Built motion from commit d824bffd.|2.6.11
authorsupport <support@xcally.com>
Tue, 21 Jun 2022 08:38:23 +0000 (08:38 +0000)
committersupport <support@xcally.com>
Tue, 21 Jun 2022 08:38:23 +0000 (08:38 +0000)
2334 files changed:
apidoc/api_project.js
apidoc/api_project.json
legacy-libs/google-auth-library/node_modules/semver/CHANGELOG.md [new file with mode: 0644]
legacy-libs/google-auth-library/node_modules/semver/LICENSE [new file with mode: 0644]
legacy-libs/google-auth-library/node_modules/semver/README.md [new file with mode: 0644]
legacy-libs/google-auth-library/node_modules/semver/bin/semver [new file with mode: 0644]
legacy-libs/google-auth-library/node_modules/semver/package.json [new file with mode: 0644]
legacy-libs/google-auth-library/node_modules/semver/range.bnf [new file with mode: 0644]
legacy-libs/google-auth-library/node_modules/semver/semver.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/build/src/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/build/src/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials-filter.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials-filter.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-stream.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-stream.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-credentials.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-credentials.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-options.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-options.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/client.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/client.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/compression-filter.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/compression-filter.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/constants.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/constants.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/deadline-filter.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/deadline-filter.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/events.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/events.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter-stack.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter-stack.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/logging.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/logging.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/make-client.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/make-client.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata-status-filter.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata-status-filter.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/object-stream.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/object-stream.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/status-builder.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/status-builder.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/subchannel.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/subchannel.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/build/src/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/build/src/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/bench/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/bench/suite.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/float/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/array.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/emptyArray.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/emptyObject.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/object.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/path/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/path/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/path/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/path/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/path/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/path/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/index.d.ts [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/tests/data/utf8.txt [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/tests/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@types/babel-types/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/@types/babel-types/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/camelcase/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/camelcase/license [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/camelcase/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/camelcase/readme.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/cliui/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/cliui/LICENSE.txt [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/cliui/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/cliui/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/cliui/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/LICENSE.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/asyncworker.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/buffers.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/callback.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/converters.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/errors.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/json.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/maybe_types.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/methods.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/new.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/node_misc.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/object_wrappers.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/persistent.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/scopes.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/script.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/string_bytes.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/v8_internals.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/doc/v8_misc.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/include_dirs.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks_12_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks_pre_12_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_converters.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_converters_43_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_converters_pre_43_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_define_own_property_helper.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_implementation_12_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_implementation_pre_12_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_json.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_maybe_43_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_maybe_pre_43_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_new.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_object_wrap.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_persistent_12_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_persistent_pre_12_inl.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_private.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_string_bytes.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_typedarray_contents.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/nan_weak.h [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/tools/1to2.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/tools/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/nan/tools/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/bin/pbjs [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/bower.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/binary.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/json.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/proto.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/amd.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/commonjs.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/js.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/json.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/proto.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/util.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.Message.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.Service.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.Parser.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.Tokenizer.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Element.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Map.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Element.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.Value.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Extension.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.ExtensionField.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.Field.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.OneOf.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Namespace.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.Method.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.RPCMethod.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Util.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.js.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.svg [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.svg [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.svg [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.svg [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.svg [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.svg [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/index.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/linenumber.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/Apache-License-2.0.txt [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/lang-css.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/prettify.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/jsdoc-default.css [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/prettify-jsdoc.css [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/prettify-tomorrow.css [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/donate.png [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/test.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/server.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/www/example.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/www/index.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/externs/fs.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/externs/protobuf.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/jsdoc.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/protobuf.png [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/scripts/build.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Message.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Service.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto/Parser.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto/Tokenizer.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Lang.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Map.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Element.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum/Value.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Extension.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/ExtensionField.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/Field.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/OneOf.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Namespace.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/Method.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/RPCMethod.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/T.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Util.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/bower.json.in [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/es5.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/descriptor.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/descriptor.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/protobuf.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/src/wrap.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/PingExample.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/T139.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/T263.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/annotations.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/bench.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/bench.txt [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/camelcase.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/comments.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/complex.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/complex.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/custom-options.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/custom-options.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/common.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/dep1.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/dep2.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/main.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example1.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example1u.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example2.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example3.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example4.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example5.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/extend.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/extend.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/field_name_same_as_package/main.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/field_name_same_as_package/sub.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/google/protobuf/descriptor.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/groups.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file1.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file2.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file3.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_a.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_a_single_quote.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_b.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_common.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports-toplevel.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports-weak.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/inner.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/negid.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.css [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/numberformats.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/oneof.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/optional.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/options.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/options.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/packed.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Bar.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Bar.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Foo.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto3.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/protobufnet.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/repeated.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/services.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/setarray.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/string_single_quote.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/suite.html [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/suite.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/toplevel.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/protobufjs/tests/x64.proto [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/window-size/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/window-size/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/window-size/cli.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/window-size/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/window-size/package.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/LICENSE [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/README.md [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/completion.sh.hbs [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/index.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/lib/completion.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/lib/parser.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/lib/tokenize-arg-string.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/lib/usage.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/lib/validation.js [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/de.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/en.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/es.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/fr.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/id.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/ja.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/ko.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/nb.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/pirate.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/pl.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/pt.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/pt_BR.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/tr.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/locales/zh.json [new file with mode: 0644]
legacy-libs/grpc-cloned/node_modules/yargs/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/abbrev/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/abbrev/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/abbrev/abbrev.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/abbrev/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/ansi-regex/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/ansi-regex/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/ansi-regex/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/ansi-regex/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/aproba/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/aproba/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/aproba/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/aproba/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/CHANGES.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/tracker-base.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/tracker-group.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/tracker-stream.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/are-we-there-yet/tracker.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/balanced-match/LICENSE.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/balanced-match/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/balanced-match/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/balanced-match/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/brace-expansion/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/brace-expansion/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/brace-expansion/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/brace-expansion/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/chownr/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/chownr/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/chownr/chownr.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/chownr/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/code-point-at/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/code-point-at/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/code-point-at/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/code-point-at/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/concat-map/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/concat-map/README.markdown [new file with mode: 0644]
legacy-libs/grpc/node_modules/concat-map/example/map.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/concat-map/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/concat-map/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/concat-map/test/map.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/console-control-strings/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/console-control-strings/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/console-control-strings/README.md~ [new file with mode: 0644]
legacy-libs/grpc/node_modules/console-control-strings/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/console-control-strings/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/core-util-is/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/core-util-is/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/core-util-is/float.patch [new file with mode: 0644]
legacy-libs/grpc/node_modules/core-util-is/lib/util.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/core-util-is/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/core-util-is/test.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/deep-extend/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/deep-extend/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/deep-extend/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/deep-extend/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/deep-extend/lib/deep-extend.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/deep-extend/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/History.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/License [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/Makefile [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/Readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/delegates/test/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/detect-libc/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/detect-libc/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/detect-libc/bin/detect-libc.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/detect-libc/lib/detect-libc.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/detect-libc/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs-minipass/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs-minipass/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs-minipass/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs-minipass/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs.realpath/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs.realpath/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs.realpath/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs.realpath/old.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/fs.realpath/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/base-theme.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/error.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/has-color.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/plumbing.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/process.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/progress-bar.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/render-template.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/set-immediate.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/set-interval.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/spin.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/template-item.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/theme-set.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/themes.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/gauge/wide-truncate.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/has-unicode/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/has-unicode/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/has-unicode/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/has-unicode/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/Changelog.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/dbcs-codec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/dbcs-data.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/internal.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-codec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-data-generated.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-data.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/big5-added.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp936.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp949.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp950.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/eucjp.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/gbk-added.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/shiftjis.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/utf16.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/encodings/utf7.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/lib/bom-handling.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/lib/extend-node.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/lib/index.d.ts [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/lib/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/lib/streams.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/iconv-lite/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/ignore-walk/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/ignore-walk/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/ignore-walk/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/ignore-walk/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/inflight/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/inflight/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/inflight/inflight.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/inflight/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/inherits/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/inherits/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/inherits/inherits.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/inherits/inherits_browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/inherits/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/ini/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/ini/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/ini/ini.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/ini/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/is-fullwidth-code-point/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/is-fullwidth-code-point/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/is-fullwidth-code-point/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/is-fullwidth-code-point/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/isarray/Makefile [new file with mode: 0644]
legacy-libs/grpc/node_modules/isarray/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/isarray/component.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/isarray/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/isarray/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/isarray/test.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimatch/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimatch/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimatch/minimatch.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimatch/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/example/parse.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/readme.markdown [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/all_bool.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/bool.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/dash.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/default_bool.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/dotted.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/kv_short.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/long.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/num.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/parse.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/parse_modified.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/short.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/stop_early.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/unknown.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minimist/test/whitespace.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minipass/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/minipass/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/minipass/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minipass/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/minizlib/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/minizlib/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/minizlib/constants.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minizlib/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/minizlib/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/bin/cmd.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/bin/usage.txt [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/examples/pow.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/example/parse.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/readme.markdown [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/dash.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/default_bool.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/dotted.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/long.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/parse.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/short.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/whitespace.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/readme.markdown [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/chmod.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/clobber.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/mkdirp.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/opts_fs.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/opts_fs_sync.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/perm.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/perm_sync.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/race.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/rel.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/return.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/return_sync.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/root.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/sync.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/umask.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/mkdirp/test/umask_sync.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/bin/needle [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/deflated-stream.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/digest-auth.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/download-to-file.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/multipart-stream.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/parsed-stream.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/parsed-stream2.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/stream-events.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/stream-to-file.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/examples/upload-image.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/auth.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/cookies.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/decoder.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/multipart.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/needle.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/parsers.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/lib/querystring.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/license.txt [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/node.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/src/browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/src/common.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/src/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/debug/src/node.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/ms/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/ms/license.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/ms/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/node_modules/ms/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/basic_auth_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/compression_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/cookies_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/decoder_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/errors_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/headers_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/helpers.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/long_string_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/output_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/parsing_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/post_data_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/proxy_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/querystring_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/redirect_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/redirect_with_timeout.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/request_stream_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/response_stream_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/socket_pool_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/url_spec.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/utils/formidable.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/utils/proxy.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/needle/test/utils/test.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/appveyor.yml [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp.cmd [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/contributing.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/build.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/clean.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/configure.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/info.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/install.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/node-pre-gyp.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/package.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/pre-binding.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/publish.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/rebuild.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/reinstall.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/reveal.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/testbinary.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/testpackage.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/unpublish.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/compile.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/napi.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/s3_setup.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/versioning.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/node-pre-gyp/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/bin/nopt.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/examples/my-program.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/lib/nopt.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/nopt/test/basic.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-bundled/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-bundled/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-bundled/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-bundled/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-packlist/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-packlist/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-packlist/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/npm-packlist/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/npmlog/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/npmlog/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/npmlog/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/npmlog/log.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/npmlog/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/number-is-nan/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/number-is-nan/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/number-is-nan/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/number-is-nan/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/object-assign/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/object-assign/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/object-assign/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/object-assign/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/once/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/once/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/once/once.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/once/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-homedir/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-homedir/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-homedir/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-homedir/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-tmpdir/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-tmpdir/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-tmpdir/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/os-tmpdir/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/osenv/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/osenv/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/osenv/osenv.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/osenv/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/path-is-absolute/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/path-is-absolute/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/path-is-absolute/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/path-is-absolute/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/process-nextick-args/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/process-nextick-args/license.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/process-nextick-args/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/process-nextick-args/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/bin/pbjs [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/bower.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/binary.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/json.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/proto.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/amd.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/commonjs.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/js.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/json.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/proto.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/util.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.Message.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.Service.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.Parser.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.Tokenizer.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Element.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Map.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Element.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.Value.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Extension.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.ExtensionField.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.Field.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.OneOf.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Namespace.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.Method.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.RPCMethod.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Util.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.js.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.svg [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.svg [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.svg [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.svg [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.svg [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.svg [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/index.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/scripts/linenumber.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/Apache-License-2.0.txt [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/lang-css.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/prettify.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/styles/jsdoc-default.css [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/styles/prettify-jsdoc.css [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/docs/styles/prettify-tomorrow.css [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/donate.png [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/protoify/test.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/websocket/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/websocket/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/websocket/server.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/websocket/www/example.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/examples/websocket/www/index.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/externs/fs.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/externs/protobuf.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/jsdoc.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/protobuf.png [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/scripts/build.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Message.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Service.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto/Parser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto/Tokenizer.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Lang.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Map.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Element.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum/Value.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Extension.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/ExtensionField.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/Field.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/OneOf.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Namespace.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/Method.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/RPCMethod.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/T.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Util.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/bower.json.in [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/es5.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/descriptor.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/descriptor.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/protobuf.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/src/wrap.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/PingExample.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/T139.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/T263.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/annotations.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/bench.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/bench.txt [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/camelcase.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/comments.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/complex.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/complex.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/custom-options.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/custom-options.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/common.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/dep1.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/dep2.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/main.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/example1.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/example1u.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/example2.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/example3.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/example4.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/example5.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/extend.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/extend.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/field_name_same_as_package/main.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/field_name_same_as_package/sub.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/google/protobuf/descriptor.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/groups.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file1.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file2.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file3.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/import_a.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/import_a_single_quote.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/import_b.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/import_common.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/imports-toplevel.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/imports-weak.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/imports.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/imports.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/inner.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/negid.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.css [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/numberformats.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/oneof.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/optional.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/options.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/options.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/packed.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Bar.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Bar.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Foo.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/proto3.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/protobufnet.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/repeated.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/services.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/setarray.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/string_single_quote.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/suite.html [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/suite.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/toplevel.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/protobufjs/tests/x64.proto [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/LICENSE.APACHE2 [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/LICENSE.BSD [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/LICENSE.MIT [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/cli.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/lib/utils.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/test/ini.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/test/nested-env-vars.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rc/test/test.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/CONTRIBUTING.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/GOVERNANCE.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/duplex-browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/duplex.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/_stream_duplex.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/_stream_passthrough.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/_stream_readable.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/_stream_transform.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/_stream_writable.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/BufferList.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/destroy.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/stream-browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/stream.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/passthrough.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/readable-browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/readable.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/transform.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/writable-browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/readable-stream/writable.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/bin.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/changelog.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/common.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/glob.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/node_modules/glob/sync.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/rimraf/rimraf.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/safe-buffer/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/safe-buffer/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/safe-buffer/index.d.ts [new file with mode: 0644]
legacy-libs/grpc/node_modules/safe-buffer/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/safe-buffer/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/Porting-Buffer.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/Readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/dangerous.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/safer.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/safer-buffer/tests.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/sax/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/sax/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/sax/lib/sax.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/sax/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/bin/semver [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/range.bnf [new file with mode: 0644]
legacy-libs/grpc/node_modules/semver/semver.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/set-blocking/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/set-blocking/LICENSE.txt [new file with mode: 0644]
legacy-libs/grpc/node_modules/set-blocking/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/set-blocking/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/set-blocking/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/signal-exit/CHANGELOG.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/signal-exit/LICENSE.txt [new file with mode: 0644]
legacy-libs/grpc/node_modules/signal-exit/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/signal-exit/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/signal-exit/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/signal-exit/signals.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/string-width/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/string-width/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/string-width/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/string-width/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/string_decoder/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/string_decoder/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/string_decoder/lib/string_decoder.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/string_decoder/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-ansi/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-ansi/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-ansi/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-ansi/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-json-comments/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-json-comments/license [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-json-comments/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/strip-json-comments/readme.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/index.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/buffer.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/create.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/extract.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/header.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/high-level-opt.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/large-numbers.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/list.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/mkdir.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/mode-fix.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/pack.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/parse.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/pax.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/read-entry.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/replace.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/types.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/unpack.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/update.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/warn-mixin.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/winchars.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/lib/write-entry.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/tar/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/util-deprecate/History.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/util-deprecate/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/util-deprecate/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/util-deprecate/browser.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/util-deprecate/node.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/util-deprecate/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/wide-align/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/wide-align/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/wide-align/align.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/wide-align/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/wrappy/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/wrappy/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/wrappy/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/wrappy/wrappy.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/yallist/LICENSE [new file with mode: 0644]
legacy-libs/grpc/node_modules/yallist/README.md [new file with mode: 0644]
legacy-libs/grpc/node_modules/yallist/iterator.js [new file with mode: 0644]
legacy-libs/grpc/node_modules/yallist/package.json [new file with mode: 0644]
legacy-libs/grpc/node_modules/yallist/yallist.js [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/LICENSE [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/README.md [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/assert.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/async_hooks.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/base.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/buffer.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/child_process.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/cluster.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/console.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/constants.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/crypto.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/dgram.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/dns.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/domain.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/events.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/fs.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/globals.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/globals.global.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/http.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/http2.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/https.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/index.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/inspector.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/module.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/net.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/os.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/package.json [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/path.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/perf_hooks.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/process.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/punycode.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/querystring.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/readline.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/repl.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/stream.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/string_decoder.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/timers.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/tls.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/trace_events.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/ts3.4/assert.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/ts3.4/base.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/ts3.4/globals.global.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/ts3.4/index.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/ts3.6/base.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/ts3.6/index.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/tty.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/url.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/util.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/v8.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/vm.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/wasi.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/worker_threads.d.ts [new file with mode: 0644]
legacy-libs/protobufjs/node_modules/@types/node/zlib.d.ts [new file with mode: 0644]
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.events.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmContactHasItem/cmContactHasItem.attributes.js
server/api/cmContactHasItem/cmContactHasItem.controller.js
server/api/cmContactHasItem/cmContactHasItem.model.js
server/api/cmContactHasItem/cmContactHasItem.rpc.js
server/api/cmContactHasItem/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
server/api/cmHopperAdditionalPhone/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/contactItemType/contactItemType.attributes.js
server/api/contactItemType/contactItemType.controller.js
server/api/contactItemType/contactItemType.model.js
server/api/contactItemType/contactItemType.rpc.js
server/api/contactItemType/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.events.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/contacts/index.js
server/components/contacts/sql-utils.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/import/cm/csvUpdates.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/interaction/sql-utils.js
server/components/interaction/update-interaction.js
server/components/interaction/utils.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/components/realtime/agents.js
server/components/realtime/queues.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/cloud-provider.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/schedule/whatsapp.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/api.js
server/errors/index.js
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/events.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/project.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/index.js
server/services/ami/dialer/models/action.js
server/services/ami/dialer/models/agentComplete.js
server/services/ami/dialer/models/final.js
server/services/ami/dialer/models/hangup.js
server/services/ami/dialer/models/history.js
server/services/ami/dialer/models/queueCallerAbandon.js
server/services/ami/dialer/utils/hopper.js
server/services/ami/dialer/utils/index.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/voiceQueueSummary.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/realtime/utils.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperAdditionalPhone.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/interval.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/tvox.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
server/utils/client-side-logger.js
server/utils/iftime.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index 15c992c..9d8f856 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-06-21T07:33:12.595Z",
+    "time": "2022-06-21T08:30:10.520Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index ea2b315..f60df4d 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-06-21T07:33:12.595Z",
+    "time": "2022-06-21T08:30:10.520Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
diff --git a/legacy-libs/google-auth-library/node_modules/semver/CHANGELOG.md b/legacy-libs/google-auth-library/node_modules/semver/CHANGELOG.md
new file mode 100644 (file)
index 0000000..66304fd
--- /dev/null
@@ -0,0 +1,39 @@
+# changes log
+
+## 5.7
+
+* Add `minVersion` method
+
+## 5.6
+
+* Move boolean `loose` param to an options object, with
+  backwards-compatibility protection.
+* Add ability to opt out of special prerelease version handling with
+  the `includePrerelease` option flag.
+
+## 5.5
+
+* Add version coercion capabilities
+
+## 5.4
+
+* Add intersection checking
+
+## 5.3
+
+* Add `minSatisfying` method
+
+## 5.2
+
+* Add `prerelease(v)` that returns prerelease components
+
+## 5.1
+
+* Add Backus-Naur for ranges
+* Remove excessively cute inspection methods
+
+## 5.0
+
+* Remove AMD/Browserified build artifacts
+* Fix ltr and gtr when using the `*` range
+* Fix for range `*` with a prerelease identifier
diff --git a/legacy-libs/google-auth-library/node_modules/semver/LICENSE b/legacy-libs/google-auth-library/node_modules/semver/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/google-auth-library/node_modules/semver/README.md b/legacy-libs/google-auth-library/node_modules/semver/README.md
new file mode 100644 (file)
index 0000000..f8dfa5a
--- /dev/null
@@ -0,0 +1,412 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install --save semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean('  =v1.2.3   ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] <version> [<version> [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range <range>
+        Print versions that match the specified range.
+
+-i --increment [<level>]
+        Increment a version by the specified level.  Level can
+        be one of: major, minor, patch, premajor, preminor,
+        prepatch, or prerelease.  Default level is 'patch'.
+        Only one version may be specified.
+
+--preid <identifier>
+        Identifier to be used to prefix premajor, preminor,
+        prepatch or prerelease version increments.
+
+-l --loose
+        Interpret versions and ranges loosely
+
+-p --include-prerelease
+        Always include prerelease versions in range matching
+
+-c --coerce
+        Coerce a string into SemVer if possible
+        (does not imply --loose)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+<https://semver.org/>.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`.  The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal.  If no operator is specified, then equality is assumed,
+  so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`.  A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules.  The version
+range only accepts prerelease tags on the `1.2.3` version.  The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold.  First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions.  By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk.  However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any version satisfies)
+* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator.  Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+  the `1.2.3` version will be allowed, if they are greater than or
+  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
+  `1.2.4-beta.2` would not, because it is a prerelease of a
+  different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero digit in the
+`[major, minor, patch]` tuple.  In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`.  It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0`
+* `^0.2.3` := `>=0.2.3 <0.3.0`
+* `^0.0.3` := `>=0.0.3 <0.0.4`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+  the `1.2.3` version will be allowed, if they are greater than or
+  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
+  `1.2.4-beta.2` would not, because it is a prerelease of a
+  different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4`  Note that prereleases in the
+  `0.0.3` version *only* will be allowed, if they are greater than or
+  equal to `beta`.  So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0`
+* `^0.0.x` := `>=0.0.0 <0.1.0`
+* `^0.0` := `>=0.0.0 <0.1.0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0`
+* `^0.x` := `>=0.0.0 <1.0.0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set  ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range      ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen     ::= partial ' - ' partial
+simple     ::= primitive | partial | tilde | caret
+primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr         ::= 'x' | 'X' | '*' | nr
+nr         ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde      ::= '~' partial
+caret      ::= '^' partial
+qualifier  ::= ( '-' pre )? ( '+' build )?
+pre        ::= parts
+build      ::= parts
+parts      ::= part ( '.' part ) *
+part       ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument.  All
+options in this object are `false` by default.  The options supported
+are:
+
+- `loose`  Be more forgiving about not-quite-valid semver strings.
+  (Any resulting output will always be 100% strict compliant, of
+  course.)  For backwards compatibility reasons, if the `options`
+  argument is a boolean value instead of an object, it is interpreted
+  to be the `loose` param.
+- `includePrerelease`  Set to suppress the [default
+  behavior](https://github.com/npm/node-semver#prerelease-tags) of
+  excluding prerelease tagged versions from ranges unless they are
+  explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+  type (`major`,   `premajor`, `minor`, `preminor`, `patch`,
+  `prepatch`, or `prerelease`), or null if it's not valid
+  * `premajor` in one call will bump the version up to the next major
+    version and down to a prerelease of that major version.
+    `preminor`, and `prepatch` work the same way.
+  * If called from a non-prerelease version, the `prerelease` will work the
+    same as `prepatch`. It increments the patch version, then makes a
+    prerelease. If the input version is already a prerelease it simply
+    increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+  if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+  or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+  a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+  even if they're not the exact same string.  You already know how to
+  compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+  the corresponding function above.  `"==="` and `"!=="` do simple
+  string comparison, but are included for completeness.  Throws if an
+  invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+  `v2` is greater.  Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare.  Sorts an array of versions
+  in descending order when passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+  (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+  or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+  range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+  that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+  that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+  the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+  versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+  versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+  the bounds of the range in either the high or low direction.  The
+  `hilo` argument must be either the string `'>'` or `'<'`.  (This is
+  the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range!  For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver string to
+semver. It looks for the first digit in a string, and consumes all
+remaining characters which satisfy at least a partial semver (e.g., `1`,
+`1.2`, `1.2.3`) up to the max permitted length (256 characters).  Longer
+versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`).  All
+surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
+`3.4.0`).  Only text which lacks digits will fail coercion (`version one`
+is not valid).  The maximum  length for any semver component considered for
+coercion is 16 characters; longer components will be ignored
+(`10000000000000000.4.7.4` becomes `4.7.4`).  The maximum value for any
+semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
+components are invalid (`9999999999999999.4.7.4` is likely invalid).
diff --git a/legacy-libs/google-auth-library/node_modules/semver/bin/semver b/legacy-libs/google-auth-library/node_modules/semver/bin/semver
new file mode 100644 (file)
index 0000000..801e77f
--- /dev/null
@@ -0,0 +1,160 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+
+var versions = []
+
+var range = []
+
+var inc = null
+
+var version = require('../package.json').version
+
+var loose = false
+
+var includePrerelease = false
+
+var coerce = false
+
+var identifier
+
+var semver = require('../semver')
+
+var reverse = false
+
+var options = {}
+
+main()
+
+function main () {
+  if (!argv.length) return help()
+  while (argv.length) {
+    var a = argv.shift()
+    var indexOfEqualSign = a.indexOf('=')
+    if (indexOfEqualSign !== -1) {
+      a = a.slice(0, indexOfEqualSign)
+      argv.unshift(a.slice(indexOfEqualSign + 1))
+    }
+    switch (a) {
+      case '-rv': case '-rev': case '--rev': case '--reverse':
+        reverse = true
+        break
+      case '-l': case '--loose':
+        loose = true
+        break
+      case '-p': case '--include-prerelease':
+        includePrerelease = true
+        break
+      case '-v': case '--version':
+        versions.push(argv.shift())
+        break
+      case '-i': case '--inc': case '--increment':
+        switch (argv[0]) {
+          case 'major': case 'minor': case 'patch': case 'prerelease':
+          case 'premajor': case 'preminor': case 'prepatch':
+            inc = argv.shift()
+            break
+          default:
+            inc = 'patch'
+            break
+        }
+        break
+      case '--preid':
+        identifier = argv.shift()
+        break
+      case '-r': case '--range':
+        range.push(argv.shift())
+        break
+      case '-c': case '--coerce':
+        coerce = true
+        break
+      case '-h': case '--help': case '-?':
+        return help()
+      default:
+        versions.push(a)
+        break
+    }
+  }
+
+  var options = { loose: loose, includePrerelease: includePrerelease }
+
+  versions = versions.map(function (v) {
+    return coerce ? (semver.coerce(v) || { version: v }).version : v
+  }).filter(function (v) {
+    return semver.valid(v)
+  })
+  if (!versions.length) return fail()
+  if (inc && (versions.length !== 1 || range.length)) { return failInc() }
+
+  for (var i = 0, l = range.length; i < l; i++) {
+    versions = versions.filter(function (v) {
+      return semver.satisfies(v, range[i], options)
+    })
+    if (!versions.length) return fail()
+  }
+  return success(versions)
+}
+
+function failInc () {
+  console.error('--inc can only be used on a single version with no range')
+  fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+  var compare = reverse ? 'rcompare' : 'compare'
+  versions.sort(function (a, b) {
+    return semver[compare](a, b, options)
+  }).map(function (v) {
+    return semver.clean(v, options)
+  }).map(function (v) {
+    return inc ? semver.inc(v, inc, options, identifier) : v
+  }).forEach(function (v, i, _) { console.log(v) })
+}
+
+function help () {
+  console.log(['SemVer ' + version,
+    '',
+    'A JavaScript implementation of the https://semver.org/ specification',
+    'Copyright Isaac Z. Schlueter',
+    '',
+    'Usage: semver [options] <version> [<version> [...]]',
+    'Prints valid versions sorted by SemVer precedence',
+    '',
+    'Options:',
+    '-r --range <range>',
+    '        Print versions that match the specified range.',
+    '',
+    '-i --increment [<level>]',
+    '        Increment a version by the specified level.  Level can',
+    '        be one of: major, minor, patch, premajor, preminor,',
+    "        prepatch, or prerelease.  Default level is 'patch'.",
+    '        Only one version may be specified.',
+    '',
+    '--preid <identifier>',
+    '        Identifier to be used to prefix premajor, preminor,',
+    '        prepatch or prerelease version increments.',
+    '',
+    '-l --loose',
+    '        Interpret versions and ranges loosely',
+    '',
+    '-p --include-prerelease',
+    '        Always include prerelease versions in range matching',
+    '',
+    '-c --coerce',
+    '        Coerce a string into SemVer if possible',
+    '        (does not imply --loose)',
+    '',
+    'Program exits successfully if any valid version satisfies',
+    'all supplied ranges, and prints all satisfying versions.',
+    '',
+    'If no satisfying versions are found, then exits failure.',
+    '',
+    'Versions are printed in ascending order, so supplying',
+    'multiple versions to the utility will just sort them.'
+  ].join('\n'))
+}
diff --git a/legacy-libs/google-auth-library/node_modules/semver/package.json b/legacy-libs/google-auth-library/node_modules/semver/package.json
new file mode 100644 (file)
index 0000000..b43d344
--- /dev/null
@@ -0,0 +1,60 @@
+{
+  "_from": "semver@^5.5.0",
+  "_id": "semver@5.7.1",
+  "_inBundle": false,
+  "_integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+  "_location": "/google-auth-library/semver",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "semver@^5.5.0",
+    "name": "semver",
+    "escapedName": "semver",
+    "rawSpec": "^5.5.0",
+    "saveSpec": null,
+    "fetchSpec": "^5.5.0"
+  },
+  "_requiredBy": [
+    "/google-auth-library"
+  ],
+  "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+  "_shasum": "a954f931aeba508d307bbf069eff0c01c96116f7",
+  "_spec": "semver@^5.5.0",
+  "_where": "/home/vito/Development/MOTION_V2/CUSTOM_PKGS/dfnode8/node_modules/google-auth-library",
+  "bin": {
+    "semver": "bin/semver"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/node-semver/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "The semantic version parser used by npm.",
+  "devDependencies": {
+    "tap": "^13.0.0-rc.18"
+  },
+  "files": [
+    "bin",
+    "range.bnf",
+    "semver.js"
+  ],
+  "homepage": "https://github.com/npm/node-semver#readme",
+  "license": "ISC",
+  "main": "semver.js",
+  "name": "semver",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/node-semver.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap"
+  },
+  "tap": {
+    "check-coverage": true
+  },
+  "version": "5.7.1"
+}
diff --git a/legacy-libs/google-auth-library/node_modules/semver/range.bnf b/legacy-libs/google-auth-library/node_modules/semver/range.bnf
new file mode 100644 (file)
index 0000000..d4c6ae0
--- /dev/null
@@ -0,0 +1,16 @@
+range-set  ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range      ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen     ::= partial ' - ' partial
+simple     ::= primitive | partial | tilde | caret
+primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr         ::= 'x' | 'X' | '*' | nr
+nr         ::= '0' | [1-9] ( [0-9] ) *
+tilde      ::= '~' partial
+caret      ::= '^' partial
+qualifier  ::= ( '-' pre )? ( '+' build )?
+pre        ::= parts
+build      ::= parts
+parts      ::= part ( '.' part ) *
+part       ::= nr | [-0-9A-Za-z]+
diff --git a/legacy-libs/google-auth-library/node_modules/semver/semver.js b/legacy-libs/google-auth-library/node_modules/semver/semver.js
new file mode 100644 (file)
index 0000000..d315d5d
--- /dev/null
@@ -0,0 +1,1483 @@
+exports = module.exports = SemVer
+
+var debug
+/* istanbul ignore next */
+if (typeof process === 'object' &&
+    process.env &&
+    process.env.NODE_DEBUG &&
+    /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+  debug = function () {
+    var args = Array.prototype.slice.call(arguments, 0)
+    args.unshift('SEMVER')
+    console.log.apply(console, args)
+  }
+} else {
+  debug = function () {}
+}
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0'
+
+var MAX_LENGTH = 256
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+  /* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+var MAX_SAFE_COMPONENT_LENGTH = 16
+
+// The actual regexps go on exports.re
+var re = exports.re = []
+var src = exports.src = []
+var R = 0
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+var NUMERICIDENTIFIER = R++
+src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
+var NUMERICIDENTIFIERLOOSE = R++
+src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+var NONNUMERICIDENTIFIER = R++
+src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+var MAINVERSION = R++
+src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+                   '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+                   '(' + src[NUMERICIDENTIFIER] + ')'
+
+var MAINVERSIONLOOSE = R++
+src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+var PRERELEASEIDENTIFIER = R++
+src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
+                            '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+var PRERELEASEIDENTIFIERLOOSE = R++
+src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
+                                 '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+var PRERELEASE = R++
+src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
+                  '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
+
+var PRERELEASELOOSE = R++
+src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
+                       '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+var BUILDIDENTIFIER = R++
+src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+var BUILD = R++
+src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
+             '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups.  The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+var FULL = R++
+var FULLPLAIN = 'v?' + src[MAINVERSION] +
+                src[PRERELEASE] + '?' +
+                src[BUILD] + '?'
+
+src[FULL] = '^' + FULLPLAIN + '$'
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
+                 src[PRERELEASELOOSE] + '?' +
+                 src[BUILD] + '?'
+
+var LOOSE = R++
+src[LOOSE] = '^' + LOOSEPLAIN + '$'
+
+var GTLT = R++
+src[GTLT] = '((?:<|>)?=?)'
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+var XRANGEIDENTIFIERLOOSE = R++
+src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
+var XRANGEIDENTIFIER = R++
+src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
+
+var XRANGEPLAIN = R++
+src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
+                   '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+                   '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+                   '(?:' + src[PRERELEASE] + ')?' +
+                   src[BUILD] + '?' +
+                   ')?)?'
+
+var XRANGEPLAINLOOSE = R++
+src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+                        '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+                        '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+                        '(?:' + src[PRERELEASELOOSE] + ')?' +
+                        src[BUILD] + '?' +
+                        ')?)?'
+
+var XRANGE = R++
+src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
+var XRANGELOOSE = R++
+src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+var COERCE = R++
+src[COERCE] = '(?:^|[^\\d])' +
+              '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
+              '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+              '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+              '(?:$|[^\\d])'
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+var LONETILDE = R++
+src[LONETILDE] = '(?:~>?)'
+
+var TILDETRIM = R++
+src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
+re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
+var tildeTrimReplace = '$1~'
+
+var TILDE = R++
+src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
+var TILDELOOSE = R++
+src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+var LONECARET = R++
+src[LONECARET] = '(?:\\^)'
+
+var CARETTRIM = R++
+src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
+re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
+var caretTrimReplace = '$1^'
+
+var CARET = R++
+src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
+var CARETLOOSE = R++
+src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+var COMPARATORLOOSE = R++
+src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
+var COMPARATOR = R++
+src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+var COMPARATORTRIM = R++
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
+                      '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
+
+// this one has to use the /g flag
+re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
+var comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+var HYPHENRANGE = R++
+src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
+                   '\\s+-\\s+' +
+                   '(' + src[XRANGEPLAIN] + ')' +
+                   '\\s*$'
+
+var HYPHENRANGELOOSE = R++
+src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
+                        '\\s+-\\s+' +
+                        '(' + src[XRANGEPLAINLOOSE] + ')' +
+                        '\\s*$'
+
+// Star ranges basically just allow anything at all.
+var STAR = R++
+src[STAR] = '(<|>)?=?\\s*\\*'
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+  debug(i, src[i])
+  if (!re[i]) {
+    re[i] = new RegExp(src[i])
+  }
+}
+
+exports.parse = parse
+function parse (version, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  if (version instanceof SemVer) {
+    return version
+  }
+
+  if (typeof version !== 'string') {
+    return null
+  }
+
+  if (version.length > MAX_LENGTH) {
+    return null
+  }
+
+  var r = options.loose ? re[LOOSE] : re[FULL]
+  if (!r.test(version)) {
+    return null
+  }
+
+  try {
+    return new SemVer(version, options)
+  } catch (er) {
+    return null
+  }
+}
+
+exports.valid = valid
+function valid (version, options) {
+  var v = parse(version, options)
+  return v ? v.version : null
+}
+
+exports.clean = clean
+function clean (version, options) {
+  var s = parse(version.trim().replace(/^[=v]+/, ''), options)
+  return s ? s.version : null
+}
+
+exports.SemVer = SemVer
+
+function SemVer (version, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+  if (version instanceof SemVer) {
+    if (version.loose === options.loose) {
+      return version
+    } else {
+      version = version.version
+    }
+  } else if (typeof version !== 'string') {
+    throw new TypeError('Invalid Version: ' + version)
+  }
+
+  if (version.length > MAX_LENGTH) {
+    throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+  }
+
+  if (!(this instanceof SemVer)) {
+    return new SemVer(version, options)
+  }
+
+  debug('SemVer', version, options)
+  this.options = options
+  this.loose = !!options.loose
+
+  var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
+
+  if (!m) {
+    throw new TypeError('Invalid Version: ' + version)
+  }
+
+  this.raw = version
+
+  // these are actually numbers
+  this.major = +m[1]
+  this.minor = +m[2]
+  this.patch = +m[3]
+
+  if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+    throw new TypeError('Invalid major version')
+  }
+
+  if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+    throw new TypeError('Invalid minor version')
+  }
+
+  if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+    throw new TypeError('Invalid patch version')
+  }
+
+  // numberify any prerelease numeric ids
+  if (!m[4]) {
+    this.prerelease = []
+  } else {
+    this.prerelease = m[4].split('.').map(function (id) {
+      if (/^[0-9]+$/.test(id)) {
+        var num = +id
+        if (num >= 0 && num < MAX_SAFE_INTEGER) {
+          return num
+        }
+      }
+      return id
+    })
+  }
+
+  this.build = m[5] ? m[5].split('.') : []
+  this.format()
+}
+
+SemVer.prototype.format = function () {
+  this.version = this.major + '.' + this.minor + '.' + this.patch
+  if (this.prerelease.length) {
+    this.version += '-' + this.prerelease.join('.')
+  }
+  return this.version
+}
+
+SemVer.prototype.toString = function () {
+  return this.version
+}
+
+SemVer.prototype.compare = function (other) {
+  debug('SemVer.compare', this.version, this.options, other)
+  if (!(other instanceof SemVer)) {
+    other = new SemVer(other, this.options)
+  }
+
+  return this.compareMain(other) || this.comparePre(other)
+}
+
+SemVer.prototype.compareMain = function (other) {
+  if (!(other instanceof SemVer)) {
+    other = new SemVer(other, this.options)
+  }
+
+  return compareIdentifiers(this.major, other.major) ||
+         compareIdentifiers(this.minor, other.minor) ||
+         compareIdentifiers(this.patch, other.patch)
+}
+
+SemVer.prototype.comparePre = function (other) {
+  if (!(other instanceof SemVer)) {
+    other = new SemVer(other, this.options)
+  }
+
+  // NOT having a prerelease is > having one
+  if (this.prerelease.length && !other.prerelease.length) {
+    return -1
+  } else if (!this.prerelease.length && other.prerelease.length) {
+    return 1
+  } else if (!this.prerelease.length && !other.prerelease.length) {
+    return 0
+  }
+
+  var i = 0
+  do {
+    var a = this.prerelease[i]
+    var b = other.prerelease[i]
+    debug('prerelease compare', i, a, b)
+    if (a === undefined && b === undefined) {
+      return 0
+    } else if (b === undefined) {
+      return 1
+    } else if (a === undefined) {
+      return -1
+    } else if (a === b) {
+      continue
+    } else {
+      return compareIdentifiers(a, b)
+    }
+  } while (++i)
+}
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function (release, identifier) {
+  switch (release) {
+    case 'premajor':
+      this.prerelease.length = 0
+      this.patch = 0
+      this.minor = 0
+      this.major++
+      this.inc('pre', identifier)
+      break
+    case 'preminor':
+      this.prerelease.length = 0
+      this.patch = 0
+      this.minor++
+      this.inc('pre', identifier)
+      break
+    case 'prepatch':
+      // If this is already a prerelease, it will bump to the next version
+      // drop any prereleases that might already exist, since they are not
+      // relevant at this point.
+      this.prerelease.length = 0
+      this.inc('patch', identifier)
+      this.inc('pre', identifier)
+      break
+    // If the input is a non-prerelease version, this acts the same as
+    // prepatch.
+    case 'prerelease':
+      if (this.prerelease.length === 0) {
+        this.inc('patch', identifier)
+      }
+      this.inc('pre', identifier)
+      break
+
+    case 'major':
+      // If this is a pre-major version, bump up to the same major version.
+      // Otherwise increment major.
+      // 1.0.0-5 bumps to 1.0.0
+      // 1.1.0 bumps to 2.0.0
+      if (this.minor !== 0 ||
+          this.patch !== 0 ||
+          this.prerelease.length === 0) {
+        this.major++
+      }
+      this.minor = 0
+      this.patch = 0
+      this.prerelease = []
+      break
+    case 'minor':
+      // If this is a pre-minor version, bump up to the same minor version.
+      // Otherwise increment minor.
+      // 1.2.0-5 bumps to 1.2.0
+      // 1.2.1 bumps to 1.3.0
+      if (this.patch !== 0 || this.prerelease.length === 0) {
+        this.minor++
+      }
+      this.patch = 0
+      this.prerelease = []
+      break
+    case 'patch':
+      // If this is not a pre-release version, it will increment the patch.
+      // If it is a pre-release it will bump up to the same patch version.
+      // 1.2.0-5 patches to 1.2.0
+      // 1.2.0 patches to 1.2.1
+      if (this.prerelease.length === 0) {
+        this.patch++
+      }
+      this.prerelease = []
+      break
+    // This probably shouldn't be used publicly.
+    // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+    case 'pre':
+      if (this.prerelease.length === 0) {
+        this.prerelease = [0]
+      } else {
+        var i = this.prerelease.length
+        while (--i >= 0) {
+          if (typeof this.prerelease[i] === 'number') {
+            this.prerelease[i]++
+            i = -2
+          }
+        }
+        if (i === -1) {
+          // didn't increment anything
+          this.prerelease.push(0)
+        }
+      }
+      if (identifier) {
+        // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+        // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+        if (this.prerelease[0] === identifier) {
+          if (isNaN(this.prerelease[1])) {
+            this.prerelease = [identifier, 0]
+          }
+        } else {
+          this.prerelease = [identifier, 0]
+        }
+      }
+      break
+
+    default:
+      throw new Error('invalid increment argument: ' + release)
+  }
+  this.format()
+  this.raw = this.version
+  return this
+}
+
+exports.inc = inc
+function inc (version, release, loose, identifier) {
+  if (typeof (loose) === 'string') {
+    identifier = loose
+    loose = undefined
+  }
+
+  try {
+    return new SemVer(version, loose).inc(release, identifier).version
+  } catch (er) {
+    return null
+  }
+}
+
+exports.diff = diff
+function diff (version1, version2) {
+  if (eq(version1, version2)) {
+    return null
+  } else {
+    var v1 = parse(version1)
+    var v2 = parse(version2)
+    var prefix = ''
+    if (v1.prerelease.length || v2.prerelease.length) {
+      prefix = 'pre'
+      var defaultResult = 'prerelease'
+    }
+    for (var key in v1) {
+      if (key === 'major' || key === 'minor' || key === 'patch') {
+        if (v1[key] !== v2[key]) {
+          return prefix + key
+        }
+      }
+    }
+    return defaultResult // may be undefined
+  }
+}
+
+exports.compareIdentifiers = compareIdentifiers
+
+var numeric = /^[0-9]+$/
+function compareIdentifiers (a, b) {
+  var anum = numeric.test(a)
+  var bnum = numeric.test(b)
+
+  if (anum && bnum) {
+    a = +a
+    b = +b
+  }
+
+  return a === b ? 0
+    : (anum && !bnum) ? -1
+    : (bnum && !anum) ? 1
+    : a < b ? -1
+    : 1
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers
+function rcompareIdentifiers (a, b) {
+  return compareIdentifiers(b, a)
+}
+
+exports.major = major
+function major (a, loose) {
+  return new SemVer(a, loose).major
+}
+
+exports.minor = minor
+function minor (a, loose) {
+  return new SemVer(a, loose).minor
+}
+
+exports.patch = patch
+function patch (a, loose) {
+  return new SemVer(a, loose).patch
+}
+
+exports.compare = compare
+function compare (a, b, loose) {
+  return new SemVer(a, loose).compare(new SemVer(b, loose))
+}
+
+exports.compareLoose = compareLoose
+function compareLoose (a, b) {
+  return compare(a, b, true)
+}
+
+exports.rcompare = rcompare
+function rcompare (a, b, loose) {
+  return compare(b, a, loose)
+}
+
+exports.sort = sort
+function sort (list, loose) {
+  return list.sort(function (a, b) {
+    return exports.compare(a, b, loose)
+  })
+}
+
+exports.rsort = rsort
+function rsort (list, loose) {
+  return list.sort(function (a, b) {
+    return exports.rcompare(a, b, loose)
+  })
+}
+
+exports.gt = gt
+function gt (a, b, loose) {
+  return compare(a, b, loose) > 0
+}
+
+exports.lt = lt
+function lt (a, b, loose) {
+  return compare(a, b, loose) < 0
+}
+
+exports.eq = eq
+function eq (a, b, loose) {
+  return compare(a, b, loose) === 0
+}
+
+exports.neq = neq
+function neq (a, b, loose) {
+  return compare(a, b, loose) !== 0
+}
+
+exports.gte = gte
+function gte (a, b, loose) {
+  return compare(a, b, loose) >= 0
+}
+
+exports.lte = lte
+function lte (a, b, loose) {
+  return compare(a, b, loose) <= 0
+}
+
+exports.cmp = cmp
+function cmp (a, op, b, loose) {
+  switch (op) {
+    case '===':
+      if (typeof a === 'object')
+        a = a.version
+      if (typeof b === 'object')
+        b = b.version
+      return a === b
+
+    case '!==':
+      if (typeof a === 'object')
+        a = a.version
+      if (typeof b === 'object')
+        b = b.version
+      return a !== b
+
+    case '':
+    case '=':
+    case '==':
+      return eq(a, b, loose)
+
+    case '!=':
+      return neq(a, b, loose)
+
+    case '>':
+      return gt(a, b, loose)
+
+    case '>=':
+      return gte(a, b, loose)
+
+    case '<':
+      return lt(a, b, loose)
+
+    case '<=':
+      return lte(a, b, loose)
+
+    default:
+      throw new TypeError('Invalid operator: ' + op)
+  }
+}
+
+exports.Comparator = Comparator
+function Comparator (comp, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  if (comp instanceof Comparator) {
+    if (comp.loose === !!options.loose) {
+      return comp
+    } else {
+      comp = comp.value
+    }
+  }
+
+  if (!(this instanceof Comparator)) {
+    return new Comparator(comp, options)
+  }
+
+  debug('comparator', comp, options)
+  this.options = options
+  this.loose = !!options.loose
+  this.parse(comp)
+
+  if (this.semver === ANY) {
+    this.value = ''
+  } else {
+    this.value = this.operator + this.semver.version
+  }
+
+  debug('comp', this)
+}
+
+var ANY = {}
+Comparator.prototype.parse = function (comp) {
+  var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+  var m = comp.match(r)
+
+  if (!m) {
+    throw new TypeError('Invalid comparator: ' + comp)
+  }
+
+  this.operator = m[1]
+  if (this.operator === '=') {
+    this.operator = ''
+  }
+
+  // if it literally is just '>' or '' then allow anything.
+  if (!m[2]) {
+    this.semver = ANY
+  } else {
+    this.semver = new SemVer(m[2], this.options.loose)
+  }
+}
+
+Comparator.prototype.toString = function () {
+  return this.value
+}
+
+Comparator.prototype.test = function (version) {
+  debug('Comparator.test', version, this.options.loose)
+
+  if (this.semver === ANY) {
+    return true
+  }
+
+  if (typeof version === 'string') {
+    version = new SemVer(version, this.options)
+  }
+
+  return cmp(version, this.operator, this.semver, this.options)
+}
+
+Comparator.prototype.intersects = function (comp, options) {
+  if (!(comp instanceof Comparator)) {
+    throw new TypeError('a Comparator is required')
+  }
+
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  var rangeTmp
+
+  if (this.operator === '') {
+    rangeTmp = new Range(comp.value, options)
+    return satisfies(this.value, rangeTmp, options)
+  } else if (comp.operator === '') {
+    rangeTmp = new Range(this.value, options)
+    return satisfies(comp.semver, rangeTmp, options)
+  }
+
+  var sameDirectionIncreasing =
+    (this.operator === '>=' || this.operator === '>') &&
+    (comp.operator === '>=' || comp.operator === '>')
+  var sameDirectionDecreasing =
+    (this.operator === '<=' || this.operator === '<') &&
+    (comp.operator === '<=' || comp.operator === '<')
+  var sameSemVer = this.semver.version === comp.semver.version
+  var differentDirectionsInclusive =
+    (this.operator === '>=' || this.operator === '<=') &&
+    (comp.operator === '>=' || comp.operator === '<=')
+  var oppositeDirectionsLessThan =
+    cmp(this.semver, '<', comp.semver, options) &&
+    ((this.operator === '>=' || this.operator === '>') &&
+    (comp.operator === '<=' || comp.operator === '<'))
+  var oppositeDirectionsGreaterThan =
+    cmp(this.semver, '>', comp.semver, options) &&
+    ((this.operator === '<=' || this.operator === '<') &&
+    (comp.operator === '>=' || comp.operator === '>'))
+
+  return sameDirectionIncreasing || sameDirectionDecreasing ||
+    (sameSemVer && differentDirectionsInclusive) ||
+    oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
+}
+
+exports.Range = Range
+function Range (range, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  if (range instanceof Range) {
+    if (range.loose === !!options.loose &&
+        range.includePrerelease === !!options.includePrerelease) {
+      return range
+    } else {
+      return new Range(range.raw, options)
+    }
+  }
+
+  if (range instanceof Comparator) {
+    return new Range(range.value, options)
+  }
+
+  if (!(this instanceof Range)) {
+    return new Range(range, options)
+  }
+
+  this.options = options
+  this.loose = !!options.loose
+  this.includePrerelease = !!options.includePrerelease
+
+  // First, split based on boolean or ||
+  this.raw = range
+  this.set = range.split(/\s*\|\|\s*/).map(function (range) {
+    return this.parseRange(range.trim())
+  }, this).filter(function (c) {
+    // throw out any that are not relevant for whatever reason
+    return c.length
+  })
+
+  if (!this.set.length) {
+    throw new TypeError('Invalid SemVer Range: ' + range)
+  }
+
+  this.format()
+}
+
+Range.prototype.format = function () {
+  this.range = this.set.map(function (comps) {
+    return comps.join(' ').trim()
+  }).join('||').trim()
+  return this.range
+}
+
+Range.prototype.toString = function () {
+  return this.range
+}
+
+Range.prototype.parseRange = function (range) {
+  var loose = this.options.loose
+  range = range.trim()
+  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+  var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
+  range = range.replace(hr, hyphenReplace)
+  debug('hyphen replace', range)
+  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+  range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
+  debug('comparator trim', range, re[COMPARATORTRIM])
+
+  // `~ 1.2.3` => `~1.2.3`
+  range = range.replace(re[TILDETRIM], tildeTrimReplace)
+
+  // `^ 1.2.3` => `^1.2.3`
+  range = range.replace(re[CARETTRIM], caretTrimReplace)
+
+  // normalize spaces
+  range = range.split(/\s+/).join(' ')
+
+  // At this point, the range is completely trimmed and
+  // ready to be split into comparators.
+
+  var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+  var set = range.split(' ').map(function (comp) {
+    return parseComparator(comp, this.options)
+  }, this).join(' ').split(/\s+/)
+  if (this.options.loose) {
+    // in loose mode, throw out any that are not valid comparators
+    set = set.filter(function (comp) {
+      return !!comp.match(compRe)
+    })
+  }
+  set = set.map(function (comp) {
+    return new Comparator(comp, this.options)
+  }, this)
+
+  return set
+}
+
+Range.prototype.intersects = function (range, options) {
+  if (!(range instanceof Range)) {
+    throw new TypeError('a Range is required')
+  }
+
+  return this.set.some(function (thisComparators) {
+    return thisComparators.every(function (thisComparator) {
+      return range.set.some(function (rangeComparators) {
+        return rangeComparators.every(function (rangeComparator) {
+          return thisComparator.intersects(rangeComparator, options)
+        })
+      })
+    })
+  })
+}
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators
+function toComparators (range, options) {
+  return new Range(range, options).set.map(function (comp) {
+    return comp.map(function (c) {
+      return c.value
+    }).join(' ').trim().split(' ')
+  })
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator (comp, options) {
+  debug('comp', comp, options)
+  comp = replaceCarets(comp, options)
+  debug('caret', comp)
+  comp = replaceTildes(comp, options)
+  debug('tildes', comp)
+  comp = replaceXRanges(comp, options)
+  debug('xrange', comp)
+  comp = replaceStars(comp, options)
+  debug('stars', comp)
+  return comp
+}
+
+function isX (id) {
+  return !id || id.toLowerCase() === 'x' || id === '*'
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes (comp, options) {
+  return comp.trim().split(/\s+/).map(function (comp) {
+    return replaceTilde(comp, options)
+  }).join(' ')
+}
+
+function replaceTilde (comp, options) {
+  var r = options.loose ? re[TILDELOOSE] : re[TILDE]
+  return comp.replace(r, function (_, M, m, p, pr) {
+    debug('tilde', comp, _, M, m, p, pr)
+    var ret
+
+    if (isX(M)) {
+      ret = ''
+    } else if (isX(m)) {
+      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+    } else if (isX(p)) {
+      // ~1.2 == >=1.2.0 <1.3.0
+      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+    } else if (pr) {
+      debug('replaceTilde pr', pr)
+      ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+            ' <' + M + '.' + (+m + 1) + '.0'
+    } else {
+      // ~1.2.3 == >=1.2.3 <1.3.0
+      ret = '>=' + M + '.' + m + '.' + p +
+            ' <' + M + '.' + (+m + 1) + '.0'
+    }
+
+    debug('tilde return', ret)
+    return ret
+  })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets (comp, options) {
+  return comp.trim().split(/\s+/).map(function (comp) {
+    return replaceCaret(comp, options)
+  }).join(' ')
+}
+
+function replaceCaret (comp, options) {
+  debug('caret', comp, options)
+  var r = options.loose ? re[CARETLOOSE] : re[CARET]
+  return comp.replace(r, function (_, M, m, p, pr) {
+    debug('caret', comp, _, M, m, p, pr)
+    var ret
+
+    if (isX(M)) {
+      ret = ''
+    } else if (isX(m)) {
+      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+    } else if (isX(p)) {
+      if (M === '0') {
+        ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+      } else {
+        ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
+      }
+    } else if (pr) {
+      debug('replaceCaret pr', pr)
+      if (M === '0') {
+        if (m === '0') {
+          ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+                ' <' + M + '.' + m + '.' + (+p + 1)
+        } else {
+          ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+                ' <' + M + '.' + (+m + 1) + '.0'
+        }
+      } else {
+        ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+              ' <' + (+M + 1) + '.0.0'
+      }
+    } else {
+      debug('no pr')
+      if (M === '0') {
+        if (m === '0') {
+          ret = '>=' + M + '.' + m + '.' + p +
+                ' <' + M + '.' + m + '.' + (+p + 1)
+        } else {
+          ret = '>=' + M + '.' + m + '.' + p +
+                ' <' + M + '.' + (+m + 1) + '.0'
+        }
+      } else {
+        ret = '>=' + M + '.' + m + '.' + p +
+              ' <' + (+M + 1) + '.0.0'
+      }
+    }
+
+    debug('caret return', ret)
+    return ret
+  })
+}
+
+function replaceXRanges (comp, options) {
+  debug('replaceXRanges', comp, options)
+  return comp.split(/\s+/).map(function (comp) {
+    return replaceXRange(comp, options)
+  }).join(' ')
+}
+
+function replaceXRange (comp, options) {
+  comp = comp.trim()
+  var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
+  return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
+    debug('xRange', comp, ret, gtlt, M, m, p, pr)
+    var xM = isX(M)
+    var xm = xM || isX(m)
+    var xp = xm || isX(p)
+    var anyX = xp
+
+    if (gtlt === '=' && anyX) {
+      gtlt = ''
+    }
+
+    if (xM) {
+      if (gtlt === '>' || gtlt === '<') {
+        // nothing is allowed
+        ret = '<0.0.0'
+      } else {
+        // nothing is forbidden
+        ret = '*'
+      }
+    } else if (gtlt && anyX) {
+      // we know patch is an x, because we have any x at all.
+      // replace X with 0
+      if (xm) {
+        m = 0
+      }
+      p = 0
+
+      if (gtlt === '>') {
+        // >1 => >=2.0.0
+        // >1.2 => >=1.3.0
+        // >1.2.3 => >= 1.2.4
+        gtlt = '>='
+        if (xm) {
+          M = +M + 1
+          m = 0
+          p = 0
+        } else {
+          m = +m + 1
+          p = 0
+        }
+      } else if (gtlt === '<=') {
+        // <=0.7.x is actually <0.8.0, since any 0.7.x should
+        // pass.  Similarly, <=7.x is actually <8.0.0, etc.
+        gtlt = '<'
+        if (xm) {
+          M = +M + 1
+        } else {
+          m = +m + 1
+        }
+      }
+
+      ret = gtlt + M + '.' + m + '.' + p
+    } else if (xm) {
+      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+    } else if (xp) {
+      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+    }
+
+    debug('xRange return', ret)
+
+    return ret
+  })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars (comp, options) {
+  debug('replaceStars', comp, options)
+  // Looseness is ignored here.  star is always as loose as it gets!
+  return comp.trim().replace(re[STAR], '')
+}
+
+// This function is passed to string.replace(re[HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace ($0,
+  from, fM, fm, fp, fpr, fb,
+  to, tM, tm, tp, tpr, tb) {
+  if (isX(fM)) {
+    from = ''
+  } else if (isX(fm)) {
+    from = '>=' + fM + '.0.0'
+  } else if (isX(fp)) {
+    from = '>=' + fM + '.' + fm + '.0'
+  } else {
+    from = '>=' + from
+  }
+
+  if (isX(tM)) {
+    to = ''
+  } else if (isX(tm)) {
+    to = '<' + (+tM + 1) + '.0.0'
+  } else if (isX(tp)) {
+    to = '<' + tM + '.' + (+tm + 1) + '.0'
+  } else if (tpr) {
+    to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
+  } else {
+    to = '<=' + to
+  }
+
+  return (from + ' ' + to).trim()
+}
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function (version) {
+  if (!version) {
+    return false
+  }
+
+  if (typeof version === 'string') {
+    version = new SemVer(version, this.options)
+  }
+
+  for (var i = 0; i < this.set.length; i++) {
+    if (testSet(this.set[i], version, this.options)) {
+      return true
+    }
+  }
+  return false
+}
+
+function testSet (set, version, options) {
+  for (var i = 0; i < set.length; i++) {
+    if (!set[i].test(version)) {
+      return false
+    }
+  }
+
+  if (version.prerelease.length && !options.includePrerelease) {
+    // Find the set of versions that are allowed to have prereleases
+    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+    // That should allow `1.2.3-pr.2` to pass.
+    // However, `1.2.4-alpha.notready` should NOT be allowed,
+    // even though it's within the range set by the comparators.
+    for (i = 0; i < set.length; i++) {
+      debug(set[i].semver)
+      if (set[i].semver === ANY) {
+        continue
+      }
+
+      if (set[i].semver.prerelease.length > 0) {
+        var allowed = set[i].semver
+        if (allowed.major === version.major &&
+            allowed.minor === version.minor &&
+            allowed.patch === version.patch) {
+          return true
+        }
+      }
+    }
+
+    // Version has a -pre, but it's not one of the ones we like.
+    return false
+  }
+
+  return true
+}
+
+exports.satisfies = satisfies
+function satisfies (version, range, options) {
+  try {
+    range = new Range(range, options)
+  } catch (er) {
+    return false
+  }
+  return range.test(version)
+}
+
+exports.maxSatisfying = maxSatisfying
+function maxSatisfying (versions, range, options) {
+  var max = null
+  var maxSV = null
+  try {
+    var rangeObj = new Range(range, options)
+  } catch (er) {
+    return null
+  }
+  versions.forEach(function (v) {
+    if (rangeObj.test(v)) {
+      // satisfies(v, range, options)
+      if (!max || maxSV.compare(v) === -1) {
+        // compare(max, v, true)
+        max = v
+        maxSV = new SemVer(max, options)
+      }
+    }
+  })
+  return max
+}
+
+exports.minSatisfying = minSatisfying
+function minSatisfying (versions, range, options) {
+  var min = null
+  var minSV = null
+  try {
+    var rangeObj = new Range(range, options)
+  } catch (er) {
+    return null
+  }
+  versions.forEach(function (v) {
+    if (rangeObj.test(v)) {
+      // satisfies(v, range, options)
+      if (!min || minSV.compare(v) === 1) {
+        // compare(min, v, true)
+        min = v
+        minSV = new SemVer(min, options)
+      }
+    }
+  })
+  return min
+}
+
+exports.minVersion = minVersion
+function minVersion (range, loose) {
+  range = new Range(range, loose)
+
+  var minver = new SemVer('0.0.0')
+  if (range.test(minver)) {
+    return minver
+  }
+
+  minver = new SemVer('0.0.0-0')
+  if (range.test(minver)) {
+    return minver
+  }
+
+  minver = null
+  for (var i = 0; i < range.set.length; ++i) {
+    var comparators = range.set[i]
+
+    comparators.forEach(function (comparator) {
+      // Clone to avoid manipulating the comparator's semver object.
+      var compver = new SemVer(comparator.semver.version)
+      switch (comparator.operator) {
+        case '>':
+          if (compver.prerelease.length === 0) {
+            compver.patch++
+          } else {
+            compver.prerelease.push(0)
+          }
+          compver.raw = compver.format()
+          /* fallthrough */
+        case '':
+        case '>=':
+          if (!minver || gt(minver, compver)) {
+            minver = compver
+          }
+          break
+        case '<':
+        case '<=':
+          /* Ignore maximum versions */
+          break
+        /* istanbul ignore next */
+        default:
+          throw new Error('Unexpected operation: ' + comparator.operator)
+      }
+    })
+  }
+
+  if (minver && range.test(minver)) {
+    return minver
+  }
+
+  return null
+}
+
+exports.validRange = validRange
+function validRange (range, options) {
+  try {
+    // Return '*' instead of '' so that truthiness works.
+    // This will throw if it's invalid anyway
+    return new Range(range, options).range || '*'
+  } catch (er) {
+    return null
+  }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr
+function ltr (version, range, options) {
+  return outside(version, range, '<', options)
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr
+function gtr (version, range, options) {
+  return outside(version, range, '>', options)
+}
+
+exports.outside = outside
+function outside (version, range, hilo, options) {
+  version = new SemVer(version, options)
+  range = new Range(range, options)
+
+  var gtfn, ltefn, ltfn, comp, ecomp
+  switch (hilo) {
+    case '>':
+      gtfn = gt
+      ltefn = lte
+      ltfn = lt
+      comp = '>'
+      ecomp = '>='
+      break
+    case '<':
+      gtfn = lt
+      ltefn = gte
+      ltfn = gt
+      comp = '<'
+      ecomp = '<='
+      break
+    default:
+      throw new TypeError('Must provide a hilo val of "<" or ">"')
+  }
+
+  // If it satisifes the range it is not outside
+  if (satisfies(version, range, options)) {
+    return false
+  }
+
+  // From now on, variable terms are as if we're in "gtr" mode.
+  // but note that everything is flipped for the "ltr" function.
+
+  for (var i = 0; i < range.set.length; ++i) {
+    var comparators = range.set[i]
+
+    var high = null
+    var low = null
+
+    comparators.forEach(function (comparator) {
+      if (comparator.semver === ANY) {
+        comparator = new Comparator('>=0.0.0')
+      }
+      high = high || comparator
+      low = low || comparator
+      if (gtfn(comparator.semver, high.semver, options)) {
+        high = comparator
+      } else if (ltfn(comparator.semver, low.semver, options)) {
+        low = comparator
+      }
+    })
+
+    // If the edge version comparator has a operator then our version
+    // isn't outside it
+    if (high.operator === comp || high.operator === ecomp) {
+      return false
+    }
+
+    // If the lowest version comparator has an operator and our version
+    // is less than it then it isn't higher than the range
+    if ((!low.operator || low.operator === comp) &&
+        ltefn(version, low.semver)) {
+      return false
+    } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+      return false
+    }
+  }
+  return true
+}
+
+exports.prerelease = prerelease
+function prerelease (version, options) {
+  var parsed = parse(version, options)
+  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+
+exports.intersects = intersects
+function intersects (r1, r2, options) {
+  r1 = new Range(r1, options)
+  r2 = new Range(r2, options)
+  return r1.intersects(r2)
+}
+
+exports.coerce = coerce
+function coerce (version) {
+  if (version instanceof SemVer) {
+    return version
+  }
+
+  if (typeof version !== 'string') {
+    return null
+  }
+
+  var match = version.match(re[COERCE])
+
+  if (match == null) {
+    return null
+  }
+
+  return parse(match[1] +
+    '.' + (match[2] || '0') +
+    '.' + (match[3] || '0'))
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/CHANGELOG.md b/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/CHANGELOG.md
new file mode 100644 (file)
index 0000000..19a0501
--- /dev/null
@@ -0,0 +1,78 @@
+# Changelog
+
+[npm history][1]
+
+[1]: https://www.npmjs.com/package/nodejs-promisify?activeTab=versions
+
+## v0.4.0
+
+02-12-2019 19:44 PST
+
+### New features
+- feat: add callbackify() and callbackifyAll() methods ([#82](https://github.com/googleapis/nodejs-promisify/pull/82))
+
+### Documentation
+- docs: update contributing path in README ([#86](https://github.com/googleapis/nodejs-promisify/pull/86))
+- chore: move CONTRIBUTING.md to root ([#85](https://github.com/googleapis/nodejs-promisify/pull/85))
+- docs: add lint/fix example to contributing guide ([#83](https://github.com/googleapis/nodejs-promisify/pull/83))
+
+### Internal / Testing Changes
+- build: create docs test npm scripts ([#88](https://github.com/googleapis/nodejs-promisify/pull/88))
+- build: test using @grpc/grpc-js in CI ([#87](https://github.com/googleapis/nodejs-promisify/pull/87))
+- build: ignore googleapis.com in doc link check ([#81](https://github.com/googleapis/nodejs-promisify/pull/81))
+- build: check broken links in generated docs ([#79](https://github.com/googleapis/nodejs-promisify/pull/79))
+- chore(deps): update dependency @types/sinon to v7 ([#78](https://github.com/googleapis/nodejs-promisify/pull/78))
+- chore(build): inject yoshi automation key ([#77](https://github.com/googleapis/nodejs-promisify/pull/77))
+- chore: update nyc and eslint configs ([#76](https://github.com/googleapis/nodejs-promisify/pull/76))
+- chore: fix publish.sh permission +x ([#74](https://github.com/googleapis/nodejs-promisify/pull/74))
+- fix(build): fix Kokoro release script ([#73](https://github.com/googleapis/nodejs-promisify/pull/73))
+- build: add Kokoro configs for autorelease ([#72](https://github.com/googleapis/nodejs-promisify/pull/72))
+- chore: always nyc report before calling codecov ([#69](https://github.com/googleapis/nodejs-promisify/pull/69))
+- chore: nyc ignore build/test by default ([#68](https://github.com/googleapis/nodejs-promisify/pull/68))
+- chore(build): update prettier config ([#66](https://github.com/googleapis/nodejs-promisify/pull/66))
+- fix: get the build passing ([#65](https://github.com/googleapis/nodejs-promisify/pull/65))
+- chore: update license file ([#64](https://github.com/googleapis/nodejs-promisify/pull/64))
+- fix(build): fix system key decryption ([#60](https://github.com/googleapis/nodejs-promisify/pull/60))
+- chore(deps): update dependency @types/sinon to v5.0.7 ([#58](https://github.com/googleapis/nodejs-promisify/pull/58))
+- fix: Pin @types/sinon to last compatible version ([#57](https://github.com/googleapis/nodejs-promisify/pull/57))
+- chore: add synth.metadata
+- chore(deps): update dependency gts to ^0.9.0 ([#54](https://github.com/googleapis/nodejs-promisify/pull/54))
+- chore: update eslintignore config ([#53](https://github.com/googleapis/nodejs-promisify/pull/53))
+- chore: use latest npm on Windows ([#52](https://github.com/googleapis/nodejs-promisify/pull/52))
+- chore: update CircleCI config ([#51](https://github.com/googleapis/nodejs-promisify/pull/51))
+- chore: include build in eslintignore ([#48](https://github.com/googleapis/nodejs-promisify/pull/48))
+- chore: update issue templates ([#44](https://github.com/googleapis/nodejs-promisify/pull/44))
+- chore: remove old issue template ([#42](https://github.com/googleapis/nodejs-promisify/pull/42))
+- build: run tests on node11 ([#41](https://github.com/googleapis/nodejs-promisify/pull/41))
+- chores(build): do not collect sponge.xml from windows builds ([#40](https://github.com/googleapis/nodejs-promisify/pull/40))
+- chores(build): run codecov on continuous builds ([#39](https://github.com/googleapis/nodejs-promisify/pull/39))
+- chore: update new issue template ([#38](https://github.com/googleapis/nodejs-promisify/pull/38))
+- chore(deps): update dependency sinon to v7 ([#33](https://github.com/googleapis/nodejs-promisify/pull/33))
+- build: fix codecov uploading on Kokoro ([#34](https://github.com/googleapis/nodejs-promisify/pull/34))
+- Update kokoro config ([#30](https://github.com/googleapis/nodejs-promisify/pull/30))
+- Update CI config ([#28](https://github.com/googleapis/nodejs-promisify/pull/28))
+- Don't publish sourcemaps ([#26](https://github.com/googleapis/nodejs-promisify/pull/26))
+- Update kokoro config ([#24](https://github.com/googleapis/nodejs-promisify/pull/24))
+- test: remove appveyor config ([#23](https://github.com/googleapis/nodejs-promisify/pull/23))
+- Update CI config ([#22](https://github.com/googleapis/nodejs-promisify/pull/22))
+- Enable prefer-const in the eslint config ([#21](https://github.com/googleapis/nodejs-promisify/pull/21))
+- Enable no-var in eslint ([#19](https://github.com/googleapis/nodejs-promisify/pull/19))
+- Update CI config ([#18](https://github.com/googleapis/nodejs-promisify/pull/18))
+
+## v0.3.1
+
+### Internal / Testing Changes
+- Add synth script and update CI (#14)
+- chore(deps): update dependency nyc to v13 (#12)
+- chore: ignore package-lock.json (#11)
+- chore(deps): lock file maintenance (#10)
+- chore: update renovate config (#9)
+- remove that whitespace (#8)
+- chore(deps): lock file maintenance (#7)
+- chore(deps): update dependency typescript to v3 (#6)
+- chore: assert.deelEqual => assert.deepStrictEqual (#5)
+- chore: move mocha options to mocha.opts (#4)
+- chore(deps): update dependency gts to ^0.8.0 (#1)
+- chore(deps): lock file maintenance (#3)
+- chore(deps): lock file maintenance (#2)
+
diff --git a/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/LICENSE b/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/LICENSE
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/README.md b/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/README.md
new file mode 100644 (file)
index 0000000..c24ecfb
--- /dev/null
@@ -0,0 +1,40 @@
+<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
+
+# @google-cloud/promisify
+> A simple utility for promisifying and callbackifying functions and classes.
+
+Google Cloud Common node.js module contains stuff used by other Cloud API modules.
+
+* [github.com/googlecloudplatform/google-cloud-node](https://github.com/googlecloudplatform/google-cloud-node)
+
+Read more about the client libraries for Cloud APIs, including the older
+Google APIs Client Libraries, in [Client Libraries Explained][explained].
+
+[explained]: https://cloud.google.com/apis/docs/client-libraries-explained
+
+### Installing the package
+
+It's unlikely you will need to install this package directly, as it will be
+installed as a dependency when you install other `@google-cloud` packages.
+
+## Versioning
+
+This library follows [Semantic Versioning](http://semver.org/).
+
+This library is considered to be in **alpha**. This means it is still a
+work-in-progress and under active development. Any release is subject to
+backwards-incompatible changes at any time.
+
+More Information: [Google Cloud Platform Launch Stages][launch_stages]
+
+[launch_stages]: https://cloud.google.com/terms/launch-stages
+
+## Contributing
+
+Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-promisify/blob/master/CONTRIBUTING.md).
+
+## License
+
+Apache Version 2.0
+
+See [LICENSE](https://github.com/googlecloudplatform/google-cloud-node/blob/master/LICENSE)
diff --git a/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/build/src/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/build/src/index.d.ts
new file mode 100644 (file)
index 0000000..199195e
--- /dev/null
@@ -0,0 +1,76 @@
+/**
+ * Copyright 2014 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export interface PromisifyAllOptions extends PromisifyOptions {
+    /**
+     * Array of methods to ignore when promisifying.
+     */
+    exclude?: string[];
+}
+export interface PromisifyOptions {
+    /**
+     * Resolve the promise with single arg instead of an array.
+     */
+    singular?: boolean;
+}
+export interface PromiseMethod extends Function {
+    promisified_?: boolean;
+}
+export interface WithPromise {
+    Promise?: PromiseConstructor;
+}
+export interface CallbackifyAllOptions {
+    /**
+     * Array of methods to ignore when callbackifying.
+     */
+    exclude?: string[];
+}
+export interface CallbackMethod extends Function {
+    callbackified_?: boolean;
+}
+/**
+ * Wraps a callback style function to conditionally return a promise.
+ *
+ * @param {function} originalMethod - The method to promisify.
+ * @param {object=} options - Promise options.
+ * @param {boolean} options.singular - Resolve the promise with single arg instead of an array.
+ * @return {function} wrapped
+ */
+export declare function promisify(originalMethod: PromiseMethod, options?: PromisifyOptions): any;
+/**
+ * Promisifies certain Class methods. This will not promisify private or
+ * streaming methods.
+ *
+ * @param {module:common/service} Class - Service class.
+ * @param {object=} options - Configuration object.
+ */
+export declare function promisifyAll(Class: Function, options?: PromisifyAllOptions): void;
+/**
+ * Wraps a promisy type function to conditionally call a callback function.
+ *
+ * @param {function} originalMethod - The method to callbackify.
+ * @param {object=} options - Callback options.
+ * @param {boolean} options.singular - Pass to the callback a single arg instead of an array.
+ * @return {function} wrapped
+ */
+export declare function callbackify(originalMethod: CallbackMethod): CallbackMethod;
+/**
+ * Callbackifies certain Class methods. This will not callbackify private or
+ * streaming methods.
+ *
+ * @param {module:common/service} Class - Service class.
+ * @param {object=} options - Configuration object.
+ */
+export declare function callbackifyAll(Class: Function, options?: CallbackifyAllOptions): void;
diff --git a/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/build/src/index.js b/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/build/src/index.js
new file mode 100644 (file)
index 0000000..3bd0226
--- /dev/null
@@ -0,0 +1,162 @@
+"use strict";
+/**
+ * Copyright 2014 Google Inc. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * Wraps a callback style function to conditionally return a promise.
+ *
+ * @param {function} originalMethod - The method to promisify.
+ * @param {object=} options - Promise options.
+ * @param {boolean} options.singular - Resolve the promise with single arg instead of an array.
+ * @return {function} wrapped
+ */
+function promisify(originalMethod, options) {
+    if (originalMethod.promisified_) {
+        return originalMethod;
+    }
+    options = options || {};
+    const slice = Array.prototype.slice;
+    // tslint:disable-next-line:no-any
+    const wrapper = function () {
+        const context = this;
+        let last;
+        for (last = arguments.length - 1; last >= 0; last--) {
+            const arg = arguments[last];
+            if (typeof arg === 'undefined') {
+                continue; // skip trailing undefined.
+            }
+            if (typeof arg !== 'function') {
+                break; // non-callback last argument found.
+            }
+            return originalMethod.apply(context, arguments);
+        }
+        // peel trailing undefined.
+        const args = slice.call(arguments, 0, last + 1);
+        // tslint:disable-next-line:variable-name
+        let PromiseCtor = Promise;
+        // Because dedupe will likely create a single install of
+        // @google-cloud/common to be shared amongst all modules, we need to
+        // localize it at the Service level.
+        if (context && context.Promise) {
+            PromiseCtor = context.Promise;
+        }
+        return new PromiseCtor((resolve, reject) => {
+            // tslint:disable-next-line:no-any
+            args.push((...args) => {
+                const callbackArgs = slice.call(args);
+                const err = callbackArgs.shift();
+                if (err) {
+                    return reject(err);
+                }
+                if (options.singular && callbackArgs.length === 1) {
+                    resolve(callbackArgs[0]);
+                }
+                else {
+                    resolve(callbackArgs);
+                }
+            });
+            originalMethod.apply(context, args);
+        });
+    };
+    wrapper.promisified_ = true;
+    return wrapper;
+}
+exports.promisify = promisify;
+/**
+ * Promisifies certain Class methods. This will not promisify private or
+ * streaming methods.
+ *
+ * @param {module:common/service} Class - Service class.
+ * @param {object=} options - Configuration object.
+ */
+// tslint:disable-next-line:variable-name
+function promisifyAll(Class, options) {
+    const exclude = (options && options.exclude) || [];
+    const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype);
+    const methods = ownPropertyNames.filter((methodName) => {
+        // clang-format off
+        return (typeof Class.prototype[methodName] === 'function' && // is it a function?
+            !/(^_|(Stream|_)|promise$)|^constructor$/.test(methodName) && // is it promisable?
+            exclude.indexOf(methodName) === -1); // is it blacklisted?
+        // clang-format on
+    });
+    methods.forEach((methodName) => {
+        const originalMethod = Class.prototype[methodName];
+        if (!originalMethod.promisified_) {
+            Class.prototype[methodName] = exports.promisify(originalMethod, options);
+        }
+    });
+}
+exports.promisifyAll = promisifyAll;
+/**
+ * Wraps a promisy type function to conditionally call a callback function.
+ *
+ * @param {function} originalMethod - The method to callbackify.
+ * @param {object=} options - Callback options.
+ * @param {boolean} options.singular - Pass to the callback a single arg instead of an array.
+ * @return {function} wrapped
+ */
+function callbackify(originalMethod) {
+    if (originalMethod.callbackified_) {
+        return originalMethod;
+    }
+    // tslint:disable-next-line:no-any
+    const wrapper = function () {
+        const context = this;
+        if (typeof arguments[arguments.length - 1] !== 'function') {
+            return originalMethod.apply(context, arguments);
+        }
+        const cb = Array.prototype.pop.call(arguments);
+        originalMethod
+            .apply(context, arguments)
+            // tslint:disable-next-line:no-any
+            .then((res) => {
+            res = Array.isArray(res) ? res : [res];
+            cb(null, ...res);
+        }, (err) => cb(err));
+    };
+    wrapper.callbackified_ = true;
+    return wrapper;
+}
+exports.callbackify = callbackify;
+/**
+ * Callbackifies certain Class methods. This will not callbackify private or
+ * streaming methods.
+ *
+ * @param {module:common/service} Class - Service class.
+ * @param {object=} options - Configuration object.
+ */
+function callbackifyAll(
+// tslint:disable-next-line:variable-name
+Class, options) {
+    const exclude = (options && options.exclude) || [];
+    const ownPropertyNames = Object.getOwnPropertyNames(Class.prototype);
+    const methods = ownPropertyNames.filter((methodName) => {
+        // clang-format off
+        return (typeof Class.prototype[methodName] === 'function' && // is it a function?
+            !/^_|(Stream|_)|^constructor$/.test(methodName) && // is it callbackifyable?
+            exclude.indexOf(methodName) === -1); // is it blacklisted?
+        // clang-format on
+    });
+    methods.forEach((methodName) => {
+        const originalMethod = Class.prototype[methodName];
+        if (!originalMethod.callbackified_) {
+            Class.prototype[methodName] = exports.callbackify(originalMethod);
+        }
+    });
+}
+exports.callbackifyAll = callbackifyAll;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/package.json b/legacy-libs/grpc-cloned/node_modules/@google-cloud/promisify/package.json
new file mode 100644 (file)
index 0000000..0c69aa9
--- /dev/null
@@ -0,0 +1,130 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@google-cloud/promisify@^0.4.0",
+        "scope": "@google-cloud",
+        "escapedName": "@google-cloud%2fpromisify",
+        "name": "@google-cloud/promisify",
+        "rawSpec": "^0.4.0",
+        "spec": ">=0.4.0 <0.5.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/google-proto-files"
+    ]
+  ],
+  "_from": "@google-cloud/promisify@>=0.4.0 <0.5.0",
+  "_hasShrinkwrap": false,
+  "_id": "@google-cloud/promisify@0.4.0",
+  "_inCache": true,
+  "_location": "/@google-cloud/promisify",
+  "_nodeVersion": "8.15.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/promisify_0.4.0_1550076723142_0.4569426648631332"
+  },
+  "_npmUser": {
+    "name": "google-node-team",
+    "email": "node-team-npm@google.com"
+  },
+  "_npmVersion": "6.4.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@google-cloud/promisify@^0.4.0",
+    "scope": "@google-cloud",
+    "escapedName": "@google-cloud%2fpromisify",
+    "name": "@google-cloud/promisify",
+    "rawSpec": "^0.4.0",
+    "spec": ">=0.4.0 <0.5.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/google-proto-files"
+  ],
+  "_resolved": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz",
+  "_shasum": "4fbfcf4d85bb6a2e4ccf05aa63d2b10d6c9aad9b",
+  "_shrinkwrap": null,
+  "_spec": "@google-cloud/promisify@^0.4.0",
+  "_where": "/var/opt/motion2/node_modules/google-proto-files",
+  "author": {
+    "name": "Google Inc."
+  },
+  "bugs": {
+    "url": "https://github.com/googleapis/nodejs-promisify/issues"
+  },
+  "dependencies": {},
+  "description": "A simple utility for promisifying functions and classes.",
+  "devDependencies": {
+    "@compodoc/compodoc": "^1.1.7",
+    "@types/mocha": "^5.2.4",
+    "@types/node": "^10.5.2",
+    "@types/sinon": "^7.0.0",
+    "broken-link-checker-local": "^0.2.0",
+    "codecov": "^3.0.4",
+    "gts": "^0.9.0",
+    "hard-rejection": "^1.0.0",
+    "intelli-espower-loader": "^1.0.1",
+    "mocha": "^5.2.0",
+    "nyc": "^13.0.0",
+    "sinon": "^7.0.0",
+    "source-map-support": "^0.5.6",
+    "typescript": "^3.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-4yAHDC52TEMCNcMzVC8WlqnKKKq+Ssi2lXoUg9zWWkZ6U6tq9ZBRYLHHCRdfU+EU9YJsVmivwGcKYCjRGjnf4Q==",
+    "shasum": "4fbfcf4d85bb6a2e4ccf05aa63d2b10d6c9aad9b",
+    "tarball": "https://registry.npmjs.org/@google-cloud/promisify/-/promisify-0.4.0.tgz",
+    "fileCount": 6,
+    "unpackedSize": 28605,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZEs0CRA9TVsSAnZWagAAYeYQAIu4gIj99PtmT+98gH8w\nJ6znPbyICrOIHwbgEQhqqb1lzqykXmpRVbCwK/d/ttB2AWDCaQ60boE7qCjN\nFhM6QTr7V4qukz+O+mX2/DKBpQym5SegbjV8GrRWnqNTn/sNaNGJoYi/DVzE\nMpHL36oqYJk9p7dTGJzPoFwoZTCxq9xkafcVLLTyDbHyPcnvqdxAeElNoMax\n8W6tFzHUhid/HVDDQwEBbIvq2hl/wHcRgWxtBYVwFQIscfIO6XO43clGa9Xy\n6K+N7uc6rkeo76stgOeYWxLJGdsugmp4SnaO5AqpMPyRW9pLga5PkHRBEF4X\n1n+vZw5odDxwtyUW6vmN00xGvDZbJt47fEEcVy6tI+84cY010RX+mQ8aqUzM\npKfAg/j3hNQd3aR45u6e3Yg8hl3+VN1JMN6WqP64xunRmWcxsDzaR7nhTO/2\n0x7dl3vJ4ST/47MHZA+ym3MuSKTQqVfCAr3KkY2qaU0QMeIOoEg9tDVrT5LW\n2z03uEh5SzAuc5DWFa6cBLnUz3QeUHOWIDD042HrgApyGujNDH1uaxXZBaCh\ntCS0fs3hs0lqqjc1PQmhGNLUcht61OqzBh55uiohLrTGDzdFuBazOZqo2B/4\ngFn1/sjDMBYTc8pCddq7QZnFfo8T0QQUS4q3xIcetVymoFKNnViLhCZvqNFd\nRBxi\r\n=YIr2\r\n-----END PGP SIGNATURE-----\r\n"
+  },
+  "gitHead": "c97037fede2817b34db7e9c04749cb685ad8a6ea",
+  "homepage": "https://github.com/googleapis/nodejs-promisify#readme",
+  "keywords": [],
+  "license": "Apache-2.0",
+  "main": "build/src/index.js",
+  "maintainers": [
+    {
+      "name": "fenster",
+      "email": "npm@fenster.name"
+    },
+    {
+      "name": "google-node-team",
+      "email": "node-team-npm@google.com"
+    },
+    {
+      "name": "justinbeckwith",
+      "email": "justin.beckwith@gmail.com"
+    },
+    {
+      "name": "ofrobots",
+      "email": "ofrobots@google.com"
+    }
+  ],
+  "name": "@google-cloud/promisify",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/googleapis/nodejs-promisify.git"
+  },
+  "scripts": {
+    "clean": "gts clean",
+    "compile": "tsc -p .",
+    "docs": "compodoc src/",
+    "docs-test": "blcl docs -r --exclude www.googleapis.com",
+    "fix": "gts fix",
+    "lint": "gts check",
+    "posttest": "npm run lint",
+    "predocs-test": "npm run docs",
+    "prepare": "npm run compile",
+    "presystem-test": "npm run compile",
+    "pretest": "npm run compile",
+    "samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
+    "system-test": "mocha build/system-test",
+    "test": "nyc mocha build/test"
+  },
+  "types": "build/src/index.d.ts",
+  "version": "0.4.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/LICENSE b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/LICENSE
new file mode 100644 (file)
index 0000000..8dada3e
--- /dev/null
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/README.md b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/README.md
new file mode 100644 (file)
index 0000000..e391866
--- /dev/null
@@ -0,0 +1,31 @@
+# Pure JavaScript gRPC Client
+
+**Note: This is an beta-level release. Some APIs may not yet be present and there may be bugs. Please report any that you encounter**
+
+## Installation
+
+Node 10 is recommended. The exact set of compatible Node versions can be found in the `engines` field of the `package.json` file.
+
+```sh
+npm install @grpc/grpc-js
+```
+
+## Features
+
+ - Unary and streaming calls
+ - Cancellation
+ - Deadlines
+ - TLS channel credentials
+ - Call credentials (for auth)
+ - Simple reconnection
+ - Channel API
+
+This library does not directly handle `.proto` files. To use `.proto` files with this library we recommend using the `@grpc/proto-loader` package.
+
+## Some Notes on API Guarantees
+
+The public API of this library follows semantic versioning, with some caveats:
+
+ - Some methods are prefixed with an underscore. These methods are internal and should not be considered part of the public API.
+ - The class `Call` is only exposed due to limitations of TypeScript. It should not be considered part of the public API.
+ - In general, any API that is exposed by this library but is not exposed by the `grpc` library is likely an error and should not be considered part of the public API.
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials-filter.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials-filter.d.ts
new file mode 100644 (file)
index 0000000..c15735a
--- /dev/null
@@ -0,0 +1,16 @@
+import { Call } from './call-stream';
+import { Http2Channel } from './channel';
+import { BaseFilter, Filter, FilterFactory } from './filter';
+import { Metadata } from './metadata';
+export declare class CallCredentialsFilter extends BaseFilter implements Filter {
+    private readonly channel;
+    private readonly stream;
+    private serviceUrl;
+    constructor(channel: Http2Channel, stream: Call);
+    sendMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+}
+export declare class CallCredentialsFilterFactory implements FilterFactory<CallCredentialsFilter> {
+    private readonly channel;
+    constructor(channel: Http2Channel);
+    createFilter(callStream: Call): CallCredentialsFilter;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials-filter.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials-filter.js
new file mode 100644 (file)
index 0000000..77ee72d
--- /dev/null
@@ -0,0 +1,43 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const filter_1 = require("./filter");
+class CallCredentialsFilter extends filter_1.BaseFilter {
+    constructor(channel, stream) {
+        super();
+        this.channel = channel;
+        this.stream = stream;
+        this.channel = channel;
+        this.stream = stream;
+        const splitPath = stream.getMethod().split('/');
+        let serviceName = '';
+        /* The standard path format is "/{serviceName}/{methodName}", so if we split
+         * by '/', the first item should be empty and the second should be the
+         * service name */
+        if (splitPath.length >= 2) {
+            serviceName = splitPath[1];
+        }
+        /* Currently, call credentials are only allowed on HTTPS connections, so we
+         * can assume that the scheme is "https" */
+        this.serviceUrl = `https://${stream.getHost()}/${serviceName}`;
+    }
+    async sendMetadata(metadata) {
+        const channelCredentials = this.channel.credentials._getCallCredentials();
+        const streamCredentials = this.stream.getCredentials();
+        const credentials = channelCredentials.compose(streamCredentials);
+        const credsMetadata = credentials.generateMetadata({ service_url: this.serviceUrl });
+        const resultMetadata = await metadata;
+        resultMetadata.merge(await credsMetadata);
+        return resultMetadata;
+    }
+}
+exports.CallCredentialsFilter = CallCredentialsFilter;
+class CallCredentialsFilterFactory {
+    constructor(channel) {
+        this.channel = channel;
+    }
+    createFilter(callStream) {
+        return new CallCredentialsFilter(this.channel, callStream);
+    }
+}
+exports.CallCredentialsFilterFactory = CallCredentialsFilterFactory;
+//# sourceMappingURL=call-credentials-filter.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials.d.ts
new file mode 100644 (file)
index 0000000..d7a1636
--- /dev/null
@@ -0,0 +1,32 @@
+import { Metadata } from './metadata';
+export declare type CallMetadataOptions = {
+    service_url: string;
+};
+export declare type CallMetadataGenerator = (options: CallMetadataOptions, cb: (err: Error | null, metadata?: Metadata) => void) => void;
+/**
+ * A class that represents a generic method of adding authentication-related
+ * metadata on a per-request basis.
+ */
+export declare abstract class CallCredentials {
+    /**
+     * Asynchronously generates a new Metadata object.
+     * @param options Options used in generating the Metadata object.
+     */
+    abstract generateMetadata(options: CallMetadataOptions): Promise<Metadata>;
+    /**
+     * Creates a new CallCredentials object from properties of both this and
+     * another CallCredentials object. This object's metadata generator will be
+     * called first.
+     * @param callCredentials The other CallCredentials object.
+     */
+    abstract compose(callCredentials: CallCredentials): CallCredentials;
+    /**
+     * Creates a new CallCredentials object from a given function that generates
+     * Metadata objects.
+     * @param metadataGenerator A function that accepts a set of options, and
+     * generates a Metadata object based on these options, which is passed back
+     * to the caller via a supplied (err, metadata) callback.
+     */
+    static createFromMetadataGenerator(metadataGenerator: CallMetadataGenerator): CallCredentials;
+    static createEmpty(): CallCredentials;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-credentials.js
new file mode 100644 (file)
index 0000000..04f12c9
--- /dev/null
@@ -0,0 +1,70 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const metadata_1 = require("./metadata");
+/**
+ * A class that represents a generic method of adding authentication-related
+ * metadata on a per-request basis.
+ */
+class CallCredentials {
+    /**
+     * Creates a new CallCredentials object from a given function that generates
+     * Metadata objects.
+     * @param metadataGenerator A function that accepts a set of options, and
+     * generates a Metadata object based on these options, which is passed back
+     * to the caller via a supplied (err, metadata) callback.
+     */
+    static createFromMetadataGenerator(metadataGenerator) {
+        return new SingleCallCredentials(metadataGenerator);
+    }
+    static createEmpty() {
+        return new EmptyCallCredentials();
+    }
+}
+exports.CallCredentials = CallCredentials;
+class ComposedCallCredentials extends CallCredentials {
+    constructor(creds) {
+        super();
+        this.creds = creds;
+    }
+    async generateMetadata(options) {
+        const base = new metadata_1.Metadata();
+        const generated = await Promise.all(this.creds.map((cred) => cred.generateMetadata(options)));
+        for (const gen of generated) {
+            base.merge(gen);
+        }
+        return base;
+    }
+    compose(other) {
+        return new ComposedCallCredentials(this.creds.concat([other]));
+    }
+}
+class SingleCallCredentials extends CallCredentials {
+    constructor(metadataGenerator) {
+        super();
+        this.metadataGenerator = metadataGenerator;
+    }
+    generateMetadata(options) {
+        return new Promise((resolve, reject) => {
+            this.metadataGenerator(options, (err, metadata) => {
+                if (metadata !== undefined) {
+                    resolve(metadata);
+                }
+                else {
+                    reject(err);
+                }
+            });
+        });
+    }
+    compose(other) {
+        return new ComposedCallCredentials([this, other]);
+    }
+}
+class EmptyCallCredentials extends CallCredentials {
+    generateMetadata(options) {
+        return Promise.resolve(new metadata_1.Metadata());
+    }
+    compose(other) {
+        return other;
+    }
+}
+//# sourceMappingURL=call-credentials.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-stream.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-stream.d.ts
new file mode 100644 (file)
index 0000000..f444fb9
--- /dev/null
@@ -0,0 +1,100 @@
+/// <reference types="node" />
+import * as http2 from 'http2';
+import { Duplex } from 'stream';
+import { CallCredentials } from './call-credentials';
+import { Http2Channel } from './channel';
+import { Status } from './constants';
+import { EmitterAugmentation1 } from './events';
+import { Filter } from './filter';
+import { FilterStackFactory } from './filter-stack';
+import { Metadata } from './metadata';
+import { ObjectDuplex, WriteCallback } from './object-stream';
+export declare type Deadline = Date | number;
+export interface CallStreamOptions {
+    deadline: Deadline;
+    flags: number;
+    host: string;
+    parentCall: Call | null;
+}
+export declare type PartialCallStreamOptions = Partial<CallStreamOptions>;
+export interface StatusObject {
+    code: Status;
+    details: string;
+    metadata: Metadata;
+}
+export declare const enum WriteFlags {
+    BufferHint = 1,
+    NoCompress = 2,
+    WriteThrough = 4
+}
+export interface WriteObject {
+    message: Buffer;
+    flags?: number;
+}
+/**
+ * This interface represents a duplex stream associated with a single gRPC call.
+ */
+export declare type Call = {
+    cancelWithStatus(status: Status, details: string): void;
+    getPeer(): string;
+    sendMetadata(metadata: Metadata): void;
+    getDeadline(): Deadline;
+    getCredentials(): CallCredentials;
+    setCredentials(credentials: CallCredentials): void;
+    getStatus(): StatusObject | null;
+    getMethod(): string;
+    getHost(): string;
+} & EmitterAugmentation1<'metadata', Metadata> & EmitterAugmentation1<'status', StatusObject> & ObjectDuplex<WriteObject, Buffer>;
+export declare class Http2CallStream extends Duplex implements Call {
+    private readonly methodName;
+    private readonly channel;
+    private readonly options;
+    credentials: CallCredentials;
+    filterStack: Filter;
+    private http2Stream;
+    private pendingRead;
+    private pendingWrite;
+    private pendingWriteCallback;
+    private pendingFinalCallback;
+    private readState;
+    private readCompressFlag;
+    private readPartialSize;
+    private readSizeRemaining;
+    private readMessageSize;
+    private readPartialMessage;
+    private readMessageRemaining;
+    private isReadFilterPending;
+    private canPush;
+    private unpushedReadMessages;
+    private unfilteredReadMessages;
+    private mappedStatusCode;
+    private handlingHeaders;
+    private handlingTrailers;
+    private finalStatus;
+    constructor(methodName: string, channel: Http2Channel, options: CallStreamOptions, filterStackFactory: FilterStackFactory);
+    /**
+     * On first call, emits a 'status' event with the given StatusObject.
+     * Subsequent calls are no-ops.
+     * @param status The status of the call.
+     */
+    private endCall;
+    private handleFilterError;
+    private handleFilteredRead;
+    private filterReceivedMessage;
+    private tryPush;
+    private handleTrailers;
+    attachHttp2Stream(stream: http2.ClientHttp2Stream): void;
+    sendMetadata(metadata: Metadata): void;
+    private destroyHttp2Stream;
+    cancelWithStatus(status: Status, details: string): void;
+    getDeadline(): Deadline;
+    getCredentials(): CallCredentials;
+    setCredentials(credentials: CallCredentials): void;
+    getStatus(): StatusObject | null;
+    getPeer(): string;
+    getMethod(): string;
+    getHost(): string;
+    _read(size: number): void;
+    _write(chunk: WriteObject, encoding: string, cb: WriteCallback): void;
+    _final(cb: Function): void;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-stream.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call-stream.js
new file mode 100644 (file)
index 0000000..ca8cee8
--- /dev/null
@@ -0,0 +1,410 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const http2 = require("http2");
+const stream_1 = require("stream");
+const call_credentials_1 = require("./call-credentials");
+const constants_1 = require("./constants");
+const metadata_1 = require("./metadata");
+const { HTTP2_HEADER_STATUS, HTTP2_HEADER_CONTENT_TYPE, NGHTTP2_CANCEL } = http2.constants;
+var ReadState;
+(function (ReadState) {
+    ReadState[ReadState["NO_DATA"] = 0] = "NO_DATA";
+    ReadState[ReadState["READING_SIZE"] = 1] = "READING_SIZE";
+    ReadState[ReadState["READING_MESSAGE"] = 2] = "READING_MESSAGE";
+})(ReadState || (ReadState = {}));
+class Http2CallStream extends stream_1.Duplex {
+    constructor(methodName, channel, options, filterStackFactory) {
+        super({ objectMode: true });
+        this.methodName = methodName;
+        this.channel = channel;
+        this.options = options;
+        this.credentials = call_credentials_1.CallCredentials.createEmpty();
+        this.http2Stream = null;
+        this.pendingRead = false;
+        this.pendingWrite = null;
+        this.pendingWriteCallback = null;
+        this.pendingFinalCallback = null;
+        this.readState = ReadState.NO_DATA;
+        this.readCompressFlag = Buffer.alloc(1);
+        this.readPartialSize = Buffer.alloc(4);
+        this.readSizeRemaining = 4;
+        this.readMessageSize = 0;
+        this.readPartialMessage = [];
+        this.readMessageRemaining = 0;
+        this.isReadFilterPending = false;
+        this.canPush = false;
+        this.unpushedReadMessages = [];
+        this.unfilteredReadMessages = [];
+        // Status code mapped from :status. To be used if grpc-status is not received
+        this.mappedStatusCode = constants_1.Status.UNKNOWN;
+        // Promise objects that are re-assigned to resolving promises when headers
+        // or trailers received. Processing headers/trailers is asynchronous, so we
+        // can use these objects to await their completion. This helps us establish
+        // order of precedence when obtaining the status of the call.
+        this.handlingHeaders = Promise.resolve();
+        this.handlingTrailers = Promise.resolve();
+        // This is populated (non-null) if and only if the call has ended
+        this.finalStatus = null;
+        this.filterStack = filterStackFactory.createFilter(this);
+    }
+    /**
+     * On first call, emits a 'status' event with the given StatusObject.
+     * Subsequent calls are no-ops.
+     * @param status The status of the call.
+     */
+    endCall(status) {
+        if (this.finalStatus === null) {
+            this.finalStatus = status;
+            this.emit('status', status);
+        }
+    }
+    handleFilterError(error) {
+        this.cancelWithStatus(constants_1.Status.INTERNAL, error.message);
+    }
+    handleFilteredRead(message) {
+        /* If we the call has already ended, we don't want to do anything with
+         * this message. Dropping it on the floor is correct behavior */
+        if (this.finalStatus !== null) {
+            return;
+        }
+        this.isReadFilterPending = false;
+        if (this.canPush) {
+            if (!this.push(message)) {
+                this.canPush = false;
+                this.http2Stream.pause();
+            }
+        }
+        else {
+            this.unpushedReadMessages.push(message);
+        }
+        if (this.unfilteredReadMessages.length > 0) {
+            /* nextMessage is guaranteed not to be undefined because
+               unfilteredReadMessages is non-empty */
+            const nextMessage = this.unfilteredReadMessages.shift();
+            this.filterReceivedMessage(nextMessage);
+        }
+    }
+    filterReceivedMessage(framedMessage) {
+        /* If we the call has already ended, we don't want to do anything with
+         * this message. Dropping it on the floor is correct behavior */
+        if (this.finalStatus !== null) {
+            return;
+        }
+        if (framedMessage === null) {
+            if (this.canPush) {
+                this.push(null);
+            }
+            else {
+                this.unpushedReadMessages.push(null);
+            }
+            return;
+        }
+        this.isReadFilterPending = true;
+        this.filterStack.receiveMessage(Promise.resolve(framedMessage))
+            .then(this.handleFilteredRead.bind(this), this.handleFilterError.bind(this));
+    }
+    tryPush(messageBytes) {
+        if (this.isReadFilterPending) {
+            this.unfilteredReadMessages.push(messageBytes);
+        }
+        else {
+            this.filterReceivedMessage(messageBytes);
+        }
+    }
+    handleTrailers(headers) {
+        const code = this.mappedStatusCode;
+        const details = '';
+        let metadata;
+        try {
+            metadata = metadata_1.Metadata.fromHttp2Headers(headers);
+        }
+        catch (e) {
+            metadata = new metadata_1.Metadata();
+        }
+        const status = { code, details, metadata };
+        this.handlingTrailers = (async () => {
+            let finalStatus;
+            try {
+                // Attempt to assign final status.
+                finalStatus =
+                    await this.filterStack.receiveTrailers(Promise.resolve(status));
+            }
+            catch (error) {
+                await this.handlingHeaders;
+                // This is a no-op if the call was already ended when handling headers.
+                this.endCall({
+                    code: constants_1.Status.INTERNAL,
+                    details: 'Failed to process received status',
+                    metadata: new metadata_1.Metadata()
+                });
+                return;
+            }
+            // It's possible that headers were received but not fully handled yet.
+            // Give the headers handler an opportunity to end the call first,
+            // if an error occurred.
+            await this.handlingHeaders;
+            // This is a no-op if the call was already ended when handling headers.
+            this.endCall(finalStatus);
+        })();
+    }
+    attachHttp2Stream(stream) {
+        if (this.finalStatus !== null) {
+            stream.close(NGHTTP2_CANCEL);
+        }
+        else {
+            this.http2Stream = stream;
+            stream.on('response', (headers, flags) => {
+                switch (headers[HTTP2_HEADER_STATUS]) {
+                    // TODO(murgatroid99): handle 100 and 101
+                    case '400':
+                        this.mappedStatusCode = constants_1.Status.INTERNAL;
+                        break;
+                    case '401':
+                        this.mappedStatusCode = constants_1.Status.UNAUTHENTICATED;
+                        break;
+                    case '403':
+                        this.mappedStatusCode = constants_1.Status.PERMISSION_DENIED;
+                        break;
+                    case '404':
+                        this.mappedStatusCode = constants_1.Status.UNIMPLEMENTED;
+                        break;
+                    case '429':
+                    case '502':
+                    case '503':
+                    case '504':
+                        this.mappedStatusCode = constants_1.Status.UNAVAILABLE;
+                        break;
+                    default:
+                        this.mappedStatusCode = constants_1.Status.UNKNOWN;
+                }
+                if (flags & http2.constants.NGHTTP2_FLAG_END_STREAM) {
+                    this.handleTrailers(headers);
+                }
+                else {
+                    let metadata;
+                    try {
+                        metadata = metadata_1.Metadata.fromHttp2Headers(headers);
+                    }
+                    catch (error) {
+                        this.endCall({
+                            code: constants_1.Status.UNKNOWN,
+                            details: error.message,
+                            metadata: new metadata_1.Metadata()
+                        });
+                        return;
+                    }
+                    this.handlingHeaders =
+                        this.filterStack.receiveMetadata(Promise.resolve(metadata))
+                            .then((finalMetadata) => {
+                            this.emit('metadata', finalMetadata);
+                        })
+                            .catch((error) => {
+                            this.destroyHttp2Stream();
+                            this.endCall({
+                                code: constants_1.Status.UNKNOWN,
+                                details: error.message,
+                                metadata: new metadata_1.Metadata()
+                            });
+                        });
+                }
+            });
+            stream.on('trailers', this.handleTrailers.bind(this));
+            stream.on('data', (data) => {
+                let readHead = 0;
+                let toRead;
+                while (readHead < data.length) {
+                    switch (this.readState) {
+                        case ReadState.NO_DATA:
+                            this.readCompressFlag = data.slice(readHead, readHead + 1);
+                            readHead += 1;
+                            this.readState = ReadState.READING_SIZE;
+                            this.readPartialSize.fill(0);
+                            this.readSizeRemaining = 4;
+                            this.readMessageSize = 0;
+                            this.readMessageRemaining = 0;
+                            this.readPartialMessage = [];
+                            break;
+                        case ReadState.READING_SIZE:
+                            toRead = Math.min(data.length - readHead, this.readSizeRemaining);
+                            data.copy(this.readPartialSize, 4 - this.readSizeRemaining, readHead, readHead + toRead);
+                            this.readSizeRemaining -= toRead;
+                            readHead += toRead;
+                            // readSizeRemaining >=0 here
+                            if (this.readSizeRemaining === 0) {
+                                this.readMessageSize = this.readPartialSize.readUInt32BE(0);
+                                this.readMessageRemaining = this.readMessageSize;
+                                if (this.readMessageRemaining > 0) {
+                                    this.readState = ReadState.READING_MESSAGE;
+                                }
+                                else {
+                                    this.tryPush(Buffer.concat([this.readCompressFlag, this.readPartialSize]));
+                                    this.readState = ReadState.NO_DATA;
+                                }
+                            }
+                            break;
+                        case ReadState.READING_MESSAGE:
+                            toRead =
+                                Math.min(data.length - readHead, this.readMessageRemaining);
+                            this.readPartialMessage.push(data.slice(readHead, readHead + toRead));
+                            this.readMessageRemaining -= toRead;
+                            readHead += toRead;
+                            // readMessageRemaining >=0 here
+                            if (this.readMessageRemaining === 0) {
+                                // At this point, we have read a full message
+                                const framedMessageBuffers = [
+                                    this.readCompressFlag, this.readPartialSize
+                                ].concat(this.readPartialMessage);
+                                const framedMessage = Buffer.concat(framedMessageBuffers, this.readMessageSize + 5);
+                                this.tryPush(framedMessage);
+                                this.readState = ReadState.NO_DATA;
+                            }
+                            break;
+                        default:
+                            throw new Error('This should never happen');
+                    }
+                }
+            });
+            stream.on('end', () => {
+                this.tryPush(null);
+            });
+            stream.on('close', async (errorCode) => {
+                let code;
+                let details = '';
+                switch (errorCode) {
+                    case http2.constants.NGHTTP2_REFUSED_STREAM:
+                        code = constants_1.Status.UNAVAILABLE;
+                        break;
+                    case http2.constants.NGHTTP2_CANCEL:
+                        code = constants_1.Status.CANCELLED;
+                        break;
+                    case http2.constants.NGHTTP2_ENHANCE_YOUR_CALM:
+                        code = constants_1.Status.RESOURCE_EXHAUSTED;
+                        details = 'Bandwidth exhausted';
+                        break;
+                    case http2.constants.NGHTTP2_INADEQUATE_SECURITY:
+                        code = constants_1.Status.PERMISSION_DENIED;
+                        details = 'Protocol not secure enough';
+                        break;
+                    default:
+                        code = constants_1.Status.INTERNAL;
+                }
+                // This guarantees that if trailers were received, the value of the
+                // 'grpc-status' header takes precedence for emitted status data.
+                await this.handlingTrailers;
+                // This is a no-op if trailers were received at all.
+                // This is OK, because status codes emitted here correspond to more
+                // catastrophic issues that prevent us from receiving trailers in the
+                // first place.
+                this.endCall({ code, details, metadata: new metadata_1.Metadata() });
+            });
+            stream.on('error', (err) => {
+                this.endCall({
+                    code: constants_1.Status.INTERNAL,
+                    details: 'Internal HTTP2 error',
+                    metadata: new metadata_1.Metadata()
+                });
+            });
+            if (!this.pendingRead) {
+                stream.pause();
+            }
+            if (this.pendingWrite) {
+                if (!this.pendingWriteCallback) {
+                    throw new Error('Invalid state in write handling code');
+                }
+                stream.write(this.pendingWrite, this.pendingWriteCallback);
+            }
+            if (this.pendingFinalCallback) {
+                stream.end(this.pendingFinalCallback);
+            }
+        }
+    }
+    sendMetadata(metadata) {
+        this.channel._startHttp2Stream(this.options.host, this.methodName, this, metadata);
+    }
+    destroyHttp2Stream() {
+        // The http2 stream could already have been destroyed if cancelWithStatus
+        // is called in response to an internal http2 error.
+        if (this.http2Stream !== null && !this.http2Stream.destroyed) {
+            /* TODO(murgatroid99): Determine if we want to send different RST_STREAM
+             * codes based on the status code */
+            this.http2Stream.close(NGHTTP2_CANCEL);
+        }
+    }
+    cancelWithStatus(status, details) {
+        this.destroyHttp2Stream();
+        (async () => {
+            // If trailers are currently being processed, the call should be ended
+            // by handleTrailers instead.
+            await this.handlingTrailers;
+            this.endCall({ code: status, details, metadata: new metadata_1.Metadata() });
+        })();
+    }
+    getDeadline() {
+        return this.options.deadline;
+    }
+    getCredentials() {
+        return this.credentials;
+    }
+    setCredentials(credentials) {
+        this.credentials = credentials;
+    }
+    getStatus() {
+        return this.finalStatus;
+    }
+    getPeer() {
+        throw new Error('Not yet implemented');
+    }
+    getMethod() {
+        return this.methodName;
+    }
+    getHost() {
+        return this.options.host;
+    }
+    _read(size) {
+        /* If we have already emitted a status, we should not emit any more
+         * messages and we should communicate that the stream has ended */
+        if (this.finalStatus !== null) {
+            this.push(null);
+            return;
+        }
+        this.canPush = true;
+        if (this.http2Stream === null) {
+            this.pendingRead = true;
+        }
+        else {
+            while (this.unpushedReadMessages.length > 0) {
+                const nextMessage = this.unpushedReadMessages.shift();
+                this.canPush = this.push(nextMessage);
+                if (nextMessage === null || (!this.canPush)) {
+                    this.canPush = false;
+                    return;
+                }
+            }
+            /* Only resume reading from the http2Stream if we don't have any pending
+             * messages to emit, and we haven't gotten the signal to stop pushing
+             * messages */
+            this.http2Stream.resume();
+        }
+    }
+    _write(chunk, encoding, cb) {
+        this.filterStack.sendMessage(Promise.resolve(chunk)).then((message) => {
+            if (this.http2Stream === null) {
+                this.pendingWrite = message.message;
+                this.pendingWriteCallback = cb;
+            }
+            else {
+                this.http2Stream.write(message.message, cb);
+            }
+        }, this.handleFilterError.bind(this));
+    }
+    _final(cb) {
+        if (this.http2Stream === null) {
+            this.pendingFinalCallback = cb;
+        }
+        else {
+            this.http2Stream.end(cb);
+        }
+    }
+}
+exports.Http2CallStream = Http2CallStream;
+//# sourceMappingURL=call-stream.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call.d.ts
new file mode 100644 (file)
index 0000000..0fb6b6e
--- /dev/null
@@ -0,0 +1,72 @@
+/// <reference types="node" />
+import { EventEmitter } from 'events';
+import { Duplex, Readable, Writable } from 'stream';
+import { Call, StatusObject } from './call-stream';
+import { EmitterAugmentation1 } from './events';
+import { Metadata } from './metadata';
+import { ObjectReadable, ObjectWritable } from './object-stream';
+/**
+ * A type extending the built-in Error object with additional fields.
+ */
+export declare type ServiceError = StatusObject & Error;
+/**
+ * A base type for all user-facing values returned by client-side method calls.
+ */
+export declare type SurfaceCall = {
+    cancel(): void;
+    getPeer(): string;
+} & EmitterAugmentation1<'metadata', Metadata> & EmitterAugmentation1<'status', StatusObject> & EventEmitter;
+/**
+ * A type representing the return value of a unary method call.
+ */
+export declare type ClientUnaryCall = SurfaceCall;
+/**
+ * A type representing the return value of a server stream method call.
+ */
+export declare type ClientReadableStream<ResponseType> = {
+    deserialize: (chunk: Buffer) => ResponseType;
+} & SurfaceCall & ObjectReadable<ResponseType>;
+/**
+ * A type representing the return value of a client stream method call.
+ */
+export declare type ClientWritableStream<RequestType> = {
+    serialize: (value: RequestType) => Buffer;
+} & SurfaceCall & ObjectWritable<RequestType>;
+/**
+ * A type representing the return value of a bidirectional stream method call.
+ */
+export declare type ClientDuplexStream<RequestType, ResponseType> = ClientWritableStream<RequestType> & ClientReadableStream<ResponseType>;
+export declare class ClientUnaryCallImpl extends EventEmitter implements ClientUnaryCall {
+    private readonly call;
+    constructor(call: Call);
+    cancel(): void;
+    getPeer(): string;
+}
+export declare class ClientReadableStreamImpl<ResponseType> extends Readable implements ClientReadableStream<ResponseType> {
+    private readonly call;
+    readonly deserialize: (chunk: Buffer) => ResponseType;
+    constructor(call: Call, deserialize: (chunk: Buffer) => ResponseType);
+    cancel(): void;
+    getPeer(): string;
+    _read(_size: number): void;
+}
+export declare class ClientWritableStreamImpl<RequestType> extends Writable implements ClientWritableStream<RequestType> {
+    private readonly call;
+    readonly serialize: (value: RequestType) => Buffer;
+    constructor(call: Call, serialize: (value: RequestType) => Buffer);
+    cancel(): void;
+    getPeer(): string;
+    _write(chunk: RequestType, encoding: string, cb: Function): void;
+    _final(cb: Function): void;
+}
+export declare class ClientDuplexStreamImpl<RequestType, ResponseType> extends Duplex implements ClientDuplexStream<RequestType, ResponseType> {
+    private readonly call;
+    readonly serialize: (value: RequestType) => Buffer;
+    readonly deserialize: (chunk: Buffer) => ResponseType;
+    constructor(call: Call, serialize: (value: RequestType) => Buffer, deserialize: (chunk: Buffer) => ResponseType);
+    cancel(): void;
+    getPeer(): string;
+    _read(_size: number): void;
+    _write(chunk: RequestType, encoding: string, cb: Function): void;
+    _final(cb: Function): void;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/call.js
new file mode 100644 (file)
index 0000000..c660387
--- /dev/null
@@ -0,0 +1,154 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const events_1 = require("events");
+const stream_1 = require("stream");
+const constants_1 = require("./constants");
+class ClientUnaryCallImpl extends events_1.EventEmitter {
+    constructor(call) {
+        super();
+        this.call = call;
+        call.on('metadata', (metadata) => {
+            this.emit('metadata', metadata);
+        });
+        call.on('status', (status) => {
+            this.emit('status', status);
+        });
+    }
+    cancel() {
+        this.call.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');
+    }
+    getPeer() {
+        return this.call.getPeer();
+    }
+}
+exports.ClientUnaryCallImpl = ClientUnaryCallImpl;
+function setUpReadableStream(stream, call, deserialize) {
+    let statusEmitted = false;
+    call.on('data', (data) => {
+        let deserialized;
+        try {
+            deserialized = deserialize(data);
+        }
+        catch (e) {
+            call.cancelWithStatus(constants_1.Status.INTERNAL, 'Failed to parse server response');
+            return;
+        }
+        if (!stream.push(deserialized)) {
+            call.pause();
+        }
+    });
+    call.on('end', () => {
+        if (statusEmitted) {
+            stream.push(null);
+        }
+        else {
+            call.once('status', () => {
+                stream.push(null);
+            });
+        }
+    });
+    call.on('status', (status) => {
+        if (status.code !== constants_1.Status.OK) {
+            const error = Object.assign(new Error(status.details), status);
+            stream.emit('error', error);
+        }
+        stream.emit('status', status);
+        statusEmitted = true;
+    });
+    call.pause();
+}
+class ClientReadableStreamImpl extends stream_1.Readable {
+    constructor(call, deserialize) {
+        super({ objectMode: true });
+        this.call = call;
+        this.deserialize = deserialize;
+        call.on('metadata', (metadata) => {
+            this.emit('metadata', metadata);
+        });
+        setUpReadableStream(this, call, deserialize);
+    }
+    cancel() {
+        this.call.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');
+    }
+    getPeer() {
+        return this.call.getPeer();
+    }
+    _read(_size) {
+        this.call.resume();
+    }
+}
+exports.ClientReadableStreamImpl = ClientReadableStreamImpl;
+function tryWrite(call, serialize, chunk, encoding, cb) {
+    let message;
+    const flags = Number(encoding);
+    try {
+        message = serialize(chunk);
+    }
+    catch (e) {
+        call.cancelWithStatus(constants_1.Status.INTERNAL, 'Serialization failure');
+        cb(e);
+        return;
+    }
+    const writeObj = { message };
+    if (!Number.isNaN(flags)) {
+        writeObj.flags = flags;
+    }
+    call.write(writeObj, cb);
+}
+class ClientWritableStreamImpl extends stream_1.Writable {
+    constructor(call, serialize) {
+        super({ objectMode: true });
+        this.call = call;
+        this.serialize = serialize;
+        call.on('metadata', (metadata) => {
+            this.emit('metadata', metadata);
+        });
+        call.on('status', (status) => {
+            this.emit('status', status);
+        });
+    }
+    cancel() {
+        this.call.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');
+    }
+    getPeer() {
+        return this.call.getPeer();
+    }
+    _write(chunk, encoding, cb) {
+        tryWrite(this.call, this.serialize, chunk, encoding, cb);
+    }
+    _final(cb) {
+        this.call.end();
+        cb();
+    }
+}
+exports.ClientWritableStreamImpl = ClientWritableStreamImpl;
+class ClientDuplexStreamImpl extends stream_1.Duplex {
+    constructor(call, serialize, deserialize) {
+        super({ objectMode: true });
+        this.call = call;
+        this.serialize = serialize;
+        this.deserialize = deserialize;
+        call.on('metadata', (metadata) => {
+            this.emit('metadata', metadata);
+        });
+        setUpReadableStream(this, call, deserialize);
+    }
+    cancel() {
+        this.call.cancelWithStatus(constants_1.Status.CANCELLED, 'Cancelled on client');
+    }
+    getPeer() {
+        return this.call.getPeer();
+    }
+    _read(_size) {
+        this.call.resume();
+    }
+    _write(chunk, encoding, cb) {
+        tryWrite(this.call, this.serialize, chunk, encoding, cb);
+    }
+    _final(cb) {
+        this.call.end();
+        cb();
+    }
+}
+exports.ClientDuplexStreamImpl = ClientDuplexStreamImpl;
+//# sourceMappingURL=call.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-credentials.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-credentials.d.ts
new file mode 100644 (file)
index 0000000..0cb7cdf
--- /dev/null
@@ -0,0 +1,73 @@
+/// <reference types="node" />
+import { ConnectionOptions } from 'tls';
+import { CallCredentials } from './call-credentials';
+/**
+ * A certificate as received by the checkServerIdentity callback.
+ */
+export interface Certificate {
+    /**
+     * The raw certificate in DER form.
+     */
+    raw: Buffer;
+}
+/**
+ * A callback that will receive the expected hostname and presented peer
+ * certificate as parameters. The callback should return an error to
+ * indicate that the presented certificate is considered invalid and
+ * otherwise returned undefined.
+ */
+export declare type CheckServerIdentityCallback = (hostname: string, cert: Certificate) => Error | undefined;
+/**
+ * Additional peer verification options that can be set when creating
+ * SSL credentials.
+ */
+export interface VerifyOptions {
+    /**
+     * If set, this callback will be invoked after the usual hostname verification
+     * has been performed on the peer certificate.
+     */
+    checkServerIdentity?: CheckServerIdentityCallback;
+}
+/**
+ * A class that contains credentials for communicating over a channel, as well
+ * as a set of per-call credentials, which are applied to every method call made
+ * over a channel initialized with an instance of this class.
+ */
+export declare abstract class ChannelCredentials {
+    protected callCredentials: CallCredentials;
+    protected constructor(callCredentials?: CallCredentials);
+    /**
+     * Returns a copy of this object with the included set of per-call credentials
+     * expanded to include callCredentials.
+     * @param callCredentials A CallCredentials object to associate with this
+     * instance.
+     */
+    abstract compose(callCredentials: CallCredentials): ChannelCredentials;
+    /**
+     * Gets the set of per-call credentials associated with this instance.
+     */
+    _getCallCredentials(): CallCredentials;
+    /**
+     * Gets a SecureContext object generated from input parameters if this
+     * instance was created with createSsl, or null if this instance was created
+     * with createInsecure.
+     */
+    abstract _getConnectionOptions(): ConnectionOptions | null;
+    /**
+     * Indicates whether this credentials object creates a secure channel.
+     */
+    abstract _isSecure(): boolean;
+    /**
+     * Return a new ChannelCredentials instance with a given set of credentials.
+     * The resulting instance can be used to construct a Channel that communicates
+     * over TLS.
+     * @param rootCerts The root certificate data.
+     * @param privateKey The client certificate private key, if available.
+     * @param certChain The client certificate key chain, if available.
+     */
+    static createSsl(rootCerts?: Buffer | null, privateKey?: Buffer | null, certChain?: Buffer | null, verifyOptions?: VerifyOptions): ChannelCredentials;
+    /**
+     * Return a new ChannelCredentials instance with no credentials.
+     */
+    static createInsecure(): ChannelCredentials;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-credentials.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-credentials.js
new file mode 100644 (file)
index 0000000..89689ff
--- /dev/null
@@ -0,0 +1,96 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const tls_1 = require("tls");
+const call_credentials_1 = require("./call-credentials");
+// tslint:disable-next-line:no-any
+function verifyIsBufferOrNull(obj, friendlyName) {
+    if (obj && !(obj instanceof Buffer)) {
+        throw new TypeError(`${friendlyName}, if provided, must be a Buffer.`);
+    }
+}
+/**
+ * A class that contains credentials for communicating over a channel, as well
+ * as a set of per-call credentials, which are applied to every method call made
+ * over a channel initialized with an instance of this class.
+ */
+class ChannelCredentials {
+    constructor(callCredentials) {
+        this.callCredentials = callCredentials || call_credentials_1.CallCredentials.createEmpty();
+    }
+    /**
+     * Gets the set of per-call credentials associated with this instance.
+     */
+    _getCallCredentials() {
+        return this.callCredentials;
+    }
+    /**
+     * Return a new ChannelCredentials instance with a given set of credentials.
+     * The resulting instance can be used to construct a Channel that communicates
+     * over TLS.
+     * @param rootCerts The root certificate data.
+     * @param privateKey The client certificate private key, if available.
+     * @param certChain The client certificate key chain, if available.
+     */
+    static createSsl(rootCerts, privateKey, certChain, verifyOptions) {
+        verifyIsBufferOrNull(rootCerts, 'Root certificate');
+        verifyIsBufferOrNull(privateKey, 'Private key');
+        verifyIsBufferOrNull(certChain, 'Certificate chain');
+        if (privateKey && !certChain) {
+            throw new Error('Private key must be given with accompanying certificate chain');
+        }
+        if (!privateKey && certChain) {
+            throw new Error('Certificate chain must be given with accompanying private key');
+        }
+        const secureContext = tls_1.createSecureContext({
+            ca: rootCerts || undefined,
+            key: privateKey || undefined,
+            cert: certChain || undefined
+        });
+        const connectionOptions = { secureContext };
+        if (verifyOptions && verifyOptions.checkServerIdentity) {
+            connectionOptions.checkServerIdentity =
+                (host, cert) => {
+                    return verifyOptions.checkServerIdentity(host, { raw: cert.raw });
+                };
+        }
+        return new SecureChannelCredentialsImpl(connectionOptions);
+    }
+    /**
+     * Return a new ChannelCredentials instance with no credentials.
+     */
+    static createInsecure() {
+        return new InsecureChannelCredentialsImpl();
+    }
+}
+exports.ChannelCredentials = ChannelCredentials;
+class InsecureChannelCredentialsImpl extends ChannelCredentials {
+    constructor(callCredentials) {
+        super(callCredentials);
+    }
+    compose(callCredentials) {
+        throw new Error('Cannot compose insecure credentials');
+    }
+    _getConnectionOptions() {
+        return null;
+    }
+    _isSecure() {
+        return false;
+    }
+}
+class SecureChannelCredentialsImpl extends ChannelCredentials {
+    constructor(connectionOptions, callCredentials) {
+        super(callCredentials);
+        this.connectionOptions = connectionOptions;
+    }
+    compose(callCredentials) {
+        const combinedCallCredentials = this.callCredentials.compose(callCredentials);
+        return new SecureChannelCredentialsImpl(this.connectionOptions, combinedCallCredentials);
+    }
+    _getConnectionOptions() {
+        return this.connectionOptions;
+    }
+    _isSecure() {
+        return true;
+    }
+}
+//# sourceMappingURL=channel-credentials.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-options.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-options.d.ts
new file mode 100644 (file)
index 0000000..dc7d666
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+ * An interface that contains options used when initializing a Channel instance.
+ */
+export interface ChannelOptions {
+    'grpc.ssl_target_name_override': string;
+    'grpc.primary_user_agent': string;
+    'grpc.secondary_user_agent': string;
+    'grpc.default_authority': string;
+    'grpc.keepalive_time_ms': number;
+    'grpc.keepalive_timeout_ms': number;
+    [key: string]: string | number;
+}
+/**
+ * This is for checking provided options at runtime. This is an object for
+ * easier membership checking.
+ */
+export declare const recognizedOptions: {
+    'grpc.ssl_target_name_override': boolean;
+    'grpc.primary_user_agent': boolean;
+    'grpc.secondary_user_agent': boolean;
+    'grpc.default_authority': boolean;
+    'grpc.keepalive_time_ms': boolean;
+    'grpc.keepalive_timeout_ms': boolean;
+};
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-options.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel-options.js
new file mode 100644 (file)
index 0000000..5abebf6
--- /dev/null
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * This is for checking provided options at runtime. This is an object for
+ * easier membership checking.
+ */
+exports.recognizedOptions = {
+    'grpc.ssl_target_name_override': true,
+    'grpc.primary_user_agent': true,
+    'grpc.secondary_user_agent': true,
+    'grpc.default_authority': true,
+    'grpc.keepalive_time_ms': true,
+    'grpc.keepalive_timeout_ms': true
+};
+//# sourceMappingURL=channel-options.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel.d.ts
new file mode 100644 (file)
index 0000000..b6ad83e
--- /dev/null
@@ -0,0 +1,92 @@
+/// <reference types="node" />
+import { EventEmitter } from 'events';
+import { Call, Deadline, Http2CallStream } from './call-stream';
+import { ChannelCredentials } from './channel-credentials';
+import { ChannelOptions } from './channel-options';
+import { Metadata } from './metadata';
+export declare enum ConnectivityState {
+    CONNECTING = 0,
+    READY = 1,
+    TRANSIENT_FAILURE = 2,
+    IDLE = 3,
+    SHUTDOWN = 4
+}
+/**
+ * An interface that represents a communication channel to a server specified
+ * by a given address.
+ */
+export interface Channel {
+    /**
+     * Close the channel. This has the same functionality as the existing
+     * grpc.Client.prototype.close
+     */
+    close(): void;
+    /**
+     * Return the target that this channel connects to
+     */
+    getTarget(): string;
+    /**
+     * Get the channel's current connectivity state. This method is here mainly
+     * because it is in the existing internal Channel class, and there isn't
+     * another good place to put it.
+     * @param tryToConnect If true, the channel will start connecting if it is
+     *     idle. Otherwise, idle channels will only start connecting when a
+     *     call starts.
+     */
+    getConnectivityState(tryToConnect: boolean): ConnectivityState;
+    /**
+     * Watch for connectivity state changes. This is also here mainly because
+     * it is in the existing external Channel class.
+     * @param currentState The state to watch for transitions from. This should
+     *     always be populated by calling getConnectivityState immediately
+     *     before.
+     * @param deadline A deadline for waiting for a state change
+     * @param callback Called with no error when a state change, or with an
+     *     error if the deadline passes without a state change.
+     */
+    watchConnectivityState(currentState: ConnectivityState, deadline: Date | number, callback: (error?: Error) => void): void;
+    /**
+     * Create a call object. Call is an opaque type that is used by the Client
+     * class. This function is called by the gRPC library when starting a
+     * request. Implementers should return an instance of Call that is returned
+     * from calling createCall on an instance of the provided Channel class.
+     * @param method The full method string to request.
+     * @param deadline The call deadline
+     * @param host A host string override for making the request
+     * @param parentCall A server call to propagate some information from
+     * @param propagateFlags A bitwise combination of elements of grpc.propagate
+     *     that indicates what information to propagate from parentCall.
+     */
+    createCall(method: string, deadline: Deadline | null | undefined, host: string | null | undefined, parentCall: Call | null | undefined, propagateFlags: number | null | undefined): Call;
+}
+export declare class Http2Channel extends EventEmitter implements Channel {
+    readonly credentials: ChannelCredentials;
+    private readonly options;
+    private readonly userAgent;
+    private readonly target;
+    private readonly defaultAuthority;
+    private connectivityState;
+    private connecting;
+    private subChannel;
+    private filterStackFactory;
+    private subChannelConnectCallback;
+    private subChannelCloseCallback;
+    private backoffTimerId;
+    private currentBackoff;
+    private currentBackoffDeadline;
+    private handleStateChange;
+    private transitionToState;
+    private startConnecting;
+    constructor(address: string, credentials: ChannelCredentials, options: Partial<ChannelOptions>);
+    _startHttp2Stream(authority: string, methodName: string, stream: Http2CallStream, metadata: Metadata): void;
+    createCall(method: string, deadline: Deadline | null | undefined, host: string | null | undefined, parentCall: Call | null | undefined, propagateFlags: number | null | undefined): Call;
+    /**
+     * Attempts to connect, returning a Promise that resolves when the connection
+     * is successful, or rejects if the channel is shut down.
+     */
+    private connect;
+    getConnectivityState(tryToConnect: boolean): ConnectivityState;
+    watchConnectivityState(currentState: ConnectivityState, deadline: Date | number, callback: (error?: Error) => void): void;
+    getTarget(): string;
+    close(): void;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/channel.js
new file mode 100644 (file)
index 0000000..2ecca4e
--- /dev/null
@@ -0,0 +1,297 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const events_1 = require("events");
+const http2 = require("http2");
+const tls_1 = require("tls");
+const url = require("url");
+const call_credentials_filter_1 = require("./call-credentials-filter");
+const call_stream_1 = require("./call-stream");
+const channel_options_1 = require("./channel-options");
+const compression_filter_1 = require("./compression-filter");
+const constants_1 = require("./constants");
+const deadline_filter_1 = require("./deadline-filter");
+const filter_stack_1 = require("./filter-stack");
+const metadata_status_filter_1 = require("./metadata-status-filter");
+const subchannel_1 = require("./subchannel");
+const { version: clientVersion } = require('../../package.json');
+const MIN_CONNECT_TIMEOUT_MS = 20000;
+const INITIAL_BACKOFF_MS = 1000;
+const BACKOFF_MULTIPLIER = 1.6;
+const MAX_BACKOFF_MS = 120000;
+const BACKOFF_JITTER = 0.2;
+const { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_TE, HTTP2_HEADER_USER_AGENT } = http2.constants;
+var ConnectivityState;
+(function (ConnectivityState) {
+    ConnectivityState[ConnectivityState["CONNECTING"] = 0] = "CONNECTING";
+    ConnectivityState[ConnectivityState["READY"] = 1] = "READY";
+    ConnectivityState[ConnectivityState["TRANSIENT_FAILURE"] = 2] = "TRANSIENT_FAILURE";
+    ConnectivityState[ConnectivityState["IDLE"] = 3] = "IDLE";
+    ConnectivityState[ConnectivityState["SHUTDOWN"] = 4] = "SHUTDOWN";
+})(ConnectivityState = exports.ConnectivityState || (exports.ConnectivityState = {}));
+function uniformRandom(min, max) {
+    return Math.random() * (max - min) + min;
+}
+class Http2Channel extends events_1.EventEmitter {
+    constructor(address, credentials, options) {
+        super();
+        this.credentials = credentials;
+        this.options = options;
+        this.connectivityState = ConnectivityState.IDLE;
+        // Helper Promise object only used in the implementation of connect().
+        this.connecting = null;
+        /* For now, we have up to one subchannel, which will exist as long as we are
+         * connecting or trying to connect */
+        this.subChannel = null;
+        this.subChannelConnectCallback = () => { };
+        this.subChannelCloseCallback = () => { };
+        this.currentBackoff = INITIAL_BACKOFF_MS;
+        for (const option in options) {
+            if (options.hasOwnProperty(option)) {
+                if (!channel_options_1.recognizedOptions.hasOwnProperty(option)) {
+                    console.warn(`Unrecognized channel argument '${option}' will be ignored.`);
+                }
+            }
+        }
+        if (credentials._isSecure()) {
+            this.target = new url.URL(`https://${address}`);
+        }
+        else {
+            this.target = new url.URL(`http://${address}`);
+        }
+        // TODO(murgatroid99): Add more centralized handling of channel options
+        if (this.options['grpc.default_authority']) {
+            this.defaultAuthority = this.options['grpc.default_authority'];
+        }
+        else {
+            this.defaultAuthority = this.target.host;
+        }
+        this.filterStackFactory = new filter_stack_1.FilterStackFactory([
+            new call_credentials_filter_1.CallCredentialsFilterFactory(this), new deadline_filter_1.DeadlineFilterFactory(this),
+            new metadata_status_filter_1.MetadataStatusFilterFactory(this), new compression_filter_1.CompressionFilterFactory(this)
+        ]);
+        this.currentBackoffDeadline = new Date();
+        /* The only purpose of these lines is to ensure that this.backoffTimerId has
+         * a value of type NodeJS.Timer. */
+        this.backoffTimerId = setTimeout(() => { }, 0);
+        // Build user-agent string.
+        this.userAgent = [
+            options['grpc.primary_user_agent'], `grpc-node-js/${clientVersion}`,
+            options['grpc.secondary_user_agent']
+        ].filter(e => e).join(' '); // remove falsey values first
+    }
+    handleStateChange(oldState, newState) {
+        const now = new Date();
+        switch (newState) {
+            case ConnectivityState.CONNECTING:
+                if (oldState === ConnectivityState.IDLE) {
+                    this.currentBackoff = INITIAL_BACKOFF_MS;
+                    this.currentBackoffDeadline =
+                        new Date(now.getTime() + INITIAL_BACKOFF_MS);
+                }
+                else if (oldState === ConnectivityState.TRANSIENT_FAILURE) {
+                    this.currentBackoff = Math.min(this.currentBackoff * BACKOFF_MULTIPLIER, MAX_BACKOFF_MS);
+                    const jitterMagnitude = BACKOFF_JITTER * this.currentBackoff;
+                    this.currentBackoffDeadline = new Date(now.getTime() + this.currentBackoff +
+                        uniformRandom(-jitterMagnitude, jitterMagnitude));
+                }
+                this.startConnecting();
+                break;
+            case ConnectivityState.READY:
+                this.emit('connect');
+                break;
+            case ConnectivityState.TRANSIENT_FAILURE:
+                this.subChannel = null;
+                this.backoffTimerId = setTimeout(() => {
+                    this.transitionToState([ConnectivityState.TRANSIENT_FAILURE], ConnectivityState.CONNECTING);
+                }, this.currentBackoffDeadline.getTime() - now.getTime());
+                break;
+            case ConnectivityState.IDLE:
+            case ConnectivityState.SHUTDOWN:
+                if (this.subChannel) {
+                    this.subChannel.close();
+                    this.subChannel.removeListener('connect', this.subChannelConnectCallback);
+                    this.subChannel.removeListener('close', this.subChannelCloseCallback);
+                    this.subChannel = null;
+                    this.emit('shutdown');
+                    clearTimeout(this.backoffTimerId);
+                }
+                break;
+            default:
+                throw new Error('This should never happen');
+        }
+    }
+    // Transition from any of a set of oldStates to a specific newState
+    transitionToState(oldStates, newState) {
+        if (oldStates.indexOf(this.connectivityState) > -1) {
+            const oldState = this.connectivityState;
+            this.connectivityState = newState;
+            this.handleStateChange(oldState, newState);
+            this.emit('connectivityStateChanged', newState);
+        }
+    }
+    startConnecting() {
+        const connectionOptions = this.credentials._getConnectionOptions() || {};
+        if (connectionOptions.secureContext !== null) {
+            // If provided, the value of grpc.ssl_target_name_override should be used
+            // to override the target hostname when checking server identity.
+            // This option is used for testing only.
+            if (this.options['grpc.ssl_target_name_override']) {
+                const sslTargetNameOverride = this.options['grpc.ssl_target_name_override'];
+                connectionOptions.checkServerIdentity =
+                    (host, cert) => {
+                        return tls_1.checkServerIdentity(sslTargetNameOverride, cert);
+                    };
+                connectionOptions.servername = sslTargetNameOverride;
+            }
+        }
+        const subChannel = new subchannel_1.Http2SubChannel(this.target, connectionOptions, this.userAgent, this.options);
+        this.subChannel = subChannel;
+        const now = new Date();
+        const connectionTimeout = Math.max(this.currentBackoffDeadline.getTime() - now.getTime(), MIN_CONNECT_TIMEOUT_MS);
+        const connectionTimerId = setTimeout(() => {
+            // This should trigger the 'close' event, which will send us back to
+            // TRANSIENT_FAILURE
+            subChannel.close();
+        }, connectionTimeout);
+        this.subChannelConnectCallback = () => {
+            // Connection succeeded
+            clearTimeout(connectionTimerId);
+            this.transitionToState([ConnectivityState.CONNECTING], ConnectivityState.READY);
+        };
+        subChannel.once('connect', this.subChannelConnectCallback);
+        this.subChannelCloseCallback = () => {
+            // Connection failed
+            clearTimeout(connectionTimerId);
+            /* TODO(murgatroid99): verify that this works for
+             * CONNECTING->TRANSITIVE_FAILURE see nodejs/node#16645 */
+            this.transitionToState([ConnectivityState.CONNECTING, ConnectivityState.READY], ConnectivityState.TRANSIENT_FAILURE);
+        };
+        subChannel.once('close', this.subChannelCloseCallback);
+    }
+    _startHttp2Stream(authority, methodName, stream, metadata) {
+        const finalMetadata = stream.filterStack.sendMetadata(Promise.resolve(metadata.clone()));
+        Promise.all([finalMetadata, this.connect()])
+            .then(([metadataValue]) => {
+            const headers = metadataValue.toHttp2Headers();
+            headers[HTTP2_HEADER_AUTHORITY] = authority;
+            headers[HTTP2_HEADER_USER_AGENT] = this.userAgent;
+            headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/grpc';
+            headers[HTTP2_HEADER_METHOD] = 'POST';
+            headers[HTTP2_HEADER_PATH] = methodName;
+            headers[HTTP2_HEADER_TE] = 'trailers';
+            if (this.connectivityState === ConnectivityState.READY) {
+                const subChannel = this.subChannel;
+                subChannel.startCallStream(metadataValue, stream);
+            }
+            else {
+                /* In this case, we lost the connection while finalizing
+                 * metadata. That should be very unusual */
+                setImmediate(() => {
+                    this._startHttp2Stream(authority, methodName, stream, metadata);
+                });
+            }
+        })
+            .catch((error) => {
+            // We assume the error code isn't 0 (Status.OK)
+            stream.cancelWithStatus(error.code || constants_1.Status.UNKNOWN, `Getting metadata from plugin failed with error: ${error.message}`);
+        });
+    }
+    createCall(method, deadline, host, parentCall, propagateFlags) {
+        if (this.connectivityState === ConnectivityState.SHUTDOWN) {
+            throw new Error('Channel has been shut down');
+        }
+        const finalOptions = {
+            deadline: (deadline === null || deadline === undefined) ? Infinity :
+                deadline,
+            flags: propagateFlags || 0,
+            host: host || this.defaultAuthority,
+            parentCall: parentCall || null
+        };
+        const stream = new call_stream_1.Http2CallStream(method, this, finalOptions, this.filterStackFactory);
+        return stream;
+    }
+    /**
+     * Attempts to connect, returning a Promise that resolves when the connection
+     * is successful, or rejects if the channel is shut down.
+     */
+    connect() {
+        if (this.connectivityState === ConnectivityState.READY) {
+            return Promise.resolve();
+        }
+        else if (this.connectivityState === ConnectivityState.SHUTDOWN) {
+            return Promise.reject(new Error('Channel has been shut down'));
+        }
+        else {
+            // In effect, this.connecting is only assigned upon the first attempt to
+            // transition from IDLE to CONNECTING, so this condition could have also
+            // been (connectivityState === IDLE).
+            if (!this.connecting) {
+                this.connecting = new Promise((resolve, reject) => {
+                    this.transitionToState([ConnectivityState.IDLE], ConnectivityState.CONNECTING);
+                    const onConnect = () => {
+                        this.connecting = null;
+                        this.removeListener('shutdown', onShutdown);
+                        resolve();
+                    };
+                    const onShutdown = () => {
+                        this.connecting = null;
+                        this.removeListener('connect', onConnect);
+                        reject(new Error('Channel has been shut down'));
+                    };
+                    this.once('connect', onConnect);
+                    this.once('shutdown', onShutdown);
+                });
+            }
+            return this.connecting;
+        }
+    }
+    getConnectivityState(tryToConnect) {
+        if (tryToConnect) {
+            this.transitionToState([ConnectivityState.IDLE], ConnectivityState.CONNECTING);
+        }
+        return this.connectivityState;
+    }
+    watchConnectivityState(currentState, deadline, callback) {
+        if (this.connectivityState !== currentState) {
+            /* If the connectivity state is different from the provided currentState,
+             * we assume that a state change has successfully occurred */
+            setImmediate(callback);
+        }
+        else {
+            let deadlineMs = 0;
+            if (deadline instanceof Date) {
+                deadlineMs = deadline.getTime();
+            }
+            else {
+                deadlineMs = deadline;
+            }
+            let timeout = deadlineMs - Date.now();
+            if (timeout < 0) {
+                timeout = 0;
+            }
+            const timeoutId = setTimeout(() => {
+                this.removeListener('connectivityStateChanged', eventCb);
+                callback(new Error('Channel state did not change before deadline'));
+            }, timeout);
+            const eventCb = () => {
+                clearTimeout(timeoutId);
+                callback();
+            };
+            this.once('connectivityStateChanged', eventCb);
+        }
+    }
+    getTarget() {
+        return this.target.toString();
+    }
+    close() {
+        if (this.connectivityState === ConnectivityState.SHUTDOWN) {
+            throw new Error('Channel has been shut down');
+        }
+        this.transitionToState([
+            ConnectivityState.CONNECTING, ConnectivityState.READY,
+            ConnectivityState.TRANSIENT_FAILURE, ConnectivityState.IDLE
+        ], ConnectivityState.SHUTDOWN);
+    }
+}
+exports.Http2Channel = Http2Channel;
+//# sourceMappingURL=channel.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/client.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/client.d.ts
new file mode 100644 (file)
index 0000000..ba9b7a0
--- /dev/null
@@ -0,0 +1,49 @@
+/// <reference types="node" />
+import { ClientDuplexStream, ClientReadableStream, ClientUnaryCall, ClientWritableStream, ServiceError } from './call';
+import { CallCredentials } from './call-credentials';
+import { Call, Deadline } from './call-stream';
+import { Channel } from './channel';
+import { ChannelCredentials } from './channel-credentials';
+import { ChannelOptions } from './channel-options';
+import { Metadata } from './metadata';
+export declare const kChannel: unique symbol;
+export interface UnaryCallback<ResponseType> {
+    (err: ServiceError | null, value?: ResponseType): void;
+}
+export interface CallOptions {
+    deadline?: Deadline;
+    host?: string;
+    parent?: Call;
+    propagate_flags?: number;
+    credentials?: CallCredentials;
+}
+export declare type ClientOptions = Partial<ChannelOptions> & {
+    channelOverride?: Channel;
+    channelFactoryOverride?: (address: string, credentials: ChannelCredentials, options: ClientOptions) => Channel;
+};
+/**
+ * A generic gRPC client. Primarily useful as a base class for all generated
+ * clients.
+ */
+export declare class Client {
+    private readonly [kChannel];
+    constructor(address: string, credentials: ChannelCredentials, options?: ClientOptions);
+    close(): void;
+    getChannel(): Channel;
+    waitForReady(deadline: Deadline, callback: (error?: Error) => void): void;
+    private handleUnaryResponse;
+    private checkOptionalUnaryResponseArguments;
+    makeUnaryRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, metadata: Metadata, options: CallOptions, callback: UnaryCallback<ResponseType>): ClientUnaryCall;
+    makeUnaryRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, metadata: Metadata, callback: UnaryCallback<ResponseType>): ClientUnaryCall;
+    makeUnaryRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, options: CallOptions, callback: UnaryCallback<ResponseType>): ClientUnaryCall;
+    makeUnaryRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, callback: UnaryCallback<ResponseType>): ClientUnaryCall;
+    makeClientStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, metadata: Metadata, options: CallOptions, callback: UnaryCallback<ResponseType>): ClientWritableStream<RequestType>;
+    makeClientStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, metadata: Metadata, callback: UnaryCallback<ResponseType>): ClientWritableStream<RequestType>;
+    makeClientStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, options: CallOptions, callback: UnaryCallback<ResponseType>): ClientWritableStream<RequestType>;
+    makeClientStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, callback: UnaryCallback<ResponseType>): ClientWritableStream<RequestType>;
+    private checkMetadataAndOptions;
+    makeServerStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, metadata: Metadata, options?: CallOptions): ClientReadableStream<ResponseType>;
+    makeServerStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, argument: RequestType, options?: CallOptions): ClientReadableStream<ResponseType>;
+    makeBidiStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, metadata: Metadata, options?: CallOptions): ClientDuplexStream<RequestType, ResponseType>;
+    makeBidiStreamRequest<RequestType, ResponseType>(method: string, serialize: (value: RequestType) => Buffer, deserialize: (value: Buffer) => ResponseType, options?: CallOptions): ClientDuplexStream<RequestType, ResponseType>;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/client.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/client.js
new file mode 100644 (file)
index 0000000..9e4ae72
--- /dev/null
@@ -0,0 +1,186 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const call_1 = require("./call");
+const channel_1 = require("./channel");
+const constants_1 = require("./constants");
+const metadata_1 = require("./metadata");
+// This symbol must be exported (for now).
+// See: https://github.com/Microsoft/TypeScript/issues/20080
+exports.kChannel = Symbol();
+/**
+ * A generic gRPC client. Primarily useful as a base class for all generated
+ * clients.
+ */
+class Client {
+    constructor(address, credentials, options = {}) {
+        if (options.channelOverride) {
+            this[exports.kChannel] = options.channelOverride;
+        }
+        else if (options.channelFactoryOverride) {
+            this[exports.kChannel] =
+                options.channelFactoryOverride(address, credentials, options);
+        }
+        else {
+            this[exports.kChannel] = new channel_1.Http2Channel(address, credentials, options);
+        }
+    }
+    close() {
+        this[exports.kChannel].close();
+    }
+    getChannel() {
+        return this[exports.kChannel];
+    }
+    waitForReady(deadline, callback) {
+        const checkState = (err) => {
+            if (err) {
+                callback(new Error('Failed to connect before the deadline'));
+                return;
+            }
+            let newState;
+            try {
+                newState = this[exports.kChannel].getConnectivityState(true);
+            }
+            catch (e) {
+                callback(new Error('The channel has been closed'));
+                return;
+            }
+            if (newState === channel_1.ConnectivityState.READY) {
+                callback();
+            }
+            else {
+                try {
+                    this[exports.kChannel].watchConnectivityState(newState, deadline, checkState);
+                }
+                catch (e) {
+                    callback(new Error('The channel has been closed'));
+                }
+            }
+        };
+        setImmediate(checkState);
+    }
+    handleUnaryResponse(call, deserialize, callback) {
+        let responseMessage = null;
+        call.on('data', (data) => {
+            if (responseMessage != null) {
+                call.cancelWithStatus(constants_1.Status.INTERNAL, 'Too many responses received');
+            }
+            try {
+                responseMessage = deserialize(data);
+            }
+            catch (e) {
+                call.cancelWithStatus(constants_1.Status.INTERNAL, 'Failed to parse server response');
+            }
+        });
+        call.on('end', () => {
+            if (responseMessage == null) {
+                call.cancelWithStatus(constants_1.Status.INTERNAL, 'Not enough responses received');
+            }
+        });
+        call.on('status', (status) => {
+            /* We assume that call emits status after it emits end, and that it
+             * accounts for any cancelWithStatus calls up until it emits status.
+             * Therefore, considering the above event handlers, status.code should be
+             * OK if and only if we have a non-null responseMessage */
+            if (status.code === constants_1.Status.OK) {
+                callback(null, responseMessage);
+            }
+            else {
+                const error = Object.assign(new Error(status.details), status);
+                callback(error);
+            }
+        });
+    }
+    checkOptionalUnaryResponseArguments(arg1, arg2, arg3) {
+        if (arg1 instanceof Function) {
+            return { metadata: new metadata_1.Metadata(), options: {}, callback: arg1 };
+        }
+        else if (arg2 instanceof Function) {
+            if (arg1 instanceof metadata_1.Metadata) {
+                return { metadata: arg1, options: {}, callback: arg2 };
+            }
+            else {
+                return { metadata: new metadata_1.Metadata(), options: arg1, callback: arg2 };
+            }
+        }
+        else {
+            if (!((arg1 instanceof metadata_1.Metadata) && (arg2 instanceof Object) &&
+                (arg3 instanceof Function))) {
+                throw new Error('Incorrect arguments passed');
+            }
+            return { metadata: arg1, options: arg2, callback: arg3 };
+        }
+    }
+    makeUnaryRequest(method, serialize, deserialize, argument, metadata, options, callback) {
+        ({ metadata, options, callback } =
+            this.checkOptionalUnaryResponseArguments(metadata, options, callback));
+        const call = this[exports.kChannel].createCall(method, options.deadline, options.host, options.parent, options.propagate_flags);
+        if (options.credentials) {
+            call.setCredentials(options.credentials);
+        }
+        const message = serialize(argument);
+        const writeObj = { message };
+        call.sendMetadata(metadata);
+        call.write(writeObj);
+        call.end();
+        this.handleUnaryResponse(call, deserialize, callback);
+        return new call_1.ClientUnaryCallImpl(call);
+    }
+    makeClientStreamRequest(method, serialize, deserialize, metadata, options, callback) {
+        ({ metadata, options, callback } =
+            this.checkOptionalUnaryResponseArguments(metadata, options, callback));
+        const call = this[exports.kChannel].createCall(method, options.deadline, options.host, options.parent, options.propagate_flags);
+        if (options.credentials) {
+            call.setCredentials(options.credentials);
+        }
+        call.sendMetadata(metadata);
+        this.handleUnaryResponse(call, deserialize, callback);
+        return new call_1.ClientWritableStreamImpl(call, serialize);
+    }
+    checkMetadataAndOptions(arg1, arg2) {
+        let metadata;
+        let options;
+        if (arg1 instanceof metadata_1.Metadata) {
+            metadata = arg1;
+            if (arg2) {
+                options = arg2;
+            }
+            else {
+                options = {};
+            }
+        }
+        else {
+            if (arg1) {
+                options = arg1;
+            }
+            else {
+                options = {};
+            }
+            metadata = new metadata_1.Metadata();
+        }
+        return { metadata, options };
+    }
+    makeServerStreamRequest(method, serialize, deserialize, argument, metadata, options) {
+        ({ metadata, options } = this.checkMetadataAndOptions(metadata, options));
+        const call = this[exports.kChannel].createCall(method, options.deadline, options.host, options.parent, options.propagate_flags);
+        if (options.credentials) {
+            call.setCredentials(options.credentials);
+        }
+        const message = serialize(argument);
+        const writeObj = { message };
+        call.sendMetadata(metadata);
+        call.write(writeObj);
+        call.end();
+        return new call_1.ClientReadableStreamImpl(call, deserialize);
+    }
+    makeBidiStreamRequest(method, serialize, deserialize, metadata, options) {
+        ({ metadata, options } = this.checkMetadataAndOptions(metadata, options));
+        const call = this[exports.kChannel].createCall(method, options.deadline, options.host, options.parent, options.propagate_flags);
+        if (options.credentials) {
+            call.setCredentials(options.credentials);
+        }
+        call.sendMetadata(metadata);
+        return new call_1.ClientDuplexStreamImpl(call, serialize, deserialize);
+    }
+}
+exports.Client = Client;
+//# sourceMappingURL=client.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/compression-filter.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/compression-filter.d.ts
new file mode 100644 (file)
index 0000000..73c1d2c
--- /dev/null
@@ -0,0 +1,18 @@
+/// <reference types="node" />
+import { Call, WriteObject } from './call-stream';
+import { Channel } from './channel';
+import { BaseFilter, Filter, FilterFactory } from './filter';
+import { Metadata } from './metadata';
+export declare class CompressionFilter extends BaseFilter implements Filter {
+    private sendCompression;
+    private receiveCompression;
+    sendMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    receiveMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    sendMessage(message: Promise<WriteObject>): Promise<WriteObject>;
+    receiveMessage(message: Promise<Buffer>): Promise<Buffer>;
+}
+export declare class CompressionFilterFactory implements FilterFactory<CompressionFilter> {
+    private readonly channel;
+    constructor(channel: Channel);
+    createFilter(callStream: Call): CompressionFilter;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/compression-filter.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/compression-filter.js
new file mode 100644 (file)
index 0000000..978f267
--- /dev/null
@@ -0,0 +1,185 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const zlib = require("zlib");
+const filter_1 = require("./filter");
+class CompressionHandler {
+    /**
+     * @param message Raw uncompressed message bytes
+     * @param compress Indicates whether the message should be compressed
+     * @return Framed message, compressed if applicable
+     */
+    async writeMessage(message, compress) {
+        let messageBuffer = message;
+        if (compress) {
+            messageBuffer = await this.compressMessage(messageBuffer);
+        }
+        const output = Buffer.allocUnsafe(messageBuffer.length + 5);
+        output.writeUInt8(compress ? 1 : 0, 0);
+        output.writeUInt32BE(messageBuffer.length, 1);
+        messageBuffer.copy(output, 5);
+        return output;
+    }
+    /**
+     * @param data Framed message, possibly compressed
+     * @return Uncompressed message
+     */
+    async readMessage(data) {
+        const compressed = data.readUInt8(0) === 1;
+        let messageBuffer = data.slice(5);
+        if (compressed) {
+            messageBuffer = await this.decompressMessage(messageBuffer);
+        }
+        return messageBuffer;
+    }
+}
+class IdentityHandler extends CompressionHandler {
+    async compressMessage(message) {
+        return message;
+    }
+    async writeMessage(message, compress) {
+        const output = Buffer.allocUnsafe(message.length + 5);
+        /* With "identity" compression, messages should always be marked as
+         * uncompressed */
+        output.writeUInt8(0, 0);
+        output.writeUInt32BE(message.length, 1);
+        message.copy(output, 5);
+        return output;
+    }
+    decompressMessage(message) {
+        return Promise.reject(new Error('Received compressed message but "grpc-encoding" header was identity'));
+    }
+}
+class DeflateHandler extends CompressionHandler {
+    compressMessage(message) {
+        return new Promise((resolve, reject) => {
+            zlib.deflate(message, (err, output) => {
+                if (err) {
+                    reject(err);
+                }
+                else {
+                    resolve(output);
+                }
+            });
+        });
+    }
+    decompressMessage(message) {
+        return new Promise((resolve, reject) => {
+            zlib.inflate(message, (err, output) => {
+                if (err) {
+                    reject(err);
+                }
+                else {
+                    resolve(output);
+                }
+            });
+        });
+    }
+}
+class GzipHandler extends CompressionHandler {
+    compressMessage(message) {
+        return new Promise((resolve, reject) => {
+            zlib.gzip(message, (err, output) => {
+                if (err) {
+                    reject(err);
+                }
+                else {
+                    resolve(output);
+                }
+            });
+        });
+    }
+    decompressMessage(message) {
+        return new Promise((resolve, reject) => {
+            zlib.unzip(message, (err, output) => {
+                if (err) {
+                    reject(err);
+                }
+                else {
+                    resolve(output);
+                }
+            });
+        });
+    }
+}
+class UnknownHandler extends CompressionHandler {
+    constructor(compressionName) {
+        super();
+        this.compressionName = compressionName;
+    }
+    compressMessage(message) {
+        return Promise.reject(new Error(`Received message compressed wth unsupported compression method ${this.compressionName}`));
+    }
+    decompressMessage(message) {
+        // This should be unreachable
+        return Promise.reject(new Error(`Compression method not supported: ${this.compressionName}`));
+    }
+}
+function getCompressionHandler(compressionName) {
+    switch (compressionName) {
+        case 'identity':
+            return new IdentityHandler();
+        case 'deflate':
+            return new DeflateHandler();
+        case 'gzip':
+            return new GzipHandler();
+        default:
+            return new UnknownHandler(compressionName);
+    }
+}
+class CompressionFilter extends filter_1.BaseFilter {
+    constructor() {
+        super(...arguments);
+        this.sendCompression = new IdentityHandler();
+        this.receiveCompression = new IdentityHandler();
+    }
+    async sendMetadata(metadata) {
+        const headers = await metadata;
+        headers.set('grpc-encoding', 'identity');
+        headers.set('grpc-accept-encoding', 'identity,deflate,gzip');
+        return headers;
+    }
+    async receiveMetadata(metadata) {
+        const headers = await metadata;
+        const receiveEncoding = headers.get('grpc-encoding');
+        if (receiveEncoding.length > 0) {
+            const encoding = receiveEncoding[0];
+            if (typeof encoding === 'string') {
+                this.receiveCompression = getCompressionHandler(encoding);
+            }
+        }
+        headers.remove('grpc-encoding');
+        headers.remove('grpc-accept-encoding');
+        return headers;
+    }
+    async sendMessage(message) {
+        /* This filter is special. The input message is the bare message bytes,
+         * and the output is a framed and possibly compressed message. For this
+         * reason, this filter should be at the bottom of the filter stack */
+        const resolvedMessage = await message;
+        const compress = resolvedMessage.flags === undefined ?
+            false :
+            (resolvedMessage.flags & 2 /* NoCompress */) === 0;
+        return {
+            message: await this.sendCompression.writeMessage(resolvedMessage.message, compress),
+            flags: resolvedMessage.flags
+        };
+    }
+    async receiveMessage(message) {
+        /* This filter is also special. The input message is framed and possibly
+         * compressed, and the output message is deframed and uncompressed. So
+         * this is another reason that this filter should be at the bottom of the
+         * filter stack. */
+        return this.receiveCompression.readMessage(await message);
+    }
+}
+exports.CompressionFilter = CompressionFilter;
+class CompressionFilterFactory {
+    constructor(channel) {
+        this.channel = channel;
+    }
+    createFilter(callStream) {
+        return new CompressionFilter();
+    }
+}
+exports.CompressionFilterFactory = CompressionFilterFactory;
+//# sourceMappingURL=compression-filter.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/constants.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/constants.d.ts
new file mode 100644 (file)
index 0000000..d0f5eb0
--- /dev/null
@@ -0,0 +1,24 @@
+export declare enum Status {
+    OK = 0,
+    CANCELLED = 1,
+    UNKNOWN = 2,
+    INVALID_ARGUMENT = 3,
+    DEADLINE_EXCEEDED = 4,
+    NOT_FOUND = 5,
+    ALREADY_EXISTS = 6,
+    PERMISSION_DENIED = 7,
+    RESOURCE_EXHAUSTED = 8,
+    FAILED_PRECONDITION = 9,
+    ABORTED = 10,
+    OUT_OF_RANGE = 11,
+    UNIMPLEMENTED = 12,
+    INTERNAL = 13,
+    UNAVAILABLE = 14,
+    DATA_LOSS = 15,
+    UNAUTHENTICATED = 16
+}
+export declare enum LogVerbosity {
+    DEBUG = 0,
+    INFO = 1,
+    ERROR = 2
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/constants.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/constants.js
new file mode 100644 (file)
index 0000000..130a325
--- /dev/null
@@ -0,0 +1,29 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var Status;
+(function (Status) {
+    Status[Status["OK"] = 0] = "OK";
+    Status[Status["CANCELLED"] = 1] = "CANCELLED";
+    Status[Status["UNKNOWN"] = 2] = "UNKNOWN";
+    Status[Status["INVALID_ARGUMENT"] = 3] = "INVALID_ARGUMENT";
+    Status[Status["DEADLINE_EXCEEDED"] = 4] = "DEADLINE_EXCEEDED";
+    Status[Status["NOT_FOUND"] = 5] = "NOT_FOUND";
+    Status[Status["ALREADY_EXISTS"] = 6] = "ALREADY_EXISTS";
+    Status[Status["PERMISSION_DENIED"] = 7] = "PERMISSION_DENIED";
+    Status[Status["RESOURCE_EXHAUSTED"] = 8] = "RESOURCE_EXHAUSTED";
+    Status[Status["FAILED_PRECONDITION"] = 9] = "FAILED_PRECONDITION";
+    Status[Status["ABORTED"] = 10] = "ABORTED";
+    Status[Status["OUT_OF_RANGE"] = 11] = "OUT_OF_RANGE";
+    Status[Status["UNIMPLEMENTED"] = 12] = "UNIMPLEMENTED";
+    Status[Status["INTERNAL"] = 13] = "INTERNAL";
+    Status[Status["UNAVAILABLE"] = 14] = "UNAVAILABLE";
+    Status[Status["DATA_LOSS"] = 15] = "DATA_LOSS";
+    Status[Status["UNAUTHENTICATED"] = 16] = "UNAUTHENTICATED";
+})(Status = exports.Status || (exports.Status = {}));
+var LogVerbosity;
+(function (LogVerbosity) {
+    LogVerbosity[LogVerbosity["DEBUG"] = 0] = "DEBUG";
+    LogVerbosity[LogVerbosity["INFO"] = 1] = "INFO";
+    LogVerbosity[LogVerbosity["ERROR"] = 2] = "ERROR";
+})(LogVerbosity = exports.LogVerbosity || (exports.LogVerbosity = {}));
+//# sourceMappingURL=constants.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/deadline-filter.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/deadline-filter.d.ts
new file mode 100644 (file)
index 0000000..c645fd2
--- /dev/null
@@ -0,0 +1,17 @@
+import { Call } from './call-stream';
+import { Http2Channel } from './channel';
+import { BaseFilter, Filter, FilterFactory } from './filter';
+import { Metadata } from './metadata';
+export declare class DeadlineFilter extends BaseFilter implements Filter {
+    private readonly channel;
+    private readonly callStream;
+    private timer;
+    private deadline;
+    constructor(channel: Http2Channel, callStream: Call);
+    sendMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+}
+export declare class DeadlineFilterFactory implements FilterFactory<DeadlineFilter> {
+    private readonly channel;
+    constructor(channel: Http2Channel);
+    createFilter(callStream: Call): DeadlineFilter;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/deadline-filter.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/deadline-filter.js
new file mode 100644 (file)
index 0000000..b93476b
--- /dev/null
@@ -0,0 +1,85 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const channel_1 = require("./channel");
+const constants_1 = require("./constants");
+const filter_1 = require("./filter");
+const units = [['m', 1], ['S', 1000], ['M', 60 * 1000], ['H', 60 * 60 * 1000]];
+function getDeadline(deadline) {
+    const now = (new Date()).getTime();
+    const timeoutMs = Math.max(deadline - now, 0);
+    for (const [unit, factor] of units) {
+        const amount = timeoutMs / factor;
+        if (amount < 1e8) {
+            return String(Math.ceil(amount)) + unit;
+        }
+    }
+    throw new Error('Deadline is too far in the future');
+}
+class DeadlineFilter extends filter_1.BaseFilter {
+    constructor(channel, callStream) {
+        super();
+        this.channel = channel;
+        this.callStream = callStream;
+        this.timer = null;
+        const callDeadline = callStream.getDeadline();
+        if (callDeadline instanceof Date) {
+            this.deadline = callDeadline.getTime();
+        }
+        else {
+            this.deadline = callDeadline;
+        }
+        const now = (new Date()).getTime();
+        let timeout = this.deadline - now;
+        if (timeout < 0) {
+            timeout = 0;
+        }
+        if (this.deadline !== Infinity) {
+            this.timer = setTimeout(() => {
+                callStream.cancelWithStatus(constants_1.Status.DEADLINE_EXCEEDED, 'Deadline exceeded');
+            }, timeout);
+            callStream.on('status', () => clearTimeout(this.timer));
+        }
+    }
+    sendMetadata(metadata) {
+        if (this.deadline === Infinity) {
+            return metadata;
+        }
+        return new Promise((resolve, reject) => {
+            if (this.channel.getConnectivityState(false) ===
+                channel_1.ConnectivityState.READY) {
+                resolve(metadata);
+            }
+            else {
+                const handleStateChange = (newState) => {
+                    if (newState === channel_1.ConnectivityState.READY) {
+                        resolve(metadata);
+                        this.channel.removeListener('connectivityStateChanged', handleStateChange);
+                        this.callStream.removeListener('status', handleStatus);
+                    }
+                };
+                const handleStatus = () => {
+                    reject(new Error('Call ended'));
+                    this.channel.removeListener('connectivityStateChanged', handleStateChange);
+                };
+                this.channel.on('connectivityStateChanged', handleStateChange);
+                this.callStream.once('status', handleStatus);
+            }
+        })
+            .then((finalMetadata) => {
+            const timeoutString = getDeadline(this.deadline);
+            finalMetadata.set('grpc-timeout', timeoutString);
+            return finalMetadata;
+        });
+    }
+}
+exports.DeadlineFilter = DeadlineFilter;
+class DeadlineFilterFactory {
+    constructor(channel) {
+        this.channel = channel;
+    }
+    createFilter(callStream) {
+        return new DeadlineFilter(this.channel, callStream);
+    }
+}
+exports.DeadlineFilterFactory = DeadlineFilterFactory;
+//# sourceMappingURL=deadline-filter.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/events.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/events.d.ts
new file mode 100644 (file)
index 0000000..d1a764e
--- /dev/null
@@ -0,0 +1,9 @@
+export interface EmitterAugmentation1<Name extends string | symbol, Arg> {
+    addListener(event: Name, listener: (arg1: Arg) => void): this;
+    emit(event: Name, arg1: Arg): boolean;
+    on(event: Name, listener: (arg1: Arg) => void): this;
+    once(event: Name, listener: (arg1: Arg) => void): this;
+    prependListener(event: Name, listener: (arg1: Arg) => void): this;
+    prependOnceListener(event: Name, listener: (arg1: Arg) => void): this;
+    removeListener(event: Name, listener: (arg1: Arg) => void): this;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/events.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/events.js
new file mode 100644 (file)
index 0000000..003052c
--- /dev/null
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=events.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter-stack.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter-stack.d.ts
new file mode 100644 (file)
index 0000000..5d69854
--- /dev/null
@@ -0,0 +1,18 @@
+/// <reference types="node" />
+import { Call, StatusObject, WriteObject } from './call-stream';
+import { Filter, FilterFactory } from './filter';
+import { Metadata } from './metadata';
+export declare class FilterStack implements Filter {
+    private readonly filters;
+    constructor(filters: Filter[]);
+    sendMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    receiveMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    sendMessage(message: Promise<WriteObject>): Promise<WriteObject>;
+    receiveMessage(message: Promise<Buffer>): Promise<Buffer>;
+    receiveTrailers(status: Promise<StatusObject>): Promise<StatusObject>;
+}
+export declare class FilterStackFactory implements FilterFactory<FilterStack> {
+    private readonly factories;
+    constructor(factories: Array<FilterFactory<Filter>>);
+    createFilter(callStream: Call): FilterStack;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter-stack.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter-stack.js
new file mode 100644 (file)
index 0000000..f381f1d
--- /dev/null
@@ -0,0 +1,53 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class FilterStack {
+    constructor(filters) {
+        this.filters = filters;
+    }
+    sendMetadata(metadata) {
+        let result = metadata;
+        for (let i = 0; i < this.filters.length; i++) {
+            result = this.filters[i].sendMetadata(result);
+        }
+        return result;
+    }
+    receiveMetadata(metadata) {
+        let result = metadata;
+        for (let i = this.filters.length - 1; i >= 0; i--) {
+            result = this.filters[i].receiveMetadata(result);
+        }
+        return result;
+    }
+    sendMessage(message) {
+        let result = message;
+        for (let i = 0; i < this.filters.length; i++) {
+            result = this.filters[i].sendMessage(result);
+        }
+        return result;
+    }
+    receiveMessage(message) {
+        let result = message;
+        for (let i = this.filters.length - 1; i >= 0; i--) {
+            result = this.filters[i].receiveMessage(result);
+        }
+        return result;
+    }
+    receiveTrailers(status) {
+        let result = status;
+        for (let i = this.filters.length - 1; i >= 0; i--) {
+            result = this.filters[i].receiveTrailers(result);
+        }
+        return result;
+    }
+}
+exports.FilterStack = FilterStack;
+class FilterStackFactory {
+    constructor(factories) {
+        this.factories = factories;
+    }
+    createFilter(callStream) {
+        return new FilterStack(this.factories.map((factory) => factory.createFilter(callStream)));
+    }
+}
+exports.FilterStackFactory = FilterStackFactory;
+//# sourceMappingURL=filter-stack.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter.d.ts
new file mode 100644 (file)
index 0000000..b7addfa
--- /dev/null
@@ -0,0 +1,24 @@
+/// <reference types="node" />
+import { Call, StatusObject, WriteObject } from './call-stream';
+import { Metadata } from './metadata';
+/**
+ * Filter classes represent related per-call logic and state that is primarily
+ * used to modify incoming and outgoing data
+ */
+export interface Filter {
+    sendMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    receiveMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    sendMessage(message: Promise<WriteObject>): Promise<WriteObject>;
+    receiveMessage(message: Promise<Buffer>): Promise<Buffer>;
+    receiveTrailers(status: Promise<StatusObject>): Promise<StatusObject>;
+}
+export declare abstract class BaseFilter {
+    sendMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    receiveMetadata(metadata: Promise<Metadata>): Promise<Metadata>;
+    sendMessage(message: Promise<WriteObject>): Promise<WriteObject>;
+    receiveMessage(message: Promise<Buffer>): Promise<Buffer>;
+    receiveTrailers(status: Promise<StatusObject>): Promise<StatusObject>;
+}
+export interface FilterFactory<T extends Filter> {
+    createFilter(callStream: Call): T;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/filter.js
new file mode 100644 (file)
index 0000000..78480cf
--- /dev/null
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+class BaseFilter {
+    async sendMetadata(metadata) {
+        return metadata;
+    }
+    async receiveMetadata(metadata) {
+        return metadata;
+    }
+    async sendMessage(message) {
+        return message;
+    }
+    async receiveMessage(message) {
+        return message;
+    }
+    async receiveTrailers(status) {
+        return status;
+    }
+}
+exports.BaseFilter = BaseFilter;
+//# sourceMappingURL=filter.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/index.d.ts
new file mode 100644 (file)
index 0000000..8aac4ea
--- /dev/null
@@ -0,0 +1,46 @@
+/// <reference types="node" />
+import { Channel } from './channel';
+import { Client } from './client';
+import { LogVerbosity, Status } from './constants';
+import { loadPackageDefinition, makeClientConstructor } from './make-client';
+import { Metadata } from './metadata';
+import { StatusBuilder } from './status-builder';
+export interface OAuth2Client {
+    getRequestMetadata: (url: string, callback: (err: Error | null, headers?: {
+        Authorization: string;
+    }) => void) => void;
+    getRequestHeaders: (url?: string) => Promise<{
+        Authorization: string;
+    }>;
+}
+/**** Client Credentials ****/
+export declare const credentials: {
+    [key: string]: Function;
+};
+/**** Metadata ****/
+export { Metadata };
+/**** Constants ****/
+export { LogVerbosity as logVerbosity, Status as status };
+/**** Client ****/
+export { Client, loadPackageDefinition, makeClientConstructor, makeClientConstructor as makeGenericClientConstructor, Channel };
+/**
+ * Close a Client object.
+ * @param client The client to close.
+ */
+export declare const closeClient: (client: Client) => void;
+export declare const waitForClientReady: (client: Client, deadline: number | Date, callback: (error?: Error | undefined) => void) => void;
+/**** Unimplemented function stubs ****/
+export declare const loadObject: (value: any, options: any) => never;
+export declare const load: (filename: any, format: any, options: any) => never;
+export declare const setLogger: (logger: Partial<Console>) => void;
+export declare const setLogVerbosity: (verbosity: LogVerbosity) => void;
+export declare const Server: (options: any) => never;
+export declare const ServerCredentials: {
+    createSsl: (rootCerts: any, keyCertPairs: any, checkClientCertificate: any) => never;
+    createInsecure: () => never;
+};
+export declare const getClientChannel: (client: Client) => Channel;
+export { StatusBuilder };
+export declare const ListenerBuilder: () => never;
+export declare const InterceptorBuilder: () => never;
+export declare const InterceptingCall: () => never;
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/index.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/index.js
new file mode 100644 (file)
index 0000000..fe8f537
--- /dev/null
@@ -0,0 +1,137 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const semver = require("semver");
+const call_credentials_1 = require("./call-credentials");
+const channel_credentials_1 = require("./channel-credentials");
+const client_1 = require("./client");
+exports.Client = client_1.Client;
+const constants_1 = require("./constants");
+exports.logVerbosity = constants_1.LogVerbosity;
+exports.status = constants_1.Status;
+const logging = require("./logging");
+const make_client_1 = require("./make-client");
+exports.loadPackageDefinition = make_client_1.loadPackageDefinition;
+exports.makeClientConstructor = make_client_1.makeClientConstructor;
+exports.makeGenericClientConstructor = make_client_1.makeClientConstructor;
+const metadata_1 = require("./metadata");
+exports.Metadata = metadata_1.Metadata;
+const status_builder_1 = require("./status-builder");
+exports.StatusBuilder = status_builder_1.StatusBuilder;
+const supportedNodeVersions = '^8.11.2 || >=9.4';
+if (!semver.satisfies(process.version, supportedNodeVersions)) {
+    throw new Error(`@grpc/grpc-js only works on Node ${supportedNodeVersions}`);
+}
+function mixin(...sources) {
+    const result = {};
+    for (const source of sources) {
+        for (const propName of Object.getOwnPropertyNames(source)) {
+            const property = source[propName]; // tslint:disable-line no-any
+            if (typeof property === 'function') {
+                result[propName] = property;
+            }
+        }
+    }
+    return result;
+}
+/**** Client Credentials ****/
+// Using assign only copies enumerable properties, which is what we want
+exports.credentials = mixin({
+    /**
+     * Create a gRPC credential from a Google credential object.
+     * @param googleCredentials The authentication client to use.
+     * @return The resulting CallCredentials object.
+     */
+    createFromGoogleCredential: (googleCredentials) => {
+        return call_credentials_1.CallCredentials.createFromMetadataGenerator((options, callback) => {
+            // google-auth-library pre-v2.0.0 does not have getRequestHeaders
+            // but has getRequestMetadata, which is deprecated in v2.0.0
+            let getHeaders;
+            if (typeof googleCredentials.getRequestHeaders === 'function') {
+                getHeaders =
+                    googleCredentials.getRequestHeaders(options.service_url);
+            }
+            else {
+                getHeaders = new Promise((resolve, reject) => {
+                    googleCredentials.getRequestMetadata(options.service_url, (err, headers) => {
+                        if (err) {
+                            reject(err);
+                            return;
+                        }
+                        resolve(headers);
+                    });
+                });
+            }
+            getHeaders.then(headers => {
+                const metadata = new metadata_1.Metadata();
+                metadata.add('authorization', headers.Authorization);
+                callback(null, metadata);
+            }, err => {
+                callback(err);
+            });
+        });
+    },
+    /**
+     * Combine a ChannelCredentials with any number of CallCredentials into a
+     * single ChannelCredentials object.
+     * @param channelCredentials The ChannelCredentials object.
+     * @param callCredentials Any number of CallCredentials objects.
+     * @return The resulting ChannelCredentials object.
+     */
+    combineChannelCredentials: (channelCredentials, ...callCredentials) => {
+        return callCredentials.reduce((acc, other) => acc.compose(other), channelCredentials);
+    },
+    /**
+     * Combine any number of CallCredentials into a single CallCredentials
+     * object.
+     * @param first The first CallCredentials object.
+     * @param additional Any number of additional CallCredentials objects.
+     * @return The resulting CallCredentials object.
+     */
+    combineCallCredentials: (first, ...additional) => {
+        return additional.reduce((acc, other) => acc.compose(other), first);
+    }
+}, channel_credentials_1.ChannelCredentials, call_credentials_1.CallCredentials);
+/**
+ * Close a Client object.
+ * @param client The client to close.
+ */
+exports.closeClient = (client) => client.close();
+exports.waitForClientReady = (client, deadline, callback) => client.waitForReady(deadline, callback);
+/**** Unimplemented function stubs ****/
+/* tslint:disable:no-any variable-name */
+exports.loadObject = (value, options) => {
+    throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead');
+};
+exports.load = (filename, format, options) => {
+    throw new Error('Not available in this library. Use @grpc/proto-loader and loadPackageDefinition instead');
+};
+exports.setLogger = (logger) => {
+    logging.setLogger(logger);
+};
+exports.setLogVerbosity = (verbosity) => {
+    logging.setLoggerVerbosity(verbosity);
+};
+exports.Server = (options) => {
+    throw new Error('Not yet implemented');
+};
+exports.ServerCredentials = {
+    createSsl: (rootCerts, keyCertPairs, checkClientCertificate) => {
+        throw new Error('Not yet implemented');
+    },
+    createInsecure: () => {
+        throw new Error('Not yet implemented');
+    }
+};
+exports.getClientChannel = (client) => {
+    return client_1.Client.prototype.getChannel.call(client);
+};
+exports.ListenerBuilder = () => {
+    throw new Error('Not yet implemented');
+};
+exports.InterceptorBuilder = () => {
+    throw new Error('Not yet implemented');
+};
+exports.InterceptingCall = () => {
+    throw new Error('Not yet implemented');
+};
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/logging.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/logging.d.ts
new file mode 100644 (file)
index 0000000..e85362f
--- /dev/null
@@ -0,0 +1,6 @@
+/// <reference types="node" />
+import { LogVerbosity } from './constants';
+export declare const getLogger: () => Partial<Console>;
+export declare const setLogger: (logger: Partial<Console>) => void;
+export declare const setLoggerVerbosity: (verbosity: LogVerbosity) => void;
+export declare const log: (severity: LogVerbosity, ...args: any[]) => void;
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/logging.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/logging.js
new file mode 100644 (file)
index 0000000..a918fa6
--- /dev/null
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const constants_1 = require("./constants");
+let _logger = console;
+let _logVerbosity = constants_1.LogVerbosity.DEBUG;
+exports.getLogger = () => {
+    return _logger;
+};
+exports.setLogger = (logger) => {
+    _logger = logger;
+};
+exports.setLoggerVerbosity = (verbosity) => {
+    _logVerbosity = verbosity;
+};
+// tslint:disable-next-line no-any
+exports.log = (severity, ...args) => {
+    if (severity >= _logVerbosity && typeof _logger.error === 'function') {
+        _logger.error(...args);
+    }
+};
+//# sourceMappingURL=logging.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/make-client.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/make-client.d.ts
new file mode 100644 (file)
index 0000000..e299d27
--- /dev/null
@@ -0,0 +1,62 @@
+/// <reference types="node" />
+import { ChannelCredentials } from './channel-credentials';
+import { ChannelOptions } from './channel-options';
+import { Client } from './client';
+export interface Serialize<T> {
+    (value: T): Buffer;
+}
+export interface Deserialize<T> {
+    (bytes: Buffer): T;
+}
+export interface MethodDefinition<RequestType, ResponseType> {
+    path: string;
+    requestStream: boolean;
+    responseStream: boolean;
+    requestSerialize: Serialize<RequestType>;
+    responseSerialize: Serialize<ResponseType>;
+    requestDeserialize: Deserialize<RequestType>;
+    responseDeserialize: Deserialize<ResponseType>;
+    originalName?: string;
+}
+export interface ServiceDefinition {
+    [index: string]: MethodDefinition<object, object>;
+}
+export interface ProtobufTypeDefinition {
+    format: string;
+    type: object;
+    fileDescriptorProtos: Buffer[];
+}
+export interface PackageDefinition {
+    [index: string]: ServiceDefinition | ProtobufTypeDefinition;
+}
+export interface ServiceClient extends Client {
+    [methodName: string]: Function;
+}
+export interface ServiceClientConstructor {
+    new (address: string, credentials: ChannelCredentials, options?: Partial<ChannelOptions>): ServiceClient;
+    service: ServiceDefinition;
+}
+/**
+ * Creates a constructor for a client with the given methods, as specified in
+ * the methods argument. The resulting class will have an instance method for
+ * each method in the service, which is a partial application of one of the
+ * [Client]{@link grpc.Client} request methods, depending on `requestSerialize`
+ * and `responseSerialize`, with the `method`, `serialize`, and `deserialize`
+ * arguments predefined.
+ * @param methods An object mapping method names to
+ *     method attributes
+ * @param serviceName The fully qualified name of the service
+ * @param classOptions An options object.
+ * @return New client constructor, which is a subclass of
+ *     {@link grpc.Client}, and has the same arguments as that constructor.
+ */
+export declare function makeClientConstructor(methods: ServiceDefinition, serviceName: string, classOptions?: {}): ServiceClientConstructor;
+export declare type GrpcObject = {
+    [index: string]: GrpcObject | ServiceClientConstructor | ProtobufTypeDefinition;
+};
+/**
+ * Load a gRPC package definition as a gRPC object hierarchy.
+ * @param packageDef The package definition object.
+ * @return The resulting gRPC object.
+ */
+export declare function loadPackageDefinition(packageDef: PackageDefinition): GrpcObject;
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/make-client.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/make-client.js
new file mode 100644 (file)
index 0000000..5336e95
--- /dev/null
@@ -0,0 +1,112 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const client_1 = require("./client");
+/**
+ * Map with short names for each of the requester maker functions. Used in
+ * makeClientConstructor
+ * @private
+ */
+const requesterFuncs = {
+    unary: client_1.Client.prototype.makeUnaryRequest,
+    server_stream: client_1.Client.prototype.makeServerStreamRequest,
+    client_stream: client_1.Client.prototype.makeClientStreamRequest,
+    bidi: client_1.Client.prototype.makeBidiStreamRequest
+};
+/**
+ * Creates a constructor for a client with the given methods, as specified in
+ * the methods argument. The resulting class will have an instance method for
+ * each method in the service, which is a partial application of one of the
+ * [Client]{@link grpc.Client} request methods, depending on `requestSerialize`
+ * and `responseSerialize`, with the `method`, `serialize`, and `deserialize`
+ * arguments predefined.
+ * @param methods An object mapping method names to
+ *     method attributes
+ * @param serviceName The fully qualified name of the service
+ * @param classOptions An options object.
+ * @return New client constructor, which is a subclass of
+ *     {@link grpc.Client}, and has the same arguments as that constructor.
+ */
+function makeClientConstructor(methods, serviceName, classOptions) {
+    if (!classOptions) {
+        classOptions = {};
+    }
+    class ServiceClientImpl extends client_1.Client {
+    }
+    Object.keys(methods).forEach((name) => {
+        const attrs = methods[name];
+        let methodType;
+        // TODO(murgatroid99): Verify that we don't need this anymore
+        if (typeof name === 'string' && name.charAt(0) === '$') {
+            throw new Error('Method names cannot start with $');
+        }
+        if (attrs.requestStream) {
+            if (attrs.responseStream) {
+                methodType = 'bidi';
+            }
+            else {
+                methodType = 'client_stream';
+            }
+        }
+        else {
+            if (attrs.responseStream) {
+                methodType = 'server_stream';
+            }
+            else {
+                methodType = 'unary';
+            }
+        }
+        const serialize = attrs.requestSerialize;
+        const deserialize = attrs.responseDeserialize;
+        const methodFunc = partial(requesterFuncs[methodType], attrs.path, serialize, deserialize);
+        ServiceClientImpl.prototype[name] = methodFunc;
+        // Associate all provided attributes with the method
+        Object.assign(ServiceClientImpl.prototype[name], attrs);
+        if (attrs.originalName) {
+            ServiceClientImpl.prototype[attrs.originalName] =
+                ServiceClientImpl.prototype[name];
+        }
+    });
+    ServiceClientImpl.service = methods;
+    return ServiceClientImpl;
+}
+exports.makeClientConstructor = makeClientConstructor;
+function partial(fn, path, serialize, deserialize) {
+    // tslint:disable-next-line:no-any
+    return function (...args) {
+        return fn.call(this, path, serialize, deserialize, ...args);
+    };
+}
+function isProtobufTypeDefinition(obj) {
+    return 'format' in obj;
+}
+/**
+ * Load a gRPC package definition as a gRPC object hierarchy.
+ * @param packageDef The package definition object.
+ * @return The resulting gRPC object.
+ */
+function loadPackageDefinition(packageDef) {
+    const result = {};
+    for (const serviceFqn in packageDef) {
+        if (packageDef.hasOwnProperty(serviceFqn)) {
+            const service = packageDef[serviceFqn];
+            const nameComponents = serviceFqn.split('.');
+            const serviceName = nameComponents[nameComponents.length - 1];
+            let current = result;
+            for (const packageName of nameComponents.slice(0, -1)) {
+                if (!current[packageName]) {
+                    current[packageName] = {};
+                }
+                current = current[packageName];
+            }
+            if (isProtobufTypeDefinition(service)) {
+                current[serviceName] = service;
+            }
+            else {
+                current[serviceName] = makeClientConstructor(service, serviceName, {});
+            }
+        }
+    }
+    return result;
+}
+exports.loadPackageDefinition = loadPackageDefinition;
+//# sourceMappingURL=make-client.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata-status-filter.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata-status-filter.d.ts
new file mode 100644 (file)
index 0000000..de4d94c
--- /dev/null
@@ -0,0 +1,12 @@
+import { Call } from './call-stream';
+import { StatusObject } from './call-stream';
+import { Channel } from './channel';
+import { BaseFilter, Filter, FilterFactory } from './filter';
+export declare class MetadataStatusFilter extends BaseFilter implements Filter {
+    receiveTrailers(status: Promise<StatusObject>): Promise<StatusObject>;
+}
+export declare class MetadataStatusFilterFactory implements FilterFactory<MetadataStatusFilter> {
+    private readonly channel;
+    constructor(channel: Channel);
+    createFilter(callStream: Call): MetadataStatusFilter;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata-status-filter.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata-status-filter.js
new file mode 100644 (file)
index 0000000..d1906d5
--- /dev/null
@@ -0,0 +1,38 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const constants_1 = require("./constants");
+const filter_1 = require("./filter");
+class MetadataStatusFilter extends filter_1.BaseFilter {
+    async receiveTrailers(status) {
+        // tslint:disable-next-line:prefer-const
+        let { code, details, metadata } = await status;
+        if (code !== constants_1.Status.UNKNOWN) {
+            // we already have a known status, so don't assign a new one.
+            return { code, details, metadata };
+        }
+        const metadataMap = metadata.getMap();
+        if (typeof metadataMap['grpc-status'] === 'string') {
+            const receivedCode = Number(metadataMap['grpc-status']);
+            if (receivedCode in constants_1.Status) {
+                code = receivedCode;
+            }
+            metadata.remove('grpc-status');
+        }
+        if (typeof metadataMap['grpc-message'] === 'string') {
+            details = decodeURI(metadataMap['grpc-message']);
+            metadata.remove('grpc-message');
+        }
+        return { code, details, metadata };
+    }
+}
+exports.MetadataStatusFilter = MetadataStatusFilter;
+class MetadataStatusFilterFactory {
+    constructor(channel) {
+        this.channel = channel;
+    }
+    createFilter(callStream) {
+        return new MetadataStatusFilter();
+    }
+}
+exports.MetadataStatusFilterFactory = MetadataStatusFilterFactory;
+//# sourceMappingURL=metadata-status-filter.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata.d.ts
new file mode 100644 (file)
index 0000000..120691b
--- /dev/null
@@ -0,0 +1,69 @@
+/// <reference types="node" />
+import * as http2 from 'http2';
+export declare type MetadataValue = string | Buffer;
+export declare type MetadataObject = Map<string, MetadataValue[]>;
+/**
+ * A class for storing metadata. Keys are normalized to lowercase ASCII.
+ */
+export declare class Metadata {
+    protected internalRepr: MetadataObject;
+    /**
+     * Sets the given value for the given key by replacing any other values
+     * associated with that key. Normalizes the key.
+     * @param key The key to whose value should be set.
+     * @param value The value to set. Must be a buffer if and only
+     *   if the normalized key ends with '-bin'.
+     */
+    set(key: string, value: MetadataValue): void;
+    /**
+     * Adds the given value for the given key by appending to a list of previous
+     * values associated with that key. Normalizes the key.
+     * @param key The key for which a new value should be appended.
+     * @param value The value to add. Must be a buffer if and only
+     *   if the normalized key ends with '-bin'.
+     */
+    add(key: string, value: MetadataValue): void;
+    /**
+     * Removes the given key and any associated values. Normalizes the key.
+     * @param key The key whose values should be removed.
+     */
+    remove(key: string): void;
+    /**
+     * Gets a list of all values associated with the key. Normalizes the key.
+     * @param key The key whose value should be retrieved.
+     * @return A list of values associated with the given key.
+     */
+    get(key: string): MetadataValue[];
+    /**
+     * Gets a plain object mapping each key to the first value associated with it.
+     * This reflects the most common way that people will want to see metadata.
+     * @return A key/value mapping of the metadata.
+     */
+    getMap(): {
+        [key: string]: MetadataValue;
+    };
+    /**
+     * Clones the metadata object.
+     * @return The newly cloned object.
+     */
+    clone(): Metadata;
+    /**
+     * Merges all key-value pairs from a given Metadata object into this one.
+     * If both this object and the given object have values in the same key,
+     * values from the other Metadata object will be appended to this object's
+     * values.
+     * @param other A Metadata object.
+     */
+    merge(other: Metadata): void;
+    /**
+     * Creates an OutgoingHttpHeaders object that can be used with the http2 API.
+     */
+    toHttp2Headers(): http2.OutgoingHttpHeaders;
+    private _getCoreRepresentation;
+    /**
+     * Returns a new Metadata object based fields in a given IncomingHttpHeaders
+     * object.
+     * @param headers An IncomingHttpHeaders object.
+     */
+    static fromHttp2Headers(headers: http2.IncomingHttpHeaders): Metadata;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/metadata.js
new file mode 100644 (file)
index 0000000..482398a
--- /dev/null
@@ -0,0 +1,206 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const LEGAL_KEY_REGEX = /^[0-9a-z_.-]+$/;
+const LEGAL_NON_BINARY_VALUE_REGEX = /^[ -~]*$/;
+function isLegalKey(key) {
+    return LEGAL_KEY_REGEX.test(key);
+}
+function isLegalNonBinaryValue(value) {
+    return LEGAL_NON_BINARY_VALUE_REGEX.test(value);
+}
+function isBinaryKey(key) {
+    return key.endsWith('-bin');
+}
+function normalizeKey(key) {
+    return key.toLowerCase();
+}
+function validate(key, value) {
+    if (!isLegalKey(key)) {
+        throw new Error('Metadata key "' + key + '" contains illegal characters');
+    }
+    if (value != null) {
+        if (isBinaryKey(key)) {
+            if (!(value instanceof Buffer)) {
+                throw new Error('keys that end with \'-bin\' must have Buffer values');
+            }
+        }
+        else {
+            if (value instanceof Buffer) {
+                throw new Error('keys that don\'t end with \'-bin\' must have String values');
+            }
+            if (!isLegalNonBinaryValue(value)) {
+                throw new Error('Metadata string value "' + value +
+                    '" contains illegal characters');
+            }
+        }
+    }
+}
+/**
+ * A class for storing metadata. Keys are normalized to lowercase ASCII.
+ */
+class Metadata {
+    constructor() {
+        this.internalRepr = new Map();
+    }
+    /**
+     * Sets the given value for the given key by replacing any other values
+     * associated with that key. Normalizes the key.
+     * @param key The key to whose value should be set.
+     * @param value The value to set. Must be a buffer if and only
+     *   if the normalized key ends with '-bin'.
+     */
+    set(key, value) {
+        key = normalizeKey(key);
+        validate(key, value);
+        this.internalRepr.set(key, [value]);
+    }
+    /**
+     * Adds the given value for the given key by appending to a list of previous
+     * values associated with that key. Normalizes the key.
+     * @param key The key for which a new value should be appended.
+     * @param value The value to add. Must be a buffer if and only
+     *   if the normalized key ends with '-bin'.
+     */
+    add(key, value) {
+        key = normalizeKey(key);
+        validate(key, value);
+        const existingValue = this.internalRepr.get(key);
+        if (existingValue === undefined) {
+            this.internalRepr.set(key, [value]);
+        }
+        else {
+            existingValue.push(value);
+        }
+    }
+    /**
+     * Removes the given key and any associated values. Normalizes the key.
+     * @param key The key whose values should be removed.
+     */
+    remove(key) {
+        key = normalizeKey(key);
+        validate(key);
+        this.internalRepr.delete(key);
+    }
+    /**
+     * Gets a list of all values associated with the key. Normalizes the key.
+     * @param key The key whose value should be retrieved.
+     * @return A list of values associated with the given key.
+     */
+    get(key) {
+        key = normalizeKey(key);
+        validate(key);
+        return this.internalRepr.get(key) || [];
+    }
+    /**
+     * Gets a plain object mapping each key to the first value associated with it.
+     * This reflects the most common way that people will want to see metadata.
+     * @return A key/value mapping of the metadata.
+     */
+    getMap() {
+        const result = {};
+        this.internalRepr.forEach((values, key) => {
+            if (values.length > 0) {
+                const v = values[0];
+                result[key] = v instanceof Buffer ? v.slice() : v;
+            }
+        });
+        return result;
+    }
+    /**
+     * Clones the metadata object.
+     * @return The newly cloned object.
+     */
+    clone() {
+        const newMetadata = new Metadata();
+        const newInternalRepr = newMetadata.internalRepr;
+        this.internalRepr.forEach((value, key) => {
+            const clonedValue = value.map(v => {
+                if (v instanceof Buffer) {
+                    return Buffer.from(v);
+                }
+                else {
+                    return v;
+                }
+            });
+            newInternalRepr.set(key, clonedValue);
+        });
+        return newMetadata;
+    }
+    /**
+     * Merges all key-value pairs from a given Metadata object into this one.
+     * If both this object and the given object have values in the same key,
+     * values from the other Metadata object will be appended to this object's
+     * values.
+     * @param other A Metadata object.
+     */
+    merge(other) {
+        other.internalRepr.forEach((values, key) => {
+            const mergedValue = (this.internalRepr.get(key) || []).concat(values);
+            this.internalRepr.set(key, mergedValue);
+        });
+    }
+    /**
+     * Creates an OutgoingHttpHeaders object that can be used with the http2 API.
+     */
+    toHttp2Headers() {
+        // NOTE: Node <8.9 formats http2 headers incorrectly.
+        const result = {};
+        this.internalRepr.forEach((values, key) => {
+            // We assume that the user's interaction with this object is limited to
+            // through its public API (i.e. keys and values are already validated).
+            result[key] = values.map((value) => {
+                if (value instanceof Buffer) {
+                    return value.toString('base64');
+                }
+                else {
+                    return value;
+                }
+            });
+        });
+        return result;
+    }
+    // For compatibility with the other Metadata implementation
+    _getCoreRepresentation() {
+        return this.internalRepr;
+    }
+    /**
+     * Returns a new Metadata object based fields in a given IncomingHttpHeaders
+     * object.
+     * @param headers An IncomingHttpHeaders object.
+     */
+    static fromHttp2Headers(headers) {
+        const result = new Metadata();
+        Object.keys(headers).forEach((key) => {
+            // Reserved headers (beginning with `:`) are not valid keys.
+            if (key.charAt(0) === ':') {
+                return;
+            }
+            const values = headers[key];
+            if (isBinaryKey(key)) {
+                if (Array.isArray(values)) {
+                    values.forEach((value) => {
+                        result.add(key, Buffer.from(value, 'base64'));
+                    });
+                }
+                else if (values !== undefined) {
+                    values.split(',').forEach(v => {
+                        result.add(key, Buffer.from(v.trim(), 'base64'));
+                    });
+                }
+            }
+            else {
+                if (Array.isArray(values)) {
+                    values.forEach((value) => {
+                        result.add(key, value);
+                    });
+                }
+                else if (values !== undefined) {
+                    values.split(',').forEach(v => result.add(key, v.trim()));
+                }
+            }
+        });
+        return result;
+    }
+}
+exports.Metadata = Metadata;
+//# sourceMappingURL=metadata.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/object-stream.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/object-stream.d.ts
new file mode 100644 (file)
index 0000000..d8dfe9e
--- /dev/null
@@ -0,0 +1,37 @@
+/// <reference types="node" />
+import { Duplex, Readable, Writable } from 'stream';
+import { EmitterAugmentation1 } from './events';
+export declare type WriteCallback = (error: Error | null | undefined) => void;
+export interface IntermediateObjectReadable<T> extends Readable {
+    read(size?: number): any & T;
+}
+export declare type ObjectReadable<T> = {
+    read(size?: number): T;
+} & EmitterAugmentation1<'data', T> & IntermediateObjectReadable<T>;
+export interface IntermediateObjectWritable<T> extends Writable {
+    _write(chunk: any & T, encoding: string, callback: Function): void;
+    write(chunk: any & T, cb?: WriteCallback): boolean;
+    write(chunk: any & T, encoding?: any, cb?: WriteCallback): boolean;
+    setDefaultEncoding(encoding: string): this;
+    end(): void;
+    end(chunk: any & T, cb?: Function): void;
+    end(chunk: any & T, encoding?: any, cb?: Function): void;
+}
+export interface ObjectWritable<T> extends IntermediateObjectWritable<T> {
+    _write(chunk: T, encoding: string, callback: Function): void;
+    write(chunk: T, cb?: Function): boolean;
+    write(chunk: T, encoding?: any, cb?: Function): boolean;
+    setDefaultEncoding(encoding: string): this;
+    end(): void;
+    end(chunk: T, cb?: Function): void;
+    end(chunk: T, encoding?: any, cb?: Function): void;
+}
+export declare type ObjectDuplex<T, U> = {
+    read(size?: number): U;
+    _write(chunk: T, encoding: string, callback: Function): void;
+    write(chunk: T, cb?: Function): boolean;
+    write(chunk: T, encoding?: any, cb?: Function): boolean;
+    end(): void;
+    end(chunk: T, cb?: Function): void;
+    end(chunk: T, encoding?: any, cb?: Function): void;
+} & Duplex & ObjectWritable<T> & ObjectReadable<U>;
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/object-stream.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/object-stream.js
new file mode 100644 (file)
index 0000000..f8eb9ef
--- /dev/null
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=object-stream.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/status-builder.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/status-builder.d.ts
new file mode 100644 (file)
index 0000000..e8fbcec
--- /dev/null
@@ -0,0 +1,28 @@
+import { StatusObject } from './call-stream';
+import { Status } from './constants';
+import { Metadata } from './metadata';
+/**
+ * A builder for gRPC status objects.
+ */
+export declare class StatusBuilder {
+    private code;
+    private details;
+    private metadata;
+    constructor();
+    /**
+     * Adds a status code to the builder.
+     */
+    withCode(code: Status): this;
+    /**
+     * Adds details to the builder.
+     */
+    withDetails(details: string): this;
+    /**
+     * Adds metadata to the builder.
+     */
+    withMetadata(metadata: Metadata): this;
+    /**
+     * Builds the status object.
+     */
+    build(): Partial<StatusObject>;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/status-builder.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/status-builder.js
new file mode 100644 (file)
index 0000000..22909a8
--- /dev/null
@@ -0,0 +1,51 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * A builder for gRPC status objects.
+ */
+class StatusBuilder {
+    constructor() {
+        this.code = null;
+        this.details = null;
+        this.metadata = null;
+    }
+    /**
+     * Adds a status code to the builder.
+     */
+    withCode(code) {
+        this.code = code;
+        return this;
+    }
+    /**
+     * Adds details to the builder.
+     */
+    withDetails(details) {
+        this.details = details;
+        return this;
+    }
+    /**
+     * Adds metadata to the builder.
+     */
+    withMetadata(metadata) {
+        this.metadata = metadata;
+        return this;
+    }
+    /**
+     * Builds the status object.
+     */
+    build() {
+        const status = {};
+        if (this.code !== null) {
+            status.code = this.code;
+        }
+        if (this.details !== null) {
+            status.details = this.details;
+        }
+        if (this.metadata !== null) {
+            status.metadata = this.metadata;
+        }
+        return status;
+    }
+}
+exports.StatusBuilder = StatusBuilder;
+//# sourceMappingURL=status-builder.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/subchannel.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/subchannel.d.ts
new file mode 100644 (file)
index 0000000..7b96269
--- /dev/null
@@ -0,0 +1,33 @@
+/// <reference types="node" />
+import { EventEmitter } from 'events';
+import * as http2 from 'http2';
+import * as url from 'url';
+import { Call, Http2CallStream } from './call-stream';
+import { ChannelOptions } from './channel-options';
+import { Metadata } from './metadata';
+export interface SubChannel extends EventEmitter {
+    /**
+     * Attach a call stream to this subchannel's connection to start it
+     * @param headers The headers to start the stream with
+     * @param callStream The stream to start
+     */
+    startCallStream(metadata: Metadata, callStream: Call): void;
+    close(): void;
+}
+export declare class Http2SubChannel extends EventEmitter implements SubChannel {
+    private session;
+    private refCount;
+    private userAgent;
+    private keepaliveTimeMs;
+    private keepaliveTimeoutMs;
+    private keepaliveIntervalId;
+    private keepaliveTimeoutId;
+    constructor(target: url.URL, connectionOptions: http2.SecureClientSessionOptions, userAgent: string, channelArgs: Partial<ChannelOptions>);
+    private ref;
+    private unref;
+    private sendPing;
+    private startKeepalivePings;
+    private stopKeepalivePings;
+    startCallStream(metadata: Metadata, callStream: Http2CallStream): void;
+    close(): void;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/subchannel.js b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/build/src/subchannel.js
new file mode 100644 (file)
index 0000000..f15e8a4
--- /dev/null
@@ -0,0 +1,97 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+const events_1 = require("events");
+const http2 = require("http2");
+const { HTTP2_HEADER_AUTHORITY, HTTP2_HEADER_CONTENT_TYPE, HTTP2_HEADER_METHOD, HTTP2_HEADER_PATH, HTTP2_HEADER_TE, HTTP2_HEADER_USER_AGENT } = http2.constants;
+/* setInterval and setTimeout only accept signed 32 bit integers. JS doesn't
+ * have a constant for the max signed 32 bit integer, so this is a simple way
+ * to calculate it */
+const KEEPALIVE_TIME_MS = ~(1 << 31);
+const KEEPALIVE_TIMEOUT_MS = 20000;
+class Http2SubChannel extends events_1.EventEmitter {
+    constructor(target, connectionOptions, userAgent, channelArgs) {
+        super();
+        this.refCount = 0;
+        this.keepaliveTimeMs = KEEPALIVE_TIME_MS;
+        this.keepaliveTimeoutMs = KEEPALIVE_TIMEOUT_MS;
+        this.session = http2.connect(target, connectionOptions);
+        this.session.unref();
+        this.session.on('connect', () => {
+            this.emit('connect');
+        });
+        this.session.on('close', () => {
+            this.stopKeepalivePings();
+            this.emit('close');
+        });
+        this.session.on('error', () => {
+            this.stopKeepalivePings();
+            this.emit('close');
+        });
+        this.userAgent = userAgent;
+        if (channelArgs['grpc.keepalive_time_ms']) {
+            this.keepaliveTimeMs = channelArgs['grpc.keepalive_time_ms'];
+        }
+        if (channelArgs['grpc.keepalive_timeout_ms']) {
+            this.keepaliveTimeoutMs = channelArgs['grpc.keepalive_timeout_ms'];
+        }
+        this.keepaliveIntervalId = setTimeout(() => { }, 0);
+        clearTimeout(this.keepaliveIntervalId);
+        this.keepaliveTimeoutId = setTimeout(() => { }, 0);
+        clearTimeout(this.keepaliveTimeoutId);
+    }
+    ref() {
+        if (this.refCount === 0) {
+            this.session.ref();
+            this.startKeepalivePings();
+        }
+        this.refCount += 1;
+    }
+    unref() {
+        this.refCount -= 1;
+        if (this.refCount === 0) {
+            this.session.unref();
+            this.stopKeepalivePings();
+        }
+    }
+    sendPing() {
+        this.keepaliveTimeoutId = setTimeout(() => {
+            this.emit('close');
+        }, this.keepaliveTimeoutMs);
+        this.session.ping((err, duration, payload) => {
+            clearTimeout(this.keepaliveTimeoutId);
+        });
+    }
+    /* TODO(murgatroid99): refactor subchannels so that keepalives can be handled
+     * per subchannel */
+    startKeepalivePings() {
+        this.keepaliveIntervalId = setInterval(() => {
+            this.sendPing();
+        }, this.keepaliveTimeMs);
+        this.sendPing();
+    }
+    stopKeepalivePings() {
+        clearInterval(this.keepaliveIntervalId);
+        clearTimeout(this.keepaliveTimeoutId);
+    }
+    // Prerequisite: this subchannel is connected
+    startCallStream(metadata, callStream) {
+        const headers = metadata.toHttp2Headers();
+        headers[HTTP2_HEADER_AUTHORITY] = callStream.getHost();
+        headers[HTTP2_HEADER_USER_AGENT] = this.userAgent;
+        headers[HTTP2_HEADER_CONTENT_TYPE] = 'application/grpc';
+        headers[HTTP2_HEADER_METHOD] = 'POST';
+        headers[HTTP2_HEADER_PATH] = callStream.getMethod();
+        headers[HTTP2_HEADER_TE] = 'trailers';
+        const http2Stream = this.session.request(headers);
+        this.ref();
+        http2Stream.on('close', () => {
+            this.unref();
+        });
+        callStream.attachHttp2Stream(http2Stream);
+    }
+    close() {
+        this.session.close();
+    }
+}
+exports.Http2SubChannel = Http2SubChannel;
+//# sourceMappingURL=subchannel.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/package.json b/legacy-libs/grpc-cloned/node_modules/@grpc/grpc-js/package.json
new file mode 100644 (file)
index 0000000..a343fd6
--- /dev/null
@@ -0,0 +1,131 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@grpc/grpc-js@^0.3.0",
+        "scope": "@grpc",
+        "escapedName": "@grpc%2fgrpc-js",
+        "name": "@grpc/grpc-js",
+        "rawSpec": "^0.3.0",
+        "spec": ">=0.3.0 <0.4.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/google-gax"
+    ]
+  ],
+  "_from": "@grpc/grpc-js@>=0.3.0 <0.4.0",
+  "_hasShrinkwrap": false,
+  "_id": "@grpc/grpc-js@0.3.6",
+  "_inCache": true,
+  "_location": "/@grpc/grpc-js",
+  "_nodeVersion": "8.12.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/grpc-js_0.3.6_1552069270433_0.09785338326415816"
+  },
+  "_npmUser": {
+    "name": "murgatroid99",
+    "email": "mlumish@google.com"
+  },
+  "_npmVersion": "6.4.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@grpc/grpc-js@^0.3.0",
+    "scope": "@grpc",
+    "escapedName": "@grpc%2fgrpc-js",
+    "name": "@grpc/grpc-js",
+    "rawSpec": "^0.3.0",
+    "spec": ">=0.3.0 <0.4.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/google-gax"
+  ],
+  "_resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.6.tgz",
+  "_shasum": "d9b52043907170d38e06711d9477fde29ab46fa8",
+  "_shrinkwrap": null,
+  "_spec": "@grpc/grpc-js@^0.3.0",
+  "_where": "/var/opt/motion2/node_modules/google-gax",
+  "author": {
+    "name": "Google Inc."
+  },
+  "contributors": [
+    {
+      "name": "Google Inc."
+    }
+  ],
+  "dependencies": {
+    "semver": "^5.5.0"
+  },
+  "description": "gRPC Library for Node - pure JS implementation",
+  "devDependencies": {
+    "@types/lodash": "^4.14.108",
+    "@types/mocha": "^2.2.43",
+    "@types/node": "^10.5.4",
+    "clang-format": "^1.0.55",
+    "gts": "^0.5.1",
+    "lodash": "^4.17.4",
+    "typescript": "~3.3.3333"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-SmLNuPGlUur64bNS9aHZguqWDVQ8+Df1CGn+xsh7l6T2wiP5ArOMlywZ3TZo6z/rwKtGQgUJY9ZrPYUmHEXd/Q==",
+    "shasum": "d9b52043907170d38e06711d9477fde29ab46fa8",
+    "tarball": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-0.3.6.tgz",
+    "fileCount": 47,
+    "unpackedSize": 140076,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgrKXCRA9TVsSAnZWagAAx6QP/jjt1XYboVWVF/tX+ISJ\nmzO6uvrxwM56k4jaqFUHQoTry+Y8irJ/JrF9YqYRJoFWY8BJMX+TVAkqtSEm\nAmPW9wrNSb6eoITWOsR3tqO6c7Q/Q/A53q6GUD3O6exqIvzjEFRtOd9BNU6t\n1naDL6qBZRiHgOFpofpoFeOCEY451v+iIqtfBPq+prSRgGeYk2x2hdN6CuKd\nhViGgtef2lXjw3/RiuH/ldx8ODhMN4KhUNhWJjwwY3EOneLIM4lzJMqTIeHp\nRkV2d7TMdQpm5LNZNUft/80AC4a7Wm8FeUX6wntCloF1/jwMG22nVpWkbrLo\nC4knCsi0pMKMx8S3PIPSIQP5oDXiCXhl+pyA/kjy+TZhlRmgSawow9Tvxljq\nRoJG/1OcyQXqnkPqtiX5aG6J6GaWPsu9dY4jw4xnLfMurYY2sR581EEHRkuQ\nuNox25wepps4qJgMnR9HbPggKRVGDCbKSuHwmMi1Gfq0uJ9c+y4ju43EuJDu\nmS/3NQbYJthEj2/R4kH3YT5mBLRgSLZOAU8DWAwsi93HMDiiefboKbFuyJKH\nS4SNHMmuh93aV7xxZZOdvTCJniMplAkSPgGziHVbn2POuRheF88czPUamRTl\na+Byf1dEXa5/86LZPMcKWdkp4WMepStkYUlzGVjZqJT4oS1ZQIMVjMZI8xzT\nsHtx\r\n=8dhQ\r\n-----END PGP SIGNATURE-----\r\n"
+  },
+  "engines": {
+    "node": "^8.11.2 || >=9.4"
+  },
+  "homepage": "https://grpc.io/",
+  "keywords": [],
+  "license": "Apache-2.0",
+  "main": "build/src/index.js",
+  "maintainers": [
+    {
+      "name": "grpc-packages",
+      "email": "grpc-packages@google.com"
+    },
+    {
+      "name": "murgatroid99",
+      "email": "mlumish@google.com"
+    },
+    {
+      "name": "nicolasnoble",
+      "email": "nicolas@nobis-crew.org"
+    }
+  ],
+  "name": "@grpc/grpc-js",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/grpc/grpc-node/tree/master/packages/grpc-js"
+  },
+  "scripts": {
+    "build": "npm run compile",
+    "check": "gts check",
+    "clean": "gts clean",
+    "compile": "tsc -p .",
+    "fix": "gts fix",
+    "format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts",
+    "lint": "tslint -c node_modules/google-ts-style/tslint.json -p . -t codeFrame --type-check",
+    "posttest": "npm run check",
+    "prepare": "npm run compile",
+    "pretest": "npm run compile",
+    "test": "gulp test"
+  },
+  "types": "build/src/index.d.ts",
+  "version": "0.3.6",
+  "warnings": [
+    {
+      "code": "ENOTSUP",
+      "required": {
+        "node": "^8.11.2 || >=9.4"
+      },
+      "pkgid": "@grpc/grpc-js@0.3.6"
+    }
+  ]
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/README.md b/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/README.md
new file mode 100644 (file)
index 0000000..481b862
--- /dev/null
@@ -0,0 +1,53 @@
+# gRPC Protobuf Loader
+
+A utility package for loading `.proto` files for use with gRPC, using the latest Protobuf.js package.
+Please refer to [protobuf.js' documentation](https://github.com/dcodeIO/protobuf.js/blob/master/README.md)
+to understands its features and limitations.
+
+## Installation
+
+```sh
+npm install @grpc/proto-loader
+```
+
+## Usage
+
+```js
+const protoLoader = require('@grpc/proto-loader');
+const grpcLibrary = require('grpc');
+// OR
+const grpcLibrary = require('@grpc/grpc-js');
+
+protoLoader.load(protoFileName, options).then(packageDefinition => {
+  const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition);
+});
+// OR
+const packageDefinition = protoLoader.loadSync(protoFileName, options);
+const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition);
+```
+
+The options parameter is an object that can have the following optional properties:
+
+| Field name | Valid values | Description
+|------------|--------------|------------
+| `keepCase` | `true` or `false` | Preserve field names. The default is to change them to camel case.
+| `longs` | `String` or `Number` | The type to use to represent `long` values. Defaults to a `Long` object type.
+| `enums` | `String` | The type to use to represent `enum` values. Defaults to the numeric value.
+| `bytes` | `Array` or `String` | The type to use to represent `bytes` values. Defaults to `Buffer`.
+| `defaults` | `true` or `false` | Set default values on output objects. Defaults to `false`.
+| `arrays` | `true` or `false` | Set empty arrays for missing array values even if `defaults` is `false` Defaults to `false`.
+| `objects` | `true` or `false` | Set empty objects for missing object values even if `defaults` is `false` Defaults to `false`.
+| `oneofs` | `true` or `false` | Set virtual oneof properties to the present field's name. Defaults to `false`.
+| `includeDirs` | An array of strings | A list of search paths for imported `.proto` files.
+
+The following options object closely approximates the existing behavior of `grpc.load`:
+
+```js
+const options = {
+  keepCase: true,
+  longs: String,
+  enums: String,
+  defaults: true,
+  oneofs: true
+}
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/build/src/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/build/src/index.d.ts
new file mode 100644 (file)
index 0000000..943ba1f
--- /dev/null
@@ -0,0 +1,96 @@
+/// <reference types="node" />
+/**
+ * @license
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+import * as Protobuf from 'protobufjs';
+import * as descriptor from 'protobufjs/ext/descriptor';
+declare module 'protobufjs' {
+    interface Type {
+        toDescriptor(protoVersion: string): Protobuf.Message<descriptor.IDescriptorProto> & descriptor.IDescriptorProto;
+    }
+    interface Root {
+        toDescriptor(protoVersion: string): Protobuf.Message<descriptor.IFileDescriptorSet> & descriptor.IFileDescriptorSet;
+    }
+    interface Enum {
+        toDescriptor(protoVersion: string): Protobuf.Message<descriptor.IEnumDescriptorProto> & descriptor.IEnumDescriptorProto;
+    }
+}
+export interface Serialize<T> {
+    (value: T): Buffer;
+}
+export interface Deserialize<T> {
+    (bytes: Buffer): T;
+}
+export interface ProtobufTypeDefinition {
+    format: string;
+    type: object;
+    fileDescriptorProtos: Buffer[];
+}
+export interface MessageTypeDefinition extends ProtobufTypeDefinition {
+    format: 'Protocol Buffer 3 DescriptorProto';
+}
+export interface EnumTypeDefinition extends ProtobufTypeDefinition {
+    format: 'Protocol Buffer 3 EnumDescriptorProto';
+}
+export interface MethodDefinition<RequestType, ResponseType> {
+    path: string;
+    requestStream: boolean;
+    responseStream: boolean;
+    requestSerialize: Serialize<RequestType>;
+    responseSerialize: Serialize<ResponseType>;
+    requestDeserialize: Deserialize<RequestType>;
+    responseDeserialize: Deserialize<ResponseType>;
+    originalName?: string;
+    requestType: MessageTypeDefinition;
+    responseType: MessageTypeDefinition;
+}
+export interface ServiceDefinition {
+    [index: string]: MethodDefinition<object, object>;
+}
+export declare type AnyDefinition = ServiceDefinition | MessageTypeDefinition | EnumTypeDefinition;
+export interface PackageDefinition {
+    [index: string]: AnyDefinition;
+}
+export declare type Options = Protobuf.IParseOptions & Protobuf.IConversionOptions & {
+    includeDirs?: string[];
+};
+/**
+ * Load a .proto file with the specified options.
+ * @param filename The file path to load. Can be an absolute path or relative to
+ *     an include path.
+ * @param options.keepCase Preserve field names. The default is to change them
+ *     to camel case.
+ * @param options.longs The type that should be used to represent `long` values.
+ *     Valid options are `Number` and `String`. Defaults to a `Long` object type
+ *     from a library.
+ * @param options.enums The type that should be used to represent `enum` values.
+ *     The only valid option is `String`. Defaults to the numeric value.
+ * @param options.bytes The type that should be used to represent `bytes`
+ *     values. Valid options are `Array` and `String`. The default is to use
+ *     `Buffer`.
+ * @param options.defaults Set default values on output objects. Defaults to
+ *     `false`.
+ * @param options.arrays Set empty arrays for missing array values even if
+ *     `defaults` is `false`. Defaults to `false`.
+ * @param options.objects Set empty objects for missing object values even if
+ *     `defaults` is `false`. Defaults to `false`.
+ * @param options.oneofs Set virtual oneof properties to the present field's
+ *     name
+ * @param options.includeDirs Paths to search for imported `.proto` files.
+ */
+export declare function load(filename: string, options?: Options): Promise<PackageDefinition>;
+export declare function loadSync(filename: string, options?: Options): PackageDefinition;
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/build/src/index.js b/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/build/src/index.js
new file mode 100644 (file)
index 0000000..8fbed58
--- /dev/null
@@ -0,0 +1,228 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * @license
+ * Copyright 2018 gRPC authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+var Protobuf = require("protobufjs");
+var descriptor = require("protobufjs/ext/descriptor");
+var fs = require("fs");
+var path = require("path");
+var camelCase = require("lodash.camelcase");
+var descriptorOptions = {
+    longs: String,
+    enums: String,
+    bytes: String,
+    defaults: true,
+    oneofs: true,
+    json: true
+};
+function joinName(baseName, name) {
+    if (baseName === '') {
+        return name;
+    }
+    else {
+        return baseName + '.' + name;
+    }
+}
+function isHandledReflectionObject(obj) {
+    return obj instanceof Protobuf.Service || obj instanceof Protobuf.Type || obj instanceof Protobuf.Enum;
+}
+function isNamespaceBase(obj) {
+    return obj instanceof Protobuf.Namespace || obj instanceof Protobuf.Root;
+}
+function getAllHandledReflectionObjects(obj, parentName) {
+    var objName = joinName(parentName, obj.name);
+    if (isHandledReflectionObject(obj)) {
+        return [[objName, obj]];
+    }
+    else {
+        if (isNamespaceBase(obj) && typeof obj.nested !== undefined) {
+            return Object.keys(obj.nested).map(function (name) {
+                return getAllHandledReflectionObjects(obj.nested[name], objName);
+            }).reduce(function (accumulator, currentValue) { return accumulator.concat(currentValue); }, []);
+        }
+    }
+    return [];
+}
+function createDeserializer(cls, options) {
+    return function deserialize(argBuf) {
+        return cls.toObject(cls.decode(argBuf), options);
+    };
+}
+function createSerializer(cls) {
+    return function serialize(arg) {
+        var message = cls.fromObject(arg);
+        return cls.encode(message).finish();
+    };
+}
+function createMethodDefinition(method, serviceName, options) {
+    /* This is only ever called after the corresponding root.resolveAll(), so we
+     * can assume that the resolved request and response types are non-null */
+    var requestType = method.resolvedRequestType;
+    var responseType = method.resolvedResponseType;
+    return {
+        path: '/' + serviceName + '/' + method.name,
+        requestStream: !!method.requestStream,
+        responseStream: !!method.responseStream,
+        requestSerialize: createSerializer(requestType),
+        requestDeserialize: createDeserializer(requestType, options),
+        responseSerialize: createSerializer(responseType),
+        responseDeserialize: createDeserializer(responseType, options),
+        // TODO(murgatroid99): Find a better way to handle this
+        originalName: camelCase(method.name),
+        requestType: createMessageDefinition(requestType),
+        responseType: createMessageDefinition(responseType)
+    };
+}
+function createServiceDefinition(service, name, options) {
+    var def = {};
+    for (var _i = 0, _a = service.methodsArray; _i < _a.length; _i++) {
+        var method = _a[_i];
+        def[method.name] = createMethodDefinition(method, name, options);
+    }
+    return def;
+}
+var fileDescriptorCache = new Map();
+function getFileDescriptors(root) {
+    if (fileDescriptorCache.has(root)) {
+        return fileDescriptorCache.get(root);
+    }
+    else {
+        var descriptorList = root.toDescriptor('proto3').file;
+        var bufferList = descriptorList.map(function (value) { return Buffer.from(descriptor.FileDescriptorProto.encode(value).finish()); });
+        fileDescriptorCache.set(root, bufferList);
+        return bufferList;
+    }
+}
+function createMessageDefinition(message) {
+    var messageDescriptor = message.toDescriptor('proto3');
+    return {
+        format: 'Protocol Buffer 3 DescriptorProto',
+        type: messageDescriptor.$type.toObject(messageDescriptor, descriptorOptions),
+        fileDescriptorProtos: getFileDescriptors(message.root)
+    };
+}
+function createEnumDefinition(enumType) {
+    var enumDescriptor = enumType.toDescriptor('proto3');
+    return {
+        format: 'Protocol Buffer 3 EnumDescriptorProto',
+        type: enumDescriptor.$type.toObject(enumDescriptor, descriptorOptions),
+        fileDescriptorProtos: getFileDescriptors(enumType.root)
+    };
+}
+/**
+ * function createDefinition(obj: Protobuf.Service, name: string, options: Options): ServiceDefinition;
+ * function createDefinition(obj: Protobuf.Type, name: string, options: Options): MessageTypeDefinition;
+ * function createDefinition(obj: Protobuf.Enum, name: string, options: Options): EnumTypeDefinition;
+ */
+function createDefinition(obj, name, options) {
+    if (obj instanceof Protobuf.Service) {
+        return createServiceDefinition(obj, name, options);
+    }
+    else if (obj instanceof Protobuf.Type) {
+        return createMessageDefinition(obj);
+    }
+    else if (obj instanceof Protobuf.Enum) {
+        return createEnumDefinition(obj);
+    }
+    else {
+        throw new Error('Type mismatch in reflection object handling');
+    }
+}
+function createPackageDefinition(root, options) {
+    var def = {};
+    root.resolveAll();
+    for (var _i = 0, _a = getAllHandledReflectionObjects(root, ''); _i < _a.length; _i++) {
+        var _b = _a[_i], name = _b[0], obj = _b[1];
+        def[name] = createDefinition(obj, name, options);
+    }
+    return def;
+}
+function addIncludePathResolver(root, includePaths) {
+    var originalResolvePath = root.resolvePath;
+    root.resolvePath = function (origin, target) {
+        if (path.isAbsolute(target)) {
+            return target;
+        }
+        for (var _i = 0, includePaths_1 = includePaths; _i < includePaths_1.length; _i++) {
+            var directory = includePaths_1[_i];
+            var fullPath = path.join(directory, target);
+            try {
+                fs.accessSync(fullPath, fs.constants.R_OK);
+                return fullPath;
+            }
+            catch (err) {
+                continue;
+            }
+        }
+        return originalResolvePath(origin, target);
+    };
+}
+/**
+ * Load a .proto file with the specified options.
+ * @param filename The file path to load. Can be an absolute path or relative to
+ *     an include path.
+ * @param options.keepCase Preserve field names. The default is to change them
+ *     to camel case.
+ * @param options.longs The type that should be used to represent `long` values.
+ *     Valid options are `Number` and `String`. Defaults to a `Long` object type
+ *     from a library.
+ * @param options.enums The type that should be used to represent `enum` values.
+ *     The only valid option is `String`. Defaults to the numeric value.
+ * @param options.bytes The type that should be used to represent `bytes`
+ *     values. Valid options are `Array` and `String`. The default is to use
+ *     `Buffer`.
+ * @param options.defaults Set default values on output objects. Defaults to
+ *     `false`.
+ * @param options.arrays Set empty arrays for missing array values even if
+ *     `defaults` is `false`. Defaults to `false`.
+ * @param options.objects Set empty objects for missing object values even if
+ *     `defaults` is `false`. Defaults to `false`.
+ * @param options.oneofs Set virtual oneof properties to the present field's
+ *     name
+ * @param options.includeDirs Paths to search for imported `.proto` files.
+ */
+function load(filename, options) {
+    var root = new Protobuf.Root();
+    options = options || {};
+    if (!!options.includeDirs) {
+        if (!(options.includeDirs instanceof Array)) {
+            return Promise.reject(new Error('The includeDirs option must be an array'));
+        }
+        addIncludePathResolver(root, options.includeDirs);
+    }
+    return root.load(filename, options).then(function (loadedRoot) {
+        loadedRoot.resolveAll();
+        return createPackageDefinition(root, options);
+    });
+}
+exports.load = load;
+function loadSync(filename, options) {
+    var root = new Protobuf.Root();
+    options = options || {};
+    if (!!options.includeDirs) {
+        if (!(options.includeDirs instanceof Array)) {
+            throw new Error('The include option must be an array');
+        }
+        addIncludePathResolver(root, options.includeDirs);
+    }
+    var loadedRoot = root.loadSync(filename, options);
+    loadedRoot.resolveAll();
+    return createPackageDefinition(root, options);
+}
+exports.loadSync = loadSync;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/package.json b/legacy-libs/grpc-cloned/node_modules/@grpc/proto-loader/package.json
new file mode 100644 (file)
index 0000000..8aca934
--- /dev/null
@@ -0,0 +1,124 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@grpc/proto-loader@^0.4.0",
+        "scope": "@grpc",
+        "escapedName": "@grpc%2fproto-loader",
+        "name": "@grpc/proto-loader",
+        "rawSpec": "^0.4.0",
+        "spec": ">=0.4.0 <0.5.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/google-gax"
+    ]
+  ],
+  "_from": "@grpc/proto-loader@>=0.4.0 <0.5.0",
+  "_hasShrinkwrap": false,
+  "_id": "@grpc/proto-loader@0.4.0",
+  "_inCache": true,
+  "_location": "/@grpc/proto-loader",
+  "_nodeVersion": "8.11.2",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/proto-loader_0.4.0_1547758327418_0.7862900007567022"
+  },
+  "_npmUser": {
+    "name": "murgatroid99",
+    "email": "mlumish@google.com"
+  },
+  "_npmVersion": "5.6.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@grpc/proto-loader@^0.4.0",
+    "scope": "@grpc",
+    "escapedName": "@grpc%2fproto-loader",
+    "name": "@grpc/proto-loader",
+    "rawSpec": "^0.4.0",
+    "spec": ">=0.4.0 <0.5.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/google-gax"
+  ],
+  "_resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz",
+  "_shasum": "a823a51eb2fde58369bef1deb5445fd808d70901",
+  "_shrinkwrap": null,
+  "_spec": "@grpc/proto-loader@^0.4.0",
+  "_where": "/var/opt/motion2/node_modules/google-gax",
+  "author": {
+    "name": "Google Inc."
+  },
+  "bugs": {
+    "url": "https://github.com/grpc/grpc-node/issues"
+  },
+  "contributors": [
+    {
+      "name": "Michael Lumish",
+      "email": "mlumish@google.com"
+    }
+  ],
+  "dependencies": {
+    "lodash.camelcase": "^4.3.0",
+    "protobufjs": "^6.8.6"
+  },
+  "description": "gRPC utility library for loading .proto files",
+  "devDependencies": {
+    "@types/lodash.camelcase": "^4.3.4",
+    "@types/node": "^10.12.5",
+    "clang-format": "^1.2.2",
+    "gts": "^0.5.3",
+    "typescript": "~2.7.2"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-Jm6o+75uWT7E6+lt8edg4J1F/9+BedOjaMgwE14pxS/AO43/0ZqK+rCLVVrXLoExwSAZvgvOD2B0ivy3Spsspw==",
+    "shasum": "a823a51eb2fde58369bef1deb5445fd808d70901",
+    "tarball": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.4.0.tgz",
+    "fileCount": 4,
+    "unpackedSize": 16380,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcQOr4CRA9TVsSAnZWagAAYQAP/1BNPBMs2zd48wvTlSnr\nHBPsl0d0ZfrdNYHLQsJ8TQLVq1b4qYAl25DqUoaptEfYhZRIj0wOh1W7TD7L\naPA+DCL2NEmMAUaRdsYL+BcTD5cCZ48AL679YG4ntdLxGTx+rmSO0W0nk8PW\nNzI4IPdfVkXjAsR7CqA79EJUPGW3KUv51Usp1XdOs5ot9uQtPdSF/sct64LD\nY1AG0oWI74mVEP3MbZLkDrUXPeCDGxfdoeRhsk9tbK27rCmb3Fpc1CKGgmVJ\nkIujZOaU9BnDs1qsa8KY3PQdBp2nLLNKaTQE3XVUvxdotOaLahM/NRwF21es\njku0nPQjJSZmVdjXHR24cQXj1COH5e9d78PFH+khECGxjnNUhcydclPp/myn\nJaOPCOPYTYAYO6n6MQljJvcBbQfsjhorkmNy2Ywb1gJjZH+elc7upxUY1QRu\n8VDtLlzh+ctx1TvzrPgNuUuo7CK1lflr7MMHPl0Kh/Hl/GoRvxWoOdMhN+3m\nXbC/9nFljMCGmKff71xh9K3bE1ugXDMNVyrSPCCJRZjLT2CLcqy3TH0Anx0f\nwCKqcEeLPlAUiel2CbL4HVS20DFo4K7wwvjG7u/sGQhDX/rGo4MpJmIVW9WS\nc94HGbzecwEV/fo9WkxHODQndmnIQgk9mu1AULI8nbW/SMz+TXeTNCOfbz/Z\nwe2Y\r\n=dFkd\r\n-----END PGP SIGNATURE-----\r\n"
+  },
+  "engines": {
+    "node": ">=6"
+  },
+  "homepage": "https://grpc.io/",
+  "license": "Apache-2.0",
+  "main": "build/src/index.js",
+  "maintainers": [
+    {
+      "name": "grpc-packages",
+      "email": "grpc-packages@google.com"
+    },
+    {
+      "name": "murgatroid99",
+      "email": "mlumish@google.com"
+    },
+    {
+      "name": "nicolasnoble",
+      "email": "nicolas@nobis-crew.org"
+    }
+  ],
+  "name": "@grpc/proto-loader",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/grpc/grpc-node.git"
+  },
+  "scripts": {
+    "build": "npm run compile",
+    "check": "gts check",
+    "clean": "gts clean",
+    "compile": "tsc -p .",
+    "fix": "gts fix",
+    "format": "clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts",
+    "lint": "tslint -c node_modules/google-ts-style/tslint.json -p . -t codeFrame --type-check",
+    "posttest": "npm run check",
+    "prepare": "npm run compile",
+    "pretest": "npm run compile",
+    "test": "gulp test"
+  },
+  "typings": "build/src/index.d.ts",
+  "version": "0.4.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/README.md
new file mode 100644 (file)
index 0000000..7227096
--- /dev/null
@@ -0,0 +1,13 @@
+@protobufjs/aspromise\r
+=====================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/aspromise.svg)](https://www.npmjs.com/package/@protobufjs/aspromise)\r
+\r
+Returns a promise from a node-style callback function.\r
+\r
+API\r
+---\r
+\r
+* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**<br />\r
+  Returns a promise from a node-style callback function.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/index.d.ts
new file mode 100644 (file)
index 0000000..afbd89a
--- /dev/null
@@ -0,0 +1,13 @@
+export = asPromise;\r
+\r
+type asPromiseCallback = (error: Error | null, ...params: any[]) => {};\r
+\r
+/**\r
+ * Returns a promise from a node-style callback function.\r
+ * @memberof util\r
+ * @param {asPromiseCallback} fn Function to call\r
+ * @param {*} ctx Function context\r
+ * @param {...*} params Function arguments\r
+ * @returns {Promise<*>} Promisified function\r
+ */\r
+declare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise<any>;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/index.js
new file mode 100644 (file)
index 0000000..b10f826
--- /dev/null
@@ -0,0 +1,52 @@
+"use strict";\r
+module.exports = asPromise;\r
+\r
+/**\r
+ * Callback as used by {@link util.asPromise}.\r
+ * @typedef asPromiseCallback\r
+ * @type {function}\r
+ * @param {Error|null} error Error, if any\r
+ * @param {...*} params Additional arguments\r
+ * @returns {undefined}\r
+ */\r
+\r
+/**\r
+ * Returns a promise from a node-style callback function.\r
+ * @memberof util\r
+ * @param {asPromiseCallback} fn Function to call\r
+ * @param {*} ctx Function context\r
+ * @param {...*} params Function arguments\r
+ * @returns {Promise<*>} Promisified function\r
+ */\r
+function asPromise(fn, ctx/*, varargs */) {\r
+    var params  = new Array(arguments.length - 1),\r
+        offset  = 0,\r
+        index   = 2,\r
+        pending = true;\r
+    while (index < arguments.length)\r
+        params[offset++] = arguments[index++];\r
+    return new Promise(function executor(resolve, reject) {\r
+        params[offset] = function callback(err/*, varargs */) {\r
+            if (pending) {\r
+                pending = false;\r
+                if (err)\r
+                    reject(err);\r
+                else {\r
+                    var params = new Array(arguments.length - 1),\r
+                        offset = 0;\r
+                    while (offset < params.length)\r
+                        params[offset++] = arguments[offset];\r
+                    resolve.apply(null, params);\r
+                }\r
+            }\r
+        };\r
+        try {\r
+            fn.apply(ctx || null, params);\r
+        } catch (err) {\r
+            if (pending) {\r
+                pending = false;\r
+                reject(err);\r
+            }\r
+        }\r
+    });\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/package.json
new file mode 100644 (file)
index 0000000..e8f1b6f
--- /dev/null
@@ -0,0 +1,93 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/aspromise@^1.1.2",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2faspromise",
+        "name": "@protobufjs/aspromise",
+        "rawSpec": "^1.1.2",
+        "spec": ">=1.1.2 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/aspromise@>=1.1.2 <2.0.0",
+  "_id": "@protobufjs/aspromise@1.1.2",
+  "_inCache": true,
+  "_location": "/@protobufjs/aspromise",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/aspromise-1.1.2.tgz_1493030312365_0.014110192423686385"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/aspromise@^1.1.2",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2faspromise",
+    "name": "@protobufjs/aspromise",
+    "rawSpec": "^1.1.2",
+    "spec": ">=1.1.2 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/@protobufjs/fetch",
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
+  "_shasum": "9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/aspromise@^1.1.2",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "Returns a promise from a node-style callback function.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf",
+    "tarball": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode+npm@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/aspromise",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.2"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/aspromise/tests/index.js
new file mode 100644 (file)
index 0000000..6d8d24c
--- /dev/null
@@ -0,0 +1,130 @@
+var tape = require("tape");\r
+\r
+var asPromise = require("..");\r
+\r
+tape.test("aspromise", function(test) {\r
+\r
+    test.test(this.name + " - resolve", function(test) {\r
+\r
+        function fn(arg1, arg2, callback) {\r
+            test.equal(this, ctx, "function should be called with this = ctx");\r
+            test.equal(arg1, 1, "function should be called with arg1 = 1");\r
+            test.equal(arg2, 2, "function should be called with arg2 = 2");\r
+            callback(null, arg2);\r
+        }\r
+\r
+        var ctx = {};\r
+\r
+        var promise = asPromise(fn, ctx, 1, 2);\r
+        promise.then(function(arg2) {\r
+            test.equal(arg2, 2, "promise should be resolved with arg2 = 2");\r
+            test.end();\r
+        }).catch(function(err) {\r
+            test.fail("promise should not be rejected (" + err + ")");\r
+        });\r
+    });\r
+\r
+    test.test(this.name + " - reject", function(test) {\r
+\r
+        function fn(arg1, arg2, callback) {\r
+            test.equal(this, ctx, "function should be called with this = ctx");\r
+            test.equal(arg1, 1, "function should be called with arg1 = 1");\r
+            test.equal(arg2, 2, "function should be called with arg2 = 2");\r
+            callback(arg1);\r
+        }\r
+\r
+        var ctx = {};\r
+\r
+        var promise = asPromise(fn, ctx, 1, 2);\r
+        promise.then(function() {\r
+            test.fail("promise should not be resolved");\r
+        }).catch(function(err) {\r
+            test.equal(err, 1, "promise should be rejected with err = 1");\r
+            test.end();\r
+        });\r
+    });\r
+\r
+    test.test(this.name + " - resolve twice", function(test) {\r
+\r
+        function fn(arg1, arg2, callback) {\r
+            test.equal(this, ctx, "function should be called with this = ctx");\r
+            test.equal(arg1, 1, "function should be called with arg1 = 1");\r
+            test.equal(arg2, 2, "function should be called with arg2 = 2");\r
+            callback(null, arg2);\r
+            callback(null, arg1);\r
+        }\r
+\r
+        var ctx = {};\r
+        var count = 0;\r
+\r
+        var promise = asPromise(fn, ctx, 1, 2);\r
+        promise.then(function(arg2) {\r
+            test.equal(arg2, 2, "promise should be resolved with arg2 = 2");\r
+            if (++count > 1)\r
+                test.fail("promise should not be resolved twice");\r
+            test.end();\r
+        }).catch(function(err) {\r
+            test.fail("promise should not be rejected (" + err + ")");\r
+        });\r
+    });\r
+\r
+    test.test(this.name + " - reject twice", function(test) {\r
+\r
+        function fn(arg1, arg2, callback) {\r
+            test.equal(this, ctx, "function should be called with this = ctx");\r
+            test.equal(arg1, 1, "function should be called with arg1 = 1");\r
+            test.equal(arg2, 2, "function should be called with arg2 = 2");\r
+            callback(arg1);\r
+            callback(arg2);\r
+        }\r
+\r
+        var ctx = {};\r
+        var count = 0;\r
+\r
+        var promise = asPromise(fn, ctx, 1, 2);\r
+        promise.then(function() {\r
+            test.fail("promise should not be resolved");\r
+        }).catch(function(err) {\r
+            test.equal(err, 1, "promise should be rejected with err = 1");\r
+            if (++count > 1)\r
+                test.fail("promise should not be rejected twice");\r
+            test.end();\r
+        });\r
+    });\r
+\r
+    test.test(this.name + " - reject error", function(test) {\r
+\r
+        function fn(callback) {\r
+            test.ok(arguments.length === 1 && typeof callback === "function", "function should be called with just a callback");\r
+            throw 3;\r
+        }\r
+\r
+        var promise = asPromise(fn, null);\r
+        promise.then(function() {\r
+            test.fail("promise should not be resolved");\r
+        }).catch(function(err) {\r
+            test.equal(err, 3, "promise should be rejected with err = 3");\r
+            test.end();\r
+        });\r
+    });\r
+\r
+    test.test(this.name + " - reject and error", function(test) {\r
+\r
+        function fn(callback) {\r
+            callback(3);\r
+            throw 4;\r
+        }\r
+\r
+        var count = 0;\r
+\r
+        var promise = asPromise(fn, null);\r
+        promise.then(function() {\r
+            test.fail("promise should not be resolved");\r
+        }).catch(function(err) {\r
+            test.equal(err, 3, "promise should be rejected with err = 3");\r
+            if (++count > 1)\r
+                test.fail("promise should not be rejected twice");\r
+            test.end();\r
+        });\r
+    });\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/README.md
new file mode 100644 (file)
index 0000000..0e2eb33
--- /dev/null
@@ -0,0 +1,19 @@
+@protobufjs/base64\r
+==================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/base64.svg)](https://www.npmjs.com/package/@protobufjs/base64)\r
+\r
+A minimal base64 implementation for number arrays.\r
+\r
+API\r
+---\r
+\r
+* **base64.length(string: `string`): `number`**<br />\r
+  Calculates the byte length of a base64 encoded string.\r
+\r
+* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />\r
+  Encodes a buffer to a base64 encoded string.\r
+\r
+* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />\r
+  Decodes a base64 encoded string to a buffer.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/index.d.ts
new file mode 100644 (file)
index 0000000..16fd7db
--- /dev/null
@@ -0,0 +1,32 @@
+/**\r
+ * Calculates the byte length of a base64 encoded string.\r
+ * @param {string} string Base64 encoded string\r
+ * @returns {number} Byte length\r
+ */\r
+export function length(string: string): number;\r
+\r
+/**\r
+ * Encodes a buffer to a base64 encoded string.\r
+ * @param {Uint8Array} buffer Source buffer\r
+ * @param {number} start Source start\r
+ * @param {number} end Source end\r
+ * @returns {string} Base64 encoded string\r
+ */\r
+export function encode(buffer: Uint8Array, start: number, end: number): string;\r
+\r
+/**\r
+ * Decodes a base64 encoded string to a buffer.\r
+ * @param {string} string Source string\r
+ * @param {Uint8Array} buffer Destination buffer\r
+ * @param {number} offset Destination offset\r
+ * @returns {number} Number of bytes written\r
+ * @throws {Error} If encoding is invalid\r
+ */\r
+export function decode(string: string, buffer: Uint8Array, offset: number): number;\r
+\r
+/**\r
+ * Tests if the specified string appears to be base64 encoded.\r
+ * @param {string} string String to test\r
+ * @returns {boolean} `true` if it appears to be base64 encoded, otherwise false\r
+ */\r
+export function test(string: string): boolean;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/index.js
new file mode 100644 (file)
index 0000000..26d5443
--- /dev/null
@@ -0,0 +1,139 @@
+"use strict";\r
+\r
+/**\r
+ * A minimal base64 implementation for number arrays.\r
+ * @memberof util\r
+ * @namespace\r
+ */\r
+var base64 = exports;\r
+\r
+/**\r
+ * Calculates the byte length of a base64 encoded string.\r
+ * @param {string} string Base64 encoded string\r
+ * @returns {number} Byte length\r
+ */\r
+base64.length = function length(string) {\r
+    var p = string.length;\r
+    if (!p)\r
+        return 0;\r
+    var n = 0;\r
+    while (--p % 4 > 1 && string.charAt(p) === "=")\r
+        ++n;\r
+    return Math.ceil(string.length * 3) / 4 - n;\r
+};\r
+\r
+// Base64 encoding table\r
+var b64 = new Array(64);\r
+\r
+// Base64 decoding table\r
+var s64 = new Array(123);\r
+\r
+// 65..90, 97..122, 48..57, 43, 47\r
+for (var i = 0; i < 64;)\r
+    s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\r
+\r
+/**\r
+ * Encodes a buffer to a base64 encoded string.\r
+ * @param {Uint8Array} buffer Source buffer\r
+ * @param {number} start Source start\r
+ * @param {number} end Source end\r
+ * @returns {string} Base64 encoded string\r
+ */\r
+base64.encode = function encode(buffer, start, end) {\r
+    var parts = null,\r
+        chunk = [];\r
+    var i = 0, // output index\r
+        j = 0, // goto index\r
+        t;     // temporary\r
+    while (start < end) {\r
+        var b = buffer[start++];\r
+        switch (j) {\r
+            case 0:\r
+                chunk[i++] = b64[b >> 2];\r
+                t = (b & 3) << 4;\r
+                j = 1;\r
+                break;\r
+            case 1:\r
+                chunk[i++] = b64[t | b >> 4];\r
+                t = (b & 15) << 2;\r
+                j = 2;\r
+                break;\r
+            case 2:\r
+                chunk[i++] = b64[t | b >> 6];\r
+                chunk[i++] = b64[b & 63];\r
+                j = 0;\r
+                break;\r
+        }\r
+        if (i > 8191) {\r
+            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r
+            i = 0;\r
+        }\r
+    }\r
+    if (j) {\r
+        chunk[i++] = b64[t];\r
+        chunk[i++] = 61;\r
+        if (j === 1)\r
+            chunk[i++] = 61;\r
+    }\r
+    if (parts) {\r
+        if (i)\r
+            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r
+        return parts.join("");\r
+    }\r
+    return String.fromCharCode.apply(String, chunk.slice(0, i));\r
+};\r
+\r
+var invalidEncoding = "invalid encoding";\r
+\r
+/**\r
+ * Decodes a base64 encoded string to a buffer.\r
+ * @param {string} string Source string\r
+ * @param {Uint8Array} buffer Destination buffer\r
+ * @param {number} offset Destination offset\r
+ * @returns {number} Number of bytes written\r
+ * @throws {Error} If encoding is invalid\r
+ */\r
+base64.decode = function decode(string, buffer, offset) {\r
+    var start = offset;\r
+    var j = 0, // goto index\r
+        t;     // temporary\r
+    for (var i = 0; i < string.length;) {\r
+        var c = string.charCodeAt(i++);\r
+        if (c === 61 && j > 1)\r
+            break;\r
+        if ((c = s64[c]) === undefined)\r
+            throw Error(invalidEncoding);\r
+        switch (j) {\r
+            case 0:\r
+                t = c;\r
+                j = 1;\r
+                break;\r
+            case 1:\r
+                buffer[offset++] = t << 2 | (c & 48) >> 4;\r
+                t = c;\r
+                j = 2;\r
+                break;\r
+            case 2:\r
+                buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\r
+                t = c;\r
+                j = 3;\r
+                break;\r
+            case 3:\r
+                buffer[offset++] = (t & 3) << 6 | c;\r
+                j = 0;\r
+                break;\r
+        }\r
+    }\r
+    if (j === 1)\r
+        throw Error(invalidEncoding);\r
+    return offset - start;\r
+};\r
+\r
+/**\r
+ * Tests if the specified string appears to be base64 encoded.\r
+ * @param {string} string String to test\r
+ * @returns {boolean} `true` if probably base64 encoded, otherwise false\r
+ */\r
+base64.test = function test(string) {\r
+    return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/package.json
new file mode 100644 (file)
index 0000000..22b27e7
--- /dev/null
@@ -0,0 +1,93 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/base64@^1.1.2",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2fbase64",
+        "name": "@protobufjs/base64",
+        "rawSpec": "^1.1.2",
+        "spec": ">=1.1.2 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/base64@>=1.1.2 <2.0.0",
+  "_id": "@protobufjs/base64@1.1.2",
+  "_inCache": true,
+  "_location": "/@protobufjs/base64",
+  "_nodeVersion": "8.0.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/base64-1.1.2.tgz_1497000720755_0.053681070916354656"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "5.0.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/base64@^1.1.2",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2fbase64",
+    "name": "@protobufjs/base64",
+    "rawSpec": "^1.1.2",
+    "spec": ">=1.1.2 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
+  "_shasum": "4c85730e59b9a1f1f349047dbf24296034bb2735",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/base64@^1.1.2",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "A minimal base64 implementation for number arrays.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
+    "shasum": "4c85730e59b9a1f1f349047dbf24296034bb2735",
+    "tarball": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+npm-protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/base64",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.2"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/base64/tests/index.js
new file mode 100644 (file)
index 0000000..89828f2
--- /dev/null
@@ -0,0 +1,46 @@
+var tape = require("tape");\r
+\r
+var base64 = require("..");\r
+\r
+var strings = {\r
+    "": "",\r
+    "a": "YQ==",\r
+    "ab": "YWI=",\r
+    "abcdefg": "YWJjZGVmZw==",\r
+    "abcdefgh": "YWJjZGVmZ2g=",\r
+    "abcdefghi": "YWJjZGVmZ2hp"\r
+};\r
+\r
+tape.test("base64", function(test) {\r
+\r
+    Object.keys(strings).forEach(function(str) {\r
+        var enc = strings[str];\r
+\r
+        test.equal(base64.test(enc), true, "should detect '" + enc + "' to be base64 encoded");\r
+\r
+        var len = base64.length(enc);\r
+        test.equal(len, str.length, "should calculate '" + enc + "' as " + str.length + " bytes");\r
+\r
+        var buf = new Array(len);\r
+        var len2 = base64.decode(enc, buf, 0);\r
+        test.equal(len2, len, "should decode '" + enc + "' to " + len + " bytes");\r
+\r
+        test.equal(String.fromCharCode.apply(String, buf), str, "should decode '" + enc + "' to '" + str + "'");\r
+\r
+        var enc2 = base64.encode(buf, 0, buf.length);\r
+        test.equal(enc2, enc, "should encode '" + str + "' to '" + enc + "'");\r
+\r
+    });\r
+\r
+    test.throws(function() {\r
+        var buf = new Array(10);\r
+        base64.decode("YQ!", buf, 0);\r
+    }, Error, "should throw if encoding is invalid");\r
+\r
+    test.throws(function() {\r
+        var buf = new Array(10);\r
+        base64.decode("Y", buf, 0);\r
+    }, Error, "should throw if string is truncated");\r
+\r
+    test.end();\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/README.md
new file mode 100644 (file)
index 0000000..0169338
--- /dev/null
@@ -0,0 +1,49 @@
+@protobufjs/codegen\r
+===================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen)\r
+\r
+A minimalistic code generation utility.\r
+\r
+API\r
+---\r
+\r
+* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**<br />\r
+  Begins generating a function.\r
+\r
+* **codegen.verbose = `false`**<br />\r
+  When set to true, codegen will log generated code to console. Useful for debugging.\r
+\r
+Invoking **codegen** returns an appender function that appends code to the function's body and returns itself:\r
+\r
+* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**<br />\r
+  Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters:\r
+\r
+  * `%d`: Number (integer or floating point value)\r
+  * `%f`: Floating point value\r
+  * `%i`: Integer value\r
+  * `%j`: JSON.stringify'ed value\r
+  * `%s`: String value\r
+  * `%%`: Percent sign<br />\r
+\r
+* **Codegen([scope: `Object.<string,*>`]): `Function`**<br />\r
+  Finishes the function and returns it.\r
+\r
+* **Codegen.toString([functionNameOverride: `string`]): `string`**<br />\r
+  Returns the function as a string.\r
+\r
+Example\r
+-------\r
+\r
+```js\r
+var codegen = require("@protobufjs/codegen");\r
+\r
+var add = codegen(["a", "b"], "add") // A function with parameters "a" and "b" named "add"\r
+  ("// awesome comment")             // adds the line to the function's body\r
+  ("return a + b - c + %d", 1)       // replaces %d with 1 and adds the line to the body\r
+  ({ c: 1 });                        // adds "c" with a value of 1 to the function's scope\r
+\r
+console.log(add.toString()); // function add(a, b) { return a + b - c + 1 }\r
+console.log(add(1, 2));      // calculates 1 + 2 - 1 + 1 = 3\r
+```\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/index.d.ts
new file mode 100644 (file)
index 0000000..f7fb921
--- /dev/null
@@ -0,0 +1,31 @@
+export = codegen;\r
+\r
+/**\r
+ * Appends code to the function's body.\r
+ * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r
+ * @param [formatParams] Format parameters\r
+ * @returns Itself or the generated function if finished\r
+ * @throws {Error} If format parameter counts do not match\r
+ */\r
+type Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function);\r
+\r
+/**\r
+ * Begins generating a function.\r
+ * @param functionParams Function parameter names\r
+ * @param [functionName] Function name if not anonymous\r
+ * @returns Appender that appends code to the function's body\r
+ */\r
+declare function codegen(functionParams: string[], functionName?: string): Codegen;\r
+\r
+/**\r
+ * Begins generating a function.\r
+ * @param [functionName] Function name if not anonymous\r
+ * @returns Appender that appends code to the function's body\r
+ */\r
+declare function codegen(functionName?: string): Codegen;\r
+\r
+declare namespace codegen {\r
+\r
+    /** When set to `true`, codegen will log generated code to console. Useful for debugging. */\r
+    let verbose: boolean;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/index.js
new file mode 100644 (file)
index 0000000..de73f80
--- /dev/null
@@ -0,0 +1,99 @@
+"use strict";\r
+module.exports = codegen;\r
+\r
+/**\r
+ * Begins generating a function.\r
+ * @memberof util\r
+ * @param {string[]} functionParams Function parameter names\r
+ * @param {string} [functionName] Function name if not anonymous\r
+ * @returns {Codegen} Appender that appends code to the function's body\r
+ */\r
+function codegen(functionParams, functionName) {\r
+\r
+    /* istanbul ignore if */\r
+    if (typeof functionParams === "string") {\r
+        functionName = functionParams;\r
+        functionParams = undefined;\r
+    }\r
+\r
+    var body = [];\r
+\r
+    /**\r
+     * Appends code to the function's body or finishes generation.\r
+     * @typedef Codegen\r
+     * @type {function}\r
+     * @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\r
+     * @param {...*} [formatParams] Format parameters\r
+     * @returns {Codegen|Function} Itself or the generated function if finished\r
+     * @throws {Error} If format parameter counts do not match\r
+     */\r
+\r
+    function Codegen(formatStringOrScope) {\r
+        // note that explicit array handling below makes this ~50% faster\r
+\r
+        // finish the function\r
+        if (typeof formatStringOrScope !== "string") {\r
+            var source = toString();\r
+            if (codegen.verbose)\r
+                console.log("codegen: " + source); // eslint-disable-line no-console\r
+            source = "return " + source;\r
+            if (formatStringOrScope) {\r
+                var scopeKeys   = Object.keys(formatStringOrScope),\r
+                    scopeParams = new Array(scopeKeys.length + 1),\r
+                    scopeValues = new Array(scopeKeys.length),\r
+                    scopeOffset = 0;\r
+                while (scopeOffset < scopeKeys.length) {\r
+                    scopeParams[scopeOffset] = scopeKeys[scopeOffset];\r
+                    scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\r
+                }\r
+                scopeParams[scopeOffset] = source;\r
+                return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\r
+            }\r
+            return Function(source)(); // eslint-disable-line no-new-func\r
+        }\r
+\r
+        // otherwise append to body\r
+        var formatParams = new Array(arguments.length - 1),\r
+            formatOffset = 0;\r
+        while (formatOffset < formatParams.length)\r
+            formatParams[formatOffset] = arguments[++formatOffset];\r
+        formatOffset = 0;\r
+        formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\r
+            var value = formatParams[formatOffset++];\r
+            switch ($1) {\r
+                case "d": case "f": return String(Number(value));\r
+                case "i": return String(Math.floor(value));\r
+                case "j": return JSON.stringify(value);\r
+                case "s": return String(value);\r
+            }\r
+            return "%";\r
+        });\r
+        if (formatOffset !== formatParams.length)\r
+            throw Error("parameter count mismatch");\r
+        body.push(formatStringOrScope);\r
+        return Codegen;\r
+    }\r
+\r
+    function toString(functionNameOverride) {\r
+        return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n  " + body.join("\n  ") + "\n}";\r
+    }\r
+\r
+    Codegen.toString = toString;\r
+    return Codegen;\r
+}\r
+\r
+/**\r
+ * Begins generating a function.\r
+ * @memberof util\r
+ * @function codegen\r
+ * @param {string} [functionName] Function name if not anonymous\r
+ * @returns {Codegen} Appender that appends code to the function's body\r
+ * @variation 2\r
+ */\r
+\r
+/**\r
+ * When set to `true`, codegen will log generated code to console. Useful for debugging.\r
+ * @name util.codegen.verbose\r
+ * @type {boolean}\r
+ */\r
+codegen.verbose = false;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/package.json
new file mode 100644 (file)
index 0000000..dde2069
--- /dev/null
@@ -0,0 +1,86 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/codegen@^2.0.4",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2fcodegen",
+        "name": "@protobufjs/codegen",
+        "rawSpec": "^2.0.4",
+        "spec": ">=2.0.4 <3.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/codegen@>=2.0.4 <3.0.0",
+  "_id": "@protobufjs/codegen@2.0.4",
+  "_inCache": true,
+  "_location": "/@protobufjs/codegen",
+  "_nodeVersion": "8.0.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/codegen-2.0.4.tgz_1497041777758_0.900342388311401"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "5.0.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/codegen@^2.0.4",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2fcodegen",
+    "name": "@protobufjs/codegen",
+    "rawSpec": "^2.0.4",
+    "spec": ">=2.0.4 <3.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
+  "_shasum": "7ef37f0d010fb028ad1ad59722e506d9262815cb",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/codegen@^2.0.4",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "A minimalistic code generation utility.",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==",
+    "shasum": "7ef37f0d010fb028ad1ad59722e506d9262815cb",
+    "tarball": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+npm-protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/codegen",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "types": "index.d.ts",
+  "version": "2.0.4"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/codegen/tests/index.js
new file mode 100644 (file)
index 0000000..f3a3db1
--- /dev/null
@@ -0,0 +1,13 @@
+var codegen = require("..");\r
+\r
+// new require("benchmark").Suite().add("add", function() {\r
+\r
+var add = codegen(["a", "b"], "add")\r
+  ("// awesome comment")\r
+  ("return a + b - c + %d", 1)\r
+  ({ c: 1 });\r
+\r
+if (add(1, 2) !== 3)\r
+  throw Error("failed");\r
+\r
+// }).on("cycle", function(event) { process.stdout.write(String(event.target) + "\n"); }).run();\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/README.md
new file mode 100644 (file)
index 0000000..998d315
--- /dev/null
@@ -0,0 +1,22 @@
+@protobufjs/eventemitter\r
+========================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/eventemitter.svg)](https://www.npmjs.com/package/@protobufjs/eventemitter)\r
+\r
+A minimal event emitter.\r
+\r
+API\r
+---\r
+\r
+* **new EventEmitter()**<br />\r
+  Constructs a new event emitter instance.\r
+\r
+* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**<br />\r
+  Registers an event listener.\r
+\r
+* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**<br />\r
+  Removes an event listener or any matching listeners if arguments are omitted.\r
+\r
+* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**<br />\r
+  Emits an event by calling its listeners with the specified arguments.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/index.d.ts
new file mode 100644 (file)
index 0000000..4615963
--- /dev/null
@@ -0,0 +1,43 @@
+export = EventEmitter;\r
+\r
+/**\r
+ * Constructs a new event emitter instance.\r
+ * @classdesc A minimal event emitter.\r
+ * @memberof util\r
+ * @constructor\r
+ */\r
+declare class EventEmitter {\r
+\r
+    /**\r
+     * Constructs a new event emitter instance.\r
+     * @classdesc A minimal event emitter.\r
+     * @memberof util\r
+     * @constructor\r
+     */\r
+    constructor();\r
+\r
+    /**\r
+     * Registers an event listener.\r
+     * @param {string} evt Event name\r
+     * @param {function} fn Listener\r
+     * @param {*} [ctx] Listener context\r
+     * @returns {util.EventEmitter} `this`\r
+     */\r
+    on(evt: string, fn: () => any, ctx?: any): EventEmitter;\r
+\r
+    /**\r
+     * Removes an event listener or any matching listeners if arguments are omitted.\r
+     * @param {string} [evt] Event name. Removes all listeners if omitted.\r
+     * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r
+     * @returns {util.EventEmitter} `this`\r
+     */\r
+    off(evt?: string, fn?: () => any): EventEmitter;\r
+\r
+    /**\r
+     * Emits an event by calling its listeners with the specified arguments.\r
+     * @param {string} evt Event name\r
+     * @param {...*} args Arguments\r
+     * @returns {util.EventEmitter} `this`\r
+     */\r
+    emit(evt: string, ...args: any[]): EventEmitter;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/index.js
new file mode 100644 (file)
index 0000000..76ce938
--- /dev/null
@@ -0,0 +1,76 @@
+"use strict";\r
+module.exports = EventEmitter;\r
+\r
+/**\r
+ * Constructs a new event emitter instance.\r
+ * @classdesc A minimal event emitter.\r
+ * @memberof util\r
+ * @constructor\r
+ */\r
+function EventEmitter() {\r
+\r
+    /**\r
+     * Registered listeners.\r
+     * @type {Object.<string,*>}\r
+     * @private\r
+     */\r
+    this._listeners = {};\r
+}\r
+\r
+/**\r
+ * Registers an event listener.\r
+ * @param {string} evt Event name\r
+ * @param {function} fn Listener\r
+ * @param {*} [ctx] Listener context\r
+ * @returns {util.EventEmitter} `this`\r
+ */\r
+EventEmitter.prototype.on = function on(evt, fn, ctx) {\r
+    (this._listeners[evt] || (this._listeners[evt] = [])).push({\r
+        fn  : fn,\r
+        ctx : ctx || this\r
+    });\r
+    return this;\r
+};\r
+\r
+/**\r
+ * Removes an event listener or any matching listeners if arguments are omitted.\r
+ * @param {string} [evt] Event name. Removes all listeners if omitted.\r
+ * @param {function} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\r
+ * @returns {util.EventEmitter} `this`\r
+ */\r
+EventEmitter.prototype.off = function off(evt, fn) {\r
+    if (evt === undefined)\r
+        this._listeners = {};\r
+    else {\r
+        if (fn === undefined)\r
+            this._listeners[evt] = [];\r
+        else {\r
+            var listeners = this._listeners[evt];\r
+            for (var i = 0; i < listeners.length;)\r
+                if (listeners[i].fn === fn)\r
+                    listeners.splice(i, 1);\r
+                else\r
+                    ++i;\r
+        }\r
+    }\r
+    return this;\r
+};\r
+\r
+/**\r
+ * Emits an event by calling its listeners with the specified arguments.\r
+ * @param {string} evt Event name\r
+ * @param {...*} args Arguments\r
+ * @returns {util.EventEmitter} `this`\r
+ */\r
+EventEmitter.prototype.emit = function emit(evt) {\r
+    var listeners = this._listeners[evt];\r
+    if (listeners) {\r
+        var args = [],\r
+            i = 1;\r
+        for (; i < arguments.length;)\r
+            args.push(arguments[i++]);\r
+        for (i = 0; i < listeners.length;)\r
+            listeners[i].fn.apply(listeners[i++].ctx, args);\r
+    }\r
+    return this;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/package.json
new file mode 100644 (file)
index 0000000..4abce6b
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/eventemitter@^1.1.0",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2feventemitter",
+        "name": "@protobufjs/eventemitter",
+        "rawSpec": "^1.1.0",
+        "spec": ">=1.1.0 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/eventemitter@>=1.1.0 <2.0.0",
+  "_id": "@protobufjs/eventemitter@1.1.0",
+  "_inCache": true,
+  "_location": "/@protobufjs/eventemitter",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/eventemitter-1.1.0.tgz_1485367943950_0.18555008037947118"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/eventemitter@^1.1.0",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2feventemitter",
+    "name": "@protobufjs/eventemitter",
+    "rawSpec": "^1.1.0",
+    "spec": ">=1.1.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
+  "_shasum": "355cbc98bafad5978f9ed095f397621f1d066b70",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/eventemitter@^1.1.0",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "A minimal event emitter.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "355cbc98bafad5978f9ed095f397621f1d066b70",
+    "tarball": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+npm-protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/eventemitter",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/eventemitter/tests/index.js
new file mode 100644 (file)
index 0000000..aeee277
--- /dev/null
@@ -0,0 +1,47 @@
+var tape = require("tape");\r
+\r
+var EventEmitter = require("..");\r
+\r
+tape.test("eventemitter", function(test) {\r
+\r
+    var ee = new EventEmitter();\r
+    var fn;\r
+    var ctx = {};\r
+\r
+    test.doesNotThrow(function() {\r
+        ee.emit("a", 1);\r
+        ee.off();\r
+        ee.off("a");\r
+        ee.off("a", function() {});\r
+    }, "should not throw if no listeners are registered");\r
+    \r
+    test.equal(ee.on("a", function(arg1) {\r
+        test.equal(this, ctx, "should be called with this = ctx");\r
+        test.equal(arg1, 1, "should be called with arg1 = 1");\r
+    }, ctx), ee, "should return itself when registering events");\r
+    ee.emit("a", 1);\r
+\r
+    ee.off("a");\r
+    test.same(ee._listeners, { a: [] }, "should remove all listeners of the respective event when calling off(evt)");\r
+\r
+    ee.off();\r
+    test.same(ee._listeners, {}, "should remove all listeners when just calling off()");\r
+\r
+    ee.on("a", fn = function(arg1) {\r
+        test.equal(this, ctx, "should be called with this = ctx");\r
+        test.equal(arg1, 1, "should be called with arg1 = 1");\r
+    }, ctx).emit("a", 1);\r
+\r
+    ee.off("a", fn);\r
+    test.same(ee._listeners, { a: [] }, "should remove the exact listener when calling off(evt, fn)");\r
+\r
+    ee.on("a", function() {\r
+        test.equal(this, ee, "should be called with this = ee");\r
+    }).emit("a");\r
+\r
+    test.doesNotThrow(function() {\r
+        ee.off("a", fn);\r
+    }, "should not throw if no such listener is found");\r
+\r
+    test.end();\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/README.md
new file mode 100644 (file)
index 0000000..11088a0
--- /dev/null
@@ -0,0 +1,13 @@
+@protobufjs/fetch\r
+=================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch)\r
+\r
+Fetches the contents of a file accross node and browsers.\r
+\r
+API\r
+---\r
+\r
+* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise<string|Uint8Array>|undefined`**\r
+  Fetches the contents of a file.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/index.d.ts
new file mode 100644 (file)
index 0000000..77cf9f3
--- /dev/null
@@ -0,0 +1,56 @@
+export = fetch;\r
+\r
+/**\r
+ * Node-style callback as used by {@link util.fetch}.\r
+ * @typedef FetchCallback\r
+ * @type {function}\r
+ * @param {?Error} error Error, if any, otherwise `null`\r
+ * @param {string} [contents] File contents, if there hasn't been an error\r
+ * @returns {undefined}\r
+ */\r
+type FetchCallback = (error: Error, contents?: string) => void;\r
+\r
+/**\r
+ * Options as used by {@link util.fetch}.\r
+ * @typedef FetchOptions\r
+ * @type {Object}\r
+ * @property {boolean} [binary=false] Whether expecting a binary response\r
+ * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r
+ */\r
+\r
+interface FetchOptions {\r
+    binary?: boolean;\r
+    xhr?: boolean\r
+}\r
+\r
+/**\r
+ * Fetches the contents of a file.\r
+ * @memberof util\r
+ * @param {string} filename File path or url\r
+ * @param {FetchOptions} options Fetch options\r
+ * @param {FetchCallback} callback Callback function\r
+ * @returns {undefined}\r
+ */\r
+declare function fetch(filename: string, options: FetchOptions, callback: FetchCallback): void;\r
+\r
+/**\r
+ * Fetches the contents of a file.\r
+ * @name util.fetch\r
+ * @function\r
+ * @param {string} path File path or url\r
+ * @param {FetchCallback} callback Callback function\r
+ * @returns {undefined}\r
+ * @variation 2\r
+ */\r
+declare function fetch(path: string, callback: FetchCallback): void;\r
+\r
+/**\r
+ * Fetches the contents of a file.\r
+ * @name util.fetch\r
+ * @function\r
+ * @param {string} path File path or url\r
+ * @param {FetchOptions} [options] Fetch options\r
+ * @returns {Promise<string|Uint8Array>} Promise\r
+ * @variation 3\r
+ */\r
+declare function fetch(path: string, options?: FetchOptions): Promise<(string|Uint8Array)>;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/index.js
new file mode 100644 (file)
index 0000000..f2766f5
--- /dev/null
@@ -0,0 +1,115 @@
+"use strict";\r
+module.exports = fetch;\r
+\r
+var asPromise = require("@protobufjs/aspromise"),\r
+    inquire   = require("@protobufjs/inquire");\r
+\r
+var fs = inquire("fs");\r
+\r
+/**\r
+ * Node-style callback as used by {@link util.fetch}.\r
+ * @typedef FetchCallback\r
+ * @type {function}\r
+ * @param {?Error} error Error, if any, otherwise `null`\r
+ * @param {string} [contents] File contents, if there hasn't been an error\r
+ * @returns {undefined}\r
+ */\r
+\r
+/**\r
+ * Options as used by {@link util.fetch}.\r
+ * @typedef FetchOptions\r
+ * @type {Object}\r
+ * @property {boolean} [binary=false] Whether expecting a binary response\r
+ * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\r
+ */\r
+\r
+/**\r
+ * Fetches the contents of a file.\r
+ * @memberof util\r
+ * @param {string} filename File path or url\r
+ * @param {FetchOptions} options Fetch options\r
+ * @param {FetchCallback} callback Callback function\r
+ * @returns {undefined}\r
+ */\r
+function fetch(filename, options, callback) {\r
+    if (typeof options === "function") {\r
+        callback = options;\r
+        options = {};\r
+    } else if (!options)\r
+        options = {};\r
+\r
+    if (!callback)\r
+        return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\r
+\r
+    // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\r
+    if (!options.xhr && fs && fs.readFile)\r
+        return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\r
+            return err && typeof XMLHttpRequest !== "undefined"\r
+                ? fetch.xhr(filename, options, callback)\r
+                : err\r
+                ? callback(err)\r
+                : callback(null, options.binary ? contents : contents.toString("utf8"));\r
+        });\r
+\r
+    // use the XHR version otherwise.\r
+    return fetch.xhr(filename, options, callback);\r
+}\r
+\r
+/**\r
+ * Fetches the contents of a file.\r
+ * @name util.fetch\r
+ * @function\r
+ * @param {string} path File path or url\r
+ * @param {FetchCallback} callback Callback function\r
+ * @returns {undefined}\r
+ * @variation 2\r
+ */\r
+\r
+/**\r
+ * Fetches the contents of a file.\r
+ * @name util.fetch\r
+ * @function\r
+ * @param {string} path File path or url\r
+ * @param {FetchOptions} [options] Fetch options\r
+ * @returns {Promise<string|Uint8Array>} Promise\r
+ * @variation 3\r
+ */\r
+\r
+/**/\r
+fetch.xhr = function fetch_xhr(filename, options, callback) {\r
+    var xhr = new XMLHttpRequest();\r
+    xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\r
+\r
+        if (xhr.readyState !== 4)\r
+            return undefined;\r
+\r
+        // local cors security errors return status 0 / empty string, too. afaik this cannot be\r
+        // reliably distinguished from an actually empty file for security reasons. feel free\r
+        // to send a pull request if you are aware of a solution.\r
+        if (xhr.status !== 0 && xhr.status !== 200)\r
+            return callback(Error("status " + xhr.status));\r
+\r
+        // if binary data is expected, make sure that some sort of array is returned, even if\r
+        // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\r
+        if (options.binary) {\r
+            var buffer = xhr.response;\r
+            if (!buffer) {\r
+                buffer = [];\r
+                for (var i = 0; i < xhr.responseText.length; ++i)\r
+                    buffer.push(xhr.responseText.charCodeAt(i) & 255);\r
+            }\r
+            return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);\r
+        }\r
+        return callback(null, xhr.responseText);\r
+    };\r
+\r
+    if (options.binary) {\r
+        // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\r
+        if ("overrideMimeType" in xhr)\r
+            xhr.overrideMimeType("text/plain; charset=x-user-defined");\r
+        xhr.responseType = "arraybuffer";\r
+    }\r
+\r
+    xhr.open("GET", filename);\r
+    xhr.send();\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/package.json
new file mode 100644 (file)
index 0000000..5b1214d
--- /dev/null
@@ -0,0 +1,95 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/fetch@^1.1.0",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2ffetch",
+        "name": "@protobufjs/fetch",
+        "rawSpec": "^1.1.0",
+        "spec": ">=1.1.0 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/fetch@>=1.1.0 <2.0.0",
+  "_id": "@protobufjs/fetch@1.1.0",
+  "_inCache": true,
+  "_location": "/@protobufjs/fetch",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/fetch-1.1.0.tgz_1485532253082_0.3777743794489652"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/fetch@^1.1.0",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2ffetch",
+    "name": "@protobufjs/fetch",
+    "rawSpec": "^1.1.0",
+    "spec": ">=1.1.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
+  "_shasum": "ba99fb598614af65700c1619ff06d454b0d84c45",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/fetch@^1.1.0",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {
+    "@protobufjs/aspromise": "^1.1.1",
+    "@protobufjs/inquire": "^1.1.0"
+  },
+  "description": "Fetches the contents of a file accross node and browsers.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "ba99fb598614af65700c1619ff06d454b0d84c45",
+    "tarball": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode+npm@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/fetch",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/fetch/tests/index.js
new file mode 100644 (file)
index 0000000..3cb0dae
--- /dev/null
@@ -0,0 +1,16 @@
+var tape = require("tape");\r
+\r
+var fetch = require("..");\r
+\r
+tape.test("fetch", function(test) {\r
+\r
+    if (typeof Promise !== "undefined") {\r
+        var promise = fetch("NOTFOUND");\r
+        promise.catch(function() {});\r
+        test.ok(promise instanceof Promise, "should return a promise if callback has been omitted");\r
+    }\r
+\r
+    // TODO - some way to test this properly?\r
+    \r
+    test.end();\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/README.md
new file mode 100644 (file)
index 0000000..8947bae
--- /dev/null
@@ -0,0 +1,102 @@
+@protobufjs/float\r
+=================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/float.svg)](https://www.npmjs.com/package/@protobufjs/float)\r
+\r
+Reads / writes floats / doubles from / to buffers in both modern and ancient browsers. Fast.\r
+\r
+API\r
+---\r
+\r
+* **writeFloatLE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\r
+  Writes a 32 bit float to a buffer using little endian byte order.\r
+\r
+* **writeFloatBE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\r
+  Writes a 32 bit float to a buffer using big endian byte order.\r
+\r
+* **readFloatLE(buf: `Uint8Array`, pos: `number`): `number`**<br />\r
+  Reads a 32 bit float from a buffer using little endian byte order.\r
+\r
+* **readFloatBE(buf: `Uint8Array`, pos: `number`): `number`**<br />\r
+  Reads a 32 bit float from a buffer using big endian byte order.\r
+\r
+* **writeDoubleLE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\r
+  Writes a 64 bit double to a buffer using little endian byte order.\r
+\r
+* **writeDoubleBE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\r
+  Writes a 64 bit double to a buffer using big endian byte order.\r
+\r
+* **readDoubleLE(buf: `Uint8Array`, pos: `number`): `number`**<br />\r
+  Reads a 64 bit double from a buffer using little endian byte order.\r
+\r
+* **readDoubleBE(buf: `Uint8Array`, pos: `number`): `number`**<br />\r
+  Reads a 64 bit double from a buffer using big endian byte order.\r
+\r
+Performance\r
+-----------\r
+There is a simple benchmark included comparing raw read/write performance of this library (float), float's fallback for old browsers, the [ieee754](https://www.npmjs.com/package/ieee754) module and node's [buffer](https://nodejs.org/api/buffer.html). On an i7-2600k running node 6.9.1 it yields:\r
+\r
+```\r
+benchmarking writeFloat performance ...\r
+\r
+float x 42,741,625 ops/sec ±1.75% (81 runs sampled)\r
+float (fallback) x 11,272,532 ops/sec ±1.12% (85 runs sampled)\r
+ieee754 x 8,653,337 ops/sec ±1.18% (84 runs sampled)\r
+buffer x 12,412,414 ops/sec ±1.41% (83 runs sampled)\r
+buffer (noAssert) x 13,471,149 ops/sec ±1.09% (84 runs sampled)\r
+\r
+                      float was fastest\r
+           float (fallback) was 73.5% slower\r
+                    ieee754 was 79.6% slower\r
+                     buffer was 70.9% slower\r
+          buffer (noAssert) was 68.3% slower\r
+\r
+benchmarking readFloat performance ...\r
+\r
+float x 44,382,729 ops/sec ±1.70% (84 runs sampled)\r
+float (fallback) x 20,925,938 ops/sec ±0.86% (87 runs sampled)\r
+ieee754 x 17,189,009 ops/sec ±1.01% (87 runs sampled)\r
+buffer x 10,518,437 ops/sec ±1.04% (83 runs sampled)\r
+buffer (noAssert) x 11,031,636 ops/sec ±1.15% (87 runs sampled)\r
+\r
+                      float was fastest\r
+           float (fallback) was 52.5% slower\r
+                    ieee754 was 61.0% slower\r
+                     buffer was 76.1% slower\r
+          buffer (noAssert) was 75.0% slower\r
+\r
+benchmarking writeDouble performance ...\r
+\r
+float x 38,624,906 ops/sec ±0.93% (83 runs sampled)\r
+float (fallback) x 10,457,811 ops/sec ±1.54% (85 runs sampled)\r
+ieee754 x 7,681,130 ops/sec ±1.11% (83 runs sampled)\r
+buffer x 12,657,876 ops/sec ±1.03% (83 runs sampled)\r
+buffer (noAssert) x 13,372,795 ops/sec ±0.84% (85 runs sampled)\r
+\r
+                      float was fastest\r
+           float (fallback) was 73.1% slower\r
+                    ieee754 was 80.1% slower\r
+                     buffer was 67.3% slower\r
+          buffer (noAssert) was 65.3% slower\r
+\r
+benchmarking readDouble performance ...\r
+\r
+float x 40,527,888 ops/sec ±1.05% (84 runs sampled)\r
+float (fallback) x 18,696,480 ops/sec ±0.84% (86 runs sampled)\r
+ieee754 x 14,074,028 ops/sec ±1.04% (87 runs sampled)\r
+buffer x 10,092,367 ops/sec ±1.15% (84 runs sampled)\r
+buffer (noAssert) x 10,623,793 ops/sec ±0.96% (84 runs sampled)\r
+\r
+                      float was fastest\r
+           float (fallback) was 53.8% slower\r
+                    ieee754 was 65.3% slower\r
+                     buffer was 75.1% slower\r
+          buffer (noAssert) was 73.8% slower\r
+```\r
+\r
+To run it yourself:\r
+\r
+```\r
+$> npm run bench\r
+```\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/bench/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/bench/index.js
new file mode 100644 (file)
index 0000000..1b3c4b8
--- /dev/null
@@ -0,0 +1,87 @@
+"use strict";\r
+\r
+var float = require(".."),\r
+    ieee754 = require("ieee754"),\r
+    newSuite = require("./suite");\r
+\r
+var F32 = Float32Array;\r
+var F64 = Float64Array;\r
+delete global.Float32Array;\r
+delete global.Float64Array;\r
+var floatFallback = float({});\r
+global.Float32Array = F32;\r
+global.Float64Array = F64;\r
+\r
+var buf = new Buffer(8);\r
+\r
+newSuite("writeFloat")\r
+.add("float", function() {\r
+    float.writeFloatLE(0.1, buf, 0);\r
+})\r
+.add("float (fallback)", function() {\r
+    floatFallback.writeFloatLE(0.1, buf, 0);\r
+})\r
+.add("ieee754", function() {\r
+    ieee754.write(buf, 0.1, 0, true, 23, 4);\r
+})\r
+.add("buffer", function() {\r
+    buf.writeFloatLE(0.1, 0);\r
+})\r
+.add("buffer (noAssert)", function() {\r
+    buf.writeFloatLE(0.1, 0, true);\r
+})\r
+.run();\r
+\r
+newSuite("readFloat")\r
+.add("float", function() {\r
+    float.readFloatLE(buf, 0);\r
+})\r
+.add("float (fallback)", function() {\r
+    floatFallback.readFloatLE(buf, 0);\r
+})\r
+.add("ieee754", function() {\r
+    ieee754.read(buf, 0, true, 23, 4);\r
+})\r
+.add("buffer", function() {\r
+    buf.readFloatLE(0);\r
+})\r
+.add("buffer (noAssert)", function() {\r
+    buf.readFloatLE(0, true);\r
+})\r
+.run();\r
+\r
+newSuite("writeDouble")\r
+.add("float", function() {\r
+    float.writeDoubleLE(0.1, buf, 0);\r
+})\r
+.add("float (fallback)", function() {\r
+    floatFallback.writeDoubleLE(0.1, buf, 0);\r
+})\r
+.add("ieee754", function() {\r
+    ieee754.write(buf, 0.1, 0, true, 52, 8);\r
+})\r
+.add("buffer", function() {\r
+    buf.writeDoubleLE(0.1, 0);\r
+})\r
+.add("buffer (noAssert)", function() {\r
+    buf.writeDoubleLE(0.1, 0, true);\r
+})\r
+.run();\r
+\r
+newSuite("readDouble")\r
+.add("float", function() {\r
+    float.readDoubleLE(buf, 0);\r
+})\r
+.add("float (fallback)", function() {\r
+    floatFallback.readDoubleLE(buf, 0);\r
+})\r
+.add("ieee754", function() {\r
+    ieee754.read(buf, 0, true, 52, 8);\r
+})\r
+.add("buffer", function() {\r
+    buf.readDoubleLE(0);\r
+})\r
+.add("buffer (noAssert)", function() {\r
+    buf.readDoubleLE(0, true);\r
+})\r
+.run();\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/bench/suite.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/bench/suite.js
new file mode 100644 (file)
index 0000000..3820579
--- /dev/null
@@ -0,0 +1,46 @@
+"use strict";\r
+module.exports = newSuite;\r
+\r
+var benchmark = require("benchmark"),\r
+    chalk     = require("chalk");\r
+\r
+var padSize = 27;\r
+\r
+function newSuite(name) {\r
+    var benches = [];\r
+    return new benchmark.Suite(name)\r
+    .on("add", function(event) {\r
+        benches.push(event.target);\r
+    })\r
+    .on("start", function() {\r
+        process.stdout.write("benchmarking " + name + " performance ...\n\n");\r
+    })\r
+    .on("cycle", function(event) {\r
+        process.stdout.write(String(event.target) + "\n");\r
+    })\r
+    .on("complete", function() {\r
+        if (benches.length > 1) {\r
+            var fastest = this.filter("fastest"), // eslint-disable-line no-invalid-this\r
+                fastestHz = getHz(fastest[0]);\r
+            process.stdout.write("\n" + chalk.white(pad(fastest[0].name, padSize)) + " was " + chalk.green("fastest") + "\n");\r
+            benches.forEach(function(bench) {\r
+                if (fastest.indexOf(bench) === 0)\r
+                    return;\r
+                var hz = hz = getHz(bench);\r
+                var percent = (1 - hz / fastestHz) * 100;\r
+                process.stdout.write(chalk.white(pad(bench.name, padSize)) + " was " + chalk.red(percent.toFixed(1) + "% slower") + "\n");\r
+            });\r
+        }\r
+        process.stdout.write("\n");\r
+    });\r
+}\r
+\r
+function getHz(bench) {\r
+    return 1 / (bench.stats.mean + bench.stats.moe);\r
+}\r
+\r
+function pad(str, len, l) {\r
+    while (str.length < len)\r
+        str = l ? str + " " : " " + str;\r
+    return str;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/index.d.ts
new file mode 100644 (file)
index 0000000..ab05de3
--- /dev/null
@@ -0,0 +1,83 @@
+/**
+ * Writes a 32 bit float to a buffer using little endian byte order.
+ * @name writeFloatLE
+ * @function
+ * @param {number} val Value to write
+ * @param {Uint8Array} buf Target buffer
+ * @param {number} pos Target buffer offset
+ * @returns {undefined}
+ */
+export function writeFloatLE(val: number, buf: Uint8Array, pos: number): void;
+
+/**
+ * Writes a 32 bit float to a buffer using big endian byte order.
+ * @name writeFloatBE
+ * @function
+ * @param {number} val Value to write
+ * @param {Uint8Array} buf Target buffer
+ * @param {number} pos Target buffer offset
+ * @returns {undefined}
+ */
+export function writeFloatBE(val: number, buf: Uint8Array, pos: number): void;
+
+/**
+ * Reads a 32 bit float from a buffer using little endian byte order.
+ * @name readFloatLE
+ * @function
+ * @param {Uint8Array} buf Source buffer
+ * @param {number} pos Source buffer offset
+ * @returns {number} Value read
+ */
+export function readFloatLE(buf: Uint8Array, pos: number): number;
+
+/**
+ * Reads a 32 bit float from a buffer using big endian byte order.
+ * @name readFloatBE
+ * @function
+ * @param {Uint8Array} buf Source buffer
+ * @param {number} pos Source buffer offset
+ * @returns {number} Value read
+ */
+export function readFloatBE(buf: Uint8Array, pos: number): number;
+
+/**
+ * Writes a 64 bit double to a buffer using little endian byte order.
+ * @name writeDoubleLE
+ * @function
+ * @param {number} val Value to write
+ * @param {Uint8Array} buf Target buffer
+ * @param {number} pos Target buffer offset
+ * @returns {undefined}
+ */
+export function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void;
+
+/**
+ * Writes a 64 bit double to a buffer using big endian byte order.
+ * @name writeDoubleBE
+ * @function
+ * @param {number} val Value to write
+ * @param {Uint8Array} buf Target buffer
+ * @param {number} pos Target buffer offset
+ * @returns {undefined}
+ */
+export function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void;
+
+/**
+ * Reads a 64 bit double from a buffer using little endian byte order.
+ * @name readDoubleLE
+ * @function
+ * @param {Uint8Array} buf Source buffer
+ * @param {number} pos Source buffer offset
+ * @returns {number} Value read
+ */
+export function readDoubleLE(buf: Uint8Array, pos: number): number;
+
+/**
+ * Reads a 64 bit double from a buffer using big endian byte order.
+ * @name readDoubleBE
+ * @function
+ * @param {Uint8Array} buf Source buffer
+ * @param {number} pos Source buffer offset
+ * @returns {number} Value read
+ */
+export function readDoubleBE(buf: Uint8Array, pos: number): number;
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/index.js
new file mode 100644 (file)
index 0000000..706d096
--- /dev/null
@@ -0,0 +1,335 @@
+"use strict";\r
+\r
+module.exports = factory(factory);\r
+\r
+/**\r
+ * Reads / writes floats / doubles from / to buffers.\r
+ * @name util.float\r
+ * @namespace\r
+ */\r
+\r
+/**\r
+ * Writes a 32 bit float to a buffer using little endian byte order.\r
+ * @name util.float.writeFloatLE\r
+ * @function\r
+ * @param {number} val Value to write\r
+ * @param {Uint8Array} buf Target buffer\r
+ * @param {number} pos Target buffer offset\r
+ * @returns {undefined}\r
+ */\r
+\r
+/**\r
+ * Writes a 32 bit float to a buffer using big endian byte order.\r
+ * @name util.float.writeFloatBE\r
+ * @function\r
+ * @param {number} val Value to write\r
+ * @param {Uint8Array} buf Target buffer\r
+ * @param {number} pos Target buffer offset\r
+ * @returns {undefined}\r
+ */\r
+\r
+/**\r
+ * Reads a 32 bit float from a buffer using little endian byte order.\r
+ * @name util.float.readFloatLE\r
+ * @function\r
+ * @param {Uint8Array} buf Source buffer\r
+ * @param {number} pos Source buffer offset\r
+ * @returns {number} Value read\r
+ */\r
+\r
+/**\r
+ * Reads a 32 bit float from a buffer using big endian byte order.\r
+ * @name util.float.readFloatBE\r
+ * @function\r
+ * @param {Uint8Array} buf Source buffer\r
+ * @param {number} pos Source buffer offset\r
+ * @returns {number} Value read\r
+ */\r
+\r
+/**\r
+ * Writes a 64 bit double to a buffer using little endian byte order.\r
+ * @name util.float.writeDoubleLE\r
+ * @function\r
+ * @param {number} val Value to write\r
+ * @param {Uint8Array} buf Target buffer\r
+ * @param {number} pos Target buffer offset\r
+ * @returns {undefined}\r
+ */\r
+\r
+/**\r
+ * Writes a 64 bit double to a buffer using big endian byte order.\r
+ * @name util.float.writeDoubleBE\r
+ * @function\r
+ * @param {number} val Value to write\r
+ * @param {Uint8Array} buf Target buffer\r
+ * @param {number} pos Target buffer offset\r
+ * @returns {undefined}\r
+ */\r
+\r
+/**\r
+ * Reads a 64 bit double from a buffer using little endian byte order.\r
+ * @name util.float.readDoubleLE\r
+ * @function\r
+ * @param {Uint8Array} buf Source buffer\r
+ * @param {number} pos Source buffer offset\r
+ * @returns {number} Value read\r
+ */\r
+\r
+/**\r
+ * Reads a 64 bit double from a buffer using big endian byte order.\r
+ * @name util.float.readDoubleBE\r
+ * @function\r
+ * @param {Uint8Array} buf Source buffer\r
+ * @param {number} pos Source buffer offset\r
+ * @returns {number} Value read\r
+ */\r
+\r
+// Factory function for the purpose of node-based testing in modified global environments\r
+function factory(exports) {\r
+\r
+    // float: typed array\r
+    if (typeof Float32Array !== "undefined") (function() {\r
+\r
+        var f32 = new Float32Array([ -0 ]),\r
+            f8b = new Uint8Array(f32.buffer),\r
+            le  = f8b[3] === 128;\r
+\r
+        function writeFloat_f32_cpy(val, buf, pos) {\r
+            f32[0] = val;\r
+            buf[pos    ] = f8b[0];\r
+            buf[pos + 1] = f8b[1];\r
+            buf[pos + 2] = f8b[2];\r
+            buf[pos + 3] = f8b[3];\r
+        }\r
+\r
+        function writeFloat_f32_rev(val, buf, pos) {\r
+            f32[0] = val;\r
+            buf[pos    ] = f8b[3];\r
+            buf[pos + 1] = f8b[2];\r
+            buf[pos + 2] = f8b[1];\r
+            buf[pos + 3] = f8b[0];\r
+        }\r
+\r
+        /* istanbul ignore next */\r
+        exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\r
+        /* istanbul ignore next */\r
+        exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\r
+\r
+        function readFloat_f32_cpy(buf, pos) {\r
+            f8b[0] = buf[pos    ];\r
+            f8b[1] = buf[pos + 1];\r
+            f8b[2] = buf[pos + 2];\r
+            f8b[3] = buf[pos + 3];\r
+            return f32[0];\r
+        }\r
+\r
+        function readFloat_f32_rev(buf, pos) {\r
+            f8b[3] = buf[pos    ];\r
+            f8b[2] = buf[pos + 1];\r
+            f8b[1] = buf[pos + 2];\r
+            f8b[0] = buf[pos + 3];\r
+            return f32[0];\r
+        }\r
+\r
+        /* istanbul ignore next */\r
+        exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\r
+        /* istanbul ignore next */\r
+        exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\r
+\r
+    // float: ieee754\r
+    })(); else (function() {\r
+\r
+        function writeFloat_ieee754(writeUint, val, buf, pos) {\r
+            var sign = val < 0 ? 1 : 0;\r
+            if (sign)\r
+                val = -val;\r
+            if (val === 0)\r
+                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\r
+            else if (isNaN(val))\r
+                writeUint(2143289344, buf, pos);\r
+            else if (val > 3.4028234663852886e+38) // +-Infinity\r
+                writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\r
+            else if (val < 1.1754943508222875e-38) // denormal\r
+                writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\r
+            else {\r
+                var exponent = Math.floor(Math.log(val) / Math.LN2),\r
+                    mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\r
+                writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\r
+            }\r
+        }\r
+\r
+        exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\r
+        exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\r
+\r
+        function readFloat_ieee754(readUint, buf, pos) {\r
+            var uint = readUint(buf, pos),\r
+                sign = (uint >> 31) * 2 + 1,\r
+                exponent = uint >>> 23 & 255,\r
+                mantissa = uint & 8388607;\r
+            return exponent === 255\r
+                ? mantissa\r
+                ? NaN\r
+                : sign * Infinity\r
+                : exponent === 0 // denormal\r
+                ? sign * 1.401298464324817e-45 * mantissa\r
+                : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\r
+        }\r
+\r
+        exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\r
+        exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\r
+\r
+    })();\r
+\r
+    // double: typed array\r
+    if (typeof Float64Array !== "undefined") (function() {\r
+\r
+        var f64 = new Float64Array([-0]),\r
+            f8b = new Uint8Array(f64.buffer),\r
+            le  = f8b[7] === 128;\r
+\r
+        function writeDouble_f64_cpy(val, buf, pos) {\r
+            f64[0] = val;\r
+            buf[pos    ] = f8b[0];\r
+            buf[pos + 1] = f8b[1];\r
+            buf[pos + 2] = f8b[2];\r
+            buf[pos + 3] = f8b[3];\r
+            buf[pos + 4] = f8b[4];\r
+            buf[pos + 5] = f8b[5];\r
+            buf[pos + 6] = f8b[6];\r
+            buf[pos + 7] = f8b[7];\r
+        }\r
+\r
+        function writeDouble_f64_rev(val, buf, pos) {\r
+            f64[0] = val;\r
+            buf[pos    ] = f8b[7];\r
+            buf[pos + 1] = f8b[6];\r
+            buf[pos + 2] = f8b[5];\r
+            buf[pos + 3] = f8b[4];\r
+            buf[pos + 4] = f8b[3];\r
+            buf[pos + 5] = f8b[2];\r
+            buf[pos + 6] = f8b[1];\r
+            buf[pos + 7] = f8b[0];\r
+        }\r
+\r
+        /* istanbul ignore next */\r
+        exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\r
+        /* istanbul ignore next */\r
+        exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\r
+\r
+        function readDouble_f64_cpy(buf, pos) {\r
+            f8b[0] = buf[pos    ];\r
+            f8b[1] = buf[pos + 1];\r
+            f8b[2] = buf[pos + 2];\r
+            f8b[3] = buf[pos + 3];\r
+            f8b[4] = buf[pos + 4];\r
+            f8b[5] = buf[pos + 5];\r
+            f8b[6] = buf[pos + 6];\r
+            f8b[7] = buf[pos + 7];\r
+            return f64[0];\r
+        }\r
+\r
+        function readDouble_f64_rev(buf, pos) {\r
+            f8b[7] = buf[pos    ];\r
+            f8b[6] = buf[pos + 1];\r
+            f8b[5] = buf[pos + 2];\r
+            f8b[4] = buf[pos + 3];\r
+            f8b[3] = buf[pos + 4];\r
+            f8b[2] = buf[pos + 5];\r
+            f8b[1] = buf[pos + 6];\r
+            f8b[0] = buf[pos + 7];\r
+            return f64[0];\r
+        }\r
+\r
+        /* istanbul ignore next */\r
+        exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\r
+        /* istanbul ignore next */\r
+        exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\r
+\r
+    // double: ieee754\r
+    })(); else (function() {\r
+\r
+        function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\r
+            var sign = val < 0 ? 1 : 0;\r
+            if (sign)\r
+                val = -val;\r
+            if (val === 0) {\r
+                writeUint(0, buf, pos + off0);\r
+                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\r
+            } else if (isNaN(val)) {\r
+                writeUint(0, buf, pos + off0);\r
+                writeUint(2146959360, buf, pos + off1);\r
+            } else if (val > 1.7976931348623157e+308) { // +-Infinity\r
+                writeUint(0, buf, pos + off0);\r
+                writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\r
+            } else {\r
+                var mantissa;\r
+                if (val < 2.2250738585072014e-308) { // denormal\r
+                    mantissa = val / 5e-324;\r
+                    writeUint(mantissa >>> 0, buf, pos + off0);\r
+                    writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\r
+                } else {\r
+                    var exponent = Math.floor(Math.log(val) / Math.LN2);\r
+                    if (exponent === 1024)\r
+                        exponent = 1023;\r
+                    mantissa = val * Math.pow(2, -exponent);\r
+                    writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\r
+                    writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\r
+                }\r
+            }\r
+        }\r
+\r
+        exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\r
+        exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\r
+\r
+        function readDouble_ieee754(readUint, off0, off1, buf, pos) {\r
+            var lo = readUint(buf, pos + off0),\r
+                hi = readUint(buf, pos + off1);\r
+            var sign = (hi >> 31) * 2 + 1,\r
+                exponent = hi >>> 20 & 2047,\r
+                mantissa = 4294967296 * (hi & 1048575) + lo;\r
+            return exponent === 2047\r
+                ? mantissa\r
+                ? NaN\r
+                : sign * Infinity\r
+                : exponent === 0 // denormal\r
+                ? sign * 5e-324 * mantissa\r
+                : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\r
+        }\r
+\r
+        exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\r
+        exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\r
+\r
+    })();\r
+\r
+    return exports;\r
+}\r
+\r
+// uint helpers\r
+\r
+function writeUintLE(val, buf, pos) {\r
+    buf[pos    ] =  val        & 255;\r
+    buf[pos + 1] =  val >>> 8  & 255;\r
+    buf[pos + 2] =  val >>> 16 & 255;\r
+    buf[pos + 3] =  val >>> 24;\r
+}\r
+\r
+function writeUintBE(val, buf, pos) {\r
+    buf[pos    ] =  val >>> 24;\r
+    buf[pos + 1] =  val >>> 16 & 255;\r
+    buf[pos + 2] =  val >>> 8  & 255;\r
+    buf[pos + 3] =  val        & 255;\r
+}\r
+\r
+function readUintLE(buf, pos) {\r
+    return (buf[pos    ]\r
+          | buf[pos + 1] << 8\r
+          | buf[pos + 2] << 16\r
+          | buf[pos + 3] << 24) >>> 0;\r
+}\r
+\r
+function readUintBE(buf, pos) {\r
+    return (buf[pos    ] << 24\r
+          | buf[pos + 1] << 16\r
+          | buf[pos + 2] << 8\r
+          | buf[pos + 3]) >>> 0;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/package.json
new file mode 100644 (file)
index 0000000..7ee37d1
--- /dev/null
@@ -0,0 +1,96 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/float@^1.0.2",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2ffloat",
+        "name": "@protobufjs/float",
+        "rawSpec": "^1.0.2",
+        "spec": ">=1.0.2 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/float@>=1.0.2 <2.0.0",
+  "_id": "@protobufjs/float@1.0.2",
+  "_inCache": true,
+  "_location": "/@protobufjs/float",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/float-1.0.2.tgz_1491129941022_0.6265034212265164"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/float@^1.0.2",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2ffloat",
+    "name": "@protobufjs/float",
+    "rawSpec": "^1.0.2",
+    "spec": ">=1.0.2 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+  "_shasum": "5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/float@^1.0.2",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "Reads / writes floats / doubles from / to buffers in both modern and ancient browsers.",
+  "devDependencies": {
+    "benchmark": "^2.1.4",
+    "chalk": "^1.1.3",
+    "ieee754": "^1.1.8",
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1",
+    "tarball": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode+npm@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/float",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "bench": "node bench",
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/float/tests/index.js
new file mode 100644 (file)
index 0000000..324e85c
--- /dev/null
@@ -0,0 +1,100 @@
+var tape = require("tape");\r
+\r
+var float = require("..");\r
+\r
+tape.test("float", function(test) {\r
+\r
+    // default\r
+    test.test(test.name + " - typed array", function(test) {\r
+        runTest(float, test);\r
+    });\r
+\r
+    // ieee754\r
+    test.test(test.name + " - fallback", function(test) {\r
+        var F32 = global.Float32Array,\r
+            F64 = global.Float64Array;\r
+        delete global.Float32Array;\r
+        delete global.Float64Array;\r
+        runTest(float({}), test);\r
+        global.Float32Array = F32;\r
+        global.Float64Array = F64;\r
+    });\r
+});\r
+\r
+function runTest(float, test) {\r
+\r
+    var common = [\r
+        0,\r
+        -0,\r
+        Infinity,\r
+        -Infinity,\r
+        0.125,\r
+        1024.5,\r
+        -4096.5,\r
+        NaN\r
+    ];\r
+\r
+    test.test(test.name + " - using 32 bits", function(test) {\r
+        common.concat([\r
+            3.4028234663852886e+38,\r
+            1.1754943508222875e-38,\r
+            1.1754946310819804e-39\r
+        ])\r
+        .forEach(function(value) {\r
+            var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString();\r
+            test.ok(\r
+                checkValue(value, 4, float.readFloatLE, float.writeFloatLE, Buffer.prototype.writeFloatLE),\r
+                "should write and read back " + strval + " (32 bit LE)"\r
+            );\r
+            test.ok(\r
+                checkValue(value, 4, float.readFloatBE, float.writeFloatBE, Buffer.prototype.writeFloatBE),\r
+                "should write and read back " + strval + " (32 bit BE)"\r
+            );\r
+        });\r
+        test.end();\r
+    });\r
+\r
+    test.test(test.name + " - using 64 bits", function(test) {\r
+        common.concat([\r
+            1.7976931348623157e+308,\r
+            2.2250738585072014e-308,\r
+            2.2250738585072014e-309\r
+        ])\r
+        .forEach(function(value) {\r
+            var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString();\r
+            test.ok(\r
+                checkValue(value, 8, float.readDoubleLE, float.writeDoubleLE, Buffer.prototype.writeDoubleLE),\r
+                "should write and read back " + strval + " (64 bit LE)"\r
+            );\r
+            test.ok(\r
+                checkValue(value, 8, float.readDoubleBE, float.writeDoubleBE, Buffer.prototype.writeDoubleBE),\r
+                "should write and read back " + strval + " (64 bit BE)"\r
+            );\r
+        });\r
+        test.end();\r
+    });\r
+\r
+    test.end();\r
+}\r
+\r
+function checkValue(value, size, read, write, write_comp) {\r
+    var buffer = new Buffer(size);\r
+    write(value, buffer, 0);\r
+    var value_comp = read(buffer, 0);\r
+    var strval = value === 0 && 1 / value < 0 ? "-0" : value.toString();\r
+    if (value !== value) {\r
+        if (value_comp === value_comp)\r
+            return false;\r
+    } else if (value_comp !== value)\r
+        return false;\r
+\r
+    var buffer_comp = new Buffer(size);\r
+    write_comp.call(buffer_comp, value, 0);\r
+    for (var i = 0; i < size; ++i)\r
+        if (buffer[i] !== buffer_comp[i]) {\r
+            console.error(">", buffer, buffer_comp);\r
+            return false;\r
+        }\r
+\r
+    return true;\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/README.md
new file mode 100644 (file)
index 0000000..22f9968
--- /dev/null
@@ -0,0 +1,13 @@
+@protobufjs/inquire\r
+===================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/inquire.svg)](https://www.npmjs.com/package/@protobufjs/inquire)\r
+\r
+Requires a module only if available and hides the require call from bundlers.\r
+\r
+API\r
+---\r
+\r
+* **inquire(moduleName: `string`): `?Object`**<br />\r
+  Requires a module only if available.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/index.d.ts
new file mode 100644 (file)
index 0000000..6f9825b
--- /dev/null
@@ -0,0 +1,9 @@
+export = inquire;\r
+\r
+/**\r
+ * Requires a module only if available.\r
+ * @memberof util\r
+ * @param {string} moduleName Module to require\r
+ * @returns {?Object} Required module if available and not empty, otherwise `null`\r
+ */\r
+declare function inquire(moduleName: string): Object;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/index.js
new file mode 100644 (file)
index 0000000..33778b5
--- /dev/null
@@ -0,0 +1,17 @@
+"use strict";\r
+module.exports = inquire;\r
+\r
+/**\r
+ * Requires a module only if available.\r
+ * @memberof util\r
+ * @param {string} moduleName Module to require\r
+ * @returns {?Object} Required module if available and not empty, otherwise `null`\r
+ */\r
+function inquire(moduleName) {\r
+    try {\r
+        var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval\r
+        if (mod && (mod.length || Object.keys(mod).length))\r
+            return mod;\r
+    } catch (e) {} // eslint-disable-line no-empty\r
+    return null;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/package.json
new file mode 100644 (file)
index 0000000..a91b63f
--- /dev/null
@@ -0,0 +1,93 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/inquire@^1.1.0",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2finquire",
+        "name": "@protobufjs/inquire",
+        "rawSpec": "^1.1.0",
+        "spec": ">=1.1.0 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/inquire@>=1.1.0 <2.0.0",
+  "_id": "@protobufjs/inquire@1.1.0",
+  "_inCache": true,
+  "_location": "/@protobufjs/inquire",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/inquire-1.1.0.tgz_1485367981156_0.06349746254272759"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/inquire@^1.1.0",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2finquire",
+    "name": "@protobufjs/inquire",
+    "rawSpec": "^1.1.0",
+    "spec": ">=1.1.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/@protobufjs/fetch",
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
+  "_shasum": "ff200e3e7cf2429e2dcafc1140828e8cc638f089",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/inquire@^1.1.0",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "Requires a module only if available and hides the require call from bundlers.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "ff200e3e7cf2429e2dcafc1140828e8cc638f089",
+    "tarball": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode+npm@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/inquire",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/array.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/array.js
new file mode 100644 (file)
index 0000000..96627c3
--- /dev/null
@@ -0,0 +1 @@
+module.exports = [1];\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/emptyArray.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/emptyArray.js
new file mode 100644 (file)
index 0000000..0630c8f
--- /dev/null
@@ -0,0 +1 @@
+module.exports = [];\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/emptyObject.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/emptyObject.js
new file mode 100644 (file)
index 0000000..0369aa4
--- /dev/null
@@ -0,0 +1 @@
+module.exports = {};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/object.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/data/object.js
new file mode 100644 (file)
index 0000000..3226d44
--- /dev/null
@@ -0,0 +1 @@
+module.exports = { a: 1 };\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/inquire/tests/index.js
new file mode 100644 (file)
index 0000000..7d6496f
--- /dev/null
@@ -0,0 +1,20 @@
+var tape = require("tape");\r
+\r
+var inquire = require("..");\r
+\r
+tape.test("inquire", function(test) {\r
+\r
+    test.equal(inquire("buffer").Buffer, Buffer, "should be able to require \"buffer\"");\r
+\r
+    test.equal(inquire("%invalid"), null, "should not be able to require \"%invalid\"");\r
+\r
+    test.equal(inquire("./tests/data/emptyObject"), null, "should return null when requiring a module exporting an empty object");\r
+\r
+    test.equal(inquire("./tests/data/emptyArray"), null, "should return null when requiring a module exporting an empty array");\r
+\r
+    test.same(inquire("./tests/data/object"), { a: 1 }, "should return the object if a non-empty object");\r
+\r
+    test.same(inquire("./tests/data/array"), [ 1 ], "should return the module if a non-empty array");\r
+\r
+    test.end();\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/README.md
new file mode 100644 (file)
index 0000000..0e8e6bc
--- /dev/null
@@ -0,0 +1,19 @@
+@protobufjs/path\r
+================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/path.svg)](https://www.npmjs.com/package/@protobufjs/path)\r
+\r
+A minimal path module to resolve Unix, Windows and URL paths alike.\r
+\r
+API\r
+---\r
+\r
+* **path.isAbsolute(path: `string`): `boolean`**<br />\r
+  Tests if the specified path is absolute.\r
+\r
+* **path.normalize(path: `string`): `string`**<br />\r
+  Normalizes the specified path.\r
+\r
+* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**<br />\r
+  Resolves the specified include path against the specified origin path.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/index.d.ts
new file mode 100644 (file)
index 0000000..567c3dc
--- /dev/null
@@ -0,0 +1,22 @@
+/**\r
+ * Tests if the specified path is absolute.\r
+ * @param {string} path Path to test\r
+ * @returns {boolean} `true` if path is absolute\r
+ */\r
+export function isAbsolute(path: string): boolean;\r
+\r
+/**\r
+ * Normalizes the specified path.\r
+ * @param {string} path Path to normalize\r
+ * @returns {string} Normalized path\r
+ */\r
+export function normalize(path: string): string;\r
+\r
+/**\r
+ * Resolves the specified include path against the specified origin path.\r
+ * @param {string} originPath Path to the origin file\r
+ * @param {string} includePath Include path relative to origin path\r
+ * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r
+ * @returns {string} Path to the include file\r
+ */\r
+export function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/index.js
new file mode 100644 (file)
index 0000000..1ea7b17
--- /dev/null
@@ -0,0 +1,65 @@
+"use strict";\r
+\r
+/**\r
+ * A minimal path module to resolve Unix, Windows and URL paths alike.\r
+ * @memberof util\r
+ * @namespace\r
+ */\r
+var path = exports;\r
+\r
+var isAbsolute =\r
+/**\r
+ * Tests if the specified path is absolute.\r
+ * @param {string} path Path to test\r
+ * @returns {boolean} `true` if path is absolute\r
+ */\r
+path.isAbsolute = function isAbsolute(path) {\r
+    return /^(?:\/|\w+:)/.test(path);\r
+};\r
+\r
+var normalize =\r
+/**\r
+ * Normalizes the specified path.\r
+ * @param {string} path Path to normalize\r
+ * @returns {string} Normalized path\r
+ */\r
+path.normalize = function normalize(path) {\r
+    path = path.replace(/\\/g, "/")\r
+               .replace(/\/{2,}/g, "/");\r
+    var parts    = path.split("/"),\r
+        absolute = isAbsolute(path),\r
+        prefix   = "";\r
+    if (absolute)\r
+        prefix = parts.shift() + "/";\r
+    for (var i = 0; i < parts.length;) {\r
+        if (parts[i] === "..") {\r
+            if (i > 0 && parts[i - 1] !== "..")\r
+                parts.splice(--i, 2);\r
+            else if (absolute)\r
+                parts.splice(i, 1);\r
+            else\r
+                ++i;\r
+        } else if (parts[i] === ".")\r
+            parts.splice(i, 1);\r
+        else\r
+            ++i;\r
+    }\r
+    return prefix + parts.join("/");\r
+};\r
+\r
+/**\r
+ * Resolves the specified include path against the specified origin path.\r
+ * @param {string} originPath Path to the origin file\r
+ * @param {string} includePath Include path relative to origin path\r
+ * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\r
+ * @returns {string} Path to the include file\r
+ */\r
+path.resolve = function resolve(originPath, includePath, alreadyNormalized) {\r
+    if (!alreadyNormalized)\r
+        includePath = normalize(includePath);\r
+    if (isAbsolute(includePath))\r
+        return includePath;\r
+    if (!alreadyNormalized)\r
+        originPath = normalize(originPath);\r
+    return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/package.json
new file mode 100644 (file)
index 0000000..a699e67
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/path@^1.1.2",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2fpath",
+        "name": "@protobufjs/path",
+        "rawSpec": "^1.1.2",
+        "spec": ">=1.1.2 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/path@>=1.1.2 <2.0.0",
+  "_id": "@protobufjs/path@1.1.2",
+  "_inCache": true,
+  "_location": "/@protobufjs/path",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/path-1.1.2.tgz_1487868856921_0.727851988747716"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/path@^1.1.2",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2fpath",
+    "name": "@protobufjs/path",
+    "rawSpec": "^1.1.2",
+    "spec": ">=1.1.2 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+  "_shasum": "6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/path@^1.1.2",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "A minimal path module to resolve Unix, Windows and URL paths alike.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d",
+    "tarball": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode+npm@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/path",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.2"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/path/tests/index.js
new file mode 100644 (file)
index 0000000..927736e
--- /dev/null
@@ -0,0 +1,60 @@
+var tape = require("tape");\r
+\r
+var path = require("..");\r
+\r
+tape.test("path", function(test) {\r
+\r
+    test.ok(path.isAbsolute("X:\\some\\path\\file.js"), "should identify absolute windows paths");\r
+    test.ok(path.isAbsolute("/some/path/file.js"), "should identify absolute unix paths");\r
+\r
+    test.notOk(path.isAbsolute("some\\path\\file.js"), "should identify relative windows paths");\r
+    test.notOk(path.isAbsolute("some/path/file.js"), "should identify relative unix paths");\r
+\r
+    var paths = [\r
+        {\r
+            actual: "X:\\some\\..\\.\\path\\\\file.js",\r
+            normal: "X:/path/file.js",\r
+            resolve: {\r
+                origin: "X:/path/origin.js",\r
+                expected: "X:/path/file.js"\r
+            }\r
+        }, {\r
+            actual: "some\\..\\.\\path\\\\file.js",\r
+            normal: "path/file.js",\r
+            resolve: {\r
+                origin: "X:/path/origin.js",\r
+                expected: "X:/path/path/file.js"\r
+            }\r
+        }, {\r
+            actual: "/some/.././path//file.js",\r
+            normal: "/path/file.js",\r
+            resolve: {\r
+                origin: "/path/origin.js",\r
+                expected: "/path/file.js"\r
+            }\r
+        }, {\r
+            actual: "some/.././path//file.js",\r
+            normal: "path/file.js",\r
+            resolve: {\r
+                origin: "",\r
+                expected: "path/file.js"\r
+            }\r
+        }, {\r
+            actual: ".././path//file.js",\r
+            normal: "../path/file.js"\r
+        }, {\r
+            actual: "/.././path//file.js",\r
+            normal: "/path/file.js"\r
+        }\r
+    ];\r
+\r
+    paths.forEach(function(p) {\r
+        test.equal(path.normalize(p.actual), p.normal, "should normalize " + p.actual);\r
+        if (p.resolve) {\r
+            test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, "should resolve " + p.actual);\r
+            test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, "should resolve " + p.normal + " (already normalized)");\r
+        }\r
+    });\r
+\r
+    test.end();\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/README.md
new file mode 100644 (file)
index 0000000..3955ae0
--- /dev/null
@@ -0,0 +1,13 @@
+@protobufjs/pool\r
+================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/pool.svg)](https://www.npmjs.com/package/@protobufjs/pool)\r
+\r
+A general purpose buffer pool.\r
+\r
+API\r
+---\r
+\r
+* **pool(alloc: `function(size: number): Uint8Array`, slice: `function(this: Uint8Array, start: number, end: number): Uint8Array`, [size=8192: `number`]): `function(size: number): Uint8Array`**<br />\r
+  Creates a pooled allocator.\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/index.d.ts
new file mode 100644 (file)
index 0000000..465559c
--- /dev/null
@@ -0,0 +1,32 @@
+export = pool;\r
+\r
+/**\r
+ * An allocator as used by {@link util.pool}.\r
+ * @typedef PoolAllocator\r
+ * @type {function}\r
+ * @param {number} size Buffer size\r
+ * @returns {Uint8Array} Buffer\r
+ */\r
+type PoolAllocator = (size: number) => Uint8Array;\r
+\r
+/**\r
+ * A slicer as used by {@link util.pool}.\r
+ * @typedef PoolSlicer\r
+ * @type {function}\r
+ * @param {number} start Start offset\r
+ * @param {number} end End offset\r
+ * @returns {Uint8Array} Buffer slice\r
+ * @this {Uint8Array}\r
+ */\r
+type PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;\r
+\r
+/**\r
+ * A general purpose buffer pool.\r
+ * @memberof util\r
+ * @function\r
+ * @param {PoolAllocator} alloc Allocator\r
+ * @param {PoolSlicer} slice Slicer\r
+ * @param {number} [size=8192] Slab size\r
+ * @returns {PoolAllocator} Pooled allocator\r
+ */\r
+declare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/index.js
new file mode 100644 (file)
index 0000000..9556f5a
--- /dev/null
@@ -0,0 +1,48 @@
+"use strict";\r
+module.exports = pool;\r
+\r
+/**\r
+ * An allocator as used by {@link util.pool}.\r
+ * @typedef PoolAllocator\r
+ * @type {function}\r
+ * @param {number} size Buffer size\r
+ * @returns {Uint8Array} Buffer\r
+ */\r
+\r
+/**\r
+ * A slicer as used by {@link util.pool}.\r
+ * @typedef PoolSlicer\r
+ * @type {function}\r
+ * @param {number} start Start offset\r
+ * @param {number} end End offset\r
+ * @returns {Uint8Array} Buffer slice\r
+ * @this {Uint8Array}\r
+ */\r
+\r
+/**\r
+ * A general purpose buffer pool.\r
+ * @memberof util\r
+ * @function\r
+ * @param {PoolAllocator} alloc Allocator\r
+ * @param {PoolSlicer} slice Slicer\r
+ * @param {number} [size=8192] Slab size\r
+ * @returns {PoolAllocator} Pooled allocator\r
+ */\r
+function pool(alloc, slice, size) {\r
+    var SIZE   = size || 8192;\r
+    var MAX    = SIZE >>> 1;\r
+    var slab   = null;\r
+    var offset = SIZE;\r
+    return function pool_alloc(size) {\r
+        if (size < 1 || size > MAX)\r
+            return alloc(size);\r
+        if (offset + size > SIZE) {\r
+            slab = alloc(SIZE);\r
+            offset = 0;\r
+        }\r
+        var buf = slice.call(slab, offset, offset += size);\r
+        if (offset & 7) // align to 32 bit\r
+            offset = (offset | 7) + 1;\r
+        return buf;\r
+    };\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/package.json
new file mode 100644 (file)
index 0000000..119d282
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/pool@^1.1.0",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2fpool",
+        "name": "@protobufjs/pool",
+        "rawSpec": "^1.1.0",
+        "spec": ">=1.1.0 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/pool@>=1.1.0 <2.0.0",
+  "_id": "@protobufjs/pool@1.1.0",
+  "_inCache": true,
+  "_location": "/@protobufjs/pool",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/pool-1.1.0.tgz_1485367998862_0.3938121625687927"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/pool@^1.1.0",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2fpool",
+    "name": "@protobufjs/pool",
+    "rawSpec": "^1.1.0",
+    "spec": ">=1.1.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+  "_shasum": "09fd15f2d6d3abfa9b65bc366506d6ad7846ff54",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/pool@^1.1.0",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "A general purpose buffer pool.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "09fd15f2d6d3abfa9b65bc366506d6ad7846ff54",
+    "tarball": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+npm-protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/pool",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/pool/tests/index.js
new file mode 100644 (file)
index 0000000..dc488b8
--- /dev/null
@@ -0,0 +1,33 @@
+var tape = require("tape");\r
+\r
+var pool = require("..");\r
+\r
+if (typeof Uint8Array !== "undefined")\r
+tape.test("pool", function(test) {\r
+\r
+    var alloc = pool(function(size) { return new Uint8Array(size); }, Uint8Array.prototype.subarray);\r
+\r
+    var buf1 = alloc(0);\r
+    test.equal(buf1.length, 0, "should allocate a buffer of size 0");\r
+\r
+    var buf2 = alloc(1);\r
+    test.equal(buf2.length, 1, "should allocate a buffer of size 1 (initializes slab)");\r
+\r
+    test.notEqual(buf2.buffer, buf1.buffer, "should not reference the same backing buffer if previous buffer had size 0");\r
+    test.equal(buf2.byteOffset, 0, "should allocate at byteOffset 0 when using a new slab");\r
+\r
+    buf1 = alloc(1);\r
+    test.equal(buf1.buffer, buf2.buffer, "should reference the same backing buffer when allocating a chunk fitting into the slab");\r
+    test.equal(buf1.byteOffset, 8, "should align slices to 32 bit and this allocate at byteOffset 8");\r
+\r
+    var buf3 = alloc(4097);\r
+    test.notEqual(buf3.buffer, buf2.buffer, "should not reference the same backing buffer when allocating a buffer larger than half the backing buffer's size");\r
+\r
+    buf2 = alloc(4096);\r
+    test.equal(buf2.buffer, buf1.buffer, "should reference the same backing buffer when allocating a buffer smaller or equal than half the backing buffer's size");\r
+\r
+    buf1 = alloc(4096);\r
+    test.notEqual(buf1.buffer, buf2.buffer, "should not reference the same backing buffer when the slab is exhausted (initializes new slab)");\r
+\r
+    test.end();\r
+});
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/LICENSE b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/LICENSE
new file mode 100644 (file)
index 0000000..2a2d560
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2016, Daniel Wirtz  All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are\r
+met:\r
+\r
+* Redistributions of source code must retain the above copyright\r
+  notice, this list of conditions and the following disclaimer.\r
+* Redistributions in binary form must reproduce the above copyright\r
+  notice, this list of conditions and the following disclaimer in the\r
+  documentation and/or other materials provided with the distribution.\r
+* Neither the name of its author, nor the names of its contributors\r
+  may be used to endorse or promote products derived from this software\r
+  without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/README.md b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/README.md
new file mode 100644 (file)
index 0000000..3696289
--- /dev/null
@@ -0,0 +1,20 @@
+@protobufjs/utf8\r
+================\r
+[![npm](https://img.shields.io/npm/v/@protobufjs/utf8.svg)](https://www.npmjs.com/package/@protobufjs/utf8)\r
+\r
+A minimal UTF8 implementation for number arrays.\r
+\r
+API\r
+---\r
+\r
+* **utf8.length(string: `string`): `number`**<br />\r
+  Calculates the UTF8 byte length of a string.\r
+\r
+* **utf8.read(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />\r
+  Reads UTF8 bytes as a string.\r
+\r
+* **utf8.write(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />\r
+  Writes a string as UTF8 bytes.\r
+\r
+\r
+**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/index.d.ts b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/index.d.ts
new file mode 100644 (file)
index 0000000..010888c
--- /dev/null
@@ -0,0 +1,24 @@
+/**\r
+ * Calculates the UTF8 byte length of a string.\r
+ * @param {string} string String\r
+ * @returns {number} Byte length\r
+ */\r
+export function length(string: string): number;\r
+\r
+/**\r
+ * Reads UTF8 bytes as a string.\r
+ * @param {Uint8Array} buffer Source buffer\r
+ * @param {number} start Source start\r
+ * @param {number} end Source end\r
+ * @returns {string} String read\r
+ */\r
+export function read(buffer: Uint8Array, start: number, end: number): string;\r
+\r
+/**\r
+ * Writes a string as UTF8 bytes.\r
+ * @param {string} string Source string\r
+ * @param {Uint8Array} buffer Destination buffer\r
+ * @param {number} offset Destination offset\r
+ * @returns {number} Bytes written\r
+ */\r
+export function write(string: string, buffer: Uint8Array, offset: number): number;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/index.js
new file mode 100644 (file)
index 0000000..e4ff8df
--- /dev/null
@@ -0,0 +1,105 @@
+"use strict";\r
+\r
+/**\r
+ * A minimal UTF8 implementation for number arrays.\r
+ * @memberof util\r
+ * @namespace\r
+ */\r
+var utf8 = exports;\r
+\r
+/**\r
+ * Calculates the UTF8 byte length of a string.\r
+ * @param {string} string String\r
+ * @returns {number} Byte length\r
+ */\r
+utf8.length = function utf8_length(string) {\r
+    var len = 0,\r
+        c = 0;\r
+    for (var i = 0; i < string.length; ++i) {\r
+        c = string.charCodeAt(i);\r
+        if (c < 128)\r
+            len += 1;\r
+        else if (c < 2048)\r
+            len += 2;\r
+        else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\r
+            ++i;\r
+            len += 4;\r
+        } else\r
+            len += 3;\r
+    }\r
+    return len;\r
+};\r
+\r
+/**\r
+ * Reads UTF8 bytes as a string.\r
+ * @param {Uint8Array} buffer Source buffer\r
+ * @param {number} start Source start\r
+ * @param {number} end Source end\r
+ * @returns {string} String read\r
+ */\r
+utf8.read = function utf8_read(buffer, start, end) {\r
+    var len = end - start;\r
+    if (len < 1)\r
+        return "";\r
+    var parts = null,\r
+        chunk = [],\r
+        i = 0, // char offset\r
+        t;     // temporary\r
+    while (start < end) {\r
+        t = buffer[start++];\r
+        if (t < 128)\r
+            chunk[i++] = t;\r
+        else if (t > 191 && t < 224)\r
+            chunk[i++] = (t & 31) << 6 | buffer[start++] & 63;\r
+        else if (t > 239 && t < 365) {\r
+            t = ((t & 7) << 18 | (buffer[start++] & 63) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63) - 0x10000;\r
+            chunk[i++] = 0xD800 + (t >> 10);\r
+            chunk[i++] = 0xDC00 + (t & 1023);\r
+        } else\r
+            chunk[i++] = (t & 15) << 12 | (buffer[start++] & 63) << 6 | buffer[start++] & 63;\r
+        if (i > 8191) {\r
+            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\r
+            i = 0;\r
+        }\r
+    }\r
+    if (parts) {\r
+        if (i)\r
+            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\r
+        return parts.join("");\r
+    }\r
+    return String.fromCharCode.apply(String, chunk.slice(0, i));\r
+};\r
+\r
+/**\r
+ * Writes a string as UTF8 bytes.\r
+ * @param {string} string Source string\r
+ * @param {Uint8Array} buffer Destination buffer\r
+ * @param {number} offset Destination offset\r
+ * @returns {number} Bytes written\r
+ */\r
+utf8.write = function utf8_write(string, buffer, offset) {\r
+    var start = offset,\r
+        c1, // character 1\r
+        c2; // character 2\r
+    for (var i = 0; i < string.length; ++i) {\r
+        c1 = string.charCodeAt(i);\r
+        if (c1 < 128) {\r
+            buffer[offset++] = c1;\r
+        } else if (c1 < 2048) {\r
+            buffer[offset++] = c1 >> 6       | 192;\r
+            buffer[offset++] = c1       & 63 | 128;\r
+        } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\r
+            c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\r
+            ++i;\r
+            buffer[offset++] = c1 >> 18      | 240;\r
+            buffer[offset++] = c1 >> 12 & 63 | 128;\r
+            buffer[offset++] = c1 >> 6  & 63 | 128;\r
+            buffer[offset++] = c1       & 63 | 128;\r
+        } else {\r
+            buffer[offset++] = c1 >> 12      | 224;\r
+            buffer[offset++] = c1 >> 6  & 63 | 128;\r
+            buffer[offset++] = c1       & 63 | 128;\r
+        }\r
+    }\r
+    return offset - start;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/package.json b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/package.json
new file mode 100644 (file)
index 0000000..916a7c6
--- /dev/null
@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@protobufjs/utf8@^1.1.0",
+        "scope": "@protobufjs",
+        "escapedName": "@protobufjs%2futf8",
+        "name": "@protobufjs/utf8",
+        "rawSpec": "^1.1.0",
+        "spec": ">=1.1.0 <2.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@protobufjs/utf8@>=1.1.0 <2.0.0",
+  "_id": "@protobufjs/utf8@1.1.0",
+  "_inCache": true,
+  "_location": "/@protobufjs/utf8",
+  "_nodeVersion": "6.9.1",
+  "_npmOperationalInternal": {
+    "host": "packages-18-east.internal.npmjs.com",
+    "tmp": "tmp/utf8-1.1.0.tgz_1485368134514_0.7150300552602857"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "4.0.5",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@protobufjs/utf8@^1.1.0",
+    "scope": "@protobufjs",
+    "escapedName": "@protobufjs%2futf8",
+    "name": "@protobufjs/utf8",
+    "rawSpec": "^1.1.0",
+    "spec": ">=1.1.0 <2.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
+  "_shasum": "a777360b5b39a1a2e5106f8e858f2fd2d060c570",
+  "_shrinkwrap": null,
+  "_spec": "@protobufjs/utf8@^1.1.0",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode+protobufjs@dcode.io"
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "dependencies": {},
+  "description": "A minimal UTF8 implementation for number arrays.",
+  "devDependencies": {
+    "istanbul": "^0.4.5",
+    "tape": "^4.6.3"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "a777360b5b39a1a2e5106f8e858f2fd2d060c570",
+    "tarball": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz"
+  },
+  "homepage": "https://github.com/dcodeIO/protobuf.js#readme",
+  "license": "BSD-3-Clause",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    },
+    {
+      "name": "protobufjs",
+      "email": "dcode+npm-protobufjs@dcode.io"
+    }
+  ],
+  "name": "@protobufjs/utf8",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover node_modules/tape/bin/tape tests/*.js",
+    "test": "tape tests/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/tests/data/utf8.txt b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/tests/data/utf8.txt
new file mode 100644 (file)
index 0000000..580b4c4
--- /dev/null
@@ -0,0 +1,216 @@
+UTF-8 encoded sample plain-text file
+‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
+
+Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
+
+
+The ASCII compatible UTF-8 encoding used in this plain-text file
+is defined in Unicode, ISO 10646-1, and RFC 2279.
+
+
+Using Unicode/UTF-8, you can write in emails and source code things such as
+
+Mathematics and sciences:
+
+  ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),      ⎧⎡⎛┌─────┐⎞⎤⎫
+                                            ⎪⎢⎜│a²+b³ ⎟⎥⎪
+  ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),    ⎪⎢⎜│───── ⎟⎥⎪
+                                            ⎪⎢⎜⎷ c₈   ⎟⎥⎪
+  ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ,                   ⎨⎢⎜       ⎟⎥⎬
+                                            ⎪⎢⎜ ∞     ⎟⎥⎪
+  ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫),      ⎪⎢⎜ ⎲     ⎟⎥⎪
+                                            ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪
+  2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm     ⎩⎣⎝i=1    ⎠⎦⎭
+
+Linguistics and dictionaries:
+
+  ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn
+  Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]
+
+APL:
+
+  ((V⍳V)=⍳⍴V)/V←,V    ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈
+
+Nicer typography in plain text files:
+
+  ╔══════════════════════════════════════════╗
+  ║                                          ║
+  ║   • ‘single’ and “double” quotes         ║
+  ║                                          ║
+  ║   • Curly apostrophes: “We’ve been here” ║
+  ║                                          ║
+  ║   • Latin-1 apostrophe and accents: '´`  ║
+  ║                                          ║
+  ║   • ‚deutsche‘ „Anführungszeichen“       ║
+  ║                                          ║
+  ║   • †, ‡, ‰, •, 3–4, —, −5/+5, ™, …      ║
+  ║                                          ║
+  ║   • ASCII safety test: 1lI|, 0OD, 8B     ║
+  ║                      ╭─────────╮         ║
+  ║   • the euro symbol: │ 14.95 € │         ║
+  ║                      ╰─────────╯         ║
+  ╚══════════════════════════════════════════╝
+
+Combining characters:
+
+  STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑
+
+Greek (in Polytonic):
+
+  The Greek anthem:
+
+  Σὲ γνωρίζω ἀπὸ τὴν κόψη
+  τοῦ σπαθιοῦ τὴν τρομερή,
+  σὲ γνωρίζω ἀπὸ τὴν ὄψη
+  ποὺ μὲ βία μετράει τὴ γῆ.
+
+  ᾿Απ᾿ τὰ κόκκαλα βγαλμένη
+  τῶν ῾Ελλήνων τὰ ἱερά
+  καὶ σὰν πρῶτα ἀνδρειωμένη
+  χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!
+
+  From a speech of Demosthenes in the 4th century BC:
+
+  Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,
+  ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς
+  λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ
+  τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿
+  εἰς τοῦτο προήκοντα,  ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ
+  πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν
+  οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,
+  οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν
+  ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον
+  τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι
+  γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν
+  προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους
+  σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ
+  τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ
+  τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς
+  τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.
+
+  Δημοσθένους, Γ´ ᾿Ολυνθιακὸς
+
+Georgian:
+
+  From a Unicode conference invitation:
+
+  გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
+  კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,
+  ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს
+  ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,
+  ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება
+  ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,
+  ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.
+
+Russian:
+
+  From a Unicode conference invitation:
+
+  Зарегистрируйтесь сейчас на Десятую Международную Конференцию по
+  Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.
+  Конференция соберет широкий круг экспертов по  вопросам глобального
+  Интернета и Unicode, локализации и интернационализации, воплощению и
+  применению Unicode в различных операционных системах и программных
+  приложениях, шрифтах, верстке и многоязычных компьютерных системах.
+
+Thai (UCS Level 2):
+
+  Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese
+  classic 'San Gua'):
+
+  [----------------------------|------------------------]
+    ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช  พระปกเกศกองบู๊กู้ขึ้นใหม่
+  สิบสองกษัตริย์ก่อนหน้าแลถัดไป       สององค์ไซร้โง่เขลาเบาปัญญา
+    ทรงนับถือขันทีเป็นที่พึ่ง           บ้านเมืองจึงวิปริตเป็นนักหนา
+  โฮจิ๋นเรียกทัพทั่วหัวเมืองมา         หมายจะฆ่ามดชั่วตัวสำคัญ
+    เหมือนขับไสไล่เสือจากเคหา      รับหมาป่าเข้ามาเลยอาสัญ
+  ฝ่ายอ้องอุ้นยุแยกให้แตกกัน          ใช้สาวนั้นเป็นชนวนชื่นชวนใจ
+    พลันลิฉุยกุยกีกลับก่อเหตุ          ช่างอาเพศจริงหนาฟ้าร้องไห้
+  ต้องรบราฆ่าฟันจนบรรลัย           ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ
+
+  (The above is a two-column text. If combining characters are handled
+  correctly, the lines of the second column should be aligned with the
+  | character above.)
+
+Ethiopian:
+
+  Proverbs in the Amharic language:
+
+  ሰማይ አይታረስ ንጉሥ አይከሰስ።
+  ብላ ካለኝ እንደአባቴ በቆመጠኝ።
+  ጌጥ ያለቤቱ ቁምጥና ነው።
+  ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።
+  የአፍ ወለምታ በቅቤ አይታሽም።
+  አይጥ በበላ ዳዋ ተመታ።
+  ሲተረጉሙ ይደረግሙ።
+  ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።
+  ድር ቢያብር አንበሳ ያስር።
+  ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።
+  እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።
+  የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።
+  ሥራ ከመፍታት ልጄን ላፋታት።
+  ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።
+  የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።
+  ተንጋሎ ቢተፉ ተመልሶ ባፉ።
+  ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።
+  እግርህን በፍራሽህ ልክ ዘርጋ።
+
+Runes:
+
+  ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ
+
+  (Old English, which transcribed into Latin reads 'He cwaeth that he
+  bude thaem lande northweardum with tha Westsae.' and means 'He said
+  that he lived in the northern land near the Western Sea.')
+
+Braille:
+
+  ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌
+
+  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞
+  ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎
+  ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂
+  ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙
+  ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑
+  ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲
+
+  ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
+
+  ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹
+  ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞
+  ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕
+  ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹
+  ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎
+  ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎
+  ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳
+  ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞
+  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲
+
+  (The first couple of paragraphs of "A Christmas Carol" by Dickens)
+
+Compact font selection example text:
+
+  ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789
+  abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ
+  –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд
+  ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂӥẄɐː⍎אԱა
+
+Greetings in various languages:
+
+  Hello world, Καλημέρα κόσμε, コンニチハ
+
+Box drawing alignment tests:                                          █
+                                                                      ▉
+  ╔══╦══╗  ┌──┬──┐  ╭──┬──╮  ╭──┬──╮  ┏━━┳━━┓  ┎┒┏┑   ╷  ╻ ┏┯┓ ┌┰┐    ▊ ╱╲╱╲╳╳╳
+  ║┌─╨─┐║  │╔═╧═╗│  │╒═╪═╕│  │╓─╁─╖│  ┃┌─╂─┐┃  ┗╃╄┙  ╶┼╴╺╋╸┠┼┨ ┝╋┥    ▋ ╲╱╲╱╳╳╳
+  ║│╲ ╱│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╿ │┃  ┍╅╆┓   ╵  ╹ ┗┷┛ └┸┘    ▌ ╱╲╱╲╳╳╳
+  ╠╡ ╳ ╞╣  ├╢   ╟┤  ├┼─┼─┼┤  ├╫─╂─╫┤  ┣┿╾┼╼┿┫  ┕┛┖┚     ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳
+  ║│╱ ╲│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╽ │┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▎
+  ║└─╥─┘║  │╚═╤═╝│  │╘═╪═╛│  │╙─╀─╜│  ┃└─╂─┘┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▏
+  ╚══╩══╝  └──┴──┘  ╰──┴──╯  ╰──┴──╯  ┗━━┻━━┛  ▗▄▖▛▀▜   └╌╌┘ ╎ ┗╍╍┛ ┋  ▁▂▃▄▅▆▇█
+                                               ▝▀▘▙▄▟
+
+Surrogates:
+
+𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 𠻗 𠻹 𠻺 𠼭 𠼮 𠽌 𠾴 𠾼 𠿪 𡁜 𡁯 𡁵 𡁶 𡁻 𡃁
+𡃉 𡇙 𢃇 𢞵 𢫕 𢭃 𢯊 𢱑 𢱕 𢳂 𢴈 𢵌 𢵧 𢺳 𣲷 𤓓 𤶸 𤷪 𥄫 𦉘 𦟌 𦧲 𦧺 𧨾 𨅝 𨈇 𨋢 𨳊 𨳍 𨳒 𩶘
diff --git a/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/tests/index.js b/legacy-libs/grpc-cloned/node_modules/@protobufjs/utf8/tests/index.js
new file mode 100644 (file)
index 0000000..222cd8a
--- /dev/null
@@ -0,0 +1,57 @@
+var tape = require("tape");\r
+\r
+var utf8 = require("..");\r
+\r
+var data = require("fs").readFileSync(require.resolve("./data/utf8.txt")),\r
+    dataStr = data.toString("utf8");\r
+\r
+tape.test("utf8", function(test) {\r
+\r
+    test.test(test.name + " - length", function(test) {\r
+        test.equal(utf8.length(""), 0, "should return a byte length of zero for an empty string");\r
+\r
+        test.equal(utf8.length(dataStr), Buffer.byteLength(dataStr), "should return the same byte length as node buffers");\r
+\r
+        test.end();\r
+    });\r
+\r
+    test.test(test.name + " - read", function(test) {\r
+        var comp = utf8.read([], 0, 0);\r
+        test.equal(comp, "", "should decode an empty buffer to an empty string");\r
+\r
+        comp = utf8.read(data, 0, data.length);\r
+        test.equal(comp, data.toString("utf8"), "should decode to the same byte data as node buffers");\r
+\r
+        var longData = Buffer.concat([data, data, data, data]);\r
+        comp = utf8.read(longData, 0, longData.length);\r
+        test.equal(comp, longData.toString("utf8"), "should decode to the same byte data as node buffers (long)");\r
+\r
+        var chunkData = new Buffer(data.toString("utf8").substring(0, 8192));\r
+        comp = utf8.read(chunkData, 0, chunkData.length);\r
+        test.equal(comp, chunkData.toString("utf8"), "should decode to the same byte data as node buffers (chunk size)");\r
+\r
+        test.end();\r
+    });\r
+\r
+    test.test(test.name + " - write", function(test) {\r
+        var buf = new Buffer(0);\r
+        test.equal(utf8.write("", buf, 0), 0, "should encode an empty string to an empty buffer");\r
+\r
+        var len = utf8.length(dataStr);\r
+        buf = new Buffer(len);\r
+        test.equal(utf8.write(dataStr, buf, 0), len, "should encode to exactly " + len + " bytes");\r
+\r
+        test.equal(buf.length, data.length, "should encode to a buffer length equal to that of node buffers");\r
+\r
+        for (var i = 0; i < buf.length; ++i) {\r
+            if (buf[i] !== data[i]) {\r
+                test.fail("should encode to the same buffer data as node buffers (offset " + i + ")");\r
+                return;\r
+            }\r
+        }\r
+        test.pass("should encode to the same buffer data as node buffers");\r
+\r
+        test.end();\r
+    });\r
+\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/@types/babel-types/LICENSE b/legacy-libs/grpc-cloned/node_modules/@types/babel-types/LICENSE
new file mode 100644 (file)
index 0000000..2107107
--- /dev/null
@@ -0,0 +1,21 @@
+    MIT License
+
+    Copyright (c) Microsoft Corporation. All rights reserved.
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in all
+    copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+    SOFTWARE
diff --git a/legacy-libs/grpc-cloned/node_modules/@types/babel-types/README.md b/legacy-libs/grpc-cloned/node_modules/@types/babel-types/README.md
new file mode 100644 (file)
index 0000000..1aea8bc
--- /dev/null
@@ -0,0 +1,16 @@
+# Installation\r
+> `npm install --save @types/babel-types`\r
+\r
+# Summary\r
+This package contains type definitions for babel-types (https://github.com/babel/babel/tree/master/packages/babel-types).\r
+\r
+# Details\r
+Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-types\r
+\r
+Additional Details\r
+ * Last updated: Mon, 26 Feb 2018 19:08:08 GMT\r
+ * Dependencies: none\r
+ * Global values: none\r
+\r
+# Credits\r
+These definitions were written by Troy Gerwien <https://github.com/yortus>, Sam Baxter <https://github.com/baxtersa>, Marvin Hagemeister <https://github.com/marvinhagemeister>, Boris Cherny <https://github.com/bcherny>.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/camelcase/index.js b/legacy-libs/grpc-cloned/node_modules/camelcase/index.js
new file mode 100644 (file)
index 0000000..929facb
--- /dev/null
@@ -0,0 +1,56 @@
+'use strict';
+
+function preserveCamelCase(str) {
+       var isLastCharLower = false;
+
+       for (var i = 0; i < str.length; i++) {
+               var c = str.charAt(i);
+
+               if (isLastCharLower && (/[a-zA-Z]/).test(c) && c.toUpperCase() === c) {
+                       str = str.substr(0, i) + '-' + str.substr(i);
+                       isLastCharLower = false;
+                       i++;
+               } else {
+                       isLastCharLower = (c.toLowerCase() === c);
+               }
+       }
+
+       return str;
+}
+
+module.exports = function () {
+       var str = [].map.call(arguments, function (str) {
+               return str.trim();
+       }).filter(function (str) {
+               return str.length;
+       }).join('-');
+
+       if (!str.length) {
+               return '';
+       }
+
+       if (str.length === 1) {
+               return str;
+       }
+
+       if (!(/[_.\- ]+/).test(str)) {
+               if (str === str.toUpperCase()) {
+                       return str.toLowerCase();
+               }
+
+               if (str[0] !== str[0].toLowerCase()) {
+                       return str[0].toLowerCase() + str.slice(1);
+               }
+
+               return str;
+       }
+
+       str = preserveCamelCase(str);
+
+       return str
+       .replace(/^[_.\- ]+/, '')
+       .toLowerCase()
+       .replace(/[_.\- ]+(\w|$)/g, function (m, p1) {
+               return p1.toUpperCase();
+       });
+};
diff --git a/legacy-libs/grpc-cloned/node_modules/camelcase/license b/legacy-libs/grpc-cloned/node_modules/camelcase/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc-cloned/node_modules/camelcase/package.json b/legacy-libs/grpc-cloned/node_modules/camelcase/package.json
new file mode 100644 (file)
index 0000000..2558bd6
--- /dev/null
@@ -0,0 +1,107 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "camelcase@^2.0.1",
+        "scope": null,
+        "escapedName": "camelcase",
+        "name": "camelcase",
+        "rawSpec": "^2.0.1",
+        "spec": ">=2.0.1 <3.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/grpc/node_modules/yargs"
+    ]
+  ],
+  "_from": "camelcase@>=2.0.1 <3.0.0",
+  "_id": "camelcase@2.1.1",
+  "_inCache": true,
+  "_location": "/grpc/camelcase",
+  "_nodeVersion": "4.3.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/camelcase-2.1.1.tgz_1457803836074_0.4515206723008305"
+  },
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "_npmVersion": "2.14.12",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "camelcase@^2.0.1",
+    "scope": null,
+    "escapedName": "camelcase",
+    "name": "camelcase",
+    "rawSpec": "^2.0.1",
+    "spec": ">=2.0.1 <3.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/grpc/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz",
+  "_shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f",
+  "_shrinkwrap": null,
+  "_spec": "camelcase@^2.0.1",
+  "_where": "/var/opt/motion2/node_modules/grpc/node_modules/yargs",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "http://sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/camelcase/issues"
+  },
+  "dependencies": {},
+  "description": "Convert a dash/dot/underscore/space separated string to camelCase: foo-bar → fooBar",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "7c1d16d679a1bbe59ca02cacecfb011e201f5a1f",
+    "tarball": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "35c9c8abce5b9cc9defe534ab25823dc6383180f",
+  "homepage": "https://github.com/sindresorhus/camelcase",
+  "keywords": [
+    "camelcase",
+    "camel-case",
+    "camel",
+    "case",
+    "dash",
+    "hyphen",
+    "dot",
+    "underscore",
+    "separator",
+    "string",
+    "text",
+    "convert"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "name": "camelcase",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/camelcase.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "2.1.1"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/camelcase/readme.md b/legacy-libs/grpc-cloned/node_modules/camelcase/readme.md
new file mode 100644 (file)
index 0000000..080b2a1
--- /dev/null
@@ -0,0 +1,57 @@
+# camelcase [![Build Status](https://travis-ci.org/sindresorhus/camelcase.svg?branch=master)](https://travis-ci.org/sindresorhus/camelcase)
+
+> Convert a dash/dot/underscore/space separated string to camelCase: `foo-bar` → `fooBar`
+
+
+## Install
+
+```
+$ npm install --save camelcase
+```
+
+
+## Usage
+
+```js
+const camelCase = require('camelcase');
+
+camelCase('foo-bar');
+//=> 'fooBar'
+
+camelCase('foo_bar');
+//=> 'fooBar'
+
+camelCase('Foo-Bar');
+//=> 'fooBar'
+
+camelCase('--foo.bar');
+//=> 'fooBar'
+
+camelCase('__foo__bar__');
+//=> 'fooBar'
+
+camelCase('foo bar');
+//=> 'fooBar'
+
+console.log(process.argv[3]);
+//=> '--foo-bar'
+camelCase(process.argv[3]);
+//=> 'fooBar'
+
+camelCase('foo', 'bar');
+//=> 'fooBar'
+
+camelCase('__foo__', '--bar');
+//=> 'fooBar'
+```
+
+
+## Related
+
+- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
+- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/legacy-libs/grpc-cloned/node_modules/cliui/CHANGELOG.md b/legacy-libs/grpc-cloned/node_modules/cliui/CHANGELOG.md
new file mode 100644 (file)
index 0000000..ef6a35e
--- /dev/null
@@ -0,0 +1,15 @@
+# Change Log
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+<a name="3.2.0"></a>
+# [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)
+
+
+### Bug Fixes
+
+* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33))
+
+### Features
+
+* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32))
diff --git a/legacy-libs/grpc-cloned/node_modules/cliui/LICENSE.txt b/legacy-libs/grpc-cloned/node_modules/cliui/LICENSE.txt
new file mode 100644 (file)
index 0000000..c7e2747
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc-cloned/node_modules/cliui/README.md b/legacy-libs/grpc-cloned/node_modules/cliui/README.md
new file mode 100644 (file)
index 0000000..028392c
--- /dev/null
@@ -0,0 +1,110 @@
+# cliui
+
+[![Build Status](https://travis-ci.org/yargs/cliui.svg)](https://travis-ci.org/yargs/cliui)
+[![Coverage Status](https://coveralls.io/repos/yargs/cliui/badge.svg?branch=)](https://coveralls.io/r/yargs/cliui?branch=)
+[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui)
+[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
+
+easily create complex multi-column command-line-interfaces.
+
+## Example
+
+```js
+var ui = require('cliui')({
+  width: 80
+})
+
+ui.div('Usage: $0 [command] [options]')
+
+ui.div({
+  text: 'Options:',
+  padding: [2, 0, 2, 0]
+})
+
+ui.div(
+  {
+    text: "-f, --file",
+    width: 20,
+    padding: [0, 4, 0, 4]
+  },
+  {
+    text: "the file to load." +
+      chalk.green("(if this description is long it wraps).")
+    ,
+    width: 20
+  },
+  {
+    text: chalk.red("[required]"),
+    align: 'right'
+  }
+)
+
+console.log(ui.toString())
+```
+
+<img width="500" src="screenshot.png">
+
+## Layout DSL
+
+cliui exposes a simple layout DSL:
+
+If you create a single `ui.row`, passing a string rather than an
+object:
+
+* `\n`: characters will be interpreted as new rows.
+* `\t`: characters will be interpreted as new columns.
+* `\s`: characters will be interpreted as padding.
+
+**as an example...**
+
+```js
+var ui = require('./')({
+  width: 60
+})
+
+ui.div(
+  'Usage: node ./bin/foo.js\n' +
+  '  <regex>\t  provide a regex\n' +
+  '  <glob>\t  provide a glob\t [required]'
+)
+
+console.log(ui.toString())
+```
+
+**will output:**
+
+```shell
+Usage: node ./bin/foo.js
+  <regex>  provide a regex
+  <glob>   provide a glob          [required]
+```
+
+## Methods
+
+```js
+cliui = require('cliui')
+```
+
+### cliui({width: integer})
+
+Specify the maximum width of the UI being generated.
+
+### cliui({wrap: boolean})
+
+Enable or disable the wrapping of text in a column.
+
+### cliui.div(column, column, column)
+
+Create a row with any number of columns, a column
+can either be a string, or an object with the following
+options:
+
+* **width:** the width of a column.
+* **align:** alignment, `right` or `center`.
+* **padding:** `[top, right, bottom, left]`.
+* **border:** should a border be placed around the div?
+
+### cliui.span(column, column, column)
+
+Similar to `div`, except the next row will be appended without
+a new line being created.
diff --git a/legacy-libs/grpc-cloned/node_modules/cliui/index.js b/legacy-libs/grpc-cloned/node_modules/cliui/index.js
new file mode 100644 (file)
index 0000000..e501e78
--- /dev/null
@@ -0,0 +1,316 @@
+var stringWidth = require('string-width')
+var stripAnsi = require('strip-ansi')
+var wrap = require('wrap-ansi')
+var align = {
+  right: alignRight,
+  center: alignCenter
+}
+var top = 0
+var right = 1
+var bottom = 2
+var left = 3
+
+function UI (opts) {
+  this.width = opts.width
+  this.wrap = opts.wrap
+  this.rows = []
+}
+
+UI.prototype.span = function () {
+  var cols = this.div.apply(this, arguments)
+  cols.span = true
+}
+
+UI.prototype.div = function () {
+  if (arguments.length === 0) this.div('')
+  if (this.wrap && this._shouldApplyLayoutDSL.apply(this, arguments)) {
+    return this._applyLayoutDSL(arguments[0])
+  }
+
+  var cols = []
+
+  for (var i = 0, arg; (arg = arguments[i]) !== undefined; i++) {
+    if (typeof arg === 'string') cols.push(this._colFromString(arg))
+    else cols.push(arg)
+  }
+
+  this.rows.push(cols)
+  return cols
+}
+
+UI.prototype._shouldApplyLayoutDSL = function () {
+  return arguments.length === 1 && typeof arguments[0] === 'string' &&
+    /[\t\n]/.test(arguments[0])
+}
+
+UI.prototype._applyLayoutDSL = function (str) {
+  var _this = this
+  var rows = str.split('\n')
+  var leftColumnWidth = 0
+
+  // simple heuristic for layout, make sure the
+  // second column lines up along the left-hand.
+  // don't allow the first column to take up more
+  // than 50% of the screen.
+  rows.forEach(function (row) {
+    var columns = row.split('\t')
+    if (columns.length > 1 && stringWidth(columns[0]) > leftColumnWidth) {
+      leftColumnWidth = Math.min(
+        Math.floor(_this.width * 0.5),
+        stringWidth(columns[0])
+      )
+    }
+  })
+
+  // generate a table:
+  //  replacing ' ' with padding calculations.
+  //  using the algorithmically generated width.
+  rows.forEach(function (row) {
+    var columns = row.split('\t')
+    _this.div.apply(_this, columns.map(function (r, i) {
+      return {
+        text: r.trim(),
+        padding: _this._measurePadding(r),
+        width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
+      }
+    }))
+  })
+
+  return this.rows[this.rows.length - 1]
+}
+
+UI.prototype._colFromString = function (str) {
+  return {
+    text: str,
+    padding: this._measurePadding(str)
+  }
+}
+
+UI.prototype._measurePadding = function (str) {
+  // measure padding without ansi escape codes
+  var noAnsi = stripAnsi(str)
+  return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length]
+}
+
+UI.prototype.toString = function () {
+  var _this = this
+  var lines = []
+
+  _this.rows.forEach(function (row, i) {
+    _this.rowToString(row, lines)
+  })
+
+  // don't display any lines with the
+  // hidden flag set.
+  lines = lines.filter(function (line) {
+    return !line.hidden
+  })
+
+  return lines.map(function (line) {
+    return line.text
+  }).join('\n')
+}
+
+UI.prototype.rowToString = function (row, lines) {
+  var _this = this
+  var padding
+  var rrows = this._rasterize(row)
+  var str = ''
+  var ts
+  var width
+  var wrapWidth
+
+  rrows.forEach(function (rrow, r) {
+    str = ''
+    rrow.forEach(function (col, c) {
+      ts = '' // temporary string used during alignment/padding.
+      width = row[c].width // the width with padding.
+      wrapWidth = _this._negatePadding(row[c]) // the width without padding.
+
+      ts += col
+
+      for (var i = 0; i < wrapWidth - stringWidth(col); i++) {
+        ts += ' '
+      }
+
+      // align the string within its column.
+      if (row[c].align && row[c].align !== 'left' && _this.wrap) {
+        ts = align[row[c].align](ts, wrapWidth)
+        if (stringWidth(ts) < wrapWidth) ts += new Array(width - stringWidth(ts)).join(' ')
+      }
+
+      // apply border and padding to string.
+      padding = row[c].padding || [0, 0, 0, 0]
+      if (padding[left]) str += new Array(padding[left] + 1).join(' ')
+      str += addBorder(row[c], ts, '| ')
+      str += ts
+      str += addBorder(row[c], ts, ' |')
+      if (padding[right]) str += new Array(padding[right] + 1).join(' ')
+
+      // if prior row is span, try to render the
+      // current row on the prior line.
+      if (r === 0 && lines.length > 0) {
+        str = _this._renderInline(str, lines[lines.length - 1])
+      }
+    })
+
+    // remove trailing whitespace.
+    lines.push({
+      text: str.replace(/ +$/, ''),
+      span: row.span
+    })
+  })
+
+  return lines
+}
+
+function addBorder (col, ts, style) {
+  if (col.border) {
+    if (/[.']-+[.']/.test(ts)) return ''
+    else if (ts.trim().length) return style
+    else return '  '
+  }
+  return ''
+}
+
+// if the full 'source' can render in
+// the target line, do so.
+UI.prototype._renderInline = function (source, previousLine) {
+  var leadingWhitespace = source.match(/^ */)[0].length
+  var target = previousLine.text
+  var targetTextWidth = stringWidth(target.trimRight())
+
+  if (!previousLine.span) return source
+
+  // if we're not applying wrapping logic,
+  // just always append to the span.
+  if (!this.wrap) {
+    previousLine.hidden = true
+    return target + source
+  }
+
+  if (leadingWhitespace < targetTextWidth) return source
+
+  previousLine.hidden = true
+
+  return target.trimRight() + new Array(leadingWhitespace - targetTextWidth + 1).join(' ') + source.trimLeft()
+}
+
+UI.prototype._rasterize = function (row) {
+  var _this = this
+  var i
+  var rrow
+  var rrows = []
+  var widths = this._columnWidths(row)
+  var wrapped
+
+  // word wrap all columns, and create
+  // a data-structure that is easy to rasterize.
+  row.forEach(function (col, c) {
+    // leave room for left and right padding.
+    col.width = widths[c]
+    if (_this.wrap) wrapped = wrap(col.text, _this._negatePadding(col), {hard: true}).split('\n')
+    else wrapped = col.text.split('\n')
+
+    if (col.border) {
+      wrapped.unshift('.' + new Array(_this._negatePadding(col) + 3).join('-') + '.')
+      wrapped.push("'" + new Array(_this._negatePadding(col) + 3).join('-') + "'")
+    }
+
+    // add top and bottom padding.
+    if (col.padding) {
+      for (i = 0; i < (col.padding[top] || 0); i++) wrapped.unshift('')
+      for (i = 0; i < (col.padding[bottom] || 0); i++) wrapped.push('')
+    }
+
+    wrapped.forEach(function (str, r) {
+      if (!rrows[r]) rrows.push([])
+
+      rrow = rrows[r]
+
+      for (var i = 0; i < c; i++) {
+        if (rrow[i] === undefined) rrow.push('')
+      }
+      rrow.push(str)
+    })
+  })
+
+  return rrows
+}
+
+UI.prototype._negatePadding = function (col) {
+  var wrapWidth = col.width
+  if (col.padding) wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0)
+  if (col.border) wrapWidth -= 4
+  return wrapWidth
+}
+
+UI.prototype._columnWidths = function (row) {
+  var _this = this
+  var widths = []
+  var unset = row.length
+  var unsetWidth
+  var remainingWidth = this.width
+
+  // column widths can be set in config.
+  row.forEach(function (col, i) {
+    if (col.width) {
+      unset--
+      widths[i] = col.width
+      remainingWidth -= col.width
+    } else {
+      widths[i] = undefined
+    }
+  })
+
+  // any unset widths should be calculated.
+  if (unset) unsetWidth = Math.floor(remainingWidth / unset)
+  widths.forEach(function (w, i) {
+    if (!_this.wrap) widths[i] = row[i].width || stringWidth(row[i].text)
+    else if (w === undefined) widths[i] = Math.max(unsetWidth, _minWidth(row[i]))
+  })
+
+  return widths
+}
+
+// calculates the minimum width of
+// a column, based on padding preferences.
+function _minWidth (col) {
+  var padding = col.padding || []
+  var minWidth = 1 + (padding[left] || 0) + (padding[right] || 0)
+  if (col.border) minWidth += 4
+  return minWidth
+}
+
+function alignRight (str, width) {
+  str = str.trim()
+  var padding = ''
+  var strWidth = stringWidth(str)
+
+  if (strWidth < width) {
+    padding = new Array(width - strWidth + 1).join(' ')
+  }
+
+  return padding + str
+}
+
+function alignCenter (str, width) {
+  str = str.trim()
+  var padding = ''
+  var strWidth = stringWidth(str.trim())
+
+  if (strWidth < width) {
+    padding = new Array(parseInt((width - strWidth) / 2, 10) + 1).join(' ')
+  }
+
+  return padding + str
+}
+
+module.exports = function (opts) {
+  opts = opts || {}
+
+  return new UI({
+    width: (opts || {}).width || 80,
+    wrap: typeof opts.wrap === 'boolean' ? opts.wrap : true
+  })
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/cliui/package.json b/legacy-libs/grpc-cloned/node_modules/cliui/package.json
new file mode 100644 (file)
index 0000000..2f6f7dd
--- /dev/null
@@ -0,0 +1,131 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "cliui@^3.0.3",
+        "scope": null,
+        "escapedName": "cliui",
+        "name": "cliui",
+        "rawSpec": "^3.0.3",
+        "spec": ">=3.0.3 <4.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/grpc/node_modules/yargs"
+    ]
+  ],
+  "_from": "cliui@>=3.0.3 <4.0.0",
+  "_id": "cliui@3.2.0",
+  "_inCache": true,
+  "_location": "/grpc/cliui",
+  "_nodeVersion": "5.1.0",
+  "_npmOperationalInternal": {
+    "host": "packages-12-west.internal.npmjs.com",
+    "tmp": "tmp/cliui-3.2.0.tgz_1460342854008_0.8861493801232427"
+  },
+  "_npmUser": {
+    "name": "bcoe",
+    "email": "ben@npmjs.com"
+  },
+  "_npmVersion": "3.3.12",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "cliui@^3.0.3",
+    "scope": null,
+    "escapedName": "cliui",
+    "name": "cliui",
+    "rawSpec": "^3.0.3",
+    "spec": ">=3.0.3 <4.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/grpc/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
+  "_shasum": "120601537a916d29940f934da3b48d585a39213d",
+  "_shrinkwrap": null,
+  "_spec": "cliui@^3.0.3",
+  "_where": "/var/opt/motion2/node_modules/grpc/node_modules/yargs",
+  "author": {
+    "name": "Ben Coe",
+    "email": "ben@npmjs.com"
+  },
+  "bugs": {
+    "url": "https://github.com/yargs/cliui/issues"
+  },
+  "config": {
+    "blanket": {
+      "pattern": [
+        "index.js"
+      ],
+      "data-cover-never": [
+        "node_modules",
+        "test"
+      ],
+      "output-reporter": "spec"
+    }
+  },
+  "dependencies": {
+    "string-width": "^1.0.1",
+    "strip-ansi": "^3.0.1",
+    "wrap-ansi": "^2.0.0"
+  },
+  "description": "easily create complex multi-column command-line-interfaces",
+  "devDependencies": {
+    "chai": "^3.5.0",
+    "chalk": "^1.1.2",
+    "coveralls": "^2.11.8",
+    "mocha": "^2.4.5",
+    "nyc": "^6.4.0",
+    "standard": "^6.0.8",
+    "standard-version": "^2.1.2"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "120601537a916d29940f934da3b48d585a39213d",
+    "tarball": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz"
+  },
+  "files": [
+    "index.js"
+  ],
+  "gitHead": "75d62e9dfa77a0e0a9c3ac3b96b02baa294142ce",
+  "homepage": "https://github.com/yargs/cliui#readme",
+  "keywords": [
+    "cli",
+    "command-line",
+    "layout",
+    "design",
+    "console",
+    "wrap",
+    "table"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "bcoe",
+      "email": "ben@npmjs.com"
+    }
+  ],
+  "name": "cliui",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/yargs/cliui.git"
+  },
+  "scripts": {
+    "coverage": "nyc --reporter=text-lcov mocha | coveralls",
+    "pretest": "standard",
+    "test": "nyc mocha",
+    "version": "standard-version"
+  },
+  "standard": {
+    "ignore": [
+      "**/example/**"
+    ],
+    "globals": [
+      "it"
+    ]
+  },
+  "version": "3.2.0"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/CHANGELOG.md b/legacy-libs/grpc-cloned/node_modules/nan/CHANGELOG.md
new file mode 100644 (file)
index 0000000..93d9496
--- /dev/null
@@ -0,0 +1,537 @@
+# NAN ChangeLog
+
+**Version 2.14.2: current Node 14.13.1, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1**
+
+### 2.14.2 Oct 13 2020
+
+  - Bugfix: fix gcc 8 function cast warning (#899) 35f0fab205574b2cbda04e6347c8b2db755e124f
+
+### 2.14.1 Apr 21 2020
+
+  - Bugfix: use GetBackingStore() instead of GetContents() (#888) 2c023bd447661a61071da318b0ff4003c3858d39
+
+### 2.14.0 May 16 2019
+
+  - Feature: Add missing methods to Nan::Maybe<T> (#852) 4e962489fb84a184035b9fa74f245f650249aca6
+
+### 2.13.2 Mar 24 2019
+
+  - Bugfix: remove usage of deprecated `IsNearDeath` (#842) fbaf42252af279c3d867c6b193571f9711c39847
+
+### 2.13.1 Mar 14 2019
+
+  - Bugfix: check V8 version directly instead of inferring from NMV (#840) 12f9df9f393285de8fb4a8cd01478dc4fe3b089d
+
+### 2.13.0 Mar 13 2019
+
+  - Feature: add support for node master (#831) 113c0282072e7ff4f9dfc98b432fd894b798c2c
+
+### 2.12.1 Dec 18 2018
+
+  - Bugfix: Fix build breakage with Node.js 10.0.0-10.9.0. (#833) 625e90e8fef8d39ffa7247250a76a100b2487474
+
+### 2.12.0 Dec 16 2018
+
+  - Bugfix: Add scope.Escape() to Call() (#817) 2e5ed4fc3a8ac80a6ef1f2a55099ab3ac8800dc6
+  - Bugfix: Fix Node.js v10.12.0 deprecation warnings. 509859cc23b1770376b56550a027840a2ce0f73d
+  - Feature: Allow SetWeak() for non-object persistent handles. (#824) e6ef6a48e7e671fe3e4b7dddaa8912a3f8262ecd
+
+### 2.11.1 Sep 29 2018
+
+  - Fix: adapt to V8 7.0 24a22c3b25eeeec2016c6ec239bdd6169e985447
+
+### 2.11.0 Aug 25 2018
+
+  - Removal: remove `FunctionCallbackInfo::Callee` for nodejs `>= 10` 1a56c0a6efd4fac944cb46c30912a8e023bda7d4
+  - Bugfix: Fix `AsyncProgressWorkerBase::WorkProgress` sends invalid data b0c764d1dab11e9f8b37ffb81e2560a4498aad5e
+  - Feature: Introduce `GetCurrentEventLoop` b4911b0bb1f6d47d860e10ec014d941c51efac5e
+  - Feature: Add `NAN_MODULE_WORKER_ENABLED` macro as a replacement for `NAN_MODULE` b058fb047d18a58250e66ae831444441c1f2ac7a
+
+### 2.10.0 Mar 16 2018
+
+  - Deprecation: Deprecate `MakeCallback` 5e92b19a59e194241d6a658bd6ff7bfbda372950
+  - Feature: add `Nan::Call` overload 4482e1242fe124d166fc1a5b2be3c1cc849fe452
+  - Feature: add more `Nan::Call` overloads 8584e63e6d04c7d2eb8c4a664e4ef57d70bf672b
+  - Feature: Fix deprecation warnings for Node 10 1caf258243b0602ed56922bde74f1c91b0cbcb6a
+
+### 2.9.2 Feb 22 2018
+
+  - Bugfix: Bandaid for async hooks 212bd2f849be14ef1b02fc85010b053daa24252b
+
+### 2.9.1 Feb 22 2018
+
+  - Bugfix: Avoid deprecation warnings in deprecated `Nan::Callback::operator()` 372b14d91289df4604b0f81780709708c45a9aa4
+  - Bugfix: Avoid deprecation warnings in `Nan::JSON` 3bc294bce0b7d0a3ee4559926303e5ed4866fda2
+
+### 2.9.0 Feb 22 2018
+
+  - Deprecation: Deprecate legacy `Callback::Call` 6dd5fa690af61ca3523004b433304c581b3ea309
+  - Feature: introduce `AsyncResource` class 90c0a179c0d8cb5fd26f1a7d2b1d6231eb402d48o
+  - Feature: Add context aware `Nan::Callback::Call` functions 7169e09fb088418b6e388222e88b4c13f07ebaee
+  - Feature: Make `AsyncWorker` context aware 066ba21a6fb9e2b5230c9ed3a6fc51f1211736a4
+  - Feature: add `Callback` overload to `Nan::Call` 5328daf66e202658c1dc0d916c3aaba99b3cc606
+  - Bugfix: fix warning: suggest parentheses around `&&` within `||` b2bb63d68b8ae623a526b542764e1ac82319cb2c
+  - Bugfix: Fix compilation on io.js 3 d06114dba0a522fb436f0c5f47b994210968cd7b
+
+### 2.8.0 Nov 15 2017
+
+  - Deprecation: Deprecate `Nan::ForceSet` in favor of `Nan::DefineOwnProperty()` 95cbb976d6fbbba88ba0f86dd188223a8591b4e7
+  - Feature: Add `Nan::AsyncProgressQueueWorker` a976636ecc2ef617d1b061ce4a6edf39923691cb
+  - Feature: Add `Nan::DefineOwnProperty()` 95cbb976d6fbbba88ba0f86dd188223a8591b4e7
+  - Bugfix: Fix compiling on io.js 1 & 2 82705a64503ce60c62e98df5bd02972bba090900
+  - Bugfix: Use DefineOwnProperty instead of ForceSet 95cbb976d6fbbba88ba0f86dd188223a8591b4e7
+
+### 2.7.0 Aug 30 2017
+
+  - Feature: Add `Nan::To<v8::Function>()` overload. b93280670c9f6da42ed4cf6cbf085ffdd87bd65b
+  - Bugfix: Fix ternary in `Nan::MaybeLocal<T>::FromMaybe<S>()`. 79a26f7d362e756a9524e672a82c3d603b542867
+
+### 2.6.2 Apr 12 2017
+
+  - Bugfix: Fix v8::JSON::Parse() deprecation warning. 87f6a3c65815fa062296a994cc863e2fa124867d
+
+### 2.6.1 Apr 6 2017
+
+  - Bugfix: nan_json.h: fix build breakage in Node 6 ac8d47dc3c10bfbf3f15a6b951633120c0ee6d51
+
+### 2.6.0 Apr 6 2017
+
+  - Feature: nan: add support for JSON::Parse & Stringify b533226c629cce70e1932a873bb6f849044a56c5
+
+### 2.5.1 Jan 23 2017
+
+  - Bugfix: Fix disappearing handle for private value 6a80995694f162ef63dbc9948fbefd45d4485aa0
+  - Bugfix: Add missing scopes a93b8bae6bc7d32a170db6e89228b7f60ee57112
+  - Bugfix: Use string::data instead of string::front in NewOneByteString d5f920371e67e1f3b268295daee6e83af86b6e50
+
+### 2.5.0 Dec 21 2016
+
+  - Feature: Support Private accessors a86255cb357e8ad8ccbf1f6a4a901c921e39a178
+  - Bugfix: Abort in delete operators that shouldn't be called 0fe38215ff8581703967dfd26c12793feb960018
+
+### 2.4.0 Jul 10 2016
+
+  - Feature: Rewrite Callback to add Callback::Reset c4cf44d61f8275cd5f7b0c911d7a806d4004f649
+  - Feature: AsyncProgressWorker: add template types for .send 1242c9a11a7ed481c8f08ec06316385cacc513d0
+  - Bugfix: Add constness to old Persistent comparison operators bd43cb9982c7639605d60fd073efe8cae165d9b2
+
+### 2.3.5 May 31 2016
+
+  - Bugfix: Replace NAN_INLINE with 'inline' keyword. 71819d8725f822990f439479c9aba3b240804909
+
+### 2.3.4 May 31 2016
+
+  - Bugfix: Remove V8 deprecation warnings 0592fb0a47f3a1c7763087ebea8e1138829f24f9
+  - Bugfix: Fix new versions not to use WeakCallbackInfo::IsFirstPass 615c19d9e03d4be2049c10db0151edbc3b229246
+  - Bugfix: Make ObjectWrap::handle() const d19af99595587fe7a26bd850af6595c2a7145afc
+  - Bugfix: Fix compilation errors related to 0592fb0a47f3a1c7763087ebea8e1138829f24f9 e9191c525b94f652718325e28610a1adcf90fed8
+
+### 2.3.3 May 4 2016
+
+  - Bugfix: Refactor SetMethod() to deal with v8::Templates (#566) b9083cf6d5de6ebe6bcb49c7502fbb7c0d9ddda8
+
+### 2.3.2 Apr 27 2016
+
+  - Bugfix: Fix compilation on outdated versions due to Handle removal f8b7c875d04d425a41dfd4f3f8345bc3a11e6c52
+
+### 2.3.1 Apr 27 2016
+
+  - Bugfix: Don't use deprecated v8::Template::Set() in SetMethod a90951e9ea70fa1b3836af4b925322919159100e
+
+### 2.3.0 Apr 27 2016
+
+  - Feature: added Signal() for invoking async callbacks without sending data from AsyncProgressWorker d8adba45f20e077d00561b20199133620c990b38
+  - Bugfix: Don't use deprecated v8::Template::Set() 00dacf0a4b86027415867fa7f1059acc499dcece
+
+### 2.2.1 Mar 29 2016
+
+  - Bugfix: Use NewFromUnsigned in ReturnValue<T>::Set(uint32_t i) for pre_12 3a18f9bdce29826e0e4c217854bc476918241a58
+  - Performance: Remove unneeeded nullptr checks b715ef44887931c94f0d1605b3b1a4156eebece9
+
+### 2.2.0 Jan 9 2016
+
+  - Feature: Add Function::Call wrapper 4c157474dacf284d125c324177b45aa5dabc08c6
+  - Feature: Rename GC*logueCallback to GCCallback for > 4.0 3603435109f981606d300eb88004ca101283acec
+  - Bugfix: Fix Global::Pass for old versions 367e82a60fbaa52716232cc89db1cc3f685d77d9
+  - Bugfix: Remove weird MaybeLocal wrapping of what already is a MaybeLocal 23b4590db10c2ba66aee2338aebe9751c4cb190b
+
+### 2.1.0 Oct 8 2015
+
+  - Deprecation: Deprecate NanErrnoException in favor of ErrnoException 0af1ca4cf8b3f0f65ed31bc63a663ab3319da55c
+  - Feature: added helper class for accessing contents of typedarrays 17b51294c801e534479d5463697a73462d0ca555
+  - Feature: [Maybe types] Add MakeMaybe(...) 48d7b53d9702b0c7a060e69ea10fea8fb48d814d
+  - Feature: new: allow utf16 string with length 66ac6e65c8ab9394ef588adfc59131b3b9d8347b
+  - Feature: Introduce SetCallHandler and SetCallAsFunctionHandler 7764a9a115d60ba10dc24d86feb0fbc9b4f75537
+  - Bugfix: Enable creating Locals from Globals under Node 0.10. 9bf9b8b190821af889790fdc18ace57257e4f9ff
+  - Bugfix: Fix issue #462 where PropertyCallbackInfo data is not stored safely. 55f50adedd543098526c7b9f4fffd607d3f9861f
+
+### 2.0.9 Sep 8 2015
+
+  - Bugfix: EscapableHandleScope in Nan::NewBuffer for Node 0.8 and 0.10 b1654d7
+
+### 2.0.8 Aug 28 2015
+
+  - Work around duplicate linking bug in clang 11902da
+
+### 2.0.7 Aug 26 2015
+
+  - Build: Repackage
+
+### 2.0.6 Aug 26 2015
+
+  - Bugfix: Properly handle null callback in FunctionTemplate factory 6e99cb1
+  - Bugfix: Remove unused static std::map instances 525bddc
+  - Bugfix: Make better use of maybe versions of APIs bfba85b
+  - Bugfix: Fix shadowing issues with handle in ObjectWrap 0a9072d
+
+### 2.0.5 Aug 10 2015
+
+  - Bugfix: Reimplement weak callback in ObjectWrap 98d38c1
+  - Bugfix: Make sure callback classes are not assignable, copyable or movable 81f9b1d
+
+### 2.0.4 Aug 6 2015
+
+  - Build: Repackage
+
+### 2.0.3 Aug 6 2015
+
+  - Bugfix: Don't use clang++ / g++ syntax extension. 231450e
+
+### 2.0.2 Aug 6 2015
+
+  - Build: Repackage
+
+### 2.0.1 Aug 6 2015
+
+  - Bugfix: Add workaround for missing REPLACE_INVALID_UTF8 60d6687
+  - Bugfix: Reimplement ObjectWrap from scratch to prevent memory leaks 6484601
+  - Bugfix: Fix Persistent leak in FunctionCallbackInfo and PropertyCallbackInfo 641ef5f
+  - Bugfix: Add missing overload for Nan::NewInstance that takes argc/argv 29450ed
+
+### 2.0.0 Jul 31 2015
+
+  - Change: Renamed identifiers with leading underscores       b5932b4
+  - Change: Replaced NanObjectWrapHandle with class NanObjectWrap      464f1e1
+  - Change: Replace NanScope and NanEscpableScope macros with classes  47751c4
+  - Change: Rename NanNewBufferHandle to NanNewBuffer  6745f99
+  - Change: Rename NanBufferUse to NanNewBuffer        3e8b0a5
+  - Change: Rename NanNewBuffer to NanCopyBuffer       d6af78d
+  - Change: Remove Nan prefix from all names   72d1f67
+  - Change: Update Buffer API for new upstream changes d5d3291
+  - Change: Rename Scope and EscapableScope to HandleScope and EscapableHandleScope    21a7a6a
+  - Change: Get rid of Handles  e6c0daf
+  - Feature: Support io.js 3 with V8 4.4
+  - Feature: Introduce NanPersistent   7fed696
+  - Feature: Introduce NanGlobal       4408da1
+  - Feature: Added NanTryCatch 10f1ca4
+  - Feature: Update for V8 v4.3        4b6404a
+  - Feature: Introduce NanNewOneByteString     c543d32
+  - Feature: Introduce namespace Nan   67ed1b1
+  - Removal: Remove NanLocker and NanUnlocker  dd6e401
+  - Removal: Remove string converters, except NanUtf8String, which now follows the node implementation b5d00a9
+  - Removal: Remove NanReturn* macros  d90a25c
+  - Removal: Remove HasInstance        e8f84fe
+
+
+### 1.9.0 Jul 31 2015
+
+  - Feature: Added `NanFatalException` 81d4a2c
+  - Feature: Added more error types 4265f06
+  - Feature: Added dereference and function call operators to NanCallback c4b2ed0
+  - Feature: Added indexed GetFromPersistent and SaveToPersistent edd510c
+  - Feature: Added more overloads of SaveToPersistent and GetFromPersistent 8b1cef6
+  - Feature: Added NanErrnoException dd87d9e
+  - Correctness: Prevent assign, copy, and move for classes that do not support it 1f55c59, 4b808cb, c96d9b2, fba4a29, 3357130
+  - Deprecation: Deprecate `NanGetPointerSafe` and `NanSetPointerSafe` 81d4a2c
+  - Deprecation: Deprecate `NanBooleanOptionValue` and `NanUInt32OptionValue` 0ad254b
+
+### 1.8.4 Apr 26 2015
+
+  - Build: Repackage
+
+### 1.8.3 Apr 26 2015
+
+  - Bugfix: Include missing header 1af8648
+
+### 1.8.2 Apr 23 2015
+
+  - Build: Repackage
+
+### 1.8.1 Apr 23 2015
+
+  - Bugfix: NanObjectWrapHandle should take a pointer 155f1d3
+
+### 1.8.0 Apr 23 2015
+
+  - Feature: Allow primitives with NanReturnValue 2e4475e
+  - Feature: Added comparison operators to NanCallback 55b075e
+  - Feature: Backport thread local storage 15bb7fa
+  - Removal: Remove support for signatures with arguments 8a2069d
+  - Correcteness: Replaced NanObjectWrapHandle macro with function 0bc6d59
+
+### 1.7.0 Feb 28 2015
+
+  - Feature: Made NanCallback::Call accept optional target 8d54da7
+  - Feature: Support atom-shell 0.21 0b7f1bb
+
+### 1.6.2 Feb 6 2015
+
+  - Bugfix: NanEncode: fix argument type for node::Encode on io.js 2be8639
+
+### 1.6.1 Jan 23 2015
+
+  - Build: version bump
+
+### 1.5.3 Jan 23 2015
+
+  - Build: repackage
+
+### 1.6.0 Jan 23 2015
+
+ - Deprecated `NanNewContextHandle` in favor of `NanNew<Context>` 49259af
+ - Support utility functions moved in newer v8 versions (Node 0.11.15, io.js 1.0) a0aa179
+ - Added `NanEncode`, `NanDecodeBytes` and `NanDecodeWrite` 75e6fb9
+
+### 1.5.2 Jan 23 2015
+
+  - Bugfix: Fix non-inline definition build error with clang++ 21d96a1, 60fadd4
+  - Bugfix: Readded missing String constructors 18d828f
+  - Bugfix: Add overload handling NanNew<FunctionTemplate>(..) 5ef813b
+  - Bugfix: Fix uv_work_cb versioning 997e4ae
+  - Bugfix: Add function factory and test 4eca89c
+  - Bugfix: Add object template factory and test cdcb951
+  - Correctness: Lifted an io.js related typedef c9490be
+  - Correctness: Make explicit downcasts of String lengths 00074e6
+  - Windows: Limit the scope of disabled warning C4530 83d7deb
+
+### 1.5.1 Jan 15 2015
+
+  - Build: version bump
+
+### 1.4.3 Jan 15 2015
+
+  - Build: version bump
+
+### 1.4.2 Jan 15 2015
+
+  - Feature: Support io.js 0dbc5e8
+
+### 1.5.0 Jan 14 2015
+
+ - Feature: Support io.js b003843
+ - Correctness: Improved NanNew internals 9cd4f6a
+ - Feature: Implement progress to NanAsyncWorker 8d6a160
+
+### 1.4.1 Nov 8 2014
+
+ - Bugfix: Handle DEBUG definition correctly
+ - Bugfix: Accept int as Boolean
+
+### 1.4.0 Nov 1 2014
+
+ - Feature: Added NAN_GC_CALLBACK 6a5c245
+ - Performance: Removed unnecessary local handle creation 18a7243, 41fe2f8
+ - Correctness: Added constness to references in NanHasInstance 02c61cd
+ - Warnings: Fixed spurious warnings from -Wundef and -Wshadow, 541b122, 99d8cb6
+ - Windoze: Shut Visual Studio up when compiling 8d558c1
+ - License: Switch to plain MIT from custom hacked MIT license 11de983
+ - Build: Added test target to Makefile e232e46
+ - Performance: Removed superfluous scope in NanAsyncWorker f4b7821
+ - Sugar/Feature: Added NanReturnThis() and NanReturnHolder() shorthands 237a5ff, d697208
+ - Feature: Added suitable overload of NanNew for v8::Integer::NewFromUnsigned b27b450
+
+### 1.3.0 Aug 2 2014
+
+ - Added NanNew<v8::String, std::string>(std::string)
+ - Added NanNew<v8::String, std::string&>(std::string&)
+ - Added NanAsciiString helper class
+ - Added NanUtf8String helper class
+ - Added NanUcs2String helper class
+ - Deprecated NanRawString()
+ - Deprecated NanCString()
+ - Added NanGetIsolateData(v8::Isolate *isolate)
+ - Added NanMakeCallback(v8::Handle<v8::Object> target, v8::Handle<v8::Function> func, int argc, v8::Handle<v8::Value>* argv)
+ - Added NanMakeCallback(v8::Handle<v8::Object> target, v8::Handle<v8::String> symbol, int argc, v8::Handle<v8::Value>* argv)
+ - Added NanMakeCallback(v8::Handle<v8::Object> target, const char* method, int argc, v8::Handle<v8::Value>* argv)
+ - Added NanSetTemplate(v8::Handle<v8::Template> templ, v8::Handle<v8::String> name , v8::Handle<v8::Data> value, v8::PropertyAttribute attributes)
+ - Added NanSetPrototypeTemplate(v8::Local<v8::FunctionTemplate> templ, v8::Handle<v8::String> name, v8::Handle<v8::Data> value, v8::PropertyAttribute attributes)
+ - Added NanSetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ, const char *name, v8::Handle<v8::Data> value)
+ - Added NanSetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ, v8::Handle<v8::String> name, v8::Handle<v8::Data> value, v8::PropertyAttribute attributes)
+
+### 1.2.0 Jun 5 2014
+
+ - Add NanSetPrototypeTemplate
+ - Changed NAN_WEAK_CALLBACK internals, switched _NanWeakCallbackData to class,
+     introduced _NanWeakCallbackDispatcher
+ - Removed -Wno-unused-local-typedefs from test builds
+ - Made test builds Windows compatible ('Sleep()')
+
+### 1.1.2 May 28 2014
+
+ - Release to fix more stuff-ups in 1.1.1
+
+### 1.1.1 May 28 2014
+
+ - Release to fix version mismatch in nan.h and lack of changelog entry for 1.1.0
+
+### 1.1.0 May 25 2014
+
+ - Remove nan_isolate, use v8::Isolate::GetCurrent() internally instead
+ - Additional explicit overloads for NanNew(): (char*,int), (uint8_t*[,int]),
+     (uint16_t*[,int), double, int, unsigned int, bool, v8::String::ExternalStringResource*,
+     v8::String::ExternalAsciiStringResource*
+ - Deprecate NanSymbol()
+ - Added SetErrorMessage() and ErrorMessage() to NanAsyncWorker
+
+### 1.0.0 May 4 2014
+
+ - Heavy API changes for V8 3.25 / Node 0.11.13
+ - Use cpplint.py
+ - Removed NanInitPersistent
+ - Removed NanPersistentToLocal
+ - Removed NanFromV8String
+ - Removed NanMakeWeak
+ - Removed NanNewLocal
+ - Removed NAN_WEAK_CALLBACK_OBJECT
+ - Removed NAN_WEAK_CALLBACK_DATA
+ - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions
+ - Introduce NanUndefined, NanNull, NanTrue and NanFalse
+ - Introduce NanEscapableScope and NanEscapeScope
+ - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node)
+ - Introduce NanMakeCallback for node::MakeCallback
+ - Introduce NanSetTemplate
+ - Introduce NanGetCurrentContext
+ - Introduce NanCompileScript and NanRunScript
+ - Introduce NanAdjustExternalMemory
+ - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback
+ - Introduce NanGetHeapStatistics
+ - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent()
+
+### 0.8.0 Jan 9 2014
+
+ - NanDispose -> NanDisposePersistent, deprecate NanDispose
+ - Extract _NAN_*_RETURN_TYPE, pull up NAN_*()
+
+### 0.7.1 Jan 9 2014
+
+ - Fixes to work against debug builds of Node
+ - Safer NanPersistentToLocal (avoid reinterpret_cast)
+ - Speed up common NanRawString case by only extracting flattened string when necessary
+
+### 0.7.0 Dec 17 2013
+
+ - New no-arg form of NanCallback() constructor.
+ - NanCallback#Call takes Handle rather than Local
+ - Removed deprecated NanCallback#Run method, use NanCallback#Call instead
+ - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS
+ - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call()
+ - Introduce NanRawString() for char* (or appropriate void*) from v8::String
+     (replacement for NanFromV8String)
+ - Introduce NanCString() for null-terminated char* from v8::String
+
+### 0.6.0 Nov 21 2013
+
+ - Introduce NanNewLocal<T>(v8::Handle<T> value) for use in place of
+     v8::Local<T>::New(...) since v8 started requiring isolate in Node 0.11.9
+
+### 0.5.2 Nov 16 2013
+
+ - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public
+
+### 0.5.1 Nov 12 2013
+
+ - Use node::MakeCallback() instead of direct v8::Function::Call()
+
+### 0.5.0 Nov 11 2013
+
+ - Added @TooTallNate as collaborator
+ - New, much simpler, "include_dirs" for binding.gyp
+ - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros
+
+### 0.4.4 Nov 2 2013
+
+ - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+
+
+### 0.4.3 Nov 2 2013
+
+ - Include node_object_wrap.h, removed from node.h for Node 0.11.8.
+
+### 0.4.2 Nov 2 2013
+
+ - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for
+     Node 0.11.8 release.
+
+### 0.4.1 Sep 16 2013
+
+ - Added explicit `#include <uv.h>` as it was removed from node.h for v0.11.8
+
+### 0.4.0 Sep 2 2013
+
+ - Added NAN_INLINE and NAN_DEPRECATED and made use of them
+ - Added NanError, NanTypeError and NanRangeError
+ - Cleaned up code
+
+### 0.3.2 Aug 30 2013
+
+ - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent
+     in NanAsyncWorker
+
+### 0.3.1 Aug 20 2013
+
+ - fix "not all control paths return a value" compile warning on some platforms
+
+### 0.3.0 Aug 19 2013
+
+ - Made NAN work with NPM
+ - Lots of fixes to NanFromV8String, pulling in features from new Node core
+ - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API
+ - Added optional error number argument for NanThrowError()
+ - Added NanInitPersistent()
+ - Added NanReturnNull() and NanReturnEmptyString()
+ - Added NanLocker and NanUnlocker
+ - Added missing scopes
+ - Made sure to clear disposed Persistent handles
+ - Changed NanAsyncWorker to allocate error messages on the heap
+ - Changed NanThrowError(Local<Value>) to NanThrowError(Handle<Value>)
+ - Fixed leak in NanAsyncWorker when errmsg is used
+
+### 0.2.2 Aug 5 2013
+
+ - Fixed usage of undefined variable with node::BASE64 in NanFromV8String()
+
+### 0.2.1 Aug 5 2013
+
+ - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for
+     NanFromV8String()
+
+### 0.2.0 Aug 5 2013
+
+ - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR,
+     NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY
+ - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS,
+     _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS,
+     _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS,
+     _NAN_PROPERTY_QUERY_ARGS
+ - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer
+ - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT,
+     NAN_WEAK_CALLBACK_DATA, NanMakeWeak
+ - Renamed THROW_ERROR to _NAN_THROW_ERROR
+ - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*)
+ - Added NanBufferUse(char*, uint32_t)
+ - Added NanNewContextHandle(v8::ExtensionConfiguration*,
+       v8::Handle<v8::ObjectTemplate>, v8::Handle<v8::Value>)
+ - Fixed broken NanCallback#GetFunction()
+ - Added optional encoding and size arguments to NanFromV8String()
+ - Added NanGetPointerSafe() and NanSetPointerSafe()
+ - Added initial test suite (to be expanded)
+ - Allow NanUInt32OptionValue to convert any Number object
+
+### 0.1.0 Jul 21 2013
+
+ - Added `NAN_GETTER`, `NAN_SETTER`
+ - Added `NanThrowError` with single Local<Value> argument
+ - Added `NanNewBufferHandle` with single uint32_t argument
+ - Added `NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>)`
+ - Added `Local<Function> NanCallback#GetFunction()`
+ - Added `NanCallback#Call(int, Local<Value>[])`
+ - Deprecated `NanCallback#Run(int, Local<Value>[])` in favour of Call
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/LICENSE.md b/legacy-libs/grpc-cloned/node_modules/nan/LICENSE.md
new file mode 100644 (file)
index 0000000..dddd13d
--- /dev/null
@@ -0,0 +1,13 @@
+The MIT License (MIT)
+=====================
+
+Copyright (c) 2018 NAN contributors
+-----------------------------------
+
+*NAN contributors listed at <https://github.com/nodejs/nan#contributors>*
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/README.md b/legacy-libs/grpc-cloned/node_modules/nan/README.md
new file mode 100644 (file)
index 0000000..f671ef1
--- /dev/null
@@ -0,0 +1,455 @@
+Native Abstractions for Node.js
+===============================
+
+**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10, 0.12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 and 14.**
+
+***Current version: 2.14.2***
+
+*(See [CHANGELOG.md](https://github.com/nodejs/nan/blob/master/CHANGELOG.md) for complete ChangeLog)*
+
+[![NPM](https://nodei.co/npm/nan.png?downloads=true&downloadRank=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6&height=3)](https://nodei.co/npm/nan/)
+
+[![Build Status](https://api.travis-ci.org/nodejs/nan.svg?branch=master)](https://travis-ci.org/nodejs/nan)
+[![Build status](https://ci.appveyor.com/api/projects/status/kh73pbm9dsju7fgh)](https://ci.appveyor.com/project/RodVagg/nan)
+
+Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.12 to 4.0, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle.
+
+This project also contains some helper utilities that make addon development a bit more pleasant.
+
+ * **[News & Updates](#news)**
+ * **[Usage](#usage)**
+ * **[Example](#example)**
+ * **[API](#api)**
+ * **[Tests](#tests)**
+ * **[Known issues](#issues)**
+ * **[Governance & Contributing](#governance)**
+
+<a name="news"></a>
+
+## News & Updates
+
+<a name="usage"></a>
+
+## Usage
+
+Simply add **NAN** as a dependency in the *package.json* of your Node addon:
+
+``` bash
+$ npm install --save nan
+```
+
+Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include <nan.h>` in your *.cpp* files:
+
+``` python
+"include_dirs" : [
+    "<!(node -e \"require('nan')\")"
+]
+```
+
+This works like a `-I<path-to-NAN>` when compiling your addon.
+
+<a name="example"></a>
+
+## Example
+
+Just getting started with Nan? Take a look at the **[Node Add-on Examples](https://github.com/nodejs/node-addon-examples)**.
+
+Refer to a [quick-start **Nan** Boilerplate](https://github.com/fcanas/node-native-boilerplate) for a ready-to-go project that utilizes basic Nan functionality.
+
+For a simpler example, see the **[async pi estimation example](https://github.com/nodejs/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**.
+
+Yet another example is **[nan-example-eol](https://github.com/CodeCharmLtd/nan-example-eol)**. It shows newline detection implemented as a native addon.
+
+Also take a look at our comprehensive **[C++ test suite](https://github.com/nodejs/nan/tree/master/test/cpp)** which has a plethora of code snippets for your pasting pleasure.
+
+<a name="api"></a>
+
+## API
+
+Additional to the NAN documentation below, please consult:
+
+* [The V8 Getting Started * Guide](https://v8.dev/docs/embed)
+* [V8 API Documentation](https://v8docs.nodesource.com/)
+* [Node Add-on Documentation](https://nodejs.org/api/addons.html)
+
+<!-- START API -->
+
+### JavaScript-accessible methods
+
+A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://github.com/v8/v8/wiki/Embedder%27s-Guide#templates) for further information.
+
+In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type.
+
+* **Method argument types**
+ - <a href="doc/methods.md#api_nan_function_callback_info"><b><code>Nan::FunctionCallbackInfo</code></b></a>
+ - <a href="doc/methods.md#api_nan_property_callback_info"><b><code>Nan::PropertyCallbackInfo</code></b></a>
+ - <a href="doc/methods.md#api_nan_return_value"><b><code>Nan::ReturnValue</code></b></a>
+* **Method declarations**
+ - <a href="doc/methods.md#api_nan_method"><b>Method declaration</b></a>
+ - <a href="doc/methods.md#api_nan_getter"><b>Getter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_setter"><b>Setter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_property_getter"><b>Property getter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_property_setter"><b>Property setter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_property_enumerator"><b>Property enumerator declaration</b></a>
+ - <a href="doc/methods.md#api_nan_property_deleter"><b>Property deleter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_property_query"><b>Property query declaration</b></a>
+ - <a href="doc/methods.md#api_nan_index_getter"><b>Index getter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_index_setter"><b>Index setter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_index_enumerator"><b>Index enumerator declaration</b></a>
+ - <a href="doc/methods.md#api_nan_index_deleter"><b>Index deleter declaration</b></a>
+ - <a href="doc/methods.md#api_nan_index_query"><b>Index query declaration</b></a>
+* Method and template helpers
+ - <a href="doc/methods.md#api_nan_set_method"><b><code>Nan::SetMethod()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_prototype_method"><b><code>Nan::SetPrototypeMethod()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_accessor"><b><code>Nan::SetAccessor()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_named_property_handler"><b><code>Nan::SetNamedPropertyHandler()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_indexed_property_handler"><b><code>Nan::SetIndexedPropertyHandler()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_template"><b><code>Nan::SetTemplate()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_prototype_template"><b><code>Nan::SetPrototypeTemplate()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_instance_template"><b><code>Nan::SetInstanceTemplate()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_call_handler"><b><code>Nan::SetCallHandler()</code></b></a>
+ - <a href="doc/methods.md#api_nan_set_call_as_function_handler"><b><code>Nan::SetCallAsFunctionHandler()</code></b></a>
+
+### Scopes
+
+A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works.
+
+A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope.
+
+The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these.
+
+ - <a href="doc/scopes.md#api_nan_handle_scope"><b><code>Nan::HandleScope</code></b></a>
+ - <a href="doc/scopes.md#api_nan_escapable_handle_scope"><b><code>Nan::EscapableHandleScope</code></b></a>
+
+Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection).
+
+### Persistent references
+
+An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed.
+
+Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported.
+
+ - <a href="doc/persistent.md#api_nan_persistent_base"><b><code>Nan::PersistentBase & v8::PersistentBase</code></b></a>
+ - <a href="doc/persistent.md#api_nan_non_copyable_persistent_traits"><b><code>Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits</code></b></a>
+ - <a href="doc/persistent.md#api_nan_copyable_persistent_traits"><b><code>Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits</code></b></a>
+ - <a href="doc/persistent.md#api_nan_persistent"><b><code>Nan::Persistent</code></b></a>
+ - <a href="doc/persistent.md#api_nan_global"><b><code>Nan::Global</code></b></a>
+ - <a href="doc/persistent.md#api_nan_weak_callback_info"><b><code>Nan::WeakCallbackInfo</code></b></a>
+ - <a href="doc/persistent.md#api_nan_weak_callback_type"><b><code>Nan::WeakCallbackType</code></b></a>
+
+Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles).
+
+### New
+
+NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8.
+
+ - <a href="doc/new.md#api_nan_new"><b><code>Nan::New()</code></b></a>
+ - <a href="doc/new.md#api_nan_undefined"><b><code>Nan::Undefined()</code></b></a>
+ - <a href="doc/new.md#api_nan_null"><b><code>Nan::Null()</code></b></a>
+ - <a href="doc/new.md#api_nan_true"><b><code>Nan::True()</code></b></a>
+ - <a href="doc/new.md#api_nan_false"><b><code>Nan::False()</code></b></a>
+ - <a href="doc/new.md#api_nan_empty_string"><b><code>Nan::EmptyString()</code></b></a>
+
+
+### Converters
+
+NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN.
+
+ - <a href="doc/converters.md#api_nan_to"><b><code>Nan::To()</code></b></a>
+
+### Maybe Types
+
+The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_.
+
+* **Maybe Types**
+  - <a href="doc/maybe_types.md#api_nan_maybe_local"><b><code>Nan::MaybeLocal</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_maybe"><b><code>Nan::Maybe</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_nothing"><b><code>Nan::Nothing</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_just"><b><code>Nan::Just</code></b></a>
+* **Maybe Helpers**
+  - <a href="doc/maybe_types.md#api_nan_call"><b><code>Nan::Call()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_to_detail_string"><b><code>Nan::ToDetailString()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_to_array_index"><b><code>Nan::ToArrayIndex()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_equals"><b><code>Nan::Equals()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_new_instance"><b><code>Nan::NewInstance()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_function"><b><code>Nan::GetFunction()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_set"><b><code>Nan::Set()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_define_own_property"><b><code>Nan::DefineOwnProperty()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_force_set"><del><b><code>Nan::ForceSet()</code></b></del></a>
+  - <a href="doc/maybe_types.md#api_nan_get"><b><code>Nan::Get()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_property_attribute"><b><code>Nan::GetPropertyAttributes()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_has"><b><code>Nan::Has()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_delete"><b><code>Nan::Delete()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_property_names"><b><code>Nan::GetPropertyNames()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_own_property_names"><b><code>Nan::GetOwnPropertyNames()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_set_prototype"><b><code>Nan::SetPrototype()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_object_proto_to_string"><b><code>Nan::ObjectProtoToString()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_has_own_property"><b><code>Nan::HasOwnProperty()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_has_real_named_property"><b><code>Nan::HasRealNamedProperty()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_has_real_indexed_property"><b><code>Nan::HasRealIndexedProperty()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_has_real_named_callback_property"><b><code>Nan::HasRealNamedCallbackProperty()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_real_named_property_in_prototype_chain"><b><code>Nan::GetRealNamedPropertyInPrototypeChain()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_real_named_property"><b><code>Nan::GetRealNamedProperty()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_call_as_function"><b><code>Nan::CallAsFunction()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_call_as_constructor"><b><code>Nan::CallAsConstructor()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_source_line"><b><code>Nan::GetSourceLine()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_line_number"><b><code>Nan::GetLineNumber()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_start_column"><b><code>Nan::GetStartColumn()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_end_column"><b><code>Nan::GetEndColumn()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_clone_element_at"><b><code>Nan::CloneElementAt()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_has_private"><b><code>Nan::HasPrivate()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_get_private"><b><code>Nan::GetPrivate()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_set_private"><b><code>Nan::SetPrivate()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_delete_private"><b><code>Nan::DeletePrivate()</code></b></a>
+  - <a href="doc/maybe_types.md#api_nan_make_maybe"><b><code>Nan::MakeMaybe()</code></b></a>
+
+### Script
+
+NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8.
+
+ - <a href="doc/script.md#api_nan_compile_script"><b><code>Nan::CompileScript()</code></b></a>
+ - <a href="doc/script.md#api_nan_run_script"><b><code>Nan::RunScript()</code></b></a>
+
+
+### JSON
+
+The _JSON_ object provides the C++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object.
+
+ - <a href="doc/json.md#api_nan_json_parse"><b><code>Nan::JSON.Parse</code></b></a>
+ - <a href="doc/json.md#api_nan_json_stringify"><b><code>Nan::JSON.Stringify</code></b></a>
+
+Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments.
+
+### Errors
+
+NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted.
+
+Note that an Error object is simply a specialized form of `v8::Value`.
+
+Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information.
+
+ - <a href="doc/errors.md#api_nan_error"><b><code>Nan::Error()</code></b></a>
+ - <a href="doc/errors.md#api_nan_range_error"><b><code>Nan::RangeError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_reference_error"><b><code>Nan::ReferenceError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_syntax_error"><b><code>Nan::SyntaxError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_type_error"><b><code>Nan::TypeError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_throw_error"><b><code>Nan::ThrowError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_throw_range_error"><b><code>Nan::ThrowRangeError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_throw_reference_error"><b><code>Nan::ThrowReferenceError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_throw_syntax_error"><b><code>Nan::ThrowSyntaxError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_throw_type_error"><b><code>Nan::ThrowTypeError()</code></b></a>
+ - <a href="doc/errors.md#api_nan_fatal_exception"><b><code>Nan::FatalException()</code></b></a>
+ - <a href="doc/errors.md#api_nan_errno_exception"><b><code>Nan::ErrnoException()</code></b></a>
+ - <a href="doc/errors.md#api_nan_try_catch"><b><code>Nan::TryCatch</code></b></a>
+
+
+### Buffers
+
+NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility.
+
+ - <a href="doc/buffers.md#api_nan_new_buffer"><b><code>Nan::NewBuffer()</code></b></a>
+ - <a href="doc/buffers.md#api_nan_copy_buffer"><b><code>Nan::CopyBuffer()</code></b></a>
+ - <a href="doc/buffers.md#api_nan_free_callback"><b><code>Nan::FreeCallback()</code></b></a>
+
+### Nan::Callback
+
+`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution.
+
+ - <a href="doc/callback.md#api_nan_callback"><b><code>Nan::Callback</code></b></a>
+
+### Asynchronous work helpers
+
+`Nan::AsyncWorker`, `Nan::AsyncProgressWorker` and `Nan::AsyncProgressQueueWorker` are helper classes that make working with asynchronous code easier.
+
+ - <a href="doc/asyncworker.md#api_nan_async_worker"><b><code>Nan::AsyncWorker</code></b></a>
+ - <a href="doc/asyncworker.md#api_nan_async_progress_worker"><b><code>Nan::AsyncProgressWorkerBase &amp; Nan::AsyncProgressWorker</code></b></a>
+ - <a href="doc/asyncworker.md#api_nan_async_progress_queue_worker"><b><code>Nan::AsyncProgressQueueWorker</code></b></a>
+ - <a href="doc/asyncworker.md#api_nan_async_queue_worker"><b><code>Nan::AsyncQueueWorker</code></b></a>
+
+### Strings & Bytes
+
+Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing.
+
+ - <a href="doc/string_bytes.md#api_nan_encoding"><b><code>Nan::Encoding</code></b></a>
+ - <a href="doc/string_bytes.md#api_nan_encode"><b><code>Nan::Encode()</code></b></a>
+ - <a href="doc/string_bytes.md#api_nan_decode_bytes"><b><code>Nan::DecodeBytes()</code></b></a>
+ - <a href="doc/string_bytes.md#api_nan_decode_write"><b><code>Nan::DecodeWrite()</code></b></a>
+
+
+### Object Wrappers
+
+The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects.
+
+ - <a href="doc/object_wrappers.md#api_nan_object_wrap"><b><code>Nan::ObjectWrap</code></b></a>
+
+
+### V8 internals
+
+The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods.
+
+ - <a href="doc/v8_internals.md#api_nan_gc_callback"><b><code>NAN_GC_CALLBACK()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_add_gc_epilogue_callback"><b><code>Nan::AddGCEpilogueCallback()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_remove_gc_epilogue_callback"><b><code>Nan::RemoveGCEpilogueCallback()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_add_gc_prologue_callback"><b><code>Nan::AddGCPrologueCallback()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_remove_gc_prologue_callback"><b><code>Nan::RemoveGCPrologueCallback()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_get_heap_statistics"><b><code>Nan::GetHeapStatistics()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_set_counter_function"><b><code>Nan::SetCounterFunction()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_set_create_histogram_function"><b><code>Nan::SetCreateHistogramFunction()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_set_add_histogram_sample_function"><b><code>Nan::SetAddHistogramSampleFunction()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_idle_notification"><b><code>Nan::IdleNotification()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_low_memory_notification"><b><code>Nan::LowMemoryNotification()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_context_disposed_notification"><b><code>Nan::ContextDisposedNotification()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_get_internal_field_pointer"><b><code>Nan::GetInternalFieldPointer()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_set_internal_field_pointer"><b><code>Nan::SetInternalFieldPointer()</code></b></a>
+ - <a href="doc/v8_internals.md#api_nan_adjust_external_memory"><b><code>Nan::AdjustExternalMemory()</code></b></a>
+
+
+### Miscellaneous V8 Helpers
+
+ - <a href="doc/v8_misc.md#api_nan_utf8_string"><b><code>Nan::Utf8String</code></b></a>
+ - <a href="doc/v8_misc.md#api_nan_get_current_context"><b><code>Nan::GetCurrentContext()</code></b></a>
+ - <a href="doc/v8_misc.md#api_nan_set_isolate_data"><b><code>Nan::SetIsolateData()</code></b></a>
+ - <a href="doc/v8_misc.md#api_nan_get_isolate_data"><b><code>Nan::GetIsolateData()</code></b></a>
+ - <a href="doc/v8_misc.md#api_nan_typedarray_contents"><b><code>Nan::TypedArrayContents</code></b></a>
+
+
+### Miscellaneous Node Helpers
+
+ - <a href="doc/node_misc.md#api_nan_asyncresource"><b><code>Nan::AsyncResource</code></b></a>
+ - <a href="doc/node_misc.md#api_nan_make_callback"><b><code>Nan::MakeCallback()</code></b></a>
+ - <a href="doc/node_misc.md#api_nan_module_init"><b><code>NAN_MODULE_INIT()</code></b></a>
+ - <a href="doc/node_misc.md#api_nan_export"><b><code>Nan::Export()</code></b></a>
+
+<!-- END API -->
+
+
+<a name="tests"></a>
+
+### Tests
+
+To run the NAN tests do:
+
+``` sh
+npm install
+npm run-script rebuild-tests
+npm test
+```
+
+Or just:
+
+``` sh
+npm install
+make test
+```
+
+<a name="issues"></a>
+
+## Known issues
+
+### Compiling against Node.js 0.12 on OSX
+
+With new enough compilers available on OSX, the versions of V8 headers corresponding to Node.js 0.12
+do not compile anymore. The error looks something like:
+
+```
+❯   CXX(target) Release/obj.target/accessors/cpp/accessors.o
+In file included from ../cpp/accessors.cpp:9:
+In file included from ../../nan.h:51:
+In file included from /Users/ofrobots/.node-gyp/0.12.18/include/node/node.h:61:
+/Users/ofrobots/.node-gyp/0.12.18/include/node/v8.h:5800:54: error: 'CreateHandle' is a protected member of 'v8::HandleScope'
+  return Handle<T>(reinterpret_cast<T*>(HandleScope::CreateHandle(
+                                        ~~~~~~~~~~~~~^~~~~~~~~~~~
+```
+
+This can be worked around by patching your local versions of v8.h corresponding to Node 0.12 to make
+`v8::Handle` a friend of `v8::HandleScope`. Since neither Node.js not V8 support this release line anymore
+this patch cannot be released by either project in an official release.
+
+For this reason, we do not test against Node.js 0.12 on OSX in this project's CI. If you need to support
+that configuration, you will need to either get an older compiler, or apply a source patch to the version
+of V8 headers as a workaround.
+
+<a name="governance"></a>
+
+## Governance & Contributing
+
+NAN is governed by the [Node.js Addon API Working Group](https://github.com/nodejs/CTC/blob/master/WORKING_GROUPS.md#addon-api)
+
+### Addon API Working Group (WG)
+
+The NAN project is jointly governed by a Working Group which is responsible for high-level guidance of the project.
+
+Members of the WG are also known as Collaborators, there is no distinction between the two, unlike other Node.js projects.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project [README.md](./README.md#collaborators).
+
+Individuals making significant and valuable contributions are made members of the WG and given commit-access to the project. These individuals are identified by the WG and their addition to the WG is discussed via GitHub and requires unanimous consensus amongst those WG members participating in the discussion with a quorum of 50% of WG members required for acceptance of the vote.
+
+_Note:_ If you make a significant contribution and are not considered for commit-access log an issue or contact a WG member directly.
+
+For the current list of WG members / Collaborators, see the project [README.md](./README.md#collaborators).
+
+### Consensus Seeking Process
+
+The WG follows a [Consensus Seeking](https://en.wikipedia.org/wiki/Consensus-seeking_decision-making) decision making model.
+
+Modifications of the contents of the NAN repository are made on a collaborative basis. Anybody with a GitHub account may propose a modification via pull request and it will be considered by the WG. All pull requests must be reviewed and accepted by a WG member with sufficient expertise who is able to take full responsibility for the change. In the case of pull requests proposed by an existing WG member, an additional WG member is required for sign-off. Consensus should be sought if additional WG members participate and there is disagreement around a particular modification.
+
+If a change proposal cannot reach a consensus, a WG member can call for a vote amongst the members of the WG. Simple majority wins.
+
+<a id="developers-certificate-of-origin"></a>
+
+## Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+  have the right to submit it under the open source license
+  indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+  of my knowledge, is covered under an appropriate open source
+  license and I have the right under that license to submit that
+  work with modifications, whether created in whole or in part
+  by me, under the same open source license (unless I am
+  permitted to submit under a different license), as indicated
+  in the file; or
+
+* (c) The contribution was provided directly to me by some other
+  person who certified (a), (b) or (c) and I have not modified
+  it.
+
+* (d) I understand and agree that this project and the contribution
+  are public and that a record of the contribution (including all
+  personal information I submit with it, including my sign-off) is
+  maintained indefinitely and may be redistributed consistent with
+  this project or the open source license(s) involved.
+
+<a name="collaborators"></a>
+
+### WG Members / Collaborators
+
+<table><tbody>
+<tr><th align="left">Rod Vagg</th><td><a href="https://github.com/rvagg">GitHub/rvagg</a></td><td><a href="http://twitter.com/rvagg">Twitter/@rvagg</a></td></tr>
+<tr><th align="left">Benjamin Byholm</th><td><a href="https://github.com/kkoopa/">GitHub/kkoopa</a></td><td>-</td></tr>
+<tr><th align="left">Trevor Norris</th><td><a href="https://github.com/trevnorris">GitHub/trevnorris</a></td><td><a href="http://twitter.com/trevnorris">Twitter/@trevnorris</a></td></tr>
+<tr><th align="left">Nathan Rajlich</th><td><a href="https://github.com/TooTallNate">GitHub/TooTallNate</a></td><td><a href="http://twitter.com/TooTallNate">Twitter/@TooTallNate</a></td></tr>
+<tr><th align="left">Brett Lawson</th><td><a href="https://github.com/brett19">GitHub/brett19</a></td><td><a href="http://twitter.com/brett19x">Twitter/@brett19x</a></td></tr>
+<tr><th align="left">Ben Noordhuis</th><td><a href="https://github.com/bnoordhuis">GitHub/bnoordhuis</a></td><td><a href="http://twitter.com/bnoordhuis">Twitter/@bnoordhuis</a></td></tr>
+<tr><th align="left">David Siegel</th><td><a href="https://github.com/agnat">GitHub/agnat</a></td><td><a href="http://twitter.com/agnat">Twitter/@agnat</a></td></tr>
+<tr><th align="left">Michael Ira Krufky</th><td><a href="https://github.com/mkrufky">GitHub/mkrufky</a></td><td><a href="http://twitter.com/mkrufky">Twitter/@mkrufky</a></td></tr>
+</tbody></table>
+
+## Licence &amp; copyright
+
+Copyright (c) 2018 NAN WG Members / Collaborators (listed above).
+
+Native Abstractions for Node.js is licensed under an MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/asyncworker.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/asyncworker.md
new file mode 100644 (file)
index 0000000..04231f8
--- /dev/null
@@ -0,0 +1,146 @@
+## Asynchronous work helpers
+
+`Nan::AsyncWorker`, `Nan::AsyncProgressWorker` and `Nan::AsyncProgressQueueWorker` are helper classes that make working with asynchronous code easier.
+
+ - <a href="#api_nan_async_worker"><b><code>Nan::AsyncWorker</code></b></a>
+ - <a href="#api_nan_async_progress_worker"><b><code>Nan::AsyncProgressWorkerBase &amp; Nan::AsyncProgressWorker</code></b></a>
+ - <a href="#api_nan_async_progress_queue_worker"><b><code>Nan::AsyncProgressQueueWorker</code></b></a>
+ - <a href="#api_nan_async_queue_worker"><b><code>Nan::AsyncQueueWorker</code></b></a>
+
+<a name="api_nan_async_worker"></a>
+### Nan::AsyncWorker
+
+`Nan::AsyncWorker` is an _abstract_ class that you can subclass to have much of the annoying asynchronous queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the asynchronous work is in progress.
+
+This class internally handles the details of creating an [`AsyncResource`][AsyncResource], and running the callback in the
+correct async context. To be able to identify the async resources created by this class in async-hooks, provide a
+`resource_name` to the constructor. It is recommended that the module name be used as a prefix to the `resource_name` to avoid
+collisions in the names. For more details see [`AsyncResource`][AsyncResource] documentation.  The `resource_name` needs to stay valid for the lifetime of the worker instance.
+
+Definition:
+
+```c++
+class AsyncWorker {
+ public:
+  explicit AsyncWorker(Callback *callback_, const char* resource_name = "nan:AsyncWorker");
+
+  virtual ~AsyncWorker();
+
+  virtual void WorkComplete();
+
+  void SaveToPersistent(const char *key, const v8::Local<v8::Value> &value);
+
+  void SaveToPersistent(const v8::Local<v8::String> &key,
+                        const v8::Local<v8::Value> &value);
+
+  void SaveToPersistent(uint32_t index,
+                        const v8::Local<v8::Value> &value);
+
+  v8::Local<v8::Value> GetFromPersistent(const char *key) const;
+
+  v8::Local<v8::Value> GetFromPersistent(const v8::Local<v8::String> &key) const;
+
+  v8::Local<v8::Value> GetFromPersistent(uint32_t index) const;
+
+  virtual void Execute() = 0;
+
+  uv_work_t request;
+
+  virtual void Destroy();
+
+ protected:
+  Persistent<v8::Object> persistentHandle;
+
+  Callback *callback;
+
+  virtual void HandleOKCallback();
+
+  virtual void HandleErrorCallback();
+
+  void SetErrorMessage(const char *msg);
+
+  const char* ErrorMessage();
+};
+```
+
+<a name="api_nan_async_progress_worker"></a>
+### Nan::AsyncProgressWorkerBase &amp; Nan::AsyncProgressWorker
+
+`Nan::AsyncProgressWorkerBase` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript.
+
+Previously the definition of `Nan::AsyncProgressWorker` only allowed sending `const char` data. Now extending `Nan::AsyncProgressWorker` will yield an instance of the implicit `Nan::AsyncProgressWorkerBase` template with type `<char>` for compatibility.
+
+`Nan::AsyncProgressWorkerBase` &amp; `Nan::AsyncProgressWorker` is intended for best-effort delivery of nonessential progress messages, e.g. a progress bar.  The last event sent before the main thread is woken will be delivered.
+
+Definition:
+
+```c++
+template<class T>
+class AsyncProgressWorkerBase<T> : public AsyncWorker {
+ public:
+  explicit AsyncProgressWorkerBase(Callback *callback_, const char* resource_name = ...);
+
+  virtual ~AsyncProgressWorkerBase();
+
+  void WorkProgress();
+
+  class ExecutionProgress {
+   public:
+    void Signal() const;
+    void Send(const T* data, size_t count) const;
+  };
+
+  virtual void Execute(const ExecutionProgress& progress) = 0;
+
+  virtual void HandleProgressCallback(const T *data, size_t count) = 0;
+
+  virtual void Destroy();
+};
+
+typedef AsyncProgressWorkerBase<T> AsyncProgressWorker;
+```
+
+<a name="api_nan_async_progress_queue_worker"></a>
+### Nan::AsyncProgressQueueWorker
+
+`Nan::AsyncProgressQueueWorker` is an _abstract_ class template that extends `Nan::AsyncWorker` and adds additional progress reporting callbacks that can be used during the asynchronous work execution to provide progress data back to JavaScript.
+
+`Nan::AsyncProgressQueueWorker` behaves exactly the same as `Nan::AsyncProgressWorker`, except all events are queued and delivered to the main thread.
+
+Definition:
+
+```c++
+template<class T>
+class AsyncProgressQueueWorker<T> : public AsyncWorker {
+ public:
+  explicit AsyncProgressQueueWorker(Callback *callback_, const char* resource_name = "nan:AsyncProgressQueueWorker");
+
+  virtual ~AsyncProgressQueueWorker();
+
+  void WorkProgress();
+
+  class ExecutionProgress {
+   public:
+    void Send(const T* data, size_t count) const;
+  };
+
+  virtual void Execute(const ExecutionProgress& progress) = 0;
+
+  virtual void HandleProgressCallback(const T *data, size_t count) = 0;
+
+  virtual void Destroy();
+};
+```
+
+<a name="api_nan_async_queue_worker"></a>
+### Nan::AsyncQueueWorker
+
+`Nan::AsyncQueueWorker` will run a `Nan::AsyncWorker` asynchronously via libuv. Both the `execute` and `after_work` steps are taken care of for you. Most of the logic for this is embedded in `Nan::AsyncWorker`.
+
+Definition:
+
+```c++
+void AsyncQueueWorker(AsyncWorker *);
+```
+
+[AsyncResource]: node_misc.md#api_nan_asyncresource
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/buffers.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/buffers.md
new file mode 100644 (file)
index 0000000..8d8d25c
--- /dev/null
@@ -0,0 +1,54 @@
+## Buffers
+
+NAN's `node::Buffer` helpers exist as the API has changed across supported Node versions. Use these methods to ensure compatibility.
+
+ - <a href="#api_nan_new_buffer"><b><code>Nan::NewBuffer()</code></b></a>
+ - <a href="#api_nan_copy_buffer"><b><code>Nan::CopyBuffer()</code></b></a>
+ - <a href="#api_nan_free_callback"><b><code>Nan::FreeCallback()</code></b></a>
+
+<a name="api_nan_new_buffer"></a>
+### Nan::NewBuffer()
+
+Allocate a new `node::Buffer` object with the specified size and optional data. Calls `node::Buffer::New()`.
+
+Note that when creating a `Buffer` using `Nan::NewBuffer()` and an existing `char*`, it is assumed that the ownership of the pointer is being transferred to the new `Buffer` for management.
+When a `node::Buffer` instance is garbage collected and a `FreeCallback` has not been specified, `data` will be disposed of via a call to `free()`.
+You _must not_ free the memory space manually once you have created a `Buffer` in this way.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Object> Nan::NewBuffer(uint32_t size)
+Nan::MaybeLocal<v8::Object> Nan::NewBuffer(char* data, uint32_t size)
+Nan::MaybeLocal<v8::Object> Nan::NewBuffer(char *data,
+                                           size_t length,
+                                           Nan::FreeCallback callback,
+                                           void *hint)
+```
+
+
+<a name="api_nan_copy_buffer"></a>
+### Nan::CopyBuffer()
+
+Similar to [`Nan::NewBuffer()`](#api_nan_new_buffer) except that an implicit memcpy will occur within Node. Calls `node::Buffer::Copy()`.
+
+Management of the `char*` is left to the user, you should manually free the memory space if necessary as the new `Buffer` will have its own copy.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Object> Nan::CopyBuffer(const char *data, uint32_t size)
+```
+
+
+<a name="api_nan_free_callback"></a>
+### Nan::FreeCallback()
+
+A free callback that can be provided to [`Nan::NewBuffer()`](#api_nan_new_buffer).
+The supplied callback will be invoked when the `Buffer` undergoes garbage collection.
+
+Signature:
+
+```c++
+typedef void (*FreeCallback)(char *data, void *hint);
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/callback.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/callback.md
new file mode 100644 (file)
index 0000000..f7af0bf
--- /dev/null
@@ -0,0 +1,76 @@
+## Nan::Callback
+
+`Nan::Callback` makes it easier to use `v8::Function` handles as callbacks. A class that wraps a `v8::Function` handle, protecting it from garbage collection and making it particularly useful for storage and use across asynchronous execution.
+
+ - <a href="#api_nan_callback"><b><code>Nan::Callback</code></b></a>
+
+<a name="api_nan_callback"></a>
+### Nan::Callback
+
+```c++
+class Callback {
+ public:
+  Callback();
+
+  explicit Callback(const v8::Local<v8::Function> &fn);
+
+  ~Callback();
+
+  bool operator==(const Callback &other) const;
+
+  bool operator!=(const Callback &other) const;
+
+  v8::Local<v8::Function> operator*() const;
+
+  MaybeLocal<v8::Value> operator()(AsyncResource* async_resource,
+                                   v8::Local<v8::Object> target,
+                                   int argc = 0,
+                                   v8::Local<v8::Value> argv[] = 0) const;
+
+  MaybeLocal<v8::Value> operator()(AsyncResource* async_resource,
+                                   int argc = 0,
+                                   v8::Local<v8::Value> argv[] = 0) const;
+
+  void SetFunction(const v8::Local<v8::Function> &fn);
+
+  v8::Local<v8::Function> GetFunction() const;
+
+  bool IsEmpty() const;
+
+  void Reset(const v8::Local<v8::Function> &fn);
+
+  void Reset();
+
+  MaybeLocal<v8::Value> Call(v8::Local<v8::Object> target,
+                            int argc,
+                            v8::Local<v8::Value> argv[],
+                            AsyncResource* async_resource) const;
+  MaybeLocal<v8::Value> Call(int argc,
+                             v8::Local<v8::Value> argv[],
+                             AsyncResource* async_resource) const;
+
+  // Deprecated versions. Use the versions that accept an async_resource instead
+  // as they run the callback in the correct async context as specified by the
+  // resource. If you want to call a synchronous JS function (i.e. on a
+  // non-empty JS stack), you can use Nan::Call instead.
+  v8::Local<v8::Value> operator()(v8::Local<v8::Object> target,
+                                  int argc = 0,
+                                  v8::Local<v8::Value> argv[] = 0) const;
+
+  v8::Local<v8::Value> operator()(int argc = 0,
+                                  v8::Local<v8::Value> argv[] = 0) const;
+  v8::Local<v8::Value> Call(v8::Local<v8::Object> target,
+                            int argc,
+                            v8::Local<v8::Value> argv[]) const;
+
+  v8::Local<v8::Value> Call(int argc, v8::Local<v8::Value> argv[]) const;
+};
+```
+
+Example usage:
+
+```c++
+v8::Local<v8::Function> function;
+Nan::Callback callback(function);
+callback.Call(0, 0);
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/converters.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/converters.md
new file mode 100644 (file)
index 0000000..d20861b
--- /dev/null
@@ -0,0 +1,41 @@
+## Converters
+
+NAN contains functions that convert `v8::Value`s to other `v8::Value` types and native types. Since type conversion is not guaranteed to succeed, they return `Nan::Maybe` types. These converters can be used in place of `value->ToX()` and `value->XValue()` (where `X` is one of the types, e.g. `Boolean`) in a way that provides a consistent interface across V8 versions. Newer versions of V8 use the new `v8::Maybe` and `v8::MaybeLocal` types for these conversions, older versions don't have this functionality so it is provided by NAN.
+
+ - <a href="#api_nan_to"><b><code>Nan::To()</code></b></a>
+
+<a name="api_nan_to"></a>
+### Nan::To()
+
+Converts a `v8::Local<v8::Value>` to a different subtype of `v8::Value` or to a native data type. Returns a `Nan::MaybeLocal<>` or a `Nan::Maybe<>` accordingly.
+
+See [maybe_types.md](./maybe_types.md) for more information on `Nan::Maybe` types.
+
+Signatures:
+
+```c++
+// V8 types
+Nan::MaybeLocal<v8::Boolean> Nan::To<v8::Boolean>(v8::Local<v8::Value> val);
+Nan::MaybeLocal<v8::Int32> Nan::To<v8::Int32>(v8::Local<v8::Value> val);
+Nan::MaybeLocal<v8::Integer> Nan::To<v8::Integer>(v8::Local<v8::Value> val);
+Nan::MaybeLocal<v8::Object> Nan::To<v8::Object>(v8::Local<v8::Value> val);
+Nan::MaybeLocal<v8::Number> Nan::To<v8::Number>(v8::Local<v8::Value> val);
+Nan::MaybeLocal<v8::String> Nan::To<v8::String>(v8::Local<v8::Value> val);
+Nan::MaybeLocal<v8::Uint32> Nan::To<v8::Uint32>(v8::Local<v8::Value> val);
+
+// Native types
+Nan::Maybe<bool> Nan::To<bool>(v8::Local<v8::Value> val);
+Nan::Maybe<double> Nan::To<double>(v8::Local<v8::Value> val);
+Nan::Maybe<int32_t> Nan::To<int32_t>(v8::Local<v8::Value> val);
+Nan::Maybe<int64_t> Nan::To<int64_t>(v8::Local<v8::Value> val);
+Nan::Maybe<uint32_t> Nan::To<uint32_t>(v8::Local<v8::Value> val);
+```
+
+### Example
+
+```c++
+v8::Local<v8::Value> val;
+Nan::MaybeLocal<v8::String> str = Nan::To<v8::String>(val);
+Nan::Maybe<double> d = Nan::To<double>(val);
+```
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/errors.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/errors.md
new file mode 100644 (file)
index 0000000..843435b
--- /dev/null
@@ -0,0 +1,226 @@
+## Errors
+
+NAN includes helpers for creating, throwing and catching Errors as much of this functionality varies across the supported versions of V8 and must be abstracted.
+
+Note that an Error object is simply a specialized form of `v8::Value`.
+
+Also consult the V8 Embedders Guide section on [Exceptions](https://developers.google.com/v8/embed#exceptions) for more information.
+
+ - <a href="#api_nan_error"><b><code>Nan::Error()</code></b></a>
+ - <a href="#api_nan_range_error"><b><code>Nan::RangeError()</code></b></a>
+ - <a href="#api_nan_reference_error"><b><code>Nan::ReferenceError()</code></b></a>
+ - <a href="#api_nan_syntax_error"><b><code>Nan::SyntaxError()</code></b></a>
+ - <a href="#api_nan_type_error"><b><code>Nan::TypeError()</code></b></a>
+ - <a href="#api_nan_throw_error"><b><code>Nan::ThrowError()</code></b></a>
+ - <a href="#api_nan_throw_range_error"><b><code>Nan::ThrowRangeError()</code></b></a>
+ - <a href="#api_nan_throw_reference_error"><b><code>Nan::ThrowReferenceError()</code></b></a>
+ - <a href="#api_nan_throw_syntax_error"><b><code>Nan::ThrowSyntaxError()</code></b></a>
+ - <a href="#api_nan_throw_type_error"><b><code>Nan::ThrowTypeError()</code></b></a>
+ - <a href="#api_nan_fatal_exception"><b><code>Nan::FatalException()</code></b></a>
+ - <a href="#api_nan_errno_exception"><b><code>Nan::ErrnoException()</code></b></a>
+ - <a href="#api_nan_try_catch"><b><code>Nan::TryCatch</code></b></a>
+
+
+<a name="api_nan_error"></a>
+### Nan::Error()
+
+Create a new Error object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
+
+Note that an Error object is simply a specialized form of `v8::Value`.
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::Error(const char *msg);
+v8::Local<v8::Value> Nan::Error(v8::Local<v8::String> msg);
+```
+
+
+<a name="api_nan_range_error"></a>
+### Nan::RangeError()
+
+Create a new RangeError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
+
+Note that an RangeError object is simply a specialized form of `v8::Value`.
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::RangeError(const char *msg);
+v8::Local<v8::Value> Nan::RangeError(v8::Local<v8::String> msg);
+```
+
+
+<a name="api_nan_reference_error"></a>
+### Nan::ReferenceError()
+
+Create a new ReferenceError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
+
+Note that an ReferenceError object is simply a specialized form of `v8::Value`.
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::ReferenceError(const char *msg);
+v8::Local<v8::Value> Nan::ReferenceError(v8::Local<v8::String> msg);
+```
+
+
+<a name="api_nan_syntax_error"></a>
+### Nan::SyntaxError()
+
+Create a new SyntaxError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
+
+Note that an SyntaxError object is simply a specialized form of `v8::Value`.
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::SyntaxError(const char *msg);
+v8::Local<v8::Value> Nan::SyntaxError(v8::Local<v8::String> msg);
+```
+
+
+<a name="api_nan_type_error"></a>
+### Nan::TypeError()
+
+Create a new TypeError object using the [v8::Exception](https://v8docs.nodesource.com/node-8.16/da/d6a/classv8_1_1_exception.html) class in a way that is compatible across the supported versions of V8.
+
+Note that an TypeError object is simply a specialized form of `v8::Value`.
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::TypeError(const char *msg);
+v8::Local<v8::Value> Nan::TypeError(v8::Local<v8::String> msg);
+```
+
+
+<a name="api_nan_throw_error"></a>
+### Nan::ThrowError()
+
+Throw an Error object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new Error object will be created.
+
+Signature:
+
+```c++
+void Nan::ThrowError(const char *msg);
+void Nan::ThrowError(v8::Local<v8::String> msg);
+void Nan::ThrowError(v8::Local<v8::Value> error);
+```
+
+
+<a name="api_nan_throw_range_error"></a>
+### Nan::ThrowRangeError()
+
+Throw an RangeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new RangeError object will be created.
+
+Signature:
+
+```c++
+void Nan::ThrowRangeError(const char *msg);
+void Nan::ThrowRangeError(v8::Local<v8::String> msg);
+void Nan::ThrowRangeError(v8::Local<v8::Value> error);
+```
+
+
+<a name="api_nan_throw_reference_error"></a>
+### Nan::ThrowReferenceError()
+
+Throw an ReferenceError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new ReferenceError object will be created.
+
+Signature:
+
+```c++
+void Nan::ThrowReferenceError(const char *msg);
+void Nan::ThrowReferenceError(v8::Local<v8::String> msg);
+void Nan::ThrowReferenceError(v8::Local<v8::Value> error);
+```
+
+
+<a name="api_nan_throw_syntax_error"></a>
+### Nan::ThrowSyntaxError()
+
+Throw an SyntaxError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new SyntaxError object will be created.
+
+Signature:
+
+```c++
+void Nan::ThrowSyntaxError(const char *msg);
+void Nan::ThrowSyntaxError(v8::Local<v8::String> msg);
+void Nan::ThrowSyntaxError(v8::Local<v8::Value> error);
+```
+
+
+<a name="api_nan_throw_type_error"></a>
+### Nan::ThrowTypeError()
+
+Throw an TypeError object (a specialized `v8::Value` as above) in the current context. If a `msg` is provided, a new TypeError object will be created.
+
+Signature:
+
+```c++
+void Nan::ThrowTypeError(const char *msg);
+void Nan::ThrowTypeError(v8::Local<v8::String> msg);
+void Nan::ThrowTypeError(v8::Local<v8::Value> error);
+```
+
+<a name="api_nan_fatal_exception"></a>
+### Nan::FatalException()
+
+Replaces `node::FatalException()` which has a different API across supported versions of Node. For use with [`Nan::TryCatch`](#api_nan_try_catch).
+
+Signature:
+
+```c++
+void Nan::FatalException(const Nan::TryCatch& try_catch);
+```
+
+<a name="api_nan_errno_exception"></a>
+### Nan::ErrnoException()
+
+Replaces `node::ErrnoException()` which has a different API across supported versions of Node. 
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::ErrnoException(int errorno,
+                                         const char* syscall = NULL,
+                                         const char* message = NULL,
+                                         const char* path = NULL);
+```
+
+
+<a name="api_nan_try_catch"></a>
+### Nan::TryCatch
+
+A simple wrapper around [`v8::TryCatch`](https://v8docs.nodesource.com/node-8.16/d4/dc6/classv8_1_1_try_catch.html) compatible with all supported versions of V8. Can be used as a direct replacement in most cases. See also [`Nan::FatalException()`](#api_nan_fatal_exception) for an internal use compatible with `node::FatalException`.
+
+Signature:
+
+```c++
+class Nan::TryCatch {
+ public:
+  Nan::TryCatch();
+
+  bool HasCaught() const;
+
+  bool CanContinue() const;
+
+  v8::Local<v8::Value> ReThrow();
+
+  v8::Local<v8::Value> Exception() const;
+
+  // Nan::MaybeLocal for older versions of V8
+  v8::MaybeLocal<v8::Value> StackTrace() const;
+
+  v8::Local<v8::Message> Message() const;
+
+  void Reset();
+
+  void SetVerbose(bool value);
+
+  void SetCaptureMessage(bool value);
+};
+```
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/json.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/json.md
new file mode 100644 (file)
index 0000000..d142597
--- /dev/null
@@ -0,0 +1,62 @@
+## JSON
+
+The _JSON_ object provides the c++ versions of the methods offered by the `JSON` object in javascript. V8 exposes these methods via the `v8::JSON` object.
+
+ - <a href="#api_nan_json_parse"><b><code>Nan::JSON.Parse</code></b></a>
+ - <a href="#api_nan_json_stringify"><b><code>Nan::JSON.Stringify</code></b></a>
+
+Refer to the V8 JSON object in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html) for more information about these methods and their arguments.
+
+<a name="api_nan_json_parse"></a>
+
+### Nan::JSON.Parse
+
+A simple wrapper around [`v8::JSON::Parse`](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html#a936310d2540fb630ed37d3ee3ffe4504).
+
+Definition:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::JSON::Parse(v8::Local<v8::String> json_string);
+```
+
+Use `JSON.Parse(json_string)` to parse a string into a `v8::Value`.
+
+Example:
+
+```c++
+v8::Local<v8::String> json_string = Nan::New("{ \"JSON\": \"object\" }").ToLocalChecked();
+
+Nan::JSON NanJSON;
+Nan::MaybeLocal<v8::Value> result = NanJSON.Parse(json_string);
+if (!result.IsEmpty()) {
+  v8::Local<v8::Value> val = result.ToLocalChecked();
+}
+```
+
+<a name="api_nan_json_stringify"></a>
+
+### Nan::JSON.Stringify
+
+A simple wrapper around [`v8::JSON::Stringify`](https://v8docs.nodesource.com/node-8.16/da/d6f/classv8_1_1_j_s_o_n.html#a44b255c3531489ce43f6110209138860).
+
+Definition:
+
+```c++
+Nan::MaybeLocal<v8::String> Nan::JSON::Stringify(v8::Local<v8::Object> json_object, v8::Local<v8::String> gap = v8::Local<v8::String>());
+```
+
+Use `JSON.Stringify(value)` to stringify a `v8::Object`.
+
+Example:
+
+```c++
+// using `v8::Local<v8::Value> val` from the `JSON::Parse` example
+v8::Local<v8::Object> obj = Nan::To<v8::Object>(val).ToLocalChecked();
+
+Nan::JSON NanJSON;
+Nan::MaybeLocal<v8::String> result = NanJSON.Stringify(obj);
+if (!result.IsEmpty()) {
+  v8::Local<v8::String> stringified = result.ToLocalChecked();
+}
+```
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/maybe_types.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/maybe_types.md
new file mode 100644 (file)
index 0000000..142851a
--- /dev/null
@@ -0,0 +1,583 @@
+## Maybe Types
+
+The `Nan::MaybeLocal` and `Nan::Maybe` types are monads that encapsulate `v8::Local` handles that _may be empty_.
+
+* **Maybe Types**
+  - <a href="#api_nan_maybe_local"><b><code>Nan::MaybeLocal</code></b></a>
+  - <a href="#api_nan_maybe"><b><code>Nan::Maybe</code></b></a>
+  - <a href="#api_nan_nothing"><b><code>Nan::Nothing</code></b></a>
+  - <a href="#api_nan_just"><b><code>Nan::Just</code></b></a>
+* **Maybe Helpers**
+  - <a href="#api_nan_call"><b><code>Nan::Call()</code></b></a>
+  - <a href="#api_nan_to_detail_string"><b><code>Nan::ToDetailString()</code></b></a>
+  - <a href="#api_nan_to_array_index"><b><code>Nan::ToArrayIndex()</code></b></a>
+  - <a href="#api_nan_equals"><b><code>Nan::Equals()</code></b></a>
+  - <a href="#api_nan_new_instance"><b><code>Nan::NewInstance()</code></b></a>
+  - <a href="#api_nan_get_function"><b><code>Nan::GetFunction()</code></b></a>
+  - <a href="#api_nan_set"><b><code>Nan::Set()</code></b></a>
+  - <a href="#api_nan_define_own_property"><b><code>Nan::DefineOwnProperty()</code></b></a>
+  - <a href="#api_nan_force_set"><del><b><code>Nan::ForceSet()</code></b></del></a>
+  - <a href="#api_nan_get"><b><code>Nan::Get()</code></b></a>
+  - <a href="#api_nan_get_property_attribute"><b><code>Nan::GetPropertyAttributes()</code></b></a>
+  - <a href="#api_nan_has"><b><code>Nan::Has()</code></b></a>
+  - <a href="#api_nan_delete"><b><code>Nan::Delete()</code></b></a>
+  - <a href="#api_nan_get_property_names"><b><code>Nan::GetPropertyNames()</code></b></a>
+  - <a href="#api_nan_get_own_property_names"><b><code>Nan::GetOwnPropertyNames()</code></b></a>
+  - <a href="#api_nan_set_prototype"><b><code>Nan::SetPrototype()</code></b></a>
+  - <a href="#api_nan_object_proto_to_string"><b><code>Nan::ObjectProtoToString()</code></b></a>
+  - <a href="#api_nan_has_own_property"><b><code>Nan::HasOwnProperty()</code></b></a>
+  - <a href="#api_nan_has_real_named_property"><b><code>Nan::HasRealNamedProperty()</code></b></a>
+  - <a href="#api_nan_has_real_indexed_property"><b><code>Nan::HasRealIndexedProperty()</code></b></a>
+  - <a href="#api_nan_has_real_named_callback_property"><b><code>Nan::HasRealNamedCallbackProperty()</code></b></a>
+  - <a href="#api_nan_get_real_named_property_in_prototype_chain"><b><code>Nan::GetRealNamedPropertyInPrototypeChain()</code></b></a>
+  - <a href="#api_nan_get_real_named_property"><b><code>Nan::GetRealNamedProperty()</code></b></a>
+  - <a href="#api_nan_call_as_function"><b><code>Nan::CallAsFunction()</code></b></a>
+  - <a href="#api_nan_call_as_constructor"><b><code>Nan::CallAsConstructor()</code></b></a>
+  - <a href="#api_nan_get_source_line"><b><code>Nan::GetSourceLine()</code></b></a>
+  - <a href="#api_nan_get_line_number"><b><code>Nan::GetLineNumber()</code></b></a>
+  - <a href="#api_nan_get_start_column"><b><code>Nan::GetStartColumn()</code></b></a>
+  - <a href="#api_nan_get_end_column"><b><code>Nan::GetEndColumn()</code></b></a>
+  - <a href="#api_nan_clone_element_at"><b><code>Nan::CloneElementAt()</code></b></a>
+  - <a href="#api_nan_has_private"><b><code>Nan::HasPrivate()</code></b></a>
+  - <a href="#api_nan_get_private"><b><code>Nan::GetPrivate()</code></b></a>
+  - <a href="#api_nan_set_private"><b><code>Nan::SetPrivate()</code></b></a>
+  - <a href="#api_nan_delete_private"><b><code>Nan::DeletePrivate()</code></b></a>
+  - <a href="#api_nan_make_maybe"><b><code>Nan::MakeMaybe()</code></b></a>
+
+<a name="api_nan_maybe_local"></a>
+### Nan::MaybeLocal
+
+A `Nan::MaybeLocal<T>` is a wrapper around [`v8::Local<T>`](https://v8docs.nodesource.com/node-8.16/de/deb/classv8_1_1_local.html) that enforces a check that determines whether the `v8::Local<T>` is empty before it can be used.
+
+If an API method returns a `Nan::MaybeLocal`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, an empty `Nan::MaybeLocal` is returned.
+
+Definition:
+
+```c++
+template<typename T> class Nan::MaybeLocal {
+ public:
+  MaybeLocal();
+
+  template<typename S> MaybeLocal(v8::Local<S> that);
+
+  bool IsEmpty() const;
+
+  template<typename S> bool ToLocal(v8::Local<S> *out);
+
+  // Will crash if the MaybeLocal<> is empty.
+  v8::Local<T> ToLocalChecked();
+
+  template<typename S> v8::Local<S> FromMaybe(v8::Local<S> default_value) const;
+};
+```
+
+See the documentation for [`v8::MaybeLocal`](https://v8docs.nodesource.com/node-8.16/d8/d7d/classv8_1_1_maybe_local.html) for further details.
+
+<a name="api_nan_maybe"></a>
+### Nan::Maybe
+
+A simple `Nan::Maybe` type, representing an object which may or may not have a value, see https://hackage.haskell.org/package/base/docs/Data-Maybe.html.
+
+If an API method returns a `Nan::Maybe<>`, the API method can potentially fail either because an exception is thrown, or because an exception is pending, e.g. because a previous API call threw an exception that hasn't been caught yet, or because a `v8::TerminateExecution` exception was thrown. In that case, a "Nothing" value is returned.
+
+Definition:
+
+```c++
+template<typename T> class Nan::Maybe {
+ public:
+  bool IsNothing() const;
+  bool IsJust() const;
+
+  // Will crash if the Maybe<> is nothing.
+  T FromJust();
+
+  T FromMaybe(const T& default_value);
+
+  bool operator==(const Maybe &other);
+
+  bool operator!=(const Maybe &other);
+};
+```
+
+See the documentation for [`v8::Maybe`](https://v8docs.nodesource.com/node-8.16/d9/d4b/classv8_1_1_maybe.html) for further details.
+
+<a name="api_nan_nothing"></a>
+### Nan::Nothing
+
+Construct an empty `Nan::Maybe` type representing _nothing_.
+
+```c++
+template<typename T> Nan::Maybe<T> Nan::Nothing();
+```
+
+<a name="api_nan_just"></a>
+### Nan::Just
+
+Construct a `Nan::Maybe` type representing _just_ a value.
+
+```c++
+template<typename T> Nan::Maybe<T> Nan::Just(const T &t);
+```
+
+<a name="api_nan_call"></a>
+### Nan::Call()
+
+A helper method for calling a synchronous [`v8::Function#Call()`](https://v8docs.nodesource.com/node-8.16/d5/d54/classv8_1_1_function.html#a9c3d0e4e13ddd7721fce238aa5b94a11) in a way compatible across supported versions of V8.
+
+For asynchronous callbacks, use Nan::Callback::Call along with an AsyncResource.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::Call(v8::Local<v8::Function> fun, v8::Local<v8::Object> recv, int argc, v8::Local<v8::Value> argv[]);
+Nan::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback& callback, v8::Local<v8::Object> recv,
+ int argc, v8::Local<v8::Value> argv[]);
+Nan::MaybeLocal<v8::Value> Nan::Call(const Nan::Callback& callback, int argc, v8::Local<v8::Value> argv[]);
+```
+
+
+<a name="api_nan_to_detail_string"></a>
+### Nan::ToDetailString()
+
+A helper method for calling [`v8::Value#ToDetailString()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#a2f9770296dc2c8d274bc8cc0dca243e5) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::String> Nan::ToDetailString(v8::Local<v8::Value> val);
+```
+
+
+<a name="api_nan_to_array_index"></a>
+### Nan::ToArrayIndex()
+
+A helper method for calling [`v8::Value#ToArrayIndex()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#acc5bbef3c805ec458470c0fcd6f13493) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Uint32> Nan::ToArrayIndex(v8::Local<v8::Value> val);
+```
+
+
+<a name="api_nan_equals"></a>
+### Nan::Equals()
+
+A helper method for calling [`v8::Value#Equals()`](https://v8docs.nodesource.com/node-8.16/dc/d0a/classv8_1_1_value.html#a08fba1d776a59bbf6864b25f9152c64b) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b));
+```
+
+
+<a name="api_nan_new_instance"></a>
+### Nan::NewInstance()
+
+A helper method for calling [`v8::Function#NewInstance()`](https://v8docs.nodesource.com/node-8.16/d5/d54/classv8_1_1_function.html#ae477558b10c14b76ed00e8dbab44ce5b) and [`v8::ObjectTemplate#NewInstance()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#ad605a7543cfbc5dab54cdb0883d14ae4) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h);
+Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h, int argc, v8::Local<v8::Value> argv[]);
+Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::ObjectTemplate> h);
+```
+
+
+<a name="api_nan_get_function"></a>
+### Nan::GetFunction()
+
+A helper method for calling [`v8::FunctionTemplate#GetFunction()`](https://v8docs.nodesource.com/node-8.16/d8/d83/classv8_1_1_function_template.html#a56d904662a86eca78da37d9bb0ed3705) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Function> Nan::GetFunction(v8::Local<v8::FunctionTemplate> t);
+```
+
+
+<a name="api_nan_set"></a>
+### Nan::Set()
+
+A helper method for calling [`v8::Object#Set()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a67604ea3734f170c66026064ea808f20) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::Set(v8::Local<v8::Object> obj,
+                          v8::Local<v8::Value> key,
+                          v8::Local<v8::Value> value)
+Nan::Maybe<bool> Nan::Set(v8::Local<v8::Object> obj,
+                          uint32_t index,
+                          v8::Local<v8::Value> value);
+```
+
+
+<a name="api_nan_define_own_property"></a>
+### Nan::DefineOwnProperty()
+
+A helper method for calling [`v8::Object#DefineOwnProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a6f76b2ed605cb8f9185b92de0033a820) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::DefineOwnProperty(v8::Local<v8::Object> obj,
+                                        v8::Local<v8::String> key,
+                                        v8::Local<v8::Value> value,
+                                        v8::PropertyAttribute attribs = v8::None);
+```
+
+
+<a name="api_nan_force_set"></a>
+### <del>Nan::ForceSet()</del>
+
+Deprecated, use <a href="#api_nan_define_own_property"><code>Nan::DefineOwnProperty()</code></a>.
+
+<del>A helper method for calling [`v8::Object#ForceSet()`](https://v8docs.nodesource.com/node-0.12/db/d85/classv8_1_1_object.html#acfbdfd7427b516ebdb5c47c4df5ed96c) in a way compatible across supported versions of V8.</del>
+
+Signature:
+
+```c++
+NAN_DEPRECATED Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object> obj,
+                                              v8::Local<v8::Value> key,
+                                              v8::Local<v8::Value> value,
+                                              v8::PropertyAttribute attribs = v8::None);
+```
+
+
+<a name="api_nan_get"></a>
+### Nan::Get()
+
+A helper method for calling [`v8::Object#Get()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a2565f03e736694f6b1e1cf22a0b4eac2) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::Get(v8::Local<v8::Object> obj,
+                                    v8::Local<v8::Value> key);
+Nan::MaybeLocal<v8::Value> Nan::Get(v8::Local<v8::Object> obj, uint32_t index);
+```
+
+
+<a name="api_nan_get_property_attribute"></a>
+### Nan::GetPropertyAttributes()
+
+A helper method for calling [`v8::Object#GetPropertyAttributes()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a9b898894da3d1db2714fd9325a54fe57) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<v8::PropertyAttribute> Nan::GetPropertyAttributes(
+    v8::Local<v8::Object> obj,
+    v8::Local<v8::Value> key);
+```
+
+
+<a name="api_nan_has"></a>
+### Nan::Has()
+
+A helper method for calling [`v8::Object#Has()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab3c3d89ea7c2f9afd08965bd7299a41d) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::Has(v8::Local<v8::Object> obj, v8::Local<v8::String> key);
+Nan::Maybe<bool> Nan::Has(v8::Local<v8::Object> obj, uint32_t index);
+```
+
+
+<a name="api_nan_delete"></a>
+### Nan::Delete()
+
+A helper method for calling [`v8::Object#Delete()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a48e4a19b2cedff867eecc73ddb7d377f) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::Delete(v8::Local<v8::Object> obj,
+                             v8::Local<v8::String> key);
+Nan::Maybe<bool> Nan::Delete(v8::Local<v8::Object> obj, uint32_t index);
+```
+
+
+<a name="api_nan_get_property_names"></a>
+### Nan::GetPropertyNames()
+
+A helper method for calling [`v8::Object#GetPropertyNames()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#aced885270cfd2c956367b5eedc7fbfe8) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Array> Nan::GetPropertyNames(v8::Local<v8::Object> obj);
+```
+
+
+<a name="api_nan_get_own_property_names"></a>
+### Nan::GetOwnPropertyNames()
+
+A helper method for calling [`v8::Object#GetOwnPropertyNames()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a79a6e4d66049b9aa648ed4dfdb23e6eb) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Array> Nan::GetOwnPropertyNames(v8::Local<v8::Object> obj);
+```
+
+
+<a name="api_nan_set_prototype"></a>
+### Nan::SetPrototype()
+
+A helper method for calling [`v8::Object#SetPrototype()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a442706b22fceda6e6d1f632122a9a9f4) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::SetPrototype(v8::Local<v8::Object> obj,
+                                   v8::Local<v8::Value> prototype);
+```
+
+
+<a name="api_nan_object_proto_to_string"></a>
+### Nan::ObjectProtoToString()
+
+A helper method for calling [`v8::Object#ObjectProtoToString()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab7a92b4dcf822bef72f6c0ac6fea1f0b) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::String> Nan::ObjectProtoToString(v8::Local<v8::Object> obj);
+```
+
+
+<a name="api_nan_has_own_property"></a>
+### Nan::HasOwnProperty()
+
+A helper method for calling [`v8::Object#HasOwnProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab7b7245442ca6de1e1c145ea3fd653ff) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::HasOwnProperty(v8::Local<v8::Object> obj,
+                                     v8::Local<v8::String> key);
+```
+
+
+<a name="api_nan_has_real_named_property"></a>
+### Nan::HasRealNamedProperty()
+
+A helper method for calling [`v8::Object#HasRealNamedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ad8b80a59c9eb3c1e6c3cd6c84571f767) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::HasRealNamedProperty(v8::Local<v8::Object> obj,
+                                           v8::Local<v8::String> key);
+```
+
+
+<a name="api_nan_has_real_indexed_property"></a>
+### Nan::HasRealIndexedProperty()
+
+A helper method for calling [`v8::Object#HasRealIndexedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af94fc1135a5e74a2193fb72c3a1b9855) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::HasRealIndexedProperty(v8::Local<v8::Object> obj,
+                                             uint32_t index);
+```
+
+
+<a name="api_nan_has_real_named_callback_property"></a>
+### Nan::HasRealNamedCallbackProperty()
+
+A helper method for calling [`v8::Object#HasRealNamedCallbackProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af743b7ea132b89f84d34d164d0668811) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::HasRealNamedCallbackProperty(
+    v8::Local<v8::Object> obj,
+    v8::Local<v8::String> key);
+```
+
+
+<a name="api_nan_get_real_named_property_in_prototype_chain"></a>
+### Nan::GetRealNamedPropertyInPrototypeChain()
+
+A helper method for calling [`v8::Object#GetRealNamedPropertyInPrototypeChain()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a8700b1862e6b4783716964ba4d5e6172) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::GetRealNamedPropertyInPrototypeChain(
+    v8::Local<v8::Object> obj,
+    v8::Local<v8::String> key);
+```
+
+
+<a name="api_nan_get_real_named_property"></a>
+### Nan::GetRealNamedProperty()
+
+A helper method for calling [`v8::Object#GetRealNamedProperty()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a84471a824576a5994fdd0ffcbf99ccc0) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::GetRealNamedProperty(v8::Local<v8::Object> obj,
+                                                     v8::Local<v8::String> key);
+```
+
+
+<a name="api_nan_call_as_function"></a>
+### Nan::CallAsFunction()
+
+A helper method for calling [`v8::Object#CallAsFunction()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ad3ffc36f3dfc3592ce2a96bc047ee2cd) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::CallAsFunction(v8::Local<v8::Object> obj,
+                                               v8::Local<v8::Object> recv,
+                                               int argc,
+                                               v8::Local<v8::Value> argv[]);
+```
+
+
+<a name="api_nan_call_as_constructor"></a>
+### Nan::CallAsConstructor()
+
+A helper method for calling [`v8::Object#CallAsConstructor()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a50d571de50d0b0dfb28795619d07a01b) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::CallAsConstructor(v8::Local<v8::Object> obj,
+                                                  int argc,
+                                                  v8::Local<v8::Value> argv[]);
+```
+
+
+<a name="api_nan_get_source_line"></a>
+### Nan::GetSourceLine()
+
+A helper method for calling [`v8::Message#GetSourceLine()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#a849f7a6c41549d83d8159825efccd23a) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::String> Nan::GetSourceLine(v8::Local<v8::Message> msg);
+```
+
+
+<a name="api_nan_get_line_number"></a>
+### Nan::GetLineNumber()
+
+A helper method for calling [`v8::Message#GetLineNumber()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#adbe46c10a88a6565f2732a2d2adf99b9) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<int> Nan::GetLineNumber(v8::Local<v8::Message> msg);
+```
+
+
+<a name="api_nan_get_start_column"></a>
+### Nan::GetStartColumn()
+
+A helper method for calling [`v8::Message#GetStartColumn()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#a60ede616ba3822d712e44c7a74487ba6) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<int> Nan::GetStartColumn(v8::Local<v8::Message> msg);
+```
+
+
+<a name="api_nan_get_end_column"></a>
+### Nan::GetEndColumn()
+
+A helper method for calling [`v8::Message#GetEndColumn()`](https://v8docs.nodesource.com/node-8.16/d9/d28/classv8_1_1_message.html#aaa004cf19e529da980bc19fcb76d93be) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<int> Nan::GetEndColumn(v8::Local<v8::Message> msg);
+```
+
+
+<a name="api_nan_clone_element_at"></a>
+### Nan::CloneElementAt()
+
+A helper method for calling [`v8::Array#CloneElementAt()`](https://v8docs.nodesource.com/node-4.8/d3/d32/classv8_1_1_array.html#a1d3a878d4c1c7cae974dd50a1639245e) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array> array, uint32_t index);
+```
+
+<a name="api_nan_has_private"></a>
+### Nan::HasPrivate()
+
+A helper method for calling [`v8::Object#HasPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#af68a0b98066cfdeb8f943e98a40ba08d) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::HasPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key);
+```
+
+<a name="api_nan_get_private"></a>
+### Nan::GetPrivate()
+
+A helper method for calling [`v8::Object#GetPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a169f2da506acbec34deadd9149a1925a) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::GetPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key);
+```
+
+<a name="api_nan_set_private"></a>
+### Nan::SetPrivate()
+
+A helper method for calling [`v8::Object#SetPrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ace1769b0f3b86bfe9fda1010916360ee) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::SetPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key, v8::Local<v8::Value> value);
+```
+
+<a name="api_nan_delete_private"></a>
+### Nan::DeletePrivate()
+
+A helper method for calling [`v8::Object#DeletePrivate()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a138bb32a304f3982be02ad499693b8fd) in a way compatible across supported versions of V8.
+
+Signature:
+
+```c++
+Nan::Maybe<bool> Nan::DeletePrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key);
+```
+
+<a name="api_nan_make_maybe"></a>
+### Nan::MakeMaybe()
+
+Wraps a `v8::Local<>` in a `Nan::MaybeLocal<>`. When called with a `Nan::MaybeLocal<>` it just returns its argument. This is useful in generic template code that builds on NAN.
+
+Synopsis:
+
+```c++
+  MaybeLocal<v8::Number> someNumber = MakeMaybe(New<v8::Number>(3.141592654));
+  MaybeLocal<v8::String> someString = MakeMaybe(New<v8::String>("probably"));
+```
+
+Signature:
+
+```c++
+template <typename T, template <typename> class MaybeMaybe>
+Nan::MaybeLocal<T> Nan::MakeMaybe(MaybeMaybe<T> v);
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/methods.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/methods.md
new file mode 100644 (file)
index 0000000..9642d02
--- /dev/null
@@ -0,0 +1,664 @@
+## JavaScript-accessible methods
+
+A _template_ is a blueprint for JavaScript functions and objects in a context. You can use a template to wrap C++ functions and data structures within JavaScript objects so that they can be manipulated from JavaScript. See the V8 Embedders Guide section on [Templates](https://github.com/v8/v8/wiki/Embedder%27s-Guide#templates) for further information.
+
+In order to expose functionality to JavaScript via a template, you must provide it to V8 in a form that it understands. Across the versions of V8 supported by NAN, JavaScript-accessible method signatures vary widely, NAN fully abstracts method declaration and provides you with an interface that is similar to the most recent V8 API but is backward-compatible with older versions that still use the now-deceased `v8::Argument` type.
+
+* **Method argument types**
+ - <a href="#api_nan_function_callback_info"><b><code>Nan::FunctionCallbackInfo</code></b></a>
+ - <a href="#api_nan_property_callback_info"><b><code>Nan::PropertyCallbackInfo</code></b></a>
+ - <a href="#api_nan_return_value"><b><code>Nan::ReturnValue</code></b></a>
+* **Method declarations**
+ - <a href="#api_nan_method"><b>Method declaration</b></a>
+ - <a href="#api_nan_getter"><b>Getter declaration</b></a>
+ - <a href="#api_nan_setter"><b>Setter declaration</b></a>
+ - <a href="#api_nan_property_getter"><b>Property getter declaration</b></a>
+ - <a href="#api_nan_property_setter"><b>Property setter declaration</b></a>
+ - <a href="#api_nan_property_enumerator"><b>Property enumerator declaration</b></a>
+ - <a href="#api_nan_property_deleter"><b>Property deleter declaration</b></a>
+ - <a href="#api_nan_property_query"><b>Property query declaration</b></a>
+ - <a href="#api_nan_index_getter"><b>Index getter declaration</b></a>
+ - <a href="#api_nan_index_setter"><b>Index setter declaration</b></a>
+ - <a href="#api_nan_index_enumerator"><b>Index enumerator declaration</b></a>
+ - <a href="#api_nan_index_deleter"><b>Index deleter declaration</b></a>
+ - <a href="#api_nan_index_query"><b>Index query declaration</b></a>
+* Method and template helpers
+ - <a href="#api_nan_set_method"><b><code>Nan::SetMethod()</code></b></a>
+ - <a href="#api_nan_set_prototype_method"><b><code>Nan::SetPrototypeMethod()</code></b></a>
+ - <a href="#api_nan_set_accessor"><b><code>Nan::SetAccessor()</code></b></a>
+ - <a href="#api_nan_set_named_property_handler"><b><code>Nan::SetNamedPropertyHandler()</code></b></a>
+ - <a href="#api_nan_set_indexed_property_handler"><b><code>Nan::SetIndexedPropertyHandler()</code></b></a>
+ - <a href="#api_nan_set_template"><b><code>Nan::SetTemplate()</code></b></a>
+ - <a href="#api_nan_set_prototype_template"><b><code>Nan::SetPrototypeTemplate()</code></b></a>
+ - <a href="#api_nan_set_instance_template"><b><code>Nan::SetInstanceTemplate()</code></b></a>
+ - <a href="#api_nan_set_call_handler"><b><code>Nan::SetCallHandler()</code></b></a>
+ - <a href="#api_nan_set_call_as_function_handler"><b><code>Nan::SetCallAsFunctionHandler()</code></b></a>
+
+<a name="api_nan_function_callback_info"></a>
+### Nan::FunctionCallbackInfo
+
+`Nan::FunctionCallbackInfo` should be used in place of [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.16/dd/d0d/classv8_1_1_function_callback_info.html), even with older versions of Node where `v8::FunctionCallbackInfo` does not exist.
+
+Definition:
+
+```c++
+template<typename T> class FunctionCallbackInfo {
+ public:
+  ReturnValue<T> GetReturnValue() const;
+  v8::Local<v8::Function> Callee(); // NOTE: Not available in NodeJS >= 10.0.0
+  v8::Local<v8::Value> Data();
+  v8::Local<v8::Object> Holder();
+  bool IsConstructCall();
+  int Length() const;
+  v8::Local<v8::Value> operator[](int i) const;
+  v8::Local<v8::Object> This() const;
+  v8::Isolate *GetIsolate() const;
+};
+```
+
+See the [`v8::FunctionCallbackInfo`](https://v8docs.nodesource.com/node-8.16/dd/d0d/classv8_1_1_function_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from methods.
+
+**Note:** `FunctionCallbackInfo::Callee` is removed in Node.js after `10.0.0` because it is was deprecated in V8. Consider using `info.Data()` to pass any information you need.
+
+<a name="api_nan_property_callback_info"></a>
+### Nan::PropertyCallbackInfo
+
+`Nan::PropertyCallbackInfo` should be used in place of [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/node-8.16/d7/dc5/classv8_1_1_property_callback_info.html), even with older versions of Node where `v8::PropertyCallbackInfo` does not exist.
+
+Definition:
+
+```c++
+template<typename T> class PropertyCallbackInfo : public PropertyCallbackInfoBase<T> {
+ public:
+  ReturnValue<T> GetReturnValue() const;
+  v8::Isolate* GetIsolate() const;
+  v8::Local<v8::Value> Data() const;
+  v8::Local<v8::Object> This() const;
+  v8::Local<v8::Object> Holder() const;
+};
+```
+
+See the [`v8::PropertyCallbackInfo`](https://v8docs.nodesource.com/node-8.16/d7/dc5/classv8_1_1_property_callback_info.html) documentation for usage details on these. See [`Nan::ReturnValue`](#api_nan_return_value) for further information on how to set a return value from property accessor methods.
+
+<a name="api_nan_return_value"></a>
+### Nan::ReturnValue
+
+`Nan::ReturnValue` is used in place of [`v8::ReturnValue`](https://v8docs.nodesource.com/node-8.16/da/da7/classv8_1_1_return_value.html) on both [`Nan::FunctionCallbackInfo`](#api_nan_function_callback_info) and [`Nan::PropertyCallbackInfo`](#api_nan_property_callback_info) as the return type of `GetReturnValue()`.
+
+Example usage:
+
+```c++
+void EmptyArray(const Nan::FunctionCallbackInfo<v8::Value>& info) {
+  info.GetReturnValue().Set(Nan::New<v8::Array>());
+}
+```
+
+Definition:
+
+```c++
+template<typename T> class ReturnValue {
+ public:
+  // Handle setters
+  template <typename S> void Set(const v8::Local<S> &handle);
+  template <typename S> void Set(const Nan::Global<S> &handle);
+
+  // Fast primitive setters
+  void Set(bool value);
+  void Set(double i);
+  void Set(int32_t i);
+  void Set(uint32_t i);
+
+  // Fast JS primitive setters
+  void SetNull();
+  void SetUndefined();
+  void SetEmptyString();
+
+  // Convenience getter for isolate
+  v8::Isolate *GetIsolate() const;
+};
+```
+
+See the documentation on [`v8::ReturnValue`](https://v8docs.nodesource.com/node-8.16/da/da7/classv8_1_1_return_value.html) for further information on this.
+
+<a name="api_nan_method"></a>
+### Method declaration
+
+JavaScript-accessible methods should be declared with the following signature to form a `Nan::FunctionCallback`:
+
+```c++
+typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
+```
+
+Example:
+
+```c++
+void MethodName(const Nan::FunctionCallbackInfo<v8::Value>& info) {
+  ...
+}
+```
+
+You do not need to declare a new `HandleScope` within a method as one is implicitly created for you.
+
+**Example usage**
+
+```c++
+// .h:
+class Foo : public Nan::ObjectWrap {
+  ...
+
+  static void Bar(const Nan::FunctionCallbackInfo<v8::Value>& info);
+  static void Baz(const Nan::FunctionCallbackInfo<v8::Value>& info);
+}
+
+
+// .cc:
+void Foo::Bar(const Nan::FunctionCallbackInfo<v8::Value>& info) {
+  ...
+}
+
+void Foo::Baz(const Nan::FunctionCallbackInfo<v8::Value>& info) {
+  ...
+}
+```
+
+A helper macro `NAN_METHOD(methodname)` exists, compatible with NAN v1 method declarations.
+
+**Example usage with `NAN_METHOD(methodname)`**
+
+```c++
+// .h:
+class Foo : public Nan::ObjectWrap {
+  ...
+
+  static NAN_METHOD(Bar);
+  static NAN_METHOD(Baz);
+}
+
+
+// .cc:
+NAN_METHOD(Foo::Bar) {
+  ...
+}
+
+NAN_METHOD(Foo::Baz) {
+  ...
+}
+```
+
+Use [`Nan::SetPrototypeMethod`](#api_nan_set_prototype_method) to attach a method to a JavaScript function prototype or [`Nan::SetMethod`](#api_nan_set_method) to attach a method directly on a JavaScript object.
+
+<a name="api_nan_getter"></a>
+### Getter declaration
+
+JavaScript-accessible getters should be declared with the following signature to form a `Nan::GetterCallback`:
+
+```c++
+typedef void(*GetterCallback)(v8::Local<v8::String>,
+                              const PropertyCallbackInfo<v8::Value>&);
+```
+
+Example:
+
+```c++
+void GetterName(v8::Local<v8::String> property,
+                const Nan::PropertyCallbackInfo<v8::Value>& info) {
+  ...
+}
+```
+
+You do not need to declare a new `HandleScope` within a getter as one is implicitly created for you.
+
+A helper macro `NAN_GETTER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors).
+
+<a name="api_nan_setter"></a>
+### Setter declaration
+
+JavaScript-accessible setters should be declared with the following signature to form a <b><code>Nan::SetterCallback</code></b>:
+
+```c++
+typedef void(*SetterCallback)(v8::Local<v8::String>,
+                              v8::Local<v8::Value>,
+                              const PropertyCallbackInfo<void>&);
+```
+
+Example:
+
+```c++
+void SetterName(v8::Local<v8::String> property,
+                v8::Local<v8::Value> value,
+                const Nan::PropertyCallbackInfo<void>& info) {
+  ...
+}
+```
+
+You do not need to declare a new `HandleScope` within a setter as one is implicitly created for you.
+
+A helper macro `NAN_SETTER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on [Accessors](https://developers.google.com/v8/embed#accesssors).
+
+<a name="api_nan_property_getter"></a>
+### Property getter declaration
+
+JavaScript-accessible property getters should be declared with the following signature to form a <b><code>Nan::PropertyGetterCallback</code></b>:
+
+```c++
+typedef void(*PropertyGetterCallback)(v8::Local<v8::String>,
+                                      const PropertyCallbackInfo<v8::Value>&);
+```
+
+Example:
+
+```c++
+void PropertyGetterName(v8::Local<v8::String> property,
+                        const Nan::PropertyCallbackInfo<v8::Value>& info) {
+  ...
+}
+```
+
+You do not need to declare a new `HandleScope` within a property getter as one is implicitly created for you.
+
+A helper macro `NAN_PROPERTY_GETTER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_property_setter"></a>
+### Property setter declaration
+
+JavaScript-accessible property setters should be declared with the following signature to form a <b><code>Nan::PropertySetterCallback</code></b>:
+
+```c++
+typedef void(*PropertySetterCallback)(v8::Local<v8::String>,
+                                      v8::Local<v8::Value>,
+                                      const PropertyCallbackInfo<v8::Value>&);
+```
+
+Example:
+
+```c++
+void PropertySetterName(v8::Local<v8::String> property,
+                        v8::Local<v8::Value> value,
+                        const Nan::PropertyCallbackInfo<v8::Value>& info);
+```
+
+You do not need to declare a new `HandleScope` within a property setter as one is implicitly created for you.
+
+A helper macro `NAN_PROPERTY_SETTER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_property_enumerator"></a>
+### Property enumerator declaration
+
+JavaScript-accessible property enumerators should be declared with the following signature to form a <b><code>Nan::PropertyEnumeratorCallback</code></b>:
+
+```c++
+typedef void(*PropertyEnumeratorCallback)(const PropertyCallbackInfo<v8::Array>&);
+```
+
+Example:
+
+```c++
+void PropertyEnumeratorName(const Nan::PropertyCallbackInfo<v8::Array>& info);
+```
+
+You do not need to declare a new `HandleScope` within a property enumerator as one is implicitly created for you.
+
+A helper macro `NAN_PROPERTY_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_property_deleter"></a>
+### Property deleter declaration
+
+JavaScript-accessible property deleters should be declared with the following signature to form a <b><code>Nan::PropertyDeleterCallback</code></b>:
+
+```c++
+typedef void(*PropertyDeleterCallback)(v8::Local<v8::String>,
+                                       const PropertyCallbackInfo<v8::Boolean>&);
+```
+
+Example:
+
+```c++
+void PropertyDeleterName(v8::Local<v8::String> property,
+                         const Nan::PropertyCallbackInfo<v8::Boolean>& info);
+```
+
+You do not need to declare a new `HandleScope` within a property deleter as one is implicitly created for you.
+
+A helper macro `NAN_PROPERTY_DELETER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_property_query"></a>
+### Property query declaration
+
+JavaScript-accessible property query methods should be declared with the following signature to form a <b><code>Nan::PropertyQueryCallback</code></b>:
+
+```c++
+typedef void(*PropertyQueryCallback)(v8::Local<v8::String>,
+                                     const PropertyCallbackInfo<v8::Integer>&);
+```
+
+Example:
+
+```c++
+void PropertyQueryName(v8::Local<v8::String> property,
+                       const Nan::PropertyCallbackInfo<v8::Integer>& info);
+```
+
+You do not need to declare a new `HandleScope` within a property query method as one is implicitly created for you.
+
+A helper macro `NAN_PROPERTY_QUERY(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on named property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_index_getter"></a>
+### Index getter declaration
+
+JavaScript-accessible index getter methods should be declared with the following signature to form a <b><code>Nan::IndexGetterCallback</code></b>:
+
+```c++
+typedef void(*IndexGetterCallback)(uint32_t,
+                                   const PropertyCallbackInfo<v8::Value>&);
+```
+
+Example:
+
+```c++
+void IndexGetterName(uint32_t index, const PropertyCallbackInfo<v8::Value>& info);
+```
+
+You do not need to declare a new `HandleScope` within a index getter as one is implicitly created for you.
+
+A helper macro `NAN_INDEX_GETTER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_index_setter"></a>
+### Index setter declaration
+
+JavaScript-accessible index setter methods should be declared with the following signature to form a <b><code>Nan::IndexSetterCallback</code></b>:
+
+```c++
+typedef void(*IndexSetterCallback)(uint32_t,
+                                   v8::Local<v8::Value>,
+                                   const PropertyCallbackInfo<v8::Value>&);
+```
+
+Example:
+
+```c++
+void IndexSetterName(uint32_t index,
+                     v8::Local<v8::Value> value,
+                     const PropertyCallbackInfo<v8::Value>& info);
+```
+
+You do not need to declare a new `HandleScope` within a index setter as one is implicitly created for you.
+
+A helper macro `NAN_INDEX_SETTER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_index_enumerator"></a>
+### Index enumerator declaration
+
+JavaScript-accessible index enumerator methods should be declared with the following signature to form a <b><code>Nan::IndexEnumeratorCallback</code></b>:
+
+```c++
+typedef void(*IndexEnumeratorCallback)(const PropertyCallbackInfo<v8::Array>&);
+```
+
+Example:
+
+```c++
+void IndexEnumeratorName(const PropertyCallbackInfo<v8::Array>& info);
+```
+
+You do not need to declare a new `HandleScope` within a index enumerator as one is implicitly created for you.
+
+A helper macro `NAN_INDEX_ENUMERATOR(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_index_deleter"></a>
+### Index deleter declaration
+
+JavaScript-accessible index deleter methods should be declared with the following signature to form a <b><code>Nan::IndexDeleterCallback</code></b>:
+
+```c++
+typedef void(*IndexDeleterCallback)(uint32_t,
+                                    const PropertyCallbackInfo<v8::Boolean>&);
+```
+
+Example:
+
+```c++
+void IndexDeleterName(uint32_t index, const PropertyCallbackInfo<v8::Boolean>& info);
+```
+
+You do not need to declare a new `HandleScope` within a index deleter as one is implicitly created for you.
+
+A helper macro `NAN_INDEX_DELETER(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_index_query"></a>
+### Index query declaration
+
+JavaScript-accessible index query methods should be declared with the following signature to form a <b><code>Nan::IndexQueryCallback</code></b>:
+
+```c++
+typedef void(*IndexQueryCallback)(uint32_t,
+                                  const PropertyCallbackInfo<v8::Integer>&);
+```
+
+Example:
+
+```c++
+void IndexQueryName(uint32_t index, const PropertyCallbackInfo<v8::Integer>& info);
+```
+
+You do not need to declare a new `HandleScope` within a index query method as one is implicitly created for you.
+
+A helper macro `NAN_INDEX_QUERY(methodname)` exists, compatible with NAN v1 method declarations.
+
+Also see the V8 Embedders Guide documentation on indexed property [Interceptors](https://developers.google.com/v8/embed#interceptors).
+
+<a name="api_nan_set_method"></a>
+### Nan::SetMethod()
+
+Sets a method with a given name directly on a JavaScript object where the method has the `Nan::FunctionCallback` signature (see <a href="#api_nan_method">Method declaration</a>).
+
+Signature:
+
+```c++
+void Nan::SetMethod(v8::Local<v8::Object> recv,
+                    const char *name,
+                    Nan::FunctionCallback callback,
+                    v8::Local<v8::Value> data = v8::Local<v8::Value>())
+void Nan::SetMethod(v8::Local<v8::Template> templ,
+                    const char *name,
+                    Nan::FunctionCallback callback,
+                    v8::Local<v8::Value> data = v8::Local<v8::Value>())
+```
+
+<a name="api_nan_set_prototype_method"></a>
+### Nan::SetPrototypeMethod()
+
+Sets a method with a given name on a `FunctionTemplate`'s prototype where the method has the `Nan::FunctionCallback` signature (see <a href="#api_nan_method">Method declaration</a>).
+
+Signature:
+
+```c++
+void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate> recv,
+                             const char* name,
+                             Nan::FunctionCallback callback,
+                             v8::Local<v8::Value> data = v8::Local<v8::Value>())
+```
+
+<a name="api_nan_set_accessor"></a>
+### Nan::SetAccessor()
+
+Sets getters and setters for a property with a given name on an `ObjectTemplate` or a plain `Object`. Accepts getters with the `Nan::GetterCallback` signature (see <a href="#api_nan_getter">Getter declaration</a>) and setters with the `Nan::SetterCallback` signature (see <a href="#api_nan_setter">Setter declaration</a>).
+
+Signature:
+
+```c++
+void SetAccessor(v8::Local<v8::ObjectTemplate> tpl,
+                 v8::Local<v8::String> name,
+                 Nan::GetterCallback getter,
+                 Nan::SetterCallback setter = 0,
+                 v8::Local<v8::Value> data = v8::Local<v8::Value>(),
+                 v8::AccessControl settings = v8::DEFAULT,
+                 v8::PropertyAttribute attribute = v8::None,
+                 imp::Sig signature = imp::Sig());
+bool SetAccessor(v8::Local<v8::Object> obj,
+                 v8::Local<v8::String> name,
+                 Nan::GetterCallback getter,
+                 Nan::SetterCallback setter = 0,
+                 v8::Local<v8::Value> data = v8::Local<v8::Value>(),
+                 v8::AccessControl settings = v8::DEFAULT,
+                 v8::PropertyAttribute attribute = v8::None)
+```
+
+See the V8 [`ObjectTemplate#SetAccessor()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#aca0ed196f8a9adb1f68b1aadb6c9cd77) and [`Object#SetAccessor()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ae91b3b56b357f285288c89fbddc46d1b) for further information about how to use `Nan::SetAccessor()`.
+
+<a name="api_nan_set_named_property_handler"></a>
+### Nan::SetNamedPropertyHandler()
+
+Sets named property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts:
+
+* Property getters with the `Nan::PropertyGetterCallback` signature (see <a href="#api_nan_property_getter">Property getter declaration</a>)
+* Property setters with the `Nan::PropertySetterCallback` signature (see <a href="#api_nan_property_setter">Property setter declaration</a>)
+* Property query methods with the `Nan::PropertyQueryCallback` signature (see <a href="#api_nan_property_query">Property query declaration</a>)
+* Property deleters with the `Nan::PropertyDeleterCallback` signature (see <a href="#api_nan_property_deleter">Property deleter declaration</a>)
+* Property enumerators with the `Nan::PropertyEnumeratorCallback` signature (see <a href="#api_nan_property_enumerator">Property enumerator declaration</a>)
+
+Signature:
+
+```c++
+void SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate> tpl,
+                             Nan::PropertyGetterCallback getter,
+                             Nan::PropertySetterCallback setter = 0,
+                             Nan::PropertyQueryCallback query = 0,
+                             Nan::PropertyDeleterCallback deleter = 0,
+                             Nan::PropertyEnumeratorCallback enumerator = 0,
+                             v8::Local<v8::Value> data = v8::Local<v8::Value>())
+```
+
+See the V8 [`ObjectTemplate#SetNamedPropertyHandler()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#a33b3ebd7de641f6cc6414b7de01fc1c7) for further information about how to use `Nan::SetNamedPropertyHandler()`.
+
+<a name="api_nan_set_indexed_property_handler"></a>
+### Nan::SetIndexedPropertyHandler()
+
+Sets indexed property getters, setters, query, deleter and enumerator methods on an `ObjectTemplate`. Accepts:
+
+* Indexed property getters with the `Nan::IndexGetterCallback` signature (see <a href="#api_nan_index_getter">Index getter declaration</a>)
+* Indexed property setters with the `Nan::IndexSetterCallback` signature (see <a href="#api_nan_index_setter">Index setter declaration</a>)
+* Indexed property query methods with the `Nan::IndexQueryCallback` signature (see <a href="#api_nan_index_query">Index query declaration</a>)
+* Indexed property deleters with the `Nan::IndexDeleterCallback` signature (see <a href="#api_nan_index_deleter">Index deleter declaration</a>)
+* Indexed property enumerators with the `Nan::IndexEnumeratorCallback` signature (see <a href="#api_nan_index_enumerator">Index enumerator declaration</a>)
+
+Signature:
+
+```c++
+void SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate> tpl,
+                               Nan::IndexGetterCallback getter,
+                               Nan::IndexSetterCallback setter = 0,
+                               Nan::IndexQueryCallback query = 0,
+                               Nan::IndexDeleterCallback deleter = 0,
+                               Nan::IndexEnumeratorCallback enumerator = 0,
+                               v8::Local<v8::Value> data = v8::Local<v8::Value>())
+```
+
+See the V8 [`ObjectTemplate#SetIndexedPropertyHandler()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#ac89f06d634add0e890452033f7d17ff1) for further information about how to use `Nan::SetIndexedPropertyHandler()`.
+
+<a name="api_nan_set_template"></a>
+### Nan::SetTemplate()
+
+Adds properties on an `Object`'s or `Function`'s template.
+
+Signature:
+
+```c++
+void Nan::SetTemplate(v8::Local<v8::Template> templ,
+                      const char *name,
+                      v8::Local<v8::Data> value);
+void Nan::SetTemplate(v8::Local<v8::Template> templ,
+                      v8::Local<v8::String> name,
+                      v8::Local<v8::Data> value,
+                      v8::PropertyAttribute attributes)
+```
+
+Calls the `Template`'s [`Set()`](https://v8docs.nodesource.com/node-8.16/db/df7/classv8_1_1_template.html#ae3fbaff137557aa6a0233bc7e52214ac).
+
+<a name="api_nan_set_prototype_template"></a>
+### Nan::SetPrototypeTemplate()
+
+Adds properties on an `Object`'s or `Function`'s prototype template.
+
+Signature:
+
+```c++
+void Nan::SetPrototypeTemplate(v8::Local<v8::FunctionTemplate> templ,
+                               const char *name,
+                               v8::Local<v8::Data> value);
+void Nan::SetPrototypeTemplate(v8::Local<v8::FunctionTemplate> templ,
+                               v8::Local<v8::String> name,
+                               v8::Local<v8::Data> value,
+                               v8::PropertyAttribute attributes)
+```
+
+Calls the `FunctionTemplate`'s _PrototypeTemplate's_ [`Set()`](https://v8docs.nodesource.com/node-8.16/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf).
+
+<a name="api_nan_set_instance_template"></a>
+### Nan::SetInstanceTemplate()
+
+Use to add instance properties on `FunctionTemplate`'s.
+
+Signature:
+
+```c++
+void Nan::SetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ,
+                              const char *name,
+                              v8::Local<v8::Data> value);
+void Nan::SetInstanceTemplate(v8::Local<v8::FunctionTemplate> templ,
+                              v8::Local<v8::String> name,
+                              v8::Local<v8::Data> value,
+                              v8::PropertyAttribute attributes)
+```
+
+Calls the `FunctionTemplate`'s _InstanceTemplate's_ [`Set()`](https://v8docs.nodesource.com/node-8.16/db/df7/classv8_1_1_template.html#a2db6a56597bf23c59659c0659e564ddf).
+
+<a name="api_nan_set_call_handler"></a>
+### Nan::SetCallHandler()
+
+Set the call-handler callback for a `v8::FunctionTemplate`.
+This callback is called whenever the function created from this FunctionTemplate is called.
+
+Signature:
+
+```c++
+void Nan::SetCallHandler(v8::Local<v8::FunctionTemplate> templ, Nan::FunctionCallback callback, v8::Local<v8::Value> data = v8::Local<v8::Value>())
+```
+
+Calls the `FunctionTemplate`'s [`SetCallHandler()`](https://v8docs.nodesource.com/node-8.16/d8/d83/classv8_1_1_function_template.html#ab7574b298db3c27fbc2ed465c08ea2f8).
+
+<a name="api_nan_set_call_as_function_handler"></a>
+### Nan::SetCallAsFunctionHandler()
+
+Sets the callback to be used when calling instances created from the `v8::ObjectTemplate` as a function.
+If no callback is set, instances behave like normal JavaScript objects that cannot be called as a function.
+
+Signature:
+
+```c++
+void Nan::SetCallAsFunctionHandler(v8::Local<v8::ObjectTemplate> templ, Nan::FunctionCallback callback, v8::Local<v8::Value> data = v8::Local<v8::Value>())
+```
+
+Calls the `ObjectTemplate`'s [`SetCallAsFunctionHandler()`](https://v8docs.nodesource.com/node-8.16/db/d5f/classv8_1_1_object_template.html#a5e9612fc80bf6db8f2da199b9b0bd04e).
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/new.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/new.md
new file mode 100644 (file)
index 0000000..0f28a0e
--- /dev/null
@@ -0,0 +1,147 @@
+## New
+
+NAN provides a `Nan::New()` helper for the creation of new JavaScript objects in a way that's compatible across the supported versions of V8.
+
+ - <a href="#api_nan_new"><b><code>Nan::New()</code></b></a>
+ - <a href="#api_nan_undefined"><b><code>Nan::Undefined()</code></b></a>
+ - <a href="#api_nan_null"><b><code>Nan::Null()</code></b></a>
+ - <a href="#api_nan_true"><b><code>Nan::True()</code></b></a>
+ - <a href="#api_nan_false"><b><code>Nan::False()</code></b></a>
+ - <a href="#api_nan_empty_string"><b><code>Nan::EmptyString()</code></b></a>
+
+
+<a name="api_nan_new"></a>
+### Nan::New()
+
+`Nan::New()` should be used to instantiate new JavaScript objects.
+
+Refer to the specific V8 type in the [V8 documentation](https://v8docs.nodesource.com/node-8.16/d1/d83/classv8_1_1_data.html) for information on the types of arguments required for instantiation.
+
+Signatures:
+
+Return types are mostly omitted from the signatures for simplicity. In most cases the type will be contained within a `v8::Local<T>`. The following types will be contained within a `Nan::MaybeLocal<T>`: `v8::String`, `v8::Date`, `v8::RegExp`, `v8::Script`, `v8::UnboundScript`.
+
+Empty objects:
+
+```c++
+Nan::New<T>();
+```
+
+Generic single and multiple-argument:
+
+```c++
+Nan::New<T>(A0 arg0);
+Nan::New<T>(A0 arg0, A1 arg1);
+Nan::New<T>(A0 arg0, A1 arg1, A2 arg2);
+Nan::New<T>(A0 arg0, A1 arg1, A2 arg2, A3 arg3);
+```
+
+For creating `v8::FunctionTemplate` and `v8::Function` objects:
+
+_The definition of `Nan::FunctionCallback` can be found in the [Method declaration](./methods.md#api_nan_method) documentation._
+
+```c++
+Nan::New<T>(Nan::FunctionCallback callback,
+            v8::Local<v8::Value> data = v8::Local<v8::Value>());
+Nan::New<T>(Nan::FunctionCallback callback,
+            v8::Local<v8::Value> data = v8::Local<v8::Value>(),
+            A2 a2 = A2());
+```
+
+Native number types:
+
+```c++
+v8::Local<v8::Boolean> Nan::New<T>(bool value);
+v8::Local<v8::Int32> Nan::New<T>(int32_t value);
+v8::Local<v8::Uint32> Nan::New<T>(uint32_t value);
+v8::Local<v8::Number> Nan::New<T>(double value);
+```
+
+String types:
+
+```c++
+Nan::MaybeLocal<v8::String> Nan::New<T>(std::string const& value);
+Nan::MaybeLocal<v8::String> Nan::New<T>(const char * value, int length);
+Nan::MaybeLocal<v8::String> Nan::New<T>(const char * value);
+Nan::MaybeLocal<v8::String> Nan::New<T>(const uint16_t * value);
+Nan::MaybeLocal<v8::String> Nan::New<T>(const uint16_t * value, int length);
+```
+
+Specialized types:
+
+```c++
+v8::Local<v8::String> Nan::New<T>(v8::String::ExternalStringResource * value);
+v8::Local<v8::String> Nan::New<T>(Nan::ExternalOneByteStringResource * value);
+v8::Local<v8::RegExp> Nan::New<T>(v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
+```
+
+Note that `Nan::ExternalOneByteStringResource` maps to [`v8::String::ExternalOneByteStringResource`](https://v8docs.nodesource.com/node-8.16/d9/db3/classv8_1_1_string_1_1_external_one_byte_string_resource.html), and `v8::String::ExternalAsciiStringResource` in older versions of V8.
+
+
+<a name="api_nan_undefined"></a>
+### Nan::Undefined()
+
+A helper method to reference the `v8::Undefined` object in a way that is compatible across all supported versions of V8.
+
+Signature:
+
+```c++
+v8::Local<v8::Primitive> Nan::Undefined()
+```
+
+<a name="api_nan_null"></a>
+### Nan::Null()
+
+A helper method to reference the `v8::Null` object in a way that is compatible across all supported versions of V8.
+
+Signature:
+
+```c++
+v8::Local<v8::Primitive> Nan::Null()
+```
+
+<a name="api_nan_true"></a>
+### Nan::True()
+
+A helper method to reference the `v8::Boolean` object representing the `true` value in a way that is compatible across all supported versions of V8.
+
+Signature:
+
+```c++
+v8::Local<v8::Boolean> Nan::True()
+```
+
+<a name="api_nan_false"></a>
+### Nan::False()
+
+A helper method to reference the `v8::Boolean` object representing the `false` value in a way that is compatible across all supported versions of V8.
+
+Signature:
+
+```c++
+v8::Local<v8::Boolean> Nan::False()
+```
+
+<a name="api_nan_empty_string"></a>
+### Nan::EmptyString()
+
+Call [`v8::String::Empty`](https://v8docs.nodesource.com/node-8.16/d2/db3/classv8_1_1_string.html#a7c1bc8886115d7ee46f1d571dd6ebc6d) to reference the empty string in a way that is compatible across all supported versions of V8.
+
+Signature:
+
+```c++
+v8::Local<v8::String> Nan::EmptyString()
+```
+
+
+<a name="api_nan_new_one_byte_string"></a>
+### Nan::NewOneByteString()
+
+An implementation of [`v8::String::NewFromOneByte()`](https://v8docs.nodesource.com/node-8.16/d2/db3/classv8_1_1_string.html#a5264d50b96d2c896ce525a734dc10f09) provided for consistent availability and API across supported versions of V8. Allocates a new string from Latin-1 data.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::String> Nan::NewOneByteString(const uint8_t * value,
+                                                  int length = -1)
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/node_misc.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/node_misc.md
new file mode 100644 (file)
index 0000000..17578e3
--- /dev/null
@@ -0,0 +1,123 @@
+## Miscellaneous Node Helpers
+
+ - <a href="#api_nan_asyncresource"><b><code>Nan::AsyncResource</code></b></a>
+ - <a href="#api_nan_make_callback"><b><code>Nan::MakeCallback()</code></b></a>
+ - <a href="#api_nan_module_init"><b><code>NAN_MODULE_INIT()</code></b></a>
+ - <a href="#api_nan_export"><b><code>Nan::Export()</code></b></a>
+
+<a name="api_nan_asyncresource"></a>
+### Nan::AsyncResource
+
+This class is analogous to the `AsyncResource` JavaScript class exposed by Node's [async_hooks][] API.
+
+When calling back into JavaScript asynchronously, special care must be taken to ensure that the runtime can properly track
+async hops. `Nan::AsyncResource` is a class that provides an RAII wrapper around `node::EmitAsyncInit`, `node::EmitAsyncDestroy`,
+and `node::MakeCallback`. Using this mechanism to call back into JavaScript, as opposed to `Nan::MakeCallback` or
+`v8::Function::Call` ensures that the callback is executed in the correct async context. This ensures that async mechanisms
+such as domains and [async_hooks][] function correctly.
+
+Definition:
+
+```c++
+class AsyncResource {
+ public:
+  AsyncResource(v8::Local<v8::String> name,
+                v8::Local<v8::Object> resource = New<v8::Object>());
+  AsyncResource(const char* name,
+                v8::Local<v8::Object> resource = New<v8::Object>());
+  ~AsyncResource();
+
+  v8::MaybeLocal<v8::Value> runInAsyncScope(v8::Local<v8::Object> target,
+                                            v8::Local<v8::Function> func,
+                                            int argc,
+                                            v8::Local<v8::Value>* argv);
+  v8::MaybeLocal<v8::Value> runInAsyncScope(v8::Local<v8::Object> target,
+                                            v8::Local<v8::String> symbol,
+                                            int argc,
+                                            v8::Local<v8::Value>* argv);
+  v8::MaybeLocal<v8::Value> runInAsyncScope(v8::Local<v8::Object> target,
+                                            const char* method,
+                                            int argc,
+                                            v8::Local<v8::Value>* argv);
+};
+```
+
+* `name`: Identifier for the kind of resource that is being provided for diagnostics information exposed by the [async_hooks][]
+  API. This will be passed to the possible `init` hook as the `type`. To avoid name collisions with other modules we recommend
+  that the name include the name of the owning module as a prefix. For example `mysql` module could use something like
+  `mysql:batch-db-query-resource`.
+* `resource`: An optional object associated with the async work that will be passed to the possible [async_hooks][]
+  `init` hook. If this parameter is omitted, or an empty handle is provided, this object will be created automatically.
+* When calling JS on behalf of this resource, one can use `runInAsyncScope`. This will ensure that the callback runs in the
+  correct async execution context.
+* `AsyncDestroy` is automatically called when an AsyncResource object is destroyed.
+
+For more details, see the Node [async_hooks][] documentation. You might also want to take a look at the documentation for the
+[N-API counterpart][napi]. For example usage, see the `asyncresource.cpp` example in the `test/cpp` directory.
+
+<a name="api_nan_make_callback"></a>
+### Nan::MakeCallback()
+
+Deprecated wrappers around the legacy `node::MakeCallback()` APIs. Node.js 10+
+has deprecated these legacy APIs as they do not provide a mechanism to preserve
+async context.
+
+We recommend that you use the `AsyncResource` class and `AsyncResource::runInAsyncScope` instead of using `Nan::MakeCallback` or
+`v8::Function#Call()` directly. `AsyncResource` properly takes care of running the callback in the correct async execution
+context – something that is essential for functionality like domains, async_hooks and async debugging.
+
+Signatures:
+
+```c++
+NAN_DEPRECATED
+v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object> target,
+                                       v8::Local<v8::Function> func,
+                                       int argc,
+                                       v8::Local<v8::Value>* argv);
+NAN_DEPRECATED
+v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object> target,
+                                       v8::Local<v8::String> symbol,
+                                       int argc,
+                                       v8::Local<v8::Value>* argv);
+NAN_DEPRECATED
+v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object> target,
+                                       const char* method,
+                                       int argc,
+                                       v8::Local<v8::Value>* argv);
+```
+
+
+<a name="api_nan_module_init"></a>
+### NAN_MODULE_INIT()
+
+Used to define the entry point function to a Node add-on. Creates a function with a given `name` that receives a `target` object representing the equivalent of the JavaScript `exports` object.
+
+See example below.
+
+<a name="api_nan_export"></a>
+### Nan::Export()
+
+A simple helper to register a `v8::FunctionTemplate` from a JavaScript-accessible method (see [Methods](./methods.md)) as a property on an object. Can be used in a way similar to assigning properties to `module.exports` in JavaScript.
+
+Signature:
+
+```c++
+void Export(v8::Local<v8::Object> target, const char *name, Nan::FunctionCallback f)
+```
+
+Also available as the shortcut `NAN_EXPORT` macro.
+
+Example:
+
+```c++
+NAN_METHOD(Foo) {
+  ...
+}
+
+NAN_MODULE_INIT(Init) {
+  NAN_EXPORT(target, Foo);
+}
+```
+
+[async_hooks]: https://nodejs.org/dist/latest-v9.x/docs/api/async_hooks.html
+[napi]: https://nodejs.org/dist/latest-v9.x/docs/api/n-api.html#n_api_custom_asynchronous_operations
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/object_wrappers.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/object_wrappers.md
new file mode 100644 (file)
index 0000000..07d8c05
--- /dev/null
@@ -0,0 +1,263 @@
+## Object Wrappers
+
+The `ObjectWrap` class can be used to make wrapped C++ objects and a factory of wrapped objects.
+
+ - <a href="#api_nan_object_wrap"><b><code>Nan::ObjectWrap</code></b></a>
+
+
+<a name="api_nan_object_wrap"></a>
+### Nan::ObjectWrap()
+
+A reimplementation of `node::ObjectWrap` that adds some API not present in older versions of Node. Should be preferred over `node::ObjectWrap` in all cases for consistency.
+
+Definition:
+
+```c++
+class ObjectWrap {
+ public:
+  ObjectWrap();
+
+  virtual ~ObjectWrap();
+
+  template <class T>
+  static inline T* Unwrap(v8::Local<v8::Object> handle);
+
+  inline v8::Local<v8::Object> handle();
+
+  inline Nan::Persistent<v8::Object>& persistent();
+
+ protected:
+  inline void Wrap(v8::Local<v8::Object> handle);
+
+  inline void MakeWeak();
+
+  /* Ref() marks the object as being attached to an event loop.
+   * Refed objects will not be garbage collected, even if
+   * all references are lost.
+   */
+  virtual void Ref();
+
+  /* Unref() marks an object as detached from the event loop.  This is its
+   * default state.  When an object with a "weak" reference changes from
+   * attached to detached state it will be freed. Be careful not to access
+   * the object after making this call as it might be gone!
+   * (A "weak reference" means an object that only has a
+   * persistent handle.)
+   *
+   * DO NOT CALL THIS FROM DESTRUCTOR
+   */
+  virtual void Unref();
+
+  int refs_;  // ro
+};
+```
+
+See the Node documentation on [Wrapping C++ Objects](https://nodejs.org/api/addons.html#addons_wrapping_c_objects) for more details.
+
+### This vs. Holder
+
+When calling `Unwrap`, it is important that the argument is indeed some JavaScript object which got wrapped by a `Wrap` call for this class or any derived class.
+The `Signature` installed by [`Nan::SetPrototypeMethod()`](methods.md#api_nan_set_prototype_method) does ensure that `info.Holder()` is just such an instance.
+In Node 0.12 and later, `info.This()` will also be of such a type, since otherwise the invocation will get rejected.
+However, in Node 0.10 and before it was possible to invoke a method on a JavaScript object which just had the extension type in its prototype chain.
+In such a situation, calling `Unwrap` on `info.This()` will likely lead to a failed assertion causing a crash, but could lead to even more serious corruption.
+
+On the other hand, calling `Unwrap` in an [accessor](methods.md#api_nan_set_accessor) should not use `Holder()` if the accessor is defined on the prototype.
+So either define your accessors on the instance template,
+or use `This()` after verifying that it is indeed a valid object.
+
+### Examples
+
+#### Basic
+
+```c++
+class MyObject : public Nan::ObjectWrap {
+ public:
+  static NAN_MODULE_INIT(Init) {
+    v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
+    tpl->SetClassName(Nan::New("MyObject").ToLocalChecked());
+    tpl->InstanceTemplate()->SetInternalFieldCount(1);
+
+    Nan::SetPrototypeMethod(tpl, "getHandle", GetHandle);
+    Nan::SetPrototypeMethod(tpl, "getValue", GetValue);
+
+    constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked());
+    Nan::Set(target, Nan::New("MyObject").ToLocalChecked(),
+      Nan::GetFunction(tpl).ToLocalChecked());
+  }
+
+ private:
+  explicit MyObject(double value = 0) : value_(value) {}
+  ~MyObject() {}
+
+  static NAN_METHOD(New) {
+    if (info.IsConstructCall()) {
+      double value = info[0]->IsUndefined() ? 0 : Nan::To<double>(info[0]).FromJust();
+      MyObject *obj = new MyObject(value);
+      obj->Wrap(info.This());
+      info.GetReturnValue().Set(info.This());
+    } else {
+      const int argc = 1;
+      v8::Local<v8::Value> argv[argc] = {info[0]};
+      v8::Local<v8::Function> cons = Nan::New(constructor());
+      info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked());
+    }
+  }
+
+  static NAN_METHOD(GetHandle) {
+    MyObject* obj = Nan::ObjectWrap::Unwrap<MyObject>(info.Holder());
+    info.GetReturnValue().Set(obj->handle());
+  }
+
+  static NAN_METHOD(GetValue) {
+    MyObject* obj = Nan::ObjectWrap::Unwrap<MyObject>(info.Holder());
+    info.GetReturnValue().Set(obj->value_);
+  }
+
+  static inline Nan::Persistent<v8::Function> & constructor() {
+    static Nan::Persistent<v8::Function> my_constructor;
+    return my_constructor;
+  }
+
+  double value_;
+};
+
+NODE_MODULE(objectwrapper, MyObject::Init)
+```
+
+To use in Javascript:
+
+```Javascript
+var objectwrapper = require('bindings')('objectwrapper');
+
+var obj = new objectwrapper.MyObject(5);
+console.log('Should be 5: ' + obj.getValue());
+```
+
+#### Factory of wrapped objects
+
+```c++
+class MyFactoryObject : public Nan::ObjectWrap {
+ public:
+  static NAN_MODULE_INIT(Init) {
+    v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
+    tpl->InstanceTemplate()->SetInternalFieldCount(1);
+
+    Nan::SetPrototypeMethod(tpl, "getValue", GetValue);
+
+    constructor().Reset(Nan::GetFunction(tpl).ToLocalChecked());
+  }
+
+  static NAN_METHOD(NewInstance) {
+    v8::Local<v8::Function> cons = Nan::New(constructor());
+    double value = info[0]->IsNumber() ? Nan::To<double>(info[0]).FromJust() : 0;
+    const int argc = 1;
+    v8::Local<v8::Value> argv[1] = {Nan::New(value)};
+    info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked());
+  }
+
+  // Needed for the next example:
+  inline double value() const {
+    return value_;
+  }
+
+ private:
+  explicit MyFactoryObject(double value = 0) : value_(value) {}
+  ~MyFactoryObject() {}
+
+  static NAN_METHOD(New) {
+    if (info.IsConstructCall()) {
+      double value = info[0]->IsNumber() ? Nan::To<double>(info[0]).FromJust() : 0;
+      MyFactoryObject * obj = new MyFactoryObject(value);
+      obj->Wrap(info.This());
+      info.GetReturnValue().Set(info.This());
+    } else {
+      const int argc = 1;
+      v8::Local<v8::Value> argv[argc] = {info[0]};
+      v8::Local<v8::Function> cons = Nan::New(constructor());
+      info.GetReturnValue().Set(Nan::NewInstance(cons, argc, argv).ToLocalChecked());
+    }
+  }
+
+  static NAN_METHOD(GetValue) {
+    MyFactoryObject* obj = ObjectWrap::Unwrap<MyFactoryObject>(info.Holder());
+    info.GetReturnValue().Set(obj->value_);
+  }
+
+  static inline Nan::Persistent<v8::Function> & constructor() {
+    static Nan::Persistent<v8::Function> my_constructor;
+    return my_constructor;
+  }
+
+  double value_;
+};
+
+NAN_MODULE_INIT(Init) {
+  MyFactoryObject::Init(target);
+  Nan::Set(target,
+    Nan::New<v8::String>("newFactoryObjectInstance").ToLocalChecked(),
+    Nan::GetFunction(
+      Nan::New<v8::FunctionTemplate>(MyFactoryObject::NewInstance)).ToLocalChecked()
+  );
+}
+
+NODE_MODULE(wrappedobjectfactory, Init)
+```
+
+To use in Javascript:
+
+```Javascript
+var wrappedobjectfactory = require('bindings')('wrappedobjectfactory');
+
+var obj = wrappedobjectfactory.newFactoryObjectInstance(10);
+console.log('Should be 10: ' + obj.getValue());
+```
+
+#### Passing wrapped objects around
+
+Use the `MyFactoryObject` class above along with the following:
+
+```c++
+static NAN_METHOD(Sum) {
+  Nan::MaybeLocal<v8::Object> maybe1 = Nan::To<v8::Object>(info[0]);
+  Nan::MaybeLocal<v8::Object> maybe2 = Nan::To<v8::Object>(info[1]);
+
+  // Quick check:
+  if (maybe1.IsEmpty() || maybe2.IsEmpty()) {
+    // return value is undefined by default
+    return;
+  }
+
+  MyFactoryObject* obj1 =
+    Nan::ObjectWrap::Unwrap<MyFactoryObject>(maybe1.ToLocalChecked());
+  MyFactoryObject* obj2 =
+    Nan::ObjectWrap::Unwrap<MyFactoryObject>(maybe2.ToLocalChecked());
+
+  info.GetReturnValue().Set(Nan::New<v8::Number>(obj1->value() + obj2->value()));
+}
+
+NAN_MODULE_INIT(Init) {
+  MyFactoryObject::Init(target);
+  Nan::Set(target,
+    Nan::New<v8::String>("newFactoryObjectInstance").ToLocalChecked(),
+    Nan::GetFunction(
+      Nan::New<v8::FunctionTemplate>(MyFactoryObject::NewInstance)).ToLocalChecked()
+  );
+  Nan::Set(target,
+    Nan::New<v8::String>("sum").ToLocalChecked(),
+    Nan::GetFunction(Nan::New<v8::FunctionTemplate>(Sum)).ToLocalChecked()
+  );
+}
+
+NODE_MODULE(myaddon, Init)
+```
+
+To use in Javascript:
+
+```Javascript
+var myaddon = require('bindings')('myaddon');
+
+var obj1 = myaddon.newFactoryObjectInstance(5);
+var obj2 = myaddon.newFactoryObjectInstance(10);
+console.log('sum of object values: ' + myaddon.sum(obj1, obj2));
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/persistent.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/persistent.md
new file mode 100644 (file)
index 0000000..2e13f6b
--- /dev/null
@@ -0,0 +1,296 @@
+## Persistent references
+
+An object reference that is independent of any `HandleScope` is a _persistent_ reference. Where a `Local` handle only lives as long as the `HandleScope` in which it was allocated, a `Persistent` handle remains valid until it is explicitly disposed.
+
+Due to the evolution of the V8 API, it is necessary for NAN to provide a wrapper implementation of the `Persistent` classes to supply compatibility across the V8 versions supported.
+
+ - <a href="#api_nan_persistent_base"><b><code>Nan::PersistentBase & v8::PersistentBase</code></b></a>
+ - <a href="#api_nan_non_copyable_persistent_traits"><b><code>Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits</code></b></a>
+ - <a href="#api_nan_copyable_persistent_traits"><b><code>Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits</code></b></a>
+ - <a href="#api_nan_persistent"><b><code>Nan::Persistent</code></b></a>
+ - <a href="#api_nan_global"><b><code>Nan::Global</code></b></a>
+ - <a href="#api_nan_weak_callback_info"><b><code>Nan::WeakCallbackInfo</code></b></a>
+ - <a href="#api_nan_weak_callback_type"><b><code>Nan::WeakCallbackType</code></b></a>
+
+Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://developers.google.com/v8/embed#handles).
+
+<a name="api_nan_persistent_base"></a>
+### Nan::PersistentBase & v8::PersistentBase
+
+A persistent handle contains a reference to a storage cell in V8 which holds an object value and which is updated by the garbage collector whenever the object is moved. A new storage cell can be created using the constructor or `Nan::PersistentBase::Reset()`. Existing handles can be disposed using an argument-less `Nan::PersistentBase::Reset()`.
+
+Definition:
+
+_(note: this is implemented as `Nan::PersistentBase` for older versions of V8 and the native `v8::PersistentBase` is used for newer versions of V8)_
+
+```c++
+template<typename T> class PersistentBase {
+ public:
+  /**
+   * If non-empty, destroy the underlying storage cell
+   */
+  void Reset();
+
+  /**
+   * If non-empty, destroy the underlying storage cell and create a new one with
+   * the contents of another if it is also non-empty
+   */
+  template<typename S> void Reset(const v8::Local<S> &other);
+
+  /**
+   * If non-empty, destroy the underlying storage cell and create a new one with
+   * the contents of another if it is also non-empty
+   */
+  template<typename S> void Reset(const PersistentBase<S> &other);
+
+  /** Returns true if the handle is empty. */
+  bool IsEmpty() const;
+
+  /**
+   * If non-empty, destroy the underlying storage cell
+   * IsEmpty() will return true after this call.
+   */
+  void Empty();
+
+  template<typename S> bool operator==(const PersistentBase<S> &that);
+
+  template<typename S> bool operator==(const v8::Local<S> &that);
+
+  template<typename S> bool operator!=(const PersistentBase<S> &that);
+
+  template<typename S> bool operator!=(const v8::Local<S> &that);
+
+   /**
+   *  Install a finalization callback on this object.
+   *  NOTE: There is no guarantee as to *when* or even *if* the callback is
+   *  invoked. The invocation is performed solely on a best effort basis.
+   *  As always, GC-based finalization should *not* be relied upon for any
+   *  critical form of resource management! At the moment you can either
+   *  specify a parameter for the callback or the location of two internal
+   *  fields in the dying object.
+   */
+  template<typename P>
+  void SetWeak(P *parameter,
+               typename WeakCallbackInfo<P>::Callback callback,
+               WeakCallbackType type);
+
+  void ClearWeak();
+
+  /**
+   * Marks the reference to this object independent. Garbage collector is free
+   * to ignore any object groups containing this object. Weak callback for an
+   * independent handle should not assume that it will be preceded by a global
+   * GC prologue callback or followed by a global GC epilogue callback.
+   */
+  void MarkIndependent() const;
+
+  bool IsIndependent() const;
+
+  /** Checks if the handle holds the only reference to an object. */
+  bool IsNearDeath() const;
+
+  /** Returns true if the handle's reference is weak.  */
+  bool IsWeak() const
+};
+```
+
+See the V8 documentation for [`PersistentBase`](https://v8docs.nodesource.com/node-8.16/d4/dca/classv8_1_1_persistent_base.html) for further information.
+
+**Tip:** To get a `v8::Local` reference to the original object back from a `PersistentBase` or `Persistent` object:
+
+```c++
+v8::Local<v8::Object> object = Nan::New(persistent);
+```
+
+<a name="api_nan_non_copyable_persistent_traits"></a>
+### Nan::NonCopyablePersistentTraits & v8::NonCopyablePersistentTraits
+
+Default traits for `Nan::Persistent`. This class does not allow use of the a copy constructor or assignment operator. At present `kResetInDestructor` is not set, but that will change in a future version.
+
+Definition:
+
+_(note: this is implemented as `Nan::NonCopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_
+
+```c++
+template<typename T> class NonCopyablePersistentTraits {
+ public:
+  typedef Persistent<T, NonCopyablePersistentTraits<T> > NonCopyablePersistent;
+
+  static const bool kResetInDestructor = false;
+
+  template<typename S, typename M>
+  static void Copy(const Persistent<S, M> &source,
+                   NonCopyablePersistent *dest);
+
+  template<typename O> static void Uncompilable();
+};
+```
+
+See the V8 documentation for [`NonCopyablePersistentTraits`](https://v8docs.nodesource.com/node-8.16/de/d73/classv8_1_1_non_copyable_persistent_traits.html) for further information.
+
+<a name="api_nan_copyable_persistent_traits"></a>
+### Nan::CopyablePersistentTraits & v8::CopyablePersistentTraits
+
+A helper class of traits to allow copying and assignment of `Persistent`. This will clone the contents of storage cell, but not any of the flags, etc..
+
+Definition:
+
+_(note: this is implemented as `Nan::CopyablePersistentTraits` for older versions of V8 and the native `v8::NonCopyablePersistentTraits` is used for newer versions of V8)_
+
+```c++
+template<typename T>
+class CopyablePersistentTraits {
+ public:
+  typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
+
+  static const bool kResetInDestructor = true;
+
+  template<typename S, typename M>
+  static void Copy(const Persistent<S, M> &source,
+                   CopyablePersistent *dest);
+};
+```
+
+See the V8 documentation for [`CopyablePersistentTraits`](https://v8docs.nodesource.com/node-8.16/da/d5c/structv8_1_1_copyable_persistent_traits.html) for further information.
+
+<a name="api_nan_persistent"></a>
+### Nan::Persistent
+
+A type of `PersistentBase` which allows copy and assignment. Copy, assignment and destructor behavior is controlled by the traits class `M`.
+
+Definition:
+
+```c++
+template<typename T, typename M = NonCopyablePersistentTraits<T> >
+class Persistent;
+
+template<typename T, typename M> class Persistent : public PersistentBase<T> {
+ public:
+ /**
+  * A Persistent with no storage cell.
+  */
+  Persistent();
+
+  /**
+   * Construct a Persistent from a v8::Local. When the v8::Local is non-empty, a
+   * new storage cell is created pointing to the same object, and no flags are
+   * set.
+   */
+  template<typename S> Persistent(v8::Local<S> that);
+
+  /**
+   * Construct a Persistent from a Persistent. When the Persistent is non-empty,
+   * a new storage cell is created pointing to the same object, and no flags are
+   * set.
+   */
+  Persistent(const Persistent &that);
+
+  /**
+   * The copy constructors and assignment operator create a Persistent exactly
+   * as the Persistent constructor, but the Copy function from the traits class
+   * is called, allowing the setting of flags based on the copied Persistent.
+   */
+  Persistent &operator=(const Persistent &that);
+
+  template <typename S, typename M2>
+  Persistent &operator=(const Persistent<S, M2> &that);
+
+  /**
+   * The destructor will dispose the Persistent based on the kResetInDestructor
+   * flags in the traits class.  Since not calling dispose can result in a
+   * memory leak, it is recommended to always set this flag.
+   */
+  ~Persistent();
+};
+```
+
+See the V8 documentation for [`Persistent`](https://v8docs.nodesource.com/node-8.16/d2/d78/classv8_1_1_persistent.html) for further information.
+
+<a name="api_nan_global"></a>
+### Nan::Global
+
+A type of `PersistentBase` which has move semantics.
+
+```c++
+template<typename T> class Global : public PersistentBase<T> {
+ public:
+  /**
+   * A Global with no storage cell.
+   */
+  Global();
+
+  /**
+   * Construct a Global from a v8::Local. When the v8::Local is non-empty, a new
+   * storage cell is created pointing to the same object, and no flags are set.
+   */
+  template<typename S> Global(v8::Local<S> that);
+  /**
+   * Construct a Global from a PersistentBase. When the Persistent is non-empty,
+   * a new storage cell is created pointing to the same object, and no flags are
+   * set.
+   */
+  template<typename S> Global(const PersistentBase<S> &that);
+
+  /**
+   * Pass allows returning globals from functions, etc.
+   */
+  Global Pass();
+};
+```
+
+See the V8 documentation for [`Global`](https://v8docs.nodesource.com/node-8.16/d5/d40/classv8_1_1_global.html) for further information.
+
+<a name="api_nan_weak_callback_info"></a>
+### Nan::WeakCallbackInfo
+
+`Nan::WeakCallbackInfo` is used as an argument when setting a persistent reference as weak. You may need to free any external resources attached to the object. It is a mirror of `v8:WeakCallbackInfo` as found in newer versions of V8.
+
+Definition:
+
+```c++
+template<typename T> class WeakCallbackInfo {
+ public:
+  typedef void (*Callback)(const WeakCallbackInfo<T>& data);
+
+  v8::Isolate *GetIsolate() const;
+
+  /**
+   * Get the parameter that was associated with the weak handle.
+   */
+  T *GetParameter() const;
+
+  /**
+   * Get pointer from internal field, index can be 0 or 1.
+   */
+  void *GetInternalField(int index) const;
+};
+```
+
+Example usage:
+
+```c++
+void weakCallback(const WeakCallbackInfo<int> &data) {
+  int *parameter = data.GetParameter();
+  delete parameter;
+}
+
+Persistent<v8::Object> obj;
+int *data = new int(0);
+obj.SetWeak(data, callback, WeakCallbackType::kParameter);
+```
+
+See the V8 documentation for [`WeakCallbackInfo`](https://v8docs.nodesource.com/node-8.16/d8/d06/classv8_1_1_weak_callback_info.html) for further information.
+
+<a name="api_nan_weak_callback_type"></a>
+### Nan::WeakCallbackType
+
+Represents the type of a weak callback.
+A weak callback of type `kParameter` makes the supplied parameter to `Nan::PersistentBase::SetWeak` available through `WeakCallbackInfo::GetParameter`.
+A weak callback of type `kInternalFields` uses up to two internal fields at indices 0 and 1 on the `Nan::PersistentBase<v8::Object>` being made weak.
+Note that only `v8::Object`s and derivatives can have internal fields.
+
+Definition:
+
+```c++
+enum class WeakCallbackType { kParameter, kInternalFields };
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/scopes.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/scopes.md
new file mode 100644 (file)
index 0000000..84000ee
--- /dev/null
@@ -0,0 +1,73 @@
+## Scopes
+
+A _local handle_ is a pointer to an object. All V8 objects are accessed using handles, they are necessary because of the way the V8 garbage collector works.
+
+A handle scope can be thought of as a container for any number of handles. When you've finished with your handles, instead of deleting each one individually you can simply delete their scope.
+
+The creation of `HandleScope` objects is different across the supported versions of V8. Therefore, NAN provides its own implementations that can be used safely across these.
+
+ - <a href="#api_nan_handle_scope"><b><code>Nan::HandleScope</code></b></a>
+ - <a href="#api_nan_escapable_handle_scope"><b><code>Nan::EscapableHandleScope</code></b></a>
+
+Also see the V8 Embedders Guide section on [Handles and Garbage Collection](https://github.com/v8/v8/wiki/Embedder%27s%20Guide#handles-and-garbage-collection).
+
+<a name="api_nan_handle_scope"></a>
+### Nan::HandleScope
+
+A simple wrapper around [`v8::HandleScope`](https://v8docs.nodesource.com/node-8.16/d3/d95/classv8_1_1_handle_scope.html).
+
+Definition:
+
+```c++
+class Nan::HandleScope {
+ public:
+  Nan::HandleScope();
+  static int NumberOfHandles();
+};
+```
+
+Allocate a new `Nan::HandleScope` whenever you are creating new V8 JavaScript objects. Note that an implicit `HandleScope` is created for you on JavaScript-accessible methods so you do not need to insert one yourself.
+
+Example:
+
+```c++
+// new object is created, it needs a new scope:
+void Pointless() {
+  Nan::HandleScope scope;
+  v8::Local<v8::Object> obj = Nan::New<v8::Object>();
+}
+
+// JavaScript-accessible method already has a HandleScope
+NAN_METHOD(Pointless2) {
+  v8::Local<v8::Object> obj = Nan::New<v8::Object>();
+}
+```
+
+<a name="api_nan_escapable_handle_scope"></a>
+### Nan::EscapableHandleScope
+
+Similar to [`Nan::HandleScope`](#api_nan_handle_scope) but should be used in cases where a function needs to return a V8 JavaScript type that has been created within it.
+
+Definition:
+
+```c++
+class Nan::EscapableHandleScope {
+ public:
+  Nan::EscapableHandleScope();
+  static int NumberOfHandles();
+  template<typename T> v8::Local<T> Escape(v8::Local<T> value);
+}
+```
+
+Use `Escape(value)` to return the object.
+
+Example:
+
+```c++
+v8::Local<v8::Object> EmptyObj() {
+  Nan::EscapableHandleScope scope;
+  v8::Local<v8::Object> obj = Nan::New<v8::Object>();
+  return scope.Escape(obj);
+}
+```
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/script.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/script.md
new file mode 100644 (file)
index 0000000..213320a
--- /dev/null
@@ -0,0 +1,38 @@
+## Script
+
+NAN provides a `v8::Script` helpers as the API has changed over the supported versions of V8.
+
+ - <a href="#api_nan_compile_script"><b><code>Nan::CompileScript()</code></b></a>
+ - <a href="#api_nan_run_script"><b><code>Nan::RunScript()</code></b></a>
+
+
+<a name="api_nan_compile_script"></a>
+### Nan::CompileScript()
+
+A wrapper around [`v8::ScriptCompiler::Compile()`](https://v8docs.nodesource.com/node-8.16/da/da5/classv8_1_1_script_compiler.html#a93f5072a0db55d881b969e9fc98e564b).
+
+Note that `Nan::BoundScript` is an alias for `v8::Script`.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<Nan::BoundScript> Nan::CompileScript(
+    v8::Local<v8::String> s,
+    const v8::ScriptOrigin& origin);
+Nan::MaybeLocal<Nan::BoundScript> Nan::CompileScript(v8::Local<v8::String> s);
+```
+
+
+<a name="api_nan_run_script"></a>
+### Nan::RunScript()
+
+Calls `script->Run()` or `script->BindToCurrentContext()->Run(Nan::GetCurrentContext())`.
+
+Note that `Nan::BoundScript` is an alias for `v8::Script` and `Nan::UnboundScript` is an alias for `v8::UnboundScript` where available and `v8::Script` on older versions of V8.
+
+Signature:
+
+```c++
+Nan::MaybeLocal<v8::Value> Nan::RunScript(v8::Local<Nan::UnboundScript> script)
+Nan::MaybeLocal<v8::Value> Nan::RunScript(v8::Local<Nan::BoundScript> script) 
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/string_bytes.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/string_bytes.md
new file mode 100644 (file)
index 0000000..7c1bd32
--- /dev/null
@@ -0,0 +1,62 @@
+## Strings & Bytes
+
+Miscellaneous string & byte encoding and decoding functionality provided for compatibility across supported versions of V8 and Node. Implemented by NAN to ensure that all encoding types are supported, even for older versions of Node where they are missing.
+
+ - <a href="#api_nan_encoding"><b><code>Nan::Encoding</code></b></a>
+ - <a href="#api_nan_encode"><b><code>Nan::Encode()</code></b></a>
+ - <a href="#api_nan_decode_bytes"><b><code>Nan::DecodeBytes()</code></b></a>
+ - <a href="#api_nan_decode_write"><b><code>Nan::DecodeWrite()</code></b></a>
+
+
+<a name="api_nan_encoding"></a>
+### Nan::Encoding
+
+An enum representing the supported encoding types. A copy of `node::encoding` that is consistent across versions of Node.
+
+Definition:
+
+```c++
+enum Nan::Encoding { ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER }
+```
+
+
+<a name="api_nan_encode"></a>
+### Nan::Encode()
+
+A wrapper around `node::Encode()` that provides a consistent implementation across supported versions of Node.
+
+Signature:
+
+```c++
+v8::Local<v8::Value> Nan::Encode(const void *buf,
+                                 size_t len,
+                                 enum Nan::Encoding encoding = BINARY);
+```
+
+
+<a name="api_nan_decode_bytes"></a>
+### Nan::DecodeBytes()
+
+A wrapper around `node::DecodeBytes()` that provides a consistent implementation across supported versions of Node.
+
+Signature:
+
+```c++
+ssize_t Nan::DecodeBytes(v8::Local<v8::Value> val,
+                         enum Nan::Encoding encoding = BINARY);
+```
+
+
+<a name="api_nan_decode_write"></a>
+### Nan::DecodeWrite()
+
+A wrapper around `node::DecodeWrite()` that provides a consistent implementation across supported versions of Node.
+
+Signature:
+
+```c++
+ssize_t Nan::DecodeWrite(char *buf,
+                         size_t len,
+                         v8::Local<v8::Value> val,
+                         enum Nan::Encoding encoding = BINARY);
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/v8_internals.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/v8_internals.md
new file mode 100644 (file)
index 0000000..08dd6d0
--- /dev/null
@@ -0,0 +1,199 @@
+## V8 internals
+
+The hooks to access V8 internals—including GC and statistics—are different across the supported versions of V8, therefore NAN provides its own hooks that call the appropriate V8 methods.
+
+ - <a href="#api_nan_gc_callback"><b><code>NAN_GC_CALLBACK()</code></b></a>
+ - <a href="#api_nan_add_gc_epilogue_callback"><b><code>Nan::AddGCEpilogueCallback()</code></b></a>
+ - <a href="#api_nan_remove_gc_epilogue_callback"><b><code>Nan::RemoveGCEpilogueCallback()</code></b></a>
+ - <a href="#api_nan_add_gc_prologue_callback"><b><code>Nan::AddGCPrologueCallback()</code></b></a>
+ - <a href="#api_nan_remove_gc_prologue_callback"><b><code>Nan::RemoveGCPrologueCallback()</code></b></a>
+ - <a href="#api_nan_get_heap_statistics"><b><code>Nan::GetHeapStatistics()</code></b></a>
+ - <a href="#api_nan_set_counter_function"><b><code>Nan::SetCounterFunction()</code></b></a>
+ - <a href="#api_nan_set_create_histogram_function"><b><code>Nan::SetCreateHistogramFunction()</code></b></a>
+ - <a href="#api_nan_set_add_histogram_sample_function"><b><code>Nan::SetAddHistogramSampleFunction()</code></b></a>
+ - <a href="#api_nan_idle_notification"><b><code>Nan::IdleNotification()</code></b></a>
+ - <a href="#api_nan_low_memory_notification"><b><code>Nan::LowMemoryNotification()</code></b></a>
+ - <a href="#api_nan_context_disposed_notification"><b><code>Nan::ContextDisposedNotification()</code></b></a>
+ - <a href="#api_nan_get_internal_field_pointer"><b><code>Nan::GetInternalFieldPointer()</code></b></a>
+ - <a href="#api_nan_set_internal_field_pointer"><b><code>Nan::SetInternalFieldPointer()</code></b></a>
+ - <a href="#api_nan_adjust_external_memory"><b><code>Nan::AdjustExternalMemory()</code></b></a>
+
+
+<a name="api_nan_gc_callback"></a>
+### NAN_GC_CALLBACK(callbackname)
+
+Use `NAN_GC_CALLBACK` to declare your callbacks for `Nan::AddGCPrologueCallback()` and `Nan::AddGCEpilogueCallback()`. Your new method receives the arguments `v8::GCType type` and `v8::GCCallbackFlags flags`.
+
+```c++
+static Nan::Persistent<Function> callback;
+
+NAN_GC_CALLBACK(gcPrologueCallback) {
+  v8::Local<Value> argv[] = { Nan::New("prologue").ToLocalChecked() };
+  Nan::MakeCallback(Nan::GetCurrentContext()->Global(), Nan::New(callback), 1, argv);
+}
+
+NAN_METHOD(Hook) {
+  callback.Reset(To<Function>(args[0]).ToLocalChecked());
+  Nan::AddGCPrologueCallback(gcPrologueCallback);
+  info.GetReturnValue().Set(info.Holder());
+}
+```
+
+<a name="api_nan_add_gc_epilogue_callback"></a>
+### Nan::AddGCEpilogueCallback()
+
+Signature:
+
+```c++
+void Nan::AddGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback, v8::GCType gc_type_filter = v8::kGCTypeAll)
+```
+
+Calls V8's [`AddGCEpilogueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a580f976e4290cead62c2fc4dd396be3e).
+
+<a name="api_nan_remove_gc_epilogue_callback"></a>
+### Nan::RemoveGCEpilogueCallback()
+
+Signature:
+
+```c++
+void Nan::RemoveGCEpilogueCallback(v8::Isolate::GCEpilogueCallback callback)
+```
+
+Calls V8's [`RemoveGCEpilogueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#adca9294555a3908e9f23c7bb0f0f284c).
+
+<a name="api_nan_add_gc_prologue_callback"></a>
+### Nan::AddGCPrologueCallback()
+
+Signature:
+
+```c++
+void Nan::AddGCPrologueCallback(v8::Isolate::GCPrologueCallback, v8::GCType gc_type_filter callback)
+```
+
+Calls V8's [`AddGCPrologueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a6dbef303603ebdb03da6998794ea05b8).
+
+<a name="api_nan_remove_gc_prologue_callback"></a>
+### Nan::RemoveGCPrologueCallback()
+
+Signature:
+
+```c++
+void Nan::RemoveGCPrologueCallback(v8::Isolate::GCPrologueCallback callback)
+```
+
+Calls V8's [`RemoveGCPrologueCallback()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a5f72c7cda21415ce062bbe5c58abe09e).
+
+<a name="api_nan_get_heap_statistics"></a>
+### Nan::GetHeapStatistics()
+
+Signature:
+
+```c++
+void Nan::GetHeapStatistics(v8::HeapStatistics *heap_statistics)
+```
+
+Calls V8's [`GetHeapStatistics()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a5593ac74687b713095c38987e5950b34).
+
+<a name="api_nan_set_counter_function"></a>
+### Nan::SetCounterFunction()
+
+Signature:
+
+```c++
+void Nan::SetCounterFunction(v8::CounterLookupCallback cb)
+```
+
+Calls V8's [`SetCounterFunction()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a045d7754e62fa0ec72ae6c259b29af94).
+
+<a name="api_nan_set_create_histogram_function"></a>
+### Nan::SetCreateHistogramFunction()
+
+Signature:
+
+```c++
+void Nan::SetCreateHistogramFunction(v8::CreateHistogramCallback cb) 
+```
+
+Calls V8's [`SetCreateHistogramFunction()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a542d67e85089cb3f92aadf032f99e732).
+
+<a name="api_nan_set_add_histogram_sample_function"></a>
+### Nan::SetAddHistogramSampleFunction()
+
+Signature:
+
+```c++
+void Nan::SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) 
+```
+
+Calls V8's [`SetAddHistogramSampleFunction()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#aeb420b690bc2c216882d6fdd00ddd3ea).
+
+<a name="api_nan_idle_notification"></a>
+### Nan::IdleNotification()
+
+Signature:
+
+```c++
+bool Nan::IdleNotification(int idle_time_in_ms)
+```
+
+Calls V8's [`IdleNotification()` or `IdleNotificationDeadline()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#ad6a2a02657f5425ad460060652a5a118) depending on V8 version.
+
+<a name="api_nan_low_memory_notification"></a>
+### Nan::LowMemoryNotification()
+
+Signature:
+
+```c++
+void Nan::LowMemoryNotification() 
+```
+
+Calls V8's [`LowMemoryNotification()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a24647f61d6b41f69668094bdcd6ea91f).
+
+<a name="api_nan_context_disposed_notification"></a>
+### Nan::ContextDisposedNotification()
+
+Signature:
+
+```c++
+void Nan::ContextDisposedNotification()
+```
+
+Calls V8's [`ContextDisposedNotification()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#ad7f5dc559866343fe6cd8db1f134d48b).
+
+<a name="api_nan_get_internal_field_pointer"></a>
+### Nan::GetInternalFieldPointer()
+
+Gets a pointer to the internal field with at `index` from a V8 `Object` handle.
+
+Signature:
+
+```c++
+void* Nan::GetInternalFieldPointer(v8::Local<v8::Object> object, int index) 
+```
+
+Calls the Object's [`GetAlignedPointerFromInternalField()` or `GetPointerFromInternalField()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#a580ea84afb26c005d6762eeb9e3c308f) depending on the version of V8.
+
+<a name="api_nan_set_internal_field_pointer"></a>
+### Nan::SetInternalFieldPointer()
+
+Sets the value of the internal field at `index` on a V8 `Object` handle.
+
+Signature:
+
+```c++
+void Nan::SetInternalFieldPointer(v8::Local<v8::Object> object, int index, void* value)
+```
+
+Calls the Object's [`SetAlignedPointerInInternalField()` or `SetPointerInInternalField()`](https://v8docs.nodesource.com/node-8.16/db/d85/classv8_1_1_object.html#ab3c57184263cf29963ef0017bec82281) depending on the version of V8.
+
+<a name="api_nan_adjust_external_memory"></a>
+### Nan::AdjustExternalMemory()
+
+Signature:
+
+```c++
+int Nan::AdjustExternalMemory(int bytesChange)
+```
+
+Calls V8's [`AdjustAmountOfExternalAllocatedMemory()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#ae1a59cac60409d3922582c4af675473e).
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/doc/v8_misc.md b/legacy-libs/grpc-cloned/node_modules/nan/doc/v8_misc.md
new file mode 100644 (file)
index 0000000..1bd46d3
--- /dev/null
@@ -0,0 +1,85 @@
+## Miscellaneous V8 Helpers
+
+ - <a href="#api_nan_utf8_string"><b><code>Nan::Utf8String</code></b></a>
+ - <a href="#api_nan_get_current_context"><b><code>Nan::GetCurrentContext()</code></b></a>
+ - <a href="#api_nan_set_isolate_data"><b><code>Nan::SetIsolateData()</code></b></a>
+ - <a href="#api_nan_get_isolate_data"><b><code>Nan::GetIsolateData()</code></b></a>
+ - <a href="#api_nan_typedarray_contents"><b><code>Nan::TypedArrayContents</code></b></a>
+
+
+<a name="api_nan_utf8_string"></a>
+### Nan::Utf8String
+
+Converts an object to a UTF-8-encoded character array. If conversion to a string fails (e.g. due to an exception in the toString() method of the object) then the length() method returns 0 and the * operator returns NULL. The underlying memory used for this object is managed by the object.
+
+An implementation of [`v8::String::Utf8Value`](https://v8docs.nodesource.com/node-8.16/d4/d1b/classv8_1_1_string_1_1_utf8_value.html) that is consistent across all supported versions of V8.
+
+Definition:
+
+```c++
+class Nan::Utf8String {
+ public:
+  Nan::Utf8String(v8::Local<v8::Value> from);
+
+  int length() const;
+
+  char* operator*();
+  const char* operator*() const;
+};
+```
+
+<a name="api_nan_get_current_context"></a>
+### Nan::GetCurrentContext()
+
+A call to [`v8::Isolate::GetCurrent()->GetCurrentContext()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a81c7a1ed7001ae2a65e89107f75fd053) that works across all supported versions of V8.
+
+Signature:
+
+```c++
+v8::Local<v8::Context> Nan::GetCurrentContext()
+```
+
+<a name="api_nan_set_isolate_data"></a>
+### Nan::SetIsolateData()
+
+A helper to provide a consistent API to [`v8::Isolate#SetData()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#a7acadfe7965997e9c386a05f098fbe36).
+
+Signature:
+
+```c++
+void Nan::SetIsolateData(v8::Isolate *isolate, T *data)
+```
+
+
+<a name="api_nan_get_isolate_data"></a>
+### Nan::GetIsolateData()
+
+A helper to provide a consistent API to [`v8::Isolate#GetData()`](https://v8docs.nodesource.com/node-8.16/d5/dda/classv8_1_1_isolate.html#aabd223436bc1100a787dadaa024c6257).
+
+Signature:
+
+```c++
+T *Nan::GetIsolateData(v8::Isolate *isolate)
+```
+
+<a name="api_nan_typedarray_contents"></a>
+### Nan::TypedArrayContents<T>
+
+A helper class for accessing the contents of an ArrayBufferView (aka a typedarray) from C++.  If the input array is not a valid typedarray, then the data pointer of TypedArrayContents will default to `NULL` and the length will be 0.  If the data pointer is not compatible with the alignment requirements of type, an assertion error will fail.
+
+Note that you must store a reference to the `array` object while you are accessing its contents.
+
+Definition:
+
+```c++
+template<typename T>
+class Nan::TypedArrayContents {
+ public:
+  TypedArrayContents(v8::Local<Value> array);
+
+  size_t length() const;
+
+  T* const operator*();
+  const T* const operator*() const;
+};
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/include_dirs.js b/legacy-libs/grpc-cloned/node_modules/nan/include_dirs.js
new file mode 100644 (file)
index 0000000..4f1dfb4
--- /dev/null
@@ -0,0 +1 @@
+console.log(require('path').relative('.', __dirname));
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan.h b/legacy-libs/grpc-cloned/node_modules/nan/nan.h
new file mode 100644 (file)
index 0000000..59cd9b6
--- /dev/null
@@ -0,0 +1,2898 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors:
+ *   - Rod Vagg <https://github.com/rvagg>
+ *   - Benjamin Byholm <https://github.com/kkoopa>
+ *   - Trevor Norris <https://github.com/trevnorris>
+ *   - Nathan Rajlich <https://github.com/TooTallNate>
+ *   - Brett Lawson <https://github.com/brett19>
+ *   - Ben Noordhuis <https://github.com/bnoordhuis>
+ *   - David Siegel <https://github.com/agnat>
+ *   - Michael Ira Krufky <https://github.com/mkrufky>
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ *
+ * Version 2.14.2: current Node 14.13.1, Node 0.12: 0.12.18, Node 0.10: 0.10.48, iojs: 3.3.1
+ *
+ * See https://github.com/nodejs/nan for the latest update to this file
+ **********************************************************************************/
+
+#ifndef NAN_H_
+#define NAN_H_
+
+#include <node_version.h>
+
+#define NODE_0_10_MODULE_VERSION 11
+#define NODE_0_12_MODULE_VERSION 14
+#define ATOM_0_21_MODULE_VERSION 41
+#define IOJS_1_0_MODULE_VERSION  42
+#define IOJS_1_1_MODULE_VERSION  43
+#define IOJS_2_0_MODULE_VERSION  44
+#define IOJS_3_0_MODULE_VERSION  45
+#define NODE_4_0_MODULE_VERSION  46
+#define NODE_5_0_MODULE_VERSION  47
+#define NODE_6_0_MODULE_VERSION  48
+#define NODE_7_0_MODULE_VERSION  51
+#define NODE_8_0_MODULE_VERSION  57
+#define NODE_9_0_MODULE_VERSION  59
+#define NODE_10_0_MODULE_VERSION 64
+#define NODE_11_0_MODULE_VERSION 67
+#define NODE_12_0_MODULE_VERSION 72
+#define NODE_13_0_MODULE_VERSION 79
+#define NODE_14_0_MODULE_VERSION 83
+
+#ifdef _MSC_VER
+# define NAN_HAS_CPLUSPLUS_11 (_MSC_VER >= 1800)
+#else
+# define NAN_HAS_CPLUSPLUS_11 (__cplusplus >= 201103L)
+#endif
+
+#if NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION && !NAN_HAS_CPLUSPLUS_11
+# error This version of node/NAN/v8 requires a C++11 compiler
+#endif
+
+#include <uv.h>
+#include <node.h>
+#include <node_buffer.h>
+#include <node_object_wrap.h>
+#include <algorithm>
+#include <cstring>
+#include <climits>
+#include <cstdlib>
+#include <utility>
+#if defined(_MSC_VER)
+# pragma warning( push )
+# pragma warning( disable : 4530 )
+# include <queue>
+# include <string>
+# include <vector>
+# pragma warning( pop )
+#else
+# include <queue>
+# include <string>
+# include <vector>
+#endif
+
+// uv helpers
+#ifdef UV_VERSION_MAJOR
+# ifndef UV_VERSION_PATCH
+#  define UV_VERSION_PATCH 0
+# endif
+# define NAUV_UVVERSION ((UV_VERSION_MAJOR << 16) | \
+                         (UV_VERSION_MINOR <<  8) | \
+                         (UV_VERSION_PATCH))
+#else
+# define NAUV_UVVERSION 0x000b00
+#endif
+
+#if NAUV_UVVERSION < 0x000b0b
+# ifdef WIN32
+#  include <windows.h>
+# else
+#  include <pthread.h>
+# endif
+#endif
+
+namespace Nan {
+
+#define NAN_CONCAT(a, b) NAN_CONCAT_HELPER(a, b)
+#define NAN_CONCAT_HELPER(a, b) a##b
+
+#define NAN_INLINE inline  // TODO(bnoordhuis) Remove in v3.0.0.
+
+#if defined(__GNUC__) && \
+    !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS)
+# define NAN_DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER) && \
+    !(defined(V8_DISABLE_DEPRECATIONS) && V8_DISABLE_DEPRECATIONS)
+# define NAN_DEPRECATED __declspec(deprecated)
+#else
+# define NAN_DEPRECATED
+#endif
+
+#if NAN_HAS_CPLUSPLUS_11
+# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&) = delete;
+# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&) = delete;
+# define NAN_DISALLOW_MOVE(CLASS)                                              \
+    CLASS(CLASS&&) = delete;  /* NOLINT(build/c++11) */                        \
+    void operator=(CLASS&&) = delete;
+#else
+# define NAN_DISALLOW_ASSIGN(CLASS) void operator=(const CLASS&);
+# define NAN_DISALLOW_COPY(CLASS) CLASS(const CLASS&);
+# define NAN_DISALLOW_MOVE(CLASS)
+#endif
+
+#define NAN_DISALLOW_ASSIGN_COPY(CLASS)                                        \
+    NAN_DISALLOW_ASSIGN(CLASS)                                                 \
+    NAN_DISALLOW_COPY(CLASS)
+
+#define NAN_DISALLOW_ASSIGN_MOVE(CLASS)                                        \
+    NAN_DISALLOW_ASSIGN(CLASS)                                                 \
+    NAN_DISALLOW_MOVE(CLASS)
+
+#define NAN_DISALLOW_COPY_MOVE(CLASS)                                          \
+    NAN_DISALLOW_COPY(CLASS)                                                   \
+    NAN_DISALLOW_MOVE(CLASS)
+
+#define NAN_DISALLOW_ASSIGN_COPY_MOVE(CLASS)                                   \
+    NAN_DISALLOW_ASSIGN(CLASS)                                                 \
+    NAN_DISALLOW_COPY(CLASS)                                                   \
+    NAN_DISALLOW_MOVE(CLASS)
+
+#define TYPE_CHECK(T, S)                                                       \
+    while (false) {                                                            \
+      *(static_cast<T *volatile *>(0)) = static_cast<S*>(0);                   \
+    }
+
+//=== RegistrationFunction =====================================================
+
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+  typedef v8::Handle<v8::Object> ADDON_REGISTER_FUNCTION_ARGS_TYPE;
+#else
+  typedef v8::Local<v8::Object> ADDON_REGISTER_FUNCTION_ARGS_TYPE;
+#endif
+
+#define NAN_MODULE_INIT(name)                                                  \
+    void name(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE target)
+
+#if NODE_MAJOR_VERSION >= 10 || \
+    NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3
+#define NAN_MODULE_WORKER_ENABLED(module_name, registration)                   \
+    extern "C" NODE_MODULE_EXPORT void                                         \
+      NAN_CONCAT(node_register_module_v, NODE_MODULE_VERSION)(                 \
+        v8::Local<v8::Object> exports, v8::Local<v8::Value> module,            \
+        v8::Local<v8::Context> context)                                        \
+    {                                                                          \
+        registration(exports);                                                 \
+    }
+#else
+#define NAN_MODULE_WORKER_ENABLED(module_name, registration)                   \
+    NODE_MODULE(module_name, registration)
+#endif
+
+//=== CallbackInfo =============================================================
+
+#include "nan_callbacks.h"  // NOLINT(build/include)
+
+//==============================================================================
+
+#if (NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION)
+typedef v8::Script             UnboundScript;
+typedef v8::Script             BoundScript;
+#else
+typedef v8::UnboundScript      UnboundScript;
+typedef v8::Script             BoundScript;
+#endif
+
+#if (NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION)
+typedef v8::String::ExternalAsciiStringResource
+    ExternalOneByteStringResource;
+#else
+typedef v8::String::ExternalOneByteStringResource
+    ExternalOneByteStringResource;
+#endif
+
+#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
+template<typename T>
+class NonCopyablePersistentTraits :
+    public v8::NonCopyablePersistentTraits<T> {};
+template<typename T>
+class CopyablePersistentTraits :
+    public v8::CopyablePersistentTraits<T> {};
+
+template<typename T>
+class PersistentBase :
+    public v8::PersistentBase<T> {};
+
+template<typename T, typename M = v8::NonCopyablePersistentTraits<T> >
+class Persistent;
+#else
+template<typename T> class NonCopyablePersistentTraits;
+template<typename T> class PersistentBase;
+template<typename T, typename P> class WeakCallbackData;
+template<typename T, typename M = NonCopyablePersistentTraits<T> >
+class Persistent;
+#endif  // NODE_MODULE_VERSION
+
+template<typename T>
+class Maybe {
+ public:
+  inline bool IsNothing() const { return !has_value_; }
+  inline bool IsJust() const { return has_value_; }
+
+  inline T ToChecked() const { return FromJust(); }
+  inline void Check() const { FromJust(); }
+
+  inline bool To(T* out) const {
+    if (IsJust()) *out = value_;
+    return IsJust();
+  }
+
+  inline T FromJust() const {
+#if defined(V8_ENABLE_CHECKS)
+    assert(IsJust() && "FromJust is Nothing");
+#endif  // V8_ENABLE_CHECKS
+    return value_;
+  }
+
+  inline T FromMaybe(const T& default_value) const {
+    return has_value_ ? value_ : default_value;
+  }
+
+  inline bool operator==(const Maybe &other) const {
+    return (IsJust() == other.IsJust()) &&
+        (!IsJust() || FromJust() == other.FromJust());
+  }
+
+  inline bool operator!=(const Maybe &other) const {
+    return !operator==(other);
+  }
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+  // Allow implicit conversions from v8::Maybe<T> to Nan::Maybe<T>.
+  Maybe(const v8::Maybe<T>& that)  // NOLINT(runtime/explicit)
+    : has_value_(that.IsJust())
+    , value_(that.FromMaybe(T())) {}
+#endif
+
+ private:
+  Maybe() : has_value_(false) {}
+  explicit Maybe(const T& t) : has_value_(true), value_(t) {}
+  bool has_value_;
+  T value_;
+
+  template<typename U>
+  friend Maybe<U> Nothing();
+  template<typename U>
+  friend Maybe<U> Just(const U& u);
+};
+
+template<typename T>
+inline Maybe<T> Nothing() {
+  return Maybe<T>();
+}
+
+template<typename T>
+inline Maybe<T> Just(const T& t) {
+  return Maybe<T>(t);
+}
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+# include "nan_maybe_43_inl.h"  // NOLINT(build/include)
+#else
+# include "nan_maybe_pre_43_inl.h"  // NOLINT(build/include)
+#endif
+
+#include "nan_converters.h"  // NOLINT(build/include)
+#include "nan_new.h"  // NOLINT(build/include)
+
+#if NAUV_UVVERSION < 0x000b17
+#define NAUV_WORK_CB(func) \
+    void func(uv_async_t *async, int)
+#else
+#define NAUV_WORK_CB(func) \
+    void func(uv_async_t *async)
+#endif
+
+#if NAUV_UVVERSION >= 0x000b0b
+
+typedef uv_key_t nauv_key_t;
+
+inline int nauv_key_create(nauv_key_t *key) {
+  return uv_key_create(key);
+}
+
+inline void nauv_key_delete(nauv_key_t *key) {
+  uv_key_delete(key);
+}
+
+inline void* nauv_key_get(nauv_key_t *key) {
+  return uv_key_get(key);
+}
+
+inline void nauv_key_set(nauv_key_t *key, void *value) {
+  uv_key_set(key, value);
+}
+
+#else
+
+/* Implement thread local storage for older versions of libuv.
+ * This is essentially a backport of libuv commit 5d2434bf
+ * written by Ben Noordhuis, adjusted for names and inline.
+ */
+
+#ifndef WIN32
+
+typedef pthread_key_t nauv_key_t;
+
+inline int nauv_key_create(nauv_key_t* key) {
+  return -pthread_key_create(key, NULL);
+}
+
+inline void nauv_key_delete(nauv_key_t* key) {
+  if (pthread_key_delete(*key))
+    abort();
+}
+
+inline void* nauv_key_get(nauv_key_t* key) {
+  return pthread_getspecific(*key);
+}
+
+inline void nauv_key_set(nauv_key_t* key, void* value) {
+  if (pthread_setspecific(*key, value))
+    abort();
+}
+
+#else
+
+typedef struct {
+  DWORD tls_index;
+} nauv_key_t;
+
+inline int nauv_key_create(nauv_key_t* key) {
+  key->tls_index = TlsAlloc();
+  if (key->tls_index == TLS_OUT_OF_INDEXES)
+    return UV_ENOMEM;
+  return 0;
+}
+
+inline void nauv_key_delete(nauv_key_t* key) {
+  if (TlsFree(key->tls_index) == FALSE)
+    abort();
+  key->tls_index = TLS_OUT_OF_INDEXES;
+}
+
+inline void* nauv_key_get(nauv_key_t* key) {
+  void* value = TlsGetValue(key->tls_index);
+  if (value == NULL)
+    if (GetLastError() != ERROR_SUCCESS)
+      abort();
+  return value;
+}
+
+inline void nauv_key_set(nauv_key_t* key, void* value) {
+  if (TlsSetValue(key->tls_index, value) == FALSE)
+    abort();
+}
+
+#endif
+#endif
+
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+template<typename T>
+v8::Local<T> New(v8::Handle<T>);
+#endif
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+  typedef v8::WeakCallbackType WeakCallbackType;
+#else
+struct WeakCallbackType {
+  enum E {kParameter, kInternalFields};
+  E type;
+  WeakCallbackType(E other) : type(other) {}  // NOLINT(runtime/explicit)
+  inline bool operator==(E other) { return other == this->type; }
+  inline bool operator!=(E other) { return !operator==(other); }
+};
+#endif
+
+template<typename P> class WeakCallbackInfo;
+
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+# include "nan_persistent_12_inl.h"  // NOLINT(build/include)
+#else
+# include "nan_persistent_pre_12_inl.h"  // NOLINT(build/include)
+#endif
+
+namespace imp {
+  static const size_t kMaxLength = 0x3fffffff;
+  // v8::String::REPLACE_INVALID_UTF8 was introduced
+  // in node.js v0.10.29 and v0.8.27.
+#if NODE_MAJOR_VERSION > 0 || \
+    NODE_MINOR_VERSION > 10 || \
+    NODE_MINOR_VERSION == 10 && NODE_PATCH_VERSION >= 29 || \
+    NODE_MINOR_VERSION == 8 && NODE_PATCH_VERSION >= 27
+  static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
+#else
+  static const unsigned kReplaceInvalidUtf8 = 0;
+#endif
+}  // end of namespace imp
+
+//=== HandleScope ==============================================================
+
+class HandleScope {
+  v8::HandleScope scope;
+
+ public:
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  inline HandleScope() : scope(v8::Isolate::GetCurrent()) {}
+  inline static int NumberOfHandles() {
+    return v8::HandleScope::NumberOfHandles(v8::Isolate::GetCurrent());
+  }
+#else
+  inline HandleScope() : scope() {}
+  inline static int NumberOfHandles() {
+    return v8::HandleScope::NumberOfHandles();
+  }
+#endif
+
+ private:
+  // Make it hard to create heap-allocated or illegal handle scopes by
+  // disallowing certain operations.
+  HandleScope(const HandleScope &);
+  void operator=(const HandleScope &);
+  void *operator new(size_t size);
+  void operator delete(void *, size_t) {
+    abort();
+  }
+};
+
+class EscapableHandleScope {
+ public:
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  inline EscapableHandleScope() : scope(v8::Isolate::GetCurrent()) {}
+
+  inline static int NumberOfHandles() {
+    return v8::EscapableHandleScope::NumberOfHandles(v8::Isolate::GetCurrent());
+  }
+
+  template<typename T>
+  inline v8::Local<T> Escape(v8::Local<T> value) {
+    return scope.Escape(value);
+  }
+
+ private:
+  v8::EscapableHandleScope scope;
+#else
+  inline EscapableHandleScope() : scope() {}
+
+  inline static int NumberOfHandles() {
+    return v8::HandleScope::NumberOfHandles();
+  }
+
+  template<typename T>
+  inline v8::Local<T> Escape(v8::Local<T> value) {
+    return scope.Close(value);
+  }
+
+ private:
+  v8::HandleScope scope;
+#endif
+
+ private:
+  // Make it hard to create heap-allocated or illegal handle scopes by
+  // disallowing certain operations.
+  EscapableHandleScope(const EscapableHandleScope &);
+  void operator=(const EscapableHandleScope &);
+  void *operator new(size_t size);
+  void operator delete(void *, size_t) {
+    abort();
+  }
+};
+
+//=== TryCatch =================================================================
+
+class TryCatch {
+  v8::TryCatch try_catch_;
+  friend void FatalException(const TryCatch&);
+
+ public:
+#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+  TryCatch() : try_catch_(v8::Isolate::GetCurrent()) {}
+#endif
+
+  inline bool HasCaught() const { return try_catch_.HasCaught(); }
+
+  inline bool CanContinue() const { return try_catch_.CanContinue(); }
+
+  inline v8::Local<v8::Value> ReThrow() {
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    return New(try_catch_.ReThrow());
+#else
+    return try_catch_.ReThrow();
+#endif
+  }
+
+  inline v8::Local<v8::Value> Exception() const {
+    return try_catch_.Exception();
+  }
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+  inline v8::MaybeLocal<v8::Value> StackTrace() const {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(try_catch_.StackTrace(isolate->GetCurrentContext())
+                            .FromMaybe(v8::Local<v8::Value>()));
+  }
+#else
+  inline MaybeLocal<v8::Value> StackTrace() const {
+    return try_catch_.StackTrace();
+  }
+#endif
+
+  inline v8::Local<v8::Message> Message() const {
+    return try_catch_.Message();
+  }
+
+  inline void Reset() { try_catch_.Reset(); }
+
+  inline void SetVerbose(bool value) { try_catch_.SetVerbose(value); }
+
+  inline void SetCaptureMessage(bool value) {
+    try_catch_.SetCaptureMessage(value);
+  }
+};
+
+v8::Local<v8::Value> MakeCallback(v8::Local<v8::Object> target,
+                                  v8::Local<v8::Function> func,
+                                  int argc,
+                                  v8::Local<v8::Value>* argv);
+v8::Local<v8::Value> MakeCallback(v8::Local<v8::Object> target,
+                                  v8::Local<v8::String> symbol,
+                                  int argc,
+                                  v8::Local<v8::Value>* argv);
+v8::Local<v8::Value> MakeCallback(v8::Local<v8::Object> target,
+                                  const char* method,
+                                  int argc,
+                                  v8::Local<v8::Value>* argv);
+
+// === AsyncResource ===========================================================
+
+class AsyncResource {
+ public:
+  AsyncResource(
+      v8::Local<v8::String> name
+    , v8::Local<v8::Object> resource = New<v8::Object>()) {
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+
+    if (resource.IsEmpty()) {
+      resource = New<v8::Object>();
+    }
+
+    context = node::EmitAsyncInit(isolate, resource, name);
+#endif
+  }
+
+  AsyncResource(
+      const char* name
+    , v8::Local<v8::Object> resource = New<v8::Object>()) {
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+
+    if (resource.IsEmpty()) {
+      resource = New<v8::Object>();
+    }
+
+    v8::Local<v8::String> name_string =
+        New<v8::String>(name).ToLocalChecked();
+    context = node::EmitAsyncInit(isolate, resource, name_string);
+#endif
+  }
+
+  ~AsyncResource() {
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    node::EmitAsyncDestroy(isolate, context);
+#endif
+  }
+
+  inline MaybeLocal<v8::Value> runInAsyncScope(
+      v8::Local<v8::Object> target
+    , v8::Local<v8::Function> func
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION
+    return MakeCallback(target, func, argc, argv);
+#else
+    return node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, func, argc, argv, context);
+#endif
+  }
+
+  inline MaybeLocal<v8::Value> runInAsyncScope(
+      v8::Local<v8::Object> target
+    , v8::Local<v8::String> symbol
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION
+    return MakeCallback(target, symbol, argc, argv);
+#else
+    return node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, symbol, argc, argv, context);
+#endif
+  }
+
+  inline MaybeLocal<v8::Value> runInAsyncScope(
+      v8::Local<v8::Object> target
+    , const char* method
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+#if NODE_MODULE_VERSION < NODE_9_0_MODULE_VERSION
+    return MakeCallback(target, method, argc, argv);
+#else
+    return node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, method, argc, argv, context);
+#endif
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncResource)
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+  node::async_context context;
+#endif
+};
+
+inline uv_loop_t* GetCurrentEventLoop() {
+#if NODE_MAJOR_VERSION >= 10 || \
+  NODE_MAJOR_VERSION == 9 && NODE_MINOR_VERSION >= 3 || \
+  NODE_MAJOR_VERSION == 8 && NODE_MINOR_VERSION >= 10
+    return node::GetCurrentEventLoop(v8::Isolate::GetCurrent());
+#else
+    return uv_default_loop();
+#endif
+}
+
+//============ =================================================================
+
+/* node 0.12  */
+#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
+  inline
+  void SetCounterFunction(v8::CounterLookupCallback cb) {
+    v8::Isolate::GetCurrent()->SetCounterFunction(cb);
+  }
+
+  inline
+  void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) {
+    v8::Isolate::GetCurrent()->SetCreateHistogramFunction(cb);
+  }
+
+  inline
+  void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) {
+    v8::Isolate::GetCurrent()->SetAddHistogramSampleFunction(cb);
+  }
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+  inline bool IdleNotification(int idle_time_in_ms) {
+    return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
+        idle_time_in_ms * 0.001);
+  }
+# else
+  inline bool IdleNotification(int idle_time_in_ms) {
+    return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms);
+  }
+#endif
+
+  inline void LowMemoryNotification() {
+    v8::Isolate::GetCurrent()->LowMemoryNotification();
+  }
+
+  inline void ContextDisposedNotification() {
+    v8::Isolate::GetCurrent()->ContextDisposedNotification();
+  }
+#else
+  inline
+  void SetCounterFunction(v8::CounterLookupCallback cb) {
+    v8::V8::SetCounterFunction(cb);
+  }
+
+  inline
+  void SetCreateHistogramFunction(v8::CreateHistogramCallback cb) {
+    v8::V8::SetCreateHistogramFunction(cb);
+  }
+
+  inline
+  void SetAddHistogramSampleFunction(v8::AddHistogramSampleCallback cb) {
+    v8::V8::SetAddHistogramSampleFunction(cb);
+  }
+
+  inline bool IdleNotification(int idle_time_in_ms) {
+    return v8::V8::IdleNotification(idle_time_in_ms);
+  }
+
+  inline void LowMemoryNotification() {
+    v8::V8::LowMemoryNotification();
+  }
+
+  inline void ContextDisposedNotification() {
+    v8::V8::ContextDisposedNotification();
+  }
+#endif
+
+#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)  // Node 0.12
+  inline v8::Local<v8::Primitive> Undefined() {
+# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::Undefined(v8::Isolate::GetCurrent())));
+# else
+    return v8::Undefined(v8::Isolate::GetCurrent());
+# endif
+  }
+
+  inline v8::Local<v8::Primitive> Null() {
+# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::Null(v8::Isolate::GetCurrent())));
+# else
+    return v8::Null(v8::Isolate::GetCurrent());
+# endif
+  }
+
+  inline v8::Local<v8::Boolean> True() {
+# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::True(v8::Isolate::GetCurrent())));
+# else
+    return v8::True(v8::Isolate::GetCurrent());
+# endif
+  }
+
+  inline v8::Local<v8::Boolean> False() {
+# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::False(v8::Isolate::GetCurrent())));
+# else
+    return v8::False(v8::Isolate::GetCurrent());
+# endif
+  }
+
+  inline v8::Local<v8::String> EmptyString() {
+    return v8::String::Empty(v8::Isolate::GetCurrent());
+  }
+
+  inline int AdjustExternalMemory(int bc) {
+    return static_cast<int>(
+        v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(bc));
+  }
+
+  inline void SetTemplate(
+      v8::Local<v8::Template> templ
+    , const char *name
+    , v8::Local<v8::Data> value) {
+    templ->Set(v8::Isolate::GetCurrent(), name, value);
+  }
+
+  inline void SetTemplate(
+      v8::Local<v8::Template> templ
+    , v8::Local<v8::String> name
+    , v8::Local<v8::Data> value
+    , v8::PropertyAttribute attributes) {
+    templ->Set(name, value, attributes);
+  }
+
+  inline v8::Local<v8::Context> GetCurrentContext() {
+    return v8::Isolate::GetCurrent()->GetCurrentContext();
+  }
+
+  inline void* GetInternalFieldPointer(
+      v8::Local<v8::Object> object
+    , int index) {
+    return object->GetAlignedPointerFromInternalField(index);
+  }
+
+  inline void SetInternalFieldPointer(
+      v8::Local<v8::Object> object
+    , int index
+    , void* value) {
+    object->SetAlignedPointerInInternalField(index, value);
+  }
+
+# define NAN_GC_CALLBACK(name)                                                 \
+    void name(v8::Isolate *isolate, v8::GCType type, v8::GCCallbackFlags flags)
+
+#if NODE_MODULE_VERSION <= NODE_4_0_MODULE_VERSION
+  typedef v8::Isolate::GCEpilogueCallback GCEpilogueCallback;
+  typedef v8::Isolate::GCPrologueCallback GCPrologueCallback;
+#else
+  typedef v8::Isolate::GCCallback GCEpilogueCallback;
+  typedef v8::Isolate::GCCallback GCPrologueCallback;
+#endif
+
+  inline void AddGCEpilogueCallback(
+      GCEpilogueCallback callback
+    , v8::GCType gc_type_filter = v8::kGCTypeAll) {
+    v8::Isolate::GetCurrent()->AddGCEpilogueCallback(callback, gc_type_filter);
+  }
+
+  inline void RemoveGCEpilogueCallback(
+      GCEpilogueCallback callback) {
+    v8::Isolate::GetCurrent()->RemoveGCEpilogueCallback(callback);
+  }
+
+  inline void AddGCPrologueCallback(
+      GCPrologueCallback callback
+    , v8::GCType gc_type_filter = v8::kGCTypeAll) {
+    v8::Isolate::GetCurrent()->AddGCPrologueCallback(callback, gc_type_filter);
+  }
+
+  inline void RemoveGCPrologueCallback(
+      GCPrologueCallback callback) {
+    v8::Isolate::GetCurrent()->RemoveGCPrologueCallback(callback);
+  }
+
+  inline void GetHeapStatistics(
+      v8::HeapStatistics *heap_statistics) {
+    v8::Isolate::GetCurrent()->GetHeapStatistics(heap_statistics);
+  }
+
+# define X(NAME)                                                               \
+    inline v8::Local<v8::Value> NAME(const char *msg) {                        \
+      EscapableHandleScope scope;                                              \
+      return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked()));     \
+    }                                                                          \
+                                                                               \
+    inline                                                                     \
+    v8::Local<v8::Value> NAME(v8::Local<v8::String> msg) {                     \
+      return v8::Exception::NAME(msg);                                         \
+    }                                                                          \
+                                                                               \
+    inline void Throw ## NAME(const char *msg) {                               \
+      HandleScope scope;                                                       \
+      v8::Isolate::GetCurrent()->ThrowException(                               \
+          v8::Exception::NAME(New(msg).ToLocalChecked()));                     \
+    }                                                                          \
+                                                                               \
+    inline void Throw ## NAME(v8::Local<v8::String> msg) {                     \
+      HandleScope scope;                                                       \
+      v8::Isolate::GetCurrent()->ThrowException(                               \
+          v8::Exception::NAME(msg));                                           \
+    }
+
+  X(Error)
+  X(RangeError)
+  X(ReferenceError)
+  X(SyntaxError)
+  X(TypeError)
+
+# undef X
+
+  inline void ThrowError(v8::Local<v8::Value> error) {
+    v8::Isolate::GetCurrent()->ThrowException(error);
+  }
+
+  inline MaybeLocal<v8::Object> NewBuffer(
+      char *data
+    , size_t length
+#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION
+    , node::Buffer::FreeCallback callback
+#else
+    , node::smalloc::FreeCallback callback
+#endif
+    , void *hint
+  ) {
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(length <= imp::kMaxLength && "too large buffer");
+#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION
+    return node::Buffer::New(
+        v8::Isolate::GetCurrent(), data, length, callback, hint);
+#else
+    return node::Buffer::New(v8::Isolate::GetCurrent(), data, length, callback,
+                             hint);
+#endif
+  }
+
+  inline MaybeLocal<v8::Object> CopyBuffer(
+      const char *data
+    , uint32_t size
+  ) {
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(size <= imp::kMaxLength && "too large buffer");
+#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION
+    return node::Buffer::Copy(
+        v8::Isolate::GetCurrent(), data, size);
+#else
+    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
+#endif
+  }
+
+  inline MaybeLocal<v8::Object> NewBuffer(uint32_t size) {
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(size <= imp::kMaxLength && "too large buffer");
+#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION
+    return node::Buffer::New(
+        v8::Isolate::GetCurrent(), size);
+#else
+    return node::Buffer::New(v8::Isolate::GetCurrent(), size);
+#endif
+  }
+
+  inline MaybeLocal<v8::Object> NewBuffer(
+      char* data
+    , uint32_t size
+  ) {
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(size <= imp::kMaxLength && "too large buffer");
+#if NODE_MODULE_VERSION > IOJS_2_0_MODULE_VERSION
+    return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
+#else
+    return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
+#endif
+  }
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+  inline MaybeLocal<v8::String>
+  NewOneByteString(const uint8_t * value, int length = -1) {
+    return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value,
+          v8::NewStringType::kNormal, length);
+  }
+
+  inline MaybeLocal<BoundScript> CompileScript(
+      v8::Local<v8::String> s
+    , const v8::ScriptOrigin& origin
+  ) {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    v8::ScriptCompiler::Source source(s, origin);
+    return scope.Escape(
+        v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source)
+            .FromMaybe(v8::Local<BoundScript>()));
+  }
+
+  inline MaybeLocal<BoundScript> CompileScript(
+      v8::Local<v8::String> s
+  ) {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    v8::ScriptCompiler::Source source(s);
+    return scope.Escape(
+        v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &source)
+            .FromMaybe(v8::Local<BoundScript>()));
+  }
+
+  inline MaybeLocal<v8::Value> RunScript(
+      v8::Local<UnboundScript> script
+  ) {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(script->BindToCurrentContext()
+                            ->Run(isolate->GetCurrentContext())
+                            .FromMaybe(v8::Local<v8::Value>()));
+  }
+
+  inline MaybeLocal<v8::Value> RunScript(
+      v8::Local<BoundScript> script
+  ) {
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(script->Run(isolate->GetCurrentContext())
+                            .FromMaybe(v8::Local<v8::Value>()));
+  }
+#else
+  inline MaybeLocal<v8::String>
+  NewOneByteString(const uint8_t * value, int length = -1) {
+    return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value,
+                                      v8::String::kNormalString, length);
+  }
+
+  inline MaybeLocal<BoundScript> CompileScript(
+      v8::Local<v8::String> s
+    , const v8::ScriptOrigin& origin
+  ) {
+    v8::ScriptCompiler::Source source(s, origin);
+    return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
+  }
+
+  inline MaybeLocal<BoundScript> CompileScript(
+      v8::Local<v8::String> s
+  ) {
+    v8::ScriptCompiler::Source source(s);
+    return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
+  }
+
+  inline MaybeLocal<v8::Value> RunScript(
+      v8::Local<UnboundScript> script
+  ) {
+    EscapableHandleScope scope;
+    return scope.Escape(script->BindToCurrentContext()->Run());
+  }
+
+  inline MaybeLocal<v8::Value> RunScript(
+      v8::Local<BoundScript> script
+  ) {
+    return script->Run();
+  }
+#endif
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
+      v8::Local<v8::Object> target
+    , v8::Local<v8::Function> func
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, func, argc, argv)));
+#else
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource res("nan:makeCallback");
+    return res.runInAsyncScope(target, func, argc, argv)
+        .FromMaybe(v8::Local<v8::Value>());
+# else
+    return node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, func, argc, argv);
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#endif  // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+  }
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
+      v8::Local<v8::Object> target
+    , v8::Local<v8::String> symbol
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, symbol, argc, argv)));
+#else
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource res("nan:makeCallback");
+    return res.runInAsyncScope(target, symbol, argc, argv)
+        .FromMaybe(v8::Local<v8::Value>());
+# else
+    return node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, symbol, argc, argv);
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#endif  // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+  }
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> MakeCallback(
+      v8::Local<v8::Object> target
+    , const char* method
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    return scope.Escape(New(node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, method, argc, argv)));
+#else
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource res("nan:makeCallback");
+    return res.runInAsyncScope(target, method, argc, argv)
+        .FromMaybe(v8::Local<v8::Value>());
+# else
+    return node::MakeCallback(
+        v8::Isolate::GetCurrent(), target, method, argc, argv);
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#endif  // NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+  }
+
+  inline void FatalException(const TryCatch& try_catch) {
+    node::FatalException(v8::Isolate::GetCurrent(), try_catch.try_catch_);
+  }
+
+  inline v8::Local<v8::Value> ErrnoException(
+          int errorno
+       ,  const char* syscall = NULL
+       ,  const char* message = NULL
+       ,  const char* path = NULL) {
+    return node::ErrnoException(v8::Isolate::GetCurrent(), errorno, syscall,
+            message, path);
+  }
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> NanErrnoException(
+          int errorno
+       ,  const char* syscall = NULL
+       ,  const char* message = NULL
+       ,  const char* path = NULL) {
+    return ErrnoException(errorno, syscall, message, path);
+  }
+
+  template<typename T>
+  inline void SetIsolateData(
+      v8::Isolate *isolate
+    , T *data
+  ) {
+      isolate->SetData(0, data);
+  }
+
+  template<typename T>
+  inline T *GetIsolateData(
+      v8::Isolate *isolate
+  ) {
+      return static_cast<T*>(isolate->GetData(0));
+  }
+
+class Utf8String {
+ public:
+  inline explicit Utf8String(v8::Local<v8::Value> from) :
+      length_(0), str_(str_st_) {
+    HandleScope scope;
+    if (!from.IsEmpty()) {
+#if NODE_MAJOR_VERSION >= 10
+      v8::Local<v8::Context> context = GetCurrentContext();
+      v8::Local<v8::String> string =
+          from->ToString(context).FromMaybe(v8::Local<v8::String>());
+#else
+      v8::Local<v8::String> string = from->ToString();
+#endif
+      if (!string.IsEmpty()) {
+        size_t len = 3 * string->Length() + 1;
+        assert(len <= INT_MAX);
+        if (len > sizeof (str_st_)) {
+          str_ = static_cast<char*>(malloc(len));
+          assert(str_ != 0);
+        }
+        const int flags =
+            v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8;
+#if NODE_MAJOR_VERSION >= 11
+        length_ = string->WriteUtf8(v8::Isolate::GetCurrent(), str_,
+                                    static_cast<int>(len), 0, flags);
+#else
+        // See https://github.com/nodejs/nan/issues/832.
+        // Disable the warning as there is no way around it.
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4996)
+#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif  // NODE_MAJOR_VERSION < 11
+        str_[length_] = '\0';
+      }
+    }
+  }
+
+  inline int length() const {
+    return length_;
+  }
+
+  inline char* operator*() { return str_; }
+  inline const char* operator*() const { return str_; }
+
+  inline ~Utf8String() {
+    if (str_ != str_st_) {
+      free(str_);
+    }
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String)
+
+  int length_;
+  char *str_;
+  char str_st_[1024];
+};
+
+#else  // Node 0.8 and 0.10
+  inline v8::Local<v8::Primitive> Undefined() {
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::Undefined()));
+  }
+
+  inline v8::Local<v8::Primitive> Null() {
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::Null()));
+  }
+
+  inline v8::Local<v8::Boolean> True() {
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::True()));
+  }
+
+  inline v8::Local<v8::Boolean> False() {
+    EscapableHandleScope scope;
+    return scope.Escape(New(v8::False()));
+  }
+
+  inline v8::Local<v8::String> EmptyString() {
+    return v8::String::Empty();
+  }
+
+  inline int AdjustExternalMemory(int bc) {
+    return static_cast<int>(v8::V8::AdjustAmountOfExternalAllocatedMemory(bc));
+  }
+
+  inline void SetTemplate(
+      v8::Local<v8::Template> templ
+    , const char *name
+    , v8::Local<v8::Data> value) {
+    templ->Set(name, value);
+  }
+
+  inline void SetTemplate(
+      v8::Local<v8::Template> templ
+    , v8::Local<v8::String> name
+    , v8::Local<v8::Data> value
+    , v8::PropertyAttribute attributes) {
+    templ->Set(name, value, attributes);
+  }
+
+  inline v8::Local<v8::Context> GetCurrentContext() {
+    return v8::Context::GetCurrent();
+  }
+
+  inline void* GetInternalFieldPointer(
+      v8::Local<v8::Object> object
+    , int index) {
+    return object->GetPointerFromInternalField(index);
+  }
+
+  inline void SetInternalFieldPointer(
+      v8::Local<v8::Object> object
+    , int index
+    , void* value) {
+    object->SetPointerInInternalField(index, value);
+  }
+
+# define NAN_GC_CALLBACK(name)                                                 \
+    void name(v8::GCType type, v8::GCCallbackFlags flags)
+
+  inline void AddGCEpilogueCallback(
+    v8::GCEpilogueCallback callback
+  , v8::GCType gc_type_filter = v8::kGCTypeAll) {
+    v8::V8::AddGCEpilogueCallback(callback, gc_type_filter);
+  }
+  inline void RemoveGCEpilogueCallback(
+    v8::GCEpilogueCallback callback) {
+    v8::V8::RemoveGCEpilogueCallback(callback);
+  }
+  inline void AddGCPrologueCallback(
+    v8::GCPrologueCallback callback
+  , v8::GCType gc_type_filter = v8::kGCTypeAll) {
+    v8::V8::AddGCPrologueCallback(callback, gc_type_filter);
+  }
+  inline void RemoveGCPrologueCallback(
+    v8::GCPrologueCallback callback) {
+    v8::V8::RemoveGCPrologueCallback(callback);
+  }
+  inline void GetHeapStatistics(
+    v8::HeapStatistics *heap_statistics) {
+    v8::V8::GetHeapStatistics(heap_statistics);
+  }
+
+# define X(NAME)                                                               \
+    inline v8::Local<v8::Value> NAME(const char *msg) {                        \
+      EscapableHandleScope scope;                                              \
+      return scope.Escape(v8::Exception::NAME(New(msg).ToLocalChecked()));     \
+    }                                                                          \
+                                                                               \
+    inline                                                                     \
+    v8::Local<v8::Value> NAME(v8::Local<v8::String> msg) {                     \
+      return v8::Exception::NAME(msg);                                         \
+    }                                                                          \
+                                                                               \
+    inline void Throw ## NAME(const char *msg) {                               \
+      HandleScope scope;                                                       \
+      v8::ThrowException(v8::Exception::NAME(New(msg).ToLocalChecked()));      \
+    }                                                                          \
+                                                                               \
+    inline                                                                     \
+    void Throw ## NAME(v8::Local<v8::String> errmsg) {                         \
+      HandleScope scope;                                                       \
+      v8::ThrowException(v8::Exception::NAME(errmsg));                         \
+    }
+
+  X(Error)
+  X(RangeError)
+  X(ReferenceError)
+  X(SyntaxError)
+  X(TypeError)
+
+# undef X
+
+  inline void ThrowError(v8::Local<v8::Value> error) {
+    v8::ThrowException(error);
+  }
+
+  inline MaybeLocal<v8::Object> NewBuffer(
+      char *data
+    , size_t length
+    , node::Buffer::free_callback callback
+    , void *hint
+  ) {
+    EscapableHandleScope scope;
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(length <= imp::kMaxLength && "too large buffer");
+    return scope.Escape(
+        New(node::Buffer::New(data, length, callback, hint)->handle_));
+  }
+
+  inline MaybeLocal<v8::Object> CopyBuffer(
+      const char *data
+    , uint32_t size
+  ) {
+    EscapableHandleScope scope;
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(size <= imp::kMaxLength && "too large buffer");
+#if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION
+    return scope.Escape(New(node::Buffer::New(data, size)->handle_));
+#else
+    return scope.Escape(
+        New(node::Buffer::New(const_cast<char *>(data), size)->handle_));
+#endif
+  }
+
+  inline MaybeLocal<v8::Object> NewBuffer(uint32_t size) {
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    EscapableHandleScope scope;
+    assert(size <= imp::kMaxLength && "too large buffer");
+    return scope.Escape(New(node::Buffer::New(size)->handle_));
+  }
+
+  inline void FreeData(char *data, void *hint) {
+    (void) hint;  // unused
+    delete[] data;
+  }
+
+  inline MaybeLocal<v8::Object> NewBuffer(
+      char* data
+    , uint32_t size
+  ) {
+    EscapableHandleScope scope;
+    // arbitrary buffer lengths requires
+    // NODE_MODULE_VERSION >= IOJS_3_0_MODULE_VERSION
+    assert(size <= imp::kMaxLength && "too large buffer");
+    return scope.Escape(
+        New(node::Buffer::New(data, size, FreeData, NULL)->handle_));
+  }
+
+namespace imp {
+inline void
+widenString(std::vector<uint16_t> *ws, const uint8_t *s, int l) {
+  size_t len = static_cast<size_t>(l);
+  if (l < 0) {
+    len = strlen(reinterpret_cast<const char*>(s));
+  }
+  assert(len <= INT_MAX && "string too long");
+  ws->resize(len);
+  std::copy(s, s + len, ws->begin());  // NOLINT(build/include_what_you_use)
+}
+}  // end of namespace imp
+
+  inline MaybeLocal<v8::String>
+  NewOneByteString(const uint8_t * value, int length = -1) {
+    std::vector<uint16_t> wideString;  // NOLINT(build/include_what_you_use)
+    imp::widenString(&wideString, value, length);
+    return v8::String::New(wideString.data(),
+                           static_cast<int>(wideString.size()));
+  }
+
+  inline MaybeLocal<BoundScript> CompileScript(
+      v8::Local<v8::String> s
+    , const v8::ScriptOrigin& origin
+  ) {
+    return v8::Script::Compile(s, const_cast<v8::ScriptOrigin *>(&origin));
+  }
+
+  inline MaybeLocal<BoundScript> CompileScript(
+    v8::Local<v8::String> s
+  ) {
+    return v8::Script::Compile(s);
+  }
+
+  inline
+  MaybeLocal<v8::Value> RunScript(v8::Local<v8::Script> script) {
+    return script->Run();
+  }
+
+  inline v8::Local<v8::Value> MakeCallback(
+      v8::Local<v8::Object> target
+    , v8::Local<v8::Function> func
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+    v8::HandleScope scope;
+    return scope.Close(New(node::MakeCallback(target, func, argc, argv)));
+  }
+
+  inline v8::Local<v8::Value> MakeCallback(
+      v8::Local<v8::Object> target
+    , v8::Local<v8::String> symbol
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+    v8::HandleScope scope;
+    return scope.Close(New(node::MakeCallback(target, symbol, argc, argv)));
+  }
+
+  inline v8::Local<v8::Value> MakeCallback(
+      v8::Local<v8::Object> target
+    , const char* method
+    , int argc
+    , v8::Local<v8::Value>* argv) {
+    v8::HandleScope scope;
+    return scope.Close(New(node::MakeCallback(target, method, argc, argv)));
+  }
+
+  inline void FatalException(const TryCatch& try_catch) {
+    node::FatalException(const_cast<v8::TryCatch &>(try_catch.try_catch_));
+  }
+
+  inline v8::Local<v8::Value> ErrnoException(
+          int errorno
+       ,  const char* syscall = NULL
+       ,  const char* message = NULL
+       ,  const char* path = NULL) {
+    return node::ErrnoException(errorno, syscall, message, path);
+  }
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> NanErrnoException(
+          int errorno
+       ,  const char* syscall = NULL
+       ,  const char* message = NULL
+       ,  const char* path = NULL) {
+    return ErrnoException(errorno, syscall, message, path);
+  }
+
+
+  template<typename T>
+  inline void SetIsolateData(
+      v8::Isolate *isolate
+    , T *data
+  ) {
+      isolate->SetData(data);
+  }
+
+  template<typename T>
+  inline T *GetIsolateData(
+      v8::Isolate *isolate
+  ) {
+      return static_cast<T*>(isolate->GetData());
+  }
+
+class Utf8String {
+ public:
+  inline explicit Utf8String(v8::Local<v8::Value> from) :
+      length_(0), str_(str_st_) {
+    v8::HandleScope scope;
+    if (!from.IsEmpty()) {
+      v8::Local<v8::String> string = from->ToString();
+      if (!string.IsEmpty()) {
+        size_t len = 3 * string->Length() + 1;
+        assert(len <= INT_MAX);
+        if (len > sizeof (str_st_)) {
+          str_ = static_cast<char*>(malloc(len));
+          assert(str_ != 0);
+        }
+        const int flags =
+            v8::String::NO_NULL_TERMINATION | imp::kReplaceInvalidUtf8;
+        length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
+        str_[length_] = '\0';
+      }
+    }
+  }
+
+  inline int length() const {
+    return length_;
+  }
+
+  inline char* operator*() { return str_; }
+  inline const char* operator*() const { return str_; }
+
+  inline ~Utf8String() {
+    if (str_ != str_st_) {
+      free(str_);
+    }
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(Utf8String)
+
+  int length_;
+  char *str_;
+  char str_st_[1024];
+};
+
+#endif  // NODE_MODULE_VERSION
+
+typedef void (*FreeCallback)(char *data, void *hint);
+
+typedef const FunctionCallbackInfo<v8::Value>& NAN_METHOD_ARGS_TYPE;
+typedef void NAN_METHOD_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Value>& NAN_GETTER_ARGS_TYPE;
+typedef void NAN_GETTER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<void>& NAN_SETTER_ARGS_TYPE;
+typedef void NAN_SETTER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Value>&
+    NAN_PROPERTY_GETTER_ARGS_TYPE;
+typedef void NAN_PROPERTY_GETTER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Value>&
+    NAN_PROPERTY_SETTER_ARGS_TYPE;
+typedef void NAN_PROPERTY_SETTER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Array>&
+    NAN_PROPERTY_ENUMERATOR_ARGS_TYPE;
+typedef void NAN_PROPERTY_ENUMERATOR_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Boolean>&
+    NAN_PROPERTY_DELETER_ARGS_TYPE;
+typedef void NAN_PROPERTY_DELETER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Integer>&
+    NAN_PROPERTY_QUERY_ARGS_TYPE;
+typedef void NAN_PROPERTY_QUERY_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Value>& NAN_INDEX_GETTER_ARGS_TYPE;
+typedef void NAN_INDEX_GETTER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Value>& NAN_INDEX_SETTER_ARGS_TYPE;
+typedef void NAN_INDEX_SETTER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Array>&
+    NAN_INDEX_ENUMERATOR_ARGS_TYPE;
+typedef void NAN_INDEX_ENUMERATOR_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Boolean>&
+    NAN_INDEX_DELETER_ARGS_TYPE;
+typedef void NAN_INDEX_DELETER_RETURN_TYPE;
+
+typedef const PropertyCallbackInfo<v8::Integer>&
+    NAN_INDEX_QUERY_ARGS_TYPE;
+typedef void NAN_INDEX_QUERY_RETURN_TYPE;
+
+#define NAN_METHOD(name)                                                       \
+    Nan::NAN_METHOD_RETURN_TYPE name(Nan::NAN_METHOD_ARGS_TYPE info)
+#define NAN_GETTER(name)                                                       \
+    Nan::NAN_GETTER_RETURN_TYPE name(                                          \
+        v8::Local<v8::String> property                                         \
+      , Nan::NAN_GETTER_ARGS_TYPE info)
+#define NAN_SETTER(name)                                                       \
+    Nan::NAN_SETTER_RETURN_TYPE name(                                          \
+        v8::Local<v8::String> property                                         \
+      , v8::Local<v8::Value> value                                             \
+      , Nan::NAN_SETTER_ARGS_TYPE info)
+#define NAN_PROPERTY_GETTER(name)                                              \
+    Nan::NAN_PROPERTY_GETTER_RETURN_TYPE name(                                 \
+        v8::Local<v8::String> property                                         \
+      , Nan::NAN_PROPERTY_GETTER_ARGS_TYPE info)
+#define NAN_PROPERTY_SETTER(name)                                              \
+    Nan::NAN_PROPERTY_SETTER_RETURN_TYPE name(                                 \
+        v8::Local<v8::String> property                                         \
+      , v8::Local<v8::Value> value                                             \
+      , Nan::NAN_PROPERTY_SETTER_ARGS_TYPE info)
+#define NAN_PROPERTY_ENUMERATOR(name)                                          \
+    Nan::NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name(                             \
+        Nan::NAN_PROPERTY_ENUMERATOR_ARGS_TYPE info)
+#define NAN_PROPERTY_DELETER(name)                                             \
+    Nan::NAN_PROPERTY_DELETER_RETURN_TYPE name(                                \
+        v8::Local<v8::String> property                                         \
+      , Nan::NAN_PROPERTY_DELETER_ARGS_TYPE info)
+#define NAN_PROPERTY_QUERY(name)                                               \
+    Nan::NAN_PROPERTY_QUERY_RETURN_TYPE name(                                  \
+        v8::Local<v8::String> property                                         \
+      , Nan::NAN_PROPERTY_QUERY_ARGS_TYPE info)
+# define NAN_INDEX_GETTER(name)                                                \
+    Nan::NAN_INDEX_GETTER_RETURN_TYPE name(                                    \
+        uint32_t index                                                         \
+      , Nan::NAN_INDEX_GETTER_ARGS_TYPE info)
+#define NAN_INDEX_SETTER(name)                                                 \
+    Nan::NAN_INDEX_SETTER_RETURN_TYPE name(                                    \
+        uint32_t index                                                         \
+      , v8::Local<v8::Value> value                                             \
+      , Nan::NAN_INDEX_SETTER_ARGS_TYPE info)
+#define NAN_INDEX_ENUMERATOR(name)                                             \
+    Nan::NAN_INDEX_ENUMERATOR_RETURN_TYPE                                      \
+    name(Nan::NAN_INDEX_ENUMERATOR_ARGS_TYPE info)
+#define NAN_INDEX_DELETER(name)                                                \
+    Nan::NAN_INDEX_DELETER_RETURN_TYPE name(                                   \
+        uint32_t index                                                         \
+      , Nan::NAN_INDEX_DELETER_ARGS_TYPE info)
+#define NAN_INDEX_QUERY(name)                                                  \
+    Nan::NAN_INDEX_QUERY_RETURN_TYPE name(                                     \
+        uint32_t index                                                         \
+      , Nan::NAN_INDEX_QUERY_ARGS_TYPE info)
+
+class Callback {
+ public:
+  Callback() {}
+
+  explicit Callback(const v8::Local<v8::Function> &fn) : handle_(fn) {}
+
+  ~Callback() {
+    handle_.Reset();
+  }
+
+  bool operator==(const Callback &other) const {
+    return handle_ == other.handle_;
+  }
+
+  bool operator!=(const Callback &other) const {
+    return !operator==(other);
+  }
+
+  inline
+  v8::Local<v8::Function> operator*() const { return GetFunction(); }
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> operator()(
+      v8::Local<v8::Object> target
+    , int argc = 0
+    , v8::Local<v8::Value> argv[] = 0) const {
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource async("nan:Callback:operator()");
+    return Call_(isolate, target, argc, argv, &async)
+        .FromMaybe(v8::Local<v8::Value>());
+# else
+    return Call_(isolate, target, argc, argv);
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#else
+    return Call_(target, argc, argv);
+#endif  //  NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  }
+
+  NAN_DEPRECATED inline v8::Local<v8::Value> operator()(
+      int argc = 0
+    , v8::Local<v8::Value> argv[] = 0) const {
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource async("nan:Callback:operator()");
+    return scope.Escape(Call_(isolate, isolate->GetCurrentContext()->Global(),
+                              argc, argv, &async)
+                            .FromMaybe(v8::Local<v8::Value>()));
+# else
+    return scope.Escape(
+        Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv));
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#else
+    v8::HandleScope scope;
+    return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv));
+#endif  //  NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  }
+
+  inline MaybeLocal<v8::Value> operator()(
+      AsyncResource* resource
+    , int argc = 0
+    , v8::Local<v8::Value> argv[] = 0) const {
+    return this->Call(argc, argv, resource);
+  }
+
+  inline MaybeLocal<v8::Value> operator()(
+      AsyncResource* resource
+    , v8::Local<v8::Object> target
+    , int argc = 0
+    , v8::Local<v8::Value> argv[] = 0) const {
+    return this->Call(target, argc, argv, resource);
+  }
+
+  // TODO(kkoopa): remove
+  inline void SetFunction(const v8::Local<v8::Function> &fn) {
+    Reset(fn);
+  }
+
+  inline void Reset(const v8::Local<v8::Function> &fn) {
+    handle_.Reset(fn);
+  }
+
+  inline void Reset() {
+    handle_.Reset();
+  }
+
+  inline v8::Local<v8::Function> GetFunction() const {
+    return New(handle_);
+  }
+
+  inline bool IsEmpty() const {
+    return handle_.IsEmpty();
+  }
+
+  // Deprecated: For async callbacks Use the versions that accept an
+  // AsyncResource. If this callback does not correspond to an async resource,
+  // that is, it is a synchronous function call on a non-empty JS stack, you
+  // should Nan::Call instead.
+  NAN_DEPRECATED inline v8::Local<v8::Value>
+  Call(v8::Local<v8::Object> target
+     , int argc
+     , v8::Local<v8::Value> argv[]) const {
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource async("nan:Callback:Call");
+    return Call_(isolate, target, argc, argv, &async)
+        .FromMaybe(v8::Local<v8::Value>());
+# else
+    return Call_(isolate, target, argc, argv);
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#else
+    return Call_(target, argc, argv);
+#endif
+  }
+
+  // Deprecated: For async callbacks Use the versions that accept an
+  // AsyncResource. If this callback does not correspond to an async resource,
+  // that is, it is a synchronous function call on a non-empty JS stack, you
+  // should Nan::Call instead.
+  NAN_DEPRECATED inline v8::Local<v8::Value>
+  Call(int argc, v8::Local<v8::Value> argv[]) const {
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+# if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    AsyncResource async("nan:Callback:Call");
+    return scope.Escape(Call_(isolate, isolate->GetCurrentContext()->Global(),
+                              argc, argv, &async)
+                            .FromMaybe(v8::Local<v8::Value>()));
+# else
+    return scope.Escape(
+        Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv));
+# endif  // NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+#else
+    v8::HandleScope scope;
+    return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv));
+#endif
+  }
+
+  inline MaybeLocal<v8::Value>
+  Call(v8::Local<v8::Object> target
+     , int argc
+     , v8::Local<v8::Value> argv[]
+     , AsyncResource* resource) const {
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    return Call_(isolate, target, argc, argv, resource);
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    return Call_(isolate, target, argc, argv);
+#else
+    return Call_(target, argc, argv);
+#endif
+  }
+
+  inline MaybeLocal<v8::Value>
+  Call(int argc, v8::Local<v8::Value> argv[], AsyncResource* resource) const {
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
+    return Call(isolate->GetCurrentContext()->Global(), argc, argv, resource);
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+    v8::Isolate *isolate = v8::Isolate::GetCurrent();
+    v8::EscapableHandleScope scope(isolate);
+    return scope.Escape(
+        Call_(isolate, isolate->GetCurrentContext()->Global(), argc, argv));
+#else
+    v8::HandleScope scope;
+    return scope.Close(Call_(v8::Context::GetCurrent()->Global(), argc, argv));
+#endif
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(Callback)
+  Persistent<v8::Function> handle_;
+
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+  MaybeLocal<v8::Value> Call_(v8::Isolate *isolate
+                            , v8::Local<v8::Object> target
+                            , int argc
+                            , v8::Local<v8::Value> argv[]
+                            , AsyncResource* resource) const {
+    EscapableHandleScope scope;
+    v8::Local<v8::Function> func = New(handle_);
+    auto maybe = resource->runInAsyncScope(target, func, argc, argv);
+    v8::Local<v8::Value> local;
+    if (!maybe.ToLocal(&local)) return MaybeLocal<v8::Value>();
+    return scope.Escape(local);
+  }
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  v8::Local<v8::Value> Call_(v8::Isolate *isolate
+                           , v8::Local<v8::Object> target
+                           , int argc
+                           , v8::Local<v8::Value> argv[]) const {
+    EscapableHandleScope scope;
+
+    v8::Local<v8::Function> callback = New(handle_);
+# if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+    return scope.Escape(New(node::MakeCallback(
+        isolate
+      , target
+      , callback
+      , argc
+      , argv
+    )));
+# else
+    return scope.Escape(node::MakeCallback(
+        isolate
+      , target
+      , callback
+      , argc
+      , argv
+    ));
+# endif
+  }
+#else
+  v8::Local<v8::Value> Call_(v8::Local<v8::Object> target
+                           , int argc
+                           , v8::Local<v8::Value> argv[]) const {
+    EscapableHandleScope scope;
+
+    v8::Local<v8::Function> callback = New(handle_);
+    return scope.Escape(New(node::MakeCallback(
+        target
+      , callback
+      , argc
+      , argv
+    )));
+  }
+#endif
+};
+
+inline MaybeLocal<v8::Value> Call(
+    const Nan::Callback& callback
+  , v8::Local<v8::Object> recv
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  return Call(*callback, recv, argc, argv);
+}
+
+inline MaybeLocal<v8::Value> Call(
+    const Nan::Callback& callback
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  v8::Isolate* isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      Call(*callback, isolate->GetCurrentContext()->Global(), argc, argv)
+          .FromMaybe(v8::Local<v8::Value>()));
+#else
+  EscapableHandleScope scope;
+  return scope.Escape(
+      Call(*callback, v8::Context::GetCurrent()->Global(), argc, argv)
+          .FromMaybe(v8::Local<v8::Value>()));
+#endif
+}
+
+inline MaybeLocal<v8::Value> Call(
+    v8::Local<v8::String> symbol
+  , v8::Local<v8::Object> recv
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  EscapableHandleScope scope;
+  v8::Local<v8::Value> fn_v =
+      Get(recv, symbol).FromMaybe(v8::Local<v8::Value>());
+  if (fn_v.IsEmpty() || !fn_v->IsFunction()) return v8::Local<v8::Value>();
+  v8::Local<v8::Function> fn = fn_v.As<v8::Function>();
+  return scope.Escape(
+      Call(fn, recv, argc, argv).FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline MaybeLocal<v8::Value> Call(
+    const char* method
+  , v8::Local<v8::Object> recv
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  EscapableHandleScope scope;
+  v8::Local<v8::String> method_string =
+      New<v8::String>(method).ToLocalChecked();
+  return scope.Escape(
+      Call(method_string, recv, argc, argv).FromMaybe(v8::Local<v8::Value>()));
+}
+
+/* abstract */ class AsyncWorker {
+ public:
+  explicit AsyncWorker(Callback *callback_,
+                       const char* resource_name = "nan:AsyncWorker")
+      : callback(callback_), errmsg_(NULL) {
+    request.data = this;
+
+    HandleScope scope;
+    v8::Local<v8::Object> obj = New<v8::Object>();
+    persistentHandle.Reset(obj);
+    async_resource = new AsyncResource(resource_name, obj);
+  }
+
+  virtual ~AsyncWorker() {
+    HandleScope scope;
+
+    if (!persistentHandle.IsEmpty())
+      persistentHandle.Reset();
+    delete callback;
+    delete[] errmsg_;
+    delete async_resource;
+  }
+
+  virtual void WorkComplete() {
+    HandleScope scope;
+
+    if (errmsg_ == NULL)
+      HandleOKCallback();
+    else
+      HandleErrorCallback();
+    delete callback;
+    callback = NULL;
+  }
+
+  inline void SaveToPersistent(
+      const char *key, const v8::Local<v8::Value> &value) {
+    HandleScope scope;
+    Set(New(persistentHandle), New(key).ToLocalChecked(), value).FromJust();
+  }
+
+  inline void SaveToPersistent(
+      const v8::Local<v8::String> &key, const v8::Local<v8::Value> &value) {
+    HandleScope scope;
+    Set(New(persistentHandle), key, value).FromJust();
+  }
+
+  inline void SaveToPersistent(
+      uint32_t index, const v8::Local<v8::Value> &value) {
+    HandleScope scope;
+    Set(New(persistentHandle), index, value).FromJust();
+  }
+
+  inline v8::Local<v8::Value> GetFromPersistent(const char *key) const {
+    EscapableHandleScope scope;
+    return scope.Escape(
+        Get(New(persistentHandle), New(key).ToLocalChecked())
+        .FromMaybe(v8::Local<v8::Value>()));
+  }
+
+  inline v8::Local<v8::Value>
+  GetFromPersistent(const v8::Local<v8::String> &key) const {
+    EscapableHandleScope scope;
+    return scope.Escape(
+        Get(New(persistentHandle), key)
+        .FromMaybe(v8::Local<v8::Value>()));
+  }
+
+  inline v8::Local<v8::Value> GetFromPersistent(uint32_t index) const {
+    EscapableHandleScope scope;
+    return scope.Escape(
+        Get(New(persistentHandle), index)
+        .FromMaybe(v8::Local<v8::Value>()));
+  }
+
+  virtual void Execute() = 0;
+
+  uv_work_t request;
+
+  virtual void Destroy() {
+      delete this;
+  }
+
+ protected:
+  Persistent<v8::Object> persistentHandle;
+  Callback *callback;
+  AsyncResource *async_resource;
+
+  virtual void HandleOKCallback() {
+    HandleScope scope;
+
+    callback->Call(0, NULL, async_resource);
+  }
+
+  virtual void HandleErrorCallback() {
+    HandleScope scope;
+
+    v8::Local<v8::Value> argv[] = {
+      v8::Exception::Error(New<v8::String>(ErrorMessage()).ToLocalChecked())
+    };
+    callback->Call(1, argv, async_resource);
+  }
+
+  void SetErrorMessage(const char *msg) {
+    delete[] errmsg_;
+
+    size_t size = strlen(msg) + 1;
+    errmsg_ = new char[size];
+    memcpy(errmsg_, msg, size);
+  }
+
+  const char* ErrorMessage() const {
+    return errmsg_;
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(AsyncWorker)
+  char *errmsg_;
+};
+
+/* abstract */ class AsyncBareProgressWorkerBase : public AsyncWorker {
+ public:
+  explicit AsyncBareProgressWorkerBase(
+      Callback *callback_,
+      const char* resource_name = "nan:AsyncBareProgressWorkerBase")
+      : AsyncWorker(callback_, resource_name) {
+    uv_async_init(
+        GetCurrentEventLoop()
+      , &async
+      , AsyncProgress_
+    );
+    async.data = this;
+  }
+
+  virtual ~AsyncBareProgressWorkerBase() {
+  }
+
+  virtual void WorkProgress() = 0;
+
+  virtual void Destroy() {
+      uv_close(reinterpret_cast<uv_handle_t*>(&async), AsyncClose_);
+  }
+
+ private:
+  inline static NAUV_WORK_CB(AsyncProgress_) {
+    AsyncBareProgressWorkerBase *worker =
+            static_cast<AsyncBareProgressWorkerBase*>(async->data);
+    worker->WorkProgress();
+  }
+
+  inline static void AsyncClose_(uv_handle_t* handle) {
+    AsyncBareProgressWorkerBase *worker =
+            static_cast<AsyncBareProgressWorkerBase*>(handle->data);
+    delete worker;
+  }
+
+ protected:
+  uv_async_t async;
+};
+
+template<class T>
+/* abstract */
+class AsyncBareProgressWorker : public AsyncBareProgressWorkerBase {
+ public:
+  explicit AsyncBareProgressWorker(
+      Callback *callback_,
+      const char* resource_name = "nan:AsyncBareProgressWorker")
+      : AsyncBareProgressWorkerBase(callback_, resource_name) {
+    uv_mutex_init(&async_lock);
+  }
+
+  virtual ~AsyncBareProgressWorker() {
+    uv_mutex_destroy(&async_lock);
+  }
+
+  class ExecutionProgress {
+    friend class AsyncBareProgressWorker;
+   public:
+    void Signal() const {
+      uv_mutex_lock(&that_->async_lock);
+      uv_async_send(&that_->async);
+      uv_mutex_unlock(&that_->async_lock);
+    }
+
+    void Send(const T* data, size_t count) const {
+      that_->SendProgress_(data, count);
+    }
+
+   private:
+    explicit ExecutionProgress(AsyncBareProgressWorker *that) : that_(that) {}
+    NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress)
+    AsyncBareProgressWorker* const that_;
+  };
+
+  virtual void Execute(const ExecutionProgress& progress) = 0;
+  virtual void HandleProgressCallback(const T *data, size_t size) = 0;
+
+ protected:
+  uv_mutex_t async_lock;
+
+ private:
+  void Execute() /*final override*/ {
+    ExecutionProgress progress(this);
+    Execute(progress);
+  }
+
+  virtual void SendProgress_(const T *data, size_t count) = 0;
+};
+
+template<class T>
+/* abstract */
+class AsyncProgressWorkerBase : public AsyncBareProgressWorker<T> {
+ public:
+  explicit AsyncProgressWorkerBase(
+      Callback *callback_,
+      const char* resource_name = "nan:AsyncProgressWorkerBase")
+      : AsyncBareProgressWorker<T>(callback_, resource_name), asyncdata_(NULL),
+        asyncsize_(0) {
+  }
+
+  virtual ~AsyncProgressWorkerBase() {
+    delete[] asyncdata_;
+  }
+
+  void WorkProgress() {
+    uv_mutex_lock(&this->async_lock);
+    T *data = asyncdata_;
+    size_t size = asyncsize_;
+    asyncdata_ = NULL;
+    asyncsize_ = 0;
+    uv_mutex_unlock(&this->async_lock);
+
+    // Don't send progress events after we've already completed.
+    if (this->callback) {
+        this->HandleProgressCallback(data, size);
+    }
+    delete[] data;
+  }
+
+ private:
+  void SendProgress_(const T *data, size_t count) {
+    T *new_data = new T[count];
+    std::copy(data, data + count, new_data);
+
+    uv_mutex_lock(&this->async_lock);
+    T *old_data = asyncdata_;
+    asyncdata_ = new_data;
+    asyncsize_ = count;
+    uv_async_send(&this->async);
+    uv_mutex_unlock(&this->async_lock);
+
+    delete[] old_data;
+  }
+
+  T *asyncdata_;
+  size_t asyncsize_;
+};
+
+// This ensures compatibility to the previous un-templated AsyncProgressWorker
+// class definition.
+typedef AsyncProgressWorkerBase<char> AsyncProgressWorker;
+
+template<class T>
+/* abstract */
+class AsyncBareProgressQueueWorker : public AsyncBareProgressWorkerBase {
+ public:
+  explicit AsyncBareProgressQueueWorker(
+      Callback *callback_,
+      const char* resource_name = "nan:AsyncBareProgressQueueWorker")
+      : AsyncBareProgressWorkerBase(callback_, resource_name) {
+  }
+
+  virtual ~AsyncBareProgressQueueWorker() {
+  }
+
+  class ExecutionProgress {
+    friend class AsyncBareProgressQueueWorker;
+   public:
+    void Send(const T* data, size_t count) const {
+      that_->SendProgress_(data, count);
+    }
+
+   private:
+    explicit ExecutionProgress(AsyncBareProgressQueueWorker *that)
+        : that_(that) {}
+    NAN_DISALLOW_ASSIGN_COPY_MOVE(ExecutionProgress)
+    AsyncBareProgressQueueWorker* const that_;
+  };
+
+  virtual void Execute(const ExecutionProgress& progress) = 0;
+  virtual void HandleProgressCallback(const T *data, size_t size) = 0;
+
+ private:
+  void Execute() /*final override*/ {
+    ExecutionProgress progress(this);
+    Execute(progress);
+  }
+
+  virtual void SendProgress_(const T *data, size_t count) = 0;
+};
+
+template<class T>
+/* abstract */
+class AsyncProgressQueueWorker : public AsyncBareProgressQueueWorker<T> {
+ public:
+  explicit AsyncProgressQueueWorker(
+      Callback *callback_,
+      const char* resource_name = "nan:AsyncProgressQueueWorker")
+      : AsyncBareProgressQueueWorker<T>(callback_) {
+    uv_mutex_init(&async_lock);
+  }
+
+  virtual ~AsyncProgressQueueWorker() {
+    uv_mutex_lock(&async_lock);
+
+    while (!asyncdata_.empty()) {
+      std::pair<T*, size_t> &datapair = asyncdata_.front();
+      T *data = datapair.first;
+
+      asyncdata_.pop();
+
+      delete[] data;
+    }
+
+    uv_mutex_unlock(&async_lock);
+    uv_mutex_destroy(&async_lock);
+  }
+
+  void WorkComplete() {
+    WorkProgress();
+    AsyncWorker::WorkComplete();
+  }
+
+  void WorkProgress() {
+    uv_mutex_lock(&async_lock);
+
+    while (!asyncdata_.empty()) {
+      std::pair<T*, size_t> &datapair = asyncdata_.front();
+
+      T *data = datapair.first;
+      size_t size = datapair.second;
+
+      asyncdata_.pop();
+      uv_mutex_unlock(&async_lock);
+
+      // Don't send progress events after we've already completed.
+      if (this->callback) {
+          this->HandleProgressCallback(data, size);
+      }
+
+      delete[] data;
+
+      uv_mutex_lock(&async_lock);
+    }
+
+    uv_mutex_unlock(&async_lock);
+  }
+
+ private:
+  void SendProgress_(const T *data, size_t count) {
+    T *new_data = new T[count];
+    std::copy(data, data + count, new_data);
+
+    uv_mutex_lock(&async_lock);
+    asyncdata_.push(std::pair<T*, size_t>(new_data, count));
+    uv_mutex_unlock(&async_lock);
+
+    uv_async_send(&this->async);
+  }
+
+  uv_mutex_t async_lock;
+  std::queue<std::pair<T*, size_t> > asyncdata_;
+};
+
+inline void AsyncExecute (uv_work_t* req) {
+  AsyncWorker *worker = static_cast<AsyncWorker*>(req->data);
+  worker->Execute();
+}
+
+/* uv_after_work_cb has 1 argument before node-v0.9.4 and
+ * 2 arguments since node-v0.9.4
+ * https://github.com/libuv/libuv/commit/92fb84b751e18f032c02609467f44bfe927b80c5
+ */
+inline void AsyncExecuteComplete(uv_work_t *req) {
+  AsyncWorker* worker = static_cast<AsyncWorker*>(req->data);
+  worker->WorkComplete();
+  worker->Destroy();
+}
+inline void AsyncExecuteComplete (uv_work_t* req, int status) {
+  AsyncExecuteComplete(req);
+}
+
+inline void AsyncQueueWorker (AsyncWorker* worker) {
+  uv_queue_work(
+      GetCurrentEventLoop()
+    , &worker->request
+    , AsyncExecute
+    , AsyncExecuteComplete
+  );
+}
+
+namespace imp {
+
+inline
+ExternalOneByteStringResource const*
+GetExternalResource(v8::Local<v8::String> str) {
+#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION
+    return str->GetExternalAsciiStringResource();
+#else
+    return str->GetExternalOneByteStringResource();
+#endif
+}
+
+inline
+bool
+IsExternal(v8::Local<v8::String> str) {
+#if NODE_MODULE_VERSION < ATOM_0_21_MODULE_VERSION
+    return str->IsExternalAscii();
+#else
+    return str->IsExternalOneByte();
+#endif
+}
+
+}  // end of namespace imp
+
+enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER};
+
+#if NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION
+# include "nan_string_bytes.h"  // NOLINT(build/include)
+#endif
+
+inline v8::Local<v8::Value> Encode(
+    const void *buf, size_t len, enum Encoding encoding = BINARY) {
+#if (NODE_MODULE_VERSION >= ATOM_0_21_MODULE_VERSION)
+  v8::Isolate* isolate = v8::Isolate::GetCurrent();
+  node::encoding node_enc = static_cast<node::encoding>(encoding);
+
+  if (encoding == UCS2) {
+    return node::Encode(
+        isolate
+      , reinterpret_cast<const uint16_t *>(buf)
+      , len / 2);
+  } else {
+    return node::Encode(
+        isolate
+      , reinterpret_cast<const char *>(buf)
+      , len
+      , node_enc);
+  }
+#elif (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
+  return node::Encode(
+      v8::Isolate::GetCurrent()
+    , buf, len
+    , static_cast<node::encoding>(encoding));
+#else
+# if NODE_MODULE_VERSION >= NODE_0_10_MODULE_VERSION
+  return node::Encode(buf, len, static_cast<node::encoding>(encoding));
+# else
+  return imp::Encode(reinterpret_cast<const char*>(buf), len, encoding);
+# endif
+#endif
+}
+
+inline ssize_t DecodeBytes(
+    v8::Local<v8::Value> val, enum Encoding encoding = BINARY) {
+#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
+  return node::DecodeBytes(
+      v8::Isolate::GetCurrent()
+    , val
+    , static_cast<node::encoding>(encoding));
+#else
+# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION)
+  if (encoding == BUFFER) {
+    return node::DecodeBytes(val, node::BINARY);
+  }
+# endif
+  return node::DecodeBytes(val, static_cast<node::encoding>(encoding));
+#endif
+}
+
+inline ssize_t DecodeWrite(
+    char *buf
+  , size_t len
+  , v8::Local<v8::Value> val
+  , enum Encoding encoding = BINARY) {
+#if (NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION)
+  return node::DecodeWrite(
+      v8::Isolate::GetCurrent()
+    , buf
+    , len
+    , val
+    , static_cast<node::encoding>(encoding));
+#else
+# if (NODE_MODULE_VERSION < NODE_0_10_MODULE_VERSION)
+  if (encoding == BUFFER) {
+    return node::DecodeWrite(buf, len, val, node::BINARY);
+  }
+# endif
+  return node::DecodeWrite(
+      buf
+    , len
+    , val
+    , static_cast<node::encoding>(encoding));
+#endif
+}
+
+inline void SetPrototypeTemplate(
+    v8::Local<v8::FunctionTemplate> templ
+  , const char *name
+  , v8::Local<v8::Data> value
+) {
+  HandleScope scope;
+  SetTemplate(templ->PrototypeTemplate(), name, value);
+}
+
+inline void SetPrototypeTemplate(
+    v8::Local<v8::FunctionTemplate> templ
+  , v8::Local<v8::String> name
+  , v8::Local<v8::Data> value
+  , v8::PropertyAttribute attributes
+) {
+  HandleScope scope;
+  SetTemplate(templ->PrototypeTemplate(), name, value, attributes);
+}
+
+inline void SetInstanceTemplate(
+    v8::Local<v8::FunctionTemplate> templ
+  , const char *name
+  , v8::Local<v8::Data> value
+) {
+  HandleScope scope;
+  SetTemplate(templ->InstanceTemplate(), name, value);
+}
+
+inline void SetInstanceTemplate(
+    v8::Local<v8::FunctionTemplate> templ
+  , v8::Local<v8::String> name
+  , v8::Local<v8::Data> value
+  , v8::PropertyAttribute attributes
+) {
+  HandleScope scope;
+  SetTemplate(templ->InstanceTemplate(), name, value, attributes);
+}
+
+namespace imp {
+
+// Note(@agnat): Helper to distinguish different receiver types. The first
+// version deals with receivers derived from v8::Template. The second version
+// handles everything else. The final argument only serves as discriminator and
+// is unused.
+template <typename T>
+inline
+void
+SetMethodAux(T recv,
+             v8::Local<v8::String> name,
+             v8::Local<v8::FunctionTemplate> tpl,
+             v8::Template *) {
+  recv->Set(name, tpl);
+}
+
+template <typename T>
+inline
+void
+SetMethodAux(T recv,
+             v8::Local<v8::String> name,
+             v8::Local<v8::FunctionTemplate> tpl,
+             ...) {
+  Set(recv, name, GetFunction(tpl).ToLocalChecked());
+}
+
+}  // end of namespace imp
+
+template <typename T, template <typename> class HandleType>
+inline void SetMethod(
+    HandleType<T> recv
+  , const char *name
+  , FunctionCallback callback
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+  HandleScope scope;
+  v8::Local<v8::FunctionTemplate> t = New<v8::FunctionTemplate>(callback, data);
+  v8::Local<v8::String> fn_name = New(name).ToLocalChecked();
+  t->SetClassName(fn_name);
+  // Note(@agnat): Pass an empty T* as discriminator. See note on
+  // SetMethodAux(...) above
+  imp::SetMethodAux(recv, fn_name, t, static_cast<T*>(0));
+}
+
+inline void SetPrototypeMethod(
+    v8::Local<v8::FunctionTemplate> recv
+  , const char* name
+  , FunctionCallback callback
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+  HandleScope scope;
+  v8::Local<v8::FunctionTemplate> t = New<v8::FunctionTemplate>(
+      callback
+    , data
+    , New<v8::Signature>(recv));
+  v8::Local<v8::String> fn_name = New(name).ToLocalChecked();
+  recv->PrototypeTemplate()->Set(fn_name, t);
+  t->SetClassName(fn_name);
+}
+
+//=== Accessors and Such =======================================================
+
+inline void SetAccessor(
+    v8::Local<v8::ObjectTemplate> tpl
+  , v8::Local<v8::String> name
+  , GetterCallback getter
+  , SetterCallback setter = 0
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()
+  , v8::AccessControl settings = v8::DEFAULT
+  , v8::PropertyAttribute attribute = v8::None
+  , imp::Sig signature = imp::Sig()) {
+  HandleScope scope;
+
+  imp::NativeGetter getter_ =
+      imp::GetterCallbackWrapper;
+  imp::NativeSetter setter_ =
+      setter ? imp::SetterCallbackWrapper : 0;
+
+  v8::Local<v8::ObjectTemplate> otpl = New<v8::ObjectTemplate>();
+  otpl->SetInternalFieldCount(imp::kAccessorFieldCount);
+  v8::Local<v8::Object> obj = NewInstance(otpl).ToLocalChecked();
+
+  obj->SetInternalField(
+      imp::kGetterIndex
+    , New<v8::External>(reinterpret_cast<void *>(getter)));
+
+  if (setter != 0) {
+    obj->SetInternalField(
+        imp::kSetterIndex
+      , New<v8::External>(reinterpret_cast<void *>(setter)));
+  }
+
+  if (!data.IsEmpty()) {
+    obj->SetInternalField(imp::kDataIndex, data);
+  }
+
+  tpl->SetAccessor(
+      name
+    , getter_
+    , setter_
+    , obj
+    , settings
+    , attribute
+    , signature);
+}
+
+inline bool SetAccessor(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> name
+  , GetterCallback getter
+  , SetterCallback setter = 0
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()
+  , v8::AccessControl settings = v8::DEFAULT
+  , v8::PropertyAttribute attribute = v8::None) {
+  HandleScope scope;
+
+  imp::NativeGetter getter_ =
+      imp::GetterCallbackWrapper;
+  imp::NativeSetter setter_ =
+      setter ? imp::SetterCallbackWrapper : 0;
+
+  v8::Local<v8::ObjectTemplate> otpl = New<v8::ObjectTemplate>();
+  otpl->SetInternalFieldCount(imp::kAccessorFieldCount);
+  v8::Local<v8::Object> dataobj = NewInstance(otpl).ToLocalChecked();
+
+  dataobj->SetInternalField(
+      imp::kGetterIndex
+    , New<v8::External>(reinterpret_cast<void *>(getter)));
+
+  if (!data.IsEmpty()) {
+    dataobj->SetInternalField(imp::kDataIndex, data);
+  }
+
+  if (setter) {
+    dataobj->SetInternalField(
+        imp::kSetterIndex
+      , New<v8::External>(reinterpret_cast<void *>(setter)));
+  }
+
+#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION)
+  return obj->SetAccessor(
+      GetCurrentContext()
+    , name
+    , getter_
+    , setter_
+    , dataobj
+    , settings
+    , attribute).FromMaybe(false);
+#else
+  return obj->SetAccessor(
+      name
+    , getter_
+    , setter_
+    , dataobj
+    , settings
+    , attribute);
+#endif
+}
+
+inline void SetNamedPropertyHandler(
+    v8::Local<v8::ObjectTemplate> tpl
+  , PropertyGetterCallback getter
+  , PropertySetterCallback setter = 0
+  , PropertyQueryCallback query = 0
+  , PropertyDeleterCallback deleter = 0
+  , PropertyEnumeratorCallback enumerator = 0
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+  HandleScope scope;
+
+  imp::NativePropertyGetter getter_ =
+      imp::PropertyGetterCallbackWrapper;
+  imp::NativePropertySetter setter_ =
+      setter ? imp::PropertySetterCallbackWrapper : 0;
+  imp::NativePropertyQuery query_ =
+      query ? imp::PropertyQueryCallbackWrapper : 0;
+  imp::NativePropertyDeleter *deleter_ =
+      deleter ? imp::PropertyDeleterCallbackWrapper : 0;
+  imp::NativePropertyEnumerator enumerator_ =
+      enumerator ? imp::PropertyEnumeratorCallbackWrapper : 0;
+
+  v8::Local<v8::ObjectTemplate> otpl = New<v8::ObjectTemplate>();
+  otpl->SetInternalFieldCount(imp::kPropertyFieldCount);
+  v8::Local<v8::Object> obj = NewInstance(otpl).ToLocalChecked();
+  obj->SetInternalField(
+      imp::kPropertyGetterIndex
+    , New<v8::External>(reinterpret_cast<void *>(getter)));
+
+  if (setter) {
+    obj->SetInternalField(
+        imp::kPropertySetterIndex
+      , New<v8::External>(reinterpret_cast<void *>(setter)));
+  }
+
+  if (query) {
+    obj->SetInternalField(
+        imp::kPropertyQueryIndex
+      , New<v8::External>(reinterpret_cast<void *>(query)));
+  }
+
+  if (deleter) {
+    obj->SetInternalField(
+        imp::kPropertyDeleterIndex
+      , New<v8::External>(reinterpret_cast<void *>(deleter)));
+  }
+
+  if (enumerator) {
+    obj->SetInternalField(
+        imp::kPropertyEnumeratorIndex
+      , New<v8::External>(reinterpret_cast<void *>(enumerator)));
+  }
+
+  if (!data.IsEmpty()) {
+    obj->SetInternalField(imp::kDataIndex, data);
+  }
+
+#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+  tpl->SetHandler(v8::NamedPropertyHandlerConfiguration(
+      getter_, setter_, query_, deleter_, enumerator_, obj));
+#else
+  tpl->SetNamedPropertyHandler(
+      getter_
+    , setter_
+    , query_
+    , deleter_
+    , enumerator_
+    , obj);
+#endif
+}
+
+inline void SetIndexedPropertyHandler(
+    v8::Local<v8::ObjectTemplate> tpl
+  , IndexGetterCallback getter
+  , IndexSetterCallback setter = 0
+  , IndexQueryCallback query = 0
+  , IndexDeleterCallback deleter = 0
+  , IndexEnumeratorCallback enumerator = 0
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+  HandleScope scope;
+
+  imp::NativeIndexGetter getter_ =
+      imp::IndexGetterCallbackWrapper;
+  imp::NativeIndexSetter setter_ =
+      setter ? imp::IndexSetterCallbackWrapper : 0;
+  imp::NativeIndexQuery query_ =
+      query ? imp::IndexQueryCallbackWrapper : 0;
+  imp::NativeIndexDeleter deleter_ =
+      deleter ? imp::IndexDeleterCallbackWrapper : 0;
+  imp::NativeIndexEnumerator enumerator_ =
+      enumerator ? imp::IndexEnumeratorCallbackWrapper : 0;
+
+  v8::Local<v8::ObjectTemplate> otpl = New<v8::ObjectTemplate>();
+  otpl->SetInternalFieldCount(imp::kIndexPropertyFieldCount);
+  v8::Local<v8::Object> obj = NewInstance(otpl).ToLocalChecked();
+  obj->SetInternalField(
+      imp::kIndexPropertyGetterIndex
+    , New<v8::External>(reinterpret_cast<void *>(getter)));
+
+  if (setter) {
+    obj->SetInternalField(
+        imp::kIndexPropertySetterIndex
+      , New<v8::External>(reinterpret_cast<void *>(setter)));
+  }
+
+  if (query) {
+    obj->SetInternalField(
+        imp::kIndexPropertyQueryIndex
+      , New<v8::External>(reinterpret_cast<void *>(query)));
+  }
+
+  if (deleter) {
+    obj->SetInternalField(
+        imp::kIndexPropertyDeleterIndex
+      , New<v8::External>(reinterpret_cast<void *>(deleter)));
+  }
+
+  if (enumerator) {
+    obj->SetInternalField(
+        imp::kIndexPropertyEnumeratorIndex
+      , New<v8::External>(reinterpret_cast<void *>(enumerator)));
+  }
+
+  if (!data.IsEmpty()) {
+    obj->SetInternalField(imp::kDataIndex, data);
+  }
+
+#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+  tpl->SetHandler(v8::IndexedPropertyHandlerConfiguration(
+      getter_, setter_, query_, deleter_, enumerator_, obj));
+#else
+  tpl->SetIndexedPropertyHandler(
+      getter_
+    , setter_
+    , query_
+    , deleter_
+    , enumerator_
+    , obj);
+#endif
+}
+
+inline void SetCallHandler(
+    v8::Local<v8::FunctionTemplate> tpl
+  , FunctionCallback callback
+  , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+  HandleScope scope;
+
+  v8::Local<v8::ObjectTemplate> otpl = New<v8::ObjectTemplate>();
+  otpl->SetInternalFieldCount(imp::kFunctionFieldCount);
+  v8::Local<v8::Object> obj = NewInstance(otpl).ToLocalChecked();
+
+  obj->SetInternalField(
+      imp::kFunctionIndex
+    , New<v8::External>(reinterpret_cast<void *>(callback)));
+
+  if (!data.IsEmpty()) {
+    obj->SetInternalField(imp::kDataIndex, data);
+  }
+
+  tpl->SetCallHandler(imp::FunctionCallbackWrapper, obj);
+}
+
+
+inline void SetCallAsFunctionHandler(
+    v8::Local<v8::ObjectTemplate> tpl,
+    FunctionCallback callback,
+    v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+  HandleScope scope;
+
+  v8::Local<v8::ObjectTemplate> otpl = New<v8::ObjectTemplate>();
+  otpl->SetInternalFieldCount(imp::kFunctionFieldCount);
+  v8::Local<v8::Object> obj = NewInstance(otpl).ToLocalChecked();
+
+  obj->SetInternalField(
+      imp::kFunctionIndex
+    , New<v8::External>(reinterpret_cast<void *>(callback)));
+
+  if (!data.IsEmpty()) {
+    obj->SetInternalField(imp::kDataIndex, data);
+  }
+
+  tpl->SetCallAsFunctionHandler(imp::FunctionCallbackWrapper, obj);
+}
+
+//=== Weak Persistent Handling =================================================
+
+#include "nan_weak.h"  // NOLINT(build/include)
+
+//=== ObjectWrap ===============================================================
+
+#include "nan_object_wrap.h"  // NOLINT(build/include)
+
+//=== HiddenValue/Private ======================================================
+
+#include "nan_private.h"  // NOLINT(build/include)
+
+//=== Export ==================================================================
+
+inline
+void
+Export(ADDON_REGISTER_FUNCTION_ARGS_TYPE target, const char *name,
+    FunctionCallback f) {
+  HandleScope scope;
+
+  Set(target, New<v8::String>(name).ToLocalChecked(),
+      GetFunction(New<v8::FunctionTemplate>(f)).ToLocalChecked());
+}
+
+//=== Tap Reverse Binding =====================================================
+
+struct Tap {
+  explicit Tap(v8::Local<v8::Value> t) : t_() {
+    HandleScope scope;
+
+    t_.Reset(To<v8::Object>(t).ToLocalChecked());
+  }
+
+  ~Tap() { t_.Reset(); }  // not sure if necessary
+
+  inline void plan(int i) {
+    HandleScope scope;
+    v8::Local<v8::Value> arg = New(i);
+    Call("plan", New(t_), 1, &arg);
+  }
+
+  inline void ok(bool isOk, const char *msg = NULL) {
+    HandleScope scope;
+    v8::Local<v8::Value> args[2];
+    args[0] = New(isOk);
+    if (msg) args[1] = New(msg).ToLocalChecked();
+    Call("ok", New(t_), msg ? 2 : 1, args);
+  }
+
+  inline void pass(const char * msg = NULL) {
+    HandleScope scope;
+    v8::Local<v8::Value> hmsg;
+    if (msg) hmsg = New(msg).ToLocalChecked();
+    Call("pass", New(t_), msg ? 1 : 0, &hmsg);
+  }
+
+  inline void end() {
+    HandleScope scope;
+    Call("end", New(t_), 0, NULL);
+  }
+
+ private:
+  Persistent<v8::Object> t_;
+};
+
+#define NAN_STRINGIZE2(x) #x
+#define NAN_STRINGIZE(x) NAN_STRINGIZE2(x)
+#define NAN_TEST_EXPRESSION(expression) \
+  ( expression ), __FILE__ ":" NAN_STRINGIZE(__LINE__) ": " #expression
+
+#define NAN_EXPORT(target, function) Export(target, #function, function)
+
+#undef TYPE_CHECK
+
+//=== Generic Maybefication ===================================================
+
+namespace imp {
+
+template <typename T> struct Maybefier;
+
+template <typename T> struct Maybefier<v8::Local<T> > {
+  inline static MaybeLocal<T> convert(v8::Local<T> v) {
+    return v;
+  }
+};
+
+template <typename T> struct Maybefier<MaybeLocal<T> > {
+  inline static MaybeLocal<T> convert(MaybeLocal<T> v) {
+    return v;
+  }
+};
+
+}  // end of namespace imp
+
+template <typename T, template <typename> class MaybeMaybe>
+inline MaybeLocal<T>
+MakeMaybe(MaybeMaybe<T> v) {
+  return imp::Maybefier<MaybeMaybe<T> >::convert(v);
+}
+
+//=== TypedArrayContents =======================================================
+
+#include "nan_typedarray_contents.h"  // NOLINT(build/include)
+
+//=== JSON =====================================================================
+
+#include "nan_json.h"  // NOLINT(build/include)
+
+}  // end of namespace Nan
+
+#endif  // NAN_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks.h
new file mode 100644 (file)
index 0000000..53ede84
--- /dev/null
@@ -0,0 +1,88 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_CALLBACKS_H_
+#define NAN_CALLBACKS_H_
+
+template<typename T> class FunctionCallbackInfo;
+template<typename T> class PropertyCallbackInfo;
+template<typename T> class Global;
+
+typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
+typedef void(*GetterCallback)
+    (v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
+typedef void(*SetterCallback)(
+    v8::Local<v8::String>,
+    v8::Local<v8::Value>,
+    const PropertyCallbackInfo<void>&);
+typedef void(*PropertyGetterCallback)(
+    v8::Local<v8::String>,
+    const PropertyCallbackInfo<v8::Value>&);
+typedef void(*PropertySetterCallback)(
+    v8::Local<v8::String>,
+    v8::Local<v8::Value>,
+    const PropertyCallbackInfo<v8::Value>&);
+typedef void(*PropertyEnumeratorCallback)
+    (const PropertyCallbackInfo<v8::Array>&);
+typedef void(*PropertyDeleterCallback)(
+    v8::Local<v8::String>,
+    const PropertyCallbackInfo<v8::Boolean>&);
+typedef void(*PropertyQueryCallback)(
+    v8::Local<v8::String>,
+    const PropertyCallbackInfo<v8::Integer>&);
+typedef void(*IndexGetterCallback)(
+    uint32_t,
+    const PropertyCallbackInfo<v8::Value>&);
+typedef void(*IndexSetterCallback)(
+    uint32_t,
+    v8::Local<v8::Value>,
+    const PropertyCallbackInfo<v8::Value>&);
+typedef void(*IndexEnumeratorCallback)
+    (const PropertyCallbackInfo<v8::Array>&);
+typedef void(*IndexDeleterCallback)(
+    uint32_t,
+    const PropertyCallbackInfo<v8::Boolean>&);
+typedef void(*IndexQueryCallback)(
+    uint32_t,
+    const PropertyCallbackInfo<v8::Integer>&);
+
+namespace imp {
+typedef v8::Local<v8::AccessorSignature> Sig;
+
+static const int kDataIndex =                    0;
+
+static const int kFunctionIndex =                1;
+static const int kFunctionFieldCount =           2;
+
+static const int kGetterIndex =                  1;
+static const int kSetterIndex =                  2;
+static const int kAccessorFieldCount =           3;
+
+static const int kPropertyGetterIndex =          1;
+static const int kPropertySetterIndex =          2;
+static const int kPropertyEnumeratorIndex =      3;
+static const int kPropertyDeleterIndex =         4;
+static const int kPropertyQueryIndex =           5;
+static const int kPropertyFieldCount =           6;
+
+static const int kIndexPropertyGetterIndex =     1;
+static const int kIndexPropertySetterIndex =     2;
+static const int kIndexPropertyEnumeratorIndex = 3;
+static const int kIndexPropertyDeleterIndex =    4;
+static const int kIndexPropertyQueryIndex =      5;
+static const int kIndexPropertyFieldCount =      6;
+
+}  // end of namespace imp
+
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+# include "nan_callbacks_12_inl.h"  // NOLINT(build/include)
+#else
+# include "nan_callbacks_pre_12_inl.h"  // NOLINT(build/include)
+#endif
+
+#endif  // NAN_CALLBACKS_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks_12_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks_12_inl.h
new file mode 100644 (file)
index 0000000..c27b18d
--- /dev/null
@@ -0,0 +1,514 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_CALLBACKS_12_INL_H_
+#define NAN_CALLBACKS_12_INL_H_
+
+template<typename T>
+class ReturnValue {
+  v8::ReturnValue<T> value_;
+
+ public:
+  template <class S>
+  explicit inline ReturnValue(const v8::ReturnValue<S> &value) :
+      value_(value) {}
+  template <class S>
+  explicit inline ReturnValue(const ReturnValue<S>& that)
+      : value_(that.value_) {
+    TYPE_CHECK(T, S);
+  }
+
+  // Handle setters
+  template <typename S> inline void Set(const v8::Local<S> &handle) {
+    TYPE_CHECK(T, S);
+    value_.Set(handle);
+  }
+
+  template <typename S> inline void Set(const Global<S> &handle) {
+    TYPE_CHECK(T, S);
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) &&                       \
+  (V8_MINOR_VERSION > 5 || (V8_MINOR_VERSION == 5 &&                           \
+  defined(V8_BUILD_NUMBER) && V8_BUILD_NUMBER >= 8))))
+    value_.Set(handle);
+#else
+    value_.Set(*reinterpret_cast<const v8::Persistent<S>*>(&handle));
+    const_cast<Global<S> &>(handle).Reset();
+#endif
+  }
+
+  // Fast primitive setters
+  inline void Set(bool value) {
+    TYPE_CHECK(T, v8::Boolean);
+    value_.Set(value);
+  }
+
+  inline void Set(double i) {
+    TYPE_CHECK(T, v8::Number);
+    value_.Set(i);
+  }
+
+  inline void Set(int32_t i) {
+    TYPE_CHECK(T, v8::Integer);
+    value_.Set(i);
+  }
+
+  inline void Set(uint32_t i) {
+    TYPE_CHECK(T, v8::Integer);
+    value_.Set(i);
+  }
+
+  // Fast JS primitive setters
+  inline void SetNull() {
+    TYPE_CHECK(T, v8::Primitive);
+    value_.SetNull();
+  }
+
+  inline void SetUndefined() {
+    TYPE_CHECK(T, v8::Primitive);
+    value_.SetUndefined();
+  }
+
+  inline void SetEmptyString() {
+    TYPE_CHECK(T, v8::String);
+    value_.SetEmptyString();
+  }
+
+  // Convenience getter for isolate
+  inline v8::Isolate *GetIsolate() const {
+    return value_.GetIsolate();
+  }
+
+  // Pointer setter: Uncompilable to prevent inadvertent misuse.
+  template<typename S>
+  inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); }
+};
+
+template<typename T>
+class FunctionCallbackInfo {
+  const v8::FunctionCallbackInfo<T> &info_;
+  const v8::Local<v8::Value> data_;
+
+ public:
+  explicit inline FunctionCallbackInfo(
+      const v8::FunctionCallbackInfo<T> &info
+    , v8::Local<v8::Value> data) :
+          info_(info)
+        , data_(data) {}
+
+  inline ReturnValue<T> GetReturnValue() const {
+    return ReturnValue<T>(info_.GetReturnValue());
+  }
+
+#if NODE_MAJOR_VERSION < 10
+  inline v8::Local<v8::Function> Callee() const { return info_.Callee(); }
+#endif
+  inline v8::Local<v8::Value> Data() const { return data_; }
+  inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
+  inline bool IsConstructCall() const { return info_.IsConstructCall(); }
+  inline int Length() const { return info_.Length(); }
+  inline v8::Local<v8::Value> operator[](int i) const { return info_[i]; }
+  inline v8::Local<v8::Object> This() const { return info_.This(); }
+  inline v8::Isolate *GetIsolate() const { return info_.GetIsolate(); }
+
+
+ protected:
+  static const int kHolderIndex = 0;
+  static const int kIsolateIndex = 1;
+  static const int kReturnValueDefaultValueIndex = 2;
+  static const int kReturnValueIndex = 3;
+  static const int kDataIndex = 4;
+  static const int kCalleeIndex = 5;
+  static const int kContextSaveIndex = 6;
+  static const int kArgsLength = 7;
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo)
+};
+
+template<typename T>
+class PropertyCallbackInfo {
+  const v8::PropertyCallbackInfo<T> &info_;
+  const v8::Local<v8::Value> data_;
+
+ public:
+  explicit inline PropertyCallbackInfo(
+      const v8::PropertyCallbackInfo<T> &info
+    , const v8::Local<v8::Value> data) :
+          info_(info)
+        , data_(data) {}
+
+  inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); }
+  inline v8::Local<v8::Value> Data() const { return data_; }
+  inline v8::Local<v8::Object> This() const { return info_.This(); }
+  inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
+  inline ReturnValue<T> GetReturnValue() const {
+    return ReturnValue<T>(info_.GetReturnValue());
+  }
+
+ protected:
+  static const int kHolderIndex = 0;
+  static const int kIsolateIndex = 1;
+  static const int kReturnValueDefaultValueIndex = 2;
+  static const int kReturnValueIndex = 3;
+  static const int kDataIndex = 4;
+  static const int kThisIndex = 5;
+  static const int kArgsLength = 6;
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfo)
+};
+
+namespace imp {
+static
+void FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  FunctionCallback callback = reinterpret_cast<FunctionCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kFunctionIndex).As<v8::External>()->Value()));
+  FunctionCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  callback(cbinfo);
+}
+
+typedef void (*NativeFunction)(const v8::FunctionCallbackInfo<v8::Value> &);
+
+#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+static
+void GetterCallbackWrapper(
+    v8::Local<v8::Name> property
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  GetterCallback callback = reinterpret_cast<GetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
+  callback(property.As<v8::String>(), cbinfo);
+}
+
+typedef void (*NativeGetter)
+    (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void SetterCallbackWrapper(
+    v8::Local<v8::Name> property
+  , v8::Local<v8::Value> value
+  , const v8::PropertyCallbackInfo<void> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<void>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  SetterCallback callback = reinterpret_cast<SetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
+  callback(property.As<v8::String>(), value, cbinfo);
+}
+
+typedef void (*NativeSetter)(
+    v8::Local<v8::Name>
+  , v8::Local<v8::Value>
+  , const v8::PropertyCallbackInfo<void> &);
+#else
+static
+void GetterCallbackWrapper(
+    v8::Local<v8::String> property
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  GetterCallback callback = reinterpret_cast<GetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
+  callback(property, cbinfo);
+}
+
+typedef void (*NativeGetter)
+    (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void SetterCallbackWrapper(
+    v8::Local<v8::String> property
+  , v8::Local<v8::Value> value
+  , const v8::PropertyCallbackInfo<void> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<void>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  SetterCallback callback = reinterpret_cast<SetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
+  callback(property, value, cbinfo);
+}
+
+typedef void (*NativeSetter)(
+    v8::Local<v8::String>
+  , v8::Local<v8::Value>
+  , const v8::PropertyCallbackInfo<void> &);
+#endif
+
+#if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+static
+void PropertyGetterCallbackWrapper(
+    v8::Local<v8::Name> property
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyGetterIndex)
+              .As<v8::External>()->Value()));
+  callback(property.As<v8::String>(), cbinfo);
+}
+
+typedef void (*NativePropertyGetter)
+    (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void PropertySetterCallbackWrapper(
+    v8::Local<v8::Name> property
+  , v8::Local<v8::Value> value
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertySetterIndex)
+              .As<v8::External>()->Value()));
+  callback(property.As<v8::String>(), value, cbinfo);
+}
+
+typedef void (*NativePropertySetter)(
+    v8::Local<v8::Name>
+  , v8::Local<v8::Value>
+  , const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void PropertyEnumeratorCallbackWrapper(
+    const v8::PropertyCallbackInfo<v8::Array> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Array>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyEnumeratorCallback callback =
+      reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyEnumeratorIndex)
+              .As<v8::External>()->Value()));
+  callback(cbinfo);
+}
+
+typedef void (*NativePropertyEnumerator)
+    (const v8::PropertyCallbackInfo<v8::Array> &);
+
+static
+void PropertyDeleterCallbackWrapper(
+    v8::Local<v8::Name> property
+  , const v8::PropertyCallbackInfo<v8::Boolean> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Boolean>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyDeleterIndex)
+              .As<v8::External>()->Value()));
+  callback(property.As<v8::String>(), cbinfo);
+}
+
+typedef void (NativePropertyDeleter)
+    (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean> &);
+
+static
+void PropertyQueryCallbackWrapper(
+    v8::Local<v8::Name> property
+  , const v8::PropertyCallbackInfo<v8::Integer> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Integer>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyQueryIndex)
+              .As<v8::External>()->Value()));
+  callback(property.As<v8::String>(), cbinfo);
+}
+
+typedef void (*NativePropertyQuery)
+    (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer> &);
+#else
+static
+void PropertyGetterCallbackWrapper(
+    v8::Local<v8::String> property
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyGetterIndex)
+              .As<v8::External>()->Value()));
+  callback(property, cbinfo);
+}
+
+typedef void (*NativePropertyGetter)
+    (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void PropertySetterCallbackWrapper(
+    v8::Local<v8::String> property
+  , v8::Local<v8::Value> value
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertySetterIndex)
+              .As<v8::External>()->Value()));
+  callback(property, value, cbinfo);
+}
+
+typedef void (*NativePropertySetter)(
+    v8::Local<v8::String>
+  , v8::Local<v8::Value>
+  , const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void PropertyEnumeratorCallbackWrapper(
+    const v8::PropertyCallbackInfo<v8::Array> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Array>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyEnumeratorCallback callback =
+      reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyEnumeratorIndex)
+              .As<v8::External>()->Value()));
+  callback(cbinfo);
+}
+
+typedef void (*NativePropertyEnumerator)
+    (const v8::PropertyCallbackInfo<v8::Array> &);
+
+static
+void PropertyDeleterCallbackWrapper(
+    v8::Local<v8::String> property
+  , const v8::PropertyCallbackInfo<v8::Boolean> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Boolean>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyDeleterIndex)
+              .As<v8::External>()->Value()));
+  callback(property, cbinfo);
+}
+
+typedef void (NativePropertyDeleter)
+    (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean> &);
+
+static
+void PropertyQueryCallbackWrapper(
+    v8::Local<v8::String> property
+  , const v8::PropertyCallbackInfo<v8::Integer> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Integer>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyQueryIndex)
+              .As<v8::External>()->Value()));
+  callback(property, cbinfo);
+}
+
+typedef void (*NativePropertyQuery)
+    (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer> &);
+#endif
+
+static
+void IndexGetterCallbackWrapper(
+    uint32_t index, const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexGetterCallback callback = reinterpret_cast<IndexGetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyGetterIndex)
+              .As<v8::External>()->Value()));
+  callback(index, cbinfo);
+}
+
+typedef void (*NativeIndexGetter)
+    (uint32_t, const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void IndexSetterCallbackWrapper(
+    uint32_t index
+  , v8::Local<v8::Value> value
+  , const v8::PropertyCallbackInfo<v8::Value> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexSetterCallback callback = reinterpret_cast<IndexSetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertySetterIndex)
+              .As<v8::External>()->Value()));
+  callback(index, value, cbinfo);
+}
+
+typedef void (*NativeIndexSetter)(
+    uint32_t
+  , v8::Local<v8::Value>
+  , const v8::PropertyCallbackInfo<v8::Value> &);
+
+static
+void IndexEnumeratorCallbackWrapper(
+    const v8::PropertyCallbackInfo<v8::Array> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Array>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexEnumeratorCallback callback = reinterpret_cast<IndexEnumeratorCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(
+              kIndexPropertyEnumeratorIndex).As<v8::External>()->Value()));
+  callback(cbinfo);
+}
+
+typedef void (*NativeIndexEnumerator)
+    (const v8::PropertyCallbackInfo<v8::Array> &);
+
+static
+void IndexDeleterCallbackWrapper(
+    uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Boolean>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexDeleterCallback callback = reinterpret_cast<IndexDeleterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyDeleterIndex)
+              .As<v8::External>()->Value()));
+  callback(index, cbinfo);
+}
+
+typedef void (*NativeIndexDeleter)
+    (uint32_t, const v8::PropertyCallbackInfo<v8::Boolean> &);
+
+static
+void IndexQueryCallbackWrapper(
+    uint32_t index, const v8::PropertyCallbackInfo<v8::Integer> &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Integer>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexQueryCallback callback = reinterpret_cast<IndexQueryCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyQueryIndex)
+              .As<v8::External>()->Value()));
+  callback(index, cbinfo);
+}
+
+typedef void (*NativeIndexQuery)
+    (uint32_t, const v8::PropertyCallbackInfo<v8::Integer> &);
+}  // end of namespace imp
+
+#endif  // NAN_CALLBACKS_12_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks_pre_12_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_callbacks_pre_12_inl.h
new file mode 100644 (file)
index 0000000..c9ba499
--- /dev/null
@@ -0,0 +1,520 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_CALLBACKS_PRE_12_INL_H_
+#define NAN_CALLBACKS_PRE_12_INL_H_
+
+namespace imp {
+template<typename T> class ReturnValueImp;
+}  // end of namespace imp
+
+template<typename T>
+class ReturnValue {
+  v8::Isolate *isolate_;
+  v8::Persistent<T> *value_;
+  friend class imp::ReturnValueImp<T>;
+
+ public:
+  template <class S>
+  explicit inline ReturnValue(v8::Isolate *isolate, v8::Persistent<S> *p) :
+      isolate_(isolate), value_(p) {}
+  template <class S>
+  explicit inline ReturnValue(const ReturnValue<S>& that)
+      : isolate_(that.isolate_), value_(that.value_) {
+    TYPE_CHECK(T, S);
+  }
+
+  // Handle setters
+  template <typename S> inline void Set(const v8::Local<S> &handle) {
+    TYPE_CHECK(T, S);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(handle);
+  }
+
+  template <typename S> inline void Set(const Global<S> &handle) {
+    TYPE_CHECK(T, S);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(handle.persistent);
+    const_cast<Global<S> &>(handle).Reset();
+  }
+
+  // Fast primitive setters
+  inline void Set(bool value) {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::Boolean);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::Boolean::New(value));
+  }
+
+  inline void Set(double i) {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::Number);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::Number::New(i));
+  }
+
+  inline void Set(int32_t i) {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::Integer);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::Int32::New(i));
+  }
+
+  inline void Set(uint32_t i) {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::Integer);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::Uint32::NewFromUnsigned(i));
+  }
+
+  // Fast JS primitive setters
+  inline void SetNull() {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::Primitive);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::Null());
+  }
+
+  inline void SetUndefined() {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::Primitive);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::Undefined());
+  }
+
+  inline void SetEmptyString() {
+    v8::HandleScope scope;
+
+    TYPE_CHECK(T, v8::String);
+    value_->Dispose();
+    *value_ = v8::Persistent<T>::New(v8::String::Empty());
+  }
+
+  // Convenience getter for isolate
+  inline v8::Isolate *GetIsolate() const {
+    return isolate_;
+  }
+
+  // Pointer setter: Uncompilable to prevent inadvertent misuse.
+  template<typename S>
+  inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); }
+};
+
+template<typename T>
+class FunctionCallbackInfo {
+  const v8::Arguments &args_;
+  v8::Local<v8::Value> data_;
+  ReturnValue<T> return_value_;
+  v8::Persistent<T> retval_;
+
+ public:
+  explicit inline FunctionCallbackInfo(
+      const v8::Arguments &args
+    , v8::Local<v8::Value> data) :
+          args_(args)
+        , data_(data)
+        , return_value_(args.GetIsolate(), &retval_)
+        , retval_(v8::Persistent<T>::New(v8::Undefined())) {}
+
+  inline ~FunctionCallbackInfo() {
+    retval_.Dispose();
+    retval_.Clear();
+  }
+
+  inline ReturnValue<T> GetReturnValue() const {
+    return ReturnValue<T>(return_value_);
+  }
+
+  inline v8::Local<v8::Function> Callee() const { return args_.Callee(); }
+  inline v8::Local<v8::Value> Data() const { return data_; }
+  inline v8::Local<v8::Object> Holder() const { return args_.Holder(); }
+  inline bool IsConstructCall() const { return args_.IsConstructCall(); }
+  inline int Length() const { return args_.Length(); }
+  inline v8::Local<v8::Value> operator[](int i) const { return args_[i]; }
+  inline v8::Local<v8::Object> This() const { return args_.This(); }
+  inline v8::Isolate *GetIsolate() const { return args_.GetIsolate(); }
+
+
+ protected:
+  static const int kHolderIndex = 0;
+  static const int kIsolateIndex = 1;
+  static const int kReturnValueDefaultValueIndex = 2;
+  static const int kReturnValueIndex = 3;
+  static const int kDataIndex = 4;
+  static const int kCalleeIndex = 5;
+  static const int kContextSaveIndex = 6;
+  static const int kArgsLength = 7;
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo)
+};
+
+template<typename T>
+class PropertyCallbackInfoBase {
+  const v8::AccessorInfo &info_;
+  const v8::Local<v8::Value> data_;
+
+ public:
+  explicit inline PropertyCallbackInfoBase(
+      const v8::AccessorInfo &info
+    , const v8::Local<v8::Value> data) :
+          info_(info)
+        , data_(data) {}
+
+  inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); }
+  inline v8::Local<v8::Value> Data() const { return data_; }
+  inline v8::Local<v8::Object> This() const { return info_.This(); }
+  inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
+
+ protected:
+  static const int kHolderIndex = 0;
+  static const int kIsolateIndex = 1;
+  static const int kReturnValueDefaultValueIndex = 2;
+  static const int kReturnValueIndex = 3;
+  static const int kDataIndex = 4;
+  static const int kThisIndex = 5;
+  static const int kArgsLength = 6;
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfoBase)
+};
+
+template<typename T>
+class PropertyCallbackInfo : public PropertyCallbackInfoBase<T> {
+  ReturnValue<T> return_value_;
+  v8::Persistent<T> retval_;
+
+ public:
+  explicit inline PropertyCallbackInfo(
+      const v8::AccessorInfo &info
+    , const v8::Local<v8::Value> data) :
+          PropertyCallbackInfoBase<T>(info, data)
+        , return_value_(info.GetIsolate(), &retval_)
+        , retval_(v8::Persistent<T>::New(v8::Undefined())) {}
+
+  inline ~PropertyCallbackInfo() {
+    retval_.Dispose();
+    retval_.Clear();
+  }
+
+  inline ReturnValue<T> GetReturnValue() const { return return_value_; }
+};
+
+template<>
+class PropertyCallbackInfo<v8::Array> :
+    public PropertyCallbackInfoBase<v8::Array> {
+  ReturnValue<v8::Array> return_value_;
+  v8::Persistent<v8::Array> retval_;
+
+ public:
+  explicit inline PropertyCallbackInfo(
+      const v8::AccessorInfo &info
+    , const v8::Local<v8::Value> data) :
+          PropertyCallbackInfoBase<v8::Array>(info, data)
+        , return_value_(info.GetIsolate(), &retval_)
+        , retval_(v8::Persistent<v8::Array>::New(v8::Local<v8::Array>())) {}
+
+  inline ~PropertyCallbackInfo() {
+    retval_.Dispose();
+    retval_.Clear();
+  }
+
+  inline ReturnValue<v8::Array> GetReturnValue() const {
+    return return_value_;
+  }
+};
+
+template<>
+class PropertyCallbackInfo<v8::Boolean> :
+    public PropertyCallbackInfoBase<v8::Boolean> {
+  ReturnValue<v8::Boolean> return_value_;
+  v8::Persistent<v8::Boolean> retval_;
+
+ public:
+  explicit inline PropertyCallbackInfo(
+      const v8::AccessorInfo &info
+    , const v8::Local<v8::Value> data) :
+          PropertyCallbackInfoBase<v8::Boolean>(info, data)
+        , return_value_(info.GetIsolate(), &retval_)
+        , retval_(v8::Persistent<v8::Boolean>::New(v8::Local<v8::Boolean>())) {}
+
+  inline ~PropertyCallbackInfo() {
+    retval_.Dispose();
+    retval_.Clear();
+  }
+
+  inline ReturnValue<v8::Boolean> GetReturnValue() const {
+    return return_value_;
+  }
+};
+
+template<>
+class PropertyCallbackInfo<v8::Integer> :
+    public PropertyCallbackInfoBase<v8::Integer> {
+  ReturnValue<v8::Integer> return_value_;
+  v8::Persistent<v8::Integer> retval_;
+
+ public:
+  explicit inline PropertyCallbackInfo(
+      const v8::AccessorInfo &info
+    , const v8::Local<v8::Value> data) :
+          PropertyCallbackInfoBase<v8::Integer>(info, data)
+        , return_value_(info.GetIsolate(), &retval_)
+        , retval_(v8::Persistent<v8::Integer>::New(v8::Local<v8::Integer>())) {}
+
+  inline ~PropertyCallbackInfo() {
+    retval_.Dispose();
+    retval_.Clear();
+  }
+
+  inline ReturnValue<v8::Integer> GetReturnValue() const {
+    return return_value_;
+  }
+};
+
+namespace imp {
+template<typename T>
+class ReturnValueImp : public ReturnValue<T> {
+ public:
+  explicit ReturnValueImp(ReturnValue<T> that) :
+      ReturnValue<T>(that) {}
+  inline v8::Handle<T> Value() {
+      return *ReturnValue<T>::value_;
+  }
+};
+
+static
+v8::Handle<v8::Value> FunctionCallbackWrapper(const v8::Arguments &args) {
+  v8::Local<v8::Object> obj = args.Data().As<v8::Object>();
+  FunctionCallback callback = reinterpret_cast<FunctionCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kFunctionIndex).As<v8::External>()->Value()));
+  FunctionCallbackInfo<v8::Value>
+      cbinfo(args, obj->GetInternalField(kDataIndex));
+  callback(cbinfo);
+  return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Value> (*NativeFunction)(const v8::Arguments &);
+
+static
+v8::Handle<v8::Value> GetterCallbackWrapper(
+    v8::Local<v8::String> property, const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  GetterCallback callback = reinterpret_cast<GetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
+  callback(property, cbinfo);
+  return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Value> (*NativeGetter)
+    (v8::Local<v8::String>, const v8::AccessorInfo &);
+
+static
+void SetterCallbackWrapper(
+    v8::Local<v8::String> property
+  , v8::Local<v8::Value> value
+  , const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<void>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  SetterCallback callback = reinterpret_cast<SetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
+  callback(property, value, cbinfo);
+}
+
+typedef void (*NativeSetter)
+    (v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Value> PropertyGetterCallbackWrapper(
+    v8::Local<v8::String> property, const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyGetterIndex)
+              .As<v8::External>()->Value()));
+  callback(property, cbinfo);
+  return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Value> (*NativePropertyGetter)
+    (v8::Local<v8::String>, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Value> PropertySetterCallbackWrapper(
+    v8::Local<v8::String> property
+  , v8::Local<v8::Value> value
+  , const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertySetterIndex)
+              .As<v8::External>()->Value()));
+  callback(property, value, cbinfo);
+  return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Value> (*NativePropertySetter)
+    (v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Array> PropertyEnumeratorCallbackWrapper(
+    const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Array>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyEnumeratorCallback callback =
+      reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyEnumeratorIndex)
+              .As<v8::External>()->Value()));
+  callback(cbinfo);
+  return ReturnValueImp<v8::Array>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Array> (*NativePropertyEnumerator)
+    (const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Boolean> PropertyDeleterCallbackWrapper(
+    v8::Local<v8::String> property
+  , const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Boolean>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyDeleterIndex)
+              .As<v8::External>()->Value()));
+  callback(property, cbinfo);
+  return ReturnValueImp<v8::Boolean>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Boolean> (NativePropertyDeleter)
+    (v8::Local<v8::String>, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Integer> PropertyQueryCallbackWrapper(
+    v8::Local<v8::String> property, const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Integer>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kPropertyQueryIndex)
+              .As<v8::External>()->Value()));
+  callback(property, cbinfo);
+  return ReturnValueImp<v8::Integer>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Integer> (*NativePropertyQuery)
+    (v8::Local<v8::String>, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Value> IndexGetterCallbackWrapper(
+    uint32_t index, const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexGetterCallback callback = reinterpret_cast<IndexGetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyGetterIndex)
+              .As<v8::External>()->Value()));
+  callback(index, cbinfo);
+  return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Value> (*NativeIndexGetter)
+    (uint32_t, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Value> IndexSetterCallbackWrapper(
+    uint32_t index
+  , v8::Local<v8::Value> value
+  , const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Value>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexSetterCallback callback = reinterpret_cast<IndexSetterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertySetterIndex)
+              .As<v8::External>()->Value()));
+  callback(index, value, cbinfo);
+  return ReturnValueImp<v8::Value>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Value> (*NativeIndexSetter)
+    (uint32_t, v8::Local<v8::Value>, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Array> IndexEnumeratorCallbackWrapper(
+    const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Array>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexEnumeratorCallback callback = reinterpret_cast<IndexEnumeratorCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyEnumeratorIndex)
+              .As<v8::External>()->Value()));
+  callback(cbinfo);
+  return ReturnValueImp<v8::Array>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Array> (*NativeIndexEnumerator)
+    (const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Boolean> IndexDeleterCallbackWrapper(
+    uint32_t index, const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Boolean>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexDeleterCallback callback = reinterpret_cast<IndexDeleterCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyDeleterIndex)
+              .As<v8::External>()->Value()));
+  callback(index, cbinfo);
+  return ReturnValueImp<v8::Boolean>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Boolean> (*NativeIndexDeleter)
+    (uint32_t, const v8::AccessorInfo &);
+
+static
+v8::Handle<v8::Integer> IndexQueryCallbackWrapper(
+    uint32_t index, const v8::AccessorInfo &info) {
+  v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
+  PropertyCallbackInfo<v8::Integer>
+      cbinfo(info, obj->GetInternalField(kDataIndex));
+  IndexQueryCallback callback = reinterpret_cast<IndexQueryCallback>(
+      reinterpret_cast<intptr_t>(
+          obj->GetInternalField(kIndexPropertyQueryIndex)
+              .As<v8::External>()->Value()));
+  callback(index, cbinfo);
+  return ReturnValueImp<v8::Integer>(cbinfo.GetReturnValue()).Value();
+}
+
+typedef v8::Handle<v8::Integer> (*NativeIndexQuery)
+    (uint32_t, const v8::AccessorInfo &);
+}  // end of namespace imp
+
+#endif  // NAN_CALLBACKS_PRE_12_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_converters.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_converters.h
new file mode 100644 (file)
index 0000000..c0b3272
--- /dev/null
@@ -0,0 +1,72 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_CONVERTERS_H_
+#define NAN_CONVERTERS_H_
+
+namespace imp {
+template<typename T> struct ToFactoryBase {
+  typedef MaybeLocal<T> return_t;
+};
+template<typename T> struct ValueFactoryBase { typedef Maybe<T> return_t; };
+
+template<typename T> struct ToFactory;
+
+template<>
+struct ToFactory<v8::Function> : ToFactoryBase<v8::Function> {
+  static inline return_t convert(v8::Local<v8::Value> val) {
+    if (val.IsEmpty() || !val->IsFunction()) return MaybeLocal<v8::Function>();
+    return MaybeLocal<v8::Function>(val.As<v8::Function>());
+  }
+};
+
+#define X(TYPE)                                                                \
+    template<>                                                                 \
+    struct ToFactory<v8::TYPE> : ToFactoryBase<v8::TYPE> {                     \
+      static inline return_t convert(v8::Local<v8::Value> val);                \
+    };
+
+X(Boolean)
+X(Number)
+X(String)
+X(Object)
+X(Integer)
+X(Uint32)
+X(Int32)
+
+#undef X
+
+#define X(TYPE)                                                                \
+    template<>                                                                 \
+    struct ToFactory<TYPE> : ValueFactoryBase<TYPE> {                          \
+      static inline return_t convert(v8::Local<v8::Value> val);                \
+    };
+
+X(bool)
+X(double)
+X(int64_t)
+X(uint32_t)
+X(int32_t)
+
+#undef X
+}  // end of namespace imp
+
+template<typename T>
+inline
+typename imp::ToFactory<T>::return_t To(v8::Local<v8::Value> val) {
+  return imp::ToFactory<T>::convert(val);
+}
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+# include "nan_converters_43_inl.h"
+#else
+# include "nan_converters_pre_43_inl.h"
+#endif
+
+#endif  // NAN_CONVERTERS_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_converters_43_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_converters_43_inl.h
new file mode 100644 (file)
index 0000000..41b72de
--- /dev/null
@@ -0,0 +1,68 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_CONVERTERS_43_INL_H_
+#define NAN_CONVERTERS_43_INL_H_
+
+#define X(TYPE)                                                                \
+imp::ToFactory<v8::TYPE>::return_t                                             \
+imp::ToFactory<v8::TYPE>::convert(v8::Local<v8::Value> val) {                  \
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();                            \
+  v8::EscapableHandleScope scope(isolate);                                     \
+  return scope.Escape(                                                         \
+      val->To ## TYPE(isolate->GetCurrentContext())                            \
+          .FromMaybe(v8::Local<v8::TYPE>()));                                  \
+}
+
+X(Number)
+X(String)
+X(Object)
+X(Integer)
+X(Uint32)
+X(Int32)
+// V8 <= 7.0
+#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0)
+X(Boolean)
+#else
+imp::ToFactory<v8::Boolean>::return_t                                          \
+imp::ToFactory<v8::Boolean>::convert(v8::Local<v8::Value> val) {               \
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();                            \
+  v8::EscapableHandleScope scope(isolate);                                     \
+  return scope.Escape(val->ToBoolean(isolate));                                \
+}
+#endif
+
+#undef X
+
+#define X(TYPE, NAME)                                                          \
+imp::ToFactory<TYPE>::return_t                                                 \
+imp::ToFactory<TYPE>::convert(v8::Local<v8::Value> val) {                      \
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();                            \
+  v8::HandleScope scope(isolate);                                              \
+  return val->NAME ## Value(isolate->GetCurrentContext());                     \
+}
+
+X(double, Number)
+X(int64_t, Integer)
+X(uint32_t, Uint32)
+X(int32_t, Int32)
+// V8 <= 7.0
+#if V8_MAJOR_VERSION < 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION == 0)
+X(bool, Boolean)
+#else
+imp::ToFactory<bool>::return_t                                                 \
+imp::ToFactory<bool>::convert(v8::Local<v8::Value> val) {                      \
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();                            \
+  v8::HandleScope scope(isolate);                                              \
+  return Just<bool>(val->BooleanValue(isolate));                               \
+}
+#endif
+
+#undef X
+
+#endif  // NAN_CONVERTERS_43_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_converters_pre_43_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_converters_pre_43_inl.h
new file mode 100644 (file)
index 0000000..ae0518a
--- /dev/null
@@ -0,0 +1,42 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_CONVERTERS_PRE_43_INL_H_
+#define NAN_CONVERTERS_PRE_43_INL_H_
+
+#define X(TYPE)                                                                \
+imp::ToFactory<v8::TYPE>::return_t                                             \
+imp::ToFactory<v8::TYPE>::convert(v8::Local<v8::Value> val) {                  \
+  return val->To ## TYPE();                                                    \
+}
+
+X(Boolean)
+X(Number)
+X(String)
+X(Object)
+X(Integer)
+X(Uint32)
+X(Int32)
+
+#undef X
+
+#define X(TYPE, NAME)                                                          \
+imp::ToFactory<TYPE>::return_t                                                 \
+imp::ToFactory<TYPE>::convert(v8::Local<v8::Value> val) {                      \
+  return Just(val->NAME ## Value());                                           \
+}
+
+X(bool, Boolean)
+X(double, Number)
+X(int64_t, Integer)
+X(uint32_t, Uint32)
+X(int32_t, Int32)
+
+#undef X
+
+#endif  // NAN_CONVERTERS_PRE_43_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_define_own_property_helper.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_define_own_property_helper.h
new file mode 100644 (file)
index 0000000..d710ef2
--- /dev/null
@@ -0,0 +1,29 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_DEFINE_OWN_PROPERTY_HELPER_H_
+#define NAN_DEFINE_OWN_PROPERTY_HELPER_H_
+
+namespace imp {
+
+inline Maybe<bool> DefineOwnPropertyHelper(
+    v8::PropertyAttribute current
+  , v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key
+  , v8::Handle<v8::Value> value
+  , v8::PropertyAttribute attribs = v8::None) {
+  return !(current & v8::DontDelete) ||                     // configurable OR
+                  (!(current & v8::ReadOnly) &&             // writable AND
+                   !((attribs ^ current) & ~v8::ReadOnly))  // same excluding RO
+             ? Just<bool>(obj->ForceSet(key, value, attribs))
+             : Nothing<bool>();
+}
+
+}  // end of namespace imp
+
+#endif  // NAN_DEFINE_OWN_PROPERTY_HELPER_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_implementation_12_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_implementation_12_inl.h
new file mode 100644 (file)
index 0000000..255293a
--- /dev/null
@@ -0,0 +1,430 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_IMPLEMENTATION_12_INL_H_
+#define NAN_IMPLEMENTATION_12_INL_H_
+//==============================================================================
+// node v0.11 implementation
+//==============================================================================
+
+namespace imp {
+
+//=== Array ====================================================================
+
+Factory<v8::Array>::return_t
+Factory<v8::Array>::New() {
+  return v8::Array::New(v8::Isolate::GetCurrent());
+}
+
+Factory<v8::Array>::return_t
+Factory<v8::Array>::New(int length) {
+  return v8::Array::New(v8::Isolate::GetCurrent(), length);
+}
+
+//=== Boolean ==================================================================
+
+Factory<v8::Boolean>::return_t
+Factory<v8::Boolean>::New(bool value) {
+  return v8::Boolean::New(v8::Isolate::GetCurrent(), value);
+}
+
+//=== Boolean Object ===========================================================
+
+Factory<v8::BooleanObject>::return_t
+Factory<v8::BooleanObject>::New(bool value) {
+#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION)
+  return v8::BooleanObject::New(
+    v8::Isolate::GetCurrent(), value).As<v8::BooleanObject>();
+#else
+  return v8::BooleanObject::New(value).As<v8::BooleanObject>();
+#endif
+}
+
+//=== Context ==================================================================
+
+Factory<v8::Context>::return_t
+Factory<v8::Context>::New( v8::ExtensionConfiguration* extensions
+                         , v8::Local<v8::ObjectTemplate> tmpl
+                         , v8::Local<v8::Value> obj) {
+  return v8::Context::New(v8::Isolate::GetCurrent(), extensions, tmpl, obj);
+}
+
+//=== Date =====================================================================
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+Factory<v8::Date>::return_t
+Factory<v8::Date>::New(double value) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(v8::Date::New(isolate->GetCurrentContext(), value)
+      .FromMaybe(v8::Local<v8::Value>()).As<v8::Date>());
+}
+#else
+Factory<v8::Date>::return_t
+Factory<v8::Date>::New(double value) {
+  return v8::Date::New(v8::Isolate::GetCurrent(), value).As<v8::Date>();
+}
+#endif
+
+//=== External =================================================================
+
+Factory<v8::External>::return_t
+Factory<v8::External>::New(void * value) {
+  return v8::External::New(v8::Isolate::GetCurrent(), value);
+}
+
+//=== Function =================================================================
+
+Factory<v8::Function>::return_t
+Factory<v8::Function>::New( FunctionCallback callback
+                          , v8::Local<v8::Value> data) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  v8::Local<v8::ObjectTemplate> tpl = v8::ObjectTemplate::New(isolate);
+  tpl->SetInternalFieldCount(imp::kFunctionFieldCount);
+  v8::Local<v8::Object> obj = NewInstance(tpl).ToLocalChecked();
+
+  obj->SetInternalField(
+      imp::kFunctionIndex
+    , v8::External::New(isolate, reinterpret_cast<void *>(callback)));
+
+  v8::Local<v8::Value> val = v8::Local<v8::Value>::New(isolate, data);
+
+  if (!val.IsEmpty()) {
+    obj->SetInternalField(imp::kDataIndex, val);
+  }
+
+#if NODE_MAJOR_VERSION >= 10
+  v8::Local<v8::Context> context = isolate->GetCurrentContext();
+  v8::Local<v8::Function> function =
+      v8::Function::New(context, imp::FunctionCallbackWrapper, obj)
+      .ToLocalChecked();
+#else
+  v8::Local<v8::Function> function =
+      v8::Function::New(isolate, imp::FunctionCallbackWrapper, obj);
+#endif
+
+  return scope.Escape(function);
+}
+
+//=== Function Template ========================================================
+
+Factory<v8::FunctionTemplate>::return_t
+Factory<v8::FunctionTemplate>::New( FunctionCallback callback
+                                  , v8::Local<v8::Value> data
+                                  , v8::Local<v8::Signature> signature) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  if (callback) {
+    v8::EscapableHandleScope scope(isolate);
+    v8::Local<v8::ObjectTemplate> tpl = v8::ObjectTemplate::New(isolate);
+    tpl->SetInternalFieldCount(imp::kFunctionFieldCount);
+    v8::Local<v8::Object> obj = NewInstance(tpl).ToLocalChecked();
+
+    obj->SetInternalField(
+        imp::kFunctionIndex
+      , v8::External::New(isolate, reinterpret_cast<void *>(callback)));
+    v8::Local<v8::Value> val = v8::Local<v8::Value>::New(isolate, data);
+
+    if (!val.IsEmpty()) {
+      obj->SetInternalField(imp::kDataIndex, val);
+    }
+
+    return scope.Escape(v8::FunctionTemplate::New( isolate
+                                    , imp::FunctionCallbackWrapper
+                                    , obj
+                                    , signature));
+  } else {
+    return v8::FunctionTemplate::New(isolate, 0, data, signature);
+  }
+}
+
+//=== Number ===================================================================
+
+Factory<v8::Number>::return_t
+Factory<v8::Number>::New(double value) {
+  return v8::Number::New(v8::Isolate::GetCurrent(), value);
+}
+
+//=== Number Object ============================================================
+
+Factory<v8::NumberObject>::return_t
+Factory<v8::NumberObject>::New(double value) {
+  return v8::NumberObject::New( v8::Isolate::GetCurrent()
+                              , value).As<v8::NumberObject>();
+}
+
+//=== Integer, Int32 and Uint32 ================================================
+
+template <typename T>
+typename IntegerFactory<T>::return_t
+IntegerFactory<T>::New(int32_t value) {
+  return To<T>(T::New(v8::Isolate::GetCurrent(), value));
+}
+
+template <typename T>
+typename IntegerFactory<T>::return_t
+IntegerFactory<T>::New(uint32_t value) {
+  return To<T>(T::NewFromUnsigned(v8::Isolate::GetCurrent(), value));
+}
+
+Factory<v8::Uint32>::return_t
+Factory<v8::Uint32>::New(int32_t value) {
+  return To<v8::Uint32>(
+      v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value));
+}
+
+Factory<v8::Uint32>::return_t
+Factory<v8::Uint32>::New(uint32_t value) {
+  return To<v8::Uint32>(
+      v8::Uint32::NewFromUnsigned(v8::Isolate::GetCurrent(), value));
+}
+
+//=== Object ===================================================================
+
+Factory<v8::Object>::return_t
+Factory<v8::Object>::New() {
+  return v8::Object::New(v8::Isolate::GetCurrent());
+}
+
+//=== Object Template ==========================================================
+
+Factory<v8::ObjectTemplate>::return_t
+Factory<v8::ObjectTemplate>::New() {
+  return v8::ObjectTemplate::New(v8::Isolate::GetCurrent());
+}
+
+//=== RegExp ===================================================================
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+Factory<v8::RegExp>::return_t
+Factory<v8::RegExp>::New(
+    v8::Local<v8::String> pattern
+  , v8::RegExp::Flags flags) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      v8::RegExp::New(isolate->GetCurrentContext(), pattern, flags)
+          .FromMaybe(v8::Local<v8::RegExp>()));
+}
+#else
+Factory<v8::RegExp>::return_t
+Factory<v8::RegExp>::New(
+    v8::Local<v8::String> pattern
+  , v8::RegExp::Flags flags) {
+  return v8::RegExp::New(pattern, flags);
+}
+#endif
+
+//=== Script ===================================================================
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+Factory<v8::Script>::return_t
+Factory<v8::Script>::New( v8::Local<v8::String> source) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  v8::ScriptCompiler::Source src(source);
+  return scope.Escape(
+      v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src)
+          .FromMaybe(v8::Local<v8::Script>()));
+}
+
+Factory<v8::Script>::return_t
+Factory<v8::Script>::New( v8::Local<v8::String> source
+                        , v8::ScriptOrigin const& origin) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  v8::ScriptCompiler::Source src(source, origin);
+  return scope.Escape(
+      v8::ScriptCompiler::Compile(isolate->GetCurrentContext(), &src)
+          .FromMaybe(v8::Local<v8::Script>()));
+}
+#else
+Factory<v8::Script>::return_t
+Factory<v8::Script>::New( v8::Local<v8::String> source) {
+  v8::ScriptCompiler::Source src(source);
+  return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
+}
+
+Factory<v8::Script>::return_t
+Factory<v8::Script>::New( v8::Local<v8::String> source
+                        , v8::ScriptOrigin const& origin) {
+  v8::ScriptCompiler::Source src(source, origin);
+  return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
+}
+#endif
+
+//=== Signature ================================================================
+
+Factory<v8::Signature>::return_t
+Factory<v8::Signature>::New(Factory<v8::Signature>::FTH receiver) {
+  return v8::Signature::New(v8::Isolate::GetCurrent(), receiver);
+}
+
+//=== String ===================================================================
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New() {
+  return v8::String::Empty(v8::Isolate::GetCurrent());
+}
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+Factory<v8::String>::return_t
+Factory<v8::String>::New(const char * value, int length) {
+  return v8::String::NewFromUtf8(
+      v8::Isolate::GetCurrent(), value, v8::NewStringType::kNormal, length);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(std::string const& value) {
+  assert(value.size() <= INT_MAX && "string too long");
+  return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(),
+      value.data(), v8::NewStringType::kNormal, static_cast<int>(value.size()));
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(const uint16_t * value, int length) {
+  return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value,
+        v8::NewStringType::kNormal, length);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
+  return v8::String::NewExternalTwoByte(v8::Isolate::GetCurrent(), value);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(ExternalOneByteStringResource * value) {
+  return v8::String::NewExternalOneByte(v8::Isolate::GetCurrent(), value);
+}
+#else
+Factory<v8::String>::return_t
+Factory<v8::String>::New(const char * value, int length) {
+  return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value,
+                                 v8::String::kNormalString, length);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(
+    std::string const& value) /* NOLINT(build/include_what_you_use) */ {
+  assert(value.size() <= INT_MAX && "string too long");
+  return v8::String::NewFromUtf8(v8::Isolate::GetCurrent(), value.data(),
+                                 v8::String::kNormalString,
+                                 static_cast<int>(value.size()));
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(const uint16_t * value, int length) {
+  return v8::String::NewFromTwoByte(v8::Isolate::GetCurrent(), value,
+                                    v8::String::kNormalString, length);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
+  return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(ExternalOneByteStringResource * value) {
+  return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
+}
+#endif
+
+//=== String Object ============================================================
+
+// See https://github.com/nodejs/nan/pull/811#discussion_r224594980.
+// Disable the warning as there is no way around it.
+// TODO(bnoordhuis) Use isolate-based version in Node.js v12.
+Factory<v8::StringObject>::return_t
+Factory<v8::StringObject>::New(v8::Local<v8::String> value) {
+// V8 > 7.0
+#if V8_MAJOR_VERSION > 7 || (V8_MAJOR_VERSION == 7 && V8_MINOR_VERSION > 0)
+  return v8::StringObject::New(v8::Isolate::GetCurrent(), value)
+      .As<v8::StringObject>();
+#else
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable : 4996)
+#endif
+#ifdef __GNUC__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+  return v8::StringObject::New(value).As<v8::StringObject>();
+#ifdef __GNUC__
+#pragma GCC diagnostic pop
+#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#endif
+}
+
+//=== Unbound Script ===========================================================
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+Factory<v8::UnboundScript>::return_t
+Factory<v8::UnboundScript>::New(v8::Local<v8::String> source) {
+  v8::ScriptCompiler::Source src(source);
+  return v8::ScriptCompiler::CompileUnboundScript(
+      v8::Isolate::GetCurrent(), &src);
+}
+
+Factory<v8::UnboundScript>::return_t
+Factory<v8::UnboundScript>::New( v8::Local<v8::String> source
+                               , v8::ScriptOrigin const& origin) {
+  v8::ScriptCompiler::Source src(source, origin);
+  return v8::ScriptCompiler::CompileUnboundScript(
+      v8::Isolate::GetCurrent(), &src);
+}
+#else
+Factory<v8::UnboundScript>::return_t
+Factory<v8::UnboundScript>::New(v8::Local<v8::String> source) {
+  v8::ScriptCompiler::Source src(source);
+  return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
+}
+
+Factory<v8::UnboundScript>::return_t
+Factory<v8::UnboundScript>::New( v8::Local<v8::String> source
+                               , v8::ScriptOrigin const& origin) {
+  v8::ScriptCompiler::Source src(source, origin);
+  return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
+}
+#endif
+
+}  // end of namespace imp
+
+//=== Presistents and Handles ==================================================
+
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+template <typename T>
+inline v8::Local<T> New(v8::Handle<T> h) {
+  return v8::Local<T>::New(v8::Isolate::GetCurrent(), h);
+}
+#endif
+
+template <typename T, typename M>
+inline v8::Local<T> New(v8::Persistent<T, M> const& p) {
+  return v8::Local<T>::New(v8::Isolate::GetCurrent(), p);
+}
+
+template <typename T, typename M>
+inline v8::Local<T> New(Persistent<T, M> const& p) {
+  return v8::Local<T>::New(v8::Isolate::GetCurrent(), p);
+}
+
+template <typename T>
+inline v8::Local<T> New(Global<T> const& p) {
+  return v8::Local<T>::New(v8::Isolate::GetCurrent(), p);
+}
+
+#endif  // NAN_IMPLEMENTATION_12_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_implementation_pre_12_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_implementation_pre_12_inl.h
new file mode 100644 (file)
index 0000000..1472421
--- /dev/null
@@ -0,0 +1,263 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_IMPLEMENTATION_PRE_12_INL_H_
+#define NAN_IMPLEMENTATION_PRE_12_INL_H_
+
+//==============================================================================
+// node v0.10 implementation
+//==============================================================================
+
+namespace imp {
+
+//=== Array ====================================================================
+
+Factory<v8::Array>::return_t
+Factory<v8::Array>::New() {
+  return v8::Array::New();
+}
+
+Factory<v8::Array>::return_t
+Factory<v8::Array>::New(int length) {
+  return v8::Array::New(length);
+}
+
+//=== Boolean ==================================================================
+
+Factory<v8::Boolean>::return_t
+Factory<v8::Boolean>::New(bool value) {
+  return v8::Boolean::New(value)->ToBoolean();
+}
+
+//=== Boolean Object ===========================================================
+
+Factory<v8::BooleanObject>::return_t
+Factory<v8::BooleanObject>::New(bool value) {
+  return v8::BooleanObject::New(value).As<v8::BooleanObject>();
+}
+
+//=== Context ==================================================================
+
+Factory<v8::Context>::return_t
+Factory<v8::Context>::New( v8::ExtensionConfiguration* extensions
+                         , v8::Local<v8::ObjectTemplate> tmpl
+                         , v8::Local<v8::Value> obj) {
+  v8::Persistent<v8::Context> ctx = v8::Context::New(extensions, tmpl, obj);
+  v8::Local<v8::Context> lctx = v8::Local<v8::Context>::New(ctx);
+  ctx.Dispose();
+  return lctx;
+}
+
+//=== Date =====================================================================
+
+Factory<v8::Date>::return_t
+Factory<v8::Date>::New(double value) {
+  return v8::Date::New(value).As<v8::Date>();
+}
+
+//=== External =================================================================
+
+Factory<v8::External>::return_t
+Factory<v8::External>::New(void * value) {
+  return v8::External::New(value);
+}
+
+//=== Function =================================================================
+
+Factory<v8::Function>::return_t
+Factory<v8::Function>::New( FunctionCallback callback
+                          , v8::Local<v8::Value> data) {
+  v8::HandleScope scope;
+
+  return scope.Close(Factory<v8::FunctionTemplate>::New(
+                         callback, data, v8::Local<v8::Signature>())
+                         ->GetFunction());
+}
+
+
+//=== FunctionTemplate =========================================================
+
+Factory<v8::FunctionTemplate>::return_t
+Factory<v8::FunctionTemplate>::New( FunctionCallback callback
+                                  , v8::Local<v8::Value> data
+                                  , v8::Local<v8::Signature> signature) {
+  if (callback) {
+    v8::HandleScope scope;
+
+    v8::Local<v8::ObjectTemplate> tpl = v8::ObjectTemplate::New();
+    tpl->SetInternalFieldCount(imp::kFunctionFieldCount);
+    v8::Local<v8::Object> obj = tpl->NewInstance();
+
+    obj->SetInternalField(
+        imp::kFunctionIndex
+      , v8::External::New(reinterpret_cast<void *>(callback)));
+
+    v8::Local<v8::Value> val = v8::Local<v8::Value>::New(data);
+
+    if (!val.IsEmpty()) {
+      obj->SetInternalField(imp::kDataIndex, val);
+    }
+
+    // Note(agnat): Emulate length argument here. Unfortunately, I couldn't find
+    // a way. Have at it though...
+    return scope.Close(
+        v8::FunctionTemplate::New(imp::FunctionCallbackWrapper
+                                 , obj
+                                 , signature));
+  } else {
+    return v8::FunctionTemplate::New(0, data, signature);
+  }
+}
+
+//=== Number ===================================================================
+
+Factory<v8::Number>::return_t
+Factory<v8::Number>::New(double value) {
+  return v8::Number::New(value);
+}
+
+//=== Number Object ============================================================
+
+Factory<v8::NumberObject>::return_t
+Factory<v8::NumberObject>::New(double value) {
+  return v8::NumberObject::New(value).As<v8::NumberObject>();
+}
+
+//=== Integer, Int32 and Uint32 ================================================
+
+template <typename T>
+typename IntegerFactory<T>::return_t
+IntegerFactory<T>::New(int32_t value) {
+  return To<T>(T::New(value));
+}
+
+template <typename T>
+typename IntegerFactory<T>::return_t
+IntegerFactory<T>::New(uint32_t value) {
+  return To<T>(T::NewFromUnsigned(value));
+}
+
+Factory<v8::Uint32>::return_t
+Factory<v8::Uint32>::New(int32_t value) {
+  return To<v8::Uint32>(v8::Uint32::NewFromUnsigned(value));
+}
+
+Factory<v8::Uint32>::return_t
+Factory<v8::Uint32>::New(uint32_t value) {
+  return To<v8::Uint32>(v8::Uint32::NewFromUnsigned(value));
+}
+
+
+//=== Object ===================================================================
+
+Factory<v8::Object>::return_t
+Factory<v8::Object>::New() {
+  return v8::Object::New();
+}
+
+//=== Object Template ==========================================================
+
+Factory<v8::ObjectTemplate>::return_t
+Factory<v8::ObjectTemplate>::New() {
+  return v8::ObjectTemplate::New();
+}
+
+//=== RegExp ===================================================================
+
+Factory<v8::RegExp>::return_t
+Factory<v8::RegExp>::New(
+    v8::Local<v8::String> pattern
+  , v8::RegExp::Flags flags) {
+  return v8::RegExp::New(pattern, flags);
+}
+
+//=== Script ===================================================================
+
+Factory<v8::Script>::return_t
+Factory<v8::Script>::New( v8::Local<v8::String> source) {
+  return v8::Script::New(source);
+}
+Factory<v8::Script>::return_t
+Factory<v8::Script>::New( v8::Local<v8::String> source
+                        , v8::ScriptOrigin const& origin) {
+  return v8::Script::New(source, const_cast<v8::ScriptOrigin*>(&origin));
+}
+
+//=== Signature ================================================================
+
+Factory<v8::Signature>::return_t
+Factory<v8::Signature>::New(Factory<v8::Signature>::FTH receiver) {
+  return v8::Signature::New(receiver);
+}
+
+//=== String ===================================================================
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New() {
+  return v8::String::Empty();
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(const char * value, int length) {
+  return v8::String::New(value, length);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(
+    std::string const& value) /* NOLINT(build/include_what_you_use) */ {
+  assert(value.size() <= INT_MAX && "string too long");
+  return v8::String::New(value.data(), static_cast<int>(value.size()));
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(const uint16_t * value, int length) {
+  return v8::String::New(value, length);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(v8::String::ExternalStringResource * value) {
+  return v8::String::NewExternal(value);
+}
+
+Factory<v8::String>::return_t
+Factory<v8::String>::New(v8::String::ExternalAsciiStringResource * value) {
+  return v8::String::NewExternal(value);
+}
+
+//=== String Object ============================================================
+
+Factory<v8::StringObject>::return_t
+Factory<v8::StringObject>::New(v8::Local<v8::String> value) {
+  return v8::StringObject::New(value).As<v8::StringObject>();
+}
+
+}  // end of namespace imp
+
+//=== Presistents and Handles ==================================================
+
+template <typename T>
+inline v8::Local<T> New(v8::Handle<T> h) {
+  return v8::Local<T>::New(h);
+}
+
+template <typename T>
+inline v8::Local<T> New(v8::Persistent<T> const& p) {
+  return v8::Local<T>::New(p);
+}
+
+template <typename T, typename M>
+inline v8::Local<T> New(Persistent<T, M> const& p) {
+  return v8::Local<T>::New(p.persistent);
+}
+
+template <typename T>
+inline v8::Local<T> New(Global<T> const& p) {
+  return v8::Local<T>::New(p.persistent);
+}
+
+#endif  // NAN_IMPLEMENTATION_PRE_12_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_json.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_json.h
new file mode 100644 (file)
index 0000000..33ac8ba
--- /dev/null
@@ -0,0 +1,166 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_JSON_H_
+#define NAN_JSON_H_
+
+#if NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION
+#define NAN_JSON_H_NEED_PARSE 1
+#else
+#define NAN_JSON_H_NEED_PARSE 0
+#endif  // NODE_MODULE_VERSION < NODE_0_12_MODULE_VERSION
+
+#if NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION
+#define NAN_JSON_H_NEED_STRINGIFY 0
+#else
+#define NAN_JSON_H_NEED_STRINGIFY 1
+#endif  // NODE_MODULE_VERSION >= NODE_7_0_MODULE_VERSION
+
+class JSON {
+ public:
+  JSON() {
+#if NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY
+    Nan::HandleScope scope;
+
+    Nan::MaybeLocal<v8::Value> maybe_global_json = Nan::Get(
+      Nan::GetCurrentContext()->Global(),
+      Nan::New("JSON").ToLocalChecked()
+    );
+
+    assert(!maybe_global_json.IsEmpty() && "global JSON is empty");
+    v8::Local<v8::Value> val_global_json = maybe_global_json.ToLocalChecked();
+
+    assert(val_global_json->IsObject() && "global JSON is not an object");
+    Nan::MaybeLocal<v8::Object> maybe_obj_global_json =
+      Nan::To<v8::Object>(val_global_json);
+
+    assert(!maybe_obj_global_json.IsEmpty() && "global JSON object is empty");
+    v8::Local<v8::Object> global_json = maybe_obj_global_json.ToLocalChecked();
+
+#if NAN_JSON_H_NEED_PARSE
+    Nan::MaybeLocal<v8::Value> maybe_parse_method = Nan::Get(
+      global_json, Nan::New("parse").ToLocalChecked()
+    );
+
+    assert(!maybe_parse_method.IsEmpty() && "JSON.parse is empty");
+    v8::Local<v8::Value> parse_method = maybe_parse_method.ToLocalChecked();
+
+    assert(parse_method->IsFunction() && "JSON.parse is not a function");
+    parse_cb_.Reset(parse_method.As<v8::Function>());
+#endif  // NAN_JSON_H_NEED_PARSE
+
+#if NAN_JSON_H_NEED_STRINGIFY
+    Nan::MaybeLocal<v8::Value> maybe_stringify_method = Nan::Get(
+      global_json, Nan::New("stringify").ToLocalChecked()
+    );
+
+    assert(!maybe_stringify_method.IsEmpty() && "JSON.stringify is empty");
+    v8::Local<v8::Value> stringify_method =
+      maybe_stringify_method.ToLocalChecked();
+
+    assert(
+      stringify_method->IsFunction() && "JSON.stringify is not a function"
+    );
+    stringify_cb_.Reset(stringify_method.As<v8::Function>());
+#endif  // NAN_JSON_H_NEED_STRINGIFY
+#endif  // NAN_JSON_H_NEED_PARSE + NAN_JSON_H_NEED_STRINGIFY
+  }
+
+  inline
+  Nan::MaybeLocal<v8::Value> Parse(v8::Local<v8::String> json_string) {
+    Nan::EscapableHandleScope scope;
+#if NAN_JSON_H_NEED_PARSE
+    return scope.Escape(parse(json_string));
+#else
+    Nan::MaybeLocal<v8::Value> result;
+#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION && \
+    NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION
+    result = v8::JSON::Parse(json_string);
+#else
+#if NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION
+    v8::Local<v8::Context> context_or_isolate = Nan::GetCurrentContext();
+#else
+    v8::Isolate* context_or_isolate = v8::Isolate::GetCurrent();
+#endif  // NODE_MODULE_VERSION > NODE_6_0_MODULE_VERSION
+    result = v8::JSON::Parse(context_or_isolate, json_string);
+#endif  // NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION &&
+        // NODE_MODULE_VERSION <= IOJS_2_0_MODULE_VERSION
+    if (result.IsEmpty()) return v8::Local<v8::Value>();
+    return scope.Escape(result.ToLocalChecked());
+#endif  // NAN_JSON_H_NEED_PARSE
+  }
+
+  inline
+  Nan::MaybeLocal<v8::String> Stringify(v8::Local<v8::Object> json_object) {
+    Nan::EscapableHandleScope scope;
+    Nan::MaybeLocal<v8::String> result =
+#if NAN_JSON_H_NEED_STRINGIFY
+      Nan::To<v8::String>(stringify(json_object));
+#else
+      v8::JSON::Stringify(Nan::GetCurrentContext(), json_object);
+#endif  // NAN_JSON_H_NEED_STRINGIFY
+    if (result.IsEmpty()) return v8::Local<v8::String>();
+    return scope.Escape(result.ToLocalChecked());
+  }
+
+  inline
+  Nan::MaybeLocal<v8::String> Stringify(v8::Local<v8::Object> json_object,
+    v8::Local<v8::String> gap) {
+    Nan::EscapableHandleScope scope;
+    Nan::MaybeLocal<v8::String> result =
+#if NAN_JSON_H_NEED_STRINGIFY
+      Nan::To<v8::String>(stringify(json_object, gap));
+#else
+      v8::JSON::Stringify(Nan::GetCurrentContext(), json_object, gap);
+#endif  // NAN_JSON_H_NEED_STRINGIFY
+    if (result.IsEmpty()) return v8::Local<v8::String>();
+    return scope.Escape(result.ToLocalChecked());
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(JSON)
+#if NAN_JSON_H_NEED_PARSE
+  Nan::Callback parse_cb_;
+#endif  // NAN_JSON_H_NEED_PARSE
+#if NAN_JSON_H_NEED_STRINGIFY
+  Nan::Callback stringify_cb_;
+#endif  // NAN_JSON_H_NEED_STRINGIFY
+
+#if NAN_JSON_H_NEED_PARSE
+  inline v8::Local<v8::Value> parse(v8::Local<v8::Value> arg) {
+    assert(!parse_cb_.IsEmpty() && "parse_cb_ is empty");
+    AsyncResource resource("nan:JSON.parse");
+    return parse_cb_.Call(1, &arg, &resource).FromMaybe(v8::Local<v8::Value>());
+  }
+#endif  // NAN_JSON_H_NEED_PARSE
+
+#if NAN_JSON_H_NEED_STRINGIFY
+  inline v8::Local<v8::Value> stringify(v8::Local<v8::Value> arg) {
+    assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty");
+    AsyncResource resource("nan:JSON.stringify");
+    return stringify_cb_.Call(1, &arg, &resource)
+        .FromMaybe(v8::Local<v8::Value>());
+  }
+
+  inline v8::Local<v8::Value> stringify(v8::Local<v8::Value> arg,
+    v8::Local<v8::String> gap) {
+    assert(!stringify_cb_.IsEmpty() && "stringify_cb_ is empty");
+
+    v8::Local<v8::Value> argv[] = {
+      arg,
+      Nan::Null(),
+      gap
+    };
+    AsyncResource resource("nan:JSON.stringify");
+    return stringify_cb_.Call(3, argv, &resource)
+        .FromMaybe(v8::Local<v8::Value>());
+  }
+#endif  // NAN_JSON_H_NEED_STRINGIFY
+};
+
+#endif  // NAN_JSON_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_maybe_43_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_maybe_43_inl.h
new file mode 100644 (file)
index 0000000..c04ce30
--- /dev/null
@@ -0,0 +1,356 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_MAYBE_43_INL_H_
+#define NAN_MAYBE_43_INL_H_
+
+template<typename T>
+using MaybeLocal = v8::MaybeLocal<T>;
+
+inline
+MaybeLocal<v8::String> ToDetailString(v8::Local<v8::Value> val) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(val->ToDetailString(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::String>()));
+}
+
+inline
+MaybeLocal<v8::Uint32> ToArrayIndex(v8::Local<v8::Value> val) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(val->ToArrayIndex(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Uint32>()));
+}
+
+inline
+Maybe<bool> Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b)) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return a->Equals(isolate->GetCurrentContext(), b);
+}
+
+inline
+MaybeLocal<v8::Object> NewInstance(v8::Local<v8::Function> h) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(h->NewInstance(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Object>()));
+}
+
+inline
+MaybeLocal<v8::Object> NewInstance(
+      v8::Local<v8::Function> h
+    , int argc
+    , v8::Local<v8::Value> argv[]) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv)
+                          .FromMaybe(v8::Local<v8::Object>()));
+}
+
+inline
+MaybeLocal<v8::Object> NewInstance(v8::Local<v8::ObjectTemplate> h) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(h->NewInstance(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Object>()));
+}
+
+
+inline MaybeLocal<v8::Function> GetFunction(
+    v8::Local<v8::FunctionTemplate> t) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(t->GetFunction(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Function>()));
+}
+
+inline Maybe<bool> Set(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::Value> key
+  , v8::Local<v8::Value> value) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Set(isolate->GetCurrentContext(), key, value);
+}
+
+inline Maybe<bool> Set(
+    v8::Local<v8::Object> obj
+  , uint32_t index
+  , v8::Local<v8::Value> value) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Set(isolate->GetCurrentContext(), index, value);
+}
+
+#if NODE_MODULE_VERSION < NODE_4_0_MODULE_VERSION
+#include "nan_define_own_property_helper.h"  // NOLINT(build/include)
+#endif
+
+inline Maybe<bool> DefineOwnProperty(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key
+  , v8::Local<v8::Value> value
+  , v8::PropertyAttribute attribs = v8::None) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+#if NODE_MODULE_VERSION >= NODE_4_0_MODULE_VERSION
+  return obj->DefineOwnProperty(isolate->GetCurrentContext(), key, value,
+                                attribs);
+#else
+  Maybe<v8::PropertyAttribute> maybeCurrent =
+      obj->GetPropertyAttributes(isolate->GetCurrentContext(), key);
+  if (maybeCurrent.IsNothing()) {
+    return Nothing<bool>();
+  }
+  v8::PropertyAttribute current = maybeCurrent.FromJust();
+  return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs);
+#endif
+}
+
+NAN_DEPRECATED inline Maybe<bool> ForceSet(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::Value> key
+  , v8::Local<v8::Value> value
+  , v8::PropertyAttribute attribs = v8::None) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
+  return key->IsName()
+             ? obj->DefineOwnProperty(isolate->GetCurrentContext(),
+                                      key.As<v8::Name>(), value, attribs)
+             : Nothing<bool>();
+#else
+  return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
+#endif
+}
+
+inline MaybeLocal<v8::Value> Get(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::Value> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->Get(isolate->GetCurrentContext(), key)
+                          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline
+MaybeLocal<v8::Value> Get(v8::Local<v8::Object> obj, uint32_t index) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->Get(isolate->GetCurrentContext(), index)
+                          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline v8::PropertyAttribute GetPropertyAttributes(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::Value> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->GetPropertyAttributes(isolate->GetCurrentContext(), key)
+      .FromJust();
+}
+
+inline Maybe<bool> Has(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Has(isolate->GetCurrentContext(), key);
+}
+
+inline Maybe<bool> Has(v8::Local<v8::Object> obj, uint32_t index) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Has(isolate->GetCurrentContext(), index);
+}
+
+inline Maybe<bool> Delete(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Delete(isolate->GetCurrentContext(), key);
+}
+
+inline
+Maybe<bool> Delete(v8::Local<v8::Object> obj, uint32_t index) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->Delete(isolate->GetCurrentContext(), index);
+}
+
+inline
+MaybeLocal<v8::Array> GetPropertyNames(v8::Local<v8::Object> obj) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->GetPropertyNames(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Array>()));
+}
+
+inline
+MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Local<v8::Object> obj) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->GetOwnPropertyNames(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::Array>()));
+}
+
+inline Maybe<bool> SetPrototype(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::Value> prototype) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->SetPrototype(isolate->GetCurrentContext(), prototype);
+}
+
+inline MaybeLocal<v8::String> ObjectProtoToString(
+    v8::Local<v8::Object> obj) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->ObjectProtoToString(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::String>()));
+}
+
+inline Maybe<bool> HasOwnProperty(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasOwnProperty(isolate->GetCurrentContext(), key);
+}
+
+inline Maybe<bool> HasRealNamedProperty(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasRealNamedProperty(isolate->GetCurrentContext(), key);
+}
+
+inline Maybe<bool> HasRealIndexedProperty(
+    v8::Local<v8::Object> obj
+  , uint32_t index) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasRealIndexedProperty(isolate->GetCurrentContext(), index);
+}
+
+inline Maybe<bool> HasRealNamedCallbackProperty(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return obj->HasRealNamedCallbackProperty(isolate->GetCurrentContext(), key);
+}
+
+inline MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(obj->GetRealNamedPropertyInPrototypeChain(
+                             isolate->GetCurrentContext(), key)
+                          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline MaybeLocal<v8::Value> GetRealNamedProperty(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::String> key) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      obj->GetRealNamedProperty(isolate->GetCurrentContext(), key)
+          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline MaybeLocal<v8::Value> CallAsFunction(
+    v8::Local<v8::Object> obj
+  , v8::Local<v8::Object> recv
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      obj->CallAsFunction(isolate->GetCurrentContext(), recv, argc, argv)
+          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline MaybeLocal<v8::Value> CallAsConstructor(
+    v8::Local<v8::Object> obj
+  , int argc, v8::Local<v8::Value> argv[]) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(
+      obj->CallAsConstructor(isolate->GetCurrentContext(), argc, argv)
+          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+inline
+MaybeLocal<v8::String> GetSourceLine(v8::Local<v8::Message> msg) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(msg->GetSourceLine(isolate->GetCurrentContext())
+                          .FromMaybe(v8::Local<v8::String>()));
+}
+
+inline Maybe<int> GetLineNumber(v8::Local<v8::Message> msg) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return msg->GetLineNumber(isolate->GetCurrentContext());
+}
+
+inline Maybe<int> GetStartColumn(v8::Local<v8::Message> msg) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return msg->GetStartColumn(isolate->GetCurrentContext());
+}
+
+inline Maybe<int> GetEndColumn(v8::Local<v8::Message> msg) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::HandleScope scope(isolate);
+  return msg->GetEndColumn(isolate->GetCurrentContext());
+}
+
+inline MaybeLocal<v8::Object> CloneElementAt(
+    v8::Local<v8::Array> array
+  , uint32_t index) {
+#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION)
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  v8::Local<v8::Context> context = isolate->GetCurrentContext();
+  v8::Local<v8::Value> elem;
+  v8::Local<v8::Object> obj;
+  if (!array->Get(context, index).ToLocal(&elem)) {
+    return scope.Escape(obj);
+  }
+  if (!elem->ToObject(context).ToLocal(&obj)) {
+    return scope.Escape(v8::Local<v8::Object>());
+  }
+  return scope.Escape(obj->Clone());
+#else
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(array->CloneElementAt(isolate->GetCurrentContext(), index)
+                          .FromMaybe(v8::Local<v8::Object>()));
+#endif
+}
+
+inline MaybeLocal<v8::Value> Call(
+    v8::Local<v8::Function> fun
+  , v8::Local<v8::Object> recv
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  return scope.Escape(fun->Call(isolate->GetCurrentContext(), recv, argc, argv)
+                          .FromMaybe(v8::Local<v8::Value>()));
+}
+
+#endif  // NAN_MAYBE_43_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_maybe_pre_43_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_maybe_pre_43_inl.h
new file mode 100644 (file)
index 0000000..83325ae
--- /dev/null
@@ -0,0 +1,268 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_MAYBE_PRE_43_INL_H_
+#define NAN_MAYBE_PRE_43_INL_H_
+
+template<typename T>
+class MaybeLocal {
+ public:
+  inline MaybeLocal() : val_(v8::Local<T>()) {}
+
+  template<typename S>
+# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
+  inline
+  MaybeLocal(v8::Local<S> that) : val_(that) {}  // NOLINT(runtime/explicit)
+# else
+  inline
+  MaybeLocal(v8::Local<S> that) :  // NOLINT(runtime/explicit)
+      val_(*reinterpret_cast<v8::Local<T>*>(&that)) {}
+# endif
+
+  inline bool IsEmpty() const { return val_.IsEmpty(); }
+
+  template<typename S>
+  inline bool ToLocal(v8::Local<S> *out) const {
+    *out = val_;
+    return !IsEmpty();
+  }
+
+  inline v8::Local<T> ToLocalChecked() const {
+#if defined(V8_ENABLE_CHECKS)
+    assert(!IsEmpty() && "ToLocalChecked is Empty");
+#endif  // V8_ENABLE_CHECKS
+    return val_;
+  }
+
+  template<typename S>
+  inline v8::Local<S> FromMaybe(v8::Local<S> default_value) const {
+    return IsEmpty() ? default_value : v8::Local<S>(val_);
+  }
+
+ private:
+  v8::Local<T> val_;
+};
+
+inline
+MaybeLocal<v8::String> ToDetailString(v8::Handle<v8::Value> val) {
+  return MaybeLocal<v8::String>(val->ToDetailString());
+}
+
+inline
+MaybeLocal<v8::Uint32> ToArrayIndex(v8::Handle<v8::Value> val) {
+  return MaybeLocal<v8::Uint32>(val->ToArrayIndex());
+}
+
+inline
+Maybe<bool> Equals(v8::Handle<v8::Value> a, v8::Handle<v8::Value>(b)) {
+  return Just<bool>(a->Equals(b));
+}
+
+inline
+MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::Function> h) {
+  return MaybeLocal<v8::Object>(h->NewInstance());
+}
+
+inline
+MaybeLocal<v8::Object> NewInstance(
+      v8::Local<v8::Function> h
+    , int argc
+    , v8::Local<v8::Value> argv[]) {
+  return MaybeLocal<v8::Object>(h->NewInstance(argc, argv));
+}
+
+inline
+MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::ObjectTemplate> h) {
+  return MaybeLocal<v8::Object>(h->NewInstance());
+}
+
+inline
+MaybeLocal<v8::Function> GetFunction(v8::Handle<v8::FunctionTemplate> t) {
+  return MaybeLocal<v8::Function>(t->GetFunction());
+}
+
+inline Maybe<bool> Set(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::Value> key
+  , v8::Handle<v8::Value> value) {
+  return Just<bool>(obj->Set(key, value));
+}
+
+inline Maybe<bool> Set(
+    v8::Handle<v8::Object> obj
+  , uint32_t index
+  , v8::Handle<v8::Value> value) {
+  return Just<bool>(obj->Set(index, value));
+}
+
+#include "nan_define_own_property_helper.h"  // NOLINT(build/include)
+
+inline Maybe<bool> DefineOwnProperty(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key
+  , v8::Handle<v8::Value> value
+  , v8::PropertyAttribute attribs = v8::None) {
+  v8::PropertyAttribute current = obj->GetPropertyAttributes(key);
+  return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs);
+}
+
+NAN_DEPRECATED inline Maybe<bool> ForceSet(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::Value> key
+  , v8::Handle<v8::Value> value
+  , v8::PropertyAttribute attribs = v8::None) {
+  return Just<bool>(obj->ForceSet(key, value, attribs));
+}
+
+inline MaybeLocal<v8::Value> Get(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::Value> key) {
+  return MaybeLocal<v8::Value>(obj->Get(key));
+}
+
+inline MaybeLocal<v8::Value> Get(
+    v8::Handle<v8::Object> obj
+  , uint32_t index) {
+  return MaybeLocal<v8::Value>(obj->Get(index));
+}
+
+inline Maybe<v8::PropertyAttribute> GetPropertyAttributes(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::Value> key) {
+  return Just<v8::PropertyAttribute>(obj->GetPropertyAttributes(key));
+}
+
+inline Maybe<bool> Has(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return Just<bool>(obj->Has(key));
+}
+
+inline Maybe<bool> Has(
+    v8::Handle<v8::Object> obj
+  , uint32_t index) {
+  return Just<bool>(obj->Has(index));
+}
+
+inline Maybe<bool> Delete(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return Just<bool>(obj->Delete(key));
+}
+
+inline Maybe<bool> Delete(
+    v8::Handle<v8::Object> obj
+  , uint32_t index) {
+  return Just<bool>(obj->Delete(index));
+}
+
+inline
+MaybeLocal<v8::Array> GetPropertyNames(v8::Handle<v8::Object> obj) {
+  return MaybeLocal<v8::Array>(obj->GetPropertyNames());
+}
+
+inline
+MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Handle<v8::Object> obj) {
+  return MaybeLocal<v8::Array>(obj->GetOwnPropertyNames());
+}
+
+inline Maybe<bool> SetPrototype(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::Value> prototype) {
+  return Just<bool>(obj->SetPrototype(prototype));
+}
+
+inline MaybeLocal<v8::String> ObjectProtoToString(
+    v8::Handle<v8::Object> obj) {
+  return MaybeLocal<v8::String>(obj->ObjectProtoToString());
+}
+
+inline Maybe<bool> HasOwnProperty(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return Just<bool>(obj->HasOwnProperty(key));
+}
+
+inline Maybe<bool> HasRealNamedProperty(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return Just<bool>(obj->HasRealNamedProperty(key));
+}
+
+inline Maybe<bool> HasRealIndexedProperty(
+    v8::Handle<v8::Object> obj
+  , uint32_t index) {
+  return Just<bool>(obj->HasRealIndexedProperty(index));
+}
+
+inline Maybe<bool> HasRealNamedCallbackProperty(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return Just<bool>(obj->HasRealNamedCallbackProperty(key));
+}
+
+inline MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return MaybeLocal<v8::Value>(
+      obj->GetRealNamedPropertyInPrototypeChain(key));
+}
+
+inline MaybeLocal<v8::Value> GetRealNamedProperty(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::String> key) {
+  return MaybeLocal<v8::Value>(obj->GetRealNamedProperty(key));
+}
+
+inline MaybeLocal<v8::Value> CallAsFunction(
+    v8::Handle<v8::Object> obj
+  , v8::Handle<v8::Object> recv
+  , int argc
+  , v8::Handle<v8::Value> argv[]) {
+  return MaybeLocal<v8::Value>(obj->CallAsFunction(recv, argc, argv));
+}
+
+inline MaybeLocal<v8::Value> CallAsConstructor(
+    v8::Handle<v8::Object> obj
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  return MaybeLocal<v8::Value>(obj->CallAsConstructor(argc, argv));
+}
+
+inline
+MaybeLocal<v8::String> GetSourceLine(v8::Handle<v8::Message> msg) {
+  return MaybeLocal<v8::String>(msg->GetSourceLine());
+}
+
+inline Maybe<int> GetLineNumber(v8::Handle<v8::Message> msg) {
+  return Just<int>(msg->GetLineNumber());
+}
+
+inline Maybe<int> GetStartColumn(v8::Handle<v8::Message> msg) {
+  return Just<int>(msg->GetStartColumn());
+}
+
+inline Maybe<int> GetEndColumn(v8::Handle<v8::Message> msg) {
+  return Just<int>(msg->GetEndColumn());
+}
+
+inline MaybeLocal<v8::Object> CloneElementAt(
+    v8::Handle<v8::Array> array
+  , uint32_t index) {
+  return MaybeLocal<v8::Object>(array->CloneElementAt(index));
+}
+
+inline MaybeLocal<v8::Value> Call(
+    v8::Local<v8::Function> fun
+  , v8::Local<v8::Object> recv
+  , int argc
+  , v8::Local<v8::Value> argv[]) {
+  return MaybeLocal<v8::Value>(fun->Call(recv, argc, argv));
+}
+
+#endif  // NAN_MAYBE_PRE_43_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_new.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_new.h
new file mode 100644 (file)
index 0000000..cdf8bbe
--- /dev/null
@@ -0,0 +1,340 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_NEW_H_
+#define NAN_NEW_H_
+
+namespace imp {  // scnr
+
+// TODO(agnat): Generalize
+template <typename T> v8::Local<T> To(v8::Local<v8::Integer> i);
+
+template <>
+inline
+v8::Local<v8::Integer>
+To<v8::Integer>(v8::Local<v8::Integer> i) {
+  return Nan::To<v8::Integer>(i).ToLocalChecked();
+}
+
+template <>
+inline
+v8::Local<v8::Int32>
+To<v8::Int32>(v8::Local<v8::Integer> i) {
+  return Nan::To<v8::Int32>(i).ToLocalChecked();
+}
+
+template <>
+inline
+v8::Local<v8::Uint32>
+To<v8::Uint32>(v8::Local<v8::Integer> i) {
+  return Nan::To<v8::Uint32>(i).ToLocalChecked();
+}
+
+template <typename T> struct FactoryBase {
+  typedef v8::Local<T> return_t;
+};
+
+template <typename T> struct MaybeFactoryBase {
+  typedef MaybeLocal<T> return_t;
+};
+
+template <typename T> struct Factory;
+
+template <>
+struct Factory<v8::Array> : FactoryBase<v8::Array> {
+  static inline return_t New();
+  static inline return_t New(int length);
+};
+
+template <>
+struct Factory<v8::Boolean> : FactoryBase<v8::Boolean> {
+  static inline return_t New(bool value);
+};
+
+template <>
+struct Factory<v8::BooleanObject> : FactoryBase<v8::BooleanObject> {
+  static inline return_t New(bool value);
+};
+
+template <>
+struct Factory<v8::Context> : FactoryBase<v8::Context> {
+  static inline
+  return_t
+  New( v8::ExtensionConfiguration* extensions = NULL
+     , v8::Local<v8::ObjectTemplate> tmpl = v8::Local<v8::ObjectTemplate>()
+     , v8::Local<v8::Value> obj = v8::Local<v8::Value>());
+};
+
+template <>
+struct Factory<v8::Date> : MaybeFactoryBase<v8::Date> {
+  static inline return_t New(double value);
+};
+
+template <>
+struct Factory<v8::External> : FactoryBase<v8::External> {
+  static inline return_t New(void *value);
+};
+
+template <>
+struct Factory<v8::Function> : FactoryBase<v8::Function> {
+  static inline
+  return_t
+  New( FunctionCallback callback
+     , v8::Local<v8::Value> data = v8::Local<v8::Value>());
+};
+
+template <>
+struct Factory<v8::FunctionTemplate> : FactoryBase<v8::FunctionTemplate> {
+  static inline
+  return_t
+  New( FunctionCallback callback = NULL
+     , v8::Local<v8::Value> data = v8::Local<v8::Value>()
+     , v8::Local<v8::Signature> signature = v8::Local<v8::Signature>());
+};
+
+template <>
+struct Factory<v8::Number> : FactoryBase<v8::Number> {
+  static inline return_t New(double value);
+};
+
+template <>
+struct Factory<v8::NumberObject> : FactoryBase<v8::NumberObject> {
+  static inline return_t New(double value);
+};
+
+template <typename T>
+struct IntegerFactory : FactoryBase<T> {
+  typedef typename FactoryBase<T>::return_t return_t;
+  static inline return_t New(int32_t value);
+  static inline return_t New(uint32_t value);
+};
+
+template <>
+struct Factory<v8::Integer> : IntegerFactory<v8::Integer> {};
+
+template <>
+struct Factory<v8::Int32> : IntegerFactory<v8::Int32> {};
+
+template <>
+struct Factory<v8::Uint32> : FactoryBase<v8::Uint32> {
+  static inline return_t New(int32_t value);
+  static inline return_t New(uint32_t value);
+};
+
+template <>
+struct Factory<v8::Object> : FactoryBase<v8::Object> {
+  static inline return_t New();
+};
+
+template <>
+struct Factory<v8::ObjectTemplate> : FactoryBase<v8::ObjectTemplate> {
+  static inline return_t New();
+};
+
+template <>
+struct Factory<v8::RegExp> : MaybeFactoryBase<v8::RegExp> {
+  static inline return_t New(
+      v8::Local<v8::String> pattern, v8::RegExp::Flags flags);
+};
+
+template <>
+struct Factory<v8::Script> : MaybeFactoryBase<v8::Script> {
+  static inline return_t New( v8::Local<v8::String> source);
+  static inline return_t New( v8::Local<v8::String> source
+                            , v8::ScriptOrigin const& origin);
+};
+
+template <>
+struct Factory<v8::Signature> : FactoryBase<v8::Signature> {
+  typedef v8::Local<v8::FunctionTemplate> FTH;
+  static inline return_t New(FTH receiver = FTH());
+};
+
+template <>
+struct Factory<v8::String> : MaybeFactoryBase<v8::String> {
+  static inline return_t New();
+  static inline return_t New(const char *value, int length = -1);
+  static inline return_t New(const uint16_t *value, int length = -1);
+  static inline return_t New(std::string const& value);
+
+  static inline return_t New(v8::String::ExternalStringResource * value);
+  static inline return_t New(ExternalOneByteStringResource * value);
+};
+
+template <>
+struct Factory<v8::StringObject> : FactoryBase<v8::StringObject> {
+  static inline return_t New(v8::Local<v8::String> value);
+};
+
+}  // end of namespace imp
+
+#if (NODE_MODULE_VERSION >= 12)
+
+namespace imp {
+
+template <>
+struct Factory<v8::UnboundScript> : MaybeFactoryBase<v8::UnboundScript> {
+  static inline return_t New( v8::Local<v8::String> source);
+  static inline return_t New( v8::Local<v8::String> source
+                            , v8::ScriptOrigin const& origin);
+};
+
+}  // end of namespace imp
+
+# include "nan_implementation_12_inl.h"
+
+#else  // NODE_MODULE_VERSION >= 12
+
+# include "nan_implementation_pre_12_inl.h"
+
+#endif
+
+//=== API ======================================================================
+
+template <typename T>
+typename imp::Factory<T>::return_t
+New() {
+  return imp::Factory<T>::New();
+}
+
+template <typename T, typename A0>
+typename imp::Factory<T>::return_t
+New(A0 arg0) {
+  return imp::Factory<T>::New(arg0);
+}
+
+template <typename T, typename A0, typename A1>
+typename imp::Factory<T>::return_t
+New(A0 arg0, A1 arg1) {
+  return imp::Factory<T>::New(arg0, arg1);
+}
+
+template <typename T, typename A0, typename A1, typename A2>
+typename imp::Factory<T>::return_t
+New(A0 arg0, A1 arg1, A2 arg2) {
+  return imp::Factory<T>::New(arg0, arg1, arg2);
+}
+
+template <typename T, typename A0, typename A1, typename A2, typename A3>
+typename imp::Factory<T>::return_t
+New(A0 arg0, A1 arg1, A2 arg2, A3 arg3) {
+  return imp::Factory<T>::New(arg0, arg1, arg2, arg3);
+}
+
+// Note(agnat): When passing overloaded function pointers to template functions
+// as generic arguments the compiler needs help in picking the right overload.
+// These two functions handle New<Function> and New<FunctionTemplate> with
+// all argument variations.
+
+// v8::Function and v8::FunctionTemplate with one or two arguments
+template <typename T>
+typename imp::Factory<T>::return_t
+New( FunctionCallback callback
+      , v8::Local<v8::Value> data = v8::Local<v8::Value>()) {
+    return imp::Factory<T>::New(callback, data);
+}
+
+// v8::Function and v8::FunctionTemplate with three arguments
+template <typename T, typename A2>
+typename imp::Factory<T>::return_t
+New( FunctionCallback callback
+      , v8::Local<v8::Value> data = v8::Local<v8::Value>()
+      , A2 a2 = A2()) {
+    return imp::Factory<T>::New(callback, data, a2);
+}
+
+// Convenience
+
+#if NODE_MODULE_VERSION < IOJS_3_0_MODULE_VERSION
+template <typename T> inline v8::Local<T> New(v8::Handle<T> h);
+#endif
+
+#if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+template <typename T, typename M>
+    inline v8::Local<T> New(v8::Persistent<T, M> const& p);
+#else
+template <typename T> inline v8::Local<T> New(v8::Persistent<T> const& p);
+#endif
+template <typename T, typename M>
+inline v8::Local<T> New(Persistent<T, M> const& p);
+template <typename T>
+inline v8::Local<T> New(Global<T> const& p);
+
+inline
+imp::Factory<v8::Boolean>::return_t
+New(bool value) {
+  return New<v8::Boolean>(value);
+}
+
+inline
+imp::Factory<v8::Int32>::return_t
+New(int32_t value) {
+  return New<v8::Int32>(value);
+}
+
+inline
+imp::Factory<v8::Uint32>::return_t
+New(uint32_t value) {
+  return New<v8::Uint32>(value);
+}
+
+inline
+imp::Factory<v8::Number>::return_t
+New(double value) {
+  return New<v8::Number>(value);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(std::string const& value) {  // NOLINT(build/include_what_you_use)
+  return New<v8::String>(value);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(const char * value, int length) {
+  return New<v8::String>(value, length);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(const uint16_t * value, int length) {
+  return New<v8::String>(value, length);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(const char * value) {
+  return New<v8::String>(value);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(const uint16_t * value) {
+  return New<v8::String>(value);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(v8::String::ExternalStringResource * value) {
+  return New<v8::String>(value);
+}
+
+inline
+imp::Factory<v8::String>::return_t
+New(ExternalOneByteStringResource * value) {
+  return New<v8::String>(value);
+}
+
+inline
+imp::Factory<v8::RegExp>::return_t
+New(v8::Local<v8::String> pattern, v8::RegExp::Flags flags) {
+  return New<v8::RegExp>(pattern, flags);
+}
+
+#endif  // NAN_NEW_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_object_wrap.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_object_wrap.h
new file mode 100644 (file)
index 0000000..78712f9
--- /dev/null
@@ -0,0 +1,156 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_OBJECT_WRAP_H_
+#define NAN_OBJECT_WRAP_H_
+
+class ObjectWrap {
+ public:
+  ObjectWrap() {
+    refs_ = 0;
+  }
+
+
+  virtual ~ObjectWrap() {
+    if (persistent().IsEmpty()) {
+      return;
+    }
+
+    persistent().ClearWeak();
+    persistent().Reset();
+  }
+
+
+  template <class T>
+  static inline T* Unwrap(v8::Local<v8::Object> object) {
+    assert(!object.IsEmpty());
+    assert(object->InternalFieldCount() > 0);
+    // Cast to ObjectWrap before casting to T.  A direct cast from void
+    // to T won't work right when T has more than one base class.
+    void* ptr = GetInternalFieldPointer(object, 0);
+    ObjectWrap* wrap = static_cast<ObjectWrap*>(ptr);
+    return static_cast<T*>(wrap);
+  }
+
+
+  inline v8::Local<v8::Object> handle() const {
+    return New(handle_);
+  }
+
+
+  inline Persistent<v8::Object>& persistent() {
+    return handle_;
+  }
+
+
+ protected:
+  inline void Wrap(v8::Local<v8::Object> object) {
+    assert(persistent().IsEmpty());
+    assert(object->InternalFieldCount() > 0);
+    SetInternalFieldPointer(object, 0, this);
+    persistent().Reset(object);
+    MakeWeak();
+  }
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+
+  inline void MakeWeak() {
+    persistent().v8::PersistentBase<v8::Object>::SetWeak(
+        this, WeakCallback, v8::WeakCallbackType::kParameter);
+#if NODE_MAJOR_VERSION < 10
+    // FIXME(bnoordhuis) Probably superfluous in older Node.js versions too.
+    persistent().MarkIndependent();
+#endif
+  }
+
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+
+  inline void MakeWeak() {
+    persistent().v8::PersistentBase<v8::Object>::SetWeak(this, WeakCallback);
+    persistent().MarkIndependent();
+  }
+
+#else
+
+  inline void MakeWeak() {
+    persistent().persistent.MakeWeak(this, WeakCallback);
+    persistent().MarkIndependent();
+  }
+
+#endif
+
+  /* Ref() marks the object as being attached to an event loop.
+   * Refed objects will not be garbage collected, even if
+   * all references are lost.
+   */
+  virtual void Ref() {
+    assert(!persistent().IsEmpty());
+    persistent().ClearWeak();
+    refs_++;
+  }
+
+  /* Unref() marks an object as detached from the event loop.  This is its
+   * default state.  When an object with a "weak" reference changes from
+   * attached to detached state it will be freed. Be careful not to access
+   * the object after making this call as it might be gone!
+   * (A "weak reference" means an object that only has a
+   * persistent handle.)
+   *
+   * DO NOT CALL THIS FROM DESTRUCTOR
+   */
+  virtual void Unref() {
+    assert(!persistent().IsEmpty());
+    assert(!persistent().IsWeak());
+    assert(refs_ > 0);
+    if (--refs_ == 0)
+      MakeWeak();
+  }
+
+  int refs_;  // ro
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(ObjectWrap)
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+
+  static void
+  WeakCallback(v8::WeakCallbackInfo<ObjectWrap> const& info) {
+    ObjectWrap* wrap = info.GetParameter();
+    assert(wrap->refs_ == 0);
+    wrap->handle_.Reset();
+    delete wrap;
+  }
+
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+
+  static void
+  WeakCallback(v8::WeakCallbackData<v8::Object, ObjectWrap> const& data) {
+    ObjectWrap* wrap = data.GetParameter();
+    assert(wrap->refs_ == 0);
+    assert(wrap->handle_.IsNearDeath());
+    wrap->handle_.Reset();
+    delete wrap;
+  }
+
+#else
+
+  static void WeakCallback(v8::Persistent<v8::Value> value, void *data) {
+    ObjectWrap *wrap = static_cast<ObjectWrap*>(data);
+    assert(wrap->refs_ == 0);
+    assert(wrap->handle_.IsNearDeath());
+    wrap->handle_.Reset();
+    delete wrap;
+  }
+
+#endif
+  Persistent<v8::Object> handle_;
+};
+
+
+#endif  // NAN_OBJECT_WRAP_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_persistent_12_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_persistent_12_inl.h
new file mode 100644 (file)
index 0000000..d9649e8
--- /dev/null
@@ -0,0 +1,132 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_PERSISTENT_12_INL_H_
+#define NAN_PERSISTENT_12_INL_H_
+
+template<typename T, typename M> class Persistent :
+    public v8::Persistent<T, M> {
+ public:
+  inline Persistent() : v8::Persistent<T, M>() {}
+
+  template<typename S> inline Persistent(v8::Local<S> that) :
+      v8::Persistent<T, M>(v8::Isolate::GetCurrent(), that) {}
+
+  template<typename S, typename M2>
+  inline
+  Persistent(const v8::Persistent<S, M2> &that) :  // NOLINT(runtime/explicit)
+      v8::Persistent<T, M2>(v8::Isolate::GetCurrent(), that) {}
+
+  inline void Reset() { v8::PersistentBase<T>::Reset(); }
+
+  template <typename S>
+  inline void Reset(const v8::Local<S> &other) {
+    v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
+  }
+
+  template <typename S>
+  inline void Reset(const v8::PersistentBase<S> &other) {
+    v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
+  }
+
+  template<typename P>
+  inline void SetWeak(
+    P *parameter
+    , typename WeakCallbackInfo<P>::Callback callback
+    , WeakCallbackType type);
+
+ private:
+  inline T *operator*() const { return *PersistentBase<T>::persistent; }
+
+  template<typename S, typename M2>
+  inline void Copy(const Persistent<S, M2> &that) {
+    TYPE_CHECK(T, S);
+
+    this->Reset();
+
+    if (!that.IsEmpty()) {
+      this->Reset(that);
+      M::Copy(that, this);
+    }
+  }
+};
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+template<typename T>
+class Global : public v8::Global<T> {
+ public:
+  inline Global() : v8::Global<T>() {}
+
+  template<typename S> inline Global(v8::Local<S> that) :
+    v8::Global<T>(v8::Isolate::GetCurrent(), that) {}
+
+  template<typename S>
+  inline
+  Global(const v8::PersistentBase<S> &that) :  // NOLINT(runtime/explicit)
+      v8::Global<S>(v8::Isolate::GetCurrent(), that) {}
+
+  inline void Reset() { v8::PersistentBase<T>::Reset(); }
+
+  template <typename S>
+  inline void Reset(const v8::Local<S> &other) {
+    v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
+  }
+
+  template <typename S>
+  inline void Reset(const v8::PersistentBase<S> &other) {
+    v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
+  }
+
+  template<typename P>
+  inline void SetWeak(
+    P *parameter
+    , typename WeakCallbackInfo<P>::Callback callback
+    , WeakCallbackType type) {
+    reinterpret_cast<Persistent<T>*>(this)->SetWeak(
+        parameter, callback, type);
+  }
+};
+#else
+template<typename T>
+class Global : public v8::UniquePersistent<T> {
+ public:
+  inline Global() : v8::UniquePersistent<T>() {}
+
+  template<typename S> inline Global(v8::Local<S> that) :
+    v8::UniquePersistent<T>(v8::Isolate::GetCurrent(), that) {}
+
+  template<typename S>
+  inline
+  Global(const v8::PersistentBase<S> &that) :  // NOLINT(runtime/explicit)
+      v8::UniquePersistent<S>(v8::Isolate::GetCurrent(), that) {}
+
+  inline void Reset() { v8::PersistentBase<T>::Reset(); }
+
+  template <typename S>
+  inline void Reset(const v8::Local<S> &other) {
+    v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
+  }
+
+  template <typename S>
+  inline void Reset(const v8::PersistentBase<S> &other) {
+    v8::PersistentBase<T>::Reset(v8::Isolate::GetCurrent(), other);
+  }
+
+  template<typename P>
+  inline void SetWeak(
+    P *parameter
+    , typename WeakCallbackInfo<P>::Callback callback
+    , WeakCallbackType type) {
+    reinterpret_cast<Persistent<T>*>(this)->SetWeak(
+        parameter, callback, type);
+  }
+};
+#endif
+
+#endif  // NAN_PERSISTENT_12_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_persistent_pre_12_inl.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_persistent_pre_12_inl.h
new file mode 100644 (file)
index 0000000..4c9c59d
--- /dev/null
@@ -0,0 +1,242 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_PERSISTENT_PRE_12_INL_H_
+#define NAN_PERSISTENT_PRE_12_INL_H_
+
+template<typename T>
+class PersistentBase {
+  v8::Persistent<T> persistent;
+  template<typename U>
+  friend v8::Local<U> New(const PersistentBase<U> &p);
+  template<typename U, typename M>
+  friend v8::Local<U> New(const Persistent<U, M> &p);
+  template<typename U>
+  friend v8::Local<U> New(const Global<U> &p);
+  template<typename S> friend class ReturnValue;
+
+ public:
+  inline PersistentBase() :
+      persistent() {}
+
+  inline void Reset() {
+    persistent.Dispose();
+    persistent.Clear();
+  }
+
+  template<typename S>
+  inline void Reset(const v8::Local<S> &other) {
+    TYPE_CHECK(T, S);
+
+    if (!persistent.IsEmpty()) {
+      persistent.Dispose();
+    }
+
+    if (other.IsEmpty()) {
+      persistent.Clear();
+    } else {
+      persistent = v8::Persistent<T>::New(other);
+    }
+  }
+
+  template<typename S>
+  inline void Reset(const PersistentBase<S> &other) {
+    TYPE_CHECK(T, S);
+
+    if (!persistent.IsEmpty()) {
+      persistent.Dispose();
+    }
+
+    if (other.IsEmpty()) {
+      persistent.Clear();
+    } else {
+      persistent = v8::Persistent<T>::New(other.persistent);
+    }
+  }
+
+  inline bool IsEmpty() const { return persistent.IsEmpty(); }
+
+  inline void Empty() { persistent.Clear(); }
+
+  template<typename S>
+  inline bool operator==(const PersistentBase<S> &that) const {
+    return this->persistent == that.persistent;
+  }
+
+  template<typename S>
+  inline bool operator==(const v8::Local<S> &that) const {
+    return this->persistent == that;
+  }
+
+  template<typename S>
+  inline bool operator!=(const PersistentBase<S> &that) const {
+    return !operator==(that);
+  }
+
+  template<typename S>
+  inline bool operator!=(const v8::Local<S> &that) const {
+    return !operator==(that);
+  }
+
+  template<typename P>
+  inline void SetWeak(
+    P *parameter
+    , typename WeakCallbackInfo<P>::Callback callback
+    , WeakCallbackType type);
+
+  inline void ClearWeak() { persistent.ClearWeak(); }
+
+  inline void MarkIndependent() { persistent.MarkIndependent(); }
+
+  inline bool IsIndependent() const { return persistent.IsIndependent(); }
+
+  inline bool IsNearDeath() const { return persistent.IsNearDeath(); }
+
+  inline bool IsWeak() const { return persistent.IsWeak(); }
+
+ private:
+  inline explicit PersistentBase(v8::Persistent<T> that) :
+      persistent(that) { }
+  inline explicit PersistentBase(T *val) : persistent(val) {}
+  template<typename S, typename M> friend class Persistent;
+  template<typename S> friend class Global;
+  friend class ObjectWrap;
+};
+
+template<typename T>
+class NonCopyablePersistentTraits {
+ public:
+  typedef Persistent<T, NonCopyablePersistentTraits<T> >
+      NonCopyablePersistent;
+  static const bool kResetInDestructor = false;
+  template<typename S, typename M>
+  inline static void Copy(const Persistent<S, M> &source,
+                             NonCopyablePersistent *dest) {
+    Uncompilable<v8::Object>();
+  }
+
+  template<typename O> inline static void Uncompilable() {
+    TYPE_CHECK(O, v8::Primitive);
+  }
+};
+
+template<typename T>
+struct CopyablePersistentTraits {
+  typedef Persistent<T, CopyablePersistentTraits<T> > CopyablePersistent;
+  static const bool kResetInDestructor = true;
+  template<typename S, typename M>
+  static inline void Copy(const Persistent<S, M> &source,
+                             CopyablePersistent *dest) {}
+};
+
+template<typename T, typename M> class Persistent :
+    public PersistentBase<T> {
+ public:
+  inline Persistent() {}
+
+  template<typename S> inline Persistent(v8::Handle<S> that)
+      : PersistentBase<T>(v8::Persistent<T>::New(that)) {
+    TYPE_CHECK(T, S);
+  }
+
+  inline Persistent(const Persistent &that) : PersistentBase<T>() {
+    Copy(that);
+  }
+
+  template<typename S, typename M2>
+  inline Persistent(const Persistent<S, M2> &that) :
+      PersistentBase<T>() {
+    Copy(that);
+  }
+
+  inline Persistent &operator=(const Persistent &that) {
+    Copy(that);
+    return *this;
+  }
+
+  template <class S, class M2>
+  inline Persistent &operator=(const Persistent<S, M2> &that) {
+    Copy(that);
+    return *this;
+  }
+
+  inline ~Persistent() {
+    if (M::kResetInDestructor) this->Reset();
+  }
+
+ private:
+  inline T *operator*() const { return *PersistentBase<T>::persistent; }
+
+  template<typename S, typename M2>
+  inline void Copy(const Persistent<S, M2> &that) {
+    TYPE_CHECK(T, S);
+
+    this->Reset();
+
+    if (!that.IsEmpty()) {
+      this->persistent = v8::Persistent<T>::New(that.persistent);
+      M::Copy(that, this);
+    }
+  }
+};
+
+template<typename T>
+class Global : public PersistentBase<T> {
+  struct RValue {
+    inline explicit RValue(Global* obj) : object(obj) {}
+    Global* object;
+  };
+
+ public:
+  inline Global() : PersistentBase<T>(0) { }
+
+  template <typename S>
+  inline Global(v8::Local<S> that)  // NOLINT(runtime/explicit)
+      : PersistentBase<T>(v8::Persistent<T>::New(that)) {
+    TYPE_CHECK(T, S);
+  }
+
+  template <typename S>
+  inline Global(const PersistentBase<S> &that)  // NOLINT(runtime/explicit)
+    : PersistentBase<T>(that) {
+    TYPE_CHECK(T, S);
+  }
+  /**
+   * Move constructor.
+   */
+  inline Global(RValue rvalue)  // NOLINT(runtime/explicit)
+    : PersistentBase<T>(rvalue.object->persistent) {
+    rvalue.object->Reset();
+  }
+  inline ~Global() { this->Reset(); }
+  /**
+   * Move via assignment.
+   */
+  template<typename S>
+  inline Global &operator=(Global<S> rhs) {
+    TYPE_CHECK(T, S);
+    this->Reset(rhs.persistent);
+    rhs.Reset();
+    return *this;
+  }
+  /**
+   * Cast operator for moves.
+   */
+  inline operator RValue() { return RValue(this); }
+  /**
+   * Pass allows returning uniques from functions, etc.
+   */
+  Global Pass() { return Global(RValue(this)); }
+
+ private:
+  Global(Global &);
+  void operator=(Global &);
+  template<typename S> friend class ReturnValue;
+};
+
+#endif  // NAN_PERSISTENT_PRE_12_INL_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_private.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_private.h
new file mode 100644 (file)
index 0000000..15f44cc
--- /dev/null
@@ -0,0 +1,73 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_PRIVATE_H_
+#define NAN_PRIVATE_H_
+
+inline Maybe<bool>
+HasPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key) {
+  HandleScope scope;
+#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::Local<v8::Context> context = isolate->GetCurrentContext();
+  v8::Local<v8::Private> private_key = v8::Private::ForApi(isolate, key);
+  return object->HasPrivate(context, private_key);
+#else
+  return Just(!object->GetHiddenValue(key).IsEmpty());
+#endif
+}
+
+inline MaybeLocal<v8::Value>
+GetPrivate(v8::Local<v8::Object> object, v8::Local<v8::String> key) {
+#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::EscapableHandleScope scope(isolate);
+  v8::Local<v8::Context> context = isolate->GetCurrentContext();
+  v8::Local<v8::Private> private_key = v8::Private::ForApi(isolate, key);
+  v8::MaybeLocal<v8::Value> v = object->GetPrivate(context, private_key);
+  return scope.Escape(v.ToLocalChecked());
+#else
+  EscapableHandleScope scope;
+  v8::Local<v8::Value> v = object->GetHiddenValue(key);
+  if (v.IsEmpty()) {
+    v = Undefined();
+  }
+  return scope.Escape(v);
+#endif
+}
+
+inline Maybe<bool> SetPrivate(
+    v8::Local<v8::Object> object,
+    v8::Local<v8::String> key,
+    v8::Local<v8::Value> value) {
+#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION
+  HandleScope scope;
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::Local<v8::Context> context = isolate->GetCurrentContext();
+  v8::Local<v8::Private> private_key = v8::Private::ForApi(isolate, key);
+  return object->SetPrivate(context, private_key, value);
+#else
+  return Just(object->SetHiddenValue(key, value));
+#endif
+}
+
+inline Maybe<bool> DeletePrivate(
+    v8::Local<v8::Object> object,
+    v8::Local<v8::String> key) {
+#if NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION
+  HandleScope scope;
+  v8::Isolate *isolate = v8::Isolate::GetCurrent();
+  v8::Local<v8::Private> private_key = v8::Private::ForApi(isolate, key);
+  return object->DeletePrivate(isolate->GetCurrentContext(), private_key);
+#else
+  return Just(object->DeleteHiddenValue(key));
+#endif
+}
+
+#endif  // NAN_PRIVATE_H_
+
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_string_bytes.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_string_bytes.h
new file mode 100644 (file)
index 0000000..a2e6437
--- /dev/null
@@ -0,0 +1,305 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+#ifndef NAN_STRING_BYTES_H_
+#define NAN_STRING_BYTES_H_
+
+// Decodes a v8::Local<v8::String> or Buffer to a raw char*
+
+namespace imp {
+
+using v8::Local;
+using v8::Object;
+using v8::String;
+using v8::Value;
+
+
+//// Base 64 ////
+
+#define base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4)
+
+
+
+//// HEX ////
+
+static bool contains_non_ascii_slow(const char* buf, size_t len) {
+  for (size_t i = 0; i < len; ++i) {
+    if (buf[i] & 0x80) return true;
+  }
+  return false;
+}
+
+
+static bool contains_non_ascii(const char* src, size_t len) {
+  if (len < 16) {
+    return contains_non_ascii_slow(src, len);
+  }
+
+  const unsigned bytes_per_word = sizeof(void*);
+  const unsigned align_mask = bytes_per_word - 1;
+  const unsigned unaligned = reinterpret_cast<uintptr_t>(src) & align_mask;
+
+  if (unaligned > 0) {
+    const unsigned n = bytes_per_word - unaligned;
+    if (contains_non_ascii_slow(src, n)) return true;
+    src += n;
+    len -= n;
+  }
+
+
+#if defined(__x86_64__) || defined(_WIN64)
+  const uintptr_t mask = 0x8080808080808080ll;
+#else
+  const uintptr_t mask = 0x80808080l;
+#endif
+
+  const uintptr_t* srcw = reinterpret_cast<const uintptr_t*>(src);
+
+  for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) {
+    if (srcw[i] & mask) return true;
+  }
+
+  const unsigned remainder = len & align_mask;
+  if (remainder > 0) {
+    const size_t offset = len - remainder;
+    if (contains_non_ascii_slow(src + offset, remainder)) return true;
+  }
+
+  return false;
+}
+
+
+static void force_ascii_slow(const char* src, char* dst, size_t len) {
+  for (size_t i = 0; i < len; ++i) {
+    dst[i] = src[i] & 0x7f;
+  }
+}
+
+
+static void force_ascii(const char* src, char* dst, size_t len) {
+  if (len < 16) {
+    force_ascii_slow(src, dst, len);
+    return;
+  }
+
+  const unsigned bytes_per_word = sizeof(void*);
+  const unsigned align_mask = bytes_per_word - 1;
+  const unsigned src_unalign = reinterpret_cast<uintptr_t>(src) & align_mask;
+  const unsigned dst_unalign = reinterpret_cast<uintptr_t>(dst) & align_mask;
+
+  if (src_unalign > 0) {
+    if (src_unalign == dst_unalign) {
+      const unsigned unalign = bytes_per_word - src_unalign;
+      force_ascii_slow(src, dst, unalign);
+      src += unalign;
+      dst += unalign;
+      len -= src_unalign;
+    } else {
+      force_ascii_slow(src, dst, len);
+      return;
+    }
+  }
+
+#if defined(__x86_64__) || defined(_WIN64)
+  const uintptr_t mask = ~0x8080808080808080ll;
+#else
+  const uintptr_t mask = ~0x80808080l;
+#endif
+
+  const uintptr_t* srcw = reinterpret_cast<const uintptr_t*>(src);
+  uintptr_t* dstw = reinterpret_cast<uintptr_t*>(dst);
+
+  for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) {
+    dstw[i] = srcw[i] & mask;
+  }
+
+  const unsigned remainder = len & align_mask;
+  if (remainder > 0) {
+    const size_t offset = len - remainder;
+    force_ascii_slow(src + offset, dst + offset, remainder);
+  }
+}
+
+
+static size_t base64_encode(const char* src,
+                            size_t slen,
+                            char* dst,
+                            size_t dlen) {
+  // We know how much we'll write, just make sure that there's space.
+  assert(dlen >= base64_encoded_size(slen) &&
+      "not enough space provided for base64 encode");
+
+  dlen = base64_encoded_size(slen);
+
+  unsigned a;
+  unsigned b;
+  unsigned c;
+  unsigned i;
+  unsigned k;
+  unsigned n;
+
+  static const char table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                              "abcdefghijklmnopqrstuvwxyz"
+                              "0123456789+/";
+
+  i = 0;
+  k = 0;
+  n = slen / 3 * 3;
+
+  while (i < n) {
+    a = src[i + 0] & 0xff;
+    b = src[i + 1] & 0xff;
+    c = src[i + 2] & 0xff;
+
+    dst[k + 0] = table[a >> 2];
+    dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
+    dst[k + 2] = table[((b & 0x0f) << 2) | (c >> 6)];
+    dst[k + 3] = table[c & 0x3f];
+
+    i += 3;
+    k += 4;
+  }
+
+  if (n != slen) {
+    switch (slen - n) {
+      case 1:
+        a = src[i + 0] & 0xff;
+        dst[k + 0] = table[a >> 2];
+        dst[k + 1] = table[(a & 3) << 4];
+        dst[k + 2] = '=';
+        dst[k + 3] = '=';
+        break;
+
+      case 2:
+        a = src[i + 0] & 0xff;
+        b = src[i + 1] & 0xff;
+        dst[k + 0] = table[a >> 2];
+        dst[k + 1] = table[((a & 3) << 4) | (b >> 4)];
+        dst[k + 2] = table[(b & 0x0f) << 2];
+        dst[k + 3] = '=';
+        break;
+    }
+  }
+
+  return dlen;
+}
+
+
+static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) {
+  // We know how much we'll write, just make sure that there's space.
+  assert(dlen >= slen * 2 &&
+      "not enough space provided for hex encode");
+
+  dlen = slen * 2;
+  for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) {
+    static const char hex[] = "0123456789abcdef";
+    uint8_t val = static_cast<uint8_t>(src[i]);
+    dst[k + 0] = hex[val >> 4];
+    dst[k + 1] = hex[val & 15];
+  }
+
+  return dlen;
+}
+
+
+
+static Local<Value> Encode(const char* buf,
+                           size_t buflen,
+                           enum Encoding encoding) {
+  assert(buflen <= node::Buffer::kMaxLength);
+  if (!buflen && encoding != BUFFER)
+    return New("").ToLocalChecked();
+
+  Local<String> val;
+  switch (encoding) {
+    case BUFFER:
+      return CopyBuffer(buf, buflen).ToLocalChecked();
+
+    case ASCII:
+      if (contains_non_ascii(buf, buflen)) {
+        char* out = new char[buflen];
+        force_ascii(buf, out, buflen);
+        val = New<String>(out, buflen).ToLocalChecked();
+        delete[] out;
+      } else {
+        val = New<String>(buf, buflen).ToLocalChecked();
+      }
+      break;
+
+    case UTF8:
+      val = New<String>(buf, buflen).ToLocalChecked();
+      break;
+
+    case BINARY: {
+      // TODO(isaacs) use ExternalTwoByteString?
+      const unsigned char *cbuf = reinterpret_cast<const unsigned char*>(buf);
+      uint16_t * twobytebuf = new uint16_t[buflen];
+      for (size_t i = 0; i < buflen; i++) {
+        // XXX is the following line platform independent?
+        twobytebuf[i] = cbuf[i];
+      }
+      val = New<String>(twobytebuf, buflen).ToLocalChecked();
+      delete[] twobytebuf;
+      break;
+    }
+
+    case BASE64: {
+      size_t dlen = base64_encoded_size(buflen);
+      char* dst = new char[dlen];
+
+      size_t written = base64_encode(buf, buflen, dst, dlen);
+      assert(written == dlen);
+
+      val = New<String>(dst, dlen).ToLocalChecked();
+      delete[] dst;
+      break;
+    }
+
+    case UCS2: {
+      const uint16_t* data = reinterpret_cast<const uint16_t*>(buf);
+      val = New<String>(data, buflen / 2).ToLocalChecked();
+      break;
+    }
+
+    case HEX: {
+      size_t dlen = buflen * 2;
+      char* dst = new char[dlen];
+      size_t written = hex_encode(buf, buflen, dst, dlen);
+      assert(written == dlen);
+
+      val = New<String>(dst, dlen).ToLocalChecked();
+      delete[] dst;
+      break;
+    }
+
+    default:
+      assert(0 && "unknown encoding");
+      break;
+  }
+
+  return val;
+}
+
+#undef base64_encoded_size
+
+}  // end of namespace imp
+
+#endif  // NAN_STRING_BYTES_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_typedarray_contents.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_typedarray_contents.h
new file mode 100644 (file)
index 0000000..c6ac8a4
--- /dev/null
@@ -0,0 +1,96 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_TYPEDARRAY_CONTENTS_H_
+#define NAN_TYPEDARRAY_CONTENTS_H_
+
+template<typename T>
+class TypedArrayContents {
+ public:
+  inline explicit TypedArrayContents(v8::Local<v8::Value> from) :
+      length_(0), data_(NULL) {
+    HandleScope scope;
+
+    size_t length = 0;
+    void*  data = NULL;
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+
+    if (from->IsArrayBufferView()) {
+      v8::Local<v8::ArrayBufferView> array =
+        v8::Local<v8::ArrayBufferView>::Cast(from);
+
+      const size_t    byte_length = array->ByteLength();
+      const ptrdiff_t byte_offset = array->ByteOffset();
+      v8::Local<v8::ArrayBuffer> buffer = array->Buffer();
+
+      length = byte_length / sizeof(T);
+// Actually it's 7.9 here but this would lead to ABI issues with Node.js 13
+// using 7.8 till 13.2.0.
+#if (V8_MAJOR_VERSION >= 8)
+      data = static_cast<char*>(buffer->GetBackingStore()->Data()) + byte_offset;
+#else
+      data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
+#endif
+    }
+
+#else
+
+    if (from->IsObject() && !from->IsNull()) {
+      v8::Local<v8::Object> array = v8::Local<v8::Object>::Cast(from);
+
+      MaybeLocal<v8::Value> buffer = Get(array,
+        New<v8::String>("buffer").ToLocalChecked());
+      MaybeLocal<v8::Value> byte_length = Get(array,
+        New<v8::String>("byteLength").ToLocalChecked());
+      MaybeLocal<v8::Value> byte_offset = Get(array,
+        New<v8::String>("byteOffset").ToLocalChecked());
+
+      if (!buffer.IsEmpty() &&
+          !byte_length.IsEmpty() && byte_length.ToLocalChecked()->IsUint32() &&
+          !byte_offset.IsEmpty() && byte_offset.ToLocalChecked()->IsUint32()) {
+        data = array->GetIndexedPropertiesExternalArrayData();
+        if(data) {
+          length = byte_length.ToLocalChecked()->Uint32Value() / sizeof(T);
+        }
+      }
+    }
+
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER >= 1900 || __cplusplus >= 201103L
+    assert(reinterpret_cast<uintptr_t>(data) % alignof (T) == 0);
+#elif defined(_MSC_VER) && _MSC_VER >= 1600 || defined(__GNUC__)
+    assert(reinterpret_cast<uintptr_t>(data) % __alignof(T) == 0);
+#else
+    assert(reinterpret_cast<uintptr_t>(data) % sizeof (T) == 0);
+#endif
+
+    length_ = length;
+    data_   = static_cast<T*>(data);
+  }
+
+  inline size_t length() const      { return length_; }
+  inline T* operator*()             { return data_;   }
+  inline const T* operator*() const { return data_;   }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(TypedArrayContents)
+
+  //Disable heap allocation
+  void *operator new(size_t size);
+  void operator delete(void *, size_t) {
+    abort();
+  }
+
+  size_t  length_;
+  T*      data_;
+};
+
+#endif  // NAN_TYPEDARRAY_CONTENTS_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/nan_weak.h b/legacy-libs/grpc-cloned/node_modules/nan/nan_weak.h
new file mode 100644 (file)
index 0000000..7e7ab07
--- /dev/null
@@ -0,0 +1,437 @@
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+#ifndef NAN_WEAK_H_
+#define NAN_WEAK_H_
+
+static const int kInternalFieldsInWeakCallback = 2;
+static const int kNoInternalFieldIndex = -1;
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \
+    v8::WeakCallbackInfo<WeakCallbackInfo<T> > const&
+# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \
+    NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
+#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION
+# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \
+    v8::PhantomCallbackData<WeakCallbackInfo<T> > const&
+# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \
+    NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
+#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+# define NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ \
+    v8::PhantomCallbackData<WeakCallbackInfo<T> > const&
+# define NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ \
+    v8::InternalFieldsCallbackData<WeakCallbackInfo<T>, void> const&
+# define NAN_WEAK_PARAMETER_CALLBACK_SIG_ NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+# define NAN_WEAK_TWOFIELD_CALLBACK_SIG_ NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+# define NAN_WEAK_CALLBACK_DATA_TYPE_ \
+    v8::WeakCallbackData<S, WeakCallbackInfo<T> > const&
+# define NAN_WEAK_CALLBACK_SIG_ NAN_WEAK_CALLBACK_DATA_TYPE_
+#else
+# define NAN_WEAK_CALLBACK_DATA_TYPE_ void *
+# define NAN_WEAK_CALLBACK_SIG_ \
+    v8::Persistent<v8::Value>, NAN_WEAK_CALLBACK_DATA_TYPE_
+#endif
+
+template<typename T>
+class WeakCallbackInfo {
+ public:
+  typedef void (*Callback)(const WeakCallbackInfo<T>& data);
+  WeakCallbackInfo(
+      Persistent<v8::Value> *persistent
+    , Callback callback
+    , void *parameter
+    , void *field1 = 0
+    , void *field2 = 0) :
+        callback_(callback), isolate_(0), parameter_(parameter) {
+    std::memcpy(&persistent_, persistent, sizeof (v8::Persistent<v8::Value>));
+    internal_fields_[0] = field1;
+    internal_fields_[1] = field2;
+  }
+  inline v8::Isolate *GetIsolate() const { return isolate_; }
+  inline T *GetParameter() const { return static_cast<T*>(parameter_); }
+  inline void *GetInternalField(int index) const {
+    assert((index == 0 || index == 1) && "internal field index out of bounds");
+    if (index == 0) {
+      return internal_fields_[0];
+    } else {
+      return internal_fields_[1];
+    }
+  }
+
+ private:
+  NAN_DISALLOW_ASSIGN_COPY_MOVE(WeakCallbackInfo)
+  Callback callback_;
+  v8::Isolate *isolate_;
+  void *parameter_;
+  void *internal_fields_[kInternalFieldsInWeakCallback];
+  v8::Persistent<v8::Value> persistent_;
+  template<typename S, typename M> friend class Persistent;
+  template<typename S> friend class PersistentBase;
+#if NODE_MODULE_VERSION <= NODE_0_12_MODULE_VERSION
+# if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+  template<typename S>
+  static void invoke(NAN_WEAK_CALLBACK_SIG_ data);
+  template<typename S>
+  static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data);
+# else
+  static void invoke(NAN_WEAK_CALLBACK_SIG_ data);
+  static WeakCallbackInfo *unwrap(NAN_WEAK_CALLBACK_DATA_TYPE_ data);
+# endif
+#else
+# if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                     \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+  template<bool isFirstPass>
+  static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data);
+  template<bool isFirstPass>
+  static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data);
+# else
+  static void invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data);
+  static void invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data);
+# endif
+  static WeakCallbackInfo *unwrapparameter(
+      NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data);
+  static WeakCallbackInfo *unwraptwofield(
+      NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data);
+#endif
+};
+
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+
+template<typename T>
+template<bool isFirstPass>
+void
+WeakCallbackInfo<T>::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) {
+  WeakCallbackInfo<T> *cbinfo = unwrapparameter(data);
+  if (isFirstPass) {
+    cbinfo->persistent_.Reset();
+    data.SetSecondPassCallback(invokeparameter<false>);
+  } else {
+    cbinfo->callback_(*cbinfo);
+    delete cbinfo;
+  }
+}
+
+template<typename T>
+template<bool isFirstPass>
+void
+WeakCallbackInfo<T>::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) {
+  WeakCallbackInfo<T> *cbinfo = unwraptwofield(data);
+  if (isFirstPass) {
+    cbinfo->persistent_.Reset();
+    data.SetSecondPassCallback(invoketwofield<false>);
+  } else {
+    cbinfo->callback_(*cbinfo);
+    delete cbinfo;
+  }
+}
+
+template<typename T>
+WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrapparameter(
+    NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) {
+  WeakCallbackInfo<T> *cbinfo =
+      static_cast<WeakCallbackInfo<T>*>(data.GetParameter());
+  cbinfo->isolate_ = data.GetIsolate();
+  return cbinfo;
+}
+
+template<typename T>
+WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwraptwofield(
+    NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) {
+  WeakCallbackInfo<T> *cbinfo =
+      static_cast<WeakCallbackInfo<T>*>(data.GetInternalField(0));
+  cbinfo->isolate_ = data.GetIsolate();
+  return cbinfo;
+}
+
+#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_
+#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_
+#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
+# elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+
+template<typename T>
+void
+WeakCallbackInfo<T>::invokeparameter(NAN_WEAK_PARAMETER_CALLBACK_SIG_ data) {
+  WeakCallbackInfo<T> *cbinfo = unwrapparameter(data);
+  cbinfo->persistent_.Reset();
+  cbinfo->callback_(*cbinfo);
+  delete cbinfo;
+}
+
+template<typename T>
+void
+WeakCallbackInfo<T>::invoketwofield(NAN_WEAK_TWOFIELD_CALLBACK_SIG_ data) {
+  WeakCallbackInfo<T> *cbinfo = unwraptwofield(data);
+  cbinfo->persistent_.Reset();
+  cbinfo->callback_(*cbinfo);
+  delete cbinfo;
+}
+
+template<typename T>
+WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrapparameter(
+    NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_ data) {
+  WeakCallbackInfo<T> *cbinfo =
+       static_cast<WeakCallbackInfo<T>*>(data.GetParameter());
+  cbinfo->isolate_ = data.GetIsolate();
+  return cbinfo;
+}
+
+template<typename T>
+WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwraptwofield(
+    NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_ data) {
+  WeakCallbackInfo<T> *cbinfo =
+       static_cast<WeakCallbackInfo<T>*>(data.GetInternalField1());
+  cbinfo->isolate_ = data.GetIsolate();
+  return cbinfo;
+}
+
+#undef NAN_WEAK_PARAMETER_CALLBACK_SIG_
+#undef NAN_WEAK_TWOFIELD_CALLBACK_SIG_
+#undef NAN_WEAK_PARAMETER_CALLBACK_DATA_TYPE_
+#undef NAN_WEAK_TWOFIELD_CALLBACK_DATA_TYPE_
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+
+template<typename T>
+template<typename S>
+void WeakCallbackInfo<T>::invoke(NAN_WEAK_CALLBACK_SIG_ data) {
+  WeakCallbackInfo<T> *cbinfo = unwrap(data);
+  cbinfo->persistent_.Reset();
+  cbinfo->callback_(*cbinfo);
+  delete cbinfo;
+}
+
+template<typename T>
+template<typename S>
+WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrap(
+    NAN_WEAK_CALLBACK_DATA_TYPE_ data) {
+  void *parameter = data.GetParameter();
+  WeakCallbackInfo<T> *cbinfo =
+      static_cast<WeakCallbackInfo<T>*>(parameter);
+  cbinfo->isolate_ = data.GetIsolate();
+  return cbinfo;
+}
+
+#undef NAN_WEAK_CALLBACK_SIG_
+#undef NAN_WEAK_CALLBACK_DATA_TYPE_
+#else
+
+template<typename T>
+void WeakCallbackInfo<T>::invoke(NAN_WEAK_CALLBACK_SIG_ data) {
+  WeakCallbackInfo<T> *cbinfo = unwrap(data);
+  cbinfo->persistent_.Dispose();
+  cbinfo->persistent_.Clear();
+  cbinfo->callback_(*cbinfo);
+  delete cbinfo;
+}
+
+template<typename T>
+WeakCallbackInfo<T> *WeakCallbackInfo<T>::unwrap(
+    NAN_WEAK_CALLBACK_DATA_TYPE_ data) {
+  WeakCallbackInfo<T> *cbinfo =
+      static_cast<WeakCallbackInfo<T>*>(data);
+  cbinfo->isolate_ = v8::Isolate::GetCurrent();
+  return cbinfo;
+}
+
+#undef NAN_WEAK_CALLBACK_SIG_
+#undef NAN_WEAK_CALLBACK_DATA_TYPE_
+#endif
+
+#if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 ||                      \
+  (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && V8_MINOR_VERSION >= 3))
+template<typename T, typename M>
+template<typename P>
+inline void Persistent<T, M>::SetWeak(
+    P *parameter
+  , typename WeakCallbackInfo<P>::Callback callback
+  , WeakCallbackType type) {
+  WeakCallbackInfo<P> *wcbd;
+  if (type == WeakCallbackType::kParameter) {
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , parameter);
+    v8::PersistentBase<T>::SetWeak(
+        wcbd
+      , WeakCallbackInfo<P>::template invokeparameter<true>
+      , type);
+  } else {
+    v8::Local<v8::Value>* self_v(reinterpret_cast<v8::Local<v8::Value>*>(this));
+    assert((*self_v)->IsObject());
+    v8::Local<v8::Object> self((*self_v).As<v8::Object>());
+    int count = self->InternalFieldCount();
+    void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
+    for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
+      internal_fields[i] = self->GetAlignedPointerFromInternalField(i);
+    }
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , 0
+      , internal_fields[0]
+      , internal_fields[1]);
+    self->SetAlignedPointerInInternalField(0, wcbd);
+    v8::PersistentBase<T>::SetWeak(
+        static_cast<WeakCallbackInfo<P>*>(0)
+      , WeakCallbackInfo<P>::template invoketwofield<true>
+      , type);
+  }
+}
+#elif NODE_MODULE_VERSION > IOJS_1_1_MODULE_VERSION
+template<typename T, typename M>
+template<typename P>
+inline void Persistent<T, M>::SetWeak(
+    P *parameter
+  , typename WeakCallbackInfo<P>::Callback callback
+  , WeakCallbackType type) {
+  WeakCallbackInfo<P> *wcbd;
+  if (type == WeakCallbackType::kParameter) {
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , parameter);
+    v8::PersistentBase<T>::SetPhantom(
+        wcbd
+      , WeakCallbackInfo<P>::invokeparameter);
+  } else {
+    v8::Local<v8::Value>* self_v(reinterpret_cast<v8::Local<v8::Value>*>(this));
+    assert((*self_v)->IsObject());
+    v8::Local<v8::Object> self((*self_v).As<v8::Object>());
+    int count = self->InternalFieldCount();
+    void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
+    for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
+      internal_fields[i] = self->GetAlignedPointerFromInternalField(i);
+    }
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , 0
+      , internal_fields[0]
+      , internal_fields[1]);
+    self->SetAlignedPointerInInternalField(0, wcbd);
+    v8::PersistentBase<T>::SetPhantom(
+        static_cast<WeakCallbackInfo<P>*>(0)
+      , WeakCallbackInfo<P>::invoketwofield
+      , 0
+      , count > 1 ? 1 : kNoInternalFieldIndex);
+  }
+}
+#elif NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
+template<typename T, typename M>
+template<typename P>
+inline void Persistent<T, M>::SetWeak(
+    P *parameter
+  , typename WeakCallbackInfo<P>::Callback callback
+  , WeakCallbackType type) {
+  WeakCallbackInfo<P> *wcbd;
+  if (type == WeakCallbackType::kParameter) {
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , parameter);
+    v8::PersistentBase<T>::SetPhantom(
+        wcbd
+      , WeakCallbackInfo<P>::invokeparameter);
+  } else {
+    v8::Local<v8::Value>* self_v(reinterpret_cast<v8::Local<v8::Value>*>(this));
+    assert((*self_v)->IsObject());
+    v8::Local<v8::Object> self((*self_v).As<v8::Object>());
+    int count = self->InternalFieldCount();
+    void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
+    for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
+      internal_fields[i] = self->GetAlignedPointerFromInternalField(i);
+    }
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , 0
+      , internal_fields[0]
+      , internal_fields[1]);
+    self->SetAlignedPointerInInternalField(0, wcbd);
+    v8::PersistentBase<T>::SetPhantom(
+        WeakCallbackInfo<P>::invoketwofield
+      , 0
+      , count > 1 ? 1 : kNoInternalFieldIndex);
+  }
+}
+#elif NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
+template<typename T, typename M>
+template<typename P>
+inline void Persistent<T, M>::SetWeak(
+    P *parameter
+  , typename WeakCallbackInfo<P>::Callback callback
+  , WeakCallbackType type) {
+  WeakCallbackInfo<P> *wcbd;
+  if (type == WeakCallbackType::kParameter) {
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , parameter);
+    v8::PersistentBase<T>::SetWeak(wcbd, WeakCallbackInfo<P>::invoke);
+  } else {
+    v8::Local<v8::Value>* self_v(reinterpret_cast<v8::Local<v8::Value>*>(this));
+    assert((*self_v)->IsObject());
+    v8::Local<v8::Object> self((*self_v).As<v8::Object>());
+    int count = self->InternalFieldCount();
+    void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
+    for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
+      internal_fields[i] = self->GetAlignedPointerFromInternalField(i);
+    }
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , 0
+      , internal_fields[0]
+      , internal_fields[1]);
+    v8::PersistentBase<T>::SetWeak(wcbd, WeakCallbackInfo<P>::invoke);
+  }
+}
+#else
+template<typename T>
+template<typename P>
+inline void PersistentBase<T>::SetWeak(
+    P *parameter
+  , typename WeakCallbackInfo<P>::Callback callback
+  , WeakCallbackType type) {
+  WeakCallbackInfo<P> *wcbd;
+  if (type == WeakCallbackType::kParameter) {
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , parameter);
+    persistent.MakeWeak(wcbd, WeakCallbackInfo<P>::invoke);
+  } else {
+    v8::Local<v8::Value>* self_v(reinterpret_cast<v8::Local<v8::Value>*>(this));
+    assert((*self_v)->IsObject());
+    v8::Local<v8::Object> self((*self_v).As<v8::Object>());
+    int count = self->InternalFieldCount();
+    void *internal_fields[kInternalFieldsInWeakCallback] = {0, 0};
+    for (int i = 0; i < count && i < kInternalFieldsInWeakCallback; i++) {
+      internal_fields[i] = self->GetPointerFromInternalField(i);
+    }
+    wcbd = new WeakCallbackInfo<P>(
+        reinterpret_cast<Persistent<v8::Value>*>(this)
+      , callback
+      , 0
+      , internal_fields[0]
+      , internal_fields[1]);
+    persistent.MakeWeak(wcbd, WeakCallbackInfo<P>::invoke);
+  }
+}
+#endif
+
+#endif  // NAN_WEAK_H_
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/package.json b/legacy-libs/grpc-cloned/node_modules/nan/package.json
new file mode 100644 (file)
index 0000000..b2939e5
--- /dev/null
@@ -0,0 +1,143 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "nan@^2.13.2",
+        "scope": null,
+        "escapedName": "nan",
+        "name": "nan",
+        "rawSpec": "^2.13.2",
+        "spec": ">=2.13.2 <3.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/grpc"
+    ]
+  ],
+  "_from": "nan@>=2.13.2 <3.0.0",
+  "_hasShrinkwrap": false,
+  "_id": "nan@2.14.2",
+  "_inCache": true,
+  "_location": "/grpc/nan",
+  "_nodeVersion": "9.6.0",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/nan_2.14.2_1602593394727_0.8742800087816833"
+  },
+  "_npmUser": {
+    "name": "kkoopa",
+    "email": "bbyholm@abo.fi"
+  },
+  "_npmVersion": "5.6.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "nan@^2.13.2",
+    "scope": null,
+    "escapedName": "nan",
+    "name": "nan",
+    "rawSpec": "^2.13.2",
+    "spec": ">=2.13.2 <3.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/grpc"
+  ],
+  "_resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz",
+  "_shasum": "f5376400695168f4cc694ac9393d0c9585eeea19",
+  "_shrinkwrap": null,
+  "_spec": "nan@^2.13.2",
+  "_where": "/var/opt/motion2/node_modules/grpc",
+  "bugs": {
+    "url": "https://github.com/nodejs/nan/issues"
+  },
+  "contributors": [
+    {
+      "name": "Rod Vagg",
+      "email": "r@va.gg",
+      "url": "https://github.com/rvagg"
+    },
+    {
+      "name": "Benjamin Byholm",
+      "email": "bbyholm@abo.fi",
+      "url": "https://github.com/kkoopa/"
+    },
+    {
+      "name": "Trevor Norris",
+      "email": "trev.norris@gmail.com",
+      "url": "https://github.com/trevnorris"
+    },
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "https://github.com/TooTallNate"
+    },
+    {
+      "name": "Brett Lawson",
+      "email": "brett19@gmail.com",
+      "url": "https://github.com/brett19"
+    },
+    {
+      "name": "Ben Noordhuis",
+      "email": "info@bnoordhuis.nl",
+      "url": "https://github.com/bnoordhuis"
+    },
+    {
+      "name": "David Siegel",
+      "email": "david@artcom.de",
+      "url": "https://github.com/agnat"
+    },
+    {
+      "name": "Michael Ira Krufky",
+      "email": "mkrufky@gmail.com",
+      "url": "https://github.com/mkrufky"
+    }
+  ],
+  "dependencies": {},
+  "description": "Native Abstractions for Node.js: C++ header for Node 0.8 -> 14 compatibility",
+  "devDependencies": {
+    "bindings": "~1.2.1",
+    "commander": "^2.8.1",
+    "glob": "^5.0.14",
+    "node-gyp": "~3.6.2",
+    "readable-stream": "^2.1.4",
+    "request": "=2.81.0",
+    "tap": "~0.7.1",
+    "xtend": "~4.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==",
+    "shasum": "f5376400695168f4cc694ac9393d0c9585eeea19",
+    "tarball": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz",
+    "fileCount": 46,
+    "unpackedSize": 417991,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhaJzCRA9TVsSAnZWagAAqa0P/33rKLxI1mx53dz2Z6/B\nQQAJOUcgZgpIdY7LkaDGw6oTRyYoDg9uq1aOW7uL6OTJGZb/0UH3LS/gs5CK\nUk1CnYitqHSmyzOCO6tZyQmiFqYqLJf5drQn+uV9sU3bi2+u42Z03vTv5v+j\nEwRLH3TfeMbrEOgDdBuo6RB+jgaZHKyEXsvCe6NXXAaAQ8as82vtDOA1FOzq\nhB91RTYgS57lF3g/ciWg/Bvb7o2Fwep7+Ah/22Cpz9UC8fm8QGz4/lQRba3m\n504ah7HXRoF79+HqvntRKF0j8fJ8fpX3cu7wQ5UND8bj/VhhNpKZtM/tCv98\nq00KMaWYNqD+NJYKULLS658iJVjpPNr9UElb3+jNDCoX+UEvdOckuJKwo5u0\n7HRmqpE6Pb0MGfVqhHK6K3buwg+eccMcCKPiHHaiZvqa/jD0savGNx2ylMVD\niTpyl8XV+ZU9vfR1tJ3OFYzOGfXOGG5LqOut/hT0qjBLTWXL3ajPcxCNdJRH\nWSrDJ7Y3da/KkyMdX37t39Q6JkQbD2hz2nGNIr1pe36CNqx8FMOvnHG2Gwuy\nGFdcABFLpkppKhHmRebaRlQXJ416KHzxUkD+A/5DcUb7ChoJgn4j6TN7ewVb\nNOb7UllppKKHOseXgre8uJM1vVslNLVsBYzfgv58uhSTbMvo5QBuK/QHKilw\nRoBa\r\n=4oJR\r\n-----END PGP SIGNATURE-----\r\n"
+  },
+  "gitHead": "7c3fc6884666bd19b597ea58a99f51f2f4860c4e",
+  "homepage": "https://github.com/nodejs/nan#readme",
+  "license": "MIT",
+  "main": "include_dirs.js",
+  "maintainers": [
+    {
+      "name": "kkoopa",
+      "email": "bbyholm@abo.fi"
+    },
+    {
+      "name": "rvagg",
+      "email": "r@va.gg"
+    }
+  ],
+  "name": "nan",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nodejs/nan.git"
+  },
+  "scripts": {
+    "docs": "doc/.build.sh",
+    "rebuild-tests": "node-gyp rebuild --msvs_version=2015 --directory test",
+    "test": "tap --gc --stderr test/js/*-test.js",
+    "test:worker": "node --experimental-worker test/tap-as-worker.js --gc --stderr test/js/*-test.js"
+  },
+  "version": "2.14.2"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/tools/1to2.js b/legacy-libs/grpc-cloned/node_modules/nan/tools/1to2.js
new file mode 100644 (file)
index 0000000..6af2505
--- /dev/null
@@ -0,0 +1,412 @@
+#!/usr/bin/env node
+/*********************************************************************
+ * NAN - Native Abstractions for Node.js
+ *
+ * Copyright (c) 2018 NAN contributors
+ *
+ * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
+ ********************************************************************/
+
+var commander = require('commander'),
+    fs = require('fs'),
+    glob = require('glob'),
+    groups = [],
+    total = 0,
+    warning1 = '/* ERROR: Rewrite using Buffer */\n',
+    warning2 = '\\/\\* ERROR\\: Rewrite using Buffer \\*\\/\\n',
+    length,
+    i;
+
+fs.readFile(__dirname + '/package.json', 'utf8', function (err, data) {
+  if (err) {
+    throw err;
+  }
+
+  commander
+      .version(JSON.parse(data).version)
+      .usage('[options] <file ...>')
+      .parse(process.argv);
+
+  if (!process.argv.slice(2).length) {
+    commander.outputHelp();
+  }
+});
+
+/* construct strings representing regular expressions
+   each expression contains a unique group allowing for identification of the match
+   the index of this key group, relative to the regular expression in question,
+    is indicated by the first array member */
+
+/* simple substistutions, key group is the entire match, 0 */
+groups.push([0, [
+  '_NAN_',
+  'NODE_SET_METHOD',
+  'NODE_SET_PROTOTYPE_METHOD',
+  'NanAsciiString',
+  'NanEscapeScope',
+  'NanReturnValue',
+  'NanUcs2String'].join('|')]);
+
+/* substitutions of parameterless macros, key group is 1 */
+groups.push([1, ['(', [
+  'NanEscapableScope',
+  'NanReturnNull',
+  'NanReturnUndefined',
+  'NanScope'].join('|'), ')\\(\\)'].join('')]);
+
+/* replace TryCatch with NanTryCatch once, gobbling possible namespace, key group 2 */
+groups.push([2, '(?:(?:v8\\:\\:)?|(Nan)?)(TryCatch)']);
+
+/* NanNew("string") will likely not fail a ToLocalChecked(), key group 1 */ 
+groups.push([1, ['(NanNew)', '(\\("[^\\"]*"[^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]);
+
+/* Removed v8 APIs, warn that the code needs rewriting using node::Buffer, key group 2 */
+groups.push([2, ['(', warning2, ')?', '^.*?(', [
+      'GetIndexedPropertiesExternalArrayDataLength',
+      'GetIndexedPropertiesExternalArrayData',
+      'GetIndexedPropertiesExternalArrayDataType',
+      'GetIndexedPropertiesPixelData',
+      'GetIndexedPropertiesPixelDataLength',
+      'HasIndexedPropertiesInExternalArrayData',
+      'HasIndexedPropertiesInPixelData',
+      'SetIndexedPropertiesToExternalArrayData',
+      'SetIndexedPropertiesToPixelData'].join('|'), ')'].join('')]);
+
+/* No need for NanScope in V8-exposed methods, key group 2 */
+groups.push([2, ['((', [
+      'NAN_METHOD',
+      'NAN_GETTER',
+      'NAN_SETTER',
+      'NAN_PROPERTY_GETTER',
+      'NAN_PROPERTY_SETTER',
+      'NAN_PROPERTY_ENUMERATOR',
+      'NAN_PROPERTY_DELETER',
+      'NAN_PROPERTY_QUERY',
+      'NAN_INDEX_GETTER',
+      'NAN_INDEX_SETTER',
+      'NAN_INDEX_ENUMERATOR',
+      'NAN_INDEX_DELETER',
+      'NAN_INDEX_QUERY'].join('|'), ')\\([^\\)]*\\)\\s*\\{)\\s*NanScope\\(\\)\\s*;'].join('')]);
+
+/* v8::Value::ToXXXXXXX returns v8::MaybeLocal<T>, key group 3 */
+groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->(', [
+      'Boolean',
+      'Number',
+      'String',
+      'Object',
+      'Integer',
+      'Uint32',
+      'Int32'].join('|'), ')\\('].join('')]);
+
+/* v8::Value::XXXXXXXValue returns v8::Maybe<T>, key group 3 */
+groups.push([3, ['([\\s\\(\\)])([^\\s\\(\\)]+)->((?:', [
+      'Boolean',
+      'Number',
+      'Integer',
+      'Uint32',
+      'Int32'].join('|'), ')Value)\\('].join('')]);
+
+/* NAN_WEAK_CALLBACK macro was removed, write out callback definition, key group 1 */
+groups.push([1, '(NAN_WEAK_CALLBACK)\\(([^\\s\\)]+)\\)']);
+
+/* node::ObjectWrap and v8::Persistent have been replaced with Nan implementations, key group 1 */
+groups.push([1, ['(', [
+  'NanDisposePersistent',
+  'NanObjectWrapHandle'].join('|'), ')\\s*\\(\\s*([^\\s\\)]+)'].join('')]);
+
+/* Since NanPersistent there is no need for NanMakeWeakPersistent, key group 1 */
+groups.push([1, '(NanMakeWeakPersistent)\\s*\\(\\s*([^\\s,]+)\\s*,\\s*']);
+
+/* Many methods of v8::Object and others now return v8::MaybeLocal<T>, key group 3 */
+groups.push([3, ['([\\s])([^\\s]+)->(', [
+  'GetEndColumn',
+  'GetFunction',
+  'GetLineNumber',
+  'NewInstance',
+  'GetPropertyNames',
+  'GetOwnPropertyNames',
+  'GetSourceLine',
+  'GetStartColumn',
+  'ObjectProtoToString',
+  'ToArrayIndex',
+  'ToDetailString',
+  'CallAsConstructor',
+  'CallAsFunction',
+  'CloneElementAt',
+  'Delete',
+  'ForceSet',
+  'Get',
+  'GetPropertyAttributes',
+  'GetRealNamedProperty',
+  'GetRealNamedPropertyInPrototypeChain',
+  'Has',
+  'HasOwnProperty',
+  'HasRealIndexedProperty',
+  'HasRealNamedCallbackProperty',
+  'HasRealNamedProperty',
+  'Set',
+  'SetAccessor',
+  'SetIndexedPropertyHandler',
+  'SetNamedPropertyHandler',
+  'SetPrototype'].join('|'), ')\\('].join('')]);
+
+/* You should get an error if any of these fail anyways,
+   or handle the error better, it is indicated either way, key group 2 */
+groups.push([2, ['NanNew(<(?:v8\\:\\:)?(', ['Date', 'String', 'RegExp'].join('|'), ')>)(\\([^\\)]*\\))(?!\\.ToLocalChecked\\(\\))'].join('')]);
+
+/* v8::Value::Equals now returns a v8::Maybe, key group 3 */
+groups.push([3, '([\\s\\(\\)])([^\\s\\(\\)]+)->(Equals)\\(([^\\s\\)]+)']);
+
+/* NanPersistent makes this unnecessary, key group 1 */
+groups.push([1, '(NanAssignPersistent)(?:<v8\\:\\:[^>]+>)?\\(([^,]+),\\s*']);
+
+/* args has been renamed to info, key group 2 */
+groups.push([2, '(\\W)(args)(\\W)'])
+
+/* node::ObjectWrap was replaced with NanObjectWrap, key group 2 */
+groups.push([2, '(\\W)(?:node\\:\\:)?(ObjectWrap)(\\W)']);
+
+/* v8::Persistent was replaced with NanPersistent, key group 2 */
+groups.push([2, '(\\W)(?:v8\\:\\:)?(Persistent)(\\W)']);
+
+/* counts the number of capturing groups in a well-formed regular expression,
+   ignoring non-capturing groups and escaped parentheses */
+function groupcount(s) {
+  var positive = s.match(/\((?!\?)/g),
+      negative = s.match(/\\\(/g);
+  return (positive ? positive.length : 0) - (negative ? negative.length : 0);
+}
+
+/* compute the absolute position of each key group in the joined master RegExp */
+for (i = 1, length = groups.length; i < length; i++) {
+       total += groupcount(groups[i - 1][1]);
+       groups[i][0] += total;
+}
+
+/* create the master RegExp, whis is the union of all the groups' expressions */
+master = new RegExp(groups.map(function (a) { return a[1]; }).join('|'), 'gm');
+
+/* replacement function for String.replace, receives 21 arguments */
+function replace() {
+       /* simple expressions */
+      switch (arguments[groups[0][0]]) {
+        case '_NAN_':
+          return 'NAN_';
+        case 'NODE_SET_METHOD':
+          return 'NanSetMethod';
+        case 'NODE_SET_PROTOTYPE_METHOD':
+          return 'NanSetPrototypeMethod';
+        case 'NanAsciiString':
+          return 'NanUtf8String';
+        case 'NanEscapeScope':
+          return 'scope.Escape';
+        case 'NanReturnNull':
+          return 'info.GetReturnValue().SetNull';
+        case 'NanReturnValue':
+          return 'info.GetReturnValue().Set';
+        case 'NanUcs2String':
+          return 'v8::String::Value';
+        default:
+      }
+
+      /* macros without arguments */
+      switch (arguments[groups[1][0]]) {
+        case 'NanEscapableScope':
+          return 'NanEscapableScope scope'
+        case 'NanReturnUndefined':
+          return 'return';
+        case 'NanScope':
+          return 'NanScope scope';
+        default:
+      }
+
+      /* TryCatch, emulate negative backref */
+      if (arguments[groups[2][0]] === 'TryCatch') {
+        return arguments[groups[2][0] - 1] ? arguments[0] : 'NanTryCatch';
+      }
+
+      /* NanNew("foo") --> NanNew("foo").ToLocalChecked() */
+      if (arguments[groups[3][0]] === 'NanNew') {
+        return [arguments[0], '.ToLocalChecked()'].join('');
+      }
+
+      /* insert warning for removed functions as comment on new line above */
+      switch (arguments[groups[4][0]]) {
+        case 'GetIndexedPropertiesExternalArrayData':
+        case 'GetIndexedPropertiesExternalArrayDataLength':
+        case 'GetIndexedPropertiesExternalArrayDataType':
+        case 'GetIndexedPropertiesPixelData':
+        case 'GetIndexedPropertiesPixelDataLength':
+        case 'HasIndexedPropertiesInExternalArrayData':
+        case 'HasIndexedPropertiesInPixelData':
+        case 'SetIndexedPropertiesToExternalArrayData':
+        case 'SetIndexedPropertiesToPixelData':
+          return arguments[groups[4][0] - 1] ? arguments[0] : [warning1, arguments[0]].join('');
+        default:
+      }
+
+     /* remove unnecessary NanScope() */
+      switch (arguments[groups[5][0]]) {
+        case 'NAN_GETTER':
+        case 'NAN_METHOD':
+        case 'NAN_SETTER':
+        case 'NAN_INDEX_DELETER':
+        case 'NAN_INDEX_ENUMERATOR':
+        case 'NAN_INDEX_GETTER':
+        case 'NAN_INDEX_QUERY':
+        case 'NAN_INDEX_SETTER':
+        case 'NAN_PROPERTY_DELETER':
+        case 'NAN_PROPERTY_ENUMERATOR':
+        case 'NAN_PROPERTY_GETTER':
+        case 'NAN_PROPERTY_QUERY':
+        case 'NAN_PROPERTY_SETTER':
+          return arguments[groups[5][0] - 1];
+        default:
+      }
+
+      /* Value conversion */
+      switch (arguments[groups[6][0]]) {
+        case 'Boolean':
+        case 'Int32':
+        case 'Integer':
+        case 'Number':
+        case 'Object':
+        case 'String':
+        case 'Uint32':
+          return [arguments[groups[6][0] - 2], 'NanTo<v8::', arguments[groups[6][0]], '>(',  arguments[groups[6][0] - 1]].join('');
+        default:
+      }
+
+      /* other value conversion */
+      switch (arguments[groups[7][0]]) {
+        case 'BooleanValue':
+          return [arguments[groups[7][0] - 2], 'NanTo<bool>(', arguments[groups[7][0] - 1]].join('');
+        case 'Int32Value':
+          return [arguments[groups[7][0] - 2], 'NanTo<int32_t>(', arguments[groups[7][0] - 1]].join('');
+        case 'IntegerValue':
+          return [arguments[groups[7][0] - 2], 'NanTo<int64_t>(', arguments[groups[7][0] - 1]].join('');
+        case 'Uint32Value':
+          return [arguments[groups[7][0] - 2], 'NanTo<uint32_t>(', arguments[groups[7][0] - 1]].join('');
+        default:
+      }
+
+      /* NAN_WEAK_CALLBACK */
+      if (arguments[groups[8][0]] === 'NAN_WEAK_CALLBACK') {
+        return ['template<typename T>\nvoid ',
+          arguments[groups[8][0] + 1], '(const NanWeakCallbackInfo<T> &data)'].join('');
+      }
+
+      /* use methods on NAN classes instead */
+      switch (arguments[groups[9][0]]) {
+        case 'NanDisposePersistent':
+          return [arguments[groups[9][0] + 1], '.Reset('].join('');
+        case 'NanObjectWrapHandle':
+          return [arguments[groups[9][0] + 1], '->handle('].join('');
+        default:
+      }
+
+      /* use method on NanPersistent instead */
+      if (arguments[groups[10][0]] === 'NanMakeWeakPersistent') {
+        return arguments[groups[10][0] + 1] + '.SetWeak(';
+      }
+
+      /* These return Maybes, the upper ones take no arguments */
+      switch (arguments[groups[11][0]]) {
+        case 'GetEndColumn':
+        case 'GetFunction':
+        case 'GetLineNumber':
+        case 'GetOwnPropertyNames':
+        case 'GetPropertyNames':
+        case 'GetSourceLine':
+        case 'GetStartColumn':
+        case 'NewInstance':
+        case 'ObjectProtoToString':
+        case 'ToArrayIndex':
+        case 'ToDetailString':
+          return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1]].join('');
+        case 'CallAsConstructor':
+        case 'CallAsFunction':
+        case 'CloneElementAt':
+        case 'Delete':
+        case 'ForceSet':
+        case 'Get':
+        case 'GetPropertyAttributes':
+        case 'GetRealNamedProperty':
+        case 'GetRealNamedPropertyInPrototypeChain':
+        case 'Has':
+        case 'HasOwnProperty':
+        case 'HasRealIndexedProperty':
+        case 'HasRealNamedCallbackProperty':
+        case 'HasRealNamedProperty':
+        case 'Set':
+        case 'SetAccessor':
+        case 'SetIndexedPropertyHandler':
+        case 'SetNamedPropertyHandler':
+        case 'SetPrototype':
+          return [arguments[groups[11][0] - 2], 'Nan', arguments[groups[11][0]], '(', arguments[groups[11][0] - 1], ', '].join('');
+        default:
+      }
+
+      /* Automatic ToLocalChecked(), take it or leave it */
+      switch (arguments[groups[12][0]]) {
+        case 'Date':
+        case 'String':
+        case 'RegExp':
+          return ['NanNew', arguments[groups[12][0] - 1], arguments[groups[12][0] + 1], '.ToLocalChecked()'].join('');
+        default:
+      }
+
+      /* NanEquals is now required for uniformity */
+      if (arguments[groups[13][0]] === 'Equals') {
+        return [arguments[groups[13][0] - 1], 'NanEquals(', arguments[groups[13][0] - 1], ', ', arguments[groups[13][0] + 1]].join('');
+      }
+
+      /* use method on replacement class instead */
+      if (arguments[groups[14][0]] === 'NanAssignPersistent') {
+        return [arguments[groups[14][0] + 1], '.Reset('].join('');
+      }
+
+      /* args --> info */
+      if (arguments[groups[15][0]] === 'args') {
+        return [arguments[groups[15][0] - 1], 'info', arguments[groups[15][0] + 1]].join('');
+      }
+
+      /* ObjectWrap --> NanObjectWrap */
+      if (arguments[groups[16][0]] === 'ObjectWrap') {
+        return [arguments[groups[16][0] - 1], 'NanObjectWrap', arguments[groups[16][0] + 1]].join('');
+      }
+
+      /* Persistent --> NanPersistent */
+      if (arguments[groups[17][0]] === 'Persistent') {
+        return [arguments[groups[17][0] - 1], 'NanPersistent', arguments[groups[17][0] + 1]].join('');
+      }
+
+      /* This should not happen. A switch is probably missing a case if it does. */
+      throw 'Unhandled match: ' + arguments[0];
+}
+
+/* reads a file, runs replacement and writes it back */
+function processFile(file) {
+  fs.readFile(file, {encoding: 'utf8'}, function (err, data) {
+    if (err) {
+      throw err;
+    }
+
+    /* run replacement twice, might need more runs */
+    fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) {
+      if (err) {
+        throw err;
+      }
+    });
+  });
+}
+
+/* process file names from command line and process the identified files */
+for (i = 2, length = process.argv.length; i < length; i++) {
+  glob(process.argv[i], function (err, matches) {
+    if (err) {
+      throw err;
+    }
+    matches.forEach(processFile);
+  });
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/tools/README.md b/legacy-libs/grpc-cloned/node_modules/nan/tools/README.md
new file mode 100644 (file)
index 0000000..7f07e4b
--- /dev/null
@@ -0,0 +1,14 @@
+1to2 naively converts source code files from NAN 1 to NAN 2. There will be erroneous conversions,
+false positives and missed opportunities. The input files are rewritten in place. Make sure that
+you have backups. You will have to manually review the changes afterwards and do some touchups.
+
+```sh
+$ tools/1to2.js
+
+  Usage: 1to2 [options] <file ...>
+
+  Options:
+
+    -h, --help     output usage information
+    -V, --version  output the version number
+```
diff --git a/legacy-libs/grpc-cloned/node_modules/nan/tools/package.json b/legacy-libs/grpc-cloned/node_modules/nan/tools/package.json
new file mode 100644 (file)
index 0000000..2dcdd78
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name": "1to2",
+  "version": "1.0.0",
+  "description": "NAN 1 -> 2 Migration Script",
+  "main": "1to2.js",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nodejs/nan.git"
+  },
+  "contributors": [
+    "Benjamin Byholm <bbyholm@abo.fi> (https://github.com/kkoopa/)",
+    "Mathias Küsel (https://github.com/mathiask88/)"
+  ],
+  "dependencies": {
+    "glob": "~5.0.10",
+    "commander": "~2.8.1"
+  },
+  "license": "MIT"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/LICENSE b/legacy-libs/grpc-cloned/node_modules/protobufjs/LICENSE
new file mode 100644 (file)
index 0000000..75b5248
--- /dev/null
@@ -0,0 +1,202 @@
+\r
+                                 Apache License\r
+                           Version 2.0, January 2004\r
+                        http://www.apache.org/licenses/\r
+\r
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+   1. Definitions.\r
+\r
+      "License" shall mean the terms and conditions for use, reproduction,\r
+      and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+      "Licensor" shall mean the copyright owner or entity authorized by\r
+      the copyright owner that is granting the License.\r
+\r
+      "Legal Entity" shall mean the union of the acting entity and all\r
+      other entities that control, are controlled by, or are under common\r
+      control with that entity. For the purposes of this definition,\r
+      "control" means (i) the power, direct or indirect, to cause the\r
+      direction or management of such entity, whether by contract or\r
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+      outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+      "You" (or "Your") shall mean an individual or Legal Entity\r
+      exercising permissions granted by this License.\r
+\r
+      "Source" form shall mean the preferred form for making modifications,\r
+      including but not limited to software source code, documentation\r
+      source, and configuration files.\r
+\r
+      "Object" form shall mean any form resulting from mechanical\r
+      transformation or translation of a Source form, including but\r
+      not limited to compiled object code, generated documentation,\r
+      and conversions to other media types.\r
+\r
+      "Work" shall mean the work of authorship, whether in Source or\r
+      Object form, made available under the License, as indicated by a\r
+      copyright notice that is included in or attached to the work\r
+      (an example is provided in the Appendix below).\r
+\r
+      "Derivative Works" shall mean any work, whether in Source or Object\r
+      form, that is based on (or derived from) the Work and for which the\r
+      editorial revisions, annotations, elaborations, or other modifications\r
+      represent, as a whole, an original work of authorship. For the purposes\r
+      of this License, Derivative Works shall not include works that remain\r
+      separable from, or merely link (or bind by name) to the interfaces of,\r
+      the Work and Derivative Works thereof.\r
+\r
+      "Contribution" shall mean any work of authorship, including\r
+      the original version of the Work and any modifications or additions\r
+      to that Work or Derivative Works thereof, that is intentionally\r
+      submitted to Licensor for inclusion in the Work by the copyright owner\r
+      or by an individual or Legal Entity authorized to submit on behalf of\r
+      the copyright owner. For the purposes of this definition, "submitted"\r
+      means any form of electronic, verbal, or written communication sent\r
+      to the Licensor or its representatives, including but not limited to\r
+      communication on electronic mailing lists, source code control systems,\r
+      and issue tracking systems that are managed by, or on behalf of, the\r
+      Licensor for the purpose of discussing and improving the Work, but\r
+      excluding communication that is conspicuously marked or otherwise\r
+      designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+      "Contributor" shall mean Licensor and any individual or Legal Entity\r
+      on behalf of whom a Contribution has been received by Licensor and\r
+      subsequently incorporated within the Work.\r
+\r
+   2. Grant of Copyright License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      copyright license to reproduce, prepare Derivative Works of,\r
+      publicly display, publicly perform, sublicense, and distribute the\r
+      Work and such Derivative Works in Source or Object form.\r
+\r
+   3. Grant of Patent License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      (except as stated in this section) patent license to make, have made,\r
+      use, offer to sell, sell, import, and otherwise transfer the Work,\r
+      where such license applies only to those patent claims licensable\r
+      by such Contributor that are necessarily infringed by their\r
+      Contribution(s) alone or by combination of their Contribution(s)\r
+      with the Work to which such Contribution(s) was submitted. If You\r
+      institute patent litigation against any entity (including a\r
+      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+      or a Contribution incorporated within the Work constitutes direct\r
+      or contributory patent infringement, then any patent licenses\r
+      granted to You under this License for that Work shall terminate\r
+      as of the date such litigation is filed.\r
+\r
+   4. Redistribution. You may reproduce and distribute copies of the\r
+      Work or Derivative Works thereof in any medium, with or without\r
+      modifications, and in Source or Object form, provided that You\r
+      meet the following conditions:\r
+\r
+      (a) You must give any other recipients of the Work or\r
+          Derivative Works a copy of this License; and\r
+\r
+      (b) You must cause any modified files to carry prominent notices\r
+          stating that You changed the files; and\r
+\r
+      (c) You must retain, in the Source form of any Derivative Works\r
+          that You distribute, all copyright, patent, trademark, and\r
+          attribution notices from the Source form of the Work,\r
+          excluding those notices that do not pertain to any part of\r
+          the Derivative Works; and\r
+\r
+      (d) If the Work includes a "NOTICE" text file as part of its\r
+          distribution, then any Derivative Works that You distribute must\r
+          include a readable copy of the attribution notices contained\r
+          within such NOTICE file, excluding those notices that do not\r
+          pertain to any part of the Derivative Works, in at least one\r
+          of the following places: within a NOTICE text file distributed\r
+          as part of the Derivative Works; within the Source form or\r
+          documentation, if provided along with the Derivative Works; or,\r
+          within a display generated by the Derivative Works, if and\r
+          wherever such third-party notices normally appear. The contents\r
+          of the NOTICE file are for informational purposes only and\r
+          do not modify the License. You may add Your own attribution\r
+          notices within Derivative Works that You distribute, alongside\r
+          or as an addendum to the NOTICE text from the Work, provided\r
+          that such additional attribution notices cannot be construed\r
+          as modifying the License.\r
+\r
+      You may add Your own copyright statement to Your modifications and\r
+      may provide additional or different license terms and conditions\r
+      for use, reproduction, or distribution of Your modifications, or\r
+      for any such Derivative Works as a whole, provided Your use,\r
+      reproduction, and distribution of the Work otherwise complies with\r
+      the conditions stated in this License.\r
+\r
+   5. Submission of Contributions. Unless You explicitly state otherwise,\r
+      any Contribution intentionally submitted for inclusion in the Work\r
+      by You to the Licensor shall be under the terms and conditions of\r
+      this License, without any additional terms or conditions.\r
+      Notwithstanding the above, nothing herein shall supersede or modify\r
+      the terms of any separate license agreement you may have executed\r
+      with Licensor regarding such Contributions.\r
+\r
+   6. Trademarks. This License does not grant permission to use the trade\r
+      names, trademarks, service marks, or product names of the Licensor,\r
+      except as required for reasonable and customary use in describing the\r
+      origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+   7. Disclaimer of Warranty. Unless required by applicable law or\r
+      agreed to in writing, Licensor provides the Work (and each\r
+      Contributor provides its Contributions) on an "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+      implied, including, without limitation, any warranties or conditions\r
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+      PARTICULAR PURPOSE. You are solely responsible for determining the\r
+      appropriateness of using or redistributing the Work and assume any\r
+      risks associated with Your exercise of permissions under this License.\r
+\r
+   8. Limitation of Liability. In no event and under no legal theory,\r
+      whether in tort (including negligence), contract, or otherwise,\r
+      unless required by applicable law (such as deliberate and grossly\r
+      negligent acts) or agreed to in writing, shall any Contributor be\r
+      liable to You for damages, including any direct, indirect, special,\r
+      incidental, or consequential damages of any character arising as a\r
+      result of this License or out of the use or inability to use the\r
+      Work (including but not limited to damages for loss of goodwill,\r
+      work stoppage, computer failure or malfunction, or any and all\r
+      other commercial damages or losses), even if such Contributor\r
+      has been advised of the possibility of such damages.\r
+\r
+   9. Accepting Warranty or Additional Liability. While redistributing\r
+      the Work or Derivative Works thereof, You may choose to offer,\r
+      and charge a fee for, acceptance of support, warranty, indemnity,\r
+      or other liability obligations and/or rights consistent with this\r
+      License. However, in accepting such obligations, You may act only\r
+      on Your own behalf and on Your sole responsibility, not on behalf\r
+      of any other Contributor, and only if You agree to indemnify,\r
+      defend, and hold each Contributor harmless for any liability\r
+      incurred by, or claims asserted against, such Contributor by reason\r
+      of your accepting any such warranty or additional liability.\r
+\r
+   END OF TERMS AND CONDITIONS\r
+\r
+   APPENDIX: How to apply the Apache License to your work.\r
+\r
+      To apply the Apache License to your work, attach the following\r
+      boilerplate notice, with the fields enclosed by brackets "[]"\r
+      replaced with your own identifying information. (Don't include\r
+      the brackets!)  The text should be enclosed in the appropriate\r
+      comment syntax for the file format. We also recommend that a\r
+      file or class name and description of purpose be included on the\r
+      same "printed page" as the copyright notice for easier\r
+      identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/README.md b/legacy-libs/grpc-cloned/node_modules/protobufjs/README.md
new file mode 100644 (file)
index 0000000..1cf6661
--- /dev/null
@@ -0,0 +1,184 @@
+protobuf.js 5 [![Build Status](https://travis-ci.org/dcodeIO/protobuf.js.svg?branch=ProtoBuf5)](https://travis-ci.org/dcodeIO/protobuf.js) [![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dcode%40dcode.io&item_name=%3C3%20protobuf.js)\r
+=====================================\r
+**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use\r
+in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/docs/overview)).\r
+\r
+**protobuf.js** is a pure JavaScript implementation on top of [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js)\r
+including a .proto parser, message class building and simple encoding and decoding. There is no compilation step\r
+required, it's super easy to use and it works out of the box on .proto files!\r
+\r
+Getting started\r
+---------------\r
+* **Step 1:** Become familar with [Google's Protocol Buffers (protobuf)](https://developers.google.com/protocol-buffers/docs/overview)\r
+* **Step 2:** Read on or head straight to [our wiki](https://github.com/dcodeIO/protobuf.js/wiki) for additional information\r
+* **Step 3:** Build something cool! :-)\r
+\r
+Features\r
+--------\r
+* [RequireJS](http://requirejs.org/)/AMD compatible\r
+* [node.js](http://nodejs.org)/CommonJS compatible, also available via [npm](https://npmjs.org/package/protobufjs)\r
+* Browser compatible\r
+* [Closure Compiler](https://developers.google.com/closure/compiler/) compatible (fully annotated, [externs](https://github.com/dcodeIO/protobuf.js/tree/master/externs))\r
+* Fully documented using [jsdoc3](https://github.com/jsdoc3/jsdoc)\r
+* Well tested through [test.js](https://github.com/dcodeIO/test.js)\r
+* [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js) is the only production dependency\r
+* Fully compatible to the official implementation including advanced features\r
+* proto2js command line utility\r
+\r
+Installation\r
+------------\r
+\r
+### node.js / CommonJS\r
+\r
+```\r
+$> npm install protobufjs\r
+```\r
+\r
+```js\r
+var ProtoBuf = require("protobufjs");\r
+...\r
+```\r
+\r
+### RequireJS / AMD\r
+\r
+Requires [bytebuffer.js](http://github.com/dcodeIO/bytebuffer.js). Optionally depends on [long.js](https://github.com/dcodeIO/long.js) for long (int64) support. If you do not require long support, you can skip the Long.js config. RequireJS example:\r
+\r
+```js\r
+require(["protobuf"], function(ProtoBuf) {\r
+    ...\r
+});\r
+```\r
+\r
+Or as a module dependency:\r
+\r
+```js\r
+define("MyModule", ["protobuf"], function(ProtoBuf) {\r
+    ...\r
+});\r
+```\r
+\r
+### Browser\r
+\r
+Requires [bytebuffer.js](http://github.com/dcodeIO/bytebuffer.js). Optionally depends on [long.js](https://github.com/dcodeIO/long.js) for long (int64) support. If you do not require long support, you can skip the Long.js include.\r
+\r
+```html\r
+<!-- Order is important -->\r
+<script src="long.min.js"></script>\r
+<script src="bytebuffer.min.js"></script>\r
+<script src="protobuf.min.js"></script>\r
+```\r
+\r
+```js\r
+var ProtoBuf = dcodeIO.ProtoBuf;\r
+...\r
+```\r
+\r
+Getting started\r
+---------------\r
+\r
+*Note:* You'll need the full build to load .proto data. light builds are able to load JSON only.\r
+\r
+### Loading .proto files\r
+\r
+To load a .proto file, use:\r
+\r
+**API:** `ProtoBuf.loadProtoFile(source[, callback[, builder]]):Builder|undefined`\r
+\r
+```js\r
+// Synchronously\r
+var builder = ProtoBuf.loadProtoFile("path/to/file.proto");\r
+\r
+// Asynchronously\r
+ProtoBuf.loadProtoFile("path/to/file.proto", function(err, builder) {\r
+    ...\r
+});\r
+```\r
+\r
+`ProtoBuf.loadProtoFile` also accepts an object specifying the import root directory and the file to load as its first parameter: `{root: string, file: string}`. Additionally, an already created and then reused builder can be specified as the last argument, which is useful if all the definitions shall reside in a single namespace.\r
+\r
+### Loading .proto strings\r
+\r
+**API:** `ProtoBuf.loadProto(source[, builder][, filename]):Builder`\r
+\r
+```js\r
+var builder = ProtoBuf.loadProto(...protoString..., "myproto.proto");\r
+```\r
+\r
+### Loading JSON files and strings\r
+\r
+To load the (raw) JSON counterpart generated through pbjs, use `ProtoBuf.loadJsonFile` respectively `ProtoBuf.loadJson`. It's the same API.\r
+\r
+If you generated classes or modules with it, loading is done just by including respectively requiring the resulting file. Loading is handled transparently in this case.\r
+\r
+When using JSON only, you can use protobuf-light.js or protobuf-light.min.js instead, which do NOT include the ProtoBuf.DotProto package for parsing and are therefore smaller.\r
+\r
+Command line\r
+------------\r
+Since ProtoBuf.js 4.0.0 the library ships with the `pbjs` command line utility. With it it's possible to convert between .proto and JSON descriptors and even to generate the code required to access runtime structures as pure JS (classes), an AMD module or a CommonJS module.\r
+\r
+```\r
+\r
+ _ |_ . _\r
+|_)|_)|_)           ProtoBuf.js v4.0.0-b3 https://github.com/dcodeIO/ProtoBuf.js\r
+|     '\r
+\r
+CLI utility to convert between .proto and JSON syntax / to generate classes.\r
+\r
+Usage: pbjs <filename> [options] [> outFile]\r
+\r
+Options:\r
+  --help, -h        Show help  [boolean]\r
+  --version, -v     Show version number  [boolean]\r
+  --source, -s      Specifies the source format. Valid formats are:\r
+\r
+                       json       Plain JSON descriptor\r
+                       proto      Plain .proto descriptor\r
+\r
+  --target, -t      Specifies the target format. Valid formats are:\r
+\r
+                       amd        Runtime structures as AMD module\r
+                       commonjs   Runtime structures as CommonJS module\r
+                       js         Runtime structures\r
+                       json       Plain JSON descriptor\r
+                       proto      Plain .proto descriptor\r
+\r
+  --using, -u       Specifies an option to apply to the volatile builder\r
+                    loading the source, e.g. convertFieldsToCamelCase.\r
+  --min, -m         Minifies the output.  [default: false]\r
+  --path, -p        Adds a directory to the include path.\r
+  --legacy, -l      Includes legacy descriptors from google/protobuf/ if\r
+                    explicitly referenced.  [default: false]\r
+  --quiet, -q       Suppresses any informatory output to stderr.  [default: false]\r
+  --use, -i         Specifies an option to apply to the emitted builder\r
+                    utilized by your program, e.g. populateAccessors.\r
+  --exports, -e     Specifies the namespace to export. Defaults to export\r
+                    the root namespace.\r
+  --dependency, -d  Library dependency to use when generating classes.\r
+                    Defaults to 'protobufjs' for CommonJS, 'ProtoBuf' for\r
+                    AMD modules and 'dcodeIO.ProtoBuf' for classes.\r
+```\r
+\r
+Documentation\r
+-------------\r
+* [Read the official protobuf guide](https://developers.google.com/protocol-buffers/docs/overview)\r
+* [Read the API docs](http://htmlpreview.github.io/?https://raw.githubusercontent.com/dcodeIO/protobuf.js/ProtoBuf5/docs/ProtoBuf.html)\r
+* [Check out the examples](https://github.com/dcodeIO/protobuf.js/tree/ProtoBuf5/examples)\r
+\r
+Tests\r
+-----\r
+* [View source](https://github.com/dcodeIO/protobuf.js/blob/ProtoBuf5/tests/suite.js)\r
+\r
+Downloads\r
+---------\r
+* [Distributions](https://github.com/dcodeIO/protobuf.js/tree/ProtoBuf5/dist)\r
+* [ZIP-Archive](https://github.com/dcodeIO/protobuf.js/archive/ProtoBuf5.zip)\r
+* [Tarball](https://github.com/dcodeIO/protobuf.js/tarball/ProtoBuf5)\r
+\r
+CDN usage\r
+---------\r
+```html\r
+<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/5.0.1/dist/protobuf.min.js"></script>\r
+```\r
+With the version pointing to the exact [release](https://github.com/dcodeIO/protobuf.js/releases) your project depends upon.\r
+\r
+**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/bin/pbjs b/legacy-libs/grpc-cloned/node_modules/protobufjs/bin/pbjs
new file mode 100644 (file)
index 0000000..73ebc4a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env node\r
+process.exit(require(__dirname+"/../cli/pbjs.js").main(process.argv));\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/bower.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/bower.json
new file mode 100644 (file)
index 0000000..30f074c
--- /dev/null
@@ -0,0 +1,19 @@
+{\r
+    "name": "protobuf",\r
+    "description": "Protocol Buffers for JavaScript. Finally.",\r
+    "version": "5.0.3",\r
+    "main": "dist/protobuf.js",\r
+    "license": "Apache-2.0",\r
+    "homepage": "http://dcode.io/",\r
+    "dependencies": {\r
+        "bytebuffer": "~5"\r
+    },\r
+    "keywords": ["net", "buffer", "protobuf", "serialization", "bytebuffer", "websocket", "webrtc"],\r
+    "ignore": [\r
+        "**/.*",\r
+        "node_modules",\r
+        "bower_components",\r
+        "test",\r
+        "tests"\r
+    ]\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs.js
new file mode 100644 (file)
index 0000000..e90798b
--- /dev/null
@@ -0,0 +1,281 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var ProtoBuf = require(__dirname+"/../index.js"),\r
+    fs       = require("fs"),\r
+    path     = require("path"),\r
+    cli      = require("ascli")("pbjs"),\r
+    yargs    = require("yargs"),\r
+    util     = require("./pbjs/util.js"),\r
+    glob     = require("glob"),\r
+    pkg      = require("../package.json");\r
+\r
+/**\r
+ * pbjs namespace.\r
+ * @exports pbjs\r
+ * @namespace\r
+ */\r
+var pbjs = module.exports = {};\r
+\r
+/**\r
+ * @alias pbjs/util\r
+ */\r
+pbjs.util = util;\r
+\r
+/**\r
+ * Source formats.\r
+ * @type {!Object.<string,!function(string,!Object.<string,*>)>}\r
+ */\r
+pbjs.sources = {};\r
+fs.readdirSync(__dirname+"/pbjs/sources").forEach(function(source) {\r
+    if (/\.js$/.test(source)) {\r
+        var src = require(__dirname + "/pbjs/sources/" + source);\r
+        if (!src.exclude)\r
+            pbjs.sources[source.substring(0, source.lastIndexOf("."))] = src;\r
+    }\r
+});\r
+\r
+/**\r
+ * Target formats.\r
+ * @type {!Object.<string,!function(!ProtoBuf.Builder,!Object.<string,*>)>}\r
+ */\r
+pbjs.targets = {};\r
+fs.readdirSync(__dirname+"/pbjs/targets").forEach(function(target) {\r
+    if (/\.js$/.test(target))\r
+        pbjs.targets[target.substring(0, target.lastIndexOf("."))] = require(__dirname + "/pbjs/targets/" + target);\r
+});\r
+\r
+/**\r
+ * Status code: Operation successful\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_OK = 0;\r
+\r
+/**\r
+ * Status code: Displaying usage information\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_USAGE = 1;\r
+\r
+/**\r
+ * Status code: No such include directory\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_INCLUDE_DIR = 2;\r
+\r
+/**\r
+ * Status code: No such source format\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_SOURCE_FORMAT = 3;\r
+\r
+/**\r
+ * Status code: No such target format\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_TARGET_FORMAT = 4;\r
+\r
+/**\r
+ * Status code: No such namespace\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_NAMESPACE = 5;\r
+\r
+/**\r
+ * Status code: Illegal dependency\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_DEPENDENCY = 6;\r
+\r
+/**\r
+ * Status code: No matching source files\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_NOSOURCE = 7;\r
+\r
+// Makes a table of available source or target formats\r
+function mkOptions(obj) {\r
+    var str = '';\r
+    Object.keys(obj).forEach(function(key) {\r
+        str += "\n   "+util.pad(key, 10)+" "+obj[key].description;\r
+    });\r
+    return str;\r
+}\r
+\r
+/**\r
+ * Executes the program.\r
+ * @param {!Array.<string>} argv Command line arguments\r
+ * @returns {number} Status code\r
+ */\r
+pbjs.main = function(argv) {\r
+    var options = yargs\r
+        .usage(cli("pb".white.bold+"js".green.bold, util.pad("ProtoBuf.js v"+pkg['version'], 31, true)+" "+pkg['homepage'].grey) + "\n" +\r
+                    "CLI utility to convert between .proto and JSON syntax / to generate classes.\n\n" +\r
+                    "Usage: ".white.bold+path.basename(argv[1]).green.bold+" <source files...> [options] [> outFile]")\r
+        .help("help")\r
+        .version(pkg["version"])\r
+        .wrap(null)\r
+        .options({\r
+            source: {\r
+                alias: "s",\r
+                describe: "Specifies the source format. Valid formats are:\n" + mkOptions(pbjs.sources)+"\n"\r
+            },\r
+            target: {\r
+                alias: "t",\r
+                describe: "Specifies the target format. Valid formats are:\n" + mkOptions(pbjs.targets)+"\n"\r
+            },\r
+            using: {\r
+                alias: "u",\r
+                describe: "Specifies an option to apply to the volatile builder\nloading the source, e.g. convertFieldsToCamelCase.",\r
+                type: "array"\r
+            },\r
+            min: {\r
+                alias: "m",\r
+                describe: "Minifies the output.",\r
+                default: false\r
+            },\r
+            path: {\r
+                alias: "p",\r
+                describe: "Adds a directory to the include path."\r
+            },\r
+            legacy: {\r
+                alias: "l",\r
+                describe: "Includes legacy descriptors from google/protobuf/ if\nexplicitly referenced.",\r
+                default: false\r
+            },\r
+            quiet: {\r
+                alias: "q",\r
+                describe: "Suppresses any informatory output to stderr.",\r
+                default: false\r
+            },\r
+            out: {\r
+                alias: "o",\r
+                describe: "Send output to file instead of stdout.",\r
+            },\r
+            use: {\r
+                alias: "i",\r
+                describe: "Specifies an option to apply to the emitted builder\nutilized by your program, e.g. populateAccessors.",\r
+                type: "array"\r
+            },\r
+            exports: {\r
+                alias: "e",\r
+                describe: "Specifies the namespace to export. Defaults to export\nthe root namespace."\r
+            },\r
+            dependency: {\r
+                alias: "d",\r
+                describe: "Library dependency to use when generating classes.\nDefaults to 'protobufjs' for CommonJS, 'protobuf' for\nAMD modules and 'dcodeIO.ProtoBuf' for classes."\r
+            }\r
+        })\r
+        .alias("help", "h")\r
+        .alias("version", "v")\r
+        .check(function (args) {\r
+            if (args.source && typeof pbjs.sources[args.source] !== "function") {\r
+                return "Unrecognized source format: '" + args.source + "'";\r
+            }\r
+\r
+            if (args.target && typeof pbjs.targets[args.target] !== "function") {\r
+                return "Unrecognized target format: '" + args.target + "'";\r
+            }\r
+\r
+            if (args._.length < 3) {\r
+                return "The filename to parse is required.";\r
+            }\r
+\r
+            return true;\r
+        })\r
+        .parse(argv);\r
+\r
+    var start = Date.now(),\r
+        sourceFiles = options._.slice(2);\r
+\r
+    // Expand glob expressions\r
+    var sourceFilesExpand = [];\r
+    for (var i=0; i<sourceFiles.length; ++i) {\r
+        var filename = sourceFiles[i],\r
+            files = glob.sync(filename);\r
+        if (files.length === 0) {\r
+            cli.fail("No matching source files: "+filename);\r
+            return pbjs.STATUS_ERR_NOSOURCE;\r
+        }\r
+        files.forEach(function(filename) {\r
+            if (sourceFilesExpand.indexOf(filename) === -1)\r
+                sourceFilesExpand.push(filename);\r
+        });\r
+    }\r
+    sourceFiles = sourceFilesExpand;\r
+\r
+    if (!options.target)\r
+        options.target = "json";\r
+\r
+    // Set up include paths\r
+    var includePath = Array.isArray(options['path']) ? options['path'] : (typeof options['path'] === 'string' ? [options['path']] : []);\r
+    sourceFiles.forEach(function (sourceFile) {\r
+        var dir = path.dirname(sourceFile);\r
+        if (includePath.indexOf(dir) === -1) {\r
+            includePath.push(dir);\r
+        }\r
+    });\r
+    includePath.forEach(function(path) { // Verify that include paths actually exist\r
+        if (!fs.existsSync(path)) {\r
+            if (!options.quiet)\r
+                cli.fail("No such include directory: "+path);\r
+            return pbjs.STATUS_ERR_INCLUDE_DIR;\r
+        }\r
+    });\r
+    options.path = includePath;\r
+\r
+    // Detect source format if not specified, then verify\r
+    if (typeof options.source !== 'string') {\r
+        var source = fs.readFileSync(sourceFiles[0]).toString("utf8").trim();\r
+        if (source.substring(0,1) === "{")\r
+            options.source = "json";\r
+        else\r
+            options.source = "proto";\r
+    }\r
+\r
+    // Load the source files to a common builder\r
+    var builder = pbjs.sources[options.source](sourceFiles, options);\r
+\r
+    // Validate exports and dependency if set\r
+    if (typeof options.exports !== 'undefined') {\r
+        if (!(builder.lookup(options.exports) instanceof ProtoBuf.Reflect.Namespace)) {\r
+            if (!options.quiet)\r
+                cli.fail("No such export namespace: "+options.exports);\r
+            return pbjs.STATUS_ERR_NAMESPACE;\r
+        }\r
+        if (options.exports.charAt(0) === '.')\r
+            options.exports = options.exports.substring(1);\r
+    }\r
+    if (typeof options.dependency !== 'undefined')\r
+        if (typeof options.dependency !== 'string' || !options.dependency) {\r
+            if (!options.quiet)\r
+                cli.fail("Illegal dependency: "+options.dependency);\r
+            return pbjs.STATUS_ERR_DEPENDENCY;\r
+        }\r
+\r
+    // Perform target conversion\r
+    if (!options.quiet)\r
+        cli.error("\nProcessing: "+sourceFiles.join(", ")+" ...\n");\r
+    var res = pbjs.targets[options.target](builder, options);\r
+    if (options.out){\r
+        fs.writeFileSync(options.out, res);\r
+    }else\r
+    process.stdout.write(res);\r
+    if (!options.quiet)\r
+        cli.error(""),\r
+        cli.ok("Converted "+sourceFiles.length+" source files to "+options.target+" ("+res.length+" bytes, "+(Date.now()-start)+" ms)");\r
+\r
+    return pbjs.STATUS_OK;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/binary.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/binary.js
new file mode 100644 (file)
index 0000000..2eb64c9
--- /dev/null
@@ -0,0 +1,130 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Binary descriptor set";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require(__dirname+"/../util.js"),\r
+    node_path = require("path"),\r
+    fs = require("fs");\r
+\r
+/**\r
+ * pbjs source: Binary descriptor\r
+ * @exports pbjs/sources/binary\r
+ * @function\r
+ * @param {!Array.<string>} filenames Source files\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {!ProtoBuf.Builder}\r
+ */\r
+var binary = module.exports = function(filenames, options) {\r
+    options = options || [];\r
+    var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),\r
+        loaded = [];\r
+    filenames.forEach(function(filename) {\r
+        var data = binary.load(filename, options, loaded);\r
+        builder["import"](data, filename);\r
+    });\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+binary.description = description;\r
+\r
+binary.exclude = true; // Unfinished\r
+\r
+/**\r
+ * Loads a binary descriptor.\r
+ * @param {string} filename Source file\r
+ * @param {!Object.<string,*>} options Options\r
+ * @param {!Array.<string>=} loaded An array of already loaded filenames\r
+ * @returns {*} JSON descriptor\r
+ */\r
+binary.load = function(filename, options, loaded) {\r
+    filename = node_path.resolve(filename);\r
+    loaded = loaded || [];\r
+    if (loaded.indexOf(filename) >= 0)\r
+        return {};\r
+    var data = fs.readFileSync(filename);\r
+    loaded.push(filename);\r
+    var builder = ProtoBuf.loadProtoFile(node_path.join("..", "..", "..", "src", "google", "protobuf", "descriptor.proto")),\r
+        FileDescriptorSet = builder.build("google.protobuf.FileDescriptorSet");\r
+    var fds = FileDescriptorSet.decode(data),\r
+        imports = [];\r
+    var json = {\r
+        "package": null,\r
+        "imports": imports\r
+    };\r
+    fds.file.forEach(function(fdp) {\r
+        imports.push(buildFileDescriptorProto(fdp));\r
+    });\r
+    return json;\r
+};\r
+\r
+function buildFileDescriptorProto(fdp) {\r
+    var pkg = fdp.package,\r
+        messages = [],\r
+        enums = [],\r
+        services = [],\r
+        extensions = [],\r
+        options = {},\r
+        imports = [];\r
+    fdp.message_type.forEach(function(dp) {\r
+        messages.push(buildMessageDescriptorProto(dp));\r
+    });\r
+    fdp.enum_type.forEach(function(edp) {\r
+        enums.push(buildEnumDescriptorProto(edp));\r
+    });\r
+    fdp.service.forEach(function(sdp) {\r
+        enums.push(buildServiceDescriptorProto(sdp));\r
+    });\r
+    fdp.extension.forEach(function(fdp) {\r
+        extensions.push(buildFieldDescriptorProtoAsExtension(fdp));\r
+    });\r
+    fdp.options.forEach(function(fo) {\r
+        // TODO\r
+    });\r
+    fdp.dependency.forEach(function(filename) {\r
+        // TODO\r
+    });\r
+    return {\r
+        "package": pkg,\r
+        "messages": messages,\r
+        "enums": enums,\r
+        "services": services,\r
+        "extensions": extensions,\r
+        "options": options,\r
+        "imports": imports\r
+    };\r
+}\r
+\r
+function buildMessageDescriptorProto(mdp) {\r
+\r
+}\r
+\r
+function buildEnumDescriptorProto(edp) {\r
+\r
+}\r
+\r
+function buildServiceDescriptorProto(sdp) {\r
+\r
+}\r
+\r
+function buildFieldDescriptorProtoAsExtension(fdp) {\r
+\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/json.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/json.js
new file mode 100644 (file)
index 0000000..86df60f
--- /dev/null
@@ -0,0 +1,84 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain JSON descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require(__dirname+"/../util.js"),\r
+    node_path = require("path"),\r
+    fs = require("fs");\r
+\r
+/**\r
+ * pbjs source: Plain JSON descriptor\r
+ * @exports pbjs/sources/json\r
+ * @function\r
+ * @param {!Array.<string>} filenames Source files\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {!ProtoBuf.Builder}\r
+ */\r
+var json = module.exports = function(filenames, options) {\r
+    options = options || [];\r
+    var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),\r
+        loaded = [];\r
+    filenames.forEach(function(filename) {\r
+        var data = json.load(filename, options, loaded);\r
+        builder["import"](data, filename);\r
+    });\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+json.description = description;\r
+\r
+/**\r
+ * Loads a JSON descriptor including imports.\r
+ * @param {string} filename Source file\r
+ * @param {!Object.<string,*>} options Options\r
+ * @param {!Array.<string>=} loaded An array of already loaded filenames\r
+ * @returns {*} JSON descriptor\r
+ */\r
+json.load = function(filename, options, loaded) {\r
+    filename = node_path.resolve(filename);\r
+    loaded = loaded || [];\r
+    if (loaded.indexOf(filename) >= 0)\r
+        return {};\r
+    var data = JSON.parse(fs.readFileSync(filename).toString("utf8")),\r
+        imports = data['imports'];\r
+    loaded.push(filename);\r
+    if (Array.isArray(imports)) {\r
+        for (var i=0; i<imports.length; ++i) {\r
+            // Skip pulled imports and legacy descriptors\r
+            if (typeof imports[i] !== 'string' || (util.isDescriptor(imports[i]) && !options.legacy))\r
+                continue;\r
+            // Merge imports, try include paths\r
+            (function() {\r
+                var path = options.path || [];\r
+                for (var j=0; j<path.length; ++j) {\r
+                    var import_filename = node_path.resolve(path[j] + "/", imports[i]);\r
+                    if (!fs.existsSync(import_filename))\r
+                        continue;\r
+                    imports[i] = json.load(import_filename, options, loaded);\r
+                    return;\r
+                }\r
+                throw Error("File not found: "+imports[i]);\r
+            })();\r
+        }\r
+    }\r
+    return data;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/proto.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/sources/proto.js
new file mode 100644 (file)
index 0000000..34fa3ee
--- /dev/null
@@ -0,0 +1,84 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain .proto descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require(__dirname+"/../util.js"),\r
+    fs = require("fs"),\r
+    node_path = require("path");\r
+\r
+/**\r
+ * pbjs source: Plain .proto descriptor\r
+ * @exports pbjs/sources/proto\r
+ * @function\r
+ * @param {!Array.<string>} filenames Source files\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {!ProtoBuf.Builder}\r
+ */\r
+var proto = module.exports = function(filenames, options) {\r
+    options = options || [];\r
+    var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),\r
+        loaded = [];\r
+    filenames.forEach(function(filename) {\r
+        var data = proto.load(filename, options, loaded);\r
+        builder["import"](data, filename);\r
+    });\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+proto.description = description;\r
+\r
+/**\r
+ * Loads a .proto descriptor including imports.\r
+ * @param {string} filename Source file\r
+ * @param {!Object.<string,*>} options Options\r
+ * @param {!Array.<string>=} loaded An array of already loaded filenames\r
+ * @returns {*} JSON descriptor\r
+ */\r
+proto.load = function(filename, options, loaded) {\r
+    filename = node_path.resolve(filename);\r
+    loaded = loaded || [];\r
+    if (loaded.indexOf(filename) >= 0)\r
+        return {};\r
+    var data = ProtoBuf.DotProto.Parser.parse(fs.readFileSync(filename).toString("utf8"));\r
+    loaded.push(filename);\r
+    if (Array.isArray(data['imports'])) {\r
+        var imports = data['imports'];\r
+        for (var i=0; i<imports.length; i++) {\r
+            // Skip pulled imports and legacy descriptors\r
+            if (typeof imports[i] !== 'string' || (util.isDescriptor(imports[i]) && !options.legacy))\r
+                continue;\r
+            // Merge imports, try include paths\r
+            (function() {\r
+                var path = options.path || [];\r
+                for (var j=0; j<path.length; ++j) {\r
+                    var import_filename = node_path.resolve(path[j] + "/", imports[i]);\r
+                    if (!fs.existsSync(import_filename))\r
+                        continue;\r
+                    imports[i] = proto.load(import_filename, options, loaded);\r
+                    return;\r
+                }\r
+                throw Error("File not found: "+imports[i]);\r
+            })();\r
+        }\r
+    }\r
+    return data;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/amd.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/amd.js
new file mode 100644 (file)
index 0000000..7d0f538
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures as AMD module";\r
+\r
+var ProtoBuf = require("../../../index.js"),\r
+    util = require("../util.js"),\r
+    js = require("./js.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures as an AMD module\r
+ * @exports pbjs/targets/amd\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var amd = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        "define([", JSON.stringify(options.dependency || "protobuf"), "]", options.min ? "," : ", ",\r
+        "function(ProtoBuf)", options.min ? "{" : " {\n    ",\r
+        "return ProtoBuf",\r
+        util.indent(js.build(builder, options), options.min ? "" : "    "), options.min ? "" : "\n",\r
+        "});"\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+amd.description = description;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/commonjs.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/commonjs.js
new file mode 100644 (file)
index 0000000..11d1cfd
--- /dev/null
@@ -0,0 +1,42 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures as CommonJS module";\r
+\r
+var util = require("../util.js"),\r
+    js = require("./js.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures as a CommonJS module\r
+ * @exports pbjs/targets/commonjs\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var commonjs = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        "module.exports", options.min ? "=" : " = ",\r
+        "require(", JSON.stringify(options.dependency || "protobufjs"), ")",\r
+        js.build(builder, options)\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+commonjs.description = description;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/js.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/js.js
new file mode 100644 (file)
index 0000000..4f9ee12
--- /dev/null
@@ -0,0 +1,63 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures";\r
+\r
+var util = require("../util.js"),\r
+    json = require("./json.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures\r
+ * @exports pbjs/targets/js\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var js = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    var varName = "_root";\r
+    if (options.exports)\r
+        varName = options.exports.substring(options.exports.lastIndexOf(".")+1);\r
+    return [\r
+        "var ", varName, options.min ? "=" : " = ", options.dependency || "dcodeIO.ProtoBuf",\r
+        js.build(builder, options)\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Builds the core js target.\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+js.build = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        ".newBuilder(",\r
+        JSON.stringify(util.getBuilderOptions(options, "use"), null, options.min ? 0 : 4),\r
+        ")['import'](",\r
+        json(builder, options),\r
+        ").build(",\r
+        typeof options.exports === 'string' ? JSON.stringify(options.exports.split(".")) : "",\r
+        ");"\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+js.description = description;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/json.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/json.js
new file mode 100644 (file)
index 0000000..39e4c6d
--- /dev/null
@@ -0,0 +1,260 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain JSON descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require("../util.js");\r
+\r
+/**\r
+ * pbjs target: Plain JSON descriptor\r
+ * @exports pbjs/targets/json\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var json = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    builder.resolveAll();\r
+\r
+    // Set the pointer to the lowest common namespace (with options)\r
+    var ptr = builder.ns;\r
+    while (ptr.children.length === 1 && Object.keys(ptr.options).length === 0 && ptr.children[0].className === "Namespace")\r
+        ptr = ptr.children[0];\r
+\r
+    // Start by building the package namespace\r
+    var pkg = ptr.fqn().substring(1),\r
+        out = {\r
+            "package": pkg !== "" ? pkg : null\r
+        };\r
+    buildNamespace(ptr, out);\r
+    return JSON.stringify(out, null, options.min ? 0 : 4);\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+json.description = description;\r
+\r
+/**\r
+ * Builds all structures in a namespace.\r
+ * @param {!ProtoBuf.Reflect.Namespace} ns Namespace to build\r
+ * @param {!Object.<string,*>} out Extended output object\r
+ */\r
+function buildNamespace(ns, out) {\r
+    var messages, enums, services;\r
+    util.extend(out, {\r
+        "syntax"   : ns.syntax   || 'proto2',\r
+        "options"  : out.options || {},\r
+        "messages" : messages = [],\r
+        "enums"    : enums    = [],\r
+        "services" : services = []\r
+    });\r
+    if (!(ns instanceof ProtoBuf.Reflect.Message))\r
+        out['isNamespace'] = true;\r
+    util.extend(out["options"], buildOptions(ns.options));\r
+    ns.getChildren(ProtoBuf.Reflect.Enum).forEach(function(enm) {\r
+        enums.push(buildEnum(enm));\r
+    });\r
+    if (enums.length === 0)\r
+        delete out["enums"];\r
+    ns.getChildren(ProtoBuf.Reflect.Message).forEach(function(msg) {\r
+        messages.push(buildMessage(msg));\r
+    });\r
+    ns.getChildren(ProtoBuf.Reflect.Service).forEach(function(svc) {\r
+        services.push(buildService(svc));\r
+    });\r
+    if (services.length === 0)\r
+        delete out["services"];\r
+    Array.prototype.push.apply(messages, buildExtensions(ns));\r
+    ns.getChildren(ProtoBuf.Reflect.Namespace).forEach(function(innerNs) {\r
+        if (innerNs.className !== "Namespace")\r
+            return;\r
+        var emptyMessage = {\r
+            "name": innerNs.name,\r
+            "fields": []\r
+        };\r
+        buildNamespace(innerNs, emptyMessage);\r
+        messages.push(emptyMessage);\r
+    });\r
+    if (messages.length === 0)\r
+        delete out["messages"];\r
+    if (Object.keys(out["options"]).length === 0)\r
+        delete out["options"];\r
+}\r
+\r
+/**\r
+ * Builds extensions declared in the specified namespace.\r
+ * @param {!ProtoBuf.Reflect.Namespace} ns Namespace\r
+ * @returns {!Array.<!*>}\r
+ */\r
+function buildExtensions(ns) {\r
+    var exts = util.groupExtensions(ns);\r
+    if (exts === null)\r
+        return [];\r
+    var messages = [];\r
+    Object.keys(exts).forEach(function(extFqn) {\r
+        var extMsg = ns.resolve(extFqn),\r
+            extFields = exts[extFqn];\r
+        var fields, ext = {\r
+            "ref"    : ns.qn(extMsg),\r
+            "fields" : fields = []\r
+        };\r
+        extFields.forEach(function(extField) {\r
+            fields.push(buildMessageField(extField));\r
+        });\r
+        messages.push(ext);\r
+    });\r
+    return messages;\r
+}\r
+\r
+/**\r
+ * Builds block-level options.\r
+ * @param {!Object.<string,*>} options Options\r
+ * @returns {!Object.<string,*>}\r
+ */\r
+function buildOptions(options) {\r
+    Object.keys(options = options || {}).forEach(function(key) {\r
+        var val = options[key];\r
+        switch (typeof val) {\r
+            case 'string':\r
+            case 'number':\r
+            case 'boolean':\r
+            case 'object':\r
+                break;\r
+            default:\r
+                throw Error("Illegal option type: "+typeof(val));\r
+        }\r
+    });\r
+    return options;\r
+}\r
+\r
+/**\r
+ * Builds a message.\r
+ * @param {!ProtoBuf.Reflect.Message} msg Message\r
+ * @returns {!*}\r
+ */\r
+function buildMessage(msg) {\r
+    var fields, oneofs;\r
+    var out = {\r
+        "name"     : msg.name,\r
+        "syntax"   : msg.syntax || 'proto2',\r
+        "options"  : {},\r
+        "fields"   : fields   = [],\r
+        "oneofs"   : oneofs   = {}\r
+    };\r
+    msg.getChildren(ProtoBuf.Reflect.Message.Field).forEach(function(fld) {\r
+        if (fld instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+            return;\r
+        fields.push(buildMessageField(fld));\r
+    });\r
+    msg.getChildren(ProtoBuf.Reflect.Message.OneOf).forEach(function(oneof) {\r
+        oneofs[oneof.name] = buildMessageOneof(oneof);\r
+    });\r
+    if (msg.extensions)\r
+        out["extensions"] = msg.extensions;\r
+    if (Object.keys(oneofs).length === 0)\r
+        delete out["oneofs"];\r
+    buildNamespace(msg, out);\r
+    return out;\r
+}\r
+\r
+/**\r
+ * Builds a message field.\r
+ * @param {!ProtoBuf.Reflect.Message.Field} fld Message field\r
+ * @returns {!*}\r
+ */\r
+function buildMessageField(fld) {\r
+    return {\r
+        "rule"    : fld.map ? "map" : (fld.repeated ? "repeated" : (fld.required ? "required" : "optional")),\r
+        "type"    : fld.resolvedType ? fld.parent.qn(fld.resolvedType) : fld.type['name'],\r
+        "keytype" : (typeof(fld.keyType) === 'string') ? fld.keyType : (fld.keyType !== null ? fld.keyType.name : undefined),\r
+        "name"    : fld instanceof ProtoBuf.Reflect.Message.ExtensionField ? fld.name.substring(fld.name.lastIndexOf(".")+1): fld.name,\r
+        "id"      : fld.id,\r
+        "options" : Object.keys(fld.options).length > 0 ? buildOptions(fld.options) : undefined,\r
+        "oneof"   : fld.oneof ? fld.oneof.name : undefined\r
+    };\r
+}\r
+\r
+/**\r
+ * Builds a message oneof.\r
+ * @param {!ProtoBuf.Reflect.message.OneOf} oneof Message oneof\r
+ * @returns {!Array.<!*>}\r
+ */\r
+function buildMessageOneof(oneof) {\r
+    var out = [];\r
+    oneof.fields.forEach(function(fld) {\r
+        out.push(fld.id);\r
+    });\r
+    return out;\r
+}\r
+\r
+/**\r
+ * Builds an enum.\r
+ * @param {!ProtoBuf.Reflect.Enum} enm Enum\r
+ * @returns {!*}\r
+ */\r
+function buildEnum(enm) {\r
+    var values;\r
+    var out = {\r
+        "name"    : enm.name,\r
+        "syntax"  : enm.syntax || 'proto2',\r
+        "values"  : values = []\r
+    };\r
+    enm.getChildren(ProtoBuf.Reflect.Enum.Value).forEach(function(val) {\r
+        values.push(buildEnumValue(val));\r
+    });\r
+    if (Object.keys(enm.options).length > 0)\r
+        out["options"] = buildOptions(enm.options);\r
+    return out;\r
+}\r
+\r
+/**\r
+ * Builds an enum value.\r
+ * @param {!ProtoBuf.Reflect.Enum.Value} val Enum value\r
+ * @returns {!*}\r
+ */\r
+function buildEnumValue(val) {\r
+    return {\r
+        "name"    : val.name,\r
+        "id"      : val.id\r
+    };\r
+}\r
+\r
+/**\r
+ * Builds a service.\r
+ * @param {!ProtoBuf.Reflect.Service} svc Service\r
+ * @returns {!*}\r
+ */\r
+function buildService(svc) {\r
+    var rpc;\r
+    var out = {\r
+        "name": svc.name,\r
+        "options": buildOptions(svc.options),\r
+        "rpc": rpc = {}\r
+    };\r
+    svc.getChildren(ProtoBuf.Reflect.Service.RPCMethod).forEach(function(mtd) {\r
+        rpc[mtd.name] = {\r
+            "request": svc.qn(mtd.resolvedRequestType),\r
+            "request_stream": mtd.requestStream,\r
+            "response": svc.qn(mtd.resolvedResponseType),\r
+            "response_stream": mtd.responseStream,\r
+            "options": buildOptions(mtd.options)\r
+        };\r
+    });\r
+    return out;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/proto.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/targets/proto.js
new file mode 100644 (file)
index 0000000..abfce36
--- /dev/null
@@ -0,0 +1,267 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain .proto descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require("../util.js");\r
+\r
+/**\r
+ * pbjs target: Plain .proto descriptor\r
+ * @exports pbjs/targets/proto\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var proto = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    builder.resolveAll();\r
+\r
+    // Set the pointer to the lowest common namespace (with options)\r
+    var ptr = builder.ns;\r
+    while (ptr.children.length === 1 && Object.keys(ptr.options).length === 0 && ptr.children[0].className === "Namespace")\r
+        ptr = ptr.children[0];\r
+\r
+    var out = [];\r
+\r
+    function trim() {\r
+        out[out.length-1] = out[out.length-1].replace(/\n{2,}$/, "\n");\r
+    }\r
+\r
+    // Builds a set of top level options\r
+    function buildOptions(opt, indent) {\r
+        var keys;\r
+        if ((keys = Object.keys(opt)).length === 0)\r
+            return;\r
+        keys.forEach(function(key) {\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push("option ", key, options.min ? "=" : " = ", value(opt[key]), options.min ? ";" : ";\n");\r
+        });\r
+        if (!options.min)\r
+            out[out.length-1] += "\n";\r
+    }\r
+\r
+    // Builds everything within a namespace\r
+    function buildNamespace(ns, indent) {\r
+        ns.getChildren(ProtoBuf.Reflect.Enum).forEach(function(enm) {\r
+            buildEnum(enm, indent);\r
+        });\r
+        ns.getChildren(ProtoBuf.Reflect.Message).forEach(function(msg) {\r
+            if (!msg.isGroup) // legacy groups are build within the respective field\r
+                buildMessage(msg, indent);\r
+        });\r
+        var exts = util.groupExtensions(ns);\r
+        if (exts !== null) {\r
+            Object.keys(exts).forEach(function(extFqn) {\r
+                var extMsg = ns.resolve(extFqn),\r
+                    extFields = exts[extFqn];\r
+                if (!options.min)\r
+                    out.push(indent);\r
+                out.push("extend ", ns.qn(extMsg), options.min ? "{" : " {\n");\r
+                extFields.forEach(function(extField) {\r
+                    buildMessageField(ns, extField, indent+"    ", false);\r
+                });\r
+                if (!options.min)\r
+                    out.push(indent);\r
+                out.push(options.min ? "}" : "}\n\n");\r
+            });\r
+        }\r
+        ns.getChildren(ProtoBuf.Reflect.Service).forEach(function(svc) {\r
+            buildService(svc, indent);\r
+        });\r
+        ns.getChildren(ProtoBuf.Reflect.Namespace).forEach(function(innerNs) {\r
+            if (innerNs.className !== "Namespace")\r
+                return;\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push("message ", innerNs.name, options.min ? "{" : " {\n");\r
+            buildNamespace(innerNs, indent+"    ");\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push(options.min ? "}" : "}\n");\r
+        });\r
+        trim();\r
+    }\r
+\r
+    // Builds a message\r
+    function buildMessage(msg, indent) {\r
+        if (!msg.isGroup) {\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push("message ", msg.name);\r
+        }\r
+        out.push(options.min ? "{" : " {\n");\r
+        buildOptions(msg.options, indent+"    ");\r
+        var n = 0, oneofFields = [];\r
+        msg.getChildren(ProtoBuf.Reflect.Message.OneOf).forEach(function(oneof) {\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push("oneof ", oneof.name, options.min ? "{" : " {\n");\r
+            oneof.fields.forEach(function(fld) {\r
+                buildMessageField(msg, fld, indent+"        ", true);\r
+                oneofFields.push(fld);\r
+            });\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push(options.min ? "}" : "}\n");\r
+        });\r
+        msg.getChildren(ProtoBuf.Reflect.Message.Field).forEach(function(fld) {\r
+            if (fld instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+                return;\r
+            if (oneofFields.indexOf(fld) >= 0)\r
+                return;\r
+            buildMessageField(msg, fld, indent+"    ", false);\r
+            n++;\r
+        });\r
+        if (n > 0 && !options.min)\r
+            out[out.length-1] += "\n";\r
+        if (msg.extensions) { // array of ranges\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push("extensions ");\r
+            msg.extensions.forEach(function(range, index) {\r
+                if (index > 0)\r
+                    out.push(options.min ? "," : ", ");\r
+                out.push(value(range[0]));\r
+                if (range[1] !== range[0])\r
+                    out.push(" to ", range[1] === ProtoBuf.ID_MAX ? "max" : value(range[1]));\r
+            });\r
+            out.push(options.min ? ";" : ";\n\n");\r
+        }\r
+        buildNamespace(msg, indent+"    ");\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push(options.min ? "}" : "}\n\n");\r
+    }\r
+\r
+    // Builds a message field\r
+    function buildMessageField(msg, fld, indent, isOneOf) {\r
+        var isGroup = false;\r
+        if (!options.min)\r
+            out.push(indent);\r
+        if (!isOneOf)\r
+            out.push(fld.required ? "required " : (fld.repeated ? "repeated " : "optional "));\r
+        if (fld.resolvedType !== null) {\r
+            if (fld.resolvedType instanceof ProtoBuf.Reflect.Message && fld.resolvedType.isGroup) {\r
+                // inline legacy groups\r
+                out.push("group ");\r
+                isGroup = true;\r
+            }\r
+            out.push(msg.qn(fld.resolvedType));\r
+        } else\r
+            out.push(fld.type['name']);\r
+        if (!isGroup)\r
+            out.push(" ", fld instanceof ProtoBuf.Reflect.Message.ExtensionField ? fld.name.substring(fld.name.lastIndexOf(".")+1) : fld.name);\r
+        out.push(options.min ? "=" : " = ", fld.id);\r
+        if (isGroup) // inline\r
+            buildMessage(fld.resolvedType, indent);\r
+        else {\r
+            var keys = Object.keys(fld.options);\r
+            if (keys.length > 0) {\r
+                out.push(options.min ? "[" : " [");\r
+                var n = 0;\r
+                keys.forEach(function (key) {\r
+                    if (n > 0)\r
+                        out.push(options.min ? "," : ", ");\r
+                    out.push(key, options.min ? "=" : " = ",\r
+                        // BEWARE: Monkey patch for string enum defaults\r
+                        key === "default" && fld.type === ProtoBuf.TYPES["enum"] && typeof fld.options[key] === 'string' ? fld.options[key] : value(fld.options[key])\r
+                    );\r
+                    n++;\r
+                });\r
+                out.push("]");\r
+            }\r
+            out.push(options.min ? ";" : ";\n");\r
+        }\r
+    }\r
+\r
+    // Builds an enum\r
+    function buildEnum(enm, indent) {\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push("enum ", enm.name, options.min ? "{" : " {\n");\r
+        buildOptions(enm.options, indent+"    ");\r
+        enm.getChildren(ProtoBuf.Reflect.Enum.Value).forEach(function(val) {\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push(val.name, options.min ? "=" : " = ", val.id, options.min? ";" : ";\n");\r
+        });\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push(options.min ? "}" : "}\n\n");\r
+    }\r
+\r
+    // Builds a service\r
+    function buildService(svc, indent) {\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push("service ", svc.name, options.min ? "{" : " {\n");\r
+        buildOptions(svc.options, indent+"    ");\r
+        svc.getChildren(ProtoBuf.Reflect.Service.RPCMethod).forEach(function(rpc) {\r
+            if (!options.min)\r
+                out.push(indent+"    ");\r
+            out.push("rpc ", rpc.name, "(", svc.qn(rpc.resolvedRequestType), ") returns(", svc.qn(rpc.resolvedResponseType), ")");\r
+            var keys = Object.keys(rpc.options);\r
+            if (keys.length === 0) {\r
+                out.push(options.min ? ";" : ";\n")\r
+            } else {\r
+                out.push(options.min ? "{" : " {\n");\r
+                buildOptions(rpc.options, indent+"        ");\r
+                trim();\r
+                if (!options.min)\r
+                    out.push(indent+"    ");\r
+                out.push(options.min ? "}" : "}\n");\r
+            }\r
+            if (!options.min)\r
+                out[out.length-1] += "\n";\r
+        });\r
+        trim();\r
+        out.push(options.min ? "}" : "}\n");\r
+    }\r
+\r
+    // Start by building the package namespace\r
+    var pkg = ptr.fqn().substring(1);\r
+    if (pkg !== "")\r
+        out.push("package ", pkg, options.min ? ";" : ";\n\n");\r
+    buildOptions(ptr.options, "");\r
+    buildNamespace(ptr, "");\r
+    return out.join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+proto.description = description;\r
+\r
+/**\r
+ * Converts a JavaScript value to a .proto value.\r
+ * @param {*} v Value\r
+ * @returns {string} Dot proto value\r
+ */\r
+function value(v) {\r
+    switch (typeof v) {\r
+        case 'boolean':\r
+            return v ? 'true' : 'false';\r
+        case 'number':\r
+            return v.toString();\r
+        case 'string':\r
+            return '"'+v.replace(/"/g, '\\"')+'"';\r
+        default:\r
+            throw new Error("illegal value type: "+typeof(v));\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/util.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/cli/pbjs/util.js
new file mode 100644 (file)
index 0000000..26715c1
--- /dev/null
@@ -0,0 +1,128 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var ProtoBuf = require("../../index.js");\r
+\r
+/**\r
+ * Utility namespace.\r
+ * @exports pbjs/util\r
+ * @namespace\r
+ */\r
+var util = module.exports = {};\r
+\r
+/**\r
+ * Extracts builder options with the specified prefix from a set of CLI options.\r
+ * @param {!Object.<string,*>} options CLI options\r
+ * @param {string} prefix Prefix\r
+ * @returns {!Object.<string,*>}\r
+ */\r
+util.getBuilderOptions = function(options, prefix) {\r
+    if (!options[prefix])\r
+        return {};\r
+    var builderOptions = {};\r
+    options[prefix].forEach(function(kv) {\r
+        var key, val;\r
+        var p = kv.indexOf("=");\r
+        if (p < 0) {\r
+            key = kv;\r
+            val = true;\r
+        } else {\r
+            key = kv.substring(0, p);\r
+            val = kv.substring(p+1);\r
+            if (val === "true")\r
+                val = true;\r
+            else if (val === "false")\r
+                val = false;\r
+            else {\r
+                var intval = parseInt(val, 10);\r
+                if (intval == val)\r
+                    val = intval;\r
+            }\r
+        }\r
+        builderOptions[key] = val;\r
+    });\r
+    return builderOptions;\r
+};\r
+\r
+/**\r
+ * Pads a string to the specified length.\r
+ * @param {string} str String to pad\r
+ * @param {number} len Pad length\r
+ * @param {boolean=} left Whether to pad to the left, defaults to `false`\r
+ * @returns {string}\r
+ */\r
+util.pad = function(str, len, left) {\r
+    while (str.length < len)\r
+        left ? str = " "+str : str += " ";\r
+    return str;\r
+};\r
+\r
+/**\r
+ * Indents a string by the specified whitespace.\r
+ * @param {string} str String to indent\r
+ * @param {string|number} ws Whitespace string or number of whitespaces\r
+ * @returns {string}\r
+ */\r
+util.indent = function(str, ws) {\r
+    if (ws === 0 || ws === "")\r
+        return str;\r
+    var lines = str.split(/\r?\n/);\r
+    if (typeof ws === 'number') {\r
+        var n = ws; ws = "";\r
+        while (ws.length < n) ws += " ";\r
+    }\r
+    for (var i=1; i<lines.length; ++i)\r
+        lines[i] = ws+lines[i];\r
+    return lines.join("\n");\r
+};\r
+\r
+/**\r
+ * Extends an object with additional properties.\r
+ * @param {!Object.<string,*>} subject Subject to extend\r
+ * @param {!Object.<string,*>} extension Extensions to apply\r
+ */\r
+util.extend = function(subject, extension) {\r
+    Object.keys(extension).forEach(function(key) {\r
+        subject[key] = extension[key];\r
+    });\r
+};\r
+\r
+/**\r
+ * Groups extensions by extended message.\r
+ * @param {!ProtoBuf.Reflect.Namespace} ns Namespace\r
+ * @returns {?Object.<string,!Array.<!ProtoBuf.Reflect.Message.ExtensionField>>}\r
+ */\r
+util.groupExtensions = function(ns) {\r
+    var exts = {},\r
+        n = 0;\r
+    ns.getChildren(ProtoBuf.Reflect.Extension).forEach(function(ext) {\r
+        var msg = ext.field.parent,\r
+            fqn = msg.fqn();\r
+        if (!exts[fqn])\r
+            exts[fqn] = [];\r
+        exts[fqn].push(ext.field);\r
+        n++;\r
+    });\r
+    return n > 0 ? exts : null;\r
+};\r
+\r
+/**\r
+ * Tests if the specified import name is referencing an internal descriptor.\r
+ * @param {string} name Import name\r
+ * @returns {boolean}\r
+ */\r
+util.isDescriptor = function(name) {\r
+    return /^google\/protobuf\/descriptor/.test(name);\r
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.Message.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.Message.html
new file mode 100644 (file)
index 0000000..c129b8e
--- /dev/null
@@ -0,0 +1,5815 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Message</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Message</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Builder.html">.Builder</a>.</span>
+        
+        Message
+        </h2>
+        
+            <div class="class-description"><p>Barebone of all runtime messages.</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Message"><span class="type-signature"></span>new Message<span class="signature">(values, &hellip;var_args)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new runtime Message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>values</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">!Object.&lt;string, *></span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Preset values</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>var_args</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                    &lt;repeatable><br>
+                
+                </td>
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2375">line 2375</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be created</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".$options"><span class="type-signature">(static) </span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3052">line 3052</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".$type"><span class="type-signature">(static, non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3068">line 3068</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$options"><span class="type-signature"></span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3060">line 3060</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$type"><span class="type-signature">(non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3076">line 3076</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decode"><span class="type-signature">(static) </span>decode<span class="signature">(buffer, length<span class="signature-attributes">opt</span>, enc<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes a message from the specified buffer or string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">ArrayBuffer</span>
+|
+
+<span class="param-type">Buffer</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Buffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>length</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message length. Defaults to decode all the remainig data.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>enc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2928">line 2928</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Message.html#.decode64">ProtoBuf.Builder.Message.decode64</a></li>
+        
+            <li><a href="ProtoBuf.Builder.Message.html#.decodeHex">ProtoBuf.Builder.Message.decodeHex</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decode64"><span class="type-signature">(static) </span>decode64<span class="signature">(str)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes the message from the specified base64 encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>String to decode from</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2995">line 2995</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decodeDelimited"><span class="type-signature">(static) </span>decodeDelimited<span class="signature">(buffer, enc<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes a varint32 length-delimited message from the specified buffer or string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">ArrayBuffer</span>
+|
+
+<span class="param-type">Buffer</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Buffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>enc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2961">line 2961</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message or <code>null</code> if not enough bytes are available yet</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decodeHex"><span class="type-signature">(static) </span>decodeHex<span class="signature">(str)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes the message from the specified hex encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>String to decode from</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3009">line 3009</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decodeJSON"><span class="type-signature">(static) </span>decodeJSON<span class="signature">(str)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes the message from a JSON string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>String to decode from</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3023">line 3023</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are
+missing.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$add"><span class="type-signature"></span>$add<span class="signature">(key, value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a value to a repeated field. This is an alias for <a href="ProtoBuf.Builder.Message.html#add">ProtoBuf.Builder.Message#add</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to add</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to assert the value or not (asserts by default)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2453">line 2453</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be added</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$encode"><span class="type-signature"></span>$encode<span class="signature">(buffer<span class="signature-attributes">opt</span>, noVerify<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to. Will create a new one and flip it if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noVerify</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not verify field values, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2651">line 2651</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Message.html#encode64">ProtoBuf.Builder.Message#encode64</a></li>
+        
+            <li><a href="ProtoBuf.Builder.Message.html#encodeHex">ProtoBuf.Builder.Message#encodeHex</a></li>
+        
+            <li><a href="ProtoBuf.Builder.Message.html#encodeAB">ProtoBuf.Builder.Message#encodeAB</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ByteBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as a ByteBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$get"><span class="type-signature"></span>$get<span class="signature">(key)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a field's value. This is an alias for <a href="ProtoBuf.Builder.Message.html#$get">ProtoBuf.Builder.Message#$get</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Key</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2541">line 2541</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If there is no such field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$set"><span class="type-signature"></span>$set<span class="signature">(keyOrObj, value<span class="signature-attributes">opt</span>, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>keyOrObj</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>String key or plain object holding multiple values</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set if key is a string, otherwise omitted</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert the value, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2508">line 2508</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(key, value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a value to a repeated field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to add</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to assert the value or not (asserts by default)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2425">line 2425</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be added</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates the byte length of the message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2695">line 2695</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be calculated or if required fields are missing.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode64"><span class="type-signature"></span>encode64<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to a base64 encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2788">line 2788</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the underlying buffer cannot be encoded or if required fields are missing. The later
+ still returns the encoded base64 string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Base64 encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeAB"><span class="type-signature"></span>encodeAB<span class="signature">()</span><span class="type-signature"> &rarr; {ArrayBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to an ArrayBuffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2730">line 2730</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ArrayBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as ArrayBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ArrayBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeDelimited"><span class="type-signature"></span>encodeDelimited<span class="signature">(buffer<span class="signature-attributes">opt</span>, noVerify<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the varint32 length-delimited message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to. Will create a new one and flip it if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noVerify</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not verify field values, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2707">line 2707</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ByteBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as a ByteBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeHex"><span class="type-signature"></span>encodeHex<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to a hex encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2817">line 2817</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the underlying buffer cannot be encoded or if required fields are missing. The later
+ still returns the encoded hex string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Hex encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeJSON"><span class="type-signature"></span>encodeJSON<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes a message to JSON.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2918">line 2918</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>JSON string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeNB"><span class="type-signature"></span>encodeNB<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Buffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to a node Buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2759">line 2759</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded, not running under node.js or if required fields are
+ missing. The later still returns the encoded node Buffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Buffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(key, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a field's value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Key</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert for an actual field, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2520">line 2520</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If there is no such field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="get%5BSomeField%5D"><span class="type-signature">(abstract) </span>get[SomeField]<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2625">line 2625</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="get_%5Bsome_field%5D"><span class="type-signature">(abstract) </span>get_[some_field]<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2636">line 2636</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(keyOrObj, value<span class="signature-attributes">opt</span>, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a field's value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>keyOrObj</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>String key or plain object holding multiple values</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set if key is a string, otherwise omitted</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert for an actual field / proper value type, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2466">line 2466</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="set%5BSomeField%5D"><span class="type-signature">(abstract) </span>set[SomeField]<span class="signature">(value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert the value, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2597">line 2597</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="set_%5Bsome_field%5D"><span class="type-signature">(abstract) </span>set_[some_field]<span class="signature">(value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert the value, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2611">line 2611</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toArrayBuffer"><span class="type-signature"></span>toArrayBuffer<span class="signature">()</span><span class="type-signature"> &rarr; {ArrayBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as an ArrayBuffer. This is an alias for <a href="ProtoBuf.Builder.Message.html#encodeAB">ProtoBuf.Builder.Message#encodeAB</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2748">line 2748</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ArrayBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as ArrayBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ArrayBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toBase64"><span class="type-signature"></span>toBase64<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as a base64 encoded string. This is an alias for <a href="ProtoBuf.Builder.Message.html#encode64">ProtoBuf.Builder.Message#encode64</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2806">line 2806</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded base64 string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Base64 encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toBuffer"><span class="type-signature"></span>toBuffer<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Buffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as a node Buffer. This is an alias for <a href="ProtoBuf.Builder.Message.html#encodeNB">ProtoBuf.Builder.Message#encodeNB</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2777">line 2777</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded node Buffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Buffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toHex"><span class="type-signature"></span>toHex<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as a hex encoded string. This is an alias for <a href="ProtoBuf.Builder.Message.html#encodeHex">ProtoBuf.Builder.Message#encodeHex</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2835">line 2835</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded hex string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Hex encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toRaw"><span class="type-signature"></span>toRaw<span class="signature">(binaryAsBase64<span class="signature-attributes">opt</span>, longsAsStrings)</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message's raw payload.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>binaryAsBase64</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to include binary data as base64 strings instead of Buffers, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>longsAsStrings</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to encode longs as strings</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2909">line 2909</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Raw payload</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3039">line 3039</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation as of &quot;.Fully.Qualified.MessageName&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.Service.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.Service.html
new file mode 100644 (file)
index 0000000..85a5262
--- /dev/null
@@ -0,0 +1,961 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Service</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Service</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Builder.html">.Builder</a>.</span>
+        
+        Service
+        </h2>
+        
+            <div class="class-description"><p>Barebone of all runtime services.</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Service"><span class="type-signature"></span>new Service<span class="signature">(rpcImpl<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new runtime Service.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rpcImpl</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>RPC implementation receiving the method name and the message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4005">line 4005</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the service cannot be created</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".$options"><span class="type-signature">(static) </span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Service options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4108">line 4108</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".$type"><span class="type-signature">(static, non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4124">line 4124</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$options"><span class="type-signature"></span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Service options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4116">line 4116</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$type"><span class="type-signature">(non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4132">line 4132</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="rpcImpl"><span class="type-signature">(non-null) </span>rpcImpl<span class="type-signature"> :function</span></h4>
+
+
+
+
+<div class="description">
+    <p>Service implementation.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4016">line 4016</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".%5BMethod%5D"><span class="type-signature">(abstract, static) </span>[Method]<span class="signature">(rpcImpl<span class="signature-attributes">non-null</span>, req, callback)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Asynchronously performs an RPC call using the given RPC implementation.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rpcImpl</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>RPC implementation</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>req</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Request</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Callback receiving
+ the error if any and the response either as a pre-parsed message or as its raw bytes</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4036">line 4036</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="%5BMethod%5D"><span class="type-signature">(abstract) </span>[Method]<span class="signature">(req, callback)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Asynchronously performs an RPC call using the instance's RPC implementation.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>req</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Request</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Callback receiving
+ the error if any and the response either as a pre-parsed message or as its raw bytes</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4047">line 4047</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Builder.html
new file mode 100644 (file)
index 0000000..9a5a4ee
--- /dev/null
@@ -0,0 +1,2800 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Builder</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Builder</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Builder
+        </h2>
+        
+            <div class="class-description"><p>Provides the functionality to build protocol messages.</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Builder"><span class="type-signature"></span>new Builder<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4295">line 4295</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Builder.Message.html">Message</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Builder.Service.html">Service</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="files"><span class="type-signature"></span>files<span class="type-signature"> :Array.&lt;string></span></h4>
+
+
+
+
+<div class="description">
+    <p>Imported files.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;string></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4330">line 4330</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="importRoot"><span class="type-signature">(nullable) </span>importRoot<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Import root override.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4337">line 4337</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="ns"><span class="type-signature"></span>ns<span class="type-signature"> :<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4302">line 4302</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4344">line 4344</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="ptr"><span class="type-signature"></span>ptr<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Namespace pointer.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4309">line 4309</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolved"><span class="type-signature"></span>resolved<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4316">line 4316</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="result"><span class="type-signature"></span>result<span class="type-signature"> :Object.&lt;string, (<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>|Object)>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>The current building result.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, (<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>|Object)></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4323">line 4323</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isEnum"><span class="type-signature">(static) </span>isEnum<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes an enum.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4390">line 4390</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isExtend"><span class="type-signature">(static) </span>isExtend<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes an extended message</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4419">line 4419</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isMessage"><span class="type-signature">(static) </span>isMessage<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes a message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4361">line 4361</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isMessageField"><span class="type-signature">(static) </span>isMessageField<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes a message field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4377">line 4377</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isService"><span class="type-signature">(static) </span>isService<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes a service.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4406">line 4406</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="%22import%22%5D"><span class="type-signature"></span>"import"]<span class="signature">(json, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Imports another definition into this builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>json</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parsed import</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Imported file name</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4640">line 4640</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition or file cannot be imported</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(path<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>|!Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the protocol. This will first try to resolve all definitions and, if this has been successful,
+return the built package.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>path</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Specifies what to return. If omitted, the entire namespace will be returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4853">line 4853</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If a type could not be resolved</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+|
+
+<span class="param-type">!Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">(defs<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Creates the specified definitions at the current pointer position.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>defs</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Array.&lt;!Object></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Messages, enums or services to create</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4463">line 4463</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If a message definition is invalid</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="define"><span class="type-signature"></span>define<span class="signature">(namespace)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Defines a namespace on top of the current pointer position and places the pointer on it.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>namespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4444">line 4444</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="lookup"><span class="type-signature"></span>lookup<span class="signature">(path<span class="signature-attributes">opt</span>, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Similar to <a href="ProtoBuf.Builder.html#build">ProtoBuf.Builder#build</a>, but looks up the internal reflection descriptor.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>path</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Specifies what to return. If omitted, the entire namespace wiil be returned.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types like fields, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4881">line 4881</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Reflection descriptor or <code>null</code> if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="reset"><span class="type-signature"></span>reset<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resets the pointer to the root namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4433">line 4433</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolveAll"><span class="type-signature"></span>resolveAll<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves all namespace objects.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4769">line 4769</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If a type cannot be resolved</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4890">line 4890</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation as of &quot;Builder&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.Parser.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.Parser.html
new file mode 100644 (file)
index 0000000..81cdf38
--- /dev/null
@@ -0,0 +1,729 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Parser</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Parser</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.DotProto.html">.DotProto</a>.</span>
+        
+        Parser
+        </h2>
+        
+            <div class="class-description"><p>prototype parser</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Parser"><span class="type-signature"></span>new Parser<span class="signature">(source)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Parser.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>source</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Source</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line688">line 688</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="proto3"><span class="type-signature"></span>proto3<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether parsing proto3 or not.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line701">line 701</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="tn"><span class="type-signature">(non-null) </span>tn<span class="type-signature"> :<a href="ProtoBuf.DotProto.Tokenizer.html">ProtoBuf.DotProto.Tokenizer</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Tokenizer.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.DotProto.Tokenizer.html">ProtoBuf.DotProto.Tokenizer</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line695">line 695</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".parse"><span class="type-signature">(static) </span>parse<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Object}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Parses the specified source.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line796">line 796</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the source cannot be parsed</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Object}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Parses the source.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line716">line 716</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the source cannot be parsed</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this parser.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1373">line 1373</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.Tokenizer.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.Tokenizer.html
new file mode 100644 (file)
index 0000000..8ad8727
--- /dev/null
@@ -0,0 +1,1140 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Tokenizer</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Tokenizer</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.DotProto.html">.DotProto</a>.</span>
+        
+        Tokenizer
+        </h2>
+        
+            <div class="class-description"><p>prototype tokenizer</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Tokenizer"><span class="type-signature"></span>new Tokenizer<span class="signature">(proto)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Tokenizer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>proto</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Proto to tokenize</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line495">line 495</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="index"><span class="type-signature"></span>index<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Current index.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line509">line 509</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="line"><span class="type-signature"></span>line<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Current line.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line516">line 516</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="source"><span class="type-signature"></span>source<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Source to parse.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line502">line 502</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="stack"><span class="type-signature">(non-null) </span>stack<span class="type-signature"> :Array.&lt;string></span></h4>
+
+
+
+
+<div class="description">
+    <p>Token stack.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;string></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line523">line 523</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the next token and advances by one.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line563">line 563</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Token or <code>null</code> on EOF</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="omit"><span class="type-signature"></span>omit<span class="signature">(expected)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Omits an optional token.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>expected</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Expected optional token</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line658">line 658</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p><code>true</code> if the token exists</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="peek"><span class="type-signature"></span>peek<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Peeks for the next token.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line632">line 632</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Token or <code>null</code> on EOF</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="skip"><span class="type-signature"></span>skip<span class="signature">(expected)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Skips a specific token and throws if it differs.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>expected</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Expected token</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line647">line 647</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the actual token differs</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line671">line 671</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation as of &quot;Tokenizer(index/length)&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.DotProto.html
new file mode 100644 (file)
index 0000000..744f956
--- /dev/null
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: DotProto</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: DotProto</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        DotProto
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>Utilities to parse .proto files.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line486">line 486</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.DotProto.Parser.html">Parser</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Element.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Element.html
new file mode 100644 (file)
index 0000000..24ef9bb
--- /dev/null
@@ -0,0 +1,555 @@
+<!DOCTYPE html>\r
+<html lang="en">\r
+<head>\r
+    <meta charset="utf-8">\r
+    <title>JSDoc: Class: Element</title>\r
+\r
+    <script src="scripts/prettify/prettify.js"> </script>\r
+    <script src="scripts/prettify/lang-css.js"> </script>\r
+    <!--[if lt IE 9]>\r
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>\r
+    <![endif]-->\r
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">\r
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">\r
+</head>\r
+\r
+<body>\r
+\r
+<div id="main">\r
+\r
+    <h1 class="page-title">Class: Element</h1>\r
+\r
+    \r
+\r
+\r
+\r
+<section>\r
+\r
+<header>\r
+    <h2>\r
+        <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>\r
+    \r
+    Element\r
+    </h2>\r
+    \r
+</header>\r
+\r
+<article>\r
+    <div class="container-overview">\r
+    \r
+\r
+    \r
+        \r
+<dt>\r
+    <h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax)</span><span class="type-signature"></span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+\r
+    \r
+    <div class="description">\r
+        <p>Constructs a new Element implementation that checks and converts values for a\r
+particular field type, as appropriate.</p>\r
+<p>An Element represents a single value: either the value of a singular field,\r
+or a value contained in one entry of a repeated field or map field. This\r
+class does not implement these higher-level concepts; it only encapsulates\r
+the low-level typechecking and conversion.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+        <h5>Parameters:</h5>\r
+        \r
+\r
+<table class="params">\r
+    <thead>\r
+    <tr>\r
+        \r
+        <th>Name</th>\r
+        \r
+\r
+        <th>Type</th>\r
+\r
+        \r
+\r
+        \r
+\r
+        <th class="last">Description</th>\r
+    </tr>\r
+    </thead>\r
+\r
+    <tbody>\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>type</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type"><a href="Object.html">Object</a></span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Resolved data type</p></td>\r
+        </tr>\r
+\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>resolvedType</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>\r
+|\r
+\r
+<span class="param-type">null</span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Resolved type, if relevant\r
+(e.g. submessage field).</p></td>\r
+        </tr>\r
+\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>isMapKey</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type">boolean</span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Is this element a Map key? The value will be\r
+converted to string form if so.</p></td>\r
+        </tr>\r
+\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>syntax</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type">string</span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Syntax level of defining message type, e.g.,\r
+proto2 or proto3.</p></td>\r
+        </tr>\r
+\r
+    \r
+    </tbody>\r
+</table>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3754">line 3754</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+    \r
+    </div>\r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+     \r
+\r
+    \r
+\r
+    \r
+        <h3 class="subsection-title">Members</h3>\r
+\r
+        <dl>\r
+            \r
+<dt>\r
+    <h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Element is a map key.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type">boolean</span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3771">line 3771</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        \r
+            \r
+<dt>\r
+    <h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Element type reference to submessage or enum definition, if needed.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>\r
+|\r
+\r
+<span class="param-type">null</span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3765">line 3765</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        \r
+            \r
+<dt>\r
+    <h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Syntax level of defining message type, e.g., proto2 or proto3.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type">string</span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3777">line 3777</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        \r
+            \r
+<dt>\r
+    <h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :<a href="Object.html">Object</a></span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Element type, as a string (e.g., int32).</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type"><a href="Object.html">Object</a></span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3759">line 3759</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        </dl>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</article>\r
+\r
+</section>\r
+\r
+\r
+\r
+\r
+</div>\r
+\r
+<nav>\r
+    <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Element.html">Element</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>\r
+</nav>\r
+\r
+<br clear="both">\r
+\r
+<footer>\r
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Mon Jun 01 2015 01:15:14 GMT+0200 (Mitteleuropäische Sommerzeit)\r
+</footer>\r
+\r
+<script> prettyPrint(); </script>\r
+<script src="scripts/linenumber.js"> </script>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Map.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Map.html
new file mode 100644 (file)
index 0000000..bf81c46
--- /dev/null
@@ -0,0 +1,561 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Map</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Map</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Map
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Map"><span class="type-signature"></span>new Map<span class="signature">(field<span class="signature-attributes">non-null</span>, contents<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Map. A Map is a container that is used to implement map
+fields on message objects. It closely follows the ES6 Map API; however,
+it is distinct because we do not want to depend on external polyfills or
+on ES6 itself.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>field</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ProtoBuf.Reflect.Field</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Map field</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>contents</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Initial contents</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4934">line 4934</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="field"><span class="type-signature">(non-null) </span>field<span class="type-signature"> :ProtoBuf.Reflect.Field</span></h4>
+
+
+
+
+<div class="description">
+    <p>The field corresponding to this map.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Reflect.Field</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4942">line 4942</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyElem"><span class="type-signature">(non-null) </span>keyElem<span class="type-signature"> :<a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Element instance corresponding to key type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4948">line 4948</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="map"><span class="type-signature">(non-null) </span>map<span class="type-signature"> :Object.&lt;string, {key: *, value: *}></span></h4>
+
+
+
+
+<div class="description">
+    <p>Internal map: stores mapping of (string form of key) -&gt; (key, value)
+pair.</p>
+<p>We provide map semantics for arbitrary key types, but we build on top
+of an Object, which has only string keys. In order to avoid the need
+to convert a string key back to its native type in many situations,
+we store the native key value alongside the value. Thus, we only need
+a one-way mapping from a key type to its string form that guarantees
+uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1
+=== K2).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, {key: *, value: *}></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4970">line 4970</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="valueElem"><span class="type-signature">(non-null) </span>valueElem<span class="type-signature"> :<a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Element instance corresponding to value type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4954">line 4954</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Element.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Element.html
new file mode 100644 (file)
index 0000000..b1ab780
--- /dev/null
@@ -0,0 +1,846 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Element</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Element</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Element
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax, name)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Element implementation that checks and converts values for a
+particular field type, as appropriate.</p>
+<p>An Element represents a single value: either the value of a singular field,
+or a value contained in one entry of a repeated field or map field. This
+class does not implement these higher-level concepts; it only encapsulates
+the low-level typechecking and conversion.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Resolved data type</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>resolvedType</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Resolved type, if relevant
+(e.g. submessage field).</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>isMapKey</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Is this element a Map key? The value will be
+converted to string form if so.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Syntax level of defining message type, e.g.,
+proto2 or proto3.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Name of the field containing this element (for error
+messages)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1720">line 1720</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element is a map key.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1738">line 1738</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Name of the field containing this element (for error messages)</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1750">line 1750</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element type reference to submessage or enum definition, if needed.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1732">line 1732</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level of defining message type, e.g., proto2 or proto3.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1744">line 1744</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :Object</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element type, as a string (e.g., int32).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1726">line 1726</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".defaultFieldValue"><span class="type-signature">(static) </span>defaultFieldValue<span class="signature">(type)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the default value for this field in proto3.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>the field type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1780">line 1780</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Default value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.Value.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.Value.html
new file mode 100644 (file)
index 0000000..a88498f
--- /dev/null
@@ -0,0 +1,1066 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Value</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Value</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Enum.html">.Enum</a>.</span>
+        
+        Value
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Value"><span class="type-signature"></span>new Value<span class="signature">(builder<span class="signature-attributes">non-null</span>, enm<span class="signature-attributes">non-null</span>, name, id)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Enum Value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>enm</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Enum.html">ProtoBuf.Reflect.Enum</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Enum reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>id</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Unique field id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3905">line 3905</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Unique enum value id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3918">line 3918</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html
new file mode 100644 (file)
index 0000000..366a0ab
--- /dev/null
@@ -0,0 +1,2722 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Enum</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Enum</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Enum
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Enum"><span class="type-signature"></span>new Enum<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Enum.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parent Reflect object</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Enum name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Enum options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3831">line 3831</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="object"><span class="type-signature"></span>object<span class="type-signature"> :Object.&lt;string, number>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Runtime enum object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, number></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3844">line 3844</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".getName"><span class="type-signature">(static) </span>getName<span class="signature">(enm<span class="signature-attributes">non-null</span>, value)</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the string name of an enum value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>enm</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ProtoBuf.Builder.Enum</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime enum</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Enum value</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3854">line 3854</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Name or <code>null</code> if not present</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild)</span><span class="type-signature"> &rarr; (non-null) {Object.&lt;string, number>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this enum and returns the runtime counterpart.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rebuild</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Whether to rebuild or not, defaults to false</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3874">line 3874</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, number></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Extension.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Extension.html
new file mode 100644 (file)
index 0000000..29afcb1
--- /dev/null
@@ -0,0 +1,360 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Extension</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Extension</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Extension
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Extension"><span class="type-signature"></span>new Extension<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, field<span class="signature-attributes">non-null</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>An extension (field).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Parent object</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Object name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>field</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Extension field</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3939">line 3939</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="field"><span class="type-signature">(non-null) </span>field<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Extended message field.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3947">line 3947</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.ExtensionField.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.ExtensionField.html
new file mode 100644 (file)
index 0000000..259cc9c
--- /dev/null
@@ -0,0 +1,3376 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: ExtensionField</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: ExtensionField</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Message.html">.Message</a>.</span>
+        
+        ExtensionField
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="ExtensionField"><span class="type-signature"></span>new ExtensionField<span class="signature">(builder<span class="signature-attributes">non-null</span>, message<span class="signature-attributes">non-null</span>, rule, type, name, id, options<span class="signature-attributes">opt, non-null</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message ExtensionField.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>rule</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Rule, one of requried, optional, repeated</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Data type, e.g. int32</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>id</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Unique field id</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3774">line 3774</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="defaultValue"><span class="type-signature"></span>defaultValue<span class="type-signature"> :*</span></h4>
+
+
+
+
+<div class="description">
+    <p>Default value.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">*</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#defaultValue">ProtoBuf.Reflect.Message.Field#defaultValue</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3384">line 3384</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="element"><span class="type-signature"></span>element<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element implementation. Created in build() after types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#element">ProtoBuf.Reflect.Message.Field#element</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3412">line 3412</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="extension"><span class="type-signature">(non-null) </span>extension<span class="type-signature"> :<a href="ProtoBuf.Reflect.Extension.html">ProtoBuf.Reflect.Extension</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Extension reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Extension.html">ProtoBuf.Reflect.Extension</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3782">line 3782</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Unique message field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#id">ProtoBuf.Reflect.Message.Field#id</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3369">line 3369</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyElement"><span class="type-signature"></span>keyElement<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Key element implementation, for map fields. Created in build() after
+types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#keyElement">ProtoBuf.Reflect.Message.Field#keyElement</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3420">line 3420</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyType"><span class="type-signature"></span>keyType<span class="type-signature"> :string|Object|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field key type. Type reference string if unresolved, protobuf
+type if resolved. Valid only if this.map === true, null otherwise.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#keyType">ProtoBuf.Reflect.Message.Field#keyType</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3347">line 3347</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="map"><span class="type-signature"></span>map<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field map flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#map">ProtoBuf.Reflect.Message.Field#map</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3339">line 3339</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="oneof"><span class="type-signature">(nullable) </span>oneof<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Enclosing OneOf.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#oneof">ProtoBuf.Reflect.Message.Field#oneof</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3391">line 3391</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#options">ProtoBuf.Reflect.Message.Field#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3377">line 3377</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="originalName"><span class="type-signature"></span>originalName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Original field name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#originalName">ProtoBuf.Reflect.Message.Field#originalName</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3405">line 3405</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="repeated"><span class="type-signature"></span>repeated<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field repeated flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#repeated">ProtoBuf.Reflect.Message.Field#repeated</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3332">line 3332</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="required"><span class="type-signature"></span>required<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field required flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#required">ProtoBuf.Reflect.Message.Field#required</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3325">line 3325</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved type reference inside the global namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#resolvedType">ProtoBuf.Reflect.Message.Field#resolvedType</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3362">line 3362</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level of this definition (e.g., proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#syntax">ProtoBuf.Reflect.Message.Field#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3398">line 3398</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :string|Object</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field type. Type reference string if unresolved, protobuf type if
+resolved. In a map field, this is the value type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#type">ProtoBuf.Reflect.Message.Field#type</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3355">line 3355</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates the length of this field's value on the network level.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#calculate">ProtoBuf.Reflect.Message.Field#calculate</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3635">line 3635</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(wireType, buffer, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decode the field value from the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>wireType</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Leading wire type</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#decode">ProtoBuf.Reflect.Message.Field#decode</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3693">line 3693</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be decoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded value: array for packed repeated fields, [key, value] for
+            map fields, or an individual value otherwise.</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(value, buffer, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the specified field value to the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#encode">ProtoBuf.Reflect.Message.Field#encode</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3561">line 3561</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be encoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The ByteBuffer for chaining</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="hasWirePresence"><span class="type-signature"></span>hasWirePresence<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines whether the field will have a presence on the wire given its
+value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#hasWirePresence">ProtoBuf.Reflect.Message.Field#hasWirePresence</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3509">line 3509</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Whether the field will be present on the wire</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="verifyValue"><span class="type-signature"></span>verifyValue<span class="signature">(value, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Checks if the given value can be set for this field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to check</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated value check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#verifyValue">ProtoBuf.Reflect.Message.Field#verifyValue</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3461">line 3461</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set for this field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Verified, maybe adjusted, value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.Field.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.Field.html
new file mode 100644 (file)
index 0000000..f9c678b
--- /dev/null
@@ -0,0 +1,3308 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Field</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Field</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Message.html">.Message</a>.</span>
+        
+        Field
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Field"><span class="type-signature"></span>new Field<span class="signature">(builder<span class="signature-attributes">non-null</span>, message<span class="signature-attributes">non-null</span>, rule, keytype<span class="signature-attributes">nullable</span>, type, name, id, options<span class="signature-attributes">opt</span>, oneof<span class="signature-attributes">opt, non-null</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message Field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>rule</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Rule, one of requried, optional, repeated</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>keytype</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Key data type, if any.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Data type, e.g. int32</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>id</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Unique field id</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>oneof</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Enclosing OneOf</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level of this definition (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3312">line 3312</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="defaultValue"><span class="type-signature"></span>defaultValue<span class="type-signature"> :*</span></h4>
+
+
+
+
+<div class="description">
+    <p>Default value.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">*</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3384">line 3384</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="element"><span class="type-signature"></span>element<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element implementation. Created in build() after types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3412">line 3412</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Unique message field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3369">line 3369</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyElement"><span class="type-signature"></span>keyElement<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Key element implementation, for map fields. Created in build() after
+types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3420">line 3420</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyType"><span class="type-signature"></span>keyType<span class="type-signature"> :string|Object|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field key type. Type reference string if unresolved, protobuf
+type if resolved. Valid only if this.map === true, null otherwise.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3347">line 3347</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="map"><span class="type-signature"></span>map<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field map flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3339">line 3339</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="oneof"><span class="type-signature">(nullable) </span>oneof<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Enclosing OneOf.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3391">line 3391</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3377">line 3377</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="originalName"><span class="type-signature"></span>originalName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Original field name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3405">line 3405</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="repeated"><span class="type-signature"></span>repeated<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field repeated flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3332">line 3332</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="required"><span class="type-signature"></span>required<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field required flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3325">line 3325</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved type reference inside the global namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3362">line 3362</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level of this definition (e.g., proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3398">line 3398</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :string|Object</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field type. Type reference string if unresolved, protobuf type if
+resolved. In a map field, this is the value type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3355">line 3355</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates the length of this field's value on the network level.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3635">line 3635</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(wireType, buffer, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decode the field value from the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>wireType</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Leading wire type</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3693">line 3693</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be decoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded value: array for packed repeated fields, [key, value] for
+            map fields, or an individual value otherwise.</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(value, buffer, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the specified field value to the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3561">line 3561</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be encoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The ByteBuffer for chaining</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="hasWirePresence"><span class="type-signature"></span>hasWirePresence<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines whether the field will have a presence on the wire given its
+value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3509">line 3509</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Whether the field will be present on the wire</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="verifyValue"><span class="type-signature"></span>verifyValue<span class="signature">(value, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Checks if the given value can be set for this field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to check</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated value check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3461">line 3461</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set for this field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Verified, maybe adjusted, value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.OneOf.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.OneOf.html
new file mode 100644 (file)
index 0000000..9c8d042
--- /dev/null
@@ -0,0 +1,1043 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: OneOf</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: OneOf</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Message.html">.Message</a>.</span>
+        
+        OneOf
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="OneOf"><span class="type-signature"></span>new OneOf<span class="signature">(builder<span class="signature-attributes">non-null</span>, message<span class="signature-attributes">non-null</span>, name)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message OneOf.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Message reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>OneOf name</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3803">line 3803</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="fields"><span class="type-signature">(non-null) </span>fields<span class="type-signature"> :Array.&lt;!<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Enclosed fields.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;!<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3811">line 3811</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.html
new file mode 100644 (file)
index 0000000..48292bc
--- /dev/null
@@ -0,0 +1,3477 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Message</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Message</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Message
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Message"><span class="type-signature"></span>new Message<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>, isGroup<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parent message or namespace</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>isGroup</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p><code>true</code> if this is a legacy group</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level of this definition (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2298">line 2298</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="clazz"><span class="type-signature">(nullable) </span>clazz<span class="type-signature"> :function</span></h4>
+
+
+
+
+<div class="description">
+    <p>Runtime message class.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2318">line 2318</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="extensions"><span class="type-signature"></span>extensions<span class="type-signature"> :!Array.&lt;number>|undefined</span></h4>
+
+
+
+
+<div class="description">
+    <p>Extensions range.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">!Array.&lt;number></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2311">line 2311</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="isGroup"><span class="type-signature"></span>isGroup<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether this is a legacy group or not.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2325">line 2325</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the message and returns the runtime counterpart, which is a fully functional class.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rebuild</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to rebuild or not, defaults to false</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2365">line 2365</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Message class</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">(message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates a runtime message's byte length.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message to encode</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3156">line 3156</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If required fields are missing or the message cannot be calculated for another reason</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(buffer, length<span class="signature-attributes">opt</span>, expectedGroupEndId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes an encoded message and returns the decoded message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>length</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message length. Defaults to decode all remaining data.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>expectedGroupEndId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Expected GROUPEND id if this is a legacy group</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3218">line 3218</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(message<span class="signature-attributes">non-null</span>, buffer, noVerify<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes a runtime message's contents to the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Runtime message to encode</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to write to</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noVerify</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not verify field values, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3129">line 3129</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If required fields are missing or the message cannot be encoded for another reason</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The ByteBuffer for chaining</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Namespace.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Namespace.html
new file mode 100644 (file)
index 0000000..6fce414
--- /dev/null
@@ -0,0 +1,2371 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Namespace</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Namespace</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Namespace
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Namespace"><span class="type-signature"></span>new Namespace<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">nullable</span>, name, options<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Namespace parent</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Namespace name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Namespace options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level of this definition (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1500">line 1500</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, (function()|Object)>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace and returns the runtime counterpart.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1648">line 1648</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Runtime namespace</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, (function()|Object)></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.Method.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.Method.html
new file mode 100644 (file)
index 0000000..72a5ed3
--- /dev/null
@@ -0,0 +1,1202 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Method</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Method</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Service.html">.Service</a>.</span>
+        
+        Method
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Method"><span class="type-signature"></span>new Method<span class="signature">(builder<span class="signature-attributes">non-null</span>, svc<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Abstract service method.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>svc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Service</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Method name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4167">line 4167</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature"></span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4180">line 4180</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the method's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4189">line 4189</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.RPCMethod.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.RPCMethod.html
new file mode 100644 (file)
index 0000000..e58dc69
--- /dev/null
@@ -0,0 +1,1768 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: RPCMethod</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: RPCMethod</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Service.html">.Service</a>.</span>
+        
+        RPCMethod
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="RPCMethod"><span class="type-signature"></span>new RPCMethod<span class="signature">(builder<span class="signature-attributes">non-null</span>, svc<span class="signature-attributes">non-null</span>, name, request, response, request_stream, response_stream, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>RPC service method.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>svc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Service</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Method name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>request</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Request message name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>response</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Response message name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>request_stream</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether requests are streamed</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>response_stream</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether responses are streamed</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4217">line 4217</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Service.Method.html">ProtoBuf.Reflect.Service.Method</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Service.Method.html#className">ProtoBuf.Reflect.Service.Method#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature"></span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Service.Method.html#options">ProtoBuf.Reflect.Service.Method#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4180">line 4180</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="requestName"><span class="type-signature"></span>requestName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Request message name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4230">line 4230</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="requestStream"><span class="type-signature"></span>requestStream<span class="type-signature"> :bool</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether requests are streamed</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">bool</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4244">line 4244</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedRequestType"><span class="type-signature"></span>resolvedRequestType<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved request message type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4258">line 4258</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedResponseType"><span class="type-signature"></span>resolvedResponseType<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved response message type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4265">line 4265</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="responseName"><span class="type-signature"></span>responseName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Response message name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4237">line 4237</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="responseStream"><span class="type-signature"></span>responseStream<span class="type-signature"> :bool</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether responses are streamed</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">bool</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4251">line 4251</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the method's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Service.Method.html#buildOpt">ProtoBuf.Reflect.Service.Method#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4189">line 4189</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.html
new file mode 100644 (file)
index 0000000..8cb30c6
--- /dev/null
@@ -0,0 +1,2565 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Service</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Service</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Service
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Service"><span class="type-signature"></span>new Service<span class="signature">(builder<span class="signature-attributes">non-null</span>, root<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Service.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>root</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Root</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Service name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3969">line 3969</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="clazz"><span class="type-signature">(nullable) </span>clazz<span class="type-signature"> :function</span></h4>
+
+
+
+
+<div class="description">
+    <p>Built runtime service class.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3981">line 3981</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {function}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the service and returns the runtime counterpart, which is a fully functional class.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rebuild</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to rebuild or not</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3998">line 3998</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Service.html">ProtoBuf.Builder.Service</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Service class</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">function</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html
new file mode 100644 (file)
index 0000000..bf94703
--- /dev/null
@@ -0,0 +1,953 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: T</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: T</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        T
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="T"><span class="type-signature">(abstract) </span>new T<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">nullable</span>, name)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a Reflect base class.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parent object</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Object name</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1410">line 1410</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Reflect.html
new file mode 100644 (file)
index 0000000..7bc4751
--- /dev/null
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: Reflect</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: Reflect</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Reflect
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>Reflection types.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1399">line 1399</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Element.html">Element</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Enum.html">Enum</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Extension.html">Extension</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Message.html">Message</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Service.html">Service</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.T.html">T</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Util.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.Util.html
new file mode 100644 (file)
index 0000000..46a958c
--- /dev/null
@@ -0,0 +1,692 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: Util</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: Util</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Util
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>ProtoBuf utilities.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line304">line 304</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".IS_NODE"><span class="type-signature">(static, constant) </span>IS_NODE<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Flag if running in node or not.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line312">line 312</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".fetch"><span class="type-signature">(static) </span>fetch<span class="signature">(path, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Fetches a resource.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>path</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Resource path</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback receiving the resource's contents. If omitted the resource will
+  be fetched synchronously. If the request failed, contents will be null.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line350">line 350</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Resource contents if callback is omitted (null if the request failed), else undefined.</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".toCamelCase"><span class="type-signature">(static) </span>toCamelCase<span class="signature">(str)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Converts a string to camel case.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line400">line 400</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".XHR"><span class="type-signature">(static) </span>XHR<span class="signature">()</span><span class="type-signature"> &rarr; {XMLHttpRequest}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a XMLHttpRequest object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line322">line 322</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If XMLHttpRequest is not supported</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">XMLHttpRequest</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.html
new file mode 100644 (file)
index 0000000..855809c
--- /dev/null
@@ -0,0 +1,3209 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: ProtoBuf</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: ProtoBuf</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+        ProtoBuf
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>The ProtoBuf namespace.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line40">line 40</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Builder.html">Builder</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Map.html">Map</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+        <h3 class="subsection-title">Namespaces</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.DotProto.html">DotProto</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.html">Reflect</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Util.html">Util</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".ByteBuffer"><span class="type-signature">(static, non-null) </span>ByteBuffer<span class="type-signature"> :function</span></h4>
+
+
+
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line46">line 46</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".convertFieldsToCamelCase"><span class="type-signature">(static) </span>convertFieldsToCamelCase<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>If set to <code>true</code>, field names will be converted from underscore notation to camel case. Defaults to <code>false</code>.
+ Must be set prior to parsing.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line274">line 274</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".ID_MAX"><span class="type-signature">(static, constant) </span>ID_MAX<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Maximum field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line266">line 266</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".ID_MIN"><span class="type-signature">(static, constant) </span>ID_MIN<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Minimum field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line258">line 258</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".Lang"><span class="type-signature">(static, non-null) </span>Lang<span class="type-signature"> :Object.&lt;string, !RegExp></span></h4>
+
+
+
+
+<div class="description">
+    <p>Language expressions.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, !RegExp></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line414">line 414</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".Long"><span class="type-signature">(static, nullable) </span>Long<span class="type-signature"> :function</span></h4>
+
+
+
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line52">line 52</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".MAP_KEY_TYPES"><span class="type-signature">(static, constant, non-null) </span>MAP_KEY_TYPES<span class="type-signature"> :Array.&lt;!Object.&lt;string, {name: string, wireType: number, defaultValue: *}>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Valid map key types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;!Object.&lt;string, {name: string, wireType: number, defaultValue: *}>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line236">line 236</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".PACKABLE_WIRE_TYPES"><span class="type-signature">(static, constant, non-null) </span>PACKABLE_WIRE_TYPES<span class="type-signature"> :Array.&lt;number></span></h4>
+
+
+
+
+<div class="description">
+    <p>Packable wire types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;number></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line123">line 123</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".populateAccessors"><span class="type-signature">(static) </span>populateAccessors<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by
+ setting this to <code>false</code> prior to building messages.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line282">line 282</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".populateDefaults"><span class="type-signature">(static) </span>populateDefaults<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>By default, messages are populated with default values if a field is not present on the wire. To disable
+ this behavior, set this setting to <code>false</code>.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line290">line 290</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".TYPES"><span class="type-signature">(static, constant, non-null) </span>TYPES<span class="type-signature"> :Object.&lt;string, {name: string, wireType: number, defaultValue: *}></span></h4>
+
+
+
+
+<div class="description">
+    <p>Types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, {name: string, wireType: number, defaultValue: *}></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line136">line 136</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".VERSION"><span class="type-signature">(static, constant) </span>VERSION<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>ProtoBuf.js version.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line60">line 60</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES"><span class="type-signature">(static, constant) </span>WIRE_TYPES<span class="type-signature"> :Object.&lt;string, number></span></h4>
+
+
+
+
+<div class="description">
+    <p>Wire types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, number></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line68">line 68</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.BITS32"><span class="type-signature">(static, constant) </span>WIRE_TYPES.BITS32<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fixed 32 bits wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line115">line 115</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.BITS64"><span class="type-signature">(static, constant) </span>WIRE_TYPES.BITS64<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fixed 64 bits wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line83">line 83</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.ENDGROUP"><span class="type-signature">(static, constant) </span>WIRE_TYPES.ENDGROUP<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>End group wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line107">line 107</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.LDELIM"><span class="type-signature">(static, constant) </span>WIRE_TYPES.LDELIM<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Length delimited wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line91">line 91</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.STARTGROUP"><span class="type-signature">(static, constant) </span>WIRE_TYPES.STARTGROUP<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Start group wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line99">line 99</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.VARINT"><span class="type-signature">(static) </span>WIRE_TYPES.VARINT<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Varint wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line75">line 75</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadJson"><span class="type-signature">(static) </span>loadJson<span class="signature">(json, builder<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .json definition and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>json</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>JSON definition</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The corresponding file name if known. Must be specified for imports.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5217">line 5217</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition cannot be parsed or built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder to create new messages</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadJsonFile"><span class="type-signature">(static) </span>loadJsonFile<span class="signature">(filename, callback<span class="signature-attributes">opt</span>, builder<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .json file and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Path to json file or an object specifying 'file' with
+ an overridden 'root' path for all imported files.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback that will receive <code>null</code> as the first and
+ the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
+ file will be read synchronously and this function will return the Builder.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5242">line 5242</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The Builder if synchronous (no callback specified, will be NULL if the
+  request has failed), else undefined</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadProto"><span class="type-signature">(static) </span>loadProto<span class="signature">(proto, builder<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto string and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>proto</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>.proto file contents</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The corresponding file name if known. Must be specified for imports.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5124">line 5124</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition cannot be parsed or built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder to create new messages</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadProtoFile"><span class="type-signature">(static) </span>loadProtoFile<span class="signature">(filename, callback<span class="signature-attributes">opt</span>, builder<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto file and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Path to proto file or an object specifying 'file' with
+ an overridden 'root' path for all imported files.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback that will receive <code>null</code> as the first and
+ the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
+ file will be read synchronously and this function will return the Builder.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5155">line 5155</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The Builder if synchronous (no callback specified, will be NULL if the
+  request has failed), else undefined</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".newBuilder"><span class="type-signature">(static) </span>newBuilder<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new empty Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder options, defaults to global options set on ProtoBuf</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5199">line 5199</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".protoFromFile"><span class="type-signature">(static) </span>protoFromFile<span class="signature">(filename, callback<span class="signature-attributes">opt</span>, builder<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto file and returns the Builder. This is an alias of <a href="ProtoBuf.html#.loadProtoFile">ProtoBuf.loadProtoFile</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Path to proto file or an object specifying 'file' with
+ an overridden 'root' path for all imported files.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback that will receive <code>null</code> as the first and
+ the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
+ file will be read synchronously and this function will return the Builder.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5190">line 5190</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The Builder if synchronous (no callback specified, will be NULL if the
+  request has failed), else undefined</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".protoFromString"><span class="type-signature">(static) </span>protoFromString<span class="signature">(proto, builder<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto string and returns the Builder. This is an alias of <a href="ProtoBuf.html#.loadProto">ProtoBuf.loadProto</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>proto</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>.proto file contents</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The corresponding file name if known. Must be specified for imports.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5141">line 5141</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition cannot be parsed or built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder to create new messages</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.js.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/ProtoBuf.js.html
new file mode 100644 (file)
index 0000000..c2f28a9
--- /dev/null
@@ -0,0 +1,5316 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Source: protobuf.js</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Source: protobuf.js</h1>
+
+    
+
+
+
+    
+    <section>
+        <article>
+            <pre class="prettyprint source linenums"><code>/*\r
+ Copyright 2013 Daniel Wirtz &lt;dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @license protobuf.js (c) 2013 Daniel Wirtz &lt;dcode@dcode.io>\r
+ * Released under the Apache License, Version 2.0\r
+ * see: https://github.com/dcodeIO/protobuf.js for details\r
+ */\r
+(function(global, factory) {\r
+\r
+    /* AMD */ if (typeof define === 'function' &amp;&amp; define["amd"])\r
+        define(["bytebuffer"], factory);\r
+    /* CommonJS */ else if (typeof require === "function" &amp;&amp; typeof module === "object" &amp;&amp; module &amp;&amp; module["exports"])\r
+        module["exports"] = factory(require("bytebuffer"), true);\r
+    /* Global */ else\r
+        (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);\r
+\r
+})(this, function(ByteBuffer, isCommonJS) {\r
+    "use strict";\r
+\r
+    /**\r
+     * The ProtoBuf namespace.\r
+     * @exports ProtoBuf\r
+     * @namespace\r
+     * @expose\r
+     */\r
+    var ProtoBuf = {};\r
+\r
+    /**\r
+     * @type {!function(new: ByteBuffer, ...[*])}\r
+     * @expose\r
+     */\r
+    ProtoBuf.ByteBuffer = ByteBuffer;\r
+\r
+    /**\r
+     * @type {?function(new: Long, ...[*])}\r
+     * @expose\r
+     */\r
+    ProtoBuf.Long = ByteBuffer.Long || null;\r
+\r
+    /**\r
+     * ProtoBuf.js version.\r
+     * @type {string}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.VERSION = "5.0.2";\r
+\r
+    /**\r
+     * Wire types.\r
+     * @type {Object.&lt;string,number>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES = {};\r
+\r
+    /**\r
+     * Varint wire type.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.VARINT = 0;\r
+\r
+    /**\r
+     * Fixed 64 bits wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.BITS64 = 1;\r
+\r
+    /**\r
+     * Length delimited wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.LDELIM = 2;\r
+\r
+    /**\r
+     * Start group wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r
+\r
+    /**\r
+     * End group wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r
+\r
+    /**\r
+     * Fixed 32 bits wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.BITS32 = 5;\r
+\r
+    /**\r
+     * Packable wire types.\r
+     * @type {!Array.&lt;number>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.PACKABLE_WIRE_TYPES = [\r
+        ProtoBuf.WIRE_TYPES.VARINT,\r
+        ProtoBuf.WIRE_TYPES.BITS64,\r
+        ProtoBuf.WIRE_TYPES.BITS32\r
+    ];\r
+\r
+    /**\r
+     * Types.\r
+     * @dict\r
+     * @type {!Object.&lt;string,{name: string, wireType: number, defaultValue: *}>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.TYPES = {\r
+        // According to the protobuf spec.\r
+        "int32": {\r
+            name: "int32",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "uint32": {\r
+            name: "uint32",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "sint32": {\r
+            name: "sint32",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "int64": {\r
+            name: "int64",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+        },\r
+        "uint64": {\r
+            name: "uint64",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+        },\r
+        "sint64": {\r
+            name: "sint64",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+        },\r
+        "bool": {\r
+            name: "bool",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: false\r
+        },\r
+        "double": {\r
+            name: "double",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+            defaultValue: 0\r
+        },\r
+        "string": {\r
+            name: "string",\r
+            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+            defaultValue: ""\r
+        },\r
+        "bytes": {\r
+            name: "bytes",\r
+            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+            defaultValue: null // overridden in the code, must be a unique instance\r
+        },\r
+        "fixed32": {\r
+            name: "fixed32",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+            defaultValue: 0\r
+        },\r
+        "sfixed32": {\r
+            name: "sfixed32",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+            defaultValue: 0\r
+        },\r
+        "fixed64": {\r
+            name: "fixed64",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+            defaultValue:  ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+        },\r
+        "sfixed64": {\r
+            name: "sfixed64",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+        },\r
+        "float": {\r
+            name: "float",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+            defaultValue: 0\r
+        },\r
+        "enum": {\r
+            name: "enum",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "message": {\r
+            name: "message",\r
+            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+            defaultValue: null\r
+        },\r
+        "group": {\r
+            name: "group",\r
+            wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r
+            defaultValue: null\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Valid map key types.\r
+     * @type {!Array.&lt;!Object.&lt;string,{name: string, wireType: number, defaultValue: *}>>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.MAP_KEY_TYPES = [\r
+        ProtoBuf.TYPES["int32"],\r
+        ProtoBuf.TYPES["sint32"],\r
+        ProtoBuf.TYPES["sfixed32"],\r
+        ProtoBuf.TYPES["uint32"],\r
+        ProtoBuf.TYPES["fixed32"],\r
+        ProtoBuf.TYPES["int64"],\r
+        ProtoBuf.TYPES["sint64"],\r
+        ProtoBuf.TYPES["sfixed64"],\r
+        ProtoBuf.TYPES["uint64"],\r
+        ProtoBuf.TYPES["fixed64"],\r
+        ProtoBuf.TYPES["bool"],\r
+        ProtoBuf.TYPES["string"],\r
+        ProtoBuf.TYPES["bytes"]\r
+    ];\r
+\r
+    /**\r
+     * Minimum field id.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.ID_MIN = 1;\r
+\r
+    /**\r
+     * Maximum field id.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.ID_MAX = 0x1FFFFFFF;\r
+\r
+    /**\r
+     * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r
+     *  Must be set prior to parsing.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    ProtoBuf.convertFieldsToCamelCase = false;\r
+\r
+    /**\r
+     * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r
+     *  setting this to `false` prior to building messages.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    ProtoBuf.populateAccessors = true;\r
+\r
+    /**\r
+     * By default, messages are populated with default values if a field is not present on the wire. To disable\r
+     *  this behavior, set this setting to `false`.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    ProtoBuf.populateDefaults = true;\r
+\r
+    /**\r
+     * @alias ProtoBuf.Util\r
+     * @expose\r
+     */\r
+    ProtoBuf.Util = (function() {\r
+        "use strict";\r
+\r
+        /**\r
+         * ProtoBuf utilities.\r
+         * @exports ProtoBuf.Util\r
+         * @namespace\r
+         */\r
+        var Util = {};\r
+\r
+        /**\r
+         * Flag if running in node or not.\r
+         * @type {boolean}\r
+         * @const\r
+         * @expose\r
+         */\r
+        Util.IS_NODE = !!(\r
+            typeof process === 'object' &amp;&amp; process+'' === '[object process]' &amp;&amp; !process['browser']\r
+        );\r
+\r
+        /**\r
+         * Constructs a XMLHttpRequest object.\r
+         * @return {XMLHttpRequest}\r
+         * @throws {Error} If XMLHttpRequest is not supported\r
+         * @expose\r
+         */\r
+        Util.XHR = function() {\r
+            // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r
+            var XMLHttpFactories = [\r
+                function () {return new XMLHttpRequest()},\r
+                function () {return new ActiveXObject("Msxml2.XMLHTTP")},\r
+                function () {return new ActiveXObject("Msxml3.XMLHTTP")},\r
+                function () {return new ActiveXObject("Microsoft.XMLHTTP")}\r
+            ];\r
+            /** @type {?XMLHttpRequest} */\r
+            var xhr = null;\r
+            for (var i=0;i&lt;XMLHttpFactories.length;i++) {\r
+                try { xhr = XMLHttpFactories[i](); }\r
+                catch (e) { continue; }\r
+                break;\r
+            }\r
+            if (!xhr)\r
+                throw Error("XMLHttpRequest is not supported");\r
+            return xhr;\r
+        };\r
+\r
+        /**\r
+         * Fetches a resource.\r
+         * @param {string} path Resource path\r
+         * @param {function(?string)=} callback Callback receiving the resource's contents. If omitted the resource will\r
+         *   be fetched synchronously. If the request failed, contents will be null.\r
+         * @return {?string|undefined} Resource contents if callback is omitted (null if the request failed), else undefined.\r
+         * @expose\r
+         */\r
+        Util.fetch = function(path, callback) {\r
+            if (callback &amp;&amp; typeof callback != 'function')\r
+                callback = null;\r
+            if (Util.IS_NODE) {\r
+                var fs = require("fs");\r
+                if (callback) {\r
+                    fs.readFile(path, function(err, data) {\r
+                        if (err)\r
+                            callback(null);\r
+                        else\r
+                            callback(""+data);\r
+                    });\r
+                } else\r
+                    try {\r
+                        return fs.readFileSync(path);\r
+                    } catch (e) {\r
+                        return null;\r
+                    }\r
+            } else {\r
+                var xhr = Util.XHR();\r
+                xhr.open('GET', path, callback ? true : false);\r
+                // xhr.setRequestHeader('User-Agent', 'XMLHTTP/1.0');\r
+                xhr.setRequestHeader('Accept', 'text/plain');\r
+                if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');\r
+                if (callback) {\r
+                    xhr.onreadystatechange = function() {\r
+                        if (xhr.readyState != 4) return;\r
+                        if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 &amp;&amp; typeof xhr.responseText === 'string'))\r
+                            callback(xhr.responseText);\r
+                        else\r
+                            callback(null);\r
+                    };\r
+                    if (xhr.readyState == 4)\r
+                        return;\r
+                    xhr.send(null);\r
+                } else {\r
+                    xhr.send(null);\r
+                    if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 &amp;&amp; typeof xhr.responseText === 'string'))\r
+                        return xhr.responseText;\r
+                    return null;\r
+                }\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Converts a string to camel case.\r
+         * @param {string} str\r
+         * @returns {string}\r
+         * @expose\r
+         */\r
+        Util.toCamelCase = function(str) {\r
+            return str.replace(/_([a-zA-Z])/g, function ($0, $1) {\r
+                return $1.toUpperCase();\r
+            });\r
+        };\r
+\r
+        return Util;\r
+    })();\r
+\r
+    /**\r
+     * Language expressions.\r
+     * @type {!Object.&lt;string,!RegExp>}\r
+     * @expose\r
+     */\r
+    ProtoBuf.Lang = {\r
+\r
+        // Characters always ending a statement\r
+        DELIM: /[\s\{\}=;:\[\],'"\(\)&lt;>]/g,\r
+\r
+        // Field rules\r
+        RULE: /^(?:required|optional|repeated|map)$/,\r
+\r
+        // Field types\r
+        TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r
+\r
+        // Names\r
+        NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r
+\r
+        // Type definitions\r
+        TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r
+\r
+        // Type references\r
+        TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r
+\r
+        // Fully qualified type references\r
+        FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,\r
+\r
+        // All numbers\r
+        NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r
+\r
+        // Decimal numbers\r
+        NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r
+\r
+        // Hexadecimal numbers\r
+        NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r
+\r
+        // Octal numbers\r
+        NUMBER_OCT: /^0[0-7]+$/,\r
+\r
+        // Floating point numbers\r
+        NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r
+\r
+        // Booleans\r
+        BOOL: /^(?:true|false)$/i,\r
+\r
+        // Id numbers\r
+        ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+        // Negative id numbers (enum values)\r
+        NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+        // Whitespaces\r
+        WHITESPACE: /\s/,\r
+\r
+        // All strings\r
+        STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,\r
+\r
+        // Double quoted strings\r
+        STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,\r
+\r
+        // Single quoted strings\r
+        STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g\r
+    };\r
+\r
+    /**\r
+     * @alias ProtoBuf.DotProto\r
+     * @expose\r
+     */\r
+    ProtoBuf.DotProto = (function(ProtoBuf, Lang) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Utilities to parse .proto files.\r
+         * @exports ProtoBuf.DotProto\r
+         * @namespace\r
+         */\r
+        var DotProto = {};\r
+\r
+        /**\r
+         * Constructs a new Tokenizer.\r
+         * @exports ProtoBuf.DotProto.Tokenizer\r
+         * @class prototype tokenizer\r
+         * @param {string} proto Proto to tokenize\r
+         * @constructor\r
+         */\r
+        var Tokenizer = function(proto) {\r
+\r
+            /**\r
+             * Source to parse.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.source = proto+"";\r
+\r
+            /**\r
+             * Current index.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.index = 0;\r
+\r
+            /**\r
+             * Current line.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.line = 1;\r
+\r
+            /**\r
+             * Token stack.\r
+             * @type {!Array.&lt;string>}\r
+             * @expose\r
+             */\r
+            this.stack = [];\r
+\r
+            /**\r
+             * Opening character of the current string read, if any.\r
+             * @type {?string}\r
+             * @private\r
+             */\r
+            this._stringOpen = null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Tokenizer.prototype\r
+         * @inner\r
+         */\r
+        var TokenizerPrototype = Tokenizer.prototype;\r
+\r
+        /**\r
+         * Reads a string beginning at the current index.\r
+         * @return {string}\r
+         * @private\r
+         */\r
+        TokenizerPrototype._readString = function() {\r
+            var re = this._stringOpen === '"'\r
+                ? Lang.STRING_DQ\r
+                : Lang.STRING_SQ;\r
+            re.lastIndex = this.index - 1; // Include the open quote\r
+            var match = re.exec(this.source);\r
+            if (!match)\r
+                throw Error("unterminated string");\r
+            this.index = re.lastIndex;\r
+            this.stack.push(this._stringOpen);\r
+            this._stringOpen = null;\r
+            return match[1];\r
+        };\r
+\r
+        /**\r
+         * Gets the next token and advances by one.\r
+         * @return {?string} Token or `null` on EOF\r
+         * @expose\r
+         */\r
+        TokenizerPrototype.next = function() {\r
+            if (this.stack.length > 0)\r
+                return this.stack.shift();\r
+            if (this.index >= this.source.length)\r
+                return null;\r
+            if (this._stringOpen !== null)\r
+                return this._readString();\r
+\r
+            var repeat,\r
+                prev,\r
+                next;\r
+            do {\r
+                repeat = false;\r
+\r
+                // Strip white spaces\r
+                while (Lang.WHITESPACE.test(next = this.source.charAt(this.index))) {\r
+                    if (next === '\n')\r
+                        ++this.line;\r
+                    if (++this.index === this.source.length)\r
+                        return null;\r
+                }\r
+\r
+                // Strip comments\r
+                if (this.source.charAt(this.index) === '/') {\r
+                    ++this.index;\r
+                    if (this.source.charAt(this.index) === '/') { // Line\r
+                        while (this.source.charAt(++this.index) !== '\n')\r
+                            if (this.index == this.source.length)\r
+                                return null;\r
+                        ++this.index;\r
+                        ++this.line;\r
+                        repeat = true;\r
+                    } else if ((next = this.source.charAt(this.index)) === '*') { /* Block */\r
+                        do {\r
+                            if (next === '\n')\r
+                                ++this.line;\r
+                            if (++this.index === this.source.length)\r
+                                return null;\r
+                            prev = next;\r
+                            next = this.source.charAt(this.index);\r
+                        } while (prev !== '*' || next !== '/');\r
+                        ++this.index;\r
+                        repeat = true;\r
+                    } else\r
+                        return '/';\r
+                }\r
+            } while (repeat);\r
+\r
+            if (this.index === this.source.length)\r
+                return null;\r
+\r
+            // Read the next token\r
+            var end = this.index;\r
+            Lang.DELIM.lastIndex = 0;\r
+            var delim = Lang.DELIM.test(this.source.charAt(end++));\r
+            if (!delim)\r
+                while(end &lt; this.source.length &amp;&amp; !Lang.DELIM.test(this.source.charAt(end)))\r
+                    ++end;\r
+            var token = this.source.substring(this.index, this.index = end);\r
+            if (token === '"' || token === "'")\r
+                this._stringOpen = token;\r
+            return token;\r
+        };\r
+\r
+        /**\r
+         * Peeks for the next token.\r
+         * @return {?string} Token or `null` on EOF\r
+         * @expose\r
+         */\r
+        TokenizerPrototype.peek = function() {\r
+            if (this.stack.length === 0) {\r
+                var token = this.next();\r
+                if (token === null)\r
+                    return null;\r
+                this.stack.push(token);\r
+            }\r
+            return this.stack[0];\r
+        };\r
+\r
+        /**\r
+         * Skips a specific token and throws if it differs.\r
+         * @param {string} expected Expected token\r
+         * @throws {Error} If the actual token differs\r
+         */\r
+        TokenizerPrototype.skip = function(expected) {\r
+            var actual = this.next();\r
+            if (actual !== expected)\r
+                throw Error("illegal '"+actual+"', '"+expected+"' expected");\r
+        };\r
+\r
+        /**\r
+         * Omits an optional token.\r
+         * @param {string} expected Expected optional token\r
+         * @returns {boolean} `true` if the token exists\r
+         */\r
+        TokenizerPrototype.omit = function(expected) {\r
+            if (this.peek() === expected) {\r
+                this.next();\r
+                return true;\r
+            }\r
+            return false;\r
+        };\r
+\r
+        /**\r
+         * Returns a string representation of this object.\r
+         * @return {string} String representation as of "Tokenizer(index/length)"\r
+         * @expose\r
+         */\r
+        TokenizerPrototype.toString = function() {\r
+            return "Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")";\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Tokenizer\r
+         * @expose\r
+         */\r
+        DotProto.Tokenizer = Tokenizer;\r
+\r
+        /**\r
+         * Constructs a new Parser.\r
+         * @exports ProtoBuf.DotProto.Parser\r
+         * @class prototype parser\r
+         * @param {string} source Source\r
+         * @constructor\r
+         */\r
+        var Parser = function(source) {\r
+\r
+            /**\r
+             * Tokenizer.\r
+             * @type {!ProtoBuf.DotProto.Tokenizer}\r
+             * @expose\r
+             */\r
+            this.tn = new Tokenizer(source);\r
+\r
+            /**\r
+             * Whether parsing proto3 or not.\r
+             * @type {boolean}\r
+             */\r
+            this.proto3 = false;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Parser.prototype\r
+         * @inner\r
+         */\r
+        var ParserPrototype = Parser.prototype;\r
+\r
+        /**\r
+         * Parses the source.\r
+         * @returns {!Object}\r
+         * @throws {Error} If the source cannot be parsed\r
+         * @expose\r
+         */\r
+        ParserPrototype.parse = function() {\r
+            var topLevel = {\r
+                "name": "[ROOT]", // temporary\r
+                "package": null,\r
+                "messages": [],\r
+                "enums": [],\r
+                "imports": [],\r
+                "options": {},\r
+                "services": []\r
+                // "syntax": undefined\r
+            };\r
+            var token,\r
+                head = true,\r
+                weak;\r
+            try {\r
+                while (token = this.tn.next()) {\r
+                    switch (token) {\r
+                        case 'package':\r
+                            if (!head || topLevel["package"] !== null)\r
+                                throw Error("unexpected 'package'");\r
+                            token = this.tn.next();\r
+                            if (!Lang.TYPEREF.test(token))\r
+                                throw Error("illegal package name: " + token);\r
+                            this.tn.skip(";");\r
+                            topLevel["package"] = token;\r
+                            break;\r
+                        case 'import':\r
+                            if (!head)\r
+                                throw Error("unexpected 'import'");\r
+                            token = this.tn.peek();\r
+                            if (token === "public" || (weak = token === "weak")) // token ignored\r
+                                this.tn.next();\r
+                            token = this._readString();\r
+                            this.tn.skip(";");\r
+                            if (!weak) // import ignored\r
+                                topLevel["imports"].push(token);\r
+                            break;\r
+                        case 'syntax':\r
+                            if (!head)\r
+                                throw Error("unexpected 'syntax'");\r
+                            this.tn.skip("=");\r
+                            if ((topLevel["syntax"] = this._readString()) === "proto3")\r
+                                this.proto3 = true;\r
+                            this.tn.skip(";");\r
+                            break;\r
+                        case 'message':\r
+                            this._parseMessage(topLevel, null);\r
+                            head = false;\r
+                            break;\r
+                        case 'enum':\r
+                            this._parseEnum(topLevel);\r
+                            head = false;\r
+                            break;\r
+                        case 'option':\r
+                            this._parseOption(topLevel);\r
+                            break;\r
+                        case 'service':\r
+                            this._parseService(topLevel);\r
+                            break;\r
+                        case 'extend':\r
+                            this._parseExtend(topLevel);\r
+                            break;\r
+                        default:\r
+                            throw Error("unexpected '" + token + "'");\r
+                    }\r
+                }\r
+            } catch (e) {\r
+                e.message = "Parse error at line "+this.tn.line+": " + e.message;\r
+                throw e;\r
+            }\r
+            delete topLevel["name"];\r
+            return topLevel;\r
+        };\r
+\r
+        /**\r
+         * Parses the specified source.\r
+         * @returns {!Object}\r
+         * @throws {Error} If the source cannot be parsed\r
+         * @expose\r
+         */\r
+        Parser.parse = function(source) {\r
+            return new Parser(source).parse();\r
+        };\r
+\r
+        // ----- Conversion ------\r
+\r
+        /**\r
+         * Converts a numerical string to an id.\r
+         * @param {string} value\r
+         * @param {boolean=} mayBeNegative\r
+         * @returns {number}\r
+         * @inner\r
+         */\r
+        function mkId(value, mayBeNegative) {\r
+            var id = -1,\r
+                sign = 1;\r
+            if (value.charAt(0) == '-') {\r
+                sign = -1;\r
+                value = value.substring(1);\r
+            }\r
+            if (Lang.NUMBER_DEC.test(value))\r
+                id = parseInt(value);\r
+            else if (Lang.NUMBER_HEX.test(value))\r
+                id = parseInt(value.substring(2), 16);\r
+            else if (Lang.NUMBER_OCT.test(value))\r
+                id = parseInt(value.substring(1), 8);\r
+            else\r
+                throw Error("illegal id value: " + (sign &lt; 0 ? '-' : '') + value);\r
+            id = (sign*id)|0; // Force to 32bit\r
+            if (!mayBeNegative &amp;&amp; id &lt; 0)\r
+                throw Error("illegal id value: " + (sign &lt; 0 ? '-' : '') + value);\r
+            return id;\r
+        }\r
+\r
+        /**\r
+         * Converts a numerical string to a number.\r
+         * @param {string} val\r
+         * @returns {number}\r
+         * @inner\r
+         */\r
+        function mkNumber(val) {\r
+            var sign = 1;\r
+            if (val.charAt(0) == '-') {\r
+                sign = -1;\r
+                val = val.substring(1);\r
+            }\r
+            if (Lang.NUMBER_DEC.test(val))\r
+                return sign * parseInt(val, 10);\r
+            else if (Lang.NUMBER_HEX.test(val))\r
+                return sign * parseInt(val.substring(2), 16);\r
+            else if (Lang.NUMBER_OCT.test(val))\r
+                return sign * parseInt(val.substring(1), 8);\r
+            else if (val === 'inf')\r
+                return sign * Infinity;\r
+            else if (val === 'nan')\r
+                return NaN;\r
+            else if (Lang.NUMBER_FLT.test(val))\r
+                return sign * parseFloat(val);\r
+            throw Error("illegal number value: " + (sign &lt; 0 ? '-' : '') + val);\r
+        }\r
+\r
+        // ----- Reading ------\r
+\r
+        /**\r
+         * Reads a string.\r
+         * @returns {string}\r
+         * @private\r
+         */\r
+        ParserPrototype._readString = function() {\r
+            var value = "",\r
+                token,\r
+                delim;\r
+            do {\r
+                delim = this.tn.next();\r
+                if (delim !== "'" &amp;&amp; delim !== '"')\r
+                    throw Error("illegal string delimiter: "+delim);\r
+                value += this.tn.next();\r
+                this.tn.skip(delim);\r
+                token = this.tn.peek();\r
+            } while (token === '"' || token === '"'); // multi line?\r
+            return value;\r
+        };\r
+\r
+        /**\r
+         * Reads a value.\r
+         * @param {boolean=} mayBeTypeRef\r
+         * @returns {number|boolean|string}\r
+         * @private\r
+         */\r
+        ParserPrototype._readValue = function(mayBeTypeRef) {\r
+            var token = this.tn.peek(),\r
+                value;\r
+            if (token === '"' || token === "'")\r
+                return this._readString();\r
+            this.tn.next();\r
+            if (Lang.NUMBER.test(token))\r
+                return mkNumber(token);\r
+            if (Lang.BOOL.test(token))\r
+                return (token.toLowerCase() === 'true');\r
+            if (mayBeTypeRef &amp;&amp; Lang.TYPEREF.test(token))\r
+                return token;\r
+            throw Error("illegal value: "+token);\r
+\r
+        };\r
+\r
+        // ----- Parsing constructs -----\r
+\r
+        /**\r
+         * Parses a namespace option.\r
+         * @param {!Object} parent Parent definition\r
+         * @param {boolean=} isList\r
+         * @private\r
+         */\r
+        ParserPrototype._parseOption = function(parent, isList) {\r
+            var token = this.tn.next(),\r
+                custom = false;\r
+            if (token === '(') {\r
+                custom = true;\r
+                token = this.tn.next();\r
+            }\r
+            if (!Lang.TYPEREF.test(token))\r
+                // we can allow options of the form google.protobuf.* since they will just get ignored anyways\r
+                // if (!/google\.protobuf\./.test(token)) // FIXME: Why should that not be a valid typeref?\r
+                    throw Error("illegal option name: "+token);\r
+            var name = token;\r
+            if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar\r
+                this.tn.skip(')');\r
+                name = '('+name+')';\r
+                token = this.tn.peek();\r
+                if (Lang.FQTYPEREF.test(token)) {\r
+                    name += token;\r
+                    this.tn.next();\r
+                }\r
+            }\r
+            this.tn.skip('=');\r
+            this._parseOptionValue(parent, name);\r
+            if (!isList)\r
+                this.tn.skip(";");\r
+        };\r
+\r
+        /**\r
+         * Sets an option on the specified options object.\r
+         * @param {!Object.&lt;string,*>} options\r
+         * @param {string} name\r
+         * @param {string|number|boolean} value\r
+         * @inner\r
+         */\r
+        function setOption(options, name, value) {\r
+            if (typeof options[name] === 'undefined')\r
+                options[name] = value;\r
+            else {\r
+                if (!Array.isArray(options[name]))\r
+                    options[name] = [ options[name] ];\r
+                options[name].push(value);\r
+            }\r
+        }\r
+\r
+        /**\r
+         * Parses an option value.\r
+         * @param {!Object} parent\r
+         * @param {string} name\r
+         * @private\r
+         */\r
+        ParserPrototype._parseOptionValue = function(parent, name) {\r
+            var token = this.tn.peek();\r
+            if (token !== '{') { // Plain value\r
+                setOption(parent["options"], name, this._readValue(true));\r
+            } else { // Aggregate options\r
+                this.tn.skip("{");\r
+                while ((token = this.tn.next()) !== '}') {\r
+                    if (!Lang.NAME.test(token))\r
+                        throw Error("illegal option name: " + name + "." + token);\r
+                    if (this.tn.omit(":"))\r
+                        setOption(parent["options"], name + "." + token, this._readValue(true));\r
+                    else\r
+                        this._parseOptionValue(parent, name + "." + token);\r
+                }\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Parses a service definition.\r
+         * @param {!Object} parent Parent definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseService = function(parent) {\r
+            var token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal service name at line "+this.tn.line+": "+token);\r
+            var name = token;\r
+            var svc = {\r
+                "name": name,\r
+                "rpc": {},\r
+                "options": {}\r
+            };\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (token === "option")\r
+                    this._parseOption(svc);\r
+                else if (token === 'rpc')\r
+                    this._parseServiceRPC(svc);\r
+                else\r
+                    throw Error("illegal service token: "+token);\r
+            }\r
+            this.tn.omit(";");\r
+            parent["services"].push(svc);\r
+        };\r
+\r
+        /**\r
+         * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)].\r
+         * @param {!Object} svc Service definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseServiceRPC = function(svc) {\r
+            var type = "rpc",\r
+                token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal rpc service method name: "+token);\r
+            var name = token;\r
+            var method = {\r
+                "request": null,\r
+                "response": null,\r
+                "request_stream": false,\r
+                "response_stream": false,\r
+                "options": {}\r
+            };\r
+            this.tn.skip("(");\r
+            token = this.tn.next();\r
+            if (token.toLowerCase() === "stream") {\r
+              method["request_stream"] = true;\r
+              token = this.tn.next();\r
+            }\r
+            if (!Lang.TYPEREF.test(token))\r
+                throw Error("illegal rpc service request type: "+token);\r
+            method["request"] = token;\r
+            this.tn.skip(")");\r
+            token = this.tn.next();\r
+            if (token.toLowerCase() !== "returns")\r
+                throw Error("illegal rpc service request type delimiter: "+token);\r
+            this.tn.skip("(");\r
+            token = this.tn.next();\r
+            if (token.toLowerCase() === "stream") {\r
+              method["response_stream"] = true;\r
+              token = this.tn.next();\r
+            }\r
+            method["response"] = token;\r
+            this.tn.skip(")");\r
+            token = this.tn.peek();\r
+            if (token === '{') {\r
+                this.tn.next();\r
+                while ((token = this.tn.next()) !== '}') {\r
+                    if (token === 'option')\r
+                        this._parseOption(method);\r
+                    else\r
+                        throw Error("illegal rpc service token: " + token);\r
+                }\r
+                this.tn.omit(";");\r
+            } else\r
+                this.tn.skip(";");\r
+            if (typeof svc[type] === 'undefined')\r
+                svc[type] = {};\r
+            svc[type][name] = method;\r
+        };\r
+\r
+        /**\r
+         * Parses a message definition.\r
+         * @param {!Object} parent Parent definition\r
+         * @param {!Object=} fld Field definition if this is a group\r
+         * @returns {!Object}\r
+         * @private\r
+         */\r
+        ParserPrototype._parseMessage = function(parent, fld) {\r
+            var isGroup = !!fld,\r
+                token = this.tn.next();\r
+            var msg = {\r
+                "name": "",\r
+                "fields": [],\r
+                "enums": [],\r
+                "messages": [],\r
+                "options": {},\r
+                "services": [],\r
+                "oneofs": {}\r
+                // "extensions": undefined\r
+            };\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal "+(isGroup ? "group" : "message")+" name: "+token);\r
+            msg["name"] = token;\r
+            if (isGroup) {\r
+                this.tn.skip("=");\r
+                fld["id"] = mkId(this.tn.next());\r
+                msg["isGroup"] = true;\r
+            }\r
+            token = this.tn.peek();\r
+            if (token === '[' &amp;&amp; fld)\r
+                this._parseFieldOptions(fld);\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (Lang.RULE.test(token))\r
+                    this._parseMessageField(msg, token);\r
+                else if (token === "oneof")\r
+                    this._parseMessageOneOf(msg);\r
+                else if (token === "enum")\r
+                    this._parseEnum(msg);\r
+                else if (token === "message")\r
+                    this._parseMessage(msg);\r
+                else if (token === "option")\r
+                    this._parseOption(msg);\r
+                else if (token === "service")\r
+                    this._parseService(msg);\r
+                else if (token === "extensions")\r
+                    if (msg.hasOwnProperty("extensions")) {\r
+                        msg["extensions"] = msg["extensions"].concat(this._parseExtensionRanges())\r
+                    } else {\r
+                        msg["extensions"] = this._parseExtensionRanges();\r
+                    }\r
+                else if (token === "reserved")\r
+                    this._parseIgnored(); // TODO\r
+                else if (token === "extend")\r
+                    this._parseExtend(msg);\r
+                else if (Lang.TYPEREF.test(token)) {\r
+                    if (!this.proto3)\r
+                        throw Error("illegal field rule: "+token);\r
+                    this._parseMessageField(msg, "optional", token);\r
+                } else\r
+                    throw Error("illegal message token: "+token);\r
+            }\r
+            this.tn.omit(";");\r
+            parent["messages"].push(msg);\r
+            return msg;\r
+        };\r
+\r
+        /**\r
+         * Parses an ignored statement.\r
+         * @private\r
+         */\r
+        ParserPrototype._parseIgnored = function() {\r
+            while (this.tn.peek() !== ';')\r
+                this.tn.next();\r
+            this.tn.skip(";");\r
+        };\r
+\r
+        /**\r
+         * Parses a message field.\r
+         * @param {!Object} msg Message definition\r
+         * @param {string} rule Field rule\r
+         * @param {string=} type Field type if already known (never known for maps)\r
+         * @returns {!Object} Field descriptor\r
+         * @private\r
+         */\r
+        ParserPrototype._parseMessageField = function(msg, rule, type) {\r
+            if (!Lang.RULE.test(rule))\r
+                throw Error("illegal message field rule: "+rule);\r
+            var fld = {\r
+                "rule": rule,\r
+                "type": "",\r
+                "name": "",\r
+                "options": {},\r
+                "id": 0\r
+            };\r
+            var token;\r
+            if (rule === "map") {\r
+\r
+                if (type)\r
+                    throw Error("illegal type: " + type);\r
+                this.tn.skip('&lt;');\r
+                token = this.tn.next();\r
+                if (!Lang.TYPE.test(token) &amp;&amp; !Lang.TYPEREF.test(token))\r
+                    throw Error("illegal message field type: " + token);\r
+                fld["keytype"] = token;\r
+                this.tn.skip(',');\r
+                token = this.tn.next();\r
+                if (!Lang.TYPE.test(token) &amp;&amp; !Lang.TYPEREF.test(token))\r
+                    throw Error("illegal message field: " + token);\r
+                fld["type"] = token;\r
+                this.tn.skip('>');\r
+                token = this.tn.next();\r
+                if (!Lang.NAME.test(token))\r
+                    throw Error("illegal message field name: " + token);\r
+                fld["name"] = token;\r
+                this.tn.skip("=");\r
+                fld["id"] = mkId(this.tn.next());\r
+                token = this.tn.peek();\r
+                if (token === '[')\r
+                    this._parseFieldOptions(fld);\r
+                this.tn.skip(";");\r
+\r
+            } else {\r
+\r
+                type = typeof type !== 'undefined' ? type : this.tn.next();\r
+\r
+                if (type === "group") {\r
+\r
+                    // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your\r
+                    // code, you can treat this message just as if it had a Result type field called result (the latter name is\r
+                    // converted to lower-case so that it does not conflict with the former)."\r
+                    var grp = this._parseMessage(msg, fld);\r
+                    if (!/^[A-Z]/.test(grp["name"]))\r
+                        throw Error('illegal group name: '+grp["name"]);\r
+                    fld["type"] = grp["name"];\r
+                    fld["name"] = grp["name"].toLowerCase();\r
+                    this.tn.omit(";");\r
+\r
+                } else {\r
+\r
+                    if (!Lang.TYPE.test(type) &amp;&amp; !Lang.TYPEREF.test(type))\r
+                        throw Error("illegal message field type: " + type);\r
+                    fld["type"] = type;\r
+                    token = this.tn.next();\r
+                    if (!Lang.NAME.test(token))\r
+                        throw Error("illegal message field name: " + token);\r
+                    fld["name"] = token;\r
+                    this.tn.skip("=");\r
+                    fld["id"] = mkId(this.tn.next());\r
+                    token = this.tn.peek();\r
+                    if (token === "[")\r
+                        this._parseFieldOptions(fld);\r
+                    this.tn.skip(";");\r
+\r
+                }\r
+            }\r
+            msg["fields"].push(fld);\r
+            return fld;\r
+        };\r
+\r
+        /**\r
+         * Parses a message oneof.\r
+         * @param {!Object} msg Message definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseMessageOneOf = function(msg) {\r
+            var token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal oneof name: "+token);\r
+            var name = token,\r
+                fld;\r
+            var fields = [];\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== "}") {\r
+                fld = this._parseMessageField(msg, "optional", token);\r
+                fld["oneof"] = name;\r
+                fields.push(fld["id"]);\r
+            }\r
+            this.tn.omit(";");\r
+            msg["oneofs"][name] = fields;\r
+        };\r
+\r
+        /**\r
+         * Parses a set of field option definitions.\r
+         * @param {!Object} fld Field definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseFieldOptions = function(fld) {\r
+            this.tn.skip("[");\r
+            var token,\r
+                first = true;\r
+            while ((token = this.tn.peek()) !== ']') {\r
+                if (!first)\r
+                    this.tn.skip(",");\r
+                this._parseOption(fld, true);\r
+                first = false;\r
+            }\r
+            this.tn.next();\r
+        };\r
+\r
+        /**\r
+         * Parses an enum.\r
+         * @param {!Object} msg Message definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseEnum = function(msg) {\r
+            var enm = {\r
+                "name": "",\r
+                "values": [],\r
+                "options": {}\r
+            };\r
+            var token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal name: "+token);\r
+            enm["name"] = token;\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (token === "option")\r
+                    this._parseOption(enm);\r
+                else {\r
+                    if (!Lang.NAME.test(token))\r
+                        throw Error("illegal name: "+token);\r
+                    this.tn.skip("=");\r
+                    var val = {\r
+                        "name": token,\r
+                        "id": mkId(this.tn.next(), true)\r
+                    };\r
+                    token = this.tn.peek();\r
+                    if (token === "[")\r
+                        this._parseFieldOptions({ "options": {} });\r
+                    this.tn.skip(";");\r
+                    enm["values"].push(val);\r
+                }\r
+            }\r
+            this.tn.omit(";");\r
+            msg["enums"].push(enm);\r
+        };\r
+\r
+        /**\r
+         * Parses extension / reserved ranges.\r
+         * @returns {!Array.&lt;!Array.&lt;number>>}\r
+         * @private\r
+         */\r
+        ParserPrototype._parseExtensionRanges = function() {\r
+            var ranges = [];\r
+            var token,\r
+                range,\r
+                value;\r
+            do {\r
+                range = [];\r
+                while (true) {\r
+                    token = this.tn.next();\r
+                    switch (token) {\r
+                        case "min":\r
+                            value = ProtoBuf.ID_MIN;\r
+                            break;\r
+                        case "max":\r
+                            value = ProtoBuf.ID_MAX;\r
+                            break;\r
+                        default:\r
+                            value = mkNumber(token);\r
+                            break;\r
+                    }\r
+                    range.push(value);\r
+                    if (range.length === 2)\r
+                        break;\r
+                    if (this.tn.peek() !== "to") {\r
+                        range.push(value);\r
+                        break;\r
+                    }\r
+                    this.tn.next();\r
+                }\r
+                ranges.push(range);\r
+            } while (this.tn.omit(","));\r
+            this.tn.skip(";");\r
+            return ranges;\r
+        };\r
+\r
+        /**\r
+         * Parses an extend block.\r
+         * @param {!Object} parent Parent object\r
+         * @private\r
+         */\r
+        ParserPrototype._parseExtend = function(parent) {\r
+            var token = this.tn.next();\r
+            if (!Lang.TYPEREF.test(token))\r
+                throw Error("illegal extend reference: "+token);\r
+            var ext = {\r
+                "ref": token,\r
+                "fields": []\r
+            };\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (Lang.RULE.test(token))\r
+                    this._parseMessageField(ext, token);\r
+                else if (Lang.TYPEREF.test(token)) {\r
+                    if (!this.proto3)\r
+                        throw Error("illegal field rule: "+token);\r
+                    this._parseMessageField(ext, "optional", token);\r
+                } else\r
+                    throw Error("illegal extend token: "+token);\r
+            }\r
+            this.tn.omit(";");\r
+            parent["messages"].push(ext);\r
+            return ext;\r
+        };\r
+\r
+        // ----- General -----\r
+\r
+        /**\r
+         * Returns a string representation of this parser.\r
+         * @returns {string}\r
+         */\r
+        ParserPrototype.toString = function() {\r
+            return "Parser at line "+this.tn.line;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Parser\r
+         * @expose\r
+         */\r
+        DotProto.Parser = Parser;\r
+\r
+        return DotProto;\r
+\r
+    })(ProtoBuf, ProtoBuf.Lang);\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect\r
+     * @expose\r
+     */\r
+    ProtoBuf.Reflect = (function(ProtoBuf) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Reflection types.\r
+         * @exports ProtoBuf.Reflect\r
+         * @namespace\r
+         */\r
+        var Reflect = {};\r
+\r
+        /**\r
+         * Constructs a Reflect base class.\r
+         * @exports ProtoBuf.Reflect.T\r
+         * @constructor\r
+         * @abstract\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {?ProtoBuf.Reflect.T} parent Parent object\r
+         * @param {string} name Object name\r
+         */\r
+        var T = function(builder, parent, name) {\r
+\r
+            /**\r
+             * Builder reference.\r
+             * @type {!ProtoBuf.Builder}\r
+             * @expose\r
+             */\r
+            this.builder = builder;\r
+\r
+            /**\r
+             * Parent object.\r
+             * @type {?ProtoBuf.Reflect.T}\r
+             * @expose\r
+             */\r
+            this.parent = parent;\r
+\r
+            /**\r
+             * Object name in namespace.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.name = name;\r
+\r
+            /**\r
+             * Fully qualified class name\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.className;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.T.prototype\r
+         * @inner\r
+         */\r
+        var TPrototype = T.prototype;\r
+\r
+        /**\r
+         * Returns the fully qualified name of this object.\r
+         * @returns {string} Fully qualified name as of ".PATH.TO.THIS"\r
+         * @expose\r
+         */\r
+        TPrototype.fqn = function() {\r
+            var name = this.name,\r
+                ptr = this;\r
+            do {\r
+                ptr = ptr.parent;\r
+                if (ptr == null)\r
+                    break;\r
+                name = ptr.name+"."+name;\r
+            } while (true);\r
+            return name;\r
+        };\r
+\r
+        /**\r
+         * Returns a string representation of this Reflect object (its fully qualified name).\r
+         * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r
+         * @return String representation\r
+         * @expose\r
+         */\r
+        TPrototype.toString = function(includeClass) {\r
+            return (includeClass ? this.className + " " : "") + this.fqn();\r
+        };\r
+\r
+        /**\r
+         * Builds this type.\r
+         * @throws {Error} If this type cannot be built directly\r
+         * @expose\r
+         */\r
+        TPrototype.build = function() {\r
+            throw Error(this.toString(true)+" cannot be built directly");\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.T\r
+         * @expose\r
+         */\r
+        Reflect.T = T;\r
+\r
+        /**\r
+         * Constructs a new Namespace.\r
+         * @exports ProtoBuf.Reflect.Namespace\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r
+         * @param {string} name Namespace name\r
+         * @param {Object.&lt;string,*>=} options Namespace options\r
+         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Namespace = function(builder, parent, name, options, syntax) {\r
+            T.call(this, builder, parent, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Namespace";\r
+\r
+            /**\r
+             * Children inside the namespace.\r
+             * @type {!Array.&lt;ProtoBuf.Reflect.T>}\r
+             */\r
+            this.children = [];\r
+\r
+            /**\r
+             * Options.\r
+             * @type {!Object.&lt;string, *>}\r
+             */\r
+            this.options = options || {};\r
+\r
+            /**\r
+             * Syntax level (e.g., proto2 or proto3).\r
+             * @type {!string}\r
+             */\r
+            this.syntax = syntax || "proto2";\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Namespace.prototype\r
+         * @inner\r
+         */\r
+        var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * Returns an array of the namespace's children.\r
+         * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r
+         * @return {Array.&lt;ProtoBuf.Reflect.T>}\r
+         * @expose\r
+         */\r
+        NamespacePrototype.getChildren = function(type) {\r
+            type = type || null;\r
+            if (type == null)\r
+                return this.children.slice();\r
+            var children = [];\r
+            for (var i=0, k=this.children.length; i&lt;k; ++i)\r
+                if (this.children[i] instanceof type)\r
+                    children.push(this.children[i]);\r
+            return children;\r
+        };\r
+\r
+        /**\r
+         * Adds a child to the namespace.\r
+         * @param {ProtoBuf.Reflect.T} child Child\r
+         * @throws {Error} If the child cannot be added (duplicate)\r
+         * @expose\r
+         */\r
+        NamespacePrototype.addChild = function(child) {\r
+            var other;\r
+            if (other = this.getChild(child.name)) {\r
+                // Try to revert camelcase transformation on collision\r
+                if (other instanceof Message.Field &amp;&amp; other.name !== other.originalName &amp;&amp; this.getChild(other.originalName) === null)\r
+                    other.name = other.originalName; // Revert previous first (effectively keeps both originals)\r
+                else if (child instanceof Message.Field &amp;&amp; child.name !== child.originalName &amp;&amp; this.getChild(child.originalName) === null)\r
+                    child.name = child.originalName;\r
+                else\r
+                    throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);\r
+            }\r
+            this.children.push(child);\r
+        };\r
+\r
+        /**\r
+         * Gets a child by its name or id.\r
+         * @param {string|number} nameOrId Child name or id\r
+         * @return {?ProtoBuf.Reflect.T} The child or null if not found\r
+         * @expose\r
+         */\r
+        NamespacePrototype.getChild = function(nameOrId) {\r
+            var key = typeof nameOrId === 'number' ? 'id' : 'name';\r
+            for (var i=0, k=this.children.length; i&lt;k; ++i)\r
+                if (this.children[i][key] === nameOrId)\r
+                    return this.children[i];\r
+            return null;\r
+        };\r
+\r
+        /**\r
+         * Resolves a reflect object inside of this namespace.\r
+         * @param {string|!Array.&lt;string>} qn Qualified name to resolve\r
+         * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r
+         * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r
+         * @expose\r
+         */\r
+        NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r
+            var part = typeof qn === 'string' ? qn.split(".") : qn,\r
+                ptr = this,\r
+                i = 0;\r
+            if (part[i] === "") { // Fully qualified name, e.g. ".My.Message'\r
+                while (ptr.parent !== null)\r
+                    ptr = ptr.parent;\r
+                i++;\r
+            }\r
+            var child;\r
+            do {\r
+                do {\r
+                    if (!(ptr instanceof Reflect.Namespace)) {\r
+                        ptr = null;\r
+                        break;\r
+                    }\r
+                    child = ptr.getChild(part[i]);\r
+                    if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace &amp;&amp; !(child instanceof Reflect.Namespace))) {\r
+                        ptr = null;\r
+                        break;\r
+                    }\r
+                    ptr = child; i++;\r
+                } while (i &lt; part.length);\r
+                if (ptr != null)\r
+                    break; // Found\r
+                // Else search the parent\r
+                if (this.parent !== null)\r
+                    return this.parent.resolve(qn, excludeNonNamespace);\r
+            } while (ptr != null);\r
+            return ptr;\r
+        };\r
+\r
+        /**\r
+         * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r
+         * @param {!ProtoBuf.Reflect.T} t Reflection type\r
+         * @returns {string} The shortest qualified name or, if there is none, the fqn\r
+         * @expose\r
+         */\r
+        NamespacePrototype.qn = function(t) {\r
+            var part = [], ptr = t;\r
+            do {\r
+                part.unshift(ptr.name);\r
+                ptr = ptr.parent;\r
+            } while (ptr !== null);\r
+            for (var len=1; len &lt;= part.length; len++) {\r
+                var qn = part.slice(part.length-len);\r
+                if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r
+                    return qn.join(".");\r
+            }\r
+            return t.fqn();\r
+        };\r
+\r
+        /**\r
+         * Builds the namespace and returns the runtime counterpart.\r
+         * @return {Object.&lt;string,Function|Object>} Runtime namespace\r
+         * @expose\r
+         */\r
+        NamespacePrototype.build = function() {\r
+            /** @dict */\r
+            var ns = {};\r
+            var children = this.children;\r
+            for (var i=0, k=children.length, child; i&lt;k; ++i) {\r
+                child = children[i];\r
+                if (child instanceof Namespace)\r
+                    ns[child.name] = child.build();\r
+            }\r
+            if (Object.defineProperty)\r
+                Object.defineProperty(ns, "$options", { "value": this.buildOpt() });\r
+            return ns;\r
+        };\r
+\r
+        /**\r
+         * Builds the namespace's '$options' property.\r
+         * @return {Object.&lt;string,*>}\r
+         */\r
+        NamespacePrototype.buildOpt = function() {\r
+            var opt = {},\r
+                keys = Object.keys(this.options);\r
+            for (var i=0, k=keys.length; i&lt;k; ++i) {\r
+                var key = keys[i],\r
+                    val = this.options[keys[i]];\r
+                // TODO: Options are not resolved, yet.\r
+                // if (val instanceof Namespace) {\r
+                //     opt[key] = val.build();\r
+                // } else {\r
+                opt[key] = val;\r
+                // }\r
+            }\r
+            return opt;\r
+        };\r
+\r
+        /**\r
+         * Gets the value assigned to the option with the specified name.\r
+         * @param {string=} name Returns the option value if specified, otherwise all options are returned.\r
+         * @return {*|Object.&lt;string,*>}null} Option value or NULL if there is no such option\r
+         */\r
+        NamespacePrototype.getOption = function(name) {\r
+            if (typeof name === 'undefined')\r
+                return this.options;\r
+            return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Namespace\r
+         * @expose\r
+         */\r
+        Reflect.Namespace = Namespace;\r
+\r
+        /**\r
+         * Constructs a new Element implementation that checks and converts values for a\r
+         * particular field type, as appropriate.\r
+         *\r
+         * An Element represents a single value: either the value of a singular field,\r
+         * or a value contained in one entry of a repeated field or map field. This\r
+         * class does not implement these higher-level concepts; it only encapsulates\r
+         * the low-level typechecking and conversion.\r
+         *\r
+         * @exports ProtoBuf.Reflect.Element\r
+         * @param {{name: string, wireType: number}} type Resolved data type\r
+         * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r
+         * (e.g. submessage field).\r
+         * @param {boolean} isMapKey Is this element a Map key? The value will be\r
+         * converted to string form if so.\r
+         * @param {string} syntax Syntax level of defining message type, e.g.,\r
+         * proto2 or proto3.\r
+         * @param {string} name Name of the field containing this element (for error\r
+         * messages)\r
+         * @constructor\r
+         */\r
+        var Element = function(type, resolvedType, isMapKey, syntax, name) {\r
+\r
+            /**\r
+             * Element type, as a string (e.g., int32).\r
+             * @type {{name: string, wireType: number}}\r
+             */\r
+            this.type = type;\r
+\r
+            /**\r
+             * Element type reference to submessage or enum definition, if needed.\r
+             * @type {ProtoBuf.Reflect.T|null}\r
+             */\r
+            this.resolvedType = resolvedType;\r
+\r
+            /**\r
+             * Element is a map key.\r
+             * @type {boolean}\r
+             */\r
+            this.isMapKey = isMapKey;\r
+\r
+            /**\r
+             * Syntax level of defining message type, e.g., proto2 or proto3.\r
+             * @type {string}\r
+             */\r
+            this.syntax = syntax;\r
+\r
+            /**\r
+             * Name of the field containing this element (for error messages)\r
+             * @type {string}\r
+             */\r
+            this.name = name;\r
+\r
+            if (isMapKey &amp;&amp; ProtoBuf.MAP_KEY_TYPES.indexOf(type) &lt; 0)\r
+                throw Error("Invalid map key type: " + type.name);\r
+        };\r
+\r
+        var ElementPrototype = Element.prototype;\r
+\r
+        /**\r
+         * Obtains a (new) default value for the specified type.\r
+         * @param type {string|{name: string, wireType: number}} Field type\r
+         * @returns {*} Default value\r
+         * @inner\r
+         */\r
+        function mkDefault(type) {\r
+            if (typeof type === 'string')\r
+                type = ProtoBuf.TYPES[type];\r
+            if (typeof type.defaultValue === 'undefined')\r
+                throw Error("default value for type "+type.name+" is not supported");\r
+            if (type == ProtoBuf.TYPES["bytes"])\r
+                return new ByteBuffer(0);\r
+            return type.defaultValue;\r
+        }\r
+\r
+        /**\r
+         * Returns the default value for this field in proto3.\r
+         * @function\r
+         * @param type {string|{name: string, wireType: number}} the field type\r
+         * @returns {*} Default value\r
+         */\r
+        Element.defaultFieldValue = mkDefault;\r
+\r
+        /**\r
+         * Makes a Long from a value.\r
+         * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r
+         * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r
+         *  strings and numbers\r
+         * @returns {!Long}\r
+         * @throws {Error} If the value cannot be converted to a Long\r
+         * @inner\r
+         */\r
+        function mkLong(value, unsigned) {\r
+            if (value &amp;&amp; typeof value.low === 'number' &amp;&amp; typeof value.high === 'number' &amp;&amp; typeof value.unsigned === 'boolean'\r
+                &amp;&amp; value.low === value.low &amp;&amp; value.high === value.high)\r
+                return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r
+            if (typeof value === 'string')\r
+                return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r
+            if (typeof value === 'number')\r
+                return ProtoBuf.Long.fromNumber(value, unsigned || false);\r
+            throw Error("not convertible to Long");\r
+        }\r
+\r
+        ElementPrototype.toString = function() {\r
+            return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r
+        }\r
+\r
+        /**\r
+         * Checks if the given value can be set for an element of this type (singular\r
+         * field or one element of a repeated field or map).\r
+         * @param {*} value Value to check\r
+         * @return {*} Verified, maybe adjusted, value\r
+         * @throws {Error} If the value cannot be verified for this element slot\r
+         * @expose\r
+         */\r
+        ElementPrototype.verifyValue = function(value) {\r
+            var self = this;\r
+            function fail(val, msg) {\r
+                throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+            }\r
+            switch (this.type) {\r
+                // Signed 32bit\r
+                case ProtoBuf.TYPES["int32"]:\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                    // Account for !NaN: value === value\r
+                    if (typeof value !== 'number' || (value === value &amp;&amp; value % 1 !== 0))\r
+                        fail(typeof value, "not an integer");\r
+                    return value > 4294967295 ? value | 0 : value;\r
+\r
+                // Unsigned 32bit\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    if (typeof value !== 'number' || (value === value &amp;&amp; value % 1 !== 0))\r
+                        fail(typeof value, "not an integer");\r
+                    return value &lt; 0 ? value >>> 0 : value;\r
+\r
+                // Signed 64bit\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]: {\r
+                    if (ProtoBuf.Long)\r
+                        try {\r
+                            return mkLong(value, false);\r
+                        } catch (e) {\r
+                            fail(typeof value, e.message);\r
+                        }\r
+                    else\r
+                        fail(typeof value, "requires Long.js");\r
+                }\r
+\r
+                // Unsigned 64bit\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                case ProtoBuf.TYPES["fixed64"]: {\r
+                    if (ProtoBuf.Long)\r
+                        try {\r
+                            return mkLong(value, true);\r
+                        } catch (e) {\r
+                            fail(typeof value, e.message);\r
+                        }\r
+                    else\r
+                        fail(typeof value, "requires Long.js");\r
+                }\r
+\r
+                // Bool\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    if (typeof value !== 'boolean')\r
+                        fail(typeof value, "not a boolean");\r
+                    return value;\r
+\r
+                // Float\r
+                case ProtoBuf.TYPES["float"]:\r
+                case ProtoBuf.TYPES["double"]:\r
+                    if (typeof value !== 'number')\r
+                        fail(typeof value, "not a number");\r
+                    return value;\r
+\r
+                // Length-delimited string\r
+                case ProtoBuf.TYPES["string"]:\r
+                    if (typeof value !== 'string' &amp;&amp; !(value &amp;&amp; value instanceof String))\r
+                        fail(typeof value, "not a string");\r
+                    return ""+value; // Convert String object to string\r
+\r
+                // Length-delimited bytes\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    if (ByteBuffer.isByteBuffer(value))\r
+                        return value;\r
+                    return ByteBuffer.wrap(value, "base64");\r
+\r
+                // Constant enum value\r
+                case ProtoBuf.TYPES["enum"]: {\r
+                    var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r
+                    for (i=0; i&lt;values.length; i++)\r
+                        if (values[i].name == value)\r
+                            return values[i].id;\r
+                        else if (values[i].id == value)\r
+                            return values[i].id;\r
+\r
+                    if (this.syntax === 'proto3') {\r
+                        // proto3: just make sure it's an integer.\r
+                        if (typeof value !== 'number' || (value === value &amp;&amp; value % 1 !== 0))\r
+                            fail(typeof value, "not an integer");\r
+                        if (value > 4294967295 || value &lt; 0)\r
+                            fail(typeof value, "not in range for uint32")\r
+                        return value;\r
+                    } else {\r
+                        // proto2 requires enum values to be valid.\r
+                        fail(value, "not a valid enum value");\r
+                    }\r
+                }\r
+                // Embedded message\r
+                case ProtoBuf.TYPES["group"]:\r
+                case ProtoBuf.TYPES["message"]: {\r
+                    if (!value || typeof value !== 'object')\r
+                        fail(typeof value, "object expected");\r
+                    if (value instanceof this.resolvedType.clazz)\r
+                        return value;\r
+                    if (value instanceof ProtoBuf.Builder.Message) {\r
+                        // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r
+                        var obj = {};\r
+                        for (var i in value)\r
+                            if (value.hasOwnProperty(i))\r
+                                obj[i] = value[i];\r
+                        value = obj;\r
+                    }\r
+                    // Else let's try to construct one from a key-value object\r
+                    return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r
+                }\r
+            }\r
+\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");\r
+        };\r
+\r
+        /**\r
+         * Calculates the byte length of an element on the wire.\r
+         * @param {number} id Field number\r
+         * @param {*} value Field value\r
+         * @returns {number} Byte length\r
+         * @throws {Error} If the value cannot be calculated\r
+         * @expose\r
+         */\r
+        ElementPrototype.calculateLength = function(id, value) {\r
+            if (value === null) return 0; // Nothing to encode\r
+            // Tag has already been written\r
+            var n;\r
+            switch (this.type) {\r
+                case ProtoBuf.TYPES["int32"]:\r
+                    return value &lt; 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                    return ByteBuffer.calculateVarint32(value);\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                    return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                case ProtoBuf.TYPES["float"]:\r
+                    return 4;\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                    return ByteBuffer.calculateVarint64(value);\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                    return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                    return 8;\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    return 1;\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    return ByteBuffer.calculateVarint32(value);\r
+                case ProtoBuf.TYPES["double"]:\r
+                    return 8;\r
+                case ProtoBuf.TYPES["string"]:\r
+                    n = ByteBuffer.calculateUTF8Bytes(value);\r
+                    return ByteBuffer.calculateVarint32(n) + n;\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    if (value.remaining() &lt; 0)\r
+                        throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+                    return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r
+                case ProtoBuf.TYPES["message"]:\r
+                    n = this.resolvedType.calculate(value);\r
+                    return ByteBuffer.calculateVarint32(n) + n;\r
+                case ProtoBuf.TYPES["group"]:\r
+                    n = this.resolvedType.calculate(value);\r
+                    return n + ByteBuffer.calculateVarint32((id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+            }\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+        };\r
+\r
+        /**\r
+         * Encodes a value to the specified buffer. Does not encode the key.\r
+         * @param {number} id Field number\r
+         * @param {*} value Field value\r
+         * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+         * @return {ByteBuffer} The ByteBuffer for chaining\r
+         * @throws {Error} If the value cannot be encoded\r
+         * @expose\r
+         */\r
+        ElementPrototype.encodeValue = function(id, value, buffer) {\r
+            if (value === null) return buffer; // Nothing to encode\r
+            // Tag has already been written\r
+\r
+            switch (this.type) {\r
+                // 32bit signed varint\r
+                case ProtoBuf.TYPES["int32"]:\r
+                    // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r
+                    // long – it is, effectively, treated like a very large unsigned integer." (see #122)\r
+                    if (value &lt; 0)\r
+                        buffer.writeVarint64(value);\r
+                    else\r
+                        buffer.writeVarint32(value);\r
+                    break;\r
+\r
+                // 32bit unsigned varint\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                    buffer.writeVarint32(value);\r
+                    break;\r
+\r
+                // 32bit varint zig-zag\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                    buffer.writeVarint32ZigZag(value);\r
+                    break;\r
+\r
+                // Fixed unsigned 32bit\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    buffer.writeUint32(value);\r
+                    break;\r
+\r
+                // Fixed signed 32bit\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                    buffer.writeInt32(value);\r
+                    break;\r
+\r
+                // 64bit varint as-is\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                    buffer.writeVarint64(value); // throws\r
+                    break;\r
+\r
+                // 64bit varint zig-zag\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                    buffer.writeVarint64ZigZag(value); // throws\r
+                    break;\r
+\r
+                // Fixed unsigned 64bit\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                    buffer.writeUint64(value); // throws\r
+                    break;\r
+\r
+                // Fixed signed 64bit\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                    buffer.writeInt64(value); // throws\r
+                    break;\r
+\r
+                // Bool\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    if (typeof value === 'string')\r
+                        buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r
+                    else\r
+                        buffer.writeVarint32(value ? 1 : 0);\r
+                    break;\r
+\r
+                // Constant enum value\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    buffer.writeVarint32(value);\r
+                    break;\r
+\r
+                // 32bit float\r
+                case ProtoBuf.TYPES["float"]:\r
+                    buffer.writeFloat32(value);\r
+                    break;\r
+\r
+                // 64bit float\r
+                case ProtoBuf.TYPES["double"]:\r
+                    buffer.writeFloat64(value);\r
+                    break;\r
+\r
+                // Length-delimited string\r
+                case ProtoBuf.TYPES["string"]:\r
+                    buffer.writeVString(value);\r
+                    break;\r
+\r
+                // Length-delimited bytes\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    if (value.remaining() &lt; 0)\r
+                        throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+                    var prevOffset = value.offset;\r
+                    buffer.writeVarint32(value.remaining());\r
+                    buffer.append(value);\r
+                    value.offset = prevOffset;\r
+                    break;\r
+\r
+                // Embedded message\r
+                case ProtoBuf.TYPES["message"]:\r
+                    var bb = new ByteBuffer().LE();\r
+                    this.resolvedType.encode(value, bb);\r
+                    buffer.writeVarint32(bb.offset);\r
+                    buffer.append(bb.flip());\r
+                    break;\r
+\r
+                // Legacy group\r
+                case ProtoBuf.TYPES["group"]:\r
+                    this.resolvedType.encode(value, buffer);\r
+                    buffer.writeVarint32((id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+                    break;\r
+\r
+                default:\r
+                    // We should never end here\r
+                    throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+            }\r
+            return buffer;\r
+        };\r
+\r
+        /**\r
+         * Decode one element value from the specified buffer.\r
+         * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+         * @param {number} wireType The field wire type\r
+         * @param {number} id The field number\r
+         * @return {*} Decoded value\r
+         * @throws {Error} If the field cannot be decoded\r
+         * @expose\r
+         */\r
+        ElementPrototype.decode = function(buffer, wireType, id) {\r
+            if (wireType != this.type.wireType)\r
+                throw Error("Unexpected wire type for element");\r
+\r
+            var value, nBytes;\r
+            switch (this.type) {\r
+                // 32bit signed varint\r
+                case ProtoBuf.TYPES["int32"]:\r
+                    return buffer.readVarint32() | 0;\r
+\r
+                // 32bit unsigned varint\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                    return buffer.readVarint32() >>> 0;\r
+\r
+                // 32bit signed varint zig-zag\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                    return buffer.readVarint32ZigZag() | 0;\r
+\r
+                // Fixed 32bit unsigned\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    return buffer.readUint32() >>> 0;\r
+\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                    return buffer.readInt32() | 0;\r
+\r
+                // 64bit signed varint\r
+                case ProtoBuf.TYPES["int64"]:\r
+                    return buffer.readVarint64();\r
+\r
+                // 64bit unsigned varint\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                    return buffer.readVarint64().toUnsigned();\r
+\r
+                // 64bit signed varint zig-zag\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                    return buffer.readVarint64ZigZag();\r
+\r
+                // Fixed 64bit unsigned\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                    return buffer.readUint64();\r
+\r
+                // Fixed 64bit signed\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                    return buffer.readInt64();\r
+\r
+                // Bool varint\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    return !!buffer.readVarint32();\r
+\r
+                // Constant enum value (varint)\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    // The following Builder.Message#set will already throw\r
+                    return buffer.readVarint32();\r
+\r
+                // 32bit float\r
+                case ProtoBuf.TYPES["float"]:\r
+                    return buffer.readFloat();\r
+\r
+                // 64bit float\r
+                case ProtoBuf.TYPES["double"]:\r
+                    return buffer.readDouble();\r
+\r
+                // Length-delimited string\r
+                case ProtoBuf.TYPES["string"]:\r
+                    return buffer.readVString();\r
+\r
+                // Length-delimited bytes\r
+                case ProtoBuf.TYPES["bytes"]: {\r
+                    nBytes = buffer.readVarint32();\r
+                    if (buffer.remaining() &lt; nBytes)\r
+                        throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+                    value = buffer.clone(); // Offset already set\r
+                    value.limit = value.offset+nBytes;\r
+                    buffer.offset += nBytes;\r
+                    return value;\r
+                }\r
+\r
+                // Length-delimited embedded message\r
+                case ProtoBuf.TYPES["message"]: {\r
+                    nBytes = buffer.readVarint32();\r
+                    return this.resolvedType.decode(buffer, nBytes);\r
+                }\r
+\r
+                // Legacy group\r
+                case ProtoBuf.TYPES["group"]:\r
+                    return this.resolvedType.decode(buffer, -1, id);\r
+            }\r
+\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal decode type");\r
+        };\r
+\r
+        /**\r
+         * Converts a value from a string to the canonical element type.\r
+         *\r
+         * Legal only when isMapKey is true.\r
+         *\r
+         * @param {string} str The string value\r
+         * @returns {*} The value\r
+         */\r
+        ElementPrototype.valueFromString = function(str) {\r
+            if (!this.isMapKey) {\r
+                throw Error("valueFromString() called on non-map-key element");\r
+            }\r
+\r
+            switch (this.type) {\r
+                case ProtoBuf.TYPES["int32"]:\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    return this.verifyValue(parseInt(str));\r
+\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                      // Long-based fields support conversions from string already.\r
+                      return this.verifyValue(str);\r
+\r
+                case ProtoBuf.TYPES["bool"]:\r
+                      return str === "true";\r
+\r
+                case ProtoBuf.TYPES["string"]:\r
+                      return this.verifyValue(str);\r
+\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                      return ByteBuffer.fromBinary(str);\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Converts a value from the canonical element type to a string.\r
+         *\r
+         * It should be the case that `valueFromString(valueToString(val))` returns\r
+         * a value equivalent to `verifyValue(val)` for every legal value of `val`\r
+         * according to this element type.\r
+         *\r
+         * This may be used when the element must be stored or used as a string,\r
+         * e.g., as a map key on an Object.\r
+         *\r
+         * Legal only when isMapKey is true.\r
+         *\r
+         * @param {*} val The value\r
+         * @returns {string} The string form of the value.\r
+         */\r
+        ElementPrototype.valueToString = function(value) {\r
+            if (!this.isMapKey) {\r
+                throw Error("valueToString() called on non-map-key element");\r
+            }\r
+\r
+            if (this.type === ProtoBuf.TYPES["bytes"]) {\r
+                return value.toString("binary");\r
+            } else {\r
+                return value.toString();\r
+            }\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Element\r
+         * @expose\r
+         */\r
+        Reflect.Element = Element;\r
+\r
+        /**\r
+         * Constructs a new Message.\r
+         * @exports ProtoBuf.Reflect.Message\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r
+         * @param {string} name Message name\r
+         * @param {Object.&lt;string,*>=} options Message options\r
+         * @param {boolean=} isGroup `true` if this is a legacy group\r
+         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Namespace\r
+         */\r
+        var Message = function(builder, parent, name, options, isGroup, syntax) {\r
+            Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Message";\r
+\r
+            /**\r
+             * Extensions range.\r
+             * @type {!Array.&lt;number>|undefined}\r
+             * @expose\r
+             */\r
+            this.extensions = undefined;\r
+\r
+            /**\r
+             * Runtime message class.\r
+             * @type {?function(new:ProtoBuf.Builder.Message)}\r
+             * @expose\r
+             */\r
+            this.clazz = null;\r
+\r
+            /**\r
+             * Whether this is a legacy group or not.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.isGroup = !!isGroup;\r
+\r
+            // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r
+\r
+            /**\r
+             * Cached fields.\r
+             * @type {?Array.&lt;!ProtoBuf.Reflect.Message.Field>}\r
+             * @private\r
+             */\r
+            this._fields = null;\r
+\r
+            /**\r
+             * Cached fields by id.\r
+             * @type {?Object.&lt;number,!ProtoBuf.Reflect.Message.Field>}\r
+             * @private\r
+             */\r
+            this._fieldsById = null;\r
+\r
+            /**\r
+             * Cached fields by name.\r
+             * @type {?Object.&lt;string,!ProtoBuf.Reflect.Message.Field>}\r
+             * @private\r
+             */\r
+            this._fieldsByName = null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.prototype\r
+         * @inner\r
+         */\r
+        var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r
+\r
+        /**\r
+         * Builds the message and returns the runtime counterpart, which is a fully functional class.\r
+         * @see ProtoBuf.Builder.Message\r
+         * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r
+         * @return {ProtoBuf.Reflect.Message} Message class\r
+         * @throws {Error} If the message cannot be built\r
+         * @expose\r
+         */\r
+        MessagePrototype.build = function(rebuild) {\r
+            if (this.clazz &amp;&amp; !rebuild)\r
+                return this.clazz;\r
+\r
+            // Create the runtime Message class in its own scope\r
+            var clazz = (function(ProtoBuf, T) {\r
+\r
+                var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r
+                    oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r
+\r
+                /**\r
+                 * Constructs a new runtime Message.\r
+                 * @name ProtoBuf.Builder.Message\r
+                 * @class Barebone of all runtime messages.\r
+                 * @param {!Object.&lt;string,*>|string} values Preset values\r
+                 * @param {...string} var_args\r
+                 * @constructor\r
+                 * @throws {Error} If the message cannot be created\r
+                 */\r
+                var Message = function(values, var_args) {\r
+                    ProtoBuf.Builder.Message.call(this);\r
+\r
+                    // Create virtual oneof properties\r
+                    for (var i=0, k=oneofs.length; i&lt;k; ++i)\r
+                        this[oneofs[i].name] = null;\r
+                    // Create fields and set default values\r
+                    for (i=0, k=fields.length; i&lt;k; ++i) {\r
+                        var field = fields[i];\r
+                        this[field.name] =\r
+                            field.repeated ? [] :\r
+                            (field.map ? new ProtoBuf.Map(field) : null);\r
+                        if ((field.required || T.syntax === 'proto3') &amp;&amp;\r
+                            field.defaultValue !== null)\r
+                            this[field.name] = field.defaultValue;\r
+                    }\r
+\r
+                    if (arguments.length > 0) {\r
+                        var value;\r
+                        // Set field values from a values object\r
+                        if (arguments.length === 1 &amp;&amp; values !== null &amp;&amp; typeof values === 'object' &amp;&amp;\r
+                            /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &amp;&amp;\r
+                            /* not a repeated field */ !Array.isArray(values) &amp;&amp;\r
+                            /* not a Map */ !(values instanceof ProtoBuf.Map) &amp;&amp;\r
+                            /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &amp;&amp;\r
+                            /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &amp;&amp;\r
+                            /* not a Long */ !(ProtoBuf.Long &amp;&amp; values instanceof ProtoBuf.Long)) {\r
+                            this.$set(values);\r
+                        } else // Set field values from arguments, in declaration order\r
+                            for (i=0, k=arguments.length; i&lt;k; ++i)\r
+                                if (typeof (value = arguments[i]) !== 'undefined')\r
+                                    this.$set(fields[i].name, value); // May throw\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * @alias ProtoBuf.Builder.Message.prototype\r
+                 * @inner\r
+                 */\r
+                var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);\r
+\r
+                /**\r
+                 * Adds a value to a repeated field.\r
+                 * @name ProtoBuf.Builder.Message#add\r
+                 * @function\r
+                 * @param {string} key Field name\r
+                 * @param {*} value Value to add\r
+                 * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @throws {Error} If the value cannot be added\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.add = function(key, value, noAssert) {\r
+                    var field = T._fieldsByName[key];\r
+                    if (!noAssert) {\r
+                        if (!field)\r
+                            throw Error(this+"#"+key+" is undefined");\r
+                        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                            throw Error(this+"#"+key+" is not a field: "+field.toString(true)); // May throw if it's an enum or embedded message\r
+                        if (!field.repeated)\r
+                            throw Error(this+"#"+key+" is not a repeated field");\r
+                        value = field.verifyValue(value, true);\r
+                    }\r
+                    if (this[key] === null)\r
+                        this[key] = [];\r
+                    this[key].push(value);\r
+                    return this;\r
+                };\r
+\r
+                /**\r
+                 * Adds a value to a repeated field. This is an alias for {@link ProtoBuf.Builder.Message#add}.\r
+                 * @name ProtoBuf.Builder.Message#$add\r
+                 * @function\r
+                 * @param {string} key Field name\r
+                 * @param {*} value Value to add\r
+                 * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @throws {Error} If the value cannot be added\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.$add = MessagePrototype.add;\r
+\r
+                /**\r
+                 * Sets a field's value.\r
+                 * @name ProtoBuf.Builder.Message#set\r
+                 * @function\r
+                 * @param {string|!Object.&lt;string,*>} keyOrObj String key or plain object holding multiple values\r
+                 * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+                 * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @throws {Error} If the value cannot be set\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.set = function(keyOrObj, value, noAssert) {\r
+                    if (keyOrObj &amp;&amp; typeof keyOrObj === 'object') {\r
+                        noAssert = value;\r
+                        for (var ikey in keyOrObj) {\r
+                            // Check if virtual oneof field - don't set these\r
+                            if (keyOrObj.hasOwnProperty(ikey) &amp;&amp; typeof (value = keyOrObj[ikey]) !== 'undefined' &amp;&amp; T._oneofsByName[ikey] === undefined)\r
+                                this.$set(ikey, value, noAssert);\r
+                        }\r
+                        return this;\r
+                    }\r
+                    var field = T._fieldsByName[keyOrObj];\r
+                    if (!noAssert) {\r
+                        if (!field)\r
+                            throw Error(this+"#"+keyOrObj+" is not a field: undefined");\r
+                        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                            throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));\r
+                        this[field.name] = (value = field.verifyValue(value)); // May throw\r
+                    } else\r
+                        this[keyOrObj] = value;\r
+                    if (field &amp;&amp; field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+                        var currentField = this[field.oneof.name]; // Virtual field references currently set field\r
+                        if (value !== null) {\r
+                            if (currentField !== null &amp;&amp; currentField !== field.name)\r
+                                this[currentField] = null; // Clear currently set field\r
+                            this[field.oneof.name] = field.name; // Point virtual field at this field\r
+                        } else if (/* value === null &amp;&amp; */currentField === keyOrObj)\r
+                            this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r
+                    }\r
+                    return this;\r
+                };\r
+\r
+                /**\r
+                 * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r
+                 * @name ProtoBuf.Builder.Message#$set\r
+                 * @function\r
+                 * @param {string|!Object.&lt;string,*>} keyOrObj String key or plain object holding multiple values\r
+                 * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                 * @throws {Error} If the value cannot be set\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.$set = MessagePrototype.set;\r
+\r
+                /**\r
+                 * Gets a field's value.\r
+                 * @name ProtoBuf.Builder.Message#get\r
+                 * @function\r
+                 * @param {string} key Key\r
+                 * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r
+                 * @return {*} Value\r
+                 * @throws {Error} If there is no such field\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.get = function(key, noAssert) {\r
+                    if (noAssert)\r
+                        return this[key];\r
+                    var field = T._fieldsByName[key];\r
+                    if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                        throw Error(this+"#"+key+" is not a field: undefined");\r
+                    if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                        throw Error(this+"#"+key+" is not a field: "+field.toString(true));\r
+                    return this[field.name];\r
+                };\r
+\r
+                /**\r
+                 * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r
+                 * @name ProtoBuf.Builder.Message#$get\r
+                 * @function\r
+                 * @param {string} key Key\r
+                 * @return {*} Value\r
+                 * @throws {Error} If there is no such field\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.$get = MessagePrototype.get;\r
+\r
+                // Getters and setters\r
+\r
+                for (var i=0; i&lt;fields.length; i++) {\r
+                    var field = fields[i];\r
+                    // no setters for extension fields as these are named by their fqn\r
+                    if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+                        continue;\r
+\r
+                    if (T.builder.options['populateAccessors'])\r
+                        (function(field) {\r
+                            // set/get[SomeValue]\r
+                            var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {\r
+                                return match.toUpperCase().replace('_','');\r
+                            });\r
+                            Name = Name.substring(0,1).toUpperCase() + Name.substring(1);\r
+\r
+                            // set/get_[some_value] FIXME: Do we really need these?\r
+                            var name = field.originalName.replace(/([A-Z])/g, function(match) {\r
+                                return "_"+match;\r
+                            });\r
+\r
+                            /**\r
+                             * The current field's unbound setter function.\r
+                             * @function\r
+                             * @param {*} value\r
+                             * @param {boolean=} noAssert\r
+                             * @returns {!ProtoBuf.Builder.Message}\r
+                             * @inner\r
+                             */\r
+                            var setter = function(value, noAssert) {\r
+                                this[field.name] = noAssert ? value : field.verifyValue(value);\r
+                                return this;\r
+                            };\r
+\r
+                            /**\r
+                             * The current field's unbound getter function.\r
+                             * @function\r
+                             * @returns {*}\r
+                             * @inner\r
+                             */\r
+                            var getter = function() {\r
+                                return this[field.name];\r
+                            };\r
+\r
+                            if (T.getChild("set"+Name) === null)\r
+                                /**\r
+                                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#set[SomeField]\r
+                                 * @function\r
+                                 * @param {*} value Value to set\r
+                                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                                 * @returns {!ProtoBuf.Builder.Message} this\r
+                                 * @abstract\r
+                                 * @throws {Error} If the value cannot be set\r
+                                 */\r
+                                MessagePrototype["set"+Name] = setter;\r
+\r
+                            if (T.getChild("set_"+name) === null)\r
+                                /**\r
+                                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#set_[some_field]\r
+                                 * @function\r
+                                 * @param {*} value Value to set\r
+                                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                                 * @returns {!ProtoBuf.Builder.Message} this\r
+                                 * @abstract\r
+                                 * @throws {Error} If the value cannot be set\r
+                                 */\r
+                                MessagePrototype["set_"+name] = setter;\r
+\r
+                            if (T.getChild("get"+Name) === null)\r
+                                /**\r
+                                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#get[SomeField]\r
+                                 * @function\r
+                                 * @abstract\r
+                                 * @return {*} The value\r
+                                 */\r
+                                MessagePrototype["get"+Name] = getter;\r
+\r
+                            if (T.getChild("get_"+name) === null)\r
+                                /**\r
+                                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#get_[some_field]\r
+                                 * @function\r
+                                 * @return {*} The value\r
+                                 * @abstract\r
+                                 */\r
+                                MessagePrototype["get_"+name] = getter;\r
+\r
+                        })(field);\r
+                }\r
+\r
+                // En-/decoding\r
+\r
+                /**\r
+                 * Encodes the message.\r
+                 * @name ProtoBuf.Builder.Message#$encode\r
+                 * @function\r
+                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 * @see ProtoBuf.Builder.Message#encode64\r
+                 * @see ProtoBuf.Builder.Message#encodeHex\r
+                 * @see ProtoBuf.Builder.Message#encodeAB\r
+                 */\r
+                MessagePrototype.encode = function(buffer, noVerify) {\r
+                    if (typeof buffer === 'boolean')\r
+                        noVerify = buffer,\r
+                        buffer = undefined;\r
+                    var isNew = false;\r
+                    if (!buffer)\r
+                        buffer = new ByteBuffer(),\r
+                        isNew = true;\r
+                    var le = buffer.littleEndian;\r
+                    try {\r
+                        T.encode(this, buffer.LE(), noVerify);\r
+                        return (isNew ? buffer.flip() : buffer).LE(le);\r
+                    } catch (e) {\r
+                        buffer.LE(le);\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Encodes a message using the specified data payload.\r
+                 * @param {!Object.&lt;string,*>} data Data payload\r
+                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+                 * @expose\r
+                 */\r
+                Message.encode = function(data, buffer, noVerify) {\r
+                    return new Message(data).encode(buffer, noVerify);\r
+                };\r
+\r
+                /**\r
+                 * Calculates the byte length of the message.\r
+                 * @name ProtoBuf.Builder.Message#calculate\r
+                 * @function\r
+                 * @returns {number} Byte length\r
+                 * @throws {Error} If the message cannot be calculated or if required fields are missing.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.calculate = function() {\r
+                    return T.calculate(this);\r
+                };\r
+\r
+                /**\r
+                 * Encodes the varint32 length-delimited message.\r
+                 * @name ProtoBuf.Builder.Message#encodeDelimited\r
+                 * @function\r
+                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r
+                    var isNew = false;\r
+                    if (!buffer)\r
+                        buffer = new ByteBuffer(),\r
+                        isNew = true;\r
+                    var enc = new ByteBuffer().LE();\r
+                    T.encode(this, enc, noVerify).flip();\r
+                    buffer.writeVarint32(enc.remaining());\r
+                    buffer.append(enc);\r
+                    return isNew ? buffer.flip() : buffer;\r
+                };\r
+\r
+                /**\r
+                 * Directly encodes the message to an ArrayBuffer.\r
+                 * @name ProtoBuf.Builder.Message#encodeAB\r
+                 * @function\r
+                 * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeAB = function() {\r
+                    try {\r
+                        return this.encode().toArrayBuffer();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r
+                 * @name ProtoBuf.Builder.Message#toArrayBuffer\r
+                 * @function\r
+                 * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r
+\r
+                /**\r
+                 * Directly encodes the message to a node Buffer.\r
+                 * @name ProtoBuf.Builder.Message#encodeNB\r
+                 * @function\r
+                 * @return {!Buffer}\r
+                 * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r
+                 *  missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeNB = function() {\r
+                    try {\r
+                        return this.encode().toBuffer();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r
+                 * @name ProtoBuf.Builder.Message#toBuffer\r
+                 * @function\r
+                 * @return {!Buffer}\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded node Buffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r
+\r
+                /**\r
+                 * Directly encodes the message to a base64 encoded string.\r
+                 * @name ProtoBuf.Builder.Message#encode64\r
+                 * @function\r
+                 * @return {string} Base64 encoded string\r
+                 * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+                 *  still returns the encoded base64 string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encode64 = function() {\r
+                    try {\r
+                        return this.encode().toBase64();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r
+                 * @name ProtoBuf.Builder.Message#toBase64\r
+                 * @function\r
+                 * @return {string} Base64 encoded string\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded base64 string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toBase64 = MessagePrototype.encode64;\r
+\r
+                /**\r
+                 * Directly encodes the message to a hex encoded string.\r
+                 * @name ProtoBuf.Builder.Message#encodeHex\r
+                 * @function\r
+                 * @return {string} Hex encoded string\r
+                 * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+                 *  still returns the encoded hex string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeHex = function() {\r
+                    try {\r
+                        return this.encode().toHex();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toHex();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r
+                 * @name ProtoBuf.Builder.Message#toHex\r
+                 * @function\r
+                 * @return {string} Hex encoded string\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded hex string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toHex = MessagePrototype.encodeHex;\r
+\r
+                /**\r
+                 * Clones a message object or field value to a raw object.\r
+                 * @param {*} obj Object to clone\r
+                 * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r
+                 * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+                 * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r
+                 * @returns {*} Cloned object\r
+                 * @inner\r
+                 */\r
+                function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r
+                    if (obj === null || typeof obj !== 'object') {\r
+                        // Convert enum values to their respective names\r
+                        if (resolvedType &amp;&amp; resolvedType instanceof ProtoBuf.Reflect.Enum) {\r
+                            var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r
+                            if (name !== null)\r
+                                return name;\r
+                        }\r
+                        // Pass-through string, number, boolean, null...\r
+                        return obj;\r
+                    }\r
+                    // Convert ByteBuffers to raw buffer or strings\r
+                    if (ByteBuffer.isByteBuffer(obj))\r
+                        return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r
+                    // Convert Longs to proper objects or strings\r
+                    if (ProtoBuf.Long.isLong(obj))\r
+                        return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r
+                    var clone;\r
+                    // Clone arrays\r
+                    if (Array.isArray(obj)) {\r
+                        clone = [];\r
+                        obj.forEach(function(v, k) {\r
+                            clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r
+                        });\r
+                        return clone;\r
+                    }\r
+                    clone = {};\r
+                    // Convert maps to objects\r
+                    if (obj instanceof ProtoBuf.Map) {\r
+                        var it = obj.entries();\r
+                        for (var e = it.next(); !e.done; e = it.next())\r
+                            clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r
+                        return clone;\r
+                    }\r
+                    // Everything else is a non-null object\r
+                    var type = obj.$type,\r
+                        field = undefined;\r
+                    for (var i in obj)\r
+                        if (obj.hasOwnProperty(i)) {\r
+                            if (type &amp;&amp; (field = type.getChild(i)))\r
+                                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r
+                            else\r
+                                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r
+                        }\r
+                    return clone;\r
+                }\r
+\r
+                /**\r
+                 * Returns the message's raw payload.\r
+                 * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r
+                 * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+                 * @returns {Object.&lt;string,*>} Raw payload\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r
+                    return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r
+                };\r
+\r
+                /**\r
+                 * Encodes a message to JSON.\r
+                 * @returns {string} JSON string\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeJSON = function() {\r
+                    return JSON.stringify(\r
+                        cloneRaw(this,\r
+                             /* binary-as-base64 */ true,\r
+                             /* longs-as-strings */ true,\r
+                             this.$type\r
+                        )\r
+                    );\r
+                };\r
+\r
+                /**\r
+                 * Decodes a message from the specified buffer or string.\r
+                 * @name ProtoBuf.Builder.Message.decode\r
+                 * @function\r
+                 * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+                 * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r
+                 * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 * @see ProtoBuf.Builder.Message.decode64\r
+                 * @see ProtoBuf.Builder.Message.decodeHex\r
+                 */\r
+                Message.decode = function(buffer, length, enc) {\r
+                    if (typeof length === 'string')\r
+                        enc = length,\r
+                        length = -1;\r
+                    if (typeof buffer === 'string')\r
+                        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+                    else if (!ByteBuffer.isByteBuffer(buffer))\r
+                        buffer = ByteBuffer.wrap(buffer); // May throw\r
+                    var le = buffer.littleEndian;\r
+                    try {\r
+                        var msg = T.decode(buffer.LE(), length);\r
+                        buffer.LE(le);\r
+                        return msg;\r
+                    } catch (e) {\r
+                        buffer.LE(le);\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Decodes a varint32 length-delimited message from the specified buffer or string.\r
+                 * @name ProtoBuf.Builder.Message.decodeDelimited\r
+                 * @function\r
+                 * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+                 * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+                 * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                Message.decodeDelimited = function(buffer, enc) {\r
+                    if (typeof buffer === 'string')\r
+                        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+                    else if (!ByteBuffer.isByteBuffer(buffer))\r
+                        buffer = ByteBuffer.wrap(buffer); // May throw\r
+                    if (buffer.remaining() &lt; 1)\r
+                        return null;\r
+                    var off = buffer.offset,\r
+                        len = buffer.readVarint32();\r
+                    if (buffer.remaining() &lt; len) {\r
+                        buffer.offset = off;\r
+                        return null;\r
+                    }\r
+                    try {\r
+                        var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r
+                        buffer.offset += len;\r
+                        return msg;\r
+                    } catch (err) {\r
+                        buffer.offset += len;\r
+                        throw err;\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Decodes the message from the specified base64 encoded string.\r
+                 * @name ProtoBuf.Builder.Message.decode64\r
+                 * @function\r
+                 * @param {string} str String to decode from\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                Message.decode64 = function(str) {\r
+                    return Message.decode(str, "base64");\r
+                };\r
+\r
+                /**\r
+                 * Decodes the message from the specified hex encoded string.\r
+                 * @name ProtoBuf.Builder.Message.decodeHex\r
+                 * @function\r
+                 * @param {string} str String to decode from\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                Message.decodeHex = function(str) {\r
+                    return Message.decode(str, "hex");\r
+                };\r
+\r
+                /**\r
+                 * Decodes the message from a JSON string.\r
+                 * @name ProtoBuf.Builder.Message.decodeJSON\r
+                 * @function\r
+                 * @param {string} str String to decode from\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are\r
+                 * missing.\r
+                 * @expose\r
+                 */\r
+                Message.decodeJSON = function(str) {\r
+                    return new Message(JSON.parse(str));\r
+                };\r
+\r
+                // Utility\r
+\r
+                /**\r
+                 * Returns a string representation of this Message.\r
+                 * @name ProtoBuf.Builder.Message#toString\r
+                 * @function\r
+                 * @return {string} String representation as of ".Fully.Qualified.MessageName"\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toString = function() {\r
+                    return T.toString();\r
+                };\r
+\r
+                // Properties\r
+\r
+                /**\r
+                 * Message options.\r
+                 * @name ProtoBuf.Builder.Message.$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $optionsS; // cc needs this\r
+\r
+                /**\r
+                 * Message options.\r
+                 * @name ProtoBuf.Builder.Message#$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $options;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Message.$type\r
+                 * @type {!ProtoBuf.Reflect.Message}\r
+                 * @expose\r
+                 */\r
+                var $typeS;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Message#$type\r
+                 * @type {!ProtoBuf.Reflect.Message}\r
+                 * @expose\r
+                 */\r
+                var $type;\r
+\r
+                if (Object.defineProperty)\r
+                    Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),\r
+                    Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),\r
+                    Object.defineProperty(Message, "$type", { "value": T }),\r
+                    Object.defineProperty(MessagePrototype, "$type", { "value": T });\r
+\r
+                return Message;\r
+\r
+            })(ProtoBuf, this);\r
+\r
+            // Static enums and prototyped sub-messages / cached collections\r
+            this._fields = [];\r
+            this._fieldsById = {};\r
+            this._fieldsByName = {};\r
+            this._oneofsByName = {};\r
+            for (var i=0, k=this.children.length, child; i&lt;k; i++) {\r
+                child = this.children[i];\r
+                if (child instanceof Enum || child instanceof Message || child instanceof Service) {\r
+                    if (clazz.hasOwnProperty(child.name))\r
+                        throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");\r
+                    clazz[child.name] = child.build();\r
+                } else if (child instanceof Message.Field)\r
+                    child.build(),\r
+                    this._fields.push(child),\r
+                    this._fieldsById[child.id] = child,\r
+                    this._fieldsByName[child.name] = child;\r
+                else if (child instanceof Message.OneOf) {\r
+                    this._oneofsByName[child.name] = child;\r
+                }\r
+                else if (!(child instanceof Message.OneOf) &amp;&amp; !(child instanceof Extension)) // Not built\r
+                    throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));\r
+            }\r
+\r
+            return this.clazz = clazz;\r
+        };\r
+\r
+        /**\r
+         * Encodes a runtime message's contents to the specified buffer.\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+         * @param {ByteBuffer} buffer ByteBuffer to write to\r
+         * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+         * @return {ByteBuffer} The ByteBuffer for chaining\r
+         * @throws {Error} If required fields are missing or the message cannot be encoded for another reason\r
+         * @expose\r
+         */\r
+        MessagePrototype.encode = function(message, buffer, noVerify) {\r
+            var fieldMissing = null,\r
+                field;\r
+            for (var i=0, k=this._fields.length, val; i&lt;k; ++i) {\r
+                field = this._fields[i];\r
+                val = message[field.name];\r
+                if (field.required &amp;&amp; val === null) {\r
+                    if (fieldMissing === null)\r
+                        fieldMissing = field;\r
+                } else\r
+                    field.encode(noVerify ? val : field.verifyValue(val), buffer, message);\r
+            }\r
+            if (fieldMissing !== null) {\r
+                var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);\r
+                err["encoded"] = buffer; // Still expose what we got\r
+                throw(err);\r
+            }\r
+            return buffer;\r
+        };\r
+\r
+        /**\r
+         * Calculates a runtime message's byte length.\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+         * @returns {number} Byte length\r
+         * @throws {Error} If required fields are missing or the message cannot be calculated for another reason\r
+         * @expose\r
+         */\r
+        MessagePrototype.calculate = function(message) {\r
+            for (var n=0, i=0, k=this._fields.length, field, val; i&lt;k; ++i) {\r
+                field = this._fields[i];\r
+                val = message[field.name];\r
+                if (field.required &amp;&amp; val === null)\r
+                   throw Error("Missing at least one required field for "+this.toString(true)+": "+field);\r
+                else\r
+                    n += field.calculate(val, message);\r
+            }\r
+            return n;\r
+        };\r
+\r
+        /**\r
+         * Skips all data until the end of the specified group has been reached.\r
+         * @param {number} expectedId Expected GROUPEND id\r
+         * @param {!ByteBuffer} buf ByteBuffer\r
+         * @returns {boolean} `true` if a value as been skipped, `false` if the end has been reached\r
+         * @throws {Error} If it wasn't possible to find the end of the group (buffer overrun or end tag mismatch)\r
+         * @inner\r
+         */\r
+        function skipTillGroupEnd(expectedId, buf) {\r
+            var tag = buf.readVarint32(), // Throws on OOB\r
+                wireType = tag &amp; 0x07,\r
+                id = tag >>> 3;\r
+            switch (wireType) {\r
+                case ProtoBuf.WIRE_TYPES.VARINT:\r
+                    do tag = buf.readUint8();\r
+                    while ((tag &amp; 0x80) === 0x80);\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.BITS64:\r
+                    buf.offset += 8;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.LDELIM:\r
+                    tag = buf.readVarint32(); // reads the varint\r
+                    buf.offset += tag;        // skips n bytes\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+                    skipTillGroupEnd(id, buf);\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.ENDGROUP:\r
+                    if (id === expectedId)\r
+                        return false;\r
+                    else\r
+                        throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");\r
+                case ProtoBuf.WIRE_TYPES.BITS32:\r
+                    buf.offset += 4;\r
+                    break;\r
+                default:\r
+                    throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);\r
+            }\r
+            return true;\r
+        }\r
+\r
+        /**\r
+         * Decodes an encoded message and returns the decoded message.\r
+         * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+         * @param {number=} length Message length. Defaults to decode all remaining data.\r
+         * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r
+         * @return {ProtoBuf.Builder.Message} Decoded message\r
+         * @throws {Error} If the message cannot be decoded\r
+         * @expose\r
+         */\r
+        MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r
+            if (typeof length !== 'number')\r
+                length = -1;\r
+            var start = buffer.offset,\r
+                msg = new (this.clazz)(),\r
+                tag, wireType, id, field;\r
+            while (buffer.offset &lt; start+length || (length === -1 &amp;&amp; buffer.remaining() > 0)) {\r
+                tag = buffer.readVarint32();\r
+                wireType = tag &amp; 0x07;\r
+                id = tag >>> 3;\r
+                if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r
+                    if (id !== expectedGroupEndId)\r
+                        throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");\r
+                    break;\r
+                }\r
+                if (!(field = this._fieldsById[id])) {\r
+                    // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing."\r
+                    switch (wireType) {\r
+                        case ProtoBuf.WIRE_TYPES.VARINT:\r
+                            buffer.readVarint32();\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.BITS32:\r
+                            buffer.offset += 4;\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.BITS64:\r
+                            buffer.offset += 8;\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.LDELIM:\r
+                            var len = buffer.readVarint32();\r
+                            buffer.offset += len;\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+                            while (skipTillGroupEnd(id, buffer)) {}\r
+                            break;\r
+                        default:\r
+                            throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);\r
+                    }\r
+                    continue;\r
+                }\r
+                if (field.repeated &amp;&amp; !field.options["packed"]) {\r
+                    msg[field.name].push(field.decode(wireType, buffer));\r
+                } else if (field.map) {\r
+                    var keyval = field.decode(wireType, buffer);\r
+                    msg[field.name].set(keyval[0], keyval[1]);\r
+                } else {\r
+                    msg[field.name] = field.decode(wireType, buffer);\r
+                    if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+                        var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r
+                        if (currentField !== null &amp;&amp; currentField !== field.name)\r
+                            msg[currentField] = null; // Clear currently set field\r
+                        msg[field.oneof.name] = field.name; // Point virtual field at this field\r
+                    }\r
+                }\r
+            }\r
+\r
+            // Check if all required fields are present and set default values for optional fields that are not\r
+            for (var i=0, k=this._fields.length; i&lt;k; ++i) {\r
+                field = this._fields[i];\r
+                if (msg[field.name] === null) {\r
+                    if (this.syntax === "proto3") { // Proto3 sets default values by specification\r
+                        msg[field.name] = field.defaultValue;\r
+                    } else if (field.required) {\r
+                        var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);\r
+                        err["decoded"] = msg; // Still expose what we got\r
+                        throw(err);\r
+                    } else if (ProtoBuf.populateDefaults &amp;&amp; field.defaultValue !== null)\r
+                        msg[field.name] = field.defaultValue;\r
+                }\r
+            }\r
+            return msg;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message\r
+         * @expose\r
+         */\r
+        Reflect.Message = Message;\r
+\r
+        /**\r
+         * Constructs a new Message Field.\r
+         * @exports ProtoBuf.Reflect.Message.Field\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+         * @param {string} rule Rule, one of requried, optional, repeated\r
+         * @param {string?} keytype Key data type, if any.\r
+         * @param {string} type Data type, e.g. int32\r
+         * @param {string} name Field name\r
+         * @param {number} id Unique field id\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r
+         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r
+            T.call(this, builder, message, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Message.Field";\r
+\r
+            /**\r
+             * Message field required flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.required = rule === "required";\r
+\r
+            /**\r
+             * Message field repeated flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.repeated = rule === "repeated";\r
+\r
+            /**\r
+             * Message field map flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.map = rule === "map";\r
+\r
+            /**\r
+             * Message field key type. Type reference string if unresolved, protobuf\r
+             * type if resolved. Valid only if this.map === true, null otherwise.\r
+             * @type {string|{name: string, wireType: number}|null}\r
+             * @expose\r
+             */\r
+            this.keyType = keytype || null;\r
+\r
+            /**\r
+             * Message field type. Type reference string if unresolved, protobuf type if\r
+             * resolved. In a map field, this is the value type.\r
+             * @type {string|{name: string, wireType: number}}\r
+             * @expose\r
+             */\r
+            this.type = type;\r
+\r
+            /**\r
+             * Resolved type reference inside the global namespace.\r
+             * @type {ProtoBuf.Reflect.T|null}\r
+             * @expose\r
+             */\r
+            this.resolvedType = null;\r
+\r
+            /**\r
+             * Unique message field id.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.id = id;\r
+\r
+            /**\r
+             * Message field options.\r
+             * @type {!Object.&lt;string,*>}\r
+             * @dict\r
+             * @expose\r
+             */\r
+            this.options = options || {};\r
+\r
+            /**\r
+             * Default value.\r
+             * @type {*}\r
+             * @expose\r
+             */\r
+            this.defaultValue = null;\r
+\r
+            /**\r
+             * Enclosing OneOf.\r
+             * @type {?ProtoBuf.Reflect.Message.OneOf}\r
+             * @expose\r
+             */\r
+            this.oneof = oneof || null;\r
+\r
+            /**\r
+             * Syntax level of this definition (e.g., proto3).\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.syntax = syntax || 'proto2';\r
+\r
+            /**\r
+             * Original field name.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r
+\r
+            /**\r
+             * Element implementation. Created in build() after types are resolved.\r
+             * @type {ProtoBuf.Element}\r
+             * @expose\r
+             */\r
+            this.element = null;\r
+\r
+            /**\r
+             * Key element implementation, for map fields. Created in build() after\r
+             * types are resolved.\r
+             * @type {ProtoBuf.Element}\r
+             * @expose\r
+             */\r
+            this.keyElement = null;\r
+\r
+            // Convert field names to camel case notation if the override is set\r
+            if (this.builder.options['convertFieldsToCamelCase'] &amp;&amp; !(this instanceof Message.ExtensionField))\r
+                this.name = ProtoBuf.Util.toCamelCase(this.name);\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.Field.prototype\r
+         * @inner\r
+         */\r
+        var FieldPrototype = Field.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * Builds the field.\r
+         * @override\r
+         * @expose\r
+         */\r
+        FieldPrototype.build = function() {\r
+            this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r
+            if (this.map)\r
+                this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r
+\r
+            // In proto3, fields do not have field presence, and every field is set to\r
+            // its type's default value ("", 0, 0.0, or false).\r
+            if (this.syntax === 'proto3' &amp;&amp; !this.repeated &amp;&amp; !this.map)\r
+                this.defaultValue = Element.defaultFieldValue(this.type);\r
+\r
+            // Otherwise, default values are present when explicitly specified\r
+            else if (typeof this.options['default'] !== 'undefined')\r
+                this.defaultValue = this.verifyValue(this.options['default']);\r
+        };\r
+\r
+        /**\r
+         * Checks if the given value can be set for this field.\r
+         * @param {*} value Value to check\r
+         * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r
+         * @return {*} Verified, maybe adjusted, value\r
+         * @throws {Error} If the value cannot be set for this field\r
+         * @expose\r
+         */\r
+        FieldPrototype.verifyValue = function(value, skipRepeated) {\r
+            skipRepeated = skipRepeated || false;\r
+            var self = this;\r
+            function fail(val, msg) {\r
+                throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+            }\r
+            if (value === null) { // NULL values for optional fields\r
+                if (this.required)\r
+                    fail(typeof value, "required");\r
+                if (this.syntax === 'proto3' &amp;&amp; this.type !== ProtoBuf.TYPES["message"])\r
+                    fail(typeof value, "proto3 field without field presence cannot be null");\r
+                return null;\r
+            }\r
+            var i;\r
+            if (this.repeated &amp;&amp; !skipRepeated) { // Repeated values as arrays\r
+                if (!Array.isArray(value))\r
+                    value = [value];\r
+                var res = [];\r
+                for (i=0; i&lt;value.length; i++)\r
+                    res.push(this.element.verifyValue(value[i]));\r
+                return res;\r
+            }\r
+            if (this.map &amp;&amp; !skipRepeated) { // Map values as objects\r
+                if (!(value instanceof ProtoBuf.Map)) {\r
+                    // If not already a Map, attempt to convert.\r
+                    if (!(value instanceof Object)) {\r
+                        fail(typeof value,\r
+                             "expected ProtoBuf.Map or raw object for map field");\r
+                    }\r
+                    return new ProtoBuf.Map(this, value);\r
+                } else {\r
+                    return value;\r
+                }\r
+            }\r
+            // All non-repeated fields expect no array\r
+            if (!this.repeated &amp;&amp; Array.isArray(value))\r
+                fail(typeof value, "no array expected");\r
+\r
+            return this.element.verifyValue(value);\r
+        };\r
+\r
+        /**\r
+         * Determines whether the field will have a presence on the wire given its\r
+         * value.\r
+         * @param {*} value Verified field value\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+         * @return {boolean} Whether the field will be present on the wire\r
+         */\r
+        FieldPrototype.hasWirePresence = function(value, message) {\r
+            if (this.syntax !== 'proto3')\r
+                return (value !== null);\r
+            if (this.oneof &amp;&amp; message[this.oneof.name] === this.name)\r
+                return true;\r
+            switch (this.type) {\r
+                case ProtoBuf.TYPES["int32"]:\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    return value !== 0;\r
+\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                    return value.low !== 0 || value.high !== 0;\r
+\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    return value;\r
+\r
+                case ProtoBuf.TYPES["float"]:\r
+                case ProtoBuf.TYPES["double"]:\r
+                    return value !== 0.0;\r
+\r
+                case ProtoBuf.TYPES["string"]:\r
+                    return value.length > 0;\r
+\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    return value.remaining() > 0;\r
+\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    return value !== 0;\r
+\r
+                case ProtoBuf.TYPES["message"]:\r
+                    return value !== null;\r
+                default:\r
+                    return true;\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Encodes the specified field value to the specified buffer.\r
+         * @param {*} value Verified field value\r
+         * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+         * @return {ByteBuffer} The ByteBuffer for chaining\r
+         * @throws {Error} If the field cannot be encoded\r
+         * @expose\r
+         */\r
+        FieldPrototype.encode = function(value, buffer, message) {\r
+            if (this.type === null || typeof this.type !== 'object')\r
+                throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+            if (value === null || (this.repeated &amp;&amp; value.length == 0))\r
+                return buffer; // Optional omitted\r
+            try {\r
+                if (this.repeated) {\r
+                    var i;\r
+                    // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r
+                    // types) can be declared 'packed'."\r
+                    if (this.options["packed"] &amp;&amp; ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                        // "All of the elements of the field are packed into a single key-value pair with wire type 2\r
+                        // (length-delimited). Each element is encoded the same way it would be normally, except without a\r
+                        // tag preceding it."\r
+                        buffer.writeVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r
+                        var start = buffer.offset; // Remember where the contents begin\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            this.element.encodeValue(this.id, value[i], buffer);\r
+                        var len = buffer.offset-start,\r
+                            varintLen = ByteBuffer.calculateVarint32(len);\r
+                        if (varintLen > 1) { // We need to move the contents\r
+                            var contents = buffer.slice(start, buffer.offset);\r
+                            start += varintLen-1;\r
+                            buffer.offset = start;\r
+                            buffer.append(contents);\r
+                        }\r
+                        buffer.writeVarint32(len, start-varintLen);\r
+                    } else {\r
+                        // "If your message definition has repeated elements (without the [packed=true] option), the encoded\r
+                        // message has zero or more key-value pairs with the same tag number"\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            buffer.writeVarint32((this.id &lt;&lt; 3) | this.type.wireType),\r
+                            this.element.encodeValue(this.id, value[i], buffer);\r
+                    }\r
+                } else if (this.map) {\r
+                    // Write out each map entry as a submessage.\r
+                    value.forEach(function(val, key, m) {\r
+                        // Compute the length of the submessage (key, val) pair.\r
+                        var length =\r
+                            ByteBuffer.calculateVarint32((1 &lt;&lt; 3) | this.keyType.wireType) +\r
+                            this.keyElement.calculateLength(1, key) +\r
+                            ByteBuffer.calculateVarint32((2 &lt;&lt; 3) | this.type.wireType) +\r
+                            this.element.calculateLength(2, val);\r
+\r
+                        // Submessage with wire type of length-delimited.\r
+                        buffer.writeVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        buffer.writeVarint32(length);\r
+\r
+                        // Write out the key and val.\r
+                        buffer.writeVarint32((1 &lt;&lt; 3) | this.keyType.wireType);\r
+                        this.keyElement.encodeValue(1, key, buffer);\r
+                        buffer.writeVarint32((2 &lt;&lt; 3) | this.type.wireType);\r
+                        this.element.encodeValue(2, val, buffer);\r
+                    }, this);\r
+                } else {\r
+                    if (this.hasWirePresence(value, message)) {\r
+                        buffer.writeVarint32((this.id &lt;&lt; 3) | this.type.wireType);\r
+                        this.element.encodeValue(this.id, value, buffer);\r
+                    }\r
+                }\r
+            } catch (e) {\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+            }\r
+            return buffer;\r
+        };\r
+\r
+        /**\r
+         * Calculates the length of this field's value on the network level.\r
+         * @param {*} value Field value\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+         * @returns {number} Byte length\r
+         * @expose\r
+         */\r
+        FieldPrototype.calculate = function(value, message) {\r
+            value = this.verifyValue(value); // May throw\r
+            if (this.type === null || typeof this.type !== 'object')\r
+                throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+            if (value === null || (this.repeated &amp;&amp; value.length == 0))\r
+                return 0; // Optional omitted\r
+            var n = 0;\r
+            try {\r
+                if (this.repeated) {\r
+                    var i, ni;\r
+                    if (this.options["packed"] &amp;&amp; ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                        n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        ni = 0;\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            ni += this.element.calculateLength(this.id, value[i]);\r
+                        n += ByteBuffer.calculateVarint32(ni);\r
+                        n += ni;\r
+                    } else {\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | this.type.wireType),\r
+                            n += this.element.calculateLength(this.id, value[i]);\r
+                    }\r
+                } else if (this.map) {\r
+                    // Each map entry becomes a submessage.\r
+                    value.forEach(function(val, key, m) {\r
+                        // Compute the length of the submessage (key, val) pair.\r
+                        var length =\r
+                            ByteBuffer.calculateVarint32((1 &lt;&lt; 3) | this.keyType.wireType) +\r
+                            this.keyElement.calculateLength(1, key) +\r
+                            ByteBuffer.calculateVarint32((2 &lt;&lt; 3) | this.type.wireType) +\r
+                            this.element.calculateLength(2, val);\r
+\r
+                        n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        n += ByteBuffer.calculateVarint32(length);\r
+                        n += length;\r
+                    }, this);\r
+                } else {\r
+                    if (this.hasWirePresence(value, message)) {\r
+                        n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | this.type.wireType);\r
+                        n += this.element.calculateLength(this.id, value);\r
+                    }\r
+                }\r
+            } catch (e) {\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+            }\r
+            return n;\r
+        };\r
+\r
+        /**\r
+         * Decode the field value from the specified buffer.\r
+         * @param {number} wireType Leading wire type\r
+         * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+         * @param {boolean=} skipRepeated Whether to skip the repeated check or not. Defaults to false.\r
+         * @return {*} Decoded value: array for packed repeated fields, [key, value] for\r
+         *             map fields, or an individual value otherwise.\r
+         * @throws {Error} If the field cannot be decoded\r
+         * @expose\r
+         */\r
+        FieldPrototype.decode = function(wireType, buffer, skipRepeated) {\r
+            var value, nBytes;\r
+\r
+            // We expect wireType to match the underlying type's wireType unless we see\r
+            // a packed repeated field, or unless this is a map field.\r
+            var wireTypeOK =\r
+                (!this.map &amp;&amp; wireType == this.type.wireType) ||\r
+                (!skipRepeated &amp;&amp; this.repeated &amp;&amp; this.options["packed"] &amp;&amp;\r
+                 wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||\r
+                (this.map &amp;&amp; wireType == ProtoBuf.WIRE_TYPES.LDELIM);\r
+            if (!wireTypeOK)\r
+                throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");\r
+\r
+            // Handle packed repeated fields.\r
+            if (wireType == ProtoBuf.WIRE_TYPES.LDELIM &amp;&amp; this.repeated &amp;&amp; this.options["packed"] &amp;&amp; ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                if (!skipRepeated) {\r
+                    nBytes = buffer.readVarint32();\r
+                    nBytes = buffer.offset + nBytes; // Limit\r
+                    var values = [];\r
+                    while (buffer.offset &lt; nBytes)\r
+                        values.push(this.decode(this.type.wireType, buffer, true));\r
+                    return values;\r
+                }\r
+                // Read the next value otherwise...\r
+            }\r
+\r
+            // Handle maps.\r
+            if (this.map) {\r
+                // Read one (key, value) submessage, and return [key, value]\r
+                var key = Element.defaultFieldValue(this.keyType);\r
+                value = Element.defaultFieldValue(this.type);\r
+\r
+                // Read the length\r
+                nBytes = buffer.readVarint32();\r
+                if (buffer.remaining() &lt; nBytes)\r
+                    throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+\r
+                // Get a sub-buffer of this key/value submessage\r
+                var msgbuf = buffer.clone();\r
+                msgbuf.limit = msgbuf.offset + nBytes;\r
+                buffer.offset += nBytes;\r
+\r
+                while (msgbuf.remaining() > 0) {\r
+                    var tag = msgbuf.readVarint32();\r
+                    wireType = tag &amp; 0x07;\r
+                    var id = tag >>> 3;\r
+                    if (id === 1) {\r
+                        key = this.keyElement.decode(msgbuf, wireType, id);\r
+                    } else if (id === 2) {\r
+                        value = this.element.decode(msgbuf, wireType, id);\r
+                    } else {\r
+                        throw Error("Unexpected tag in map field key/value submessage");\r
+                    }\r
+                }\r
+\r
+                return [key, value];\r
+            }\r
+\r
+            // Handle singular and non-packed repeated field values.\r
+            return this.element.decode(buffer, wireType, this.id);\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.Field\r
+         * @expose\r
+         */\r
+        Reflect.Message.Field = Field;\r
+\r
+        /**\r
+         * Constructs a new Message ExtensionField.\r
+         * @exports ProtoBuf.Reflect.Message.ExtensionField\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+         * @param {string} rule Rule, one of requried, optional, repeated\r
+         * @param {string} type Data type, e.g. int32\r
+         * @param {string} name Field name\r
+         * @param {number} id Unique field id\r
+         * @param {!Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Message.Field\r
+         */\r
+        var ExtensionField = function(builder, message, rule, type, name, id, options) {\r
+            Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r
+\r
+            /**\r
+             * Extension reference.\r
+             * @type {!ProtoBuf.Reflect.Extension}\r
+             * @expose\r
+             */\r
+            this.extension;\r
+        };\r
+\r
+        // Extends Field\r
+        ExtensionField.prototype = Object.create(Field.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.ExtensionField\r
+         * @expose\r
+         */\r
+        Reflect.Message.ExtensionField = ExtensionField;\r
+\r
+        /**\r
+         * Constructs a new Message OneOf.\r
+         * @exports ProtoBuf.Reflect.Message.OneOf\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+         * @param {string} name OneOf name\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var OneOf = function(builder, message, name) {\r
+            T.call(this, builder, message, name);\r
+\r
+            /**\r
+             * Enclosed fields.\r
+             * @type {!Array.&lt;!ProtoBuf.Reflect.Message.Field>}\r
+             * @expose\r
+             */\r
+            this.fields = [];\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.OneOf\r
+         * @expose\r
+         */\r
+        Reflect.Message.OneOf = OneOf;\r
+\r
+        /**\r
+         * Constructs a new Enum.\r
+         * @exports ProtoBuf.Reflect.Enum\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r
+         * @param {string} name Enum name\r
+         * @param {Object.&lt;string,*>=} options Enum options\r
+         * @param {string?} syntax The syntax level (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Namespace\r
+         */\r
+        var Enum = function(builder, parent, name, options, syntax) {\r
+            Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Enum";\r
+\r
+            /**\r
+             * Runtime enum object.\r
+             * @type {Object.&lt;string,number>|null}\r
+             * @expose\r
+             */\r
+            this.object = null;\r
+        };\r
+\r
+        /**\r
+         * Gets the string name of an enum value.\r
+         * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r
+         * @param {number} value Enum value\r
+         * @returns {?string} Name or `null` if not present\r
+         * @expose\r
+         */\r
+        Enum.getName = function(enm, value) {\r
+            var keys = Object.keys(enm);\r
+            for (var i=0, key; i&lt;keys.length; ++i)\r
+                if (enm[key = keys[i]] === value)\r
+                    return key;\r
+            return null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Enum.prototype\r
+         * @inner\r
+         */\r
+        var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);\r
+\r
+        /**\r
+         * Builds this enum and returns the runtime counterpart.\r
+         * @param {boolean} rebuild Whether to rebuild or not, defaults to false\r
+         * @returns {!Object.&lt;string,number>}\r
+         * @expose\r
+         */\r
+        EnumPrototype.build = function(rebuild) {\r
+            if (this.object &amp;&amp; !rebuild)\r
+                return this.object;\r
+            var enm = new ProtoBuf.Builder.Enum(),\r
+                values = this.getChildren(Enum.Value);\r
+            for (var i=0, k=values.length; i&lt;k; ++i)\r
+                enm[values[i]['name']] = values[i]['id'];\r
+            if (Object.defineProperty)\r
+                Object.defineProperty(enm, '$options', {\r
+                    "value": this.buildOpt(),\r
+                    "enumerable": false\r
+                });\r
+            return this.object = enm;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Enum\r
+         * @expose\r
+         */\r
+        Reflect.Enum = Enum;\r
+\r
+        /**\r
+         * Constructs a new Enum Value.\r
+         * @exports ProtoBuf.Reflect.Enum.Value\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Enum} enm Enum reference\r
+         * @param {string} name Field name\r
+         * @param {number} id Unique field id\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Value = function(builder, enm, name, id) {\r
+            T.call(this, builder, enm, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Enum.Value";\r
+\r
+            /**\r
+             * Unique enum value id.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.id = id;\r
+        };\r
+\r
+        // Extends T\r
+        Value.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Enum.Value\r
+         * @expose\r
+         */\r
+        Reflect.Enum.Value = Value;\r
+\r
+        /**\r
+         * An extension (field).\r
+         * @exports ProtoBuf.Reflect.Extension\r
+         * @constructor\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.T} parent Parent object\r
+         * @param {string} name Object name\r
+         * @param {!ProtoBuf.Reflect.Message.Field} field Extension field\r
+         */\r
+        var Extension = function(builder, parent, name, field) {\r
+            T.call(this, builder, parent, name);\r
+\r
+            /**\r
+             * Extended message field.\r
+             * @type {!ProtoBuf.Reflect.Message.Field}\r
+             * @expose\r
+             */\r
+            this.field = field;\r
+        };\r
+\r
+        // Extends T\r
+        Extension.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Extension\r
+         * @expose\r
+         */\r
+        Reflect.Extension = Extension;\r
+\r
+        /**\r
+         * Constructs a new Service.\r
+         * @exports ProtoBuf.Reflect.Service\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Namespace} root Root\r
+         * @param {string} name Service name\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Namespace\r
+         */\r
+        var Service = function(builder, root, name, options) {\r
+            Namespace.call(this, builder, root, name, options);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Service";\r
+\r
+            /**\r
+             * Built runtime service class.\r
+             * @type {?function(new:ProtoBuf.Builder.Service)}\r
+             */\r
+            this.clazz = null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.prototype\r
+         * @inner\r
+         */\r
+        var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r
+\r
+        /**\r
+         * Builds the service and returns the runtime counterpart, which is a fully functional class.\r
+         * @see ProtoBuf.Builder.Service\r
+         * @param {boolean=} rebuild Whether to rebuild or not\r
+         * @return {Function} Service class\r
+         * @throws {Error} If the message cannot be built\r
+         * @expose\r
+         */\r
+        ServicePrototype.build = function(rebuild) {\r
+            if (this.clazz &amp;&amp; !rebuild)\r
+                return this.clazz;\r
+\r
+            // Create the runtime Service class in its own scope\r
+            return this.clazz = (function(ProtoBuf, T) {\r
+\r
+                /**\r
+                 * Constructs a new runtime Service.\r
+                 * @name ProtoBuf.Builder.Service\r
+                 * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r
+                 * @class Barebone of all runtime services.\r
+                 * @constructor\r
+                 * @throws {Error} If the service cannot be created\r
+                 */\r
+                var Service = function(rpcImpl) {\r
+                    ProtoBuf.Builder.Service.call(this);\r
+\r
+                    /**\r
+                     * Service implementation.\r
+                     * @name ProtoBuf.Builder.Service#rpcImpl\r
+                     * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r
+                     * @expose\r
+                     */\r
+                    this.rpcImpl = rpcImpl || function(name, msg, callback) {\r
+                        // This is what a user has to implement: A function receiving the method name, the actual message to\r
+                        // send (type checked) and the callback that's either provided with the error as its first\r
+                        // argument or null and the actual response message.\r
+                        setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async!\r
+                    };\r
+                };\r
+\r
+                /**\r
+                 * @alias ProtoBuf.Builder.Service.prototype\r
+                 * @inner\r
+                 */\r
+                var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r
+\r
+                /**\r
+                 * Asynchronously performs an RPC call using the given RPC implementation.\r
+                 * @name ProtoBuf.Builder.Service.[Method]\r
+                 * @function\r
+                 * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r
+                 * @param {ProtoBuf.Builder.Message} req Request\r
+                 * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+                 *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+                 * @abstract\r
+                 */\r
+\r
+                /**\r
+                 * Asynchronously performs an RPC call using the instance's RPC implementation.\r
+                 * @name ProtoBuf.Builder.Service#[Method]\r
+                 * @function\r
+                 * @param {ProtoBuf.Builder.Message} req Request\r
+                 * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+                 *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+                 * @abstract\r
+                 */\r
+\r
+                var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r
+                for (var i=0; i&lt;rpc.length; i++) {\r
+                    (function(method) {\r
+\r
+                        // service#Method(message, callback)\r
+                        ServicePrototype[method.name] = function(req, callback) {\r
+                            try {\r
+                                try {\r
+                                    // If given as a buffer, decode the request. Will throw a TypeError if not a valid buffer.\r
+                                    req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));\r
+                                } catch (err) {\r
+                                    if (!(err instanceof TypeError))\r
+                                        throw err;\r
+                                }\r
+                                if (req === null || typeof req !== 'object')\r
+                                    throw Error("Illegal arguments");\r
+                                if (!(req instanceof method.resolvedRequestType.clazz))\r
+                                    req = new method.resolvedRequestType.clazz(req);\r
+                                this.rpcImpl(method.fqn(), req, function(err, res) { // Assumes that this is properly async\r
+                                    if (err) {\r
+                                        callback(err);\r
+                                        return;\r
+                                    }\r
+                                    // Coalesce to empty string when service response has empty content\r
+                                    if (res === null)\r
+                                        res = ''\r
+                                    try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}\r
+                                    if (!res || !(res instanceof method.resolvedResponseType.clazz)) {\r
+                                        callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));\r
+                                        return;\r
+                                    }\r
+                                    callback(null, res);\r
+                                });\r
+                            } catch (err) {\r
+                                setTimeout(callback.bind(this, err), 0);\r
+                            }\r
+                        };\r
+\r
+                        // Service.Method(rpcImpl, message, callback)\r
+                        Service[method.name] = function(rpcImpl, req, callback) {\r
+                            new Service(rpcImpl)[method.name](req, callback);\r
+                        };\r
+\r
+                        if (Object.defineProperty)\r
+                            Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),\r
+                            Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });\r
+                    })(rpc[i]);\r
+                }\r
+\r
+                // Properties\r
+\r
+                /**\r
+                 * Service options.\r
+                 * @name ProtoBuf.Builder.Service.$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $optionsS; // cc needs this\r
+\r
+                /**\r
+                 * Service options.\r
+                 * @name ProtoBuf.Builder.Service#$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $options;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Service.$type\r
+                 * @type {!ProtoBuf.Reflect.Service}\r
+                 * @expose\r
+                 */\r
+                var $typeS;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Service#$type\r
+                 * @type {!ProtoBuf.Reflect.Service}\r
+                 * @expose\r
+                 */\r
+                var $type;\r
+\r
+                if (Object.defineProperty)\r
+                    Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),\r
+                    Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),\r
+                    Object.defineProperty(Service, "$type", { "value": T }),\r
+                    Object.defineProperty(ServicePrototype, "$type", { "value": T });\r
+\r
+                return Service;\r
+\r
+            })(ProtoBuf, this);\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service\r
+         * @expose\r
+         */\r
+        Reflect.Service = Service;\r
+\r
+        /**\r
+         * Abstract service method.\r
+         * @exports ProtoBuf.Reflect.Service.Method\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Service} svc Service\r
+         * @param {string} name Method name\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Method = function(builder, svc, name, options) {\r
+            T.call(this, builder, svc, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Service.Method";\r
+\r
+            /**\r
+             * Options.\r
+             * @type {Object.&lt;string, *>}\r
+             * @expose\r
+             */\r
+            this.options = options || {};\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.Method.prototype\r
+         * @inner\r
+         */\r
+        var MethodPrototype = Method.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * Builds the method's '$options' property.\r
+         * @name ProtoBuf.Reflect.Service.Method#buildOpt\r
+         * @function\r
+         * @return {Object.&lt;string,*>}\r
+         */\r
+        MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.Method\r
+         * @expose\r
+         */\r
+        Reflect.Service.Method = Method;\r
+\r
+        /**\r
+         * RPC service method.\r
+         * @exports ProtoBuf.Reflect.Service.RPCMethod\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Service} svc Service\r
+         * @param {string} name Method name\r
+         * @param {string} request Request message name\r
+         * @param {string} response Response message name\r
+         * @param {boolean} request_stream Whether requests are streamed\r
+         * @param {boolean} response_stream Whether responses are streamed\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Service.Method\r
+         */\r
+        var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r
+            Method.call(this, builder, svc, name, options);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Service.RPCMethod";\r
+\r
+            /**\r
+             * Request message name.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.requestName = request;\r
+\r
+            /**\r
+             * Response message name.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.responseName = response;\r
+\r
+            /**\r
+             * Whether requests are streamed\r
+             * @type {bool}\r
+             * @expose\r
+             */\r
+            this.requestStream = request_stream;\r
+\r
+            /**\r
+             * Whether responses are streamed\r
+             * @type {bool}\r
+             * @expose\r
+             */\r
+            this.responseStream = response_stream;\r
+\r
+            /**\r
+             * Resolved request message type.\r
+             * @type {ProtoBuf.Reflect.Message}\r
+             * @expose\r
+             */\r
+            this.resolvedRequestType = null;\r
+\r
+            /**\r
+             * Resolved response message type.\r
+             * @type {ProtoBuf.Reflect.Message}\r
+             * @expose\r
+             */\r
+            this.resolvedResponseType = null;\r
+        };\r
+\r
+        // Extends Method\r
+        RPCMethod.prototype = Object.create(Method.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.RPCMethod\r
+         * @expose\r
+         */\r
+        Reflect.Service.RPCMethod = RPCMethod;\r
+\r
+        return Reflect;\r
+\r
+    })(ProtoBuf);\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder\r
+     * @expose\r
+     */\r
+    ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Constructs a new Builder.\r
+         * @exports ProtoBuf.Builder\r
+         * @class Provides the functionality to build protocol messages.\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         */\r
+        var Builder = function(options) {\r
+\r
+            /**\r
+             * Namespace.\r
+             * @type {ProtoBuf.Reflect.Namespace}\r
+             * @expose\r
+             */\r
+            this.ns = new Reflect.Namespace(this, null, ""); // Global namespace\r
+\r
+            /**\r
+             * Namespace pointer.\r
+             * @type {ProtoBuf.Reflect.T}\r
+             * @expose\r
+             */\r
+            this.ptr = this.ns;\r
+\r
+            /**\r
+             * Resolved flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.resolved = false;\r
+\r
+            /**\r
+             * The current building result.\r
+             * @type {Object.&lt;string,ProtoBuf.Builder.Message|Object>|null}\r
+             * @expose\r
+             */\r
+            this.result = null;\r
+\r
+            /**\r
+             * Imported files.\r
+             * @type {Array.&lt;string>}\r
+             * @expose\r
+             */\r
+            this.files = {};\r
+\r
+            /**\r
+             * Import root override.\r
+             * @type {?string}\r
+             * @expose\r
+             */\r
+            this.importRoot = null;\r
+\r
+            /**\r
+             * Options.\r
+             * @type {!Object.&lt;string, *>}\r
+             * @expose\r
+             */\r
+            this.options = options || {};\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.prototype\r
+         * @inner\r
+         */\r
+        var BuilderPrototype = Builder.prototype;\r
+\r
+        // ----- Definition tests -----\r
+\r
+        /**\r
+         * Tests if a definition most likely describes a message.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isMessage = function(def) {\r
+            // Messages require a string name\r
+            if (typeof def["name"] !== 'string')\r
+                return false;\r
+            // Messages do not contain values (enum) or rpc methods (service)\r
+            if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes a message field.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isMessageField = function(def) {\r
+            // Message fields require a string rule, name and type and an id\r
+            if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes an enum.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isEnum = function(def) {\r
+            // Enums require a string name\r
+            if (typeof def["name"] !== 'string')\r
+                return false;\r
+            // Enums require at least one value\r
+            if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes a service.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isService = function(def) {\r
+            // Services require a string name and an rpc object\r
+            if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes an extended message\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isExtend = function(def) {\r
+            // Extends rquire a string ref\r
+            if (typeof def["ref"] !== 'string')\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        // ----- Building -----\r
+\r
+        /**\r
+         * Resets the pointer to the root namespace.\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @expose\r
+         */\r
+        BuilderPrototype.reset = function() {\r
+            this.ptr = this.ns;\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Defines a namespace on top of the current pointer position and places the pointer on it.\r
+         * @param {string} namespace\r
+         * @return {!ProtoBuf.Builder} this\r
+         * @expose\r
+         */\r
+        BuilderPrototype.define = function(namespace) {\r
+            if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r
+                throw Error("illegal namespace: "+namespace);\r
+            namespace.split(".").forEach(function(part) {\r
+                var ns = this.ptr.getChild(part);\r
+                if (ns === null) // Keep existing\r
+                    this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r
+                this.ptr = ns;\r
+            }, this);\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Creates the specified definitions at the current pointer position.\r
+         * @param {!Array.&lt;!Object>} defs Messages, enums or services to create\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @throws {Error} If a message definition is invalid\r
+         * @expose\r
+         */\r
+        BuilderPrototype.create = function(defs) {\r
+            if (!defs)\r
+                return this; // Nothing to create\r
+            if (!Array.isArray(defs))\r
+                defs = [defs];\r
+            else {\r
+                if (defs.length === 0)\r
+                    return this;\r
+                defs = defs.slice();\r
+            }\r
+\r
+            // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r
+            var stack = [defs];\r
+            while (stack.length > 0) {\r
+                defs = stack.pop();\r
+\r
+                if (!Array.isArray(defs)) // Stack always contains entire namespaces\r
+                    throw Error("not a valid namespace: "+JSON.stringify(defs));\r
+\r
+                while (defs.length > 0) {\r
+                    var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r
+\r
+                    if (Builder.isMessage(def)) {\r
+                        var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);\r
+\r
+                        // Create OneOfs\r
+                        var oneofs = {};\r
+                        if (def["oneofs"])\r
+                            Object.keys(def["oneofs"]).forEach(function(name) {\r
+                                obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r
+                            }, this);\r
+\r
+                        // Create fields\r
+                        if (def["fields"])\r
+                            def["fields"].forEach(function(fld) {\r
+                                if (obj.getChild(fld["id"]|0) !== null)\r
+                                    throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);\r
+                                if (fld["options"] &amp;&amp; typeof fld["options"] !== 'object')\r
+                                    throw Error("illegal field options in "+obj.name+"#"+fld["name"]);\r
+                                var oneof = null;\r
+                                if (typeof fld["oneof"] === 'string' &amp;&amp; !(oneof = oneofs[fld["oneof"]]))\r
+                                    throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);\r
+                                fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);\r
+                                if (oneof)\r
+                                    oneof.fields.push(fld);\r
+                                obj.addChild(fld);\r
+                            }, this);\r
+\r
+                        // Push children to stack\r
+                        var subObj = [];\r
+                        if (def["enums"])\r
+                            def["enums"].forEach(function(enm) {\r
+                                subObj.push(enm);\r
+                            });\r
+                        if (def["messages"])\r
+                            def["messages"].forEach(function(msg) {\r
+                                subObj.push(msg);\r
+                            });\r
+                        if (def["services"])\r
+                            def["services"].forEach(function(svc) {\r
+                                subObj.push(svc);\r
+                            });\r
+\r
+                        // Set extension ranges\r
+                        if (def["extensions"]) {\r
+                            if (typeof def["extensions"][0] === 'number') // pre 5.0.1\r
+                                obj.extensions = [ def["extensions"] ];\r
+                            else\r
+                                obj.extensions = def["extensions"];\r
+                        }\r
+\r
+                        // Create on top of current namespace\r
+                        this.ptr.addChild(obj);\r
+                        if (subObj.length > 0) {\r
+                            stack.push(defs); // Push the current level back\r
+                            defs = subObj; // Continue processing sub level\r
+                            subObj = null;\r
+                            this.ptr = obj; // And move the pointer to this namespace\r
+                            obj = null;\r
+                            continue;\r
+                        }\r
+                        subObj = null;\r
+\r
+                    } else if (Builder.isEnum(def)) {\r
+\r
+                        obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);\r
+                        def["values"].forEach(function(val) {\r
+                            obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));\r
+                        }, this);\r
+                        this.ptr.addChild(obj);\r
+\r
+                    } else if (Builder.isService(def)) {\r
+\r
+                        obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);\r
+                        Object.keys(def["rpc"]).forEach(function(name) {\r
+                            var mtd = def["rpc"][name];\r
+                            obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));\r
+                        }, this);\r
+                        this.ptr.addChild(obj);\r
+\r
+                    } else if (Builder.isExtend(def)) {\r
+\r
+                        obj = this.ptr.resolve(def["ref"], true);\r
+                        if (obj) {\r
+                            def["fields"].forEach(function(fld) {\r
+                                if (obj.getChild(fld['id']|0) !== null)\r
+                                    throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);\r
+                                // Check if field id is allowed to be extended\r
+                                if (obj.extensions) {\r
+                                    var valid = false;\r
+                                    obj.extensions.forEach(function(range) {\r
+                                        if (fld["id"] >= range[0] &amp;&amp; fld["id"] &lt;= range[1])\r
+                                            valid = true;\r
+                                    });\r
+                                    if (!valid)\r
+                                        throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");\r
+                                }\r
+                                // Convert extension field names to camel case notation if the override is set\r
+                                var name = fld["name"];\r
+                                if (this.options['convertFieldsToCamelCase'])\r
+                                    name = ProtoBuf.Util.toCamelCase(name);\r
+                                // see #161: Extensions use their fully qualified name as their runtime key and...\r
+                                var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);\r
+                                // ...are added on top of the current namespace as an extension which is used for\r
+                                // resolving their type later on (the extension always keeps the original name to\r
+                                // prevent naming collisions)\r
+                                var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);\r
+                                field.extension = ext;\r
+                                this.ptr.addChild(ext);\r
+                                obj.addChild(field);\r
+                            }, this);\r
+\r
+                        } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions\r
+                            throw Error("extended message "+def["ref"]+" is not defined");\r
+\r
+                    } else\r
+                        throw Error("not a valid definition: "+JSON.stringify(def));\r
+\r
+                    def = null;\r
+                    obj = null;\r
+                }\r
+                // Break goes here\r
+                defs = null;\r
+                this.ptr = this.ptr.parent; // Namespace done, continue at parent\r
+            }\r
+            this.resolved = false; // Require re-resolve\r
+            this.result = null; // Require re-build\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Propagates syntax to all children.\r
+         * @param {!Object} parent\r
+         * @inner\r
+         */\r
+        function propagateSyntax(parent) {\r
+            if (parent['messages']) {\r
+                parent['messages'].forEach(function(child) {\r
+                    child["syntax"] = parent["syntax"];\r
+                    propagateSyntax(child);\r
+                });\r
+            }\r
+            if (parent['enums']) {\r
+                parent['enums'].forEach(function(child) {\r
+                    child["syntax"] = parent["syntax"];\r
+                });\r
+            }\r
+        }\r
+\r
+        /**\r
+         * Imports another definition into this builder.\r
+         * @param {Object.&lt;string,*>} json Parsed import\r
+         * @param {(string|{root: string, file: string})=} filename Imported file name\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @throws {Error} If the definition or file cannot be imported\r
+         * @expose\r
+         */\r
+        BuilderPrototype["import"] = function(json, filename) {\r
+            var delim = '/';\r
+\r
+            // Make sure to skip duplicate imports\r
+\r
+            if (typeof filename === 'string') {\r
+\r
+                if (ProtoBuf.Util.IS_NODE)\r
+                    filename = require("path")['resolve'](filename);\r
+                if (this.files[filename] === true)\r
+                    return this.reset();\r
+                this.files[filename] = true;\r
+\r
+            } else if (typeof filename === 'object') { // Object with root, file.\r
+\r
+                var root = filename.root;\r
+                if (ProtoBuf.Util.IS_NODE)\r
+                    root = require("path")['resolve'](root);\r
+                if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)\r
+                    delim = '\\';\r
+                var fname;\r
+                if (ProtoBuf.Util.IS_NODE)\r
+                    fname = require("path")['join'](root, filename.file);\r
+                else\r
+                    fname = root + delim + filename.file;\r
+                if (this.files[fname] === true)\r
+                    return this.reset();\r
+                this.files[fname] = true;\r
+            }\r
+\r
+            // Import imports\r
+\r
+            if (json['imports'] &amp;&amp; json['imports'].length > 0) {\r
+                var importRoot,\r
+                    resetRoot = false;\r
+\r
+                if (typeof filename === 'object') { // If an import root is specified, override\r
+\r
+                    this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards\r
+                    importRoot = this.importRoot;\r
+                    filename = filename["file"];\r
+                    if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)\r
+                        delim = '\\';\r
+\r
+                } else if (typeof filename === 'string') {\r
+\r
+                    if (this.importRoot) // If import root is overridden, use it\r
+                        importRoot = this.importRoot;\r
+                    else { // Otherwise compute from filename\r
+                        if (filename.indexOf("/") >= 0) { // Unix\r
+                            importRoot = filename.replace(/\/[^\/]*$/, "");\r
+                            if (/* /file.proto */ importRoot === "")\r
+                                importRoot = "/";\r
+                        } else if (filename.indexOf("\\") >= 0) { // Windows\r
+                            importRoot = filename.replace(/\\[^\\]*$/, "");\r
+                            delim = '\\';\r
+                        } else\r
+                            importRoot = ".";\r
+                    }\r
+\r
+                } else\r
+                    importRoot = null;\r
+\r
+                for (var i=0; i&lt;json['imports'].length; i++) {\r
+                    if (typeof json['imports'][i] === 'string') { // Import file\r
+                        if (!importRoot)\r
+                            throw Error("cannot determine import root");\r
+                        var importFilename = json['imports'][i];\r
+                        if (importFilename === "google/protobuf/descriptor.proto")\r
+                            continue; // Not needed and therefore not used\r
+                        if (ProtoBuf.Util.IS_NODE)\r
+                            importFilename = require("path")['join'](importRoot, importFilename);\r
+                        else\r
+                            importFilename = importRoot + delim + importFilename;\r
+                        if (this.files[importFilename] === true)\r
+                            continue; // Already imported\r
+                        if (/\.proto$/i.test(importFilename) &amp;&amp; !ProtoBuf.DotProto)       // If this is a light build\r
+                            importFilename = importFilename.replace(/\.proto$/, ".json"); // always load the JSON file\r
+                        var contents = ProtoBuf.Util.fetch(importFilename);\r
+                        if (contents === null)\r
+                            throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");\r
+                        if (/\.json$/i.test(importFilename)) // Always possible\r
+                            this["import"](JSON.parse(contents+""), importFilename); // May throw\r
+                        else\r
+                            this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename); // May throw\r
+                    } else // Import structure\r
+                        if (!filename)\r
+                            this["import"](json['imports'][i]);\r
+                        else if (/\.(\w+)$/.test(filename)) // With extension: Append _importN to the name portion to make it unique\r
+                            this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));\r
+                        else // Without extension: Append _importN to make it unique\r
+                            this["import"](json['imports'][i], filename+"_import"+i);\r
+                }\r
+                if (resetRoot) // Reset import root override when all imports are done\r
+                    this.importRoot = null;\r
+            }\r
+\r
+            // Import structures\r
+\r
+            if (json['package'])\r
+                this.define(json['package']);\r
+            if (json['syntax'])\r
+                propagateSyntax(json);\r
+            var base = this.ptr;\r
+            if (json['options'])\r
+                Object.keys(json['options']).forEach(function(key) {\r
+                    base.options[key] = json['options'][key];\r
+                });\r
+            if (json['messages'])\r
+                this.create(json['messages']),\r
+                this.ptr = base;\r
+            if (json['enums'])\r
+                this.create(json['enums']),\r
+                this.ptr = base;\r
+            if (json['services'])\r
+                this.create(json['services']),\r
+                this.ptr = base;\r
+            if (json['extends'])\r
+                this.create(json['extends']);\r
+\r
+            return this.reset();\r
+        };\r
+\r
+        /**\r
+         * Resolves all namespace objects.\r
+         * @throws {Error} If a type cannot be resolved\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @expose\r
+         */\r
+        BuilderPrototype.resolveAll = function() {\r
+            // Resolve all reflected objects\r
+            var res;\r
+            if (this.ptr == null || typeof this.ptr.type === 'object')\r
+                return this; // Done (already resolved)\r
+\r
+            if (this.ptr instanceof Reflect.Namespace) { // Resolve children\r
+\r
+                this.ptr.children.forEach(function(child) {\r
+                    this.ptr = child;\r
+                    this.resolveAll();\r
+                }, this);\r
+\r
+            } else if (this.ptr instanceof Reflect.Message.Field) { // Resolve type\r
+\r
+                if (!Lang.TYPE.test(this.ptr.type)) {\r
+                    if (!Lang.TYPEREF.test(this.ptr.type))\r
+                        throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                    res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);\r
+                    if (!res)\r
+                        throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                    this.ptr.resolvedType = res;\r
+                    if (res instanceof Reflect.Enum) {\r
+                        this.ptr.type = ProtoBuf.TYPES["enum"];\r
+                        if (this.ptr.syntax === 'proto3' &amp;&amp; res.syntax !== 'proto3')\r
+                            throw Error("proto3 message cannot reference proto2 enum");\r
+                    }\r
+                    else if (res instanceof Reflect.Message)\r
+                        this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];\r
+                    else\r
+                        throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                } else\r
+                    this.ptr.type = ProtoBuf.TYPES[this.ptr.type];\r
+\r
+                // If it's a map field, also resolve the key type. The key type can be only a numeric, string, or bool type\r
+                // (i.e., no enums or messages), so we don't need to resolve against the current namespace.\r
+                if (this.ptr.map) {\r
+                    if (!Lang.TYPE.test(this.ptr.keyType))\r
+                        throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);\r
+                    this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];\r
+                }\r
+\r
+                // If it's a repeated and packable field then proto3 mandates it should be packed by\r
+                // default\r
+                if (\r
+                  this.ptr.syntax === 'proto3' &amp;&amp;\r
+                  this.ptr.repeated &amp;&amp; this.ptr.options.packed === undefined &amp;&amp;\r
+                  ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1\r
+                ) {\r
+                  this.ptr.options.packed = true;\r
+                }\r
+\r
+            } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {\r
+\r
+                if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {\r
+                    res = this.ptr.parent.resolve(this.ptr.requestName, true);\r
+                    if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                        throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);\r
+                    this.ptr.resolvedRequestType = res;\r
+                    res = this.ptr.parent.resolve(this.ptr.responseName, true);\r
+                    if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                        throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);\r
+                    this.ptr.resolvedResponseType = res;\r
+                } else // Should not happen as nothing else is implemented\r
+                    throw Error("illegal service type in "+this.ptr.toString(true));\r
+\r
+            } else if (\r
+                !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) &amp;&amp; // Not built\r
+                !(this.ptr instanceof ProtoBuf.Reflect.Extension) &amp;&amp; // Not built\r
+                !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value) // Built in enum\r
+            )\r
+                throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);\r
+\r
+            return this.reset();\r
+        };\r
+\r
+        /**\r
+         * Builds the protocol. This will first try to resolve all definitions and, if this has been successful,\r
+         * return the built package.\r
+         * @param {(string|Array.&lt;string>)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r
+         * @returns {!ProtoBuf.Builder.Message|!Object.&lt;string,*>}\r
+         * @throws {Error} If a type could not be resolved\r
+         * @expose\r
+         */\r
+        BuilderPrototype.build = function(path) {\r
+            this.reset();\r
+            if (!this.resolved)\r
+                this.resolveAll(),\r
+                this.resolved = true,\r
+                this.result = null; // Require re-build\r
+            if (this.result === null) // (Re-)Build\r
+                this.result = this.ns.build();\r
+            if (!path)\r
+                return this.result;\r
+            var part = typeof path === 'string' ? path.split(".") : path,\r
+                ptr = this.result; // Build namespace pointer (no hasChild etc.)\r
+            for (var i=0; i&lt;part.length; i++)\r
+                if (ptr[part[i]])\r
+                    ptr = ptr[part[i]];\r
+                else {\r
+                    ptr = null;\r
+                    break;\r
+                }\r
+            return ptr;\r
+        };\r
+\r
+        /**\r
+         * Similar to {@link ProtoBuf.Builder#build}, but looks up the internal reflection descriptor.\r
+         * @param {string=} path Specifies what to return. If omitted, the entire namespace wiil be returned.\r
+         * @param {boolean=} excludeNonNamespace Excludes non-namespace types like fields, defaults to `false`\r
+         * @returns {?ProtoBuf.Reflect.T} Reflection descriptor or `null` if not found\r
+         */\r
+        BuilderPrototype.lookup = function(path, excludeNonNamespace) {\r
+            return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;\r
+        };\r
+\r
+        /**\r
+         * Returns a string representation of this object.\r
+         * @return {string} String representation as of "Builder"\r
+         * @expose\r
+         */\r
+        BuilderPrototype.toString = function() {\r
+            return "Builder";\r
+        };\r
+\r
+        // ----- Base classes -----\r
+        // Exist for the sole purpose of being able to "... instanceof ProtoBuf.Builder.Message" etc.\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.Message\r
+         */\r
+        Builder.Message = function() {};\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.Enum\r
+         */\r
+        Builder.Enum = function() {};\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.Message\r
+         */\r
+        Builder.Service = function() {};\r
+\r
+        return Builder;\r
+\r
+    })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);\r
+\r
+    /**\r
+     * @alias ProtoBuf.Map\r
+     * @expose\r
+     */\r
+    ProtoBuf.Map = (function(ProtoBuf, Reflect) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Constructs a new Map. A Map is a container that is used to implement map\r
+         * fields on message objects. It closely follows the ES6 Map API; however,\r
+         * it is distinct because we do not want to depend on external polyfills or\r
+         * on ES6 itself.\r
+         *\r
+         * @exports ProtoBuf.Map\r
+         * @param {!ProtoBuf.Reflect.Field} field Map field\r
+         * @param {Object.&lt;string,*>=} contents Initial contents\r
+         * @constructor\r
+         */\r
+        var Map = function(field, contents) {\r
+            if (!field.map)\r
+                throw Error("field is not a map");\r
+\r
+            /**\r
+             * The field corresponding to this map.\r
+             * @type {!ProtoBuf.Reflect.Field}\r
+             */\r
+            this.field = field;\r
+\r
+            /**\r
+             * Element instance corresponding to key type.\r
+             * @type {!ProtoBuf.Reflect.Element}\r
+             */\r
+            this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r
+\r
+            /**\r
+             * Element instance corresponding to value type.\r
+             * @type {!ProtoBuf.Reflect.Element}\r
+             */\r
+            this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r
+\r
+            /**\r
+             * Internal map: stores mapping of (string form of key) -> (key, value)\r
+             * pair.\r
+             *\r
+             * We provide map semantics for arbitrary key types, but we build on top\r
+             * of an Object, which has only string keys. In order to avoid the need\r
+             * to convert a string key back to its native type in many situations,\r
+             * we store the native key value alongside the value. Thus, we only need\r
+             * a one-way mapping from a key type to its string form that guarantees\r
+             * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r
+             * === K2).\r
+             *\r
+             * @type {!Object&lt;string, {key: *, value: *}>}\r
+             */\r
+            this.map = {};\r
+\r
+            /**\r
+             * Returns the number of elements in the map.\r
+             */\r
+            Object.defineProperty(this, "size", {\r
+                get: function() { return Object.keys(this.map).length; }\r
+            });\r
+\r
+            // Fill initial contents from a raw object.\r
+            if (contents) {\r
+                var keys = Object.keys(contents);\r
+                for (var i = 0; i &lt; keys.length; i++) {\r
+                    var key = this.keyElem.valueFromString(keys[i]);\r
+                    var val = this.valueElem.verifyValue(contents[keys[i]]);\r
+                    this.map[this.keyElem.valueToString(key)] =\r
+                        { key: key, value: val };\r
+                }\r
+            }\r
+        };\r
+\r
+        var MapPrototype = Map.prototype;\r
+\r
+        /**\r
+         * Helper: return an iterator over an array.\r
+         * @param {!Array&lt;*>} arr the array\r
+         * @returns {!Object} an iterator\r
+         * @inner\r
+         */\r
+        function arrayIterator(arr) {\r
+            var idx = 0;\r
+            return {\r
+                next: function() {\r
+                    if (idx &lt; arr.length)\r
+                        return { done: false, value: arr[idx++] };\r
+                    return { done: true };\r
+                }\r
+            }\r
+        }\r
+\r
+        /**\r
+         * Clears the map.\r
+         */\r
+        MapPrototype.clear = function() {\r
+            this.map = {};\r
+        };\r
+\r
+        /**\r
+         * Deletes a particular key from the map.\r
+         * @returns {boolean} Whether any entry with this key was deleted.\r
+         */\r
+        MapPrototype["delete"] = function(key) {\r
+            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+            var hadKey = keyValue in this.map;\r
+            delete this.map[keyValue];\r
+            return hadKey;\r
+        };\r
+\r
+        /**\r
+         * Returns an iterator over [key, value] pairs in the map.\r
+         * @returns {Object} The iterator\r
+         */\r
+        MapPrototype.entries = function() {\r
+            var entries = [];\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0, entry; i &lt; strKeys.length; i++)\r
+                entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r
+            return arrayIterator(entries);\r
+        };\r
+\r
+        /**\r
+         * Returns an iterator over keys in the map.\r
+         * @returns {Object} The iterator\r
+         */\r
+        MapPrototype.keys = function() {\r
+            var keys = [];\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0; i &lt; strKeys.length; i++)\r
+                keys.push(this.map[strKeys[i]].key);\r
+            return arrayIterator(keys);\r
+        };\r
+\r
+        /**\r
+         * Returns an iterator over values in the map.\r
+         * @returns {!Object} The iterator\r
+         */\r
+        MapPrototype.values = function() {\r
+            var values = [];\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0; i &lt; strKeys.length; i++)\r
+                values.push(this.map[strKeys[i]].value);\r
+            return arrayIterator(values);\r
+        };\r
+\r
+        /**\r
+         * Iterates over entries in the map, calling a function on each.\r
+         * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r
+         * @param {Object=} thisArg The `this` value for the callback\r
+         */\r
+        MapPrototype.forEach = function(cb, thisArg) {\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0, entry; i &lt; strKeys.length; i++)\r
+                cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r
+        };\r
+\r
+        /**\r
+         * Sets a key in the map to the given value.\r
+         * @param {*} key The key\r
+         * @param {*} value The value\r
+         * @returns {!ProtoBuf.Map} The map instance\r
+         */\r
+        MapPrototype.set = function(key, value) {\r
+            var keyValue = this.keyElem.verifyValue(key);\r
+            var valValue = this.valueElem.verifyValue(value);\r
+            this.map[this.keyElem.valueToString(keyValue)] =\r
+                { key: keyValue, value: valValue };\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Gets the value corresponding to a key in the map.\r
+         * @param {*} key The key\r
+         * @returns {*|undefined} The value, or `undefined` if key not present\r
+         */\r
+        MapPrototype.get = function(key) {\r
+            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+            if (!(keyValue in this.map))\r
+                return undefined;\r
+            return this.map[keyValue].value;\r
+        };\r
+\r
+        /**\r
+         * Determines whether the given key is present in the map.\r
+         * @param {*} key The key\r
+         * @returns {boolean} `true` if the key is present\r
+         */\r
+        MapPrototype.has = function(key) {\r
+            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+            return (keyValue in this.map);\r
+        };\r
+\r
+        return Map;\r
+    })(ProtoBuf, ProtoBuf.Reflect);\r
+\r
+\r
+    /**\r
+     * Loads a .proto string and returns the Builder.\r
+     * @param {string} proto .proto file contents\r
+     * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+     * @return {ProtoBuf.Builder} Builder to create new messages\r
+     * @throws {Error} If the definition cannot be parsed or built\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadProto = function(proto, builder, filename) {\r
+        if (typeof builder === 'string' || (builder &amp;&amp; typeof builder["file"] === 'string' &amp;&amp; typeof builder["root"] === 'string'))\r
+            filename = builder,\r
+            builder = undefined;\r
+        return ProtoBuf.loadJson(ProtoBuf.DotProto.Parser.parse(proto), builder, filename);\r
+    };\r
+\r
+    /**\r
+     * Loads a .proto string and returns the Builder. This is an alias of {@link ProtoBuf.loadProto}.\r
+     * @function\r
+     * @param {string} proto .proto file contents\r
+     * @param {(ProtoBuf.Builder|string)=} builder Builder to append to. Will create a new one if omitted.\r
+     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+     * @return {ProtoBuf.Builder} Builder to create new messages\r
+     * @throws {Error} If the definition cannot be parsed or built\r
+     * @expose\r
+     */\r
+    ProtoBuf.protoFromString = ProtoBuf.loadProto; // Legacy\r
+\r
+    /**\r
+     * Loads a .proto file and returns the Builder.\r
+     * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+     *  an overridden 'root' path for all imported files.\r
+     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+     *  file will be read synchronously and this function will return the Builder.\r
+     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+     * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+     *   request has failed), else undefined\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadProtoFile = function(filename, callback, builder) {\r
+        if (callback &amp;&amp; typeof callback === 'object')\r
+            builder = callback,\r
+            callback = null;\r
+        else if (!callback || typeof callback !== 'function')\r
+            callback = null;\r
+        if (callback)\r
+            return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+                if (contents === null) {\r
+                    callback(Error("Failed to fetch file"));\r
+                    return;\r
+                }\r
+                try {\r
+                    callback(null, ProtoBuf.loadProto(contents, builder, filename));\r
+                } catch (e) {\r
+                    callback(e);\r
+                }\r
+            });\r
+        var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+        return contents === null ? null : ProtoBuf.loadProto(contents, builder, filename);\r
+    };\r
+\r
+    /**\r
+     * Loads a .proto file and returns the Builder. This is an alias of {@link ProtoBuf.loadProtoFile}.\r
+     * @function\r
+     * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+     *  an overridden 'root' path for all imported files.\r
+     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+     *  file will be read synchronously and this function will return the Builder.\r
+     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+     * @return {!ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+     *   request has failed), else undefined\r
+     * @expose\r
+     */\r
+    ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile; // Legacy\r
+\r
+\r
+    /**\r
+     * Constructs a new empty Builder.\r
+     * @param {Object.&lt;string,*>=} options Builder options, defaults to global options set on ProtoBuf\r
+     * @return {!ProtoBuf.Builder} Builder\r
+     * @expose\r
+     */\r
+    ProtoBuf.newBuilder = function(options) {\r
+        options = options || {};\r
+        if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r
+            options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r
+        if (typeof options['populateAccessors'] === 'undefined')\r
+            options['populateAccessors'] = ProtoBuf.populateAccessors;\r
+        return new ProtoBuf.Builder(options);\r
+    };\r
+\r
+    /**\r
+     * Loads a .json definition and returns the Builder.\r
+     * @param {!*|string} json JSON definition\r
+     * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+     * @return {ProtoBuf.Builder} Builder to create new messages\r
+     * @throws {Error} If the definition cannot be parsed or built\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadJson = function(json, builder, filename) {\r
+        if (typeof builder === 'string' || (builder &amp;&amp; typeof builder["file"] === 'string' &amp;&amp; typeof builder["root"] === 'string'))\r
+            filename = builder,\r
+            builder = null;\r
+        if (!builder || typeof builder !== 'object')\r
+            builder = ProtoBuf.newBuilder();\r
+        if (typeof json === 'string')\r
+            json = JSON.parse(json);\r
+        builder["import"](json, filename);\r
+        builder.resolveAll();\r
+        return builder;\r
+    };\r
+\r
+    /**\r
+     * Loads a .json file and returns the Builder.\r
+     * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r
+     *  an overridden 'root' path for all imported files.\r
+     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+     *  file will be read synchronously and this function will return the Builder.\r
+     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+     * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+     *   request has failed), else undefined\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r
+        if (callback &amp;&amp; typeof callback === 'object')\r
+            builder = callback,\r
+            callback = null;\r
+        else if (!callback || typeof callback !== 'function')\r
+            callback = null;\r
+        if (callback)\r
+            return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+                if (contents === null) {\r
+                    callback(Error("Failed to fetch file"));\r
+                    return;\r
+                }\r
+                try {\r
+                    callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r
+                } catch (e) {\r
+                    callback(e);\r
+                }\r
+            });\r
+        var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+        return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r
+    };\r
+\r
+    return ProtoBuf;\r
+});\r
+</code></pre>
+        </article>
+    </section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot
new file mode 100644 (file)
index 0000000..5d20d91
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.svg b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.svg
new file mode 100644 (file)
index 0000000..3ed7be4
--- /dev/null
@@ -0,0 +1,1830 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansbold" horiz-adv-x="1169" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1417" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM940 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150zM1258 0h-305v1118 h305v-1118z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1417" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1258 0h-305v1556h305v-1556z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="2208" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1571 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224 q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1730 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150zM2048 0h-305v1118h305v-1118z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="2208" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1571 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224 q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM2048 0h-305v1556h305v-1556z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="586" d="M416 485h-244l-51 977h346zM117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="&#x22;" horiz-adv-x="967" d="M412 1462l-41 -528h-197l-41 528h279zM834 1462l-41 -528h-197l-41 528h279z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M999 844l-47 -232h258v-206h-297l-77 -406h-220l78 406h-194l-76 -406h-215l74 406h-238v206h277l47 232h-252v209h289l77 407h219l-77 -407h198l78 407h215l-78 -407h240v-209h-279zM539 612h196l47 232h-196z" />
+<glyph unicode="$" d="M1092 457q0 -159 -115 -255.5t-322 -115.5v-205h-137v201q-244 5 -428 86v264q87 -43 209.5 -76t218.5 -39v310l-67 26q-198 78 -280.5 169.5t-82.5 226.5q0 145 113.5 238.5t316.5 113.5v153h137v-149q229 -10 414 -92l-94 -234q-156 64 -320 78v-295 q195 -75 277.5 -130t121 -121t38.5 -154zM791 442q0 42 -34 71t-102 60v-249q136 23 136 118zM389 1049q0 -44 30.5 -72.5t98.5 -58.5v235q-129 -19 -129 -104z" />
+<glyph unicode="%" horiz-adv-x="1845" d="M315 1024q0 -127 22.5 -189.5t72.5 -62.5q96 0 96 252q0 250 -96 250q-50 0 -72.5 -61.5t-22.5 -188.5zM758 1026q0 -230 -89 -345.5t-261 -115.5q-165 0 -255 118.5t-90 342.5q0 457 345 457q169 0 259.5 -118.5t90.5 -338.5zM1446 1462l-811 -1462h-240l811 1462h240z M1339 440q0 -127 22.5 -189.5t72.5 -62.5q96 0 96 252q0 250 -96 250q-50 0 -72.5 -61.5t-22.5 -188.5zM1782 442q0 -229 -89 -344.5t-261 -115.5q-165 0 -255 118.5t-90 341.5q0 457 345 457q169 0 259.5 -118.5t90.5 -338.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1536" d="M1536 0h-377l-115 113q-191 -133 -432 -133q-244 0 -387 112t-143 303q0 137 60.5 233.5t207.5 180.5q-75 86 -109 164.5t-34 171.5q0 152 116.5 245t311.5 93q186 0 297.5 -86.5t111.5 -231.5q0 -119 -69 -217.5t-223 -187.5l284 -277q71 117 123 301h318 q-36 -135 -99 -263.5t-143 -227.5zM403 424q0 -86 64.5 -137t165.5 -51q126 0 227 61l-332 330q-58 -44 -91.5 -92t-33.5 -111zM762 1133q0 53 -36 83.5t-93 30.5q-67 0 -105.5 -32t-38.5 -91q0 -88 95 -194q86 48 132 94.5t46 108.5z" />
+<glyph unicode="'" horiz-adv-x="545" d="M412 1462l-41 -528h-197l-41 528h279z" />
+<glyph unicode="(" horiz-adv-x="694" d="M82 561q0 265 77.5 496t223.5 405h250q-141 -193 -213 -424t-72 -475q0 -245 73.5 -473.5t209.5 -413.5h-248q-147 170 -224 397t-77 488z" />
+<glyph unicode=")" horiz-adv-x="694" d="M612 561q0 -263 -77.5 -490t-223.5 -395h-248q135 184 209 412.5t74 474.5q0 244 -72 475t-213 424h250q147 -175 224 -406.5t77 -494.5z" />
+<glyph unicode="*" horiz-adv-x="1116" d="M688 1556l-41 -368l373 104l33 -252l-340 -24l223 -297l-227 -121l-156 313l-137 -311l-236 119l221 297l-338 26l39 250l365 -104l-41 368h262z" />
+<glyph unicode="+" d="M475 612h-387v219h387v390h219v-390h387v-219h-387v-385h-219v385z" />
+<glyph unicode="," horiz-adv-x="594" d="M459 215q-52 -202 -176 -479h-220q65 266 101 502h280z" />
+<glyph unicode="-" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="." horiz-adv-x="584" d="M117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="/" horiz-adv-x="846" d="M836 1462l-545 -1462h-277l545 1462h277z" />
+<glyph unicode="0" d="M1096 731q0 -383 -125.5 -567t-386.5 -184q-253 0 -381.5 190t-128.5 561q0 387 125 570.5t385 183.5q253 0 382.5 -192t129.5 -562zM381 731q0 -269 46.5 -385.5t156.5 -116.5q108 0 156 118t48 384q0 269 -48.5 386.5t-155.5 117.5q-109 0 -156 -117.5t-47 -386.5z" />
+<glyph unicode="1" d="M846 0h-309v846l3 139l5 152q-77 -77 -107 -101l-168 -135l-149 186l471 375h254v-1462z" />
+<glyph unicode="2" d="M1104 0h-1022v215l367 371q163 167 213 231.5t72 119.5t22 114q0 88 -48.5 131t-129.5 43q-85 0 -165 -39t-167 -111l-168 199q108 92 179 130t155 58.5t188 20.5q137 0 242 -50t163 -140t58 -206q0 -101 -35.5 -189.5t-110 -181.5t-262.5 -265l-188 -177v-14h637v-260z " />
+<glyph unicode="3" d="M1047 1135q0 -137 -83 -233t-233 -132v-6q177 -22 268 -107.5t91 -230.5q0 -211 -153 -328.5t-437 -117.5q-238 0 -422 79v263q85 -43 187 -70t202 -27q153 0 226 52t73 167q0 103 -84 146t-268 43h-111v237h113q170 0 248.5 44.5t78.5 152.5q0 166 -208 166 q-72 0 -146.5 -24t-165.5 -83l-143 213q200 144 477 144q227 0 358.5 -92t131.5 -256z" />
+<glyph unicode="4" d="M1137 303h-176v-303h-302v303h-624v215l641 944h285v-919h176v-240zM659 543v248q0 62 5 180t8 137h-8q-37 -82 -89 -160l-268 -405h352z" />
+<glyph unicode="5" d="M614 934q212 0 337.5 -119t125.5 -326q0 -245 -151 -377t-432 -132q-244 0 -394 79v267q79 -42 184 -68.5t199 -26.5q283 0 283 232q0 221 -293 221q-53 0 -117 -10.5t-104 -22.5l-123 66l55 745h793v-262h-522l-27 -287l35 7q61 14 151 14z" />
+<glyph unicode="6" d="M72 621q0 434 183.5 646t549.5 212q125 0 196 -15v-247q-89 20 -176 20q-159 0 -259.5 -48t-150.5 -142t-59 -267h13q99 170 317 170q196 0 307 -123t111 -340q0 -234 -132 -370.5t-366 -136.5q-162 0 -282.5 75t-186 219t-65.5 347zM600 227q99 0 152 66.5t53 189.5 q0 107 -49.5 168.5t-149.5 61.5q-94 0 -160.5 -61t-66.5 -142q0 -119 62.5 -201t158.5 -82z" />
+<glyph unicode="7" d="M227 0l549 1200h-721v260h1049v-194l-553 -1266h-324z" />
+<glyph unicode="8" d="M586 1481q210 0 338.5 -95.5t128.5 -257.5q0 -112 -62 -199.5t-200 -156.5q164 -88 235.5 -183.5t71.5 -209.5q0 -180 -141 -289.5t-371 -109.5q-240 0 -377 102t-137 289q0 125 66.5 222t213.5 171q-125 79 -180 169t-55 197q0 157 130 254t339 97zM358 389 q0 -86 60 -134t164 -48q115 0 172 49.5t57 130.5q0 67 -56.5 125.5t-183.5 124.5q-213 -98 -213 -248zM584 1255q-79 0 -127.5 -40.5t-48.5 -108.5q0 -60 38.5 -107.5t139.5 -97.5q98 46 137 94t39 111q0 69 -50 109t-128 40z" />
+<glyph unicode="9" d="M1098 838q0 -432 -182 -645t-551 -213q-130 0 -197 14v248q84 -21 176 -21q155 0 255 45.5t153 143t61 268.5h-12q-58 -94 -134 -132t-190 -38q-191 0 -301 122.5t-110 340.5q0 235 133.5 371.5t363.5 136.5q162 0 283.5 -76t186.5 -220.5t65 -344.5zM569 1231 q-96 0 -150 -66t-54 -190q0 -106 49 -168t149 -62q94 0 161 61.5t67 141.5q0 119 -62.5 201t-159.5 82z" />
+<glyph unicode=":" horiz-adv-x="584" d="M117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5zM117 969q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -81 -46.5 -125.5t-127.5 -44.5q-84 0 -130 44t-46 126z" />
+<glyph unicode=";" horiz-adv-x="594" d="M444 238l15 -23q-52 -202 -176 -479h-220q65 266 101 502h280zM117 969q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -81 -46.5 -125.5t-127.5 -44.5q-84 0 -130 44t-46 126z" />
+<glyph unicode="&#x3c;" d="M1081 203l-993 438v143l993 496v-240l-684 -317l684 -281v-239z" />
+<glyph unicode="=" d="M88 805v219h993v-219h-993zM88 418v219h993v-219h-993z" />
+<glyph unicode="&#x3e;" d="M88 442l684 281l-684 317v240l993 -496v-143l-993 -438v239z" />
+<glyph unicode="?" horiz-adv-x="977" d="M276 485v74q0 96 41 167t150 151q105 75 138.5 122t33.5 105q0 65 -48 99t-134 34q-150 0 -342 -98l-109 219q223 125 473 125q206 0 327.5 -99t121.5 -264q0 -110 -50 -190t-190 -180q-96 -71 -121.5 -108t-25.5 -97v-60h-265zM244 143q0 84 45 127t131 43 q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="@" horiz-adv-x="1837" d="M1735 752q0 -144 -46 -263.5t-130 -187.5t-195 -68q-74 0 -131 35.5t-82 93.5h-16q-108 -129 -275 -129q-177 0 -279 106.5t-102 291.5q0 211 134 340t350 129q86 0 189.5 -16.5t170.5 -39.5l-23 -489q0 -139 76 -139q64 0 102 93.5t38 244.5q0 161 -67 284.5 t-188.5 188.5t-277.5 65q-202 0 -351 -83t-228.5 -239.5t-79.5 -361.5q0 -276 147.5 -423.5t427.5 -147.5q106 0 233 23.5t250 68.5v-192q-214 -91 -475 -91q-380 0 -592.5 200t-212.5 556q0 247 108.5 448.5t309 316t461.5 114.5q220 0 393 -90t267 -256t94 -383zM711 627 q0 -211 172 -211q90 0 137 63.5t57 206.5l13 221q-51 11 -115 11q-125 0 -194.5 -78t-69.5 -213z" />
+<glyph unicode="A" horiz-adv-x="1413" d="M1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381z" />
+<glyph unicode="B" horiz-adv-x="1376" d="M184 1462h455q311 0 451.5 -88.5t140.5 -281.5q0 -131 -61.5 -215t-163.5 -101v-10q139 -31 200.5 -116t61.5 -226q0 -200 -144.5 -312t-392.5 -112h-547v1462zM494 883h180q126 0 182.5 39t56.5 129q0 84 -61.5 120.5t-194.5 36.5h-163v-325zM494 637v-381h202 q128 0 189 49t61 150q0 182 -260 182h-192z" />
+<glyph unicode="C" horiz-adv-x="1305" d="M805 1225q-175 0 -271 -131.5t-96 -366.5q0 -489 367 -489q154 0 373 77v-260q-180 -75 -402 -75q-319 0 -488 193.5t-169 555.5q0 228 83 399.5t238.5 263t364.5 91.5q213 0 428 -103l-100 -252q-82 39 -165 68t-163 29z" />
+<glyph unicode="D" horiz-adv-x="1516" d="M1397 745q0 -361 -205.5 -553t-593.5 -192h-414v1462h459q358 0 556 -189t198 -528zM1075 737q0 471 -416 471h-165v-952h133q448 0 448 481z" />
+<glyph unicode="E" horiz-adv-x="1147" d="M1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256z" />
+<glyph unicode="F" horiz-adv-x="1124" d="M489 0h-305v1462h838v-254h-533v-377h496v-253h-496v-578z" />
+<glyph unicode="G" horiz-adv-x="1483" d="M739 821h580v-758q-141 -46 -265.5 -64.5t-254.5 -18.5q-331 0 -505.5 194.5t-174.5 558.5q0 354 202.5 552t561.5 198q225 0 434 -90l-103 -248q-160 80 -333 80q-201 0 -322 -135t-121 -363q0 -238 97.5 -363.5t283.5 -125.5q97 0 197 20v305h-277v258z" />
+<glyph unicode="H" horiz-adv-x="1567" d="M1382 0h-309v631h-579v-631h-310v1462h310v-573h579v573h309v-1462z" />
+<glyph unicode="I" horiz-adv-x="678" d="M184 0v1462h310v-1462h-310z" />
+<glyph unicode="J" horiz-adv-x="678" d="M31 -430q-105 0 -183 22v258q80 -20 146 -20q102 0 146 63.5t44 198.5v1370h310v-1368q0 -256 -117 -390t-346 -134z" />
+<glyph unicode="K" horiz-adv-x="1360" d="M1360 0h-352l-383 616l-131 -94v-522h-310v1462h310v-669l122 172l396 497h344l-510 -647z" />
+<glyph unicode="L" horiz-adv-x="1157" d="M184 0v1462h310v-1206h593v-256h-903z" />
+<glyph unicode="M" horiz-adv-x="1931" d="M803 0l-352 1147h-9q19 -350 19 -467v-680h-277v1462h422l346 -1118h6l367 1118h422v-1462h-289v692q0 49 1.5 113t13.5 340h-9l-377 -1145h-284z" />
+<glyph unicode="N" horiz-adv-x="1665" d="M1481 0h-394l-636 1106h-9q19 -293 19 -418v-688h-277v1462h391l635 -1095h7q-15 285 -15 403v692h279v-1462z" />
+<glyph unicode="O" horiz-adv-x="1630" d="M1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5z" />
+<glyph unicode="P" horiz-adv-x="1286" d="M494 774h102q143 0 214 56.5t71 164.5q0 109 -59.5 161t-186.5 52h-141v-434zM1194 1006q0 -236 -147.5 -361t-419.5 -125h-133v-520h-310v1462h467q266 0 404.5 -114.5t138.5 -341.5z" />
+<glyph unicode="Q" horiz-adv-x="1630" d="M1511 733q0 -258 -91.5 -432.5t-268.5 -255.5l352 -393h-397l-268 328h-23q-336 0 -516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5z" />
+<glyph unicode="R" horiz-adv-x="1352" d="M494 813h100q147 0 217 49t70 154q0 104 -71.5 148t-221.5 44h-94v-395zM494 561v-561h-310v1462h426q298 0 441 -108.5t143 -329.5q0 -129 -71 -229.5t-201 -157.5q330 -493 430 -637h-344l-349 561h-165z" />
+<glyph unicode="S" horiz-adv-x="1128" d="M1047 406q0 -198 -142.5 -312t-396.5 -114q-234 0 -414 88v288q148 -66 250.5 -93t187.5 -27q102 0 156.5 39t54.5 116q0 43 -24 76.5t-70.5 64.5t-189.5 99q-134 63 -201 121t-107 135t-40 180q0 194 131.5 305t363.5 111q114 0 217.5 -27t216.5 -76l-100 -241 q-117 48 -193.5 67t-150.5 19q-88 0 -135 -41t-47 -107q0 -41 19 -71.5t60.5 -59t196.5 -102.5q205 -98 281 -196.5t76 -241.5z" />
+<glyph unicode="T" horiz-adv-x="1186" d="M748 0h-310v1204h-397v258h1104v-258h-397v-1204z" />
+<glyph unicode="U" horiz-adv-x="1548" d="M1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309z" />
+<glyph unicode="V" horiz-adv-x="1331" d="M1018 1462h313l-497 -1462h-338l-496 1462h313l275 -870q23 -77 47.5 -179.5t30.5 -142.5q11 92 75 322z" />
+<glyph unicode="W" horiz-adv-x="1980" d="M1608 0h-353l-198 768q-11 41 -37.5 169.5t-30.5 172.5q-6 -54 -30 -173.5t-37 -170.5l-197 -766h-352l-373 1462h305l187 -798q49 -221 71 -383q6 57 27.5 176.5t40.5 185.5l213 819h293l213 -819q14 -55 35 -168t32 -194q10 78 32 194.5t40 188.5l186 798h305z" />
+<glyph unicode="X" horiz-adv-x="1366" d="M1366 0h-354l-340 553l-340 -553h-332l485 754l-454 708h342l315 -526l309 526h334l-459 -725z" />
+<glyph unicode="Y" horiz-adv-x="1278" d="M639 860l305 602h334l-485 -893v-569h-308v559l-485 903h336z" />
+<glyph unicode="Z" horiz-adv-x="1186" d="M1137 0h-1088v201l701 1005h-682v256h1050v-200l-700 -1006h719v-256z" />
+<glyph unicode="[" horiz-adv-x="678" d="M627 -324h-484v1786h484v-211h-224v-1364h224v-211z" />
+<glyph unicode="\" horiz-adv-x="846" d="M289 1462l545 -1462h-277l-545 1462h277z" />
+<glyph unicode="]" horiz-adv-x="678" d="M51 -113h223v1364h-223v211h484v-1786h-484v211z" />
+<glyph unicode="^" horiz-adv-x="1090" d="M8 520l438 950h144l495 -950h-239l-322 643l-280 -643h-236z" />
+<glyph unicode="_" horiz-adv-x="842" d="M846 -324h-850v140h850v-140z" />
+<glyph unicode="`" horiz-adv-x="1243" d="M707 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="a" horiz-adv-x="1237" d="M870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48t-65 -134 q0 -129 148 -129q106 0 169.5 61t63.5 162v92z" />
+<glyph unicode="b" horiz-adv-x="1296" d="M782 1139q198 0 310 -154.5t112 -423.5q0 -277 -115.5 -429t-314.5 -152q-197 0 -309 143h-21l-51 -123h-233v1556h305v-362q0 -69 -12 -221h12q107 166 317 166zM684 895q-113 0 -165 -69.5t-54 -229.5v-33q0 -180 53.5 -258t169.5 -78q94 0 149.5 86.5t55.5 251.5 t-56 247.5t-153 82.5z" />
+<glyph unicode="c" horiz-adv-x="1053" d="M614 -20q-522 0 -522 573q0 285 142 435.5t407 150.5q194 0 348 -76l-90 -236q-72 29 -134 47.5t-124 18.5q-238 0 -238 -338q0 -328 238 -328q88 0 163 23.5t150 73.5v-261q-74 -47 -149.5 -65t-190.5 -18z" />
+<glyph unicode="d" horiz-adv-x="1296" d="M514 -20q-197 0 -309.5 153t-112.5 424q0 275 114.5 428.5t315.5 153.5q211 0 322 -164h10q-23 125 -23 223v358h306v-1556h-234l-59 145h-13q-104 -165 -317 -165zM621 223q117 0 171.5 68t59.5 231v33q0 180 -55.5 258t-180.5 78q-102 0 -158.5 -86.5t-56.5 -251.5 t57 -247.5t163 -82.5z" />
+<glyph unicode="e" horiz-adv-x="1210" d="M623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z" />
+<glyph unicode="f" horiz-adv-x="793" d="M778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229z" />
+<glyph unicode="g" horiz-adv-x="1157" d="M1133 1118v-155l-175 -45q48 -75 48 -168q0 -180 -125.5 -280.5t-348.5 -100.5l-55 3l-45 5q-47 -36 -47 -80q0 -66 168 -66h190q184 0 280.5 -79t96.5 -232q0 -196 -163.5 -304t-469.5 -108q-234 0 -357.5 81.5t-123.5 228.5q0 101 63 169t185 97q-47 20 -82 65.5 t-35 96.5q0 64 37 106.5t107 83.5q-88 38 -139.5 122t-51.5 198q0 183 119 283t340 100q47 0 111.5 -8.5t82.5 -12.5h390zM270 -158q0 -63 60.5 -99t169.5 -36q164 0 257 45t93 123q0 63 -55 87t-170 24h-158q-84 0 -140.5 -39.5t-56.5 -104.5zM381 752q0 -91 41.5 -144 t126.5 -53q86 0 126 53t40 144q0 202 -166 202q-168 0 -168 -202z" />
+<glyph unicode="h" horiz-adv-x="1346" d="M1192 0h-305v653q0 242 -180 242q-128 0 -185 -87t-57 -282v-526h-305v1556h305v-317q0 -37 -7 -174l-7 -90h16q102 164 324 164q197 0 299 -106t102 -304v-729z" />
+<glyph unicode="i" horiz-adv-x="625" d="M147 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150zM465 0h-305v1118h305v-1118z" />
+<glyph unicode="j" horiz-adv-x="625" d="M70 -492q-117 0 -201 25v240q70 -19 143 -19q77 0 112.5 43t35.5 127v1194h305v-1239q0 -178 -103 -274.5t-292 -96.5zM147 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150z" />
+<glyph unicode="k" horiz-adv-x="1270" d="M453 608l133 170l313 340h344l-444 -485l471 -633h-352l-322 453l-131 -105v-348h-305v1556h305v-694l-16 -254h4z" />
+<glyph unicode="l" horiz-adv-x="625" d="M465 0h-305v1556h305v-1556z" />
+<glyph unicode="m" horiz-adv-x="2011" d="M1161 0h-305v653q0 121 -40.5 181.5t-127.5 60.5q-117 0 -170 -86t-53 -283v-526h-305v1118h233l41 -143h17q45 77 130 120.5t195 43.5q251 0 340 -164h27q45 78 132.5 121t197.5 43q190 0 287.5 -97.5t97.5 -312.5v-729h-306v653q0 121 -40.5 181.5t-127.5 60.5 q-112 0 -167.5 -80t-55.5 -254v-561z" />
+<glyph unicode="n" horiz-adv-x="1346" d="M1192 0h-305v653q0 121 -43 181.5t-137 60.5q-128 0 -185 -85.5t-57 -283.5v-526h-305v1118h233l41 -143h17q51 81 140.5 122.5t203.5 41.5q195 0 296 -105.5t101 -304.5v-729z" />
+<glyph unicode="o" horiz-adv-x="1268" d="M403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z" />
+<glyph unicode="p" horiz-adv-x="1296" d="M774 -20q-197 0 -309 143h-16q16 -140 16 -162v-453h-305v1610h248l43 -145h14q107 166 317 166q198 0 310 -153t112 -425q0 -179 -52.5 -311t-149.5 -201t-228 -69zM684 895q-113 0 -165 -69.5t-54 -229.5v-33q0 -180 53.5 -258t169.5 -78q205 0 205 338 q0 165 -50.5 247.5t-158.5 82.5z" />
+<glyph unicode="q" horiz-adv-x="1296" d="M623 219q116 0 170 66.5t59 232.5v37q0 180 -55.5 258t-178.5 78q-215 0 -215 -338q0 -168 53.5 -251t166.5 -83zM514 -20q-198 0 -310 152.5t-112 424.5q0 274 114.5 428t313.5 154q106 0 185 -40t139 -124h8l27 143h258v-1610h-306v469q0 61 13 168h-13 q-49 -81 -130 -123t-187 -42z" />
+<glyph unicode="r" horiz-adv-x="930" d="M784 1139q62 0 103 -9l-23 -286q-37 10 -90 10q-146 0 -227.5 -75t-81.5 -210v-569h-305v1118h231l45 -188h15q52 94 140.5 151.5t192.5 57.5z" />
+<glyph unicode="s" horiz-adv-x="1018" d="M940 332q0 -172 -119.5 -262t-357.5 -90q-122 0 -208 16.5t-161 48.5v252q85 -40 191.5 -67t187.5 -27q166 0 166 96q0 36 -22 58.5t-76 51t-144 66.5q-129 54 -189.5 100t-88 105.5t-27.5 146.5q0 149 115.5 230.5t327.5 81.5q202 0 393 -88l-92 -220q-84 36 -157 59 t-149 23q-135 0 -135 -73q0 -41 43.5 -71t190.5 -89q131 -53 192 -99t90 -106t29 -143z" />
+<glyph unicode="t" horiz-adv-x="889" d="M631 223q80 0 192 35v-227q-114 -51 -280 -51q-183 0 -266.5 92.5t-83.5 277.5v539h-146v129l168 102l88 236h195v-238h313v-229h-313v-539q0 -65 36.5 -96t96.5 -31z" />
+<glyph unicode="u" horiz-adv-x="1346" d="M952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234z" />
+<glyph unicode="v" horiz-adv-x="1165" d="M426 0l-426 1118h319l216 -637q36 -121 45 -229h6q5 96 45 229l215 637h319l-426 -1118h-313z" />
+<glyph unicode="w" horiz-adv-x="1753" d="M1079 0l-86 391l-116 494h-7l-204 -885h-328l-318 1118h304l129 -495q31 -133 63 -367h6q4 76 35 241l16 85l138 536h336l131 -536q4 -22 12.5 -65t16.5 -91.5t14.5 -95t7.5 -74.5h6q9 72 32 197.5t33 169.5l134 495h299l-322 -1118h-332z" />
+<glyph unicode="x" horiz-adv-x="1184" d="M389 571l-360 547h346l217 -356l219 356h346l-364 -547l381 -571h-347l-235 383l-236 -383h-346z" />
+<glyph unicode="y" horiz-adv-x="1165" d="M0 1118h334l211 -629q27 -82 37 -194h6q11 103 43 194l207 629h327l-473 -1261q-65 -175 -185.5 -262t-281.5 -87q-79 0 -155 17v242q55 -13 120 -13q81 0 141.5 49.5t94.5 149.5l18 55z" />
+<glyph unicode="z" horiz-adv-x="999" d="M938 0h-883v180l518 705h-487v233h834v-198l-504 -687h522v-233z" />
+<glyph unicode="{" horiz-adv-x="807" d="M287 270q0 87 -65.5 133t-190.5 46v239q126 0 191 44t65 126v8v318q0 153 97 215.5t341 62.5v-225q-99 -3 -136.5 -38t-37.5 -103v-299q-6 -188 -234 -222v-12q234 -35 234 -212v-9v-299q0 -68 37 -103t137 -38v-226q-244 0 -341 62.5t-97 216.5v315z" />
+<glyph unicode="|" horiz-adv-x="1128" d="M455 1550h219v-2015h-219v2015z" />
+<glyph unicode="}" horiz-adv-x="807" d="M520 -45q0 -112 -41 -169t-135.5 -83.5t-261.5 -26.5v226q99 2 136.5 36t37.5 105v299v11q0 86 59 139.5t174 70.5v12q-227 34 -233 222v299q0 70 -37 104t-137 37v225q167 0 262 -26.5t135.5 -84t40.5 -167.5v-318v-10q0 -84 61.5 -126t194.5 -42v-239 q-125 0 -190.5 -41t-65.5 -138v-315z" />
+<glyph unicode="~" d="M322 672q-55 0 -117.5 -33.5t-116.5 -87.5v231q103 109 256 109q73 0 137.5 -16t139.5 -48q129 -55 227 -55q53 0 116 32t117 89v-231q-101 -109 -256 -109q-66 0 -126 13t-150 50q-131 56 -227 56z" />
+<glyph unicode="&#xa1;" horiz-adv-x="586" d="M168 606h244l51 -975h-346zM467 948q0 -84 -45 -127t-131 -43q-83 0 -128.5 44t-45.5 126q0 81 46.5 125.5t127.5 44.5q84 0 130 -44t46 -126z" />
+<glyph unicode="&#xa2;" d="M563 176q-420 59 -420 565q0 261 104.5 403t315.5 173v166h178v-158q166 -9 299 -74l-90 -235q-72 29 -134 47t-124 18q-121 0 -179 -83.5t-58 -254.5q0 -327 237 -327q82 0 148 15.5t166 60.5v-254q-127 -61 -265 -70v-188h-178v196z" />
+<glyph unicode="&#xa3;" d="M700 1483q195 0 390 -82l-93 -230q-157 64 -272 64q-78 0 -120 -44.5t-42 -127.5v-193h375v-219h-375v-143q0 -170 -151 -248h718v-260h-1048v248q103 44 141.5 101t38.5 157v145h-178v219h178v195q0 201 114.5 309.5t323.5 108.5z" />
+<glyph unicode="&#xa4;" d="M188 723q0 102 54 197l-129 127l147 147l127 -127q91 53 197 53q105 0 196 -55l127 129l150 -143l-129 -129q53 -89 53 -199q0 -107 -53 -199l125 -125l-146 -145l-127 125q-95 -51 -196 -51q-115 0 -199 51l-125 -123l-145 145l127 125q-54 93 -54 197zM395 723 q0 -77 54.5 -132.5t134.5 -55.5q81 0 136.5 55t55.5 133q0 80 -56.5 135t-135.5 55q-78 0 -133.5 -56t-55.5 -134z" />
+<glyph unicode="&#xa5;" d="M584 860l264 602h313l-383 -747h195v-178h-246v-138h246v-178h-246v-221h-287v221h-247v178h247v138h-247v178h190l-377 747h316z" />
+<glyph unicode="&#xa6;" horiz-adv-x="1128" d="M455 1550h219v-815h-219v815zM455 350h219v-815h-219v815z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M121 805q0 79 36 144.5t97 105.5q-133 84 -133 233q0 131 111.5 210t293.5 79q170 0 363 -84l-82 -190q-68 32 -138.5 57.5t-148.5 25.5q-81 0 -118 -23t-37 -71q0 -49 49.5 -86t163.5 -82q163 -64 240 -148.5t77 -193.5q0 -177 -125 -260q62 -40 93.5 -92.5t31.5 -126.5 q0 -148 -119.5 -235.5t-320.5 -87.5q-203 0 -349 79v207q81 -41 180 -69.5t169 -28.5q194 0 194 117q0 39 -18.5 63t-63.5 49.5t-125 59.5q-183 74 -252 152.5t-69 195.5zM344 827q0 -67 65 -119t181 -98q78 57 78 146q0 68 -50.5 115t-183.5 96q-37 -14 -63.5 -53.5 t-26.5 -86.5z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1243" d="M279 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM682 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M895 1010q-97 0 -150 -74t-53 -205q0 -280 203 -280q57 0 123 15t123 44v-191q-120 -57 -252 -57q-204 0 -316 125t-112 346q0 220 110.5 342.5t309.5 122.5q149 0 305 -78l-74 -168q-113 58 -217 58zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275 t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM242 731q0 -164 82 -305.5t224 -223t304 -81.5q164 0 305.5 82t223 224t81.5 304q0 164 -82 305.5t-224 223t-304 81.5q-164 0 -305.5 -82t-223 -224t-81.5 -304z" />
+<glyph unicode="&#xaa;" horiz-adv-x="784" d="M561 764l-31 110q-43 -58 -105 -90t-136 -32q-117 0 -179.5 58.5t-62.5 164.5q0 109 82.5 163.5t267.5 63.5l99 4q0 117 -127 117q-81 0 -217 -61l-66 135q66 32 145.5 57t178.5 25q137 0 211.5 -71t74.5 -202v-442h-135zM252 977q0 -38 23 -56t55 -18q77 0 121.5 41.5 t44.5 106.5v36l-99 -6q-145 -10 -145 -104z" />
+<glyph unicode="&#xab;" horiz-adv-x="1260" d="M82 573l371 455l219 -119l-279 -348l279 -348l-219 -119l-371 453v26zM588 573l370 455l220 -119l-279 -348l279 -348l-220 -119l-370 453v26z" />
+<glyph unicode="&#xac;" d="M1081 248h-219v364h-774v219h993v-583z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M61 424zM61 424v250h537v-250h-537z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M1157 905q0 -170 -143 -233l237 -400h-254l-178 338h-47v-338h-229v916h264q181 0 265.5 -70t84.5 -213zM772 778h31q66 0 94.5 28.5t28.5 94.5q0 65 -28 92t-97 27h-29v-242zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275t101 -377q0 -197 -97 -370 t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM242 731q0 -164 82 -305.5t224 -223t304 -81.5q164 0 305.5 82t223 224t81.5 304q0 164 -82 305.5t-224 223t-304 81.5q-164 0 -305.5 -82t-223 -224t-81.5 -304z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036v201h1036v-201z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M92 1137q0 92 46 172t126 127t174 47q92 0 172.5 -46t127 -127t46.5 -173q0 -93 -46.5 -173.5t-126.5 -125.5t-173 -45q-145 0 -245.5 99.5t-100.5 244.5zM283 1137q0 -64 44.5 -109t110.5 -45t111 46t45 108q0 63 -45.5 110t-110.5 47q-64 0 -109.5 -46t-45.5 -111z" />
+<glyph unicode="&#xb1;" d="M475 674h-387v219h387v389h219v-389h387v-219h-387v-385h-219v385zM88 0v219h993v-219h-993z" />
+<glyph unicode="&#xb2;" horiz-adv-x="776" d="M702 586h-647v168l224 219q102 100 130.5 144.5t28.5 94.5q0 38 -24 58t-64 20q-81 0 -180 -88l-123 152q147 129 336 129q137 0 216 -66.5t79 -183.5q0 -85 -47 -160t-176 -192l-105 -95h352v-200z" />
+<glyph unicode="&#xb3;" horiz-adv-x="776" d="M666 1249q0 -143 -170 -198v-13q94 -20 146 -75t52 -134q0 -121 -88 -190.5t-274 -69.5q-143 0 -273 70v190q148 -90 271 -90q143 0 143 107q0 53 -44 79.5t-122 26.5h-112v160h92q83 0 123.5 26t40.5 83q0 38 -25 63t-76 25q-47 0 -89 -19t-99 -59l-101 141 q62 47 137.5 78t178.5 31q127 0 208 -64t81 -168z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1243" d="M332 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1352" d="M465 465q0 -121 44 -181.5t138 -60.5q126 0 183 86.5t57 282.5v526h305v-1118h-231l-43 150h-15q-42 -85 -102 -127.5t-148 -42.5q-62 0 -114 23t-84 67l5 -85l5 -157v-320h-305v1610h305v-653z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1167 -260h-161v1616h-166v-1616h-162v819q-62 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h604v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="584" d="M117 723q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -81 -46.5 -125.5t-127.5 -44.5q-84 0 -130 44t-46 126z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M418 -250q0 -128 -75.5 -185t-233.5 -57q-78 0 -146 21v168q27 -7 72.5 -14t70.5 -7q72 0 72 62q0 83 -166 108l78 154h193l-27 -61q74 -24 118 -74.5t44 -114.5z" />
+<glyph unicode="&#xb9;" horiz-adv-x="776" d="M584 586h-238v446l3 112l5 95q-27 -36 -75 -78l-78 -61l-109 127l301 235h191v-876z" />
+<glyph unicode="&#xba;" horiz-adv-x="795" d="M737 1116q0 -171 -91.5 -267.5t-250.5 -96.5q-153 0 -245.5 98.5t-92.5 265.5q0 169 89.5 266t252.5 97q152 0 245 -98.5t93 -264.5zM260 1116q0 -100 32.5 -150.5t104.5 -50.5t103.5 50.5t31.5 150.5t-31.5 149.5t-103.5 49.5t-104.5 -49.5t-32.5 -149.5z" />
+<glyph unicode="&#xbb;" horiz-adv-x="1260" d="M1178 547l-371 -453l-219 119l278 348l-278 348l219 119l371 -455v-26zM672 547l-371 -453l-219 119l278 348l-278 348l219 119l371 -455v-26z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1804" d="M46 0zM538 586h-238v446l3 112l5 95q-27 -36 -75 -78l-78 -61l-109 127l301 235h191v-876zM1370 1462l-811 -1462h-239l811 1462h239zM1682 152h-125v-151h-238v151h-383v154l385 577h236v-563h125v-168zM1319 320v164q0 86 6 184q-9 -26 -35.5 -80t-41.5 -77l-127 -191 h198z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1804" d="M46 0zM538 586h-238v446l3 112l5 95q-27 -36 -75 -78l-78 -61l-109 127l301 235h191v-876zM1370 1462l-811 -1462h-239l811 1462h239zM1716 1h-647v168l224 219q102 100 130.5 144.5t28.5 94.5q0 38 -24 58t-64 20q-81 0 -180 -88l-123 152q147 129 336 129 q137 0 216 -66.5t79 -183.5q0 -85 -47 -160t-176 -192l-105 -95h352v-200z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1804" d="M90 0zM697 1249q0 -143 -170 -198v-13q94 -20 146 -75t52 -134q0 -121 -88 -190.5t-274 -69.5q-143 0 -273 70v190q148 -90 271 -90q143 0 143 107q0 53 -44 79.5t-122 26.5h-112v160h92q83 0 123.5 26t40.5 83q0 38 -25 63t-76 25q-47 0 -89 -19t-99 -59l-101 141 q62 47 137.5 78t178.5 31q127 0 208 -64t81 -168zM1441 1462l-811 -1462h-239l811 1462h239zM1712 152h-125v-151h-238v151h-383v154l385 577h236v-563h125v-168zM1349 320v164q0 86 6 184q-9 -26 -35.5 -80t-41.5 -77l-127 -191h198z" />
+<glyph unicode="&#xbf;" horiz-adv-x="977" d="M713 606v-74q0 -98 -44.5 -169t-152.5 -148q-109 -78 -137.5 -122t-28.5 -107q0 -57 43.5 -94t132.5 -37q79 0 169 29t186 71l102 -221q-98 -56 -221.5 -90.5t-229.5 -34.5q-220 0 -345.5 96.5t-125.5 265.5q0 108 48.5 187t191.5 184q95 70 121.5 107t26.5 98v59h264z M745 948q0 -84 -45 -127t-131 -43q-83 0 -128.5 44t-45.5 126q0 81 46.5 125.5t127.5 44.5q84 0 130 -44t46 -126z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM713 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM541 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM938 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM543 1684q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16 q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM365 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM768 1743 q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM959 1567q0 -108 -71 -174t-183 -66t-180 64t-68 174q0 108 67.5 172.5t180.5 64.5q110 0 182 -66t72 -169zM801 1565 q0 45 -27 70.5t-69 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69 26t27 71z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1950" d="M1829 0h-873v348h-491l-150 -348h-315l655 1462h1174v-254h-563v-321h526v-254h-526v-377h563v-256zM578 608h378v590h-127z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1305" d="M119 0zM805 1225q-175 0 -271 -131.5t-96 -366.5q0 -489 367 -489q154 0 373 77v-260q-180 -75 -402 -75q-319 0 -488 193.5t-169 555.5q0 228 83 399.5t238.5 263t364.5 91.5q213 0 428 -103l-100 -252q-82 39 -165 68t-163 29zM959 -250q0 -128 -75.5 -185t-233.5 -57 q-78 0 -146 21v168q27 -7 72.5 -14t70.5 -7q72 0 72 62q0 83 -166 108l78 154h193l-27 -61q74 -24 118 -74.5t44 -114.5z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1147" d="M184 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM634 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1147" d="M184 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM424 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xca;" horiz-adv-x="1147" d="M175 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM841 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1147" d="M184 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM272 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM675 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99 q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xcc;" horiz-adv-x="678" d="M0 0zM184 0v1462h310v-1462h-310zM317 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xcd;" horiz-adv-x="678" d="M167 0zM184 0v1462h310v-1462h-310zM167 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xce;" horiz-adv-x="678" d="M0 0zM184 0v1462h310v-1462h-310zM570 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xcf;" horiz-adv-x="678" d="M0 0zM184 0v1462h310v-1462h-310zM-3 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM400 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5 t-40.5 100.5z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1516" d="M47 850h137v612h459q358 0 556 -189t198 -528q0 -361 -205.5 -553t-593.5 -192h-414v596h-137v254zM1075 737q0 232 -104 351.5t-314 119.5h-163v-358h237v-254h-237v-340h131q450 0 450 481z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1665" d="M184 0zM1481 0h-394l-636 1106h-9q19 -293 19 -418v-688h-277v1462h391l635 -1095h7q-15 285 -15 403v692h279v-1462zM668 1684q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149 q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM824 1579q-63 44 -185 142.5t-190 164.5v21h342 q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM658 1579v27q172 200 235 301h342v-21 q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM1047 1579q-157 93 -234 176q-78 -81 -229 -176h-203 v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM652 1684q-31 0 -59.5 -26.5t-41.5 -80.5h-149 q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM474 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37 t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM877 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xd7;" d="M428 723l-299 301l152 154l301 -299l305 299l153 -150l-305 -305l301 -303l-149 -152l-305 301l-301 -299l-150 152z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1630" d="M1511 733q0 -363 -180 -558t-516 -195q-197 0 -336 65l-90 -135l-162 108l90 136q-198 194 -198 581q0 365 180.5 557.5t517.5 192.5q198 0 344 -70l84 125l160 -104l-88 -131q194 -194 194 -572zM444 733q0 -191 56 -307l506 756q-84 45 -189 45q-185 0 -279 -124.5 t-94 -369.5zM1186 733q0 180 -51 297l-500 -751q76 -39 180 -39q371 0 371 493z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM750 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xda;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM602 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM1006 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357 q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM433 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5 q-64 0 -101.5 35t-37.5 98zM836 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1278" d="M0 0zM639 860l305 602h334l-485 -893v-569h-308v559l-485 903h336zM461 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xde;" horiz-adv-x="1286" d="M1194 770q0 -229 -142.5 -353t-404.5 -124h-153v-293h-310v1462h310v-229h178q254 0 388 -119t134 -344zM494 543h100q145 0 216 52.5t71 174.5q0 107 -63.5 159t-199.5 52h-124v-438z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1456" d="M1249 1241q0 -64 -21 -112.5t-53 -86.5t-69 -67t-69 -53t-53 -45t-21 -43q0 -27 26.5 -53t92.5 -66q146 -91 198.5 -140t78 -110t25.5 -139q0 -172 -116.5 -259t-343.5 -87q-99 0 -171 14.5t-132 48.5v242q53 -36 135.5 -61t146.5 -25q168 0 168 123q0 41 -16 66.5 t-57 55.5t-115 72q-126 72 -175 131.5t-49 140.5q0 64 35 117t105 102q77 55 108 95t31 86q0 60 -63.5 100.5t-163.5 40.5q-116 0 -181 -52.5t-65 -148.5v-1128h-305v1139q0 201 146.5 314.5t404.5 113.5q244 0 391 -88.5t147 -237.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM614 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM441 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM843 1240q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM467 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36 t-73 16.5z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM285 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM688 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36 q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM883 1479q0 -108 -71 -174t-183 -66t-180 64t-68 174q0 108 67.5 172.5t180.5 64.5q110 0 182 -66t72 -169zM725 1477q0 45 -27 70.5t-69 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69 26t27 71z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1878" d="M1329 -20q-137 0 -249.5 50.5t-184.5 155.5q-98 -117 -196.5 -161.5t-256.5 -44.5q-161 0 -258.5 94.5t-97.5 259.5q0 178 121 262.5t362 93.5l191 6v84q0 69 -44.5 102t-121.5 33q-140 0 -305 -77l-99 202q189 101 422 101q227 0 342 -131q66 64 152.5 96.5t206.5 32.5 q221 0 349 -137.5t128 -370.5v-148h-723q5 -130 77 -203t202 -73q196 0 380 88v-236q-79 -39 -171 -59t-226 -20zM760 518l-113 -4q-124 -4 -186 -47.5t-62 -134.5q0 -129 140 -129q101 0 161 61t60 162v92zM1307 922q-217 0 -234 -236h430q-2 112 -55 174t-141 62z" />
+<glyph unicode="&#xe7;" horiz-adv-x="1053" d="M92 0zM614 -20q-522 0 -522 573q0 285 142 435.5t407 150.5q194 0 348 -76l-90 -236q-72 29 -134 47.5t-124 18.5q-238 0 -238 -338q0 -328 238 -328q88 0 163 23.5t150 73.5v-261q-74 -47 -149.5 -65t-190.5 -18zM805 -250q0 -128 -75.5 -185t-233.5 -57q-78 0 -146 21 v168q27 -7 72.5 -14t70.5 -7q72 0 72 62q0 83 -166 108l78 154h193l-27 -61q74 -24 118 -74.5t44 -114.5z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M620 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M447 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xea;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M860 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M297 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM700 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xec;" horiz-adv-x="625" d="M0 0zM465 0h-305v1118h305v-1118zM274 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xed;" horiz-adv-x="625" d="M145 0zM465 0h-305v1118h305v-1118zM145 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xee;" horiz-adv-x="625" d="M0 0zM465 0h-305v1118h305v-1118zM544 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xef;" horiz-adv-x="625" d="M0 0zM465 0h-305v1118h305v-1118zM-29 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM374 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5 t-40.5 100.5z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1268" d="M510 1303q-80 53 -152 92l101 176q144 -65 258 -141l225 139l100 -154l-170 -104q156 -143 230 -324.5t74 -413.5q0 -280 -145 -436.5t-400 -156.5q-245 0 -392 137t-147 372q0 233 130 369.5t351 136.5q205 0 275 -98l8 4q-67 162 -192 281l-230 -142l-100 156zM864 532 q0 108 -61 173t-168 65q-121 0 -176.5 -68.5t-55.5 -214.5q0 -140 60 -211t172 -71q123 0 176 82t53 245z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1346" d="M160 0zM1192 0h-305v653q0 121 -43 181.5t-137 60.5q-128 0 -185 -85.5t-57 -283.5v-526h-305v1118h233l41 -143h17q51 81 140.5 122.5t203.5 41.5q195 0 296 -105.5t101 -304.5v-729zM508 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82 q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M612 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M467 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M864 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M469 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M291 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM694 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xf7;" d="M88 612v219h993v-219h-993zM444 373q0 76 37 113.5t103 37.5t102.5 -39t36.5 -112q0 -70 -37 -111t-102 -41t-102.5 39t-37.5 113zM444 1071q0 75 37 113.5t103 38.5q67 0 103 -40.5t36 -111.5q0 -70 -37 -110.5t-102 -40.5t-102.5 39t-37.5 112z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1268" d="M1176 561q0 -273 -144 -427t-401 -154q-126 0 -234 45l-67 -101l-154 105l68 100q-152 156 -152 432q0 274 143 426t402 152q132 0 248 -52l55 82l152 -108l-58 -84q142 -155 142 -416zM403 561q0 -94 19 -166l317 475q-43 23 -106 23q-122 0 -176 -82.5t-54 -249.5z M864 561q0 81 -12 141l-309 -462q38 -15 92 -15q122 0 175.5 84.5t53.5 251.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM620 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM498 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM901 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357 q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM326 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5 t-103 -36.5q-64 0 -101.5 35t-37.5 98zM729 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1165" d="M0 0zM0 1118h334l211 -629q27 -82 37 -194h6q11 103 43 194l207 629h327l-473 -1261q-65 -175 -185.5 -262t-281.5 -87q-79 0 -155 17v242q55 -13 120 -13q81 0 141.5 49.5t94.5 149.5l18 55zM393 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5 h-203z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1296" d="M465 973q50 81 131 123.5t186 42.5q198 0 310 -154.5t112 -423.5q0 -273 -111.5 -427t-310.5 -154q-213 0 -317 137h-14l7 -62l7 -94v-453h-305v2048h305v-391l-7 -120l-7 -72h14zM684 895q-113 0 -165 -69.5t-54 -229.5v-33q0 -180 53.5 -258t169.5 -78q205 0 205 338 q0 165 -50.5 247.5t-158.5 82.5z" />
+<glyph unicode="&#xff;" horiz-adv-x="1165" d="M0 0zM0 1118h334l211 -629q27 -82 37 -194h6q11 103 43 194l207 629h327l-473 -1261q-65 -175 -185.5 -262t-281.5 -87q-79 0 -155 17v242q55 -13 120 -13q81 0 141.5 49.5t94.5 149.5l18 55zM243 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5 t-103 -36.5q-64 0 -101.5 35t-37.5 98zM646 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#x131;" horiz-adv-x="625" d="M465 0h-305v1118h305v-1118z" />
+<glyph unicode="&#x152;" horiz-adv-x="1993" d="M1872 0h-873q-38 -9 -109 -14.5t-116 -5.5q-319 0 -487 197t-168 558q0 363 169.5 556.5t487.5 193.5q61 0 127 -7t101 -16h868v-254h-563v-321h526v-254h-526v-377h563v-256zM776 1227q-166 0 -252 -125.5t-86 -368.5q0 -244 86 -368.5t250 -124.5q65 0 126 10.5 t99 28.5v907q-35 19 -101.5 30t-121.5 11z" />
+<glyph unicode="&#x153;" horiz-adv-x="2003" d="M1446 -20q-271 0 -420 155q-141 -155 -391 -155q-162 0 -286 70t-190.5 202t-66.5 309q0 277 141.5 427.5t399.5 150.5q112 0 212 -39.5t171 -116.5q144 156 383 156q244 0 380 -135t136 -373v-148h-746v-8q7 -127 81.5 -197.5t207.5 -70.5q107 0 200 21t193 67v-236 q-81 -39 -175.5 -59t-229.5 -20zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1405 922q-94 0 -156 -57.5t-71 -178.5h450q-2 111 -60.5 173.5t-162.5 62.5z" />
+<glyph unicode="&#x178;" horiz-adv-x="1278" d="M0 0zM639 860l305 602h334l-485 -893v-569h-308v559l-485 903h336zM297 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM700 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97 t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1243" d="M852 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M842 1479q0 -108 -71 -174t-183 -66t-180 64t-68 174q0 108 67.5 172.5t180.5 64.5q110 0 182 -66t72 -169zM684 1477q0 45 -27 70.5t-69 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69 26t27 71z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1243" d="M457 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M82 436v230h860v-230h-860z" />
+<glyph unicode="&#x2014;" horiz-adv-x="2048" d="M82 436v230h1884v-230h-1884z" />
+<glyph unicode="&#x2018;" horiz-adv-x="444" d="M39 961l-14 22q22 91 72.5 228.5t103.5 250.5h219q-66 -267 -101 -501h-280z" />
+<glyph unicode="&#x2019;" horiz-adv-x="444" d="M406 1462l14 -22q-50 -197 -176 -479h-219q69 296 100 501h281z" />
+<glyph unicode="&#x201a;" horiz-adv-x="596" d="M459 215q-52 -202 -176 -479h-220q65 266 101 502h280z" />
+<glyph unicode="&#x201c;" horiz-adv-x="911" d="M492 983q22 91 72.5 228.5t103.5 250.5h219q-66 -267 -101 -501h-280zM25 983q22 91 72.5 228.5t103.5 250.5h219q-66 -267 -101 -501h-280z" />
+<glyph unicode="&#x201d;" horiz-adv-x="911" d="M420 1440q-50 -197 -176 -479h-219q69 296 100 501h281zM887 1440q-50 -197 -176 -479h-219q69 296 100 501h280z" />
+<glyph unicode="&#x201e;" horiz-adv-x="1061" d="M459 215q-52 -202 -176 -479h-220q65 266 101 502h280zM926 215q-52 -202 -176 -479h-220q65 266 101 502h280z" />
+<glyph unicode="&#x2022;" horiz-adv-x="770" d="M98 748q0 154 74 235.5t213 81.5q137 0 212 -82t75 -235q0 -152 -75.5 -235t-211.5 -83q-138 0 -212.5 83t-74.5 235z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1751" d="M117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5zM700 143q0 84 45 127t132 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-85 0 -131 44.5t-46 125.5zM1284 143q0 84 45 127t131 43 q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="754" d="M82 573l371 455l219 -119l-279 -348l279 -348l-219 -119l-371 453v26z" />
+<glyph unicode="&#x203a;" horiz-adv-x="754" d="M672 547l-371 -453l-219 119l278 348l-278 348l219 119l371 -455v-26z" />
+<glyph unicode="&#x2044;" horiz-adv-x="266" d="M657 1462l-811 -1462h-239l811 1462h239z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="776" d="M758 737h-125v-151h-238v151h-383v154l385 577h236v-563h125v-168zM395 905v164q0 86 6 184q-9 -26 -35.5 -80t-41.5 -77l-127 -191h198z" />
+<glyph unicode="&#x20ac;" d="M803 1225q-122 0 -201 -70.5t-102 -204.5h403v-176h-418l-2 -35v-47l2 -33h355v-178h-338q51 -243 321 -243q143 0 275 57v-256q-116 -59 -293 -59q-245 0 -403 133t-199 368h-137v178h118q-4 23 -4 62l2 53h-116v176h133q37 242 199 382.5t405 140.5q188 0 352 -82 l-98 -232q-69 31 -129 48.5t-125 17.5z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M381 741h-168v572h-197v149h564v-149h-199v-572zM956 741l-165 529h-7l4 -111v-418h-163v721h247l160 -510l170 510h240v-721h-168v408l4 121h-6l-174 -529h-142z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1120" d="M0 1120h1120v-1120h-1120v1120z" />
+<glyph horiz-adv-x="1296" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff
new file mode 100644 (file)
index 0000000..1205787
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot
new file mode 100644 (file)
index 0000000..1f639a1
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.svg b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.svg
new file mode 100644 (file)
index 0000000..6a2607b
--- /dev/null
@@ -0,0 +1,1830 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansbold_italic" horiz-adv-x="1128" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1352" d="M0 0zM-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h219l-49 -229h-220l-215 -1010q-77 -371 -403 -371z M1065 1380q0 87 47.5 131.5t134.5 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-151 0 -151 123zM1081 0h-301l237 1118h301z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1352" d="M0 0zM-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h219l-49 -229h-220l-215 -1010q-77 -371 -403 -371z M1081 0h-301l330 1556h301z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="2048" d="M-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h395l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49 l-79 -224q-69 31 -134 31q-57 0 -91.5 -40t-47.5 -105l-12 -62h219l-49 -229h-219l-215 -1010q-77 -371 -404 -371q-104 0 -174 25v242q61 -21 115 -21q136 0 172 170l205 965h-396l-215 -1010q-77 -371 -403 -371zM1778 0h-301l237 1118h301zM1761 1380q0 87 48 131.5 t135 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-152 0 -152 123z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="2048" d="M-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h395l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49 l-79 -224q-69 31 -134 31q-57 0 -91.5 -40t-47.5 -105l-12 -62h219l-49 -229h-219l-215 -1010q-77 -371 -404 -371q-104 0 -174 25v242q61 -21 115 -21q136 0 172 170l205 965h-396l-215 -1010q-77 -371 -403 -371zM1778 0h-301l329 1556h301z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="586" d="M391 485h-241l157 977h340zM25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="&#x22;" horiz-adv-x="928" d="M549 1462l-152 -528h-196l71 528h277zM954 1462l-151 -528h-199l74 528h276z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M1036 846l-69 -232h258l-19 -206h-297l-116 -408h-220l117 408h-194l-115 -408h-215l113 408h-238l18 206h277l70 232h-252l18 209h289l119 407h217l-117 -407h199l116 407h215l-116 -407h239l-18 -209h-279zM553 614h197l69 232h-196z" />
+<glyph unicode="$" d="M1034 496q0 -184 -125.5 -291.5t-367.5 -124.5l-39 -199h-140l44 201q-209 12 -355 86v266q198 -107 404 -117l71 322q-163 61 -241 151t-78 214q0 173 127 279.5t350 121.5l35 151h139l-33 -151q166 -22 295 -90l-106 -232q-132 65 -242 74l-63 -299q131 -51 195 -99.5 t97 -113t33 -149.5zM594 322q63 9 102 45t39 98q0 46 -24.5 75.5t-59.5 43.5zM633 1157q-62 -7 -96.5 -41t-34.5 -94q0 -79 80 -111z" />
+<glyph unicode="%" horiz-adv-x="1753" d="M518 1274q-63 0 -110.5 -128.5t-47.5 -277.5q0 -96 56 -96q65 0 112 131t47 275q0 96 -57 96zM821 1165q0 -166 -56 -310t-151 -217t-217 -73q-139 0 -210.5 83.5t-71.5 236.5q0 169 55.5 311.5t148.5 214.5t216 72q137 0 211.5 -80t74.5 -238zM1554 1462l-1083 -1462 h-240l1088 1462h235zM1376 690q-39 0 -75 -56t-59 -154t-23 -195t55 -97q41 0 77 55t59.5 154.5t23.5 196.5q0 96 -58 96zM1679 590q0 -167 -54 -313.5t-148 -220.5t-215 -74q-144 0 -216.5 78.5t-72.5 222.5q0 177 53 322.5t148 219.5t219 74q137 0 211.5 -78.5 t74.5 -230.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1450" d="M1325 0h-350l-72 98q-175 -118 -403 -118q-209 0 -320.5 97.5t-111.5 280.5q0 145 78.5 248.5t273.5 200.5q-76 130 -76 258q0 195 117.5 307.5t316.5 112.5q169 0 266 -82.5t97 -224.5q0 -280 -365 -426l195 -263q44 57 80.5 121.5t78.5 173.5h300q-133 -313 -310 -497z M541 623q-88 -51 -123 -104.5t-35 -131.5q0 -65 45.5 -108t116.5 -43q115 0 221 59zM662 920q113 59 155.5 111t42.5 112q0 57 -30 82.5t-70 25.5q-66 0 -102.5 -46.5t-36.5 -119.5q0 -46 12 -92t29 -73z" />
+<glyph unicode="'" horiz-adv-x="522" d="M549 1462l-152 -528h-196l71 528h277z" />
+<glyph unicode="(" horiz-adv-x="694" d="M74 281q0 339 122.5 626.5t381.5 554.5h262q-255 -278 -377.5 -573.5t-122.5 -618.5q0 -308 117 -594h-234q-149 266 -149 605z" />
+<glyph unicode=")" horiz-adv-x="694" d="M618 858q0 -342 -124 -630.5t-379 -551.5h-262q499 545 499 1192q0 307 -116 594h233q149 -264 149 -604z" />
+<glyph unicode="*" horiz-adv-x="1116" d="M885 1522l-113 -353l387 29l-18 -254l-338 43l160 -336l-246 -73l-90 337l-197 -278l-207 164l275 248l-326 92l86 237l338 -174l33 369z" />
+<glyph unicode="+" d="M475 612h-366v219h366v369h219v-369h367v-219h-367v-364h-219v364z" />
+<glyph unicode="," horiz-adv-x="569" d="M377 238l8 -23q-118 -255 -262 -479h-225q74 167 194 502h285z" />
+<glyph unicode="-" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="." horiz-adv-x="584" d="M25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="/" horiz-adv-x="862" d="M1014 1462l-809 -1462h-295l809 1462h295z" />
+<glyph unicode="0" d="M1110 1012q0 -470 -168.5 -751t-472.5 -281q-198 0 -300.5 122t-102.5 365q0 297 84 537t228 360.5t333 120.5q399 0 399 -473zM684 1235q-80 0 -149.5 -104t-117.5 -302t-48 -368q0 -115 27.5 -173.5t97.5 -58.5q81 0 150.5 106t116 301t46.5 386q0 111 -30.5 162 t-92.5 51z" />
+<glyph unicode="1" d="M688 0h-305l180 829q35 152 76 287q-9 -8 -61.5 -47t-262.5 -170l-133 215l566 348h249z" />
+<glyph unicode="2" d="M913 0h-962l43 213l477 424q180 159 248.5 254.5t68.5 179.5q0 75 -41 114.5t-110 39.5q-66 0 -135.5 -33.5t-171.5 -118.5l-146 203q132 112 252 159.5t250 47.5q190 0 301 -98t111 -259q0 -107 -41 -201t-122.5 -188t-266.5 -245l-269 -222v-10h568z" />
+<glyph unicode="3" d="M1104 1149q0 -156 -94.5 -262t-261.5 -135v-4q131 -26 198.5 -106.5t67.5 -201.5q0 -133 -74 -238t-212 -163.5t-327 -58.5q-239 0 -387 79v267q84 -50 182 -75.5t191 -25.5q158 0 243 63.5t85 176.5q0 172 -258 172h-138l46 221h73q167 0 263 62t96 172q0 67 -43 104 t-121 37q-134 0 -287 -100l-127 204q124 81 232.5 113.5t246.5 32.5q190 0 298 -90.5t108 -243.5z" />
+<glyph unicode="4" d="M1028 303h-170l-63 -303h-293l63 303h-590l48 234l770 925h311l-195 -919h170zM616 543l58 248q12 58 40 164t42 141h-6q-35 -63 -132 -181l-313 -372h311z" />
+<glyph unicode="5" d="M623 922q183 0 289 -103t106 -287q0 -167 -71.5 -292t-208.5 -192.5t-330 -67.5q-117 0 -218.5 23t-162.5 58v269q174 -99 352 -99q154 0 241 71t87 194q0 94 -57.5 141t-166.5 47q-102 0 -213 -33l-104 78l207 733h755l-55 -262h-489l-88 -293q72 15 127 15z" />
+<glyph unicode="6" d="M88 469q0 202 61 395.5t167.5 335t256.5 213.5t357 72q125 0 223 -27l-51 -246q-84 25 -191 25q-194 0 -313.5 -108t-185.5 -345h4q115 166 311 166q157 0 242.5 -97t85.5 -273q0 -169 -71 -313.5t-190.5 -215.5t-277.5 -71q-212 0 -320 127t-108 362zM530 227 q99 0 161.5 94t62.5 236q0 71 -33.5 113.5t-102.5 42.5q-60 0 -114.5 -35.5t-87.5 -95.5t-33 -160q0 -91 40 -143t107 -52z" />
+<glyph unicode="7" d="M78 0l737 1202h-629l56 260h975l-41 -194l-752 -1268h-346z" />
+<glyph unicode="8" d="M721 1485q123 0 215.5 -42t141 -118t48.5 -174q0 -134 -80.5 -233.5t-230.5 -151.5q217 -141 217 -365q0 -122 -63.5 -218.5t-181 -149.5t-273.5 -53q-214 0 -336.5 100t-122.5 270q0 298 348 426q-165 132 -165 299q0 119 58 212.5t168 145.5t257 52zM582 643 q-116 -45 -173 -107t-57 -153q0 -81 50 -128.5t135 -47.5q93 0 147.5 53.5t54.5 138.5q0 73 -36.5 131.5t-120.5 112.5zM694 1260q-76 0 -121 -46.5t-45 -119.5q0 -132 123 -201q185 72 185 221q0 68 -39.5 107t-102.5 39z" />
+<glyph unicode="9" d="M1092 1001q0 -280 -99 -533t-264 -370.5t-403 -117.5q-128 0 -240 32v256q111 -41 227 -41q121 0 207.5 49t144 138.5t99.5 257.5h-4q-111 -158 -295 -158q-163 0 -252.5 103.5t-89.5 285.5q0 166 73 305.5t196 208t286 68.5q203 0 308.5 -123t105.5 -361zM645 1237 q-65 0 -115.5 -42t-78 -114t-27.5 -153q0 -87 37.5 -131.5t105.5 -44.5q60 0 111.5 36.5t82 100t30.5 158.5q0 84 -35.5 137t-110.5 53z" />
+<glyph unicode=":" horiz-adv-x="584" d="M207 940q0 92 55.5 145.5t149.5 53.5q68 0 108.5 -38.5t40.5 -107.5q0 -86 -54.5 -140t-144.5 -54q-72 0 -113.5 36.5t-41.5 104.5zM25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode=";" horiz-adv-x="584" d="M385 215q-118 -255 -262 -479h-225q74 167 194 502h285zM207 940q0 92 55.5 145.5t149.5 53.5q68 0 108.5 -38.5t40.5 -107.5q0 -86 -54.5 -140t-144.5 -54q-72 0 -113.5 36.5t-41.5 104.5z" />
+<glyph unicode="&#x3c;" d="M1061 203l-952 438v143l952 496v-240l-643 -317l643 -281v-239z" />
+<glyph unicode="=" d="M109 807v217h952v-217h-952zM109 418v219h952v-219h-952z" />
+<glyph unicode="&#x3e;" d="M109 442l643 281l-643 317v240l952 -496v-143l-952 -438v239z" />
+<glyph unicode="?" horiz-adv-x="940" d="M260 485l14 78q19 103 73.5 177t172.5 155q124 84 157.5 127t33.5 96q0 119 -133 119q-50 0 -106.5 -16t-201.5 -84l-92 221q230 125 445 125q177 0 280 -87.5t103 -244.5q0 -83 -28.5 -149.5t-82.5 -123t-190 -147.5q-64 -43 -96.5 -73t-52.5 -64.5t-38 -108.5h-258z M166 115q0 91 55 144.5t150 53.5q68 0 108.5 -38t40.5 -107q0 -87 -55 -141t-143 -54q-74 0 -115 38t-41 104z" />
+<glyph unicode="@" horiz-adv-x="1753" d="M1733 840q0 -173 -64 -321t-177.5 -231t-254.5 -83q-88 0 -144.5 38.5t-72.5 108.5h-6q-50 -77 -113 -112t-147 -35q-127 0 -198 79.5t-71 229.5q0 147 67.5 276.5t187.5 205t268 75.5q185 0 327 -55l-106 -420q-11 -44 -19 -76.5t-8 -64.5q0 -68 58 -68q66 0 124 64 t92.5 171t34.5 214q0 213 -123.5 325.5t-359.5 112.5q-203 0 -366.5 -94t-255 -266t-91.5 -392q0 -243 134 -380.5t376 -137.5q117 0 219.5 20t221.5 66v-186q-230 -90 -465 -90q-217 0 -378 85.5t-246 241.5t-85 359q0 279 120.5 497t343 341.5t497.5 123.5 q318 0 499 -163.5t181 -458.5zM995 889q-82 0 -145.5 -51.5t-100 -137t-36.5 -174.5q0 -65 24.5 -102t69.5 -37q141 0 213 270l57 222q-36 10 -82 10z" />
+<glyph unicode="A" horiz-adv-x="1286" d="M842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333z" />
+<glyph unicode="B" horiz-adv-x="1270" d="M788 1462q229 0 346 -81.5t117 -243.5q0 -150 -83 -247.5t-236 -129.5v-6q100 -26 159.5 -96.5t59.5 -180.5q0 -229 -153 -353t-423 -124h-522l309 1462h426zM545 883h149q121 0 181.5 48.5t60.5 139.5q0 137 -170 137h-152zM412 256h180q117 0 183.5 58t66.5 161 q0 162 -183 162h-165z" />
+<glyph unicode="C" horiz-adv-x="1253" d="M905 1227q-132 0 -237.5 -81t-169.5 -238.5t-64 -338.5q0 -167 68.5 -248t218.5 -81q146 0 338 77v-260q-199 -77 -400 -77q-254 0 -395 149.5t-141 423.5q0 262 104 482.5t278 335t400 114.5q125 0 222 -22.5t208 -82.5l-118 -250q-106 59 -175 78t-137 19z" />
+<glyph unicode="D" horiz-adv-x="1386" d="M1323 909q0 -280 -98 -486.5t-283.5 -314.5t-437.5 -108h-451l309 1462h396q270 0 417.5 -143t147.5 -410zM518 256q148 0 258 76t172 223.5t62 337.5q0 154 -72.5 234.5t-208.5 80.5h-115l-202 -952h106z" />
+<glyph unicode="E" horiz-adv-x="1110" d="M870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512z" />
+<glyph unicode="F" horiz-adv-x="1087" d="M358 0h-305l309 1462h814l-54 -254h-508l-79 -377h473l-56 -253h-473z" />
+<glyph unicode="G" horiz-adv-x="1413" d="M754 821h563l-162 -762q-134 -46 -248.5 -62.5t-242.5 -16.5q-259 0 -400 147t-141 422q0 268 107 484.5t301 334t448 117.5q218 0 410 -99l-115 -251q-74 40 -148 64t-161 24q-153 0 -273.5 -83t-189 -236.5t-68.5 -330.5q0 -172 72.5 -252.5t222.5 -80.5q76 0 170 24 l66 299h-267z" />
+<glyph unicode="H" horiz-adv-x="1434" d="M1135 0h-306l134 631h-471l-134 -631h-305l309 1462h306l-121 -573h471l121 573h305z" />
+<glyph unicode="I" horiz-adv-x="659" d="M53 0l312 1462h305l-312 -1462h-305z" />
+<glyph unicode="J" horiz-adv-x="678" d="M-135 -430q-94 0 -187 27v253q88 -20 164 -20q99 0 160.5 60.5t89.5 191.5l293 1380h305l-303 -1423q-52 -245 -175.5 -357t-346.5 -112z" />
+<glyph unicode="K" horiz-adv-x="1255" d="M1141 0h-338l-211 592l-125 -70l-109 -522h-305l309 1462h306l-152 -702l158 205l409 497h361l-594 -700z" />
+<glyph unicode="L" horiz-adv-x="1061" d="M53 0l309 1462h306l-256 -1206h512l-54 -256h-817z" />
+<glyph unicode="M" horiz-adv-x="1802" d="M838 369l551 1093h423l-309 -1462h-280l145 692q53 247 105 441h-5l-569 -1133h-281l-61 1133h-4q-11 -88 -38 -231t-187 -902h-275l309 1462h404l68 -1093h4z" />
+<glyph unicode="N" horiz-adv-x="1546" d="M1247 0h-342l-356 1106h-6l-4 -32q-32 -216 -66 -386l-145 -688h-275l309 1462h357l340 -1077h4q12 76 39 217t180 860h274z" />
+<glyph unicode="O" horiz-adv-x="1495" d="M1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246t56 357 q0 142 -65 219.5t-183 77.5z" />
+<glyph unicode="P" horiz-adv-x="1188" d="M522 774h56q142 0 223.5 69t81.5 185q0 180 -195 180h-74zM1190 1036q0 -241 -169.5 -378.5t-467.5 -137.5h-86l-109 -520h-305l309 1462h338q242 0 366 -106.5t124 -319.5z" />
+<glyph unicode="Q" horiz-adv-x="1495" d="M1432 938q0 -316 -122.5 -555.5t-334.5 -337.5l254 -393h-359l-178 328h-26q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87 t155.5 246t56 357q0 142 -65 219.5t-183 77.5z" />
+<glyph unicode="R" horiz-adv-x="1247" d="M530 813h78q131 0 204 57t73 174q0 82 -47.5 123t-149.5 41h-74zM477 561l-119 -561h-305l309 1462h359q237 0 356 -102t119 -299q0 -158 -83 -271.5t-239 -168.5l261 -621h-332l-207 561h-119z" />
+<glyph unicode="S" horiz-adv-x="1085" d="M946 432q0 -209 -148 -330.5t-401 -121.5q-221 0 -356 90v274q193 -108 358 -108q112 0 175 42.5t63 116.5q0 43 -13.5 75.5t-38.5 60.5t-124 102q-138 99 -194 196t-56 209q0 129 62 230.5t176.5 158t263.5 56.5q217 0 397 -99l-109 -233q-156 74 -288 74 q-83 0 -136 -45t-53 -119q0 -61 33 -106.5t148 -120.5q121 -80 181 -176.5t60 -225.5z" />
+<glyph unicode="T" horiz-adv-x="1087" d="M571 0h-305l254 1204h-352l55 258h1010l-55 -258h-353z" />
+<glyph unicode="U" horiz-adv-x="1415" d="M1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306z" />
+<glyph unicode="V" horiz-adv-x="1208" d="M535 299q78 221 110 283l432 880h316l-748 -1462h-334l-127 1462h295l51 -880q4 -45 4 -133q-2 -103 -6 -150h7z" />
+<glyph unicode="W" horiz-adv-x="1831" d="M1006 1018q-46 -146 -115 -299l-324 -719h-338l-45 1462h287l6 -798q0 -52 -4 -173t-10 -174h6q22 64 67 180.5t60 145.5l369 819h270l21 -873q0 -146 -9 -272h6q43 129 131 349l330 796h309l-647 -1462h-346l-22 721l-2 139q0 88 4 158h-4z" />
+<glyph unicode="X" horiz-adv-x="1241" d="M1124 0h-331l-172 543l-396 -543h-342l576 764l-238 698h320l153 -518l363 518h344l-545 -725z" />
+<glyph unicode="Y" horiz-adv-x="1155" d="M627 870l374 592h342l-618 -903l-119 -559h-303l119 559l-236 903h312z" />
+<glyph unicode="Z" horiz-adv-x="1098" d="M920 0h-981l38 201l777 1005h-543l53 256h936l-41 -202l-782 -1004h596z" />
+<glyph unicode="[" horiz-adv-x="678" d="M436 -324h-473l381 1786h473l-45 -211h-215l-291 -1364h215z" />
+<glyph unicode="\" horiz-adv-x="862" d="M481 1462l224 -1462h-267l-217 1462h260z" />
+<glyph unicode="]" horiz-adv-x="678" d="M-92 -113h213l291 1364h-215l45 211h473l-381 -1786h-471z" />
+<glyph unicode="^" horiz-adv-x="1081" d="M20 520l619 950h147l277 -950h-223l-174 633l-402 -633h-244z" />
+<glyph unicode="_" horiz-adv-x="819" d="M635 -324h-821l30 140h822z" />
+<glyph unicode="`" horiz-adv-x="1135" d="M934 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="a" horiz-adv-x="1217" d="M406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44z" />
+<glyph unicode="b" horiz-adv-x="1219" d="M813 1139q146 0 230.5 -108t84.5 -298t-68 -367.5t-187 -281.5t-263 -104q-194 0 -276 163h-8l-58 -143h-231l330 1556h301l-62 -288q-41 -182 -84 -299h8q78 98 142.5 134t140.5 36zM692 895q-68 0 -130 -65t-102 -180.5t-40 -250.5q0 -80 37 -128t102 -48q67 0 128 69 t98.5 189.5t37.5 237.5q0 176 -131 176z" />
+<glyph unicode="c" horiz-adv-x="989" d="M506 -20q-201 0 -308.5 107.5t-107.5 303.5q0 212 74.5 385.5t209.5 268t308 94.5q182 0 328 -72l-92 -229q-54 23 -106 40t-118 17q-85 0 -153.5 -64t-107 -175.5t-38.5 -239.5q0 -96 45.5 -144.5t126.5 -48.5q76 0 141 23.5t134 58.5v-246q-152 -79 -336 -79z" />
+<glyph unicode="d" horiz-adv-x="1217" d="M406 -20q-147 0 -231.5 107t-84.5 300q0 196 71.5 374.5t188.5 278t258 99.5q82 0 141.5 -37t112.5 -127h8l2 28q6 110 25 195l76 358h301l-330 -1556h-229l14 145h-4q-71 -87 -148.5 -126t-170.5 -39zM532 223q66 0 128.5 68.5t100.5 182.5t38 245q0 80 -37.5 128 t-102.5 48q-68 0 -129.5 -72t-98 -190t-36.5 -234q0 -176 137 -176z" />
+<glyph unicode="e" horiz-adv-x="1141" d="M696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5t147.5 -52.5 q87 0 158 19t172 67v-227q-172 -86 -390 -86z" />
+<glyph unicode="f" horiz-adv-x="764" d="M-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h219l-49 -229h-220l-215 -1010q-77 -371 -403 -371z" />
+<glyph unicode="g" horiz-adv-x="1108" d="M1186 1116l-35 -166l-174 -41q16 -52 16 -118q0 -195 -121 -308.5t-329 -113.5q-59 0 -99 10q-84 -27 -84 -78q0 -34 30 -49t89 -23l137 -18q163 -21 237.5 -84.5t74.5 -183.5q0 -211 -156 -323t-446 -112q-208 0 -324.5 75.5t-116.5 207.5q0 102 68.5 175.5t214.5 121.5 q-74 47 -74 133q0 71 44.5 122.5t146.5 98.5q-65 49 -96 112t-31 153q0 199 125.5 315.5t341.5 116.5q83 0 166 -23h395zM365 -6q-106 -14 -160.5 -57t-54.5 -109q0 -115 194 -115q151 0 228 45t77 127q0 39 -32.5 60t-137.5 35zM614 948q-77 0 -124.5 -76.5t-47.5 -191.5 q0 -119 103 -119q75 0 121.5 76.5t46.5 193.5t-99 117z" />
+<glyph unicode="h" horiz-adv-x="1237" d="M977 0h-301l137 653q16 68 16 119q0 123 -108 123q-92 0 -167 -114t-118 -318l-98 -463h-301l330 1556h301q-39 -181 -60 -278t-86 -309h8q62 77 138 123.5t176 46.5q138 0 213.5 -83.5t75.5 -238.5q0 -73 -23 -180z" />
+<glyph unicode="i" horiz-adv-x="608" d="M322 1380q0 87 47.5 131.5t134.5 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-151 0 -151 123zM338 0h-301l237 1118h301z" />
+<glyph unicode="j" horiz-adv-x="608" d="M-90 -492q-104 0 -174 25v242q61 -21 114 -21q137 0 173 170l253 1194h302l-265 -1239q-77 -371 -403 -371zM324 1380q0 87 47.5 131.5t134.5 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-151 0 -151 123z" />
+<glyph unicode="k" horiz-adv-x="1163" d="M920 1118h344l-498 -504l285 -614h-336l-183 420l-120 -72l-74 -348h-301l330 1556h301l-148 -694q-8 -41 -29 -117l-28 -102h4z" />
+<glyph unicode="l" horiz-adv-x="608" d="M338 0h-301l330 1556h301z" />
+<glyph unicode="m" horiz-adv-x="1853" d="M844 1139q219 0 262 -228h6q68 110 160.5 169t197.5 59q136 0 207.5 -85t71.5 -237q0 -76 -23 -180l-133 -637h-301l138 653q16 68 16 119q0 123 -98 123q-92 0 -166.5 -112t-118.5 -318l-96 -465h-301l137 653q16 68 16 119q0 123 -98 123q-92 0 -167 -114t-118 -318 l-98 -463h-301l237 1118h230l-21 -207h6q146 228 355 228z" />
+<glyph unicode="n" horiz-adv-x="1237" d="M977 0h-301l137 653q16 68 16 119q0 123 -108 123q-92 0 -167 -114t-118 -318l-98 -463h-301l237 1118h230l-21 -207h6q146 228 355 228q138 0 213.5 -83.5t75.5 -238.5q0 -73 -23 -180z" />
+<glyph unicode="o" horiz-adv-x="1198" d="M805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5q196 0 310 -118 t114 -325z" />
+<glyph unicode="p" horiz-adv-x="1219" d="M813 1139q146 0 230.5 -107.5t84.5 -300.5q0 -191 -68.5 -367.5t-187.5 -280t-262 -103.5q-83 0 -143 37t-111 126h-8q-12 -159 -43 -295l-72 -340h-301l342 1610h230l-17 -170h9q138 191 317 191zM692 895q-68 0 -131.5 -67.5t-102 -180t-38.5 -248.5q0 -80 37 -128 t102 -48q67 0 128 69t98.5 189.5t37.5 237.5q0 176 -131 176z" />
+<glyph unicode="q" horiz-adv-x="1217" d="M391 -20q-88 0 -156 47.5t-106.5 138.5t-38.5 219q0 198 72 377.5t189 278t257 98.5q86 0 152.5 -37.5t124.5 -126.5h8l57 143h232l-342 -1610h-301q47 218 73 337.5t84 304.5h-8q-72 -94 -143 -132t-154 -38zM535 223q64 0 127.5 70t100 181t36.5 245q0 80 -37.5 128 t-102.5 48q-68 0 -129.5 -72t-98 -190t-36.5 -234q0 -88 36.5 -132t103.5 -44z" />
+<glyph unicode="r" horiz-adv-x="862" d="M842 1139q59 0 96 -11l-66 -290q-45 16 -100 16q-116 0 -203.5 -91.5t-124.5 -262.5l-106 -500h-301l237 1118h230l-21 -207h6q147 228 353 228z" />
+<glyph unicode="s" horiz-adv-x="969" d="M829 369q0 -188 -124.5 -288.5t-346.5 -100.5q-107 0 -186.5 15t-148.5 50v248q157 -90 319 -90q80 0 131 32.5t51 88.5q0 43 -37 77t-131 86q-121 68 -169 135.5t-48 159.5q0 170 110.5 263.5t315.5 93.5q201 0 363 -95l-99 -215q-140 84 -258 84q-57 0 -92 -25.5 t-35 -68.5q0 -39 32 -68.5t120 -74.5q123 -63 178 -137t55 -170z" />
+<glyph unicode="t" horiz-adv-x="840" d="M514 223q65 0 162 35v-225q-111 -53 -266 -53q-150 0 -220.5 63t-70.5 195q0 50 12 112l115 539h-152l29 147l196 84l132 236h194l-49 -238h283l-50 -229h-282l-115 -539q-6 -30 -6 -53q0 -74 88 -74z" />
+<glyph unicode="u" horiz-adv-x="1237" d="M262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213z" />
+<glyph unicode="v" horiz-adv-x="1049" d="M455 301q55 153 92 223l297 594h323l-604 -1118h-323l-138 1118h295l45 -586q7 -133 7 -231h6z" />
+<glyph unicode="w" horiz-adv-x="1614" d="M856 860q-62 -178 -123 -319l-233 -541h-324l-51 1118h281l4 -495l-4 -167l-7 -171h4q6 20 14 41.5t51 136.5t46 119l231 536h328v-536q0 -142 -10 -297h6l28 80q73 208 95 258l219 495h307l-530 -1118h-330l-6 520q0 155 10 340h-6z" />
+<glyph unicode="x" horiz-adv-x="1087" d="M379 573l-225 545h321l115 -334l244 334h354l-467 -561l244 -557h-326l-125 342l-264 -342h-350z" />
+<glyph unicode="y" horiz-adv-x="1063" d="M102 1118h295l56 -518q14 -122 14 -293h6q20 51 44 119.5t65 153.5l260 538h327l-680 -1278q-177 -332 -483 -332q-90 0 -147 19v240q68 -13 116 -13q84 0 147.5 48t117.5 149l26 49z" />
+<glyph unicode="z" horiz-adv-x="932" d="M748 0h-795l35 180l575 705h-397l51 233h750l-43 -200l-566 -685h439z" />
+<glyph unicode="{" horiz-adv-x="727" d="M201 319q0 140 -209 140l45 229q122 0 192.5 41.5t92.5 138.5l61 285q38 170 131 239.5t270 69.5h84l-49 -225q-90 -2 -130.5 -34.5t-55.5 -106.5l-66 -297q-45 -207 -276 -236v-8q85 -26 126.5 -82.5t41.5 -134.5q0 -44 -15 -113l-36 -178q-7 -28 -7 -51q0 -54 33.5 -74 t91.5 -20v-226h-53q-167 0 -253.5 63.5t-86.5 184.5q0 57 14 125l39 184q15 69 15 86z" />
+<glyph unicode="|" d="M455 1550h219v-2015h-219v2015z" />
+<glyph unicode="}" horiz-adv-x="727" d="M256 1462q340 0 340 -248q0 -56 -14 -124l-39 -185q-15 -69 -15 -86q0 -139 209 -139l-45 -229q-122 0 -192.5 -42t-91.5 -139l-62 -284q-37 -170 -130.5 -240t-270.5 -70h-45v226q93 3 137 35.5t59 105.5l66 297q25 111 95 166t181 69v9q-168 51 -168 217q0 43 15 112 l37 179q6 30 6 51q0 54 -36.5 74t-109.5 20l41 225h33z" />
+<glyph unicode="~" d="M342 672q-54 0 -116.5 -33t-116.5 -88v231q101 109 256 109q64 0 117 -14t139 -50q64 -27 111 -41t95 -14q51 0 112 30.5t122 90.5v-231q-103 -109 -256 -109q-59 0 -109 11.5t-147 51.5q-89 38 -127 47t-80 9z" />
+<glyph unicode="&#xa1;" horiz-adv-x="586" d="M182 606h242l-158 -977h-340zM549 977q0 -92 -55.5 -145.5t-149.5 -53.5q-68 0 -108.5 38t-40.5 108q0 85 54 139.5t144 54.5q73 0 114.5 -37t41.5 -104z" />
+<glyph unicode="&#xa2;" d="M575 -20h-188l49 210q-134 36 -203 136t-69 258q0 193 62.5 355t178 262.5t267.5 123.5l33 158h188l-35 -158q118 -14 225 -65l-92 -230q-53 23 -105 40t-118 17q-133 0 -216 -143t-83 -336q0 -96 45 -144t127 -48q75 0 140 23.5t134 58.5v-246q-136 -71 -299 -80z" />
+<glyph unicode="&#xa3;" d="M872 1485q195 0 369 -86l-113 -232q-141 68 -237 68q-75 0 -123 -39.5t-68 -132.5l-47 -229h299l-45 -220h-299l-18 -84q-42 -195 -209 -270h655l-55 -260h-993l49 246q196 48 244 264l22 104h-192l45 220h192l49 247q41 197 162 300.5t313 103.5z" />
+<glyph unicode="&#xa4;" d="M190 723q0 102 54 197l-129 127l147 147l127 -127q91 53 197 53q105 0 196 -55l127 129l150 -143l-129 -129q53 -89 53 -199q0 -107 -53 -199l125 -125l-146 -145l-127 125q-95 -51 -196 -51q-115 0 -199 51l-125 -123l-145 145l127 125q-54 93 -54 197zM397 723 q0 -77 54.5 -132.5t134.5 -55.5q81 0 136.5 55t55.5 133q0 80 -56.5 135t-135.5 55q-78 0 -133.5 -56t-55.5 -134z" />
+<glyph unicode="&#xa5;" d="M608 872l371 590h311l-506 -747h203l-39 -178h-252l-28 -138h252l-37 -178h-252l-47 -221h-291l47 221h-252l37 178h252l29 138h-252l39 178h196l-192 747h297z" />
+<glyph unicode="&#xa6;" d="M455 1550h219v-815h-219v815zM455 350h219v-815h-219v815z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M150 760q0 89 47.5 163t154.5 142q-42 34 -70 84.5t-28 107.5q0 149 117 234.5t313 85.5q172 0 344 -88l-82 -193q-147 84 -282 84q-144 0 -144 -106q0 -43 40.5 -76t127.5 -72q242 -106 242 -303q0 -188 -193 -303q38 -35 64 -85.5t26 -108.5q0 -161 -126 -253.5 t-345 -92.5q-204 0 -336 75v224q172 -105 345 -105q99 0 144.5 35t45.5 92q0 39 -33 72.5t-127 79.5q-117 57 -181 131t-64 176zM506 967q-51 -25 -82 -70.5t-31 -99.5t43.5 -96.5t143.5 -88.5q49 31 75.5 78.5t26.5 95.5q0 109 -176 181z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1135" d="M397 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM799 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M932 1010q-111 0 -163 -73t-52 -214q0 -134 55.5 -203t159.5 -69q43 0 108.5 15.5t124.5 43.5v-191q-131 -57 -262 -57q-196 0 -307 122.5t-111 336.5q0 225 117.5 351t325.5 126q142 0 284 -72l-75 -174q-114 58 -205 58zM125 731q0 200 100 375t275 276t377 101 q199 0 373.5 -99t276 -275.5t101.5 -377.5q0 -199 -98.5 -373t-272.5 -276t-380 -102q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM266 731q0 -164 81.5 -305t224 -223t305.5 -82q167 0 308 83t221.5 223.5t80.5 303.5t-80.5 303.5t-222 223.5t-307.5 83 q-164 0 -306.5 -82.5t-223.5 -223.5t-81 -304z" />
+<glyph unicode="&#xaa;" horiz-adv-x="772" d="M369 752q-103 0 -160 70t-57 198q0 117 46 228t123 171t177 60q120 0 180 -103h6l39 90h154l-158 -702h-154l8 92h-2q-80 -104 -202 -104zM442 903q45 0 84 41.5t65.5 120t26.5 154.5q0 106 -88 106q-73 0 -123.5 -96t-50.5 -215q0 -111 86 -111z" />
+<glyph unicode="&#xab;" horiz-adv-x="1151" d="M72 569l401 463l191 -155l-279 -334l135 -350l-246 -103l-202 461v18zM559 569l402 463l190 -155l-279 -334l136 -350l-246 -103l-203 461v18z" />
+<glyph unicode="&#xac;" d="M1061 248h-219v364h-733v219h952v-583z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M41 424zM41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M1237 899q0 -86 -44 -149.5t-130 -96.5l197 -360h-254l-138 297h-67v-297h-230v874h308q173 0 265.5 -67.5t92.5 -200.5zM801 758h51q72 0 113 31t41 92q0 59 -35.5 88.5t-116.5 29.5h-53v-241zM125 731q0 200 100 375t275 276t377 101q199 0 373.5 -99t276 -275.5 t101.5 -377.5q0 -199 -98.5 -373t-272.5 -276t-380 -102q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM266 731q0 -164 81.5 -305t224 -223t305.5 -82q167 0 308 83t221.5 223.5t80.5 303.5t-80.5 303.5t-222 223.5t-307.5 83q-164 0 -306.5 -82.5t-223.5 -223.5t-81 -304z " />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036l45 201h1036z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M164 1137q0 93 46.5 173.5t127.5 126.5t172 46q93 0 173.5 -47t126.5 -127t46 -172q0 -93 -46 -173t-126 -125.5t-174 -45.5q-93 0 -173 45t-126.5 125t-46.5 174zM354 1137q0 -63 45.5 -108.5t110.5 -45.5q66 0 111 46t45 108q0 63 -45.5 110t-110.5 47t-110.5 -47.5 t-45.5 -109.5z" />
+<glyph unicode="&#xb1;" d="M475 674h-366v219h366v369h219v-369h367v-219h-367v-365h-219v365zM109 0v219h952v-219h-952z" />
+<glyph unicode="&#xb2;" horiz-adv-x="776" d="M707 586h-648l35 166l273 219q111 91 141 122t44.5 59t14.5 56q0 42 -25.5 62t-60.5 20q-86 0 -188 -82l-100 158q74 57 156 87t192 30q123 0 196.5 -63t73.5 -160q0 -70 -22 -123t-70 -103.5t-189 -152.5l-129 -95h347z" />
+<glyph unicode="&#xb3;" horiz-adv-x="776" d="M813 1270q0 -87 -51 -145.5t-166 -88.5v-4q154 -33 154 -176q0 -131 -107 -209t-285 -78q-75 0 -145.5 15.5t-120.5 40.5v192q125 -72 254 -72q76 0 125 30.5t49 88.5q0 37 -26 62.5t-88 25.5h-127l34 160h90q84 0 132.5 28t48.5 85q0 40 -26 60t-71 20q-86 0 -188 -66 l-82 150q142 92 313 92q130 0 206.5 -55.5t76.5 -155.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1135" d="M483 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1249" d="M424 348q0 -60 31.5 -92.5t79.5 -32.5q90 0 162.5 106.5t117.5 319.5l98 469h301l-237 -1118h-229l18 176h-6q-117 -196 -266 -196q-51 0 -89.5 19.5t-58.5 47.5h-6q-8 -66 -21.5 -139t-82.5 -400h-304l342 1610h301l-135 -645q-16 -70 -16 -125z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1202 -260h-162v1616h-166v-1616h-161v819q-62 -18 -146 -18q-216 0 -318 125t-102 376q0 256 107.5 385t343.5 129h604v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="584" d="M131 553zM131 695q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M262 -250q0 -116 -83 -179t-234 -63q-86 0 -152 23v168q63 -23 125 -23q102 0 102 82q0 34 -31 56.5t-110 31.5l96 154h185l-39 -72q141 -49 141 -178z" />
+<glyph unicode="&#xb9;" horiz-adv-x="776" d="M528 1462h207l-186 -876h-246l84 397q24 109 55 207q-16 -15 -80 -60l-131 -81l-102 165z" />
+<glyph unicode="&#xba;" horiz-adv-x="754" d="M809 1194q0 -128 -48.5 -232.5t-132.5 -157t-196 -52.5q-134 0 -202 75t-68 211q0 197 104 319t277 122q129 0 197.5 -73.5t68.5 -211.5zM522 1315q-64 0 -107.5 -89.5t-43.5 -199.5q0 -111 80 -111q63 0 105 85.5t42 207.5q0 107 -76 107z" />
+<glyph unicode="&#xbb;" horiz-adv-x="1151" d="M1079 535l-401 -463l-191 155l279 334l-135 350l246 103l202 -461v-18zM592 535l-402 -463l-190 155l279 334l-136 350l246 103l203 -461v-18z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1804" d="M97 0zM1500 1462l-1084 -1462h-239l1087 1462h236zM496 1462h207l-186 -876h-246l84 397q24 109 55 207q-16 -15 -80 -60l-131 -81l-102 165zM1573 152h-119l-32 -151h-238l33 151h-373l31 174l475 557h260l-121 -563h119zM1252 320l58 231l22 74q-13 -20 -43 -58 t-211 -247h174z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1804" d="M97 0zM1588 1h-648l35 166l273 219q111 91 141 122t44.5 59t14.5 56q0 42 -25.5 62t-60.5 20q-86 0 -188 -82l-100 158q74 57 156 87t192 30q123 0 196.5 -63t73.5 -160q0 -70 -22 -123t-70 -103.5t-189 -152.5l-129 -95h347zM496 1462h207l-186 -876h-246l84 397 q24 109 55 207q-16 -15 -80 -60l-131 -81l-102 165zM1500 1462l-1084 -1462h-239l1087 1462h236z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1804" d="M133 0zM1633 1462l-1084 -1462h-239l1087 1462h236zM1634 152h-119l-32 -151h-238l33 151h-373l31 174l475 557h260l-121 -563h119zM1313 320l58 231l22 74q-13 -20 -43 -58t-211 -247h174zM854 1270q0 -87 -51 -145.5t-166 -88.5v-4q154 -33 154 -176q0 -131 -107 -209 t-285 -78q-75 0 -145.5 15.5t-120.5 40.5v192q125 -72 254 -72q76 0 125 30.5t49 88.5q0 37 -26 62.5t-88 25.5h-127l34 160h90q84 0 132.5 28t48.5 85q0 40 -26 60t-71 20q-86 0 -188 -66l-82 150q142 92 313 92q130 0 206.5 -55.5t76.5 -155.5z" />
+<glyph unicode="&#xbf;" horiz-adv-x="940" d="M678 606l-14 -78q-19 -105 -76.5 -180t-169.5 -151q-122 -83 -156.5 -126t-34.5 -98q0 -118 133 -118q50 0 106.5 16t201.5 84l92 -221q-221 -125 -445 -125q-177 0 -280 87.5t-103 244.5q0 82 28.5 148.5t83.5 124t189 146.5q93 62 128 106.5t51 106.5l8 33h258z M772 977q0 -92 -55.5 -145.5t-149.5 -53.5q-68 0 -108.5 38t-40.5 108q0 86 54.5 140t143.5 54q73 0 114.5 -37t41.5 -104z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM965 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM735 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM1235 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z " />
+<glyph unicode="&#xc3;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM999 1579q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5 t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM516 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM918 1720q0 78 42 118t120 40 q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM1087 1567q0 -107 -70 -173.5t-184 -66.5q-110 0 -179 63.5t-69 174.5q0 109 68.5 173t179.5 64q110 0 182 -65t72 -170z M930 1565q0 45 -27.5 70.5t-69.5 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69.5 26t27.5 71z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1833" d="M1593 0h-817l74 348h-426l-219 -348h-328l922 1462h1104l-54 -254h-512l-67 -321h477l-55 -254h-478l-79 -377h512zM905 608l127 600h-80l-364 -600h317z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1253" d="M123 0zM905 1227q-132 0 -237.5 -81t-169.5 -238.5t-64 -338.5q0 -167 68.5 -248t218.5 -81q146 0 338 77v-260q-199 -77 -400 -77q-254 0 -395 149.5t-141 423.5q0 262 104 482.5t278 335t400 114.5q125 0 222 -22.5t208 -82.5l-118 -250q-106 59 -175 78t-137 19z M825 -250q0 -116 -83 -179t-234 -63q-86 0 -152 23v168q63 -23 125 -23q102 0 102 82q0 34 -31 56.5t-110 31.5l96 154h185l-39 -72q141 -49 141 -178z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM906 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM608 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xca;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM1177 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM438 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM840 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5 t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xcc;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM667 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM414 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xce;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM937 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xcf;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM222 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM624 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1386" d="M1323 909q0 -280 -98 -486.5t-283.5 -314.5t-437.5 -108h-451l125 596h-141l55 254h139l131 612h396q270 0 417.5 -143t147.5 -410zM518 256q148 0 258 76t172 223.5t62 337.5q0 154 -72.5 234.5t-208.5 80.5h-115l-75 -358h237l-55 -254h-238l-71 -340h106z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1546" d="M53 0zM1247 0h-342l-356 1106h-6l-4 -32q-32 -216 -66 -386l-145 -688h-275l309 1462h357l340 -1077h4q12 76 39 217t180 860h274zM1114 1579q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36 t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM1053 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM753 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM1308 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM1071 1579q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM585 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM987 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xd7;" d="M428 723l-299 301l152 154l301 -299l305 299l153 -150l-305 -305l301 -303l-149 -152l-305 301l-301 -299l-150 152z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1495" d="M1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-180 0 -304 71l-108 -137l-154 115l121 151q-98 138 -98 357q0 265 99 487.5t273 341.5t402 119q182 0 305 -76l105 131l151 -117l-117 -145q91 -134 91 -340zM870 1233q-126 0 -229 -91.5t-160 -252.5t-57 -352 q0 -32 8 -101l596 754q-69 43 -158 43zM1133 930l-5 80l-589 -740q59 -37 153 -37q124 0 226 89t158.5 247.5t56.5 360.5z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM1002 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311 q36 -148 115 -303v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM757 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5 t-194 -158.5h-209v25z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM1284 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217 v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM565 1720q0 78 42.5 118t119.5 40q133 0 133 -108 q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM967 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1155" d="M186 0zM627 870l374 592h342l-618 -903l-119 -559h-303l119 559l-236 903h312zM606 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xde;" horiz-adv-x="1188" d="M1143 807q0 -243 -170.5 -378.5t-466.5 -135.5h-86l-62 -293h-305l309 1462h306l-50 -229h35q242 0 366 -106.5t124 -319.5zM475 547h55q139 0 222.5 66.5t83.5 185.5q0 180 -195 180h-74z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1350" d="M846 1567q208 0 331 -90t123 -240q0 -114 -49 -192t-178 -152q-73 -42 -96 -68.5t-23 -54.5q0 -23 22 -49.5t79 -69.5q107 -83 144.5 -150.5t37.5 -150.5q0 -170 -123.5 -270t-337.5 -100q-187 0 -297 61v240q128 -78 258 -78q101 0 148 33t47 86q0 40 -26.5 75 t-108.5 97q-94 72 -129 130t-35 126q0 84 45 145t162 127q66 37 104.5 76t38.5 96q0 62 -39.5 98.5t-124.5 36.5q-96 0 -156 -51.5t-85 -171.5l-254 -1219q-43 -198 -147 -288.5t-277 -90.5q-90 0 -160 25v242q61 -21 115 -21q133 0 170 178l254 1207q47 224 182 326 t385 102z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM869 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM598 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM1120 1240h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM884 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM397 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM799 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM1023 1479q0 -107 -70 -173.5t-184 -66.5q-110 0 -179 63.5t-69 174.5q0 109 68.5 173t179.5 64q110 0 182 -65t72 -170zM866 1477q0 45 -27.5 70.5t-69.5 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69.5 26t27.5 71z " />
+<glyph unicode="&#xe6;" horiz-adv-x="1786" d="M1206 -20q-109 0 -179.5 27t-117.5 87l-16 -94h-188l14 145h-6q-71 -88 -146.5 -126.5t-167.5 -38.5q-146 0 -227.5 109t-81.5 296q0 200 68.5 375.5t185 277t258.5 101.5q96 0 160.5 -38.5t114.5 -125.5h6l57 143h188l-18 -90q44 49 120.5 80t168.5 31 q157 0 246.5 -83.5t89.5 -221.5q0 -187 -167 -288.5t-476 -101.5h-52l-2 -19v-19q0 -96 55.5 -147.5t159.5 -51.5q66 0 152 23t162 63v-227q-179 -86 -361 -86zM518 223q72 0 134 68t99 184.5t37 243.5q0 80 -33 128t-102 48q-68 0 -128 -69t-95 -185.5t-35 -241.5 q0 -84 32.5 -130t90.5 -46zM1341 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95z" />
+<glyph unicode="&#xe7;" horiz-adv-x="989" d="M90 0zM506 -20q-201 0 -308.5 107.5t-107.5 303.5q0 212 74.5 385.5t209.5 268t308 94.5q182 0 328 -72l-92 -229q-54 23 -106 40t-118 17q-85 0 -153.5 -64t-107 -175.5t-38.5 -239.5q0 -96 45.5 -144.5t126.5 -48.5q76 0 141 23.5t134 58.5v-246q-152 -79 -336 -79z M653 -250q0 -116 -83 -179t-234 -63q-86 0 -152 23v168q63 -23 125 -23q102 0 102 82q0 34 -31 56.5t-110 31.5l96 154h185l-39 -72q141 -49 141 -178z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM849 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM528 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xea;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM1101 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM365 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM767 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xec;" horiz-adv-x="608" d="M37 0zM338 0h-301l237 1118h301zM579 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="608" d="M37 0zM338 0h-301l237 1118h301zM291 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xee;" horiz-adv-x="608" d="M36 0zM338 0h-301l237 1118h301zM845 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xef;" horiz-adv-x="608" d="M37 0zM338 0h-301l237 1118h301zM126 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM528 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1182" d="M618 1309q-34 34 -124 80l118 186q134 -61 232 -139l237 131l76 -152l-192 -106q81 -107 113 -235t32 -279q0 -249 -69.5 -432.5t-203.5 -283t-323 -99.5q-216 0 -329 110t-113 316q0 165 64.5 301t180.5 212t265 76q83 0 151.5 -31t114.5 -94h6q-20 213 -117 310 l-231 -131l-88 147zM528 205q66 0 122.5 55.5t89 148.5t32.5 193q0 77 -38.5 122.5t-108.5 45.5q-73 0 -130 -53t-88.5 -143t-31.5 -197q0 -81 39 -126.5t114 -45.5z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1237" d="M37 0zM977 0h-301l137 653q16 68 16 119q0 123 -108 123q-92 0 -167 -114t-118 -318l-98 -463h-301l237 1118h230l-21 -207h6q146 228 355 228q138 0 213.5 -83.5t75.5 -238.5q0 -73 -23 -180zM909 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28 t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM845 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM571 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM1109 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM865 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM386 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM788 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xf7;" d="M109 612v219h952v-219h-952zM444 373q0 76 37 113.5t103 37.5t102.5 -39t36.5 -112q0 -70 -37 -111t-102 -41t-102.5 39t-37.5 113zM444 1071q0 75 37 113.5t103 38.5q67 0 103 -40.5t36 -111.5q0 -70 -37 -110.5t-102 -40.5t-102.5 39t-37.5 112z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1198" d="M1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-123 0 -225 53l-109 -135l-141 108l119 148q-72 107 -72 256q0 213 71.5 379.5t206.5 258t316 91.5q131 0 227 -56l70 88l145 -110l-84 -105q66 -107 66 -260zM662 903q-81 0 -144.5 -62.5t-98 -169.5t-34.5 -233 v-12l365 453q-35 24 -88 24zM543 215q114 0 193 133t79 318v16l-358 -444q11 -8 35.5 -15.5t50.5 -7.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM845 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311 q36 -148 115 -303v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM610 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209 v25z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM1143 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25 q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM411 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5 t-121 -43.5q-135 0 -135 110zM813 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1063" d="M0 0zM102 1118h295l56 -518q14 -122 14 -293h6q20 51 44 119.5t65 153.5l260 538h327l-680 -1278q-177 -332 -483 -332q-90 0 -147 19v240q68 -13 116 -13q84 0 147.5 48t117.5 149l26 49zM497 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1219" d="M813 1139q150 0 232.5 -106.5t82.5 -301.5q0 -199 -69 -381t-182 -276t-250 -94q-178 0 -271 163h-8q-12 -159 -43 -295l-72 -340h-301l435 2048h301l-66 -307q-29 -131 -80 -280h8q131 170 283 170zM682 895q-71 0 -130 -65t-95.5 -184.5t-36.5 -246.5q0 -80 33.5 -128 t105.5 -48q69 0 129 65t97.5 183.5t37.5 247.5q0 88 -37.5 132t-103.5 44z" />
+<glyph unicode="&#xff;" horiz-adv-x="1063" d="M0 0zM102 1118h295l56 -518q14 -122 14 -293h6q20 51 44 119.5t65 153.5l260 538h327l-680 -1278q-177 -332 -483 -332q-90 0 -147 19v240q68 -13 116 -13q84 0 147.5 48t117.5 149l26 49zM310 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5 q-135 0 -135 110zM712 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#x131;" horiz-adv-x="608" d="M338 0h-301l237 1118h301z" />
+<glyph unicode="&#x152;" horiz-adv-x="1845" d="M1606 0h-760q-93 -20 -180 -20q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q140 0 209 -23h809l-53 -254h-512l-68 -321h477l-55 -254h-477l-80 -377h512zM688 240q88 0 158 32l194 916q-62 39 -168 39q-121 0 -222 -91.5t-158.5 -251.5 t-57.5 -347q0 -147 66.5 -222t187.5 -75z" />
+<glyph unicode="&#x153;" horiz-adv-x="1806" d="M1198 -20q-116 0 -208 38.5t-138 106.5q-63 -68 -147 -106.5t-207 -38.5q-187 0 -297.5 117t-110.5 317q0 216 69 380.5t200 254.5t309 90q209 0 313 -160q154 160 399 160q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-476 -101.5h-51l-2 -21v-20q0 -91 51 -143.5 t147 -52.5q87 0 158 19t172 67v-227q-93 -46 -185.5 -66t-203.5 -20zM645 893q-71 0 -127 -60.5t-90.5 -176.5t-34.5 -242q0 -91 36.5 -140t109.5 -49q109 0 179 134.5t70 336.5q0 96 -37 146.5t-106 50.5zM1362 922q-88 0 -165.5 -78.5t-102.5 -196.5h45q155 0 241 48.5 t86 131.5q0 95 -104 95z" />
+<glyph unicode="&#x178;" horiz-adv-x="1155" d="M186 0zM627 870l374 592h342l-618 -903l-119 -559h-303l119 559l-236 903h312zM432 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM834 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5 q-135 0 -135 110z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1135" d="M1120 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M1034 1479q0 -107 -70 -173.5t-184 -66.5q-110 0 -179 63.5t-69 174.5q0 109 68.5 173t179.5 64q110 0 182 -65t72 -170zM877 1477q0 45 -27.5 70.5t-69.5 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69.5 26t27.5 71z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1135" d="M866 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M41 436l49 230h852l-49 -230h-852z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1966" d="M41 436l49 230h1835l-49 -230h-1835z" />
+<glyph unicode="&#x2018;" horiz-adv-x="440" d="M123 961l-8 22q103 227 262 479h225q-91 -213 -194 -501h-285z" />
+<glyph unicode="&#x2019;" horiz-adv-x="440" d="M586 1462l8 -22q-103 -227 -262 -479h-226q89 206 195 501h285z" />
+<glyph unicode="&#x201a;" horiz-adv-x="569" d="M377 238l8 -23q-103 -227 -262 -479h-225q88 207 194 502h285z" />
+<glyph unicode="&#x201c;" horiz-adv-x="887" d="M569 961l-8 22q103 227 262 479h226q-97 -227 -195 -501h-285zM123 961l-8 22q103 227 262 479h225q-91 -213 -194 -501h-285z" />
+<glyph unicode="&#x201d;" horiz-adv-x="887" d="M586 1462l8 -22q-103 -227 -262 -479h-226q89 206 195 501h285zM1032 1462l8 -22q-103 -227 -262 -479h-225q23 53 46.5 111t148.5 390h284z" />
+<glyph unicode="&#x201e;" horiz-adv-x="1018" d="M377 238l8 -23q-103 -227 -262 -479h-225q88 207 194 502h285zM825 238l9 -23q-100 -221 -263 -479h-225q24 57 49 118.5t146 383.5h284z" />
+<glyph unicode="&#x2022;" horiz-adv-x="739" d="M104 686q0 106 42.5 194t120 136.5t182.5 48.5q120 0 182.5 -67t62.5 -191q0 -177 -91.5 -277t-248.5 -100q-117 0 -183.5 67t-66.5 189z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1706" d="M25 0zM25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5zM586 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5zM1147 115q0 90 53.5 144t150.5 54 q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="664" d="M72 569l401 463l191 -155l-279 -334l135 -350l-246 -103l-202 461v18z" />
+<glyph unicode="&#x203a;" horiz-adv-x="664" d="M592 535l-402 -463l-190 155l279 334l-136 350l246 103l203 -461v-18z" />
+<glyph unicode="&#x2044;" horiz-adv-x="256" d="M791 1462l-1084 -1462h-239l1087 1462h236z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="776" d="M776 737h-119l-32 -151h-238l33 151h-373l31 174l475 557h260l-121 -563h119zM455 905l58 231l22 74q-13 -20 -43 -58t-211 -247h174z" />
+<glyph unicode="&#x20ac;" d="M899 1237q-97 0 -176 -74.5t-135 -212.5h348l-39 -176h-360q-11 -34 -25 -115h299l-37 -178h-280q0 -120 44.5 -181.5t147.5 -61.5q133 0 283 63v-258q-126 -63 -330 -63q-446 0 -446 501h-152l37 178h127q9 67 22 115h-125l39 176h135q87 252 250.5 393.5t374.5 141.5 q100 0 179 -23t165 -80l-125 -223q-87 49 -131 63.5t-90 14.5z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M471 741h-168v572h-197v149h564v-149h-199v-572zM1047 741l-166 529h-7l5 -111v-418h-164v721h248l159 -510l170 510h240v-721h-168v408l4 121h-6l-174 -529h-141z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1120" d="M0 1120h1120v-1120h-1120v1120z" />
+<glyph horiz-adv-x="1217" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff
new file mode 100644 (file)
index 0000000..ed760c0
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot
new file mode 100644 (file)
index 0000000..0c8a0ae
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.svg b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.svg
new file mode 100644 (file)
index 0000000..e1075dc
--- /dev/null
@@ -0,0 +1,1830 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansitalic" horiz-adv-x="1128" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1165" d="M0 0zM-104 -492q-69 0 -125 21v141q64 -22 112 -22q76 0 117 62t66 177l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h238l-25 -127h-237l-232 -1098 q-39 -189 -120 -276t-213 -87zM870 0h-168l234 1096h168zM983 1376q0 56 32 91.5t83 35.5q88 0 88 -90q0 -55 -33.5 -93t-77.5 -38q-40 0 -66 24.5t-26 69.5z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1165" d="M0 0zM-104 -492q-69 0 -125 21v141q64 -22 112 -22q76 0 117 62t66 177l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h238l-25 -127h-237l-232 -1098 q-39 -189 -120 -276t-213 -87zM868 0h-168l332 1556h168z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1815" d="M545 -492q-71 0 -125 21v141q61 -22 115 -22q68 0 111 57.5t69 181.5l227 1082h-481l-232 -1098q-39 -189 -120 -276t-213 -87q-69 0 -125 21v141q64 -22 112 -22q70 0 114 58t69 181l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5 t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h482l24 108q45 197 126 280t243 83q41 0 97.5 -11t92.5 -26l-45 -129q-76 29 -137 29q-89 0 -135 -51t-74 -175l-24 -108h239l-26 -127h-238l-231 -1098q-43 -195 -123.5 -279t-210.5 -84z M1522 0h-168l233 1096h168zM1634 1376q0 54 32 90.5t83 36.5q88 0 88 -90q0 -55 -33.5 -93t-77.5 -38q-38 0 -65 24.5t-27 69.5z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1815" d="M1520 0h-168l331 1556h168zM545 -492q-71 0 -125 21v141q61 -22 115 -22q68 0 111 57.5t69 181.5l227 1082h-481l-232 -1098q-39 -189 -120 -276t-213 -87q-69 0 -125 21v141q64 -22 112 -22q70 0 114 58t69 181l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5 t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h482l24 108q45 197 126 280t243 83q41 0 97.5 -11t92.5 -26l-45 -129q-76 29 -137 29q-89 0 -135 -51t-74 -175l-24 -108h239l-26 -127h-238l-231 -1098 q-43 -195 -123.5 -279t-210.5 -84z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="530" d="M555 1462l-274 -1059h-109q49 307 176 1059h207zM43 78q0 76 39.5 120t107.5 44q45 0 73 -27.5t28 -81.5q0 -68 -39 -115t-105 -47q-49 0 -76.5 28t-27.5 79z" />
+<glyph unicode="&#x22;" horiz-adv-x="791" d="M485 1462l-153 -528h-107l72 528h188zM834 1462l-154 -528h-107l72 528h189z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M1036 899l-98 -340h285l-13 -129h-309l-125 -430h-139l129 430h-303l-127 -430h-133l121 430h-261l13 129h284l101 340h-277l13 127h301l123 436h139l-125 -436h305l127 436h133l-125 -436h264l-12 -127h-291zM500 559h303l96 340h-303z" />
+<glyph unicode="$" d="M942 492q0 -162 -112.5 -263t-309.5 -123l-49 -225h-133l49 223q-195 14 -315 72v154q82 -41 175.5 -63.5t166.5 -22.5l98 452q-139 49 -201.5 123.5t-62.5 188.5q0 159 108 255t299 113l39 176h133l-39 -178q159 -12 283 -76l-63 -135q-121 63 -248 72l-94 -440 q149 -55 212.5 -125t63.5 -178zM549 250q107 13 170 75t63 154q0 54 -33 96t-114 74zM627 1235q-108 -11 -167 -69t-59 -156q0 -53 34.5 -97.5t107.5 -70.5z" />
+<glyph unicode="%" horiz-adv-x="1624" d="M1468 1462l-1085 -1462h-152l1086 1462h151zM1284 772q-67 0 -119.5 -64.5t-84 -188.5t-31.5 -240q0 -173 106 -173q65 0 117 65t86.5 198.5t34.5 236.5q0 166 -109 166zM1532 621q0 -107 -31.5 -236t-82 -217.5t-121 -138t-156.5 -49.5q-110 0 -171 74.5t-61 219.5 q0 166 50.5 318.5t136.5 228.5t200 76q116 0 176 -71.5t60 -204.5zM543 1358q-66 0 -119 -63t-85 -187.5t-32 -243.5q0 -172 107 -172q52 0 94 39.5t73.5 114t50.5 175t19 171.5q0 166 -108 166zM791 1206q0 -108 -32 -237.5t-82.5 -217.5t-120.5 -137t-157 -49 q-109 0 -170 75t-61 220q0 166 50.5 318.5t136.5 228.5t200 76q116 0 176 -72t60 -205z" />
+<glyph unicode="&#x26;" horiz-adv-x="1372" d="M737 1348q-105 0 -163 -60t-58 -170q0 -120 82 -235q139 71 191 110t83 85t31 104q0 77 -42.5 121.5t-123.5 44.5zM471 119q87 0 168 33t195 124l-306 433q-128 -67 -184 -116t-85.5 -107.5t-29.5 -131.5q0 -106 66.5 -170.5t175.5 -64.5zM66 342q0 148 90 257.5 t303 211.5q-103 165 -103 309q0 164 106 264.5t281 100.5q149 0 236.5 -79t87.5 -212q0 -78 -32.5 -137t-87.5 -108t-127.5 -90t-153.5 -83l278 -389q127 110 199 295h168q-101 -236 -283 -412l203 -270h-201l-117 166q-120 -100 -230 -143t-247 -43q-168 0 -269 96 t-101 266z" />
+<glyph unicode="'" horiz-adv-x="444" d="M485 1462l-153 -528h-107l72 528h188z" />
+<glyph unicode="(" horiz-adv-x="584" d="M82 272q0 339 120 627t384 563h157q-246 -270 -371.5 -570t-125.5 -618q0 -339 114 -598h-131q-147 266 -147 596z" />
+<glyph unicode=")" horiz-adv-x="584" d="M500 864q0 -341 -121.5 -629.5t-382.5 -558.5h-156q496 551 496 1188q0 341 -113 598h131q146 -269 146 -598z" />
+<glyph unicode="*" horiz-adv-x="1130" d="M854 1528l-123 -383l422 18l-8 -157l-393 47l180 -383l-166 -52l-113 406l-258 -344l-116 121l309 284l-373 109l55 154l371 -185l41 400z" />
+<glyph unicode="+" d="M516 651h-389v142h389v391h141v-391h390v-142h-390v-387h-141v387z" />
+<glyph unicode="," horiz-adv-x="492" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187z" />
+<glyph unicode="-" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="." horiz-adv-x="518" d="M43 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="/" horiz-adv-x="717" d="M893 1462l-813 -1462h-174l813 1462h174z" />
+<glyph unicode="0" d="M1092 1014q0 -295 -78.5 -539t-214 -369.5t-314.5 -125.5q-176 0 -270 127.5t-94 369.5q0 270 82 514.5t216.5 369t307.5 124.5q365 0 365 -471zM717 1341q-113 0 -209 -115.5t-155.5 -323t-59.5 -423.5q0 -172 50 -264t161 -92q115 0 209 114t150.5 328t56.5 453 q0 323 -203 323z" />
+<glyph unicode="1" d="M588 0h-172l196 913q59 261 88 359q-50 -53 -139 -111l-178 -110l-80 127l449 284h149z" />
+<glyph unicode="2" d="M911 0h-899l31 147l465 420q102 93 176.5 163.5t123 133t72 124t23.5 136.5q0 99 -60 157t-163 58q-77 0 -150.5 -28.5t-162.5 -96.5l-82 115q191 154 413 154q176 0 278.5 -88.5t102.5 -243.5q0 -111 -39.5 -204t-131 -197t-294.5 -281l-352 -307v-8h678z" />
+<glyph unicode="3" d="M1073 1159q0 -156 -101 -264.5t-280 -140.5v-9q124 -23 195 -106.5t71 -208.5q0 -133 -62 -234.5t-181 -158.5t-283 -57q-210 0 -385 79v164q94 -49 199 -75.5t190 -26.5q162 0 252 79.5t90 217.5q0 131 -79 198.5t-220 67.5h-131l31 143h139q165 0 274 87t109 227 q0 92 -58 146t-157 54q-80 0 -157 -27t-175 -93l-80 118q195 144 424 144q179 0 277 -87t98 -237z" />
+<glyph unicode="4" d="M1067 334h-233l-72 -334h-164l74 334h-656l29 158l834 978h196l-207 -983h232zM705 487q46 220 78 373t116 445h-8q-17 -29 -66.5 -96.5t-72.5 -96.5l-533 -625h486z" />
+<glyph unicode="5" d="M598 893q182 0 289.5 -104.5t107.5 -282.5q0 -161 -73 -283t-204 -182.5t-308 -60.5q-193 0 -330 79v164q164 -102 334 -102q191 0 298 96t107 268q0 126 -73.5 199.5t-204.5 73.5q-48 0 -97 -6.5t-139 -30.5l-74 57l197 684h668l-33 -153h-522l-127 -439q87 23 184 23z " />
+<glyph unicode="6" d="M133 424q0 209 60.5 415t163.5 351.5t246 219t327 73.5q111 0 184 -23l-35 -145q-68 22 -170 22q-212 0 -356.5 -149t-212.5 -443h8q59 79 146.5 126t193.5 47q154 0 244 -98.5t90 -270.5q0 -161 -66.5 -294.5t-180.5 -204t-261 -70.5q-182 0 -281.5 115t-99.5 329z M532 121q94 0 167.5 54t114 149t40.5 208q0 248 -221 248q-66 0 -128 -28.5t-110 -76t-72 -104.5t-24 -155q0 -137 60.5 -216t172.5 -79z" />
+<glyph unicode="7" d="M174 0l768 1313h-719l31 149h891l-27 -139l-764 -1323h-180z" />
+<glyph unicode="8" d="M741 1485q174 0 271.5 -86.5t97.5 -235.5q0 -129 -78 -225t-266 -176q127 -78 180 -165t53 -202q0 -122 -60 -217.5t-172.5 -146.5t-264.5 -51q-190 0 -298 98.5t-108 267.5q0 148 95 256t296 184q-95 69 -135.5 144.5t-40.5 171.5q0 111 54.5 198.5t153.5 136t222 48.5z M608 700q-185 -60 -261.5 -143.5t-76.5 -202.5q0 -107 69 -170t181 -63q139 0 222 74t83 196q0 99 -52 174t-165 135zM729 1341q-114 0 -182 -65.5t-68 -175.5q0 -82 39 -144t127 -116q161 60 228 131.5t67 173.5q0 90 -57.5 143t-153.5 53z" />
+<glyph unicode="9" d="M1067 1034q0 -194 -56 -406.5t-147.5 -360t-221.5 -217.5t-302 -70q-136 0 -242 34v158q134 -47 246 -47q202 0 327 141t189 441h-10q-51 -75 -132.5 -118.5t-180.5 -43.5q-169 0 -261 98.5t-92 288.5q0 153 64.5 280.5t180 199t259.5 71.5q180 0 279.5 -114.5 t99.5 -334.5zM682 1341q-150 0 -241 -113t-91 -290q0 -124 54.5 -190t162.5 -66q76 0 140 28.5t108.5 81.5t65 114t20.5 151q0 131 -59 207.5t-160 76.5z" />
+<glyph unicode=":" horiz-adv-x="518" d="M43 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77zM203 956q0 77 40 122.5t111 45.5q97 0 97 -104q0 -73 -41.5 -119.5t-106.5 -46.5q-46 0 -73 26.5t-27 75.5z" />
+<glyph unicode=";" horiz-adv-x="518" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187zM203 956q0 77 40 122.5t111 45.5q97 0 97 -104q0 -73 -41.5 -119.5t-106.5 -46.5q-46 0 -73 26.5t-27 75.5z" />
+<glyph unicode="&#x3c;" d="M1040 242l-919 422v98l919 479v-149l-747 -371l747 -328v-151z" />
+<glyph unicode="=" d="M127 858v139h920v-139h-920zM127 444v142h920v-142h-920z" />
+<glyph unicode="&#x3e;" d="M121 393l745 328l-745 371v149l919 -479v-98l-919 -422v151z" />
+<glyph unicode="?" horiz-adv-x="874" d="M260 403q22 130 72.5 213.5t165.5 174.5q128 100 168 144t63 94t23 112q0 93 -51.5 143.5t-147.5 50.5q-81 0 -155 -25.5t-140 -56.5l-61 129q92 51 192 76t182 25q167 0 259 -84t92 -238q0 -123 -65.5 -226.5t-225.5 -223.5q-125 -91 -169 -147.5t-67 -160.5h-135z M158 74q0 77 40 122.5t111 45.5q44 0 70.5 -26t26.5 -79q0 -73 -41.5 -119.5t-106.5 -46.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="@" horiz-adv-x="1735" d="M1679 852q0 -179 -55 -324t-155 -227t-222 -82q-197 0 -213 184h-8q-111 -184 -291 -184q-115 0 -180.5 75.5t-65.5 209.5q0 157 68 284t188.5 199t260.5 72q65 0 127.5 -12t150.5 -48q-64 -242 -98 -368t-31 -172q0 -117 102 -117q78 0 141.5 67t100.5 183.5t37 243.5 q0 239 -128 367t-370 128q-228 0 -406.5 -107t-277 -295.5t-98.5 -416.5q0 -270 143.5 -418.5t409.5 -148.5q197 0 420 86v-127q-219 -90 -443 -90q-314 0 -494.5 184.5t-180.5 505.5q0 261 126.5 485.5t343.5 347.5t486 123q191 0 329 -75.5t210.5 -213.5t72.5 -319z M985 938q-94 0 -174 -55t-126 -153t-46 -212q0 -93 33 -134.5t98 -41.5q187 0 272 315l70 258q-63 23 -127 23z" />
+<glyph unicode="A" horiz-adv-x="1137" d="M813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394z" />
+<glyph unicode="B" horiz-adv-x="1225" d="M770 1462q432 0 432 -336q0 -141 -87 -238t-245 -126v-10q115 -32 176.5 -110.5t61.5 -188.5q0 -212 -152 -332.5t-407 -120.5h-463l309 1462h375zM434 836h248q156 0 249 73t93 199q0 104 -66.5 155.5t-209.5 51.5h-211zM287 145h266q181 0 278 80.5t97 227.5 q0 116 -74.5 177.5t-214.5 61.5h-236z" />
+<glyph unicode="C" horiz-adv-x="1198" d="M942 1331q-174 0 -311.5 -97t-218 -284.5t-80.5 -408.5q0 -187 97.5 -298.5t268.5 -111.5q139 0 322 57v-149q-86 -31 -164 -45t-188 -14q-242 0 -380 149.5t-138 407.5q0 261 105.5 485.5t283.5 342.5t403 118q197 0 348 -80l-69 -141q-138 69 -279 69z" />
+<glyph unicode="D" horiz-adv-x="1364" d="M1300 877q0 -261 -105 -461t-300 -308t-457 -108h-352l309 1462h342q276 0 419.5 -149.5t143.5 -435.5zM449 147q202 0 355 91.5t234.5 258.5t81.5 382t-103 325.5t-302 110.5h-178l-250 -1168h162z" />
+<glyph unicode="E" horiz-adv-x="1047" d="M821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565z" />
+<glyph unicode="F" horiz-adv-x="967" d="M258 0h-172l309 1462h735l-30 -153h-568l-110 -533h528l-32 -153h-529z" />
+<glyph unicode="G" horiz-adv-x="1386" d="M821 766h459l-154 -711q-216 -75 -419 -75q-264 0 -410.5 144.5t-146.5 403.5q0 269 101.5 489.5t281.5 343t399 122.5q117 0 219.5 -20t206.5 -64l-66 -152q-77 34 -165.5 59t-194.5 25q-169 0 -307.5 -101.5t-215.5 -283.5t-77 -407q0 -190 102.5 -299t286.5 -109 q154 0 260 39l96 444h-289z" />
+<glyph unicode="H" horiz-adv-x="1389" d="M1085 0h-167l143 688h-660l-145 -688h-170l309 1462h170l-131 -622h660l133 622h168z" />
+<glyph unicode="I" horiz-adv-x="559" d="M86 0l311 1462h168l-311 -1462h-168z" />
+<glyph unicode="J" horiz-adv-x="547" d="M-166 -385q-105 0 -153 25l6 147q69 -20 145 -20q100 0 165.5 62.5t90.5 182.5l307 1450h170l-309 -1468q-79 -379 -422 -379z" />
+<glyph unicode="K" horiz-adv-x="1141" d="M1034 0h-186q-72 181 -146.5 359.5t-146.5 361.5l-174 -131l-125 -590h-170l309 1462h170l-151 -710l700 710h209l-639 -637z" />
+<glyph unicode="L" horiz-adv-x="971" d="M86 0l309 1462h170l-276 -1308h565l-33 -154h-735z" />
+<glyph unicode="M" horiz-adv-x="1714" d="M676 0l-166 1296h-8q-7 -72 -28.5 -197.5t-37.5 -199.5l-190 -899h-162l309 1462h244l149 -1204h9l659 1204h266l-303 -1462h-174q126 590 193 905.5t94 392.5h-6l-717 -1298h-131z" />
+<glyph unicode="N" horiz-adv-x="1438" d="M1139 0h-181l-460 1223h-6q-32 -221 -74 -418l-172 -805h-162l309 1462h180l459 -1220h6q30 224 72 405l174 815h164z" />
+<glyph unicode="O" horiz-adv-x="1475" d="M1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5t70 403 q0 199 -94 310.5t-261 111.5z" />
+<glyph unicode="P" horiz-adv-x="1159" d="M1159 1085q0 -248 -164 -379t-481 -131h-135l-123 -575h-170l309 1462h330q214 0 324 -94.5t110 -282.5zM410 721h133q216 0 328 91t112 267q0 125 -69.5 180.5t-213.5 55.5h-163z" />
+<glyph unicode="Q" horiz-adv-x="1475" d="M874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q158 0 279 100t187.5 280.5t66.5 399.5q0 199 -94 310.5t-261 111.5zM725 -18l-17 -2h-16q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424 q0 -333 -139 -576t-375 -321l274 -358h-219z" />
+<glyph unicode="R" horiz-adv-x="1165" d="M385 608l-129 -608h-170l309 1462h320q446 0 446 -366q0 -348 -368 -449l239 -647h-186l-209 608h-252zM532 1313q-102 -494 -116 -559h168q193 0 297 85t104 244q0 121 -67.5 175.5t-219.5 54.5h-166z" />
+<glyph unicode="S" horiz-adv-x="1028" d="M913 424q0 -211 -140.5 -327.5t-395.5 -116.5q-106 0 -186.5 14.5t-151.5 48.5v170q162 -84 340 -84q162 0 257 75.5t95 207.5q0 78 -52.5 137.5t-195.5 140.5q-151 85 -209.5 170t-58.5 201q0 187 132 304.5t347 117.5q99 0 184.5 -19t180.5 -65l-66 -150 q-66 38 -148 60t-151 22q-134 0 -215.5 -69.5t-81.5 -188.5q0 -54 17 -92.5t54 -72.5t142 -95q147 -88 198.5 -138t78 -110.5t26.5 -140.5z" />
+<glyph unicode="T" horiz-adv-x="1020" d="M487 0h-172l277 1311h-406l33 151h985l-30 -151h-408z" />
+<glyph unicode="U" horiz-adv-x="1384" d="M1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170z" />
+<glyph unicode="V" horiz-adv-x="1122" d="M479 197q61 144 162 338l479 927h191l-781 -1462h-180l-162 1462h170l97 -930q20 -196 20 -335h4z" />
+<glyph unicode="W" horiz-adv-x="1745" d="M1257 0h-170l-49 965q-8 136 -8 282h-6q-25 -72 -61 -154.5t-504 -1092.5h-174l-62 1462h170l31 -901l2 -88q0 -98 -10 -258h6q89 243 156 383l405 864h178l43 -860q9 -153 9 -304l-1 -83h9q75 224 131 354l387 893h182z" />
+<glyph unicode="X" horiz-adv-x="1063" d="M956 0h-180l-213 641l-481 -641h-186l596 776l-263 686h172l203 -563l443 563h186l-555 -694z" />
+<glyph unicode="Y" horiz-adv-x="1030" d="M537 715l489 747h193l-627 -921l-113 -541h-172l119 549l-238 913h170z" />
+<glyph unicode="Z" horiz-adv-x="1087" d="M885 0h-901l28 137l924 1170h-655l32 155h858l-26 -139l-924 -1169h697z" />
+<glyph unicode="[" horiz-adv-x="586" d="M371 -324h-387l381 1786h387l-31 -141h-227l-318 -1503h227z" />
+<glyph unicode="\" horiz-adv-x="717" d="M375 1462l217 -1462h-154l-217 1462h154z" />
+<glyph unicode="]" horiz-adv-x="586" d="M-119 -182h225l320 1503h-227l30 141h389l-380 -1786h-388z" />
+<glyph unicode="^" horiz-adv-x="1059" d="M53 553l598 920h109l266 -920h-145l-201 747l-467 -747h-160z" />
+<glyph unicode="_" horiz-adv-x="807" d="M623 -324h-811l30 140h811z" />
+<glyph unicode="`" horiz-adv-x="1135" d="M903 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="a" horiz-adv-x="1157" d="M639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233t-51 -310 q0 -114 47 -170.5t132 -56.5z" />
+<glyph unicode="b" horiz-adv-x="1182" d="M545 -20q-97 0 -170.5 51t-110.5 139h-10l-70 -170h-125l330 1556h168q-51 -242 -78.5 -370.5t-75.5 -300.5h9q93 118 183.5 173.5t186.5 55.5q141 0 220 -99t79 -272q0 -209 -68.5 -386.5t-191 -277t-276.5 -99.5zM731 975q-96 0 -195.5 -95t-158 -239t-58.5 -295 q0 -110 55.5 -168.5t160.5 -58.5q99 0 184.5 81t137.5 230.5t52 317.5q0 227 -178 227z" />
+<glyph unicode="c" horiz-adv-x="922" d="M506 -20q-194 0 -301 107t-107 302q0 200 74 369t204.5 263.5t293.5 94.5q137 0 268 -51l-47 -141q-120 51 -219 51q-112 0 -204.5 -76.5t-145 -213t-52.5 -296.5q0 -128 66.5 -199t183.5 -71q72 0 136 20t126 47v-143q-124 -63 -276 -63z" />
+<glyph unicode="d" horiz-adv-x="1182" d="M639 1114q194 0 281 -190h10q17 155 45 274l78 358h166l-330 -1556h-139l22 209h-8q-101 -125 -189 -177t-182 -52q-139 0 -217 98t-78 272q0 214 72 392t194.5 275t274.5 97zM449 119q94 0 194 93.5t158.5 239t58.5 296.5q0 111 -54 169t-157 58q-101 0 -187.5 -82.5 t-139 -232t-52.5 -314.5q0 -227 179 -227z" />
+<glyph unicode="e" horiz-adv-x="1010" d="M492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35z" />
+<glyph unicode="f" horiz-adv-x="641" d="M-104 -492q-69 0 -125 21v141q64 -22 112 -22q76 0 117 62t66 177l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h238l-25 -127h-237l-232 -1098 q-39 -189 -120 -276t-213 -87z" />
+<glyph unicode="g" horiz-adv-x="1026" d="M1100 1096l-25 -107l-211 -24q41 -62 41 -158q0 -191 -116.5 -304.5t-311.5 -113.5q-55 0 -84 8q-139 -53 -139 -131q0 -41 33 -54.5t96 -21.5l117 -14q181 -22 262.5 -88t81.5 -194q0 -184 -146 -285t-411 -101q-194 0 -304 73.5t-110 207.5q0 105 72 182t233 131 q-78 41 -78 121q0 69 51 118.5t142 92.5q-63 32 -103 94.5t-40 145.5q0 194 119.5 318t305.5 124q78 0 154 -20h371zM35 -195q0 -77 65 -122t193 -45q182 0 284.5 63.5t102.5 179.5q0 62 -54 98t-184 50l-159 16q-120 -25 -184 -88t-64 -152zM313 680q0 -85 45 -129.5 t125 -44.5q79 0 138 42t90.5 115.5t31.5 159.5q0 82 -44 125t-126 43q-78 0 -136.5 -40.5t-91 -113t-32.5 -157.5z" />
+<glyph unicode="h" horiz-adv-x="1182" d="M729 0l148 692q18 94 18 135q0 148 -147 148q-89 0 -173.5 -59t-149 -171.5t-97.5 -271.5l-101 -473h-168l330 1556h168q-18 -82 -34.5 -159t-34 -156.5t-38 -166.5t-47.5 -189h11q94 123 185.5 176t191.5 53q131 0 202.5 -72t71.5 -204q0 -62 -23 -166 q-39 -193 -145 -672h-168z" />
+<glyph unicode="i" horiz-adv-x="520" d="M227 0h-168l234 1096h168zM340 1376q0 56 32 91.5t83 35.5q88 0 88 -90q0 -55 -33.5 -93t-77.5 -38q-40 0 -66 24.5t-26 69.5z" />
+<glyph unicode="j" horiz-adv-x="520" d="M-135 -492q-69 0 -123 21v141q61 -22 119 -22q125 0 168 205l264 1243h166l-266 -1258q-36 -171 -114.5 -250.5t-213.5 -79.5zM340 1376q0 56 32 91.5t83 35.5q86 0 86 -90q0 -55 -33.5 -93t-77.5 -38q-38 0 -64 24.5t-26 69.5z" />
+<glyph unicode="k" horiz-adv-x="999" d="M330 559l526 537h201l-469 -467l295 -629h-187l-235 524l-152 -123l-82 -401h-170l330 1556h170l-129 -602t-102 -395h4z" />
+<glyph unicode="l" horiz-adv-x="520" d="M225 0h-168l332 1556h168z" />
+<glyph unicode="m" horiz-adv-x="1786" d="M696 0l148 692q18 94 18 135q0 70 -31 109t-106 39q-84 0 -163.5 -60t-140 -171.5t-93.5 -268.5l-101 -475h-168l234 1096h139l-22 -203h10q87 119 173.5 171t178.5 52q113 0 174 -65t72 -181h8q86 125 183 185.5t196 60.5q127 0 196.5 -68t69.5 -198q0 -68 -22 -178 l-144 -672h-170l148 692q20 104 20 146q0 62 -34.5 99.5t-108.5 37.5q-81 0 -160 -58t-138.5 -164.5t-90.5 -252.5l-107 -500h-168z" />
+<glyph unicode="n" horiz-adv-x="1182" d="M729 0l148 692q20 104 20 144q0 63 -35.5 101t-113.5 38q-89 0 -173.5 -60t-149 -171t-97.5 -269l-101 -475h-168l234 1096h139l-22 -203h10q96 122 185.5 172.5t185.5 50.5q127 0 200.5 -69.5t73.5 -194.5q0 -79 -23 -180l-143 -672h-170z" />
+<glyph unicode="o" horiz-adv-x="1149" d="M643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5z" />
+<glyph unicode="p" horiz-adv-x="1182" d="M545 -20q-97 0 -170 50t-113 140h-10l-4 -38q-3 -25 -10.5 -70t-114.5 -554h-166l336 1588h139l-26 -209h8q179 227 372 227q137 0 216 -97.5t79 -273.5q0 -212 -69 -389t-191 -275.5t-276 -98.5zM731 975q-96 0 -195.5 -95t-158 -239t-58.5 -295q0 -110 55.5 -168.5 t160.5 -58.5q99 0 184.5 81t137.5 230.5t52 317.5q0 227 -178 227z" />
+<glyph unicode="q" horiz-adv-x="1182" d="M641 1116q94 0 165.5 -50.5t108.5 -141.5h13l67 172h125l-336 -1588h-166l101 480q9 45 57 221h-8q-95 -121 -185 -175t-186 -54q-140 0 -219.5 97.5t-79.5 272.5q0 212 72.5 392t196 277t274.5 97zM449 119q92 0 190 92t158.5 237t60.5 300q0 105 -54.5 166t-152.5 61 q-101 0 -189 -84.5t-140 -233t-52 -311.5q0 -227 179 -227z" />
+<glyph unicode="r" horiz-adv-x="811" d="M752 1116q69 0 120 -14l-36 -150q-53 13 -105 13q-91 0 -170.5 -60t-139 -166.5t-87.5 -236.5l-107 -502h-168l234 1096h139l-22 -203h10q72 95 119 136.5t98.5 64t114.5 22.5z" />
+<glyph unicode="s" horiz-adv-x="877" d="M735 311q0 -156 -110.5 -243.5t-311.5 -87.5q-169 0 -305 69v158q70 -42 151 -65t150 -23q126 0 190 50t64 128q0 57 -35 96t-151 107q-130 73 -184 143t-54 166q0 138 101 222.5t266 84.5q171 0 330 -74l-54 -137l-56 25q-101 43 -220 43q-93 0 -146 -43.5t-53 -112.5 q0 -56 35.5 -96t146.5 -103q107 -60 153.5 -103t69.5 -92.5t23 -111.5z" />
+<glyph unicode="t" horiz-adv-x="664" d="M395 117q55 0 144 26v-129q-34 -14 -84 -24t-80 -10q-125 0 -191.5 59.5t-66.5 177.5q0 66 18 150l127 602h-172l14 73l185 78l125 228h98l-55 -252h274l-26 -127h-273l-129 -604q-18 -87 -18 -132q0 -56 29 -86t81 -30z" />
+<glyph unicode="u" horiz-adv-x="1182" d="M451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170z" />
+<glyph unicode="v" horiz-adv-x="946" d="M223 0l-125 1096h168l64 -613q24 -258 24 -362h6q127 275 179 371l325 604h178l-591 -1096h-228z" />
+<glyph unicode="w" horiz-adv-x="1468" d="M831 0l-32 602q-4 94 -4 172v156h-9l-50 -118l-83 -189l-291 -623h-202l-43 1096h164l18 -594v-88q0 -147 -8 -269h6q47 124 137 322l295 629h182l37 -594q6 -168 6 -262v-53l-2 -42h6q28 86 83 218.5t323 732.5h178l-506 -1096h-205z" />
+<glyph unicode="x" horiz-adv-x="979" d="M467 434l-346 -434h-195l475 565l-239 531h170l174 -412l330 412h194l-455 -539l252 -557h-168z" />
+<glyph unicode="y" horiz-adv-x="946" d="M98 1096h168l74 -545q10 -69 19.5 -203.5t9.5 -216.5h6q35 87 87 200t77 156l325 609h178l-696 -1282q-93 -172 -184 -239t-219 -67q-72 0 -140 21v135q63 -18 131 -18q82 0 140.5 50.5t113.5 149.5l76 136z" />
+<glyph unicode="z" horiz-adv-x="909" d="M690 0h-719l23 117l694 854h-479l27 125h657l-29 -140l-680 -831h531z" />
+<glyph unicode="{" horiz-adv-x="715" d="M442 -324q-141 0 -216.5 52.5t-75.5 171.5q0 52 20 141q33 146 51.5 227.5t14.5 102.5q0 143 -209 143l32 143q118 0 189.5 43.5t93.5 147.5l68 326q34 160 117.5 224t254.5 64h33l-31 -141q-105 0 -151 -36.5t-66 -123.5l-71 -321q-28 -123 -91 -184t-167 -78v-5 q151 -41 151 -213q0 -59 -18 -131l-47 -211q-15 -58 -15 -98q0 -53 36.5 -77.5t119.5 -24.5v-142h-23z" />
+<glyph unicode="|" d="M541 1556h139v-2052h-139v2052z" />
+<glyph unicode="}" horiz-adv-x="715" d="M285 1462q144 0 220.5 -52.5t76.5 -170.5q0 -48 -21 -141l-49 -219q-16 -68 -16 -111q0 -143 209 -143l-33 -144q-119 0 -190 -43t-93 -147l-67 -326q-36 -164 -119 -226.5t-264 -62.5h-13v142q115 0 167 36t71 123l72 322q25 117 88 179.5t170 80.5v6q-150 42 -150 211 q0 59 18 131l50 213q14 65 14 99q0 53 -40.5 77.5t-139.5 24.5l28 141h11z" />
+<glyph unicode="~" d="M348 713q-54 0 -118.5 -34.5t-114.5 -86.5v151q98 109 243 109q69 0 127 -14.5t144 -51.5q64 -27 112.5 -41t98.5 -14q55 0 119.5 33t115.5 88v-150q-100 -110 -244 -110q-72 0 -135 16.5t-135 48.5q-75 32 -120 44t-93 12z" />
+<glyph unicode="&#xa1;" horiz-adv-x="530" d="M260 684h109l-176 -1057h-207zM250 950q0 76 40.5 122t110.5 46q44 0 70.5 -26t26.5 -80q0 -71 -40.5 -117.5t-105.5 -46.5q-48 0 -75 25.5t-27 76.5z" />
+<glyph unicode="&#xa2;" d="M582 -20h-125l43 215q-132 34 -203.5 137.5t-71.5 257.5q0 185 63.5 344t178.5 258.5t260 120.5l35 170h123l-37 -168q119 -9 217 -49l-47 -142q-109 52 -219 52q-112 0 -204.5 -76.5t-145 -213t-52.5 -296.5q0 -125 66 -198t184 -73q72 0 136 20t126 48v-143 q-123 -62 -286 -66z" />
+<glyph unicode="&#xa3;" d="M842 1481q184 0 336 -86l-66 -133q-146 79 -278 79q-213 0 -263 -237l-69 -326h370l-26 -127h-371l-47 -219q-22 -98 -66 -166.5t-124 -111.5h725l-33 -154h-953l27 141q205 46 258 289l47 221h-200l26 127h201l76 350q75 353 430 353z" />
+<glyph unicode="&#xa4;" d="M229 723q0 117 68 215l-129 129l92 92l127 -129q103 70 217 70t215 -70l129 129l92 -90l-129 -129q70 -104 70 -217q0 -119 -70 -217l127 -127l-90 -90l-129 127q-98 -68 -215 -68q-119 0 -217 70l-127 -127l-90 90l127 127q-68 96 -68 215zM358 723q0 -103 71.5 -174.5 t174.5 -71.5q104 0 177 71.5t73 174.5q0 104 -73 177t-177 73q-102 0 -174 -72.5t-72 -177.5z" />
+<glyph unicode="&#xa5;" d="M582 715l491 747h187l-533 -770h231l-28 -133h-297l-33 -160h297l-29 -133h-295l-57 -266h-154l56 266h-291l29 133h290l33 160h-291l29 133h225l-202 770h163z" />
+<glyph unicode="&#xa6;" d="M541 1556h139v-776h-139v776zM541 281h139v-777h-139v777z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M174 770q0 201 238 307q-119 70 -119 203q0 127 103.5 206t279.5 79q189 0 321 -68l-53 -123q-148 60 -266 60q-102 0 -162.5 -40.5t-60.5 -109.5q0 -49 38 -83.5t162 -90.5q100 -44 149 -83.5t75 -89.5t26 -114q0 -97 -61 -180t-172 -139q114 -71 114 -189 q0 -152 -114 -237.5t-318 -85.5q-176 0 -295 61v148q56 -34 136.5 -56t156.5 -22q133 0 204 44.5t71 129.5q0 48 -50.5 89t-152.5 87q-138 61 -194 130.5t-56 166.5zM514 1010q-82 -26 -135 -87.5t-53 -131.5t50.5 -117t198.5 -111q80 44 127.5 107t47.5 131 q0 60 -49.5 105.5t-186.5 103.5z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1135" d="M457 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM821 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M928 1059q-125 0 -191.5 -87t-66.5 -241q0 -169 65 -249.5t193 -80.5q82 0 211 43v-122q-66 -28 -113 -38t-104 -10q-192 0 -297 119.5t-105 339.5q0 208 110 330.5t300 122.5q130 0 248 -60l-60 -120q-106 53 -190 53zM139 731q0 200 100 375t275 276t377 101 q197 0 370 -97t277 -272t104 -383q0 -204 -100.5 -376.5t-273 -273.5t-377.5 -101q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM244 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5q0 174 -87 323t-235.5 236.5t-324.5 87.5 q-174 0 -323 -87t-236.5 -235.5t-87.5 -324.5z" />
+<glyph unicode="&#xaa;" horiz-adv-x="686" d="M498 1479q114 0 153 -103h6l37 90h86l-139 -665h-92l14 117h-4q-40 -56 -90 -93t-123 -37q-77 0 -126.5 60t-49.5 166q0 127 41.5 234.5t116.5 169t170 61.5zM381 891q61 0 112.5 49t86 137.5t34.5 167.5q0 62 -28.5 96.5t-85.5 34.5q-92 0 -154.5 -103t-62.5 -243 q0 -139 98 -139z" />
+<glyph unicode="&#xab;" horiz-adv-x="958" d="M88 584l391 374l78 -81l-297 -328l172 -387l-113 -49l-231 442v29zM483 541l367 405l86 -69l-283 -365l158 -350l-113 -49l-215 397v31z" />
+<glyph unicode="&#xac;" d="M1047 793v-529h-140v387h-780v142h920z" />
+<glyph unicode="&#xad;" horiz-adv-x="639" d="M55 469zM55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M139 731q0 200 100 375t275 276t377 101q197 0 370 -97t277 -272t104 -383q0 -204 -100.5 -376.5t-273 -273.5t-377.5 -101q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM244 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5 q0 174 -87 323t-235.5 236.5t-324.5 87.5q-174 0 -323 -87t-236.5 -235.5t-87.5 -324.5zM1194 915q0 -78 -47.5 -141t-132.5 -98l227 -385h-149l-207 352h-113v-352h-127v880h229q163 0 241.5 -63t78.5 -193zM772 762h92q195 0 195 149q0 76 -47.5 107t-149.5 31h-90v-287z " />
+<glyph unicode="&#xaf;" horiz-adv-x="782" d="M1012 1556h-785l33 132h787z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M215 1171q0 128 90.5 220t220.5 92q83 0 155.5 -41.5t114.5 -114t42 -156.5q0 -128 -90.5 -218.5t-221.5 -90.5t-221 90.5t-90 218.5zM328 1171q0 -80 58 -138t140 -58q83 0 140 58.5t57 137.5q0 82 -57.5 140.5t-139.5 58.5q-80 0 -139 -58.5t-59 -140.5z" />
+<glyph unicode="&#xb1;" d="M516 643h-389v141h389v392h141v-392h390v-141h-390v-387h-141v387zM127 0v141h920v-141h-920z" />
+<glyph unicode="&#xb2;" horiz-adv-x="717" d="M657 586h-561l23 106l264 228q115 100 158.5 149.5t63.5 93t20 90.5q0 53 -31 85t-90 32q-90 0 -195 -80l-59 90q125 101 274 101q109 0 171.5 -56.5t62.5 -150.5q0 -99 -52.5 -179.5t-197.5 -205.5l-221 -187h395z" />
+<glyph unicode="&#xb3;" horiz-adv-x="717" d="M549 1036q69 -17 108 -68t39 -120q0 -132 -91 -205.5t-253 -73.5q-125 0 -233 56v127q125 -72 239 -72q205 0 205 170q0 137 -178 137h-90l22 107h95q97 0 155 41t58 112q0 60 -34.5 90.5t-93.5 30.5q-102 0 -196 -68l-55 93q109 88 268 88q114 0 178 -56t64 -151 q0 -180 -207 -234v-4z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1135" d="M532 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1194" d="M295 266q0 -147 147 -147q89 0 172 59t148.5 171t99.5 269l105 478h163l-233 -1096h-139l24 205h-12q-93 -121 -183 -173t-188 -52q-112 0 -163 96h-9q-11 -78 -22.5 -148t-83.5 -420h-164l336 1588h168l-148 -695q-18 -92 -18 -135z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1206 -260h-114v1661h-213v-1661h-115v819q-62 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h557v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="518" d="M170 587zM170 690q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M211 -276q0 -98 -81 -157t-214 -59q-41 0 -86 9v100q38 -6 68 -6q174 0 174 110q0 46 -39 67.5t-99 29.5l101 182h106l-61 -121q131 -38 131 -155z" />
+<glyph unicode="&#xb9;" horiz-adv-x="717" d="M537 1462h118l-186 -876h-135l112 526q25 103 58 225q-25 -25 -50 -46.5t-145 -100.5l-51 90z" />
+<glyph unicode="&#xba;" horiz-adv-x="688" d="M745 1219q0 -191 -88.5 -311t-240.5 -120q-113 0 -180.5 71t-67.5 196q0 117 42 215.5t117.5 153.5t174.5 55q117 0 180 -67t63 -193zM500 1376q-102 0 -160.5 -87.5t-58.5 -229.5q0 -85 38 -127.5t107 -42.5q94 0 152.5 88.5t58.5 232.5q0 166 -137 166z" />
+<glyph unicode="&#xbb;" horiz-adv-x="958" d="M872 485l-393 -370l-78 82l297 323l-172 391l113 50l233 -447v-29zM477 528l-368 -401l-86 70l282 360l-158 354l113 50l217 -402v-31z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1518" d="M123 0zM1362 1462l-1086 -1462h-153l1085 1462h154zM483 1462h118l-186 -876h-135l112 526q25 103 58 225q-25 -25 -50 -46.5t-145 -100.5l-51 90zM1327 203h-129l-43 -202h-127l43 202h-365l23 101l481 579h133l-121 -563h127zM1095 320q69 322 90 395 q-20 -36 -110 -149l-205 -246h225z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1518" d="M66 0zM427 1462h118l-186 -876h-135l112 526q25 103 58 225q-25 -25 -50 -46.5t-145 -100.5l-51 90zM1305 1462l-1086 -1462h-153l1085 1462h154zM1343 1h-561l23 106l264 228q115 100 158.5 149.5t63.5 93t20 90.5q0 53 -31 85t-90 32q-90 0 -195 -80l-59 90 q125 101 274 101q109 0 171.5 -56.5t62.5 -150.5q0 -99 -52.5 -179.5t-197.5 -205.5l-221 -187h395z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1565" d="M87 0zM517 1036q69 -17 108 -68t39 -120q0 -132 -91 -205.5t-253 -73.5q-125 0 -233 56v127q125 -72 239 -72q205 0 205 170q0 137 -178 137h-90l22 107h95q97 0 155 41t58 112q0 60 -34.5 90.5t-93.5 30.5q-102 0 -196 -68l-55 93q109 88 268 88q114 0 178 -56t64 -151 q0 -180 -207 -234v-4zM1512 1462l-1086 -1462h-153l1085 1462h154zM1477 203h-129l-43 -202h-127l43 202h-365l23 101l481 579h133l-121 -563h127zM1245 320q69 322 90 395q-20 -36 -110 -149l-205 -246h225z" />
+<glyph unicode="&#xbf;" horiz-adv-x="874" d="M657 680q-22 -130 -72 -212t-165 -175l-95 -75q-159 -127 -159 -275q0 -93 51.5 -144t147.5 -51q80 0 154 25.5t140 56.5l62 -129q-90 -48 -189 -74t-186 -26q-168 0 -259 83.5t-91 237.5q0 124 66 228t225 223q132 98 172.5 152.5t62.5 154.5h135zM760 1010 q0 -77 -40.5 -122.5t-111.5 -45.5q-43 0 -69.5 26t-26.5 78q0 71 40 118.5t107 47.5q47 0 74 -25.5t27 -76.5z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM863 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM679 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM1080 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27 z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM934 1581q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18 t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM523 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM887 1716q0 46 28 79.5 t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM991 1585q0 -99 -60 -157t-159 -58q-101 0 -160 57.5t-59 155.5q0 94 62 152.5t157 58.5q101 0 160 -57t59 -152zM887 1583 q0 53 -32 84t-83 31q-49 0 -82 -31t-33 -84q0 -54 29.5 -84.5t85.5 -30.5q51 0 83 30.5t32 84.5z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1673" d="M1448 0h-737l98 465h-438l-293 -465h-197l938 1462h938l-33 -153h-565l-100 -469h528l-28 -150h-529l-115 -538h566zM840 621l147 688h-84l-434 -688h371z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1198" d="M150 0zM942 1331q-174 0 -311.5 -97t-218 -284.5t-80.5 -408.5q0 -187 97.5 -298.5t268.5 -111.5q139 0 322 57v-149q-86 -31 -164 -45t-188 -14q-242 0 -380 149.5t-138 407.5q0 261 105.5 485.5t283.5 342.5t403 118q197 0 348 -80l-69 -141q-138 69 -279 69zM758 -276 q0 -98 -81 -157t-214 -59q-41 0 -86 9v100q38 -6 68 -6q174 0 174 110q0 46 -39 67.5t-99 29.5l101 182h106l-61 -121q131 -38 131 -155z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM898 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM657 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xca;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM1084 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM523 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM887 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34 q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xcc;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM593 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM412 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xce;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM808 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xcf;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM265 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM629 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1364" d="M1300 877q0 -261 -105 -461t-300 -308t-457 -108h-352l135 649h-149l32 150h150l141 663h342q276 0 419.5 -149.5t143.5 -435.5zM449 147q202 0 355 91.5t234.5 258.5t81.5 382t-103 325.5t-302 110.5h-178l-111 -516h330l-33 -150h-330l-106 -502h162z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1438" d="M84 0zM1139 0h-181l-460 1223h-6q-32 -221 -74 -418l-172 -805h-162l309 1462h180l459 -1220h6q30 224 72 405l174 815h164zM1102 1581q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5 t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM1007 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM821 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM1227 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM1067 1581q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM664 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM1028 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xd7;" d="M487 723l-319 321l98 99l320 -320l323 320l99 -96l-324 -324l322 -322l-97 -96l-323 320l-320 -318l-96 96z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1475" d="M1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-200 0 -332 96l-129 -160l-112 92l137 170q-106 136 -106 371q0 264 96 482t263.5 336t377.5 118q99 0 178.5 -27t151.5 -84l131 166l114 -92l-149 -184q48 -62 73 -156t25 -201zM874 1333q-157 0 -281 -101 t-192.5 -281t-68.5 -398q0 -135 41 -227l737 919q-90 88 -236 88zM1229 911q0 118 -33 205l-733 -911q91 -74 233 -74q152 0 272.5 97.5t190.5 279.5t70 403z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM991 1579h-104q-61 61 -128.5 154 t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM823 1606q56 60 125.5 151.5t106.5 149.5 h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM1217 1579h-103q-57 48 -161 189 q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM643 1716q0 46 28 79.5t74 33.5 q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM1007 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1030" d="M188 0zM537 715l489 747h193l-627 -921l-113 -541h-172l119 549l-238 913h170zM616 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xde;" horiz-adv-x="1159" d="M1106 829q0 -248 -164 -379t-483 -131h-133l-70 -319h-170l309 1462h170l-53 -256h160q213 0 323.5 -95t110.5 -282zM354 465h135q215 0 328 91t113 267q0 126 -70 181t-215 55h-166z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1182" d="M-133 -492q-69 0 -123 21v143q61 -22 111 -22q65 0 107 47.5t65 157.5l280 1314q43 200 156 299t307 99q162 0 252 -71t90 -196q0 -57 -21 -106.5t-61.5 -95t-178.5 -150.5q-110 -83 -110 -151q0 -56 95 -122q47 -34 101 -87.5t79.5 -110t25.5 -123.5 q0 -175 -108.5 -274.5t-292.5 -99.5q-175 0 -268 71v160q51 -41 118.5 -66.5t129.5 -25.5q113 0 181 58t68 159q0 40 -10.5 71t-33.5 59t-89 83q-88 69 -122.5 124t-34.5 115q0 53 18.5 96t49.5 78.5t124 104.5q80 56 111 87.5t48 65t17 70.5q0 64 -52.5 100.5t-141.5 36.5 q-119 0 -186 -62.5t-95 -190.5l-274 -1303q-40 -189 -121 -276t-211 -87z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM824 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM600 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM1005 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM856 1243q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM454 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM818 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM951 1456q0 -99 -60 -157t-159 -58q-101 0 -160 57.5t-59 155.5q0 94 62 152.5t157 58.5q101 0 160 -57t59 -152zM847 1454q0 53 -32 84t-83 31q-49 0 -82 -31t-33 -84q0 -54 29.5 -84.5t85.5 -30.5q51 0 83 30.5t32 84.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1669" d="M1165 -20q-108 0 -189.5 39.5t-121.5 119.5l-31 -139h-114l26 209h-8q-109 -132 -191.5 -180.5t-177.5 -48.5q-122 0 -191 99t-69 269q0 206 70.5 385t191.5 281t263 102q82 0 145 -48.5t102 -143.5h11l67 172h109l-31 -146q123 166 332 166q119 0 192.5 -68t73.5 -184 q0 -182 -166.5 -283.5t-472.5 -101.5h-39l-4 -80q0 -131 62.5 -204.5t193.5 -73.5q55 0 116.5 16.5t178.5 67.5v-150q-164 -75 -328 -75zM412 119q95 0 188.5 91.5t153 240.5t59.5 299q0 103 -45.5 164t-122.5 61q-99 0 -187 -86.5t-138 -231.5t-50 -309q0 -114 37 -171.5 t105 -57.5zM1325 973q-117 0 -211 -94.5t-141 -260.5h14q226 0 348.5 58.5t122.5 169.5q0 61 -35 94t-98 33z" />
+<glyph unicode="&#xe7;" horiz-adv-x="922" d="M98 0zM506 -20q-194 0 -301 107t-107 302q0 200 74 369t204.5 263.5t293.5 94.5q137 0 268 -51l-47 -141q-120 51 -219 51q-112 0 -204.5 -76.5t-145 -213t-52.5 -296.5q0 -128 66.5 -199t183.5 -71q72 0 136 20t126 47v-143q-124 -63 -276 -63zM592 -276q0 -98 -81 -157 t-214 -59q-41 0 -86 9v100q38 -6 68 -6q174 0 174 110q0 46 -39 67.5t-99 29.5l101 182h106l-61 -121q131 -38 131 -155z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM777 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM585 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xea;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM966 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM413 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM777 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34 q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xec;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM492 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM324 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xee;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM708 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xef;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM161 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM525 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1165" d="M676 1343q-66 58 -146 113l95 117q118 -84 188 -154l260 146l64 -105l-240 -133q87 -115 126.5 -240.5t39.5 -269.5q0 -253 -71.5 -447t-203 -292t-311.5 -98q-182 0 -284.5 104t-102.5 289q0 160 67.5 298t187 217t267.5 79q105 0 181.5 -45.5t111.5 -124.5l6 2v17 q0 136 -36.5 240t-110.5 197l-270 -149l-56 108zM487 121q107 0 190 56t134 168t51 226q0 118 -65.5 187t-178.5 69q-109 0 -189 -57.5t-123.5 -161t-43.5 -231.5q0 -126 57.5 -191t167.5 -65z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1182" d="M59 0zM729 0l148 692q20 104 20 144q0 63 -35.5 101t-113.5 38q-89 0 -173.5 -60t-149 -171t-97.5 -269l-101 -475h-168l234 1096h139l-22 -203h10q96 122 185.5 172.5t185.5 50.5q127 0 200.5 -69.5t73.5 -194.5q0 -79 -23 -180l-143 -672h-170zM871 1243 q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM798 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM589 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM997 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM844 1243q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM433 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM797 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xf7;" d="M127 651v142h920v-142h-920zM475 373q0 121 111 121q53 0 82.5 -30.5t29.5 -90.5q0 -58 -30 -89.5t-82 -31.5t-81.5 31t-29.5 90zM475 1071q0 121 111 121q53 0 82.5 -30.5t29.5 -90.5q0 -58 -30 -89.5t-82 -31.5t-81.5 31t-29.5 90z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1149" d="M1047 705q0 -189 -69.5 -360t-191.5 -266t-276 -95q-146 0 -246 65l-98 -125l-105 82l109 135q-68 103 -68 265q0 194 73.5 361t195.5 255t272 88q146 0 252 -68l104 129l105 -79l-119 -129q62 -97 62 -258zM647 971q-108 0 -195.5 -73t-137.5 -202t-50 -280 q0 -92 17 -137l518 645q-54 47 -152 47zM885 688q0 84 -13 119l-514 -641q57 -45 158 -45q103 0 188.5 71.5t133 200.5t47.5 295z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM800 1241h-104q-61 61 -128.5 154t-95.5 153v21 h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM636 1268q56 60 125.5 151.5t106.5 149.5h190 v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM1024 1241h-103q-57 48 -161 189 q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM457 1378q0 46 28 79.5t74 33.5q78 0 78 -80 q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM821 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xfd;" horiz-adv-x="946" d="M0 0zM98 1096h168l74 -545q10 -69 19.5 -203.5t9.5 -216.5h6q35 87 87 200t77 156l325 609h178l-696 -1282q-93 -172 -184 -239t-219 -67q-72 0 -140 21v135q63 -18 131 -18q82 0 140.5 50.5t113.5 149.5l76 136zM500 1268q56 60 125.5 151.5t106.5 149.5h190v-21 q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1182" d="M545 -20q-98 0 -172 51t-113 139h-10q-8 -104 -25 -176l-102 -486h-166l432 2048h168q-95 -441 -115 -522t-39 -149h9q101 125 189 177t183 52q139 0 218 -97.5t79 -273.5q0 -212 -69 -389t-191 -275.5t-276 -98.5zM731 975q-96 0 -195.5 -95t-158 -239t-58.5 -295 q0 -110 55.5 -168.5t160.5 -58.5q99 0 184.5 81t137.5 230.5t52 317.5q0 227 -178 227z" />
+<glyph unicode="&#xff;" horiz-adv-x="946" d="M0 0zM98 1096h168l74 -545q10 -69 19.5 -203.5t9.5 -216.5h6q35 87 87 200t77 156l325 609h178l-696 -1282q-93 -172 -184 -239t-219 -67q-72 0 -140 21v135q63 -18 131 -18q82 0 140.5 50.5t113.5 149.5l76 136zM335 1378q0 46 28 79.5t74 33.5q78 0 78 -80 q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM699 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#x131;" horiz-adv-x="520" d="M227 0h-168l234 1096h168z" />
+<glyph unicode="&#x152;" horiz-adv-x="1751" d="M1524 0h-674q-78 -20 -158 -20q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q152 0 237 -23h709l-31 -153h-565l-100 -469h528l-31 -150h-528l-115 -538h565zM696 131q69 0 123 19l246 1161q-76 22 -191 22q-157 0 -281 -101t-192.5 -281t-68.5 -398 q0 -199 98 -310.5t266 -111.5z" />
+<glyph unicode="&#x153;" horiz-adv-x="1769" d="M1251 -20q-270 0 -356 225q-69 -107 -171.5 -164t-225.5 -57q-184 0 -292 114t-108 308q0 193 75 360t201 255.5t281 88.5q270 0 359 -225q75 109 177.5 170t221.5 61q139 0 217 -65.5t78 -186.5q0 -183 -164.5 -284t-468.5 -101h-41l-4 -80q0 -131 61.5 -204.5 t190.5 -73.5q75 0 145 24.5t150 59.5v-150q-162 -75 -326 -75zM649 969q-109 0 -196 -73t-135 -202t-48 -284q0 -141 62 -214t172 -73q177 0 278 160.5t101 427.5q0 124 -59.5 191t-174.5 67zM1413 973q-125 0 -220.5 -94.5t-139.5 -260.5h18q231 0 351 61t120 177 q0 48 -32 82.5t-97 34.5z" />
+<glyph unicode="&#x178;" horiz-adv-x="1030" d="M188 0zM537 715l489 747h193l-627 -921l-113 -541h-172l119 549l-238 913h170zM452 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM816 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22 t-23.5 62z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1135" d="M1014 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M989 1456q0 -99 -60 -157t-159 -58q-101 0 -160 57.5t-59 155.5q0 94 62 152.5t157 58.5q101 0 160 -57t59 -152zM885 1454q0 53 -32 84t-83 31q-49 0 -82 -31t-33 -84q0 -54 29.5 -84.5t85.5 -30.5q51 0 83 30.5t32 84.5z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1135" d="M838 1243q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#x2011;" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#x2012;" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M55 469l35 160h823l-34 -160h-824z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1966" d="M55 469l35 160h1806l-34 -160h-1807z" />
+<glyph unicode="&#x2018;" horiz-adv-x="348" d="M129 961l-6 22q98 211 270 479h127q-147 -345 -203 -501h-188z" />
+<glyph unicode="&#x2019;" horiz-adv-x="348" d="M516 1462l8 -22q-40 -91 -111 -218.5t-159 -260.5h-129q134 298 203 501h188z" />
+<glyph unicode="&#x201a;" horiz-adv-x="492" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187z" />
+<glyph unicode="&#x201c;" horiz-adv-x="719" d="M500 961l-8 22q80 181 272 479h127q-162 -379 -203 -501h-188zM129 961l-6 22q98 211 270 479h127q-147 -345 -203 -501h-188z" />
+<glyph unicode="&#x201d;" horiz-adv-x="719" d="M516 1462l8 -22q-40 -91 -111 -218.5t-159 -260.5h-129q134 298 203 501h188zM885 1462l10 -22q-94 -206 -274 -479h-127q57 126 115.5 272.5t86.5 228.5h189z" />
+<glyph unicode="&#x201e;" horiz-adv-x="858" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187zM659 238l9 -23q-95 -205 -271 -479h-129q140 316 203 502h188z" />
+<glyph unicode="&#x2022;" horiz-adv-x="774" d="M199 684q0 145 73.5 231t198.5 86q92 0 139 -49t47 -141q0 -141 -74 -230t-202 -89q-89 0 -135.5 49.5t-46.5 142.5z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1563" d="M43 0zM563 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77zM1085 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77zM43 74q0 77 40.5 122.5 t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="580" d="M88 578l391 380l78 -81l-297 -334l172 -381l-113 -49l-231 436v29z" />
+<glyph unicode="&#x203a;" horiz-adv-x="580" d="M492 496l-392 -381l-77 82l296 333l-172 381l113 50l232 -437v-28z" />
+<glyph unicode="&#x2044;" horiz-adv-x="268" d="M752 1462l-1086 -1462h-153l1085 1462h154z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="717" d="M713 788h-129l-43 -202h-127l43 202h-365l23 101l481 579h133l-121 -563h127zM481 905q69 322 90 395q-20 -36 -110 -149l-205 -246h225z" />
+<glyph unicode="&#x20ac;" d="M928 1329q-140 0 -254 -99t-189 -298h426l-26 -133h-441q-21 -65 -32 -164h381l-29 -131h-361q0 -373 297 -373q123 0 256 55v-147q-127 -59 -278 -59q-212 0 -328.5 133.5t-116.5 378.5v12h-170l27 131h154q8 80 30 164h-151l27 133h159q97 267 259.5 408t369.5 141 q89 0 160 -21.5t141 -70.5l-80 -138q-113 78 -231 78z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M438 741h-121v617h-196v104h516v-104h-199v-617zM1014 741l-189 551h-6q4 -52 4 -121v-430h-118v721h180l182 -557l193 557h170v-721h-121v430q0 73 4 121h-6l-197 -551h-96z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1095" d="M0 1095h1095v-1095h-1095v1095z" />
+<glyph horiz-adv-x="1182" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff
new file mode 100644 (file)
index 0000000..ff652e6
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot
new file mode 100644 (file)
index 0000000..1486840
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.svg b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.svg
new file mode 100644 (file)
index 0000000..11a472c
--- /dev/null
@@ -0,0 +1,1831 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sanslight" horiz-adv-x="1169" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1077" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM895 0h-99v1087h99v-1087zM782 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71 t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1077" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM895 0h-99v1556h99v-1556z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1692" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1200 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5 q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1510 0h-99v1087h99v-1087zM1397 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1692" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1200 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5 q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1510 0h-99v1556h99v-1556z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="492" d="M276 377h-61l-29 1085h119zM164 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="&#x22;" horiz-adv-x="723" d="M260 1462l-33 -528h-61l-33 528h127zM590 1462l-33 -528h-61l-33 528h127z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M967 928l-76 -398h303v-79h-320l-86 -451h-90l88 451h-360l-86 -451h-88l86 451h-283v79h299l76 398h-297v80h311l86 454h91l-89 -454h365l88 454h86l-88 -454h285v-80h-301zM440 530h363l78 398h-363z" />
+<glyph unicode="$" d="M991 440q0 -133 -99 -217t-274 -106v-236h-81v232q-92 2 -200.5 22.5t-172.5 50.5v103q75 -36 179.5 -61t193.5 -25v508q-145 44 -215 88t-102 104t-32 146q0 124 94.5 208.5t254.5 104.5v192h81v-190q197 -9 351 -72l-33 -90q-141 62 -318 72v-486q213 -66 293 -144 t80 -204zM881 444q0 85 -63 140.5t-200 95.5v-471q122 13 192.5 75t70.5 160zM297 1049q0 -86 57 -141t183 -93v453q-119 -16 -179.5 -76t-60.5 -143z" />
+<glyph unicode="%" horiz-adv-x="1653" d="M211 1026q0 -186 45 -279.5t141 -93.5q193 0 193 373q0 184 -49.5 276.5t-143.5 92.5q-96 0 -141 -92.5t-45 -276.5zM688 1026q0 -226 -75 -343.5t-216 -117.5q-133 0 -208.5 120.5t-75.5 340.5q0 223 72 340t212 117q139 0 215 -120.5t76 -336.5zM1063 438 q0 -185 45 -277.5t141 -92.5q193 0 193 370q0 369 -193 369q-96 0 -141 -91.5t-45 -277.5zM1540 438q0 -226 -74 -343.5t-215 -117.5q-136 0 -211 121.5t-75 339.5q0 225 73.5 341t212.5 116q137 0 213 -120t76 -337zM1280 1462l-811 -1462h-96l811 1462h96z" />
+<glyph unicode="&#x26;" horiz-adv-x="1460" d="M123 371q0 138 73.5 235t274.5 205l-75 82q-66 71 -98 139t-32 142q0 143 95.5 227t256.5 84q155 0 245.5 -81t90.5 -224q0 -105 -70 -192.5t-253 -194.5l452 -457q61 72 104 157t75 201h96q-63 -246 -209 -426l266 -268h-135l-193 197q-92 -90 -164 -131.5t-157.5 -63.5 t-194.5 -22q-209 0 -328.5 103t-119.5 288zM578 70q128 0 234.5 43.5t209.5 146.5l-483 485q-136 -72 -196.5 -122.5t-88 -109.5t-27.5 -138q0 -143 93 -224t258 -81zM373 1176q0 -79 40 -146t152 -174q159 85 221 159t62 169q0 94 -62 152.5t-168 58.5q-114 0 -179.5 -58 t-65.5 -161z" />
+<glyph unicode="'" horiz-adv-x="393" d="M260 1462l-33 -528h-61l-33 528h127z" />
+<glyph unicode="(" horiz-adv-x="557" d="M82 561q0 265 77.5 496t223.5 405h113q-148 -182 -227 -412.5t-79 -486.5q0 -483 304 -887h-111q-147 170 -224 397t-77 488z" />
+<glyph unicode=")" horiz-adv-x="557" d="M475 561q0 -263 -77.5 -490t-223.5 -395h-111q304 404 304 887q0 257 -79 487.5t-227 411.5h113q147 -175 224 -406.5t77 -494.5z" />
+<glyph unicode="*" horiz-adv-x="1128" d="M631 1556l-37 -405l405 104l21 -131l-395 -39l247 -340l-124 -71l-191 379l-180 -379l-125 71l242 340l-390 39l19 131l401 -104l-39 405h146z" />
+<glyph unicode="+" d="M625 764h434v-82h-434v-432h-82v432h-432v82h432v434h82v-434z" />
+<glyph unicode="," horiz-adv-x="440" d="M295 238l12 -21q-75 -265 -174 -481h-65q77 275 110 502h117z" />
+<glyph unicode="-" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="." horiz-adv-x="487" d="M162 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="/" horiz-adv-x="698" d="M674 1462l-545 -1462h-104l544 1462h105z" />
+<glyph unicode="0" d="M1055 735q0 -385 -117.5 -570t-355.5 -185q-229 0 -348 190.5t-119 564.5q0 382 115.5 566t351.5 184q231 0 352 -190.5t121 -559.5zM223 735q0 -340 89 -502.5t270 -162.5q189 0 275.5 168t86.5 497q0 324 -86.5 492t-275.5 168t-274 -168t-85 -492z" />
+<glyph unicode="1" d="M682 0h-98v1065q0 145 12 301q-15 -15 -31 -29t-309 -243l-57 71l397 297h86v-1462z" />
+<glyph unicode="2" d="M1028 0h-915v88l389 406q164 170 230 260t97 172t31 172q0 131 -86 213t-223 82q-183 0 -350 -133l-54 69q183 154 406 154q191 0 300.5 -102t109.5 -281q0 -145 -73.5 -280.5t-268.5 -334.5l-375 -385v-4h782v-96z" />
+<glyph unicode="3" d="M979 1118q0 -136 -85.5 -229t-229.5 -119v-6q176 -22 268 -112t92 -242q0 -205 -139.5 -317.5t-401.5 -112.5q-223 0 -389 83v99q84 -44 188.5 -69t196.5 -25q221 0 332 89.5t111 252.5q0 145 -113.5 223t-333.5 78h-158v96h160q182 0 288.5 86.5t106.5 234.5 q0 122 -86.5 195.5t-226.5 73.5q-109 0 -199 -30.5t-202 -104.5l-49 67q85 71 205 112.5t243 41.5q202 0 312 -95.5t110 -269.5z" />
+<glyph unicode="4" d="M1141 373h-252v-373h-94v373h-752v67l725 1030h121v-1011h252v-86zM795 459v418q0 302 14 507h-8q-20 -37 -123 -188l-516 -737h633z" />
+<glyph unicode="5" d="M537 879q234 0 368.5 -113t134.5 -311q0 -225 -140 -350t-386 -125q-109 0 -207 21.5t-164 61.5v103q108 -55 192 -76.5t179 -21.5q192 0 308 101.5t116 274.5q0 163 -113 256t-307 93q-130 0 -272 -39l-60 39l58 669h704v-96h-610l-45 -516q156 29 244 29z" />
+<glyph unicode="6" d="M131 623q0 285 77.5 479.5t220 288.5t343.5 94q94 0 172 -23v-88q-73 27 -176 27q-247 0 -384.5 -178t-154.5 -518h13q76 98 174 148t207 50q205 0 320.5 -117t115.5 -323q0 -224 -121.5 -353.5t-327.5 -129.5q-222 0 -350.5 169.5t-128.5 473.5zM610 68q164 0 255 103 t91 294q0 168 -90 262t-245 94q-102 0 -189.5 -45t-139.5 -119.5t-52 -152.5q0 -111 49.5 -213.5t134 -162.5t186.5 -60z" />
+<glyph unicode="7" d="M334 0l602 1366h-827v96h946v-73l-604 -1389h-117z" />
+<glyph unicode="8" d="M582 1487q186 0 299.5 -95t113.5 -257q0 -112 -70.5 -198t-228.5 -159q192 -79 270 -173t78 -228q0 -181 -126.5 -289t-339.5 -108q-221 0 -339 101t-118 294q0 131 83 230t257 169q-161 76 -227 160.5t-66 202.5q0 105 53 184.5t148.5 122.5t212.5 43zM223 360 q0 -138 93.5 -214t261.5 -76q164 0 264 80.5t100 218.5q0 124 -78.5 201.5t-302.5 162.5q-184 -71 -261 -157t-77 -216zM580 1397q-141 0 -226.5 -69.5t-85.5 -190.5q0 -70 31.5 -123.5t91 -97t199.5 -101.5q163 63 234 139t71 183q0 120 -84.5 190t-230.5 70z" />
+<glyph unicode="9" d="M1036 842q0 -288 -75.5 -482t-220 -287t-349.5 -93q-104 0 -192 26v86q43 -14 103.5 -21.5t92.5 -7.5q247 0 387 178.5t156 520.5h-12q-73 -96 -174 -147.5t-211 -51.5q-203 0 -316.5 112t-113.5 318q0 220 124.5 356t323.5 136q144 0 252 -75.5t166.5 -221.5t58.5 -346z M559 1397q-158 0 -252 -106.5t-94 -291.5q0 -174 87 -264t249 -90q101 0 188.5 45t139 119.5t51.5 151.5q0 117 -46.5 219t-130 159.5t-192.5 57.5z" />
+<glyph unicode=":" horiz-adv-x="487" d="M162 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98zM162 971q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode=";" horiz-adv-x="487" d="M303 238l12 -21q-75 -265 -174 -481h-65q29 97 62 245.5t48 256.5h117zM162 971q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#x3c;" d="M1059 266l-948 416v61l948 474v-95l-823 -405l823 -355v-96z" />
+<glyph unicode="=" d="M111 885v82h948v-82h-948zM111 477v82h948v-82h-948z" />
+<glyph unicode="&#x3e;" d="M111 362l823 355l-823 405v95l948 -474v-61l-948 -416v96z" />
+<glyph unicode="?" horiz-adv-x="862" d="M293 377v37q0 123 37.5 201t138.5 167l91 79q72 61 103 121t31 138q0 127 -83.5 202t-219.5 75q-79 0 -148 -17.5t-149 -56.5l-37 80q110 48 184.5 64t153.5 16q183 0 288 -98.5t105 -270.5q0 -68 -18 -119t-50.5 -94.5t-78.5 -84t-102 -87.5q-64 -54 -98.5 -98.5 t-50 -93.5t-15.5 -146v-14h-82zM260 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="@" horiz-adv-x="1815" d="M1702 725q0 -228 -90.5 -366t-245.5 -138q-89 0 -144.5 54t-64.5 147h-4q-43 -100 -124 -150.5t-189 -50.5q-148 0 -229 96.5t-81 270.5q0 202 120.5 330.5t314.5 128.5q138 0 286 -41l-22 -464v-30q0 -104 35 -156.5t116 -52.5q103 0 168.5 116.5t65.5 303.5 q0 194 -79 340t-225.5 224.5t-334.5 78.5q-230 0 -405.5 -99.5t-270 -281.5t-94.5 -418q0 -322 167 -497.5t474 -175.5q93 0 188.5 18t231.5 70v-99q-203 -80 -414 -80q-349 0 -544 200.5t-195 557.5q0 256 108.5 460.5t307 317.5t448.5 113q215 0 380.5 -89t255 -254.5 t89.5 -383.5zM633 590q0 -143 55 -215t174 -72q255 0 273 346l16 291q-79 27 -193 27q-149 0 -237 -102.5t-88 -274.5z" />
+<glyph unicode="A" horiz-adv-x="1229" d="M911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174z" />
+<glyph unicode="B" horiz-adv-x="1284" d="M207 1462h401q271 0 398 -92t127 -278q0 -127 -77.5 -211.5t-226.5 -108.5v-6q175 -26 257.5 -110.5t82.5 -235.5q0 -202 -134 -311t-380 -109h-448v1462zM309 811h322q206 0 299.5 68.5t93.5 214.5t-105.5 212t-314.5 66h-295v-561zM309 721v-631h344q406 0 406 330 q0 301 -428 301h-322z" />
+<glyph unicode="C" horiz-adv-x="1272" d="M831 1391q-275 0 -433 -176t-158 -482q0 -313 149 -486t426 -173q184 0 338 47v-90q-145 -51 -362 -51q-308 0 -485 199t-177 556q0 223 84.5 393t243 262.5t368.5 92.5q214 0 383 -80l-41 -92q-160 80 -336 80z" />
+<glyph unicode="D" horiz-adv-x="1446" d="M1317 745q0 -368 -193 -556.5t-567 -188.5h-350v1462h395q350 0 532.5 -183t182.5 -534zM1206 741q0 314 -159.5 472.5t-468.5 158.5h-269v-1282h242q655 0 655 651z" />
+<glyph unicode="E" horiz-adv-x="1130" d="M1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94z" />
+<glyph unicode="F" horiz-adv-x="1028" d="M309 0h-102v1462h801v-94h-699v-620h660v-95h-660v-653z" />
+<glyph unicode="G" horiz-adv-x="1481" d="M782 737h539v-667q-212 -90 -477 -90q-346 0 -530.5 195.5t-184.5 553.5q0 223 91.5 395.5t262 266.5t391.5 94q239 0 429 -88l-41 -92q-190 88 -394 88q-289 0 -458.5 -178.5t-169.5 -481.5q0 -330 161 -496.5t473 -166.5q202 0 343 57v514h-435v96z" />
+<glyph unicode="H" horiz-adv-x="1473" d="M1266 0h-103v719h-854v-719h-102v1462h102v-649h854v649h103v-1462z" />
+<glyph unicode="I" horiz-adv-x="516" d="M207 0v1462h102v-1462h-102z" />
+<glyph unicode="J" horiz-adv-x="506" d="M-33 -369q-92 0 -151 27v88q78 -20 149 -20q242 0 242 264v1472h102v-1462q0 -369 -342 -369z" />
+<glyph unicode="K" horiz-adv-x="1190" d="M1190 0h-125l-561 772l-195 -172v-600h-102v1462h102v-760l162 162l573 598h130l-599 -618z" />
+<glyph unicode="L" horiz-adv-x="1051" d="M207 0v1462h102v-1366h697v-96h-799z" />
+<glyph unicode="M" horiz-adv-x="1767" d="M850 0l-545 1350h-8q8 -124 8 -254v-1096h-98v1462h158l518 -1286h6l518 1286h154v-1462h-103v1108q0 116 12 240h-8l-547 -1348h-65z" />
+<glyph unicode="N" horiz-adv-x="1477" d="M1270 0h-103l-866 1298h-8q12 -232 12 -350v-948h-98v1462h102l865 -1296h6q-9 180 -9 342v954h99v-1462z" />
+<glyph unicode="O" horiz-adv-x="1565" d="M1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483z" />
+<glyph unicode="P" horiz-adv-x="1198" d="M1087 1042q0 -212 -144 -325t-408 -113h-226v-604h-102v1462h358q522 0 522 -420zM309 692h201q247 0 357 81.5t110 264.5q0 169 -104 250.5t-322 81.5h-242v-678z" />
+<glyph unicode="Q" horiz-adv-x="1565" d="M1436 733q0 -294 -126 -486.5t-349 -246.5l333 -348h-166l-282 330l-33 -2h-31q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5 t-401.5 168.5q-261 0 -402.5 -170t-141.5 -483z" />
+<glyph unicode="R" horiz-adv-x="1217" d="M309 637v-637h-102v1462h348q272 0 402 -100.5t130 -302.5q0 -147 -77.5 -248t-235.5 -145l397 -666h-122l-377 637h-363zM309 725h279q185 0 287 82.5t102 243.5q0 167 -100 243t-326 76h-242v-645z" />
+<glyph unicode="S" horiz-adv-x="1116" d="M1014 377q0 -183 -134.5 -290t-357.5 -107q-268 0 -411 59v102q158 -67 403 -67q180 0 285.5 82.5t105.5 216.5q0 83 -35 137.5t-114 99.5t-232 97q-224 77 -309.5 166.5t-85.5 238.5q0 164 128.5 267.5t330.5 103.5q206 0 387 -78l-37 -88q-182 76 -348 76 q-162 0 -258 -75t-96 -204q0 -81 29.5 -133t96.5 -93.5t230 -99.5q171 -59 257 -114.5t125.5 -126t39.5 -170.5z" />
+<glyph unicode="T" horiz-adv-x="1073" d="M588 0h-103v1366h-475v96h1053v-96h-475v-1366z" />
+<glyph unicode="U" horiz-adv-x="1473" d="M1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102z" />
+<glyph unicode="V" horiz-adv-x="1182" d="M1071 1462h111l-547 -1462h-90l-545 1462h109l368 -995q84 -225 113 -338q20 75 79 233z" />
+<glyph unicode="W" horiz-adv-x="1827" d="M1372 0h-84l-321 1128q-40 139 -60 228q-16 -87 -45.5 -200t-322.5 -1156h-86l-402 1462h107l256 -942q15 -57 28 -105.5t23.5 -91t19 -82t15.5 -79.5q24 136 102 413l250 887h113l293 -1018q51 -176 73 -284q13 72 33.5 153t308.5 1149h103z" />
+<glyph unicode="X" horiz-adv-x="1102" d="M1102 0h-117l-432 682l-440 -682h-113l492 762l-447 700h115l395 -626l401 626h109l-453 -698z" />
+<glyph unicode="Y" horiz-adv-x="1081" d="M543 662l428 800h110l-487 -897v-565h-105v557l-489 905h117z" />
+<glyph unicode="Z" horiz-adv-x="1180" d="M1098 0h-1016v76l856 1290h-817v96h954v-76l-858 -1290h881v-96z" />
+<glyph unicode="[" horiz-adv-x="653" d="M602 -324h-428v1786h428v-94h-330v-1597h330v-95z" />
+<glyph unicode="\" horiz-adv-x="698" d="M127 1462l547 -1462h-103l-546 1462h102z" />
+<glyph unicode="]" horiz-adv-x="653" d="M51 -229h330v1597h-330v94h428v-1786h-428v95z" />
+<glyph unicode="^" d="M88 561l465 912h68l460 -912h-100l-395 791l-398 -791h-100z" />
+<glyph unicode="_" horiz-adv-x="842" d="M846 -266h-850v82h850v-82z" />
+<glyph unicode="`" horiz-adv-x="1182" d="M776 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="a" horiz-adv-x="1085" d="M842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5z" />
+<glyph unicode="b" horiz-adv-x="1219" d="M641 1108q228 0 343.5 -143.5t115.5 -419.5q0 -271 -121.5 -418t-341.5 -147q-116 0 -209 48t-147 136h-9l-28 -164h-62v1556h99v-391q0 -88 -4 -162l-3 -85h7q62 98 149.5 144t210.5 46zM639 1018q-192 0 -275 -110t-83 -363v-17q0 -246 86.5 -353t269.5 -107 q178 0 268 124.5t90 354.5q0 471 -356 471z" />
+<glyph unicode="c" horiz-adv-x="973" d="M616 -20q-233 0 -365 147t-132 410q0 270 137 420.5t375 150.5q141 0 270 -49l-27 -88q-141 47 -245 47q-200 0 -303 -123.5t-103 -355.5q0 -220 103 -344.5t288 -124.5q148 0 275 53v-92q-104 -51 -273 -51z" />
+<glyph unicode="d" horiz-adv-x="1219" d="M580 1108q118 0 204 -43t154 -147h6q-6 126 -6 247v391h98v-1556h-65l-25 166h-8q-124 -186 -356 -186q-225 0 -344 140t-119 408q0 282 118 431t343 149zM580 1018q-178 0 -267.5 -125t-89.5 -363q0 -462 359 -462q184 0 270 107t86 353v17q0 252 -84.5 362.5 t-273.5 110.5z" />
+<glyph unicode="e" horiz-adv-x="1124" d="M621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5z" />
+<glyph unicode="f" horiz-adv-x="614" d="M586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86z" />
+<glyph unicode="g" horiz-adv-x="1071" d="M1030 1087v-69l-225 -14q90 -112 90 -246q0 -157 -104.5 -254.5t-280.5 -97.5q-74 0 -104 6q-59 -31 -90 -73t-31 -89q0 -52 39.5 -76t132.5 -24h190q177 0 271 -71.5t94 -211.5q0 -172 -139.5 -265.5t-397.5 -93.5q-205 0 -317.5 79t-112.5 220q0 112 69.5 186 t188.5 101q-49 21 -78.5 59.5t-29.5 88.5q0 109 139 192q-95 39 -148 122.5t-53 191.5q0 163 103.5 261.5t279.5 98.5q107 0 166 -21h348zM150 -184q0 -224 333 -224q428 0 428 273q0 98 -67 142t-217 44h-178q-299 0 -299 -235zM233 748q0 -126 76.5 -195.5t204.5 -69.5 q136 0 208.5 69t72.5 200q0 139 -74.5 208.5t-208.5 69.5q-130 0 -204.5 -74.5t-74.5 -207.5z" />
+<glyph unicode="h" horiz-adv-x="1208" d="M940 0v705q0 164 -69 238.5t-214 74.5q-195 0 -285.5 -98.5t-90.5 -319.5v-600h-99v1556h99v-495l-5 -139h7q61 98 154 142t231 44q370 0 370 -397v-711h-98z" />
+<glyph unicode="i" horiz-adv-x="463" d="M281 0h-99v1087h99v-1087zM168 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="j" horiz-adv-x="463" d="M37 -492q-80 0 -135 25v86q69 -20 129 -20q151 0 151 176v1312h99v-1298q0 -135 -63.5 -208t-180.5 -73zM168 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="k" horiz-adv-x="991" d="M279 477l555 610h120l-428 -464l465 -623h-119l-413 549l-178 -162v-387h-99v1556h99v-780l-7 -299h5z" />
+<glyph unicode="l" horiz-adv-x="463" d="M281 0h-99v1556h99v-1556z" />
+<glyph unicode="m" horiz-adv-x="1808" d="M1540 0v713q0 159 -62 232t-190 73q-167 0 -247 -92t-80 -289v-637h-101v743q0 275 -252 275q-171 0 -249 -99.5t-78 -318.5v-600h-99v1087h82l21 -149h6q45 81 128 125.5t183 44.5q257 0 330 -193h4q53 93 142.5 143t203.5 50q178 0 267 -95t89 -302v-711h-98z" />
+<glyph unicode="n" horiz-adv-x="1208" d="M940 0v705q0 164 -69 238.5t-214 74.5q-195 0 -285.5 -98.5t-90.5 -319.5v-600h-99v1087h84l19 -149h6q106 170 377 170q370 0 370 -397v-711h-98z" />
+<glyph unicode="o" horiz-adv-x="1200" d="M1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5t-97.5 -349.5z " />
+<glyph unicode="p" horiz-adv-x="1219" d="M647 -20q-251 0 -366 188h-7l3 -84q4 -74 4 -162v-414h-99v1579h84l19 -155h6q112 176 358 176q220 0 335.5 -144.5t115.5 -420.5q0 -268 -121.5 -415.5t-331.5 -147.5zM645 68q167 0 258.5 124t91.5 347q0 479 -346 479q-190 0 -279 -104.5t-89 -340.5v-32 q0 -255 85.5 -364t278.5 -109z" />
+<glyph unicode="q" horiz-adv-x="1219" d="M569 -20q-214 0 -332 142t-118 410q0 275 118 425.5t338 150.5q236 0 353 -174h6l18 153h84v-1579h-98v414q0 122 6 248h-6q-118 -190 -369 -190zM571 68q198 0 282.5 109t84.5 366v12q0 245 -85 354t-271 109q-176 0 -267.5 -124t-91.5 -364q0 -229 89.5 -345.5 t258.5 -116.5z" />
+<glyph unicode="r" horiz-adv-x="797" d="M610 1108q69 0 148 -14l-19 -95q-68 17 -141 17q-139 0 -228 -118t-89 -298v-600h-99v1087h84l10 -196h7q67 120 143 168.5t184 48.5z" />
+<glyph unicode="s" horiz-adv-x="954" d="M856 283q0 -146 -111 -224.5t-315 -78.5q-218 0 -346 67v107q164 -82 346 -82q161 0 244.5 53.5t83.5 142.5q0 82 -66.5 138t-218.5 110q-163 59 -229 101.5t-99.5 96t-33.5 130.5q0 122 102.5 193t286.5 71q176 0 334 -66l-37 -90q-160 66 -297 66q-133 0 -211 -44 t-78 -122q0 -85 60.5 -136t236.5 -114q147 -53 214 -95.5t100.5 -96.5t33.5 -127z" />
+<glyph unicode="t" horiz-adv-x="686" d="M469 68q94 0 164 16v-80q-72 -24 -166 -24q-144 0 -212.5 77t-68.5 242v702h-161v58l161 45l50 246h51v-263h319v-86h-319v-688q0 -125 44 -185t138 -60z" />
+<glyph unicode="u" horiz-adv-x="1208" d="M268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98z" />
+<glyph unicode="v" horiz-adv-x="940" d="M420 0l-420 1087h102l281 -739q56 -142 84 -248h6q41 136 84 250l281 737h102l-420 -1087h-100z" />
+<glyph unicode="w" horiz-adv-x="1481" d="M1051 0l-238 727q-23 74 -59 217h-6l-21 -74l-45 -145l-242 -725h-98l-311 1087h106l174 -630q61 -234 80 -344h6q59 234 86 311l224 663h90l213 -661q72 -235 88 -311h6q8 65 80 348l166 624h100l-295 -1087h-104z" />
+<glyph unicode="x" horiz-adv-x="1020" d="M449 559l-379 528h114l324 -458l321 458h109l-373 -528l400 -559h-115l-342 485l-344 -485h-109z" />
+<glyph unicode="y" horiz-adv-x="940" d="M0 1087h102l230 -610q105 -281 133 -379h6q42 129 137 385l230 604h102l-487 -1263q-59 -154 -99 -208t-93.5 -81t-129.5 -27q-57 0 -127 21v86q58 -16 125 -16q51 0 90 24t70.5 74.5t73 160t53.5 142.5z" />
+<glyph unicode="z" horiz-adv-x="944" d="M858 0h-776v63l645 936h-598v88h727v-63l-649 -936h651v-88z" />
+<glyph unicode="{" horiz-adv-x="723" d="M389 -27q0 -102 59.5 -152.5t202.5 -53.5v-91q-195 0 -277.5 75t-82.5 231v337q0 205 -230 209v80q122 2 176 51t54 148v350q0 299 360 305v-90q-138 -5 -200 -58t-62 -157v-305q0 -130 -44 -194t-142 -85v-8q97 -20 141.5 -83.5t44.5 -186.5v-322z" />
+<glyph unicode="|" horiz-adv-x="1108" d="M508 1561h92v-2067h-92v2067z" />
+<glyph unicode="}" horiz-adv-x="723" d="M334 295q0 123 44.5 186.5t141.5 83.5v8q-97 20 -141.5 84t-44.5 195v305q0 103 -61.5 156.5t-200.5 58.5v90q174 0 267 -77.5t93 -227.5v-350q0 -100 54.5 -148.5t175.5 -50.5v-80q-230 -4 -230 -209v-337q0 -155 -82.5 -230.5t-277.5 -75.5v91q141 2 201.5 52.5 t60.5 153.5v322z" />
+<glyph unicode="~" d="M334 745q-49 0 -108 -30.5t-115 -89.5v94q108 110 233 110q61 0 115 -13.5t155 -57.5q126 -58 220 -58q56 0 109.5 30.5t115.5 94.5v-96q-48 -49 -104.5 -81t-129.5 -32q-116 0 -270 72q-124 57 -221 57z" />
+<glyph unicode="&#xa1;" horiz-adv-x="492" d="M215 711h61l29 -1086h-119zM166 1010q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#xa2;" d="M602 190q-186 30 -288.5 175t-102.5 380q0 232 102.5 381.5t288.5 182.5v174h82v-166h14q131 0 275 -55l-31 -84q-134 51 -237 51q-187 0 -288.5 -122.5t-101.5 -358.5q0 -225 100.5 -349.5t280.5 -124.5q131 0 267 58v-92q-110 -56 -267 -56h-12v-204h-82v210z" />
+<glyph unicode="&#xa3;" d="M412 676v-256q0 -116 -35 -196t-113 -128h809v-96h-995v84q110 21 171.5 110t61.5 224v258h-211v82h211v297q0 204 98 315t281 111q175 0 330 -68l-35 -86q-157 66 -295 66q-141 0 -209.5 -81t-68.5 -253v-301h411v-82h-411z" />
+<glyph unicode="&#xa4;" d="M991 723q0 -151 -90 -256l139 -141l-59 -60l-137 142q-110 -93 -260 -93q-153 0 -260 93l-138 -142l-59 60l139 141q-90 106 -90 256q0 147 90 258l-139 141l59 60l138 -142q103 93 260 93q155 0 260 -93l137 142l59 -60l-139 -141q90 -111 90 -258zM584 395 q134 0 228.5 95.5t94.5 232.5q0 136 -95 233t-228 97q-134 0 -229 -97t-95 -233t94.5 -232t229.5 -96z" />
+<glyph unicode="&#xa5;" d="M586 666l428 796h110l-432 -788h283v-82h-338v-205h338v-82h-338v-305h-105v305h-337v82h337v205h-337v82h278l-430 788h117z" />
+<glyph unicode="&#xa6;" horiz-adv-x="1108" d="M508 1561h92v-764h-92v764zM508 258h92v-764h-92v764z" />
+<glyph unicode="&#xa7;" horiz-adv-x="1057" d="M145 813q0 83 50.5 152.5t138.5 107.5q-86 47 -125 102t-39 136q0 117 101.5 183.5t275.5 66.5q175 0 336 -64l-35 -80q-91 34 -158.5 47t-144.5 13q-134 0 -205.5 -44.5t-71.5 -119.5q0 -54 25.5 -88.5t85.5 -65.5t188 -74q192 -64 264 -132.5t72 -170.5 q0 -173 -186 -274q86 -42 129 -96t43 -136q0 -135 -113 -207.5t-311 -72.5q-92 0 -171 15t-165 52v95q182 -78 332 -78q162 0 247 49.5t85 140.5q0 55 -25 87.5t-88.5 65.5t-190.5 79q-200 73 -272 141.5t-72 169.5zM246 825q0 -65 31.5 -104t105.5 -75t250 -99 q82 41 126 98t44 121q0 62 -32 102t-108.5 77t-236.5 87q-81 -23 -130.5 -79t-49.5 -128z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1182" d="M336 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM717 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M897 1092q-142 0 -222.5 -94.5t-80.5 -264.5q0 -186 74.5 -275t220.5 -89q84 0 198 43v-88q-102 -45 -208 -45q-187 0 -288.5 115t-101.5 331q0 208 111 332.5t297 124.5q119 0 227 -52l-37 -83q-98 45 -190 45zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100 t276 -275t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM193 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89t329.5 88.5t240.5 240.5t89 330q0 174 -85.5 325t-239 243t-334.5 92q-176 0 -328.5 -88.5t-241.5 -242.5t-89 -329z " />
+<glyph unicode="&#xaa;" horiz-adv-x="686" d="M512 813l-25 72q-84 -84 -202 -84q-95 0 -151 49t-56 139q0 100 80 151.5t241 59.5l95 4v43q0 77 -38 114.5t-106 37.5q-87 0 -196 -49l-33 73q117 56 231 56q228 0 228 -215v-451h-68zM168 993q0 -54 35 -85t96 -31q90 0 142.5 50t52.5 142v64l-88 -5 q-116 -6 -177 -36.5t-61 -98.5z" />
+<glyph unicode="&#xab;" horiz-adv-x="885" d="M82 543l309 393l62 -43l-254 -363l254 -362l-62 -43l-309 391v27zM442 543l310 393l61 -43l-254 -363l254 -362l-61 -43l-310 391v27z" />
+<glyph unicode="&#xac;" d="M1038 764v-494h-82v412h-845v82h927z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M92 512zM92 512v82h475v-82h-475z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M709 731h112q91 0 143 46.5t52 135.5q0 172 -197 172h-110v-354zM1120 918q0 -79 -38.5 -139.5t-110.5 -94.5l237 -393h-121l-210 360h-168v-360h-101v880h211q143 0 222 -62t79 -191zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275t101 -377 q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM193 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89t329.5 88.5t240.5 240.5t89 330q0 174 -85.5 325t-239 243t-334.5 92q-176 0 -328.5 -88.5t-241.5 -242.5t-89 -329z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036v82h1036v-82z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M139 1184q0 132 86.5 215.5t212.5 83.5t212.5 -83.5t86.5 -215.5t-86.5 -215.5t-212.5 -83.5q-130 0 -214.5 83t-84.5 216zM229 1184q0 -91 61 -154t148 -63q86 0 147.5 62t61.5 155q0 92 -60 154.5t-149 62.5q-90 0 -149.5 -64t-59.5 -153z" />
+<glyph unicode="&#xb1;" d="M111 1zM111 1v82h948v-82h-948zM625 764h434v-82h-434v-432h-82v432h-432v82h432v434h82v-434z" />
+<glyph unicode="&#xb2;" horiz-adv-x="688" d="M629 586h-576v78l242 237q125 121 172 193t47 149q0 71 -46.5 112.5t-123.5 41.5q-108 0 -217 -82l-49 65q119 103 270 103q124 0 194 -63.5t70 -174.5q0 -47 -13 -89t-40 -85.5t-68.5 -90t-308.5 -306.5h447v-88z" />
+<glyph unicode="&#xb3;" horiz-adv-x="688" d="M616 1260q0 -78 -44 -131.5t-117 -75.5q186 -45 186 -211q0 -130 -88.5 -201.5t-247.5 -71.5q-144 0 -264 60v88q136 -62 266 -62q115 0 174.5 49t59.5 136q0 83 -59.5 122t-178.5 39h-131v84h135q105 0 158 43.5t53 120.5q0 67 -47 107.5t-127 40.5q-128 0 -246 -78 l-47 70q130 94 293 94q127 0 199.5 -60t72.5 -163z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1182" d="M393 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1221" d="M281 1087v-704q0 -164 69 -238.5t213 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-50 -77 -150 -123.5t-217 -46.5q-99 0 -167.5 27.5t-119.5 84.5q5 -92 5 -170v-414h-99v1579h99z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1106 -260h-100v1722h-228v-1722h-100v819q-64 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h543v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="487" d="M162 623zM162 721q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M393 -291q0 -100 -67.5 -150.5t-188.5 -50.5q-68 0 -94 11v88q30 -10 92 -10q78 0 119 28t41 80q0 94 -193 121l93 174h96l-66 -117q168 -37 168 -174z" />
+<glyph unicode="&#xb9;" horiz-adv-x="688" d="M350 1462h92v-876h-98v547q0 99 12 233q-26 -23 -233 -145l-47 77z" />
+<glyph unicode="&#xba;" horiz-adv-x="739" d="M670 1141q0 -161 -80 -250.5t-223 -89.5t-220 86t-77 254q0 162 78 250t223 88q142 0 220.5 -87t78.5 -251zM160 1141q0 -264 209 -264t209 264q0 131 -50 194.5t-159 63.5t-159 -63.5t-50 -194.5z" />
+<glyph unicode="&#xbb;" horiz-adv-x="885" d="M803 518l-309 -393l-62 43l254 362l-254 363l62 43l309 -391v-27zM442 518l-309 -393l-61 43l254 362l-254 363l61 43l309 -391v-27z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1516" d="M59 0zM333 1462h92v-876h-98v547q0 99 12 233q-26 -23 -233 -145l-47 77zM1148 1462l-811 -1462h-94l811 1462h94zM1392 242h-129v-241h-90v241h-413v60l407 581h96v-563h129v-78zM1173 320v221q0 132 8 232q-6 -12 -21.5 -35.5t-295.5 -417.5h309z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1516" d="M11 0zM285 1462h92v-876h-98v547q0 99 12 233q-26 -23 -233 -145l-47 77zM1073 1462l-811 -1462h-94l811 1462h94zM1403 1h-576v78l242 237q125 121 172 193t47 149q0 71 -46.5 112.5t-123.5 41.5q-108 0 -217 -82l-49 65q119 103 270 103q124 0 194 -63.5t70 -174.5 q0 -47 -13 -89t-40 -85.5t-68.5 -90t-308.5 -306.5h447v-88z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1516" d="M41 0zM616 1260q0 -78 -44 -131.5t-117 -75.5q186 -45 186 -211q0 -130 -88.5 -201.5t-247.5 -71.5q-144 0 -264 60v88q136 -62 266 -62q115 0 174.5 49t59.5 136q0 83 -59.5 122t-178.5 39h-131v84h135q105 0 158 43.5t53 120.5q0 67 -47 107.5t-127 40.5 q-128 0 -246 -78l-47 70q130 94 293 94q127 0 199.5 -60t72.5 -163zM1300 1462l-811 -1462h-94l811 1462h94zM1495 242h-129v-241h-90v241h-413v60l407 581h96v-563h129v-78zM1276 320v221q0 132 8 232q-6 -12 -21.5 -35.5t-295.5 -417.5h309z" />
+<glyph unicode="&#xbf;" horiz-adv-x="862" d="M569 711v-37q0 -125 -39.5 -204.5t-136.5 -164.5l-90 -79q-73 -61 -104 -120.5t-31 -138.5q0 -124 82 -200t221 -76q125 0 233 46l64 27l37 -79q-111 -48 -185.5 -64t-152.5 -16q-184 0 -288.5 99t-104.5 269q0 70 20 124t58.5 102t171.5 159q64 53 98.5 98.5t49.5 94 t15 145.5v15h82zM440 1010q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM720 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM504 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM328 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM784 1581q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59 q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM367 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM748 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM836 1610q0 -97 -60 -155t-157 -58t-157 58t-60 155q0 94 60 152.5t157 58.5t157 -59t60 -152zM482 1610q0 -66 37.5 -103.5t99.5 -37.5 t99.5 37.5t37.5 103.5q0 64 -39 101.5t-98 37.5q-62 0 -99.5 -38t-37.5 -101z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1653" d="M1528 0h-717v516h-475l-227 -516h-111l653 1462h877v-94h-615v-553h576v-94h-576v-627h615v-94zM377 608h434v760h-100z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1272" d="M129 0zM831 1391q-275 0 -433 -176t-158 -482q0 -313 149 -486t426 -173q184 0 338 47v-90q-145 -51 -362 -51q-308 0 -485 199t-177 556q0 223 84.5 393t243 262.5t368.5 92.5q214 0 383 -80l-41 -92q-160 80 -336 80zM911 -291q0 -100 -67.5 -150.5t-188.5 -50.5 q-68 0 -94 11v88q30 -10 92 -10q78 0 119 28t41 80q0 94 -193 121l93 174h96l-66 -117q168 -37 168 -174z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM697 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM463 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xca;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM315 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM354 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM735 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xcc;" horiz-adv-x="516" d="M0 0zM207 0v1462h102v-1462h-102zM320 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xcd;" horiz-adv-x="516" d="M191 0zM207 0v1462h102v-1462h-102zM191 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xce;" horiz-adv-x="516" d="M0 0zM207 0v1462h102v-1462h-102zM-32 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xcf;" horiz-adv-x="516" d="M5 0zM207 0v1462h102v-1462h-102zM5 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM386 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1466" d="M1317 745q0 -368 -193 -556.5t-567 -188.5h-350v678h-160v94h160v690h395q350 0 532.5 -183t182.5 -534zM1206 741q0 314 -159.5 472.5t-468.5 158.5h-269v-600h406v-94h-406v-588h242q655 0 655 651z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1477" d="M207 0zM1270 0h-103l-866 1298h-8q12 -232 12 -350v-948h-98v1462h102l865 -1296h6q-9 180 -9 342v954h99v-1462zM897 1581q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59 q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM885 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM686 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM492 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM940 1581q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM529 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM910 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xd7;" d="M584 780l409 408l58 -58l-408 -407l406 -408l-58 -57l-407 408l-406 -408l-57 57l405 408l-407 407l57 58z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1565" d="M1436 733q0 -348 -174 -550.5t-480 -202.5q-236 0 -395 120l-86 -120l-74 59l90 127q-188 200 -188 569q0 349 175.5 549.5t479.5 200.5q232 0 392 -121l108 152l72 -60l-111 -153q191 -207 191 -570zM1325 733q0 315 -139 486l-742 -1037q133 -106 338 -106 q264 0 403.5 170t139.5 487zM240 733q0 -312 139 -483l739 1034q-133 102 -334 102q-261 0 -402.5 -170t-141.5 -483z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM833 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xda;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM633 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM444 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207 q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM481 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM862 1727q0 46 15.5 66 t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1081" d="M0 0zM543 662l428 800h110l-487 -897v-565h-105v557l-489 905h117zM434 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xde;" horiz-adv-x="1198" d="M1087 778q0 -212 -144 -325t-408 -113h-226v-340h-102v1462h102v-264h256q522 0 522 -420zM309 428h201q247 0 357 81.5t110 264.5q0 169 -104 250.5t-322 81.5h-242v-678z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1194" d="M961 1284q0 -139 -139 -250q-81 -64 -110.5 -100.5t-29.5 -75.5q0 -44 14.5 -68t51.5 -57t102 -78q106 -75 151.5 -124.5t68 -103t22.5 -120.5q0 -156 -88 -241.5t-246 -85.5q-95 0 -174.5 18.5t-126.5 48.5v107q65 -38 148.5 -62t152.5 -24q114 0 174.5 54.5t60.5 160.5 q0 83 -39 144t-149 136q-127 87 -175 147t-48 146q0 60 32.5 110t106.5 108q74 57 106.5 105.5t32.5 106.5q0 93 -70 143t-202 50q-145 0 -226 -69t-81 -196v-1214h-99v1206q0 173 103.5 267t292.5 94q188 0 285.5 -72.5t97.5 -210.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM638 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM422 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM251 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM697 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5 h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM282 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM663 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM759 1456q0 -97 -60 -155t-157 -58t-157 58t-60 155q0 94 60 152.5t157 58.5t157 -59t60 -152zM405 1456q0 -66 37.5 -103.5t99.5 -37.5t99.5 37.5t37.5 103.5q0 64 -39 101.5t-98 37.5 q-62 0 -99.5 -38t-37.5 -101z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1731" d="M1243 -20q-295 0 -397 256q-68 -133 -168 -194.5t-252 -61.5q-156 0 -242 82.5t-86 226.5q0 154 125 243t377 97l201 6v72q0 155 -61.5 234t-198.5 79q-148 0 -305 -84l-37 86q173 84 346 84q261 0 325 -211q111 213 347 213q184 0 289.5 -134.5t105.5 -363.5v-80h-715 q0 -460 348 -460q85 0 150 12t174 57v-90q-92 -41 -165 -55t-161 -14zM434 70q169 0 266 99.5t97 276.5v107l-187 -8q-219 -11 -313 -71.5t-94 -188.5q0 -102 61 -158.5t170 -56.5zM1217 1020q-284 0 -314 -402h604q0 188 -77.5 295t-212.5 107z" />
+<glyph unicode="&#xe7;" horiz-adv-x="973" d="M119 0zM616 -20q-233 0 -365 147t-132 410q0 270 137 420.5t375 150.5q141 0 270 -49l-27 -88q-141 47 -245 47q-200 0 -303 -123.5t-103 -355.5q0 -220 103 -344.5t288 -124.5q148 0 275 53v-92q-104 -51 -273 -51zM723 -291q0 -100 -67.5 -150.5t-188.5 -50.5 q-68 0 -94 11v88q30 -10 92 -10q78 0 119 28t41 80q0 94 -193 121l93 174h96l-66 -117q168 -37 168 -174z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM685 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM452 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xea;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM290 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM331 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM712 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xec;" horiz-adv-x="463" d="M0 0zM281 0h-99v1087h99v-1087zM349 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xed;" horiz-adv-x="463" d="M107 0zM281 0h-99v1087h99v-1087zM107 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xee;" horiz-adv-x="463" d="M0 0zM281 0h-99v1087h99v-1087zM-58 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xef;" horiz-adv-x="463" d="M0 0zM281 0h-99v1087h99v-1087zM-21 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM360 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1174" d="M1055 559q0 -276 -124 -427.5t-349 -151.5q-214 0 -339.5 130t-125.5 361q0 228 126.5 357.5t342.5 129.5q108 0 187.5 -33t148.5 -96l4 2q-64 270 -269 459l-270 -157l-49 77l244 146q-86 62 -199 119l45 81q147 -69 248 -145l225 137l49 -84l-202 -121 q154 -151 230.5 -353t76.5 -431zM950 557q0 146 -97 228.5t-267 82.5q-185 0 -275 -100.5t-90 -304.5q0 -186 94.5 -289.5t268.5 -103.5q179 0 272.5 123t93.5 364z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1208" d="M182 0zM940 0v705q0 164 -69 238.5t-214 74.5q-195 0 -285.5 -98.5t-90.5 -319.5v-600h-99v1087h84l19 -149h6q106 170 377 170q370 0 370 -397v-711h-98zM779 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5 t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM718 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM499 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM309 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM761 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM346 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM727 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xf7;" d="M111 682v82h948v-82h-948zM504 1075q0 99 80 99q82 0 82 -99q0 -52 -23.5 -75t-58.5 -23q-34 0 -57 23t-23 75zM504 371q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1200" d="M1081 545q0 -266 -129 -415.5t-356 -149.5q-173 0 -291 98l-86 -113l-72 58l93 120q-121 153 -121 402q0 266 129 414.5t354 148.5q179 0 301 -104l96 124l74 -55l-104 -137q112 -147 112 -391zM223 545q0 -200 78 -322l543 705q-98 90 -246 90q-180 0 -277.5 -123.5 t-97.5 -349.5zM977 545q0 190 -72 309l-543 -702q94 -82 238 -82q180 0 278.5 125.5t98.5 349.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM687 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM495 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM313 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70 v16z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM350 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM731 1389q0 46 15.5 66t47.5 20q64 0 64 -86 t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xfd;" horiz-adv-x="940" d="M0 0zM0 1087h102l230 -610q105 -281 133 -379h6q42 129 137 385l230 604h102l-487 -1263q-59 -154 -99 -208t-93.5 -81t-129.5 -27q-57 0 -127 21v86q58 -16 125 -16q51 0 90 24t70.5 74.5t73 160t53.5 142.5zM361 1257q73 79 144.5 171.5t97.5 140.5h141v-17 q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1219" d="M281 918q114 190 368 190q220 0 335.5 -144.5t115.5 -420.5q0 -268 -121.5 -415.5t-331.5 -147.5q-251 0 -366 188h-7l3 -84q4 -74 4 -162v-414h-99v2048h99v-391l-7 -247h7zM645 68q167 0 258.5 124t91.5 347q0 479 -348 479q-193 0 -279.5 -105t-86.5 -354v-18 q0 -255 85.5 -364t278.5 -109z" />
+<glyph unicode="&#xff;" horiz-adv-x="940" d="M0 0zM0 1087h102l230 -610q105 -281 133 -379h6q42 129 137 385l230 604h102l-487 -1263q-59 -154 -99 -208t-93.5 -81t-129.5 -27q-57 0 -127 21v86q58 -16 125 -16q51 0 90 24t70.5 74.5t73 160t53.5 142.5zM214 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86 q-63 0 -63 86zM595 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#x131;" horiz-adv-x="463" d="M281 0h-99v1087h99v-1087z" />
+<glyph unicode="&#x152;" horiz-adv-x="1839" d="M1714 0h-756q-76 -16 -176 -16q-305 0 -479 200t-174 551q0 347 174.5 545.5t480.5 198.5q78 0 183 -17h747v-94h-655v-553h616v-94h-616v-627h655v-94zM782 80q109 0 174 18v1266q-62 16 -172 16q-262 0 -403 -167.5t-141 -479.5q0 -315 140.5 -484t401.5 -169z" />
+<glyph unicode="&#x153;" horiz-adv-x="1942" d="M1438 -20q-156 0 -266.5 67.5t-165.5 198.5q-59 -128 -158 -197t-252 -69q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q151 0 251 -70t157 -209q110 279 399 279q192 0 303 -134t111 -364v-80h-762q2 -230 100.5 -345t276.5 -115q93 0 163.5 13t178.5 56 v-90q-92 -40 -170 -54.5t-172 -14.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5q174 0 265 122.5t91 352.5q0 224 -93 348.5t-265 124.5q-180 0 -277.5 -123.5t-97.5 -349.5zM1409 1020q-155 0 -242 -104t-102 -298h653q0 189 -82 295.5t-227 106.5z" />
+<glyph unicode="&#x178;" horiz-adv-x="1081" d="M0 0zM543 662l428 800h110l-487 -897v-565h-105v557l-489 905h117zM288 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM669 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1182" d="M299 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M805 1456q0 -97 -60 -155t-157 -58t-157 58t-60 155q0 94 60 152.5t157 58.5t157 -59t60 -152zM451 1456q0 -66 37.5 -103.5t99.5 -37.5t99.5 37.5t37.5 103.5q0 64 -39 101.5t-98 37.5q-62 0 -99.5 -38t-37.5 -101z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1182" d="M780 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M82 512v82h860v-82h-860z" />
+<glyph unicode="&#x2014;" horiz-adv-x="2048" d="M82 512v82h1884v-82h-1884z" />
+<glyph unicode="&#x2018;" horiz-adv-x="297" d="M41 961l-12 20q32 112 81.5 251t92.5 230h65q-30 -101 -64.5 -257t-45.5 -244h-117z" />
+<glyph unicode="&#x2019;" horiz-adv-x="297" d="M256 1462l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117z" />
+<glyph unicode="&#x201a;" horiz-adv-x="451" d="M68 0zM295 238l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117z" />
+<glyph unicode="&#x201c;" horiz-adv-x="614" d="M358 961l-12 20q34 120 83 255t91 226h66q-30 -98 -63 -248.5t-48 -252.5h-117zM41 961l-12 20q32 112 81.5 251t92.5 230h65q-30 -101 -64.5 -257t-45.5 -244h-117z" />
+<glyph unicode="&#x201d;" horiz-adv-x="614" d="M256 1462l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117zM573 1462l13 -20q-36 -128 -85 -261t-89 -220h-66q30 98 63 248.5t48 252.5h116z" />
+<glyph unicode="&#x201e;" horiz-adv-x="768" d="M68 0zM295 238l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117zM612 238l13 -20q-36 -128 -85 -261t-89 -220h-66q30 98 63 248.5t48 252.5h116z" />
+<glyph unicode="&#x2022;" horiz-adv-x="770" d="M231 748q0 89 40.5 134.5t113.5 45.5t113.5 -47t40.5 -133q0 -85 -41 -133t-113 -48t-113 47t-41 134z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1466" d="M162 0zM162 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98zM651 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98zM1141 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="524" d="M82 543l309 393l62 -43l-254 -363l254 -362l-62 -43l-309 391v27z" />
+<glyph unicode="&#x203a;" horiz-adv-x="524" d="M442 518l-309 -393l-61 43l254 362l-254 363l61 43l309 -391v-27z" />
+<glyph unicode="&#x2044;" horiz-adv-x="246" d="M573 1462l-811 -1462h-94l811 1462h94z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="688" d="M657 827h-129v-241h-90v241h-413v60l407 581h96v-563h129v-78zM438 905v221q0 132 8 232q-6 -12 -21.5 -35.5t-295.5 -417.5h309z" />
+<glyph unicode="&#x20ac;" d="M803 1397q-174 0 -288 -125.5t-155 -364.5h502v-82h-510l-4 -104v-24q0 -65 4 -87h449v-82h-443q30 -217 147.5 -338.5t301.5 -121.5q148 0 287 65v-94q-81 -34 -150.5 -46.5t-140.5 -12.5q-228 0 -367.5 140t-181.5 408h-180v82h172q-4 38 -4 113l4 102h-172v82h184 q39 272 183 425t362 153q88 0 161 -17t148 -57l-39 -86q-132 72 -270 72z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1485" d="M313 741h-86v643h-217v78h522v-78h-219v-643zM913 741l-221 609h-6l4 -201v-408h-82v721h125l221 -606l224 606h125v-721h-86v398l4 207h-7l-227 -605h-74z" />
+<glyph unicode="&#x2212;" d="M111 682v82h948v-82h-948z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1085" d="M0 1085h1085v-1085h-1085v1085z" />
+<glyph horiz-adv-x="1219" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff
new file mode 100644 (file)
index 0000000..e786074
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot
new file mode 100644 (file)
index 0000000..8f44592
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.svg b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.svg
new file mode 100644 (file)
index 0000000..431d7e3
--- /dev/null
@@ -0,0 +1,1835 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sanslight_italic" horiz-adv-x="1128" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb00;" horiz-adv-x="1155" d="M-131 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h477l35 160q35 168 116.5 244t227.5 76q73 0 166 -31 l-24 -80q-87 27 -148 27q-97 0 -154.5 -54.5t-82.5 -177.5l-35 -164h248l-17 -81h-248l-252 -1190q-34 -165 -105.5 -236.5t-193.5 -71.5q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l244 1166h-477l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1040" d="M0 0zM739 0h-98l231 1087h96zM915 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31 l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h248l-16 -81h-248l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1042" d="M0 0zM737 0h-94l334 1556h94zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h248l-16 -81h-248 l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1616" d="M0 0zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h477l35 160q35 168 116.5 244t227.5 76 q73 0 166 -31l-24 -80q-87 27 -148 27q-97 0 -154.5 -54.5t-82.5 -177.5l-35 -164h248l-17 -81h-248l-252 -1190q-34 -165 -105.5 -236.5t-193.5 -71.5q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l244 1166h-477l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z M1315 0h-98l231 1087h96zM1491 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1626" d="M0 0zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h477l35 160q35 168 116.5 244t227.5 76 q73 0 166 -31l-24 -80q-87 27 -148 27q-97 0 -154.5 -54.5t-82.5 -177.5l-35 -164h248l-17 -81h-248l-252 -1190q-34 -165 -105.5 -236.5t-193.5 -71.5q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l244 1166h-477l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z M1321 0h-94l334 1556h94z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="502" d="M248 377h-62l203 1085h119zM80 57q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-68 -34.5q-67 0 -67 73z" />
+<glyph unicode="&#x22;" horiz-adv-x="721" d="M455 1462l-146 -528h-61l80 528h127zM784 1462l-145 -528h-61l79 528h127z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M389 530l119 398h-297l8 80h311l134 454h90l-136 -454h365l135 454h86l-135 -454h285l-8 -80h-302l-118 -398h303l-8 -79h-320l-133 -451h-90l135 451h-360l-134 -451h-88l134 451h-283l8 79h299zM475 530h363l120 398h-362z" />
+<glyph unicode="$" d="M928 467q0 -151 -110.5 -243t-297.5 -103l-53 -240h-82l51 240q-79 2 -158 18t-137 43v94q65 -34 153.5 -53.5t160.5 -19.5l110 512q-110 53 -153 91t-66.5 87.5t-23.5 116.5q0 155 105.5 250.5t272.5 99.5l41 192h80l-41 -192q149 -5 277 -68l-35 -78q-110 61 -256 70 l-109 -514q124 -60 172.5 -99.5t73.5 -88.5t25 -115zM537 203q142 7 223.5 74.5t81.5 183.5q0 76 -48 129.5t-157 97.5zM686 1284q-134 -9 -205 -80t-71 -186q0 -78 37 -128.5t137 -96.5z" />
+<glyph unicode="%" horiz-adv-x="1556" d="M1458 1462l-1139 -1462h-106l1135 1462h110zM1520 612q0 -175 -50 -327t-136 -230t-197 -78q-112 0 -172 75.5t-60 223.5q0 160 52 312t138 229.5t193 77.5q121 0 176.5 -71.5t55.5 -211.5zM1284 821q-80 0 -146.5 -72.5t-106.5 -202.5t-40 -263q0 -116 41 -174t113 -58 q130 0 209.5 166.5t79.5 386.5q0 109 -36 163t-114 54zM760 1198q0 -175 -50 -327t-136 -230t-197 -78q-112 0 -172 75.5t-60 223.5q0 160 52 312t138 229.5t193 77.5q232 0 232 -283zM524 1407q-79 0 -145 -71.5t-107 -203t-41 -264.5q0 -115 41 -173t113 -58 q84 0 148.5 72t102.5 204t38 277q0 109 -36 163t-114 54z" />
+<glyph unicode="&#x26;" horiz-adv-x="1331" d="M748 1395q-125 0 -194 -68t-69 -192q0 -132 109 -281q203 89 279.5 163.5t76.5 182.5q0 91 -56.5 143t-145.5 52zM465 63q108 0 211.5 42.5t222.5 146.5l-352 493q-164 -79 -232 -134.5t-103.5 -124t-35.5 -158.5q0 -119 78 -192t211 -73zM78 324q0 162 99 277.5 t325 215.5l-41 67q-78 128 -78 251q0 157 101 253.5t264 96.5q145 0 227 -76.5t82 -206.5q0 -85 -41 -154t-121 -128t-256 -138l330 -463q73 75 135.5 176.5t91.5 186.5h111q-102 -247 -285 -436l184 -246h-123l-131 184q-121 -108 -242 -156t-266 -48q-167 0 -266.5 94 t-99.5 250z" />
+<glyph unicode="'" horiz-adv-x="403" d="M461 1462l-146 -528h-61l80 528h127z" />
+<glyph unicode="(" horiz-adv-x="526" d="M104 270q0 343 122 633t382 559h105q-259 -276 -384.5 -568t-125.5 -618q0 -317 127 -600h-80q-146 262 -146 594z" />
+<glyph unicode=")" horiz-adv-x="526" d="M453 868q0 -345 -123.5 -636t-380.5 -556h-105q257 274 383.5 566.5t126.5 619.5q0 148 -28.5 294t-98.5 306h80q146 -262 146 -594z" />
+<glyph unicode="*" horiz-adv-x="1137" d="M834 1540l-109 -405l438 8l-8 -107l-416 29l181 -401l-115 -37l-135 417l-285 -348l-78 78l318 318l-392 125l39 102l394 -168l47 408z" />
+<glyph unicode="+" d="M563 672h-401v100h401v404h101v-404h401v-100h-401v-400h-101v400z" />
+<glyph unicode="," horiz-adv-x="451" d="M250 238l8 -23q-34 -92 -114 -233.5t-160 -245.5h-74q79 132 141 271t88 231h111z" />
+<glyph unicode="-" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="." horiz-adv-x="485" d="M82 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73z" />
+<glyph unicode="/" horiz-adv-x="641" d="M827 1462l-817 -1462h-110l815 1462h112z" />
+<glyph unicode="0" d="M1075 1016q0 -201 -41 -405t-116.5 -346t-183.5 -213.5t-242 -71.5q-176 0 -264.5 126.5t-88.5 387.5q0 186 44.5 381.5t124 334t187 207t240.5 68.5q340 0 340 -469zM723 1397q-134 0 -241.5 -113t-173.5 -329t-66 -451q0 -222 62.5 -329t197.5 -107q139 0 244 112 t166 337t61 489q0 199 -59.5 295t-190.5 96z" />
+<glyph unicode="1" d="M537 0h-105l225 1055q19 92 74 293q-42 -36 -75.5 -61t-249.5 -161l-52 78l406 258h90z" />
+<glyph unicode="2" d="M909 0h-870l22 104l449 402q198 177 284 276.5t126.5 186.5t40.5 180q0 112 -66 178t-197 66q-176 0 -333 -129l-54 73q180 146 394 146q173 0 268.5 -85t95.5 -237q0 -110 -43.5 -208.5t-141.5 -211.5t-311 -303l-383 -338v-4h736z" />
+<glyph unicode="3" d="M1049 1174q0 -162 -106 -275t-286 -143v-4q117 -24 185.5 -115.5t68.5 -226.5q0 -134 -64 -233t-179.5 -148t-274.5 -49q-96 0 -184.5 20.5t-153.5 52.5v101q172 -86 344 -86q197 0 303.5 89.5t106.5 252.5q0 145 -89 223t-247 78h-117l21 96h110q209 0 333 95.5 t124 258.5q0 114 -63.5 175t-188.5 61q-167 0 -344 -131l-49 75q84 67 188 104.5t218 37.5q161 0 252.5 -82.5t91.5 -226.5z" />
+<glyph unicode="4" d="M1071 371h-264l-80 -371h-96l80 371h-688l20 96l881 1010h118l-215 -1018h265zM729 459q79 369 119 558.5t86 354.5h-4q-66 -91 -129 -166l-651 -747h579z" />
+<glyph unicode="5" d="M582 879q188 0 292.5 -102t104.5 -279q0 -237 -148 -377.5t-407 -140.5q-84 0 -177.5 20t-158.5 51v107q170 -90 340 -90q208 0 328.5 114.5t120.5 313.5q0 140 -85 219.5t-225 79.5q-133 0 -243 -41l-66 49l193 659h624l-18 -96h-541l-149 -516q98 29 215 29z" />
+<glyph unicode="6" d="M170 428q0 283 105 544.5t269.5 385t383.5 123.5q123 0 182 -21l-18 -90q-86 23 -170 23q-233 0 -393.5 -174t-233.5 -502h8q68 94 164 143t211 49q161 0 250.5 -100.5t89.5 -282.5q0 -156 -60 -281t-171 -195t-257 -70q-171 0 -265.5 119t-94.5 329zM543 68 q112 0 196.5 58.5t130 162t45.5 229.5q0 146 -67 224.5t-195 78.5q-81 0 -154 -31.5t-129 -87t-78 -115t-22 -173.5q0 -164 72.5 -255t200.5 -91z" />
+<glyph unicode="7" d="M244 0l796 1366h-766l23 96h858l-20 -110l-779 -1352h-112z" />
+<glyph unicode="8" d="M737 1485q163 0 258 -85t95 -229q0 -138 -84 -234.5t-285 -172.5q130 -78 190 -170.5t60 -208.5t-58 -208t-165.5 -144.5t-260.5 -52.5q-178 0 -283.5 92.5t-105.5 253.5q0 159 100.5 268.5t321.5 187.5q-100 72 -144 152t-44 180q0 159 114 265t291 106zM610 733 q-218 -73 -313.5 -167.5t-95.5 -225.5q0 -136 77.5 -206.5t219.5 -70.5q168 0 270 91t102 233q0 104 -62 189t-198 157zM727 1399q-130 0 -214.5 -82t-84.5 -203q0 -91 41.5 -159t157.5 -142q192 62 279 144t87 206q0 109 -70.5 172.5t-195.5 63.5z" />
+<glyph unicode="9" d="M1059 1032q0 -288 -101.5 -548t-263.5 -382t-393 -122q-114 0 -186 22v90q87 -29 192 -29q474 0 627 674h-8q-140 -192 -367 -192q-162 0 -255 105t-93 284q0 155 59.5 281t170.5 196t257 70q174 0 267.5 -115.5t93.5 -333.5zM686 1393q-112 0 -197.5 -58.5 t-130.5 -162.5t-45 -230q0 -145 67.5 -225t192.5 -80q83 0 157.5 32.5t129 87.5t76.5 114t22 176q0 166 -71 256t-201 90z" />
+<glyph unicode=":" horiz-adv-x="485" d="M260 989q0 57 25.5 89t68.5 32q66 0 66 -72q0 -55 -25 -89t-67 -34q-68 0 -68 74zM102 55q0 56 25.5 88.5t69.5 32.5q65 0 65 -72q0 -55 -25.5 -88.5t-66.5 -33.5q-68 0 -68 73z" />
+<glyph unicode=";" horiz-adv-x="485" d="M287 238l8 -23q-35 -96 -118.5 -242t-156.5 -237h-73q79 132 141 271t88 231h111zM266 989q0 57 25.5 89t68.5 32q66 0 66 -72q0 -55 -25 -89t-67 -34q-68 0 -68 74z" />
+<glyph unicode="&#x3c;" d="M1051 262l-914 414v74l914 471v-103l-801 -399l801 -350v-107z" />
+<glyph unicode="=" d="M168 885v100h903v-100h-903zM168 461v98h903v-98h-903z" />
+<glyph unicode="&#x3e;" d="M170 369l801 350l-801 399v103l915 -471v-74l-915 -414v107z" />
+<glyph unicode="?" horiz-adv-x="799" d="M242 362l6 29q29 132 82 206.5t157 147.5q118 84 175 145.5t86.5 127.5t29.5 141q0 108 -67.5 170t-182.5 62q-139 0 -307 -101l-39 86q85 49 171.5 78t187.5 29q159 0 250.5 -84.5t91.5 -229.5q0 -127 -66 -234t-231 -226q-85 -61 -132.5 -108.5t-73 -95t-46.5 -143.5 h-92zM170 59q0 56 25 88.5t69 32.5q66 0 66 -71q0 -54 -24.5 -88.5t-67.5 -34.5q-68 0 -68 73z" />
+<glyph unicode="@" horiz-adv-x="1724" d="M1688 858q0 -179 -56 -323.5t-154.5 -227t-211.5 -82.5q-98 0 -154.5 55t-56.5 144h-4q-54 -97 -132.5 -148t-168.5 -51q-112 0 -178 73t-66 202q0 156 63 283t178 198.5t261 71.5q122 0 252 -52l-84 -315q-39 -140 -39 -221q0 -71 34.5 -111.5t100.5 -40.5 q86 0 160 73.5t117.5 198t43.5 251.5q0 156 -65 277t-187 188t-292 67q-235 0 -424.5 -108.5t-295.5 -304t-106 -439.5q0 -288 155 -449t435 -161q207 0 420 82v-90q-210 -82 -428 -82q-203 0 -357.5 82.5t-238.5 239t-84 370.5q0 276 121.5 493.5t337 337t473.5 119.5 q189 0 330.5 -72.5t221 -213t79.5 -314.5zM1008 969q-113 0 -204.5 -59t-142.5 -165.5t-51 -238.5q0 -92 40.5 -142.5t113.5 -50.5q101 0 180.5 89t124.5 255l78 289q-66 23 -139 23z" />
+<glyph unicode="A" horiz-adv-x="1059" d="M805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449z" />
+<glyph unicode="B" horiz-adv-x="1202" d="M412 1462h379q190 0 290.5 -84t100.5 -241q0 -153 -90 -249t-254 -124v-4q125 -31 188.5 -113.5t63.5 -204.5q0 -205 -140.5 -323.5t-390.5 -118.5h-457zM377 811h278q206 0 313 81t107 238q0 119 -78 180.5t-229 61.5h-272zM358 721l-135 -631h342q201 0 309.5 87.5 t108.5 256.5q0 145 -90 216t-275 71h-260z" />
+<glyph unicode="C" horiz-adv-x="1169" d="M961 1389q-197 0 -351.5 -104.5t-245 -304.5t-90.5 -441q0 -225 110.5 -346t317.5 -121q140 0 304 51v-94q-156 -49 -316 -49q-252 0 -386 145t-134 410q0 266 104.5 488t284.5 341t402 119q177 0 307 -68l-45 -90q-55 30 -124.5 47t-137.5 17z" />
+<glyph unicode="D" horiz-adv-x="1350" d="M1288 879q0 -253 -109.5 -461.5t-300.5 -313t-446 -104.5h-330l310 1462h305q282 0 426.5 -147.5t144.5 -435.5zM430 90q226 0 394.5 94.5t261 275.5t92.5 412q0 498 -476 498h-206l-275 -1280h209z" />
+<glyph unicode="E" horiz-adv-x="1067" d="M829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627z" />
+<glyph unicode="F" horiz-adv-x="981" d="M205 0h-103l310 1462h708l-20 -94h-604l-134 -620h570l-21 -95h-569z" />
+<glyph unicode="G" horiz-adv-x="1374" d="M856 735h406l-150 -682q-211 -73 -405 -73q-257 0 -397 146t-140 421q0 265 105 483.5t283.5 335.5t395.5 117q113 0 203 -19t184 -59l-38 -94q-110 46 -189.5 62t-167.5 16q-184 0 -339 -107.5t-244 -301.5t-89 -433q0 -229 114.5 -352t326.5 -123q155 0 309 47l117 526 h-303z" />
+<glyph unicode="H" horiz-adv-x="1366" d="M1063 0h-100l151 719h-760l-149 -719h-103l310 1462h102l-139 -649h760l137 649h100z" />
+<glyph unicode="I" horiz-adv-x="504" d="M102 0l310 1462h98l-309 -1462h-99z" />
+<glyph unicode="J" horiz-adv-x="477" d="M-180 -360q-48 0 -88 8t-56 16l11 92q57 -20 137 -20q213 0 262 241l309 1485h105l-314 -1491q-35 -170 -125 -250.5t-241 -80.5z" />
+<glyph unicode="K" horiz-adv-x="1122" d="M979 0h-111l-342 788l-190 -153l-131 -635h-103l310 1462h102l-158 -723l133 121l680 602h138l-699 -610z" />
+<glyph unicode="L" horiz-adv-x="938" d="M102 0l310 1462h102l-289 -1366h621l-23 -96h-721z" />
+<glyph unicode="M" horiz-adv-x="1669" d="M772 205l733 1257h150l-301 -1462h-101l191 901q79 369 100 447h-6l-780 -1348h-51l-222 1348h-6q-20 -154 -78 -426l-196 -922h-96l309 1462h143l205 -1257h6z" />
+<glyph unicode="N" horiz-adv-x="1372" d="M1069 0h-86l-516 1284h-8q-23 -149 -48 -273t-214 -1011h-95l310 1462h80l522 -1294h8q23 176 74 416l188 878h94z" />
+<glyph unicode="O" horiz-adv-x="1464" d="M1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300t79 430.5 q0 240 -104.5 364t-310.5 124z" />
+<glyph unicode="P" horiz-adv-x="1145" d="M1145 1102q0 -500 -610 -500h-201l-129 -602h-103l310 1462h315q202 0 310 -92.5t108 -267.5zM350 694h191q252 0 373.5 96.5t121.5 305.5q0 274 -329 274h-211z" />
+<glyph unicode="Q" horiz-adv-x="1464" d="M1403 911q0 -216 -70 -418t-186.5 -324t-274.5 -167l267 -350h-142l-231 332l-74 -4q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128 q169 0 300 98.5t210 300t79 430.5q0 240 -104.5 364t-310.5 124z" />
+<glyph unicode="R" horiz-adv-x="1145" d="M336 633l-131 -633h-103l310 1462h303q430 0 430 -360q0 -182 -103.5 -303t-281.5 -152q201 -591 221 -647h-111l-211 633h-323zM358 725h252q208 0 317 95.5t109 281.5q0 268 -329 268h-211z" />
+<glyph unicode="S" horiz-adv-x="1020" d="M895 403q0 -126 -65.5 -224.5t-179.5 -148.5t-269 -50q-88 0 -172.5 17t-171.5 58v109q163 -92 348 -92q188 0 295.5 86.5t107.5 232.5q0 61 -17 104.5t-52.5 78.5t-91 68t-131.5 75q-150 76 -209.5 164t-59.5 206t59 207.5t165 139t237 49.5q99 0 180 -17.5t168 -60.5 l-32 -94q-66 40 -151.5 63t-164.5 23q-163 0 -259.5 -82.5t-96.5 -218.5q0 -103 49 -170t182 -133q154 -79 213.5 -130t89 -113t29.5 -147z" />
+<glyph unicode="T" horiz-adv-x="985" d="M438 0h-102l289 1368h-432l20 94h973l-19 -94h-440z" />
+<glyph unicode="U" horiz-adv-x="1370" d="M1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101z" />
+<glyph unicode="V" horiz-adv-x="1079" d="M457 147q51 111 124 247l572 1068h117l-799 -1462h-88l-182 1462h100l117 -950q26 -217 35 -365h4z" />
+<glyph unicode="W" horiz-adv-x="1702" d="M1018 1341q-27 -76 -62 -153.5t-563 -1187.5h-82l-73 1462h100l47 -1031l4 -165l-2 -86h6q85 226 170 398l434 884h105l61 -878q19 -266 19 -410h6q30 86 61.5 163t493.5 1125h108q-169 -365 -330.5 -731t-328.5 -731h-78l-78 1075q-11 142 -11 219l1 47h-8z" />
+<glyph unicode="X" horiz-adv-x="971" d="M879 0h-107l-254 678l-526 -678h-127l608 766l-272 696h106l240 -626l483 626h119l-555 -719z" />
+<glyph unicode="Y" horiz-adv-x="965" d="M494 645l544 817h117l-631 -932l-108 -530h-105l119 545l-237 917h100z" />
+<glyph unicode="Z" d="M913 0h-925l22 92l1069 1276h-764l23 94h887l-19 -88l-1069 -1280h799z" />
+<glyph unicode="[" horiz-adv-x="537" d="M369 -324h-426l376 1786h429l-19 -90h-330l-340 -1605h330z" />
+<glyph unicode="\" horiz-adv-x="641" d="M295 1462l242 -1462h-82l-246 1462h86z" />
+<glyph unicode="]" horiz-adv-x="537" d="M203 1462h426l-377 -1786h-428l18 91h330l340 1605h-330z" />
+<glyph unicode="^" horiz-adv-x="1047" d="M70 569l587 906h91l260 -906h-105l-217 809l-500 -809h-116z" />
+<glyph unicode="_" horiz-adv-x="801" d="M625 -291h-807l18 86h807z" />
+<glyph unicode="`" horiz-adv-x="1135" d="M766 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="a" horiz-adv-x="1133" d="M655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82t-164 -245.5 t-64 -325.5q0 -152 50 -223.5t151 -71.5z" />
+<glyph unicode="b" horiz-adv-x="1151" d="M500 -16q-113 0 -186 59t-97 166h-6l-55 -209h-80l327 1556h95q-131 -628 -162 -751h6q93 156 199 229.5t231 73.5q281 0 281 -375q0 -203 -76 -380t-201 -273t-276 -96zM750 1018q-91 0 -180 -61.5t-160.5 -169.5t-106.5 -235t-35 -206q0 -129 64 -202.5t166 -73.5 q124 0 224 83t164 245t64 325q0 152 -49 223.5t-151 71.5z" />
+<glyph unicode="c" horiz-adv-x="887" d="M477 -20q-174 0 -274.5 110.5t-100.5 306.5q0 193 73.5 361.5t198.5 257t290 88.5q134 0 241 -43l-28 -90q-107 47 -218 47q-129 0 -232.5 -77t-162.5 -222t-59 -320q0 -158 73.5 -243.5t208.5 -85.5q71 0 131.5 13t131.5 46v-92q-116 -57 -273 -57z" />
+<glyph unicode="d" horiz-adv-x="1133" d="M655 1104q230 0 279 -219h4q12 66 143 671h99l-330 -1556h-82l45 274h-6q-173 -294 -424 -294q-281 0 -281 374q0 193 71.5 370t197.5 278.5t284 101.5zM406 70q89 0 178.5 62.5t160 168t106.5 231t36 209.5q0 126 -61.5 201.5t-168.5 75.5q-124 0 -224 -83t-164 -242.5 t-64 -327.5q0 -295 201 -295z" />
+<glyph unicode="e" horiz-adv-x="928" d="M469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5t-162.5 -308.5h49 q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5z" />
+<glyph unicode="f" horiz-adv-x="578" d="M-131 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h248l-16 -81h-248l-252 -1190q-33 -161 -104 -234.5 t-195 -73.5z" />
+<glyph unicode="g" horiz-adv-x="1040" d="M1100 1087l-17 -79l-243 -11q26 -28 43.5 -84t17.5 -114q0 -109 -54.5 -206.5t-148 -145.5t-213.5 -48q-63 0 -77 9q-80 -33 -124 -73t-44 -81t31.5 -64.5t113.5 -31.5l121 -11q346 -31 346 -264q0 -112 -65 -197.5t-187 -131.5t-291 -46q-186 0 -291.5 72t-105.5 203 q0 236 309 334q-78 42 -78 123q0 123 191 202q-71 36 -110.5 105.5t-39.5 157.5q0 111 53.5 204t148 146t206.5 53q69 0 147 -21h361zM14 -207q0 -101 81 -150t224 -49q203 0 317 74.5t114 204.5q0 85 -62.5 130.5t-218.5 57.5l-160 15q-157 -45 -226 -114.5t-69 -168.5z M285 711q0 -112 58.5 -170t164.5 -58q88 0 154 37t102.5 114t36.5 169q0 104 -56 161.5t-157 57.5q-93 0 -161 -43t-105 -116t-37 -152z" />
+<glyph unicode="h" horiz-adv-x="1143" d="M764 0l149 692q21 92 21 156q0 80 -43.5 125t-134.5 45q-112 0 -210.5 -67t-166 -188t-103.5 -286l-102 -477h-98l332 1556h96l-86 -411q-44 -200 -66 -279h6q78 113 186.5 175.5t229.5 62.5q124 0 192 -65t68 -183q0 -70 -24 -182l-148 -674h-98z" />
+<glyph unicode="i" horiz-adv-x="475" d="M174 0h-98l231 1087h96zM350 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5z" />
+<glyph unicode="j" horiz-adv-x="475" d="M-166 -492q-62 0 -113 19v92q47 -22 113 -22q82 0 128.5 51.5t72.5 177.5l266 1261h96l-268 -1271q-35 -165 -106.5 -236.5t-188.5 -71.5zM350 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5z" />
+<glyph unicode="k" horiz-adv-x="944" d="M270 477l609 610h125l-474 -469l297 -618h-106l-264 559l-205 -188l-80 -371h-96l330 1556h96l-166 -780l-70 -299h4z" />
+<glyph unicode="l" horiz-adv-x="475" d="M170 0h-94l334 1556h94z" />
+<glyph unicode="m" horiz-adv-x="1751" d="M711 0l147 674q25 125 25 162q0 182 -154 182q-106 0 -200 -67.5t-159 -188.5t-100 -287l-100 -475h-98l231 1087h80l-33 -210h6q80 113 181.5 170t212.5 57q106 0 163 -67t60 -195h6q77 129 181 195.5t222 66.5q117 0 182.5 -61.5t65.5 -176.5q0 -29 -2.5 -56.5 t-19.5 -119.5l-152 -690h-100l149 680q25 120 25 176q0 77 -43 119.5t-119 42.5q-157 0 -277.5 -137.5t-168.5 -362.5l-109 -518h-102z" />
+<glyph unicode="n" horiz-adv-x="1143" d="M764 0l149 692q21 92 21 156q0 80 -43.5 125t-134.5 45q-112 0 -210.5 -67t-166 -187.5t-103.5 -286.5l-102 -477h-98l231 1087h82l-37 -221h6q164 238 416 238q130 0 195 -64t65 -184q0 -70 -24 -182l-148 -674h-98z" />
+<glyph unicode="o" horiz-adv-x="1124" d="M649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83z" />
+<glyph unicode="p" horiz-adv-x="1149" d="M498 -16q-230 0 -279 219h-4q-13 -72 -149 -695h-99l336 1579h82l-45 -274h6q91 153 195.5 224t228.5 71q135 0 208 -92.5t73 -282.5q0 -195 -72 -371t-197.5 -277t-283.5 -101zM748 1018q-87 0 -174 -58.5t-161.5 -167.5t-110.5 -237.5t-36 -208.5q0 -125 61.5 -200.5 t168.5 -75.5q124 0 225 84t164 243.5t63 325.5q0 295 -200 295z" />
+<glyph unicode="q" horiz-adv-x="1157" d="M651 1104q109 0 183.5 -58t99.5 -167h6l55 208h80l-327 -1556h-95l98 470l64 282h-6q-93 -156 -199 -229.5t-231 -73.5q-281 0 -281 374q0 201 75.5 379t200.5 274.5t277 96.5zM401 70q92 0 182 62.5t160.5 171.5t105 236.5t34.5 200.5q0 130 -63.5 203.5t-166.5 73.5 q-124 0 -224 -83t-164 -245t-64 -325q0 -143 45.5 -219t154.5 -76z" />
+<glyph unicode="r" horiz-adv-x="752" d="M713 1106q69 0 123 -14l-21 -93q-47 15 -113 15q-94 0 -179 -64t-153 -192t-100 -277l-100 -481h-98l231 1087h80l-29 -204h6q73 94 123 135.5t106.5 64.5t123.5 23z" />
+<glyph unicode="s" horiz-adv-x="827" d="M713 295q0 -144 -103 -229.5t-280 -85.5q-173 0 -305 75v107q74 -46 153 -71t148 -25q138 0 211 57.5t73 163.5q0 42 -15.5 74t-50 61.5t-132.5 85.5q-148 80 -200 145.5t-52 159.5q0 128 98.5 209.5t259.5 81.5q75 0 158.5 -17.5t140.5 -46.5l-35 -88q-136 64 -264 64 q-116 0 -186 -53t-70 -138q0 -55 17 -88t60.5 -68.5t119.5 -76.5q114 -63 161.5 -103.5t70 -86.5t22.5 -107z" />
+<glyph unicode="t" horiz-adv-x="616" d="M694 1087l-18 -81h-283l-135 -635q-22 -99 -22 -164q0 -139 126 -139q68 0 152 26v-86q-101 -28 -170 -28q-99 0 -153 54.5t-54 158.5q0 73 29 206l129 607h-182l14 67l184 17l97 253h55l-55 -256h286z" />
+<glyph unicode="u" horiz-adv-x="1143" d="M381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100z" />
+<glyph unicode="v" horiz-adv-x="895" d="M276 0l-172 1087h101l108 -735q26 -165 33 -254h6q51 115 129 256l406 733h102l-600 -1087h-113z" />
+<glyph unicode="w" horiz-adv-x="1393" d="M838 0l-60 686q-14 224 -14 266h-6q-34 -92 -144 -290l-356 -662h-117l-20 1087h92l13 -821l-3 -157h6q61 134 150 297l373 681h77l64 -681q14 -147 14 -297h6l24 61l101 236l320 681h96l-508 -1087h-108z" />
+<glyph unicode="x" horiz-adv-x="922" d="M442 483l-393 -483h-121l471 559l-245 528h100l207 -462l373 462h120l-448 -534l258 -553h-98z" />
+<glyph unicode="y" horiz-adv-x="920" d="M123 1087h100l82 -548q51 -351 55 -449h11q43 105 186 367l348 630h103l-713 -1290q-72 -127 -122.5 -178t-114 -81t-146.5 -30q-68 0 -129 21v92q71 -27 137 -27q80 0 147 49.5t130 164.5t100 184z" />
+<glyph unicode="z" horiz-adv-x="887" d="M700 0h-729l15 72l776 932h-543l17 83h659l-18 -83l-762 -920h602z" />
+<glyph unicode="{" horiz-adv-x="709" d="M424 -324q-256 0 -256 199q0 45 16 115l56 252q18 90 18 127q0 159 -199 159l21 78q126 0 191 49t89 158l89 393q30 135 106 195.5t215 60.5h29l-17 -86q-86 -2 -129 -20.5t-69.5 -61.5t-44.5 -120l-74 -338q-30 -134 -91.5 -194.5t-164.5 -78.5v-4q68 -18 105.5 -68.5 t37.5 -121.5q0 -52 -24 -164l-47 -225q-13 -58 -13 -101q0 -61 37.5 -89t138.5 -28v-86h-20z" />
+<glyph unicode="|" d="M584 1561h100v-2071h-100v2071z" />
+<glyph unicode="}" horiz-adv-x="709" d="M332 1462q131 0 189.5 -51t58.5 -147q0 -41 -17 -115l-55 -252q-19 -95 -19 -127q0 -77 49.5 -118.5t149.5 -41.5l-20 -78q-125 0 -191 -48.5t-90 -157.5l-88 -394q-32 -139 -108.5 -197.5t-213.5 -58.5h-18v86q96 2 138 21t68.5 61t43.5 121l74 338q27 126 87.5 189.5 t168.5 82.5v5q-75 20 -109.5 72.5t-34.5 117.5q0 55 18 131l54 258q12 61 12 101q0 44 -18 69t-54 36t-116 11l20 86h21z" />
+<glyph unicode="~" d="M350 745q-49 0 -108 -30.5t-115 -89.5v94q108 110 233 110q61 0 115 -13.5t156 -57.5q126 -58 219 -58q54 0 107.5 29t117.5 96v-96q-111 -113 -233 -113q-117 0 -271 72q-62 29 -112.5 43t-108.5 14z" />
+<glyph unicode="&#xa1;" horiz-adv-x="502" d="M264 711h62l-203 -1086h-119zM432 1030q0 -56 -25 -88.5t-69 -32.5q-66 0 -66 72q0 55 25 89t68 34q67 0 67 -74z" />
+<glyph unicode="&#xa2;" d="M578 -20h-93l45 215q-132 25 -206 132.5t-74 272.5q0 184 63.5 341t178 253t256.5 111l36 178h90l-38 -176q116 -4 217 -43l-29 -90q-107 47 -217 47q-130 0 -233 -76t-162.5 -221t-59.5 -322q0 -164 74.5 -247t208.5 -83q127 0 264 60v-92q-118 -58 -281 -58z" />
+<glyph unicode="&#xa3;" d="M879 1479q170 0 313 -78l-39 -84l-54 26q-108 50 -231 50q-134 0 -220.5 -74.5t-117.5 -220.5l-73 -340h409l-18 -82h-408l-57 -268q-50 -225 -188 -314h759l-20 -94h-938l16 84q93 11 165.5 95.5t107.5 236.5l57 260h-199l17 82h198l76 350q41 187 155 279t290 92z" />
+<glyph unicode="&#xa4;" d="M262 723q0 118 74 225l-129 129l63 64l127 -129q105 78 230 78q118 0 223 -78l131 129l61 -62l-129 -129q78 -106 78 -227q0 -135 -78 -227l129 -127l-61 -62l-131 127q-104 -76 -223 -76q-126 0 -228 80l-129 -129l-61 62l127 127q-74 98 -74 225zM350 723 q0 -116 80 -196.5t197 -80.5t198.5 81t81.5 196q0 75 -36.5 140t-102.5 104t-141 39q-114 0 -195.5 -82t-81.5 -201z" />
+<glyph unicode="&#xa5;" d="M584 645l544 817h117l-559 -823h266l-16 -76h-315l-39 -190h317l-18 -84h-316l-59 -289h-105l64 289h-299l18 84h299l41 190h-301l17 76h258l-215 823h100z" />
+<glyph unicode="&#xa6;" d="M578 1561h100v-756h-100v756zM578 246h100v-756h-100v756z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M211 778q0 101 69.5 182t198.5 130q-64 31 -103.5 85.5t-39.5 120.5q0 74 46 134.5t132.5 94.5t202.5 34q163 0 289 -58l-31 -80q-138 54 -264 54q-124 0 -202.5 -46.5t-78.5 -123.5q0 -59 46 -104.5t183 -106.5q112 -52 158.5 -89.5t71 -85t24.5 -110.5 q0 -197 -249 -317q122 -64 122 -197q0 -86 -48 -153.5t-139.5 -105.5t-221.5 -38q-157 0 -275 53v99q47 -27 126 -46.5t153 -19.5q149 0 228 52.5t79 150.5q0 62 -42.5 106t-166.5 96q-155 65 -211.5 130t-56.5 159zM559 1038q-119 -30 -187.5 -97.5t-68.5 -154.5 q0 -57 24.5 -96.5t81 -73t187.5 -81.5q103 49 162 113.5t59 156.5q0 72 -57.5 126t-200.5 107z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1135" d="M836 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM492 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M944 1092q-142 0 -222.5 -94.5t-80.5 -264.5q0 -186 74.5 -275t220.5 -89q85 0 199 43v-88q-104 -45 -209 -45q-187 0 -288 116t-101 330q0 207 110 332t297 125q119 0 227 -52l-36 -83q-99 45 -191 45zM147 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275 t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM240 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89q174 0 325 85.5t243 239t92 334.5q0 178 -89 330t-240.5 241t-330.5 89q-182 0 -335 -92t-238.5 -243t-85.5 -325z" />
+<glyph unicode="&#xaa;" horiz-adv-x="643" d="M487 1485q55 0 97.5 -29t66.5 -86h6l35 103h66l-137 -650h-72l22 125h-4q-96 -137 -223 -137q-80 0 -127 56.5t-47 164.5q0 189 90.5 321t226.5 132zM369 885q66 0 133.5 75.5t97.5 184.5q16 51 16 123q0 58 -36 100.5t-93 42.5q-94 0 -161.5 -111.5t-67.5 -271.5 q0 -143 111 -143z" />
+<glyph unicode="&#xab;" horiz-adv-x="860" d="M426 932l57 -49l-317 -336l213 -385l-64 -39l-254 418l2 26zM786 932l58 -49l-314 -336l209 -385l-63 -39l-254 418l2 26z" />
+<glyph unicode="&#xac;" d="M1028 772v-500h-100v400h-803v100h903z" />
+<glyph unicode="&#xad;" horiz-adv-x="629" d="M77 502zM77 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M758 731h112q93 0 144 46.5t51 135.5q0 172 -197 172h-110v-354zM1169 918q0 -80 -39.5 -141t-109.5 -93l237 -393h-120l-211 360h-168v-360h-101v880h211q143 0 222 -62t79 -191zM150 731q0 207 103.5 382t276.5 272.5t371 97.5q200 0 375 -100t276 -275t101 -377 q0 -197 -97 -370t-272 -277t-383 -104q-204 0 -376.5 100.5t-273.5 273t-101 377.5zM242 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89q174 0 325 85.5t243 239t92 334.5q0 178 -89 330t-240.5 241t-330.5 89q-182 0 -335 -92t-238.5 -243t-85.5 -325z" />
+<glyph unicode="&#xaf;" horiz-adv-x="655" d="M1001 1556h-653l53 97h654z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M242 1190q0 120 85 206.5t208 86.5q122 0 207 -86.5t85 -206.5q0 -122 -85.5 -207.5t-206.5 -85.5q-122 0 -207.5 85.5t-85.5 207.5zM315 1190q0 -89 64.5 -153t155.5 -64q92 0 155.5 64t63.5 153q0 90 -64 155.5t-155 65.5q-90 0 -155 -65.5t-65 -155.5z" />
+<glyph unicode="&#xb1;" d="M528 629h-401v98h401v406h101v-406h401v-98h-401v-400h-101v400zM127 0v100h903v-100h-903z" />
+<glyph unicode="&#xb2;" horiz-adv-x="643" d="M604 586h-522l16 80l297 258q137 118 182.5 190.5t45.5 153.5q0 59 -38.5 97t-105.5 38q-95 0 -194 -76l-41 62q108 90 239 90q73 0 125 -27t78.5 -72t26.5 -100q0 -106 -59 -198.5t-183 -194.5l-266 -223h416z" />
+<glyph unicode="&#xb3;" horiz-adv-x="643" d="M705 1276q0 -85 -48.5 -148t-154.5 -88v-4q66 -16 105.5 -68t39.5 -124q0 -77 -39 -141t-109 -99t-161 -35q-59 0 -123.5 15.5t-105.5 40.5v90q46 -28 108 -48t125 -20q99 0 159 52.5t60 142.5q0 162 -196 162h-84l16 79h86q102 0 168.5 49.5t66.5 129.5 q0 68 -37.5 102.5t-105.5 34.5q-100 0 -199 -68l-40 64q109 86 251 86q100 0 159 -56.5t59 -148.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1135" d="M580 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1171" d="M238 242q0 -82 48.5 -127t135.5 -45q110 0 207 64.5t162.5 182.5t101.5 285l104 485h99l-234 -1087h-78l29 205h-6q-164 -221 -404 -221q-85 0 -139 32.5t-76 89.5h-6q-18 -132 -51 -284l-63 -314h-97l338 1579h101l-152 -698q-20 -96 -20 -147z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1208 -260h-100v1722h-227v-1722h-101v819q-64 -18 -145 -18q-216 0 -318 125t-102 376q0 260 109 387t342 127h542v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="485" d="M207 625zM207 698q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M197 -289q0 -94 -75.5 -148.5t-217.5 -54.5q-46 0 -78 7v79q30 -6 72 -6q198 0 198 115q0 97 -151 107l110 190h80l-78 -137q140 -30 140 -152z" />
+<glyph unicode="&#xb9;" horiz-adv-x="643" d="M512 1462h80l-186 -876h-84l118 569q5 21 11.5 50.5t14 60t15.5 59t15 49.5q-34 -31 -60 -51.5t-143 -93.5l-39 59z" />
+<glyph unicode="&#xba;" horiz-adv-x="655" d="M518 1479q105 0 165 -64t60 -180q0 -115 -40 -214t-114 -156.5t-175 -57.5q-114 0 -169 67.5t-55 184.5q0 112 41.5 209.5t116 154t170.5 56.5zM508 1405q-70 0 -124 -46.5t-84 -124.5t-30 -167q0 -186 156 -186q73 0 125.5 46.5t81.5 127.5t29 176q0 83 -39 128.5 t-115 45.5z" />
+<glyph unicode="&#xbb;" horiz-adv-x="860" d="M451 123l-58 49l314 336l-209 385l63 39l254 -418l-2 -27zM90 123l-57 49l313 336l-209 385l64 39l254 -418l-2 -27z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1481" d="M129 0zM1319 230h-131l-49 -229h-82l49 229h-391l21 76l506 577h86l-125 -581h133zM1121 302q61 294 79 365.5t29 105.5q-10 -16 -61 -79t-338 -392h291zM1323 1462l-1087 -1462h-107l1086 1462h108zM509 1462h80l-186 -876h-84l118 569q5 21 11.5 50.5t14 60t15.5 59 t15 49.5q-34 -31 -60 -51.5t-143 -93.5l-39 59z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1458" d="M53 0zM1278 1h-522l16 80l297 258q137 118 182.5 190.5t45.5 153.5q0 59 -38.5 97t-105.5 38q-95 0 -194 -76l-41 62q108 90 239 90q73 0 125 -27t78.5 -72t26.5 -100q0 -106 -59 -198.5t-183 -194.5l-266 -223h416zM431 1462h80l-186 -876h-84l118 569q5 21 11.5 50.5 t14 60t15.5 59t15 49.5q-34 -31 -60 -51.5t-143 -93.5l-39 59zM1247 1462l-1087 -1462h-107l1086 1462h108z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1458" d="M71 0zM1380 230h-131l-49 -229h-82l49 229h-391l21 76l506 577h86l-125 -581h133zM1182 302q61 294 79 365.5t29 105.5q-10 -16 -61 -79t-338 -392h291zM667 1276q0 -85 -48.5 -148t-154.5 -88v-4q66 -16 105.5 -68t39.5 -124q0 -77 -39 -141t-109 -99t-161 -35 q-59 0 -123.5 15.5t-105.5 40.5v90q46 -28 108 -48t125 -20q99 0 159 52.5t60 142.5q0 162 -196 162h-84l16 79h86q102 0 168.5 49.5t66.5 129.5q0 68 -37.5 102.5t-105.5 34.5q-100 0 -199 -68l-40 64q109 86 251 86q100 0 159 -56.5t59 -148.5zM1407 1462l-1087 -1462 h-107l1086 1462h108z" />
+<glyph unicode="&#xbf;" horiz-adv-x="799" d="M641 717l-6 -29q-28 -127 -79 -200t-161 -154q-118 -84 -175 -145.5t-86.5 -127.5t-29.5 -141q0 -106 65.5 -168.5t184.5 -62.5q141 0 308 100l38 -86q-85 -49 -170.5 -77.5t-187.5 -28.5q-159 0 -250.5 84.5t-91.5 228.5q0 133 70 240.5t227 220.5q85 61 133.5 109 t73 95t45.5 142h92zM713 1020q0 -56 -25.5 -88.5t-69.5 -32.5q-65 0 -65 72q0 56 25 89.5t67 33.5q68 0 68 -74z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM815 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM668 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM1007 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5 t92.5 -146.5v-29z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM911 1587q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5 q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM879 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM535 1704q0 49 20.5 78t56.5 29q54 0 54 -64 q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM945 1600q0 -92 -57.5 -148.5t-145.5 -56.5q-93 0 -148 52t-55 145q0 88 59.5 144t149.5 56q88 0 142.5 -50t54.5 -142zM867 1598 q0 57 -33.5 90t-87.5 33q-60 0 -93.5 -36t-33.5 -93t33 -90t90 -33q56 0 90.5 36t34.5 93z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1640" d="M1403 0h-727l110 522h-444l-328 -522h-131l946 1462h883l-20 -94h-625l-117 -553h590l-20 -94h-588l-135 -627h626zM408 627h401l156 741h-88z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1169" d="M170 0zM961 1389q-197 0 -351.5 -104.5t-245 -304.5t-90.5 -441q0 -225 110.5 -346t317.5 -121q140 0 304 51v-94q-156 -49 -316 -49q-252 0 -386 145t-134 410q0 266 104.5 488t284.5 341t402 119q177 0 307 -68l-45 -90q-55 30 -124.5 47t-137.5 17zM752 -289 q0 -94 -75.5 -148.5t-217.5 -54.5q-46 0 -78 7v79q30 -6 72 -6q198 0 198 115q0 97 -151 107l110 190h80l-78 -137q140 -30 140 -152z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM891 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM654 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xca;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM1036 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM902 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM558 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xcc;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM525 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM419 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xce;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM738 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xcf;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM604 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM260 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1352" d="M1288 879q0 -253 -109.5 -461.5t-300.5 -313t-446 -104.5h-330l144 676h-156l21 96h155l146 690h305q282 0 426.5 -147.5t144.5 -435.5zM430 90q226 0 394.5 94.5t261 275.5t92.5 412q0 498 -476 498h-206l-129 -598h378l-20 -96h-379l-125 -586h209z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1372" d="M102 0zM1069 0h-86l-516 1284h-8q-23 -149 -48 -273t-214 -1011h-95l310 1462h80l522 -1294h8q23 176 74 416l188 878h94zM1062 1587q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14 t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM989 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM844 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM1171 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM1077 1587q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z " />
+<glyph unicode="&#xd6;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM1031 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM687 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xd7;" d="M551 723l-330 332l70 69l330 -329l333 329l68 -67l-332 -334l332 -332l-68 -67l-333 329l-330 -327l-68 67z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1464" d="M1403 911q0 -187 -52 -365.5t-144.5 -304.5t-223 -193.5t-291.5 -67.5q-215 0 -348 112l-139 -170l-66 64l146 172q-113 149 -113 401q0 263 94 479.5t256.5 330.5t370.5 114q219 0 352 -121l133 168l70 -53l-145 -183q45 -51 72.5 -161t27.5 -222zM879 1389 q-134 0 -244 -59.5t-188.5 -170t-124.5 -267.5t-46 -319q0 -105 21.5 -191t56.5 -138l826 1032q-107 113 -301 113zM1294 901q0 85 -17.5 172t-43.5 129l-821 -1030q107 -100 293 -100q170 0 301 100t209.5 296.5t78.5 432.5z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM946 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303 v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM838 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5 t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM1148 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54 v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM1022 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29 q-55 0 -55 63zM678 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xdd;" horiz-adv-x="965" d="M193 0zM494 645l544 817h117l-631 -932l-108 -530h-105l119 545l-237 917h100zM563 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xde;" horiz-adv-x="1145" d="M1087 836q0 -247 -153 -373.5t-457 -126.5h-201l-71 -336h-103l310 1462h102l-57 -266h213q200 0 308.5 -92.5t108.5 -267.5zM293 428h190q256 0 376 98.5t120 302.5q0 275 -330 275h-211z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1094" d="M-162 -492q-73 0 -119 23v90q53 -24 115 -24q79 0 123 50.5t66 153.5l305 1409q80 357 405 357q137 0 215 -61.5t78 -174.5q0 -75 -44.5 -140.5t-166.5 -148.5q-107 -76 -141.5 -124.5t-34.5 -106.5q0 -51 34 -88.5t93 -75.5q96 -63 138 -133.5t42 -165.5 q0 -170 -106.5 -269t-286.5 -99q-143 0 -234 65v109q45 -36 112.5 -59t129.5 -23q132 0 208.5 71t76.5 195q0 75 -31.5 129t-109.5 108q-82 58 -119 110.5t-37 121.5q0 57 21 103t60.5 88.5t137.5 113.5q101 70 131.5 116t30.5 101q0 70 -55 110t-150 40q-129 0 -205 -76 t-108 -229l-291 -1377q-33 -152 -103.5 -220.5t-179.5 -68.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM809 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM586 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM955 1243h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM858 1249q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173 t-124.5 -55z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM835 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM491 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM927 1448q0 -92 -57.5 -148.5t-145.5 -56.5q-93 0 -148 52t-55 145q0 88 59.5 144t149.5 56q88 0 142.5 -50t54.5 -142zM849 1446q0 57 -33.5 90t-87.5 33q-60 0 -93.5 -36t-33.5 -93t33 -90t90 -33q56 0 90.5 36 t34.5 93z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1602" d="M1155 -20q-123 0 -211 60t-117 165l-39 -205h-77l41 254h-9q-94 -142 -189 -208t-208 -66q-120 0 -182 94t-62 270q0 206 70.5 384.5t192.5 277t274 98.5q106 0 166 -56.5t74 -156.5h10l59 192h66l-35 -186q139 207 350 207q112 0 175 -61.5t63 -172.5 q0 -179 -158.5 -271.5t-470.5 -92.5h-39q-8 -51 -8 -96q0 -161 69.5 -250.5t217.5 -89.5q69 0 133.5 21t130.5 52v-94q-80 -37 -147 -53t-140 -16zM369 70q67 0 138.5 42t134 117.5t106 170.5t63.5 199t20 165q0 118 -49 186t-141 68q-123 0 -223 -86t-156.5 -240 t-56.5 -340q0 -150 42.5 -216t121.5 -66zM1317 1018q-119 0 -232 -115.5t-172 -308.5h48q263 0 383 67t120 203q0 71 -38.5 112.5t-108.5 41.5z" />
+<glyph unicode="&#xe7;" horiz-adv-x="887" d="M102 0zM477 -20q-174 0 -274.5 110.5t-100.5 306.5q0 193 73.5 361.5t198.5 257t290 88.5q134 0 241 -43l-28 -90q-107 47 -218 47q-129 0 -232.5 -77t-162.5 -222t-59 -320q0 -158 73.5 -243.5t208.5 -85.5q71 0 131.5 13t131.5 46v-92q-116 -57 -273 -57zM574 -289 q0 -94 -75.5 -148.5t-217.5 -54.5q-46 0 -78 7v79q30 -6 72 -6q198 0 198 115q0 97 -151 107l110 190h80l-78 -137q140 -30 140 -152z" />
+<glyph unicode="&#xe8;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM751 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM532 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xea;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM904 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xeb;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM780 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM436 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xec;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM454 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM284 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xee;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM642 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xef;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM515 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM171 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1124" d="M713 1364q-54 60 -158 139l59 68q32 -26 81 -66t100 -94l266 150l39 -74l-256 -141q87 -116 131.5 -276t44.5 -335q0 -355 -141.5 -555t-399.5 -200q-177 0 -277 106.5t-100 294.5q0 170 63 301.5t178.5 203.5t262.5 72q107 0 188 -49.5t121 -142.5h5q0 139 -43 289 t-115 243l-295 -163l-39 73zM489 70q118 0 208.5 61t144 186.5t53.5 270.5q0 77 -35 142t-100 101.5t-156 36.5q-124 0 -213.5 -61.5t-137.5 -169.5t-48 -248q0 -153 73.5 -236t210.5 -83z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1143" d="M76 0zM764 0l149 692q21 92 21 156q0 80 -43.5 125t-134.5 45q-112 0 -210.5 -67t-166 -187.5t-103.5 -286.5l-102 -477h-98l231 1087h82l-37 -221h6q164 238 416 238q130 0 195 -64t65 -184q0 -70 -24 -182l-148 -674h-98zM874 1249q-40 0 -77.5 19t-75.5 45 q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM744 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM573 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM941 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM839 1249q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM812 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM468 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xf7;" d="M168 672v100h903v-100h-903zM522 373q0 106 96 106q48 0 73.5 -27.5t25.5 -78.5q0 -57 -29 -82t-70 -25q-96 0 -96 107zM522 1071q0 107 96 107q46 0 72.5 -27.5t26.5 -79.5q0 -57 -29 -81.5t-70 -24.5q-96 0 -96 106z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1124" d="M164 127q-66 106 -66 276q0 191 73 358t197 257t281 90q150 0 250 -82l109 133l65 -53l-117 -143q70 -105 70 -263q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-163 0 -254 83l-110 -135l-64 54zM924 702q0 101 -35 179l-608 -742q67 -73 202 -73q127 0 225.5 77.5 t157 228t58.5 330.5zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -125 32 -197l605 739q-74 72 -197 72z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM774 1241h-66q-50 52 -114 144.5 t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM627 1262q66 51 150.5 142 t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM957 1241h-49q-70 60 -161 207 q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM827 1366q0 49 20.5 78t56.5 29 q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM483 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xfd;" horiz-adv-x="920" d="M0 0zM123 1087h100l82 -548q51 -351 55 -449h11q43 105 186 367l348 630h103l-713 -1290q-72 -127 -122.5 -178t-114 -81t-146.5 -30q-68 0 -129 21v92q71 -27 137 -27q80 0 147 49.5t130 164.5t100 184zM505 1262q66 51 150.5 142t129.5 165h137v-23 q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1163" d="M498 -16q-230 0 -279 219h-4q-13 -72 -149 -695h-99l434 2048h99q-114 -535 -164 -751h6q93 156 199 229.5t231 73.5q133 0 206 -92.5t73 -282.5q0 -195 -72 -371t-197.5 -277t-283.5 -101zM748 1018q-86 0 -172.5 -57.5t-162.5 -169.5t-111.5 -238t-35.5 -207 q0 -125 61.5 -200.5t168.5 -75.5q124 0 225 84t164 243.5t63 325.5q0 295 -200 295z" />
+<glyph unicode="&#xff;" horiz-adv-x="920" d="M0 0zM123 1087h100l82 -548q51 -351 55 -449h11q43 105 186 367l348 630h103l-713 -1290q-72 -127 -122.5 -178t-114 -81t-146.5 -30q-68 0 -129 21v92q71 -27 137 -27q80 0 147 49.5t130 164.5t100 184zM698 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77 t-55 -29q-55 0 -55 63zM354 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#x131;" horiz-adv-x="475" d="M174 0h-98l231 1087h96z" />
+<glyph unicode="&#x152;" horiz-adv-x="1767" d="M1530 0h-666q-25 -6 -77.5 -13t-94.5 -7q-251 0 -385.5 149.5t-134.5 429.5q0 263 96 482t262 330.5t381 111.5q130 0 240 -21h688l-20 -94h-625l-117 -553h590l-20 -94h-588l-135 -627h626zM705 72q68 0 116 12l271 1290q-110 15 -189 15q-182 0 -321.5 -98.5 t-222.5 -293.5t-83 -424q0 -245 109 -373t320 -128z" />
+<glyph unicode="&#x153;" horiz-adv-x="1720" d="M1262 -20q-135 0 -228 69t-125 201q-65 -127 -179 -198.5t-257 -71.5q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90q141 0 237 -74.5t126 -212.5q70 132 182.5 207.5t241.5 75.5q114 0 182 -61t68 -166q0 -181 -163.5 -276t-486.5 -95h-32 q-7 -38 -7 -98q0 -165 74 -251.5t213 -86.5q133 0 277 73v-94q-140 -69 -299 -69zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5q0 154 -73 237t-210 83zM1423 1018q-131 0 -243 -115t-162 -309h49q516 0 516 270 q0 70 -44.5 112t-115.5 42z" />
+<glyph unicode="&#x178;" horiz-adv-x="965" d="M193 0zM494 645l544 817h117l-631 -932l-108 -530h-105l119 545l-237 917h100zM798 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM454 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1135" d="M958 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M967 1448q0 -92 -57.5 -148.5t-145.5 -56.5q-93 0 -148 52t-55 145q0 88 59.5 144t149.5 56q88 0 142.5 -50t54.5 -142zM889 1446q0 57 -33.5 90t-87.5 33q-60 0 -93.5 -36t-33.5 -93t33 -90t90 -33q56 0 90.5 36t34.5 93z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1135" d="M831 1249q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#x2011;" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#x2012;" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M66 502l18 90h807l-17 -90h-808z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1966" d="M68 502l18 90h1788l-16 -90h-1790z" />
+<glyph unicode="&#x2018;" horiz-adv-x="299" d="M133 961l-4 22q41 100 116 231t161 248h73q-66 -106 -129.5 -242.5t-103.5 -258.5h-113z" />
+<glyph unicode="&#x2019;" horiz-adv-x="299" d="M475 1462l4 -22q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 106 129.5 242.5t103.5 258.5h113z" />
+<glyph unicode="&#x201a;" horiz-adv-x="451" d="M246 238l4 -23q-40 -97 -115.5 -230t-161.5 -249h-73q68 110 131.5 248t101.5 254h113z" />
+<glyph unicode="&#x201c;" horiz-adv-x="631" d="M133 961l-4 22q41 100 116 231t161 248h73q-66 -106 -129.5 -242.5t-103.5 -258.5h-113zM467 961l-4 22q43 104 120 238.5t156 240.5h74q-66 -106 -129.5 -242.5t-103.5 -258.5h-113z" />
+<glyph unicode="&#x201d;" horiz-adv-x="631" d="M809 1462l4 -22q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 106 129.5 242.5t103.5 258.5h113zM475 1462l4 -22q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 106 129.5 242.5t103.5 258.5h113z" />
+<glyph unicode="&#x201e;" horiz-adv-x="776" d="M561 238l4 -23q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 108 129 242.5t105 259.5h112zM227 238l4 -23q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q73 119 135.5 254.5t98.5 247.5h112z" />
+<glyph unicode="&#x2022;" horiz-adv-x="793" d="M248 682q0 137 63 213t172 76q76 0 116 -39.5t40 -118.5q0 -125 -66 -207t-176 -82q-149 0 -149 158z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1489" d="M69 0zM69 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73zM569 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73zM1071 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="537" d="M451 932l57 -49l-318 -336l213 -385l-63 -39l-254 418l2 26z" />
+<glyph unicode="&#x203a;" horiz-adv-x="537" d="M94 123l-57 49l317 336l-213 385l64 39l254 -418l-2 -27z" />
+<glyph unicode="&#x2044;" horiz-adv-x="274" d="M731 1462l-1087 -1462h-107l1086 1462h108z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="643" d="M657 815h-131l-49 -229h-82l49 229h-391l21 76l506 577h86l-125 -581h133zM459 887q61 294 79 365.5t29 105.5q-10 -16 -61 -79t-338 -392h291z" />
+<glyph unicode="&#x20ac;" d="M991 1389q-186 0 -330.5 -120.5t-226.5 -346.5h457l-21 -82h-460q-30 -98 -39 -217h442l-20 -82h-424q0 -243 89 -356t265 -113q115 0 252 57v-94q-129 -55 -270 -55q-209 0 -325 139.5t-116 394.5v27h-184l16 82h172q5 101 35 217h-170l19 82h174q95 273 270 417 t399 144q166 0 287 -90l-53 -82q-102 78 -238 78z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M477 741h-86v643h-217v78h522v-78h-219v-643zM1077 741l-221 609h-6l4 -201v-408h-82v721h125l221 -606l223 606h125v-721h-86v398l4 207h-6l-227 -605h-74z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1085" d="M0 1085h1085v-1085h-1085v1085z" />
+<glyph horiz-adv-x="1133" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+<hkern g1="uniFB00" u2="&#x201d;" k="-123" />
+<hkern g1="uniFB00" u2="&#x2019;" k="-123" />
+<hkern g1="uniFB00" u2="&#x27;" k="-123" />
+<hkern g1="uniFB00" u2="&#x22;" k="-123" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff
new file mode 100644 (file)
index 0000000..43e8b9e
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot
new file mode 100644 (file)
index 0000000..6bbc3cf
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.svg b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.svg
new file mode 100644 (file)
index 0000000..25a3952
--- /dev/null
@@ -0,0 +1,1831 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansregular" horiz-adv-x="1171" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1212" d="M29 0zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1036 0h-166v1096h166v-1096zM856 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5 q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1212" d="M29 0zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1036 0h-166v1556h166v-1556z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1909" d="M29 0zM1358 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31 q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1731 0h-166v1096h166v-1096zM1551 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1909" d="M29 0zM1358 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31 q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1731 0h-166v1556h166v-1556z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="547" d="M326 403h-105l-51 1059h207zM152 106q0 136 120 136q58 0 89.5 -35t31.5 -101q0 -64 -32 -99.5t-89 -35.5q-52 0 -86 31.5t-34 103.5z" />
+<glyph unicode="&#x22;" horiz-adv-x="821" d="M319 1462l-40 -528h-105l-41 528h186zM688 1462l-41 -528h-104l-41 528h186z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M981 899l-66 -340h283v-129h-307l-84 -430h-137l84 430h-303l-82 -430h-136l80 430h-262v129h287l68 340h-277v127h299l82 436h139l-82 -436h305l84 436h134l-84 -436h264v-127h-289zM475 559h303l66 340h-303z" />
+<glyph unicode="$" d="M1036 449q0 -136 -102 -224.5t-285 -111.5v-232h-129v223q-112 0 -217 17.5t-172 48.5v156q83 -37 191.5 -60.5t197.5 -23.5v440q-205 65 -287.5 151t-82.5 222q0 131 101.5 215t268.5 102v182h129v-180q184 -5 355 -74l-52 -131q-149 59 -303 70v-434q157 -50 235 -97.5 t115 -109t37 -149.5zM866 436q0 72 -44.5 116.5t-172.5 88.5v-389q217 30 217 184zM319 1057q0 -76 45 -122t156 -87v387q-99 -16 -150 -62.5t-51 -115.5z" />
+<glyph unicode="%" horiz-adv-x="1686" d="M242 1026q0 -170 37 -255t120 -85q164 0 164 340q0 338 -164 338q-83 0 -120 -84t-37 -254zM700 1026q0 -228 -76.5 -344.5t-224.5 -116.5q-140 0 -217.5 119t-77.5 342q0 227 74.5 342t220.5 115q145 0 223 -119t78 -338zM1122 440q0 -171 37 -255.5t121 -84.5t124 83.5 t40 256.5q0 171 -40 253.5t-124 82.5t-121 -82.5t-37 -253.5zM1581 440q0 -227 -76.5 -343.5t-224.5 -116.5q-142 0 -218.5 119t-76.5 341q0 227 74.5 342t220.5 115q142 0 221.5 -117.5t79.5 -339.5zM1323 1462l-811 -1462h-147l811 1462h147z" />
+<glyph unicode="&#x26;" horiz-adv-x="1495" d="M414 1171q0 -69 36 -131.5t123 -150.5q129 75 179.5 138.5t50.5 146.5q0 77 -51.5 125.5t-137.5 48.5q-89 0 -144.5 -48t-55.5 -129zM569 129q241 0 400 154l-437 424q-111 -68 -157 -112.5t-68 -95.5t-22 -116q0 -117 77.5 -185.5t206.5 -68.5zM113 379q0 130 69.5 230 t249.5 202q-85 95 -115.5 144t-48.5 102t-18 110q0 150 98 234t273 84q162 0 255 -83.5t93 -232.5q0 -107 -68 -197.5t-225 -183.5l407 -391q56 62 89.5 145.5t56.5 182.5h168q-68 -286 -205 -434l299 -291h-229l-185 178q-118 -106 -240 -152t-272 -46q-215 0 -333.5 106 t-118.5 293z" />
+<glyph unicode="'" horiz-adv-x="453" d="M319 1462l-40 -528h-105l-41 528h186z" />
+<glyph unicode="(" horiz-adv-x="606" d="M82 561q0 265 77.5 496t223.5 405h162q-144 -193 -216.5 -424t-72.5 -475q0 -240 74 -469t213 -418h-160q-147 170 -224 397t-77 488z" />
+<glyph unicode=")" horiz-adv-x="606" d="M524 561q0 -263 -77.5 -490t-223.5 -395h-160q139 188 213 417.5t74 469.5q0 244 -72.5 475t-216.5 424h162q147 -175 224 -406.5t77 -494.5z" />
+<glyph unicode="*" horiz-adv-x="1130" d="M657 1556l-43 -395l398 111l26 -182l-381 -31l248 -326l-172 -94l-176 362l-160 -362l-176 94l242 326l-377 31l29 182l391 -111l-43 395h194z" />
+<glyph unicode="+" d="M653 791h412v-138h-412v-426h-139v426h-410v138h410v428h139v-428z" />
+<glyph unicode="," horiz-adv-x="502" d="M350 238l15 -23q-26 -100 -75 -232.5t-102 -246.5h-125q27 104 59.5 257t45.5 245h182z" />
+<glyph unicode="-" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="." horiz-adv-x="545" d="M152 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode="/" horiz-adv-x="752" d="M731 1462l-545 -1462h-166l545 1462h166z" />
+<glyph unicode="0" d="M1069 733q0 -379 -119.5 -566t-365.5 -187q-236 0 -359 191.5t-123 561.5q0 382 119 567t363 185q238 0 361.5 -193t123.5 -559zM270 733q0 -319 75 -464.5t239 -145.5q166 0 240.5 147.5t74.5 462.5t-74.5 461.5t-240.5 146.5q-164 0 -239 -144.5t-75 -463.5z" />
+<glyph unicode="1" d="M715 0h-162v1042q0 130 8 246q-21 -21 -47 -44t-238 -195l-88 114l387 299h140v-1462z" />
+<glyph unicode="2" d="M1061 0h-961v143l385 387q176 178 232 254t84 148t28 155q0 117 -71 185.5t-197 68.5q-91 0 -172.5 -30t-181.5 -109l-88 113q202 168 440 168q206 0 323 -105.5t117 -283.5q0 -139 -78 -275t-292 -344l-320 -313v-8h752v-154z" />
+<glyph unicode="3" d="M1006 1118q0 -140 -78.5 -229t-222.5 -119v-8q176 -22 261 -112t85 -236q0 -209 -145 -321.5t-412 -112.5q-116 0 -212.5 17.5t-187.5 61.5v158q95 -47 202.5 -71.5t203.5 -24.5q379 0 379 297q0 266 -418 266h-144v143h146q171 0 271 75.5t100 209.5q0 107 -73.5 168 t-199.5 61q-96 0 -181 -26t-194 -96l-84 112q90 71 207.5 111.5t247.5 40.5q213 0 331 -97.5t118 -267.5z" />
+<glyph unicode="4" d="M1130 336h-217v-336h-159v336h-711v145l694 989h176v-983h217v-151zM754 487v486q0 143 10 323h-8q-48 -96 -90 -159l-457 -650h545z" />
+<glyph unicode="5" d="M557 893q231 0 363.5 -114.5t132.5 -313.5q0 -227 -144.5 -356t-398.5 -129q-247 0 -377 79v160q70 -45 174 -70.5t205 -25.5q176 0 273.5 83t97.5 240q0 306 -375 306q-95 0 -254 -29l-86 55l55 684h727v-153h-585l-37 -439q115 23 229 23z" />
+<glyph unicode="6" d="M117 625q0 431 167.5 644.5t495.5 213.5q113 0 178 -19v-143q-77 25 -176 25q-235 0 -359 -146.5t-136 -460.5h12q110 172 348 172q197 0 310.5 -119t113.5 -323q0 -228 -124.5 -358.5t-336.5 -130.5q-227 0 -360 170.5t-133 474.5zM608 121q142 0 220.5 89.5t78.5 258.5 q0 145 -73 228t-218 83q-90 0 -165 -37t-119.5 -102t-44.5 -135q0 -103 40 -192t113.5 -141t167.5 -52z" />
+<glyph unicode="7" d="M285 0l606 1309h-797v153h973v-133l-598 -1329h-184z" />
+<glyph unicode="8" d="M584 1483q200 0 317 -93t117 -257q0 -108 -67 -197t-214 -162q178 -85 253 -178.5t75 -216.5q0 -182 -127 -290.5t-348 -108.5q-234 0 -360 102.5t-126 290.5q0 251 306 391q-138 78 -198 168.5t-60 202.5q0 159 117.5 253.5t314.5 94.5zM268 369q0 -120 83.5 -187 t234.5 -67q149 0 232 70t83 192q0 97 -78 172.5t-272 146.5q-149 -64 -216 -141.5t-67 -185.5zM582 1348q-125 0 -196 -60t-71 -160q0 -92 59 -158t218 -132q143 60 202.5 129t59.5 161q0 101 -72.5 160.5t-199.5 59.5z" />
+<glyph unicode="9" d="M1061 838q0 -858 -664 -858q-116 0 -184 20v143q80 -26 182 -26q240 0 362.5 148.5t133.5 455.5h-12q-55 -83 -146 -126.5t-205 -43.5q-194 0 -308 116t-114 324q0 228 127.5 360t335.5 132q149 0 260.5 -76.5t171.5 -223t60 -345.5zM569 1341q-143 0 -221 -92t-78 -256 q0 -144 72 -226.5t219 -82.5q91 0 167.5 37t120.5 101t44 134q0 105 -41 194t-114.5 140t-168.5 51z" />
+<glyph unicode=":" horiz-adv-x="545" d="M152 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5zM152 989q0 135 118 135q123 0 123 -135q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode=";" horiz-adv-x="545" d="M350 238l15 -23q-26 -100 -75 -232.5t-102 -246.5h-125q27 104 59.5 257t45.5 245h182zM147 989q0 135 119 135q123 0 123 -135q0 -65 -33 -100t-90 -35q-58 0 -88.5 35t-30.5 100z" />
+<glyph unicode="&#x3c;" d="M1065 242l-961 422v98l961 479v-149l-782 -371l782 -328v-151z" />
+<glyph unicode="=" d="M119 858v137h930v-137h-930zM119 449v137h930v-137h-930z" />
+<glyph unicode="&#x3e;" d="M104 393l783 326l-783 373v149l961 -479v-98l-961 -422v151z" />
+<glyph unicode="?" horiz-adv-x="879" d="M289 403v54q0 117 36 192.5t134 159.5q136 115 171.5 173t35.5 140q0 102 -65.5 157.5t-188.5 55.5q-79 0 -154 -18.5t-172 -67.5l-59 135q189 99 395 99q191 0 297 -94t106 -265q0 -73 -19.5 -128.5t-57.5 -105t-164 -159.5q-101 -86 -133.5 -143t-32.5 -152v-33h-129z M240 106q0 136 120 136q58 0 89.5 -35t31.5 -101q0 -64 -32 -99.5t-89 -35.5q-52 0 -86 31.5t-34 103.5z" />
+<glyph unicode="@" horiz-adv-x="1841" d="M1720 729q0 -142 -44 -260t-124 -183t-184 -65q-86 0 -145 52t-70 133h-8q-40 -87 -114.5 -136t-176.5 -49q-150 0 -234.5 102.5t-84.5 278.5q0 204 118 331.5t310 127.5q68 0 154 -12.5t155 -34.5l-25 -470v-22q0 -178 133 -178q91 0 148 107.5t57 279.5q0 181 -74 317 t-210.5 209.5t-313.5 73.5q-223 0 -388 -92.5t-252 -264t-87 -396.5q0 -305 161 -469t464 -164q210 0 436 86v-133q-192 -84 -436 -84q-363 0 -563.5 199.5t-200.5 557.5q0 260 107 463t305 314.5t454 111.5q215 0 382.5 -90.5t259 -257t91.5 -383.5zM686 598 q0 -254 195 -254q207 0 225 313l14 261q-72 20 -157 20q-130 0 -203.5 -90t-73.5 -250z" />
+<glyph unicode="A" horiz-adv-x="1296" d="M1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473z" />
+<glyph unicode="B" horiz-adv-x="1327" d="M201 1462h413q291 0 421 -87t130 -275q0 -130 -72.5 -214.5t-211.5 -109.5v-10q333 -57 333 -350q0 -196 -132.5 -306t-370.5 -110h-510v1462zM371 836h280q180 0 259 56.5t79 190.5q0 123 -88 177.5t-280 54.5h-250v-479zM371 692v-547h305q177 0 266.5 68.5t89.5 214.5 q0 136 -91.5 200t-278.5 64h-291z" />
+<glyph unicode="C" horiz-adv-x="1292" d="M827 1331q-241 0 -380.5 -160.5t-139.5 -439.5q0 -287 134.5 -443.5t383.5 -156.5q153 0 349 55v-149q-152 -57 -375 -57q-323 0 -498.5 196t-175.5 557q0 226 84.5 396t244 262t375.5 92q230 0 402 -84l-72 -146q-166 78 -332 78z" />
+<glyph unicode="D" horiz-adv-x="1493" d="M1368 745q0 -362 -196.5 -553.5t-565.5 -191.5h-405v1462h448q341 0 530 -189t189 -528zM1188 739q0 286 -143.5 431t-426.5 145h-247v-1168h207q304 0 457 149.5t153 442.5z" />
+<glyph unicode="E" horiz-adv-x="1139" d="M1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152z" />
+<glyph unicode="F" horiz-adv-x="1057" d="M371 0h-170v1462h815v-151h-645v-535h606v-151h-606v-625z" />
+<glyph unicode="G" horiz-adv-x="1491" d="M844 766h497v-711q-116 -37 -236 -56t-278 -19q-332 0 -517 197.5t-185 553.5q0 228 91.5 399.5t263.5 262t403 90.5q234 0 436 -86l-66 -150q-198 84 -381 84q-267 0 -417 -159t-150 -441q0 -296 144.5 -449t424.5 -153q152 0 297 35v450h-327v152z" />
+<glyph unicode="H" horiz-adv-x="1511" d="M1311 0h-170v688h-770v-688h-170v1462h170v-622h770v622h170v-1462z" />
+<glyph unicode="I" horiz-adv-x="571" d="M201 0v1462h170v-1462h-170z" />
+<glyph unicode="J" horiz-adv-x="547" d="M-12 -385q-94 0 -148 27v145q71 -20 148 -20q99 0 150.5 60t51.5 173v1462h170v-1448q0 -190 -96 -294.5t-276 -104.5z" />
+<glyph unicode="K" horiz-adv-x="1257" d="M1257 0h-200l-533 709l-153 -136v-573h-170v1462h170v-725l663 725h201l-588 -635z" />
+<glyph unicode="L" horiz-adv-x="1063" d="M201 0v1462h170v-1308h645v-154h-815z" />
+<glyph unicode="M" horiz-adv-x="1849" d="M848 0l-496 1296h-8q14 -154 14 -366v-930h-157v1462h256l463 -1206h8l467 1206h254v-1462h-170v942q0 162 14 352h-8l-500 -1294h-137z" />
+<glyph unicode="N" horiz-adv-x="1544" d="M1343 0h-194l-799 1227h-8q16 -216 16 -396v-831h-157v1462h192l797 -1222h8q-2 27 -9 173.5t-5 209.5v839h159v-1462z" />
+<glyph unicode="O" horiz-adv-x="1595" d="M1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5z" />
+<glyph unicode="P" horiz-adv-x="1233" d="M1128 1036q0 -222 -151.5 -341.5t-433.5 -119.5h-172v-575h-170v1462h379q548 0 548 -426zM371 721h153q226 0 327 73t101 234q0 145 -95 216t-296 71h-190v-594z" />
+<glyph unicode="Q" horiz-adv-x="1595" d="M1470 733q0 -281 -113 -467t-319 -252l348 -362h-247l-285 330l-55 -2q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5 q-243 0 -369.5 -153.5t-126.5 -446.5z" />
+<glyph unicode="R" horiz-adv-x="1266" d="M371 608v-608h-170v1462h401q269 0 397.5 -103t128.5 -310q0 -290 -294 -392l397 -657h-201l-354 608h-305zM371 754h233q180 0 264 71.5t84 214.5q0 145 -85.5 209t-274.5 64h-221v-559z" />
+<glyph unicode="S" horiz-adv-x="1124" d="M1026 389q0 -193 -140 -301t-380 -108q-260 0 -400 67v164q90 -38 196 -60t210 -22q170 0 256 64.5t86 179.5q0 76 -30.5 124.5t-102 89.5t-217.5 93q-204 73 -291.5 173t-87.5 261q0 169 127 269t336 100q218 0 401 -80l-53 -148q-181 76 -352 76q-135 0 -211 -58 t-76 -161q0 -76 28 -124.5t94.5 -89t203.5 -89.5q230 -82 316.5 -176t86.5 -244z" />
+<glyph unicode="T" horiz-adv-x="1133" d="M651 0h-170v1311h-463v151h1096v-151h-463v-1311z" />
+<glyph unicode="U" horiz-adv-x="1491" d="M1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170z" />
+<glyph unicode="V" horiz-adv-x="1219" d="M1036 1462h183l-527 -1462h-168l-524 1462h180l336 -946q58 -163 92 -317q36 162 94 323z" />
+<glyph unicode="W" horiz-adv-x="1896" d="M1477 0h-168l-295 979q-21 65 -47 164t-27 119q-22 -132 -70 -289l-286 -973h-168l-389 1462h180l231 -903q48 -190 70 -344q27 183 80 358l262 889h180l275 -897q48 -155 81 -350q19 142 72 346l230 901h180z" />
+<glyph unicode="X" horiz-adv-x="1182" d="M1174 0h-193l-393 643l-400 -643h-180l486 764l-453 698h188l363 -579l366 579h181l-453 -692z" />
+<glyph unicode="Y" horiz-adv-x="1147" d="M573 731l390 731h184l-488 -895v-567h-172v559l-487 903h186z" />
+<glyph unicode="Z" horiz-adv-x="1169" d="M1087 0h-1005v133l776 1176h-752v153h959v-133l-776 -1175h798v-154z" />
+<glyph unicode="[" horiz-adv-x="674" d="M623 -324h-457v1786h457v-141h-289v-1503h289v-142z" />
+<glyph unicode="\" horiz-adv-x="752" d="M186 1462l547 -1462h-166l-544 1462h163z" />
+<glyph unicode="]" horiz-adv-x="674" d="M51 -182h289v1503h-289v141h457v-1786h-457v142z" />
+<glyph unicode="^" horiz-adv-x="1110" d="M49 551l434 922h99l477 -922h-152l-372 745l-334 -745h-152z" />
+<glyph unicode="_" horiz-adv-x="918" d="M922 -315h-926v131h926v-131z" />
+<glyph unicode="`" horiz-adv-x="1182" d="M786 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="a" horiz-adv-x="1139" d="M850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85t88.5 238 v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47z" />
+<glyph unicode="b" horiz-adv-x="1255" d="M686 1114q216 0 335.5 -147.5t119.5 -417.5t-120.5 -419.5t-334.5 -149.5q-107 0 -195.5 39.5t-148.5 121.5h-12l-35 -141h-119v1556h166v-378q0 -127 -8 -228h8q116 164 344 164zM662 975q-170 0 -245 -97.5t-75 -328.5t77 -330.5t247 -99.5q153 0 228 111.5t75 320.5 q0 214 -75 319t-232 105z" />
+<glyph unicode="c" horiz-adv-x="975" d="M614 -20q-238 0 -368.5 146.5t-130.5 414.5q0 275 132.5 425t377.5 150q79 0 158 -17t124 -40l-51 -141q-55 22 -120 36.5t-115 14.5q-334 0 -334 -426q0 -202 81.5 -310t241.5 -108q137 0 281 59v-147q-110 -57 -277 -57z" />
+<glyph unicode="d" horiz-adv-x="1255" d="M922 147h-9q-115 -167 -344 -167q-215 0 -334.5 147t-119.5 418t120 421t334 150q223 0 342 -162h13l-7 79l-4 77v446h166v-1556h-135zM590 119q170 0 246.5 92.5t76.5 298.5v35q0 233 -77.5 332.5t-247.5 99.5q-146 0 -223.5 -113.5t-77.5 -320.5q0 -210 77 -317 t226 -107z" />
+<glyph unicode="e" horiz-adv-x="1149" d="M639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5t-200 83.5z " />
+<glyph unicode="f" horiz-adv-x="694" d="M670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129z" />
+<glyph unicode="g" horiz-adv-x="1122" d="M1073 1096v-105l-203 -24q28 -35 50 -91.5t22 -127.5q0 -161 -110 -257t-302 -96q-49 0 -92 8q-106 -56 -106 -141q0 -45 37 -66.5t127 -21.5h194q178 0 273.5 -75t95.5 -218q0 -182 -146 -277.5t-426 -95.5q-215 0 -331.5 80t-116.5 226q0 100 64 173t180 99 q-42 19 -70.5 59t-28.5 93q0 60 32 105t101 87q-85 35 -138.5 119t-53.5 192q0 180 108 277.5t306 97.5q86 0 155 -20h379zM199 -184q0 -89 75 -135t215 -46q209 0 309.5 62.5t100.5 169.5q0 89 -55 123.5t-207 34.5h-199q-113 0 -176 -54t-63 -155zM289 745q0 -115 65 -174 t181 -59q243 0 243 236q0 247 -246 247q-117 0 -180 -63t-63 -187z" />
+<glyph unicode="h" horiz-adv-x="1257" d="M926 0v709q0 134 -61 200t-191 66q-173 0 -252.5 -94t-79.5 -308v-573h-166v1556h166v-471q0 -85 -8 -141h10q49 79 139.5 124.5t206.5 45.5q201 0 301.5 -95.5t100.5 -303.5v-715h-166z" />
+<glyph unicode="i" horiz-adv-x="518" d="M342 0h-166v1096h166v-1096zM162 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="j" horiz-adv-x="518" d="M43 -492q-95 0 -154 25v135q69 -20 136 -20q78 0 114.5 42.5t36.5 129.5v1276h166v-1264q0 -324 -299 -324zM162 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="k" horiz-adv-x="1075" d="M340 561q43 61 131 160l354 375h197l-444 -467l475 -629h-201l-387 518l-125 -108v-410h-164v1556h164v-825q0 -55 -8 -170h8z" />
+<glyph unicode="l" horiz-adv-x="518" d="M342 0h-166v1556h166v-1556z" />
+<glyph unicode="m" horiz-adv-x="1905" d="M1573 0v713q0 131 -56 196.5t-174 65.5q-155 0 -229 -89t-74 -274v-612h-166v713q0 131 -56 196.5t-175 65.5q-156 0 -228.5 -93.5t-72.5 -306.5v-575h-166v1096h135l27 -150h8q47 80 132.5 125t191.5 45q257 0 336 -186h8q49 86 142 136t212 50q186 0 278.5 -95.5 t92.5 -305.5v-715h-166z" />
+<glyph unicode="n" horiz-adv-x="1257" d="M926 0v709q0 134 -61 200t-191 66q-172 0 -252 -93t-80 -307v-575h-166v1096h135l27 -150h8q51 81 143 125.5t205 44.5q198 0 298 -95.5t100 -305.5v-715h-166z" />
+<glyph unicode="o" horiz-adv-x="1237" d="M1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z" />
+<glyph unicode="p" horiz-adv-x="1255" d="M686 -20q-107 0 -195.5 39.5t-148.5 121.5h-12q12 -96 12 -182v-451h-166v1588h135l23 -150h8q64 90 149 130t195 40q218 0 336.5 -149t118.5 -418q0 -270 -120.5 -419.5t-334.5 -149.5zM662 975q-168 0 -243 -93t-77 -296v-37q0 -231 77 -330.5t247 -99.5 q142 0 222.5 115t80.5 317q0 205 -80.5 314.5t-226.5 109.5z" />
+<glyph unicode="q" horiz-adv-x="1255" d="M590 119q166 0 242 89t81 300v37q0 230 -78 331t-247 101q-146 0 -223.5 -113.5t-77.5 -320.5t76.5 -315.5t226.5 -108.5zM565 -20q-212 0 -331 149t-119 416q0 269 120 420t334 151q225 0 346 -170h9l24 150h131v-1588h-166v469q0 100 11 170h-13q-115 -167 -346 -167z " />
+<glyph unicode="r" horiz-adv-x="836" d="M676 1116q73 0 131 -12l-23 -154q-68 15 -120 15q-133 0 -227.5 -108t-94.5 -269v-588h-166v1096h137l19 -203h8q61 107 147 165t189 58z" />
+<glyph unicode="s" horiz-adv-x="977" d="M883 299q0 -153 -114 -236t-320 -83q-218 0 -340 69v154q79 -40 169.5 -63t174.5 -23q130 0 200 41.5t70 126.5q0 64 -55.5 109.5t-216.5 107.5q-153 57 -217.5 99.5t-96 96.5t-31.5 129q0 134 109 211.5t299 77.5q177 0 346 -72l-59 -135q-165 68 -299 68 q-118 0 -178 -37t-60 -102q0 -44 22.5 -75t72.5 -59t192 -81q195 -71 263.5 -143t68.5 -181z" />
+<glyph unicode="t" horiz-adv-x="723" d="M530 117q44 0 85 6.5t65 13.5v-127q-27 -13 -79.5 -21.5t-94.5 -8.5q-318 0 -318 335v652h-157v80l157 69l70 234h96v-254h318v-129h-318v-645q0 -99 47 -152t129 -53z" />
+<glyph unicode="u" horiz-adv-x="1257" d="M332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168z" />
+<glyph unicode="v" horiz-adv-x="1026" d="M416 0l-416 1096h178l236 -650q80 -228 94 -296h8q11 53 69.5 219.5t262.5 726.5h178l-416 -1096h-194z" />
+<glyph unicode="w" horiz-adv-x="1593" d="M1071 0l-201 643q-19 59 -71 268h-8q-40 -175 -70 -270l-207 -641h-192l-299 1096h174q106 -413 161.5 -629t63.5 -291h8q11 57 35.5 147.5t42.5 143.5l201 629h180l196 -629q56 -172 76 -289h8q4 36 21.5 111t208.5 807h172l-303 -1096h-197z" />
+<glyph unicode="x" horiz-adv-x="1073" d="M440 561l-381 535h189l289 -420l288 420h187l-381 -535l401 -561h-188l-307 444l-310 -444h-188z" />
+<glyph unicode="y" horiz-adv-x="1032" d="M2 1096h178l240 -625q79 -214 98 -309h8q13 51 54.5 174.5t271.5 759.5h178l-471 -1248q-70 -185 -163.5 -262.5t-229.5 -77.5q-76 0 -150 17v133q55 -12 123 -12q171 0 244 192l61 156z" />
+<glyph unicode="z" horiz-adv-x="958" d="M877 0h-795v113l598 854h-561v129h743v-129l-590 -838h605v-129z" />
+<glyph unicode="{" horiz-adv-x="776" d="M475 12q0 -102 58.5 -148t171.5 -48v-140q-190 2 -294 87t-104 239v303q0 104 -63 148.5t-183 44.5v141q130 2 188 48t58 142v306q0 155 108 241t290 86v-139q-230 -6 -230 -199v-295q0 -215 -223 -254v-12q223 -39 223 -254v-297z" />
+<glyph unicode="|" horiz-adv-x="1128" d="M494 1556h141v-2052h-141v2052z" />
+<glyph unicode="}" horiz-adv-x="776" d="M522 575q-223 39 -223 254v295q0 193 -227 199v139q184 0 289.5 -87t105.5 -240v-306q0 -97 59 -142.5t189 -47.5v-141q-122 0 -185 -44.5t-63 -148.5v-303q0 -153 -102.5 -238.5t-292.5 -87.5v140q111 2 169 48t58 148v297q0 114 55 174t168 80v12z" />
+<glyph unicode="~" d="M338 713q-53 0 -116.5 -33.5t-117.5 -87.5v151q100 109 244 109q68 0 124.5 -14t145.5 -52q66 -28 115 -41.5t96 -13.5q54 0 118 32t118 89v-150q-102 -110 -244 -110q-72 0 -135 16.5t-135 48.5q-75 32 -120 44t-93 12z" />
+<glyph unicode="&#xa1;" horiz-adv-x="547" d="M219 684h105l51 -1057h-207zM393 983q0 -135 -121 -135q-60 0 -90 35.5t-30 99.5q0 63 31.5 99t88.5 36q51 0 86 -32t35 -103z" />
+<glyph unicode="&#xa2;" d="M971 240q-105 -54 -252 -60v-200h-133v206q-203 32 -299.5 168.5t-96.5 386.5q0 508 396 570v172h135v-164q75 -3 146 -19.5t120 -39.5l-49 -140q-133 51 -242 51q-172 0 -253 -105.5t-81 -322.5q0 -212 79.5 -313.5t246.5 -101.5q141 0 283 59v-147z" />
+<glyph unicode="&#xa3;" d="M682 1481q190 0 360 -84l-61 -133q-154 77 -297 77q-123 0 -185.5 -62t-62.5 -202v-295h422v-127h-422v-221q0 -100 -32.5 -168t-106.5 -112h795v-154h-1029v141q205 47 205 291v223h-198v127h198v316q0 178 112 280.5t302 102.5z" />
+<glyph unicode="&#xa4;" d="M184 723q0 122 74 229l-135 140l94 92l135 -133q104 73 234 73q127 0 229 -73l137 133l95 -92l-134 -138q74 -113 74 -231q0 -131 -74 -234l131 -135l-92 -92l-137 133q-102 -71 -229 -71q-134 0 -234 73l-135 -133l-92 92l133 136q-74 107 -74 231zM313 723 q0 -112 78.5 -192t194.5 -80t195 79.5t79 192.5q0 114 -80 195t-194 81q-116 0 -194.5 -82t-78.5 -194z" />
+<glyph unicode="&#xa5;" d="M584 735l379 727h174l-416 -770h262v-127h-317v-170h317v-127h-317v-268h-164v268h-316v127h316v170h-316v127h256l-411 770h178z" />
+<glyph unicode="&#xa6;" horiz-adv-x="1128" d="M494 1556h141v-776h-141v776zM494 281h141v-777h-141v777z" />
+<glyph unicode="&#xa7;" horiz-adv-x="1057" d="M139 809q0 86 43 154.5t121 105.5q-74 40 -116 95.5t-42 140.5q0 121 103.5 190.5t300.5 69.5q94 0 173.5 -14.5t176.5 -53.5l-53 -131q-98 39 -165.5 52.5t-143.5 13.5q-116 0 -174 -29.5t-58 -93.5q0 -60 61.5 -102t215.5 -97q186 -68 261 -143.5t75 -182.5 q0 -90 -41 -160.5t-115 -111.5q153 -81 153 -227q0 -140 -117 -216.5t-329 -76.5q-218 0 -346 65v148q78 -37 175 -59.5t179 -22.5q134 0 204.5 38t70.5 109q0 46 -24 75t-78 58t-169 72q-142 52 -209 97t-100 102t-33 135zM285 829q0 -77 66 -129.5t233 -113.5l49 -19 q137 80 137 191q0 83 -73.5 139t-258.5 113q-68 -19 -110.5 -69t-42.5 -112z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1182" d="M309 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM690 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M893 1059q-125 0 -192.5 -87t-67.5 -241q0 -168 63.5 -249t194.5 -81q86 0 211 45v-124q-48 -20 -98.5 -34t-120.5 -14q-194 0 -298 120.5t-104 336.5q0 209 110.5 332t301.5 123q128 0 246 -60l-58 -118q-108 51 -188 51zM100 731q0 200 100 375t275 276t377 101 q200 0 375 -100t276 -275t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM205 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5q0 174 -87 323t-235.5 236.5t-324.5 87.5q-174 0 -323 -87 t-236.5 -235.5t-87.5 -324.5z" />
+<glyph unicode="&#xaa;" horiz-adv-x="725" d="M532 801l-24 84q-92 -97 -232 -97q-95 0 -150.5 49.5t-55.5 151.5t77 154.5t242 58.5l117 4v39q0 133 -148 133q-100 0 -204 -51l-43 96q114 56 247 56q130 0 198.5 -52.5t68.5 -173.5v-452h-93zM193 989q0 -100 112 -100q201 0 201 180v49l-98 -4q-112 -4 -163.5 -32.5 t-51.5 -92.5z" />
+<glyph unicode="&#xab;" horiz-adv-x="1018" d="M82 551l342 407l119 -69l-289 -350l289 -351l-119 -71l-342 407v27zM477 551l344 407l117 -69l-287 -350l287 -351l-117 -71l-344 407v27z" />
+<glyph unicode="&#xac;" d="M1065 791v-527h-137v389h-824v138h961z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M84 473zM84 473v152h491v-152h-491z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M723 762h108q80 0 128.5 41.5t48.5 105.5q0 75 -43 107.5t-136 32.5h-106v-287zM1157 913q0 -80 -42.5 -141.5t-119.5 -91.5l238 -395h-168l-207 354h-135v-354h-148v891h261q166 0 243.5 -65t77.5 -198zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275 t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM205 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5q0 174 -87 323t-235.5 236.5t-324.5 87.5q-174 0 -323 -87t-236.5 -235.5t-87.5 -324.5z " />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036v127h1036v-127z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M127 1171q0 130 90.5 221t220.5 91t221 -90.5t91 -221.5q0 -84 -41 -155.5t-114 -113.5t-157 -42q-130 0 -220.5 90t-90.5 221zM242 1171q0 -82 58.5 -139t139.5 -57q80 0 137.5 56.5t57.5 139.5q0 84 -56.5 140.5t-138.5 56.5q-83 0 -140.5 -57t-57.5 -140z" />
+<glyph unicode="&#xb1;" d="M104 1zM653 791h412v-138h-412v-426h-139v426h-410v138h410v428h139v-428zM104 1v138h961v-138h-961z" />
+<glyph unicode="&#xb2;" horiz-adv-x="711" d="M653 586h-604v104l236 230q89 86 130 134.5t57.5 86.5t16.5 92q0 68 -40 102.5t-103 34.5q-52 0 -101 -19t-118 -69l-66 88q131 111 283 111q132 0 205.5 -65t73.5 -177q0 -80 -44.5 -155.5t-191.5 -213.5l-174 -165h440v-119z" />
+<glyph unicode="&#xb3;" horiz-adv-x="711" d="M627 1255q0 -80 -41 -131.5t-109 -74.5q176 -47 176 -209q0 -128 -92 -199.5t-260 -71.5q-152 0 -268 56v123q147 -68 270 -68q211 0 211 162q0 145 -231 145h-117v107h119q103 0 152.5 39.5t49.5 107.5q0 61 -40 95t-107 34q-66 0 -122 -21.5t-112 -56.5l-69 90 q63 45 133 72t164 27q136 0 214.5 -59.5t78.5 -166.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1182" d="M393 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1268" d="M342 381q0 -262 254 -262q171 0 250.5 94.5t79.5 306.5v576h166v-1096h-136l-26 147h-10q-111 -167 -340 -167q-150 0 -238 92h-10q10 -84 10 -244v-320h-166v1588h166v-715z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1120 -260h-114v1712h-213v-1712h-115v819q-62 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h557v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="545" d="M152 723q0 66 31 100.5t87 34.5q58 0 90.5 -34.5t32.5 -100.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode="&#xb8;" horiz-adv-x="465" d="M436 -289q0 -97 -76.5 -150t-226.5 -53q-51 0 -96 9v106q45 -8 104 -8q79 0 119.5 20t40.5 74q0 43 -39.5 69.5t-148.5 43.5l88 178h110l-55 -115q180 -39 180 -174z" />
+<glyph unicode="&#xb9;" horiz-adv-x="711" d="M338 1462h143v-876h-133v579q0 91 6 181q-22 -22 -49 -44.5t-162 -117.5l-67 96z" />
+<glyph unicode="&#xba;" horiz-adv-x="768" d="M702 1135q0 -164 -85.5 -255.5t-235.5 -91.5q-146 0 -230.5 93t-84.5 254q0 163 84 253.5t235 90.5q152 0 234.5 -91t82.5 -253zM188 1135q0 -122 45.5 -183t149.5 -61q105 0 151 61t46 183q0 123 -46 182t-151 59q-103 0 -149 -59t-46 -182z" />
+<glyph unicode="&#xbb;" horiz-adv-x="1018" d="M936 524l-344 -407l-117 71l287 351l-287 350l117 69l344 -407v-27zM541 524l-344 -407l-117 71l287 351l-287 350l117 69l344 -407v-27z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1597" d="M75 0zM1298 1462l-903 -1462h-143l903 1462h143zM337 1462h143v-876h-133v579q0 91 6 181q-22 -22 -49 -44.5t-162 -117.5l-67 96zM1489 203h-125v-202h-145v202h-402v101l408 579h139v-563h125v-117zM1219 320v195q0 134 6 209q-5 -12 -17 -31.5t-27 -42l-30 -45 t-26 -39.5l-168 -246h262z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1597" d="M46 0zM1230 1462l-903 -1462h-143l903 1462h143zM308 1462h143v-876h-133v579q0 91 6 181q-22 -22 -49 -44.5t-162 -117.5l-67 96zM1499 1h-604v104l236 230q89 86 130 134.5t57.5 86.5t16.5 92q0 68 -40 102.5t-103 34.5q-52 0 -101 -19t-118 -69l-66 88 q131 111 283 111q132 0 205.5 -65t73.5 -177q0 -80 -44.5 -155.5t-191.5 -213.5l-174 -165h440v-119z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1597" d="M26 0zM620 1255q0 -80 -41 -131.5t-109 -74.5q176 -47 176 -209q0 -128 -92 -199.5t-260 -71.5q-152 0 -268 56v123q147 -68 270 -68q211 0 211 162q0 145 -231 145h-117v107h119q103 0 152.5 39.5t49.5 107.5q0 61 -40 95t-107 34q-66 0 -122 -21.5t-112 -56.5l-69 90 q63 45 133 72t164 27q136 0 214.5 -59.5t78.5 -166.5zM1390 1462l-903 -1462h-143l903 1462h143zM1569 203h-125v-202h-145v202h-402v101l408 579h139v-563h125v-117zM1299 320v195q0 134 6 209q-5 -12 -17 -31.5t-27 -42l-30 -45t-26 -39.5l-168 -246h262z" />
+<glyph unicode="&#xbf;" horiz-adv-x="879" d="M590 684v-51q0 -122 -37.5 -196t-134.5 -158q-121 -106 -151.5 -143.5t-43 -76t-12.5 -94.5q0 -100 66 -156.5t188 -56.5q80 0 155 19t173 67l59 -135q-197 -96 -395 -96q-190 0 -298 93t-108 263q0 70 17.5 122.5t49.5 97t76.5 85.5t98.5 88q101 88 133.5 146t32.5 151 v31h131zM639 983q0 -135 -121 -135q-59 0 -90 34.5t-31 100.5q0 64 33 99.5t88 35.5q51 0 86 -32t35 -103z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM724 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM526 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM303 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186 h-115v23z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM792 1581q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5 q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM364 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5z M745 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM870 1587q0 -98 -61.5 -157.5t-163.5 -59.5q-101 0 -161 58.5t-60 156.5t60.5 155.5t160.5 57.5q101 0 163 -59.5t62 -151.5z M762 1585q0 56 -33 86.5t-84 30.5t-84 -30.5t-33 -86.5t30 -86.5t87 -30.5q52 0 84.5 30.5t32.5 86.5z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1788" d="M1665 0h-750v465h-514l-227 -465h-176l698 1462h969v-151h-580v-471h541v-150h-541v-538h580v-152zM469 618h446v693h-118z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1292" d="M125 0zM827 1331q-241 0 -380.5 -160.5t-139.5 -439.5q0 -287 134.5 -443.5t383.5 -156.5q153 0 349 55v-149q-152 -57 -375 -57q-323 0 -498.5 196t-175.5 557q0 226 84.5 396t244 262t375.5 92q230 0 402 -84l-72 -146q-166 78 -332 78zM950 -289q0 -97 -76.5 -150 t-226.5 -53q-51 0 -96 9v106q45 -8 104 -8q79 0 119.5 20t40.5 74q0 43 -39.5 69.5t-148.5 43.5l88 178h110l-55 -115q180 -39 180 -174z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM713 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM456 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xca;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM263 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM327 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM708 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5 t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xcc;" horiz-adv-x="571" d="M5 0zM201 0v1462h170v-1462h-170zM398 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="571" d="M179 0zM201 0v1462h170v-1462h-170zM179 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xce;" horiz-adv-x="571" d="M0 0zM201 0v1462h170v-1462h-170zM-57 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xcf;" horiz-adv-x="571" d="M5 0zM201 0v1462h170v-1462h-170zM5 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM386 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1479" d="M1352 745q0 -362 -196.5 -553.5t-565.5 -191.5h-389v649h-154v150h154v663h434q337 0 527 -187.5t190 -529.5zM1171 739q0 576 -569 576h-231v-516h379v-150h-379v-502h190q610 0 610 592z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1544" d="M201 0zM1343 0h-194l-799 1227h-8q16 -216 16 -396v-831h-157v1462h192l797 -1222h8q-2 27 -9 173.5t-5 209.5v839h159v-1462zM935 1581q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41 t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM907 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM659 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM448 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM942 1581q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM522 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM903 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xd7;" d="M940 1176l96 -99l-352 -354l350 -352l-96 -99l-354 351l-348 -351l-101 99l350 352l-352 352l100 101l353 -355z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1595" d="M1470 733q0 -351 -177.5 -552t-493.5 -201q-235 0 -383 100l-101 -141l-120 79l108 154q-178 198 -178 563q0 357 176 553.5t500 196.5q209 0 366 -94l97 135l120 -80l-106 -148q192 -202 192 -565zM1290 733q0 272 -110 426l-672 -948q115 -82 291 -82q243 0 367 153 t124 451zM305 733q0 -262 101 -416l669 943q-106 73 -274 73q-243 0 -369.5 -153.5t-126.5 -446.5z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM856 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM600 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM393 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186 q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM461 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5 t-26.5 74.5zM842 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1147" d="M0 0zM573 731l390 731h184l-488 -895v-567h-172v559l-487 903h186zM442 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xde;" horiz-adv-x="1251" d="M1145 784q0 -227 -151.5 -346t-438.5 -119h-184v-319h-170v1462h170v-256h215q281 0 420 -103.5t139 -318.5zM371 465h168q226 0 327 71.5t101 235.5q0 149 -95 218t-297 69h-204v-594z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1274" d="M1049 1266q0 -135 -143 -250q-88 -70 -116 -103.5t-28 -66.5q0 -32 13.5 -53t49 -49.5t113.5 -79.5q140 -95 191 -173.5t51 -179.5q0 -160 -97 -245.5t-276 -85.5q-188 0 -295 69v154q63 -39 141 -62.5t150 -23.5q215 0 215 182q0 75 -41.5 128.5t-151.5 123.5 q-127 82 -175 143.5t-48 145.5q0 63 34.5 116t105.5 106q75 57 107 102t32 98q0 80 -68 122.5t-195 42.5q-276 0 -276 -223v-1204h-166v1202q0 178 110 271.5t332 93.5q206 0 318.5 -78.5t112.5 -222.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM672 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM436 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM228 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM721 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99 q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM279 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM660 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75 q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM804 1458q0 -98 -61.5 -157.5t-163.5 -59.5q-101 0 -161 58.5t-60 156.5t60.5 155.5t160.5 57.5q101 0 163 -59.5t62 -151.5zM696 1456q0 56 -33 86.5t-84 30.5t-84 -30.5t-33 -86.5 t30 -86.5t87 -30.5q52 0 84.5 30.5t32.5 86.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1757" d="M94 303q0 161 124 250.5t378 97.5l184 6v68q0 129 -58 190.5t-177 61.5q-144 0 -307 -84l-52 127q74 41 173.5 67.5t197.5 26.5q130 0 212.5 -43.5t123.5 -138.5q53 88 138.5 136t195.5 48q192 0 308 -133.5t116 -355.5v-107h-701q8 -395 322 -395q91 0 169.5 17.5 t162.5 56.5v-148q-86 -38 -160.5 -54.5t-175.5 -16.5q-289 0 -414 233q-81 -127 -179.5 -180t-232.5 -53q-163 0 -255.5 85t-92.5 238zM268 301q0 -95 53.5 -139.5t141.5 -44.5q145 0 229 84.5t84 238.5v99l-158 -7q-186 -8 -268 -62.5t-82 -168.5zM1225 977 q-121 0 -190.5 -83t-80.5 -241h519q0 156 -64 240t-184 84z" />
+<glyph unicode="&#xe7;" horiz-adv-x="975" d="M115 0zM614 -20q-238 0 -368.5 146.5t-130.5 414.5q0 275 132.5 425t377.5 150q79 0 158 -17t124 -40l-51 -141q-55 22 -120 36.5t-115 14.5q-334 0 -334 -426q0 -202 81.5 -310t241.5 -108q137 0 281 59v-147q-110 -57 -277 -57zM762 -289q0 -97 -76.5 -150t-226.5 -53 q-51 0 -96 9v106q45 -8 104 -8q79 0 119.5 20t40.5 74q0 43 -39.5 69.5t-148.5 43.5l88 178h110l-55 -115q180 -39 180 -174z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM711 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM471 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xea;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM259 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM319 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM700 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xec;" horiz-adv-x="518" d="M0 0zM342 0h-166v1096h166v-1096zM355 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="518" d="M169 0zM342 0h-166v1096h166v-1096zM169 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xee;" horiz-adv-x="518" d="M0 0zM342 0h-166v1096h166v-1096zM-77 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xef;" horiz-adv-x="518" d="M0 0zM342 0h-166v1096h166v-1096zM-20 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM361 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1221" d="M1122 563q0 -281 -130.5 -432t-377.5 -151q-222 0 -361.5 134.5t-139.5 360.5q0 230 131.5 361t351.5 131q226 0 326 -121l8 4q-57 214 -262 405l-271 -155l-73 108l233 133q-92 62 -186 111l69 117q156 -73 258 -148l238 138l76 -107l-207 -119q152 -143 234.5 -342 t82.5 -428zM954 512q0 147 -90 232t-246 85q-337 0 -337 -360q0 -167 87.5 -258.5t249.5 -91.5q175 0 255.5 100.5t80.5 292.5z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1257" d="M176 0zM926 0v709q0 134 -61 200t-191 66q-172 0 -252 -93t-80 -307v-575h-166v1096h135l27 -150h8q51 81 143 125.5t205 44.5q198 0 298 -95.5t100 -305.5v-715h-166zM802 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98 q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M742 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M479 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M282 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M773 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M336 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM717 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xf7;" d="M104 653v138h961v-138h-961zM471 373q0 60 29.5 90.5t83.5 30.5q52 0 81 -31.5t29 -89.5q0 -57 -29.5 -89t-80.5 -32q-52 0 -82.5 31.5t-30.5 89.5zM471 1071q0 60 29.5 90.5t83.5 30.5q52 0 81 -31.5t29 -89.5q0 -57 -29.5 -89t-80.5 -32q-52 0 -82.5 31.5t-30.5 89.5z " />
+<glyph unicode="&#xf8;" horiz-adv-x="1237" d="M1122 549q0 -268 -135 -418.5t-373 -150.5q-154 0 -266 69l-84 -117l-114 78l94 131q-129 152 -129 408q0 268 134 417.5t372 149.5q154 0 270 -76l84 119l117 -76l-97 -133q127 -152 127 -401zM287 549q0 -171 53 -273l465 646q-75 53 -189 53q-163 0 -246 -107 t-83 -319zM950 549q0 164 -51 264l-465 -643q71 -51 184 -51q163 0 247.5 109.5t84.5 320.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM726 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM506 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM286 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119 q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM342 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5 q-37 0 -63.5 24.5t-26.5 74.5zM723 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1032" d="M2 0zM2 1096h178l240 -625q79 -214 98 -309h8q13 51 54.5 174.5t271.5 759.5h178l-471 -1248q-70 -185 -163.5 -262.5t-229.5 -77.5q-76 0 -150 17v133q55 -12 123 -12q171 0 244 192l61 156zM411 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147 h-111v25z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1255" d="M344 948q66 89 151 128.5t191 39.5q215 0 335 -150t120 -417q0 -268 -120.5 -418.5t-334.5 -150.5q-222 0 -344 161h-12l4 -34q8 -77 8 -140v-459h-166v2048h166v-466q0 -52 -6 -142h8zM664 975q-168 0 -244 -92t-78 -293v-41q0 -231 77 -330.5t247 -99.5q303 0 303 432 q0 215 -74 319.5t-231 104.5z" />
+<glyph unicode="&#xff;" horiz-adv-x="1032" d="M2 0zM2 1096h178l240 -625q79 -214 98 -309h8q13 51 54.5 174.5t271.5 759.5h178l-471 -1248q-70 -185 -163.5 -262.5t-229.5 -77.5q-76 0 -150 17v133q55 -12 123 -12q171 0 244 192l61 156zM234 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5 t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM615 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#x131;" horiz-adv-x="518" d="M342 0h-166v1096h166v-1096z" />
+<glyph unicode="&#x152;" horiz-adv-x="1890" d="M1767 0h-768q-102 -20 -194 -20q-327 0 -503.5 196.5t-176.5 558.5q0 360 174 555t494 195q102 0 192 -23h782v-151h-589v-471h551v-150h-551v-538h589v-152zM811 1333q-249 0 -377.5 -152.5t-128.5 -447.5q0 -297 128.5 -450.5t375.5 -153.5q112 0 199 33v1141 q-87 30 -197 30z" />
+<glyph unicode="&#x153;" horiz-adv-x="1929" d="M1430 -20q-293 0 -418 235q-62 -116 -166.5 -175.5t-241.5 -59.5q-223 0 -357 152.5t-134 416.5q0 265 131 415t366 150q131 0 233.5 -59.5t164.5 -173.5q58 112 154 172.5t222 60.5q201 0 320 -132.5t119 -358.5v-105h-729q8 -393 338 -393q94 0 174.5 17.5t167.5 56.5 v-148q-88 -39 -164 -55t-180 -16zM287 549q0 -211 76 -320.5t243 -109.5q163 0 239.5 106.5t76.5 315.5q0 221 -77.5 327.5t-242.5 106.5q-166 0 -240.5 -108t-74.5 -318zM1382 975q-127 0 -199.5 -82t-84.5 -240h544q0 158 -66 240t-194 82z" />
+<glyph unicode="&#x178;" horiz-adv-x="1147" d="M0 0zM573 731l390 731h184l-488 -895v-567h-172v559l-487 903h186zM294 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM675 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5 t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1212" d="M268 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M813 1458q0 -98 -61.5 -157.5t-163.5 -59.5q-101 0 -161 58.5t-60 156.5t60.5 155.5t160.5 57.5q101 0 163 -59.5t62 -151.5zM705 1456q0 56 -33 86.5t-84 30.5t-84 -30.5t-33 -86.5t30 -86.5t87 -30.5q52 0 84.5 30.5t32.5 86.5z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1212" d="M788 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M82 473v152h860v-152h-860z" />
+<glyph unicode="&#x2014;" horiz-adv-x="2048" d="M82 473v152h1884v-152h-1884z" />
+<glyph unicode="&#x2018;" horiz-adv-x="348" d="M37 961l-12 22q22 90 71 224t105 255h123q-66 -254 -103 -501h-184z" />
+<glyph unicode="&#x2019;" horiz-adv-x="348" d="M309 1462l15 -22q-26 -100 -75 -232.5t-102 -246.5h-122q70 285 102 501h182z" />
+<glyph unicode="&#x201a;" horiz-adv-x="502" d="M63 0zM350 238l15 -23q-26 -100 -75 -232.5t-102 -246.5h-125q27 104 59.5 257t45.5 245h182z" />
+<glyph unicode="&#x201c;" horiz-adv-x="717" d="M406 961l-15 22q56 215 178 479h123q-30 -115 -59.5 -259.5t-42.5 -241.5h-184zM37 961l-12 22q22 90 71 224t105 255h123q-66 -254 -103 -501h-184z" />
+<glyph unicode="&#x201d;" horiz-adv-x="717" d="M309 1462l15 -22q-26 -100 -75 -232.5t-102 -246.5h-122q70 285 102 501h182zM678 1462l14 -22q-24 -91 -72 -224t-104 -255h-125q26 100 59 254t46 247h182z" />
+<glyph unicode="&#x201e;" horiz-adv-x="829" d="M25 0zM309 238l15 -22q-26 -100 -75 -232.5t-102 -246.5h-122q70 285 102 501h182zM678 238l14 -22q-24 -91 -72 -224t-104 -255h-125q26 100 59 254t46 247h182z" />
+<glyph unicode="&#x2022;" horiz-adv-x="770" d="M164 748q0 121 56.5 184t164.5 63q105 0 163 -62t58 -185q0 -119 -57.5 -183.5t-163.5 -64.5q-107 0 -164 65.5t-57 182.5z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1606" d="M152 0zM152 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5zM682 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5zM1213 106 q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="623" d="M82 551l342 407l119 -69l-289 -350l289 -351l-119 -71l-342 407v27z" />
+<glyph unicode="&#x203a;" horiz-adv-x="623" d="M541 524l-344 -407l-117 71l287 351l-287 350l117 69l344 -407v-27z" />
+<glyph unicode="&#x2044;" horiz-adv-x="266" d="M655 1462l-903 -1462h-143l903 1462h143z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="711" d="M692 788h-125v-202h-145v202h-402v101l408 579h139v-563h125v-117zM422 905v195q0 134 6 209q-5 -12 -17 -31.5t-27 -42l-30 -45t-26 -39.5l-168 -246h262z" />
+<glyph unicode="&#x20ac;" horiz-adv-x="1208" d="M795 1333q-319 0 -398 -403h510v-129h-524l-2 -57v-64l2 -45h463v-129h-447q37 -180 138.5 -278.5t271.5 -98.5q156 0 309 66v-150q-146 -65 -317 -65q-237 0 -381.5 134.5t-190.5 391.5h-166v129h152l-2 42v44l2 80h-152v129h164q39 261 185 407t383 146q201 0 366 -97 l-71 -139q-166 86 -295 86z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1589" d="M369 741h-123v615h-209v106h543v-106h-211v-615zM969 741l-201 559h-8l6 -129v-430h-119v721h187l196 -559l203 559h180v-721h-127v420l6 137h-8l-211 -557h-104z" />
+<glyph unicode="&#x2212;" d="M104 653v138h961v-138h-961z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1095" d="M0 1095h1095v-1095h-1095v1095z" />
+<glyph horiz-adv-x="1255" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff
new file mode 100644 (file)
index 0000000..e231183
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/index.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/index.html
new file mode 100644 (file)
index 0000000..3493d2f
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Home</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Home</h1>
+
+    
+
+
+
+    
+
+
+    <h3> </h3>
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/linenumber.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/linenumber.js
new file mode 100644 (file)
index 0000000..8d52f7e
--- /dev/null
@@ -0,0 +1,25 @@
+/*global document */
+(function() {
+    var source = document.getElementsByClassName('prettyprint source linenums');
+    var i = 0;
+    var lineNumber = 0;
+    var lineId;
+    var lines;
+    var totalLines;
+    var anchorHash;
+
+    if (source && source[0]) {
+        anchorHash = document.location.hash.substring(1);
+        lines = source[0].getElementsByTagName('li');
+        totalLines = lines.length;
+
+        for (; i < totalLines; i++) {
+            lineNumber++;
+            lineId = 'line' + lineNumber;
+            lines[i].id = lineId;
+            if (lineId === anchorHash) {
+                lines[i].className += ' selected';
+            }
+        }
+    }
+})();
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/Apache-License-2.0.txt b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/Apache-License-2.0.txt
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/lang-css.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/lang-css.js
new file mode 100644 (file)
index 0000000..041e1f5
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\f"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
+/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/prettify.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/scripts/prettify/prettify.js
new file mode 100644 (file)
index 0000000..eef5ad7
--- /dev/null
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/jsdoc-default.css b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/jsdoc-default.css
new file mode 100644 (file)
index 0000000..24aa20f
--- /dev/null
@@ -0,0 +1,353 @@
+@font-face {
+    font-family: 'Open Sans';
+    font-weight: normal;
+    font-style: normal;
+    src: url('../fonts/OpenSans-Regular-webfont.eot');
+    src:
+        local('Open Sans'),
+        local('OpenSans'),
+        url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
+        url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
+        url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
+}
+
+@font-face {
+    font-family: 'Open Sans Light';
+    font-weight: normal;
+    font-style: normal;
+    src: url('../fonts/OpenSans-Light-webfont.eot');
+    src:
+        local('Open Sans Light'),
+        local('OpenSans Light'),
+        url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
+        url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
+        url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
+}
+
+html
+{
+    overflow: auto;
+    background-color: #fff;
+    font-size: 14px;
+}
+
+body
+{
+    font-family: 'Open Sans', sans-serif;
+    line-height: 1.5;
+    color: #4d4e53;
+    background-color: white;
+}
+
+a, a:visited, a:active {
+    color: #0095dd;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+header
+{
+    display: block;
+    padding: 0px 4px;
+}
+
+tt, code, kbd, samp {
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+}
+
+.class-description {
+    font-size: 130%;
+    line-height: 140%;
+    margin-bottom: 1em;
+    margin-top: 1em;
+}
+
+.class-description:empty {
+    margin: 0;
+}
+
+#main {
+    float: left;
+    width: 70%;
+}
+
+article dl {
+    margin-bottom: 40px;
+}
+
+section
+{
+    display: block;
+    background-color: #fff;
+    padding: 12px 24px;
+    border-bottom: 1px solid #ccc;
+    margin-right: 30px;
+}
+
+.variation {
+    display: none;
+}
+
+.signature-attributes {
+    font-size: 60%;
+    color: #aaa;
+    font-style: italic;
+    font-weight: lighter;
+}
+
+nav
+{
+    display: block;
+    float: right;
+    margin-top: 28px;
+    width: 30%;
+    box-sizing: border-box;
+    border-left: 1px solid #ccc;
+    padding-left: 16px;
+}
+
+nav ul {
+    font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
+    font-size: 100%;
+    line-height: 17px;
+    padding: 0;
+    margin: 0;
+    list-style-type: none;
+}
+
+nav ul a, nav ul a:visited, nav ul a:active {
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+    line-height: 18px;
+    color: #4D4E53;
+}
+
+nav h3 {
+    margin-top: 12px;
+}
+
+nav li {
+    margin-top: 6px;
+}
+
+footer {
+    display: block;
+    padding: 6px;
+    margin-top: 12px;
+    font-style: italic;
+    font-size: 90%;
+}
+
+h1, h2, h3, h4 {
+    font-weight: 200;
+    margin: 0;
+}
+
+h1
+{
+    font-family: 'Open Sans Light', sans-serif;
+    font-size: 48px;
+    letter-spacing: -2px;
+    margin: 12px 24px 20px;
+}
+
+h2, h3
+{
+    font-size: 30px;
+    font-weight: 700;
+    letter-spacing: -1px;
+    margin-bottom: 12px;
+}
+
+h4
+{
+    font-size: 18px;
+    letter-spacing: -0.33px;
+    margin-bottom: 12px;
+    color: #4d4e53;
+}
+
+h5, .container-overview .subsection-title
+{
+    font-size: 120%;
+    font-weight: bold;
+    letter-spacing: -0.01em;
+    margin: 8px 0 3px 0;
+}
+
+h6
+{
+    font-size: 100%;
+    letter-spacing: -0.01em;
+    margin: 6px 0 3px 0;
+    font-style: italic;
+}
+
+.ancestors { color: #999; }
+.ancestors a
+{
+    color: #999 !important;
+    text-decoration: none;
+}
+
+.clear
+{
+    clear: both;
+}
+
+.important
+{
+    font-weight: bold;
+    color: #950B02;
+}
+
+.yes-def {
+    text-indent: -1000px;
+}
+
+.type-signature {
+    color: #aaa;
+}
+
+.name, .signature {
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+}
+
+.details { margin-top: 14px; border-left: 2px solid #DDD; }
+.details dt { width: 120px; float: left; padding-left: 10px;  padding-top: 6px; }
+.details dd { margin-left: 70px; }
+.details ul { margin: 0; }
+.details ul { list-style-type: none; }
+.details li { margin-left: 30px; padding-top: 6px; }
+.details pre.prettyprint { margin: 0 }
+.details .object-value { padding-top: 0; }
+
+.description {
+    margin-bottom: 1em;
+    margin-top: 1em;
+}
+
+.code-caption
+{
+    font-style: italic;
+    font-size: 107%;
+    margin: 0;
+}
+
+.prettyprint
+{
+    border: 1px solid #ddd;
+    width: 80%;
+    overflow: auto;
+}
+
+.prettyprint.source {
+    width: inherit;
+}
+
+.prettyprint code
+{
+    font-size: 100%;
+    line-height: 18px;
+    display: block;
+    padding: 4px 12px;
+    margin: 0;
+    background-color: #fff;
+    color: #4D4E53;
+}
+
+.prettyprint code span.line
+{
+  display: inline-block;
+}
+
+.prettyprint.linenums
+{
+  padding-left: 70px;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+.prettyprint.linenums ol
+{
+  padding-left: 0;
+}
+
+.prettyprint.linenums li
+{
+  border-left: 3px #ddd solid;
+}
+
+.prettyprint.linenums li.selected,
+.prettyprint.linenums li.selected *
+{
+  background-color: lightyellow;
+}
+
+.prettyprint.linenums li *
+{
+  -webkit-user-select: text;
+  -moz-user-select: text;
+  -ms-user-select: text;
+  user-select: text;
+}
+
+.params, .props
+{
+    border-spacing: 0;
+    border: 0;
+    border-collapse: collapse;
+}
+
+.params .name, .props .name, .name code {
+    color: #4D4E53;
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+    font-size: 100%;
+}
+
+.params td, .params th, .props td, .props th
+{
+    border: 1px solid #ddd;
+    margin: 0px;
+    text-align: left;
+    vertical-align: top;
+    padding: 4px 6px;
+    display: table-cell;
+}
+
+.params thead tr, .props thead tr
+{
+    background-color: #ddd;
+    font-weight: bold;
+}
+
+.params .params thead tr, .props .props thead tr
+{
+    background-color: #fff;
+    font-weight: bold;
+}
+
+.params th, .props th { border-right: 1px solid #aaa; }
+.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
+
+.params td.description > p:first-child,
+.props td.description > p:first-child
+{
+    margin-top: 0;
+    padding-top: 0;
+}
+
+.params td.description > p:last-child,
+.props td.description > p:last-child
+{
+    margin-bottom: 0;
+    padding-bottom: 0;
+}
+
+.disabled {
+    color: #454545;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/prettify-jsdoc.css b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/prettify-jsdoc.css
new file mode 100644 (file)
index 0000000..5a2526e
--- /dev/null
@@ -0,0 +1,111 @@
+/* JSDoc prettify.js theme */
+
+/* plain text */
+.pln {
+  color: #000000;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* string content */
+.str {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a keyword */
+.kwd {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* a comment */
+.com {
+  font-weight: normal;
+  font-style: italic;
+}
+
+/* a type name */
+.typ {
+  color: #000000;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a literal value */
+.lit {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* punctuation */
+.pun {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* lisp open bracket */
+.opn {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* lisp close bracket */
+.clo {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* a markup tag name */
+.tag {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a markup attribute name */
+.atn {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a markup attribute value */
+.atv {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a declaration */
+.dec {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* a variable name */
+.var {
+  color: #000000;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a function name */
+.fun {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+  margin-top: 0;
+  margin-bottom: 0;
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/prettify-tomorrow.css b/legacy-libs/grpc-cloned/node_modules/protobufjs/docs/styles/prettify-tomorrow.css
new file mode 100644 (file)
index 0000000..b6f92a7
--- /dev/null
@@ -0,0 +1,132 @@
+/* Tomorrow Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* Pretty printing styles. Used with prettify.js. */
+/* SPAN elements with the classes below are added by prettyprint. */
+/* plain text */
+.pln {
+  color: #4d4d4c; }
+
+@media screen {
+  /* string content */
+  .str {
+    color: #718c00; }
+
+  /* a keyword */
+  .kwd {
+    color: #8959a8; }
+
+  /* a comment */
+  .com {
+    color: #8e908c; }
+
+  /* a type name */
+  .typ {
+    color: #4271ae; }
+
+  /* a literal value */
+  .lit {
+    color: #f5871f; }
+
+  /* punctuation */
+  .pun {
+    color: #4d4d4c; }
+
+  /* lisp open bracket */
+  .opn {
+    color: #4d4d4c; }
+
+  /* lisp close bracket */
+  .clo {
+    color: #4d4d4c; }
+
+  /* a markup tag name */
+  .tag {
+    color: #c82829; }
+
+  /* a markup attribute name */
+  .atn {
+    color: #f5871f; }
+
+  /* a markup attribute value */
+  .atv {
+    color: #3e999f; }
+
+  /* a declaration */
+  .dec {
+    color: #f5871f; }
+
+  /* a variable name */
+  .var {
+    color: #c82829; }
+
+  /* a function name */
+  .fun {
+    color: #4271ae; } }
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+  .str {
+    color: #060; }
+
+  .kwd {
+    color: #006;
+    font-weight: bold; }
+
+  .com {
+    color: #600;
+    font-style: italic; }
+
+  .typ {
+    color: #404;
+    font-weight: bold; }
+
+  .lit {
+    color: #044; }
+
+  .pun, .opn, .clo {
+    color: #440; }
+
+  .tag {
+    color: #006;
+    font-weight: bold; }
+
+  .atn {
+    color: #404; }
+
+  .atv {
+    color: #060; } }
+/* Style */
+/*
+pre.prettyprint {
+  background: white;
+  font-family: Consolas, Monaco, 'Andale Mono', monospace;
+  font-size: 12px;
+  line-height: 1.5;
+  border: 1px solid #ccc;
+  padding: 10px; }
+*/
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+  margin-top: 0;
+  margin-bottom: 0; }
+
+/* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L4,
+li.L5,
+li.L6,
+li.L7,
+li.L8,
+li.L9 {
+  /* */ }
+
+/* Alternate shading for lines */
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 {
+  /* */ }
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/donate.png b/legacy-libs/grpc-cloned/node_modules/protobufjs/donate.png
new file mode 100644 (file)
index 0000000..207d001
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/donate.png differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/README.md b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/README.md
new file mode 100644 (file)
index 0000000..e82333b
--- /dev/null
@@ -0,0 +1,28 @@
+ProtoBuf.js protoify example\r
+============================\r
+This example shows the general usage of ProtoBuf.js by converting JSON structures to protocol buffers and vice versa\r
+using a definition describing JSON itself. While this works as an example, it does not provide any real world benefits\r
+(well, this is if you are not building a protobuf-backed database for JSON data, using inter-field substitution to\r
+minimize redundancy - nevermind, forget that).\r
+\r
+Instructions\r
+------------\r
+1. Set up dependencies: `npm install`\r
+2. Run: `npm test`\r
+\r
+Now you know no more and no less than that it works and you might want to inspect the following files to get the 'how':\r
+\r
+* **[index.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/index.js)**\r
+  contains the sample's source code\r
+\r
+* **[json.proto](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.proto)**\r
+  contains the protobuf definition used\r
+\r
+* **[json.json](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.json)**\r
+  contains the protobuf definition converted through `proto2js json.proto > json.json`\r
+\r
+* **[json.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.js)**\r
+  contains the protobuf definition converted through `proto2js json.proto -commonjs=js > json.js`\r
+\r
+* **[test.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/test.js)**\r
+  contains our simple test suite\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/index.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/index.js
new file mode 100644 (file)
index 0000000..94f066a
--- /dev/null
@@ -0,0 +1,147 @@
+var ProtoBuf = require("protobufjs"),\r
+    ByteBuffer = ProtoBuf.ByteBuffer,                    // ProtoBuf.js uses and also exposes ByteBuffer.js\r
+    Long = ProtoBuf.Long;                                // as well as Long.js (not used in this example)\r
+\r
+// Option 1: Loading the .proto file directly\r
+var builder = ProtoBuf.loadProtoFile("./json.proto"),    // Creates the Builder\r
+    JS = builder.build("js");                            // Returns just the 'js' namespace if that's all we need\r
+\r
+// Option 2: Loading the .json file generated through 'proto2js json.proto > json.json'\r
+var root = ProtoBuf.loadJsonFile("./json.json").build(), // Here we make the Builder return the root namespace\r
+    JS = root.js;                                        // then we reference 'js' inside. Both is possible.\r
+\r
+// Option 3: Loading the module generated through 'proto2js json.proto -commonjs=js > json.js'\r
+var JS = require("./json.js");                           // Returns what is specified with -commonjs[=XX] (omitted=root)\r
+\r
+// `JS` now contains the js namespace from json.proto: Value, Array and Object\r
+\r
+// This is how we use these classes:\r
+\r
+/**\r
+ * Converts a JSON-like structure to JS-Namespace values.\r
+ * @param {*} val JSON\r
+ * @returns {!JS.Value} JS-Namespace value\r
+ * @inner\r
+ */\r
+function _protoify(val) {\r
+    switch (typeof val) {\r
+        case 'number':\r
+            if (val%1 === 0 && val >= (0x80000000|0) && val <= (0x7fffffff|0))\r
+                return new JS.Value(val); // sets the first field declared in .js.Value\r
+            else\r
+                return new JS.Value(null, val); // sets the second field\r
+        case 'string':\r
+            return new JS.Value({ 'string': val }); // uses object notation instead\r
+        case 'boolean':\r
+            return new JS.Value({ 'boolean': val });\r
+        case 'object':\r
+            if (val === null)\r
+                return new JS.Value({ 'null': true });\r
+            if (Object.prototype.toString.call(val) === "[object Array]") {\r
+                var arr = new JS.Array();\r
+                for (var i=0; i<val.length; ++i)\r
+                    arr['values'][i] = _protoify(val[i]);\r
+                return new JS.Value({ 'array': arr });\r
+            }\r
+            var obj = new JS.Object();\r
+            for (var key in val)\r
+                if (val.hasOwnProperty(key))\r
+                    obj['keys'].push(_protoify(key)),\r
+                        obj['values'].push(_protoify(val[key]));\r
+            return new JS.Value({ 'object': obj });\r
+        case 'undefined':\r
+            return new JS.Value(); // undefined\r
+        default:\r
+            throw Error("Unsupported type: "+(typeof val)); // symbol, function\r
+    }\r
+}\r
+\r
+/**\r
+ * Converts JS-Namespace values to JSON.\r
+ * @param {!JS.Value} value JS value\r
+ * @returns {*} JSON\r
+ * @inner\r
+ */\r
+function _jsonify(value) {\r
+    if (value.type === null)\r
+        return undefined;\r
+    switch (value.type) {\r
+        case 'null':\r
+            return null;\r
+        case 'array':\r
+            return (function() {\r
+                var values = value['array']['values'],\r
+                    i = 0,\r
+                    k = values.length,\r
+                    arr = new Array(k);\r
+                for (; i<k; ++i)\r
+                    arr[i] = _jsonify(values[i]);\r
+                return arr;\r
+            })();\r
+        case 'object':\r
+            return (function() {\r
+                var keys = value['object']['keys'],\r
+                    values = value['object']['values'],\r
+                    i = 0,\r
+                    k = keys.length,\r
+                    obj = {};\r
+                for (; i<k; ++i)\r
+                    obj[keys[i]['string'] /* is a JS.Value, here always a string */] = _jsonify(values[i]);\r
+                return obj;\r
+            })();\r
+        default:\r
+            return value[value.type];\r
+    }\r
+}\r
+\r
+// And this is how we actually encode and decode them:\r
+\r
+/**\r
+ * A temporary Buffer to speed up encoding.\r
+ * @type {!ByteBuffer}\r
+ * @inner\r
+ */\r
+var tempBuffer = ByteBuffer.allocate(1024);\r
+\r
+/**\r
+ * Converts a JSON structure to a Buffer.\r
+ * @param {*} json JSON\r
+ * @returns {!Buffer|!ArrayBuffer}\r
+ * @expose\r
+ */\r
+module.exports = function(json) {\r
+    return _protoify(json)     // Returns the root JS.Value\r
+           .encode(tempBuffer).flip() // Encodes it to a ByteBuffer, here: reusing tempBuffer forever\r
+                               // The non-tempBuffer alternative is just doing .encode()\r
+           .toBuffer();        // Converts it to a Buffer. In the browser, this returns an ArrayBuffer. To return an\r
+                               // ArrayBuffer explicitly both under node.js and in the browser, use .toArrayBuffer().\r
+                               // Performance note: This just returns a slice on the ByteBuffer's backing .buffer\r
+};\r
+\r
+/**\r
+ * Converts a Buffer to a JSON structure.\r
+ * @param {!Buffer|!ArrayBuffer} proto Buffer\r
+ * @returns {*} JSON\r
+ * @expose\r
+ */\r
+module.exports.parse = function(proto) {\r
+    return _jsonify(           // Processes JS-namespace objects\r
+        JS.Value.decode(proto) // Decodes the JS.Value from a ByteBuffer, a Buffer, an ArrayBuffer, an Uint8Array, ...\r
+    );\r
+};\r
+\r
+/**\r
+ * Performs maintenance.\r
+ * @expose\r
+ */\r
+module.exports.performMaintenance = function() {\r
+    if (tempBuffer.capacity() > 2048)\r
+        tempBuffer = ByteBuffer.allocate(1024);\r
+    // In case this module is running inside of a daemon, we'd just call this\r
+    // method every now and then to discard the tempBuffer if it becomes too\r
+    // large. This is just an example on how to reuse ByteBuffers effectively.\r
+    // You may consider something like this for the performance benefit, which\r
+    // is decreasing the memory allocation footprint of your app.\r
+};\r
+\r
+// Have a nice day!\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.js
new file mode 100644 (file)
index 0000000..3f78846
--- /dev/null
@@ -0,0 +1,123 @@
+module.exports = require("protobufjs").newBuilder({})["import"]({\r
+    "package": "js",\r
+    "messages": [\r
+        {\r
+            "name": "Value",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "sint32",\r
+                    "name": "integer",\r
+                    "id": 1,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "double",\r
+                    "name": "double",\r
+                    "id": 2,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "string",\r
+                    "id": 3,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "boolean",\r
+                    "id": 4,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "null",\r
+                    "id": 5,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Array",\r
+                    "name": "array",\r
+                    "id": 6,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Object",\r
+                    "name": "object",\r
+                    "id": 7,\r
+                    "oneof": "type"\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {\r
+                "type": [\r
+                    1,\r
+                    2,\r
+                    3,\r
+                    4,\r
+                    5,\r
+                    6,\r
+                    7\r
+                ]\r
+            }\r
+        },\r
+        {\r
+            "name": "Array",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 1\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        },\r
+        {\r
+            "name": "Object",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "keys",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {},\r
+    "services": []\r
+}).build("js");\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.json
new file mode 100644 (file)
index 0000000..26ed18f
--- /dev/null
@@ -0,0 +1,123 @@
+{\r
+    "package": "js",\r
+    "messages": [\r
+        {\r
+            "name": "Value",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "sint32",\r
+                    "name": "integer",\r
+                    "id": 1,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "double",\r
+                    "name": "double",\r
+                    "id": 2,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "string",\r
+                    "id": 3,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "boolean",\r
+                    "id": 4,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "null",\r
+                    "id": 5,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Array",\r
+                    "name": "array",\r
+                    "id": 6,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Object",\r
+                    "name": "object",\r
+                    "id": 7,\r
+                    "oneof": "type"\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {\r
+                "type": [\r
+                    1,\r
+                    2,\r
+                    3,\r
+                    4,\r
+                    5,\r
+                    6,\r
+                    7\r
+                ]\r
+            }\r
+        },\r
+        {\r
+            "name": "Array",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 1\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        },\r
+        {\r
+            "name": "Object",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "keys",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/json.proto
new file mode 100644 (file)
index 0000000..d543392
--- /dev/null
@@ -0,0 +1,30 @@
+// Everything below is located in the js-namespace\r
+package js;\r
+\r
+// Represents a JavaScript value.\r
+// Contains exactly one or zero fields.\r
+message Value {\r
+    oneof type {\r
+        sint32 integer = 1;\r
+        double double = 2;\r
+        string string = 3;\r
+        bool boolean = 4;\r
+        bool null = 5;\r
+        Array array = 6;\r
+        Object object = 7;\r
+        // if none is set: undefined\r
+    }\r
+}\r
+\r
+// Represents a JavaScript array.\r
+// Contains zero to N values.\r
+message Array {\r
+    repeated Value values = 1;\r
+}\r
+\r
+// Represents a JavaScript object.\r
+// Contains zero to N keys with associated values.\r
+message Object {\r
+    repeated Value keys = 1;\r
+    repeated Value values = 2;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/package.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/package.json
new file mode 100644 (file)
index 0000000..f03b843
--- /dev/null
@@ -0,0 +1,15 @@
+{\r
+    "name": "protobufjs-protoify-example",\r
+    "version": "1.0.0",\r
+    "main": "index.js",\r
+    "dependencies": {\r
+        "protobufjs": "~3.7"\r
+    },\r
+    "engines": {\r
+        "node": ">=0.8"\r
+    },\r
+    "scripts": {\r
+        "test": "node test.js"\r
+    },\r
+    "private": true\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/test.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/protoify/test.js
new file mode 100644 (file)
index 0000000..c6c9e0d
--- /dev/null
@@ -0,0 +1,56 @@
+var protoify = require("./index.js"),\r
+    ByteBuffer = require("protobufjs").ByteBuffer,\r
+    assert = require("assert");\r
+\r
+// Array of samples to test\r
+var samples = [\r
+    1, -1, 0x80000000|0, 0x7fffffff|0,                    // Integers\r
+    0.1, 0.2, 1.234,                                      // Doubles\r
+    "John",                                               // String\r
+    true, false,                                          // Booleans\r
+    null,                                                 // null\r
+    [],                                                   // Array\r
+    {},                                                   // Object\r
+    undefined,                                            // undefined\r
+    [                                                     // Array holding each data type\r
+        1,\r
+        0.1,\r
+        "John",\r
+        true,\r
+        false,\r
+        null,\r
+        [],\r
+        {},\r
+        undefined\r
+    ],\r
+    {                                                     // Object holding each data type\r
+        1: 1,\r
+        0.1: 0.1,\r
+        "John": "John",\r
+        true: true,\r
+        false: false,\r
+        null: null,\r
+        array: [],\r
+        object: {},\r
+        undefined: undefined\r
+    }\r
+];\r
+\r
+samples.forEach(function(sample) {\r
+    // Encode each sample to a Buffer\r
+    var buf = protoify(sample);\r
+\r
+    // Print some nice debugging information\r
+    console.log(JSON.stringify(sample));\r
+    console.log("-------------------------------------------------------------------");\r
+    console.log(ByteBuffer.wrap(buf).toDebug(true));\r
+\r
+    // Decode the Buffer back to JSON\r
+    var decodedSample = protoify.parse(buf);\r
+\r
+    // And assert that it's actually equal\r
+    assert.deepEqual(decodedSample, sample);\r
+});\r
+\r
+// If no assertion errors are thrown, print\r
+console.log("OK");\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/README.md b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/README.md
new file mode 100644 (file)
index 0000000..6a2c403
--- /dev/null
@@ -0,0 +1,9 @@
+ProtoBuf.js WebSocket example\r
+=============================\r
+This example shows how to use binary websockets to transfer protocol buffers.\r
+\r
+Instructions\r
+------------\r
+1. Set up dependencies: `npm install`\r
+2. Run: `node server.js`\r
+3. Open [http://localhost:8080/](http://localhost:8080/) in a recent browser\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/package.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/package.json
new file mode 100644 (file)
index 0000000..3090d31
--- /dev/null
@@ -0,0 +1,16 @@
+{\r
+    "name": "protobufjs-websocket-example",\r
+    "version": "1.1.0",\r
+    "dependencies": {\r
+        "protobufjs": "~3",\r
+        "ws": "~0.4",\r
+        "open": "0.0.3"\r
+    },\r
+    "engines": {\r
+        "node": ">=0.8"\r
+    },\r
+    "scripts": {\r
+        "run": "node server.js"\r
+    },\r
+    "private": true\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/server.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/server.js
new file mode 100644 (file)
index 0000000..514cb15
--- /dev/null
@@ -0,0 +1,97 @@
+// Set up: npm install\r
+var http = require("http"),\r
+    fs = require("fs"),\r
+    path = require("path"),\r
+    ws = require("ws"),\r
+    open = require("open"),\r
+    ProtoBuf = require("protobufjs");\r
+\r
+// Copy dependencies to "www/" (example specific, you usually don't have to care\r
+var deps = [\r
+      ["Long.min.js", "./node_modules/long/dist/Long.min.js"],\r
+      ["ByteBufferAB.min.js", "./node_modules/bytebuffer/dist/ByteBufferAB.min.js"],\r
+      ["ProtoBuf.min.js", "./node_modules/protobufjs/dist/ProtoBuf.min.js"]\r
+];\r
+for (var i=0, dep, data; i<deps.length; i++) {\r
+    dep = deps[i];\r
+    if (!fs.existsSync(path.join(__dirname, "www", dep[0]))) {\r
+        console.log("Copying "+dep[0]+" from "+dep[1]);\r
+        try {\r
+            fs.writeFileSync(path.join(__dirname, "www", dep[0]), fs.readFileSync(path.join(__dirname, dep[1])));\r
+        } catch (err) {\r
+            console.log("Copying failed: "+err.message);\r
+            console.log("\nDid you run `npm install` ?");\r
+            process.exit(1);\r
+        }\r
+    }\r
+}\r
+\r
+// Initialize from .proto file\r
+var builder = ProtoBuf.loadProtoFile(path.join(__dirname, "www", "example.proto")),\r
+    Message = builder.build("Message");\r
+\r
+// HTTP server\r
+var server = http.createServer(function(req, res) {\r
+        var file = null,\r
+            type = "text/html";\r
+        if (req.url == "/") {\r
+            file = "index.html";\r
+        } else if (/^\/(\w+(?:\.min)?\.(?:js|html|proto))$/.test(req.url)) {\r
+            file = req.url.substring(1);\r
+            if (/\.js$/.test(file)) {\r
+                type = "text/javascript";\r
+            }\r
+        }\r
+        if (file) {\r
+            fs.readFile(path.join(__dirname, "www", file), function(err, data) {\r
+                if (err) {\r
+                    res.writeHead(500, {"Content-Type": type});\r
+                    res.end("Internal Server Error: "+err);\r
+                } else {\r
+                    res.writeHead(200, {"Content-Type": type});\r
+                    res.write(data);\r
+                    res.end();\r
+                    console.log("Served www/"+file);\r
+                }\r
+            });\r
+        } else {\r
+            res.writeHead(404, {"Content-Type": "text/html"});\r
+            res.end("Not Found");\r
+        }\r
+    });\r
+server.listen(8080);\r
+server.on("listening", function() {\r
+    console.log("Server started");\r
+    open("http://localhost:8080/");\r
+});\r
+server.on("error", function(err) {\r
+    console.log("Failed to start server:", err);\r
+    process.exit(1);\r
+});\r
+\r
+// WebSocket adapter\r
+var wss = new ws.Server({server: server});\r
+wss.on("connection", function(socket) {\r
+    console.log("New WebSocket connection");\r
+    socket.on("close", function() {\r
+        console.log("WebSocket disconnected");\r
+    });\r
+    socket.on("message", function(data, flags) {\r
+        if (flags.binary) {\r
+            try {\r
+                // Decode the Message\r
+                var msg = Message.decode(data);\r
+                console.log("Received: "+msg.text);\r
+                // Transform the text to upper case\r
+                msg.text = msg.text.toUpperCase();\r
+                // Re-encode it and send it back\r
+                socket.send(msg.toBuffer());\r
+                console.log("Sent: "+msg.text);\r
+            } catch (err) {\r
+                console.log("Processing failed:", err);\r
+            }\r
+        } else {\r
+            console.log("Not binary data");\r
+        }\r
+    });\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/www/example.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/www/example.proto
new file mode 100644 (file)
index 0000000..f717bf3
--- /dev/null
@@ -0,0 +1,3 @@
+message Message {\r
+    required string text = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/www/index.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/examples/websocket/www/index.html
new file mode 100644 (file)
index 0000000..cb2cf4b
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>                                        <!-- Please copy the following files into here: -->\r
+<script src="./Long.min.js"></script>         <!-- https://raw.github.com/dcodeIO/Long.js/master/dist/Long.min.js -->\r
+<script src="./ByteBufferAB.min.js"></script> <!-- https://raw.github.com/dcodeIO/ByteBuffer.js/master/dist/ByteBufferAB.min.js -->\r
+<script src="./ProtoBuf.min.js"></script>     <!-- https://raw.github.com/dcodeIO/ProtoBuf.js/master/dist/ProtoBuf.min.js -->\r
+<script>\r
+if (typeof dcodeIO === 'undefined' || !dcodeIO.ProtoBuf) {\r
+    throw(new Error("ProtoBuf.js is not present. Please see www/index.html for manual setup instructions."));\r
+}\r
+// Initialize ProtoBuf.js\r
+var ProtoBuf = dcodeIO.ProtoBuf;\r
+var Message = ProtoBuf.loadProtoFile("./example.proto").build("Message");\r
+</script>\r
+</head>\r
+<body>\r
+<textarea id="log" style="width: 100%; height: 200px"></textarea><br />\r
+<input type="text" id="text" value="hello world!" /> <button onclick="send()">Send</button>\r
+\r
+<script>\r
+var log = document.getElementById("log");\r
+var text = document.getElementById("text");\r
+\r
+// Connect to our server: node server.js\r
+var socket = new WebSocket("ws://localhost:8080/ws");\r
+socket.binaryType = "arraybuffer"; // We are talking binary\r
+\r
+function send() {\r
+    if (socket.readyState == WebSocket.OPEN) {\r
+        var msg = new Message(text.value);\r
+        socket.send(msg.toArrayBuffer());\r
+        log.value += "Sent: "+msg.text+"\n";\r
+    } else {\r
+        log.value += "Not connected\n";\r
+    }\r
+}\r
+\r
+socket.onopen = function() {\r
+    log.value += "Connected\n";\r
+};\r
+\r
+socket.onclose = function() {\r
+    log.value += "Disconnected\n";\r
+};\r
+    \r
+socket.onmessage = function(evt) {\r
+    try {\r
+        // Decode the Message\r
+        var msg = Message.decode(evt.data);\r
+        log.value += "Received: "+msg.text+"\n";\r
+    } catch (err) {\r
+        log.value += "Error: "+err+"\n";\r
+    }\r
+};\r
+\r
+log.value = ""; // Clear log on reload\r
+</script>\r
+</body>\r
+</html>\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/externs/fs.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/externs/fs.js
new file mode 100644 (file)
index 0000000..04b422d
--- /dev/null
@@ -0,0 +1,644 @@
+/*\r
+ * Copyright 2012 The Closure Compiler Authors.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @fileoverview Definitions for node's "fs" module.\r
+ * @see http://nodejs.org/api/fs.html\r
+ * @externs\r
+ * @author Daniel Wirtz <dcode@dcode.io>\r
+ */\r
+\r
+/**\r
+ BEGIN_NODE_INCLUDE\r
+ var fs = require('fs');\r
+ END_NODE_INCLUDE\r
+ */\r
+\r
+var fs = {};\r
+\r
+/**\r
+ * @param {string} oldPath\r
+ * @param {string} newPath\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.rename = function(oldPath, newPath, callback) {};\r
+\r
+/**\r
+ * @param {string} oldPath\r
+ * @param {string} newPath\r
+ */\r
+fs.renameSync = function(oldPath, newPath) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} len\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.truncate = function(fd, len, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} len\r
+ */\r
+fs.truncateSync = function(fd, len) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.chown = function(path, uid, gid, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ */\r
+fs.chownSync = function(path, uid, gid) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.fchown = function(fd, uid, gid, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ */\r
+fs.fchownSync = function(fd, uid, gid) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.lchown = function(path, uid, gid, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ */\r
+fs.lchownSync = function(path, uid, gid) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.chmod = function(path, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ */\r
+fs.chmodSync = function(path, mode) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.fchmod = function(fd, mode, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} mode\r
+ */\r
+fs.fchmodSync = function(fd, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.lchmod = function(path, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ */\r
+fs.lchmodSync = function(path, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string, fs.Stats)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.stat = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {fs.Stats}\r
+ * @nosideeffects\r
+ */\r
+fs.statSync = function(path) {}\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {function(string, fs.Stats)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.fstat = function(fd, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @return {fs.Stats}\r
+ * @nosideeffects\r
+ */\r
+fs.fstatSync = function(fd) {}\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string, fs.Stats)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.lstat = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {fs.Stats}\r
+ * @nosideeffects\r
+ */\r
+fs.lstatSync = function(path) {}\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.link = function(srcpath, dstpath, callback) {};\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ */\r
+fs.linkSync = function(srcpath, dstpath) {};\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ * @param {string=} type\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.symlink = function(srcpath, dstpath, type, callback) {};\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ * @param {string=} type\r
+ */\r
+fs.symlinkSync = function(srcpath, dstpath, type) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string, string)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.readlink = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+fs.readlinkSync = function(path) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {object.<string,string>=|function(string, string)=} cache\r
+ * @param {function(string, string)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.realpath = function(path, cache, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {object.<string,string>=} cache\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+fs.realpathSync = function(path, cache) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.unlink = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ */\r
+fs.unlinkSync = function(path) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.rmdir = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ */\r
+fs.rmdirSync = function(path) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number=} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.mkdir = function(path, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number=} mode\r
+ */\r
+fs.mkdirSync = function(path, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string,array.<string>)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.readdir = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {array.<string>}\r
+ * @nosideeffects\r
+ */\r
+fs.readdirSync = function(path) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.close = function(fd, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ */\r
+fs.closeSync = function(fd) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {string} flags\r
+ * @param {number=} mode\r
+ * @param {function(string, *)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.open = function(path, flags, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {string} flags\r
+ * @param {number=} mode\r
+ * @return {*}\r
+ * @nosideeffects\r
+ */\r
+fs.openSync = function(path, flags, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @param {function(...)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.utimes = function(path, atime, mtime, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @nosideeffects\r
+ */\r
+fs.utimesSync = function(path, atime, mtime) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @param {function(...)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.futimes = function(fd, atime, mtime, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @nosideeffects\r
+ */\r
+fs.futimesSync = function(fd, atime, mtime) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.fsync = function(fd, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ */\r
+fs.fsyncSync = function(fd) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @param {function(string, number, *)=} callback\r
+ */\r
+fs.write = function(fd, buffer, offset, length, position, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @return {number}\r
+ */\r
+fs.writeSync = function(fd, buffer, offset, length, position) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @param {function(string, number, *)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.read = function(fd, buffer, offset, length, position, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @return {number}\r
+ * @nosideeffects\r
+ */\r
+fs.readSync = function(fd, buffer, offset, length, position) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {string=|function(string, *)=}encoding\r
+ * @param {function(string, *)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.readFile = function(filename, encoding, callback) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {string=} encoding\r
+ * @nosideeffects\r
+ */\r
+fs.readFileSync = function(filename, encoding) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=|function(string)=} encoding\r
+ * @param {function(string)=} callback\r
+ */\r
+fs.writeFile = function(filename, data, encoding, callback) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=} encoding\r
+ */\r
+fs.writeFileSync = function(filename, data, encoding) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=|function(string)=} encoding\r
+ * @param {function(string)=} callback\r
+ */\r
+fs.appendFile = function(filename, data, encoding, callback) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=|function(string)=} encoding\r
+ */\r
+fs.appendFileSync = function(filename, data, encoding) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {{persistent: boolean, interval: number}=|function(*,*)} options\r
+ * @param {function(*,*)=} listener\r
+ */\r
+fs.watchFile = function(filename, options, listener) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {function=} listener\r
+ */\r
+fs.unwatchFile = function(filename, listener) {};\r
+\r
+/**\r
+ * \r
+ * @param {string} filename\r
+ * @param {{persistent: boolean}=|function(string, string)} options\r
+ * @param {function(string, string)=} listener\r
+ * @return {fs.FSWatcher}\r
+ */\r
+fs.watch = function(filename, options, listener) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(boolean)} callback\r
+ * @nosideeffects\r
+ */\r
+fs.exists = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @nosideeffects\r
+ */\r
+fs.existsSync = function(path) {};\r
+\r
+/**\r
+ * @constructor\r
+ */\r
+fs.Stats = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isFile = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isDirectory = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isBlockDevice = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isCharacterDevice = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isSymbolicLink = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isFIFO = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isSocket = function() {};\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.dev = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.ino = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.mode = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.nlink = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.uid = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.gid = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.rdev = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.size = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.blkSize = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.blocks = 0;\r
+\r
+/**\r
+ * @type {Date}\r
+ */\r
+fs.Stats.prototype.atime = 0;\r
+\r
+/**\r
+ * @type {Date}\r
+ */\r
+fs.Stats.prototype.mtime = 0;\r
+\r
+/**\r
+ * @type {Date}\r
+ */\r
+fs.Stats.prototype.ctime = 0;\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {{flags: string, encoding: ?string, fd: *, mode: number, bufferSize: number}=} options\r
+ * @nosideeffects\r
+ */\r
+fs.createReadStream = function(path, options) {};\r
+\r
+/**\r
+ * @constructor\r
+ * @extends {stream.ReadableStream}\r
+ */\r
+fs.ReadStream = function() {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {{flags: string, encoding: ?string, mode: number}=} options\r
+ * @nosideeffects\r
+ */\r
+fs.createWriteStream = function(path, options) {};\r
+\r
+/**\r
+ * @constructor\r
+ * @extends {stream.WritableStream}\r
+ */\r
+fs.WriteStream = function() {};\r
+\r
+/**\r
+ * @param {string} event\r
+ * @param {function(...)} callback\r
+ */\r
+fs.WriteStream.prototype.on = function(event, callback) {};\r
+\r
+/**\r
+ * @constructor\r
+ */\r
+fs.FSWatcher = function() {};\r
+\r
+/**\r
+ */\r
+fs.FSWatcher.prototype.close = function() {};\r
+\r
+/**\r
+ * @param {string} event\r
+ * @param {function(...)} callback\r
+ */\r
+fs.FSWatcher.prototype.on = function(event, callback) {};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/externs/protobuf.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/externs/protobuf.js
new file mode 100644 (file)
index 0000000..a2ad4d1
--- /dev/null
@@ -0,0 +1,933 @@
+/*\r
+ * Copyright 2012 The Closure Compiler Authors.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @fileoverview Externs for ProtoBuf.js.\r
+ * @see https://github.com/dcodeIO/ProtoBuf.js\r
+ * @externs\r
+ */\r
+\r
+/**\r
+ BEGIN_NODE_INCLUDE\r
+ var ProtoBuf = require('protobufjs');\r
+ END_NODE_INCLUDE\r
+ */\r
+\r
+/**\r
+ * @typedef {Array}\r
+ */\r
+var Buffer;\r
+\r
+/**\r
+ * @typedef {Object}\r
+ */\r
+var dcodeIO;\r
+\r
+/**\r
+ * {@type Object.<string.*>}\r
+ */\r
+var ProtoBuf = {};\r
+\r
+/**\r
+ * @type {string}\r
+ * @const\r
+ */\r
+ProtoBuf.VERSION;\r
+\r
+/**\r
+ * @type {!Object.<string,number>}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES = {};\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.VARINT;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS64;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.LDELIM;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.STARTGROUP;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.ENDGROUP;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS32;\r
+\r
+/**\r
+ * @type {!Array.<number>}\r
+ * @const\r
+ */\r
+ProtoBuf.PACKABLE_WIRE_TYPES;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.convertFieldsToCamelCase;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.populateAccessors;\r
+\r
+/**\r
+ * @dict\r
+ * @type {!Object<string,{name: string, wireType: number}>}\r
+ * @const\r
+ */\r
+ProtoBuf.TYPES;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.ID_MIN;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.ID_MAX;\r
+\r
+/**\r
+ * @type {!function(new: ByteBuffer, ...*)}\r
+ */\r
+ProtoBuf.ByteBuffer;\r
+\r
+/**\r
+ * @type {?function(new: Long, ...*)}\r
+ */\r
+ProtoBuf.Long;\r
+\r
+/**\r
+ * @type {!Object<string,string|RegExp>}\r
+ */\r
+ProtoBuf.Lang;\r
+\r
+/**\r
+ * @type {Object<string, function(*)>}\r
+ */\r
+ProtoBuf.DotProto;\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @constructor\r
+ */\r
+ProtoBuf.DotProto.Tokenizer = function(proto) {};\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.source;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.index;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.line;\r
+\r
+/**\r
+ * @type {Array.<string>}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.stack;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.readingString;\r
+\r
+/**\r
+ * @return {?string}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.next = function() {};\r
+\r
+/**\r
+ * @return {?string}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.peek = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.toString = function() {};\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @constructor\r
+ */\r
+ProtoBuf.DotProto.Parser = function(proto) {};\r
+\r
+/**\r
+ * @type {!ProtoBuf.DotProto.Tokenizer}\r
+ */\r
+ProtoBuf.DotProto.Parser.prototype.tn;\r
+\r
+/**\r
+ * @return {{package: (string|null), messages: Array.<Object>, enums: Array.<Object>, imports: Array.<string>, options: Object<string,*>}}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.DotProto.Parser.prototype.parse = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.DotProto.Parser.prototype.toString = function() {};\r
+\r
+/**\r
+ * @type {Object<string, function(*)>}\r
+ */\r
+ProtoBuf.Reflect.Reflect = {};\r
+\r
+/**\r
+ * @constructor\r
+ * @param {ProtoBuf.Reflect.T} parent\r
+ * @param {string} name Object name\r
+ */\r
+ProtoBuf.Reflect.T = function(parent, name) {};\r
+\r
+/**\r
+ * @type {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Reflect.T.prototype.parent;\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.T.prototype.name;\r
+\r
+/**\r
+ * @returns {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.T.prototype.fqn = function() {};\r
+\r
+/**\r
+ * @param {boolean=} includeClass\r
+ * @returns {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.T.prototype.toString = function(includeClass) {};\r
+\r
+/**\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.T.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {?ProtoBuf.Reflect.Namespace} parent\r
+ * @param {string} name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Namespace = function(parent, name) {};\r
+\r
+/**\r
+ * @type {Array.<ProtoBuf.Reflect.T>}\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.children;\r
+\r
+/**\r
+ * @param {ProtoBuf.Reflect.T=} type\r
+ * @return {Array.<ProtoBuf.Reflect.T>}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.getChildren = function(type) {};\r
+\r
+/**\r
+ * @param {ProtoBuf.Reflect.T} child\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.addChild = function(child) {};\r
+\r
+/**\r
+ * @param {string|number} nameOrId\r
+ * @returns {boolean}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.hasChild = function(nameOrId) {};\r
+\r
+/**\r
+ * @param {string|number} nameOrId\r
+ * @return {?ProtoBuf.Reflect.T}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.getChild = function(nameOrId) {};\r
+\r
+/**\r
+ * @param {string} qn\r
+ * @param {boolean=} excludeFields\r
+ * @return {?ProtoBuf.Reflect.Namespace}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.resolve = function(qn, excludeFields) {};\r
+\r
+/**\r
+ * @return {Object.<string,Function|Object>}\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Namespace} parent\r
+ * @param {string} name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+ProtoBuf.Reflect.Message = function(parent, name) {};\r
+\r
+/**\r
+ * @type {?Array.<number>}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.extensions;\r
+\r
+/**\r
+ * @type {?ProtoBuf.Builder.Message}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.clazz;\r
+\r
+/**\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Builder.Message} message\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.encode = function(message, buffer) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Builder.Message} message\r
+ * @return {number}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.calculate = function(message) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Builder.Message} message\r
+ * @param {!ByteBuffer} buffer\r
+ * @param {boolean} noVerify\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.encodeDelimited = function(message, buffer, noVerify) {};\r
+\r
+/**\r
+ * @param {!ByteBuffer} buffer\r
+ * @param {number=} length\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.decode = function(buffer, length) {};\r
+\r
+/**\r
+ * @param {!ByteBuffer} buffer\r
+ * @param {number=} length\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.decodeDelimited = function(buffer, length) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Message} message\r
+ * @param {string} rule\r
+ * @param {string} type\r
+ * @param {string} name\r
+ * @param {number} id\r
+ * @param {Object<string>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Message.Field = function(message, rule, type, name, id, options) {};\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.required;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.repeated;\r
+\r
+/**\r
+ * @type {string|{name: string, wireType: number}}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.type;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.id;\r
+\r
+/**\r
+ * @type {!Object.<string,*>}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.options;\r
+\r
+/**\r
+ * @type {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.resolvedType;\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.originalName;\r
+\r
+/**\r
+ * @param {*} value\r
+ * @param {boolean=} skipRepeated\r
+ * @return {*}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.verifyValue = function(value, skipRepeated) {};\r
+\r
+/**\r
+ * @param {*} value\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.encode = function(value, buffer) {};\r
+\r
+/**\r
+ * @param {*} value\r
+ * @return {number}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.calculate = function(value) {};\r
+\r
+/**\r
+ * @param {number} wireType\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {*}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.decode = function(wireType, buffer) {};\r
+\r
+/**\r
+ * @param {*} value\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.encodeValue = function(value, buffer) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.T} parent\r
+ * @param {string} name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+ProtoBuf.Reflect.Enum = function(parent, name) {};\r
+\r
+/**\r
+ * @return {Object<string,*>}\r
+ */\r
+ProtoBuf.Reflect.Enum.prototype.build = function() {};\r
+\r
+/**\r
+ * @type {?Object.<string,number>}\r
+ */\r
+ProtoBuf.Reflect.Enum.prototype.object;\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Enum} enm\r
+ * @param {string} name\r
+ * @param {number} id \r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Enum.Value = function(enm, name, id) {};\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.Reflect.Enum.Value.prototype.id;\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Namespace} root\r
+ * @param {string} name Service name\r
+ * @param {Object.<string,*>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+ProtoBuf.Reflect.Service = function(root, name, options) {};\r
+\r
+/**\r
+ * @type {ProtoBuf.Builder.Service}\r
+ */\r
+ProtoBuf.Reflect.Service.prototype.clazz;\r
+\r
+/**\r
+ * @return {!ProtoBuf.Builder.Service}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Service.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Service} svc\r
+ * @param {string} name\r
+ * @param {Object.<string,*>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Service.Method = function(svc, name, options) {};\r
+\r
+/**\r
+ * @return {Object.<string,*>}\r
+ */\r
+ProtoBuf.Reflect.Service.Method.prototype.buildOpt = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Service} svc\r
+ * @param {string} name\r
+ * @param {string} request\r
+ * @param {string} response\r
+ * @param {Object.<string,*>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Service.Method\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod = function(svc, name, request, response, options) {};\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.requestName;\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.responseName;\r
+\r
+/**\r
+ * @type {ProtoBuf.Reflect.Message}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedRequestType;\r
+\r
+/**\r
+ * @type {ProtoBuf.Reflect.Message}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedResponseType;\r
+\r
+/**\r
+ * @constructor\r
+ */\r
+ProtoBuf.Builder = function() {};\r
+\r
+/**\r
+ * @type {!ProtoBuf.Reflect.Namespace}\r
+ */\r
+ProtoBuf.Builder.prototype.ns;\r
+\r
+/**\r
+ * @type {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Builder.prototype.ptr;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Builder.prototype.resolved;\r
+\r
+/**\r
+ * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}\r
+ */\r
+ProtoBuf.Builder.prototype.result;\r
+\r
+/**\r
+ * @type {Array.<string>}\r
+ */\r
+ProtoBuf.Builder.prototype.files;\r
+\r
+/**\r
+ * @type {?string}\r
+ */\r
+ProtoBuf.Builder.prototype.importRoot;\r
+\r
+/**\r
+ */\r
+ProtoBuf.Builder.prototype.reset = function() {};\r
+\r
+/**\r
+ * @param {string} pkg\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.define = function(pkg) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.isValidMessage = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.isValidMessageField = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Builder.isValidEnum = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Builder.isValidService = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Builder.isValidExtend = function(def) {};\r
+\r
+/**\r
+ * @param {Array.<Object.<string,*>>} messages\r
+ * @return {ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.create = function(messages) {};\r
+\r
+/**\r
+ * @name ProtoBuf.Builder.prototype.import\r
+ * @function\r
+ * @param {ProtoBuf.Builder} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype["import"] = function(builder, filename) {};\r
+\r
+/**\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.resolveAll = function() {};\r
+\r
+/**\r
+ * @param {string=} path\r
+ * @return {ProtoBuf.Builder.Message|Object.<string,*>}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.build = function(path) {};\r
+\r
+/**\r
+ * @param {string=} path\r
+ * @return {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Builder.prototype.lookup = function(path) {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.prototype.toString = function() {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} values\r
+ * @constructor\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message = function(values) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.add = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.$add = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.set = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.$set = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @return {*}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.get = function(key) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @return {*}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.$get = function(key) {};\r
+\r
+/**\r
+ * @param {ByteBuffer=} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encode = function(buffer) {};\r
+\r
+/**\r
+ * @return {number}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.calculate = function() {};\r
+\r
+/**\r
+ * @return {!ArrayBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encodeAB = function() {};\r
+\r
+/**\r
+ * @return {!ArrayBuffer}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toArrayBuffer = function() {};\r
+\r
+/**\r
+ * @return {!Buffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encodeNB = function() {};\r
+\r
+/**\r
+ * @return {!Buffer}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toBuffer = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encode64 = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toBase64 = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encodeHex = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toHex = function() {};\r
+\r
+/**\r
+ * @param {boolean=} includeBuffers\r
+ * @return {Object.<string,*>}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toRaw = function(includeBuffers) {};\r
+\r
+/**\r
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer\r
+ * @param {string=} enc\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.decode = function(buffer, enc) {};\r
+\r
+/**\r
+ * @param {string} str\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.decode64 = function(str) {};\r
+\r
+/**\r
+ * @param {string} str\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.decodeHex = function(str) {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toString = function() {};\r
+\r
+/**\r
+ * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl\r
+ * @constructor\r
+ */\r
+ProtoBuf.Builder.Service = function(rpcImpl) {};\r
+\r
+/**\r
+ * @type {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r
+ */\r
+ProtoBuf.Builder.prototype.rpcImpl;\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @param {(ProtoBuf.Builder|string)=} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadProto = function(proto, builder, filename) {};\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.protoFromString = function(proto, builder, filename) {};\r
+\r
+/**\r
+ * @param {string|{root: string, file: string}} filename\r
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback\r
+ * @param {ProtoBuf.Builder=} builder\r
+ * @return {ProtoBuf.Builder|undefined}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadProtoFile = function(filename, callback, builder) {};\r
+\r
+/**\r
+ * @param {string|{root: string, file: string}} filename\r
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback\r
+ * @param {ProtoBuf.Builder=} builder\r
+ * @return {ProtoBuf.Builder|undefined}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.protoFromFile = function(filename, callback, builder) {};\r
+\r
+/**\r
+ * @param {!*|string} json\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadJson = function(json, builder, filename) {};\r
+\r
+/**\r
+ * @param {string|{root: string, file: string}} filename\r
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback\r
+ * @param {ProtoBuf.Builder=} builder\r
+ * @return {ProtoBuf.Builder|undefined}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadJsonFile = function(filename, callback, builder) {};\r
+\r
+/**\r
+ * @param {string=} pkg\r
+ * @return {!ProtoBuf.Builder}\r
+ */\r
+ProtoBuf.newBuilder = function(pkg) {};\r
+\r
+ProtoBuf.Util = {};\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Util.IS_NODE;\r
+\r
+/**\r
+ * @return {XMLHttpRequest}\r
+ */\r
+ProtoBuf.Util.XHR = function() {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(?string)=} callback\r
+ * @return {?string|undefined}\r
+ */\r
+ProtoBuf.Util.fetch = function(path, callback) {};\r
+\r
+/**\r
+ * @param {*} obj\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Util.isArray = function(obj) {};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/index.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/index.js
new file mode 100644 (file)
index 0000000..989d3b0
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./dist/protobuf.js");\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/jsdoc.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/jsdoc.json
new file mode 100644 (file)
index 0000000..5527efd
--- /dev/null
@@ -0,0 +1,12 @@
+{\r
+    "tags": {\r
+        "allowUnknownTags": true\r
+    },\r
+    "source": {\r
+        "include": ["dist/protobuf.js"]\r
+    },\r
+    "opts": {\r
+        "destination": "docs"\r
+    },\r
+    "plugins": ["plugins/markdown"]\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/package.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/package.json
new file mode 100644 (file)
index 0000000..0b6a196
--- /dev/null
@@ -0,0 +1,135 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "protobufjs@^5.0.3",
+        "scope": null,
+        "escapedName": "protobufjs",
+        "name": "protobufjs",
+        "rawSpec": "^5.0.3",
+        "spec": ">=5.0.3 <6.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/grpc"
+    ]
+  ],
+  "_from": "protobufjs@>=5.0.3 <6.0.0",
+  "_id": "protobufjs@5.0.3",
+  "_inCache": true,
+  "_location": "/grpc/protobufjs",
+  "_nodeVersion": "8.9.1",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/protobufjs_5.0.3_1526462497935_0.23118861557345283"
+  },
+  "_npmUser": {
+    "name": "dcode",
+    "email": "dcode+npm@dcode.io"
+  },
+  "_npmVersion": "5.5.1",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "protobufjs@^5.0.3",
+    "scope": null,
+    "escapedName": "protobufjs",
+    "name": "protobufjs",
+    "rawSpec": "^5.0.3",
+    "spec": ">=5.0.3 <6.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/grpc"
+  ],
+  "_resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz",
+  "_shasum": "e4dfe9fb67c90b2630d15868249bcc4961467a17",
+  "_shrinkwrap": null,
+  "_spec": "protobufjs@^5.0.3",
+  "_where": "/var/opt/motion2/node_modules/grpc",
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode@dcode.io"
+  },
+  "bin": {
+    "pbjs": "./bin/pbjs"
+  },
+  "browser": {
+    "fs": false,
+    "path": false
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "contributors": [
+    {
+      "name": "Frank Xu",
+      "email": "yyfrankyy@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ascli": "~1",
+    "bytebuffer": "~5",
+    "glob": "^7.0.5",
+    "yargs": "^3.10.0"
+  },
+  "description": "Protocol Buffers for JavaScript. Finally.",
+  "devDependencies": {
+    "closurecompiler": "~1",
+    "fixture-stdout": "^0.2.1",
+    "jsdoc": "~3.3.0-alpha10",
+    "metascript": ">=0.18 <1",
+    "testjs": "~1 >=1.0.4"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==",
+    "shasum": "e4dfe9fb67c90b2630d15868249bcc4961467a17",
+    "tarball": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz",
+    "fileCount": 189,
+    "unpackedSize": 3128808,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+/gjCRA9TVsSAnZWagAA4lAQAIQu/R1fQv2iN0SAWNaR\nDe6nwKeB3BTkxeIB/HNfwzhVEmSepbskJrzx4ZSGlnSKLI/R/RPjh1yvx6dG\nQ1+1ddWcSTbAj85enFcR1WIb3/rV92W+61sba8vh8+yYlPs/HO2aXc7RqjuH\nnWAHJ/WgQItMdiOLbXxtm1s0oFiK2/l9tLVU+xzIIjADzNjPSD/tHZkc4S1a\n7b+6AX0lviG2A9AxyQgF/WLoY8sY7xEHiukE6mFfu0l8c9u0IeM9zx/wtzyB\nPKaBjzjDgEkqbrLGVARuYTOT5oFd/DNESLfkpYRJWsYgTHluY+RUyxCM2n61\nRRSqNedYavPi602su160AQnANLH8wyQG+KSdaPPR9TmCYE+5+B1TZU77jYKL\nyCmwoNi/SV8U9HNESFrgh/lMqizYOyLjfmhdeegEw4+p6fDBcW6//JWRBo2k\no5hQgsgmcSDV3wPrZoRMOC5z1x0hm9DlojZ7lJk5fuoVYjT1/K4BhcM4OFFu\ndy77gZl9MSEQWxMDp8VHPYVCsnEjJtKdqPJgiB9sD9qqM+b9BxC2eiGjh5rw\n5/3zecpFTtdJ0zn4XlFk/JrBTF9+WNTI4akHqWmzOkFmrqdn8d+JgPD+FJph\nfPHLENcZ+AqwDhZhMxV4LKHZ8t2XlhCfvFu26nQ6sfXmpPUfo/Qj5gj5DIcS\nUf1W\r\n=4WLx\r\n-----END PGP SIGNATURE-----\r\n"
+  },
+  "engines": {
+    "node": ">=0.8"
+  },
+  "gitHead": "2c2ffbc084cb36c971885707c559cccdb242d08f",
+  "homepage": "https://github.com/dcodeIO/protobuf.js",
+  "keywords": [
+    "net",
+    "buffer",
+    "protobuf",
+    "serialization",
+    "bytebuffer",
+    "websocket",
+    "webrtc"
+  ],
+  "license": "Apache-2.0",
+  "main": "./dist/protobuf.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    }
+  ],
+  "name": "protobufjs",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "build": "node scripts/build.js",
+    "compile": "npm run-script compile-full && npm run-script compile-light",
+    "compile-full": "ccjs dist/protobuf.js --create_source_map=dist/protobuf.min.map --compilation_level=SIMPLE_OPTIMIZATIONS > dist/protobuf.min.js",
+    "compile-light": "ccjs dist/protobuf-light.js --create_source_map=dist/protobuf-light.min.map --compilation_level=SIMPLE_OPTIMIZATIONS > dist/protobuf-light.min.js",
+    "compress": "npm run-script compress-full && npm run-script compress-light",
+    "compress-full": "gzip -c -9 dist/protobuf.min.js > dist/protobuf.min.js.gz",
+    "compress-light": "gzip -c -9 dist/protobuf-light.min.js > dist/protobuf-light.min.js.gz",
+    "descriptor2json": "node bin/pbjs src/google/protobuf/descriptor.proto --target=json > src/google/protobuf/descriptor.json",
+    "jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc.json",
+    "make": "npm run-script build && npm run-script compile && npm run-script descriptor2json && npm run-script compress && npm test && npm run-script jsdoc",
+    "prepublish": "npm test",
+    "test": "node bin/pbjs tests/complex.proto --target=json > tests/complex.json && node node_modules/testjs/bin/testjs tests/suite.js"
+  },
+  "version": "5.0.3"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/protobuf.png b/legacy-libs/grpc-cloned/node_modules/protobufjs/protobuf.png
new file mode 100644 (file)
index 0000000..7569a93
Binary files /dev/null and b/legacy-libs/grpc-cloned/node_modules/protobufjs/protobuf.png differ
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/scripts/build.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/scripts/build.js
new file mode 100644 (file)
index 0000000..db3ab95
--- /dev/null
@@ -0,0 +1,53 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+var MetaScript = require("metascript"),\r
+    path = require("path"),\r
+    fs = require("fs");\r
+\r
+var rootDir = path.join(__dirname, ".."),\r
+    srcDir  = path.join(rootDir, "src"),\r
+    distDir = path.join(rootDir, "dist"),\r
+    pkg = require(path.join(rootDir, "package.json")),\r
+    filename;\r
+\r
+var scope = {\r
+    VERSION: pkg.version,           // Version\r
+    DOTPROTO: true                  // Whether to include the ProtoBuf.DotProto package for .proto syntax support\r
+};\r
+\r
+// Make full build\r
+console.log("Building protobuf.js with scope", JSON.stringify(scope, null, 2));\r
+fs.writeFileSync(\r
+    path.join(distDir, "protobuf.js"),\r
+    MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)\r
+);\r
+\r
+// Make light build\r
+scope.DOTPROTO = false;\r
+console.log("Building protobuf-light.js with scope", JSON.stringify(scope, null, 2));\r
+fs.writeFileSync(\r
+    path.join(distDir, "protobuf-light.js"),\r
+    MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)\r
+);\r
+\r
+// Update bower.json\r
+scope = { VERSION: pkg.version };\r
+console.log("Updating bower.json with scope", JSON.stringify(scope, null, 2));\r
+fs.writeFileSync(\r
+    path.join(rootDir, "bower.json"),\r
+    MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "bower.json.in")), filename, scope, srcDir)\r
+);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder.js
new file mode 100644 (file)
index 0000000..18eeba8
--- /dev/null
@@ -0,0 +1,634 @@
+/**\r
+ * @alias ProtoBuf.Builder\r
+ * @expose\r
+ */\r
+ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Constructs a new Builder.\r
+     * @exports ProtoBuf.Builder\r
+     * @class Provides the functionality to build protocol messages.\r
+     * @param {Object.<string,*>=} options Options\r
+     * @constructor\r
+     */\r
+    var Builder = function(options) {\r
+\r
+        /**\r
+         * Namespace.\r
+         * @type {ProtoBuf.Reflect.Namespace}\r
+         * @expose\r
+         */\r
+        this.ns = new Reflect.Namespace(this, null, ""); // Global namespace\r
+\r
+        /**\r
+         * Namespace pointer.\r
+         * @type {ProtoBuf.Reflect.T}\r
+         * @expose\r
+         */\r
+        this.ptr = this.ns;\r
+\r
+        /**\r
+         * Resolved flag.\r
+         * @type {boolean}\r
+         * @expose\r
+         */\r
+        this.resolved = false;\r
+\r
+        /**\r
+         * The current building result.\r
+         * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}\r
+         * @expose\r
+         */\r
+        this.result = null;\r
+\r
+        /**\r
+         * Imported files.\r
+         * @type {Array.<string>}\r
+         * @expose\r
+         */\r
+        this.files = {};\r
+\r
+        /**\r
+         * Import root override.\r
+         * @type {?string}\r
+         * @expose\r
+         */\r
+        this.importRoot = null;\r
+\r
+        /**\r
+         * Options.\r
+         * @type {!Object.<string, *>}\r
+         * @expose\r
+         */\r
+        this.options = options || {};\r
+    };\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.prototype\r
+     * @inner\r
+     */\r
+    var BuilderPrototype = Builder.prototype;\r
+\r
+    // ----- Definition tests -----\r
+\r
+    /**\r
+     * Tests if a definition most likely describes a message.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isMessage = function(def) {\r
+        // Messages require a string name\r
+        if (typeof def["name"] !== 'string')\r
+            return false;\r
+        // Messages do not contain values (enum) or rpc methods (service)\r
+        if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes a message field.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isMessageField = function(def) {\r
+        // Message fields require a string rule, name and type and an id\r
+        if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes an enum.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isEnum = function(def) {\r
+        // Enums require a string name\r
+        if (typeof def["name"] !== 'string')\r
+            return false;\r
+        // Enums require at least one value\r
+        if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes a service.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isService = function(def) {\r
+        // Services require a string name and an rpc object\r
+        if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes an extended message\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isExtend = function(def) {\r
+        // Extends rquire a string ref\r
+        if (typeof def["ref"] !== 'string')\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    // ----- Building -----\r
+\r
+    /**\r
+     * Resets the pointer to the root namespace.\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @expose\r
+     */\r
+    BuilderPrototype.reset = function() {\r
+        this.ptr = this.ns;\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Defines a namespace on top of the current pointer position and places the pointer on it.\r
+     * @param {string} namespace\r
+     * @return {!ProtoBuf.Builder} this\r
+     * @expose\r
+     */\r
+    BuilderPrototype.define = function(namespace) {\r
+        if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r
+            throw Error("illegal namespace: "+namespace);\r
+        namespace.split(".").forEach(function(part) {\r
+            var ns = this.ptr.getChild(part);\r
+            if (ns === null) // Keep existing\r
+                this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r
+            this.ptr = ns;\r
+        }, this);\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Creates the specified definitions at the current pointer position.\r
+     * @param {!Array.<!Object>} defs Messages, enums or services to create\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @throws {Error} If a message definition is invalid\r
+     * @expose\r
+     */\r
+    BuilderPrototype.create = function(defs) {\r
+        if (!defs)\r
+            return this; // Nothing to create\r
+        if (!Array.isArray(defs))\r
+            defs = [defs];\r
+        else {\r
+            if (defs.length === 0)\r
+                return this;\r
+            defs = defs.slice();\r
+        }\r
+\r
+        // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r
+        var stack = [defs];\r
+        while (stack.length > 0) {\r
+            defs = stack.pop();\r
+\r
+            if (!Array.isArray(defs)) // Stack always contains entire namespaces\r
+                throw Error("not a valid namespace: "+JSON.stringify(defs));\r
+\r
+            while (defs.length > 0) {\r
+                var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r
+\r
+                if (Builder.isMessage(def)) {\r
+                    var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);\r
+\r
+                    // Create OneOfs\r
+                    var oneofs = {};\r
+                    if (def["oneofs"])\r
+                        Object.keys(def["oneofs"]).forEach(function(name) {\r
+                            obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r
+                        }, this);\r
+\r
+                    // Create fields\r
+                    if (def["fields"])\r
+                        def["fields"].forEach(function(fld) {\r
+                            if (obj.getChild(fld["id"]|0) !== null)\r
+                                throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);\r
+                            if (fld["options"] && typeof fld["options"] !== 'object')\r
+                                throw Error("illegal field options in "+obj.name+"#"+fld["name"]);\r
+                            var oneof = null;\r
+                            if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]]))\r
+                                throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);\r
+                            fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);\r
+                            if (oneof)\r
+                                oneof.fields.push(fld);\r
+                            obj.addChild(fld);\r
+                        }, this);\r
+\r
+                    // Push children to stack\r
+                    var subObj = [];\r
+                    if (def["enums"])\r
+                        def["enums"].forEach(function(enm) {\r
+                            subObj.push(enm);\r
+                        });\r
+                    if (def["messages"])\r
+                        def["messages"].forEach(function(msg) {\r
+                            subObj.push(msg);\r
+                        });\r
+                    if (def["services"])\r
+                        def["services"].forEach(function(svc) {\r
+                            subObj.push(svc);\r
+                        });\r
+\r
+                    // Set extension ranges\r
+                    if (def["extensions"]) {\r
+                        if (typeof def["extensions"][0] === 'number') // pre 5.0.1\r
+                            obj.extensions = [ def["extensions"] ];\r
+                        else\r
+                            obj.extensions = def["extensions"];\r
+                    }\r
+\r
+                    // Create on top of current namespace\r
+                    this.ptr.addChild(obj);\r
+                    if (subObj.length > 0) {\r
+                        stack.push(defs); // Push the current level back\r
+                        defs = subObj; // Continue processing sub level\r
+                        subObj = null;\r
+                        this.ptr = obj; // And move the pointer to this namespace\r
+                        obj = null;\r
+                        continue;\r
+                    }\r
+                    subObj = null;\r
+\r
+                } else if (Builder.isEnum(def)) {\r
+\r
+                    obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);\r
+                    def["values"].forEach(function(val) {\r
+                        obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));\r
+                    }, this);\r
+                    this.ptr.addChild(obj);\r
+\r
+                } else if (Builder.isService(def)) {\r
+\r
+                    obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);\r
+                    Object.keys(def["rpc"]).forEach(function(name) {\r
+                        var mtd = def["rpc"][name];\r
+                        obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));\r
+                    }, this);\r
+                    this.ptr.addChild(obj);\r
+\r
+                } else if (Builder.isExtend(def)) {\r
+\r
+                    obj = this.ptr.resolve(def["ref"], true);\r
+                    if (obj) {\r
+                        def["fields"].forEach(function(fld) {\r
+                            if (obj.getChild(fld['id']|0) !== null)\r
+                                throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);\r
+                            // Check if field id is allowed to be extended\r
+                            if (obj.extensions) {\r
+                                var valid = false;\r
+                                obj.extensions.forEach(function(range) {\r
+                                    if (fld["id"] >= range[0] && fld["id"] <= range[1])\r
+                                        valid = true;\r
+                                });\r
+                                if (!valid)\r
+                                    throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");\r
+                            }\r
+                            // Convert extension field names to camel case notation if the override is set\r
+                            var name = fld["name"];\r
+                            if (this.options['convertFieldsToCamelCase'])\r
+                                name = ProtoBuf.Util.toCamelCase(name);\r
+                            // see #161: Extensions use their fully qualified name as their runtime key and...\r
+                            var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);\r
+                            // ...are added on top of the current namespace as an extension which is used for\r
+                            // resolving their type later on (the extension always keeps the original name to\r
+                            // prevent naming collisions)\r
+                            var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);\r
+                            field.extension = ext;\r
+                            this.ptr.addChild(ext);\r
+                            obj.addChild(field);\r
+                        }, this);\r
+\r
+                    } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions\r
+                        throw Error("extended message "+def["ref"]+" is not defined");\r
+\r
+                } else\r
+                    throw Error("not a valid definition: "+JSON.stringify(def));\r
+\r
+                def = null;\r
+                obj = null;\r
+            }\r
+            // Break goes here\r
+            defs = null;\r
+            this.ptr = this.ptr.parent; // Namespace done, continue at parent\r
+        }\r
+        this.resolved = false; // Require re-resolve\r
+        this.result = null; // Require re-build\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Propagates syntax to all children.\r
+     * @param {!Object} parent\r
+     * @inner\r
+     */\r
+    function propagateSyntax(parent) {\r
+        if (parent['messages']) {\r
+            parent['messages'].forEach(function(child) {\r
+                child["syntax"] = parent["syntax"];\r
+                propagateSyntax(child);\r
+            });\r
+        }\r
+        if (parent['enums']) {\r
+            parent['enums'].forEach(function(child) {\r
+                child["syntax"] = parent["syntax"];\r
+            });\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Imports another definition into this builder.\r
+     * @param {Object.<string,*>} json Parsed import\r
+     * @param {(string|{root: string, file: string})=} filename Imported file name\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @throws {Error} If the definition or file cannot be imported\r
+     * @expose\r
+     */\r
+    BuilderPrototype["import"] = function(json, filename) {\r
+        var delim = '/';\r
+\r
+        // Make sure to skip duplicate imports\r
+\r
+        if (typeof filename === 'string') {\r
+\r
+            if (ProtoBuf.Util.IS_NODE)\r
+                filename = require("path")['resolve'](filename);\r
+            if (this.files[filename] === true)\r
+                return this.reset();\r
+            this.files[filename] = true;\r
+\r
+        } else if (typeof filename === 'object') { // Object with root, file.\r
+\r
+            var root = filename.root;\r
+            if (ProtoBuf.Util.IS_NODE)\r
+                root = require("path")['resolve'](root);\r
+            if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)\r
+                delim = '\\';\r
+            var fname;\r
+            if (ProtoBuf.Util.IS_NODE)\r
+                fname = require("path")['join'](root, filename.file);\r
+            else\r
+                fname = root + delim + filename.file;\r
+            if (this.files[fname] === true)\r
+                return this.reset();\r
+            this.files[fname] = true;\r
+        }\r
+\r
+        // Import imports\r
+\r
+        if (json['imports'] && json['imports'].length > 0) {\r
+            var importRoot,\r
+                resetRoot = false;\r
+\r
+            if (typeof filename === 'object') { // If an import root is specified, override\r
+\r
+                this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards\r
+                importRoot = this.importRoot;\r
+                filename = filename["file"];\r
+                if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)\r
+                    delim = '\\';\r
+\r
+            } else if (typeof filename === 'string') {\r
+\r
+                if (this.importRoot) // If import root is overridden, use it\r
+                    importRoot = this.importRoot;\r
+                else { // Otherwise compute from filename\r
+                    if (filename.indexOf("/") >= 0) { // Unix\r
+                        importRoot = filename.replace(/\/[^\/]*$/, "");\r
+                        if (/* /file.proto */ importRoot === "")\r
+                            importRoot = "/";\r
+                    } else if (filename.indexOf("\\") >= 0) { // Windows\r
+                        importRoot = filename.replace(/\\[^\\]*$/, "");\r
+                        delim = '\\';\r
+                    } else\r
+                        importRoot = ".";\r
+                }\r
+\r
+            } else\r
+                importRoot = null;\r
+\r
+            for (var i=0; i<json['imports'].length; i++) {\r
+                if (typeof json['imports'][i] === 'string') { // Import file\r
+                    if (!importRoot)\r
+                        throw Error("cannot determine import root");\r
+                    var importFilename = json['imports'][i];\r
+                    if (importFilename === "google/protobuf/descriptor.proto")\r
+                        continue; // Not needed and therefore not used\r
+                    if (ProtoBuf.Util.IS_NODE)\r
+                        importFilename = require("path")['join'](importRoot, importFilename);\r
+                    else\r
+                        importFilename = importRoot + delim + importFilename;\r
+                    if (this.files[importFilename] === true)\r
+                        continue; // Already imported\r
+                    if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto)       // If this is a light build\r
+                        importFilename = importFilename.replace(/\.proto$/, ".json"); // always load the JSON file\r
+                    var contents = ProtoBuf.Util.fetch(importFilename);\r
+                    if (contents === null)\r
+                        throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");\r
+                    if (/\.json$/i.test(importFilename)) // Always possible\r
+                        this["import"](JSON.parse(contents+""), importFilename); // May throw\r
+                    else\r
+                        this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename); // May throw\r
+                } else // Import structure\r
+                    if (!filename)\r
+                        this["import"](json['imports'][i]);\r
+                    else if (/\.(\w+)$/.test(filename)) // With extension: Append _importN to the name portion to make it unique\r
+                        this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));\r
+                    else // Without extension: Append _importN to make it unique\r
+                        this["import"](json['imports'][i], filename+"_import"+i);\r
+            }\r
+            if (resetRoot) // Reset import root override when all imports are done\r
+                this.importRoot = null;\r
+        }\r
+\r
+        // Import structures\r
+\r
+        if (json['package'])\r
+            this.define(json['package']);\r
+        if (json['syntax'])\r
+            propagateSyntax(json);\r
+        var base = this.ptr;\r
+        if (json['options'])\r
+            Object.keys(json['options']).forEach(function(key) {\r
+                base.options[key] = json['options'][key];\r
+            });\r
+        if (json['messages'])\r
+            this.create(json['messages']),\r
+            this.ptr = base;\r
+        if (json['enums'])\r
+            this.create(json['enums']),\r
+            this.ptr = base;\r
+        if (json['services'])\r
+            this.create(json['services']),\r
+            this.ptr = base;\r
+        if (json['extends'])\r
+            this.create(json['extends']);\r
+\r
+        return this.reset();\r
+    };\r
+\r
+    /**\r
+     * Resolves all namespace objects.\r
+     * @throws {Error} If a type cannot be resolved\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @expose\r
+     */\r
+    BuilderPrototype.resolveAll = function() {\r
+        // Resolve all reflected objects\r
+        var res;\r
+        if (this.ptr == null || typeof this.ptr.type === 'object')\r
+            return this; // Done (already resolved)\r
+\r
+        if (this.ptr instanceof Reflect.Namespace) { // Resolve children\r
+\r
+            this.ptr.children.forEach(function(child) {\r
+                this.ptr = child;\r
+                this.resolveAll();\r
+            }, this);\r
+\r
+        } else if (this.ptr instanceof Reflect.Message.Field) { // Resolve type\r
+\r
+            if (!Lang.TYPE.test(this.ptr.type)) {\r
+                if (!Lang.TYPEREF.test(this.ptr.type))\r
+                    throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);\r
+                if (!res)\r
+                    throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                this.ptr.resolvedType = res;\r
+                if (res instanceof Reflect.Enum) {\r
+                    this.ptr.type = ProtoBuf.TYPES["enum"];\r
+                    if (this.ptr.syntax === 'proto3' && res.syntax !== 'proto3')\r
+                        throw Error("proto3 message cannot reference proto2 enum");\r
+                }\r
+                else if (res instanceof Reflect.Message)\r
+                    this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];\r
+                else\r
+                    throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+            } else\r
+                this.ptr.type = ProtoBuf.TYPES[this.ptr.type];\r
+\r
+            // If it's a map field, also resolve the key type. The key type can be only a numeric, string, or bool type\r
+            // (i.e., no enums or messages), so we don't need to resolve against the current namespace.\r
+            if (this.ptr.map) {\r
+                if (!Lang.TYPE.test(this.ptr.keyType))\r
+                    throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);\r
+                this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];\r
+            }\r
+\r
+            // If it's a repeated and packable field then proto3 mandates it should be packed by\r
+            // default\r
+            if (\r
+              this.ptr.syntax === 'proto3' &&\r
+              this.ptr.repeated && this.ptr.options.packed === undefined &&\r
+              ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1\r
+            ) {\r
+              this.ptr.options.packed = true;\r
+            }\r
+\r
+        } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {\r
+\r
+            if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {\r
+                res = this.ptr.parent.resolve(this.ptr.requestName, true);\r
+                if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                    throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);\r
+                this.ptr.resolvedRequestType = res;\r
+                res = this.ptr.parent.resolve(this.ptr.responseName, true);\r
+                if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                    throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);\r
+                this.ptr.resolvedResponseType = res;\r
+            } else // Should not happen as nothing else is implemented\r
+                throw Error("illegal service type in "+this.ptr.toString(true));\r
+\r
+        } else if (\r
+            !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) && // Not built\r
+            !(this.ptr instanceof ProtoBuf.Reflect.Extension) && // Not built\r
+            !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value) // Built in enum\r
+        )\r
+            throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);\r
+\r
+        return this.reset();\r
+    };\r
+\r
+    /**\r
+     * Builds the protocol. This will first try to resolve all definitions and, if this has been successful,\r
+     * return the built package.\r
+     * @param {(string|Array.<string>)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r
+     * @returns {!ProtoBuf.Builder.Message|!Object.<string,*>}\r
+     * @throws {Error} If a type could not be resolved\r
+     * @expose\r
+     */\r
+    BuilderPrototype.build = function(path) {\r
+        this.reset();\r
+        if (!this.resolved)\r
+            this.resolveAll(),\r
+            this.resolved = true,\r
+            this.result = null; // Require re-build\r
+        if (this.result === null) // (Re-)Build\r
+            this.result = this.ns.build();\r
+        if (!path)\r
+            return this.result;\r
+        var part = typeof path === 'string' ? path.split(".") : path,\r
+            ptr = this.result; // Build namespace pointer (no hasChild etc.)\r
+        for (var i=0; i<part.length; i++)\r
+            if (ptr[part[i]])\r
+                ptr = ptr[part[i]];\r
+            else {\r
+                ptr = null;\r
+                break;\r
+            }\r
+        return ptr;\r
+    };\r
+\r
+    /**\r
+     * Similar to {@link ProtoBuf.Builder#build}, but looks up the internal reflection descriptor.\r
+     * @param {string=} path Specifies what to return. If omitted, the entire namespace wiil be returned.\r
+     * @param {boolean=} excludeNonNamespace Excludes non-namespace types like fields, defaults to `false`\r
+     * @returns {?ProtoBuf.Reflect.T} Reflection descriptor or `null` if not found\r
+     */\r
+    BuilderPrototype.lookup = function(path, excludeNonNamespace) {\r
+        return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;\r
+    };\r
+\r
+    /**\r
+     * Returns a string representation of this object.\r
+     * @return {string} String representation as of "Builder"\r
+     * @expose\r
+     */\r
+    BuilderPrototype.toString = function() {\r
+        return "Builder";\r
+    };\r
+\r
+    // ----- Base classes -----\r
+    // Exist for the sole purpose of being able to "... instanceof ProtoBuf.Builder.Message" etc.\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.Message\r
+     */\r
+    Builder.Message = function() {};\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.Enum\r
+     */\r
+    Builder.Enum = function() {};\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.Message\r
+     */\r
+    Builder.Service = function() {};\r
+\r
+    return Builder;\r
+\r
+})(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js
new file mode 100644 (file)
index 0000000..f1e6ca9
--- /dev/null
@@ -0,0 +1,22 @@
+// This file is not included currently and exists for documentation purposes only.\r
+\r
+/*?\r
+ // --- Scope ------------------\r
+ // T : Reflect.Enum instance\r
+ */\r
+\r
+/**\r
+ * Constructs a new runtime Enum.\r
+ * @name ProtoBuf.Builder.Enum\r
+ * @class Barebone of all runtime enums.\r
+ * @constructor\r
+ */\r
+var Enum = function() {\r
+    ProtoBuf.Builder.Enum.call(this);\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Builder.Enum.prototype\r
+ * @inner\r
+ */\r
+var EnumPrototype = Enum.prototype = Object.create(ProtoBuf.Builder.Enum.prototype);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Message.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Message.js
new file mode 100644 (file)
index 0000000..fe95141
--- /dev/null
@@ -0,0 +1,721 @@
+/*?\r
+ // --- Scope ------------------\r
+ // T : Reflect.Message instance\r
+ */\r
+var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r
+    oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r
+\r
+/**\r
+ * Constructs a new runtime Message.\r
+ * @name ProtoBuf.Builder.Message\r
+ * @class Barebone of all runtime messages.\r
+ * @param {!Object.<string,*>|string} values Preset values\r
+ * @param {...string} var_args\r
+ * @constructor\r
+ * @throws {Error} If the message cannot be created\r
+ */\r
+var Message = function(values, var_args) {\r
+    ProtoBuf.Builder.Message.call(this);\r
+\r
+    // Create virtual oneof properties\r
+    for (var i=0, k=oneofs.length; i<k; ++i)\r
+        this[oneofs[i].name] = null;\r
+    // Create fields and set default values\r
+    for (i=0, k=fields.length; i<k; ++i) {\r
+        var field = fields[i];\r
+        this[field.name] =\r
+            field.repeated ? [] :\r
+            (field.map ? new ProtoBuf.Map(field) : null);\r
+        if ((field.required || T.syntax === 'proto3') &&\r
+            field.defaultValue !== null)\r
+            this[field.name] = field.defaultValue;\r
+    }\r
+\r
+    if (arguments.length > 0) {\r
+        var value;\r
+        // Set field values from a values object\r
+        if (arguments.length === 1 && values !== null && typeof values === 'object' &&\r
+            /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &&\r
+            /* not a repeated field */ !Array.isArray(values) &&\r
+            /* not a Map */ !(values instanceof ProtoBuf.Map) &&\r
+            /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &&\r
+            /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&\r
+            /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {\r
+            this.$set(values);\r
+        } else // Set field values from arguments, in declaration order\r
+            for (i=0, k=arguments.length; i<k; ++i)\r
+                if (typeof (value = arguments[i]) !== 'undefined')\r
+                    this.$set(fields[i].name, value); // May throw\r
+    }\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Builder.Message.prototype\r
+ * @inner\r
+ */\r
+var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);\r
+\r
+/**\r
+ * Adds a value to a repeated field.\r
+ * @name ProtoBuf.Builder.Message#add\r
+ * @function\r
+ * @param {string} key Field name\r
+ * @param {*} value Value to add\r
+ * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+ * @returns {!ProtoBuf.Builder.Message} this\r
+ * @throws {Error} If the value cannot be added\r
+ * @expose\r
+ */\r
+MessagePrototype.add = function(key, value, noAssert) {\r
+    var field = T._fieldsByName[key];\r
+    if (!noAssert) {\r
+        if (!field)\r
+            throw Error(this+"#"+key+" is undefined");\r
+        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+            throw Error(this+"#"+key+" is not a field: "+field.toString(true)); // May throw if it's an enum or embedded message\r
+        if (!field.repeated)\r
+            throw Error(this+"#"+key+" is not a repeated field");\r
+        value = field.verifyValue(value, true);\r
+    }\r
+    if (this[key] === null)\r
+        this[key] = [];\r
+    this[key].push(value);\r
+    return this;\r
+};\r
+\r
+/**\r
+ * Adds a value to a repeated field. This is an alias for {@link ProtoBuf.Builder.Message#add}.\r
+ * @name ProtoBuf.Builder.Message#$add\r
+ * @function\r
+ * @param {string} key Field name\r
+ * @param {*} value Value to add\r
+ * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+ * @returns {!ProtoBuf.Builder.Message} this\r
+ * @throws {Error} If the value cannot be added\r
+ * @expose\r
+ */\r
+MessagePrototype.$add = MessagePrototype.add;\r
+\r
+/**\r
+ * Sets a field's value.\r
+ * @name ProtoBuf.Builder.Message#set\r
+ * @function\r
+ * @param {string|!Object.<string,*>} keyOrObj String key or plain object holding multiple values\r
+ * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+ * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r
+ * @returns {!ProtoBuf.Builder.Message} this\r
+ * @throws {Error} If the value cannot be set\r
+ * @expose\r
+ */\r
+MessagePrototype.set = function(keyOrObj, value, noAssert) {\r
+    if (keyOrObj && typeof keyOrObj === 'object') {\r
+        noAssert = value;\r
+        for (var ikey in keyOrObj) {\r
+            // Check if virtual oneof field - don't set these\r
+            if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)\r
+                this.$set(ikey, value, noAssert);\r
+        }\r
+        return this;\r
+    }\r
+    var field = T._fieldsByName[keyOrObj];\r
+    if (!noAssert) {\r
+        if (!field)\r
+            throw Error(this+"#"+keyOrObj+" is not a field: undefined");\r
+        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+            throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));\r
+        this[field.name] = (value = field.verifyValue(value)); // May throw\r
+    } else\r
+        this[keyOrObj] = value;\r
+    if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+        var currentField = this[field.oneof.name]; // Virtual field references currently set field\r
+        if (value !== null) {\r
+            if (currentField !== null && currentField !== field.name)\r
+                this[currentField] = null; // Clear currently set field\r
+            this[field.oneof.name] = field.name; // Point virtual field at this field\r
+        } else if (/* value === null && */currentField === keyOrObj)\r
+            this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r
+    }\r
+    return this;\r
+};\r
+\r
+/**\r
+ * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r
+ * @name ProtoBuf.Builder.Message#$set\r
+ * @function\r
+ * @param {string|!Object.<string,*>} keyOrObj String key or plain object holding multiple values\r
+ * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+ * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+ * @throws {Error} If the value cannot be set\r
+ * @expose\r
+ */\r
+MessagePrototype.$set = MessagePrototype.set;\r
+\r
+/**\r
+ * Gets a field's value.\r
+ * @name ProtoBuf.Builder.Message#get\r
+ * @function\r
+ * @param {string} key Key\r
+ * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r
+ * @return {*} Value\r
+ * @throws {Error} If there is no such field\r
+ * @expose\r
+ */\r
+MessagePrototype.get = function(key, noAssert) {\r
+    if (noAssert)\r
+        return this[key];\r
+    var field = T._fieldsByName[key];\r
+    if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r
+        throw Error(this+"#"+key+" is not a field: undefined");\r
+    if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+        throw Error(this+"#"+key+" is not a field: "+field.toString(true));\r
+    return this[field.name];\r
+};\r
+\r
+/**\r
+ * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r
+ * @name ProtoBuf.Builder.Message#$get\r
+ * @function\r
+ * @param {string} key Key\r
+ * @return {*} Value\r
+ * @throws {Error} If there is no such field\r
+ * @expose\r
+ */\r
+MessagePrototype.$get = MessagePrototype.get;\r
+\r
+// Getters and setters\r
+\r
+for (var i=0; i<fields.length; i++) {\r
+    var field = fields[i];\r
+    // no setters for extension fields as these are named by their fqn\r
+    if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+        continue;\r
+\r
+    if (T.builder.options['populateAccessors'])\r
+        (function(field) {\r
+            // set/get[SomeValue]\r
+            var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {\r
+                return match.toUpperCase().replace('_','');\r
+            });\r
+            Name = Name.substring(0,1).toUpperCase() + Name.substring(1);\r
+\r
+            // set/get_[some_value] FIXME: Do we really need these?\r
+            var name = field.originalName.replace(/([A-Z])/g, function(match) {\r
+                return "_"+match;\r
+            });\r
+\r
+            /**\r
+             * The current field's unbound setter function.\r
+             * @function\r
+             * @param {*} value\r
+             * @param {boolean=} noAssert\r
+             * @returns {!ProtoBuf.Builder.Message}\r
+             * @inner\r
+             */\r
+            var setter = function(value, noAssert) {\r
+                this[field.name] = noAssert ? value : field.verifyValue(value);\r
+                return this;\r
+            };\r
+\r
+            /**\r
+             * The current field's unbound getter function.\r
+             * @function\r
+             * @returns {*}\r
+             * @inner\r
+             */\r
+            var getter = function() {\r
+                return this[field.name];\r
+            };\r
+\r
+            if (T.getChild("set"+Name) === null)\r
+                /**\r
+                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#set[SomeField]\r
+                 * @function\r
+                 * @param {*} value Value to set\r
+                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @abstract\r
+                 * @throws {Error} If the value cannot be set\r
+                 */\r
+                MessagePrototype["set"+Name] = setter;\r
+\r
+            if (T.getChild("set_"+name) === null)\r
+                /**\r
+                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#set_[some_field]\r
+                 * @function\r
+                 * @param {*} value Value to set\r
+                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @abstract\r
+                 * @throws {Error} If the value cannot be set\r
+                 */\r
+                MessagePrototype["set_"+name] = setter;\r
+\r
+            if (T.getChild("get"+Name) === null)\r
+                /**\r
+                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#get[SomeField]\r
+                 * @function\r
+                 * @abstract\r
+                 * @return {*} The value\r
+                 */\r
+                MessagePrototype["get"+Name] = getter;\r
+\r
+            if (T.getChild("get_"+name) === null)\r
+                /**\r
+                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#get_[some_field]\r
+                 * @function\r
+                 * @return {*} The value\r
+                 * @abstract\r
+                 */\r
+                MessagePrototype["get_"+name] = getter;\r
+\r
+        })(field);\r
+}\r
+\r
+// En-/decoding\r
+\r
+/**\r
+ * Encodes the message.\r
+ * @name ProtoBuf.Builder.Message#$encode\r
+ * @function\r
+ * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ * @see ProtoBuf.Builder.Message#encode64\r
+ * @see ProtoBuf.Builder.Message#encodeHex\r
+ * @see ProtoBuf.Builder.Message#encodeAB\r
+ */\r
+MessagePrototype.encode = function(buffer, noVerify) {\r
+    if (typeof buffer === 'boolean')\r
+        noVerify = buffer,\r
+        buffer = undefined;\r
+    var isNew = false;\r
+    if (!buffer)\r
+        buffer = new ByteBuffer(),\r
+        isNew = true;\r
+    var le = buffer.littleEndian;\r
+    try {\r
+        T.encode(this, buffer.LE(), noVerify);\r
+        return (isNew ? buffer.flip() : buffer).LE(le);\r
+    } catch (e) {\r
+        buffer.LE(le);\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Encodes a message using the specified data payload.\r
+ * @param {!Object.<string,*>} data Data payload\r
+ * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+ * @expose\r
+ */\r
+Message.encode = function(data, buffer, noVerify) {\r
+    return new Message(data).encode(buffer, noVerify);\r
+};\r
+\r
+/**\r
+ * Calculates the byte length of the message.\r
+ * @name ProtoBuf.Builder.Message#calculate\r
+ * @function\r
+ * @returns {number} Byte length\r
+ * @throws {Error} If the message cannot be calculated or if required fields are missing.\r
+ * @expose\r
+ */\r
+MessagePrototype.calculate = function() {\r
+    return T.calculate(this);\r
+};\r
+\r
+/**\r
+ * Encodes the varint32 length-delimited message.\r
+ * @name ProtoBuf.Builder.Message#encodeDelimited\r
+ * @function\r
+ * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r
+    var isNew = false;\r
+    if (!buffer)\r
+        buffer = new ByteBuffer(),\r
+        isNew = true;\r
+    var enc = new ByteBuffer().LE();\r
+    T.encode(this, enc, noVerify).flip();\r
+    buffer.writeVarint32(enc.remaining());\r
+    buffer.append(enc);\r
+    return isNew ? buffer.flip() : buffer;\r
+};\r
+\r
+/**\r
+ * Directly encodes the message to an ArrayBuffer.\r
+ * @name ProtoBuf.Builder.Message#encodeAB\r
+ * @function\r
+ * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeAB = function() {\r
+    try {\r
+        return this.encode().toArrayBuffer();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r
+ * @name ProtoBuf.Builder.Message#toArrayBuffer\r
+ * @function\r
+ * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r
+\r
+/**\r
+ * Directly encodes the message to a node Buffer.\r
+ * @name ProtoBuf.Builder.Message#encodeNB\r
+ * @function\r
+ * @return {!Buffer}\r
+ * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r
+ *  missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeNB = function() {\r
+    try {\r
+        return this.encode().toBuffer();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r
+ * @name ProtoBuf.Builder.Message#toBuffer\r
+ * @function\r
+ * @return {!Buffer}\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded node Buffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r
+\r
+/**\r
+ * Directly encodes the message to a base64 encoded string.\r
+ * @name ProtoBuf.Builder.Message#encode64\r
+ * @function\r
+ * @return {string} Base64 encoded string\r
+ * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+ *  still returns the encoded base64 string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encode64 = function() {\r
+    try {\r
+        return this.encode().toBase64();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r
+ * @name ProtoBuf.Builder.Message#toBase64\r
+ * @function\r
+ * @return {string} Base64 encoded string\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded base64 string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toBase64 = MessagePrototype.encode64;\r
+\r
+/**\r
+ * Directly encodes the message to a hex encoded string.\r
+ * @name ProtoBuf.Builder.Message#encodeHex\r
+ * @function\r
+ * @return {string} Hex encoded string\r
+ * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+ *  still returns the encoded hex string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeHex = function() {\r
+    try {\r
+        return this.encode().toHex();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toHex();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r
+ * @name ProtoBuf.Builder.Message#toHex\r
+ * @function\r
+ * @return {string} Hex encoded string\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded hex string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toHex = MessagePrototype.encodeHex;\r
+\r
+/**\r
+ * Clones a message object or field value to a raw object.\r
+ * @param {*} obj Object to clone\r
+ * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r
+ * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+ * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r
+ * @returns {*} Cloned object\r
+ * @inner\r
+ */\r
+function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r
+    if (obj === null || typeof obj !== 'object') {\r
+        // Convert enum values to their respective names\r
+        if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {\r
+            var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r
+            if (name !== null)\r
+                return name;\r
+        }\r
+        // Pass-through string, number, boolean, null...\r
+        return obj;\r
+    }\r
+    // Convert ByteBuffers to raw buffer or strings\r
+    if (ByteBuffer.isByteBuffer(obj))\r
+        return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r
+    // Convert Longs to proper objects or strings\r
+    if (ProtoBuf.Long.isLong(obj))\r
+        return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r
+    var clone;\r
+    // Clone arrays\r
+    if (Array.isArray(obj)) {\r
+        clone = [];\r
+        obj.forEach(function(v, k) {\r
+            clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r
+        });\r
+        return clone;\r
+    }\r
+    clone = {};\r
+    // Convert maps to objects\r
+    if (obj instanceof ProtoBuf.Map) {\r
+        var it = obj.entries();\r
+        for (var e = it.next(); !e.done; e = it.next())\r
+            clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r
+        return clone;\r
+    }\r
+    // Everything else is a non-null object\r
+    var type = obj.$type,\r
+        field = undefined;\r
+    for (var i in obj)\r
+        if (obj.hasOwnProperty(i)) {\r
+            if (type && (field = type.getChild(i)))\r
+                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r
+            else\r
+                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r
+        }\r
+    return clone;\r
+}\r
+\r
+/**\r
+ * Returns the message's raw payload.\r
+ * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r
+ * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+ * @returns {Object.<string,*>} Raw payload\r
+ * @expose\r
+ */\r
+MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r
+    return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r
+};\r
+\r
+/**\r
+ * Encodes a message to JSON.\r
+ * @returns {string} JSON string\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeJSON = function() {\r
+    return JSON.stringify(\r
+        cloneRaw(this,\r
+             /* binary-as-base64 */ true,\r
+             /* longs-as-strings */ true,\r
+             this.$type\r
+        )\r
+    );\r
+};\r
+\r
+/**\r
+ * Decodes a message from the specified buffer or string.\r
+ * @name ProtoBuf.Builder.Message.decode\r
+ * @function\r
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+ * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r
+ * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ * @see ProtoBuf.Builder.Message.decode64\r
+ * @see ProtoBuf.Builder.Message.decodeHex\r
+ */\r
+Message.decode = function(buffer, length, enc) {\r
+    if (typeof length === 'string')\r
+        enc = length,\r
+        length = -1;\r
+    if (typeof buffer === 'string')\r
+        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+    else if (!ByteBuffer.isByteBuffer(buffer))\r
+        buffer = ByteBuffer.wrap(buffer); // May throw\r
+    var le = buffer.littleEndian;\r
+    try {\r
+        var msg = T.decode(buffer.LE(), length);\r
+        buffer.LE(le);\r
+        return msg;\r
+    } catch (e) {\r
+        buffer.LE(le);\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Decodes a varint32 length-delimited message from the specified buffer or string.\r
+ * @name ProtoBuf.Builder.Message.decodeDelimited\r
+ * @function\r
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+ * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+ * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ */\r
+Message.decodeDelimited = function(buffer, enc) {\r
+    if (typeof buffer === 'string')\r
+        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+    else if (!ByteBuffer.isByteBuffer(buffer))\r
+        buffer = ByteBuffer.wrap(buffer); // May throw\r
+    if (buffer.remaining() < 1)\r
+        return null;\r
+    var off = buffer.offset,\r
+        len = buffer.readVarint32();\r
+    if (buffer.remaining() < len) {\r
+        buffer.offset = off;\r
+        return null;\r
+    }\r
+    try {\r
+        var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r
+        buffer.offset += len;\r
+        return msg;\r
+    } catch (err) {\r
+        buffer.offset += len;\r
+        throw err;\r
+    }\r
+};\r
+\r
+/**\r
+ * Decodes the message from the specified base64 encoded string.\r
+ * @name ProtoBuf.Builder.Message.decode64\r
+ * @function\r
+ * @param {string} str String to decode from\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ */\r
+Message.decode64 = function(str) {\r
+    return Message.decode(str, "base64");\r
+};\r
+\r
+/**\r
+ * Decodes the message from the specified hex encoded string.\r
+ * @name ProtoBuf.Builder.Message.decodeHex\r
+ * @function\r
+ * @param {string} str String to decode from\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ */\r
+Message.decodeHex = function(str) {\r
+    return Message.decode(str, "hex");\r
+};\r
+\r
+/**\r
+ * Decodes the message from a JSON string.\r
+ * @name ProtoBuf.Builder.Message.decodeJSON\r
+ * @function\r
+ * @param {string} str String to decode from\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are\r
+ * missing.\r
+ * @expose\r
+ */\r
+Message.decodeJSON = function(str) {\r
+    return new Message(JSON.parse(str));\r
+};\r
+\r
+// Utility\r
+\r
+/**\r
+ * Returns a string representation of this Message.\r
+ * @name ProtoBuf.Builder.Message#toString\r
+ * @function\r
+ * @return {string} String representation as of ".Fully.Qualified.MessageName"\r
+ * @expose\r
+ */\r
+MessagePrototype.toString = function() {\r
+    return T.toString();\r
+};\r
+\r
+// Properties\r
+\r
+/**\r
+ * Message options.\r
+ * @name ProtoBuf.Builder.Message.$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $optionsS; // cc needs this\r
+\r
+/**\r
+ * Message options.\r
+ * @name ProtoBuf.Builder.Message#$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $options;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Message.$type\r
+ * @type {!ProtoBuf.Reflect.Message}\r
+ * @expose\r
+ */\r
+var $typeS;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Message#$type\r
+ * @type {!ProtoBuf.Reflect.Message}\r
+ * @expose\r
+ */\r
+var $type;\r
+\r
+if (Object.defineProperty)\r
+    Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),\r
+    Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),\r
+    Object.defineProperty(Message, "$type", { "value": T }),\r
+    Object.defineProperty(MessagePrototype, "$type", { "value": T });\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Service.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Builder/Service.js
new file mode 100644 (file)
index 0000000..43de942
--- /dev/null
@@ -0,0 +1,144 @@
+/*?\r
+ // --- Scope ------------------\r
+ // T : Reflect.Service instance\r
+ */\r
+/**\r
+ * Constructs a new runtime Service.\r
+ * @name ProtoBuf.Builder.Service\r
+ * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r
+ * @class Barebone of all runtime services.\r
+ * @constructor\r
+ * @throws {Error} If the service cannot be created\r
+ */\r
+var Service = function(rpcImpl) {\r
+    ProtoBuf.Builder.Service.call(this);\r
+\r
+    /**\r
+     * Service implementation.\r
+     * @name ProtoBuf.Builder.Service#rpcImpl\r
+     * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r
+     * @expose\r
+     */\r
+    this.rpcImpl = rpcImpl || function(name, msg, callback) {\r
+        // This is what a user has to implement: A function receiving the method name, the actual message to\r
+        // send (type checked) and the callback that's either provided with the error as its first\r
+        // argument or null and the actual response message.\r
+        setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async!\r
+    };\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Builder.Service.prototype\r
+ * @inner\r
+ */\r
+var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r
+\r
+/**\r
+ * Asynchronously performs an RPC call using the given RPC implementation.\r
+ * @name ProtoBuf.Builder.Service.[Method]\r
+ * @function\r
+ * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r
+ * @param {ProtoBuf.Builder.Message} req Request\r
+ * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+ *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+ * @abstract\r
+ */\r
+\r
+/**\r
+ * Asynchronously performs an RPC call using the instance's RPC implementation.\r
+ * @name ProtoBuf.Builder.Service#[Method]\r
+ * @function\r
+ * @param {ProtoBuf.Builder.Message} req Request\r
+ * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+ *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+ * @abstract\r
+ */\r
+\r
+var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r
+for (var i=0; i<rpc.length; i++) {\r
+    (function(method) {\r
+\r
+        // service#Method(message, callback)\r
+        ServicePrototype[method.name] = function(req, callback) {\r
+            try {\r
+                try {\r
+                    // If given as a buffer, decode the request. Will throw a TypeError if not a valid buffer.\r
+                    req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));\r
+                } catch (err) {\r
+                    if (!(err instanceof TypeError))\r
+                        throw err;\r
+                }\r
+                if (req === null || typeof req !== 'object')\r
+                    throw Error("Illegal arguments");\r
+                if (!(req instanceof method.resolvedRequestType.clazz))\r
+                    req = new method.resolvedRequestType.clazz(req);\r
+                this.rpcImpl(method.fqn(), req, function(err, res) { // Assumes that this is properly async\r
+                    if (err) {\r
+                        callback(err);\r
+                        return;\r
+                    }\r
+                    // Coalesce to empty string when service response has empty content\r
+                    if (res === null)\r
+                        res = ''\r
+                    try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}\r
+                    if (!res || !(res instanceof method.resolvedResponseType.clazz)) {\r
+                        callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));\r
+                        return;\r
+                    }\r
+                    callback(null, res);\r
+                });\r
+            } catch (err) {\r
+                setTimeout(callback.bind(this, err), 0);\r
+            }\r
+        };\r
+\r
+        // Service.Method(rpcImpl, message, callback)\r
+        Service[method.name] = function(rpcImpl, req, callback) {\r
+            new Service(rpcImpl)[method.name](req, callback);\r
+        };\r
+\r
+        if (Object.defineProperty)\r
+            Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),\r
+            Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });\r
+    })(rpc[i]);\r
+}\r
+\r
+// Properties\r
+\r
+/**\r
+ * Service options.\r
+ * @name ProtoBuf.Builder.Service.$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $optionsS; // cc needs this\r
+\r
+/**\r
+ * Service options.\r
+ * @name ProtoBuf.Builder.Service#$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $options;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Service.$type\r
+ * @type {!ProtoBuf.Reflect.Service}\r
+ * @expose\r
+ */\r
+var $typeS;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Service#$type\r
+ * @type {!ProtoBuf.Reflect.Service}\r
+ * @expose\r
+ */\r
+var $type;\r
+\r
+if (Object.defineProperty)\r
+    Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),\r
+    Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),\r
+    Object.defineProperty(Service, "$type", { "value": T }),\r
+    Object.defineProperty(ServicePrototype, "$type", { "value": T });\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto.js
new file mode 100644 (file)
index 0000000..f3cea78
--- /dev/null
@@ -0,0 +1,33 @@
+/**\r
+ * @alias ProtoBuf.DotProto\r
+ * @expose\r
+ */\r
+ProtoBuf.DotProto = (function(ProtoBuf, Lang) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Utilities to parse .proto files.\r
+     * @exports ProtoBuf.DotProto\r
+     * @namespace\r
+     */\r
+    var DotProto = {};\r
+    \r
+    //? include("DotProto/Tokenizer.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.DotProto.Tokenizer\r
+     * @expose\r
+     */\r
+    DotProto.Tokenizer = Tokenizer;\r
+    \r
+    //? include("DotProto/Parser.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.DotProto.Parser\r
+     * @expose\r
+     */\r
+    DotProto.Parser = Parser;\r
+    \r
+    return DotProto;\r
+    \r
+})(ProtoBuf, ProtoBuf.Lang);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto/Parser.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto/Parser.js
new file mode 100644 (file)
index 0000000..36595ee
--- /dev/null
@@ -0,0 +1,700 @@
+/*?\r
+ // --- Scope ----------------------\r
+ // Lang      : Language expressions\r
+ // Tokenizer : DotProto Tokenizer\r
+ */\r
+/**\r
+ * Constructs a new Parser.\r
+ * @exports ProtoBuf.DotProto.Parser\r
+ * @class prototype parser\r
+ * @param {string} source Source\r
+ * @constructor\r
+ */\r
+var Parser = function(source) {\r
+\r
+    /**\r
+     * Tokenizer.\r
+     * @type {!ProtoBuf.DotProto.Tokenizer}\r
+     * @expose\r
+     */\r
+    this.tn = new Tokenizer(source);\r
+\r
+    /**\r
+     * Whether parsing proto3 or not.\r
+     * @type {boolean}\r
+     */\r
+    this.proto3 = false;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.DotProto.Parser.prototype\r
+ * @inner\r
+ */\r
+var ParserPrototype = Parser.prototype;\r
+\r
+/**\r
+ * Parses the source.\r
+ * @returns {!Object}\r
+ * @throws {Error} If the source cannot be parsed\r
+ * @expose\r
+ */\r
+ParserPrototype.parse = function() {\r
+    var topLevel = {\r
+        "name": "[ROOT]", // temporary\r
+        "package": null,\r
+        "messages": [],\r
+        "enums": [],\r
+        "imports": [],\r
+        "options": {},\r
+        "services": []\r
+        // "syntax": undefined\r
+    };\r
+    var token,\r
+        head = true,\r
+        weak;\r
+    try {\r
+        while (token = this.tn.next()) {\r
+            switch (token) {\r
+                case 'package':\r
+                    if (!head || topLevel["package"] !== null)\r
+                        throw Error("unexpected 'package'");\r
+                    token = this.tn.next();\r
+                    if (!Lang.TYPEREF.test(token))\r
+                        throw Error("illegal package name: " + token);\r
+                    this.tn.skip(";");\r
+                    topLevel["package"] = token;\r
+                    break;\r
+                case 'import':\r
+                    if (!head)\r
+                        throw Error("unexpected 'import'");\r
+                    token = this.tn.peek();\r
+                    if (token === "public" || (weak = token === "weak")) // token ignored\r
+                        this.tn.next();\r
+                    token = this._readString();\r
+                    this.tn.skip(";");\r
+                    if (!weak) // import ignored\r
+                        topLevel["imports"].push(token);\r
+                    break;\r
+                case 'syntax':\r
+                    if (!head)\r
+                        throw Error("unexpected 'syntax'");\r
+                    this.tn.skip("=");\r
+                    if ((topLevel["syntax"] = this._readString()) === "proto3")\r
+                        this.proto3 = true;\r
+                    this.tn.skip(";");\r
+                    break;\r
+                case 'message':\r
+                    this._parseMessage(topLevel, null);\r
+                    head = false;\r
+                    break;\r
+                case 'enum':\r
+                    this._parseEnum(topLevel);\r
+                    head = false;\r
+                    break;\r
+                case 'option':\r
+                    this._parseOption(topLevel);\r
+                    break;\r
+                case 'service':\r
+                    this._parseService(topLevel);\r
+                    break;\r
+                case 'extend':\r
+                    this._parseExtend(topLevel);\r
+                    break;\r
+                default:\r
+                    throw Error("unexpected '" + token + "'");\r
+            }\r
+        }\r
+    } catch (e) {\r
+        e.message = "Parse error at line "+this.tn.line+": " + e.message;\r
+        throw e;\r
+    }\r
+    delete topLevel["name"];\r
+    return topLevel;\r
+};\r
+\r
+/**\r
+ * Parses the specified source.\r
+ * @returns {!Object}\r
+ * @throws {Error} If the source cannot be parsed\r
+ * @expose\r
+ */\r
+Parser.parse = function(source) {\r
+    return new Parser(source).parse();\r
+};\r
+\r
+// ----- Conversion ------\r
+\r
+/**\r
+ * Converts a numerical string to an id.\r
+ * @param {string} value\r
+ * @param {boolean=} mayBeNegative\r
+ * @returns {number}\r
+ * @inner\r
+ */\r
+function mkId(value, mayBeNegative) {\r
+    var id = -1,\r
+        sign = 1;\r
+    if (value.charAt(0) == '-') {\r
+        sign = -1;\r
+        value = value.substring(1);\r
+    }\r
+    if (Lang.NUMBER_DEC.test(value))\r
+        id = parseInt(value);\r
+    else if (Lang.NUMBER_HEX.test(value))\r
+        id = parseInt(value.substring(2), 16);\r
+    else if (Lang.NUMBER_OCT.test(value))\r
+        id = parseInt(value.substring(1), 8);\r
+    else\r
+        throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value);\r
+    id = (sign*id)|0; // Force to 32bit\r
+    if (!mayBeNegative && id < 0)\r
+        throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value);\r
+    return id;\r
+}\r
+\r
+/**\r
+ * Converts a numerical string to a number.\r
+ * @param {string} val\r
+ * @returns {number}\r
+ * @inner\r
+ */\r
+function mkNumber(val) {\r
+    var sign = 1;\r
+    if (val.charAt(0) == '-') {\r
+        sign = -1;\r
+        val = val.substring(1);\r
+    }\r
+    if (Lang.NUMBER_DEC.test(val))\r
+        return sign * parseInt(val, 10);\r
+    else if (Lang.NUMBER_HEX.test(val))\r
+        return sign * parseInt(val.substring(2), 16);\r
+    else if (Lang.NUMBER_OCT.test(val))\r
+        return sign * parseInt(val.substring(1), 8);\r
+    else if (val === 'inf')\r
+        return sign * Infinity;\r
+    else if (val === 'nan')\r
+        return NaN;\r
+    else if (Lang.NUMBER_FLT.test(val))\r
+        return sign * parseFloat(val);\r
+    throw Error("illegal number value: " + (sign < 0 ? '-' : '') + val);\r
+}\r
+\r
+// ----- Reading ------\r
+\r
+/**\r
+ * Reads a string.\r
+ * @returns {string}\r
+ * @private\r
+ */\r
+ParserPrototype._readString = function() {\r
+    var value = "",\r
+        token,\r
+        delim;\r
+    do {\r
+        delim = this.tn.next();\r
+        if (delim !== "'" && delim !== '"')\r
+            throw Error("illegal string delimiter: "+delim);\r
+        value += this.tn.next();\r
+        this.tn.skip(delim);\r
+        token = this.tn.peek();\r
+    } while (token === '"' || token === '"'); // multi line?\r
+    return value;\r
+};\r
+\r
+/**\r
+ * Reads a value.\r
+ * @param {boolean=} mayBeTypeRef\r
+ * @returns {number|boolean|string}\r
+ * @private\r
+ */\r
+ParserPrototype._readValue = function(mayBeTypeRef) {\r
+    var token = this.tn.peek(),\r
+        value;\r
+    if (token === '"' || token === "'")\r
+        return this._readString();\r
+    this.tn.next();\r
+    if (Lang.NUMBER.test(token))\r
+        return mkNumber(token);\r
+    if (Lang.BOOL.test(token))\r
+        return (token.toLowerCase() === 'true');\r
+    if (mayBeTypeRef && Lang.TYPEREF.test(token))\r
+        return token;\r
+    throw Error("illegal value: "+token);\r
+\r
+};\r
+\r
+// ----- Parsing constructs -----\r
+\r
+/**\r
+ * Parses a namespace option.\r
+ * @param {!Object} parent Parent definition\r
+ * @param {boolean=} isList\r
+ * @private\r
+ */\r
+ParserPrototype._parseOption = function(parent, isList) {\r
+    var token = this.tn.next(),\r
+        custom = false;\r
+    if (token === '(') {\r
+        custom = true;\r
+        token = this.tn.next();\r
+    }\r
+    if (!Lang.TYPEREF.test(token))\r
+        // we can allow options of the form google.protobuf.* since they will just get ignored anyways\r
+        // if (!/google\.protobuf\./.test(token)) // FIXME: Why should that not be a valid typeref?\r
+            throw Error("illegal option name: "+token);\r
+    var name = token;\r
+    if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar\r
+        this.tn.skip(')');\r
+        name = '('+name+')';\r
+        token = this.tn.peek();\r
+        if (Lang.FQTYPEREF.test(token)) {\r
+            name += token;\r
+            this.tn.next();\r
+        }\r
+    }\r
+    this.tn.skip('=');\r
+    this._parseOptionValue(parent, name);\r
+    if (!isList)\r
+        this.tn.skip(";");\r
+};\r
+\r
+/**\r
+ * Sets an option on the specified options object.\r
+ * @param {!Object.<string,*>} options\r
+ * @param {string} name\r
+ * @param {string|number|boolean} value\r
+ * @inner\r
+ */\r
+function setOption(options, name, value) {\r
+    if (typeof options[name] === 'undefined')\r
+        options[name] = value;\r
+    else {\r
+        if (!Array.isArray(options[name]))\r
+            options[name] = [ options[name] ];\r
+        options[name].push(value);\r
+    }\r
+}\r
+\r
+/**\r
+ * Parses an option value.\r
+ * @param {!Object} parent\r
+ * @param {string} name\r
+ * @private\r
+ */\r
+ParserPrototype._parseOptionValue = function(parent, name) {\r
+    var token = this.tn.peek();\r
+    if (token !== '{') { // Plain value\r
+        setOption(parent["options"], name, this._readValue(true));\r
+    } else { // Aggregate options\r
+        this.tn.skip("{");\r
+        while ((token = this.tn.next()) !== '}') {\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal option name: " + name + "." + token);\r
+            if (this.tn.omit(":"))\r
+                setOption(parent["options"], name + "." + token, this._readValue(true));\r
+            else\r
+                this._parseOptionValue(parent, name + "." + token);\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Parses a service definition.\r
+ * @param {!Object} parent Parent definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseService = function(parent) {\r
+    var token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal service name at line "+this.tn.line+": "+token);\r
+    var name = token;\r
+    var svc = {\r
+        "name": name,\r
+        "rpc": {},\r
+        "options": {}\r
+    };\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (token === "option")\r
+            this._parseOption(svc);\r
+        else if (token === 'rpc')\r
+            this._parseServiceRPC(svc);\r
+        else\r
+            throw Error("illegal service token: "+token);\r
+    }\r
+    this.tn.omit(";");\r
+    parent["services"].push(svc);\r
+};\r
+\r
+/**\r
+ * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)].\r
+ * @param {!Object} svc Service definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseServiceRPC = function(svc) {\r
+    var type = "rpc",\r
+        token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal rpc service method name: "+token);\r
+    var name = token;\r
+    var method = {\r
+        "request": null,\r
+        "response": null,\r
+        "request_stream": false,\r
+        "response_stream": false,\r
+        "options": {}\r
+    };\r
+    this.tn.skip("(");\r
+    token = this.tn.next();\r
+    if (token.toLowerCase() === "stream") {\r
+      method["request_stream"] = true;\r
+      token = this.tn.next();\r
+    }\r
+    if (!Lang.TYPEREF.test(token))\r
+        throw Error("illegal rpc service request type: "+token);\r
+    method["request"] = token;\r
+    this.tn.skip(")");\r
+    token = this.tn.next();\r
+    if (token.toLowerCase() !== "returns")\r
+        throw Error("illegal rpc service request type delimiter: "+token);\r
+    this.tn.skip("(");\r
+    token = this.tn.next();\r
+    if (token.toLowerCase() === "stream") {\r
+      method["response_stream"] = true;\r
+      token = this.tn.next();\r
+    }\r
+    method["response"] = token;\r
+    this.tn.skip(")");\r
+    token = this.tn.peek();\r
+    if (token === '{') {\r
+        this.tn.next();\r
+        while ((token = this.tn.next()) !== '}') {\r
+            if (token === 'option')\r
+                this._parseOption(method);\r
+            else\r
+                throw Error("illegal rpc service token: " + token);\r
+        }\r
+        this.tn.omit(";");\r
+    } else\r
+        this.tn.skip(";");\r
+    if (typeof svc[type] === 'undefined')\r
+        svc[type] = {};\r
+    svc[type][name] = method;\r
+};\r
+\r
+/**\r
+ * Parses a message definition.\r
+ * @param {!Object} parent Parent definition\r
+ * @param {!Object=} fld Field definition if this is a group\r
+ * @returns {!Object}\r
+ * @private\r
+ */\r
+ParserPrototype._parseMessage = function(parent, fld) {\r
+    var isGroup = !!fld,\r
+        token = this.tn.next();\r
+    var msg = {\r
+        "name": "",\r
+        "fields": [],\r
+        "enums": [],\r
+        "messages": [],\r
+        "options": {},\r
+        "services": [],\r
+        "oneofs": {}\r
+        // "extensions": undefined\r
+    };\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal "+(isGroup ? "group" : "message")+" name: "+token);\r
+    msg["name"] = token;\r
+    if (isGroup) {\r
+        this.tn.skip("=");\r
+        fld["id"] = mkId(this.tn.next());\r
+        msg["isGroup"] = true;\r
+    }\r
+    token = this.tn.peek();\r
+    if (token === '[' && fld)\r
+        this._parseFieldOptions(fld);\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (Lang.RULE.test(token))\r
+            this._parseMessageField(msg, token);\r
+        else if (token === "oneof")\r
+            this._parseMessageOneOf(msg);\r
+        else if (token === "enum")\r
+            this._parseEnum(msg);\r
+        else if (token === "message")\r
+            this._parseMessage(msg);\r
+        else if (token === "option")\r
+            this._parseOption(msg);\r
+        else if (token === "service")\r
+            this._parseService(msg);\r
+        else if (token === "extensions")\r
+            if (msg.hasOwnProperty("extensions")) {\r
+                msg["extensions"] = msg["extensions"].concat(this._parseExtensionRanges())\r
+            } else {\r
+                msg["extensions"] = this._parseExtensionRanges();\r
+            }\r
+        else if (token === "reserved")\r
+            this._parseIgnored(); // TODO\r
+        else if (token === "extend")\r
+            this._parseExtend(msg);\r
+        else if (Lang.TYPEREF.test(token)) {\r
+            if (!this.proto3)\r
+                throw Error("illegal field rule: "+token);\r
+            this._parseMessageField(msg, "optional", token);\r
+        } else\r
+            throw Error("illegal message token: "+token);\r
+    }\r
+    this.tn.omit(";");\r
+    parent["messages"].push(msg);\r
+    return msg;\r
+};\r
+\r
+/**\r
+ * Parses an ignored statement.\r
+ * @private\r
+ */\r
+ParserPrototype._parseIgnored = function() {\r
+    while (this.tn.peek() !== ';')\r
+        this.tn.next();\r
+    this.tn.skip(";");\r
+};\r
+\r
+/**\r
+ * Parses a message field.\r
+ * @param {!Object} msg Message definition\r
+ * @param {string} rule Field rule\r
+ * @param {string=} type Field type if already known (never known for maps)\r
+ * @returns {!Object} Field descriptor\r
+ * @private\r
+ */\r
+ParserPrototype._parseMessageField = function(msg, rule, type) {\r
+    if (!Lang.RULE.test(rule))\r
+        throw Error("illegal message field rule: "+rule);\r
+    var fld = {\r
+        "rule": rule,\r
+        "type": "",\r
+        "name": "",\r
+        "options": {},\r
+        "id": 0\r
+    };\r
+    var token;\r
+    if (rule === "map") {\r
+\r
+        if (type)\r
+            throw Error("illegal type: " + type);\r
+        this.tn.skip('<');\r
+        token = this.tn.next();\r
+        if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token))\r
+            throw Error("illegal message field type: " + token);\r
+        fld["keytype"] = token;\r
+        this.tn.skip(',');\r
+        token = this.tn.next();\r
+        if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token))\r
+            throw Error("illegal message field: " + token);\r
+        fld["type"] = token;\r
+        this.tn.skip('>');\r
+        token = this.tn.next();\r
+        if (!Lang.NAME.test(token))\r
+            throw Error("illegal message field name: " + token);\r
+        fld["name"] = token;\r
+        this.tn.skip("=");\r
+        fld["id"] = mkId(this.tn.next());\r
+        token = this.tn.peek();\r
+        if (token === '[')\r
+            this._parseFieldOptions(fld);\r
+        this.tn.skip(";");\r
+\r
+    } else {\r
+\r
+        type = typeof type !== 'undefined' ? type : this.tn.next();\r
+\r
+        if (type === "group") {\r
+\r
+            // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your\r
+            // code, you can treat this message just as if it had a Result type field called result (the latter name is\r
+            // converted to lower-case so that it does not conflict with the former)."\r
+            var grp = this._parseMessage(msg, fld);\r
+            if (!/^[A-Z]/.test(grp["name"]))\r
+                throw Error('illegal group name: '+grp["name"]);\r
+            fld["type"] = grp["name"];\r
+            fld["name"] = grp["name"].toLowerCase();\r
+            this.tn.omit(";");\r
+\r
+        } else {\r
+\r
+            if (!Lang.TYPE.test(type) && !Lang.TYPEREF.test(type))\r
+                throw Error("illegal message field type: " + type);\r
+            fld["type"] = type;\r
+            token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal message field name: " + token);\r
+            fld["name"] = token;\r
+            this.tn.skip("=");\r
+            fld["id"] = mkId(this.tn.next());\r
+            token = this.tn.peek();\r
+            if (token === "[")\r
+                this._parseFieldOptions(fld);\r
+            this.tn.skip(";");\r
+\r
+        }\r
+    }\r
+    msg["fields"].push(fld);\r
+    return fld;\r
+};\r
+\r
+/**\r
+ * Parses a message oneof.\r
+ * @param {!Object} msg Message definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseMessageOneOf = function(msg) {\r
+    var token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal oneof name: "+token);\r
+    var name = token,\r
+        fld;\r
+    var fields = [];\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== "}") {\r
+        fld = this._parseMessageField(msg, "optional", token);\r
+        fld["oneof"] = name;\r
+        fields.push(fld["id"]);\r
+    }\r
+    this.tn.omit(";");\r
+    msg["oneofs"][name] = fields;\r
+};\r
+\r
+/**\r
+ * Parses a set of field option definitions.\r
+ * @param {!Object} fld Field definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseFieldOptions = function(fld) {\r
+    this.tn.skip("[");\r
+    var token,\r
+        first = true;\r
+    while ((token = this.tn.peek()) !== ']') {\r
+        if (!first)\r
+            this.tn.skip(",");\r
+        this._parseOption(fld, true);\r
+        first = false;\r
+    }\r
+    this.tn.next();\r
+};\r
+\r
+/**\r
+ * Parses an enum.\r
+ * @param {!Object} msg Message definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseEnum = function(msg) {\r
+    var enm = {\r
+        "name": "",\r
+        "values": [],\r
+        "options": {}\r
+    };\r
+    var token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal name: "+token);\r
+    enm["name"] = token;\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (token === "option")\r
+            this._parseOption(enm);\r
+        else {\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal name: "+token);\r
+            this.tn.skip("=");\r
+            var val = {\r
+                "name": token,\r
+                "id": mkId(this.tn.next(), true)\r
+            };\r
+            token = this.tn.peek();\r
+            if (token === "[")\r
+                this._parseFieldOptions({ "options": {} });\r
+            this.tn.skip(";");\r
+            enm["values"].push(val);\r
+        }\r
+    }\r
+    this.tn.omit(";");\r
+    msg["enums"].push(enm);\r
+};\r
+\r
+/**\r
+ * Parses extension / reserved ranges.\r
+ * @returns {!Array.<!Array.<number>>}\r
+ * @private\r
+ */\r
+ParserPrototype._parseExtensionRanges = function() {\r
+    var ranges = [];\r
+    var token,\r
+        range,\r
+        value;\r
+    do {\r
+        range = [];\r
+        while (true) {\r
+            token = this.tn.next();\r
+            switch (token) {\r
+                case "min":\r
+                    value = ProtoBuf.ID_MIN;\r
+                    break;\r
+                case "max":\r
+                    value = ProtoBuf.ID_MAX;\r
+                    break;\r
+                default:\r
+                    value = mkNumber(token);\r
+                    break;\r
+            }\r
+            range.push(value);\r
+            if (range.length === 2)\r
+                break;\r
+            if (this.tn.peek() !== "to") {\r
+                range.push(value);\r
+                break;\r
+            }\r
+            this.tn.next();\r
+        }\r
+        ranges.push(range);\r
+    } while (this.tn.omit(","));\r
+    this.tn.skip(";");\r
+    return ranges;\r
+};\r
+\r
+/**\r
+ * Parses an extend block.\r
+ * @param {!Object} parent Parent object\r
+ * @private\r
+ */\r
+ParserPrototype._parseExtend = function(parent) {\r
+    var token = this.tn.next();\r
+    if (!Lang.TYPEREF.test(token))\r
+        throw Error("illegal extend reference: "+token);\r
+    var ext = {\r
+        "ref": token,\r
+        "fields": []\r
+    };\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (Lang.RULE.test(token))\r
+            this._parseMessageField(ext, token);\r
+        else if (Lang.TYPEREF.test(token)) {\r
+            if (!this.proto3)\r
+                throw Error("illegal field rule: "+token);\r
+            this._parseMessageField(ext, "optional", token);\r
+        } else\r
+            throw Error("illegal extend token: "+token);\r
+    }\r
+    this.tn.omit(";");\r
+    parent["messages"].push(ext);\r
+    return ext;\r
+};\r
+\r
+// ----- General -----\r
+\r
+/**\r
+ * Returns a string representation of this parser.\r
+ * @returns {string}\r
+ */\r
+ParserPrototype.toString = function() {\r
+    return "Parser at line "+this.tn.line;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto/Tokenizer.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/DotProto/Tokenizer.js
new file mode 100644 (file)
index 0000000..10c1a1d
--- /dev/null
@@ -0,0 +1,190 @@
+/*?\r
+ // --- Scope -----------------\r
+ // Lang : Language expressions\r
+*/\r
+/**\r
+ * Constructs a new Tokenizer.\r
+ * @exports ProtoBuf.DotProto.Tokenizer\r
+ * @class prototype tokenizer\r
+ * @param {string} proto Proto to tokenize\r
+ * @constructor\r
+ */\r
+var Tokenizer = function(proto) {\r
+\r
+    /**\r
+     * Source to parse.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.source = proto+"";\r
+\r
+    /**\r
+     * Current index.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.index = 0;\r
+\r
+    /**\r
+     * Current line.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.line = 1;\r
+\r
+    /**\r
+     * Token stack.\r
+     * @type {!Array.<string>}\r
+     * @expose\r
+     */\r
+    this.stack = [];\r
+\r
+    /**\r
+     * Opening character of the current string read, if any.\r
+     * @type {?string}\r
+     * @private\r
+     */\r
+    this._stringOpen = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.DotProto.Tokenizer.prototype\r
+ * @inner\r
+ */\r
+var TokenizerPrototype = Tokenizer.prototype;\r
+\r
+/**\r
+ * Reads a string beginning at the current index.\r
+ * @return {string}\r
+ * @private\r
+ */\r
+TokenizerPrototype._readString = function() {\r
+    var re = this._stringOpen === '"'\r
+        ? Lang.STRING_DQ\r
+        : Lang.STRING_SQ;\r
+    re.lastIndex = this.index - 1; // Include the open quote\r
+    var match = re.exec(this.source);\r
+    if (!match)\r
+        throw Error("unterminated string");\r
+    this.index = re.lastIndex;\r
+    this.stack.push(this._stringOpen);\r
+    this._stringOpen = null;\r
+    return match[1];\r
+};\r
+\r
+/**\r
+ * Gets the next token and advances by one.\r
+ * @return {?string} Token or `null` on EOF\r
+ * @expose\r
+ */\r
+TokenizerPrototype.next = function() {\r
+    if (this.stack.length > 0)\r
+        return this.stack.shift();\r
+    if (this.index >= this.source.length)\r
+        return null;\r
+    if (this._stringOpen !== null)\r
+        return this._readString();\r
+\r
+    var repeat,\r
+        prev,\r
+        next;\r
+    do {\r
+        repeat = false;\r
+\r
+        // Strip white spaces\r
+        while (Lang.WHITESPACE.test(next = this.source.charAt(this.index))) {\r
+            if (next === '\n')\r
+                ++this.line;\r
+            if (++this.index === this.source.length)\r
+                return null;\r
+        }\r
+\r
+        // Strip comments\r
+        if (this.source.charAt(this.index) === '/') {\r
+            ++this.index;\r
+            if (this.source.charAt(this.index) === '/') { // Line\r
+                while (this.source.charAt(++this.index) !== '\n')\r
+                    if (this.index == this.source.length)\r
+                        return null;\r
+                ++this.index;\r
+                ++this.line;\r
+                repeat = true;\r
+            } else if ((next = this.source.charAt(this.index)) === '*') { /* Block */\r
+                do {\r
+                    if (next === '\n')\r
+                        ++this.line;\r
+                    if (++this.index === this.source.length)\r
+                        return null;\r
+                    prev = next;\r
+                    next = this.source.charAt(this.index);\r
+                } while (prev !== '*' || next !== '/');\r
+                ++this.index;\r
+                repeat = true;\r
+            } else\r
+                return '/';\r
+        }\r
+    } while (repeat);\r
+\r
+    if (this.index === this.source.length)\r
+        return null;\r
+\r
+    // Read the next token\r
+    var end = this.index;\r
+    Lang.DELIM.lastIndex = 0;\r
+    var delim = Lang.DELIM.test(this.source.charAt(end++));\r
+    if (!delim)\r
+        while(end < this.source.length && !Lang.DELIM.test(this.source.charAt(end)))\r
+            ++end;\r
+    var token = this.source.substring(this.index, this.index = end);\r
+    if (token === '"' || token === "'")\r
+        this._stringOpen = token;\r
+    return token;\r
+};\r
+\r
+/**\r
+ * Peeks for the next token.\r
+ * @return {?string} Token or `null` on EOF\r
+ * @expose\r
+ */\r
+TokenizerPrototype.peek = function() {\r
+    if (this.stack.length === 0) {\r
+        var token = this.next();\r
+        if (token === null)\r
+            return null;\r
+        this.stack.push(token);\r
+    }\r
+    return this.stack[0];\r
+};\r
+\r
+/**\r
+ * Skips a specific token and throws if it differs.\r
+ * @param {string} expected Expected token\r
+ * @throws {Error} If the actual token differs\r
+ */\r
+TokenizerPrototype.skip = function(expected) {\r
+    var actual = this.next();\r
+    if (actual !== expected)\r
+        throw Error("illegal '"+actual+"', '"+expected+"' expected");\r
+};\r
+\r
+/**\r
+ * Omits an optional token.\r
+ * @param {string} expected Expected optional token\r
+ * @returns {boolean} `true` if the token exists\r
+ */\r
+TokenizerPrototype.omit = function(expected) {\r
+    if (this.peek() === expected) {\r
+        this.next();\r
+        return true;\r
+    }\r
+    return false;\r
+};\r
+\r
+/**\r
+ * Returns a string representation of this object.\r
+ * @return {string} String representation as of "Tokenizer(index/length)"\r
+ * @expose\r
+ */\r
+TokenizerPrototype.toString = function() {\r
+    return "Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")";\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Lang.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Lang.js
new file mode 100644 (file)
index 0000000..a0fb768
--- /dev/null
@@ -0,0 +1,64 @@
+/**\r
+ * Language expressions.\r
+ * @type {!Object.<string,!RegExp>}\r
+ * @expose\r
+ */\r
+ProtoBuf.Lang = {\r
+\r
+    // Characters always ending a statement\r
+    DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,\r
+\r
+    // Field rules\r
+    RULE: /^(?:required|optional|repeated|map)$/,\r
+\r
+    // Field types\r
+    TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r
+\r
+    // Names\r
+    NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r
+\r
+    // Type definitions\r
+    TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r
+\r
+    // Type references\r
+    TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\r
+\r
+    // Fully qualified type references\r
+    FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r
+\r
+    // All numbers\r
+    NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r
+\r
+    // Decimal numbers\r
+    NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r
+\r
+    // Hexadecimal numbers\r
+    NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r
+\r
+    // Octal numbers\r
+    NUMBER_OCT: /^0[0-7]+$/,\r
+\r
+    // Floating point numbers\r
+    NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r
+\r
+    // Booleans\r
+    BOOL: /^(?:true|false)$/i,\r
+\r
+    // Id numbers\r
+    ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+    // Negative id numbers (enum values)\r
+    NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+    // Whitespaces\r
+    WHITESPACE: /\s/,\r
+\r
+    // All strings\r
+    STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,\r
+\r
+    // Double quoted strings\r
+    STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,\r
+\r
+    // Single quoted strings\r
+    STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Map.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Map.js
new file mode 100644 (file)
index 0000000..ca2e88a
--- /dev/null
@@ -0,0 +1,197 @@
+/**\r
+ * @alias ProtoBuf.Map\r
+ * @expose\r
+ */\r
+ProtoBuf.Map = (function(ProtoBuf, Reflect) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Constructs a new Map. A Map is a container that is used to implement map\r
+     * fields on message objects. It closely follows the ES6 Map API; however,\r
+     * it is distinct because we do not want to depend on external polyfills or\r
+     * on ES6 itself.\r
+     *\r
+     * @exports ProtoBuf.Map\r
+     * @param {!ProtoBuf.Reflect.Field} field Map field\r
+     * @param {Object.<string,*>=} contents Initial contents\r
+     * @constructor\r
+     */\r
+    var Map = function(field, contents) {\r
+        if (!field.map)\r
+            throw Error("field is not a map");\r
+\r
+        /**\r
+         * The field corresponding to this map.\r
+         * @type {!ProtoBuf.Reflect.Field}\r
+         */\r
+        this.field = field;\r
+\r
+        /**\r
+         * Element instance corresponding to key type.\r
+         * @type {!ProtoBuf.Reflect.Element}\r
+         */\r
+        this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r
+\r
+        /**\r
+         * Element instance corresponding to value type.\r
+         * @type {!ProtoBuf.Reflect.Element}\r
+         */\r
+        this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r
+\r
+        /**\r
+         * Internal map: stores mapping of (string form of key) -> (key, value)\r
+         * pair.\r
+         *\r
+         * We provide map semantics for arbitrary key types, but we build on top\r
+         * of an Object, which has only string keys. In order to avoid the need\r
+         * to convert a string key back to its native type in many situations,\r
+         * we store the native key value alongside the value. Thus, we only need\r
+         * a one-way mapping from a key type to its string form that guarantees\r
+         * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r
+         * === K2).\r
+         *\r
+         * @type {!Object<string, {key: *, value: *}>}\r
+         */\r
+        this.map = {};\r
+\r
+        /**\r
+         * Returns the number of elements in the map.\r
+         */\r
+        Object.defineProperty(this, "size", {\r
+            get: function() { return Object.keys(this.map).length; }\r
+        });\r
+\r
+        // Fill initial contents from a raw object.\r
+        if (contents) {\r
+            var keys = Object.keys(contents);\r
+            for (var i = 0; i < keys.length; i++) {\r
+                var key = this.keyElem.valueFromString(keys[i]);\r
+                var val = this.valueElem.verifyValue(contents[keys[i]]);\r
+                this.map[this.keyElem.valueToString(key)] =\r
+                    { key: key, value: val };\r
+            }\r
+        }\r
+    };\r
+\r
+    var MapPrototype = Map.prototype;\r
+\r
+    /**\r
+     * Helper: return an iterator over an array.\r
+     * @param {!Array<*>} arr the array\r
+     * @returns {!Object} an iterator\r
+     * @inner\r
+     */\r
+    function arrayIterator(arr) {\r
+        var idx = 0;\r
+        return {\r
+            next: function() {\r
+                if (idx < arr.length)\r
+                    return { done: false, value: arr[idx++] };\r
+                return { done: true };\r
+            }\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Clears the map.\r
+     */\r
+    MapPrototype.clear = function() {\r
+        this.map = {};\r
+    };\r
+\r
+    /**\r
+     * Deletes a particular key from the map.\r
+     * @returns {boolean} Whether any entry with this key was deleted.\r
+     */\r
+    MapPrototype["delete"] = function(key) {\r
+        var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+        var hadKey = keyValue in this.map;\r
+        delete this.map[keyValue];\r
+        return hadKey;\r
+    };\r
+\r
+    /**\r
+     * Returns an iterator over [key, value] pairs in the map.\r
+     * @returns {Object} The iterator\r
+     */\r
+    MapPrototype.entries = function() {\r
+        var entries = [];\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0, entry; i < strKeys.length; i++)\r
+            entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r
+        return arrayIterator(entries);\r
+    };\r
+\r
+    /**\r
+     * Returns an iterator over keys in the map.\r
+     * @returns {Object} The iterator\r
+     */\r
+    MapPrototype.keys = function() {\r
+        var keys = [];\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0; i < strKeys.length; i++)\r
+            keys.push(this.map[strKeys[i]].key);\r
+        return arrayIterator(keys);\r
+    };\r
+\r
+    /**\r
+     * Returns an iterator over values in the map.\r
+     * @returns {!Object} The iterator\r
+     */\r
+    MapPrototype.values = function() {\r
+        var values = [];\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0; i < strKeys.length; i++)\r
+            values.push(this.map[strKeys[i]].value);\r
+        return arrayIterator(values);\r
+    };\r
+\r
+    /**\r
+     * Iterates over entries in the map, calling a function on each.\r
+     * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r
+     * @param {Object=} thisArg The `this` value for the callback\r
+     */\r
+    MapPrototype.forEach = function(cb, thisArg) {\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0, entry; i < strKeys.length; i++)\r
+            cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r
+    };\r
+\r
+    /**\r
+     * Sets a key in the map to the given value.\r
+     * @param {*} key The key\r
+     * @param {*} value The value\r
+     * @returns {!ProtoBuf.Map} The map instance\r
+     */\r
+    MapPrototype.set = function(key, value) {\r
+        var keyValue = this.keyElem.verifyValue(key);\r
+        var valValue = this.valueElem.verifyValue(value);\r
+        this.map[this.keyElem.valueToString(keyValue)] =\r
+            { key: keyValue, value: valValue };\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Gets the value corresponding to a key in the map.\r
+     * @param {*} key The key\r
+     * @returns {*|undefined} The value, or `undefined` if key not present\r
+     */\r
+    MapPrototype.get = function(key) {\r
+        var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+        if (!(keyValue in this.map))\r
+            return undefined;\r
+        return this.map[keyValue].value;\r
+    };\r
+\r
+    /**\r
+     * Determines whether the given key is present in the map.\r
+     * @param {*} key The key\r
+     * @returns {boolean} `true` if the key is present\r
+     */\r
+    MapPrototype.has = function(key) {\r
+        var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+        return (keyValue in this.map);\r
+    };\r
+\r
+    return Map;\r
+})(ProtoBuf, ProtoBuf.Reflect);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect.js
new file mode 100644 (file)
index 0000000..8172bb9
--- /dev/null
@@ -0,0 +1,121 @@
+/**\r
+ * @alias ProtoBuf.Reflect\r
+ * @expose\r
+ */\r
+ProtoBuf.Reflect = (function(ProtoBuf) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Reflection types.\r
+     * @exports ProtoBuf.Reflect\r
+     * @namespace\r
+     */\r
+    var Reflect = {};\r
+    \r
+    //? include("Reflect/T.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.T\r
+     * @expose\r
+     */\r
+    Reflect.T = T;\r
+\r
+    //? include("Reflect/Namespace.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Namespace\r
+     * @expose\r
+     */\r
+    Reflect.Namespace = Namespace;\r
+\r
+    //? include("Reflect/Element.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Element\r
+     * @expose\r
+     */\r
+    Reflect.Element = Element;\r
+    \r
+    //? include("Reflect/Message.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message\r
+     * @expose\r
+     */\r
+    Reflect.Message = Message;\r
+    \r
+    //? include("Reflect/Message/Field.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message.Field\r
+     * @expose\r
+     */\r
+    Reflect.Message.Field = Field;\r
+\r
+    //? include("Reflect/Message/ExtensionField.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message.ExtensionField\r
+     * @expose\r
+     */\r
+    Reflect.Message.ExtensionField = ExtensionField;\r
+\r
+    //? include("Reflect/Message/OneOf.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message.OneOf\r
+     * @expose\r
+     */\r
+    Reflect.Message.OneOf = OneOf;\r
+\r
+    //? include("Reflect/Enum.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Enum\r
+     * @expose\r
+     */\r
+    Reflect.Enum = Enum;\r
+    \r
+    //? include("Reflect/Enum/Value.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Enum.Value\r
+     * @expose\r
+     */\r
+    Reflect.Enum.Value = Value;\r
+\r
+    //? include("Reflect/Extension.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Extension\r
+     * @expose\r
+     */\r
+    Reflect.Extension = Extension;\r
+\r
+    //? include("Reflect/Service.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Service\r
+     * @expose\r
+     */\r
+    Reflect.Service = Service;\r
+\r
+    //? include("Reflect/Service/Method.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Service.Method\r
+     * @expose\r
+     */\r
+    Reflect.Service.Method = Method;\r
+    \r
+    //? include("Reflect/Service/RPCMethod.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Service.RPCMethod\r
+     * @expose\r
+     */\r
+    Reflect.Service.RPCMethod = RPCMethod;\r
+\r
+    return Reflect;\r
+\r
+})(ProtoBuf);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Element.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Element.js
new file mode 100644 (file)
index 0000000..0e7b8ee
--- /dev/null
@@ -0,0 +1,580 @@
+/**\r
+ * Constructs a new Element implementation that checks and converts values for a\r
+ * particular field type, as appropriate.\r
+ *\r
+ * An Element represents a single value: either the value of a singular field,\r
+ * or a value contained in one entry of a repeated field or map field. This\r
+ * class does not implement these higher-level concepts; it only encapsulates\r
+ * the low-level typechecking and conversion.\r
+ *\r
+ * @exports ProtoBuf.Reflect.Element\r
+ * @param {{name: string, wireType: number}} type Resolved data type\r
+ * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r
+ * (e.g. submessage field).\r
+ * @param {boolean} isMapKey Is this element a Map key? The value will be\r
+ * converted to string form if so.\r
+ * @param {string} syntax Syntax level of defining message type, e.g.,\r
+ * proto2 or proto3.\r
+ * @param {string} name Name of the field containing this element (for error\r
+ * messages)\r
+ * @constructor\r
+ */\r
+var Element = function(type, resolvedType, isMapKey, syntax, name) {\r
+\r
+    /**\r
+     * Element type, as a string (e.g., int32).\r
+     * @type {{name: string, wireType: number}}\r
+     */\r
+    this.type = type;\r
+\r
+    /**\r
+     * Element type reference to submessage or enum definition, if needed.\r
+     * @type {ProtoBuf.Reflect.T|null}\r
+     */\r
+    this.resolvedType = resolvedType;\r
+\r
+    /**\r
+     * Element is a map key.\r
+     * @type {boolean}\r
+     */\r
+    this.isMapKey = isMapKey;\r
+\r
+    /**\r
+     * Syntax level of defining message type, e.g., proto2 or proto3.\r
+     * @type {string}\r
+     */\r
+    this.syntax = syntax;\r
+\r
+    /**\r
+     * Name of the field containing this element (for error messages)\r
+     * @type {string}\r
+     */\r
+    this.name = name;\r
+\r
+    if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)\r
+        throw Error("Invalid map key type: " + type.name);\r
+};\r
+\r
+var ElementPrototype = Element.prototype;\r
+\r
+/**\r
+ * Obtains a (new) default value for the specified type.\r
+ * @param type {string|{name: string, wireType: number}} Field type\r
+ * @returns {*} Default value\r
+ * @inner\r
+ */\r
+function mkDefault(type) {\r
+    if (typeof type === 'string')\r
+        type = ProtoBuf.TYPES[type];\r
+    if (typeof type.defaultValue === 'undefined')\r
+        throw Error("default value for type "+type.name+" is not supported");\r
+    if (type == ProtoBuf.TYPES["bytes"])\r
+        return new ByteBuffer(0);\r
+    return type.defaultValue;\r
+}\r
+\r
+/**\r
+ * Returns the default value for this field in proto3.\r
+ * @function\r
+ * @param type {string|{name: string, wireType: number}} the field type\r
+ * @returns {*} Default value\r
+ */\r
+Element.defaultFieldValue = mkDefault;\r
+\r
+/**\r
+ * Makes a Long from a value.\r
+ * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r
+ * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r
+ *  strings and numbers\r
+ * @returns {!Long}\r
+ * @throws {Error} If the value cannot be converted to a Long\r
+ * @inner\r
+ */\r
+function mkLong(value, unsigned) {\r
+    if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'\r
+        && value.low === value.low && value.high === value.high)\r
+        return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r
+    if (typeof value === 'string')\r
+        return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r
+    if (typeof value === 'number')\r
+        return ProtoBuf.Long.fromNumber(value, unsigned || false);\r
+    throw Error("not convertible to Long");\r
+}\r
+\r
+ElementPrototype.toString = function() {\r
+    return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r
+}\r
+\r
+/**\r
+ * Checks if the given value can be set for an element of this type (singular\r
+ * field or one element of a repeated field or map).\r
+ * @param {*} value Value to check\r
+ * @return {*} Verified, maybe adjusted, value\r
+ * @throws {Error} If the value cannot be verified for this element slot\r
+ * @expose\r
+ */\r
+ElementPrototype.verifyValue = function(value) {\r
+    var self = this;\r
+    function fail(val, msg) {\r
+        throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+    }\r
+    switch (this.type) {\r
+        // Signed 32bit\r
+        case ProtoBuf.TYPES["int32"]:\r
+        case ProtoBuf.TYPES["sint32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+            // Account for !NaN: value === value\r
+            if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r
+                fail(typeof value, "not an integer");\r
+            return value > 4294967295 ? value | 0 : value;\r
+\r
+        // Unsigned 32bit\r
+        case ProtoBuf.TYPES["uint32"]:\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r
+                fail(typeof value, "not an integer");\r
+            return value < 0 ? value >>> 0 : value;\r
+\r
+        // Signed 64bit\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["sint64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]: {\r
+            if (ProtoBuf.Long)\r
+                try {\r
+                    return mkLong(value, false);\r
+                } catch (e) {\r
+                    fail(typeof value, e.message);\r
+                }\r
+            else\r
+                fail(typeof value, "requires Long.js");\r
+        }\r
+\r
+        // Unsigned 64bit\r
+        case ProtoBuf.TYPES["uint64"]:\r
+        case ProtoBuf.TYPES["fixed64"]: {\r
+            if (ProtoBuf.Long)\r
+                try {\r
+                    return mkLong(value, true);\r
+                } catch (e) {\r
+                    fail(typeof value, e.message);\r
+                }\r
+            else\r
+                fail(typeof value, "requires Long.js");\r
+        }\r
+\r
+        // Bool\r
+        case ProtoBuf.TYPES["bool"]:\r
+            if (typeof value !== 'boolean')\r
+                fail(typeof value, "not a boolean");\r
+            return value;\r
+\r
+        // Float\r
+        case ProtoBuf.TYPES["float"]:\r
+        case ProtoBuf.TYPES["double"]:\r
+            if (typeof value !== 'number')\r
+                fail(typeof value, "not a number");\r
+            return value;\r
+\r
+        // Length-delimited string\r
+        case ProtoBuf.TYPES["string"]:\r
+            if (typeof value !== 'string' && !(value && value instanceof String))\r
+                fail(typeof value, "not a string");\r
+            return ""+value; // Convert String object to string\r
+\r
+        // Length-delimited bytes\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            if (ByteBuffer.isByteBuffer(value))\r
+                return value;\r
+            return ByteBuffer.wrap(value, "base64");\r
+\r
+        // Constant enum value\r
+        case ProtoBuf.TYPES["enum"]: {\r
+            var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r
+            for (i=0; i<values.length; i++)\r
+                if (values[i].name == value)\r
+                    return values[i].id;\r
+                else if (values[i].id == value)\r
+                    return values[i].id;\r
+\r
+            if (this.syntax === 'proto3') {\r
+                // proto3: just make sure it's an integer.\r
+                if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r
+                    fail(typeof value, "not an integer");\r
+                if (value > 4294967295 || value < 0)\r
+                    fail(typeof value, "not in range for uint32")\r
+                return value;\r
+            } else {\r
+                // proto2 requires enum values to be valid.\r
+                fail(value, "not a valid enum value");\r
+            }\r
+        }\r
+        // Embedded message\r
+        case ProtoBuf.TYPES["group"]:\r
+        case ProtoBuf.TYPES["message"]: {\r
+            if (!value || typeof value !== 'object')\r
+                fail(typeof value, "object expected");\r
+            if (value instanceof this.resolvedType.clazz)\r
+                return value;\r
+            if (value instanceof ProtoBuf.Builder.Message) {\r
+                // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r
+                var obj = {};\r
+                for (var i in value)\r
+                    if (value.hasOwnProperty(i))\r
+                        obj[i] = value[i];\r
+                value = obj;\r
+            }\r
+            // Else let's try to construct one from a key-value object\r
+            return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r
+        }\r
+    }\r
+\r
+    // We should never end here\r
+    throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");\r
+};\r
+\r
+/**\r
+ * Calculates the byte length of an element on the wire.\r
+ * @param {number} id Field number\r
+ * @param {*} value Field value\r
+ * @returns {number} Byte length\r
+ * @throws {Error} If the value cannot be calculated\r
+ * @expose\r
+ */\r
+ElementPrototype.calculateLength = function(id, value) {\r
+    if (value === null) return 0; // Nothing to encode\r
+    // Tag has already been written\r
+    var n;\r
+    switch (this.type) {\r
+        case ProtoBuf.TYPES["int32"]:\r
+            return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r
+        case ProtoBuf.TYPES["uint32"]:\r
+            return ByteBuffer.calculateVarint32(value);\r
+        case ProtoBuf.TYPES["sint32"]:\r
+            return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+        case ProtoBuf.TYPES["float"]:\r
+            return 4;\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+            return ByteBuffer.calculateVarint64(value);\r
+        case ProtoBuf.TYPES["sint64"]:\r
+            return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+            return 8;\r
+        case ProtoBuf.TYPES["bool"]:\r
+            return 1;\r
+        case ProtoBuf.TYPES["enum"]:\r
+            return ByteBuffer.calculateVarint32(value);\r
+        case ProtoBuf.TYPES["double"]:\r
+            return 8;\r
+        case ProtoBuf.TYPES["string"]:\r
+            n = ByteBuffer.calculateUTF8Bytes(value);\r
+            return ByteBuffer.calculateVarint32(n) + n;\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            if (value.remaining() < 0)\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+            return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r
+        case ProtoBuf.TYPES["message"]:\r
+            n = this.resolvedType.calculate(value);\r
+            return ByteBuffer.calculateVarint32(n) + n;\r
+        case ProtoBuf.TYPES["group"]:\r
+            n = this.resolvedType.calculate(value);\r
+            return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+    }\r
+    // We should never end here\r
+    throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+};\r
+\r
+/**\r
+ * Encodes a value to the specified buffer. Does not encode the key.\r
+ * @param {number} id Field number\r
+ * @param {*} value Field value\r
+ * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+ * @return {ByteBuffer} The ByteBuffer for chaining\r
+ * @throws {Error} If the value cannot be encoded\r
+ * @expose\r
+ */\r
+ElementPrototype.encodeValue = function(id, value, buffer) {\r
+    if (value === null) return buffer; // Nothing to encode\r
+    // Tag has already been written\r
+\r
+    switch (this.type) {\r
+        // 32bit signed varint\r
+        case ProtoBuf.TYPES["int32"]:\r
+            // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r
+            // long – it is, effectively, treated like a very large unsigned integer." (see #122)\r
+            if (value < 0)\r
+                buffer.writeVarint64(value);\r
+            else\r
+                buffer.writeVarint32(value);\r
+            break;\r
+\r
+        // 32bit unsigned varint\r
+        case ProtoBuf.TYPES["uint32"]:\r
+            buffer.writeVarint32(value);\r
+            break;\r
+\r
+        // 32bit varint zig-zag\r
+        case ProtoBuf.TYPES["sint32"]:\r
+            buffer.writeVarint32ZigZag(value);\r
+            break;\r
+\r
+        // Fixed unsigned 32bit\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            buffer.writeUint32(value);\r
+            break;\r
+\r
+        // Fixed signed 32bit\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+            buffer.writeInt32(value);\r
+            break;\r
+\r
+        // 64bit varint as-is\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+            buffer.writeVarint64(value); // throws\r
+            break;\r
+\r
+        // 64bit varint zig-zag\r
+        case ProtoBuf.TYPES["sint64"]:\r
+            buffer.writeVarint64ZigZag(value); // throws\r
+            break;\r
+\r
+        // Fixed unsigned 64bit\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+            buffer.writeUint64(value); // throws\r
+            break;\r
+\r
+        // Fixed signed 64bit\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+            buffer.writeInt64(value); // throws\r
+            break;\r
+\r
+        // Bool\r
+        case ProtoBuf.TYPES["bool"]:\r
+            if (typeof value === 'string')\r
+                buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r
+            else\r
+                buffer.writeVarint32(value ? 1 : 0);\r
+            break;\r
+\r
+        // Constant enum value\r
+        case ProtoBuf.TYPES["enum"]:\r
+            buffer.writeVarint32(value);\r
+            break;\r
+\r
+        // 32bit float\r
+        case ProtoBuf.TYPES["float"]:\r
+            buffer.writeFloat32(value);\r
+            break;\r
+\r
+        // 64bit float\r
+        case ProtoBuf.TYPES["double"]:\r
+            buffer.writeFloat64(value);\r
+            break;\r
+\r
+        // Length-delimited string\r
+        case ProtoBuf.TYPES["string"]:\r
+            buffer.writeVString(value);\r
+            break;\r
+\r
+        // Length-delimited bytes\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            if (value.remaining() < 0)\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+            var prevOffset = value.offset;\r
+            buffer.writeVarint32(value.remaining());\r
+            buffer.append(value);\r
+            value.offset = prevOffset;\r
+            break;\r
+\r
+        // Embedded message\r
+        case ProtoBuf.TYPES["message"]:\r
+            var bb = new ByteBuffer().LE();\r
+            this.resolvedType.encode(value, bb);\r
+            buffer.writeVarint32(bb.offset);\r
+            buffer.append(bb.flip());\r
+            break;\r
+\r
+        // Legacy group\r
+        case ProtoBuf.TYPES["group"]:\r
+            this.resolvedType.encode(value, buffer);\r
+            buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+            break;\r
+\r
+        default:\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+    }\r
+    return buffer;\r
+};\r
+\r
+/**\r
+ * Decode one element value from the specified buffer.\r
+ * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+ * @param {number} wireType The field wire type\r
+ * @param {number} id The field number\r
+ * @return {*} Decoded value\r
+ * @throws {Error} If the field cannot be decoded\r
+ * @expose\r
+ */\r
+ElementPrototype.decode = function(buffer, wireType, id) {\r
+    if (wireType != this.type.wireType)\r
+        throw Error("Unexpected wire type for element");\r
+\r
+    var value, nBytes;\r
+    switch (this.type) {\r
+        // 32bit signed varint\r
+        case ProtoBuf.TYPES["int32"]:\r
+            return buffer.readVarint32() | 0;\r
+\r
+        // 32bit unsigned varint\r
+        case ProtoBuf.TYPES["uint32"]:\r
+            return buffer.readVarint32() >>> 0;\r
+\r
+        // 32bit signed varint zig-zag\r
+        case ProtoBuf.TYPES["sint32"]:\r
+            return buffer.readVarint32ZigZag() | 0;\r
+\r
+        // Fixed 32bit unsigned\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            return buffer.readUint32() >>> 0;\r
+\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+            return buffer.readInt32() | 0;\r
+\r
+        // 64bit signed varint\r
+        case ProtoBuf.TYPES["int64"]:\r
+            return buffer.readVarint64();\r
+\r
+        // 64bit unsigned varint\r
+        case ProtoBuf.TYPES["uint64"]:\r
+            return buffer.readVarint64().toUnsigned();\r
+\r
+        // 64bit signed varint zig-zag\r
+        case ProtoBuf.TYPES["sint64"]:\r
+            return buffer.readVarint64ZigZag();\r
+\r
+        // Fixed 64bit unsigned\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+            return buffer.readUint64();\r
+\r
+        // Fixed 64bit signed\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+            return buffer.readInt64();\r
+\r
+        // Bool varint\r
+        case ProtoBuf.TYPES["bool"]:\r
+            return !!buffer.readVarint32();\r
+\r
+        // Constant enum value (varint)\r
+        case ProtoBuf.TYPES["enum"]:\r
+            // The following Builder.Message#set will already throw\r
+            return buffer.readVarint32();\r
+\r
+        // 32bit float\r
+        case ProtoBuf.TYPES["float"]:\r
+            return buffer.readFloat();\r
+\r
+        // 64bit float\r
+        case ProtoBuf.TYPES["double"]:\r
+            return buffer.readDouble();\r
+\r
+        // Length-delimited string\r
+        case ProtoBuf.TYPES["string"]:\r
+            return buffer.readVString();\r
+\r
+        // Length-delimited bytes\r
+        case ProtoBuf.TYPES["bytes"]: {\r
+            nBytes = buffer.readVarint32();\r
+            if (buffer.remaining() < nBytes)\r
+                throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+            value = buffer.clone(); // Offset already set\r
+            value.limit = value.offset+nBytes;\r
+            buffer.offset += nBytes;\r
+            return value;\r
+        }\r
+\r
+        // Length-delimited embedded message\r
+        case ProtoBuf.TYPES["message"]: {\r
+            nBytes = buffer.readVarint32();\r
+            return this.resolvedType.decode(buffer, nBytes);\r
+        }\r
+\r
+        // Legacy group\r
+        case ProtoBuf.TYPES["group"]:\r
+            return this.resolvedType.decode(buffer, -1, id);\r
+    }\r
+\r
+    // We should never end here\r
+    throw Error("[INTERNAL] Illegal decode type");\r
+};\r
+\r
+/**\r
+ * Converts a value from a string to the canonical element type.\r
+ *\r
+ * Legal only when isMapKey is true.\r
+ *\r
+ * @param {string} str The string value\r
+ * @returns {*} The value\r
+ */\r
+ElementPrototype.valueFromString = function(str) {\r
+    if (!this.isMapKey) {\r
+        throw Error("valueFromString() called on non-map-key element");\r
+    }\r
+\r
+    switch (this.type) {\r
+        case ProtoBuf.TYPES["int32"]:\r
+        case ProtoBuf.TYPES["sint32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+        case ProtoBuf.TYPES["uint32"]:\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            return this.verifyValue(parseInt(str));\r
+\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["sint64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+              // Long-based fields support conversions from string already.\r
+              return this.verifyValue(str);\r
+\r
+        case ProtoBuf.TYPES["bool"]:\r
+              return str === "true";\r
+\r
+        case ProtoBuf.TYPES["string"]:\r
+              return this.verifyValue(str);\r
+\r
+        case ProtoBuf.TYPES["bytes"]:\r
+              return ByteBuffer.fromBinary(str);\r
+    }\r
+};\r
+\r
+/**\r
+ * Converts a value from the canonical element type to a string.\r
+ *\r
+ * It should be the case that `valueFromString(valueToString(val))` returns\r
+ * a value equivalent to `verifyValue(val)` for every legal value of `val`\r
+ * according to this element type.\r
+ *\r
+ * This may be used when the element must be stored or used as a string,\r
+ * e.g., as a map key on an Object.\r
+ *\r
+ * Legal only when isMapKey is true.\r
+ *\r
+ * @param {*} val The value\r
+ * @returns {string} The string form of the value.\r
+ */\r
+ElementPrototype.valueToString = function(value) {\r
+    if (!this.isMapKey) {\r
+        throw Error("valueToString() called on non-map-key element");\r
+    }\r
+\r
+    if (this.type === ProtoBuf.TYPES["bytes"]) {\r
+        return value.toString("binary");\r
+    } else {\r
+        return value.toString();\r
+    }\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum.js
new file mode 100644 (file)
index 0000000..87c05e6
--- /dev/null
@@ -0,0 +1,68 @@
+/**\r
+ * Constructs a new Enum.\r
+ * @exports ProtoBuf.Reflect.Enum\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r
+ * @param {string} name Enum name\r
+ * @param {Object.<string,*>=} options Enum options\r
+ * @param {string?} syntax The syntax level (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Enum = function(builder, parent, name, options, syntax) {\r
+    Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Enum";\r
+\r
+    /**\r
+     * Runtime enum object.\r
+     * @type {Object.<string,number>|null}\r
+     * @expose\r
+     */\r
+    this.object = null;\r
+};\r
+\r
+/**\r
+ * Gets the string name of an enum value.\r
+ * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r
+ * @param {number} value Enum value\r
+ * @returns {?string} Name or `null` if not present\r
+ * @expose\r
+ */\r
+Enum.getName = function(enm, value) {\r
+    var keys = Object.keys(enm);\r
+    for (var i=0, key; i<keys.length; ++i)\r
+        if (enm[key = keys[i]] === value)\r
+            return key;\r
+    return null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Enum.prototype\r
+ * @inner\r
+ */\r
+var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds this enum and returns the runtime counterpart.\r
+ * @param {boolean} rebuild Whether to rebuild or not, defaults to false\r
+ * @returns {!Object.<string,number>}\r
+ * @expose\r
+ */\r
+EnumPrototype.build = function(rebuild) {\r
+    if (this.object && !rebuild)\r
+        return this.object;\r
+    var enm = new ProtoBuf.Builder.Enum(),\r
+        values = this.getChildren(Enum.Value);\r
+    for (var i=0, k=values.length; i<k; ++i)\r
+        enm[values[i]['name']] = values[i]['id'];\r
+    if (Object.defineProperty)\r
+        Object.defineProperty(enm, '$options', {\r
+            "value": this.buildOpt(),\r
+            "enumerable": false\r
+        });\r
+    return this.object = enm;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum/Value.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum/Value.js
new file mode 100644 (file)
index 0000000..9c809fa
--- /dev/null
@@ -0,0 +1,28 @@
+/**\r
+ * Constructs a new Enum Value.\r
+ * @exports ProtoBuf.Reflect.Enum.Value\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Enum} enm Enum reference\r
+ * @param {string} name Field name\r
+ * @param {number} id Unique field id\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Value = function(builder, enm, name, id) {\r
+    T.call(this, builder, enm, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Enum.Value";\r
+\r
+    /**\r
+     * Unique enum value id.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.id = id;\r
+};\r
+\r
+// Extends T\r
+Value.prototype = Object.create(T.prototype);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Extension.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Extension.js
new file mode 100644 (file)
index 0000000..4559a4f
--- /dev/null
@@ -0,0 +1,22 @@
+/**\r
+ * An extension (field).\r
+ * @exports ProtoBuf.Reflect.Extension\r
+ * @constructor\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.T} parent Parent object\r
+ * @param {string} name Object name\r
+ * @param {!ProtoBuf.Reflect.Message.Field} field Extension field\r
+ */\r
+var Extension = function(builder, parent, name, field) {\r
+    T.call(this, builder, parent, name);\r
+\r
+    /**\r
+     * Extended message field.\r
+     * @type {!ProtoBuf.Reflect.Message.Field}\r
+     * @expose\r
+     */\r
+    this.field = field;\r
+};\r
+\r
+// Extends T\r
+Extension.prototype = Object.create(T.prototype);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message.js
new file mode 100644 (file)
index 0000000..f802aff
--- /dev/null
@@ -0,0 +1,287 @@
+/**\r
+ * Constructs a new Message.\r
+ * @exports ProtoBuf.Reflect.Message\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r
+ * @param {string} name Message name\r
+ * @param {Object.<string,*>=} options Message options\r
+ * @param {boolean=} isGroup `true` if this is a legacy group\r
+ * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Message = function(builder, parent, name, options, isGroup, syntax) {\r
+    Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Message";\r
+\r
+    /**\r
+     * Extensions range.\r
+     * @type {!Array.<number>|undefined}\r
+     * @expose\r
+     */\r
+    this.extensions = undefined;\r
+\r
+    /**\r
+     * Runtime message class.\r
+     * @type {?function(new:ProtoBuf.Builder.Message)}\r
+     * @expose\r
+     */\r
+    this.clazz = null;\r
+\r
+    /**\r
+     * Whether this is a legacy group or not.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.isGroup = !!isGroup;\r
+\r
+    // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r
+\r
+    /**\r
+     * Cached fields.\r
+     * @type {?Array.<!ProtoBuf.Reflect.Message.Field>}\r
+     * @private\r
+     */\r
+    this._fields = null;\r
+\r
+    /**\r
+     * Cached fields by id.\r
+     * @type {?Object.<number,!ProtoBuf.Reflect.Message.Field>}\r
+     * @private\r
+     */\r
+    this._fieldsById = null;\r
+\r
+    /**\r
+     * Cached fields by name.\r
+     * @type {?Object.<string,!ProtoBuf.Reflect.Message.Field>}\r
+     * @private\r
+     */\r
+    this._fieldsByName = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Message.prototype\r
+ * @inner\r
+ */\r
+var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds the message and returns the runtime counterpart, which is a fully functional class.\r
+ * @see ProtoBuf.Builder.Message\r
+ * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r
+ * @return {ProtoBuf.Reflect.Message} Message class\r
+ * @throws {Error} If the message cannot be built\r
+ * @expose\r
+ */\r
+MessagePrototype.build = function(rebuild) {\r
+    if (this.clazz && !rebuild)\r
+        return this.clazz;\r
+\r
+    // Create the runtime Message class in its own scope\r
+    var clazz = (function(ProtoBuf, T) {\r
+\r
+        //? include("../Builder/Message.js");\r
+\r
+        return Message;\r
+\r
+    })(ProtoBuf, this);\r
+\r
+    // Static enums and prototyped sub-messages / cached collections\r
+    this._fields = [];\r
+    this._fieldsById = {};\r
+    this._fieldsByName = {};\r
+    this._oneofsByName = {};\r
+    for (var i=0, k=this.children.length, child; i<k; i++) {\r
+        child = this.children[i];\r
+        if (child instanceof Enum || child instanceof Message || child instanceof Service) {\r
+            if (clazz.hasOwnProperty(child.name))\r
+                throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");\r
+            clazz[child.name] = child.build();\r
+        } else if (child instanceof Message.Field)\r
+            child.build(),\r
+            this._fields.push(child),\r
+            this._fieldsById[child.id] = child,\r
+            this._fieldsByName[child.name] = child;\r
+        else if (child instanceof Message.OneOf) {\r
+            this._oneofsByName[child.name] = child;\r
+        }\r
+        else if (!(child instanceof Message.OneOf) && !(child instanceof Extension)) // Not built\r
+            throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));\r
+    }\r
+\r
+    return this.clazz = clazz;\r
+};\r
+\r
+/**\r
+ * Encodes a runtime message's contents to the specified buffer.\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+ * @param {ByteBuffer} buffer ByteBuffer to write to\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {ByteBuffer} The ByteBuffer for chaining\r
+ * @throws {Error} If required fields are missing or the message cannot be encoded for another reason\r
+ * @expose\r
+ */\r
+MessagePrototype.encode = function(message, buffer, noVerify) {\r
+    var fieldMissing = null,\r
+        field;\r
+    for (var i=0, k=this._fields.length, val; i<k; ++i) {\r
+        field = this._fields[i];\r
+        val = message[field.name];\r
+        if (field.required && val === null) {\r
+            if (fieldMissing === null)\r
+                fieldMissing = field;\r
+        } else\r
+            field.encode(noVerify ? val : field.verifyValue(val), buffer, message);\r
+    }\r
+    if (fieldMissing !== null) {\r
+        var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);\r
+        err["encoded"] = buffer; // Still expose what we got\r
+        throw(err);\r
+    }\r
+    return buffer;\r
+};\r
+\r
+/**\r
+ * Calculates a runtime message's byte length.\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+ * @returns {number} Byte length\r
+ * @throws {Error} If required fields are missing or the message cannot be calculated for another reason\r
+ * @expose\r
+ */\r
+MessagePrototype.calculate = function(message) {\r
+    for (var n=0, i=0, k=this._fields.length, field, val; i<k; ++i) {\r
+        field = this._fields[i];\r
+        val = message[field.name];\r
+        if (field.required && val === null)\r
+           throw Error("Missing at least one required field for "+this.toString(true)+": "+field);\r
+        else\r
+            n += field.calculate(val, message);\r
+    }\r
+    return n;\r
+};\r
+\r
+/**\r
+ * Skips all data until the end of the specified group has been reached.\r
+ * @param {number} expectedId Expected GROUPEND id\r
+ * @param {!ByteBuffer} buf ByteBuffer\r
+ * @returns {boolean} `true` if a value as been skipped, `false` if the end has been reached\r
+ * @throws {Error} If it wasn't possible to find the end of the group (buffer overrun or end tag mismatch)\r
+ * @inner\r
+ */\r
+function skipTillGroupEnd(expectedId, buf) {\r
+    var tag = buf.readVarint32(), // Throws on OOB\r
+        wireType = tag & 0x07,\r
+        id = tag >>> 3;\r
+    switch (wireType) {\r
+        case ProtoBuf.WIRE_TYPES.VARINT:\r
+            do tag = buf.readUint8();\r
+            while ((tag & 0x80) === 0x80);\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.BITS64:\r
+            buf.offset += 8;\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.LDELIM:\r
+            tag = buf.readVarint32(); // reads the varint\r
+            buf.offset += tag;        // skips n bytes\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+            skipTillGroupEnd(id, buf);\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.ENDGROUP:\r
+            if (id === expectedId)\r
+                return false;\r
+            else\r
+                throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");\r
+        case ProtoBuf.WIRE_TYPES.BITS32:\r
+            buf.offset += 4;\r
+            break;\r
+        default:\r
+            throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);\r
+    }\r
+    return true;\r
+}\r
+\r
+/**\r
+ * Decodes an encoded message and returns the decoded message.\r
+ * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+ * @param {number=} length Message length. Defaults to decode all remaining data.\r
+ * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r
+ * @return {ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded\r
+ * @expose\r
+ */\r
+MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r
+    if (typeof length !== 'number')\r
+        length = -1;\r
+    var start = buffer.offset,\r
+        msg = new (this.clazz)(),\r
+        tag, wireType, id, field;\r
+    while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {\r
+        tag = buffer.readVarint32();\r
+        wireType = tag & 0x07;\r
+        id = tag >>> 3;\r
+        if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r
+            if (id !== expectedGroupEndId)\r
+                throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");\r
+            break;\r
+        }\r
+        if (!(field = this._fieldsById[id])) {\r
+            // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing."\r
+            switch (wireType) {\r
+                case ProtoBuf.WIRE_TYPES.VARINT:\r
+                    buffer.readVarint32();\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.BITS32:\r
+                    buffer.offset += 4;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.BITS64:\r
+                    buffer.offset += 8;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.LDELIM:\r
+                    var len = buffer.readVarint32();\r
+                    buffer.offset += len;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+                    while (skipTillGroupEnd(id, buffer)) {}\r
+                    break;\r
+                default:\r
+                    throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);\r
+            }\r
+            continue;\r
+        }\r
+        if (field.repeated && !field.options["packed"]) {\r
+            msg[field.name].push(field.decode(wireType, buffer));\r
+        } else if (field.map) {\r
+            var keyval = field.decode(wireType, buffer);\r
+            msg[field.name].set(keyval[0], keyval[1]);\r
+        } else {\r
+            msg[field.name] = field.decode(wireType, buffer);\r
+            if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+                var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r
+                if (currentField !== null && currentField !== field.name)\r
+                    msg[currentField] = null; // Clear currently set field\r
+                msg[field.oneof.name] = field.name; // Point virtual field at this field\r
+            }\r
+        }\r
+    }\r
+\r
+    // Check if all required fields are present and set default values for optional fields that are not\r
+    for (var i=0, k=this._fields.length; i<k; ++i) {\r
+        field = this._fields[i];\r
+        if (msg[field.name] === null) {\r
+            if (this.syntax === "proto3") { // Proto3 sets default values by specification\r
+                msg[field.name] = field.defaultValue;\r
+            } else if (field.required) {\r
+                var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);\r
+                err["decoded"] = msg; // Still expose what we got\r
+                throw(err);\r
+            } else if (ProtoBuf.populateDefaults && field.defaultValue !== null)\r
+                msg[field.name] = field.defaultValue;\r
+        }\r
+    }\r
+    return msg;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/ExtensionField.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/ExtensionField.js
new file mode 100644 (file)
index 0000000..5052191
--- /dev/null
@@ -0,0 +1,26 @@
+/**\r
+ * Constructs a new Message ExtensionField.\r
+ * @exports ProtoBuf.Reflect.Message.ExtensionField\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+ * @param {string} rule Rule, one of requried, optional, repeated\r
+ * @param {string} type Data type, e.g. int32\r
+ * @param {string} name Field name\r
+ * @param {number} id Unique field id\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Message.Field\r
+ */\r
+var ExtensionField = function(builder, message, rule, type, name, id, options) {\r
+    Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r
+\r
+    /**\r
+     * Extension reference.\r
+     * @type {!ProtoBuf.Reflect.Extension}\r
+     * @expose\r
+     */\r
+    this.extension;\r
+};\r
+\r
+// Extends Field\r
+ExtensionField.prototype = Object.create(Field.prototype);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/Field.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/Field.js
new file mode 100644 (file)
index 0000000..d7c3b64
--- /dev/null
@@ -0,0 +1,458 @@
+/**\r
+ * Constructs a new Message Field.\r
+ * @exports ProtoBuf.Reflect.Message.Field\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+ * @param {string} rule Rule, one of requried, optional, repeated\r
+ * @param {string?} keytype Key data type, if any.\r
+ * @param {string} type Data type, e.g. int32\r
+ * @param {string} name Field name\r
+ * @param {number} id Unique field id\r
+ * @param {Object.<string,*>=} options Options\r
+ * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r
+ * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r
+    T.call(this, builder, message, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Message.Field";\r
+\r
+    /**\r
+     * Message field required flag.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.required = rule === "required";\r
+\r
+    /**\r
+     * Message field repeated flag.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.repeated = rule === "repeated";\r
+\r
+    /**\r
+     * Message field map flag.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.map = rule === "map";\r
+\r
+    /**\r
+     * Message field key type. Type reference string if unresolved, protobuf\r
+     * type if resolved. Valid only if this.map === true, null otherwise.\r
+     * @type {string|{name: string, wireType: number}|null}\r
+     * @expose\r
+     */\r
+    this.keyType = keytype || null;\r
+\r
+    /**\r
+     * Message field type. Type reference string if unresolved, protobuf type if\r
+     * resolved. In a map field, this is the value type.\r
+     * @type {string|{name: string, wireType: number}}\r
+     * @expose\r
+     */\r
+    this.type = type;\r
+\r
+    /**\r
+     * Resolved type reference inside the global namespace.\r
+     * @type {ProtoBuf.Reflect.T|null}\r
+     * @expose\r
+     */\r
+    this.resolvedType = null;\r
+\r
+    /**\r
+     * Unique message field id.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.id = id;\r
+\r
+    /**\r
+     * Message field options.\r
+     * @type {!Object.<string,*>}\r
+     * @dict\r
+     * @expose\r
+     */\r
+    this.options = options || {};\r
+\r
+    /**\r
+     * Default value.\r
+     * @type {*}\r
+     * @expose\r
+     */\r
+    this.defaultValue = null;\r
+\r
+    /**\r
+     * Enclosing OneOf.\r
+     * @type {?ProtoBuf.Reflect.Message.OneOf}\r
+     * @expose\r
+     */\r
+    this.oneof = oneof || null;\r
+\r
+    /**\r
+     * Syntax level of this definition (e.g., proto3).\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.syntax = syntax || 'proto2';\r
+\r
+    /**\r
+     * Original field name.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r
+\r
+    /**\r
+     * Element implementation. Created in build() after types are resolved.\r
+     * @type {ProtoBuf.Element}\r
+     * @expose\r
+     */\r
+    this.element = null;\r
+\r
+    /**\r
+     * Key element implementation, for map fields. Created in build() after\r
+     * types are resolved.\r
+     * @type {ProtoBuf.Element}\r
+     * @expose\r
+     */\r
+    this.keyElement = null;\r
+\r
+    // Convert field names to camel case notation if the override is set\r
+    if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))\r
+        this.name = ProtoBuf.Util.toCamelCase(this.name);\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Message.Field.prototype\r
+ * @inner\r
+ */\r
+var FieldPrototype = Field.prototype = Object.create(T.prototype);\r
+\r
+/**\r
+ * Builds the field.\r
+ * @override\r
+ * @expose\r
+ */\r
+FieldPrototype.build = function() {\r
+    this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r
+    if (this.map)\r
+        this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r
+\r
+    // In proto3, fields do not have field presence, and every field is set to\r
+    // its type's default value ("", 0, 0.0, or false).\r
+    if (this.syntax === 'proto3' && !this.repeated && !this.map)\r
+        this.defaultValue = Element.defaultFieldValue(this.type);\r
+\r
+    // Otherwise, default values are present when explicitly specified\r
+    else if (typeof this.options['default'] !== 'undefined')\r
+        this.defaultValue = this.verifyValue(this.options['default']);\r
+};\r
+\r
+/**\r
+ * Checks if the given value can be set for this field.\r
+ * @param {*} value Value to check\r
+ * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r
+ * @return {*} Verified, maybe adjusted, value\r
+ * @throws {Error} If the value cannot be set for this field\r
+ * @expose\r
+ */\r
+FieldPrototype.verifyValue = function(value, skipRepeated) {\r
+    skipRepeated = skipRepeated || false;\r
+    var self = this;\r
+    function fail(val, msg) {\r
+        throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+    }\r
+    if (value === null) { // NULL values for optional fields\r
+        if (this.required)\r
+            fail(typeof value, "required");\r
+        if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"])\r
+            fail(typeof value, "proto3 field without field presence cannot be null");\r
+        return null;\r
+    }\r
+    var i;\r
+    if (this.repeated && !skipRepeated) { // Repeated values as arrays\r
+        if (!Array.isArray(value))\r
+            value = [value];\r
+        var res = [];\r
+        for (i=0; i<value.length; i++)\r
+            res.push(this.element.verifyValue(value[i]));\r
+        return res;\r
+    }\r
+    if (this.map && !skipRepeated) { // Map values as objects\r
+        if (!(value instanceof ProtoBuf.Map)) {\r
+            // If not already a Map, attempt to convert.\r
+            if (!(value instanceof Object)) {\r
+                fail(typeof value,\r
+                     "expected ProtoBuf.Map or raw object for map field");\r
+            }\r
+            return new ProtoBuf.Map(this, value);\r
+        } else {\r
+            return value;\r
+        }\r
+    }\r
+    // All non-repeated fields expect no array\r
+    if (!this.repeated && Array.isArray(value))\r
+        fail(typeof value, "no array expected");\r
+\r
+    return this.element.verifyValue(value);\r
+};\r
+\r
+/**\r
+ * Determines whether the field will have a presence on the wire given its\r
+ * value.\r
+ * @param {*} value Verified field value\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+ * @return {boolean} Whether the field will be present on the wire\r
+ */\r
+FieldPrototype.hasWirePresence = function(value, message) {\r
+    if (this.syntax !== 'proto3')\r
+        return (value !== null);\r
+    if (this.oneof && message[this.oneof.name] === this.name)\r
+        return true;\r
+    switch (this.type) {\r
+        case ProtoBuf.TYPES["int32"]:\r
+        case ProtoBuf.TYPES["sint32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+        case ProtoBuf.TYPES["uint32"]:\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            return value !== 0;\r
+\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["sint64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+            return value.low !== 0 || value.high !== 0;\r
+\r
+        case ProtoBuf.TYPES["bool"]:\r
+            return value;\r
+\r
+        case ProtoBuf.TYPES["float"]:\r
+        case ProtoBuf.TYPES["double"]:\r
+            return value !== 0.0;\r
+\r
+        case ProtoBuf.TYPES["string"]:\r
+            return value.length > 0;\r
+\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            return value.remaining() > 0;\r
+\r
+        case ProtoBuf.TYPES["enum"]:\r
+            return value !== 0;\r
+\r
+        case ProtoBuf.TYPES["message"]:\r
+            return value !== null;\r
+        default:\r
+            return true;\r
+    }\r
+};\r
+\r
+/**\r
+ * Encodes the specified field value to the specified buffer.\r
+ * @param {*} value Verified field value\r
+ * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+ * @return {ByteBuffer} The ByteBuffer for chaining\r
+ * @throws {Error} If the field cannot be encoded\r
+ * @expose\r
+ */\r
+FieldPrototype.encode = function(value, buffer, message) {\r
+    if (this.type === null || typeof this.type !== 'object')\r
+        throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+    if (value === null || (this.repeated && value.length == 0))\r
+        return buffer; // Optional omitted\r
+    try {\r
+        if (this.repeated) {\r
+            var i;\r
+            // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r
+            // types) can be declared 'packed'."\r
+            if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                // "All of the elements of the field are packed into a single key-value pair with wire type 2\r
+                // (length-delimited). Each element is encoded the same way it would be normally, except without a\r
+                // tag preceding it."\r
+                buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r
+                var start = buffer.offset; // Remember where the contents begin\r
+                for (i=0; i<value.length; i++)\r
+                    this.element.encodeValue(this.id, value[i], buffer);\r
+                var len = buffer.offset-start,\r
+                    varintLen = ByteBuffer.calculateVarint32(len);\r
+                if (varintLen > 1) { // We need to move the contents\r
+                    var contents = buffer.slice(start, buffer.offset);\r
+                    start += varintLen-1;\r
+                    buffer.offset = start;\r
+                    buffer.append(contents);\r
+                }\r
+                buffer.writeVarint32(len, start-varintLen);\r
+            } else {\r
+                // "If your message definition has repeated elements (without the [packed=true] option), the encoded\r
+                // message has zero or more key-value pairs with the same tag number"\r
+                for (i=0; i<value.length; i++)\r
+                    buffer.writeVarint32((this.id << 3) | this.type.wireType),\r
+                    this.element.encodeValue(this.id, value[i], buffer);\r
+            }\r
+        } else if (this.map) {\r
+            // Write out each map entry as a submessage.\r
+            value.forEach(function(val, key, m) {\r
+                // Compute the length of the submessage (key, val) pair.\r
+                var length =\r
+                    ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +\r
+                    this.keyElement.calculateLength(1, key) +\r
+                    ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +\r
+                    this.element.calculateLength(2, val);\r
+\r
+                // Submessage with wire type of length-delimited.\r
+                buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                buffer.writeVarint32(length);\r
+\r
+                // Write out the key and val.\r
+                buffer.writeVarint32((1 << 3) | this.keyType.wireType);\r
+                this.keyElement.encodeValue(1, key, buffer);\r
+                buffer.writeVarint32((2 << 3) | this.type.wireType);\r
+                this.element.encodeValue(2, val, buffer);\r
+            }, this);\r
+        } else {\r
+            if (this.hasWirePresence(value, message)) {\r
+                buffer.writeVarint32((this.id << 3) | this.type.wireType);\r
+                this.element.encodeValue(this.id, value, buffer);\r
+            }\r
+        }\r
+    } catch (e) {\r
+        throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+    }\r
+    return buffer;\r
+};\r
+\r
+/**\r
+ * Calculates the length of this field's value on the network level.\r
+ * @param {*} value Field value\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+ * @returns {number} Byte length\r
+ * @expose\r
+ */\r
+FieldPrototype.calculate = function(value, message) {\r
+    value = this.verifyValue(value); // May throw\r
+    if (this.type === null || typeof this.type !== 'object')\r
+        throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+    if (value === null || (this.repeated && value.length == 0))\r
+        return 0; // Optional omitted\r
+    var n = 0;\r
+    try {\r
+        if (this.repeated) {\r
+            var i, ni;\r
+            if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                ni = 0;\r
+                for (i=0; i<value.length; i++)\r
+                    ni += this.element.calculateLength(this.id, value[i]);\r
+                n += ByteBuffer.calculateVarint32(ni);\r
+                n += ni;\r
+            } else {\r
+                for (i=0; i<value.length; i++)\r
+                    n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType),\r
+                    n += this.element.calculateLength(this.id, value[i]);\r
+            }\r
+        } else if (this.map) {\r
+            // Each map entry becomes a submessage.\r
+            value.forEach(function(val, key, m) {\r
+                // Compute the length of the submessage (key, val) pair.\r
+                var length =\r
+                    ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +\r
+                    this.keyElement.calculateLength(1, key) +\r
+                    ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +\r
+                    this.element.calculateLength(2, val);\r
+\r
+                n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                n += ByteBuffer.calculateVarint32(length);\r
+                n += length;\r
+            }, this);\r
+        } else {\r
+            if (this.hasWirePresence(value, message)) {\r
+                n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType);\r
+                n += this.element.calculateLength(this.id, value);\r
+            }\r
+        }\r
+    } catch (e) {\r
+        throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+    }\r
+    return n;\r
+};\r
+\r
+/**\r
+ * Decode the field value from the specified buffer.\r
+ * @param {number} wireType Leading wire type\r
+ * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+ * @param {boolean=} skipRepeated Whether to skip the repeated check or not. Defaults to false.\r
+ * @return {*} Decoded value: array for packed repeated fields, [key, value] for\r
+ *             map fields, or an individual value otherwise.\r
+ * @throws {Error} If the field cannot be decoded\r
+ * @expose\r
+ */\r
+FieldPrototype.decode = function(wireType, buffer, skipRepeated) {\r
+    var value, nBytes;\r
+\r
+    // We expect wireType to match the underlying type's wireType unless we see\r
+    // a packed repeated field, or unless this is a map field.\r
+    var wireTypeOK =\r
+        (!this.map && wireType == this.type.wireType) ||\r
+        (!skipRepeated && this.repeated && this.options["packed"] &&\r
+         wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||\r
+        (this.map && wireType == ProtoBuf.WIRE_TYPES.LDELIM);\r
+    if (!wireTypeOK)\r
+        throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");\r
+\r
+    // Handle packed repeated fields.\r
+    if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+        if (!skipRepeated) {\r
+            nBytes = buffer.readVarint32();\r
+            nBytes = buffer.offset + nBytes; // Limit\r
+            var values = [];\r
+            while (buffer.offset < nBytes)\r
+                values.push(this.decode(this.type.wireType, buffer, true));\r
+            return values;\r
+        }\r
+        // Read the next value otherwise...\r
+    }\r
+\r
+    // Handle maps.\r
+    if (this.map) {\r
+        // Read one (key, value) submessage, and return [key, value]\r
+        var key = Element.defaultFieldValue(this.keyType);\r
+        value = Element.defaultFieldValue(this.type);\r
+\r
+        // Read the length\r
+        nBytes = buffer.readVarint32();\r
+        if (buffer.remaining() < nBytes)\r
+            throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+\r
+        // Get a sub-buffer of this key/value submessage\r
+        var msgbuf = buffer.clone();\r
+        msgbuf.limit = msgbuf.offset + nBytes;\r
+        buffer.offset += nBytes;\r
+\r
+        while (msgbuf.remaining() > 0) {\r
+            var tag = msgbuf.readVarint32();\r
+            wireType = tag & 0x07;\r
+            var id = tag >>> 3;\r
+            if (id === 1) {\r
+                key = this.keyElement.decode(msgbuf, wireType, id);\r
+            } else if (id === 2) {\r
+                value = this.element.decode(msgbuf, wireType, id);\r
+            } else {\r
+                throw Error("Unexpected tag in map field key/value submessage");\r
+            }\r
+        }\r
+\r
+        return [key, value];\r
+    }\r
+\r
+    // Handle singular and non-packed repeated field values.\r
+    return this.element.decode(buffer, wireType, this.id);\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/OneOf.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/OneOf.js
new file mode 100644 (file)
index 0000000..07a896f
--- /dev/null
@@ -0,0 +1,19 @@
+/**\r
+ * Constructs a new Message OneOf.\r
+ * @exports ProtoBuf.Reflect.Message.OneOf\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+ * @param {string} name OneOf name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var OneOf = function(builder, message, name) {\r
+    T.call(this, builder, message, name);\r
+\r
+    /**\r
+     * Enclosed fields.\r
+     * @type {!Array.<!ProtoBuf.Reflect.Message.Field>}\r
+     * @expose\r
+     */\r
+    this.fields = [];\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Namespace.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Namespace.js
new file mode 100644 (file)
index 0000000..b5c96c9
--- /dev/null
@@ -0,0 +1,203 @@
+/**\r
+ * Constructs a new Namespace.\r
+ * @exports ProtoBuf.Reflect.Namespace\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r
+ * @param {string} name Namespace name\r
+ * @param {Object.<string,*>=} options Namespace options\r
+ * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Namespace = function(builder, parent, name, options, syntax) {\r
+    T.call(this, builder, parent, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Namespace";\r
+\r
+    /**\r
+     * Children inside the namespace.\r
+     * @type {!Array.<ProtoBuf.Reflect.T>}\r
+     */\r
+    this.children = [];\r
+\r
+    /**\r
+     * Options.\r
+     * @type {!Object.<string, *>}\r
+     */\r
+    this.options = options || {};\r
+\r
+    /**\r
+     * Syntax level (e.g., proto2 or proto3).\r
+     * @type {!string}\r
+     */\r
+    this.syntax = syntax || "proto2";\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Namespace.prototype\r
+ * @inner\r
+ */\r
+var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r
+\r
+/**\r
+ * Returns an array of the namespace's children.\r
+ * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r
+ * @return {Array.<ProtoBuf.Reflect.T>}\r
+ * @expose\r
+ */\r
+NamespacePrototype.getChildren = function(type) {\r
+    type = type || null;\r
+    if (type == null)\r
+        return this.children.slice();\r
+    var children = [];\r
+    for (var i=0, k=this.children.length; i<k; ++i)\r
+        if (this.children[i] instanceof type)\r
+            children.push(this.children[i]);\r
+    return children;\r
+};\r
+\r
+/**\r
+ * Adds a child to the namespace.\r
+ * @param {ProtoBuf.Reflect.T} child Child\r
+ * @throws {Error} If the child cannot be added (duplicate)\r
+ * @expose\r
+ */\r
+NamespacePrototype.addChild = function(child) {\r
+    var other;\r
+    if (other = this.getChild(child.name)) {\r
+        // Try to revert camelcase transformation on collision\r
+        if (other instanceof Message.Field && other.name !== other.originalName && this.getChild(other.originalName) === null)\r
+            other.name = other.originalName; // Revert previous first (effectively keeps both originals)\r
+        else if (child instanceof Message.Field && child.name !== child.originalName && this.getChild(child.originalName) === null)\r
+            child.name = child.originalName;\r
+        else\r
+            throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);\r
+    }\r
+    this.children.push(child);\r
+};\r
+\r
+/**\r
+ * Gets a child by its name or id.\r
+ * @param {string|number} nameOrId Child name or id\r
+ * @return {?ProtoBuf.Reflect.T} The child or null if not found\r
+ * @expose\r
+ */\r
+NamespacePrototype.getChild = function(nameOrId) {\r
+    var key = typeof nameOrId === 'number' ? 'id' : 'name';\r
+    for (var i=0, k=this.children.length; i<k; ++i)\r
+        if (this.children[i][key] === nameOrId)\r
+            return this.children[i];\r
+    return null;\r
+};\r
+\r
+/**\r
+ * Resolves a reflect object inside of this namespace.\r
+ * @param {string|!Array.<string>} qn Qualified name to resolve\r
+ * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r
+ * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r
+ * @expose\r
+ */\r
+NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r
+    var part = typeof qn === 'string' ? qn.split(".") : qn,\r
+        ptr = this,\r
+        i = 0;\r
+    if (part[i] === "") { // Fully qualified name, e.g. ".My.Message'\r
+        while (ptr.parent !== null)\r
+            ptr = ptr.parent;\r
+        i++;\r
+    }\r
+    var child;\r
+    do {\r
+        do {\r
+            if (!(ptr instanceof Reflect.Namespace)) {\r
+                ptr = null;\r
+                break;\r
+            }\r
+            child = ptr.getChild(part[i]);\r
+            if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {\r
+                ptr = null;\r
+                break;\r
+            }\r
+            ptr = child; i++;\r
+        } while (i < part.length);\r
+        if (ptr != null)\r
+            break; // Found\r
+        // Else search the parent\r
+        if (this.parent !== null)\r
+            return this.parent.resolve(qn, excludeNonNamespace);\r
+    } while (ptr != null);\r
+    return ptr;\r
+};\r
+\r
+/**\r
+ * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r
+ * @param {!ProtoBuf.Reflect.T} t Reflection type\r
+ * @returns {string} The shortest qualified name or, if there is none, the fqn\r
+ * @expose\r
+ */\r
+NamespacePrototype.qn = function(t) {\r
+    var part = [], ptr = t;\r
+    do {\r
+        part.unshift(ptr.name);\r
+        ptr = ptr.parent;\r
+    } while (ptr !== null);\r
+    for (var len=1; len <= part.length; len++) {\r
+        var qn = part.slice(part.length-len);\r
+        if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r
+            return qn.join(".");\r
+    }\r
+    return t.fqn();\r
+};\r
+\r
+/**\r
+ * Builds the namespace and returns the runtime counterpart.\r
+ * @return {Object.<string,Function|Object>} Runtime namespace\r
+ * @expose\r
+ */\r
+NamespacePrototype.build = function() {\r
+    /** @dict */\r
+    var ns = {};\r
+    var children = this.children;\r
+    for (var i=0, k=children.length, child; i<k; ++i) {\r
+        child = children[i];\r
+        if (child instanceof Namespace)\r
+            ns[child.name] = child.build();\r
+    }\r
+    if (Object.defineProperty)\r
+        Object.defineProperty(ns, "$options", { "value": this.buildOpt() });\r
+    return ns;\r
+};\r
+\r
+/**\r
+ * Builds the namespace's '$options' property.\r
+ * @return {Object.<string,*>}\r
+ */\r
+NamespacePrototype.buildOpt = function() {\r
+    var opt = {},\r
+        keys = Object.keys(this.options);\r
+    for (var i=0, k=keys.length; i<k; ++i) {\r
+        var key = keys[i],\r
+            val = this.options[keys[i]];\r
+        // TODO: Options are not resolved, yet.\r
+        // if (val instanceof Namespace) {\r
+        //     opt[key] = val.build();\r
+        // } else {\r
+        opt[key] = val;\r
+        // }\r
+    }\r
+    return opt;\r
+};\r
+\r
+/**\r
+ * Gets the value assigned to the option with the specified name.\r
+ * @param {string=} name Returns the option value if specified, otherwise all options are returned.\r
+ * @return {*|Object.<string,*>}null} Option value or NULL if there is no such option\r
+ */\r
+NamespacePrototype.getOption = function(name) {\r
+    if (typeof name === 'undefined')\r
+        return this.options;\r
+    return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js
new file mode 100644 (file)
index 0000000..025df11
--- /dev/null
@@ -0,0 +1,52 @@
+/**\r
+ * Constructs a new Service.\r
+ * @exports ProtoBuf.Reflect.Service\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Namespace} root Root\r
+ * @param {string} name Service name\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Service = function(builder, root, name, options) {\r
+    Namespace.call(this, builder, root, name, options);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service";\r
+\r
+    /**\r
+     * Built runtime service class.\r
+     * @type {?function(new:ProtoBuf.Builder.Service)}\r
+     */\r
+    this.clazz = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Service.prototype\r
+ * @inner\r
+ */\r
+var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds the service and returns the runtime counterpart, which is a fully functional class.\r
+ * @see ProtoBuf.Builder.Service\r
+ * @param {boolean=} rebuild Whether to rebuild or not\r
+ * @return {Function} Service class\r
+ * @throws {Error} If the message cannot be built\r
+ * @expose\r
+ */\r
+ServicePrototype.build = function(rebuild) {\r
+    if (this.clazz && !rebuild)\r
+        return this.clazz;\r
+\r
+    // Create the runtime Service class in its own scope\r
+    return this.clazz = (function(ProtoBuf, T) {\r
+\r
+        //? include("../Builder/Service.js");\r
+\r
+        return Service;\r
+\r
+    })(ProtoBuf, this);\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/Method.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/Method.js
new file mode 100644 (file)
index 0000000..9d56ef6
--- /dev/null
@@ -0,0 +1,39 @@
+/**\r
+ * Abstract service method.\r
+ * @exports ProtoBuf.Reflect.Service.Method\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Service} svc Service\r
+ * @param {string} name Method name\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Method = function(builder, svc, name, options) {\r
+    T.call(this, builder, svc, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service.Method";\r
+\r
+    /**\r
+     * Options.\r
+     * @type {Object.<string, *>}\r
+     * @expose\r
+     */\r
+    this.options = options || {};\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Service.Method.prototype\r
+ * @inner\r
+ */\r
+var MethodPrototype = Method.prototype = Object.create(T.prototype);\r
+\r
+/**\r
+ * Builds the method's '$options' property.\r
+ * @name ProtoBuf.Reflect.Service.Method#buildOpt\r
+ * @function\r
+ * @return {Object.<string,*>}\r
+ */\r
+MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/RPCMethod.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/RPCMethod.js
new file mode 100644 (file)
index 0000000..3c12b02
--- /dev/null
@@ -0,0 +1,67 @@
+/**\r
+ * RPC service method.\r
+ * @exports ProtoBuf.Reflect.Service.RPCMethod\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Service} svc Service\r
+ * @param {string} name Method name\r
+ * @param {string} request Request message name\r
+ * @param {string} response Response message name\r
+ * @param {boolean} request_stream Whether requests are streamed\r
+ * @param {boolean} response_stream Whether responses are streamed\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Service.Method\r
+ */\r
+var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r
+    Method.call(this, builder, svc, name, options);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service.RPCMethod";\r
+\r
+    /**\r
+     * Request message name.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.requestName = request;\r
+\r
+    /**\r
+     * Response message name.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.responseName = response;\r
+\r
+    /**\r
+     * Whether requests are streamed\r
+     * @type {bool}\r
+     * @expose\r
+     */\r
+    this.requestStream = request_stream;\r
+\r
+    /**\r
+     * Whether responses are streamed\r
+     * @type {bool}\r
+     * @expose\r
+     */\r
+    this.responseStream = response_stream;\r
+\r
+    /**\r
+     * Resolved request message type.\r
+     * @type {ProtoBuf.Reflect.Message}\r
+     * @expose\r
+     */\r
+    this.resolvedRequestType = null;\r
+\r
+    /**\r
+     * Resolved response message type.\r
+     * @type {ProtoBuf.Reflect.Message}\r
+     * @expose\r
+     */\r
+    this.resolvedResponseType = null;\r
+};\r
+\r
+// Extends Method\r
+RPCMethod.prototype = Object.create(Method.prototype);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/T.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Reflect/T.js
new file mode 100644 (file)
index 0000000..12d2b13
--- /dev/null
@@ -0,0 +1,81 @@
+/**\r
+ * Constructs a Reflect base class.\r
+ * @exports ProtoBuf.Reflect.T\r
+ * @constructor\r
+ * @abstract\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {?ProtoBuf.Reflect.T} parent Parent object\r
+ * @param {string} name Object name\r
+ */\r
+var T = function(builder, parent, name) {\r
+\r
+    /**\r
+     * Builder reference.\r
+     * @type {!ProtoBuf.Builder}\r
+     * @expose\r
+     */\r
+    this.builder = builder;\r
+\r
+    /**\r
+     * Parent object.\r
+     * @type {?ProtoBuf.Reflect.T}\r
+     * @expose\r
+     */\r
+    this.parent = parent;\r
+\r
+    /**\r
+     * Object name in namespace.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.name = name;\r
+\r
+    /**\r
+     * Fully qualified class name\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.className;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.T.prototype\r
+ * @inner\r
+ */\r
+var TPrototype = T.prototype;\r
+\r
+/**\r
+ * Returns the fully qualified name of this object.\r
+ * @returns {string} Fully qualified name as of ".PATH.TO.THIS"\r
+ * @expose\r
+ */\r
+TPrototype.fqn = function() {\r
+    var name = this.name,\r
+        ptr = this;\r
+    do {\r
+        ptr = ptr.parent;\r
+        if (ptr == null)\r
+            break;\r
+        name = ptr.name+"."+name;\r
+    } while (true);\r
+    return name;\r
+};\r
+\r
+/**\r
+ * Returns a string representation of this Reflect object (its fully qualified name).\r
+ * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r
+ * @return String representation\r
+ * @expose\r
+ */\r
+TPrototype.toString = function(includeClass) {\r
+    return (includeClass ? this.className + " " : "") + this.fqn();\r
+};\r
+\r
+/**\r
+ * Builds this type.\r
+ * @throws {Error} If this type cannot be built directly\r
+ * @expose\r
+ */\r
+TPrototype.build = function() {\r
+    throw Error(this.toString(true)+" cannot be built directly");\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Util.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/ProtoBuf/Util.js
new file mode 100644 (file)
index 0000000..d8dc06e
--- /dev/null
@@ -0,0 +1,116 @@
+/**\r
+ * @alias ProtoBuf.Util\r
+ * @expose\r
+ */\r
+ProtoBuf.Util = (function() {\r
+    "use strict";\r
+\r
+    /**\r
+     * ProtoBuf utilities.\r
+     * @exports ProtoBuf.Util\r
+     * @namespace\r
+     */\r
+    var Util = {};\r
+\r
+    /**\r
+     * Flag if running in node or not.\r
+     * @type {boolean}\r
+     * @const\r
+     * @expose\r
+     */\r
+    Util.IS_NODE = !!(\r
+        typeof process === 'object' && process+'' === '[object process]' && !process['browser']\r
+    );\r
+\r
+    /**\r
+     * Constructs a XMLHttpRequest object.\r
+     * @return {XMLHttpRequest}\r
+     * @throws {Error} If XMLHttpRequest is not supported\r
+     * @expose\r
+     */\r
+    Util.XHR = function() {\r
+        // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r
+        var XMLHttpFactories = [\r
+            function () {return new XMLHttpRequest()},\r
+            function () {return new ActiveXObject("Msxml2.XMLHTTP")},\r
+            function () {return new ActiveXObject("Msxml3.XMLHTTP")},\r
+            function () {return new ActiveXObject("Microsoft.XMLHTTP")}\r
+        ];\r
+        /** @type {?XMLHttpRequest} */\r
+        var xhr = null;\r
+        for (var i=0;i<XMLHttpFactories.length;i++) {\r
+            try { xhr = XMLHttpFactories[i](); }\r
+            catch (e) { continue; }\r
+            break;\r
+        }\r
+        if (!xhr)\r
+            throw Error("XMLHttpRequest is not supported");\r
+        return xhr;\r
+    };\r
+\r
+    /**\r
+     * Fetches a resource.\r
+     * @param {string} path Resource path\r
+     * @param {function(?string)=} callback Callback receiving the resource's contents. If omitted the resource will\r
+     *   be fetched synchronously. If the request failed, contents will be null.\r
+     * @return {?string|undefined} Resource contents if callback is omitted (null if the request failed), else undefined.\r
+     * @expose\r
+     */\r
+    Util.fetch = function(path, callback) {\r
+        if (callback && typeof callback != 'function')\r
+            callback = null;\r
+        if (Util.IS_NODE) {\r
+            var fs = require("fs");\r
+            if (callback) {\r
+                fs.readFile(path, function(err, data) {\r
+                    if (err)\r
+                        callback(null);\r
+                    else\r
+                        callback(""+data);\r
+                });\r
+            } else\r
+                try {\r
+                    return fs.readFileSync(path);\r
+                } catch (e) {\r
+                    return null;\r
+                }\r
+        } else {\r
+            var xhr = Util.XHR();\r
+            xhr.open('GET', path, callback ? true : false);\r
+            // xhr.setRequestHeader('User-Agent', 'XMLHTTP/1.0');\r
+            xhr.setRequestHeader('Accept', 'text/plain');\r
+            if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');\r
+            if (callback) {\r
+                xhr.onreadystatechange = function() {\r
+                    if (xhr.readyState != 4) return;\r
+                    if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 && typeof xhr.responseText === 'string'))\r
+                        callback(xhr.responseText);\r
+                    else\r
+                        callback(null);\r
+                };\r
+                if (xhr.readyState == 4)\r
+                    return;\r
+                xhr.send(null);\r
+            } else {\r
+                xhr.send(null);\r
+                if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 && typeof xhr.responseText === 'string'))\r
+                    return xhr.responseText;\r
+                return null;\r
+            }\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Converts a string to camel case.\r
+     * @param {string} str\r
+     * @returns {string}\r
+     * @expose\r
+     */\r
+    Util.toCamelCase = function(str) {\r
+        return str.replace(/_([a-zA-Z])/g, function ($0, $1) {\r
+            return $1.toUpperCase();\r
+        });\r
+    };\r
+    \r
+    return Util;\r
+})();\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/bower.json.in b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/bower.json.in
new file mode 100644 (file)
index 0000000..11e30fb
--- /dev/null
@@ -0,0 +1,19 @@
+{\r
+    "name": "protobuf",\r
+    "description": "Protocol Buffers for JavaScript. Finally.",\r
+    "version": /*?== VERSION */,\r
+    "main": "dist/protobuf.js",\r
+    "license": "Apache-2.0",\r
+    "homepage": "http://dcode.io/",\r
+    "dependencies": {\r
+        "bytebuffer": "~5"\r
+    },\r
+    "keywords": ["net", "buffer", "protobuf", "serialization", "bytebuffer", "websocket", "webrtc"],\r
+    "ignore": [\r
+        "**/.*",\r
+        "node_modules",\r
+        "bower_components",\r
+        "test",\r
+        "tests"\r
+    ]\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/es5.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/es5.js
new file mode 100644 (file)
index 0000000..83b4c71
--- /dev/null
@@ -0,0 +1,43 @@
+// Starting with ProtoBuf.js 4.X we are no longer bundling any ES5 polyfills with the library.\r
+// It is now up to the user to provide these as needed. For reference, this is what we use:\r
+\r
+// ref: https://developer.mozilla.org/de/docs/JavaScript/Reference/Global_Objects/Object/create\r
+if (!Object.create)\r
+    /** @expose */\r
+    Object.create = function (o) {\r
+        if (arguments.length > 1)\r
+            throw Error('illegal number of arguments');\r
+        function F() {}\r
+        F.prototype = o;\r
+        return new F();\r
+    };\r
+\r
+// ref: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\r
+if (!Array.isArray)\r
+    /** @expose */\r
+    Array.isArray = function(o) {\r
+        return Object.prototype.toString.call(o) === "[object Array]";\r
+    };\r
+\r
+// ref: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r
+if (!Array.prototype.forEach)\r
+    /** @expose */\r
+    Array.prototype.forEach = function(callback, thisArg) {\r
+        var T, k;\r
+        if (this == null)\r
+            throw new TypeError('this is null or not defined');\r
+        var O = Object(this);\r
+        var len = O.length >>> 0;\r
+        if (typeof callback !== "function")\r
+            throw new TypeError(callback + ' is not a function');\r
+        if (arguments.length > 1)\r
+            T = thisArg;\r
+        k = 0;\r
+        while (k < len) {\r
+            var kValue;\r
+            if (k in O)\r
+                kValue = O[k],\r
+                callback.call(T, kValue, k, O);\r
+            k++;\r
+        }\r
+    };\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/README.md b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/README.md
new file mode 100644 (file)
index 0000000..9f0c426
--- /dev/null
@@ -0,0 +1,13 @@
+These files are by default not used by ProtoBuf.js and are here for the purpose of completeness. The library does not\r
+need and therefore does not use these files by design. In most use cases including the descriptor isn't even required\r
+and would just add about 10KB (minified JSON) to your application.\r
+\r
+### Though it's possible to include them:\r
+\r
+1. You may explicitly reference them by providing a relative or absolute path in your .proto files. E.g. use\r
+   `./google/protobuf/descriptor.proto` and bundle the file with your application.\r
+   \r
+2. If you use the `proto2js` command line utility with the `-legacy` option and the descriptor namespace is explicitly\r
+   referenced, it is included in the generated output.\r
+\r
+You are then able to work with it as if it'd be no more and no less than a standard import.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/descriptor.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/descriptor.json
new file mode 100644 (file)
index 0000000..2cb3cc1
--- /dev/null
@@ -0,0 +1,849 @@
+{
+    "package": "google.protobuf",
+    "syntax": "proto2",
+    "options": {
+        "java_package": "com.google.protobuf",
+        "java_outer_classname": "DescriptorProtos",
+        "optimize_for": "SPEED"
+    },
+    "messages": [
+        {
+            "name": "FileDescriptorSet",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "FileDescriptorProto",
+                    "name": "file",
+                    "id": 1
+                }
+            ]
+        },
+        {
+            "name": "FileDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "package",
+                    "id": 2
+                },
+                {
+                    "rule": "repeated",
+                    "type": "string",
+                    "name": "dependency",
+                    "id": 3
+                },
+                {
+                    "rule": "repeated",
+                    "type": "int32",
+                    "name": "public_dependency",
+                    "id": 10
+                },
+                {
+                    "rule": "repeated",
+                    "type": "int32",
+                    "name": "weak_dependency",
+                    "id": 11
+                },
+                {
+                    "rule": "repeated",
+                    "type": "DescriptorProto",
+                    "name": "message_type",
+                    "id": 4
+                },
+                {
+                    "rule": "repeated",
+                    "type": "EnumDescriptorProto",
+                    "name": "enum_type",
+                    "id": 5
+                },
+                {
+                    "rule": "repeated",
+                    "type": "ServiceDescriptorProto",
+                    "name": "service",
+                    "id": 6
+                },
+                {
+                    "rule": "repeated",
+                    "type": "FieldDescriptorProto",
+                    "name": "extension",
+                    "id": 7
+                },
+                {
+                    "rule": "optional",
+                    "type": "FileOptions",
+                    "name": "options",
+                    "id": 8
+                },
+                {
+                    "rule": "optional",
+                    "type": "SourceCodeInfo",
+                    "name": "source_code_info",
+                    "id": 9
+                }
+            ]
+        },
+        {
+            "name": "DescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "repeated",
+                    "type": "FieldDescriptorProto",
+                    "name": "field",
+                    "id": 2
+                },
+                {
+                    "rule": "repeated",
+                    "type": "FieldDescriptorProto",
+                    "name": "extension",
+                    "id": 6
+                },
+                {
+                    "rule": "repeated",
+                    "type": "DescriptorProto",
+                    "name": "nested_type",
+                    "id": 3
+                },
+                {
+                    "rule": "repeated",
+                    "type": "EnumDescriptorProto",
+                    "name": "enum_type",
+                    "id": 4
+                },
+                {
+                    "rule": "repeated",
+                    "type": "ExtensionRange",
+                    "name": "extension_range",
+                    "id": 5
+                },
+                {
+                    "rule": "optional",
+                    "type": "MessageOptions",
+                    "name": "options",
+                    "id": 7
+                }
+            ],
+            "messages": [
+                {
+                    "name": "ExtensionRange",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "optional",
+                            "type": "int32",
+                            "name": "start",
+                            "id": 1
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "int32",
+                            "name": "end",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "FieldDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "int32",
+                    "name": "number",
+                    "id": 3
+                },
+                {
+                    "rule": "optional",
+                    "type": "Label",
+                    "name": "label",
+                    "id": 4
+                },
+                {
+                    "rule": "optional",
+                    "type": "Type",
+                    "name": "type",
+                    "id": 5
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "type_name",
+                    "id": 6
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "extendee",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "default_value",
+                    "id": 7
+                },
+                {
+                    "rule": "optional",
+                    "type": "FieldOptions",
+                    "name": "options",
+                    "id": 8
+                }
+            ],
+            "enums": [
+                {
+                    "name": "Type",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "TYPE_DOUBLE",
+                            "id": 1
+                        },
+                        {
+                            "name": "TYPE_FLOAT",
+                            "id": 2
+                        },
+                        {
+                            "name": "TYPE_INT64",
+                            "id": 3
+                        },
+                        {
+                            "name": "TYPE_UINT64",
+                            "id": 4
+                        },
+                        {
+                            "name": "TYPE_INT32",
+                            "id": 5
+                        },
+                        {
+                            "name": "TYPE_FIXED64",
+                            "id": 6
+                        },
+                        {
+                            "name": "TYPE_FIXED32",
+                            "id": 7
+                        },
+                        {
+                            "name": "TYPE_BOOL",
+                            "id": 8
+                        },
+                        {
+                            "name": "TYPE_STRING",
+                            "id": 9
+                        },
+                        {
+                            "name": "TYPE_GROUP",
+                            "id": 10
+                        },
+                        {
+                            "name": "TYPE_MESSAGE",
+                            "id": 11
+                        },
+                        {
+                            "name": "TYPE_BYTES",
+                            "id": 12
+                        },
+                        {
+                            "name": "TYPE_UINT32",
+                            "id": 13
+                        },
+                        {
+                            "name": "TYPE_ENUM",
+                            "id": 14
+                        },
+                        {
+                            "name": "TYPE_SFIXED32",
+                            "id": 15
+                        },
+                        {
+                            "name": "TYPE_SFIXED64",
+                            "id": 16
+                        },
+                        {
+                            "name": "TYPE_SINT32",
+                            "id": 17
+                        },
+                        {
+                            "name": "TYPE_SINT64",
+                            "id": 18
+                        }
+                    ]
+                },
+                {
+                    "name": "Label",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "LABEL_OPTIONAL",
+                            "id": 1
+                        },
+                        {
+                            "name": "LABEL_REQUIRED",
+                            "id": 2
+                        },
+                        {
+                            "name": "LABEL_REPEATED",
+                            "id": 3
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "EnumDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "repeated",
+                    "type": "EnumValueDescriptorProto",
+                    "name": "value",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "EnumOptions",
+                    "name": "options",
+                    "id": 3
+                }
+            ]
+        },
+        {
+            "name": "EnumValueDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "int32",
+                    "name": "number",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "EnumValueOptions",
+                    "name": "options",
+                    "id": 3
+                }
+            ]
+        },
+        {
+            "name": "ServiceDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "repeated",
+                    "type": "MethodDescriptorProto",
+                    "name": "method",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "ServiceOptions",
+                    "name": "options",
+                    "id": 3
+                }
+            ]
+        },
+        {
+            "name": "MethodDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "input_type",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "output_type",
+                    "id": 3
+                },
+                {
+                    "rule": "optional",
+                    "type": "MethodOptions",
+                    "name": "options",
+                    "id": 4
+                }
+            ]
+        },
+        {
+            "name": "FileOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "java_package",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "java_outer_classname",
+                    "id": 8
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "java_multiple_files",
+                    "id": 10,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "java_generate_equals_and_hash",
+                    "id": 20,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "OptimizeMode",
+                    "name": "optimize_for",
+                    "id": 9,
+                    "options": {
+                        "default": "SPEED"
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "go_package",
+                    "id": 11
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "cc_generic_services",
+                    "id": 16,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "java_generic_services",
+                    "id": 17,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "py_generic_services",
+                    "id": 18,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ],
+            "enums": [
+                {
+                    "name": "OptimizeMode",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "SPEED",
+                            "id": 1
+                        },
+                        {
+                            "name": "CODE_SIZE",
+                            "id": 2
+                        },
+                        {
+                            "name": "LITE_RUNTIME",
+                            "id": 3
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "MessageOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "message_set_wire_format",
+                    "id": 1,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "no_standard_descriptor_accessor",
+                    "id": 2,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "FieldOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "CType",
+                    "name": "ctype",
+                    "id": 1,
+                    "options": {
+                        "default": "STRING"
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "packed",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "lazy",
+                    "id": 5,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "deprecated",
+                    "id": 3,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "experimental_map_key",
+                    "id": 9
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "weak",
+                    "id": 10,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ],
+            "enums": [
+                {
+                    "name": "CType",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "STRING",
+                            "id": 0
+                        },
+                        {
+                            "name": "CORD",
+                            "id": 1
+                        },
+                        {
+                            "name": "STRING_PIECE",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "EnumOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "allow_alias",
+                    "id": 2,
+                    "options": {
+                        "default": true
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "EnumValueOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "ServiceOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "MethodOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "UninterpretedOption",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "NamePart",
+                    "name": "name",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "identifier_value",
+                    "id": 3
+                },
+                {
+                    "rule": "optional",
+                    "type": "uint64",
+                    "name": "positive_int_value",
+                    "id": 4
+                },
+                {
+                    "rule": "optional",
+                    "type": "int64",
+                    "name": "negative_int_value",
+                    "id": 5
+                },
+                {
+                    "rule": "optional",
+                    "type": "double",
+                    "name": "double_value",
+                    "id": 6
+                },
+                {
+                    "rule": "optional",
+                    "type": "bytes",
+                    "name": "string_value",
+                    "id": 7
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "aggregate_value",
+                    "id": 8
+                }
+            ],
+            "messages": [
+                {
+                    "name": "NamePart",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "required",
+                            "type": "string",
+                            "name": "name_part",
+                            "id": 1
+                        },
+                        {
+                            "rule": "required",
+                            "type": "bool",
+                            "name": "is_extension",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "SourceCodeInfo",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "Location",
+                    "name": "location",
+                    "id": 1
+                }
+            ],
+            "messages": [
+                {
+                    "name": "Location",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "repeated",
+                            "type": "int32",
+                            "name": "path",
+                            "id": 1,
+                            "options": {
+                                "packed": true
+                            }
+                        },
+                        {
+                            "rule": "repeated",
+                            "type": "int32",
+                            "name": "span",
+                            "id": 2,
+                            "options": {
+                                "packed": true
+                            }
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "string",
+                            "name": "leading_comments",
+                            "id": 3
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "string",
+                            "name": "trailing_comments",
+                            "id": 4
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "isNamespace": true
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/descriptor.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/google/protobuf/descriptor.proto
new file mode 100644 (file)
index 0000000..83fe2e1
--- /dev/null
@@ -0,0 +1,620 @@
+// Protocol Buffers - Google's data interchange format\r
+// Copyright 2008 Google Inc.  All rights reserved.\r
+// http://code.google.com/p/protobuf/\r
+//\r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are\r
+// met:\r
+//\r
+//     * Redistributions of source code must retain the above copyright\r
+// notice, this list of conditions and the following disclaimer.\r
+//     * Redistributions in binary form must reproduce the above\r
+// copyright notice, this list of conditions and the following disclaimer\r
+// in the documentation and/or other materials provided with the\r
+// distribution.\r
+//     * Neither the name of Google Inc. nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+//\r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+// Author: kenton@google.com (Kenton Varda)\r
+//  Based on original Protocol Buffers design by\r
+//  Sanjay Ghemawat, Jeff Dean, and others.\r
+//\r
+// The messages in this file describe the definitions found in .proto files.\r
+// A valid .proto file can be translated directly to a FileDescriptorProto\r
+// without any other information (e.g. without reading its imports).\r
+\r
+\r
+\r
+package google.protobuf;\r
+option java_package = "com.google.protobuf";\r
+option java_outer_classname = "DescriptorProtos";\r
+\r
+// descriptor.proto must be optimized for speed because reflection-based\r
+// algorithms don't work during bootstrapping.\r
+option optimize_for = SPEED;\r
+\r
+// The protocol compiler can output a FileDescriptorSet containing the .proto\r
+// files it parses.\r
+message FileDescriptorSet {\r
+  repeated FileDescriptorProto file = 1;\r
+}\r
+\r
+// Describes a complete .proto file.\r
+message FileDescriptorProto {\r
+  optional string name = 1;       // file name, relative to root of source tree\r
+  optional string package = 2;    // e.g. "foo", "foo.bar", etc.\r
+\r
+  // Names of files imported by this file.\r
+  repeated string dependency = 3;\r
+  // Indexes of the public imported files in the dependency list above.\r
+  repeated int32 public_dependency = 10;\r
+  // Indexes of the weak imported files in the dependency list.\r
+  // For Google-internal migration only. Do not use.\r
+  repeated int32 weak_dependency = 11;\r
+\r
+  // All top-level definitions in this file.\r
+  repeated DescriptorProto message_type = 4;\r
+  repeated EnumDescriptorProto enum_type = 5;\r
+  repeated ServiceDescriptorProto service = 6;\r
+  repeated FieldDescriptorProto extension = 7;\r
+\r
+  optional FileOptions options = 8;\r
+\r
+  // This field contains optional information about the original source code.\r
+  // You may safely remove this entire field whithout harming runtime\r
+  // functionality of the descriptors -- the information is needed only by\r
+  // development tools.\r
+  optional SourceCodeInfo source_code_info = 9;\r
+}\r
+\r
+// Describes a message type.\r
+message DescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated FieldDescriptorProto field = 2;\r
+  repeated FieldDescriptorProto extension = 6;\r
+\r
+  repeated DescriptorProto nested_type = 3;\r
+  repeated EnumDescriptorProto enum_type = 4;\r
+\r
+  message ExtensionRange {\r
+    optional int32 start = 1;\r
+    optional int32 end = 2;\r
+  }\r
+  repeated ExtensionRange extension_range = 5;\r
+\r
+  optional MessageOptions options = 7;\r
+}\r
+\r
+// Describes a field within a message.\r
+message FieldDescriptorProto {\r
+  enum Type {\r
+    // 0 is reserved for errors.\r
+    // Order is weird for historical reasons.\r
+    TYPE_DOUBLE         = 1;\r
+    TYPE_FLOAT          = 2;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\r
+    // negative values are likely.\r
+    TYPE_INT64          = 3;\r
+    TYPE_UINT64         = 4;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\r
+    // negative values are likely.\r
+    TYPE_INT32          = 5;\r
+    TYPE_FIXED64        = 6;\r
+    TYPE_FIXED32        = 7;\r
+    TYPE_BOOL           = 8;\r
+    TYPE_STRING         = 9;\r
+    TYPE_GROUP          = 10;  // Tag-delimited aggregate.\r
+    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.\r
+\r
+    // New in version 2.\r
+    TYPE_BYTES          = 12;\r
+    TYPE_UINT32         = 13;\r
+    TYPE_ENUM           = 14;\r
+    TYPE_SFIXED32       = 15;\r
+    TYPE_SFIXED64       = 16;\r
+    TYPE_SINT32         = 17;  // Uses ZigZag encoding.\r
+    TYPE_SINT64         = 18;  // Uses ZigZag encoding.\r
+  };\r
+\r
+  enum Label {\r
+    // 0 is reserved for errors\r
+    LABEL_OPTIONAL      = 1;\r
+    LABEL_REQUIRED      = 2;\r
+    LABEL_REPEATED      = 3;\r
+    // TODO(sanjay): Should we add LABEL_MAP?\r
+  };\r
+\r
+  optional string name = 1;\r
+  optional int32 number = 3;\r
+  optional Label label = 4;\r
+\r
+  // If type_name is set, this need not be set.  If both this and type_name\r
+  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.\r
+  optional Type type = 5;\r
+\r
+  // For message and enum types, this is the name of the type.  If the name\r
+  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\r
+  // rules are used to find the type (i.e. first the nested types within this\r
+  // message are searched, then within the parent, on up to the root\r
+  // namespace).\r
+  optional string type_name = 6;\r
+\r
+  // For extensions, this is the name of the type being extended.  It is\r
+  // resolved in the same manner as type_name.\r
+  optional string extendee = 2;\r
+\r
+  // For numeric types, contains the original text representation of the value.\r
+  // For booleans, "true" or "false".\r
+  // For strings, contains the default text contents (not escaped in any way).\r
+  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\r
+  // TODO(kenton):  Base-64 encode?\r
+  optional string default_value = 7;\r
+\r
+  optional FieldOptions options = 8;\r
+}\r
+\r
+// Describes an enum type.\r
+message EnumDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated EnumValueDescriptorProto value = 2;\r
+\r
+  optional EnumOptions options = 3;\r
+}\r
+\r
+// Describes a value within an enum.\r
+message EnumValueDescriptorProto {\r
+  optional string name = 1;\r
+  optional int32 number = 2;\r
+\r
+  optional EnumValueOptions options = 3;\r
+}\r
+\r
+// Describes a service.\r
+message ServiceDescriptorProto {\r
+  optional string name = 1;\r
+  repeated MethodDescriptorProto method = 2;\r
+\r
+  optional ServiceOptions options = 3;\r
+}\r
+\r
+// Describes a method of a service.\r
+message MethodDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  // Input and output type names.  These are resolved in the same way as\r
+  // FieldDescriptorProto.type_name, but must refer to a message type.\r
+  optional string input_type = 2;\r
+  optional string output_type = 3;\r
+\r
+  optional MethodOptions options = 4;\r
+}\r
+\r
+\r
+// ===================================================================\r
+// Options\r
+\r
+// Each of the definitions above may have "options" attached.  These are\r
+// just annotations which may cause code to be generated slightly differently\r
+// or may contain hints for code that manipulates protocol messages.\r
+//\r
+// Clients may define custom options as extensions of the *Options messages.\r
+// These extensions may not yet be known at parsing time, so the parser cannot\r
+// store the values in them.  Instead it stores them in a field in the *Options\r
+// message called uninterpreted_option. This field must have the same name\r
+// across all *Options messages. We then use this field to populate the\r
+// extensions when we build a descriptor, at which point all protos have been\r
+// parsed and so all extensions are known.\r
+//\r
+// Extension numbers for custom options may be chosen as follows:\r
+// * For options which will only be used within a single application or\r
+//   organization, or for experimental options, use field numbers 50000\r
+//   through 99999.  It is up to you to ensure that you do not use the\r
+//   same number for multiple options.\r
+// * For options which will be published and used publicly by multiple\r
+//   independent entities, e-mail protobuf-global-extension-registry@google.com\r
+//   to reserve extension numbers. Simply provide your project name (e.g.\r
+//   Object-C plugin) and your porject website (if available) -- there's no need\r
+//   to explain how you intend to use them. Usually you only need one extension\r
+//   number. You can declare multiple options with only one extension number by\r
+//   putting them in a sub-message. See the Custom Options section of the docs\r
+//   for examples:\r
+//   http://code.google.com/apis/protocolbuffers/docs/proto.html#options\r
+//   If this turns out to be popular, a web service will be set up\r
+//   to automatically assign option numbers.\r
+\r
+\r
+message FileOptions {\r
+\r
+  // Sets the Java package where classes generated from this .proto will be\r
+  // placed.  By default, the proto package is used, but this is often\r
+  // inappropriate because proto packages do not normally start with backwards\r
+  // domain names.\r
+  optional string java_package = 1;\r
+\r
+\r
+  // If set, all the classes from the .proto file are wrapped in a single\r
+  // outer class with the given name.  This applies to both Proto1\r
+  // (equivalent to the old "--one_java_file" option) and Proto2 (where\r
+  // a .proto always translates to a single class, but you may want to\r
+  // explicitly choose the class name).\r
+  optional string java_outer_classname = 8;\r
+\r
+  // If set true, then the Java code generator will generate a separate .java\r
+  // file for each top-level message, enum, and service defined in the .proto\r
+  // file.  Thus, these types will *not* be nested inside the outer class\r
+  // named by java_outer_classname.  However, the outer class will still be\r
+  // generated to contain the file's getDescriptor() method as well as any\r
+  // top-level extensions defined in the file.\r
+  optional bool java_multiple_files = 10 [default=false];\r
+\r
+  // If set true, then the Java code generator will generate equals() and\r
+  // hashCode() methods for all messages defined in the .proto file. This is\r
+  // purely a speed optimization, as the AbstractMessage base class includes\r
+  // reflection-based implementations of these methods.\r
+  optional bool java_generate_equals_and_hash = 20 [default=false];\r
+\r
+  // Generated classes can be optimized for speed or code size.\r
+  enum OptimizeMode {\r
+    SPEED = 1;        // Generate complete code for parsing, serialization,\r
+                      // etc.\r
+    CODE_SIZE = 2;    // Use ReflectionOps to implement these methods.\r
+    LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\r
+  }\r
+  optional OptimizeMode optimize_for = 9 [default=SPEED];\r
+\r
+  // Sets the Go package where structs generated from this .proto will be\r
+  // placed.  There is no default.\r
+  optional string go_package = 11;\r
+\r
+\r
+\r
+  // Should generic services be generated in each language?  "Generic" services\r
+  // are not specific to any particular RPC system.  They are generated by the\r
+  // main code generators in each language (without additional plugins).\r
+  // Generic services were the only kind of service generation supported by\r
+  // early versions of proto2.\r
+  //\r
+  // Generic services are now considered deprecated in favor of using plugins\r
+  // that generate code specific to your particular RPC system.  Therefore,\r
+  // these default to false.  Old code which depends on generic services should\r
+  // explicitly set them to true.\r
+  optional bool cc_generic_services = 16 [default=false];\r
+  optional bool java_generic_services = 17 [default=false];\r
+  optional bool py_generic_services = 18 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MessageOptions {\r
+  // Set true to use the old proto1 MessageSet wire format for extensions.\r
+  // This is provided for backwards-compatibility with the MessageSet wire\r
+  // format.  You should not use this for any other reason:  It's less\r
+  // efficient, has fewer features, and is more complicated.\r
+  //\r
+  // The message must be defined exactly as follows:\r
+  //   message Foo {\r
+  //     option message_set_wire_format = true;\r
+  //     extensions 4 to max;\r
+  //   }\r
+  // Note that the message cannot have any defined fields; MessageSets only\r
+  // have extensions.\r
+  //\r
+  // All extensions of your type must be singular messages; e.g. they cannot\r
+  // be int32s, enums, or repeated messages.\r
+  //\r
+  // Because this is an option, the above two restrictions are not enforced by\r
+  // the protocol compiler.\r
+  optional bool message_set_wire_format = 1 [default=false];\r
+\r
+  // Disables the generation of the standard "descriptor()" accessor, which can\r
+  // conflict with a field of the same name.  This is meant to make migration\r
+  // from proto1 easier; new code should avoid fields named "descriptor".\r
+  optional bool no_standard_descriptor_accessor = 2 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message FieldOptions {\r
+  // The ctype option instructs the C++ code generator to use a different\r
+  // representation of the field than it normally would.  See the specific\r
+  // options below.  This option is not yet implemented in the open source\r
+  // release -- sorry, we'll try to include it in a future version!\r
+  optional CType ctype = 1 [default = STRING];\r
+  enum CType {\r
+    // Default mode.\r
+    STRING = 0;\r
+\r
+    CORD = 1;\r
+\r
+    STRING_PIECE = 2;\r
+  }\r
+  // The packed option can be enabled for repeated primitive fields to enable\r
+  // a more efficient representation on the wire. Rather than repeatedly\r
+  // writing the tag and type for each element, the entire array is encoded as\r
+  // a single length-delimited blob.\r
+  optional bool packed = 2;\r
+\r
+\r
+\r
+  // Should this field be parsed lazily?  Lazy applies only to message-type\r
+  // fields.  It means that when the outer message is initially parsed, the\r
+  // inner message's contents will not be parsed but instead stored in encoded\r
+  // form.  The inner message will actually be parsed when it is first accessed.\r
+  //\r
+  // This is only a hint.  Implementations are free to choose whether to use\r
+  // eager or lazy parsing regardless of the value of this option.  However,\r
+  // setting this option true suggests that the protocol author believes that\r
+  // using lazy parsing on this field is worth the additional bookkeeping\r
+  // overhead typically needed to implement it.\r
+  //\r
+  // This option does not affect the public interface of any generated code;\r
+  // all method signatures remain the same.  Furthermore, thread-safety of the\r
+  // interface is not affected by this option; const methods remain safe to\r
+  // call from multiple threads concurrently, while non-const methods continue\r
+  // to require exclusive access.\r
+  //\r
+  //\r
+  // Note that implementations may choose not to check required fields within\r
+  // a lazy sub-message.  That is, calling IsInitialized() on the outher message\r
+  // may return true even if the inner message has missing required fields.\r
+  // This is necessary because otherwise the inner message would have to be\r
+  // parsed in order to perform the check, defeating the purpose of lazy\r
+  // parsing.  An implementation which chooses not to check required fields\r
+  // must be consistent about it.  That is, for any particular sub-message, the\r
+  // implementation must either *always* check its required fields, or *never*\r
+  // check its required fields, regardless of whether or not the message has\r
+  // been parsed.\r
+  optional bool lazy = 5 [default=false];\r
+\r
+  // Is this field deprecated?\r
+  // Depending on the target platform, this can emit Deprecated annotations\r
+  // for accessors, or it will be completely ignored; in the very least, this\r
+  // is a formalization for deprecating fields.\r
+  optional bool deprecated = 3 [default=false];\r
+\r
+  // EXPERIMENTAL.  DO NOT USE.\r
+  // For "map" fields, the name of the field in the enclosed type that\r
+  // is the key for this map.  For example, suppose we have:\r
+  //   message Item {\r
+  //     required string name = 1;\r
+  //     required string value = 2;\r
+  //   }\r
+  //   message Config {\r
+  //     repeated Item items = 1 [experimental_map_key="name"];\r
+  //   }\r
+  // In this situation, the map key for Item will be set to "name".\r
+  // TODO: Fully-implement this, then remove the "experimental_" prefix.\r
+  optional string experimental_map_key = 9;\r
+\r
+  // For Google-internal migration only. Do not use.\r
+  optional bool weak = 10 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumOptions {\r
+\r
+  // Set this option to false to disallow mapping different tag names to a same\r
+  // value.\r
+  optional bool allow_alias = 2 [default=true];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumValueOptions {\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message ServiceOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MethodOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+\r
+// A message representing a option the parser does not recognize. This only\r
+// appears in options protos created by the compiler::Parser class.\r
+// DescriptorPool resolves these when building Descriptor objects. Therefore,\r
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),\r
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\r
+// in them.\r
+message UninterpretedOption {\r
+  // The name of the uninterpreted option.  Each string represents a segment in\r
+  // a dot-separated name.  is_extension is true iff a segment represents an\r
+  // extension (denoted with parentheses in options specs in .proto files).\r
+  // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents\r
+  // "foo.(bar.baz).qux".\r
+  message NamePart {\r
+    required string name_part = 1;\r
+    required bool is_extension = 2;\r
+  }\r
+  repeated NamePart name = 2;\r
+\r
+  // The value of the uninterpreted option, in whatever type the tokenizer\r
+  // identified it as during parsing. Exactly one of these should be set.\r
+  optional string identifier_value = 3;\r
+  optional uint64 positive_int_value = 4;\r
+  optional int64 negative_int_value = 5;\r
+  optional double double_value = 6;\r
+  optional bytes string_value = 7;\r
+  optional string aggregate_value = 8;\r
+}\r
+\r
+// ===================================================================\r
+// Optional source code info\r
+\r
+// Encapsulates information about the original source file from which a\r
+// FileDescriptorProto was generated.\r
+message SourceCodeInfo {\r
+  // A Location identifies a piece of source code in a .proto file which\r
+  // corresponds to a particular definition.  This information is intended\r
+  // to be useful to IDEs, code indexers, documentation generators, and similar\r
+  // tools.\r
+  //\r
+  // For example, say we have a file like:\r
+  //   message Foo {\r
+  //     optional string foo = 1;\r
+  //   }\r
+  // Let's look at just the field definition:\r
+  //   optional string foo = 1;\r
+  //   ^       ^^     ^^  ^  ^^^\r
+  //   a       bc     de  f  ghi\r
+  // We have the following locations:\r
+  //   span   path               represents\r
+  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\r
+  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\r
+  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\r
+  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\r
+  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\r
+  //\r
+  // Notes:\r
+  // - A location may refer to a repeated field itself (i.e. not to any\r
+  //   particular index within it).  This is used whenever a set of elements are\r
+  //   logically enclosed in a single code segment.  For example, an entire\r
+  //   extend block (possibly containing multiple extension definitions) will\r
+  //   have an outer location whose path refers to the "extensions" repeated\r
+  //   field without an index.\r
+  // - Multiple locations may have the same path.  This happens when a single\r
+  //   logical declaration is spread out across multiple places.  The most\r
+  //   obvious example is the "extend" block again -- there may be multiple\r
+  //   extend blocks in the same scope, each of which will have the same path.\r
+  // - A location's span is not always a subset of its parent's span.  For\r
+  //   example, the "extendee" of an extension declaration appears at the\r
+  //   beginning of the "extend" block and is shared by all extensions within\r
+  //   the block.\r
+  // - Just because a location's span is a subset of some other location's span\r
+  //   does not mean that it is a descendent.  For example, a "group" defines\r
+  //   both a type and a field in a single declaration.  Thus, the locations\r
+  //   corresponding to the type and field and their components will overlap.\r
+  // - Code which tries to interpret locations should probably be designed to\r
+  //   ignore those that it doesn't understand, as more types of locations could\r
+  //   be recorded in the future.\r
+  repeated Location location = 1;\r
+  message Location {\r
+    // Identifies which part of the FileDescriptorProto was defined at this\r
+    // location.\r
+    //\r
+    // Each element is a field number or an index.  They form a path from\r
+    // the root FileDescriptorProto to the place where the definition.  For\r
+    // example, this path:\r
+    //   [ 4, 3, 2, 7, 1 ]\r
+    // refers to:\r
+    //   file.message_type(3)  // 4, 3\r
+    //       .field(7)         // 2, 7\r
+    //       .name()           // 1\r
+    // This is because FileDescriptorProto.message_type has field number 4:\r
+    //   repeated DescriptorProto message_type = 4;\r
+    // and DescriptorProto.field has field number 2:\r
+    //   repeated FieldDescriptorProto field = 2;\r
+    // and FieldDescriptorProto.name has field number 1:\r
+    //   optional string name = 1;\r
+    //\r
+    // Thus, the above path gives the location of a field name.  If we removed\r
+    // the last element:\r
+    //   [ 4, 3, 2, 7 ]\r
+    // this path refers to the whole field declaration (from the beginning\r
+    // of the label to the terminating semicolon).\r
+    repeated int32 path = 1 [packed=true];\r
+\r
+    // Always has exactly three or four elements: start line, start column,\r
+    // end line (optional, otherwise assumed same as start line), end column.\r
+    // These are packed into a single field for efficiency.  Note that line\r
+    // and column numbers are zero-based -- typically you will want to add\r
+    // 1 to each before displaying to a user.\r
+    repeated int32 span = 2 [packed=true];\r
+\r
+    // If this SourceCodeInfo represents a complete declaration, these are any\r
+    // comments appearing before and after the declaration which appear to be\r
+    // attached to the declaration.\r
+    //\r
+    // A series of line comments appearing on consecutive lines, with no other\r
+    // tokens appearing on those lines, will be treated as a single comment.\r
+    //\r
+    // Only the comment content is provided; comment markers (e.g. //) are\r
+    // stripped out.  For block comments, leading whitespace and an asterisk\r
+    // will be stripped from the beginning of each line other than the first.\r
+    // Newlines are included in the output.\r
+    //\r
+    // Examples:\r
+    //\r
+    //   optional int32 foo = 1;  // Comment attached to foo.\r
+    //   // Comment attached to bar.\r
+    //   optional int32 bar = 2;\r
+    //\r
+    //   optional string baz = 3;\r
+    //   // Comment attached to baz.\r
+    //   // Another line attached to baz.\r
+    //\r
+    //   // Comment attached to qux.\r
+    //   //\r
+    //   // Another line attached to qux.\r
+    //   optional double qux = 4;\r
+    //\r
+    //   optional string corge = 5;\r
+    //   /* Block comment attached\r
+    //    * to corge.  Leading asterisks\r
+    //    * will be removed. */\r
+    //   /* Block comment attached to\r
+    //    * grault. */\r
+    //   optional int32 grault = 6;\r
+    optional string leading_comments = 3;\r
+    optional string trailing_comments = 4;\r
+  }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/protobuf.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/protobuf.js
new file mode 100644 (file)
index 0000000..6efc681
--- /dev/null
@@ -0,0 +1,421 @@
+/**\r
+ * The ProtoBuf namespace.\r
+ * @exports ProtoBuf\r
+ * @namespace\r
+ * @expose\r
+ */\r
+var ProtoBuf = {};\r
+\r
+/**\r
+ * @type {!function(new: ByteBuffer, ...[*])}\r
+ * @expose\r
+ */\r
+ProtoBuf.ByteBuffer = ByteBuffer;\r
+\r
+/**\r
+ * @type {?function(new: Long, ...[*])}\r
+ * @expose\r
+ */\r
+ProtoBuf.Long = ByteBuffer.Long || null;\r
+\r
+/**\r
+ * ProtoBuf.js version.\r
+ * @type {string}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.VERSION = "/*?= VERSION */";\r
+\r
+/**\r
+ * Wire types.\r
+ * @type {Object.<string,number>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES = {};\r
+\r
+/**\r
+ * Varint wire type.\r
+ * @type {number}\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.VARINT = 0;\r
+\r
+/**\r
+ * Fixed 64 bits wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS64 = 1;\r
+\r
+/**\r
+ * Length delimited wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.LDELIM = 2;\r
+\r
+/**\r
+ * Start group wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r
+\r
+/**\r
+ * End group wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r
+\r
+/**\r
+ * Fixed 32 bits wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS32 = 5;\r
+\r
+/**\r
+ * Packable wire types.\r
+ * @type {!Array.<number>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.PACKABLE_WIRE_TYPES = [\r
+    ProtoBuf.WIRE_TYPES.VARINT,\r
+    ProtoBuf.WIRE_TYPES.BITS64,\r
+    ProtoBuf.WIRE_TYPES.BITS32\r
+];\r
+\r
+/**\r
+ * Types.\r
+ * @dict\r
+ * @type {!Object.<string,{name: string, wireType: number, defaultValue: *}>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.TYPES = {\r
+    // According to the protobuf spec.\r
+    "int32": {\r
+        name: "int32",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "uint32": {\r
+        name: "uint32",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "sint32": {\r
+        name: "sint32",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "int64": {\r
+        name: "int64",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+    },\r
+    "uint64": {\r
+        name: "uint64",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+    },\r
+    "sint64": {\r
+        name: "sint64",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+    },\r
+    "bool": {\r
+        name: "bool",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: false\r
+    },\r
+    "double": {\r
+        name: "double",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+        defaultValue: 0\r
+    },\r
+    "string": {\r
+        name: "string",\r
+        wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+        defaultValue: ""\r
+    },\r
+    "bytes": {\r
+        name: "bytes",\r
+        wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+        defaultValue: null // overridden in the code, must be a unique instance\r
+    },\r
+    "fixed32": {\r
+        name: "fixed32",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+        defaultValue: 0\r
+    },\r
+    "sfixed32": {\r
+        name: "sfixed32",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+        defaultValue: 0\r
+    },\r
+    "fixed64": {\r
+        name: "fixed64",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+        defaultValue:  ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+    },\r
+    "sfixed64": {\r
+        name: "sfixed64",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+    },\r
+    "float": {\r
+        name: "float",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+        defaultValue: 0\r
+    },\r
+    "enum": {\r
+        name: "enum",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "message": {\r
+        name: "message",\r
+        wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+        defaultValue: null\r
+    },\r
+    "group": {\r
+        name: "group",\r
+        wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r
+        defaultValue: null\r
+    }\r
+};\r
+\r
+/**\r
+ * Valid map key types.\r
+ * @type {!Array.<!Object.<string,{name: string, wireType: number, defaultValue: *}>>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.MAP_KEY_TYPES = [\r
+    ProtoBuf.TYPES["int32"],\r
+    ProtoBuf.TYPES["sint32"],\r
+    ProtoBuf.TYPES["sfixed32"],\r
+    ProtoBuf.TYPES["uint32"],\r
+    ProtoBuf.TYPES["fixed32"],\r
+    ProtoBuf.TYPES["int64"],\r
+    ProtoBuf.TYPES["sint64"],\r
+    ProtoBuf.TYPES["sfixed64"],\r
+    ProtoBuf.TYPES["uint64"],\r
+    ProtoBuf.TYPES["fixed64"],\r
+    ProtoBuf.TYPES["bool"],\r
+    ProtoBuf.TYPES["string"],\r
+    ProtoBuf.TYPES["bytes"]\r
+];\r
+\r
+/**\r
+ * Minimum field id.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.ID_MIN = 1;\r
+\r
+/**\r
+ * Maximum field id.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.ID_MAX = 0x1FFFFFFF;\r
+\r
+/**\r
+ * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r
+ *  Must be set prior to parsing.\r
+ * @type {boolean}\r
+ * @expose\r
+ */\r
+ProtoBuf.convertFieldsToCamelCase = false;\r
+\r
+/**\r
+ * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r
+ *  setting this to `false` prior to building messages.\r
+ * @type {boolean}\r
+ * @expose\r
+ */\r
+ProtoBuf.populateAccessors = true;\r
+\r
+/**\r
+ * By default, messages are populated with default values if a field is not present on the wire. To disable\r
+ *  this behavior, set this setting to `false`.\r
+ * @type {boolean}\r
+ * @expose\r
+ */\r
+ProtoBuf.populateDefaults = true;\r
+\r
+//? include("ProtoBuf/Util.js");\r
+\r
+//? include("ProtoBuf/Lang.js");\r
+\r
+//? if (DOTPROTO) include("ProtoBuf/DotProto.js");\r
+\r
+//? include("ProtoBuf/Reflect.js");\r
+\r
+//? include("ProtoBuf/Builder.js");\r
+\r
+//? include("ProtoBuf/Map.js");\r
+\r
+//? if (DOTPROTO) {\r
+\r
+/**\r
+ * Loads a .proto string and returns the Builder.\r
+ * @param {string} proto .proto file contents\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+ * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+ * @return {ProtoBuf.Builder} Builder to create new messages\r
+ * @throws {Error} If the definition cannot be parsed or built\r
+ * @expose\r
+ */\r
+ProtoBuf.loadProto = function(proto, builder, filename) {\r
+    if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))\r
+        filename = builder,\r
+        builder = undefined;\r
+    return ProtoBuf.loadJson(ProtoBuf.DotProto.Parser.parse(proto), builder, filename);\r
+};\r
+\r
+/**\r
+ * Loads a .proto string and returns the Builder. This is an alias of {@link ProtoBuf.loadProto}.\r
+ * @function\r
+ * @param {string} proto .proto file contents\r
+ * @param {(ProtoBuf.Builder|string)=} builder Builder to append to. Will create a new one if omitted.\r
+ * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+ * @return {ProtoBuf.Builder} Builder to create new messages\r
+ * @throws {Error} If the definition cannot be parsed or built\r
+ * @expose\r
+ */\r
+ProtoBuf.protoFromString = ProtoBuf.loadProto; // Legacy\r
+\r
+/**\r
+ * Loads a .proto file and returns the Builder.\r
+ * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+ *  an overridden 'root' path for all imported files.\r
+ * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+ *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+ *  file will be read synchronously and this function will return the Builder.\r
+ * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+ * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+ *   request has failed), else undefined\r
+ * @expose\r
+ */\r
+ProtoBuf.loadProtoFile = function(filename, callback, builder) {\r
+    if (callback && typeof callback === 'object')\r
+        builder = callback,\r
+        callback = null;\r
+    else if (!callback || typeof callback !== 'function')\r
+        callback = null;\r
+    if (callback)\r
+        return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+            if (contents === null) {\r
+                callback(Error("Failed to fetch file"));\r
+                return;\r
+            }\r
+            try {\r
+                callback(null, ProtoBuf.loadProto(contents, builder, filename));\r
+            } catch (e) {\r
+                callback(e);\r
+            }\r
+        });\r
+    var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+    return contents === null ? null : ProtoBuf.loadProto(contents, builder, filename);\r
+};\r
+\r
+/**\r
+ * Loads a .proto file and returns the Builder. This is an alias of {@link ProtoBuf.loadProtoFile}.\r
+ * @function\r
+ * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+ *  an overridden 'root' path for all imported files.\r
+ * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+ *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+ *  file will be read synchronously and this function will return the Builder.\r
+ * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+ * @return {!ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+ *   request has failed), else undefined\r
+ * @expose\r
+ */\r
+ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile; // Legacy\r
+\r
+//? } // DOTPROTO\r
+\r
+/**\r
+ * Constructs a new empty Builder.\r
+ * @param {Object.<string,*>=} options Builder options, defaults to global options set on ProtoBuf\r
+ * @return {!ProtoBuf.Builder} Builder\r
+ * @expose\r
+ */\r
+ProtoBuf.newBuilder = function(options) {\r
+    options = options || {};\r
+    if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r
+        options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r
+    if (typeof options['populateAccessors'] === 'undefined')\r
+        options['populateAccessors'] = ProtoBuf.populateAccessors;\r
+    return new ProtoBuf.Builder(options);\r
+};\r
+\r
+/**\r
+ * Loads a .json definition and returns the Builder.\r
+ * @param {!*|string} json JSON definition\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+ * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+ * @return {ProtoBuf.Builder} Builder to create new messages\r
+ * @throws {Error} If the definition cannot be parsed or built\r
+ * @expose\r
+ */\r
+ProtoBuf.loadJson = function(json, builder, filename) {\r
+    if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))\r
+        filename = builder,\r
+        builder = null;\r
+    if (!builder || typeof builder !== 'object')\r
+        builder = ProtoBuf.newBuilder();\r
+    if (typeof json === 'string')\r
+        json = JSON.parse(json);\r
+    builder["import"](json, filename);\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Loads a .json file and returns the Builder.\r
+ * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r
+ *  an overridden 'root' path for all imported files.\r
+ * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+ *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+ *  file will be read synchronously and this function will return the Builder.\r
+ * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+ * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+ *   request has failed), else undefined\r
+ * @expose\r
+ */\r
+ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r
+    if (callback && typeof callback === 'object')\r
+        builder = callback,\r
+        callback = null;\r
+    else if (!callback || typeof callback !== 'function')\r
+        callback = null;\r
+    if (callback)\r
+        return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+            if (contents === null) {\r
+                callback(Error("Failed to fetch file"));\r
+                return;\r
+            }\r
+            try {\r
+                callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r
+            } catch (e) {\r
+                callback(e);\r
+            }\r
+        });\r
+    var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+    return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r
+};\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/src/wrap.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/src/wrap.js
new file mode 100644 (file)
index 0000000..3fabafd
--- /dev/null
@@ -0,0 +1,37 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @license protobuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>\r
+ * Released under the Apache License, Version 2.0\r
+ * see: https://github.com/dcodeIO/protobuf.js for details\r
+ */\r
+(function(global, factory) {\r
+\r
+    /* AMD */ if (typeof define === 'function' && define["amd"])\r
+        define(["bytebuffer"], factory);\r
+    /* CommonJS */ else if (typeof require === "function" && typeof module === "object" && module && module["exports"])\r
+        module["exports"] = factory(require("bytebuffer"), true);\r
+    /* Global */ else\r
+        (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);\r
+\r
+})(this, function(ByteBuffer, isCommonJS) {\r
+    "use strict";\r
+\r
+    //? include("protobuf.js");\r
+\r
+    return ProtoBuf;\r
+});\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/PingExample.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/PingExample.proto
new file mode 100644 (file)
index 0000000..013c362
--- /dev/null
@@ -0,0 +1,12 @@
+message Message {\r
+    optional Ping ping = 1;\r
+    optional Pong pong = 2;\r
+    \r
+    message Ping {\r
+        required uint32 time = 1;\r
+    }\r
+    \r
+    message Pong {\r
+        required uint32 time = 1;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/T139.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/T139.proto
new file mode 100644 (file)
index 0000000..d0c0599
--- /dev/null
@@ -0,0 +1,4 @@
+message T139 {\r
+    required int32 a = 1;\r
+    required uint32 b = 2;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/T263.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/T263.proto
new file mode 100644 (file)
index 0000000..db0c4eb
--- /dev/null
@@ -0,0 +1,13 @@
+package services;\r
+\r
+message resume {\r
+    message Resume {\r
+        repeated string experience = 1;\r
+    }\r
+}\r
+\r
+message profile {\r
+    message Profile {\r
+        optional services.resume.Resume resume = 1;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/annotations.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/annotations.proto
new file mode 100644 (file)
index 0000000..d7d2896
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2015, Google Inc.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//     http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+\r
+syntax = "proto3";\r
+\r
+package google.api;\r
+\r
+// import "google/api/http.proto";\r
+// import "google/protobuf/descriptor.proto";\r
+\r
+option java_multiple_files = true;\r
+option java_outer_classname = "AnnotationsProto";\r
+option java_package = "com.google.api";\r
+\r
+extend google.protobuf.MethodOptions {\r
+  // See `HttpRule`.\r
+  HttpRule http = 72295728;\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/bench.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/bench.js
new file mode 100644 (file)
index 0000000..7f3c0cd
--- /dev/null
@@ -0,0 +1,48 @@
+var ProtoBuf = require("../index.js");\r
+\r
+var sample = {\r
+    id: 1,\r
+    name: "John123",\r
+    password: "helloworld"\r
+};\r
+\r
+console.log("Sample: `"+JSON.stringify(sample, null, 4));\r
+console.log("\n");\r
+\r
+var proto = " message Sample {" +\r
+    "required uint32 id = 1;" +\r
+    "required string name = 2;" +\r
+    "required string password = 3;" +\r
+    "}";\r
+\r
+var builder = ProtoBuf.loadProto(proto, "bench.proto"),\r
+    Sample = builder.build("Sample");\r
+\r
+// Compare size\r
+console.log("Encoding size");\r
+console.log("-------------");\r
+var jsonData = new Buffer(JSON.stringify(sample), "utf8"),\r
+    protoData = new Sample(sample).toBuffer();\r
+console.log("* Encoded sample size as JSON: "+jsonData.length+" bytes");\r
+console.log("* Encoded sample size as protocol buffer: "+protoData.length+" bytes");\r
+console.log("");\r
+\r
+// Compare encoding speed\r
+console.log("Encoding speed");\r
+console.log("--------------");\r
+(function() {\r
+    // Assuming that a receive buffer is used\r
+    var buf = ProtoBuf.ByteBuffer.allocate(64);\r
+    var protoSample = new Sample(sample),\r
+        n = 100000, k = (n/1000)+'k';\r
+    console.time("* ProtoBuf encode "+k);\r
+    for (var i=0; i<n; ++i)\r
+        protoSample.encode(buf, true),\r
+        buf.flip();\r
+    console.timeEnd("* ProtoBuf encode "+k);\r
+    console.time("* ProtoBuf decode "+k);\r
+    for (var i=0; i<n; ++i)\r
+        Sample.decode(buf),\r
+        buf.flip();\r
+    console.timeEnd("* ProtoBuf decode "+k);\r
+})();\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/bench.txt b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/bench.txt
new file mode 100644 (file)
index 0000000..aa847b2
--- /dev/null
@@ -0,0 +1,373 @@
+Statistical profiling result from v8.log, (1544 ticks, 944 unaccounted, 0 excluded).\r
+\r
+ [Unknown]:\r
+   ticks  total  nonlib   name\r
+    944   61.1%\r
+\r
+ [Shared libraries]:\r
+   ticks  total  nonlib   name\r
+\r
+ [JavaScript]:\r
+   ticks  total  nonlib   name\r
+    248   16.1%   16.1%  LazyCompile: *Buffer.write buffer.js:315\r
+    190   12.3%   12.3%  LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+    189   12.2%   12.2%  LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    188   12.2%   12.2%  LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    142    9.2%    9.2%  LazyCompile: *Buffer.toString buffer.js:392\r
+     84    5.4%    5.4%  LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     62    4.0%    4.0%  LazyCompile: *toLowerCase native string.js:739\r
+     47    3.0%    3.0%  LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     38    2.5%    2.5%  LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+     36    2.3%    2.3%  LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     27    1.7%    1.7%  LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     25    1.6%    1.6%  LazyCompile: *module.exports.ByteBuffer.readVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1272\r
+     25    1.6%    1.6%  Builtin: A builtin from the snapshot\r
+     24    1.6%    1.6%  Stub: CompareICStub\r
+     15    1.0%    1.0%  Stub: CEntryStub\r
+     15    1.0%    1.0%  LazyCompile: <anonymous> native string.js:36\r
+     15    1.0%    1.0%  LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+     11    0.7%    0.7%  Stub: InstanceofStub\r
+     11    0.7%    0.7%  LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     11    0.7%    0.7%  KeyedLoadIC: A keyed load IC from the snapshot\r
+     10    0.6%    0.6%  LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+      9    0.6%    0.6%  LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+      9    0.6%    0.6%  LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+      8    0.5%    0.5%  LazyCompile: ~NativeModule.compile node.js:892\r
+      7    0.5%    0.5%  Stub: KeyedLoadElementStub\r
+      6    0.4%    0.4%  Stub: CompareICStub {2}\r
+      6    0.4%    0.4%  LazyCompile: *module.exports.ByteBuffer.LE x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2299\r
+      6    0.4%    0.4%  LazyCompile: *isFinite native v8natives.js:103\r
+      5    0.3%    0.3%  Stub: ToBooleanStub_UndefinedSpecObject\r
+      5    0.3%    0.3%  LazyCompile: ~Module._compile module.js:374\r
+      5    0.3%    0.3%  Builtin: A builtin from the snapshot {3}\r
+      4    0.3%    0.3%  Stub: ToBooleanStub\r
+      4    0.3%    0.3%  Stub: KeyedLoadElementStub {1}\r
+      4    0.3%    0.3%  LazyCompile: *module.exports.ByteBuffer.remaining x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2397\r
+      3    0.2%    0.2%  KeyedStoreIC: A keyed store IC from the snapshot\r
+      2    0.1%    0.1%  Stub: BinaryOpStub_SHR_Alloc_SMI\r
+      2    0.1%    0.1%  Stub: BinaryOpStub_SHL_Alloc_SMI\r
+      2    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      2    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      2    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferAB.js:23\r
+      2    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\dist\ProtoBuf.js:22\r
+      2    0.1%    0.1%  Function: ~<anonymous> net.js:1\r
+      1    0.1%    0.1%  Stub: ToBooleanStub {1}\r
+      1    0.1%    0.1%  Stub: CompareICStub {1}\r
+      1    0.1%    0.1%  Stub: CallConstructStub\r
+      1    0.1%    0.1%  Stub: BinaryOpStub_MUL_Alloc_SMI\r
+      1    0.1%    0.1%  Stub: BinaryOpStub_BIT_OR_OverwriteLeft_SMI\r
+      1    0.1%    0.1%  LazyCompile: ~tryFile module.js:138\r
+      1    0.1%    0.1%  LazyCompile: ~nextTick node.js:334\r
+      1    0.1%    0.1%  LazyCompile: ~module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+      1    0.1%    0.1%  LazyCompile: ~join native array.js:410\r
+      1    0.1%    0.1%  LazyCompile: ~fs.statSync fs.js:687\r
+      1    0.1%    0.1%  LazyCompile: ~fs.openSync fs.js:429\r
+      1    0.1%    0.1%  LazyCompile: ~fs.fstatSync fs.js:678\r
+      1    0.1%    0.1%  LazyCompile: ~filter native array.js:1036\r
+      1    0.1%    0.1%  LazyCompile: ~exec native regexp.js:168\r
+      1    0.1%    0.1%  LazyCompile: ~createWriteReq net.js:658\r
+      1    0.1%    0.1%  LazyCompile: ~createWritableStdioStream node.js:550\r
+      1    0.1%    0.1%  LazyCompile: ~bind native v8natives.js:1578\r
+      1    0.1%    0.1%  LazyCompile: ~StringSplitOnRegExp native string.js:591\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Field x:\public\ProtoBuf\dist\ProtoBuf.js:2401\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.DotProto.Parser._parseId x:\public\ProtoBuf\dist\ProtoBuf.js:724\r
+      1    0.1%    0.1%  LazyCompile: ~Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+      1    0.1%    0.1%  LazyCompile: ~Buffer.write buffer.js:315\r
+      1    0.1%    0.1%  LazyCompile: ~Buffer buffer.js:156\r
+      1    0.1%    0.1%  LazyCompile: statPath module.js:88\r
+      1    0.1%    0.1%  KeyedLoadIC: args_count: 0\r
+      1    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      1    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\node_modules\long\dist\Long.js:23\r
+      1    0.1%    0.1%  Function: ~<anonymous> fs.js:1\r
+      1    0.1%    0.1%  Builtin: A builtin from the snapshot {2}\r
+      1    0.1%    0.1%  Builtin: A builtin from the snapshot {1}\r
+\r
+ [C++]:\r
+   ticks  total  nonlib   name\r
+\r
+ [GC]:\r
+   ticks  total  nonlib   name\r
+      2    0.1%\r
+\r
+ [Bottom up (heavy) profile]:\r
+  Note: percentage shows a share of a particular caller in the total\r
+  amount of its parent calls.\r
+  Callers occupying less than 2.0% are not shown.\r
+\r
+   ticks parent  name\r
+    248   16.1%  LazyCompile: *Buffer.write buffer.js:315\r
+    247   99.6%    LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    247  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+    247  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+    247  100.0%          LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+    247  100.0%            LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+\r
+    190   12.3%  LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+    190  100.0%    LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    190  100.0%      LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    182   95.8%        LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+    182  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+    182  100.0%            LazyCompile: ~Module._compile module.js:374\r
+      8    4.2%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      8  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      8  100.0%            LazyCompile: ~Module._compile module.js:374\r
+\r
+    189   12.2%  LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    189  100.0%    LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    183   96.8%      LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+    183  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+    183  100.0%          LazyCompile: ~Module._compile module.js:374\r
+    183  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+      6    3.2%      Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      6  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      6  100.0%          LazyCompile: ~Module._compile module.js:374\r
+      6  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+\r
+    188   12.2%  LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    188  100.0%    LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+    188  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+    187   99.5%        LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+    187  100.0%          LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+    178   95.2%            LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      9    4.8%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+\r
+    142    9.2%  LazyCompile: *Buffer.toString buffer.js:392\r
+    142  100.0%    LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+    141   99.3%      LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+    141  100.0%        LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    141  100.0%          LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    132   93.6%            LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      9    6.4%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+\r
+     84    5.4%  LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     82   97.6%    LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     82  100.0%      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     82  100.0%        LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     79   96.3%          LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     79  100.0%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      3    3.7%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      3  100.0%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      2    2.4%    LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      2  100.0%      LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+      2  100.0%        LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      2  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      2  100.0%            LazyCompile: ~Module._compile module.js:374\r
+\r
+     62    4.0%  LazyCompile: *toLowerCase native string.js:739\r
+     36   58.1%    LazyCompile: *Buffer.write buffer.js:315\r
+     36  100.0%      LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+     36  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     36  100.0%          LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     36  100.0%            LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     23   37.1%    LazyCompile: *Buffer.toString buffer.js:392\r
+     23  100.0%      LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+     23  100.0%        LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     23  100.0%          LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     23  100.0%            LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+      2    3.2%    LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+      2  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      2  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      2  100.0%          LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      2  100.0%            LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+\r
+     47    3.0%  LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     46   97.9%    LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     46  100.0%      LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+     44   95.7%        LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     44  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+     44  100.0%            LazyCompile: ~Module._compile module.js:374\r
+      2    4.3%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      2  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      2  100.0%            LazyCompile: ~Module._compile module.js:374\r
+\r
+     38    2.5%  LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+     26   68.4%    LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     26  100.0%      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     26  100.0%        LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     26  100.0%          LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     26  100.0%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      6   15.8%    LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      6  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      6  100.0%        LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      6  100.0%          LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+      6  100.0%            LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      6   15.8%    LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+      6  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      6  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      6  100.0%          LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      6  100.0%            LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+\r
+     36    2.3%  LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     35   97.2%    LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     32   91.4%      LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     32  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+     32  100.0%          LazyCompile: ~Module._compile module.js:374\r
+     32  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+      3    8.6%      Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      3  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      3  100.0%          LazyCompile: ~Module._compile module.js:374\r
+      3  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+\r
+\r
+ [Top down (heavy) profile]:\r
+  Note: callees occupying less than 0.1% are not shown.\r
+\r
+  inclusive      self           name\r
+  ticks   total  ticks   total\r
+   1533   99.3%      0    0.0%  Function: ~<anonymous> node.js:27\r
+   1533   99.3%      0    0.0%    LazyCompile: ~startup node.js:30\r
+   1527   98.9%      0    0.0%      LazyCompile: ~Module.runMain module.js:495\r
+   1527   98.9%      0    0.0%        LazyCompile: Module._load module.js:275\r
+   1524   98.7%      0    0.0%          LazyCompile: ~Module.load module.js:346\r
+   1523   98.6%      0    0.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+   1523   98.6%      0    0.0%              LazyCompile: ~Module._compile module.js:374\r
+   1523   98.6%      1    0.1%                Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+   1413   91.5%     11    0.7%                  LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+    701   45.4%      9    0.6%                    LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+    681   44.1%     32    2.1%                      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+    631   40.9%     22    1.4%                        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+    576   37.3%     79    5.1%                          LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+    473   30.6%    178   11.5%                            LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    286   18.5%    236   15.3%                              LazyCompile: *Buffer.write buffer.js:315\r
+     37    2.4%     35    2.3%                                LazyCompile: *toLowerCase native string.js:739\r
+      2    0.1%      2    0.1%                                  Stub: CEntryStub\r
+      5    0.3%      5    0.3%                                LazyCompile: *isFinite native v8natives.js:103\r
+      3    0.2%      3    0.2%                                Stub: CompareICStub {2}\r
+      3    0.2%      2    0.1%                                LazyCompile: <anonymous> native string.js:36\r
+      6    0.4%      6    0.4%                              LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+      2    0.1%      2    0.1%                              LazyCompile: *toLowerCase native string.js:739\r
+     13    0.8%     13    0.8%                            Stub: CompareICStub\r
+      6    0.4%      6    0.4%                            LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+      4    0.3%      4    0.3%                            Builtin: A builtin from the snapshot\r
+     26    1.7%     26    1.7%                          LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+      3    0.2%      3    0.2%                          Builtin: A builtin from the snapshot\r
+      2    0.1%      2    0.1%                          Stub: BinaryOpStub_SHL_Alloc_SMI\r
+      8    0.5%      8    0.5%                        Stub: InstanceofStub\r
+      6    0.4%      6    0.4%                        KeyedLoadIC: A keyed load IC from the snapshot\r
+      2    0.1%      2    0.1%                        Stub: CEntryStub\r
+      2    0.1%      2    0.1%                        LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      5    0.3%      5    0.3%                      Stub: ToBooleanStub_UndefinedSpecObject\r
+      3    0.2%      3    0.2%                      LazyCompile: *module.exports.ByteBuffer.LE x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2299\r
+      2    0.1%      2    0.1%                      Stub: ToBooleanStub\r
+    697   45.1%     10    0.6%                    LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    679   44.0%    183   11.9%                      LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    257   16.6%     44    2.8%                        LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+    199   12.9%     15    1.0%                          LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+    173   11.2%    132    8.5%                            LazyCompile: *Buffer.toString buffer.js:392\r
+     23    1.5%     21    1.4%                              LazyCompile: *toLowerCase native string.js:739\r
+      2    0.1%      2    0.1%                                Stub: CEntryStub\r
+     13    0.8%     13    0.8%                              LazyCompile: <anonymous> native string.js:36\r
+      3    0.2%      3    0.2%                              Stub: CompareICStub {2}\r
+     10    0.6%     10    0.6%                            LazyCompile: *module.exports.ByteBuffer.readVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1272\r
+      9    0.6%      9    0.6%                          Stub: CompareICStub\r
+      3    0.2%      3    0.2%                          Builtin: A builtin from the snapshot\r
+    183   11.9%    182   11.8%                        LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+     14    0.9%     14    0.9%                        LazyCompile: *module.exports.ByteBuffer.readVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1272\r
+      8    0.5%      8    0.5%                        Builtin: A builtin from the snapshot\r
+      7    0.5%      7    0.5%                        Stub: KeyedLoadElementStub\r
+      5    0.3%      5    0.3%                        Builtin: A builtin from the snapshot {3}\r
+      4    0.3%      4    0.3%                        Stub: KeyedLoadElementStub {1}\r
+      4    0.3%      4    0.3%                        Stub: CEntryStub\r
+      4    0.3%      4    0.3%                        LazyCompile: *module.exports.ByteBuffer.remaining x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2397\r
+      4    0.3%      4    0.3%                        KeyedLoadIC: A keyed load IC from the snapshot\r
+      2    0.1%      2    0.1%                        KeyedStoreIC: A keyed store IC from the snapshot\r
+      3    0.2%      3    0.2%                      Stub: InstanceofStub\r
+      3    0.2%      3    0.2%                      Builtin: A builtin from the snapshot\r
+      2    0.1%      2    0.1%                      LazyCompile: *module.exports.ByteBuffer.LE x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2299\r
+      3    0.2%      3    0.2%                    LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+     77    5.0%      2    0.1%                  Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     37    2.4%      0    0.0%                    LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     32    2.1%      3    0.2%                      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     29    1.9%      4    0.3%                        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     25    1.6%      3    0.2%                          LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     21    1.4%      9    0.6%                            LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+     12    0.8%     11    0.7%                              LazyCompile: *Buffer.write buffer.js:315\r
+      5    0.3%      1    0.1%                      LazyCompile: ~ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      4    0.3%      0    0.0%                        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      2    0.1%      0    0.0%                          LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     37    2.4%      0    0.0%                    LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+     34    2.2%      6    0.4%                      LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     16    1.0%      2    0.1%                        LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     12    0.8%      0    0.0%                          LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+     12    0.8%      9    0.6%                            LazyCompile: *Buffer.toString buffer.js:392\r
+      3    0.2%      2    0.1%                              LazyCompile: *toLowerCase native string.js:739\r
+      9    0.6%      8    0.5%                        LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+      2    0.1%      1    0.1%                      LazyCompile: ~ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     17    1.1%      0    0.0%                  LazyCompile: ~require module.js:379\r
+     17    1.1%      0    0.0%                    LazyCompile: ~Module.require module.js:361\r
+     17    1.1%      0    0.0%                      LazyCompile: Module._load module.js:275\r
+     17    1.1%      0    0.0%                        LazyCompile: ~Module.load module.js:346\r
+     17    1.1%      0    0.0%                          LazyCompile: ~Module._extensions..js module.js:472\r
+     17    1.1%      0    0.0%                            LazyCompile: ~Module._compile module.js:374\r
+     17    1.1%      0    0.0%                              Function: ~<anonymous> x:\public\ProtoBuf\index.js:1\r
+     17    1.1%      0    0.0%                                LazyCompile: ~require module.js:379\r
+     17    1.1%      0    0.0%                                  LazyCompile: ~Module.require module.js:361\r
+     17    1.1%      0    0.0%                                    LazyCompile: Module._load module.js:275\r
+     17    1.1%      0    0.0%                                      LazyCompile: ~Module.load module.js:346\r
+     17    1.1%      0    0.0%                                        LazyCompile: ~Module._extensions..js module.js:472\r
+     16    1.0%      2    0.1%                                          LazyCompile: ~Module._compile module.js:374\r
+     14    0.9%      0    0.0%                                            Function: ~<anonymous> x:\public\ProtoBuf\dist\ProtoBuf.js:1\r
+     14    0.9%      2    0.1%                                              Function: ~<anonymous> x:\public\ProtoBuf\dist\ProtoBuf.js:22\r
+     12    0.8%      0    0.0%                                                LazyCompile: ~require module.js:379\r
+     12    0.8%      0    0.0%                                                  LazyCompile: ~Module.require module.js:361\r
+     12    0.8%      0    0.0%                                                    LazyCompile: Module._load module.js:275\r
+     11    0.7%      0    0.0%                                                      LazyCompile: ~Module.load module.js:346\r
+     11    0.7%      0    0.0%                                                        LazyCompile: ~Module._extensions..js module.js:472\r
+     11    0.7%      0    0.0%                                                          LazyCompile: ~Module._compile module.js:374\r
+     11    0.7%      0    0.0%                                                            Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\index.js:1\r
+     11    0.7%      0    0.0%                                                              LazyCompile: ~require module.js:379\r
+     11    0.7%      0    0.0%                                                                LazyCompile: ~Module.require module.js:361\r
+     11    0.7%      0    0.0%                                                                  LazyCompile: Module._load module.js:275\r
+     10    0.6%      0    0.0%                                                                    LazyCompile: ~Module.load module.js:346\r
+     10    0.6%      0    0.0%                                                                      LazyCompile: ~Module._extensions..js module.js:472\r
+      9    0.6%      3    0.2%                                                                        LazyCompile: ~Module._compile module.js:374\r
+      4    0.3%      0    0.0%                                                                          Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1\r
+      4    0.3%      0    0.0%                                                                            Function: <anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:23\r
+      4    0.3%      0    0.0%                                                                              LazyCompile: ~require module.js:379\r
+      4    0.3%      0    0.0%                                                                                LazyCompile: ~Module.require module.js:361\r
+      4    0.3%      0    0.0%                                                                                  LazyCompile: Module._load module.js:275\r
+      3    0.2%      0    0.0%                                                                                    LazyCompile: ~Module._resolveFilename module.js:323\r
+      3    0.2%      0    0.0%                                                                                      LazyCompile: ~Module._findPath module.js:160\r
+      2    0.1%      0    0.0%                                                                                        LazyCompile: ~tryExtensions module.js:148\r
+      2    0.1%      0    0.0%                                                                                          LazyCompile: ~tryFile module.js:138\r
+      2    0.1%      1    0.1%                                                                                            LazyCompile: statPath module.js:88\r
+      2    0.1%      0    0.0%                                                                          Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferAB.js:1\r
+      2    0.1%      2    0.1%                                                                            Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferAB.js:23\r
+      6    0.4%      0    0.0%                  LazyCompile: ~<anonymous> node.js:204\r
+      6    0.4%      0    0.0%                    LazyCompile: ~NativeModule.require node.js:847\r
+      6    0.4%      1    0.1%                      LazyCompile: ~NativeModule.compile node.js:892\r
+      5    0.3%      0    0.0%                        Function: ~<anonymous> console.js:1\r
+      4    0.3%      0    0.0%                          LazyCompile: ~<anonymous> node.js:615\r
+      4    0.3%      1    0.1%                            LazyCompile: ~createWritableStdioStream node.js:550\r
+      3    0.2%      0    0.0%                              LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      0    0.0%                                LazyCompile: ~NativeModule.compile node.js:892\r
+      3    0.2%      0    0.0%                                  Function: ~<anonymous> tty.js:1\r
+      3    0.2%      0    0.0%                                    LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      1    0.1%                                      LazyCompile: ~NativeModule.compile node.js:892\r
+      2    0.1%      2    0.1%                                        Function: ~<anonymous> net.js:1\r
+      2    0.1%      0    0.0%                  LazyCompile: ~b native v8natives.js:1582\r
+      2    0.1%      0    0.0%                    LazyCompile: ~Console.log console.js:52\r
+      2    0.1%      0    0.0%                      LazyCompile: ~Socket.write net.js:612\r
+      2    0.1%      0    0.0%                        LazyCompile: ~Writable.write _stream_writable.js:162\r
+      2    0.1%      0    0.0%                          LazyCompile: ~writeOrBuffer _stream_writable.js:199\r
+      2    0.1%      0    0.0%                            LazyCompile: ~doWrite _stream_writable.js:220\r
+      2    0.1%      0    0.0%                              LazyCompile: ~Socket._write net.js:619\r
+      2    0.1%      0    0.0%                  LazyCompile: ~ProtoBuf.loadProto x:\public\ProtoBuf\dist\ProtoBuf.js:3983\r
+      2    0.1%      2    0.1%                  LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+      2    0.1%      2    0.1%                  Builtin: A builtin from the snapshot\r
+      3    0.2%      0    0.0%          LazyCompile: ~Module._resolveFilename module.js:323\r
+      3    0.2%      0    0.0%            LazyCompile: ~Module._findPath module.js:160\r
+      3    0.2%      0    0.0%              LazyCompile: ~tryFile module.js:138\r
+      3    0.2%      0    0.0%                LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      1    0.1%                  LazyCompile: ~NativeModule.compile node.js:892\r
+      2    0.1%      1    0.1%                    Function: ~<anonymous> fs.js:1\r
+      3    0.2%      0    0.0%      LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      2    0.1%        LazyCompile: ~NativeModule.compile node.js:892\r
+      2    0.1%      0    0.0%      LazyCompile: ~startup.globalVariables node.js:160\r
+      2    0.1%      0    0.0%        LazyCompile: ~NativeModule.require node.js:847\r
+      2    0.1%      1    0.1%          LazyCompile: ~NativeModule.compile node.js:892\r
+\r
+      3    0.2%      3    0.2%  LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/camelcase.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/camelcase.proto
new file mode 100644 (file)
index 0000000..03de070
--- /dev/null
@@ -0,0 +1,14 @@
+message Test {\r
+    \r
+    // Case 1: Revert 1st\r
+    required int32 some_field = 1; // -> someField, reverted\r
+    required int32 someField = 2; // kept\r
+    \r
+    // Case 2: Revert 2nd\r
+    required int32 aField = 3; // kept\r
+    required int32 a_field = 4; // -> aField, reverted\r
+    \r
+    // No revert\r
+    required int32 its_a_field = 5; // -> itsAField\r
+    \r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/comments.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/comments.proto
new file mode 100644 (file)
index 0000000..9f808f7
--- /dev/null
@@ -0,0 +1,10 @@
+// single line comment\r
+\r
+/**\r
+ * Naranjas.\r
+ */\r
+message TestC { // one more\r
+    required /***** uncommon block ****/int32 a = 1; // another more\r
+}\r
+\r
+// the end.
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/complex.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/complex.json
new file mode 100644 (file)
index 0000000..534f1ba
--- /dev/null
@@ -0,0 +1,114 @@
+{
+    "package": "Game.Cars",
+    "syntax": "proto2",
+    "messages": [
+        {
+            "name": "Car",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "required",
+                    "type": "string",
+                    "name": "model",
+                    "id": 1
+                },
+                {
+                    "rule": "required",
+                    "type": "Vendor",
+                    "name": "vendor",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "Speed",
+                    "name": "speed",
+                    "id": 3,
+                    "options": {
+                        "default": "FAST"
+                    }
+                }
+            ],
+            "messages": [
+                {
+                    "name": "Vendor",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "required",
+                            "type": "string",
+                            "name": "name",
+                            "id": 1
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "Address",
+                            "name": "address",
+                            "id": 2
+                        },
+                        {
+                            "rule": "repeated",
+                            "type": "string",
+                            "name": "models",
+                            "id": 3
+                        }
+                    ],
+                    "messages": [
+                        {
+                            "name": "Address",
+                            "syntax": "proto2",
+                            "fields": [
+                                {
+                                    "rule": "required",
+                                    "type": "string",
+                                    "name": "country",
+                                    "id": 1
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "name": "Holder",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "optional",
+                            "type": "string",
+                            "name": "first_name",
+                            "id": 1
+                        },
+                        {
+                            "rule": "required",
+                            "type": "string",
+                            "name": "last_name",
+                            "id": 2
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "Vendor.Address",
+                            "name": "address",
+                            "id": 3
+                        }
+                    ]
+                }
+            ],
+            "enums": [
+                {
+                    "name": "Speed",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "FAST",
+                            "id": 1
+                        },
+                        {
+                            "name": "SUPERFAST",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "isNamespace": true
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/complex.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/complex.proto
new file mode 100644 (file)
index 0000000..4e55c59
--- /dev/null
@@ -0,0 +1,35 @@
+package Game.Cars;\r
+\r
+// Car\r
+message Car {\r
+    \r
+    // Car Vendor\r
+    message Vendor {\r
+        required string name = 1;\r
+        \r
+        // Car Vendor Address\r
+        message Address {\r
+            required string country = 1;\r
+        }\r
+        \r
+        optional Address address = 2;\r
+        repeated string models = 3;               // The models sold here.\r
+    }\r
+    \r
+    required  string  model  = 1;                 // Model name\r
+    required  Vendor  vendor = 2;                 // Vendor information\r
+    optional  Speed   speed  = 3 [default=FAST];  // Car speed\r
+    \r
+    // Car speed enum\r
+    enum Speed {\r
+        FAST      = 1;\r
+        SUPERFAST = 2;\r
+    }\r
+    \r
+    // Car Holder\r
+    message Holder {\r
+        optional  string          first_name = 1;\r
+        required  string          last_name  = 2;\r
+        optional  Vendor.Address  address    = 3;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/custom-options.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/custom-options.json
new file mode 100644 (file)
index 0000000..d60c0ba
--- /dev/null
@@ -0,0 +1,169 @@
+{\r
+    "package": null,\r
+    "messages": [\r
+        {\r
+            "ref": "google.protobuf.FileOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "my_file_option",\r
+                    "id": 50000\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.MessageOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "int32",\r
+                    "name": "my_message_option",\r
+                    "id": 50001\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.FieldOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "float",\r
+                    "name": "my_field_option",\r
+                    "id": 50002\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.EnumOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "my_enum_option",\r
+                    "id": 50003\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.EnumValueOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "uint32",\r
+                    "name": "my_enum_value_option",\r
+                    "id": 50004\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.ServiceOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "MyEnum",\r
+                    "name": "my_service_option",\r
+                    "id": 50005\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.MethodOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "MyMessage",\r
+                    "name": "my_method_option",\r
+                    "id": 50006\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "name": "MyMessage",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {\r
+                        "(my_field_option)": 4.5\r
+                    },\r
+                    "type": "int32",\r
+                    "name": "foo",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "bar",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {\r
+                "(my_message_option)": 1234\r
+            }\r
+        },\r
+        {\r
+            "name": "RequestType",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {}\r
+        },\r
+        {\r
+            "name": "ResponseType",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {}\r
+        }\r
+    ],\r
+    "enums": [\r
+        {\r
+            "name": "MyEnum",\r
+            "values": [\r
+                {\r
+                    "name": "FOO",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "name": "BAR",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "options": {\r
+                "(my_enum_option)": true\r
+            }\r
+        }\r
+    ],\r
+    "imports": [],\r
+    "options": {\r
+        "(my_file_option)": "Hello world!"\r
+    },\r
+    "services": [\r
+        {\r
+            "name": "MyService",\r
+            "rpc": {\r
+                "MyMethod": {\r
+                    "request": "RequestType",\r
+                    "response": "ResponseType",\r
+                    "options": {\r
+                        "(my_method_option).foo": 567,\r
+                        "(my_method_option).bar": "Some string"\r
+                    }\r
+                }\r
+            },\r
+            "options": {\r
+                "(my_service_option)": "FOO"\r
+            }\r
+        }\r
+    ]\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/custom-options.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/custom-options.proto
new file mode 100644 (file)
index 0000000..01f9773
--- /dev/null
@@ -0,0 +1,53 @@
+import "google/protobuf/descriptor.proto";\r
+\r
+extend google.protobuf.FileOptions {\r
+  optional string my_file_option = 50000;\r
+}\r
+extend google.protobuf.MessageOptions {\r
+  optional int32 my_message_option = 50001;\r
+}\r
+extend google.protobuf.FieldOptions {\r
+  optional float my_field_option = 50002;\r
+}\r
+extend google.protobuf.EnumOptions {\r
+  optional bool my_enum_option = 50003;\r
+}\r
+extend google.protobuf.EnumValueOptions {\r
+  optional uint32 my_enum_value_option = 50004;\r
+}\r
+extend google.protobuf.ServiceOptions {\r
+  optional MyEnum my_service_option = 50005;\r
+}\r
+extend google.protobuf.MethodOptions {\r
+  optional MyMessage my_method_option = 50006;\r
+}\r
+\r
+option (my_file_option) = "Hello world!";\r
+\r
+message MyMessage {\r
+  option (my_message_option) = 1234;\r
+\r
+  optional int32 foo = 1 [(my_field_option) = 4.5];\r
+  optional string bar = 2;\r
+}\r
+\r
+enum MyEnum {\r
+  option (my_enum_option) = true;\r
+\r
+  FOO = 1 [(my_enum_value_option) = 321];\r
+  BAR = 2;\r
+}\r
+\r
+message RequestType {}\r
+message ResponseType {}\r
+\r
+service MyService {\r
+  option (my_service_option) = FOO;\r
+\r
+  rpc MyMethod(RequestType) returns(ResponseType) {\r
+    // Note: my_method_option has type MyMessage. We can set each field\r
+    // within it using a separate "option" line.\r
+    option (my_method_option).foo = 567;\r
+    option (my_method_option).bar = "Some string";\r
+  }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/common.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/common.proto
new file mode 100644 (file)
index 0000000..7845c1d
--- /dev/null
@@ -0,0 +1,5 @@
+package main;\r
+\r
+message Common {\r
+    optional string commonField = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/dep1.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/dep1.proto
new file mode 100644 (file)
index 0000000..897916f
--- /dev/null
@@ -0,0 +1,7 @@
+package main;\r
+\r
+import "common.proto";\r
+\r
+message Dep1 {\r
+    optional main.Common test1 = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/dep2.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/dep2.proto
new file mode 100644 (file)
index 0000000..5f6ff6b
--- /dev/null
@@ -0,0 +1,8 @@
+package main;\r
+\r
+import "dep1.proto";\r
+\r
+message Dep2 {\r
+    optional main.Dep1 test1 = 1;\r
+    optional main.Common test2 = 2;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/main.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/dupimport/main.proto
new file mode 100644 (file)
index 0000000..fc2c7b5
--- /dev/null
@@ -0,0 +1,11 @@
+package main;\r
+\r
+import "dep1.proto";\r
+import "dep2.proto";\r
+import "common.proto";\r
+\r
+message MainMessage {\r
+    optional main.Dep1 test1 = 1;\r
+    optional main.Dep2 test2 = 2;\r
+    optional main.Common test3 = 3;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example1.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example1.proto
new file mode 100644 (file)
index 0000000..dd3c96e
--- /dev/null
@@ -0,0 +1,5 @@
+message Test1 {\r
+    required int32 a = 1;\r
+}\r
+\r
+// Test1 should encode to "08 96 01" with Test1#a=150\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example1u.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example1u.proto
new file mode 100644 (file)
index 0000000..2b91e8b
--- /dev/null
@@ -0,0 +1,3 @@
+message Test1u {\r
+    required uint32 a = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example2.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example2.proto
new file mode 100644 (file)
index 0000000..e00c4d2
--- /dev/null
@@ -0,0 +1,5 @@
+message Test2 {\r
+  required string b = 2;\r
+}\r
+\r
+// Test2 should encode to "12 07 74 65 73 74 69 6e 67" with Test2#b="testing"\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example3.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example3.proto
new file mode 100644 (file)
index 0000000..2ec5a97
--- /dev/null
@@ -0,0 +1,9 @@
+message Test1 {\r
+  required int32 a = 1;\r
+}\r
+\r
+message Test3 {\r
+  required Test1 c = 3;\r
+}\r
+\r
+// Test3 should encode to "1a 03 08 96 01" with Test1#a=150 \r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example4.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example4.proto
new file mode 100644 (file)
index 0000000..455ae94
--- /dev/null
@@ -0,0 +1,5 @@
+message Test4 {\r
+  repeated int32 d = 4 [packed=true];\r
+}\r
+\r
+// Test4 should encode to "<22 06 03 8E 02 9E A7 05>" with d=[3, 270, 86942]\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example5.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/example5.proto
new file mode 100644 (file)
index 0000000..22a8156
--- /dev/null
@@ -0,0 +1,29 @@
+package Datastore;\r
+\r
+message LookupRequest {\r
+  repeated string key = 1;\r
+}\r
+\r
+message LookupResponse {\r
+  repeated string results = 1;\r
+}\r
+\r
+message RunQueryRequest {\r
+  required string query = 1;\r
+}\r
+\r
+message RunQueryResponse {\r
+  repeated string results = 1;\r
+}\r
+\r
+service LookupService {\r
+  // Look up some entities by key.\r
+  rpc Lookup(LookupRequest) returns (LookupResponse) {\r
+  }\r
+}\r
+\r
+service RunQueryService {\r
+  // Query for entities.\r
+  rpc RunQuery(RunQueryRequest) returns (RunQueryResponse) {\r
+  };\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/extend.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/extend.json
new file mode 100644 (file)
index 0000000..5027fd5
--- /dev/null
@@ -0,0 +1,71 @@
+{\r
+    "package": null,\r
+    "messages": [\r
+        {\r
+            "ref": "google.protobuf.MessageOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "int32",\r
+                    "name": "foo",\r
+                    "id": 1001\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "name": "Foo",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "extensions": [\r
+                2,\r
+                536870911\r
+            ]\r
+        },\r
+        {\r
+            "ref": "Foo",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "bar",\r
+                    "id": 2\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "name": "Bar",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [\r
+                {\r
+                    "name": "Foo",\r
+                    "fields": [],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {}\r
+                },\r
+                {\r
+                    "ref": "Foo",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "optional",\r
+                            "options": {},\r
+                            "type": "Foo",\r
+                            "name": "foo",\r
+                            "id": 3\r
+                        }\r
+                    ]\r
+                }\r
+            ],\r
+            "options": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/extend.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/extend.proto
new file mode 100644 (file)
index 0000000..20ea830
--- /dev/null
@@ -0,0 +1,23 @@
+import "google/protobuf/descriptor.proto"; // Ignored\r
+// import "./google/protobuf/descriptor.proto"; // Not ignored\r
+\r
+extend google.protobuf.MessageOptions {\r
+  optional int32 foo = 1001;\r
+}\r
+\r
+message Foo {\r
+    extensions 2 to max;\r
+}\r
+\r
+extend Foo {\r
+    optional string bar = 2;\r
+}\r
+\r
+message Bar {\r
+    message Foo {\r
+    }\r
+\r
+    extend .Foo {\r
+        optional Foo foo = 3; // references Bar.Foo\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/field_name_same_as_package/main.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/field_name_same_as_package/main.proto
new file mode 100644 (file)
index 0000000..6be8ba4
--- /dev/null
@@ -0,0 +1,7 @@
+package main;\r
+\r
+import "sub.proto";\r
+\r
+message MainMessage {\r
+    optional main.sub.Sub sub = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/field_name_same_as_package/sub.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/field_name_same_as_package/sub.proto
new file mode 100644 (file)
index 0000000..1c7ba4f
--- /dev/null
@@ -0,0 +1,5 @@
+package main.sub;\r
+\r
+message Sub {\r
+    optional string test1 = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/google/protobuf/descriptor.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/google/protobuf/descriptor.proto
new file mode 100644 (file)
index 0000000..83fe2e1
--- /dev/null
@@ -0,0 +1,620 @@
+// Protocol Buffers - Google's data interchange format\r
+// Copyright 2008 Google Inc.  All rights reserved.\r
+// http://code.google.com/p/protobuf/\r
+//\r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are\r
+// met:\r
+//\r
+//     * Redistributions of source code must retain the above copyright\r
+// notice, this list of conditions and the following disclaimer.\r
+//     * Redistributions in binary form must reproduce the above\r
+// copyright notice, this list of conditions and the following disclaimer\r
+// in the documentation and/or other materials provided with the\r
+// distribution.\r
+//     * Neither the name of Google Inc. nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+//\r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+// Author: kenton@google.com (Kenton Varda)\r
+//  Based on original Protocol Buffers design by\r
+//  Sanjay Ghemawat, Jeff Dean, and others.\r
+//\r
+// The messages in this file describe the definitions found in .proto files.\r
+// A valid .proto file can be translated directly to a FileDescriptorProto\r
+// without any other information (e.g. without reading its imports).\r
+\r
+\r
+\r
+package google.protobuf;\r
+option java_package = "com.google.protobuf";\r
+option java_outer_classname = "DescriptorProtos";\r
+\r
+// descriptor.proto must be optimized for speed because reflection-based\r
+// algorithms don't work during bootstrapping.\r
+option optimize_for = SPEED;\r
+\r
+// The protocol compiler can output a FileDescriptorSet containing the .proto\r
+// files it parses.\r
+message FileDescriptorSet {\r
+  repeated FileDescriptorProto file = 1;\r
+}\r
+\r
+// Describes a complete .proto file.\r
+message FileDescriptorProto {\r
+  optional string name = 1;       // file name, relative to root of source tree\r
+  optional string package = 2;    // e.g. "foo", "foo.bar", etc.\r
+\r
+  // Names of files imported by this file.\r
+  repeated string dependency = 3;\r
+  // Indexes of the public imported files in the dependency list above.\r
+  repeated int32 public_dependency = 10;\r
+  // Indexes of the weak imported files in the dependency list.\r
+  // For Google-internal migration only. Do not use.\r
+  repeated int32 weak_dependency = 11;\r
+\r
+  // All top-level definitions in this file.\r
+  repeated DescriptorProto message_type = 4;\r
+  repeated EnumDescriptorProto enum_type = 5;\r
+  repeated ServiceDescriptorProto service = 6;\r
+  repeated FieldDescriptorProto extension = 7;\r
+\r
+  optional FileOptions options = 8;\r
+\r
+  // This field contains optional information about the original source code.\r
+  // You may safely remove this entire field whithout harming runtime\r
+  // functionality of the descriptors -- the information is needed only by\r
+  // development tools.\r
+  optional SourceCodeInfo source_code_info = 9;\r
+}\r
+\r
+// Describes a message type.\r
+message DescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated FieldDescriptorProto field = 2;\r
+  repeated FieldDescriptorProto extension = 6;\r
+\r
+  repeated DescriptorProto nested_type = 3;\r
+  repeated EnumDescriptorProto enum_type = 4;\r
+\r
+  message ExtensionRange {\r
+    optional int32 start = 1;\r
+    optional int32 end = 2;\r
+  }\r
+  repeated ExtensionRange extension_range = 5;\r
+\r
+  optional MessageOptions options = 7;\r
+}\r
+\r
+// Describes a field within a message.\r
+message FieldDescriptorProto {\r
+  enum Type {\r
+    // 0 is reserved for errors.\r
+    // Order is weird for historical reasons.\r
+    TYPE_DOUBLE         = 1;\r
+    TYPE_FLOAT          = 2;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\r
+    // negative values are likely.\r
+    TYPE_INT64          = 3;\r
+    TYPE_UINT64         = 4;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\r
+    // negative values are likely.\r
+    TYPE_INT32          = 5;\r
+    TYPE_FIXED64        = 6;\r
+    TYPE_FIXED32        = 7;\r
+    TYPE_BOOL           = 8;\r
+    TYPE_STRING         = 9;\r
+    TYPE_GROUP          = 10;  // Tag-delimited aggregate.\r
+    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.\r
+\r
+    // New in version 2.\r
+    TYPE_BYTES          = 12;\r
+    TYPE_UINT32         = 13;\r
+    TYPE_ENUM           = 14;\r
+    TYPE_SFIXED32       = 15;\r
+    TYPE_SFIXED64       = 16;\r
+    TYPE_SINT32         = 17;  // Uses ZigZag encoding.\r
+    TYPE_SINT64         = 18;  // Uses ZigZag encoding.\r
+  };\r
+\r
+  enum Label {\r
+    // 0 is reserved for errors\r
+    LABEL_OPTIONAL      = 1;\r
+    LABEL_REQUIRED      = 2;\r
+    LABEL_REPEATED      = 3;\r
+    // TODO(sanjay): Should we add LABEL_MAP?\r
+  };\r
+\r
+  optional string name = 1;\r
+  optional int32 number = 3;\r
+  optional Label label = 4;\r
+\r
+  // If type_name is set, this need not be set.  If both this and type_name\r
+  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.\r
+  optional Type type = 5;\r
+\r
+  // For message and enum types, this is the name of the type.  If the name\r
+  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\r
+  // rules are used to find the type (i.e. first the nested types within this\r
+  // message are searched, then within the parent, on up to the root\r
+  // namespace).\r
+  optional string type_name = 6;\r
+\r
+  // For extensions, this is the name of the type being extended.  It is\r
+  // resolved in the same manner as type_name.\r
+  optional string extendee = 2;\r
+\r
+  // For numeric types, contains the original text representation of the value.\r
+  // For booleans, "true" or "false".\r
+  // For strings, contains the default text contents (not escaped in any way).\r
+  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\r
+  // TODO(kenton):  Base-64 encode?\r
+  optional string default_value = 7;\r
+\r
+  optional FieldOptions options = 8;\r
+}\r
+\r
+// Describes an enum type.\r
+message EnumDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated EnumValueDescriptorProto value = 2;\r
+\r
+  optional EnumOptions options = 3;\r
+}\r
+\r
+// Describes a value within an enum.\r
+message EnumValueDescriptorProto {\r
+  optional string name = 1;\r
+  optional int32 number = 2;\r
+\r
+  optional EnumValueOptions options = 3;\r
+}\r
+\r
+// Describes a service.\r
+message ServiceDescriptorProto {\r
+  optional string name = 1;\r
+  repeated MethodDescriptorProto method = 2;\r
+\r
+  optional ServiceOptions options = 3;\r
+}\r
+\r
+// Describes a method of a service.\r
+message MethodDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  // Input and output type names.  These are resolved in the same way as\r
+  // FieldDescriptorProto.type_name, but must refer to a message type.\r
+  optional string input_type = 2;\r
+  optional string output_type = 3;\r
+\r
+  optional MethodOptions options = 4;\r
+}\r
+\r
+\r
+// ===================================================================\r
+// Options\r
+\r
+// Each of the definitions above may have "options" attached.  These are\r
+// just annotations which may cause code to be generated slightly differently\r
+// or may contain hints for code that manipulates protocol messages.\r
+//\r
+// Clients may define custom options as extensions of the *Options messages.\r
+// These extensions may not yet be known at parsing time, so the parser cannot\r
+// store the values in them.  Instead it stores them in a field in the *Options\r
+// message called uninterpreted_option. This field must have the same name\r
+// across all *Options messages. We then use this field to populate the\r
+// extensions when we build a descriptor, at which point all protos have been\r
+// parsed and so all extensions are known.\r
+//\r
+// Extension numbers for custom options may be chosen as follows:\r
+// * For options which will only be used within a single application or\r
+//   organization, or for experimental options, use field numbers 50000\r
+//   through 99999.  It is up to you to ensure that you do not use the\r
+//   same number for multiple options.\r
+// * For options which will be published and used publicly by multiple\r
+//   independent entities, e-mail protobuf-global-extension-registry@google.com\r
+//   to reserve extension numbers. Simply provide your project name (e.g.\r
+//   Object-C plugin) and your porject website (if available) -- there's no need\r
+//   to explain how you intend to use them. Usually you only need one extension\r
+//   number. You can declare multiple options with only one extension number by\r
+//   putting them in a sub-message. See the Custom Options section of the docs\r
+//   for examples:\r
+//   http://code.google.com/apis/protocolbuffers/docs/proto.html#options\r
+//   If this turns out to be popular, a web service will be set up\r
+//   to automatically assign option numbers.\r
+\r
+\r
+message FileOptions {\r
+\r
+  // Sets the Java package where classes generated from this .proto will be\r
+  // placed.  By default, the proto package is used, but this is often\r
+  // inappropriate because proto packages do not normally start with backwards\r
+  // domain names.\r
+  optional string java_package = 1;\r
+\r
+\r
+  // If set, all the classes from the .proto file are wrapped in a single\r
+  // outer class with the given name.  This applies to both Proto1\r
+  // (equivalent to the old "--one_java_file" option) and Proto2 (where\r
+  // a .proto always translates to a single class, but you may want to\r
+  // explicitly choose the class name).\r
+  optional string java_outer_classname = 8;\r
+\r
+  // If set true, then the Java code generator will generate a separate .java\r
+  // file for each top-level message, enum, and service defined in the .proto\r
+  // file.  Thus, these types will *not* be nested inside the outer class\r
+  // named by java_outer_classname.  However, the outer class will still be\r
+  // generated to contain the file's getDescriptor() method as well as any\r
+  // top-level extensions defined in the file.\r
+  optional bool java_multiple_files = 10 [default=false];\r
+\r
+  // If set true, then the Java code generator will generate equals() and\r
+  // hashCode() methods for all messages defined in the .proto file. This is\r
+  // purely a speed optimization, as the AbstractMessage base class includes\r
+  // reflection-based implementations of these methods.\r
+  optional bool java_generate_equals_and_hash = 20 [default=false];\r
+\r
+  // Generated classes can be optimized for speed or code size.\r
+  enum OptimizeMode {\r
+    SPEED = 1;        // Generate complete code for parsing, serialization,\r
+                      // etc.\r
+    CODE_SIZE = 2;    // Use ReflectionOps to implement these methods.\r
+    LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\r
+  }\r
+  optional OptimizeMode optimize_for = 9 [default=SPEED];\r
+\r
+  // Sets the Go package where structs generated from this .proto will be\r
+  // placed.  There is no default.\r
+  optional string go_package = 11;\r
+\r
+\r
+\r
+  // Should generic services be generated in each language?  "Generic" services\r
+  // are not specific to any particular RPC system.  They are generated by the\r
+  // main code generators in each language (without additional plugins).\r
+  // Generic services were the only kind of service generation supported by\r
+  // early versions of proto2.\r
+  //\r
+  // Generic services are now considered deprecated in favor of using plugins\r
+  // that generate code specific to your particular RPC system.  Therefore,\r
+  // these default to false.  Old code which depends on generic services should\r
+  // explicitly set them to true.\r
+  optional bool cc_generic_services = 16 [default=false];\r
+  optional bool java_generic_services = 17 [default=false];\r
+  optional bool py_generic_services = 18 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MessageOptions {\r
+  // Set true to use the old proto1 MessageSet wire format for extensions.\r
+  // This is provided for backwards-compatibility with the MessageSet wire\r
+  // format.  You should not use this for any other reason:  It's less\r
+  // efficient, has fewer features, and is more complicated.\r
+  //\r
+  // The message must be defined exactly as follows:\r
+  //   message Foo {\r
+  //     option message_set_wire_format = true;\r
+  //     extensions 4 to max;\r
+  //   }\r
+  // Note that the message cannot have any defined fields; MessageSets only\r
+  // have extensions.\r
+  //\r
+  // All extensions of your type must be singular messages; e.g. they cannot\r
+  // be int32s, enums, or repeated messages.\r
+  //\r
+  // Because this is an option, the above two restrictions are not enforced by\r
+  // the protocol compiler.\r
+  optional bool message_set_wire_format = 1 [default=false];\r
+\r
+  // Disables the generation of the standard "descriptor()" accessor, which can\r
+  // conflict with a field of the same name.  This is meant to make migration\r
+  // from proto1 easier; new code should avoid fields named "descriptor".\r
+  optional bool no_standard_descriptor_accessor = 2 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message FieldOptions {\r
+  // The ctype option instructs the C++ code generator to use a different\r
+  // representation of the field than it normally would.  See the specific\r
+  // options below.  This option is not yet implemented in the open source\r
+  // release -- sorry, we'll try to include it in a future version!\r
+  optional CType ctype = 1 [default = STRING];\r
+  enum CType {\r
+    // Default mode.\r
+    STRING = 0;\r
+\r
+    CORD = 1;\r
+\r
+    STRING_PIECE = 2;\r
+  }\r
+  // The packed option can be enabled for repeated primitive fields to enable\r
+  // a more efficient representation on the wire. Rather than repeatedly\r
+  // writing the tag and type for each element, the entire array is encoded as\r
+  // a single length-delimited blob.\r
+  optional bool packed = 2;\r
+\r
+\r
+\r
+  // Should this field be parsed lazily?  Lazy applies only to message-type\r
+  // fields.  It means that when the outer message is initially parsed, the\r
+  // inner message's contents will not be parsed but instead stored in encoded\r
+  // form.  The inner message will actually be parsed when it is first accessed.\r
+  //\r
+  // This is only a hint.  Implementations are free to choose whether to use\r
+  // eager or lazy parsing regardless of the value of this option.  However,\r
+  // setting this option true suggests that the protocol author believes that\r
+  // using lazy parsing on this field is worth the additional bookkeeping\r
+  // overhead typically needed to implement it.\r
+  //\r
+  // This option does not affect the public interface of any generated code;\r
+  // all method signatures remain the same.  Furthermore, thread-safety of the\r
+  // interface is not affected by this option; const methods remain safe to\r
+  // call from multiple threads concurrently, while non-const methods continue\r
+  // to require exclusive access.\r
+  //\r
+  //\r
+  // Note that implementations may choose not to check required fields within\r
+  // a lazy sub-message.  That is, calling IsInitialized() on the outher message\r
+  // may return true even if the inner message has missing required fields.\r
+  // This is necessary because otherwise the inner message would have to be\r
+  // parsed in order to perform the check, defeating the purpose of lazy\r
+  // parsing.  An implementation which chooses not to check required fields\r
+  // must be consistent about it.  That is, for any particular sub-message, the\r
+  // implementation must either *always* check its required fields, or *never*\r
+  // check its required fields, regardless of whether or not the message has\r
+  // been parsed.\r
+  optional bool lazy = 5 [default=false];\r
+\r
+  // Is this field deprecated?\r
+  // Depending on the target platform, this can emit Deprecated annotations\r
+  // for accessors, or it will be completely ignored; in the very least, this\r
+  // is a formalization for deprecating fields.\r
+  optional bool deprecated = 3 [default=false];\r
+\r
+  // EXPERIMENTAL.  DO NOT USE.\r
+  // For "map" fields, the name of the field in the enclosed type that\r
+  // is the key for this map.  For example, suppose we have:\r
+  //   message Item {\r
+  //     required string name = 1;\r
+  //     required string value = 2;\r
+  //   }\r
+  //   message Config {\r
+  //     repeated Item items = 1 [experimental_map_key="name"];\r
+  //   }\r
+  // In this situation, the map key for Item will be set to "name".\r
+  // TODO: Fully-implement this, then remove the "experimental_" prefix.\r
+  optional string experimental_map_key = 9;\r
+\r
+  // For Google-internal migration only. Do not use.\r
+  optional bool weak = 10 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumOptions {\r
+\r
+  // Set this option to false to disallow mapping different tag names to a same\r
+  // value.\r
+  optional bool allow_alias = 2 [default=true];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumValueOptions {\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message ServiceOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MethodOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+\r
+// A message representing a option the parser does not recognize. This only\r
+// appears in options protos created by the compiler::Parser class.\r
+// DescriptorPool resolves these when building Descriptor objects. Therefore,\r
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),\r
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\r
+// in them.\r
+message UninterpretedOption {\r
+  // The name of the uninterpreted option.  Each string represents a segment in\r
+  // a dot-separated name.  is_extension is true iff a segment represents an\r
+  // extension (denoted with parentheses in options specs in .proto files).\r
+  // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents\r
+  // "foo.(bar.baz).qux".\r
+  message NamePart {\r
+    required string name_part = 1;\r
+    required bool is_extension = 2;\r
+  }\r
+  repeated NamePart name = 2;\r
+\r
+  // The value of the uninterpreted option, in whatever type the tokenizer\r
+  // identified it as during parsing. Exactly one of these should be set.\r
+  optional string identifier_value = 3;\r
+  optional uint64 positive_int_value = 4;\r
+  optional int64 negative_int_value = 5;\r
+  optional double double_value = 6;\r
+  optional bytes string_value = 7;\r
+  optional string aggregate_value = 8;\r
+}\r
+\r
+// ===================================================================\r
+// Optional source code info\r
+\r
+// Encapsulates information about the original source file from which a\r
+// FileDescriptorProto was generated.\r
+message SourceCodeInfo {\r
+  // A Location identifies a piece of source code in a .proto file which\r
+  // corresponds to a particular definition.  This information is intended\r
+  // to be useful to IDEs, code indexers, documentation generators, and similar\r
+  // tools.\r
+  //\r
+  // For example, say we have a file like:\r
+  //   message Foo {\r
+  //     optional string foo = 1;\r
+  //   }\r
+  // Let's look at just the field definition:\r
+  //   optional string foo = 1;\r
+  //   ^       ^^     ^^  ^  ^^^\r
+  //   a       bc     de  f  ghi\r
+  // We have the following locations:\r
+  //   span   path               represents\r
+  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\r
+  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\r
+  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\r
+  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\r
+  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\r
+  //\r
+  // Notes:\r
+  // - A location may refer to a repeated field itself (i.e. not to any\r
+  //   particular index within it).  This is used whenever a set of elements are\r
+  //   logically enclosed in a single code segment.  For example, an entire\r
+  //   extend block (possibly containing multiple extension definitions) will\r
+  //   have an outer location whose path refers to the "extensions" repeated\r
+  //   field without an index.\r
+  // - Multiple locations may have the same path.  This happens when a single\r
+  //   logical declaration is spread out across multiple places.  The most\r
+  //   obvious example is the "extend" block again -- there may be multiple\r
+  //   extend blocks in the same scope, each of which will have the same path.\r
+  // - A location's span is not always a subset of its parent's span.  For\r
+  //   example, the "extendee" of an extension declaration appears at the\r
+  //   beginning of the "extend" block and is shared by all extensions within\r
+  //   the block.\r
+  // - Just because a location's span is a subset of some other location's span\r
+  //   does not mean that it is a descendent.  For example, a "group" defines\r
+  //   both a type and a field in a single declaration.  Thus, the locations\r
+  //   corresponding to the type and field and their components will overlap.\r
+  // - Code which tries to interpret locations should probably be designed to\r
+  //   ignore those that it doesn't understand, as more types of locations could\r
+  //   be recorded in the future.\r
+  repeated Location location = 1;\r
+  message Location {\r
+    // Identifies which part of the FileDescriptorProto was defined at this\r
+    // location.\r
+    //\r
+    // Each element is a field number or an index.  They form a path from\r
+    // the root FileDescriptorProto to the place where the definition.  For\r
+    // example, this path:\r
+    //   [ 4, 3, 2, 7, 1 ]\r
+    // refers to:\r
+    //   file.message_type(3)  // 4, 3\r
+    //       .field(7)         // 2, 7\r
+    //       .name()           // 1\r
+    // This is because FileDescriptorProto.message_type has field number 4:\r
+    //   repeated DescriptorProto message_type = 4;\r
+    // and DescriptorProto.field has field number 2:\r
+    //   repeated FieldDescriptorProto field = 2;\r
+    // and FieldDescriptorProto.name has field number 1:\r
+    //   optional string name = 1;\r
+    //\r
+    // Thus, the above path gives the location of a field name.  If we removed\r
+    // the last element:\r
+    //   [ 4, 3, 2, 7 ]\r
+    // this path refers to the whole field declaration (from the beginning\r
+    // of the label to the terminating semicolon).\r
+    repeated int32 path = 1 [packed=true];\r
+\r
+    // Always has exactly three or four elements: start line, start column,\r
+    // end line (optional, otherwise assumed same as start line), end column.\r
+    // These are packed into a single field for efficiency.  Note that line\r
+    // and column numbers are zero-based -- typically you will want to add\r
+    // 1 to each before displaying to a user.\r
+    repeated int32 span = 2 [packed=true];\r
+\r
+    // If this SourceCodeInfo represents a complete declaration, these are any\r
+    // comments appearing before and after the declaration which appear to be\r
+    // attached to the declaration.\r
+    //\r
+    // A series of line comments appearing on consecutive lines, with no other\r
+    // tokens appearing on those lines, will be treated as a single comment.\r
+    //\r
+    // Only the comment content is provided; comment markers (e.g. //) are\r
+    // stripped out.  For block comments, leading whitespace and an asterisk\r
+    // will be stripped from the beginning of each line other than the first.\r
+    // Newlines are included in the output.\r
+    //\r
+    // Examples:\r
+    //\r
+    //   optional int32 foo = 1;  // Comment attached to foo.\r
+    //   // Comment attached to bar.\r
+    //   optional int32 bar = 2;\r
+    //\r
+    //   optional string baz = 3;\r
+    //   // Comment attached to baz.\r
+    //   // Another line attached to baz.\r
+    //\r
+    //   // Comment attached to qux.\r
+    //   //\r
+    //   // Another line attached to qux.\r
+    //   optional double qux = 4;\r
+    //\r
+    //   optional string corge = 5;\r
+    //   /* Block comment attached\r
+    //    * to corge.  Leading asterisks\r
+    //    * will be removed. */\r
+    //   /* Block comment attached to\r
+    //    * grault. */\r
+    //   optional int32 grault = 6;\r
+    optional string leading_comments = 3;\r
+    optional string trailing_comments = 4;\r
+  }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/groups.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/groups.proto
new file mode 100644 (file)
index 0000000..9e96720
--- /dev/null
@@ -0,0 +1,13 @@
+message Outer {\r
+  required string before = 1;\r
+  repeated group MyInner = 2 [deprecated=true] {\r
+    required string a = 3;\r
+  }\r
+  required string after = 4;\r
+  optional MyInner myInner2 = 5;\r
+}\r
+\r
+message OuterSparse {\r
+  required string before = 1;\r
+  required string after = 4;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file1.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file1.proto
new file mode 100644 (file)
index 0000000..eaf02ee
--- /dev/null
@@ -0,0 +1 @@
+import "importRoot/file2.proto";\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file2.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file2.proto
new file mode 100644 (file)
index 0000000..44c7794
--- /dev/null
@@ -0,0 +1 @@
+import "importRoot/file3.proto";\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file3.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/importRoot/file3.proto
new file mode 100644 (file)
index 0000000..24377d9
--- /dev/null
@@ -0,0 +1 @@
+message Test {}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_a.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_a.proto
new file mode 100644 (file)
index 0000000..f50242f
--- /dev/null
@@ -0,0 +1,5 @@
+import "import_common.proto";\r
+\r
+message A {\r
+    optional Common common = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_a_single_quote.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_a_single_quote.proto
new file mode 100644 (file)
index 0000000..6ea6844
--- /dev/null
@@ -0,0 +1,5 @@
+import 'import_common.proto';\r
+\r
+message A {\r
+    optional Common common = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_b.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_b.proto
new file mode 100644 (file)
index 0000000..4809bfd
--- /dev/null
@@ -0,0 +1,5 @@
+import "import_common.proto";\r
+\r
+message B {\r
+    optional Common common = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_common.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/import_common.proto
new file mode 100644 (file)
index 0000000..ad9bfe7
--- /dev/null
@@ -0,0 +1,2 @@
+message Common {\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports-toplevel.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports-toplevel.proto
new file mode 100644 (file)
index 0000000..ebca0ff
--- /dev/null
@@ -0,0 +1,13 @@
+import "toplevel.proto";\r
+\r
+package My;\r
+\r
+enum MyEnum1 {\r
+    ONE = 1;\r
+    TWO = 2;\r
+}\r
+\r
+message Test1 {\r
+    required MyEnum num = 1 [default=ONE];\r
+    required MyEnum1 num1 = 2 [default=ONE];\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports-weak.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports-weak.proto
new file mode 100644 (file)
index 0000000..a5986f1
--- /dev/null
@@ -0,0 +1,7 @@
+package My;\r
+\r
+import weak "example1.proto";\r
+\r
+message Test2 {\r
+    required Test1 test1 = 1;\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports.json
new file mode 100644 (file)
index 0000000..c92a99c
--- /dev/null
@@ -0,0 +1,83 @@
+{\r
+    "package": "My",\r
+    "messages": [\r
+        {\r
+            "name": "Test3",\r
+            "fields": [\r
+                {\r
+                    "rule": "required",\r
+                    "options": {},\r
+                    "type": "Test1",\r
+                    "name": "test1",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "required",\r
+                    "options": {},\r
+                    "type": ".Test2",\r
+                    "name": "test2",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [\r
+        {\r
+            "package": null,\r
+            "messages": [\r
+                {\r
+                    "name": "Test1",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "required",\r
+                            "options": {},\r
+                            "type": "int32",\r
+                            "name": "a",\r
+                            "id": 1\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {},\r
+                    "oneofs": {}\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "imports": [],\r
+            "options": {},\r
+            "services": []\r
+        },\r
+        {\r
+            "package": null,\r
+            "messages": [\r
+                {\r
+                    "name": "Test2",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "required",\r
+                            "options": {},\r
+                            "type": "string",\r
+                            "name": "b",\r
+                            "id": 2\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {},\r
+                    "oneofs": {}\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "imports": [],\r
+            "options": {},\r
+            "services": []\r
+        }\r
+    ],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/imports.proto
new file mode 100644 (file)
index 0000000..e604dac
--- /dev/null
@@ -0,0 +1,9 @@
+package My;\r
+\r
+import public "example1.proto";\r
+import "example2.proto";\r
+\r
+message Test3 {\r
+    required Test1 test1 = 1;\r
+    required .Test2 test2 = 2;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/inner.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/inner.proto
new file mode 100644 (file)
index 0000000..c750f28
--- /dev/null
@@ -0,0 +1,10 @@
+message Foo {\r
+    required Bar bar = 1;\r
+    required Baz baz = 2;\r
+}\r
+message Bar {\r
+    required string blah = 1;\r
+}\r
+message Baz {\r
+    required string blah = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/negid.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/negid.proto
new file mode 100644 (file)
index 0000000..9b6a2ec
--- /dev/null
@@ -0,0 +1,9 @@
+message Test {\r
+    required LobbyType type = 1 [default=INVALID];\r
+    \r
+    enum LobbyType {\r
+        INVALID = -1;\r
+        MATCH = 0;\r
+        PRACTICE = 1;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/LICENSE b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/LICENSE
new file mode 100644 (file)
index 0000000..5dfdc43
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Caolan McMahon\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+THE SOFTWARE.\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.css b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.css
new file mode 100644 (file)
index 0000000..4c3f20c
--- /dev/null
@@ -0,0 +1,70 @@
+/*!\r
+ * Styles taken from qunit.css\r
+ */\r
+\r
+h1#nodeunit-header, h1.nodeunit-header {\r
+    padding: 15px;\r
+    font-size: large;\r
+    background-color: #06b;\r
+    color: white;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    margin: 0;\r
+}\r
+\r
+h1#nodeunit-header a {\r
+    color: white;\r
+}\r
+\r
+h2#nodeunit-banner {\r
+    height: 2em;\r
+    border-bottom: 1px solid white;\r
+    background-color: #eee;\r
+    margin: 0;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+}\r
+h2#nodeunit-banner.pass {\r
+    background-color: green;\r
+}\r
+h2#nodeunit-banner.fail {\r
+    background-color: red;\r
+}\r
+\r
+h2#nodeunit-userAgent, h2.nodeunit-userAgent {\r
+    padding: 10px;\r
+    background-color: #eee;\r
+    color: black;\r
+    margin: 0;\r
+    font-size: small;\r
+    font-weight: normal;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    font-size: 10pt;\r
+}\r
+\r
+div#nodeunit-testrunner-toolbar {\r
+    background: #eee;\r
+    border-top: 1px solid black;\r
+    padding: 10px;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    margin: 0;\r
+    font-size: 10pt;\r
+}\r
+\r
+ol#nodeunit-tests {\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    font-size: 10pt;\r
+}\r
+ol#nodeunit-tests li strong {\r
+    cursor:pointer;\r
+}\r
+ol#nodeunit-tests .pass {\r
+    color: green;\r
+} \r
+ol#nodeunit-tests .fail {\r
+    color: red;\r
+} \r
+\r
+p#nodeunit-testresult {\r
+    margin-left: 1em;\r
+    font-size: 10pt;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.js
new file mode 100644 (file)
index 0000000..2f8f20d
--- /dev/null
@@ -0,0 +1,2108 @@
+/*!\r
+ * Nodeunit\r
+ * https://github.com/caolan/nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * json2.js\r
+ * http://www.JSON.org/json2.js\r
+ * Public Domain.\r
+ * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\r
+ */\r
+nodeunit = (function(){\r
+/*\r
+    http://www.JSON.org/json2.js\r
+    2010-11-17\r
+\r
+    Public Domain.\r
+\r
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\r
+\r
+    See http://www.JSON.org/js.html\r
+\r
+\r
+    This code should be minified before deployment.\r
+    See http://javascript.crockford.com/jsmin.html\r
+\r
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\r
+    NOT CONTROL.\r
+\r
+\r
+    This file creates a global JSON object containing two methods: stringify\r
+    and parse.\r
+\r
+        JSON.stringify(value, replacer, space)\r
+            value       any JavaScript value, usually an object or array.\r
+\r
+            replacer    an optional parameter that determines how object\r
+                        values are stringified for objects. It can be a\r
+                        function or an array of strings.\r
+\r
+            space       an optional parameter that specifies the indentation\r
+                        of nested structures. If it is omitted, the text will\r
+                        be packed without extra whitespace. If it is a number,\r
+                        it will specify the number of spaces to indent at each\r
+                        level. If it is a string (such as '\t' or '&nbsp;'),\r
+                        it contains the characters used to indent at each level.\r
+\r
+            This method produces a JSON text from a JavaScript value.\r
+\r
+            When an object value is found, if the object contains a toJSON\r
+            method, its toJSON method will be called and the result will be\r
+            stringified. A toJSON method does not serialize: it returns the\r
+            value represented by the name/value pair that should be serialized,\r
+            or undefined if nothing should be serialized. The toJSON method\r
+            will be passed the key associated with the value, and this will be\r
+            bound to the value\r
+\r
+            For example, this would serialize Dates as ISO strings.\r
+\r
+                Date.prototype.toJSON = function (key) {\r
+                    function f(n) {\r
+                        // Format integers to have at least two digits.\r
+                        return n < 10 ? '0' + n : n;\r
+                    }\r
+\r
+                    return this.getUTCFullYear()   + '-' +\r
+                         f(this.getUTCMonth() + 1) + '-' +\r
+                         f(this.getUTCDate())      + 'T' +\r
+                         f(this.getUTCHours())     + ':' +\r
+                         f(this.getUTCMinutes())   + ':' +\r
+                         f(this.getUTCSeconds())   + 'Z';\r
+                };\r
+\r
+            You can provide an optional replacer method. It will be passed the\r
+            key and value of each member, with this bound to the containing\r
+            object. The value that is returned from your method will be\r
+            serialized. If your method returns undefined, then the member will\r
+            be excluded from the serialization.\r
+\r
+            If the replacer parameter is an array of strings, then it will be\r
+            used to select the members to be serialized. It filters the results\r
+            such that only members with keys listed in the replacer array are\r
+            stringified.\r
+\r
+            Values that do not have JSON representations, such as undefined or\r
+            functions, will not be serialized. Such values in objects will be\r
+            dropped; in arrays they will be replaced with null. You can use\r
+            a replacer function to replace those with JSON values.\r
+            JSON.stringify(undefined) returns undefined.\r
+\r
+            The optional space parameter produces a stringification of the\r
+            value that is filled with line breaks and indentation to make it\r
+            easier to read.\r
+\r
+            If the space parameter is a non-empty string, then that string will\r
+            be used for indentation. If the space parameter is a number, then\r
+            the indentation will be that many spaces.\r
+\r
+            Example:\r
+\r
+            text = JSON.stringify(['e', {pluribus: 'unum'}]);\r
+            // text is '["e",{"pluribus":"unum"}]'\r
+\r
+\r
+            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');\r
+            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'\r
+\r
+            text = JSON.stringify([new Date()], function (key, value) {\r
+                return this[key] instanceof Date ?\r
+                    'Date(' + this[key] + ')' : value;\r
+            });\r
+            // text is '["Date(---current time---)"]'\r
+\r
+\r
+        JSON.parse(text, reviver)\r
+            This method parses a JSON text to produce an object or array.\r
+            It can throw a SyntaxError exception.\r
+\r
+            The optional reviver parameter is a function that can filter and\r
+            transform the results. It receives each of the keys and values,\r
+            and its return value is used instead of the original value.\r
+            If it returns what it received, then the structure is not modified.\r
+            If it returns undefined then the member is deleted.\r
+\r
+            Example:\r
+\r
+            // Parse the text. Values that look like ISO date strings will\r
+            // be converted to Date objects.\r
+\r
+            myData = JSON.parse(text, function (key, value) {\r
+                var a;\r
+                if (typeof value === 'string') {\r
+                    a =\r
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);\r
+                    if (a) {\r
+                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\r
+                            +a[5], +a[6]));\r
+                    }\r
+                }\r
+                return value;\r
+            });\r
+\r
+            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {\r
+                var d;\r
+                if (typeof value === 'string' &&\r
+                        value.slice(0, 5) === 'Date(' &&\r
+                        value.slice(-1) === ')') {\r
+                    d = new Date(value.slice(5, -1));\r
+                    if (d) {\r
+                        return d;\r
+                    }\r
+                }\r
+                return value;\r
+            });\r
+\r
+\r
+    This is a reference implementation. You are free to copy, modify, or\r
+    redistribute.\r
+*/\r
+\r
+/*jslint evil: true, strict: false, regexp: false */\r
+\r
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,\r
+    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\r
+    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\r
+    lastIndex, length, parse, prototype, push, replace, slice, stringify,\r
+    test, toJSON, toString, valueOf\r
+*/\r
+\r
+\r
+// Create a JSON object only if one does not already exist. We create the\r
+// methods in a closure to avoid creating global variables.\r
+\r
+var JSON = {};\r
+\r
+(function () {\r
+    "use strict";\r
+\r
+    function f(n) {\r
+        // Format integers to have at least two digits.\r
+        return n < 10 ? '0' + n : n;\r
+    }\r
+\r
+    if (typeof Date.prototype.toJSON !== 'function') {\r
+\r
+        Date.prototype.toJSON = function (key) {\r
+\r
+            return isFinite(this.valueOf()) ?\r
+                   this.getUTCFullYear()   + '-' +\r
+                 f(this.getUTCMonth() + 1) + '-' +\r
+                 f(this.getUTCDate())      + 'T' +\r
+                 f(this.getUTCHours())     + ':' +\r
+                 f(this.getUTCMinutes())   + ':' +\r
+                 f(this.getUTCSeconds())   + 'Z' : null;\r
+        };\r
+\r
+        String.prototype.toJSON =\r
+        Number.prototype.toJSON =\r
+        Boolean.prototype.toJSON = function (key) {\r
+            return this.valueOf();\r
+        };\r
+    }\r
+\r
+    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,\r
+        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,\r
+        gap,\r
+        indent,\r
+        meta = {    // table of character substitutions\r
+            '\b': '\\b',\r
+            '\t': '\\t',\r
+            '\n': '\\n',\r
+            '\f': '\\f',\r
+            '\r': '\\r',\r
+            '"' : '\\"',\r
+            '\\': '\\\\'\r
+        },\r
+        rep;\r
+\r
+\r
+    function quote(string) {\r
+\r
+// If the string contains no control characters, no quote characters, and no\r
+// backslash characters, then we can safely slap some quotes around it.\r
+// Otherwise we must also replace the offending characters with safe escape\r
+// sequences.\r
+\r
+        escapable.lastIndex = 0;\r
+        return escapable.test(string) ?\r
+            '"' + string.replace(escapable, function (a) {\r
+                var c = meta[a];\r
+                return typeof c === 'string' ? c :\r
+                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\r
+            }) + '"' :\r
+            '"' + string + '"';\r
+    }\r
+\r
+\r
+    function str(key, holder) {\r
+\r
+// Produce a string from holder[key].\r
+\r
+        var i,          // The loop counter.\r
+            k,          // The member key.\r
+            v,          // The member value.\r
+            length,\r
+            mind = gap,\r
+            partial,\r
+            value = holder[key];\r
+\r
+// If the value has a toJSON method, call it to obtain a replacement value.\r
+\r
+        if (value && typeof value === 'object' &&\r
+                typeof value.toJSON === 'function') {\r
+            value = value.toJSON(key);\r
+        }\r
+\r
+// If we were called with a replacer function, then call the replacer to\r
+// obtain a replacement value.\r
+\r
+        if (typeof rep === 'function') {\r
+            value = rep.call(holder, key, value);\r
+        }\r
+\r
+// What happens next depends on the value's type.\r
+\r
+        switch (typeof value) {\r
+        case 'string':\r
+            return quote(value);\r
+\r
+        case 'number':\r
+\r
+// JSON numbers must be finite. Encode non-finite numbers as null.\r
+\r
+            return isFinite(value) ? String(value) : 'null';\r
+\r
+        case 'boolean':\r
+        case 'null':\r
+\r
+// If the value is a boolean or null, convert it to a string. Note:\r
+// typeof null does not produce 'null'. The case is included here in\r
+// the remote chance that this gets fixed someday.\r
+\r
+            return String(value);\r
+\r
+// If the type is 'object', we might be dealing with an object or an array or\r
+// null.\r
+\r
+        case 'object':\r
+\r
+// Due to a specification blunder in ECMAScript, typeof null is 'object',\r
+// so watch out for that case.\r
+\r
+            if (!value) {\r
+                return 'null';\r
+            }\r
+\r
+// Make an array to hold the partial results of stringifying this object value.\r
+\r
+            gap += indent;\r
+            partial = [];\r
+\r
+// Is the value an array?\r
+\r
+            if (Object.prototype.toString.apply(value) === '[object Array]') {\r
+\r
+// The value is an array. Stringify every element. Use null as a placeholder\r
+// for non-JSON values.\r
+\r
+                length = value.length;\r
+                for (i = 0; i < length; i += 1) {\r
+                    partial[i] = str(i, value) || 'null';\r
+                }\r
+\r
+// Join all of the elements together, separated with commas, and wrap them in\r
+// brackets.\r
+\r
+                v = partial.length === 0 ? '[]' :\r
+                    gap ? '[\n' + gap +\r
+                            partial.join(',\n' + gap) + '\n' +\r
+                                mind + ']' :\r
+                          '[' + partial.join(',') + ']';\r
+                gap = mind;\r
+                return v;\r
+            }\r
+\r
+// If the replacer is an array, use it to select the members to be stringified.\r
+\r
+            if (rep && typeof rep === 'object') {\r
+                length = rep.length;\r
+                for (i = 0; i < length; i += 1) {\r
+                    k = rep[i];\r
+                    if (typeof k === 'string') {\r
+                        v = str(k, value);\r
+                        if (v) {\r
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);\r
+                        }\r
+                    }\r
+                }\r
+            } else {\r
+\r
+// Otherwise, iterate through all of the keys in the object.\r
+\r
+                for (k in value) {\r
+                    if (Object.hasOwnProperty.call(value, k)) {\r
+                        v = str(k, value);\r
+                        if (v) {\r
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+\r
+// Join all of the member texts together, separated with commas,\r
+// and wrap them in braces.\r
+\r
+            v = partial.length === 0 ? '{}' :\r
+                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +\r
+                        mind + '}' : '{' + partial.join(',') + '}';\r
+            gap = mind;\r
+            return v;\r
+        }\r
+    }\r
+\r
+// If the JSON object does not yet have a stringify method, give it one.\r
+\r
+    if (typeof JSON.stringify !== 'function') {\r
+        JSON.stringify = function (value, replacer, space) {\r
+\r
+// The stringify method takes a value and an optional replacer, and an optional\r
+// space parameter, and returns a JSON text. The replacer can be a function\r
+// that can replace values, or an array of strings that will select the keys.\r
+// A default replacer method can be provided. Use of the space parameter can\r
+// produce text that is more easily readable.\r
+\r
+            var i;\r
+            gap = '';\r
+            indent = '';\r
+\r
+// If the space parameter is a number, make an indent string containing that\r
+// many spaces.\r
+\r
+            if (typeof space === 'number') {\r
+                for (i = 0; i < space; i += 1) {\r
+                    indent += ' ';\r
+                }\r
+\r
+// If the space parameter is a string, it will be used as the indent string.\r
+\r
+            } else if (typeof space === 'string') {\r
+                indent = space;\r
+            }\r
+\r
+// If there is a replacer, it must be a function or an array.\r
+// Otherwise, throw an error.\r
+\r
+            rep = replacer;\r
+            if (replacer && typeof replacer !== 'function' &&\r
+                    (typeof replacer !== 'object' ||\r
+                     typeof replacer.length !== 'number')) {\r
+                throw new Error('JSON.stringify');\r
+            }\r
+\r
+// Make a fake root object containing our value under the key of ''.\r
+// Return the result of stringifying the value.\r
+\r
+            return str('', {'': value});\r
+        };\r
+    }\r
+\r
+\r
+// If the JSON object does not yet have a parse method, give it one.\r
+\r
+    if (typeof JSON.parse !== 'function') {\r
+        JSON.parse = function (text, reviver) {\r
+\r
+// The parse method takes a text and an optional reviver function, and returns\r
+// a JavaScript value if the text is a valid JSON text.\r
+\r
+            var j;\r
+\r
+            function walk(holder, key) {\r
+\r
+// The walk method is used to recursively walk the resulting structure so\r
+// that modifications can be made.\r
+\r
+                var k, v, value = holder[key];\r
+                if (value && typeof value === 'object') {\r
+                    for (k in value) {\r
+                        if (Object.hasOwnProperty.call(value, k)) {\r
+                            v = walk(value, k);\r
+                            if (v !== undefined) {\r
+                                value[k] = v;\r
+                            } else {\r
+                                delete value[k];\r
+                            }\r
+                        }\r
+                    }\r
+                }\r
+                return reviver.call(holder, key, value);\r
+            }\r
+\r
+\r
+// Parsing happens in four stages. In the first stage, we replace certain\r
+// Unicode characters with escape sequences. JavaScript handles many characters\r
+// incorrectly, either silently deleting them, or treating them as line endings.\r
+\r
+            text = String(text);\r
+            cx.lastIndex = 0;\r
+            if (cx.test(text)) {\r
+                text = text.replace(cx, function (a) {\r
+                    return '\\u' +\r
+                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\r
+                });\r
+            }\r
+\r
+// In the second stage, we run the text against regular expressions that look\r
+// for non-JSON patterns. We are especially concerned with '()' and 'new'\r
+// because they can cause invocation, and '=' because it can cause mutation.\r
+// But just to be safe, we want to reject all unexpected forms.\r
+\r
+// We split the second stage into 4 regexp operations in order to work around\r
+// crippling inefficiencies in IE's and Safari's regexp engines. First we\r
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we\r
+// replace all simple value tokens with ']' characters. Third, we delete all\r
+// open brackets that follow a colon or comma or that begin the text. Finally,\r
+// we look to see that the remaining characters are only whitespace or ']' or\r
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\r
+\r
+            if (/^[\],:{}\s]*$/\r
+.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')\r
+.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')\r
+.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {\r
+\r
+// In the third stage we use the eval function to compile the text into a\r
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity\r
+// in JavaScript: it can begin a block or an object literal. We wrap the text\r
+// in parens to eliminate the ambiguity.\r
+\r
+                j = eval('(' + text + ')');\r
+\r
+// In the optional fourth stage, we recursively walk the new structure, passing\r
+// each name/value pair to a reviver function for possible transformation.\r
+\r
+                return typeof reviver === 'function' ?\r
+                    walk({'': j}, '') : j;\r
+            }\r
+\r
+// If the text is not JSON parseable, then a SyntaxError is thrown.\r
+\r
+            throw new SyntaxError('JSON.parse');\r
+        };\r
+    }\r
+}());\r
+var assert = this.assert = {};\r
+var types = {};\r
+var core = {};\r
+var nodeunit = {};\r
+var reporter = {};\r
+/*global setTimeout: false, console: false */\r
+(function () {\r
+\r
+    var async = {};\r
+\r
+    // global on the server, window in the browser\r
+    var root = this,\r
+        previous_async = root.async;\r
+\r
+    if (typeof module !== 'undefined' && module.exports) {\r
+        module.exports = async;\r
+    }\r
+    else {\r
+        root.async = async;\r
+    }\r
+\r
+    async.noConflict = function () {\r
+        root.async = previous_async;\r
+        return async;\r
+    };\r
+\r
+    //// cross-browser compatiblity functions ////\r
+\r
+    var _forEach = function (arr, iterator) {\r
+        if (arr.forEach) {\r
+            return arr.forEach(iterator);\r
+        }\r
+        for (var i = 0; i < arr.length; i += 1) {\r
+            iterator(arr[i], i, arr);\r
+        }\r
+    };\r
+\r
+    var _map = function (arr, iterator) {\r
+        if (arr.map) {\r
+            return arr.map(iterator);\r
+        }\r
+        var results = [];\r
+        _forEach(arr, function (x, i, a) {\r
+            results.push(iterator(x, i, a));\r
+        });\r
+        return results;\r
+    };\r
+\r
+    var _reduce = function (arr, iterator, memo) {\r
+        if (arr.reduce) {\r
+            return arr.reduce(iterator, memo);\r
+        }\r
+        _forEach(arr, function (x, i, a) {\r
+            memo = iterator(memo, x, i, a);\r
+        });\r
+        return memo;\r
+    };\r
+\r
+    var _keys = function (obj) {\r
+        if (Object.keys) {\r
+            return Object.keys(obj);\r
+        }\r
+        var keys = [];\r
+        for (var k in obj) {\r
+            if (obj.hasOwnProperty(k)) {\r
+                keys.push(k);\r
+            }\r
+        }\r
+        return keys;\r
+    };\r
+\r
+    var _indexOf = function (arr, item) {\r
+        if (arr.indexOf) {\r
+            return arr.indexOf(item);\r
+        }\r
+        for (var i = 0; i < arr.length; i += 1) {\r
+            if (arr[i] === item) {\r
+                return i;\r
+            }\r
+        }\r
+        return -1;\r
+    };\r
+\r
+    //// exported async module functions ////\r
+\r
+    //// nextTick implementation with browser-compatible fallback ////\r
+    if (typeof process === 'undefined' || !(process.nextTick)) {\r
+        async.nextTick = function (fn) {\r
+            setTimeout(fn, 0);\r
+        };\r
+    }\r
+    else {\r
+        async.nextTick = process.nextTick;\r
+    }\r
+\r
+    async.forEach = function (arr, iterator, callback) {\r
+        if (!arr.length) {\r
+            return callback();\r
+        }\r
+        var completed = 0;\r
+        _forEach(arr, function (x) {\r
+            iterator(x, function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    completed += 1;\r
+                    if (completed === arr.length) {\r
+                        callback();\r
+                    }\r
+                }\r
+            });\r
+        });\r
+    };\r
+\r
+    async.forEachSeries = function (arr, iterator, callback) {\r
+        if (!arr.length) {\r
+            return callback();\r
+        }\r
+        var completed = 0;\r
+        var iterate = function () {\r
+            iterator(arr[completed], function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    completed += 1;\r
+                    if (completed === arr.length) {\r
+                        callback();\r
+                    }\r
+                    else {\r
+                        iterate();\r
+                    }\r
+                }\r
+            });\r
+        };\r
+        iterate();\r
+    };\r
+\r
+\r
+    var doParallel = function (fn) {\r
+        return function () {\r
+            var args = Array.prototype.slice.call(arguments);\r
+            return fn.apply(null, [async.forEach].concat(args));\r
+        };\r
+    };\r
+    var doSeries = function (fn) {\r
+        return function () {\r
+            var args = Array.prototype.slice.call(arguments);\r
+            return fn.apply(null, [async.forEachSeries].concat(args));\r
+        };\r
+    };\r
+\r
+\r
+    var _asyncMap = function (eachfn, arr, iterator, callback) {\r
+        var results = [];\r
+        arr = _map(arr, function (x, i) {\r
+            return {index: i, value: x};\r
+        });\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x.value, function (err, v) {\r
+                results[x.index] = v;\r
+                callback(err);\r
+            });\r
+        }, function (err) {\r
+            callback(err, results);\r
+        });\r
+    };\r
+    async.map = doParallel(_asyncMap);\r
+    async.mapSeries = doSeries(_asyncMap);\r
+\r
+\r
+    // reduce only has a series version, as doing reduce in parallel won't\r
+    // work in many situations.\r
+    async.reduce = function (arr, memo, iterator, callback) {\r
+        async.forEachSeries(arr, function (x, callback) {\r
+            iterator(memo, x, function (err, v) {\r
+                memo = v;\r
+                callback(err);\r
+            });\r
+        }, function (err) {\r
+            callback(err, memo);\r
+        });\r
+    };\r
+    // inject alias\r
+    async.inject = async.reduce;\r
+    // foldl alias\r
+    async.foldl = async.reduce;\r
+\r
+    async.reduceRight = function (arr, memo, iterator, callback) {\r
+        var reversed = _map(arr, function (x) {\r
+            return x;\r
+        }).reverse();\r
+        async.reduce(reversed, memo, iterator, callback);\r
+    };\r
+    // foldr alias\r
+    async.foldr = async.reduceRight;\r
+\r
+    var _filter = function (eachfn, arr, iterator, callback) {\r
+        var results = [];\r
+        arr = _map(arr, function (x, i) {\r
+            return {index: i, value: x};\r
+        });\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x.value, function (v) {\r
+                if (v) {\r
+                    results.push(x);\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            callback(_map(results.sort(function (a, b) {\r
+                return a.index - b.index;\r
+            }), function (x) {\r
+                return x.value;\r
+            }));\r
+        });\r
+    };\r
+    async.filter = doParallel(_filter);\r
+    async.filterSeries = doSeries(_filter);\r
+    // select alias\r
+    async.select = async.filter;\r
+    async.selectSeries = async.filterSeries;\r
+\r
+    var _reject = function (eachfn, arr, iterator, callback) {\r
+        var results = [];\r
+        arr = _map(arr, function (x, i) {\r
+            return {index: i, value: x};\r
+        });\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x.value, function (v) {\r
+                if (!v) {\r
+                    results.push(x);\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            callback(_map(results.sort(function (a, b) {\r
+                return a.index - b.index;\r
+            }), function (x) {\r
+                return x.value;\r
+            }));\r
+        });\r
+    };\r
+    async.reject = doParallel(_reject);\r
+    async.rejectSeries = doSeries(_reject);\r
+\r
+    var _detect = function (eachfn, arr, iterator, main_callback) {\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x, function (result) {\r
+                if (result) {\r
+                    main_callback(x);\r
+                }\r
+                else {\r
+                    callback();\r
+                }\r
+            });\r
+        }, function (err) {\r
+            main_callback();\r
+        });\r
+    };\r
+    async.detect = doParallel(_detect);\r
+    async.detectSeries = doSeries(_detect);\r
+\r
+    async.some = function (arr, iterator, main_callback) {\r
+        async.forEach(arr, function (x, callback) {\r
+            iterator(x, function (v) {\r
+                if (v) {\r
+                    main_callback(true);\r
+                    main_callback = function () {};\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            main_callback(false);\r
+        });\r
+    };\r
+    // any alias\r
+    async.any = async.some;\r
+\r
+    async.every = function (arr, iterator, main_callback) {\r
+        async.forEach(arr, function (x, callback) {\r
+            iterator(x, function (v) {\r
+                if (!v) {\r
+                    main_callback(false);\r
+                    main_callback = function () {};\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            main_callback(true);\r
+        });\r
+    };\r
+    // all alias\r
+    async.all = async.every;\r
+\r
+    async.sortBy = function (arr, iterator, callback) {\r
+        async.map(arr, function (x, callback) {\r
+            iterator(x, function (err, criteria) {\r
+                if (err) {\r
+                    callback(err);\r
+                }\r
+                else {\r
+                    callback(null, {value: x, criteria: criteria});\r
+                }\r
+            });\r
+        }, function (err, results) {\r
+            if (err) {\r
+                return callback(err);\r
+            }\r
+            else {\r
+                var fn = function (left, right) {\r
+                    var a = left.criteria, b = right.criteria;\r
+                    return a < b ? -1 : a > b ? 1 : 0;\r
+                };\r
+                callback(null, _map(results.sort(fn), function (x) {\r
+                    return x.value;\r
+                }));\r
+            }\r
+        });\r
+    };\r
+\r
+    async.auto = function (tasks, callback) {\r
+        callback = callback || function () {};\r
+        var keys = _keys(tasks);\r
+        if (!keys.length) {\r
+            return callback(null);\r
+        }\r
+\r
+        var completed = [];\r
+\r
+        var listeners = [];\r
+        var addListener = function (fn) {\r
+            listeners.unshift(fn);\r
+        };\r
+        var removeListener = function (fn) {\r
+            for (var i = 0; i < listeners.length; i += 1) {\r
+                if (listeners[i] === fn) {\r
+                    listeners.splice(i, 1);\r
+                    return;\r
+                }\r
+            }\r
+        };\r
+        var taskComplete = function () {\r
+            _forEach(listeners, function (fn) {\r
+                fn();\r
+            });\r
+        };\r
+\r
+        addListener(function () {\r
+            if (completed.length === keys.length) {\r
+                callback(null);\r
+            }\r
+        });\r
+\r
+        _forEach(keys, function (k) {\r
+            var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];\r
+            var taskCallback = function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    // stop subsequent errors hitting callback multiple times\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    completed.push(k);\r
+                    taskComplete();\r
+                }\r
+            };\r
+            var requires = task.slice(0, Math.abs(task.length - 1)) || [];\r
+            var ready = function () {\r
+                return _reduce(requires, function (a, x) {\r
+                    return (a && _indexOf(completed, x) !== -1);\r
+                }, true);\r
+            };\r
+            if (ready()) {\r
+                task[task.length - 1](taskCallback);\r
+            }\r
+            else {\r
+                var listener = function () {\r
+                    if (ready()) {\r
+                        removeListener(listener);\r
+                        task[task.length - 1](taskCallback);\r
+                    }\r
+                };\r
+                addListener(listener);\r
+            }\r
+        });\r
+    };\r
+\r
+    async.waterfall = function (tasks, callback) {\r
+        if (!tasks.length) {\r
+            return callback();\r
+        }\r
+        callback = callback || function () {};\r
+        var wrapIterator = function (iterator) {\r
+            return function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    var args = Array.prototype.slice.call(arguments, 1);\r
+                    var next = iterator.next();\r
+                    if (next) {\r
+                        args.push(wrapIterator(next));\r
+                    }\r
+                    else {\r
+                        args.push(callback);\r
+                    }\r
+                    async.nextTick(function () {\r
+                        iterator.apply(null, args);\r
+                    });\r
+                }\r
+            };\r
+        };\r
+        wrapIterator(async.iterator(tasks))();\r
+    };\r
+\r
+    async.parallel = function (tasks, callback) {\r
+        callback = callback || function () {};\r
+        if (tasks.constructor === Array) {\r
+            async.map(tasks, function (fn, callback) {\r
+                if (fn) {\r
+                    fn(function (err) {\r
+                        var args = Array.prototype.slice.call(arguments, 1);\r
+                        if (args.length <= 1) {\r
+                            args = args[0];\r
+                        }\r
+                        callback.call(null, err, args || null);\r
+                    });\r
+                }\r
+            }, callback);\r
+        }\r
+        else {\r
+            var results = {};\r
+            async.forEach(_keys(tasks), function (k, callback) {\r
+                tasks[k](function (err) {\r
+                    var args = Array.prototype.slice.call(arguments, 1);\r
+                    if (args.length <= 1) {\r
+                        args = args[0];\r
+                    }\r
+                    results[k] = args;\r
+                    callback(err);\r
+                });\r
+            }, function (err) {\r
+                callback(err, results);\r
+            });\r
+        }\r
+    };\r
+\r
+    async.series = function (tasks, callback) {\r
+        callback = callback || function () {};\r
+        if (tasks.constructor === Array) {\r
+            async.mapSeries(tasks, function (fn, callback) {\r
+                if (fn) {\r
+                    fn(function (err) {\r
+                        var args = Array.prototype.slice.call(arguments, 1);\r
+                        if (args.length <= 1) {\r
+                            args = args[0];\r
+                        }\r
+                        callback.call(null, err, args || null);\r
+                    });\r
+                }\r
+            }, callback);\r
+        }\r
+        else {\r
+            var results = {};\r
+            async.forEachSeries(_keys(tasks), function (k, callback) {\r
+                tasks[k](function (err) {\r
+                    var args = Array.prototype.slice.call(arguments, 1);\r
+                    if (args.length <= 1) {\r
+                        args = args[0];\r
+                    }\r
+                    results[k] = args;\r
+                    callback(err);\r
+                });\r
+            }, function (err) {\r
+                callback(err, results);\r
+            });\r
+        }\r
+    };\r
+\r
+    async.iterator = function (tasks) {\r
+        var makeCallback = function (index) {\r
+            var fn = function () {\r
+                if (tasks.length) {\r
+                    tasks[index].apply(null, arguments);\r
+                }\r
+                return fn.next();\r
+            };\r
+            fn.next = function () {\r
+                return (index < tasks.length - 1) ? makeCallback(index + 1): null;\r
+            };\r
+            return fn;\r
+        };\r
+        return makeCallback(0);\r
+    };\r
+\r
+    async.apply = function (fn) {\r
+        var args = Array.prototype.slice.call(arguments, 1);\r
+        return function () {\r
+            return fn.apply(\r
+                null, args.concat(Array.prototype.slice.call(arguments))\r
+            );\r
+        };\r
+    };\r
+\r
+    var _concat = function (eachfn, arr, fn, callback) {\r
+        var r = [];\r
+        eachfn(arr, function (x, cb) {\r
+            fn(x, function (err, y) {\r
+                r = r.concat(y || []);\r
+                cb(err);\r
+            });\r
+        }, function (err) {\r
+            callback(err, r);\r
+        });\r
+    };\r
+    async.concat = doParallel(_concat);\r
+    async.concatSeries = doSeries(_concat);\r
+\r
+    async.whilst = function (test, iterator, callback) {\r
+        if (test()) {\r
+            iterator(function (err) {\r
+                if (err) {\r
+                    return callback(err);\r
+                }\r
+                async.whilst(test, iterator, callback);\r
+            });\r
+        }\r
+        else {\r
+            callback();\r
+        }\r
+    };\r
+\r
+    async.until = function (test, iterator, callback) {\r
+        if (!test()) {\r
+            iterator(function (err) {\r
+                if (err) {\r
+                    return callback(err);\r
+                }\r
+                async.until(test, iterator, callback);\r
+            });\r
+        }\r
+        else {\r
+            callback();\r
+        }\r
+    };\r
+\r
+    async.queue = function (worker, concurrency) {\r
+        var workers = 0;\r
+        var tasks = [];\r
+        var q = {\r
+            concurrency: concurrency,\r
+            push: function (data, callback) {\r
+                tasks.push({data: data, callback: callback});\r
+                async.nextTick(q.process);\r
+            },\r
+            process: function () {\r
+                if (workers < q.concurrency && tasks.length) {\r
+                    var task = tasks.splice(0, 1)[0];\r
+                    workers += 1;\r
+                    worker(task.data, function () {\r
+                        workers -= 1;\r
+                        if (task.callback) {\r
+                            task.callback.apply(task, arguments);\r
+                        }\r
+                        q.process();\r
+                    });\r
+                }\r
+            },\r
+            length: function () {\r
+                return tasks.length;\r
+            }\r
+        };\r
+        return q;\r
+    };\r
+\r
+    var _console_fn = function (name) {\r
+        return function (fn) {\r
+            var args = Array.prototype.slice.call(arguments, 1);\r
+            fn.apply(null, args.concat([function (err) {\r
+                var args = Array.prototype.slice.call(arguments, 1);\r
+                if (typeof console !== 'undefined') {\r
+                    if (err) {\r
+                        if (console.error) {\r
+                            console.error(err);\r
+                        }\r
+                    }\r
+                    else if (console[name]) {\r
+                        _forEach(args, function (x) {\r
+                            console[name](x);\r
+                        });\r
+                    }\r
+                }\r
+            }]));\r
+        };\r
+    };\r
+    async.log = _console_fn('log');\r
+    async.dir = _console_fn('dir');\r
+    /*async.info = _console_fn('info');\r
+    async.warn = _console_fn('warn');\r
+    async.error = _console_fn('error');*/\r
+\r
+    async.memoize = function (fn, hasher) {\r
+        var memo = {};\r
+        hasher = hasher || function (x) {\r
+            return x;\r
+        };\r
+        return function () {\r
+            var args = Array.prototype.slice.call(arguments);\r
+            var callback = args.pop();\r
+            var key = hasher.apply(null, args);\r
+            if (key in memo) {\r
+                callback.apply(null, memo[key]);\r
+            }\r
+            else {\r
+                fn.apply(null, args.concat([function () {\r
+                    memo[key] = arguments;\r
+                    callback.apply(null, arguments);\r
+                }]));\r
+            }\r
+        };\r
+    };\r
+\r
+}());\r
+(function(exports){\r
+/**\r
+ * This file is based on the node.js assert module, but with some small\r
+ * changes for browser-compatibility\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ */\r
+\r
+\r
+/**\r
+ * Added for browser compatibility\r
+ */\r
+\r
+var _keys = function(obj){\r
+    if(Object.keys) return Object.keys(obj);\r
+    if (typeof obj != 'object' && typeof obj != 'function') {\r
+        throw new TypeError('-');\r
+    }\r
+    var keys = [];\r
+    for(var k in obj){\r
+        if(obj.hasOwnProperty(k)) keys.push(k);\r
+    }\r
+    return keys;\r
+};\r
+\r
+\r
+\r
+// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\r
+//\r
+// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\r
+//\r
+// Originally from narwhal.js (http://narwhaljs.org)\r
+// Copyright (c) 2009 Thomas Robinson <280north.com>\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining a copy\r
+// of this software and associated documentation files (the 'Software'), to\r
+// deal in the Software without restriction, including without limitation the\r
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\r
+// sell copies of the Software, and to permit persons to whom the Software is\r
+// furnished to do so, subject to the following conditions:\r
+//\r
+// The above copyright notice and this permission notice shall be included in\r
+// all copies or substantial portions of the Software.\r
+//\r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+\r
+\r
+var pSlice = Array.prototype.slice;\r
+\r
+// 1. The assert module provides functions that throw\r
+// AssertionError's when particular conditions are not met. The\r
+// assert module must conform to the following interface.\r
+\r
+var assert = exports;\r
+\r
+// 2. The AssertionError is defined in assert.\r
+// new assert.AssertionError({message: message, actual: actual, expected: expected})\r
+\r
+assert.AssertionError = function AssertionError (options) {\r
+  this.name = "AssertionError";\r
+  this.message = options.message;\r
+  this.actual = options.actual;\r
+  this.expected = options.expected;\r
+  this.operator = options.operator;\r
+  var stackStartFunction = options.stackStartFunction || fail;\r
+\r
+  if (Error.captureStackTrace) {\r
+    Error.captureStackTrace(this, stackStartFunction);\r
+  }\r
+};\r
+// code from util.inherits in node\r
+assert.AssertionError.super_ = Error;\r
+\r
+\r
+// EDITED FOR BROWSER COMPATIBILITY: replaced Object.create call\r
+// TODO: test what effect this may have\r
+var ctor = function () { this.constructor = assert.AssertionError; };\r
+ctor.prototype = Error.prototype;\r
+assert.AssertionError.prototype = new ctor();\r
+\r
+\r
+assert.AssertionError.prototype.toString = function() {\r
+  if (this.message) {\r
+    return [this.name+":", this.message].join(' ');\r
+  } else {\r
+    return [ this.name+":"\r
+           , JSON.stringify(this.expected )\r
+           , this.operator\r
+           , JSON.stringify(this.actual)\r
+           ].join(" ");\r
+  }\r
+};\r
+\r
+// assert.AssertionError instanceof Error\r
+\r
+assert.AssertionError.__proto__ = Error.prototype;\r
+\r
+// At present only the three keys mentioned above are used and\r
+// understood by the spec. Implementations or sub modules can pass\r
+// other keys to the AssertionError's constructor - they will be\r
+// ignored.\r
+\r
+// 3. All of the following functions must throw an AssertionError\r
+// when a corresponding condition is not met, with a message that\r
+// may be undefined if not provided.  All assertion methods provide\r
+// both the actual and expected values to the assertion error for\r
+// display purposes.\r
+\r
+function fail(actual, expected, message, operator, stackStartFunction) {\r
+  throw new assert.AssertionError({\r
+    message: message,\r
+    actual: actual,\r
+    expected: expected,\r
+    operator: operator,\r
+    stackStartFunction: stackStartFunction\r
+  });\r
+}\r
+\r
+// EXTENSION! allows for well behaved errors defined elsewhere.\r
+assert.fail = fail;\r
+\r
+// 4. Pure assertion tests whether a value is truthy, as determined\r
+// by !!guard.\r
+// assert.ok(guard, message_opt);\r
+// This statement is equivalent to assert.equal(true, guard,\r
+// message_opt);. To test strictly for the value true, use\r
+// assert.strictEqual(true, guard, message_opt);.\r
+\r
+assert.ok = function ok(value, message) {\r
+  if (!!!value) fail(value, true, message, "==", assert.ok);\r
+};\r
+\r
+// 5. The equality assertion tests shallow, coercive equality with\r
+// ==.\r
+// assert.equal(actual, expected, message_opt);\r
+\r
+assert.equal = function equal(actual, expected, message) {\r
+  if (actual != expected) fail(actual, expected, message, "==", assert.equal);\r
+};\r
+\r
+// 6. The non-equality assertion tests for whether two objects are not equal\r
+// with != assert.notEqual(actual, expected, message_opt);\r
+\r
+assert.notEqual = function notEqual(actual, expected, message) {\r
+  if (actual == expected) {\r
+    fail(actual, expected, message, "!=", assert.notEqual);\r
+  }\r
+};\r
+\r
+// 7. The equivalence assertion tests a deep equality relation.\r
+// assert.deepEqual(actual, expected, message_opt);\r
+\r
+assert.deepEqual = function deepEqual(actual, expected, message) {\r
+  if (!_deepEqual(actual, expected)) {\r
+    fail(actual, expected, message, "deepEqual", assert.deepEqual);\r
+  }\r
+};\r
+\r
+var Buffer = null;\r
+if (typeof require !== 'undefined' && typeof process !== 'undefined') {\r
+    try {\r
+        Buffer = require('buffer').Buffer;\r
+    }\r
+    catch (e) {\r
+        // May be a CommonJS environment other than Node.js\r
+        Buffer = null;\r
+    }\r
+}\r
+\r
+function _deepEqual(actual, expected) {\r
+  // 7.1. All identical values are equivalent, as determined by ===.\r
+  if (actual === expected) {\r
+    return true;\r
+  // 7.2. If the expected value is a Date object, the actual value is\r
+  // equivalent if it is also a Date object that refers to the same time.\r
+  } else if (actual instanceof Date && expected instanceof Date) {\r
+    return actual.getTime() === expected.getTime();\r
+\r
+  // 7.2.1 If the expcted value is a RegExp object, the actual value is\r
+  // equivalent if it is also a RegExp object that refers to the same source and options\r
+  } else if (actual instanceof RegExp && expected instanceof RegExp) {\r
+    return actual.source === expected.source &&\r
+           actual.global === expected.global &&\r
+           actual.ignoreCase === expected.ignoreCase &&\r
+           actual.multiline === expected.multiline;\r
+\r
+  } else if (Buffer && actual instanceof Buffer && expected instanceof Buffer) {\r
+    return (function() {\r
+      var i, len;\r
+\r
+      for (i = 0, len = expected.length; i < len; i++) {\r
+        if (actual[i] !== expected[i]) {\r
+          return false;\r
+        }\r
+      }\r
+      return actual.length === expected.length;\r
+    })();\r
+  // 7.3. Other pairs that do not both pass typeof value == "object",\r
+  // equivalence is determined by ==.\r
+  } else if (typeof actual != 'object' && typeof expected != 'object') {\r
+    return actual == expected;\r
+\r
+  // 7.4. For all other Object pairs, including Array objects, equivalence is\r
+  // determined by having the same number of owned properties (as verified\r
+  // with Object.prototype.hasOwnProperty.call), the same set of keys\r
+  // (although not necessarily the same order), equivalent values for every\r
+  // corresponding key, and an identical "prototype" property. Note: this\r
+  // accounts for both named and indexed properties on Arrays.\r
+  } else {\r
+    return objEquiv(actual, expected);\r
+  }\r
+}\r
+\r
+function isUndefinedOrNull (value) {\r
+  return value === null || value === undefined;\r
+}\r
+\r
+function isArguments (object) {\r
+  return Object.prototype.toString.call(object) == '[object Arguments]';\r
+}\r
+\r
+function objEquiv (a, b) {\r
+  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\r
+    return false;\r
+  // an identical "prototype" property.\r
+  if (a.prototype !== b.prototype) return false;\r
+  //~~~I've managed to break Object.keys through screwy arguments passing.\r
+  //   Converting to array solves the problem.\r
+  if (isArguments(a)) {\r
+    if (!isArguments(b)) {\r
+      return false;\r
+    }\r
+    a = pSlice.call(a);\r
+    b = pSlice.call(b);\r
+    return _deepEqual(a, b);\r
+  }\r
+  try{\r
+    var ka = _keys(a),\r
+      kb = _keys(b),\r
+      key, i;\r
+  } catch (e) {//happens when one is a string literal and the other isn't\r
+    return false;\r
+  }\r
+  // having the same number of owned properties (keys incorporates hasOwnProperty)\r
+  if (ka.length != kb.length)\r
+    return false;\r
+  //the same set of keys (although not necessarily the same order),\r
+  ka.sort();\r
+  kb.sort();\r
+  //~~~cheap key test\r
+  for (i = ka.length - 1; i >= 0; i--) {\r
+    if (ka[i] != kb[i])\r
+      return false;\r
+  }\r
+  //equivalent values for every corresponding key, and\r
+  //~~~possibly expensive deep test\r
+  for (i = ka.length - 1; i >= 0; i--) {\r
+    key = ka[i];\r
+    if (!_deepEqual(a[key], b[key] ))\r
+       return false;\r
+  }\r
+  return true;\r
+}\r
+\r
+// 8. The non-equivalence assertion tests for any deep inequality.\r
+// assert.notDeepEqual(actual, expected, message_opt);\r
+\r
+assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\r
+  if (_deepEqual(actual, expected)) {\r
+    fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);\r
+  }\r
+};\r
+\r
+// 9. The strict equality assertion tests strict equality, as determined by ===.\r
+// assert.strictEqual(actual, expected, message_opt);\r
+\r
+assert.strictEqual = function strictEqual(actual, expected, message) {\r
+  if (actual !== expected) {\r
+    fail(actual, expected, message, "===", assert.strictEqual);\r
+  }\r
+};\r
+\r
+// 10. The strict non-equality assertion tests for strict inequality, as determined by !==.\r
+// assert.notStrictEqual(actual, expected, message_opt);\r
+\r
+assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\r
+  if (actual === expected) {\r
+    fail(actual, expected, message, "!==", assert.notStrictEqual);\r
+  }\r
+};\r
+\r
+function expectedException(actual, expected) {\r
+  if (!actual || !expected) {\r
+    return false;\r
+  }\r
+\r
+  if (expected instanceof RegExp) {\r
+    return expected.test(actual.message || actual);\r
+  } else if (actual instanceof expected) {\r
+    return true;\r
+  } else if (expected.call({}, actual) === true) {\r
+    return true;\r
+  }\r
+\r
+  return false;\r
+}\r
+\r
+function _throws(shouldThrow, block, expected, message) {\r
+  var actual;\r
+\r
+  if (typeof expected === 'string') {\r
+    message = expected;\r
+    expected = null;\r
+  }\r
+\r
+  try {\r
+    block();\r
+  } catch (e) {\r
+    actual = e;\r
+  }\r
+\r
+  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\r
+            (message ? ' ' + message : '.');\r
+\r
+  if (shouldThrow && !actual) {\r
+    fail('Missing expected exception' + message);\r
+  }\r
+\r
+  if (!shouldThrow && expectedException(actual, expected)) {\r
+    fail('Got unwanted exception' + message);\r
+  }\r
+\r
+  if ((shouldThrow && actual && expected &&\r
+      !expectedException(actual, expected)) || (!shouldThrow && actual)) {\r
+    throw actual;\r
+  }\r
+}\r
+\r
+// 11. Expected to throw an error:\r
+// assert.throws(block, Error_opt, message_opt);\r
+\r
+assert.throws = function(block, /*optional*/error, /*optional*/message) {\r
+  _throws.apply(this, [true].concat(pSlice.call(arguments)));\r
+};\r
+\r
+// EXTENSION! This is annoying to write outside this module.\r
+assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {\r
+  _throws.apply(this, [false].concat(pSlice.call(arguments)));\r
+};\r
+\r
+assert.ifError = function (err) { if (err) {throw err;}};\r
+})(assert);\r
+(function(exports){\r
+/*!\r
+ * Nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ * Only code on that line will be removed, it's mostly to avoid requiring code\r
+ * that is node specific\r
+ */\r
+\r
+/**\r
+ * Module dependencies\r
+ */\r
+\r
+\r
+\r
+/**\r
+ * Creates assertion objects representing the result of an assert call.\r
+ * Accepts an object or AssertionError as its argument.\r
+ *\r
+ * @param {object} obj\r
+ * @api public\r
+ */\r
+\r
+exports.assertion = function (obj) {\r
+    return {\r
+        method: obj.method || '',\r
+        message: obj.message || (obj.error && obj.error.message) || '',\r
+        error: obj.error,\r
+        passed: function () {\r
+            return !this.error;\r
+        },\r
+        failed: function () {\r
+            return Boolean(this.error);\r
+        }\r
+    };\r
+};\r
+\r
+/**\r
+ * Creates an assertion list object representing a group of assertions.\r
+ * Accepts an array of assertion objects.\r
+ *\r
+ * @param {Array} arr\r
+ * @param {Number} duration\r
+ * @api public\r
+ */\r
+\r
+exports.assertionList = function (arr, duration) {\r
+    var that = arr || [];\r
+    that.failures = function () {\r
+        var failures = 0;\r
+        for (var i = 0; i < this.length; i += 1) {\r
+            if (this[i].failed()) {\r
+                failures += 1;\r
+            }\r
+        }\r
+        return failures;\r
+    };\r
+    that.passes = function () {\r
+        return that.length - that.failures();\r
+    };\r
+    that.duration = duration || 0;\r
+    return that;\r
+};\r
+\r
+/**\r
+ * Create a wrapper function for assert module methods. Executes a callback\r
+ * after it's complete with an assertion object representing the result.\r
+ *\r
+ * @param {Function} callback\r
+ * @api private\r
+ */\r
+\r
+var assertWrapper = function (callback) {\r
+    return function (new_method, assert_method, arity) {\r
+        return function () {\r
+            var message = arguments[arity - 1];\r
+            var a = exports.assertion({method: new_method, message: message});\r
+            try {\r
+                assert[assert_method].apply(null, arguments);\r
+            }\r
+            catch (e) {\r
+                a.error = e;\r
+            }\r
+            callback(a);\r
+        };\r
+    };\r
+};\r
+\r
+/**\r
+ * Creates the 'test' object that gets passed to every test function.\r
+ * Accepts the name of the test function as its first argument, followed by\r
+ * the start time in ms, the options object and a callback function.\r
+ *\r
+ * @param {String} name\r
+ * @param {Number} start\r
+ * @param {Object} options\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.test = function (name, start, options, callback) {\r
+    var expecting;\r
+    var a_list = [];\r
+\r
+    var wrapAssert = assertWrapper(function (a) {\r
+        a_list.push(a);\r
+        if (options.log) {\r
+            async.nextTick(function () {\r
+                options.log(a);\r
+            });\r
+        }\r
+    });\r
+\r
+    var test = {\r
+        done: function (err) {\r
+            if (expecting !== undefined && expecting !== a_list.length) {\r
+                var e = new Error(\r
+                    'Expected ' + expecting + ' assertions, ' +\r
+                    a_list.length + ' ran'\r
+                );\r
+                var a1 = exports.assertion({method: 'expect', error: e});\r
+                a_list.push(a1);\r
+                if (options.log) {\r
+                    async.nextTick(function () {\r
+                        options.log(a1);\r
+                    });\r
+                }\r
+            }\r
+            if (err) {\r
+                var a2 = exports.assertion({error: err});\r
+                a_list.push(a2);\r
+                if (options.log) {\r
+                    async.nextTick(function () {\r
+                        options.log(a2);\r
+                    });\r
+                }\r
+            }\r
+            var end = new Date().getTime();\r
+            async.nextTick(function () {\r
+                var assertion_list = exports.assertionList(a_list, end - start);\r
+                options.testDone(name, assertion_list);\r
+                callback(null, a_list);\r
+            });\r
+        },\r
+        ok: wrapAssert('ok', 'ok', 2),\r
+        same: wrapAssert('same', 'deepEqual', 3),\r
+        equals: wrapAssert('equals', 'equal', 3),\r
+        expect: function (num) {\r
+            expecting = num;\r
+        },\r
+        _assertion_list: a_list\r
+    };\r
+    // add all functions from the assert module\r
+    for (var k in assert) {\r
+        if (assert.hasOwnProperty(k)) {\r
+            test[k] = wrapAssert(k, k, assert[k].length);\r
+        }\r
+    }\r
+    return test;\r
+};\r
+\r
+/**\r
+ * Ensures an options object has all callbacks, adding empty callback functions\r
+ * if any are missing.\r
+ *\r
+ * @param {Object} opt\r
+ * @return {Object}\r
+ * @api public\r
+ */\r
+\r
+exports.options = function (opt) {\r
+    var optionalCallback = function (name) {\r
+        opt[name] = opt[name] || function () {};\r
+    };\r
+\r
+    optionalCallback('moduleStart');\r
+    optionalCallback('moduleDone');\r
+    optionalCallback('testStart');\r
+    optionalCallback('testDone');\r
+    //optionalCallback('log');\r
+\r
+    // 'done' callback is not optional.\r
+\r
+    return opt;\r
+};\r
+})(types);\r
+(function(exports){\r
+/*!\r
+ * Nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ * Only code on that line will be removed, it's mostly to avoid requiring code\r
+ * that is node specific\r
+ */\r
+\r
+/**\r
+ * Module dependencies\r
+ */\r
+\r
+\r
+\r
+/**\r
+ * Added for browser compatibility\r
+ */\r
+\r
+var _keys = function (obj) {\r
+    if (Object.keys) {\r
+        return Object.keys(obj);\r
+    }\r
+    var keys = [];\r
+    for (var k in obj) {\r
+        if (obj.hasOwnProperty(k)) {\r
+            keys.push(k);\r
+        }\r
+    }\r
+    return keys;\r
+};\r
+\r
+\r
+var _copy = function (obj) {\r
+    var nobj = {};\r
+    var keys = _keys(obj);\r
+    for (var i = 0; i <  keys.length; i += 1) {\r
+        nobj[keys[i]] = obj[keys[i]];\r
+    }\r
+    return nobj;\r
+};\r
+\r
+\r
+/**\r
+ * Runs a test function (fn) from a loaded module. After the test function\r
+ * calls test.done(), the callback is executed with an assertionList as its\r
+ * second argument.\r
+ *\r
+ * @param {String} name\r
+ * @param {Function} fn\r
+ * @param {Object} opt\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.runTest = function (name, fn, opt, callback) {\r
+    var options = types.options(opt);\r
+\r
+    options.testStart(name);\r
+    var start = new Date().getTime();\r
+    var test = types.test(name, start, options, callback);\r
+\r
+    try {\r
+        fn(test);\r
+    }\r
+    catch (e) {\r
+        test.done(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Takes an object containing test functions or other test suites as properties\r
+ * and runs each in series. After all tests have completed, the callback is\r
+ * called with a list of all assertions as the second argument.\r
+ *\r
+ * If a name is passed to this function it is prepended to all test and suite\r
+ * names that run within it.\r
+ *\r
+ * @param {String} name\r
+ * @param {Object} suite\r
+ * @param {Object} opt\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.runSuite = function (name, suite, opt, callback) {\r
+    suite = wrapGroup(suite);\r
+    var keys = _keys(suite);\r
+\r
+    async.concatSeries(keys, function (k, cb) {\r
+        var prop = suite[k], _name;\r
+\r
+        _name = name ? [].concat(name, k) : [k];\r
+        _name.toString = function () {\r
+            // fallback for old one\r
+            return this.join(' - ');\r
+        };\r
+\r
+        if (typeof prop === 'function') {\r
+            var in_name = false,\r
+                in_specific_test = (_name.toString() === opt.testFullSpec) ? true : false;\r
+            for (var i = 0; i < _name.length; i += 1) {\r
+                if (_name[i] === opt.testspec) {\r
+                    in_name = true;\r
+                }\r
+            }\r
+\r
+            if ((!opt.testFullSpec || in_specific_test) && (!opt.testspec || in_name)) {\r
+                if (opt.moduleStart) {\r
+                    opt.moduleStart();\r
+                }\r
+                exports.runTest(_name, suite[k], opt, cb);\r
+            }\r
+            else {\r
+                return cb();\r
+            }\r
+        }\r
+        else {\r
+            exports.runSuite(_name, suite[k], opt, cb);\r
+        }\r
+    }, callback);\r
+};\r
+\r
+/**\r
+ * Run each exported test function or test suite from a loaded module.\r
+ *\r
+ * @param {String} name\r
+ * @param {Object} mod\r
+ * @param {Object} opt\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.runModule = function (name, mod, opt, callback) {\r
+    var options = _copy(types.options(opt));\r
+\r
+    var _run = false;\r
+    var _moduleStart = options.moduleStart;\r
+\r
+    mod = wrapGroup(mod);\r
+\r
+    function run_once() {\r
+        if (!_run) {\r
+            _run = true;\r
+            _moduleStart(name);\r
+        }\r
+    }\r
+    options.moduleStart = run_once;\r
+\r
+    var start = new Date().getTime();\r
+\r
+    exports.runSuite(null, mod, options, function (err, a_list) {\r
+        var end = new Date().getTime();\r
+        var assertion_list = types.assertionList(a_list, end - start);\r
+        options.moduleDone(name, assertion_list);\r
+        if (nodeunit.complete) {\r
+            nodeunit.complete(name, assertion_list);\r
+        }\r
+        callback(null, a_list);\r
+    });\r
+};\r
+\r
+/**\r
+ * Treats an object literal as a list of modules keyed by name. Runs each\r
+ * module and finished with calling 'done'. You can think of this as a browser\r
+ * safe alternative to runFiles in the nodeunit module.\r
+ *\r
+ * @param {Object} modules\r
+ * @param {Object} opt\r
+ * @api public\r
+ */\r
+\r
+// TODO: add proper unit tests for this function\r
+exports.runModules = function (modules, opt) {\r
+    var all_assertions = [];\r
+    var options = types.options(opt);\r
+    var start = new Date().getTime();\r
+\r
+    async.concatSeries(_keys(modules), function (k, cb) {\r
+        exports.runModule(k, modules[k], options, cb);\r
+    },\r
+    function (err, all_assertions) {\r
+        var end = new Date().getTime();\r
+        options.done(types.assertionList(all_assertions, end - start));\r
+    });\r
+};\r
+\r
+\r
+/**\r
+ * Wraps a test function with setUp and tearDown functions.\r
+ * Used by testCase.\r
+ *\r
+ * @param {Function} setUp\r
+ * @param {Function} tearDown\r
+ * @param {Function} fn\r
+ * @api private\r
+ */\r
+\r
+var wrapTest = function (setUp, tearDown, fn) {\r
+    return function (test) {\r
+        var context = {};\r
+        if (tearDown) {\r
+            var done = test.done;\r
+            test.done = function (err) {\r
+                try {\r
+                    tearDown.call(context, function (err2) {\r
+                        if (err && err2) {\r
+                            test._assertion_list.push(\r
+                                types.assertion({error: err})\r
+                            );\r
+                            return done(err2);\r
+                        }\r
+                        done(err || err2);\r
+                    });\r
+                }\r
+                catch (e) {\r
+                    done(e);\r
+                }\r
+            };\r
+        }\r
+        if (setUp) {\r
+            setUp.call(context, function (err) {\r
+                if (err) {\r
+                    return test.done(err);\r
+                }\r
+                fn.call(context, test);\r
+            });\r
+        }\r
+        else {\r
+            fn.call(context, test);\r
+        }\r
+    };\r
+};\r
+\r
+\r
+/**\r
+ * Returns a serial callback from two functions.\r
+ *\r
+ * @param {Function} funcFirst\r
+ * @param {Function} funcSecond\r
+ * @api private\r
+ */\r
+\r
+var getSerialCallback = function (fns) {\r
+    if (!fns.length) {\r
+        return null;\r
+    }\r
+    return function (callback) {\r
+        var that = this;\r
+        var bound_fns = [];\r
+        for (var i = 0, len = fns.length; i < len; i++) {\r
+            (function (j) {\r
+                bound_fns.push(function () {\r
+                    return fns[j].apply(that, arguments);\r
+                });\r
+            })(i);\r
+        }\r
+        return async.series(bound_fns, callback);\r
+    };\r
+};\r
+\r
+\r
+/**\r
+ * Wraps a group of tests with setUp and tearDown functions.\r
+ * Used by testCase.\r
+ *\r
+ * @param {Object} group\r
+ * @param {Array} setUps - parent setUp functions\r
+ * @param {Array} tearDowns - parent tearDown functions\r
+ * @api private\r
+ */\r
+\r
+var wrapGroup = function (group, setUps, tearDowns) {\r
+    var tests = {};\r
+\r
+    var setUps = setUps ? setUps.slice(): [];\r
+    var tearDowns = tearDowns ? tearDowns.slice(): [];\r
+\r
+    if (group.setUp) {\r
+        setUps.push(group.setUp);\r
+        delete group.setUp;\r
+    }\r
+    if (group.tearDown) {\r
+        tearDowns.unshift(group.tearDown);\r
+        delete group.tearDown;\r
+    }\r
+\r
+    var keys = _keys(group);\r
+\r
+    for (var i = 0; i < keys.length; i += 1) {\r
+        var k = keys[i];\r
+        if (typeof group[k] === 'function') {\r
+            tests[k] = wrapTest(\r
+                getSerialCallback(setUps),\r
+                getSerialCallback(tearDowns),\r
+                group[k]\r
+            );\r
+        }\r
+        else if (typeof group[k] === 'object') {\r
+            tests[k] = wrapGroup(group[k], setUps, tearDowns);\r
+        }\r
+    }\r
+    return tests;\r
+};\r
+\r
+\r
+/**\r
+ * Backwards compatibility for test suites using old testCase API\r
+ */\r
+\r
+exports.testCase = function (suite) {\r
+    return suite;\r
+};\r
+})(core);\r
+(function(exports){\r
+/*!\r
+ * Nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ * Only code on that line will be removed, its mostly to avoid requiring code\r
+ * that is node specific\r
+ */\r
+\r
+\r
+/**\r
+ * NOTE: this test runner is not listed in index.js because it cannot be\r
+ * used with the command-line tool, only inside the browser.\r
+ */\r
+\r
+\r
+/**\r
+ * Reporter info string\r
+ */\r
+\r
+exports.info = "Browser-based test reporter";\r
+\r
+\r
+/**\r
+ * Run all tests within each module, reporting the results\r
+ *\r
+ * @param {Array} files\r
+ * @api public\r
+ */\r
+\r
+exports.run = function (modules, options) {\r
+    var start = new Date().getTime(), div;\r
+       options = options || {};\r
+       div = options.div || document.body;\r
+\r
+    function setText(el, txt) {\r
+        if ('innerText' in el) {\r
+            el.innerText = txt;\r
+        }\r
+        else if ('textContent' in el){\r
+            el.textContent = txt;\r
+        }\r
+    }\r
+\r
+    function getOrCreate(tag, id) {\r
+        var el = document.getElementById(id);\r
+        if (!el) {\r
+            el = document.createElement(tag);\r
+            el.id = id;\r
+            div.appendChild(el);\r
+        }\r
+        return el;\r
+    };\r
+\r
+    var header = getOrCreate('h1', 'nodeunit-header');\r
+    var banner = getOrCreate('h2', 'nodeunit-banner');\r
+    var userAgent = getOrCreate('h2', 'nodeunit-userAgent');\r
+    var tests = getOrCreate('ol', 'nodeunit-tests');\r
+    var result = getOrCreate('p', 'nodeunit-testresult');\r
+\r
+    setText(userAgent, navigator.userAgent);\r
+\r
+    nodeunit.runModules(modules, {\r
+        moduleStart: function (name) {\r
+            /*var mheading = document.createElement('h2');\r
+            mheading.innerText = name;\r
+            results.appendChild(mheading);\r
+            module = document.createElement('ol');\r
+            results.appendChild(module);*/\r
+        },\r
+        testDone: function (name, assertions) {\r
+            var test = document.createElement('li');\r
+            var strong = document.createElement('strong');\r
+            strong.innerHTML = name + ' <b style="color: black;">(' +\r
+                '<b class="fail">' + assertions.failures() + '</b>, ' +\r
+                '<b class="pass">' + assertions.passes() + '</b>, ' +\r
+                assertions.length +\r
+            ')</b>';\r
+            test.className = assertions.failures() ? 'fail': 'pass';\r
+            test.appendChild(strong);\r
+\r
+            var aList = document.createElement('ol');\r
+            aList.style.display = 'none';\r
+            test.onclick = function () {\r
+                var d = aList.style.display;\r
+                aList.style.display = (d == 'none') ? 'block': 'none';\r
+            };\r
+            for (var i=0; i<assertions.length; i++) {\r
+                var li = document.createElement('li');\r
+                var a = assertions[i];\r
+                if (a.failed()) {\r
+                    li.innerHTML = (a.message || a.method || 'no message') +\r
+                        '<pre>' + (a.error.stack || a.error) + '</pre>';\r
+                    li.className = 'fail';\r
+                }\r
+                else {\r
+                    li.innerHTML = a.message || a.method || 'no message';\r
+                    li.className = 'pass';\r
+                }\r
+                aList.appendChild(li);\r
+            }\r
+            test.appendChild(aList);\r
+            tests.appendChild(test);\r
+        },\r
+        done: function (assertions) {\r
+            var end = new Date().getTime();\r
+            var duration = end - start;\r
+\r
+            var failures = assertions.failures();\r
+            banner.className = failures ? 'fail': 'pass';\r
+\r
+            result.innerHTML = 'Tests completed in ' + duration +\r
+                ' milliseconds.<br/><span class="passed">' +\r
+                assertions.passes() + '</span> assertions of ' +\r
+                '<span class="all">' + assertions.length + '<span> passed, ' +\r
+                assertions.failures() + ' failed.';\r
+        }\r
+    });\r
+};\r
+})(reporter);\r
+nodeunit = core;\r
+nodeunit.assert = assert;\r
+nodeunit.reporter = reporter;\r
+nodeunit.run = reporter.run;\r
+return nodeunit; })();\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/numberformats.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/numberformats.proto
new file mode 100644 (file)
index 0000000..79a07f8
--- /dev/null
@@ -0,0 +1,18 @@
+enum Formats {\r
+    DEC = 1;\r
+    HEX = 0x1F;\r
+    OCT = 017;\r
+}\r
+\r
+message Msg {\r
+    required int32 dec = 1 [default=-1];\r
+    required int32 hex = 2 [default=-0x1F];\r
+    required int32 oct = 3 [default=-017];\r
+    required double exp = 4 [default=0.1e5];\r
+    required double nod = 5 [default=1.];\r
+    required double exn = 6 [default=1e8];\r
+    required double sp1 = 7 [default=inf];\r
+    required double sp2 = 8 [default=-inf];\r
+    required double sp3 = 9 [default=nan];\r
+    required int32 hexUC = 10 [default=0X209];\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/oneof.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/oneof.proto
new file mode 100644 (file)
index 0000000..52a618b
--- /dev/null
@@ -0,0 +1,6 @@
+message MyOneOf {\r
+    oneof my_oneof {\r
+        uint32 id = 1;\r
+        string name = 2;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/optional.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/optional.proto
new file mode 100644 (file)
index 0000000..92fbfc5
--- /dev/null
@@ -0,0 +1,12 @@
+message Test1 {\r
+    optional int32 a = 1;\r
+    optional Test2 b = 2;\r
+}\r
+\r
+message Test2 {\r
+    optional int32 c = 1;\r
+    optional Test3 d = 2;\r
+}\r
+\r
+message Test3 {\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/options.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/options.json
new file mode 100644 (file)
index 0000000..405450e
--- /dev/null
@@ -0,0 +1,32 @@
+{\r
+    "package": "My",\r
+    "messages": [\r
+        {\r
+            "name": "Test",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {\r
+                        "default": "Max"\r
+                    },\r
+                    "type": "string",\r
+                    "name": "name",\r
+                    "id": 1\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {\r
+                "(inmessage)": "My.Test",\r
+                "(foo.my_option).bar": false\r
+            }\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {\r
+        "(toplevel_1)": 10,\r
+        "(toplevel_2)": "Hello world!"\r
+    },\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/options.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/options.proto
new file mode 100644 (file)
index 0000000..f96da6d
--- /dev/null
@@ -0,0 +1,13 @@
+option (toplevel_1) = 10;\r
+package My;\r
+option (toplevel_2) = "Hello world!";\r
+\r
+message Test {\r
+    optional string name = 1 [default="Max"];\r
+    optional string desc1 = 2 [default="Shouldn't mix quotes"];\r
+    optional string desc2 = 3 [default='Shouldn"t mix quotes'];\r
+    optional string desc3 = 4 [(foo_options) = { opt1: 123 opt2: "baz" }];\r
+    optional string desc4 = 5 [(foo_options) = {options { opt1: 1234 opt2: "baz" } options { opt1: 4321 opt2: "foo" }} ];\r
+    option (inmessage) = My.Test;\r
+    option (foo.my_option).bar = false;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/packed.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/packed.proto
new file mode 100644 (file)
index 0000000..b9ee7a0
--- /dev/null
@@ -0,0 +1,4 @@
+message Message {\r
+    repeated int32 a = 1 [packed = true];\r
+    repeated int32 b = 2;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Bar.json b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Bar.json
new file mode 100644 (file)
index 0000000..3c4712a
--- /dev/null
@@ -0,0 +1,46 @@
+{\r
+    "package": null,\r
+    "messages": [\r
+        {\r
+            "ref": "Foo",\r
+            "fields": [\r
+                {\r
+                    "rule": "required",\r
+                    "type": "string",\r
+                    "name": "buzz",\r
+                    "id": 2,\r
+                    "options": {}\r
+                }\r
+            ]\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [\r
+        {\r
+            "package": null,\r
+            "messages": [\r
+                {\r
+                    "name": "Foo",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "required",\r
+                            "type": "string",\r
+                            "name": "fizz",\r
+                            "id": 1,\r
+                            "options": {}\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {}\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "imports": [],\r
+            "options": {},\r
+            "services": []\r
+        }\r
+    ],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Bar.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Bar.proto
new file mode 100644 (file)
index 0000000..309157b
--- /dev/null
@@ -0,0 +1,7 @@
+// Bar.proto\r
+import "Foo.proto";\r
+\r
+// really extend Bar but that produces an empty constructor. \r
+extend Foo {\r
+    required string buzz = 2;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Foo.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto2js/Foo.proto
new file mode 100644 (file)
index 0000000..f56944a
--- /dev/null
@@ -0,0 +1,4 @@
+// Foo.proto\r
+message Foo {\r
+    required string fizz = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto3.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/proto3.proto
new file mode 100644 (file)
index 0000000..9f99fbb
--- /dev/null
@@ -0,0 +1,7 @@
+syntax = "proto3";\r
+\r
+package test;\r
+\r
+message Foo {\r
+  int32 optional_int32 = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/protobufnet.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/protobufnet.proto
new file mode 100644 (file)
index 0000000..1d255c2
--- /dev/null
@@ -0,0 +1,19 @@
+message IMeshImp {\r
+}\r
+message Mesh {\r
+   optional IMeshImp _meshImp = 1;\r
+   repeated float3 _vertices = 2;\r
+   repeated uint32 _colors = 3;\r
+   repeated float3 _normals = 4;\r
+   repeated float2 _uvs = 5;\r
+   repeated int32 _triangles = 6;\r
+}\r
+message float2 {\r
+   optional float x = 1 [default = 0];\r
+   optional float y = 2 [default = 0];\r
+}\r
+message float3 {\r
+   optional float x = 1 [default = 0];\r
+   optional float y = 2 [default = 0];\r
+   optional float z = 3 [default = 0];\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/repeated.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/repeated.proto
new file mode 100644 (file)
index 0000000..4ed169b
--- /dev/null
@@ -0,0 +1,12 @@
+message Outer {\r
+       // As of: https://developers.google.com/protocol-buffers/docs/encoding#optional\r
+       \r
+       repeated Inner inner = 1;\r
+       // "If your message definition has repeated elements (without the [packed=true] option), the encoded message has\r
+       // zero or more key-value pairs with the same tag number."\r
+       \r
+}\r
+\r
+message Inner {\r
+       optional uint32 inner_value = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/services.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/services.js
new file mode 100644 (file)
index 0000000..c59995d
--- /dev/null
@@ -0,0 +1,39 @@
+var root = require("..").newBuilder({\r
+    "convertFieldsToCamelCase": true,\r
+    "populateAccessors": false\r
+})['import']({\r
+    "package": "my.namespace",\r
+    "messages": [\r
+        {\r
+            "name": "something",\r
+            "fields": [],\r
+            "messages": [\r
+                {\r
+                    "name": "v1",\r
+                    "fields": [],\r
+                    "messages": [\r
+                        {\r
+                            "name": "GetRequest",\r
+                            "fields": []\r
+                        },\r
+                        {\r
+                            "name": "GetResponse",\r
+                            "fields": []\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "services": [{\r
+                        "name": "SomeService",\r
+                        "rpc": {\r
+                            "get": {\r
+                                "request": "GetRequest",\r
+                                "response": "GetResponse"\r
+                            }\r
+                        }\r
+                    }]\r
+                }\r
+            ]\r
+        }\r
+    ]\r
+}).build();\r
+console.log(require("util").inspect(root, { depth: 10}));
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/setarray.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/setarray.proto
new file mode 100644 (file)
index 0000000..8bbcc32
--- /dev/null
@@ -0,0 +1,7 @@
+message Outer {\r
+    repeated Inner inners = 4;\r
+}\r
+\r
+message Inner {\r
+    required string str = 1;\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/string_single_quote.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/string_single_quote.proto
new file mode 100644 (file)
index 0000000..082cff8
--- /dev/null
@@ -0,0 +1,3 @@
+message TestSingleQuoteString {\r
+    required string a = 1 [ default = 'hello world' ];\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/suite.html b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/suite.html
new file mode 100644 (file)
index 0000000..ed15eaa
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <title>ProtoBuf.js Test Suite</title>\r
+    <link rel="stylesheet" href="nodeunit-browser/nodeunit.css" type="text/css" />\r
+    <script src="nodeunit-browser/nodeunit.js"></script>\r
+    <script src="https://raw.github.com/dcodeIO/Long.js/master/Long.min.js"></script>\r
+    <script src="https://raw.github.com/dcodeIO/ByteBuffer.js/master/ByteBuffer.min.js"></script>\r
+    <script src="../ProtoBuf.min.js"></script>\r
+    <script src="suite.js"></script>\r
+</head>\r
+<body>\r
+    <h1 id="nodeunit-header">ProtoBuf.js Test Suite</h1>\r
+    <script>nodeunit.run({ "suite": suite });</script>\r
+</body>\r
+</html>\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/suite.js b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/suite.js
new file mode 100644 (file)
index 0000000..da0b087
--- /dev/null
@@ -0,0 +1,2267 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+/**\r
+ * ProtoBuf.js Test Suite.\r
+ * @author Daniel Wirtz <dcode@dcode.io>\r
+ */\r
+(function(global) {\r
+\r
+    var FILE = "protobuf.js";\r
+    var BROWSER = !!global.window;\r
+    var StdOutFixture = require('fixture-stdout');\r
+    var fixture = new StdOutFixture();\r
+\r
+    var ProtoBuf = BROWSER ? global.dcodeIO.ProtoBuf : require(__dirname+"/../dist/"+FILE),\r
+        ByteBuffer = BROWSER ? global.dcodeIO.ByteBuffer : ByteBuffer || require("bytebuffer"),\r
+        util = BROWSER ? null : require("util"),\r
+        fs = BROWSER ? null : require("fs");\r
+\r
+        if (typeof __dirname == 'undefined') {\r
+            __dirname = document.location.href.replace(/[\/\\][^\/\\]*$/, "");\r
+        }\r
+\r
+    /**\r
+     * Constructs a new Sandbox for module loaders and shim testing.\r
+     * @param {Object.<string,*>} properties Additional properties to set\r
+     * @constructor\r
+     */\r
+    var Sandbox = function(properties) {\r
+        this.ByteBuffer = function() {};\r
+        for (var i in properties) {\r
+            this[i] = properties[i];\r
+        }\r
+        this.console = {\r
+            log: function(s) {\r
+                console.log(s);\r
+            }\r
+        };\r
+    };\r
+\r
+    function fail(e) {\r
+        throw(e);\r
+    }\r
+\r
+    /**\r
+     * Validates the complexDotProto and complexInline tests.\r
+     * @param {*} test Nodeunit test\r
+     * @param {Object} Game Game namespace\r
+     */\r
+    function validateComplex(test, Game) {\r
+        var Car = Game.Cars.Car,\r
+            Vendor = Car.Vendor,\r
+            Speed = Car.Speed;\r
+\r
+        var vendor;\r
+        // Car from class with argument list properties\r
+        var car = new Car(\r
+            "Rusty",\r
+            // Vendor from class with object properties\r
+            vendor = new Vendor({\r
+                "name": "Iron Inc.",\r
+                // Address from object\r
+                "address": {\r
+                    "country": "US"\r
+                },\r
+                "models": ["m1"]\r
+            }),\r
+            // Speed from enum object\r
+            Speed.SUPERFAST\r
+        );\r
+        test.equal(car.model, "Rusty");\r
+        test.equal(car.vendor.name, "Iron Inc.");\r
+        test.equal(car.vendor.address.country, "US");\r
+        test.equal(car.vendor.address.country, car.getVendor().get_address().country);\r
+        var bb = new ByteBuffer(32);\r
+        car.encode(bb);\r
+        test.equal(bb.flip().toString("debug"), "<0A 05 52 75 73 74 79 12 15 0A 09 49 72 6F 6E 20 49 6E 63 2E 12 04 0A 02 55 53 1A 02 6D 31 18 02>");\r
+        var carDec = Car.decode(bb);\r
+        test.equal(carDec.model, "Rusty");\r
+        test.equal(carDec.vendor.name, "Iron Inc.");\r
+        test.equal(carDec.vendor.address.country, "US");\r
+        test.equal(carDec.vendor.address.country, carDec.getVendor().get_address().country);\r
+        test.equal(carDec.vendor.models[0], "m1");\r
+    }\r
+\r
+    /**\r
+     * Test suite.\r
+     * @type {Object.<string,function>}\r
+     */\r
+    var suite = {\r
+\r
+        "init": function(test) {\r
+            test.ok(typeof ProtoBuf == "object");\r
+            test.ok(typeof ProtoBuf.Reflect == 'object');\r
+            test.ok(typeof ProtoBuf.loadProto == "function");\r
+            test.ok(typeof ProtoBuf.loadProtoFile == "function");\r
+            test.strictEqual(ProtoBuf.loadProto, ProtoBuf.protoFromString);\r
+            test.strictEqual(ProtoBuf.loadProtoFile, ProtoBuf.protoFromFile);\r
+            test.ok(ProtoBuf.ByteBuffer);\r
+            test.done();\r
+        },\r
+\r
+        "IS_NODE": function(test) {\r
+            test.ok(ProtoBuf.Util.IS_NODE);\r
+            test.done();\r
+        },\r
+\r
+        // Example "A Simple Message" from the protobuf docs\r
+        // https://developers.google.com/protocol-buffers/docs/encoding#simple\r
+        "example1": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example1.proto");\r
+                var Test1 = builder.build("Test1");\r
+                test.ok(typeof Test1 == 'function');\r
+                var inst = new Test1(150);\r
+                test.ok(inst instanceof ProtoBuf.Builder.Message);\r
+                test.equal(inst.a, 150);\r
+                test.equal(inst.getA(), 150);\r
+                test.equal(inst.get_a(), 150);\r
+                inst.setA(151);\r
+                test.equal(inst.a, 151);\r
+                test.equal(inst.getA(), 151);\r
+                test.equal(inst.get_a(), 151);\r
+                inst.set_a(152);\r
+                test.equal(inst.a, 152);\r
+                test.equal(inst.toString(), ".Test1");\r
+                test.throws(function() {\r
+                    inst.setA(null); // required\r
+                });\r
+                test.throws(function() {\r
+                    inst.setA([]);\r
+                });\r
+                var size = inst.calculate();\r
+                var bb = new ByteBuffer(3);\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<08 98 01>");\r
+                var instDec = Test1.decode(bb);\r
+                test.equal(instDec.a, 152);\r
+\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Basically the same as example1, but with an unsigned value.\r
+        "example1u": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example1u.proto");\r
+                var Test1u = builder.build("Test1u");\r
+                test.ok(typeof Test1u == 'function');\r
+                var inst = new Test1u(-1);\r
+                test.strictEqual(inst.a, 4294967295);\r
+                var bb = new ByteBuffer(6);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<08 FF FF FF FF 0F>");\r
+                var instDec = Test1u.decode(bb);\r
+                test.strictEqual(instDec.a, 4294967295);\r
+\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Example "Strings" from the protobuf docs\r
+        // https://developers.google.com/protocol-buffers/docs/encoding#types\r
+        "example2": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example2.proto");\r
+                var Test2 = builder.build("Test2");\r
+                var inst = new Test2("testing");\r
+                var bb = new ByteBuffer(9);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<12 07 74 65 73 74 69 6E 67>");\r
+                var instDec = Test2.decode(bb);\r
+                test.equal(instDec.b, "testing");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Example "Embedded Messages" from the protobuf docs\r
+        // https://developers.google.com/protocol-buffers/docs/encoding#embedded\r
+        "example3": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example3.proto");\r
+                var root = builder.build();\r
+                var Test1 = root.Test1;\r
+                var Test3 = root.Test3;\r
+                var inst = new Test3(new Test1(150));\r
+                var bb = new ByteBuffer(5);\r
+                test.equal(inst.c.a, 150);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<1A 03 08 96 01>");\r
+                var instDec = Test3.decode(bb);\r
+                test.equal(instDec.c.a, 150);\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "example4": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example4.proto");\r
+                var Test4 = builder.build("Test4");\r
+                var inst = new Test4([3, 270, 86942]);\r
+                var bb = new ByteBuffer(8);\r
+                test.equal(inst.d.length, 3);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<22 06 03 8E 02 9E A7 05>");\r
+                var instDec = Test4.decode(bb);\r
+                test.equal(bb.toString("debug"), "22 06 03 8E 02 9E A7 05|");\r
+                test.equal(instDec.d.length, 3);\r
+                test.equal(instDec.d[2], 86942);\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "example5": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example5.proto");\r
+                builder.build();\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "constructor": function(test) {\r
+            var builder = ProtoBuf.loadProtoFile(__dirname+"/example1.proto");\r
+            var Test1 = builder.build("Test1");\r
+            var t1 = new Test1(123),\r
+                t2 = new Test1({a: 123}),\r
+                t3 = new Test1(t1);\r
+            test.deepEqual(t1, t2);\r
+            test.deepEqual(t2, t3);\r
+            test.done();\r
+        },\r
+        \r
+        "constructorWithOneofs": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/oneof.proto"),\r
+                    MyOneOf = builder.build("MyOneOf"),\r
+                    TOneOf = builder.lookup(".MyOneOf");\r
+                test.ok(TOneOf.getChild("my_oneof"));\r
+                \r
+                var myOneOf = new MyOneOf();\r
+                test.strictEqual(myOneOf.my_oneof, null);\r
+                myOneOf.set("id", 1);\r
+                test.strictEqual(myOneOf.my_oneof, "id");\r
+                myOneOf.set("name", "me");\r
+                test.strictEqual(myOneOf.my_oneof, "name");\r
+                test.strictEqual(myOneOf.id, null);\r
+                \r
+                var copy = new MyOneOf(myOneOf); // this line is what was failing\r
+                // Error: .MyOneOf#my_oneof is not a field: undefined\r
+                \r
+                test.deepEqual(myOneOf, copy);\r
+                \r
+                // Test same things are there\r
+                test.strictEqual(copy.my_oneof, "name");\r
+                test.strictEqual(copy.name, "me");\r
+                test.strictEqual(copy.id, null);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "numberFormats": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/numberformats.proto");\r
+                var Formats = builder.build("Formats");\r
+                test.strictEqual(Formats.DEC, 1);\r
+                test.strictEqual(Formats.HEX, 31);\r
+                test.strictEqual(Formats.OCT, 15);\r
+                var Msg = builder.build("Msg");\r
+                var msg = new Msg();\r
+                test.strictEqual(msg.dec, -1);\r
+                test.strictEqual(msg.hex, -31);\r
+                test.strictEqual(msg.hexUC, 521);\r
+                test.strictEqual(msg.oct, -15);\r
+                test.strictEqual(msg.exp, 0.1e5);\r
+                test.strictEqual(msg.nod, 1.);\r
+                test.strictEqual(msg.exn, 1e8);\r
+                test.strictEqual(msg.sp1, Infinity);\r
+                test.strictEqual(msg.sp2, -Infinity);\r
+                test.ok(isNaN(msg.sp3));\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Check encode/decode against a table of known correct pairs.\r
+        // Note that javascript ArrayBuffer does not support signed Zero or NaN\r
+        // bertdouglas (https://github.com/bertdouglas)\r
+        "float": function(test) {\r
+            try {\r
+                var str_proto = "message Float {"\r
+                    + " required float f = 1;"\r
+                    + "}";\r
+                var builder = ProtoBuf.loadProto(str_proto);\r
+                var root = builder.build();\r
+                var Float = root.Float;\r
+\r
+                var in_tolerance = function (reference,actual) {\r
+                    var tol = 1e-6;\r
+                    var scale = 1.0;\r
+                    if (reference != 0.0 ) {\r
+                        scale = reference;\r
+                    };\r
+                    var err = Math.abs(reference - actual)/scale;\r
+                    return err < tol;\r
+                };\r
+\r
+                var f_vals = [\r
+                    // hex values are shown here in big-endian following IEEE754 notation\r
+                    // protobuf is little-endian\r
+                    // { f: -0.0 , b: "80 00 00 00" },\r
+                    { f: +0.0 , b: "00 00 00 00" },\r
+                    { f: -1e-10 , b: "AE DB E6 FF" },\r
+                    { f: +1e-10 , b: "2E DB E6 FF" },\r
+                    { f: -2e+10 , b: "D0 95 02 F9" },\r
+                    { f: +2e+10 , b: "50 95 02 F9" },\r
+                    { f: -3e-30 , b: "8E 73 63 90" },\r
+                    { f: +3e-30 , b: "0E 73 63 90" },\r
+                    { f: -4e+30 , b: "F2 49 F2 CA" },\r
+                    { f: +4e+30 , b: "72 49 F2 CA" },\r
+                    { f: -123456789.0 , b: "CC EB 79 A3" },\r
+                    { f: +123456789.0 , b: "4C EB 79 A3" },\r
+                    { f: -0.987654321 , b: "BF 7C D6 EA" },\r
+                    { f: +0.987654321 , b: "3F 7C D6 EA" },\r
+                    { f: -Infinity , b: "FF 80 00 00" },\r
+                    { f: +Infinity , b: "7F 80 00 00" }\r
+                    // { f: -NaN , b: "FF C0 00 00>" },\r
+                    // { f: +NaN , b: "7F C0 00 00" }\r
+                ];\r
+\r
+                f_vals.map( function(x) {\r
+                    // check encode\r
+                    var m1 = new Float();\r
+                    var b1 = new ByteBuffer();\r
+                    m1.f = x.f;\r
+                    m1.encode(b1);\r
+                    var q1 = b1.slice(1,5).compact().reverse();\r
+                    test.strictEqual('<' + x.b + '>', q1.toString("debug"));\r
+\r
+                    // check decode\r
+                    var b2 = new ByteBuffer();\r
+                    var s1 = x.b + ' 0D';\r
+                    var s2 = s1.split(" ");\r
+                    var s3 = s2.reverse();\r
+                    var i1 = s3.map(function(y) { return parseInt(y,16) } );\r
+                    i1.map(function(y) { b2.writeUint8(y) });\r
+                    b2.limit = b2.offset;\r
+                    b2.offset = 0;\r
+                    var m2 = Float.decode(b2);\r
+\r
+                    var s4 = "" + x.f +" " + m2.f;\r
+                    if ( isNaN(x.f) ) {\r
+                        test.ok( isNaN(m2.f), s4 );\r
+                    }\r
+                    else if ( ! isFinite( x.f) ) {\r
+                        test.ok( x.f === m2.f, s4 );\r
+                    }\r
+                    else {\r
+                        test.ok( in_tolerance(x.f, m2.f), s4 );\r
+                    }\r
+                });\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "bytes": function(test) {\r
+            try {\r
+                var str_proto = "message Test { required bytes b = 1; }";\r
+                var builder = ProtoBuf.loadProto(str_proto);\r
+                var Test = builder.build("Test");\r
+                var bb = new ByteBuffer(4).writeUint32(0x12345678).flip();\r
+                var myTest = new Test(bb);\r
+                test.strictEqual(myTest.b.array, bb.array);\r
+                var bb2 = new ByteBuffer(6);\r
+                var size = myTest.calculate();\r
+                myTest.encode(bb2);\r
+                test.strictEqual(bb2.offset, size);\r
+                test.equal(bb2.flip().toString("debug"), "<0A 04 12 34 56 78>");\r
+                myTest = Test.decode(bb2);\r
+                test.equal(myTest.b.BE().readUint32(), 0x12345678);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "bytesFromFile": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Image { required bytes data = 1; }"),\r
+                    Image = builder.build("Image"),\r
+                    data = fs.readFileSync(__dirname+"/../protobuf.png"),\r
+                    image = new Image({ data: data }),\r
+                    bb = image.encode(),\r
+                    imageDec = Image.decode(bb),\r
+                    dataDec = imageDec.data.toBuffer();\r
+                test.strictEqual(data.length, dataDec.length);\r
+                test.deepEqual(data, dataDec);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "notEnoughBytes": function(test) {\r
+            var builder = ProtoBuf.loadProto("message Test { required bytes b = 1; }");\r
+            var Test = builder.build("Test");\r
+            var bb = new ByteBuffer().writeUint32(0x12345678).flip();\r
+            var encoded = new ByteBuffer(6);\r
+            new Test(bb).encode(encoded);\r
+            test.equal(encoded.flip().toString("debug"), "<0A 04 12 34 56 78>");\r
+            encoded = encoded.slice(0, 5); // chop off the last byte\r
+            var err = null;\r
+            try {\r
+                Test.decode(encoded);\r
+            } catch (caught) {\r
+                err = caught;\r
+            }\r
+            test.ok(err && err.message && err.message.indexOf(": 4 required but got only 3") >= 0);\r
+            test.done();\r
+        },\r
+\r
+        "bool": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test { optional bool ok = 1 [ default = false ]; }"),\r
+                    Test = builder.build("Test"),\r
+                    t =  new Test();\r
+                test.strictEqual(t.ok, null); // Not set as it is optional\r
+                t.setOk(true);\r
+                test.strictEqual(t.ok, true);\r
+                test.strictEqual(Test.decode(t.encode()).ok, true);\r
+                t.setOk(false);\r
+                test.strictEqual(t.ok, false);\r
+                t.setOk(null); // Not set\r
+                test.strictEqual(Test.decode(t.encode()).ok, false); // = default when missing\r
+            } catch (err) {\r
+                fail(err);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // As mentioned by Bill Katz\r
+        "T139": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/T139.proto");\r
+                var T139 = builder.build("T139");\r
+                test.ok(typeof T139 == 'function');\r
+                var inst = new T139(139,139);\r
+                test.equal(inst.a, 139);\r
+                test.equal(inst.b, 139);\r
+                inst.setA(139);\r
+                inst.setB(139);\r
+                test.equal(inst.a, 139);\r
+                test.equal(inst.b, 139);\r
+                var bb = new ByteBuffer(3);\r
+                inst.encode(bb);\r
+                test.equal(bb.flip().toString("debug"), "<08 8B 01 10 8B 01>");\r
+                var instDec = T139.decode(bb);\r
+                test.equal(instDec.a, 139);\r
+                test.equal(instDec.b, 139);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "emptyDefaultString": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test1 { required string test = 1 [default = \"\"]; }");\r
+                var Test1;\r
+                test.doesNotThrow(function() {\r
+                    Test1 = builder.build("Test1");\r
+                });\r
+                var test1 = new Test1();\r
+                test.strictEqual(test1.test, "");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "trailingSemicolon": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test1 { optional string test = 1; };");\r
+                test.doesNotThrow(function() {\r
+                    var Test1 = builder.build("Test1");\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "inner": {\r
+\r
+            "longstr": function(test) {\r
+                try {\r
+                    var builder = ProtoBuf.loadProto("message Test { required Inner a = 1; message Inner { required string b = 1; } }");\r
+                    var Test = builder.build("Test");\r
+                    var t = new Test();\r
+                    var data = "0123456789"; // 10: 20, 40, 80, 160, 320 bytes\r
+                    for (var i=0; i<5; i++) data += data;\r
+                    test.equal(data.length, 320);\r
+                    t.a = new Test.Inner(data);\r
+                    var bb = t.encode();\r
+                    var t2 = Test.decode(bb);\r
+                    test.equal(t2.a.b.length, 320);\r
+                    test.equal(data, t2.a.b);\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            },\r
+\r
+            "multiple": function(test) {\r
+                try {\r
+                    var str = "";\r
+                    for (var i=0; i<200; i++) str += 'a';\r
+                    var builder = ProtoBuf.loadProtoFile(__dirname+"/inner.proto");\r
+                    var fooCls = builder.build("Foo");\r
+                    var barCls = builder.build("Bar");\r
+                    var bazCls = builder.build("Baz");\r
+                    var foo = new fooCls(new barCls(str), new bazCls(str));\r
+                    var fooEncoded = foo.encode();\r
+                    test.doesNotThrow(function() {\r
+                        fooCls.decode(fooEncoded);\r
+                    });\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            },\r
+\r
+            "float": function(test) {\r
+                try {\r
+                    var builder = ProtoBuf.loadProto("message Foo { required Bar bar = 1; } message Bar { required float baz = 1; }");\r
+                    var root = builder.build();\r
+                    var foo = new root.Foo(new root.Bar(4));\r
+                    var bb = foo.encode();\r
+                    var foo2 = root.Foo.decode(bb);\r
+                    test.equal(foo.bar.baz, 4);\r
+                    test.equal(foo2.bar.baz, foo.bar.baz);\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            }\r
+\r
+        },\r
+\r
+        "truncated": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test { required int32 a = 1; required int32 b = 2; }");\r
+                var Test = builder.build("Test");\r
+                var t = new Test(), bb = new ByteBuffer(2);\r
+                t.setA(1);\r
+                try {\r
+                    bb = t.encode(bb).flip();\r
+                    test.ok(false);\r
+                } catch (e) {\r
+                    test.ok(e.encoded);\r
+                    bb = e.encoded.flip();\r
+                    test.equal(bb.toString("debug"), "<08 01>");\r
+                }\r
+                var t2;\r
+                try /* to decode truncated message */ {\r
+                    t2 = Test.decode(bb);\r
+                    test.ok(false); // ^ throws\r
+                } catch (e) {\r
+                    // But still be able to access the rest\r
+                    var t3 = e.decoded;\r
+                    test.strictEqual(t3.a, 1);\r
+                    test.strictEqual(t3.b, null);\r
+                }\r
+                test.strictEqual(t2, undefined);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Options on all levels\r
+        "options": {\r
+\r
+            "parse": function(test) {\r
+                try {\r
+                    var parser = new ProtoBuf.DotProto.Parser(ProtoBuf.Util.fetch(__dirname+"/options.proto"));\r
+                    var root = parser.parse();\r
+                    test.equal(root["package"], "My");\r
+                    test.strictEqual(root["options"]["(toplevel_1)"], 10);\r
+                    test.equal(root["options"]["(toplevel_2)"], "Hello world!");\r
+                    var opt = root["messages"][0]["fields"][0]["options"];\r
+                    test.equal(opt["default"], "Max");\r
+                    opt = root["messages"][0]["options"];\r
+                    test.strictEqual(opt["(inmessage)"], "My.Test");\r
+                    test.strictEqual(opt["(foo.my_option).bar"], false);\r
+                    opt = root["messages"][0]["fields"][1]["options"];\r
+                    test.strictEqual(opt["default"], "Shouldn't mix quotes");\r
+                    opt = root["messages"][0]["fields"][2]["options"];\r
+                    test.strictEqual(opt["default"], 'Shouldn"t mix quotes');\r
+                    opt = root["messages"][0]["fields"][3]["options"];\r
+                    test.strictEqual(opt["(foo_options).opt1"], 123);\r
+                    test.strictEqual(opt["(foo_options).opt2"], "baz");\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            },\r
+\r
+            "export": function(test) {\r
+                try {\r
+                    var builder = ProtoBuf.loadProtoFile(__dirname+"/options.proto");\r
+                    var My = builder.build("My");\r
+                    test.deepEqual(My.$options, {\r
+                        "(toplevel_1)": 10,\r
+                        "(toplevel_2)": "Hello world!"\r
+                    });\r
+                    test.strictEqual(My.$options['(toplevel_1)'], 10);\r
+                    test.deepEqual(My.Test.$options, {\r
+                        "(inmessage)": "My.Test",\r
+                        "(foo.my_option).bar": false\r
+                    });\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            }\r
+        },\r
+\r
+        // Comments\r
+        "comments": function(test) {\r
+            try {\r
+                var tn = new ProtoBuf.DotProto.Tokenizer(ProtoBuf.Util.fetch(__dirname+'/comments.proto'));\r
+                var token, tokens = [];\r
+                do {\r
+                    token = tn.next();\r
+                    tokens.push(token);\r
+                } while (token !== null);\r
+                test.deepEqual(tokens, ['message', 'TestC', '{', 'required', 'int32', 'a', '=', '1', ';', '}', null]);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // A more or less complex proto with type references\r
+        "complexProto": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/complex.proto");\r
+                validateComplex(test, builder.build("Game"));\r
+                var TCars = builder.lookup("Game.Cars");\r
+                test.strictEqual(TCars.fqn(), ".Game.Cars");\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // The same created without calling upon the parser to do so\r
+        "complexJSON": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadJsonFile(__dirname+"/complex.json");\r
+                validateComplex(test, builder.build("Game"));\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Test error messages\r
+        "errorMessage": function(test) {\r
+            test.throws(function() {\r
+                var builder = ProtoBuf.loadJsonFile(__dirname+"/complex.json");\r
+                var Game = builder.build("Game");\r
+                var car = new Game.Cars.Car();\r
+                car.speed = "hello";\r
+                car.encode();\r
+            }, /Illegal value for speed/);\r
+            test.done();\r
+        },\r
+\r
+        // Builder reused to add definitions from multiple sources\r
+        "multiBuilder": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example1.proto");\r
+                ProtoBuf.loadProtoFile(__dirname+"/example2.proto", builder);\r
+                var ns = builder.build();\r
+                test.ok(!!ns.Test1);\r
+                test.ok(!!ns.Test2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Inner messages test\r
+        "inner": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/repeated.proto");\r
+                var root = builder.build(),\r
+                    Outer = root.Outer,\r
+                    Inner = root.Inner;\r
+                // Empty\r
+                var outer = new Outer();\r
+                var bb = new ByteBuffer(1).fill(0).flip();\r
+                outer.encode(bb);\r
+                test.equal(bb.flip().toString("debug"), "|00");\r
+                var douter = Outer.decode(bb);\r
+                test.ok(douter.inner instanceof Array);\r
+                test.equal(douter.inner.length, 0);\r
+                // Multiple\r
+                outer = new Outer({ inner: [new Inner(1), new Inner(2)] });\r
+                bb = new ByteBuffer(8);\r
+                var size = outer.calculate();\r
+                outer.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<0A 02 08 01 0A 02 08 02>");\r
+                douter = Outer.decode(bb);\r
+                test.ok(douter.inner instanceof Array);\r
+                test.equal(douter.inner.length, 2);\r
+                test.equal(douter.inner[0].inner_value, 1);\r
+                test.equal(douter.inner[1].inner_value, 2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Packed vs. not packed repeated fields test\r
+        "packed": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/packed.proto");\r
+                var Message = builder.build("Message");\r
+                // Both empty\r
+                var message = new Message();\r
+                var bb = new ByteBuffer(1).fill(0).flip();\r
+                var size = message.calculate();\r
+                message.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "|00");\r
+                message = Message.decode(bb);\r
+                test.ok(message.a instanceof Array);\r
+                test.equal(message.a.length, 0);\r
+                test.ok(message.b instanceof Array);\r
+                test.equal(message.b.length, 0);\r
+                // Both non-empty\r
+                message = new Message([1,2,3], [1,2,3]);\r
+                size = message.calculate();\r
+                message.encode(bb.resize(11));\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<0A 03 01 02 03 10 01 10 02 10 03>");\r
+                message = Message.decode(bb);\r
+                test.ok(message.a instanceof Array);\r
+                test.equal(message.a.length, 3);\r
+                test.deepEqual(message.a, [1,2,3]);\r
+                test.ok(message.b instanceof Array);\r
+                test.equal(message.b.length, 3);\r
+                test.deepEqual(message.b, [1,2,3]);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Legacy groups test\r
+        "groups": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/groups.proto");\r
+                var root = builder.build();\r
+                var Outer = root.Outer;\r
+                var TOuter = builder.ns.getChild("Outer");\r
+                var TInner = TOuter.getChild("MyInner");\r
+                test.ok(TInner instanceof ProtoBuf.Reflect.Message);\r
+                test.strictEqual(TInner.isGroup, true);\r
+                var Tinner = TOuter.getChild("myinner");\r
+                test.ok(Tinner instanceof ProtoBuf.Reflect.Message.Field);\r
+                test.strictEqual(Tinner.id, 2);\r
+                test.deepEqual(Tinner.options, { "deprecated": true });\r
+                var Inner = root.Outer.MyInner;\r
+                var outer = new Outer("a", [new Inner("hello")], "b", new Inner("world"));\r
+                var bb = new ByteBuffer();\r
+                var size = outer.calculate();\r
+                outer.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                bb.flip().compact();\r
+                var wiredMsg = [\r
+                    "0A", // 1|010 = id 1, wire type 2 (ldelim)\r
+                    "01", // length 1\r
+                    "61", // "a"\r
+                    "13", // 10|011 = id 2, wire type 3 (start group)\r
+                    "1A", // 11|010 = id 3, wire type 2 (ldelim)\r
+                    "05", // length 5\r
+                    "68 65 6C 6C 6F", // "hello"\r
+                    "14", // 10|100 = id 2, wire type 4 (end group)\r
+                    "22", // 100|010 = id 4, wire type 2 (ldelim)\r
+                    "01", // length 1\r
+                    "62", // "b"\r
+                    "2B", // 101|011 = id 5, wire type = 3 (start group)\r
+                    "1A", // 11|010 = id 3, wire type = 2 (ldelim)\r
+                    "05", // length 5\r
+                    "77 6F 72 6C 64", // "world"\r
+                    "2C" // 101|100 = id 5, wire type = 4 (end group)\r
+                ];\r
+                test.equal(bb.toString("debug"), "<" +wiredMsg.join(" ") + ">");\r
+                var douter = Outer.decode(bb);\r
+                test.strictEqual(douter.before, "a");\r
+                test.strictEqual(douter.myinner.length, 1);\r
+                test.strictEqual(douter.myinner[0].a, "hello");\r
+                test.strictEqual(douter.after, "b");\r
+                bb.offset = 0;\r
+                douter = root.OuterSparse.decode(bb);\r
+                test.strictEqual(bb.offset, bb.limit);\r
+                test.strictEqual(douter.before, "a");\r
+                test.strictEqual(douter.after, "b");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "x64Fixed": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/x64.proto");\r
+                var Test = builder.build("Test");\r
+                var myTest = new Test();\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -1);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 1);\r
+                myTest.setVal(-2);\r
+                myTest.setUval(2);\r
+                var bb = new ByteBuffer(18); // 2x tag + 2x 64bit\r
+                var size = myTest.calculate();\r
+                myTest.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<09 FE FF FF FF FF FF FF FF 11 02 00 00 00 00 00 00 00>");\r
+                //                         ^ wireType=1, id=1         ^ wireType=1, id=2\r
+                myTest = Test.decode(bb);\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -2);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "x64Varint": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/x64.proto");\r
+                var Test = builder.build("Test2");\r
+                var Test = builder.build("Test2");\r
+                var myTest = new Test();\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -1);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 1);\r
+                test.ok(myTest.sval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.sval.unsigned, false);\r
+                test.equal(myTest.sval.toNumber(), -2);\r
+\r
+                myTest.setVal(-2);\r
+                myTest.setUval(2);\r
+                myTest.setSval(-3);\r
+                var bb = new ByteBuffer(3+10+2); // 3x tag + 1x varint 10byte + 2x varint 1byte\r
+                var size = myTest.calculate();\r
+                myTest.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<08 FE FF FF FF FF FF FF FF FF 01 10 02 18 05>");\r
+                // 08: wireType=0, id=1, 18: wireType=0, id=2, ?: wireType=0, id=3\r
+                myTest = Test.decode(bb);\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -2);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 2);\r
+                test.ok(myTest.sval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.sval.unsigned, false);\r
+                test.equal(myTest.sval.toNumber(), -3);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "keywords": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Reserved { optional string get = 1; }");\r
+                var My = builder.build();\r
+                var myTest = new My.Reserved("a");\r
+                test.doesNotThrow(function() {\r
+                    myTest.encode();\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "imports": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/imports.proto");\r
+                var root = builder.build();\r
+                test.ok(!!root.Test1);\r
+                test.ok(!!root.Test2);\r
+                test.ok(!!root.My.Test3);\r
+                test.notEqual(root.Test2, root.My.Test2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "weakImports": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/imports-weak.proto");\r
+                var root = builder.build();\r
+            } catch (e) {\r
+                test.ok(e.message.indexOf("unresolvable type reference") >= 0);\r
+                test.done();\r
+                return;\r
+            }\r
+            var e = new Error("Weak import was imported.");\r
+            fail(e);\r
+        },\r
+\r
+        "importExtensions": function(test) {\r
+            var x = "package x; \\r
+            message Test { \\r
+                extensions 1 to 10; \\r
+            } \\r
+            extend Test { \\r
+                optional int32 first_val = 1; \\r
+            }";\r
+            var y = "package y; \\r
+            extend x.Test { \\r
+                optional int32 second_val = 2; \\r
+            }";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(x, builder);\r
+            ProtoBuf.loadProto(y, builder);\r
+            var Test = builder.build('x.Test');\r
+            var inst = new Test();\r
+            test.strictEqual(inst[".x.first_val"], null);\r
+            test.strictEqual(inst[".y.second_val"], null);\r
+            test.done();\r
+        },\r
+\r
+        "toplevel": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/toplevel.proto");\r
+                var My = builder.build("My");\r
+                test.ok(!!My.MyEnum);\r
+                test.equal(My.MyEnum.ONE, 1);\r
+                test.equal(My.MyEnum.TWO, 2);\r
+                test.ok(!!My.Test);\r
+                var myTest = new My.Test();\r
+                test.equal(myTest.num, My.MyEnum.ONE);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importsToplevel": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/imports-toplevel.proto");\r
+                var My = builder.build("My");\r
+                test.ok(!!My.MyEnum);\r
+                test.equal(My.MyEnum1.ONE, 1);\r
+                test.equal(My.MyEnum1.TWO, 2);\r
+                test.ok(!!My.Test1);\r
+                var myTest = new My.Test1();\r
+                test.equal(myTest.num, My.MyEnum.ONE);\r
+                test.equal(myTest.num1, My.MyEnum1.ONE);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importDuplicate": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/import_a.proto");\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/import_b.proto", builder);\r
+                });\r
+                var root = builder.build();\r
+                test.ok(root.A);\r
+                test.ok(root.B);\r
+                test.ok(root.Common);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importDuplicateDifferentBuilder": function(test) {\r
+            try {\r
+                var builderA = ProtoBuf.loadProtoFile(__dirname+"/import_a.proto");\r
+                var builderB;\r
+                test.doesNotThrow(function() {\r
+                    builderB = ProtoBuf.loadProtoFile(__dirname+"/import_b.proto");\r
+                });\r
+                var rootA = builderA.build();\r
+                var rootB = builderB.build();\r
+                test.ok(rootA.A);\r
+                test.ok(rootB.B);\r
+                test.ok(rootA.Common);\r
+                test.ok(rootB.Common);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "dupimport": function(test) {\r
+            try {\r
+                // Suppress logging result to stdout\r
+                fixture.capture(function() { return false;});\r
+                require(__dirname+"/../cli/pbjs.js").main(["node", "bin/pbjs", __dirname+"/dupimport/main.proto", "--quiet"]);\r
+                fixture.release();\r
+            } catch (e) {\r
+                fixture.release();\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "field_name_same_as_package": function(test) {\r
+            try {\r
+                fixture.capture(function() { return false;});\r
+                require(__dirname+"/../cli/pbjs.js").main(["node", "bin/pbjs", __dirname+"/field_name_same_as_package/main.proto", "--quiet"]);\r
+                fixture.release();\r
+            } catch (e) {\r
+                fixture.release();\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importRoot": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile({\r
+                    root: __dirname,\r
+                    file: "importRoot/file1.proto"\r
+                });\r
+                var Test = builder.build("Test");\r
+                test.ok(new Test() instanceof ProtoBuf.Builder.Message);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "extend": function(test) {\r
+            try {\r
+                var ast = new ProtoBuf.DotProto.Parser(fs.readFileSync(__dirname+"/extend.proto")).parse();\r
+                test.deepEqual(ast, { package: null,\r
+                    messages:\r
+                        [ { ref: 'google.protobuf.MessageOptions',\r
+                            fields:\r
+                                [ { rule: 'optional',\r
+                                    type: 'int32',\r
+                                    name: 'foo',\r
+                                    options: {},\r
+                                    id: 1001 } ] },\r
+                            { name: 'Foo',\r
+                                fields: [],\r
+                                enums: [],\r
+                                messages: [],\r
+                                options: {},\r
+                                services: [],\r
+                                oneofs: {},\r
+                                extensions: [ [ 2, 536870911 ] ] },\r
+                            { ref: 'Foo',\r
+                                fields:\r
+                                    [ { rule: 'optional',\r
+                                        type: 'string',\r
+                                        name: 'bar',\r
+                                        options: {},\r
+                                        id: 2 } ] },\r
+                            { name: 'Bar',\r
+                                fields: [],\r
+                                enums: [],\r
+                                messages:\r
+                                    [ { name: 'Foo',\r
+                                        fields: [],\r
+                                        enums: [],\r
+                                        messages: [],\r
+                                        options: {},\r
+                                        services: [],\r
+                                        oneofs: {} },\r
+                                        { ref: '.Foo',\r
+                                            fields: [ { rule: 'optional', type: 'Foo', name: 'foo', options: {}, id: 3 } ] } ],\r
+                                options: {},\r
+                                services: [],\r
+                                oneofs: {} } ],\r
+                    enums: [],\r
+                    imports: [ 'google/protobuf/descriptor.proto' ],\r
+                    options: {},\r
+                    services: [] }\r
+                );\r
+\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/extend.proto");\r
+                var TFoo = builder.lookup(".Foo"),\r
+                    TBar = builder.lookup(".Bar"),\r
+                    TBarFoo = builder.lookup(".Bar.Foo"),\r
+                    fields = TFoo.getChildren(ProtoBuf.Reflect.Message.Field);\r
+                test.strictEqual(fields.length, 2);\r
+                test.strictEqual(fields[0].name, ".bar");\r
+                test.strictEqual(fields[0].id, 2);\r
+                test.strictEqual(fields[1].name, ".Bar.foo");\r
+                test.strictEqual(fields[1].id, 3);\r
+                test.deepEqual(TFoo.extensions, [[2, ProtoBuf.ID_MAX]]); // explicitly defined\r
+                test.strictEqual(TBar.extensions, undefined); // none defined\r
+                test.deepEqual(TBar.getChild("foo"), { builder: builder, parent: TBar, name: "foo", field: TFoo.getChild('.Bar.foo') });\r
+                test.strictEqual(TBar.getChildren(ProtoBuf.Reflect.Message.Field).length, 0);\r
+                var root = builder.build();\r
+                test.strictEqual(TFoo.getChild(".Bar.foo").resolvedType, TBarFoo); // .Bar.Foo, not .Foo\r
+                var foo = new root.Foo(),\r
+                    bar = new root.Bar();\r
+                foo['.bar'] = "123";\r
+                foo['.Bar.foo'] = bar;\r
+                test.equal(foo.encode().compact().toString("debug"), "<12 03 31 32 33 1A 00>");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Custom options on all levels\r
+        // victorr (https://github.com/victorr)\r
+        "customOptions": function(test) {\r
+            try {\r
+                var parser = new ProtoBuf.DotProto.Parser(ProtoBuf.Util.fetch(__dirname+"/custom-options.proto"));\r
+                var root = parser.parse();\r
+                test.equal(root["options"]["(my_file_option)"], "Hello world!");\r
+                test.equal(root["messages"][7]["options"]["(my_message_option)"], 1234);\r
+                test.equal(root["messages"][7]["fields"][0]["options"]["(my_field_option)"], 4.5);\r
+                // test.equal(root["services"]["MyService"]["options"]["my_service_option"], "FOO");\r
+                // TODO: add tests for my_enum_option, my_enum_value_option\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "oneofs": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/oneof.proto"),\r
+                    MyOneOf = builder.build("MyOneOf"),\r
+                    TOneOf = builder.lookup(".MyOneOf");\r
+                test.ok(TOneOf.getChild("my_oneof"));\r
+                var myOneOf = new MyOneOf();\r
+                test.strictEqual(myOneOf.my_oneof, null);\r
+                myOneOf.set("id", 1);\r
+                test.strictEqual(myOneOf.my_oneof, "id");\r
+                myOneOf.set("name", "me");\r
+                test.strictEqual(myOneOf.my_oneof, "name");\r
+                test.strictEqual(myOneOf.id, null);\r
+                var bb = myOneOf.encode().compact();\r
+                test.strictEqual(bb.toString("debug"), "<12 02 6D 65>"); // id 2, wt 2, len 2\r
+                myOneOf = MyOneOf.decode(bb);\r
+                test.strictEqual(myOneOf.my_oneof, "name");\r
+                test.strictEqual(myOneOf.name, "me");\r
+                test.strictEqual(myOneOf.id, null);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "services": function(test) {\r
+            try {\r
+                var parser = new ProtoBuf.DotProto.Parser(ProtoBuf.Util.fetch(__dirname+"/custom-options.proto"));\r
+                var root = parser.parse();\r
+                test.deepEqual(root["services"], [{\r
+                    "name": "MyService",\r
+                    "rpc": {\r
+                        "MyMethod": {\r
+                            "request": "RequestType",\r
+                            "response": "ResponseType",\r
+                            "request_stream": false,\r
+                            "response_stream": false,\r
+                            "options": {\r
+                                "(my_method_option).foo": 567,\r
+                                "(my_method_option).bar": "Some string"\r
+                            }\r
+                        }\r
+                    },\r
+                    "options": {\r
+                        "(my_service_option)": "FOO"\r
+                    }\r
+                }]);\r
+\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/custom-options.proto");\r
+                var root = builder.build(),\r
+                    MyService = root.MyService,\r
+                    RequestType = root.RequestType,\r
+                    ResponseType = root.ResponseType,\r
+                    called = false;\r
+\r
+                test.deepEqual(MyService.$options, {\r
+                    "(my_service_option)": "FOO"\r
+                });\r
+                test.deepEqual(MyService.MyMethod.$options, {\r
+                    "(my_method_option).foo": 567,\r
+                    "(my_method_option).bar": "Some string"\r
+                });\r
+\r
+                // Provide the service with your actual RPC implementation based on whatever framework you like most.\r
+                var myService = new MyService(function(method, req, callback) {\r
+                    test.strictEqual(method, ".MyService.MyMethod");\r
+                    test.ok(req instanceof RequestType);\r
+                    called = true;\r
+\r
+                    // In this case we just return no error and our pre-built response. This must be properly async!\r
+                    setTimeout(callback.bind(this, null, (new ResponseType()).encode() /* as raw bytes for debugging */ ));\r
+                });\r
+\r
+                test.deepEqual(myService.$options, MyService.$options);\r
+                test.deepEqual(myService.MyMethod.$options, MyService.MyMethod.$options);\r
+\r
+                // Call the service with your request message and provide a callback. This will call your actual service\r
+                // implementation to perform the request and gather a response before calling the callback. If the\r
+                // request or response type is invalid i.e. not an instance of RequestType or ResponseType, your\r
+                // implementation will not be called as ProtoBuf.js handles this case internally and directly hands the\r
+                // error to your callback below.\r
+                myService.MyMethod(new RequestType(), function(err, res) {\r
+                    // We get: err = null, res = our prebuilt response. And that's it.\r
+                    if (err !== null) {\r
+                        fail(err);\r
+                    }\r
+                    test.strictEqual(called, true);\r
+                    test.ok(res instanceof ResponseType);\r
+                    test.done();\r
+                });\r
+                myService.MyMethod(new RequestType().encode(), function(err, res) {\r
+                    // We get: err = null, res = our prebuilt response. And that's it.\r
+                    if (err !== null) {\r
+                        fail(err);\r
+                    }\r
+                    test.strictEqual(called, true);\r
+                    test.ok(res instanceof ResponseType);\r
+                    test.done();\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+        },\r
+\r
+        // Properly ignore "syntax" and "extensions" keywords\r
+        // The corresponding .proto file has been removed upon request\r
+        /* "gtfs-realtime": function(test) {\r
+            try {\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/gtfs-realtime.proto");\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        }, */\r
+\r
+        "delimited": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Position { required int32 x = 1; required int32 y = 2; }");\r
+                var Position = builder.build("Position");\r
+                var bb = new ByteBuffer();\r
+                for (var i=0; i<2; i++) {\r
+                    var position = new Position(10,10);\r
+                    position.encodeDelimited(bb);\r
+                }\r
+                bb.flip();\r
+                for (i=0; i<2; i++) {\r
+                    position = Position.decodeDelimited(bb);\r
+                    test.strictEqual(position.x, 10);\r
+                    test.strictEqual(position.y, 10);\r
+                }\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "stringify": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Position { required int32 x = 1; required int64 y = 2; }");\r
+                var Position = builder.build("Position");\r
+                var position = new Position(1, ProtoBuf.Long.fromNumber(2));\r
+                var json = JSON.stringify(position);\r
+                test.strictEqual(json, '{"x":1,"y":{"low":2,"high":0,"unsigned":false}}');\r
+                position = new Position(JSON.parse(json));\r
+                test.strictEqual(position.x, 1);\r
+                test.ok(position.y instanceof ProtoBuf.Long);\r
+                test.deepEqual(position.y, {"low":2,"high":0,"unsigned":false});\r
+                // Also test if this encodes and decodes properly\r
+                position = Position.decode(position.encode());\r
+                test.ok(position.y instanceof ProtoBuf.Long);\r
+                test.deepEqual(position.y, {"low": 2, "high": 0, "unsigned": false });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "fields": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/optional.proto");\r
+                var Test1 = builder.build("Test1");\r
+                var test1 = new Test1();\r
+                test.strictEqual(test1.a, null);\r
+                test.deepEqual(Object.keys(test1), ['a','b']);\r
+                var bb = test1.encode();\r
+                test1 = Test1.decode(bb);\r
+                test.strictEqual(test1.a, null);\r
+                test.deepEqual(Object.keys(test1), ['a','b']);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "fieldsToCamelCase": function(test) {\r
+            try {\r
+                ProtoBuf.convertFieldsToCamelCase = true;\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/camelcase.proto");\r
+                var Test = builder.build("Test"),\r
+                    TTest = builder.lookup("Test");\r
+                var msg = new Test();\r
+\r
+                // Reverted collision on 1st\r
+                test.strictEqual(msg.some_field, null);\r
+                test.strictEqual(msg.someField, null);\r
+                test.equal(TTest.getChild("some_field").id, 1);\r
+                test.equal(TTest.getChild("someField").id, 2);\r
+\r
+\r
+                // Reverted collision on 2nd\r
+                test.strictEqual(msg.aField, null);\r
+                test.strictEqual(msg.a_field, null);\r
+                test.equal(TTest.getChild("aField").id, 3);\r
+                test.equal(TTest.getChild("a_field").id, 4);\r
+\r
+                // No collision\r
+                test.strictEqual(msg.itsAField, null);\r
+                test.equal(TTest.getChild("itsAField").id, 5);\r
+\r
+                test.ok(typeof msg.set_its_a_field === "function");\r
+                test.ok(typeof msg.setItsAField === "function");\r
+\r
+                ProtoBuf.convertFieldsToCamelCase = false;\r
+            } catch (e) {\r
+                ProtoBuf.convertFieldsToCamelCase = false;\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "setarray": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/setarray.proto");\r
+                var root = builder.build(),\r
+                    Outer = root.Outer,\r
+                    Inner = root.Inner,\r
+                    inners = [];\r
+\r
+                // Array of repeated messages\r
+                inners.push(new Inner("a"), new Inner("b"), new Inner("c"));\r
+                var outer = new Outer();\r
+                outer.setInners(inners);\r
+                test.deepEqual(outer.inners, inners);\r
+\r
+                // Array of repeated message objects\r
+                inners = [];\r
+                inners.push({ str: 'a' }, { str: 'b' }, { str: 'c' });\r
+                outer.setInners(inners); // Converts\r
+                test.ok(outer.inners[0] instanceof Inner);\r
+                test.deepEqual(outer.inners, inners);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+\r
+        // Make sure that our example at https://github.com/dcodeIO/ProtoBuf.js/wiki is not nonsense\r
+        "pingexample": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/PingExample.proto");\r
+                var Message = builder.build("Message");\r
+                var msg = new Message();\r
+                msg.ping = new Message.Ping(123456789);\r
+                var bb = msg.encode();\r
+                test.strictEqual(bb.limit, 7);\r
+                msg = Message.decode(bb);\r
+                test.ok(msg.ping);\r
+                test.notOk(msg.pong);\r
+                test.strictEqual(msg.ping.time, 123456789);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "negInt32": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test { required int32 value = 2; }");\r
+                var Test = builder.build("Test");\r
+                var t = new Test(-1);\r
+                var size = t.calculate();\r
+                var bb = t.encode(); // flips\r
+                test.strictEqual(bb.remaining(), size);\r
+                test.strictEqual(bb.toBase64(), "EP///////////wE=");\r
+                t = Test.decode(bb);\r
+                test.strictEqual(t.value, -1);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "negEnumId": function(test) {\r
+            try {\r
+                test.doesNotThrow(function() {\r
+                    var builder = ProtoBuf.loadProtoFile(__dirname+"/negid.proto");\r
+                    var Test = builder.build("Test");\r
+                    test.strictEqual(Test.LobbyType.INVALID, -1);\r
+                    var t = new Test(Test.LobbyType.INVALID);\r
+                    test.strictEqual(t.type, -1);\r
+                    var size = t.calculate();\r
+                    var bb = t.encode(); // flips\r
+                    test.strictEqual(bb.remaining(), size);\r
+                    t = Test.decode(bb);\r
+                    test.strictEqual(t.type, -1);\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "base64": function(test) {\r
+            try {\r
+                var Message = ProtoBuf.loadProto("message Message { required string s = 1; }").build("Message");\r
+                var msg = new Message("ProtoBuf.js");\r
+                var b64 = msg.toBase64();\r
+                test.strictEqual(b64, "CgtQcm90b0J1Zi5qcw==");\r
+                var msg2 = Message.decode64(b64);\r
+                test.deepEqual(msg, msg2);\r
+                msg2 = Message.decode(b64, "base64");\r
+                test.deepEqual(msg, msg2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "hex": function(test) {\r
+            try {\r
+                var Message = ProtoBuf.loadProto("message Message { required string s = 1; }").build("Message");\r
+                var msg = new Message("ProtoBuf.js");\r
+                var hex = msg.toHex();\r
+                test.strictEqual(hex, "0a0b50726f746f4275662e6a73");\r
+                var msg2 = Message.decodeHex(hex);\r
+                test.deepEqual(msg, msg2);\r
+                msg2 = Message.decode(hex, "hex");\r
+                test.deepEqual(msg, msg2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "forwardComp": function(test) {\r
+            try {\r
+                var Message = ProtoBuf.loadProto("message Message { required int32 a = 1; required string b = 2; required float c = 3; }").build("Message");\r
+                var msg = new Message(123, "abc", 0.123);\r
+                var bb = msg.encode();\r
+                Message = ProtoBuf.loadProto("message Message {}").build("Message");\r
+                test.doesNotThrow(function() {\r
+                    Message.decode(bb);\r
+                });\r
+                test.strictEqual(bb.offset, bb.limit);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "tokenizerLine": function(test) {\r
+            try {\r
+                var parser = new ProtoBuf.DotProto.Parser("package test;\n\nmessage Message {\n\trequired string invalid = 1;}ERROR\n"),\r
+                    ast = null, err = null;\r
+                try {\r
+                    ast = parser.parse();\r
+                } catch (caught) {\r
+                    err = caught;\r
+                }\r
+                test.ok(err);\r
+                test.notOk(ast);\r
+                test.ok(err.message.indexOf("line 4:") >= 0);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "excludeFields": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message A { required int32 i = 1; } message B { required A A = 1; }");\r
+                builder.build();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "proto2jsExtend": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadJsonFile(__dirname+"/proto2js/Bar.json");\r
+                builder.build();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "emptyMessage": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message EmptyMessage {}"),\r
+                    EmptyMessage = builder.build("EmptyMessage");\r
+\r
+                var msg = new EmptyMessage(),\r
+                    ab = msg.toArrayBuffer();\r
+                test.strictEqual(ab.byteLength, 0);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "toRaw": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message MyMessage { required int32 a = 1; required int32 b = 2; required bytes c = 3; }"),\r
+                    MyMessage = builder.build("MyMessage");\r
+                var raw = { a: 1, b: 2, c: "YWJj" },\r
+                    myMessage = new MyMessage(raw);\r
+                test.deepEqual(myMessage.c.toBase64(), raw.c);\r
+                test.deepEqual(myMessage.toRaw(true), raw);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "singleQuotedString": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/string_single_quote.proto");\r
+                var TestSingleQuoteString = builder.build("TestSingleQuoteString");\r
+                test.ok(typeof TestSingleQuoteString == 'function');\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importDuplicateSingleQuote": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/import_a_single_quote.proto");\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/import_b.proto", builder);\r
+                });\r
+                var root = builder.build();\r
+                test.ok(root.A);\r
+                test.ok(root.B);\r
+                test.ok(root.Common);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importStringSuccessively": function(test) {\r
+            try {\r
+                var proto1 = "message A { required string a = 1; };";\r
+                var proto2 = "import \"proto1.proto\"; message B { required A a = 1; };";\r
+                var builder = ProtoBuf.loadProto(proto1, "proto1.proto");\r
+                ProtoBuf.loadProto(proto2, builder, "proto2.proto");\r
+                var root = builder.build();\r
+                test.ok(root.A);\r
+                test.ok(root.B);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "multilineString": function(test) {\r
+            try {\r
+                var proto = "message TestMessage { required string test = 1 [default = \"1\"   \"2\"\n\"3\"];}";\r
+                var builder = ProtoBuf.loadProto(proto, "multilineString.proto");\r
+                var TestMessage = builder.build("TestMessage"),\r
+                    testMessage = new TestMessage();\r
+                test.strictEqual(testMessage.test, "123");\r
+                test.done();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "packable": function(test) {\r
+            try {\r
+                var proto = 'message Inner { required int32 id=2; }\nmessage Outer { repeated Inner inner = 1 [packed=true]; }';\r
+                var builder = ProtoBuf.loadProto(proto);\r
+                var root = builder.build();\r
+                var inner = new root.Inner(1),\r
+                    outer = new root.Outer(inner);\r
+                var bb = outer.encode().compact();\r
+                test.strictEqual(bb.toDebug(), "<0A 02 10 01>");\r
+                // 0A: wt 2, id 1\r
+                // 02: len 2\r
+                // 10: wt 0, id 2\r
+                // 01: 1\r
+                var outer2 = root.Outer.decode(bb);\r
+                test.strictEqual(outer2.inner.id, 1);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "$type": function(test) {\r
+            var builder = ProtoBuf.loadProto("message Test {}");\r
+            var Test = builder.build("Test"),\r
+                TTest = builder.lookup("Test");\r
+            test.strictEqual(new Test().$type, TTest);\r
+            test.done();\r
+        },\r
+\r
+        "descriptor": function(test) {\r
+            try {\r
+                var proto = 'import "./google/protobuf/descriptor.proto";';\r
+                var builder = ProtoBuf.loadProto(proto, "tests/proto.proto");\r
+                var root = builder.build("google.protobuf");\r
+                test.ok(root.FileDescriptorSet);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "mismatchedNesting": function(test) {\r
+            try {\r
+                var proto = "message Child { optional uint32 foo = 1; } message FakeChild { optional uint32 foo = 1; } message Parent { optional Child child = 1; }";\r
+                var builder = ProtoBuf.loadProto(proto, "tests/mismatchedNesting.proto");\r
+                var root = builder.build();\r
+                var foo = new root.Parent({ child: new root.FakeChild({ foo: 1 })});\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        /* "mismatchedType": function(test) {\r
+            try {\r
+                var proto  = "message Test1 { optional string foo = 1; }";\r
+                    proto += "message Test2 { optional int32 foo = 1; }";\r
+                var builder = ProtoBuf.loadProto(proto, "tests/mistmatchedType.proto");\r
+                var root = builder.build();\r
+                var test1 = new root.Test1({ foo: 'bar' });\r
+                var test2 = root.Test2.decode(test1.encode());\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        }, */\r
+\r
+        "builderOptions": function(test) {\r
+            try {\r
+                var proto = "message Foo { optional uint32 foo_bar = 1; }";\r
+                var builder = ProtoBuf.newBuilder({\r
+                    convertFieldsToCamelCase: true\r
+                });\r
+                ProtoBuf.loadProto(proto, builder, "tests/builderOptions.proto");\r
+                var Foo = builder.build("Foo");\r
+                test.strictEqual(ProtoBuf.convertFieldsToCamelCase, false);\r
+                test.strictEqual(builder.options.convertFieldsToCamelCase, true);\r
+                var foo = new Foo();\r
+                test.ok(typeof foo.fooBar !== 'undefined');\r
+                test.ok(typeof foo.foo_bar === 'undefined');\r
+                test.done();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "proto3": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/proto3.proto");\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/proto3.proto", builder);\r
+                });\r
+                var root = builder.build();\r
+                test.ok(root.test.Foo.$type.syntax === 'proto3');\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // FIXME: This test relied on some bloated builder functionality that has been removed.\r
+        // Is it even mandatory to strictly disallow proto2/3 mixing, even if that would be illegal in the official\r
+        // implementation?\r
+        /* "proto3DisallowedFeatures": function(test) {\r
+            try {\r
+                // Required field\r
+                var proto = "syntax = \"proto3\"; message Foo { required int32 field = 1; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Field with default value\r
+                var proto = "syntax = \"proto3\"; message Foo { int32 field = 1 [default=42]; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Message with extension range\r
+                var proto = "syntax = \"proto3\"; message Foo { extensions 100 to max; } ";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Message with extension\r
+                var proto = "syntax = \"proto3\"; message Foo { extensions 100 to max; } " +\r
+                            "message Bar { extend Foo { optional Bar bar = 100; } }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Enum with non-zero first entry.\r
+                var proto = "syntax = \"proto3\"; enum E { A = 1; B = 2; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Proto3 message referring to proto2 enum.\r
+                var proto2 = "syntax = \"proto2\"; enum E { A = 1; B = 2; }";\r
+                var proto3 = "syntax = \"proto3\"; message Test { E enum_field = 1; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto2, builder, "tests/proto3DisallowedFeatures1.proto");\r
+                ProtoBuf.loadProto(proto3, builder, "tests/proto3DisallowedFeatures3.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Proto3 message refers to proto2 enum/.test(e.message));\r
+            }\r
+\r
+            test.done();\r
+        }, */\r
+\r
+        "proto3FieldPresence": function(test) {\r
+            var proto =\r
+                "syntax = \"proto3\";\n" +\r
+                "message Test {\n" +\r
+                "  int32 field_int32 = 1;\n" +\r
+                "  int64 field_int64 = 2;\n" +\r
+                "  string field_str = 3;\n" +\r
+                "  bytes field_bytes = 4;\n" +\r
+                "  Test field_msg = 5;\n" +\r
+                "  Enum field_enum = 6;\n" +\r
+                "  repeated int32 rpt_int32 = 11;\n" +\r
+                "  repeated int64 rpt_int64 = 12;\n" +\r
+                "  repeated string rpt_str = 13;\n" +\r
+                "  repeated bytes rpt_bytes = 14;\n" +\r
+                "  repeated Test rpt_msg = 15;\n" +\r
+                "  repeated Enum rpt_enum = 16;\n" +\r
+                "  oneof oneof_type { bool oneof_bool = 17; };\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/proto3FieldPresence.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            test.strictEqual(testMsg.field_int32, 0);\r
+            test.strictEqual(testMsg.field_int64.low, 0);\r
+            test.strictEqual(testMsg.field_int64.high, 0);\r
+            test.strictEqual(testMsg.field_str, "");\r
+            test.strictEqual(testMsg.field_msg, null);\r
+            test.ok(testMsg.field_bytes instanceof ByteBuffer);\r
+            test.strictEqual(testMsg.field_bytes.remaining(), 0);\r
+            test.strictEqual(testMsg.rpt_int32.length, 0);\r
+            test.strictEqual(testMsg.oneof_type, null);\r
+            test.strictEqual(testMsg.oneof_bool, false);\r
+\r
+            // No fields should go on the wire, even though they're set\r
+            var encoded = testMsg.encode();\r
+            test.strictEqual(encoded.remaining(), 0);\r
+            testMsg.field_int32 = 42;\r
+            encoded = testMsg.encode();\r
+            test.strictEqual(encoded.remaining(), 2);\r
+            testMsg.field_int32 = 0;\r
+            encoded = testMsg.encode();\r
+            test.strictEqual(encoded.remaining(), 0);\r
+\r
+            // Enum fields should be able to carry arbitrary values.\r
+            testMsg.field_enum = 42;\r
+            test.strictEqual(testMsg.field_enum, 42);\r
+            encoded = testMsg.encode();\r
+            testMsg = Test.decode(encoded);\r
+            test.strictEqual(testMsg.field_enum, 42);\r
+\r
+            // Explicitly set fields that are part of an oneof should\r
+            // be encoded even if set to their default value\r
+            testMsg = new Test();\r
+            testMsg.set("oneof_bool", false);\r
+            test.strictEqual(testMsg.oneof_type, "oneof_bool");\r
+            encoded = testMsg.encode().compact();\r
+            test.strictEqual(encoded.toString("debug"), "<88 01 00>"); // 17|varint (0term) + varint 0\r
+            var decoded = Test.decode(encoded);\r
+            test.strictEqual(decoded.oneof_type, "oneof_bool");\r
+            test.strictEqual(decoded.oneof_bool, false);\r
+\r
+            test.done();\r
+        },\r
+\r
+        "mapContainer": function(test) {\r
+            var proto =\r
+                "message Test {\n" +\r
+                "  map<string, int32> map_string_int32 = 1;\n" +\r
+                "  map<string, int64> map_string_int64 = 2;\n" +\r
+                "  map<string, string> map_string_string = 3;\n" +\r
+                "  map<string, Test> map_string_msg = 4;\n" +\r
+                "  map<string, Enum> map_string_enum = 5;\n" +\r
+                "  map<int32, string> map_int32_string = 6;\n" +\r
+                "  map<int64, string> map_int64_string = 7;\n" +\r
+                "  map<bool, string> map_bool_string = 9;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapContainer.proto");\r
+\r
+            var map_string_int32 =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_string_int32"));\r
+            test.strictEqual(map_string_int32.size, 0);\r
+            test.strictEqual(map_string_int32.has("asdf"), false);\r
+            test.strictEqual(map_string_int32.get("asdf"), undefined);\r
+            map_string_int32.set("asdf", 42);\r
+            test.strictEqual(map_string_int32.has("asdf"), true);\r
+            test.strictEqual(map_string_int32.get("asdf"), 42);\r
+\r
+            var it = map_string_int32.keys();\r
+            var itVal = it.next();\r
+            test.strictEqual(itVal.done, false);\r
+            test.strictEqual(itVal.value, "asdf");\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, true);\r
+\r
+            it = map_string_int32.values();\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, false);\r
+            test.strictEqual(itVal.value, 42);\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, true);\r
+\r
+            it = map_string_int32.entries();\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, false);\r
+            test.deepEqual(itVal.value, ["asdf", 42]);\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, true);\r
+\r
+            map_string_int32.set("jkl;", 84);\r
+            test.strictEqual(map_string_int32.has("jkl;"), true);\r
+            test.strictEqual(map_string_int32.has("asdf"), true);\r
+            test.strictEqual(map_string_int32.size, 2);\r
+            map_string_int32.delete("jkl;");\r
+            test.strictEqual(map_string_int32.has("jkl;"), false);\r
+            test.strictEqual(map_string_int32.get("jkl;"), undefined);\r
+            test.strictEqual(map_string_int32.size, 1);\r
+\r
+            map_string_int32.clear();\r
+            test.strictEqual(map_string_int32.size, 0);\r
+\r
+            try {\r
+                map_string_int32.set("asdf", 42.1);\r
+                test.ok(false); // ^ should throw\r
+            } catch(e) {\r
+                test.ok(e.message.match(/not an integer/));\r
+            }\r
+\r
+            try {\r
+                map_string_int32.set(42, 42);\r
+                test.ok(false); // ^ should throw\r
+            } catch(e) {\r
+                test.ok(e.message.match(/not a string/));\r
+            }\r
+\r
+            // Test various key types to ensure that value->string->value\r
+            // conversion works.\r
+            var map_int32_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int32_string"));\r
+            test.strictEqual(map_int32_string.size, 0);\r
+            map_int32_string.set(12345678, "asdf");\r
+            test.strictEqual(map_int32_string.size, 1);\r
+            test.strictEqual(map_int32_string.has(12345678), true);\r
+            test.strictEqual(map_int32_string.get(12345678), "asdf");\r
+\r
+            var map_int64_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int64_string"));\r
+            test.strictEqual(map_int64_string.size, 0);\r
+            map_int64_string.set("9223372036854775807", "asdf");\r
+            test.strictEqual(map_int64_string.size, 1);\r
+            test.strictEqual(map_int64_string.has("9223372036854775807"), true);\r
+            test.strictEqual(map_int64_string.get("9223372036854775807"), "asdf");\r
+\r
+            // Ensure that initialization from a raw object works.\r
+            var map_int32_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int32_string"),\r
+                                 { 42: "asdf" });\r
+            test.strictEqual(map_int32_string.size, 1);\r
+            test.strictEqual(map_int32_string.keys().next().value, 42);\r
+\r
+            var map_int64_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int64_string"),\r
+                                 { "9223372036854775807": "asdf" });\r
+            test.strictEqual(map_int64_string.size, 1);\r
+            var i64 = map_int64_string.keys().next().value;\r
+            test.ok(i64 instanceof ProtoBuf.Long);\r
+            test.strictEqual(i64.toString(), "9223372036854775807");\r
+\r
+            test.done();\r
+        },\r
+\r
+        "mapField": function(test) {\r
+            var proto =\r
+                "message Test {\n" +\r
+                "  map<string, int32> map_string_int32 = 1;\n" +\r
+                "  map<string, int64> map_string_int64 = 2;\n" +\r
+                "  map<string, string> map_string_string = 3;\n" +\r
+                "  map<string, Test> map_string_msg = 4;\n" +\r
+                "  map<string, Enum> map_string_enum = 5;\n" +\r
+                "  map<int32, string> map_int32_string = 6;\n" +\r
+                "  map<int64, string> map_int64_string = 7;\n" +\r
+                "  map<bool, string> map_bool_string = 9;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapField.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            test.strictEqual(testMsg.map_string_int32.size, 0);\r
+            test.strictEqual(testMsg.map_string_int64.size, 0);\r
+            test.strictEqual(testMsg.map_string_string.size, 0);\r
+            test.strictEqual(testMsg.map_string_msg.size, 0);\r
+            test.strictEqual(testMsg.map_string_enum.size, 0);\r
+            test.strictEqual(testMsg.map_int32_string.size, 0);\r
+            test.strictEqual(testMsg.map_int64_string.size, 0);\r
+            test.strictEqual(testMsg.map_bool_string.size, 0);\r
+\r
+            testMsg.$set('map_string_int32', { 'asdf': 42 });\r
+\r
+            try {\r
+                testMsg.$set('map_string_int32', { 'asdf': 42.1 });\r
+                test.ok(false); // ^ should throw\r
+            } catch (e) {\r
+                test.ok(e.message.match(/Illegal/));\r
+            }\r
+\r
+            test.done();\r
+        },\r
+\r
+        "mapEncodeDecode": function(test) {\r
+            var proto =\r
+                "message Test {\n" +\r
+                "  map<string, int32> map_string_int32 = 1;\n" +\r
+                "  map<string, int64> map_string_int64 = 2;\n" +\r
+                "  map<string, string> map_string_string = 3;\n" +\r
+                "  map<string, Test> map_string_msg = 4;\n" +\r
+                "  map<string, Enum> map_string_enum = 5;\n" +\r
+                "  map<int32, string> map_int32_string = 6;\n" +\r
+                "  map<int64, string> map_int64_string = 7;\n" +\r
+                "  map<bool, string> map_bool_string = 9;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapField.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            testMsg.map_string_int32.set("a", 1);\r
+            testMsg.map_string_int32.set("b", 2);\r
+            testMsg.map_string_int64.set("c", "12345678901234");\r
+            testMsg.map_string_int64.set("d", "98765432109876");\r
+            testMsg.map_string_string.set("e", "asdf");\r
+            testMsg.map_string_string.set("f", "jkl;");\r
+            testMsg.map_string_enum.set("g", Enum.A);\r
+            testMsg.map_string_enum.set("h", Enum.B);\r
+            testMsg.map_int32_string.set(9, "a");\r
+            testMsg.map_int32_string.set(10, "b");\r
+            testMsg.map_int64_string.set("12345678901234", "a");\r
+            testMsg.map_int64_string.set("98765432109876", "b");\r
+            testMsg.map_bool_string.set(false, "a");\r
+            testMsg.map_bool_string.set(true, "b");\r
+\r
+            var encoded = testMsg.encode();\r
+            testMsg = Test.decode(encoded);\r
+\r
+            test.strictEqual(testMsg.map_string_int32.get("a"), 1);\r
+            test.strictEqual(testMsg.map_string_int32.get("b"), 2);\r
+            test.strictEqual(testMsg.map_string_int64.get("c").toString(), "12345678901234");\r
+            test.strictEqual(testMsg.map_string_int64.get("d").toString(), "98765432109876");\r
+            test.strictEqual(testMsg.map_string_string.get("e"), "asdf");\r
+            test.strictEqual(testMsg.map_string_string.get("f"), "jkl;");\r
+            test.strictEqual(testMsg.map_string_enum.get("g"), Enum.A);\r
+            test.strictEqual(testMsg.map_string_enum.get("h"), Enum.B);\r
+            test.strictEqual(testMsg.map_int32_string.get(9), "a");\r
+            test.strictEqual(testMsg.map_int32_string.get(10), "b");\r
+            test.strictEqual(testMsg.map_int64_string.get("12345678901234"), "a");\r
+            test.strictEqual(testMsg.map_int64_string.get("98765432109876"), "b");\r
+            test.strictEqual(testMsg.map_bool_string.get(false), "a");\r
+            test.strictEqual(testMsg.map_bool_string.get(true), "b");\r
+\r
+            test.done();\r
+        },\r
+\r
+        "proto3Json": function(test) {\r
+            var proto =\r
+                "syntax = \"proto3\";\n" +\r
+                "message Test {\n" +\r
+                "  int32 optional_int32 = 1;\n" +\r
+                "  int64 optional_int64 = 2;\n" +\r
+                "  string optional_string = 3;\n" +\r
+                "  bytes optional_bytes = 4;\n" +\r
+                "  bool optional_bool = 5;\n" +\r
+                "  Enum optional_enum = 6;\n" +\r
+                "  repeated int32 repeated_int32 = 11;\n" +\r
+                "  repeated int64 repeated_int64 = 12;\n" +\r
+                "  repeated string repeated_string = 13;\n" +\r
+                "  repeated bytes repeated_bytes = 14;\n" +\r
+                "  repeated bool repeated_bool = 15;\n" +\r
+                "  repeated Enum repeated_enum = 16;\n" +\r
+                "  map<string, int32> map_string_int32 = 20;\n" +\r
+                "  map<string, int64> map_string_int64 = 21;\n" +\r
+                "  map<string, string> map_string_string = 22;\n" +\r
+                "  map<string, Enum> map_string_enum = 24;\n" +\r
+                "  map<int32, string> map_int32_string = 25;\n" +\r
+                "  map<int64, string> map_int64_string = 26;\n" +\r
+                "  map<bool, string> map_bool_string = 27;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapField.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            testMsg.optional_int32 = 1;\r
+            testMsg.optional_int64 = "12345678901234";\r
+            testMsg.optional_string = "hello";\r
+            testMsg.optional_bytes = ProtoBuf.ByteBuffer.fromBinary("\x00\xFF\x80");\r
+            testMsg.optional_bool = true;\r
+            testMsg.optional_enum = Enum.A;\r
+            testMsg.repeated_int32.push(1);\r
+            testMsg.repeated_int64.push("12345678901234");\r
+            testMsg.repeated_string.push("hello");\r
+            testMsg.repeated_bytes.push(ProtoBuf.ByteBuffer.fromBinary("\x00\xFF\x80"));\r
+            testMsg.repeated_bool.push(true);\r
+            testMsg.repeated_enum.push(Enum.A);\r
+            testMsg.map_string_int32.set("a", 1);\r
+            testMsg.map_string_int32.set("b", 2);\r
+            testMsg.map_string_int64.set("c", "12345678901234");\r
+            testMsg.map_string_int64.set("d", "98765432109876");\r
+            testMsg.map_string_string.set("e", "asdf");\r
+            testMsg.map_string_string.set("f", "jkl;");\r
+            testMsg.map_string_enum.set("g", Enum.A);\r
+            testMsg.map_string_enum.set("h", Enum.B);\r
+            testMsg.map_int32_string.set(9, "a");\r
+            testMsg.map_int32_string.set(10, "b");\r
+            testMsg.map_int64_string.set("12345678901234", "a");\r
+            testMsg.map_int64_string.set("98765432109876", "b");\r
+            testMsg.map_bool_string.set(false, "a");\r
+            testMsg.map_bool_string.set(true, "b");\r
+\r
+            var jsonObj = JSON.parse(testMsg.encodeJSON());\r
+            test.deepEqual(jsonObj,\r
+                {\r
+                    optional_int32: 1,\r
+                    optional_int64: "12345678901234",\r
+                    optional_string: "hello",\r
+                    optional_bytes: "AP+A",  // base64\r
+                    optional_bool: true,\r
+                    optional_enum: "A",\r
+                    repeated_int32: [1],\r
+                    repeated_int64: ["12345678901234"],\r
+                    repeated_string: ["hello"],\r
+                    repeated_bytes: ["AP+A"],  // base64\r
+                    repeated_bool: [true],\r
+                    repeated_enum: ["A"],\r
+                    map_string_int32: { "a": 1, "b": 2 },\r
+                    map_string_int64: { "c": "12345678901234", "d": "98765432109876" },\r
+                    map_string_string: { "e": "asdf", "f": "jkl;" },\r
+                    map_string_enum: { "g": "A", "h": "B" },\r
+                    map_int32_string: { "9": "a", "10": "b" },\r
+                    map_int64_string: { "12345678901234": "a", "98765432109876": "b" },\r
+                    map_bool_string: { "false": "a", "true": "b" },\r
+                });\r
+\r
+            var testMsg2 = Test.decodeJSON(testMsg.encodeJSON());\r
+            test.strictEqual(testMsg2.encodeJSON(), testMsg.encodeJSON());\r
+\r
+            test.done();\r
+        },\r
+\r
+        // Node.js only\r
+        "loaders": BROWSER ? {} : {\r
+\r
+            "commonjs": function(test) {\r
+                var fs = require("fs")\r
+                  , vm = require("vm")\r
+                  , util = require('util');\r
+\r
+                var code = fs.readFileSync(__dirname+"/../dist/"+FILE);\r
+                var exports = {};\r
+                var sandbox = new Sandbox({\r
+                    module: {\r
+                        exports: exports,\r
+                        id: "protobufjs"\r
+                    },\r
+                    exports: exports,\r
+                    require: (function() {\r
+                        function require(mod) {\r
+                            if (mod == 'bytebuffer') require.called = true;\r
+                            return ByteBuffer;\r
+                        }\r
+                        require.called = false;\r
+                        return require;\r
+                    })()\r
+                });\r
+                vm.runInNewContext(code, sandbox, "ProtoBuf.js in CommonJS-VM");\r
+                // console.log(util.inspect(sandbox));\r
+                test.ok(typeof sandbox.module.exports == 'object');\r
+                test.ok(typeof sandbox.require != 'undefined' && sandbox.require.called);\r
+                test.done();\r
+            },\r
+\r
+            "amd": function(test) {\r
+                var fs = require("fs")\r
+                  , vm = require("vm")\r
+                  , util = require('util');\r
+\r
+                var code = fs.readFileSync(__dirname+"/../dist/"+FILE);\r
+                var sandbox = new Sandbox({\r
+                    define: (function() {\r
+                        function define() {\r
+                            define.called = true;\r
+                        }\r
+                        define.amd = true;\r
+                        define.called = false;\r
+                        return define;\r
+                    })()\r
+                });\r
+                vm.runInNewContext(code, sandbox, "ProtoBuf.js in AMD-VM");\r
+                // console.log(util.inspect(sandbox));\r
+                test.ok(sandbox.define.called == true);\r
+                test.done();\r
+            },\r
+\r
+            "shim": function(test) {\r
+                var fs = require("fs")\r
+                  , vm = require("vm")\r
+                  , util = require('util');\r
+\r
+                var code = fs.readFileSync(__dirname+"/../dist/"+FILE);\r
+                var sandbox = new Sandbox({\r
+                    dcodeIO: {\r
+                        ByteBuffer: ByteBuffer\r
+                    }\r
+                });\r
+                vm.runInNewContext(code, sandbox, "ProtoBuf.js in shim-VM");\r
+                // console.log(util.inspect(sandbox));\r
+                test.ok(typeof sandbox.dcodeIO != 'undefined' && typeof sandbox.dcodeIO.ProtoBuf != 'undefined');\r
+                test.done();\r
+            }\r
+        }\r
+    };\r
+\r
+    if (typeof module != 'undefined' && module.exports) {\r
+        module.exports = suite;\r
+    } else {\r
+        global["suite"] = suite;\r
+    }\r
+\r
+})(this);\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/toplevel.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/toplevel.proto
new file mode 100644 (file)
index 0000000..eec948e
--- /dev/null
@@ -0,0 +1,10 @@
+package My;\r
+\r
+enum MyEnum {\r
+    ONE = 1;\r
+    TWO = 2;\r
+}\r
+\r
+message Test {\r
+    required MyEnum num = 1 [default=ONE];\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/x64.proto b/legacy-libs/grpc-cloned/node_modules/protobufjs/tests/x64.proto
new file mode 100644 (file)
index 0000000..18ea2d3
--- /dev/null
@@ -0,0 +1,10 @@
+message Test {\r
+    required sfixed64 val = 1 [default=-1];\r
+    required fixed64 uval = 2 [default=1];\r
+}\r
+\r
+message Test2 {\r
+    required int64 val = 1 [default=-1];\r
+    required uint64 uval = 2 [default=1];\r
+    required sint64 sval = 3 [default=-2];\r
+}\r
diff --git a/legacy-libs/grpc-cloned/node_modules/window-size/LICENSE b/legacy-libs/grpc-cloned/node_modules/window-size/LICENSE
new file mode 100644 (file)
index 0000000..65f90ac
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2015, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc-cloned/node_modules/window-size/README.md b/legacy-libs/grpc-cloned/node_modules/window-size/README.md
new file mode 100644 (file)
index 0000000..0985bd6
--- /dev/null
@@ -0,0 +1,45 @@
+# window-size [![NPM version](https://badge.fury.io/js/window-size.svg)](http://badge.fury.io/js/window-size)  [![Build Status](https://travis-ci.org/jonschlinkert/window-size.svg)](https://travis-ci.org/jonschlinkert/window-size)
+
+> Reliable way to to get the height and width of the terminal/console in a node.js environment.
+
+## Install
+
+Install with [npm](https://www.npmjs.com/)
+
+```sh
+$ npm i window-size --save
+```
+
+## Usage
+
+```js
+var size = require('window-size');
+size.height; // "25" (rows)
+size.width; // "80" (columns)
+```
+
+## Other projects
+
+* [base-cli](https://www.npmjs.com/package/base-cli): Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… [more](https://www.npmjs.com/package/base-cli) | [homepage](https://github.com/jonschlinkert/base-cli)
+* [lint-deps](https://www.npmjs.com/package/lint-deps): CLI tool that tells you when dependencies are missing from package.json and offers you a… [more](https://www.npmjs.com/package/lint-deps) | [homepage](https://github.com/jonschlinkert/lint-deps)
+* [yargs](https://www.npmjs.com/package/yargs): Light-weight option parsing with an argv hash. No optstrings attached. | [homepage](https://github.com/bcoe/yargs#readme)
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/window-size/issues/new).
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2014-2015 [Jon Schlinkert](https://github.com/jonschlinkert)
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 15, 2015._
\ No newline at end of file
diff --git a/legacy-libs/grpc-cloned/node_modules/window-size/cli.js b/legacy-libs/grpc-cloned/node_modules/window-size/cli.js
new file mode 100644 (file)
index 0000000..dd8d0e5
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+'use strict';
+var helpText = ['Usage',
+'  $ window-size',
+'',
+'Example',
+'  $ window-size',
+'  height: 40 ',
+'  width : 145',
+''].join('\n');
+
+function showSize () {
+  var size = require('./');
+  console.log('height: ' + size.height);
+  console.log('width : ' + size.width);
+}
+
+if (process.argv.length > 2) {
+  switch (process.argv[2]) {
+    case 'help':
+    case '--help':
+    case '-h':
+      console.log(helpText);
+      break;
+    default:
+      showSize();
+  }
+} else {
+  showSize();
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/window-size/index.js b/legacy-libs/grpc-cloned/node_modules/window-size/index.js
new file mode 100644 (file)
index 0000000..eba89c9
--- /dev/null
@@ -0,0 +1,32 @@
+'use strict';
+
+/*!
+ * window-size <https://github.com/jonschlinkert/window-size>
+ *
+ * Copyright (c) 2014-2015 Jon Schlinkert
+ * Licensed under the MIT license.
+ */
+
+var tty = require('tty');
+
+module.exports = (function () {
+  var width;
+  var height;
+
+  if (tty.isatty(1) && tty.isatty(2)) {
+    if (process.stdout.getWindowSize) {
+      width = process.stdout.getWindowSize(1)[0];
+      height = process.stdout.getWindowSize(1)[1];
+    } else if (tty.getWindowSize) {
+      width = tty.getWindowSize()[1];
+      height = tty.getWindowSize()[0];
+    } else if (process.stdout.columns && process.stdout.rows) {
+      height = process.stdout.columns;
+      width = process.stdout.rows;
+    }
+  } else {
+    Error('window-size could not get size with tty or process.stdout.');
+  }
+
+  return {height: height, width: width};
+})();
diff --git a/legacy-libs/grpc-cloned/node_modules/window-size/package.json b/legacy-libs/grpc-cloned/node_modules/window-size/package.json
new file mode 100644 (file)
index 0000000..adf5ee8
--- /dev/null
@@ -0,0 +1,117 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "window-size@^0.1.4",
+        "scope": null,
+        "escapedName": "window-size",
+        "name": "window-size",
+        "rawSpec": "^0.1.4",
+        "spec": ">=0.1.4 <0.2.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/grpc/node_modules/yargs"
+    ]
+  ],
+  "_from": "window-size@>=0.1.4 <0.2.0",
+  "_id": "window-size@0.1.4",
+  "_inCache": true,
+  "_location": "/grpc/window-size",
+  "_nodeVersion": "5.0.0",
+  "_npmUser": {
+    "name": "jonschlinkert",
+    "email": "github@sellside.com"
+  },
+  "_npmVersion": "3.3.6",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "window-size@^0.1.4",
+    "scope": null,
+    "escapedName": "window-size",
+    "name": "window-size",
+    "rawSpec": "^0.1.4",
+    "spec": ">=0.1.4 <0.2.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/grpc/yargs"
+  ],
+  "_resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz",
+  "_shasum": "f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876",
+  "_shrinkwrap": null,
+  "_spec": "window-size@^0.1.4",
+  "_where": "/var/opt/motion2/node_modules/grpc/node_modules/yargs",
+  "author": {
+    "name": "Jon Schlinkert",
+    "url": "https://github.com/jonschlinkert"
+  },
+  "bin": {
+    "window-size": "cli.js"
+  },
+  "bugs": {
+    "url": "https://github.com/jonschlinkert/window-size/issues"
+  },
+  "dependencies": {},
+  "description": "Reliable way to to get the height and width of the terminal/console in a node.js environment.",
+  "devDependencies": {
+    "semistandard": "^7.0.2",
+    "tap": "^2.2.1"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876",
+    "tarball": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz"
+  },
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "files": [
+    "index.js",
+    "cli.js"
+  ],
+  "gitHead": "619d0da99254adc5c6059c84e3ec2b24564add46",
+  "homepage": "https://github.com/jonschlinkert/window-size",
+  "keywords": [
+    "console",
+    "height",
+    "resize",
+    "size",
+    "terminal",
+    "tty",
+    "width",
+    "window"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "maintainers": [
+    {
+      "name": "jonschlinkert",
+      "email": "github@sellside.com"
+    },
+    {
+      "name": "doowb",
+      "email": "brian.woodward@gmail.com"
+    }
+  ],
+  "name": "window-size",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/jonschlinkert/window-size.git"
+  },
+  "scripts": {
+    "pretest": "semistandard",
+    "test": "tap --coverage test.js"
+  },
+  "verb": {
+    "related": {
+      "list": [
+        "yargs",
+        "lint-deps",
+        "base-cli"
+      ]
+    }
+  },
+  "version": "0.1.4"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/CHANGELOG.md b/legacy-libs/grpc-cloned/node_modules/yargs/CHANGELOG.md
new file mode 100644 (file)
index 0000000..6c0cb51
--- /dev/null
@@ -0,0 +1,508 @@
+## Change Log
+
+### v3.32.0 (2016/1/14 10:13 +07:00)
+
+- [#344](https://github.com/bcoe/yargs/pull/344) yargs now has a code of conduct and contributor guidelines (@bcoe)
+- [#341](https://github.com/bcoe/yargs/issues/341) Fix edge-case with camel-case arguments (@davibe)
+- [#331](https://github.com/bcoe/yargs/pull/331) Handle parsing a raw argument string (@kellyselden)
+- [#325](https://github.com/bcoe/yargs/pull/325) Tweaks to make tests pass again on Windows (@isaacs)
+- [#321](https://github.com/bcoe/yargs/pull/321) Custom config parsing function (@bcoe)
+
+### v3.31.0 (2015/12/03 10:15 +07:00)
+
+- [#239](https://github.com/bcoe/yargs/pull/239) Pass argv to commands (@bcoe)
+- [#308](https://github.com/bcoe/yargs/pull/308) Yargs now handles environment variables (@nexdrew)
+- [#302](https://github.com/bcoe/yargs/pull/302) Add Indonesian translation (@rilut)
+- [#300](https://github.com/bcoe/yargs/pull/300) Add Turkish translation (@feyzo)
+- [#298](https://github.com/bcoe/yargs/pull/298) Add Norwegian Bokmål translation (@sindresorhus)
+- [#297](https://github.com/bcoe/yargs/pull/297) Fix for layout of cjk characters (@disjukr)
+- [#296](https://github.com/bcoe/yargs/pull/296) Add Korean translation (@disjukr)
+
+### v3.30.0 (2015/11/13 16:29 +07:00)
+
+- [#293](https://github.com/bcoe/yargs/pull/293) Polish language support (@kamilogorek)
+- [#291](https://github.com/bcoe/yargs/pull/291) fix edge-cases with `.alias()` (@bcoe)
+- [#289](https://github.com/bcoe/yargs/pull/289) group options in custom groups (@bcoe)
+
+### v3.29.0 (2015/10/16 21:51 +07:00)
+
+- [#282](https://github.com/bcoe/yargs/pull/282) completions now accept promises (@LinusU)
+- [#281](https://github.com/bcoe/yargs/pull/281) fix parsing issues with dot notation (@bcoe)
+
+### v3.28.0 (2015/10/16 1:55 +07:00)
+
+- [#277](https://github.com/bcoe/yargs/pull/277) adds support for ansi escape codes (@bcoe)
+
+### v3.27.0 (2015/10/08 1:55 +00:00)
+
+- [#271](https://github.com/bcoe/yargs/pull/273) skips validation for help or version flags with exitProcess(false) (@tepez)
+- [#273](https://github.com/bcoe/yargs/pull/273) implements single output for errors with exitProcess(false) (@nexdrew)
+- [#269](https://github.com/bcoe/yargs/pull/269) verifies single output for errors with exitProcess(false) (@tepez)
+- [#268](https://github.com/bcoe/yargs/pull/268) adds Chinese translation (@qiu8310)
+- [#266](https://github.com/bcoe/yargs/pull/266) adds case for -- after -- in parser test (@geophree)
+
+### v3.26.0 (2015/09/25 2:14 +00:00)
+
+- [#263](https://github.com/bcoe/yargs/pull/263) document count() and option() object keys (@nexdrew)
+- [#259](https://github.com/bcoe/yargs/pull/259) remove util in readme (@38elements)
+- [#258](https://github.com/bcoe/yargs/pull/258) node v4 builds, update deps (@nexdrew)
+- [#257](https://github.com/bcoe/yargs/pull/257) fix spelling errors (@dkoleary88)
+
+### v3.25.0 (2015/09/13 7:38 -07:00)
+
+- [#254](https://github.com/bcoe/yargs/pull/254) adds Japanese translation (@oti)
+- [#253](https://github.com/bcoe/yargs/pull/253) fixes for tests on Windows (@bcoe)
+
+### v3.24.0 (2015/09/04 12:02 +00:00)
+
+- [#248](https://github.com/bcoe/yargs/pull/248) reinstate os-locale, no spawning (@nexdrew)
+- [#249](https://github.com/bcoe/yargs/pull/249) use travis container-based infrastructure (@nexdrew)
+- [#247](https://github.com/bcoe/yargs/pull/247) upgrade standard (@nexdrew)
+
+### v3.23.0 (2015/08/30 23:00 +00:00)
+
+- [#246](https://github.com/bcoe/yargs/pull/246) detect locale based only on environment variables (@bcoe)
+- [#244](https://github.com/bcoe/yargs/pull/244) adds Windows CI testing (@bcoe)
+- [#245](https://github.com/bcoe/yargs/pull/245) adds OSX CI testing (@bcoe, @nexdrew)
+
+### v3.22.0 (2015/08/28 22:26 +00:00)
+- [#242](https://github.com/bcoe/yargs/pull/242) adds detectLocale config option (@bcoe)
+
+### v3.21.1 (2015/08/28 20:58 +00:00)
+- [#240](https://github.com/bcoe/yargs/pull/240) hot-fix for Atom on Windows (@bcoe)
+
+### v3.21.0 (2015/08/21 21:20 +00:00)
+- [#238](https://github.com/bcoe/yargs/pull/238) upgrade camelcase, window-size, chai, mocha (@nexdrew)
+- [#237](https://github.com/bcoe/yargs/pull/237) adds defaultDescription to option() (@nexdrew)
+
+### v3.20.0 (2015/08/20 01:29 +00:00)
+- [#231](https://github.com/bcoe/yargs/pull/231) Merge pull request #231 from bcoe/detect-locale (@sindresorhus)
+- [#235](https://github.com/bcoe/yargs/pull/235) adds german translation to yargs (@maxrimue)
+
+### v3.19.0 (2015/08/14 05:12 +00:00)
+- [#224](https://github.com/bcoe/yargs/pull/224) added Portuguese translation (@codemonkey3045)
+
+### v3.18.1 (2015/08/12 05:53 +00:00)
+
+- [#228](https://github.com/bcoe/yargs/pull/228) notes about embedding yargs in Electron (@etiktin)
+- [#223](https://github.com/bcoe/yargs/pull/223) make booleans work in config files (@sgentle)
+
+### v3.18.0 (2015/08/06 20:05 +00:00)
+- [#222](https://github.com/bcoe/yargs/pull/222) updates fr locale (@nexdrew)
+- [#221](https://github.com/bcoe/yargs/pull/221) adds missing locale strings (@nexdrew)
+- [#220](https://github.com/bcoe/yargs/pull/220) adds es locale (@zkat)
+
+### v3.17.1 (2015/08/02 19:35 +00:00)
+- [#218](https://github.com/bcoe/yargs/pull/218) upgrades nyc (@bcoe)
+
+### v3.17.0 (2015/08/02 18:39 +00:00)
+- [#217](https://github.com/bcoe/yargs/pull/217) sort methods in README.md (@nexdrew)
+- [#215](https://github.com/bcoe/yargs/pull/215) adds fr locale (@LoicMahieu)
+
+### v3.16.0 (2015/07/30 04:35 +00:00)
+- [#210](https://github.com/bcoe/yargs/pull/210) adds i18n support to yargs (@bcoe)
+- [#209](https://github.com/bcoe/yargs/pull/209) adds choices type to yargs (@nexdrew)
+- [#207](https://github.com/bcoe/yargs/pull/207) pretty new shields from shields.io (@SimenB)
+- [#208](https://github.com/bcoe/yargs/pull/208) improvements to README.md (@nexdrew)
+- [#205](https://github.com/bcoe/yargs/pull/205) faster build times on Travis (@ChristianMurphy)
+
+### v3.15.0 (2015/07/06 06:01 +00:00)
+- [#197](https://github.com/bcoe/yargs/pull/197) tweaks to how errors bubble up from parser.js (@bcoe)
+- [#193](https://github.com/bcoe/yargs/pull/193) upgraded nyc, reporting now happens by default (@bcoe)
+
+### v3.14.0 (2015/06/28 02:12 +00:00)
+
+- [#192](https://github.com/bcoe/yargs/pull/192) standard style nits (@bcoe)
+- [#190](https://github.com/bcoe/yargs/pull/190) allow for hidden commands, e.g.,
+  .completion('completion', false) (@tschaub)
+
+### v3.13.0 (2015/06/24 04:12 +00:00)
+
+- [#187](https://github.com/bcoe/yargs/pull/187) completion now behaves differently
+  if it is being run in the context of a command (@tschaub)
+- [#186](https://github.com/bcoe/yargs/pull/186) if no matches are found for a completion
+  default to filename completion (@tschaub)
+
+### v3.12.0 (2015/06/19 03:23 +00:00)
+- [#183](https://github.com/bcoe/yargs/pull/183) don't complete commands if they've already been completed (@tschaub)
+- [#181](https://github.com/bcoe/yargs/pull/181) various fixes for completion. (@bcoe, @tschaub)
+- [#182](https://github.com/bcoe/yargs/pull/182) you can now set a maximum # of of required arguments (@bcoe)
+
+### v3.11.0 (2015/06/15 05:15 +00:00)
+
+- [#173](https://github.com/bcoe/yargs/pull/173) update standard, window-size, chai (@bcoe)
+- [#171](https://github.com/bcoe/yargs/pull/171) a description can now be set
+  when providing a config option. (@5c077yP)
+
+### v3.10.0 (2015/05/29 04:25 +00:00)
+
+- [#165](https://github.com/bcoe/yargs/pull/165) expose yargs.terminalWidth() thanks @ensonic (@bcoe)
+- [#164](https://github.com/bcoe/yargs/pull/164) better array handling thanks @getify (@bcoe)
+
+### v3.9.1 (2015/05/20 05:14 +00:00)
+- [b6662b6](https://github.com/bcoe/yargs/commit/b6662b6774cfeab4876f41ec5e2f67b7698f4e2f) clarify .config() docs (@linclark)
+- [0291360](https://github.com/bcoe/yargs/commit/02913606285ce31ce81d7f12c48d8a3029776ec7) fixed tests, switched to nyc for coverage, fixed security issue, added Lin as collaborator (@bcoe)
+
+### v3.9.0 (2015/05/10 18:32 +00:00)
+- [#157](https://github.com/bcoe/yargs/pull/157) Merge pull request #157 from bcoe/command-yargs. allows handling of command specific arguments. Thanks for the suggestion @ohjames (@bcoe)
+- [#158](https://github.com/bcoe/yargs/pull/158) Merge pull request #158 from kemitchell/spdx-license. Update license format (@kemitchell)
+
+### v3.8.0 (2015/04/24 23:10 +00:00)
+- [#154](https://github.com/bcoe/yargs/pull/154) showHelp's method signature was misleading fixes #153 (@bcoe)
+- [#151](https://github.com/bcoe/yargs/pull/151) refactor yargs' table layout logic to use new helper library (@bcoe)
+- [#150](https://github.com/bcoe/yargs/pull/150) Fix README example in argument requirements (@annonymouse)
+
+### v3.7.2 (2015/04/13 11:52 -07:00)
+
+* [679fbbf](https://github.com/bcoe/yargs/commit/679fbbf55904030ccee8a2635e8e5f46551ab2f0) updated yargs to use the [standard](https://github.com/feross/standard) style guide (agokjr)
+* [22382ee](https://github.com/bcoe/yargs/commit/22382ee9f5b495bc2586c1758cd1091cec3647f9 various bug fixes for $0 (@nylen)
+
+### v3.7.1 (2015/04/10 11:06 -07:00)
+
+* [89e1992](https://github.com/bcoe/yargs/commit/89e1992a004ba73609b5f9ee6890c4060857aba4) detect iojs bin along with node bin. (@bcoe)
+* [755509e](https://github.com/bcoe/yargs/commit/755509ea90041e5f7833bba3b8c5deffe56f0aab) improvements to example documentation in README.md (@rstacruz)
+* [0d2dfc8](https://github.com/bcoe/yargs/commit/0d2dfc822a43418242908ad97ddd5291a1b35dc6) showHelp() no longer requires that .argv has been called (@bcoe)
+
+### v3.7.0 (2015/04/04 02:29 -07:00)
+
+* [56cbe2d](https://github.com/bcoe/yargs/commit/56cbe2ddd33dc176dcbf97ba40559864a9f114e4) make .requiresArg() work with type hints. (@bcoe).
+* [2f5d562](https://github.com/bcoe/yargs/commit/2f5d5624f736741deeedf6a664d57bc4d857bdd0) serialize arrays and objects in usage strings. (@bcoe).
+* [5126304](https://github.com/bcoe/yargs/commit/5126304dd18351fc28f10530616fdd9361e0af98) be more lenient about alias/primary key ordering in chaining API. (@bcoe)
+
+### v3.6.0 (2015/03/21 01:00 +00:00)
+- [4e24e22](https://github.com/bcoe/yargs/commit/4e24e22e6a195e55ab943ede704a0231ac33b99c) support for .js configuration files. (@pirxpilot)
+
+### v3.5.4 (2015/03/12 05:56 +00:00)
+- [c16cc08](https://github.com/bcoe/yargs/commit/c16cc085501155cf7fd853ccdf8584b05ab92b78) message for non-option arguments is now optional, thanks to (@raine)
+
+### v3.5.3 (2015/03/09 06:14 +00:00)
+- [870b428](https://github.com/bcoe/yargs/commit/870b428cf515d560926ca392555b7ad57dba9e3d) completion script was missing in package.json (@bcoe)
+
+### v3.5.2 (2015/03/09 06:11 +00:00)
+- [58a4b24](https://github.com/bcoe/yargs/commit/58a4b2473ebbb326713d522be53e32d3aabb08d2) parse was being called multiple times, resulting in strange behavior (@bcoe)
+
+### v3.5.1 (2015/03/09 04:55 +00:00)
+- [4e588e0](https://github.com/bcoe/yargs/commit/4e588e055afbeb9336533095f051496e3977f515) accidentally left testing logic in (@bcoe)
+
+### v3.5.0 (2015/03/09 04:49 +00:00)
+- [718bacd](https://github.com/bcoe/yargs/commit/718bacd81b9b44f786af76b2afe491fe06274f19) added support for bash completions see #4 (@bcoe)
+- [a192882](https://github.com/bcoe/yargs/commit/a19288270fc431396c42af01125eeb4443664528) downgrade to mocha 2.1.0 until https://github.com/mochajs/mocha/issues/1585 can be sorted out (@bcoe)
+
+### v3.4.7 (2015/03/09 04:09 +00:00)
+- [9845e5c](https://github.com/bcoe/yargs/commit/9845e5c1a9c684ba0be3f0bfb40e7b62ab49d9c8) the Argv singleton was not being updated when manually parsing arguments, fixes #114 (@bcoe)
+
+### v3.4.6 (2015/03/09 04:01 +00:00)
+- [45b4c80](https://github.com/bcoe/yargs/commit/45b4c80b890d02770b0a94f326695a8a566e8fe9) set placeholders for all keys fixes #115 (@bcoe)
+
+### v3.4.5 (2015/03/01 20:31 +00:00)
+- [a758e0b](https://github.com/bcoe/yargs/commit/a758e0b2556184f067cf3d9c4ef886d39817ebd2) fix for count consuming too many arguments (@bcoe)
+
+### v3.4.4 (2015/02/28 04:52 +00:00)
+- [0476af7](https://github.com/bcoe/yargs/commit/0476af757966acf980d998b45108221d4888cfcb) added nargs feature, allowing you to specify the number of arguments after an option (@bcoe)
+- [092477d](https://github.com/bcoe/yargs/commit/092477d7ab3efbf0ba11cede57f7d8cfc70b024f) updated README with full example of v3.0 API (@bcoe)
+
+### v3.3.3 (2015/02/28 04:23 +00:00)
+- [0c4b769](https://github.com/bcoe/yargs/commit/0c4b769516cd8d93a7c4e5e675628ae0049aa9a8) remove string dependency, which conflicted with other libraries see #106 (@bcoe)
+
+### v3.3.2 (2015/02/28 04:11 +00:00)
+- [2a98906](https://github.com/bcoe/yargs/commit/2a9890675821c0e7a12f146ce008b0562cb8ec9a) add $0 to epilog (@schnittstabil)
+
+### v3.3.1 (2015/02/24 03:28 +00:00)
+- [ad485ce](https://github.com/bcoe/yargs/commit/ad485ce748ebdfce25b88ef9d6e83d97a2f68987) fix for applying defaults to camel-case args (@bcoe)
+
+### v3.3.0 (2015/02/24 00:49 +00:00)
+- [8bfe36d](https://github.com/bcoe/yargs/commit/8bfe36d7fb0f93a799ea3f4c756a7467c320f8c0) fix and document restart() command, as a tool for building nested CLIs (@bcoe)
+
+### v3.2.1 (2015/02/22 05:45 +00:00)
+- [49a6d18](https://github.com/bcoe/yargs/commit/49a6d1822a4ef9b1ea6f90cc366be60912628885) you can now provide a function that generates a default value (@bcoe)
+
+### v3.2.0 (2015/02/22 05:24 +00:00)
+- [7a55886](https://github.com/bcoe/yargs/commit/7a55886c9343cf71a20744ca5cdd56d2ea7412d5) improvements to yargs two-column text layout (@bcoe)
+- [b6ab513](https://github.com/bcoe/yargs/commit/b6ab5136a4c3fa6aa496f6b6360382e403183989) Tweak NPM version badge (@nylen)
+
+### v3.1.0 (2015/02/19 19:37 +00:00)
+- [9bd2379](https://github.com/bcoe/yargs/commit/9bd237921cf1b61fd9f32c0e6d23f572fc225861) version now accepts a function, making it easy to load version #s from a package.json (@bcoe)
+
+### v3.0.4 (2015/02/14 01:40 +00:00)
+- [0b7c19b](https://github.com/bcoe/yargs/commit/0b7c19beaecb747267ca4cc10e5cb2a8550bc4b7) various fixes for dot-notation handling (@bcoe)
+
+### v3.0.3 (2015/02/14 00:59 +00:00)
+- [c3f35e9](https://github.com/bcoe/yargs/commit/c3f35e99bd5a0d278073fcadd95e2d778616cc17) make sure dot-notation is applied to aliases (@bcoe)
+
+### 3.0.2 (2015/02/13 16:50 +00:00)
+- [74c8967](https://github.com/bcoe/yargs/commit/74c8967c340c204a0a7edf8a702b6f46c2705435) document epilog shorthand of epilogue. (@bcoe)
+- [670110f](https://github.com/bcoe/yargs/commit/670110fc01bedc4831b6fec6afac54517d5a71bc) any non-truthy value now causes check to fail see #76 (@bcoe)
+- [0d8f791](https://github.com/bcoe/yargs/commit/0d8f791a33c11ced4cd431ea8d3d3a337d456b56) finished implementing my wish-list of fetures for yargs 3.0. see #88 (@bcoe)
+- [5768447](https://github.com/bcoe/yargs/commit/5768447447c4c8e8304f178846206ce86540f063) fix coverage. (@bcoe)
+- [82e793f](https://github.com/bcoe/yargs/commit/82e793f3f61c41259eaacb67f0796aea2cf2aaa0) detect console width and perform word-wrapping. (@bcoe)
+- [67476b3](https://github.com/bcoe/yargs/commit/67476b37eea07fee55f23f35b9e0c7d76682b86d) refactor two-column table layout so that we can use it for examples and usage (@bcoe)
+- [4724cdf](https://github.com/bcoe/yargs/commit/4724cdfcc8e37ae1ca3dcce9d762f476e9ef4bb4) major refactor of index.js, in prep for 3.x release. (@bcoe)
+
+### v2.3.0 (2015/02/08 20:41 +00:00)
+- [d824620](https://github.com/bcoe/yargs/commit/d824620493df4e63664af1fe320764dd1a9244e6) allow for undefined boolean defaults (@ashi009)
+
+### v2.2.0 (2015/02/08 20:07 +00:00)
+- [d6edd98](https://github.com/bcoe/yargs/commit/d6edd9848826e7389ed1393858c45d03961365fd) in-prep for further refactoring, and a 3.x release I've shuffled some things around and gotten test-coverage to 100%. (@bcoe)
+
+### v2.1.2 (2015/02/08 06:05 +00:00)
+- [d640745](https://github.com/bcoe/yargs/commit/d640745a7b9f8d476e0223879d056d18d9c265c4) switch to path.relative (@bcoe)
+- [3bfd41f](https://github.com/bcoe/yargs/commit/3bfd41ff262a041f29d828b88936a79c63cad594) remove mocha.opts. (@bcoe)
+- [47a2f35](https://github.com/bcoe/yargs/commit/47a2f357091db70903a402d6765501c1d63f15fe) document using .string('_') for string ids. see #56 (@bcoe)
+- [#57](https://github.com/bcoe/yargs/pull/57) Merge pull request #57 from eush77/option-readme (@eush77)
+
+### v2.1.1 (2015/02/06 08:08 +00:00)
+- [01c6c61](https://github.com/bcoe/yargs/commit/01c6c61d67b4ebf88f41f0b32a345ec67f0ac17d) fix for #71, 'newAliases' of undefined (@bcoe)
+
+### v2.1.0 (2015/02/06 07:59 +00:00)
+- [6a1a3fa](https://github.com/bcoe/yargs/commit/6a1a3fa731958e26ccd56885f183dd8985cc828f) try to guess argument types, and apply sensible defaults see #73 (@bcoe)
+
+### v2.0.1 (2015/02/06 07:54 +00:00)
+- [96a06b2](https://github.com/bcoe/yargs/commit/96a06b2650ff1d085a52b7328d8bba614c20cc12) Fix for strange behavior with --sort option, see #51 (@bcoe)
+
+### v2.0.0 (2015/02/06 07:45 +00:00)
+- [0250517](https://github.com/bcoe/yargs/commit/0250517c9643e53f431b824e8ccfa54937414011) - [108fb84](https://github.com/bcoe/yargs/commit/108fb8409a3a63dcaf99d917fe4dfcfaa1de236d) fixed bug with boolean parsing, when bools separated by = see #66 (@bcoe)
+- [a465a59](https://github.com/bcoe/yargs/commit/a465a5915f912715738de890982e4f8395958b10) Add `files` field to the package.json (@shinnn)
+- [31043de](https://github.com/bcoe/yargs/commit/31043de7a38a17c4c97711f1099f5fb164334db3) fix for yargs.argv having the same keys added multiple times see #63 (@bcoe)
+- [2d68c5b](https://github.com/bcoe/yargs/commit/2d68c5b91c976431001c4863ce47c9297850f1ad) Disable process.exit calls using .exitProcess(false) (@cianclarke)
+- [45da9ec](https://github.com/bcoe/yargs/commit/45da9ec4c55a7bd394721bc6a1db0dabad7bc52a) Mention .option in README (@eush77)
+
+### v1.3.2 (2014/10/06 21:56 +00:00)
+- [b8d3472](https://github.com/bcoe/yargs/commit/b8d34725482e5821a3cc809c0df71378f282f526) 1.3.2 (@chevex)
+
+### list (2014/08/30 18:41 +00:00)
+- [fbc777f](https://github.com/bcoe/yargs/commit/fbc777f416eeefd37c84e44d27d7dfc7c1925721) Now that yargs is the successor to optimist, I'm changing the README language to be more universal. Pirate speak isn't very accessible to non-native speakers. (@chevex)
+- [a54d068](https://github.com/bcoe/yargs/commit/a54d0682ae2efc2394d407ab171cc8a8bbd135ea) version output will not print extra newline (@boneskull)
+- [1cef5d6](https://github.com/bcoe/yargs/commit/1cef5d62a9d6d61a3948a49574892e01932cc6ae) Added contributors section to package.json (@chrisn)
+- [cc295c0](https://github.com/bcoe/yargs/commit/cc295c0a80a2de267e0155b60d315fc4b6f7c709) Added 'require' and 'required' as synonyms for 'demand' (@chrisn)
+- [d0bf951](https://github.com/bcoe/yargs/commit/d0bf951d949066b6280101ed606593d079ee15c8) Updating minimist. (@chevex)
+- [c15f8e7](https://github.com/bcoe/yargs/commit/c15f8e7f245b261e542cf205ce4f4313630cbdb4) Fix #31 (bad interaction between camelCase options and strict mode) (@nylen)
+- [d991b9b](https://github.com/bcoe/yargs/commit/d991b9be687a68812dee1e3b185ba64b7778b82d) Added .help() and .version() methods (@chrisn)
+- [e8c8aa4](https://github.com/bcoe/yargs/commit/e8c8aa46268379357cb11e9fc34b8c403037724b) Added .showHelpOnFail() method (@chrisn)
+- [e855af4](https://github.com/bcoe/yargs/commit/e855af4a933ea966b5bbdd3c4c6397a4bac1a053) Allow boolean flag with .demand() (@chrisn)
+- [14dbec2](https://github.com/bcoe/yargs/commit/14dbec24fb7380683198e2b20c4deb8423e64bea) Fixes issue #22. Arguments are no longer printed to the console when using .config. (@chevex)
+- [bef74fc](https://github.com/bcoe/yargs/commit/bef74fcddc1544598a804f80d0a3728459f196bf) Informing users that Yargs is the official optimist successor. (@chevex)
+- [#24](https://github.com/bcoe/yargs/pull/24) Merge pull request #24 from chrisn/strict (@chrisn)
+- [889a2b2](https://github.com/bcoe/yargs/commit/889a2b28eb9768801b05163360a470d0fd6c8b79) Added requiresArg option, for options that require values (@chrisn)
+- [eb16369](https://github.com/bcoe/yargs/commit/eb163692262be1fe80b992fd8803d5923c5a9b18) Added .strict() method, to report error if unknown arguments are given (@chrisn)
+- [0471c3f](https://github.com/bcoe/yargs/commit/0471c3fd999e1ad4e6cded88b8aa02013b66d14f) Changed optimist to yargs in usage-options.js example (@chrisn)
+- [5c88f74](https://github.com/bcoe/yargs/commit/5c88f74e3cf031b17c54b4b6606c83e485ff520e) Change optimist to yargs in examples (@chrisn)
+- [66f12c8](https://github.com/bcoe/yargs/commit/66f12c82ba3c943e4de8ca862980e835da8ecb3a) Fix a couple of bad interactions between aliases and defaults (@nylen)
+- [8fa1d80](https://github.com/bcoe/yargs/commit/8fa1d80f14b03eb1f2898863a61f1d1615bceb50) Document second argument of usage(message, opts) (@Gobie)
+- [56e6528](https://github.com/bcoe/yargs/commit/56e6528cf674ff70d63083fb044ff240f608448e) For "--some-option", also set argv.someOption (@nylen)
+- [ed5f6d3](https://github.com/bcoe/yargs/commit/ed5f6d33f57ad1086b11c91b51100f7c6c7fa8ee) Finished porting unit tests to Mocha. (@chevex)
+
+### v1.0.15 (2014/02/05 23:18 +00:00)
+- [e2b1fc0](https://github.com/bcoe/yargs/commit/e2b1fc0c4a59cf532ae9b01b275e1ef57eeb64d2) 1.0.15 update to badges (@chevex)
+
+### v1.0.14 (2014/02/05 23:17 +00:00)
+- [f33bbb0](https://github.com/bcoe/yargs/commit/f33bbb0f00fe18960f849cc8e15a7428a4cd59b8) Revert "Fixed issue which caused .demand function not to work correctly." (@chevex)
+
+### v1.0.13 (2014/02/05 22:13 +00:00)
+- [6509e5e](https://github.com/bcoe/yargs/commit/6509e5e7dee6ef1a1f60eea104be0faa1a045075) Fixed issue which caused .demand function not to work correctly. (@chevex)
+
+### v1.0.12 (2013/12/13 00:09 +00:00)
+- [05eb267](https://github.com/bcoe/yargs/commit/05eb26741c9ce446b33ff006e5d33221f53eaceb) 1.0.12 (@chevex)
+
+### v1.0.11 (2013/12/13 00:07 +00:00)
+- [c1bde46](https://github.com/bcoe/yargs/commit/c1bde46e37318a68b87d17a50c130c861d6ce4a9) 1.0.11 (@chevex)
+
+### v1.0.10 (2013/12/12 23:57 +00:00)
+- [dfebf81](https://github.com/bcoe/yargs/commit/dfebf8164c25c650701528ee581ca483a99dc21c) Fixed formatting in README (@chevex)
+
+### v1.0.9 (2013/12/12 23:47 +00:00)
+- [0b4e34a](https://github.com/bcoe/yargs/commit/0b4e34af5e6d84a9dbb3bb6d02cd87588031c182) Update README.md (@chevex)
+
+### v1.0.8 (2013/12/06 16:36 +00:00)
+- [#1](https://github.com/bcoe/yargs/pull/1) fix error caused by check() see #1 (@martinheidegger)
+
+### v1.0.7 (2013/11/24 18:01 +00:00)
+- [a247d88](https://github.com/bcoe/yargs/commit/a247d88d6e46644cbb7303c18b1bb678fc132d72) Modified Pirate Joe image. (@chevex)
+
+### v1.0.6 (2013/11/23 19:21 +00:00)
+- [d7f69e1](https://github.com/bcoe/yargs/commit/d7f69e1d34bc929736a8bdccdc724583e21b7eab) Updated Pirate Joe image. (@chevex)
+
+### v1.0.5 (2013/11/23 19:09 +00:00)
+- [ece809c](https://github.com/bcoe/yargs/commit/ece809cf317cc659175e1d66d87f3ca68c2760be) Updated readme notice again. (@chevex)
+
+### v1.0.4 (2013/11/23 19:05 +00:00)
+- [9e81e81](https://github.com/bcoe/yargs/commit/9e81e81654028f83ba86ffc3ac772a0476084e5e) Updated README with a notice about yargs being a fork of optimist and what that implies. (@chevex)
+
+### v1.0.3 (2013/11/23 17:43 +00:00)
+- [65e7a78](https://github.com/bcoe/yargs/commit/65e7a782c86764944d63d084416aba9ee6019c5f) Changed some small wording in README.md. (@chevex)
+- [459e20e](https://github.com/bcoe/yargs/commit/459e20e539b366b85128dd281ccd42221e96c7da) Fix a bug in the options function, when string and boolean options weren't applied to aliases. (@shockone)
+
+### v1.0.2 (2013/11/23 09:46 +00:00)
+- [3d80ebe](https://github.com/bcoe/yargs/commit/3d80ebed866d3799224b6f7d596247186a3898a9) 1.0.2 (@chevex)
+
+### v1.0.1 (2013/11/23 09:39 +00:00)
+- [f80ff36](https://github.com/bcoe/yargs/commit/f80ff3642d580d4b68bf9f5a94277481bd027142) Updated image. (@chevex)
+
+### v1.0.0 (2013/11/23 09:33 +00:00)
+- [54e31d5](https://github.com/bcoe/yargs/commit/54e31d505f820b80af13644e460894b320bf25a3) Rebranded from optimist to yargs in the spirit of the fork :D (@chevex)
+- [4ebb6c5](https://github.com/bcoe/yargs/commit/4ebb6c59f44787db7c24c5b8fe2680f01a23f498) Added documentation for demandCount(). (@chevex)
+- [4561ce6](https://github.com/bcoe/yargs/commit/4561ce66dcffa95f49e8b4449b25b94cd68acb25) Simplified the error messages returned by .check(). (@chevex)
+- [661c678](https://github.com/bcoe/yargs/commit/661c67886f479b16254a830b7e1db3be29e6b7a6) Fixed an issue with demand not accepting a zero value. (@chevex)
+- [731dd3c](https://github.com/bcoe/yargs/commit/731dd3c37624790490bd6df4d5f1da8f4348279e) Add .fail(fn) so death isn't the only option. Should fix issue #39. (@chevex)
+- [fa15417](https://github.com/bcoe/yargs/commit/fa15417ff9e70dace0d726627a5818654824c1d8) Added a few missing 'return self' (@chevex)
+- [e655e4d](https://github.com/bcoe/yargs/commit/e655e4d99d1ae1d3695ef755d51c2de08d669761) Fix showing help in certain JS environments. (@chevex)
+- [a746a31](https://github.com/bcoe/yargs/commit/a746a31cd47c87327028e6ea33762d6187ec5c87) Better string representation of default values. (@chevex)
+- [6134619](https://github.com/bcoe/yargs/commit/6134619a7e90b911d5443230b644c5d447c1a68c) Implies: conditional demands (@chevex)
+- [046b93b](https://github.com/bcoe/yargs/commit/046b93b5d40a27367af4cb29726e4d781d934639) Added support for JSON config files. (@chevex)
+- [a677ec0](https://github.com/bcoe/yargs/commit/a677ec0a0ecccd99c75e571d03323f950688da03) Add .example(cmd, desc) feature. (@chevex)
+- [1bd4375](https://github.com/bcoe/yargs/commit/1bd4375e11327ba1687d4bb6e5e9f3c30c1be2af) Added 'defaults' as alias to 'default' so as to avoid usage of a reserved keyword. (@chevex)
+- [6b753c1](https://github.com/bcoe/yargs/commit/6b753c16ca09e723060e70b773b430323b29c45c) add .normalize(args..) support for normalizing paths (@chevex)
+- [33d7d59](https://github.com/bcoe/yargs/commit/33d7d59341d364f03d3a25f0a55cb99004dbbe4b) Customize error messages with demand(key, msg) (@chevex)
+- [647d37f](https://github.com/bcoe/yargs/commit/647d37f164c20f4bafbf67dd9db6cd6e2cd3b49f) Merge branch 'rewrite-duplicate-test' of github.com:isbadawi/node-optimist (@chevex)
+- [9059d1a](https://github.com/bcoe/yargs/commit/9059d1ad5e8aea686c2a01c89a23efdf929fff2e) Pass aliases object to check functions for greater versatility. (@chevex)
+- [623dc26](https://github.com/bcoe/yargs/commit/623dc26c7331abff2465ef8532e3418996d42fe6) Added ability to count boolean options and rolled minimist library back into project. (@chevex)
+- [49f0dce](https://github.com/bcoe/yargs/commit/49f0dcef35de4db544c3966350d36eb5838703f6) Fixed small typo. (@chevex)
+- [79ec980](https://github.com/bcoe/yargs/commit/79ec9806d9ca6eb0014cfa4b6d1849f4f004baf2) Removed dependency on wordwrap module. (@chevex)
+- [ea14630](https://github.com/bcoe/yargs/commit/ea14630feddd69d1de99dd8c0e08948f4c91f00a) Merge branch 'master' of github.com:chbrown/node-optimist (@chevex)
+- [2b75da2](https://github.com/bcoe/yargs/commit/2b75da2624061e0f4f3107d20303c06ec9054906) Merge branch 'master' of github.com:seanzhou1023/node-optimist (@chevex)
+- [d9bda11](https://github.com/bcoe/yargs/commit/d9bda1116e26f3b40e833ca9ca19263afea53565) Merge branch 'patch-1' of github.com:thefourtheye/node-optimist (@chevex)
+- [d6cc606](https://github.com/bcoe/yargs/commit/d6cc6064a4f1bea38a16a4430b8a1334832fbeff) Renamed README. (@chevex)
+- [9498d3f](https://github.com/bcoe/yargs/commit/9498d3f59acfb5e102826503e681623c3a64b178) Renamed readme and added .gitignore. (@chevex)
+- [bbd1fe3](https://github.com/bcoe/yargs/commit/bbd1fe37fefa366dde0fb3dc44d91fe8b28f57f5) Included examples for ```help``` and ```showHelp``` functions and fixed few formatting issues (@thefourtheye)
+- [37fea04](https://github.com/bcoe/yargs/commit/37fea0470a5796a0294c1dcfff68d8041650e622) .alias({}) behaves differently based on mapping direction when generating descriptions (@chbrown)
+- [855b20d](https://github.com/bcoe/yargs/commit/855b20d0be567ca121d06b30bea64001b74f3d6d) Documented function signatures are useful for dynamically typed languages. (@chbrown)
+
+### 0.6.0 (2013/06/25 08:48 +00:00)
+- [d37bfe0](https://github.com/bcoe/yargs/commit/d37bfe05ae6d295a0ab481efe4881222412791f4) all tests passing using minimist (@substack)
+- [76f1352](https://github.com/bcoe/yargs/commit/76f135270399d01f2bbc621e524a5966e5c422fd) all parse tests now passing (@substack)
+- [a7b6754](https://github.com/bcoe/yargs/commit/a7b6754276c38d1565479a5685c3781aeb947816) using minimist, some tests passing (@substack)
+- [6655688](https://github.com/bcoe/yargs/commit/66556882aa731cbbbe16cc4d42c85740a2e98099) Give credit where its due (@DeadAlready)
+- [602a2a9](https://github.com/bcoe/yargs/commit/602a2a92a459f93704794ad51b115bbb08b535ce) v0.5.3 - Remove wordwrap as dependency (@DeadAlready)
+
+### 0.5.2 (2013/05/31 03:46 +00:00)
+- [4497ca5](https://github.com/bcoe/yargs/commit/4497ca55e332760a37b866ec119ded347ca27a87) fixed the whitespace bug without breaking anything else (@substack)
+- [5a3dd1a](https://github.com/bcoe/yargs/commit/5a3dd1a4e0211a38613c6e02f61328e1031953fa) failing test for whitespace arg (@substack)
+
+### 0.5.1 (2013/05/30 07:17 +00:00)
+- [a20228f](https://github.com/bcoe/yargs/commit/a20228f62a454755dd07f628a7c5759113918327) fix parse() to work with functions before it (@substack)
+- [b13bd4c](https://github.com/bcoe/yargs/commit/b13bd4cac856a9821d42fa173bdb58f089365a7d) failing test for parse() with modifiers (@substack)
+
+### 0.5.0 (2013/05/18 21:59 +00:00)
+- [c474a64](https://github.com/bcoe/yargs/commit/c474a649231527915c222156e3b40806d365a87c) fixes for dash (@substack)
+
+### 0.4.0 (2013/04/13 19:03 +00:00)
+- [dafe3e1](https://github.com/bcoe/yargs/commit/dafe3e18d7c6e7c2d68e06559df0e5cbea3adb14) failing short test (@substack)
+
+### 0.3.7 (2013/04/04 04:07 +00:00)
+- [6c7a0ec](https://github.com/bcoe/yargs/commit/6c7a0ec94ce4199a505f0518b4d6635d4e47cc81) Fix for windows. On windows there is no _ in environment. (@hdf)
+
+### 0.3.6 (2013/04/04 04:04 +00:00)
+- [e72346a](https://github.com/bcoe/yargs/commit/e72346a727b7267af5aa008b418db89970873f05) Add support for newlines in -a="" arguments (@danielbeardsley)
+- [71e1fb5](https://github.com/bcoe/yargs/commit/71e1fb55ea9987110a669ac6ec12338cfff3821c) drop 0.4, add 0.8 to travis (@substack)
+
+### 0.3.5 (2012/10/10 11:09 +00:00)
+- [ee692b3](https://github.com/bcoe/yargs/commit/ee692b37554c70a0bb16389a50a26b66745cbbea) Fix parsing booleans (@vojtajina)
+- [5045122](https://github.com/bcoe/yargs/commit/5045122664c3f5b4805addf1be2148d5856f7ce8) set $0 properly in the tests (@substack)
+
+### 0.3.4 (2012/04/30 06:54 +00:00)
+- [f28c0e6](https://github.com/bcoe/yargs/commit/f28c0e62ca94f6e0bb2e6d82fc3d91a55e69b903) bump for string "true" params (@substack)
+- [8f44aeb](https://github.com/bcoe/yargs/commit/8f44aeb74121ddd689580e2bf74ef86a605e9bf2) Fix failing test for aliased booleans. (@coderarity)
+- [b9f7b61](https://github.com/bcoe/yargs/commit/b9f7b613b1e68e11e6c23fbda9e555a517dcc976) Add failing test for short aliased booleans. (@coderarity)
+
+### 0.3.3 (2012/04/30 06:45 +00:00)
+- [541bac8](https://github.com/bcoe/yargs/commit/541bac8dd787a5f1a5d28f6d8deb1627871705e7) Fixes #37.
+
+### 0.3.2 (2012/04/12 20:28 +00:00)
+- [3a0f014](https://github.com/bcoe/yargs/commit/3a0f014c1451280ac1c9caa1f639d31675586eec) travis badge (@substack)
+- [4fb60bf](https://github.com/bcoe/yargs/commit/4fb60bf17845f4ce3293f8ca49c9a1a7c736cfce) Fix boolean aliases. (@coderarity)
+- [f14dda5](https://github.com/bcoe/yargs/commit/f14dda546efc4fe06ace04d36919bfbb7634f79b) Adjusted package.json to use tap (@jfhbrook)
+- [88e5d32](https://github.com/bcoe/yargs/commit/88e5d32295be6e544c8d355ff84e355af38a1c74) test/usage.js no longer hangs (@jfhbrook)
+- [e1e740c](https://github.com/bcoe/yargs/commit/e1e740c27082f3ce84deca2093d9db2ef735d0e5) two tests for combined boolean/alias opts parsing (@jfhbrook)
+
+### 0.3.1 (2011/12/31 08:44 +00:00)
+- [d09b719](https://github.com/bcoe/yargs/commit/d09b71980ef711b6cf3918cd19beec8257e40e82) If "default" is set to false it was not passed on, fixed. (@wolframkriesing)
+
+### 0.3.0 (2011/12/09 06:03 +00:00)
+- [6e74aa7](https://github.com/bcoe/yargs/commit/6e74aa7b46a65773e20c0cb68d2d336d4a0d553d) bump and documented dot notation (@substack)
+
+### 0.2.7 (2011/10/20 02:25 +00:00)
+- [94adee2](https://github.com/bcoe/yargs/commit/94adee20e17b58d0836f80e8b9cdbe9813800916) argv._ can be told 'Hey! argv._! Don't be messing with my args.', and it WILL obey (@colinta)
+- [c46fdd5](https://github.com/bcoe/yargs/commit/c46fdd56a05410ae4a1e724a4820c82e77ff5469) optimistic critter image (@substack)
+- [5c95c73](https://github.com/bcoe/yargs/commit/5c95c73aedf4c7482bd423e10c545e86d7c8a125) alias options() to option() (@substack)
+- [f7692ea](https://github.com/bcoe/yargs/commit/f7692ea8da342850af819367833abb685fde41d8) [fix] Fix for parsing boolean edge case (@indexzero)
+- [d1f92d1](https://github.com/bcoe/yargs/commit/d1f92d1425bd7f356055e78621b30cdf9741a3c2)
+- [b01bda8](https://github.com/bcoe/yargs/commit/b01bda8d86e455bbf74ce497864cb8ab5b9fb847) [fix test] Update to ensure optimist is aware of default booleans. Associated tests included (@indexzero)
+- [aa753e7](https://github.com/bcoe/yargs/commit/aa753e7c54fb3a12f513769a0ff6d54aa0f63943) [dist test] Update devDependencies in package.json. Update test pathing to be more npm and require.paths future-proof (@indexzero)
+- [7bfce2f](https://github.com/bcoe/yargs/commit/7bfce2f3b3c98e6539e7549d35fbabced7e9341e) s/sys/util/ (@substack)
+- [d420a7a](https://github.com/bcoe/yargs/commit/d420a7a9c890d2cdb11acfaf3ea3f43bc3e39f41) update usage output (@substack)
+- [cf86eed](https://github.com/bcoe/yargs/commit/cf86eede2e5fc7495b6ec15e6d137d9ac814f075) some sage readme protips about parsing rules (@substack)
+- [5da9f7a](https://github.com/bcoe/yargs/commit/5da9f7a5c0e1758ec7c5801fb3e94d3f6e970513) documented all the methods finally (@substack)
+- [8ca6879](https://github.com/bcoe/yargs/commit/8ca6879311224b25933642987300f6a29de5c21b) fenced syntax highlighting (@substack)
+- [b72bacf](https://github.com/bcoe/yargs/commit/b72bacf1d02594778c1935405bc8137eb61761dc) right-alignment of wrapped extra params (@substack)
+- [2b980bf](https://github.com/bcoe/yargs/commit/2b980bf2656b4ee8fc5134dc5f56a48855c35198) now with .wrap() (@substack)
+- [d614f63](https://github.com/bcoe/yargs/commit/d614f639654057d1b7e35e3f5a306e88ec2ad1e4) don't show 'Options:' when there aren't any (@substack)
+- [691eda3](https://github.com/bcoe/yargs/commit/691eda354df97b5a86168317abcbcaabdc08a0fb) failing test for multi-aliasing (@substack)
+- [0826c9f](https://github.com/bcoe/yargs/commit/0826c9f462109feab2bc7a99346d22e72bf774b7) "Options:" > "options:" (@substack)
+- [72f7490](https://github.com/bcoe/yargs/commit/72f749025d01b7f295738ed370a669d885fbada0) [minor] Update formatting for `.showHelp()` (@indexzero)
+- [75aecce](https://github.com/bcoe/yargs/commit/75aeccea74329094072f95800e02c275e7d999aa) options works again, too lazy to write a proper test right now (@substack)
+- [f742e54](https://github.com/bcoe/yargs/commit/f742e5439817c662dc3bd8734ddd6467e6018cfd) line_count_options example, which breaks (@substack)
+- [4ca06b8](https://github.com/bcoe/yargs/commit/4ca06b8b4ea99b5d5714b315a2a8576bee6e5537) line count example (@substack)
+- [eeb8423](https://github.com/bcoe/yargs/commit/eeb8423e0a5ecc9dc3eb1e6df9f3f8c1c88f920b) remove self.argv setting in boolean (@substack)
+- [6903412](https://github.com/bcoe/yargs/commit/69034126804660af9cc20ea7f4457b50338ee3d7) removed camel case for now (@substack)
+- [5a0d88b](https://github.com/bcoe/yargs/commit/5a0d88bf23e9fa79635dd034e2a1aa992acc83cd) remove dead longest checking code (@substack)
+- [d782170](https://github.com/bcoe/yargs/commit/d782170babf7284b1aa34f5350df0dd49c373fa8) .help() too (@substack)
+- [622ec17](https://github.com/bcoe/yargs/commit/622ec17379bb5374fdbb190404c82bc600975791) rm old help generator (@substack)
+- [7c8baac](https://github.com/bcoe/yargs/commit/7c8baac4d66195e9f5158503ea9ebfb61153dab7) nub keys (@substack)
+- [8197785](https://github.com/bcoe/yargs/commit/8197785ad4762465084485b041abd722f69bf344) generate help message based on the previous calls, todo: nub (@substack)
+- [3ffbdc3](https://github.com/bcoe/yargs/commit/3ffbdc33c8f5e83d4ea2ac60575ce119570c7ede) stub out new showHelp, better checks (@substack)
+- [d4e21f5](https://github.com/bcoe/yargs/commit/d4e21f56a4830f7de841900d3c79756fb9886184) let .options() take single options too (@substack)
+- [3c4cf29](https://github.com/bcoe/yargs/commit/3c4cf2901a29bac119cca8e983028d8669230ec6) .options() is now heaps simpler (@substack)
+- [89f0d04](https://github.com/bcoe/yargs/commit/89f0d043cbccd302f10ab30c2069e05d2bf817c9) defaults work again, all tests pass (@substack)
+- [dd87333](https://github.com/bcoe/yargs/commit/dd8733365423006a6e4156372ebb55f98323af58) update test error messages, down to 2 failing tests (@substack)
+- [53f7bc6](https://github.com/bcoe/yargs/commit/53f7bc626b9875f2abdfc5dd7a80bde7f14143a3) fix for bools doubling up, passes the parse test again, others fail (@substack)
+- [2213e2d](https://github.com/bcoe/yargs/commit/2213e2ddc7263226fba717fb041dc3fde9bc2ee4) refactored for an argv getter, failing several tests (@substack)
+- [d1e7379](https://github.com/bcoe/yargs/commit/d1e737970f15c6c006bebdd8917706827ff2f0f2) just rescan for now, alias test passes (@substack)
+- [b2f8c99](https://github.com/bcoe/yargs/commit/b2f8c99cc477a8eb0fdf4cf178e1785b63185cfd) failing alias test (@substack)
+- [d0c0174](https://github.com/bcoe/yargs/commit/d0c0174daa144bfb6dc7290fdc448c393c475e15) .alias() (@substack)
+- [d85f431](https://github.com/bcoe/yargs/commit/d85f431ad7d07b058af3f2a57daa51495576c164) [api] Remove `.describe()` in favor of building upon the existing `.usage()` API (@indexzero)
+- [edbd527](https://github.com/bcoe/yargs/commit/edbd5272a8e213e71acd802782135c7f9699913a) [doc api] Add `.describe()`, `.options()`, and `.showHelp()` methods along with example. (@indexzero)
+- [be4902f](https://github.com/bcoe/yargs/commit/be4902ff0961ae8feb9093f2c0a4066463ded2cf) updates for coffee since it now does argv the node way (@substack)
+- [e24cb23](https://github.com/bcoe/yargs/commit/e24cb23798ee64e53b60815e7fda78b87f42390c) more general coffeescript detection (@substack)
+- [78ac753](https://github.com/bcoe/yargs/commit/78ac753e5d0ec32a96d39d893272afe989e42a4d) Don't trigger the CoffeeScript hack when running under node_g. (@papandreou)
+- [bcfe973](https://github.com/bcoe/yargs/commit/bcfe9731d7f90d4632281b8a52e8d76eb0195ae6) .string() but failing test (@substack)
+- [1987aca](https://github.com/bcoe/yargs/commit/1987aca28c7ba4e8796c07bbc547cb984804c826) test hex strings (@substack)
+- [ef36db3](https://github.com/bcoe/yargs/commit/ef36db32259b0b0d62448dc907c760e5554fb7e7) more keywords (@substack)
+- [cc53c56](https://github.com/bcoe/yargs/commit/cc53c56329960bed6ab077a79798e991711ba01d) Added camelCase function that converts --multi-word-option to camel case (so it becomes argv.multiWordOption). (@papandreou)
+- [60b57da](https://github.com/bcoe/yargs/commit/60b57da36797716e5783a633c6d5c79099016d45) fixed boolean bug by rescanning (@substack)
+- [dff6d07](https://github.com/bcoe/yargs/commit/dff6d078d97f8ac503c7d18dcc7b7a8c364c2883) boolean examples (@substack)
+- [0e380b9](https://github.com/bcoe/yargs/commit/0e380b92c4ef4e3c8dac1da18b5c31d85b1d02c9) boolean() with passing test (@substack)
+- [62644d4](https://github.com/bcoe/yargs/commit/62644d4bffbb8d1bbf0c2baf58a1d14a6359ef07) coffee compatibility with node regex for versions too (@substack)
+- [430fafc](https://github.com/bcoe/yargs/commit/430fafcf1683d23774772826581acff84b456827) argv._ fixed by fixing the coffee detection (@substack)
+- [343b8af](https://github.com/bcoe/yargs/commit/343b8afefd98af274ebe21b5a16b3a949ec5429f) whichNodeArgs test fails too (@substack)
+- [63df2f3](https://github.com/bcoe/yargs/commit/63df2f371f31e63d7f1dec2cbf0022a5f08da9d2) replicated mnot's bug in whichNodeEmpty test (@substack)
+- [35473a4](https://github.com/bcoe/yargs/commit/35473a4d93a45e5e7e512af8bb54ebb532997ae1) test for ./bin usage (@substack)
+- [13df151](https://github.com/bcoe/yargs/commit/13df151e44228eed10e5441c7cd163e086c458a4) don't coerce booleans to numbers (@substack)
+- [85f8007](https://github.com/bcoe/yargs/commit/85f8007e93b8be7124feea64b1f1916d8ba1894a) package bump for automatic number conversion (@substack)
+- [8f17014](https://github.com/bcoe/yargs/commit/8f170141cded4ccc0c6d67a849c5bf996aa29643) updated readme and examples with new auto-numberification goodness (@substack)
+- [73dc901](https://github.com/bcoe/yargs/commit/73dc9011ac968e39b55e19e916084a839391b506) auto number conversion works yay (@substack)
+- [bcec56b](https://github.com/bcoe/yargs/commit/bcec56b3d031e018064cbb691539ccc4f28c14ad) failing test for not-implemented auto numification (@substack)
+- [ebd2844](https://github.com/bcoe/yargs/commit/ebd2844d683feeac583df79af0e5124a7a7db04e) odd that eql doesn't check types careflly (@substack)
+- [fd854b0](https://github.com/bcoe/yargs/commit/fd854b02e512ce854b76386d395672a7969c1bc4) package author + keywords (@substack)
+- [656a1d5](https://github.com/bcoe/yargs/commit/656a1d5a1b7c0e49d72e80cb13f20671d56f76c6) updated readme with .default() stuff (@substack)
+- [cd7f8c5](https://github.com/bcoe/yargs/commit/cd7f8c55f0b82b79b690d14c5f806851236998a1) passing tests for new .default() behavior (@substack)
+- [932725e](https://github.com/bcoe/yargs/commit/932725e39ce65bc91a0385a5fab659a5fa976ac2) new default() thing for setting default key/values (@substack)
+- [4e6c7ab](https://github.com/bcoe/yargs/commit/4e6c7aba6374ac9ebc6259ecf91f13af7bce40e3) test for coffee usage (@substack)
+- [d54ffcc](https://github.com/bcoe/yargs/commit/d54ffccf2a5a905f51ed5108f7c647f35d64ae23) new --key value style with passing tests. NOTE: changes existing behavior (@substack)
+- [ed2a2d5](https://github.com/bcoe/yargs/commit/ed2a2d5d828100ebeef6385c0fb88d146a5cfe9b) package bump for summatix's coffee script fix (@substack)
+- [75a975e](https://github.com/bcoe/yargs/commit/75a975eed8430d28e2a79dc9e6d819ad545f4587) Added support for CoffeeScript (@summatix)
+- [56b2b1d](https://github.com/bcoe/yargs/commit/56b2b1de8d11f8a2b91979d8ae2d6db02d8fe64d) test coverage for the falsy check() usage (@substack)
+- [a4843a9](https://github.com/bcoe/yargs/commit/a4843a9f0e69ffb4afdf6a671d89eb6f218be35d) check bug fixed plus a handy string (@substack)
+- [857bd2d](https://github.com/bcoe/yargs/commit/857bd2db933a5aaa9cfecba0ced2dc9b415f8111) tests for demandCount, back up to 100% coverage (@substack)
+- [073b776](https://github.com/bcoe/yargs/commit/073b7768ebd781668ef05c13f9003aceca2f5c35) call demandCount from demand (@substack)
+- [4bd4b7a](https://github.com/bcoe/yargs/commit/4bd4b7a085c8b6ce1d885a0f486cc9865cee2db1) add demandCount to check for the number of arguments in the _ list (@marshall)
+- [b8689ac](https://github.com/bcoe/yargs/commit/b8689ac68dacf248119d242bba39a41cb0adfa07) Rebase checks. That will be its own module eventually. (@substack)
+- [e688370](https://github.com/bcoe/yargs/commit/e688370b576f0aa733c3f46183df69e1b561668e) a $0 like in perl (@substack)
+- [2e5e196](https://github.com/bcoe/yargs/commit/2e5e1960fc19afb21fb3293752316eaa8bcd3609) usage test hacking around process and console (@substack)
+- [fcc3521](https://github.com/bcoe/yargs/commit/fcc352163fbec6a1dfe8caf47a0df39de24fe016) description pun (@substack)
+- [87a1fe2](https://github.com/bcoe/yargs/commit/87a1fe29037ca2ca5fefda85141aaeb13e8ce761) mit/x11 license (@substack)
+- [8d089d2](https://github.com/bcoe/yargs/commit/8d089d24cd687c0bde3640a96c09b78f884900dd) bool example is more consistent and also shows off short option grouping (@substack)
+- [448d747](https://github.com/bcoe/yargs/commit/448d7473ac68e8e03d8befc9457b0d9e21725be0) start of the readme and examples (@substack)
+- [da74dea](https://github.com/bcoe/yargs/commit/da74dea799a9b59dbf022cbb8001bfdb0d52eec9) more tests for long and short captures (@substack)
+- [ab6387e](https://github.com/bcoe/yargs/commit/ab6387e6769ca4af82ca94c4c67c7319f0d9fcfa) silly bug in the tests with s/not/no/, all tests pass now (@substack)
+- [102496a](https://github.com/bcoe/yargs/commit/102496a319e8e06f6550d828fc2f72992c7d9ecc) hack an instance for process.argv onto Argv so the export can be called to create an instance or used for argv, which is the most common case (@substack)
+- [a01caeb](https://github.com/bcoe/yargs/commit/a01caeb532546d19f68f2b2b87f7036cfe1aaedd) divide example (@substack)
+- [443da55](https://github.com/bcoe/yargs/commit/443da55736acbaf8ff8b04d1b9ce19ab016ddda2) start of the lib with a package.json (@substack)
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/LICENSE b/legacy-libs/grpc-cloned/node_modules/yargs/LICENSE
new file mode 100644 (file)
index 0000000..432d1ae
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/README.md b/legacy-libs/grpc-cloned/node_modules/yargs/README.md
new file mode 100644 (file)
index 0000000..3649538
--- /dev/null
@@ -0,0 +1,1243 @@
+yargs
+========
+
+Yargs be a node.js library fer hearties tryin' ter parse optstrings.
+
+With yargs, ye be havin' a map that leads straight to yer treasure! Treasure of course, being a simple option hash.
+
+[![Build Status][travis-image]][travis-url]
+[![Dependency Status][gemnasium-image]][gemnasium-url]
+[![Coverage Status][coveralls-image]][coveralls-url]
+[![NPM version][npm-image]][npm-url]
+[![Windows Tests][windows-image]][windows-url]
+
+> Yargs is the official successor to optimist. Please feel free to submit issues and pull requests. If you'd like to contribute and don't know where to start, have a look at [the issue list](https://github.com/bcoe/yargs/issues) :)
+
+examples
+========
+
+With yargs, the options be just a hash!
+-------------------------------------------------------------------
+
+plunder.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+
+if (argv.ships > 3 && argv.distance < 53.5) {
+    console.log('Plunder more riffiwobbles!');
+}
+else {
+    console.log('Retreat from the xupptumblers!');
+}
+````
+
+***
+
+    $ ./plunder.js --ships=4 --distance=22
+    Plunder more riffiwobbles!
+
+    $ ./plunder.js --ships 12 --distance 98.7
+    Retreat from the xupptumblers!
+
+![Joe was one optimistic pirate.](http://i.imgur.com/4WFGVJ9.png)
+
+But don't walk the plank just yet! There be more! You can do short options:
+-------------------------------------------------
+
+short.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+````
+
+***
+
+    $ ./short.js -x 10 -y 21
+    (10,21)
+
+And booleans, both long, short, and even grouped:
+----------------------------------
+
+bool.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+
+if (argv.s) {
+    process.stdout.write(argv.fr ? 'Le perroquet dit: ' : 'The parrot says: ');
+}
+console.log(
+    (argv.fr ? 'couac' : 'squawk') + (argv.p ? '!' : '')
+);
+````
+
+***
+
+    $ ./bool.js -s
+    The parrot says: squawk
+
+    $ ./bool.js -sp
+    The parrot says: squawk!
+
+    $ ./bool.js -sp --fr
+    Le perroquet dit: couac!
+
+And non-hyphenated options too! Just use `argv._`!
+-------------------------------------------------
+
+nonopt.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+console.log(argv._);
+````
+
+***
+
+    $ ./nonopt.js -x 6.82 -y 3.35 rum
+    (6.82,3.35)
+    [ 'rum' ]
+
+    $ ./nonopt.js "me hearties" -x 0.54 yo -y 1.12 ho
+    (0.54,1.12)
+    [ 'me hearties', 'yo', 'ho' ]
+
+Yargs even counts your booleans!
+----------------------------------------------------------------------
+
+count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .count('verbose')
+    .alias('v', 'verbose')
+    .argv;
+
+VERBOSE_LEVEL = argv.verbose;
+
+function WARN()  { VERBOSE_LEVEL >= 0 && console.log.apply(console, arguments); }
+function INFO()  { VERBOSE_LEVEL >= 1 && console.log.apply(console, arguments); }
+function DEBUG() { VERBOSE_LEVEL >= 2 && console.log.apply(console, arguments); }
+
+WARN("Showing only important stuff");
+INFO("Showing semi-important stuff too");
+DEBUG("Extra chatty mode");
+````
+
+***
+    $ node count.js
+    Showing only important stuff
+
+    $ node count.js -v
+    Showing only important stuff
+    Showing semi-important stuff too
+
+    $ node count.js -vv
+    Showing only important stuff
+    Showing semi-important stuff too
+    Extra chatty mode
+
+    $ node count.js -v --verbose
+    Showing only important stuff
+    Showing semi-important stuff too
+    Extra chatty mode
+
+Tell users how to use yer options and make demands.
+-------------------------------------------------
+
+area.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .usage('Usage: $0 -w [num] -h [num]')
+    .demand(['w','h'])
+    .argv;
+
+console.log("The area is:", argv.w * argv.h);
+````
+
+***
+
+    $ ./area.js -w 55 -h 11
+    The area is: 605
+
+    $ node ./area.js -w 4.91 -w 2.51
+    Usage: area.js -w [num] -h [num]
+
+    Options:
+      -w  [required]
+      -h  [required]
+
+    Missing required arguments: h
+
+After yer demands have been met, demand more! Ask for non-hyphenated arguments!
+-----------------------------------------
+
+demand_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .demand(2)
+    .argv;
+console.dir(argv);
+````
+
+***
+
+       $ ./demand_count.js a
+
+       Not enough non-option arguments: got 1, need at least 2
+
+       $ ./demand_count.js a b
+       { _: [ 'a', 'b' ], '$0': 'demand_count.js' }
+
+       $ ./demand_count.js a b c
+       { _: [ 'a', 'b', 'c' ], '$0': 'demand_count.js' }
+
+EVEN MORE SHIVER ME TIMBERS!
+------------------
+
+default_singles.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .default('x', 10)
+    .default('y', 10)
+    .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+    $ ./default_singles.js -x 5
+    15
+
+default_hash.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .default({ x : 10, y : 10 })
+    .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+    $ ./default_hash.js -y 7
+    17
+
+And if you really want to get all descriptive about it...
+---------------------------------------------------------
+
+boolean_single.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .boolean('v')
+    .argv
+;
+console.dir(argv.v);
+console.dir(argv._);
+````
+
+***
+
+    $ ./boolean_single.js -v "me hearties" yo ho
+    true
+    [ 'me hearties', 'yo', 'ho' ]
+
+
+boolean_double.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .boolean(['x','y','z'])
+    .argv
+;
+console.dir([ argv.x, argv.y, argv.z ]);
+console.dir(argv._);
+````
+
+***
+
+    $ ./boolean_double.js -x -z one two three
+    [ true, false, true ]
+    [ 'one', 'two', 'three' ]
+
+Yargs is here to help you...
+---------------------------
+
+Ye can describe parameters fer help messages and set aliases. Yargs figures
+out how ter format a handy help string automatically.
+
+line_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .usage('Usage: $0 <command> [options]')
+    .command('count', 'Count the lines in a file')
+    .demand(1)
+    .example('$0 count -f foo.js', 'count the lines in the given file')
+    .demand('f')
+    .alias('f', 'file')
+    .nargs('f', 1)
+    .describe('f', 'Load a file')
+    .help('h')
+    .alias('h', 'help')
+    .epilog('copyright 2015')
+    .argv;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+    lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+    console.log(lines);
+});
+````
+
+***
+    $ node line_count.js count
+    Usage: line_count.js <command> [options]
+
+    Commands:
+      count    Count the lines in a file
+
+    Options:
+      -f, --file  Load a file        [required]
+      -h, --help  Show help           [boolean]
+
+    Examples:
+      line_count.js count -f foo.js  count the lines in the given file
+
+    copyright 2015
+
+    Missing required arguments: f
+
+    $ node line_count.js count --file line_count.js
+    26
+
+    $ node line_count.js count -f line_count.js
+    26
+
+methods
+=======
+
+By itself,
+
+````javascript
+require('yargs').argv
+````
+
+will use the `process.argv` array to construct the `argv` object.
+
+You can pass in the `process.argv` yourself:
+
+````javascript
+require('yargs')([ '-x', '1', '-y', '2' ]).argv
+````
+
+or use `.parse()` to do the same thing:
+
+````javascript
+require('yargs').parse([ '-x', '1', '-y', '2' ])
+````
+
+The rest of these methods below come in just before the terminating `.argv`.
+
+<a name="alias"></a>.alias(key, alias)
+------------------
+
+Set key names as equivalent such that updates to a key will propagate to aliases
+and vice-versa.
+
+Optionally `.alias()` can take an object that maps keys to aliases.
+Each key of this object should be the canonical version of the option, and each
+value should be a string or an array of strings.
+
+.argv
+-----
+
+Get the arguments as a plain old object.
+
+Arguments without a corresponding flag show up in the `argv._` array.
+
+The script name or node command is available at `argv.$0` similarly to how `$0`
+works in bash or perl.
+
+If `yargs` is executed in an environment that embeds node and there's no script name (e.g.
+[Electron](http://electron.atom.io/) or [nw.js](http://nwjs.io/)), it will ignore the first parameter since it
+expects it to be the script name. In order to override this behavior, use `.parse(process.argv.slice(1))`
+instead of `.argv` and the first parameter won't be ignored.
+
+<a name="array"></a>.array(key)
+----------
+
+Tell the parser to interpret `key` as an array. If `.array('foo')` is set,
+`--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
+
+<a name="boolean"></a>.boolean(key)
+-------------
+
+Interpret `key` as a boolean. If a non-flag option follows `key` in
+`process.argv`, that string won't get set as the value of `key`.
+
+`key` will default to `false`, unless a `default(key, undefined)` is
+explicitly set.
+
+If `key` is an array, interpret all the elements as booleans.
+
+.check(fn)
+----------
+
+Check that certain conditions are met in the provided arguments.
+
+`fn` is called with two arguments, the parsed `argv` hash and an array of options and their aliases.
+
+If `fn` throws or returns a non-truthy value, show the thrown error, usage information, and
+exit.
+
+<a name="choices"></a>.choices(key, choices)
+----------------------
+
+Limit valid values for `key` to a predefined set of `choices`, given as an array
+or as an individual value.
+
+```js
+var argv = require('yargs')
+  .alias('i', 'ingredient')
+  .describe('i', 'choose your sandwich ingredients')
+  .choices('i', ['peanut-butter', 'jelly', 'banana', 'pickles'])
+  .help('help')
+  .argv
+```
+
+If this method is called multiple times, all enumerated values will be merged
+together. Choices are generally strings or numbers, and value matching is
+case-sensitive.
+
+Optionally `.choices()` can take an object that maps multiple keys to their
+choices.
+
+Choices can also be specified as `choices` in the object given to `option()`.
+
+```js
+var argv = require('yargs')
+  .option('size', {
+    alias: 's',
+    describe: 'choose a size',
+    choices: ['xs', 's', 'm', 'l', 'xl']
+  })
+  .argv
+```
+
+.command(cmd, desc, [fn])
+-------------------
+
+Document the commands exposed by your application.
+
+Use `desc` to provide a description for each command your application accepts (the
+values stored in `argv._`).  Set `desc` to `false` to create a hidden command.
+Hidden commands don't show up in the help output and aren't available for
+completion.
+
+Optionally, you can provide a handler `fn` which will be executed when
+a given command is provided. The handler will be called with `yargs` and
+`argv` as arguments.
+
+`yargs` is a blank instance of yargs, which can be used to compose a nested
+hierarchy of options handlers.
+
+`argv` represents the arguments parsed prior to the
+command being executed (those described in the outer yargs instance).
+
+Here's an example of top-level and nested commands in action:
+
+```js
+var argv = require('yargs')
+  .usage('npm <command>')
+  .command('install', 'tis a mighty fine package to install')
+  .command('publish', 'shiver me timbers, should you be sharing all that', function (yargs, argv) {
+    argv = yargs.option('f', {
+      alias: 'force',
+      description: 'yar, it usually be a bad idea'
+    })
+    .help('help')
+    .argv
+  })
+  .help('help')
+  .argv;
+```
+
+.completion(cmd, [description], [fn]);
+-------------
+
+Enable bash-completion shortcuts for commands and options.
+
+`cmd`: When present in `argv._`, will result in the `.bashrc` completion script
+being outputted. To enable bash completions, concat the generated script to your
+`.bashrc` or `.bash_profile`.
+
+`description`: Provide a description in your usage instructions for the command
+that generates bash completion scripts.
+
+`fn`: Rather than relying on yargs' default completion functionality, which
+shiver me timbers is pretty awesome, you can provide your own completion
+method.
+
+```js
+var argv = require('yargs')
+  .completion('completion', function(current, argv) {
+    // 'current' is the current command being completed.
+    // 'argv' is the parsed arguments so far.
+    // simply return an array of completions.
+    return [
+      'foo',
+      'bar'
+    ];
+  })
+  .argv;
+```
+
+You can also provide asynchronous completions.
+
+```js
+var argv = require('yargs')
+  .completion('completion', function(current, argv, done) {
+    setTimeout(function() {
+      done([
+        'apple',
+        'banana'
+      ]);
+    }, 500);
+  })
+  .argv;
+```
+
+But wait, there's more! You can return an asynchronous promise.
+
+```js
+var argv = require('yargs')
+  .completion('completion', function(current, argv, done) {
+    return new Promise(function (resolve, reject) {
+      setTimeout(function () {
+        resolve(['apple', 'banana'])
+      }, 10)
+    })
+  })
+  .argv;
+```
+
+<a name="config"></a>.config(key, [description], [parseFn])
+------------
+
+Tells the parser that if the option specified by `key` is passed in, it
+should be interpreted as a path to a JSON config file. The file is loaded
+and parsed, and its properties are set as arguments.
+
+An optional `description` can be provided to customize the config (`key`) option
+in the usage string.
+
+An optional `parseFn` can be used to provide a custom parser. The parsing
+function must be synchronous, and should return an object containing
+key value pairs or an error.
+
+```js
+var argv = require('yargs')
+  .config('settings', function (configPath) {
+    return JSON.parse(fs.readFileSync(configPath, 'utf-8'))
+  })
+  .argv
+```
+
+<a name="count"></a>.count(key)
+------------
+
+Interpret `key` as a boolean flag, but set its parsed value to the number of
+flag occurrences rather than `true` or `false`. Default value is thus `0`.
+
+<a name="default"></a>.default(key, value, [description])
+--------------------
+
+Set `argv[key]` to `value` if no option was specified in `process.argv`.
+
+Optionally `.default()` can take an object that maps keys to default values.
+
+But wait, there's more! The default value can be a `function` which returns
+a value. The name of the function will be used in the usage string:
+
+```js
+var argv = require('yargs')
+  .default('random', function randomValue() {
+    return Math.random() * 256;
+  }).argv;
+```
+
+Optionally, `description` can also be provided and will take precedence over
+displaying the value in the usage instructions:
+
+```js
+.default('timeout', 60000, '(one-minute)')
+```
+
+<a name="demand"></a>.demand(key, [msg | boolean])
+------------------------------
+.demand(count, [max], [msg])
+------------------------------
+
+If `key` is a string, show the usage information and exit if `key` wasn't
+specified in `process.argv`.
+
+If `key` is a number, demand at least as many non-option arguments, which show
+up in `argv._`. A second number can also optionally be provided, which indicates
+the maximum number of non-option arguments.
+
+If `key` is an array, demand each element.
+
+If a `msg` string is given, it will be printed when the argument is missing,
+instead of the standard error message. This is especially helpful for the non-option arguments in `argv._`.
+
+If a `boolean` value is given, it controls whether the option is demanded;
+this is useful when using `.options()` to specify command line parameters.
+
+<a name="describe"></a>.describe(key, desc)
+--------------------
+
+Describe a `key` for the generated usage information.
+
+Optionally `.describe()` can take an object that maps keys to descriptions.
+
+.detectLocale(boolean)
+-----------
+
+Should yargs attempt to detect the os' locale? Defaults to `true`.
+
+.env([prefix])
+--------------
+
+Tell yargs to parse environment variables matching the given prefix and apply
+them to argv as though they were command line arguments.
+
+If this method is called with no argument or with an empty string or with `true`,
+then all env vars will be applied to argv.
+
+Program arguments are defined in this order of precedence:
+
+1. Command line args
+2. Config file
+3. Env var
+4. Configured defaults
+
+```js
+var argv = require('yargs')
+  .env('MY_PROGRAM')
+  .option('f', {
+    alias: 'fruit-thing',
+    default: 'apple'
+  })
+  .argv
+console.log(argv)
+```
+
+```
+$ node fruity.js
+{ _: [],
+  f: 'apple',
+  'fruit-thing': 'apple',
+  fruitThing: 'apple',
+  '$0': 'fruity.js' }
+```
+
+```
+$ MY_PROGRAM_FRUIT_THING=banana node fruity.js
+{ _: [],
+  fruitThing: 'banana',
+  f: 'banana',
+  'fruit-thing': 'banana',
+  '$0': 'fruity.js' }
+```
+
+```
+$ MY_PROGRAM_FRUIT_THING=banana node fruity.js -f cat
+{ _: [],
+  f: 'cat',
+  'fruit-thing': 'cat',
+  fruitThing: 'cat',
+  '$0': 'fruity.js' }
+```
+
+Env var parsing is disabled by default, but you can also explicitly disable it
+by calling `.env(false)`, e.g. if you need to undo previous configuration.
+
+.epilog(str)
+------------
+.epilogue(str)
+--------------
+
+A message to print at the end of the usage instructions, e.g.
+
+```js
+var argv = require('yargs')
+  .epilogue('for more information, find our manual at http://example.com');
+```
+
+.example(cmd, desc)
+-------------------
+
+Give some example invocations of your program. Inside `cmd`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+Examples will be printed out as part of the help message.
+
+.exitProcess(enable)
+----------------------------------
+
+By default, yargs exits the process when the user passes a help flag, uses the
+`.version` functionality, or when validation fails. Calling
+`.exitProcess(false)` disables this behavior, enabling further actions after
+yargs have been validated.
+
+.fail(fn)
+---------
+
+Method to execute when a failure occurs, rather than printing the failure message.
+
+`fn` is called with the failure message that would have been printed.
+
+<a name="group"></a>.group(key(s), groupName)
+--------------------
+
+Given a key, or an array of keys, places options under an alternative heading
+when displaying usage instructions, e.g.,
+
+```js
+var yargs = require('yargs')(['--help'])
+  .help('help')
+  .group('batman', 'Heroes:')
+  .describe('batman', "world's greatest detective")
+  .wrap(null)
+  .argv
+```
+***
+    Heroes:
+      --batman  world's greatest detective
+
+    Options:
+      --help  Show help  [boolean]
+
+.help([option, [description]])
+------------------------------
+
+Add an option (e.g. `--help`) that displays the usage string and exits the
+process. If present, the `description` parameter customizes the description of
+the help option in the usage string.
+
+If invoked without parameters, `.help()` returns the generated usage string.
+
+Example:
+
+```js
+var yargs = require("yargs")
+  .usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
+console.log(yargs.help());
+```
+
+Later on, `argv` can be retrieved with `yargs.argv`.
+
+.implies(x, y)
+--------------
+
+Given the key `x` is set, it is required that the key `y` is set.
+
+Optionally `.implies()` can accept an object specifying multiple implications.
+
+.locale()
+---------
+
+Return the locale that yargs is currently using.
+
+By default, yargs will auto-detect the operating system's locale so that
+yargs-generated help content will display in the user's language.
+
+To override this behavior with a static locale, pass the desired locale as a
+string to this method (see below).
+
+.locale(locale)
+---------------
+
+Override the auto-detected locale from the user's operating system with a static
+locale. Note that the OS locale can be modified by setting/exporting the `LC_ALL`
+environment variable.
+
+```js
+var argv = require('yargs')
+  .usage('./$0 - follow ye instructions true')
+  .option('option', {
+    alias: 'o',
+    describe: "'tis a mighty fine option",
+    demand: true
+  })
+  .command('run', "Arrr, ya best be knowin' what yer doin'")
+  .example('$0 run foo', "shiver me timbers, here's an example for ye")
+  .help('help')
+  .wrap(70)
+  .locale('pirate')
+  .argv
+```
+
+***
+
+```shell
+./test.js - follow ye instructions true
+
+Choose yer command:
+  run  Arrr, ya best be knowin' what yer doin'
+
+Options for me hearties!
+  --option, -o  'tis a mighty fine option               [requi-yar-ed]
+  --help        Parlay this here code of conduct             [boolean]
+
+Ex. marks the spot:
+  test.js run foo  shiver me timbers, here's an example for ye
+
+Ye be havin' to set the followin' argument land lubber: option
+```
+
+Locales currently supported:
+
+* **de:** German.
+* **en:** American English.
+* **es:** Spanish.
+* **fr:** French.
+* **id:** Indonesian.
+* **ja:** Japanese.
+* **ko:** Korean.
+* **nb:** Norwegian Bokmål.
+* **pirate:** American Pirate.
+* **pt:** Portuguese.
+* **pt_BR:** Brazilian Portuguese.
+* **tr:** Turkish.
+* **zh:** Chinese.
+
+To submit a new translation for yargs:
+
+1. use `./locales/en.json` as a starting point.
+2. submit a pull request with the new locale file.
+
+*The [Microsoft Terminology Search](http://www.microsoft.com/Language/en-US/Search.aspx) can be useful for finding the correct terminology in your locale.*
+
+<a name="nargs"></a>.nargs(key, count)
+-----------
+
+The number of arguments that should be consumed after a key. This can be a
+useful hint to prevent parsing ambiguity. For example:
+
+```js
+var argv = require('yargs')
+  .nargs('token', 1)
+  .parse(['--token', '-my-token']);
+```
+
+parses as:
+
+`{ _: [], token: '-my-token', '$0': 'node test' }`
+
+Optionally `.nargs()` can take an object of `key`/`narg` pairs.
+
+.option(key, opt)
+-----------------
+.options(key, opt)
+------------------
+
+Instead of chaining together `.alias().demand().default().describe().string()`, you can specify
+keys in `opt` for each of the chainable methods.
+
+For example:
+
+````javascript
+var argv = require('yargs')
+    .option('f', {
+        alias: 'file',
+        demand: true,
+        default: '/etc/passwd',
+        describe: 'x marks the spot',
+        type: 'string'
+    })
+    .argv
+;
+````
+
+is the same as
+
+````javascript
+var argv = require('yargs')
+    .alias('f', 'file')
+    .demand('f')
+    .default('f', '/etc/passwd')
+    .describe('f', 'x marks the spot')
+    .string('f')
+    .argv
+;
+````
+
+Optionally `.options()` can take an object that maps keys to `opt` parameters.
+
+````javascript
+var argv = require('yargs')
+    .options({
+      'f': {
+        alias: 'file',
+        demand: true,
+        default: '/etc/passwd',
+        describe: 'x marks the spot',
+        type: 'string'
+      }
+    })
+    .argv
+;
+````
+
+Valid `opt` keys include:
+
+- `alias`: string or array of strings, alias(es) for the canonical option key, see [`alias()`](#alias)
+- `array`: boolean, interpret option as an array, see [`array()`](#array)
+- `boolean`: boolean, interpret option as a boolean flag, see [`boolean()`](#boolean)
+- `choices`: value or array of values, limit valid option arguments to a predefined set, see [`choices()`](#choices)
+- `config`: boolean, interpret option as a path to a JSON config file, see [`config()`](#config)
+- `configParser`: function, provide a custom config parsing function, see [`config()`](#config)
+- `count`: boolean, interpret option as a count of boolean flags, see [`count()`](#count)
+- `default`: value, set a default value for the option, see [`default()`](#default)
+- `defaultDescription`: string, use this description for the default value in help content, see [`default()`](#default)
+- `demand`/`require`/`required`: boolean or string, demand the option be given, with optional error message, see [`demand()`](#demand)
+- `desc`/`describe`/`description`: string, the option description for help content, see [`describe()`](#describe)
+- `group`: string, when displaying usage instructions place the option under an alternative group heading, see [`group()`](#group)
+- `nargs`: number, specify how many arguments should be consumed for the option, see [`nargs()`](#nargs)
+- `requiresArg`: boolean, require the option be specified with a value, see [`requiresArg()`](#requiresArg)
+- `string`: boolean, interpret option as a string, see [`string()`](#string)
+- `type`: one of the following strings
+    - `'array'`: synonymous for `array: true`, see [`array()`](#array)
+    - `'boolean'`: synonymous for `boolean: true`, see [`boolean()`](#boolean)
+    - `'count'`: synonymous for `count: true`, see [`count()`](#count)
+    - `'string'`: synonymous for `string: true`, see [`string()`](#string)
+
+.parse(args)
+------------
+
+Parse `args` instead of `process.argv`. Returns the `argv` object.
+
+`args` may either be a pre-processed argv array, or a raw argument string.
+
+.require(key, [msg | boolean])
+------------------------------
+.required(key, [msg | boolean])
+------------------------------
+
+An alias for [`demand()`](#demand). See docs there.
+
+<a name="requiresArg"></a>.requiresArg(key)
+-----------------
+
+Specifies either a single option key (string), or an array of options that
+must be followed by option values. If any option value is missing, show the
+usage information and exit.
+
+The default behavior is to set the value of any key not followed by an
+option value to `true`.
+
+.reset()
+--------
+
+Reset the argument object built up so far. This is useful for
+creating nested command line interfaces.
+
+```js
+var yargs = require('yargs')
+  .usage('$0 command')
+  .command('hello', 'hello command')
+  .command('world', 'world command')
+  .demand(1, 'must provide a valid command'),
+  argv = yargs.argv,
+  command = argv._[0];
+
+if (command === 'hello') {
+  yargs.reset()
+    .usage('$0 hello')
+    .help('h')
+    .example('$0 hello', 'print the hello message!')
+    .argv
+
+  console.log('hello!');
+} else if (command === 'world'){
+  yargs.reset()
+    .usage('$0 world')
+    .help('h')
+    .example('$0 world', 'print the world message!')
+    .argv
+
+  console.log('world!');
+} else {
+  yargs.showHelp();
+}
+```
+
+.showCompletionScript()
+----------------------
+
+Generate a bash completion script. Users of your application can install this
+script in their `.bashrc`, and yargs will provide completion shortcuts for
+commands and options.
+
+.showHelp(consoleLevel='error')
+---------------------------
+
+Print the usage data using the [`console`](https://nodejs.org/api/console.html) function `consoleLevel` for printing.
+
+Example:
+
+```js
+var yargs = require("yargs")
+  .usage("$0 -operand1 number -operand2 number -operation [add|subtract]");
+yargs.showHelp(); //prints to stderr using console.error()
+```
+
+Or, to print the usage data to `stdout` instead, you can specify the use of `console.log`:
+
+```js
+yargs.showHelp("log"); //prints to stdout using console.log()
+```
+
+Later on, `argv` can be retrieved with `yargs.argv`.
+
+.showHelpOnFail(enable, [message])
+----------------------------------
+
+By default, yargs outputs a usage string if any error is detected. Use the
+`.showHelpOnFail()` method to customize this behavior. If `enable` is `false`,
+the usage string is not output. If the `message` parameter is present, this
+message is output after the error message.
+
+line_count.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('yargs')
+    .usage('Count the lines in a file.\nUsage: $0 -f <file>')
+    .demand('f')
+    .alias('f', 'file')
+    .describe('f', 'Load a file')
+    .string('f')
+    .showHelpOnFail(false, 'Specify --help for available options')
+    .help('help')
+    .argv;
+
+// etc.
+````
+
+***
+
+```
+$ node line_count.js
+Missing argument value: f
+
+Specify --help for available options
+```
+
+.strict()
+---------
+
+Any command-line argument given that is not demanded, or does not have a
+corresponding description, will be reported as an error.
+
+<a name="string"></a>.string(key)
+------------
+
+Tell the parser logic not to interpret `key` as a number or boolean.
+This can be useful if you need to preserve leading zeros in an input.
+
+If `key` is an array, interpret all the elements as strings.
+
+`.string('_')` will result in non-hyphenated arguments being interpreted as strings,
+regardless of whether they resemble numbers.
+
+.updateLocale(obj)
+------------------
+.updateStrings(obj)
+------------------
+
+Override the default strings used by yargs with the key/value
+pairs provided in `obj`:
+
+```js
+var argv = require('yargs')
+  .command('run', 'the run command')
+  .help('help')
+  .updateStrings({
+    'Commands:': 'My Commands -->\n'
+  })
+  .wrap(null)
+  .argv
+```
+
+***
+
+```shell
+My Commands -->
+
+  run  the run command
+
+Options:
+  --help  Show help  [boolean]
+```
+
+If you explicitly specify a `locale()`, you should do so *before* calling
+`updateStrings()`.
+
+.usage(message, [opts])
+---------------------
+
+Set a usage message to show which commands to use. Inside `message`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+
+`opts` is optional and acts like calling `.options(opts)`.
+
+.version(version, [option], [description])
+----------------------------------------
+
+Add an option (e.g. `--version`) that displays the version number (given by the
+`version` parameter) and exits the process. If present, the `description`
+parameter customizes the description of the version option in the usage string.
+
+You can provide a `function` for version, rather than a string.
+This is useful if you want to use the version from your package.json:
+
+```js
+var argv = require('yargs')
+  .version(function() {
+    return require('../package').version;
+  })
+  .argv;
+```
+
+.wrap(columns)
+--------------
+
+Format usage output to wrap at `columns` many columns.
+
+By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to
+specify no column limit (no right-align). Use `.wrap(yargs.terminalWidth())` to
+maximize the width of yargs' usage instructions.
+
+parsing tricks
+==============
+
+stop parsing
+------------
+
+Use `--` to stop parsing flags and stuff the remainder into `argv._`.
+
+    $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4
+    { _: [ '-c', '3', '-d', '4' ],
+      a: 1,
+      b: 2,
+      '$0': 'examples/reflect.js' }
+
+negate fields
+-------------
+
+If you want to explicitly set a field to false instead of just leaving it
+undefined or to override a default you can do `--no-key`.
+
+    $ node examples/reflect.js -a --no-b
+    { _: [], a: true, b: false, '$0': 'examples/reflect.js' }
+
+numbers
+-------
+
+Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to
+one. This way you can just `net.createConnection(argv.port)` and you can add
+numbers out of `argv` with `+` without having that mean concatenation,
+which is super frustrating.
+
+duplicates
+----------
+
+If you specify a flag multiple times it will get turned into an array containing
+all the values in order.
+
+    $ node examples/reflect.js -x 5 -x 8 -x 0
+    { _: [], x: [ 5, 8, 0 ], '$0': 'examples/reflect.js' }
+
+dot notation
+------------
+
+When you use dots (`.`s) in argument names, an implicit object path is assumed.
+This lets you organize arguments into nested objects.
+
+    $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5
+    { _: [],
+      foo: { bar: { baz: 33 }, quux: 5 },
+      '$0': 'examples/reflect.js' }
+
+short numbers
+-------------
+
+Short numeric `-n5` style arguments work too:
+
+    $ node examples/reflect.js -n123 -m456
+    { _: [], n: 123, m: 456, '$0': 'examples/reflect.js' }
+
+installation
+============
+
+With [npm](https://github.com/npm/npm), just do:
+
+    npm install yargs
+
+or clone this project on github:
+
+    git clone http://github.com/bcoe/yargs.git
+
+To run the tests with npm, just do:
+
+    npm test
+
+inspired by
+===========
+
+This module is loosely inspired by Perl's
+[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).
+
+
+
+[travis-url]: https://travis-ci.org/bcoe/yargs
+[travis-image]: https://img.shields.io/travis/bcoe/yargs.svg
+[gemnasium-url]: https://gemnasium.com/bcoe/yargs
+[gemnasium-image]: https://img.shields.io/gemnasium/bcoe/yargs.svg
+[coveralls-url]: https://coveralls.io/github/bcoe/yargs
+[coveralls-image]: https://img.shields.io/coveralls/bcoe/yargs.svg
+[npm-url]: https://www.npmjs.com/package/yargs
+[npm-image]: https://img.shields.io/npm/v/yargs.svg
+[windows-url]: https://ci.appveyor.com/project/bcoe/yargs
+[windows-image]: https://img.shields.io/appveyor/ci/bcoe/yargs/master.svg?label=Windows%20Tests
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/completion.sh.hbs b/legacy-libs/grpc-cloned/node_modules/yargs/completion.sh.hbs
new file mode 100644 (file)
index 0000000..8392ad5
--- /dev/null
@@ -0,0 +1,28 @@
+###-begin-{{app_name}}-completions-###
+#
+# yargs command completion script
+#
+# Installation: {{app_path}} completion >> ~/.bashrc
+#    or {{app_path}} completion >> ~/.bash_profile on OSX.
+#
+_yargs_completions()
+{
+    local cur_word args type_list
+
+    cur_word="${COMP_WORDS[COMP_CWORD]}"
+    args=$(printf "%s " "${COMP_WORDS[@]}")
+
+    # ask yargs to generate completions.
+    type_list=`{{app_path}} --get-yargs-completions $args`
+
+    COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )
+
+    # if no match was found, fall back to filename completion
+    if [ ${#COMPREPLY[@]} -eq 0 ]; then
+      COMPREPLY=( $(compgen -f -- "${cur_word}" ) )
+    fi
+
+    return 0
+}
+complete -F _yargs_completions {{app_name}}
+###-end-{{app_name}}-completions-###
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/index.js b/legacy-libs/grpc-cloned/node_modules/yargs/index.js
new file mode 100644 (file)
index 0000000..7b6a343
--- /dev/null
@@ -0,0 +1,665 @@
+var assert = require('assert')
+var Completion = require('./lib/completion')
+var Parser = require('./lib/parser')
+var path = require('path')
+var tokenizeArgString = require('./lib/tokenize-arg-string')
+var Usage = require('./lib/usage')
+var Validation = require('./lib/validation')
+var Y18n = require('y18n')
+
+Argv(process.argv.slice(2))
+
+var exports = module.exports = Argv
+function Argv (processArgs, cwd) {
+  processArgs = processArgs || [] // handle calling yargs().
+
+  var self = {}
+  var completion = null
+  var usage = null
+  var validation = null
+  var y18n = Y18n({
+    directory: path.resolve(__dirname, './locales'),
+    updateFiles: false
+  })
+
+  if (!cwd) cwd = process.cwd()
+
+  self.$0 = process.argv
+    .slice(0, 2)
+    .map(function (x, i) {
+      // ignore the node bin, specify this in your
+      // bin file with #!/usr/bin/env node
+      if (i === 0 && /\b(node|iojs)$/.test(x)) return
+      var b = rebase(cwd, x)
+      return x.match(/^\//) && b.length < x.length ? b : x
+    })
+    .join(' ').trim()
+
+  if (process.env._ !== undefined && process.argv[1] === process.env._) {
+    self.$0 = process.env._.replace(
+      path.dirname(process.execPath) + '/', ''
+    )
+  }
+
+  var options
+  self.resetOptions = self.reset = function () {
+    // put yargs back into its initial
+    // state, this is useful for creating a
+    // nested CLI.
+    options = {
+      array: [],
+      boolean: [],
+      string: [],
+      narg: {},
+      key: {},
+      alias: {},
+      default: {},
+      defaultDescription: {},
+      choices: {},
+      requiresArg: [],
+      count: [],
+      normalize: [],
+      config: {},
+      envPrefix: undefined
+    }
+
+    usage = Usage(self, y18n) // handle usage output.
+    validation = Validation(self, usage, y18n) // handle arg validation.
+    completion = Completion(self, usage)
+
+    demanded = {}
+    groups = {}
+
+    exitProcess = true
+    strict = false
+    helpOpt = null
+    versionOpt = null
+    commandHandlers = {}
+    self.parsed = false
+
+    return self
+  }
+  self.resetOptions()
+
+  self.boolean = function (bools) {
+    options.boolean.push.apply(options.boolean, [].concat(bools))
+    return self
+  }
+
+  self.array = function (arrays) {
+    options.array.push.apply(options.array, [].concat(arrays))
+    return self
+  }
+
+  self.nargs = function (key, n) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.nargs(k, key[k])
+      })
+    } else {
+      options.narg[key] = n
+    }
+    return self
+  }
+
+  self.choices = function (key, values) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.choices(k, key[k])
+      })
+    } else {
+      options.choices[key] = (options.choices[key] || []).concat(values)
+    }
+    return self
+  }
+
+  self.normalize = function (strings) {
+    options.normalize.push.apply(options.normalize, [].concat(strings))
+    return self
+  }
+
+  self.config = function (key, msg, parseFn) {
+    if (typeof msg === 'function') {
+      parseFn = msg
+      msg = null
+    }
+    self.describe(key, msg || usage.deferY18nLookup('Path to JSON config file'))
+    ;(Array.isArray(key) ? key : [key]).forEach(function (k) {
+      options.config[k] = parseFn || true
+    })
+    return self
+  }
+
+  self.example = function (cmd, description) {
+    usage.example(cmd, description)
+    return self
+  }
+
+  self.command = function (cmd, description, fn) {
+    if (description !== false) {
+      usage.command(cmd, description)
+    }
+    if (fn) commandHandlers[cmd] = fn
+    return self
+  }
+
+  var commandHandlers = {}
+  self.getCommandHandlers = function () {
+    return commandHandlers
+  }
+
+  self.string = function (strings) {
+    options.string.push.apply(options.string, [].concat(strings))
+    return self
+  }
+
+  self.default = function (key, value, defaultDescription) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.default(k, key[k])
+      })
+    } else {
+      if (defaultDescription) options.defaultDescription[key] = defaultDescription
+      if (typeof value === 'function') {
+        if (!options.defaultDescription[key]) options.defaultDescription[key] = usage.functionDescription(value)
+        value = value.call()
+      }
+      options.default[key] = value
+    }
+    return self
+  }
+
+  self.alias = function (x, y) {
+    if (typeof x === 'object') {
+      Object.keys(x).forEach(function (key) {
+        self.alias(key, x[key])
+      })
+    } else {
+      // perhaps 'x' is already an alias in another list?
+      // if so we should append to x's list.
+      var aliases = null
+      Object.keys(options.alias).forEach(function (key) {
+        if (~options.alias[key].indexOf(x)) aliases = options.alias[key]
+      })
+
+      if (aliases) { // x was an alias itself.
+        aliases.push(y)
+      } else { // x is a new alias key.
+        options.alias[x] = (options.alias[x] || []).concat(y)
+      }
+
+      // wait! perhaps we've created two lists of aliases
+      // that reference each other?
+      if (options.alias[y]) {
+        Array.prototype.push.apply((options.alias[x] || aliases), options.alias[y])
+        delete options.alias[y]
+      }
+    }
+    return self
+  }
+
+  self.count = function (counts) {
+    options.count.push.apply(options.count, [].concat(counts))
+    return self
+  }
+
+  var demanded = {}
+  self.demand = self.required = self.require = function (keys, max, msg) {
+    // you can optionally provide a 'max' key,
+    // which will raise an exception if too many '_'
+    // options are provided.
+    if (typeof max !== 'number') {
+      msg = max
+      max = Infinity
+    }
+
+    if (typeof keys === 'number') {
+      if (!demanded._) demanded._ = { count: 0, msg: null, max: max }
+      demanded._.count = keys
+      demanded._.msg = msg
+    } else if (Array.isArray(keys)) {
+      keys.forEach(function (key) {
+        self.demand(key, msg)
+      })
+    } else {
+      if (typeof msg === 'string') {
+        demanded[keys] = { msg: msg }
+      } else if (msg === true || typeof msg === 'undefined') {
+        demanded[keys] = { msg: undefined }
+      }
+    }
+
+    return self
+  }
+  self.getDemanded = function () {
+    return demanded
+  }
+
+  self.requiresArg = function (requiresArgs) {
+    options.requiresArg.push.apply(options.requiresArg, [].concat(requiresArgs))
+    return self
+  }
+
+  self.implies = function (key, value) {
+    validation.implies(key, value)
+    return self
+  }
+
+  self.usage = function (msg, opts) {
+    if (!opts && typeof msg === 'object') {
+      opts = msg
+      msg = null
+    }
+
+    usage.usage(msg)
+
+    if (opts) self.options(opts)
+
+    return self
+  }
+
+  self.epilogue = self.epilog = function (msg) {
+    usage.epilog(msg)
+    return self
+  }
+
+  self.fail = function (f) {
+    usage.failFn(f)
+    return self
+  }
+
+  self.check = function (f) {
+    validation.check(f)
+    return self
+  }
+
+  self.defaults = self.default
+
+  self.describe = function (key, desc) {
+    options.key[key] = true
+    usage.describe(key, desc)
+    return self
+  }
+
+  self.parse = function (args) {
+    return parseArgs(args)
+  }
+
+  self.option = self.options = function (key, opt) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.options(k, key[k])
+      })
+    } else {
+      assert(typeof opt === 'object', 'second argument to option must be an object')
+
+      options.key[key] = true // track manually set keys.
+
+      if (opt.alias) self.alias(key, opt.alias)
+
+      var demand = opt.demand || opt.required || opt.require
+
+      if (demand) {
+        self.demand(key, demand)
+      } if ('config' in opt) {
+        self.config(key, opt.configParser)
+      } if ('default' in opt) {
+        self.default(key, opt.default)
+      } if ('nargs' in opt) {
+        self.nargs(key, opt.nargs)
+      } if ('choices' in opt) {
+        self.choices(key, opt.choices)
+      } if ('group' in opt) {
+        self.group(key, opt.group)
+      } if (opt.boolean || opt.type === 'boolean') {
+        self.boolean(key)
+        if (opt.alias) self.boolean(opt.alias)
+      } if (opt.array || opt.type === 'array') {
+        self.array(key)
+        if (opt.alias) self.array(opt.alias)
+      } if (opt.string || opt.type === 'string') {
+        self.string(key)
+        if (opt.alias) self.string(opt.alias)
+      } if (opt.count || opt.type === 'count') {
+        self.count(key)
+      } if (opt.defaultDescription) {
+        options.defaultDescription[key] = opt.defaultDescription
+      }
+
+      var desc = opt.describe || opt.description || opt.desc
+      if (desc) {
+        self.describe(key, desc)
+      }
+
+      if (opt.requiresArg) {
+        self.requiresArg(key)
+      }
+    }
+
+    return self
+  }
+  self.getOptions = function () {
+    return options
+  }
+
+  var groups = {}
+  self.group = function (opts, groupName) {
+    var seen = {}
+    groups[groupName] = (groups[groupName] || []).concat(opts).filter(function (key) {
+      if (seen[key]) return false
+      return (seen[key] = true)
+    })
+    return self
+  }
+  self.getGroups = function () {
+    return groups
+  }
+
+  // as long as options.envPrefix is not undefined,
+  // parser will apply env vars matching prefix to argv
+  self.env = function (prefix) {
+    if (prefix === false) options.envPrefix = undefined
+    else options.envPrefix = prefix || ''
+    return self
+  }
+
+  self.wrap = function (cols) {
+    usage.wrap(cols)
+    return self
+  }
+
+  var strict = false
+  self.strict = function () {
+    strict = true
+    return self
+  }
+  self.getStrict = function () {
+    return strict
+  }
+
+  self.showHelp = function (level) {
+    if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
+    usage.showHelp(level)
+    return self
+  }
+
+  var versionOpt = null
+  self.version = function (ver, opt, msg) {
+    versionOpt = opt || 'version'
+    usage.version(ver)
+    self.boolean(versionOpt)
+    self.describe(versionOpt, msg || usage.deferY18nLookup('Show version number'))
+    return self
+  }
+
+  var helpOpt = null
+  self.addHelpOpt = function (opt, msg) {
+    helpOpt = opt
+    self.boolean(opt)
+    self.describe(opt, msg || usage.deferY18nLookup('Show help'))
+    return self
+  }
+
+  self.showHelpOnFail = function (enabled, message) {
+    usage.showHelpOnFail(enabled, message)
+    return self
+  }
+
+  var exitProcess = true
+  self.exitProcess = function (enabled) {
+    if (typeof enabled !== 'boolean') {
+      enabled = true
+    }
+    exitProcess = enabled
+    return self
+  }
+  self.getExitProcess = function () {
+    return exitProcess
+  }
+
+  self.help = function () {
+    if (arguments.length > 0) return self.addHelpOpt.apply(self, arguments)
+
+    if (!self.parsed) parseArgs(processArgs) // run parser, if it has not already been executed.
+
+    return usage.help()
+  }
+
+  var completionCommand = null
+  self.completion = function (cmd, desc, fn) {
+    // a function to execute when generating
+    // completions can be provided as the second
+    // or third argument to completion.
+    if (typeof desc === 'function') {
+      fn = desc
+      desc = null
+    }
+
+    // register the completion command.
+    completionCommand = cmd || 'completion'
+    if (!desc && desc !== false) {
+      desc = 'generate bash completion script'
+    }
+    self.command(completionCommand, desc)
+
+    // a function can be provided
+    if (fn) completion.registerFunction(fn)
+
+    return self
+  }
+
+  self.showCompletionScript = function ($0) {
+    $0 = $0 || self.$0
+    console.log(completion.generateCompletionScript($0))
+    return self
+  }
+
+  self.locale = function (locale) {
+    if (arguments.length === 0) {
+      guessLocale()
+      return y18n.getLocale()
+    }
+    detectLocale = false
+    y18n.setLocale(locale)
+    return self
+  }
+
+  self.updateStrings = self.updateLocale = function (obj) {
+    detectLocale = false
+    y18n.updateLocale(obj)
+    return self
+  }
+
+  var detectLocale = true
+  self.detectLocale = function (detect) {
+    detectLocale = detect
+    return self
+  }
+  self.getDetectLocale = function () {
+    return detectLocale
+  }
+
+  self.getUsageInstance = function () {
+    return usage
+  }
+
+  self.getValidationInstance = function () {
+    return validation
+  }
+
+  self.terminalWidth = function () {
+    return require('window-size').width
+  }
+
+  Object.defineProperty(self, 'argv', {
+    get: function () {
+      var args = null
+
+      try {
+        args = parseArgs(processArgs)
+      } catch (err) {
+        usage.fail(err.message)
+      }
+
+      return args
+    },
+    enumerable: true
+  })
+
+  function parseArgs (args) {
+    args = normalizeArgs(args)
+
+    var parsed = Parser(args, options, y18n)
+    var argv = parsed.argv
+    var aliases = parsed.aliases
+
+    argv.$0 = self.$0
+
+    self.parsed = parsed
+
+    guessLocale() // guess locale lazily, so that it can be turned off in chain.
+
+    // while building up the argv object, there
+    // are two passes through the parser. If completion
+    // is being performed short-circuit on the first pass.
+    if (completionCommand &&
+      (process.argv.join(' ')).indexOf(completion.completionKey) !== -1 &&
+      !argv[completion.completionKey]) {
+      return argv
+    }
+
+    // if there's a handler associated with a
+    // command defer processing to it.
+    var handlerKeys = Object.keys(self.getCommandHandlers())
+    for (var i = 0, command; (command = handlerKeys[i]) !== undefined; i++) {
+      if (~argv._.indexOf(command)) {
+        runCommand(command, self, argv)
+        return self.argv
+      }
+    }
+
+    // generate a completion script for adding to ~/.bashrc.
+    if (completionCommand && ~argv._.indexOf(completionCommand) && !argv[completion.completionKey]) {
+      self.showCompletionScript()
+      if (exitProcess) {
+        process.exit(0)
+      }
+    }
+
+    // we must run completions first, a user might
+    // want to complete the --help or --version option.
+    if (completion.completionKey in argv) {
+      // we allow for asynchronous completions,
+      // e.g., loading in a list of commands from an API.
+      completion.getCompletion(function (completions) {
+        ;(completions || []).forEach(function (completion) {
+          console.log(completion)
+        })
+
+        if (exitProcess) {
+          process.exit(0)
+        }
+      })
+      return
+    }
+
+    var helpOrVersion = false
+    Object.keys(argv).forEach(function (key) {
+      if (key === helpOpt && argv[key]) {
+        helpOrVersion = true
+        self.showHelp('log')
+        if (exitProcess) {
+          process.exit(0)
+        }
+      } else if (key === versionOpt && argv[key]) {
+        helpOrVersion = true
+        usage.showVersion()
+        if (exitProcess) {
+          process.exit(0)
+        }
+      }
+    })
+
+    // If the help or version options where used and exitProcess is false,
+    // we won't run validations
+    if (!helpOrVersion) {
+      if (parsed.error) throw parsed.error
+
+      // if we're executed via bash completion, don't
+      // bother with validation.
+      if (!argv[completion.completionKey]) {
+        validation.nonOptionCount(argv)
+        validation.missingArgumentValue(argv)
+        validation.requiredArguments(argv)
+        if (strict) validation.unknownArguments(argv, aliases)
+        validation.customChecks(argv, aliases)
+        validation.limitedChoices(argv)
+        validation.implications(argv)
+      }
+    }
+
+    setPlaceholderKeys(argv)
+
+    return argv
+  }
+
+  function guessLocale () {
+    if (!detectLocale) return
+
+    try {
+      var osLocale = require('os-locale')
+      self.locale(osLocale.sync({ spawn: false }))
+    } catch (err) {
+      // if we explode looking up locale just noop
+      // we'll keep using the default language 'en'.
+    }
+  }
+
+  function runCommand (command, yargs, argv) {
+    setPlaceholderKeys(argv)
+    yargs.getCommandHandlers()[command](yargs.reset(), argv)
+  }
+
+  function setPlaceholderKeys (argv) {
+    Object.keys(options.key).forEach(function (key) {
+      // don't set placeholder keys for dot
+      // notation options 'foo.bar'.
+      if (~key.indexOf('.')) return
+      if (typeof argv[key] === 'undefined') argv[key] = undefined
+    })
+  }
+
+  function normalizeArgs (args) {
+    if (typeof args === 'string') {
+      return tokenizeArgString(args)
+    }
+    return args
+  }
+
+  singletonify(self)
+  return self
+}
+
+// rebase an absolute path to a relative one with respect to a base directory
+// exported for tests
+exports.rebase = rebase
+function rebase (base, dir) {
+  return path.relative(base, dir)
+}
+
+/*  Hack an instance of Argv with process.argv into Argv
+    so people can do
+    require('yargs')(['--beeble=1','-z','zizzle']).argv
+    to parse a list of args and
+    require('yargs').argv
+    to get a parsed version of process.argv.
+*/
+function singletonify (inst) {
+  Object.keys(inst).forEach(function (key) {
+    if (key === 'argv') {
+      Argv.__defineGetter__(key, inst.__lookupGetter__(key))
+    } else {
+      Argv[key] = typeof inst[key] === 'function' ? inst[key].bind(inst) : inst[key]
+    }
+  })
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/lib/completion.js b/legacy-libs/grpc-cloned/node_modules/yargs/lib/completion.js
new file mode 100644 (file)
index 0000000..576012f
--- /dev/null
@@ -0,0 +1,91 @@
+var fs = require('fs')
+var path = require('path')
+
+// add bash completions to your
+//  yargs-powered applications.
+module.exports = function (yargs, usage) {
+  var self = {
+    completionKey: 'get-yargs-completions'
+  }
+
+  // get a list of completion commands.
+  self.getCompletion = function (done) {
+    var completions = []
+    var current = process.argv[process.argv.length - 1]
+    var previous = process.argv.slice(process.argv.indexOf('--' + self.completionKey) + 1)
+    var argv = yargs.parse(previous)
+
+    // a custom completion function can be provided
+    // to completion().
+    if (completionFunction) {
+      if (completionFunction.length < 3) {
+        var result = completionFunction(current, argv)
+
+        // promise based completion function.
+        if (typeof result.then === 'function') {
+          return result.then(function (list) {
+            process.nextTick(function () { done(list) })
+          }).catch(function (err) {
+            process.nextTick(function () { throw err })
+          })
+        }
+
+        // synchronous completion function.
+        return done(result)
+      } else {
+        // asynchronous completion function
+        return completionFunction(current, argv, function (completions) {
+          done(completions)
+        })
+      }
+    }
+
+    var handlers = yargs.getCommandHandlers()
+    for (var i = 0, ii = previous.length; i < ii; ++i) {
+      if (handlers[previous[i]]) {
+        return handlers[previous[i]](yargs.reset())
+      }
+    }
+
+    if (!current.match(/^-/)) {
+      usage.getCommands().forEach(function (command) {
+        if (previous.indexOf(command[0]) === -1) {
+          completions.push(command[0])
+        }
+      })
+    }
+
+    if (current.match(/^-/)) {
+      Object.keys(yargs.getOptions().key).forEach(function (key) {
+        completions.push('--' + key)
+      })
+    }
+
+    done(completions)
+  }
+
+  // generate the completion script to add to your .bashrc.
+  self.generateCompletionScript = function ($0) {
+    var script = fs.readFileSync(
+      path.resolve(__dirname, '../completion.sh.hbs'),
+      'utf-8'
+    )
+    var name = path.basename($0)
+
+    // add ./to applications not yet installed as bin.
+    if ($0.match(/\.js$/)) $0 = './' + $0
+
+    script = script.replace(/{{app_name}}/g, name)
+    return script.replace(/{{app_path}}/g, $0)
+  }
+
+  // register a function to perform your own custom
+  // completions., this function can be either
+  // synchrnous or asynchronous.
+  var completionFunction = null
+  self.registerFunction = function (fn) {
+    completionFunction = fn
+  }
+
+  return self
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/lib/parser.js b/legacy-libs/grpc-cloned/node_modules/yargs/lib/parser.js
new file mode 100644 (file)
index 0000000..f5f68e9
--- /dev/null
@@ -0,0 +1,520 @@
+// fancy-pants parsing of argv, originally forked
+// from minimist: https://www.npmjs.com/package/minimist
+var camelCase = require('camelcase')
+var path = require('path')
+
+function increment (orig) {
+  return orig !== undefined ? orig + 1 : 0
+}
+
+module.exports = function (args, opts, y18n) {
+  if (!opts) opts = {}
+
+  var __ = y18n.__
+  var error = null
+  var flags = { arrays: {}, bools: {}, strings: {}, counts: {}, normalize: {}, configs: {}, defaulted: {} }
+
+  ;[].concat(opts['array']).filter(Boolean).forEach(function (key) {
+    flags.arrays[key] = true
+  })
+
+  ;[].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
+    flags.bools[key] = true
+  })
+
+  ;[].concat(opts.string).filter(Boolean).forEach(function (key) {
+    flags.strings[key] = true
+  })
+
+  ;[].concat(opts.count).filter(Boolean).forEach(function (key) {
+    flags.counts[key] = true
+  })
+
+  ;[].concat(opts.normalize).filter(Boolean).forEach(function (key) {
+    flags.normalize[key] = true
+  })
+
+  Object.keys(opts.config).forEach(function (k) {
+    flags.configs[k] = opts.config[k]
+  })
+
+  var aliases = {}
+  var newAliases = {}
+
+  extendAliases(opts.key)
+  extendAliases(opts.alias)
+  extendAliases(opts.default)
+
+  var defaults = opts['default'] || {}
+  Object.keys(defaults).forEach(function (key) {
+    if (/-/.test(key) && !opts.alias[key]) {
+      aliases[key] = aliases[key] || []
+    }
+    (aliases[key] || []).forEach(function (alias) {
+      defaults[alias] = defaults[key]
+    })
+  })
+
+  var argv = { _: [] }
+
+  Object.keys(flags.bools).forEach(function (key) {
+    setArg(key, !(key in defaults) ? false : defaults[key])
+    setDefaulted(key)
+  })
+
+  var notFlags = []
+  if (args.indexOf('--') !== -1) {
+    notFlags = args.slice(args.indexOf('--') + 1)
+    args = args.slice(0, args.indexOf('--'))
+  }
+
+  for (var i = 0; i < args.length; i++) {
+    var arg = args[i]
+    var broken
+    var key
+    var letters
+    var m
+    var next
+    var value
+
+    // -- seperated by =
+    if (arg.match(/^--.+=/)) {
+      // Using [\s\S] instead of . because js doesn't support the
+      // 'dotall' regex modifier. See:
+      // http://stackoverflow.com/a/1068308/13216
+      m = arg.match(/^--([^=]+)=([\s\S]*)$/)
+
+      // nargs format = '--f=monkey washing cat'
+      if (checkAllAliases(m[1], opts.narg)) {
+        args.splice(i + 1, m[1], m[2])
+        i = eatNargs(i, m[1], args)
+      // arrays format = '--f=a b c'
+      } else if (checkAllAliases(m[1], flags.arrays) && args.length > i + 1) {
+        args.splice(i + 1, m[1], m[2])
+        i = eatArray(i, m[1], args)
+      } else {
+        setArg(m[1], m[2])
+      }
+    } else if (arg.match(/^--no-.+/)) {
+      key = arg.match(/^--no-(.+)/)[1]
+      setArg(key, false)
+
+    // -- seperated by space.
+    } else if (arg.match(/^--.+/)) {
+      key = arg.match(/^--(.+)/)[1]
+
+      // nargs format = '--foo a b c'
+      if (checkAllAliases(key, opts.narg)) {
+        i = eatNargs(i, key, args)
+      // array format = '--foo a b c'
+      } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+        i = eatArray(i, key, args)
+      } else {
+        next = args[i + 1]
+
+        if (next !== undefined && !next.match(/^-/) &&
+          !checkAllAliases(key, flags.bools) &&
+          !checkAllAliases(key, flags.counts)) {
+          setArg(key, next)
+          i++
+        } else if (/^(true|false)$/.test(next)) {
+          setArg(key, next)
+          i++
+        } else {
+          setArg(key, defaultForType(guessType(key, flags)))
+        }
+      }
+
+    // dot-notation flag seperated by '='.
+    } else if (arg.match(/^-.\..+=/)) {
+      m = arg.match(/^-([^=]+)=([\s\S]*)$/)
+      setArg(m[1], m[2])
+
+    // dot-notation flag seperated by space.
+    } else if (arg.match(/^-.\..+/)) {
+      next = args[i + 1]
+      key = arg.match(/^-(.\..+)/)[1]
+
+      if (next !== undefined && !next.match(/^-/) &&
+        !checkAllAliases(key, flags.bools) &&
+        !checkAllAliases(key, flags.counts)) {
+        setArg(key, next)
+        i++
+      } else {
+        setArg(key, defaultForType(guessType(key, flags)))
+      }
+    } else if (arg.match(/^-[^-]+/)) {
+      letters = arg.slice(1, -1).split('')
+      broken = false
+
+      for (var j = 0; j < letters.length; j++) {
+        next = arg.slice(j + 2)
+
+        if (letters[j + 1] && letters[j + 1] === '=') {
+          value = arg.slice(j + 3)
+          key = letters[j]
+
+          // nargs format = '-f=monkey washing cat'
+          if (checkAllAliases(letters[j], opts.narg)) {
+            args.splice(i + 1, 0, value)
+            i = eatNargs(i, key, args)
+          // array format = '-f=a b c'
+          } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+            args.splice(i + 1, 0, value)
+            i = eatArray(i, key, args)
+          } else {
+            setArg(key, value)
+          }
+
+          broken = true
+          break
+        }
+
+        if (next === '-') {
+          setArg(letters[j], next)
+          continue
+        }
+
+        if (/[A-Za-z]/.test(letters[j]) &&
+          /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
+          setArg(letters[j], next)
+          broken = true
+          break
+        }
+
+        if (letters[j + 1] && letters[j + 1].match(/\W/)) {
+          setArg(letters[j], arg.slice(j + 2))
+          broken = true
+          break
+        } else {
+          setArg(letters[j], defaultForType(guessType(letters[j], flags)))
+        }
+      }
+
+      key = arg.slice(-1)[0]
+
+      if (!broken && key !== '-') {
+        // nargs format = '-f a b c'
+        if (checkAllAliases(key, opts.narg)) {
+          i = eatNargs(i, key, args)
+        // array format = '-f a b c'
+        } else if (checkAllAliases(key, flags.arrays) && args.length > i + 1) {
+          i = eatArray(i, key, args)
+        } else {
+          if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) &&
+            !checkAllAliases(key, flags.bools) &&
+            !checkAllAliases(key, flags.counts)) {
+            setArg(key, args[i + 1])
+            i++
+          } else if (args[i + 1] && /true|false/.test(args[i + 1])) {
+            setArg(key, args[i + 1])
+            i++
+          } else {
+            setArg(key, defaultForType(guessType(key, flags)))
+          }
+        }
+      }
+    } else {
+      argv._.push(
+        flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
+      )
+    }
+  }
+
+  // order of precedence:
+  // 1. command line arg
+  // 2. value from config file
+  // 3. value from env var
+  // 4. configured default value
+  applyEnvVars(opts, argv, true) // special case: check env vars that point to config file
+  setConfig(argv)
+  applyEnvVars(opts, argv, false)
+  applyDefaultsAndAliases(argv, aliases, defaults)
+
+  Object.keys(flags.counts).forEach(function (key) {
+    setArg(key, defaults[key])
+  })
+
+  notFlags.forEach(function (key) {
+    argv._.push(key)
+  })
+
+  // how many arguments should we consume, based
+  // on the nargs option?
+  function eatNargs (i, key, args) {
+    var toEat = checkAllAliases(key, opts.narg)
+
+    if (args.length - (i + 1) < toEat) error = Error(__('Not enough arguments following: %s', key))
+
+    for (var ii = i + 1; ii < (toEat + i + 1); ii++) {
+      setArg(key, args[ii])
+    }
+
+    return (i + toEat)
+  }
+
+  // if an option is an array, eat all non-hyphenated arguments
+  // following it... YUM!
+  // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
+  function eatArray (i, key, args) {
+    for (var ii = i + 1; ii < args.length; ii++) {
+      if (/^-/.test(args[ii])) break
+      i = ii
+      setArg(key, args[ii])
+    }
+
+    return i
+  }
+
+  function setArg (key, val) {
+    unsetDefaulted(key)
+
+    // handle parsing boolean arguments --foo=true --bar false.
+    if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
+      if (typeof val === 'string') val = val === 'true'
+    }
+
+    if (/-/.test(key) && !(aliases[key] && aliases[key].length)) {
+      var c = camelCase(key)
+      aliases[key] = [c]
+      newAliases[c] = true
+    }
+
+    var value = !checkAllAliases(key, flags.strings) && isNumber(val) ? Number(val) : val
+
+    if (checkAllAliases(key, flags.counts)) {
+      value = increment
+    }
+
+    var splitKey = key.split('.')
+    setKey(argv, splitKey, value)
+
+    // alias references an inner-value within
+    // a dot-notation object. see #279.
+    if (~key.indexOf('.') && aliases[key]) {
+      aliases[key].forEach(function (x) {
+        x = x.split('.')
+        setKey(argv, x, value)
+      })
+    }
+
+    ;(aliases[splitKey[0]] || []).forEach(function (x) {
+      x = x.split('.')
+
+      // handle populating dot notation for both
+      // the key and its aliases.
+      if (splitKey.length > 1) {
+        var a = [].concat(splitKey)
+        a.shift() // nuke the old key.
+        x = x.concat(a)
+      }
+
+      setKey(argv, x, value)
+    })
+
+    var keys = [key].concat(aliases[key] || [])
+    for (var i = 0, l = keys.length; i < l; i++) {
+      if (flags.normalize[keys[i]]) {
+        keys.forEach(function (key) {
+          argv.__defineSetter__(key, function (v) {
+            val = path.normalize(v)
+          })
+
+          argv.__defineGetter__(key, function () {
+            return typeof val === 'string' ? path.normalize(val) : val
+          })
+        })
+        break
+      }
+    }
+  }
+
+  // set args from config.json file, this should be
+  // applied last so that defaults can be applied.
+  function setConfig (argv) {
+    var configLookup = {}
+
+    // expand defaults/aliases, in-case any happen to reference
+    // the config.json file.
+    applyDefaultsAndAliases(configLookup, aliases, defaults)
+
+    Object.keys(flags.configs).forEach(function (configKey) {
+      var configPath = argv[configKey] || configLookup[configKey]
+      if (configPath) {
+        try {
+          var config = null
+          var resolvedConfigPath = path.resolve(process.cwd(), configPath)
+
+          if (typeof flags.configs[configKey] === 'function') {
+            try {
+              config = flags.configs[configKey](resolvedConfigPath)
+            } catch (e) {
+              config = e
+            }
+            if (config instanceof Error) {
+              error = config
+              return
+            }
+          } else {
+            config = require(resolvedConfigPath)
+          }
+
+          Object.keys(config).forEach(function (key) {
+            // setting arguments via CLI takes precedence over
+            // values within the config file.
+            if (argv[key] === undefined || (flags.defaulted[key])) {
+              delete argv[key]
+              setArg(key, config[key])
+            }
+          })
+        } catch (ex) {
+          if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
+        }
+      }
+    })
+  }
+
+  function applyEnvVars (opts, argv, configOnly) {
+    if (typeof opts.envPrefix === 'undefined') return
+
+    var prefix = typeof opts.envPrefix === 'string' ? opts.envPrefix : ''
+    Object.keys(process.env).forEach(function (envVar) {
+      if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
+        var key = camelCase(envVar.substring(prefix.length))
+        if (((configOnly && flags.configs[key]) || !configOnly) && (!(key in argv) || flags.defaulted[key])) {
+          setArg(key, process.env[envVar])
+        }
+      }
+    })
+  }
+
+  function applyDefaultsAndAliases (obj, aliases, defaults) {
+    Object.keys(defaults).forEach(function (key) {
+      if (!hasKey(obj, key.split('.'))) {
+        setKey(obj, key.split('.'), defaults[key])
+
+        ;(aliases[key] || []).forEach(function (x) {
+          if (hasKey(obj, x.split('.'))) return
+          setKey(obj, x.split('.'), defaults[key])
+        })
+      }
+    })
+  }
+
+  function hasKey (obj, keys) {
+    var o = obj
+    keys.slice(0, -1).forEach(function (key) {
+      o = (o[key] || {})
+    })
+
+    var key = keys[keys.length - 1]
+
+    if (typeof o !== 'object') return false
+    else return key in o
+  }
+
+  function setKey (obj, keys, value) {
+    var o = obj
+    keys.slice(0, -1).forEach(function (key) {
+      if (o[key] === undefined) o[key] = {}
+      o = o[key]
+    })
+
+    var key = keys[keys.length - 1]
+    if (value === increment) {
+      o[key] = increment(o[key])
+    } else if (o[key] === undefined && checkAllAliases(key, flags.arrays)) {
+      o[key] = Array.isArray(value) ? value : [value]
+    } else if (o[key] === undefined || typeof o[key] === 'boolean') {
+      o[key] = value
+    } else if (Array.isArray(o[key])) {
+      o[key].push(value)
+    } else {
+      o[key] = [ o[key], value ]
+    }
+  }
+
+  // extend the aliases list with inferred aliases.
+  function extendAliases (obj) {
+    Object.keys(obj || {}).forEach(function (key) {
+      // short-circuit if we've already added a key
+      // to the aliases array, for example it might
+      // exist in both 'opts.default' and 'opts.key'.
+      if (aliases[key]) return
+
+      aliases[key] = [].concat(opts.alias[key] || [])
+      // For "--option-name", also set argv.optionName
+      aliases[key].concat(key).forEach(function (x) {
+        if (/-/.test(x)) {
+          var c = camelCase(x)
+          aliases[key].push(c)
+          newAliases[c] = true
+        }
+      })
+      aliases[key].forEach(function (x) {
+        aliases[x] = [key].concat(aliases[key].filter(function (y) {
+          return x !== y
+        }))
+      })
+    })
+  }
+
+  // check if a flag is set for any of a key's aliases.
+  function checkAllAliases (key, flag) {
+    var isSet = false
+    var toCheck = [].concat(aliases[key] || [], key)
+
+    toCheck.forEach(function (key) {
+      if (flag[key]) isSet = flag[key]
+    })
+
+    return isSet
+  }
+
+  function setDefaulted (key) {
+    [].concat(aliases[key] || [], key).forEach(function (k) {
+      flags.defaulted[k] = true
+    })
+  }
+
+  function unsetDefaulted (key) {
+    [].concat(aliases[key] || [], key).forEach(function (k) {
+      delete flags.defaulted[k]
+    })
+  }
+
+  // return a default value, given the type of a flag.,
+  // e.g., key of type 'string' will default to '', rather than 'true'.
+  function defaultForType (type) {
+    var def = {
+      boolean: true,
+      string: '',
+      array: []
+    }
+
+    return def[type]
+  }
+
+  // given a flag, enforce a default type.
+  function guessType (key, flags) {
+    var type = 'boolean'
+
+    if (flags.strings && flags.strings[key]) type = 'string'
+    else if (flags.arrays && flags.arrays[key]) type = 'array'
+
+    return type
+  }
+
+  function isNumber (x) {
+    if (typeof x === 'number') return true
+    if (/^0x[0-9a-f]+$/i.test(x)) return true
+    return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x)
+  }
+
+  return {
+    argv: argv,
+    aliases: aliases,
+    error: error,
+    newAliases: newAliases
+  }
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/lib/tokenize-arg-string.js b/legacy-libs/grpc-cloned/node_modules/yargs/lib/tokenize-arg-string.js
new file mode 100644 (file)
index 0000000..df43fa5
--- /dev/null
@@ -0,0 +1,32 @@
+// take an un-split argv string and tokenize it.
+module.exports = function (argString) {
+  var i = 0
+  var c = null
+  var opening = null
+  var args = []
+
+  for (var ii = 0; ii < argString.length; ii++) {
+    c = argString.charAt(ii)
+
+    // split on spaces unless we're in quotes.
+    if (c === ' ' && !opening) {
+      i++
+      continue
+    }
+
+    // don't split the string if we're in matching
+    // opening or closing single and double quotes.
+    if (c === opening) {
+      opening = null
+      continue
+    } else if ((c === "'" || c === '"') && !opening) {
+      opening = c
+      continue
+    }
+
+    if (!args[i]) args[i] = ''
+    args[i] += c
+  }
+
+  return args
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/lib/usage.js b/legacy-libs/grpc-cloned/node_modules/yargs/lib/usage.js
new file mode 100644 (file)
index 0000000..b1b59bc
--- /dev/null
@@ -0,0 +1,383 @@
+// this file handles outputting usage instructions,
+// failures, etc. keeps logging in one place.
+var cliui = require('cliui')
+var decamelize = require('decamelize')
+var stringWidth = require('string-width')
+var wsize = require('window-size')
+
+module.exports = function (yargs, y18n) {
+  var __ = y18n.__
+  var self = {}
+
+  // methods for ouputting/building failure message.
+  var fails = []
+  self.failFn = function (f) {
+    fails.push(f)
+  }
+
+  var failMessage = null
+  var showHelpOnFail = true
+  self.showHelpOnFail = function (enabled, message) {
+    if (typeof enabled === 'string') {
+      message = enabled
+      enabled = true
+    } else if (typeof enabled === 'undefined') {
+      enabled = true
+    }
+    failMessage = message
+    showHelpOnFail = enabled
+    return self
+  }
+
+  var failureOutput = false
+  self.fail = function (msg) {
+    if (fails.length) {
+      fails.forEach(function (f) {
+        f(msg)
+      })
+    } else {
+      // don't output failure message more than once
+      if (!failureOutput) {
+        failureOutput = true
+        if (showHelpOnFail) yargs.showHelp('error')
+        if (msg) console.error(msg)
+        if (failMessage) {
+          if (msg) console.error('')
+          console.error(failMessage)
+        }
+      }
+      if (yargs.getExitProcess()) {
+        process.exit(1)
+      } else {
+        throw new Error(msg)
+      }
+    }
+  }
+
+  // methods for ouputting/building help (usage) message.
+  var usage
+  self.usage = function (msg) {
+    usage = msg
+  }
+
+  var examples = []
+  self.example = function (cmd, description) {
+    examples.push([cmd, description || ''])
+  }
+
+  var commands = []
+  self.command = function (cmd, description) {
+    commands.push([cmd, description || ''])
+  }
+  self.getCommands = function () {
+    return commands
+  }
+
+  var descriptions = {}
+  self.describe = function (key, desc) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.describe(k, key[k])
+      })
+    } else {
+      descriptions[key] = desc
+    }
+  }
+  self.getDescriptions = function () {
+    return descriptions
+  }
+
+  var epilog
+  self.epilog = function (msg) {
+    epilog = msg
+  }
+
+  var wrap = windowWidth()
+  self.wrap = function (cols) {
+    wrap = cols
+  }
+
+  var deferY18nLookupPrefix = '__yargsString__:'
+  self.deferY18nLookup = function (str) {
+    return deferY18nLookupPrefix + str
+  }
+
+  var defaultGroup = 'Options:'
+  self.help = function () {
+    normalizeAliases()
+
+    var demanded = yargs.getDemanded()
+    var groups = yargs.getGroups()
+    var options = yargs.getOptions()
+    var keys = Object.keys(
+      Object.keys(descriptions)
+      .concat(Object.keys(demanded))
+      .concat(Object.keys(options.default))
+      .reduce(function (acc, key) {
+        if (key !== '_') acc[key] = true
+        return acc
+      }, {})
+    )
+    var ui = cliui({
+      width: wrap,
+      wrap: !!wrap
+    })
+
+    // the usage string.
+    if (usage) {
+      var u = usage.replace(/\$0/g, yargs.$0)
+      ui.div(u + '\n')
+    }
+
+    // your application's commands, i.e., non-option
+    // arguments populated in '_'.
+    if (commands.length) {
+      ui.div(__('Commands:'))
+
+      commands.forEach(function (command) {
+        ui.div(
+          {text: command[0], padding: [0, 2, 0, 2], width: maxWidth(commands) + 4},
+          {text: command[1]}
+        )
+      })
+
+      ui.div()
+    }
+
+    // perform some cleanup on the keys array, making it
+    // only include top-level keys not their aliases.
+    var aliasKeys = (Object.keys(options.alias) || [])
+      .concat(Object.keys(yargs.parsed.newAliases) || [])
+
+    keys = keys.filter(function (key) {
+      return !yargs.parsed.newAliases[key] && aliasKeys.every(function (alias) {
+        return (options.alias[alias] || []).indexOf(key) === -1
+      })
+    })
+
+    // populate 'Options:' group with any keys that have not
+    // explicitly had a group set.
+    if (!groups[defaultGroup]) groups[defaultGroup] = []
+    addUngroupedKeys(keys, options.alias, groups)
+
+    // display 'Options:' table along with any custom tables:
+    Object.keys(groups).forEach(function (groupName) {
+      if (!groups[groupName].length) return
+
+      ui.div(__(groupName))
+
+      // if we've grouped the key 'f', but 'f' aliases 'foobar',
+      // normalizedKeys should contain only 'foobar'.
+      var normalizedKeys = groups[groupName].map(function (key) {
+        if (~aliasKeys.indexOf(key)) return key
+        for (var i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) {
+          if (~(options.alias[aliasKey] || []).indexOf(key)) return aliasKey
+        }
+        return key
+      })
+
+      // actually generate the switches string --foo, -f, --bar.
+      var switches = normalizedKeys.reduce(function (acc, key) {
+        acc[key] = [ key ].concat(options.alias[key] || [])
+          .map(function (sw) {
+            return (sw.length > 1 ? '--' : '-') + sw
+          })
+          .join(', ')
+
+        return acc
+      }, {})
+
+      normalizedKeys.forEach(function (key) {
+        var kswitch = switches[key]
+        var desc = descriptions[key] || ''
+        var type = null
+
+        if (~desc.lastIndexOf(deferY18nLookupPrefix)) desc = __(desc.substring(deferY18nLookupPrefix.length))
+
+        if (~options.boolean.indexOf(key)) type = '[' + __('boolean') + ']'
+        if (~options.count.indexOf(key)) type = '[' + __('count') + ']'
+        if (~options.string.indexOf(key)) type = '[' + __('string') + ']'
+        if (~options.normalize.indexOf(key)) type = '[' + __('string') + ']'
+        if (~options.array.indexOf(key)) type = '[' + __('array') + ']'
+
+        var extra = [
+          type,
+          demanded[key] ? '[' + __('required') + ']' : null,
+          options.choices && options.choices[key] ? '[' + __('choices:') + ' ' +
+            self.stringifiedValues(options.choices[key]) + ']' : null,
+          defaultString(options.default[key], options.defaultDescription[key])
+        ].filter(Boolean).join(' ')
+
+        ui.span(
+          {text: kswitch, padding: [0, 2, 0, 2], width: maxWidth(switches) + 4},
+          desc
+        )
+
+        if (extra) ui.div({text: extra, padding: [0, 0, 0, 2], align: 'right'})
+        else ui.div()
+      })
+
+      ui.div()
+    })
+
+    // describe some common use-cases for your application.
+    if (examples.length) {
+      ui.div(__('Examples:'))
+
+      examples.forEach(function (example) {
+        example[0] = example[0].replace(/\$0/g, yargs.$0)
+      })
+
+      examples.forEach(function (example) {
+        ui.div(
+          {text: example[0], padding: [0, 2, 0, 2], width: maxWidth(examples) + 4},
+          example[1]
+        )
+      })
+
+      ui.div()
+    }
+
+    // the usage string.
+    if (epilog) {
+      var e = epilog.replace(/\$0/g, yargs.$0)
+      ui.div(e + '\n')
+    }
+
+    return ui.toString()
+  }
+
+  // return the maximum width of a string
+  // in the left-hand column of a table.
+  function maxWidth (table) {
+    var width = 0
+
+    // table might be of the form [leftColumn],
+    // or {key: leftColumn}}
+    if (!Array.isArray(table)) {
+      table = Object.keys(table).map(function (key) {
+        return [table[key]]
+      })
+    }
+
+    table.forEach(function (v) {
+      width = Math.max(stringWidth(v[0]), width)
+    })
+
+    // if we've enabled 'wrap' we should limit
+    // the max-width of the left-column.
+    if (wrap) width = Math.min(width, parseInt(wrap * 0.5, 10))
+
+    return width
+  }
+
+  // make sure any options set for aliases,
+  // are copied to the keys being aliased.
+  function normalizeAliases () {
+    var demanded = yargs.getDemanded()
+    var options = yargs.getOptions()
+
+    ;(Object.keys(options.alias) || []).forEach(function (key) {
+      options.alias[key].forEach(function (alias) {
+        // copy descriptions.
+        if (descriptions[alias]) self.describe(key, descriptions[alias])
+        // copy demanded.
+        if (demanded[alias]) yargs.demand(key, demanded[alias].msg)
+        // type messages.
+        if (~options.boolean.indexOf(alias)) yargs.boolean(key)
+        if (~options.count.indexOf(alias)) yargs.count(key)
+        if (~options.string.indexOf(alias)) yargs.string(key)
+        if (~options.normalize.indexOf(alias)) yargs.normalize(key)
+        if (~options.array.indexOf(alias)) yargs.array(key)
+      })
+    })
+  }
+
+  // given a set of keys, place any keys that are
+  // ungrouped under the 'Options:' grouping.
+  function addUngroupedKeys (keys, aliases, groups) {
+    var groupedKeys = []
+    var toCheck = null
+    Object.keys(groups).forEach(function (group) {
+      groupedKeys = groupedKeys.concat(groups[group])
+    })
+
+    keys.forEach(function (key) {
+      toCheck = [key].concat(aliases[key])
+      if (!toCheck.some(function (k) {
+        return groupedKeys.indexOf(k) !== -1
+      })) {
+        groups[defaultGroup].push(key)
+      }
+    })
+    return groupedKeys
+  }
+
+  self.showHelp = function (level) {
+    level = level || 'error'
+    console[level](self.help())
+  }
+
+  self.functionDescription = function (fn) {
+    var description = fn.name ? decamelize(fn.name, '-') : __('generated-value')
+    return ['(', description, ')'].join('')
+  }
+
+  self.stringifiedValues = function (values, separator) {
+    var string = ''
+    var sep = separator || ', '
+    var array = [].concat(values)
+
+    if (!values || !array.length) return string
+
+    array.forEach(function (value) {
+      if (string.length) string += sep
+      string += JSON.stringify(value)
+    })
+
+    return string
+  }
+
+  // format the default-value-string displayed in
+  // the right-hand column.
+  function defaultString (value, defaultDescription) {
+    var string = '[' + __('default:') + ' '
+
+    if (value === undefined && !defaultDescription) return null
+
+    if (defaultDescription) {
+      string += defaultDescription
+    } else {
+      switch (typeof value) {
+        case 'string':
+          string += JSON.stringify(value)
+          break
+        case 'object':
+          string += JSON.stringify(value)
+          break
+        default:
+          string += value
+      }
+    }
+
+    return string + ']'
+  }
+
+  // guess the width of the console window, max-width 80.
+  function windowWidth () {
+    return wsize.width ? Math.min(80, wsize.width) : null
+  }
+
+  // logic for displaying application version.
+  var version = null
+  self.version = function (ver, opt, msg) {
+    version = ver
+  }
+
+  self.showVersion = function () {
+    if (typeof version === 'function') console.log(version())
+    else console.log(version)
+  }
+
+  return self
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/lib/validation.js b/legacy-libs/grpc-cloned/node_modules/yargs/lib/validation.js
new file mode 100644 (file)
index 0000000..514bbff
--- /dev/null
@@ -0,0 +1,249 @@
+// validation-type-stuff, missing params,
+// bad implications, custom checks.
+module.exports = function (yargs, usage, y18n) {
+  var __ = y18n.__
+  var __n = y18n.__n
+  var self = {}
+
+  // validate appropriate # of non-option
+  // arguments were provided, i.e., '_'.
+  self.nonOptionCount = function (argv) {
+    var demanded = yargs.getDemanded()
+    var _s = argv._.length
+
+    if (demanded._ && (_s < demanded._.count || _s > demanded._.max)) {
+      if (demanded._.msg !== undefined) {
+        usage.fail(demanded._.msg)
+      } else if (_s < demanded._.count) {
+        usage.fail(
+          __('Not enough non-option arguments: got %s, need at least %s', argv._.length, demanded._.count)
+        )
+      } else {
+        usage.fail(
+          __('Too many non-option arguments: got %s, maximum of %s', argv._.length, demanded._.max)
+        )
+      }
+    }
+  }
+
+  // make sure that any args that require an
+  // value (--foo=bar), have a value.
+  self.missingArgumentValue = function (argv) {
+    var defaultValues = [true, false, '']
+    var options = yargs.getOptions()
+
+    if (options.requiresArg.length > 0) {
+      var missingRequiredArgs = []
+
+      options.requiresArg.forEach(function (key) {
+        var value = argv[key]
+
+        // if a value is explicitly requested,
+        // flag argument as missing if it does not
+        // look like foo=bar was entered.
+        if (~defaultValues.indexOf(value) ||
+          (Array.isArray(value) && !value.length)) {
+          missingRequiredArgs.push(key)
+        }
+      })
+
+      if (missingRequiredArgs.length > 0) {
+        usage.fail(__n(
+          'Missing argument value: %s',
+          'Missing argument values: %s',
+          missingRequiredArgs.length,
+          missingRequiredArgs.join(', ')
+        ))
+      }
+    }
+  }
+
+  // make sure all the required arguments are present.
+  self.requiredArguments = function (argv) {
+    var demanded = yargs.getDemanded()
+    var missing = null
+
+    Object.keys(demanded).forEach(function (key) {
+      if (!argv.hasOwnProperty(key)) {
+        missing = missing || {}
+        missing[key] = demanded[key]
+      }
+    })
+
+    if (missing) {
+      var customMsgs = []
+      Object.keys(missing).forEach(function (key) {
+        var msg = missing[key].msg
+        if (msg && customMsgs.indexOf(msg) < 0) {
+          customMsgs.push(msg)
+        }
+      })
+
+      var customMsg = customMsgs.length ? '\n' + customMsgs.join('\n') : ''
+
+      usage.fail(__n(
+        'Missing required argument: %s',
+        'Missing required arguments: %s',
+        Object.keys(missing).length,
+        Object.keys(missing).join(', ') + customMsg
+      ))
+    }
+  }
+
+  // check for unknown arguments (strict-mode).
+  self.unknownArguments = function (argv, aliases) {
+    var aliasLookup = {}
+    var descriptions = usage.getDescriptions()
+    var demanded = yargs.getDemanded()
+    var unknown = []
+
+    Object.keys(aliases).forEach(function (key) {
+      aliases[key].forEach(function (alias) {
+        aliasLookup[alias] = key
+      })
+    })
+
+    Object.keys(argv).forEach(function (key) {
+      if (key !== '$0' && key !== '_' &&
+        !descriptions.hasOwnProperty(key) &&
+        !demanded.hasOwnProperty(key) &&
+        !aliasLookup.hasOwnProperty(key)) {
+        unknown.push(key)
+      }
+    })
+
+    if (unknown.length > 0) {
+      usage.fail(__n(
+        'Unknown argument: %s',
+        'Unknown arguments: %s',
+        unknown.length,
+        unknown.join(', ')
+      ))
+    }
+  }
+
+  // validate arguments limited to enumerated choices
+  self.limitedChoices = function (argv) {
+    var options = yargs.getOptions()
+    var invalid = {}
+
+    if (!Object.keys(options.choices).length) return
+
+    Object.keys(argv).forEach(function (key) {
+      if (key !== '$0' && key !== '_' &&
+        options.choices.hasOwnProperty(key)) {
+        [].concat(argv[key]).forEach(function (value) {
+          // TODO case-insensitive configurability
+          if (options.choices[key].indexOf(value) === -1) {
+            invalid[key] = (invalid[key] || []).concat(value)
+          }
+        })
+      }
+    })
+
+    var invalidKeys = Object.keys(invalid)
+
+    if (!invalidKeys.length) return
+
+    var msg = __('Invalid values:')
+    invalidKeys.forEach(function (key) {
+      msg += '\n  ' + __(
+        'Argument: %s, Given: %s, Choices: %s',
+        key,
+        usage.stringifiedValues(invalid[key]),
+        usage.stringifiedValues(options.choices[key])
+      )
+    })
+    usage.fail(msg)
+  }
+
+  // custom checks, added using the `check` option on yargs.
+  var checks = []
+  self.check = function (f) {
+    checks.push(f)
+  }
+
+  self.customChecks = function (argv, aliases) {
+    checks.forEach(function (f) {
+      try {
+        var result = f(argv, aliases)
+        if (!result) {
+          usage.fail(__('Argument check failed: %s', f.toString()))
+        } else if (typeof result === 'string') {
+          usage.fail(result)
+        }
+      } catch (err) {
+        usage.fail(err.message ? err.message : err)
+      }
+    })
+  }
+
+  // check implications, argument foo implies => argument bar.
+  var implied = {}
+  self.implies = function (key, value) {
+    if (typeof key === 'object') {
+      Object.keys(key).forEach(function (k) {
+        self.implies(k, key[k])
+      })
+    } else {
+      implied[key] = value
+    }
+  }
+  self.getImplied = function () {
+    return implied
+  }
+
+  self.implications = function (argv) {
+    var implyFail = []
+
+    Object.keys(implied).forEach(function (key) {
+      var num
+      var origKey = key
+      var value = implied[key]
+
+      // convert string '1' to number 1
+      num = Number(key)
+      key = isNaN(num) ? key : num
+
+      if (typeof key === 'number') {
+        // check length of argv._
+        key = argv._.length >= key
+      } else if (key.match(/^--no-.+/)) {
+        // check if key doesn't exist
+        key = key.match(/^--no-(.+)/)[1]
+        key = !argv[key]
+      } else {
+        // check if key exists
+        key = argv[key]
+      }
+
+      num = Number(value)
+      value = isNaN(num) ? value : num
+
+      if (typeof value === 'number') {
+        value = argv._.length >= value
+      } else if (value.match(/^--no-.+/)) {
+        value = value.match(/^--no-(.+)/)[1]
+        value = !argv[value]
+      } else {
+        value = argv[value]
+      }
+
+      if (key && !value) {
+        implyFail.push(origKey)
+      }
+    })
+
+    if (implyFail.length) {
+      var msg = __('Implications failed:') + '\n'
+
+      implyFail.forEach(function (key) {
+        msg += ('  ' + key + ' -> ' + implied[key])
+      })
+
+      usage.fail(msg)
+    }
+  }
+
+  return self
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/de.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/de.json
new file mode 100644 (file)
index 0000000..00b3907
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Kommandos:",
+  "Options:": "Optionen:",
+  "Examples:": "Beispiele:",
+  "boolean": "boolean",
+  "count": "Zähler",
+  "string": "string",
+  "array": "array",
+  "required": "erforderlich",
+  "default:": "Standard:",
+  "choices:": "Möglichkeiten:",
+  "generated-value": "Generierter-Wert",
+  "Not enough non-option arguments: got %s, need at least %s": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
+  "Too many non-option arguments: got %s, maximum of %s": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
+  "Missing argument value: %s": {
+    "one": "Fehlender Argumentwert: %s",
+    "other": "Fehlende Argumentwerte: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Fehlendes Argument: %s",
+    "other": "Fehlende Argumente: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Unbekanntes Argument: %s",
+    "other": "Unbekannte Argumente: %s"
+  },
+  "Invalid values:": "Unzulässige Werte:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
+  "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
+  "Implications failed:": "Implikationen fehlgeschlagen:",
+  "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
+  "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
+  "Path to JSON config file": "Pfad zur JSON-Config Datei",
+  "Show help": "Hilfe anzeigen",
+  "Show version number": "Version anzeigen"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/en.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/en.json
new file mode 100644 (file)
index 0000000..ce19199
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Commands:",
+  "Options:": "Options:",
+  "Examples:": "Examples:",
+  "boolean": "boolean",
+  "count": "count",
+  "string": "string",
+  "array": "array",
+  "required": "required",
+  "default:": "default:",
+  "choices:": "choices:",
+  "generated-value": "generated-value",
+  "Not enough non-option arguments: got %s, need at least %s": "Not enough non-option arguments: got %s, need at least %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Too many non-option arguments: got %s, maximum of %s",
+  "Missing argument value: %s": {
+    "one": "Missing argument value: %s",
+    "other": "Missing argument values: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Missing required argument: %s",
+    "other": "Missing required arguments: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Unknown argument: %s",
+    "other": "Unknown arguments: %s"
+  },
+  "Invalid values:": "Invalid values:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
+  "Argument check failed: %s": "Argument check failed: %s",
+  "Implications failed:": "Implications failed:",
+  "Not enough arguments following: %s": "Not enough arguments following: %s",
+  "Invalid JSON config file: %s": "Invalid JSON config file: %s",
+  "Path to JSON config file": "Path to JSON config file",
+  "Show help": "Show help",
+  "Show version number": "Show version number"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/es.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/es.json
new file mode 100644 (file)
index 0000000..c4f1917
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Comandos:",
+  "Options:": "Opciones:",
+  "Examples:": "Ejemplos:",
+  "boolean": "boolean",
+  "count": "cuenta",
+  "string": "cadena de caracteres",
+  "array": "tabla",
+  "required": "requisito",
+  "default:": "defecto:",
+  "choices:": "selección:",
+  "generated-value": "valor-generado",
+  "Not enough non-option arguments: got %s, need at least %s": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
+  "Missing argument value: %s": {
+    "one": "Falta argumento: %s",
+    "other": "Faltan argumentos: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Falta argumento requerido: %s",
+    "other": "Faltan argumentos requeridos: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argumento desconocido: %s",
+    "other": "Argumentos desconocidos: %s"
+  },
+  "Invalid values:": "Valores inválidos:",
+  "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Selección: %s",
+  "Argument check failed: %s": "Verificación de argumento ha fracasado: %s",
+  "Implications failed:": "Implicaciones fracasadas:",
+  "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
+  "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
+  "Path to JSON config file": "Ruta al archivo de configuración JSON",
+  "Show help": "Muestra ayuda",
+  "Show version number": "Muestra número de versión"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/fr.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/fr.json
new file mode 100644 (file)
index 0000000..49d068b
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Commandes:",
+  "Options:": "Options:",
+  "Examples:": "Exemples:",
+  "boolean": "booléen",
+  "count": "comptage",
+  "string": "chaine de caractère",
+  "array": "tableau",
+  "required": "requis",
+  "default:": "défaut:",
+  "choices:": "choix:",
+  "generated-value": "valeur générée",
+  "Not enough non-option arguments: got %s, need at least %s": "Pas assez d'arguments non-option: reçu %s, besoin d'au moins %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Trop d'arguments non-option: reçu %s, maximum %s",
+  "Missing argument value: %s": {
+    "one": "Argument manquant: %s",
+    "other": "Arguments manquants: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Argument requis manquant: %s",
+    "other": "Arguments requis manquants: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argument inconnu: %s",
+    "other": "Arguments inconnus: %s"
+  },
+  "Invalid values:": "Valeurs invalides:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Donné: %s, Choix: %s",
+  "Argument check failed: %s": "Echec de la vérification de l'argument: %s",
+  "Implications failed:": "Implications échouées:",
+  "Not enough arguments following: %s": "Pas assez d'arguments suivant: %s",
+  "Invalid JSON config file: %s": "Fichier de configuration JSON invalide: %s",
+  "Path to JSON config file": "Chemin du fichier de configuration JSON",
+  "Show help": "Affiche de l'aide",
+  "Show version number": "Affiche le numéro de version"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/id.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/id.json
new file mode 100644 (file)
index 0000000..7cb7e56
--- /dev/null
@@ -0,0 +1,37 @@
+
+{
+  "Commands:": "Perintah:",
+  "Options:": "Pilihan:",
+  "Examples:": "Contoh:",
+  "boolean": "boolean",
+  "count": "jumlah",
+  "string": "string",
+  "array": "larik",
+  "required": "diperlukan",
+  "default:": "bawaan:",
+  "choices:": "pilihan:",
+  "generated-value": "nilai-yang-dihasilkan",
+  "Not enough non-option arguments: got %s, need at least %s": "Argumen wajib kurang: hanya %s, minimal %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
+  "Missing argument value: %s": {
+    "one": "Kurang argumen: %s",
+    "other": "Kurang argumen: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Kurang argumen wajib: %s",
+    "other": "Kurang argumen wajib: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argumen tak diketahui: %s",
+    "other": "Argumen tak diketahui: %s"
+  },
+  "Invalid values:": "Nilai-nilai tidak valid:",
+  "Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s",
+  "Argument check failed: %s": "Pemeriksaan argument gagal: %s",
+  "Implications failed:": "Implikasi gagal:",
+  "Not enough arguments following: %s": "Kurang argumen untuk: %s",
+  "Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s",
+  "Path to JSON config file": "Alamat berkas konfigurasi JSON",
+  "Show help": "Lihat bantuan",
+  "Show version number": "Lihat nomor versi"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/ja.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/ja.json
new file mode 100644 (file)
index 0000000..21b8e52
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "コマンド:",
+  "Options:": "オプション:",
+  "Examples:": "例:",
+  "boolean": "真偽",
+  "count": "カウント",
+  "string": "文字列",
+  "array": "配列",
+  "required": "必須",
+  "default:": "デフォルト:",
+  "choices:": "選択してください:",
+  "generated-value": "生成された値",
+  "Not enough non-option arguments: got %s, need at least %s": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
+  "Too many non-option arguments: got %s, maximum of %s": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
+  "Missing argument value: %s": {
+    "one": "引数が見つかりません: %s",
+    "other": "引数が見つかりません: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "必須の引数が見つかりません: %s",
+    "other": "必須の引数が見つかりません: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "未知の引数です: %s",
+    "other": "未知の引数です: %s"
+  },
+  "Invalid values:": "不正な値です:",
+  "Argument: %s, Given: %s, Choices: %s": "引数は %s です。指定できるのは %s つです。選択してください: %s",
+  "Argument check failed: %s": "引数のチェックに失敗しました: %s",
+  "Implications failed:": "オプションの組み合わせで不正が生じました:",
+  "Not enough arguments following: %s": "次の引数が不足しています。: %s",
+  "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s",
+  "Path to JSON config file": "JSONの設定ファイルまでのpath",
+  "Show help": "ヘルプを表示",
+  "Show version number": "バージョンを表示"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/ko.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/ko.json
new file mode 100644 (file)
index 0000000..a16971a
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "명령:",
+  "Options:": "옵션:",
+  "Examples:": "예시:",
+  "boolean": "여부",
+  "count": "개수",
+  "string": "문자열",
+  "array": "배열",
+  "required": "필수",
+  "default:": "기본:",
+  "choices:": "선택:",
+  "generated-value": "생성된 값",
+  "Not enough non-option arguments: got %s, need at least %s": "옵션이 아닌 인자가 충분치 않습니다: %s개를 받았지만, 적어도 %s개는 필요합니다",
+  "Too many non-option arguments: got %s, maximum of %s": "옵션이 아닌 인자가 너무 많습니다: %s개를 받았지만, %s개 이하여야 합니다",
+  "Missing argument value: %s": {
+    "one": "인자값을 받지 못했습니다: %s",
+    "other": "인자값들을 받지 못했습니다: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "필수 인자를 받지 못했습니다: %s",
+    "other": "필수 인자들을 받지 못했습니다: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "알 수 없는 인자입니다: %s",
+    "other": "알 수 없는 인자들입니다: %s"
+  },
+  "Invalid values:": "잘못된 값입니다:",
+  "Argument: %s, Given: %s, Choices: %s": "인자: %s, 입력받은 값: %s, 선택지: %s",
+  "Argument check failed: %s": "유효하지 않은 인자입니다: %s",
+  "Implications failed:": "옵션의 조합이 잘못되었습니다:",
+  "Not enough arguments following: %s": "인자가 충분하게 주어지지 않았습니다: %s",
+  "Invalid JSON config file: %s": "유효하지 않은 JSON 설정파일입니다: %s",
+  "Path to JSON config file": "JSON 설정파일 경로",
+  "Show help": "도움말을 보여줍니다",
+  "Show version number": "버전 넘버를 보여줍니다"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/nb.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/nb.json
new file mode 100644 (file)
index 0000000..65fa6ae
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Kommandoer:",
+  "Options:": "Alternativer:",
+  "Examples:": "Eksempler:",
+  "boolean": "boolsk",
+  "count": "antall",
+  "string": "streng",
+  "array": "matrise",
+  "required": "obligatorisk",
+  "default:": "standard:",
+  "choices:": "valg:",
+  "generated-value": "generert-verdi",
+  "Not enough non-option arguments: got %s, need at least %s": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
+  "Too many non-option arguments: got %s, maximum of %s": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
+  "Missing argument value: %s": {
+    "one": "Mangler argument verdi: %s",
+    "other": "Mangler argument verdier: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Mangler obligatorisk argument: %s",
+    "other": "Mangler obligatoriske argumenter: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Ukjent argument: %s",
+    "other": "Ukjente argumenter: %s"
+  },
+  "Invalid values:": "Ugyldige verdier:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s",
+  "Argument check failed: %s": "Argument sjekk mislyktes: %s",
+  "Implications failed:": "Konsekvensene mislyktes:",
+  "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s",
+  "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
+  "Path to JSON config file": "Bane til JSON konfigurasjonsfil",
+  "Show help": "Vis hjelp",
+  "Show version number": "Vis versjonsnummer"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/pirate.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/pirate.json
new file mode 100644 (file)
index 0000000..1f4e19e
--- /dev/null
@@ -0,0 +1,12 @@
+{
+  "Commands:": "Choose yer command:",
+  "Options:": "Options for me hearties!",
+  "Examples:": "Ex. marks the spot:",
+  "required": "requi-yar-ed",
+  "Missing required argument: %s": {
+    "one": "Ye be havin' to set the followin' argument land lubber: %s",
+    "other": "Ye be havin' to set the followin' arguments land lubber: %s"
+  },
+  "Show help": "Parlay this here code of conduct",
+  "Show version number": "'Tis the version ye be askin' fer"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/pl.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/pl.json
new file mode 100644 (file)
index 0000000..7d4c5be
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Polecenia:",
+  "Options:": "Opcje:",
+  "Examples:": "Przykłady:",
+  "boolean": "boolean",
+  "count": "ilość",
+  "string": "ciąg znaków",
+  "array": "tablica",
+  "required": "wymagany",
+  "default:": "domyślny:",
+  "choices:": "dostępne:",
+  "generated-value": "wygenerowana-wartość",
+  "Not enough non-option arguments: got %s, need at least %s": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
+  "Missing argument value: %s": {
+    "one": "Brak wartości dla argumentu: %s",
+    "other": "Brak wartości dla argumentów: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Brak wymaganego argumentu: %s",
+    "other": "Brak wymaganych argumentów: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Nieznany argument: %s",
+    "other": "Nieznane argumenty: %s"
+  },
+  "Invalid values:": "Nieprawidłowe wartości:",
+  "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s",
+  "Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s",
+  "Implications failed:": "Założenia nie zostały spełnione:",
+  "Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s",
+  "Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s",
+  "Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON",
+  "Show help": "Pokaż pomoc",
+  "Show version number": "Pokaż numer wersji"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/pt.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/pt.json
new file mode 100644 (file)
index 0000000..6abbcd4
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Comandos:",
+  "Options:": "Opções:",
+  "Examples:": "Exemplos:",
+  "boolean": "boolean",
+  "count": "contagem",
+  "string": "cadeia de caracteres",
+  "array": "arranjo",
+  "required": "requerido",
+  "default:": "padrão:",
+  "choices:": "escolhas:",
+  "generated-value": "valor-gerado",
+  "Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
+  "Missing argument value: %s": {
+    "one": "Falta valor de argumento: %s",
+    "other": "Falta valores de argumento: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Falta argumento obrigatório: %s",
+    "other": "Faltando argumentos obrigatórios: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argumento desconhecido: %s",
+    "other": "Argumentos desconhecidos: %s"
+  },
+  "Invalid values:": "Valores inválidos:",
+  "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s",
+  "Argument check failed: %s": "Verificação de argumento falhou: %s",
+  "Implications failed:": "Implicações falharam:",
+  "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s",
+  "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s",
+  "Path to JSON config file": "Caminho para o arquivo de configuração em JSON",
+  "Show help": "Mostra ajuda",
+  "Show version number": "Mostra número de versão"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/pt_BR.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/pt_BR.json
new file mode 100644 (file)
index 0000000..eb7544e
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Comandos:",
+  "Options:": "Opções:",
+  "Examples:": "Exemplos:",
+  "boolean": "boolean",
+  "count": "contagem",
+  "string": "string",
+  "array": "array",
+  "required": "obrigatório",
+  "default:": "padrão:",
+  "choices:": "opções:",
+  "generated-value": "valor-gerado",
+  "Not enough non-option arguments: got %s, need at least %s": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s",
+  "Too many non-option arguments: got %s, maximum of %s": "Excesso de argumentos: recebido %s, máximo de %s",
+  "Missing argument value: %s": {
+    "one": "Falta valor de argumento: %s",
+    "other": "Falta valores de argumento: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Falta argumento obrigatório: %s",
+    "other": "Faltando argumentos obrigatórios: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Argumento desconhecido: %s",
+    "other": "Argumentos desconhecidos: %s"
+  },
+  "Invalid values:": "Valores inválidos:",
+  "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s",
+  "Argument check failed: %s": "Verificação de argumento falhou: %s",
+  "Implications failed:": "Implicações falharam:",
+  "Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s",
+  "Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s",
+  "Path to JSON config file": "Caminho para o arquivo JSON de configuração",
+  "Show help": "Exibe ajuda",
+  "Show version number": "Exibe a versão"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/tr.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/tr.json
new file mode 100644 (file)
index 0000000..cef09d2
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "Komutlar:",
+  "Options:": "Seçenekler:",
+  "Examples:": "Örnekler:",
+  "boolean": "boolean",
+  "count": "sayı",
+  "string": "string",
+  "array": "array",
+  "required": "zorunlu",
+  "default:": "varsayılan:",
+  "choices:": "seçimler:",
+  "generated-value": "oluşturulan-değer",
+  "Not enough non-option arguments: got %s, need at least %s": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli",
+  "Too many non-option arguments: got %s, maximum of %s": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s",
+  "Missing argument value: %s": {
+    "one": "Eksik argüman değeri: %s",
+    "other": "Eksik argüman değerleri: %s"
+  },
+  "Missing required argument: %s": {
+    "one": "Eksik zorunlu argüman: %s",
+    "other": "Eksik zorunlu argümanlar: %s"
+  },
+  "Unknown argument: %s": {
+    "one": "Bilinmeyen argüman: %s",
+    "other": "Bilinmeyen argümanlar: %s"
+  },
+  "Invalid values:": "Geçersiz değerler:",
+  "Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s",
+  "Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s",
+  "Implications failed:": "Sonuçlar başarısız oldu:",
+  "Not enough arguments following: %s": "%s için yeterli argüman bulunamadı",
+  "Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s",
+  "Path to JSON config file": "JSON yapılandırma dosya konumu",
+  "Show help": "Yardım detaylarını göster",
+  "Show version number": "Versiyon detaylarını göster"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/locales/zh.json b/legacy-libs/grpc-cloned/node_modules/yargs/locales/zh.json
new file mode 100644 (file)
index 0000000..7b01d71
--- /dev/null
@@ -0,0 +1,36 @@
+{
+  "Commands:": "命令:",
+  "Options:": "选项:",
+  "Examples:": "示例:",
+  "boolean": "boolean",
+  "count": "count",
+  "string": "string",
+  "array": "array",
+  "required": "required",
+  "default:": "默认值:",
+  "choices:": "可选值:",
+  "generated-value": "生成的值",
+  "Not enough non-option arguments: got %s, need at least %s": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个",
+  "Too many non-option arguments: got %s, maximum of %s": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个",
+  "Missing argument value: %s": {
+    "one": "没有给此选项指定值:%s",
+    "other": "没有给这些选项指定值:%s"
+  },
+  "Missing required argument: %s": {
+    "one": "缺少必须的选项:%s",
+    "other": "缺少这些必须的选项:%s"
+  },
+  "Unknown argument: %s": {
+    "one": "无法识别的选项:%s",
+    "other": "无法识别这些选项:%s"
+  },
+  "Invalid values:": "无效的选项值:",
+  "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s",
+  "Argument check failed: %s": "选项值验证失败:%s",
+  "Implications failed:": "缺少依赖的选项:",
+  "Not enough arguments following: %s": "没有提供足够的值给此选项:%s",
+  "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s",
+  "Path to JSON config file": "JSON 配置文件的路径",
+  "Show help": "显示帮助信息",
+  "Show version number": "显示版本号"
+}
diff --git a/legacy-libs/grpc-cloned/node_modules/yargs/package.json b/legacy-libs/grpc-cloned/node_modules/yargs/package.json
new file mode 100644 (file)
index 0000000..953d8bc
--- /dev/null
@@ -0,0 +1,174 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "yargs@^3.10.0",
+        "scope": null,
+        "escapedName": "yargs",
+        "name": "yargs",
+        "rawSpec": "^3.10.0",
+        "spec": ">=3.10.0 <4.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/grpc/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "yargs@>=3.10.0 <4.0.0",
+  "_id": "yargs@3.32.0",
+  "_inCache": true,
+  "_location": "/grpc/yargs",
+  "_nodeVersion": "3.2.0",
+  "_npmUser": {
+    "name": "bcoe",
+    "email": "ben@npmjs.com"
+  },
+  "_npmVersion": "3.3.0",
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "yargs@^3.10.0",
+    "scope": null,
+    "escapedName": "yargs",
+    "name": "yargs",
+    "rawSpec": "^3.10.0",
+    "spec": ">=3.10.0 <4.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/grpc/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz",
+  "_shasum": "03088e9ebf9e756b69751611d2a5ef591482c995",
+  "_shrinkwrap": null,
+  "_spec": "yargs@^3.10.0",
+  "_where": "/var/opt/motion2/node_modules/grpc/node_modules/protobufjs",
+  "author": {
+    "name": "Alex Ford",
+    "email": "Alex.Ford@CodeTunnel.com",
+    "url": "http://CodeTunnel.com"
+  },
+  "bugs": {
+    "url": "https://github.com/bcoe/yargs/issues"
+  },
+  "contributors": [
+    {
+      "name": "Benjamin Coe",
+      "email": "ben@npmjs.com",
+      "url": "https://github.com/bcoe"
+    },
+    {
+      "name": "Andrew Goode",
+      "url": "https://github.com/nexdrew"
+    },
+    {
+      "name": "Chris Needham",
+      "email": "chris@chrisneedham.com",
+      "url": "http://chrisneedham.com"
+    },
+    {
+      "name": "James Nylen",
+      "email": "jnylen@gmail.com",
+      "url": "https://github.com/nylen"
+    },
+    {
+      "name": "Benjamin Horsleben",
+      "url": "https://github.com/fizker"
+    },
+    {
+      "name": "Lin Clark",
+      "url": "https://github.com/linclark"
+    },
+    {
+      "name": "Tim Schaub",
+      "url": "https://github.com/tschaub"
+    }
+  ],
+  "dependencies": {
+    "camelcase": "^2.0.1",
+    "cliui": "^3.0.3",
+    "decamelize": "^1.1.1",
+    "os-locale": "^1.4.0",
+    "string-width": "^1.0.1",
+    "window-size": "^0.1.4",
+    "y18n": "^3.2.0"
+  },
+  "description": "Light-weight option parsing with an argv hash. No optstrings attached.",
+  "devDependencies": {
+    "chai": "^3.4.1",
+    "chalk": "^1.1.1",
+    "coveralls": "^2.11.4",
+    "es6-promise": "^3.0.2",
+    "hashish": "0.0.4",
+    "mocha": "^2.3.4",
+    "nyc": "^5.2.0",
+    "standard": "^5.4.1",
+    "which": "^1.1.2",
+    "win-spawn": "^2.0.0"
+  },
+  "directories": {},
+  "dist": {
+    "shasum": "03088e9ebf9e756b69751611d2a5ef591482c995",
+    "tarball": "https://registry.npmjs.org/yargs/-/yargs-3.32.0.tgz"
+  },
+  "engine": {
+    "node": ">=0.10"
+  },
+  "files": [
+    "index.js",
+    "lib",
+    "locales",
+    "completion.sh.hbs",
+    "LICENSE"
+  ],
+  "gitHead": "e6eaddf457c27e71a0bbe156f17d2f82087f0d6f",
+  "homepage": "https://github.com/bcoe/yargs#readme",
+  "keywords": [
+    "argument",
+    "args",
+    "option",
+    "parser",
+    "parsing",
+    "cli",
+    "command"
+  ],
+  "license": "MIT",
+  "main": "./index.js",
+  "maintainers": [
+    {
+      "name": "bcoe",
+      "email": "ben@npmjs.com"
+    },
+    {
+      "name": "chevex",
+      "email": "alex.ford@codetunnel.com"
+    },
+    {
+      "name": "nexdrew",
+      "email": "andrew@npmjs.com"
+    },
+    {
+      "name": "nylen",
+      "email": "jnylen@gmail.com"
+    }
+  ],
+  "name": "yargs",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/bcoe/yargs.git"
+  },
+  "scripts": {
+    "coverage": "nyc report --reporter=text-lcov | coveralls",
+    "pretest": "standard",
+    "test": "nyc --cache mocha --timeout=4000 --check-leaks"
+  },
+  "standard": {
+    "ignore": [
+      "**/example/**"
+    ],
+    "globals": [
+      "it"
+    ]
+  },
+  "version": "3.32.0"
+}
diff --git a/legacy-libs/grpc/node_modules/abbrev/LICENSE b/legacy-libs/grpc/node_modules/abbrev/LICENSE
new file mode 100644 (file)
index 0000000..9bcfa9d
--- /dev/null
@@ -0,0 +1,46 @@
+This software is dual-licensed under the ISC and MIT licenses.
+You may use this software under EITHER of the following licenses.
+
+----------
+
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+----------
+
+Copyright Isaac Z. Schlueter and Contributors
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/abbrev/README.md b/legacy-libs/grpc/node_modules/abbrev/README.md
new file mode 100644 (file)
index 0000000..99746fe
--- /dev/null
@@ -0,0 +1,23 @@
+# abbrev-js
+
+Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
+
+Usage:
+
+    var abbrev = require("abbrev");
+    abbrev("foo", "fool", "folding", "flop");
+    
+    // returns:
+    { fl: 'flop'
+    , flo: 'flop'
+    , flop: 'flop'
+    , fol: 'folding'
+    , fold: 'folding'
+    , foldi: 'folding'
+    , foldin: 'folding'
+    , folding: 'folding'
+    , foo: 'foo'
+    , fool: 'fool'
+    }
+
+This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.
diff --git a/legacy-libs/grpc/node_modules/abbrev/abbrev.js b/legacy-libs/grpc/node_modules/abbrev/abbrev.js
new file mode 100644 (file)
index 0000000..7b1dc5d
--- /dev/null
@@ -0,0 +1,61 @@
+module.exports = exports = abbrev.abbrev = abbrev
+
+abbrev.monkeyPatch = monkeyPatch
+
+function monkeyPatch () {
+  Object.defineProperty(Array.prototype, 'abbrev', {
+    value: function () { return abbrev(this) },
+    enumerable: false, configurable: true, writable: true
+  })
+
+  Object.defineProperty(Object.prototype, 'abbrev', {
+    value: function () { return abbrev(Object.keys(this)) },
+    enumerable: false, configurable: true, writable: true
+  })
+}
+
+function abbrev (list) {
+  if (arguments.length !== 1 || !Array.isArray(list)) {
+    list = Array.prototype.slice.call(arguments, 0)
+  }
+  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
+    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
+  }
+
+  // sort them lexicographically, so that they're next to their nearest kin
+  args = args.sort(lexSort)
+
+  // walk through each, seeing how much it has in common with the next and previous
+  var abbrevs = {}
+    , prev = ""
+  for (var i = 0, l = args.length ; i < l ; i ++) {
+    var current = args[i]
+      , next = args[i + 1] || ""
+      , nextMatches = true
+      , prevMatches = true
+    if (current === next) continue
+    for (var j = 0, cl = current.length ; j < cl ; j ++) {
+      var curChar = current.charAt(j)
+      nextMatches = nextMatches && curChar === next.charAt(j)
+      prevMatches = prevMatches && curChar === prev.charAt(j)
+      if (!nextMatches && !prevMatches) {
+        j ++
+        break
+      }
+    }
+    prev = current
+    if (j === cl) {
+      abbrevs[current] = current
+      continue
+    }
+    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
+      abbrevs[a] = current
+      a += current.charAt(j)
+    }
+  }
+  return abbrevs
+}
+
+function lexSort (a, b) {
+  return a === b ? 0 : a > b ? 1 : -1
+}
diff --git a/legacy-libs/grpc/node_modules/abbrev/package.json b/legacy-libs/grpc/node_modules/abbrev/package.json
new file mode 100644 (file)
index 0000000..1d5f62d
--- /dev/null
@@ -0,0 +1,64 @@
+{
+  "_args": [
+    [
+      "abbrev@1.1.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "abbrev@1.1.1",
+  "_id": "abbrev@1.1.1",
+  "_inBundle": false,
+  "_integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
+  "_location": "/grpc/abbrev",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "abbrev@1.1.1",
+    "name": "abbrev",
+    "escapedName": "abbrev",
+    "rawSpec": "1.1.1",
+    "saveSpec": null,
+    "fetchSpec": "1.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/nopt"
+  ],
+  "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/abbrev-js/issues"
+  },
+  "dependencies": {},
+  "description": "Like ruby's abbrev module, but in js",
+  "devDependencies": {
+    "tap": "^10.1"
+  },
+  "files": [
+    "abbrev.js"
+  ],
+  "homepage": "https://github.com/isaacs/abbrev-js#readme",
+  "license": "ISC",
+  "main": "abbrev.js",
+  "name": "abbrev",
+  "optionalDependencies": {},
+  "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n    var abbrev = require(\"abbrev\");\n    abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n    \n    // returns:\n    { fl: 'flop'\n    , flo: 'flop'\n    , flop: 'flop'\n    , fol: 'folding'\n    , fold: 'folding'\n    , foldi: 'folding'\n    , foldin: 'folding'\n    , folding: 'folding'\n    , foo: 'foo'\n    , fool: 'fool'\n    }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+ssh://git@github.com/isaacs/abbrev-js.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test.js --100"
+  },
+  "version": "1.1.1"
+}
diff --git a/legacy-libs/grpc/node_modules/ansi-regex/index.js b/legacy-libs/grpc/node_modules/ansi-regex/index.js
new file mode 100644 (file)
index 0000000..b9574ed
--- /dev/null
@@ -0,0 +1,4 @@
+'use strict';
+module.exports = function () {
+       return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
+};
diff --git a/legacy-libs/grpc/node_modules/ansi-regex/license b/legacy-libs/grpc/node_modules/ansi-regex/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/ansi-regex/package.json b/legacy-libs/grpc/node_modules/ansi-regex/package.json
new file mode 100644 (file)
index 0000000..cbb8886
--- /dev/null
@@ -0,0 +1,116 @@
+{
+  "_args": [
+    [
+      "ansi-regex@2.1.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "ansi-regex@2.1.1",
+  "_id": "ansi-regex@2.1.1",
+  "_inBundle": false,
+  "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
+  "_location": "/grpc/ansi-regex",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "ansi-regex@2.1.1",
+    "name": "ansi-regex",
+    "escapedName": "ansi-regex",
+    "rawSpec": "2.1.1",
+    "saveSpec": null,
+    "fetchSpec": "2.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/strip-ansi"
+  ],
+  "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/chalk/ansi-regex/issues"
+  },
+  "dependencies": {},
+  "description": "Regular expression for matching ANSI escape codes",
+  "devDependencies": {
+    "ava": "0.17.0",
+    "xo": "0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/chalk/ansi-regex#readme",
+  "keywords": [
+    "ansi",
+    "styles",
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "cli",
+    "string",
+    "tty",
+    "escape",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "command-line",
+    "text",
+    "regex",
+    "regexp",
+    "re",
+    "match",
+    "test",
+    "find",
+    "pattern"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "Sindre Sorhus",
+      "email": "sindresorhus@gmail.com",
+      "url": "sindresorhus.com"
+    },
+    {
+      "name": "Joshua Appelman",
+      "email": "jappelman@xebia.com",
+      "url": "jbnicolai.com"
+    },
+    {
+      "name": "JD Ballard",
+      "email": "i.am.qix@gmail.com",
+      "url": "github.com/qix-"
+    }
+  ],
+  "name": "ansi-regex",
+  "optionalDependencies": {},
+  "readme": "# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)\n\n> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save ansi-regex\n```\n\n\n## Usage\n\n```js\nconst ansiRegex = require('ansi-regex');\n\nansiRegex().test('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nansiRegex().test('cake');\n//=> false\n\n'\\u001b[4mcake\\u001b[0m'.match(ansiRegex());\n//=> ['\\u001b[4m', '\\u001b[0m']\n```\n\n## FAQ\n\n### Why do you test for codes not in the ECMA 48 standard?\n\nSome of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.\n\nOn the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of \"interrupts\" that can mean different things on certain brands of processors, most of which have been phased out.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/chalk/ansi-regex.git"
+  },
+  "scripts": {
+    "test": "xo && ava --verbose",
+    "view-supported": "node fixtures/view-codes.js"
+  },
+  "version": "2.1.1",
+  "xo": {
+    "rules": {
+      "guard-for-in": 0,
+      "no-loop-func": 0
+    }
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/ansi-regex/readme.md b/legacy-libs/grpc/node_modules/ansi-regex/readme.md
new file mode 100644 (file)
index 0000000..6a928ed
--- /dev/null
@@ -0,0 +1,39 @@
+# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)
+
+> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```
+$ npm install --save ansi-regex
+```
+
+
+## Usage
+
+```js
+const ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001b[4mcake\u001b[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001b[4mcake\u001b[0m'.match(ansiRegex());
+//=> ['\u001b[4m', '\u001b[0m']
+```
+
+## FAQ
+
+### Why do you test for codes not in the ECMA 48 standard?
+
+Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
+
+On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/aproba/LICENSE b/legacy-libs/grpc/node_modules/aproba/LICENSE
new file mode 100644 (file)
index 0000000..f4be44d
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2015, Rebecca Turner <me@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/legacy-libs/grpc/node_modules/aproba/README.md b/legacy-libs/grpc/node_modules/aproba/README.md
new file mode 100644 (file)
index 0000000..0bfc594
--- /dev/null
@@ -0,0 +1,94 @@
+aproba
+======
+
+A ridiculously light-weight function argument validator
+
+```
+var validate = require("aproba")
+
+function myfunc(a, b, c) {
+  // `a` must be a string, `b` a number, `c` a function
+  validate('SNF', arguments) // [a,b,c] is also valid
+}
+
+myfunc('test', 23, function () {}) // ok
+myfunc(123, 23, function () {}) // type error
+myfunc('test', 23) // missing arg error
+myfunc('test', 23, function () {}, true) // too many args error
+
+```
+
+Valid types are:
+
+| type | description
+| :--: | :----------
+| *    | matches any type
+| A    | `Array.isArray` OR an `arguments` object
+| S    | typeof == string
+| N    | typeof == number
+| F    | typeof == function
+| O    | typeof == object and not type A and not type E
+| B    | typeof == boolean
+| E    | `instanceof Error` OR `null` **(special: see below)**
+| Z    | == `null`
+
+Validation failures throw one of three exception types, distinguished by a
+`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`.
+
+If you pass in an invalid type then it will throw with a code of
+`EUNKNOWNTYPE`.
+
+If an **error** argument is found and is not null then the remaining
+arguments are optional.  That is, if you say `ESO` then that's like using a
+non-magical `E` in: `E|ESO|ZSO`.
+
+### But I have optional arguments?!
+
+You can provide more than one signature by separating them with pipes `|`.
+If any signature matches the arguments then they'll be considered valid.
+
+So for example, say you wanted to write a signature for
+`fs.createWriteStream`.  The docs for it describe it thusly:
+
+```
+fs.createWriteStream(path[, options])
+```
+
+This would be a signature of `SO|S`.  That is, a string and and object, or
+just a string.
+
+Now, if you read the full `fs` docs, you'll see that actually path can ALSO
+be a buffer.  And options can be a string, that is:
+```
+path <String> | <Buffer>
+options <String> | <Object>
+```
+
+To reproduce this you have to fully enumerate all of the possible
+combinations and that implies a signature of `SO|SS|OO|OS|S|O`.  The
+awkwardness is a feature: It reminds you of the complexity you're adding to
+your API when you do this sort of thing.
+
+
+### Browser support
+
+This has no dependencies and should work in browsers, though you'll have
+noisier stack traces.
+
+### Why this exists
+
+I wanted a very simple argument validator. It needed to do two things:
+
+1. Be more concise and easier to use than assertions
+
+2. Not encourage an infinite bikeshed of DSLs
+
+This is why types are specified by a single character and there's no such
+thing as an optional argument. 
+
+This is not intended to validate user data. This is specifically about
+asserting the interface of your functions.
+
+If you need greater validation, I encourage you to write them by hand or
+look elsewhere.
+
diff --git a/legacy-libs/grpc/node_modules/aproba/index.js b/legacy-libs/grpc/node_modules/aproba/index.js
new file mode 100644 (file)
index 0000000..6f3f797
--- /dev/null
@@ -0,0 +1,105 @@
+'use strict'
+
+function isArguments (thingy) {
+  return thingy != null && typeof thingy === 'object' && thingy.hasOwnProperty('callee')
+}
+
+var types = {
+  '*': {label: 'any', check: function () { return true }},
+  A: {label: 'array', check: function (thingy) { return Array.isArray(thingy) || isArguments(thingy) }},
+  S: {label: 'string', check: function (thingy) { return typeof thingy === 'string' }},
+  N: {label: 'number', check: function (thingy) { return typeof thingy === 'number' }},
+  F: {label: 'function', check: function (thingy) { return typeof thingy === 'function' }},
+  O: {label: 'object', check: function (thingy) { return typeof thingy === 'object' && thingy != null && !types.A.check(thingy) && !types.E.check(thingy) }},
+  B: {label: 'boolean', check: function (thingy) { return typeof thingy === 'boolean' }},
+  E: {label: 'error', check: function (thingy) { return thingy instanceof Error }},
+  Z: {label: 'null', check: function (thingy) { return thingy == null }}
+}
+
+function addSchema (schema, arity) {
+  var group = arity[schema.length] = arity[schema.length] || []
+  if (group.indexOf(schema) === -1) group.push(schema)
+}
+
+var validate = module.exports = function (rawSchemas, args) {
+  if (arguments.length !== 2) throw wrongNumberOfArgs(['SA'], arguments.length)
+  if (!rawSchemas) throw missingRequiredArg(0, 'rawSchemas')
+  if (!args) throw missingRequiredArg(1, 'args')
+  if (!types.S.check(rawSchemas)) throw invalidType(0, ['string'], rawSchemas)
+  if (!types.A.check(args)) throw invalidType(1, ['array'], args)
+  var schemas = rawSchemas.split('|')
+  var arity = {}
+
+  schemas.forEach(function (schema) {
+    for (var ii = 0; ii < schema.length; ++ii) {
+      var type = schema[ii]
+      if (!types[type]) throw unknownType(ii, type)
+    }
+    if (/E.*E/.test(schema)) throw moreThanOneError(schema)
+    addSchema(schema, arity)
+    if (/E/.test(schema)) {
+      addSchema(schema.replace(/E.*$/, 'E'), arity)
+      addSchema(schema.replace(/E/, 'Z'), arity)
+      if (schema.length === 1) addSchema('', arity)
+    }
+  })
+  var matching = arity[args.length]
+  if (!matching) {
+    throw wrongNumberOfArgs(Object.keys(arity), args.length)
+  }
+  for (var ii = 0; ii < args.length; ++ii) {
+    var newMatching = matching.filter(function (schema) {
+      var type = schema[ii]
+      var typeCheck = types[type].check
+      return typeCheck(args[ii])
+    })
+    if (!newMatching.length) {
+      var labels = matching.map(function (schema) {
+        return types[schema[ii]].label
+      }).filter(function (schema) { return schema != null })
+      throw invalidType(ii, labels, args[ii])
+    }
+    matching = newMatching
+  }
+}
+
+function missingRequiredArg (num) {
+  return newException('EMISSINGARG', 'Missing required argument #' + (num + 1))
+}
+
+function unknownType (num, type) {
+  return newException('EUNKNOWNTYPE', 'Unknown type ' + type + ' in argument #' + (num + 1))
+}
+
+function invalidType (num, expectedTypes, value) {
+  var valueType
+  Object.keys(types).forEach(function (typeCode) {
+    if (types[typeCode].check(value)) valueType = types[typeCode].label
+  })
+  return newException('EINVALIDTYPE', 'Argument #' + (num + 1) + ': Expected ' +
+    englishList(expectedTypes) + ' but got ' + valueType)
+}
+
+function englishList (list) {
+  return list.join(', ').replace(/, ([^,]+)$/, ' or $1')
+}
+
+function wrongNumberOfArgs (expected, got) {
+  var english = englishList(expected)
+  var args = expected.every(function (ex) { return ex.length === 1 })
+    ? 'argument'
+    : 'arguments'
+  return newException('EWRONGARGCOUNT', 'Expected ' + english + ' ' + args + ' but got ' + got)
+}
+
+function moreThanOneError (schema) {
+  return newException('ETOOMANYERRORTYPES',
+    'Only one error type per argument signature is allowed, more than one found in "' + schema + '"')
+}
+
+function newException (code, msg) {
+  var e = new Error(msg)
+  e.code = code
+  if (Error.captureStackTrace) Error.captureStackTrace(e, validate)
+  return e
+}
diff --git a/legacy-libs/grpc/node_modules/aproba/package.json b/legacy-libs/grpc/node_modules/aproba/package.json
new file mode 100644 (file)
index 0000000..5f9d995
--- /dev/null
@@ -0,0 +1,69 @@
+{
+  "_args": [
+    [
+      "aproba@1.2.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "aproba@1.2.0",
+  "_id": "aproba@1.2.0",
+  "_inBundle": false,
+  "_integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
+  "_location": "/grpc/aproba",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "aproba@1.2.0",
+    "name": "aproba",
+    "escapedName": "aproba",
+    "rawSpec": "1.2.0",
+    "saveSpec": null,
+    "fetchSpec": "1.2.0"
+  },
+  "_requiredBy": [
+    "/grpc/gauge"
+  ],
+  "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.2.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Rebecca Turner",
+    "email": "me@re-becca.org"
+  },
+  "bugs": {
+    "url": "https://github.com/iarna/aproba/issues"
+  },
+  "dependencies": {},
+  "description": "A ridiculously light-weight argument validator (now browser friendly)",
+  "devDependencies": {
+    "standard": "^10.0.3",
+    "tap": "^10.0.2"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/iarna/aproba",
+  "keywords": [
+    "argument",
+    "validate"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "aproba",
+  "optionalDependencies": {},
+  "readme": "aproba\n======\n\nA ridiculously light-weight function argument validator\n\n```\nvar validate = require(\"aproba\")\n\nfunction myfunc(a, b, c) {\n  // `a` must be a string, `b` a number, `c` a function\n  validate('SNF', arguments) // [a,b,c] is also valid\n}\n\nmyfunc('test', 23, function () {}) // ok\nmyfunc(123, 23, function () {}) // type error\nmyfunc('test', 23) // missing arg error\nmyfunc('test', 23, function () {}, true) // too many args error\n\n```\n\nValid types are:\n\n| type | description\n| :--: | :----------\n| *    | matches any type\n| A    | `Array.isArray` OR an `arguments` object\n| S    | typeof == string\n| N    | typeof == number\n| F    | typeof == function\n| O    | typeof == object and not type A and not type E\n| B    | typeof == boolean\n| E    | `instanceof Error` OR `null` **(special: see below)**\n| Z    | == `null`\n\nValidation failures throw one of three exception types, distinguished by a\n`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`.\n\nIf you pass in an invalid type then it will throw with a code of\n`EUNKNOWNTYPE`.\n\nIf an **error** argument is found and is not null then the remaining\narguments are optional.  That is, if you say `ESO` then that's like using a\nnon-magical `E` in: `E|ESO|ZSO`.\n\n### But I have optional arguments?!\n\nYou can provide more than one signature by separating them with pipes `|`.\nIf any signature matches the arguments then they'll be considered valid.\n\nSo for example, say you wanted to write a signature for\n`fs.createWriteStream`.  The docs for it describe it thusly:\n\n```\nfs.createWriteStream(path[, options])\n```\n\nThis would be a signature of `SO|S`.  That is, a string and and object, or\njust a string.\n\nNow, if you read the full `fs` docs, you'll see that actually path can ALSO\nbe a buffer.  And options can be a string, that is:\n```\npath <String> | <Buffer>\noptions <String> | <Object>\n```\n\nTo reproduce this you have to fully enumerate all of the possible\ncombinations and that implies a signature of `SO|SS|OO|OS|S|O`.  The\nawkwardness is a feature: It reminds you of the complexity you're adding to\nyour API when you do this sort of thing.\n\n\n### Browser support\n\nThis has no dependencies and should work in browsers, though you'll have\nnoisier stack traces.\n\n### Why this exists\n\nI wanted a very simple argument validator. It needed to do two things:\n\n1. Be more concise and easier to use than assertions\n\n2. Not encourage an infinite bikeshed of DSLs\n\nThis is why types are specified by a single character and there's no such\nthing as an optional argument. \n\nThis is not intended to validate user data. This is specifically about\nasserting the interface of your functions.\n\nIf you need greater validation, I encourage you to write them by hand or\nlook elsewhere.\n\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iarna/aproba.git"
+  },
+  "scripts": {
+    "test": "standard && tap -j3 test/*.js"
+  },
+  "version": "1.2.0"
+}
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/CHANGES.md b/legacy-libs/grpc/node_modules/are-we-there-yet/CHANGES.md
new file mode 100644 (file)
index 0000000..21f3b1c
--- /dev/null
@@ -0,0 +1,37 @@
+Hi, figured we could actually use a changelog now:
+
+## 1.1.5 2018-05-24
+
+* [#92](https://github.com/iarna/are-we-there-yet/pull/92) Fix bug where
+  `finish` would throw errors when including `TrackerStream` objects in
+  `TrackerGroup` collections.  (@brianloveswords)
+
+## 1.1.4 2017-04-21
+
+* Fix typo in package.json
+
+## 1.1.3 2017-04-21
+
+* Improve documentation and limit files included in the distribution.
+
+## 1.1.2 2016-03-15
+
+* Add tracker group cycle detection and tests for it
+
+## 1.1.1 2016-01-29
+
+* Fix a typo in stream completion tracker
+
+## 1.1.0 2016-01-29
+
+* Rewrote completion percent computation to be low impact– no more walking a
+  tree of completion groups every time we need this info.  Previously, with
+  medium sized tree of completion groups, even a relatively modest number of
+  calls to the top level `completed()` method would result in absurd numbers
+  of calls overall as it walked down the tree. We now, instead, keep track as
+  we bubble up changes, so the computation is limited to when data changes and
+  to the depth of that one branch, instead of _every_ node. (Plus, we were already
+  incurring _this_ cost, since we already bubbled out changes.)
+* Moved different tracker types out to their own files.
+* Made tests test for TOO MANY events too.
+* Standarized the source code formatting
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/LICENSE b/legacy-libs/grpc/node_modules/are-we-there-yet/LICENSE
new file mode 100644 (file)
index 0000000..af45880
--- /dev/null
@@ -0,0 +1,5 @@
+Copyright (c) 2015, Rebecca Turner
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/README.md b/legacy-libs/grpc/node_modules/are-we-there-yet/README.md
new file mode 100644 (file)
index 0000000..7e2b42d
--- /dev/null
@@ -0,0 +1,195 @@
+are-we-there-yet
+----------------
+
+Track complex hiearchies of asynchronous task completion statuses.  This is
+intended to give you a way of recording and reporting the progress of the big
+recursive fan-out and gather type workflows that are so common in async.
+
+What you do with this completion data is up to you, but the most common use case is to
+feed it to one of the many progress bar modules.
+
+Most progress bar modules include a rudamentary version of this, but my
+needs were more complex.
+
+Usage
+=====
+
+```javascript
+var TrackerGroup = require("are-we-there-yet").TrackerGroup
+
+var top = new TrackerGroup("program")
+
+var single = top.newItem("one thing", 100)
+single.completeWork(20)
+
+console.log(top.completed()) // 0.2
+
+fs.stat("file", function(er, stat) {
+  if (er) throw er  
+  var stream = top.newStream("file", stat.size)
+  console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete
+                              // and 50% * 20% == 10%
+  fs.createReadStream("file").pipe(stream).on("data", function (chunk) {
+    // do stuff with chunk
+  })
+  top.on("change", function (name) {
+    // called each time a chunk is read from "file"
+    // top.completed() will start at 0.1 and fill up to 0.6 as the file is read
+  })
+})
+```
+
+Shared Methods
+==============
+
+* var completed = tracker.completed()
+
+Implemented in: `Tracker`, `TrackerGroup`, `TrackerStream`
+
+Returns the ratio of completed work to work to be done. Range of 0 to 1.
+
+* tracker.finish()
+
+Implemented in: `Tracker`, `TrackerGroup`
+
+Marks the tracker as completed. With a TrackerGroup this marks all of its
+components as completed.
+
+Marks all of the components of this tracker as finished, which in turn means
+that `tracker.completed()` for this will now be 1.
+
+This will result in one or more `change` events being emitted.
+
+Events
+======
+
+All tracker objects emit `change` events with the following arguments:
+
+```
+function (name, completed, tracker)
+```
+
+`name` is the name of the tracker that originally emitted the event,
+or if it didn't have one, the first containing tracker group that had one.
+
+`completed` is the percent complete (as returned by `tracker.completed()` method).
+
+`tracker` is the tracker object that you are listening for events on.
+
+TrackerGroup
+============
+
+* var tracker = new TrackerGroup(**name**)
+
+  * **name** *(optional)* - The name of this tracker group, used in change
+    notifications if the component updating didn't have a name. Defaults to undefined.
+
+Creates a new empty tracker aggregation group. These are trackers whose
+completion status is determined by the completion status of other trackers.
+
+* tracker.addUnit(**otherTracker**, **weight**)
+
+  * **otherTracker** - Any of the other are-we-there-yet tracker objects
+  * **weight** *(optional)* - The weight to give the tracker, defaults to 1.
+
+Adds the **otherTracker** to this aggregation group. The weight determines
+how long you expect this tracker to take to complete in proportion to other
+units.  So for instance, if you add one tracker with a weight of 1 and
+another with a weight of 2, you're saying the second will take twice as long
+to complete as the first.  As such, the first will account for 33% of the
+completion of this tracker and the second will account for the other 67%.
+
+Returns **otherTracker**.
+
+* var subGroup = tracker.newGroup(**name**, **weight**)
+
+The above is exactly equivalent to:
+
+```javascript
+  var subGroup = tracker.addUnit(new TrackerGroup(name), weight)
+```
+
+* var subItem = tracker.newItem(**name**, **todo**, **weight**)
+
+The above is exactly equivalent to:
+
+```javascript
+  var subItem = tracker.addUnit(new Tracker(name, todo), weight)
+```
+
+* var subStream = tracker.newStream(**name**, **todo**, **weight**)
+
+The above is exactly equivalent to:
+
+```javascript
+  var subStream = tracker.addUnit(new TrackerStream(name, todo), weight)
+```
+
+* console.log( tracker.debug() )
+
+Returns a tree showing the completion of this tracker group and all of its
+children, including recursively entering all of the children.
+
+Tracker
+=======
+
+* var tracker = new Tracker(**name**, **todo**)
+
+  * **name** *(optional)* The name of this counter to report in change
+    events.  Defaults to undefined.
+  * **todo** *(optional)* The amount of work todo (a number). Defaults to 0.
+
+Ordinarily these are constructed as a part of a tracker group (via
+`newItem`).
+
+* var completed = tracker.completed()
+
+Returns the ratio of completed work to work to be done. Range of 0 to 1. If
+total work to be done is 0 then it will return 0.
+
+* tracker.addWork(**todo**)
+
+  * **todo** A number to add to the amount of work to be done.
+
+Increases the amount of work to be done, thus decreasing the completion
+percentage.  Triggers a `change` event.
+
+* tracker.completeWork(**completed**)
+
+  * **completed** A number to add to the work complete
+
+Increase the amount of work complete, thus increasing the completion percentage.
+Will never increase the work completed past the amount of work todo. That is,
+percentages > 100% are not allowed. Triggers a `change` event.
+
+* tracker.finish()
+
+Marks this tracker as finished, tracker.completed() will now be 1. Triggers
+a `change` event.
+
+TrackerStream
+=============
+
+* var tracker = new TrackerStream(**name**, **size**, **options**)
+
+  * **name** *(optional)* The name of this counter to report in change
+    events.  Defaults to undefined.
+  * **size** *(optional)* The number of bytes being sent through this stream.
+  * **options** *(optional)* A hash of stream options
+
+The tracker stream object is a pass through stream that updates an internal
+tracker object each time a block passes through.  It's intended to track
+downloads, file extraction and other related activities. You use it by piping
+your data source into it and then using it as your data source.
+
+If your data has a length attribute then that's used as the amount of work
+completed when the chunk is passed through.  If it does not (eg, object
+streams) then each chunk counts as completing 1 unit of work, so your size
+should be the total number of objects being streamed.
+
+* tracker.addWork(**todo**)
+
+  * **todo** Increase the expected overall size by **todo** bytes.
+
+Increases the amount of work to be done, thus decreasing the completion
+percentage.  Triggers a `change` event.
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/index.js b/legacy-libs/grpc/node_modules/are-we-there-yet/index.js
new file mode 100644 (file)
index 0000000..57d8743
--- /dev/null
@@ -0,0 +1,4 @@
+'use strict'
+exports.TrackerGroup = require('./tracker-group.js')
+exports.Tracker = require('./tracker.js')
+exports.TrackerStream = require('./tracker-stream.js')
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/package.json b/legacy-libs/grpc/node_modules/are-we-there-yet/package.json
new file mode 100644 (file)
index 0000000..ddcb7a6
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_args": [
+    [
+      "are-we-there-yet@1.1.5",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "are-we-there-yet@1.1.5",
+  "_id": "are-we-there-yet@1.1.5",
+  "_inBundle": false,
+  "_integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
+  "_location": "/grpc/are-we-there-yet",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "are-we-there-yet@1.1.5",
+    "name": "are-we-there-yet",
+    "escapedName": "are-we-there-yet",
+    "rawSpec": "1.1.5",
+    "saveSpec": null,
+    "fetchSpec": "1.1.5"
+  },
+  "_requiredBy": [
+    "/grpc/npmlog"
+  ],
+  "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.5",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Rebecca Turner",
+    "url": "http://re-becca.org"
+  },
+  "bugs": {
+    "url": "https://github.com/iarna/are-we-there-yet/issues"
+  },
+  "dependencies": {
+    "delegates": "^1.0.0",
+    "readable-stream": "^2.0.6"
+  },
+  "description": "Keep track of the overall completion of many disparate processes",
+  "devDependencies": {
+    "standard": "^11.0.1",
+    "tap": "^12.0.1"
+  },
+  "files": [
+    "index.js",
+    "tracker-base.js",
+    "tracker-group.js",
+    "tracker-stream.js",
+    "tracker.js",
+    "CHANGES.md"
+  ],
+  "homepage": "https://github.com/iarna/are-we-there-yet",
+  "license": "ISC",
+  "main": "index.js",
+  "name": "are-we-there-yet",
+  "optionalDependencies": {},
+  "readme": "are-we-there-yet\n----------------\n\nTrack complex hiearchies of asynchronous task completion statuses.  This is\nintended to give you a way of recording and reporting the progress of the big\nrecursive fan-out and gather type workflows that are so common in async.\n\nWhat you do with this completion data is up to you, but the most common use case is to\nfeed it to one of the many progress bar modules.\n\nMost progress bar modules include a rudamentary version of this, but my\nneeds were more complex.\n\nUsage\n=====\n\n```javascript\nvar TrackerGroup = require(\"are-we-there-yet\").TrackerGroup\n\nvar top = new TrackerGroup(\"program\")\n\nvar single = top.newItem(\"one thing\", 100)\nsingle.completeWork(20)\n\nconsole.log(top.completed()) // 0.2\n\nfs.stat(\"file\", function(er, stat) {\n  if (er) throw er  \n  var stream = top.newStream(\"file\", stat.size)\n  console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete\n                              // and 50% * 20% == 10%\n  fs.createReadStream(\"file\").pipe(stream).on(\"data\", function (chunk) {\n    // do stuff with chunk\n  })\n  top.on(\"change\", function (name) {\n    // called each time a chunk is read from \"file\"\n    // top.completed() will start at 0.1 and fill up to 0.6 as the file is read\n  })\n})\n```\n\nShared Methods\n==============\n\n* var completed = tracker.completed()\n\nImplemented in: `Tracker`, `TrackerGroup`, `TrackerStream`\n\nReturns the ratio of completed work to work to be done. Range of 0 to 1.\n\n* tracker.finish()\n\nImplemented in: `Tracker`, `TrackerGroup`\n\nMarks the tracker as completed. With a TrackerGroup this marks all of its\ncomponents as completed.\n\nMarks all of the components of this tracker as finished, which in turn means\nthat `tracker.completed()` for this will now be 1.\n\nThis will result in one or more `change` events being emitted.\n\nEvents\n======\n\nAll tracker objects emit `change` events with the following arguments:\n\n```\nfunction (name, completed, tracker)\n```\n\n`name` is the name of the tracker that originally emitted the event,\nor if it didn't have one, the first containing tracker group that had one.\n\n`completed` is the percent complete (as returned by `tracker.completed()` method).\n\n`tracker` is the tracker object that you are listening for events on.\n\nTrackerGroup\n============\n\n* var tracker = new TrackerGroup(**name**)\n\n  * **name** *(optional)* - The name of this tracker group, used in change\n    notifications if the component updating didn't have a name. Defaults to undefined.\n\nCreates a new empty tracker aggregation group. These are trackers whose\ncompletion status is determined by the completion status of other trackers.\n\n* tracker.addUnit(**otherTracker**, **weight**)\n\n  * **otherTracker** - Any of the other are-we-there-yet tracker objects\n  * **weight** *(optional)* - The weight to give the tracker, defaults to 1.\n\nAdds the **otherTracker** to this aggregation group. The weight determines\nhow long you expect this tracker to take to complete in proportion to other\nunits.  So for instance, if you add one tracker with a weight of 1 and\nanother with a weight of 2, you're saying the second will take twice as long\nto complete as the first.  As such, the first will account for 33% of the\ncompletion of this tracker and the second will account for the other 67%.\n\nReturns **otherTracker**.\n\n* var subGroup = tracker.newGroup(**name**, **weight**)\n\nThe above is exactly equivalent to:\n\n```javascript\n  var subGroup = tracker.addUnit(new TrackerGroup(name), weight)\n```\n\n* var subItem = tracker.newItem(**name**, **todo**, **weight**)\n\nThe above is exactly equivalent to:\n\n```javascript\n  var subItem = tracker.addUnit(new Tracker(name, todo), weight)\n```\n\n* var subStream = tracker.newStream(**name**, **todo**, **weight**)\n\nThe above is exactly equivalent to:\n\n```javascript\n  var subStream = tracker.addUnit(new TrackerStream(name, todo), weight)\n```\n\n* console.log( tracker.debug() )\n\nReturns a tree showing the completion of this tracker group and all of its\nchildren, including recursively entering all of the children.\n\nTracker\n=======\n\n* var tracker = new Tracker(**name**, **todo**)\n\n  * **name** *(optional)* The name of this counter to report in change\n    events.  Defaults to undefined.\n  * **todo** *(optional)* The amount of work todo (a number). Defaults to 0.\n\nOrdinarily these are constructed as a part of a tracker group (via\n`newItem`).\n\n* var completed = tracker.completed()\n\nReturns the ratio of completed work to work to be done. Range of 0 to 1. If\ntotal work to be done is 0 then it will return 0.\n\n* tracker.addWork(**todo**)\n\n  * **todo** A number to add to the amount of work to be done.\n\nIncreases the amount of work to be done, thus decreasing the completion\npercentage.  Triggers a `change` event.\n\n* tracker.completeWork(**completed**)\n\n  * **completed** A number to add to the work complete\n\nIncrease the amount of work complete, thus increasing the completion percentage.\nWill never increase the work completed past the amount of work todo. That is,\npercentages > 100% are not allowed. Triggers a `change` event.\n\n* tracker.finish()\n\nMarks this tracker as finished, tracker.completed() will now be 1. Triggers\na `change` event.\n\nTrackerStream\n=============\n\n* var tracker = new TrackerStream(**name**, **size**, **options**)\n\n  * **name** *(optional)* The name of this counter to report in change\n    events.  Defaults to undefined.\n  * **size** *(optional)* The number of bytes being sent through this stream.\n  * **options** *(optional)* A hash of stream options\n\nThe tracker stream object is a pass through stream that updates an internal\ntracker object each time a block passes through.  It's intended to track\ndownloads, file extraction and other related activities. You use it by piping\nyour data source into it and then using it as your data source.\n\nIf your data has a length attribute then that's used as the amount of work\ncompleted when the chunk is passed through.  If it does not (eg, object\nstreams) then each chunk counts as completing 1 unit of work, so your size\nshould be the total number of objects being streamed.\n\n* tracker.addWork(**todo**)\n\n  * **todo** Increase the expected overall size by **todo** bytes.\n\nIncreases the amount of work to be done, thus decreasing the completion\npercentage.  Triggers a `change` event.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iarna/are-we-there-yet.git"
+  },
+  "scripts": {
+    "test": "standard && tap test/*.js"
+  },
+  "version": "1.1.5"
+}
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/tracker-base.js b/legacy-libs/grpc/node_modules/are-we-there-yet/tracker-base.js
new file mode 100644 (file)
index 0000000..6f43687
--- /dev/null
@@ -0,0 +1,11 @@
+'use strict'
+var EventEmitter = require('events').EventEmitter
+var util = require('util')
+
+var trackerId = 0
+var TrackerBase = module.exports = function (name) {
+  EventEmitter.call(this)
+  this.id = ++trackerId
+  this.name = name
+}
+util.inherits(TrackerBase, EventEmitter)
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/tracker-group.js b/legacy-libs/grpc/node_modules/are-we-there-yet/tracker-group.js
new file mode 100644 (file)
index 0000000..9759e12
--- /dev/null
@@ -0,0 +1,107 @@
+'use strict'
+var util = require('util')
+var TrackerBase = require('./tracker-base.js')
+var Tracker = require('./tracker.js')
+var TrackerStream = require('./tracker-stream.js')
+
+var TrackerGroup = module.exports = function (name) {
+  TrackerBase.call(this, name)
+  this.parentGroup = null
+  this.trackers = []
+  this.completion = {}
+  this.weight = {}
+  this.totalWeight = 0
+  this.finished = false
+  this.bubbleChange = bubbleChange(this)
+}
+util.inherits(TrackerGroup, TrackerBase)
+
+function bubbleChange (trackerGroup) {
+  return function (name, completed, tracker) {
+    trackerGroup.completion[tracker.id] = completed
+    if (trackerGroup.finished) return
+    trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup)
+  }
+}
+
+TrackerGroup.prototype.nameInTree = function () {
+  var names = []
+  var from = this
+  while (from) {
+    names.unshift(from.name)
+    from = from.parentGroup
+  }
+  return names.join('/')
+}
+
+TrackerGroup.prototype.addUnit = function (unit, weight) {
+  if (unit.addUnit) {
+    var toTest = this
+    while (toTest) {
+      if (unit === toTest) {
+        throw new Error(
+          'Attempted to add tracker group ' +
+          unit.name + ' to tree that already includes it ' +
+          this.nameInTree(this))
+      }
+      toTest = toTest.parentGroup
+    }
+    unit.parentGroup = this
+  }
+  this.weight[unit.id] = weight || 1
+  this.totalWeight += this.weight[unit.id]
+  this.trackers.push(unit)
+  this.completion[unit.id] = unit.completed()
+  unit.on('change', this.bubbleChange)
+  if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit)
+  return unit
+}
+
+TrackerGroup.prototype.completed = function () {
+  if (this.trackers.length === 0) return 0
+  var valPerWeight = 1 / this.totalWeight
+  var completed = 0
+  for (var ii = 0; ii < this.trackers.length; ii++) {
+    var trackerId = this.trackers[ii].id
+    completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId]
+  }
+  return completed
+}
+
+TrackerGroup.prototype.newGroup = function (name, weight) {
+  return this.addUnit(new TrackerGroup(name), weight)
+}
+
+TrackerGroup.prototype.newItem = function (name, todo, weight) {
+  return this.addUnit(new Tracker(name, todo), weight)
+}
+
+TrackerGroup.prototype.newStream = function (name, todo, weight) {
+  return this.addUnit(new TrackerStream(name, todo), weight)
+}
+
+TrackerGroup.prototype.finish = function () {
+  this.finished = true
+  if (!this.trackers.length) this.addUnit(new Tracker(), 1, true)
+  for (var ii = 0; ii < this.trackers.length; ii++) {
+    var tracker = this.trackers[ii]
+    tracker.finish()
+    tracker.removeListener('change', this.bubbleChange)
+  }
+  this.emit('change', this.name, 1, this)
+}
+
+var buffer = '                                  '
+TrackerGroup.prototype.debug = function (depth) {
+  depth = depth || 0
+  var indent = depth ? buffer.substr(0, depth) : ''
+  var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n'
+  this.trackers.forEach(function (tracker) {
+    if (tracker instanceof TrackerGroup) {
+      output += tracker.debug(depth + 1)
+    } else {
+      output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n'
+    }
+  })
+  return output
+}
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/tracker-stream.js b/legacy-libs/grpc/node_modules/are-we-there-yet/tracker-stream.js
new file mode 100644 (file)
index 0000000..e1cf850
--- /dev/null
@@ -0,0 +1,36 @@
+'use strict'
+var util = require('util')
+var stream = require('readable-stream')
+var delegate = require('delegates')
+var Tracker = require('./tracker.js')
+
+var TrackerStream = module.exports = function (name, size, options) {
+  stream.Transform.call(this, options)
+  this.tracker = new Tracker(name, size)
+  this.name = name
+  this.id = this.tracker.id
+  this.tracker.on('change', delegateChange(this))
+}
+util.inherits(TrackerStream, stream.Transform)
+
+function delegateChange (trackerStream) {
+  return function (name, completion, tracker) {
+    trackerStream.emit('change', name, completion, trackerStream)
+  }
+}
+
+TrackerStream.prototype._transform = function (data, encoding, cb) {
+  this.tracker.completeWork(data.length ? data.length : 1)
+  this.push(data)
+  cb()
+}
+
+TrackerStream.prototype._flush = function (cb) {
+  this.tracker.finish()
+  cb()
+}
+
+delegate(TrackerStream.prototype, 'tracker')
+  .method('completed')
+  .method('addWork')
+  .method('finish')
diff --git a/legacy-libs/grpc/node_modules/are-we-there-yet/tracker.js b/legacy-libs/grpc/node_modules/are-we-there-yet/tracker.js
new file mode 100644 (file)
index 0000000..68c2339
--- /dev/null
@@ -0,0 +1,30 @@
+'use strict'
+var util = require('util')
+var TrackerBase = require('./tracker-base.js')
+
+var Tracker = module.exports = function (name, todo) {
+  TrackerBase.call(this, name)
+  this.workDone = 0
+  this.workTodo = todo || 0
+}
+util.inherits(Tracker, TrackerBase)
+
+Tracker.prototype.completed = function () {
+  return this.workTodo === 0 ? 0 : this.workDone / this.workTodo
+}
+
+Tracker.prototype.addWork = function (work) {
+  this.workTodo += work
+  this.emit('change', this.name, this.completed(), this)
+}
+
+Tracker.prototype.completeWork = function (work) {
+  this.workDone += work
+  if (this.workDone > this.workTodo) this.workDone = this.workTodo
+  this.emit('change', this.name, this.completed(), this)
+}
+
+Tracker.prototype.finish = function () {
+  this.workTodo = this.workDone = 1
+  this.emit('change', this.name, 1, this)
+}
diff --git a/legacy-libs/grpc/node_modules/balanced-match/LICENSE.md b/legacy-libs/grpc/node_modules/balanced-match/LICENSE.md
new file mode 100644 (file)
index 0000000..2cdc8e4
--- /dev/null
@@ -0,0 +1,21 @@
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/balanced-match/README.md b/legacy-libs/grpc/node_modules/balanced-match/README.md
new file mode 100644 (file)
index 0000000..08e918c
--- /dev/null
@@ -0,0 +1,91 @@
+# balanced-match
+
+Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
+
+[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)
+[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)
+
+[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)
+
+## Example
+
+Get the first matching pair of braces:
+
+```js
+var balanced = require('balanced-match');
+
+console.log(balanced('{', '}', 'pre{in{nested}}post'));
+console.log(balanced('{', '}', 'pre{first}between{second}post'));
+console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre  {   in{nest}   }  post'));
+```
+
+The matches are:
+
+```bash
+$ node example.js
+{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
+{ start: 3,
+  end: 9,
+  pre: 'pre',
+  body: 'first',
+  post: 'between{second}post' }
+{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
+```
+
+## API
+
+### var m = balanced(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+object with those keys:
+
+* **start** the index of the first match of `a`
+* **end** the index of the matching `b`
+* **pre** the preamble, `a` and `b` not included
+* **body** the match, `a` and `b` not included
+* **post** the postscript, `a` and `b` not included
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
+
+### var r = balanced.range(a, b, str)
+
+For the first non-nested matching pair of `a` and `b` in `str`, return an
+array with indexes: `[ <a index>, <b index> ]`.
+
+If there's no match, `undefined` will be returned.
+
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install balanced-match
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/balanced-match/index.js b/legacy-libs/grpc/node_modules/balanced-match/index.js
new file mode 100644 (file)
index 0000000..1685a76
--- /dev/null
@@ -0,0 +1,59 @@
+'use strict';
+module.exports = balanced;
+function balanced(a, b, str) {
+  if (a instanceof RegExp) a = maybeMatch(a, str);
+  if (b instanceof RegExp) b = maybeMatch(b, str);
+
+  var r = range(a, b, str);
+
+  return r && {
+    start: r[0],
+    end: r[1],
+    pre: str.slice(0, r[0]),
+    body: str.slice(r[0] + a.length, r[1]),
+    post: str.slice(r[1] + b.length)
+  };
+}
+
+function maybeMatch(reg, str) {
+  var m = str.match(reg);
+  return m ? m[0] : null;
+}
+
+balanced.range = range;
+function range(a, b, str) {
+  var begs, beg, left, right, result;
+  var ai = str.indexOf(a);
+  var bi = str.indexOf(b, ai + 1);
+  var i = ai;
+
+  if (ai >= 0 && bi > 0) {
+    begs = [];
+    left = str.length;
+
+    while (i >= 0 && !result) {
+      if (i == ai) {
+        begs.push(i);
+        ai = str.indexOf(a, i + 1);
+      } else if (begs.length == 1) {
+        result = [ begs.pop(), bi ];
+      } else {
+        beg = begs.pop();
+        if (beg < left) {
+          left = beg;
+          right = bi;
+        }
+
+        bi = str.indexOf(b, i + 1);
+      }
+
+      i = ai < bi && ai >= 0 ? ai : bi;
+    }
+
+    if (begs.length) {
+      result = [ left, right ];
+    }
+  }
+
+  return result;
+}
diff --git a/legacy-libs/grpc/node_modules/balanced-match/package.json b/legacy-libs/grpc/node_modules/balanced-match/package.json
new file mode 100644 (file)
index 0000000..c35a498
--- /dev/null
@@ -0,0 +1,84 @@
+{
+  "_args": [
+    [
+      "balanced-match@1.0.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "balanced-match@1.0.0",
+  "_id": "balanced-match@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+  "_location": "/grpc/balanced-match",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "balanced-match@1.0.0",
+    "name": "balanced-match",
+    "escapedName": "balanced-match",
+    "rawSpec": "1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "1.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/brace-expansion"
+  ],
+  "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/balanced-match/issues"
+  },
+  "dependencies": {},
+  "description": "Match balanced character pairs, like \"{\" and \"}\"",
+  "devDependencies": {
+    "matcha": "^0.7.0",
+    "tape": "^4.6.0"
+  },
+  "homepage": "https://github.com/juliangruber/balanced-match",
+  "keywords": [
+    "match",
+    "regexp",
+    "test",
+    "balanced",
+    "parse"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "balanced-match",
+  "optionalDependencies": {},
+  "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\nconsole.log(balanced(/\\s+\\{\\s+/, /\\s+\\}\\s+/, 'pre  {   in{nest}   }  post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n  end: 9,\n  pre: 'pre',\n  body: 'first',\n  post: 'between{second}post' }\n{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.\n\n### var r = balanced.range(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\narray with indexes: `[ <a index>, <b index> ]`.\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/balanced-match.git"
+  },
+  "scripts": {
+    "bench": "make bench",
+    "test": "make test"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/20..latest",
+      "firefox/nightly",
+      "chrome/25..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "1.0.0"
+}
diff --git a/legacy-libs/grpc/node_modules/brace-expansion/LICENSE b/legacy-libs/grpc/node_modules/brace-expansion/LICENSE
new file mode 100644 (file)
index 0000000..de32266
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/brace-expansion/README.md b/legacy-libs/grpc/node_modules/brace-expansion/README.md
new file mode 100644 (file)
index 0000000..6b4e0e1
--- /dev/null
@@ -0,0 +1,129 @@
+# brace-expansion
+
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), 
+as known from sh/bash, in JavaScript.
+
+[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
+[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
+[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)
+
+[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)
+
+## Example
+
+```js
+var expand = require('brace-expansion');
+
+expand('file-{a,b,c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('-v{,,}')
+// => ['-v', '-v', '-v']
+
+expand('file{0..2}.jpg')
+// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
+
+expand('file-{a..c}.jpg')
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
+
+expand('file{2..0}.jpg')
+// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
+
+expand('file{0..4..2}.jpg')
+// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
+
+expand('file-{a..e..2}.jpg')
+// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
+
+expand('file{00..10..5}.jpg')
+// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
+
+expand('{{A..C},{a..c}}')
+// => ['A', 'B', 'C', 'a', 'b', 'c']
+
+expand('ppp{,config,oe{,conf}}')
+// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
+```
+
+## API
+
+```js
+var expand = require('brace-expansion');
+```
+
+### var expanded = expand(str)
+
+Return an array of all possible and valid expansions of `str`. If none are
+found, `[str]` is returned.
+
+Valid expansions are:
+
+```js
+/^(.*,)+(.+)?$/
+// {a,b,...}
+```
+
+A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+A numeric sequence from `x` to `y` inclusive, with optional increment.
+If `x` or `y` start with a leading `0`, all the numbers will be padded
+to have equal length. Negative numbers and backwards iteration work too.
+
+```js
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
+// {x..y[..incr]}
+```
+
+An alphabetic sequence from `x` to `y` inclusive, with optional increment.
+`x` and `y` must be exactly one character, and if given, `incr` must be a
+number.
+
+For compatibility reasons, the string `${` is not eligible for brace expansion.
+
+## Installation
+
+With [npm](https://npmjs.org) do:
+
+```bash
+npm install brace-expansion
+```
+
+## Contributors
+
+- [Julian Gruber](https://github.com/juliangruber)
+- [Isaac Z. Schlueter](https://github.com/isaacs)
+
+## Sponsors
+
+This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
+
+Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/brace-expansion/index.js b/legacy-libs/grpc/node_modules/brace-expansion/index.js
new file mode 100644 (file)
index 0000000..0478be8
--- /dev/null
@@ -0,0 +1,201 @@
+var concatMap = require('concat-map');
+var balanced = require('balanced-match');
+
+module.exports = expandTop;
+
+var escSlash = '\0SLASH'+Math.random()+'\0';
+var escOpen = '\0OPEN'+Math.random()+'\0';
+var escClose = '\0CLOSE'+Math.random()+'\0';
+var escComma = '\0COMMA'+Math.random()+'\0';
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
+
+function numeric(str) {
+  return parseInt(str, 10) == str
+    ? parseInt(str, 10)
+    : str.charCodeAt(0);
+}
+
+function escapeBraces(str) {
+  return str.split('\\\\').join(escSlash)
+            .split('\\{').join(escOpen)
+            .split('\\}').join(escClose)
+            .split('\\,').join(escComma)
+            .split('\\.').join(escPeriod);
+}
+
+function unescapeBraces(str) {
+  return str.split(escSlash).join('\\')
+            .split(escOpen).join('{')
+            .split(escClose).join('}')
+            .split(escComma).join(',')
+            .split(escPeriod).join('.');
+}
+
+
+// Basically just str.split(","), but handling cases
+// where we have nested braced sections, which should be
+// treated as individual members, like {a,{b,c},d}
+function parseCommaParts(str) {
+  if (!str)
+    return [''];
+
+  var parts = [];
+  var m = balanced('{', '}', str);
+
+  if (!m)
+    return str.split(',');
+
+  var pre = m.pre;
+  var body = m.body;
+  var post = m.post;
+  var p = pre.split(',');
+
+  p[p.length-1] += '{' + body + '}';
+  var postParts = parseCommaParts(post);
+  if (post.length) {
+    p[p.length-1] += postParts.shift();
+    p.push.apply(p, postParts);
+  }
+
+  parts.push.apply(parts, p);
+
+  return parts;
+}
+
+function expandTop(str) {
+  if (!str)
+    return [];
+
+  // I don't know why Bash 4.3 does this, but it does.
+  // Anything starting with {} will have the first two bytes preserved
+  // but *only* at the top level, so {},a}b will not expand to anything,
+  // but a{},b}c will be expanded to [a}c,abc].
+  // One could argue that this is a bug in Bash, but since the goal of
+  // this module is to match Bash's rules, we escape a leading {}
+  if (str.substr(0, 2) === '{}') {
+    str = '\\{\\}' + str.substr(2);
+  }
+
+  return expand(escapeBraces(str), true).map(unescapeBraces);
+}
+
+function identity(e) {
+  return e;
+}
+
+function embrace(str) {
+  return '{' + str + '}';
+}
+function isPadded(el) {
+  return /^-?0\d/.test(el);
+}
+
+function lte(i, y) {
+  return i <= y;
+}
+function gte(i, y) {
+  return i >= y;
+}
+
+function expand(str, isTop) {
+  var expansions = [];
+
+  var m = balanced('{', '}', str);
+  if (!m || /\$$/.test(m.pre)) return [str];
+
+  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
+  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
+  var isSequence = isNumericSequence || isAlphaSequence;
+  var isOptions = m.body.indexOf(',') >= 0;
+  if (!isSequence && !isOptions) {
+    // {a},b}
+    if (m.post.match(/,.*\}/)) {
+      str = m.pre + '{' + m.body + escClose + m.post;
+      return expand(str);
+    }
+    return [str];
+  }
+
+  var n;
+  if (isSequence) {
+    n = m.body.split(/\.\./);
+  } else {
+    n = parseCommaParts(m.body);
+    if (n.length === 1) {
+      // x{{a,b}}y ==> x{a}y x{b}y
+      n = expand(n[0], false).map(embrace);
+      if (n.length === 1) {
+        var post = m.post.length
+          ? expand(m.post, false)
+          : [''];
+        return post.map(function(p) {
+          return m.pre + n[0] + p;
+        });
+      }
+    }
+  }
+
+  // at this point, n is the parts, and we know it's not a comma set
+  // with a single entry.
+
+  // no need to expand pre, since it is guaranteed to be free of brace-sets
+  var pre = m.pre;
+  var post = m.post.length
+    ? expand(m.post, false)
+    : [''];
+
+  var N;
+
+  if (isSequence) {
+    var x = numeric(n[0]);
+    var y = numeric(n[1]);
+    var width = Math.max(n[0].length, n[1].length)
+    var incr = n.length == 3
+      ? Math.abs(numeric(n[2]))
+      : 1;
+    var test = lte;
+    var reverse = y < x;
+    if (reverse) {
+      incr *= -1;
+      test = gte;
+    }
+    var pad = n.some(isPadded);
+
+    N = [];
+
+    for (var i = x; test(i, y); i += incr) {
+      var c;
+      if (isAlphaSequence) {
+        c = String.fromCharCode(i);
+        if (c === '\\')
+          c = '';
+      } else {
+        c = String(i);
+        if (pad) {
+          var need = width - c.length;
+          if (need > 0) {
+            var z = new Array(need + 1).join('0');
+            if (i < 0)
+              c = '-' + z + c.slice(1);
+            else
+              c = z + c;
+          }
+        }
+      }
+      N.push(c);
+    }
+  } else {
+    N = concatMap(n, function(el) { return expand(el, false) });
+  }
+
+  for (var j = 0; j < N.length; j++) {
+    for (var k = 0; k < post.length; k++) {
+      var expansion = pre + N[j] + post[k];
+      if (!isTop || isSequence || expansion)
+        expansions.push(expansion);
+    }
+  }
+
+  return expansions;
+}
+
diff --git a/legacy-libs/grpc/node_modules/brace-expansion/package.json b/legacy-libs/grpc/node_modules/brace-expansion/package.json
new file mode 100644 (file)
index 0000000..5256a00
--- /dev/null
@@ -0,0 +1,82 @@
+{
+  "_args": [
+    [
+      "brace-expansion@1.1.11",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "brace-expansion@1.1.11",
+  "_id": "brace-expansion@1.1.11",
+  "_inBundle": false,
+  "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+  "_location": "/grpc/brace-expansion",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "brace-expansion@1.1.11",
+    "name": "brace-expansion",
+    "escapedName": "brace-expansion",
+    "rawSpec": "1.1.11",
+    "saveSpec": null,
+    "fetchSpec": "1.1.11"
+  },
+  "_requiredBy": [
+    "/grpc/minimatch"
+  ],
+  "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.11",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/brace-expansion/issues"
+  },
+  "dependencies": {
+    "balanced-match": "^1.0.0",
+    "concat-map": "0.0.1"
+  },
+  "description": "Brace expansion as known from sh/bash",
+  "devDependencies": {
+    "matcha": "^0.7.0",
+    "tape": "^4.6.0"
+  },
+  "homepage": "https://github.com/juliangruber/brace-expansion",
+  "keywords": [],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "brace-expansion",
+  "optionalDependencies": {},
+  "readme": "# brace-expansion\n\n[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), \nas known from sh/bash, in JavaScript.\n\n[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)\n[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)\n[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)\n\n[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)\n\n## Example\n\n```js\nvar expand = require('brace-expansion');\n\nexpand('file-{a,b,c}.jpg')\n// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']\n\nexpand('-v{,,}')\n// => ['-v', '-v', '-v']\n\nexpand('file{0..2}.jpg')\n// => ['file0.jpg', 'file1.jpg', 'file2.jpg']\n\nexpand('file-{a..c}.jpg')\n// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']\n\nexpand('file{2..0}.jpg')\n// => ['file2.jpg', 'file1.jpg', 'file0.jpg']\n\nexpand('file{0..4..2}.jpg')\n// => ['file0.jpg', 'file2.jpg', 'file4.jpg']\n\nexpand('file-{a..e..2}.jpg')\n// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']\n\nexpand('file{00..10..5}.jpg')\n// => ['file00.jpg', 'file05.jpg', 'file10.jpg']\n\nexpand('{{A..C},{a..c}}')\n// => ['A', 'B', 'C', 'a', 'b', 'c']\n\nexpand('ppp{,config,oe{,conf}}')\n// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']\n```\n\n## API\n\n```js\nvar expand = require('brace-expansion');\n```\n\n### var expanded = expand(str)\n\nReturn an array of all possible and valid expansions of `str`. If none are\nfound, `[str]` is returned.\n\nValid expansions are:\n\n```js\n/^(.*,)+(.+)?$/\n// {a,b,...}\n```\n\nA comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.\n\n```js\n/^-?\\d+\\.\\.-?\\d+(\\.\\.-?\\d+)?$/\n// {x..y[..incr]}\n```\n\nA numeric sequence from `x` to `y` inclusive, with optional increment.\nIf `x` or `y` start with a leading `0`, all the numbers will be padded\nto have equal length. Negative numbers and backwards iteration work too.\n\n```js\n/^-?\\d+\\.\\.-?\\d+(\\.\\.-?\\d+)?$/\n// {x..y[..incr]}\n```\n\nAn alphabetic sequence from `x` to `y` inclusive, with optional increment.\n`x` and `y` must be exactly one character, and if given, `incr` must be a\nnumber.\n\nFor compatibility reasons, the string `${` is not eligible for brace expansion.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install brace-expansion\n```\n\n## Contributors\n\n- [Julian Gruber](https://github.com/juliangruber)\n- [Isaac Z. Schlueter](https://github.com/isaacs)\n\n## Sponsors\n\nThis module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!\n\nDo you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/brace-expansion.git"
+  },
+  "scripts": {
+    "bench": "matcha test/perf/bench.js",
+    "gentest": "bash test/generate.sh",
+    "test": "tape test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/20..latest",
+      "firefox/nightly",
+      "chrome/25..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "1.1.11"
+}
diff --git a/legacy-libs/grpc/node_modules/chownr/LICENSE b/legacy-libs/grpc/node_modules/chownr/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/chownr/README.md b/legacy-libs/grpc/node_modules/chownr/README.md
new file mode 100644 (file)
index 0000000..70e9a54
--- /dev/null
@@ -0,0 +1,3 @@
+Like `chown -R`.
+
+Takes the same arguments as `fs.chown()`
diff --git a/legacy-libs/grpc/node_modules/chownr/chownr.js b/legacy-libs/grpc/node_modules/chownr/chownr.js
new file mode 100644 (file)
index 0000000..7e63928
--- /dev/null
@@ -0,0 +1,88 @@
+'use strict'
+const fs = require('fs')
+const path = require('path')
+
+/* istanbul ignore next */
+const LCHOWN = fs.lchown ? 'lchown' : 'chown'
+/* istanbul ignore next */
+const LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'
+
+// fs.readdir could only accept an options object as of node v6
+const nodeVersion = process.version
+let readdir = (path, options, cb) => fs.readdir(path, options, cb)
+let readdirSync = (path, options) => fs.readdirSync(path, options)
+/* istanbul ignore next */
+if (/^v4\./.test(nodeVersion))
+  readdir = (path, options, cb) => fs.readdir(path, cb)
+
+const chownrKid = (p, child, uid, gid, cb) => {
+  if (typeof child === 'string')
+    return fs.lstat(path.resolve(p, child), (er, stats) => {
+      if (er)
+        return cb(er)
+      stats.name = child
+      chownrKid(p, stats, uid, gid, cb)
+    })
+
+  if (child.isDirectory()) {
+    chownr(path.resolve(p, child.name), uid, gid, er => {
+      if (er)
+        return cb(er)
+      fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb)
+    })
+  } else
+    fs[LCHOWN](path.resolve(p, child.name), uid, gid, cb)
+}
+
+
+const chownr = (p, uid, gid, cb) => {
+  readdir(p, { withFileTypes: true }, (er, children) => {
+    // any error other than ENOTDIR or ENOTSUP means it's not readable,
+    // or doesn't exist.  give up.
+    if (er && er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')
+      return cb(er)
+    if (er || !children.length) return fs[LCHOWN](p, uid, gid, cb)
+
+    let len = children.length
+    let errState = null
+    const then = er => {
+      if (errState) return
+      if (er) return cb(errState = er)
+      if (-- len === 0) return fs[LCHOWN](p, uid, gid, cb)
+    }
+
+    children.forEach(child => chownrKid(p, child, uid, gid, then))
+  })
+}
+
+const chownrKidSync = (p, child, uid, gid) => {
+  if (typeof child === 'string') {
+    const stats = fs.lstatSync(path.resolve(p, child))
+    stats.name = child
+    child = stats
+  }
+
+  if (child.isDirectory())
+    chownrSync(path.resolve(p, child.name), uid, gid)
+
+  fs[LCHOWNSYNC](path.resolve(p, child.name), uid, gid)
+}
+
+const chownrSync = (p, uid, gid) => {
+  let children
+  try {
+    children = readdirSync(p, { withFileTypes: true })
+  } catch (er) {
+    if (er && er.code === 'ENOTDIR' && er.code !== 'ENOTSUP')
+      return fs[LCHOWNSYNC](p, uid, gid)
+    throw er
+  }
+
+  if (children.length)
+    children.forEach(child => chownrKidSync(p, child, uid, gid))
+
+  return fs[LCHOWNSYNC](p, uid, gid)
+}
+
+module.exports = chownr
+chownr.sync = chownrSync
diff --git a/legacy-libs/grpc/node_modules/chownr/package.json b/legacy-libs/grpc/node_modules/chownr/package.json
new file mode 100644 (file)
index 0000000..c6bedef
--- /dev/null
@@ -0,0 +1,64 @@
+{
+  "_from": "chownr@^1.1.1",
+  "_id": "chownr@1.1.1",
+  "_inBundle": false,
+  "_integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
+  "_location": "/grpc/chownr",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "chownr@^1.1.1",
+    "name": "chownr",
+    "escapedName": "chownr",
+    "rawSpec": "^1.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^1.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz",
+  "_shasum": "54726b8b8fff4df053c42187e801fb4412df1494",
+  "_shrinkwrap": null,
+  "_spec": "chownr@^1.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/tar",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/chownr/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "like `chown -R`",
+  "devDependencies": {
+    "mkdirp": "0.3",
+    "rimraf": "",
+    "tap": "^12.0.1"
+  },
+  "files": [
+    "chownr.js"
+  ],
+  "homepage": "https://github.com/isaacs/chownr#readme",
+  "license": "ISC",
+  "main": "chownr.js",
+  "name": "chownr",
+  "optionalDependencies": {},
+  "readme": "Like `chown -R`.\n\nTakes the same arguments as `fs.chown()`\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/chownr.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --cov"
+  },
+  "version": "1.1.1"
+}
diff --git a/legacy-libs/grpc/node_modules/code-point-at/index.js b/legacy-libs/grpc/node_modules/code-point-at/index.js
new file mode 100644 (file)
index 0000000..0432fe6
--- /dev/null
@@ -0,0 +1,32 @@
+/* eslint-disable babel/new-cap, xo/throw-new-error */
+'use strict';
+module.exports = function (str, pos) {
+       if (str === null || str === undefined) {
+               throw TypeError();
+       }
+
+       str = String(str);
+
+       var size = str.length;
+       var i = pos ? Number(pos) : 0;
+
+       if (Number.isNaN(i)) {
+               i = 0;
+       }
+
+       if (i < 0 || i >= size) {
+               return undefined;
+       }
+
+       var first = str.charCodeAt(i);
+
+       if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) {
+               var second = str.charCodeAt(i + 1);
+
+               if (second >= 0xDC00 && second <= 0xDFFF) {
+                       return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000;
+               }
+       }
+
+       return first;
+};
diff --git a/legacy-libs/grpc/node_modules/code-point-at/license b/legacy-libs/grpc/node_modules/code-point-at/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/code-point-at/package.json b/legacy-libs/grpc/node_modules/code-point-at/package.json
new file mode 100644 (file)
index 0000000..0d7150f
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_args": [
+    [
+      "code-point-at@1.1.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "code-point-at@1.1.0",
+  "_id": "code-point-at@1.1.0",
+  "_inBundle": false,
+  "_integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
+  "_location": "/grpc/code-point-at",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "code-point-at@1.1.0",
+    "name": "code-point-at",
+    "escapedName": "code-point-at",
+    "rawSpec": "1.1.0",
+    "saveSpec": null,
+    "fetchSpec": "1.1.0"
+  },
+  "_requiredBy": [
+    "/grpc/string-width"
+  ],
+  "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/code-point-at/issues"
+  },
+  "dependencies": {},
+  "description": "ES2015 `String#codePointAt()` ponyfill",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "^0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/code-point-at#readme",
+  "keywords": [
+    "es2015",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "string",
+    "str",
+    "code",
+    "point",
+    "at",
+    "codepoint",
+    "unicode"
+  ],
+  "license": "MIT",
+  "name": "code-point-at",
+  "optionalDependencies": {},
+  "readme": "# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at)\n\n> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) [ponyfill](https://ponyfill.com)\n\n\n## Install\n\n```\n$ npm install --save code-point-at\n```\n\n\n## Usage\n\n```js\nvar codePointAt = require('code-point-at');\n\ncodePointAt('🐴');\n//=> 128052\n\ncodePointAt('abc', 2);\n//=> 99\n```\n\n## API\n\n### codePointAt(input, [position])\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/code-point-at.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc/node_modules/code-point-at/readme.md b/legacy-libs/grpc/node_modules/code-point-at/readme.md
new file mode 100644 (file)
index 0000000..4c97730
--- /dev/null
@@ -0,0 +1,32 @@
+# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at)
+
+> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) [ponyfill](https://ponyfill.com)
+
+
+## Install
+
+```
+$ npm install --save code-point-at
+```
+
+
+## Usage
+
+```js
+var codePointAt = require('code-point-at');
+
+codePointAt('🐴');
+//=> 128052
+
+codePointAt('abc', 2);
+//=> 99
+```
+
+## API
+
+### codePointAt(input, [position])
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/concat-map/LICENSE b/legacy-libs/grpc/node_modules/concat-map/LICENSE
new file mode 100644 (file)
index 0000000..ee27ba4
--- /dev/null
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/concat-map/README.markdown b/legacy-libs/grpc/node_modules/concat-map/README.markdown
new file mode 100644 (file)
index 0000000..408f70a
--- /dev/null
@@ -0,0 +1,62 @@
+concat-map
+==========
+
+Concatenative mapdashery.
+
+[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)
+
+[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)
+
+example
+=======
+
+``` js
+var concatMap = require('concat-map');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
+```
+
+***
+
+```
+[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
+```
+
+methods
+=======
+
+``` js
+var concatMap = require('concat-map')
+```
+
+concatMap(xs, fn)
+-----------------
+
+Return an array of concatenated elements by calling `fn(x, i)` for each element
+`x` and each index `i` in the array `xs`.
+
+When `fn(x, i)` returns an array, its result will be concatenated with the
+result array. If `fn(x, i)` returns anything else, that value will be pushed
+onto the end of the result array.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install concat-map
+```
+
+license
+=======
+
+MIT
+
+notes
+=====
+
+This module was written while sitting high above the ground in a tree.
diff --git a/legacy-libs/grpc/node_modules/concat-map/example/map.js b/legacy-libs/grpc/node_modules/concat-map/example/map.js
new file mode 100644 (file)
index 0000000..3365621
--- /dev/null
@@ -0,0 +1,6 @@
+var concatMap = require('../');
+var xs = [ 1, 2, 3, 4, 5, 6 ];
+var ys = concatMap(xs, function (x) {
+    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+});
+console.dir(ys);
diff --git a/legacy-libs/grpc/node_modules/concat-map/index.js b/legacy-libs/grpc/node_modules/concat-map/index.js
new file mode 100644 (file)
index 0000000..b29a781
--- /dev/null
@@ -0,0 +1,13 @@
+module.exports = function (xs, fn) {
+    var res = [];
+    for (var i = 0; i < xs.length; i++) {
+        var x = fn(xs[i], i);
+        if (isArray(x)) res.push.apply(res, x);
+        else res.push(x);
+    }
+    return res;
+};
+
+var isArray = Array.isArray || function (xs) {
+    return Object.prototype.toString.call(xs) === '[object Array]';
+};
diff --git a/legacy-libs/grpc/node_modules/concat-map/package.json b/legacy-libs/grpc/node_modules/concat-map/package.json
new file mode 100644 (file)
index 0000000..5601b9f
--- /dev/null
@@ -0,0 +1,96 @@
+{
+  "_args": [
+    [
+      "concat-map@0.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "concat-map@0.0.1",
+  "_id": "concat-map@0.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+  "_location": "/grpc/concat-map",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "concat-map@0.0.1",
+    "name": "concat-map",
+    "escapedName": "concat-map",
+    "rawSpec": "0.0.1",
+    "saveSpec": null,
+    "fetchSpec": "0.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/brace-expansion"
+  ],
+  "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "0.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-concat-map/issues"
+  },
+  "dependencies": {},
+  "description": "concatenative mapdashery",
+  "devDependencies": {
+    "tape": "~2.4.0"
+  },
+  "directories": {
+    "example": "example",
+    "test": "test"
+  },
+  "homepage": "https://github.com/substack/node-concat-map#readme",
+  "keywords": [
+    "concat",
+    "concatMap",
+    "map",
+    "functional",
+    "higher-order"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "concat-map",
+  "optionalDependencies": {},
+  "readme": "concat-map\n==========\n\nConcatenative mapdashery.\n\n[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)\n\n[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)\n\nexample\n=======\n\n``` js\nvar concatMap = require('concat-map');\nvar xs = [ 1, 2, 3, 4, 5, 6 ];\nvar ys = concatMap(xs, function (x) {\n    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];\n});\nconsole.dir(ys);\n```\n\n***\n\n```\n[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]\n```\n\nmethods\n=======\n\n``` js\nvar concatMap = require('concat-map')\n```\n\nconcatMap(xs, fn)\n-----------------\n\nReturn an array of concatenated elements by calling `fn(x, i)` for each element\n`x` and each index `i` in the array `xs`.\n\nWhen `fn(x, i)` returns an array, its result will be concatenated with the\nresult array. If `fn(x, i)` returns anything else, that value will be pushed\nonto the end of the result array.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install concat-map\n```\n\nlicense\n=======\n\nMIT\n\nnotes\n=====\n\nThis module was written while sitting high above the ground in a tree.\n",
+  "readmeFilename": "README.markdown",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/node-concat-map.git"
+  },
+  "scripts": {
+    "test": "tape test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": {
+      "ie": [
+        6,
+        7,
+        8,
+        9
+      ],
+      "ff": [
+        3.5,
+        10,
+        15
+      ],
+      "chrome": [
+        10,
+        22
+      ],
+      "safari": [
+        5.1
+      ],
+      "opera": [
+        12
+      ]
+    }
+  },
+  "version": "0.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/concat-map/test/map.js b/legacy-libs/grpc/node_modules/concat-map/test/map.js
new file mode 100644 (file)
index 0000000..fdbd702
--- /dev/null
@@ -0,0 +1,39 @@
+var concatMap = require('../');
+var test = require('tape');
+
+test('empty or not', function (t) {
+    var xs = [ 1, 2, 3, 4, 5, 6 ];
+    var ixes = [];
+    var ys = concatMap(xs, function (x, ix) {
+        ixes.push(ix);
+        return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
+    });
+    t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
+    t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
+    t.end();
+});
+
+test('always something', function (t) {
+    var xs = [ 'a', 'b', 'c', 'd' ];
+    var ys = concatMap(xs, function (x) {
+        return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
+    });
+    t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
+    t.end();
+});
+
+test('scalars', function (t) {
+    var xs = [ 'a', 'b', 'c', 'd' ];
+    var ys = concatMap(xs, function (x) {
+        return x === 'b' ? [ 'B', 'B', 'B' ] : x;
+    });
+    t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
+    t.end();
+});
+
+test('undefs', function (t) {
+    var xs = [ 'a', 'b', 'c', 'd' ];
+    var ys = concatMap(xs, function () {});
+    t.same(ys, [ undefined, undefined, undefined, undefined ]);
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/console-control-strings/LICENSE b/legacy-libs/grpc/node_modules/console-control-strings/LICENSE
new file mode 100644 (file)
index 0000000..e756052
--- /dev/null
@@ -0,0 +1,13 @@
+Copyright (c) 2014, Rebecca Turner <me@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/console-control-strings/README.md b/legacy-libs/grpc/node_modules/console-control-strings/README.md
new file mode 100644 (file)
index 0000000..f58cc8d
--- /dev/null
@@ -0,0 +1,145 @@
+# Console Control Strings
+
+A library of cross-platform tested terminal/console command strings for
+doing things like color and cursor positioning.  This is a subset of both
+ansi and vt100.  All control codes included work on both Windows & Unix-like
+OSes, except where noted.
+
+## Usage
+
+```js
+var consoleControl = require('console-control-strings')
+
+console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
+process.stdout.write(consoleControl.goto(75, 10))
+```
+
+## Why Another?
+
+There are tons of libraries similar to this one.  I wanted one that was:
+
+1. Very clear about compatibility goals.
+2. Could emit, for instance, a start color code without an end one.
+3. Returned strings w/o writing to streams.
+4. Was not weighed down with other unrelated baggage.
+
+## Functions
+
+### var code = consoleControl.up(_num = 1_)
+
+Returns the escape sequence to move _num_ lines up.
+
+### var code = consoleControl.down(_num = 1_)
+
+Returns the escape sequence to move _num_ lines down.
+
+### var code = consoleControl.forward(_num = 1_)
+
+Returns the escape sequence to move _num_ lines righ.
+
+### var code = consoleControl.back(_num = 1_)
+
+Returns the escape sequence to move _num_ lines left.
+
+### var code = consoleControl.nextLine(_num = 1_)
+
+Returns the escape sequence to move _num_ lines down and to the beginning of
+the line.
+
+### var code = consoleControl.previousLine(_num = 1_)
+
+Returns the escape sequence to move _num_ lines up and to the beginning of
+the line.
+
+### var code = consoleControl.eraseData()
+
+Returns the escape sequence to erase everything from the current cursor
+position to the bottom right of the screen.  This is line based, so it
+erases the remainder of the current line and all following lines.
+
+### var code = consoleControl.eraseLine()
+
+Returns the escape sequence to erase to the end of the current line.
+
+### var code = consoleControl.goto(_x_, _y_)
+
+Returns the escape sequence to move the cursor to the designated position. 
+Note that the origin is _1, 1_ not _0, 0_.
+
+### var code = consoleControl.gotoSOL()
+
+Returns the escape sequence to move the cursor to the beginning of the
+current line. (That is, it returns a carriage return, `\r`.)
+
+### var code = consoleControl.beep()
+
+Returns the escape sequence to cause the termianl to beep.  (That is, it
+returns unicode character `\x0007`, a Control-G.)
+
+### var code = consoleControl.hideCursor()
+
+Returns the escape sequence to hide the cursor.
+
+### var code = consoleControl.showCursor()
+
+Returns the escape sequence to show the cursor.
+
+### var code = consoleControl.color(_colors = []_)
+
+### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
+
+Returns the escape sequence to set the current terminal display attributes
+(mostly colors).  Arguments can either be a list of attributes or an array
+of attributes.  The difference between passing in an array or list of colors
+and calling `.color` separately for each one, is that in the former case a
+single escape sequence will be produced where as in the latter each change
+will have its own distinct escape sequence.  Each attribute can be one of:
+
+* Reset:
+  * **reset** – Reset all attributes to the terminal default.
+* Styles:
+  * **bold** – Display text as bold.  In some terminals this means using a
+    bold font, in others this means changing the color.  In some it means
+    both.
+  * **italic** – Display text as italic. This is not available in most Windows terminals.
+  * **underline** – Underline text. This is not available in most Windows Terminals.
+  * **inverse** – Invert the foreground and background colors.
+  * **stopBold** – Do not display text as bold.
+  * **stopItalic** – Do not display text as italic.
+  * **stopUnderline** – Do not underline text.
+  * **stopInverse** – Do not invert foreground and background.
+* Colors:
+  * **white**
+  * **black**
+  * **blue**
+  * **cyan**
+  * **green**
+  * **magenta**
+  * **red**
+  * **yellow**
+  * **grey** / **brightBlack**
+  * **brightRed**
+  * **brightGreen**
+  * **brightYellow**
+  * **brightBlue**
+  * **brightMagenta**
+  * **brightCyan**
+  * **brightWhite**
+* Background Colors:
+  * **bgWhite**
+  * **bgBlack**
+  * **bgBlue**
+  * **bgCyan**
+  * **bgGreen**
+  * **bgMagenta**
+  * **bgRed**
+  * **bgYellow**
+  * **bgGrey** / **bgBrightBlack**
+  * **bgBrightRed**
+  * **bgBrightGreen**
+  * **bgBrightYellow**
+  * **bgBrightBlue**
+  * **bgBrightMagenta**
+  * **bgBrightCyan**
+  * **bgBrightWhite**
+
diff --git a/legacy-libs/grpc/node_modules/console-control-strings/README.md~ b/legacy-libs/grpc/node_modules/console-control-strings/README.md~
new file mode 100644 (file)
index 0000000..6eb34e8
--- /dev/null
@@ -0,0 +1,140 @@
+# Console Control Strings
+
+A library of cross-platform tested terminal/console command strings for
+doing things like color and cursor positioning.  This is a subset of both
+ansi and vt100.  All control codes included work on both Windows & Unix-like
+OSes, except where noted.
+
+## Usage
+
+```js
+var consoleControl = require('console-control-strings')
+
+console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
+process.stdout.write(consoleControl.goto(75, 10))
+```
+
+## Why Another?
+
+There are tons of libraries similar to this one.  I wanted one that was:
+
+1. Very clear about compatibility goals.
+2. Could emit, for instance, a start color code without an end one.
+3. Returned strings w/o writing to streams.
+4. Was not weighed down with other unrelated baggage.
+
+## Functions
+
+### var code = consoleControl.up(_num = 1_)
+
+Returns the escape sequence to move _num_ lines up.
+
+### var code = consoleControl.down(_num = 1_)
+
+Returns the escape sequence to move _num_ lines down.
+
+### var code = consoleControl.forward(_num = 1_)
+
+Returns the escape sequence to move _num_ lines righ.
+
+### var code = consoleControl.back(_num = 1_)
+
+Returns the escape sequence to move _num_ lines left.
+
+### var code = consoleControl.nextLine(_num = 1_)
+
+Returns the escape sequence to move _num_ lines down and to the beginning of
+the line.
+
+### var code = consoleControl.previousLine(_num = 1_)
+
+Returns the escape sequence to move _num_ lines up and to the beginning of
+the line.
+
+### var code = consoleControl.eraseData()
+
+Returns the escape sequence to erase everything from the current cursor
+position to the bottom right of the screen.  This is line based, so it
+erases the remainder of the current line and all following lines.
+
+### var code = consoleControl.eraseLine()
+
+Returns the escape sequence to erase to the end of the current line.
+
+### var code = consoleControl.goto(_x_, _y_)
+
+Returns the escape sequence to move the cursor to the designated position. 
+Note that the origin is _1, 1_ not _0, 0_.
+
+### var code = consoleControl.gotoSOL()
+
+Returns the escape sequence to move the cursor to the beginning of the
+current line. (That is, it returns a carriage return, `\r`.)
+
+### var code = consoleControl.hideCursor()
+
+Returns the escape sequence to hide the cursor.
+
+### var code = consoleControl.showCursor()
+
+Returns the escape sequence to show the cursor.
+
+### var code = consoleControl.color(_colors = []_)
+
+### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
+
+Returns the escape sequence to set the current terminal display attributes
+(mostly colors).  Arguments can either be a list of attributes or an array
+of attributes.  The difference between passing in an array or list of colors
+and calling `.color` separately for each one, is that in the former case a
+single escape sequence will be produced where as in the latter each change
+will have its own distinct escape sequence.  Each attribute can be one of:
+
+* Reset:
+  * **reset** – Reset all attributes to the terminal default.
+* Styles:
+  * **bold** – Display text as bold.  In some terminals this means using a
+    bold font, in others this means changing the color.  In some it means
+    both.
+  * **italic** – Display text as italic. This is not available in most Windows terminals.
+  * **underline** – Underline text. This is not available in most Windows Terminals.
+  * **inverse** – Invert the foreground and background colors.
+  * **stopBold** – Do not display text as bold.
+  * **stopItalic** – Do not display text as italic.
+  * **stopUnderline** – Do not underline text.
+  * **stopInverse** – Do not invert foreground and background.
+* Colors:
+  * **white**
+  * **black**
+  * **blue**
+  * **cyan**
+  * **green**
+  * **magenta**
+  * **red**
+  * **yellow**
+  * **grey** / **brightBlack**
+  * **brightRed**
+  * **brightGreen**
+  * **brightYellow**
+  * **brightBlue**
+  * **brightMagenta**
+  * **brightCyan**
+  * **brightWhite**
+* Background Colors:
+  * **bgWhite**
+  * **bgBlack**
+  * **bgBlue**
+  * **bgCyan**
+  * **bgGreen**
+  * **bgMagenta**
+  * **bgRed**
+  * **bgYellow**
+  * **bgGrey** / **bgBrightBlack**
+  * **bgBrightRed**
+  * **bgBrightGreen**
+  * **bgBrightYellow**
+  * **bgBrightBlue**
+  * **bgBrightMagenta**
+  * **bgBrightCyan**
+  * **bgBrightWhite**
+
diff --git a/legacy-libs/grpc/node_modules/console-control-strings/index.js b/legacy-libs/grpc/node_modules/console-control-strings/index.js
new file mode 100644 (file)
index 0000000..bf89034
--- /dev/null
@@ -0,0 +1,125 @@
+'use strict'
+
+// These tables borrowed from `ansi`
+
+var prefix = '\x1b['
+
+exports.up = function up (num) {
+  return prefix + (num || '') + 'A'
+}
+
+exports.down = function down (num) {
+  return prefix + (num || '') + 'B'
+}
+
+exports.forward = function forward (num) {
+  return prefix + (num || '') + 'C'
+}
+
+exports.back = function back (num) {
+  return prefix + (num || '') + 'D'
+}
+
+exports.nextLine = function nextLine (num) {
+  return prefix + (num || '') + 'E'
+}
+
+exports.previousLine = function previousLine (num) {
+  return prefix + (num || '') + 'F'
+}
+
+exports.horizontalAbsolute = function horizontalAbsolute (num) {
+  if (num == null) throw new Error('horizontalAboslute requires a column to position to')
+  return prefix + num + 'G'
+}
+
+exports.eraseData = function eraseData () {
+  return prefix + 'J'
+}
+
+exports.eraseLine = function eraseLine () {
+  return prefix + 'K'
+}
+
+exports.goto = function (x, y) {
+  return prefix + y + ';' + x + 'H'
+}
+
+exports.gotoSOL = function () {
+  return '\r'
+}
+
+exports.beep = function () {
+  return '\x07'
+}
+
+exports.hideCursor = function hideCursor () {
+  return prefix + '?25l'
+}
+
+exports.showCursor = function showCursor () {
+  return prefix + '?25h'
+}
+
+var colors = {
+  reset: 0,
+// styles
+  bold: 1,
+  italic: 3,
+  underline: 4,
+  inverse: 7,
+// resets
+  stopBold: 22,
+  stopItalic: 23,
+  stopUnderline: 24,
+  stopInverse: 27,
+// colors
+  white: 37,
+  black: 30,
+  blue: 34,
+  cyan: 36,
+  green: 32,
+  magenta: 35,
+  red: 31,
+  yellow: 33,
+  bgWhite: 47,
+  bgBlack: 40,
+  bgBlue: 44,
+  bgCyan: 46,
+  bgGreen: 42,
+  bgMagenta: 45,
+  bgRed: 41,
+  bgYellow: 43,
+
+  grey: 90,
+  brightBlack: 90,
+  brightRed: 91,
+  brightGreen: 92,
+  brightYellow: 93,
+  brightBlue: 94,
+  brightMagenta: 95,
+  brightCyan: 96,
+  brightWhite: 97,
+
+  bgGrey: 100,
+  bgBrightBlack: 100,
+  bgBrightRed: 101,
+  bgBrightGreen: 102,
+  bgBrightYellow: 103,
+  bgBrightBlue: 104,
+  bgBrightMagenta: 105,
+  bgBrightCyan: 106,
+  bgBrightWhite: 107
+}
+
+exports.color = function color (colorWith) {
+  if (arguments.length !== 1 || !Array.isArray(colorWith)) {
+    colorWith = Array.prototype.slice.call(arguments)
+  }
+  return prefix + colorWith.map(colorNameToCode).join(';') + 'm'
+}
+
+function colorNameToCode (color) {
+  if (colors[color] != null) return colors[color]
+  throw new Error('Unknown color or style name: ' + color)
+}
diff --git a/legacy-libs/grpc/node_modules/console-control-strings/package.json b/legacy-libs/grpc/node_modules/console-control-strings/package.json
new file mode 100644 (file)
index 0000000..85dd604
--- /dev/null
@@ -0,0 +1,69 @@
+{
+  "_args": [
+    [
+      "console-control-strings@1.1.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "console-control-strings@1.1.0",
+  "_id": "console-control-strings@1.1.0",
+  "_inBundle": false,
+  "_integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
+  "_location": "/grpc/console-control-strings",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "console-control-strings@1.1.0",
+    "name": "console-control-strings",
+    "escapedName": "console-control-strings",
+    "rawSpec": "1.1.0",
+    "saveSpec": null,
+    "fetchSpec": "1.1.0"
+  },
+  "_requiredBy": [
+    "/grpc/gauge",
+    "/grpc/npmlog"
+  ],
+  "_resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Rebecca Turner",
+    "email": "me@re-becca.org",
+    "url": "http://re-becca.org/"
+  },
+  "bugs": {
+    "url": "https://github.com/iarna/console-control-strings/issues"
+  },
+  "dependencies": {},
+  "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning.  This is a subset of both ansi and vt100.  All control codes included work on both Windows & Unix-like OSes, except where noted.",
+  "devDependencies": {
+    "standard": "^7.1.2",
+    "tap": "^5.7.2"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "LICENSE",
+    "index.js"
+  ],
+  "homepage": "https://github.com/iarna/console-control-strings#readme",
+  "keywords": [],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "console-control-strings",
+  "optionalDependencies": {},
+  "readme": "# Console Control Strings\n\nA library of cross-platform tested terminal/console command strings for\ndoing things like color and cursor positioning.  This is a subset of both\nansi and vt100.  All control codes included work on both Windows & Unix-like\nOSes, except where noted.\n\n## Usage\n\n```js\nvar consoleControl = require('console-control-strings')\n\nconsole.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))\nprocess.stdout.write(consoleControl.goto(75, 10))\n```\n\n## Why Another?\n\nThere are tons of libraries similar to this one.  I wanted one that was:\n\n1. Very clear about compatibility goals.\n2. Could emit, for instance, a start color code without an end one.\n3. Returned strings w/o writing to streams.\n4. Was not weighed down with other unrelated baggage.\n\n## Functions\n\n### var code = consoleControl.up(_num = 1_)\n\nReturns the escape sequence to move _num_ lines up.\n\n### var code = consoleControl.down(_num = 1_)\n\nReturns the escape sequence to move _num_ lines down.\n\n### var code = consoleControl.forward(_num = 1_)\n\nReturns the escape sequence to move _num_ lines righ.\n\n### var code = consoleControl.back(_num = 1_)\n\nReturns the escape sequence to move _num_ lines left.\n\n### var code = consoleControl.nextLine(_num = 1_)\n\nReturns the escape sequence to move _num_ lines down and to the beginning of\nthe line.\n\n### var code = consoleControl.previousLine(_num = 1_)\n\nReturns the escape sequence to move _num_ lines up and to the beginning of\nthe line.\n\n### var code = consoleControl.eraseData()\n\nReturns the escape sequence to erase everything from the current cursor\nposition to the bottom right of the screen.  This is line based, so it\nerases the remainder of the current line and all following lines.\n\n### var code = consoleControl.eraseLine()\n\nReturns the escape sequence to erase to the end of the current line.\n\n### var code = consoleControl.goto(_x_, _y_)\n\nReturns the escape sequence to move the cursor to the designated position. \nNote that the origin is _1, 1_ not _0, 0_.\n\n### var code = consoleControl.gotoSOL()\n\nReturns the escape sequence to move the cursor to the beginning of the\ncurrent line. (That is, it returns a carriage return, `\\r`.)\n\n### var code = consoleControl.beep()\n\nReturns the escape sequence to cause the termianl to beep.  (That is, it\nreturns unicode character `\\x0007`, a Control-G.)\n\n### var code = consoleControl.hideCursor()\n\nReturns the escape sequence to hide the cursor.\n\n### var code = consoleControl.showCursor()\n\nReturns the escape sequence to show the cursor.\n\n### var code = consoleControl.color(_colors = []_)\n\n### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)\n\nReturns the escape sequence to set the current terminal display attributes\n(mostly colors).  Arguments can either be a list of attributes or an array\nof attributes.  The difference between passing in an array or list of colors\nand calling `.color` separately for each one, is that in the former case a\nsingle escape sequence will be produced where as in the latter each change\nwill have its own distinct escape sequence.  Each attribute can be one of:\n\n* Reset:\n  * **reset** – Reset all attributes to the terminal default.\n* Styles:\n  * **bold** – Display text as bold.  In some terminals this means using a\n    bold font, in others this means changing the color.  In some it means\n    both.\n  * **italic** – Display text as italic. This is not available in most Windows terminals.\n  * **underline** – Underline text. This is not available in most Windows Terminals.\n  * **inverse** – Invert the foreground and background colors.\n  * **stopBold** – Do not display text as bold.\n  * **stopItalic** – Do not display text as italic.\n  * **stopUnderline** – Do not underline text.\n  * **stopInverse** – Do not invert foreground and background.\n* Colors:\n  * **white**\n  * **black**\n  * **blue**\n  * **cyan**\n  * **green**\n  * **magenta**\n  * **red**\n  * **yellow**\n  * **grey** / **brightBlack**\n  * **brightRed**\n  * **brightGreen**\n  * **brightYellow**\n  * **brightBlue**\n  * **brightMagenta**\n  * **brightCyan**\n  * **brightWhite**\n* Background Colors:\n  * **bgWhite**\n  * **bgBlack**\n  * **bgBlue**\n  * **bgCyan**\n  * **bgGreen**\n  * **bgMagenta**\n  * **bgRed**\n  * **bgYellow**\n  * **bgGrey** / **bgBrightBlack**\n  * **bgBrightRed**\n  * **bgBrightGreen**\n  * **bgBrightYellow**\n  * **bgBrightBlue**\n  * **bgBrightMagenta**\n  * **bgBrightCyan**\n  * **bgBrightWhite**\n\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iarna/console-control-strings.git"
+  },
+  "scripts": {
+    "test": "standard && tap test/*.js"
+  },
+  "version": "1.1.0"
+}
diff --git a/legacy-libs/grpc/node_modules/core-util-is/LICENSE b/legacy-libs/grpc/node_modules/core-util-is/LICENSE
new file mode 100644 (file)
index 0000000..d8d7f94
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/core-util-is/README.md b/legacy-libs/grpc/node_modules/core-util-is/README.md
new file mode 100644 (file)
index 0000000..5a76b41
--- /dev/null
@@ -0,0 +1,3 @@
+# core-util-is
+
+The `util.is*` functions introduced in Node v0.12.
diff --git a/legacy-libs/grpc/node_modules/core-util-is/float.patch b/legacy-libs/grpc/node_modules/core-util-is/float.patch
new file mode 100644 (file)
index 0000000..a06d5c0
--- /dev/null
@@ -0,0 +1,604 @@
+diff --git a/lib/util.js b/lib/util.js
+index a03e874..9074e8e 100644
+--- a/lib/util.js
++++ b/lib/util.js
+@@ -19,430 +19,6 @@
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+-var formatRegExp = /%[sdj%]/g;
+-exports.format = function(f) {
+-  if (!isString(f)) {
+-    var objects = [];
+-    for (var i = 0; i < arguments.length; i++) {
+-      objects.push(inspect(arguments[i]));
+-    }
+-    return objects.join(' ');
+-  }
+-
+-  var i = 1;
+-  var args = arguments;
+-  var len = args.length;
+-  var str = String(f).replace(formatRegExp, function(x) {
+-    if (x === '%%') return '%';
+-    if (i >= len) return x;
+-    switch (x) {
+-      case '%s': return String(args[i++]);
+-      case '%d': return Number(args[i++]);
+-      case '%j':
+-        try {
+-          return JSON.stringify(args[i++]);
+-        } catch (_) {
+-          return '[Circular]';
+-        }
+-      default:
+-        return x;
+-    }
+-  });
+-  for (var x = args[i]; i < len; x = args[++i]) {
+-    if (isNull(x) || !isObject(x)) {
+-      str += ' ' + x;
+-    } else {
+-      str += ' ' + inspect(x);
+-    }
+-  }
+-  return str;
+-};
+-
+-
+-// Mark that a method should not be used.
+-// Returns a modified function which warns once by default.
+-// If --no-deprecation is set, then it is a no-op.
+-exports.deprecate = function(fn, msg) {
+-  // Allow for deprecating things in the process of starting up.
+-  if (isUndefined(global.process)) {
+-    return function() {
+-      return exports.deprecate(fn, msg).apply(this, arguments);
+-    };
+-  }
+-
+-  if (process.noDeprecation === true) {
+-    return fn;
+-  }
+-
+-  var warned = false;
+-  function deprecated() {
+-    if (!warned) {
+-      if (process.throwDeprecation) {
+-        throw new Error(msg);
+-      } else if (process.traceDeprecation) {
+-        console.trace(msg);
+-      } else {
+-        console.error(msg);
+-      }
+-      warned = true;
+-    }
+-    return fn.apply(this, arguments);
+-  }
+-
+-  return deprecated;
+-};
+-
+-
+-var debugs = {};
+-var debugEnviron;
+-exports.debuglog = function(set) {
+-  if (isUndefined(debugEnviron))
+-    debugEnviron = process.env.NODE_DEBUG || '';
+-  set = set.toUpperCase();
+-  if (!debugs[set]) {
+-    if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
+-      var pid = process.pid;
+-      debugs[set] = function() {
+-        var msg = exports.format.apply(exports, arguments);
+-        console.error('%s %d: %s', set, pid, msg);
+-      };
+-    } else {
+-      debugs[set] = function() {};
+-    }
+-  }
+-  return debugs[set];
+-};
+-
+-
+-/**
+- * Echos the value of a value. Trys to print the value out
+- * in the best way possible given the different types.
+- *
+- * @param {Object} obj The object to print out.
+- * @param {Object} opts Optional options object that alters the output.
+- */
+-/* legacy: obj, showHidden, depth, colors*/
+-function inspect(obj, opts) {
+-  // default options
+-  var ctx = {
+-    seen: [],
+-    stylize: stylizeNoColor
+-  };
+-  // legacy...
+-  if (arguments.length >= 3) ctx.depth = arguments[2];
+-  if (arguments.length >= 4) ctx.colors = arguments[3];
+-  if (isBoolean(opts)) {
+-    // legacy...
+-    ctx.showHidden = opts;
+-  } else if (opts) {
+-    // got an "options" object
+-    exports._extend(ctx, opts);
+-  }
+-  // set default options
+-  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
+-  if (isUndefined(ctx.depth)) ctx.depth = 2;
+-  if (isUndefined(ctx.colors)) ctx.colors = false;
+-  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
+-  if (ctx.colors) ctx.stylize = stylizeWithColor;
+-  return formatValue(ctx, obj, ctx.depth);
+-}
+-exports.inspect = inspect;
+-
+-
+-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+-inspect.colors = {
+-  'bold' : [1, 22],
+-  'italic' : [3, 23],
+-  'underline' : [4, 24],
+-  'inverse' : [7, 27],
+-  'white' : [37, 39],
+-  'grey' : [90, 39],
+-  'black' : [30, 39],
+-  'blue' : [34, 39],
+-  'cyan' : [36, 39],
+-  'green' : [32, 39],
+-  'magenta' : [35, 39],
+-  'red' : [31, 39],
+-  'yellow' : [33, 39]
+-};
+-
+-// Don't use 'blue' not visible on cmd.exe
+-inspect.styles = {
+-  'special': 'cyan',
+-  'number': 'yellow',
+-  'boolean': 'yellow',
+-  'undefined': 'grey',
+-  'null': 'bold',
+-  'string': 'green',
+-  'date': 'magenta',
+-  // "name": intentionally not styling
+-  'regexp': 'red'
+-};
+-
+-
+-function stylizeWithColor(str, styleType) {
+-  var style = inspect.styles[styleType];
+-
+-  if (style) {
+-    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
+-           '\u001b[' + inspect.colors[style][1] + 'm';
+-  } else {
+-    return str;
+-  }
+-}
+-
+-
+-function stylizeNoColor(str, styleType) {
+-  return str;
+-}
+-
+-
+-function arrayToHash(array) {
+-  var hash = {};
+-
+-  array.forEach(function(val, idx) {
+-    hash[val] = true;
+-  });
+-
+-  return hash;
+-}
+-
+-
+-function formatValue(ctx, value, recurseTimes) {
+-  // Provide a hook for user-specified inspect functions.
+-  // Check that value is an object with an inspect function on it
+-  if (ctx.customInspect &&
+-      value &&
+-      isFunction(value.inspect) &&
+-      // Filter out the util module, it's inspect function is special
+-      value.inspect !== exports.inspect &&
+-      // Also filter out any prototype objects using the circular check.
+-      !(value.constructor && value.constructor.prototype === value)) {
+-    var ret = value.inspect(recurseTimes, ctx);
+-    if (!isString(ret)) {
+-      ret = formatValue(ctx, ret, recurseTimes);
+-    }
+-    return ret;
+-  }
+-
+-  // Primitive types cannot have properties
+-  var primitive = formatPrimitive(ctx, value);
+-  if (primitive) {
+-    return primitive;
+-  }
+-
+-  // Look up the keys of the object.
+-  var keys = Object.keys(value);
+-  var visibleKeys = arrayToHash(keys);
+-
+-  if (ctx.showHidden) {
+-    keys = Object.getOwnPropertyNames(value);
+-  }
+-
+-  // Some type of object without properties can be shortcutted.
+-  if (keys.length === 0) {
+-    if (isFunction(value)) {
+-      var name = value.name ? ': ' + value.name : '';
+-      return ctx.stylize('[Function' + name + ']', 'special');
+-    }
+-    if (isRegExp(value)) {
+-      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+-    }
+-    if (isDate(value)) {
+-      return ctx.stylize(Date.prototype.toString.call(value), 'date');
+-    }
+-    if (isError(value)) {
+-      return formatError(value);
+-    }
+-  }
+-
+-  var base = '', array = false, braces = ['{', '}'];
+-
+-  // Make Array say that they are Array
+-  if (isArray(value)) {
+-    array = true;
+-    braces = ['[', ']'];
+-  }
+-
+-  // Make functions say that they are functions
+-  if (isFunction(value)) {
+-    var n = value.name ? ': ' + value.name : '';
+-    base = ' [Function' + n + ']';
+-  }
+-
+-  // Make RegExps say that they are RegExps
+-  if (isRegExp(value)) {
+-    base = ' ' + RegExp.prototype.toString.call(value);
+-  }
+-
+-  // Make dates with properties first say the date
+-  if (isDate(value)) {
+-    base = ' ' + Date.prototype.toUTCString.call(value);
+-  }
+-
+-  // Make error with message first say the error
+-  if (isError(value)) {
+-    base = ' ' + formatError(value);
+-  }
+-
+-  if (keys.length === 0 && (!array || value.length == 0)) {
+-    return braces[0] + base + braces[1];
+-  }
+-
+-  if (recurseTimes < 0) {
+-    if (isRegExp(value)) {
+-      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+-    } else {
+-      return ctx.stylize('[Object]', 'special');
+-    }
+-  }
+-
+-  ctx.seen.push(value);
+-
+-  var output;
+-  if (array) {
+-    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
+-  } else {
+-    output = keys.map(function(key) {
+-      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
+-    });
+-  }
+-
+-  ctx.seen.pop();
+-
+-  return reduceToSingleString(output, base, braces);
+-}
+-
+-
+-function formatPrimitive(ctx, value) {
+-  if (isUndefined(value))
+-    return ctx.stylize('undefined', 'undefined');
+-  if (isString(value)) {
+-    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
+-                                             .replace(/'/g, "\\'")
+-                                             .replace(/\\"/g, '"') + '\'';
+-    return ctx.stylize(simple, 'string');
+-  }
+-  if (isNumber(value)) {
+-    // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
+-    // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
+-    if (value === 0 && 1 / value < 0)
+-      return ctx.stylize('-0', 'number');
+-    return ctx.stylize('' + value, 'number');
+-  }
+-  if (isBoolean(value))
+-    return ctx.stylize('' + value, 'boolean');
+-  // For some reason typeof null is "object", so special case here.
+-  if (isNull(value))
+-    return ctx.stylize('null', 'null');
+-}
+-
+-
+-function formatError(value) {
+-  return '[' + Error.prototype.toString.call(value) + ']';
+-}
+-
+-
+-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
+-  var output = [];
+-  for (var i = 0, l = value.length; i < l; ++i) {
+-    if (hasOwnProperty(value, String(i))) {
+-      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+-          String(i), true));
+-    } else {
+-      output.push('');
+-    }
+-  }
+-  keys.forEach(function(key) {
+-    if (!key.match(/^\d+$/)) {
+-      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+-          key, true));
+-    }
+-  });
+-  return output;
+-}
+-
+-
+-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
+-  var name, str, desc;
+-  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
+-  if (desc.get) {
+-    if (desc.set) {
+-      str = ctx.stylize('[Getter/Setter]', 'special');
+-    } else {
+-      str = ctx.stylize('[Getter]', 'special');
+-    }
+-  } else {
+-    if (desc.set) {
+-      str = ctx.stylize('[Setter]', 'special');
+-    }
+-  }
+-  if (!hasOwnProperty(visibleKeys, key)) {
+-    name = '[' + key + ']';
+-  }
+-  if (!str) {
+-    if (ctx.seen.indexOf(desc.value) < 0) {
+-      if (isNull(recurseTimes)) {
+-        str = formatValue(ctx, desc.value, null);
+-      } else {
+-        str = formatValue(ctx, desc.value, recurseTimes - 1);
+-      }
+-      if (str.indexOf('\n') > -1) {
+-        if (array) {
+-          str = str.split('\n').map(function(line) {
+-            return '  ' + line;
+-          }).join('\n').substr(2);
+-        } else {
+-          str = '\n' + str.split('\n').map(function(line) {
+-            return '   ' + line;
+-          }).join('\n');
+-        }
+-      }
+-    } else {
+-      str = ctx.stylize('[Circular]', 'special');
+-    }
+-  }
+-  if (isUndefined(name)) {
+-    if (array && key.match(/^\d+$/)) {
+-      return str;
+-    }
+-    name = JSON.stringify('' + key);
+-    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
+-      name = name.substr(1, name.length - 2);
+-      name = ctx.stylize(name, 'name');
+-    } else {
+-      name = name.replace(/'/g, "\\'")
+-                 .replace(/\\"/g, '"')
+-                 .replace(/(^"|"$)/g, "'");
+-      name = ctx.stylize(name, 'string');
+-    }
+-  }
+-
+-  return name + ': ' + str;
+-}
+-
+-
+-function reduceToSingleString(output, base, braces) {
+-  var numLinesEst = 0;
+-  var length = output.reduce(function(prev, cur) {
+-    numLinesEst++;
+-    if (cur.indexOf('\n') >= 0) numLinesEst++;
+-    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
+-  }, 0);
+-
+-  if (length > 60) {
+-    return braces[0] +
+-           (base === '' ? '' : base + '\n ') +
+-           ' ' +
+-           output.join(',\n  ') +
+-           ' ' +
+-           braces[1];
+-  }
+-
+-  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
+-}
+-
+-
+ // NOTE: These type checking functions intentionally don't use `instanceof`
+ // because it is fragile and can be easily faked with `Object.create()`.
+ function isArray(ar) {
+@@ -522,166 +98,10 @@ function isPrimitive(arg) {
+ exports.isPrimitive = isPrimitive;
+
+ function isBuffer(arg) {
+-  return arg instanceof Buffer;
++  return Buffer.isBuffer(arg);
+ }
+ exports.isBuffer = isBuffer;
+
+ function objectToString(o) {
+   return Object.prototype.toString.call(o);
+-}
+-
+-
+-function pad(n) {
+-  return n < 10 ? '0' + n.toString(10) : n.toString(10);
+-}
+-
+-
+-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+-              'Oct', 'Nov', 'Dec'];
+-
+-// 26 Feb 16:19:34
+-function timestamp() {
+-  var d = new Date();
+-  var time = [pad(d.getHours()),
+-              pad(d.getMinutes()),
+-              pad(d.getSeconds())].join(':');
+-  return [d.getDate(), months[d.getMonth()], time].join(' ');
+-}
+-
+-
+-// log is just a thin wrapper to console.log that prepends a timestamp
+-exports.log = function() {
+-  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
+-};
+-
+-
+-/**
+- * Inherit the prototype methods from one constructor into another.
+- *
+- * The Function.prototype.inherits from lang.js rewritten as a standalone
+- * function (not on Function.prototype). NOTE: If this file is to be loaded
+- * during bootstrapping this function needs to be rewritten using some native
+- * functions as prototype setup using normal JavaScript does not work as
+- * expected during bootstrapping (see mirror.js in r114903).
+- *
+- * @param {function} ctor Constructor function which needs to inherit the
+- *     prototype.
+- * @param {function} superCtor Constructor function to inherit prototype from.
+- */
+-exports.inherits = function(ctor, superCtor) {
+-  ctor.super_ = superCtor;
+-  ctor.prototype = Object.create(superCtor.prototype, {
+-    constructor: {
+-      value: ctor,
+-      enumerable: false,
+-      writable: true,
+-      configurable: true
+-    }
+-  });
+-};
+-
+-exports._extend = function(origin, add) {
+-  // Don't do anything if add isn't an object
+-  if (!add || !isObject(add)) return origin;
+-
+-  var keys = Object.keys(add);
+-  var i = keys.length;
+-  while (i--) {
+-    origin[keys[i]] = add[keys[i]];
+-  }
+-  return origin;
+-};
+-
+-function hasOwnProperty(obj, prop) {
+-  return Object.prototype.hasOwnProperty.call(obj, prop);
+-}
+-
+-
+-// Deprecated old stuff.
+-
+-exports.p = exports.deprecate(function() {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    console.error(exports.inspect(arguments[i]));
+-  }
+-}, 'util.p: Use console.error() instead');
+-
+-
+-exports.exec = exports.deprecate(function() {
+-  return require('child_process').exec.apply(this, arguments);
+-}, 'util.exec is now called `child_process.exec`.');
+-
+-
+-exports.print = exports.deprecate(function() {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    process.stdout.write(String(arguments[i]));
+-  }
+-}, 'util.print: Use console.log instead');
+-
+-
+-exports.puts = exports.deprecate(function() {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    process.stdout.write(arguments[i] + '\n');
+-  }
+-}, 'util.puts: Use console.log instead');
+-
+-
+-exports.debug = exports.deprecate(function(x) {
+-  process.stderr.write('DEBUG: ' + x + '\n');
+-}, 'util.debug: Use console.error instead');
+-
+-
+-exports.error = exports.deprecate(function(x) {
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
+-    process.stderr.write(arguments[i] + '\n');
+-  }
+-}, 'util.error: Use console.error instead');
+-
+-
+-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
+-  var callbackCalled = false;
+-
+-  function call(a, b, c) {
+-    if (callback && !callbackCalled) {
+-      callback(a, b, c);
+-      callbackCalled = true;
+-    }
+-  }
+-
+-  readStream.addListener('data', function(chunk) {
+-    if (writeStream.write(chunk) === false) readStream.pause();
+-  });
+-
+-  writeStream.addListener('drain', function() {
+-    readStream.resume();
+-  });
+-
+-  readStream.addListener('end', function() {
+-    writeStream.end();
+-  });
+-
+-  readStream.addListener('close', function() {
+-    call();
+-  });
+-
+-  readStream.addListener('error', function(err) {
+-    writeStream.end();
+-    call(err);
+-  });
+-
+-  writeStream.addListener('error', function(err) {
+-    readStream.destroy();
+-    call(err);
+-  });
+-}, 'util.pump(): Use readableStream.pipe() instead');
+-
+-
+-var uv;
+-exports._errnoException = function(err, syscall) {
+-  if (isUndefined(uv)) uv = process.binding('uv');
+-  var errname = uv.errname(err);
+-  var e = new Error(syscall + ' ' + errname);
+-  e.code = errname;
+-  e.errno = errname;
+-  e.syscall = syscall;
+-  return e;
+-};
++}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/core-util-is/lib/util.js b/legacy-libs/grpc/node_modules/core-util-is/lib/util.js
new file mode 100644 (file)
index 0000000..ff4c851
--- /dev/null
@@ -0,0 +1,107 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// NOTE: These type checking functions intentionally don't use `instanceof`
+// because it is fragile and can be easily faked with `Object.create()`.
+
+function isArray(arg) {
+  if (Array.isArray) {
+    return Array.isArray(arg);
+  }
+  return objectToString(arg) === '[object Array]';
+}
+exports.isArray = isArray;
+
+function isBoolean(arg) {
+  return typeof arg === 'boolean';
+}
+exports.isBoolean = isBoolean;
+
+function isNull(arg) {
+  return arg === null;
+}
+exports.isNull = isNull;
+
+function isNullOrUndefined(arg) {
+  return arg == null;
+}
+exports.isNullOrUndefined = isNullOrUndefined;
+
+function isNumber(arg) {
+  return typeof arg === 'number';
+}
+exports.isNumber = isNumber;
+
+function isString(arg) {
+  return typeof arg === 'string';
+}
+exports.isString = isString;
+
+function isSymbol(arg) {
+  return typeof arg === 'symbol';
+}
+exports.isSymbol = isSymbol;
+
+function isUndefined(arg) {
+  return arg === void 0;
+}
+exports.isUndefined = isUndefined;
+
+function isRegExp(re) {
+  return objectToString(re) === '[object RegExp]';
+}
+exports.isRegExp = isRegExp;
+
+function isObject(arg) {
+  return typeof arg === 'object' && arg !== null;
+}
+exports.isObject = isObject;
+
+function isDate(d) {
+  return objectToString(d) === '[object Date]';
+}
+exports.isDate = isDate;
+
+function isError(e) {
+  return (objectToString(e) === '[object Error]' || e instanceof Error);
+}
+exports.isError = isError;
+
+function isFunction(arg) {
+  return typeof arg === 'function';
+}
+exports.isFunction = isFunction;
+
+function isPrimitive(arg) {
+  return arg === null ||
+         typeof arg === 'boolean' ||
+         typeof arg === 'number' ||
+         typeof arg === 'string' ||
+         typeof arg === 'symbol' ||  // ES6 symbol
+         typeof arg === 'undefined';
+}
+exports.isPrimitive = isPrimitive;
+
+exports.isBuffer = Buffer.isBuffer;
+
+function objectToString(o) {
+  return Object.prototype.toString.call(o);
+}
diff --git a/legacy-libs/grpc/node_modules/core-util-is/package.json b/legacy-libs/grpc/node_modules/core-util-is/package.json
new file mode 100644 (file)
index 0000000..321b588
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_args": [
+    [
+      "core-util-is@1.0.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "core-util-is@1.0.2",
+  "_id": "core-util-is@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
+  "_location": "/grpc/core-util-is",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "core-util-is@1.0.2",
+    "name": "core-util-is",
+    "escapedName": "core-util-is",
+    "rawSpec": "1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "1.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/core-util-is/issues"
+  },
+  "dependencies": {},
+  "description": "The `util.is*` functions introduced in Node v0.12.",
+  "devDependencies": {
+    "tap": "^2.3.0"
+  },
+  "homepage": "https://github.com/isaacs/core-util-is#readme",
+  "keywords": [
+    "util",
+    "isBuffer",
+    "isArray",
+    "isNumber",
+    "isString",
+    "isRegExp",
+    "isThis",
+    "isThat",
+    "polyfill"
+  ],
+  "license": "MIT",
+  "main": "lib/util.js",
+  "name": "core-util-is",
+  "optionalDependencies": {},
+  "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/core-util-is.git"
+  },
+  "scripts": {
+    "test": "tap test.js"
+  },
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc/node_modules/core-util-is/test.js b/legacy-libs/grpc/node_modules/core-util-is/test.js
new file mode 100644 (file)
index 0000000..1a490c6
--- /dev/null
@@ -0,0 +1,68 @@
+var assert = require('tap');
+
+var t = require('./lib/util');
+
+assert.equal(t.isArray([]), true);
+assert.equal(t.isArray({}), false);
+
+assert.equal(t.isBoolean(null), false);
+assert.equal(t.isBoolean(true), true);
+assert.equal(t.isBoolean(false), true);
+
+assert.equal(t.isNull(null), true);
+assert.equal(t.isNull(undefined), false);
+assert.equal(t.isNull(false), false);
+assert.equal(t.isNull(), false);
+
+assert.equal(t.isNullOrUndefined(null), true);
+assert.equal(t.isNullOrUndefined(undefined), true);
+assert.equal(t.isNullOrUndefined(false), false);
+assert.equal(t.isNullOrUndefined(), true);
+
+assert.equal(t.isNumber(null), false);
+assert.equal(t.isNumber('1'), false);
+assert.equal(t.isNumber(1), true);
+
+assert.equal(t.isString(null), false);
+assert.equal(t.isString('1'), true);
+assert.equal(t.isString(1), false);
+
+assert.equal(t.isSymbol(null), false);
+assert.equal(t.isSymbol('1'), false);
+assert.equal(t.isSymbol(1), false);
+assert.equal(t.isSymbol(Symbol()), true);
+
+assert.equal(t.isUndefined(null), false);
+assert.equal(t.isUndefined(undefined), true);
+assert.equal(t.isUndefined(false), false);
+assert.equal(t.isUndefined(), true);
+
+assert.equal(t.isRegExp(null), false);
+assert.equal(t.isRegExp('1'), false);
+assert.equal(t.isRegExp(new RegExp()), true);
+
+assert.equal(t.isObject({}), true);
+assert.equal(t.isObject([]), true);
+assert.equal(t.isObject(new RegExp()), true);
+assert.equal(t.isObject(new Date()), true);
+
+assert.equal(t.isDate(null), false);
+assert.equal(t.isDate('1'), false);
+assert.equal(t.isDate(new Date()), true);
+
+assert.equal(t.isError(null), false);
+assert.equal(t.isError({ err: true }), false);
+assert.equal(t.isError(new Error()), true);
+
+assert.equal(t.isFunction(null), false);
+assert.equal(t.isFunction({ }), false);
+assert.equal(t.isFunction(function() {}), true);
+
+assert.equal(t.isPrimitive(null), true);
+assert.equal(t.isPrimitive(''), true);
+assert.equal(t.isPrimitive(0), true);
+assert.equal(t.isPrimitive(new Date()), false);
+
+assert.equal(t.isBuffer(null), false);
+assert.equal(t.isBuffer({}), false);
+assert.equal(t.isBuffer(new Buffer(0)), true);
diff --git a/legacy-libs/grpc/node_modules/deep-extend/CHANGELOG.md b/legacy-libs/grpc/node_modules/deep-extend/CHANGELOG.md
new file mode 100644 (file)
index 0000000..dd13ec1
--- /dev/null
@@ -0,0 +1,46 @@
+Changelog
+=========
+
+v0.6.0
+------
+
+- Updated "devDependencies" versions to fix vulnerability alerts
+- Dropped support of io.js and node.js v0.12.x and lower since new versions of
+  "devDependencies" couldn't work with those old node.js versions
+  (minimal supported version of node.js now is v4.0.0)
+
+v0.5.1
+------
+
+- Fix prototype pollution vulnerability (thanks to @mwakerman for the PR)
+- Avoid using deprecated Buffer API (thanks to @ChALkeR for the PR)
+
+v0.5.0
+------
+
+- Auto-testing provided by Travis CI;
+- Support older Node.JS versions (`v0.11.x` and `v0.10.x`);
+- Removed tests files from npm package.
+
+v0.4.2
+------
+
+- Fix for `null` as an argument.
+
+v0.4.1
+------
+
+- Removed test code from <b>npm</b> package
+  ([see pull request #21](https://github.com/unclechu/node-deep-extend/pull/21));
+- Increased minimal version of Node from `0.4.0` to `0.12.0`
+  (because can't run tests on lesser version anyway).
+
+v0.4.0
+------
+
+- **WARNING!** Broken backward compatibility with `v0.3.x`;
+- Fixed bug with extending arrays instead of cloning;
+- Deep cloning for arrays;
+- Check for own property;
+- Fixed some documentation issues;
+- Strict JS mode.
diff --git a/legacy-libs/grpc/node_modules/deep-extend/LICENSE b/legacy-libs/grpc/node_modules/deep-extend/LICENSE
new file mode 100644 (file)
index 0000000..5c58916
--- /dev/null
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013-2018, Viacheslav Lotsmanov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/deep-extend/README.md b/legacy-libs/grpc/node_modules/deep-extend/README.md
new file mode 100644 (file)
index 0000000..67c7fc0
--- /dev/null
@@ -0,0 +1,91 @@
+Deep Extend
+===========
+
+Recursive object extending.
+
+[![Build Status](https://api.travis-ci.org/unclechu/node-deep-extend.svg?branch=master)](https://travis-ci.org/unclechu/node-deep-extend)
+
+[![NPM](https://nodei.co/npm/deep-extend.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/deep-extend/)
+
+Install
+-------
+
+```bash
+$ npm install deep-extend
+```
+
+Usage
+-----
+
+```javascript
+var deepExtend = require('deep-extend');
+var obj1 = {
+  a: 1,
+  b: 2,
+  d: {
+    a: 1,
+    b: [],
+    c: { test1: 123, test2: 321 }
+  },
+  f: 5,
+  g: 123,
+  i: 321,
+  j: [1, 2]
+};
+var obj2 = {
+  b: 3,
+  c: 5,
+  d: {
+    b: { first: 'one', second: 'two' },
+    c: { test2: 222 }
+  },
+  e: { one: 1, two: 2 },
+  f: [],
+  g: (void 0),
+  h: /abc/g,
+  i: null,
+  j: [3, 4]
+};
+
+deepExtend(obj1, obj2);
+
+console.log(obj1);
+/*
+{ a: 1,
+  b: 3,
+  d:
+   { a: 1,
+     b: { first: 'one', second: 'two' },
+     c: { test1: 123, test2: 222 } },
+  f: [],
+  g: undefined,
+  c: 5,
+  e: { one: 1, two: 2 },
+  h: /abc/g,
+  i: null,
+  j: [3, 4] }
+*/
+```
+
+Unit testing
+------------
+
+```bash
+$ npm test
+```
+
+Changelog
+---------
+
+[CHANGELOG.md](./CHANGELOG.md)
+
+Any issues?
+-----------
+
+Please, report about issues
+[here](https://github.com/unclechu/node-deep-extend/issues).
+
+License
+-------
+
+[MIT](./LICENSE)
diff --git a/legacy-libs/grpc/node_modules/deep-extend/index.js b/legacy-libs/grpc/node_modules/deep-extend/index.js
new file mode 100644 (file)
index 0000000..762d81e
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./lib/deep-extend');
diff --git a/legacy-libs/grpc/node_modules/deep-extend/lib/deep-extend.js b/legacy-libs/grpc/node_modules/deep-extend/lib/deep-extend.js
new file mode 100644 (file)
index 0000000..651fd8d
--- /dev/null
@@ -0,0 +1,150 @@
+/*!
+ * @description Recursive object extending
+ * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
+ * @license MIT
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2013-2018 Viacheslav Lotsmanov
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+'use strict';
+
+function isSpecificValue(val) {
+       return (
+               val instanceof Buffer
+               || val instanceof Date
+               || val instanceof RegExp
+       ) ? true : false;
+}
+
+function cloneSpecificValue(val) {
+       if (val instanceof Buffer) {
+               var x = Buffer.alloc
+                       ? Buffer.alloc(val.length)
+                       : new Buffer(val.length);
+               val.copy(x);
+               return x;
+       } else if (val instanceof Date) {
+               return new Date(val.getTime());
+       } else if (val instanceof RegExp) {
+               return new RegExp(val);
+       } else {
+               throw new Error('Unexpected situation');
+       }
+}
+
+/**
+ * Recursive cloning array.
+ */
+function deepCloneArray(arr) {
+       var clone = [];
+       arr.forEach(function (item, index) {
+               if (typeof item === 'object' && item !== null) {
+                       if (Array.isArray(item)) {
+                               clone[index] = deepCloneArray(item);
+                       } else if (isSpecificValue(item)) {
+                               clone[index] = cloneSpecificValue(item);
+                       } else {
+                               clone[index] = deepExtend({}, item);
+                       }
+               } else {
+                       clone[index] = item;
+               }
+       });
+       return clone;
+}
+
+function safeGetProperty(object, property) {
+       return property === '__proto__' ? undefined : object[property];
+}
+
+/**
+ * Extening object that entered in first argument.
+ *
+ * Returns extended object or false if have no target object or incorrect type.
+ *
+ * If you wish to clone source object (without modify it), just use empty new
+ * object as first argument, like this:
+ *   deepExtend({}, yourObj_1, [yourObj_N]);
+ */
+var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) {
+       if (arguments.length < 1 || typeof arguments[0] !== 'object') {
+               return false;
+       }
+
+       if (arguments.length < 2) {
+               return arguments[0];
+       }
+
+       var target = arguments[0];
+
+       // convert arguments to array and cut off target object
+       var args = Array.prototype.slice.call(arguments, 1);
+
+       var val, src, clone;
+
+       args.forEach(function (obj) {
+               // skip argument if isn't an object, is null, or is an array
+               if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {
+                       return;
+               }
+
+               Object.keys(obj).forEach(function (key) {
+                       src = safeGetProperty(target, key); // source value
+                       val = safeGetProperty(obj, key); // new value
+
+                       // recursion prevention
+                       if (val === target) {
+                               return;
+
+                       /**
+                        * if new value isn't object then just overwrite by new value
+                        * instead of extending.
+                        */
+                       } else if (typeof val !== 'object' || val === null) {
+                               target[key] = val;
+                               return;
+
+                       // just clone arrays (and recursive clone objects inside)
+                       } else if (Array.isArray(val)) {
+                               target[key] = deepCloneArray(val);
+                               return;
+
+                       // custom cloning and overwrite for specific objects
+                       } else if (isSpecificValue(val)) {
+                               target[key] = cloneSpecificValue(val);
+                               return;
+
+                       // overwrite by new value if source isn't object or array
+                       } else if (typeof src !== 'object' || src === null || Array.isArray(src)) {
+                               target[key] = deepExtend({}, val);
+                               return;
+
+                       // source value and new value is objects both, extending...
+                       } else {
+                               target[key] = deepExtend(src, val);
+                               return;
+                       }
+               });
+       });
+
+       return target;
+};
diff --git a/legacy-libs/grpc/node_modules/deep-extend/package.json b/legacy-libs/grpc/node_modules/deep-extend/package.json
new file mode 100644 (file)
index 0000000..9e7afc0
--- /dev/null
@@ -0,0 +1,100 @@
+{
+  "_args": [
+    [
+      "deep-extend@0.6.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "deep-extend@0.6.0",
+  "_id": "deep-extend@0.6.0",
+  "_inBundle": false,
+  "_integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
+  "_location": "/grpc/deep-extend",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "deep-extend@0.6.0",
+    "name": "deep-extend",
+    "escapedName": "deep-extend",
+    "rawSpec": "0.6.0",
+    "saveSpec": null,
+    "fetchSpec": "0.6.0"
+  },
+  "_requiredBy": [
+    "/grpc/rc"
+  ],
+  "_resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "0.6.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Viacheslav Lotsmanov",
+    "email": "lotsmanov89@gmail.com"
+  },
+  "bugs": {
+    "url": "https://github.com/unclechu/node-deep-extend/issues"
+  },
+  "contributors": [
+    {
+      "name": "Romain Prieto",
+      "url": "https://github.com/rprieto"
+    },
+    {
+      "name": "Max Maximov",
+      "url": "https://github.com/maxmaximov"
+    },
+    {
+      "name": "Marshall Bowers",
+      "url": "https://github.com/maxdeviant"
+    },
+    {
+      "name": "Misha Wakerman",
+      "url": "https://github.com/mwakerman"
+    }
+  ],
+  "dependencies": {},
+  "description": "Recursive object extending",
+  "devDependencies": {
+    "mocha": "5.2.0",
+    "should": "13.2.1"
+  },
+  "engines": {
+    "node": ">=4.0.0"
+  },
+  "files": [
+    "index.js",
+    "lib/"
+  ],
+  "homepage": "https://github.com/unclechu/node-deep-extend",
+  "keywords": [
+    "deep-extend",
+    "extend",
+    "deep",
+    "recursive",
+    "xtend",
+    "clone",
+    "merge",
+    "json"
+  ],
+  "license": "MIT",
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.githubusercontent.com/unclechu/node-deep-extend/master/LICENSE"
+    }
+  ],
+  "main": "lib/deep-extend.js",
+  "name": "deep-extend",
+  "optionalDependencies": {},
+  "readme": "Deep Extend\n===========\n\nRecursive object extending.\n\n[![Build Status](https://api.travis-ci.org/unclechu/node-deep-extend.svg?branch=master)](https://travis-ci.org/unclechu/node-deep-extend)\n\n[![NPM](https://nodei.co/npm/deep-extend.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/deep-extend/)\n\nInstall\n-------\n\n```bash\n$ npm install deep-extend\n```\n\nUsage\n-----\n\n```javascript\nvar deepExtend = require('deep-extend');\nvar obj1 = {\n  a: 1,\n  b: 2,\n  d: {\n    a: 1,\n    b: [],\n    c: { test1: 123, test2: 321 }\n  },\n  f: 5,\n  g: 123,\n  i: 321,\n  j: [1, 2]\n};\nvar obj2 = {\n  b: 3,\n  c: 5,\n  d: {\n    b: { first: 'one', second: 'two' },\n    c: { test2: 222 }\n  },\n  e: { one: 1, two: 2 },\n  f: [],\n  g: (void 0),\n  h: /abc/g,\n  i: null,\n  j: [3, 4]\n};\n\ndeepExtend(obj1, obj2);\n\nconsole.log(obj1);\n/*\n{ a: 1,\n  b: 3,\n  d:\n   { a: 1,\n     b: { first: 'one', second: 'two' },\n     c: { test1: 123, test2: 222 } },\n  f: [],\n  g: undefined,\n  c: 5,\n  e: { one: 1, two: 2 },\n  h: /abc/g,\n  i: null,\n  j: [3, 4] }\n*/\n```\n\nUnit testing\n------------\n\n```bash\n$ npm test\n```\n\nChangelog\n---------\n\n[CHANGELOG.md](./CHANGELOG.md)\n\nAny issues?\n-----------\n\nPlease, report about issues\n[here](https://github.com/unclechu/node-deep-extend/issues).\n\nLicense\n-------\n\n[MIT](./LICENSE)\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/unclechu/node-deep-extend.git"
+  },
+  "scripts": {
+    "test": "mocha"
+  },
+  "version": "0.6.0"
+}
diff --git a/legacy-libs/grpc/node_modules/delegates/History.md b/legacy-libs/grpc/node_modules/delegates/History.md
new file mode 100644 (file)
index 0000000..25959ea
--- /dev/null
@@ -0,0 +1,22 @@
+
+1.0.0 / 2015-12-14
+==================
+
+  * Merge pull request #12 from kasicka/master
+  * Add license text
+
+0.1.0 / 2014-10-17
+==================
+
+ * adds `.fluent()` to api
+
+0.0.3 / 2014-01-13
+==================
+
+ * fix receiver for .method()
+
+0.0.2 / 2014-01-13
+==================
+
+ * Object.defineProperty() sucks
+ * Initial commit
diff --git a/legacy-libs/grpc/node_modules/delegates/License b/legacy-libs/grpc/node_modules/delegates/License
new file mode 100644 (file)
index 0000000..60de60a
--- /dev/null
@@ -0,0 +1,20 @@
+Copyright (c) 2015 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/delegates/Makefile b/legacy-libs/grpc/node_modules/delegates/Makefile
new file mode 100644 (file)
index 0000000..a9dcfd5
--- /dev/null
@@ -0,0 +1,8 @@
+
+test:
+       @./node_modules/.bin/mocha \
+               --require should \
+               --reporter spec \
+               --bail
+
+.PHONY: test
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/delegates/Readme.md b/legacy-libs/grpc/node_modules/delegates/Readme.md
new file mode 100644 (file)
index 0000000..ab8cf4a
--- /dev/null
@@ -0,0 +1,94 @@
+
+# delegates
+
+  Node method and accessor delegation utilty.
+
+## Installation
+
+```
+$ npm install delegates
+```
+
+## Example
+
+```js
+var delegate = require('delegates');
+
+...
+
+delegate(proto, 'request')
+  .method('acceptsLanguages')
+  .method('acceptsEncodings')
+  .method('acceptsCharsets')
+  .method('accepts')
+  .method('is')
+  .access('querystring')
+  .access('idempotent')
+  .access('socket')
+  .access('length')
+  .access('query')
+  .access('search')
+  .access('status')
+  .access('method')
+  .access('path')
+  .access('body')
+  .access('host')
+  .access('url')
+  .getter('subdomains')
+  .getter('protocol')
+  .getter('header')
+  .getter('stale')
+  .getter('fresh')
+  .getter('secure')
+  .getter('ips')
+  .getter('ip')
+```
+
+# API
+
+## Delegate(proto, prop)
+
+Creates a delegator instance used to configure using the `prop` on the given
+`proto` object. (which is usually a prototype)
+
+## Delegate#method(name)
+
+Allows the given method `name` to be accessed on the host.
+
+## Delegate#getter(name)
+
+Creates a "getter" for the property with the given `name` on the delegated
+object.
+
+## Delegate#setter(name)
+
+Creates a "setter" for the property with the given `name` on the delegated
+object.
+
+## Delegate#access(name)
+
+Creates an "accessor" (ie: both getter *and* setter) for the property with the
+given `name` on the delegated object.
+
+## Delegate#fluent(name)
+
+A unique type of "accessor" that works for a "fluent" API. When called as a
+getter, the method returns the expected value. However, if the method is called
+with a value, it will return itself so it can be chained. For example:
+
+```js
+delegate(proto, 'request')
+  .fluent('query')
+
+// getter
+var q = request.query();
+
+// setter (chainable)
+request
+  .query({ a: 1 })
+  .query({ b: 2 });
+```
+
+# License
+
+  MIT
diff --git a/legacy-libs/grpc/node_modules/delegates/index.js b/legacy-libs/grpc/node_modules/delegates/index.js
new file mode 100644 (file)
index 0000000..17c222d
--- /dev/null
@@ -0,0 +1,121 @@
+
+/**
+ * Expose `Delegator`.
+ */
+
+module.exports = Delegator;
+
+/**
+ * Initialize a delegator.
+ *
+ * @param {Object} proto
+ * @param {String} target
+ * @api public
+ */
+
+function Delegator(proto, target) {
+  if (!(this instanceof Delegator)) return new Delegator(proto, target);
+  this.proto = proto;
+  this.target = target;
+  this.methods = [];
+  this.getters = [];
+  this.setters = [];
+  this.fluents = [];
+}
+
+/**
+ * Delegate method `name`.
+ *
+ * @param {String} name
+ * @return {Delegator} self
+ * @api public
+ */
+
+Delegator.prototype.method = function(name){
+  var proto = this.proto;
+  var target = this.target;
+  this.methods.push(name);
+
+  proto[name] = function(){
+    return this[target][name].apply(this[target], arguments);
+  };
+
+  return this;
+};
+
+/**
+ * Delegator accessor `name`.
+ *
+ * @param {String} name
+ * @return {Delegator} self
+ * @api public
+ */
+
+Delegator.prototype.access = function(name){
+  return this.getter(name).setter(name);
+};
+
+/**
+ * Delegator getter `name`.
+ *
+ * @param {String} name
+ * @return {Delegator} self
+ * @api public
+ */
+
+Delegator.prototype.getter = function(name){
+  var proto = this.proto;
+  var target = this.target;
+  this.getters.push(name);
+
+  proto.__defineGetter__(name, function(){
+    return this[target][name];
+  });
+
+  return this;
+};
+
+/**
+ * Delegator setter `name`.
+ *
+ * @param {String} name
+ * @return {Delegator} self
+ * @api public
+ */
+
+Delegator.prototype.setter = function(name){
+  var proto = this.proto;
+  var target = this.target;
+  this.setters.push(name);
+
+  proto.__defineSetter__(name, function(val){
+    return this[target][name] = val;
+  });
+
+  return this;
+};
+
+/**
+ * Delegator fluent accessor
+ *
+ * @param {String} name
+ * @return {Delegator} self
+ * @api public
+ */
+
+Delegator.prototype.fluent = function (name) {
+  var proto = this.proto;
+  var target = this.target;
+  this.fluents.push(name);
+
+  proto[name] = function(val){
+    if ('undefined' != typeof val) {
+      this[target][name] = val;
+      return this;
+    } else {
+      return this[target][name];
+    }
+  };
+
+  return this;
+};
diff --git a/legacy-libs/grpc/node_modules/delegates/package.json b/legacy-libs/grpc/node_modules/delegates/package.json
new file mode 100644 (file)
index 0000000..e727b4a
--- /dev/null
@@ -0,0 +1,55 @@
+{
+  "_args": [
+    [
+      "delegates@1.0.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "delegates@1.0.0",
+  "_id": "delegates@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
+  "_location": "/grpc/delegates",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "delegates@1.0.0",
+    "name": "delegates",
+    "escapedName": "delegates",
+    "rawSpec": "1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "1.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/are-we-there-yet"
+  ],
+  "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "bugs": {
+    "url": "https://github.com/visionmedia/node-delegates/issues"
+  },
+  "dependencies": {},
+  "description": "delegate methods and accessors to another property",
+  "devDependencies": {
+    "mocha": "*",
+    "should": "*"
+  },
+  "homepage": "https://github.com/visionmedia/node-delegates#readme",
+  "keywords": [
+    "delegate",
+    "delegation"
+  ],
+  "license": "MIT",
+  "name": "delegates",
+  "optionalDependencies": {},
+  "readme": "\n# delegates\n\n  Node method and accessor delegation utilty.\n\n## Installation\n\n```\n$ npm install delegates\n```\n\n## Example\n\n```js\nvar delegate = require('delegates');\n\n...\n\ndelegate(proto, 'request')\n  .method('acceptsLanguages')\n  .method('acceptsEncodings')\n  .method('acceptsCharsets')\n  .method('accepts')\n  .method('is')\n  .access('querystring')\n  .access('idempotent')\n  .access('socket')\n  .access('length')\n  .access('query')\n  .access('search')\n  .access('status')\n  .access('method')\n  .access('path')\n  .access('body')\n  .access('host')\n  .access('url')\n  .getter('subdomains')\n  .getter('protocol')\n  .getter('header')\n  .getter('stale')\n  .getter('fresh')\n  .getter('secure')\n  .getter('ips')\n  .getter('ip')\n```\n\n# API\n\n## Delegate(proto, prop)\n\nCreates a delegator instance used to configure using the `prop` on the given\n`proto` object. (which is usually a prototype)\n\n## Delegate#method(name)\n\nAllows the given method `name` to be accessed on the host.\n\n## Delegate#getter(name)\n\nCreates a \"getter\" for the property with the given `name` on the delegated\nobject.\n\n## Delegate#setter(name)\n\nCreates a \"setter\" for the property with the given `name` on the delegated\nobject.\n\n## Delegate#access(name)\n\nCreates an \"accessor\" (ie: both getter *and* setter) for the property with the\ngiven `name` on the delegated object.\n\n## Delegate#fluent(name)\n\nA unique type of \"accessor\" that works for a \"fluent\" API. When called as a\ngetter, the method returns the expected value. However, if the method is called\nwith a value, it will return itself so it can be chained. For example:\n\n```js\ndelegate(proto, 'request')\n  .fluent('query')\n\n// getter\nvar q = request.query();\n\n// setter (chainable)\nrequest\n  .query({ a: 1 })\n  .query({ b: 2 });\n```\n\n# License\n\n  MIT\n",
+  "readmeFilename": "Readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/visionmedia/node-delegates.git"
+  },
+  "version": "1.0.0"
+}
diff --git a/legacy-libs/grpc/node_modules/delegates/test/index.js b/legacy-libs/grpc/node_modules/delegates/test/index.js
new file mode 100644 (file)
index 0000000..7b6e3d4
--- /dev/null
@@ -0,0 +1,94 @@
+
+var assert = require('assert');
+var delegate = require('..');
+
+describe('.method(name)', function(){
+  it('should delegate methods', function(){
+    var obj = {};
+
+    obj.request = {
+      foo: function(bar){
+        assert(this == obj.request);
+        return bar;
+      }
+    };
+
+    delegate(obj, 'request').method('foo');
+
+    obj.foo('something').should.equal('something');
+  })
+})
+
+describe('.getter(name)', function(){
+  it('should delegate getters', function(){
+    var obj = {};
+
+    obj.request = {
+      get type() {
+        return 'text/html';
+      }
+    }
+
+    delegate(obj, 'request').getter('type');
+
+    obj.type.should.equal('text/html');
+  })
+})
+
+describe('.setter(name)', function(){
+  it('should delegate setters', function(){
+    var obj = {};
+
+    obj.request = {
+      get type() {
+        return this._type.toUpperCase();
+      },
+
+      set type(val) {
+        this._type = val;
+      }
+    }
+
+    delegate(obj, 'request').setter('type');
+
+    obj.type = 'hey';
+    obj.request.type.should.equal('HEY');
+  })
+})
+
+describe('.access(name)', function(){
+  it('should delegate getters and setters', function(){
+    var obj = {};
+
+    obj.request = {
+      get type() {
+        return this._type.toUpperCase();
+      },
+
+      set type(val) {
+        this._type = val;
+      }
+    }
+
+    delegate(obj, 'request').access('type');
+
+    obj.type = 'hey';
+    obj.type.should.equal('HEY');
+  })
+})
+
+describe('.fluent(name)', function () {
+  it('should delegate in a fluent fashion', function () {
+    var obj = {
+      settings: {
+        env: 'development'
+      }
+    };
+
+    delegate(obj, 'settings').fluent('env');
+
+    obj.env().should.equal('development');
+    obj.env('production').should.equal(obj);
+    obj.settings.env.should.equal('production');
+  })
+})
diff --git a/legacy-libs/grpc/node_modules/detect-libc/LICENSE b/legacy-libs/grpc/node_modules/detect-libc/LICENSE
new file mode 100644 (file)
index 0000000..8dada3e
--- /dev/null
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/legacy-libs/grpc/node_modules/detect-libc/README.md b/legacy-libs/grpc/node_modules/detect-libc/README.md
new file mode 100644 (file)
index 0000000..3176357
--- /dev/null
@@ -0,0 +1,78 @@
+# detect-libc
+
+Node.js module to detect the C standard library (libc) implementation
+family and version in use on a given Linux system.
+
+Provides a value suitable for use with the `LIBC` option of
+[prebuild](https://www.npmjs.com/package/prebuild),
+[prebuild-ci](https://www.npmjs.com/package/prebuild-ci) and
+[prebuild-install](https://www.npmjs.com/package/prebuild-install),
+therefore allowing build and provision of pre-compiled binaries
+for musl-based Linux e.g. Alpine as well as glibc-based.
+
+Currently supports libc detection of `glibc` and `musl`.
+
+## Install
+
+```sh
+npm install detect-libc
+```
+
+## Usage
+
+### API
+
+```js
+const { GLIBC, MUSL, family, version, isNonGlibcLinux } = require('detect-libc');
+```
+
+* `GLIBC` is a String containing the value "glibc" for comparison with `family`.
+* `MUSL` is a String containing the value "musl" for comparison with `family`.
+* `family` is a String representing the system libc family.
+* `version` is a String representing the system libc version number.
+* `isNonGlibcLinux` is a Boolean representing whether the system is a non-glibc Linux, e.g. Alpine.
+
+### detect-libc command line tool
+
+When run on a Linux system with a non-glibc libc,
+the child command will be run with the `LIBC` environment variable
+set to the relevant value.
+
+On all other platforms will run the child command as-is.
+
+The command line feature requires `spawnSync` provided by Node v0.12+.
+
+```sh
+detect-libc child-command
+```
+
+## Integrating with prebuild
+
+```json
+  "scripts": {
+    "install": "detect-libc prebuild-install || node-gyp rebuild",
+    "test": "mocha && detect-libc prebuild-ci"
+  },
+  "dependencies": {
+    "detect-libc": "^1.0.2",
+    "prebuild-install": "^2.2.0"
+  },
+  "devDependencies": {
+    "prebuild": "^6.2.1",
+    "prebuild-ci": "^2.2.3"
+  }
+```
+
+## Licence
+
+Copyright 2017 Lovell Fuller
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/legacy-libs/grpc/node_modules/detect-libc/bin/detect-libc.js b/legacy-libs/grpc/node_modules/detect-libc/bin/detect-libc.js
new file mode 100644 (file)
index 0000000..5486127
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/env node
+
+'use strict';
+
+var spawnSync = require('child_process').spawnSync;
+var libc = require('../');
+
+var spawnOptions = {
+  env: process.env,
+  shell: true,
+  stdio: 'inherit'
+};
+
+if (libc.isNonGlibcLinux) {
+  spawnOptions.env.LIBC = process.env.LIBC || libc.family;
+}
+
+process.exit(spawnSync(process.argv[2], process.argv.slice(3), spawnOptions).status);
diff --git a/legacy-libs/grpc/node_modules/detect-libc/lib/detect-libc.js b/legacy-libs/grpc/node_modules/detect-libc/lib/detect-libc.js
new file mode 100644 (file)
index 0000000..1855fe1
--- /dev/null
@@ -0,0 +1,92 @@
+'use strict';
+
+var platform = require('os').platform();
+var spawnSync = require('child_process').spawnSync;
+var readdirSync = require('fs').readdirSync;
+
+var GLIBC = 'glibc';
+var MUSL = 'musl';
+
+var spawnOptions = {
+  encoding: 'utf8',
+  env: process.env
+};
+
+if (!spawnSync) {
+  spawnSync = function () {
+    return { status: 126, stdout: '', stderr: '' };
+  };
+}
+
+function contains (needle) {
+  return function (haystack) {
+    return haystack.indexOf(needle) !== -1;
+  };
+}
+
+function versionFromMuslLdd (out) {
+  return out.split(/[\r\n]+/)[1].trim().split(/\s/)[1];
+}
+
+function safeReaddirSync (path) {
+  try {
+    return readdirSync(path);
+  } catch (e) {}
+  return [];
+}
+
+var family = '';
+var version = '';
+var method = '';
+
+if (platform === 'linux') {
+  // Try getconf
+  var glibc = spawnSync('getconf', ['GNU_LIBC_VERSION'], spawnOptions);
+  if (glibc.status === 0) {
+    family = GLIBC;
+    version = glibc.stdout.trim().split(' ')[1];
+    method = 'getconf';
+  } else {
+    // Try ldd
+    var ldd = spawnSync('ldd', ['--version'], spawnOptions);
+    if (ldd.status === 0 && ldd.stdout.indexOf(MUSL) !== -1) {
+      family = MUSL;
+      version = versionFromMuslLdd(ldd.stdout);
+      method = 'ldd';
+    } else if (ldd.status === 1 && ldd.stderr.indexOf(MUSL) !== -1) {
+      family = MUSL;
+      version = versionFromMuslLdd(ldd.stderr);
+      method = 'ldd';
+    } else {
+      // Try filesystem (family only)
+      var lib = safeReaddirSync('/lib');
+      if (lib.some(contains('-linux-gnu'))) {
+        family = GLIBC;
+        method = 'filesystem';
+      } else if (lib.some(contains('libc.musl-'))) {
+        family = MUSL;
+        method = 'filesystem';
+      } else if (lib.some(contains('ld-musl-'))) {
+        family = MUSL;
+        method = 'filesystem';
+      } else {
+        var usrSbin = safeReaddirSync('/usr/sbin');
+        if (usrSbin.some(contains('glibc'))) {
+          family = GLIBC;
+          method = 'filesystem';
+        }
+      }
+    }
+  }
+}
+
+var isNonGlibcLinux = (family !== '' && family !== GLIBC);
+
+module.exports = {
+  GLIBC: GLIBC,
+  MUSL: MUSL,
+  family: family,
+  version: version,
+  method: method,
+  isNonGlibcLinux: isNonGlibcLinux
+};
diff --git a/legacy-libs/grpc/node_modules/detect-libc/package.json b/legacy-libs/grpc/node_modules/detect-libc/package.json
new file mode 100644 (file)
index 0000000..1bda8cf
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_args": [
+    [
+      "detect-libc@1.0.3",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "detect-libc@1.0.3",
+  "_id": "detect-libc@1.0.3",
+  "_inBundle": false,
+  "_integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
+  "_location": "/grpc/detect-libc",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "detect-libc@1.0.3",
+    "name": "detect-libc",
+    "escapedName": "detect-libc",
+    "rawSpec": "1.0.3",
+    "saveSpec": null,
+    "fetchSpec": "1.0.3"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.3",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Lovell Fuller",
+    "email": "npm@lovell.info"
+  },
+  "bin": {
+    "detect-libc": "./bin/detect-libc.js"
+  },
+  "bugs": {
+    "url": "https://github.com/lovell/detect-libc/issues"
+  },
+  "contributors": [
+    {
+      "name": "Niklas Salmoukas",
+      "email": "niklas@salmoukas.com"
+    }
+  ],
+  "dependencies": {},
+  "description": "Node.js module to detect the C standard library (libc) implementation family and version",
+  "devDependencies": {
+    "ava": "^0.23.0",
+    "nyc": "^11.3.0",
+    "proxyquire": "^1.8.0",
+    "semistandard": "^11.0.0"
+  },
+  "engines": {
+    "node": ">=0.10"
+  },
+  "homepage": "https://github.com/lovell/detect-libc#readme",
+  "keywords": [
+    "libc",
+    "glibc",
+    "musl"
+  ],
+  "license": "Apache-2.0",
+  "main": "lib/detect-libc.js",
+  "name": "detect-libc",
+  "optionalDependencies": {},
+  "readme": "# detect-libc\n\nNode.js module to detect the C standard library (libc) implementation\nfamily and version in use on a given Linux system.\n\nProvides a value suitable for use with the `LIBC` option of\n[prebuild](https://www.npmjs.com/package/prebuild),\n[prebuild-ci](https://www.npmjs.com/package/prebuild-ci) and\n[prebuild-install](https://www.npmjs.com/package/prebuild-install),\ntherefore allowing build and provision of pre-compiled binaries\nfor musl-based Linux e.g. Alpine as well as glibc-based.\n\nCurrently supports libc detection of `glibc` and `musl`.\n\n## Install\n\n```sh\nnpm install detect-libc\n```\n\n## Usage\n\n### API\n\n```js\nconst { GLIBC, MUSL, family, version, isNonGlibcLinux } = require('detect-libc');\n```\n\n* `GLIBC` is a String containing the value \"glibc\" for comparison with `family`.\n* `MUSL` is a String containing the value \"musl\" for comparison with `family`.\n* `family` is a String representing the system libc family.\n* `version` is a String representing the system libc version number.\n* `isNonGlibcLinux` is a Boolean representing whether the system is a non-glibc Linux, e.g. Alpine.\n\n### detect-libc command line tool\n\nWhen run on a Linux system with a non-glibc libc,\nthe child command will be run with the `LIBC` environment variable\nset to the relevant value.\n\nOn all other platforms will run the child command as-is.\n\nThe command line feature requires `spawnSync` provided by Node v0.12+.\n\n```sh\ndetect-libc child-command\n```\n\n## Integrating with prebuild\n\n```json\n  \"scripts\": {\n    \"install\": \"detect-libc prebuild-install || node-gyp rebuild\",\n    \"test\": \"mocha && detect-libc prebuild-ci\"\n  },\n  \"dependencies\": {\n    \"detect-libc\": \"^1.0.2\",\n    \"prebuild-install\": \"^2.2.0\"\n  },\n  \"devDependencies\": {\n    \"prebuild\": \"^6.2.1\",\n    \"prebuild-ci\": \"^2.2.3\"\n  }\n```\n\n## Licence\n\nCopyright 2017 Lovell Fuller\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/lovell/detect-libc.git"
+  },
+  "scripts": {
+    "test": "semistandard && nyc --reporter=lcov ava"
+  },
+  "version": "1.0.3"
+}
diff --git a/legacy-libs/grpc/node_modules/fs-minipass/LICENSE b/legacy-libs/grpc/node_modules/fs-minipass/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/fs-minipass/README.md b/legacy-libs/grpc/node_modules/fs-minipass/README.md
new file mode 100644 (file)
index 0000000..1e61241
--- /dev/null
@@ -0,0 +1,70 @@
+# fs-minipass
+
+Filesystem streams based on [minipass](http://npm.im/minipass).
+
+4 classes are exported:
+
+- ReadStream
+- ReadStreamSync
+- WriteStream
+- WriteStreamSync
+
+When using `ReadStreamSync`, all of the data is made available
+immediately upon consuming the stream.  Nothing is buffered in memory
+when the stream is constructed.  If the stream is piped to a writer,
+then it will synchronously `read()` and emit data into the writer as
+fast as the writer can consume it.  (That is, it will respect
+backpressure.)  If you call `stream.read()` then it will read the
+entire file and return the contents.
+
+When using `WriteStreamSync`, every write is flushed to the file
+synchronously.  If your writes all come in a single tick, then it'll
+write it all out in a single tick.  It's as synchronous as you are.
+
+The async versions work much like their node builtin counterparts,
+with the exception of introducing significantly less Stream machinery
+overhead.
+
+## USAGE
+
+It's just streams, you pipe them or read() them or write() to them.
+
+```js
+const fsm = require('fs-minipass')
+const readStream = new fsm.ReadStream('file.txt')
+const writeStream = new fsm.WriteStream('output.txt')
+writeStream.write('some file header or whatever\n')
+readStream.pipe(writeStream)
+```
+
+## ReadStream(path, options)
+
+Path string is required, but somewhat irrelevant if an open file
+descriptor is passed in as an option.
+
+Options:
+
+- `fd` Pass in a numeric file descriptor, if the file is already open.
+- `readSize` The size of reads to do, defaults to 16MB
+- `size` The size of the file, if known.  Prevents zero-byte read()
+  call at the end.
+- `autoClose` Set to `false` to prevent the file descriptor from being
+  closed when the file is done being read.
+
+## WriteStream(path, options)
+
+Path string is required, but somewhat irrelevant if an open file
+descriptor is passed in as an option.
+
+Options:
+
+- `fd` Pass in a numeric file descriptor, if the file is already open.
+- `mode` The mode to create the file with. Defaults to `0o666`.
+- `start` The position in the file to start reading.  If not
+  specified, then the file will start writing at position zero, and be
+  truncated by default.
+- `autoClose` Set to `false` to prevent the file descriptor from being
+  closed when the stream is ended.
+- `flags` Flags to use when opening the file.  Irrelevant if `fd` is
+  passed in, since file won't be opened in that case.  Defaults to
+  `'a'` if a `pos` is specified, or `'w'` otherwise.
diff --git a/legacy-libs/grpc/node_modules/fs-minipass/index.js b/legacy-libs/grpc/node_modules/fs-minipass/index.js
new file mode 100644 (file)
index 0000000..6bb7f10
--- /dev/null
@@ -0,0 +1,386 @@
+'use strict'
+const MiniPass = require('minipass')
+const EE = require('events').EventEmitter
+const fs = require('fs')
+
+// for writev
+const binding = process.binding('fs')
+const writeBuffers = binding.writeBuffers
+const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback
+
+const _autoClose = Symbol('_autoClose')
+const _close = Symbol('_close')
+const _ended = Symbol('_ended')
+const _fd = Symbol('_fd')
+const _finished = Symbol('_finished')
+const _flags = Symbol('_flags')
+const _flush = Symbol('_flush')
+const _handleChunk = Symbol('_handleChunk')
+const _makeBuf = Symbol('_makeBuf')
+const _mode = Symbol('_mode')
+const _needDrain = Symbol('_needDrain')
+const _onerror = Symbol('_onerror')
+const _onopen = Symbol('_onopen')
+const _onread = Symbol('_onread')
+const _onwrite = Symbol('_onwrite')
+const _open = Symbol('_open')
+const _path = Symbol('_path')
+const _pos = Symbol('_pos')
+const _queue = Symbol('_queue')
+const _read = Symbol('_read')
+const _readSize = Symbol('_readSize')
+const _reading = Symbol('_reading')
+const _remain = Symbol('_remain')
+const _size = Symbol('_size')
+const _write = Symbol('_write')
+const _writing = Symbol('_writing')
+const _defaultFlag = Symbol('_defaultFlag')
+
+class ReadStream extends MiniPass {
+  constructor (path, opt) {
+    opt = opt || {}
+    super(opt)
+
+    this.writable = false
+
+    if (typeof path !== 'string')
+      throw new TypeError('path must be a string')
+
+    this[_fd] = typeof opt.fd === 'number' ? opt.fd : null
+    this[_path] = path
+    this[_readSize] = opt.readSize || 16*1024*1024
+    this[_reading] = false
+    this[_size] = typeof opt.size === 'number' ? opt.size : Infinity
+    this[_remain] = this[_size]
+    this[_autoClose] = typeof opt.autoClose === 'boolean' ?
+      opt.autoClose : true
+
+    if (typeof this[_fd] === 'number')
+      this[_read]()
+    else
+      this[_open]()
+  }
+
+  get fd () { return this[_fd] }
+  get path () { return this[_path] }
+
+  write () {
+    throw new TypeError('this is a readable stream')
+  }
+
+  end () {
+    throw new TypeError('this is a readable stream')
+  }
+
+  [_open] () {
+    fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))
+  }
+
+  [_onopen] (er, fd) {
+    if (er)
+      this[_onerror](er)
+    else {
+      this[_fd] = fd
+      this.emit('open', fd)
+      this[_read]()
+    }
+  }
+
+  [_makeBuf] () {
+    return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]))
+  }
+
+  [_read] () {
+    if (!this[_reading]) {
+      this[_reading] = true
+      const buf = this[_makeBuf]()
+      /* istanbul ignore if */
+      if (buf.length === 0) return process.nextTick(() => this[_onread](null, 0, buf))
+      fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) =>
+        this[_onread](er, br, buf))
+    }
+  }
+
+  [_onread] (er, br, buf) {
+    this[_reading] = false
+    if (er)
+      this[_onerror](er)
+    else if (this[_handleChunk](br, buf))
+      this[_read]()
+  }
+
+  [_close] () {
+    if (this[_autoClose] && typeof this[_fd] === 'number') {
+      fs.close(this[_fd], _ => this.emit('close'))
+      this[_fd] = null
+    }
+  }
+
+  [_onerror] (er) {
+    this[_reading] = true
+    this[_close]()
+    this.emit('error', er)
+  }
+
+  [_handleChunk] (br, buf) {
+    let ret = false
+    // no effect if infinite
+    this[_remain] -= br
+    if (br > 0)
+      ret = super.write(br < buf.length ? buf.slice(0, br) : buf)
+
+    if (br === 0 || this[_remain] <= 0) {
+      ret = false
+      this[_close]()
+      super.end()
+    }
+
+    return ret
+  }
+
+  emit (ev, data) {
+    switch (ev) {
+      case 'prefinish':
+      case 'finish':
+        break
+
+      case 'drain':
+        if (typeof this[_fd] === 'number')
+          this[_read]()
+        break
+
+      default:
+        return super.emit(ev, data)
+    }
+  }
+}
+
+class ReadStreamSync extends ReadStream {
+  [_open] () {
+    let threw = true
+    try {
+      this[_onopen](null, fs.openSync(this[_path], 'r'))
+      threw = false
+    } finally {
+      if (threw)
+        this[_close]()
+    }
+  }
+
+  [_read] () {
+    let threw = true
+    try {
+      if (!this[_reading]) {
+        this[_reading] = true
+        do {
+          const buf = this[_makeBuf]()
+          /* istanbul ignore next */
+          const br = buf.length === 0 ? 0 : fs.readSync(this[_fd], buf, 0, buf.length, null)
+          if (!this[_handleChunk](br, buf))
+            break
+        } while (true)
+        this[_reading] = false
+      }
+      threw = false
+    } finally {
+      if (threw)
+        this[_close]()
+    }
+  }
+
+  [_close] () {
+    if (this[_autoClose] && typeof this[_fd] === 'number') {
+      try {
+        fs.closeSync(this[_fd])
+      } catch (er) {}
+      this[_fd] = null
+      this.emit('close')
+    }
+  }
+}
+
+class WriteStream extends EE {
+  constructor (path, opt) {
+    opt = opt || {}
+    super(opt)
+    this.readable = false
+    this[_writing] = false
+    this[_ended] = false
+    this[_needDrain] = false
+    this[_queue] = []
+    this[_path] = path
+    this[_fd] = typeof opt.fd === 'number' ? opt.fd : null
+    this[_mode] = opt.mode === undefined ? 0o666 : opt.mode
+    this[_pos] = typeof opt.start === 'number' ? opt.start : null
+    this[_autoClose] = typeof opt.autoClose === 'boolean' ?
+      opt.autoClose : true
+
+    // truncating makes no sense when writing into the middle
+    const defaultFlag = this[_pos] !== null ? 'r+' : 'w'
+    this[_defaultFlag] = opt.flags === undefined
+    this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags
+
+    if (this[_fd] === null)
+      this[_open]()
+  }
+
+  get fd () { return this[_fd] }
+  get path () { return this[_path] }
+
+  [_onerror] (er) {
+    this[_close]()
+    this[_writing] = true
+    this.emit('error', er)
+  }
+
+  [_open] () {
+    fs.open(this[_path], this[_flags], this[_mode],
+      (er, fd) => this[_onopen](er, fd))
+  }
+
+  [_onopen] (er, fd) {
+    if (this[_defaultFlag] &&
+        this[_flags] === 'r+' &&
+        er && er.code === 'ENOENT') {
+      this[_flags] = 'w'
+      this[_open]()
+    } else if (er)
+      this[_onerror](er)
+    else {
+      this[_fd] = fd
+      this.emit('open', fd)
+      this[_flush]()
+    }
+  }
+
+  end (buf, enc) {
+    if (buf)
+      this.write(buf, enc)
+
+    this[_ended] = true
+
+    // synthetic after-write logic, where drain/finish live
+    if (!this[_writing] && !this[_queue].length &&
+        typeof this[_fd] === 'number')
+      this[_onwrite](null, 0)
+  }
+
+  write (buf, enc) {
+    if (typeof buf === 'string')
+      buf = new Buffer(buf, enc)
+
+    if (this[_ended]) {
+      this.emit('error', new Error('write() after end()'))
+      return false
+    }
+
+    if (this[_fd] === null || this[_writing] || this[_queue].length) {
+      this[_queue].push(buf)
+      this[_needDrain] = true
+      return false
+    }
+
+    this[_writing] = true
+    this[_write](buf)
+    return true
+  }
+
+  [_write] (buf) {
+    fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) =>
+      this[_onwrite](er, bw))
+  }
+
+  [_onwrite] (er, bw) {
+    if (er)
+      this[_onerror](er)
+    else {
+      if (this[_pos] !== null)
+        this[_pos] += bw
+      if (this[_queue].length)
+        this[_flush]()
+      else {
+        this[_writing] = false
+
+        if (this[_ended] && !this[_finished]) {
+          this[_finished] = true
+          this[_close]()
+          this.emit('finish')
+        } else if (this[_needDrain]) {
+          this[_needDrain] = false
+          this.emit('drain')
+        }
+      }
+    }
+  }
+
+  [_flush] () {
+    if (this[_queue].length === 0) {
+      if (this[_ended])
+        this[_onwrite](null, 0)
+    } else if (this[_queue].length === 1)
+      this[_write](this[_queue].pop())
+    else {
+      const iovec = this[_queue]
+      this[_queue] = []
+      writev(this[_fd], iovec, this[_pos],
+        (er, bw) => this[_onwrite](er, bw))
+    }
+  }
+
+  [_close] () {
+    if (this[_autoClose] && typeof this[_fd] === 'number') {
+      fs.close(this[_fd], _ => this.emit('close'))
+      this[_fd] = null
+    }
+  }
+}
+
+class WriteStreamSync extends WriteStream {
+  [_open] () {
+    let fd
+    try {
+      fd = fs.openSync(this[_path], this[_flags], this[_mode])
+    } catch (er) {
+      if (this[_defaultFlag] &&
+          this[_flags] === 'r+' &&
+          er && er.code === 'ENOENT') {
+        this[_flags] = 'w'
+        return this[_open]()
+      } else
+        throw er
+    }
+    this[_onopen](null, fd)
+  }
+
+  [_close] () {
+    if (this[_autoClose] && typeof this[_fd] === 'number') {
+      try {
+        fs.closeSync(this[_fd])
+      } catch (er) {}
+      this[_fd] = null
+      this.emit('close')
+    }
+  }
+
+  [_write] (buf) {
+    try {
+      this[_onwrite](null,
+        fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]))
+    } catch (er) {
+      this[_onwrite](er, 0)
+    }
+  }
+}
+
+const writev = (fd, iovec, pos, cb) => {
+  const done = (er, bw) => cb(er, bw, iovec)
+  const req = new FSReqWrap()
+  req.oncomplete = done
+  binding.writeBuffers(fd, iovec, pos, req)
+}
+
+exports.ReadStream = ReadStream
+exports.ReadStreamSync = ReadStreamSync
+
+exports.WriteStream = WriteStream
+exports.WriteStreamSync = WriteStreamSync
diff --git a/legacy-libs/grpc/node_modules/fs-minipass/package.json b/legacy-libs/grpc/node_modules/fs-minipass/package.json
new file mode 100644 (file)
index 0000000..008d02b
--- /dev/null
@@ -0,0 +1,69 @@
+{
+  "_from": "fs-minipass@^1.2.5",
+  "_id": "fs-minipass@1.2.6",
+  "_inBundle": false,
+  "_integrity": "sha512-crhvyXcMejjv3Z5d2Fa9sf5xLYVCF5O1c71QxbVnbLsmYMBEvDAftewesN/HhY03YRoA7zOMxjNGrF5svGaaeQ==",
+  "_location": "/grpc/fs-minipass",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "fs-minipass@^1.2.5",
+    "name": "fs-minipass",
+    "escapedName": "fs-minipass",
+    "rawSpec": "^1.2.5",
+    "saveSpec": null,
+    "fetchSpec": "^1.2.5"
+  },
+  "_requiredBy": [
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.6.tgz",
+  "_shasum": "2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07",
+  "_shrinkwrap": null,
+  "_spec": "fs-minipass@^1.2.5",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/tar",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/fs-minipass/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "minipass": "^2.2.1"
+  },
+  "deprecated": false,
+  "description": "fs read and write streams based on minipass",
+  "devDependencies": {
+    "mutate-fs": "^2.0.1",
+    "tap": "^13.1.9"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/npm/fs-minipass#readme",
+  "keywords": [],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "fs-minipass",
+  "optionalDependencies": {},
+  "readme": "# fs-minipass\n\nFilesystem streams based on [minipass](http://npm.im/minipass).\n\n4 classes are exported:\n\n- ReadStream\n- ReadStreamSync\n- WriteStream\n- WriteStreamSync\n\nWhen using `ReadStreamSync`, all of the data is made available\nimmediately upon consuming the stream.  Nothing is buffered in memory\nwhen the stream is constructed.  If the stream is piped to a writer,\nthen it will synchronously `read()` and emit data into the writer as\nfast as the writer can consume it.  (That is, it will respect\nbackpressure.)  If you call `stream.read()` then it will read the\nentire file and return the contents.\n\nWhen using `WriteStreamSync`, every write is flushed to the file\nsynchronously.  If your writes all come in a single tick, then it'll\nwrite it all out in a single tick.  It's as synchronous as you are.\n\nThe async versions work much like their node builtin counterparts,\nwith the exception of introducing significantly less Stream machinery\noverhead.\n\n## USAGE\n\nIt's just streams, you pipe them or read() them or write() to them.\n\n```js\nconst fsm = require('fs-minipass')\nconst readStream = new fsm.ReadStream('file.txt')\nconst writeStream = new fsm.WriteStream('output.txt')\nwriteStream.write('some file header or whatever\\n')\nreadStream.pipe(writeStream)\n```\n\n## ReadStream(path, options)\n\nPath string is required, but somewhat irrelevant if an open file\ndescriptor is passed in as an option.\n\nOptions:\n\n- `fd` Pass in a numeric file descriptor, if the file is already open.\n- `readSize` The size of reads to do, defaults to 16MB\n- `size` The size of the file, if known.  Prevents zero-byte read()\n  call at the end.\n- `autoClose` Set to `false` to prevent the file descriptor from being\n  closed when the file is done being read.\n\n## WriteStream(path, options)\n\nPath string is required, but somewhat irrelevant if an open file\ndescriptor is passed in as an option.\n\nOptions:\n\n- `fd` Pass in a numeric file descriptor, if the file is already open.\n- `mode` The mode to create the file with. Defaults to `0o666`.\n- `start` The position in the file to start reading.  If not\n  specified, then the file will start writing at position zero, and be\n  truncated by default.\n- `autoClose` Set to `false` to prevent the file descriptor from being\n  closed when the stream is ended.\n- `flags` Flags to use when opening the file.  Irrelevant if `fd` is\n  passed in, since file won't be opened in that case.  Defaults to\n  `'a'` if a `pos` is specified, or `'w'` otherwise.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/fs-minipass.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --follow-tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap"
+  },
+  "tap": {
+    "check-coverage": true
+  },
+  "version": "1.2.6"
+}
diff --git a/legacy-libs/grpc/node_modules/fs.realpath/LICENSE b/legacy-libs/grpc/node_modules/fs.realpath/LICENSE
new file mode 100644 (file)
index 0000000..5bd884c
--- /dev/null
@@ -0,0 +1,43 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+----
+
+This library bundles a version of the `fs.realpath` and `fs.realpathSync`
+methods from Node.js v0.10 under the terms of the Node.js MIT license.
+
+Node's license follows, also included at the header of `old.js` which contains
+the licensed code:
+
+  Copyright Joyent, Inc. and other Node contributors.
+
+  Permission is hereby granted, free of charge, to any person obtaining a
+  copy of this software and associated documentation files (the "Software"),
+  to deal in the Software without restriction, including without limitation
+  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+  and/or sell copies of the Software, and to permit persons to whom the
+  Software is furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in
+  all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/fs.realpath/README.md b/legacy-libs/grpc/node_modules/fs.realpath/README.md
new file mode 100644 (file)
index 0000000..a42ceac
--- /dev/null
@@ -0,0 +1,33 @@
+# fs.realpath
+
+A backwards-compatible fs.realpath for Node v6 and above
+
+In Node v6, the JavaScript implementation of fs.realpath was replaced
+with a faster (but less resilient) native implementation.  That raises
+new and platform-specific errors and cannot handle long or excessively
+symlink-looping paths.
+
+This module handles those cases by detecting the new errors and
+falling back to the JavaScript implementation.  On versions of Node
+prior to v6, it has no effect.
+
+## USAGE
+
+```js
+var rp = require('fs.realpath')
+
+// async version
+rp.realpath(someLongAndLoopingPath, function (er, real) {
+  // the ELOOP was handled, but it was a bit slower
+})
+
+// sync version
+var real = rp.realpathSync(someLongAndLoopingPath)
+
+// monkeypatch at your own risk!
+// This replaces the fs.realpath/fs.realpathSync builtins
+rp.monkeypatch()
+
+// un-do the monkeypatching
+rp.unmonkeypatch()
+```
diff --git a/legacy-libs/grpc/node_modules/fs.realpath/index.js b/legacy-libs/grpc/node_modules/fs.realpath/index.js
new file mode 100644 (file)
index 0000000..b09c7c7
--- /dev/null
@@ -0,0 +1,66 @@
+module.exports = realpath
+realpath.realpath = realpath
+realpath.sync = realpathSync
+realpath.realpathSync = realpathSync
+realpath.monkeypatch = monkeypatch
+realpath.unmonkeypatch = unmonkeypatch
+
+var fs = require('fs')
+var origRealpath = fs.realpath
+var origRealpathSync = fs.realpathSync
+
+var version = process.version
+var ok = /^v[0-5]\./.test(version)
+var old = require('./old.js')
+
+function newError (er) {
+  return er && er.syscall === 'realpath' && (
+    er.code === 'ELOOP' ||
+    er.code === 'ENOMEM' ||
+    er.code === 'ENAMETOOLONG'
+  )
+}
+
+function realpath (p, cache, cb) {
+  if (ok) {
+    return origRealpath(p, cache, cb)
+  }
+
+  if (typeof cache === 'function') {
+    cb = cache
+    cache = null
+  }
+  origRealpath(p, cache, function (er, result) {
+    if (newError(er)) {
+      old.realpath(p, cache, cb)
+    } else {
+      cb(er, result)
+    }
+  })
+}
+
+function realpathSync (p, cache) {
+  if (ok) {
+    return origRealpathSync(p, cache)
+  }
+
+  try {
+    return origRealpathSync(p, cache)
+  } catch (er) {
+    if (newError(er)) {
+      return old.realpathSync(p, cache)
+    } else {
+      throw er
+    }
+  }
+}
+
+function monkeypatch () {
+  fs.realpath = realpath
+  fs.realpathSync = realpathSync
+}
+
+function unmonkeypatch () {
+  fs.realpath = origRealpath
+  fs.realpathSync = origRealpathSync
+}
diff --git a/legacy-libs/grpc/node_modules/fs.realpath/old.js b/legacy-libs/grpc/node_modules/fs.realpath/old.js
new file mode 100644 (file)
index 0000000..b40305e
--- /dev/null
@@ -0,0 +1,303 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+var pathModule = require('path');
+var isWindows = process.platform === 'win32';
+var fs = require('fs');
+
+// JavaScript implementation of realpath, ported from node pre-v6
+
+var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
+
+function rethrow() {
+  // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
+  // is fairly slow to generate.
+  var callback;
+  if (DEBUG) {
+    var backtrace = new Error;
+    callback = debugCallback;
+  } else
+    callback = missingCallback;
+
+  return callback;
+
+  function debugCallback(err) {
+    if (err) {
+      backtrace.message = err.message;
+      err = backtrace;
+      missingCallback(err);
+    }
+  }
+
+  function missingCallback(err) {
+    if (err) {
+      if (process.throwDeprecation)
+        throw err;  // Forgot a callback but don't know where? Use NODE_DEBUG=fs
+      else if (!process.noDeprecation) {
+        var msg = 'fs: missing callback ' + (err.stack || err.message);
+        if (process.traceDeprecation)
+          console.trace(msg);
+        else
+          console.error(msg);
+      }
+    }
+  }
+}
+
+function maybeCallback(cb) {
+  return typeof cb === 'function' ? cb : rethrow();
+}
+
+var normalize = pathModule.normalize;
+
+// Regexp that finds the next partion of a (partial) path
+// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
+if (isWindows) {
+  var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
+} else {
+  var nextPartRe = /(.*?)(?:[\/]+|$)/g;
+}
+
+// Regex to find the device root, including trailing slash. E.g. 'c:\\'.
+if (isWindows) {
+  var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
+} else {
+  var splitRootRe = /^[\/]*/;
+}
+
+exports.realpathSync = function realpathSync(p, cache) {
+  // make p is absolute
+  p = pathModule.resolve(p);
+
+  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
+    return cache[p];
+  }
+
+  var original = p,
+      seenLinks = {},
+      knownHard = {};
+
+  // current character position in p
+  var pos;
+  // the partial path so far, including a trailing slash if any
+  var current;
+  // the partial path without a trailing slash (except when pointing at a root)
+  var base;
+  // the partial path scanned in the previous round, with slash
+  var previous;
+
+  start();
+
+  function start() {
+    // Skip over roots
+    var m = splitRootRe.exec(p);
+    pos = m[0].length;
+    current = m[0];
+    base = m[0];
+    previous = '';
+
+    // On windows, check that the root exists. On unix there is no need.
+    if (isWindows && !knownHard[base]) {
+      fs.lstatSync(base);
+      knownHard[base] = true;
+    }
+  }
+
+  // walk down the path, swapping out linked pathparts for their real
+  // values
+  // NB: p.length changes.
+  while (pos < p.length) {
+    // find the next part
+    nextPartRe.lastIndex = pos;
+    var result = nextPartRe.exec(p);
+    previous = current;
+    current += result[0];
+    base = previous + result[1];
+    pos = nextPartRe.lastIndex;
+
+    // continue if not a symlink
+    if (knownHard[base] || (cache && cache[base] === base)) {
+      continue;
+    }
+
+    var resolvedLink;
+    if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
+      // some known symbolic link.  no need to stat again.
+      resolvedLink = cache[base];
+    } else {
+      var stat = fs.lstatSync(base);
+      if (!stat.isSymbolicLink()) {
+        knownHard[base] = true;
+        if (cache) cache[base] = base;
+        continue;
+      }
+
+      // read the link if it wasn't read before
+      // dev/ino always return 0 on windows, so skip the check.
+      var linkTarget = null;
+      if (!isWindows) {
+        var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+        if (seenLinks.hasOwnProperty(id)) {
+          linkTarget = seenLinks[id];
+        }
+      }
+      if (linkTarget === null) {
+        fs.statSync(base);
+        linkTarget = fs.readlinkSync(base);
+      }
+      resolvedLink = pathModule.resolve(previous, linkTarget);
+      // track this, if given a cache.
+      if (cache) cache[base] = resolvedLink;
+      if (!isWindows) seenLinks[id] = linkTarget;
+    }
+
+    // resolve the link, then start over
+    p = pathModule.resolve(resolvedLink, p.slice(pos));
+    start();
+  }
+
+  if (cache) cache[original] = p;
+
+  return p;
+};
+
+
+exports.realpath = function realpath(p, cache, cb) {
+  if (typeof cb !== 'function') {
+    cb = maybeCallback(cache);
+    cache = null;
+  }
+
+  // make p is absolute
+  p = pathModule.resolve(p);
+
+  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
+    return process.nextTick(cb.bind(null, null, cache[p]));
+  }
+
+  var original = p,
+      seenLinks = {},
+      knownHard = {};
+
+  // current character position in p
+  var pos;
+  // the partial path so far, including a trailing slash if any
+  var current;
+  // the partial path without a trailing slash (except when pointing at a root)
+  var base;
+  // the partial path scanned in the previous round, with slash
+  var previous;
+
+  start();
+
+  function start() {
+    // Skip over roots
+    var m = splitRootRe.exec(p);
+    pos = m[0].length;
+    current = m[0];
+    base = m[0];
+    previous = '';
+
+    // On windows, check that the root exists. On unix there is no need.
+    if (isWindows && !knownHard[base]) {
+      fs.lstat(base, function(err) {
+        if (err) return cb(err);
+        knownHard[base] = true;
+        LOOP();
+      });
+    } else {
+      process.nextTick(LOOP);
+    }
+  }
+
+  // walk down the path, swapping out linked pathparts for their real
+  // values
+  function LOOP() {
+    // stop if scanned past end of path
+    if (pos >= p.length) {
+      if (cache) cache[original] = p;
+      return cb(null, p);
+    }
+
+    // find the next part
+    nextPartRe.lastIndex = pos;
+    var result = nextPartRe.exec(p);
+    previous = current;
+    current += result[0];
+    base = previous + result[1];
+    pos = nextPartRe.lastIndex;
+
+    // continue if not a symlink
+    if (knownHard[base] || (cache && cache[base] === base)) {
+      return process.nextTick(LOOP);
+    }
+
+    if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
+      // known symbolic link.  no need to stat again.
+      return gotResolvedLink(cache[base]);
+    }
+
+    return fs.lstat(base, gotStat);
+  }
+
+  function gotStat(err, stat) {
+    if (err) return cb(err);
+
+    // if not a symlink, skip to the next path part
+    if (!stat.isSymbolicLink()) {
+      knownHard[base] = true;
+      if (cache) cache[base] = base;
+      return process.nextTick(LOOP);
+    }
+
+    // stat & read the link if not read before
+    // call gotTarget as soon as the link target is known
+    // dev/ino always return 0 on windows, so skip the check.
+    if (!isWindows) {
+      var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
+      if (seenLinks.hasOwnProperty(id)) {
+        return gotTarget(null, seenLinks[id], base);
+      }
+    }
+    fs.stat(base, function(err) {
+      if (err) return cb(err);
+
+      fs.readlink(base, function(err, target) {
+        if (!isWindows) seenLinks[id] = target;
+        gotTarget(err, target);
+      });
+    });
+  }
+
+  function gotTarget(err, target, base) {
+    if (err) return cb(err);
+
+    var resolvedLink = pathModule.resolve(previous, target);
+    if (cache) cache[base] = resolvedLink;
+    gotResolvedLink(resolvedLink);
+  }
+
+  function gotResolvedLink(resolvedLink) {
+    // resolve the link, then start over
+    p = pathModule.resolve(resolvedLink, p.slice(pos));
+    start();
+  }
+};
diff --git a/legacy-libs/grpc/node_modules/fs.realpath/package.json b/legacy-libs/grpc/node_modules/fs.realpath/package.json
new file mode 100644 (file)
index 0000000..88ff784
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_args": [
+    [
+      "fs.realpath@1.0.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "fs.realpath@1.0.0",
+  "_id": "fs.realpath@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+  "_location": "/grpc/fs.realpath",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "fs.realpath@1.0.0",
+    "name": "fs.realpath",
+    "escapedName": "fs.realpath",
+    "rawSpec": "1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "1.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/fs.realpath/issues"
+  },
+  "dependencies": {},
+  "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails",
+  "devDependencies": {},
+  "files": [
+    "old.js",
+    "index.js"
+  ],
+  "homepage": "https://github.com/isaacs/fs.realpath#readme",
+  "keywords": [
+    "realpath",
+    "fs",
+    "polyfill"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "fs.realpath",
+  "optionalDependencies": {},
+  "readme": "# fs.realpath\n\nA backwards-compatible fs.realpath for Node v6 and above\n\nIn Node v6, the JavaScript implementation of fs.realpath was replaced\nwith a faster (but less resilient) native implementation.  That raises\nnew and platform-specific errors and cannot handle long or excessively\nsymlink-looping paths.\n\nThis module handles those cases by detecting the new errors and\nfalling back to the JavaScript implementation.  On versions of Node\nprior to v6, it has no effect.\n\n## USAGE\n\n```js\nvar rp = require('fs.realpath')\n\n// async version\nrp.realpath(someLongAndLoopingPath, function (er, real) {\n  // the ELOOP was handled, but it was a bit slower\n})\n\n// sync version\nvar real = rp.realpathSync(someLongAndLoopingPath)\n\n// monkeypatch at your own risk!\n// This replaces the fs.realpath/fs.realpathSync builtins\nrp.monkeypatch()\n\n// un-do the monkeypatching\nrp.unmonkeypatch()\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/fs.realpath.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js --cov"
+  },
+  "version": "1.0.0"
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/CHANGELOG.md b/legacy-libs/grpc/node_modules/gauge/CHANGELOG.md
new file mode 100644 (file)
index 0000000..407bc19
--- /dev/null
@@ -0,0 +1,160 @@
+### v2.7.4
+
+* Reset colors prior to ending a line, to eliminate flicker when a line
+  is trucated between start and end color sequences.
+
+### v2.7.3
+
+* Only create our onExit handler when we're enabled and remove it when we're
+  disabled.  This stops us from creating multiple onExit handlers when
+  multiple gauge objects are being used.
+* Fix bug where if a theme name were given instead of a theme object, it
+  would crash.
+* Remove supports-color because it's not actually used.  Uhm.  Yes, I just
+  updated it.  >.>
+
+### v2.7.2
+
+* Use supports-color instead of has-color (as the module has been renamed)
+
+### v2.7.1
+
+* Bug fix: Calls to show/pulse while the progress bar is disabled should still
+  update our internal representation of what would be shown should it be enabled.
+
+### v2.7.0
+
+* New feature: Add new `isEnabled` method to allow introspection of the gauge's
+  "enabledness" as controlled by `.enable()` and `.disable()`.
+
+### v2.6.0
+
+* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge
+  is already enabled or disabled respectively.  This prevents leaking event
+  listeners, amongst other weirdness.
+* New feature: Template items can have default values that will be used if no
+  value was otherwise passed in.
+
+### v2.5.3
+
+* Default to `enabled` only if we have a tty.  Users can always override
+  this by passing in the `enabled` option explicitly or by calling calling
+  `gauge.enable()`.
+
+### v2.5.2
+
+* Externalized `./console-strings.js` into `console-control-strings`.
+
+### v2.5.1
+
+* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the
+  node profiler.
+* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add
+  a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012))
+
+### v2.5.0
+
+* Add way to programmatically fetch a list of theme names in a themeset
+  (`Themeset.getThemeNames`).
+
+### v2.4.0
+
+* Add support for setting themesets on existing gauge objects.
+* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when
+  your terminal is interleaving output from multiple filehandles (ie, stdout
+  & stderr).
+
+### v2.3.1
+
+* Fix a refactor bug in setTheme where it wasn't accepting the various types
+  of args it should.
+
+### v2.3.0
+
+#### FEATURES
+
+* Add setTemplate & setTheme back in.
+* Add support for named themes, you can now ask for things like 'colorASCII'
+  and 'brailleSpinner'.  Of course, you can still pass in theme objects.
+  Additionally you can now pass in an object with `hasUnicode`, `hasColor` and
+  `platform` keys in order to override our guesses as to those values when
+  selecting a default theme from the themeset.
+* Make the output stream optional (it defaults to `process.stderr` now).
+* Add `setWriteTo(stream[, tty])` to change the output stream and,
+  optionally, tty.
+
+#### BUG FIXES & REFACTORING
+
+* Abort the display phase early if we're supposed to be hidden and we are.
+* Stop printing a bunch of spaces at the end of lines, since we're already
+  using an erase-to-end-of-line code anyway.
+* The unicode themes were missing the subsection separator.
+
+### v2.2.1
+
+* Fix image in readme
+
+### v2.2.0
+
+* All new themes API– reference themes by name and pass in custom themes and
+  themesets (themesets get platform support autodetection done on them to
+  select the best theme).  Theme mixins let you add features to all existing
+  themes.
+* Much, much improved test coverage.
+
+### v2.1.0
+
+* Got rid of ░ in the default platform, noUnicode, hasColor theme.  Thanks
+  to @yongtw123 for pointing out this had snuck in.
+* Fiddled with the demo output to make it easier to see the spinner spin. Also
+  added prints before each platforms test output.
+* I forgot to include `signal-exit` in our deps.  <.< Thank you @KenanY for
+  finding this. Then I was lazy and made a new commit instead of using his
+  PR. Again, thank you for your patience @KenenY.
+* Drastically speed up travis testing.
+* Add a small javascript demo (demo.js) for showing off the various themes
+  (and testing them on diff platforms).
+* Change: The subsection separator from ⁄ and / (different chars) to >.
+* Fix crasher: A show or pulse without a label would cause the template renderer
+  to complain about a missing value.
+* New feature: Add the ability to disable the clean-up-on-exit behavior.
+  Not something I expect to be widely desirable, but important if you have
+  multiple distinct gauge instances in your app.
+* Use our own color support detection.
+  The `has-color` module proved too magic for my needs, making assumptions
+  as to which stream we write to and reading command line arguments.
+
+### v2.0.0
+
+This is a major rewrite of the internals.  Externally there are fewer
+changes:
+
+* On node>0.8 gauge object now prints updates at a fixed rate.  This means
+  that when you call `show` it may wate up to `updateInterval` ms before it
+  actually prints an update.  You override this behavior with the
+  `fixedFramerate` option.
+* The gauge object now keeps the cursor hidden as long as it's enabled and
+  shown.
+* The constructor's arguments have changed, now it takes a mandatory output
+  stream and an optional options object.  The stream no longer needs to be
+  an `ansi`ified stream, although it can be if you want (but we won't make
+  use of its special features).
+* Previously the gauge was disabled by default if `process.stdout` wasn't a
+  tty.  Now it always defaults to enabled.  If you want the previous
+  behavior set the `enabled` option to `process.stdout.isTTY`.
+* The constructor's options have changed– see the docs for details.
+* Themes are entirely different.  If you were using a custom theme, or
+  referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then
+  you'll need to change your code.  You can get the equivalent of the latter
+  with:
+  ```
+  var themes = require('gauge/themes')
+  var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform
+  ```
+  The default themes no longer use any ambiguous width characters, so even
+  if you choose to display those as wide your progress bar should still
+  display correctly.
+* Templates are entirely different and if you were using a custom one, you
+  should consult the documentation to learn how to recreate it.  If you were
+  using the default, be aware that it has changed and the result looks quite
+  a bit different.
diff --git a/legacy-libs/grpc/node_modules/gauge/LICENSE b/legacy-libs/grpc/node_modules/gauge/LICENSE
new file mode 100644 (file)
index 0000000..e756052
--- /dev/null
@@ -0,0 +1,13 @@
+Copyright (c) 2014, Rebecca Turner <me@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/gauge/README.md b/legacy-libs/grpc/node_modules/gauge/README.md
new file mode 100644 (file)
index 0000000..bdd60e3
--- /dev/null
@@ -0,0 +1,399 @@
+gauge
+=====
+
+A nearly stateless terminal based horizontal gauge / progress bar.
+
+```javascript
+var Gauge = require("gauge")
+
+var gauge = new Gauge()
+
+gauge.show("test", 0.20)
+
+gauge.pulse("this")
+
+gauge.hide()
+```
+
+![](gauge-demo.gif)
+
+
+### CHANGES FROM 1.x
+
+Gauge 2.x is breaking release, please see the [changelog] for details on
+what's changed if you were previously a user of this module.
+
+[changelog]: CHANGELOG.md
+
+### THE GAUGE CLASS
+
+This is the typical interface to the module– it provides a pretty
+fire-and-forget interface to displaying your status information.
+
+```
+var Gauge = require("gauge")
+
+var gauge = new Gauge([stream], [options])
+```
+
+* **stream** – *(optional, default STDERR)* A stream that progress bar
+  updates are to be written to.  Gauge honors backpressure and will pause
+  most writing if it is indicated.
+* **options** – *(optional)* An option object.
+
+Constructs a new gauge. Gauges are drawn on a single line, and are not drawn
+if **stream** isn't a tty and a tty isn't explicitly provided.
+
+If **stream** is a terminal or if you pass in **tty** to **options** then we
+will detect terminal resizes and redraw to fit.  We do this by watching for
+`resize` events on the tty.  (To work around a bug in verisons of Node prior
+to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to
+larger window sizes will be clean, but shrinking the window will always
+result in some cruft.
+
+**IMPORTANT:** If you prevously were passing in a non-tty stream but you still
+want output (for example, a stream wrapped by the `ansi` module) then you
+need to pass in the **tty** option below, as `gauge` needs access to
+the underlying tty in order to do things like terminal resizes and terminal
+width detection.
+
+The **options** object can have the following properties, all of which are
+optional:
+
+* **updateInterval**: How often gauge updates should be drawn, in miliseconds.
+* **fixedFramerate**: Defaults to false on node 0.8, true on everything
+  else.  When this is true a timer is created to trigger once every
+  `updateInterval` ms, when false, updates are printed as soon as they come
+  in but updates more often than `updateInterval` are ignored.  The reason
+  0.8 doesn't have this set to true is that it can't `unref` its timer and
+  so it would stop your program from exiting– if you want to use this
+  feature with 0.8 just make sure you call `gauge.disable()` before you
+  expect your program to exit.
+* **themes**: A themeset to use when selecting the theme to use. Defaults
+  to `gauge/themes`, see the [themes] documentation for details.
+* **theme**: Select a theme for use, it can be a:
+  * Theme object, in which case the **themes** is not used.
+  * The name of a theme, which will be looked up in the current *themes*
+    object.
+  * A configuration object with any of `hasUnicode`, `hasColor` or
+    `platform` keys, which if wlll be used to override our guesses when making
+    a default theme selection.
+
+  If no theme is selected then a default is picked using a combination of our
+  best guesses at your OS, color support and unicode support.
+* **template**: Describes what you want your gauge to look like.  The
+  default is what npm uses.  Detailed [documentation] is later in this
+  document.
+* **hideCursor**: Defaults to true.  If true, then the cursor will be hidden
+  while the gauge is displayed.
+* **tty**: The tty that you're ultimately writing to.  Defaults to the same
+  as **stream**.  This is used for detecting the width of the terminal and
+  resizes. The width used is `tty.columns - 1`. If no tty is available then
+  a width of `79` is assumed.
+* **enabled**: Defaults to true if `tty` is a TTY, false otherwise.  If true
+  the gauge starts enabled.  If disabled then all update commands are
+  ignored and no gauge will be printed until you call `.enable()`.
+* **Plumbing**: The class to use to actually generate the gauge for
+  printing.  This defaults to `require('gauge/plumbing')` and ordinarly you
+  shouldn't need to override this.
+* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit
+  handler to make sure your cursor is turned back on and the progress bar
+  erased when your process exits, even if you Ctrl-C out or otherwise exit
+  unexpectedly. You can disable this and it won't register the exit handler.
+
+[has-unicode]: https://www.npmjs.com/package/has-unicode
+[themes]: #themes
+[documentation]: #templates
+
+#### `gauge.show(section | status, [completed])`
+
+The first argument is either the section, the name of the current thing
+contributing to progress, or an object with keys like **section**,
+**subsection** & **completed** (or any others you have types for in a custom
+template).  If you don't want to update or set any of these you can pass
+`null` and it will be ignored.
+
+The second argument is the percent completed as a value between 0 and 1.
+Without it, completion is just not updated. You'll also note that completion
+can be passed in as part of a status object as the first argument. If both
+it and the completed argument are passed in, the completed argument wins.
+
+#### `gauge.hide([cb])`
+
+Removes the gauge from the terminal.  Optionally, callback `cb` after IO has
+had an opportunity to happen (currently this just means after `setImmediate`
+has called back.)
+
+It turns out this is important when you're pausing the progress bar on one
+filehandle and printing to another– otherwise (with a big enough print) node
+can end up printing the "end progress bar" bits to the progress bar filehandle
+while other stuff is printing to another filehandle. These getting interleaved
+can cause corruption in some terminals.
+
+#### `gauge.pulse([subsection])`
+
+* **subsection** – *(optional)* The specific thing that triggered this pulse
+
+Spins the spinner in the gauge to show output.  If **subsection** is
+included then it will be combined with the last name passed to `gauge.show`.
+
+#### `gauge.disable()`
+
+Hides the gauge and ignores further calls to `show` or `pulse`.
+
+#### `gauge.enable()`
+
+Shows the gauge and resumes updating when `show` or `pulse` is called.
+
+#### `gauge.isEnabled()`
+
+Returns true if the gauge is enabled.
+
+#### `gauge.setThemeset(themes)`
+
+Change the themeset to select a theme from. The same as the `themes` option
+used in the constructor. The theme will be reselected from this themeset.
+
+#### `gauge.setTheme(theme)`
+
+Change the active theme, will be displayed with the next show or pulse. This can be:
+
+* Theme object, in which case the **themes** is not used.
+* The name of a theme, which will be looked up in the current *themes*
+  object.
+* A configuration object with any of `hasUnicode`, `hasColor` or
+  `platform` keys, which if wlll be used to override our guesses when making
+  a default theme selection.
+
+If no theme is selected then a default is picked using a combination of our
+best guesses at your OS, color support and unicode support.
+
+#### `gauge.setTemplate(template)`
+
+Change the active template, will be displayed with the next show or pulse
+
+### Tracking Completion
+
+If you have more than one thing going on that you want to track completion
+of, you may find the related [are-we-there-yet] helpful.  It's `change`
+event can be wired up to the `show` method to get a more traditional
+progress bar interface.
+
+[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet
+
+### THEMES
+
+```
+var themes = require('gauge/themes')
+
+// fetch the default color unicode theme for this platform
+var ourTheme = themes({hasUnicode: true, hasColor: true})
+
+// fetch the default non-color unicode theme for osx
+var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})
+
+// create a new theme based on the color ascii theme for this platform
+// that brackets the progress bar with arrows
+var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), {
+  preProgressbar: '→',
+  postProgressbar: '←'
+})
+```
+
+The object returned by `gauge/themes` is an instance of the `ThemeSet` class.
+
+```
+var ThemeSet = require('gauge/theme-set')
+var themes = new ThemeSet()
+// or
+var themes = require('gauge/themes')
+var mythemes = themes.newThemeset() // creates a new themeset based on the default themes
+```
+
+#### themes(opts)
+#### themes.getDefault(opts)
+
+Theme objects are a function that fetches the default theme based on
+platform, unicode and color support.
+
+Options is an object with the following properties:
+
+* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is
+  available then a non-unicode theme will be used.
+* **hasColor** - If true, fetch a color theme, if no color theme is
+  available a non-color theme will be used.
+* **platform** (optional) - Defaults to `process.platform`.  If no
+  platform match is available then `fallback` is used instead.
+
+If no compatible theme can be found then an error will be thrown with a
+`code` of `EMISSINGTHEME`.
+
+#### themes.addTheme(themeName, themeObj)
+#### themes.addTheme(themeName, [parentTheme], newTheme)
+
+Adds a named theme to the themeset.  You can pass in either a theme object,
+as returned by `themes.newTheme` or the arguments you'd pass to
+`themes.newTheme`.
+
+#### themes.getThemeNames()
+
+Return a list of all of the names of the themes in this themeset. Suitable
+for use in `themes.getTheme(…)`.
+
+#### themes.getTheme(name)
+
+Returns the theme object from this theme set named `name`.
+
+If `name` does not exist in this themeset an error will be thrown with
+a `code` of `EMISSINGTHEME`.
+
+#### themes.setDefault([opts], themeName)
+
+`opts` is an object with the following properties.
+
+* **platform** - Defaults to `'fallback'`.  If your theme is platform
+  specific, specify that here with the platform from `process.platform`, eg,
+  `win32`, `darwin`, etc.
+* **hasUnicode** - Defaults to `false`. If your theme uses unicode you
+  should set this to true.
+* **hasColor** - Defaults to `false`.  If your theme uses color you should
+  set this to true.
+
+`themeName` is the name of the theme (as given to `addTheme`) to use for
+this set of `opts`.
+
+#### themes.newTheme([parentTheme,] newTheme)
+
+Create a new theme object based on `parentTheme`.  If no `parentTheme` is
+provided then a minimal parentTheme that defines functions for rendering the
+activity indicator (spinner) and progress bar will be defined. (This
+fallback parent is defined in `gauge/base-theme`.)
+
+newTheme should be a bare object– we'll start by discussing the properties
+defined by the default themes:
+
+* **preProgressbar** - displayed prior to the progress bar, if the progress
+  bar is displayed.
+* **postProgressbar** - displayed after the progress bar, if the progress bar
+  is displayed.
+* **progressBarTheme** - The subtheme passed through to the progress bar
+  renderer, it's an object with `complete` and `remaining` properties
+  that are the strings you want repeated for those sections of the progress
+  bar.
+* **activityIndicatorTheme** - The theme for the activity indicator (spinner),
+  this can either be a string, in which each character is a different step, or
+  an array of strings.
+* **preSubsection** - Displayed as a separator between the `section` and
+  `subsection` when the latter is printed.
+
+More generally, themes can have any value that would be a valid value when rendering
+templates. The properties in the theme are used when their name matches a type in
+the template. Their values can be:
+
+* **strings & numbers** - They'll be included as is
+* **function (values, theme, width)** - Should return what you want in your output.
+  *values* is an object with values provided via `gauge.show`,
+  *theme* is the theme specific to this item (see below) or this theme object,
+  and *width* is the number of characters wide your result should be.
+
+There are a couple of special prefixes:
+
+* **pre** - Is shown prior to the property, if its displayed.
+* **post** - Is shown after the property, if its displayed.
+
+And one special suffix:
+
+* **Theme** - Its value is passed to a function-type item as the theme.
+
+#### themes.addToAllThemes(theme)
+
+This *mixes-in* `theme` into all themes currently defined. It also adds it
+to the default parent theme for this themeset, so future themes added to
+this themeset will get the values from `theme` by default.
+
+#### themes.newThemeset()
+
+Copy the current themeset into a new one.  This allows you to easily inherit
+one themeset from another.
+
+### TEMPLATES
+
+A template is an array of objects and strings that, after being evaluated,
+will be turned into the gauge line.  The default template is:
+
+```javascript
+[
+    {type: 'progressbar', length: 20},
+    {type: 'activityIndicator', kerning: 1, length: 1},
+    {type: 'section', kerning: 1, default: ''},
+    {type: 'subsection', kerning: 1, default: ''}
+]
+```
+
+The various template elements can either be **plain strings**, in which case they will
+be be included verbatum in the output, or objects with the following properties:
+
+* *type* can be any of the following plus any keys you pass into `gauge.show` plus
+  any keys you have on a custom theme.
+  * `section` – What big thing you're working on now.
+  * `subsection` – What component of that thing is currently working.
+  * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`
+    from your active theme.
+  * `progressbar` – A progress bar representing your current `completed`
+    using the `progressbarTheme` from your active theme.
+* *kerning* – Number of spaces that must be between this item and other
+  items, if this item is displayed at all.
+* *maxLength* – The maximum length for this element. If its value is longer it
+  will be truncated.
+* *minLength* – The minimum length for this element. If its value is shorter it
+  will be padded according to the *align* value.
+* *align* – (Default: left) Possible values "left", "right" and "center". Works
+  as you'd expect from word processors.
+* *length* – Provides a single value for both *minLength* and *maxLength*. If both
+  *length* and *minLength or *maxLength* are specifed then the latter take precedence.
+* *value* – A literal value to use for this template item.
+* *default* – A default value to use for this template item if a value
+  wasn't otherwise passed in.
+
+### PLUMBING
+
+This is the super simple, assume nothing, do no magic internals used by gauge to
+implement its ordinary interface.
+
+```
+var Plumbing = require('gauge/plumbing')
+var gauge = new Plumbing(theme, template, width)
+```
+
+* **theme**: The theme to use.
+* **template**: The template to use.
+* **width**: How wide your gauge should be
+
+#### `gauge.setTheme(theme)`
+
+Change the active theme.
+
+#### `gauge.setTemplate(template)`
+
+Change the active template.
+
+#### `gauge.setWidth(width)`
+
+Change the width to render at.
+
+#### `gauge.hide()`
+
+Return the string necessary to hide the progress bar
+
+#### `gauge.hideCursor()`
+
+Return a string to hide the cursor.
+
+#### `gauge.showCursor()`
+
+Return a string to show the cursor.
+
+#### `gauge.show(status)`
+
+Using `status` for values, render the provided template with the theme and return
+a string that is suitable for printing to update the gauge.
diff --git a/legacy-libs/grpc/node_modules/gauge/base-theme.js b/legacy-libs/grpc/node_modules/gauge/base-theme.js
new file mode 100644 (file)
index 0000000..0b67638
--- /dev/null
@@ -0,0 +1,14 @@
+'use strict'
+var spin = require('./spin.js')
+var progressBar = require('./progress-bar.js')
+
+module.exports = {
+  activityIndicator: function (values, theme, width) {
+    if (values.spun == null) return
+    return spin(theme, values.spun)
+  },
+  progressbar: function (values, theme, width) {
+    if (values.completed == null) return
+    return progressBar(theme, width, values.completed)
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/error.js b/legacy-libs/grpc/node_modules/gauge/error.js
new file mode 100644 (file)
index 0000000..d9914ba
--- /dev/null
@@ -0,0 +1,24 @@
+'use strict'
+var util = require('util')
+
+var User = exports.User = function User (msg) {
+  var err = new Error(msg)
+  Error.captureStackTrace(err, User)
+  err.code = 'EGAUGE'
+  return err
+}
+
+exports.MissingTemplateValue = function MissingTemplateValue (item, values) {
+  var err = new User(util.format('Missing template value "%s"', item.type))
+  Error.captureStackTrace(err, MissingTemplateValue)
+  err.template = item
+  err.values = values
+  return err
+}
+
+exports.Internal = function Internal (msg) {
+  var err = new Error(msg)
+  Error.captureStackTrace(err, Internal)
+  err.code = 'EGAUGEINTERNAL'
+  return err
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/has-color.js b/legacy-libs/grpc/node_modules/gauge/has-color.js
new file mode 100644 (file)
index 0000000..e283a25
--- /dev/null
@@ -0,0 +1,12 @@
+'use strict'
+
+module.exports = isWin32() || isColorTerm()
+
+function isWin32 () {
+  return process.platform === 'win32'
+}
+
+function isColorTerm () {
+  var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i
+  return !!process.env.COLORTERM || termHasColor.test(process.env.TERM)
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/index.js b/legacy-libs/grpc/node_modules/gauge/index.js
new file mode 100644 (file)
index 0000000..c553240
--- /dev/null
@@ -0,0 +1,233 @@
+'use strict'
+var Plumbing = require('./plumbing.js')
+var hasUnicode = require('has-unicode')
+var hasColor = require('./has-color.js')
+var onExit = require('signal-exit')
+var defaultThemes = require('./themes')
+var setInterval = require('./set-interval.js')
+var process = require('./process.js')
+var setImmediate = require('./set-immediate')
+
+module.exports = Gauge
+
+function callWith (obj, method) {
+  return function () {
+    return method.call(obj)
+  }
+}
+
+function Gauge (arg1, arg2) {
+  var options, writeTo
+  if (arg1 && arg1.write) {
+    writeTo = arg1
+    options = arg2 || {}
+  } else if (arg2 && arg2.write) {
+    writeTo = arg2
+    options = arg1 || {}
+  } else {
+    writeTo = process.stderr
+    options = arg1 || arg2 || {}
+  }
+
+  this._status = {
+    spun: 0,
+    section: '',
+    subsection: ''
+  }
+  this._paused = false // are we paused for back pressure?
+  this._disabled = true // are all progress bar updates disabled?
+  this._showing = false // do we WANT the progress bar on screen
+  this._onScreen = false // IS the progress bar on screen
+  this._needsRedraw = false // should we print something at next tick?
+  this._hideCursor = options.hideCursor == null ? true : options.hideCursor
+  this._fixedFramerate = options.fixedFramerate == null
+    ? !(/^v0\.8\./.test(process.version))
+    : options.fixedFramerate
+  this._lastUpdateAt = null
+  this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval
+
+  this._themes = options.themes || defaultThemes
+  this._theme = options.theme
+  var theme = this._computeTheme(options.theme)
+  var template = options.template || [
+    {type: 'progressbar', length: 20},
+    {type: 'activityIndicator', kerning: 1, length: 1},
+    {type: 'section', kerning: 1, default: ''},
+    {type: 'subsection', kerning: 1, default: ''}
+  ]
+  this.setWriteTo(writeTo, options.tty)
+  var PlumbingClass = options.Plumbing || Plumbing
+  this._gauge = new PlumbingClass(theme, template, this.getWidth())
+
+  this._$$doRedraw = callWith(this, this._doRedraw)
+  this._$$handleSizeChange = callWith(this, this._handleSizeChange)
+
+  this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit
+  this._removeOnExit = null
+
+  if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) {
+    this.enable()
+  } else {
+    this.disable()
+  }
+}
+Gauge.prototype = {}
+
+Gauge.prototype.isEnabled = function () {
+  return !this._disabled
+}
+
+Gauge.prototype.setTemplate = function (template) {
+  this._gauge.setTemplate(template)
+  if (this._showing) this._requestRedraw()
+}
+
+Gauge.prototype._computeTheme = function (theme) {
+  if (!theme) theme = {}
+  if (typeof theme === 'string') {
+    theme = this._themes.getTheme(theme)
+  } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) {
+    var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode
+    var useColor = theme.hasColor == null ? hasColor : theme.hasColor
+    theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform})
+  }
+  return theme
+}
+
+Gauge.prototype.setThemeset = function (themes) {
+  this._themes = themes
+  this.setTheme(this._theme)
+}
+
+Gauge.prototype.setTheme = function (theme) {
+  this._gauge.setTheme(this._computeTheme(theme))
+  if (this._showing) this._requestRedraw()
+  this._theme = theme
+}
+
+Gauge.prototype._requestRedraw = function () {
+  this._needsRedraw = true
+  if (!this._fixedFramerate) this._doRedraw()
+}
+
+Gauge.prototype.getWidth = function () {
+  return ((this._tty && this._tty.columns) || 80) - 1
+}
+
+Gauge.prototype.setWriteTo = function (writeTo, tty) {
+  var enabled = !this._disabled
+  if (enabled) this.disable()
+  this._writeTo = writeTo
+  this._tty = tty ||
+    (writeTo === process.stderr && process.stdout.isTTY && process.stdout) ||
+    (writeTo.isTTY && writeTo) ||
+    this._tty
+  if (this._gauge) this._gauge.setWidth(this.getWidth())
+  if (enabled) this.enable()
+}
+
+Gauge.prototype.enable = function () {
+  if (!this._disabled) return
+  this._disabled = false
+  if (this._tty) this._enableEvents()
+  if (this._showing) this.show()
+}
+
+Gauge.prototype.disable = function () {
+  if (this._disabled) return
+  if (this._showing) {
+    this._lastUpdateAt = null
+    this._showing = false
+    this._doRedraw()
+    this._showing = true
+  }
+  this._disabled = true
+  if (this._tty) this._disableEvents()
+}
+
+Gauge.prototype._enableEvents = function () {
+  if (this._cleanupOnExit) {
+    this._removeOnExit = onExit(callWith(this, this.disable))
+  }
+  this._tty.on('resize', this._$$handleSizeChange)
+  if (this._fixedFramerate) {
+    this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval)
+    if (this.redrawTracker.unref) this.redrawTracker.unref()
+  }
+}
+
+Gauge.prototype._disableEvents = function () {
+  this._tty.removeListener('resize', this._$$handleSizeChange)
+  if (this._fixedFramerate) clearInterval(this.redrawTracker)
+  if (this._removeOnExit) this._removeOnExit()
+}
+
+Gauge.prototype.hide = function (cb) {
+  if (this._disabled) return cb && process.nextTick(cb)
+  if (!this._showing) return cb && process.nextTick(cb)
+  this._showing = false
+  this._doRedraw()
+  cb && setImmediate(cb)
+}
+
+Gauge.prototype.show = function (section, completed) {
+  this._showing = true
+  if (typeof section === 'string') {
+    this._status.section = section
+  } else if (typeof section === 'object') {
+    var sectionKeys = Object.keys(section)
+    for (var ii = 0; ii < sectionKeys.length; ++ii) {
+      var key = sectionKeys[ii]
+      this._status[key] = section[key]
+    }
+  }
+  if (completed != null) this._status.completed = completed
+  if (this._disabled) return
+  this._requestRedraw()
+}
+
+Gauge.prototype.pulse = function (subsection) {
+  this._status.subsection = subsection || ''
+  this._status.spun ++
+  if (this._disabled) return
+  if (!this._showing) return
+  this._requestRedraw()
+}
+
+Gauge.prototype._handleSizeChange = function () {
+  this._gauge.setWidth(this._tty.columns - 1)
+  this._requestRedraw()
+}
+
+Gauge.prototype._doRedraw = function () {
+  if (this._disabled || this._paused) return
+  if (!this._fixedFramerate) {
+    var now = Date.now()
+    if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return
+    this._lastUpdateAt = now
+  }
+  if (!this._showing && this._onScreen) {
+    this._onScreen = false
+    var result = this._gauge.hide()
+    if (this._hideCursor) {
+      result += this._gauge.showCursor()
+    }
+    return this._writeTo.write(result)
+  }
+  if (!this._showing && !this._onScreen) return
+  if (this._showing && !this._onScreen) {
+    this._onScreen = true
+    this._needsRedraw = true
+    if (this._hideCursor) {
+      this._writeTo.write(this._gauge.hideCursor())
+    }
+  }
+  if (!this._needsRedraw) return
+  if (!this._writeTo.write(this._gauge.show(this._status))) {
+    this._paused = true
+    this._writeTo.on('drain', callWith(this, function () {
+      this._paused = false
+      this._doRedraw()
+    }))
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/package.json b/legacy-libs/grpc/node_modules/gauge/package.json
new file mode 100644 (file)
index 0000000..e4549ce
--- /dev/null
@@ -0,0 +1,98 @@
+{
+  "_args": [
+    [
+      "gauge@2.7.4",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "gauge@2.7.4",
+  "_id": "gauge@2.7.4",
+  "_inBundle": false,
+  "_integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
+  "_location": "/grpc/gauge",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "gauge@2.7.4",
+    "name": "gauge",
+    "escapedName": "gauge",
+    "rawSpec": "2.7.4",
+    "saveSpec": null,
+    "fetchSpec": "2.7.4"
+  },
+  "_requiredBy": [
+    "/grpc/npmlog"
+  ],
+  "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.7.4",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Rebecca Turner",
+    "email": "me@re-becca.org"
+  },
+  "bugs": {
+    "url": "https://github.com/iarna/gauge/issues"
+  },
+  "dependencies": {
+    "aproba": "^1.0.3",
+    "console-control-strings": "^1.0.0",
+    "has-unicode": "^2.0.0",
+    "object-assign": "^4.1.0",
+    "signal-exit": "^3.0.0",
+    "string-width": "^1.0.1",
+    "strip-ansi": "^3.0.1",
+    "wide-align": "^1.1.0"
+  },
+  "description": "A terminal based horizontal guage",
+  "devDependencies": {
+    "readable-stream": "^2.0.6",
+    "require-inject": "^1.4.0",
+    "standard": "^7.1.2",
+    "tap": "^5.7.2",
+    "through2": "^2.0.0"
+  },
+  "files": [
+    "base-theme.js",
+    "CHANGELOG.md",
+    "error.js",
+    "has-color.js",
+    "index.js",
+    "LICENSE",
+    "package.json",
+    "plumbing.js",
+    "process.js",
+    "progress-bar.js",
+    "README.md",
+    "render-template.js",
+    "set-immediate.js",
+    "set-interval.js",
+    "spin.js",
+    "template-item.js",
+    "theme-set.js",
+    "themes.js",
+    "wide-truncate.js"
+  ],
+  "homepage": "https://github.com/iarna/gauge",
+  "keywords": [
+    "progressbar",
+    "progress",
+    "gauge"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "gauge",
+  "optionalDependencies": {},
+  "readme": "gauge\n=====\n\nA nearly stateless terminal based horizontal gauge / progress bar.\n\n```javascript\nvar Gauge = require(\"gauge\")\n\nvar gauge = new Gauge()\n\ngauge.show(\"test\", 0.20)\n\ngauge.pulse(\"this\")\n\ngauge.hide()\n```\n\n![](gauge-demo.gif)\n\n\n### CHANGES FROM 1.x\n\nGauge 2.x is breaking release, please see the [changelog] for details on\nwhat's changed if you were previously a user of this module.\n\n[changelog]: CHANGELOG.md\n\n### THE GAUGE CLASS\n\nThis is the typical interface to the module– it provides a pretty\nfire-and-forget interface to displaying your status information.\n\n```\nvar Gauge = require(\"gauge\")\n\nvar gauge = new Gauge([stream], [options])\n```\n\n* **stream** – *(optional, default STDERR)* A stream that progress bar\n  updates are to be written to.  Gauge honors backpressure and will pause\n  most writing if it is indicated.\n* **options** – *(optional)* An option object.\n\nConstructs a new gauge. Gauges are drawn on a single line, and are not drawn\nif **stream** isn't a tty and a tty isn't explicitly provided.\n\nIf **stream** is a terminal or if you pass in **tty** to **options** then we\nwill detect terminal resizes and redraw to fit.  We do this by watching for\n`resize` events on the tty.  (To work around a bug in verisons of Node prior\nto 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to\nlarger window sizes will be clean, but shrinking the window will always\nresult in some cruft.\n\n**IMPORTANT:** If you prevously were passing in a non-tty stream but you still\nwant output (for example, a stream wrapped by the `ansi` module) then you\nneed to pass in the **tty** option below, as `gauge` needs access to\nthe underlying tty in order to do things like terminal resizes and terminal\nwidth detection.\n\nThe **options** object can have the following properties, all of which are\noptional:\n\n* **updateInterval**: How often gauge updates should be drawn, in miliseconds.\n* **fixedFramerate**: Defaults to false on node 0.8, true on everything\n  else.  When this is true a timer is created to trigger once every\n  `updateInterval` ms, when false, updates are printed as soon as they come\n  in but updates more often than `updateInterval` are ignored.  The reason\n  0.8 doesn't have this set to true is that it can't `unref` its timer and\n  so it would stop your program from exiting– if you want to use this\n  feature with 0.8 just make sure you call `gauge.disable()` before you\n  expect your program to exit.\n* **themes**: A themeset to use when selecting the theme to use. Defaults\n  to `gauge/themes`, see the [themes] documentation for details.\n* **theme**: Select a theme for use, it can be a:\n  * Theme object, in which case the **themes** is not used.\n  * The name of a theme, which will be looked up in the current *themes*\n    object.\n  * A configuration object with any of `hasUnicode`, `hasColor` or\n    `platform` keys, which if wlll be used to override our guesses when making\n    a default theme selection.\n\n  If no theme is selected then a default is picked using a combination of our\n  best guesses at your OS, color support and unicode support.\n* **template**: Describes what you want your gauge to look like.  The\n  default is what npm uses.  Detailed [documentation] is later in this\n  document.\n* **hideCursor**: Defaults to true.  If true, then the cursor will be hidden\n  while the gauge is displayed.\n* **tty**: The tty that you're ultimately writing to.  Defaults to the same\n  as **stream**.  This is used for detecting the width of the terminal and\n  resizes. The width used is `tty.columns - 1`. If no tty is available then\n  a width of `79` is assumed.\n* **enabled**: Defaults to true if `tty` is a TTY, false otherwise.  If true\n  the gauge starts enabled.  If disabled then all update commands are\n  ignored and no gauge will be printed until you call `.enable()`.\n* **Plumbing**: The class to use to actually generate the gauge for\n  printing.  This defaults to `require('gauge/plumbing')` and ordinarly you\n  shouldn't need to override this.\n* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit\n  handler to make sure your cursor is turned back on and the progress bar\n  erased when your process exits, even if you Ctrl-C out or otherwise exit\n  unexpectedly. You can disable this and it won't register the exit handler.\n\n[has-unicode]: https://www.npmjs.com/package/has-unicode\n[themes]: #themes\n[documentation]: #templates\n\n#### `gauge.show(section | status, [completed])`\n\nThe first argument is either the section, the name of the current thing\ncontributing to progress, or an object with keys like **section**,\n**subsection** & **completed** (or any others you have types for in a custom\ntemplate).  If you don't want to update or set any of these you can pass\n`null` and it will be ignored.\n\nThe second argument is the percent completed as a value between 0 and 1.\nWithout it, completion is just not updated. You'll also note that completion\ncan be passed in as part of a status object as the first argument. If both\nit and the completed argument are passed in, the completed argument wins.\n\n#### `gauge.hide([cb])`\n\nRemoves the gauge from the terminal.  Optionally, callback `cb` after IO has\nhad an opportunity to happen (currently this just means after `setImmediate`\nhas called back.)\n\nIt turns out this is important when you're pausing the progress bar on one\nfilehandle and printing to another– otherwise (with a big enough print) node\ncan end up printing the \"end progress bar\" bits to the progress bar filehandle\nwhile other stuff is printing to another filehandle. These getting interleaved\ncan cause corruption in some terminals.\n\n#### `gauge.pulse([subsection])`\n\n* **subsection** – *(optional)* The specific thing that triggered this pulse\n\nSpins the spinner in the gauge to show output.  If **subsection** is\nincluded then it will be combined with the last name passed to `gauge.show`.\n\n#### `gauge.disable()`\n\nHides the gauge and ignores further calls to `show` or `pulse`.\n\n#### `gauge.enable()`\n\nShows the gauge and resumes updating when `show` or `pulse` is called.\n\n#### `gauge.isEnabled()`\n\nReturns true if the gauge is enabled.\n\n#### `gauge.setThemeset(themes)`\n\nChange the themeset to select a theme from. The same as the `themes` option\nused in the constructor. The theme will be reselected from this themeset.\n\n#### `gauge.setTheme(theme)`\n\nChange the active theme, will be displayed with the next show or pulse. This can be:\n\n* Theme object, in which case the **themes** is not used.\n* The name of a theme, which will be looked up in the current *themes*\n  object.\n* A configuration object with any of `hasUnicode`, `hasColor` or\n  `platform` keys, which if wlll be used to override our guesses when making\n  a default theme selection.\n\nIf no theme is selected then a default is picked using a combination of our\nbest guesses at your OS, color support and unicode support.\n\n#### `gauge.setTemplate(template)`\n\nChange the active template, will be displayed with the next show or pulse\n\n### Tracking Completion\n\nIf you have more than one thing going on that you want to track completion\nof, you may find the related [are-we-there-yet] helpful.  It's `change`\nevent can be wired up to the `show` method to get a more traditional\nprogress bar interface.\n\n[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet\n\n### THEMES\n\n```\nvar themes = require('gauge/themes')\n\n// fetch the default color unicode theme for this platform\nvar ourTheme = themes({hasUnicode: true, hasColor: true})\n\n// fetch the default non-color unicode theme for osx\nvar ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})\n\n// create a new theme based on the color ascii theme for this platform\n// that brackets the progress bar with arrows\nvar ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), {\n  preProgressbar: '→',\n  postProgressbar: '←'\n})\n```\n\nThe object returned by `gauge/themes` is an instance of the `ThemeSet` class.\n\n```\nvar ThemeSet = require('gauge/theme-set')\nvar themes = new ThemeSet()\n// or\nvar themes = require('gauge/themes')\nvar mythemes = themes.newThemeset() // creates a new themeset based on the default themes\n```\n\n#### themes(opts)\n#### themes.getDefault(opts)\n\nTheme objects are a function that fetches the default theme based on\nplatform, unicode and color support.\n\nOptions is an object with the following properties:\n\n* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is\n  available then a non-unicode theme will be used.\n* **hasColor** - If true, fetch a color theme, if no color theme is\n  available a non-color theme will be used.\n* **platform** (optional) - Defaults to `process.platform`.  If no\n  platform match is available then `fallback` is used instead.\n\nIf no compatible theme can be found then an error will be thrown with a\n`code` of `EMISSINGTHEME`.\n\n#### themes.addTheme(themeName, themeObj)\n#### themes.addTheme(themeName, [parentTheme], newTheme)\n\nAdds a named theme to the themeset.  You can pass in either a theme object,\nas returned by `themes.newTheme` or the arguments you'd pass to\n`themes.newTheme`.\n\n#### themes.getThemeNames()\n\nReturn a list of all of the names of the themes in this themeset. Suitable\nfor use in `themes.getTheme(…)`.\n\n#### themes.getTheme(name)\n\nReturns the theme object from this theme set named `name`.\n\nIf `name` does not exist in this themeset an error will be thrown with\na `code` of `EMISSINGTHEME`.\n\n#### themes.setDefault([opts], themeName)\n\n`opts` is an object with the following properties.\n\n* **platform** - Defaults to `'fallback'`.  If your theme is platform\n  specific, specify that here with the platform from `process.platform`, eg,\n  `win32`, `darwin`, etc.\n* **hasUnicode** - Defaults to `false`. If your theme uses unicode you\n  should set this to true.\n* **hasColor** - Defaults to `false`.  If your theme uses color you should\n  set this to true.\n\n`themeName` is the name of the theme (as given to `addTheme`) to use for\nthis set of `opts`.\n\n#### themes.newTheme([parentTheme,] newTheme)\n\nCreate a new theme object based on `parentTheme`.  If no `parentTheme` is\nprovided then a minimal parentTheme that defines functions for rendering the\nactivity indicator (spinner) and progress bar will be defined. (This\nfallback parent is defined in `gauge/base-theme`.)\n\nnewTheme should be a bare object– we'll start by discussing the properties\ndefined by the default themes:\n\n* **preProgressbar** - displayed prior to the progress bar, if the progress\n  bar is displayed.\n* **postProgressbar** - displayed after the progress bar, if the progress bar\n  is displayed.\n* **progressBarTheme** - The subtheme passed through to the progress bar\n  renderer, it's an object with `complete` and `remaining` properties\n  that are the strings you want repeated for those sections of the progress\n  bar.\n* **activityIndicatorTheme** - The theme for the activity indicator (spinner),\n  this can either be a string, in which each character is a different step, or\n  an array of strings.\n* **preSubsection** - Displayed as a separator between the `section` and\n  `subsection` when the latter is printed.\n\nMore generally, themes can have any value that would be a valid value when rendering\ntemplates. The properties in the theme are used when their name matches a type in\nthe template. Their values can be:\n\n* **strings & numbers** - They'll be included as is\n* **function (values, theme, width)** - Should return what you want in your output.\n  *values* is an object with values provided via `gauge.show`,\n  *theme* is the theme specific to this item (see below) or this theme object,\n  and *width* is the number of characters wide your result should be.\n\nThere are a couple of special prefixes:\n\n* **pre** - Is shown prior to the property, if its displayed.\n* **post** - Is shown after the property, if its displayed.\n\nAnd one special suffix:\n\n* **Theme** - Its value is passed to a function-type item as the theme.\n\n#### themes.addToAllThemes(theme)\n\nThis *mixes-in* `theme` into all themes currently defined. It also adds it\nto the default parent theme for this themeset, so future themes added to\nthis themeset will get the values from `theme` by default.\n\n#### themes.newThemeset()\n\nCopy the current themeset into a new one.  This allows you to easily inherit\none themeset from another.\n\n### TEMPLATES\n\nA template is an array of objects and strings that, after being evaluated,\nwill be turned into the gauge line.  The default template is:\n\n```javascript\n[\n    {type: 'progressbar', length: 20},\n    {type: 'activityIndicator', kerning: 1, length: 1},\n    {type: 'section', kerning: 1, default: ''},\n    {type: 'subsection', kerning: 1, default: ''}\n]\n```\n\nThe various template elements can either be **plain strings**, in which case they will\nbe be included verbatum in the output, or objects with the following properties:\n\n* *type* can be any of the following plus any keys you pass into `gauge.show` plus\n  any keys you have on a custom theme.\n  * `section` – What big thing you're working on now.\n  * `subsection` – What component of that thing is currently working.\n  * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`\n    from your active theme.\n  * `progressbar` – A progress bar representing your current `completed`\n    using the `progressbarTheme` from your active theme.\n* *kerning* – Number of spaces that must be between this item and other\n  items, if this item is displayed at all.\n* *maxLength* – The maximum length for this element. If its value is longer it\n  will be truncated.\n* *minLength* – The minimum length for this element. If its value is shorter it\n  will be padded according to the *align* value.\n* *align* – (Default: left) Possible values \"left\", \"right\" and \"center\". Works\n  as you'd expect from word processors.\n* *length* – Provides a single value for both *minLength* and *maxLength*. If both\n  *length* and *minLength or *maxLength* are specifed then the latter take precedence.\n* *value* – A literal value to use for this template item.\n* *default* – A default value to use for this template item if a value\n  wasn't otherwise passed in.\n\n### PLUMBING\n\nThis is the super simple, assume nothing, do no magic internals used by gauge to\nimplement its ordinary interface.\n\n```\nvar Plumbing = require('gauge/plumbing')\nvar gauge = new Plumbing(theme, template, width)\n```\n\n* **theme**: The theme to use.\n* **template**: The template to use.\n* **width**: How wide your gauge should be\n\n#### `gauge.setTheme(theme)`\n\nChange the active theme.\n\n#### `gauge.setTemplate(template)`\n\nChange the active template.\n\n#### `gauge.setWidth(width)`\n\nChange the width to render at.\n\n#### `gauge.hide()`\n\nReturn the string necessary to hide the progress bar\n\n#### `gauge.hideCursor()`\n\nReturn a string to hide the cursor.\n\n#### `gauge.showCursor()`\n\nReturn a string to show the cursor.\n\n#### `gauge.show(status)`\n\nUsing `status` for values, render the provided template with the theme and return\na string that is suitable for printing to update the gauge.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iarna/gauge.git"
+  },
+  "scripts": {
+    "prepublish": "rm -f *~",
+    "test": "standard && tap test/*.js --coverage"
+  },
+  "version": "2.7.4"
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/plumbing.js b/legacy-libs/grpc/node_modules/gauge/plumbing.js
new file mode 100644 (file)
index 0000000..1afb4af
--- /dev/null
@@ -0,0 +1,48 @@
+'use strict'
+var consoleControl = require('console-control-strings')
+var renderTemplate = require('./render-template.js')
+var validate = require('aproba')
+
+var Plumbing = module.exports = function (theme, template, width) {
+  if (!width) width = 80
+  validate('OAN', [theme, template, width])
+  this.showing = false
+  this.theme = theme
+  this.width = width
+  this.template = template
+}
+Plumbing.prototype = {}
+
+Plumbing.prototype.setTheme = function (theme) {
+  validate('O', [theme])
+  this.theme = theme
+}
+
+Plumbing.prototype.setTemplate = function (template) {
+  validate('A', [template])
+  this.template = template
+}
+
+Plumbing.prototype.setWidth = function (width) {
+  validate('N', [width])
+  this.width = width
+}
+
+Plumbing.prototype.hide = function () {
+  return consoleControl.gotoSOL() + consoleControl.eraseLine()
+}
+
+Plumbing.prototype.hideCursor = consoleControl.hideCursor
+
+Plumbing.prototype.showCursor = consoleControl.showCursor
+
+Plumbing.prototype.show = function (status) {
+  var values = Object.create(this.theme)
+  for (var key in status) {
+    values[key] = status[key]
+  }
+
+  return renderTemplate(this.width, this.template, values).trim() +
+         consoleControl.color('reset') +
+         consoleControl.eraseLine() + consoleControl.gotoSOL()
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/process.js b/legacy-libs/grpc/node_modules/gauge/process.js
new file mode 100644 (file)
index 0000000..05e8569
--- /dev/null
@@ -0,0 +1,3 @@
+'use strict'
+// this exists so we can replace it during testing
+module.exports = process
diff --git a/legacy-libs/grpc/node_modules/gauge/progress-bar.js b/legacy-libs/grpc/node_modules/gauge/progress-bar.js
new file mode 100644 (file)
index 0000000..7f8dd68
--- /dev/null
@@ -0,0 +1,35 @@
+'use strict'
+var validate = require('aproba')
+var renderTemplate = require('./render-template.js')
+var wideTruncate = require('./wide-truncate')
+var stringWidth = require('string-width')
+
+module.exports = function (theme, width, completed) {
+  validate('ONN', [theme, width, completed])
+  if (completed < 0) completed = 0
+  if (completed > 1) completed = 1
+  if (width <= 0) return ''
+  var sofar = Math.round(width * completed)
+  var rest = width - sofar
+  var template = [
+    {type: 'complete', value: repeat(theme.complete, sofar), length: sofar},
+    {type: 'remaining', value: repeat(theme.remaining, rest), length: rest}
+  ]
+  return renderTemplate(width, template, theme)
+}
+
+// lodash's way of repeating
+function repeat (string, width) {
+  var result = ''
+  var n = width
+  do {
+    if (n % 2) {
+      result += string
+    }
+    n = Math.floor(n / 2)
+    /*eslint no-self-assign: 0*/
+    string += string
+  } while (n && stringWidth(result) < width)
+
+  return wideTruncate(result, width)
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/render-template.js b/legacy-libs/grpc/node_modules/gauge/render-template.js
new file mode 100644 (file)
index 0000000..3261bfb
--- /dev/null
@@ -0,0 +1,181 @@
+'use strict'
+var align = require('wide-align')
+var validate = require('aproba')
+var objectAssign = require('object-assign')
+var wideTruncate = require('./wide-truncate')
+var error = require('./error')
+var TemplateItem = require('./template-item')
+
+function renderValueWithValues (values) {
+  return function (item) {
+    return renderValue(item, values)
+  }
+}
+
+var renderTemplate = module.exports = function (width, template, values) {
+  var items = prepareItems(width, template, values)
+  var rendered = items.map(renderValueWithValues(values)).join('')
+  return align.left(wideTruncate(rendered, width), width)
+}
+
+function preType (item) {
+  var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1)
+  return 'pre' + cappedTypeName
+}
+
+function postType (item) {
+  var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1)
+  return 'post' + cappedTypeName
+}
+
+function hasPreOrPost (item, values) {
+  if (!item.type) return
+  return values[preType(item)] || values[postType(item)]
+}
+
+function generatePreAndPost (baseItem, parentValues) {
+  var item = objectAssign({}, baseItem)
+  var values = Object.create(parentValues)
+  var template = []
+  var pre = preType(item)
+  var post = postType(item)
+  if (values[pre]) {
+    template.push({value: values[pre]})
+    values[pre] = null
+  }
+  item.minLength = null
+  item.length = null
+  item.maxLength = null
+  template.push(item)
+  values[item.type] = values[item.type]
+  if (values[post]) {
+    template.push({value: values[post]})
+    values[post] = null
+  }
+  return function ($1, $2, length) {
+    return renderTemplate(length, template, values)
+  }
+}
+
+function prepareItems (width, template, values) {
+  function cloneAndObjectify (item, index, arr) {
+    var cloned = new TemplateItem(item, width)
+    var type = cloned.type
+    if (cloned.value == null) {
+      if (!(type in values)) {
+        if (cloned.default == null) {
+          throw new error.MissingTemplateValue(cloned, values)
+        } else {
+          cloned.value = cloned.default
+        }
+      } else {
+        cloned.value = values[type]
+      }
+    }
+    if (cloned.value == null || cloned.value === '') return null
+    cloned.index = index
+    cloned.first = index === 0
+    cloned.last = index === arr.length - 1
+    if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values)
+    return cloned
+  }
+
+  var output = template.map(cloneAndObjectify).filter(function (item) { return item != null })
+
+  var outputLength = 0
+  var remainingSpace = width
+  var variableCount = output.length
+
+  function consumeSpace (length) {
+    if (length > remainingSpace) length = remainingSpace
+    outputLength += length
+    remainingSpace -= length
+  }
+
+  function finishSizing (item, length) {
+    if (item.finished) throw new error.Internal('Tried to finish template item that was already finished')
+    if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity')
+    if (length != null) item.length = length
+    item.minLength = null
+    item.maxLength = null
+    --variableCount
+    item.finished = true
+    if (item.length == null) item.length = item.getBaseLength()
+    if (item.length == null) throw new error.Internal('Finished template items must have a length')
+    consumeSpace(item.getLength())
+  }
+
+  output.forEach(function (item) {
+    if (!item.kerning) return
+    var prevPadRight = item.first ? 0 : output[item.index - 1].padRight
+    if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight
+    if (!item.last) item.padRight = item.kerning
+  })
+
+  // Finish any that have a fixed (literal or intuited) length
+  output.forEach(function (item) {
+    if (item.getBaseLength() == null) return
+    finishSizing(item)
+  })
+
+  var resized = 0
+  var resizing
+  var hunkSize
+  do {
+    resizing = false
+    hunkSize = Math.round(remainingSpace / variableCount)
+    output.forEach(function (item) {
+      if (item.finished) return
+      if (!item.maxLength) return
+      if (item.getMaxLength() < hunkSize) {
+        finishSizing(item, item.maxLength)
+        resizing = true
+      }
+    })
+  } while (resizing && resized++ < output.length)
+  if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength')
+
+  resized = 0
+  do {
+    resizing = false
+    hunkSize = Math.round(remainingSpace / variableCount)
+    output.forEach(function (item) {
+      if (item.finished) return
+      if (!item.minLength) return
+      if (item.getMinLength() >= hunkSize) {
+        finishSizing(item, item.minLength)
+        resizing = true
+      }
+    })
+  } while (resizing && resized++ < output.length)
+  if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength')
+
+  hunkSize = Math.round(remainingSpace / variableCount)
+  output.forEach(function (item) {
+    if (item.finished) return
+    finishSizing(item, hunkSize)
+  })
+
+  return output
+}
+
+function renderFunction (item, values, length) {
+  validate('OON', arguments)
+  if (item.type) {
+    return item.value(values, values[item.type + 'Theme'] || {}, length)
+  } else {
+    return item.value(values, {}, length)
+  }
+}
+
+function renderValue (item, values) {
+  var length = item.getBaseLength()
+  var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value
+  if (value == null || value === '') return ''
+  var alignWith = align[item.align] || align.left
+  var leftPadding = item.padLeft ? align.left('', item.padLeft) : ''
+  var rightPadding = item.padRight ? align.right('', item.padRight) : ''
+  var truncated = wideTruncate(String(value), length)
+  var aligned = alignWith(truncated, length)
+  return leftPadding + aligned + rightPadding
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/set-immediate.js b/legacy-libs/grpc/node_modules/gauge/set-immediate.js
new file mode 100644 (file)
index 0000000..6650a48
--- /dev/null
@@ -0,0 +1,7 @@
+'use strict'
+var process = require('./process')
+try {
+  module.exports = setImmediate
+} catch (ex) {
+  module.exports = process.nextTick
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/set-interval.js b/legacy-libs/grpc/node_modules/gauge/set-interval.js
new file mode 100644 (file)
index 0000000..5761987
--- /dev/null
@@ -0,0 +1,3 @@
+'use strict'
+// this exists so we can replace it during testing
+module.exports = setInterval
diff --git a/legacy-libs/grpc/node_modules/gauge/spin.js b/legacy-libs/grpc/node_modules/gauge/spin.js
new file mode 100644 (file)
index 0000000..34142ee
--- /dev/null
@@ -0,0 +1,5 @@
+'use strict'
+
+module.exports = function spin (spinstr, spun) {
+  return spinstr[spun % spinstr.length]
+}
diff --git a/legacy-libs/grpc/node_modules/gauge/template-item.js b/legacy-libs/grpc/node_modules/gauge/template-item.js
new file mode 100644 (file)
index 0000000..e46f447
--- /dev/null
@@ -0,0 +1,73 @@
+'use strict'
+var stringWidth = require('string-width')
+
+module.exports = TemplateItem
+
+function isPercent (num) {
+  if (typeof num !== 'string') return false
+  return num.slice(-1) === '%'
+}
+
+function percent (num) {
+  return Number(num.slice(0, -1)) / 100
+}
+
+function TemplateItem (values, outputLength) {
+  this.overallOutputLength = outputLength
+  this.finished = false
+  this.type = null
+  this.value = null
+  this.length = null
+  this.maxLength = null
+  this.minLength = null
+  this.kerning = null
+  this.align = 'left'
+  this.padLeft = 0
+  this.padRight = 0
+  this.index = null
+  this.first = null
+  this.last = null
+  if (typeof values === 'string') {
+    this.value = values
+  } else {
+    for (var prop in values) this[prop] = values[prop]
+  }
+  // Realize percents
+  if (isPercent(this.length)) {
+    this.length = Math.round(this.overallOutputLength * percent(this.length))
+  }
+  if (isPercent(this.minLength)) {
+    this.minLength = Math.round(this.overallOutputLength * percent(this.minLength))
+  }
+  if (isPercent(this.maxLength)) {
+    this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength))
+  }
+  return this
+}
+
+TemplateItem.prototype = {}
+
+TemplateItem.prototype.getBaseLength = function () {
+  var length = this.length
+  if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) {
+    length = stringWidth(this.value)
+  }
+  return length
+}
+
+TemplateItem.prototype.getLength = function () {
+  var length = this.getBaseLength()
+  if (length == null) return null
+  return length + this.padLeft + this.padRight
+}
+
+TemplateItem.prototype.getMaxLength = function () {
+  if (this.maxLength == null) return null
+  return this.maxLength + this.padLeft + this.padRight
+}
+
+TemplateItem.prototype.getMinLength = function () {
+  if (this.minLength == null) return null
+  return this.minLength + this.padLeft + this.padRight
+}
+
diff --git a/legacy-libs/grpc/node_modules/gauge/theme-set.js b/legacy-libs/grpc/node_modules/gauge/theme-set.js
new file mode 100644 (file)
index 0000000..68971d5
--- /dev/null
@@ -0,0 +1,115 @@
+'use strict'
+var objectAssign = require('object-assign')
+
+module.exports = function () {
+  return ThemeSetProto.newThemeSet()
+}
+
+var ThemeSetProto = {}
+
+ThemeSetProto.baseTheme = require('./base-theme.js')
+
+ThemeSetProto.newTheme = function (parent, theme) {
+  if (!theme) {
+    theme = parent
+    parent = this.baseTheme
+  }
+  return objectAssign({}, parent, theme)
+}
+
+ThemeSetProto.getThemeNames = function () {
+  return Object.keys(this.themes)
+}
+
+ThemeSetProto.addTheme = function (name, parent, theme) {
+  this.themes[name] = this.newTheme(parent, theme)
+}
+
+ThemeSetProto.addToAllThemes = function (theme) {
+  var themes = this.themes
+  Object.keys(themes).forEach(function (name) {
+    objectAssign(themes[name], theme)
+  })
+  objectAssign(this.baseTheme, theme)
+}
+
+ThemeSetProto.getTheme = function (name) {
+  if (!this.themes[name]) throw this.newMissingThemeError(name)
+  return this.themes[name]
+}
+
+ThemeSetProto.setDefault = function (opts, name) {
+  if (name == null) {
+    name = opts
+    opts = {}
+  }
+  var platform = opts.platform == null ? 'fallback' : opts.platform
+  var hasUnicode = !!opts.hasUnicode
+  var hasColor = !!opts.hasColor
+  if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}}
+  this.defaults[platform][hasUnicode][hasColor] = name
+}
+
+ThemeSetProto.getDefault = function (opts) {
+  if (!opts) opts = {}
+  var platformName = opts.platform || process.platform
+  var platform = this.defaults[platformName] || this.defaults.fallback
+  var hasUnicode = !!opts.hasUnicode
+  var hasColor = !!opts.hasColor
+  if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor)
+  if (!platform[hasUnicode][hasColor]) {
+    if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) {
+      hasUnicode = false
+    } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) {
+      hasColor = false
+    } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) {
+      hasUnicode = false
+      hasColor = false
+    } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) {
+      hasUnicode = false
+    } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) {
+      hasColor = false
+    } else if (platform === this.defaults.fallback) {
+      throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor)
+    }
+  }
+  if (platform[hasUnicode][hasColor]) {
+    return this.getTheme(platform[hasUnicode][hasColor])
+  } else {
+    return this.getDefault(objectAssign({}, opts, {platform: 'fallback'}))
+  }
+}
+
+ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) {
+  var err = new Error('Could not find a gauge theme named "' + name + '"')
+  Error.captureStackTrace.call(err, newMissingThemeError)
+  err.theme = name
+  err.code = 'EMISSINGTHEME'
+  return err
+}
+
+ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) {
+  var err = new Error(
+    'Could not find a gauge theme for your platform/unicode/color use combo:\n' +
+    '    platform = ' + platformName + '\n' +
+    '    hasUnicode = ' + hasUnicode + '\n' +
+    '    hasColor = ' + hasColor)
+  Error.captureStackTrace.call(err, newMissingDefaultThemeError)
+  err.platform = platformName
+  err.hasUnicode = hasUnicode
+  err.hasColor = hasColor
+  err.code = 'EMISSINGTHEME'
+  return err
+}
+
+ThemeSetProto.newThemeSet = function () {
+  var themeset = function (opts) {
+    return themeset.getDefault(opts)
+  }
+  return objectAssign(themeset, ThemeSetProto, {
+    themes: objectAssign({}, this.themes),
+    baseTheme: objectAssign({}, this.baseTheme),
+    defaults: JSON.parse(JSON.stringify(this.defaults || {}))
+  })
+}
+
diff --git a/legacy-libs/grpc/node_modules/gauge/themes.js b/legacy-libs/grpc/node_modules/gauge/themes.js
new file mode 100644 (file)
index 0000000..eb5a4f5
--- /dev/null
@@ -0,0 +1,54 @@
+'use strict'
+var consoleControl = require('console-control-strings')
+var ThemeSet = require('./theme-set.js')
+
+var themes = module.exports = new ThemeSet()
+
+themes.addTheme('ASCII', {
+  preProgressbar: '[',
+  postProgressbar: ']',
+  progressbarTheme: {
+    complete: '#',
+    remaining: '.'
+  },
+  activityIndicatorTheme: '-\\|/',
+  preSubsection: '>'
+})
+
+themes.addTheme('colorASCII', themes.getTheme('ASCII'), {
+  progressbarTheme: {
+    preComplete: consoleControl.color('inverse'),
+    complete: ' ',
+    postComplete: consoleControl.color('stopInverse'),
+    preRemaining: consoleControl.color('brightBlack'),
+    remaining: '.',
+    postRemaining: consoleControl.color('reset')
+  }
+})
+
+themes.addTheme('brailleSpinner', {
+  preProgressbar: '⸨',
+  postProgressbar: '⸩',
+  progressbarTheme: {
+    complete: '░',
+    remaining: '⠂'
+  },
+  activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏',
+  preSubsection: '>'
+})
+
+themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), {
+  progressbarTheme: {
+    preComplete: consoleControl.color('inverse'),
+    complete: ' ',
+    postComplete: consoleControl.color('stopInverse'),
+    preRemaining: consoleControl.color('brightBlack'),
+    remaining: '░',
+    postRemaining: consoleControl.color('reset')
+  }
+})
+
+themes.setDefault({}, 'ASCII')
+themes.setDefault({hasColor: true}, 'colorASCII')
+themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner')
+themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner')
diff --git a/legacy-libs/grpc/node_modules/gauge/wide-truncate.js b/legacy-libs/grpc/node_modules/gauge/wide-truncate.js
new file mode 100644 (file)
index 0000000..c531bc4
--- /dev/null
@@ -0,0 +1,25 @@
+'use strict'
+var stringWidth = require('string-width')
+var stripAnsi = require('strip-ansi')
+
+module.exports = wideTruncate
+
+function wideTruncate (str, target) {
+  if (stringWidth(str) === 0) return str
+  if (target <= 0) return ''
+  if (stringWidth(str) <= target) return str
+
+  // We compute the number of bytes of ansi sequences here and add
+  // that to our initial truncation to ensure that we don't slice one
+  // that we want to keep in half.
+  var noAnsi = stripAnsi(str)
+  var ansiSize = str.length + noAnsi.length
+  var truncated = str.slice(0, target + ansiSize)
+
+  // we have to shrink the result to account for our ansi sequence buffer
+  // (if an ansi sequence was truncated) and double width characters.
+  while (stringWidth(truncated) > target) {
+    truncated = truncated.slice(0, -1)
+  }
+  return truncated
+}
diff --git a/legacy-libs/grpc/node_modules/has-unicode/LICENSE b/legacy-libs/grpc/node_modules/has-unicode/LICENSE
new file mode 100644 (file)
index 0000000..d42e25e
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2014, Rebecca Turner <me@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/legacy-libs/grpc/node_modules/has-unicode/README.md b/legacy-libs/grpc/node_modules/has-unicode/README.md
new file mode 100644 (file)
index 0000000..5a03e59
--- /dev/null
@@ -0,0 +1,43 @@
+has-unicode
+===========
+
+Try to guess if your terminal supports unicode
+
+```javascript
+var hasUnicode = require("has-unicode")
+
+if (hasUnicode()) {
+  // the terminal probably has unicode support
+}
+```
+```javascript
+var hasUnicode = require("has-unicode").tryHarder
+hasUnicode(function(unicodeSupported) {
+  if (unicodeSupported) {
+    // the terminal probably has unicode support
+  }
+})
+```
+
+## Detecting Unicode
+
+What we actually detect is UTF-8 support, as that's what Node itself supports.
+If you have a UTF-16 locale then you won't be detected as unicode capable.
+
+### Windows
+
+Since at least Windows 7, `cmd` and `powershell` have been unicode capable,
+but unfortunately even then it's not guaranteed. In many localizations it
+still uses legacy code pages and there's no facility short of running
+programs or linking C++ that will let us detect this. As such, we
+report any Windows installation as NOT unicode capable, and recommend
+that you encourage your users to override this via config.
+
+### Unix Like Operating Systems
+
+We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in
+that order.  For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. 
+For `LC_CTYPE` it looks to see if the value is `UTF-8`.  This is sufficient
+for most POSIX systems.  While locale data can be put in `/etc/locale.conf`
+as well, AFAIK it's always copied into the environment.
+
diff --git a/legacy-libs/grpc/node_modules/has-unicode/index.js b/legacy-libs/grpc/node_modules/has-unicode/index.js
new file mode 100644 (file)
index 0000000..9b0fe44
--- /dev/null
@@ -0,0 +1,16 @@
+"use strict"
+var os = require("os")
+
+var hasUnicode = module.exports = function () {
+  // Recent Win32 platforms (>XP) CAN support unicode in the console but
+  // don't have to, and in non-english locales often use traditional local
+  // code pages. There's no way, short of windows system calls or execing
+  // the chcp command line program to figure this out. As such, we default
+  // this to false and encourage your users to override it via config if
+  // appropriate.
+  if (os.type() == "Windows_NT") { return false }
+
+  var isUTF8 = /UTF-?8$/i
+  var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG
+  return isUTF8.test(ctype)
+}
diff --git a/legacy-libs/grpc/node_modules/has-unicode/package.json b/legacy-libs/grpc/node_modules/has-unicode/package.json
new file mode 100644 (file)
index 0000000..317695d
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_args": [
+    [
+      "has-unicode@2.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "has-unicode@2.0.1",
+  "_id": "has-unicode@2.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
+  "_location": "/grpc/has-unicode",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "has-unicode@2.0.1",
+    "name": "has-unicode",
+    "escapedName": "has-unicode",
+    "rawSpec": "2.0.1",
+    "saveSpec": null,
+    "fetchSpec": "2.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/gauge"
+  ],
+  "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Rebecca Turner",
+    "email": "me@re-becca.org"
+  },
+  "bugs": {
+    "url": "https://github.com/iarna/has-unicode/issues"
+  },
+  "dependencies": {},
+  "description": "Try to guess if your terminal supports unicode",
+  "devDependencies": {
+    "require-inject": "^1.3.0",
+    "tap": "^2.3.1"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/iarna/has-unicode",
+  "keywords": [
+    "unicode",
+    "terminal"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "has-unicode",
+  "optionalDependencies": {},
+  "readme": "has-unicode\n===========\n\nTry to guess if your terminal supports unicode\n\n```javascript\nvar hasUnicode = require(\"has-unicode\")\n\nif (hasUnicode()) {\n  // the terminal probably has unicode support\n}\n```\n```javascript\nvar hasUnicode = require(\"has-unicode\").tryHarder\nhasUnicode(function(unicodeSupported) {\n  if (unicodeSupported) {\n    // the terminal probably has unicode support\n  }\n})\n```\n\n## Detecting Unicode\n\nWhat we actually detect is UTF-8 support, as that's what Node itself supports.\nIf you have a UTF-16 locale then you won't be detected as unicode capable.\n\n### Windows\n\nSince at least Windows 7, `cmd` and `powershell` have been unicode capable,\nbut unfortunately even then it's not guaranteed. In many localizations it\nstill uses legacy code pages and there's no facility short of running\nprograms or linking C++ that will let us detect this. As such, we\nreport any Windows installation as NOT unicode capable, and recommend\nthat you encourage your users to override this via config.\n\n### Unix Like Operating Systems\n\nWe look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in\nthat order.  For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. \nFor `LC_CTYPE` it looks to see if the value is `UTF-8`.  This is sufficient\nfor most POSIX systems.  While locale data can be put in `/etc/locale.conf`\nas well, AFAIK it's always copied into the environment.\n\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iarna/has-unicode.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "2.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/Changelog.md b/legacy-libs/grpc/node_modules/iconv-lite/Changelog.md
new file mode 100644 (file)
index 0000000..e31cd0c
--- /dev/null
@@ -0,0 +1,158 @@
+
+# 0.4.23 / 2018-05-07
+
+  * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann)
+  * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn)
+
+
+# 0.4.22 / 2018-05-05
+
+  * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson)
+  * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson)
+
+
+# 0.4.21 / 2018-04-06
+
+  * Fix encoding canonicalization (#156)
+  * Fix the paths in the "browser" field in package.json (#174 by @LMLB)
+  * Removed "contributors" section in package.json - see Git history instead.
+
+
+# 0.4.20 / 2018-04-06
+
+  * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR)
+
+
+# 0.4.19 / 2017-09-09
+
+  * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147)
+  * Re-generated windows1255 codec, because it was updated in iconv project
+  * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8
+
+
+# 0.4.18 / 2017-06-13
+
+  * Fixed CESU-8 regression in Node v8.
+
+
+# 0.4.17 / 2017-04-22
+
+ * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn)
+
+
+# 0.4.16 / 2017-04-22
+
+ * Added support for React Native (#150)
+ * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex)
+ * Fixed typo in Readme (#138 by @jiangzhuo)
+ * Fixed build for Node v6.10+ by making correct version comparison
+ * Added a warning if iconv-lite is loaded not as utf-8 (see #142)
+
+
+# 0.4.15 / 2016-11-21
+
+ * Fixed typescript type definition (#137)
+
+
+# 0.4.14 / 2016-11-20
+
+ * Preparation for v1.0
+ * Added Node v6 and latest Node versions to Travis CI test rig
+ * Deprecated Node v0.8 support
+ * Typescript typings (@larssn)
+ * Fix encoding of Euro character in GB 18030 (inspired by @lygstate)
+ * Add ms prefix to dbcs windows encodings (@rokoroku)
+
+
+# 0.4.13 / 2015-10-01
+
+ * Fix silly mistake in deprecation notice.
+
+
+# 0.4.12 / 2015-09-26
+
+ * Node v4 support:
+   * Added CESU-8 decoding (#106)
+   * Added deprecation notice for `extendNodeEncodings`
+   * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol)
+
+
+# 0.4.11 / 2015-07-03
+
+ * Added CESU-8 encoding.
+
+
+# 0.4.10 / 2015-05-26
+
+ * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not
+   just spaces. This should minimize the importance of "default" endianness.
+
+
+# 0.4.9 / 2015-05-24
+
+ * Streamlined BOM handling: strip BOM by default, add BOM when encoding if 
+   addBOM: true. Added docs to Readme.
+ * UTF16 now uses UTF16-LE by default.
+ * Fixed minor issue with big5 encoding.
+ * Added io.js testing on Travis; updated node-iconv version to test against.
+   Now we just skip testing SBCS encodings that node-iconv doesn't support.
+ * (internal refactoring) Updated codec interface to use classes.
+ * Use strict mode in all files.
+
+
+# 0.4.8 / 2015-04-14
+ * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94)
+
+
+# 0.4.7 / 2015-02-05
+
+ * stop official support of Node.js v0.8. Should still work, but no guarantees.
+   reason: Packages needed for testing are hard to get on Travis CI.
+ * work in environment where Object.prototype is monkey patched with enumerable 
+   props (#89).
+
+
+# 0.4.6 / 2015-01-12
+ * fix rare aliases of single-byte encodings (thanks @mscdex)
+ * double the timeout for dbcs tests to make them less flaky on travis
+
+
+# 0.4.5 / 2014-11-20
+
+ * fix windows-31j and x-sjis encoding support (@nleush)
+ * minor fix: undefined variable reference when internal error happens
+
+
+# 0.4.4 / 2014-07-16
+
+ * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3)
+ * fixed streaming base64 encoding
+
+
+# 0.4.3 / 2014-06-14
+
+ * added encodings UTF-16BE and UTF-16 with BOM
+
+
+# 0.4.2 / 2014-06-12
+
+ * don't throw exception if `extendNodeEncodings()` is called more than once
+
+
+# 0.4.1 / 2014-06-11
+
+ * codepage 808 added
+
+
+# 0.4.0 / 2014-06-10
+
+ * code is rewritten from scratch
+ * all widespread encodings are supported
+ * streaming interface added
+ * browserify compatibility added
+ * (optional) extend core primitive encodings to make usage even simpler
+ * moved from vows to mocha as the testing framework
+
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/LICENSE b/legacy-libs/grpc/node_modules/iconv-lite/LICENSE
new file mode 100644 (file)
index 0000000..d518d83
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright (c) 2011 Alexander Shtuchkin
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/README.md b/legacy-libs/grpc/node_modules/iconv-lite/README.md
new file mode 100644 (file)
index 0000000..c981c37
--- /dev/null
@@ -0,0 +1,156 @@
+## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite)
+
+ * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).
+ * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), 
+   [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others.
+ * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison).
+ * Intuitive encode/decode API
+ * Streaming support for Node v0.10+
+ * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings.
+ * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included).
+ * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included.
+ * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`).
+ * License: MIT.
+
+[![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true&downloadRank=true)](https://npmjs.org/packages/iconv-lite/)
+
+## Usage
+### Basic API
+```javascript
+var iconv = require('iconv-lite');
+
+// Convert from an encoded buffer to js string.
+str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
+
+// Convert from js string to an encoded buffer.
+buf = iconv.encode("Sample input string", 'win1251');
+
+// Check if encoding is supported
+iconv.encodingExists("us-ascii")
+```
+
+### Streaming API (Node v0.10+)
+```javascript
+
+// Decode stream (from binary stream to js strings)
+http.createServer(function(req, res) {
+    var converterStream = iconv.decodeStream('win1251');
+    req.pipe(converterStream);
+
+    converterStream.on('data', function(str) {
+        console.log(str); // Do something with decoded strings, chunk-by-chunk.
+    });
+});
+
+// Convert encoding streaming example
+fs.createReadStream('file-in-win1251.txt')
+    .pipe(iconv.decodeStream('win1251'))
+    .pipe(iconv.encodeStream('ucs2'))
+    .pipe(fs.createWriteStream('file-in-ucs2.txt'));
+
+// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.
+http.createServer(function(req, res) {
+    req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) {
+        assert(typeof body == 'string');
+        console.log(body); // full request body string
+    });
+});
+```
+
+### [Deprecated] Extend Node.js own encodings
+> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility).
+
+```javascript
+// After this call all Node basic primitives will understand iconv-lite encodings.
+iconv.extendNodeEncodings();
+
+// Examples:
+buf = new Buffer(str, 'win1251');
+buf.write(str, 'gbk');
+str = buf.toString('latin1');
+assert(Buffer.isEncoding('iso-8859-15'));
+Buffer.byteLength(str, 'us-ascii');
+
+http.createServer(function(req, res) {
+    req.setEncoding('big5');
+    req.collect(function(err, body) {
+        console.log(body);
+    });
+});
+
+fs.createReadStream("file.txt", "shift_jis");
+
+// External modules are also supported (if they use Node primitives, which they probably do).
+request = require('request');
+request({
+    url: "http://github.com/", 
+    encoding: "cp932"
+});
+
+// To remove extensions
+iconv.undoExtendNodeEncodings();
+```
+
+## Supported encodings
+
+ *  All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex.
+ *  Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap.
+ *  All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, 
+    IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. 
+    Aliases like 'latin1', 'us-ascii' also supported.
+ *  All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP.
+
+See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).
+
+Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors!
+
+Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors!
+
+
+## Encoding/decoding speed
+
+Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). 
+Note: your results may vary, so please always check on your hardware.
+
+    operation             iconv@2.1.4   iconv-lite@0.4.7
+    ----------------------------------------------------------
+    encode('win1251')     ~96 Mb/s      ~320 Mb/s
+    decode('win1251')     ~95 Mb/s      ~246 Mb/s
+
+## BOM handling
+
+ * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options
+   (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`).
+   A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found.
+ * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module.
+ * Encoding: No BOM added, unless overridden by `addBOM: true` option.
+
+## UTF-16 Encodings
+
+This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be
+smart about endianness in the following ways:
+ * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be 
+   overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`.
+ * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override.
+
+## Other notes
+
+When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding).  
+Untranslatable characters are set to � or ?. No transliteration is currently supported.  
+Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77).  
+
+## Testing
+
+```bash
+$ git clone git@github.com:ashtuchkin/iconv-lite.git
+$ cd iconv-lite
+$ npm install
+$ npm test
+    
+$ # To view performance:
+$ node test/performance.js
+
+$ # To view test coverage:
+$ npm run coverage
+$ open coverage/lcov-report/index.html
+```
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/dbcs-codec.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/dbcs-codec.js
new file mode 100644 (file)
index 0000000..1fe3e16
--- /dev/null
@@ -0,0 +1,555 @@
+"use strict";
+var Buffer = require("safer-buffer").Buffer;
+
+// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
+// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
+// To save memory and loading time, we read table files only when requested.
+
+exports._dbcs = DBCSCodec;
+
+var UNASSIGNED = -1,
+    GB18030_CODE = -2,
+    SEQ_START  = -10,
+    NODE_START = -1000,
+    UNASSIGNED_NODE = new Array(0x100),
+    DEF_CHAR = -1;
+
+for (var i = 0; i < 0x100; i++)
+    UNASSIGNED_NODE[i] = UNASSIGNED;
+
+
+// Class DBCSCodec reads and initializes mapping tables.
+function DBCSCodec(codecOptions, iconv) {
+    this.encodingName = codecOptions.encodingName;
+    if (!codecOptions)
+        throw new Error("DBCS codec is called without the data.")
+    if (!codecOptions.table)
+        throw new Error("Encoding '" + this.encodingName + "' has no data.");
+
+    // Load tables.
+    var mappingTable = codecOptions.table();
+
+
+    // Decode tables: MBCS -> Unicode.
+
+    // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.
+    // Trie root is decodeTables[0].
+    // Values: >=  0 -> unicode character code. can be > 0xFFFF
+    //         == UNASSIGNED -> unknown/unassigned sequence.
+    //         == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.
+    //         <= NODE_START -> index of the next node in our trie to process next byte.
+    //         <= SEQ_START  -> index of the start of a character code sequence, in decodeTableSeq.
+    this.decodeTables = [];
+    this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.
+
+    // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. 
+    this.decodeTableSeq = [];
+
+    // Actual mapping tables consist of chunks. Use them to fill up decode tables.
+    for (var i = 0; i < mappingTable.length; i++)
+        this._addDecodeChunk(mappingTable[i]);
+
+    this.defaultCharUnicode = iconv.defaultCharUnicode;
+
+    
+    // Encode tables: Unicode -> DBCS.
+
+    // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.
+    // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.
+    // Values: >=  0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).
+    //         == UNASSIGNED -> no conversion found. Output a default char.
+    //         <= SEQ_START  -> it's an index in encodeTableSeq, see below. The character starts a sequence.
+    this.encodeTable = [];
+    
+    // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
+    // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
+    // means end of sequence (needed when one sequence is a strict subsequence of another).
+    // Objects are kept separately from encodeTable to increase performance.
+    this.encodeTableSeq = [];
+
+    // Some chars can be decoded, but need not be encoded.
+    var skipEncodeChars = {};
+    if (codecOptions.encodeSkipVals)
+        for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {
+            var val = codecOptions.encodeSkipVals[i];
+            if (typeof val === 'number')
+                skipEncodeChars[val] = true;
+            else
+                for (var j = val.from; j <= val.to; j++)
+                    skipEncodeChars[j] = true;
+        }
+        
+    // Use decode trie to recursively fill out encode tables.
+    this._fillEncodeTable(0, 0, skipEncodeChars);
+
+    // Add more encoding pairs when needed.
+    if (codecOptions.encodeAdd) {
+        for (var uChar in codecOptions.encodeAdd)
+            if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))
+                this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
+    }
+
+    this.defCharSB  = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
+    if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];
+    if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
+
+
+    // Load & create GB18030 tables when needed.
+    if (typeof codecOptions.gb18030 === 'function') {
+        this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.
+
+        // Add GB18030 decode tables.
+        var thirdByteNodeIdx = this.decodeTables.length;
+        var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);
+
+        var fourthByteNodeIdx = this.decodeTables.length;
+        var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);
+
+        for (var i = 0x81; i <= 0xFE; i++) {
+            var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];
+            var secondByteNode = this.decodeTables[secondByteNodeIdx];
+            for (var j = 0x30; j <= 0x39; j++)
+                secondByteNode[j] = NODE_START - thirdByteNodeIdx;
+        }
+        for (var i = 0x81; i <= 0xFE; i++)
+            thirdByteNode[i] = NODE_START - fourthByteNodeIdx;
+        for (var i = 0x30; i <= 0x39; i++)
+            fourthByteNode[i] = GB18030_CODE
+    }        
+}
+
+DBCSCodec.prototype.encoder = DBCSEncoder;
+DBCSCodec.prototype.decoder = DBCSDecoder;
+
+// Decoder helpers
+DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
+    var bytes = [];
+    for (; addr > 0; addr >>= 8)
+        bytes.push(addr & 0xFF);
+    if (bytes.length == 0)
+        bytes.push(0);
+
+    var node = this.decodeTables[0];
+    for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.
+        var val = node[bytes[i]];
+
+        if (val == UNASSIGNED) { // Create new node.
+            node[bytes[i]] = NODE_START - this.decodeTables.length;
+            this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
+        }
+        else if (val <= NODE_START) { // Existing node.
+            node = this.decodeTables[NODE_START - val];
+        }
+        else
+            throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
+    }
+    return node;
+}
+
+
+DBCSCodec.prototype._addDecodeChunk = function(chunk) {
+    // First element of chunk is the hex mbcs code where we start.
+    var curAddr = parseInt(chunk[0], 16);
+
+    // Choose the decoding node where we'll write our chars.
+    var writeTable = this._getDecodeTrieNode(curAddr);
+    curAddr = curAddr & 0xFF;
+
+    // Write all other elements of the chunk to the table.
+    for (var k = 1; k < chunk.length; k++) {
+        var part = chunk[k];
+        if (typeof part === "string") { // String, write as-is.
+            for (var l = 0; l < part.length;) {
+                var code = part.charCodeAt(l++);
+                if (0xD800 <= code && code < 0xDC00) { // Decode surrogate
+                    var codeTrail = part.charCodeAt(l++);
+                    if (0xDC00 <= codeTrail && codeTrail < 0xE000)
+                        writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);
+                    else
+                        throw new Error("Incorrect surrogate pair in "  + this.encodingName + " at chunk " + chunk[0]);
+                }
+                else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)
+                    var len = 0xFFF - code + 2;
+                    var seq = [];
+                    for (var m = 0; m < len; m++)
+                        seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.
+
+                    writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
+                    this.decodeTableSeq.push(seq);
+                }
+                else
+                    writeTable[curAddr++] = code; // Basic char
+            }
+        } 
+        else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character.
+            var charCode = writeTable[curAddr - 1] + 1;
+            for (var l = 0; l < part; l++)
+                writeTable[curAddr++] = charCode++;
+        }
+        else
+            throw new Error("Incorrect type '" + typeof part + "' given in "  + this.encodingName + " at chunk " + chunk[0]);
+    }
+    if (curAddr > 0xFF)
+        throw new Error("Incorrect chunk in "  + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
+}
+
+// Encoder helpers
+DBCSCodec.prototype._getEncodeBucket = function(uCode) {
+    var high = uCode >> 8; // This could be > 0xFF because of astral characters.
+    if (this.encodeTable[high] === undefined)
+        this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.
+    return this.encodeTable[high];
+}
+
+DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
+    var bucket = this._getEncodeBucket(uCode);
+    var low = uCode & 0xFF;
+    if (bucket[low] <= SEQ_START)
+        this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.
+    else if (bucket[low] == UNASSIGNED)
+        bucket[low] = dbcsCode;
+}
+
+DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
+    
+    // Get the root of character tree according to first character of the sequence.
+    var uCode = seq[0];
+    var bucket = this._getEncodeBucket(uCode);
+    var low = uCode & 0xFF;
+
+    var node;
+    if (bucket[low] <= SEQ_START) {
+        // There's already a sequence with  - use it.
+        node = this.encodeTableSeq[SEQ_START-bucket[low]];
+    }
+    else {
+        // There was no sequence object - allocate a new one.
+        node = {};
+        if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.
+        bucket[low] = SEQ_START - this.encodeTableSeq.length;
+        this.encodeTableSeq.push(node);
+    }
+
+    // Traverse the character tree, allocating new nodes as needed.
+    for (var j = 1; j < seq.length-1; j++) {
+        var oldVal = node[uCode];
+        if (typeof oldVal === 'object')
+            node = oldVal;
+        else {
+            node = node[uCode] = {}
+            if (oldVal !== undefined)
+                node[DEF_CHAR] = oldVal
+        }
+    }
+
+    // Set the leaf to given dbcsCode.
+    uCode = seq[seq.length-1];
+    node[uCode] = dbcsCode;
+}
+
+DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
+    var node = this.decodeTables[nodeIdx];
+    for (var i = 0; i < 0x100; i++) {
+        var uCode = node[i];
+        var mbCode = prefix + i;
+        if (skipEncodeChars[mbCode])
+            continue;
+
+        if (uCode >= 0)
+            this._setEncodeChar(uCode, mbCode);
+        else if (uCode <= NODE_START)
+            this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);
+        else if (uCode <= SEQ_START)
+            this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
+    }
+}
+
+
+
+// == Encoder ==================================================================
+
+function DBCSEncoder(options, codec) {
+    // Encoder state
+    this.leadSurrogate = -1;
+    this.seqObj = undefined;
+    
+    // Static data
+    this.encodeTable = codec.encodeTable;
+    this.encodeTableSeq = codec.encodeTableSeq;
+    this.defaultCharSingleByte = codec.defCharSB;
+    this.gb18030 = codec.gb18030;
+}
+
+DBCSEncoder.prototype.write = function(str) {
+    var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),
+        leadSurrogate = this.leadSurrogate,
+        seqObj = this.seqObj, nextChar = -1,
+        i = 0, j = 0;
+
+    while (true) {
+        // 0. Get next character.
+        if (nextChar === -1) {
+            if (i == str.length) break;
+            var uCode = str.charCodeAt(i++);
+        }
+        else {
+            var uCode = nextChar;
+            nextChar = -1;    
+        }
+
+        // 1. Handle surrogates.
+        if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.
+            if (uCode < 0xDC00) { // We've got lead surrogate.
+                if (leadSurrogate === -1) {
+                    leadSurrogate = uCode;
+                    continue;
+                } else {
+                    leadSurrogate = uCode;
+                    // Double lead surrogate found.
+                    uCode = UNASSIGNED;
+                }
+            } else { // We've got trail surrogate.
+                if (leadSurrogate !== -1) {
+                    uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);
+                    leadSurrogate = -1;
+                } else {
+                    // Incomplete surrogate pair - only trail surrogate found.
+                    uCode = UNASSIGNED;
+                }
+                
+            }
+        }
+        else if (leadSurrogate !== -1) {
+            // Incomplete surrogate pair - only lead surrogate found.
+            nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.
+            leadSurrogate = -1;
+        }
+
+        // 2. Convert uCode character.
+        var dbcsCode = UNASSIGNED;
+        if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence
+            var resCode = seqObj[uCode];
+            if (typeof resCode === 'object') { // Sequence continues.
+                seqObj = resCode;
+                continue;
+
+            } else if (typeof resCode == 'number') { // Sequence finished. Write it.
+                dbcsCode = resCode;
+
+            } else if (resCode == undefined) { // Current character is not part of the sequence.
+
+                // Try default character for this sequence
+                resCode = seqObj[DEF_CHAR];
+                if (resCode !== undefined) {
+                    dbcsCode = resCode; // Found. Write it.
+                    nextChar = uCode; // Current character will be written too in the next iteration.
+
+                } else {
+                    // TODO: What if we have no default? (resCode == undefined)
+                    // Then, we should write first char of the sequence as-is and try the rest recursively.
+                    // Didn't do it for now because no encoding has this situation yet.
+                    // Currently, just skip the sequence and write current char.
+                }
+            }
+            seqObj = undefined;
+        }
+        else if (uCode >= 0) {  // Regular character
+            var subtable = this.encodeTable[uCode >> 8];
+            if (subtable !== undefined)
+                dbcsCode = subtable[uCode & 0xFF];
+            
+            if (dbcsCode <= SEQ_START) { // Sequence start
+                seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];
+                continue;
+            }
+
+            if (dbcsCode == UNASSIGNED && this.gb18030) {
+                // Use GB18030 algorithm to find character(s) to write.
+                var idx = findIdx(this.gb18030.uChars, uCode);
+                if (idx != -1) {
+                    var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
+                    newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;
+                    newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;
+                    newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;
+                    newBuf[j++] = 0x30 + dbcsCode;
+                    continue;
+                }
+            }
+        }
+
+        // 3. Write dbcsCode character.
+        if (dbcsCode === UNASSIGNED)
+            dbcsCode = this.defaultCharSingleByte;
+        
+        if (dbcsCode < 0x100) {
+            newBuf[j++] = dbcsCode;
+        }
+        else if (dbcsCode < 0x10000) {
+            newBuf[j++] = dbcsCode >> 8;   // high byte
+            newBuf[j++] = dbcsCode & 0xFF; // low byte
+        }
+        else {
+            newBuf[j++] = dbcsCode >> 16;
+            newBuf[j++] = (dbcsCode >> 8) & 0xFF;
+            newBuf[j++] = dbcsCode & 0xFF;
+        }
+    }
+
+    this.seqObj = seqObj;
+    this.leadSurrogate = leadSurrogate;
+    return newBuf.slice(0, j);
+}
+
+DBCSEncoder.prototype.end = function() {
+    if (this.leadSurrogate === -1 && this.seqObj === undefined)
+        return; // All clean. Most often case.
+
+    var newBuf = Buffer.alloc(10), j = 0;
+
+    if (this.seqObj) { // We're in the sequence.
+        var dbcsCode = this.seqObj[DEF_CHAR];
+        if (dbcsCode !== undefined) { // Write beginning of the sequence.
+            if (dbcsCode < 0x100) {
+                newBuf[j++] = dbcsCode;
+            }
+            else {
+                newBuf[j++] = dbcsCode >> 8;   // high byte
+                newBuf[j++] = dbcsCode & 0xFF; // low byte
+            }
+        } else {
+            // See todo above.
+        }
+        this.seqObj = undefined;
+    }
+
+    if (this.leadSurrogate !== -1) {
+        // Incomplete surrogate pair - only lead surrogate found.
+        newBuf[j++] = this.defaultCharSingleByte;
+        this.leadSurrogate = -1;
+    }
+    
+    return newBuf.slice(0, j);
+}
+
+// Export for testing
+DBCSEncoder.prototype.findIdx = findIdx;
+
+
+// == Decoder ==================================================================
+
+function DBCSDecoder(options, codec) {
+    // Decoder state
+    this.nodeIdx = 0;
+    this.prevBuf = Buffer.alloc(0);
+
+    // Static data
+    this.decodeTables = codec.decodeTables;
+    this.decodeTableSeq = codec.decodeTableSeq;
+    this.defaultCharUnicode = codec.defaultCharUnicode;
+    this.gb18030 = codec.gb18030;
+}
+
+DBCSDecoder.prototype.write = function(buf) {
+    var newBuf = Buffer.alloc(buf.length*2),
+        nodeIdx = this.nodeIdx, 
+        prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
+        seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
+        uCode;
+
+    if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.
+        prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
+    
+    for (var i = 0, j = 0; i < buf.length; i++) {
+        var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];
+
+        // Lookup in current trie node.
+        var uCode = this.decodeTables[nodeIdx][curByte];
+
+        if (uCode >= 0) { 
+            // Normal character, just use it.
+        }
+        else if (uCode === UNASSIGNED) { // Unknown char.
+            // TODO: Callback with seq.
+            //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
+            i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).
+            uCode = this.defaultCharUnicode.charCodeAt(0);
+        }
+        else if (uCode === GB18030_CODE) {
+            var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
+            var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);
+            var idx = findIdx(this.gb18030.gbChars, ptr);
+            uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
+        }
+        else if (uCode <= NODE_START) { // Go to next trie node.
+            nodeIdx = NODE_START - uCode;
+            continue;
+        }
+        else if (uCode <= SEQ_START) { // Output a sequence of chars.
+            var seq = this.decodeTableSeq[SEQ_START - uCode];
+            for (var k = 0; k < seq.length - 1; k++) {
+                uCode = seq[k];
+                newBuf[j++] = uCode & 0xFF;
+                newBuf[j++] = uCode >> 8;
+            }
+            uCode = seq[seq.length-1];
+        }
+        else
+            throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
+
+        // Write the character to buffer, handling higher planes using surrogate pair.
+        if (uCode > 0xFFFF) { 
+            uCode -= 0x10000;
+            var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);
+            newBuf[j++] = uCodeLead & 0xFF;
+            newBuf[j++] = uCodeLead >> 8;
+
+            uCode = 0xDC00 + uCode % 0x400;
+        }
+        newBuf[j++] = uCode & 0xFF;
+        newBuf[j++] = uCode >> 8;
+
+        // Reset trie node.
+        nodeIdx = 0; seqStart = i+1;
+    }
+
+    this.nodeIdx = nodeIdx;
+    this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);
+    return newBuf.slice(0, j).toString('ucs2');
+}
+
+DBCSDecoder.prototype.end = function() {
+    var ret = '';
+
+    // Try to parse all remaining chars.
+    while (this.prevBuf.length > 0) {
+        // Skip 1 character in the buffer.
+        ret += this.defaultCharUnicode;
+        var buf = this.prevBuf.slice(1);
+
+        // Parse remaining as usual.
+        this.prevBuf = Buffer.alloc(0);
+        this.nodeIdx = 0;
+        if (buf.length > 0)
+            ret += this.write(buf);
+    }
+
+    this.nodeIdx = 0;
+    return ret;
+}
+
+// Binary search for GB18030. Returns largest i such that table[i] <= val.
+function findIdx(table, val) {
+    if (table[0] > val)
+        return -1;
+
+    var l = 0, r = table.length;
+    while (l < r-1) { // always table[l] <= val < table[r]
+        var mid = l + Math.floor((r-l+1)/2);
+        if (table[mid] <= val)
+            l = mid;
+        else
+            r = mid;
+    }
+    return l;
+}
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/dbcs-data.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/dbcs-data.js
new file mode 100644 (file)
index 0000000..4b61914
--- /dev/null
@@ -0,0 +1,176 @@
+"use strict";
+
+// Description of supported double byte encodings and aliases.
+// Tables are not require()-d until they are needed to speed up library load.
+// require()-s are direct to support Browserify.
+
+module.exports = {
+    
+    // == Japanese/ShiftJIS ====================================================
+    // All japanese encodings are based on JIS X set of standards:
+    // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
+    // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. 
+    //              Has several variations in 1978, 1983, 1990 and 1997.
+    // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
+    // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
+    //              2 planes, first is superset of 0208, second - revised 0212.
+    //              Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
+
+    // Byte encodings are:
+    //  * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
+    //               encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
+    //               Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
+    //  * EUC-JP:    Up to 3 bytes per character. Used mostly on *nixes.
+    //               0x00-0x7F       - lower part of 0201
+    //               0x8E, 0xA1-0xDF - upper part of 0201
+    //               (0xA1-0xFE)x2   - 0208 plane (94x94).
+    //               0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
+    //  * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
+    //               Used as-is in ISO2022 family.
+    //  * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, 
+    //                0201-1976 Roman, 0208-1978, 0208-1983.
+    //  * ISO2022-JP-1: Adds esc seq for 0212-1990.
+    //  * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
+    //  * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
+    //  * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
+    //
+    // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
+    //
+    // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
+
+    'shiftjis': {
+        type: '_dbcs',
+        table: function() { return require('./tables/shiftjis.json') },
+        encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
+        encodeSkipVals: [{from: 0xED40, to: 0xF940}],
+    },
+    'csshiftjis': 'shiftjis',
+    'mskanji': 'shiftjis',
+    'sjis': 'shiftjis',
+    'windows31j': 'shiftjis',
+    'ms31j': 'shiftjis',
+    'xsjis': 'shiftjis',
+    'windows932': 'shiftjis',
+    'ms932': 'shiftjis',
+    '932': 'shiftjis',
+    'cp932': 'shiftjis',
+
+    'eucjp': {
+        type: '_dbcs',
+        table: function() { return require('./tables/eucjp.json') },
+        encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
+    },
+
+    // TODO: KDDI extension to Shift_JIS
+    // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
+    // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
+
+
+    // == Chinese/GBK ==========================================================
+    // http://en.wikipedia.org/wiki/GBK
+    // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
+
+    // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
+    'gb2312': 'cp936',
+    'gb231280': 'cp936',
+    'gb23121980': 'cp936',
+    'csgb2312': 'cp936',
+    'csiso58gb231280': 'cp936',
+    'euccn': 'cp936',
+
+    // Microsoft's CP936 is a subset and approximation of GBK.
+    'windows936': 'cp936',
+    'ms936': 'cp936',
+    '936': 'cp936',
+    'cp936': {
+        type: '_dbcs',
+        table: function() { return require('./tables/cp936.json') },
+    },
+
+    // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
+    'gbk': {
+        type: '_dbcs',
+        table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
+    },
+    'xgbk': 'gbk',
+    'isoir58': 'gbk',
+
+    // GB18030 is an algorithmic extension of GBK.
+    // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
+    // http://icu-project.org/docs/papers/gb18030.html
+    // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
+    // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
+    'gb18030': {
+        type: '_dbcs',
+        table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) },
+        gb18030: function() { return require('./tables/gb18030-ranges.json') },
+        encodeSkipVals: [0x80],
+        encodeAdd: {'€': 0xA2E3},
+    },
+
+    'chinese': 'gb18030',
+
+
+    // == Korean ===============================================================
+    // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
+    'windows949': 'cp949',
+    'ms949': 'cp949',
+    '949': 'cp949',
+    'cp949': {
+        type: '_dbcs',
+        table: function() { return require('./tables/cp949.json') },
+    },
+
+    'cseuckr': 'cp949',
+    'csksc56011987': 'cp949',
+    'euckr': 'cp949',
+    'isoir149': 'cp949',
+    'korean': 'cp949',
+    'ksc56011987': 'cp949',
+    'ksc56011989': 'cp949',
+    'ksc5601': 'cp949',
+
+
+    // == Big5/Taiwan/Hong Kong ================================================
+    // There are lots of tables for Big5 and cp950. Please see the following links for history:
+    // http://moztw.org/docs/big5/  http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
+    // Variations, in roughly number of defined chars:
+    //  * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
+    //  * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
+    //  * Big5-2003 (Taiwan standard) almost superset of cp950.
+    //  * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
+    //  * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. 
+    //    many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
+    //    Plus, it has 4 combining sequences.
+    //    Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
+    //    because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
+    //    Implementations are not consistent within browsers; sometimes labeled as just big5.
+    //    MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
+    //    Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
+    //    In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
+    //    Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
+    //                   http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
+    // 
+    // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
+    // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
+
+    'windows950': 'cp950',
+    'ms950': 'cp950',
+    '950': 'cp950',
+    'cp950': {
+        type: '_dbcs',
+        table: function() { return require('./tables/cp950.json') },
+    },
+
+    // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
+    'big5': 'big5hkscs',
+    'big5hkscs': {
+        type: '_dbcs',
+        table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) },
+        encodeSkipVals: [0xa2cc],
+    },
+
+    'cnbig5': 'big5hkscs',
+    'csbig5': 'big5hkscs',
+    'xxbig5': 'big5hkscs',
+};
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/index.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/index.js
new file mode 100644 (file)
index 0000000..e304003
--- /dev/null
@@ -0,0 +1,22 @@
+"use strict";
+
+// Update this array if you add/rename/remove files in this directory.
+// We support Browserify by skipping automatic module discovery and requiring modules directly.
+var modules = [
+    require("./internal"),
+    require("./utf16"),
+    require("./utf7"),
+    require("./sbcs-codec"),
+    require("./sbcs-data"),
+    require("./sbcs-data-generated"),
+    require("./dbcs-codec"),
+    require("./dbcs-data"),
+];
+
+// Put all encoding/alias/codec definitions to single object and export it. 
+for (var i = 0; i < modules.length; i++) {
+    var module = modules[i];
+    for (var enc in module)
+        if (Object.prototype.hasOwnProperty.call(module, enc))
+            exports[enc] = module[enc];
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/internal.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/internal.js
new file mode 100644 (file)
index 0000000..05ce38b
--- /dev/null
@@ -0,0 +1,188 @@
+"use strict";
+var Buffer = require("safer-buffer").Buffer;
+
+// Export Node.js internal encodings.
+
+module.exports = {
+    // Encodings
+    utf8:   { type: "_internal", bomAware: true},
+    cesu8:  { type: "_internal", bomAware: true},
+    unicode11utf8: "utf8",
+
+    ucs2:   { type: "_internal", bomAware: true},
+    utf16le: "ucs2",
+
+    binary: { type: "_internal" },
+    base64: { type: "_internal" },
+    hex:    { type: "_internal" },
+
+    // Codec.
+    _internal: InternalCodec,
+};
+
+//------------------------------------------------------------------------------
+
+function InternalCodec(codecOptions, iconv) {
+    this.enc = codecOptions.encodingName;
+    this.bomAware = codecOptions.bomAware;
+
+    if (this.enc === "base64")
+        this.encoder = InternalEncoderBase64;
+    else if (this.enc === "cesu8") {
+        this.enc = "utf8"; // Use utf8 for decoding.
+        this.encoder = InternalEncoderCesu8;
+
+        // Add decoder for versions of Node not supporting CESU-8
+        if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
+            this.decoder = InternalDecoderCesu8;
+            this.defaultCharUnicode = iconv.defaultCharUnicode;
+        }
+    }
+}
+
+InternalCodec.prototype.encoder = InternalEncoder;
+InternalCodec.prototype.decoder = InternalDecoder;
+
+//------------------------------------------------------------------------------
+
+// We use node.js internal decoder. Its signature is the same as ours.
+var StringDecoder = require('string_decoder').StringDecoder;
+
+if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.
+    StringDecoder.prototype.end = function() {};
+
+
+function InternalDecoder(options, codec) {
+    StringDecoder.call(this, codec.enc);
+}
+
+InternalDecoder.prototype = StringDecoder.prototype;
+
+
+//------------------------------------------------------------------------------
+// Encoder is mostly trivial
+
+function InternalEncoder(options, codec) {
+    this.enc = codec.enc;
+}
+
+InternalEncoder.prototype.write = function(str) {
+    return Buffer.from(str, this.enc);
+}
+
+InternalEncoder.prototype.end = function() {
+}
+
+
+//------------------------------------------------------------------------------
+// Except base64 encoder, which must keep its state.
+
+function InternalEncoderBase64(options, codec) {
+    this.prevStr = '';
+}
+
+InternalEncoderBase64.prototype.write = function(str) {
+    str = this.prevStr + str;
+    var completeQuads = str.length - (str.length % 4);
+    this.prevStr = str.slice(completeQuads);
+    str = str.slice(0, completeQuads);
+
+    return Buffer.from(str, "base64");
+}
+
+InternalEncoderBase64.prototype.end = function() {
+    return Buffer.from(this.prevStr, "base64");
+}
+
+
+//------------------------------------------------------------------------------
+// CESU-8 encoder is also special.
+
+function InternalEncoderCesu8(options, codec) {
+}
+
+InternalEncoderCesu8.prototype.write = function(str) {
+    var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
+    for (var i = 0; i < str.length; i++) {
+        var charCode = str.charCodeAt(i);
+        // Naive implementation, but it works because CESU-8 is especially easy
+        // to convert from UTF-16 (which all JS strings are encoded in).
+        if (charCode < 0x80)
+            buf[bufIdx++] = charCode;
+        else if (charCode < 0x800) {
+            buf[bufIdx++] = 0xC0 + (charCode >>> 6);
+            buf[bufIdx++] = 0x80 + (charCode & 0x3f);
+        }
+        else { // charCode will always be < 0x10000 in javascript.
+            buf[bufIdx++] = 0xE0 + (charCode >>> 12);
+            buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);
+            buf[bufIdx++] = 0x80 + (charCode & 0x3f);
+        }
+    }
+    return buf.slice(0, bufIdx);
+}
+
+InternalEncoderCesu8.prototype.end = function() {
+}
+
+//------------------------------------------------------------------------------
+// CESU-8 decoder is not implemented in Node v4.0+
+
+function InternalDecoderCesu8(options, codec) {
+    this.acc = 0;
+    this.contBytes = 0;
+    this.accBytes = 0;
+    this.defaultCharUnicode = codec.defaultCharUnicode;
+}
+
+InternalDecoderCesu8.prototype.write = function(buf) {
+    var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, 
+        res = '';
+    for (var i = 0; i < buf.length; i++) {
+        var curByte = buf[i];
+        if ((curByte & 0xC0) !== 0x80) { // Leading byte
+            if (contBytes > 0) { // Previous code is invalid
+                res += this.defaultCharUnicode;
+                contBytes = 0;
+            }
+
+            if (curByte < 0x80) { // Single-byte code
+                res += String.fromCharCode(curByte);
+            } else if (curByte < 0xE0) { // Two-byte code
+                acc = curByte & 0x1F;
+                contBytes = 1; accBytes = 1;
+            } else if (curByte < 0xF0) { // Three-byte code
+                acc = curByte & 0x0F;
+                contBytes = 2; accBytes = 1;
+            } else { // Four or more are not supported for CESU-8.
+                res += this.defaultCharUnicode;
+            }
+        } else { // Continuation byte
+            if (contBytes > 0) { // We're waiting for it.
+                acc = (acc << 6) | (curByte & 0x3f);
+                contBytes--; accBytes++;
+                if (contBytes === 0) {
+                    // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
+                    if (accBytes === 2 && acc < 0x80 && acc > 0)
+                        res += this.defaultCharUnicode;
+                    else if (accBytes === 3 && acc < 0x800)
+                        res += this.defaultCharUnicode;
+                    else
+                        // Actually add character.
+                        res += String.fromCharCode(acc);
+                }
+            } else { // Unexpected continuation byte
+                res += this.defaultCharUnicode;
+            }
+        }
+    }
+    this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;
+    return res;
+}
+
+InternalDecoderCesu8.prototype.end = function() {
+    var res = 0;
+    if (this.contBytes > 0)
+        res += this.defaultCharUnicode;
+    return res;
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-codec.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-codec.js
new file mode 100644 (file)
index 0000000..f225823
--- /dev/null
@@ -0,0 +1,72 @@
+"use strict";
+var Buffer = require("safer-buffer").Buffer;
+
+// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
+// correspond to encoded bytes (if 128 - then lower half is ASCII). 
+
+exports._sbcs = SBCSCodec;
+function SBCSCodec(codecOptions, iconv) {
+    if (!codecOptions)
+        throw new Error("SBCS codec is called without the data.")
+    
+    // Prepare char buffer for decoding.
+    if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
+        throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
+    
+    if (codecOptions.chars.length === 128) {
+        var asciiString = "";
+        for (var i = 0; i < 128; i++)
+            asciiString += String.fromCharCode(i);
+        codecOptions.chars = asciiString + codecOptions.chars;
+    }
+
+    this.decodeBuf = new Buffer.from(codecOptions.chars, 'ucs2');
+    
+    // Encoding buffer.
+    var encodeBuf = new Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
+
+    for (var i = 0; i < codecOptions.chars.length; i++)
+        encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
+
+    this.encodeBuf = encodeBuf;
+}
+
+SBCSCodec.prototype.encoder = SBCSEncoder;
+SBCSCodec.prototype.decoder = SBCSDecoder;
+
+
+function SBCSEncoder(options, codec) {
+    this.encodeBuf = codec.encodeBuf;
+}
+
+SBCSEncoder.prototype.write = function(str) {
+    var buf = Buffer.alloc(str.length);
+    for (var i = 0; i < str.length; i++)
+        buf[i] = this.encodeBuf[str.charCodeAt(i)];
+    
+    return buf;
+}
+
+SBCSEncoder.prototype.end = function() {
+}
+
+
+function SBCSDecoder(options, codec) {
+    this.decodeBuf = codec.decodeBuf;
+}
+
+SBCSDecoder.prototype.write = function(buf) {
+    // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
+    var decodeBuf = this.decodeBuf;
+    var newBuf = Buffer.alloc(buf.length*2);
+    var idx1 = 0, idx2 = 0;
+    for (var i = 0; i < buf.length; i++) {
+        idx1 = buf[i]*2; idx2 = i*2;
+        newBuf[idx2] = decodeBuf[idx1];
+        newBuf[idx2+1] = decodeBuf[idx1+1];
+    }
+    return newBuf.toString('ucs2');
+}
+
+SBCSDecoder.prototype.end = function() {
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-data-generated.js
new file mode 100644 (file)
index 0000000..9b48236
--- /dev/null
@@ -0,0 +1,451 @@
+"use strict";
+
+// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
+module.exports = {
+  "437": "cp437",
+  "737": "cp737",
+  "775": "cp775",
+  "850": "cp850",
+  "852": "cp852",
+  "855": "cp855",
+  "856": "cp856",
+  "857": "cp857",
+  "858": "cp858",
+  "860": "cp860",
+  "861": "cp861",
+  "862": "cp862",
+  "863": "cp863",
+  "864": "cp864",
+  "865": "cp865",
+  "866": "cp866",
+  "869": "cp869",
+  "874": "windows874",
+  "922": "cp922",
+  "1046": "cp1046",
+  "1124": "cp1124",
+  "1125": "cp1125",
+  "1129": "cp1129",
+  "1133": "cp1133",
+  "1161": "cp1161",
+  "1162": "cp1162",
+  "1163": "cp1163",
+  "1250": "windows1250",
+  "1251": "windows1251",
+  "1252": "windows1252",
+  "1253": "windows1253",
+  "1254": "windows1254",
+  "1255": "windows1255",
+  "1256": "windows1256",
+  "1257": "windows1257",
+  "1258": "windows1258",
+  "28591": "iso88591",
+  "28592": "iso88592",
+  "28593": "iso88593",
+  "28594": "iso88594",
+  "28595": "iso88595",
+  "28596": "iso88596",
+  "28597": "iso88597",
+  "28598": "iso88598",
+  "28599": "iso88599",
+  "28600": "iso885910",
+  "28601": "iso885911",
+  "28603": "iso885913",
+  "28604": "iso885914",
+  "28605": "iso885915",
+  "28606": "iso885916",
+  "windows874": {
+    "type": "_sbcs",
+    "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
+  },
+  "win874": "windows874",
+  "cp874": "windows874",
+  "windows1250": {
+    "type": "_sbcs",
+    "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬\ad®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
+  },
+  "win1250": "windows1250",
+  "cp1250": "windows1250",
+  "windows1251": {
+    "type": "_sbcs",
+    "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬\ad®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
+  },
+  "win1251": "windows1251",
+  "cp1251": "windows1251",
+  "windows1252": {
+    "type": "_sbcs",
+    "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
+  },
+  "win1252": "windows1252",
+  "cp1252": "windows1252",
+  "windows1253": {
+    "type": "_sbcs",
+    "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬\ad®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
+  },
+  "win1253": "windows1253",
+  "cp1253": "windows1253",
+  "windows1254": {
+    "type": "_sbcs",
+    "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
+  },
+  "win1254": "windows1254",
+  "cp1254": "windows1254",
+  "windows1255": {
+    "type": "_sbcs",
+    "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬\ad®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��\200e\200f�"
+  },
+  "win1255": "windows1255",
+  "cp1255": "windows1255",
+  "windows1256": {
+    "type": "_sbcs",
+    "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ\200c\200dں ،¢£¤¥¦§¨©ھ«¬\ad®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü\200e\200fے"
+  },
+  "win1256": "windows1256",
+  "cp1256": "windows1256",
+  "windows1257": {
+    "type": "_sbcs",
+    "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬\ad®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
+  },
+  "win1257": "windows1257",
+  "cp1257": "windows1257",
+  "windows1258": {
+    "type": "_sbcs",
+    "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
+  },
+  "win1258": "windows1258",
+  "cp1258": "windows1258",
+  "iso88591": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
+  },
+  "cp28591": "iso88591",
+  "iso88592": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f Ą˘Ł¤ĽŚ§¨ŠŞŤŹ\adŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
+  },
+  "cp28592": "iso88592",
+  "iso88593": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f Ħ˘£¤�Ĥ§¨İŞĞĴ\ad�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"
+  },
+  "cp28593": "iso88593",
+  "iso88594": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ĄĸŖ¤ĨĻ§¨ŠĒĢŦ\adŽ¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
+  },
+  "cp28594": "iso88594",
+  "iso88595": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ЁЂЃЄЅІЇЈЉЊЋЌ\adЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
+  },
+  "cp28595": "iso88595",
+  "iso88596": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ���¤�������،\ad�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"
+  },
+  "cp28596": "iso88596",
+  "iso88597": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ‘’£€₯¦§¨©ͺ«¬\ad�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
+  },
+  "cp28597": "iso88597",
+  "iso88598": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f �¢£¤¥¦§¨©×«¬\ad®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��\200e\200f�"
+  },
+  "cp28598": "iso88598",
+  "iso88599": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
+  },
+  "cp28599": "iso88599",
+  "iso885910": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ĄĒĢĪĨĶ§ĻĐŠŦŽ\adŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
+  },
+  "cp28600": "iso885910",
+  "iso885911": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
+  },
+  "cp28601": "iso885911",
+  "iso885913": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ”¢£¤„¦§Ø©Ŗ«¬\ad®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
+  },
+  "cp28603": "iso885913",
+  "iso885914": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ\ad®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
+  },
+  "cp28604": "iso885914",
+  "iso885915": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£€¥Š§š©ª«¬\ad®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
+  },
+  "cp28605": "iso885915",
+  "iso885916": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ĄąŁ€„Š§š©Ș«Ź\adźŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
+  },
+  "cp28606": "iso885916",
+  "cp437": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
+  },
+  "ibm437": "cp437",
+  "csibm437": "cp437",
+  "cp737": {
+    "type": "_sbcs",
+    "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
+  },
+  "ibm737": "cp737",
+  "csibm737": "cp737",
+  "cp775": {
+    "type": "_sbcs",
+    "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’\ad±“¾¶§÷„°∙·¹³²■ "
+  },
+  "ibm775": "cp775",
+  "csibm775": "cp775",
+  "cp850": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´\ad±‗¾¶§÷¸°¨·¹³²■ "
+  },
+  "ibm850": "cp850",
+  "csibm850": "cp850",
+  "cp852": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´\ad˝˛ˇ˘§÷¸°¨˙űŘř■ "
+  },
+  "ibm852": "cp852",
+  "csibm852": "cp852",
+  "cp855": {
+    "type": "_sbcs",
+    "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№\adыЫзЗшШэЭщЩчЧ§■ "
+  },
+  "ibm855": "cp855",
+  "csibm855": "cp855",
+  "cp856": {
+    "type": "_sbcs",
+    "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´\ad±‗¾¶§÷¸°¨·¹³²■ "
+  },
+  "ibm856": "cp856",
+  "csibm856": "cp856",
+  "cp857": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´\ad±�¾¶§÷¸°¨·¹³²■ "
+  },
+  "ibm857": "cp857",
+  "csibm857": "cp857",
+  "cp858": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´\ad±‗¾¶§÷¸°¨·¹³²■ "
+  },
+  "ibm858": "cp858",
+  "csibm858": "cp858",
+  "cp860": {
+    "type": "_sbcs",
+    "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
+  },
+  "ibm860": "cp860",
+  "csibm860": "cp860",
+  "cp861": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
+  },
+  "ibm861": "cp861",
+  "csibm861": "cp861",
+  "cp862": {
+    "type": "_sbcs",
+    "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
+  },
+  "ibm862": "cp862",
+  "csibm862": "cp862",
+  "cp863": {
+    "type": "_sbcs",
+    "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
+  },
+  "ibm863": "cp863",
+  "csibm863": "cp863",
+  "cp864": {
+    "type": "_sbcs",
+    "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7f°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� \adﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"
+  },
+  "ibm864": "cp864",
+  "csibm864": "cp864",
+  "cp865": {
+    "type": "_sbcs",
+    "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
+  },
+  "ibm865": "cp865",
+  "csibm865": "cp865",
+  "cp866": {
+    "type": "_sbcs",
+    "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
+  },
+  "ibm866": "cp866",
+  "csibm866": "cp866",
+  "cp869": {
+    "type": "_sbcs",
+    "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄\ad±υφχ§ψ΅°¨ωϋΰώ■ "
+  },
+  "ibm869": "cp869",
+  "csibm869": "cp869",
+  "cp922": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£¤¥¦§¨©ª«¬\ad®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
+  },
+  "ibm922": "cp922",
+  "csibm922": "cp922",
+  "cp1046": {
+    "type": "_sbcs",
+    "chars": "ﺈ×÷\f8f6\f8f5\f8f4\f8f7\88■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ \f8fa\f8f9\f8f8¤\f8fbﺋﺑﺗﺛﺟﺣ،\adﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟ\f8fcﻵﻷﻹﻻﻣﻧﻬﻩ�"
+  },
+  "ibm1046": "cp1046",
+  "csibm1046": "cp1046",
+  "cp1124": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ЁЂҐЄЅІЇЈЉЊЋЌ\adЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
+  },
+  "ibm1124": "cp1124",
+  "csibm1124": "cp1124",
+  "cp1125": {
+    "type": "_sbcs",
+    "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
+  },
+  "ibm1125": "cp1125",
+  "csibm1125": "cp1125",
+  "cp1129": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£¤¥¦§œ©ª«¬\ad®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
+  },
+  "ibm1129": "cp1129",
+  "csibm1129": "cp1129",
+  "cp1133": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"
+  },
+  "ibm1133": "cp1133",
+  "csibm1133": "cp1133",
+  "cp1161": {
+    "type": "_sbcs",
+    "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
+  },
+  "ibm1161": "cp1161",
+  "csibm1161": "cp1161",
+  "cp1162": {
+    "type": "_sbcs",
+    "chars": "€\81\82\83\84\86\87\88\89\8a\8b\8c\8d\8e\8f\90‘’“”•–—\98\99\9a\9b\9c\9d\9e\9f กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
+  },
+  "ibm1162": "cp1162",
+  "csibm1162": "cp1162",
+  "cp1163": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ¡¢£€¥¦§œ©ª«¬\ad®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
+  },
+  "ibm1163": "cp1163",
+  "csibm1163": "cp1163",
+  "maccroatian": {
+    "type": "_sbcs",
+    "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
+  },
+  "maccyrillic": {
+    "type": "_sbcs",
+    "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
+  },
+  "macgreek": {
+    "type": "_sbcs",
+    "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦\adùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"
+  },
+  "maciceland": {
+    "type": "_sbcs",
+    "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
+  },
+  "macroman": {
+    "type": "_sbcs",
+    "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
+  },
+  "macromania": {
+    "type": "_sbcs",
+    "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
+  },
+  "macthai": {
+    "type": "_sbcs",
+    "chars": "«»…\f88c\f88f\f892\f895\f898\f88b\f88e\f891\f894\f897“”\f899�•\f884\f889\f885\f886\f887\f888\f88a\f88d\f890\f893\f896‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\feff\200b–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"
+  },
+  "macturkish": {
+    "type": "_sbcs",
+    "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"
+  },
+  "macukraine": {
+    "type": "_sbcs",
+    "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
+  },
+  "koi8r": {
+    "type": "_sbcs",
+    "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
+  },
+  "koi8u": {
+    "type": "_sbcs",
+    "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
+  },
+  "koi8ru": {
+    "type": "_sbcs",
+    "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
+  },
+  "koi8t": {
+    "type": "_sbcs",
+    "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬\ad®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
+  },
+  "armscii8": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"
+  },
+  "rk1048": {
+    "type": "_sbcs",
+    "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬\ad®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
+  },
+  "tcvn": {
+    "type": "_sbcs",
+    "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7fÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"
+  },
+  "georgianacademy": {
+    "type": "_sbcs",
+    "chars": "\80\81‚ƒ„…†‡ˆ‰Š‹Œ\8d\8e\8f\90‘’“”•–—˜™š›œ\9d\9eŸ ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
+  },
+  "georgianps": {
+    "type": "_sbcs",
+    "chars": "\80\81‚ƒ„…†‡ˆ‰Š‹Œ\8d\8e\8f\90‘’“”•–—˜™š›œ\9d\9eŸ ¡¢£¤¥¦§¨©ª«¬\ad®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
+  },
+  "pt154": {
+    "type": "_sbcs",
+    "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
+  },
+  "viscii": {
+    "type": "_sbcs",
+    "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\7fẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"
+  },
+  "iso646cn": {
+    "type": "_sbcs",
+    "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾\7f��������������������������������������������������������������������������������������������������������������������������������"
+  },
+  "iso646jp": {
+    "type": "_sbcs",
+    "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾\7f��������������������������������������������������������������������������������������������������������������������������������"
+  },
+  "hproman8": {
+    "type": "_sbcs",
+    "chars": "\80\81\82\83\84\85\86\87\88\89\8a\8b\8c\8d\8e\8f\90\91\92\93\94\95\96\97\98\99\9a\9b\9c\9d\9e\9f ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"
+  },
+  "macintosh": {
+    "type": "_sbcs",
+    "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
+  },
+  "ascii": {
+    "type": "_sbcs",
+    "chars": "��������������������������������������������������������������������������������������������������������������������������������"
+  },
+  "tis620": {
+    "type": "_sbcs",
+    "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
+  }
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-data.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/sbcs-data.js
new file mode 100644 (file)
index 0000000..2d6f846
--- /dev/null
@@ -0,0 +1,169 @@
+"use strict";
+
+// Manually added data to be used by sbcs codec in addition to generated one.
+
+module.exports = {
+    // Not supported by iconv, not sure why.
+    "10029": "maccenteuro",
+    "maccenteuro": {
+        "type": "_sbcs",
+        "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
+    },
+
+    "808": "cp808",
+    "ibm808": "cp808",
+    "cp808": {
+        "type": "_sbcs",
+        "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
+    },
+
+    // Aliases of generated encodings.
+    "ascii8bit": "ascii",
+    "usascii": "ascii",
+    "ansix34": "ascii",
+    "ansix341968": "ascii",
+    "ansix341986": "ascii",
+    "csascii": "ascii",
+    "cp367": "ascii",
+    "ibm367": "ascii",
+    "isoir6": "ascii",
+    "iso646us": "ascii",
+    "iso646irv": "ascii",
+    "us": "ascii",
+
+    "latin1": "iso88591",
+    "latin2": "iso88592",
+    "latin3": "iso88593",
+    "latin4": "iso88594",
+    "latin5": "iso88599",
+    "latin6": "iso885910",
+    "latin7": "iso885913",
+    "latin8": "iso885914",
+    "latin9": "iso885915",
+    "latin10": "iso885916",
+
+    "csisolatin1": "iso88591",
+    "csisolatin2": "iso88592",
+    "csisolatin3": "iso88593",
+    "csisolatin4": "iso88594",
+    "csisolatincyrillic": "iso88595",
+    "csisolatinarabic": "iso88596",
+    "csisolatingreek" : "iso88597",
+    "csisolatinhebrew": "iso88598",
+    "csisolatin5": "iso88599",
+    "csisolatin6": "iso885910",
+
+    "l1": "iso88591",
+    "l2": "iso88592",
+    "l3": "iso88593",
+    "l4": "iso88594",
+    "l5": "iso88599",
+    "l6": "iso885910",
+    "l7": "iso885913",
+    "l8": "iso885914",
+    "l9": "iso885915",
+    "l10": "iso885916",
+
+    "isoir14": "iso646jp",
+    "isoir57": "iso646cn",
+    "isoir100": "iso88591",
+    "isoir101": "iso88592",
+    "isoir109": "iso88593",
+    "isoir110": "iso88594",
+    "isoir144": "iso88595",
+    "isoir127": "iso88596",
+    "isoir126": "iso88597",
+    "isoir138": "iso88598",
+    "isoir148": "iso88599",
+    "isoir157": "iso885910",
+    "isoir166": "tis620",
+    "isoir179": "iso885913",
+    "isoir199": "iso885914",
+    "isoir203": "iso885915",
+    "isoir226": "iso885916",
+
+    "cp819": "iso88591",
+    "ibm819": "iso88591",
+
+    "cyrillic": "iso88595",
+
+    "arabic": "iso88596",
+    "arabic8": "iso88596",
+    "ecma114": "iso88596",
+    "asmo708": "iso88596",
+
+    "greek" : "iso88597",
+    "greek8" : "iso88597",
+    "ecma118" : "iso88597",
+    "elot928" : "iso88597",
+
+    "hebrew": "iso88598",
+    "hebrew8": "iso88598",
+
+    "turkish": "iso88599",
+    "turkish8": "iso88599",
+
+    "thai": "iso885911",
+    "thai8": "iso885911",
+
+    "celtic": "iso885914",
+    "celtic8": "iso885914",
+    "isoceltic": "iso885914",
+
+    "tis6200": "tis620",
+    "tis62025291": "tis620",
+    "tis62025330": "tis620",
+
+    "10000": "macroman",
+    "10006": "macgreek",
+    "10007": "maccyrillic",
+    "10079": "maciceland",
+    "10081": "macturkish",
+
+    "cspc8codepage437": "cp437",
+    "cspc775baltic": "cp775",
+    "cspc850multilingual": "cp850",
+    "cspcp852": "cp852",
+    "cspc862latinhebrew": "cp862",
+    "cpgr": "cp869",
+
+    "msee": "cp1250",
+    "mscyrl": "cp1251",
+    "msansi": "cp1252",
+    "msgreek": "cp1253",
+    "msturk": "cp1254",
+    "mshebr": "cp1255",
+    "msarab": "cp1256",
+    "winbaltrim": "cp1257",
+
+    "cp20866": "koi8r",
+    "20866": "koi8r",
+    "ibm878": "koi8r",
+    "cskoi8r": "koi8r",
+
+    "cp21866": "koi8u",
+    "21866": "koi8u",
+    "ibm1168": "koi8u",
+
+    "strk10482002": "rk1048",
+
+    "tcvn5712": "tcvn",
+    "tcvn57121": "tcvn",
+
+    "gb198880": "iso646cn",
+    "cn": "iso646cn",
+
+    "csiso14jisc6220ro": "iso646jp",
+    "jisc62201969ro": "iso646jp",
+    "jp": "iso646jp",
+
+    "cshproman8": "hproman8",
+    "r8": "hproman8",
+    "roman8": "hproman8",
+    "xroman8": "hproman8",
+    "ibm1051": "hproman8",
+
+    "mac": "macintosh",
+    "csmacintosh": "macintosh",
+};
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/big5-added.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/big5-added.json
new file mode 100644 (file)
index 0000000..3c3d3c2
--- /dev/null
@@ -0,0 +1,122 @@
+[
+["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],
+["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],
+["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],
+["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],
+["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],
+["8940","𪎩𡅅"],
+["8943","攊"],
+["8946","丽滝鵎釟"],
+["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],
+["89a1","琑糼緍楆竉刧"],
+["89ab","醌碸酞肼"],
+["89b0","贋胶𠧧"],
+["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],
+["89c1","溚舾甙"],
+["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],
+["8a40","𧶄唥"],
+["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],
+["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],
+["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],
+["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],
+["8aac","䠋𠆩㿺塳𢶍"],
+["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],
+["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],
+["8ac9","𪘁𠸉𢫏𢳉"],
+["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],
+["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],
+["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],
+["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],
+["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],
+["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],
+["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],
+["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],
+["8ca1","𣏹椙橃𣱣泿"],
+["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],
+["8cc9","顨杫䉶圽"],
+["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],
+["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],
+["8d40","𠮟"],
+["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],
+["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],
+["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],
+["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],
+["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],
+["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],
+["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],
+["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],
+["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],
+["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],
+["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],
+["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],
+["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],
+["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],
+["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],
+["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],
+["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],
+["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],
+["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],
+["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],
+["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],
+["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],
+["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],
+["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],
+["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],
+["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],
+["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],
+["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],
+["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],
+["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],
+["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],
+["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],
+["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],
+["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],
+["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],
+["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],
+["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],
+["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],
+["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],
+["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],
+["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],
+["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],
+["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],
+["9fae","酙隁酜"],
+["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],
+["9fc1","𤤙盖鮝个𠳔莾衂"],
+["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],
+["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],
+["9fe7","毺蠘罸"],
+["9feb","嘠𪙊蹷齓"],
+["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],
+["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],
+["a055","𡠻𦸅"],
+["a058","詾𢔛"],
+["a05b","惽癧髗鵄鍮鮏蟵"],
+["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],
+["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],
+["a0a1","嵗𨯂迚𨸹"],
+["a0a6","僙𡵆礆匲阸𠼻䁥"],
+["a0ae","矾"],
+["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],
+["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],
+["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],
+["a3c0","␀",31,"␡"],
+["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],
+["c740","す",58,"ァアィイ"],
+["c7a1","ゥ",81,"А",5,"ЁЖ",4],
+["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],
+["c8a1","龰冈龱𧘇"],
+["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],
+["c8f5","ʃɐɛɔɵœøŋʊɪ"],
+["f9fe","■"],
+["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],
+["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],
+["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],
+["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],
+["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],
+["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],
+["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],
+["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],
+["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],
+["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp936.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp936.json
new file mode 100644 (file)
index 0000000..49ddb9a
--- /dev/null
@@ -0,0 +1,264 @@
+[
+["0","\u0000",127,"€"],
+["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],
+["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],
+["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],
+["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],
+["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],
+["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],
+["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],
+["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],
+["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],
+["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],
+["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],
+["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],
+["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],
+["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],
+["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],
+["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],
+["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],
+["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],
+["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],
+["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],
+["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],
+["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],
+["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],
+["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],
+["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],
+["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],
+["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],
+["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],
+["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],
+["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],
+["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],
+["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],
+["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],
+["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],
+["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],
+["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],
+["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],
+["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],
+["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],
+["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],
+["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],
+["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],
+["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],
+["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],
+["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],
+["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],
+["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],
+["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],
+["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],
+["9980","檧檨檪檭",114,"欥欦欨",6],
+["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],
+["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],
+["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],
+["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],
+["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],
+["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],
+["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],
+["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],
+["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],
+["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],
+["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],
+["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],
+["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],
+["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],
+["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],
+["a2a1","ⅰ",9],
+["a2b1","⒈",19,"⑴",19,"①",9],
+["a2e5","㈠",9],
+["a2f1","Ⅰ",11],
+["a3a1","!"#¥%",88," ̄"],
+["a4a1","ぁ",82],
+["a5a1","ァ",85],
+["a6a1","Α",16,"Σ",6],
+["a6c1","α",16,"σ",6],
+["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],
+["a6ee","︻︼︷︸︱"],
+["a6f4","︳︴"],
+["a7a1","А",5,"ЁЖ",25],
+["a7d1","а",5,"ёж",25],
+["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],
+["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],
+["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],
+["a8bd","ńň"],
+["a8c0","ɡ"],
+["a8c5","ㄅ",36],
+["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],
+["a959","℡㈱"],
+["a95c","‐"],
+["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],
+["a980","﹢",4,"﹨﹩﹪﹫"],
+["a996","〇"],
+["a9a4","─",75],
+["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],
+["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],
+["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],
+["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],
+["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],
+["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],
+["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],
+["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],
+["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],
+["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],
+["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],
+["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],
+["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],
+["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],
+["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],
+["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],
+["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],
+["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],
+["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],
+["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],
+["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],
+["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],
+["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],
+["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],
+["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],
+["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],
+["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],
+["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],
+["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],
+["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],
+["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],
+["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],
+["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],
+["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],
+["bb40","籃",9,"籎",36,"籵",5,"籾",9],
+["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],
+["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],
+["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],
+["bd40","紷",54,"絯",7],
+["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],
+["be40","継",12,"綧",6,"綯",42],
+["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],
+["bf40","緻",62],
+["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],
+["c040","繞",35,"纃",23,"纜纝纞"],
+["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],
+["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],
+["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],
+["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],
+["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],
+["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],
+["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],
+["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],
+["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],
+["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],
+["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],
+["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],
+["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],
+["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],
+["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],
+["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],
+["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],
+["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],
+["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],
+["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],
+["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],
+["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],
+["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],
+["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],
+["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],
+["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],
+["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],
+["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],
+["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],
+["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],
+["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],
+["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],
+["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],
+["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],
+["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],
+["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],
+["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],
+["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],
+["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],
+["d440","訞",31,"訿",8,"詉",21],
+["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],
+["d540","誁",7,"誋",7,"誔",46],
+["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],
+["d640","諤",34,"謈",27],
+["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],
+["d740","譆",31,"譧",4,"譭",25],
+["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],
+["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],
+["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],
+["d940","貮",62],
+["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],
+["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],
+["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],
+["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],
+["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],
+["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],
+["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],
+["dd40","軥",62],
+["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],
+["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],
+["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],
+["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],
+["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],
+["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],
+["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],
+["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],
+["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],
+["e240","釦",62],
+["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],
+["e340","鉆",45,"鉵",16],
+["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],
+["e440","銨",5,"銯",24,"鋉",31],
+["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],
+["e540","錊",51,"錿",10],
+["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],
+["e640","鍬",34,"鎐",27],
+["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],
+["e740","鏎",7,"鏗",54],
+["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],
+["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],
+["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],
+["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],
+["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],
+["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],
+["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],
+["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],
+["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],
+["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],
+["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],
+["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],
+["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],
+["ee40","頏",62],
+["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],
+["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],
+["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],
+["f040","餈",4,"餎餏餑",28,"餯",26],
+["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],
+["f140","馌馎馚",10,"馦馧馩",47],
+["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],
+["f240","駺",62],
+["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],
+["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],
+["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],
+["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],
+["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],
+["f540","魼",62],
+["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],
+["f640","鯜",62],
+["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],
+["f740","鰼",62],
+["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],
+["f840","鳣",62],
+["f880","鴢",32],
+["f940","鵃",62],
+["f980","鶂",32],
+["fa40","鶣",62],
+["fa80","鷢",32],
+["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],
+["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],
+["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],
+["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],
+["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],
+["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],
+["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp949.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp949.json
new file mode 100644 (file)
index 0000000..2022a00
--- /dev/null
@@ -0,0 +1,273 @@
+[
+["0","\u0000",127],
+["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],
+["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],
+["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],
+["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],
+["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],
+["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],
+["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],
+["8361","긝",18,"긲긳긵긶긹긻긼"],
+["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],
+["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],
+["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],
+["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],
+["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],
+["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],
+["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],
+["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],
+["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],
+["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],
+["8741","놞",9,"놩",15],
+["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],
+["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],
+["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],
+["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],
+["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],
+["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],
+["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],
+["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],
+["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],
+["8a61","둧",4,"둭",18,"뒁뒂"],
+["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],
+["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],
+["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],
+["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],
+["8c41","똀",15,"똒똓똕똖똗똙",4],
+["8c61","똞",6,"똦",5,"똭",6,"똵",5],
+["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],
+["8d41","뛃",16,"뛕",8],
+["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],
+["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],
+["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],
+["8e61","럂",4,"럈럊",19],
+["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],
+["8f41","뢅",7,"뢎",17],
+["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],
+["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],
+["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],
+["9061","륾",5,"릆릈릋릌릏",15],
+["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],
+["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],
+["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],
+["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],
+["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],
+["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],
+["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],
+["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],
+["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],
+["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],
+["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],
+["9461","봞",5,"봥",6,"봭",12],
+["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],
+["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],
+["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],
+["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],
+["9641","뺸",23,"뻒뻓"],
+["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],
+["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],
+["9741","뾃",16,"뾕",8],
+["9761","뾞",17,"뾱",7],
+["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],
+["9841","쁀",16,"쁒",5,"쁙쁚쁛"],
+["9861","쁝쁞쁟쁡",6,"쁪",15],
+["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],
+["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],
+["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],
+["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],
+["9a41","숤숥숦숧숪숬숮숰숳숵",16],
+["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],
+["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],
+["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],
+["9b61","쌳",17,"썆",7],
+["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],
+["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],
+["9c61","쏿",8,"쐉",6,"쐑",9],
+["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],
+["9d41","쒪",13,"쒹쒺쒻쒽",8],
+["9d61","쓆",25],
+["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],
+["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],
+["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],
+["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],
+["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],
+["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],
+["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],
+["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],
+["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],
+["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],
+["a141","좥좦좧좩",18,"좾좿죀죁"],
+["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],
+["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃\ad―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],
+["a241","줐줒",5,"줙",18],
+["a261","줭",6,"줵",18],
+["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],
+["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],
+["a361","즑",6,"즚즜즞",16],
+["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],
+["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],
+["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],
+["a481","쨦쨧쨨쨪",28,"ㄱ",93],
+["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],
+["a561","쩫",17,"쩾",5,"쪅쪆"],
+["a581","쪇",16,"쪙",14,"ⅰ",9],
+["a5b0","Ⅰ",9],
+["a5c1","Α",16,"Σ",6],
+["a5e1","α",16,"σ",6],
+["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],
+["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],
+["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],
+["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],
+["a761","쬪",22,"쭂쭃쭄"],
+["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],
+["a841","쭭",10,"쭺",14],
+["a861","쮉",18,"쮝",6],
+["a881","쮤",19,"쮹",11,"ÆЪĦ"],
+["a8a6","IJ"],
+["a8a8","ĿŁØŒºÞŦŊ"],
+["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],
+["a941","쯅",14,"쯕",10],
+["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],
+["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],
+["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],
+["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],
+["aa81","챳챴챶",29,"ぁ",82],
+["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],
+["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],
+["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],
+["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],
+["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],
+["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],
+["acd1","а",5,"ёж",25],
+["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],
+["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],
+["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],
+["ae41","췆",5,"췍췎췏췑",16],
+["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],
+["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],
+["af41","츬츭츮츯츲츴츶",19],
+["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],
+["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],
+["b041","캚",5,"캢캦",5,"캮",12],
+["b061","캻",5,"컂",19],
+["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],
+["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],
+["b161","켥",6,"켮켲",5,"켹",11],
+["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],
+["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],
+["b261","쾎",18,"쾢",5,"쾩"],
+["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],
+["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],
+["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],
+["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],
+["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],
+["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],
+["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],
+["b541","킕",14,"킦킧킩킪킫킭",5],
+["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],
+["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],
+["b641","턅",7,"턎",17],
+["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],
+["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],
+["b741","텮",13,"텽",6,"톅톆톇톉톊"],
+["b761","톋",20,"톢톣톥톦톧"],
+["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],
+["b841","퇐",7,"퇙",17],
+["b861","퇫",8,"퇵퇶퇷퇹",13],
+["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],
+["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],
+["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],
+["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],
+["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],
+["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],
+["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],
+["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],
+["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],
+["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],
+["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],
+["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],
+["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],
+["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],
+["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],
+["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],
+["be41","퐸",7,"푁푂푃푅",14],
+["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],
+["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],
+["bf41","풞",10,"풪",14],
+["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],
+["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],
+["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],
+["c061","픞",25],
+["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],
+["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],
+["c161","햌햍햎햏햑",19,"햦햧"],
+["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],
+["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],
+["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],
+["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],
+["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],
+["c361","홢",4,"홨홪",5,"홲홳홵",11],
+["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],
+["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],
+["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],
+["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],
+["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],
+["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],
+["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],
+["c641","힍힎힏힑",6,"힚힜힞",5],
+["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],
+["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],
+["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],
+["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],
+["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],
+["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],
+["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],
+["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],
+["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],
+["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],
+["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],
+["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],
+["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],
+["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],
+["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],
+["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],
+["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],
+["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],
+["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],
+["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],
+["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],
+["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],
+["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],
+["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],
+["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],
+["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],
+["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],
+["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],
+["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],
+["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],
+["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],
+["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],
+["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],
+["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],
+["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],
+["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],
+["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],
+["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],
+["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],
+["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],
+["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],
+["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],
+["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],
+["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],
+["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],
+["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],
+["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],
+["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],
+["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],
+["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],
+["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],
+["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],
+["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],
+["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],
+["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp950.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/cp950.json
new file mode 100644 (file)
index 0000000..d8bc871
--- /dev/null
@@ -0,0 +1,177 @@
+[
+["0","\u0000",127],
+["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],
+["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],
+["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],
+["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],
+["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],
+["a3a1","ㄐ",25,"˙ˉˊˇˋ"],
+["a3e1","€"],
+["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],
+["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],
+["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],
+["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],
+["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],
+["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],
+["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],
+["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],
+["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],
+["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],
+["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],
+["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],
+["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],
+["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],
+["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],
+["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],
+["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],
+["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],
+["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],
+["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],
+["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],
+["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],
+["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],
+["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],
+["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],
+["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],
+["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],
+["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],
+["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],
+["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],
+["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],
+["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],
+["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],
+["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],
+["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],
+["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],
+["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],
+["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],
+["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],
+["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],
+["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],
+["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],
+["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],
+["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],
+["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],
+["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],
+["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],
+["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],
+["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],
+["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],
+["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],
+["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],
+["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],
+["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],
+["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],
+["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],
+["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],
+["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],
+["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],
+["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],
+["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],
+["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],
+["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],
+["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],
+["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],
+["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],
+["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],
+["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],
+["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],
+["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],
+["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],
+["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],
+["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],
+["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],
+["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],
+["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],
+["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],
+["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],
+["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],
+["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],
+["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],
+["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],
+["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],
+["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],
+["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],
+["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],
+["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],
+["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],
+["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],
+["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],
+["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],
+["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],
+["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],
+["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],
+["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],
+["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],
+["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],
+["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],
+["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],
+["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],
+["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],
+["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],
+["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],
+["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],
+["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],
+["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],
+["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],
+["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],
+["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],
+["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],
+["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],
+["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],
+["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],
+["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],
+["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],
+["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],
+["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],
+["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],
+["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],
+["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],
+["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],
+["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],
+["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],
+["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],
+["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],
+["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],
+["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],
+["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],
+["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],
+["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],
+["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],
+["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],
+["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],
+["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],
+["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],
+["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],
+["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],
+["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],
+["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],
+["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],
+["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],
+["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],
+["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],
+["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],
+["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],
+["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],
+["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],
+["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],
+["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],
+["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],
+["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],
+["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],
+["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],
+["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],
+["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],
+["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],
+["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],
+["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],
+["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],
+["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],
+["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],
+["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],
+["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],
+["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],
+["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],
+["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],
+["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/eucjp.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/eucjp.json
new file mode 100644 (file)
index 0000000..4fa61ca
--- /dev/null
@@ -0,0 +1,182 @@
+[
+["0","\u0000",127],
+["8ea1","。",62],
+["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],
+["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],
+["a2ba","∈∋⊆⊇⊂⊃∪∩"],
+["a2ca","∧∨¬⇒⇔∀∃"],
+["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],
+["a2f2","ʼn♯♭♪†‡¶"],
+["a2fe","◯"],
+["a3b0","0",9],
+["a3c1","A",25],
+["a3e1","a",25],
+["a4a1","ぁ",82],
+["a5a1","ァ",85],
+["a6a1","Α",16,"Σ",6],
+["a6c1","α",16,"σ",6],
+["a7a1","А",5,"ЁЖ",25],
+["a7d1","а",5,"ёж",25],
+["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],
+["ada1","①",19,"Ⅰ",9],
+["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],
+["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],
+["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],
+["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],
+["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],
+["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],
+["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],
+["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],
+["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],
+["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],
+["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],
+["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],
+["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],
+["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],
+["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],
+["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],
+["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],
+["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],
+["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],
+["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],
+["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],
+["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],
+["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],
+["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],
+["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],
+["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],
+["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],
+["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],
+["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],
+["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],
+["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],
+["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],
+["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],
+["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],
+["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],
+["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],
+["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],
+["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],
+["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],
+["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],
+["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],
+["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],
+["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],
+["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],
+["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],
+["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],
+["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],
+["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],
+["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],
+["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],
+["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],
+["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],
+["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],
+["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],
+["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],
+["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],
+["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],
+["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],
+["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],
+["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],
+["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],
+["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],
+["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],
+["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],
+["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],
+["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],
+["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],
+["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],
+["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],
+["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],
+["f4a1","堯槇遙瑤凜熙"],
+["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],
+["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],
+["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],
+["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],
+["fcf1","ⅰ",9,"¬¦'""],
+["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],
+["8fa2c2","¡¦¿"],
+["8fa2eb","ºª©®™¤№"],
+["8fa6e1","ΆΈΉΊΪ"],
+["8fa6e7","Ό"],
+["8fa6e9","ΎΫ"],
+["8fa6ec","Ώ"],
+["8fa6f1","άέήίϊΐόςύϋΰώ"],
+["8fa7c2","Ђ",10,"ЎЏ"],
+["8fa7f2","ђ",10,"ўџ"],
+["8fa9a1","ÆĐ"],
+["8fa9a4","Ħ"],
+["8fa9a6","IJ"],
+["8fa9a8","ŁĿ"],
+["8fa9ab","ŊØŒ"],
+["8fa9af","ŦÞ"],
+["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],
+["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],
+["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],
+["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],
+["8fabbd","ġĥíìïîǐ"],
+["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],
+["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],
+["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],
+["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],
+["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],
+["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],
+["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],
+["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],
+["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],
+["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],
+["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],
+["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],
+["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],
+["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],
+["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],
+["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],
+["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],
+["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],
+["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],
+["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],
+["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],
+["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],
+["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],
+["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],
+["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],
+["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],
+["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],
+["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],
+["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],
+["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],
+["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],
+["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],
+["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],
+["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],
+["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],
+["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],
+["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],
+["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],
+["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],
+["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],
+["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],
+["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],
+["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],
+["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],
+["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],
+["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],
+["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],
+["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],
+["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],
+["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],
+["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],
+["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],
+["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],
+["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],
+["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],
+["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],
+["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],
+["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],
+["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],
+["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],
+["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],
+["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],
+["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
new file mode 100644 (file)
index 0000000..85c6934
--- /dev/null
@@ -0,0 +1 @@
+{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/gbk-added.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/gbk-added.json
new file mode 100644 (file)
index 0000000..8abfa9f
--- /dev/null
@@ -0,0 +1,55 @@
+[
+["a140","\e4c6",62],
+["a180","\e505",32],
+["a240","\e526",62],
+["a280","\e565",32],
+["a2ab","\e766",5],
+["a2e3","€\e76d"],
+["a2ef","\e76e\e76f"],
+["a2fd","\e770\e771"],
+["a340","\e586",62],
+["a380","\e5c5",31," "],
+["a440","\e5e6",62],
+["a480","\e625",32],
+["a4f4","\e772",10],
+["a540","\e646",62],
+["a580","\e685",32],
+["a5f7","\e77d",7],
+["a640","\e6a6",62],
+["a680","\e6e5",32],
+["a6b9","\e785",7],
+["a6d9","\e78d",6],
+["a6ec","\e794\e795"],
+["a6f3","\e796"],
+["a6f6","\e797",8],
+["a740","\e706",62],
+["a780","\e745",32],
+["a7c2","\e7a0",14],
+["a7f2","\e7af",12],
+["a896","\e7bc",10],
+["a8bc","\e7c7"],
+["a8bf","ǹ"],
+["a8c1","\e7c9\e7ca\e7cb\e7cc"],
+["a8ea","\e7cd",20],
+["a958","\e7e2"],
+["a95b","\e7e3"],
+["a95d","\e7e4\e7e5\e7e6"],
+["a989","〾⿰",11],
+["a997","\e7f4",12],
+["a9f0","\e801",14],
+["aaa1","\e000",93],
+["aba1","\e05e",93],
+["aca1","\e0bc",93],
+["ada1","\e11a",93],
+["aea1","\e178",93],
+["afa1","\e1d6",93],
+["d7fa","\e810",4],
+["f8a1","\e234",93],
+["f9a1","\e292",93],
+["faa1","\e2f0",93],
+["fba1","\e34e",93],
+["fca1","\e3ac",93],
+["fda1","\e40a",93],
+["fe50","⺁\e816\e817\e818⺄㑳㑇⺈⺋\e81e㖞㘚㘎⺌⺗㥮㤘\e826㧏㧟㩳㧐\e82b\e82c㭎㱮㳠⺧\e831\e832⺪䁖䅟⺮䌷⺳⺶⺷\e83b䎱䎬⺻䏝䓖䙡䙌\e843"],
+["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶\e854\e855䲣䲟䲠䲡䱷䲢䴓",6,"䶮\e864\e468",93]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/shiftjis.json b/legacy-libs/grpc/node_modules/iconv-lite/encodings/tables/shiftjis.json
new file mode 100644 (file)
index 0000000..5a3a43c
--- /dev/null
@@ -0,0 +1,125 @@
+[
+["0","\u0000",128],
+["a1","。",62],
+["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],
+["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],
+["81b8","∈∋⊆⊇⊂⊃∪∩"],
+["81c8","∧∨¬⇒⇔∀∃"],
+["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],
+["81f0","ʼn♯♭♪†‡¶"],
+["81fc","◯"],
+["824f","0",9],
+["8260","A",25],
+["8281","a",25],
+["829f","ぁ",82],
+["8340","ァ",62],
+["8380","ム",22],
+["839f","Α",16,"Σ",6],
+["83bf","α",16,"σ",6],
+["8440","А",5,"ЁЖ",25],
+["8470","а",5,"ёж",7],
+["8480","о",17],
+["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],
+["8740","①",19,"Ⅰ",9],
+["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],
+["877e","㍻"],
+["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],
+["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],
+["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],
+["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],
+["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],
+["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],
+["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],
+["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],
+["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],
+["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],
+["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],
+["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],
+["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],
+["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],
+["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],
+["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],
+["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],
+["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],
+["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],
+["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],
+["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],
+["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],
+["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],
+["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],
+["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],
+["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],
+["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],
+["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],
+["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],
+["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],
+["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],
+["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],
+["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],
+["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],
+["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],
+["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],
+["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],
+["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],
+["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],
+["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],
+["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],
+["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],
+["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],
+["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],
+["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],
+["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],
+["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],
+["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],
+["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],
+["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],
+["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],
+["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],
+["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],
+["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],
+["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],
+["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],
+["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],
+["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],
+["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],
+["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],
+["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],
+["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],
+["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],
+["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],
+["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],
+["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],
+["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],
+["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],
+["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],
+["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],
+["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],
+["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],
+["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],
+["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],
+["eeef","ⅰ",9,"¬¦'""],
+["f040","\e000",62],
+["f080","\e03f",124],
+["f140","\e0bc",62],
+["f180","\e0fb",124],
+["f240","\e178",62],
+["f280","\e1b7",124],
+["f340","\e234",62],
+["f380","\e273",124],
+["f440","\e2f0",62],
+["f480","\e32f",124],
+["f540","\e3ac",62],
+["f580","\e3eb",124],
+["f640","\e468",62],
+["f680","\e4a7",124],
+["f740","\e524",62],
+["f780","\e563",124],
+["f840","\e5e0",62],
+["f880","\e61f",124],
+["f940","\e69c"],
+["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],
+["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],
+["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],
+["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],
+["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]
+]
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/utf16.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/utf16.js
new file mode 100644 (file)
index 0000000..54765ae
--- /dev/null
@@ -0,0 +1,177 @@
+"use strict";
+var Buffer = require("safer-buffer").Buffer;
+
+// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
+
+// == UTF16-BE codec. ==========================================================
+
+exports.utf16be = Utf16BECodec;
+function Utf16BECodec() {
+}
+
+Utf16BECodec.prototype.encoder = Utf16BEEncoder;
+Utf16BECodec.prototype.decoder = Utf16BEDecoder;
+Utf16BECodec.prototype.bomAware = true;
+
+
+// -- Encoding
+
+function Utf16BEEncoder() {
+}
+
+Utf16BEEncoder.prototype.write = function(str) {
+    var buf = Buffer.from(str, 'ucs2');
+    for (var i = 0; i < buf.length; i += 2) {
+        var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
+    }
+    return buf;
+}
+
+Utf16BEEncoder.prototype.end = function() {
+}
+
+
+// -- Decoding
+
+function Utf16BEDecoder() {
+    this.overflowByte = -1;
+}
+
+Utf16BEDecoder.prototype.write = function(buf) {
+    if (buf.length == 0)
+        return '';
+
+    var buf2 = Buffer.alloc(buf.length + 1),
+        i = 0, j = 0;
+
+    if (this.overflowByte !== -1) {
+        buf2[0] = buf[0];
+        buf2[1] = this.overflowByte;
+        i = 1; j = 2;
+    }
+
+    for (; i < buf.length-1; i += 2, j+= 2) {
+        buf2[j] = buf[i+1];
+        buf2[j+1] = buf[i];
+    }
+
+    this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
+
+    return buf2.slice(0, j).toString('ucs2');
+}
+
+Utf16BEDecoder.prototype.end = function() {
+}
+
+
+// == UTF-16 codec =============================================================
+// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
+// Defaults to UTF-16LE, as it's prevalent and default in Node.
+// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
+// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
+
+// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
+
+exports.utf16 = Utf16Codec;
+function Utf16Codec(codecOptions, iconv) {
+    this.iconv = iconv;
+}
+
+Utf16Codec.prototype.encoder = Utf16Encoder;
+Utf16Codec.prototype.decoder = Utf16Decoder;
+
+
+// -- Encoding (pass-through)
+
+function Utf16Encoder(options, codec) {
+    options = options || {};
+    if (options.addBOM === undefined)
+        options.addBOM = true;
+    this.encoder = codec.iconv.getEncoder('utf-16le', options);
+}
+
+Utf16Encoder.prototype.write = function(str) {
+    return this.encoder.write(str);
+}
+
+Utf16Encoder.prototype.end = function() {
+    return this.encoder.end();
+}
+
+
+// -- Decoding
+
+function Utf16Decoder(options, codec) {
+    this.decoder = null;
+    this.initialBytes = [];
+    this.initialBytesLen = 0;
+
+    this.options = options || {};
+    this.iconv = codec.iconv;
+}
+
+Utf16Decoder.prototype.write = function(buf) {
+    if (!this.decoder) {
+        // Codec is not chosen yet. Accumulate initial bytes.
+        this.initialBytes.push(buf);
+        this.initialBytesLen += buf.length;
+        
+        if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)
+            return '';
+
+        // We have enough bytes -> detect endianness.
+        var buf = Buffer.concat(this.initialBytes),
+            encoding = detectEncoding(buf, this.options.defaultEncoding);
+        this.decoder = this.iconv.getDecoder(encoding, this.options);
+        this.initialBytes.length = this.initialBytesLen = 0;
+    }
+
+    return this.decoder.write(buf);
+}
+
+Utf16Decoder.prototype.end = function() {
+    if (!this.decoder) {
+        var buf = Buffer.concat(this.initialBytes),
+            encoding = detectEncoding(buf, this.options.defaultEncoding);
+        this.decoder = this.iconv.getDecoder(encoding, this.options);
+
+        var res = this.decoder.write(buf),
+            trail = this.decoder.end();
+
+        return trail ? (res + trail) : res;
+    }
+    return this.decoder.end();
+}
+
+function detectEncoding(buf, defaultEncoding) {
+    var enc = defaultEncoding || 'utf-16le';
+
+    if (buf.length >= 2) {
+        // Check BOM.
+        if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM
+            enc = 'utf-16be';
+        else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM
+            enc = 'utf-16le';
+        else {
+            // No BOM found. Try to deduce encoding from initial content.
+            // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
+            // So, we count ASCII as if it was LE or BE, and decide from that.
+            var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions
+                _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.
+
+            for (var i = 0; i < _len; i += 2) {
+                if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;
+                if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;
+            }
+
+            if (asciiCharsBE > asciiCharsLE)
+                enc = 'utf-16be';
+            else if (asciiCharsBE < asciiCharsLE)
+                enc = 'utf-16le';
+        }
+    }
+
+    return enc;
+}
+
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/encodings/utf7.js b/legacy-libs/grpc/node_modules/iconv-lite/encodings/utf7.js
new file mode 100644 (file)
index 0000000..b7631c2
--- /dev/null
@@ -0,0 +1,290 @@
+"use strict";
+var Buffer = require("safer-buffer").Buffer;
+
+// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
+// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
+
+exports.utf7 = Utf7Codec;
+exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
+function Utf7Codec(codecOptions, iconv) {
+    this.iconv = iconv;
+};
+
+Utf7Codec.prototype.encoder = Utf7Encoder;
+Utf7Codec.prototype.decoder = Utf7Decoder;
+Utf7Codec.prototype.bomAware = true;
+
+
+// -- Encoding
+
+var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
+
+function Utf7Encoder(options, codec) {
+    this.iconv = codec.iconv;
+}
+
+Utf7Encoder.prototype.write = function(str) {
+    // Naive implementation.
+    // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
+    return Buffer.from(str.replace(nonDirectChars, function(chunk) {
+        return "+" + (chunk === '+' ? '' : 
+            this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) 
+            + "-";
+    }.bind(this)));
+}
+
+Utf7Encoder.prototype.end = function() {
+}
+
+
+// -- Decoding
+
+function Utf7Decoder(options, codec) {
+    this.iconv = codec.iconv;
+    this.inBase64 = false;
+    this.base64Accum = '';
+}
+
+var base64Regex = /[A-Za-z0-9\/+]/;
+var base64Chars = [];
+for (var i = 0; i < 256; i++)
+    base64Chars[i] = base64Regex.test(String.fromCharCode(i));
+
+var plusChar = '+'.charCodeAt(0), 
+    minusChar = '-'.charCodeAt(0),
+    andChar = '&'.charCodeAt(0);
+
+Utf7Decoder.prototype.write = function(buf) {
+    var res = "", lastI = 0,
+        inBase64 = this.inBase64,
+        base64Accum = this.base64Accum;
+
+    // The decoder is more involved as we must handle chunks in stream.
+
+    for (var i = 0; i < buf.length; i++) {
+        if (!inBase64) { // We're in direct mode.
+            // Write direct chars until '+'
+            if (buf[i] == plusChar) {
+                res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
+                lastI = i+1;
+                inBase64 = true;
+            }
+        } else { // We decode base64.
+            if (!base64Chars[buf[i]]) { // Base64 ended.
+                if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
+                    res += "+";
+                } else {
+                    var b64str = base64Accum + buf.slice(lastI, i).toString();
+                    res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
+                }
+
+                if (buf[i] != minusChar) // Minus is absorbed after base64.
+                    i--;
+
+                lastI = i+1;
+                inBase64 = false;
+                base64Accum = '';
+            }
+        }
+    }
+
+    if (!inBase64) {
+        res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
+    } else {
+        var b64str = base64Accum + buf.slice(lastI).toString();
+
+        var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
+        base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
+        b64str = b64str.slice(0, canBeDecoded);
+
+        res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
+    }
+
+    this.inBase64 = inBase64;
+    this.base64Accum = base64Accum;
+
+    return res;
+}
+
+Utf7Decoder.prototype.end = function() {
+    var res = "";
+    if (this.inBase64 && this.base64Accum.length > 0)
+        res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
+
+    this.inBase64 = false;
+    this.base64Accum = '';
+    return res;
+}
+
+
+// UTF-7-IMAP codec.
+// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
+// Differences:
+//  * Base64 part is started by "&" instead of "+"
+//  * Direct characters are 0x20-0x7E, except "&" (0x26)
+//  * In Base64, "," is used instead of "/"
+//  * Base64 must not be used to represent direct characters.
+//  * No implicit shift back from Base64 (should always end with '-')
+//  * String must end in non-shifted position.
+//  * "-&" while in base64 is not allowed.
+
+
+exports.utf7imap = Utf7IMAPCodec;
+function Utf7IMAPCodec(codecOptions, iconv) {
+    this.iconv = iconv;
+};
+
+Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
+Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
+Utf7IMAPCodec.prototype.bomAware = true;
+
+
+// -- Encoding
+
+function Utf7IMAPEncoder(options, codec) {
+    this.iconv = codec.iconv;
+    this.inBase64 = false;
+    this.base64Accum = Buffer.alloc(6);
+    this.base64AccumIdx = 0;
+}
+
+Utf7IMAPEncoder.prototype.write = function(str) {
+    var inBase64 = this.inBase64,
+        base64Accum = this.base64Accum,
+        base64AccumIdx = this.base64AccumIdx,
+        buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
+
+    for (var i = 0; i < str.length; i++) {
+        var uChar = str.charCodeAt(i);
+        if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
+            if (inBase64) {
+                if (base64AccumIdx > 0) {
+                    bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
+                    base64AccumIdx = 0;
+                }
+
+                buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
+                inBase64 = false;
+            }
+
+            if (!inBase64) {
+                buf[bufIdx++] = uChar; // Write direct character
+
+                if (uChar === andChar)  // Ampersand -> '&-'
+                    buf[bufIdx++] = minusChar;
+            }
+
+        } else { // Non-direct character
+            if (!inBase64) {
+                buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
+                inBase64 = true;
+            }
+            if (inBase64) {
+                base64Accum[base64AccumIdx++] = uChar >> 8;
+                base64Accum[base64AccumIdx++] = uChar & 0xFF;
+
+                if (base64AccumIdx == base64Accum.length) {
+                    bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
+                    base64AccumIdx = 0;
+                }
+            }
+        }
+    }
+
+    this.inBase64 = inBase64;
+    this.base64AccumIdx = base64AccumIdx;
+
+    return buf.slice(0, bufIdx);
+}
+
+Utf7IMAPEncoder.prototype.end = function() {
+    var buf = Buffer.alloc(10), bufIdx = 0;
+    if (this.inBase64) {
+        if (this.base64AccumIdx > 0) {
+            bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
+            this.base64AccumIdx = 0;
+        }
+
+        buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
+        this.inBase64 = false;
+    }
+
+    return buf.slice(0, bufIdx);
+}
+
+
+// -- Decoding
+
+function Utf7IMAPDecoder(options, codec) {
+    this.iconv = codec.iconv;
+    this.inBase64 = false;
+    this.base64Accum = '';
+}
+
+var base64IMAPChars = base64Chars.slice();
+base64IMAPChars[','.charCodeAt(0)] = true;
+
+Utf7IMAPDecoder.prototype.write = function(buf) {
+    var res = "", lastI = 0,
+        inBase64 = this.inBase64,
+        base64Accum = this.base64Accum;
+
+    // The decoder is more involved as we must handle chunks in stream.
+    // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
+
+    for (var i = 0; i < buf.length; i++) {
+        if (!inBase64) { // We're in direct mode.
+            // Write direct chars until '&'
+            if (buf[i] == andChar) {
+                res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
+                lastI = i+1;
+                inBase64 = true;
+            }
+        } else { // We decode base64.
+            if (!base64IMAPChars[buf[i]]) { // Base64 ended.
+                if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
+                    res += "&";
+                } else {
+                    var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');
+                    res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
+                }
+
+                if (buf[i] != minusChar) // Minus may be absorbed after base64.
+                    i--;
+
+                lastI = i+1;
+                inBase64 = false;
+                base64Accum = '';
+            }
+        }
+    }
+
+    if (!inBase64) {
+        res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
+    } else {
+        var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');
+
+        var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
+        base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
+        b64str = b64str.slice(0, canBeDecoded);
+
+        res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
+    }
+
+    this.inBase64 = inBase64;
+    this.base64Accum = base64Accum;
+
+    return res;
+}
+
+Utf7IMAPDecoder.prototype.end = function() {
+    var res = "";
+    if (this.inBase64 && this.base64Accum.length > 0)
+        res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
+
+    this.inBase64 = false;
+    this.base64Accum = '';
+    return res;
+}
+
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/lib/bom-handling.js b/legacy-libs/grpc/node_modules/iconv-lite/lib/bom-handling.js
new file mode 100644 (file)
index 0000000..1050872
--- /dev/null
@@ -0,0 +1,52 @@
+"use strict";
+
+var BOMChar = '\uFEFF';
+
+exports.PrependBOM = PrependBOMWrapper
+function PrependBOMWrapper(encoder, options) {
+    this.encoder = encoder;
+    this.addBOM = true;
+}
+
+PrependBOMWrapper.prototype.write = function(str) {
+    if (this.addBOM) {
+        str = BOMChar + str;
+        this.addBOM = false;
+    }
+
+    return this.encoder.write(str);
+}
+
+PrependBOMWrapper.prototype.end = function() {
+    return this.encoder.end();
+}
+
+
+//------------------------------------------------------------------------------
+
+exports.StripBOM = StripBOMWrapper;
+function StripBOMWrapper(decoder, options) {
+    this.decoder = decoder;
+    this.pass = false;
+    this.options = options || {};
+}
+
+StripBOMWrapper.prototype.write = function(buf) {
+    var res = this.decoder.write(buf);
+    if (this.pass || !res)
+        return res;
+
+    if (res[0] === BOMChar) {
+        res = res.slice(1);
+        if (typeof this.options.stripBOM === 'function')
+            this.options.stripBOM();
+    }
+
+    this.pass = true;
+    return res;
+}
+
+StripBOMWrapper.prototype.end = function() {
+    return this.decoder.end();
+}
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/lib/extend-node.js b/legacy-libs/grpc/node_modules/iconv-lite/lib/extend-node.js
new file mode 100644 (file)
index 0000000..87f5394
--- /dev/null
@@ -0,0 +1,217 @@
+"use strict";
+var Buffer = require("buffer").Buffer;
+// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer
+
+// == Extend Node primitives to use iconv-lite =================================
+
+module.exports = function (iconv) {
+    var original = undefined; // Place to keep original methods.
+
+    // Node authors rewrote Buffer internals to make it compatible with
+    // Uint8Array and we cannot patch key functions since then.
+    // Note: this does use older Buffer API on a purpose
+    iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);
+
+    iconv.extendNodeEncodings = function extendNodeEncodings() {
+        if (original) return;
+        original = {};
+
+        if (!iconv.supportsNodeEncodingsExtension) {
+            console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node");
+            console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility");
+            return;
+        }
+
+        var nodeNativeEncodings = {
+            'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true, 
+            'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,
+        };
+
+        Buffer.isNativeEncoding = function(enc) {
+            return enc && nodeNativeEncodings[enc.toLowerCase()];
+        }
+
+        // -- SlowBuffer -----------------------------------------------------------
+        var SlowBuffer = require('buffer').SlowBuffer;
+
+        original.SlowBufferToString = SlowBuffer.prototype.toString;
+        SlowBuffer.prototype.toString = function(encoding, start, end) {
+            encoding = String(encoding || 'utf8').toLowerCase();
+
+            // Use native conversion when possible
+            if (Buffer.isNativeEncoding(encoding))
+                return original.SlowBufferToString.call(this, encoding, start, end);
+
+            // Otherwise, use our decoding method.
+            if (typeof start == 'undefined') start = 0;
+            if (typeof end == 'undefined') end = this.length;
+            return iconv.decode(this.slice(start, end), encoding);
+        }
+
+        original.SlowBufferWrite = SlowBuffer.prototype.write;
+        SlowBuffer.prototype.write = function(string, offset, length, encoding) {
+            // Support both (string, offset, length, encoding)
+            // and the legacy (string, encoding, offset, length)
+            if (isFinite(offset)) {
+                if (!isFinite(length)) {
+                    encoding = length;
+                    length = undefined;
+                }
+            } else {  // legacy
+                var swap = encoding;
+                encoding = offset;
+                offset = length;
+                length = swap;
+            }
+
+            offset = +offset || 0;
+            var remaining = this.length - offset;
+            if (!length) {
+                length = remaining;
+            } else {
+                length = +length;
+                if (length > remaining) {
+                    length = remaining;
+                }
+            }
+            encoding = String(encoding || 'utf8').toLowerCase();
+
+            // Use native conversion when possible
+            if (Buffer.isNativeEncoding(encoding))
+                return original.SlowBufferWrite.call(this, string, offset, length, encoding);
+
+            if (string.length > 0 && (length < 0 || offset < 0))
+                throw new RangeError('attempt to write beyond buffer bounds');
+
+            // Otherwise, use our encoding method.
+            var buf = iconv.encode(string, encoding);
+            if (buf.length < length) length = buf.length;
+            buf.copy(this, offset, 0, length);
+            return length;
+        }
+
+        // -- Buffer ---------------------------------------------------------------
+
+        original.BufferIsEncoding = Buffer.isEncoding;
+        Buffer.isEncoding = function(encoding) {
+            return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);
+        }
+
+        original.BufferByteLength = Buffer.byteLength;
+        Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {
+            encoding = String(encoding || 'utf8').toLowerCase();
+
+            // Use native conversion when possible
+            if (Buffer.isNativeEncoding(encoding))
+                return original.BufferByteLength.call(this, str, encoding);
+
+            // Slow, I know, but we don't have a better way yet.
+            return iconv.encode(str, encoding).length;
+        }
+
+        original.BufferToString = Buffer.prototype.toString;
+        Buffer.prototype.toString = function(encoding, start, end) {
+            encoding = String(encoding || 'utf8').toLowerCase();
+
+            // Use native conversion when possible
+            if (Buffer.isNativeEncoding(encoding))
+                return original.BufferToString.call(this, encoding, start, end);
+
+            // Otherwise, use our decoding method.
+            if (typeof start == 'undefined') start = 0;
+            if (typeof end == 'undefined') end = this.length;
+            return iconv.decode(this.slice(start, end), encoding);
+        }
+
+        original.BufferWrite = Buffer.prototype.write;
+        Buffer.prototype.write = function(string, offset, length, encoding) {
+            var _offset = offset, _length = length, _encoding = encoding;
+            // Support both (string, offset, length, encoding)
+            // and the legacy (string, encoding, offset, length)
+            if (isFinite(offset)) {
+                if (!isFinite(length)) {
+                    encoding = length;
+                    length = undefined;
+                }
+            } else {  // legacy
+                var swap = encoding;
+                encoding = offset;
+                offset = length;
+                length = swap;
+            }
+
+            encoding = String(encoding || 'utf8').toLowerCase();
+
+            // Use native conversion when possible
+            if (Buffer.isNativeEncoding(encoding))
+                return original.BufferWrite.call(this, string, _offset, _length, _encoding);
+
+            offset = +offset || 0;
+            var remaining = this.length - offset;
+            if (!length) {
+                length = remaining;
+            } else {
+                length = +length;
+                if (length > remaining) {
+                    length = remaining;
+                }
+            }
+
+            if (string.length > 0 && (length < 0 || offset < 0))
+                throw new RangeError('attempt to write beyond buffer bounds');
+
+            // Otherwise, use our encoding method.
+            var buf = iconv.encode(string, encoding);
+            if (buf.length < length) length = buf.length;
+            buf.copy(this, offset, 0, length);
+            return length;
+
+            // TODO: Set _charsWritten.
+        }
+
+
+        // -- Readable -------------------------------------------------------------
+        if (iconv.supportsStreams) {
+            var Readable = require('stream').Readable;
+
+            original.ReadableSetEncoding = Readable.prototype.setEncoding;
+            Readable.prototype.setEncoding = function setEncoding(enc, options) {
+                // Use our own decoder, it has the same interface.
+                // We cannot use original function as it doesn't handle BOM-s.
+                this._readableState.decoder = iconv.getDecoder(enc, options);
+                this._readableState.encoding = enc;
+            }
+
+            Readable.prototype.collect = iconv._collect;
+        }
+    }
+
+    // Remove iconv-lite Node primitive extensions.
+    iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {
+        if (!iconv.supportsNodeEncodingsExtension)
+            return;
+        if (!original)
+            throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.")
+
+        delete Buffer.isNativeEncoding;
+
+        var SlowBuffer = require('buffer').SlowBuffer;
+
+        SlowBuffer.prototype.toString = original.SlowBufferToString;
+        SlowBuffer.prototype.write = original.SlowBufferWrite;
+
+        Buffer.isEncoding = original.BufferIsEncoding;
+        Buffer.byteLength = original.BufferByteLength;
+        Buffer.prototype.toString = original.BufferToString;
+        Buffer.prototype.write = original.BufferWrite;
+
+        if (iconv.supportsStreams) {
+            var Readable = require('stream').Readable;
+
+            Readable.prototype.setEncoding = original.ReadableSetEncoding;
+            delete Readable.prototype.collect;
+        }
+
+        original = undefined;
+    }
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/lib/index.d.ts b/legacy-libs/grpc/node_modules/iconv-lite/lib/index.d.ts
new file mode 100644 (file)
index 0000000..0547eb3
--- /dev/null
@@ -0,0 +1,24 @@
+/*---------------------------------------------------------------------------------------------
+ *  Copyright (c) Microsoft Corporation. All rights reserved.
+ *  Licensed under the MIT License.
+ *  REQUIREMENT: This definition is dependent on the @types/node definition.
+ *  Install with `npm install @types/node --save-dev`
+ *--------------------------------------------------------------------------------------------*/
+
+declare module 'iconv-lite' {
+       export function decode(buffer: Buffer, encoding: string, options?: Options): string;
+
+       export function encode(content: string, encoding: string, options?: Options): Buffer;
+
+       export function encodingExists(encoding: string): boolean;
+
+       export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
+
+       export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
+}
+
+export interface Options {
+    stripBOM?: boolean;
+    addBOM?: boolean;
+    defaultEncoding?: string;
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/lib/index.js b/legacy-libs/grpc/node_modules/iconv-lite/lib/index.js
new file mode 100644 (file)
index 0000000..5391919
--- /dev/null
@@ -0,0 +1,153 @@
+"use strict";
+
+// Some environments don't have global Buffer (e.g. React Native).
+// Solution would be installing npm modules "buffer" and "stream" explicitly.
+var Buffer = require("safer-buffer").Buffer;
+
+var bomHandling = require("./bom-handling"),
+    iconv = module.exports;
+
+// All codecs and aliases are kept here, keyed by encoding name/alias.
+// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
+iconv.encodings = null;
+
+// Characters emitted in case of error.
+iconv.defaultCharUnicode = '�';
+iconv.defaultCharSingleByte = '?';
+
+// Public API.
+iconv.encode = function encode(str, encoding, options) {
+    str = "" + (str || ""); // Ensure string.
+
+    var encoder = iconv.getEncoder(encoding, options);
+
+    var res = encoder.write(str);
+    var trail = encoder.end();
+    
+    return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
+}
+
+iconv.decode = function decode(buf, encoding, options) {
+    if (typeof buf === 'string') {
+        if (!iconv.skipDecodeWarning) {
+            console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
+            iconv.skipDecodeWarning = true;
+        }
+
+        buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
+    }
+
+    var decoder = iconv.getDecoder(encoding, options);
+
+    var res = decoder.write(buf);
+    var trail = decoder.end();
+
+    return trail ? (res + trail) : res;
+}
+
+iconv.encodingExists = function encodingExists(enc) {
+    try {
+        iconv.getCodec(enc);
+        return true;
+    } catch (e) {
+        return false;
+    }
+}
+
+// Legacy aliases to convert functions
+iconv.toEncoding = iconv.encode;
+iconv.fromEncoding = iconv.decode;
+
+// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
+iconv._codecDataCache = {};
+iconv.getCodec = function getCodec(encoding) {
+    if (!iconv.encodings)
+        iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
+    
+    // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
+    var enc = iconv._canonicalizeEncoding(encoding);
+
+    // Traverse iconv.encodings to find actual codec.
+    var codecOptions = {};
+    while (true) {
+        var codec = iconv._codecDataCache[enc];
+        if (codec)
+            return codec;
+
+        var codecDef = iconv.encodings[enc];
+
+        switch (typeof codecDef) {
+            case "string": // Direct alias to other encoding.
+                enc = codecDef;
+                break;
+
+            case "object": // Alias with options. Can be layered.
+                for (var key in codecDef)
+                    codecOptions[key] = codecDef[key];
+
+                if (!codecOptions.encodingName)
+                    codecOptions.encodingName = enc;
+                
+                enc = codecDef.type;
+                break;
+
+            case "function": // Codec itself.
+                if (!codecOptions.encodingName)
+                    codecOptions.encodingName = enc;
+
+                // The codec function must load all tables and return object with .encoder and .decoder methods.
+                // It'll be called only once (for each different options object).
+                codec = new codecDef(codecOptions, iconv);
+
+                iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
+                return codec;
+
+            default:
+                throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
+        }
+    }
+}
+
+iconv._canonicalizeEncoding = function(encoding) {
+    // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
+    return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
+}
+
+iconv.getEncoder = function getEncoder(encoding, options) {
+    var codec = iconv.getCodec(encoding),
+        encoder = new codec.encoder(options, codec);
+
+    if (codec.bomAware && options && options.addBOM)
+        encoder = new bomHandling.PrependBOM(encoder, options);
+
+    return encoder;
+}
+
+iconv.getDecoder = function getDecoder(encoding, options) {
+    var codec = iconv.getCodec(encoding),
+        decoder = new codec.decoder(options, codec);
+
+    if (codec.bomAware && !(options && options.stripBOM === false))
+        decoder = new bomHandling.StripBOM(decoder, options);
+
+    return decoder;
+}
+
+
+// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
+var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
+if (nodeVer) {
+
+    // Load streaming support in Node v0.10+
+    var nodeVerArr = nodeVer.split(".").map(Number);
+    if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
+        require("./streams")(iconv);
+    }
+
+    // Load Node primitive extensions.
+    require("./extend-node")(iconv);
+}
+
+if ("Ā" != "\u0100") {
+    console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
+}
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/lib/streams.js b/legacy-libs/grpc/node_modules/iconv-lite/lib/streams.js
new file mode 100644 (file)
index 0000000..4409552
--- /dev/null
@@ -0,0 +1,121 @@
+"use strict";
+
+var Buffer = require("buffer").Buffer,
+    Transform = require("stream").Transform;
+
+
+// == Exports ==================================================================
+module.exports = function(iconv) {
+    
+    // Additional Public API.
+    iconv.encodeStream = function encodeStream(encoding, options) {
+        return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
+    }
+
+    iconv.decodeStream = function decodeStream(encoding, options) {
+        return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
+    }
+
+    iconv.supportsStreams = true;
+
+
+    // Not published yet.
+    iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;
+    iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;
+    iconv._collect = IconvLiteDecoderStream.prototype.collect;
+};
+
+
+// == Encoder stream =======================================================
+function IconvLiteEncoderStream(conv, options) {
+    this.conv = conv;
+    options = options || {};
+    options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
+    Transform.call(this, options);
+}
+
+IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
+    constructor: { value: IconvLiteEncoderStream }
+});
+
+IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
+    if (typeof chunk != 'string')
+        return done(new Error("Iconv encoding stream needs strings as its input."));
+    try {
+        var res = this.conv.write(chunk);
+        if (res && res.length) this.push(res);
+        done();
+    }
+    catch (e) {
+        done(e);
+    }
+}
+
+IconvLiteEncoderStream.prototype._flush = function(done) {
+    try {
+        var res = this.conv.end();
+        if (res && res.length) this.push(res);
+        done();
+    }
+    catch (e) {
+        done(e);
+    }
+}
+
+IconvLiteEncoderStream.prototype.collect = function(cb) {
+    var chunks = [];
+    this.on('error', cb);
+    this.on('data', function(chunk) { chunks.push(chunk); });
+    this.on('end', function() {
+        cb(null, Buffer.concat(chunks));
+    });
+    return this;
+}
+
+
+// == Decoder stream =======================================================
+function IconvLiteDecoderStream(conv, options) {
+    this.conv = conv;
+    options = options || {};
+    options.encoding = this.encoding = 'utf8'; // We output strings.
+    Transform.call(this, options);
+}
+
+IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
+    constructor: { value: IconvLiteDecoderStream }
+});
+
+IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
+    if (!Buffer.isBuffer(chunk))
+        return done(new Error("Iconv decoding stream needs buffers as its input."));
+    try {
+        var res = this.conv.write(chunk);
+        if (res && res.length) this.push(res, this.encoding);
+        done();
+    }
+    catch (e) {
+        done(e);
+    }
+}
+
+IconvLiteDecoderStream.prototype._flush = function(done) {
+    try {
+        var res = this.conv.end();
+        if (res && res.length) this.push(res, this.encoding);                
+        done();
+    }
+    catch (e) {
+        done(e);
+    }
+}
+
+IconvLiteDecoderStream.prototype.collect = function(cb) {
+    var res = '';
+    this.on('error', cb);
+    this.on('data', function(chunk) { res += chunk; });
+    this.on('end', function() {
+        cb(null, res);
+    });
+    return this;
+}
+
diff --git a/legacy-libs/grpc/node_modules/iconv-lite/package.json b/legacy-libs/grpc/node_modules/iconv-lite/package.json
new file mode 100644 (file)
index 0000000..0f2f7d8
--- /dev/null
@@ -0,0 +1,83 @@
+{
+  "_args": [
+    [
+      "iconv-lite@0.4.23",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "iconv-lite@0.4.23",
+  "_id": "iconv-lite@0.4.23",
+  "_inBundle": false,
+  "_integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
+  "_location": "/grpc/iconv-lite",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "iconv-lite@0.4.23",
+    "name": "iconv-lite",
+    "escapedName": "iconv-lite",
+    "rawSpec": "0.4.23",
+    "saveSpec": null,
+    "fetchSpec": "0.4.23"
+  },
+  "_requiredBy": [
+    "/grpc/needle"
+  ],
+  "_resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
+  "_shrinkwrap": null,
+  "_spec": "0.4.23",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Alexander Shtuchkin",
+    "email": "ashtuchkin@gmail.com"
+  },
+  "browser": {
+    "./lib/extend-node": false,
+    "./lib/streams": false
+  },
+  "bugs": {
+    "url": "https://github.com/ashtuchkin/iconv-lite/issues"
+  },
+  "dependencies": {
+    "safer-buffer": ">= 2.1.2 < 3"
+  },
+  "description": "Convert character encodings in pure javascript.",
+  "devDependencies": {
+    "async": "*",
+    "errto": "*",
+    "iconv": "*",
+    "istanbul": "*",
+    "mocha": "^3.1.0",
+    "request": "~2.81.0",
+    "semver": "*",
+    "unorm": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "homepage": "https://github.com/ashtuchkin/iconv-lite",
+  "keywords": [
+    "iconv",
+    "convert",
+    "charset",
+    "icu"
+  ],
+  "license": "MIT",
+  "main": "./lib/index.js",
+  "name": "iconv-lite",
+  "optionalDependencies": {},
+  "readme": "## Pure JS character encoding conversion [![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite)\n\n * Doesn't need native code compilation. Works on Windows and in sandboxed environments like [Cloud9](http://c9.io).\n * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), \n   [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others.\n * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison).\n * Intuitive encode/decode API\n * Streaming support for Node v0.10+\n * [Deprecated] Can extend Node.js primitives (buffers, streams) to support all iconv-lite encodings.\n * In-browser usage via [Browserify](https://github.com/substack/node-browserify) (~180k gzip compressed with Buffer shim included).\n * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included.\n * React Native is supported (need to explicitly `npm install` two more modules: `buffer` and `stream`).\n * License: MIT.\n\n[![NPM Stats](https://nodei.co/npm/iconv-lite.png?downloads=true&downloadRank=true)](https://npmjs.org/packages/iconv-lite/)\n\n## Usage\n### Basic API\n```javascript\nvar iconv = require('iconv-lite');\n\n// Convert from an encoded buffer to js string.\nstr = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');\n\n// Convert from js string to an encoded buffer.\nbuf = iconv.encode(\"Sample input string\", 'win1251');\n\n// Check if encoding is supported\niconv.encodingExists(\"us-ascii\")\n```\n\n### Streaming API (Node v0.10+)\n```javascript\n\n// Decode stream (from binary stream to js strings)\nhttp.createServer(function(req, res) {\n    var converterStream = iconv.decodeStream('win1251');\n    req.pipe(converterStream);\n\n    converterStream.on('data', function(str) {\n        console.log(str); // Do something with decoded strings, chunk-by-chunk.\n    });\n});\n\n// Convert encoding streaming example\nfs.createReadStream('file-in-win1251.txt')\n    .pipe(iconv.decodeStream('win1251'))\n    .pipe(iconv.encodeStream('ucs2'))\n    .pipe(fs.createWriteStream('file-in-ucs2.txt'));\n\n// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.\nhttp.createServer(function(req, res) {\n    req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) {\n        assert(typeof body == 'string');\n        console.log(body); // full request body string\n    });\n});\n```\n\n### [Deprecated] Extend Node.js own encodings\n> NOTE: This doesn't work on latest Node versions. See [details](https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility).\n\n```javascript\n// After this call all Node basic primitives will understand iconv-lite encodings.\niconv.extendNodeEncodings();\n\n// Examples:\nbuf = new Buffer(str, 'win1251');\nbuf.write(str, 'gbk');\nstr = buf.toString('latin1');\nassert(Buffer.isEncoding('iso-8859-15'));\nBuffer.byteLength(str, 'us-ascii');\n\nhttp.createServer(function(req, res) {\n    req.setEncoding('big5');\n    req.collect(function(err, body) {\n        console.log(body);\n    });\n});\n\nfs.createReadStream(\"file.txt\", \"shift_jis\");\n\n// External modules are also supported (if they use Node primitives, which they probably do).\nrequest = require('request');\nrequest({\n    url: \"http://github.com/\", \n    encoding: \"cp932\"\n});\n\n// To remove extensions\niconv.undoExtendNodeEncodings();\n```\n\n## Supported encodings\n\n *  All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex.\n *  Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap.\n *  All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, \n    IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. \n    Aliases like 'latin1', 'us-ascii' also supported.\n *  All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP.\n\nSee [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings).\n\nMost singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors!\n\nMultibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors!\n\n\n## Encoding/decoding speed\n\nComparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). \nNote: your results may vary, so please always check on your hardware.\n\n    operation             iconv@2.1.4   iconv-lite@0.4.7\n    ----------------------------------------------------------\n    encode('win1251')     ~96 Mb/s      ~320 Mb/s\n    decode('win1251')     ~95 Mb/s      ~246 Mb/s\n\n## BOM handling\n\n * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options\n   (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`).\n   A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found.\n * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module.\n * Encoding: No BOM added, unless overridden by `addBOM: true` option.\n\n## UTF-16 Encodings\n\nThis library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be\nsmart about endianness in the following ways:\n * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be \n   overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`.\n * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override.\n\n## Other notes\n\nWhen decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding).  \nUntranslatable characters are set to � or ?. No transliteration is currently supported.  \nNode versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77).  \n\n## Testing\n\n```bash\n$ git clone git@github.com:ashtuchkin/iconv-lite.git\n$ cd iconv-lite\n$ npm install\n$ npm test\n    \n$ # To view performance:\n$ node test/performance.js\n\n$ # To view test coverage:\n$ npm run coverage\n$ open coverage/lcov-report/index.html\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/ashtuchkin/iconv-lite.git"
+  },
+  "scripts": {
+    "coverage": "istanbul cover _mocha -- --grep .",
+    "coverage-open": "open coverage/lcov-report/index.html",
+    "test": "mocha --reporter spec --grep ."
+  },
+  "typings": "./lib/index.d.ts",
+  "version": "0.4.23"
+}
diff --git a/legacy-libs/grpc/node_modules/ignore-walk/LICENSE b/legacy-libs/grpc/node_modules/ignore-walk/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/ignore-walk/README.md b/legacy-libs/grpc/node_modules/ignore-walk/README.md
new file mode 100644 (file)
index 0000000..66b69e8
--- /dev/null
@@ -0,0 +1,60 @@
+# ignore-walk
+
+[![Build
+Status](https://travis-ci.org/isaacs/ignore-walk.svg?branch=master)](https://travis-ci.org/isaacs/ignore-walk)
+
+Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.
+
+Walk a directory creating a list of entries, parsing any `.ignore`
+files met along the way to exclude files.
+
+## USAGE
+
+```javascript
+const walk = require('ignore-walk')
+
+// All options are optional, defaults provided.
+
+// this function returns a promise, but you can also pass a cb
+// if you like that approach better.
+walk({
+  path: '...', // root dir to start in. defaults to process.cwd()
+  ignoreFiles: [ '.gitignore' ], // list of filenames. defaults to ['.ignore']
+  includeEmpty: true|false, // true to include empty dirs, default false
+  follow: true|false // true to follow symlink dirs, default false
+}, callback)
+
+// to walk synchronously, do it this way:
+const result = walk.sync({ path: '/wow/such/filepath' })
+```
+
+If you want to get at the underlying classes, they're at `walk.Walker`
+and `walk.WalkerSync`.
+
+## OPTIONS
+
+* `path` The path to start in.  Defaults to `process.cwd()`
+
+* `ignoreFiles` Filenames to treat as ignore files.  The default is
+  `['.ignore']`.  (This is where you'd put `.gitignore` or
+  `.npmignore` or whatever.)  If multiple ignore files are in a
+  directory, then rules from each are applied in the order that the
+  files are listed.
+
+* `includeEmpty` Set to `true` to include empty directories, assuming
+  they are not excluded by any of the ignore rules.  If not set, then
+  this follows the standard `git` behavior of not including
+  directories that are empty.
+
+    Note: this will cause an empty directory to be included if it
+    would contain an included entry, even if it would have otherwise
+    been excluded itself.
+
+    For example, given the rules `*` (ignore everything) and `!/a/b/c`
+    (re-include the entry at `/a/b/c`), the directory `/a/b` will be
+    included if it is empty.
+
+* `follow`  Set to `true` to treat symbolically linked directories as
+  directories, recursing into them.  There is no handling for nested
+  symlinks, so `ELOOP` errors can occur in some cases when using this
+  option.  Defaults to `false`.
diff --git a/legacy-libs/grpc/node_modules/ignore-walk/index.js b/legacy-libs/grpc/node_modules/ignore-walk/index.js
new file mode 100644 (file)
index 0000000..abfd9ec
--- /dev/null
@@ -0,0 +1,265 @@
+'use strict'
+
+const fs = require('fs')
+const path = require('path')
+const EE = require('events').EventEmitter
+const Minimatch = require('minimatch').Minimatch
+
+class Walker extends EE {
+  constructor (opts) {
+    opts = opts || {}
+    super(opts)
+    this.path = opts.path || process.cwd()
+    this.basename = path.basename(this.path)
+    this.ignoreFiles = opts.ignoreFiles || [ '.ignore' ]
+    this.ignoreRules = {}
+    this.parent = opts.parent || null
+    this.includeEmpty = !!opts.includeEmpty
+    this.root = this.parent ? this.parent.root : this.path
+    this.follow = !!opts.follow
+    this.result = this.parent ? this.parent.result : []
+    this.entries = null
+    this.sawError = false
+  }
+
+  sort (a, b) {
+    return a.localeCompare(b)
+  }
+
+  emit (ev, data) {
+    let ret = false
+    if (!(this.sawError && ev === 'error')) {
+      if (ev === 'error')
+        this.sawError = true
+      else if (ev === 'done' && !this.parent)
+        data = data.sort(this.sort)
+      if (ev === 'error' && this.parent)
+        ret = this.parent.emit('error', data)
+      else
+        ret = super.emit(ev, data)
+    }
+    return ret
+  }
+
+  start () {
+    fs.readdir(this.path, (er, entries) =>
+      er ? this.emit('error', er) : this.onReaddir(entries))
+    return this
+  }
+
+  isIgnoreFile (e) {
+    return e !== "." &&
+      e !== ".." &&
+      -1 !== this.ignoreFiles.indexOf(e)
+  }
+
+  onReaddir (entries) {
+    this.entries = entries
+    if (entries.length === 0) {
+      if (this.includeEmpty)
+        this.result.push(this.path.substr(this.root.length + 1))
+      this.emit('done', this.result)
+    } else {
+      const hasIg = this.entries.some(e =>
+        this.isIgnoreFile(e))
+
+      if (hasIg)
+        this.addIgnoreFiles()
+      else
+        this.filterEntries()
+    }
+  }
+
+  addIgnoreFiles () {
+    const newIg = this.entries
+      .filter(e => this.isIgnoreFile(e))
+
+    let igCount = newIg.length
+    const then = _ => {
+      if (--igCount === 0)
+        this.filterEntries()
+    }
+
+    newIg.forEach(e => this.addIgnoreFile(e, then))
+  }
+
+  addIgnoreFile (file, then) {
+    const ig = path.resolve(this.path, file)
+    fs.readFile(ig, 'utf8', (er, data) =>
+      er ? this.emit('error', er) : this.onReadIgnoreFile(file, data, then))
+  }
+
+  onReadIgnoreFile (file, data, then) {
+    const mmopt = {
+      matchBase: true,
+      dot: true,
+      flipNegate: true,
+      nocase: true
+    }
+    const rules = data.split(/\r?\n/)
+      .filter(line => !/^#|^$/.test(line.trim()))
+      .map(r => new Minimatch(r, mmopt))
+
+    this.ignoreRules[file] = rules
+
+    then()
+  }
+
+  filterEntries () {
+    // at this point we either have ignore rules, or just inheriting
+    // this exclusion is at the point where we know the list of
+    // entries in the dir, but don't know what they are.  since
+    // some of them *might* be directories, we have to run the
+    // match in dir-mode as well, so that we'll pick up partials
+    // of files that will be included later.  Anything included
+    // at this point will be checked again later once we know
+    // what it is.
+    const filtered = this.entries.map(entry => {
+      // at this point, we don't know if it's a dir or not.
+      const passFile = this.filterEntry(entry)
+      const passDir = this.filterEntry(entry, true)
+      return (passFile || passDir) ? [entry, passFile, passDir] : false
+    }).filter(e => e)
+
+    // now we stat them all
+    // if it's a dir, and passes as a dir, then recurse
+    // if it's not a dir, but passes as a file, add to set
+    let entryCount = filtered.length
+    if (entryCount === 0) {
+      this.emit('done', this.result)
+    } else {
+      const then = _ => {
+        if (-- entryCount === 0)
+          this.emit('done', this.result)
+      }
+      filtered.forEach(filt => {
+        const entry = filt[0]
+        const file = filt[1]
+        const dir = filt[2]
+        this.stat(entry, file, dir, then)
+      })
+    }
+  }
+
+  onstat (st, entry, file, dir, then) {
+    const abs = this.path + '/' + entry
+    if (!st.isDirectory()) {
+      if (file)
+        this.result.push(abs.substr(this.root.length + 1))
+      then()
+    } else {
+      // is a directory
+      if (dir)
+        this.walker(entry, then)
+      else
+        then()
+    }
+  }
+
+  stat (entry, file, dir, then) {
+    const abs = this.path + '/' + entry
+    fs[this.follow ? 'stat' : 'lstat'](abs, (er, st) => {
+      if (er)
+        this.emit('error', er)
+      else
+        this.onstat(st, entry, file, dir, then)
+    })
+  }
+
+  walkerOpt (entry) {
+    return {
+      path: this.path + '/' + entry,
+      parent: this,
+      ignoreFiles: this.ignoreFiles,
+      follow: this.follow,
+      includeEmpty: this.includeEmpty
+    }
+  }
+
+  walker (entry, then) {
+    new Walker(this.walkerOpt(entry)).on('done', then).start()
+  }
+
+  filterEntry (entry, partial) {
+    let included = true
+
+    // this = /a/b/c
+    // entry = d
+    // parent /a/b sees c/d
+    if (this.parent && this.parent.filterEntry) {
+      var pt = this.basename + "/" + entry
+      included = this.parent.filterEntry(pt, partial)
+    }
+
+    this.ignoreFiles.forEach(f => {
+      if (this.ignoreRules[f]) {
+        this.ignoreRules[f].forEach(rule => {
+          // negation means inclusion
+          // so if it's negated, and already included, no need to check
+          // likewise if it's neither negated nor included
+          if (rule.negate !== included) {
+            // first, match against /foo/bar
+            // then, against foo/bar
+            // then, in the case of partials, match with a /
+            const match = rule.match('/' + entry) ||
+              rule.match(entry) ||
+              (!!partial && (
+                rule.match('/' + entry + '/') ||
+                rule.match(entry + '/'))) ||
+              (!!partial && rule.negate && (
+                rule.match('/' + entry, true) ||
+                rule.match(entry, true)))
+
+            if (match)
+              included = rule.negate
+          }
+        })
+      }
+    })
+
+    return included
+  }
+}
+
+class WalkerSync extends Walker {
+  constructor (opt) {
+    super(opt)
+  }
+
+  start () {
+    this.onReaddir(fs.readdirSync(this.path))
+    return this
+  }
+
+  addIgnoreFile (file, then) {
+    const ig = path.resolve(this.path, file)
+    this.onReadIgnoreFile(file, fs.readFileSync(ig, 'utf8'), then)
+  }
+
+  stat (entry, file, dir, then) {
+    const abs = this.path + '/' + entry
+    const st = fs[this.follow ? 'statSync' : 'lstatSync'](abs)
+    this.onstat(st, entry, file, dir, then)
+  }
+
+  walker (entry, then) {
+    new WalkerSync(this.walkerOpt(entry)).start()
+    then()
+  }
+}
+
+const walk = (options, callback) => {
+  const p = new Promise((resolve, reject) => {
+    new Walker(options).on('done', resolve).on('error', reject).start()
+  })
+  return callback ? p.then(res => callback(null, res), callback) : p
+}
+
+const walkSync = options => {
+  return new WalkerSync(options).start().result
+}
+
+module.exports = walk
+walk.sync = walkSync
+walk.Walker = Walker
+walk.WalkerSync = WalkerSync
diff --git a/legacy-libs/grpc/node_modules/ignore-walk/package.json b/legacy-libs/grpc/node_modules/ignore-walk/package.json
new file mode 100644 (file)
index 0000000..0405313
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_args": [
+    [
+      "ignore-walk@3.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "ignore-walk@3.0.1",
+  "_id": "ignore-walk@3.0.1",
+  "_inBundle": false,
+  "_integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
+  "_location": "/grpc/ignore-walk",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "ignore-walk@3.0.1",
+    "name": "ignore-walk",
+    "escapedName": "ignore-walk",
+    "rawSpec": "3.0.1",
+    "saveSpec": null,
+    "fetchSpec": "3.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/npm-packlist"
+  ],
+  "_resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "3.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/ignore-walk/issues"
+  },
+  "dependencies": {
+    "minimatch": "^3.0.4"
+  },
+  "description": "Nested/recursive `.gitignore`/`.npmignore` parsing and filtering.",
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "mutate-fs": "^1.1.0",
+    "rimraf": "^2.6.1",
+    "tap": "^10.7.2"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/isaacs/ignore-walk#readme",
+  "keywords": [
+    "ignorefile",
+    "ignore",
+    "file",
+    ".gitignore",
+    ".npmignore",
+    "glob"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "ignore-walk",
+  "optionalDependencies": {},
+  "readme": "# ignore-walk\n\n[![Build\nStatus](https://travis-ci.org/isaacs/ignore-walk.svg?branch=master)](https://travis-ci.org/isaacs/ignore-walk)\n\nNested/recursive `.gitignore`/`.npmignore` parsing and filtering.\n\nWalk a directory creating a list of entries, parsing any `.ignore`\nfiles met along the way to exclude files.\n\n## USAGE\n\n```javascript\nconst walk = require('ignore-walk')\n\n// All options are optional, defaults provided.\n\n// this function returns a promise, but you can also pass a cb\n// if you like that approach better.\nwalk({\n  path: '...', // root dir to start in. defaults to process.cwd()\n  ignoreFiles: [ '.gitignore' ], // list of filenames. defaults to ['.ignore']\n  includeEmpty: true|false, // true to include empty dirs, default false\n  follow: true|false // true to follow symlink dirs, default false\n}, callback)\n\n// to walk synchronously, do it this way:\nconst result = walk.sync({ path: '/wow/such/filepath' })\n```\n\nIf you want to get at the underlying classes, they're at `walk.Walker`\nand `walk.WalkerSync`.\n\n## OPTIONS\n\n* `path` The path to start in.  Defaults to `process.cwd()`\n\n* `ignoreFiles` Filenames to treat as ignore files.  The default is\n  `['.ignore']`.  (This is where you'd put `.gitignore` or\n  `.npmignore` or whatever.)  If multiple ignore files are in a\n  directory, then rules from each are applied in the order that the\n  files are listed.\n\n* `includeEmpty` Set to `true` to include empty directories, assuming\n  they are not excluded by any of the ignore rules.  If not set, then\n  this follows the standard `git` behavior of not including\n  directories that are empty.\n\n    Note: this will cause an empty directory to be included if it\n    would contain an included entry, even if it would have otherwise\n    been excluded itself.\n\n    For example, given the rules `*` (ignore everything) and `!/a/b/c`\n    (re-include the entry at `/a/b/c`), the directory `/a/b` will be\n    included if it is empty.\n\n* `follow`  Set to `true` to treat symbolically linked directories as\n  directories, recursing into them.  There is no handling for nested\n  symlinks, so `ELOOP` errors can occur in some cases when using this\n  option.  Defaults to `false`.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/ignore-walk.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --100"
+  },
+  "version": "3.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/inflight/LICENSE b/legacy-libs/grpc/node_modules/inflight/LICENSE
new file mode 100644 (file)
index 0000000..05eeeb8
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/inflight/README.md b/legacy-libs/grpc/node_modules/inflight/README.md
new file mode 100644 (file)
index 0000000..6dc8929
--- /dev/null
@@ -0,0 +1,37 @@
+# inflight
+
+Add callbacks to requests in flight to avoid async duplication
+
+## USAGE
+
+```javascript
+var inflight = require('inflight')
+
+// some request that does some stuff
+function req(key, callback) {
+  // key is any random string.  like a url or filename or whatever.
+  //
+  // will return either a falsey value, indicating that the
+  // request for this key is already in flight, or a new callback
+  // which when called will call all callbacks passed to inflightk
+  // with the same key
+  callback = inflight(key, callback)
+
+  // If we got a falsey value back, then there's already a req going
+  if (!callback) return
+
+  // this is where you'd fetch the url or whatever
+  // callback is also once()-ified, so it can safely be assigned
+  // to multiple events etc.  First call wins.
+  setTimeout(function() {
+    callback(null, key)
+  }, 100)
+}
+
+// only assigns a single setTimeout
+// when it dings, all cbs get called
+req('foo', cb1)
+req('foo', cb2)
+req('foo', cb3)
+req('foo', cb4)
+```
diff --git a/legacy-libs/grpc/node_modules/inflight/inflight.js b/legacy-libs/grpc/node_modules/inflight/inflight.js
new file mode 100644 (file)
index 0000000..48202b3
--- /dev/null
@@ -0,0 +1,54 @@
+var wrappy = require('wrappy')
+var reqs = Object.create(null)
+var once = require('once')
+
+module.exports = wrappy(inflight)
+
+function inflight (key, cb) {
+  if (reqs[key]) {
+    reqs[key].push(cb)
+    return null
+  } else {
+    reqs[key] = [cb]
+    return makeres(key)
+  }
+}
+
+function makeres (key) {
+  return once(function RES () {
+    var cbs = reqs[key]
+    var len = cbs.length
+    var args = slice(arguments)
+
+    // XXX It's somewhat ambiguous whether a new callback added in this
+    // pass should be queued for later execution if something in the
+    // list of callbacks throws, or if it should just be discarded.
+    // However, it's such an edge case that it hardly matters, and either
+    // choice is likely as surprising as the other.
+    // As it happens, we do go ahead and schedule it for later execution.
+    try {
+      for (var i = 0; i < len; i++) {
+        cbs[i].apply(null, args)
+      }
+    } finally {
+      if (cbs.length > len) {
+        // added more in the interim.
+        // de-zalgo, just in case, but don't call again.
+        cbs.splice(0, len)
+        process.nextTick(function () {
+          RES.apply(null, args)
+        })
+      } else {
+        delete reqs[key]
+      }
+    }
+  })
+}
+
+function slice (args) {
+  var length = args.length
+  var array = []
+
+  for (var i = 0; i < length; i++) array[i] = args[i]
+  return array
+}
diff --git a/legacy-libs/grpc/node_modules/inflight/package.json b/legacy-libs/grpc/node_modules/inflight/package.json
new file mode 100644 (file)
index 0000000..9bf5e01
--- /dev/null
@@ -0,0 +1,65 @@
+{
+  "_args": [
+    [
+      "inflight@1.0.6",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "inflight@1.0.6",
+  "_id": "inflight@1.0.6",
+  "_inBundle": false,
+  "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+  "_location": "/grpc/inflight",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "inflight@1.0.6",
+    "name": "inflight",
+    "escapedName": "inflight",
+    "rawSpec": "1.0.6",
+    "saveSpec": null,
+    "fetchSpec": "1.0.6"
+  },
+  "_requiredBy": [
+    "/grpc/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.6",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/inflight/issues"
+  },
+  "dependencies": {
+    "once": "^1.3.0",
+    "wrappy": "1"
+  },
+  "description": "Add callbacks to requests in flight to avoid async duplication",
+  "devDependencies": {
+    "tap": "^7.1.2"
+  },
+  "files": [
+    "inflight.js"
+  ],
+  "homepage": "https://github.com/isaacs/inflight",
+  "license": "ISC",
+  "main": "inflight.js",
+  "name": "inflight",
+  "optionalDependencies": {},
+  "readme": "# inflight\n\nAdd callbacks to requests in flight to avoid async duplication\n\n## USAGE\n\n```javascript\nvar inflight = require('inflight')\n\n// some request that does some stuff\nfunction req(key, callback) {\n  // key is any random string.  like a url or filename or whatever.\n  //\n  // will return either a falsey value, indicating that the\n  // request for this key is already in flight, or a new callback\n  // which when called will call all callbacks passed to inflightk\n  // with the same key\n  callback = inflight(key, callback)\n\n  // If we got a falsey value back, then there's already a req going\n  if (!callback) return\n\n  // this is where you'd fetch the url or whatever\n  // callback is also once()-ified, so it can safely be assigned\n  // to multiple events etc.  First call wins.\n  setTimeout(function() {\n    callback(null, key)\n  }, 100)\n}\n\n// only assigns a single setTimeout\n// when it dings, all cbs get called\nreq('foo', cb1)\nreq('foo', cb2)\nreq('foo', cb3)\nreq('foo', cb4)\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/inflight.git"
+  },
+  "scripts": {
+    "test": "tap test.js --100"
+  },
+  "version": "1.0.6"
+}
diff --git a/legacy-libs/grpc/node_modules/inherits/LICENSE b/legacy-libs/grpc/node_modules/inherits/LICENSE
new file mode 100644 (file)
index 0000000..dea3013
--- /dev/null
@@ -0,0 +1,16 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/legacy-libs/grpc/node_modules/inherits/README.md b/legacy-libs/grpc/node_modules/inherits/README.md
new file mode 100644 (file)
index 0000000..b1c5665
--- /dev/null
@@ -0,0 +1,42 @@
+Browser-friendly inheritance fully compatible with standard node.js
+[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).
+
+This package exports standard `inherits` from node.js `util` module in
+node environment, but also provides alternative browser-friendly
+implementation through [browser
+field](https://gist.github.com/shtylman/4339901). Alternative
+implementation is a literal copy of standard one located in standalone
+module to avoid requiring of `util`. It also has a shim for old
+browsers with no `Object.create` support.
+
+While keeping you sure you are using standard `inherits`
+implementation in node.js environment, it allows bundlers such as
+[browserify](https://github.com/substack/node-browserify) to not
+include full `util` package to your client code if all you need is
+just `inherits` function. It worth, because browser shim for `util`
+package is large and `inherits` is often the single function you need
+from it.
+
+It's recommended to use this package instead of
+`require('util').inherits` for any code that has chances to be used
+not only in node.js but in browser too.
+
+## usage
+
+```js
+var inherits = require('inherits');
+// then use exactly as the standard one
+```
+
+## note on version ~1.0
+
+Version ~1.0 had completely different motivation and is not compatible
+neither with 2.0 nor with standard node.js `inherits`.
+
+If you are using version ~1.0 and planning to switch to ~2.0, be
+careful:
+
+* new version uses `super_` instead of `super` for referencing
+  superclass
+* new version overwrites current prototype while old one preserves any
+  existing fields on it
diff --git a/legacy-libs/grpc/node_modules/inherits/inherits.js b/legacy-libs/grpc/node_modules/inherits/inherits.js
new file mode 100644 (file)
index 0000000..3b94763
--- /dev/null
@@ -0,0 +1,7 @@
+try {
+  var util = require('util');
+  if (typeof util.inherits !== 'function') throw '';
+  module.exports = util.inherits;
+} catch (e) {
+  module.exports = require('./inherits_browser.js');
+}
diff --git a/legacy-libs/grpc/node_modules/inherits/inherits_browser.js b/legacy-libs/grpc/node_modules/inherits/inherits_browser.js
new file mode 100644 (file)
index 0000000..c1e78a7
--- /dev/null
@@ -0,0 +1,23 @@
+if (typeof Object.create === 'function') {
+  // implementation from standard node.js 'util' module
+  module.exports = function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor
+    ctor.prototype = Object.create(superCtor.prototype, {
+      constructor: {
+        value: ctor,
+        enumerable: false,
+        writable: true,
+        configurable: true
+      }
+    });
+  };
+} else {
+  // old school shim for old browsers
+  module.exports = function inherits(ctor, superCtor) {
+    ctor.super_ = superCtor
+    var TempCtor = function () {}
+    TempCtor.prototype = superCtor.prototype
+    ctor.prototype = new TempCtor()
+    ctor.prototype.constructor = ctor
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/inherits/package.json b/legacy-libs/grpc/node_modules/inherits/package.json
new file mode 100644 (file)
index 0000000..dac6c33
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_args": [
+    [
+      "inherits@2.0.3",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "inherits@2.0.3",
+  "_id": "inherits@2.0.3",
+  "_inBundle": false,
+  "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
+  "_location": "/grpc/inherits",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "inherits@2.0.3",
+    "name": "inherits",
+    "escapedName": "inherits",
+    "rawSpec": "2.0.3",
+    "saveSpec": null,
+    "fetchSpec": "2.0.3"
+  },
+  "_requiredBy": [
+    "/grpc/readable-stream",
+    "/grpc/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.0.3",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "browser": "./inherits_browser.js",
+  "bugs": {
+    "url": "https://github.com/isaacs/inherits/issues"
+  },
+  "dependencies": {},
+  "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()",
+  "devDependencies": {
+    "tap": "^7.1.0"
+  },
+  "files": [
+    "inherits.js",
+    "inherits_browser.js"
+  ],
+  "homepage": "https://github.com/isaacs/inherits#readme",
+  "keywords": [
+    "inheritance",
+    "class",
+    "klass",
+    "oop",
+    "object-oriented",
+    "inherits",
+    "browser",
+    "browserify"
+  ],
+  "license": "ISC",
+  "main": "./inherits.js",
+  "name": "inherits",
+  "optionalDependencies": {},
+  "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n  superclass\n* new version overwrites current prototype while old one preserves any\n  existing fields on it\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/inherits.git"
+  },
+  "scripts": {
+    "test": "node test"
+  },
+  "version": "2.0.3"
+}
diff --git a/legacy-libs/grpc/node_modules/ini/LICENSE b/legacy-libs/grpc/node_modules/ini/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/ini/README.md b/legacy-libs/grpc/node_modules/ini/README.md
new file mode 100644 (file)
index 0000000..33df258
--- /dev/null
@@ -0,0 +1,102 @@
+An ini format parser and serializer for node.
+
+Sections are treated as nested objects.  Items before the first
+heading are saved on the object directly.
+
+## Usage
+
+Consider an ini-file `config.ini` that looks like this:
+
+    ; this comment is being ignored
+    scope = global
+
+    [database]
+    user = dbuser
+    password = dbpassword
+    database = use_this_database
+
+    [paths.default]
+    datadir = /var/lib/data
+    array[] = first value
+    array[] = second value
+    array[] = third value
+
+You can read, manipulate and write the ini-file like so:
+
+    var fs = require('fs')
+      , ini = require('ini')
+
+    var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))
+
+    config.scope = 'local'
+    config.database.database = 'use_another_database'
+    config.paths.default.tmpdir = '/tmp'
+    delete config.paths.default.datadir
+    config.paths.default.array.push('fourth value')
+
+    fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))
+
+This will result in a file called `config_modified.ini` being written
+to the filesystem with the following content:
+
+    [section]
+    scope=local
+    [section.database]
+    user=dbuser
+    password=dbpassword
+    database=use_another_database
+    [section.paths.default]
+    tmpdir=/tmp
+    array[]=first value
+    array[]=second value
+    array[]=third value
+    array[]=fourth value
+
+
+## API
+
+### decode(inistring)
+
+Decode the ini-style formatted `inistring` into a nested object.
+
+### parse(inistring)
+
+Alias for `decode(inistring)`
+
+### encode(object, [options])
+
+Encode the object `object` into an ini-style formatted string. If the
+optional parameter `section` is given, then all top-level properties
+of the object are put into this section and the `section`-string is
+prepended to all sub-sections, see the usage example above.
+
+The `options` object may contain the following:
+
+* `section` A string which will be the first `section` in the encoded
+  ini data.  Defaults to none.
+* `whitespace` Boolean to specify whether to put whitespace around the
+  `=` character.  By default, whitespace is omitted, to be friendly to
+  some persnickety old parsers that don't tolerate it well.  But some
+  find that it's more human-readable and pretty with the whitespace.
+
+For backwards compatibility reasons, if a `string` options is passed
+in, then it is assumed to be the `section` value.
+
+### stringify(object, [options])
+
+Alias for `encode(object, [options])`
+
+### safe(val)
+
+Escapes the string `val` such that it is safe to be used as a key or
+value in an ini-file. Basically escapes quotes. For example
+
+    ini.safe('"unsafe string"')
+
+would result in
+
+    "\"unsafe string\""
+
+### unsafe(val)
+
+Unescapes the string `val`
diff --git a/legacy-libs/grpc/node_modules/ini/ini.js b/legacy-libs/grpc/node_modules/ini/ini.js
new file mode 100644 (file)
index 0000000..590195d
--- /dev/null
@@ -0,0 +1,194 @@
+exports.parse = exports.decode = decode
+
+exports.stringify = exports.encode = encode
+
+exports.safe = safe
+exports.unsafe = unsafe
+
+var eol = typeof process !== 'undefined' &&
+  process.platform === 'win32' ? '\r\n' : '\n'
+
+function encode (obj, opt) {
+  var children = []
+  var out = ''
+
+  if (typeof opt === 'string') {
+    opt = {
+      section: opt,
+      whitespace: false
+    }
+  } else {
+    opt = opt || {}
+    opt.whitespace = opt.whitespace === true
+  }
+
+  var separator = opt.whitespace ? ' = ' : '='
+
+  Object.keys(obj).forEach(function (k, _, __) {
+    var val = obj[k]
+    if (val && Array.isArray(val)) {
+      val.forEach(function (item) {
+        out += safe(k + '[]') + separator + safe(item) + '\n'
+      })
+    } else if (val && typeof val === 'object') {
+      children.push(k)
+    } else {
+      out += safe(k) + separator + safe(val) + eol
+    }
+  })
+
+  if (opt.section && out.length) {
+    out = '[' + safe(opt.section) + ']' + eol + out
+  }
+
+  children.forEach(function (k, _, __) {
+    var nk = dotSplit(k).join('\\.')
+    var section = (opt.section ? opt.section + '.' : '') + nk
+    var child = encode(obj[k], {
+      section: section,
+      whitespace: opt.whitespace
+    })
+    if (out.length && child.length) {
+      out += eol
+    }
+    out += child
+  })
+
+  return out
+}
+
+function dotSplit (str) {
+  return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
+    .replace(/\\\./g, '\u0001')
+    .split(/\./).map(function (part) {
+      return part.replace(/\1/g, '\\.')
+      .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001')
+    })
+}
+
+function decode (str) {
+  var out = {}
+  var p = out
+  var section = null
+  //          section     |key      = value
+  var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
+  var lines = str.split(/[\r\n]+/g)
+
+  lines.forEach(function (line, _, __) {
+    if (!line || line.match(/^\s*[;#]/)) return
+    var match = line.match(re)
+    if (!match) return
+    if (match[1] !== undefined) {
+      section = unsafe(match[1])
+      p = out[section] = out[section] || {}
+      return
+    }
+    var key = unsafe(match[2])
+    var value = match[3] ? unsafe(match[4]) : true
+    switch (value) {
+      case 'true':
+      case 'false':
+      case 'null': value = JSON.parse(value)
+    }
+
+    // Convert keys with '[]' suffix to an array
+    if (key.length > 2 && key.slice(-2) === '[]') {
+      key = key.substring(0, key.length - 2)
+      if (!p[key]) {
+        p[key] = []
+      } else if (!Array.isArray(p[key])) {
+        p[key] = [p[key]]
+      }
+    }
+
+    // safeguard against resetting a previously defined
+    // array by accidentally forgetting the brackets
+    if (Array.isArray(p[key])) {
+      p[key].push(value)
+    } else {
+      p[key] = value
+    }
+  })
+
+  // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
+  // use a filter to return the keys that have to be deleted.
+  Object.keys(out).filter(function (k, _, __) {
+    if (!out[k] ||
+      typeof out[k] !== 'object' ||
+      Array.isArray(out[k])) {
+      return false
+    }
+    // see if the parent section is also an object.
+    // if so, add it to that, and mark this one for deletion
+    var parts = dotSplit(k)
+    var p = out
+    var l = parts.pop()
+    var nl = l.replace(/\\\./g, '.')
+    parts.forEach(function (part, _, __) {
+      if (!p[part] || typeof p[part] !== 'object') p[part] = {}
+      p = p[part]
+    })
+    if (p === out && nl === l) {
+      return false
+    }
+    p[nl] = out[k]
+    return true
+  }).forEach(function (del, _, __) {
+    delete out[del]
+  })
+
+  return out
+}
+
+function isQuoted (val) {
+  return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
+    (val.charAt(0) === "'" && val.slice(-1) === "'")
+}
+
+function safe (val) {
+  return (typeof val !== 'string' ||
+    val.match(/[=\r\n]/) ||
+    val.match(/^\[/) ||
+    (val.length > 1 &&
+     isQuoted(val)) ||
+    val !== val.trim())
+      ? JSON.stringify(val)
+      : val.replace(/;/g, '\\;').replace(/#/g, '\\#')
+}
+
+function unsafe (val, doUnesc) {
+  val = (val || '').trim()
+  if (isQuoted(val)) {
+    // remove the single quotes before calling JSON.parse
+    if (val.charAt(0) === "'") {
+      val = val.substr(1, val.length - 2)
+    }
+    try { val = JSON.parse(val) } catch (_) {}
+  } else {
+    // walk the val to find the first not-escaped ; character
+    var esc = false
+    var unesc = ''
+    for (var i = 0, l = val.length; i < l; i++) {
+      var c = val.charAt(i)
+      if (esc) {
+        if ('\\;#'.indexOf(c) !== -1) {
+          unesc += c
+        } else {
+          unesc += '\\' + c
+        }
+        esc = false
+      } else if (';#'.indexOf(c) !== -1) {
+        break
+      } else if (c === '\\') {
+        esc = true
+      } else {
+        unesc += c
+      }
+    }
+    if (esc) {
+      unesc += '\\'
+    }
+    return unesc.trim()
+  }
+  return val
+}
diff --git a/legacy-libs/grpc/node_modules/ini/package.json b/legacy-libs/grpc/node_modules/ini/package.json
new file mode 100644 (file)
index 0000000..541a101
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_args": [
+    [
+      "ini@1.3.5",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "ini@1.3.5",
+  "_id": "ini@1.3.5",
+  "_inBundle": false,
+  "_integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
+  "_location": "/grpc/ini",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "ini@1.3.5",
+    "name": "ini",
+    "escapedName": "ini",
+    "rawSpec": "1.3.5",
+    "saveSpec": null,
+    "fetchSpec": "1.3.5"
+  },
+  "_requiredBy": [
+    "/grpc/rc"
+  ],
+  "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.3.5",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/ini/issues"
+  },
+  "dependencies": {},
+  "description": "An ini encoder/decoder for node",
+  "devDependencies": {
+    "standard": "^10.0.3",
+    "tap": "^10.7.3 || 11"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "files": [
+    "ini.js"
+  ],
+  "homepage": "https://github.com/isaacs/ini#readme",
+  "license": "ISC",
+  "main": "ini.js",
+  "name": "ini",
+  "optionalDependencies": {},
+  "readme": "An ini format parser and serializer for node.\n\nSections are treated as nested objects.  Items before the first\nheading are saved on the object directly.\n\n## Usage\n\nConsider an ini-file `config.ini` that looks like this:\n\n    ; this comment is being ignored\n    scope = global\n\n    [database]\n    user = dbuser\n    password = dbpassword\n    database = use_this_database\n\n    [paths.default]\n    datadir = /var/lib/data\n    array[] = first value\n    array[] = second value\n    array[] = third value\n\nYou can read, manipulate and write the ini-file like so:\n\n    var fs = require('fs')\n      , ini = require('ini')\n\n    var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))\n\n    config.scope = 'local'\n    config.database.database = 'use_another_database'\n    config.paths.default.tmpdir = '/tmp'\n    delete config.paths.default.datadir\n    config.paths.default.array.push('fourth value')\n\n    fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))\n\nThis will result in a file called `config_modified.ini` being written\nto the filesystem with the following content:\n\n    [section]\n    scope=local\n    [section.database]\n    user=dbuser\n    password=dbpassword\n    database=use_another_database\n    [section.paths.default]\n    tmpdir=/tmp\n    array[]=first value\n    array[]=second value\n    array[]=third value\n    array[]=fourth value\n\n\n## API\n\n### decode(inistring)\n\nDecode the ini-style formatted `inistring` into a nested object.\n\n### parse(inistring)\n\nAlias for `decode(inistring)`\n\n### encode(object, [options])\n\nEncode the object `object` into an ini-style formatted string. If the\noptional parameter `section` is given, then all top-level properties\nof the object are put into this section and the `section`-string is\nprepended to all sub-sections, see the usage example above.\n\nThe `options` object may contain the following:\n\n* `section` A string which will be the first `section` in the encoded\n  ini data.  Defaults to none.\n* `whitespace` Boolean to specify whether to put whitespace around the\n  `=` character.  By default, whitespace is omitted, to be friendly to\n  some persnickety old parsers that don't tolerate it well.  But some\n  find that it's more human-readable and pretty with the whitespace.\n\nFor backwards compatibility reasons, if a `string` options is passed\nin, then it is assumed to be the `section` value.\n\n### stringify(object, [options])\n\nAlias for `encode(object, [options])`\n\n### safe(val)\n\nEscapes the string `val` such that it is safe to be used as a key or\nvalue in an ini-file. Basically escapes quotes. For example\n\n    ini.safe('\"unsafe string\"')\n\nwould result in\n\n    \"\\\"unsafe string\\\"\"\n\n### unsafe(val)\n\nUnescapes the string `val`\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/ini.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "pretest": "standard ini.js",
+    "preversion": "npm test",
+    "test": "tap test/*.js --100 -J"
+  },
+  "version": "1.3.5"
+}
diff --git a/legacy-libs/grpc/node_modules/is-fullwidth-code-point/index.js b/legacy-libs/grpc/node_modules/is-fullwidth-code-point/index.js
new file mode 100644 (file)
index 0000000..a7d3e38
--- /dev/null
@@ -0,0 +1,46 @@
+'use strict';
+var numberIsNan = require('number-is-nan');
+
+module.exports = function (x) {
+       if (numberIsNan(x)) {
+               return false;
+       }
+
+       // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
+
+       // code points are derived from:
+       // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
+       if (x >= 0x1100 && (
+               x <= 0x115f ||  // Hangul Jamo
+               0x2329 === x || // LEFT-POINTING ANGLE BRACKET
+               0x232a === x || // RIGHT-POINTING ANGLE BRACKET
+               // CJK Radicals Supplement .. Enclosed CJK Letters and Months
+               (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
+               // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
+               0x3250 <= x && x <= 0x4dbf ||
+               // CJK Unified Ideographs .. Yi Radicals
+               0x4e00 <= x && x <= 0xa4c6 ||
+               // Hangul Jamo Extended-A
+               0xa960 <= x && x <= 0xa97c ||
+               // Hangul Syllables
+               0xac00 <= x && x <= 0xd7a3 ||
+               // CJK Compatibility Ideographs
+               0xf900 <= x && x <= 0xfaff ||
+               // Vertical Forms
+               0xfe10 <= x && x <= 0xfe19 ||
+               // CJK Compatibility Forms .. Small Form Variants
+               0xfe30 <= x && x <= 0xfe6b ||
+               // Halfwidth and Fullwidth Forms
+               0xff01 <= x && x <= 0xff60 ||
+               0xffe0 <= x && x <= 0xffe6 ||
+               // Kana Supplement
+               0x1b000 <= x && x <= 0x1b001 ||
+               // Enclosed Ideographic Supplement
+               0x1f200 <= x && x <= 0x1f251 ||
+               // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
+               0x20000 <= x && x <= 0x3fffd)) {
+               return true;
+       }
+
+       return false;
+}
diff --git a/legacy-libs/grpc/node_modules/is-fullwidth-code-point/license b/legacy-libs/grpc/node_modules/is-fullwidth-code-point/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/is-fullwidth-code-point/package.json b/legacy-libs/grpc/node_modules/is-fullwidth-code-point/package.json
new file mode 100644 (file)
index 0000000..fe46afc
--- /dev/null
@@ -0,0 +1,84 @@
+{
+  "_args": [
+    [
+      "is-fullwidth-code-point@1.0.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "is-fullwidth-code-point@1.0.0",
+  "_id": "is-fullwidth-code-point@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
+  "_location": "/grpc/is-fullwidth-code-point",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "is-fullwidth-code-point@1.0.0",
+    "name": "is-fullwidth-code-point",
+    "escapedName": "is-fullwidth-code-point",
+    "rawSpec": "1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "1.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/string-width"
+  ],
+  "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues"
+  },
+  "dependencies": {
+    "number-is-nan": "^1.0.0"
+  },
+  "description": "Check if the character represented by a given Unicode code point is fullwidth",
+  "devDependencies": {
+    "ava": "0.0.4",
+    "code-point-at": "^1.0.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point#readme",
+  "keywords": [
+    "fullwidth",
+    "full-width",
+    "full",
+    "width",
+    "unicode",
+    "character",
+    "char",
+    "string",
+    "str",
+    "codepoint",
+    "code",
+    "point",
+    "is",
+    "detect",
+    "check"
+  ],
+  "license": "MIT",
+  "name": "is-fullwidth-code-point",
+  "optionalDependencies": {},
+  "readme": "# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)\n\n> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)\n\n\n## Install\n\n```\n$ npm install --save is-fullwidth-code-point\n```\n\n\n## Usage\n\n```js\nvar isFullwidthCodePoint = require('is-fullwidth-code-point');\n\nisFullwidthCodePoint('谢'.codePointAt());\n//=> true\n\nisFullwidthCodePoint('a'.codePointAt());\n//=> false\n```\n\n\n## API\n\n### isFullwidthCodePoint(input)\n\n#### input\n\nType: `number`\n\n[Code point](https://en.wikipedia.org/wiki/Code_point) of a character.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "version": "1.0.0"
+}
diff --git a/legacy-libs/grpc/node_modules/is-fullwidth-code-point/readme.md b/legacy-libs/grpc/node_modules/is-fullwidth-code-point/readme.md
new file mode 100644 (file)
index 0000000..4936464
--- /dev/null
@@ -0,0 +1,39 @@
+# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)
+
+> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
+
+
+## Install
+
+```
+$ npm install --save is-fullwidth-code-point
+```
+
+
+## Usage
+
+```js
+var isFullwidthCodePoint = require('is-fullwidth-code-point');
+
+isFullwidthCodePoint('谢'.codePointAt());
+//=> true
+
+isFullwidthCodePoint('a'.codePointAt());
+//=> false
+```
+
+
+## API
+
+### isFullwidthCodePoint(input)
+
+#### input
+
+Type: `number`
+
+[Code point](https://en.wikipedia.org/wiki/Code_point) of a character.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/isarray/Makefile b/legacy-libs/grpc/node_modules/isarray/Makefile
new file mode 100644 (file)
index 0000000..787d56e
--- /dev/null
@@ -0,0 +1,6 @@
+
+test:
+       @node_modules/.bin/tape test.js
+
+.PHONY: test
+
diff --git a/legacy-libs/grpc/node_modules/isarray/README.md b/legacy-libs/grpc/node_modules/isarray/README.md
new file mode 100644 (file)
index 0000000..16d2c59
--- /dev/null
@@ -0,0 +1,60 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
+[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
+
+[![browser support](https://ci.testling.com/juliangruber/isarray.png)
+](https://ci.testling.com/juliangruber/isarray)
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](http://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/browserify).
+
+With [component](http://component.io) do
+
+```bash
+$ component install juliangruber/isarray
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/isarray/component.json b/legacy-libs/grpc/node_modules/isarray/component.json
new file mode 100644 (file)
index 0000000..9e31b68
--- /dev/null
@@ -0,0 +1,19 @@
+{
+  "name" : "isarray",
+  "description" : "Array#isArray for older browsers",
+  "version" : "0.0.1",
+  "repository" : "juliangruber/isarray",
+  "homepage": "https://github.com/juliangruber/isarray",
+  "main" : "index.js",
+  "scripts" : [
+    "index.js"
+  ],
+  "dependencies" : {},
+  "keywords": ["browser","isarray","array"],
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "license": "MIT"
+}
diff --git a/legacy-libs/grpc/node_modules/isarray/index.js b/legacy-libs/grpc/node_modules/isarray/index.js
new file mode 100644 (file)
index 0000000..a57f634
--- /dev/null
@@ -0,0 +1,5 @@
+var toString = {}.toString;
+
+module.exports = Array.isArray || function (arr) {
+  return toString.call(arr) == '[object Array]';
+};
diff --git a/legacy-libs/grpc/node_modules/isarray/package.json b/legacy-libs/grpc/node_modules/isarray/package.json
new file mode 100644 (file)
index 0000000..387fb1c
--- /dev/null
@@ -0,0 +1,80 @@
+{
+  "_args": [
+    [
+      "isarray@1.0.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "isarray@1.0.0",
+  "_id": "isarray@1.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
+  "_location": "/grpc/isarray",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "isarray@1.0.0",
+    "name": "isarray",
+    "escapedName": "isarray",
+    "rawSpec": "1.0.0",
+    "saveSpec": null,
+    "fetchSpec": "1.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "bugs": {
+    "url": "https://github.com/juliangruber/isarray/issues"
+  },
+  "dependencies": {},
+  "description": "Array#isArray for older browsers",
+  "devDependencies": {
+    "tape": "~2.13.4"
+  },
+  "homepage": "https://github.com/juliangruber/isarray",
+  "keywords": [
+    "browser",
+    "isarray",
+    "array"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "isarray",
+  "optionalDependencies": {},
+  "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)\n[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)\n\n[![browser support](https://ci.testling.com/juliangruber/isarray.png)\n](https://ci.testling.com/juliangruber/isarray)\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/isarray.git"
+  },
+  "scripts": {
+    "test": "tape test.js"
+  },
+  "testling": {
+    "files": "test.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/17..latest",
+      "firefox/nightly",
+      "chrome/22..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "version": "1.0.0"
+}
diff --git a/legacy-libs/grpc/node_modules/isarray/test.js b/legacy-libs/grpc/node_modules/isarray/test.js
new file mode 100644 (file)
index 0000000..e0c3444
--- /dev/null
@@ -0,0 +1,20 @@
+var isArray = require('./');
+var test = require('tape');
+
+test('is array', function(t){
+  t.ok(isArray([]));
+  t.notOk(isArray({}));
+  t.notOk(isArray(null));
+  t.notOk(isArray(false));
+
+  var obj = {};
+  obj[0] = true;
+  t.notOk(isArray(obj));
+
+  var arr = [];
+  arr.foo = 'bar';
+  t.ok(isArray(arr));
+
+  t.end();
+});
+
diff --git a/legacy-libs/grpc/node_modules/minimatch/LICENSE b/legacy-libs/grpc/node_modules/minimatch/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/minimatch/README.md b/legacy-libs/grpc/node_modules/minimatch/README.md
new file mode 100644 (file)
index 0000000..ad72b81
--- /dev/null
@@ -0,0 +1,209 @@
+# minimatch
+
+A minimal matching utility.
+
+[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch)
+
+
+This is the matching library used internally by npm.
+
+It works by converting glob expressions into JavaScript `RegExp`
+objects.
+
+## Usage
+
+```javascript
+var minimatch = require("minimatch")
+
+minimatch("bar.foo", "*.foo") // true!
+minimatch("bar.foo", "*.bar") // false!
+minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy!
+```
+
+## Features
+
+Supports these glob features:
+
+* Brace Expansion
+* Extended glob matching
+* "Globstar" `**` matching
+
+See:
+
+* `man sh`
+* `man bash`
+* `man 3 fnmatch`
+* `man 5 gitignore`
+
+## Minimatch Class
+
+Create a minimatch object by instantiating the `minimatch.Minimatch` class.
+
+```javascript
+var Minimatch = require("minimatch").Minimatch
+var mm = new Minimatch(pattern, options)
+```
+
+### Properties
+
+* `pattern` The original pattern the minimatch object represents.
+* `options` The options supplied to the constructor.
+* `set` A 2-dimensional array of regexp or string expressions.
+  Each row in the
+  array corresponds to a brace-expanded pattern.  Each item in the row
+  corresponds to a single path-part.  For example, the pattern
+  `{a,b/c}/d` would expand to a set of patterns like:
+
+        [ [ a, d ]
+        , [ b, c, d ] ]
+
+    If a portion of the pattern doesn't have any "magic" in it
+    (that is, it's something like `"foo"` rather than `fo*o?`), then it
+    will be left as a string rather than converted to a regular
+    expression.
+
+* `regexp` Created by the `makeRe` method.  A single regular expression
+  expressing the entire pattern.  This is useful in cases where you wish
+  to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
+* `negate` True if the pattern is negated.
+* `comment` True if the pattern is a comment.
+* `empty` True if the pattern is `""`.
+
+### Methods
+
+* `makeRe` Generate the `regexp` member if necessary, and return it.
+  Will return `false` if the pattern is invalid.
+* `match(fname)` Return true if the filename matches the pattern, or
+  false otherwise.
+* `matchOne(fileArray, patternArray, partial)` Take a `/`-split
+  filename, and match it against a single row in the `regExpSet`.  This
+  method is mainly for internal use, but is exposed so that it can be
+  used by a glob-walker that needs to avoid excessive filesystem calls.
+
+All other methods are internal, and will be called as necessary.
+
+### minimatch(path, pattern, options)
+
+Main export.  Tests a path against the pattern using the options.
+
+```javascript
+var isJS = minimatch(file, "*.js", { matchBase: true })
+```
+
+### minimatch.filter(pattern, options)
+
+Returns a function that tests its
+supplied argument, suitable for use with `Array.filter`.  Example:
+
+```javascript
+var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))
+```
+
+### minimatch.match(list, pattern, options)
+
+Match against the list of
+files, in the style of fnmatch or glob.  If nothing is matched, and
+options.nonull is set, then return a list containing the pattern itself.
+
+```javascript
+var javascripts = minimatch.match(fileList, "*.js", {matchBase: true}))
+```
+
+### minimatch.makeRe(pattern, options)
+
+Make a regular expression object from the pattern.
+
+## Options
+
+All options are `false` by default.
+
+### debug
+
+Dump a ton of stuff to stderr.
+
+### nobrace
+
+Do not expand `{a,b}` and `{1..3}` brace sets.
+
+### noglobstar
+
+Disable `**` matching against multiple folder names.
+
+### dot
+
+Allow patterns to match filenames starting with a period, even if
+the pattern does not explicitly have a period in that spot.
+
+Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
+is set.
+
+### noext
+
+Disable "extglob" style patterns like `+(a|b)`.
+
+### nocase
+
+Perform a case-insensitive match.
+
+### nonull
+
+When a match is not found by `minimatch.match`, return a list containing
+the pattern itself if this option is set.  When not set, an empty list
+is returned if there are no matches.
+
+### matchBase
+
+If set, then patterns without slashes will be matched
+against the basename of the path if it contains slashes.  For example,
+`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
+
+### nocomment
+
+Suppress the behavior of treating `#` at the start of a pattern as a
+comment.
+
+### nonegate
+
+Suppress the behavior of treating a leading `!` character as negation.
+
+### flipNegate
+
+Returns from negate expressions the same as if they were not negated.
+(Ie, true on a hit, false on a miss.)
+
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between minimatch and other
+implementations, and are intentional.
+
+If the pattern starts with a `!` character, then it is negated.  Set the
+`nonegate` flag to suppress this behavior, and treat leading `!`
+characters normally.  This is perhaps relevant if you wish to start the
+pattern with a negative extglob pattern like `!(a|B)`.  Multiple `!`
+characters at the start of a pattern will negate the pattern multiple
+times.
+
+If a pattern starts with `#`, then it is treated as a comment, and
+will not match anything.  Use `\#` to match a literal `#` at the
+start of a line, or set the `nocomment` flag to suppress this behavior.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.1, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then minimatch.match returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
diff --git a/legacy-libs/grpc/node_modules/minimatch/minimatch.js b/legacy-libs/grpc/node_modules/minimatch/minimatch.js
new file mode 100644 (file)
index 0000000..5b5f8cf
--- /dev/null
@@ -0,0 +1,923 @@
+module.exports = minimatch
+minimatch.Minimatch = Minimatch
+
+var path = { sep: '/' }
+try {
+  path = require('path')
+} catch (er) {}
+
+var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
+var expand = require('brace-expansion')
+
+var plTypes = {
+  '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
+  '?': { open: '(?:', close: ')?' },
+  '+': { open: '(?:', close: ')+' },
+  '*': { open: '(?:', close: ')*' },
+  '@': { open: '(?:', close: ')' }
+}
+
+// any single thing other than /
+// don't need to escape / when using new RegExp()
+var qmark = '[^/]'
+
+// * => any number of characters
+var star = qmark + '*?'
+
+// ** when dots are allowed.  Anything goes, except .. and .
+// not (^ or / followed by one or two dots followed by $ or /),
+// followed by anything, any number of times.
+var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
+
+// not a ^ or / followed by a dot,
+// followed by anything, any number of times.
+var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
+
+// characters that need to be escaped in RegExp.
+var reSpecials = charSet('().*{}+?[]^$\\!')
+
+// "abc" -> { a:true, b:true, c:true }
+function charSet (s) {
+  return s.split('').reduce(function (set, c) {
+    set[c] = true
+    return set
+  }, {})
+}
+
+// normalizes slashes.
+var slashSplit = /\/+/
+
+minimatch.filter = filter
+function filter (pattern, options) {
+  options = options || {}
+  return function (p, i, list) {
+    return minimatch(p, pattern, options)
+  }
+}
+
+function ext (a, b) {
+  a = a || {}
+  b = b || {}
+  var t = {}
+  Object.keys(b).forEach(function (k) {
+    t[k] = b[k]
+  })
+  Object.keys(a).forEach(function (k) {
+    t[k] = a[k]
+  })
+  return t
+}
+
+minimatch.defaults = function (def) {
+  if (!def || !Object.keys(def).length) return minimatch
+
+  var orig = minimatch
+
+  var m = function minimatch (p, pattern, options) {
+    return orig.minimatch(p, pattern, ext(def, options))
+  }
+
+  m.Minimatch = function Minimatch (pattern, options) {
+    return new orig.Minimatch(pattern, ext(def, options))
+  }
+
+  return m
+}
+
+Minimatch.defaults = function (def) {
+  if (!def || !Object.keys(def).length) return Minimatch
+  return minimatch.defaults(def).Minimatch
+}
+
+function minimatch (p, pattern, options) {
+  if (typeof pattern !== 'string') {
+    throw new TypeError('glob pattern string required')
+  }
+
+  if (!options) options = {}
+
+  // shortcut: comments match nothing.
+  if (!options.nocomment && pattern.charAt(0) === '#') {
+    return false
+  }
+
+  // "" only matches ""
+  if (pattern.trim() === '') return p === ''
+
+  return new Minimatch(pattern, options).match(p)
+}
+
+function Minimatch (pattern, options) {
+  if (!(this instanceof Minimatch)) {
+    return new Minimatch(pattern, options)
+  }
+
+  if (typeof pattern !== 'string') {
+    throw new TypeError('glob pattern string required')
+  }
+
+  if (!options) options = {}
+  pattern = pattern.trim()
+
+  // windows support: need to use /, not \
+  if (path.sep !== '/') {
+    pattern = pattern.split(path.sep).join('/')
+  }
+
+  this.options = options
+  this.set = []
+  this.pattern = pattern
+  this.regexp = null
+  this.negate = false
+  this.comment = false
+  this.empty = false
+
+  // make the set of regexps etc.
+  this.make()
+}
+
+Minimatch.prototype.debug = function () {}
+
+Minimatch.prototype.make = make
+function make () {
+  // don't do it more than once.
+  if (this._made) return
+
+  var pattern = this.pattern
+  var options = this.options
+
+  // empty patterns and comments match nothing.
+  if (!options.nocomment && pattern.charAt(0) === '#') {
+    this.comment = true
+    return
+  }
+  if (!pattern) {
+    this.empty = true
+    return
+  }
+
+  // step 1: figure out negation, etc.
+  this.parseNegate()
+
+  // step 2: expand braces
+  var set = this.globSet = this.braceExpand()
+
+  if (options.debug) this.debug = console.error
+
+  this.debug(this.pattern, set)
+
+  // step 3: now we have a set, so turn each one into a series of path-portion
+  // matching patterns.
+  // These will be regexps, except in the case of "**", which is
+  // set to the GLOBSTAR object for globstar behavior,
+  // and will not contain any / characters
+  set = this.globParts = set.map(function (s) {
+    return s.split(slashSplit)
+  })
+
+  this.debug(this.pattern, set)
+
+  // glob --> regexps
+  set = set.map(function (s, si, set) {
+    return s.map(this.parse, this)
+  }, this)
+
+  this.debug(this.pattern, set)
+
+  // filter out everything that didn't compile properly.
+  set = set.filter(function (s) {
+    return s.indexOf(false) === -1
+  })
+
+  this.debug(this.pattern, set)
+
+  this.set = set
+}
+
+Minimatch.prototype.parseNegate = parseNegate
+function parseNegate () {
+  var pattern = this.pattern
+  var negate = false
+  var options = this.options
+  var negateOffset = 0
+
+  if (options.nonegate) return
+
+  for (var i = 0, l = pattern.length
+    ; i < l && pattern.charAt(i) === '!'
+    ; i++) {
+    negate = !negate
+    negateOffset++
+  }
+
+  if (negateOffset) this.pattern = pattern.substr(negateOffset)
+  this.negate = negate
+}
+
+// Brace expansion:
+// a{b,c}d -> abd acd
+// a{b,}c -> abc ac
+// a{0..3}d -> a0d a1d a2d a3d
+// a{b,c{d,e}f}g -> abg acdfg acefg
+// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
+//
+// Invalid sets are not expanded.
+// a{2..}b -> a{2..}b
+// a{b}c -> a{b}c
+minimatch.braceExpand = function (pattern, options) {
+  return braceExpand(pattern, options)
+}
+
+Minimatch.prototype.braceExpand = braceExpand
+
+function braceExpand (pattern, options) {
+  if (!options) {
+    if (this instanceof Minimatch) {
+      options = this.options
+    } else {
+      options = {}
+    }
+  }
+
+  pattern = typeof pattern === 'undefined'
+    ? this.pattern : pattern
+
+  if (typeof pattern === 'undefined') {
+    throw new TypeError('undefined pattern')
+  }
+
+  if (options.nobrace ||
+    !pattern.match(/\{.*\}/)) {
+    // shortcut. no need to expand.
+    return [pattern]
+  }
+
+  return expand(pattern)
+}
+
+// parse a component of the expanded set.
+// At this point, no pattern may contain "/" in it
+// so we're going to return a 2d array, where each entry is the full
+// pattern, split on '/', and then turned into a regular expression.
+// A regexp is made at the end which joins each array with an
+// escaped /, and another full one which joins each regexp with |.
+//
+// Following the lead of Bash 4.1, note that "**" only has special meaning
+// when it is the *only* thing in a path portion.  Otherwise, any series
+// of * is equivalent to a single *.  Globstar behavior is enabled by
+// default, and can be disabled by setting options.noglobstar.
+Minimatch.prototype.parse = parse
+var SUBPARSE = {}
+function parse (pattern, isSub) {
+  if (pattern.length > 1024 * 64) {
+    throw new TypeError('pattern is too long')
+  }
+
+  var options = this.options
+
+  // shortcuts
+  if (!options.noglobstar && pattern === '**') return GLOBSTAR
+  if (pattern === '') return ''
+
+  var re = ''
+  var hasMagic = !!options.nocase
+  var escaping = false
+  // ? => one single character
+  var patternListStack = []
+  var negativeLists = []
+  var stateChar
+  var inClass = false
+  var reClassStart = -1
+  var classStart = -1
+  // . and .. never match anything that doesn't start with .,
+  // even when options.dot is set.
+  var patternStart = pattern.charAt(0) === '.' ? '' // anything
+  // not (start or / followed by . or .. followed by / or end)
+  : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
+  : '(?!\\.)'
+  var self = this
+
+  function clearStateChar () {
+    if (stateChar) {
+      // we had some state-tracking character
+      // that wasn't consumed by this pass.
+      switch (stateChar) {
+        case '*':
+          re += star
+          hasMagic = true
+        break
+        case '?':
+          re += qmark
+          hasMagic = true
+        break
+        default:
+          re += '\\' + stateChar
+        break
+      }
+      self.debug('clearStateChar %j %j', stateChar, re)
+      stateChar = false
+    }
+  }
+
+  for (var i = 0, len = pattern.length, c
+    ; (i < len) && (c = pattern.charAt(i))
+    ; i++) {
+    this.debug('%s\t%s %s %j', pattern, i, re, c)
+
+    // skip over any that are escaped.
+    if (escaping && reSpecials[c]) {
+      re += '\\' + c
+      escaping = false
+      continue
+    }
+
+    switch (c) {
+      case '/':
+        // completely not allowed, even escaped.
+        // Should already be path-split by now.
+        return false
+
+      case '\\':
+        clearStateChar()
+        escaping = true
+      continue
+
+      // the various stateChar values
+      // for the "extglob" stuff.
+      case '?':
+      case '*':
+      case '+':
+      case '@':
+      case '!':
+        this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
+
+        // all of those are literals inside a class, except that
+        // the glob [!a] means [^a] in regexp
+        if (inClass) {
+          this.debug('  in class')
+          if (c === '!' && i === classStart + 1) c = '^'
+          re += c
+          continue
+        }
+
+        // if we already have a stateChar, then it means
+        // that there was something like ** or +? in there.
+        // Handle the stateChar, then proceed with this one.
+        self.debug('call clearStateChar %j', stateChar)
+        clearStateChar()
+        stateChar = c
+        // if extglob is disabled, then +(asdf|foo) isn't a thing.
+        // just clear the statechar *now*, rather than even diving into
+        // the patternList stuff.
+        if (options.noext) clearStateChar()
+      continue
+
+      case '(':
+        if (inClass) {
+          re += '('
+          continue
+        }
+
+        if (!stateChar) {
+          re += '\\('
+          continue
+        }
+
+        patternListStack.push({
+          type: stateChar,
+          start: i - 1,
+          reStart: re.length,
+          open: plTypes[stateChar].open,
+          close: plTypes[stateChar].close
+        })
+        // negation is (?:(?!js)[^/]*)
+        re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
+        this.debug('plType %j %j', stateChar, re)
+        stateChar = false
+      continue
+
+      case ')':
+        if (inClass || !patternListStack.length) {
+          re += '\\)'
+          continue
+        }
+
+        clearStateChar()
+        hasMagic = true
+        var pl = patternListStack.pop()
+        // negation is (?:(?!js)[^/]*)
+        // The others are (?:<pattern>)<type>
+        re += pl.close
+        if (pl.type === '!') {
+          negativeLists.push(pl)
+        }
+        pl.reEnd = re.length
+      continue
+
+      case '|':
+        if (inClass || !patternListStack.length || escaping) {
+          re += '\\|'
+          escaping = false
+          continue
+        }
+
+        clearStateChar()
+        re += '|'
+      continue
+
+      // these are mostly the same in regexp and glob
+      case '[':
+        // swallow any state-tracking char before the [
+        clearStateChar()
+
+        if (inClass) {
+          re += '\\' + c
+          continue
+        }
+
+        inClass = true
+        classStart = i
+        reClassStart = re.length
+        re += c
+      continue
+
+      case ']':
+        //  a right bracket shall lose its special
+        //  meaning and represent itself in
+        //  a bracket expression if it occurs
+        //  first in the list.  -- POSIX.2 2.8.3.2
+        if (i === classStart + 1 || !inClass) {
+          re += '\\' + c
+          escaping = false
+          continue
+        }
+
+        // handle the case where we left a class open.
+        // "[z-a]" is valid, equivalent to "\[z-a\]"
+        if (inClass) {
+          // split where the last [ was, make sure we don't have
+          // an invalid re. if so, re-walk the contents of the
+          // would-be class to re-translate any characters that
+          // were passed through as-is
+          // TODO: It would probably be faster to determine this
+          // without a try/catch and a new RegExp, but it's tricky
+          // to do safely.  For now, this is safe and works.
+          var cs = pattern.substring(classStart + 1, i)
+          try {
+            RegExp('[' + cs + ']')
+          } catch (er) {
+            // not a valid class!
+            var sp = this.parse(cs, SUBPARSE)
+            re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
+            hasMagic = hasMagic || sp[1]
+            inClass = false
+            continue
+          }
+        }
+
+        // finish up the class.
+        hasMagic = true
+        inClass = false
+        re += c
+      continue
+
+      default:
+        // swallow any state char that wasn't consumed
+        clearStateChar()
+
+        if (escaping) {
+          // no need
+          escaping = false
+        } else if (reSpecials[c]
+          && !(c === '^' && inClass)) {
+          re += '\\'
+        }
+
+        re += c
+
+    } // switch
+  } // for
+
+  // handle the case where we left a class open.
+  // "[abc" is valid, equivalent to "\[abc"
+  if (inClass) {
+    // split where the last [ was, and escape it
+    // this is a huge pita.  We now have to re-walk
+    // the contents of the would-be class to re-translate
+    // any characters that were passed through as-is
+    cs = pattern.substr(classStart + 1)
+    sp = this.parse(cs, SUBPARSE)
+    re = re.substr(0, reClassStart) + '\\[' + sp[0]
+    hasMagic = hasMagic || sp[1]
+  }
+
+  // handle the case where we had a +( thing at the *end*
+  // of the pattern.
+  // each pattern list stack adds 3 chars, and we need to go through
+  // and escape any | chars that were passed through as-is for the regexp.
+  // Go through and escape them, taking care not to double-escape any
+  // | chars that were already escaped.
+  for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
+    var tail = re.slice(pl.reStart + pl.open.length)
+    this.debug('setting tail', re, pl)
+    // maybe some even number of \, then maybe 1 \, followed by a |
+    tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
+      if (!$2) {
+        // the | isn't already escaped, so escape it.
+        $2 = '\\'
+      }
+
+      // need to escape all those slashes *again*, without escaping the
+      // one that we need for escaping the | character.  As it works out,
+      // escaping an even number of slashes can be done by simply repeating
+      // it exactly after itself.  That's why this trick works.
+      //
+      // I am sorry that you have to see this.
+      return $1 + $1 + $2 + '|'
+    })
+
+    this.debug('tail=%j\n   %s', tail, tail, pl, re)
+    var t = pl.type === '*' ? star
+      : pl.type === '?' ? qmark
+      : '\\' + pl.type
+
+    hasMagic = true
+    re = re.slice(0, pl.reStart) + t + '\\(' + tail
+  }
+
+  // handle trailing things that only matter at the very end.
+  clearStateChar()
+  if (escaping) {
+    // trailing \\
+    re += '\\\\'
+  }
+
+  // only need to apply the nodot start if the re starts with
+  // something that could conceivably capture a dot
+  var addPatternStart = false
+  switch (re.charAt(0)) {
+    case '.':
+    case '[':
+    case '(': addPatternStart = true
+  }
+
+  // Hack to work around lack of negative lookbehind in JS
+  // A pattern like: *.!(x).!(y|z) needs to ensure that a name
+  // like 'a.xyz.yz' doesn't match.  So, the first negative
+  // lookahead, has to look ALL the way ahead, to the end of
+  // the pattern.
+  for (var n = negativeLists.length - 1; n > -1; n--) {
+    var nl = negativeLists[n]
+
+    var nlBefore = re.slice(0, nl.reStart)
+    var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
+    var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
+    var nlAfter = re.slice(nl.reEnd)
+
+    nlLast += nlAfter
+
+    // Handle nested stuff like *(*.js|!(*.json)), where open parens
+    // mean that we should *not* include the ) in the bit that is considered
+    // "after" the negated section.
+    var openParensBefore = nlBefore.split('(').length - 1
+    var cleanAfter = nlAfter
+    for (i = 0; i < openParensBefore; i++) {
+      cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
+    }
+    nlAfter = cleanAfter
+
+    var dollar = ''
+    if (nlAfter === '' && isSub !== SUBPARSE) {
+      dollar = '$'
+    }
+    var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
+    re = newRe
+  }
+
+  // if the re is not "" at this point, then we need to make sure
+  // it doesn't match against an empty path part.
+  // Otherwise a/* will match a/, which it should not.
+  if (re !== '' && hasMagic) {
+    re = '(?=.)' + re
+  }
+
+  if (addPatternStart) {
+    re = patternStart + re
+  }
+
+  // parsing just a piece of a larger pattern.
+  if (isSub === SUBPARSE) {
+    return [re, hasMagic]
+  }
+
+  // skip the regexp for non-magical patterns
+  // unescape anything in it, though, so that it'll be
+  // an exact match against a file etc.
+  if (!hasMagic) {
+    return globUnescape(pattern)
+  }
+
+  var flags = options.nocase ? 'i' : ''
+  try {
+    var regExp = new RegExp('^' + re + '$', flags)
+  } catch (er) {
+    // If it was an invalid regular expression, then it can't match
+    // anything.  This trick looks for a character after the end of
+    // the string, which is of course impossible, except in multi-line
+    // mode, but it's not a /m regex.
+    return new RegExp('$.')
+  }
+
+  regExp._glob = pattern
+  regExp._src = re
+
+  return regExp
+}
+
+minimatch.makeRe = function (pattern, options) {
+  return new Minimatch(pattern, options || {}).makeRe()
+}
+
+Minimatch.prototype.makeRe = makeRe
+function makeRe () {
+  if (this.regexp || this.regexp === false) return this.regexp
+
+  // at this point, this.set is a 2d array of partial
+  // pattern strings, or "**".
+  //
+  // It's better to use .match().  This function shouldn't
+  // be used, really, but it's pretty convenient sometimes,
+  // when you just want to work with a regex.
+  var set = this.set
+
+  if (!set.length) {
+    this.regexp = false
+    return this.regexp
+  }
+  var options = this.options
+
+  var twoStar = options.noglobstar ? star
+    : options.dot ? twoStarDot
+    : twoStarNoDot
+  var flags = options.nocase ? 'i' : ''
+
+  var re = set.map(function (pattern) {
+    return pattern.map(function (p) {
+      return (p === GLOBSTAR) ? twoStar
+      : (typeof p === 'string') ? regExpEscape(p)
+      : p._src
+    }).join('\\\/')
+  }).join('|')
+
+  // must match entire pattern
+  // ending in a * or ** will make it less strict.
+  re = '^(?:' + re + ')$'
+
+  // can match anything, as long as it's not this.
+  if (this.negate) re = '^(?!' + re + ').*$'
+
+  try {
+    this.regexp = new RegExp(re, flags)
+  } catch (ex) {
+    this.regexp = false
+  }
+  return this.regexp
+}
+
+minimatch.match = function (list, pattern, options) {
+  options = options || {}
+  var mm = new Minimatch(pattern, options)
+  list = list.filter(function (f) {
+    return mm.match(f)
+  })
+  if (mm.options.nonull && !list.length) {
+    list.push(pattern)
+  }
+  return list
+}
+
+Minimatch.prototype.match = match
+function match (f, partial) {
+  this.debug('match', f, this.pattern)
+  // short-circuit in the case of busted things.
+  // comments, etc.
+  if (this.comment) return false
+  if (this.empty) return f === ''
+
+  if (f === '/' && partial) return true
+
+  var options = this.options
+
+  // windows: need to use /, not \
+  if (path.sep !== '/') {
+    f = f.split(path.sep).join('/')
+  }
+
+  // treat the test path as a set of pathparts.
+  f = f.split(slashSplit)
+  this.debug(this.pattern, 'split', f)
+
+  // just ONE of the pattern sets in this.set needs to match
+  // in order for it to be valid.  If negating, then just one
+  // match means that we have failed.
+  // Either way, return on the first hit.
+
+  var set = this.set
+  this.debug(this.pattern, 'set', set)
+
+  // Find the basename of the path by looking for the last non-empty segment
+  var filename
+  var i
+  for (i = f.length - 1; i >= 0; i--) {
+    filename = f[i]
+    if (filename) break
+  }
+
+  for (i = 0; i < set.length; i++) {
+    var pattern = set[i]
+    var file = f
+    if (options.matchBase && pattern.length === 1) {
+      file = [filename]
+    }
+    var hit = this.matchOne(file, pattern, partial)
+    if (hit) {
+      if (options.flipNegate) return true
+      return !this.negate
+    }
+  }
+
+  // didn't get any hits.  this is success if it's a negative
+  // pattern, failure otherwise.
+  if (options.flipNegate) return false
+  return this.negate
+}
+
+// set partial to true to test if, for example,
+// "/a/b" matches the start of "/*/b/*/d"
+// Partial means, if you run out of file before you run
+// out of pattern, then that's fine, as long as all
+// the parts match.
+Minimatch.prototype.matchOne = function (file, pattern, partial) {
+  var options = this.options
+
+  this.debug('matchOne',
+    { 'this': this, file: file, pattern: pattern })
+
+  this.debug('matchOne', file.length, pattern.length)
+
+  for (var fi = 0,
+      pi = 0,
+      fl = file.length,
+      pl = pattern.length
+      ; (fi < fl) && (pi < pl)
+      ; fi++, pi++) {
+    this.debug('matchOne loop')
+    var p = pattern[pi]
+    var f = file[fi]
+
+    this.debug(pattern, p, f)
+
+    // should be impossible.
+    // some invalid regexp stuff in the set.
+    if (p === false) return false
+
+    if (p === GLOBSTAR) {
+      this.debug('GLOBSTAR', [pattern, p, f])
+
+      // "**"
+      // a/**/b/**/c would match the following:
+      // a/b/x/y/z/c
+      // a/x/y/z/b/c
+      // a/b/x/b/x/c
+      // a/b/c
+      // To do this, take the rest of the pattern after
+      // the **, and see if it would match the file remainder.
+      // If so, return success.
+      // If not, the ** "swallows" a segment, and try again.
+      // This is recursively awful.
+      //
+      // a/**/b/**/c matching a/b/x/y/z/c
+      // - a matches a
+      // - doublestar
+      //   - matchOne(b/x/y/z/c, b/**/c)
+      //     - b matches b
+      //     - doublestar
+      //       - matchOne(x/y/z/c, c) -> no
+      //       - matchOne(y/z/c, c) -> no
+      //       - matchOne(z/c, c) -> no
+      //       - matchOne(c, c) yes, hit
+      var fr = fi
+      var pr = pi + 1
+      if (pr === pl) {
+        this.debug('** at the end')
+        // a ** at the end will just swallow the rest.
+        // We have found a match.
+        // however, it will not swallow /.x, unless
+        // options.dot is set.
+        // . and .. are *never* matched by **, for explosively
+        // exponential reasons.
+        for (; fi < fl; fi++) {
+          if (file[fi] === '.' || file[fi] === '..' ||
+            (!options.dot && file[fi].charAt(0) === '.')) return false
+        }
+        return true
+      }
+
+      // ok, let's see if we can swallow whatever we can.
+      while (fr < fl) {
+        var swallowee = file[fr]
+
+        this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
+
+        // XXX remove this slice.  Just pass the start index.
+        if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+          this.debug('globstar found match!', fr, fl, swallowee)
+          // found a match.
+          return true
+        } else {
+          // can't swallow "." or ".." ever.
+          // can only swallow ".foo" when explicitly asked.
+          if (swallowee === '.' || swallowee === '..' ||
+            (!options.dot && swallowee.charAt(0) === '.')) {
+            this.debug('dot detected!', file, fr, pattern, pr)
+            break
+          }
+
+          // ** swallows a segment, and continue.
+          this.debug('globstar swallow a segment, and continue')
+          fr++
+        }
+      }
+
+      // no match was found.
+      // However, in partial mode, we can't say this is necessarily over.
+      // If there's more *pattern* left, then
+      if (partial) {
+        // ran out of file
+        this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
+        if (fr === fl) return true
+      }
+      return false
+    }
+
+    // something other than **
+    // non-magic patterns just have to match exactly
+    // patterns with magic have been turned into regexps.
+    var hit
+    if (typeof p === 'string') {
+      if (options.nocase) {
+        hit = f.toLowerCase() === p.toLowerCase()
+      } else {
+        hit = f === p
+      }
+      this.debug('string match', p, f, hit)
+    } else {
+      hit = f.match(p)
+      this.debug('pattern match', p, f, hit)
+    }
+
+    if (!hit) return false
+  }
+
+  // Note: ending in / means that we'll get a final ""
+  // at the end of the pattern.  This can only match a
+  // corresponding "" at the end of the file.
+  // If the file ends in /, then it can only match a
+  // a pattern that ends in /, unless the pattern just
+  // doesn't have any more for it. But, a/b/ should *not*
+  // match "a/b/*", even though "" matches against the
+  // [^/]*? pattern, except in partial mode, where it might
+  // simply not be reached yet.
+  // However, a/b/ should still satisfy a/*
+
+  // now either we fell off the end of the pattern, or we're done.
+  if (fi === fl && pi === pl) {
+    // ran out of pattern and filename at the same time.
+    // an exact hit!
+    return true
+  } else if (fi === fl) {
+    // ran out of file, but still had pattern left.
+    // this is ok if we're doing the match as part of
+    // a glob fs traversal.
+    return partial
+  } else if (pi === pl) {
+    // ran out of pattern, still have file left.
+    // this is only acceptable if we're on the very last
+    // empty segment of a file with a trailing slash.
+    // a/* should match a/b/
+    var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
+    return emptyFileEnd
+  }
+
+  // should be unreachable.
+  throw new Error('wtf?')
+}
+
+// replace stuff like \* with *
+function globUnescape (s) {
+  return s.replace(/\\(.)/g, '$1')
+}
+
+function regExpEscape (s) {
+  return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
+}
diff --git a/legacy-libs/grpc/node_modules/minimatch/package.json b/legacy-libs/grpc/node_modules/minimatch/package.json
new file mode 100644 (file)
index 0000000..ebfbfc8
--- /dev/null
@@ -0,0 +1,71 @@
+{
+  "_args": [
+    [
+      "minimatch@3.0.4",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "minimatch@3.0.4",
+  "_id": "minimatch@3.0.4",
+  "_inBundle": false,
+  "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
+  "_location": "/grpc/minimatch",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "minimatch@3.0.4",
+    "name": "minimatch",
+    "escapedName": "minimatch",
+    "rawSpec": "3.0.4",
+    "saveSpec": null,
+    "fetchSpec": "3.0.4"
+  },
+  "_requiredBy": [
+    "/grpc/ignore-walk",
+    "/grpc/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
+  "_shrinkwrap": null,
+  "_spec": "3.0.4",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/minimatch/issues"
+  },
+  "dependencies": {
+    "brace-expansion": "^1.1.7"
+  },
+  "description": "a glob matcher in javascript",
+  "devDependencies": {
+    "tap": "^10.3.2"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "files": [
+    "minimatch.js"
+  ],
+  "homepage": "https://github.com/isaacs/minimatch#readme",
+  "license": "ISC",
+  "main": "minimatch.js",
+  "name": "minimatch",
+  "optionalDependencies": {},
+  "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instantiating the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n  Each row in the\n  array corresponds to a brace-expanded pattern.  Each item in the row\n  corresponds to a single path-part.  For example, the pattern\n  `{a,b/c}/d` would expand to a set of patterns like:\n\n        [ [ a, d ]\n        , [ b, c, d ] ]\n\n    If a portion of the pattern doesn't have any \"magic\" in it\n    (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n    will be left as a string rather than converted to a regular\n    expression.\n\n* `regexp` Created by the `makeRe` method.  A single regular expression\n  expressing the entire pattern.  This is useful in cases where you wish\n  to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n  Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n  false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n  filename, and match it against a single row in the `regExpSet`.  This\n  method is mainly for internal use, but is exposed so that it can be\n  used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n### minimatch(path, pattern, options)\n\nMain export.  Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`.  Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob.  If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself if this option is set.  When not set, an empty list\nis returned if there are no matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes.  For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated.  Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally.  This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`.  Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything.  Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set.  This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes.  For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`.  This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern.  Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity.  Since those two are valid, matching proceeds.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/minimatch.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --cov"
+  },
+  "version": "3.0.4"
+}
diff --git a/legacy-libs/grpc/node_modules/minimist/LICENSE b/legacy-libs/grpc/node_modules/minimist/LICENSE
new file mode 100644 (file)
index 0000000..ee27ba4
--- /dev/null
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/minimist/example/parse.js b/legacy-libs/grpc/node_modules/minimist/example/parse.js
new file mode 100644 (file)
index 0000000..abff3e8
--- /dev/null
@@ -0,0 +1,2 @@
+var argv = require('../')(process.argv.slice(2));
+console.dir(argv);
diff --git a/legacy-libs/grpc/node_modules/minimist/index.js b/legacy-libs/grpc/node_modules/minimist/index.js
new file mode 100644 (file)
index 0000000..6a0559d
--- /dev/null
@@ -0,0 +1,236 @@
+module.exports = function (args, opts) {
+    if (!opts) opts = {};
+    
+    var flags = { bools : {}, strings : {}, unknownFn: null };
+
+    if (typeof opts['unknown'] === 'function') {
+        flags.unknownFn = opts['unknown'];
+    }
+
+    if (typeof opts['boolean'] === 'boolean' && opts['boolean']) {
+      flags.allBools = true;
+    } else {
+      [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
+          flags.bools[key] = true;
+      });
+    }
+    
+    var aliases = {};
+    Object.keys(opts.alias || {}).forEach(function (key) {
+        aliases[key] = [].concat(opts.alias[key]);
+        aliases[key].forEach(function (x) {
+            aliases[x] = [key].concat(aliases[key].filter(function (y) {
+                return x !== y;
+            }));
+        });
+    });
+
+    [].concat(opts.string).filter(Boolean).forEach(function (key) {
+        flags.strings[key] = true;
+        if (aliases[key]) {
+            flags.strings[aliases[key]] = true;
+        }
+     });
+
+    var defaults = opts['default'] || {};
+    
+    var argv = { _ : [] };
+    Object.keys(flags.bools).forEach(function (key) {
+        setArg(key, defaults[key] === undefined ? false : defaults[key]);
+    });
+    
+    var notFlags = [];
+
+    if (args.indexOf('--') !== -1) {
+        notFlags = args.slice(args.indexOf('--')+1);
+        args = args.slice(0, args.indexOf('--'));
+    }
+
+    function argDefined(key, arg) {
+        return (flags.allBools && /^--[^=]+$/.test(arg)) ||
+            flags.strings[key] || flags.bools[key] || aliases[key];
+    }
+
+    function setArg (key, val, arg) {
+        if (arg && flags.unknownFn && !argDefined(key, arg)) {
+            if (flags.unknownFn(arg) === false) return;
+        }
+
+        var value = !flags.strings[key] && isNumber(val)
+            ? Number(val) : val
+        ;
+        setKey(argv, key.split('.'), value);
+        
+        (aliases[key] || []).forEach(function (x) {
+            setKey(argv, x.split('.'), value);
+        });
+    }
+
+    function setKey (obj, keys, value) {
+        var o = obj;
+        keys.slice(0,-1).forEach(function (key) {
+            if (o[key] === undefined) o[key] = {};
+            o = o[key];
+        });
+
+        var key = keys[keys.length - 1];
+        if (o[key] === undefined || flags.bools[key] || typeof o[key] === 'boolean') {
+            o[key] = value;
+        }
+        else if (Array.isArray(o[key])) {
+            o[key].push(value);
+        }
+        else {
+            o[key] = [ o[key], value ];
+        }
+    }
+    
+    function aliasIsBoolean(key) {
+      return aliases[key].some(function (x) {
+          return flags.bools[x];
+      });
+    }
+
+    for (var i = 0; i < args.length; i++) {
+        var arg = args[i];
+        
+        if (/^--.+=/.test(arg)) {
+            // Using [\s\S] instead of . because js doesn't support the
+            // 'dotall' regex modifier. See:
+            // http://stackoverflow.com/a/1068308/13216
+            var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
+            var key = m[1];
+            var value = m[2];
+            if (flags.bools[key]) {
+                value = value !== 'false';
+            }
+            setArg(key, value, arg);
+        }
+        else if (/^--no-.+/.test(arg)) {
+            var key = arg.match(/^--no-(.+)/)[1];
+            setArg(key, false, arg);
+        }
+        else if (/^--.+/.test(arg)) {
+            var key = arg.match(/^--(.+)/)[1];
+            var next = args[i + 1];
+            if (next !== undefined && !/^-/.test(next)
+            && !flags.bools[key]
+            && !flags.allBools
+            && (aliases[key] ? !aliasIsBoolean(key) : true)) {
+                setArg(key, next, arg);
+                i++;
+            }
+            else if (/^(true|false)$/.test(next)) {
+                setArg(key, next === 'true', arg);
+                i++;
+            }
+            else {
+                setArg(key, flags.strings[key] ? '' : true, arg);
+            }
+        }
+        else if (/^-[^-]+/.test(arg)) {
+            var letters = arg.slice(1,-1).split('');
+            
+            var broken = false;
+            for (var j = 0; j < letters.length; j++) {
+                var next = arg.slice(j+2);
+                
+                if (next === '-') {
+                    setArg(letters[j], next, arg)
+                    continue;
+                }
+                
+                if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
+                    setArg(letters[j], next.split('=')[1], arg);
+                    broken = true;
+                    break;
+                }
+                
+                if (/[A-Za-z]/.test(letters[j])
+                && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
+                    setArg(letters[j], next, arg);
+                    broken = true;
+                    break;
+                }
+                
+                if (letters[j+1] && letters[j+1].match(/\W/)) {
+                    setArg(letters[j], arg.slice(j+2), arg);
+                    broken = true;
+                    break;
+                }
+                else {
+                    setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
+                }
+            }
+            
+            var key = arg.slice(-1)[0];
+            if (!broken && key !== '-') {
+                if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
+                && !flags.bools[key]
+                && (aliases[key] ? !aliasIsBoolean(key) : true)) {
+                    setArg(key, args[i+1], arg);
+                    i++;
+                }
+                else if (args[i+1] && /true|false/.test(args[i+1])) {
+                    setArg(key, args[i+1] === 'true', arg);
+                    i++;
+                }
+                else {
+                    setArg(key, flags.strings[key] ? '' : true, arg);
+                }
+            }
+        }
+        else {
+            if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
+                argv._.push(
+                    flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
+                );
+            }
+            if (opts.stopEarly) {
+                argv._.push.apply(argv._, args.slice(i + 1));
+                break;
+            }
+        }
+    }
+    
+    Object.keys(defaults).forEach(function (key) {
+        if (!hasKey(argv, key.split('.'))) {
+            setKey(argv, key.split('.'), defaults[key]);
+            
+            (aliases[key] || []).forEach(function (x) {
+                setKey(argv, x.split('.'), defaults[key]);
+            });
+        }
+    });
+    
+    if (opts['--']) {
+        argv['--'] = new Array();
+        notFlags.forEach(function(key) {
+            argv['--'].push(key);
+        });
+    }
+    else {
+        notFlags.forEach(function(key) {
+            argv._.push(key);
+        });
+    }
+
+    return argv;
+};
+
+function hasKey (obj, keys) {
+    var o = obj;
+    keys.slice(0,-1).forEach(function (key) {
+        o = (o[key] || {});
+    });
+
+    var key = keys[keys.length - 1];
+    return key in o;
+}
+
+function isNumber (x) {
+    if (typeof x === 'number') return true;
+    if (/^0x[0-9a-f]+$/i.test(x)) return true;
+    return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
+}
+
diff --git a/legacy-libs/grpc/node_modules/minimist/package.json b/legacy-libs/grpc/node_modules/minimist/package.json
new file mode 100644 (file)
index 0000000..4daddce
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "_args": [
+    [
+      "minimist@1.2.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "minimist@1.2.0",
+  "_id": "minimist@1.2.0",
+  "_inBundle": false,
+  "_integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+  "_location": "/grpc/minimist",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "minimist@1.2.0",
+    "name": "minimist",
+    "escapedName": "minimist",
+    "rawSpec": "1.2.0",
+    "saveSpec": null,
+    "fetchSpec": "1.2.0"
+  },
+  "_requiredBy": [
+    "/grpc/rc"
+  ],
+  "_resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.2.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/minimist/issues"
+  },
+  "dependencies": {},
+  "description": "parse argument options",
+  "devDependencies": {
+    "covert": "^1.0.0",
+    "tap": "~0.4.0",
+    "tape": "^3.5.0"
+  },
+  "homepage": "https://github.com/substack/minimist",
+  "keywords": [
+    "argv",
+    "getopt",
+    "parser",
+    "optimist"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "minimist",
+  "optionalDependencies": {},
+  "readme": "# minimist\n\nparse argument options\n\nThis module is the guts of optimist's argument parser without all the\nfanciful decoration.\n\n[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)\n\n[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)\n\n# example\n\n``` js\nvar argv = require('minimist')(process.argv.slice(2));\nconsole.dir(argv);\n```\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n  x: 3,\n  y: 4,\n  n: 5,\n  a: true,\n  b: true,\n  c: true,\n  beep: 'boop' }\n```\n\n# methods\n\n``` js\nvar parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a boolean, string or array of strings to always treat as\nbooleans. if `true` will treat all double hyphenated arguments without equal signs\nas boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n* `opts.stopEarly` - when true, populate `argv._` with everything after the\nfirst non-option\n* `opts['--']` - when true, populate `argv._` with everything before the `--`\nand `argv['--']` with everything after the `--`. Here's an example:\n* `opts.unknown` - a function which is invoked with a command line parameter not\ndefined in the `opts` configuration object. If the function returns `false`, the\nunknown option is not added to `argv`.\n\n```\n> require('./')('one two three -- four five --six'.split(' '), { '--': true })\n{ _: [ 'one', 'two', 'three' ],\n  '--': [ 'four', 'five', '--six' ] }\n```\n\nNote that with `opts['--']` set, parsing for arguments still stops after the\n`--`.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install minimist\n```\n\n# license\n\nMIT\n",
+  "readmeFilename": "readme.markdown",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/minimist.git"
+  },
+  "scripts": {
+    "coverage": "covert test/*.js",
+    "test": "tap test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/6..latest",
+      "ff/5",
+      "firefox/latest",
+      "chrome/10",
+      "chrome/latest",
+      "safari/5.1",
+      "safari/latest",
+      "opera/12"
+    ]
+  },
+  "version": "1.2.0"
+}
diff --git a/legacy-libs/grpc/node_modules/minimist/readme.markdown b/legacy-libs/grpc/node_modules/minimist/readme.markdown
new file mode 100644 (file)
index 0000000..30a74cf
--- /dev/null
@@ -0,0 +1,91 @@
+# minimist
+
+parse argument options
+
+This module is the guts of optimist's argument parser without all the
+fanciful decoration.
+
+[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)
+
+[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)
+
+# example
+
+``` js
+var argv = require('minimist')(process.argv.slice(2));
+console.dir(argv);
+```
+
+```
+$ node example/parse.js -a beep -b boop
+{ _: [], a: 'beep', b: 'boop' }
+```
+
+```
+$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
+{ _: [ 'foo', 'bar', 'baz' ],
+  x: 3,
+  y: 4,
+  n: 5,
+  a: true,
+  b: true,
+  c: true,
+  beep: 'boop' }
+```
+
+# methods
+
+``` js
+var parseArgs = require('minimist')
+```
+
+## var argv = parseArgs(args, opts={})
+
+Return an argument object `argv` populated with the array arguments from `args`.
+
+`argv._` contains all the arguments that didn't have an option associated with
+them.
+
+Numeric-looking arguments will be returned as numbers unless `opts.string` or
+`opts.boolean` is set for that argument name.
+
+Any arguments after `'--'` will not be parsed and will end up in `argv._`.
+
+options can be:
+
+* `opts.string` - a string or array of strings argument names to always treat as
+strings
+* `opts.boolean` - a boolean, string or array of strings to always treat as
+booleans. if `true` will treat all double hyphenated arguments without equal signs
+as boolean (e.g. affects `--foo`, not `-f` or `--foo=bar`)
+* `opts.alias` - an object mapping string names to strings or arrays of string
+argument names to use as aliases
+* `opts.default` - an object mapping string argument names to default values
+* `opts.stopEarly` - when true, populate `argv._` with everything after the
+first non-option
+* `opts['--']` - when true, populate `argv._` with everything before the `--`
+and `argv['--']` with everything after the `--`. Here's an example:
+* `opts.unknown` - a function which is invoked with a command line parameter not
+defined in the `opts` configuration object. If the function returns `false`, the
+unknown option is not added to `argv`.
+
+```
+> require('./')('one two three -- four five --six'.split(' '), { '--': true })
+{ _: [ 'one', 'two', 'three' ],
+  '--': [ 'four', 'five', '--six' ] }
+```
+
+Note that with `opts['--']` set, parsing for arguments still stops after the
+`--`.
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install minimist
+```
+
+# license
+
+MIT
diff --git a/legacy-libs/grpc/node_modules/minimist/test/all_bool.js b/legacy-libs/grpc/node_modules/minimist/test/all_bool.js
new file mode 100644 (file)
index 0000000..ac83548
--- /dev/null
@@ -0,0 +1,32 @@
+var parse = require('../');
+var test = require('tape');
+
+test('flag boolean true (default all --args to boolean)', function (t) {
+    var argv = parse(['moo', '--honk', 'cow'], {
+        boolean: true
+    });
+    
+    t.deepEqual(argv, {
+        honk: true,
+        _: ['moo', 'cow']
+    });
+    
+    t.deepEqual(typeof argv.honk, 'boolean');
+    t.end();
+});
+
+test('flag boolean true only affects double hyphen arguments without equals signs', function (t) {
+    var argv = parse(['moo', '--honk', 'cow', '-p', '55', '--tacos=good'], {
+        boolean: true
+    });
+    
+    t.deepEqual(argv, {
+        honk: true,
+        tacos: 'good',
+        p: 55,
+        _: ['moo', 'cow']
+    });
+    
+    t.deepEqual(typeof argv.honk, 'boolean');
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/bool.js b/legacy-libs/grpc/node_modules/minimist/test/bool.js
new file mode 100644 (file)
index 0000000..14b0717
--- /dev/null
@@ -0,0 +1,166 @@
+var parse = require('../');
+var test = require('tape');
+
+test('flag boolean default false', function (t) {
+    var argv = parse(['moo'], {
+        boolean: ['t', 'verbose'],
+        default: { verbose: false, t: false }
+    });
+    
+    t.deepEqual(argv, {
+        verbose: false,
+        t: false,
+        _: ['moo']
+    });
+    
+    t.deepEqual(typeof argv.verbose, 'boolean');
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+
+});
+
+test('boolean groups', function (t) {
+    var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], {
+        boolean: ['x','y','z']
+    });
+    
+    t.deepEqual(argv, {
+        x : true,
+        y : false,
+        z : true,
+        _ : [ 'one', 'two', 'three' ]
+    });
+    
+    t.deepEqual(typeof argv.x, 'boolean');
+    t.deepEqual(typeof argv.y, 'boolean');
+    t.deepEqual(typeof argv.z, 'boolean');
+    t.end();
+});
+test('boolean and alias with chainable api', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp',  'derp' ];
+    var opts = {
+        herp: { alias: 'h', boolean: true }
+    };
+    var aliasedArgv = parse(aliased, {
+        boolean: 'herp',
+        alias: { h: 'herp' }
+    });
+    var propertyArgv = parse(regular, {
+        boolean: 'herp',
+        alias: { h: 'herp' }
+    });
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected); 
+    t.end();
+});
+
+test('boolean and alias with options hash', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp', 'derp' ];
+    var opts = {
+        alias: { 'h': 'herp' },
+        boolean: 'herp'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected);
+    t.end();
+});
+
+test('boolean and alias array with options hash', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp', 'derp' ];
+    var alt = [ '--harp', 'derp' ];
+    var opts = {
+        alias: { 'h': ['herp', 'harp'] },
+        boolean: 'h'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var altPropertyArgv = parse(alt, opts);
+    var expected = {
+        harp: true,
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected);
+    t.same(altPropertyArgv, expected);
+    t.end();
+});
+
+test('boolean and alias using explicit true', function (t) {
+    var aliased = [ '-h', 'true' ];
+    var regular = [ '--herp',  'true' ];
+    var opts = {
+        alias: { h: 'herp' },
+        boolean: 'h'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ ]
+    };
+
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected); 
+    t.end();
+});
+
+// regression, see https://github.com/substack/node-optimist/issues/71
+test('boolean and --x=true', function(t) {
+    var parsed = parse(['--boool', '--other=true'], {
+        boolean: 'boool'
+    });
+
+    t.same(parsed.boool, true);
+    t.same(parsed.other, 'true');
+
+    parsed = parse(['--boool', '--other=false'], {
+        boolean: 'boool'
+    });
+    
+    t.same(parsed.boool, true);
+    t.same(parsed.other, 'false');
+    t.end();
+});
+
+test('boolean --boool=true', function (t) {
+    var parsed = parse(['--boool=true'], {
+        default: {
+            boool: false
+        },
+        boolean: ['boool']
+    });
+
+    t.same(parsed.boool, true);
+    t.end();
+});
+
+test('boolean --boool=false', function (t) {
+    var parsed = parse(['--boool=false'], {
+        default: {
+          boool: true
+        },
+        boolean: ['boool']
+    });
+
+    t.same(parsed.boool, false);
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/dash.js b/legacy-libs/grpc/node_modules/minimist/test/dash.js
new file mode 100644 (file)
index 0000000..5a4fa5b
--- /dev/null
@@ -0,0 +1,31 @@
+var parse = require('../');
+var test = require('tape');
+
+test('-', function (t) {
+    t.plan(5);
+    t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] });
+    t.deepEqual(parse([ '-' ]), { _: [ '-' ] });
+    t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] });
+    t.deepEqual(
+        parse([ '-b', '-' ], { boolean: 'b' }),
+        { b: true, _: [ '-' ] }
+    );
+    t.deepEqual(
+        parse([ '-s', '-' ], { string: 's' }),
+        { s: '-', _: [] }
+    );
+});
+
+test('-a -- b', function (t) {
+    t.plan(3);
+    t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+});
+
+test('move arguments after the -- into their own `--` array', function(t) {
+    t.plan(1);
+    t.deepEqual(
+        parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }),
+        { name: 'John', _: [ 'before' ], '--': [ 'after' ] });
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/default_bool.js b/legacy-libs/grpc/node_modules/minimist/test/default_bool.js
new file mode 100644 (file)
index 0000000..780a311
--- /dev/null
@@ -0,0 +1,35 @@
+var test = require('tape');
+var parse = require('../');
+
+test('boolean default true', function (t) {
+    var argv = parse([], {
+        boolean: 'sometrue',
+        default: { sometrue: true }
+    });
+    t.equal(argv.sometrue, true);
+    t.end();
+});
+
+test('boolean default false', function (t) {
+    var argv = parse([], {
+        boolean: 'somefalse',
+        default: { somefalse: false }
+    });
+    t.equal(argv.somefalse, false);
+    t.end();
+});
+
+test('boolean default to null', function (t) {
+    var argv = parse([], {
+        boolean: 'maybe',
+        default: { maybe: null }
+    });
+    t.equal(argv.maybe, null);
+    var argv = parse(['--maybe'], {
+        boolean: 'maybe',
+        default: { maybe: null }
+    });
+    t.equal(argv.maybe, true);
+    t.end();
+
+})
diff --git a/legacy-libs/grpc/node_modules/minimist/test/dotted.js b/legacy-libs/grpc/node_modules/minimist/test/dotted.js
new file mode 100644 (file)
index 0000000..d8b3e85
--- /dev/null
@@ -0,0 +1,22 @@
+var parse = require('../');
+var test = require('tape');
+
+test('dotted alias', function (t) {
+    var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
+    t.equal(argv.a.b, 22);
+    t.equal(argv.aa.bb, 22);
+    t.end();
+});
+
+test('dotted default', function (t) {
+    var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
+    t.equal(argv.a.b, 11);
+    t.equal(argv.aa.bb, 11);
+    t.end();
+});
+
+test('dotted default with no alias', function (t) {
+    var argv = parse('', {default: {'a.b': 11}});
+    t.equal(argv.a.b, 11);
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/kv_short.js b/legacy-libs/grpc/node_modules/minimist/test/kv_short.js
new file mode 100644 (file)
index 0000000..f813b30
--- /dev/null
@@ -0,0 +1,16 @@
+var parse = require('../');
+var test = require('tape');
+
+test('short -k=v' , function (t) {
+    t.plan(1);
+    
+    var argv = parse([ '-b=123' ]);
+    t.deepEqual(argv, { b: 123, _: [] });
+});
+
+test('multi short -k=v' , function (t) {
+    t.plan(1);
+    
+    var argv = parse([ '-a=whatever', '-b=robots' ]);
+    t.deepEqual(argv, { a: 'whatever', b: 'robots', _: [] });
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/long.js b/legacy-libs/grpc/node_modules/minimist/test/long.js
new file mode 100644 (file)
index 0000000..5d3a1e0
--- /dev/null
@@ -0,0 +1,31 @@
+var test = require('tape');
+var parse = require('../');
+
+test('long opts', function (t) {
+    t.deepEqual(
+        parse([ '--bool' ]),
+        { bool : true, _ : [] },
+        'long boolean'
+    );
+    t.deepEqual(
+        parse([ '--pow', 'xixxle' ]),
+        { pow : 'xixxle', _ : [] },
+        'long capture sp'
+    );
+    t.deepEqual(
+        parse([ '--pow=xixxle' ]),
+        { pow : 'xixxle', _ : [] },
+        'long capture eq'
+    );
+    t.deepEqual(
+        parse([ '--host', 'localhost', '--port', '555' ]),
+        { host : 'localhost', port : 555, _ : [] },
+        'long captures sp'
+    );
+    t.deepEqual(
+        parse([ '--host=localhost', '--port=555' ]),
+        { host : 'localhost', port : 555, _ : [] },
+        'long captures eq'
+    );
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/num.js b/legacy-libs/grpc/node_modules/minimist/test/num.js
new file mode 100644 (file)
index 0000000..2cc77f4
--- /dev/null
@@ -0,0 +1,36 @@
+var parse = require('../');
+var test = require('tape');
+
+test('nums', function (t) {
+    var argv = parse([
+        '-x', '1234',
+        '-y', '5.67',
+        '-z', '1e7',
+        '-w', '10f',
+        '--hex', '0xdeadbeef',
+        '789'
+    ]);
+    t.deepEqual(argv, {
+        x : 1234,
+        y : 5.67,
+        z : 1e7,
+        w : '10f',
+        hex : 0xdeadbeef,
+        _ : [ 789 ]
+    });
+    t.deepEqual(typeof argv.x, 'number');
+    t.deepEqual(typeof argv.y, 'number');
+    t.deepEqual(typeof argv.z, 'number');
+    t.deepEqual(typeof argv.w, 'string');
+    t.deepEqual(typeof argv.hex, 'number');
+    t.deepEqual(typeof argv._[0], 'number');
+    t.end();
+});
+
+test('already a number', function (t) {
+    var argv = parse([ '-x', 1234, 789 ]);
+    t.deepEqual(argv, { x : 1234, _ : [ 789 ] });
+    t.deepEqual(typeof argv.x, 'number');
+    t.deepEqual(typeof argv._[0], 'number');
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/parse.js b/legacy-libs/grpc/node_modules/minimist/test/parse.js
new file mode 100644 (file)
index 0000000..7b4a2a1
--- /dev/null
@@ -0,0 +1,197 @@
+var parse = require('../');
+var test = require('tape');
+
+test('parse args', function (t) {
+    t.deepEqual(
+        parse([ '--no-moo' ]),
+        { moo : false, _ : [] },
+        'no'
+    );
+    t.deepEqual(
+        parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
+        { v : ['a','b','c'], _ : [] },
+        'multi'
+    );
+    t.end();
+});
+test('comprehensive', function (t) {
+    t.deepEqual(
+        parse([
+            '--name=meowmers', 'bare', '-cats', 'woo',
+            '-h', 'awesome', '--multi=quux',
+            '--key', 'value',
+            '-b', '--bool', '--no-meep', '--multi=baz',
+            '--', '--not-a-flag', 'eek'
+        ]),
+        {
+            c : true,
+            a : true,
+            t : true,
+            s : 'woo',
+            h : 'awesome',
+            b : true,
+            bool : true,
+            key : 'value',
+            multi : [ 'quux', 'baz' ],
+            meep : false,
+            name : 'meowmers',
+            _ : [ 'bare', '--not-a-flag', 'eek' ]
+        }
+    );
+    t.end();
+});
+
+test('flag boolean', function (t) {
+    var argv = parse([ '-t', 'moo' ], { boolean: 't' });
+    t.deepEqual(argv, { t : true, _ : [ 'moo' ] });
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+});
+
+test('flag boolean value', function (t) {
+    var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {
+        boolean: [ 't', 'verbose' ],
+        default: { verbose: true }
+    });
+    
+    t.deepEqual(argv, {
+        verbose: false,
+        t: true,
+        _: ['moo']
+    });
+    
+    t.deepEqual(typeof argv.verbose, 'boolean');
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+});
+
+test('newlines in params' , function (t) {
+    var args = parse([ '-s', "X\nX" ])
+    t.deepEqual(args, { _ : [], s : "X\nX" });
+    
+    // reproduce in bash:
+    // VALUE="new
+    // line"
+    // node program.js --s="$VALUE"
+    args = parse([ "--s=X\nX" ])
+    t.deepEqual(args, { _ : [], s : "X\nX" });
+    t.end();
+});
+
+test('strings' , function (t) {
+    var s = parse([ '-s', '0001234' ], { string: 's' }).s;
+    t.equal(s, '0001234');
+    t.equal(typeof s, 'string');
+    
+    var x = parse([ '-x', '56' ], { string: 'x' }).x;
+    t.equal(x, '56');
+    t.equal(typeof x, 'string');
+    t.end();
+});
+
+test('stringArgs', function (t) {
+    var s = parse([ '  ', '  ' ], { string: '_' })._;
+    t.same(s.length, 2);
+    t.same(typeof s[0], 'string');
+    t.same(s[0], '  ');
+    t.same(typeof s[1], 'string');
+    t.same(s[1], '  ');
+    t.end();
+});
+
+test('empty strings', function(t) {
+    var s = parse([ '-s' ], { string: 's' }).s;
+    t.equal(s, '');
+    t.equal(typeof s, 'string');
+
+    var str = parse([ '--str' ], { string: 'str' }).str;
+    t.equal(str, '');
+    t.equal(typeof str, 'string');
+
+    var letters = parse([ '-art' ], {
+        string: [ 'a', 't' ]
+    });
+
+    t.equal(letters.a, '');
+    t.equal(letters.r, true);
+    t.equal(letters.t, '');
+
+    t.end();
+});
+
+
+test('string and alias', function(t) {
+    var x = parse([ '--str',  '000123' ], {
+        string: 's',
+        alias: { s: 'str' }
+    });
+
+    t.equal(x.str, '000123');
+    t.equal(typeof x.str, 'string');
+    t.equal(x.s, '000123');
+    t.equal(typeof x.s, 'string');
+
+    var y = parse([ '-s',  '000123' ], {
+        string: 'str',
+        alias: { str: 's' }
+    });
+
+    t.equal(y.str, '000123');
+    t.equal(typeof y.str, 'string');
+    t.equal(y.s, '000123');
+    t.equal(typeof y.s, 'string');
+    t.end();
+});
+
+test('slashBreak', function (t) {
+    t.same(
+        parse([ '-I/foo/bar/baz' ]),
+        { I : '/foo/bar/baz', _ : [] }
+    );
+    t.same(
+        parse([ '-xyz/foo/bar/baz' ]),
+        { x : true, y : true, z : '/foo/bar/baz', _ : [] }
+    );
+    t.end();
+});
+
+test('alias', function (t) {
+    var argv = parse([ '-f', '11', '--zoom', '55' ], {
+        alias: { z: 'zoom' }
+    });
+    t.equal(argv.zoom, 55);
+    t.equal(argv.z, argv.zoom);
+    t.equal(argv.f, 11);
+    t.end();
+});
+
+test('multiAlias', function (t) {
+    var argv = parse([ '-f', '11', '--zoom', '55' ], {
+        alias: { z: [ 'zm', 'zoom' ] }
+    });
+    t.equal(argv.zoom, 55);
+    t.equal(argv.z, argv.zoom);
+    t.equal(argv.z, argv.zm);
+    t.equal(argv.f, 11);
+    t.end();
+});
+
+test('nested dotted objects', function (t) {
+    var argv = parse([
+        '--foo.bar', '3', '--foo.baz', '4',
+        '--foo.quux.quibble', '5', '--foo.quux.o_O',
+        '--beep.boop'
+    ]);
+    
+    t.same(argv.foo, {
+        bar : 3,
+        baz : 4,
+        quux : {
+            quibble : 5,
+            o_O : true
+        }
+    });
+    t.same(argv.beep, { boop : true });
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/parse_modified.js b/legacy-libs/grpc/node_modules/minimist/test/parse_modified.js
new file mode 100644 (file)
index 0000000..ab620dc
--- /dev/null
@@ -0,0 +1,9 @@
+var parse = require('../');
+var test = require('tape');
+
+test('parse with modifier functions' , function (t) {
+    t.plan(1);
+    
+    var argv = parse([ '-b', '123' ], { boolean: 'b' });
+    t.deepEqual(argv, { b: true, _: [123] });
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/short.js b/legacy-libs/grpc/node_modules/minimist/test/short.js
new file mode 100644 (file)
index 0000000..d513a1c
--- /dev/null
@@ -0,0 +1,67 @@
+var parse = require('../');
+var test = require('tape');
+
+test('numeric short args', function (t) {
+    t.plan(2);
+    t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });
+    t.deepEqual(
+        parse([ '-123', '456' ]),
+        { 1: true, 2: true, 3: 456, _: [] }
+    );
+});
+
+test('short', function (t) {
+    t.deepEqual(
+        parse([ '-b' ]),
+        { b : true, _ : [] },
+        'short boolean'
+    );
+    t.deepEqual(
+        parse([ 'foo', 'bar', 'baz' ]),
+        { _ : [ 'foo', 'bar', 'baz' ] },
+        'bare'
+    );
+    t.deepEqual(
+        parse([ '-cats' ]),
+        { c : true, a : true, t : true, s : true, _ : [] },
+        'group'
+    );
+    t.deepEqual(
+        parse([ '-cats', 'meow' ]),
+        { c : true, a : true, t : true, s : 'meow', _ : [] },
+        'short group next'
+    );
+    t.deepEqual(
+        parse([ '-h', 'localhost' ]),
+        { h : 'localhost', _ : [] },
+        'short capture'
+    );
+    t.deepEqual(
+        parse([ '-h', 'localhost', '-p', '555' ]),
+        { h : 'localhost', p : 555, _ : [] },
+        'short captures'
+    );
+    t.end();
+});
+test('mixed short bool and capture', function (t) {
+    t.same(
+        parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+        {
+            f : true, p : 555, h : 'localhost',
+            _ : [ 'script.js' ]
+        }
+    );
+    t.end();
+});
+test('short and long', function (t) {
+    t.deepEqual(
+        parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+        {
+            f : true, p : 555, h : 'localhost',
+            _ : [ 'script.js' ]
+        }
+    );
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/stop_early.js b/legacy-libs/grpc/node_modules/minimist/test/stop_early.js
new file mode 100644 (file)
index 0000000..bdf9fbc
--- /dev/null
@@ -0,0 +1,15 @@
+var parse = require('../');
+var test = require('tape');
+
+test('stops parsing on the first non-option when stopEarly is set', function (t) {
+    var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
+        stopEarly: true
+    });
+
+    t.deepEqual(argv, {
+        aaa: 'bbb',
+        _: ['ccc', '--ddd']
+    });
+
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/unknown.js b/legacy-libs/grpc/node_modules/minimist/test/unknown.js
new file mode 100644 (file)
index 0000000..462a36b
--- /dev/null
@@ -0,0 +1,102 @@
+var parse = require('../');
+var test = require('tape');
+
+test('boolean and alias is not unknown', function (t) {
+    var unknown = [];
+    function unknownFn(arg) {
+        unknown.push(arg);
+        return false;
+    }
+    var aliased = [ '-h', 'true', '--derp', 'true' ];
+    var regular = [ '--herp',  'true', '-d', 'true' ];
+    var opts = {
+        alias: { h: 'herp' },
+        boolean: 'h',
+        unknown: unknownFn
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+
+    t.same(unknown, ['--derp', '-d']);
+    t.end();
+});
+
+test('flag boolean true any double hyphen argument is not unknown', function (t) {
+    var unknown = [];
+    function unknownFn(arg) {
+        unknown.push(arg);
+        return false;
+    }
+    var argv = parse(['--honk', '--tacos=good', 'cow', '-p', '55'], {
+        boolean: true,
+        unknown: unknownFn
+    });
+    t.same(unknown, ['--tacos=good', 'cow', '-p']);
+    t.same(argv, {
+        honk: true,
+        _: []
+    });
+    t.end();
+});
+
+test('string and alias is not unknown', function (t) {
+    var unknown = [];
+    function unknownFn(arg) {
+        unknown.push(arg);
+        return false;
+    }
+    var aliased = [ '-h', 'hello', '--derp', 'goodbye' ];
+    var regular = [ '--herp',  'hello', '-d', 'moon' ];
+    var opts = {
+        alias: { h: 'herp' },
+        string: 'h',
+        unknown: unknownFn
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+
+    t.same(unknown, ['--derp', '-d']);
+    t.end();
+});
+
+test('default and alias is not unknown', function (t) {
+    var unknown = [];
+    function unknownFn(arg) {
+        unknown.push(arg);
+        return false;
+    }
+    var aliased = [ '-h', 'hello' ];
+    var regular = [ '--herp',  'hello' ];
+    var opts = {
+        default: { 'h': 'bar' },
+        alias: { 'h': 'herp' },
+        unknown: unknownFn
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+
+    t.same(unknown, []);
+    t.end();
+    unknownFn(); // exercise fn for 100% coverage
+});
+
+test('value following -- is not unknown', function (t) {
+    var unknown = [];
+    function unknownFn(arg) {
+        unknown.push(arg);
+        return false;
+    }
+    var aliased = [ '--bad', '--', 'good', 'arg' ];
+    var opts = {
+        '--': true,
+        unknown: unknownFn
+    };
+    var argv = parse(aliased, opts);
+
+    t.same(unknown, ['--bad']);
+    t.same(argv, {
+        '--': ['good', 'arg'],
+        '_': []
+    })
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/minimist/test/whitespace.js b/legacy-libs/grpc/node_modules/minimist/test/whitespace.js
new file mode 100644 (file)
index 0000000..8a52a58
--- /dev/null
@@ -0,0 +1,8 @@
+var parse = require('../');
+var test = require('tape');
+
+test('whitespace should be whitespace' , function (t) {
+    t.plan(1);
+    var x = parse([ '-x', '\t' ]).x;
+    t.equal(x, '\t');
+});
diff --git a/legacy-libs/grpc/node_modules/minipass/LICENSE b/legacy-libs/grpc/node_modules/minipass/LICENSE
new file mode 100644 (file)
index 0000000..20a4762
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) npm, Inc. and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/minipass/README.md b/legacy-libs/grpc/node_modules/minipass/README.md
new file mode 100644 (file)
index 0000000..7a83c59
--- /dev/null
@@ -0,0 +1,124 @@
+# minipass
+
+A _very_ minimal implementation of a [PassThrough
+stream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough)
+
+[It's very
+fast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0)
+for objects, strings, and buffers.
+
+Supports pipe()ing (including multi-pipe() and backpressure
+transmission), buffering data until either a `data` event handler or
+`pipe()` is added (so you don't lose the first chunk), and most other
+cases where PassThrough is a good idea.
+
+There is a `read()` method, but it's much more efficient to consume
+data from this stream via `'data'` events or by calling `pipe()` into
+some other stream.  Calling `read()` requires the buffer to be
+flattened in some cases, which requires copying memory.
+
+There is also no `unpipe()` method.  Once you start piping, there is
+no stopping it!
+
+If you set `objectMode: true` in the options, then whatever is written
+will be emitted.  Otherwise, it'll do a minimal amount of Buffer
+copying to ensure proper Streams semantics when `read(n)` is called.
+
+This is not a `through` or `through2` stream.  It doesn't transform
+the data, it just passes it right through.  If you want to transform
+the data, extend the class, and override the `write()` method.  Once
+you're done transforming the data however you want, call
+`super.write()` with the transform output.
+
+For an example of a stream that extends MiniPass to provide transform
+capabilities, check out [minizlib](http://npm.im/minizlib).
+
+## USAGE
+
+```js
+const MiniPass = require('minipass')
+const mp = new MiniPass(options) // optional: { encoding }
+mp.write('foo')
+mp.pipe(someOtherStream)
+mp.end('bar')
+```
+
+### collecting
+
+```js
+mp.collect().then(all => {
+  // all is an array of all the data emitted
+  // encoding is supported in this case, so
+  // so the result will be a collection of strings if
+  // an encoding is specified, or buffers/objects if not.
+  //
+  // In an async function, you may do
+  // const data = await stream.collect()
+})
+```
+
+### iteration
+
+You can iterate over streams synchronously or asynchronously in
+platforms that support it.
+
+Synchronous iteration will end when the currently available data is
+consumed, even if the `end` event has not been reached.  In string and
+buffer mode, the data is concatenated, so unless multiple writes are
+occurring in the same tick as the `read()`, sync iteration loops will
+generally only have a single iteration.
+
+To consume chunks in this way exactly as they have been written, with
+no flattening, create the stream with the `{ objectMode: true }`
+option.
+
+```js
+const mp = new Minipass({ objectMode: true })
+mp.write('a')
+mp.write('b')
+for (let letter of mp) {
+  console.log(letter) // a, b
+}
+mp.write('c')
+mp.write('d')
+for (let letter of mp) {
+  console.log(letter) // c, d
+}
+mp.write('e')
+mp.end()
+for (let letter of mp) {
+  console.log(letter) // e
+}
+for (let letter of mp) {
+  console.log(letter) // nothing
+}
+```
+
+Asynchronous iteration will continue until the end event is reached,
+consuming all of the data.
+
+```js
+const mp = new Minipass({ encoding: 'utf8' })
+
+// some source of some data
+let i = 5
+const inter = setInterval(() => {
+  if (i --> 0)
+    mp.write(Buffer.from('foo\n', 'utf8'))
+  else {
+    mp.end()
+    clearInterval(inter)
+  }
+}, 100)
+
+// consume the data with asynchronous iteration
+async function consume () {
+  for await (let chunk of mp) {
+    console.log(chunk)
+  }
+  return 'ok'
+}
+
+consume().then(res => console.log(res))
+// logs `foo\n` 5 times, and then `ok`
+```
diff --git a/legacy-libs/grpc/node_modules/minipass/index.js b/legacy-libs/grpc/node_modules/minipass/index.js
new file mode 100644 (file)
index 0000000..de472c3
--- /dev/null
@@ -0,0 +1,375 @@
+'use strict'
+const EE = require('events')
+const Yallist = require('yallist')
+const EOF = Symbol('EOF')
+const MAYBE_EMIT_END = Symbol('maybeEmitEnd')
+const EMITTED_END = Symbol('emittedEnd')
+const CLOSED = Symbol('closed')
+const READ = Symbol('read')
+const FLUSH = Symbol('flush')
+const doIter = process.env._MP_NO_ITERATOR_SYMBOLS_  !== '1'
+const ASYNCITERATOR = doIter && Symbol.asyncIterator || Symbol('asyncIterator not implemented')
+const ITERATOR = doIter && Symbol.iterator || Symbol('iterator not implemented')
+const FLUSHCHUNK = Symbol('flushChunk')
+const SD = require('string_decoder').StringDecoder
+const ENCODING = Symbol('encoding')
+const DECODER = Symbol('decoder')
+const FLOWING = Symbol('flowing')
+const RESUME = Symbol('resume')
+const BUFFERLENGTH = Symbol('bufferLength')
+const BUFFERPUSH = Symbol('bufferPush')
+const BUFFERSHIFT = Symbol('bufferShift')
+const OBJECTMODE = Symbol('objectMode')
+
+// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from
+// or Buffer.alloc, and Buffer in node 10 deprecated the ctor.
+// .M, this is fine .\^/M..
+let B = Buffer
+/* istanbul ignore next */
+if (!B.alloc) {
+  B = require('safe-buffer').Buffer
+}
+
+module.exports = class MiniPass extends EE {
+  constructor (options) {
+    super()
+    this[FLOWING] = false
+    this.pipes = new Yallist()
+    this.buffer = new Yallist()
+    this[OBJECTMODE] = options && options.objectMode || false
+    if (this[OBJECTMODE])
+      this[ENCODING] = null
+    else
+      this[ENCODING] = options && options.encoding || null
+    if (this[ENCODING] === 'buffer')
+      this[ENCODING] = null
+    this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null
+    this[EOF] = false
+    this[EMITTED_END] = false
+    this[CLOSED] = false
+    this.writable = true
+    this.readable = true
+    this[BUFFERLENGTH] = 0
+  }
+
+  get bufferLength () { return this[BUFFERLENGTH] }
+
+  get encoding () { return this[ENCODING] }
+  set encoding (enc) {
+    if (this[OBJECTMODE])
+      throw new Error('cannot set encoding in objectMode')
+
+    if (this[ENCODING] && enc !== this[ENCODING] &&
+        (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH]))
+      throw new Error('cannot change encoding')
+
+    if (this[ENCODING] !== enc) {
+      this[DECODER] = enc ? new SD(enc) : null
+      if (this.buffer.length)
+        this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk))
+    }
+
+    this[ENCODING] = enc
+  }
+
+  setEncoding (enc) {
+    this.encoding = enc
+  }
+
+  write (chunk, encoding, cb) {
+    if (this[EOF])
+      throw new Error('write after end')
+
+    if (typeof encoding === 'function')
+      cb = encoding, encoding = 'utf8'
+
+    if (!encoding)
+      encoding = 'utf8'
+
+    // fast-path writing strings of same encoding to a stream with
+    // an empty buffer, skipping the buffer/decoder dance
+    if (typeof chunk === 'string' && !this[OBJECTMODE] &&
+        // unless it is a string already ready for us to use
+        !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {
+      chunk = B.from(chunk, encoding)
+    }
+
+    if (B.isBuffer(chunk) && this[ENCODING])
+      chunk = this[DECODER].write(chunk)
+
+    try {
+      return this.flowing
+        ? (this.emit('data', chunk), this.flowing)
+        : (this[BUFFERPUSH](chunk), false)
+    } finally {
+      this.emit('readable')
+      if (cb)
+        cb()
+    }
+  }
+
+  read (n) {
+    try {
+      if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH])
+        return null
+
+      if (this[OBJECTMODE])
+        n = null
+
+      if (this.buffer.length > 1 && !this[OBJECTMODE]) {
+        if (this.encoding)
+          this.buffer = new Yallist([
+            Array.from(this.buffer).join('')
+          ])
+        else
+          this.buffer = new Yallist([
+            B.concat(Array.from(this.buffer), this[BUFFERLENGTH])
+          ])
+      }
+
+      return this[READ](n || null, this.buffer.head.value)
+    } finally {
+      this[MAYBE_EMIT_END]()
+    }
+  }
+
+  [READ] (n, chunk) {
+    if (n === chunk.length || n === null)
+      this[BUFFERSHIFT]()
+    else {
+      this.buffer.head.value = chunk.slice(n)
+      chunk = chunk.slice(0, n)
+      this[BUFFERLENGTH] -= n
+    }
+
+    this.emit('data', chunk)
+
+    if (!this.buffer.length && !this[EOF])
+      this.emit('drain')
+
+    return chunk
+  }
+
+  end (chunk, encoding, cb) {
+    if (typeof chunk === 'function')
+      cb = chunk, chunk = null
+    if (typeof encoding === 'function')
+      cb = encoding, encoding = 'utf8'
+    if (chunk)
+      this.write(chunk, encoding)
+    if (cb)
+      this.once('end', cb)
+    this[EOF] = true
+    this.writable = false
+    if (this.flowing)
+      this[MAYBE_EMIT_END]()
+  }
+
+  // don't let the internal resume be overwritten
+  [RESUME] () {
+    this[FLOWING] = true
+    this.emit('resume')
+    if (this.buffer.length)
+      this[FLUSH]()
+    else if (this[EOF])
+      this[MAYBE_EMIT_END]()
+    else
+      this.emit('drain')
+  }
+
+  resume () {
+    return this[RESUME]()
+  }
+
+  pause () {
+    this[FLOWING] = false
+  }
+
+  get flowing () {
+    return this[FLOWING]
+  }
+
+  [BUFFERPUSH] (chunk) {
+    if (this[OBJECTMODE])
+      this[BUFFERLENGTH] += 1
+    else
+      this[BUFFERLENGTH] += chunk.length
+    return this.buffer.push(chunk)
+  }
+
+  [BUFFERSHIFT] () {
+    if (this.buffer.length) {
+      if (this[OBJECTMODE])
+        this[BUFFERLENGTH] -= 1
+      else
+        this[BUFFERLENGTH] -= this.buffer.head.value.length
+    }
+    return this.buffer.shift()
+  }
+
+  [FLUSH] () {
+    do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()))
+
+    if (!this.buffer.length && !this[EOF])
+      this.emit('drain')
+  }
+
+  [FLUSHCHUNK] (chunk) {
+    return chunk ? (this.emit('data', chunk), this.flowing) : false
+  }
+
+  pipe (dest, opts) {
+    if (dest === process.stdout || dest === process.stderr)
+      (opts = opts || {}).end = false
+    const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() }
+    this.pipes.push(p)
+
+    dest.on('drain', p.ondrain)
+    this[RESUME]()
+    return dest
+  }
+
+  addListener (ev, fn) {
+    return this.on(ev, fn)
+  }
+
+  on (ev, fn) {
+    try {
+      return super.on(ev, fn)
+    } finally {
+      if (ev === 'data' && !this.pipes.length && !this.flowing)
+        this[RESUME]()
+      else if (ev === 'end' && this[EMITTED_END]) {
+        super.emit('end')
+        this.removeAllListeners('end')
+      }
+    }
+  }
+
+  get emittedEnd () {
+    return this[EMITTED_END]
+  }
+
+  [MAYBE_EMIT_END] () {
+    if (!this[EMITTED_END] && this.buffer.length === 0 && this[EOF]) {
+      this.emit('end')
+      this.emit('prefinish')
+      this.emit('finish')
+      if (this[CLOSED])
+        this.emit('close')
+    }
+  }
+
+  emit (ev, data) {
+    if (ev === 'data') {
+      if (!data)
+        return
+
+      if (this.pipes.length)
+        this.pipes.forEach(p => p.dest.write(data) || this.pause())
+    } else if (ev === 'end') {
+      if (this[EMITTED_END] === true)
+        return
+
+      this[EMITTED_END] = true
+      this.readable = false
+
+      if (this[DECODER]) {
+        data = this[DECODER].end()
+        if (data) {
+          this.pipes.forEach(p => p.dest.write(data))
+          super.emit('data', data)
+        }
+      }
+
+      this.pipes.forEach(p => {
+        p.dest.removeListener('drain', p.ondrain)
+        if (!p.opts || p.opts.end !== false)
+          p.dest.end()
+      })
+    } else if (ev === 'close') {
+      this[CLOSED] = true
+      // don't emit close before 'end' and 'finish'
+      if (!this[EMITTED_END])
+        return
+    }
+
+    const args = new Array(arguments.length)
+    args[0] = ev
+    args[1] = data
+    if (arguments.length > 2) {
+      for (let i = 2; i < arguments.length; i++) {
+        args[i] = arguments[i]
+      }
+    }
+
+    try {
+      return super.emit.apply(this, args)
+    } finally {
+      if (ev !== 'end')
+        this[MAYBE_EMIT_END]()
+      else
+        this.removeAllListeners('end')
+    }
+  }
+
+  // const all = await stream.collect()
+  collect () {
+    return new Promise((resolve, reject) => {
+      const buf = []
+      this.on('data', c => buf.push(c))
+      this.on('end', () => resolve(buf))
+      this.on('error', reject)
+    })
+  }
+
+  // for await (let chunk of stream)
+  [ASYNCITERATOR] () {
+    const next = () => {
+      const res = this.read()
+      if (res !== null)
+        return Promise.resolve({ done: false, value: res })
+
+      if (this[EOF])
+        return Promise.resolve({ done: true })
+
+      let resolve = null
+      let reject = null
+      const onerr = er => {
+        this.removeListener('data', ondata)
+        this.removeListener('end', onend)
+        reject(er)
+      }
+      const ondata = value => {
+        this.removeListener('error', onerr)
+        this.removeListener('end', onend)
+        this.pause()
+        resolve({ value: value, done: !!this[EOF] })
+      }
+      const onend = () => {
+        this.removeListener('error', onerr)
+        this.removeListener('data', ondata)
+        resolve({ done: true })
+      }
+      return new Promise((res, rej) => {
+        reject = rej
+        resolve = res
+        this.once('error', onerr)
+        this.once('end', onend)
+        this.once('data', ondata)
+      })
+    }
+
+    return { next }
+  }
+
+  // for (let chunk of stream)
+  [ITERATOR] () {
+    const next = () => {
+      const value = this.read()
+      const done = value === null
+      return { value, done }
+    }
+    return { next }
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/minipass/package.json b/legacy-libs/grpc/node_modules/minipass/package.json
new file mode 100644 (file)
index 0000000..9b68cd6
--- /dev/null
@@ -0,0 +1,73 @@
+{
+  "_from": "minipass@^2.3.4",
+  "_id": "minipass@2.3.5",
+  "_inBundle": false,
+  "_integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
+  "_location": "/grpc/minipass",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "minipass@^2.3.4",
+    "name": "minipass",
+    "escapedName": "minipass",
+    "rawSpec": "^2.3.4",
+    "saveSpec": null,
+    "fetchSpec": "^2.3.4"
+  },
+  "_requiredBy": [
+    "/grpc/fs-minipass",
+    "/grpc/minizlib",
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz",
+  "_shasum": "cacebe492022497f656b0f0f51e2682a9ed2d848",
+  "_shrinkwrap": null,
+  "_spec": "minipass@^2.3.4",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/tar",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/minipass/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "safe-buffer": "^5.1.2",
+    "yallist": "^3.0.0"
+  },
+  "deprecated": false,
+  "description": "minimal implementation of a PassThrough stream",
+  "devDependencies": {
+    "end-of-stream": "^1.4.0",
+    "tap": "^12.0.1",
+    "through2": "^2.0.3"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/isaacs/minipass#readme",
+  "keywords": [
+    "passthrough",
+    "stream"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "minipass",
+  "optionalDependencies": {},
+  "readme": "# minipass\n\nA _very_ minimal implementation of a [PassThrough\nstream](https://nodejs.org/api/stream.html#stream_class_stream_passthrough)\n\n[It's very\nfast](https://docs.google.com/spreadsheets/d/1oObKSrVwLX_7Ut4Z6g3fZW-AX1j1-k6w-cDsrkaSbHM/edit#gid=0)\nfor objects, strings, and buffers.\n\nSupports pipe()ing (including multi-pipe() and backpressure\ntransmission), buffering data until either a `data` event handler or\n`pipe()` is added (so you don't lose the first chunk), and most other\ncases where PassThrough is a good idea.\n\nThere is a `read()` method, but it's much more efficient to consume\ndata from this stream via `'data'` events or by calling `pipe()` into\nsome other stream.  Calling `read()` requires the buffer to be\nflattened in some cases, which requires copying memory.\n\nThere is also no `unpipe()` method.  Once you start piping, there is\nno stopping it!\n\nIf you set `objectMode: true` in the options, then whatever is written\nwill be emitted.  Otherwise, it'll do a minimal amount of Buffer\ncopying to ensure proper Streams semantics when `read(n)` is called.\n\nThis is not a `through` or `through2` stream.  It doesn't transform\nthe data, it just passes it right through.  If you want to transform\nthe data, extend the class, and override the `write()` method.  Once\nyou're done transforming the data however you want, call\n`super.write()` with the transform output.\n\nFor an example of a stream that extends MiniPass to provide transform\ncapabilities, check out [minizlib](http://npm.im/minizlib).\n\n## USAGE\n\n```js\nconst MiniPass = require('minipass')\nconst mp = new MiniPass(options) // optional: { encoding }\nmp.write('foo')\nmp.pipe(someOtherStream)\nmp.end('bar')\n```\n\n### collecting\n\n```js\nmp.collect().then(all => {\n  // all is an array of all the data emitted\n  // encoding is supported in this case, so\n  // so the result will be a collection of strings if\n  // an encoding is specified, or buffers/objects if not.\n  //\n  // In an async function, you may do\n  // const data = await stream.collect()\n})\n```\n\n### iteration\n\nYou can iterate over streams synchronously or asynchronously in\nplatforms that support it.\n\nSynchronous iteration will end when the currently available data is\nconsumed, even if the `end` event has not been reached.  In string and\nbuffer mode, the data is concatenated, so unless multiple writes are\noccurring in the same tick as the `read()`, sync iteration loops will\ngenerally only have a single iteration.\n\nTo consume chunks in this way exactly as they have been written, with\nno flattening, create the stream with the `{ objectMode: true }`\noption.\n\n```js\nconst mp = new Minipass({ objectMode: true })\nmp.write('a')\nmp.write('b')\nfor (let letter of mp) {\n  console.log(letter) // a, b\n}\nmp.write('c')\nmp.write('d')\nfor (let letter of mp) {\n  console.log(letter) // c, d\n}\nmp.write('e')\nmp.end()\nfor (let letter of mp) {\n  console.log(letter) // e\n}\nfor (let letter of mp) {\n  console.log(letter) // nothing\n}\n```\n\nAsynchronous iteration will continue until the end event is reached,\nconsuming all of the data.\n\n```js\nconst mp = new Minipass({ encoding: 'utf8' })\n\n// some source of some data\nlet i = 5\nconst inter = setInterval(() => {\n  if (i --> 0)\n    mp.write(Buffer.from('foo\\n', 'utf8'))\n  else {\n    mp.end()\n    clearInterval(inter)\n  }\n}, 100)\n\n// consume the data with asynchronous iteration\nasync function consume () {\n  for await (let chunk of mp) {\n    console.log(chunk)\n  }\n  return 'ok'\n}\n\nconsume().then(res => console.log(res))\n// logs `foo\\n` 5 times, and then `ok`\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/minipass.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --100"
+  },
+  "version": "2.3.5"
+}
diff --git a/legacy-libs/grpc/node_modules/minizlib/LICENSE b/legacy-libs/grpc/node_modules/minizlib/LICENSE
new file mode 100644 (file)
index 0000000..ffce738
--- /dev/null
@@ -0,0 +1,26 @@
+Minizlib was created by Isaac Z. Schlueter.
+It is a derivative work of the Node.js project.
+
+"""
+Copyright Isaac Z. Schlueter and Contributors
+Copyright Node.js contributors. All rights reserved.
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+"""
diff --git a/legacy-libs/grpc/node_modules/minizlib/README.md b/legacy-libs/grpc/node_modules/minizlib/README.md
new file mode 100644 (file)
index 0000000..2b58554
--- /dev/null
@@ -0,0 +1,44 @@
+# minizlib
+
+A tiny fast zlib stream built on [minipass](http://npm.im/minipass)
+and Node.js's zlib binding.
+
+This module was created to serve the needs of
+[node-tar](http://npm.im/tar) v2.  If your needs are different, then
+it may not be for you.
+
+## How does this differ from the streams in `require('zlib')`?
+
+First, there are no convenience methods to compress or decompress a
+buffer.  If you want those, use the built-in `zlib` module.  This is
+only streams.
+
+This module compresses and decompresses the data as fast as you feed
+it in.  It is synchronous, and runs on the main process thread.  Zlib
+operations can be high CPU, but they're very fast, and doing it this
+way means much less bookkeeping and artificial deferral.
+
+Node's built in zlib streams are built on top of `stream.Transform`.
+They do the maximally safe thing with respect to consistent
+asynchrony, buffering, and backpressure.
+
+This module _does_ support backpressure, and will buffer output chunks
+that are not consumed, but is less of a mediator between the input and
+output.  There is no high or low watermarks, no state objects, and so
+artificial async deferrals.  It will not protect you from Zalgo.
+
+If you write, data will be emitted right away.  If you write
+everything synchronously in one tick, and you are listening to the
+`data` event to consume it, then it'll all be emitted right away in
+that same tick.  If you want data to be emitted in the next tick, then
+write it in the next tick.
+
+It is thus the responsibility of the reader and writer to manage their
+own consumption and process execution flow.
+
+The goal is to compress and decompress as fast as possible, even for
+files that are too large to store all in one buffer.
+
+The API is very similar to the built-in zlib module.  There are
+classes that you instantiate with `new` and they are streams that can
+be piped together.
diff --git a/legacy-libs/grpc/node_modules/minizlib/constants.js b/legacy-libs/grpc/node_modules/minizlib/constants.js
new file mode 100644 (file)
index 0000000..4edffde
--- /dev/null
@@ -0,0 +1,46 @@
+module.exports = Object.freeze({
+  Z_NO_FLUSH: 0,
+  Z_PARTIAL_FLUSH: 1,
+  Z_SYNC_FLUSH: 2,
+  Z_FULL_FLUSH: 3,
+  Z_FINISH: 4,
+  Z_BLOCK: 5,
+  Z_OK: 0,
+  Z_STREAM_END: 1,
+  Z_NEED_DICT: 2,
+  Z_ERRNO: -1,
+  Z_STREAM_ERROR: -2,
+  Z_DATA_ERROR: -3,
+  Z_MEM_ERROR: -4,
+  Z_BUF_ERROR: -5,
+  Z_VERSION_ERROR: -6,
+  Z_NO_COMPRESSION: 0,
+  Z_BEST_SPEED: 1,
+  Z_BEST_COMPRESSION: 9,
+  Z_DEFAULT_COMPRESSION: -1,
+  Z_FILTERED: 1,
+  Z_HUFFMAN_ONLY: 2,
+  Z_RLE: 3,
+  Z_FIXED: 4,
+  Z_DEFAULT_STRATEGY: 0,
+  ZLIB_VERNUM: 4736,
+  DEFLATE: 1,
+  INFLATE: 2,
+  GZIP: 3,
+  GUNZIP: 4,
+  DEFLATERAW: 5,
+  INFLATERAW: 6,
+  UNZIP: 7,
+  Z_MIN_WINDOWBITS: 8,
+  Z_MAX_WINDOWBITS: 15,
+  Z_DEFAULT_WINDOWBITS: 15,
+  Z_MIN_CHUNK: 64,
+  Z_MAX_CHUNK: Infinity,
+  Z_DEFAULT_CHUNK: 16384,
+  Z_MIN_MEMLEVEL: 1,
+  Z_MAX_MEMLEVEL: 9,
+  Z_DEFAULT_MEMLEVEL: 8,
+  Z_MIN_LEVEL: -1,
+  Z_MAX_LEVEL: 9,
+  Z_DEFAULT_LEVEL: -1
+})
diff --git a/legacy-libs/grpc/node_modules/minizlib/index.js b/legacy-libs/grpc/node_modules/minizlib/index.js
new file mode 100644 (file)
index 0000000..df48696
--- /dev/null
@@ -0,0 +1,335 @@
+'use strict'
+
+const assert = require('assert')
+const Buffer = require('buffer').Buffer
+const realZlib = require('zlib')
+
+const constants = exports.constants = require('./constants.js')
+const MiniPass = require('minipass')
+
+const OriginalBufferConcat = Buffer.concat
+
+class ZlibError extends Error {
+  constructor (msg, errno) {
+    super('zlib: ' + msg)
+    this.errno = errno
+    this.code = codes.get(errno)
+  }
+
+  get name () {
+    return 'ZlibError'
+  }
+}
+
+// translation table for return codes.
+const codes = new Map([
+  [constants.Z_OK, 'Z_OK'],
+  [constants.Z_STREAM_END, 'Z_STREAM_END'],
+  [constants.Z_NEED_DICT, 'Z_NEED_DICT'],
+  [constants.Z_ERRNO, 'Z_ERRNO'],
+  [constants.Z_STREAM_ERROR, 'Z_STREAM_ERROR'],
+  [constants.Z_DATA_ERROR, 'Z_DATA_ERROR'],
+  [constants.Z_MEM_ERROR, 'Z_MEM_ERROR'],
+  [constants.Z_BUF_ERROR, 'Z_BUF_ERROR'],
+  [constants.Z_VERSION_ERROR, 'Z_VERSION_ERROR']
+])
+
+const validFlushFlags = new Set([
+  constants.Z_NO_FLUSH,
+  constants.Z_PARTIAL_FLUSH,
+  constants.Z_SYNC_FLUSH,
+  constants.Z_FULL_FLUSH,
+  constants.Z_FINISH,
+  constants.Z_BLOCK
+])
+
+const strategies = new Set([
+  constants.Z_FILTERED,
+  constants.Z_HUFFMAN_ONLY,
+  constants.Z_RLE,
+  constants.Z_FIXED,
+  constants.Z_DEFAULT_STRATEGY
+])
+
+// the Zlib class they all inherit from
+// This thing manages the queue of requests, and returns
+// true or false if there is anything in the queue when
+// you call the .write() method.
+const _opts = Symbol('opts')
+const _flushFlag = Symbol('flushFlag')
+const _finishFlush = Symbol('finishFlush')
+const _handle = Symbol('handle')
+const _onError = Symbol('onError')
+const _level = Symbol('level')
+const _strategy = Symbol('strategy')
+const _ended = Symbol('ended')
+
+class Zlib extends MiniPass {
+  constructor (opts, mode) {
+    super(opts)
+    this[_ended] = false
+    this[_opts] = opts = opts || {}
+    if (opts.flush && !validFlushFlags.has(opts.flush)) {
+      throw new TypeError('Invalid flush flag: ' + opts.flush)
+    }
+    if (opts.finishFlush && !validFlushFlags.has(opts.finishFlush)) {
+      throw new TypeError('Invalid flush flag: ' + opts.finishFlush)
+    }
+
+    this[_flushFlag] = opts.flush || constants.Z_NO_FLUSH
+    this[_finishFlush] = typeof opts.finishFlush !== 'undefined' ?
+      opts.finishFlush : constants.Z_FINISH
+
+    if (opts.chunkSize) {
+      if (opts.chunkSize < constants.Z_MIN_CHUNK) {
+        throw new RangeError('Invalid chunk size: ' + opts.chunkSize)
+      }
+    }
+
+    if (opts.windowBits) {
+      if (opts.windowBits < constants.Z_MIN_WINDOWBITS ||
+          opts.windowBits > constants.Z_MAX_WINDOWBITS) {
+        throw new RangeError('Invalid windowBits: ' + opts.windowBits)
+      }
+    }
+
+    if (opts.level) {
+      if (opts.level < constants.Z_MIN_LEVEL ||
+          opts.level > constants.Z_MAX_LEVEL) {
+        throw new RangeError('Invalid compression level: ' + opts.level)
+      }
+    }
+
+    if (opts.memLevel) {
+      if (opts.memLevel < constants.Z_MIN_MEMLEVEL ||
+          opts.memLevel > constants.Z_MAX_MEMLEVEL) {
+        throw new RangeError('Invalid memLevel: ' + opts.memLevel)
+      }
+    }
+
+    if (opts.strategy && !(strategies.has(opts.strategy)))
+      throw new TypeError('Invalid strategy: ' + opts.strategy)
+
+    if (opts.dictionary) {
+      if (!(opts.dictionary instanceof Buffer)) {
+        throw new TypeError('Invalid dictionary: it should be a Buffer instance')
+      }
+    }
+
+    this[_handle] = new realZlib[mode](opts)
+
+    this[_onError] = (err) => {
+      // there is no way to cleanly recover.
+      // continuing only obscures problems.
+      this.close()
+
+      const error = new ZlibError(err.message, err.errno)
+      this.emit('error', error)
+    }
+    this[_handle].on('error', this[_onError])
+
+    const level = typeof opts.level === 'number' ? opts.level
+                : constants.Z_DEFAULT_COMPRESSION
+
+    var strategy = typeof opts.strategy === 'number' ? opts.strategy
+                 : constants.Z_DEFAULT_STRATEGY
+
+    // API changed in node v9
+    /* istanbul ignore next */
+
+    this[_level] = level
+    this[_strategy] = strategy
+
+    this.once('end', this.close)
+  }
+
+  close () {
+    if (this[_handle]) {
+      this[_handle].close()
+      this[_handle] = null
+      this.emit('close')
+    }
+  }
+
+  params (level, strategy) {
+    if (!this[_handle])
+      throw new Error('cannot switch params when binding is closed')
+
+    // no way to test this without also not supporting params at all
+    /* istanbul ignore if */
+    if (!this[_handle].params)
+      throw new Error('not supported in this implementation')
+
+    if (level < constants.Z_MIN_LEVEL ||
+        level > constants.Z_MAX_LEVEL) {
+      throw new RangeError('Invalid compression level: ' + level)
+    }
+
+    if (!(strategies.has(strategy)))
+      throw new TypeError('Invalid strategy: ' + strategy)
+
+    if (this[_level] !== level || this[_strategy] !== strategy) {
+      this.flush(constants.Z_SYNC_FLUSH)
+      assert(this[_handle], 'zlib binding closed')
+      // .params() calls .flush(), but the latter is always async in the
+      // core zlib. We override .flush() temporarily to intercept that and
+      // flush synchronously.
+      const origFlush = this[_handle].flush
+      this[_handle].flush = (flushFlag, cb) => {
+        this[_handle].flush = origFlush
+        this.flush(flushFlag)
+        cb()
+      }
+      this[_handle].params(level, strategy)
+      /* istanbul ignore else */
+      if (this[_handle]) {
+        this[_level] = level
+        this[_strategy] = strategy
+      }
+    }
+  }
+
+  reset () {
+    assert(this[_handle], 'zlib binding closed')
+    return this[_handle].reset()
+  }
+
+  flush (kind) {
+    if (kind === undefined)
+      kind = constants.Z_FULL_FLUSH
+
+    if (this.ended)
+      return
+
+    const flushFlag = this[_flushFlag]
+    this[_flushFlag] = kind
+    this.write(Buffer.alloc(0))
+    this[_flushFlag] = flushFlag
+  }
+
+  end (chunk, encoding, cb) {
+    if (chunk)
+      this.write(chunk, encoding)
+    this.flush(this[_finishFlush])
+    this[_ended] = true
+    return super.end(null, null, cb)
+  }
+
+  get ended () {
+    return this[_ended]
+  }
+
+  write (chunk, encoding, cb) {
+    // process the chunk using the sync process
+    // then super.write() all the outputted chunks
+    if (typeof encoding === 'function')
+      cb = encoding, encoding = 'utf8'
+
+    if (typeof chunk === 'string')
+      chunk = Buffer.from(chunk, encoding)
+
+    assert(this[_handle], 'zlib binding closed')
+
+    // _processChunk tries to .close() the native handle after it's done, so we
+    // intercept that by temporarily making it a no-op.
+    const nativeHandle = this[_handle]._handle
+    const originalNativeClose = nativeHandle.close
+    nativeHandle.close = () => {}
+    const originalClose = this[_handle].close
+    this[_handle].close = () => {}
+    // It also calls `Buffer.concat()` at the end, which may be convenient
+    // for some, but which we are not interested in as it slows us down.
+    Buffer.concat = (args) => args
+    let result
+    try {
+      result = this[_handle]._processChunk(chunk, this[_flushFlag])
+    } catch (err) {
+      this[_onError](err)
+    } finally {
+      Buffer.concat = OriginalBufferConcat
+      if (this[_handle]) {
+        // Core zlib resets `_handle` to null after attempting to close the
+        // native handle. Our no-op handler prevented actual closure, but we
+        // need to restore the `._handle` property.
+        this[_handle]._handle = nativeHandle
+        nativeHandle.close = originalNativeClose
+        this[_handle].close = originalClose
+        // `_processChunk()` adds an 'error' listener. If we don't remove it
+        // after each call, these handlers start piling up.
+        this[_handle].removeAllListeners('error')
+      }
+    }
+
+    let writeReturn
+    if (result) {
+      if (Array.isArray(result) && result.length > 0) {
+        // The first buffer is always `handle._outBuffer`, which would be
+        // re-used for later invocations; so, we always have to copy that one.
+        writeReturn = super.write(Buffer.from(result[0]))
+        for (let i = 1; i < result.length; i++) {
+          writeReturn = super.write(result[i])
+        }
+      } else {
+        writeReturn = super.write(Buffer.from(result))
+      }
+    }
+
+    if (cb)
+      cb()
+    return writeReturn
+  }
+}
+
+// minimal 2-byte header
+class Deflate extends Zlib {
+  constructor (opts) {
+    super(opts, 'Deflate')
+  }
+}
+
+class Inflate extends Zlib {
+  constructor (opts) {
+    super(opts, 'Inflate')
+  }
+}
+
+// gzip - bigger header, same deflate compression
+class Gzip extends Zlib {
+  constructor (opts) {
+    super(opts, 'Gzip')
+  }
+}
+
+class Gunzip extends Zlib {
+  constructor (opts) {
+    super(opts, 'Gunzip')
+  }
+}
+
+// raw - no header
+class DeflateRaw extends Zlib {
+  constructor (opts) {
+    super(opts, 'DeflateRaw')
+  }
+}
+
+class InflateRaw extends Zlib {
+  constructor (opts) {
+    super(opts, 'InflateRaw')
+  }
+}
+
+// auto-detect header.
+class Unzip extends Zlib {
+  constructor (opts) {
+    super(opts, 'Unzip')
+  }
+}
+
+exports.Deflate = Deflate
+exports.Inflate = Inflate
+exports.Gzip = Gzip
+exports.Gunzip = Gunzip
+exports.DeflateRaw = DeflateRaw
+exports.InflateRaw = InflateRaw
+exports.Unzip = Unzip
diff --git a/legacy-libs/grpc/node_modules/minizlib/package.json b/legacy-libs/grpc/node_modules/minizlib/package.json
new file mode 100644 (file)
index 0000000..f5919ae
--- /dev/null
@@ -0,0 +1,75 @@
+{
+  "_from": "minizlib@^1.1.1",
+  "_id": "minizlib@1.2.1",
+  "_inBundle": false,
+  "_integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
+  "_location": "/grpc/minizlib",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "minizlib@^1.1.1",
+    "name": "minizlib",
+    "escapedName": "minizlib",
+    "rawSpec": "^1.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^1.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz",
+  "_shasum": "dd27ea6136243c7c880684e8672bb3a45fd9b614",
+  "_shrinkwrap": null,
+  "_spec": "minizlib@^1.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/tar",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/minizlib/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "minipass": "^2.2.1"
+  },
+  "deprecated": false,
+  "description": "A small fast zlib stream built on [minipass](http://npm.im/minipass) and Node.js's zlib binding.",
+  "devDependencies": {
+    "tap": "^12.0.1"
+  },
+  "files": [
+    "index.js",
+    "constants.js"
+  ],
+  "homepage": "https://github.com/isaacs/minizlib#readme",
+  "keywords": [
+    "zlib",
+    "gzip",
+    "gunzip",
+    "deflate",
+    "inflate",
+    "compression",
+    "zip",
+    "unzip"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "minizlib",
+  "optionalDependencies": {},
+  "readme": "# minizlib\n\nA tiny fast zlib stream built on [minipass](http://npm.im/minipass)\nand Node.js's zlib binding.\n\nThis module was created to serve the needs of\n[node-tar](http://npm.im/tar) v2.  If your needs are different, then\nit may not be for you.\n\n## How does this differ from the streams in `require('zlib')`?\n\nFirst, there are no convenience methods to compress or decompress a\nbuffer.  If you want those, use the built-in `zlib` module.  This is\nonly streams.\n\nThis module compresses and decompresses the data as fast as you feed\nit in.  It is synchronous, and runs on the main process thread.  Zlib\noperations can be high CPU, but they're very fast, and doing it this\nway means much less bookkeeping and artificial deferral.\n\nNode's built in zlib streams are built on top of `stream.Transform`.\nThey do the maximally safe thing with respect to consistent\nasynchrony, buffering, and backpressure.\n\nThis module _does_ support backpressure, and will buffer output chunks\nthat are not consumed, but is less of a mediator between the input and\noutput.  There is no high or low watermarks, no state objects, and so\nartificial async deferrals.  It will not protect you from Zalgo.\n\nIf you write, data will be emitted right away.  If you write\neverything synchronously in one tick, and you are listening to the\n`data` event to consume it, then it'll all be emitted right away in\nthat same tick.  If you want data to be emitted in the next tick, then\nwrite it in the next tick.\n\nIt is thus the responsibility of the reader and writer to manage their\nown consumption and process execution flow.\n\nThe goal is to compress and decompress as fast as possible, even for\nfiles that are too large to store all in one buffer.\n\nThe API is very similar to the built-in zlib module.  There are\nclasses that you instantiate with `new` and they are streams that can\nbe piped together.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/minizlib.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --100 -J"
+  },
+  "version": "1.2.1"
+}
diff --git a/legacy-libs/grpc/node_modules/mkdirp/LICENSE b/legacy-libs/grpc/node_modules/mkdirp/LICENSE
new file mode 100644 (file)
index 0000000..432d1ae
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/mkdirp/bin/cmd.js b/legacy-libs/grpc/node_modules/mkdirp/bin/cmd.js
new file mode 100644 (file)
index 0000000..d95de15
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+
+var mkdirp = require('../');
+var minimist = require('minimist');
+var fs = require('fs');
+
+var argv = minimist(process.argv.slice(2), {
+    alias: { m: 'mode', h: 'help' },
+    string: [ 'mode' ]
+});
+if (argv.help) {
+    fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout);
+    return;
+}
+
+var paths = argv._.slice();
+var mode = argv.mode ? parseInt(argv.mode, 8) : undefined;
+
+(function next () {
+    if (paths.length === 0) return;
+    var p = paths.shift();
+    
+    if (mode === undefined) mkdirp(p, cb)
+    else mkdirp(p, mode, cb)
+    
+    function cb (err) {
+        if (err) {
+            console.error(err.message);
+            process.exit(1);
+        }
+        else next();
+    }
+})();
diff --git a/legacy-libs/grpc/node_modules/mkdirp/bin/usage.txt b/legacy-libs/grpc/node_modules/mkdirp/bin/usage.txt
new file mode 100644 (file)
index 0000000..f952aa2
--- /dev/null
@@ -0,0 +1,12 @@
+usage: mkdirp [DIR1,DIR2..] {OPTIONS}
+
+  Create each supplied directory including any necessary parent directories that
+  don't yet exist.
+  
+  If the directory already exists, do nothing.
+
+OPTIONS are:
+
+  -m, --mode   If a directory needs to be created, set the mode as an octal
+               permission string.
+
diff --git a/legacy-libs/grpc/node_modules/mkdirp/examples/pow.js b/legacy-libs/grpc/node_modules/mkdirp/examples/pow.js
new file mode 100644 (file)
index 0000000..e692421
--- /dev/null
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/index.js b/legacy-libs/grpc/node_modules/mkdirp/index.js
new file mode 100644 (file)
index 0000000..6ce241b
--- /dev/null
@@ -0,0 +1,98 @@
+var path = require('path');
+var fs = require('fs');
+var _0777 = parseInt('0777', 8);
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, opts, f, made) {
+    if (typeof opts === 'function') {
+        f = opts;
+        opts = {};
+    }
+    else if (!opts || typeof opts !== 'object') {
+        opts = { mode: opts };
+    }
+    
+    var mode = opts.mode;
+    var xfs = opts.fs || fs;
+    
+    if (mode === undefined) {
+        mode = _0777 & (~process.umask());
+    }
+    if (!made) made = null;
+    
+    var cb = f || function () {};
+    p = path.resolve(p);
+    
+    xfs.mkdir(p, mode, function (er) {
+        if (!er) {
+            made = made || p;
+            return cb(null, made);
+        }
+        switch (er.code) {
+            case 'ENOENT':
+                mkdirP(path.dirname(p), opts, function (er, made) {
+                    if (er) cb(er, made);
+                    else mkdirP(p, opts, cb, made);
+                });
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                xfs.stat(p, function (er2, stat) {
+                    // if the stat fails, then that's super weird.
+                    // let the original error be the failure reason.
+                    if (er2 || !stat.isDirectory()) cb(er, made)
+                    else cb(null, made);
+                });
+                break;
+        }
+    });
+}
+
+mkdirP.sync = function sync (p, opts, made) {
+    if (!opts || typeof opts !== 'object') {
+        opts = { mode: opts };
+    }
+    
+    var mode = opts.mode;
+    var xfs = opts.fs || fs;
+    
+    if (mode === undefined) {
+        mode = _0777 & (~process.umask());
+    }
+    if (!made) made = null;
+
+    p = path.resolve(p);
+
+    try {
+        xfs.mkdirSync(p, mode);
+        made = made || p;
+    }
+    catch (err0) {
+        switch (err0.code) {
+            case 'ENOENT' :
+                made = sync(path.dirname(p), opts, made);
+                sync(p, opts, made);
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                var stat;
+                try {
+                    stat = xfs.statSync(p);
+                }
+                catch (err1) {
+                    throw err0;
+                }
+                if (!stat.isDirectory()) throw err0;
+                break;
+        }
+    }
+
+    return made;
+};
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/LICENSE b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/LICENSE
new file mode 100644 (file)
index 0000000..ee27ba4
--- /dev/null
@@ -0,0 +1,18 @@
+This software is released under the MIT license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/example/parse.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/example/parse.js
new file mode 100644 (file)
index 0000000..abff3e8
--- /dev/null
@@ -0,0 +1,2 @@
+var argv = require('../')(process.argv.slice(2));
+console.dir(argv);
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/index.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/index.js
new file mode 100644 (file)
index 0000000..584f551
--- /dev/null
@@ -0,0 +1,187 @@
+module.exports = function (args, opts) {
+    if (!opts) opts = {};
+    
+    var flags = { bools : {}, strings : {} };
+    
+    [].concat(opts['boolean']).filter(Boolean).forEach(function (key) {
+        flags.bools[key] = true;
+    });
+    
+    [].concat(opts.string).filter(Boolean).forEach(function (key) {
+        flags.strings[key] = true;
+    });
+    
+    var aliases = {};
+    Object.keys(opts.alias || {}).forEach(function (key) {
+        aliases[key] = [].concat(opts.alias[key]);
+        aliases[key].forEach(function (x) {
+            aliases[x] = [key].concat(aliases[key].filter(function (y) {
+                return x !== y;
+            }));
+        });
+    });
+    
+    var defaults = opts['default'] || {};
+    
+    var argv = { _ : [] };
+    Object.keys(flags.bools).forEach(function (key) {
+        setArg(key, defaults[key] === undefined ? false : defaults[key]);
+    });
+    
+    var notFlags = [];
+
+    if (args.indexOf('--') !== -1) {
+        notFlags = args.slice(args.indexOf('--')+1);
+        args = args.slice(0, args.indexOf('--'));
+    }
+
+    function setArg (key, val) {
+        var value = !flags.strings[key] && isNumber(val)
+            ? Number(val) : val
+        ;
+        setKey(argv, key.split('.'), value);
+        
+        (aliases[key] || []).forEach(function (x) {
+            setKey(argv, x.split('.'), value);
+        });
+    }
+    
+    for (var i = 0; i < args.length; i++) {
+        var arg = args[i];
+        
+        if (/^--.+=/.test(arg)) {
+            // Using [\s\S] instead of . because js doesn't support the
+            // 'dotall' regex modifier. See:
+            // http://stackoverflow.com/a/1068308/13216
+            var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
+            setArg(m[1], m[2]);
+        }
+        else if (/^--no-.+/.test(arg)) {
+            var key = arg.match(/^--no-(.+)/)[1];
+            setArg(key, false);
+        }
+        else if (/^--.+/.test(arg)) {
+            var key = arg.match(/^--(.+)/)[1];
+            var next = args[i + 1];
+            if (next !== undefined && !/^-/.test(next)
+            && !flags.bools[key]
+            && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
+                setArg(key, next);
+                i++;
+            }
+            else if (/^(true|false)$/.test(next)) {
+                setArg(key, next === 'true');
+                i++;
+            }
+            else {
+                setArg(key, flags.strings[key] ? '' : true);
+            }
+        }
+        else if (/^-[^-]+/.test(arg)) {
+            var letters = arg.slice(1,-1).split('');
+            
+            var broken = false;
+            for (var j = 0; j < letters.length; j++) {
+                var next = arg.slice(j+2);
+                
+                if (next === '-') {
+                    setArg(letters[j], next)
+                    continue;
+                }
+                
+                if (/[A-Za-z]/.test(letters[j])
+                && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
+                    setArg(letters[j], next);
+                    broken = true;
+                    break;
+                }
+                
+                if (letters[j+1] && letters[j+1].match(/\W/)) {
+                    setArg(letters[j], arg.slice(j+2));
+                    broken = true;
+                    break;
+                }
+                else {
+                    setArg(letters[j], flags.strings[letters[j]] ? '' : true);
+                }
+            }
+            
+            var key = arg.slice(-1)[0];
+            if (!broken && key !== '-') {
+                if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
+                && !flags.bools[key]
+                && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
+                    setArg(key, args[i+1]);
+                    i++;
+                }
+                else if (args[i+1] && /true|false/.test(args[i+1])) {
+                    setArg(key, args[i+1] === 'true');
+                    i++;
+                }
+                else {
+                    setArg(key, flags.strings[key] ? '' : true);
+                }
+            }
+        }
+        else {
+            argv._.push(
+                flags.strings['_'] || !isNumber(arg) ? arg : Number(arg)
+            );
+        }
+    }
+    
+    Object.keys(defaults).forEach(function (key) {
+        if (!hasKey(argv, key.split('.'))) {
+            setKey(argv, key.split('.'), defaults[key]);
+            
+            (aliases[key] || []).forEach(function (x) {
+                setKey(argv, x.split('.'), defaults[key]);
+            });
+        }
+    });
+    
+    notFlags.forEach(function(key) {
+        argv._.push(key);
+    });
+
+    return argv;
+};
+
+function hasKey (obj, keys) {
+    var o = obj;
+    keys.slice(0,-1).forEach(function (key) {
+        o = (o[key] || {});
+    });
+
+    var key = keys[keys.length - 1];
+    return key in o;
+}
+
+function setKey (obj, keys, value) {
+    var o = obj;
+    keys.slice(0,-1).forEach(function (key) {
+        if (o[key] === undefined) o[key] = {};
+        o = o[key];
+    });
+    
+    var key = keys[keys.length - 1];
+    if (o[key] === undefined || typeof o[key] === 'boolean') {
+        o[key] = value;
+    }
+    else if (Array.isArray(o[key])) {
+        o[key].push(value);
+    }
+    else {
+        o[key] = [ o[key], value ];
+    }
+}
+
+function isNumber (x) {
+    if (typeof x === 'number') return true;
+    if (/^0x[0-9a-f]+$/i.test(x)) return true;
+    return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
+}
+
+function longest (xs) {
+    return Math.max.apply(null, xs.map(function (x) { return x.length }));
+}
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/package.json b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/package.json
new file mode 100644 (file)
index 0000000..f59f73a
--- /dev/null
@@ -0,0 +1,79 @@
+{
+  "_args": [
+    [
+      "minimist@0.0.8",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "minimist@0.0.8",
+  "_id": "minimist@0.0.8",
+  "_inBundle": false,
+  "_integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
+  "_location": "/grpc/mkdirp/minimist",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "minimist@0.0.8",
+    "name": "minimist",
+    "escapedName": "minimist",
+    "rawSpec": "0.0.8",
+    "saveSpec": null,
+    "fetchSpec": "0.0.8"
+  },
+  "_requiredBy": [
+    "/grpc/mkdirp"
+  ],
+  "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
+  "_shrinkwrap": null,
+  "_spec": "0.0.8",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/minimist/issues"
+  },
+  "dependencies": {},
+  "description": "parse argument options",
+  "devDependencies": {
+    "tap": "~0.4.0",
+    "tape": "~1.0.4"
+  },
+  "homepage": "https://github.com/substack/minimist",
+  "keywords": [
+    "argv",
+    "getopt",
+    "parser",
+    "optimist"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "minimist",
+  "optionalDependencies": {},
+  "readme": "# minimist\n\nparse argument options\n\nThis module is the guts of optimist's argument parser without all the\nfanciful decoration.\n\n[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)\n\n[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)\n\n# example\n\n``` js\nvar argv = require('minimist')(process.argv.slice(2));\nconsole.dir(argv);\n```\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n  x: 3,\n  y: 4,\n  n: 5,\n  a: true,\n  b: true,\n  c: true,\n  beep: 'boop' }\n```\n\n# methods\n\n``` js\nvar parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a string or array of strings to always treat as booleans\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install minimist\n```\n\n# license\n\nMIT\n",
+  "readmeFilename": "readme.markdown",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/substack/minimist.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "testling": {
+    "files": "test/*.js",
+    "browsers": [
+      "ie/6..latest",
+      "ff/5",
+      "firefox/latest",
+      "chrome/10",
+      "chrome/latest",
+      "safari/5.1",
+      "safari/latest",
+      "opera/12"
+    ]
+  },
+  "version": "0.0.8"
+}
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/readme.markdown b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/readme.markdown
new file mode 100644 (file)
index 0000000..c256353
--- /dev/null
@@ -0,0 +1,73 @@
+# minimist
+
+parse argument options
+
+This module is the guts of optimist's argument parser without all the
+fanciful decoration.
+
+[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)
+
+[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)
+
+# example
+
+``` js
+var argv = require('minimist')(process.argv.slice(2));
+console.dir(argv);
+```
+
+```
+$ node example/parse.js -a beep -b boop
+{ _: [], a: 'beep', b: 'boop' }
+```
+
+```
+$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
+{ _: [ 'foo', 'bar', 'baz' ],
+  x: 3,
+  y: 4,
+  n: 5,
+  a: true,
+  b: true,
+  c: true,
+  beep: 'boop' }
+```
+
+# methods
+
+``` js
+var parseArgs = require('minimist')
+```
+
+## var argv = parseArgs(args, opts={})
+
+Return an argument object `argv` populated with the array arguments from `args`.
+
+`argv._` contains all the arguments that didn't have an option associated with
+them.
+
+Numeric-looking arguments will be returned as numbers unless `opts.string` or
+`opts.boolean` is set for that argument name.
+
+Any arguments after `'--'` will not be parsed and will end up in `argv._`.
+
+options can be:
+
+* `opts.string` - a string or array of strings argument names to always treat as
+strings
+* `opts.boolean` - a string or array of strings to always treat as booleans
+* `opts.alias` - an object mapping string names to strings or arrays of string
+argument names to use as aliases
+* `opts.default` - an object mapping string argument names to default values
+
+# install
+
+With [npm](https://npmjs.org) do:
+
+```
+npm install minimist
+```
+
+# license
+
+MIT
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/dash.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/dash.js
new file mode 100644 (file)
index 0000000..8b034b9
--- /dev/null
@@ -0,0 +1,24 @@
+var parse = require('../');
+var test = require('tape');
+
+test('-', function (t) {
+    t.plan(5);
+    t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] });
+    t.deepEqual(parse([ '-' ]), { _: [ '-' ] });
+    t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] });
+    t.deepEqual(
+        parse([ '-b', '-' ], { boolean: 'b' }),
+        { b: true, _: [ '-' ] }
+    );
+    t.deepEqual(
+        parse([ '-s', '-' ], { string: 's' }),
+        { s: '-', _: [] }
+    );
+});
+
+test('-a -- b', function (t) {
+    t.plan(3);
+    t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/default_bool.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/default_bool.js
new file mode 100644 (file)
index 0000000..f0041ee
--- /dev/null
@@ -0,0 +1,20 @@
+var test = require('tape');
+var parse = require('../');
+
+test('boolean default true', function (t) {
+    var argv = parse([], {
+        boolean: 'sometrue',
+        default: { sometrue: true }
+    });
+    t.equal(argv.sometrue, true);
+    t.end();
+});
+
+test('boolean default false', function (t) {
+    var argv = parse([], {
+        boolean: 'somefalse',
+        default: { somefalse: false }
+    });
+    t.equal(argv.somefalse, false);
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/dotted.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/dotted.js
new file mode 100644 (file)
index 0000000..ef0ae34
--- /dev/null
@@ -0,0 +1,16 @@
+var parse = require('../');
+var test = require('tape');
+
+test('dotted alias', function (t) {
+    var argv = parse(['--a.b', '22'], {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
+    t.equal(argv.a.b, 22);
+    t.equal(argv.aa.bb, 22);
+    t.end();
+});
+
+test('dotted default', function (t) {
+    var argv = parse('', {default: {'a.b': 11}, alias: {'a.b': 'aa.bb'}});
+    t.equal(argv.a.b, 11);
+    t.equal(argv.aa.bb, 11);
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/long.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/long.js
new file mode 100644 (file)
index 0000000..5d3a1e0
--- /dev/null
@@ -0,0 +1,31 @@
+var test = require('tape');
+var parse = require('../');
+
+test('long opts', function (t) {
+    t.deepEqual(
+        parse([ '--bool' ]),
+        { bool : true, _ : [] },
+        'long boolean'
+    );
+    t.deepEqual(
+        parse([ '--pow', 'xixxle' ]),
+        { pow : 'xixxle', _ : [] },
+        'long capture sp'
+    );
+    t.deepEqual(
+        parse([ '--pow=xixxle' ]),
+        { pow : 'xixxle', _ : [] },
+        'long capture eq'
+    );
+    t.deepEqual(
+        parse([ '--host', 'localhost', '--port', '555' ]),
+        { host : 'localhost', port : 555, _ : [] },
+        'long captures sp'
+    );
+    t.deepEqual(
+        parse([ '--host=localhost', '--port=555' ]),
+        { host : 'localhost', port : 555, _ : [] },
+        'long captures eq'
+    );
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/parse.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/parse.js
new file mode 100644 (file)
index 0000000..8a90646
--- /dev/null
@@ -0,0 +1,318 @@
+var parse = require('../');
+var test = require('tape');
+
+test('parse args', function (t) {
+    t.deepEqual(
+        parse([ '--no-moo' ]),
+        { moo : false, _ : [] },
+        'no'
+    );
+    t.deepEqual(
+        parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
+        { v : ['a','b','c'], _ : [] },
+        'multi'
+    );
+    t.end();
+});
+test('comprehensive', function (t) {
+    t.deepEqual(
+        parse([
+            '--name=meowmers', 'bare', '-cats', 'woo',
+            '-h', 'awesome', '--multi=quux',
+            '--key', 'value',
+            '-b', '--bool', '--no-meep', '--multi=baz',
+            '--', '--not-a-flag', 'eek'
+        ]),
+        {
+            c : true,
+            a : true,
+            t : true,
+            s : 'woo',
+            h : 'awesome',
+            b : true,
+            bool : true,
+            key : 'value',
+            multi : [ 'quux', 'baz' ],
+            meep : false,
+            name : 'meowmers',
+            _ : [ 'bare', '--not-a-flag', 'eek' ]
+        }
+    );
+    t.end();
+});
+
+test('nums', function (t) {
+    var argv = parse([
+        '-x', '1234',
+        '-y', '5.67',
+        '-z', '1e7',
+        '-w', '10f',
+        '--hex', '0xdeadbeef',
+        '789'
+    ]);
+    t.deepEqual(argv, {
+        x : 1234,
+        y : 5.67,
+        z : 1e7,
+        w : '10f',
+        hex : 0xdeadbeef,
+        _ : [ 789 ]
+    });
+    t.deepEqual(typeof argv.x, 'number');
+    t.deepEqual(typeof argv.y, 'number');
+    t.deepEqual(typeof argv.z, 'number');
+    t.deepEqual(typeof argv.w, 'string');
+    t.deepEqual(typeof argv.hex, 'number');
+    t.deepEqual(typeof argv._[0], 'number');
+    t.end();
+});
+
+test('flag boolean', function (t) {
+    var argv = parse([ '-t', 'moo' ], { boolean: 't' });
+    t.deepEqual(argv, { t : true, _ : [ 'moo' ] });
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+});
+
+test('flag boolean value', function (t) {
+    var argv = parse(['--verbose', 'false', 'moo', '-t', 'true'], {
+        boolean: [ 't', 'verbose' ],
+        default: { verbose: true }
+    });
+    
+    t.deepEqual(argv, {
+        verbose: false,
+        t: true,
+        _: ['moo']
+    });
+    
+    t.deepEqual(typeof argv.verbose, 'boolean');
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+});
+
+test('flag boolean default false', function (t) {
+    var argv = parse(['moo'], {
+        boolean: ['t', 'verbose'],
+        default: { verbose: false, t: false }
+    });
+    
+    t.deepEqual(argv, {
+        verbose: false,
+        t: false,
+        _: ['moo']
+    });
+    
+    t.deepEqual(typeof argv.verbose, 'boolean');
+    t.deepEqual(typeof argv.t, 'boolean');
+    t.end();
+
+});
+
+test('boolean groups', function (t) {
+    var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], {
+        boolean: ['x','y','z']
+    });
+    
+    t.deepEqual(argv, {
+        x : true,
+        y : false,
+        z : true,
+        _ : [ 'one', 'two', 'three' ]
+    });
+    
+    t.deepEqual(typeof argv.x, 'boolean');
+    t.deepEqual(typeof argv.y, 'boolean');
+    t.deepEqual(typeof argv.z, 'boolean');
+    t.end();
+});
+
+test('newlines in params' , function (t) {
+    var args = parse([ '-s', "X\nX" ])
+    t.deepEqual(args, { _ : [], s : "X\nX" });
+    
+    // reproduce in bash:
+    // VALUE="new
+    // line"
+    // node program.js --s="$VALUE"
+    args = parse([ "--s=X\nX" ])
+    t.deepEqual(args, { _ : [], s : "X\nX" });
+    t.end();
+});
+
+test('strings' , function (t) {
+    var s = parse([ '-s', '0001234' ], { string: 's' }).s;
+    t.equal(s, '0001234');
+    t.equal(typeof s, 'string');
+    
+    var x = parse([ '-x', '56' ], { string: 'x' }).x;
+    t.equal(x, '56');
+    t.equal(typeof x, 'string');
+    t.end();
+});
+
+test('stringArgs', function (t) {
+    var s = parse([ '  ', '  ' ], { string: '_' })._;
+    t.same(s.length, 2);
+    t.same(typeof s[0], 'string');
+    t.same(s[0], '  ');
+    t.same(typeof s[1], 'string');
+    t.same(s[1], '  ');
+    t.end();
+});
+
+test('empty strings', function(t) {
+    var s = parse([ '-s' ], { string: 's' }).s;
+    t.equal(s, '');
+    t.equal(typeof s, 'string');
+
+    var str = parse([ '--str' ], { string: 'str' }).str;
+    t.equal(str, '');
+    t.equal(typeof str, 'string');
+
+    var letters = parse([ '-art' ], {
+        string: [ 'a', 't' ]
+    });
+
+    t.equal(letters.a, '');
+    t.equal(letters.r, true);
+    t.equal(letters.t, '');
+
+    t.end();
+});
+
+
+test('slashBreak', function (t) {
+    t.same(
+        parse([ '-I/foo/bar/baz' ]),
+        { I : '/foo/bar/baz', _ : [] }
+    );
+    t.same(
+        parse([ '-xyz/foo/bar/baz' ]),
+        { x : true, y : true, z : '/foo/bar/baz', _ : [] }
+    );
+    t.end();
+});
+
+test('alias', function (t) {
+    var argv = parse([ '-f', '11', '--zoom', '55' ], {
+        alias: { z: 'zoom' }
+    });
+    t.equal(argv.zoom, 55);
+    t.equal(argv.z, argv.zoom);
+    t.equal(argv.f, 11);
+    t.end();
+});
+
+test('multiAlias', function (t) {
+    var argv = parse([ '-f', '11', '--zoom', '55' ], {
+        alias: { z: [ 'zm', 'zoom' ] }
+    });
+    t.equal(argv.zoom, 55);
+    t.equal(argv.z, argv.zoom);
+    t.equal(argv.z, argv.zm);
+    t.equal(argv.f, 11);
+    t.end();
+});
+
+test('nested dotted objects', function (t) {
+    var argv = parse([
+        '--foo.bar', '3', '--foo.baz', '4',
+        '--foo.quux.quibble', '5', '--foo.quux.o_O',
+        '--beep.boop'
+    ]);
+    
+    t.same(argv.foo, {
+        bar : 3,
+        baz : 4,
+        quux : {
+            quibble : 5,
+            o_O : true
+        }
+    });
+    t.same(argv.beep, { boop : true });
+    t.end();
+});
+
+test('boolean and alias with chainable api', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp',  'derp' ];
+    var opts = {
+        herp: { alias: 'h', boolean: true }
+    };
+    var aliasedArgv = parse(aliased, {
+        boolean: 'herp',
+        alias: { h: 'herp' }
+    });
+    var propertyArgv = parse(regular, {
+        boolean: 'herp',
+        alias: { h: 'herp' }
+    });
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected); 
+    t.end();
+});
+
+test('boolean and alias with options hash', function (t) {
+    var aliased = [ '-h', 'derp' ];
+    var regular = [ '--herp', 'derp' ];
+    var opts = {
+        alias: { 'h': 'herp' },
+        boolean: 'herp'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ 'derp' ]
+    };
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected);
+    t.end();
+});
+
+test('boolean and alias using explicit true', function (t) {
+    var aliased = [ '-h', 'true' ];
+    var regular = [ '--herp',  'true' ];
+    var opts = {
+        alias: { h: 'herp' },
+        boolean: 'h'
+    };
+    var aliasedArgv = parse(aliased, opts);
+    var propertyArgv = parse(regular, opts);
+    var expected = {
+        herp: true,
+        h: true,
+        '_': [ ]
+    };
+
+    t.same(aliasedArgv, expected);
+    t.same(propertyArgv, expected); 
+    t.end();
+});
+
+// regression, see https://github.com/substack/node-optimist/issues/71
+test('boolean and --x=true', function(t) {
+    var parsed = parse(['--boool', '--other=true'], {
+        boolean: 'boool'
+    });
+
+    t.same(parsed.boool, true);
+    t.same(parsed.other, 'true');
+
+    parsed = parse(['--boool', '--other=false'], {
+        boolean: 'boool'
+    });
+    
+    t.same(parsed.boool, true);
+    t.same(parsed.other, 'false');
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js
new file mode 100644 (file)
index 0000000..21851b0
--- /dev/null
@@ -0,0 +1,9 @@
+var parse = require('../');
+var test = require('tape');
+
+test('parse with modifier functions' , function (t) {
+    t.plan(1);
+    
+    var argv = parse([ '-b', '123' ], { boolean: 'b' });
+    t.deepEqual(argv, { b: true, _: ['123'] });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/short.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/short.js
new file mode 100644 (file)
index 0000000..d513a1c
--- /dev/null
@@ -0,0 +1,67 @@
+var parse = require('../');
+var test = require('tape');
+
+test('numeric short args', function (t) {
+    t.plan(2);
+    t.deepEqual(parse([ '-n123' ]), { n: 123, _: [] });
+    t.deepEqual(
+        parse([ '-123', '456' ]),
+        { 1: true, 2: true, 3: 456, _: [] }
+    );
+});
+
+test('short', function (t) {
+    t.deepEqual(
+        parse([ '-b' ]),
+        { b : true, _ : [] },
+        'short boolean'
+    );
+    t.deepEqual(
+        parse([ 'foo', 'bar', 'baz' ]),
+        { _ : [ 'foo', 'bar', 'baz' ] },
+        'bare'
+    );
+    t.deepEqual(
+        parse([ '-cats' ]),
+        { c : true, a : true, t : true, s : true, _ : [] },
+        'group'
+    );
+    t.deepEqual(
+        parse([ '-cats', 'meow' ]),
+        { c : true, a : true, t : true, s : 'meow', _ : [] },
+        'short group next'
+    );
+    t.deepEqual(
+        parse([ '-h', 'localhost' ]),
+        { h : 'localhost', _ : [] },
+        'short capture'
+    );
+    t.deepEqual(
+        parse([ '-h', 'localhost', '-p', '555' ]),
+        { h : 'localhost', p : 555, _ : [] },
+        'short captures'
+    );
+    t.end();
+});
+test('mixed short bool and capture', function (t) {
+    t.same(
+        parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+        {
+            f : true, p : 555, h : 'localhost',
+            _ : [ 'script.js' ]
+        }
+    );
+    t.end();
+});
+test('short and long', function (t) {
+    t.deepEqual(
+        parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+        {
+            f : true, p : 555, h : 'localhost',
+            _ : [ 'script.js' ]
+        }
+    );
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/whitespace.js b/legacy-libs/grpc/node_modules/mkdirp/node_modules/minimist/test/whitespace.js
new file mode 100644 (file)
index 0000000..8a52a58
--- /dev/null
@@ -0,0 +1,8 @@
+var parse = require('../');
+var test = require('tape');
+
+test('whitespace should be whitespace' , function (t) {
+    t.plan(1);
+    var x = parse([ '-x', '\t' ]).x;
+    t.equal(x, '\t');
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/package.json b/legacy-libs/grpc/node_modules/mkdirp/package.json
new file mode 100644 (file)
index 0000000..779e468
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_args": [
+    [
+      "mkdirp@0.5.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "mkdirp@0.5.1",
+  "_id": "mkdirp@0.5.1",
+  "_inBundle": false,
+  "_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
+  "_location": "/grpc/mkdirp",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "mkdirp@0.5.1",
+    "name": "mkdirp",
+    "escapedName": "mkdirp",
+    "rawSpec": "0.5.1",
+    "saveSpec": null,
+    "fetchSpec": "0.5.1"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp",
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "0.5.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "bin": {
+    "mkdirp": "bin/cmd.js"
+  },
+  "bugs": {
+    "url": "https://github.com/substack/node-mkdirp/issues"
+  },
+  "dependencies": {
+    "minimist": "0.0.8"
+  },
+  "description": "Recursively mkdir, like `mkdir -p`",
+  "devDependencies": {
+    "mock-fs": "2 >=2.7.0",
+    "tap": "1"
+  },
+  "homepage": "https://github.com/substack/node-mkdirp#readme",
+  "keywords": [
+    "mkdir",
+    "directory"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "mkdirp",
+  "optionalDependencies": {},
+  "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n    \nmkdirp('/tmp/foo/bar/baz', function (err) {\n    if (err) console.error(err)\n    else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n  Create each supplied directory including any necessary parent directories that\n  don't yet exist.\n  \n  If the directory already exists, do nothing.\n\nOPTIONS are:\n\n  -m, --mode   If a directory needs to be created, set the mode as an octal\n               permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n",
+  "readmeFilename": "readme.markdown",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/substack/node-mkdirp.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "0.5.1"
+}
diff --git a/legacy-libs/grpc/node_modules/mkdirp/readme.markdown b/legacy-libs/grpc/node_modules/mkdirp/readme.markdown
new file mode 100644 (file)
index 0000000..3cc1315
--- /dev/null
@@ -0,0 +1,100 @@
+# mkdirp
+
+Like `mkdir -p`, but in node.js!
+
+[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
+
+# example
+
+## pow.js
+
+```js
+var mkdirp = require('mkdirp');
+    
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
+```
+
+Output
+
+```
+pow!
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+var mkdirp = require('mkdirp');
+```
+
+## mkdirp(dir, opts, cb)
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `opts.mode`. If `opts` is a non-object, it will be treated as
+the `opts.mode`.
+
+If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+`cb(err, made)` fires with the error or the first directory `made`
+that had to be created, if any.
+
+You can optionally pass in an alternate `fs` implementation by passing in
+`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and
+`opts.fs.stat(path, cb)`.
+
+## mkdirp.sync(dir, opts)
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `opts.mode`. If `opts` is a non-object, it will be
+treated as the `opts.mode`.
+
+If `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+Returns the first directory that had to be created, if any.
+
+You can optionally pass in an alternate `fs` implementation by passing in
+`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and
+`opts.fs.statSync(path)`.
+
+# usage
+
+This package also ships with a `mkdirp` command.
+
+```
+usage: mkdirp [DIR1,DIR2..] {OPTIONS}
+
+  Create each supplied directory including any necessary parent directories that
+  don't yet exist.
+  
+  If the directory already exists, do nothing.
+
+OPTIONS are:
+
+  -m, --mode   If a directory needs to be created, set the mode as an octal
+               permission string.
+
+```
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+to get the library, or
+
+```
+npm install -g mkdirp
+```
+
+to get the command.
+
+# license
+
+MIT
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/chmod.js b/legacy-libs/grpc/node_modules/mkdirp/test/chmod.js
new file mode 100644 (file)
index 0000000..6a404b9
--- /dev/null
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+var _0744 = parseInt('0744', 8);
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+    var mode = _0744
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.equal(stat && stat.mode & _0777, mode, 'should be 0744');
+            t.end();
+        });
+    });
+});
+
+test('chmod', function (t) {
+    var mode = _0755
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.end();
+        });
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/clobber.js b/legacy-libs/grpc/node_modules/mkdirp/test/clobber.js
new file mode 100644 (file)
index 0000000..2433b9a
--- /dev/null
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+var _0755 = parseInt('0755', 8);
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+    console.error("about to write to "+itw)
+    fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+    fs.stat(itw, function (er, stat) {
+        t.ifError(er)
+        t.ok(stat && stat.isFile(), 'should be file')
+        t.end()
+    })
+})
+
+test('clobber', function (t) {
+    t.plan(2);
+    mkdirp(file, _0755, function (err) {
+        t.ok(err);
+        t.equal(err.code, 'ENOTDIR');
+        t.end();
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/mkdirp.js b/legacy-libs/grpc/node_modules/mkdirp/test/mkdirp.js
new file mode 100644 (file)
index 0000000..eaa8921
--- /dev/null
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('woo', function (t) {
+    t.plan(5);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, _0755, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            })
+        })
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/opts_fs.js b/legacy-libs/grpc/node_modules/mkdirp/test/opts_fs.js
new file mode 100644 (file)
index 0000000..97186b6
--- /dev/null
@@ -0,0 +1,29 @@
+var mkdirp = require('../');
+var path = require('path');
+var test = require('tap').test;
+var mockfs = require('mock-fs');
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('opts.fs', function (t) {
+    t.plan(5);
+    
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/beep/boop/' + [x,y,z].join('/');
+    var xfs = mockfs.fs();
+    
+    mkdirp(file, { fs: xfs, mode: _0755 }, function (err) {
+        t.ifError(err);
+        xfs.exists(file, function (ex) {
+            t.ok(ex, 'created file');
+            xfs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            });
+        });
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/opts_fs_sync.js b/legacy-libs/grpc/node_modules/mkdirp/test/opts_fs_sync.js
new file mode 100644 (file)
index 0000000..6c370aa
--- /dev/null
@@ -0,0 +1,27 @@
+var mkdirp = require('../');
+var path = require('path');
+var test = require('tap').test;
+var mockfs = require('mock-fs');
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('opts.fs sync', function (t) {
+    t.plan(4);
+    
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/beep/boop/' + [x,y,z].join('/');
+    var xfs = mockfs.fs();
+    
+    mkdirp.sync(file, { fs: xfs, mode: _0755 });
+    xfs.exists(file, function (ex) {
+        t.ok(ex, 'created file');
+        xfs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, _0755);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/perm.js b/legacy-libs/grpc/node_modules/mkdirp/test/perm.js
new file mode 100644 (file)
index 0000000..fbce44b
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('async perm', function (t) {
+    t.plan(5);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+    
+    mkdirp(file, _0755, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            })
+        })
+    });
+});
+
+test('async root perm', function (t) {
+    mkdirp('/tmp', _0755, function (err) {
+        if (err) t.fail(err);
+        t.end();
+    });
+    t.end();
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/perm_sync.js b/legacy-libs/grpc/node_modules/mkdirp/test/perm_sync.js
new file mode 100644 (file)
index 0000000..398229f
--- /dev/null
@@ -0,0 +1,36 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('sync perm', function (t) {
+    t.plan(4);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+    
+    mkdirp.sync(file, _0755);
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, _0755);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
+
+test('sync root perm', function (t) {
+    t.plan(3);
+    
+    var file = '/tmp';
+    mkdirp.sync(file, _0755);
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        })
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/race.js b/legacy-libs/grpc/node_modules/mkdirp/test/race.js
new file mode 100644 (file)
index 0000000..b0b9e18
--- /dev/null
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('race', function (t) {
+    t.plan(10);
+    var ps = [ '', 'tmp' ];
+    
+    for (var i = 0; i < 25; i++) {
+        var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+        ps.push(dir);
+    }
+    var file = ps.join('/');
+    
+    var res = 2;
+    mk(file);
+    
+    mk(file);
+    
+    function mk (file, cb) {
+        mkdirp(file, _0755, function (err) {
+            t.ifError(err);
+            exists(file, function (ex) {
+                t.ok(ex, 'file created');
+                fs.stat(file, function (err, stat) {
+                    t.ifError(err);
+                    t.equal(stat.mode & _0777, _0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                });
+            })
+        });
+    }
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/rel.js b/legacy-libs/grpc/node_modules/mkdirp/test/rel.js
new file mode 100644 (file)
index 0000000..4ddb342
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('rel', function (t) {
+    t.plan(5);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var cwd = process.cwd();
+    process.chdir('/tmp');
+    
+    var file = [x,y,z].join('/');
+    
+    mkdirp(file, _0755, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                process.chdir(cwd);
+                t.equal(stat.mode & _0777, _0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+            })
+        })
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/return.js b/legacy-libs/grpc/node_modules/mkdirp/test/return.js
new file mode 100644 (file)
index 0000000..bce68e5
--- /dev/null
@@ -0,0 +1,25 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    mkdirp(file, function (err, made) {
+        t.ifError(err);
+        t.equal(made, '/tmp/' + x);
+        mkdirp(file, function (err, made) {
+          t.ifError(err);
+          t.equal(made, null);
+        });
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/return_sync.js b/legacy-libs/grpc/node_modules/mkdirp/test/return_sync.js
new file mode 100644 (file)
index 0000000..7c222d3
--- /dev/null
@@ -0,0 +1,24 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    // Note that this will throw on failure, which will fail the test.
+    var made = mkdirp.sync(file);
+    t.equal(made, '/tmp/' + x);
+
+    // making the same file again should have no effect.
+    made = mkdirp.sync(file);
+    t.equal(made, null);
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/root.js b/legacy-libs/grpc/node_modules/mkdirp/test/root.js
new file mode 100644 (file)
index 0000000..9e7d079
--- /dev/null
@@ -0,0 +1,19 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+var _0755 = parseInt('0755', 8);
+
+test('root', function (t) {
+    // '/' on unix, 'c:/' on windows.
+    var file = path.resolve('/');
+
+    mkdirp(file, _0755, function (err) {
+        if (err) throw err
+        fs.stat(file, function (er, stat) {
+            if (er) throw er
+            t.ok(stat.isDirectory(), 'target is a directory');
+            t.end();
+        })
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/sync.js b/legacy-libs/grpc/node_modules/mkdirp/test/sync.js
new file mode 100644 (file)
index 0000000..8c8dc93
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('sync', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file, _0755);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, _0755);
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/umask.js b/legacy-libs/grpc/node_modules/mkdirp/test/umask.js
new file mode 100644 (file)
index 0000000..2033c63
--- /dev/null
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('implicit mode from umask', function (t) {
+    t.plan(5);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, function (err) {
+        t.ifError(err);
+        exists(file, function (ex) {
+            t.ok(ex, 'file created');
+            fs.stat(file, function (err, stat) {
+                t.ifError(err);
+                t.equal(stat.mode & _0777, _0777 & (~process.umask()));
+                t.ok(stat.isDirectory(), 'target not a directory');
+            });
+        })
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/mkdirp/test/umask_sync.js b/legacy-libs/grpc/node_modules/mkdirp/test/umask_sync.js
new file mode 100644 (file)
index 0000000..11a7614
--- /dev/null
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var exists = fs.exists || path.exists;
+var test = require('tap').test;
+var _0777 = parseInt('0777', 8);
+var _0755 = parseInt('0755', 8);
+
+test('umask sync modes', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    exists(file, function (ex) {
+        t.ok(ex, 'file created');
+        fs.stat(file, function (err, stat) {
+            t.ifError(err);
+            t.equal(stat.mode & _0777, (_0777 & (~process.umask())));
+            t.ok(stat.isDirectory(), 'target not a directory');
+        });
+    });
+});
diff --git a/legacy-libs/grpc/node_modules/needle/README.md b/legacy-libs/grpc/node_modules/needle/README.md
new file mode 100644 (file)
index 0000000..149bacc
--- /dev/null
@@ -0,0 +1,593 @@
+Needle
+======
+
+[![NPM](https://nodei.co/npm/needle.png)](https://nodei.co/npm/needle/)
+
+The leanest and most handsome HTTP client in the Nodelands.
+
+```js
+var needle = require('needle');
+
+needle.get('http://www.google.com', function(error, response) {
+  if (!error && response.statusCode == 200)
+    console.log(response.body);
+});
+```
+
+Callbacks not floating your boat? Needle got your back.
+
+``` js
+var data = {
+  file: '/home/johnlennon/walrus.png',
+  content_type: 'image/png'
+};
+
+// the callback is optional, and needle returns a `readableStream` object
+// that triggers a 'done' event when the request/response process is complete.
+needle
+  .post('https://my.server.com/foo', data, { multipart: true })
+  .on('readable', function() { /* eat your chunks */ })
+  .on('done', function(err, resp) {
+    console.log('Ready-o!');
+  })
+```
+
+From version 2.0.x up, Promises are also supported. Just call `needle()` directly and you'll get a native Promise object.
+
+```js
+needle('put', 'https://hacking.the.gibson/login', { password: 'god' }, { json: true })
+  .then(function(response) {
+    return doSomethingWith(response)
+  })
+  .catch(function(err) {
+    console.log('Call the locksmith!')
+  })
+```
+
+With only two real dependencies, Needle supports:
+
+ - HTTP/HTTPS requests, with the usual verbs you would expect
+ - All of Node's native TLS options, such as 'rejectUnauthorized' (see below)
+ - Basic & Digest authentication with auto-detection
+ - Multipart form-data (e.g. file uploads)
+ - HTTP Proxy forwarding, optionally with authentication
+ - Streaming gzip or deflate decompression
+ - Automatic XML & JSON parsing
+ - 301/302/303 redirect following, with fine-grained tuning, and
+ - Streaming non-UTF-8 charset decoding, via `iconv-lite`
+
+And yes, Mr. Wayne, it does come in black.
+
+This makes Needle an ideal alternative for performing quick HTTP requests in Node, either for API interaction, downloading or uploading streams of data, and so on. If you need OAuth, AWS support or anything fancier, you should check out mikeal's request module.
+
+Install
+-------
+
+```
+$ npm install needle
+```
+
+Usage
+-----
+
+```js
+// using promises
+needle('get', 'https://server.com/posts/12')
+  .then(function(resp) {
+    // ...
+  })
+  .catch(function(err) {
+    // ...
+  });
+
+// with callback
+needle.get('ifconfig.me/all.json', function(error, response, body) {
+  if (error) throw error;
+
+  // body is an alias for `response.body`,
+  // that in this case holds a JSON-decoded object.
+  console.log(body.ip_addr);
+});
+
+// no callback, using streams
+var out = fs.createWriteStream('logo.png');
+needle.get('https://google.com/images/logo.png').pipe(out).on('finish', function() {
+  console.log('Pipe finished!');
+});
+```
+
+As you can see, you can use Needle with Promises or without them. When using Promises or when a callback is passed, the response's body will be buffered and written to `response.body`, and the callback will be fired when all of the data has been collected and processed (e.g. decompressed, decoded and/or parsed).
+
+When no callback is passed, however, the buffering logic will be skipped but the response stream will still go through Needle's processing pipeline, so you get all the benefits of post-processing while keeping the streamishness we all love from Node.
+
+Response pipeline
+-----------------
+
+Depending on the response's Content-Type, Needle will either attempt to parse JSON or XML streams, or, if a text response was received, will ensure that the final encoding you get is UTF-8.
+
+You can also request a gzip/deflated response, which, if sent by the server, will be processed before parsing or decoding is performed.
+
+```js
+needle.get('http://stackoverflow.com/feeds', { compressed: true }, function(err, resp) {
+  console.log(resp.body); // this little guy won't be a Gzipped binary blob
+                          // but a nice object containing all the latest entries
+});
+```
+
+Or in anti-callback mode, using a few other options:
+
+```js
+var options = {
+  compressed         : true, // sets 'Accept-Encoding' to 'gzip,deflate'
+  follow_max         : 5,    // follow up to five redirects
+  rejectUnauthorized : true  // verify SSL certificate
+}
+
+var stream = needle.get('https://backend.server.com/everything.html', options);
+
+// read the chunks from the 'readable' event, so the stream gets consumed.
+stream.on('readable', function() {
+  while (data = this.read()) {
+    console.log(data.toString());
+  }
+})
+
+stream.on('done', function(err) {
+  // if our request had an error, our 'done' event will tell us.
+  if (!err) console.log('Great success!');
+})
+```
+
+API
+---
+
+### needle(method, url[, data][, options][, callback]) `(> 2.0.x)`
+
+Calling `needle()` directly returns a Promise. Besides `method` and `url`, all parameters are optional, although when sending a `post`, `put` or `patch` request you will get an error if `data` is not present.
+
+```js
+needle('get', 'http://some.url.com')
+  .then(function(resp) { console.log(resp.body) })
+  .catch(function(err) { console.error(err) })
+})
+```
+
+Except from the above, all of Needle's request methods return a Readable stream, and both `options` and `callback` are optional. If passed, the callback will return three arguments: `error`, `response` and `body`, which is basically an alias for `response.body`.
+
+### needle.head(url[, options][, callback])
+
+```js
+needle.head('https://my.backend.server.com', {
+  open_timeout: 5000 // if we're not able to open a connection in 5 seconds, boom.
+}, function(err, resp) {
+  if (err)
+    console.log('Shoot! Something is wrong: ' + err.message)
+  else
+    console.log('Yup, still alive.')
+})
+```
+
+### needle.get(url[, options][, callback])
+
+```js
+needle.get('google.com/search?q=syd+barrett', function(err, resp) {
+  // if no http:// is found, Needle will automagically prepend it.
+});
+```
+
+### needle.post(url, data[, options][, callback])
+
+```js
+var options = {
+  headers: { 'X-Custom-Header': 'Bumbaway atuna' }
+}
+
+needle.post('https://my.app.com/endpoint', 'foo=bar', options, function(err, resp) {
+  // you can pass params as a string or as an object.
+});
+```
+
+### needle.put(url, data[, options][, callback])
+
+```js
+var nested = {
+  params: {
+    are: {
+      also: 'supported'
+    }
+  }
+}
+
+needle.put('https://api.app.com/v2', nested, function(err, resp) {
+  console.log('Got ' + resp.bytes + ' bytes.') // another nice treat from this handsome fella.
+});
+```
+
+### needle.patch(url, data[, options][, callback])
+
+Same behaviour as PUT.
+
+### needle.delete(url, data[, options][, callback])
+
+```js
+var options = {
+  username: 'fidelio',
+  password: 'x'
+}
+
+needle.delete('https://api.app.com/messages/123', null, options, function(err, resp) {
+  // in this case, data may be null, but you need to explicity pass it.
+});
+```
+
+### needle.request(method, url, data[, options][, callback])
+
+Generic request. This not only allows for flexibility, but also lets you perform a GET request with data, in which case will be appended to the request as a query string, unless you pass a `json: true` option (read below).
+
+```js
+var params = {
+  q    : 'a very smart query',
+  page : 2
+}
+
+needle.request('get', 'forum.com/search', params, function(err, resp) {
+  if (!err && resp.statusCode == 200)
+    console.log(resp.body); // here you go, mister.
+});
+```
+
+Now, if you set pass `json: true` among the options, Needle won't set your params as a querystring but instead send a JSON representation of your data through the request's body, as well as set the `Content-Type` and `Accept` headers to `application/json`.
+
+```js
+needle.request('get', 'forum.com/search', params, { json: true }, function(err, resp) {
+  if (resp.statusCode == 200) console.log('It worked!');
+});
+```
+
+Events
+------
+
+The [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) object returned by the above request methods emits the following events, in addition to the regular ones (e.g. `end`, `close`, `data`, `pipe`, `readable`).
+
+### Event: `'response'`
+
+ - `response <http.IncomingMessage>`
+
+Emitted when the underlying [http.ClientRequest](https://nodejs.org/api/http.html#http_class_http_clientrequest) emits a response event. This is after the connection is established and the header received, but before any of it is processed (e.g. authorization required or redirect to be followed). No data has been consumed at this point.
+
+### Event: `'redirect'`
+
+ - `location <String>`
+
+Indicates that the a redirect is being followed. This means that the response code was a redirect (`301`, `302`, `303`, `307`) and the given [redirect options](#redirect-options) allowed following the URL received in the `Location` header.
+
+### Event: `'header'`
+
+ - `statusCode <Integer>`
+ - `headers <Object>`
+
+Triggered after the header has been processed, and just before the data is to be consumed. This implies that no redirect was followed and/or authentication header was received. In other words, we got a "valid" response.
+
+### Event: `'done'` (previously 'end')
+
+ - `exception <Error>` (optional)
+
+Emitted when the request/response process has finished, either because all data was consumed or an error ocurred somewhere in between. Unlike a regular stream's `end` event, Needle's `done` will be fired either on success or on failure, which is why the first argument may be an Error object. In other words:
+
+```js
+var resp = needle.get('something.worthy/of/being/streamed/by/needle');
+resp.pipe(someWritableStream);
+
+resp.on('done', function(err) {
+  if (err) console.log('An error ocurred: ' + err.message);
+  else console.log('Great success!');
+})
+```
+
+### Event: `'err'`
+
+ - `exception <Error>`
+
+Emitted when an error ocurrs. This should only happen once in the lifecycle of a Needle request.
+
+### Event: `'timeout'`
+
+ - `type <String>`
+
+Emitted when an timeout error occurs. Type can be either 'open', 'response', or 'read'. This will called right before aborting the request, which will also trigger an `err` event, a described above, with an `ECONNRESET` (Socket hang up) exception.
+
+Request options
+---------------
+
+For information about options that've changed, there's always [the changelog](https://github.com/tomas/needle/releases).
+
+ - `agent`       : Uses an [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent) of your choice, instead of the global, default one. Useful for tweaking the behaviour at the connection level, such as when doing tunneling (see below for an example).
+ - `json`        : When `true`, sets content type to `application/json` and sends request body as JSON string, instead of a query string.
+ - `open_timeout`: (or `timeout`) Returns error if connection takes longer than X milisecs to establish. Defaults to `10000` (10 secs). `0` means no timeout.
+ - `response_timeout`: Returns error if no response headers are received in X milisecs, counting from when the connection is opened. Defaults to `0` (no response timeout).
+ - `read_timeout`: Returns error if data transfer takes longer than X milisecs, once response headers are received. Defaults to `0` (no timeout).
+ - `follow_max`  : (or `follow`) Number of redirects to follow. Defaults to `0`. See below for more redirect options.
+ - `multipart`   : Enables multipart/form-data encoding. Defaults to `false`. Use it when uploading files.
+ - `proxy`       : Forwards request through HTTP(s) proxy. Eg. `proxy: 'http://user:pass@proxy.server.com:3128'`. For more advanced proxying/tunneling use a custom `agent`, as described below.
+ - `headers`     : Object containing custom HTTP headers for request. Overrides defaults described below.
+ - `auth`        : Determines what to do with provided username/password. Options are `auto`, `digest` or `basic` (default). `auto` will detect the type of authentication depending on the response headers.
+ - `stream_length`: When sending streams, this lets you manually set the Content-Length header --if the stream's bytecount is known beforehand--, preventing ECONNRESET (socket hang up) errors on some servers that misbehave when receiving payloads of unknown size. Set it to `0` and Needle will get and set the stream's length for you, or leave unset for the default behaviour, which is no Content-Length header for stream payloads.
+ - `localAddress`     : <string>, IP address. Passed to http/https request. Local interface from witch the request should be emitted.
+
+Response options
+----------------
+
+ - `decode_response` : (or `decode`) Whether to decode the text responses to UTF-8, if Content-Type header shows a different charset. Defaults to `true`.
+ - `parse_response`  : (or `parse`) Whether to parse XML or JSON response bodies automagically. Defaults to `true`. You can also set this to 'xml' or 'json' in which case Needle will *only* parse the response if the content type matches.
+ - `output`          : Dump response output to file. This occurs after parsing and charset decoding is done.
+ - `parse_cookies`   : Whether to parse response’s `Set-Cookie` header. Defaults to `true`. If parsed, response cookies will be available at `resp.cookies`.
+
+HTTP Header options
+-------------------
+
+These are basically shortcuts to the `headers` option described above.
+
+ - `cookies`   : Builds and sets a Cookie header from a `{ key: 'value' }` object.
+ - `compressed`: If `true`, sets 'Accept-Encoding' header to 'gzip,deflate', and inflates content if zipped. Defaults to `false`.
+ - `username`  : For HTTP basic auth.
+ - `password`  : For HTTP basic auth. Requires username to be passed, but is optional.
+ - `accept`    : Sets 'Accept' HTTP header. Defaults to `*/*`.
+ - `connection`: Sets 'Connection' HTTP header. Not set by default, unless running Node < 0.11.4 in which case it defaults to `close`. More info about this below.
+ - `user_agent`: Sets the 'User-Agent' HTTP header. Defaults to `Needle/{version} (Node.js {node_version})`.
+ - `content_type`: Sets the 'Content-Type' header. Unset by default, unless you're sending data in which case it's set accordingly to whatever is being sent (`application/x-www-form-urlencoded`, `application/json` or `multipart/form-data`). That is, of course, unless the option is passed, either here or through `options.headers`. You're the boss.
+
+Node.js TLS Options
+-------------------
+
+These options are passed directly to `https.request` if present. Taken from the [original documentation](http://nodejs.org/docs/latest/api/https.html):
+
+ - `pfx`                : Certificate, Private key and CA certificates to use for SSL.
+ - `key`                : Private key to use for SSL.
+ - `passphrase`         : A string of passphrase for the private key or pfx.
+ - `cert`               : Public x509 certificate to use.
+ - `ca`                 : An authority certificate or array of authority certificates to check the remote host against.
+ - `ciphers`            : A string describing the ciphers to use or exclude.
+ - `rejectUnauthorized` : If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent.
+ - `secureProtocol`     : The SSL method to use, e.g. SSLv3_method to force SSL version 3.
+
+Redirect options
+----------------
+
+These options only apply if the `follow_max` (or `follow`) option is higher than 0.
+
+ - `follow_set_cookies`      : Sends the cookies received in the `set-cookie` header as part of the following request. `false` by default.
+ - `follow_set_referer`      : Sets the 'Referer' header to the requested URI when following a redirect. `false` by default.
+ - `follow_keep_method`      : If enabled, resends the request using the original verb instead of being rewritten to `get` with no data. `false` by default.
+ - `follow_if_same_host`     : When true, Needle will only follow redirects that point to the same host as the original request. `false` by default.
+ - `follow_if_same_protocol` : When true, Needle will only follow redirects that point to the same protocol as the original request. `false` by default.
+
+Overriding Defaults
+-------------------
+
+Yes sir, we have it. Needle includes a `defaults()` method, that lets you override some of the defaults for all future requests. Like this:
+
+```js
+needle.defaults({
+  open_timeout: 60000,
+  user_agent: 'MyApp/1.2.3',
+  parse_response: false });
+```
+
+This will override Needle's default user agent and 10-second timeout, and disable response parsing, so you don't need to pass those options in every other request.
+
+More advanced Proxy support
+---------------------------
+
+Since you can pass a custom HTTPAgent to Needle you can do all sorts of neat stuff. For example, if you want to use the [`tunnel`](https://github.com/koichik/node-tunnel) module for HTTPS proxying, you can do this:
+
+```js
+var tunnel = require('tunnel');
+var myAgent = tunnel.httpOverHttp({
+  proxy: { host: 'localhost' }
+});
+
+needle.get('foobar.com', { agent: myAgent });
+```
+
+Regarding the 'Connection' header
+---------------------------------
+
+Unless you're running an old version of Node (< 0.11.4), by default Needle won't set the Connection header on requests, yielding Node's default behaviour of keeping the connection alive with the target server. This speeds up inmensely the process of sending several requests to the same host.
+
+On older versions, however, this has the unwanted behaviour of preventing the runtime from exiting, either because of a bug or 'feature' that was changed on 0.11.4. To overcome this Needle does set the 'Connection' header to 'close' on those versions, however this also means that making new requests to the same host doesn't benefit from Keep-Alive.
+
+So if you're stuck on 0.10 or even lower and want full speed, you can simply set the Connection header to 'Keep-Alive' by using `{ connection: 'Keep-Alive' }`. Please note, though, that an event loop handler will prevent the runtime from exiting so you'll need to manually call `process.exit()` or the universe will collapse.
+
+Examples Galore
+---------------
+
+### HTTPS GET with Basic Auth
+
+```js
+needle.get('https://api.server.com', { username: 'you', password: 'secret' },
+  function(err, resp) {
+    // used HTTP auth
+});
+```
+
+Or use [RFC-1738](http://tools.ietf.org/html/rfc1738#section-3.1) basic auth URL syntax:
+
+```js
+needle.get('https://username:password@api.server.com', function(err, resp) {
+    // used HTTP auth from URL
+});
+```
+
+### Digest Auth
+
+```js
+needle.get('other.server.com', { username: 'you', password: 'secret', auth: 'digest' },
+  function(err, resp, body) {
+    // needle prepends 'http://' to your URL, if missing
+});
+```
+
+### Custom Accept header, deflate
+
+```js
+var options = {
+  compressed : true,
+  follow     : 10,
+  accept     : 'application/vnd.github.full+json'
+}
+
+needle.get('api.github.com/users/tomas', options, function(err, resp, body) {
+  // body will contain a JSON.parse(d) object
+  // if parsing fails, you'll simply get the original body
+});
+```
+
+### GET XML object
+
+```js
+needle.get('https://news.ycombinator.com/rss', function(err, resp, body) {
+  // you'll get a nice object containing the nodes in the RSS
+});
+```
+
+### GET binary, output to file
+
+```js
+needle.get('http://upload.server.com/tux.png', { output: '/tmp/tux.png' }, function(err, resp, body) {
+  // you can dump any response to a file, not only binaries.
+});
+```
+
+### GET through proxy
+
+```js
+needle.get('http://search.npmjs.org', { proxy: 'http://localhost:1234' }, function(err, resp, body) {
+  // request passed through proxy
+});
+```
+
+### GET a very large document in a stream (from 0.7+)
+
+```js
+var stream = needle.get('http://www.as35662.net/100.log');
+
+stream.on('readable', function() {
+  var chunk;
+  while (chunk = this.read()) {
+    console.log('got data: ', chunk);
+  }
+});
+```
+
+### GET JSON object in a stream (from 0.7+)
+
+```js
+var stream = needle.get('http://jsonplaceholder.typicode.com/db', { parse: true });
+
+stream.on('readable', function() {
+  var node;
+
+  // our stream will only emit a single JSON root node.
+  while (node = this.read()) {
+    console.log('got data: ', node);
+  }
+});
+```
+
+### GET JSONStream flexible parser with search query (from 0.7+)
+
+```js
+
+ // The 'data' element of this stream will be the string representation
+ // of the titles of all posts.
+
+needle.get('http://jsonplaceholder.typicode.com/db', { parse: true })
+      .pipe(new JSONStream.parse('posts.*.title'));
+      .on('data', function (obj) {
+        console.log('got post title: %s', obj);
+      });
+```
+
+### File upload using multipart, passing file path
+
+```js
+var data = {
+  foo: 'bar',
+  image: { file: '/home/tomas/linux.png', content_type: 'image/png' }
+}
+
+needle.post('http://my.other.app.com', data, { multipart: true }, function(err, resp, body) {
+  // needle will read the file and include it in the form-data as binary
+});
+```
+
+### Stream upload, PUT or POST
+
+``` js
+needle.put('https://api.app.com/v2', fs.createReadStream('myfile.txt'), function(err, resp, body) {
+  // stream content is uploaded verbatim
+});
+```
+
+### Multipart POST, passing data buffer
+
+```js
+var buffer = fs.readFileSync('/path/to/package.zip');
+
+var data = {
+  zip_file: {
+    buffer       : buffer,
+    filename     : 'mypackage.zip',
+    content_type : 'application/octet-stream'
+  }
+}
+
+needle.post('http://somewhere.com/over/the/rainbow', data, { multipart: true }, function(err, resp, body) {
+  // if you see, when using buffers we need to pass the filename for the multipart body.
+  // you can also pass a filename when using the file path method, in case you want to override
+  // the default filename to be received on the other end.
+});
+```
+
+### Multipart with custom Content-Type
+
+```js
+var data = {
+  token: 'verysecret',
+  payload: {
+    value: JSON.stringify({ title: 'test', version: 1 }),
+    content_type: 'application/json'
+  }
+}
+
+needle.post('http://test.com/', data, { timeout: 5000, multipart: true }, function(err, resp, body) {
+  // in this case, if the request takes more than 5 seconds
+  // the callback will return a [Socket closed] error
+});
+```
+
+For even more examples, check out the examples directory in the repo.
+
+### Testing
+
+To run tests, you need to generate a self-signed SSL certificate in the `test` directory. After cloning the repository, run the following commands:
+
+    $ mkdir -p test/keys
+    $ openssl genrsa -out test/keys/ssl.key 2048
+    $ openssl req -new -key test/keys/ssl.key -x509 -days 999 -out test/keys/ssl.cert
+
+Then you should be able to run `npm test` once you have the dependencies in place.
+
+> Note: Tests currently only work on linux-based environments that have `/proc/self/fd`. They *do not* work on MacOS environments.
+> You can use Docker to run tests by creating a container and mounting the needle project directory on `/app`
+> `docker create --name Needle -v /app -w /app -v /app/node_modules -i node:argon`
+
+Credits
+-------
+
+Written by Tomás Pollak, with the help of contributors.
+
+Copyright
+---------
+
+(c) Fork Ltd. Licensed under the MIT license.
diff --git a/legacy-libs/grpc/node_modules/needle/bin/needle b/legacy-libs/grpc/node_modules/needle/bin/needle
new file mode 100644 (file)
index 0000000..baaa79b
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/env node
+var needle = require('./../lib/needle');
+
+function exit(code, str) {
+  console.log(str) || process.exit(code);
+}
+
+function usage() {
+  var out = ['Usage: needle [get|head|post|put|delete] url [query]'];
+  out.push('Examples: \n needle get google.com\n needle post server.com/api foo=bar');
+  exit(1, out.join('\n'))
+}
+
+if (process.argv[2] == '-v' || process.argv[2] == '--version')
+  exit(0, needle.version);
+else if (process.argv[2] == null)
+  usage();
+
+var method   = process.argv[2],
+    url      = process.argv[3],
+    options  = { compressed: true, parse_response: true, follow_max: 5, timeout: 10000 };
+
+if (!needle[method]) {
+  url    = method;
+  method = 'get';
+}
+
+var callback = function(err, resp) {
+  if (err) return exit(1, "Error: " + err.message);
+
+  if (process.argv.indexOf('-i') != -1)
+    console.log(resp.headers) || console.log('');
+
+  console.log(resp.body.toString());
+};
+
+if (method == 'post' || method == 'put')
+  needle[method](url, process.argv[4], options, callback);
+else
+  needle[method](url, options, callback);
diff --git a/legacy-libs/grpc/node_modules/needle/examples/deflated-stream.js b/legacy-libs/grpc/node_modules/needle/examples/deflated-stream.js
new file mode 100644 (file)
index 0000000..4e771b7
--- /dev/null
@@ -0,0 +1,22 @@
+var fs     = require('fs'),
+    stream = require('stream'),
+    needle = require('./../');
+
+var url  = 'http://ibl.gamechaser.net/f/tagqfxtteucbuldhezkz/bt_level1.gz';
+
+var resp = needle.get(url, { compressed: true, follow_max: 10 });
+console.log('Downloading...');
+
+resp.on('readable', function() {
+
+  while (data = this.read()) {
+    var lines = data.toString().split('\n');
+    console.log('Got ' + lines.length + ' items.');
+    // console.log(lines);
+  }
+
+})
+
+resp.on('done', function(data) {
+  console.log('Done');
+})
diff --git a/legacy-libs/grpc/node_modules/needle/examples/digest-auth.js b/legacy-libs/grpc/node_modules/needle/examples/digest-auth.js
new file mode 100644 (file)
index 0000000..5b8e5d5
--- /dev/null
@@ -0,0 +1,16 @@
+var needle = require('./..');
+
+var opts = {
+  username: 'user3',
+  password: 'user3',
+  auth: 'digest'
+}
+
+needle.get('http://test.webdav.org/auth-digest/', opts, function(err, resp, body) {
+  console.log(resp.headers);
+
+  if (resp.statusCode == 401)
+    console.log('\nIt failed.')
+  else
+    console.log('\nIt worked!')
+});
diff --git a/legacy-libs/grpc/node_modules/needle/examples/download-to-file.js b/legacy-libs/grpc/node_modules/needle/examples/download-to-file.js
new file mode 100644 (file)
index 0000000..39d5af9
--- /dev/null
@@ -0,0 +1,18 @@
+var fs = require('fs'),
+    needle = require('./..'),
+    path = require('path');
+
+var url  = process.argv[2] || 'https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png';
+var file = path.basename(url);
+
+console.log('Downloading ' + file);
+
+needle.get(url, { output: file, follow: 3 }, function(err, resp, data){
+  console.log('File saved: ' + process.cwd() + '/' + file);
+
+  var size = fs.statSync(file).size;
+  if (size == resp.bytes)
+    console.log(resp.bytes + ' bytes written to file.');
+  else
+    throw new Error('File size mismatch: ' + size + ' != ' + resp.bytes);
+});
diff --git a/legacy-libs/grpc/node_modules/needle/examples/multipart-stream.js b/legacy-libs/grpc/node_modules/needle/examples/multipart-stream.js
new file mode 100644 (file)
index 0000000..df1ada6
--- /dev/null
@@ -0,0 +1,25 @@
+var needle = require('./../');
+
+var url  = 'http://posttestserver.com/post.php?dir=needle';
+
+var black_pixel = Buffer.from("R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=", 'base64');
+
+var data = {
+  foo: 'bar',
+  nested: {
+    test: 123
+  },
+  image: { buffer: black_pixel, content_type: 'image/gif' }
+}
+
+var resp = needle.post(url, data, { multipart: true });
+
+resp.on('readable', function() {
+  while (data = this.read()) {
+    console.log(data.toString());
+  }
+})
+
+resp.on('done', function(data) {
+  console.log('Done.');
+})
diff --git a/legacy-libs/grpc/node_modules/needle/examples/parsed-stream.js b/legacy-libs/grpc/node_modules/needle/examples/parsed-stream.js
new file mode 100644 (file)
index 0000000..89c22c6
--- /dev/null
@@ -0,0 +1,23 @@
+//////////////////////////////////////////
+// This example demonstrates what happends
+// when you use the built-in JSON parser.
+//////////////////////////////////////////
+
+var fs     = require('fs'),
+    stream = require('stream'),
+    needle = require('./../');
+
+var url    = 'http://ip.jsontest.com/',
+    resp   = needle.get(url, { parse: true });
+
+resp.on('readable', function(obj) {
+  var chunk;
+
+  while (chunk = this.read()) {
+    console.log('root = ', chunk);
+  }
+});
+
+resp.on('done', function() {
+  console.log('Done.');
+});
diff --git a/legacy-libs/grpc/node_modules/needle/examples/parsed-stream2.js b/legacy-libs/grpc/node_modules/needle/examples/parsed-stream2.js
new file mode 100644 (file)
index 0000000..5d9b79a
--- /dev/null
@@ -0,0 +1,21 @@
+//////////////////////////////////////////\r
+// This example illustrates a more complex\r
+// example of parsing a JSON stream.\r
+//////////////////////////////////////////\r
+\r
+var needle     = require('./../'),\r
+    JSONStream = require('JSONStream');\r
+\r
+var url  = 'http://jsonplaceholder.typicode.com/db';\r
+\r
+// Initialize our GET request with our default (JSON) \r
+// parsers disabled.\r
+\r
+var json = new needle.get(url, {parse: false})\r
+    // And now interpret the stream as JSON, returning only the\r
+    // title of all the posts.\r
+    .pipe(new JSONStream.parse('posts.*.title'));\r
+\r
+json.on('data', function (obj) {\r
+  console.log('got title: \'' + obj + '\'');\r
+})\r
diff --git a/legacy-libs/grpc/node_modules/needle/examples/stream-events.js b/legacy-libs/grpc/node_modules/needle/examples/stream-events.js
new file mode 100644 (file)
index 0000000..6230993
--- /dev/null
@@ -0,0 +1,23 @@
+var needle = require('./..');
+
+var resp   = needle.get('google.com', { follow_max: 10, timeout: 5000 });
+
+resp.on('readable', function() {
+  var chunk;
+  while (chunk = this.read()) {
+    console.log('Got ' + chunk.length + ' bytes');
+  }
+})
+
+resp.on('headers', function(headers) {
+  console.log('Got headers', headers);
+})
+
+resp.on('redirect', function(url) {
+  console.log('Redirected to url ' + url);
+})
+
+resp.on('done', function(err) {
+  console.log('Finished. No more data to receive.');
+  if (err) console.log('With error', err)
+})
diff --git a/legacy-libs/grpc/node_modules/needle/examples/stream-to-file.js b/legacy-libs/grpc/node_modules/needle/examples/stream-to-file.js
new file mode 100644 (file)
index 0000000..d261bee
--- /dev/null
@@ -0,0 +1,14 @@
+var fs     = require('fs'),
+    needle = require('./..'),
+    path   = require('path');
+
+var url    = process.argv[2] || 'http://www.google.com/images/errors/robot.png';
+var file   = path.basename(url);
+
+console.log('Downloading ' + file + '...');
+needle
+  .get(url)
+  .pipe(fs.createWriteStream(file))
+  .on('done', function() {
+    console.log('Done!')
+  })
diff --git a/legacy-libs/grpc/node_modules/needle/examples/upload-image.js b/legacy-libs/grpc/node_modules/needle/examples/upload-image.js
new file mode 100644 (file)
index 0000000..090e3e3
--- /dev/null
@@ -0,0 +1,51 @@
+var needle = require('../'),
+    path   = require('path');
+
+var image = 'https://upload.wikimedia.org/wikipedia/commons/a/af/Tux.png';
+
+function upload(obj, cb) {
+  console.log('Uploading image...');
+
+  var url = 'http://deviantsart.com';
+
+  var opts = {
+    timeout:  10000,
+    follow:    3,
+    multipart: true
+  };
+
+  var params = {
+    file: obj
+  }
+
+  needle.post(url, params, opts, function(err, resp) {
+    if (err || !resp.body.match('url'))
+      return cb(err || new Error('No image URL found.'))
+
+    cb(null, JSON.parse(resp.body).url)
+  })
+}
+
+function download(url, cb) {
+  console.log('Getting ' + url);
+  needle.get(url, function(err, resp) {
+    if (err) throw err;
+
+    cb(null, resp.body);
+  })
+}
+
+////////////////////////////////////////
+// ok, now go.
+
+download(image, function(err, buffer) {
+  if (err) throw err;
+
+  var obj = { buffer: buffer, content_type: 'image/png' };
+
+  upload(obj, function(err, url) {
+    if (err) throw err;
+
+    console.log('Image uploaded to ' + url);
+  })
+})
diff --git a/legacy-libs/grpc/node_modules/needle/lib/auth.js b/legacy-libs/grpc/node_modules/needle/lib/auth.js
new file mode 100644 (file)
index 0000000..b7ed4ca
--- /dev/null
@@ -0,0 +1,110 @@
+var createHash = require('crypto').createHash;
+
+function get_header(header, credentials, opts) {
+  var type = header.split(' ')[0],
+      user = credentials[0],
+      pass = credentials[1];
+
+  if (type == 'Digest') {
+    return digest.generate(header, user, pass, opts.method, opts.path);
+  } else if (type == 'Basic') {
+    return basic(user, pass);
+  }
+}
+
+////////////////////
+// basic
+
+function md5(string) {
+  return createHash('md5').update(string).digest('hex');
+}
+
+function basic(user, pass) {
+  var str  = typeof pass == 'undefined' ? user : [user, pass].join(':');
+  return 'Basic ' + Buffer.from(str).toString('base64');
+}
+
+////////////////////
+// digest
+// logic inspired from https://github.com/simme/node-http-digest-client
+
+var digest = {};
+
+digest.parse_header = function(header) {
+  var challenge = {},
+      matches   = header.match(/([a-z0-9_-]+)="?([a-z0-9=\/\.@\s-]+)"?/gi);
+
+  for (var i = 0, l = matches.length; i < l; i++) {
+    var parts = matches[i].split('='),
+        key   = parts.shift(),
+        val   = parts.join('=').replace(/^"/, '').replace(/"$/, '');
+
+    challenge[key] = val;
+  }
+
+  return challenge;
+}
+
+digest.update_nc = function(nc) {
+  var max = 99999999;
+  nc++;
+
+  if (nc > max)
+    nc = 1;
+
+  var padding = new Array(8).join('0') + '';
+  nc = nc + '';
+  return padding.substr(0, 8 - nc.length) + nc;
+}
+
+digest.generate = function(header, user, pass, method, path) {
+
+  var nc        = 1,
+      cnonce    = null,
+      challenge = digest.parse_header(header);
+
+  var ha1  = md5(user + ':' + challenge.realm + ':' + pass),
+      ha2  = md5(method.toUpperCase() + ':' + path),
+      resp = [ha1, challenge.nonce];
+
+  if (typeof challenge.qop === 'string') {
+    cnonce = md5(Math.random().toString(36)).substr(0, 8);
+    nc     = digest.update_nc(nc);
+    resp   = resp.concat(nc, cnonce);
+  }
+
+  resp = resp.concat(challenge.qop, ha2);
+
+  var params = {
+    uri      : path,
+    realm    : challenge.realm,
+    nonce    : challenge.nonce,
+    username : user,
+    response : md5(resp.join(':'))
+  }
+
+  if (challenge.qop) {
+    params.qop = challenge.qop;
+  }
+
+  if (challenge.opaque) {
+    params.opaque = challenge.opaque;
+  }
+
+  if (cnonce) {
+    params.nc = nc;
+    params.cnonce = cnonce;
+  }
+
+  header = []
+  for (var k in params)
+    header.push(k + '="' + params[k] + '"')
+
+  return 'Digest ' + header.join(', ');
+}
+
+module.exports = {
+  header : get_header,
+  basic  : basic,
+  digest : digest.generate
+}
diff --git a/legacy-libs/grpc/node_modules/needle/lib/cookies.js b/legacy-libs/grpc/node_modules/needle/lib/cookies.js
new file mode 100644 (file)
index 0000000..0f48afc
--- /dev/null
@@ -0,0 +1,79 @@
+
+//  Simple cookie handling implementation based on the standard RFC 6265.
+//
+//  This module just has two functionalities:
+//    - Parse a set-cookie-header as a key value object
+//    - Write a cookie-string from a key value object
+//
+//  All cookie attributes are ignored.
+
+var unescape = require('querystring').unescape;
+
+var COOKIE_PAIR        = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/;
+var EXCLUDED_CHARS     = /[\x00-\x1F\x7F\x3B\x3B\s\"\,\\"%]/g;
+var TRAILING_SEMICOLON = /\x3B+$/;
+var SEP_SEMICOLON      = /\s*\x3B\s*/;
+
+// i know these should be 'const', but I'd like to keep
+// supporting earlier node.js versions as long as I can. :)
+
+var KEY_INDEX   = 1; // index of key from COOKIE_PAIR match
+var VALUE_INDEX = 3; // index of value from COOKIE_PAIR match
+
+// Returns a copy str trimmed and without trainling semicolon.
+function cleanCookieString(str) {
+  return str.trim().replace(/\x3B+$/, '');
+}
+
+function getFirstPair(str) {
+  var index = str.indexOf('\x3B');
+  return index === -1 ? str : str.substr(0, index);
+}
+
+// Returns a encoded copy of str based on RFC6265 S4.1.1.
+function encodeCookieComponent(str) {
+  return str.toString().replace(EXCLUDED_CHARS, encodeURIComponent);
+}
+
+// Parses a set-cookie-string based on the standard defined in RFC6265 S4.1.1.
+function parseSetCookieString(str) {
+  str = cleanCookieString(str);
+  str = getFirstPair(str);
+
+  var res = COOKIE_PAIR.exec(str);
+  if (!res || !res[VALUE_INDEX]) return null;
+
+  return {
+    name  : unescape(res[KEY_INDEX]),
+    value : unescape(res[VALUE_INDEX])
+  };
+}
+
+// Parses a set-cookie-header and returns a key/value object.
+// Each key represents the name of a cookie.
+function parseSetCookieHeader(header) {
+  if (!header) return {};
+  header = Array.isArray(header) ? header : [header];
+
+  return header.reduce(function(res, str) {
+    var cookie = parseSetCookieString(str);
+    if (cookie) res[cookie.name] = cookie.value;
+    return res;
+  }, {});
+}
+
+// Writes a set-cookie-string based on the standard definded in RFC6265 S4.1.1.
+function writeCookieString(obj) {
+  return Object.keys(obj).reduce(function(str, name) {
+    var encodedName  = encodeCookieComponent(name);
+    var encodedValue = encodeCookieComponent(obj[name]);
+    str += (str ? '; ' : '') + encodedName + '=' + encodedValue;
+    return str;
+  }, '');
+}
+
+// returns a key/val object from an array of cookie strings
+exports.read = parseSetCookieHeader;
+
+// writes a cookie string header
+exports.write = writeCookieString;
diff --git a/legacy-libs/grpc/node_modules/needle/lib/decoder.js b/legacy-libs/grpc/node_modules/needle/lib/decoder.js
new file mode 100644 (file)
index 0000000..d82bb5a
--- /dev/null
@@ -0,0 +1,53 @@
+var iconv,
+    inherits  = require('util').inherits,
+    stream    = require('stream');
+
+var regex = /(?:charset|encoding)\s*=\s*['"]? *([\w\-]+)/i;
+
+inherits(StreamDecoder, stream.Transform);
+
+function StreamDecoder(charset) {
+  if (!(this instanceof StreamDecoder))
+    return new StreamDecoder(charset);
+
+  stream.Transform.call(this, charset);
+  this.charset = charset;
+  this.parsed_chunk = false;
+}
+
+StreamDecoder.prototype._transform = function(chunk, encoding, done) {
+  var res, found;
+
+  // try get charset from chunk, just once
+  if (this.charset == 'iso-8859-1' && !this.parsed_chunk) {
+    this.parsed_chunk = true;
+
+    var matches = regex.exec(chunk.toString());
+    if (matches) {
+      found = matches[1].toLowerCase();
+      this.charset = found == 'utf-8' ? 'utf8' : found;
+    }
+  }
+
+  try {
+    res = iconv.decode(chunk, this.charset);
+  } catch(e) { // something went wrong, just return original chunk
+    res = chunk;
+  }
+
+  this.push(res);
+  done();
+}
+
+module.exports = function(charset) {
+  try {
+    if (!iconv) iconv = require('iconv-lite');
+  } catch(e) {
+    /* iconv not found */
+  }
+
+  if (iconv)
+    return new StreamDecoder(charset);
+  else
+    return new stream.PassThrough;
+}
diff --git a/legacy-libs/grpc/node_modules/needle/lib/multipart.js b/legacy-libs/grpc/node_modules/needle/lib/multipart.js
new file mode 100644 (file)
index 0000000..d1e6e18
--- /dev/null
@@ -0,0 +1,98 @@
+var readFile = require('fs').readFile,
+    basename = require('path').basename;
+
+exports.build = function(data, boundary, callback) {
+
+  if (typeof data != 'object' || typeof data.pipe == 'function')
+    return callback(new Error('Multipart builder expects data as key/val object.'));
+
+  var body   = '',
+      object = flatten(data),
+      count  = Object.keys(object).length;
+
+  if (count === 0)
+    return callback(new Error('Empty multipart body. Invalid data.'))
+
+  function done(err, section) {
+    if (err) return callback(err);
+    if (section) body += section;
+    --count || callback(null, body + '--' + boundary + '--');
+  };
+
+  for (var key in object) {
+    var value = object[key];
+    if (value === null || typeof value == 'undefined') {
+      done();
+    } else if (Buffer.isBuffer(value)) {
+      var part = { buffer: value, content_type: 'application/octet-stream' };
+      generate_part(key, part, boundary, done);
+    } else {
+      var part = (value.buffer || value.file || value.content_type) ? value : { value: value };
+      generate_part(key, part, boundary, done);
+    }
+  }
+
+}
+
+function generate_part(name, part, boundary, callback) {
+
+  var return_part = '--' + boundary + '\r\n';
+  return_part += 'Content-Disposition: form-data; name="' + name + '"';
+
+  function append(data, filename) {
+
+    if (data) {
+      var binary = part.content_type.indexOf('text') == -1;
+      return_part += '; filename="' + encodeURIComponent(filename) + '"\r\n';
+      if (binary) return_part += 'Content-Transfer-Encoding: binary\r\n';
+      return_part += 'Content-Type: ' + part.content_type + '\r\n\r\n';
+      return_part += binary ? data.toString('binary') : data.toString('utf8');
+    }
+
+    callback(null, return_part + '\r\n');
+  };
+
+  if ((part.file || part.buffer) && part.content_type) {
+
+    var filename = part.filename ? part.filename : part.file ? basename(part.file) : name;
+    if (part.buffer) return append(part.buffer, filename);
+
+    readFile(part.file, function(err, data) {
+      if (err) return callback(err);
+      append(data, filename);
+    });
+
+  } else {
+
+    if (typeof part.value == 'object')
+      return callback(new Error('Object received for ' + name + ', expected string.'))
+
+    if (part.content_type) {
+      return_part += '\r\n';
+      return_part += 'Content-Type: ' + part.content_type;
+    }
+
+    return_part += '\r\n\r\n';
+    return_part += Buffer.from(String(part.value), 'utf8').toString('binary');
+    append();
+
+  }
+
+}
+
+// flattens nested objects for multipart body
+function flatten(object, into, prefix) {
+  into = into || {};
+
+  for(var key in object) {
+    var prefix_key = prefix ? prefix + '[' + key + ']' : key;
+    var prop = object[key];
+
+    if (prop && typeof prop === 'object' && !(prop.buffer || prop.file || prop.content_type))
+      flatten(prop, into, prefix_key)
+    else
+      into[prefix_key] = prop;
+  }
+
+  return into;
+}
diff --git a/legacy-libs/grpc/node_modules/needle/lib/needle.js b/legacy-libs/grpc/node_modules/needle/lib/needle.js
new file mode 100644 (file)
index 0000000..001007c
--- /dev/null
@@ -0,0 +1,797 @@
+//////////////////////////////////////////
+// Needle -- HTTP Client for Node.js
+// Written by Tomás Pollak <tomas@forkhq.com>
+// (c) 2012-2017 - Fork Ltd.
+// MIT Licensed
+//////////////////////////////////////////
+
+var fs          = require('fs'),
+    http        = require('http'),
+    https       = require('https'),
+    url         = require('url'),
+    stream      = require('stream'),
+    debug       = require('debug')('needle'),
+    stringify   = require('./querystring').build,
+    multipart   = require('./multipart'),
+    auth        = require('./auth'),
+    cookies     = require('./cookies'),
+    parsers     = require('./parsers'),
+    decoder     = require('./decoder');
+
+//////////////////////////////////////////
+// variabilia
+
+var version     = require('../package.json').version;
+
+var user_agent  = 'Needle/' + version;
+user_agent     += ' (Node.js ' + process.version + '; ' + process.platform + ' ' + process.arch + ')';
+
+var tls_options = 'agent pfx key passphrase cert ca ciphers rejectUnauthorized secureProtocol checkServerIdentity';
+
+// older versions of node (< 0.11.4) prevent the runtime from exiting
+// because of connections in keep-alive state. so if this is the case
+// we'll default new requests to set a Connection: close header.
+var close_by_default = !http.Agent || http.Agent.defaultMaxSockets != Infinity;
+
+// see if we have Object.assign. otherwise fall back to util._extend
+var extend = Object.assign ? Object.assign : require('util')._extend;
+
+// these are the status codes that Needle interprets as redirects.
+var redirect_codes = [301, 302, 303, 307];
+
+//////////////////////////////////////////
+// decompressors for gzip/deflate bodies
+
+var decompressors = {};
+
+try {
+
+  var zlib = require('zlib');
+  decompressors['x-deflate'] = zlib.Inflate;
+  decompressors['deflate']   = zlib.Inflate;
+  decompressors['x-gzip']    = zlib.Gunzip;
+  decompressors['gzip']      = zlib.Gunzip;
+
+  // Enable Z_SYNC_FLUSH to avoid Z_BUF_ERROR errors (Node PR #2595)
+  var zlib_options = {
+    flush: zlib.Z_SYNC_FLUSH,
+    finishFlush: zlib.Z_SYNC_FLUSH
+  }
+
+} catch(e) { /* zlib not available */ }
+
+//////////////////////////////////////////
+// options and aliases
+
+var defaults = {
+  // data
+  boundary                : '--------------------NODENEEDLEHTTPCLIENT',
+  encoding                : 'utf8',
+  parse_response          : 'all', // same as true. valid options: 'json', 'xml' or false/null
+  proxy                   : null,
+
+  // headers
+  accept                  : '*/*',
+  user_agent              : user_agent,
+
+  // numbers
+  open_timeout            : 10000,
+  response_timeout        : 0,
+  read_timeout            : 0,
+  follow_max              : 0,
+  stream_length           : -1,
+
+  // booleans
+  decode_response         : true,
+  parse_cookies           : true,
+  follow_set_cookies      : false,
+  follow_set_referer      : false,
+  follow_keep_method      : false,
+  follow_if_same_host     : false,
+  follow_if_same_protocol : false
+}
+
+var aliased = {
+  options: {
+    decode  : 'decode_response',
+    parse   : 'parse_response',
+    timeout : 'open_timeout',
+    follow  : 'follow_max'
+  },
+  inverted: {}
+}
+
+// only once, invert aliased keys so we can get passed options.
+Object.keys(aliased.options).map(function(k) {
+  var value = aliased.options[k];
+  aliased.inverted[value] = k;
+});
+
+//////////////////////////////////////////
+// helpers
+
+function keys_by_type(type) {
+  return Object.keys(defaults).map(function(el) {
+    if (defaults[el] !== null && defaults[el].constructor == type)
+      return el;
+  }).filter(function(el) { return el })
+}
+
+function parse_content_type(header) {
+  if (!header || header === '') return {};
+
+  var found, charset = 'iso-8859-1', arr = header.split(';');
+
+  if (arr.length > 1 && (found = arr[1].match(/charset=(.+)/)))
+    charset = found[1];
+
+  return { type: arr[0], charset: charset };
+}
+
+function is_stream(obj) {
+  return typeof obj.pipe === 'function';
+}
+
+function get_stream_length(stream, given_length, cb) {
+  if (given_length > 0)
+    return cb(given_length);
+
+  if (stream.end !== void 0 && stream.end !== Infinity && stream.start !== void 0)
+    return cb((stream.end + 1) - (stream.start || 0));
+
+  fs.stat(stream.path, function(err, stat) {
+    cb(stat ? stat.size - (stream.start || 0) : null);
+  });
+}
+
+//////////////////////////////////////////
+// the main act
+
+function Needle(method, uri, data, options, callback) {
+  // if (!(this instanceof Needle)) {
+  //   return new Needle(method, uri, data, options, callback);
+  // }
+
+  if (typeof uri !== 'string')
+    throw new TypeError('URL must be a string, not ' + uri);
+
+  this.method   = method;
+  this.uri      = uri;
+  this.data     = data;
+
+  if (typeof options == 'function') {
+    this.callback = options;
+    this.options  = {};
+  } else {
+    this.callback = callback;
+    this.options  = options;
+  }
+
+}
+
+Needle.prototype.setup = function(uri, options) {
+
+  function get_option(key, fallback) {
+    // if original is in options, return that value
+    if (typeof options[key] != 'undefined') return options[key];
+
+    // otherwise, return value from alias or fallback/undefined
+    return typeof options[aliased.inverted[key]] != 'undefined'
+                ? options[aliased.inverted[key]] : fallback;
+  }
+
+  function check_value(expected, key) {
+    var value = get_option(key),
+        type  = typeof value;
+
+    if (type != 'undefined' && type != expected)
+      throw new TypeError(type + ' received for ' + key + ', but expected a ' + expected);
+
+    return (type == expected) ? value : defaults[key];
+  }
+
+  //////////////////////////////////////////////////
+  // the basics
+
+  var config = {
+    http_opts : {
+      localAddress: get_option('localAddress', undefined)
+    }, // passed later to http.request() directly
+    output    : options.output,
+    proxy     : get_option('proxy', defaults.proxy),
+    parser    : get_option('parse_response', defaults.parse_response),
+    encoding  : options.encoding || (options.multipart ? 'binary' : defaults.encoding)
+  }
+
+  keys_by_type(Boolean).forEach(function(key) {
+    config[key] = check_value('boolean', key);
+  })
+
+  keys_by_type(Number).forEach(function(key) {
+    config[key] = check_value('number', key);
+  })
+
+  // populate http_opts with given TLS options
+  tls_options.split(' ').forEach(function(key) {
+    if (typeof options[key] != 'undefined') {
+      config.http_opts[key] = options[key];
+      if (typeof options.agent == 'undefined')
+        config.http_opts.agent = false; // otherwise tls options are skipped
+    }
+  });
+
+  //////////////////////////////////////////////////
+  // headers, cookies
+
+  config.headers = {
+    'accept'     : options.accept     || defaults.accept,
+    'user-agent' : options.user_agent || defaults.user_agent
+  }
+
+  if (options.content_type)
+    config.headers['content-type'] = options.content_type;
+
+  // set connection header if opts.connection was passed, or if node < 0.11.4 (close)
+  if (options.connection || close_by_default)
+    config.headers['connection'] = options.connection || 'close';
+
+  if ((options.compressed || defaults.compressed) && typeof zlib != 'undefined')
+    config.headers['accept-encoding'] = 'gzip,deflate';
+
+  if (options.cookies)
+    config.headers['cookie'] = cookies.write(options.cookies);
+
+  //////////////////////////////////////////////////
+  // basic/digest auth
+
+  if (uri.match(/[^\/]@/)) { // url contains user:pass@host, so parse it.
+    var parts = (url.parse(uri).auth || '').split(':');
+    options.username = parts[0];
+    options.password = parts[1];
+  }
+
+  if (options.username) {
+    if (options.auth && (options.auth == 'auto' || options.auth == 'digest')) {
+      config.credentials = [options.username, options.password];
+    } else {
+      config.headers['authorization'] = auth.basic(options.username, options.password);
+    }
+  }
+
+  // if proxy is present, set auth header from either url or proxy_user option.
+  if (config.proxy) {
+    if (config.proxy.indexOf('http') === -1)
+      config.proxy = 'http://' + config.proxy;
+
+    if (config.proxy.indexOf('@') !== -1) {
+      var proxy = (url.parse(config.proxy).auth || '').split(':');
+      options.proxy_user = proxy[0];
+      options.proxy_pass = proxy[1];
+    }
+
+    if (options.proxy_user)
+      config.headers['proxy-authorization'] = auth.basic(options.proxy_user, options.proxy_pass);
+  }
+
+  // now that all our headers are set, overwrite them if instructed.
+  for (var h in options.headers)
+    config.headers[h.toLowerCase()] = options.headers[h];
+
+  return config;
+}
+
+Needle.prototype.start = function() {
+
+  var out      = new stream.PassThrough({ objectMode: false }),
+      uri      = this.uri,
+      data     = this.data,
+      method   = this.method,
+      callback = (typeof this.options == 'function') ? this.options : this.callback,
+      options  = this.options || {};
+
+  // if no 'http' is found on URL, prepend it.
+  if (uri.indexOf('http') === -1)
+    uri = uri.replace(/^(\/\/)?/, 'http://');
+
+  var self = this, body, waiting = false, config = this.setup(uri, options);
+
+  // unless options.json was set to false, assume boss also wants JSON if content-type matches.
+  var json = options.json || (options.json !== false && config.headers['content-type'] == 'application/json');
+
+  if (data) {
+
+    if (options.multipart) { // boss says we do multipart. so we do it.
+      var boundary = options.boundary || defaults.boundary;
+
+      waiting = true;
+      multipart.build(data, boundary, function(err, parts) {
+        if (err) throw(err);
+
+        config.headers['content-type'] = 'multipart/form-data; boundary=' + boundary;
+        next(parts);
+      });
+
+    } else if (is_stream(data)) {
+
+      if (method.toUpperCase() == 'GET')
+        throw new Error('Refusing to pipe() a stream via GET. Did you mean .post?');
+
+      if (config.stream_length > 0 || (config.stream_length === 0 && data.path)) {
+        // ok, let's get the stream's length and set it as the content-length header.
+        // this prevents some servers from cutting us off before all the data is sent.
+        waiting = true;
+        get_stream_length(data, config.stream_length, function(length) {
+          data.length = length;
+          next(data);
+        })
+
+      } else {
+        // if the boss doesn't want us to get the stream's length, or if it doesn't
+        // have a file descriptor for that purpose, then just head on.
+        body = data;
+      }
+
+    } else if (Buffer.isBuffer(data)) {
+
+      body = data; // use the raw buffer as request body.
+
+    } else if (method.toUpperCase() == 'GET' && !json) {
+
+      // append the data to the URI as a querystring.
+      uri = uri.replace(/\?.*|$/, '?' + stringify(data));
+
+    } else { // string or object data, no multipart.
+
+      // if string, leave it as it is, otherwise, stringify.
+      body = (typeof(data) === 'string') ? data
+             : json ? JSON.stringify(data) : stringify(data);
+
+      // ensure we have a buffer so bytecount is correct.
+      body = Buffer.from(body, config.encoding);
+    }
+
+  }
+
+  function next(body) {
+    if (body) {
+      if (body.length) config.headers['content-length'] = body.length;
+
+      // if no content-type was passed, determine if json or not.
+      if (!config.headers['content-type']) {
+        config.headers['content-type'] = json
+        ? 'application/json; charset=utf-8'
+        : 'application/x-www-form-urlencoded'; // no charset says W3 spec.
+      }
+    }
+
+    // unless a specific accept header was set, assume json: true wants JSON back.
+    if (options.json && (!options.accept && !(options.headers || {}).accept))
+      config.headers['accept'] = 'application/json';
+
+    self.send_request(1, method, uri, config, body, out, callback);
+  }
+
+  if (!waiting) next(body);
+  return out;
+}
+
+Needle.prototype.get_request_opts = function(method, uri, config) {
+  var opts      = config.http_opts,
+      proxy     = config.proxy,
+      remote    = proxy ? url.parse(proxy) : url.parse(uri);
+
+  opts.protocol = remote.protocol;
+  opts.host     = remote.hostname;
+  opts.port     = remote.port || (remote.protocol == 'https:' ? 443 : 80);
+  opts.path     = proxy ? uri : remote.pathname + (remote.search || '');
+  opts.method   = method;
+  opts.headers  = config.headers;
+
+  if (!opts.headers['host']) {
+    // if using proxy, make sure the host header shows the final destination
+    var target = proxy ? url.parse(uri) : remote;
+    opts.headers['host'] = target.hostname;
+
+    // and if a non standard port was passed, append it to the port header
+    if (target.port && [80, 443].indexOf(target.port) === -1) {
+      opts.headers['host'] += ':' + target.port;
+    }
+  }
+
+  return opts;
+}
+
+Needle.prototype.should_follow = function(location, config, original) {
+  if (!location) return false;
+
+  // returns true if location contains matching property (host or protocol)
+  function matches(property) {
+    var property = original[property];
+    return location.indexOf(property) !== -1;
+  }
+
+  // first, check whether the requested location is actually different from the original
+  if (location === original)
+    return false;
+
+  if (config.follow_if_same_host && !matches('host'))
+    return false; // host does not match, so not following
+
+  if (config.follow_if_same_protocol && !matches('protocol'))
+    return false; // procotol does not match, so not following
+
+  return true;
+}
+
+Needle.prototype.send_request = function(count, method, uri, config, post_data, out, callback) {
+
+  var timer,
+      returned     = 0,
+      self         = this,
+      request_opts = this.get_request_opts(method, uri, config),
+      protocol     = request_opts.protocol == 'https:' ? https : http;
+
+  function done(err, resp) {
+    if (returned++ > 0)
+      return debug('Already finished, stopping here.');
+
+    if (timer) clearTimeout(timer);
+    request.removeListener('error', had_error);
+
+    if (callback)
+      return callback(err, resp, resp ? resp.body : undefined);
+
+    // NOTE: this event used to be called 'end', but the behaviour was confusing
+    // when errors ocurred, because the stream would still emit an 'end' event.
+    out.emit('done', err);
+  }
+
+  function had_error(err) {
+    debug('Request error', err);
+    out.emit('err', err);
+    done(err || new Error('Unknown error when making request.'));
+  }
+
+  function set_timeout(type, milisecs) {
+    if (timer) clearTimeout(timer);
+    if (milisecs <= 0) return;
+
+    timer = setTimeout(function() {
+      out.emit('timeout', type);
+      request.abort();
+      // also invoke done() to terminate job on read_timeout
+      if (type == 'read') done(new Error(type + ' timeout'));
+    }, milisecs);
+  }
+
+  // handle errors on the underlying socket, that may be closed while writing
+  // for an example case, see test/long_string_spec.js. we make sure this
+  // scenario ocurred by verifying the socket's writable & destroyed states.
+  function on_socket_end() {
+    if (!this.writable && this.destroyed === false) {
+      this.destroy();
+      had_error(new Error('Remote end closed socket abruptly.'))
+    }
+  }
+
+  debug('Making request #' + count, request_opts);
+  var request = protocol.request(request_opts, function(resp) {
+
+    var headers = resp.headers;
+    debug('Got response', resp.statusCode, headers);
+    out.emit('response', resp);
+
+    set_timeout('read', config.read_timeout);
+
+    // if we got cookies, parse them unless we were instructed not to. make sure to include any
+    // cookies that might have been set on previous redirects.
+    if (config.parse_cookies && (headers['set-cookie'] || config.stored_cookies)) {
+      resp.cookies = extend(config.stored_cookies || {}, cookies.read(headers['set-cookie']));
+      debug('Got cookies', resp.cookies);
+    }
+
+    // if redirect code is found, determine if we should follow it according to the given options.
+    if (redirect_codes.indexOf(resp.statusCode) !== -1 && self.should_follow(headers.location, config, uri)) {
+      // clear timer before following redirects to prevent unexpected setTimeout consequence
+      clearTimeout(timer);
+
+      if (count <= config.follow_max) {
+        out.emit('redirect', headers.location);
+
+        // unless 'follow_keep_method' is true, rewrite the request to GET before continuing.
+        if (!config.follow_keep_method) {
+          method    = 'GET';
+          post_data = null;
+          delete config.headers['content-length']; // in case the original was a multipart POST request.
+        }
+
+        // if follow_set_cookies is true, make sure to put any cookies in the next request's headers.
+        if (config.follow_set_cookies && resp.cookies) {
+          config.stored_cookies    = resp.cookies;
+          config.headers['cookie'] = cookies.write(resp.cookies);
+        }
+
+        if (config.follow_set_referer)
+          config.headers['referer'] = encodeURI(uri); // the original, not the destination URL.
+
+        config.headers['host'] = null; // clear previous Host header to avoid conflicts.
+
+        debug('Redirecting to ' + url.resolve(uri, headers.location));
+        return self.send_request(++count, method, url.resolve(uri, headers.location), config, post_data, out, callback);
+      } else if (config.follow_max > 0) {
+        return done(new Error('Max redirects reached. Possible loop in: ' + headers.location));
+      }
+    }
+
+    // if auth is requested and credentials were not passed, resend request, provided we have user/pass.
+    if (resp.statusCode == 401 && headers['www-authenticate'] && config.credentials) {
+      if (!config.headers['authorization']) { // only if authentication hasn't been sent
+        var auth_header = auth.header(headers['www-authenticate'], config.credentials, request_opts);
+
+        if (auth_header) {
+          config.headers['authorization'] = auth_header;
+          return self.send_request(count, method, uri, config, post_data, out, callback);
+        }
+      }
+    }
+
+    // ok, so we got a valid (non-redirect & authorized) response. let's notify the stream guys.
+    out.emit('header', resp.statusCode, headers);
+    out.emit('headers', headers);
+
+    var pipeline      = [],
+        mime          = parse_content_type(headers['content-type']),
+        text_response = mime.type && mime.type.indexOf('text/') != -1;
+
+    // To start, if our body is compressed and we're able to inflate it, do it.
+    if (headers['content-encoding'] && decompressors[headers['content-encoding']]) {
+
+      var decompressor = decompressors[headers['content-encoding']](zlib_options);
+
+      // make sure we catch errors triggered by the decompressor.
+      decompressor.on('error', had_error);
+      pipeline.push(decompressor);
+    }
+
+    // If parse is enabled and we have a parser for it, then go for it.
+    if (config.parser && parsers[mime.type]) {
+
+      // If a specific parser was requested, make sure we don't parse other types.
+      var parser_name = config.parser.toString().toLowerCase();
+      if (['xml', 'json'].indexOf(parser_name) == -1 || parsers[mime.type].name == parser_name) {
+
+        // OK, so either we're parsing all content types or the one requested matches.
+        out.parser = parsers[mime.type].name;
+        pipeline.push(parsers[mime.type].fn());
+
+        // Set objectMode on out stream to improve performance.
+        out._writableState.objectMode = true;
+        out._readableState.objectMode = true;
+      }
+
+    // If we're not parsing, and unless decoding was disabled, we'll try
+    // decoding non UTF-8 bodies to UTF-8, using the iconv-lite library.
+    } else if (text_response && config.decode_response
+      && mime.charset && !mime.charset.match(/utf-?8$/i)) {
+        pipeline.push(decoder(mime.charset));
+    }
+
+    // And `out` is the stream we finally push the decoded/parsed output to.
+    pipeline.push(out);
+
+    // Now, release the kraken!
+    var tmp = resp;
+    while (pipeline.length) {
+      tmp = tmp.pipe(pipeline.shift());
+    }
+
+    // If the user has requested and output file, pipe the output stream to it.
+    // In stream mode, we will still get the response stream to play with.
+    if (config.output && resp.statusCode == 200) {
+
+      // for some reason, simply piping resp to the writable stream doesn't
+      // work all the time (stream gets cut in the middle with no warning).
+      // so we'll manually need to do the readable/write(chunk) trick.
+      var file = fs.createWriteStream(config.output);
+      file.on('error', had_error);
+
+      out.on('end', function() {
+        if (file.writable) file.end();
+      });
+
+      file.on('close', function() {
+        delete out.file;
+      })
+
+      out.on('readable', function() {
+        var chunk;
+        while ((chunk = this.read()) !== null) {
+          if (file.writable) file.write(chunk);
+
+          // if callback was requested, also push it to resp.body
+          if (resp.body) resp.body.push(chunk);
+        }
+      })
+
+      out.file = file;
+    }
+
+    // Only aggregate the full body if a callback was requested.
+    if (callback) {
+      resp.raw   = [];
+      resp.body  = [];
+      resp.bytes = 0;
+
+      // Gather and count the amount of (raw) bytes using a PassThrough stream.
+      var clean_pipe = new stream.PassThrough();
+      resp.pipe(clean_pipe);
+
+      clean_pipe.on('readable', function() {
+        var chunk;
+        while ((chunk = this.read()) != null) {
+          resp.bytes += chunk.length;
+          resp.raw.push(chunk);
+        }
+      })
+
+      // Listen on the 'readable' event to aggregate the chunks, but only if
+      // file output wasn't requested. Otherwise we'd have two stream readers.
+      if (!config.output || resp.statusCode != 200) {
+        out.on('readable', function() {
+          var chunk;
+          while ((chunk = this.read()) !== null) {
+            // We're either pushing buffers or objects, never strings.
+            if (typeof chunk == 'string') chunk = Buffer.from(chunk);
+
+            // Push all chunks to resp.body. We'll bind them in resp.end().
+            resp.body.push(chunk);
+          }
+        })
+      }
+    }
+
+    // And set the .body property once all data is in.
+    out.on('end', function() {
+      if (resp.body) { // callback mode
+
+        // we want to be able to access to the raw data later, so keep a reference.
+        resp.raw = Buffer.concat(resp.raw);
+
+        // if parse was successful, we should have an array with one object
+        if (resp.body[0] !== undefined && !Buffer.isBuffer(resp.body[0])) {
+
+          // that's our body right there.
+          resp.body = resp.body[0];
+
+          // set the parser property on our response. we may want to check.
+          if (out.parser) resp.parser = out.parser;
+
+        } else { // we got one or several buffers. string or binary.
+          resp.body = Buffer.concat(resp.body);
+
+          // if we're here and parsed is true, it means we tried to but it didn't work.
+          // so given that we got a text response, let's stringify it.
+          if (text_response || out.parser) {
+            resp.body = resp.body.toString();
+          }
+        }
+      }
+
+      // if an output file is being written to, make sure the callback
+      // is triggered after all data has been written to it.
+      if (out.file) {
+        out.file.on('close', function() {
+          done(null, resp, resp.body);
+        })
+      } else { // elvis has left the building.
+        done(null, resp, resp.body);
+      }
+
+    });
+
+  }); // end request call
+
+  // unless open_timeout was disabled, set a timeout to abort the request.
+  set_timeout('open', config.open_timeout);
+
+  // handle errors on the request object. things might get bumpy.
+  request.on('error', had_error);
+
+  // make sure timer is cleared if request is aborted (issue #257)
+  request.once('abort', function() {
+    if (timer) clearTimeout(timer);
+  })
+
+  // handle socket 'end' event to ensure we don't get delayed EPIPE errors.
+  request.once('socket', function(socket) {
+    if (socket.connecting) {
+      socket.once('connect', function() {
+        set_timeout('response', config.response_timeout);
+      })
+    } else {
+      set_timeout('response', config.response_timeout);
+    }
+
+    // console.log(socket);
+    if (!socket.on_socket_end) {
+      socket.on_socket_end = on_socket_end;
+      socket.once('end', function() { process.nextTick(on_socket_end.bind(socket)) });
+    }
+  })
+
+  if (post_data) {
+    if (is_stream(post_data)) {
+      post_data.pipe(request);
+    } else {
+      request.write(post_data, config.encoding);
+      request.end();
+    }
+  } else {
+    request.end();
+  }
+
+  out.request = request;
+  return out;
+}
+
+//////////////////////////////////////////
+// exports
+
+if (typeof Promise !== 'undefined') {
+  module.exports = function() {
+    var verb, args = [].slice.call(arguments);
+
+    if (args[0].match(/\.|\//)) // first argument looks like a URL
+      verb = (args.length > 2) ? 'post' : 'get';
+    else
+      verb = args.shift();
+
+    if (verb.match(/get|head/) && args.length == 2)
+      args.splice(1, 0, null); // assume no data if head/get with two args (url, options)
+
+    return new Promise(function(resolve, reject) {
+      module.exports.request(verb, args[0], args[1], args[2], function(err, resp) {
+        return err ? reject(err) : resolve(resp);
+      });
+    })
+  }
+}
+
+module.exports.version = version;
+
+module.exports.defaults = function(obj) {
+  for (var key in obj) {
+    var target_key = aliased.options[key] || key;
+
+    if (defaults.hasOwnProperty(target_key) && typeof obj[key] != 'undefined') {
+      if (target_key != 'parse_response' && target_key != 'proxy') {
+        // ensure type matches the original, except for proxy/parse_response that can be null/bool or string
+        var valid_type = defaults[target_key].constructor.name;
+
+        if (obj[key].constructor.name != valid_type)
+          throw new TypeError('Invalid type for ' + key + ', should be ' + valid_type);
+      }
+      defaults[target_key] = obj[key];
+    } else {
+      throw new Error('Invalid property for defaults:' + target_key);      
+    }
+  }
+
+  return defaults;
+}
+
+'head get'.split(' ').forEach(function(method) {
+  module.exports[method] = function(uri, options, callback) {
+    return new Needle(method, uri, null, options, callback).start();
+  }
+})
+
+'post put patch delete'.split(' ').forEach(function(method) {
+  module.exports[method] = function(uri, data, options, callback) {
+    return new Needle(method, uri, data, options, callback).start();
+  }
+})
+
+module.exports.request = function(method, uri, data, opts, callback) {
+  return new Needle(method, uri, data, opts, callback).start();
+};
diff --git a/legacy-libs/grpc/node_modules/needle/lib/parsers.js b/legacy-libs/grpc/node_modules/needle/lib/parsers.js
new file mode 100644 (file)
index 0000000..108b17b
--- /dev/null
@@ -0,0 +1,120 @@
+//////////////////////////////////////////
+// Defines mappings between content-type
+// and the appropriate parsers.
+//////////////////////////////////////////
+
+var Transform = require('stream').Transform;
+var sax = require('sax');
+
+function parseXML(str, cb) {
+  var obj, current, parser = sax.parser(true, { trim: true, lowercase: true })
+  parser.onerror = parser.onend = done;
+
+  function done(err) {
+    parser.onerror = parser.onend = function() { }
+    cb(err, obj)
+  }
+
+  function newElement(name, attributes) {
+    return {
+      name: name || '',
+      value: '',
+      attributes: attributes || {},
+      children: []
+    }
+  }
+
+  parser.ontext = function(t) {
+    if (current) current.value += t
+  }
+
+  parser.onopentag = function(node) {
+    var element = newElement(node.name, node.attributes)
+    if (current) {
+      element.parent = current
+      current.children.push(element)
+    } else { // root object
+      obj = element
+    }
+
+    current = element
+  };
+
+  parser.onclosetag = function() {
+    if (typeof current.parent !== 'undefined') {
+      var just_closed = current
+      current = current.parent
+      delete just_closed.parent
+    }
+  }
+
+  parser.write(str).close()
+}
+
+function parserFactory(name, fn) {
+
+  function parser() {
+    var chunks = [],
+        stream = new Transform({ objectMode: true });
+
+    // Buffer all our data
+    stream._transform = function(chunk, encoding, done) {
+      chunks.push(chunk);
+      done();
+    }
+
+    // And call the parser when all is there.
+    stream._flush = function(done) {
+      var self = this,
+          data = Buffer.concat(chunks);
+
+      try {
+        fn(data, function(err, result) {
+          if (err) throw err;
+          self.push(result);
+        });
+      } catch (err) {
+        self.push(data); // just pass the original data
+      } finally {
+        done();
+      }
+    }
+
+    return stream;
+  }
+
+  return { fn: parser, name: name };
+}
+
+var parsers = {}
+
+function buildParser(name, types, fn) {
+  var parser = parserFactory(name, fn);
+  types.forEach(function(type) {
+    parsers[type] = parser;
+  })
+}
+
+buildParser('json', [
+  'application/json',
+  'text/javascript'
+], function(buffer, cb) {
+  var err, data;
+  try { data = JSON.parse(buffer); } catch (e) { err = e; }
+  cb(err, data);
+});
+
+buildParser('xml', [
+  'text/xml',
+  'application/xml',
+  'application/rdf+xml',
+  'application/rss+xml',
+  'application/atom+xml'
+], function(buffer, cb) {
+  parseXML(buffer.toString(), function(err, obj) {
+    cb(err, obj)
+  })
+});
+
+module.exports = parsers;
+module.exports.use = buildParser;
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/needle/lib/querystring.js b/legacy-libs/grpc/node_modules/needle/lib/querystring.js
new file mode 100644 (file)
index 0000000..e58cc42
--- /dev/null
@@ -0,0 +1,49 @@
+// based on the qs module, but handles null objects as expected
+// fixes by Tomas Pollak.
+
+var toString = Object.prototype.toString;
+
+function stringify(obj, prefix) {
+  if (prefix && (obj === null || typeof obj == 'undefined')) {
+    return prefix + '=';
+  } else if (toString.call(obj) == '[object Array]') {
+    return stringifyArray(obj, prefix);
+  } else if (toString.call(obj) == '[object Object]') {
+    return stringifyObject(obj, prefix);
+  } else if (toString.call(obj) == '[object Date]') {
+    return obj.toISOString();
+  } else if (prefix) { // string inside array or hash
+    return prefix + '=' + encodeURIComponent(String(obj));
+  } else if (String(obj).indexOf('=') !== -1) { // string with equal sign
+    return String(obj);
+  } else {
+    throw new TypeError('Cannot build a querystring out of: ' + obj);
+  }
+};
+
+function stringifyArray(arr, prefix) {
+  var ret = [];
+
+  for (var i = 0, len = arr.length; i < len; i++) {
+    if (prefix)
+      ret.push(stringify(arr[i], prefix + '[]'));
+    else
+      ret.push(stringify(arr[i]));
+  }
+
+  return ret.join('&');
+}
+
+function stringifyObject(obj, prefix) {
+  var ret = [];
+
+  Object.keys(obj).forEach(function(key) {
+    ret.push(stringify(obj[key], prefix
+      ? prefix + '[' + encodeURIComponent(key) + ']'
+      : encodeURIComponent(key)));
+  })
+
+  return ret.join('&');
+}
+
+exports.build = stringify;
diff --git a/legacy-libs/grpc/node_modules/needle/license.txt b/legacy-libs/grpc/node_modules/needle/license.txt
new file mode 100644 (file)
index 0000000..fb245f3
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) Fork, Ltd.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/CHANGELOG.md b/legacy-libs/grpc/node_modules/needle/node_modules/debug/CHANGELOG.md
new file mode 100644 (file)
index 0000000..820d21e
--- /dev/null
@@ -0,0 +1,395 @@
+
+3.1.0 / 2017-09-26
+==================
+
+  * Add `DEBUG_HIDE_DATE` env var (#486)
+  * Remove ReDoS regexp in %o formatter (#504)
+  * Remove "component" from package.json
+  * Remove `component.json`
+  * Ignore package-lock.json
+  * Examples: fix colors printout
+  * Fix: browser detection
+  * Fix: spelling mistake (#496, @EdwardBetts)
+
+3.0.1 / 2017-08-24
+==================
+
+  * Fix: Disable colors in Edge and Internet Explorer (#489)
+
+3.0.0 / 2017-08-08
+==================
+
+  * Breaking: Remove DEBUG_FD (#406)
+  * Breaking: Use `Date#toISOString()` instead to `Date#toUTCString()` when output is not a TTY (#418)
+  * Breaking: Make millisecond timer namespace specific and allow 'always enabled' output (#408)
+  * Addition: document `enabled` flag (#465)
+  * Addition: add 256 colors mode (#481)
+  * Addition: `enabled()` updates existing debug instances, add `destroy()` function (#440)
+  * Update: component: update "ms" to v2.0.0
+  * Update: separate the Node and Browser tests in Travis-CI
+  * Update: refactor Readme, fixed documentation, added "Namespace Colors" section, redid screenshots
+  * Update: separate Node.js and web browser examples for organization
+  * Update: update "browserify" to v14.4.0
+  * Fix: fix Readme typo (#473)
+
+2.6.9 / 2017-09-22
+==================
+
+  * remove ReDoS regexp in %o formatter (#504)
+
+2.6.8 / 2017-05-18
+==================
+
+  * Fix: Check for undefined on browser globals (#462, @marbemac)
+
+2.6.7 / 2017-05-16
+==================
+
+  * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom)
+  * Fix: Inline extend function in node implementation (#452, @dougwilson)
+  * Docs: Fix typo (#455, @msasad)
+
+2.6.5 / 2017-04-27
+==================
+  
+  * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek)
+  * Misc: clean up browser reference checks (#447, @thebigredgeek)
+  * Misc: add npm-debug.log to .gitignore (@thebigredgeek)
+
+
+2.6.4 / 2017-04-20
+==================
+
+  * Fix: bug that would occur if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo)
+  * Chore: ignore bower.json in npm installations. (#437, @joaovieira)
+  * Misc: update "ms" to v0.7.3 (@tootallnate)
+
+2.6.3 / 2017-03-13
+==================
+
+  * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts)
+  * Docs: Changelog fix (@thebigredgeek)
+
+2.6.2 / 2017-03-10
+==================
+
+  * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin)
+  * Docs: Add backers and sponsors from Open Collective (#422, @piamancini)
+  * Docs: Add Slackin invite badge (@tootallnate)
+
+2.6.1 / 2017-02-10
+==================
+
+  * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error
+  * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0)
+  * Fix: IE8 "Expected identifier" error (#414, @vgoma)
+  * Fix: Namespaces would not disable once enabled (#409, @musikov)
+
+2.6.0 / 2016-12-28
+==================
+
+  * Fix: added better null pointer checks for browser useColors (@thebigredgeek)
+  * Improvement: removed explicit `window.debug` export (#404, @tootallnate)
+  * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate)
+
+2.5.2 / 2016-12-25
+==================
+
+  * Fix: reference error on window within webworkers (#393, @KlausTrainer)
+  * Docs: fixed README typo (#391, @lurch)
+  * Docs: added notice about v3 api discussion (@thebigredgeek)
+
+2.5.1 / 2016-12-20
+==================
+
+  * Fix: babel-core compatibility
+
+2.5.0 / 2016-12-20
+==================
+
+  * Fix: wrong reference in bower file (@thebigredgeek)
+  * Fix: webworker compatibility (@thebigredgeek)
+  * Fix: output formatting issue (#388, @kribblo)
+  * Fix: babel-loader compatibility (#383, @escwald)
+  * Misc: removed built asset from repo and publications (@thebigredgeek)
+  * Misc: moved source files to /src (#378, @yamikuronue)
+  * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue)
+  * Test: coveralls integration (#378, @yamikuronue)
+  * Docs: simplified language in the opening paragraph (#373, @yamikuronue)
+
+2.4.5 / 2016-12-17
+==================
+
+  * Fix: `navigator` undefined in Rhino (#376, @jochenberger)
+  * Fix: custom log function (#379, @hsiliev)
+  * Improvement: bit of cleanup + linting fixes (@thebigredgeek)
+  * Improvement: rm non-maintainted `dist/` dir (#375, @freewil)
+  * Docs: simplified language in the opening paragraph. (#373, @yamikuronue)
+
+2.4.4 / 2016-12-14
+==================
+
+  * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts)
+
+2.4.3 / 2016-12-14
+==================
+
+  * Fix: navigation.userAgent error for react native (#364, @escwald)
+
+2.4.2 / 2016-12-14
+==================
+
+  * Fix: browser colors (#367, @tootallnate)
+  * Misc: travis ci integration (@thebigredgeek)
+  * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek)
+
+2.4.1 / 2016-12-13
+==================
+
+  * Fix: typo that broke the package (#356)
+
+2.4.0 / 2016-12-13
+==================
+
+  * Fix: bower.json references unbuilt src entry point (#342, @justmatt)
+  * Fix: revert "handle regex special characters" (@tootallnate)
+  * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate)
+  * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate)
+  * Improvement: allow colors in workers (#335, @botverse)
+  * Improvement: use same color for same namespace. (#338, @lchenay)
+
+2.3.3 / 2016-11-09
+==================
+
+  * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne)
+  * Fix: Returning `localStorage` saved values (#331, Levi Thomason)
+  * Improvement: Don't create an empty object when no `process` (Nathan Rajlich)
+
+2.3.2 / 2016-11-09
+==================
+
+  * Fix: be super-safe in index.js as well (@TooTallNate)
+  * Fix: should check whether process exists (Tom Newby)
+
+2.3.1 / 2016-11-09
+==================
+
+  * Fix: Added electron compatibility (#324, @paulcbetts)
+  * Improvement: Added performance optimizations (@tootallnate)
+  * Readme: Corrected PowerShell environment variable example (#252, @gimre)
+  * Misc: Removed yarn lock file from source control (#321, @fengmk2)
+
+2.3.0 / 2016-11-07
+==================
+
+  * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic)
+  * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos)
+  * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15)
+  * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran)
+  * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom)
+  * Package: Update "ms" to 0.7.2 (#315, @DevSide)
+  * Package: removed superfluous version property from bower.json (#207 @kkirsche)
+  * Readme: fix USE_COLORS to DEBUG_COLORS
+  * Readme: Doc fixes for format string sugar (#269, @mlucool)
+  * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0)
+  * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable)
+  * Readme: better docs for browser support (#224, @matthewmueller)
+  * Tooling: Added yarn integration for development (#317, @thebigredgeek)
+  * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek)
+  * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman)
+  * Misc: Updated contributors (@thebigredgeek)
+
+2.2.0 / 2015-05-09
+==================
+
+  * package: update "ms" to v0.7.1 (#202, @dougwilson)
+  * README: add logging to file example (#193, @DanielOchoa)
+  * README: fixed a typo (#191, @amir-s)
+  * browser: expose `storage` (#190, @stephenmathieson)
+  * Makefile: add a `distclean` target (#189, @stephenmathieson)
+
+2.1.3 / 2015-03-13
+==================
+
+  * Updated stdout/stderr example (#186)
+  * Updated example/stdout.js to match debug current behaviour
+  * Renamed example/stderr.js to stdout.js
+  * Update Readme.md (#184)
+  * replace high intensity foreground color for bold (#182, #183)
+
+2.1.2 / 2015-03-01
+==================
+
+  * dist: recompile
+  * update "ms" to v0.7.0
+  * package: update "browserify" to v9.0.3
+  * component: fix "ms.js" repo location
+  * changed bower package name
+  * updated documentation about using debug in a browser
+  * fix: security error on safari (#167, #168, @yields)
+
+2.1.1 / 2014-12-29
+==================
+
+  * browser: use `typeof` to check for `console` existence
+  * browser: check for `console.log` truthiness (fix IE 8/9)
+  * browser: add support for Chrome apps
+  * Readme: added Windows usage remarks
+  * Add `bower.json` to properly support bower install
+
+2.1.0 / 2014-10-15
+==================
+
+  * node: implement `DEBUG_FD` env variable support
+  * package: update "browserify" to v6.1.0
+  * package: add "license" field to package.json (#135, @panuhorsmalahti)
+
+2.0.0 / 2014-09-01
+==================
+
+  * package: update "browserify" to v5.11.0
+  * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
+
+1.0.4 / 2014-07-15
+==================
+
+  * dist: recompile
+  * example: remove `console.info()` log usage
+  * example: add "Content-Type" UTF-8 header to browser example
+  * browser: place %c marker after the space character
+  * browser: reset the "content" color via `color: inherit`
+  * browser: add colors support for Firefox >= v31
+  * debug: prefer an instance `log()` function over the global one (#119)
+  * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
+
+1.0.3 / 2014-07-09
+==================
+
+  * Add support for multiple wildcards in namespaces (#122, @seegno)
+  * browser: fix lint
+
+1.0.2 / 2014-06-10
+==================
+
+  * browser: update color palette (#113, @gscottolson)
+  * common: make console logging function configurable (#108, @timoxley)
+  * node: fix %o colors on old node <= 0.8.x
+  * Makefile: find node path using shell/which (#109, @timoxley)
+
+1.0.1 / 2014-06-06
+==================
+
+  * browser: use `removeItem()` to clear localStorage
+  * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
+  * package: add "contributors" section
+  * node: fix comment typo
+  * README: list authors
+
+1.0.0 / 2014-06-04
+==================
+
+  * make ms diff be global, not be scope
+  * debug: ignore empty strings in enable()
+  * node: make DEBUG_COLORS able to disable coloring
+  * *: export the `colors` array
+  * npmignore: don't publish the `dist` dir
+  * Makefile: refactor to use browserify
+  * package: add "browserify" as a dev dependency
+  * Readme: add Web Inspector Colors section
+  * node: reset terminal color for the debug content
+  * node: map "%o" to `util.inspect()`
+  * browser: map "%j" to `JSON.stringify()`
+  * debug: add custom "formatters"
+  * debug: use "ms" module for humanizing the diff
+  * Readme: add "bash" syntax highlighting
+  * browser: add Firebug color support
+  * browser: add colors for WebKit browsers
+  * node: apply log to `console`
+  * rewrite: abstract common logic for Node & browsers
+  * add .jshintrc file
+
+0.8.1 / 2014-04-14
+==================
+
+  * package: re-add the "component" section
+
+0.8.0 / 2014-03-30
+==================
+
+  * add `enable()` method for nodejs. Closes #27
+  * change from stderr to stdout
+  * remove unnecessary index.js file
+
+0.7.4 / 2013-11-13
+==================
+
+  * remove "browserify" key from package.json (fixes something in browserify)
+
+0.7.3 / 2013-10-30
+==================
+
+  * fix: catch localStorage security error when cookies are blocked (Chrome)
+  * add debug(err) support. Closes #46
+  * add .browser prop to package.json. Closes #42
+
+0.7.2 / 2013-02-06
+==================
+
+  * fix package.json
+  * fix: Mobile Safari (private mode) is broken with debug
+  * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
+
+0.7.1 / 2013-02-05
+==================
+
+  * add repository URL to package.json
+  * add DEBUG_COLORED to force colored output
+  * add browserify support
+  * fix component. Closes #24
+
+0.7.0 / 2012-05-04
+==================
+
+  * Added .component to package.json
+  * Added debug.component.js build
+
+0.6.0 / 2012-03-16
+==================
+
+  * Added support for "-" prefix in DEBUG [Vinay Pulim]
+  * Added `.enabled` flag to the node version [TooTallNate]
+
+0.5.0 / 2012-02-02
+==================
+
+  * Added: humanize diffs. Closes #8
+  * Added `debug.disable()` to the CS variant
+  * Removed padding. Closes #10
+  * Fixed: persist client-side variant again. Closes #9
+
+0.4.0 / 2012-02-01
+==================
+
+  * Added browser variant support for older browsers [TooTallNate]
+  * Added `debug.enable('project:*')` to browser variant [TooTallNate]
+  * Added padding to diff (moved it to the right)
+
+0.3.0 / 2012-01-26
+==================
+
+  * Added millisecond diff when isatty, otherwise UTC string
+
+0.2.0 / 2012-01-22
+==================
+
+  * Added wildcard support
+
+0.1.0 / 2011-12-02
+==================
+
+  * Added: remove colors unless stderr isatty [TooTallNate]
+
+0.0.1 / 2010-01-03
+==================
+
+  * Initial release
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/LICENSE b/legacy-libs/grpc/node_modules/needle/node_modules/debug/LICENSE
new file mode 100644 (file)
index 0000000..658c933
--- /dev/null
@@ -0,0 +1,19 @@
+(The MIT License)
+
+Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
+and associated documentation files (the 'Software'), to deal in the Software without restriction, 
+including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
+and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial 
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT 
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/README.md b/legacy-libs/grpc/node_modules/needle/node_modules/debug/README.md
new file mode 100644 (file)
index 0000000..0ee7634
--- /dev/null
@@ -0,0 +1,437 @@
+# debug
+[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
+[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+A tiny JavaScript debugging utility modelled after Node.js core's debugging
+technique. Works in Node.js and web browsers.
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example [_app.js_](./examples/node/app.js):
+
+```js
+var debug = require('debug')('http')
+  , http = require('http')
+  , name = 'My App';
+
+// fake app
+
+debug('booting %o', name);
+
+http.createServer(function(req, res){
+  debug(req.method + ' ' + req.url);
+  res.end('hello\n');
+}).listen(3000, function(){
+  debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example [_worker.js_](./examples/node/worker.js):
+
+```js
+var a = require('debug')('worker:a')
+  , b = require('debug')('worker:b');
+
+function work() {
+  a('doing lots of uninteresting work');
+  setTimeout(work, Math.random() * 1000);
+}
+
+work();
+
+function workb() {
+  b('doing some work');
+  setTimeout(workb, Math.random() * 2000);
+}
+
+workb();
+```
+
+The `DEBUG` environment variable is then used to enable these based on space or
+comma-delimited names.
+
+Here are some examples:
+
+<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
+
+#### Windows command prompt notes
+
+##### CMD
+
+On Windows the environment variable is set using the `set` command.
+
+```cmd
+set DEBUG=*,-not_this
+```
+
+Example:
+
+```cmd
+set DEBUG=* & node app.js
+```
+
+##### PowerShell (VS Code default)
+
+PowerShell uses different syntax to set environment variables.
+
+```cmd
+$env:DEBUG = "*,-not_this"
+```
+
+Example:
+
+```cmd
+$env:DEBUG='app';node app.js
+```
+
+Then, run the program to be debugged as usual.
+
+npm script example:
+```js
+  "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
+```
+
+## Namespace Colors
+
+Every debug instance has a color generated for it based on its namespace name.
+This helps when visually parsing the debug output to identify which debug instance
+a debug line belongs to.
+
+#### Node.js
+
+In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
+the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
+otherwise debug will only use a small handful of basic colors.
+
+<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
+
+#### Web Browser
+
+Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+option. These are WebKit web inspectors, Firefox ([since version
+31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+and the Firebug plugin for Firefox (any version).
+
+<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
+
+
+## Millisecond diff
+
+When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
+
+
+## Conventions
+
+If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".  If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable.  You can then use it for normal output as well as debug output.
+
+## Wildcards
+
+The `*` character may be used as a wildcard. Suppose for example your library has
+debuggers named "connect:bodyParser", "connect:compress", "connect:session",
+instead of listing all three with
+`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
+`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+You can also exclude specific debuggers by prefixing them with a "-" character.
+For example, `DEBUG=*,-connect:*` would include all debuggers except those
+starting with "connect:".
+
+## Environment Variables
+
+When running through Node.js, you can set a few environment variables that will
+change the behavior of the debug logging:
+
+| Name      | Purpose                                         |
+|-----------|-------------------------------------------------|
+| `DEBUG`   | Enables/disables specific debugging namespaces. |
+| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY).  |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth.                    |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+__Note:__ The environment variables beginning with `DEBUG_` end up being
+converted into an Options object that gets used with `%o`/`%O` formatters.
+See the Node.js documentation for
+[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+for the complete list.
+
+## Formatters
+
+Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
+Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O`      | Pretty-print an Object on multiple lines. |
+| `%o`      | Pretty-print an Object all on a single line. |
+| `%s`      | String. |
+| `%d`      | Number (both integer and float). |
+| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%`      | Single percent sign ('%'). This does not consume an argument. |
+
+
+### Custom formatters
+
+You can add custom formatters by extending the `debug.formatters` object.
+For example, if you wanted to add support for rendering a Buffer as hex with
+`%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+  return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+
+## Browser Support
+
+You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+if you don't want to build it yourself.
+
+Debug's enable state is currently persisted by `localStorage`.
+Consider the situation shown below where you have `worker:a` and `worker:b`,
+and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+  a('doing some work');
+}, 1000);
+
+setInterval(function(){
+  b('doing some work');
+}, 1200);
+```
+
+
+## Output streams
+
+  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example [_stdout.js_](./examples/node/stdout.js):
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+## Extend
+You can simply extend debugger 
+```js
+const log = require('debug')('auth');
+
+//creates new debug instance with extended namespace
+const logSign = log.extend('sign');
+const logLogin = log.extend('login');
+
+log('hello'); // auth hello
+logSign('hello'); //auth:sign hello
+logLogin('hello'); //auth:login hello
+```
+
+## Set dynamically
+
+You can also enable debug dynamically by calling the `enable()` method :
+
+```js
+let debug = require('debug');
+
+console.log(1, debug.enabled('test'));
+
+debug.enable('test');
+console.log(2, debug.enabled('test'));
+
+debug.disable();
+console.log(3, debug.enabled('test'));
+
+```
+
+print :   
+```
+1 false
+2 true
+3 false
+```
+
+Usage :  
+`enable(namespaces)`  
+`namespaces` can include modes separated by a colon and wildcards.
+   
+Note that calling `enable()` completely overrides previously set DEBUG variable : 
+
+```
+$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
+=> false
+```
+
+## Checking whether a debug target is enabled
+
+After you've created a debug instance, you can determine whether or not it is
+enabled by checking the `enabled` property:
+
+```javascript
+const debug = require('debug')('http');
+
+if (debug.enabled) {
+  // do stuff...
+}
+```
+
+You can also manually toggle this property to force the debug instance to be
+enabled or disabled.
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/node.js b/legacy-libs/grpc/node_modules/needle/node_modules/debug/node.js
new file mode 100644 (file)
index 0000000..7fc36fe
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./src/node');
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/package.json b/legacy-libs/grpc/node_modules/needle/node_modules/debug/package.json
new file mode 100644 (file)
index 0000000..0b6ab5d
--- /dev/null
@@ -0,0 +1,94 @@
+{
+  "_from": "debug@^3.2.6",
+  "_id": "debug@3.2.6",
+  "_inBundle": false,
+  "_integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
+  "_location": "/grpc/needle/debug",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "debug@^3.2.6",
+    "name": "debug",
+    "escapedName": "debug",
+    "rawSpec": "^3.2.6",
+    "saveSpec": null,
+    "fetchSpec": "^3.2.6"
+  },
+  "_requiredBy": [
+    "/grpc/needle"
+  ],
+  "_resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
+  "_shasum": "e83d17de16d8a7efb7717edbe5fb10135eee629b",
+  "_shrinkwrap": null,
+  "_spec": "debug@^3.2.6",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/needle",
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca"
+  },
+  "browser": "./src/browser.js",
+  "bugs": {
+    "url": "https://github.com/visionmedia/debug/issues"
+  },
+  "bundleDependencies": false,
+  "contributors": [
+    {
+      "name": "Nathan Rajlich",
+      "email": "nathan@tootallnate.net",
+      "url": "http://n8.io"
+    },
+    {
+      "name": "Andrew Rhyne",
+      "email": "rhyneandrew@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ms": "^2.1.1"
+  },
+  "deprecated": false,
+  "description": "small debugging utility",
+  "devDependencies": {
+    "@babel/cli": "^7.0.0",
+    "@babel/core": "^7.0.0",
+    "@babel/preset-env": "^7.0.0",
+    "browserify": "14.4.0",
+    "chai": "^3.5.0",
+    "concurrently": "^3.1.0",
+    "coveralls": "^3.0.2",
+    "istanbul": "^0.4.5",
+    "karma": "^3.0.0",
+    "karma-chai": "^0.1.0",
+    "karma-mocha": "^1.3.0",
+    "karma-phantomjs-launcher": "^1.0.2",
+    "mocha": "^5.2.0",
+    "mocha-lcov-reporter": "^1.2.0",
+    "rimraf": "^2.5.4",
+    "xo": "^0.23.0"
+  },
+  "files": [
+    "src",
+    "node.js",
+    "dist/debug.js",
+    "LICENSE",
+    "README.md"
+  ],
+  "homepage": "https://github.com/visionmedia/debug#readme",
+  "keywords": [
+    "debug",
+    "log",
+    "debugger"
+  ],
+  "license": "MIT",
+  "main": "./src/index.js",
+  "name": "debug",
+  "optionalDependencies": {},
+  "readme": "# debug\n[![Build Status](https://travis-ci.org/visionmedia/debug.svg?branch=master)](https://travis-ci.org/visionmedia/debug)  [![Coverage Status](https://coveralls.io/repos/github/visionmedia/debug/badge.svg?branch=master)](https://coveralls.io/github/visionmedia/debug?branch=master)  [![Slack](https://visionmedia-community-slackin.now.sh/badge.svg)](https://visionmedia-community-slackin.now.sh/) [![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)\n[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)\n\n<img width=\"647\" src=\"https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png\">\n\nA tiny JavaScript debugging utility modelled after Node.js core's debugging\ntechnique. Works in Node.js and web browsers.\n\n## Installation\n\n```bash\n$ npm install debug\n```\n\n## Usage\n\n`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.\n\nExample [_app.js_](./examples/node/app.js):\n\n```js\nvar debug = require('debug')('http')\n  , http = require('http')\n  , name = 'My App';\n\n// fake app\n\ndebug('booting %o', name);\n\nhttp.createServer(function(req, res){\n  debug(req.method + ' ' + req.url);\n  res.end('hello\\n');\n}).listen(3000, function(){\n  debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample [_worker.js_](./examples/node/worker.js):\n\n```js\nvar a = require('debug')('worker:a')\n  , b = require('debug')('worker:b');\n\nfunction work() {\n  a('doing lots of uninteresting work');\n  setTimeout(work, Math.random() * 1000);\n}\n\nwork();\n\nfunction workb() {\n  b('doing some work');\n  setTimeout(workb, Math.random() * 2000);\n}\n\nworkb();\n```\n\nThe `DEBUG` environment variable is then used to enable these based on space or\ncomma-delimited names.\n\nHere are some examples:\n\n<img width=\"647\" alt=\"screen shot 2017-08-08 at 12 53 04 pm\" src=\"https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png\">\n<img width=\"647\" alt=\"screen shot 2017-08-08 at 12 53 38 pm\" src=\"https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png\">\n<img width=\"647\" alt=\"screen shot 2017-08-08 at 12 53 25 pm\" src=\"https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png\">\n\n#### Windows command prompt notes\n\n##### CMD\n\nOn Windows the environment variable is set using the `set` command.\n\n```cmd\nset DEBUG=*,-not_this\n```\n\nExample:\n\n```cmd\nset DEBUG=* & node app.js\n```\n\n##### PowerShell (VS Code default)\n\nPowerShell uses different syntax to set environment variables.\n\n```cmd\n$env:DEBUG = \"*,-not_this\"\n```\n\nExample:\n\n```cmd\n$env:DEBUG='app';node app.js\n```\n\nThen, run the program to be debugged as usual.\n\nnpm script example:\n```js\n  \"windowsDebug\": \"@powershell -Command $env:DEBUG='*';node app.js\",\n```\n\n## Namespace Colors\n\nEvery debug instance has a color generated for it based on its namespace name.\nThis helps when visually parsing the debug output to identify which debug instance\na debug line belongs to.\n\n#### Node.js\n\nIn Node.js, colors are enabled when stderr is a TTY. You also _should_ install\nthe [`supports-color`](https://npmjs.org/supports-color) module alongside debug,\notherwise debug will only use a small handful of basic colors.\n\n<img width=\"521\" src=\"https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png\">\n\n#### Web Browser\n\nColors are also enabled on \"Web Inspectors\" that understand the `%c` formatting\noption. These are WebKit web inspectors, Firefox ([since version\n31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))\nand the Firebug plugin for Firefox (any version).\n\n<img width=\"524\" src=\"https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png\">\n\n\n## Millisecond diff\n\nWhen actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n<img width=\"647\" src=\"https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png\">\n\nWhen stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:\n\n<img width=\"647\" src=\"https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png\">\n\n\n## Conventions\n\nIf you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\".  If you append a \"*\" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable.  You can then use it for normal output as well as debug output.\n\n## Wildcards\n\nThe `*` character may be used as a wildcard. Suppose for example your library has\ndebuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\",\ninstead of listing all three with\n`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do\n`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\nYou can also exclude specific debuggers by prefixing them with a \"-\" character.\nFor example, `DEBUG=*,-connect:*` would include all debuggers except those\nstarting with \"connect:\".\n\n## Environment Variables\n\nWhen running through Node.js, you can set a few environment variables that will\nchange the behavior of the debug logging:\n\n| Name      | Purpose                                         |\n|-----------|-------------------------------------------------|\n| `DEBUG`   | Enables/disables specific debugging namespaces. |\n| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY).  |\n| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |\n| `DEBUG_DEPTH` | Object inspection depth.                    |\n| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |\n\n\n__Note:__ The environment variables beginning with `DEBUG_` end up being\nconverted into an Options object that gets used with `%o`/`%O` formatters.\nSee the Node.js documentation for\n[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)\nfor the complete list.\n\n## Formatters\n\nDebug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.\nBelow are the officially supported formatters:\n\n| Formatter | Representation |\n|-----------|----------------|\n| `%O`      | Pretty-print an Object on multiple lines. |\n| `%o`      | Pretty-print an Object all on a single line. |\n| `%s`      | String. |\n| `%d`      | Number (both integer and float). |\n| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |\n| `%%`      | Single percent sign ('%'). This does not consume an argument. |\n\n\n### Custom formatters\n\nYou can add custom formatters by extending the `debug.formatters` object.\nFor example, if you wanted to add support for rendering a Buffer as hex with\n`%h`, you could do something like:\n\n```js\nconst createDebug = require('debug')\ncreateDebug.formatters.h = (v) => {\n  return v.toString('hex')\n}\n\n// …elsewhere\nconst debug = createDebug('foo')\ndebug('this is hex: %h', new Buffer('hello world'))\n//   foo this is hex: 68656c6c6f20776f726c6421 +0ms\n```\n\n\n## Browser Support\n\nYou can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),\nor just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),\nif you don't want to build it yourself.\n\nDebug's enable state is currently persisted by `localStorage`.\nConsider the situation shown below where you have `worker:a` and `worker:b`,\nand wish to debug both. You can enable this using `localStorage.debug`:\n\n```js\nlocalStorage.debug = 'worker:*'\n```\n\nAnd then refresh the page.\n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n  a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n  b('doing some work');\n}, 1200);\n```\n\n\n## Output streams\n\n  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:\n\nExample [_stdout.js_](./examples/node/stdout.js):\n\n```js\nvar debug = require('debug');\nvar error = debug('app:error');\n\n// by default stderr is used\nerror('goes to stderr!');\n\nvar log = debug('app:log');\n// set this namespace to log via console.log\nlog.log = console.log.bind(console); // don't forget to bind to console!\nlog('goes to stdout');\nerror('still goes to stderr!');\n\n// set all output to go via console.info\n// overrides all per-namespace log settings\ndebug.log = console.info.bind(console);\nerror('now goes to stdout via console.info');\nlog('still goes to stdout, but via console.info now');\n```\n\n## Extend\nYou can simply extend debugger \n```js\nconst log = require('debug')('auth');\n\n//creates new debug instance with extended namespace\nconst logSign = log.extend('sign');\nconst logLogin = log.extend('login');\n\nlog('hello'); // auth hello\nlogSign('hello'); //auth:sign hello\nlogLogin('hello'); //auth:login hello\n```\n\n## Set dynamically\n\nYou can also enable debug dynamically by calling the `enable()` method :\n\n```js\nlet debug = require('debug');\n\nconsole.log(1, debug.enabled('test'));\n\ndebug.enable('test');\nconsole.log(2, debug.enabled('test'));\n\ndebug.disable();\nconsole.log(3, debug.enabled('test'));\n\n```\n\nprint :   \n```\n1 false\n2 true\n3 false\n```\n\nUsage :  \n`enable(namespaces)`  \n`namespaces` can include modes separated by a colon and wildcards.\n   \nNote that calling `enable()` completely overrides previously set DEBUG variable : \n\n```\n$ DEBUG=foo node -e 'var dbg = require(\"debug\"); dbg.enable(\"bar\"); console.log(dbg.enabled(\"foo\"))'\n=> false\n```\n\n## Checking whether a debug target is enabled\n\nAfter you've created a debug instance, you can determine whether or not it is\nenabled by checking the `enabled` property:\n\n```javascript\nconst debug = require('debug')('http');\n\nif (debug.enabled) {\n  // do stuff...\n}\n```\n\nYou can also manually toggle this property to force the debug instance to be\nenabled or disabled.\n\n\n## Authors\n\n - TJ Holowaychuk\n - Nathan Rajlich\n - Andrew Rhyne\n\n## Backers\n\nSupport us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]\n\n<a href=\"https://opencollective.com/debug/backer/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/9/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/10/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/10/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/11/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/11/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/12/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/12/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/13/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/13/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/14/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/14/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/15/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/15/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/16/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/16/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/17/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/17/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/18/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/18/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/19/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/19/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/20/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/20/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/21/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/21/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/22/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/22/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/23/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/23/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/24/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/24/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/25/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/25/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/26/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/26/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/27/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/27/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/28/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/28/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/backer/29/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/backer/29/avatar.svg\"></a>\n\n\n## Sponsors\n\nBecome a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]\n\n<a href=\"https://opencollective.com/debug/sponsor/0/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/0/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/1/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/1/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/2/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/2/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/3/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/3/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/4/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/4/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/5/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/5/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/6/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/6/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/7/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/7/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/8/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/8/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/9/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/9/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/10/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/10/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/11/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/11/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/12/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/12/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/13/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/13/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/14/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/14/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/15/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/15/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/16/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/16/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/17/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/17/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/18/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/18/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/19/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/19/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/20/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/20/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/21/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/21/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/22/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/22/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/23/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/23/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/24/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/24/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/25/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/25/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/26/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/26/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/27/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/27/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/28/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/28/avatar.svg\"></a>\n<a href=\"https://opencollective.com/debug/sponsor/29/website\" target=\"_blank\"><img src=\"https://opencollective.com/debug/sponsor/29/avatar.svg\"></a>\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/debug.git"
+  },
+  "unpkg": "./dist/debug.js",
+  "version": "3.2.6"
+}
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/browser.js b/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/browser.js
new file mode 100644 (file)
index 0000000..c924b0a
--- /dev/null
@@ -0,0 +1,180 @@
+"use strict";
+
+function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
+
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+/**
+ * Colors.
+ */
+
+exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+// eslint-disable-next-line complexity
+
+function useColors() {
+  // NB: In an Electron preload script, document will be defined but not fully
+  // initialized. Since we know we're in Chrome, we'll just detect this case
+  // explicitly
+  if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+    return true;
+  } // Internet Explorer and Edge do not support colors.
+
+
+  if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+    return false;
+  } // Is webkit? http://stackoverflow.com/a/16459606/376773
+  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+
+
+  return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
+  typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
+  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+  typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
+  typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
+}
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+
+function formatArgs(args) {
+  args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
+
+  if (!this.useColors) {
+    return;
+  }
+
+  var c = 'color: ' + this.color;
+  args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
+  // arguments passed either before or after the %c, so we need to
+  // figure out the correct index to insert the CSS into
+
+  var index = 0;
+  var lastC = 0;
+  args[0].replace(/%[a-zA-Z%]/g, function (match) {
+    if (match === '%%') {
+      return;
+    }
+
+    index++;
+
+    if (match === '%c') {
+      // We only are interested in the *last* %c
+      // (the user may have provided their own)
+      lastC = index;
+    }
+  });
+  args.splice(lastC, 0, c);
+}
+/**
+ * Invokes `console.log()` when available.
+ * No-op when `console.log` is not a "function".
+ *
+ * @api public
+ */
+
+
+function log() {
+  var _console;
+
+  // This hackery is required for IE8/9, where
+  // the `console.log` function doesn't have 'apply'
+  return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
+}
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+
+function save(namespaces) {
+  try {
+    if (namespaces) {
+      exports.storage.setItem('debug', namespaces);
+    } else {
+      exports.storage.removeItem('debug');
+    }
+  } catch (error) {// Swallow
+    // XXX (@Qix-) should we be logging these?
+  }
+}
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+
+function load() {
+  var r;
+
+  try {
+    r = exports.storage.getItem('debug');
+  } catch (error) {} // Swallow
+  // XXX (@Qix-) should we be logging these?
+  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+
+
+  if (!r && typeof process !== 'undefined' && 'env' in process) {
+    r = process.env.DEBUG;
+  }
+
+  return r;
+}
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+
+function localstorage() {
+  try {
+    // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+    // The Browser also has localStorage in the global context.
+    return localStorage;
+  } catch (error) {// Swallow
+    // XXX (@Qix-) should we be logging these?
+  }
+}
+
+module.exports = require('./common')(exports);
+var formatters = module.exports.formatters;
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+  try {
+    return JSON.stringify(v);
+  } catch (error) {
+    return '[UnexpectedJSONParseError]: ' + error.message;
+  }
+};
+
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/common.js b/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/common.js
new file mode 100644 (file)
index 0000000..e0de3fb
--- /dev/null
@@ -0,0 +1,249 @@
+"use strict";
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+function setup(env) {
+  createDebug.debug = createDebug;
+  createDebug.default = createDebug;
+  createDebug.coerce = coerce;
+  createDebug.disable = disable;
+  createDebug.enable = enable;
+  createDebug.enabled = enabled;
+  createDebug.humanize = require('ms');
+  Object.keys(env).forEach(function (key) {
+    createDebug[key] = env[key];
+  });
+  /**
+  * Active `debug` instances.
+  */
+
+  createDebug.instances = [];
+  /**
+  * The currently active debug mode names, and names to skip.
+  */
+
+  createDebug.names = [];
+  createDebug.skips = [];
+  /**
+  * Map of special "%n" handling functions, for the debug "format" argument.
+  *
+  * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+  */
+
+  createDebug.formatters = {};
+  /**
+  * Selects a color for a debug namespace
+  * @param {String} namespace The namespace string for the for the debug instance to be colored
+  * @return {Number|String} An ANSI color code for the given namespace
+  * @api private
+  */
+
+  function selectColor(namespace) {
+    var hash = 0;
+
+    for (var i = 0; i < namespace.length; i++) {
+      hash = (hash << 5) - hash + namespace.charCodeAt(i);
+      hash |= 0; // Convert to 32bit integer
+    }
+
+    return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+  }
+
+  createDebug.selectColor = selectColor;
+  /**
+  * Create a debugger with the given `namespace`.
+  *
+  * @param {String} namespace
+  * @return {Function}
+  * @api public
+  */
+
+  function createDebug(namespace) {
+    var prevTime;
+
+    function debug() {
+      // Disabled?
+      if (!debug.enabled) {
+        return;
+      }
+
+      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
+        args[_key] = arguments[_key];
+      }
+
+      var self = debug; // Set `diff` timestamp
+
+      var curr = Number(new Date());
+      var ms = curr - (prevTime || curr);
+      self.diff = ms;
+      self.prev = prevTime;
+      self.curr = curr;
+      prevTime = curr;
+      args[0] = createDebug.coerce(args[0]);
+
+      if (typeof args[0] !== 'string') {
+        // Anything else let's inspect with %O
+        args.unshift('%O');
+      } // Apply any `formatters` transformations
+
+
+      var index = 0;
+      args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
+        // If we encounter an escaped % then don't increase the array index
+        if (match === '%%') {
+          return match;
+        }
+
+        index++;
+        var formatter = createDebug.formatters[format];
+
+        if (typeof formatter === 'function') {
+          var val = args[index];
+          match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
+
+          args.splice(index, 1);
+          index--;
+        }
+
+        return match;
+      }); // Apply env-specific formatting (colors, etc.)
+
+      createDebug.formatArgs.call(self, args);
+      var logFn = self.log || createDebug.log;
+      logFn.apply(self, args);
+    }
+
+    debug.namespace = namespace;
+    debug.enabled = createDebug.enabled(namespace);
+    debug.useColors = createDebug.useColors();
+    debug.color = selectColor(namespace);
+    debug.destroy = destroy;
+    debug.extend = extend; // Debug.formatArgs = formatArgs;
+    // debug.rawLog = rawLog;
+    // env-specific initialization logic for debug instances
+
+    if (typeof createDebug.init === 'function') {
+      createDebug.init(debug);
+    }
+
+    createDebug.instances.push(debug);
+    return debug;
+  }
+
+  function destroy() {
+    var index = createDebug.instances.indexOf(this);
+
+    if (index !== -1) {
+      createDebug.instances.splice(index, 1);
+      return true;
+    }
+
+    return false;
+  }
+
+  function extend(namespace, delimiter) {
+    return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+  }
+  /**
+  * Enables a debug mode by namespaces. This can include modes
+  * separated by a colon and wildcards.
+  *
+  * @param {String} namespaces
+  * @api public
+  */
+
+
+  function enable(namespaces) {
+    createDebug.save(namespaces);
+    createDebug.names = [];
+    createDebug.skips = [];
+    var i;
+    var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+    var len = split.length;
+
+    for (i = 0; i < len; i++) {
+      if (!split[i]) {
+        // ignore empty strings
+        continue;
+      }
+
+      namespaces = split[i].replace(/\*/g, '.*?');
+
+      if (namespaces[0] === '-') {
+        createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
+      } else {
+        createDebug.names.push(new RegExp('^' + namespaces + '$'));
+      }
+    }
+
+    for (i = 0; i < createDebug.instances.length; i++) {
+      var instance = createDebug.instances[i];
+      instance.enabled = createDebug.enabled(instance.namespace);
+    }
+  }
+  /**
+  * Disable debug output.
+  *
+  * @api public
+  */
+
+
+  function disable() {
+    createDebug.enable('');
+  }
+  /**
+  * Returns true if the given mode name is enabled, false otherwise.
+  *
+  * @param {String} name
+  * @return {Boolean}
+  * @api public
+  */
+
+
+  function enabled(name) {
+    if (name[name.length - 1] === '*') {
+      return true;
+    }
+
+    var i;
+    var len;
+
+    for (i = 0, len = createDebug.skips.length; i < len; i++) {
+      if (createDebug.skips[i].test(name)) {
+        return false;
+      }
+    }
+
+    for (i = 0, len = createDebug.names.length; i < len; i++) {
+      if (createDebug.names[i].test(name)) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+  /**
+  * Coerce `val`.
+  *
+  * @param {Mixed} val
+  * @return {Mixed}
+  * @api private
+  */
+
+
+  function coerce(val) {
+    if (val instanceof Error) {
+      return val.stack || val.message;
+    }
+
+    return val;
+  }
+
+  createDebug.enable(createDebug.load());
+  return createDebug;
+}
+
+module.exports = setup;
+
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/index.js b/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/index.js
new file mode 100644 (file)
index 0000000..0217315
--- /dev/null
@@ -0,0 +1,12 @@
+"use strict";
+
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+  module.exports = require('./browser.js');
+} else {
+  module.exports = require('./node.js');
+}
+
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/node.js b/legacy-libs/grpc/node_modules/needle/node_modules/debug/src/node.js
new file mode 100644 (file)
index 0000000..dbbb5f1
--- /dev/null
@@ -0,0 +1,174 @@
+"use strict";
+
+/**
+ * Module dependencies.
+ */
+var tty = require('tty');
+
+var util = require('util');
+/**
+ * This is the Node.js implementation of `debug()`.
+ */
+
+
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+try {
+  // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+  // eslint-disable-next-line import/no-extraneous-dependencies
+  var supportsColor = require('supports-color');
+
+  if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+    exports.colors = [20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68, 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134, 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 214, 215, 220, 221];
+  }
+} catch (error) {} // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+
+exports.inspectOpts = Object.keys(process.env).filter(function (key) {
+  return /^debug_/i.test(key);
+}).reduce(function (obj, key) {
+  // Camel-case
+  var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function (_, k) {
+    return k.toUpperCase();
+  }); // Coerce string value into JS value
+
+  var val = process.env[key];
+
+  if (/^(yes|on|true|enabled)$/i.test(val)) {
+    val = true;
+  } else if (/^(no|off|false|disabled)$/i.test(val)) {
+    val = false;
+  } else if (val === 'null') {
+    val = null;
+  } else {
+    val = Number(val);
+  }
+
+  obj[prop] = val;
+  return obj;
+}, {});
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+  return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
+}
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+
+function formatArgs(args) {
+  var name = this.namespace,
+      useColors = this.useColors;
+
+  if (useColors) {
+    var c = this.color;
+    var colorCode = "\x1B[3" + (c < 8 ? c : '8;5;' + c);
+    var prefix = "  ".concat(colorCode, ";1m").concat(name, " \x1B[0m");
+    args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+    args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + "\x1B[0m");
+  } else {
+    args[0] = getDate() + name + ' ' + args[0];
+  }
+}
+
+function getDate() {
+  if (exports.inspectOpts.hideDate) {
+    return '';
+  }
+
+  return new Date().toISOString() + ' ';
+}
+/**
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
+ */
+
+
+function log() {
+  return process.stderr.write(util.format.apply(util, arguments) + '\n');
+}
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+
+
+function save(namespaces) {
+  if (namespaces) {
+    process.env.DEBUG = namespaces;
+  } else {
+    // If you set a process.env field to null or undefined, it gets cast to the
+    // string 'null' or 'undefined'. Just delete instead.
+    delete process.env.DEBUG;
+  }
+}
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+
+function load() {
+  return process.env.DEBUG;
+}
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+
+function init(debug) {
+  debug.inspectOpts = {};
+  var keys = Object.keys(exports.inspectOpts);
+
+  for (var i = 0; i < keys.length; i++) {
+    debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+  }
+}
+
+module.exports = require('./common')(exports);
+var formatters = module.exports.formatters;
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+formatters.o = function (v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts).replace(/\s*\n\s*/g, ' ');
+};
+/**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+
+formatters.O = function (v) {
+  this.inspectOpts.colors = this.useColors;
+  return util.inspect(v, this.inspectOpts);
+};
+
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/ms/index.js b/legacy-libs/grpc/node_modules/needle/node_modules/ms/index.js
new file mode 100644 (file)
index 0000000..c4498bc
--- /dev/null
@@ -0,0 +1,162 @@
+/**
+ * Helpers.
+ */
+
+var s = 1000;
+var m = s * 60;
+var h = m * 60;
+var d = h * 24;
+var w = d * 7;
+var y = d * 365.25;
+
+/**
+ * Parse or format the given `val`.
+ *
+ * Options:
+ *
+ *  - `long` verbose formatting [false]
+ *
+ * @param {String|Number} val
+ * @param {Object} [options]
+ * @throws {Error} throw an error if val is not a non-empty string or a number
+ * @return {String|Number}
+ * @api public
+ */
+
+module.exports = function(val, options) {
+  options = options || {};
+  var type = typeof val;
+  if (type === 'string' && val.length > 0) {
+    return parse(val);
+  } else if (type === 'number' && isFinite(val)) {
+    return options.long ? fmtLong(val) : fmtShort(val);
+  }
+  throw new Error(
+    'val is not a non-empty string or a valid number. val=' +
+      JSON.stringify(val)
+  );
+};
+
+/**
+ * Parse the given `str` and return milliseconds.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function parse(str) {
+  str = String(str);
+  if (str.length > 100) {
+    return;
+  }
+  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+    str
+  );
+  if (!match) {
+    return;
+  }
+  var n = parseFloat(match[1]);
+  var type = (match[2] || 'ms').toLowerCase();
+  switch (type) {
+    case 'years':
+    case 'year':
+    case 'yrs':
+    case 'yr':
+    case 'y':
+      return n * y;
+    case 'weeks':
+    case 'week':
+    case 'w':
+      return n * w;
+    case 'days':
+    case 'day':
+    case 'd':
+      return n * d;
+    case 'hours':
+    case 'hour':
+    case 'hrs':
+    case 'hr':
+    case 'h':
+      return n * h;
+    case 'minutes':
+    case 'minute':
+    case 'mins':
+    case 'min':
+    case 'm':
+      return n * m;
+    case 'seconds':
+    case 'second':
+    case 'secs':
+    case 'sec':
+    case 's':
+      return n * s;
+    case 'milliseconds':
+    case 'millisecond':
+    case 'msecs':
+    case 'msec':
+    case 'ms':
+      return n;
+    default:
+      return undefined;
+  }
+}
+
+/**
+ * Short format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtShort(ms) {
+  var msAbs = Math.abs(ms);
+  if (msAbs >= d) {
+    return Math.round(ms / d) + 'd';
+  }
+  if (msAbs >= h) {
+    return Math.round(ms / h) + 'h';
+  }
+  if (msAbs >= m) {
+    return Math.round(ms / m) + 'm';
+  }
+  if (msAbs >= s) {
+    return Math.round(ms / s) + 's';
+  }
+  return ms + 'ms';
+}
+
+/**
+ * Long format for `ms`.
+ *
+ * @param {Number} ms
+ * @return {String}
+ * @api private
+ */
+
+function fmtLong(ms) {
+  var msAbs = Math.abs(ms);
+  if (msAbs >= d) {
+    return plural(ms, msAbs, d, 'day');
+  }
+  if (msAbs >= h) {
+    return plural(ms, msAbs, h, 'hour');
+  }
+  if (msAbs >= m) {
+    return plural(ms, msAbs, m, 'minute');
+  }
+  if (msAbs >= s) {
+    return plural(ms, msAbs, s, 'second');
+  }
+  return ms + ' ms';
+}
+
+/**
+ * Pluralization helper.
+ */
+
+function plural(ms, msAbs, n, name) {
+  var isPlural = msAbs >= n * 1.5;
+  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+}
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/ms/license.md b/legacy-libs/grpc/node_modules/needle/node_modules/ms/license.md
new file mode 100644 (file)
index 0000000..69b6125
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Zeit, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/ms/package.json b/legacy-libs/grpc/node_modules/needle/node_modules/ms/package.json
new file mode 100644 (file)
index 0000000..71ca8d8
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "_from": "ms@^2.1.1",
+  "_id": "ms@2.1.2",
+  "_inBundle": false,
+  "_integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+  "_location": "/grpc/needle/ms",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "ms@^2.1.1",
+    "name": "ms",
+    "escapedName": "ms",
+    "rawSpec": "^2.1.1",
+    "saveSpec": null,
+    "fetchSpec": "^2.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/needle/debug"
+  ],
+  "_resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+  "_shasum": "d09d1f357b443f493382a8eb3ccd183872ae6009",
+  "_shrinkwrap": null,
+  "_spec": "ms@^2.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/needle/node_modules/debug",
+  "bugs": {
+    "url": "https://github.com/zeit/ms/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Tiny millisecond conversion utility",
+  "devDependencies": {
+    "eslint": "4.12.1",
+    "expect.js": "0.3.1",
+    "husky": "0.14.3",
+    "lint-staged": "5.0.0",
+    "mocha": "4.0.1"
+  },
+  "eslintConfig": {
+    "extends": "eslint:recommended",
+    "env": {
+      "node": true,
+      "es6": true
+    }
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/zeit/ms#readme",
+  "license": "MIT",
+  "lint-staged": {
+    "*.js": [
+      "npm run lint",
+      "prettier --single-quote --write",
+      "git add"
+    ]
+  },
+  "main": "./index",
+  "name": "ms",
+  "optionalDependencies": {},
+  "readme": "# ms\n\n[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)\n[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)\n\nUse this package to easily convert various time formats to milliseconds.\n\n## Examples\n\n```js\nms('2 days')  // 172800000\nms('1d')      // 86400000\nms('10h')     // 36000000\nms('2.5 hrs') // 9000000\nms('2h')      // 7200000\nms('1m')      // 60000\nms('5s')      // 5000\nms('1y')      // 31557600000\nms('100')     // 100\nms('-3 days') // -259200000\nms('-1h')     // -3600000\nms('-200')    // -200\n```\n\n### Convert from Milliseconds\n\n```js\nms(60000)             // \"1m\"\nms(2 * 60000)         // \"2m\"\nms(-3 * 60000)        // \"-3m\"\nms(ms('10 hours'))    // \"10h\"\n```\n\n### Time Format Written-Out\n\n```js\nms(60000, { long: true })             // \"1 minute\"\nms(2 * 60000, { long: true })         // \"2 minutes\"\nms(-3 * 60000, { long: true })        // \"-3 minutes\"\nms(ms('10 hours'), { long: true })    // \"10 hours\"\n```\n\n## Features\n\n- Works both in [Node.js](https://nodejs.org) and in the browser\n- If a number is supplied to `ms`, a string with a unit is returned\n- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)\n- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned\n\n## Related Packages\n\n- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.\n\n## Caught a Bug?\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device\n2. Link the package to the global module directory: `npm link`\n3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!\n\nAs always, you can run the tests using: `npm test`\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/zeit/ms.git"
+  },
+  "scripts": {
+    "lint": "eslint lib/* bin/*",
+    "precommit": "lint-staged",
+    "test": "mocha tests.js"
+  },
+  "version": "2.1.2"
+}
diff --git a/legacy-libs/grpc/node_modules/needle/node_modules/ms/readme.md b/legacy-libs/grpc/node_modules/needle/node_modules/ms/readme.md
new file mode 100644 (file)
index 0000000..9a1996b
--- /dev/null
@@ -0,0 +1,60 @@
+# ms
+
+[![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms)
+[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)
+
+Use this package to easily convert various time formats to milliseconds.
+
+## Examples
+
+```js
+ms('2 days')  // 172800000
+ms('1d')      // 86400000
+ms('10h')     // 36000000
+ms('2.5 hrs') // 9000000
+ms('2h')      // 7200000
+ms('1m')      // 60000
+ms('5s')      // 5000
+ms('1y')      // 31557600000
+ms('100')     // 100
+ms('-3 days') // -259200000
+ms('-1h')     // -3600000
+ms('-200')    // -200
+```
+
+### Convert from Milliseconds
+
+```js
+ms(60000)             // "1m"
+ms(2 * 60000)         // "2m"
+ms(-3 * 60000)        // "-3m"
+ms(ms('10 hours'))    // "10h"
+```
+
+### Time Format Written-Out
+
+```js
+ms(60000, { long: true })             // "1 minute"
+ms(2 * 60000, { long: true })         // "2 minutes"
+ms(-3 * 60000, { long: true })        // "-3 minutes"
+ms(ms('10 hours'), { long: true })    // "10 hours"
+```
+
+## Features
+
+- Works both in [Node.js](https://nodejs.org) and in the browser
+- If a number is supplied to `ms`, a string with a unit is returned
+- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
+- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
+
+## Related Packages
+
+- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
+
+## Caught a Bug?
+
+1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
+2. Link the package to the global module directory: `npm link`
+3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
+
+As always, you can run the tests using: `npm test`
diff --git a/legacy-libs/grpc/node_modules/needle/package.json b/legacy-libs/grpc/node_modules/needle/package.json
new file mode 100644 (file)
index 0000000..1527e38
--- /dev/null
@@ -0,0 +1,106 @@
+{
+  "_from": "needle@^2.2.1",
+  "_id": "needle@2.4.0",
+  "_inBundle": false,
+  "_integrity": "sha512-4Hnwzr3mi5L97hMYeNl8wRW/Onhy4nUKR/lVemJ8gJedxxUyBLm9kkrDColJvoSfwi0jCNhD+xCdOtiGDQiRZg==",
+  "_location": "/grpc/needle",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "needle@^2.2.1",
+    "name": "needle",
+    "escapedName": "needle",
+    "rawSpec": "^2.2.1",
+    "saveSpec": null,
+    "fetchSpec": "^2.2.1"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/needle/-/needle-2.4.0.tgz",
+  "_shasum": "6833e74975c444642590e15a750288c5f939b57c",
+  "_shrinkwrap": null,
+  "_spec": "needle@^2.2.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/node-pre-gyp",
+  "author": {
+    "name": "Tomás Pollak",
+    "email": "tomas@forkhq.com"
+  },
+  "bin": {
+    "needle": "./bin/needle"
+  },
+  "bugs": {
+    "url": "https://github.com/tomas/needle/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "debug": "^3.2.6",
+    "iconv-lite": "^0.4.4",
+    "sax": "^1.2.4"
+  },
+  "deprecated": false,
+  "description": "The leanest and most handsome HTTP client in the Nodelands.",
+  "devDependencies": {
+    "JSONStream": "^1.3.5",
+    "jschardet": "^1.6.0",
+    "mocha": "^5.2.0",
+    "q": "^1.5.1",
+    "should": "^13.2.3",
+    "sinon": "^2.3.0",
+    "xml2js": "^0.4.19"
+  },
+  "directories": {
+    "lib": "./lib"
+  },
+  "engines": {
+    "node": ">= 4.4.x"
+  },
+  "homepage": "https://github.com/tomas/needle#readme",
+  "keywords": [
+    "http",
+    "https",
+    "simple",
+    "request",
+    "client",
+    "multipart",
+    "upload",
+    "proxy",
+    "deflate",
+    "timeout",
+    "charset",
+    "iconv",
+    "cookie",
+    "redirect"
+  ],
+  "license": "MIT",
+  "main": "./lib/needle",
+  "name": "needle",
+  "optionalDependencies": {},
+  "readme": "Needle\n======\n\n[![NPM](https://nodei.co/npm/needle.png)](https://nodei.co/npm/needle/)\n\nThe leanest and most handsome HTTP client in the Nodelands.\n\n```js\nvar needle = require('needle');\n\nneedle.get('http://www.google.com', function(error, response) {\n  if (!error && response.statusCode == 200)\n    console.log(response.body);\n});\n```\n\nCallbacks not floating your boat? Needle got your back.\n\n``` js\nvar data = {\n  file: '/home/johnlennon/walrus.png',\n  content_type: 'image/png'\n};\n\n// the callback is optional, and needle returns a `readableStream` object\n// that triggers a 'done' event when the request/response process is complete.\nneedle\n  .post('https://my.server.com/foo', data, { multipart: true })\n  .on('readable', function() { /* eat your chunks */ })\n  .on('done', function(err, resp) {\n    console.log('Ready-o!');\n  })\n```\n\nFrom version 2.0.x up, Promises are also supported. Just call `needle()` directly and you'll get a native Promise object.\n\n```js\nneedle('put', 'https://hacking.the.gibson/login', { password: 'god' }, { json: true })\n  .then(function(response) {\n    return doSomethingWith(response)\n  })\n  .catch(function(err) {\n    console.log('Call the locksmith!')\n  })\n```\n\nWith only two real dependencies, Needle supports:\n\n - HTTP/HTTPS requests, with the usual verbs you would expect\n - All of Node's native TLS options, such as 'rejectUnauthorized' (see below)\n - Basic & Digest authentication with auto-detection\n - Multipart form-data (e.g. file uploads)\n - HTTP Proxy forwarding, optionally with authentication\n - Streaming gzip or deflate decompression\n - Automatic XML & JSON parsing\n - 301/302/303 redirect following, with fine-grained tuning, and\n - Streaming non-UTF-8 charset decoding, via `iconv-lite`\n\nAnd yes, Mr. Wayne, it does come in black.\n\nThis makes Needle an ideal alternative for performing quick HTTP requests in Node, either for API interaction, downloading or uploading streams of data, and so on. If you need OAuth, AWS support or anything fancier, you should check out mikeal's request module.\n\nInstall\n-------\n\n```\n$ npm install needle\n```\n\nUsage\n-----\n\n```js\n// using promises\nneedle('get', 'https://server.com/posts/12')\n  .then(function(resp) {\n    // ...\n  })\n  .catch(function(err) {\n    // ...\n  });\n\n// with callback\nneedle.get('ifconfig.me/all.json', function(error, response, body) {\n  if (error) throw error;\n\n  // body is an alias for `response.body`,\n  // that in this case holds a JSON-decoded object.\n  console.log(body.ip_addr);\n});\n\n// no callback, using streams\nvar out = fs.createWriteStream('logo.png');\nneedle.get('https://google.com/images/logo.png').pipe(out).on('finish', function() {\n  console.log('Pipe finished!');\n});\n```\n\nAs you can see, you can use Needle with Promises or without them. When using Promises or when a callback is passed, the response's body will be buffered and written to `response.body`, and the callback will be fired when all of the data has been collected and processed (e.g. decompressed, decoded and/or parsed).\n\nWhen no callback is passed, however, the buffering logic will be skipped but the response stream will still go through Needle's processing pipeline, so you get all the benefits of post-processing while keeping the streamishness we all love from Node.\n\nResponse pipeline\n-----------------\n\nDepending on the response's Content-Type, Needle will either attempt to parse JSON or XML streams, or, if a text response was received, will ensure that the final encoding you get is UTF-8.\n\nYou can also request a gzip/deflated response, which, if sent by the server, will be processed before parsing or decoding is performed.\n\n```js\nneedle.get('http://stackoverflow.com/feeds', { compressed: true }, function(err, resp) {\n  console.log(resp.body); // this little guy won't be a Gzipped binary blob\n                          // but a nice object containing all the latest entries\n});\n```\n\nOr in anti-callback mode, using a few other options:\n\n```js\nvar options = {\n  compressed         : true, // sets 'Accept-Encoding' to 'gzip,deflate'\n  follow_max         : 5,    // follow up to five redirects\n  rejectUnauthorized : true  // verify SSL certificate\n}\n\nvar stream = needle.get('https://backend.server.com/everything.html', options);\n\n// read the chunks from the 'readable' event, so the stream gets consumed.\nstream.on('readable', function() {\n  while (data = this.read()) {\n    console.log(data.toString());\n  }\n})\n\nstream.on('done', function(err) {\n  // if our request had an error, our 'done' event will tell us.\n  if (!err) console.log('Great success!');\n})\n```\n\nAPI\n---\n\n### needle(method, url[, data][, options][, callback]) `(> 2.0.x)`\n\nCalling `needle()` directly returns a Promise. Besides `method` and `url`, all parameters are optional, although when sending a `post`, `put` or `patch` request you will get an error if `data` is not present.\n\n```js\nneedle('get', 'http://some.url.com')\n  .then(function(resp) { console.log(resp.body) })\n  .catch(function(err) { console.error(err) })\n})\n```\n\nExcept from the above, all of Needle's request methods return a Readable stream, and both `options` and `callback` are optional. If passed, the callback will return three arguments: `error`, `response` and `body`, which is basically an alias for `response.body`.\n\n### needle.head(url[, options][, callback])\n\n```js\nneedle.head('https://my.backend.server.com', {\n  open_timeout: 5000 // if we're not able to open a connection in 5 seconds, boom.\n}, function(err, resp) {\n  if (err)\n    console.log('Shoot! Something is wrong: ' + err.message)\n  else\n    console.log('Yup, still alive.')\n})\n```\n\n### needle.get(url[, options][, callback])\n\n```js\nneedle.get('google.com/search?q=syd+barrett', function(err, resp) {\n  // if no http:// is found, Needle will automagically prepend it.\n});\n```\n\n### needle.post(url, data[, options][, callback])\n\n```js\nvar options = {\n  headers: { 'X-Custom-Header': 'Bumbaway atuna' }\n}\n\nneedle.post('https://my.app.com/endpoint', 'foo=bar', options, function(err, resp) {\n  // you can pass params as a string or as an object.\n});\n```\n\n### needle.put(url, data[, options][, callback])\n\n```js\nvar nested = {\n  params: {\n    are: {\n      also: 'supported'\n    }\n  }\n}\n\nneedle.put('https://api.app.com/v2', nested, function(err, resp) {\n  console.log('Got ' + resp.bytes + ' bytes.') // another nice treat from this handsome fella.\n});\n```\n\n### needle.patch(url, data[, options][, callback])\n\nSame behaviour as PUT.\n\n### needle.delete(url, data[, options][, callback])\n\n```js\nvar options = {\n  username: 'fidelio',\n  password: 'x'\n}\n\nneedle.delete('https://api.app.com/messages/123', null, options, function(err, resp) {\n  // in this case, data may be null, but you need to explicity pass it.\n});\n```\n\n### needle.request(method, url, data[, options][, callback])\n\nGeneric request. This not only allows for flexibility, but also lets you perform a GET request with data, in which case will be appended to the request as a query string, unless you pass a `json: true` option (read below).\n\n```js\nvar params = {\n  q    : 'a very smart query',\n  page : 2\n}\n\nneedle.request('get', 'forum.com/search', params, function(err, resp) {\n  if (!err && resp.statusCode == 200)\n    console.log(resp.body); // here you go, mister.\n});\n```\n\nNow, if you set pass `json: true` among the options, Needle won't set your params as a querystring but instead send a JSON representation of your data through the request's body, as well as set the `Content-Type` and `Accept` headers to `application/json`.\n\n```js\nneedle.request('get', 'forum.com/search', params, { json: true }, function(err, resp) {\n  if (resp.statusCode == 200) console.log('It worked!');\n});\n```\n\nEvents\n------\n\nThe [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) object returned by the above request methods emits the following events, in addition to the regular ones (e.g. `end`, `close`, `data`, `pipe`, `readable`).\n\n### Event: `'response'`\n\n - `response <http.IncomingMessage>`\n\nEmitted when the underlying [http.ClientRequest](https://nodejs.org/api/http.html#http_class_http_clientrequest) emits a response event. This is after the connection is established and the header received, but before any of it is processed (e.g. authorization required or redirect to be followed). No data has been consumed at this point.\n\n### Event: `'redirect'`\n\n - `location <String>`\n\nIndicates that the a redirect is being followed. This means that the response code was a redirect (`301`, `302`, `303`, `307`) and the given [redirect options](#redirect-options) allowed following the URL received in the `Location` header.\n\n### Event: `'header'`\n\n - `statusCode <Integer>`\n - `headers <Object>`\n\nTriggered after the header has been processed, and just before the data is to be consumed. This implies that no redirect was followed and/or authentication header was received. In other words, we got a \"valid\" response.\n\n### Event: `'done'` (previously 'end')\n\n - `exception <Error>` (optional)\n\nEmitted when the request/response process has finished, either because all data was consumed or an error ocurred somewhere in between. Unlike a regular stream's `end` event, Needle's `done` will be fired either on success or on failure, which is why the first argument may be an Error object. In other words:\n\n```js\nvar resp = needle.get('something.worthy/of/being/streamed/by/needle');\nresp.pipe(someWritableStream);\n\nresp.on('done', function(err) {\n  if (err) console.log('An error ocurred: ' + err.message);\n  else console.log('Great success!');\n})\n```\n\n### Event: `'err'`\n\n - `exception <Error>`\n\nEmitted when an error ocurrs. This should only happen once in the lifecycle of a Needle request.\n\n### Event: `'timeout'`\n\n - `type <String>`\n\nEmitted when an timeout error occurs. Type can be either 'open', 'response', or 'read'. This will called right before aborting the request, which will also trigger an `err` event, a described above, with an `ECONNRESET` (Socket hang up) exception.\n\nRequest options\n---------------\n\nFor information about options that've changed, there's always [the changelog](https://github.com/tomas/needle/releases).\n\n - `agent`       : Uses an [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent) of your choice, instead of the global, default one. Useful for tweaking the behaviour at the connection level, such as when doing tunneling (see below for an example).\n - `json`        : When `true`, sets content type to `application/json` and sends request body as JSON string, instead of a query string.\n - `open_timeout`: (or `timeout`) Returns error if connection takes longer than X milisecs to establish. Defaults to `10000` (10 secs). `0` means no timeout.\n - `response_timeout`: Returns error if no response headers are received in X milisecs, counting from when the connection is opened. Defaults to `0` (no response timeout).\n - `read_timeout`: Returns error if data transfer takes longer than X milisecs, once response headers are received. Defaults to `0` (no timeout).\n - `follow_max`  : (or `follow`) Number of redirects to follow. Defaults to `0`. See below for more redirect options.\n - `multipart`   : Enables multipart/form-data encoding. Defaults to `false`. Use it when uploading files.\n - `proxy`       : Forwards request through HTTP(s) proxy. Eg. `proxy: 'http://user:pass@proxy.server.com:3128'`. For more advanced proxying/tunneling use a custom `agent`, as described below.\n - `headers`     : Object containing custom HTTP headers for request. Overrides defaults described below.\n - `auth`        : Determines what to do with provided username/password. Options are `auto`, `digest` or `basic` (default). `auto` will detect the type of authentication depending on the response headers.\n - `stream_length`: When sending streams, this lets you manually set the Content-Length header --if the stream's bytecount is known beforehand--, preventing ECONNRESET (socket hang up) errors on some servers that misbehave when receiving payloads of unknown size. Set it to `0` and Needle will get and set the stream's length for you, or leave unset for the default behaviour, which is no Content-Length header for stream payloads.\n - `localAddress`     : <string>, IP address. Passed to http/https request. Local interface from witch the request should be emitted.\n\nResponse options\n----------------\n\n - `decode_response` : (or `decode`) Whether to decode the text responses to UTF-8, if Content-Type header shows a different charset. Defaults to `true`.\n - `parse_response`  : (or `parse`) Whether to parse XML or JSON response bodies automagically. Defaults to `true`. You can also set this to 'xml' or 'json' in which case Needle will *only* parse the response if the content type matches.\n - `output`          : Dump response output to file. This occurs after parsing and charset decoding is done.\n - `parse_cookies`   : Whether to parse response’s `Set-Cookie` header. Defaults to `true`. If parsed, response cookies will be available at `resp.cookies`.\n\nHTTP Header options\n-------------------\n\nThese are basically shortcuts to the `headers` option described above.\n\n - `cookies`   : Builds and sets a Cookie header from a `{ key: 'value' }` object.\n - `compressed`: If `true`, sets 'Accept-Encoding' header to 'gzip,deflate', and inflates content if zipped. Defaults to `false`.\n - `username`  : For HTTP basic auth.\n - `password`  : For HTTP basic auth. Requires username to be passed, but is optional.\n - `accept`    : Sets 'Accept' HTTP header. Defaults to `*/*`.\n - `connection`: Sets 'Connection' HTTP header. Not set by default, unless running Node < 0.11.4 in which case it defaults to `close`. More info about this below.\n - `user_agent`: Sets the 'User-Agent' HTTP header. Defaults to `Needle/{version} (Node.js {node_version})`.\n - `content_type`: Sets the 'Content-Type' header. Unset by default, unless you're sending data in which case it's set accordingly to whatever is being sent (`application/x-www-form-urlencoded`, `application/json` or `multipart/form-data`). That is, of course, unless the option is passed, either here or through `options.headers`. You're the boss.\n\nNode.js TLS Options\n-------------------\n\nThese options are passed directly to `https.request` if present. Taken from the [original documentation](http://nodejs.org/docs/latest/api/https.html):\n\n - `pfx`                : Certificate, Private key and CA certificates to use for SSL.\n - `key`                : Private key to use for SSL.\n - `passphrase`         : A string of passphrase for the private key or pfx.\n - `cert`               : Public x509 certificate to use.\n - `ca`                 : An authority certificate or array of authority certificates to check the remote host against.\n - `ciphers`            : A string describing the ciphers to use or exclude.\n - `rejectUnauthorized` : If true, the server certificate is verified against the list of supplied CAs. An 'error' event is emitted if verification fails. Verification happens at the connection level, before the HTTP request is sent.\n - `secureProtocol`     : The SSL method to use, e.g. SSLv3_method to force SSL version 3.\n\nRedirect options\n----------------\n\nThese options only apply if the `follow_max` (or `follow`) option is higher than 0.\n\n - `follow_set_cookies`      : Sends the cookies received in the `set-cookie` header as part of the following request. `false` by default.\n - `follow_set_referer`      : Sets the 'Referer' header to the requested URI when following a redirect. `false` by default.\n - `follow_keep_method`      : If enabled, resends the request using the original verb instead of being rewritten to `get` with no data. `false` by default.\n - `follow_if_same_host`     : When true, Needle will only follow redirects that point to the same host as the original request. `false` by default.\n - `follow_if_same_protocol` : When true, Needle will only follow redirects that point to the same protocol as the original request. `false` by default.\n\nOverriding Defaults\n-------------------\n\nYes sir, we have it. Needle includes a `defaults()` method, that lets you override some of the defaults for all future requests. Like this:\n\n```js\nneedle.defaults({\n  open_timeout: 60000,\n  user_agent: 'MyApp/1.2.3',\n  parse_response: false });\n```\n\nThis will override Needle's default user agent and 10-second timeout, and disable response parsing, so you don't need to pass those options in every other request.\n\nMore advanced Proxy support\n---------------------------\n\nSince you can pass a custom HTTPAgent to Needle you can do all sorts of neat stuff. For example, if you want to use the [`tunnel`](https://github.com/koichik/node-tunnel) module for HTTPS proxying, you can do this:\n\n```js\nvar tunnel = require('tunnel');\nvar myAgent = tunnel.httpOverHttp({\n  proxy: { host: 'localhost' }\n});\n\nneedle.get('foobar.com', { agent: myAgent });\n```\n\nRegarding the 'Connection' header\n---------------------------------\n\nUnless you're running an old version of Node (< 0.11.4), by default Needle won't set the Connection header on requests, yielding Node's default behaviour of keeping the connection alive with the target server. This speeds up inmensely the process of sending several requests to the same host.\n\nOn older versions, however, this has the unwanted behaviour of preventing the runtime from exiting, either because of a bug or 'feature' that was changed on 0.11.4. To overcome this Needle does set the 'Connection' header to 'close' on those versions, however this also means that making new requests to the same host doesn't benefit from Keep-Alive.\n\nSo if you're stuck on 0.10 or even lower and want full speed, you can simply set the Connection header to 'Keep-Alive' by using `{ connection: 'Keep-Alive' }`. Please note, though, that an event loop handler will prevent the runtime from exiting so you'll need to manually call `process.exit()` or the universe will collapse.\n\nExamples Galore\n---------------\n\n### HTTPS GET with Basic Auth\n\n```js\nneedle.get('https://api.server.com', { username: 'you', password: 'secret' },\n  function(err, resp) {\n    // used HTTP auth\n});\n```\n\nOr use [RFC-1738](http://tools.ietf.org/html/rfc1738#section-3.1) basic auth URL syntax:\n\n```js\nneedle.get('https://username:password@api.server.com', function(err, resp) {\n    // used HTTP auth from URL\n});\n```\n\n### Digest Auth\n\n```js\nneedle.get('other.server.com', { username: 'you', password: 'secret', auth: 'digest' },\n  function(err, resp, body) {\n    // needle prepends 'http://' to your URL, if missing\n});\n```\n\n### Custom Accept header, deflate\n\n```js\nvar options = {\n  compressed : true,\n  follow     : 10,\n  accept     : 'application/vnd.github.full+json'\n}\n\nneedle.get('api.github.com/users/tomas', options, function(err, resp, body) {\n  // body will contain a JSON.parse(d) object\n  // if parsing fails, you'll simply get the original body\n});\n```\n\n### GET XML object\n\n```js\nneedle.get('https://news.ycombinator.com/rss', function(err, resp, body) {\n  // you'll get a nice object containing the nodes in the RSS\n});\n```\n\n### GET binary, output to file\n\n```js\nneedle.get('http://upload.server.com/tux.png', { output: '/tmp/tux.png' }, function(err, resp, body) {\n  // you can dump any response to a file, not only binaries.\n});\n```\n\n### GET through proxy\n\n```js\nneedle.get('http://search.npmjs.org', { proxy: 'http://localhost:1234' }, function(err, resp, body) {\n  // request passed through proxy\n});\n```\n\n### GET a very large document in a stream (from 0.7+)\n\n```js\nvar stream = needle.get('http://www.as35662.net/100.log');\n\nstream.on('readable', function() {\n  var chunk;\n  while (chunk = this.read()) {\n    console.log('got data: ', chunk);\n  }\n});\n```\n\n### GET JSON object in a stream (from 0.7+)\n\n```js\nvar stream = needle.get('http://jsonplaceholder.typicode.com/db', { parse: true });\n\nstream.on('readable', function() {\n  var node;\n\n  // our stream will only emit a single JSON root node.\n  while (node = this.read()) {\n    console.log('got data: ', node);\n  }\n});\n```\n\n### GET JSONStream flexible parser with search query (from 0.7+)\n\n```js\n\n // The 'data' element of this stream will be the string representation\n // of the titles of all posts.\n\nneedle.get('http://jsonplaceholder.typicode.com/db', { parse: true })\n      .pipe(new JSONStream.parse('posts.*.title'));\n      .on('data', function (obj) {\n        console.log('got post title: %s', obj);\n      });\n```\n\n### File upload using multipart, passing file path\n\n```js\nvar data = {\n  foo: 'bar',\n  image: { file: '/home/tomas/linux.png', content_type: 'image/png' }\n}\n\nneedle.post('http://my.other.app.com', data, { multipart: true }, function(err, resp, body) {\n  // needle will read the file and include it in the form-data as binary\n});\n```\n\n### Stream upload, PUT or POST\n\n``` js\nneedle.put('https://api.app.com/v2', fs.createReadStream('myfile.txt'), function(err, resp, body) {\n  // stream content is uploaded verbatim\n});\n```\n\n### Multipart POST, passing data buffer\n\n```js\nvar buffer = fs.readFileSync('/path/to/package.zip');\n\nvar data = {\n  zip_file: {\n    buffer       : buffer,\n    filename     : 'mypackage.zip',\n    content_type : 'application/octet-stream'\n  }\n}\n\nneedle.post('http://somewhere.com/over/the/rainbow', data, { multipart: true }, function(err, resp, body) {\n  // if you see, when using buffers we need to pass the filename for the multipart body.\n  // you can also pass a filename when using the file path method, in case you want to override\n  // the default filename to be received on the other end.\n});\n```\n\n### Multipart with custom Content-Type\n\n```js\nvar data = {\n  token: 'verysecret',\n  payload: {\n    value: JSON.stringify({ title: 'test', version: 1 }),\n    content_type: 'application/json'\n  }\n}\n\nneedle.post('http://test.com/', data, { timeout: 5000, multipart: true }, function(err, resp, body) {\n  // in this case, if the request takes more than 5 seconds\n  // the callback will return a [Socket closed] error\n});\n```\n\nFor even more examples, check out the examples directory in the repo.\n\n### Testing\n\nTo run tests, you need to generate a self-signed SSL certificate in the `test` directory. After cloning the repository, run the following commands:\n\n    $ mkdir -p test/keys\n    $ openssl genrsa -out test/keys/ssl.key 2048\n    $ openssl req -new -key test/keys/ssl.key -x509 -days 999 -out test/keys/ssl.cert\n\nThen you should be able to run `npm test` once you have the dependencies in place.\n\n> Note: Tests currently only work on linux-based environments that have `/proc/self/fd`. They *do not* work on MacOS environments.\n> You can use Docker to run tests by creating a container and mounting the needle project directory on `/app`\n> `docker create --name Needle -v /app -w /app -v /app/node_modules -i node:argon`\n\nCredits\n-------\n\nWritten by Tomás Pollak, with the help of contributors.\n\nCopyright\n---------\n\n(c) Fork Ltd. Licensed under the MIT license.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/tomas/needle.git"
+  },
+  "scripts": {
+    "test": "mocha test"
+  },
+  "tags": [
+    "http",
+    "https",
+    "simple",
+    "request",
+    "client",
+    "multipart",
+    "upload",
+    "proxy",
+    "deflate",
+    "timeout",
+    "charset",
+    "iconv",
+    "cookie",
+    "redirect"
+  ],
+  "version": "2.4.0"
+}
diff --git a/legacy-libs/grpc/node_modules/needle/test/basic_auth_spec.js b/legacy-libs/grpc/node_modules/needle/test/basic_auth_spec.js
new file mode 100644 (file)
index 0000000..343f1db
--- /dev/null
@@ -0,0 +1,196 @@
+var helpers = require('./helpers'),
+    should  = require('should'),
+    needle  = require('./../'),
+    server;
+
+var port = 7707;
+
+describe('Basic Auth', function() {
+
+  before(function(done) {
+    server = helpers.server({ port: port }, done);
+  })
+
+  after(function(done) {
+    server.close(done);
+  })
+
+  ///////////////// helpers
+
+  var get_auth = function(header) {
+    var token  = header.split(/\s+/).pop();
+    return token && Buffer.from(token, 'base64').toString().split(':');
+  }
+
+  describe('when neither username or password are passed', function() {
+
+    it('doesnt send any Authorization headers', function(done) {
+      needle.get('localhost:' + port, { parse: true }, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.not.containEql('authorization');
+        done();
+      })
+    })
+
+  })
+
+  describe('when username is an empty string, and password is a valid string', function() {
+
+    var opts = { username: '', password: 'foobar', parse: true };
+
+    it('doesnt send any Authorization headers', function(done) {
+      needle.get('localhost:' + port, { parse: true }, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.not.containEql('authorization');
+        done();
+      })
+    })
+
+  });
+
+  describe('when username is a valid string, but no username is passed', function() {
+
+    var opts = { username: 'foobar', parse: true };
+
+    it('sends Authorization header', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.containEql('authorization');
+        done();
+      })
+    })
+
+    it('Basic Auth only includes username, without colon', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        var auth = get_auth(sent_headers['authorization']);
+        auth[0].should.equal('foobar');
+        auth.should.have.lengthOf(1);
+        done();
+      })
+    })
+
+  })
+
+  describe('when username is a valid string, and password is null', function() {
+
+    var opts = { username: 'foobar', password: null, parse: true };
+
+    it('sends Authorization header', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.containEql('authorization');
+        done();
+      })
+    })
+
+    it('Basic Auth only includes both username and password', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        var auth = get_auth(sent_headers['authorization']);
+        auth[0].should.equal('foobar');
+        auth[1].should.equal('');
+        done();
+      })
+    })
+
+  })
+
+  describe('when username is a valid string, and password is an empty string', function() {
+
+    var opts = { username: 'foobar', password: '', parse: true };
+
+    it('sends Authorization header', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.containEql('authorization');
+        done();
+      })
+    })
+
+    it('Basic Auth only includes both username and password', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        var auth = get_auth(sent_headers['authorization']);
+        auth[0].should.equal('foobar');
+        auth[1].should.equal('');
+        auth.should.have.lengthOf(2);
+        done();
+      })
+    })
+
+  })
+
+  describe('when username AND password are non empty strings', function() {
+
+    var opts = { username: 'foobar', password: 'jakub', parse: true };
+
+    it('sends Authorization header', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.containEql('authorization');
+        done();
+      })
+    })
+
+    it('Basic Auth only includes both user and password', function(done) {
+      needle.get('localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        var auth = get_auth(sent_headers['authorization']);
+        auth[0].should.equal('foobar');
+        auth[1].should.equal('jakub');
+        auth.should.have.lengthOf(2);
+        done();
+      })
+    })
+
+  })
+
+  describe('URL with @ but not username/pass', function() {
+    it('doesnt send Authorization header', function(done) {
+      var url = 'localhost:' + port + '/abc/@def/xyz.zip';
+
+      needle.get(url, {}, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.not.containEql('authorization');
+        done();
+      })
+    })
+
+    it('sends user:pass headers if passed via options', function(done) {
+      var url = 'localhost:' + port + '/abc/@def/xyz.zip';
+
+      needle.get(url, { username: 'foo' }, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.containEql('authorization');
+        sent_headers['authorization'].should.eql('Basic Zm9v')
+        done();
+      })
+    })
+  })
+
+  describe('when username/password are included in URL', function() {
+    var opts = { parse: true };
+
+    it('sends Authorization header', function(done) {
+      needle.get('foobar:jakub@localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        Object.keys(sent_headers).should.containEql('authorization');
+        done();
+      })
+    })
+
+    it('Basic Auth only includes both user and password', function(done) {
+      needle.get('foobar:jakub@localhost:' + port, opts, function(err, resp) {
+        var sent_headers = resp.body.headers;
+        var auth = get_auth(sent_headers['authorization']);
+        auth[0].should.equal('foobar');
+        auth[1].should.equal('jakub');
+        auth.should.have.lengthOf(2);
+        done();
+      })
+    })
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/compression_spec.js b/legacy-libs/grpc/node_modules/needle/test/compression_spec.js
new file mode 100644 (file)
index 0000000..ea5f3b1
--- /dev/null
@@ -0,0 +1,94 @@
+var should = require('should'),\r
+    needle = require('./../'),\r
+    http   = require('http'),\r
+    zlib   = require('zlib'),\r
+    stream = require('stream'),\r
+    port   = 11123,\r
+    server;\r
+\r
+describe('compression', function(){\r
+\r
+  require.bind(null, 'zlib').should.not.throw()\r
+\r
+  var jsonData = '{"foo":"bar"}';\r
+\r
+  describe('when server supports compression', function(){\r
+\r
+    before(function(){\r
+      server = http.createServer(function(req, res) {\r
+        var raw = new stream.PassThrough();\r
+\r
+        var acceptEncoding = req.headers['accept-encoding'];\r
+        if (!acceptEncoding) {\r
+          acceptEncoding = '';\r
+        }\r
+\r
+        if (acceptEncoding.match(/\bdeflate\b/)) {\r
+          res.setHeader('Content-Encoding', 'deflate');\r
+          raw.pipe(zlib.createDeflate()).pipe(res);\r
+        } else if (acceptEncoding.match(/\bgzip\b/)) {\r
+          res.setHeader('Content-Encoding', 'gzip');\r
+          raw.pipe(zlib.createGzip()).pipe(res);\r
+        } else {\r
+          raw.pipe(res);\r
+        }\r
+\r
+        res.setHeader('Content-Type', 'application/json')\r
+        if (req.headers['with-bad']) {\r
+          res.end('foo'); // end, no deflate data\r
+        } else {\r
+          raw.end(jsonData)\r
+        }\r
+\r
+      })\r
+\r
+      server.listen(port);\r
+    });\r
+\r
+    after(function(done){\r
+      server.close(done);\r
+    })\r
+\r
+    describe('and client requests no compression', function() {\r
+      it('should have the body decompressed', function(done){\r
+        needle.get('localhost:' + port, function(err, response, body){\r
+          should.ifError(err);\r
+          body.should.have.property('foo', 'bar');\r
+          response.bytes.should.equal(jsonData.length);\r
+          done();\r
+        })\r
+      })\r
+    })\r
+\r
+    describe('and client requests gzip compression', function() {\r
+      it('should have the body decompressed', function(done){\r
+        needle.get('localhost:' + port, {headers: {'Accept-Encoding': 'gzip'}}, function(err, response, body){\r
+          should.ifError(err);\r
+          body.should.have.property('foo', 'bar');\r
+          response.bytes.should.not.equal(jsonData.length);\r
+          done();\r
+        })\r
+      })\r
+    })\r
+\r
+    describe('and client requests deflate compression', function() {\r
+      it('should have the body decompressed', function(done){\r
+        needle.get('localhost:' + port, {headers: {'Accept-Encoding': 'deflate'}}, function(err, response, body){\r
+          should.ifError(err);\r
+          body.should.have.property('foo', 'bar');\r
+          response.bytes.should.not.equal(jsonData.length);\r
+          done();\r
+        })\r
+      })\r
+\r
+      it('should rethrow errors from decompressors', function(done){\r
+        needle.get('localhost:' + port, {headers: {'Accept-Encoding': 'deflate', 'With-Bad': 'true'}}, function(err, response, body) {\r
+          should.exist(err);\r
+          err.message.should.equal("incorrect header check");\r
+          err.code.should.equal("Z_DATA_ERROR")\r
+          done();\r
+        })\r
+      })\r
+    })\r
+  })\r
+})\r
diff --git a/legacy-libs/grpc/node_modules/needle/test/cookies_spec.js b/legacy-libs/grpc/node_modules/needle/test/cookies_spec.js
new file mode 100644 (file)
index 0000000..04b5f11
--- /dev/null
@@ -0,0 +1,305 @@
+var needle  = require('../'),
+    cookies = require('../lib/cookies'),
+    sinon   = require('sinon'),
+    http    = require('http'),
+    should  = require('should'),
+    assert  = require('assert');
+
+var WEIRD_COOKIE_NAME      = 'wc',
+    BASE64_COOKIE_NAME     = 'bc',
+    FORBIDDEN_COOKIE_NAME  = 'fc',
+    NUMBER_COOKIE_NAME     = 'nc';
+
+var WEIRD_COOKIE_VALUE     = '!\'*+#()&-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~',
+    BASE64_COOKIE_VALUE    = 'Y29va2llCg==',
+    FORBIDDEN_COOKIE_VALUE = ' ;"\\,',
+    NUMBER_COOKIE_VALUE    = 12354342;
+
+var TEST_HOST = 'localhost',
+    NO_COOKIES_TEST_PORT   = 11112,
+    ALL_COOKIES_TEST_PORT  = 11113;
+
+describe('cookies', function() {
+
+  var setCookieHeader, headers, server, opts;
+
+  function decode(str) {
+    return decodeURIComponent(str);
+  }
+
+  function encode(str) {
+    str = str.toString().replace(/[\x00-\x1F\x7F]/g, encodeURIComponent);
+    return str.replace(/[\s\"\,;\\%]/g, encodeURIComponent);
+  }
+
+  before(function() {
+    setCookieHeader = [
+      WEIRD_COOKIE_NAME + '=' + encode(WEIRD_COOKIE_VALUE) + ';',
+      BASE64_COOKIE_NAME + '=' + encode(BASE64_COOKIE_VALUE) + ';',
+      FORBIDDEN_COOKIE_NAME + '=' + encode(FORBIDDEN_COOKIE_VALUE) + ';',
+      NUMBER_COOKIE_NAME + '=' + encode(NUMBER_COOKIE_VALUE) + ';'
+    ];
+  });
+
+  before(function(done) {
+    serverAllCookies = http.createServer(function(req, res) {
+      res.setHeader('Content-Type', 'text/html');
+      res.setHeader('Set-Cookie', setCookieHeader);
+      res.end('200');
+    }).listen(ALL_COOKIES_TEST_PORT, TEST_HOST, done);
+  });
+
+  after(function(done) {
+    serverAllCookies.close(done);
+  });
+
+  describe('with default options', function() {
+    it('no cookie header is set on request', function(done) {
+      needle.get(
+        TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, function(err, response) {
+          assert(!response.req._headers.cookie);
+          done();
+        });
+    });
+  });
+
+  describe('if response does not contain cookies', function() {
+    before(function(done) {
+      serverNoCookies = http.createServer(function(req, res) {
+        res.setHeader('Content-Type', 'text/html');
+        res.end('200');
+      }).listen(NO_COOKIES_TEST_PORT, TEST_HOST, done);
+    });
+
+    it('response.cookies is undefined', function(done) {
+      needle.get(
+        TEST_HOST + ':' + NO_COOKIES_TEST_PORT, function(error, response) {
+          assert(!response.cookies);
+          done();
+        });
+    });
+
+    after(function(done) {
+      serverNoCookies.close(done);
+    });
+  });
+
+  describe('if response contains cookies', function() {
+
+    it('puts them on resp.cookies', function(done) {
+      needle.get(
+        TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, function(error, response) {
+          response.should.have.property('cookies');
+          done();
+        });
+    });
+
+    it('parses them as a object', function(done) {
+      needle.get(
+        TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, function(error, response) {
+          response.cookies.should.be.an.instanceOf(Object)
+            .and.have.property(WEIRD_COOKIE_NAME);
+          response.cookies.should.have.property(BASE64_COOKIE_NAME);
+          response.cookies.should.have.property(FORBIDDEN_COOKIE_NAME);
+          response.cookies.should.have.property(NUMBER_COOKIE_NAME);
+          done();
+        });
+    });
+
+    it('must decode it', function(done) {
+      needle.get(
+        TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, function(error, response) {
+          response.cookies.wc.should.be.eql(WEIRD_COOKIE_VALUE);
+          response.cookies.bc.should.be.eql(BASE64_COOKIE_VALUE);
+          response.cookies.fc.should.be.eql(FORBIDDEN_COOKIE_VALUE);
+          response.cookies.nc.should.be.eql(NUMBER_COOKIE_VALUE.toString());
+          done();
+        });
+    });
+
+    describe('when a cookie value is invalid', function() {
+
+      before(function() {
+        setCookieHeader = [
+          'geo_city=%D1%E0%ED%EA%F2-%CF%E5%F2%E5%F0%E1%F3%F0%E3'
+        ];
+      })
+
+      it('doesnt blow up', function(done) {
+        needle.get(TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, function(error, response) {
+          should.not.exist(error)
+          var whatever = 'efbfbdefbfbdefbfbdefbfbdefbfbd2defbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbdefbfbd';
+          Buffer.from(response.cookies.geo_city).toString('hex').should.eql(whatever)
+          done();
+        });
+      })
+
+    })
+
+    describe('and response is a redirect', function() {
+
+      var redirectServer, testPort = 22222;
+
+      var responseCookies = [
+        [ // first req
+          WEIRD_COOKIE_NAME + '=' + encode(WEIRD_COOKIE_VALUE) + ';',
+          BASE64_COOKIE_NAME + '=' + encode(BASE64_COOKIE_VALUE) + ';',
+          'FOO=123;'
+        ], [ // second req
+          FORBIDDEN_COOKIE_NAME + '=' + encode(FORBIDDEN_COOKIE_VALUE) + ';',
+          NUMBER_COOKIE_NAME + '=' + encode(NUMBER_COOKIE_VALUE) + ';'
+        ], [ // third red
+          'FOO=BAR;'
+        ]
+      ]
+
+      before(function() {
+        redirectServer = http.createServer(function(req, res) {
+          var number  = parseInt(req.url.replace('/', ''));
+          var nextUrl = 'http://' + TEST_HOST + ':' + testPort + '/' + (number + 1);
+
+          if (responseCookies[number]) { // got cookies
+            res.statusCode = 302;
+            res.setHeader('Set-Cookie', responseCookies[number]);
+            res.setHeader('Location', nextUrl);
+          } else if (number == 3) {
+            res.statusCode = 302; // redirect but without cookies
+            res.setHeader('Location', nextUrl);
+          }
+
+          res.end('OK');
+        }).listen(22222, TEST_HOST);
+      });
+
+      after(function(done) {
+        redirectServer.close(done);
+      })
+
+      describe('and follow_set_cookies is false', function() {
+
+        var opts = {
+          follow_set_cookies: false,
+          follow_max: 4
+        };
+
+        it('no cookie header set on redirection request', function(done) {
+          var spy = sinon.spy(cookies, 'write');
+
+          needle.get(TEST_HOST + ':' + testPort + '/0', opts, function(err, resp) {
+            spy.callCount.should.eql(0);
+            done();
+          });
+        });
+      });
+
+      describe('and follow_set_cookies is true', function() {
+        var opts = {
+          follow_set_cookies: true,
+          follow_max: 4
+        };
+
+        it('should have all the cookies', function(done) {
+          needle.get(TEST_HOST + ':' + testPort + '/0', opts, function(err, resp) {
+            resp.cookies.should.have.property(WEIRD_COOKIE_NAME);
+            resp.cookies.should.have.property(BASE64_COOKIE_NAME);
+            resp.cookies.should.have.property(FORBIDDEN_COOKIE_NAME);
+            resp.cookies.should.have.property(NUMBER_COOKIE_NAME);
+            resp.cookies.should.have.property('FOO');
+            resp.cookies.FOO.should.eql('BAR'); // should overwrite previous one
+            done();
+          });
+        });
+      });
+    });
+
+    describe('with parse_cookies = false', function() {
+      it('does not parse them', function(done) {
+        needle.get(
+          TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, { parse_cookies: false }, function(error, response) {
+            assert(!response.cookies);
+            done();
+          });
+      });
+    });
+  });
+
+  describe('if request contains cookie header', function() {
+    var opts = {
+      cookies: {}
+    };
+
+    before(function() {
+      opts.cookies[WEIRD_COOKIE_NAME] = WEIRD_COOKIE_VALUE;
+      opts.cookies[BASE64_COOKIE_NAME] = BASE64_COOKIE_VALUE;
+      opts.cookies[FORBIDDEN_COOKIE_NAME] = FORBIDDEN_COOKIE_VALUE;
+      opts.cookies[NUMBER_COOKIE_NAME] = NUMBER_COOKIE_VALUE;
+    });
+
+    it('must be a valid cookie string', function(done) {
+      var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/;
+
+      var full_header = [
+        WEIRD_COOKIE_NAME     + '=' + WEIRD_COOKIE_VALUE,
+        BASE64_COOKIE_NAME    + '=' + BASE64_COOKIE_VALUE,
+        FORBIDDEN_COOKIE_NAME + '=' + encode(FORBIDDEN_COOKIE_VALUE),
+        NUMBER_COOKIE_NAME    + '=' + NUMBER_COOKIE_VALUE
+      ].join('; ')
+
+      needle.get(TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, opts, function(error, response) {
+        var cookieString = response.req._headers.cookie;
+        cookieString.should.be.type('string');
+
+        cookieString.split(/\s*;\s*/).forEach(function(pair) {
+          COOKIE_PAIR.test(pair).should.be.exactly(true);
+        });
+
+        cookieString.should.be.exactly(full_header);
+        done();
+      });
+    });
+
+    it('dont have to encode allowed characters', function(done) {
+      var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/,
+        KEY_INDEX = 1,
+        VALUE_INEX = 3;
+
+      needle.get(TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, opts, function(error, response) {
+        var cookieObj = {},
+          cookieString = response.req._headers.cookie;
+
+        cookieString.split(/\s*;\s*/).forEach(function(str) {
+          var pair = COOKIE_PAIR.exec(str);
+          cookieObj[pair[KEY_INDEX]] = pair[VALUE_INEX];
+        });
+
+        cookieObj[WEIRD_COOKIE_NAME].should.be.exactly(WEIRD_COOKIE_VALUE);
+        cookieObj[BASE64_COOKIE_NAME].should.be.exactly(BASE64_COOKIE_VALUE);
+        done();
+      });
+    });
+
+    it('must encode forbidden characters', function(done) {
+      var COOKIE_PAIR = /^([^=\s]+)\s*=\s*("?)\s*(.*)\s*\2\s*$/,
+        KEY_INDEX = 1,
+        VALUE_INEX = 3;
+
+      needle.get(TEST_HOST + ':' + ALL_COOKIES_TEST_PORT, opts, function(error, response) {
+        var cookieObj = {},
+          cookieString = response.req._headers.cookie;
+
+        cookieString.split(/\s*;\s*/).forEach(function(str) {
+          var pair = COOKIE_PAIR.exec(str);
+          cookieObj[pair[KEY_INDEX]] = pair[VALUE_INEX];
+        });
+
+        cookieObj[FORBIDDEN_COOKIE_NAME].should.not.be.eql(
+          FORBIDDEN_COOKIE_VALUE);
+        cookieObj[FORBIDDEN_COOKIE_NAME].should.be.exactly(
+          encode(FORBIDDEN_COOKIE_VALUE));
+        cookieObj[FORBIDDEN_COOKIE_NAME].should.be.exactly(
+          encodeURIComponent(FORBIDDEN_COOKIE_VALUE));
+        done();
+      });
+    });
+  });
+});
diff --git a/legacy-libs/grpc/node_modules/needle/test/decoder_spec.js b/legacy-libs/grpc/node_modules/needle/test/decoder_spec.js
new file mode 100644 (file)
index 0000000..5225f6f
--- /dev/null
@@ -0,0 +1,86 @@
+var should  = require('should'),
+    needle  = require('./../'),
+    Q       = require('q'),
+    chardet = require('jschardet');
+
+describe('character encoding', function() {
+
+  var url;
+  this.timeout(5000);
+
+  describe('test A', function() {
+
+    before(function() {
+      url = 'http://www.nina.jp/server/slackware/webapp/tomcat_charset.html';
+    })
+
+    describe('with decode = false', function() {
+
+      it('does not decode', function(done) {
+
+        needle.get(url, { decode: false }, function(err, resp) {
+          resp.body.should.be.a.String;
+          chardet.detect(resp.body).encoding.should.eql('windows-1252');
+          resp.body.indexOf('EUCを使う').should.eql(-1);
+          done();
+        })
+
+      })
+
+    })
+
+    describe('with decode = true', function() {
+
+      it('decodes', function(done) {
+
+        needle.get(url, { decode: true }, function(err, resp) {
+          resp.body.should.be.a.String;
+          chardet.detect(resp.body).encoding.should.eql('ascii');
+          resp.body.indexOf('EUCを使う').should.not.eql(-1);
+          done();
+        })
+
+      })
+
+    })
+
+  })
+
+  describe('test B', function() {
+
+    it('encodes to UTF-8', function(done) {
+
+      // Our Needle wrapper that requests a chinese website.
+      var task    = Q.nbind(needle.get, needle, 'http://www.chinesetop100.com/');
+
+      // Different instantiations of this task
+      var tasks   = [Q.fcall(task, {decode: true}),
+                     Q.fcall(task, {decode: false})];
+
+      var results = tasks.map(function(task) {
+        return task.then(function(obj) {
+          return obj[0].body;
+        });
+      });
+
+      // Execute all requests concurrently
+      Q.all(results).done(function(bodies) {
+
+        var charsets = [
+          chardet.detect(bodies[0]).encoding,
+          chardet.detect(bodies[1]).encoding,
+        ]
+
+        // We wanted to decode our first stream.
+        charsets[0].should.equal('ascii');
+        bodies[0].indexOf('全球中文网站前二十强').should.not.equal(-1);
+
+        // But not our second stream.
+        charsets[1].should.equal('windows-1252');
+        bodies[1].indexOf('全球中文网站前二十强').should.equal(-1);
+
+        done();
+      });
+    })
+  })
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/errors_spec.js b/legacy-libs/grpc/node_modules/needle/test/errors_spec.js
new file mode 100644 (file)
index 0000000..2f488f5
--- /dev/null
@@ -0,0 +1,286 @@
+var needle  = require('../'),
+    sinon   = require('sinon'),
+    should  = require('should'),
+    http    = require('http'),
+    Emitter = require('events').EventEmitter,
+    helpers = require('./helpers');
+
+var get_catch = function(url, opts) {
+  var err;
+  try {
+    needle.get(url, opts);
+  } catch(e) {
+    err = e;
+  }
+  return err;
+}
+
+describe('errors', function() {
+
+  after(function(done) {
+    setTimeout(done, 100)
+  })
+
+  describe('when host does not exist', function() {
+
+    var url = 'http://unexistinghost/foo';
+
+    describe('with callback', function() {
+
+      it('does not throw', function() {
+        var ex = get_catch(url);
+        should.not.exist(ex);
+      })
+
+      it('callbacks an error', function(done) {
+        needle.get(url, function(err) {
+          err.should.be.a.Error;
+          done();
+        })
+      })
+
+      it('error should be ENOTFOUND or EADDRINFO or EAI_AGAIN', function(done) {
+        needle.get(url, function(err) {
+          err.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
+          done();
+        })
+      })
+
+      it('does not callback a response', function(done) {
+        needle.get(url, function(err, resp) {
+          should.not.exist(resp);
+          done();
+        })
+      })
+
+      it('does not emit an error event', function(done) {
+        var emitted = false;
+        var req = needle.get(url, function(err, resp) { })
+
+        req.on('error', function() {
+          emitted = true;
+        })
+
+        setTimeout(function() {
+          emitted.should.eql(false);
+          done();
+        }, 100);
+      })
+
+    })
+
+    describe('without callback', function() {
+
+      it('does not throw', function() {
+        var ex = get_catch(url);
+        should.not.exist(ex);
+      })
+
+      it('emits end event once, with error', function(done) {
+        var callcount = 0,
+            stream = needle.get(url);
+
+        stream.on('done', function(err) {
+          callcount++;
+        })
+
+        setTimeout(function() {
+          callcount.should.equal(1);
+          done();
+        }, 200)
+      })
+
+      it('error should be ENOTFOUND or EADDRINFO or EAI_AGAIN', function(done) {
+        var errorific,
+            stream = needle.get(url);
+
+        stream.on('done', function(err) {
+          errorific = err;
+        })
+
+        setTimeout(function() {
+          should.exist(errorific);
+          errorific.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
+          done();
+        }, 200)
+      })
+
+      it('does not emit a readable event', function(done) {
+        var called = false,
+            stream = needle.get(url);
+
+        stream.on('readable', function() {
+          called = true;
+        })
+
+        setTimeout(function() {
+          called.should.be.false;
+          done();
+        }, 50)
+      })
+
+      it('does not emit an error event', function(done) {
+        var emitted = false,
+            req = needle.get(url);
+
+        req.on('error', function() {
+          emitted = true;
+        })
+
+        setTimeout(function() {
+          emitted.should.eql(false);
+          done();
+        }, 100);
+      })
+
+    })
+
+  })
+
+  describe('when request times out waiting for response', function() {
+
+    var server,
+        url = 'http://localhost:3333/foo';
+
+    var send_request = function(cb) {
+      return needle.get(url, { response_timeout: 200 }, cb);
+    }
+
+    before(function() {
+      server = helpers.server({ port: 3333, wait: 1000 });
+    })
+
+    after(function() {
+      server.close();
+    })
+
+    describe('with callback', function() {
+
+      it('aborts the request', function(done) {
+
+        var time = new Date();
+
+        send_request(function(err) {
+          var timediff = (new Date() - time);
+          timediff.should.be.within(200, 300);
+          done();
+        })
+
+      })
+
+      it('callbacks an error', function(done) {
+        send_request(function(err) {
+          err.should.be.a.Error;
+          done();
+        })
+      })
+
+      it('error should be ECONNRESET', function(done) {
+        send_request(function(err) {
+          err.code.should.equal('ECONNRESET')
+          done();
+        })
+      })
+
+      it('does not callback a response', function(done) {
+        send_request(function(err, resp) {
+          should.not.exist(resp);
+          done();
+        })
+      })
+
+      it('does not emit an error event', function(done) {
+        var emitted = false;
+
+        var req = send_request(function(err, resp) {
+          should.not.exist(resp);
+        })
+
+        req.on('error', function() {
+          emitted = true;
+        })
+
+        setTimeout(function() {
+          emitted.should.eql(false);
+          done();
+        }, 350);
+      })
+
+    })
+
+    describe('without callback', function() {
+
+      it('emits done event once, with error', function(done) {
+        var called = 0,
+            stream = send_request();
+
+        stream.on('done', function(err) {
+          called++;
+        })
+
+        setTimeout(function() {
+          called.should.equal(1);
+          done();
+        }, 250)
+      })
+
+      it('aborts the request', function(done) {
+
+        var time = new Date();
+        var stream = send_request();
+
+        stream.on('done', function(err) {
+          var timediff = (new Date() - time);
+          timediff.should.be.within(200, 300);
+          done();
+        })
+
+      })
+
+      it('error should be ECONNRESET', function(done) {
+        var error,
+            stream = send_request();
+
+        stream.on('done', function(err) {
+          error = err;
+        })
+
+        setTimeout(function() {
+          error.code.should.equal('ECONNRESET')
+          done();
+        }, 250)
+      })
+
+      it('does not emit a readable event', function(done) {
+        var called = false,
+            stream = send_request();
+
+        stream.on('readable', function() {
+          called = true;
+        })
+
+        setTimeout(function() {
+          called.should.be.false;
+          done();
+        }, 250)
+      })
+
+      it('does not emit an error event', function(done) {
+        var emitted = false;
+        var req = send_request();
+
+        req.on('error', function() {
+          emitted = true;
+        })
+
+        setTimeout(function() {
+          emitted.should.eql(false);
+          done();
+        }, 100);
+      })
+
+    })
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/headers_spec.js b/legacy-libs/grpc/node_modules/needle/test/headers_spec.js
new file mode 100644 (file)
index 0000000..e6693ef
--- /dev/null
@@ -0,0 +1,198 @@
+var http    = require('http'),
+    helpers = require('./helpers'),
+    should  = require('should');
+
+var port = 54321;
+
+describe('request headers', function() {
+
+  var needle,
+      server,
+      existing_sockets,
+      original_defaultMaxSockets;
+
+  before(function(done) {
+    setTimeout(function() {
+      existing_sockets = get_active_sockets().length;
+      server = helpers.server({ port: port }, done);
+    }, 100);
+  })
+
+  after(function(done) {
+    server.close(done)
+  })
+
+  function send_request(opts, cb) {
+    needle.get('http://localhost:' + port, opts, cb);
+  }
+
+  function get_active_sockets() {
+    var handles = process._getActiveHandles();
+
+    // only return the ones that have a .end() function (like a socket)
+    return handles.filter(function(el) {
+      if (el.constructor.name.toString() == 'Socket') {
+        return el.destroyed !== true;
+      }
+    })
+  }
+
+  describe('old node versions (<0.11.4) with persistent keep-alive connections', function() {
+
+    before(function() {
+      delete require.cache[require.resolve('..')] // in case it was already loaded
+      original_defaultMaxSockets = http.Agent.defaultMaxSockets;
+      http.Agent.defaultMaxSockets = 5;
+      needle = require('..');
+    })
+
+    after(function() {
+      http.Agent.defaultMaxSockets = original_defaultMaxSockets;
+      delete require.cache[require.resolve('..')]
+    })
+
+    describe('default options', function() {
+
+      it('sends a Connection: close header', function(done) {
+        send_request({}, function(err, resp) {
+          resp.body.headers['connection'].should.eql('close');
+          done();
+        })
+      })
+
+      it('no open sockets remain after request', function(done) {
+        send_request({}, function(err, resp) {
+          get_active_sockets().length.should.eql(existing_sockets);
+          done();
+        });
+      })
+
+    })
+
+    describe('passing connection: close', function() {
+
+      it('sends a Connection: close header', function(done) {
+        send_request({ connection: 'close' }, function(err, resp) {
+          resp.body.headers['connection'].should.eql('close');
+          done();
+        })
+      })
+
+      it('no open sockets remain after request', function(done) {
+        send_request({ connection: 'close' }, function(err, resp) {
+          get_active_sockets().length.should.eql(existing_sockets);
+          done();
+        });
+      })
+
+    })
+
+    describe('passing connection: keep-alive', function() {
+
+      it('sends a Connection: keep-alive header (using options.headers.connection)', function(done) {
+        send_request({ headers: { connection: 'keep-alive' }}, function(err, resp) {
+          resp.body.headers['connection'].should.eql('keep-alive');
+          done();
+        })
+      })
+
+      it('sends a Connection: keep-alive header (using options.connection)', function(done) {
+        send_request({ connection: 'keep-alive' }, function(err, resp) {
+          resp.body.headers['connection'].should.eql('keep-alive');
+          done();
+        })
+      })
+
+      it('one open socket remain after request', function(done) {
+        send_request({ connection: 'keep-alive' }, function(err, resp) {
+          get_active_sockets().length.should.eql(existing_sockets + 1);
+          done();
+        });
+      })
+
+    })
+
+  })
+
+  describe('new node versions with smarter connection disposing', function() {
+
+    before(function() {
+      delete require.cache[require.resolve('..')]
+      original_defaultMaxSockets = http.Agent.defaultMaxSockets;
+      http.Agent.defaultMaxSockets = Infinity;
+      needle = require('..');
+    })
+
+    after(function() {
+      http.Agent.defaultMaxSockets = original_defaultMaxSockets;
+      delete require.cache[require.resolve('..')]
+    })
+
+    describe('default options', function() {
+
+      // TODO:
+      // this is weird. by default, new node versions set a 'close' header
+      // while older versions set a keep-alive header
+
+      it.skip('sets a Connection header', function(done) {
+        send_request({}, function(err, resp) {
+          // should.not.exist(resp.body.headers['connection']);
+          // done();
+        })
+      })
+
+      it.skip('one open sockets remain after request', function(done) {
+        send_request({}, function(err, resp) {
+          // get_active_sockets().length.should.eql(1);
+          // done();
+        });
+      })
+
+    })
+
+    describe('passing connection: close', function() {
+
+      it('sends a Connection: close header', function(done) {
+        send_request({ connection: 'close' }, function(err, resp) {
+          resp.body.headers['connection'].should.eql('close');
+          done();
+        })
+      })
+
+      it('no open sockets remain after request', function(done) {
+        send_request({ connection: 'close' }, function(err, resp) {
+          get_active_sockets().length.should.eql(existing_sockets);
+          done();
+        });
+      })
+
+    })
+
+    describe('passing connection: keep-alive', function() {
+
+      it('sends a Connection: keep-alive header (using options.headers.connection)', function(done) {
+        send_request({ headers: { connection: 'keep-alive' }}, function(err, resp) {
+          resp.body.headers['connection'].should.eql('keep-alive');
+          done();
+        })
+      })
+
+      it('sends a Connection: keep-alive header (using options.connection)', function(done) {
+        send_request({ connection: 'keep-alive' }, function(err, resp) {
+          resp.body.headers['connection'].should.eql('keep-alive');
+          done();
+        })
+      })
+
+      it('one open socket remain after request', function(done) {
+        send_request({ connection: 'keep-alive' }, function(err, resp) {
+          get_active_sockets().length.should.eql(existing_sockets + 1);
+          done();
+        });
+      })
+
+    })
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/helpers.js b/legacy-libs/grpc/node_modules/needle/test/helpers.js
new file mode 100644 (file)
index 0000000..a85f548
--- /dev/null
@@ -0,0 +1,72 @@
+var fs = require('fs');
+
+var protocols = {
+  http  : require('http'),
+  https : require('https')
+}
+
+var keys = {
+  cert : fs.readFileSync(__dirname + '/keys/ssl.cert'),
+  key  : fs.readFileSync(__dirname + '/keys/ssl.key')
+}
+
+var helpers = {};
+
+helpers.server = function(opts, cb) {
+
+  var defaults = {
+    code    : 200,
+    headers : {'Content-Type': 'application/json'}
+  }
+
+  var mirror_response = function(req) {
+    return JSON.stringify({
+      headers: req.headers,
+      body: req.body
+    })
+  }
+
+  var get = function(what) {
+    if (!opts[what])
+      return defaults[what];
+  
+    if (typeof opts[what] == 'function')
+      return opts[what](); // set them at runtime
+    else
+      return opts[what];
+  }
+
+  var finish = function(req, res) {
+    res.writeHead(get('code'), get('headers'));
+    res.end(opts.response || mirror_response(req));
+  }
+
+  var handler = function(req, res) {
+
+    req.setEncoding('utf8'); // get as string
+    req.body = '';
+    req.on('data', function(str) { req.body += str })
+    req.socket.on('error', function(e) { 
+      // res.writeHead(500, {'Content-Type': 'text/plain'});
+      // res.end('Error: ' + e.message);
+    })
+
+    setTimeout(function(){
+      finish(req, res);
+    }, opts.wait || 0);
+
+  };
+
+  var protocol = opts.protocol || 'http';
+  var server;
+
+  if (protocol == 'https')
+    server = protocols[protocol].createServer(keys, handler);
+  else
+    server = protocols[protocol].createServer(handler);
+
+  server.listen(opts.port, cb);
+  return server;
+}
+
+module.exports = helpers;
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/needle/test/long_string_spec.js b/legacy-libs/grpc/node_modules/needle/test/long_string_spec.js
new file mode 100644 (file)
index 0000000..4baa4fa
--- /dev/null
@@ -0,0 +1,34 @@
+var needle = require('../'),
+    should = require('should');
+
+describe('when posting a very long string', function() {
+
+  this.timeout(20000);
+
+  function get_string(length) {
+    var str = '';
+    for (var i = 0; i < length; i++) {
+      str += 'x';
+    }
+    return str;
+  }
+
+  it("shouldn't throw an EPIPE error out of nowhere", function(done) {
+    var error;
+
+    function finished() {
+      setTimeout(function() {
+        should.not.exist(error);
+        done();
+      }, 300);
+    }
+
+    try {
+      needle.post('https://google.com', { data: get_string(Math.pow(2, 20)) }, finished)
+    } catch(e) {
+      error = e;
+    }
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/output_spec.js b/legacy-libs/grpc/node_modules/needle/test/output_spec.js
new file mode 100644 (file)
index 0000000..14fc5bb
--- /dev/null
@@ -0,0 +1,254 @@
+var should = require('should'),
+    needle = require('./../'),
+    http   = require('http'),
+    sinon  = require('sinon'),
+    stream = require('stream'),
+    fs     = require('fs'),
+    port   = 11111,
+    server;
+
+describe('with output option', function() {
+
+  var server, handler, file = '/tmp/foobar.out';
+
+  function send_request_cb(where, cb) {
+    var url = 'http://localhost:' + port + '/whatever.file';
+    return needle.get(url, { output: where }, cb);
+  }
+
+  function send_request_stream(where, cb) {
+    var url = 'http://localhost:' + port + '/whatever.file';
+    var stream = needle.get(url, { output: where });
+    stream.on('end', cb);
+  }
+
+  // this will only work in UNICES
+  function get_open_file_descriptors() {
+    var list = fs.readdirSync('/proc/self/fd');
+    return list.length;
+  }
+
+  var send_request = send_request_cb;
+
+  before(function(){
+    server = http.createServer(function(req, res) {
+      handler(req, res);
+    }).listen(port);
+  });
+
+  after(function() {
+    server.close();
+  })
+
+  beforeEach(function() {
+      try { fs.unlinkSync(file) } catch(e) { };
+  })
+
+  describe('and a 404 response', function() {
+
+    before(function() {
+      handler = function(req, res) {
+        res.writeHead(404, {'Content-Type': 'text/plain' });
+        res.end();
+      }
+    })
+
+    it('doesnt attempt to write a file', function(done) {
+      var spy = sinon.spy(fs, 'createWriteStream');
+      send_request(file, function(err, resp) {
+        resp.statusCode.should.eql(404);
+        spy.called.should.eql(false);
+        spy.restore();
+        done();
+      })
+    })
+
+    it('doesnt actually write a file', function(done) {
+      send_request(file, function(err, resp) {
+        resp.statusCode.should.eql(404);
+        fs.existsSync(file).should.eql(false);
+        done();
+      })
+    })
+
+  })
+
+  describe('and a 200 response', function() {
+
+    describe('for an empty response', function() {
+
+      before(function() {
+        handler = function(req, res) {
+          res.writeHead(200, { 'Content-Type': 'text/plain' });
+          res.end();
+        }
+      })
+
+      it('uses a writableStream', function(done) {
+        var spy = sinon.spy(fs, 'createWriteStream');
+        send_request(file, function(err, resp) {
+          resp.statusCode.should.eql(200);
+          spy.called.should.eql(true);
+          spy.restore();
+          done();
+        })
+      })
+
+      it('writes a file', function(done) {
+        fs.existsSync(file).should.eql(false);
+        send_request(file, function(err, resp) {
+          fs.existsSync(file).should.eql(true);
+          done();
+        })
+      })
+
+      it('file is zero bytes in length', function(done) {
+        send_request(file, function(err, resp) {
+          fs.statSync(file).size.should.equal(0);
+          done();
+        })
+      })
+
+      if (process.platform != 'win32') {
+        it('closes the file descriptor', function(done) {
+          var open_descriptors = get_open_file_descriptors();
+          send_request(file + Math.random(), function(err, resp) {
+            var current_descriptors = get_open_file_descriptors();
+            open_descriptors.should.eql(current_descriptors);
+            done()
+          })
+        })
+      }
+
+    })
+
+    describe('for a JSON response', function() {
+
+      before(function() {
+        handler = function(req, res) {
+          res.writeHead(200, { 'Content-Type': 'application/javascript' });
+          res.end(JSON.stringify({foo: 'bar'}));
+        }
+      })
+
+      it('uses a writableStream', function(done) {
+        var spy = sinon.spy(fs, 'createWriteStream');
+        send_request(file, function(err, resp) {
+          resp.statusCode.should.eql(200);
+          spy.called.should.eql(true);
+          spy.restore();
+          done();
+        })
+      })
+
+      it('writes a file', function(done) {
+        fs.existsSync(file).should.eql(false);
+        send_request(file, function(err, resp) {
+          fs.existsSync(file).should.eql(true);
+          done();
+        })
+      })
+
+      it('file size equals response length', function(done) {
+        send_request(file, function(err, resp) {
+          fs.statSync(file).size.should.equal(resp.bytes);
+          done();
+        })
+      })
+
+      it('response pipeline is honoured (JSON is decoded by default)', function(done) {
+        send_request_stream(file, function(err, resp) {
+          // we need to wait a bit since writing to config.output
+          // happens independently of needle's callback logic.
+          setTimeout(function() {
+            fs.readFileSync(file).toString().should.eql('{\"foo\":\"bar\"}');
+            done();
+          }, 20);
+        })
+      })
+
+      it('closes the file descriptor', function(done) {
+        var open_descriptors = get_open_file_descriptors();
+        send_request(file + Math.random(), function(err, resp) {
+          var current_descriptors = get_open_file_descriptors();
+          open_descriptors.should.eql(current_descriptors);
+          done()
+        })
+      })
+
+    })
+
+    describe('for a binary file', function() {
+
+      var pixel = Buffer.from("base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs", "base64");
+
+      before(function() {
+        handler = function(req, res) {
+          res.writeHead(200, { 'Content-Type': 'application/octet-stream', 'Transfer-Encoding': 'chunked' });
+          res.write(pixel.slice(0, 10));
+          res.write(pixel.slice(10, 20));
+          res.write(pixel.slice(20, 30));
+          res.write(pixel.slice(30));
+          res.end();
+        }
+      })
+
+      it('uses a writableStream', function(done) {
+        var spy = sinon.spy(fs, 'createWriteStream');
+        send_request(file, function(err, resp) {
+          resp.statusCode.should.eql(200);
+          spy.called.should.eql(true);
+          spy.restore();
+          done();
+        })
+      })
+
+      it('writes a file', function(done) {
+        fs.existsSync(file).should.eql(false);
+        send_request(file, function(err, resp) {
+          fs.existsSync(file).should.eql(true);
+          done();
+        })
+      })
+
+      it('file size equals response length', function(done) {
+        send_request(file, function(err, resp) {
+          fs.statSync(file).size.should.equal(resp.bytes);
+          done();
+        })
+      })
+
+      it('file is equal to original buffer', function(done) {
+        send_request(file, function(err, resp) {
+          // we need to wait a bit since writing to config.output
+          // happens independently of needle's callback logic.
+          setTimeout(function() {
+            fs.readFileSync(file).should.eql(pixel);
+            done();
+          }, 20);
+        })
+      })
+
+      it('returns the data in resp.body too', function(done) {
+        send_request(file, function(err, resp) {
+          resp.body.should.eql(pixel);
+          done();
+        })
+      })
+
+      if (process.platform != 'win32') {
+        it('closes the file descriptor', function(done) {
+          var open_descriptors = get_open_file_descriptors();
+          send_request(file + Math.random(), function(err, resp) {
+            var current_descriptors = get_open_file_descriptors();
+            open_descriptors.should.eql(current_descriptors);
+            done()
+          })
+        })
+      }
+
+    })
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/parsing_spec.js b/legacy-libs/grpc/node_modules/needle/test/parsing_spec.js
new file mode 100644 (file)
index 0000000..406a292
--- /dev/null
@@ -0,0 +1,494 @@
+var should = require('should'),
+    needle = require('./../'),
+    http   = require('http'),
+    port   = 11111,
+    server;
+
+describe('parsing', function(){
+
+  describe('when response is an JSON string', function(){
+
+    var json_string = '{"foo":"bar"}';
+
+    before(function(done){
+      server = http.createServer(function(req, res) {
+        res.setHeader('Content-Type', 'application/json');
+        res.end(json_string);
+      }).listen(port, done);
+    });
+
+    after(function(done){
+      server.close(done);
+    })
+
+    describe('and parse option is not passed', function() {
+
+      describe('with default parse_response', function() {
+
+        before(function() {
+          needle.defaults().parse_response.should.eql('all')
+        })
+
+        it('should return object', function(done){
+          needle.get('localhost:' + port, function(err, response, body){
+            should.ifError(err);
+            body.should.have.property('foo', 'bar');
+            done();
+          })
+        })
+
+      })
+
+      describe('and default parse_response is set to false', function() {
+
+        it('does NOT return object when disabled using .defaults', function(done){
+          needle.defaults({ parse_response: false })
+
+          needle.get('localhost:' + port, function(err, response, body) {
+            should.not.exist(err);
+            body.should.be.an.instanceof(Buffer)
+            body.toString().should.eql('{"foo":"bar"}');
+
+            needle.defaults({ parse_response: 'all' });
+            done();
+          })
+        })
+
+
+      })
+
+    })
+
+    describe('and parse option is true', function() {
+
+      describe('and JSON is valid', function() {
+
+        it('should return object', function(done) {
+          needle.get('localhost:' + port, { parse: true }, function(err, response, body){
+            should.not.exist(err);
+            body.should.have.property('foo', 'bar')
+            done();
+          })
+        })
+
+        it('should have a .parser = json property', function(done) {
+          needle.get('localhost:' + port, { parse: true }, function(err, resp) {
+            should.not.exist(err);
+            resp.parser.should.eql('json');
+            done();
+          })
+        })
+
+      });
+
+      describe('and response is empty', function() {
+
+        var old_json_string;
+
+        before(function() {
+          old_json_string = json_string;
+          json_string = "";
+        });
+
+        after(function() {
+          json_string = old_json_string;
+        });
+
+        it('should return an empty string', function(done) {
+          needle.get('localhost:' + port, { parse: true }, function(err, resp) {
+            should.not.exist(err);
+            resp.body.should.equal('');
+            done();
+          })
+        })
+
+      })
+
+      describe('and JSON is invalid', function() {
+
+        var old_json_string;
+
+        before(function() {
+          old_json_string = json_string;
+          json_string = "this is not going to work";
+        });
+
+        after(function() {
+          json_string = old_json_string;
+        });
+
+        it('does not throw', function(done) {
+          (function(){
+            needle.get('localhost:' + port, { parse: true }, done);
+          }).should.not.throw();
+        });
+
+        it('does NOT return object', function(done) {
+          needle.get('localhost:' + port, { parse: true }, function(err, response, body) {
+            should.not.exist(err);
+            body.should.be.a.String;
+            body.toString().should.eql('this is not going to work');
+            done();
+          })
+        })
+
+      });
+
+    })
+
+    describe('and parse option is false', function() {
+
+      it('does NOT return object', function(done){
+        needle.get('localhost:' + port, { parse: false }, function(err, response, body) {
+          should.not.exist(err);
+          body.should.be.an.instanceof(Buffer)
+          body.toString().should.eql('{"foo":"bar"}');
+          done();
+        })
+      })
+
+      it('should NOT have a .parser = json property', function(done) {
+        needle.get('localhost:' + port, { parse: false }, function(err, resp) {
+          should.not.exist(err);
+          should.not.exist(resp.parser);
+          done();
+        })
+      })
+
+    })
+
+    describe('and parse option is "xml"', function() {
+
+      it('does NOT return object', function(done){
+        needle.get('localhost:' + port, { parse: 'xml' }, function(err, response, body) {
+          should.not.exist(err);
+          body.should.be.an.instanceof(Buffer)
+          body.toString().should.eql('{"foo":"bar"}');
+          done();
+        })
+      })
+
+      it('should NOT have a .parser = json property', function(done) {
+        needle.get('localhost:' + port, { parse: 'xml' }, function(err, resp) {
+          should.not.exist(err);
+          should.not.exist(resp.parser);
+          done();
+        })
+      })
+
+    })
+
+  });
+
+  describe('when response is JSON \'false\'', function(){
+
+    var json_string = 'false';
+
+    before(function(done){
+      server = http.createServer(function(req, res) {
+        res.setHeader('Content-Type', 'application/json');
+        res.end(json_string);
+      }).listen(port, done);
+    });
+
+    after(function(done){
+      server.close(done);
+    })
+
+    describe('and parse option is not passed', function() {
+
+      it('should return object', function(done){
+        needle.get('localhost:' + port, function(err, response, body){
+          should.ifError(err);
+          body.should.equal(false);
+          done();
+        })
+      })
+
+    })
+
+    describe('and parse option is true', function() {
+
+      describe('and JSON is valid', function() {
+
+        it('should return object', function(done){
+          needle.get('localhost:' + port, { parse: true }, function(err, response, body){
+            should.not.exist(err);
+            body.should.equal(false)
+            done();
+          })
+        })
+
+      });
+
+      describe('and response is empty', function() {
+
+        var old_json_string;
+
+        before(function() {
+          old_json_string = json_string;
+          json_string = "";
+        });
+
+        after(function() {
+          json_string = old_json_string;
+        });
+
+        it('should return an empty string', function(done) {
+          needle.get('localhost:' + port, { parse: true }, function(err, resp) {
+            should.not.exist(err);
+            resp.body.should.equal('');
+            done();
+          })
+        })
+
+      })
+
+      describe('and JSON is invalid', function() {
+
+        var old_json_string;
+
+        before(function() {
+          old_json_string = json_string;
+          json_string = "this is not going to work";
+        });
+
+        after(function() {
+          json_string = old_json_string;
+        });
+
+        it('does not throw', function(done) {
+          (function(){
+            needle.get('localhost:' + port, { parse: true }, done);
+          }).should.not.throw();
+        });
+
+        it('does NOT return object', function(done) {
+          needle.get('localhost:' + port, { parse: true }, function(err, response, body) {
+            should.not.exist(err);
+            body.should.be.a.String;
+            body.toString().should.eql('this is not going to work');
+            done();
+          })
+        })
+
+      });
+
+    })
+
+    describe('and parse option is false', function() {
+
+      it('does NOT return object', function(done){
+        needle.get('localhost:' + port, { parse: false }, function(err, response, body) {
+          should.not.exist(err);
+          body.should.be.an.instanceof(Buffer)
+          body.toString().should.eql('false');
+          done();
+        })
+      })
+
+    })
+
+    describe('and parse option is "xml"', function() {
+
+      it('does NOT return object', function(done){
+        needle.get('localhost:' + port, { parse: 'xml' }, function(err, response, body) {
+          should.not.exist(err);
+          body.should.be.an.instanceof(Buffer)
+          body.toString().should.eql('false');
+          done();
+        })
+      })
+
+    })
+
+
+  });
+
+  describe('when response is an invalid XML string', function(){
+
+    before(function(done){
+      server = http.createServer(function(req, res) {
+        res.writeHeader(200, {'Content-Type': 'application/xml'})
+        res.end("<post><body there11post>")
+      }).listen(port, done);
+    });
+
+    after(function(done){
+      server.close(done);
+    })
+
+    describe('and parse_response is true', function(){
+
+      it('should return original string', function(done) {
+        needle.get('localhost:' + port, { parse_response: true }, function(err, response, body) {
+          should.not.exist(err);
+          body.should.eql('<post><body there11post>')
+          should.not.exist(body.name);
+          done();
+        })
+      })
+
+      it('should not have a .parser = xml property', function(done) {
+        needle.get('localhost:' + port, { parse_response: true }, function(err, resp) {
+          should.not.exist(err);
+          should.not.exist(resp.parser);
+          done();
+        })
+      })
+
+    })
+
+    describe('and parse response is false', function(){
+
+      it('should return valid object', function(done) {
+        needle.get('localhost:' + port, { parse_response: false }, function(err, response, body){
+          should.not.exist(err);
+          body.toString().should.eql('<post><body there11post>')
+          done();
+        })
+      })
+
+      it('should not have a .parser property', function(done) {
+        needle.get('localhost:' + port, { parse_response: false }, function(err, resp) {
+          should.not.exist(err);
+          should.not.exist(resp.parser)
+          done();
+        })
+      })
+
+    })
+
+  })
+
+  describe('when response is a valid XML string', function(){
+
+    before(function(done) {
+      server = http.createServer(function(req, res) {
+        res.writeHeader(200, {'Content-Type': 'application/xml'})
+        res.end("<post><p>hello</p><p>world</p></post>")
+      }).listen(port, done);
+    });
+
+    after(function(done) {
+      server.close(done);
+    })
+
+    describe('and parse_response is true', function(){
+
+      it('should return valid object', function(done) {
+        needle.get('localhost:' + port, { parse_response: true }, function(err, response, body) {
+          should.not.exist(err);
+          body.name.should.eql('post')
+          body.children[0].name.should.eql('p')
+          body.children[0].value.should.eql('hello')
+
+          body.children[1].name.should.eql('p')
+          body.children[1].value.should.eql('world')
+          done();
+        })
+      })
+
+      it('should have a .parser = xml property', function(done) {
+        needle.get('localhost:' + port, { parse_response: true }, function(err, resp) {
+          should.not.exist(err);
+          resp.parser.should.eql('xml');
+          done();
+        })
+      })
+
+    })
+
+    describe('and parse response is false', function(){
+
+      it('should return valid object', function(done) {
+        needle.get('localhost:' + port, { parse_response: false }, function(err, response, body){
+          should.not.exist(err);
+          body.toString().should.eql('<post><p>hello</p><p>world</p></post>')
+          done();
+        })
+      })
+
+      it('should not have a .parser property', function(done) {
+        needle.get('localhost:' + port, { parse_response: false }, function(err, resp) {
+          should.not.exist(err);
+          should.not.exist(resp.parser)
+          done();
+        })
+      })
+
+    })
+
+  })
+
+
+  describe('valid XML, using xml2js', function() {
+
+    var parsers, origParser;
+
+    before(function(done) {
+      var xml2js = require('xml2js')
+      parsers = require('../lib/parsers');
+      origParser = parsers['application/xml'];
+
+      var customParser = require('xml2js').parseString;
+      parsers.use('xml2js', ['application/xml'], function(buff, cb) {
+        var opts = { explicitRoot: true, explicitArray: false };
+        customParser(buff, opts, cb);
+      })
+
+      server = http.createServer(function(req, res) {
+        res.writeHeader(200, {'Content-Type': 'application/xml'})
+        res.end("<post><p>hello</p><p>world</p></post>")
+      }).listen(port, done);
+    });
+
+    after(function(done) {
+      parsers['application/xml'] = origParser;
+      server.close(done);
+    })
+
+    describe('and parse_response is true', function(){
+
+      it('should return valid object', function(done) {
+        needle.get('localhost:' + port, { parse_response: true }, function(err, response, body) {
+          should.not.exist(err);
+          body.should.eql({ post: { p: ['hello', 'world' ]}})
+          done();
+        })
+      })
+
+      it('should have a .parser = xml property', function(done) {
+        needle.get('localhost:' + port, { parse_response: true }, function(err, resp) {
+          should.not.exist(err);
+          resp.parser.should.eql('xml2js');
+          done();
+        })
+      })
+
+    })
+
+    describe('and parse response is false', function(){
+
+      it('should return valid object', function(done) {
+        needle.get('localhost:' + port, { parse_response: false }, function(err, response, body){
+          should.not.exist(err);
+          body.toString().should.eql('<post><p>hello</p><p>world</p></post>')
+          done();
+        })
+      })
+
+      it('should not have a .parser property', function(done) {
+        needle.get('localhost:' + port, { parse_response: false }, function(err, resp) {
+          should.not.exist(err);
+          should.not.exist(resp.parser)
+          done();
+        })
+      })
+
+    })
+
+  })
+
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/post_data_spec.js b/legacy-libs/grpc/node_modules/needle/test/post_data_spec.js
new file mode 100644 (file)
index 0000000..d9a28c6
--- /dev/null
@@ -0,0 +1,1021 @@
+var needle  = require('..'),
+    http    = require('http'),
+    should  = require('should'),
+    sinon   = require('sinon'),
+    stream  = require('stream'),
+    helpers = require('./helpers');
+
+var multiparts = ['----------------------NODENEEDLEHTTPCLIENT'];
+multiparts.push(['Content-Disposition: form-data; name=\"foo\"'])
+multiparts.push(['\r\nbar\r\n----------------------NODENEEDLEHTTPCLIENT--'])
+// multiparts.push(['Content-Disposition: form-data; name=\"test\"'])
+// multiparts.push(['\r\næµè¯\r\n----------------------NODENEEDLEHTTPCLIENT--'])
+// multiparts.push(['\r\n' + Buffer.from('测试').toString() + '\r\n----------------------NODENEEDLEHTTPCLIENT--'])
+
+
+describe('post data (e.g. request body)', function() {
+
+  var stub, spy, server;
+
+  before(function(done) {
+    server = helpers.server({ port: 4321 }, done);
+  })
+
+  after(function(done) {
+    server.close(done);
+  })
+
+  afterEach(function() {
+    if (stub) stub.restore();
+    if (spy) spy.restore();
+  })
+
+  function get(data, opts, cb) {
+    return needle.request('get', 'http://localhost:' + 4321, data, opts, cb)
+  }
+
+  function post(data, opts, cb) {
+    return needle.request('post', 'http://localhost:' + 4321, data, opts, cb)
+  }
+
+  function spystub_request() {
+    var http_req = http.request;
+    stub = sinon.stub(http, 'request', function(opts, cb) {
+      var req = http_req(opts, cb);
+      spy = sinon.spy(req, 'write');
+      return req;
+    })
+  }
+
+  function check_request(method) {
+    stub.calledOnce.should.be.true;
+    stub.args[0][0]['headers']['host'].should.equal('localhost:4321');
+    stub.args[0][0]['method'].should.equal(method);
+  }
+
+  describe('with multipart: true', function() {
+
+    describe('when null', function() {
+
+      it('sends request (non multipart)', function(done) {
+        spystub_request();
+
+        post(null, { multipart: true }, function(err, resp) {
+          check_request('post');
+          done();
+        })
+      })
+
+      it('doesnt set Content-Type header', function(done) {
+        post(null, { multipart: true }, function(err, resp) {
+          should.not.exist(resp.body.headers['content-type']);
+          done();
+        })
+      })
+
+      it('doesnt change default Accept header', function(done) {
+        post(null, { multipart: true }, function(err, resp) {
+          // resp.body contains 'header' and 'body', mirroring what we sent
+          resp.body.headers['accept'].should.equal('*/*');
+          done();
+        })
+      })
+
+      it('doesnt write anything', function(done) {
+        spystub_request();
+
+        post(null, { multipart: true }, function(err, resp) {
+          spy.called.should.be.false;
+          resp.body.body.should.eql('');
+          done();
+        })
+      })
+
+    })
+
+    describe('when string', function() {
+
+      it('explodes', function() {
+        (function() {
+          post('foobar', { multipart: true })
+        }).should.throw()
+      })
+
+    })
+
+    describe('when object', function() {
+
+      describe('get request', function() {
+
+        it('sends request', function(done) {
+          spystub_request();
+
+          get({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
+            check_request('get');
+            done();
+          })
+        })
+
+        it('sets Content-Type header', function(done) {
+          post({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
+            resp.body.headers['content-type'].should.equal('multipart/form-data; boundary=--------------------NODENEEDLEHTTPCLIENT');
+            done();
+          })
+        })
+
+        it('doesnt change default Accept header', function(done) {
+          post({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
+            resp.body.headers['accept'].should.equal('*/*');
+            done();
+          })
+        })
+
+        it('writes string as buffer', function(done) {
+          spystub_request();
+
+          get({ foo: 'bar' }, { multipart: true }, function(err, resp) {
+            spy.called.should.be.true;
+
+            spy.args[0][0].should.be.an.instanceof(String);
+            spy.args[0][0].toString().should.equal(multiparts.join('\r\n'));
+            resp.body.body.should.eql(multiparts.join('\r\n'));
+            done();
+          })
+        })
+
+        it('writes japanese chars correctly as binary', function(done) {
+          spystub_request();
+
+          get({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
+            spy.called.should.be.true;
+
+            spy.args[0][0].should.be.an.instanceof(String);
+            Buffer.from(spy.args[0][0]).toString('hex').should.eql('2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d22666f6f220d0a0d0a6261720d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2274657374220d0a0d0ac3a6c2b5c28bc3a8c2afc2950d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e542d2d')
+            done();
+          })
+        })
+
+
+      })
+
+      describe('post request', function() {
+
+        it('sends request', function(done) {
+          spystub_request();
+
+          post({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
+            check_request('post');
+            done();
+          })
+        })
+
+        it('writes string as buffer', function(done) {
+          spystub_request();
+
+          post({ foo: 'bar' }, { multipart: true }, function(err, resp) {
+            spy.called.should.be.true;
+            spy.args[0][0].should.be.an.instanceof(String);
+            spy.args[0][0].toString().should.equal(multiparts.join('\r\n'));
+            resp.body.body.should.eql(multiparts.join('\r\n'));
+            done();
+          })
+        })
+
+        it('writes japanese chars correctly as binary', function(done) {
+          spystub_request();
+
+          post({ foo: 'bar', test: '测试' }, { multipart: true }, function(err, resp) {
+            spy.called.should.be.true;
+            spy.args[0][0].should.be.an.instanceof(String);
+            Buffer.from(spy.args[0][0]).toString('hex').should.eql('2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d22666f6f220d0a0d0a6261720d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e540d0a436f6e74656e742d446973706f736974696f6e3a20666f726d2d646174613b206e616d653d2274657374220d0a0d0ac3a6c2b5c28bc3a8c2afc2950d0a2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d2d4e4f44454e4545444c4548545450434c49454e542d2d')
+            done();
+          })
+        })
+
+      })
+
+    })
+
+    describe('when stream', function() {
+
+      var stream_for_multipart;
+
+      before(function() {
+        stream_for_multipart = new stream.Readable();
+        stream_for_multipart._read = function() {
+          this.push('foobar');
+          this.push(null);
+        }
+      })
+
+      it('explodes', function() {
+        (function() {
+          post(stream_for_multipart, { multipart: true })
+        }).should.throw()
+      })
+
+    })
+
+  })
+
+  describe('non multipart', function() {
+
+    describe('when null', function() {
+
+      describe('get request', function() {
+
+        it('sends request', function(done) {
+          spystub_request();
+
+          get(null, {}, function(err, resp) {
+            check_request('get');
+            done();
+          })
+        })
+
+        it('doesnt write anything', function(done) {
+          spystub_request();
+
+          get(null, {}, function(err, resp) {
+            spy.called.should.be.false;
+            resp.body.body.should.eql('');
+            done();
+          })
+        })
+
+      })
+
+      describe('post request', function() {
+
+        it('sends request', function(done) {
+          spystub_request();
+
+          post(null, {}, function(err, resp) {
+            check_request('post');
+            done();
+          })
+        })
+
+        it('doesnt write anything', function(done) {
+          spystub_request();
+
+          post(null, {}, function(err, resp) {
+            spy.called.should.be.false;
+            resp.body.body.should.eql('');
+            done();
+          })
+        })
+
+      })
+
+    })
+
+    describe('when string with no equal sign', function() {
+
+      describe('get request', function() {
+
+        it('explodes', function() {
+          (function() {
+            get('foobar', {})
+          }).should.throw()
+        })
+
+      })
+
+      describe('post request', function() {
+
+        it('sends request', function(done) {
+          spystub_request();
+
+          post('foobar', {}, function(err, resp) {
+            check_request('post');
+            done();
+          })
+        })
+
+        it('writes string as buffer', function(done) {
+          spystub_request();
+
+          post('foobar', {}, function(err, resp) {
+            spy.called.should.be.true;
+            spy.args[0][0].should.be.an.instanceof(Buffer);
+            spy.args[0][0].toString().should.equal('foobar');
+            resp.body.body.should.eql('foobar');
+            done();
+          })
+        })
+
+      })
+
+    })
+
+    describe('when string WITH equal sign', function() {
+
+      describe('get request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request, adding data as querystring', function(done) {
+            spystub_request();
+
+            get('foo=bar', { json: false }, function(err, resp) {
+              check_request('get');
+              stub.args[0][0]['path'].should.equal('/?foo=bar')
+              done();
+            })
+          })
+
+          it('doesnt set Content-Type header', function(done) {
+            get('foo=bar', { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              should.not.exist(resp.body.headers['content-type']);
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            get('foo=bar', { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('doesnt write anything', function(done) {
+            get('foo=bar', { json: false }, function(err, resp) {
+              spy.called.should.be.false;
+              resp.body.body.should.eql('');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request, without setting a querystring', function(done) {
+            spystub_request();
+
+            get('foo=bar', { json: true }, function(err, resp) {
+              check_request('get');
+              stub.args[0][0]['path'].should.equal('/')
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            get('foo=bar', { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            get('foo=bar', { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('writes raw string (assuming it already is JSON, so no JSON.stringify)', function(done) {
+            get('foo=bar', { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].toString().should.eql('foo=bar')
+              resp.body.body.should.eql('foo=bar');
+              done();
+            })
+          })
+
+        })
+
+      })
+
+      describe('post request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post('foo=bar', { json: false }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header to www-form-urlencoded', function(done) {
+            post('foo=bar', { json: false }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            post('foo=bar', { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes as buffer', function(done) {
+            post('foo=bar', { json: false }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].should.be.an.instanceof(Buffer);
+              spy.args[0][0].toString().should.equal('foo=bar');
+              resp.body.body.should.eql('foo=bar');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post('foo=bar', { json: true }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            post('foo=bar', { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            post('foo=bar', { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('writes raw string (assuming it already is JSON, so no JSON.stringify)', function(done) {
+            post('foo=bar', { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              var json = JSON.stringify('foo=bar');
+              spy.args[0][0].toString().should.eql('foo=bar')
+              resp.body.body.should.eql('foo=bar');
+              done();
+            })
+          })
+
+        })
+
+      })
+
+    })
+
+    describe('when object', function() {
+
+      describe('get request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request, adding data as querystring', function(done) {
+            spystub_request();
+
+            get({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              check_request('get');
+              stub.args[0][0]['path'].should.equal('/?foo=bar&test=%E6%B5%8B%E8%AF%95')
+              done();
+            })
+          })
+
+          it('doesnt set Content-Type header', function(done) {
+            get({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              should.not.exist(resp.body.headers['content-type']);
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            get({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('doesnt write anything', function(done) {
+            get({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              spy.called.should.be.false;
+              resp.body.body.should.eql('');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request, without setting a querystring', function(done) {
+            spystub_request();
+
+            get({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              check_request('get');
+              stub.args[0][0]['path'].should.equal('/')
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            get({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            get({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('writes JSON.stringify version of object', function(done) {
+            get({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              var json = JSON.stringify({ foo: 'bar', test: '测试' })
+              spy.args[0][0].toString().should.eql(json)
+              resp.body.body.should.eql(json);
+              done();
+            })
+          })
+
+        })
+
+      })
+
+      describe('post request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header to www-form-urlencoded', function(done) {
+            post({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            post({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes as buffer', function(done) {
+            post({ foo: 'bar', test: '测试' }, { json: false }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].should.be.an.instanceof(Buffer);
+              spy.args[0][0].toString().should.equal('foo=bar&test=%E6%B5%8B%E8%AF%95');
+              resp.body.body.should.eql('foo=bar&test=%E6%B5%8B%E8%AF%95');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: false and content_type = "application/json"', function() {
+
+          var opts = { json: false, content_type: 'application/json' };
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header to application/json', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes as buffer', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].constructor.name.should.eql('Buffer');
+              spy.args[0][0].toString().should.equal('foo=bar&test=%E6%B5%8B%E8%AF%95');
+              resp.body.body.should.eql('foo=bar&test=%E6%B5%8B%E8%AF%95');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: undefined but content-type = application/json', function() {
+
+          var opts = { headers: { 'content-type': 'application/json' } };
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('doesnt change Content-Type header', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('leaves default Accept header', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes JSON.stringified object', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              spy.called.should.be.true;
+              var json = JSON.stringify({ foo: 'bar', test: '测试' })
+              spy.args[0][0].toString().should.eql(json)
+              resp.body.body.should.eql(json);
+              done();
+            })
+          })
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            post({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            post({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('writes JSON.stringified object', function(done) {
+            post({ foo: 'bar', test: '测试' }, { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              var json = JSON.stringify({ foo: 'bar', test: '测试' })
+              spy.args[0][0].toString().should.eql(json)
+              resp.body.body.should.eql(json);
+              done();
+            })
+          })
+
+        })
+
+
+        describe('with json: true and content_type: */* (passed, not default)', function() {
+
+          var opts = { json: true, accept: '*/*' };
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header to application/json', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('respects Accept header set by user', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes JSON.stringified object', function(done) {
+            post({ foo: 'bar', test: '测试' }, opts, function(err, resp) {
+              spy.called.should.be.true;
+              var json = JSON.stringify({ foo: 'bar', test: '测试' })
+              spy.args[0][0].toString().should.eql(json)
+              resp.body.body.should.eql(json);
+              done();
+            })
+          })
+
+        })
+
+      })
+
+    })
+
+    describe('when buffer', function() {
+
+      describe('get request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            get(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              check_request('get');
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            get(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              // should.not.exist(resp.body.headers['content-type']);
+              resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
+
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            get(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes as buffer', function(done) {
+            get(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].should.be.an.instanceof(Buffer);
+              spy.args[0][0].toString().should.equal('foobar');
+              resp.body.body.should.eql('foobar');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request, without setting a querystring', function(done) {
+            spystub_request();
+
+            get(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              check_request('get');
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            get(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            get(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('writes JSON.stringify version of object', function(done) {
+            get(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].toString().should.eql('foobar')
+              resp.body.body.should.eql('foobar');
+              done();
+            })
+          })
+
+        })
+
+      })
+
+      describe('post request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header to www-form-urlencoded', function(done) {
+            post(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            post(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes as buffer', function(done) {
+            post(Buffer.from('foobar'), { json: false }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].should.be.an.instanceof(Buffer);
+              spy.args[0][0].toString().should.equal('foobar');
+              resp.body.body.should.eql('foobar');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            post(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            post(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('passes raw buffer (assuming its a JSON string beneath)', function(done) {
+            post(Buffer.from('foobar'), { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].toString().should.eql('foobar')
+              resp.body.body.should.eql('foobar');
+              done();
+            })
+          })
+
+        })
+
+      })
+
+    })
+
+    describe('when stream', function() {
+
+      var input_stream;
+
+      beforeEach(function() {
+        input_stream = new stream.Readable();
+        input_stream._read = function() {
+          this.push('foobar');
+          this.push(null);
+        }
+      })
+
+      describe('get request', function() {
+
+        it('explodes', function() {
+          (function() {
+            get(input_stream, {})
+          }).should.throw()
+        })
+
+      });
+
+      describe('post request', function() {
+
+        describe('with json: false (default)', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post(input_stream, { json: false }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header to www-form-urlencoded', function(done) {
+            post(input_stream, { json: false }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/x-www-form-urlencoded');
+              done();
+            })
+          })
+
+          it('doesnt change default Accept header', function(done) {
+            post(input_stream, { json: false }, function(err, resp) {
+              // resp.body contains 'header' and 'body', mirroring what we sent
+              resp.body.headers['accept'].should.equal('*/*');
+              done();
+            })
+          })
+
+          it('writes as buffer', function(done) {
+            post(input_stream, { json: false }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].should.be.an.instanceof(Buffer);
+              spy.args[0][0].toString().should.equal('foobar');
+              resp.body.body.should.eql('foobar');
+              done();
+            })
+          })
+
+        })
+
+        describe('with json: true', function() {
+
+          it('sends request', function(done) {
+            spystub_request();
+
+            post(input_stream, { json: true }, function(err, resp) {
+              check_request('post');
+              done();
+            })
+          })
+
+          it('sets Content-Type header', function(done) {
+            post(input_stream, { json: true }, function(err, resp) {
+              resp.body.headers['content-type'].should.equal('application/json; charset=utf-8');
+              done();
+            })
+          })
+
+          it('set Accept header to application/json', function(done) {
+            post(input_stream, { json: true }, function(err, resp) {
+              resp.body.headers['accept'].should.equal('application/json');
+              done();
+            })
+          })
+
+          it('writes JSON.stringified object', function(done) {
+            post(input_stream, { json: true }, function(err, resp) {
+              spy.called.should.be.true;
+              spy.args[0][0].toString().should.eql('foobar')
+              resp.body.body.should.eql('foobar');
+              done();
+            })
+          })
+
+        })
+
+      })
+
+    })
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/proxy_spec.js b/legacy-libs/grpc/node_modules/needle/test/proxy_spec.js
new file mode 100644 (file)
index 0000000..9526e7f
--- /dev/null
@@ -0,0 +1,202 @@
+var helpers = require('./helpers'),
+    should  = require('should'),
+    sinon   = require('sinon'),
+    http    = require('http'),
+    needle  = require('./../');
+
+var port = 7707;
+var url = 'localhost:' + port;
+var nonexisting_host = 'awepfokawepofawe.com';
+
+describe('proxy option', function() {
+
+  var spy, opts;
+
+  function send_request(opts, done) {
+    if (spy) spy.restore();
+    spy = sinon.spy(http, 'request');
+    needle.get(url, opts, done);
+  }
+
+  //////////////////////
+  // proxy opts helpers
+
+  function not_proxied(done) {
+    return function(err, resp) {
+      var path = spy.args[0][0].path;
+      path.should.eql('/'); // not the full original URI
+      spy.restore();
+      done();
+    }
+  }
+
+  function proxied(host, port, done) {
+    return function(err, resp) {
+      var path = spy.args[0][0].path;
+      path.should.eql('http://' + url); // the full original URI
+
+      var http_host = spy.args[0][0].host;
+      if (http_host) http_host.should.eql(host);
+
+      var http_port = spy.args[0][0].port;
+      if (http_port) http_port.should.eql(port);
+
+      spy.restore();
+      done();
+    }
+  }
+
+  //////////////////////
+  // auth helpers
+
+  function get_auth(header) {
+    var token  = header.split(/\s+/).pop();
+    return token && Buffer.from(token, 'base64').toString().split(':');
+  }
+
+  function no_proxy_auth(done) {
+    return function(err, resp) {
+      var headers = spy.args[0][0].headers;
+      Object.keys(headers).should.not.containEql('proxy-authorization');
+      done();
+    }
+  }
+
+  function header_set(name, user, pass, done) {
+    return function(err, resp) {
+      var headers = spy.args[0][0].headers;
+      var auth = get_auth(headers[name]);
+      auth[0].should.eql(user);
+      auth[1].should.eql(pass);
+      done();
+    }
+  }
+
+  function proxy_auth_set(user, pass, done) {
+    return header_set('proxy-authorization', user, pass, done);
+  }
+
+  function basic_auth_set(user, pass, done) {
+    return header_set('authorization', user, pass, done);
+  }
+
+  after(function() {
+    spy.restore();
+  })
+
+  describe('when null proxy is passed', function() {
+
+    it('does not proxy', function(done) {
+      send_request({ proxy: null }, not_proxied(done))
+    })
+
+    describe('but defaults has been set', function() {
+
+      before(function() {
+        needle.defaults({ proxy: 'foobar' });
+      })
+
+      after(function() {
+        needle.defaults({ proxy: null });
+      })
+
+      it('tries to proxy anyway', function(done) {
+        send_request({}, proxied('foobar', 80, done))
+      })
+
+    })
+
+  })
+
+  describe('when weird string is passed', function() {
+
+    it('tries to proxy anyway', function(done) {
+      send_request({ proxy: 'alfalfa' }, proxied('alfalfa', 80, done))
+    })
+  })
+
+  describe('when valid url is passed', function() {
+
+    it('proxies request', function(done) {
+      send_request({ proxy: nonexisting_host + ':123/done' }, proxied(nonexisting_host, '123', done))
+    })
+
+    it('does not set a Proxy-Authorization header', function(done) {
+      send_request({ proxy: nonexisting_host + ':123/done' }, no_proxy_auth(done));
+    })
+
+    describe('and proxy url contains user:pass', function() {
+
+      before(function() {
+        opts = {
+          proxy: 'http://mj:x@' + nonexisting_host + ':123/done'
+        }
+      })
+
+      it('proxies request', function(done) {
+        send_request(opts, proxied(nonexisting_host, '123', done))
+      })
+
+      it('sets Proxy-Authorization header', function(done) {
+        send_request(opts, proxy_auth_set('mj', 'x', done));
+      })
+
+    })
+
+    describe('and a proxy_user is passed', function() {
+
+      before(function() {
+        opts = {
+          proxy: nonexisting_host + ':123',
+          proxy_user: 'someone',
+          proxy_pass: 'else'
+        }
+      })
+
+      it('proxies request', function(done) {
+        send_request(opts, proxied(nonexisting_host, '123', done))
+      })
+
+      it('sets Proxy-Authorization header', function(done) {
+        send_request(opts, proxy_auth_set('someone', 'else', done));
+      })
+
+      describe('and url also contains user:pass', function() {
+
+        it('url user:pass wins', function(done) {
+          var opts = {
+            proxy: 'http://xxx:yyy@' + nonexisting_host + ':123',
+            proxy_user: 'someone',
+            proxy_pass: 'else'
+          }
+
+          send_request(opts, proxy_auth_set('xxx', 'yyy', done));
+        })
+
+      })
+
+      describe('and options.username is also present', function() {
+
+        before(function() {
+          opts = { proxy_user: 'foobar', username: 'someone' };
+        })
+
+        it('a separate Authorization header is set', function(done) {
+          var opts = {
+            proxy: nonexisting_host + ':123',
+            proxy_user: 'someone',
+            proxy_pass: 'else',
+            username: 'test',
+            password: 'X'
+          }
+
+          send_request(opts, basic_auth_set('test', 'X', done));
+        })
+
+      })
+
+    })
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/querystring_spec.js b/legacy-libs/grpc/node_modules/needle/test/querystring_spec.js
new file mode 100644 (file)
index 0000000..34c1748
--- /dev/null
@@ -0,0 +1,128 @@
+var should    = require('should'),
+         stringify = require('../lib/querystring').build;
+
+describe('stringify', function() {
+
+       describe('with null', function() {
+
+               it('throws', function() {
+                       (function() {
+                               var res = stringify(null);
+                       }).should.throw();
+               })
+
+       })
+
+       describe('with a number', function() {
+
+               it('throws', function() {
+                       (function() {
+                               var res = stringify(100);
+                       }).should.throw();
+               })
+
+       })
+
+       describe('with a string', function() {
+
+               describe('that is empty', function() {
+
+                       it('throws', function() {
+                               (function() {
+                                       var res = stringify('');
+                               }).should.throw();
+                       })
+
+               })
+
+               describe('that doesnt contain an equal sign', function() {
+
+                       it('throws', function() {
+                               (function() {
+                                       var res = stringify('boomshagalaga');
+                               }).should.throw();
+                       })
+
+               })
+
+               describe('that contains an equal sign', function() {
+
+                       it('works', function() {
+                               var res = stringify('hello=123');
+                               res.should.eql('hello=123');
+                       })
+
+               })
+
+       })
+
+       describe('with an array', function() {
+
+               describe('with key val objects', function() {
+
+                       it('works', function() {
+                               var res = stringify([ {foo: 'bar'} ]);
+                               res.should.eql('foo=bar');
+                       })
+
+               })
+
+               describe('where all elements are strings with an equal sign', function() {
+
+                       it('works', function() {
+                               var res = stringify([ 'bar=123', 'quux=' ]);
+                               res.should.eql('bar=123&quux=');
+                       })
+
+               })
+
+               describe('with random words', function() {
+
+                       it('throws', function() {
+                               (function() {
+                                       var res = stringify(['hello', 'there']);
+                               }).should.throw();
+                       })
+
+               })
+
+               describe('with integers', function() {
+
+                       it('throws', function() {
+                               (function() {
+                                       var res = stringify([123, 432]);
+                               }).should.throw();
+                       })
+
+               })
+
+       })
+
+       describe('with an object', function() {
+
+                       it('works', function() {
+                               var res = stringify({ test: 100 });
+                               res.should.eql('test=100');
+                       })
+
+                       describe('with object where val is an array', function() {
+
+                               it('works', function() {
+                                       var res = stringify({ foo: ['bar', 'baz'] });
+                                       res.should.eql('foo[]=bar&foo[]=baz');
+                               })
+
+                       })
+
+                       describe('with object where val is an array of key val objects', function() {
+
+                               it('works', function() {
+                                       var res = stringify({ foo: [{'1': 'bar'}, {'2': 'baz'}] });
+                                       res.should.eql('foo[][1]=bar&foo[][2]=baz');
+                               })
+
+                       })
+
+       })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/redirect_spec.js b/legacy-libs/grpc/node_modules/needle/test/redirect_spec.js
new file mode 100644 (file)
index 0000000..9399c98
--- /dev/null
@@ -0,0 +1,392 @@
+var helpers = require('./helpers'),
+    should  = require('should'),
+    sinon   = require('sinon'),
+    needle  = require('./../');
+
+var ports = {
+  http  : 8888,
+  https : 9999
+}
+
+var protocols = {
+  http  : require('http'),
+  https : require('https')
+}
+
+var code = 301;
+var location; // var to set the response location
+
+function response_code() {
+  return code;
+}
+
+function response_headers() {
+  return { 'Content-Type': 'text/plain', 'Location': location }
+}
+
+describe('redirects', function() {
+
+  var spies   = {},
+      servers = {};
+
+  var current_protocol;
+  var hostname = require('os').hostname();
+
+  // open two servers, one that responds to a redirect
+  before(function(done) {
+
+    var conf = {
+      port    : ports.http,
+      code    : response_code,
+      headers : response_headers
+    }
+
+    servers.http = helpers.server(conf, function() {
+      conf.port = ports.https;
+      conf.protocol = 'https';
+      servers.https = helpers.server(conf, done);
+    });
+  })
+
+  after(function(done) {
+    servers.http.close(function() {
+      servers.https.close(done);
+    });
+  })
+
+  var prots = {'http': 'https'};
+  Object.keys(prots).forEach(function(protocol) {
+
+    current_protocol = protocol;
+    var other_protocol = protocol == 'http' ? 'https' : 'http';
+
+    var opts, // each test will modify this
+        host = '127.0.0.1',
+        url  = protocol + '://' + host + ':' + ports[protocol] + '/hello';
+
+    function send_request(opts, cb) {
+      opts.rejectUnauthorized = false;
+      // console.log(' -- sending request ' + url + ' -- redirect to ' + location);
+      needle.post(url, { foo: 'bar' }, opts, cb);
+    }
+
+    function not_followed(done) {
+      send_request(opts, function(err, resp) {
+        resp.statusCode.should.eql(301);
+        if (current_protocol == 'http') {
+          spies.http.callCount.should.eql(1); // only original request
+          spies.https.callCount.should.eql(0);
+        } else {
+          spies.http.callCount.should.eql(0);
+          spies.https.callCount.should.eql(1); // only original request
+        }
+        done();
+      })
+    }
+
+    function followed_same_protocol(done) {
+      send_request(opts, function(err, resp) {
+        // the original request plus the redirect one
+        spies[current_protocol].callCount.should.eql(2);
+        done();
+      })
+
+    }
+
+    function followed_other_protocol(done) {
+      send_request(opts, function(err, resp) {
+        // on new node versions, https.request calls http.request internally,
+        // so we need to amount for that additional call.
+
+        var http_calls = protocols.http.Agent.defaultMaxSockets == Infinity ? 2 : 1;
+
+        spies.http.callCount.should.eql(http_calls); // the one(s) from http.request
+        spies.https.callCount.should.eql(1); // the one from https.request (redirect)
+        done();
+      })
+    }
+
+    // set a spy on [protocol].request
+    // so we can see how many times a request was made
+    before(function() {
+      spies.http  = sinon.spy(protocols.http, 'request');
+      spies.https = sinon.spy(protocols.https, 'request');
+    })
+
+    // and make sure it is restored after each test
+    afterEach(function() {
+      spies.http.reset();
+      spies.https.reset();
+    })
+
+    after(function() {
+      spies.http.restore();
+      spies.https.restore();
+    })
+
+    describe('when overriding defaults', function() {
+
+      before(function() {
+        needle.defaults({ follow_max: 10 });
+        opts = {};
+      })
+
+      after(function() {
+        // reset values to previous
+        needle.defaults({ follow_max: 0 });
+      })
+
+      describe('and redirected to the same path on same host and protocol', function() {
+        before(function() {
+          location = url;
+        })
+        it('does not follow redirect', not_followed);
+      })
+
+      describe('and redirected to the same path on same host and different protocol', function() {
+        before(function() {
+          location = url.replace(protocol, other_protocol).replace(ports[protocol], ports[other_protocol]);
+        })
+
+        it('follows redirect', followed_other_protocol);
+      })
+
+      describe('and redirected to a different path on same host, same protocol', function() {
+        before(function() {
+          location = url.replace('/hello', '/goodbye');
+        })
+        it('follows redirect', followed_same_protocol);
+      })
+
+      describe('and redirected to a different path on same host, different protocol', function() {
+        before(function() {
+          location = url.replace('/hello', '/goodbye').replace(protocol, other_protocol).replace(ports[protocol], ports[other_protocol]);
+        })
+        it('follows redirect', followed_other_protocol);
+      })
+
+      describe('and redirected to same path on another host, same protocol', function() {
+        before(function() {
+          location = url.replace(host, hostname);
+        })
+        it('follows redirect', followed_same_protocol);
+      })
+
+      describe('and redirected to same path on another host, different protocol', function() {
+        before(function() {
+          location = url.replace(host, hostname).replace(protocol, other_protocol).replace(ports[protocol], ports[other_protocol]);
+        })
+        it('follows redirect', followed_other_protocol);
+      })
+
+    })
+
+    // false and null have the same result
+    var values = [false, null];
+    values.forEach(function(value) {
+
+      describe('when follow is ' + value, function() {
+
+        before(function() {
+          opts = { follow: value };
+        })
+
+
+
+        describe('and redirected to the same path on same host and protocol', function() {
+          before(function() {
+            location = url;
+          })
+
+          it('throws an error', function() {
+            (function() {
+              send_request(opts, function() { });
+            }).should.throw;
+          })
+
+        })
+
+      })
+
+    })
+
+    describe('when follow is true', function() {
+
+      before(function() {
+        opts = { follow: true };
+      })
+
+      describe('and redirected to the same path on same host and protocol', function() {
+        before(function() { location = url })
+
+        it('throws an error', function() {
+          (function() {
+            send_request(opts, function() { });
+          }).should.throw;
+        })
+
+      })
+
+    })
+
+    describe('when follow is > 0', function() {
+
+      before(function() {
+        needle.defaults({ follow: 10 });
+      })
+
+      after(function() {
+        needle.defaults({ follow: 0 });
+      })
+
+      describe('when keep_method is false', function() {
+
+        before(function() {
+          opts = { follow_keep_method: false };
+        })
+
+        // defaults to follow host and protocol
+        describe('and redirected to the same path on same host and different protocol', function() {
+
+          before(function() {
+            location = url.replace(protocol, other_protocol);
+          })
+
+          it('follows redirect', followed_other_protocol);
+
+          it('sends a GET request with no data', function(done) {
+            send_request(opts, function(err, resp) {
+              spies.http.args[0][0].method.should.eql('GET');
+              // spy.args[0][3].should.eql(null);
+              done();
+            })
+          })
+
+        })
+
+      })
+
+      describe('and set_referer is true', function() {
+
+        before(function() {
+          opts = { follow_set_referer: true };
+        })
+
+        // defaults to follow host and protocol
+        describe('and redirected to the same path on same host and different protocol', function() {
+
+          before(function() {
+            location = url.replace(protocol, other_protocol);
+          })
+
+          it('follows redirect', followed_other_protocol);
+
+          it('sets Referer header when following redirect', function(done) {
+            send_request(opts, function(err, resp) {
+              spies.http.args[0][0].headers['referer'].should.eql("http://" + host + ":8888/hello");
+              // spies.http.args[0][3].should.eql({ foo: 'bar'});
+              done();
+            })
+          })
+
+        })
+
+      })
+
+      describe('and keep_method is true', function() {
+
+        before(function() {
+          opts = { follow_keep_method: true };
+        })
+
+        // defaults to follow host and protocol
+        describe('and redirected to the same path on same host and different protocol', function() {
+
+          before(function() {
+            location = url.replace(protocol, other_protocol);
+          })
+
+          it('follows redirect', followed_other_protocol);
+
+          it('sends a POST request with the original data', function(done) {
+            send_request(opts, function(err, resp) {
+              spies.http.args[0][0].method.should.eql('post');
+              // spies.http.args[0][3].should.eql({ foo: 'bar'});
+              done();
+            })
+          })
+
+        })
+
+      })
+
+      describe('and if_same_host is false', function() {
+
+        before(function() {
+          opts = { follow_if_same_host: false };
+        })
+
+        // by default it will follow other protocols
+        describe('and redirected to same path on another domain, same protocol', function() {
+          before(function() {
+            location = url.replace(host, hostname);
+          })
+          it('follows redirect', followed_same_protocol);
+        })
+
+      })
+
+      describe('and if_same_host is true', function() {
+
+        before(function() {
+          opts = { follow_if_same_host: true };
+        })
+
+        // by default it will follow other protocols
+        describe('and redirected to same path on another domain, same protocol', function() {
+          before(function() {
+            location = url.replace(host, hostname);
+          })
+
+          it('does not follow redirect', not_followed);
+        })
+
+      })
+
+      describe('and if_same_protocol is false', function() {
+
+        before(function() {
+          opts = { follow_if_same_protocol: false };
+        })
+
+        // by default it will follow other hosts
+        describe('and redirected to same path on another domain, different protocol', function() {
+          before(function() {
+            location = url.replace(host, hostname).replace(protocol, other_protocol).replace(ports[protocol], ports[other_protocol]);
+          })
+          it('follows redirect', followed_other_protocol);
+        })
+
+      })
+
+      describe('and if_same_protocol is true', function() {
+
+        before(function() {
+          opts = { follow_if_same_protocol: true };
+        })
+
+        // by default it will follow other hosts
+        describe('and redirected to same path on another domain, different protocol', function() {
+          before(function() {
+            location = url.replace(host, hostname).replace(protocol, other_protocol).replace(ports[protocol], ports[other_protocol]);
+          })
+          it('does not follow redirect', not_followed);
+        })
+
+      })
+
+    })
+
+  })
+
+});
diff --git a/legacy-libs/grpc/node_modules/needle/test/redirect_with_timeout.js b/legacy-libs/grpc/node_modules/needle/test/redirect_with_timeout.js
new file mode 100644 (file)
index 0000000..7e8e02e
--- /dev/null
@@ -0,0 +1,45 @@
+var should  = require('should')
+var needle  = require('./../')
+
+describe('follow redirects when read_timeout is set', function () {
+
+    it('clear timeout before following redirect', function (done) {
+        var opts = {
+            open_timeout: 1000,
+            read_timeout: 3000,
+            follow: 5,
+            user_agent: 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36'
+        }
+
+        var timedOut = 0
+        var redirects = 0
+
+        var timer = setTimeout(function () {
+            var hasRedirects = redirects > 0
+            hasRedirects.should.equal(true)
+            done()
+        }, opts.read_timeout || 3000)
+
+        var resp = needle.get('http://google.com/', opts, function (err, resp, body) {
+            var noErr = err === null
+            var hasBody = body.length > 0
+            noErr.should.equal(true);
+            hasBody.should.equal(true);
+        });
+
+        resp.on('redirect', function (location) {
+            redirects++
+            // console.info('    Redirected to ', location)
+        })
+
+        resp.on('timeout', function (type) {
+            timedOut++
+            timedOut.should.equal(0)
+            // console.error('   ', type, 'timeout')
+            clearTimeout(timer)
+            done()
+        })
+
+    }).timeout(30000)
+
+})
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/needle/test/request_stream_spec.js b/legacy-libs/grpc/node_modules/needle/test/request_stream_spec.js
new file mode 100644 (file)
index 0000000..1f02c8b
--- /dev/null
@@ -0,0 +1,202 @@
+var fs     = require('fs'),
+    needle = require('..'),
+    stream = require('stream'),
+    http   = require('http'),
+    should = require('should'),
+    sinon  = require('sinon');
+
+var port   = 2233;
+
+describe('request stream length', function() {
+
+  var server, writable;
+
+  function createServer() {
+    return http.createServer(function(req, res) {
+
+      req.on('data', function(chunk) {
+        // console.log(chunk.length);
+      })
+
+      req.on('end', function() {
+        res.writeHeader(200, { 'Content-Type': 'application/json'})
+        res.end(JSON.stringify({ headers: req.headers }))
+      })
+
+    })
+  }
+
+  before(function(done) {
+    server = createServer();
+    server.listen(port, done)
+  })
+
+  beforeEach(function() {
+    writable = new stream.Readable();
+    writable._read = function() {
+      this.push('hello world');
+      this.push(null);
+    }
+  })
+
+  after(function(done) {
+    server.close(done)
+  })
+
+  function send_request(opts, cb) {
+    needle.post('http://localhost:' + port, writable, opts, function(err, resp) {
+      cb(err, resp)
+    })
+  }
+
+  describe('no stream_length set', function() {
+
+    it('doesnt set Content-Length header', function(done) {
+      send_request({}, function(err, resp) {
+        should.not.exist(resp.body.headers['content-length']);
+        done()
+      })
+    })
+
+    it('doesnt work if Transfer-Encoding is set to a blank string', function(done) {
+      send_request({ headers: { 'Transfer-Encoding': '' }}, function(err, resp) {
+        err.code.should.eql('ECONNRESET');
+        done()
+      })
+    })
+
+    it('works if Transfer-Encoding is not set', function(done) {
+      send_request({}, function(err, resp) {
+        should.not.exist(err);
+        resp.statusCode.should.eql(200);
+        done()
+      })
+    })
+
+  })
+
+  describe('stream_length set to invalid value', function() {
+
+    it('sets Content-Length header to that value', function(done) {
+      send_request({ stream_length: 5 }, function(err, resp) {
+        should.exist(err);
+        err.code.should.eql('ECONNRESET');
+        done()
+      })
+    })
+
+    it('doesnt work if Transfer-Encoding is set to a blank string', function(done) {
+      send_request({ stream_length: 5, headers: { 'Transfer-Encoding': '' }}, function(err, resp) {
+        err.code.should.eql('ECONNRESET');
+        done()
+      })
+    })
+
+    it('doesnt work if Transfer-Encoding is not set', function(done) {
+      send_request({ stream_length: 5 }, function(err, resp) {
+        err.code.should.eql('ECONNRESET');
+        done()
+      })
+    })
+
+  })
+
+  describe('stream_length is set to valid value', function() {
+
+    it('sets Content-Length header to that value', function(done) {
+      send_request({ stream_length: 11 }, function(err, resp) {
+        resp.body.headers['content-length'].should.eql('11');
+        done()
+      })
+    })
+
+    it('works if Transfer-Encoding is set to a blank string', function(done) {
+      send_request({ stream_length: 11, headers: { 'Transfer-Encoding': '' }}, function(err, resp) {
+        should.not.exist(err);
+        resp.statusCode.should.eql(200);
+        done()
+      })
+    })
+
+    it('works if Transfer-Encoding is not set', function(done) {
+      send_request({ stream_length: 11 }, function(err, resp) {
+        should.not.exist(err);
+        resp.statusCode.should.eql(200);
+        done()
+      })
+    })
+
+  })
+
+
+  describe('stream_length set to 0', function() {
+
+    describe('stream with path', function() {
+
+      var stub;
+
+      beforeEach(function() {
+        writable.path = '/foo/bar';
+        stub = sinon.stub(fs, 'stat', function(path, cb) {
+          cb(null, { size: 11 })
+        })
+      })
+
+      afterEach(function() {
+        stub.restore();
+      })
+
+      it('sets Content-Length header to streams length', function(done) {
+        send_request({ stream_length: 0 }, function(err, resp) {
+          resp.body.headers['content-length'].should.eql('11');
+          done()
+        })
+      })
+
+      it('works if Transfer-Encoding is set to a blank string', function(done) {
+        send_request({ stream_length: 0, headers: { 'Transfer-Encoding': '' }}, function(err, resp) {
+          should.not.exist(err);
+          resp.statusCode.should.eql(200);
+          done()
+        })
+      })
+
+      it('works if Transfer-Encoding is not set', function(done) {
+        send_request({ stream_length: 0 }, function(err, resp) {
+          should.not.exist(err);
+          resp.statusCode.should.eql(200);
+          done()
+        })
+      })
+
+    })
+
+    describe('stream without path', function() {
+      it('does not set Content-Length header', function(done) {
+        send_request({ stream_length: 0 }, function(err, resp) {
+          should.not.exist(resp.body.headers['content-length']);
+          done()
+        })
+      })
+
+      it('doesnt work if Transfer-Encoding is set to a blank string', function(done) {
+        send_request({ stream_length: 0, headers: { 'Transfer-Encoding': '' }}, function(err, resp) {
+          err.code.should.eql('ECONNRESET');
+          done()
+        })
+      })
+
+      it('works if Transfer-Encoding is not set', function(done) {
+        send_request({ stream_length: 0 }, function(err, resp) {
+          should.not.exist(err);
+          resp.statusCode.should.eql(200);
+          done()
+        })
+      })
+
+    })
+
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/response_stream_spec.js b/legacy-libs/grpc/node_modules/needle/test/response_stream_spec.js
new file mode 100644 (file)
index 0000000..ef20e38
--- /dev/null
@@ -0,0 +1,139 @@
+var should = require('should'),
+    needle = require('./../'),
+    http   = require('http'),
+    stream = require('stream'),
+    fs     = require('fs'),
+    port   = 11111,
+    server;
+
+describe('response streams', function() {
+
+  describe('when the server sends back json', function(){
+
+    before(function() {
+      server = http.createServer(function(req, res) {
+        res.setHeader('Content-Type', 'application/json')
+        res.end('{"foo":"bar"}')
+      }).listen(port);
+    });
+
+    after(function() {
+      server.close();
+    })
+
+    describe('and the client uses streams', function(){
+
+      it('should create a proper streams2 stream', function(done) {
+        var stream = needle.get('localhost:' + port)
+
+        // newer node versions set this to null instead of false
+        var bool = !!stream._readableState.flowing;
+        should.equal(false, bool);
+
+        var readableCalled = false;
+        stream.on('readable', function() {
+          readableCalled = true;
+        })
+
+        stream.on('done', function() {
+          readableCalled.should.be.true;
+          done();
+        });
+
+        stream.resume()
+
+      })
+
+      it('emits a single data item which is our JSON object', function(done) {
+        var stream = needle.get('localhost:' + port)
+
+        var chunks = [];
+        stream.on('readable', function () {
+          while (chunk = this.read()) {
+            chunk.should.be.an.Object;
+            chunks.push(chunk);
+          }
+        })
+
+        stream.on('done', function () {
+          chunks.should.have.length(1)
+          chunks[0].should.have.property('foo', 'bar');
+          done();
+        });
+      })
+
+      it('emits a raw buffer if we do not want to parse JSON', function(done) {
+        var stream  = needle.get('localhost:' + port, { parse: false })
+
+        var chunks = [];
+        stream.on('readable', function () {
+          while (chunk = this.read()) {
+            Buffer.isBuffer(chunk).should.be.true;
+            chunks.push(chunk);
+          }
+        })
+
+        stream.on('done', function() {
+          var body = Buffer.concat(chunks).toString();
+          body.should.equal('{"foo":"bar"}')
+          done();
+        });
+      })
+
+    })
+  })
+
+  describe('when the server sends back what was posted to it', function () {
+    var file = 'asdf.txt';
+
+    before(function(done){
+      server = http.createServer(function(req, res) {
+        res.setHeader('Content-Type', 'application/octet')
+        req.pipe(res);
+      }).listen(port);
+
+      fs.writeFile(file, 'contents of stream', done);
+    });
+
+    after(function(done){
+      server.close();
+      fs.unlink(file, done);
+    })
+
+    it('can PUT a stream', function (done) {
+      var stream = needle.put('localhost:' + port, fs.createReadStream(file), { stream: true });
+
+      var chunks = [];
+      stream.on('readable', function () {
+        while (chunk = this.read()) {
+          Buffer.isBuffer(chunk).should.be.true;
+          chunks.push(chunk);
+        }
+      })
+
+      stream.on('end', function () {
+        var body = Buffer.concat(chunks).toString();
+          body.should.equal('contents of stream')
+          done();
+      });
+    });
+
+    it('can PATCH a stream', function (done) {
+      var stream = needle.patch('localhost:' + port, fs.createReadStream(file), { stream: true });
+
+      var chunks = [];
+      stream.on('readable', function () {
+        while (chunk = this.read()) {
+          Buffer.isBuffer(chunk).should.be.true;
+          chunks.push(chunk);
+        }
+      })
+
+      stream.on('end', function () {
+        var body = Buffer.concat(chunks).toString();
+          body.should.equal('contents of stream')
+          done();
+      });
+    });
+  })
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/socket_pool_spec.js b/legacy-libs/grpc/node_modules/needle/test/socket_pool_spec.js
new file mode 100644 (file)
index 0000000..58ffa14
--- /dev/null
@@ -0,0 +1,66 @@
+var needle  = require('../'),
+    should  = require('should'),
+    http    = require('http');
+
+var server, port = 11112;
+
+describe('socket reuse', function() {
+
+  before(function() {
+    server = http.createServer(function(req, res) {
+      res.setHeader('Content-Type', 'application/json');
+      setTimeout(function() {
+        res.end('{"foo":"bar"}');
+      }, 50);
+    }).listen(port);
+  });
+
+  after(function() {
+    server.close();
+  });
+
+  describe('when sockets are reused', function() {
+
+    var httpAgent = new http.Agent({
+      keepAlive  : true,
+      maxSockets : 1
+    });
+
+    it('does not duplicate listeners on .end', function(done) {
+
+      var last_error;
+      var count = 10;
+
+      function completed(err) {
+        --count || done(last_error);
+      }
+
+      function send() {
+        needle.get('localhost:' + port, { agent: httpAgent }, function(err, resp) {
+          if (err)
+            throw new Error("Unexpected error: " + err);
+
+          // lets go through all sockets and inspect all socket objects
+          for (hostTarget in httpAgent.sockets) {
+            httpAgent.sockets[hostTarget].forEach(function(socket) {
+              // normally, there are 2 internal listeners and 1 needle sets up,
+              // but to be sure the test does not fail even if newer node versions
+              // introduce additional listeners, we use a higher limit.
+              try {
+                socket.listeners('end').length.should.be.below(5, "too many listeners on the socket object's end event");
+              } catch (e) {
+                last_error = e;
+              }
+            });
+          }
+
+          completed();
+        });
+      }
+
+      for (var i = 0; i < count; i++) {
+        send();
+      }
+    });
+  });
+});
diff --git a/legacy-libs/grpc/node_modules/needle/test/url_spec.js b/legacy-libs/grpc/node_modules/needle/test/url_spec.js
new file mode 100644 (file)
index 0000000..8a0fa3e
--- /dev/null
@@ -0,0 +1,155 @@
+var needle  = require('../'),
+    sinon   = require('sinon'),
+    should  = require('should'),
+    http    = require('http'),
+    helpers = require('./helpers');
+
+var port = 3456;
+
+describe('urls', function() {
+
+  var server, url;
+
+  function send_request(cb) {
+    return needle.get(url, cb);
+  }
+
+  before(function(done){
+    server = helpers.server({ port: port }, done);
+  })
+
+  after(function(done) {
+    server.close(done);
+  })
+
+  describe('null URL', function(){
+
+    it('throws', function(){
+      (function() {
+      send_request()
+      }).should.throw();
+    })
+
+  })
+
+  describe('invalid protocol', function(){
+
+    before(function() {
+      url = 'foo://google.com/what'
+    })
+
+    it('does not throw', function(done) {
+      (function() {
+        send_request(function(err) { 
+          done();
+        })
+      }).should.not.throw()
+    })
+
+    it('returns an error', function(done) {
+      send_request(function(err) {
+        err.should.be.an.Error;
+        err.code.should.match(/ENOTFOUND|EADDRINFO|EAI_AGAIN/)
+        done();
+      })
+    })
+
+  })
+
+  describe('invalid host', function(){
+
+    before(function() {
+      url = 'http://s1\\\2.com/'
+    })
+
+    it('fails', function(done) {
+      (function() {
+        send_request(function(){ })
+      }.should.throw(TypeError))
+      done()
+    })
+
+  })
+
+/*
+  describe('invalid path', function(){
+
+    before(function() {
+      url = 'http://www.google.com\\\/x\\\   %^&*() /x2.com/'
+    })
+
+    it('fails', function(done) {
+      send_request(function(err) {
+        err.should.be.an.Error;
+        done();
+      })
+    })
+
+  })
+*/
+
+  describe('valid protocol and path', function() {
+
+    before(function() {
+      url = 'http://localhost:' + port + '/foo';
+    })
+
+    it('works', function(done) {
+      send_request(function(err){
+        should.not.exist(err);
+        done();
+      })
+    })
+
+  })
+
+  describe('no protocol but with slashes and valid path', function() {
+
+    before(function() {
+      url = '//localhost:' + port + '/foo';
+    })
+
+    it('works', function(done) {
+      send_request(function(err){
+        should.not.exist(err);
+        done();
+      })
+    })
+
+  })
+
+  describe('no protocol nor slashes and valid path', function() {
+
+    before(function() {
+      url = 'localhost:' + port + '/foo';
+    })
+
+    it('works', function(done) {
+      send_request(function(err){
+        should.not.exist(err);
+        done();
+      })
+    })
+
+  })
+
+  describe('double encoding', function() {
+
+    var path = '/foo?email=' + encodeURIComponent('what-ever@Example.Com');
+
+    before(function() {
+      url = 'localhost:' + port + path
+    });
+
+    it('should not occur', function(done) {
+      send_request(function(err, res) {
+        should.not.exist(err);
+        should(res.req.path).be.exactly(path);
+        done();
+      });
+
+    });
+
+  })
+
+})
diff --git a/legacy-libs/grpc/node_modules/needle/test/utils/formidable.js b/legacy-libs/grpc/node_modules/needle/test/utils/formidable.js
new file mode 100644 (file)
index 0000000..ba1d983
--- /dev/null
@@ -0,0 +1,17 @@
+var formidable = require('formidable'),
+    http = require('http'),
+    util = require('util');
+
+var port = process.argv[2] || 8888;
+
+http.createServer(function(req, res) {
+  var form = new formidable.IncomingForm();
+  form.parse(req, function(err, fields, files) {
+    res.writeHead(200, {'content-type': 'text/plain'});
+    res.write('received upload:\n\n');
+    console.log(util.inspect({fields: fields, files: files}))
+    res.end(util.inspect({fields: fields, files: files}));
+  });
+}).listen(port);
+
+console.log('HTTP server listening on port ' + port);
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/needle/test/utils/proxy.js b/legacy-libs/grpc/node_modules/needle/test/utils/proxy.js
new file mode 100644 (file)
index 0000000..531bf49
--- /dev/null
@@ -0,0 +1,62 @@
+var http = require('http'),
+    https = require('https'),
+    url = require('url');
+    
+var port = 1234,
+    log  = true,
+    request_auth = false;
+
+http.createServer(function(request, response) {
+
+  console.log(request.headers);
+  console.log("Got request: " + request.url);
+  console.log("Forwarding request to " + request.headers['host']);
+
+  if (request_auth) {
+      if (!request.headers['proxy-authorization']) {
+        response.writeHead(407, {'Proxy-Authenticate': 'Basic realm="proxy.com"'})
+        return response.end('Hello.');        
+      }
+  }
+
+  var remote = url.parse(request.url);
+  var protocol = remote.protocol == 'https:' ? https : http;
+
+  var opts = {
+    host: request.headers['host'],
+    port: remote.port || (remote.protocol == 'https:' ? 443 : 80),
+    method: request.method,
+    path: remote.pathname,
+    headers: request.headers
+  }
+
+  var proxy_request = protocol.request(opts, function(proxy_response){
+
+    proxy_response.on('data', function(chunk) {
+      if (log) console.log(chunk.toString());
+      response.write(chunk, 'binary');
+    });
+    proxy_response.on('end', function() {
+      response.end();
+    });
+
+    response.writeHead(proxy_response.statusCode, proxy_response.headers);
+  });
+
+  request.on('data', function(chunk) {
+    if (log) console.log(chunk.toString());
+    proxy_request.write(chunk, 'binary');
+  });
+
+  request.on('end', function() {
+    proxy_request.end();
+  });
+
+}).listen(port);
+
+process.on('uncaughtException', function(err){
+  console.log('Uncaught exception!');
+  console.log(err);
+});
+
+console.log("Proxy server listening on port " + port);
diff --git a/legacy-libs/grpc/node_modules/needle/test/utils/test.js b/legacy-libs/grpc/node_modules/needle/test/utils/test.js
new file mode 100644 (file)
index 0000000..8d58d70
--- /dev/null
@@ -0,0 +1,104 @@
+// TODO: write specs. :)
+
+var fs = require('fs'),
+    client = require('./../../');
+
+process.env.DEBUG = true;
+
+var response_callback = function(err, resp, body){
+       console.log(err);
+       if(resp) console.log("Got status code " + resp.statusCode)
+       console.log(body);
+}
+
+function simple_head(){
+       client.head('http://www.amazon.com', response_callback);
+}
+
+function simple_get(){
+       client.get('http://www.nodejs.org', response_callback);
+}
+
+function proxy_get(){
+       client.get('https://www.google.com/search?q=nodejs', {proxy: 'http://localhost:1234'}, response_callback);
+}
+
+function auth_get(){
+       client.get('https://www.twitter.com', {username: 'asd', password: '123'}, response_callback);
+}
+
+function simple_post(url){
+
+       var data = {
+               foo: 'bar',
+               baz: {
+                       nested: 'attribute'
+               }
+       }
+
+       client.post(url, data, response_callback);
+
+}
+
+function multipart_post(url){
+
+       var filename = 'test_file.txt';
+       var data = 'Plain text data.\nLorem ipsum dolor sit amet.\nBla bla bla.\n';
+       fs.writeFileSync(filename, data);
+
+       var black_pixel = Buffer.from("data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=".replace(/^data:image\/\w+;base64,/, ""), "base64");
+
+       var data = {
+               foo: 'bar',
+               bar: 'baz',
+               nested: {
+                       my_document: { file: filename, content_type: 'text/plain' },
+                       even: {
+                               more: 'nesting'
+                       }
+               },
+    pixel: { filename: 'black_pixel.gif', buffer: black_pixel, content_type: 'image/gif' },
+    field2: {value: JSON.stringify({"json":[ {"one":1}, {"two":2} ]}), content_type: 'application/json' }
+       }
+
+       client.post(url, data, {multipart: true}, function(err, resp, body){
+
+               console.log(err);
+               console.log("Got status code " + resp.statusCode)
+               console.log(body);
+               fs.unlink(filename);
+
+       });
+
+}
+
+switch(process.argv[2]){
+       case 'head':
+               simple_head();
+               break;
+       case 'get':
+               simple_get();
+               break;
+       case 'auth':
+               auth_get();
+               break;
+       case 'proxy':
+               proxy_get();
+               break;
+       case 'post':
+               simple_post(process.argv[3] || 'http://posttestserver.com/post.php');
+               break;
+       case 'multipart':
+               multipart_post(process.argv[3] || 'http://posttestserver.com/post.php?dir=example');
+               break;
+       case 'all':
+               simple_head();
+               simple_get();
+               auth_get();
+               proxy_get();
+               simple_post(process.argv[3] || 'http://posttestserver.com/post.php');
+               multipart_post(process.argv[3] || 'http://posttestserver.com/post.php?dir=example');
+               break;
+       default:
+               console.log("Usage: ./test.js [head|get|auth|proxy|multipart]")
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/CHANGELOG.md b/legacy-libs/grpc/node_modules/node-pre-gyp/CHANGELOG.md
new file mode 100644 (file)
index 0000000..bed8edc
--- /dev/null
@@ -0,0 +1,432 @@
+# node-pre-gyp changelog
+
+## 0.12.0
+
+- Fixed double-build problem with node v10 (https://github.com/mapbox/node-pre-gyp/pull/428)
+- Added node 11 support in the local database (https://github.com/mapbox/node-pre-gyp/pull/422)
+
+## 0.11.0
+
+- Fixed double-install problem with node v10
+- Significant N-API improvements (https://github.com/mapbox/node-pre-gyp/pull/405)
+
+## 0.10.3
+
+- Now will use `request` over `needle` if request is installed. By default `needle` is used for `https`. This should unbreak proxy support that regressed in v0.9.0
+
+## 0.10.2
+
+- Fixed rc/deep-extent security vulnerability
+- Fixed broken reinstall script do to incorrectly named get_best_napi_version
+
+## 0.10.1
+
+- Fix needle error event (@medns)
+
+## 0.10.0
+
+- Allow for a single-level module path when packing @allenluce (https://github.com/mapbox/node-pre-gyp/pull/371)
+- Log warnings instead of errors when falling back @xzyfer (https://github.com/mapbox/node-pre-gyp/pull/366)
+- Add Node.js v10 support to tests (https://github.com/mapbox/node-pre-gyp/pull/372)
+- Remove retire.js from CI (https://github.com/mapbox/node-pre-gyp/pull/372)
+- Remove support for Node.js v4 due to [EOL on April 30th, 2018](https://github.com/nodejs/Release/blob/7dd52354049cae99eed0e9fe01345b0722a86fde/schedule.json#L14)
+- Update appveyor tests to install default NPM version instead of NPM v2.x for all Windows builds (https://github.com/mapbox/node-pre-gyp/pull/375)
+
+## 0.9.1
+
+- Fixed regression (in v0.9.0) with support for http redirects @allenluce (https://github.com/mapbox/node-pre-gyp/pull/361)
+
+## 0.9.0
+
+- Switched from using `request` to `needle` to reduce size of module deps (https://github.com/mapbox/node-pre-gyp/pull/350)
+
+## 0.8.0
+
+- N-API support (@inspiredware)
+
+## 0.7.1
+
+- Upgraded to tar v4.x
+
+## 0.7.0
+
+ - Updated request and hawk (#347)
+ - Dropped node v0.10.x support
+
+## 0.6.40
+
+ - Improved error reporting if an install fails
+
+## 0.6.39
+
+ - Support for node v9
+ - Support for versioning on `{libc}` to allow binaries to work on non-glic linux systems like alpine linux
+
+
+## 0.6.38
+
+ - Maintaining compatibility (for v0.6.x series) with node v0.10.x
+
+## 0.6.37
+
+ - Solved one part of #276: now now deduce the node ABI from the major version for node >= 2 even when not stored in the abi_crosswalk.json
+ - Fixed docs to avoid mentioning the deprecated and dangerous `prepublish` in package.json (#291)
+ - Add new node versions to crosswalk
+ - Ported tests to use tape instead of mocha
+ - Got appveyor tests passing by downgrading npm and node-gyp
+
+## 0.6.36
+
+ - Removed the running of `testbinary` during install. Because this was regressed for so long, it is too dangerous to re-enable by default. Developers needing validation can call `node-pre-gyp testbinary` directory.
+ - Fixed regression in v0.6.35 for electron installs (now skipping binary validation which is not yet supported for electron)
+
+## 0.6.35
+
+ - No longer recommending `npm ls` in `prepublish` (#291)
+ - Fixed testbinary command (#283) @szdavid92
+
+## 0.6.34
+
+ - Added new node versions to crosswalk, including v8
+ - Upgraded deps to latest versions, started using `^` instead of `~` for all deps.
+
+## 0.6.33
+
+ - Improved support for yarn
+
+## 0.6.32
+
+ - Honor npm configuration for CA bundles (@heikkipora)
+ - Add node-pre-gyp and npm versions to user agent (@addaleax)
+ - Updated various deps
+ - Add known node version for v7.x
+
+## 0.6.31
+
+ - Updated various deps
+
+## 0.6.30
+
+ - Update to npmlog@4.x and semver@5.3.x
+ - Add known node version for v6.5.0
+
+## 0.6.29
+
+ - Add known node versions for v0.10.45, v0.12.14, v4.4.4, v5.11.1, and v6.1.0
+
+## 0.6.28
+
+ - Now more verbose when remote binaries are not available. This is needed since npm is increasingly more quiet by default
+   and users need to know why builds are falling back to source compiles that might then error out.
+
+## 0.6.27
+
+ - Add known node version for node v6
+ - Stopped bundling dependencies
+ - Documented method for module authors to avoid bundling node-pre-gyp
+   - See https://github.com/mapbox/node-pre-gyp/tree/master#configuring for details
+
+## 0.6.26
+
+ - Skip validation for nw runtime (https://github.com/mapbox/node-pre-gyp/pull/181) via @fleg
+
+## 0.6.25
+
+ - Improved support for auto-detection of electron runtime in `node-pre-gyp.find()`
+   - Pull request from @enlight - https://github.com/mapbox/node-pre-gyp/pull/187
+ - Add known node version for 4.4.1 and 5.9.1
+
+## 0.6.24
+
+ - Add known node version for 5.8.0, 5.9.0, and 4.4.0.
+
+## 0.6.23
+
+ - Add known node version for 0.10.43, 0.12.11, 4.3.2, and 5.7.1.
+
+## 0.6.22
+
+ - Add known node version for 4.3.1, and 5.7.0.
+
+## 0.6.21
+
+ - Add known node version for 0.10.42, 0.12.10, 4.3.0, and 5.6.0.
+
+## 0.6.20
+
+ - Add known node version for 4.2.5, 4.2.6, 5.4.0, 5.4.1,and 5.5.0.
+
+## 0.6.19
+
+ - Add known node version for 4.2.4
+
+## 0.6.18
+
+ - Add new known node versions for 0.10.x, 0.12.x, 4.x, and 5.x
+
+## 0.6.17
+
+ - Re-tagged to fix packaging problem of `Error: Cannot find module 'isarray'`
+
+## 0.6.16
+
+ - Added known version in crosswalk for 5.1.0.
+
+## 0.6.15
+
+ - Upgraded tar-pack (https://github.com/mapbox/node-pre-gyp/issues/182)
+ - Support custom binary hosting mirror (https://github.com/mapbox/node-pre-gyp/pull/170)
+ - Added known version in crosswalk for 4.2.2.
+
+## 0.6.14
+
+ - Added node 5.x version
+
+## 0.6.13
+
+ - Added more known node 4.x versions
+
+## 0.6.12
+
+ - Added support for [Electron](http://electron.atom.io/). Just pass the `--runtime=electron` flag when building/installing. Thanks @zcbenz
+
+## 0.6.11
+
+ - Added known node and io.js versions including more 3.x and 4.x versions
+
+## 0.6.10
+
+ - Added known node and io.js versions including 3.x and 4.x versions
+ - Upgraded `tar` dep
+
+## 0.6.9
+
+ - Upgraded `rc` dep
+ - Updated known io.js version: v2.4.0
+
+## 0.6.8
+
+ - Upgraded `semver` and `rimraf` deps
+ - Updated known node and io.js versions
+
+## 0.6.7
+
+ - Fixed `node_abi` versions for io.js 1.1.x -> 1.8.x (should be 43, but was stored as 42) (refs https://github.com/iojs/build/issues/94)
+
+## 0.6.6
+
+ - Updated with known io.js 2.0.0 version
+
+## 0.6.5
+
+ - Now respecting `npm_config_node_gyp` (https://github.com/npm/npm/pull/4887)
+ - Updated to semver@4.3.2
+ - Updated known node v0.12.x versions and io.js 1.x versions.
+
+## 0.6.4
+
+ - Improved support for `io.js` (@fengmk2)
+ - Test coverage improvements (@mikemorris)
+ - Fixed support for `--dist-url` that regressed in 0.6.3
+
+## 0.6.3
+
+ - Added support for passing raw options to node-gyp using `--` separator. Flags passed after
+   the `--` to `node-pre-gyp configure` will be passed directly to gyp while flags passed
+   after the `--` will be passed directly to make/visual studio.
+ - Added `node-pre-gyp configure` command to be able to call `node-gyp configure` directly
+ - Fix issue with require validation not working on windows 7 (@edgarsilva)
+
+## 0.6.2
+
+ - Support for io.js >= v1.0.2
+ - Deferred require of `request` and `tar` to help speed up command line usage of `node-pre-gyp`.
+
+## 0.6.1
+
+ - Fixed bundled `tar` version
+
+## 0.6.0
+
+ - BREAKING: node odd releases like v0.11.x now use `major.minor.patch` for `{node_abi}` instead of `NODE_MODULE_VERSION` (#124)
+ - Added support for `toolset` option in versioning. By default is an empty string but `--toolset` can be passed to publish or install to select alternative binaries that target a custom toolset like C++11. For example to target Visual Studio 2014 modules like node-sqlite3 use `--toolset=v140`.
+ - Added support for `--no-rollback` option to request that a failed binary test does not remove the binary module leaves it in place.
+ - Added support for `--update-binary` option to request an existing binary be re-installed and the check for a valid local module be skipped.
+ - Added support for passing build options from `npm` through `node-pre-gyp` to `node-gyp`: `--nodedir`, `--disturl`, `--python`, and `--msvs_version`
+
+## 0.5.31
+
+ - Added support for deducing node_abi for node.js runtime from previous release if the series is even
+ - Added support for --target=0.10.33
+
+## 0.5.30
+
+ - Repackaged with latest bundled deps
+
+## 0.5.29
+
+ - Added support for semver `build`.
+ - Fixed support for downloading from urls that include `+`.
+
+## 0.5.28
+
+ - Now reporting unix style paths only in reveal command
+
+## 0.5.27
+
+ - Fixed support for auto-detecting s3 bucket name when it contains `.` - @taavo
+ - Fixed support for installing when path contains a `'` - @halfdan
+ - Ported tests to mocha
+
+## 0.5.26
+
+ - Fix node-webkit support when `--target` option is not provided
+
+## 0.5.25
+
+ - Fix bundling of deps
+
+## 0.5.24
+
+ - Updated ABI crosswalk to incldue node v0.10.30 and v0.10.31
+
+## 0.5.23
+
+ - Added `reveal` command. Pass no options to get all versioning data as json. Pass a second arg to grab a single versioned property value
+ - Added support for `--silent` (shortcut for `--loglevel=silent`)
+
+## 0.5.22
+
+ - Fixed node-webkit versioning name (NOTE: node-webkit support still experimental)
+
+## 0.5.21
+
+ - New package to fix `shasum check failed` error with v0.5.20
+
+## 0.5.20
+
+ - Now versioning node-webkit binaries based on major.minor.patch - assuming no compatible ABI across versions (#90)
+
+## 0.5.19
+
+ - Updated to know about more node-webkit releases
+
+## 0.5.18
+
+ - Updated to know about more node-webkit releases
+
+## 0.5.17
+
+ - Updated to know about node v0.10.29 release
+
+## 0.5.16
+
+ - Now supporting all aws-sdk configuration parameters (http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) (#86)
+
+## 0.5.15
+
+ - Fixed installation of windows packages sub directories on unix systems (#84)
+
+## 0.5.14
+
+ - Finished support for cross building using `--target_platform` option (#82)
+ - Now skipping binary validation on install if target arch/platform do not match the host.
+ - Removed multi-arch validing for OS X since it required a FAT node.js binary
+
+## 0.5.13
+
+ - Fix problem in 0.5.12 whereby the wrong versions of mkdirp and semver where bundled.
+
+## 0.5.12
+
+ - Improved support for node-webkit (@Mithgol)
+
+## 0.5.11
+
+ - Updated target versions listing
+
+## 0.5.10
+
+ - Fixed handling of `-debug` flag passed directory to node-pre-gyp (#72)
+ - Added optional second arg to `node_pre_gyp.find` to customize the default versioning options used to locate the runtime binary
+ - Failed install due to `testbinary` check failure no longer leaves behind binary (#70)
+
+## 0.5.9
+
+ - Fixed regression in `testbinary` command causing installs to fail on windows with 0.5.7 (#60)
+
+## 0.5.8
+
+ - Started bundling deps
+
+## 0.5.7
+
+ - Fixed the `testbinary` check, which is used to determine whether to re-download or source compile, to work even in complex dependency situations (#63)
+ - Exposed the internal `testbinary` command in node-pre-gyp command line tool
+ - Fixed minor bug so that `fallback_to_build` option is always respected
+
+## 0.5.6
+
+ - Added support for versioning on the `name` value in `package.json` (#57).
+ - Moved to using streams for reading tarball when publishing (#52)
+
+## 0.5.5
+
+ - Improved binary validation that also now works with node-webkit (@Mithgol)
+ - Upgraded test apps to work with node v0.11.x
+ - Improved test coverage
+
+## 0.5.4
+
+ - No longer depends on external install of node-gyp for compiling builds.
+
+## 0.5.3
+
+ - Reverted fix for debian/nodejs since it broke windows (#45)
+
+## 0.5.2
+
+ - Support for debian systems where the node binary is named `nodejs` (#45)
+ - Added `bin/node-pre-gyp.cmd` to be able to run command on windows locally (npm creates an .npm automatically when globally installed)
+ - Updated abi-crosswalk with node v0.10.26 entry.
+
+## 0.5.1
+
+ - Various minor bug fixes, several improving windows support for publishing.
+
+## 0.5.0
+
+ - Changed property names in `binary` object: now required are `module_name`, `module_path`, and `host`.
+ - Now `module_path` supports versioning, which allows developers to opt-in to using a versioned install path (#18).
+ - Added `remote_path` which also supports versioning.
+ - Changed `remote_uri` to `host`.
+
+## 0.4.2
+
+ - Added support for `--target` flag to request cross-compile against a specific node/node-webkit version.
+ - Added preliminary support for node-webkit
+ - Fixed support for `--target_arch` option being respected in all cases.
+
+## 0.4.1
+
+ - Fixed exception when only stderr is available in binary test (@bendi / #31)
+
+## 0.4.0
+
+ - Enforce only `https:` based remote publishing access.
+ - Added `node-pre-gyp info` command to display listing of published binaries
+ - Added support for changing the directory node-pre-gyp should build in with the `-C/--directory` option.
+ - Added support for S3 prefixes.
+
+## 0.3.1
+
+ - Added `unpublish` command.
+ - Fixed module path construction in tests.
+ - Added ability to disable falling back to build behavior via `npm install --fallback-to-build=false` which overrides setting in a depedencies package.json `install` target.
+
+## 0.3.0
+
+ - Support for packaging all files in `module_path` directory - see `app4` for example
+ - Added `testpackage` command.
+ - Changed `clean` command to only delete `.node` not entire `build` directory since node-gyp will handle that.
+ - `.node` modules must be in a folder of there own since tar-pack will remove everything when it unpacks.
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/LICENSE b/legacy-libs/grpc/node_modules/node-pre-gyp/LICENSE
new file mode 100644 (file)
index 0000000..8f5fce9
--- /dev/null
@@ -0,0 +1,27 @@
+Copyright (c), Mapbox
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice,
+      this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice,
+      this list of conditions and the following disclaimer in the documentation
+      and/or other materials provided with the distribution.
+    * Neither the name of node-pre-gyp nor the names of its contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/README.md b/legacy-libs/grpc/node_modules/node-pre-gyp/README.md
new file mode 100644 (file)
index 0000000..088f2af
--- /dev/null
@@ -0,0 +1,693 @@
+# node-pre-gyp
+
+#### node-pre-gyp makes it easy to publish and install Node.js C++ addons from binaries
+
+[![NPM](https://nodei.co/npm/node-pre-gyp.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-pre-gyp/)
+
+[![Build Status](https://api.travis-ci.org/mapbox/node-pre-gyp.svg)](https://travis-ci.org/mapbox/node-pre-gyp)
+[![Build status](https://ci.appveyor.com/api/projects/status/3nxewb425y83c0gv)](https://ci.appveyor.com/project/Mapbox/node-pre-gyp)
+[![Dependencies](https://david-dm.org/mapbox/node-pre-gyp.svg)](https://david-dm.org/mapbox/node-pre-gyp)
+
+`node-pre-gyp` stands between [npm](https://github.com/npm/npm) and [node-gyp](https://github.com/Tootallnate/node-gyp) and offers a cross-platform method of binary deployment.
+
+### Features
+
+ - A command line tool called `node-pre-gyp` that can install your package's C++ module from a binary.
+ - A variety of developer targeted commands for packaging, testing, and publishing binaries.
+ - A JavaScript module that can dynamically require your installed binary: `require('node-pre-gyp').find`
+
+For a hello world example of a module packaged with `node-pre-gyp` see <https://github.com/springmeyer/node-addon-example> and [the wiki ](https://github.com/mapbox/node-pre-gyp/wiki/Modules-using-node-pre-gyp) for real world examples.
+
+## Credits
+
+ - The module is modeled after [node-gyp](https://github.com/Tootallnate/node-gyp) by [@Tootallnate](https://github.com/Tootallnate)
+ - Motivation for initial development came from [@ErisDS](https://github.com/ErisDS) and the [Ghost Project](https://github.com/TryGhost/Ghost).
+ - Development is sponsored by [Mapbox](https://www.mapbox.com/)
+
+## FAQ
+
+See the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ).
+
+## Depends
+
+ - Node.js >= node v6.x
+
+## Install
+
+`node-pre-gyp` is designed to be installed as a local dependency of your Node.js C++ addon and accessed like:
+
+    ./node_modules/.bin/node-pre-gyp --help
+
+But you can also install it globally:
+
+    npm install node-pre-gyp -g
+
+## Usage
+
+### Commands
+
+View all possible commands:
+
+    node-pre-gyp --help
+
+- clean - Remove the entire folder containing the compiled .node module
+- install - Install pre-built binary for module
+- reinstall - Run "clean" and "install" at once
+- build - Compile the module by dispatching to node-gyp or nw-gyp
+- rebuild - Run "clean" and "build" at once
+- package - Pack binary into tarball
+- testpackage - Test that the staged package is valid
+- publish - Publish pre-built binary
+- unpublish - Unpublish pre-built binary
+- info - Fetch info on published binaries
+
+You can also chain commands:
+
+    node-pre-gyp clean build unpublish publish info
+
+### Options
+
+Options include:
+
+ - `-C/--directory`: run the command in this directory
+ - `--build-from-source`: build from source instead of using pre-built binary
+ - `--update-binary`: reinstall by replacing previously installed local binary with remote binary
+ - `--runtime=node-webkit`: customize the runtime: `node`, `electron` and `node-webkit` are the valid options
+ - `--fallback-to-build`: fallback to building from source if pre-built binary is not available
+ - `--target=0.4.0`: Pass the target node or node-webkit version to compile against
+ - `--target_arch=ia32`: Pass the target arch and override the host `arch`. Valid values are 'ia32','x64', or `arm`.
+ - `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`.
+
+Both `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module.
+
+For example: `npm install --build-from-source=myapp`. This is useful if:
+
+ - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependency with `npm install`.
+ - The larger app also depends on other modules installed with `node-pre-gyp`
+ - You only want to trigger a source compile for `myapp` and the other modules.
+
+### Configuring
+
+This is a guide to configuring your module to use node-pre-gyp.
+
+#### 1) Add new entries to your `package.json`
+
+ - Add `node-pre-gyp` to `dependencies`
+ - Add `aws-sdk` as a `devDependency`
+ - Add a custom `install` script
+ - Declare a `binary` object
+
+This looks like:
+
+```js
+    "dependencies"  : {
+      "node-pre-gyp": "0.6.x"
+    },
+    "devDependencies": {
+      "aws-sdk": "2.x"
+    }
+    "scripts": {
+        "install": "node-pre-gyp install --fallback-to-build"
+    },
+    "binary": {
+        "module_name": "your_module",
+        "module_path": "./lib/binding/",
+        "host": "https://your_module.s3-us-west-1.amazonaws.com"
+    }
+```
+
+For a full example see [node-addon-examples's package.json](https://github.com/springmeyer/node-addon-example/blob/master/package.json).
+
+Let's break this down:
+
+ - Dependencies need to list `node-pre-gyp`
+ - Your devDependencies should list `aws-sdk` so that you can run `node-pre-gyp publish` locally or a CI system. We recommend using `devDependencies` only since `aws-sdk` is large and not needed for `node-pre-gyp install` since it only uses http to fetch binaries
+ - Your `scripts` section should override the `install` target with `"install": "node-pre-gyp install --fallback-to-build"`. This allows node-pre-gyp to be used instead of the default npm behavior of always source compiling with `node-gyp` directly.
+ - Your package.json should contain a `binary` section describing key properties you provide to allow node-pre-gyp to package optimally. They are detailed below.
+
+Note: in the past we recommended putting `node-pre-gyp` in the `bundledDependencies`, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case. Also, for a time we recommended using `"preinstall": "npm install node-pre-gyp"` as an alternative method to avoid needing to bundle. But this did not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908.
+
+##### The `binary` object has three required properties
+
+###### module_name
+
+The name of your native node module. This value must:
+
+ - Match the name passed to [the NODE_MODULE macro](http://nodejs.org/api/addons.html#addons_hello_world)
+ - Must be a valid C variable name (e.g. it cannot contain `-`)
+ - Should not include the `.node` extension.
+
+###### module_path
+
+The location your native module is placed after a build. This should be an empty directory without other Javascript files. This entire directory will be packaged in the binary tarball. When installing from a remote package this directory will be overwritten with the contents of the tarball.
+
+Note: This property supports variables based on [Versioning](#versioning).
+
+###### host
+
+A url to the remote location where you've published tarball binaries (must be `https` not `http`).
+
+It is highly recommended that you use Amazon S3. The reasons are:
+
+  - Various node-pre-gyp commands like `publish` and `info` only work with an S3 host.
+  - S3 is a very solid hosting platform for distributing large files.
+  - We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp.
+
+Why then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-S3 location then it should be possible.
+
+It should also be mentioned that there is an optional and entirely separate npm module called [node-pre-gyp-github](https://github.com/bchr02/node-pre-gyp-github) which is intended to complement node-pre-gyp and be installed along with it. It provides the ability to store and publish your binaries within your repositories GitHub Releases if you would rather not use S3 directly. Installation and usage instructions can be found [here](https://github.com/bchr02/node-pre-gyp-github), but the basic premise is that instead of using the ```node-pre-gyp publish``` command you would use ```node-pre-gyp-github publish```.
+
+##### The `binary` object has two optional properties
+
+###### remote_path
+
+It **is recommended** that you customize this property. This is an extra path to use for publishing and finding remote tarballs. The default value for `remote_path` is `""` meaning that if you do not provide it then all packages will be published at the base of the `host`. It is recommended to provide a value like `./{name}/v{version}` to help organize remote packages in the case that you choose to publish multiple node addons to the same `host`.
+
+Note: This property supports variables based on [Versioning](#versioning).
+
+###### package_name
+
+It is **not recommended** to override this property unless you are also overriding the `remote_path`. This is the versioned name of the remote tarball containing the binary `.node` module and any supporting files you've placed inside the `module_path` directory. Unless you specify `package_name` in your `package.json` then it defaults to `{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz` which allows your binary to work across node versions, platforms, and architectures. If you are using `remote_path` that is also versioned by `./{module_name}/v{version}` then you could remove these variables from the `package_name` and just use: `{node_abi}-{platform}-{arch}.tar.gz`. Then your remote tarball will be looked up at, for example, `https://example.com/your-module/v0.1.0/node-v11-linux-x64.tar.gz`.
+
+Avoiding the version of your module in the `package_name` and instead only embedding in a directory name can be useful when you want to make a quick tag of your module that does not change any C++ code. In this case you can just copy binaries to the new version behind the scenes like:
+
+```sh
+aws s3 sync --acl public-read s3://mapbox-node-binary/sqlite3/v3.0.3/ s3://mapbox-node-binary/sqlite3/v3.0.4/
+```
+
+Note: This property supports variables based on [Versioning](#versioning).
+
+#### 2) Add a new target to binding.gyp
+
+`node-pre-gyp` calls out to `node-gyp` to compile the module and passes variables along like [module_name](#module_name) and [module_path](#module_path).
+
+A new target must be added to `binding.gyp` that moves the compiled `.node` module from `./build/Release/module_name.node` into the directory specified by `module_path`.
+
+Add a target like this at the end of your `targets` list:
+
+```js
+    {
+      "target_name": "action_after_build",
+      "type": "none",
+      "dependencies": [ "<(module_name)" ],
+      "copies": [
+        {
+          "files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
+          "destination": "<(module_path)"
+        }
+      ]
+    }
+```
+
+For a full example see [node-addon-example's binding.gyp](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/binding.gyp).
+
+#### 3) Dynamically require your `.node`
+
+Inside the main js file that requires your addon module you are likely currently doing:
+
+```js
+var binding = require('../build/Release/binding.node');
+```
+
+or:
+
+```js
+var bindings = require('./bindings')
+```
+
+Change those lines to:
+
+```js
+var binary = require('node-pre-gyp');
+var path = require('path');
+var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
+var binding = require(binding_path);
+```
+
+For a full example see [node-addon-example's index.js](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/index.js#L1-L4)
+
+#### 4) Build and package your app
+
+Now build your module from source:
+
+    npm install --build-from-source
+
+The `--build-from-source` tells `node-pre-gyp` to not look for a remote package and instead dispatch to node-gyp to build.
+
+Now `node-pre-gyp` should now also be installed as a local dependency so the command line tool it offers can be found at `./node_modules/.bin/node-pre-gyp`.
+
+#### 5) Test
+
+Now `npm test` should work just as it did before.
+
+#### 6) Publish the tarball
+
+Then package your app:
+
+    ./node_modules/.bin/node-pre-gyp package
+
+Once packaged, now you can publish:
+
+    ./node_modules/.bin/node-pre-gyp publish
+
+Currently the `publish` command pushes your binary to S3. This requires:
+
+ - You have installed `aws-sdk` with `npm install aws-sdk`
+ - You have created a bucket already.
+ - The `host` points to an S3 http or https endpoint.
+ - You have configured node-pre-gyp to read your S3 credentials (see [S3 hosting](#s3-hosting) for details).
+
+You can also host your binaries elsewhere. To do this requires:
+
+ - You manually publish the binary created by the `package` command to an `https` endpoint
+ - Ensure that the `host` value points to your custom `https` endpoint.
+
+#### 7) Automate builds
+
+Now you need to publish builds for all the platforms and node versions you wish to support. This is best automated.
+
+ - See [Appveyor Automation](#appveyor-automation) for how to auto-publish builds on Windows.
+ - See [Travis Automation](#travis-automation) for how to auto-publish builds on OS X and Linux.
+
+#### 8) You're done!
+
+Now publish your module to the npm registry. Users will now be able to install your module from a binary.
+
+What will happen is this:
+
+1. `npm install <your package>` will pull from the npm registry
+2. npm will run the `install` script which will call out to `node-pre-gyp`
+3. `node-pre-gyp` will fetch the binary `.node` module and unpack in the right place
+4. Assuming that all worked, you are done
+
+If a a binary was not available for a given platform and `--fallback-to-build` was used then `node-gyp rebuild` will be called to try to source compile the module.
+
+## N-API Considerations
+
+[N-API](https://nodejs.org/api/n-api.html#n_api_n_api) is an ABI-stable alternative to previous technologies such as [nan](https://github.com/nodejs/nan) which are tied to a specific Node runtime engine. N-API is Node runtime engine agnostic and guarantees modules created today will continue to run, without changes, into the future.
+
+Using `node-pre-gyp` with N-API projects requires a handful of additional configuration values and imposes some additional requirements.
+
+The most significant difference is that an N-API module can be coded to target multiple  N-API versions. Therefore, an N-API module must declare in its `package.json` file which N-API versions the module is designed to run against. In addition, since multiple builds may be required for a single module, path and file names must be specified in way that avoids naming conflicts.
+
+### The `napi_versions` array property
+
+An N-API modules must declare in its `package.json` file, the N-API versions the module is intended to support. This is accomplished by including an `napi-versions` array property in the `binary` object. For example:
+
+```js
+"binary": {
+    "module_name": "your_module",
+    "module_path": "your_module_path",
+    "host": "https://your_bucket.s3-us-west-1.amazonaws.com",
+    "napi_versions": [1,3]
+  }
+```
+
+If the `napi_versions` array property is *not* present, `node-pre-gyp` operates as it always has. Including the `napi_versions` array property instructs `node-pre-gyp` that this is a N-API module build.
+
+When the `napi_versions` array property is present, `node-pre-gyp` fires off multiple operations, one for each of the N-API versions in the array. In the example above, two operations are initiated, one for N-API version 1 and second for N-API version 3. How this version number is communicated is described next.
+
+### The `napi_build_version` value
+
+For each of the N-API module operations `node-pre-gyp` initiates, it ensures that the `napi_build_version` is set appropriately.
+
+This value is of importance in two areas:
+
+1. The C/C++ code which needs to know against which N-API version it should compile.
+2. `node-pre-gyp` itself which must assign appropriate path and file names to avoid collisions.
+
+### Defining `NAPI_VERSION` for the C/C++ code
+
+The `napi_build_version` value is communicated to the C/C++ code by adding this code to the `binding.gyp` file:
+
+```
+"defines": [
+    "NAPI_VERSION=<(napi_build_version)",
+]
+```
+
+This ensures that `NAPI_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build.
+
+> Note that earlier versions of this document recommended defining the symbol `NAPI_BUILD_VERSION`. `NAPI_VERSION` is prefered because it used by the N-API C/C++ headers to configure the specific N-API veriosn being requested. 
+
+### Path and file naming requirements in `package.json`
+
+Since `node-pre-gyp` fires off multiple operations for each request, it is essential that path and file names be created in such a way as to avoid collisions. This is accomplished by imposing additional path and file naming requirements.
+
+Specifically, when performing N-API builds, the `{napi_build_version}` text configuration value  *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text configuration value  *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.)
+
+Here's an example:
+
+```js
+"binary": {
+    "module_name": "your_module",
+    "module_path": "./lib/binding/napi-v{napi_build_version}",
+    "remote_path": "./{module_name}/v{version}/{configuration}/",
+    "package_name": "{platform}-{arch}-napi-v{napi_build_version}.tar.gz",
+    "host": "https://your_bucket.s3-us-west-1.amazonaws.com",
+    "napi_versions": [1,3]
+  }
+```
+
+## Supporting both N-API and NAN builds
+
+You may have a legacy native add-on that you wish to continue supporting for those versions of Node that do not support N-API, as you add N-API support for later Node versions. This can be accomplished by specifying the `node_napi_label` configuration value in the package.json `binary.package_name` property. 
+
+Placing the configuration value `node_napi_label` in the package.json `binary.package_name` property instructs `node-pre-gyp` to build all viable N-API binaries supported by the current Node instance. If the current Node instance does not support N-API, `node-pre-gyp` will request a traditional, non-N-API build. 
+
+The configuration value `node_napi_label` is set by `node-pre-gyp` to the type of build created, `napi` or `node`, and the version number. For N-API builds, the string contains the N-API version nad has values like `napi-v3`. For traditional, non-N-API builds, the string contains the ABI version with values like `node-v46`.
+
+Here's how the `binary` configuration above might be changed to support both N-API and NAN builds:
+
+```js
+"binary": {
+    "module_name": "your_module",
+    "module_path": "./lib/binding/{node_napi_label}",
+    "remote_path": "./{module_name}/v{version}/{configuration}/",
+    "package_name": "{platform}-{arch}-{node_napi_label}.tar.gz",
+    "host": "https://your_bucket.s3-us-west-1.amazonaws.com",
+    "napi_versions": [1,3]
+  }
+```
+
+The C/C++ symbol `NAPI_VERSION` can be used to distinguish N-API and non-N-API builds. The value of `NAPI_VERSION` is set to the integer N-API version for N-API builds and is set to `0` for non-N-API builds. 
+
+For example:
+```C
+#if NAPI_VERSION
+// N-API code goes here
+#else
+// NAN code goes here
+#endif
+```
+
+### Two additional configuration values
+
+The following two configuration values, which were implemented in previous versions of `node-pre-gyp`, continue to exist, but have been replaced by the `node_napi_label` configuration value described above.
+
+1. `napi_version` If N-API is supported by the currently executing Node instance, this value is the N-API version number supported by Node. If N-API is not supported, this value is an empty string.
+
+2. `node_abi_napi` If the value returned for `napi_version` is non empty, this value is `'napi'`. If the value returned for `napi_version` is empty, this value is the value returned for `node_abi`.
+
+These values are present for use in the `binding.gyp` file and may be used as `{napi_version}` and `{node_abi_napi}` for text substituion in the `binary` properties of the `package.json` file.
+
+## S3 Hosting
+
+You can host wherever you choose but S3 is cheap, `node-pre-gyp publish` expects it, and S3 can be integrated well with [Travis.ci](http://travis-ci.org) to automate builds for OS X and Ubuntu, and with [Appveyor](http://appveyor.com) to automate builds for Windows. Here is an approach to do this:
+
+First, get setup locally and test the workflow:
+
+#### 1) Create an S3 bucket
+
+And have your **key** and **secret key** ready for writing to the bucket.
+
+It is recommended to create a IAM user with a policy that only gives permissions to the specific bucket you plan to publish to. This can be done in the [IAM console](https://console.aws.amazon.com/iam/) by: 1) adding a new user, 2) choosing `Attach User Policy`, 3) Using the `Policy Generator`, 4) selecting `Amazon S3` for the service, 5) adding the actions: `DeleteObject`, `GetObject`, `GetObjectAcl`, `ListBucket`, `PutObject`, `PutObjectAcl`, 6) adding an ARN of `arn:aws:s3:::bucket/*` (replacing `bucket` with your bucket name), and finally 7) clicking `Add Statement` and saving the policy. It should generate a policy like:
+
+```js
+{
+  "Version": "2012-10-17",
+  "Statement": [
+    {
+      "Sid": "Stmt1394587197000",
+      "Effect": "Allow",
+      "Action": [
+        "s3:DeleteObject",
+        "s3:GetObject",
+        "s3:GetObjectAcl",
+        "s3:ListBucket",
+        "s3:PutObject",
+        "s3:PutObjectAcl"
+      ],
+      "Resource": [
+        "arn:aws:s3:::node-pre-gyp-tests/*"
+      ]
+    }
+  ]
+}
+```
+
+#### 2) Install node-pre-gyp
+
+Either install it globally:
+
+    npm install node-pre-gyp -g
+
+Or put the local version on your PATH
+
+    export PATH=`pwd`/node_modules/.bin/:$PATH
+
+#### 3) Configure AWS credentials
+
+There are several ways to do this.
+
+You can use any of the methods described at http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html.
+
+Or you can create a `~/.node_pre_gyprc`
+
+Or pass options in any way supported by [RC](https://github.com/dominictarr/rc#standards)
+
+A `~/.node_pre_gyprc` looks like:
+
+```js
+{
+    "accessKeyId": "xxx",
+    "secretAccessKey": "xxx"
+}
+```
+
+Another way is to use your environment:
+
+    export node_pre_gyp_accessKeyId=xxx
+    export node_pre_gyp_secretAccessKey=xxx
+
+You may also need to specify the `region` if it is not explicit in the `host` value you use. The `bucket` can also be specified but it is optional because `node-pre-gyp` will detect it from the `host` value.
+
+#### 4) Package and publish your build
+
+Install the `aws-sdk`:
+
+    npm install aws-sdk
+
+Then publish:
+
+    node-pre-gyp package publish
+
+Note: if you hit an error like `Hostname/IP doesn't match certificate's altnames` it may mean that you need to provide the `region` option in your config.
+
+## Appveyor Automation
+
+[Appveyor](http://www.appveyor.com/) can build binaries and publish the results per commit and supports:
+
+ - Windows Visual Studio 2013 and related compilers
+ - Both 64 bit (x64) and 32 bit (x86) build configurations
+ - Multiple Node.js versions
+
+For an example of doing this see [node-sqlite3's appveyor.yml](https://github.com/mapbox/node-sqlite3/blob/master/appveyor.yml).
+
+Below is a guide to getting set up:
+
+#### 1) Create a free Appveyor account
+
+Go to https://ci.appveyor.com/signup/free and sign in with your GitHub account.
+
+#### 2) Create a new project
+
+Go to https://ci.appveyor.com/projects/new and select the GitHub repo for your module
+
+#### 3) Add appveyor.yml and push it
+
+Once you have committed an `appveyor.yml` ([appveyor.yml reference](http://www.appveyor.com/docs/appveyor-yml)) to your GitHub repo and pushed it AppVeyor should automatically start building your project.
+
+#### 4) Create secure variables
+
+Encrypt your S3 AWS keys by going to <https://ci.appveyor.com/tools/encrypt> and hitting the `encrypt` button.
+
+Then paste the result into your `appveyor.yml`
+
+```yml
+environment:
+  node_pre_gyp_accessKeyId:
+    secure: Dn9HKdLNYvDgPdQOzRq/DqZ/MPhjknRHB1o+/lVU8MA=
+  node_pre_gyp_secretAccessKey:
+    secure: W1rwNoSnOku1r+28gnoufO8UA8iWADmL1LiiwH9IOkIVhDTNGdGPJqAlLjNqwLnL
+```
+
+NOTE: keys are per account but not per repo (this is difference than Travis where keys are per repo but not related to the account used to encrypt them).
+
+#### 5) Hook up publishing
+
+Just put `node-pre-gyp package publish` in your `appveyor.yml` after `npm install`.
+
+#### 6) Publish when you want
+
+You might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:
+
+    SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%
+    if not "%CM%" == "%CM:[publish binary]=%" node-pre-gyp --msvs_version=2013 publish
+
+If your commit message contains special characters (e.g. `&`) this method might fail. An alternative is to use PowerShell, which gives you additional possibilities, like ignoring case by using `ToLower()`:
+
+    ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains('[publish binary]')) { node-pre-gyp --msvs_version=2013 publish }
+
+Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package.
+
+## Travis Automation
+
+[Travis](https://travis-ci.org/) can push to S3 after a successful build and supports both:
+
+ - Ubuntu Precise and OS X (64 bit)
+ - Multiple Node.js versions
+
+For an example of doing this see [node-add-example's .travis.yml](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/.travis.yml).
+
+Note: if you need 32 bit binaries, this can be done from a 64 bit Travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74).
+
+Below is a guide to getting set up:
+
+#### 1) Install the Travis gem
+
+    gem install travis
+
+#### 2) Create secure variables
+
+Make sure you run this command from within the directory of your module.
+
+Use `travis-encrypt` like:
+
+    travis encrypt node_pre_gyp_accessKeyId=${node_pre_gyp_accessKeyId}
+    travis encrypt node_pre_gyp_secretAccessKey=${node_pre_gyp_secretAccessKey}
+
+Then put those values in your `.travis.yml` like:
+
+```yaml
+env:
+  global:
+    - secure: F+sEL/v56CzHqmCSSES4pEyC9NeQlkoR0Gs/ZuZxX1ytrj8SKtp3MKqBj7zhIclSdXBz4Ev966Da5ctmcTd410p0b240MV6BVOkLUtkjZJyErMBOkeb8n8yVfSoeMx8RiIhBmIvEn+rlQq+bSFis61/JkE9rxsjkGRZi14hHr4M=
+    - secure: o2nkUQIiABD139XS6L8pxq3XO5gch27hvm/gOdV+dzNKc/s2KomVPWcOyXNxtJGhtecAkABzaW8KHDDi5QL1kNEFx6BxFVMLO8rjFPsMVaBG9Ks6JiDQkkmrGNcnVdxI/6EKTLHTH5WLsz8+J7caDBzvKbEfTux5EamEhxIWgrI=
+```
+
+More details on Travis encryption at http://about.travis-ci.org/docs/user/encryption-keys/.
+
+#### 3) Hook up publishing
+
+Just put `node-pre-gyp package publish` in your `.travis.yml` after `npm install`.
+
+##### OS X publishing
+
+If you want binaries for OS X in addition to linux you can enable [multi-os for Travis](http://docs.travis-ci.com/user/multi-os/#Setting-.travis.yml)
+
+Use a configuration like:
+
+```yml
+
+language: cpp
+
+os:
+- linux
+- osx
+
+env:
+  matrix:
+    - NODE_VERSION="4"
+    - NODE_VERSION="6"
+
+before_install:
+- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
+- source ~/.nvm/nvm.sh
+- nvm install $NODE_VERSION
+- nvm use $NODE_VERSION
+```
+
+See [Travis OS X Gotchas](#travis-os-x-gotchas) for why we replace `language: node_js` and `node_js:` sections with `language: cpp` and a custom matrix.
+
+Also create platform specific sections for any deps that need install. For example if you need libpng:
+
+```yml
+- if [ $(uname -s) == 'Linux' ]; then apt-get install libpng-dev; fi;
+- if [ $(uname -s) == 'Darwin' ]; then brew install libpng; fi;
+```
+
+For detailed multi-OS examples see [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/.travis.yml) and [node-sqlite3](https://github.com/mapbox/node-sqlite3/blob/master/.travis.yml).
+
+##### Travis OS X Gotchas
+
+First, unlike the Travis Linux machines, the OS X machines do not put `node-pre-gyp` on PATH by default. To do so you will need to:
+
+```sh
+export PATH=$(pwd)/node_modules/.bin:${PATH}
+```
+
+Second, the OS X machines do not support using a matrix for installing different Node.js versions. So you need to bootstrap the installation of Node.js in a cross platform way.
+
+By doing:
+
+```yml
+env:
+  matrix:
+    - NODE_VERSION="4"
+    - NODE_VERSION="6"
+
+before_install:
+ - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm
+ - source ~/.nvm/nvm.sh
+ - nvm install $NODE_VERSION
+ - nvm use $NODE_VERSION
+```
+
+You can easily recreate the previous behavior of this matrix:
+
+```yml
+node_js:
+  - "4"
+  - "6"
+```
+
+#### 4) Publish when you want
+
+You might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:
+
+    COMMIT_MESSAGE=$(git log --format=%B --no-merges -n 1 | tr -d '\n')
+    if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]]; then node-pre-gyp publish; fi;
+
+Then you can trigger new binaries to be built like:
+
+    git commit -a -m "[publish binary]"
+
+Or, if you don't have any changes to make simply run:
+
+    git commit --allow-empty -m "[publish binary]"
+
+WARNING: if you are working in a pull request and publishing binaries from there then you will want to avoid double publishing when Travis CI builds both the `push` and `pr`. You only want to run the publish on the `push` commit. See https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/is_pr_merge.sh which is called from https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/publish.sh for an example of how to do this.
+
+Remember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on Travis see http://about.travis-ci.org/docs/user/deployment/npm/
+
+# Versioning
+
+The `binary` properties of `module_path`, `remote_path`, and `package_name` support variable substitution. The strings are evaluated by `node-pre-gyp` depending on your system and any custom build flags you passed.
+
+ - `node_abi`: The node C++ `ABI` number. This value is available in Javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version.
+ - `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override.
+ - `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override.
+ - `libc` matches `require('detect-libc').family` like `glibc` or `musl` unless the user passes the `--target_libc` option to override.
+ - `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build.
+ - `module_name` - the `binary.module_name` attribute from `package.json`.
+ - `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property).
+ - `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version`
+ - `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that`
+ - `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta`
+
+
+The options are visible in the code at <https://github.com/mapbox/node-pre-gyp/blob/612b7bca2604508d881e1187614870ba19a7f0c5/lib/util/versioning.js#L114-L127>
+
+# Download binary files from a mirror
+
+S3 is broken in China for the well known reason.
+
+Using the `npm` config argument: `--{module_name}_binary_host_mirror` can download binary files through a mirror.
+
+e.g.: Install [v8-profiler](https://www.npmjs.com/package/v8-profiler) from `npm`.
+
+```bash
+$ npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/
+```
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/appveyor.yml b/legacy-libs/grpc/node_modules/node-pre-gyp/appveyor.yml
new file mode 100644 (file)
index 0000000..2e74dbc
--- /dev/null
@@ -0,0 +1,30 @@
+os: Visual Studio 2015
+
+environment:
+  matrix:
+    - nodejs_version: 6
+    - nodejs_version: 10
+
+platform:
+  - x64
+  - x86
+
+shallow_clone: true
+
+install:
+  - ps: Install-Product node $env:nodejs_version $env:Platform
+  - ps: Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
+  - npm config get
+  - node --version
+  - npm --version
+  - node -e "console.log(process.arch);"
+  - IF /I "%PLATFORM%" == "x64" set PATH=C:\Python27-x64;%PATH%
+  - IF /I "%PLATFORM%" == "x86" SET PATH=C:\python27;%PATH%
+  - IF /I "%PLATFORM%" == "x64" CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
+  - IF /I "%PLATFORM%" == "x86" CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
+  - npm install
+  - npm test
+
+build: off
+test: off
+deploy: off
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp b/legacy-libs/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp
new file mode 100644 (file)
index 0000000..737b002
--- /dev/null
@@ -0,0 +1,134 @@
+#!/usr/bin/env node
+
+"use strict";
+
+/**
+ * Set the title.
+ */
+
+process.title = 'node-pre-gyp';
+
+/**
+ * Module dependencies.
+ */
+
+var node_pre_gyp = require('../');
+var log = require('npmlog');
+
+/**
+ * Process and execute the selected commands.
+ */
+
+var prog = new node_pre_gyp.Run();
+var completed = false;
+prog.parseArgv(process.argv);
+
+if (prog.todo.length === 0) {
+  if (~process.argv.indexOf('-v') || ~process.argv.indexOf('--version')) {
+    console.log('v%s', prog.version);
+    return process.exit(0);
+  } else if (~process.argv.indexOf('-h') || ~process.argv.indexOf('--help')) {
+    console.log('%s', prog.usage());
+    return process.exit(0);
+  }
+  console.log('%s', prog.usage());
+  return process.exit(1);
+}
+
+// if --no-color is passed
+if (prog.opts && prog.opts.hasOwnProperty('color') && !prog.opts.color) {
+  log.disableColor();
+}
+
+log.info('it worked if it ends with', 'ok');
+log.verbose('cli', process.argv);
+log.info('using', process.title + '@%s', prog.version);
+log.info('using', 'node@%s | %s | %s', process.versions.node, process.platform, process.arch);
+
+
+/**
+ * Change dir if -C/--directory was passed.
+ */
+
+var dir = prog.opts.directory;
+if (dir) {
+  var fs = require('fs');
+  try {
+    var stat = fs.statSync(dir);
+    if (stat.isDirectory()) {
+      log.info('chdir', dir);
+      process.chdir(dir);
+    } else {
+      log.warn('chdir', dir + ' is not a directory');
+    }
+  } catch (e) {
+    if (e.code === 'ENOENT') {
+      log.warn('chdir', dir + ' is not a directory');
+    } else {
+      log.warn('chdir', 'error during chdir() "%s"', e.message);
+    }
+  }
+}
+
+function run () {
+  var command = prog.todo.shift();
+  if (!command) {
+    // done!
+    completed = true;
+    log.info('ok');
+    return;
+  }
+
+  prog.commands[command.name](command.args, function (err) {
+    if (err) {
+      log.error(command.name + ' error');
+      log.error('stack', err.stack);
+      errorMessage();
+      log.error('not ok');
+      console.log(err.message);
+      return process.exit(1);
+    }
+    var args_array = [].slice.call(arguments, 1);
+    if (args_array.length) {
+      console.log.apply(console, args_array);
+    }
+    // now run the next command in the queue
+    process.nextTick(run);
+  });
+}
+
+process.on('exit', function (code) {
+  if (!completed && !code) {
+    log.error('Completion callback never invoked!');
+    issueMessage();
+    process.exit(6);
+  }
+});
+
+process.on('uncaughtException', function (err) {
+  log.error('UNCAUGHT EXCEPTION');
+  log.error('stack', err.stack);
+  issueMessage();
+  process.exit(7);
+});
+
+function errorMessage () {
+  // copied from npm's lib/util/error-handler.js
+  var os = require('os');
+  log.error('System', os.type() + ' ' + os.release());
+  log.error('command', process.argv.map(JSON.stringify).join(' '));
+  log.error('cwd', process.cwd());
+  log.error('node -v', process.version);
+  log.error(process.title+' -v', 'v' + prog.package.version);
+}
+
+function issueMessage () {
+  errorMessage();
+  log.error('', [ 'This is a bug in `'+process.title+'`.',
+                  'Try to update '+process.title+' and file an issue if it does not help:',
+                  '    <https://github.com/mapbox/'+process.title+'/issues>',
+                ].join('\n'));
+}
+
+// start running the given commands!
+run();
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp.cmd b/legacy-libs/grpc/node_modules/node-pre-gyp/bin/node-pre-gyp.cmd
new file mode 100644 (file)
index 0000000..46e14b5
--- /dev/null
@@ -0,0 +1,2 @@
+@echo off
+node  "%~dp0\node-pre-gyp" %*
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/contributing.md b/legacy-libs/grpc/node_modules/node-pre-gyp/contributing.md
new file mode 100644 (file)
index 0000000..4038fa6
--- /dev/null
@@ -0,0 +1,10 @@
+# Contributing
+
+
+### Releasing a new version:
+
+- Ensure tests are passing on travis and appveyor
+- Run `node scripts/abi_crosswalk.js` and commit any changes
+- Update the changelog
+- Tag a new release like: `git tag -a v0.6.34 -m "tagging v0.6.34" && git push --tags`
+- Run `npm publish`
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/build.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/build.js
new file mode 100644 (file)
index 0000000..43c137e
--- /dev/null
@@ -0,0 +1,51 @@
+"use strict";
+
+module.exports = exports = build;
+
+exports.usage = 'Attempts to compile the module by dispatching to node-gyp or nw-gyp';
+
+var napi = require('./util/napi.js');
+var compile = require('./util/compile.js');
+var handle_gyp_opts = require('./util/handle_gyp_opts.js');
+var configure = require('./configure.js');
+
+function do_build(gyp,argv,callback) {
+    handle_gyp_opts(gyp,argv,function(err,result) {
+        var final_args = ['build'].concat(result.gyp).concat(result.pre);
+        if (result.unparsed.length > 0) {
+            final_args = final_args.
+                          concat(['--']).
+                          concat(result.unparsed);
+        }
+        if (!err && result.opts.napi_build_version) {
+            napi.swap_build_dir_in(result.opts.napi_build_version);
+        }
+        compile.run_gyp(final_args,result.opts,function(err) {
+            if (result.opts.napi_build_version) {
+                napi.swap_build_dir_out(result.opts.napi_build_version);
+            }
+            return callback(err);
+        });
+    });
+}
+
+function build(gyp, argv, callback) {
+
+    // Form up commands to pass to node-gyp:
+    // We map `node-pre-gyp build` to `node-gyp configure build` so that we do not
+    // trigger a clean and therefore do not pay the penalty of a full recompile
+    if (argv.length && (argv.indexOf('rebuild') > -1)) {
+        argv.shift(); // remove `rebuild`
+        // here we map `node-pre-gyp rebuild` to `node-gyp rebuild` which internally means
+        // "clean + configure + build" and triggers a full recompile
+        compile.run_gyp(['clean'],{},function(err) {
+            if (err) return callback(err);
+            configure(gyp,argv,function(err) {
+                if (err) return callback(err);
+                return do_build(gyp,argv,callback);
+            });
+        });
+    } else {
+        return do_build(gyp,argv,callback);        
+    }
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/clean.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/clean.js
new file mode 100644 (file)
index 0000000..e2da17b
--- /dev/null
@@ -0,0 +1,32 @@
+"use strict";
+
+module.exports = exports = clean;
+
+exports.usage = 'Removes the entire folder containing the compiled .node module';
+
+var fs = require('fs');
+var rm = require('rimraf');
+var exists = require('fs').exists || require('path').exists;
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var path = require('path');
+
+function clean (gyp, argv, callback) {
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    var to_delete = opts.module_path;
+    if (!to_delete) {
+        return callback(new Error("module_path is empty, refusing to delete"));
+    } else if (path.normalize(to_delete) == path.normalize(process.cwd())) {
+        return callback(new Error("module_path is not set, refusing to delete"));
+    } else {
+        exists(to_delete, function(found) {
+            if (found) {
+                if (!gyp.opts.silent_clean) console.log('['+package_json.name+'] Removing "%s"', to_delete);
+                return rm(to_delete, callback);
+            }
+            return callback();
+        });
+    }
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/configure.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/configure.js
new file mode 100644 (file)
index 0000000..a6e3438
--- /dev/null
@@ -0,0 +1,52 @@
+"use strict";
+
+module.exports = exports = configure;
+
+exports.usage = 'Attempts to configure node-gyp or nw-gyp build';
+
+var napi = require('./util/napi.js');
+var compile = require('./util/compile.js');
+var handle_gyp_opts = require('./util/handle_gyp_opts.js');
+
+function configure(gyp, argv, callback) {
+    handle_gyp_opts(gyp,argv,function(err,result) {
+        var final_args = result.gyp.concat(result.pre);
+        // pull select node-gyp configure options out of the npm environ
+        var known_gyp_args = ['dist-url','python','nodedir','msvs_version'];
+        known_gyp_args.forEach(function(key) {
+            var val = gyp.opts[key] || gyp.opts[key.replace('-','_')];
+            if (val) {
+               final_args.push('--'+key+'='+val);
+            }
+        });
+        // --ensure=false tell node-gyp to re-install node development headers
+        // but it is only respected by node-gyp install, so we have to call install
+        // as a separate step if the user passes it
+        if (gyp.opts.ensure === false) {
+            var install_args = final_args.concat(['install','--ensure=false']);
+            compile.run_gyp(install_args,result.opts,function(err) {
+                if (err) return callback(err);
+                if (result.unparsed.length > 0) {
+                    final_args = final_args.
+                                  concat(['--']).
+                                  concat(result.unparsed);
+                }
+                compile.run_gyp(['configure'].concat(final_args),result.opts,function(err) {
+                    return callback(err);
+                });
+            });
+        } else {
+            if (result.unparsed.length > 0) {
+                final_args = final_args.
+                              concat(['--']).
+                              concat(result.unparsed);
+            }
+            compile.run_gyp(['configure'].concat(final_args),result.opts,function(err) {
+                if (!err && result.opts.napi_build_version) {
+                    napi.swap_build_dir_out(result.opts.napi_build_version);
+                }
+                return callback(err);
+            });
+        }
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/info.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/info.js
new file mode 100644 (file)
index 0000000..aff9bf8
--- /dev/null
@@ -0,0 +1,40 @@
+"use strict";
+
+module.exports = exports = unpublish;
+
+exports.usage = 'Lists all published binaries (requires aws-sdk)';
+
+var fs = require('fs');
+var log = require('npmlog');
+var versioning = require('./util/versioning.js');
+var s3_setup = require('./util/s3_setup.js');
+var config = require('rc')("node_pre_gyp",{acl:"public-read"});
+
+function unpublish(gyp, argv, callback) {
+    var AWS = require("aws-sdk");
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var opts = versioning.evaluate(package_json, gyp.opts);
+    s3_setup.detect(opts.hosted_path,config);
+    AWS.config.update(config);
+    var s3 =  new AWS.S3();
+    var s3_opts = {  Bucket: config.bucket,
+                     Prefix: config.prefix
+                  };
+    s3.listObjects(s3_opts, function(err, meta){
+        if (err && err.code == 'NotFound') {
+            return callback(new Error('['+package_json.name+'] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/'+config.prefix));
+        } else if(err) {
+            return callback(err);
+        } else {
+            log.verbose(JSON.stringify(meta,null,1));
+            if (meta && meta.Contents) {
+                meta.Contents.forEach(function(obj) {
+                    console.log(obj.Key);
+                });
+            } else {
+                console.error('['+package_json.name+'] No objects found at https://' + s3_opts.Bucket + '.s3.amazonaws.com/'+config.prefix );
+            }
+            return callback();
+        }
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/install.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/install.js
new file mode 100644 (file)
index 0000000..cacce67
--- /dev/null
@@ -0,0 +1,255 @@
+"use strict";
+
+module.exports = exports = install;
+
+exports.usage = 'Attempts to install pre-built binary for module';
+
+var fs = require('fs');
+var path = require('path');
+var log = require('npmlog');
+var existsAsync = fs.exists || path.exists;
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var mkdirp = require('mkdirp');
+
+var npgVersion = 'unknown';
+try {
+    // Read own package.json to get the current node-pre-pyp version.
+    var ownPackageJSON = fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8');
+    npgVersion = JSON.parse(ownPackageJSON).version;
+} catch (e) {}
+
+var http_get = {
+    impl: undefined,
+    type: undefined
+};
+
+try {
+  http_get.impl = require('request');
+  http_get.type = 'request';
+  log.warn("Using request for node-pre-gyp https download");
+} catch (e) {
+  http_get.impl = require('needle');
+  http_get.type = 'needle';
+  log.warn("Using needle for node-pre-gyp https download");
+}
+
+function download(uri,opts,callback) {
+    log.http('GET', uri);
+
+    var req = null;
+
+    // Try getting version info from the currently running npm.
+    var envVersionInfo = process.env.npm_config_user_agent ||
+        'node ' + process.version;
+
+    var requestOpts = {
+        uri: uri.replace('+','%2B'),
+        headers: {
+          'User-Agent': 'node-pre-gyp (v' + npgVersion + ', ' + envVersionInfo + ')'
+        },
+        follow_max: 10,
+    };
+
+    if (opts.cafile) {
+        try {
+            requestOpts.ca = fs.readFileSync(opts.cafile);
+        } catch (e) {
+            return callback(e);
+        }
+    } else if (opts.ca) {
+        requestOpts.ca = opts.ca;
+    }
+
+    var proxyUrl = opts.proxy ||
+                    process.env.http_proxy ||
+                    process.env.HTTP_PROXY ||
+                    process.env.npm_config_proxy;
+    if (proxyUrl) {
+      if (/^https?:\/\//i.test(proxyUrl)) {
+        log.verbose('download', 'using proxy url: "%s"', proxyUrl);
+        requestOpts.proxy = proxyUrl;
+      } else {
+        log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl);
+      }
+    }
+    try {
+        req = http_get.impl.get(requestOpts.uri, requestOpts);
+    } catch (e) {
+        return callback(e);
+    }
+    if (req) {
+      req.on('response', function (res) {
+        log.http(res.statusCode, uri);
+      });
+    }
+    return callback(null,req);
+}
+
+function place_binary(from,to,opts,callback) {
+    download(from,opts,function(err,req) {
+        if (err) return callback(err);
+        if (!req) return callback(new Error("empty req"));
+        var badDownload = false;
+        var extractCount = 0;
+        var hasResponse = false;
+        var tar = require('tar');
+
+        function afterTarball(err) {
+            if (err) return callback(err);
+            if (badDownload) return callback(new Error("bad download"));
+            if (extractCount === 0) {
+                return callback(new Error('There was a fatal problem while downloading/extracting the tarball'));
+            }
+            log.info('tarball', 'done parsing tarball');
+            callback();
+        }
+
+        function filter_func(entry) {
+            log.info('install','unpacking ' + entry.path);
+            extractCount++;
+        }
+
+        // for request compatibility
+        req.on('error', function(err) {
+            badDownload = true;
+            if (!hasResponse) {
+                hasResponse = true;
+                return callback(err);
+            }
+        });
+
+        // for needle compatibility
+        req.on('err', function(err) {
+            badDownload = true;
+            if (!hasResponse) {
+                hasResponse = true;
+                return callback(err);
+            }
+        });
+
+        req.on('close', function () {
+            if (!hasResponse) {
+                hasResponse = true;
+                return callback(new Error('Connection closed while downloading tarball file'));
+            }
+        });
+
+      req.on('response', function(res) {
+            // ignore redirects, needle handles these automatically.
+            if (http_get.type === 'needle' && res.headers.hasOwnProperty('location') && res.headers.location !== '') {
+                return;
+            }
+            if (hasResponse) {
+                return;
+            }
+            hasResponse = true;
+            if (res.statusCode !== 200) {
+                badDownload = true;
+                var err = new Error(res.statusCode + ' status code downloading tarball ' + from);
+                err.statusCode = res.statusCode;
+                return callback(err);
+            }
+            // start unzipping and untaring
+            req.pipe(tar.extract({
+              cwd: to,
+              strip: 1,
+              onentry: filter_func
+            }).on('close', afterTarball).on('error', callback));
+        });
+    });
+}
+
+function do_build(gyp,argv,callback) {
+  var args = ['rebuild'].concat(argv);
+  gyp.todo.push( { name: 'build', args: args } );
+  process.nextTick(callback);
+}
+
+function print_fallback_error(err,opts,package_json) {
+    var fallback_message = ' (falling back to source compile with node-gyp)';
+    var full_message = '';
+    if (err.statusCode !== undefined) {
+        // If we got a network response it but failed to download
+        // it means remote binaries are not available, so let's try to help
+        // the user/developer with the info to debug why
+        full_message = "Pre-built binaries not found for " + package_json.name + "@" + package_json.version;
+        full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")";
+        full_message += fallback_message;
+        log.warn("Tried to download(" + err.statusCode + "): " + opts.hosted_tarball);
+        log.warn(full_message);
+        log.http(err.message);
+    } else {
+        // If we do not have a statusCode that means an unexpected error
+        // happened and prevented an http response, so we output the exact error
+        full_message = "Pre-built binaries not installable for " + package_json.name + "@" + package_json.version;
+        full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")";
+        full_message += fallback_message;
+        log.warn(full_message);
+        log.warn("Hit error " + err.message);
+    }
+}
+
+function install(gyp, argv, callback) {
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+       var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var source_build = gyp.opts['build-from-source'] || gyp.opts.build_from_source;
+    var update_binary = gyp.opts['update-binary'] || gyp.opts.update_binary;
+    var should_do_source_build = source_build === package_json.name || (source_build === true || source_build === 'true');
+    if (should_do_source_build) {
+        log.info('build','requesting source compile');
+        return do_build(gyp,argv,callback);
+    } else {
+        var fallback_to_build = gyp.opts['fallback-to-build'] || gyp.opts.fallback_to_build;
+        var should_do_fallback_build = fallback_to_build === package_json.name || (fallback_to_build === true || fallback_to_build === 'true');
+        // but allow override from npm
+        if (process.env.npm_config_argv) {
+            var cooked = JSON.parse(process.env.npm_config_argv).cooked;
+            var match = cooked.indexOf("--fallback-to-build");
+            if (match > -1 && cooked.length > match && cooked[match+1] == "false") {
+                should_do_fallback_build = false;
+                log.info('install','Build fallback disabled via npm flag: --fallback-to-build=false');
+            }
+        }
+        var opts;
+        try {
+            opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+        } catch (err) {
+            return callback(err);
+        }
+
+        opts.ca = gyp.opts.ca;
+        opts.cafile = gyp.opts.cafile;
+
+        var from = opts.hosted_tarball;
+        var to = opts.module_path;
+        var binary_module = path.join(to,opts.module_name + '.node');
+        existsAsync(binary_module,function(found) {
+            if (found && !update_binary) {
+                console.log('['+package_json.name+'] Success: "' + binary_module + '" already installed');
+                console.log('Pass --update-binary to reinstall or --build-from-source to recompile');
+                return callback();
+            } else {
+                if (!update_binary) log.info('check','checked for "' + binary_module + '" (not found)');
+                mkdirp(to,function(err) {
+                    if (err) {
+                        after_place(err);
+                    } else {
+                        place_binary(from,to,opts,after_place);
+                    }
+                });
+            }
+            function after_place(err) {
+                if (err && should_do_fallback_build) {
+                    print_fallback_error(err,opts,package_json);
+                    return do_build(gyp,argv,callback);
+                } else if (err) {
+                    return callback(err);
+                } else {
+                    console.log('['+package_json.name+'] Success: "' + binary_module + '" is installed via remote');
+                    return callback();
+                }
+            }
+        });
+    }
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/node-pre-gyp.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/node-pre-gyp.js
new file mode 100644 (file)
index 0000000..7d09b5f
--- /dev/null
@@ -0,0 +1,203 @@
+"use strict";
+
+/**
+ * Module exports.
+ */
+
+module.exports = exports;
+
+/**
+ * Module dependencies.
+ */
+
+var fs = require('fs');
+var path = require('path');
+var nopt = require('nopt');
+var log = require('npmlog');
+log.disableProgress();
+var napi = require('./util/napi.js');
+
+var EE = require('events').EventEmitter;
+var inherits = require('util').inherits;
+var commands = [
+      'clean',
+      'install',
+      'reinstall',
+      'build',
+      'rebuild',
+      'package',
+      'testpackage',
+      'publish',
+      'unpublish',
+      'info',
+      'testbinary',
+      'reveal',
+      'configure'
+    ];
+var aliases = {};
+
+// differentiate node-pre-gyp's logs from npm's
+log.heading = 'node-pre-gyp';
+
+exports.find = require('./pre-binding').find;
+
+function Run() {
+  var self = this;
+
+  this.commands = {};
+
+  commands.forEach(function (command) {
+    self.commands[command] = function (argv, callback) {
+      log.verbose('command', command, argv);
+      return require('./' + command)(self, argv, callback);
+    };
+  });
+}
+inherits(Run, EE);
+exports.Run = Run;
+var proto = Run.prototype;
+
+/**
+ * Export the contents of the package.json.
+ */
+
+proto.package = require('../package.json');
+
+/**
+ * nopt configuration definitions
+ */
+
+proto.configDefs = {
+    help: Boolean,     // everywhere
+    arch: String,      // 'configure'
+    debug: Boolean,    // 'build'
+    directory: String, // bin
+    proxy: String,     // 'install'
+    loglevel: String,  // everywhere
+};
+
+/**
+ * nopt shorthands
+ */
+
+proto.shorthands = {
+    release: '--no-debug',
+    C: '--directory',
+    debug: '--debug',
+    j: '--jobs',
+    silent: '--loglevel=silent',
+    silly: '--loglevel=silly',
+    verbose: '--loglevel=verbose',
+};
+
+/**
+ * expose the command aliases for the bin file to use.
+ */
+
+proto.aliases = aliases;
+
+/**
+ * Parses the given argv array and sets the 'opts',
+ * 'argv' and 'command' properties.
+ */
+
+proto.parseArgv = function parseOpts (argv) {
+  this.opts = nopt(this.configDefs, this.shorthands, argv);
+  this.argv = this.opts.argv.remain.slice();
+  var commands = this.todo = [];
+
+  // create a copy of the argv array with aliases mapped
+  argv = this.argv.map(function (arg) {
+    // is this an alias?
+    if (arg in this.aliases) {
+      arg = this.aliases[arg];
+    }
+    return arg;
+  }, this);
+
+  // process the mapped args into "command" objects ("name" and "args" props)
+  argv.slice().forEach(function (arg) {
+    if (arg in this.commands) {
+      var args = argv.splice(0, argv.indexOf(arg));
+      argv.shift();
+      if (commands.length > 0) {
+        commands[commands.length - 1].args = args;
+      }
+      commands.push({ name: arg, args: [] });
+    }
+  }, this);
+  if (commands.length > 0) {
+    commands[commands.length - 1].args = argv.splice(0);
+  }
+
+  // expand commands entries for multiple napi builds
+  var dir = this.opts.directory;
+  if (dir == null) dir = process.cwd();
+  var package_json = JSON.parse(fs.readFileSync(path.join(dir,'package.json')));
+
+  this.todo = napi.expand_commands (package_json, this.opts, commands);
+
+  // support for inheriting config env variables from npm
+  var npm_config_prefix = 'npm_config_';
+  Object.keys(process.env).forEach(function (name) {
+    if (name.indexOf(npm_config_prefix) !== 0) return;
+    var val = process.env[name];
+    if (name === npm_config_prefix + 'loglevel') {
+      log.level = val;
+    } else {
+      // add the user-defined options to the config
+      name = name.substring(npm_config_prefix.length);
+      // avoid npm argv clobber already present args
+      // which avoids problem of 'npm test' calling
+      // script that runs unique npm install commands
+      if (name === 'argv') {
+         if (this.opts.argv &&
+             this.opts.argv.remain &&
+             this.opts.argv.remain.length) {
+            // do nothing
+         } else {
+            this.opts[name] = val;
+         }
+      } else {
+        this.opts[name] = val;
+      }
+    }
+  }, this);
+
+  if (this.opts.loglevel) {
+    log.level = this.opts.loglevel;
+  }
+  log.resume();
+};
+
+/**
+ * Returns the usage instructions for node-pre-gyp.
+ */
+
+proto.usage = function usage () {
+  var str = [
+      '',
+      '  Usage: node-pre-gyp <command> [options]',
+      '',
+      '  where <command> is one of:',
+      commands.map(function (c) {
+        return '    - ' + c + ' - ' + require('./' + c).usage;
+      }).join('\n'),
+      '',
+      'node-pre-gyp@' + this.version + '  ' + path.resolve(__dirname, '..'),
+      'node@' + process.versions.node
+  ].join('\n');
+  return str;
+};
+
+/**
+ * Version number getter.
+ */
+
+Object.defineProperty(proto, 'version', {
+    get: function () {
+      return this.package.version;
+    },
+    enumerable: true
+});
+
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/package.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/package.js
new file mode 100644 (file)
index 0000000..4959265
--- /dev/null
@@ -0,0 +1,56 @@
+"use strict";
+
+module.exports = exports = _package;
+
+exports.usage = 'Packs binary (and enclosing directory) into locally staged tarball';
+
+var fs = require('fs');
+var path = require('path');
+var log = require('npmlog');
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var write = require('fs').createWriteStream;
+var existsAsync = fs.exists || path.exists;
+var mkdirp = require('mkdirp');
+var tar = require('tar');
+
+function _package(gyp, argv, callback) {
+    var packlist = require('npm-packlist');
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    var from = opts.module_path;
+    var binary_module = path.join(from,opts.module_name + '.node');
+    existsAsync(binary_module,function(found) {
+        if (!found) {
+            return callback(new Error("Cannot package because " + binary_module + " missing: run `node-pre-gyp rebuild` first"));
+        }
+        var tarball = opts.staged_tarball;
+        var filter_func = function(entry) {
+            // ensure directories are +x
+            // https://github.com/mapnik/node-mapnik/issues/262
+            log.info('package','packing ' + entry.path);
+            return true;
+        };
+        mkdirp(path.dirname(tarball),function(err) {
+            if (err) return callback(err);
+            packlist({ path: from }).then(function(files) {
+                var base = path.basename(from);
+                files = files.map(function(file) {
+                    return path.join(base, file);
+                });
+                tar.create({
+                    portable: true,
+                    gzip: true,
+                    onentry: filter_func,
+                    file: tarball,
+                    cwd: path.dirname(from)
+                }, files, function(err) {
+                    if (err)  console.error('['+package_json.name+'] ' + err.message);
+                    else log.info('package','Binary staged at "' + tarball + '"');
+                    return callback(err);
+                });
+            }, callback);
+        });
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/pre-binding.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/pre-binding.js
new file mode 100644 (file)
index 0000000..09e076d
--- /dev/null
@@ -0,0 +1,30 @@
+"use strict";
+
+var versioning = require('../lib/util/versioning.js');
+var napi = require('../lib/util/napi.js');
+var existsSync = require('fs').existsSync || require('path').existsSync;
+var path = require('path');
+
+module.exports = exports;
+
+exports.usage = 'Finds the require path for the node-pre-gyp installed module';
+
+exports.validate = function(package_json,opts) {
+    versioning.validate_config(package_json,opts);
+};
+
+exports.find = function(package_json_path,opts) {
+   if (!existsSync(package_json_path)) {
+        throw new Error("package.json does not exist at " + package_json_path);
+   }
+   var package_json = require(package_json_path);
+   versioning.validate_config(package_json,opts);
+   var napi_build_version;
+   if (napi.get_napi_build_versions (package_json, opts)) {
+       napi_build_version = napi.get_best_napi_build_version(package_json, opts);
+   }
+   opts = opts || {};
+   if (!opts.module_root) opts.module_root = path.dirname(package_json_path);
+   var meta = versioning.evaluate(package_json,opts,napi_build_version);
+   return meta.module;
+};
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/publish.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/publish.js
new file mode 100644 (file)
index 0000000..376e398
--- /dev/null
@@ -0,0 +1,79 @@
+"use strict";
+
+module.exports = exports = publish;
+
+exports.usage = 'Publishes pre-built binary (requires aws-sdk)';
+
+var fs = require('fs');
+var path = require('path');
+var log = require('npmlog');
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var s3_setup = require('./util/s3_setup.js');
+var existsAsync = fs.exists || path.exists;
+var url = require('url');
+var config = require('rc')("node_pre_gyp",{acl:"public-read"});
+
+function publish(gyp, argv, callback) {
+    var AWS = require("aws-sdk");
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    var tarball = opts.staged_tarball;
+    existsAsync(tarball,function(found) {
+        if (!found) {
+            return callback(new Error("Cannot publish because " + tarball + " missing: run `node-pre-gyp package` first"));
+        }
+        log.info('publish', 'Detecting s3 credentials');
+        s3_setup.detect(opts.hosted_path,config);
+        var key_name = url.resolve(config.prefix,opts.package_name);
+        log.info('publish', 'Authenticating with s3');
+        AWS.config.update(config);
+        var s3 =  new AWS.S3();
+        var s3_opts = {  Bucket: config.bucket,
+                         Key: key_name
+                      };
+        var remote_package = 'https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key;
+        log.info('publish', 'Checking for existing binary at ' + remote_package);
+        s3.headObject(s3_opts, function(err, meta){
+            if (meta) log.info('publish', JSON.stringify(meta));
+            if (err && err.code == 'NotFound') {
+                // we are safe to publish because
+                // the object does not already exist
+                log.info('publish', 'Preparing to put object');
+                var s3_put = new AWS.S3();
+                var s3_put_opts = {  ACL: config.acl,
+                                     Body: fs.createReadStream(tarball),
+                                     Bucket: config.bucket,
+                                     Key: key_name
+                                  };
+                log.info('publish', 'Putting object');
+                try {
+                    s3_put.putObject(s3_put_opts, function(err, resp){
+                        log.info('publish', 'returned from putting object');
+                        if(err) {
+                           log.info('publish', 's3 putObject error: "' + err + '"');
+                           return callback(err);
+                        }
+                        if (resp) log.info('publish', 's3 putObject response: "' + JSON.stringify(resp) + '"');
+                        log.info('publish', 'successfully put object');
+                        console.log('['+package_json.name+'] published to ' + remote_package);
+                        return callback();
+                    });
+              } catch (err) {
+                   log.info('publish', 's3 putObject error: "' + err + '"');
+                   return callback(err);
+              }
+            } else if (err) {
+                log.info('publish', 's3 headObject error: "' + err + '"');
+                return callback(err);
+            } else {
+                log.error('publish','Cannot publish over existing version');
+                log.error('publish',"Update the 'version' field in package.json and try again");
+                log.error('publish','If the previous version was published in error see:');
+                log.error('publish','\t node-pre-gyp unpublish');
+                return callback(new Error('Failed publishing to ' + remote_package));
+            }
+        });
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/rebuild.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/rebuild.js
new file mode 100644 (file)
index 0000000..615a524
--- /dev/null
@@ -0,0 +1,21 @@
+"use strict";
+
+module.exports = exports = rebuild;
+
+exports.usage = 'Runs "clean" and "build" at once';
+
+var fs = require('fs');
+var napi = require('./util/napi.js');
+
+function rebuild (gyp, argv, callback) {
+  var package_json = JSON.parse(fs.readFileSync('./package.json'));
+  var commands = [
+    { name: 'clean', args: [] },
+    { name: 'build', args: ['rebuild'] }
+    ];
+  commands = napi.expand_commands(package_json, gyp.opts, commands);
+  for (var i = commands.length; i !== 0; i--) {
+    gyp.todo.unshift(commands[i-1]);
+  }
+  process.nextTick(callback);
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/reinstall.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/reinstall.js
new file mode 100644 (file)
index 0000000..10e85fc
--- /dev/null
@@ -0,0 +1,20 @@
+"use strict";
+
+module.exports = exports = rebuild;
+
+exports.usage = 'Runs "clean" and "install" at once';
+
+var fs = require('fs');
+var napi = require('./util/napi.js');
+
+function rebuild (gyp, argv, callback) {
+  var package_json = JSON.parse(fs.readFileSync('./package.json'));
+  var installArgs = [];
+  var napi_build_version = napi.get_best_napi_build_version(package_json, gyp.opts);
+  if (napi_build_version != null) installArgs = [ napi.get_command_arg (napi_build_version) ];
+  gyp.todo.unshift(
+      { name: 'clean', args: [] },
+      { name: 'install', args: installArgs }
+  );
+  process.nextTick(callback);
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/reveal.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/reveal.js
new file mode 100644 (file)
index 0000000..13d2f72
--- /dev/null
@@ -0,0 +1,33 @@
+"use strict";
+
+module.exports = exports = reveal;
+
+exports.usage = 'Reveals data on the versioned binary';
+
+var fs = require('fs');
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+
+function unix_paths(key, val) {
+    return val && val.replace ? val.replace(/\\/g, '/') : val;
+}
+
+function reveal(gyp, argv, callback) {
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    var hit = false;
+    // if a second arg is passed look to see
+    // if it is a known option
+    //console.log(JSON.stringify(gyp.opts,null,1))
+    var remain = gyp.opts.argv.remain[gyp.opts.argv.remain.length-1];
+    if (remain && opts.hasOwnProperty(remain)) {
+        console.log(opts[remain].replace(/\\/g, '/'));
+        hit = true;
+    }
+    // otherwise return all options as json
+    if (!hit) {
+        console.log(JSON.stringify(opts,unix_paths,2));
+    }
+    return callback();
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/testbinary.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/testbinary.js
new file mode 100644 (file)
index 0000000..453987c
--- /dev/null
@@ -0,0 +1,81 @@
+"use strict";
+
+module.exports = exports = testbinary;
+
+exports.usage = 'Tests that the binary.node can be required';
+
+var fs = require('fs');
+var path = require('path');
+var log = require('npmlog');
+var cp = require('child_process');
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var path = require('path');
+
+function testbinary(gyp, argv, callback) {
+    var args = [];
+    var options = {};
+    var shell_cmd = process.execPath;
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    // skip validation for runtimes we don't explicitly support (like electron)
+    if (opts.runtime &&
+        opts.runtime !== 'node-webkit' &&
+        opts.runtime !== 'node') {
+        return callback();
+    }
+    var nw = (opts.runtime && opts.runtime === 'node-webkit');
+    // ensure on windows that / are used for require path
+    var binary_module = opts.module.replace(/\\/g, '/');
+    if ((process.arch != opts.target_arch) ||
+        (process.platform != opts.target_platform)) {
+        var msg = "skipping validation since host platform/arch (";
+        msg += process.platform+'/'+process.arch+")";
+        msg += " does not match target (";
+        msg += opts.target_platform+'/'+opts.target_arch+")";
+        log.info('validate', msg);
+        return callback();
+    }
+    if (nw) {
+        options.timeout = 5000;
+        if (process.platform === 'darwin') {
+            shell_cmd = 'node-webkit';
+        } else if (process.platform === 'win32') {
+            shell_cmd = 'nw.exe';
+        } else {
+            shell_cmd = 'nw';
+        }
+        var modulePath = path.resolve(binary_module);
+        var appDir = path.join(__dirname, 'util', 'nw-pre-gyp');
+        args.push(appDir);
+        args.push(modulePath);
+        log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'");
+        cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) {
+            // check for normal timeout for node-webkit
+            if (err) {
+                if (err.killed === true && err.signal && err.signal.indexOf('SIG') > -1) {
+                    return callback();
+                }
+                var stderrLog = stderr.toString();
+                log.info('stderr', stderrLog);
+                if( /^\s*Xlib:\s*extension\s*"RANDR"\s*missing\s*on\s*display\s*":\d+\.\d+"\.\s*$/.test(stderrLog) ){
+                    log.info('RANDR', 'stderr contains only RANDR error, ignored');
+                    return callback();
+                }
+                return callback(err);
+            }
+            return callback();
+        });
+        return;
+    }
+    args.push('--eval');
+    args.push("require('" + binary_module.replace(/'/g, '\'') +"')");
+    log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' ') + "'");
+    cp.execFile(shell_cmd, args, options, function(err, stdout, stderr) {
+        if (err) {
+            return callback(err, { stdout:stdout, stderr:stderr});
+        }
+        return callback();
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/testpackage.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/testpackage.js
new file mode 100644 (file)
index 0000000..9091bc3
--- /dev/null
@@ -0,0 +1,55 @@
+"use strict";
+
+module.exports = exports = testpackage;
+
+exports.usage = 'Tests that the staged package is valid';
+
+var fs = require('fs');
+var path = require('path');
+var log = require('npmlog');
+var existsAsync = fs.exists || path.exists;
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var testbinary = require('./testbinary.js');
+var tar = require('tar');
+var mkdirp = require('mkdirp');
+
+function testpackage(gyp, argv, callback) {
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    var tarball = opts.staged_tarball;
+    existsAsync(tarball, function(found) {
+        if (!found) {
+            return callback(new Error("Cannot test package because " + tarball + " missing: run `node-pre-gyp package` first"));
+        }
+        var to = opts.module_path;
+        function filter_func(entry) {
+            log.info('install','unpacking [' + entry.path + ']');
+        }
+
+        mkdirp(to, function(err) {
+            if (err) {
+                return callback(err);
+            } else {
+                tar.extract({
+                    file: tarball,
+                    cwd: to,
+                    strip: 1,
+                    onentry: filter_func
+                }).then(after_extract, callback);
+            }
+        });
+
+        function after_extract() {
+            testbinary(gyp,argv,function(err) {
+                if (err) {
+                    return callback(err);
+                } else {
+                    console.log('['+package_json.name+'] Package appears valid');
+                    return callback();
+                }
+            });
+        }
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/unpublish.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/unpublish.js
new file mode 100644 (file)
index 0000000..94c93dd
--- /dev/null
@@ -0,0 +1,43 @@
+"use strict";
+
+module.exports = exports = unpublish;
+
+exports.usage = 'Unpublishes pre-built binary (requires aws-sdk)';
+
+var fs = require('fs');
+var log = require('npmlog');
+var versioning = require('./util/versioning.js');
+var napi = require('./util/napi.js');
+var s3_setup = require('./util/s3_setup.js');
+var url = require('url');
+var config = require('rc')("node_pre_gyp",{acl:"public-read"});
+
+function unpublish(gyp, argv, callback) {
+    var AWS = require("aws-sdk");
+    var package_json = JSON.parse(fs.readFileSync('./package.json'));
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(package_json, gyp.opts, napi_build_version);
+    s3_setup.detect(opts.hosted_path,config);
+    AWS.config.update(config);
+    var key_name = url.resolve(config.prefix,opts.package_name);
+    var s3 =  new AWS.S3();
+    var s3_opts = {  Bucket: config.bucket,
+                     Key: key_name
+                  };
+    s3.headObject(s3_opts, function(err, meta) {
+        if (err && err.code == 'NotFound') {
+            console.log('['+package_json.name+'] Not found: https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key);
+            return callback();
+        } else if(err) {
+            return callback(err);
+        } else {
+            log.info('unpublish', JSON.stringify(meta));
+            s3.deleteObject(s3_opts, function(err, resp) {
+                if (err) return callback(err);
+                log.info(JSON.stringify(resp));
+                console.log('['+package_json.name+'] Success: removed https://' + s3_opts.Bucket + '.s3.amazonaws.com/' + s3_opts.Key);
+                return callback();
+            });
+        }
+    });
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json
new file mode 100644 (file)
index 0000000..a0c3af7
--- /dev/null
@@ -0,0 +1,1962 @@
+{
+  "0.1.14": {
+    "node_abi": null,
+    "v8": "1.3"
+  },
+  "0.1.15": {
+    "node_abi": null,
+    "v8": "1.3"
+  },
+  "0.1.16": {
+    "node_abi": null,
+    "v8": "1.3"
+  },
+  "0.1.17": {
+    "node_abi": null,
+    "v8": "1.3"
+  },
+  "0.1.18": {
+    "node_abi": null,
+    "v8": "1.3"
+  },
+  "0.1.19": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.20": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.21": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.22": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.23": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.24": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.25": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.26": {
+    "node_abi": null,
+    "v8": "2.0"
+  },
+  "0.1.27": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.28": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.29": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.30": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.31": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.32": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.33": {
+    "node_abi": null,
+    "v8": "2.1"
+  },
+  "0.1.90": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.91": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.92": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.93": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.94": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.95": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.96": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.97": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.98": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.99": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.100": {
+    "node_abi": null,
+    "v8": "2.2"
+  },
+  "0.1.101": {
+    "node_abi": null,
+    "v8": "2.3"
+  },
+  "0.1.102": {
+    "node_abi": null,
+    "v8": "2.3"
+  },
+  "0.1.103": {
+    "node_abi": null,
+    "v8": "2.3"
+  },
+  "0.1.104": {
+    "node_abi": null,
+    "v8": "2.3"
+  },
+  "0.2.0": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.2.1": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.2.2": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.2.3": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.2.4": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.2.5": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.2.6": {
+    "node_abi": 1,
+    "v8": "2.3"
+  },
+  "0.3.0": {
+    "node_abi": 1,
+    "v8": "2.5"
+  },
+  "0.3.1": {
+    "node_abi": 1,
+    "v8": "2.5"
+  },
+  "0.3.2": {
+    "node_abi": 1,
+    "v8": "3.0"
+  },
+  "0.3.3": {
+    "node_abi": 1,
+    "v8": "3.0"
+  },
+  "0.3.4": {
+    "node_abi": 1,
+    "v8": "3.0"
+  },
+  "0.3.5": {
+    "node_abi": 1,
+    "v8": "3.0"
+  },
+  "0.3.6": {
+    "node_abi": 1,
+    "v8": "3.0"
+  },
+  "0.3.7": {
+    "node_abi": 1,
+    "v8": "3.0"
+  },
+  "0.3.8": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.0": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.1": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.2": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.3": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.4": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.5": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.6": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.7": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.8": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.9": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.10": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.11": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.4.12": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.5.0": {
+    "node_abi": 1,
+    "v8": "3.1"
+  },
+  "0.5.1": {
+    "node_abi": 1,
+    "v8": "3.4"
+  },
+  "0.5.2": {
+    "node_abi": 1,
+    "v8": "3.4"
+  },
+  "0.5.3": {
+    "node_abi": 1,
+    "v8": "3.4"
+  },
+  "0.5.4": {
+    "node_abi": 1,
+    "v8": "3.5"
+  },
+  "0.5.5": {
+    "node_abi": 1,
+    "v8": "3.5"
+  },
+  "0.5.6": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.5.7": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.5.8": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.5.9": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.5.10": {
+    "node_abi": 1,
+    "v8": "3.7"
+  },
+  "0.6.0": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.1": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.2": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.3": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.4": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.5": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.6": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.7": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.8": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.9": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.10": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.11": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.12": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.13": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.14": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.15": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.16": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.17": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.18": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.19": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.20": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.6.21": {
+    "node_abi": 1,
+    "v8": "3.6"
+  },
+  "0.7.0": {
+    "node_abi": 1,
+    "v8": "3.8"
+  },
+  "0.7.1": {
+    "node_abi": 1,
+    "v8": "3.8"
+  },
+  "0.7.2": {
+    "node_abi": 1,
+    "v8": "3.8"
+  },
+  "0.7.3": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.4": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.5": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.6": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.7": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.8": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.9": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.7.10": {
+    "node_abi": 1,
+    "v8": "3.9"
+  },
+  "0.7.11": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.7.12": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.0": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.1": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.2": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.3": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.4": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.5": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.6": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.7": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.8": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.9": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.10": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.11": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.12": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.13": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.14": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.15": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.16": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.17": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.18": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.19": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.20": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.21": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.22": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.23": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.24": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.25": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.26": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.27": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.8.28": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.9.0": {
+    "node_abi": 1,
+    "v8": "3.11"
+  },
+  "0.9.1": {
+    "node_abi": 10,
+    "v8": "3.11"
+  },
+  "0.9.2": {
+    "node_abi": 10,
+    "v8": "3.11"
+  },
+  "0.9.3": {
+    "node_abi": 10,
+    "v8": "3.13"
+  },
+  "0.9.4": {
+    "node_abi": 10,
+    "v8": "3.13"
+  },
+  "0.9.5": {
+    "node_abi": 10,
+    "v8": "3.13"
+  },
+  "0.9.6": {
+    "node_abi": 10,
+    "v8": "3.15"
+  },
+  "0.9.7": {
+    "node_abi": 10,
+    "v8": "3.15"
+  },
+  "0.9.8": {
+    "node_abi": 10,
+    "v8": "3.15"
+  },
+  "0.9.9": {
+    "node_abi": 11,
+    "v8": "3.15"
+  },
+  "0.9.10": {
+    "node_abi": 11,
+    "v8": "3.15"
+  },
+  "0.9.11": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.9.12": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.0": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.1": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.2": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.3": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.4": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.5": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.6": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.7": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.8": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.9": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.10": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.11": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.12": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.13": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.14": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.15": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.16": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.17": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.18": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.19": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.20": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.21": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.22": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.23": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.24": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.25": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.26": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.27": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.28": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.29": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.30": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.31": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.32": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.33": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.34": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.35": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.36": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.37": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.38": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.39": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.40": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.41": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.42": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.43": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.44": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.45": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.46": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.47": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.10.48": {
+    "node_abi": 11,
+    "v8": "3.14"
+  },
+  "0.11.0": {
+    "node_abi": 12,
+    "v8": "3.17"
+  },
+  "0.11.1": {
+    "node_abi": 12,
+    "v8": "3.18"
+  },
+  "0.11.2": {
+    "node_abi": 12,
+    "v8": "3.19"
+  },
+  "0.11.3": {
+    "node_abi": 12,
+    "v8": "3.19"
+  },
+  "0.11.4": {
+    "node_abi": 12,
+    "v8": "3.20"
+  },
+  "0.11.5": {
+    "node_abi": 12,
+    "v8": "3.20"
+  },
+  "0.11.6": {
+    "node_abi": 12,
+    "v8": "3.20"
+  },
+  "0.11.7": {
+    "node_abi": 12,
+    "v8": "3.20"
+  },
+  "0.11.8": {
+    "node_abi": 13,
+    "v8": "3.21"
+  },
+  "0.11.9": {
+    "node_abi": 13,
+    "v8": "3.22"
+  },
+  "0.11.10": {
+    "node_abi": 13,
+    "v8": "3.22"
+  },
+  "0.11.11": {
+    "node_abi": 14,
+    "v8": "3.22"
+  },
+  "0.11.12": {
+    "node_abi": 14,
+    "v8": "3.22"
+  },
+  "0.11.13": {
+    "node_abi": 14,
+    "v8": "3.25"
+  },
+  "0.11.14": {
+    "node_abi": 14,
+    "v8": "3.26"
+  },
+  "0.11.15": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.11.16": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.0": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.1": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.2": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.3": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.4": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.5": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.6": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.7": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.8": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.9": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.10": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.11": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.12": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.13": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.14": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.15": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.16": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.17": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "0.12.18": {
+    "node_abi": 14,
+    "v8": "3.28"
+  },
+  "1.0.0": {
+    "node_abi": 42,
+    "v8": "3.31"
+  },
+  "1.0.1": {
+    "node_abi": 42,
+    "v8": "3.31"
+  },
+  "1.0.2": {
+    "node_abi": 42,
+    "v8": "3.31"
+  },
+  "1.0.3": {
+    "node_abi": 42,
+    "v8": "4.1"
+  },
+  "1.0.4": {
+    "node_abi": 42,
+    "v8": "4.1"
+  },
+  "1.1.0": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.2.0": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.3.0": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.4.1": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.4.2": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.4.3": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.5.0": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.5.1": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.6.0": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.6.1": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.6.2": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.6.3": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.6.4": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.7.1": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.8.1": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.8.2": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.8.3": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "1.8.4": {
+    "node_abi": 43,
+    "v8": "4.1"
+  },
+  "2.0.0": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.0.1": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.0.2": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.1.0": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.2.0": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.2.1": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.3.0": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.3.1": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.3.2": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.3.3": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.3.4": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.4.0": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "2.5.0": {
+    "node_abi": 44,
+    "v8": "4.2"
+  },
+  "3.0.0": {
+    "node_abi": 45,
+    "v8": "4.4"
+  },
+  "3.1.0": {
+    "node_abi": 45,
+    "v8": "4.4"
+  },
+  "3.2.0": {
+    "node_abi": 45,
+    "v8": "4.4"
+  },
+  "3.3.0": {
+    "node_abi": 45,
+    "v8": "4.4"
+  },
+  "3.3.1": {
+    "node_abi": 45,
+    "v8": "4.4"
+  },
+  "4.0.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.1.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.1.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.1.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.3": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.4": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.5": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.2.6": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.3.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.3.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.3.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.3": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.4": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.5": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.6": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.4.7": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.5.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.6.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.6.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.6.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.7.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.7.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.7.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.7.3": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.2": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.3": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.4": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.5": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.6": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.8.7": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.9.0": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "4.9.1": {
+    "node_abi": 46,
+    "v8": "4.5"
+  },
+  "5.0.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.1.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.1.1": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.2.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.3.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.4.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.4.1": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.5.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.6.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.7.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.7.1": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.8.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.9.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.9.1": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.10.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.10.1": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.11.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.11.1": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "5.12.0": {
+    "node_abi": 47,
+    "v8": "4.6"
+  },
+  "6.0.0": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.1.0": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.2.0": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.2.1": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.2.2": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.3.0": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.3.1": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.4.0": {
+    "node_abi": 48,
+    "v8": "5.0"
+  },
+  "6.5.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.6.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.7.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.8.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.8.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.9.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.9.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.9.2": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.9.3": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.9.4": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.9.5": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.10.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.10.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.10.2": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.10.3": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.11.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.11.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.11.2": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.11.3": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.11.4": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.11.5": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.12.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.12.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.12.2": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.12.3": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.13.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.13.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.14.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.14.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.14.2": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.14.3": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.14.4": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.15.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.15.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.16.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.17.0": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "6.17.1": {
+    "node_abi": 48,
+    "v8": "5.1"
+  },
+  "7.0.0": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.1.0": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.2.0": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.2.1": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.3.0": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.4.0": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.5.0": {
+    "node_abi": 51,
+    "v8": "5.4"
+  },
+  "7.6.0": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.7.0": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.7.1": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.7.2": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.7.3": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.7.4": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.8.0": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.9.0": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.10.0": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "7.10.1": {
+    "node_abi": 51,
+    "v8": "5.5"
+  },
+  "8.0.0": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.1.0": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.1.1": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.1.2": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.1.3": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.1.4": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.2.0": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.2.1": {
+    "node_abi": 57,
+    "v8": "5.8"
+  },
+  "8.3.0": {
+    "node_abi": 57,
+    "v8": "6.0"
+  },
+  "8.4.0": {
+    "node_abi": 57,
+    "v8": "6.0"
+  },
+  "8.5.0": {
+    "node_abi": 57,
+    "v8": "6.0"
+  },
+  "8.6.0": {
+    "node_abi": 57,
+    "v8": "6.0"
+  },
+  "8.7.0": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.8.0": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.8.1": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.9.0": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.9.1": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.9.2": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.9.3": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.9.4": {
+    "node_abi": 57,
+    "v8": "6.1"
+  },
+  "8.10.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.11.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.11.1": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.11.2": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.11.3": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.11.4": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.12.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.13.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.14.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.14.1": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.15.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.15.1": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "8.16.0": {
+    "node_abi": 57,
+    "v8": "6.2"
+  },
+  "9.0.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.1.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.2.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.2.1": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.3.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.4.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.5.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.6.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.6.1": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.7.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.7.1": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.8.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.9.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.10.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.10.1": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.11.0": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.11.1": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "9.11.2": {
+    "node_abi": 59,
+    "v8": "6.2"
+  },
+  "10.0.0": {
+    "node_abi": 64,
+    "v8": "6.6"
+  },
+  "10.1.0": {
+    "node_abi": 64,
+    "v8": "6.6"
+  },
+  "10.2.0": {
+    "node_abi": 64,
+    "v8": "6.6"
+  },
+  "10.2.1": {
+    "node_abi": 64,
+    "v8": "6.6"
+  },
+  "10.3.0": {
+    "node_abi": 64,
+    "v8": "6.6"
+  },
+  "10.4.0": {
+    "node_abi": 64,
+    "v8": "6.7"
+  },
+  "10.4.1": {
+    "node_abi": 64,
+    "v8": "6.7"
+  },
+  "10.5.0": {
+    "node_abi": 64,
+    "v8": "6.7"
+  },
+  "10.6.0": {
+    "node_abi": 64,
+    "v8": "6.7"
+  },
+  "10.7.0": {
+    "node_abi": 64,
+    "v8": "6.7"
+  },
+  "10.8.0": {
+    "node_abi": 64,
+    "v8": "6.7"
+  },
+  "10.9.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.10.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.11.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.12.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.13.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.14.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.14.1": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.14.2": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.15.0": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.15.1": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.15.2": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "10.15.3": {
+    "node_abi": 64,
+    "v8": "6.8"
+  },
+  "11.0.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.1.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.2.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.3.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.4.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.5.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.6.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.7.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.8.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.9.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.10.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.10.1": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.11.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.12.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.13.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "11.14.0": {
+    "node_abi": 67,
+    "v8": "7.0"
+  },
+  "12.0.0": {
+    "node_abi": 72,
+    "v8": "7.4"
+  }
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/compile.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/compile.js
new file mode 100644 (file)
index 0000000..0dc460c
--- /dev/null
@@ -0,0 +1,87 @@
+"use strict";
+
+module.exports = exports;
+
+var fs = require('fs');
+var path = require('path');
+var win = process.platform == 'win32';
+var existsSync = fs.existsSync || path.existsSync;
+var cp = require('child_process');
+
+// try to build up the complete path to node-gyp
+/* priority:
+  - node-gyp on ENV:npm_config_node_gyp (https://github.com/npm/npm/pull/4887)
+  - node-gyp on NODE_PATH
+  - node-gyp inside npm on NODE_PATH (ignore on iojs)
+  - node-gyp inside npm beside node exe
+*/
+function which_node_gyp() {
+    var node_gyp_bin;
+    if (process.env.npm_config_node_gyp) {
+      try {
+          node_gyp_bin = process.env.npm_config_node_gyp;
+          if (existsSync(node_gyp_bin)) {
+              return node_gyp_bin;
+          }
+      } catch (err) { }
+    }
+    try {
+        var node_gyp_main = require.resolve('node-gyp');
+        node_gyp_bin = path.join(path.dirname(
+                                     path.dirname(node_gyp_main)),
+                                     'bin/node-gyp.js');
+        if (existsSync(node_gyp_bin)) {
+            return node_gyp_bin;
+        }
+    } catch (err) { }
+    if (process.execPath.indexOf('iojs') === -1) {
+        try {
+            var npm_main = require.resolve('npm');
+            node_gyp_bin = path.join(path.dirname(
+                                         path.dirname(npm_main)),
+                                         'node_modules/node-gyp/bin/node-gyp.js');
+            if (existsSync(node_gyp_bin)) {
+                return node_gyp_bin;
+            }
+        } catch (err) { }
+    }
+    var npm_base = path.join(path.dirname(
+                             path.dirname(process.execPath)),
+                             'lib/node_modules/npm/');
+    node_gyp_bin = path.join(npm_base, 'node_modules/node-gyp/bin/node-gyp.js');
+    if (existsSync(node_gyp_bin)) {
+        return node_gyp_bin;
+    }
+}
+
+module.exports.run_gyp = function(args,opts,callback) {
+    var shell_cmd = '';
+    var cmd_args = [];
+    if (opts.runtime && opts.runtime == 'node-webkit') {
+        shell_cmd = 'nw-gyp';
+        if (win) shell_cmd += '.cmd';
+    } else {
+        var node_gyp_path = which_node_gyp();
+        if (node_gyp_path) {
+            shell_cmd = process.execPath;
+            cmd_args.push(node_gyp_path);
+        } else {
+            shell_cmd = 'node-gyp';
+            if (win) shell_cmd += '.cmd';
+        }
+    }
+    var final_args = cmd_args.concat(args);
+    var cmd = cp.spawn(shell_cmd, final_args, {cwd: undefined, env: process.env, stdio: [ 0, 1, 2]});
+    cmd.on('error', function (err) {
+        if (err) {
+            return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + err + ")"));
+        }
+        callback(null,opts);
+    });
+    cmd.on('close', function (code) {
+        if (code && code !== 0) {
+            return callback(new Error("Failed to execute '" + shell_cmd + ' ' + final_args.join(' ') + "' (" + code + ")"));
+        }
+        callback(null,opts);
+    });
+};
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js
new file mode 100644 (file)
index 0000000..9f76ea3
--- /dev/null
@@ -0,0 +1,103 @@
+"use strict";
+
+module.exports = exports = handle_gyp_opts;
+
+var fs = require('fs');
+var versioning = require('./versioning.js');
+var napi = require('./napi.js');
+
+/*
+
+Here we gather node-pre-gyp generated options (from versioning) and pass them along to node-gyp.
+
+We massage the args and options slightly to account for differences in what commands mean between
+node-pre-gyp and node-gyp (e.g. see the difference between "build" and "rebuild" below)
+
+Keep in mind: the values inside `argv` and `gyp.opts` below are different depending on whether
+node-pre-gyp is called directory, or if it is called in a `run-script` phase of npm.
+
+We also try to preserve any command line options that might have been passed to npm or node-pre-gyp.
+But this is fairly difficult without passing way to much through. For example `gyp.opts` contains all
+the process.env and npm pushes a lot of variables into process.env which node-pre-gyp inherits. So we have
+to be very selective about what we pass through.
+
+For example:
+
+`npm install --build-from-source` will give:
+
+argv == [ 'rebuild' ]
+gyp.opts.argv == { remain: [ 'install' ],
+  cooked: [ 'install', '--fallback-to-build' ],
+  original: [ 'install', '--fallback-to-build' ] }
+
+`./bin/node-pre-gyp build` will give:
+
+argv == []
+gyp.opts.argv == { remain: [ 'build' ],
+  cooked: [ 'build' ],
+  original: [ '-C', 'test/app1', 'build' ] }
+
+*/
+
+// select set of node-pre-gyp versioning info
+// to share with node-gyp
+var share_with_node_gyp = [
+  'module',
+  'module_name',
+  'module_path',
+  'napi_version',
+  'node_abi_napi',
+  'napi_build_version',
+  'node_napi_label'
+];
+
+function handle_gyp_opts(gyp, argv, callback) {
+
+    // Collect node-pre-gyp specific variables to pass to node-gyp
+    var node_pre_gyp_options = [];
+    // generate custom node-pre-gyp versioning info
+    var napi_build_version = napi.get_napi_build_version_from_command_args(argv);
+    var opts = versioning.evaluate(JSON.parse(fs.readFileSync('./package.json')), gyp.opts, napi_build_version);
+    share_with_node_gyp.forEach(function(key) {
+        var val = opts[key];
+        if (val) {
+            node_pre_gyp_options.push('--' + key + '=' + val);
+        } else if (key === 'napi_build_version') {
+            node_pre_gyp_options.push('--' + key + '=0');
+        } else {
+            if (key !== 'napi_version' && key !== 'node_abi_napi')
+                return callback(new Error("Option " + key + " required but not found by node-pre-gyp"));
+        }
+    });
+
+    // Collect options that follow the special -- which disables nopt parsing
+    var unparsed_options = [];
+    var double_hyphen_found = false;
+    gyp.opts.argv.original.forEach(function(opt) {
+        if (double_hyphen_found) {
+            unparsed_options.push(opt);
+        }
+        if (opt == '--') {
+            double_hyphen_found = true;
+        }
+    });
+
+    // We try respect and pass through remaining command
+    // line options (like --foo=bar) to node-gyp
+    var cooked = gyp.opts.argv.cooked;
+    var node_gyp_options = [];
+    cooked.forEach(function(value) {
+        if (value.length > 2 && value.slice(0,2) == '--') {
+            var key = value.slice(2);
+            var val = cooked[cooked.indexOf(value)+1];
+            if (val && val.indexOf('--') === -1) { // handle '--foo=bar' or ['--foo','bar']
+                node_gyp_options.push('--' + key + '=' + val);
+            } else { // pass through --foo
+                node_gyp_options.push(value);
+            }
+        }
+    });
+
+    var result = {'opts':opts,'gyp':node_gyp_options,'pre':node_pre_gyp_options,'unparsed':unparsed_options};
+    return callback(null,result);
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/napi.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/napi.js
new file mode 100644 (file)
index 0000000..1e45ca0
--- /dev/null
@@ -0,0 +1,204 @@
+"use strict";
+
+var fs = require('fs');
+var rm = require('rimraf');
+var log = require('npmlog');
+
+module.exports = exports;
+
+var versionArray = process.version
+       .substr(1)
+       .replace(/-.*$/, '')
+       .split('.')
+       .map(function(item) {
+               return +item;
+       });
+
+var napi_multiple_commands = [
+       'build',
+       'clean',
+       'configure',
+       'package',
+       'publish',
+       'reveal',
+       'testbinary',
+       'testpackage',
+       'unpublish'
+];
+
+var napi_build_version_tag = 'napi_build_version=';
+
+module.exports.get_napi_version = function(target) { // target may be undefined
+       // returns the non-zero numeric napi version or undefined if napi is not supported.
+       // correctly supporting target requires an updated cross-walk
+       var version = process.versions.napi; // can be undefined
+       if (!version) { // this code should never need to be updated
+               if (versionArray[0] === 9 && versionArray[1] >= 3) version = 2; // 9.3.0+
+               else if (versionArray[0] === 8) version = 1; // 8.0.0+
+       }
+       return version;
+};
+
+module.exports.get_napi_version_as_string = function(target) {
+       // returns the napi version as a string or an empty string if napi is not supported.
+       var version = module.exports.get_napi_version(target);
+       return version ? ''+version : '';
+};
+
+module.exports.validate_package_json = function(package_json, opts) { // throws Error
+
+       var binary = package_json.binary;
+       var module_path_ok = pathOK(binary.module_path);
+       var remote_path_ok = pathOK(binary.remote_path);
+       var package_name_ok = pathOK(binary.package_name);
+       var napi_build_versions = module.exports.get_napi_build_versions(package_json,opts,true);
+       var napi_build_versions_raw = module.exports.get_napi_build_versions_raw(package_json);
+
+       if (napi_build_versions) {
+               napi_build_versions.forEach(function(napi_build_version){
+                       if (!(parseInt(napi_build_version,10) === napi_build_version && napi_build_version > 0)) {
+                               throw new Error("All values specified in napi_versions must be positive integers.");
+                       }
+               });
+       }
+
+       if (napi_build_versions && (!module_path_ok || (!remote_path_ok && !package_name_ok))) {
+               throw new Error("When napi_versions is specified; module_path and either remote_path or " +
+                       "package_name must contain the substitution string '{napi_build_version}`.");
+       }
+
+       if ((module_path_ok || remote_path_ok || package_name_ok) && !napi_build_versions_raw) {
+               throw new Error("When the substitution string '{napi_build_version}` is specified in " +
+                       "module_path, remote_path, or package_name; napi_versions must also be specified.");
+       }
+
+       if (napi_build_versions && !module.exports.get_best_napi_build_version(package_json, opts) && 
+       module.exports.build_napi_only(package_json)) {
+               throw new Error(
+                       'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
+                       'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
+                       'This Node instance cannot run this module.');
+       }
+
+       if (napi_build_versions_raw && !napi_build_versions && module.exports.build_napi_only(package_json)) {
+               throw new Error(
+                       'The N-API version of this Node instance is ' + module.exports.get_napi_version(opts ? opts.target : undefined) + '. ' +
+                       'This module supports N-API version(s) ' + module.exports.get_napi_build_versions_raw(package_json) + '. ' +
+                       'This Node instance cannot run this module.');
+       }
+
+};
+
+function pathOK (path) {
+       return path && (path.indexOf('{napi_build_version}') !== -1 || path.indexOf('{node_napi_label}') !== -1);
+}
+
+module.exports.expand_commands = function(package_json, opts, commands) {
+       var expanded_commands = [];
+       var napi_build_versions = module.exports.get_napi_build_versions(package_json, opts);
+       commands.forEach(function(command){
+               if (napi_build_versions && command.name === 'install') {
+                       var napi_build_version = module.exports.get_best_napi_build_version(package_json, opts);
+                       var args = napi_build_version ? [ napi_build_version_tag+napi_build_version ] : [ ];
+                       expanded_commands.push ({ name: command.name, args: args });
+               } else if (napi_build_versions && napi_multiple_commands.indexOf(command.name) !== -1) {
+                       napi_build_versions.forEach(function(napi_build_version){
+                               var args = command.args.slice();
+                               args.push (napi_build_version_tag+napi_build_version);
+                               expanded_commands.push ({ name: command.name, args: args });
+                       });
+               } else {
+                       expanded_commands.push (command);
+               }
+       });
+       return expanded_commands;
+};
+
+module.exports.get_napi_build_versions = function(package_json, opts, warnings) { // opts may be undefined
+       var napi_build_versions = [];
+       var supported_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
+       // remove duplicates, verify each napi version can actaully be built
+       if (package_json.binary && package_json.binary.napi_versions) {
+               package_json.binary.napi_versions.forEach(function(napi_version) {
+                       var duplicated = napi_build_versions.indexOf(napi_version) !== -1;
+                       if (!duplicated && supported_napi_version && napi_version <= supported_napi_version) {
+                               napi_build_versions.push(napi_version);
+                       } else if (warnings && !duplicated && supported_napi_version) {
+                               log.info('This Node instance does not support builds for N-API version', napi_version);
+                       }
+               });
+       }
+       if (opts && opts["build-latest-napi-version-only"]) {
+               var latest_version = 0;
+               napi_build_versions.forEach(function(napi_version) {
+                       if (napi_version > latest_version) latest_version = napi_version;
+               });
+               napi_build_versions = latest_version ? [ latest_version ] : [];
+       }
+       return napi_build_versions.length ? napi_build_versions : undefined;
+};
+
+module.exports.get_napi_build_versions_raw = function(package_json) {
+       var napi_build_versions = [];
+       // remove duplicates
+       if (package_json.binary && package_json.binary.napi_versions) {
+               package_json.binary.napi_versions.forEach(function(napi_version) {
+                       if (napi_build_versions.indexOf(napi_version) === -1) {
+                               napi_build_versions.push(napi_version);
+                       }
+               });
+       }
+       return napi_build_versions.length ? napi_build_versions : undefined;
+};
+
+module.exports.get_command_arg = function(napi_build_version) {
+       return napi_build_version_tag + napi_build_version;
+};
+
+module.exports.get_napi_build_version_from_command_args = function(command_args) {
+       for (var i = 0; i < command_args.length; i++) {
+               var arg = command_args[i];
+               if (arg.indexOf(napi_build_version_tag) === 0) {
+                       return parseInt(arg.substr(napi_build_version_tag.length),10);
+               }
+       }
+       return undefined;
+};
+
+module.exports.swap_build_dir_out = function(napi_build_version) {
+       if (napi_build_version) {
+               rm.sync(module.exports.get_build_dir(napi_build_version));
+               fs.renameSync('build', module.exports.get_build_dir(napi_build_version));
+       }
+};
+
+module.exports.swap_build_dir_in = function(napi_build_version) {
+       if (napi_build_version) {
+               rm.sync('build');
+               fs.renameSync(module.exports.get_build_dir(napi_build_version), 'build');
+       }
+};
+
+module.exports.get_build_dir = function(napi_build_version) {
+       return 'build-tmp-napi-v'+napi_build_version;
+};
+
+module.exports.get_best_napi_build_version = function(package_json, opts) {
+       var best_napi_build_version = 0;
+       var napi_build_versions = module.exports.get_napi_build_versions (package_json, opts);
+       if (napi_build_versions) {
+               var our_napi_version = module.exports.get_napi_version(opts ? opts.target : undefined);
+               napi_build_versions.forEach(function(napi_build_version){
+                       if (napi_build_version > best_napi_build_version &&
+                               napi_build_version <= our_napi_version) {
+                               best_napi_build_version = napi_build_version;
+                       }
+               });
+       }
+       return best_napi_build_version === 0 ? undefined : best_napi_build_version;
+};
+
+module.exports.build_napi_only = function(package_json) {
+       return package_json.binary && package_json.binary.package_name && 
+       package_json.binary.package_name.indexOf('{node_napi_label}') === -1;
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html
new file mode 100644 (file)
index 0000000..244466c
--- /dev/null
@@ -0,0 +1,26 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Node-webkit-based module test</title>
+<script>
+function nwModuleTest(){
+   var util = require('util');
+   var moduleFolder = require('nw.gui').App.argv[0];
+   try {
+      require(moduleFolder);
+   } catch(e) {
+      if( process.platform !== 'win32' ){
+         util.log('nw-pre-gyp error:');
+         util.log(e.stack);
+      }
+      process.exit(1);
+   }
+   process.exit(0);
+}
+</script>
+</head>
+<body onload="nwModuleTest()">
+<h1>Node-webkit-based module test</h1>
+</body>
+</html>
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/package.json b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/package.json
new file mode 100644 (file)
index 0000000..71d03f8
--- /dev/null
@@ -0,0 +1,9 @@
+{
+"main": "index.html",
+"name": "nw-pre-gyp-module-test",
+"description": "Node-webkit-based module test.",
+"version": "0.0.1",
+"window": {
+   "show": false
+}
+}
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/s3_setup.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/s3_setup.js
new file mode 100644 (file)
index 0000000..5bc42e9
--- /dev/null
@@ -0,0 +1,27 @@
+"use strict";
+
+module.exports = exports;
+
+var url = require('url');
+
+var URI_REGEX="^(.*)\.(s3(?:-.*)?)\.amazonaws\.com$";
+
+module.exports.detect = function(to,config) {
+    var uri = url.parse(to);
+    var hostname_matches = uri.hostname.match(URI_REGEX);
+    config.prefix = (!uri.pathname || uri.pathname == '/') ? '' : uri.pathname.replace('/','');
+    if(!hostname_matches) {
+        return;
+    }
+    if (!config.bucket) {
+        config.bucket = hostname_matches[1];
+    }
+    if (!config.region) {
+        var s3_domain = hostname_matches[2];
+        if (s3_domain.slice(0,3) == 's3-' &&
+            s3_domain.length >= 3) {
+            // it appears the region is explicit in the url
+            config.region = s3_domain.replace('s3-','');
+        }
+    }
+};
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/versioning.js b/legacy-libs/grpc/node_modules/node-pre-gyp/lib/util/versioning.js
new file mode 100644 (file)
index 0000000..fafb0da
--- /dev/null
@@ -0,0 +1,331 @@
+"use strict";
+
+module.exports = exports;
+
+var path = require('path');
+var semver = require('semver');
+var url = require('url');
+var detect_libc = require('detect-libc');
+var napi = require('./napi.js');
+
+var abi_crosswalk;
+
+// This is used for unit testing to provide a fake
+// ABI crosswalk that emulates one that is not updated
+// for the current version
+if (process.env.NODE_PRE_GYP_ABI_CROSSWALK) {
+    abi_crosswalk = require(process.env.NODE_PRE_GYP_ABI_CROSSWALK);
+} else {
+    abi_crosswalk = require('./abi_crosswalk.json');
+}
+
+var major_versions = {};
+Object.keys(abi_crosswalk).forEach(function(v) {
+    var major = v.split('.')[0];
+    if (!major_versions[major]) {
+        major_versions[major] = v;
+    }
+});
+
+function get_electron_abi(runtime, target_version) {
+    if (!runtime) {
+        throw new Error("get_electron_abi requires valid runtime arg");
+    }
+    if (typeof target_version === 'undefined') {
+        // erroneous CLI call
+        throw new Error("Empty target version is not supported if electron is the target.");
+    }
+    // Electron guarantees that patch version update won't break native modules.
+    var sem_ver = semver.parse(target_version);
+    return runtime + '-v' + sem_ver.major + '.' + sem_ver.minor;
+}
+module.exports.get_electron_abi = get_electron_abi;
+
+function get_node_webkit_abi(runtime, target_version) {
+    if (!runtime) {
+        throw new Error("get_node_webkit_abi requires valid runtime arg");
+    }
+    if (typeof target_version === 'undefined') {
+        // erroneous CLI call
+        throw new Error("Empty target version is not supported if node-webkit is the target.");
+    }
+    return runtime + '-v' + target_version;
+}
+module.exports.get_node_webkit_abi = get_node_webkit_abi;
+
+function get_node_abi(runtime, versions) {
+    if (!runtime) {
+        throw new Error("get_node_abi requires valid runtime arg");
+    }
+    if (!versions) {
+        throw new Error("get_node_abi requires valid process.versions object");
+    }
+    var sem_ver = semver.parse(versions.node);
+    if (sem_ver.major === 0 && sem_ver.minor % 2) { // odd series
+        // https://github.com/mapbox/node-pre-gyp/issues/124
+        return runtime+'-v'+versions.node;
+    } else {
+        // process.versions.modules added in >= v0.10.4 and v0.11.7
+        // https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e
+        return versions.modules ? runtime+'-v' + (+versions.modules) :
+            'v8-' + versions.v8.split('.').slice(0,2).join('.');
+    }
+}
+module.exports.get_node_abi = get_node_abi;
+
+function get_runtime_abi(runtime, target_version) {
+    if (!runtime) {
+        throw new Error("get_runtime_abi requires valid runtime arg");
+    }
+    if (runtime === 'node-webkit') {
+        return get_node_webkit_abi(runtime, target_version || process.versions['node-webkit']);
+    } else if (runtime === 'electron') {
+        return get_electron_abi(runtime, target_version || process.versions.electron);
+    } else {
+        if (runtime != 'node') {
+            throw new Error("Unknown Runtime: '" + runtime + "'");
+        }
+        if (!target_version) {
+            return get_node_abi(runtime,process.versions);
+        } else {
+            var cross_obj;
+            // abi_crosswalk generated with ./scripts/abi_crosswalk.js
+            if (abi_crosswalk[target_version]) {
+                cross_obj = abi_crosswalk[target_version];
+            } else {
+                var target_parts = target_version.split('.').map(function(i) { return +i; });
+                if (target_parts.length != 3) { // parse failed
+                    throw new Error("Unknown target version: " + target_version);
+                }
+                /*
+                    The below code tries to infer the last known ABI compatible version
+                    that we have recorded in the abi_crosswalk.json when an exact match
+                    is not possible. The reasons for this to exist are complicated:
+
+                       - We support passing --target to be able to allow developers to package binaries for versions of node
+                         that are not the same one as they are running. This might also be used in combination with the
+                         --target_arch or --target_platform flags to also package binaries for alternative platforms
+                       - When --target is passed we can't therefore determine the ABI (process.versions.modules) from the node
+                         version that is running in memory
+                       - So, therefore node-pre-gyp keeps an "ABI crosswalk" (lib/util/abi_crosswalk.json) to be able to look
+                         this info up for all versions
+                       - But we cannot easily predict what the future ABI will be for released versions
+                       - And node-pre-gyp needs to be a `bundledDependency` in apps that depend on it in order to work correctly
+                         by being fully available at install time.
+                       - So, the speed of node releases and the bundled nature of node-pre-gyp mean that a new node-pre-gyp release
+                         need to happen for every node.js/io.js/node-webkit/nw.js/atom-shell/etc release that might come online if
+                         you want the `--target` flag to keep working for the latest version
+                       - Which is impractical ^^
+                       - Hence the below code guesses about future ABI to make the need to update node-pre-gyp less demanding.
+
+                    In practice then you can have a dependency of your app like `node-sqlite3` that bundles a `node-pre-gyp` that
+                    only knows about node v0.10.33 in the `abi_crosswalk.json` but target node v0.10.34 (which is assumed to be
+                    ABI compatible with v0.10.33).
+
+                    TODO: use semver module instead of custom version parsing
+                */
+                var major = target_parts[0];
+                var minor = target_parts[1];
+                var patch = target_parts[2];
+                // io.js: yeah if node.js ever releases 1.x this will break
+                // but that is unlikely to happen: https://github.com/iojs/io.js/pull/253#issuecomment-69432616
+                if (major === 1) {
+                    // look for last release that is the same major version
+                    // e.g. we assume io.js 1.x is ABI compatible with >= 1.0.0
+                    while (true) {
+                        if (minor > 0) --minor;
+                        if (patch > 0) --patch;
+                        var new_iojs_target = '' + major + '.' + minor + '.' + patch;
+                        if (abi_crosswalk[new_iojs_target]) {
+                            cross_obj = abi_crosswalk[new_iojs_target];
+                            console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
+                            console.log('Warning: but node-pre-gyp successfully choose ' + new_iojs_target + ' as ABI compatible target');
+                            break;
+                        }
+                        if (minor === 0 && patch === 0) {
+                            break;
+                        }
+                    }
+                } else if (major >= 2) {
+                    // look for last release that is the same major version
+                    if (major_versions[major]) {
+                        cross_obj = abi_crosswalk[major_versions[major]];
+                        console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
+                        console.log('Warning: but node-pre-gyp successfully choose ' + major_versions[major] + ' as ABI compatible target');
+                    }
+                } else if (major === 0) { // node.js
+                    if (target_parts[1] % 2 === 0) { // for stable/even node.js series
+                        // look for the last release that is the same minor release
+                        // e.g. we assume node 0.10.x is ABI compatible with >= 0.10.0
+                        while (--patch > 0) {
+                            var new_node_target = '' + major + '.' + minor + '.' + patch;
+                            if (abi_crosswalk[new_node_target]) {
+                                cross_obj = abi_crosswalk[new_node_target];
+                                console.log('Warning: node-pre-gyp could not find exact match for ' + target_version);
+                                console.log('Warning: but node-pre-gyp successfully choose ' + new_node_target + ' as ABI compatible target');
+                                break;
+                            }
+                        }
+                    }
+                }
+            }
+            if (!cross_obj) {
+                throw new Error("Unsupported target version: " + target_version);
+            }
+            // emulate process.versions
+            var versions_obj = {
+                node: target_version,
+                v8: cross_obj.v8+'.0',
+                // abi_crosswalk uses 1 for node versions lacking process.versions.modules
+                // process.versions.modules added in >= v0.10.4 and v0.11.7
+                modules: cross_obj.node_abi > 1 ? cross_obj.node_abi : undefined
+            };
+            return get_node_abi(runtime, versions_obj);
+        }
+    }
+}
+module.exports.get_runtime_abi = get_runtime_abi;
+
+var required_parameters = [
+    'module_name',
+    'module_path',
+    'host'
+];
+
+function validate_config(package_json,opts) {
+    var msg = package_json.name + ' package.json is not node-pre-gyp ready:\n';
+    var missing = [];
+    if (!package_json.main) {
+        missing.push('main');
+    }
+    if (!package_json.version) {
+        missing.push('version');
+    }
+    if (!package_json.name) {
+        missing.push('name');
+    }
+    if (!package_json.binary) {
+        missing.push('binary');
+    }
+    var o = package_json.binary;
+    required_parameters.forEach(function(p) {
+        if (missing.indexOf('binary') > -1) {
+            missing.pop('binary');
+        }
+        if (!o || o[p] === undefined || o[p] === "") {
+            missing.push('binary.' + p);
+        }
+    });
+    if (missing.length >= 1) {
+        throw new Error(msg+"package.json must declare these properties: \n" + missing.join('\n'));
+    }
+    if (o) {
+        // enforce https over http
+        var protocol = url.parse(o.host).protocol;
+        if (protocol === 'http:') {
+            throw new Error("'host' protocol ("+protocol+") is invalid - only 'https:' is accepted");
+        }
+    }
+    napi.validate_package_json(package_json,opts);
+}
+
+module.exports.validate_config = validate_config;
+
+function eval_template(template,opts) {
+    Object.keys(opts).forEach(function(key) {
+        var pattern = '{'+key+'}';
+        while (template.indexOf(pattern) > -1) {
+            template = template.replace(pattern,opts[key]);
+        }
+    });
+    return template;
+}
+
+// url.resolve needs single trailing slash
+// to behave correctly, otherwise a double slash
+// may end up in the url which breaks requests
+// and a lacking slash may not lead to proper joining
+function fix_slashes(pathname) {
+    if (pathname.slice(-1) != '/') {
+        return pathname + '/';
+    }
+    return pathname;
+}
+
+// remove double slashes
+// note: path.normalize will not work because
+// it will convert forward to back slashes
+function drop_double_slashes(pathname) {
+    return pathname.replace(/\/\//g,'/');
+}
+
+function get_process_runtime(versions) {
+    var runtime = 'node';
+    if (versions['node-webkit']) {
+        runtime = 'node-webkit';
+    } else if (versions.electron) {
+        runtime = 'electron';
+    }
+    return runtime;
+}
+
+module.exports.get_process_runtime = get_process_runtime;
+
+var default_package_name = '{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz';
+var default_remote_path = '';
+
+module.exports.evaluate = function(package_json,options,napi_build_version) {
+    options = options || {};
+    validate_config(package_json,options); // options is a suitable substitute for opts in this case
+    var v = package_json.version;
+    var module_version = semver.parse(v);
+    var runtime = options.runtime || get_process_runtime(process.versions);
+    var opts = {
+        name: package_json.name,
+        configuration: Boolean(options.debug) ? 'Debug' : 'Release',
+        debug: options.debug,
+        module_name: package_json.binary.module_name,
+        version: module_version.version,
+        prerelease: module_version.prerelease.length ? module_version.prerelease.join('.') : '',
+        build: module_version.build.length ? module_version.build.join('.') : '',
+        major: module_version.major,
+        minor: module_version.minor,
+        patch: module_version.patch,
+        runtime: runtime,
+        node_abi: get_runtime_abi(runtime,options.target),
+        node_abi_napi: napi.get_napi_version(options.target) ? 'napi' : get_runtime_abi(runtime,options.target),
+        napi_version: napi.get_napi_version(options.target), // non-zero numeric, undefined if unsupported
+        napi_build_version: napi_build_version || '',
+        node_napi_label: napi_build_version ? 'napi-v' + napi_build_version : get_runtime_abi(runtime,options.target),
+        target: options.target || '',
+        platform: options.target_platform || process.platform,
+        target_platform: options.target_platform || process.platform,
+        arch: options.target_arch || process.arch,
+        target_arch: options.target_arch || process.arch,
+        libc: options.target_libc || detect_libc.family || 'unknown',
+        module_main: package_json.main,
+        toolset : options.toolset || '' // address https://github.com/mapbox/node-pre-gyp/issues/119
+    };
+    // support host mirror with npm config `--{module_name}_binary_host_mirror`
+    // e.g.: https://github.com/node-inspector/v8-profiler/blob/master/package.json#L25
+    // > npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/
+    var host = process.env['npm_config_' + opts.module_name + '_binary_host_mirror'] || package_json.binary.host;
+    opts.host = fix_slashes(eval_template(host,opts));
+    opts.module_path = eval_template(package_json.binary.module_path,opts);
+    // now we resolve the module_path to ensure it is absolute so that binding.gyp variables work predictably
+    if (options.module_root) {
+        // resolve relative to known module root: works for pre-binding require
+        opts.module_path = path.join(options.module_root,opts.module_path);
+    } else {
+        // resolve relative to current working directory: works for node-pre-gyp commands
+        opts.module_path = path.resolve(opts.module_path);
+    }
+    opts.module = path.join(opts.module_path,opts.module_name + '.node');
+    opts.remote_path = package_json.binary.remote_path ? drop_double_slashes(fix_slashes(eval_template(package_json.binary.remote_path,opts))) : default_remote_path;
+    var package_name = package_json.binary.package_name ? package_json.binary.package_name : default_package_name;
+    opts.package_name = eval_template(package_name,opts);
+    opts.staged_tarball = path.join('build/stage',opts.remote_path,opts.package_name);
+    opts.hosted_path = url.resolve(opts.host,opts.remote_path);
+    opts.hosted_tarball = url.resolve(opts.hosted_path,opts.package_name);
+    return opts;
+};
diff --git a/legacy-libs/grpc/node_modules/node-pre-gyp/package.json b/legacy-libs/grpc/node_modules/node-pre-gyp/package.json
new file mode 100644 (file)
index 0000000..83f52c3
--- /dev/null
@@ -0,0 +1,90 @@
+{
+  "_from": "node-pre-gyp@^0.13.0",
+  "_id": "node-pre-gyp@0.13.0",
+  "_inBundle": false,
+  "_integrity": "sha512-Md1D3xnEne8b/HGVQkZZwV27WUi1ZRuZBij24TNaZwUPU3ZAFtvT6xxJGaUVillfmMKnn5oD1HoGsp2Ftik7SQ==",
+  "_location": "/grpc/node-pre-gyp",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "node-pre-gyp@^0.13.0",
+    "name": "node-pre-gyp",
+    "escapedName": "node-pre-gyp",
+    "rawSpec": "^0.13.0",
+    "saveSpec": null,
+    "fetchSpec": "^0.13.0"
+  },
+  "_requiredBy": [
+    "/grpc"
+  ],
+  "_resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.13.0.tgz",
+  "_shasum": "df9ab7b68dd6498137717838e4f92a33fc9daa42",
+  "_shrinkwrap": null,
+  "_spec": "node-pre-gyp@^0.13.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Dane Springmeyer",
+    "email": "dane@mapbox.com"
+  },
+  "bin": {
+    "node-pre-gyp": "./bin/node-pre-gyp"
+  },
+  "bugs": {
+    "url": "https://github.com/mapbox/node-pre-gyp/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "detect-libc": "^1.0.2",
+    "mkdirp": "^0.5.1",
+    "needle": "^2.2.1",
+    "nopt": "^4.0.1",
+    "npm-packlist": "^1.1.6",
+    "npmlog": "^4.0.2",
+    "rc": "^1.2.7",
+    "rimraf": "^2.6.1",
+    "semver": "^5.3.0",
+    "tar": "^4"
+  },
+  "deprecated": false,
+  "description": "Node.js native addon binary install tool",
+  "devDependencies": {
+    "aws-sdk": "^2.28.0",
+    "jshint": "^2.9.5",
+    "nock": "^9.2.3",
+    "tape": "^4.6.3"
+  },
+  "homepage": "https://github.com/mapbox/node-pre-gyp#readme",
+  "jshintConfig": {
+    "node": true,
+    "globalstrict": true,
+    "undef": true,
+    "unused": false,
+    "noarg": true
+  },
+  "keywords": [
+    "native",
+    "addon",
+    "module",
+    "c",
+    "c++",
+    "bindings",
+    "binary"
+  ],
+  "license": "BSD-3-Clause",
+  "main": "./lib/node-pre-gyp.js",
+  "name": "node-pre-gyp",
+  "optionalDependencies": {},
+  "readme": "# node-pre-gyp\n\n#### node-pre-gyp makes it easy to publish and install Node.js C++ addons from binaries\n\n[![NPM](https://nodei.co/npm/node-pre-gyp.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-pre-gyp/)\n\n[![Build Status](https://api.travis-ci.org/mapbox/node-pre-gyp.svg)](https://travis-ci.org/mapbox/node-pre-gyp)\n[![Build status](https://ci.appveyor.com/api/projects/status/3nxewb425y83c0gv)](https://ci.appveyor.com/project/Mapbox/node-pre-gyp)\n[![Dependencies](https://david-dm.org/mapbox/node-pre-gyp.svg)](https://david-dm.org/mapbox/node-pre-gyp)\n\n`node-pre-gyp` stands between [npm](https://github.com/npm/npm) and [node-gyp](https://github.com/Tootallnate/node-gyp) and offers a cross-platform method of binary deployment.\n\n### Features\n\n - A command line tool called `node-pre-gyp` that can install your package's C++ module from a binary.\n - A variety of developer targeted commands for packaging, testing, and publishing binaries.\n - A JavaScript module that can dynamically require your installed binary: `require('node-pre-gyp').find`\n\nFor a hello world example of a module packaged with `node-pre-gyp` see <https://github.com/springmeyer/node-addon-example> and [the wiki ](https://github.com/mapbox/node-pre-gyp/wiki/Modules-using-node-pre-gyp) for real world examples.\n\n## Credits\n\n - The module is modeled after [node-gyp](https://github.com/Tootallnate/node-gyp) by [@Tootallnate](https://github.com/Tootallnate)\n - Motivation for initial development came from [@ErisDS](https://github.com/ErisDS) and the [Ghost Project](https://github.com/TryGhost/Ghost).\n - Development is sponsored by [Mapbox](https://www.mapbox.com/)\n\n## FAQ\n\nSee the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ).\n\n## Depends\n\n - Node.js >= node v6.x\n\n## Install\n\n`node-pre-gyp` is designed to be installed as a local dependency of your Node.js C++ addon and accessed like:\n\n    ./node_modules/.bin/node-pre-gyp --help\n\nBut you can also install it globally:\n\n    npm install node-pre-gyp -g\n\n## Usage\n\n### Commands\n\nView all possible commands:\n\n    node-pre-gyp --help\n\n- clean - Remove the entire folder containing the compiled .node module\n- install - Install pre-built binary for module\n- reinstall - Run \"clean\" and \"install\" at once\n- build - Compile the module by dispatching to node-gyp or nw-gyp\n- rebuild - Run \"clean\" and \"build\" at once\n- package - Pack binary into tarball\n- testpackage - Test that the staged package is valid\n- publish - Publish pre-built binary\n- unpublish - Unpublish pre-built binary\n- info - Fetch info on published binaries\n\nYou can also chain commands:\n\n    node-pre-gyp clean build unpublish publish info\n\n### Options\n\nOptions include:\n\n - `-C/--directory`: run the command in this directory\n - `--build-from-source`: build from source instead of using pre-built binary\n - `--update-binary`: reinstall by replacing previously installed local binary with remote binary\n - `--runtime=node-webkit`: customize the runtime: `node`, `electron` and `node-webkit` are the valid options\n - `--fallback-to-build`: fallback to building from source if pre-built binary is not available\n - `--target=0.4.0`: Pass the target node or node-webkit version to compile against\n - `--target_arch=ia32`: Pass the target arch and override the host `arch`. Valid values are 'ia32','x64', or `arm`.\n - `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`.\n\nBoth `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module.\n\nFor example: `npm install --build-from-source=myapp`. This is useful if:\n\n - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependency with `npm install`.\n - The larger app also depends on other modules installed with `node-pre-gyp`\n - You only want to trigger a source compile for `myapp` and the other modules.\n\n### Configuring\n\nThis is a guide to configuring your module to use node-pre-gyp.\n\n#### 1) Add new entries to your `package.json`\n\n - Add `node-pre-gyp` to `dependencies`\n - Add `aws-sdk` as a `devDependency`\n - Add a custom `install` script\n - Declare a `binary` object\n\nThis looks like:\n\n```js\n    \"dependencies\"  : {\n      \"node-pre-gyp\": \"0.6.x\"\n    },\n    \"devDependencies\": {\n      \"aws-sdk\": \"2.x\"\n    }\n    \"scripts\": {\n        \"install\": \"node-pre-gyp install --fallback-to-build\"\n    },\n    \"binary\": {\n        \"module_name\": \"your_module\",\n        \"module_path\": \"./lib/binding/\",\n        \"host\": \"https://your_module.s3-us-west-1.amazonaws.com\"\n    }\n```\n\nFor a full example see [node-addon-examples's package.json](https://github.com/springmeyer/node-addon-example/blob/master/package.json).\n\nLet's break this down:\n\n - Dependencies need to list `node-pre-gyp`\n - Your devDependencies should list `aws-sdk` so that you can run `node-pre-gyp publish` locally or a CI system. We recommend using `devDependencies` only since `aws-sdk` is large and not needed for `node-pre-gyp install` since it only uses http to fetch binaries\n - Your `scripts` section should override the `install` target with `\"install\": \"node-pre-gyp install --fallback-to-build\"`. This allows node-pre-gyp to be used instead of the default npm behavior of always source compiling with `node-gyp` directly.\n - Your package.json should contain a `binary` section describing key properties you provide to allow node-pre-gyp to package optimally. They are detailed below.\n\nNote: in the past we recommended putting `node-pre-gyp` in the `bundledDependencies`, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case. Also, for a time we recommended using `\"preinstall\": \"npm install node-pre-gyp\"` as an alternative method to avoid needing to bundle. But this did not behave predictably across all npm versions - see https://github.com/mapbox/node-pre-gyp/issues/260 for the details. So we do not recommend using `preinstall` to install `node-pre-gyp`. More history on this at https://github.com/strongloop/fsevents/issues/157#issuecomment-265545908.\n\n##### The `binary` object has three required properties\n\n###### module_name\n\nThe name of your native node module. This value must:\n\n - Match the name passed to [the NODE_MODULE macro](http://nodejs.org/api/addons.html#addons_hello_world)\n - Must be a valid C variable name (e.g. it cannot contain `-`)\n - Should not include the `.node` extension.\n\n###### module_path\n\nThe location your native module is placed after a build. This should be an empty directory without other Javascript files. This entire directory will be packaged in the binary tarball. When installing from a remote package this directory will be overwritten with the contents of the tarball.\n\nNote: This property supports variables based on [Versioning](#versioning).\n\n###### host\n\nA url to the remote location where you've published tarball binaries (must be `https` not `http`).\n\nIt is highly recommended that you use Amazon S3. The reasons are:\n\n  - Various node-pre-gyp commands like `publish` and `info` only work with an S3 host.\n  - S3 is a very solid hosting platform for distributing large files.\n  - We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp.\n\nWhy then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a GitHub repo. This is not recommended, but if an author really wants to host in a non-S3 location then it should be possible.\n\nIt should also be mentioned that there is an optional and entirely separate npm module called [node-pre-gyp-github](https://github.com/bchr02/node-pre-gyp-github) which is intended to complement node-pre-gyp and be installed along with it. It provides the ability to store and publish your binaries within your repositories GitHub Releases if you would rather not use S3 directly. Installation and usage instructions can be found [here](https://github.com/bchr02/node-pre-gyp-github), but the basic premise is that instead of using the ```node-pre-gyp publish``` command you would use ```node-pre-gyp-github publish```.\n\n##### The `binary` object has two optional properties\n\n###### remote_path\n\nIt **is recommended** that you customize this property. This is an extra path to use for publishing and finding remote tarballs. The default value for `remote_path` is `\"\"` meaning that if you do not provide it then all packages will be published at the base of the `host`. It is recommended to provide a value like `./{name}/v{version}` to help organize remote packages in the case that you choose to publish multiple node addons to the same `host`.\n\nNote: This property supports variables based on [Versioning](#versioning).\n\n###### package_name\n\nIt is **not recommended** to override this property unless you are also overriding the `remote_path`. This is the versioned name of the remote tarball containing the binary `.node` module and any supporting files you've placed inside the `module_path` directory. Unless you specify `package_name` in your `package.json` then it defaults to `{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz` which allows your binary to work across node versions, platforms, and architectures. If you are using `remote_path` that is also versioned by `./{module_name}/v{version}` then you could remove these variables from the `package_name` and just use: `{node_abi}-{platform}-{arch}.tar.gz`. Then your remote tarball will be looked up at, for example, `https://example.com/your-module/v0.1.0/node-v11-linux-x64.tar.gz`.\n\nAvoiding the version of your module in the `package_name` and instead only embedding in a directory name can be useful when you want to make a quick tag of your module that does not change any C++ code. In this case you can just copy binaries to the new version behind the scenes like:\n\n```sh\naws s3 sync --acl public-read s3://mapbox-node-binary/sqlite3/v3.0.3/ s3://mapbox-node-binary/sqlite3/v3.0.4/\n```\n\nNote: This property supports variables based on [Versioning](#versioning).\n\n#### 2) Add a new target to binding.gyp\n\n`node-pre-gyp` calls out to `node-gyp` to compile the module and passes variables along like [module_name](#module_name) and [module_path](#module_path).\n\nA new target must be added to `binding.gyp` that moves the compiled `.node` module from `./build/Release/module_name.node` into the directory specified by `module_path`.\n\nAdd a target like this at the end of your `targets` list:\n\n```js\n    {\n      \"target_name\": \"action_after_build\",\n      \"type\": \"none\",\n      \"dependencies\": [ \"<(module_name)\" ],\n      \"copies\": [\n        {\n          \"files\": [ \"<(PRODUCT_DIR)/<(module_name).node\" ],\n          \"destination\": \"<(module_path)\"\n        }\n      ]\n    }\n```\n\nFor a full example see [node-addon-example's binding.gyp](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/binding.gyp).\n\n#### 3) Dynamically require your `.node`\n\nInside the main js file that requires your addon module you are likely currently doing:\n\n```js\nvar binding = require('../build/Release/binding.node');\n```\n\nor:\n\n```js\nvar bindings = require('./bindings')\n```\n\nChange those lines to:\n\n```js\nvar binary = require('node-pre-gyp');\nvar path = require('path');\nvar binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));\nvar binding = require(binding_path);\n```\n\nFor a full example see [node-addon-example's index.js](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/index.js#L1-L4)\n\n#### 4) Build and package your app\n\nNow build your module from source:\n\n    npm install --build-from-source\n\nThe `--build-from-source` tells `node-pre-gyp` to not look for a remote package and instead dispatch to node-gyp to build.\n\nNow `node-pre-gyp` should now also be installed as a local dependency so the command line tool it offers can be found at `./node_modules/.bin/node-pre-gyp`.\n\n#### 5) Test\n\nNow `npm test` should work just as it did before.\n\n#### 6) Publish the tarball\n\nThen package your app:\n\n    ./node_modules/.bin/node-pre-gyp package\n\nOnce packaged, now you can publish:\n\n    ./node_modules/.bin/node-pre-gyp publish\n\nCurrently the `publish` command pushes your binary to S3. This requires:\n\n - You have installed `aws-sdk` with `npm install aws-sdk`\n - You have created a bucket already.\n - The `host` points to an S3 http or https endpoint.\n - You have configured node-pre-gyp to read your S3 credentials (see [S3 hosting](#s3-hosting) for details).\n\nYou can also host your binaries elsewhere. To do this requires:\n\n - You manually publish the binary created by the `package` command to an `https` endpoint\n - Ensure that the `host` value points to your custom `https` endpoint.\n\n#### 7) Automate builds\n\nNow you need to publish builds for all the platforms and node versions you wish to support. This is best automated.\n\n - See [Appveyor Automation](#appveyor-automation) for how to auto-publish builds on Windows.\n - See [Travis Automation](#travis-automation) for how to auto-publish builds on OS X and Linux.\n\n#### 8) You're done!\n\nNow publish your module to the npm registry. Users will now be able to install your module from a binary.\n\nWhat will happen is this:\n\n1. `npm install <your package>` will pull from the npm registry\n2. npm will run the `install` script which will call out to `node-pre-gyp`\n3. `node-pre-gyp` will fetch the binary `.node` module and unpack in the right place\n4. Assuming that all worked, you are done\n\nIf a a binary was not available for a given platform and `--fallback-to-build` was used then `node-gyp rebuild` will be called to try to source compile the module.\n\n## N-API Considerations\n\n[N-API](https://nodejs.org/api/n-api.html#n_api_n_api) is an ABI-stable alternative to previous technologies such as [nan](https://github.com/nodejs/nan) which are tied to a specific Node runtime engine. N-API is Node runtime engine agnostic and guarantees modules created today will continue to run, without changes, into the future.\n\nUsing `node-pre-gyp` with N-API projects requires a handful of additional configuration values and imposes some additional requirements.\n\nThe most significant difference is that an N-API module can be coded to target multiple  N-API versions. Therefore, an N-API module must declare in its `package.json` file which N-API versions the module is designed to run against. In addition, since multiple builds may be required for a single module, path and file names must be specified in way that avoids naming conflicts.\n\n### The `napi_versions` array property\n\nAn N-API modules must declare in its `package.json` file, the N-API versions the module is intended to support. This is accomplished by including an `napi-versions` array property in the `binary` object. For example:\n\n```js\n\"binary\": {\n    \"module_name\": \"your_module\",\n    \"module_path\": \"your_module_path\",\n    \"host\": \"https://your_bucket.s3-us-west-1.amazonaws.com\",\n    \"napi_versions\": [1,3]\n  }\n```\n\nIf the `napi_versions` array property is *not* present, `node-pre-gyp` operates as it always has. Including the `napi_versions` array property instructs `node-pre-gyp` that this is a N-API module build.\n\nWhen the `napi_versions` array property is present, `node-pre-gyp` fires off multiple operations, one for each of the N-API versions in the array. In the example above, two operations are initiated, one for N-API version 1 and second for N-API version 3. How this version number is communicated is described next.\n\n### The `napi_build_version` value\n\nFor each of the N-API module operations `node-pre-gyp` initiates, it ensures that the `napi_build_version` is set appropriately.\n\nThis value is of importance in two areas:\n\n1. The C/C++ code which needs to know against which N-API version it should compile.\n2. `node-pre-gyp` itself which must assign appropriate path and file names to avoid collisions.\n\n### Defining `NAPI_VERSION` for the C/C++ code\n\nThe `napi_build_version` value is communicated to the C/C++ code by adding this code to the `binding.gyp` file:\n\n```\n\"defines\": [\n    \"NAPI_VERSION=<(napi_build_version)\",\n]\n```\n\nThis ensures that `NAPI_VERSION`, an integer value, is declared appropriately to the C/C++ code for each build.\n\n> Note that earlier versions of this document recommended defining the symbol `NAPI_BUILD_VERSION`. `NAPI_VERSION` is prefered because it used by the N-API C/C++ headers to configure the specific N-API veriosn being requested. \n\n### Path and file naming requirements in `package.json`\n\nSince `node-pre-gyp` fires off multiple operations for each request, it is essential that path and file names be created in such a way as to avoid collisions. This is accomplished by imposing additional path and file naming requirements.\n\nSpecifically, when performing N-API builds, the `{napi_build_version}` text configuration value  *must* be present in the `module_path` property. In addition, the `{napi_build_version}` text configuration value  *must* be present in either the `remote_path` or `package_name` property. (No problem if it's in both.)\n\nHere's an example:\n\n```js\n\"binary\": {\n    \"module_name\": \"your_module\",\n    \"module_path\": \"./lib/binding/napi-v{napi_build_version}\",\n    \"remote_path\": \"./{module_name}/v{version}/{configuration}/\",\n    \"package_name\": \"{platform}-{arch}-napi-v{napi_build_version}.tar.gz\",\n    \"host\": \"https://your_bucket.s3-us-west-1.amazonaws.com\",\n    \"napi_versions\": [1,3]\n  }\n```\n\n## Supporting both N-API and NAN builds\n\nYou may have a legacy native add-on that you wish to continue supporting for those versions of Node that do not support N-API, as you add N-API support for later Node versions. This can be accomplished by specifying the `node_napi_label` configuration value in the package.json `binary.package_name` property. \n\nPlacing the configuration value `node_napi_label` in the package.json `binary.package_name` property instructs `node-pre-gyp` to build all viable N-API binaries supported by the current Node instance. If the current Node instance does not support N-API, `node-pre-gyp` will request a traditional, non-N-API build. \n\nThe configuration value `node_napi_label` is set by `node-pre-gyp` to the type of build created, `napi` or `node`, and the version number. For N-API builds, the string contains the N-API version nad has values like `napi-v3`. For traditional, non-N-API builds, the string contains the ABI version with values like `node-v46`.\n\nHere's how the `binary` configuration above might be changed to support both N-API and NAN builds:\n\n```js\n\"binary\": {\n    \"module_name\": \"your_module\",\n    \"module_path\": \"./lib/binding/{node_napi_label}\",\n    \"remote_path\": \"./{module_name}/v{version}/{configuration}/\",\n    \"package_name\": \"{platform}-{arch}-{node_napi_label}.tar.gz\",\n    \"host\": \"https://your_bucket.s3-us-west-1.amazonaws.com\",\n    \"napi_versions\": [1,3]\n  }\n```\n\nThe C/C++ symbol `NAPI_VERSION` can be used to distinguish N-API and non-N-API builds. The value of `NAPI_VERSION` is set to the integer N-API version for N-API builds and is set to `0` for non-N-API builds. \n\nFor example:\n \n```C\n#if NAPI_VERSION\n// N-API code goes here\n#else\n// NAN code goes here\n#endif\n```\n\n### Two additional configuration values\n\nThe following two configuration values, which were implemented in previous versions of `node-pre-gyp`, continue to exist, but have been replaced by the `node_napi_label` configuration value described above.\n\n1. `napi_version` If N-API is supported by the currently executing Node instance, this value is the N-API version number supported by Node. If N-API is not supported, this value is an empty string.\n\n2. `node_abi_napi` If the value returned for `napi_version` is non empty, this value is `'napi'`. If the value returned for `napi_version` is empty, this value is the value returned for `node_abi`.\n\nThese values are present for use in the `binding.gyp` file and may be used as `{napi_version}` and `{node_abi_napi}` for text substituion in the `binary` properties of the `package.json` file.\n\n## S3 Hosting\n\nYou can host wherever you choose but S3 is cheap, `node-pre-gyp publish` expects it, and S3 can be integrated well with [Travis.ci](http://travis-ci.org) to automate builds for OS X and Ubuntu, and with [Appveyor](http://appveyor.com) to automate builds for Windows. Here is an approach to do this:\n\nFirst, get setup locally and test the workflow:\n\n#### 1) Create an S3 bucket\n\nAnd have your **key** and **secret key** ready for writing to the bucket.\n\nIt is recommended to create a IAM user with a policy that only gives permissions to the specific bucket you plan to publish to. This can be done in the [IAM console](https://console.aws.amazon.com/iam/) by: 1) adding a new user, 2) choosing `Attach User Policy`, 3) Using the `Policy Generator`, 4) selecting `Amazon S3` for the service, 5) adding the actions: `DeleteObject`, `GetObject`, `GetObjectAcl`, `ListBucket`, `PutObject`, `PutObjectAcl`, 6) adding an ARN of `arn:aws:s3:::bucket/*` (replacing `bucket` with your bucket name), and finally 7) clicking `Add Statement` and saving the policy. It should generate a policy like:\n\n```js\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"Stmt1394587197000\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:DeleteObject\",\n        \"s3:GetObject\",\n        \"s3:GetObjectAcl\",\n        \"s3:ListBucket\",\n        \"s3:PutObject\",\n        \"s3:PutObjectAcl\"\n      ],\n      \"Resource\": [\n        \"arn:aws:s3:::node-pre-gyp-tests/*\"\n      ]\n    }\n  ]\n}\n```\n\n#### 2) Install node-pre-gyp\n\nEither install it globally:\n\n    npm install node-pre-gyp -g\n\nOr put the local version on your PATH\n\n    export PATH=`pwd`/node_modules/.bin/:$PATH\n\n#### 3) Configure AWS credentials\n\nThere are several ways to do this.\n\nYou can use any of the methods described at http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html.\n\nOr you can create a `~/.node_pre_gyprc`\n\nOr pass options in any way supported by [RC](https://github.com/dominictarr/rc#standards)\n\nA `~/.node_pre_gyprc` looks like:\n\n```js\n{\n    \"accessKeyId\": \"xxx\",\n    \"secretAccessKey\": \"xxx\"\n}\n```\n\nAnother way is to use your environment:\n\n    export node_pre_gyp_accessKeyId=xxx\n    export node_pre_gyp_secretAccessKey=xxx\n\nYou may also need to specify the `region` if it is not explicit in the `host` value you use. The `bucket` can also be specified but it is optional because `node-pre-gyp` will detect it from the `host` value.\n\n#### 4) Package and publish your build\n\nInstall the `aws-sdk`:\n\n    npm install aws-sdk\n\nThen publish:\n\n    node-pre-gyp package publish\n\nNote: if you hit an error like `Hostname/IP doesn't match certificate's altnames` it may mean that you need to provide the `region` option in your config.\n\n## Appveyor Automation\n\n[Appveyor](http://www.appveyor.com/) can build binaries and publish the results per commit and supports:\n\n - Windows Visual Studio 2013 and related compilers\n - Both 64 bit (x64) and 32 bit (x86) build configurations\n - Multiple Node.js versions\n\nFor an example of doing this see [node-sqlite3's appveyor.yml](https://github.com/mapbox/node-sqlite3/blob/master/appveyor.yml).\n\nBelow is a guide to getting set up:\n\n#### 1) Create a free Appveyor account\n\nGo to https://ci.appveyor.com/signup/free and sign in with your GitHub account.\n\n#### 2) Create a new project\n\nGo to https://ci.appveyor.com/projects/new and select the GitHub repo for your module\n\n#### 3) Add appveyor.yml and push it\n\nOnce you have committed an `appveyor.yml` ([appveyor.yml reference](http://www.appveyor.com/docs/appveyor-yml)) to your GitHub repo and pushed it AppVeyor should automatically start building your project.\n\n#### 4) Create secure variables\n\nEncrypt your S3 AWS keys by going to <https://ci.appveyor.com/tools/encrypt> and hitting the `encrypt` button.\n\nThen paste the result into your `appveyor.yml`\n\n```yml\nenvironment:\n  node_pre_gyp_accessKeyId:\n    secure: Dn9HKdLNYvDgPdQOzRq/DqZ/MPhjknRHB1o+/lVU8MA=\n  node_pre_gyp_secretAccessKey:\n    secure: W1rwNoSnOku1r+28gnoufO8UA8iWADmL1LiiwH9IOkIVhDTNGdGPJqAlLjNqwLnL\n```\n\nNOTE: keys are per account but not per repo (this is difference than Travis where keys are per repo but not related to the account used to encrypt them).\n\n#### 5) Hook up publishing\n\nJust put `node-pre-gyp package publish` in your `appveyor.yml` after `npm install`.\n\n#### 6) Publish when you want\n\nYou might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:\n\n    SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%\n    if not \"%CM%\" == \"%CM:[publish binary]=%\" node-pre-gyp --msvs_version=2013 publish\n\nIf your commit message contains special characters (e.g. `&`) this method might fail. An alternative is to use PowerShell, which gives you additional possibilities, like ignoring case by using `ToLower()`:\n\n    ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains('[publish binary]')) { node-pre-gyp --msvs_version=2013 publish }\n\nRemember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package.\n\n## Travis Automation\n\n[Travis](https://travis-ci.org/) can push to S3 after a successful build and supports both:\n\n - Ubuntu Precise and OS X (64 bit)\n - Multiple Node.js versions\n\nFor an example of doing this see [node-add-example's .travis.yml](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/.travis.yml).\n\nNote: if you need 32 bit binaries, this can be done from a 64 bit Travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74).\n\nBelow is a guide to getting set up:\n\n#### 1) Install the Travis gem\n\n    gem install travis\n\n#### 2) Create secure variables\n\nMake sure you run this command from within the directory of your module.\n\nUse `travis-encrypt` like:\n\n    travis encrypt node_pre_gyp_accessKeyId=${node_pre_gyp_accessKeyId}\n    travis encrypt node_pre_gyp_secretAccessKey=${node_pre_gyp_secretAccessKey}\n\nThen put those values in your `.travis.yml` like:\n\n```yaml\nenv:\n  global:\n    - secure: F+sEL/v56CzHqmCSSES4pEyC9NeQlkoR0Gs/ZuZxX1ytrj8SKtp3MKqBj7zhIclSdXBz4Ev966Da5ctmcTd410p0b240MV6BVOkLUtkjZJyErMBOkeb8n8yVfSoeMx8RiIhBmIvEn+rlQq+bSFis61/JkE9rxsjkGRZi14hHr4M=\n    - secure: o2nkUQIiABD139XS6L8pxq3XO5gch27hvm/gOdV+dzNKc/s2KomVPWcOyXNxtJGhtecAkABzaW8KHDDi5QL1kNEFx6BxFVMLO8rjFPsMVaBG9Ks6JiDQkkmrGNcnVdxI/6EKTLHTH5WLsz8+J7caDBzvKbEfTux5EamEhxIWgrI=\n```\n\nMore details on Travis encryption at http://about.travis-ci.org/docs/user/encryption-keys/.\n\n#### 3) Hook up publishing\n\nJust put `node-pre-gyp package publish` in your `.travis.yml` after `npm install`.\n\n##### OS X publishing\n\nIf you want binaries for OS X in addition to linux you can enable [multi-os for Travis](http://docs.travis-ci.com/user/multi-os/#Setting-.travis.yml)\n\nUse a configuration like:\n\n```yml\n\nlanguage: cpp\n\nos:\n- linux\n- osx\n\nenv:\n  matrix:\n    - NODE_VERSION=\"4\"\n    - NODE_VERSION=\"6\"\n\nbefore_install:\n- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm\n- source ~/.nvm/nvm.sh\n- nvm install $NODE_VERSION\n- nvm use $NODE_VERSION\n```\n\nSee [Travis OS X Gotchas](#travis-os-x-gotchas) for why we replace `language: node_js` and `node_js:` sections with `language: cpp` and a custom matrix.\n\nAlso create platform specific sections for any deps that need install. For example if you need libpng:\n\n```yml\n- if [ $(uname -s) == 'Linux' ]; then apt-get install libpng-dev; fi;\n- if [ $(uname -s) == 'Darwin' ]; then brew install libpng; fi;\n```\n\nFor detailed multi-OS examples see [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/.travis.yml) and [node-sqlite3](https://github.com/mapbox/node-sqlite3/blob/master/.travis.yml).\n\n##### Travis OS X Gotchas\n\nFirst, unlike the Travis Linux machines, the OS X machines do not put `node-pre-gyp` on PATH by default. To do so you will need to:\n\n```sh\nexport PATH=$(pwd)/node_modules/.bin:${PATH}\n```\n\nSecond, the OS X machines do not support using a matrix for installing different Node.js versions. So you need to bootstrap the installation of Node.js in a cross platform way.\n\nBy doing:\n\n```yml\nenv:\n  matrix:\n    - NODE_VERSION=\"4\"\n    - NODE_VERSION=\"6\"\n\nbefore_install:\n - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm\n - source ~/.nvm/nvm.sh\n - nvm install $NODE_VERSION\n - nvm use $NODE_VERSION\n```\n\nYou can easily recreate the previous behavior of this matrix:\n\n```yml\nnode_js:\n  - \"4\"\n  - \"6\"\n```\n\n#### 4) Publish when you want\n\nYou might wish to publish binaries only on a specific commit. To do this you could borrow from the [Travis CI idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:\n\n    COMMIT_MESSAGE=$(git log --format=%B --no-merges -n 1 | tr -d '\\n')\n    if [[ ${COMMIT_MESSAGE} =~ \"[publish binary]\" ]]; then node-pre-gyp publish; fi;\n\nThen you can trigger new binaries to be built like:\n\n    git commit -a -m \"[publish binary]\"\n\nOr, if you don't have any changes to make simply run:\n\n    git commit --allow-empty -m \"[publish binary]\"\n\nWARNING: if you are working in a pull request and publishing binaries from there then you will want to avoid double publishing when Travis CI builds both the `push` and `pr`. You only want to run the publish on the `push` commit. See https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/is_pr_merge.sh which is called from https://github.com/Project-OSRM/node-osrm/blob/8eb837abe2e2e30e595093d16e5354bc5c573575/scripts/publish.sh for an example of how to do this.\n\nRemember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on Travis see http://about.travis-ci.org/docs/user/deployment/npm/\n\n# Versioning\n\nThe `binary` properties of `module_path`, `remote_path`, and `package_name` support variable substitution. The strings are evaluated by `node-pre-gyp` depending on your system and any custom build flags you passed.\n\n - `node_abi`: The node C++ `ABI` number. This value is available in Javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version.\n - `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override.\n - `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override.\n - `libc` matches `require('detect-libc').family` like `glibc` or `musl` unless the user passes the `--target_libc` option to override.\n - `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build.\n - `module_name` - the `binary.module_name` attribute from `package.json`.\n - `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property).\n - `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version`\n - `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that`\n - `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta`\n\n\nThe options are visible in the code at <https://github.com/mapbox/node-pre-gyp/blob/612b7bca2604508d881e1187614870ba19a7f0c5/lib/util/versioning.js#L114-L127>\n\n# Download binary files from a mirror\n\nS3 is broken in China for the well known reason.\n\nUsing the `npm` config argument: `--{module_name}_binary_host_mirror` can download binary files through a mirror.\n\ne.g.: Install [v8-profiler](https://www.npmjs.com/package/v8-profiler) from `npm`.\n\n```bash\n$ npm install v8-profiler --profiler_binary_host_mirror=https://npm.taobao.org/mirrors/node-inspector/\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/mapbox/node-pre-gyp.git"
+  },
+  "scripts": {
+    "pretest": "jshint test/build.test.js test/s3_setup.test.js test/versioning.test.js test/fetch.test.js lib lib/util scripts bin/node-pre-gyp",
+    "test": "jshint lib lib/util scripts bin/node-pre-gyp && tape test/*test.js",
+    "update-crosswalk": "node scripts/abi_crosswalk.js"
+  },
+  "version": "0.13.0"
+}
diff --git a/legacy-libs/grpc/node_modules/nopt/CHANGELOG.md b/legacy-libs/grpc/node_modules/nopt/CHANGELOG.md
new file mode 100644 (file)
index 0000000..82a09fb
--- /dev/null
@@ -0,0 +1,58 @@
+### v4.0.1 (2016-12-14)
+
+#### WHOOPS
+
+* [`fb9b1ce`](https://github.com/npm/nopt/commit/fb9b1ce57b3c69b4f7819015be87719204f77ef6)
+  Merged so many patches at once that the code fencing
+  ([@adius](https://github.com/adius)) added got broken. Sorry,
+  ([@adius](https://github.com/adius))!
+  ([@othiym23](https://github.com/othiym23))
+
+### v4.0.0 (2016-12-13)
+
+#### BREAKING CHANGES
+
+* [`651d447`](https://github.com/npm/nopt/commit/651d4473946096d341a480bbe56793de3fc706aa)
+  When parsing String-typed arguments, if the next value is `""`, don't simply
+  swallow it. ([@samjonester](https://github.com/samjonester))
+
+#### PERFORMANCE TWEAKS
+
+* [`3370ce8`](https://github.com/npm/nopt/commit/3370ce87a7618ba228883861db84ddbcdff252a9)
+  Simplify initialization. ([@elidoran](https://github.com/elidoran))
+* [`356e58e`](https://github.com/npm/nopt/commit/356e58e3b3b431a4b1af7fd7bdee44c2c0526a09)
+  Store `Array.isArray(types[arg])` for reuse.
+  ([@elidoran](https://github.com/elidoran))
+* [`0d95e90`](https://github.com/npm/nopt/commit/0d95e90515844f266015b56d2c80b94e5d14a07e)
+  Interpret single-item type arrays as a single type.
+  ([@samjonester](https://github.com/samjonester))
+* [`07c69d3`](https://github.com/npm/nopt/commit/07c69d38b5186450941fbb505550becb78a0e925)
+  Simplify key-value extraction. ([@elidoran](https://github.com/elidoran))
+* [`39b6e5c`](https://github.com/npm/nopt/commit/39b6e5c65ac47f60cd43a1fbeece5cd4c834c254)
+  Only call `Date.parse(val)` once. ([@elidoran](https://github.com/elidoran))
+* [`934943d`](https://github.com/npm/nopt/commit/934943dffecb55123a2b15959fe2a359319a5dbd)
+  Use `osenv.home()` to find a user's home directory instead of assuming it's
+  always `$HOME`. ([@othiym23](https://github.com/othiym23))
+
+#### TEST & CI IMPROVEMENTS
+
+* [`326ffff`](https://github.com/npm/nopt/commit/326ffff7f78a00bcd316adecf69075f8a8093619)
+  Fix `/tmp` test to work on Windows.
+  ([@elidoran](https://github.com/elidoran))
+* [`c89d31a`](https://github.com/npm/nopt/commit/c89d31a49d14f2238bc6672db08da697bbc57f1b)
+  Only run Windows tests on Windows, only run Unix tests on a Unix.
+  ([@elidoran](https://github.com/elidoran))
+* [`affd3d1`](https://github.com/npm/nopt/commit/affd3d1d0addffa93006397b2013b18447339366)
+  Refresh Travis to run the tests against the currently-supported batch of npm
+  versions. ([@helio](https://github.com/helio)-frota)
+* [`55f9449`](https://github.com/npm/nopt/commit/55f94497d163ed4d16dd55fd6c4fb95cc440e66d)
+  `tap@8.0.1` ([@othiym23](https://github.com/othiym23))
+
+#### DOC TWEAKS
+
+* [`5271229`](https://github.com/npm/nopt/commit/5271229ee7c810217dd51616c086f5d9ab224581)
+  Use JavaScript code block for syntax highlighting.
+  ([@adius](https://github.com/adius))
+* [`c0d156f`](https://github.com/npm/nopt/commit/c0d156f229f9994c5dfcec4a8886eceff7a07682)
+  The code sample in the README had `many2: [ oneThing ]`, and now it has
+  `many2: [ two, things ]`. ([@silkentrance](https://github.com/silkentrance))
diff --git a/legacy-libs/grpc/node_modules/nopt/LICENSE b/legacy-libs/grpc/node_modules/nopt/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/nopt/README.md b/legacy-libs/grpc/node_modules/nopt/README.md
new file mode 100644 (file)
index 0000000..a99531c
--- /dev/null
@@ -0,0 +1,213 @@
+If you want to write an option parser, and have it be good, there are
+two ways to do it.  The Right Way, and the Wrong Way.
+
+The Wrong Way is to sit down and write an option parser.  We've all done
+that.
+
+The Right Way is to write some complex configurable program with so many
+options that you hit the limit of your frustration just trying to
+manage them all, and defer it with duct-tape solutions until you see
+exactly to the core of the problem, and finally snap and write an
+awesome option parser.
+
+If you want to write an option parser, don't write an option parser.
+Write a package manager, or a source control system, or a service
+restarter, or an operating system.  You probably won't end up with a
+good one of those, but if you don't give up, and you are relentless and
+diligent enough in your procrastination, you may just end up with a very
+nice option parser.
+
+## USAGE
+
+```javascript
+// my-program.js
+var nopt = require("nopt")
+  , Stream = require("stream").Stream
+  , path = require("path")
+  , knownOpts = { "foo" : [String, null]
+                , "bar" : [Stream, Number]
+                , "baz" : path
+                , "bloo" : [ "big", "medium", "small" ]
+                , "flag" : Boolean
+                , "pick" : Boolean
+                , "many1" : [String, Array]
+                , "many2" : [path, Array]
+                }
+  , shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
+                 , "b7" : ["--bar", "7"]
+                 , "m" : ["--bloo", "medium"]
+                 , "p" : ["--pick"]
+                 , "f" : ["--flag"]
+                 }
+             // everything is optional.
+             // knownOpts and shorthands default to {}
+             // arg list defaults to process.argv
+             // slice defaults to 2
+  , parsed = nopt(knownOpts, shortHands, process.argv, 2)
+console.log(parsed)
+```
+
+This would give you support for any of the following:
+
+```console
+$ node my-program.js --foo "blerp" --no-flag
+{ "foo" : "blerp", "flag" : false }
+
+$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag
+{ bar: 7, foo: "Mr. Hand", flag: true }
+
+$ node my-program.js --foo "blerp" -f -----p
+{ foo: "blerp", flag: true, pick: true }
+
+$ node my-program.js -fp --foofoo
+{ foo: "Mr. Foo", flag: true, pick: true }
+
+$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.
+{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
+
+$ node my-program.js --blatzk -fp # unknown opts are ok.
+{ blatzk: true, flag: true, pick: true }
+
+$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
+{ blatzk: 1000, flag: true, pick: true }
+
+$ node my-program.js --no-blatzk -fp # unless they start with "no-"
+{ blatzk: false, flag: true, pick: true }
+
+$ node my-program.js --baz b/a/z # known paths are resolved.
+{ baz: "/Users/isaacs/b/a/z" }
+
+# if Array is one of the types, then it can take many
+# values, and will always be an array.  The other types provided
+# specify what types are allowed in the list.
+
+$ node my-program.js --many1 5 --many1 null --many1 foo
+{ many1: ["5", "null", "foo"] }
+
+$ node my-program.js --many2 foo --many2 bar
+{ many2: ["/path/to/foo", "path/to/bar"] }
+```
+
+Read the tests at the bottom of `lib/nopt.js` for more examples of
+what this puppy can do.
+
+## Types
+
+The following types are supported, and defined on `nopt.typeDefs`
+
+* String: A normal string.  No parsing is done.
+* path: A file system path.  Gets resolved against cwd if not absolute.
+* url: A url.  If it doesn't parse, it isn't accepted.
+* Number: Must be numeric.
+* Date: Must parse as a date. If it does, and `Date` is one of the options,
+  then it will return a Date object, not a string.
+* Boolean: Must be either `true` or `false`.  If an option is a boolean,
+  then it does not need a value, and its presence will imply `true` as
+  the value.  To negate boolean flags, do `--no-whatever` or `--whatever
+  false`
+* NaN: Means that the option is strictly not allowed.  Any value will
+  fail.
+* Stream: An object matching the "Stream" class in node.  Valuable
+  for use when validating programmatically.  (npm uses this to let you
+  supply any WriteStream on the `outfd` and `logfd` config options.)
+* Array: If `Array` is specified as one of the types, then the value
+  will be parsed as a list of options.  This means that multiple values
+  can be specified, and that the value will always be an array.
+
+If a type is an array of values not on this list, then those are
+considered valid values.  For instance, in the example above, the
+`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`,
+and any other value will be rejected.
+
+When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be
+interpreted as their JavaScript equivalents.
+
+You can also mix types and values, or multiple types, in a list.  For
+instance `{ blah: [Number, null] }` would allow a value to be set to
+either a Number or null.  When types are ordered, this implies a
+preference, and the first type that can be used to properly interpret
+the value will be used.
+
+To define a new type, add it to `nopt.typeDefs`.  Each item in that
+hash is an object with a `type` member and a `validate` method.  The
+`type` member is an object that matches what goes in the type list.  The
+`validate` method is a function that gets called with `validate(data,
+key, val)`.  Validate methods should assign `data[key]` to the valid
+value of `val` if it can be handled properly, or return boolean
+`false` if it cannot.
+
+You can also call `nopt.clean(data, types, typeDefs)` to clean up a
+config object and remove its invalid properties.
+
+## Error Handling
+
+By default, nopt outputs a warning to standard error when invalid values for
+known options are found.  You can change this behavior by assigning a method
+to `nopt.invalidHandler`.  This method will be called with
+the offending `nopt.invalidHandler(key, val, types)`.
+
+If no `nopt.invalidHandler` is assigned, then it will console.error
+its whining.  If it is assigned to boolean `false` then the warning is
+suppressed.
+
+## Abbreviations
+
+Yes, they are supported.  If you define options like this:
+
+```javascript
+{ "foolhardyelephants" : Boolean
+, "pileofmonkeys" : Boolean }
+```
+
+Then this will work:
+
+```bash
+node program.js --foolhar --pil
+node program.js --no-f --pileofmon
+# etc.
+```
+
+## Shorthands
+
+Shorthands are a hash of shorter option names to a snippet of args that
+they expand to.
+
+If multiple one-character shorthands are all combined, and the
+combination does not unambiguously match any other option or shorthand,
+then they will be broken up into their constituent parts.  For example:
+
+```json
+{ "s" : ["--loglevel", "silent"]
+, "g" : "--global"
+, "f" : "--force"
+, "p" : "--parseable"
+, "l" : "--long"
+}
+```
+
+```bash
+npm ls -sgflp
+# just like doing this:
+npm ls --loglevel silent --global --force --long --parseable
+```
+
+## The Rest of the args
+
+The config object returned by nopt is given a special member called
+`argv`, which is an object with the following fields:
+
+* `remain`: The remaining args after all the parsing has occurred.
+* `original`: The args as they originally appeared.
+* `cooked`: The args after flags and shorthands are expanded.
+
+## Slicing
+
+Node programs are called with more or less the exact argv as it appears
+in C land, after the v8 and node-specific options have been plucked off.
+As such, `argv[0]` is always `node` and `argv[1]` is always the
+JavaScript program being run.
+
+That's usually not very useful to you.  So they're sliced off by
+default.  If you want them, then you can pass in `0` as the last
+argument, or any other number that you'd like to slice off the start of
+the list.
diff --git a/legacy-libs/grpc/node_modules/nopt/bin/nopt.js b/legacy-libs/grpc/node_modules/nopt/bin/nopt.js
new file mode 100644 (file)
index 0000000..3232d4c
--- /dev/null
@@ -0,0 +1,54 @@
+#!/usr/bin/env node
+var nopt = require("../lib/nopt")
+  , path = require("path")
+  , types = { num: Number
+            , bool: Boolean
+            , help: Boolean
+            , list: Array
+            , "num-list": [Number, Array]
+            , "str-list": [String, Array]
+            , "bool-list": [Boolean, Array]
+            , str: String
+            , clear: Boolean
+            , config: Boolean
+            , length: Number
+            , file: path
+            }
+  , shorthands = { s: [ "--str", "astring" ]
+                 , b: [ "--bool" ]
+                 , nb: [ "--no-bool" ]
+                 , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ]
+                 , "?": ["--help"]
+                 , h: ["--help"]
+                 , H: ["--help"]
+                 , n: [ "--num", "125" ]
+                 , c: ["--config"]
+                 , l: ["--length"]
+                 , f: ["--file"]
+                 }
+  , parsed = nopt( types
+                 , shorthands
+                 , process.argv
+                 , 2 )
+
+console.log("parsed", parsed)
+
+if (parsed.help) {
+  console.log("")
+  console.log("nopt cli tester")
+  console.log("")
+  console.log("types")
+  console.log(Object.keys(types).map(function M (t) {
+    var type = types[t]
+    if (Array.isArray(type)) {
+      return [t, type.map(function (type) { return type.name })]
+    }
+    return [t, type && type.name]
+  }).reduce(function (s, i) {
+    s[i[0]] = i[1]
+    return s
+  }, {}))
+  console.log("")
+  console.log("shorthands")
+  console.log(shorthands)
+}
diff --git a/legacy-libs/grpc/node_modules/nopt/examples/my-program.js b/legacy-libs/grpc/node_modules/nopt/examples/my-program.js
new file mode 100644 (file)
index 0000000..142447e
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+
+//process.env.DEBUG_NOPT = 1
+
+// my-program.js
+var nopt = require("../lib/nopt")
+  , Stream = require("stream").Stream
+  , path = require("path")
+  , knownOpts = { "foo" : [String, null]
+                , "bar" : [Stream, Number]
+                , "baz" : path
+                , "bloo" : [ "big", "medium", "small" ]
+                , "flag" : Boolean
+                , "pick" : Boolean
+                }
+  , shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
+                 , "b7" : ["--bar", "7"]
+                 , "m" : ["--bloo", "medium"]
+                 , "p" : ["--pick"]
+                 , "f" : ["--flag", "true"]
+                 , "g" : ["--flag"]
+                 , "s" : "--flag"
+                 }
+             // everything is optional.
+             // knownOpts and shorthands default to {}
+             // arg list defaults to process.argv
+             // slice defaults to 2
+  , parsed = nopt(knownOpts, shortHands, process.argv, 2)
+
+console.log("parsed =\n"+ require("util").inspect(parsed))
diff --git a/legacy-libs/grpc/node_modules/nopt/lib/nopt.js b/legacy-libs/grpc/node_modules/nopt/lib/nopt.js
new file mode 100644 (file)
index 0000000..1fb1135
--- /dev/null
@@ -0,0 +1,436 @@
+// info about each config option.
+
+var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
+  ? function () { console.error.apply(console, arguments) }
+  : function () {}
+
+var url = require("url")
+  , path = require("path")
+  , Stream = require("stream").Stream
+  , abbrev = require("abbrev")
+  , osenv = require("osenv")
+
+module.exports = exports = nopt
+exports.clean = clean
+
+exports.typeDefs =
+  { String  : { type: String,  validate: validateString  }
+  , Boolean : { type: Boolean, validate: validateBoolean }
+  , url     : { type: url,     validate: validateUrl     }
+  , Number  : { type: Number,  validate: validateNumber  }
+  , path    : { type: path,    validate: validatePath    }
+  , Stream  : { type: Stream,  validate: validateStream  }
+  , Date    : { type: Date,    validate: validateDate    }
+  }
+
+function nopt (types, shorthands, args, slice) {
+  args = args || process.argv
+  types = types || {}
+  shorthands = shorthands || {}
+  if (typeof slice !== "number") slice = 2
+
+  debug(types, shorthands, args, slice)
+
+  args = args.slice(slice)
+  var data = {}
+    , key
+    , argv = {
+        remain: [],
+        cooked: args,
+        original: args.slice(0)
+      }
+
+  parse(args, data, argv.remain, types, shorthands)
+  // now data is full
+  clean(data, types, exports.typeDefs)
+  data.argv = argv
+  Object.defineProperty(data.argv, 'toString', { value: function () {
+    return this.original.map(JSON.stringify).join(" ")
+  }, enumerable: false })
+  return data
+}
+
+function clean (data, types, typeDefs) {
+  typeDefs = typeDefs || exports.typeDefs
+  var remove = {}
+    , typeDefault = [false, true, null, String, Array]
+
+  Object.keys(data).forEach(function (k) {
+    if (k === "argv") return
+    var val = data[k]
+      , isArray = Array.isArray(val)
+      , type = types[k]
+    if (!isArray) val = [val]
+    if (!type) type = typeDefault
+    if (type === Array) type = typeDefault.concat(Array)
+    if (!Array.isArray(type)) type = [type]
+
+    debug("val=%j", val)
+    debug("types=", type)
+    val = val.map(function (val) {
+      // if it's an unknown value, then parse false/true/null/numbers/dates
+      if (typeof val === "string") {
+        debug("string %j", val)
+        val = val.trim()
+        if ((val === "null" && ~type.indexOf(null))
+            || (val === "true" &&
+               (~type.indexOf(true) || ~type.indexOf(Boolean)))
+            || (val === "false" &&
+               (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
+          val = JSON.parse(val)
+          debug("jsonable %j", val)
+        } else if (~type.indexOf(Number) && !isNaN(val)) {
+          debug("convert to number", val)
+          val = +val
+        } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
+          debug("convert to date", val)
+          val = new Date(val)
+        }
+      }
+
+      if (!types.hasOwnProperty(k)) {
+        return val
+      }
+
+      // allow `--no-blah` to set 'blah' to null if null is allowed
+      if (val === false && ~type.indexOf(null) &&
+          !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
+        val = null
+      }
+
+      var d = {}
+      d[k] = val
+      debug("prevalidated val", d, val, types[k])
+      if (!validate(d, k, val, types[k], typeDefs)) {
+        if (exports.invalidHandler) {
+          exports.invalidHandler(k, val, types[k], data)
+        } else if (exports.invalidHandler !== false) {
+          debug("invalid: "+k+"="+val, types[k])
+        }
+        return remove
+      }
+      debug("validated val", d, val, types[k])
+      return d[k]
+    }).filter(function (val) { return val !== remove })
+
+    if (!val.length) delete data[k]
+    else if (isArray) {
+      debug(isArray, data[k], val)
+      data[k] = val
+    } else data[k] = val[0]
+
+    debug("k=%s val=%j", k, val, data[k])
+  })
+}
+
+function validateString (data, k, val) {
+  data[k] = String(val)
+}
+
+function validatePath (data, k, val) {
+  if (val === true) return false
+  if (val === null) return true
+
+  val = String(val)
+
+  var isWin       = process.platform === 'win32'
+    , homePattern = isWin ? /^~(\/|\\)/ : /^~\//
+    , home        = osenv.home()
+
+  if (home && val.match(homePattern)) {
+    data[k] = path.resolve(home, val.substr(2))
+  } else {
+    data[k] = path.resolve(val)
+  }
+  return true
+}
+
+function validateNumber (data, k, val) {
+  debug("validate Number %j %j %j", k, val, isNaN(val))
+  if (isNaN(val)) return false
+  data[k] = +val
+}
+
+function validateDate (data, k, val) {
+  var s = Date.parse(val)
+  debug("validate Date %j %j %j", k, val, s)
+  if (isNaN(s)) return false
+  data[k] = new Date(val)
+}
+
+function validateBoolean (data, k, val) {
+  if (val instanceof Boolean) val = val.valueOf()
+  else if (typeof val === "string") {
+    if (!isNaN(val)) val = !!(+val)
+    else if (val === "null" || val === "false") val = false
+    else val = true
+  } else val = !!val
+  data[k] = val
+}
+
+function validateUrl (data, k, val) {
+  val = url.parse(String(val))
+  if (!val.host) return false
+  data[k] = val.href
+}
+
+function validateStream (data, k, val) {
+  if (!(val instanceof Stream)) return false
+  data[k] = val
+}
+
+function validate (data, k, val, type, typeDefs) {
+  // arrays are lists of types.
+  if (Array.isArray(type)) {
+    for (var i = 0, l = type.length; i < l; i ++) {
+      if (type[i] === Array) continue
+      if (validate(data, k, val, type[i], typeDefs)) return true
+    }
+    delete data[k]
+    return false
+  }
+
+  // an array of anything?
+  if (type === Array) return true
+
+  // NaN is poisonous.  Means that something is not allowed.
+  if (type !== type) {
+    debug("Poison NaN", k, val, type)
+    delete data[k]
+    return false
+  }
+
+  // explicit list of values
+  if (val === type) {
+    debug("Explicitly allowed %j", val)
+    // if (isArray) (data[k] = data[k] || []).push(val)
+    // else data[k] = val
+    data[k] = val
+    return true
+  }
+
+  // now go through the list of typeDefs, validate against each one.
+  var ok = false
+    , types = Object.keys(typeDefs)
+  for (var i = 0, l = types.length; i < l; i ++) {
+    debug("test type %j %j %j", k, val, types[i])
+    var t = typeDefs[types[i]]
+    if (t &&
+      ((type && type.name && t.type && t.type.name) ? (type.name === t.type.name) : (type === t.type))) {
+      var d = {}
+      ok = false !== t.validate(d, k, val)
+      val = d[k]
+      if (ok) {
+        // if (isArray) (data[k] = data[k] || []).push(val)
+        // else data[k] = val
+        data[k] = val
+        break
+      }
+    }
+  }
+  debug("OK? %j (%j %j %j)", ok, k, val, types[i])
+
+  if (!ok) delete data[k]
+  return ok
+}
+
+function parse (args, data, remain, types, shorthands) {
+  debug("parse", args, data, remain)
+
+  var key = null
+    , abbrevs = abbrev(Object.keys(types))
+    , shortAbbr = abbrev(Object.keys(shorthands))
+
+  for (var i = 0; i < args.length; i ++) {
+    var arg = args[i]
+    debug("arg", arg)
+
+    if (arg.match(/^-{2,}$/)) {
+      // done with keys.
+      // the rest are args.
+      remain.push.apply(remain, args.slice(i + 1))
+      args[i] = "--"
+      break
+    }
+    var hadEq = false
+    if (arg.charAt(0) === "-" && arg.length > 1) {
+      var at = arg.indexOf('=')
+      if (at > -1) {
+        hadEq = true
+        var v = arg.substr(at + 1)
+        arg = arg.substr(0, at)
+        args.splice(i, 1, arg, v)
+      }
+
+      // see if it's a shorthand
+      // if so, splice and back up to re-parse it.
+      var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
+      debug("arg=%j shRes=%j", arg, shRes)
+      if (shRes) {
+        debug(arg, shRes)
+        args.splice.apply(args, [i, 1].concat(shRes))
+        if (arg !== shRes[0]) {
+          i --
+          continue
+        }
+      }
+      arg = arg.replace(/^-+/, "")
+      var no = null
+      while (arg.toLowerCase().indexOf("no-") === 0) {
+        no = !no
+        arg = arg.substr(3)
+      }
+
+      if (abbrevs[arg]) arg = abbrevs[arg]
+
+      var argType = types[arg]
+      var isTypeArray = Array.isArray(argType)
+      if (isTypeArray && argType.length === 1) {
+        isTypeArray = false
+        argType = argType[0]
+      }
+
+      var isArray = argType === Array ||
+        isTypeArray && argType.indexOf(Array) !== -1
+
+      // allow unknown things to be arrays if specified multiple times.
+      if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
+        if (!Array.isArray(data[arg]))
+          data[arg] = [data[arg]]
+        isArray = true
+      }
+
+      var val
+        , la = args[i + 1]
+
+      var isBool = typeof no === 'boolean' ||
+        argType === Boolean ||
+        isTypeArray && argType.indexOf(Boolean) !== -1 ||
+        (typeof argType === 'undefined' && !hadEq) ||
+        (la === "false" &&
+         (argType === null ||
+          isTypeArray && ~argType.indexOf(null)))
+
+      if (isBool) {
+        // just set and move along
+        val = !no
+        // however, also support --bool true or --bool false
+        if (la === "true" || la === "false") {
+          val = JSON.parse(la)
+          la = null
+          if (no) val = !val
+          i ++
+        }
+
+        // also support "foo":[Boolean, "bar"] and "--foo bar"
+        if (isTypeArray && la) {
+          if (~argType.indexOf(la)) {
+            // an explicit type
+            val = la
+            i ++
+          } else if ( la === "null" && ~argType.indexOf(null) ) {
+            // null allowed
+            val = null
+            i ++
+          } else if ( !la.match(/^-{2,}[^-]/) &&
+                      !isNaN(la) &&
+                      ~argType.indexOf(Number) ) {
+            // number
+            val = +la
+            i ++
+          } else if ( !la.match(/^-[^-]/) && ~argType.indexOf(String) ) {
+            // string
+            val = la
+            i ++
+          }
+        }
+
+        if (isArray) (data[arg] = data[arg] || []).push(val)
+        else data[arg] = val
+
+        continue
+      }
+
+      if (argType === String) {
+        if (la === undefined) {
+          la = ""
+        } else if (la.match(/^-{1,2}[^-]+/)) {
+          la = ""
+          i --
+        }
+      }
+
+      if (la && la.match(/^-{2,}$/)) {
+        la = undefined
+        i --
+      }
+
+      val = la === undefined ? true : la
+      if (isArray) (data[arg] = data[arg] || []).push(val)
+      else data[arg] = val
+
+      i ++
+      continue
+    }
+    remain.push(arg)
+  }
+}
+
+function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
+  // handle single-char shorthands glommed together, like
+  // npm ls -glp, but only if there is one dash, and only if
+  // all of the chars are single-char shorthands, and it's
+  // not a match to some other abbrev.
+  arg = arg.replace(/^-+/, '')
+
+  // if it's an exact known option, then don't go any further
+  if (abbrevs[arg] === arg)
+    return null
+
+  // if it's an exact known shortopt, same deal
+  if (shorthands[arg]) {
+    // make it an array, if it's a list of words
+    if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+      shorthands[arg] = shorthands[arg].split(/\s+/)
+
+    return shorthands[arg]
+  }
+
+  // first check to see if this arg is a set of single-char shorthands
+  var singles = shorthands.___singles
+  if (!singles) {
+    singles = Object.keys(shorthands).filter(function (s) {
+      return s.length === 1
+    }).reduce(function (l,r) {
+      l[r] = true
+      return l
+    }, {})
+    shorthands.___singles = singles
+    debug('shorthand singles', singles)
+  }
+
+  var chrs = arg.split("").filter(function (c) {
+    return singles[c]
+  })
+
+  if (chrs.join("") === arg) return chrs.map(function (c) {
+    return shorthands[c]
+  }).reduce(function (l, r) {
+    return l.concat(r)
+  }, [])
+
+
+  // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
+  if (abbrevs[arg] && !shorthands[arg])
+    return null
+
+  // if it's an abbr for a shorthand, then use that
+  if (shortAbbr[arg])
+    arg = shortAbbr[arg]
+
+  // make it an array, if it's a list of words
+  if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+    shorthands[arg] = shorthands[arg].split(/\s+/)
+
+  return shorthands[arg]
+}
diff --git a/legacy-libs/grpc/node_modules/nopt/package.json b/legacy-libs/grpc/node_modules/nopt/package.json
new file mode 100644 (file)
index 0000000..2f94136
--- /dev/null
@@ -0,0 +1,65 @@
+{
+  "_args": [
+    [
+      "nopt@4.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "nopt@4.0.1",
+  "_id": "nopt@4.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
+  "_location": "/grpc/nopt",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "nopt@4.0.1",
+    "name": "nopt",
+    "escapedName": "nopt",
+    "rawSpec": "4.0.1",
+    "saveSpec": null,
+    "fetchSpec": "4.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "4.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bin": {
+    "nopt": "./bin/nopt.js"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/nopt/issues"
+  },
+  "dependencies": {
+    "abbrev": "1",
+    "osenv": "^0.1.4"
+  },
+  "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
+  "devDependencies": {
+    "tap": "^8.0.1"
+  },
+  "homepage": "https://github.com/npm/nopt#readme",
+  "license": "ISC",
+  "main": "lib/nopt.js",
+  "name": "nopt",
+  "optionalDependencies": {},
+  "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it.  The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser.  We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you hit the limit of your frustration just trying to\nmanage them all, and defer it with duct-tape solutions until you see\nexactly to the core of the problem, and finally snap and write an\nawesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system.  You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n```javascript\n// my-program.js\nvar nopt = require(\"nopt\")\n  , Stream = require(\"stream\").Stream\n  , path = require(\"path\")\n  , knownOpts = { \"foo\" : [String, null]\n                , \"bar\" : [Stream, Number]\n                , \"baz\" : path\n                , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n                , \"flag\" : Boolean\n                , \"pick\" : Boolean\n                , \"many1\" : [String, Array]\n                , \"many2\" : [path, Array]\n                }\n  , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n                 , \"b7\" : [\"--bar\", \"7\"]\n                 , \"m\" : [\"--bloo\", \"medium\"]\n                 , \"p\" : [\"--pick\"]\n                 , \"f\" : [\"--flag\"]\n                 }\n             // everything is optional.\n             // knownOpts and shorthands default to {}\n             // arg list defaults to process.argv\n             // slice defaults to 2\n  , parsed = nopt(knownOpts, shortHands, process.argv, 2)\nconsole.log(parsed)\n```\n\nThis would give you support for any of the following:\n\n```console\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array.  The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many1 5 --many1 null --many1 foo\n{ many1: [\"5\", \"null\", \"foo\"] }\n\n$ node my-program.js --many2 foo --many2 bar\n{ many2: [\"/path/to/foo\", \"path/to/bar\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string.  No parsing is done.\n* path: A file system path.  Gets resolved against cwd if not absolute.\n* url: A url.  If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n  then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`.  If an option is a boolean,\n  then it does not need a value, and its presence will imply `true` as\n  the value.  To negate boolean flags, do `--no-whatever` or `--whatever\n  false`\n* NaN: Means that the option is strictly not allowed.  Any value will\n  fail.\n* Stream: An object matching the \"Stream\" class in node.  Valuable\n  for use when validating programmatically.  (npm uses this to let you\n  supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n  will be parsed as a list of options.  This means that multiple values\n  can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values.  For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list.  For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.  When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`.  Each item in that\nhash is an object with a `type` member and a `validate` method.  The\n`type` member is an object that matches what goes in the type list.  The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`.  Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid values for\nknown options are found.  You can change this behavior by assigning a method\nto `nopt.invalidHandler`.  This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining.  If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported.  If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts.  For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you.  So they're sliced off by\ndefault.  If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/nopt.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "4.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/nopt/test/basic.js b/legacy-libs/grpc/node_modules/nopt/test/basic.js
new file mode 100644 (file)
index 0000000..5c18ac0
--- /dev/null
@@ -0,0 +1,303 @@
+var nopt = require("../")
+  , test = require('tap').test
+  , isWin = process.platform === 'win32'
+
+test("passing a string results in a string", function (t) {
+  var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0)
+  t.same(parsed.key, "myvalue")
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/31
+test("Empty String results in empty string, not true", function (t) {
+  var parsed = nopt({ empty: String }, {}, ["--empty"], 0)
+  t.same(parsed.empty, "")
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/65
+test("Empty String should not swallow next flag", function (t) {
+  var parsed = nopt({ empty: String, foo: String }, {}, ["--empty", "--foo"], 0)
+  t.same(parsed.empty, "")
+  t.same(parsed.foo, "")
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/66
+test("Empty String should not be true when type is single item Array", function (t) {
+  var parsed = nopt({  'foo': [String] }, {}, ["--foo"], 0)
+  t.same(parsed.foo, "")
+  t.end()
+})
+
+test("~ path is resolved to " + (isWin ? '%USERPROFILE%' : '$HOME'), function (t) {
+  var path = require("path")
+    , the
+
+  if (isWin) {
+    the = {
+      key: 'USERPROFILE',
+      dir: 'C:\\temp',
+      val: '~\\val'
+    }
+  } else {
+    the = {
+      key: 'HOME',
+      dir: '/tmp',
+      val: '~/val'
+    }
+  }
+  if (!process.env[the.key]) process.env[the.key] = v.dir
+  var parsed = nopt({key: path}, {}, ["--key=" + the.val], 0)
+  t.same(parsed.key, path.resolve(process.env[the.key], "val"))
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/24
+test("Unknown options are not parsed as numbers", function (t) {
+    var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0)
+    t.equal(parsed['leave-as-is'], '1.20')
+    t.equal(parsed['parse-me'], 1.2)
+    t.end()
+});
+
+// https://github.com/npm/nopt/issues/48
+test("Check types based on name of type", function (t) {
+  var parsed = nopt({"parse-me": {name: "Number"}}, null, ['--parse-me=1.20'], 0)
+  t.equal(parsed['parse-me'], 1.2)
+  t.end()
+})
+
+
+test("Missing types are not parsed", function (t) {
+  var parsed = nopt({"parse-me": {}}, null, ['--parse-me=1.20'], 0)
+  //should only contain argv
+  t.equal(Object.keys(parsed).length, 1)
+  t.end()
+})
+
+test("Types passed without a name are not parsed", function (t) {
+  var parsed = nopt({"parse-me": {}}, {}, ['--parse-me=1.20'], 0)
+  //should only contain argv
+  t.equal(Object.keys(parsed).length, 1)
+  t.end()
+})
+
+test("other tests", function (t) {
+
+  var util = require("util")
+    , Stream = require("stream")
+    , path = require("path")
+    , url = require("url")
+
+    , shorthands =
+      { s : ["--loglevel", "silent"]
+      , d : ["--loglevel", "info"]
+      , dd : ["--loglevel", "verbose"]
+      , ddd : ["--loglevel", "silly"]
+      , noreg : ["--no-registry"]
+      , reg : ["--registry"]
+      , "no-reg" : ["--no-registry"]
+      , silent : ["--loglevel", "silent"]
+      , verbose : ["--loglevel", "verbose"]
+      , h : ["--usage"]
+      , H : ["--usage"]
+      , "?" : ["--usage"]
+      , help : ["--usage"]
+      , v : ["--version"]
+      , f : ["--force"]
+      , desc : ["--description"]
+      , "no-desc" : ["--no-description"]
+      , "local" : ["--no-global"]
+      , l : ["--long"]
+      , p : ["--parseable"]
+      , porcelain : ["--parseable"]
+      , g : ["--global"]
+      }
+
+    , types =
+      { aoa: Array
+      , nullstream: [null, Stream]
+      , date: Date
+      , str: String
+      , browser : String
+      , cache : path
+      , color : ["always", Boolean]
+      , depth : Number
+      , description : Boolean
+      , dev : Boolean
+      , editor : path
+      , force : Boolean
+      , global : Boolean
+      , globalconfig : path
+      , group : [String, Number]
+      , gzipbin : String
+      , logfd : [Number, Stream]
+      , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+      , long : Boolean
+      , "node-version" : [false, String]
+      , npaturl : url
+      , npat : Boolean
+      , "onload-script" : [false, String]
+      , outfd : [Number, Stream]
+      , parseable : Boolean
+      , pre: Boolean
+      , prefix: path
+      , proxy : url
+      , "rebuild-bundle" : Boolean
+      , registry : url
+      , searchopts : String
+      , searchexclude: [null, String]
+      , shell : path
+      , t: [Array, String]
+      , tag : String
+      , tar : String
+      , tmp : path
+      , "unsafe-perm" : Boolean
+      , usage : Boolean
+      , user : String
+      , username : String
+      , userconfig : path
+      , version : Boolean
+      , viewer: path
+      , _exit : Boolean
+      , path: path
+      }
+
+  ; [["-v", {version:true}, []]
+    ,["---v", {version:true}, []]
+    ,["ls -s --no-reg connect -d",
+      {loglevel:"info",registry:null},["ls","connect"]]
+    ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+    ,["ls --registry blargle", {}, ["ls"]]
+    ,["--no-registry", {registry:null}, []]
+    ,["--no-color true", {color:false}, []]
+    ,["--no-color false", {color:true}, []]
+    ,["--no-color", {color:false}, []]
+    ,["--color false", {color:false}, []]
+    ,["--color --logfd 7", {logfd:7,color:true}, []]
+    ,["--color=true", {color:true}, []]
+    ,["--logfd=10", {logfd:10}, []]
+    ,["--tmp=/tmp -tar=gtar", {tmp: isWin ? "C:\\tmp" : "/tmp",tar:"gtar"},[]]
+    ,["--tmp=tmp -tar=gtar",
+      {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+    ,["--logfd x", {}, []]
+    ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+    ,["a -no-false", {false:false},["a"]]
+    ,["a -no-no-true", {true:true}, ["a"]]
+    ,["a -no-no-no-false", {false:false}, ["a"]]
+    ,["---NO-no-No-no-no-no-nO-no-no"+
+      "-No-no-no-no-no-no-no-no-no"+
+      "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+      "-no-body-can-do-the-boogaloo-like-I-do"
+     ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+    ,["we are -no-strangers-to-love "+
+      "--you-know=the-rules --and=so-do-i "+
+      "---im-thinking-of=a-full-commitment "+
+      "--no-you-would-get-this-from-any-other-guy "+
+      "--no-gonna-give-you-up "+
+      "-no-gonna-let-you-down=true "+
+      "--no-no-gonna-run-around false "+
+      "--desert-you=false "+
+      "--make-you-cry false "+
+      "--no-tell-a-lie "+
+      "--no-no-and-hurt-you false"
+     ,{"strangers-to-love":false
+      ,"you-know":"the-rules"
+      ,"and":"so-do-i"
+      ,"you-would-get-this-from-any-other-guy":false
+      ,"gonna-give-you-up":false
+      ,"gonna-let-you-down":false
+      ,"gonna-run-around":false
+      ,"desert-you":false
+      ,"make-you-cry":false
+      ,"tell-a-lie":false
+      ,"and-hurt-you":false
+      },["we", "are"]]
+    ,["-t one -t two -t three"
+     ,{t: ["one", "two", "three"]}
+     ,[]]
+    ,["-t one -t null -t three four five null"
+     ,{t: ["one", "null", "three"]}
+     ,["four", "five", "null"]]
+    ,["-t foo"
+     ,{t:["foo"]}
+     ,[]]
+    ,["--no-t"
+     ,{t:["false"]}
+     ,[]]
+    ,["-no-no-t"
+     ,{t:["true"]}
+     ,[]]
+    ,["-aoa one -aoa null -aoa 100"
+     ,{aoa:["one", null, '100']}
+     ,[]]
+    ,["-str 100"
+     ,{str:"100"}
+     ,[]]
+    ,["--color always"
+     ,{color:"always"}
+     ,[]]
+    ,["--no-nullstream"
+     ,{nullstream:null}
+     ,[]]
+    ,["--nullstream false"
+     ,{nullstream:null}
+     ,[]]
+    ,["--notadate=2011-01-25"
+     ,{notadate: "2011-01-25"}
+     ,[]]
+    ,["--date 2011-01-25"
+     ,{date: new Date("2011-01-25")}
+     ,[]]
+    ,["-cl 1"
+     ,{config: true, length: 1}
+     ,[]
+     ,{config: Boolean, length: Number, clear: Boolean}
+     ,{c: "--config", l: "--length"}]
+    ,["--acount bla"
+     ,{"acount":true}
+     ,["bla"]
+     ,{account: Boolean, credentials: Boolean, options: String}
+     ,{a:"--account", c:"--credentials",o:"--options"}]
+    ,["--clear"
+     ,{clear:true}
+     ,[]
+     ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
+     ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
+    ,["--file -"
+     ,{"file":"-"}
+     ,[]
+     ,{file:String}
+     ,{}]
+    ,["--file -"
+     ,{"file":true}
+     ,["-"]
+     ,{file:Boolean}
+     ,{}]
+    ,["--path"
+     ,{"path":null}
+     ,[]]
+    ,["--path ."
+     ,{"path":process.cwd()}
+     ,[]]
+    ].forEach(function (test) {
+      var argv = test[0].split(/\s+/)
+        , opts = test[1]
+        , rem = test[2]
+        , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
+        , parsed = actual.argv
+      delete actual.argv
+      for (var i in opts) {
+        var e = JSON.stringify(opts[i])
+          , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+        if (e && typeof e === "object") {
+          t.deepEqual(e, a)
+        } else {
+          t.equal(e, a)
+        }
+      }
+      t.deepEqual(rem, parsed.remain)
+    })
+  t.end()
+})
diff --git a/legacy-libs/grpc/node_modules/npm-bundled/LICENSE b/legacy-libs/grpc/node_modules/npm-bundled/LICENSE
new file mode 100644 (file)
index 0000000..20a4762
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) npm, Inc. and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/npm-bundled/README.md b/legacy-libs/grpc/node_modules/npm-bundled/README.md
new file mode 100644 (file)
index 0000000..fcfb232
--- /dev/null
@@ -0,0 +1,48 @@
+# npm-bundled
+
+Run this in a node package, and it'll tell you which things in
+node_modules are bundledDependencies, or transitive dependencies of
+bundled dependencies.
+
+[![Build Status](https://travis-ci.org/npm/npm-bundled.svg?branch=master)](https://travis-ci.org/npm/npm-bundled)
+
+## USAGE
+
+To get the list of deps at the top level that are bundled (or
+transitive deps of a bundled dep) run this:
+
+```js
+const bundled = require('npm-bundled')
+
+// async version
+bundled({ path: '/path/to/pkg/defaults/to/cwd'}, (er, list) => {
+  // er means it had an error, which is _hella_ weird
+  // list is a list of package names, like `fooblz` or `@corp/blerg`
+  // the might not all be deps of the top level, because transitives
+})
+
+// async promise version
+bundled({ path: '/path/to/pkg/defaults/to/cwd'}).then(list => {
+  // so promisey!
+  // actually the callback version returns a promise, too, it just
+  // attaches the supplied callback to the promise
+})
+
+// sync version, throws if there's an error
+const list = bundled({ path: '/path/to/pkg/defaults/to/cwd'})
+```
+
+That's basically all you need to know.  If you care to dig into it,
+you can also use the `bundled.Walker` and `bundled.WalkerSync`
+classes to get fancy.
+
+This library does not write anything to the filesystem, but it _may_
+have undefined behavior if the structure of `node_modules` changes
+while it's reading deps.
+
+All symlinks are followed.  This means that it can lead to surprising
+results if a symlinked bundled dependency has a missing dependency
+that is satisfied at the top level.  Since package creation resolves
+symlinks as well, this is an edge case where package creation and
+development environment are not going to be aligned, and is best
+avoided.
diff --git a/legacy-libs/grpc/node_modules/npm-bundled/index.js b/legacy-libs/grpc/node_modules/npm-bundled/index.js
new file mode 100644 (file)
index 0000000..bde0acd
--- /dev/null
@@ -0,0 +1,241 @@
+'use strict'
+
+// walk the tree of deps starting from the top level list of bundled deps
+// Any deps at the top level that are depended on by a bundled dep that
+// does not have that dep in its own node_modules folder are considered
+// bundled deps as well.  This list of names can be passed to npm-packlist
+// as the "bundled" argument.  Additionally, packageJsonCache is shared so
+// packlist doesn't have to re-read files already consumed in this pass
+
+const fs = require('fs')
+const path = require('path')
+const EE = require('events').EventEmitter
+
+class BundleWalker extends EE {
+  constructor (opt) {
+    opt = opt || {}
+    super(opt)
+    this.path = path.resolve(opt.path || process.cwd())
+
+    this.parent = opt.parent || null
+    if (this.parent) {
+      this.result = this.parent.result
+      // only collect results in node_modules folders at the top level
+      // since the node_modules in a bundled dep is included always
+      if (!this.parent.parent) {
+        const base = path.basename(this.path)
+        const scope = path.basename(path.dirname(this.path))
+        this.result.add(/^@/.test(scope) ? scope + '/' + base : base)
+      }
+      this.root = this.parent.root
+      this.packageJsonCache = this.parent.packageJsonCache
+    } else {
+      this.result = new Set()
+      this.root = this.path
+      this.packageJsonCache = opt.packageJsonCache || new Map()
+    }
+
+    this.seen = new Set()
+    this.didDone = false
+    this.children = 0
+    this.node_modules = []
+    this.package = null
+    this.bundle = null
+  }
+
+  addListener (ev, fn) {
+    return this.on(ev, fn)
+  }
+
+  on (ev, fn) {
+    const ret = super.on(ev, fn)
+    if (ev === 'done' && this.didDone) {
+      this.emit('done', this.result)
+    }
+    return ret
+  }
+
+  done () {
+    if (!this.didDone) {
+      this.didDone = true
+      if (!this.parent) {
+        const res = Array.from(this.result)
+        this.result = res
+        this.emit('done', res)
+      } else {
+        this.emit('done')
+      }
+    }
+  }
+
+  start () {
+    const pj = path.resolve(this.path, 'package.json')
+    if (this.packageJsonCache.has(pj))
+      this.onPackage(this.packageJsonCache.get(pj))
+    else
+      this.readPackageJson(pj)
+    return this
+  }
+
+  readPackageJson (pj) {
+    fs.readFile(pj, (er, data) =>
+      er ? this.done() : this.onPackageJson(pj, data))
+  }
+
+  onPackageJson (pj, data) {
+    try {
+      this.package = JSON.parse(data + '')
+    } catch (er) {
+      return this.done()
+    }
+    this.packageJsonCache.set(pj, this.package)
+    this.onPackage(this.package)
+  }
+
+  onPackage (pkg) {
+    // all deps are bundled if we got here as a child.
+    // otherwise, only bundle bundledDeps
+    // Get a unique-ified array with a short-lived Set
+    const bdRaw = this.parent
+      ? Object.keys(pkg.dependencies || {}).concat(
+        Object.keys(pkg.optionalDependencies || {}))
+      : pkg.bundleDependencies || pkg.bundledDependencies || []
+
+    const bd = Array.from(new Set(
+      Array.isArray(bdRaw) ? bdRaw : Object.keys(bdRaw)))
+
+    if (!bd.length)
+      return this.done()
+
+    this.bundle = bd
+    const nm = this.path + '/node_modules'
+    this.readModules()
+  }
+
+  readModules () {
+    readdirNodeModules(this.path + '/node_modules', (er, nm) =>
+      er ? this.onReaddir([]) : this.onReaddir(nm))
+  }
+
+  onReaddir (nm) {
+    // keep track of what we have, in case children need it
+    this.node_modules = nm
+
+    this.bundle.forEach(dep => this.childDep(dep))
+    if (this.children === 0)
+      this.done()
+  }
+
+  childDep (dep) {
+    if (this.node_modules.indexOf(dep) !== -1 && !this.seen.has(dep)) {
+      this.seen.add(dep)
+      this.child(dep)
+    } else if (this.parent) {
+      this.parent.childDep(dep)
+    }
+  }
+
+  child (dep) {
+    const p = this.path + '/node_modules/' + dep
+    this.children += 1
+    const child = new BundleWalker({
+      path: p,
+      parent: this
+    })
+    child.on('done', _ => {
+      if (--this.children === 0)
+        this.done()
+    })
+    child.start()
+  }
+}
+
+class BundleWalkerSync extends BundleWalker {
+  constructor (opt) {
+    super(opt)
+  }
+
+  start () {
+    super.start()
+    this.done()
+    return this
+  }
+
+  readPackageJson (pj) {
+    try {
+      this.onPackageJson(pj, fs.readFileSync(pj))
+    } catch (er) {}
+    return this
+  }
+
+  readModules () {
+    try {
+      this.onReaddir(readdirNodeModulesSync(this.path + '/node_modules'))
+    } catch (er) {
+      this.onReaddir([])
+    }
+  }
+
+  child (dep) {
+    new BundleWalkerSync({
+      path: this.path + '/node_modules/' + dep,
+      parent: this
+    }).start()
+  }
+}
+
+const readdirNodeModules = (nm, cb) => {
+  fs.readdir(nm, (er, set) => {
+    if (er)
+      cb(er)
+    else {
+      const scopes = set.filter(f => /^@/.test(f))
+      if (!scopes.length)
+        cb(null, set)
+      else {
+        const unscoped = set.filter(f => !/^@/.test(f))
+        let count = scopes.length
+        scopes.forEach(scope => {
+          fs.readdir(nm + '/' + scope, (er, pkgs) => {
+            if (er || !pkgs.length)
+              unscoped.push(scope)
+            else
+              unscoped.push.apply(unscoped, pkgs.map(p => scope + '/' + p))
+            if (--count === 0)
+              cb(null, unscoped)
+          })
+        })
+      }
+    }
+  })
+}
+
+const readdirNodeModulesSync = nm => {
+  const set = fs.readdirSync(nm)
+  const unscoped = set.filter(f => !/^@/.test(f))
+  const scopes = set.filter(f => /^@/.test(f)).map(scope => {
+    try {
+      const pkgs = fs.readdirSync(nm + '/' + scope)
+      return pkgs.length ? pkgs.map(p => scope + '/' + p) : [scope]
+    } catch (er) {
+      return [scope]
+    }
+  }).reduce((a, b) => a.concat(b), [])
+  return unscoped.concat(scopes)
+}
+
+const walk = (options, callback) => {
+  const p = new Promise((resolve, reject) => {
+    new BundleWalker(options).on('done', resolve).on('error', reject).start()
+  })
+  return callback ? p.then(res => callback(null, res), callback) : p
+}
+
+const walkSync = options => {
+  return new BundleWalkerSync(options).start().result
+}
+
+module.exports = walk
+walk.sync = walkSync
+walk.BundleWalker = BundleWalker
+walk.BundleWalkerSync = BundleWalkerSync
diff --git a/legacy-libs/grpc/node_modules/npm-bundled/package.json b/legacy-libs/grpc/node_modules/npm-bundled/package.json
new file mode 100644 (file)
index 0000000..89e5388
--- /dev/null
@@ -0,0 +1,65 @@
+{
+  "_from": "npm-bundled@^1.0.1",
+  "_id": "npm-bundled@1.0.6",
+  "_inBundle": false,
+  "_integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
+  "_location": "/grpc/npm-bundled",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "npm-bundled@^1.0.1",
+    "name": "npm-bundled",
+    "escapedName": "npm-bundled",
+    "rawSpec": "^1.0.1",
+    "saveSpec": null,
+    "fetchSpec": "^1.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/npm-packlist"
+  ],
+  "_resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz",
+  "_shasum": "e7ba9aadcef962bb61248f91721cd932b3fe6bdd",
+  "_shrinkwrap": null,
+  "_spec": "npm-bundled@^1.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/npm-packlist",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/npm-bundled/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "mutate-fs": "^1.1.0",
+    "rimraf": "^2.6.1",
+    "tap": "^12.0.1"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/npm/npm-bundled#readme",
+  "license": "ISC",
+  "main": "index.js",
+  "name": "npm-bundled",
+  "optionalDependencies": {},
+  "readme": "# npm-bundled\n\nRun this in a node package, and it'll tell you which things in\nnode_modules are bundledDependencies, or transitive dependencies of\nbundled dependencies.\n\n[![Build Status](https://travis-ci.org/npm/npm-bundled.svg?branch=master)](https://travis-ci.org/npm/npm-bundled)\n\n## USAGE\n\nTo get the list of deps at the top level that are bundled (or\ntransitive deps of a bundled dep) run this:\n\n```js\nconst bundled = require('npm-bundled')\n\n// async version\nbundled({ path: '/path/to/pkg/defaults/to/cwd'}, (er, list) => {\n  // er means it had an error, which is _hella_ weird\n  // list is a list of package names, like `fooblz` or `@corp/blerg`\n  // the might not all be deps of the top level, because transitives\n})\n\n// async promise version\nbundled({ path: '/path/to/pkg/defaults/to/cwd'}).then(list => {\n  // so promisey!\n  // actually the callback version returns a promise, too, it just\n  // attaches the supplied callback to the promise\n})\n\n// sync version, throws if there's an error\nconst list = bundled({ path: '/path/to/pkg/defaults/to/cwd'})\n```\n\nThat's basically all you need to know.  If you care to dig into it,\nyou can also use the `bundled.Walker` and `bundled.WalkerSync`\nclasses to get fancy.\n\nThis library does not write anything to the filesystem, but it _may_\nhave undefined behavior if the structure of `node_modules` changes\nwhile it's reading deps.\n\nAll symlinks are followed.  This means that it can lead to surprising\nresults if a symlinked bundled dependency has a missing dependency\nthat is satisfied at the top level.  Since package creation resolves\nsymlinks as well, this is an edge case where package creation and\ndevelopment environment are not going to be aligned, and is best\navoided.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/npm-bundled.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js -J --100"
+  },
+  "version": "1.0.6"
+}
diff --git a/legacy-libs/grpc/node_modules/npm-packlist/LICENSE b/legacy-libs/grpc/node_modules/npm-packlist/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/npm-packlist/README.md b/legacy-libs/grpc/node_modules/npm-packlist/README.md
new file mode 100644 (file)
index 0000000..ead5821
--- /dev/null
@@ -0,0 +1,68 @@
+# npm-packlist
+
+[![Build Status](https://travis-ci.com/npm/npm-packlist.svg?token=hHeDp9pQmz9kvsgRNVHy&branch=master)](https://travis-ci.com/npm/npm-packlist)
+
+Get a list of the files to add from a folder into an npm package
+
+These can be handed to [tar](http://npm.im/tar) like so to make an npm
+package tarball:
+
+```js
+const packlist = require('npm-packlist')
+const tar = require('tar')
+const packageDir = '/path/to/package'
+const packageTarball = '/path/to/package.tgz'
+
+packlist({ path: packageDir })
+  .then(files => tar.create({
+    prefix: 'package/',
+    cwd: packageDir,
+    file: packageTarball,
+    gzip: true
+  }, files))
+  .then(_ => {
+    // tarball has been created, continue with your day
+  })
+```
+
+This uses the following rules:
+
+1. If a `package.json` file is found, and it has a `files` list,
+   then ignore everything that isn't in `files`.  Always include the
+   readme, license, notice, changes, changelog, and history files, if
+   they exist, and the package.json file itself.
+2. If there's no `package.json` file (or it has no `files` list), and
+   there is a `.npmignore` file, then ignore all the files in the
+   `.npmignore` file.
+3. If there's no `package.json` with a `files` list, and there's no
+   `.npmignore` file, but there is a `.gitignore` file, then ignore
+   all the files in the `.gitignore` file.
+4. Everything in the root `node_modules` is ignored, unless it's a
+   bundled dependency.  If it IS a bundled dependency, and it's a
+   symbolic link, then the target of the link is included, not the
+   symlink itself.
+4. Unless they're explicitly included (by being in a `files` list, or
+   a `!negated` rule in a relevant `.npmignore` or `.gitignore`),
+   always ignore certain common cruft files:
+
+    1. .npmignore and .gitignore files (their effect is in the package
+       already, there's no need to include them in the package)
+    2. editor junk like `.*.swp`, `._*` and `.*.orig` files
+    3. `.npmrc` files (these may contain private configs)
+    4. The `node_modules/.bin` folder
+    5. Waf and gyp cruft like `/build/config.gypi` and `.lock-wscript`
+    6. Darwin's `.DS_Store` files because wtf are those even
+    7. `npm-debug.log` files at the root of a project
+
+    You can explicitly re-include any of these with a `files` list in
+    `package.json` or a negated ignore file rule.
+
+## API
+
+Same API as [ignore-walk](http://npm.im/ignore-walk), just hard-coded
+file list and rule sets.
+
+The `Walker` and `WalkerSync` classes take a `bundled` argument, which
+is a list of package names to include from node_modules.  When calling
+the top-level `packlist()` and `packlist.sync()` functions, this
+module calls into `npm-bundled` directly.
diff --git a/legacy-libs/grpc/node_modules/npm-packlist/index.js b/legacy-libs/grpc/node_modules/npm-packlist/index.js
new file mode 100644 (file)
index 0000000..777b585
--- /dev/null
@@ -0,0 +1,250 @@
+'use strict'
+
+// Do a two-pass walk, first to get the list of packages that need to be
+// bundled, then again to get the actual files and folders.
+// Keep a cache of node_modules content and package.json data, so that the
+// second walk doesn't have to re-do all the same work.
+
+const bundleWalk = require('npm-bundled')
+const BundleWalker = bundleWalk.BundleWalker
+const BundleWalkerSync = bundleWalk.BundleWalkerSync
+
+const ignoreWalk = require('ignore-walk')
+const IgnoreWalker = ignoreWalk.Walker
+const IgnoreWalkerSync = ignoreWalk.WalkerSync
+
+const rootBuiltinRules = Symbol('root-builtin-rules')
+const packageNecessaryRules = Symbol('package-necessary-rules')
+const path = require('path')
+
+const defaultRules = [
+  '.npmignore',
+  '.gitignore',
+  '**/.git',
+  '**/.svn',
+  '**/.hg',
+  '**/CVS',
+  '**/.git/**',
+  '**/.svn/**',
+  '**/.hg/**',
+  '**/CVS/**',
+  '/.lock-wscript',
+  '/.wafpickle-*',
+  '/build/config.gypi',
+  'npm-debug.log',
+  '**/.npmrc',
+  '.*.swp',
+  '**/.DS_Store/**',
+  '._*',
+  '**/._*/**',
+  '*.orig',
+  '/package-lock.json',
+  '/yarn.lock',
+  'archived-packages/**',
+  'core',
+  '!core/',
+  '!**/core/',
+  '*.core',
+  '*.vgcore',
+  'vgcore.*',
+  'core.+([0-9])',
+]
+
+// a decorator that applies our custom rules to an ignore walker
+const npmWalker = Class => class Walker extends Class {
+  constructor (opt) {
+    opt = opt || {}
+
+    // the order in which rules are applied.
+    opt.ignoreFiles = [
+      rootBuiltinRules,
+      'package.json',
+      '.npmignore',
+      '.gitignore',
+      packageNecessaryRules
+    ]
+
+    opt.includeEmpty = false
+    opt.path = opt.path || process.cwd()
+    const dirName = path.basename(opt.path)
+    const parentName = path.basename(path.dirname(opt.path))
+    opt.follow =
+      dirName === 'node_modules' ||
+      (parentName === 'node_modules' && /^@/.test(dirName))
+    super(opt)
+
+    // ignore a bunch of things by default at the root level.
+    // also ignore anything in node_modules, except bundled dependencies
+    if (!this.parent) {
+      this.bundled = opt.bundled || []
+      this.bundledScopes = Array.from(new Set(
+        this.bundled.filter(f => /^@/.test(f))
+        .map(f => f.split('/')[0])))
+      const rules = defaultRules.join('\n') + '\n'
+      this.packageJsonCache = opt.packageJsonCache || new Map()
+      super.onReadIgnoreFile(rootBuiltinRules, rules, _=>_)
+    } else {
+      this.bundled = []
+      this.bundledScopes = []
+      this.packageJsonCache = this.parent.packageJsonCache
+    }
+  }
+
+  filterEntry (entry, partial) {
+    // get the partial path from the root of the walk
+    const p = this.path.substr(this.root.length + 1)
+    const pkgre = /^node_modules\/(@[^\/]+\/?[^\/]+|[^\/]+)(\/.*)?$/
+    const isRoot = !this.parent
+    const pkg = isRoot && pkgre.test(entry) ?
+      entry.replace(pkgre, '$1') : null
+    const rootNM = isRoot && entry === 'node_modules'
+    const rootPJ = isRoot && entry === 'package.json'
+
+    return (
+      // if we're in a bundled package, check with the parent.
+      /^node_modules($|\/)/i.test(p) ? this.parent.filterEntry(
+          this.basename + '/' + entry, partial)
+
+      // if package is bundled, all files included
+      // also include @scope dirs for bundled scoped deps
+      // they'll be ignored if no files end up in them.
+      // However, this only matters if we're in the root.
+      // node_modules folders elsewhere, like lib/node_modules,
+      // should be included normally unless ignored.
+      : pkg ? -1 !== this.bundled.indexOf(pkg) ||
+        -1 !== this.bundledScopes.indexOf(pkg)
+
+      // only walk top node_modules if we want to bundle something
+      : rootNM ? !!this.bundled.length
+
+      // always include package.json at the root.
+      : rootPJ ? true
+
+      // otherwise, follow ignore-walk's logic
+      : super.filterEntry(entry, partial)
+    )
+  }
+
+  filterEntries () {
+    if (this.ignoreRules['package.json'])
+      this.ignoreRules['.gitignore'] = this.ignoreRules['.npmignore'] = null
+    else if (this.ignoreRules['.npmignore'])
+      this.ignoreRules['.gitignore'] = null
+    this.filterEntries = super.filterEntries
+    super.filterEntries()
+  }
+
+  addIgnoreFile (file, then) {
+    const ig = path.resolve(this.path, file)
+    if (this.packageJsonCache.has(ig))
+      this.onPackageJson(ig, this.packageJsonCache.get(ig), then)
+    else
+      super.addIgnoreFile(file, then)
+  }
+
+  onPackageJson (ig, pkg, then) {
+    this.packageJsonCache.set(ig, pkg)
+
+    // if there's a bin, browser or main, make sure we don't ignore it
+    // also, don't ignore the package.json itself!
+    const rules = [
+      pkg.browser ? '!' + pkg.browser : '',
+      pkg.main ? '!' + pkg.main : '',
+      '!package.json',
+      '!@(readme|copying|license|licence|notice|changes|changelog|history){,.*[^~$]}'
+    ]
+    if (pkg.bin)
+      if (typeof pkg.bin === "object")
+        for (const key in pkg.bin)
+          rules.push('!' + pkg.bin[key])
+      else
+        rules.push('!' + pkg.bin)
+
+    const data = rules.filter(f => f).join('\n') + '\n'
+    super.onReadIgnoreFile(packageNecessaryRules, data, _=>_)
+
+    if (Array.isArray(pkg.files))
+      super.onReadIgnoreFile('package.json', '*\n' + pkg.files.map(
+        f => '!' + f + '\n!' + f.replace(/\/+$/, '') + '/**'
+      ).join('\n') + '\n', then)
+    else
+      then()
+  }
+
+  // override parent onstat function to nix all symlinks
+  onstat (st, entry, file, dir, then) {
+    if (st.isSymbolicLink())
+      then()
+    else
+      super.onstat(st, entry, file, dir, then)
+  }
+
+  onReadIgnoreFile (file, data, then) {
+    if (file === 'package.json')
+      try {
+        const ig = path.resolve(this.path, file)
+        this.onPackageJson(ig, JSON.parse(data), then)
+      } catch (er) {
+        // ignore package.json files that are not json
+        then()
+      }
+    else
+      super.onReadIgnoreFile(file, data, then)
+  }
+
+  sort (a, b) {
+    return sort(a, b)
+  }
+}
+
+class Walker extends npmWalker(IgnoreWalker) {
+  walker (entry, then) {
+    new Walker(this.walkerOpt(entry)).on('done', then).start()
+  }
+}
+
+class WalkerSync extends npmWalker(IgnoreWalkerSync) {
+  walker (entry, then) {
+    new WalkerSync(this.walkerOpt(entry)).start()
+    then()
+  }
+}
+
+const walk = (options, callback) => {
+  options = options || {}
+  const p = new Promise((resolve, reject) => {
+    const bw = new BundleWalker(options)
+    bw.on('done', bundled => {
+      options.bundled = bundled
+      options.packageJsonCache = bw.packageJsonCache
+      new Walker(options).on('done', resolve).on('error', reject).start()
+    })
+    bw.start()
+  })
+  return callback ? p.then(res => callback(null, res), callback) : p
+}
+
+const walkSync = options => {
+  options = options || {}
+  const bw = new BundleWalkerSync(options).start()
+  options.bundled = bw.result
+  options.packageJsonCache = bw.packageJsonCache
+  const walker = new WalkerSync(options)
+  walker.start()
+  return walker.result
+}
+
+// package.json first, node_modules last, files before folders, alphasort
+const sort = (a, b) =>
+  a === 'package.json' ? -1
+  : b === 'package.json' ? 1
+  : /^node_modules/.test(a) && !/^node_modules/.test(b) ? 1
+  : /^node_modules/.test(b) && !/^node_modules/.test(a) ? -1
+  : path.dirname(a) === '.' && path.dirname(b) !== '.' ? -1
+  : path.dirname(b) === '.' && path.dirname(a) !== '.' ? 1
+  : a.localeCompare(b)
+
+module.exports = walk
+walk.sync = walkSync
+walk.Walker = Walker
+walk.WalkerSync = WalkerSync
diff --git a/legacy-libs/grpc/node_modules/npm-packlist/package.json b/legacy-libs/grpc/node_modules/npm-packlist/package.json
new file mode 100644 (file)
index 0000000..7304578
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "_from": "npm-packlist@^1.1.6",
+  "_id": "npm-packlist@1.4.1",
+  "_inBundle": false,
+  "_integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
+  "_location": "/grpc/npm-packlist",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "npm-packlist@^1.1.6",
+    "name": "npm-packlist",
+    "escapedName": "npm-packlist",
+    "rawSpec": "^1.1.6",
+    "saveSpec": null,
+    "fetchSpec": "^1.1.6"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz",
+  "_shasum": "19064cdf988da80ea3cee45533879d90192bbfbc",
+  "_shrinkwrap": null,
+  "_spec": "npm-packlist@^1.1.6",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/node-pre-gyp",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/npm-packlist/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "ignore-walk": "^3.0.1",
+    "npm-bundled": "^1.0.1"
+  },
+  "deprecated": false,
+  "description": "Get a list of the files to add from a folder into an npm package",
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "rimraf": "^2.6.1",
+    "tap": "^12.0.1"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://www.npmjs.com/package/npm-packlist",
+  "license": "ISC",
+  "main": "index.js",
+  "name": "npm-packlist",
+  "optionalDependencies": {},
+  "readme": "# npm-packlist\n\n[![Build Status](https://travis-ci.com/npm/npm-packlist.svg?token=hHeDp9pQmz9kvsgRNVHy&branch=master)](https://travis-ci.com/npm/npm-packlist)\n\nGet a list of the files to add from a folder into an npm package\n\nThese can be handed to [tar](http://npm.im/tar) like so to make an npm\npackage tarball:\n\n```js\nconst packlist = require('npm-packlist')\nconst tar = require('tar')\nconst packageDir = '/path/to/package'\nconst packageTarball = '/path/to/package.tgz'\n\npacklist({ path: packageDir })\n  .then(files => tar.create({\n    prefix: 'package/',\n    cwd: packageDir,\n    file: packageTarball,\n    gzip: true\n  }, files))\n  .then(_ => {\n    // tarball has been created, continue with your day\n  })\n```\n\nThis uses the following rules:\n\n1. If a `package.json` file is found, and it has a `files` list,\n   then ignore everything that isn't in `files`.  Always include the\n   readme, license, notice, changes, changelog, and history files, if\n   they exist, and the package.json file itself.\n2. If there's no `package.json` file (or it has no `files` list), and\n   there is a `.npmignore` file, then ignore all the files in the\n   `.npmignore` file.\n3. If there's no `package.json` with a `files` list, and there's no\n   `.npmignore` file, but there is a `.gitignore` file, then ignore\n   all the files in the `.gitignore` file.\n4. Everything in the root `node_modules` is ignored, unless it's a\n   bundled dependency.  If it IS a bundled dependency, and it's a\n   symbolic link, then the target of the link is included, not the\n   symlink itself.\n4. Unless they're explicitly included (by being in a `files` list, or\n   a `!negated` rule in a relevant `.npmignore` or `.gitignore`),\n   always ignore certain common cruft files:\n\n    1. .npmignore and .gitignore files (their effect is in the package\n       already, there's no need to include them in the package)\n    2. editor junk like `.*.swp`, `._*` and `.*.orig` files\n    3. `.npmrc` files (these may contain private configs)\n    4. The `node_modules/.bin` folder\n    5. Waf and gyp cruft like `/build/config.gypi` and `.lock-wscript`\n    6. Darwin's `.DS_Store` files because wtf are those even\n    7. `npm-debug.log` files at the root of a project\n\n    You can explicitly re-include any of these with a `files` list in\n    `package.json` or a negated ignore file rule.\n\n## API\n\nSame API as [ignore-walk](http://npm.im/ignore-walk), just hard-coded\nfile list and rule sets.\n\nThe `Walker` and `WalkerSync` classes take a `bundled` argument, which\nis a list of package names to include from node_modules.  When calling\nthe top-level `packlist()` and `packlist.sync()` functions, this\nmodule calls into `npm-bundled` directly.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/npm-packlist.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --100 -J"
+  },
+  "version": "1.4.1"
+}
diff --git a/legacy-libs/grpc/node_modules/npmlog/CHANGELOG.md b/legacy-libs/grpc/node_modules/npmlog/CHANGELOG.md
new file mode 100644 (file)
index 0000000..51e4abc
--- /dev/null
@@ -0,0 +1,49 @@
+### v4.0.2
+
+* Added installation instructions.
+
+### v4.0.1
+
+* Fix bugs where `log.progressEnabled` got out of sync with how `gauge` kept
+  track of these things resulting in a progressbar that couldn't be disabled.
+
+### v4.0.0
+
+* Allow creating log levels that are an empty string or 0.
+
+### v3.1.2
+
+* Update to `gauge@1.6.0` adding support for default values for template
+  items.
+
+### v3.1.1
+
+* Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to
+  when a progress bar is enabled.  In `1.x` if you didn't have a TTY the
+  progress bar was never shown.  In `2.x` it merely defaults to disabled,
+  but you can enable it explicitly if you still want progress updates.
+
+### v3.1.0
+
+* Update to `gauge@2.5.2`:
+  * Updates the `signal-exit` dependency which fixes an incompatibility with
+    the node profiler.
+  * Uses externalizes its ansi code generation in `console-control-strings`
+* Make the default progress bar include the last line printed, colored as it
+  would be when printing to a tty.
+
+### v3.0.0
+
+* Switch to `gauge@2.0.0`, for better performance, better look.
+* Set stderr/stdout blocking if they're tty's, so that we can hide a
+  progress bar going to stderr and then safely print to stdout.  Without
+  this the two can end up overlapping producing confusing and sometimes
+  corrupted output.
+
+### v2.0.0
+
+* Make the `error` event non-fatal so that folks can use it as a prefix.
+
+### v1.0.0
+
+* Add progress bar with `gauge@1.1.0`
diff --git a/legacy-libs/grpc/node_modules/npmlog/LICENSE b/legacy-libs/grpc/node_modules/npmlog/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/npmlog/README.md b/legacy-libs/grpc/node_modules/npmlog/README.md
new file mode 100644 (file)
index 0000000..268a4af
--- /dev/null
@@ -0,0 +1,216 @@
+# npmlog
+
+The logger util that npm uses.
+
+This logger is very basic.  It does the logging for npm.  It supports
+custom levels and colored output.
+
+By default, logs are written to stderr.  If you want to send log messages
+to outputs other than streams, then you can change the `log.stream`
+member, or you can just listen to the events that it emits, and do
+whatever you want with them.
+
+# Installation
+
+```console
+npm install npmlog --save
+```
+
+# Basic Usage
+
+```javascript
+var log = require('npmlog')
+
+// additional stuff ---------------------------+
+// message ----------+                         |
+// prefix ----+      |                         |
+// level -+   |      |                         |
+//        v   v      v                         v
+    log.info('fyi', 'I have a kitty cat: %j', myKittyCat)
+```
+
+## log.level
+
+* {String}
+
+The level to display logs at.  Any logs at or above this level will be
+displayed.  The special level `silent` will prevent anything from being
+displayed ever.
+
+## log.record
+
+* {Array}
+
+An array of all the log messages that have been entered.
+
+## log.maxRecordSize
+
+* {Number}
+
+The maximum number of records to keep.  If log.record gets bigger than
+10% over this value, then it is sliced down to 90% of this value.
+
+The reason for the 10% window is so that it doesn't have to resize a
+large array on every log entry.
+
+## log.prefixStyle
+
+* {Object}
+
+A style object that specifies how prefixes are styled.  (See below)
+
+## log.headingStyle
+
+* {Object}
+
+A style object that specifies how the heading is styled.  (See below)
+
+## log.heading
+
+* {String} Default: ""
+
+If set, a heading that is printed at the start of every line.
+
+## log.stream
+
+* {Stream} Default: `process.stderr`
+
+The stream where output is written.
+
+## log.enableColor()
+
+Force colors to be used on all messages, regardless of the output
+stream.
+
+## log.disableColor()
+
+Disable colors on all messages.
+
+## log.enableProgress()
+
+Enable the display of log activity spinner and progress bar
+
+## log.disableProgress()
+
+Disable the display of a progress bar
+
+## log.enableUnicode()
+
+Force the unicode theme to be used for the progress bar.
+
+## log.disableUnicode()
+
+Disable the use of unicode in the progress bar.
+
+## log.setGaugeTemplate(template)
+
+Set a template for outputting the progress bar. See the [gauge documentation] for details.
+
+[gauge documentation]: https://npmjs.com/package/gauge
+
+## log.setGaugeThemeset(themes)
+
+Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details.
+
+## log.pause()
+
+Stop emitting messages to the stream, but do not drop them.
+
+## log.resume()
+
+Emit all buffered messages that were written while paused.
+
+## log.log(level, prefix, message, ...)
+
+* `level` {String} The level to emit the message at
+* `prefix` {String} A string prefix.  Set to "" to skip.
+* `message...` Arguments to `util.format`
+
+Emit a log message at the specified level.
+
+## log\[level](prefix, message, ...)
+
+For example,
+
+* log.silly(prefix, message, ...)
+* log.verbose(prefix, message, ...)
+* log.info(prefix, message, ...)
+* log.http(prefix, message, ...)
+* log.warn(prefix, message, ...)
+* log.error(prefix, message, ...)
+
+Like `log.log(level, prefix, message, ...)`.  In this way, each level is
+given a shorthand, so you can do `log.info(prefix, message)`.
+
+## log.addLevel(level, n, style, disp)
+
+* `level` {String} Level indicator
+* `n` {Number} The numeric level
+* `style` {Object} Object with fg, bg, inverse, etc.
+* `disp` {String} Optional replacement for `level` in the output.
+
+Sets up a new level with a shorthand function and so forth.
+
+Note that if the number is `Infinity`, then setting the level to that
+will cause all log messages to be suppressed.  If the number is
+`-Infinity`, then the only way to show it is to enable all log messages.
+
+## log.newItem(name, todo, weight)
+
+* `name` {String} Optional; progress item name.
+* `todo` {Number} Optional; total amount of work to be done. Default 0.
+* `weight` {Number} Optional; the weight of this item relative to others. Default 1.
+
+This adds a new `are-we-there-yet` item tracker to the progress tracker. The
+object returned has the `log[level]` methods but is otherwise an
+`are-we-there-yet` `Tracker` object.
+
+## log.newStream(name, todo, weight)
+
+This adds a new `are-we-there-yet` stream tracker to the progress tracker. The
+object returned has the `log[level]` methods but is otherwise an
+`are-we-there-yet` `TrackerStream` object.
+
+## log.newGroup(name, weight)
+
+This adds a new `are-we-there-yet` tracker group to the progress tracker. The
+object returned has the `log[level]` methods but is otherwise an
+`are-we-there-yet` `TrackerGroup` object.
+
+# Events
+
+Events are all emitted with the message object.
+
+* `log` Emitted for all messages
+* `log.<level>` Emitted for all messages with the `<level>` level.
+* `<prefix>` Messages with prefixes also emit their prefix as an event.
+
+# Style Objects
+
+Style objects can have the following fields:
+
+* `fg` {String} Color for the foreground text
+* `bg` {String} Color for the background
+* `bold`, `inverse`, `underline` {Boolean} Set the associated property
+* `bell` {Boolean} Make a noise (This is pretty annoying, probably.)
+
+# Message Objects
+
+Every log event is emitted with a message object, and the `log.record`
+list contains all of them that have been created.  They have the
+following fields:
+
+* `id` {Number}
+* `level` {String}
+* `prefix` {String}
+* `message` {String} Result of `util.format()`
+* `messageRaw` {Array} Arguments to `util.format()`
+
+# Blocking TTYs
+
+We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set
+stderr and stdout blocking if they are tty's and have the setBlocking call.
+This is a work around for an issue in early versions of Node.js 6.x, which
+made stderr and stdout non-blocking on OSX. (They are always blocking
+Windows and were never blocking on Linux.) `npmlog` needs them to be blocking
+so that it can allow output to stdout and stderr to be interlaced.
diff --git a/legacy-libs/grpc/node_modules/npmlog/log.js b/legacy-libs/grpc/node_modules/npmlog/log.js
new file mode 100644 (file)
index 0000000..341f331
--- /dev/null
@@ -0,0 +1,309 @@
+'use strict'
+var Progress = require('are-we-there-yet')
+var Gauge = require('gauge')
+var EE = require('events').EventEmitter
+var log = exports = module.exports = new EE()
+var util = require('util')
+
+var setBlocking = require('set-blocking')
+var consoleControl = require('console-control-strings')
+
+setBlocking(true)
+var stream = process.stderr
+Object.defineProperty(log, 'stream', {
+  set: function (newStream) {
+    stream = newStream
+    if (this.gauge) this.gauge.setWriteTo(stream, stream)
+  },
+  get: function () {
+    return stream
+  }
+})
+
+// by default, decide based on tty-ness.
+var colorEnabled
+log.useColor = function () {
+  return colorEnabled != null ? colorEnabled : stream.isTTY
+}
+
+log.enableColor = function () {
+  colorEnabled = true
+  this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
+}
+log.disableColor = function () {
+  colorEnabled = false
+  this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled})
+}
+
+// default level
+log.level = 'info'
+
+log.gauge = new Gauge(stream, {
+  enabled: false, // no progress bars unless asked
+  theme: {hasColor: log.useColor()},
+  template: [
+    {type: 'progressbar', length: 20},
+    {type: 'activityIndicator', kerning: 1, length: 1},
+    {type: 'section', default: ''},
+    ':',
+    {type: 'logline', kerning: 1, default: ''}
+  ]
+})
+
+log.tracker = new Progress.TrackerGroup()
+
+// we track this separately as we may need to temporarily disable the
+// display of the status bar for our own loggy purposes.
+log.progressEnabled = log.gauge.isEnabled()
+
+var unicodeEnabled
+
+log.enableUnicode = function () {
+  unicodeEnabled = true
+  this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled})
+}
+
+log.disableUnicode = function () {
+  unicodeEnabled = false
+  this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled})
+}
+
+log.setGaugeThemeset = function (themes) {
+  this.gauge.setThemeset(themes)
+}
+
+log.setGaugeTemplate = function (template) {
+  this.gauge.setTemplate(template)
+}
+
+log.enableProgress = function () {
+  if (this.progressEnabled) return
+  this.progressEnabled = true
+  this.tracker.on('change', this.showProgress)
+  if (this._pause) return
+  this.gauge.enable()
+}
+
+log.disableProgress = function () {
+  if (!this.progressEnabled) return
+  this.progressEnabled = false
+  this.tracker.removeListener('change', this.showProgress)
+  this.gauge.disable()
+}
+
+var trackerConstructors = ['newGroup', 'newItem', 'newStream']
+
+var mixinLog = function (tracker) {
+  // mixin the public methods from log into the tracker
+  // (except: conflicts and one's we handle specially)
+  Object.keys(log).forEach(function (P) {
+    if (P[0] === '_') return
+    if (trackerConstructors.filter(function (C) { return C === P }).length) return
+    if (tracker[P]) return
+    if (typeof log[P] !== 'function') return
+    var func = log[P]
+    tracker[P] = function () {
+      return func.apply(log, arguments)
+    }
+  })
+  // if the new tracker is a group, make sure any subtrackers get
+  // mixed in too
+  if (tracker instanceof Progress.TrackerGroup) {
+    trackerConstructors.forEach(function (C) {
+      var func = tracker[C]
+      tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) }
+    })
+  }
+  return tracker
+}
+
+// Add tracker constructors to the top level log object
+trackerConstructors.forEach(function (C) {
+  log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) }
+})
+
+log.clearProgress = function (cb) {
+  if (!this.progressEnabled) return cb && process.nextTick(cb)
+  this.gauge.hide(cb)
+}
+
+log.showProgress = function (name, completed) {
+  if (!this.progressEnabled) return
+  var values = {}
+  if (name) values.section = name
+  var last = log.record[log.record.length - 1]
+  if (last) {
+    values.subsection = last.prefix
+    var disp = log.disp[last.level] || last.level
+    var logline = this._format(disp, log.style[last.level])
+    if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle)
+    logline += ' ' + last.message.split(/\r?\n/)[0]
+    values.logline = logline
+  }
+  values.completed = completed || this.tracker.completed()
+  this.gauge.show(values)
+}.bind(log) // bind for use in tracker's on-change listener
+
+// temporarily stop emitting, but don't drop
+log.pause = function () {
+  this._paused = true
+  if (this.progressEnabled) this.gauge.disable()
+}
+
+log.resume = function () {
+  if (!this._paused) return
+  this._paused = false
+
+  var b = this._buffer
+  this._buffer = []
+  b.forEach(function (m) {
+    this.emitLog(m)
+  }, this)
+  if (this.progressEnabled) this.gauge.enable()
+}
+
+log._buffer = []
+
+var id = 0
+log.record = []
+log.maxRecordSize = 10000
+log.log = function (lvl, prefix, message) {
+  var l = this.levels[lvl]
+  if (l === undefined) {
+    return this.emit('error', new Error(util.format(
+      'Undefined log level: %j', lvl)))
+  }
+
+  var a = new Array(arguments.length - 2)
+  var stack = null
+  for (var i = 2; i < arguments.length; i++) {
+    var arg = a[i - 2] = arguments[i]
+
+    // resolve stack traces to a plain string.
+    if (typeof arg === 'object' && arg &&
+        (arg instanceof Error) && arg.stack) {
+
+      Object.defineProperty(arg, 'stack', {
+        value: stack = arg.stack + '',
+        enumerable: true,
+        writable: true
+      })
+    }
+  }
+  if (stack) a.unshift(stack + '\n')
+  message = util.format.apply(util, a)
+
+  var m = { id: id++,
+            level: lvl,
+            prefix: String(prefix || ''),
+            message: message,
+            messageRaw: a }
+
+  this.emit('log', m)
+  this.emit('log.' + lvl, m)
+  if (m.prefix) this.emit(m.prefix, m)
+
+  this.record.push(m)
+  var mrs = this.maxRecordSize
+  var n = this.record.length - mrs
+  if (n > mrs / 10) {
+    var newSize = Math.floor(mrs * 0.9)
+    this.record = this.record.slice(-1 * newSize)
+  }
+
+  this.emitLog(m)
+}.bind(log)
+
+log.emitLog = function (m) {
+  if (this._paused) {
+    this._buffer.push(m)
+    return
+  }
+  if (this.progressEnabled) this.gauge.pulse(m.prefix)
+  var l = this.levels[m.level]
+  if (l === undefined) return
+  if (l < this.levels[this.level]) return
+  if (l > 0 && !isFinite(l)) return
+
+  // If 'disp' is null or undefined, use the lvl as a default
+  // Allows: '', 0 as valid disp
+  var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level
+  this.clearProgress()
+  m.message.split(/\r?\n/).forEach(function (line) {
+    if (this.heading) {
+      this.write(this.heading, this.headingStyle)
+      this.write(' ')
+    }
+    this.write(disp, log.style[m.level])
+    var p = m.prefix || ''
+    if (p) this.write(' ')
+    this.write(p, this.prefixStyle)
+    this.write(' ' + line + '\n')
+  }, this)
+  this.showProgress()
+}
+
+log._format = function (msg, style) {
+  if (!stream) return
+
+  var output = ''
+  if (this.useColor()) {
+    style = style || {}
+    var settings = []
+    if (style.fg) settings.push(style.fg)
+    if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1))
+    if (style.bold) settings.push('bold')
+    if (style.underline) settings.push('underline')
+    if (style.inverse) settings.push('inverse')
+    if (settings.length) output += consoleControl.color(settings)
+    if (style.beep) output += consoleControl.beep()
+  }
+  output += msg
+  if (this.useColor()) {
+    output += consoleControl.color('reset')
+  }
+  return output
+}
+
+log.write = function (msg, style) {
+  if (!stream) return
+
+  stream.write(this._format(msg, style))
+}
+
+log.addLevel = function (lvl, n, style, disp) {
+  // If 'disp' is null or undefined, use the lvl as a default
+  if (disp == null) disp = lvl
+  this.levels[lvl] = n
+  this.style[lvl] = style
+  if (!this[lvl]) {
+    this[lvl] = function () {
+      var a = new Array(arguments.length + 1)
+      a[0] = lvl
+      for (var i = 0; i < arguments.length; i++) {
+        a[i + 1] = arguments[i]
+      }
+      return this.log.apply(this, a)
+    }.bind(this)
+  }
+  this.disp[lvl] = disp
+}
+
+log.prefixStyle = { fg: 'magenta' }
+log.headingStyle = { fg: 'white', bg: 'black' }
+
+log.style = {}
+log.levels = {}
+log.disp = {}
+log.addLevel('silly', -Infinity, { inverse: true }, 'sill')
+log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb')
+log.addLevel('info', 2000, { fg: 'green' })
+log.addLevel('timing', 2500, { fg: 'green', bg: 'black' })
+log.addLevel('http', 3000, { fg: 'green', bg: 'black' })
+log.addLevel('notice', 3500, { fg: 'blue', bg: 'black' })
+log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN')
+log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!')
+log.addLevel('silent', Infinity)
+
+// allow 'error' prefix
+log.on('error', function () {})
diff --git a/legacy-libs/grpc/node_modules/npmlog/package.json b/legacy-libs/grpc/node_modules/npmlog/package.json
new file mode 100644 (file)
index 0000000..2cd8149
--- /dev/null
@@ -0,0 +1,68 @@
+{
+  "_args": [
+    [
+      "npmlog@4.1.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "npmlog@4.1.2",
+  "_id": "npmlog@4.1.2",
+  "_inBundle": false,
+  "_integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
+  "_location": "/grpc/npmlog",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "npmlog@4.1.2",
+    "name": "npmlog",
+    "escapedName": "npmlog",
+    "rawSpec": "4.1.2",
+    "saveSpec": null,
+    "fetchSpec": "4.1.2"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "4.1.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/npmlog/issues"
+  },
+  "dependencies": {
+    "are-we-there-yet": "~1.1.2",
+    "console-control-strings": "~1.1.0",
+    "gauge": "~2.7.3",
+    "set-blocking": "~2.0.0"
+  },
+  "description": "logger for npm",
+  "devDependencies": {
+    "standard": "~7.1.2",
+    "tap": "~5.7.3"
+  },
+  "files": [
+    "log.js"
+  ],
+  "homepage": "https://github.com/npm/npmlog#readme",
+  "license": "ISC",
+  "main": "log.js",
+  "name": "npmlog",
+  "optionalDependencies": {},
+  "readme": "# npmlog\n\nThe logger util that npm uses.\n\nThis logger is very basic.  It does the logging for npm.  It supports\ncustom levels and colored output.\n\nBy default, logs are written to stderr.  If you want to send log messages\nto outputs other than streams, then you can change the `log.stream`\nmember, or you can just listen to the events that it emits, and do\nwhatever you want with them.\n\n# Installation\n\n```console\nnpm install npmlog --save\n```\n\n# Basic Usage\n\n```javascript\nvar log = require('npmlog')\n\n// additional stuff ---------------------------+\n// message ----------+                         |\n// prefix ----+      |                         |\n// level -+   |      |                         |\n//        v   v      v                         v\n    log.info('fyi', 'I have a kitty cat: %j', myKittyCat)\n```\n\n## log.level\n\n* {String}\n\nThe level to display logs at.  Any logs at or above this level will be\ndisplayed.  The special level `silent` will prevent anything from being\ndisplayed ever.\n\n## log.record\n\n* {Array}\n\nAn array of all the log messages that have been entered.\n\n## log.maxRecordSize\n\n* {Number}\n\nThe maximum number of records to keep.  If log.record gets bigger than\n10% over this value, then it is sliced down to 90% of this value.\n\nThe reason for the 10% window is so that it doesn't have to resize a\nlarge array on every log entry.\n\n## log.prefixStyle\n\n* {Object}\n\nA style object that specifies how prefixes are styled.  (See below)\n\n## log.headingStyle\n\n* {Object}\n\nA style object that specifies how the heading is styled.  (See below)\n\n## log.heading\n\n* {String} Default: \"\"\n\nIf set, a heading that is printed at the start of every line.\n\n## log.stream\n\n* {Stream} Default: `process.stderr`\n\nThe stream where output is written.\n\n## log.enableColor()\n\nForce colors to be used on all messages, regardless of the output\nstream.\n\n## log.disableColor()\n\nDisable colors on all messages.\n\n## log.enableProgress()\n\nEnable the display of log activity spinner and progress bar\n\n## log.disableProgress()\n\nDisable the display of a progress bar\n\n## log.enableUnicode()\n\nForce the unicode theme to be used for the progress bar.\n\n## log.disableUnicode()\n\nDisable the use of unicode in the progress bar.\n\n## log.setGaugeTemplate(template)\n\nSet a template for outputting the progress bar. See the [gauge documentation] for details.\n\n[gauge documentation]: https://npmjs.com/package/gauge\n\n## log.setGaugeThemeset(themes)\n\nSelect a themeset to pick themes from for the progress bar. See the [gauge documentation] for details.\n\n## log.pause()\n\nStop emitting messages to the stream, but do not drop them.\n\n## log.resume()\n\nEmit all buffered messages that were written while paused.\n\n## log.log(level, prefix, message, ...)\n\n* `level` {String} The level to emit the message at\n* `prefix` {String} A string prefix.  Set to \"\" to skip.\n* `message...` Arguments to `util.format`\n\nEmit a log message at the specified level.\n\n## log\\[level](prefix, message, ...)\n\nFor example,\n\n* log.silly(prefix, message, ...)\n* log.verbose(prefix, message, ...)\n* log.info(prefix, message, ...)\n* log.http(prefix, message, ...)\n* log.warn(prefix, message, ...)\n* log.error(prefix, message, ...)\n\nLike `log.log(level, prefix, message, ...)`.  In this way, each level is\ngiven a shorthand, so you can do `log.info(prefix, message)`.\n\n## log.addLevel(level, n, style, disp)\n\n* `level` {String} Level indicator\n* `n` {Number} The numeric level\n* `style` {Object} Object with fg, bg, inverse, etc.\n* `disp` {String} Optional replacement for `level` in the output.\n\nSets up a new level with a shorthand function and so forth.\n\nNote that if the number is `Infinity`, then setting the level to that\nwill cause all log messages to be suppressed.  If the number is\n`-Infinity`, then the only way to show it is to enable all log messages.\n\n## log.newItem(name, todo, weight)\n\n* `name` {String} Optional; progress item name.\n* `todo` {Number} Optional; total amount of work to be done. Default 0.\n* `weight` {Number} Optional; the weight of this item relative to others. Default 1.\n\nThis adds a new `are-we-there-yet` item tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `Tracker` object.\n\n## log.newStream(name, todo, weight)\n\nThis adds a new `are-we-there-yet` stream tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerStream` object.\n\n## log.newGroup(name, weight)\n\nThis adds a new `are-we-there-yet` tracker group to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerGroup` object.\n\n# Events\n\nEvents are all emitted with the message object.\n\n* `log` Emitted for all messages\n* `log.<level>` Emitted for all messages with the `<level>` level.\n* `<prefix>` Messages with prefixes also emit their prefix as an event.\n\n# Style Objects\n\nStyle objects can have the following fields:\n\n* `fg` {String} Color for the foreground text\n* `bg` {String} Color for the background\n* `bold`, `inverse`, `underline` {Boolean} Set the associated property\n* `bell` {Boolean} Make a noise (This is pretty annoying, probably.)\n\n# Message Objects\n\nEvery log event is emitted with a message object, and the `log.record`\nlist contains all of them that have been created.  They have the\nfollowing fields:\n\n* `id` {Number}\n* `level` {String}\n* `prefix` {String}\n* `message` {String} Result of `util.format()`\n* `messageRaw` {Array} Arguments to `util.format()`\n\n# Blocking TTYs\n\nWe use [`set-blocking`](https://npmjs.com/package/set-blocking) to set\nstderr and stdout blocking if they are tty's and have the setBlocking call.\nThis is a work around for an issue in early versions of Node.js 6.x, which\nmade stderr and stdout non-blocking on OSX. (They are always blocking\nWindows and were never blocking on Linux.) `npmlog` needs them to be blocking\nso that it can allow output to stdout and stderr to be interlaced.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/npmlog.git"
+  },
+  "scripts": {
+    "test": "standard && tap test/*.js"
+  },
+  "version": "4.1.2"
+}
diff --git a/legacy-libs/grpc/node_modules/number-is-nan/index.js b/legacy-libs/grpc/node_modules/number-is-nan/index.js
new file mode 100644 (file)
index 0000000..79be4b9
--- /dev/null
@@ -0,0 +1,4 @@
+'use strict';
+module.exports = Number.isNaN || function (x) {
+       return x !== x;
+};
diff --git a/legacy-libs/grpc/node_modules/number-is-nan/license b/legacy-libs/grpc/node_modules/number-is-nan/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/number-is-nan/package.json b/legacy-libs/grpc/node_modules/number-is-nan/package.json
new file mode 100644 (file)
index 0000000..48b5bde
--- /dev/null
@@ -0,0 +1,75 @@
+{
+  "_args": [
+    [
+      "number-is-nan@1.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "number-is-nan@1.0.1",
+  "_id": "number-is-nan@1.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
+  "_location": "/grpc/number-is-nan",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "number-is-nan@1.0.1",
+    "name": "number-is-nan",
+    "escapedName": "number-is-nan",
+    "rawSpec": "1.0.1",
+    "saveSpec": null,
+    "fetchSpec": "1.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/is-fullwidth-code-point"
+  ],
+  "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/number-is-nan/issues"
+  },
+  "dependencies": {},
+  "description": "ES2015 Number.isNaN() ponyfill",
+  "devDependencies": {
+    "ava": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/number-is-nan#readme",
+  "keywords": [
+    "es2015",
+    "ecmascript",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "number",
+    "is",
+    "nan",
+    "not"
+  ],
+  "license": "MIT",
+  "name": "number-is-nan",
+  "optionalDependencies": {},
+  "readme": "# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan)\n\n> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com)\n\n\n## Install\n\n```\n$ npm install --save number-is-nan\n```\n\n\n## Usage\n\n```js\nvar numberIsNan = require('number-is-nan');\n\nnumberIsNan(NaN);\n//=> true\n\nnumberIsNan('unicorn');\n//=> false\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/number-is-nan.git"
+  },
+  "scripts": {
+    "test": "ava"
+  },
+  "version": "1.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/number-is-nan/readme.md b/legacy-libs/grpc/node_modules/number-is-nan/readme.md
new file mode 100644 (file)
index 0000000..2463508
--- /dev/null
@@ -0,0 +1,28 @@
+# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan)
+
+> ES2015 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) [ponyfill](https://ponyfill.com)
+
+
+## Install
+
+```
+$ npm install --save number-is-nan
+```
+
+
+## Usage
+
+```js
+var numberIsNan = require('number-is-nan');
+
+numberIsNan(NaN);
+//=> true
+
+numberIsNan('unicorn');
+//=> false
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/object-assign/index.js b/legacy-libs/grpc/node_modules/object-assign/index.js
new file mode 100644 (file)
index 0000000..0930cf8
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+object-assign
+(c) Sindre Sorhus
+@license MIT
+*/
+
+'use strict';
+/* eslint-disable no-unused-vars */
+var getOwnPropertySymbols = Object.getOwnPropertySymbols;
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+var propIsEnumerable = Object.prototype.propertyIsEnumerable;
+
+function toObject(val) {
+       if (val === null || val === undefined) {
+               throw new TypeError('Object.assign cannot be called with null or undefined');
+       }
+
+       return Object(val);
+}
+
+function shouldUseNative() {
+       try {
+               if (!Object.assign) {
+                       return false;
+               }
+
+               // Detect buggy property enumeration order in older V8 versions.
+
+               // https://bugs.chromium.org/p/v8/issues/detail?id=4118
+               var test1 = new String('abc');  // eslint-disable-line no-new-wrappers
+               test1[5] = 'de';
+               if (Object.getOwnPropertyNames(test1)[0] === '5') {
+                       return false;
+               }
+
+               // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+               var test2 = {};
+               for (var i = 0; i < 10; i++) {
+                       test2['_' + String.fromCharCode(i)] = i;
+               }
+               var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
+                       return test2[n];
+               });
+               if (order2.join('') !== '0123456789') {
+                       return false;
+               }
+
+               // https://bugs.chromium.org/p/v8/issues/detail?id=3056
+               var test3 = {};
+               'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
+                       test3[letter] = letter;
+               });
+               if (Object.keys(Object.assign({}, test3)).join('') !==
+                               'abcdefghijklmnopqrst') {
+                       return false;
+               }
+
+               return true;
+       } catch (err) {
+               // We don't expect any of the above to throw, but better to be safe.
+               return false;
+       }
+}
+
+module.exports = shouldUseNative() ? Object.assign : function (target, source) {
+       var from;
+       var to = toObject(target);
+       var symbols;
+
+       for (var s = 1; s < arguments.length; s++) {
+               from = Object(arguments[s]);
+
+               for (var key in from) {
+                       if (hasOwnProperty.call(from, key)) {
+                               to[key] = from[key];
+                       }
+               }
+
+               if (getOwnPropertySymbols) {
+                       symbols = getOwnPropertySymbols(from);
+                       for (var i = 0; i < symbols.length; i++) {
+                               if (propIsEnumerable.call(from, symbols[i])) {
+                                       to[symbols[i]] = from[symbols[i]];
+                               }
+                       }
+               }
+       }
+
+       return to;
+};
diff --git a/legacy-libs/grpc/node_modules/object-assign/license b/legacy-libs/grpc/node_modules/object-assign/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/object-assign/package.json b/legacy-libs/grpc/node_modules/object-assign/package.json
new file mode 100644 (file)
index 0000000..5475db3
--- /dev/null
@@ -0,0 +1,82 @@
+{
+  "_args": [
+    [
+      "object-assign@4.1.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "object-assign@4.1.1",
+  "_id": "object-assign@4.1.1",
+  "_inBundle": false,
+  "_integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+  "_location": "/grpc/object-assign",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "object-assign@4.1.1",
+    "name": "object-assign",
+    "escapedName": "object-assign",
+    "rawSpec": "4.1.1",
+    "saveSpec": null,
+    "fetchSpec": "4.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/gauge"
+  ],
+  "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "4.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/object-assign/issues"
+  },
+  "dependencies": {},
+  "description": "ES2015 `Object.assign()` ponyfill",
+  "devDependencies": {
+    "ava": "^0.16.0",
+    "lodash": "^4.16.4",
+    "matcha": "^0.7.0",
+    "xo": "^0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/object-assign#readme",
+  "keywords": [
+    "object",
+    "assign",
+    "extend",
+    "properties",
+    "es2015",
+    "ecmascript",
+    "harmony",
+    "ponyfill",
+    "prollyfill",
+    "polyfill",
+    "shim",
+    "browser"
+  ],
+  "license": "MIT",
+  "name": "object-assign",
+  "optionalDependencies": {},
+  "readme": "# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)\n\n> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)\n\n\n## Use the built-in\n\nNode.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari),\nsupport `Object.assign()` :tada:. If you target only those environments, then by all\nmeans, use `Object.assign()` instead of this package.\n\n\n## Install\n\n```\n$ npm install --save object-assign\n```\n\n\n## Usage\n\n```js\nconst objectAssign = require('object-assign');\n\nobjectAssign({foo: 0}, {bar: 1});\n//=> {foo: 0, bar: 1}\n\n// multiple sources\nobjectAssign({foo: 0}, {bar: 1}, {baz: 2});\n//=> {foo: 0, bar: 1, baz: 2}\n\n// overwrites equal keys\nobjectAssign({foo: 0}, {foo: 1}, {foo: 2});\n//=> {foo: 2}\n\n// ignores null and undefined sources\nobjectAssign({foo: 0}, null, {bar: 1}, undefined);\n//=> {foo: 0, bar: 1}\n```\n\n\n## API\n\n### objectAssign(target, [source, ...])\n\nAssigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.\n\n\n## Resources\n\n- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)\n\n\n## Related\n\n- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()`\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/object-assign.git"
+  },
+  "scripts": {
+    "bench": "matcha bench.js",
+    "test": "xo && ava"
+  },
+  "version": "4.1.1"
+}
diff --git a/legacy-libs/grpc/node_modules/object-assign/readme.md b/legacy-libs/grpc/node_modules/object-assign/readme.md
new file mode 100644 (file)
index 0000000..1be09d3
--- /dev/null
@@ -0,0 +1,61 @@
+# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign)
+
+> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) [ponyfill](https://ponyfill.com)
+
+
+## Use the built-in
+
+Node.js 4 and up, as well as every evergreen browser (Chrome, Edge, Firefox, Opera, Safari),
+support `Object.assign()` :tada:. If you target only those environments, then by all
+means, use `Object.assign()` instead of this package.
+
+
+## Install
+
+```
+$ npm install --save object-assign
+```
+
+
+## Usage
+
+```js
+const objectAssign = require('object-assign');
+
+objectAssign({foo: 0}, {bar: 1});
+//=> {foo: 0, bar: 1}
+
+// multiple sources
+objectAssign({foo: 0}, {bar: 1}, {baz: 2});
+//=> {foo: 0, bar: 1, baz: 2}
+
+// overwrites equal keys
+objectAssign({foo: 0}, {foo: 1}, {foo: 2});
+//=> {foo: 2}
+
+// ignores null and undefined sources
+objectAssign({foo: 0}, null, {bar: 1}, undefined);
+//=> {foo: 0, bar: 1}
+```
+
+
+## API
+
+### objectAssign(target, [source, ...])
+
+Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones.
+
+
+## Resources
+
+- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign)
+
+
+## Related
+
+- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()`
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/once/LICENSE b/legacy-libs/grpc/node_modules/once/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/once/README.md b/legacy-libs/grpc/node_modules/once/README.md
new file mode 100644 (file)
index 0000000..1f1ffca
--- /dev/null
@@ -0,0 +1,79 @@
+# once
+
+Only call a function once.
+
+## usage
+
+```javascript
+var once = require('once')
+
+function load (file, cb) {
+  cb = once(cb)
+  loader.load('file')
+  loader.once('load', cb)
+  loader.once('error', cb)
+}
+```
+
+Or add to the Function.prototype in a responsible way:
+
+```javascript
+// only has to be done once
+require('once').proto()
+
+function load (file, cb) {
+  cb = cb.once()
+  loader.load('file')
+  loader.once('load', cb)
+  loader.once('error', cb)
+}
+```
+
+Ironically, the prototype feature makes this module twice as
+complicated as necessary.
+
+To check whether you function has been called, use `fn.called`. Once the
+function is called for the first time the return value of the original
+function is saved in `fn.value` and subsequent calls will continue to
+return this value.
+
+```javascript
+var once = require('once')
+
+function load (cb) {
+  cb = once(cb)
+  var stream = createStream()
+  stream.once('data', cb)
+  stream.once('end', function () {
+    if (!cb.called) cb(new Error('not found'))
+  })
+}
+```
+
+## `once.strict(func)`
+
+Throw an error if the function is called twice.
+
+Some functions are expected to be called only once. Using `once` for them would
+potentially hide logical errors.
+
+In the example below, the `greet` function has to call the callback only once:
+
+```javascript
+function greet (name, cb) {
+  // return is missing from the if statement
+  // when no name is passed, the callback is called twice
+  if (!name) cb('Hello anonymous')
+  cb('Hello ' + name)
+}
+
+function log (msg) {
+  console.log(msg)
+}
+
+// this will print 'Hello anonymous' but the logical error will be missed
+greet(null, once(msg))
+
+// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time
+greet(null, once.strict(msg))
+```
diff --git a/legacy-libs/grpc/node_modules/once/once.js b/legacy-libs/grpc/node_modules/once/once.js
new file mode 100644 (file)
index 0000000..2354067
--- /dev/null
@@ -0,0 +1,42 @@
+var wrappy = require('wrappy')
+module.exports = wrappy(once)
+module.exports.strict = wrappy(onceStrict)
+
+once.proto = once(function () {
+  Object.defineProperty(Function.prototype, 'once', {
+    value: function () {
+      return once(this)
+    },
+    configurable: true
+  })
+
+  Object.defineProperty(Function.prototype, 'onceStrict', {
+    value: function () {
+      return onceStrict(this)
+    },
+    configurable: true
+  })
+})
+
+function once (fn) {
+  var f = function () {
+    if (f.called) return f.value
+    f.called = true
+    return f.value = fn.apply(this, arguments)
+  }
+  f.called = false
+  return f
+}
+
+function onceStrict (fn) {
+  var f = function () {
+    if (f.called)
+      throw new Error(f.onceError)
+    f.called = true
+    return f.value = fn.apply(this, arguments)
+  }
+  var name = fn.name || 'Function wrapped with `once`'
+  f.onceError = name + " shouldn't be called more than once"
+  f.called = false
+  return f
+}
diff --git a/legacy-libs/grpc/node_modules/once/package.json b/legacy-libs/grpc/node_modules/once/package.json
new file mode 100644 (file)
index 0000000..2788f96
--- /dev/null
@@ -0,0 +1,74 @@
+{
+  "_args": [
+    [
+      "once@1.4.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "once@1.4.0",
+  "_id": "once@1.4.0",
+  "_inBundle": false,
+  "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+  "_location": "/grpc/once",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "once@1.4.0",
+    "name": "once",
+    "escapedName": "once",
+    "rawSpec": "1.4.0",
+    "saveSpec": null,
+    "fetchSpec": "1.4.0"
+  },
+  "_requiredBy": [
+    "/grpc/inflight",
+    "/grpc/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.4.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/once/issues"
+  },
+  "dependencies": {
+    "wrappy": "1"
+  },
+  "description": "Run a function exactly one time",
+  "devDependencies": {
+    "tap": "^7.0.1"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "once.js"
+  ],
+  "homepage": "https://github.com/isaacs/once#readme",
+  "keywords": [
+    "once",
+    "function",
+    "one",
+    "single"
+  ],
+  "license": "ISC",
+  "main": "once.js",
+  "name": "once",
+  "optionalDependencies": {},
+  "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n  cb = once(cb)\n  loader.load('file')\n  loader.once('load', cb)\n  loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n  cb = cb.once()\n  loader.load('file')\n  loader.once('load', cb)\n  loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n  cb = once(cb)\n  var stream = createStream()\n  stream.once('data', cb)\n  stream.once('end', function () {\n    if (!cb.called) cb(new Error('not found'))\n  })\n}\n```\n\n## `once.strict(func)`\n\nThrow an error if the function is called twice.\n\nSome functions are expected to be called only once. Using `once` for them would\npotentially hide logical errors.\n\nIn the example below, the `greet` function has to call the callback only once:\n\n```javascript\nfunction greet (name, cb) {\n  // return is missing from the if statement\n  // when no name is passed, the callback is called twice\n  if (!name) cb('Hello anonymous')\n  cb('Hello ' + name)\n}\n\nfunction log (msg) {\n  console.log(msg)\n}\n\n// this will print 'Hello anonymous' but the logical error will be missed\ngreet(null, once(msg))\n\n// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time\ngreet(null, once.strict(msg))\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/once.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "version": "1.4.0"
+}
diff --git a/legacy-libs/grpc/node_modules/os-homedir/index.js b/legacy-libs/grpc/node_modules/os-homedir/index.js
new file mode 100644 (file)
index 0000000..3306616
--- /dev/null
@@ -0,0 +1,24 @@
+'use strict';
+var os = require('os');
+
+function homedir() {
+       var env = process.env;
+       var home = env.HOME;
+       var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
+
+       if (process.platform === 'win32') {
+               return env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null;
+       }
+
+       if (process.platform === 'darwin') {
+               return home || (user ? '/Users/' + user : null);
+       }
+
+       if (process.platform === 'linux') {
+               return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null));
+       }
+
+       return home || null;
+}
+
+module.exports = typeof os.homedir === 'function' ? os.homedir : homedir;
diff --git a/legacy-libs/grpc/node_modules/os-homedir/license b/legacy-libs/grpc/node_modules/os-homedir/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/os-homedir/package.json b/legacy-libs/grpc/node_modules/os-homedir/package.json
new file mode 100644 (file)
index 0000000..b9fdeec
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "_args": [
+    [
+      "os-homedir@1.0.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "os-homedir@1.0.2",
+  "_id": "os-homedir@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
+  "_location": "/grpc/os-homedir",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "os-homedir@1.0.2",
+    "name": "os-homedir",
+    "escapedName": "os-homedir",
+    "rawSpec": "1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "1.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/osenv"
+  ],
+  "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/os-homedir/issues"
+  },
+  "dependencies": {},
+  "description": "Node.js 4 `os.homedir()` ponyfill",
+  "devDependencies": {
+    "ava": "*",
+    "path-exists": "^2.0.0",
+    "xo": "^0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/os-homedir#readme",
+  "keywords": [
+    "builtin",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "os",
+    "homedir",
+    "home",
+    "dir",
+    "directory",
+    "folder",
+    "user",
+    "path"
+  ],
+  "license": "MIT",
+  "name": "os-homedir",
+  "optionalDependencies": {},
+  "readme": "# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir)\n\n> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com)\n\n\n## Install\n\n```\n$ npm install --save os-homedir\n```\n\n\n## Usage\n\n```js\nconst osHomedir = require('os-homedir');\n\nconsole.log(osHomedir());\n//=> '/Users/sindresorhus'\n```\n\n\n## Related\n\n- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result\n- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/os-homedir.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc/node_modules/os-homedir/readme.md b/legacy-libs/grpc/node_modules/os-homedir/readme.md
new file mode 100644 (file)
index 0000000..856ae61
--- /dev/null
@@ -0,0 +1,31 @@
+# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir)
+
+> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com)
+
+
+## Install
+
+```
+$ npm install --save os-homedir
+```
+
+
+## Usage
+
+```js
+const osHomedir = require('os-homedir');
+
+console.log(osHomedir());
+//=> '/Users/sindresorhus'
+```
+
+
+## Related
+
+- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result
+- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/os-tmpdir/index.js b/legacy-libs/grpc/node_modules/os-tmpdir/index.js
new file mode 100644 (file)
index 0000000..2077b1c
--- /dev/null
@@ -0,0 +1,25 @@
+'use strict';
+var isWindows = process.platform === 'win32';
+var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
+
+// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
+module.exports = function () {
+       var path;
+
+       if (isWindows) {
+               path = process.env.TEMP ||
+                       process.env.TMP ||
+                       (process.env.SystemRoot || process.env.windir) + '\\temp';
+       } else {
+               path = process.env.TMPDIR ||
+                       process.env.TMP ||
+                       process.env.TEMP ||
+                       '/tmp';
+       }
+
+       if (trailingSlashRe.test(path)) {
+               path = path.slice(0, -1);
+       }
+
+       return path;
+};
diff --git a/legacy-libs/grpc/node_modules/os-tmpdir/license b/legacy-libs/grpc/node_modules/os-tmpdir/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/os-tmpdir/package.json b/legacy-libs/grpc/node_modules/os-tmpdir/package.json
new file mode 100644 (file)
index 0000000..f7dea91
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "_args": [
+    [
+      "os-tmpdir@1.0.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "os-tmpdir@1.0.2",
+  "_id": "os-tmpdir@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+  "_location": "/grpc/os-tmpdir",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "os-tmpdir@1.0.2",
+    "name": "os-tmpdir",
+    "escapedName": "os-tmpdir",
+    "rawSpec": "1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "1.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/osenv"
+  ],
+  "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/os-tmpdir/issues"
+  },
+  "dependencies": {},
+  "description": "Node.js os.tmpdir() ponyfill",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "^0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/os-tmpdir#readme",
+  "keywords": [
+    "built-in",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "os",
+    "tmpdir",
+    "tempdir",
+    "tmp",
+    "temp",
+    "dir",
+    "directory",
+    "env",
+    "environment"
+  ],
+  "license": "MIT",
+  "name": "os-tmpdir",
+  "optionalDependencies": {},
+  "readme": "# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)\n\n> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com)\n\nUse this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8).\n\n\n## Install\n\n```\n$ npm install --save os-tmpdir\n```\n\n\n## Usage\n\n```js\nconst osTmpdir = require('os-tmpdir');\n\nosTmpdir();\n//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'\n```\n\n\n## API\n\nSee the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/os-tmpdir.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc/node_modules/os-tmpdir/readme.md b/legacy-libs/grpc/node_modules/os-tmpdir/readme.md
new file mode 100644 (file)
index 0000000..c09f7ed
--- /dev/null
@@ -0,0 +1,32 @@
+# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)
+
+> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com)
+
+Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8).
+
+
+## Install
+
+```
+$ npm install --save os-tmpdir
+```
+
+
+## Usage
+
+```js
+const osTmpdir = require('os-tmpdir');
+
+osTmpdir();
+//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'
+```
+
+
+## API
+
+See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/osenv/LICENSE b/legacy-libs/grpc/node_modules/osenv/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/osenv/README.md b/legacy-libs/grpc/node_modules/osenv/README.md
new file mode 100644 (file)
index 0000000..08fd900
--- /dev/null
@@ -0,0 +1,63 @@
+# osenv
+
+Look up environment settings specific to different operating systems.
+
+## Usage
+
+```javascript
+var osenv = require('osenv')
+var path = osenv.path()
+var user = osenv.user()
+// etc.
+
+// Some things are not reliably in the env, and have a fallback command:
+var h = osenv.hostname(function (er, hostname) {
+  h = hostname
+})
+// This will still cause it to be memoized, so calling osenv.hostname()
+// is now an immediate operation.
+
+// You can always send a cb, which will get called in the nextTick
+// if it's been memoized, or wait for the fallback data if it wasn't
+// found in the environment.
+osenv.hostname(function (er, hostname) {
+  if (er) console.error('error looking up hostname')
+  else console.log('this machine calls itself %s', hostname)
+})
+```
+
+## osenv.hostname()
+
+The machine name.  Calls `hostname` if not found.
+
+## osenv.user()
+
+The currently logged-in user.  Calls `whoami` if not found.
+
+## osenv.prompt()
+
+Either PS1 on unix, or PROMPT on Windows.
+
+## osenv.tmpdir()
+
+The place where temporary files should be created.
+
+## osenv.home()
+
+No place like it.
+
+## osenv.path()
+
+An array of the places that the operating system will search for
+executables.
+
+## osenv.editor() 
+
+Return the executable name of the editor program.  This uses the EDITOR
+and VISUAL environment variables, and falls back to `vi` on Unix, or
+`notepad.exe` on Windows.
+
+## osenv.shell()
+
+The SHELL on Unix, which Windows calls the ComSpec.  Defaults to 'bash'
+or 'cmd'.
diff --git a/legacy-libs/grpc/node_modules/osenv/osenv.js b/legacy-libs/grpc/node_modules/osenv/osenv.js
new file mode 100644 (file)
index 0000000..702a95b
--- /dev/null
@@ -0,0 +1,72 @@
+var isWindows = process.platform === 'win32'
+var path = require('path')
+var exec = require('child_process').exec
+var osTmpdir = require('os-tmpdir')
+var osHomedir = require('os-homedir')
+
+// looking up envs is a bit costly.
+// Also, sometimes we want to have a fallback
+// Pass in a callback to wait for the fallback on failures
+// After the first lookup, always returns the same thing.
+function memo (key, lookup, fallback) {
+  var fell = false
+  var falling = false
+  exports[key] = function (cb) {
+    var val = lookup()
+    if (!val && !fell && !falling && fallback) {
+      fell = true
+      falling = true
+      exec(fallback, function (er, output, stderr) {
+        falling = false
+        if (er) return // oh well, we tried
+        val = output.trim()
+      })
+    }
+    exports[key] = function (cb) {
+      if (cb) process.nextTick(cb.bind(null, null, val))
+      return val
+    }
+    if (cb && !falling) process.nextTick(cb.bind(null, null, val))
+    return val
+  }
+}
+
+memo('user', function () {
+  return ( isWindows
+         ? process.env.USERDOMAIN + '\\' + process.env.USERNAME
+         : process.env.USER
+         )
+}, 'whoami')
+
+memo('prompt', function () {
+  return isWindows ? process.env.PROMPT : process.env.PS1
+})
+
+memo('hostname', function () {
+  return isWindows ? process.env.COMPUTERNAME : process.env.HOSTNAME
+}, 'hostname')
+
+memo('tmpdir', function () {
+  return osTmpdir()
+})
+
+memo('home', function () {
+  return osHomedir()
+})
+
+memo('path', function () {
+  return (process.env.PATH ||
+          process.env.Path ||
+          process.env.path).split(isWindows ? ';' : ':')
+})
+
+memo('editor', function () {
+  return process.env.EDITOR ||
+         process.env.VISUAL ||
+         (isWindows ? 'notepad.exe' : 'vi')
+})
+
+memo('shell', function () {
+  return isWindows ? process.env.ComSpec || 'cmd'
+         : process.env.SHELL || 'bash'
+})
diff --git a/legacy-libs/grpc/node_modules/osenv/package.json b/legacy-libs/grpc/node_modules/osenv/package.json
new file mode 100644 (file)
index 0000000..abd077a
--- /dev/null
@@ -0,0 +1,80 @@
+{
+  "_args": [
+    [
+      "osenv@0.1.5",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "osenv@0.1.5",
+  "_id": "osenv@0.1.5",
+  "_inBundle": false,
+  "_integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
+  "_location": "/grpc/osenv",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "osenv@0.1.5",
+    "name": "osenv",
+    "escapedName": "osenv",
+    "rawSpec": "0.1.5",
+    "saveSpec": null,
+    "fetchSpec": "0.1.5"
+  },
+  "_requiredBy": [
+    "/grpc/nopt"
+  ],
+  "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
+  "_shrinkwrap": null,
+  "_spec": "0.1.5",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/osenv/issues"
+  },
+  "dependencies": {
+    "os-homedir": "^1.0.0",
+    "os-tmpdir": "^1.0.0"
+  },
+  "description": "Look up environment settings specific to different operating systems",
+  "devDependencies": {
+    "tap": "^11.1.0"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "osenv.js"
+  ],
+  "homepage": "https://github.com/npm/osenv#readme",
+  "keywords": [
+    "environment",
+    "variable",
+    "home",
+    "tmpdir",
+    "path",
+    "prompt",
+    "ps1"
+  ],
+  "license": "ISC",
+  "main": "osenv.js",
+  "name": "osenv",
+  "optionalDependencies": {},
+  "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n  h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n  if (er) console.error('error looking up hostname')\n  else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name.  Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user.  Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program.  This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec.  Defaults to 'bash'\nor 'cmd'.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/osenv.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js"
+  },
+  "version": "0.1.5"
+}
diff --git a/legacy-libs/grpc/node_modules/path-is-absolute/index.js b/legacy-libs/grpc/node_modules/path-is-absolute/index.js
new file mode 100644 (file)
index 0000000..22aa6c3
--- /dev/null
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+       return path.charAt(0) === '/';
+}
+
+function win32(path) {
+       // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+       var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+       var result = splitDeviceRe.exec(path);
+       var device = result[1] || '';
+       var isUnc = Boolean(device && device.charAt(1) !== ':');
+
+       // UNC paths are always absolute
+       return Boolean(result[2] || isUnc);
+}
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/legacy-libs/grpc/node_modules/path-is-absolute/license b/legacy-libs/grpc/node_modules/path-is-absolute/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/path-is-absolute/package.json b/legacy-libs/grpc/node_modules/path-is-absolute/package.json
new file mode 100644 (file)
index 0000000..0e28975
--- /dev/null
@@ -0,0 +1,83 @@
+{
+  "_args": [
+    [
+      "path-is-absolute@1.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "path-is-absolute@1.0.1",
+  "_id": "path-is-absolute@1.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+  "_location": "/grpc/path-is-absolute",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "path-is-absolute@1.0.1",
+    "name": "path-is-absolute",
+    "escapedName": "path-is-absolute",
+    "rawSpec": "1.0.1",
+    "saveSpec": null,
+    "fetchSpec": "1.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/rimraf/glob"
+  ],
+  "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+  },
+  "dependencies": {},
+  "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+  "devDependencies": {
+    "xo": "^0.16.0"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/path-is-absolute#readme",
+  "keywords": [
+    "path",
+    "paths",
+    "file",
+    "dir",
+    "absolute",
+    "isabsolute",
+    "is-absolute",
+    "built-in",
+    "util",
+    "utils",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "is",
+    "detect",
+    "check"
+  ],
+  "license": "MIT",
+  "name": "path-is-absolute",
+  "optionalDependencies": {},
+  "readme": "# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)\n\n> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com)\n\n\n## Install\n\n```\n$ npm install --save path-is-absolute\n```\n\n\n## Usage\n\n```js\nconst pathIsAbsolute = require('path-is-absolute');\n\n// Running on Linux\npathIsAbsolute('/home/foo');\n//=> true\npathIsAbsolute('C:/Users/foo');\n//=> false\n\n// Running on Windows\npathIsAbsolute('C:/Users/foo');\n//=> true\npathIsAbsolute('/home/foo');\n//=> false\n\n// Running on any OS\npathIsAbsolute.posix('/home/foo');\n//=> true\npathIsAbsolute.posix('C:/Users/foo');\n//=> false\npathIsAbsolute.win32('C:/Users/foo');\n//=> true\npathIsAbsolute.win32('/home/foo');\n//=> false\n```\n\n\n## API\n\nSee the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).\n\n### pathIsAbsolute(path)\n\n### pathIsAbsolute.posix(path)\n\nPOSIX specific version.\n\n### pathIsAbsolute.win32(path)\n\nWindows specific version.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+  },
+  "scripts": {
+    "test": "xo && node test.js"
+  },
+  "version": "1.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/path-is-absolute/readme.md b/legacy-libs/grpc/node_modules/path-is-absolute/readme.md
new file mode 100644 (file)
index 0000000..8dbdf5f
--- /dev/null
@@ -0,0 +1,59 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com)
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+const pathIsAbsolute = require('path-is-absolute');
+
+// Running on Linux
+pathIsAbsolute('/home/foo');
+//=> true
+pathIsAbsolute('C:/Users/foo');
+//=> false
+
+// Running on Windows
+pathIsAbsolute('C:/Users/foo');
+//=> true
+pathIsAbsolute('/home/foo');
+//=> false
+
+// Running on any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+pathIsAbsolute.posix('C:/Users/foo');
+//=> false
+pathIsAbsolute.win32('C:/Users/foo');
+//=> true
+pathIsAbsolute.win32('/home/foo');
+//=> false
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+POSIX specific version.
+
+### pathIsAbsolute.win32(path)
+
+Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/process-nextick-args/index.js b/legacy-libs/grpc/node_modules/process-nextick-args/index.js
new file mode 100644 (file)
index 0000000..3eecf11
--- /dev/null
@@ -0,0 +1,45 @@
+'use strict';
+
+if (typeof process === 'undefined' ||
+    !process.version ||
+    process.version.indexOf('v0.') === 0 ||
+    process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
+  module.exports = { nextTick: nextTick };
+} else {
+  module.exports = process
+}
+
+function nextTick(fn, arg1, arg2, arg3) {
+  if (typeof fn !== 'function') {
+    throw new TypeError('"callback" argument must be a function');
+  }
+  var len = arguments.length;
+  var args, i;
+  switch (len) {
+  case 0:
+  case 1:
+    return process.nextTick(fn);
+  case 2:
+    return process.nextTick(function afterTickOne() {
+      fn.call(null, arg1);
+    });
+  case 3:
+    return process.nextTick(function afterTickTwo() {
+      fn.call(null, arg1, arg2);
+    });
+  case 4:
+    return process.nextTick(function afterTickThree() {
+      fn.call(null, arg1, arg2, arg3);
+    });
+  default:
+    args = new Array(len - 1);
+    i = 0;
+    while (i < args.length) {
+      args[i++] = arguments[i];
+    }
+    return process.nextTick(function afterTick() {
+      fn.apply(null, args);
+    });
+  }
+}
+
diff --git a/legacy-libs/grpc/node_modules/process-nextick-args/license.md b/legacy-libs/grpc/node_modules/process-nextick-args/license.md
new file mode 100644 (file)
index 0000000..c67e353
--- /dev/null
@@ -0,0 +1,19 @@
+# Copyright (c) 2015 Calvin Metcalf
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.**
diff --git a/legacy-libs/grpc/node_modules/process-nextick-args/package.json b/legacy-libs/grpc/node_modules/process-nextick-args/package.json
new file mode 100644 (file)
index 0000000..d1bf0b2
--- /dev/null
@@ -0,0 +1,55 @@
+{
+  "_from": "process-nextick-args@~2.0.0",
+  "_id": "process-nextick-args@2.0.1",
+  "_inBundle": false,
+  "_integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
+  "_location": "/grpc/process-nextick-args",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "process-nextick-args@~2.0.0",
+    "name": "process-nextick-args",
+    "escapedName": "process-nextick-args",
+    "rawSpec": "~2.0.0",
+    "saveSpec": null,
+    "fetchSpec": "~2.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+  "_shasum": "7820d9b16120cc55ca9ae7792680ae7dba6d7fe2",
+  "_shrinkwrap": null,
+  "_spec": "process-nextick-args@~2.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/readable-stream",
+  "author": "",
+  "bugs": {
+    "url": "https://github.com/calvinmetcalf/process-nextick-args/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "process.nextTick but always with args",
+  "devDependencies": {
+    "tap": "~0.2.6"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/calvinmetcalf/process-nextick-args",
+  "license": "MIT",
+  "main": "index.js",
+  "name": "process-nextick-args",
+  "optionalDependencies": {},
+  "readme": "process-nextick-args\n=====\n\n[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)\n\n```bash\nnpm install --save process-nextick-args\n```\n\nAlways be able to pass arguments to process.nextTick, no matter the platform\n\n```js\nvar pna = require('process-nextick-args');\n\npna.nextTick(function (a, b, c) {\n  console.log(a, b, c);\n}, 'step', 3,  'profit');\n```\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "version": "2.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/process-nextick-args/readme.md b/legacy-libs/grpc/node_modules/process-nextick-args/readme.md
new file mode 100644 (file)
index 0000000..ecb432c
--- /dev/null
@@ -0,0 +1,18 @@
+process-nextick-args
+=====
+
+[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)
+
+```bash
+npm install --save process-nextick-args
+```
+
+Always be able to pass arguments to process.nextTick, no matter the platform
+
+```js
+var pna = require('process-nextick-args');
+
+pna.nextTick(function (a, b, c) {
+  console.log(a, b, c);
+}, 'step', 3,  'profit');
+```
diff --git a/legacy-libs/grpc/node_modules/protobufjs/LICENSE b/legacy-libs/grpc/node_modules/protobufjs/LICENSE
new file mode 100644 (file)
index 0000000..75b5248
--- /dev/null
@@ -0,0 +1,202 @@
+\r
+                                 Apache License\r
+                           Version 2.0, January 2004\r
+                        http://www.apache.org/licenses/\r
+\r
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\r
+\r
+   1. Definitions.\r
+\r
+      "License" shall mean the terms and conditions for use, reproduction,\r
+      and distribution as defined by Sections 1 through 9 of this document.\r
+\r
+      "Licensor" shall mean the copyright owner or entity authorized by\r
+      the copyright owner that is granting the License.\r
+\r
+      "Legal Entity" shall mean the union of the acting entity and all\r
+      other entities that control, are controlled by, or are under common\r
+      control with that entity. For the purposes of this definition,\r
+      "control" means (i) the power, direct or indirect, to cause the\r
+      direction or management of such entity, whether by contract or\r
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the\r
+      outstanding shares, or (iii) beneficial ownership of such entity.\r
+\r
+      "You" (or "Your") shall mean an individual or Legal Entity\r
+      exercising permissions granted by this License.\r
+\r
+      "Source" form shall mean the preferred form for making modifications,\r
+      including but not limited to software source code, documentation\r
+      source, and configuration files.\r
+\r
+      "Object" form shall mean any form resulting from mechanical\r
+      transformation or translation of a Source form, including but\r
+      not limited to compiled object code, generated documentation,\r
+      and conversions to other media types.\r
+\r
+      "Work" shall mean the work of authorship, whether in Source or\r
+      Object form, made available under the License, as indicated by a\r
+      copyright notice that is included in or attached to the work\r
+      (an example is provided in the Appendix below).\r
+\r
+      "Derivative Works" shall mean any work, whether in Source or Object\r
+      form, that is based on (or derived from) the Work and for which the\r
+      editorial revisions, annotations, elaborations, or other modifications\r
+      represent, as a whole, an original work of authorship. For the purposes\r
+      of this License, Derivative Works shall not include works that remain\r
+      separable from, or merely link (or bind by name) to the interfaces of,\r
+      the Work and Derivative Works thereof.\r
+\r
+      "Contribution" shall mean any work of authorship, including\r
+      the original version of the Work and any modifications or additions\r
+      to that Work or Derivative Works thereof, that is intentionally\r
+      submitted to Licensor for inclusion in the Work by the copyright owner\r
+      or by an individual or Legal Entity authorized to submit on behalf of\r
+      the copyright owner. For the purposes of this definition, "submitted"\r
+      means any form of electronic, verbal, or written communication sent\r
+      to the Licensor or its representatives, including but not limited to\r
+      communication on electronic mailing lists, source code control systems,\r
+      and issue tracking systems that are managed by, or on behalf of, the\r
+      Licensor for the purpose of discussing and improving the Work, but\r
+      excluding communication that is conspicuously marked or otherwise\r
+      designated in writing by the copyright owner as "Not a Contribution."\r
+\r
+      "Contributor" shall mean Licensor and any individual or Legal Entity\r
+      on behalf of whom a Contribution has been received by Licensor and\r
+      subsequently incorporated within the Work.\r
+\r
+   2. Grant of Copyright License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      copyright license to reproduce, prepare Derivative Works of,\r
+      publicly display, publicly perform, sublicense, and distribute the\r
+      Work and such Derivative Works in Source or Object form.\r
+\r
+   3. Grant of Patent License. Subject to the terms and conditions of\r
+      this License, each Contributor hereby grants to You a perpetual,\r
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\r
+      (except as stated in this section) patent license to make, have made,\r
+      use, offer to sell, sell, import, and otherwise transfer the Work,\r
+      where such license applies only to those patent claims licensable\r
+      by such Contributor that are necessarily infringed by their\r
+      Contribution(s) alone or by combination of their Contribution(s)\r
+      with the Work to which such Contribution(s) was submitted. If You\r
+      institute patent litigation against any entity (including a\r
+      cross-claim or counterclaim in a lawsuit) alleging that the Work\r
+      or a Contribution incorporated within the Work constitutes direct\r
+      or contributory patent infringement, then any patent licenses\r
+      granted to You under this License for that Work shall terminate\r
+      as of the date such litigation is filed.\r
+\r
+   4. Redistribution. You may reproduce and distribute copies of the\r
+      Work or Derivative Works thereof in any medium, with or without\r
+      modifications, and in Source or Object form, provided that You\r
+      meet the following conditions:\r
+\r
+      (a) You must give any other recipients of the Work or\r
+          Derivative Works a copy of this License; and\r
+\r
+      (b) You must cause any modified files to carry prominent notices\r
+          stating that You changed the files; and\r
+\r
+      (c) You must retain, in the Source form of any Derivative Works\r
+          that You distribute, all copyright, patent, trademark, and\r
+          attribution notices from the Source form of the Work,\r
+          excluding those notices that do not pertain to any part of\r
+          the Derivative Works; and\r
+\r
+      (d) If the Work includes a "NOTICE" text file as part of its\r
+          distribution, then any Derivative Works that You distribute must\r
+          include a readable copy of the attribution notices contained\r
+          within such NOTICE file, excluding those notices that do not\r
+          pertain to any part of the Derivative Works, in at least one\r
+          of the following places: within a NOTICE text file distributed\r
+          as part of the Derivative Works; within the Source form or\r
+          documentation, if provided along with the Derivative Works; or,\r
+          within a display generated by the Derivative Works, if and\r
+          wherever such third-party notices normally appear. The contents\r
+          of the NOTICE file are for informational purposes only and\r
+          do not modify the License. You may add Your own attribution\r
+          notices within Derivative Works that You distribute, alongside\r
+          or as an addendum to the NOTICE text from the Work, provided\r
+          that such additional attribution notices cannot be construed\r
+          as modifying the License.\r
+\r
+      You may add Your own copyright statement to Your modifications and\r
+      may provide additional or different license terms and conditions\r
+      for use, reproduction, or distribution of Your modifications, or\r
+      for any such Derivative Works as a whole, provided Your use,\r
+      reproduction, and distribution of the Work otherwise complies with\r
+      the conditions stated in this License.\r
+\r
+   5. Submission of Contributions. Unless You explicitly state otherwise,\r
+      any Contribution intentionally submitted for inclusion in the Work\r
+      by You to the Licensor shall be under the terms and conditions of\r
+      this License, without any additional terms or conditions.\r
+      Notwithstanding the above, nothing herein shall supersede or modify\r
+      the terms of any separate license agreement you may have executed\r
+      with Licensor regarding such Contributions.\r
+\r
+   6. Trademarks. This License does not grant permission to use the trade\r
+      names, trademarks, service marks, or product names of the Licensor,\r
+      except as required for reasonable and customary use in describing the\r
+      origin of the Work and reproducing the content of the NOTICE file.\r
+\r
+   7. Disclaimer of Warranty. Unless required by applicable law or\r
+      agreed to in writing, Licensor provides the Work (and each\r
+      Contributor provides its Contributions) on an "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\r
+      implied, including, without limitation, any warranties or conditions\r
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\r
+      PARTICULAR PURPOSE. You are solely responsible for determining the\r
+      appropriateness of using or redistributing the Work and assume any\r
+      risks associated with Your exercise of permissions under this License.\r
+\r
+   8. Limitation of Liability. In no event and under no legal theory,\r
+      whether in tort (including negligence), contract, or otherwise,\r
+      unless required by applicable law (such as deliberate and grossly\r
+      negligent acts) or agreed to in writing, shall any Contributor be\r
+      liable to You for damages, including any direct, indirect, special,\r
+      incidental, or consequential damages of any character arising as a\r
+      result of this License or out of the use or inability to use the\r
+      Work (including but not limited to damages for loss of goodwill,\r
+      work stoppage, computer failure or malfunction, or any and all\r
+      other commercial damages or losses), even if such Contributor\r
+      has been advised of the possibility of such damages.\r
+\r
+   9. Accepting Warranty or Additional Liability. While redistributing\r
+      the Work or Derivative Works thereof, You may choose to offer,\r
+      and charge a fee for, acceptance of support, warranty, indemnity,\r
+      or other liability obligations and/or rights consistent with this\r
+      License. However, in accepting such obligations, You may act only\r
+      on Your own behalf and on Your sole responsibility, not on behalf\r
+      of any other Contributor, and only if You agree to indemnify,\r
+      defend, and hold each Contributor harmless for any liability\r
+      incurred by, or claims asserted against, such Contributor by reason\r
+      of your accepting any such warranty or additional liability.\r
+\r
+   END OF TERMS AND CONDITIONS\r
+\r
+   APPENDIX: How to apply the Apache License to your work.\r
+\r
+      To apply the Apache License to your work, attach the following\r
+      boilerplate notice, with the fields enclosed by brackets "[]"\r
+      replaced with your own identifying information. (Don't include\r
+      the brackets!)  The text should be enclosed in the appropriate\r
+      comment syntax for the file format. We also recommend that a\r
+      file or class name and description of purpose be included on the\r
+      same "printed page" as the copyright notice for easier\r
+      identification within third-party archives.\r
+\r
+   Copyright [yyyy] [name of copyright owner]\r
+\r
+   Licensed under the Apache License, Version 2.0 (the "License");\r
+   you may not use this file except in compliance with the License.\r
+   You may obtain a copy of the License at\r
+\r
+       http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/README.md b/legacy-libs/grpc/node_modules/protobufjs/README.md
new file mode 100644 (file)
index 0000000..1cf6661
--- /dev/null
@@ -0,0 +1,184 @@
+protobuf.js 5 [![Build Status](https://travis-ci.org/dcodeIO/protobuf.js.svg?branch=ProtoBuf5)](https://travis-ci.org/dcodeIO/protobuf.js) [![Donate](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=dcode%40dcode.io&item_name=%3C3%20protobuf.js)\r
+=====================================\r
+**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use\r
+in communications protocols, data storage, and more, originally designed at Google ([see](https://developers.google.com/protocol-buffers/docs/overview)).\r
+\r
+**protobuf.js** is a pure JavaScript implementation on top of [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js)\r
+including a .proto parser, message class building and simple encoding and decoding. There is no compilation step\r
+required, it's super easy to use and it works out of the box on .proto files!\r
+\r
+Getting started\r
+---------------\r
+* **Step 1:** Become familar with [Google's Protocol Buffers (protobuf)](https://developers.google.com/protocol-buffers/docs/overview)\r
+* **Step 2:** Read on or head straight to [our wiki](https://github.com/dcodeIO/protobuf.js/wiki) for additional information\r
+* **Step 3:** Build something cool! :-)\r
+\r
+Features\r
+--------\r
+* [RequireJS](http://requirejs.org/)/AMD compatible\r
+* [node.js](http://nodejs.org)/CommonJS compatible, also available via [npm](https://npmjs.org/package/protobufjs)\r
+* Browser compatible\r
+* [Closure Compiler](https://developers.google.com/closure/compiler/) compatible (fully annotated, [externs](https://github.com/dcodeIO/protobuf.js/tree/master/externs))\r
+* Fully documented using [jsdoc3](https://github.com/jsdoc3/jsdoc)\r
+* Well tested through [test.js](https://github.com/dcodeIO/test.js)\r
+* [bytebuffer.js](https://github.com/dcodeIO/bytebuffer.js) is the only production dependency\r
+* Fully compatible to the official implementation including advanced features\r
+* proto2js command line utility\r
+\r
+Installation\r
+------------\r
+\r
+### node.js / CommonJS\r
+\r
+```\r
+$> npm install protobufjs\r
+```\r
+\r
+```js\r
+var ProtoBuf = require("protobufjs");\r
+...\r
+```\r
+\r
+### RequireJS / AMD\r
+\r
+Requires [bytebuffer.js](http://github.com/dcodeIO/bytebuffer.js). Optionally depends on [long.js](https://github.com/dcodeIO/long.js) for long (int64) support. If you do not require long support, you can skip the Long.js config. RequireJS example:\r
+\r
+```js\r
+require(["protobuf"], function(ProtoBuf) {\r
+    ...\r
+});\r
+```\r
+\r
+Or as a module dependency:\r
+\r
+```js\r
+define("MyModule", ["protobuf"], function(ProtoBuf) {\r
+    ...\r
+});\r
+```\r
+\r
+### Browser\r
+\r
+Requires [bytebuffer.js](http://github.com/dcodeIO/bytebuffer.js). Optionally depends on [long.js](https://github.com/dcodeIO/long.js) for long (int64) support. If you do not require long support, you can skip the Long.js include.\r
+\r
+```html\r
+<!-- Order is important -->\r
+<script src="long.min.js"></script>\r
+<script src="bytebuffer.min.js"></script>\r
+<script src="protobuf.min.js"></script>\r
+```\r
+\r
+```js\r
+var ProtoBuf = dcodeIO.ProtoBuf;\r
+...\r
+```\r
+\r
+Getting started\r
+---------------\r
+\r
+*Note:* You'll need the full build to load .proto data. light builds are able to load JSON only.\r
+\r
+### Loading .proto files\r
+\r
+To load a .proto file, use:\r
+\r
+**API:** `ProtoBuf.loadProtoFile(source[, callback[, builder]]):Builder|undefined`\r
+\r
+```js\r
+// Synchronously\r
+var builder = ProtoBuf.loadProtoFile("path/to/file.proto");\r
+\r
+// Asynchronously\r
+ProtoBuf.loadProtoFile("path/to/file.proto", function(err, builder) {\r
+    ...\r
+});\r
+```\r
+\r
+`ProtoBuf.loadProtoFile` also accepts an object specifying the import root directory and the file to load as its first parameter: `{root: string, file: string}`. Additionally, an already created and then reused builder can be specified as the last argument, which is useful if all the definitions shall reside in a single namespace.\r
+\r
+### Loading .proto strings\r
+\r
+**API:** `ProtoBuf.loadProto(source[, builder][, filename]):Builder`\r
+\r
+```js\r
+var builder = ProtoBuf.loadProto(...protoString..., "myproto.proto");\r
+```\r
+\r
+### Loading JSON files and strings\r
+\r
+To load the (raw) JSON counterpart generated through pbjs, use `ProtoBuf.loadJsonFile` respectively `ProtoBuf.loadJson`. It's the same API.\r
+\r
+If you generated classes or modules with it, loading is done just by including respectively requiring the resulting file. Loading is handled transparently in this case.\r
+\r
+When using JSON only, you can use protobuf-light.js or protobuf-light.min.js instead, which do NOT include the ProtoBuf.DotProto package for parsing and are therefore smaller.\r
+\r
+Command line\r
+------------\r
+Since ProtoBuf.js 4.0.0 the library ships with the `pbjs` command line utility. With it it's possible to convert between .proto and JSON descriptors and even to generate the code required to access runtime structures as pure JS (classes), an AMD module or a CommonJS module.\r
+\r
+```\r
+\r
+ _ |_ . _\r
+|_)|_)|_)           ProtoBuf.js v4.0.0-b3 https://github.com/dcodeIO/ProtoBuf.js\r
+|     '\r
+\r
+CLI utility to convert between .proto and JSON syntax / to generate classes.\r
+\r
+Usage: pbjs <filename> [options] [> outFile]\r
+\r
+Options:\r
+  --help, -h        Show help  [boolean]\r
+  --version, -v     Show version number  [boolean]\r
+  --source, -s      Specifies the source format. Valid formats are:\r
+\r
+                       json       Plain JSON descriptor\r
+                       proto      Plain .proto descriptor\r
+\r
+  --target, -t      Specifies the target format. Valid formats are:\r
+\r
+                       amd        Runtime structures as AMD module\r
+                       commonjs   Runtime structures as CommonJS module\r
+                       js         Runtime structures\r
+                       json       Plain JSON descriptor\r
+                       proto      Plain .proto descriptor\r
+\r
+  --using, -u       Specifies an option to apply to the volatile builder\r
+                    loading the source, e.g. convertFieldsToCamelCase.\r
+  --min, -m         Minifies the output.  [default: false]\r
+  --path, -p        Adds a directory to the include path.\r
+  --legacy, -l      Includes legacy descriptors from google/protobuf/ if\r
+                    explicitly referenced.  [default: false]\r
+  --quiet, -q       Suppresses any informatory output to stderr.  [default: false]\r
+  --use, -i         Specifies an option to apply to the emitted builder\r
+                    utilized by your program, e.g. populateAccessors.\r
+  --exports, -e     Specifies the namespace to export. Defaults to export\r
+                    the root namespace.\r
+  --dependency, -d  Library dependency to use when generating classes.\r
+                    Defaults to 'protobufjs' for CommonJS, 'ProtoBuf' for\r
+                    AMD modules and 'dcodeIO.ProtoBuf' for classes.\r
+```\r
+\r
+Documentation\r
+-------------\r
+* [Read the official protobuf guide](https://developers.google.com/protocol-buffers/docs/overview)\r
+* [Read the API docs](http://htmlpreview.github.io/?https://raw.githubusercontent.com/dcodeIO/protobuf.js/ProtoBuf5/docs/ProtoBuf.html)\r
+* [Check out the examples](https://github.com/dcodeIO/protobuf.js/tree/ProtoBuf5/examples)\r
+\r
+Tests\r
+-----\r
+* [View source](https://github.com/dcodeIO/protobuf.js/blob/ProtoBuf5/tests/suite.js)\r
+\r
+Downloads\r
+---------\r
+* [Distributions](https://github.com/dcodeIO/protobuf.js/tree/ProtoBuf5/dist)\r
+* [ZIP-Archive](https://github.com/dcodeIO/protobuf.js/archive/ProtoBuf5.zip)\r
+* [Tarball](https://github.com/dcodeIO/protobuf.js/tarball/ProtoBuf5)\r
+\r
+CDN usage\r
+---------\r
+```html\r
+<script src="//cdn.rawgit.com/dcodeIO/protobuf.js/5.0.1/dist/protobuf.min.js"></script>\r
+```\r
+With the version pointing to the exact [release](https://github.com/dcodeIO/protobuf.js/releases) your project depends upon.\r
+\r
+**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/bin/pbjs b/legacy-libs/grpc/node_modules/protobufjs/bin/pbjs
new file mode 100644 (file)
index 0000000..73ebc4a
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env node\r
+process.exit(require(__dirname+"/../cli/pbjs.js").main(process.argv));\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/bower.json b/legacy-libs/grpc/node_modules/protobufjs/bower.json
new file mode 100644 (file)
index 0000000..30f074c
--- /dev/null
@@ -0,0 +1,19 @@
+{\r
+    "name": "protobuf",\r
+    "description": "Protocol Buffers for JavaScript. Finally.",\r
+    "version": "5.0.3",\r
+    "main": "dist/protobuf.js",\r
+    "license": "Apache-2.0",\r
+    "homepage": "http://dcode.io/",\r
+    "dependencies": {\r
+        "bytebuffer": "~5"\r
+    },\r
+    "keywords": ["net", "buffer", "protobuf", "serialization", "bytebuffer", "websocket", "webrtc"],\r
+    "ignore": [\r
+        "**/.*",\r
+        "node_modules",\r
+        "bower_components",\r
+        "test",\r
+        "tests"\r
+    ]\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs.js
new file mode 100644 (file)
index 0000000..e90798b
--- /dev/null
@@ -0,0 +1,281 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var ProtoBuf = require(__dirname+"/../index.js"),\r
+    fs       = require("fs"),\r
+    path     = require("path"),\r
+    cli      = require("ascli")("pbjs"),\r
+    yargs    = require("yargs"),\r
+    util     = require("./pbjs/util.js"),\r
+    glob     = require("glob"),\r
+    pkg      = require("../package.json");\r
+\r
+/**\r
+ * pbjs namespace.\r
+ * @exports pbjs\r
+ * @namespace\r
+ */\r
+var pbjs = module.exports = {};\r
+\r
+/**\r
+ * @alias pbjs/util\r
+ */\r
+pbjs.util = util;\r
+\r
+/**\r
+ * Source formats.\r
+ * @type {!Object.<string,!function(string,!Object.<string,*>)>}\r
+ */\r
+pbjs.sources = {};\r
+fs.readdirSync(__dirname+"/pbjs/sources").forEach(function(source) {\r
+    if (/\.js$/.test(source)) {\r
+        var src = require(__dirname + "/pbjs/sources/" + source);\r
+        if (!src.exclude)\r
+            pbjs.sources[source.substring(0, source.lastIndexOf("."))] = src;\r
+    }\r
+});\r
+\r
+/**\r
+ * Target formats.\r
+ * @type {!Object.<string,!function(!ProtoBuf.Builder,!Object.<string,*>)>}\r
+ */\r
+pbjs.targets = {};\r
+fs.readdirSync(__dirname+"/pbjs/targets").forEach(function(target) {\r
+    if (/\.js$/.test(target))\r
+        pbjs.targets[target.substring(0, target.lastIndexOf("."))] = require(__dirname + "/pbjs/targets/" + target);\r
+});\r
+\r
+/**\r
+ * Status code: Operation successful\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_OK = 0;\r
+\r
+/**\r
+ * Status code: Displaying usage information\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_USAGE = 1;\r
+\r
+/**\r
+ * Status code: No such include directory\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_INCLUDE_DIR = 2;\r
+\r
+/**\r
+ * Status code: No such source format\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_SOURCE_FORMAT = 3;\r
+\r
+/**\r
+ * Status code: No such target format\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_TARGET_FORMAT = 4;\r
+\r
+/**\r
+ * Status code: No such namespace\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_NAMESPACE = 5;\r
+\r
+/**\r
+ * Status code: Illegal dependency\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_DEPENDENCY = 6;\r
+\r
+/**\r
+ * Status code: No matching source files\r
+ * @type {number}\r
+ */\r
+pbjs.STATUS_ERR_NOSOURCE = 7;\r
+\r
+// Makes a table of available source or target formats\r
+function mkOptions(obj) {\r
+    var str = '';\r
+    Object.keys(obj).forEach(function(key) {\r
+        str += "\n   "+util.pad(key, 10)+" "+obj[key].description;\r
+    });\r
+    return str;\r
+}\r
+\r
+/**\r
+ * Executes the program.\r
+ * @param {!Array.<string>} argv Command line arguments\r
+ * @returns {number} Status code\r
+ */\r
+pbjs.main = function(argv) {\r
+    var options = yargs\r
+        .usage(cli("pb".white.bold+"js".green.bold, util.pad("ProtoBuf.js v"+pkg['version'], 31, true)+" "+pkg['homepage'].grey) + "\n" +\r
+                    "CLI utility to convert between .proto and JSON syntax / to generate classes.\n\n" +\r
+                    "Usage: ".white.bold+path.basename(argv[1]).green.bold+" <source files...> [options] [> outFile]")\r
+        .help("help")\r
+        .version(pkg["version"])\r
+        .wrap(null)\r
+        .options({\r
+            source: {\r
+                alias: "s",\r
+                describe: "Specifies the source format. Valid formats are:\n" + mkOptions(pbjs.sources)+"\n"\r
+            },\r
+            target: {\r
+                alias: "t",\r
+                describe: "Specifies the target format. Valid formats are:\n" + mkOptions(pbjs.targets)+"\n"\r
+            },\r
+            using: {\r
+                alias: "u",\r
+                describe: "Specifies an option to apply to the volatile builder\nloading the source, e.g. convertFieldsToCamelCase.",\r
+                type: "array"\r
+            },\r
+            min: {\r
+                alias: "m",\r
+                describe: "Minifies the output.",\r
+                default: false\r
+            },\r
+            path: {\r
+                alias: "p",\r
+                describe: "Adds a directory to the include path."\r
+            },\r
+            legacy: {\r
+                alias: "l",\r
+                describe: "Includes legacy descriptors from google/protobuf/ if\nexplicitly referenced.",\r
+                default: false\r
+            },\r
+            quiet: {\r
+                alias: "q",\r
+                describe: "Suppresses any informatory output to stderr.",\r
+                default: false\r
+            },\r
+            out: {\r
+                alias: "o",\r
+                describe: "Send output to file instead of stdout.",\r
+            },\r
+            use: {\r
+                alias: "i",\r
+                describe: "Specifies an option to apply to the emitted builder\nutilized by your program, e.g. populateAccessors.",\r
+                type: "array"\r
+            },\r
+            exports: {\r
+                alias: "e",\r
+                describe: "Specifies the namespace to export. Defaults to export\nthe root namespace."\r
+            },\r
+            dependency: {\r
+                alias: "d",\r
+                describe: "Library dependency to use when generating classes.\nDefaults to 'protobufjs' for CommonJS, 'protobuf' for\nAMD modules and 'dcodeIO.ProtoBuf' for classes."\r
+            }\r
+        })\r
+        .alias("help", "h")\r
+        .alias("version", "v")\r
+        .check(function (args) {\r
+            if (args.source && typeof pbjs.sources[args.source] !== "function") {\r
+                return "Unrecognized source format: '" + args.source + "'";\r
+            }\r
+\r
+            if (args.target && typeof pbjs.targets[args.target] !== "function") {\r
+                return "Unrecognized target format: '" + args.target + "'";\r
+            }\r
+\r
+            if (args._.length < 3) {\r
+                return "The filename to parse is required.";\r
+            }\r
+\r
+            return true;\r
+        })\r
+        .parse(argv);\r
+\r
+    var start = Date.now(),\r
+        sourceFiles = options._.slice(2);\r
+\r
+    // Expand glob expressions\r
+    var sourceFilesExpand = [];\r
+    for (var i=0; i<sourceFiles.length; ++i) {\r
+        var filename = sourceFiles[i],\r
+            files = glob.sync(filename);\r
+        if (files.length === 0) {\r
+            cli.fail("No matching source files: "+filename);\r
+            return pbjs.STATUS_ERR_NOSOURCE;\r
+        }\r
+        files.forEach(function(filename) {\r
+            if (sourceFilesExpand.indexOf(filename) === -1)\r
+                sourceFilesExpand.push(filename);\r
+        });\r
+    }\r
+    sourceFiles = sourceFilesExpand;\r
+\r
+    if (!options.target)\r
+        options.target = "json";\r
+\r
+    // Set up include paths\r
+    var includePath = Array.isArray(options['path']) ? options['path'] : (typeof options['path'] === 'string' ? [options['path']] : []);\r
+    sourceFiles.forEach(function (sourceFile) {\r
+        var dir = path.dirname(sourceFile);\r
+        if (includePath.indexOf(dir) === -1) {\r
+            includePath.push(dir);\r
+        }\r
+    });\r
+    includePath.forEach(function(path) { // Verify that include paths actually exist\r
+        if (!fs.existsSync(path)) {\r
+            if (!options.quiet)\r
+                cli.fail("No such include directory: "+path);\r
+            return pbjs.STATUS_ERR_INCLUDE_DIR;\r
+        }\r
+    });\r
+    options.path = includePath;\r
+\r
+    // Detect source format if not specified, then verify\r
+    if (typeof options.source !== 'string') {\r
+        var source = fs.readFileSync(sourceFiles[0]).toString("utf8").trim();\r
+        if (source.substring(0,1) === "{")\r
+            options.source = "json";\r
+        else\r
+            options.source = "proto";\r
+    }\r
+\r
+    // Load the source files to a common builder\r
+    var builder = pbjs.sources[options.source](sourceFiles, options);\r
+\r
+    // Validate exports and dependency if set\r
+    if (typeof options.exports !== 'undefined') {\r
+        if (!(builder.lookup(options.exports) instanceof ProtoBuf.Reflect.Namespace)) {\r
+            if (!options.quiet)\r
+                cli.fail("No such export namespace: "+options.exports);\r
+            return pbjs.STATUS_ERR_NAMESPACE;\r
+        }\r
+        if (options.exports.charAt(0) === '.')\r
+            options.exports = options.exports.substring(1);\r
+    }\r
+    if (typeof options.dependency !== 'undefined')\r
+        if (typeof options.dependency !== 'string' || !options.dependency) {\r
+            if (!options.quiet)\r
+                cli.fail("Illegal dependency: "+options.dependency);\r
+            return pbjs.STATUS_ERR_DEPENDENCY;\r
+        }\r
+\r
+    // Perform target conversion\r
+    if (!options.quiet)\r
+        cli.error("\nProcessing: "+sourceFiles.join(", ")+" ...\n");\r
+    var res = pbjs.targets[options.target](builder, options);\r
+    if (options.out){\r
+        fs.writeFileSync(options.out, res);\r
+    }else\r
+    process.stdout.write(res);\r
+    if (!options.quiet)\r
+        cli.error(""),\r
+        cli.ok("Converted "+sourceFiles.length+" source files to "+options.target+" ("+res.length+" bytes, "+(Date.now()-start)+" ms)");\r
+\r
+    return pbjs.STATUS_OK;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/binary.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/binary.js
new file mode 100644 (file)
index 0000000..2eb64c9
--- /dev/null
@@ -0,0 +1,130 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Binary descriptor set";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require(__dirname+"/../util.js"),\r
+    node_path = require("path"),\r
+    fs = require("fs");\r
+\r
+/**\r
+ * pbjs source: Binary descriptor\r
+ * @exports pbjs/sources/binary\r
+ * @function\r
+ * @param {!Array.<string>} filenames Source files\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {!ProtoBuf.Builder}\r
+ */\r
+var binary = module.exports = function(filenames, options) {\r
+    options = options || [];\r
+    var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),\r
+        loaded = [];\r
+    filenames.forEach(function(filename) {\r
+        var data = binary.load(filename, options, loaded);\r
+        builder["import"](data, filename);\r
+    });\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+binary.description = description;\r
+\r
+binary.exclude = true; // Unfinished\r
+\r
+/**\r
+ * Loads a binary descriptor.\r
+ * @param {string} filename Source file\r
+ * @param {!Object.<string,*>} options Options\r
+ * @param {!Array.<string>=} loaded An array of already loaded filenames\r
+ * @returns {*} JSON descriptor\r
+ */\r
+binary.load = function(filename, options, loaded) {\r
+    filename = node_path.resolve(filename);\r
+    loaded = loaded || [];\r
+    if (loaded.indexOf(filename) >= 0)\r
+        return {};\r
+    var data = fs.readFileSync(filename);\r
+    loaded.push(filename);\r
+    var builder = ProtoBuf.loadProtoFile(node_path.join("..", "..", "..", "src", "google", "protobuf", "descriptor.proto")),\r
+        FileDescriptorSet = builder.build("google.protobuf.FileDescriptorSet");\r
+    var fds = FileDescriptorSet.decode(data),\r
+        imports = [];\r
+    var json = {\r
+        "package": null,\r
+        "imports": imports\r
+    };\r
+    fds.file.forEach(function(fdp) {\r
+        imports.push(buildFileDescriptorProto(fdp));\r
+    });\r
+    return json;\r
+};\r
+\r
+function buildFileDescriptorProto(fdp) {\r
+    var pkg = fdp.package,\r
+        messages = [],\r
+        enums = [],\r
+        services = [],\r
+        extensions = [],\r
+        options = {},\r
+        imports = [];\r
+    fdp.message_type.forEach(function(dp) {\r
+        messages.push(buildMessageDescriptorProto(dp));\r
+    });\r
+    fdp.enum_type.forEach(function(edp) {\r
+        enums.push(buildEnumDescriptorProto(edp));\r
+    });\r
+    fdp.service.forEach(function(sdp) {\r
+        enums.push(buildServiceDescriptorProto(sdp));\r
+    });\r
+    fdp.extension.forEach(function(fdp) {\r
+        extensions.push(buildFieldDescriptorProtoAsExtension(fdp));\r
+    });\r
+    fdp.options.forEach(function(fo) {\r
+        // TODO\r
+    });\r
+    fdp.dependency.forEach(function(filename) {\r
+        // TODO\r
+    });\r
+    return {\r
+        "package": pkg,\r
+        "messages": messages,\r
+        "enums": enums,\r
+        "services": services,\r
+        "extensions": extensions,\r
+        "options": options,\r
+        "imports": imports\r
+    };\r
+}\r
+\r
+function buildMessageDescriptorProto(mdp) {\r
+\r
+}\r
+\r
+function buildEnumDescriptorProto(edp) {\r
+\r
+}\r
+\r
+function buildServiceDescriptorProto(sdp) {\r
+\r
+}\r
+\r
+function buildFieldDescriptorProtoAsExtension(fdp) {\r
+\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/json.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/json.js
new file mode 100644 (file)
index 0000000..86df60f
--- /dev/null
@@ -0,0 +1,84 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain JSON descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require(__dirname+"/../util.js"),\r
+    node_path = require("path"),\r
+    fs = require("fs");\r
+\r
+/**\r
+ * pbjs source: Plain JSON descriptor\r
+ * @exports pbjs/sources/json\r
+ * @function\r
+ * @param {!Array.<string>} filenames Source files\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {!ProtoBuf.Builder}\r
+ */\r
+var json = module.exports = function(filenames, options) {\r
+    options = options || [];\r
+    var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),\r
+        loaded = [];\r
+    filenames.forEach(function(filename) {\r
+        var data = json.load(filename, options, loaded);\r
+        builder["import"](data, filename);\r
+    });\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+json.description = description;\r
+\r
+/**\r
+ * Loads a JSON descriptor including imports.\r
+ * @param {string} filename Source file\r
+ * @param {!Object.<string,*>} options Options\r
+ * @param {!Array.<string>=} loaded An array of already loaded filenames\r
+ * @returns {*} JSON descriptor\r
+ */\r
+json.load = function(filename, options, loaded) {\r
+    filename = node_path.resolve(filename);\r
+    loaded = loaded || [];\r
+    if (loaded.indexOf(filename) >= 0)\r
+        return {};\r
+    var data = JSON.parse(fs.readFileSync(filename).toString("utf8")),\r
+        imports = data['imports'];\r
+    loaded.push(filename);\r
+    if (Array.isArray(imports)) {\r
+        for (var i=0; i<imports.length; ++i) {\r
+            // Skip pulled imports and legacy descriptors\r
+            if (typeof imports[i] !== 'string' || (util.isDescriptor(imports[i]) && !options.legacy))\r
+                continue;\r
+            // Merge imports, try include paths\r
+            (function() {\r
+                var path = options.path || [];\r
+                for (var j=0; j<path.length; ++j) {\r
+                    var import_filename = node_path.resolve(path[j] + "/", imports[i]);\r
+                    if (!fs.existsSync(import_filename))\r
+                        continue;\r
+                    imports[i] = json.load(import_filename, options, loaded);\r
+                    return;\r
+                }\r
+                throw Error("File not found: "+imports[i]);\r
+            })();\r
+        }\r
+    }\r
+    return data;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/proto.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/sources/proto.js
new file mode 100644 (file)
index 0000000..34fa3ee
--- /dev/null
@@ -0,0 +1,84 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain .proto descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require(__dirname+"/../util.js"),\r
+    fs = require("fs"),\r
+    node_path = require("path");\r
+\r
+/**\r
+ * pbjs source: Plain .proto descriptor\r
+ * @exports pbjs/sources/proto\r
+ * @function\r
+ * @param {!Array.<string>} filenames Source files\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {!ProtoBuf.Builder}\r
+ */\r
+var proto = module.exports = function(filenames, options) {\r
+    options = options || [];\r
+    var builder = ProtoBuf.newBuilder(util.getBuilderOptions(options, "using")),\r
+        loaded = [];\r
+    filenames.forEach(function(filename) {\r
+        var data = proto.load(filename, options, loaded);\r
+        builder["import"](data, filename);\r
+    });\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+proto.description = description;\r
+\r
+/**\r
+ * Loads a .proto descriptor including imports.\r
+ * @param {string} filename Source file\r
+ * @param {!Object.<string,*>} options Options\r
+ * @param {!Array.<string>=} loaded An array of already loaded filenames\r
+ * @returns {*} JSON descriptor\r
+ */\r
+proto.load = function(filename, options, loaded) {\r
+    filename = node_path.resolve(filename);\r
+    loaded = loaded || [];\r
+    if (loaded.indexOf(filename) >= 0)\r
+        return {};\r
+    var data = ProtoBuf.DotProto.Parser.parse(fs.readFileSync(filename).toString("utf8"));\r
+    loaded.push(filename);\r
+    if (Array.isArray(data['imports'])) {\r
+        var imports = data['imports'];\r
+        for (var i=0; i<imports.length; i++) {\r
+            // Skip pulled imports and legacy descriptors\r
+            if (typeof imports[i] !== 'string' || (util.isDescriptor(imports[i]) && !options.legacy))\r
+                continue;\r
+            // Merge imports, try include paths\r
+            (function() {\r
+                var path = options.path || [];\r
+                for (var j=0; j<path.length; ++j) {\r
+                    var import_filename = node_path.resolve(path[j] + "/", imports[i]);\r
+                    if (!fs.existsSync(import_filename))\r
+                        continue;\r
+                    imports[i] = proto.load(import_filename, options, loaded);\r
+                    return;\r
+                }\r
+                throw Error("File not found: "+imports[i]);\r
+            })();\r
+        }\r
+    }\r
+    return data;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/amd.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/amd.js
new file mode 100644 (file)
index 0000000..7d0f538
--- /dev/null
@@ -0,0 +1,45 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures as AMD module";\r
+\r
+var ProtoBuf = require("../../../index.js"),\r
+    util = require("../util.js"),\r
+    js = require("./js.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures as an AMD module\r
+ * @exports pbjs/targets/amd\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var amd = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        "define([", JSON.stringify(options.dependency || "protobuf"), "]", options.min ? "," : ", ",\r
+        "function(ProtoBuf)", options.min ? "{" : " {\n    ",\r
+        "return ProtoBuf",\r
+        util.indent(js.build(builder, options), options.min ? "" : "    "), options.min ? "" : "\n",\r
+        "});"\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+amd.description = description;\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/commonjs.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/commonjs.js
new file mode 100644 (file)
index 0000000..11d1cfd
--- /dev/null
@@ -0,0 +1,42 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures as CommonJS module";\r
+\r
+var util = require("../util.js"),\r
+    js = require("./js.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures as a CommonJS module\r
+ * @exports pbjs/targets/commonjs\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var commonjs = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        "module.exports", options.min ? "=" : " = ",\r
+        "require(", JSON.stringify(options.dependency || "protobufjs"), ")",\r
+        js.build(builder, options)\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+commonjs.description = description;\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/js.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/js.js
new file mode 100644 (file)
index 0000000..4f9ee12
--- /dev/null
@@ -0,0 +1,63 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Runtime structures";\r
+\r
+var util = require("../util.js"),\r
+    json = require("./json.js");\r
+\r
+/**\r
+ * pbjs target: Runtime structures\r
+ * @exports pbjs/targets/js\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var js = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    var varName = "_root";\r
+    if (options.exports)\r
+        varName = options.exports.substring(options.exports.lastIndexOf(".")+1);\r
+    return [\r
+        "var ", varName, options.min ? "=" : " = ", options.dependency || "dcodeIO.ProtoBuf",\r
+        js.build(builder, options)\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Builds the core js target.\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+js.build = function(builder, options) {\r
+    options = options || {};\r
+    return [\r
+        ".newBuilder(",\r
+        JSON.stringify(util.getBuilderOptions(options, "use"), null, options.min ? 0 : 4),\r
+        ")['import'](",\r
+        json(builder, options),\r
+        ").build(",\r
+        typeof options.exports === 'string' ? JSON.stringify(options.exports.split(".")) : "",\r
+        ");"\r
+    ].join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+js.description = description;\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/json.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/json.js
new file mode 100644 (file)
index 0000000..39e4c6d
--- /dev/null
@@ -0,0 +1,260 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain JSON descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require("../util.js");\r
+\r
+/**\r
+ * pbjs target: Plain JSON descriptor\r
+ * @exports pbjs/targets/json\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var json = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    builder.resolveAll();\r
+\r
+    // Set the pointer to the lowest common namespace (with options)\r
+    var ptr = builder.ns;\r
+    while (ptr.children.length === 1 && Object.keys(ptr.options).length === 0 && ptr.children[0].className === "Namespace")\r
+        ptr = ptr.children[0];\r
+\r
+    // Start by building the package namespace\r
+    var pkg = ptr.fqn().substring(1),\r
+        out = {\r
+            "package": pkg !== "" ? pkg : null\r
+        };\r
+    buildNamespace(ptr, out);\r
+    return JSON.stringify(out, null, options.min ? 0 : 4);\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+json.description = description;\r
+\r
+/**\r
+ * Builds all structures in a namespace.\r
+ * @param {!ProtoBuf.Reflect.Namespace} ns Namespace to build\r
+ * @param {!Object.<string,*>} out Extended output object\r
+ */\r
+function buildNamespace(ns, out) {\r
+    var messages, enums, services;\r
+    util.extend(out, {\r
+        "syntax"   : ns.syntax   || 'proto2',\r
+        "options"  : out.options || {},\r
+        "messages" : messages = [],\r
+        "enums"    : enums    = [],\r
+        "services" : services = []\r
+    });\r
+    if (!(ns instanceof ProtoBuf.Reflect.Message))\r
+        out['isNamespace'] = true;\r
+    util.extend(out["options"], buildOptions(ns.options));\r
+    ns.getChildren(ProtoBuf.Reflect.Enum).forEach(function(enm) {\r
+        enums.push(buildEnum(enm));\r
+    });\r
+    if (enums.length === 0)\r
+        delete out["enums"];\r
+    ns.getChildren(ProtoBuf.Reflect.Message).forEach(function(msg) {\r
+        messages.push(buildMessage(msg));\r
+    });\r
+    ns.getChildren(ProtoBuf.Reflect.Service).forEach(function(svc) {\r
+        services.push(buildService(svc));\r
+    });\r
+    if (services.length === 0)\r
+        delete out["services"];\r
+    Array.prototype.push.apply(messages, buildExtensions(ns));\r
+    ns.getChildren(ProtoBuf.Reflect.Namespace).forEach(function(innerNs) {\r
+        if (innerNs.className !== "Namespace")\r
+            return;\r
+        var emptyMessage = {\r
+            "name": innerNs.name,\r
+            "fields": []\r
+        };\r
+        buildNamespace(innerNs, emptyMessage);\r
+        messages.push(emptyMessage);\r
+    });\r
+    if (messages.length === 0)\r
+        delete out["messages"];\r
+    if (Object.keys(out["options"]).length === 0)\r
+        delete out["options"];\r
+}\r
+\r
+/**\r
+ * Builds extensions declared in the specified namespace.\r
+ * @param {!ProtoBuf.Reflect.Namespace} ns Namespace\r
+ * @returns {!Array.<!*>}\r
+ */\r
+function buildExtensions(ns) {\r
+    var exts = util.groupExtensions(ns);\r
+    if (exts === null)\r
+        return [];\r
+    var messages = [];\r
+    Object.keys(exts).forEach(function(extFqn) {\r
+        var extMsg = ns.resolve(extFqn),\r
+            extFields = exts[extFqn];\r
+        var fields, ext = {\r
+            "ref"    : ns.qn(extMsg),\r
+            "fields" : fields = []\r
+        };\r
+        extFields.forEach(function(extField) {\r
+            fields.push(buildMessageField(extField));\r
+        });\r
+        messages.push(ext);\r
+    });\r
+    return messages;\r
+}\r
+\r
+/**\r
+ * Builds block-level options.\r
+ * @param {!Object.<string,*>} options Options\r
+ * @returns {!Object.<string,*>}\r
+ */\r
+function buildOptions(options) {\r
+    Object.keys(options = options || {}).forEach(function(key) {\r
+        var val = options[key];\r
+        switch (typeof val) {\r
+            case 'string':\r
+            case 'number':\r
+            case 'boolean':\r
+            case 'object':\r
+                break;\r
+            default:\r
+                throw Error("Illegal option type: "+typeof(val));\r
+        }\r
+    });\r
+    return options;\r
+}\r
+\r
+/**\r
+ * Builds a message.\r
+ * @param {!ProtoBuf.Reflect.Message} msg Message\r
+ * @returns {!*}\r
+ */\r
+function buildMessage(msg) {\r
+    var fields, oneofs;\r
+    var out = {\r
+        "name"     : msg.name,\r
+        "syntax"   : msg.syntax || 'proto2',\r
+        "options"  : {},\r
+        "fields"   : fields   = [],\r
+        "oneofs"   : oneofs   = {}\r
+    };\r
+    msg.getChildren(ProtoBuf.Reflect.Message.Field).forEach(function(fld) {\r
+        if (fld instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+            return;\r
+        fields.push(buildMessageField(fld));\r
+    });\r
+    msg.getChildren(ProtoBuf.Reflect.Message.OneOf).forEach(function(oneof) {\r
+        oneofs[oneof.name] = buildMessageOneof(oneof);\r
+    });\r
+    if (msg.extensions)\r
+        out["extensions"] = msg.extensions;\r
+    if (Object.keys(oneofs).length === 0)\r
+        delete out["oneofs"];\r
+    buildNamespace(msg, out);\r
+    return out;\r
+}\r
+\r
+/**\r
+ * Builds a message field.\r
+ * @param {!ProtoBuf.Reflect.Message.Field} fld Message field\r
+ * @returns {!*}\r
+ */\r
+function buildMessageField(fld) {\r
+    return {\r
+        "rule"    : fld.map ? "map" : (fld.repeated ? "repeated" : (fld.required ? "required" : "optional")),\r
+        "type"    : fld.resolvedType ? fld.parent.qn(fld.resolvedType) : fld.type['name'],\r
+        "keytype" : (typeof(fld.keyType) === 'string') ? fld.keyType : (fld.keyType !== null ? fld.keyType.name : undefined),\r
+        "name"    : fld instanceof ProtoBuf.Reflect.Message.ExtensionField ? fld.name.substring(fld.name.lastIndexOf(".")+1): fld.name,\r
+        "id"      : fld.id,\r
+        "options" : Object.keys(fld.options).length > 0 ? buildOptions(fld.options) : undefined,\r
+        "oneof"   : fld.oneof ? fld.oneof.name : undefined\r
+    };\r
+}\r
+\r
+/**\r
+ * Builds a message oneof.\r
+ * @param {!ProtoBuf.Reflect.message.OneOf} oneof Message oneof\r
+ * @returns {!Array.<!*>}\r
+ */\r
+function buildMessageOneof(oneof) {\r
+    var out = [];\r
+    oneof.fields.forEach(function(fld) {\r
+        out.push(fld.id);\r
+    });\r
+    return out;\r
+}\r
+\r
+/**\r
+ * Builds an enum.\r
+ * @param {!ProtoBuf.Reflect.Enum} enm Enum\r
+ * @returns {!*}\r
+ */\r
+function buildEnum(enm) {\r
+    var values;\r
+    var out = {\r
+        "name"    : enm.name,\r
+        "syntax"  : enm.syntax || 'proto2',\r
+        "values"  : values = []\r
+    };\r
+    enm.getChildren(ProtoBuf.Reflect.Enum.Value).forEach(function(val) {\r
+        values.push(buildEnumValue(val));\r
+    });\r
+    if (Object.keys(enm.options).length > 0)\r
+        out["options"] = buildOptions(enm.options);\r
+    return out;\r
+}\r
+\r
+/**\r
+ * Builds an enum value.\r
+ * @param {!ProtoBuf.Reflect.Enum.Value} val Enum value\r
+ * @returns {!*}\r
+ */\r
+function buildEnumValue(val) {\r
+    return {\r
+        "name"    : val.name,\r
+        "id"      : val.id\r
+    };\r
+}\r
+\r
+/**\r
+ * Builds a service.\r
+ * @param {!ProtoBuf.Reflect.Service} svc Service\r
+ * @returns {!*}\r
+ */\r
+function buildService(svc) {\r
+    var rpc;\r
+    var out = {\r
+        "name": svc.name,\r
+        "options": buildOptions(svc.options),\r
+        "rpc": rpc = {}\r
+    };\r
+    svc.getChildren(ProtoBuf.Reflect.Service.RPCMethod).forEach(function(mtd) {\r
+        rpc[mtd.name] = {\r
+            "request": svc.qn(mtd.resolvedRequestType),\r
+            "request_stream": mtd.requestStream,\r
+            "response": svc.qn(mtd.resolvedResponseType),\r
+            "response_stream": mtd.responseStream,\r
+            "options": buildOptions(mtd.options)\r
+        };\r
+    });\r
+    return out;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/proto.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/targets/proto.js
new file mode 100644 (file)
index 0000000..abfce36
--- /dev/null
@@ -0,0 +1,267 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var description = "Plain .proto descriptor";\r
+\r
+var ProtoBuf = require(__dirname+"/../../../index.js"),\r
+    util = require("../util.js");\r
+\r
+/**\r
+ * pbjs target: Plain .proto descriptor\r
+ * @exports pbjs/targets/proto\r
+ * @function\r
+ * @param {!ProtoBuf.Builder} builder Builder\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @returns {string}\r
+ */\r
+var proto = module.exports = function(builder, options) {\r
+    options = options || {};\r
+    builder.resolveAll();\r
+\r
+    // Set the pointer to the lowest common namespace (with options)\r
+    var ptr = builder.ns;\r
+    while (ptr.children.length === 1 && Object.keys(ptr.options).length === 0 && ptr.children[0].className === "Namespace")\r
+        ptr = ptr.children[0];\r
+\r
+    var out = [];\r
+\r
+    function trim() {\r
+        out[out.length-1] = out[out.length-1].replace(/\n{2,}$/, "\n");\r
+    }\r
+\r
+    // Builds a set of top level options\r
+    function buildOptions(opt, indent) {\r
+        var keys;\r
+        if ((keys = Object.keys(opt)).length === 0)\r
+            return;\r
+        keys.forEach(function(key) {\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push("option ", key, options.min ? "=" : " = ", value(opt[key]), options.min ? ";" : ";\n");\r
+        });\r
+        if (!options.min)\r
+            out[out.length-1] += "\n";\r
+    }\r
+\r
+    // Builds everything within a namespace\r
+    function buildNamespace(ns, indent) {\r
+        ns.getChildren(ProtoBuf.Reflect.Enum).forEach(function(enm) {\r
+            buildEnum(enm, indent);\r
+        });\r
+        ns.getChildren(ProtoBuf.Reflect.Message).forEach(function(msg) {\r
+            if (!msg.isGroup) // legacy groups are build within the respective field\r
+                buildMessage(msg, indent);\r
+        });\r
+        var exts = util.groupExtensions(ns);\r
+        if (exts !== null) {\r
+            Object.keys(exts).forEach(function(extFqn) {\r
+                var extMsg = ns.resolve(extFqn),\r
+                    extFields = exts[extFqn];\r
+                if (!options.min)\r
+                    out.push(indent);\r
+                out.push("extend ", ns.qn(extMsg), options.min ? "{" : " {\n");\r
+                extFields.forEach(function(extField) {\r
+                    buildMessageField(ns, extField, indent+"    ", false);\r
+                });\r
+                if (!options.min)\r
+                    out.push(indent);\r
+                out.push(options.min ? "}" : "}\n\n");\r
+            });\r
+        }\r
+        ns.getChildren(ProtoBuf.Reflect.Service).forEach(function(svc) {\r
+            buildService(svc, indent);\r
+        });\r
+        ns.getChildren(ProtoBuf.Reflect.Namespace).forEach(function(innerNs) {\r
+            if (innerNs.className !== "Namespace")\r
+                return;\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push("message ", innerNs.name, options.min ? "{" : " {\n");\r
+            buildNamespace(innerNs, indent+"    ");\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push(options.min ? "}" : "}\n");\r
+        });\r
+        trim();\r
+    }\r
+\r
+    // Builds a message\r
+    function buildMessage(msg, indent) {\r
+        if (!msg.isGroup) {\r
+            if (!options.min)\r
+                out.push(indent);\r
+            out.push("message ", msg.name);\r
+        }\r
+        out.push(options.min ? "{" : " {\n");\r
+        buildOptions(msg.options, indent+"    ");\r
+        var n = 0, oneofFields = [];\r
+        msg.getChildren(ProtoBuf.Reflect.Message.OneOf).forEach(function(oneof) {\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push("oneof ", oneof.name, options.min ? "{" : " {\n");\r
+            oneof.fields.forEach(function(fld) {\r
+                buildMessageField(msg, fld, indent+"        ", true);\r
+                oneofFields.push(fld);\r
+            });\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push(options.min ? "}" : "}\n");\r
+        });\r
+        msg.getChildren(ProtoBuf.Reflect.Message.Field).forEach(function(fld) {\r
+            if (fld instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+                return;\r
+            if (oneofFields.indexOf(fld) >= 0)\r
+                return;\r
+            buildMessageField(msg, fld, indent+"    ", false);\r
+            n++;\r
+        });\r
+        if (n > 0 && !options.min)\r
+            out[out.length-1] += "\n";\r
+        if (msg.extensions) { // array of ranges\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push("extensions ");\r
+            msg.extensions.forEach(function(range, index) {\r
+                if (index > 0)\r
+                    out.push(options.min ? "," : ", ");\r
+                out.push(value(range[0]));\r
+                if (range[1] !== range[0])\r
+                    out.push(" to ", range[1] === ProtoBuf.ID_MAX ? "max" : value(range[1]));\r
+            });\r
+            out.push(options.min ? ";" : ";\n\n");\r
+        }\r
+        buildNamespace(msg, indent+"    ");\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push(options.min ? "}" : "}\n\n");\r
+    }\r
+\r
+    // Builds a message field\r
+    function buildMessageField(msg, fld, indent, isOneOf) {\r
+        var isGroup = false;\r
+        if (!options.min)\r
+            out.push(indent);\r
+        if (!isOneOf)\r
+            out.push(fld.required ? "required " : (fld.repeated ? "repeated " : "optional "));\r
+        if (fld.resolvedType !== null) {\r
+            if (fld.resolvedType instanceof ProtoBuf.Reflect.Message && fld.resolvedType.isGroup) {\r
+                // inline legacy groups\r
+                out.push("group ");\r
+                isGroup = true;\r
+            }\r
+            out.push(msg.qn(fld.resolvedType));\r
+        } else\r
+            out.push(fld.type['name']);\r
+        if (!isGroup)\r
+            out.push(" ", fld instanceof ProtoBuf.Reflect.Message.ExtensionField ? fld.name.substring(fld.name.lastIndexOf(".")+1) : fld.name);\r
+        out.push(options.min ? "=" : " = ", fld.id);\r
+        if (isGroup) // inline\r
+            buildMessage(fld.resolvedType, indent);\r
+        else {\r
+            var keys = Object.keys(fld.options);\r
+            if (keys.length > 0) {\r
+                out.push(options.min ? "[" : " [");\r
+                var n = 0;\r
+                keys.forEach(function (key) {\r
+                    if (n > 0)\r
+                        out.push(options.min ? "," : ", ");\r
+                    out.push(key, options.min ? "=" : " = ",\r
+                        // BEWARE: Monkey patch for string enum defaults\r
+                        key === "default" && fld.type === ProtoBuf.TYPES["enum"] && typeof fld.options[key] === 'string' ? fld.options[key] : value(fld.options[key])\r
+                    );\r
+                    n++;\r
+                });\r
+                out.push("]");\r
+            }\r
+            out.push(options.min ? ";" : ";\n");\r
+        }\r
+    }\r
+\r
+    // Builds an enum\r
+    function buildEnum(enm, indent) {\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push("enum ", enm.name, options.min ? "{" : " {\n");\r
+        buildOptions(enm.options, indent+"    ");\r
+        enm.getChildren(ProtoBuf.Reflect.Enum.Value).forEach(function(val) {\r
+            if (!options.min)\r
+                out.push(indent, "    ");\r
+            out.push(val.name, options.min ? "=" : " = ", val.id, options.min? ";" : ";\n");\r
+        });\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push(options.min ? "}" : "}\n\n");\r
+    }\r
+\r
+    // Builds a service\r
+    function buildService(svc, indent) {\r
+        if (!options.min)\r
+            out.push(indent);\r
+        out.push("service ", svc.name, options.min ? "{" : " {\n");\r
+        buildOptions(svc.options, indent+"    ");\r
+        svc.getChildren(ProtoBuf.Reflect.Service.RPCMethod).forEach(function(rpc) {\r
+            if (!options.min)\r
+                out.push(indent+"    ");\r
+            out.push("rpc ", rpc.name, "(", svc.qn(rpc.resolvedRequestType), ") returns(", svc.qn(rpc.resolvedResponseType), ")");\r
+            var keys = Object.keys(rpc.options);\r
+            if (keys.length === 0) {\r
+                out.push(options.min ? ";" : ";\n")\r
+            } else {\r
+                out.push(options.min ? "{" : " {\n");\r
+                buildOptions(rpc.options, indent+"        ");\r
+                trim();\r
+                if (!options.min)\r
+                    out.push(indent+"    ");\r
+                out.push(options.min ? "}" : "}\n");\r
+            }\r
+            if (!options.min)\r
+                out[out.length-1] += "\n";\r
+        });\r
+        trim();\r
+        out.push(options.min ? "}" : "}\n");\r
+    }\r
+\r
+    // Start by building the package namespace\r
+    var pkg = ptr.fqn().substring(1);\r
+    if (pkg !== "")\r
+        out.push("package ", pkg, options.min ? ";" : ";\n\n");\r
+    buildOptions(ptr.options, "");\r
+    buildNamespace(ptr, "");\r
+    return out.join('');\r
+};\r
+\r
+/**\r
+ * Module description.\r
+ * @type {string}\r
+ */\r
+proto.description = description;\r
+\r
+/**\r
+ * Converts a JavaScript value to a .proto value.\r
+ * @param {*} v Value\r
+ * @returns {string} Dot proto value\r
+ */\r
+function value(v) {\r
+    switch (typeof v) {\r
+        case 'boolean':\r
+            return v ? 'true' : 'false';\r
+        case 'number':\r
+            return v.toString();\r
+        case 'string':\r
+            return '"'+v.replace(/"/g, '\\"')+'"';\r
+        default:\r
+            throw new Error("illegal value type: "+typeof(v));\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/util.js b/legacy-libs/grpc/node_modules/protobufjs/cli/pbjs/util.js
new file mode 100644 (file)
index 0000000..26715c1
--- /dev/null
@@ -0,0 +1,128 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+var ProtoBuf = require("../../index.js");\r
+\r
+/**\r
+ * Utility namespace.\r
+ * @exports pbjs/util\r
+ * @namespace\r
+ */\r
+var util = module.exports = {};\r
+\r
+/**\r
+ * Extracts builder options with the specified prefix from a set of CLI options.\r
+ * @param {!Object.<string,*>} options CLI options\r
+ * @param {string} prefix Prefix\r
+ * @returns {!Object.<string,*>}\r
+ */\r
+util.getBuilderOptions = function(options, prefix) {\r
+    if (!options[prefix])\r
+        return {};\r
+    var builderOptions = {};\r
+    options[prefix].forEach(function(kv) {\r
+        var key, val;\r
+        var p = kv.indexOf("=");\r
+        if (p < 0) {\r
+            key = kv;\r
+            val = true;\r
+        } else {\r
+            key = kv.substring(0, p);\r
+            val = kv.substring(p+1);\r
+            if (val === "true")\r
+                val = true;\r
+            else if (val === "false")\r
+                val = false;\r
+            else {\r
+                var intval = parseInt(val, 10);\r
+                if (intval == val)\r
+                    val = intval;\r
+            }\r
+        }\r
+        builderOptions[key] = val;\r
+    });\r
+    return builderOptions;\r
+};\r
+\r
+/**\r
+ * Pads a string to the specified length.\r
+ * @param {string} str String to pad\r
+ * @param {number} len Pad length\r
+ * @param {boolean=} left Whether to pad to the left, defaults to `false`\r
+ * @returns {string}\r
+ */\r
+util.pad = function(str, len, left) {\r
+    while (str.length < len)\r
+        left ? str = " "+str : str += " ";\r
+    return str;\r
+};\r
+\r
+/**\r
+ * Indents a string by the specified whitespace.\r
+ * @param {string} str String to indent\r
+ * @param {string|number} ws Whitespace string or number of whitespaces\r
+ * @returns {string}\r
+ */\r
+util.indent = function(str, ws) {\r
+    if (ws === 0 || ws === "")\r
+        return str;\r
+    var lines = str.split(/\r?\n/);\r
+    if (typeof ws === 'number') {\r
+        var n = ws; ws = "";\r
+        while (ws.length < n) ws += " ";\r
+    }\r
+    for (var i=1; i<lines.length; ++i)\r
+        lines[i] = ws+lines[i];\r
+    return lines.join("\n");\r
+};\r
+\r
+/**\r
+ * Extends an object with additional properties.\r
+ * @param {!Object.<string,*>} subject Subject to extend\r
+ * @param {!Object.<string,*>} extension Extensions to apply\r
+ */\r
+util.extend = function(subject, extension) {\r
+    Object.keys(extension).forEach(function(key) {\r
+        subject[key] = extension[key];\r
+    });\r
+};\r
+\r
+/**\r
+ * Groups extensions by extended message.\r
+ * @param {!ProtoBuf.Reflect.Namespace} ns Namespace\r
+ * @returns {?Object.<string,!Array.<!ProtoBuf.Reflect.Message.ExtensionField>>}\r
+ */\r
+util.groupExtensions = function(ns) {\r
+    var exts = {},\r
+        n = 0;\r
+    ns.getChildren(ProtoBuf.Reflect.Extension).forEach(function(ext) {\r
+        var msg = ext.field.parent,\r
+            fqn = msg.fqn();\r
+        if (!exts[fqn])\r
+            exts[fqn] = [];\r
+        exts[fqn].push(ext.field);\r
+        n++;\r
+    });\r
+    return n > 0 ? exts : null;\r
+};\r
+\r
+/**\r
+ * Tests if the specified import name is referencing an internal descriptor.\r
+ * @param {string} name Import name\r
+ * @returns {boolean}\r
+ */\r
+util.isDescriptor = function(name) {\r
+    return /^google\/protobuf\/descriptor/.test(name);\r
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.Message.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.Message.html
new file mode 100644 (file)
index 0000000..c129b8e
--- /dev/null
@@ -0,0 +1,5815 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Message</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Message</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Builder.html">.Builder</a>.</span>
+        
+        Message
+        </h2>
+        
+            <div class="class-description"><p>Barebone of all runtime messages.</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Message"><span class="type-signature"></span>new Message<span class="signature">(values, &hellip;var_args)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new runtime Message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>values</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">!Object.&lt;string, *></span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Preset values</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>var_args</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                    &lt;repeatable><br>
+                
+                </td>
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2375">line 2375</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be created</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".$options"><span class="type-signature">(static) </span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3052">line 3052</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".$type"><span class="type-signature">(static, non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3068">line 3068</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$options"><span class="type-signature"></span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3060">line 3060</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$type"><span class="type-signature">(non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3076">line 3076</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decode"><span class="type-signature">(static) </span>decode<span class="signature">(buffer, length<span class="signature-attributes">opt</span>, enc<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes a message from the specified buffer or string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">ArrayBuffer</span>
+|
+
+<span class="param-type">Buffer</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Buffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>length</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message length. Defaults to decode all the remainig data.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>enc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2928">line 2928</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Message.html#.decode64">ProtoBuf.Builder.Message.decode64</a></li>
+        
+            <li><a href="ProtoBuf.Builder.Message.html#.decodeHex">ProtoBuf.Builder.Message.decodeHex</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decode64"><span class="type-signature">(static) </span>decode64<span class="signature">(str)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes the message from the specified base64 encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>String to decode from</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2995">line 2995</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decodeDelimited"><span class="type-signature">(static) </span>decodeDelimited<span class="signature">(buffer, enc<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes a varint32 length-delimited message from the specified buffer or string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">ArrayBuffer</span>
+|
+
+<span class="param-type">Buffer</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Buffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>enc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2961">line 2961</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message or <code>null</code> if not enough bytes are available yet</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decodeHex"><span class="type-signature">(static) </span>decodeHex<span class="signature">(str)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes the message from the specified hex encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>String to decode from</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3009">line 3009</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are missing. The later still
+ returns the decoded message with missing fields in the <code>decoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".decodeJSON"><span class="type-signature">(static) </span>decodeJSON<span class="signature">(str)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes the message from a JSON string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>String to decode from</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3023">line 3023</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded or if required fields are
+missing.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$add"><span class="type-signature"></span>$add<span class="signature">(key, value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a value to a repeated field. This is an alias for <a href="ProtoBuf.Builder.Message.html#add">ProtoBuf.Builder.Message#add</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to add</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to assert the value or not (asserts by default)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2453">line 2453</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be added</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$encode"><span class="type-signature"></span>$encode<span class="signature">(buffer<span class="signature-attributes">opt</span>, noVerify<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to. Will create a new one and flip it if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noVerify</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not verify field values, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2651">line 2651</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Message.html#encode64">ProtoBuf.Builder.Message#encode64</a></li>
+        
+            <li><a href="ProtoBuf.Builder.Message.html#encodeHex">ProtoBuf.Builder.Message#encodeHex</a></li>
+        
+            <li><a href="ProtoBuf.Builder.Message.html#encodeAB">ProtoBuf.Builder.Message#encodeAB</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ByteBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as a ByteBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$get"><span class="type-signature"></span>$get<span class="signature">(key)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a field's value. This is an alias for <a href="ProtoBuf.Builder.Message.html#$get">ProtoBuf.Builder.Message#$get</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Key</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2541">line 2541</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If there is no such field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="$set"><span class="type-signature"></span>$set<span class="signature">(keyOrObj, value<span class="signature-attributes">opt</span>, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>keyOrObj</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>String key or plain object holding multiple values</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set if key is a string, otherwise omitted</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert the value, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2508">line 2508</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(key, value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a value to a repeated field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to add</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to assert the value or not (asserts by default)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2425">line 2425</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be added</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates the byte length of the message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2695">line 2695</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be calculated or if required fields are missing.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode64"><span class="type-signature"></span>encode64<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to a base64 encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2788">line 2788</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the underlying buffer cannot be encoded or if required fields are missing. The later
+ still returns the encoded base64 string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Base64 encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeAB"><span class="type-signature"></span>encodeAB<span class="signature">()</span><span class="type-signature"> &rarr; {ArrayBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to an ArrayBuffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2730">line 2730</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ArrayBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as ArrayBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ArrayBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeDelimited"><span class="type-signature"></span>encodeDelimited<span class="signature">(buffer<span class="signature-attributes">opt</span>, noVerify<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the varint32 length-delimited message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to. Will create a new one and flip it if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noVerify</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not verify field values, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2707">line 2707</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ByteBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as a ByteBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeHex"><span class="type-signature"></span>encodeHex<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to a hex encoded string.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2817">line 2817</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the underlying buffer cannot be encoded or if required fields are missing. The later
+ still returns the encoded hex string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Hex encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeJSON"><span class="type-signature"></span>encodeJSON<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes a message to JSON.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2918">line 2918</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>JSON string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encodeNB"><span class="type-signature"></span>encodeNB<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Buffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Directly encodes the message to a node Buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2759">line 2759</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded, not running under node.js or if required fields are
+ missing. The later still returns the encoded node Buffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Buffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(key, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a field's value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>key</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Key</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert for an actual field, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2520">line 2520</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If there is no such field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="get%5BSomeField%5D"><span class="type-signature">(abstract) </span>get[SomeField]<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2625">line 2625</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="get_%5Bsome_field%5D"><span class="type-signature">(abstract) </span>get_[some_field]<span class="signature">()</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2636">line 2636</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(keyOrObj, value<span class="signature-attributes">opt</span>, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a field's value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>keyOrObj</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>String key or plain object holding multiple values</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+|
+
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set if key is a string, otherwise omitted</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert for an actual field / proper value type, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2466">line 2466</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="set%5BSomeField%5D"><span class="type-signature">(abstract) </span>set[SomeField]<span class="signature">(value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert the value, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2597">line 2597</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="set_%5Bsome_field%5D"><span class="type-signature">(abstract) </span>set_[some_field]<span class="signature">(value, noAssert<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Sets a value. This method is present for each field, but only if there is no name conflict with
+ another field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to set</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noAssert</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not assert the value, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2611">line 2611</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toArrayBuffer"><span class="type-signature"></span>toArrayBuffer<span class="signature">()</span><span class="type-signature"> &rarr; {ArrayBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as an ArrayBuffer. This is an alias for <a href="ProtoBuf.Builder.Message.html#encodeAB">ProtoBuf.Builder.Message#encodeAB</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2748">line 2748</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded ArrayBuffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Encoded message as ArrayBuffer</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ArrayBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toBase64"><span class="type-signature"></span>toBase64<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as a base64 encoded string. This is an alias for <a href="ProtoBuf.Builder.Message.html#encode64">ProtoBuf.Builder.Message#encode64</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2806">line 2806</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded base64 string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Base64 encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toBuffer"><span class="type-signature"></span>toBuffer<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Buffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as a node Buffer. This is an alias for <a href="ProtoBuf.Builder.Message.html#encodeNB">ProtoBuf.Builder.Message#encodeNB</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2777">line 2777</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded node Buffer in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Buffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toHex"><span class="type-signature"></span>toHex<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message as a hex encoded string. This is an alias for <a href="ProtoBuf.Builder.Message.html#encodeHex">ProtoBuf.Builder.Message#encodeHex</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2835">line 2835</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be encoded or if required fields are missing. The later still
+ returns the encoded hex string in the <code>encoded</code> property on the error.</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Hex encoded string</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toRaw"><span class="type-signature"></span>toRaw<span class="signature">(binaryAsBase64<span class="signature-attributes">opt</span>, longsAsStrings)</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the message's raw payload.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>binaryAsBase64</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to include binary data as base64 strings instead of Buffers, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>longsAsStrings</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to encode longs as strings</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2909">line 2909</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Raw payload</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3039">line 3039</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation as of &quot;.Fully.Qualified.MessageName&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.Service.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.Service.html
new file mode 100644 (file)
index 0000000..85a5262
--- /dev/null
@@ -0,0 +1,961 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Service</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Service</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Builder.html">.Builder</a>.</span>
+        
+        Service
+        </h2>
+        
+            <div class="class-description"><p>Barebone of all runtime services.</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Service"><span class="type-signature"></span>new Service<span class="signature">(rpcImpl<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new runtime Service.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rpcImpl</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>RPC implementation receiving the method name and the message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4005">line 4005</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the service cannot be created</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".$options"><span class="type-signature">(static) </span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Service options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4108">line 4108</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".$type"><span class="type-signature">(static, non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4124">line 4124</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$options"><span class="type-signature"></span>$options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Service options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4116">line 4116</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="$type"><span class="type-signature">(non-null) </span>$type<span class="type-signature"> :<a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Reflection type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4132">line 4132</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="rpcImpl"><span class="type-signature">(non-null) </span>rpcImpl<span class="type-signature"> :function</span></h4>
+
+
+
+
+<div class="description">
+    <p>Service implementation.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4016">line 4016</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".%5BMethod%5D"><span class="type-signature">(abstract, static) </span>[Method]<span class="signature">(rpcImpl<span class="signature-attributes">non-null</span>, req, callback)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Asynchronously performs an RPC call using the given RPC implementation.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rpcImpl</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>RPC implementation</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>req</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Request</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Callback receiving
+ the error if any and the response either as a pre-parsed message or as its raw bytes</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4036">line 4036</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="%5BMethod%5D"><span class="type-signature">(abstract) </span>[Method]<span class="signature">(req, callback)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Asynchronously performs an RPC call using the instance's RPC implementation.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>req</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Request</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Callback receiving
+ the error if any and the response either as a pre-parsed message or as its raw bytes</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4047">line 4047</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Builder.html
new file mode 100644 (file)
index 0000000..9a5a4ee
--- /dev/null
@@ -0,0 +1,2800 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Builder</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Builder</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Builder
+        </h2>
+        
+            <div class="class-description"><p>Provides the functionality to build protocol messages.</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Builder"><span class="type-signature"></span>new Builder<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4295">line 4295</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Builder.Message.html">Message</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Builder.Service.html">Service</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="files"><span class="type-signature"></span>files<span class="type-signature"> :Array.&lt;string></span></h4>
+
+
+
+
+<div class="description">
+    <p>Imported files.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;string></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4330">line 4330</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="importRoot"><span class="type-signature">(nullable) </span>importRoot<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Import root override.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4337">line 4337</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="ns"><span class="type-signature"></span>ns<span class="type-signature"> :<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4302">line 4302</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4344">line 4344</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="ptr"><span class="type-signature"></span>ptr<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Namespace pointer.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4309">line 4309</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolved"><span class="type-signature"></span>resolved<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4316">line 4316</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="result"><span class="type-signature"></span>result<span class="type-signature"> :Object.&lt;string, (<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>|Object)>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>The current building result.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, (<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>|Object)></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4323">line 4323</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isEnum"><span class="type-signature">(static) </span>isEnum<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes an enum.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4390">line 4390</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isExtend"><span class="type-signature">(static) </span>isExtend<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes an extended message</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4419">line 4419</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isMessage"><span class="type-signature">(static) </span>isMessage<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes a message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4361">line 4361</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isMessageField"><span class="type-signature">(static) </span>isMessageField<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes a message field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4377">line 4377</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".isService"><span class="type-signature">(static) </span>isService<span class="signature">(def<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Tests if a definition most likely describes a service.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>def</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4406">line 4406</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="%22import%22%5D"><span class="type-signature"></span>"import"]<span class="signature">(json, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Imports another definition into this builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>json</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parsed import</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Imported file name</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4640">line 4640</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition or file cannot be imported</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(path<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>|!Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the protocol. This will first try to resolve all definitions and, if this has been successful,
+return the built package.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>path</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Specifies what to return. If omitted, the entire namespace will be returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4853">line 4853</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If a type could not be resolved</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+|
+
+<span class="param-type">!Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">(defs<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Creates the specified definitions at the current pointer position.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>defs</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Array.&lt;!Object></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Messages, enums or services to create</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4463">line 4463</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If a message definition is invalid</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="define"><span class="type-signature"></span>define<span class="signature">(namespace)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Defines a namespace on top of the current pointer position and places the pointer on it.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>namespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4444">line 4444</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="lookup"><span class="type-signature"></span>lookup<span class="signature">(path<span class="signature-attributes">opt</span>, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Similar to <a href="ProtoBuf.Builder.html#build">ProtoBuf.Builder#build</a>, but looks up the internal reflection descriptor.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>path</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Specifies what to return. If omitted, the entire namespace wiil be returned.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types like fields, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4881">line 4881</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Reflection descriptor or <code>null</code> if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="reset"><span class="type-signature"></span>reset<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resets the pointer to the root namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4433">line 4433</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolveAll"><span class="type-signature"></span>resolveAll<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves all namespace objects.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4769">line 4769</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If a type cannot be resolved</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>this</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4890">line 4890</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation as of &quot;Builder&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.Parser.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.Parser.html
new file mode 100644 (file)
index 0000000..81cdf38
--- /dev/null
@@ -0,0 +1,729 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Parser</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Parser</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.DotProto.html">.DotProto</a>.</span>
+        
+        Parser
+        </h2>
+        
+            <div class="class-description"><p>prototype parser</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Parser"><span class="type-signature"></span>new Parser<span class="signature">(source)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Parser.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>source</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Source</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line688">line 688</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="proto3"><span class="type-signature"></span>proto3<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether parsing proto3 or not.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line701">line 701</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="tn"><span class="type-signature">(non-null) </span>tn<span class="type-signature"> :<a href="ProtoBuf.DotProto.Tokenizer.html">ProtoBuf.DotProto.Tokenizer</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Tokenizer.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.DotProto.Tokenizer.html">ProtoBuf.DotProto.Tokenizer</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line695">line 695</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".parse"><span class="type-signature">(static) </span>parse<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Object}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Parses the specified source.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line796">line 796</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the source cannot be parsed</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="parse"><span class="type-signature"></span>parse<span class="signature">()</span><span class="type-signature"> &rarr; (non-null) {Object}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Parses the source.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line716">line 716</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the source cannot be parsed</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this parser.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1373">line 1373</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.Tokenizer.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.Tokenizer.html
new file mode 100644 (file)
index 0000000..8ad8727
--- /dev/null
@@ -0,0 +1,1140 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Tokenizer</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Tokenizer</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.DotProto.html">.DotProto</a>.</span>
+        
+        Tokenizer
+        </h2>
+        
+            <div class="class-description"><p>prototype tokenizer</p></div>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+    <h2>Constructor</h2>
+    
+
+    <h4 class="name" id="Tokenizer"><span class="type-signature"></span>new Tokenizer<span class="signature">(proto)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Tokenizer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>proto</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Proto to tokenize</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line495">line 495</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="index"><span class="type-signature"></span>index<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Current index.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line509">line 509</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="line"><span class="type-signature"></span>line<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Current line.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line516">line 516</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="source"><span class="type-signature"></span>source<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Source to parse.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line502">line 502</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="stack"><span class="type-signature">(non-null) </span>stack<span class="type-signature"> :Array.&lt;string></span></h4>
+
+
+
+
+<div class="description">
+    <p>Token stack.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;string></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line523">line 523</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="next"><span class="type-signature"></span>next<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the next token and advances by one.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line563">line 563</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Token or <code>null</code> on EOF</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="omit"><span class="type-signature"></span>omit<span class="signature">(expected)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Omits an optional token.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>expected</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Expected optional token</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line658">line 658</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p><code>true</code> if the token exists</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="peek"><span class="type-signature"></span>peek<span class="signature">()</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Peeks for the next token.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line632">line 632</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Token or <code>null</code> on EOF</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="skip"><span class="type-signature"></span>skip<span class="signature">(expected)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Skips a specific token and throws if it differs.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>expected</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Expected token</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line647">line 647</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the actual token differs</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line671">line 671</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation as of &quot;Tokenizer(index/length)&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.DotProto.html
new file mode 100644 (file)
index 0000000..744f956
--- /dev/null
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: DotProto</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: DotProto</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        DotProto
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>Utilities to parse .proto files.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line486">line 486</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.DotProto.Parser.html">Parser</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Element.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Element.html
new file mode 100644 (file)
index 0000000..24ef9bb
--- /dev/null
@@ -0,0 +1,555 @@
+<!DOCTYPE html>\r
+<html lang="en">\r
+<head>\r
+    <meta charset="utf-8">\r
+    <title>JSDoc: Class: Element</title>\r
+\r
+    <script src="scripts/prettify/prettify.js"> </script>\r
+    <script src="scripts/prettify/lang-css.js"> </script>\r
+    <!--[if lt IE 9]>\r
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>\r
+    <![endif]-->\r
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">\r
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">\r
+</head>\r
+\r
+<body>\r
+\r
+<div id="main">\r
+\r
+    <h1 class="page-title">Class: Element</h1>\r
+\r
+    \r
+\r
+\r
+\r
+<section>\r
+\r
+<header>\r
+    <h2>\r
+        <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>\r
+    \r
+    Element\r
+    </h2>\r
+    \r
+</header>\r
+\r
+<article>\r
+    <div class="container-overview">\r
+    \r
+\r
+    \r
+        \r
+<dt>\r
+    <h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax)</span><span class="type-signature"></span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+\r
+    \r
+    <div class="description">\r
+        <p>Constructs a new Element implementation that checks and converts values for a\r
+particular field type, as appropriate.</p>\r
+<p>An Element represents a single value: either the value of a singular field,\r
+or a value contained in one entry of a repeated field or map field. This\r
+class does not implement these higher-level concepts; it only encapsulates\r
+the low-level typechecking and conversion.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+        <h5>Parameters:</h5>\r
+        \r
+\r
+<table class="params">\r
+    <thead>\r
+    <tr>\r
+        \r
+        <th>Name</th>\r
+        \r
+\r
+        <th>Type</th>\r
+\r
+        \r
+\r
+        \r
+\r
+        <th class="last">Description</th>\r
+    </tr>\r
+    </thead>\r
+\r
+    <tbody>\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>type</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type"><a href="Object.html">Object</a></span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Resolved data type</p></td>\r
+        </tr>\r
+\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>resolvedType</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>\r
+|\r
+\r
+<span class="param-type">null</span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Resolved type, if relevant\r
+(e.g. submessage field).</p></td>\r
+        </tr>\r
+\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>isMapKey</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type">boolean</span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Is this element a Map key? The value will be\r
+converted to string form if so.</p></td>\r
+        </tr>\r
+\r
+    \r
+\r
+        <tr>\r
+            \r
+                <td class="name"><code>syntax</code></td>\r
+            \r
+\r
+            <td class="type">\r
+            \r
+                \r
+<span class="param-type">string</span>\r
+\r
+\r
+            \r
+            </td>\r
+\r
+            \r
+\r
+            \r
+\r
+            <td class="description last"><p>Syntax level of defining message type, e.g.,\r
+proto2 or proto3.</p></td>\r
+        </tr>\r
+\r
+    \r
+    </tbody>\r
+</table>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3754">line 3754</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+    \r
+    </div>\r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+     \r
+\r
+    \r
+\r
+    \r
+        <h3 class="subsection-title">Members</h3>\r
+\r
+        <dl>\r
+            \r
+<dt>\r
+    <h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Element is a map key.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type">boolean</span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3771">line 3771</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        \r
+            \r
+<dt>\r
+    <h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Element type reference to submessage or enum definition, if needed.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>\r
+|\r
+\r
+<span class="param-type">null</span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3765">line 3765</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        \r
+            \r
+<dt>\r
+    <h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Syntax level of defining message type, e.g., proto2 or proto3.</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type">string</span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3777">line 3777</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        \r
+            \r
+<dt>\r
+    <h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :<a href="Object.html">Object</a></span></h4>\r
+\r
+    \r
+</dt>\r
+<dd>\r
+    \r
+    <div class="description">\r
+        <p>Element type, as a string (e.g., int32).</p>\r
+    </div>\r
+    \r
+\r
+    \r
+        <h5>Type:</h5>\r
+        <ul>\r
+            <li>\r
+                \r
+<span class="param-type"><a href="Object.html">Object</a></span>\r
+\r
+\r
+            </li>\r
+        </ul>\r
+    \r
+\r
+    \r
+<dl class="details">\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+    <dt class="tag-source">Source:</dt>\r
+    <dd class="tag-source"><ul class="dummy"><li>\r
+        <a href="ProtoBuf.js.html">ProtoBuf.js</a>, <a href="ProtoBuf.js.html#line3759">line 3759</a>\r
+    </li></ul></dd>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</dl>\r
+\r
+\r
+    \r
+\r
+    \r
+</dd>\r
+\r
+        </dl>\r
+    \r
+\r
+    \r
+\r
+    \r
+\r
+    \r
+</article>\r
+\r
+</section>\r
+\r
+\r
+\r
+\r
+</div>\r
+\r
+<nav>\r
+    <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Element.html">Element</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>\r
+</nav>\r
+\r
+<br clear="both">\r
+\r
+<footer>\r
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-alpha9</a> on Mon Jun 01 2015 01:15:14 GMT+0200 (Mitteleuropäische Sommerzeit)\r
+</footer>\r
+\r
+<script> prettyPrint(); </script>\r
+<script src="scripts/linenumber.js"> </script>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Map.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Map.html
new file mode 100644 (file)
index 0000000..bf81c46
--- /dev/null
@@ -0,0 +1,561 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Map</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Map</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Map
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Map"><span class="type-signature"></span>new Map<span class="signature">(field<span class="signature-attributes">non-null</span>, contents<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Map. A Map is a container that is used to implement map
+fields on message objects. It closely follows the ES6 Map API; however,
+it is distinct because we do not want to depend on external polyfills or
+on ES6 itself.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>field</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ProtoBuf.Reflect.Field</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Map field</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>contents</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Initial contents</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4934">line 4934</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="field"><span class="type-signature">(non-null) </span>field<span class="type-signature"> :ProtoBuf.Reflect.Field</span></h4>
+
+
+
+
+<div class="description">
+    <p>The field corresponding to this map.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Reflect.Field</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4942">line 4942</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyElem"><span class="type-signature">(non-null) </span>keyElem<span class="type-signature"> :<a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Element instance corresponding to key type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4948">line 4948</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="map"><span class="type-signature">(non-null) </span>map<span class="type-signature"> :Object.&lt;string, {key: *, value: *}></span></h4>
+
+
+
+
+<div class="description">
+    <p>Internal map: stores mapping of (string form of key) -&gt; (key, value)
+pair.</p>
+<p>We provide map semantics for arbitrary key types, but we build on top
+of an Object, which has only string keys. In order to avoid the need
+to convert a string key back to its native type in many situations,
+we store the native key value alongside the value. Thus, we only need
+a one-way mapping from a key type to its string form that guarantees
+uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1
+=== K2).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, {key: *, value: *}></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4970">line 4970</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="valueElem"><span class="type-signature">(non-null) </span>valueElem<span class="type-signature"> :<a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Element instance corresponding to value type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Element.html">ProtoBuf.Reflect.Element</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4954">line 4954</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Element.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Element.html
new file mode 100644 (file)
index 0000000..b1ab780
--- /dev/null
@@ -0,0 +1,846 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Element</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Element</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Element
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Element"><span class="type-signature"></span>new Element<span class="signature">(type, resolvedType, isMapKey, syntax, name)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Element implementation that checks and converts values for a
+particular field type, as appropriate.</p>
+<p>An Element represents a single value: either the value of a singular field,
+or a value contained in one entry of a repeated field or map field. This
+class does not implement these higher-level concepts; it only encapsulates
+the low-level typechecking and conversion.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Resolved data type</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>resolvedType</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Resolved type, if relevant
+(e.g. submessage field).</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>isMapKey</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Is this element a Map key? The value will be
+converted to string form if so.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Syntax level of defining message type, e.g.,
+proto2 or proto3.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Name of the field containing this element (for error
+messages)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1720">line 1720</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="isMapKey"><span class="type-signature"></span>isMapKey<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element is a map key.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1738">line 1738</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Name of the field containing this element (for error messages)</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1750">line 1750</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element type reference to submessage or enum definition, if needed.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1732">line 1732</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level of defining message type, e.g., proto2 or proto3.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1744">line 1744</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :Object</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element type, as a string (e.g., int32).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1726">line 1726</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".defaultFieldValue"><span class="type-signature">(static) </span>defaultFieldValue<span class="signature">(type)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the default value for this field in proto3.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>the field type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1780">line 1780</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Default value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.Value.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.Value.html
new file mode 100644 (file)
index 0000000..a88498f
--- /dev/null
@@ -0,0 +1,1066 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Value</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Value</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Enum.html">.Enum</a>.</span>
+        
+        Value
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Value"><span class="type-signature"></span>new Value<span class="signature">(builder<span class="signature-attributes">non-null</span>, enm<span class="signature-attributes">non-null</span>, name, id)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Enum Value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>enm</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Enum.html">ProtoBuf.Reflect.Enum</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Enum reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>id</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Unique field id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3905">line 3905</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Unique enum value id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3918">line 3918</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Enum.html
new file mode 100644 (file)
index 0000000..366a0ab
--- /dev/null
@@ -0,0 +1,2722 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Enum</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Enum</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Enum
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Enum"><span class="type-signature"></span>new Enum<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Enum.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parent Reflect object</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Enum name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Enum options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3831">line 3831</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="object"><span class="type-signature"></span>object<span class="type-signature"> :Object.&lt;string, number>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Runtime enum object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, number></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3844">line 3844</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".getName"><span class="type-signature">(static) </span>getName<span class="signature">(enm<span class="signature-attributes">non-null</span>, value)</span><span class="type-signature"> &rarr; (nullable) {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the string name of an enum value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>enm</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ProtoBuf.Builder.Enum</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime enum</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Enum value</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3854">line 3854</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Name or <code>null</code> if not present</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild)</span><span class="type-signature"> &rarr; (non-null) {Object.&lt;string, number>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this enum and returns the runtime counterpart.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rebuild</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Whether to rebuild or not, defaults to false</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3874">line 3874</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, number></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Extension.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Extension.html
new file mode 100644 (file)
index 0000000..29afcb1
--- /dev/null
@@ -0,0 +1,360 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Extension</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Extension</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Extension
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Extension"><span class="type-signature"></span>new Extension<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, field<span class="signature-attributes">non-null</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>An extension (field).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Parent object</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Object name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>field</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Extension field</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3939">line 3939</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="field"><span class="type-signature">(non-null) </span>field<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Extended message field.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3947">line 3947</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.ExtensionField.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.ExtensionField.html
new file mode 100644 (file)
index 0000000..259cc9c
--- /dev/null
@@ -0,0 +1,3376 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: ExtensionField</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: ExtensionField</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Message.html">.Message</a>.</span>
+        
+        ExtensionField
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="ExtensionField"><span class="type-signature"></span>new ExtensionField<span class="signature">(builder<span class="signature-attributes">non-null</span>, message<span class="signature-attributes">non-null</span>, rule, type, name, id, options<span class="signature-attributes">opt, non-null</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message ExtensionField.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>rule</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Rule, one of requried, optional, repeated</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Data type, e.g. int32</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>id</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Unique field id</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3774">line 3774</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="defaultValue"><span class="type-signature"></span>defaultValue<span class="type-signature"> :*</span></h4>
+
+
+
+
+<div class="description">
+    <p>Default value.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">*</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#defaultValue">ProtoBuf.Reflect.Message.Field#defaultValue</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3384">line 3384</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="element"><span class="type-signature"></span>element<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element implementation. Created in build() after types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#element">ProtoBuf.Reflect.Message.Field#element</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3412">line 3412</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="extension"><span class="type-signature">(non-null) </span>extension<span class="type-signature"> :<a href="ProtoBuf.Reflect.Extension.html">ProtoBuf.Reflect.Extension</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Extension reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Extension.html">ProtoBuf.Reflect.Extension</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3782">line 3782</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Unique message field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#id">ProtoBuf.Reflect.Message.Field#id</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3369">line 3369</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyElement"><span class="type-signature"></span>keyElement<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Key element implementation, for map fields. Created in build() after
+types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#keyElement">ProtoBuf.Reflect.Message.Field#keyElement</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3420">line 3420</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyType"><span class="type-signature"></span>keyType<span class="type-signature"> :string|Object|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field key type. Type reference string if unresolved, protobuf
+type if resolved. Valid only if this.map === true, null otherwise.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#keyType">ProtoBuf.Reflect.Message.Field#keyType</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3347">line 3347</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="map"><span class="type-signature"></span>map<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field map flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#map">ProtoBuf.Reflect.Message.Field#map</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3339">line 3339</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="oneof"><span class="type-signature">(nullable) </span>oneof<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Enclosing OneOf.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#oneof">ProtoBuf.Reflect.Message.Field#oneof</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3391">line 3391</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#options">ProtoBuf.Reflect.Message.Field#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3377">line 3377</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="originalName"><span class="type-signature"></span>originalName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Original field name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#originalName">ProtoBuf.Reflect.Message.Field#originalName</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3405">line 3405</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="repeated"><span class="type-signature"></span>repeated<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field repeated flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#repeated">ProtoBuf.Reflect.Message.Field#repeated</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3332">line 3332</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="required"><span class="type-signature"></span>required<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field required flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#required">ProtoBuf.Reflect.Message.Field#required</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3325">line 3325</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved type reference inside the global namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#resolvedType">ProtoBuf.Reflect.Message.Field#resolvedType</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3362">line 3362</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level of this definition (e.g., proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#syntax">ProtoBuf.Reflect.Message.Field#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3398">line 3398</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :string|Object</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field type. Type reference string if unresolved, protobuf type if
+resolved. In a map field, this is the value type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#type">ProtoBuf.Reflect.Message.Field#type</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3355">line 3355</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates the length of this field's value on the network level.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#calculate">ProtoBuf.Reflect.Message.Field#calculate</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3635">line 3635</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(wireType, buffer, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decode the field value from the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>wireType</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Leading wire type</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#decode">ProtoBuf.Reflect.Message.Field#decode</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3693">line 3693</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be decoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded value: array for packed repeated fields, [key, value] for
+            map fields, or an individual value otherwise.</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(value, buffer, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the specified field value to the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#encode">ProtoBuf.Reflect.Message.Field#encode</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3561">line 3561</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be encoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The ByteBuffer for chaining</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="hasWirePresence"><span class="type-signature"></span>hasWirePresence<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines whether the field will have a presence on the wire given its
+value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#hasWirePresence">ProtoBuf.Reflect.Message.Field#hasWirePresence</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3509">line 3509</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Whether the field will be present on the wire</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="verifyValue"><span class="type-signature"></span>verifyValue<span class="signature">(value, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Checks if the given value can be set for this field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to check</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated value check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Message.Field.html#verifyValue">ProtoBuf.Reflect.Message.Field#verifyValue</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3461">line 3461</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set for this field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Verified, maybe adjusted, value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.Field.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.Field.html
new file mode 100644 (file)
index 0000000..f9c678b
--- /dev/null
@@ -0,0 +1,3308 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Field</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Field</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Message.html">.Message</a>.</span>
+        
+        Field
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Field"><span class="type-signature"></span>new Field<span class="signature">(builder<span class="signature-attributes">non-null</span>, message<span class="signature-attributes">non-null</span>, rule, keytype<span class="signature-attributes">nullable</span>, type, name, id, options<span class="signature-attributes">opt</span>, oneof<span class="signature-attributes">opt, non-null</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message Field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>rule</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Rule, one of requried, optional, repeated</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>keytype</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Key data type, if any.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Data type, e.g. int32</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Field name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>id</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Unique field id</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>oneof</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Enclosing OneOf</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level of this definition (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3312">line 3312</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="defaultValue"><span class="type-signature"></span>defaultValue<span class="type-signature"> :*</span></h4>
+
+
+
+
+<div class="description">
+    <p>Default value.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">*</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3384">line 3384</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="element"><span class="type-signature"></span>element<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Element implementation. Created in build() after types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3412">line 3412</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="id"><span class="type-signature"></span>id<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Unique message field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3369">line 3369</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyElement"><span class="type-signature"></span>keyElement<span class="type-signature"> :ProtoBuf.Element</span></h4>
+
+
+
+
+<div class="description">
+    <p>Key element implementation, for map fields. Created in build() after
+types are resolved.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">ProtoBuf.Element</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3420">line 3420</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="keyType"><span class="type-signature"></span>keyType<span class="type-signature"> :string|Object|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field key type. Type reference string if unresolved, protobuf
+type if resolved. Valid only if this.map === true, null otherwise.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3347">line 3347</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="map"><span class="type-signature"></span>map<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field map flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3339">line 3339</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="oneof"><span class="type-signature">(nullable) </span>oneof<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Enclosing OneOf.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.OneOf.html">ProtoBuf.Reflect.Message.OneOf</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3391">line 3391</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3377">line 3377</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="originalName"><span class="type-signature"></span>originalName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Original field name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3405">line 3405</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="repeated"><span class="type-signature"></span>repeated<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field repeated flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3332">line 3332</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="required"><span class="type-signature"></span>required<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field required flag.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3325">line 3325</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedType"><span class="type-signature"></span>resolvedType<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>|null</span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved type reference inside the global namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+|
+
+<span class="param-type">null</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3362">line 3362</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature"></span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level of this definition (e.g., proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3398">line 3398</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="type"><span class="type-signature"></span>type<span class="type-signature"> :string|Object</span></h4>
+
+
+
+
+<div class="description">
+    <p>Message field type. Type reference string if unresolved, protobuf type if
+resolved. In a map field, this is the value type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3355">line 3355</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates the length of this field's value on the network level.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3635">line 3635</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(wireType, buffer, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decode the field value from the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>wireType</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Leading wire type</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3693">line 3693</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be decoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded value: array for packed repeated fields, [key, value] for
+            map fields, or an individual value otherwise.</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(value, buffer, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes the specified field value to the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to encode to</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3561">line 3561</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the field cannot be encoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The ByteBuffer for chaining</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="hasWirePresence"><span class="type-signature"></span>hasWirePresence<span class="signature">(value, message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines whether the field will have a presence on the wire given its
+value.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Verified field value</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3509">line 3509</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Whether the field will be present on the wire</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">boolean</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="verifyValue"><span class="type-signature"></span>verifyValue<span class="signature">(value, skipRepeated<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Checks if the given value can be set for this field.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>value</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Value to check</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>skipRepeated</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to skip the repeated value check or not. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3461">line 3461</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the value cannot be set for this field</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Verified, maybe adjusted, value</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.OneOf.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.OneOf.html
new file mode 100644 (file)
index 0000000..9c8d042
--- /dev/null
@@ -0,0 +1,1043 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: OneOf</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: OneOf</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Message.html">.Message</a>.</span>
+        
+        OneOf
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="OneOf"><span class="type-signature"></span>new OneOf<span class="signature">(builder<span class="signature-attributes">non-null</span>, message<span class="signature-attributes">non-null</span>, name)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message OneOf.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Message reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>OneOf name</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3803">line 3803</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="fields"><span class="type-signature">(non-null) </span>fields<span class="type-signature"> :Array.&lt;!<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Enclosed fields.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;!<a href="ProtoBuf.Reflect.Message.Field.html">ProtoBuf.Reflect.Message.Field</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3811">line 3811</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Message.html
new file mode 100644 (file)
index 0000000..48292bc
--- /dev/null
@@ -0,0 +1,3477 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Message</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Message</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Message
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Message"><span class="type-signature"></span>new Message<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>, isGroup<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parent message or namespace</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>isGroup</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p><code>true</code> if this is a legacy group</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level of this definition (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2298">line 2298</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="clazz"><span class="type-signature">(nullable) </span>clazz<span class="type-signature"> :function</span></h4>
+
+
+
+
+<div class="description">
+    <p>Runtime message class.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2318">line 2318</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="extensions"><span class="type-signature"></span>extensions<span class="type-signature"> :!Array.&lt;number>|undefined</span></h4>
+
+
+
+
+<div class="description">
+    <p>Extensions range.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">!Array.&lt;number></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2311">line 2311</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="isGroup"><span class="type-signature"></span>isGroup<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether this is a legacy group or not.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2325">line 2325</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the message and returns the runtime counterpart, which is a fully functional class.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rebuild</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to rebuild or not, defaults to false</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line2365">line 2365</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Message class</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="calculate"><span class="type-signature"></span>calculate<span class="signature">(message<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Calculates a runtime message's byte length.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Runtime message to encode</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3156">line 3156</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If required fields are missing or the message cannot be calculated for another reason</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Byte length</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">number</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="decode"><span class="type-signature"></span>decode<span class="signature">(buffer, length<span class="signature-attributes">opt</span>, expectedGroupEndId<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Decodes an encoded message and returns the decoded message.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to decode from</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>length</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Message length. Defaults to decode all remaining data.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>expectedGroupEndId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Expected GROUPEND id if this is a legacy group</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3218">line 3218</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be decoded</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Decoded message</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="encode"><span class="type-signature"></span>encode<span class="signature">(message<span class="signature-attributes">non-null</span>, buffer, noVerify<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {ByteBuffer}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Encodes a runtime message's contents to the specified buffer.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>message</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.Message.html">ProtoBuf.Builder.Message</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Runtime message to encode</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>buffer</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">ByteBuffer</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>ByteBuffer to write to</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>noVerify</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to not verify field values, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3129">line 3129</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If required fields are missing or the message cannot be encoded for another reason</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The ByteBuffer for chaining</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">ByteBuffer</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Namespace.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Namespace.html
new file mode 100644 (file)
index 0000000..6fce414
--- /dev/null
@@ -0,0 +1,2371 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Namespace</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Namespace</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Namespace
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Namespace"><span class="type-signature"></span>new Namespace<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">nullable</span>, name, options<span class="signature-attributes">opt</span>, syntax<span class="signature-attributes">nullable</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Namespace parent</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Namespace name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Namespace options</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>syntax</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The syntax level of this definition (e.g., proto3)</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1500">line 1500</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, (function()|Object)>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace and returns the runtime counterpart.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1648">line 1648</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Runtime namespace</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, (function()|Object)></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.Method.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.Method.html
new file mode 100644 (file)
index 0000000..72a5ed3
--- /dev/null
@@ -0,0 +1,1202 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Method</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Method</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Service.html">.Service</a>.</span>
+        
+        Method
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Method"><span class="type-signature"></span>new Method<span class="signature">(builder<span class="signature-attributes">non-null</span>, svc<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Abstract service method.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>svc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Service</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Method name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4167">line 4167</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#className">ProtoBuf.Reflect.T#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature"></span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4180">line 4180</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the method's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4189">line 4189</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.RPCMethod.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.RPCMethod.html
new file mode 100644 (file)
index 0000000..e58dc69
--- /dev/null
@@ -0,0 +1,1768 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: RPCMethod</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: RPCMethod</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a><a href="ProtoBuf.Reflect.Service.html">.Service</a>.</span>
+        
+        RPCMethod
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="RPCMethod"><span class="type-signature"></span>new RPCMethod<span class="signature">(builder<span class="signature-attributes">non-null</span>, svc<span class="signature-attributes">non-null</span>, name, request, response, request_stream, response_stream, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>RPC service method.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>svc</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Service.html">ProtoBuf.Reflect.Service</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Service</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Method name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>request</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Request message name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>response</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Response message name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>request_stream</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether requests are streamed</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>response_stream</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether responses are streamed</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4217">line 4217</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Service.Method.html">ProtoBuf.Reflect.Service.Method</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Service.Method.html#className">ProtoBuf.Reflect.Service.Method#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature"></span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Service.Method.html#options">ProtoBuf.Reflect.Service.Method#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4180">line 4180</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="requestName"><span class="type-signature"></span>requestName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Request message name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4230">line 4230</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="requestStream"><span class="type-signature"></span>requestStream<span class="type-signature"> :bool</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether requests are streamed</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">bool</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4244">line 4244</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedRequestType"><span class="type-signature"></span>resolvedRequestType<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved request message type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4258">line 4258</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="resolvedResponseType"><span class="type-signature"></span>resolvedResponseType<span class="type-signature"> :<a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Resolved response message type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.Message.html">ProtoBuf.Reflect.Message</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4265">line 4265</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="responseName"><span class="type-signature"></span>responseName<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Response message name.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4237">line 4237</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="responseStream"><span class="type-signature"></span>responseStream<span class="type-signature"> :bool</span></h4>
+
+
+
+
+<div class="description">
+    <p>Whether responses are streamed</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">bool</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4251">line 4251</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#build">ProtoBuf.Reflect.T#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the method's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Service.Method.html#buildOpt">ProtoBuf.Reflect.Service.Method#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line4189">line 4189</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.Service.html
new file mode 100644 (file)
index 0000000..8cb30c6
--- /dev/null
@@ -0,0 +1,2565 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: Service</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: Service</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        Service
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="Service"><span class="type-signature"></span>new Service<span class="signature">(builder<span class="signature-attributes">non-null</span>, root<span class="signature-attributes">non-null</span>, name, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new Service.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>root</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Root</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Service name</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Options</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3969">line 3969</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+        <h3 class="subsection-title">Extends</h3>
+
+        
+
+
+    <ul>
+        <li><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></li>
+    </ul>
+
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#builder">ProtoBuf.Reflect.T#builder</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="children"><span class="type-signature">(non-null) </span>children<span class="type-signature"> :Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Children inside the namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#children">ProtoBuf.Reflect.Namespace#children</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1512">line 1512</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#className">ProtoBuf.Reflect.Namespace#className</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="clazz"><span class="type-signature">(nullable) </span>clazz<span class="type-signature"> :function</span></h4>
+
+
+
+
+<div class="description">
+    <p>Built runtime service class.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3981">line 3981</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#name">ProtoBuf.Reflect.T#name</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="options"><span class="type-signature">(non-null) </span>options<span class="type-signature"> :Object.&lt;string, *></span></h4>
+
+
+
+
+<div class="description">
+    <p>Options.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, *></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#options">ProtoBuf.Reflect.Namespace#options</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1518">line 1518</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#parent">ProtoBuf.Reflect.T#parent</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="syntax"><span class="type-signature">(non-null) </span>syntax<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Syntax level (e.g., proto2 or proto3).</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#syntax">ProtoBuf.Reflect.Namespace#syntax</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1524">line 1524</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="addChild"><span class="type-signature"></span>addChild<span class="signature">(child)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Adds a child to the namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>child</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#addChild">ProtoBuf.Reflect.Namespace#addChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1556">line 1556</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the child cannot be added (duplicate)</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">(rebuild<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {function}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the service and returns the runtime counterpart, which is a fully functional class.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>rebuild</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Whether to rebuild or not</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-overrides">Overrides:</dt>
+    <dd class="tag-overrides"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#build">ProtoBuf.Reflect.Namespace#build</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line3998">line 3998</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+    <dt class="tag-see">See:</dt>
+    <dd class="tag-see">
+        <ul>
+            <li><a href="ProtoBuf.Builder.Service.html">ProtoBuf.Builder.Service</a></li>
+        </ul>
+    </dd>
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the message cannot be built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Service class</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">function</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="buildOpt"><span class="type-signature"></span>buildOpt<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds the namespace's '$options' property.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#buildOpt">ProtoBuf.Reflect.Namespace#buildOpt</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1666">line 1666</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#fqn">ProtoBuf.Reflect.T#fqn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChild"><span class="type-signature"></span>getChild<span class="signature">(nameOrId)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets a child by its name or id.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>nameOrId</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">number</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Child name or id</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChild">ProtoBuf.Reflect.Namespace#getChild</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1576">line 1576</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The child or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getChildren"><span class="type-signature"></span>getChildren<span class="signature">(type<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns an array of the namespace's children.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>type</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Filter type (returns instances of this type only). Defaults to null (all children).</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getChildren">ProtoBuf.Reflect.Namespace#getChildren</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1539">line 1539</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">Array.&lt;<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a>></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="getOption"><span class="type-signature"></span>getOption<span class="signature">(name<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {*|Object.&lt;string, *>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Gets the value assigned to the option with the specified name.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Returns the option value if specified, otherwise all options are returned.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#getOption">ProtoBuf.Reflect.Namespace#getOption</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1687">line 1687</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>null} Option value or NULL if there is no such option</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">*</span>
+|
+
+<span class="param-type">Object.&lt;string, *></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="qn"><span class="type-signature"></span>qn<span class="signature">(t<span class="signature-attributes">non-null</span>)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Determines the shortest qualified name of the specified type, if any, relative to this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>t</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"><p>Reflection type</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#qn">ProtoBuf.Reflect.Namespace#qn</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1629">line 1629</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The shortest qualified name or, if there is none, the fqn</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="resolve"><span class="type-signature"></span>resolve<span class="signature">(qn, excludeNonNamespace<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (nullable) {<a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Resolves a reflect object inside of this namespace.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>qn</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">!Array.&lt;string></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Qualified name to resolve</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>excludeNonNamespace</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Excludes non-namespace types, defaults to <code>false</code></p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.Namespace.html#resolve">ProtoBuf.Reflect.Namespace#resolve</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1591">line 1591</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The resolved type or null if not found</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Reflect.Namespace.html">ProtoBuf.Reflect.Namespace</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+    <dt class="inherited-from">Inherited From:</dt>
+    <dd class="inherited-from"><ul class="dummy"><li>
+        <a href="ProtoBuf.Reflect.T.html#toString">ProtoBuf.Reflect.T#toString</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.T.html
new file mode 100644 (file)
index 0000000..bf94703
--- /dev/null
@@ -0,0 +1,953 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Class: T</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Class: T</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a><a href="ProtoBuf.Reflect.html">.Reflect</a>.</span>
+        
+        T
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+
+    
+
+    <h4 class="name" id="T"><span class="type-signature">(abstract) </span>new T<span class="signature">(builder<span class="signature-attributes">non-null</span>, parent<span class="signature-attributes">nullable</span>, name)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a Reflect base class.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder reference</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>parent</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+                    &lt;nullable><br>
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Parent object</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>name</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Object name</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1410">line 1410</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id="builder"><span class="type-signature">(non-null) </span>builder<span class="type-signature"> :<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Builder reference.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1417">line 1417</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="className"><span class="type-signature"></span>className<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fully qualified class name</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1438">line 1438</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="name"><span class="type-signature"></span>name<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>Object name in namespace.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1431">line 1431</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id="parent"><span class="type-signature">(nullable) </span>parent<span class="type-signature"> :<a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span></h4>
+
+
+
+
+<div class="description">
+    <p>Parent object.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type"><a href="ProtoBuf.Reflect.T.html">ProtoBuf.Reflect.T</a></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1424">line 1424</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id="build"><span class="type-signature"></span>build<span class="signature">()</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Builds this type.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1479">line 1479</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If this type cannot be built directly</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="fqn"><span class="type-signature"></span>fqn<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns the fully qualified name of this object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1452">line 1452</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Fully qualified name as of &quot;.PATH.TO.THIS&quot;</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id="toString"><span class="type-signature"></span>toString<span class="signature">(includeClass<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Returns a string representation of this Reflect object (its fully qualified name).</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>includeClass</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">boolean</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Set to true to include the class name. Defaults to false.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1470">line 1470</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>String representation</p>
+</div>
+
+
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Reflect.html
new file mode 100644 (file)
index 0000000..7bc4751
--- /dev/null
@@ -0,0 +1,159 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: Reflect</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: Reflect</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Reflect
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>Reflection types.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line1399">line 1399</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Reflect.Element.html">Element</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Enum.html">Enum</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Extension.html">Extension</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Message.html">Message</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.Service.html">Service</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.T.html">T</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+
+    
+
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Util.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.Util.html
new file mode 100644 (file)
index 0000000..46a958c
--- /dev/null
@@ -0,0 +1,692 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: Util</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: Util</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+            <span class="ancestors"><a href="ProtoBuf.html">ProtoBuf</a>.</span>
+        
+        Util
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>ProtoBuf utilities.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line304">line 304</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+
+     
+
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".IS_NODE"><span class="type-signature">(static, constant) </span>IS_NODE<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>Flag if running in node or not.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line312">line 312</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".fetch"><span class="type-signature">(static) </span>fetch<span class="signature">(path, callback<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {string|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Fetches a resource.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>path</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Resource path</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback receiving the resource's contents. If omitted the resource will
+  be fetched synchronously. If the request failed, contents will be null.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line350">line 350</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Resource contents if callback is omitted (null if the request failed), else undefined.</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".toCamelCase"><span class="type-signature">(static) </span>toCamelCase<span class="signature">(str)</span><span class="type-signature"> &rarr; {string}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Converts a string to camel case.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>str</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+
+            
+
+            <td class="description last"></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line400">line 400</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">string</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".XHR"><span class="type-signature">(static) </span>XHR<span class="signature">()</span><span class="type-signature"> &rarr; {XMLHttpRequest}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a XMLHttpRequest object.</p>
+</div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line322">line 322</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If XMLHttpRequest is not supported</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type">XMLHttpRequest</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.html
new file mode 100644 (file)
index 0000000..855809c
--- /dev/null
@@ -0,0 +1,3209 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Namespace: ProtoBuf</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Namespace: ProtoBuf</h1>
+
+    
+
+
+
+
+<section>
+
+<header>
+    
+        <h2>
+        ProtoBuf
+        </h2>
+        
+    
+</header>
+
+<article>
+    <div class="container-overview">
+    
+        
+            <div class="description"><p>The ProtoBuf namespace.</p></div>
+        
+
+        
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line40">line 40</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+        
+    
+    </div>
+
+    
+
+    
+
+    
+        <h3 class="subsection-title">Classes</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.Builder.html">Builder</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Map.html">Map</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+     
+
+    
+        <h3 class="subsection-title">Namespaces</h3>
+
+        <dl>
+            <dt><a href="ProtoBuf.DotProto.html">DotProto</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Reflect.html">Reflect</a></dt>
+            <dd></dd>
+        
+            <dt><a href="ProtoBuf.Util.html">Util</a></dt>
+            <dd></dd>
+        </dl>
+    
+
+    
+        <h3 class="subsection-title">Members</h3>
+
+        
+            
+<h4 class="name" id=".ByteBuffer"><span class="type-signature">(static, non-null) </span>ByteBuffer<span class="type-signature"> :function</span></h4>
+
+
+
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line46">line 46</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".convertFieldsToCamelCase"><span class="type-signature">(static) </span>convertFieldsToCamelCase<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>If set to <code>true</code>, field names will be converted from underscore notation to camel case. Defaults to <code>false</code>.
+ Must be set prior to parsing.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line274">line 274</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".ID_MAX"><span class="type-signature">(static, constant) </span>ID_MAX<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Maximum field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line266">line 266</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".ID_MIN"><span class="type-signature">(static, constant) </span>ID_MIN<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Minimum field id.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line258">line 258</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".Lang"><span class="type-signature">(static, non-null) </span>Lang<span class="type-signature"> :Object.&lt;string, !RegExp></span></h4>
+
+
+
+
+<div class="description">
+    <p>Language expressions.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, !RegExp></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line414">line 414</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".Long"><span class="type-signature">(static, nullable) </span>Long<span class="type-signature"> :function</span></h4>
+
+
+
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">function</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line52">line 52</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".MAP_KEY_TYPES"><span class="type-signature">(static, constant, non-null) </span>MAP_KEY_TYPES<span class="type-signature"> :Array.&lt;!Object.&lt;string, {name: string, wireType: number, defaultValue: *}>></span></h4>
+
+
+
+
+<div class="description">
+    <p>Valid map key types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;!Object.&lt;string, {name: string, wireType: number, defaultValue: *}>></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line236">line 236</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".PACKABLE_WIRE_TYPES"><span class="type-signature">(static, constant, non-null) </span>PACKABLE_WIRE_TYPES<span class="type-signature"> :Array.&lt;number></span></h4>
+
+
+
+
+<div class="description">
+    <p>Packable wire types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Array.&lt;number></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line123">line 123</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".populateAccessors"><span class="type-signature">(static) </span>populateAccessors<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by
+ setting this to <code>false</code> prior to building messages.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line282">line 282</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".populateDefaults"><span class="type-signature">(static) </span>populateDefaults<span class="type-signature"> :boolean</span></h4>
+
+
+
+
+<div class="description">
+    <p>By default, messages are populated with default values if a field is not present on the wire. To disable
+ this behavior, set this setting to <code>false</code>.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">boolean</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line290">line 290</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".TYPES"><span class="type-signature">(static, constant, non-null) </span>TYPES<span class="type-signature"> :Object.&lt;string, {name: string, wireType: number, defaultValue: *}></span></h4>
+
+
+
+
+<div class="description">
+    <p>Types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, {name: string, wireType: number, defaultValue: *}></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line136">line 136</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".VERSION"><span class="type-signature">(static, constant) </span>VERSION<span class="type-signature"> :string</span></h4>
+
+
+
+
+<div class="description">
+    <p>ProtoBuf.js version.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">string</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line60">line 60</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES"><span class="type-signature">(static, constant) </span>WIRE_TYPES<span class="type-signature"> :Object.&lt;string, number></span></h4>
+
+
+
+
+<div class="description">
+    <p>Wire types.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">Object.&lt;string, number></span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line68">line 68</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.BITS32"><span class="type-signature">(static, constant) </span>WIRE_TYPES.BITS32<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fixed 32 bits wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line115">line 115</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.BITS64"><span class="type-signature">(static, constant) </span>WIRE_TYPES.BITS64<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Fixed 64 bits wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line83">line 83</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.ENDGROUP"><span class="type-signature">(static, constant) </span>WIRE_TYPES.ENDGROUP<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>End group wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line107">line 107</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.LDELIM"><span class="type-signature">(static, constant) </span>WIRE_TYPES.LDELIM<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Length delimited wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line91">line 91</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.STARTGROUP"><span class="type-signature">(static, constant) </span>WIRE_TYPES.STARTGROUP<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Start group wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line99">line 99</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+            
+<h4 class="name" id=".WIRE_TYPES.VARINT"><span class="type-signature">(static) </span>WIRE_TYPES.VARINT<span class="type-signature"> :number</span></h4>
+
+
+
+
+<div class="description">
+    <p>Varint wire type.</p>
+</div>
+
+
+
+    <h5>Type:</h5>
+    <ul>
+        <li>
+            
+<span class="param-type">number</span>
+
+
+        </li>
+    </ul>
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line75">line 75</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+        
+    
+
+    
+        <h3 class="subsection-title">Methods</h3>
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadJson"><span class="type-signature">(static) </span>loadJson<span class="signature">(json, builder<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .json definition and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>json</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">*</span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>JSON definition</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The corresponding file name if known. Must be specified for imports.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5217">line 5217</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition cannot be parsed or built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder to create new messages</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadJsonFile"><span class="type-signature">(static) </span>loadJsonFile<span class="signature">(filename, callback<span class="signature-attributes">opt</span>, builder<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .json file and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Path to json file or an object specifying 'file' with
+ an overridden 'root' path for all imported files.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback that will receive <code>null</code> as the first and
+ the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
+ file will be read synchronously and this function will return the Builder.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5242">line 5242</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The Builder if synchronous (no callback specified, will be NULL if the
+  request has failed), else undefined</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadProto"><span class="type-signature">(static) </span>loadProto<span class="signature">(proto, builder<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto string and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>proto</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>.proto file contents</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The corresponding file name if known. Must be specified for imports.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5124">line 5124</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition cannot be parsed or built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder to create new messages</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".loadProtoFile"><span class="type-signature">(static) </span>loadProtoFile<span class="signature">(filename, callback<span class="signature-attributes">opt</span>, builder<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto file and returns the Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Path to proto file or an object specifying 'file' with
+ an overridden 'root' path for all imported files.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback that will receive <code>null</code> as the first and
+ the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
+ file will be read synchronously and this function will return the Builder.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5155">line 5155</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The Builder if synchronous (no callback specified, will be NULL if the
+  request has failed), else undefined</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".newBuilder"><span class="type-signature">(static) </span>newBuilder<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; (non-null) {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Constructs a new empty Builder.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>options</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">Object.&lt;string, *></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder options, defaults to global options set on ProtoBuf</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5199">line 5199</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".protoFromFile"><span class="type-signature">(static) </span>protoFromFile<span class="signature">(filename, callback<span class="signature-attributes">opt</span>, builder<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>|undefined}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto file and returns the Builder. This is an alias of <a href="ProtoBuf.html#.loadProtoFile">ProtoBuf.loadProtoFile</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Path to proto file or an object specifying 'file' with
+ an overridden 'root' path for all imported files.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>callback</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">function</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Callback that will receive <code>null</code> as the first and
+ the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the
+ file will be read synchronously and this function will return the Builder.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5190">line 5190</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>The Builder if synchronous (no callback specified, will be NULL if the
+  request has failed), else undefined</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">undefined</span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+            
+
+    
+
+    <h4 class="name" id=".protoFromString"><span class="type-signature">(static) </span>protoFromString<span class="signature">(proto, builder<span class="signature-attributes">opt</span>, filename<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a>}</span></h4>
+
+    
+
+
+
+<div class="description">
+    <p>Loads a .proto string and returns the Builder. This is an alias of <a href="ProtoBuf.html#.loadProto">ProtoBuf.loadProto</a>.</p>
+</div>
+
+
+
+
+
+
+
+
+
+    <h5>Parameters:</h5>
+    
+
+<table class="params">
+    <thead>
+    <tr>
+        
+        <th>Name</th>
+        
+
+        <th>Type</th>
+
+        
+        <th>Attributes</th>
+        
+
+        
+
+        <th class="last">Description</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    
+
+        <tr>
+            
+                <td class="name"><code>proto</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>.proto file contents</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>builder</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+|
+
+<span class="param-type">string</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>Builder to append to. Will create a new one if omitted.</p></td>
+        </tr>
+
+    
+
+        <tr>
+            
+                <td class="name"><code>filename</code></td>
+            
+
+            <td class="type">
+            
+                
+<span class="param-type">string</span>
+|
+
+<span class="param-type">Object</span>
+
+
+            
+            </td>
+
+            
+                <td class="attributes">
+                
+                    &lt;optional><br>
+                
+
+                
+
+                
+                </td>
+            
+
+            
+
+            <td class="description last"><p>The corresponding file name if known. Must be specified for imports.</p></td>
+        </tr>
+
+    
+    </tbody>
+</table>
+
+
+
+
+
+
+<dl class="details">
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+
+    
+    <dt class="tag-source">Source:</dt>
+    <dd class="tag-source"><ul class="dummy"><li>
+        <a href="protobuf.js.html">protobuf.js</a>, <a href="protobuf.js.html#line5141">line 5141</a>
+    </li></ul></dd>
+    
+
+    
+
+    
+
+    
+</dl>
+
+
+
+
+
+
+
+
+
+
+
+<h5>Throws:</h5>
+
+        
+
+<dl>
+    <dt>
+        <div class="param-desc">
+        <p>If the definition cannot be parsed or built</p>
+        </div>
+    </dt>
+    <dd></dd>
+    <dt>
+        <dl>
+            <dt>
+                Type
+            </dt>
+            <dd>
+                
+<span class="param-type">Error</span>
+
+
+            </dd>
+        </dl>
+    </dt>
+    <dd></dd>
+</dl>
+
+
+    
+
+
+<h5>Returns:</h5>
+
+        
+<div class="param-desc">
+    <p>Builder to create new messages</p>
+</div>
+
+
+
+<dl>
+    <dt>
+        Type
+    </dt>
+    <dd>
+        
+<span class="param-type"><a href="ProtoBuf.Builder.html">ProtoBuf.Builder</a></span>
+
+
+    </dd>
+</dl>
+
+    
+
+
+
+        
+    
+
+    
+
+    
+</article>
+
+</section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.js.html b/legacy-libs/grpc/node_modules/protobufjs/docs/ProtoBuf.js.html
new file mode 100644 (file)
index 0000000..c2f28a9
--- /dev/null
@@ -0,0 +1,5316 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Source: protobuf.js</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Source: protobuf.js</h1>
+
+    
+
+
+
+    
+    <section>
+        <article>
+            <pre class="prettyprint source linenums"><code>/*\r
+ Copyright 2013 Daniel Wirtz &lt;dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @license protobuf.js (c) 2013 Daniel Wirtz &lt;dcode@dcode.io>\r
+ * Released under the Apache License, Version 2.0\r
+ * see: https://github.com/dcodeIO/protobuf.js for details\r
+ */\r
+(function(global, factory) {\r
+\r
+    /* AMD */ if (typeof define === 'function' &amp;&amp; define["amd"])\r
+        define(["bytebuffer"], factory);\r
+    /* CommonJS */ else if (typeof require === "function" &amp;&amp; typeof module === "object" &amp;&amp; module &amp;&amp; module["exports"])\r
+        module["exports"] = factory(require("bytebuffer"), true);\r
+    /* Global */ else\r
+        (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);\r
+\r
+})(this, function(ByteBuffer, isCommonJS) {\r
+    "use strict";\r
+\r
+    /**\r
+     * The ProtoBuf namespace.\r
+     * @exports ProtoBuf\r
+     * @namespace\r
+     * @expose\r
+     */\r
+    var ProtoBuf = {};\r
+\r
+    /**\r
+     * @type {!function(new: ByteBuffer, ...[*])}\r
+     * @expose\r
+     */\r
+    ProtoBuf.ByteBuffer = ByteBuffer;\r
+\r
+    /**\r
+     * @type {?function(new: Long, ...[*])}\r
+     * @expose\r
+     */\r
+    ProtoBuf.Long = ByteBuffer.Long || null;\r
+\r
+    /**\r
+     * ProtoBuf.js version.\r
+     * @type {string}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.VERSION = "5.0.2";\r
+\r
+    /**\r
+     * Wire types.\r
+     * @type {Object.&lt;string,number>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES = {};\r
+\r
+    /**\r
+     * Varint wire type.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.VARINT = 0;\r
+\r
+    /**\r
+     * Fixed 64 bits wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.BITS64 = 1;\r
+\r
+    /**\r
+     * Length delimited wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.LDELIM = 2;\r
+\r
+    /**\r
+     * Start group wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r
+\r
+    /**\r
+     * End group wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r
+\r
+    /**\r
+     * Fixed 32 bits wire type.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.WIRE_TYPES.BITS32 = 5;\r
+\r
+    /**\r
+     * Packable wire types.\r
+     * @type {!Array.&lt;number>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.PACKABLE_WIRE_TYPES = [\r
+        ProtoBuf.WIRE_TYPES.VARINT,\r
+        ProtoBuf.WIRE_TYPES.BITS64,\r
+        ProtoBuf.WIRE_TYPES.BITS32\r
+    ];\r
+\r
+    /**\r
+     * Types.\r
+     * @dict\r
+     * @type {!Object.&lt;string,{name: string, wireType: number, defaultValue: *}>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.TYPES = {\r
+        // According to the protobuf spec.\r
+        "int32": {\r
+            name: "int32",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "uint32": {\r
+            name: "uint32",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "sint32": {\r
+            name: "sint32",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "int64": {\r
+            name: "int64",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+        },\r
+        "uint64": {\r
+            name: "uint64",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+        },\r
+        "sint64": {\r
+            name: "sint64",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+        },\r
+        "bool": {\r
+            name: "bool",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: false\r
+        },\r
+        "double": {\r
+            name: "double",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+            defaultValue: 0\r
+        },\r
+        "string": {\r
+            name: "string",\r
+            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+            defaultValue: ""\r
+        },\r
+        "bytes": {\r
+            name: "bytes",\r
+            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+            defaultValue: null // overridden in the code, must be a unique instance\r
+        },\r
+        "fixed32": {\r
+            name: "fixed32",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+            defaultValue: 0\r
+        },\r
+        "sfixed32": {\r
+            name: "sfixed32",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+            defaultValue: 0\r
+        },\r
+        "fixed64": {\r
+            name: "fixed64",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+            defaultValue:  ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+        },\r
+        "sfixed64": {\r
+            name: "sfixed64",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+            defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+        },\r
+        "float": {\r
+            name: "float",\r
+            wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+            defaultValue: 0\r
+        },\r
+        "enum": {\r
+            name: "enum",\r
+            wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+            defaultValue: 0\r
+        },\r
+        "message": {\r
+            name: "message",\r
+            wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+            defaultValue: null\r
+        },\r
+        "group": {\r
+            name: "group",\r
+            wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r
+            defaultValue: null\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Valid map key types.\r
+     * @type {!Array.&lt;!Object.&lt;string,{name: string, wireType: number, defaultValue: *}>>}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.MAP_KEY_TYPES = [\r
+        ProtoBuf.TYPES["int32"],\r
+        ProtoBuf.TYPES["sint32"],\r
+        ProtoBuf.TYPES["sfixed32"],\r
+        ProtoBuf.TYPES["uint32"],\r
+        ProtoBuf.TYPES["fixed32"],\r
+        ProtoBuf.TYPES["int64"],\r
+        ProtoBuf.TYPES["sint64"],\r
+        ProtoBuf.TYPES["sfixed64"],\r
+        ProtoBuf.TYPES["uint64"],\r
+        ProtoBuf.TYPES["fixed64"],\r
+        ProtoBuf.TYPES["bool"],\r
+        ProtoBuf.TYPES["string"],\r
+        ProtoBuf.TYPES["bytes"]\r
+    ];\r
+\r
+    /**\r
+     * Minimum field id.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.ID_MIN = 1;\r
+\r
+    /**\r
+     * Maximum field id.\r
+     * @type {number}\r
+     * @const\r
+     * @expose\r
+     */\r
+    ProtoBuf.ID_MAX = 0x1FFFFFFF;\r
+\r
+    /**\r
+     * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r
+     *  Must be set prior to parsing.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    ProtoBuf.convertFieldsToCamelCase = false;\r
+\r
+    /**\r
+     * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r
+     *  setting this to `false` prior to building messages.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    ProtoBuf.populateAccessors = true;\r
+\r
+    /**\r
+     * By default, messages are populated with default values if a field is not present on the wire. To disable\r
+     *  this behavior, set this setting to `false`.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    ProtoBuf.populateDefaults = true;\r
+\r
+    /**\r
+     * @alias ProtoBuf.Util\r
+     * @expose\r
+     */\r
+    ProtoBuf.Util = (function() {\r
+        "use strict";\r
+\r
+        /**\r
+         * ProtoBuf utilities.\r
+         * @exports ProtoBuf.Util\r
+         * @namespace\r
+         */\r
+        var Util = {};\r
+\r
+        /**\r
+         * Flag if running in node or not.\r
+         * @type {boolean}\r
+         * @const\r
+         * @expose\r
+         */\r
+        Util.IS_NODE = !!(\r
+            typeof process === 'object' &amp;&amp; process+'' === '[object process]' &amp;&amp; !process['browser']\r
+        );\r
+\r
+        /**\r
+         * Constructs a XMLHttpRequest object.\r
+         * @return {XMLHttpRequest}\r
+         * @throws {Error} If XMLHttpRequest is not supported\r
+         * @expose\r
+         */\r
+        Util.XHR = function() {\r
+            // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r
+            var XMLHttpFactories = [\r
+                function () {return new XMLHttpRequest()},\r
+                function () {return new ActiveXObject("Msxml2.XMLHTTP")},\r
+                function () {return new ActiveXObject("Msxml3.XMLHTTP")},\r
+                function () {return new ActiveXObject("Microsoft.XMLHTTP")}\r
+            ];\r
+            /** @type {?XMLHttpRequest} */\r
+            var xhr = null;\r
+            for (var i=0;i&lt;XMLHttpFactories.length;i++) {\r
+                try { xhr = XMLHttpFactories[i](); }\r
+                catch (e) { continue; }\r
+                break;\r
+            }\r
+            if (!xhr)\r
+                throw Error("XMLHttpRequest is not supported");\r
+            return xhr;\r
+        };\r
+\r
+        /**\r
+         * Fetches a resource.\r
+         * @param {string} path Resource path\r
+         * @param {function(?string)=} callback Callback receiving the resource's contents. If omitted the resource will\r
+         *   be fetched synchronously. If the request failed, contents will be null.\r
+         * @return {?string|undefined} Resource contents if callback is omitted (null if the request failed), else undefined.\r
+         * @expose\r
+         */\r
+        Util.fetch = function(path, callback) {\r
+            if (callback &amp;&amp; typeof callback != 'function')\r
+                callback = null;\r
+            if (Util.IS_NODE) {\r
+                var fs = require("fs");\r
+                if (callback) {\r
+                    fs.readFile(path, function(err, data) {\r
+                        if (err)\r
+                            callback(null);\r
+                        else\r
+                            callback(""+data);\r
+                    });\r
+                } else\r
+                    try {\r
+                        return fs.readFileSync(path);\r
+                    } catch (e) {\r
+                        return null;\r
+                    }\r
+            } else {\r
+                var xhr = Util.XHR();\r
+                xhr.open('GET', path, callback ? true : false);\r
+                // xhr.setRequestHeader('User-Agent', 'XMLHTTP/1.0');\r
+                xhr.setRequestHeader('Accept', 'text/plain');\r
+                if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');\r
+                if (callback) {\r
+                    xhr.onreadystatechange = function() {\r
+                        if (xhr.readyState != 4) return;\r
+                        if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 &amp;&amp; typeof xhr.responseText === 'string'))\r
+                            callback(xhr.responseText);\r
+                        else\r
+                            callback(null);\r
+                    };\r
+                    if (xhr.readyState == 4)\r
+                        return;\r
+                    xhr.send(null);\r
+                } else {\r
+                    xhr.send(null);\r
+                    if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 &amp;&amp; typeof xhr.responseText === 'string'))\r
+                        return xhr.responseText;\r
+                    return null;\r
+                }\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Converts a string to camel case.\r
+         * @param {string} str\r
+         * @returns {string}\r
+         * @expose\r
+         */\r
+        Util.toCamelCase = function(str) {\r
+            return str.replace(/_([a-zA-Z])/g, function ($0, $1) {\r
+                return $1.toUpperCase();\r
+            });\r
+        };\r
+\r
+        return Util;\r
+    })();\r
+\r
+    /**\r
+     * Language expressions.\r
+     * @type {!Object.&lt;string,!RegExp>}\r
+     * @expose\r
+     */\r
+    ProtoBuf.Lang = {\r
+\r
+        // Characters always ending a statement\r
+        DELIM: /[\s\{\}=;:\[\],'"\(\)&lt;>]/g,\r
+\r
+        // Field rules\r
+        RULE: /^(?:required|optional|repeated|map)$/,\r
+\r
+        // Field types\r
+        TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r
+\r
+        // Names\r
+        NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r
+\r
+        // Type definitions\r
+        TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r
+\r
+        // Type references\r
+        TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r
+\r
+        // Fully qualified type references\r
+        FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,\r
+\r
+        // All numbers\r
+        NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r
+\r
+        // Decimal numbers\r
+        NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r
+\r
+        // Hexadecimal numbers\r
+        NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r
+\r
+        // Octal numbers\r
+        NUMBER_OCT: /^0[0-7]+$/,\r
+\r
+        // Floating point numbers\r
+        NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r
+\r
+        // Booleans\r
+        BOOL: /^(?:true|false)$/i,\r
+\r
+        // Id numbers\r
+        ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+        // Negative id numbers (enum values)\r
+        NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+        // Whitespaces\r
+        WHITESPACE: /\s/,\r
+\r
+        // All strings\r
+        STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,\r
+\r
+        // Double quoted strings\r
+        STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,\r
+\r
+        // Single quoted strings\r
+        STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g\r
+    };\r
+\r
+    /**\r
+     * @alias ProtoBuf.DotProto\r
+     * @expose\r
+     */\r
+    ProtoBuf.DotProto = (function(ProtoBuf, Lang) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Utilities to parse .proto files.\r
+         * @exports ProtoBuf.DotProto\r
+         * @namespace\r
+         */\r
+        var DotProto = {};\r
+\r
+        /**\r
+         * Constructs a new Tokenizer.\r
+         * @exports ProtoBuf.DotProto.Tokenizer\r
+         * @class prototype tokenizer\r
+         * @param {string} proto Proto to tokenize\r
+         * @constructor\r
+         */\r
+        var Tokenizer = function(proto) {\r
+\r
+            /**\r
+             * Source to parse.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.source = proto+"";\r
+\r
+            /**\r
+             * Current index.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.index = 0;\r
+\r
+            /**\r
+             * Current line.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.line = 1;\r
+\r
+            /**\r
+             * Token stack.\r
+             * @type {!Array.&lt;string>}\r
+             * @expose\r
+             */\r
+            this.stack = [];\r
+\r
+            /**\r
+             * Opening character of the current string read, if any.\r
+             * @type {?string}\r
+             * @private\r
+             */\r
+            this._stringOpen = null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Tokenizer.prototype\r
+         * @inner\r
+         */\r
+        var TokenizerPrototype = Tokenizer.prototype;\r
+\r
+        /**\r
+         * Reads a string beginning at the current index.\r
+         * @return {string}\r
+         * @private\r
+         */\r
+        TokenizerPrototype._readString = function() {\r
+            var re = this._stringOpen === '"'\r
+                ? Lang.STRING_DQ\r
+                : Lang.STRING_SQ;\r
+            re.lastIndex = this.index - 1; // Include the open quote\r
+            var match = re.exec(this.source);\r
+            if (!match)\r
+                throw Error("unterminated string");\r
+            this.index = re.lastIndex;\r
+            this.stack.push(this._stringOpen);\r
+            this._stringOpen = null;\r
+            return match[1];\r
+        };\r
+\r
+        /**\r
+         * Gets the next token and advances by one.\r
+         * @return {?string} Token or `null` on EOF\r
+         * @expose\r
+         */\r
+        TokenizerPrototype.next = function() {\r
+            if (this.stack.length > 0)\r
+                return this.stack.shift();\r
+            if (this.index >= this.source.length)\r
+                return null;\r
+            if (this._stringOpen !== null)\r
+                return this._readString();\r
+\r
+            var repeat,\r
+                prev,\r
+                next;\r
+            do {\r
+                repeat = false;\r
+\r
+                // Strip white spaces\r
+                while (Lang.WHITESPACE.test(next = this.source.charAt(this.index))) {\r
+                    if (next === '\n')\r
+                        ++this.line;\r
+                    if (++this.index === this.source.length)\r
+                        return null;\r
+                }\r
+\r
+                // Strip comments\r
+                if (this.source.charAt(this.index) === '/') {\r
+                    ++this.index;\r
+                    if (this.source.charAt(this.index) === '/') { // Line\r
+                        while (this.source.charAt(++this.index) !== '\n')\r
+                            if (this.index == this.source.length)\r
+                                return null;\r
+                        ++this.index;\r
+                        ++this.line;\r
+                        repeat = true;\r
+                    } else if ((next = this.source.charAt(this.index)) === '*') { /* Block */\r
+                        do {\r
+                            if (next === '\n')\r
+                                ++this.line;\r
+                            if (++this.index === this.source.length)\r
+                                return null;\r
+                            prev = next;\r
+                            next = this.source.charAt(this.index);\r
+                        } while (prev !== '*' || next !== '/');\r
+                        ++this.index;\r
+                        repeat = true;\r
+                    } else\r
+                        return '/';\r
+                }\r
+            } while (repeat);\r
+\r
+            if (this.index === this.source.length)\r
+                return null;\r
+\r
+            // Read the next token\r
+            var end = this.index;\r
+            Lang.DELIM.lastIndex = 0;\r
+            var delim = Lang.DELIM.test(this.source.charAt(end++));\r
+            if (!delim)\r
+                while(end &lt; this.source.length &amp;&amp; !Lang.DELIM.test(this.source.charAt(end)))\r
+                    ++end;\r
+            var token = this.source.substring(this.index, this.index = end);\r
+            if (token === '"' || token === "'")\r
+                this._stringOpen = token;\r
+            return token;\r
+        };\r
+\r
+        /**\r
+         * Peeks for the next token.\r
+         * @return {?string} Token or `null` on EOF\r
+         * @expose\r
+         */\r
+        TokenizerPrototype.peek = function() {\r
+            if (this.stack.length === 0) {\r
+                var token = this.next();\r
+                if (token === null)\r
+                    return null;\r
+                this.stack.push(token);\r
+            }\r
+            return this.stack[0];\r
+        };\r
+\r
+        /**\r
+         * Skips a specific token and throws if it differs.\r
+         * @param {string} expected Expected token\r
+         * @throws {Error} If the actual token differs\r
+         */\r
+        TokenizerPrototype.skip = function(expected) {\r
+            var actual = this.next();\r
+            if (actual !== expected)\r
+                throw Error("illegal '"+actual+"', '"+expected+"' expected");\r
+        };\r
+\r
+        /**\r
+         * Omits an optional token.\r
+         * @param {string} expected Expected optional token\r
+         * @returns {boolean} `true` if the token exists\r
+         */\r
+        TokenizerPrototype.omit = function(expected) {\r
+            if (this.peek() === expected) {\r
+                this.next();\r
+                return true;\r
+            }\r
+            return false;\r
+        };\r
+\r
+        /**\r
+         * Returns a string representation of this object.\r
+         * @return {string} String representation as of "Tokenizer(index/length)"\r
+         * @expose\r
+         */\r
+        TokenizerPrototype.toString = function() {\r
+            return "Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")";\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Tokenizer\r
+         * @expose\r
+         */\r
+        DotProto.Tokenizer = Tokenizer;\r
+\r
+        /**\r
+         * Constructs a new Parser.\r
+         * @exports ProtoBuf.DotProto.Parser\r
+         * @class prototype parser\r
+         * @param {string} source Source\r
+         * @constructor\r
+         */\r
+        var Parser = function(source) {\r
+\r
+            /**\r
+             * Tokenizer.\r
+             * @type {!ProtoBuf.DotProto.Tokenizer}\r
+             * @expose\r
+             */\r
+            this.tn = new Tokenizer(source);\r
+\r
+            /**\r
+             * Whether parsing proto3 or not.\r
+             * @type {boolean}\r
+             */\r
+            this.proto3 = false;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Parser.prototype\r
+         * @inner\r
+         */\r
+        var ParserPrototype = Parser.prototype;\r
+\r
+        /**\r
+         * Parses the source.\r
+         * @returns {!Object}\r
+         * @throws {Error} If the source cannot be parsed\r
+         * @expose\r
+         */\r
+        ParserPrototype.parse = function() {\r
+            var topLevel = {\r
+                "name": "[ROOT]", // temporary\r
+                "package": null,\r
+                "messages": [],\r
+                "enums": [],\r
+                "imports": [],\r
+                "options": {},\r
+                "services": []\r
+                // "syntax": undefined\r
+            };\r
+            var token,\r
+                head = true,\r
+                weak;\r
+            try {\r
+                while (token = this.tn.next()) {\r
+                    switch (token) {\r
+                        case 'package':\r
+                            if (!head || topLevel["package"] !== null)\r
+                                throw Error("unexpected 'package'");\r
+                            token = this.tn.next();\r
+                            if (!Lang.TYPEREF.test(token))\r
+                                throw Error("illegal package name: " + token);\r
+                            this.tn.skip(";");\r
+                            topLevel["package"] = token;\r
+                            break;\r
+                        case 'import':\r
+                            if (!head)\r
+                                throw Error("unexpected 'import'");\r
+                            token = this.tn.peek();\r
+                            if (token === "public" || (weak = token === "weak")) // token ignored\r
+                                this.tn.next();\r
+                            token = this._readString();\r
+                            this.tn.skip(";");\r
+                            if (!weak) // import ignored\r
+                                topLevel["imports"].push(token);\r
+                            break;\r
+                        case 'syntax':\r
+                            if (!head)\r
+                                throw Error("unexpected 'syntax'");\r
+                            this.tn.skip("=");\r
+                            if ((topLevel["syntax"] = this._readString()) === "proto3")\r
+                                this.proto3 = true;\r
+                            this.tn.skip(";");\r
+                            break;\r
+                        case 'message':\r
+                            this._parseMessage(topLevel, null);\r
+                            head = false;\r
+                            break;\r
+                        case 'enum':\r
+                            this._parseEnum(topLevel);\r
+                            head = false;\r
+                            break;\r
+                        case 'option':\r
+                            this._parseOption(topLevel);\r
+                            break;\r
+                        case 'service':\r
+                            this._parseService(topLevel);\r
+                            break;\r
+                        case 'extend':\r
+                            this._parseExtend(topLevel);\r
+                            break;\r
+                        default:\r
+                            throw Error("unexpected '" + token + "'");\r
+                    }\r
+                }\r
+            } catch (e) {\r
+                e.message = "Parse error at line "+this.tn.line+": " + e.message;\r
+                throw e;\r
+            }\r
+            delete topLevel["name"];\r
+            return topLevel;\r
+        };\r
+\r
+        /**\r
+         * Parses the specified source.\r
+         * @returns {!Object}\r
+         * @throws {Error} If the source cannot be parsed\r
+         * @expose\r
+         */\r
+        Parser.parse = function(source) {\r
+            return new Parser(source).parse();\r
+        };\r
+\r
+        // ----- Conversion ------\r
+\r
+        /**\r
+         * Converts a numerical string to an id.\r
+         * @param {string} value\r
+         * @param {boolean=} mayBeNegative\r
+         * @returns {number}\r
+         * @inner\r
+         */\r
+        function mkId(value, mayBeNegative) {\r
+            var id = -1,\r
+                sign = 1;\r
+            if (value.charAt(0) == '-') {\r
+                sign = -1;\r
+                value = value.substring(1);\r
+            }\r
+            if (Lang.NUMBER_DEC.test(value))\r
+                id = parseInt(value);\r
+            else if (Lang.NUMBER_HEX.test(value))\r
+                id = parseInt(value.substring(2), 16);\r
+            else if (Lang.NUMBER_OCT.test(value))\r
+                id = parseInt(value.substring(1), 8);\r
+            else\r
+                throw Error("illegal id value: " + (sign &lt; 0 ? '-' : '') + value);\r
+            id = (sign*id)|0; // Force to 32bit\r
+            if (!mayBeNegative &amp;&amp; id &lt; 0)\r
+                throw Error("illegal id value: " + (sign &lt; 0 ? '-' : '') + value);\r
+            return id;\r
+        }\r
+\r
+        /**\r
+         * Converts a numerical string to a number.\r
+         * @param {string} val\r
+         * @returns {number}\r
+         * @inner\r
+         */\r
+        function mkNumber(val) {\r
+            var sign = 1;\r
+            if (val.charAt(0) == '-') {\r
+                sign = -1;\r
+                val = val.substring(1);\r
+            }\r
+            if (Lang.NUMBER_DEC.test(val))\r
+                return sign * parseInt(val, 10);\r
+            else if (Lang.NUMBER_HEX.test(val))\r
+                return sign * parseInt(val.substring(2), 16);\r
+            else if (Lang.NUMBER_OCT.test(val))\r
+                return sign * parseInt(val.substring(1), 8);\r
+            else if (val === 'inf')\r
+                return sign * Infinity;\r
+            else if (val === 'nan')\r
+                return NaN;\r
+            else if (Lang.NUMBER_FLT.test(val))\r
+                return sign * parseFloat(val);\r
+            throw Error("illegal number value: " + (sign &lt; 0 ? '-' : '') + val);\r
+        }\r
+\r
+        // ----- Reading ------\r
+\r
+        /**\r
+         * Reads a string.\r
+         * @returns {string}\r
+         * @private\r
+         */\r
+        ParserPrototype._readString = function() {\r
+            var value = "",\r
+                token,\r
+                delim;\r
+            do {\r
+                delim = this.tn.next();\r
+                if (delim !== "'" &amp;&amp; delim !== '"')\r
+                    throw Error("illegal string delimiter: "+delim);\r
+                value += this.tn.next();\r
+                this.tn.skip(delim);\r
+                token = this.tn.peek();\r
+            } while (token === '"' || token === '"'); // multi line?\r
+            return value;\r
+        };\r
+\r
+        /**\r
+         * Reads a value.\r
+         * @param {boolean=} mayBeTypeRef\r
+         * @returns {number|boolean|string}\r
+         * @private\r
+         */\r
+        ParserPrototype._readValue = function(mayBeTypeRef) {\r
+            var token = this.tn.peek(),\r
+                value;\r
+            if (token === '"' || token === "'")\r
+                return this._readString();\r
+            this.tn.next();\r
+            if (Lang.NUMBER.test(token))\r
+                return mkNumber(token);\r
+            if (Lang.BOOL.test(token))\r
+                return (token.toLowerCase() === 'true');\r
+            if (mayBeTypeRef &amp;&amp; Lang.TYPEREF.test(token))\r
+                return token;\r
+            throw Error("illegal value: "+token);\r
+\r
+        };\r
+\r
+        // ----- Parsing constructs -----\r
+\r
+        /**\r
+         * Parses a namespace option.\r
+         * @param {!Object} parent Parent definition\r
+         * @param {boolean=} isList\r
+         * @private\r
+         */\r
+        ParserPrototype._parseOption = function(parent, isList) {\r
+            var token = this.tn.next(),\r
+                custom = false;\r
+            if (token === '(') {\r
+                custom = true;\r
+                token = this.tn.next();\r
+            }\r
+            if (!Lang.TYPEREF.test(token))\r
+                // we can allow options of the form google.protobuf.* since they will just get ignored anyways\r
+                // if (!/google\.protobuf\./.test(token)) // FIXME: Why should that not be a valid typeref?\r
+                    throw Error("illegal option name: "+token);\r
+            var name = token;\r
+            if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar\r
+                this.tn.skip(')');\r
+                name = '('+name+')';\r
+                token = this.tn.peek();\r
+                if (Lang.FQTYPEREF.test(token)) {\r
+                    name += token;\r
+                    this.tn.next();\r
+                }\r
+            }\r
+            this.tn.skip('=');\r
+            this._parseOptionValue(parent, name);\r
+            if (!isList)\r
+                this.tn.skip(";");\r
+        };\r
+\r
+        /**\r
+         * Sets an option on the specified options object.\r
+         * @param {!Object.&lt;string,*>} options\r
+         * @param {string} name\r
+         * @param {string|number|boolean} value\r
+         * @inner\r
+         */\r
+        function setOption(options, name, value) {\r
+            if (typeof options[name] === 'undefined')\r
+                options[name] = value;\r
+            else {\r
+                if (!Array.isArray(options[name]))\r
+                    options[name] = [ options[name] ];\r
+                options[name].push(value);\r
+            }\r
+        }\r
+\r
+        /**\r
+         * Parses an option value.\r
+         * @param {!Object} parent\r
+         * @param {string} name\r
+         * @private\r
+         */\r
+        ParserPrototype._parseOptionValue = function(parent, name) {\r
+            var token = this.tn.peek();\r
+            if (token !== '{') { // Plain value\r
+                setOption(parent["options"], name, this._readValue(true));\r
+            } else { // Aggregate options\r
+                this.tn.skip("{");\r
+                while ((token = this.tn.next()) !== '}') {\r
+                    if (!Lang.NAME.test(token))\r
+                        throw Error("illegal option name: " + name + "." + token);\r
+                    if (this.tn.omit(":"))\r
+                        setOption(parent["options"], name + "." + token, this._readValue(true));\r
+                    else\r
+                        this._parseOptionValue(parent, name + "." + token);\r
+                }\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Parses a service definition.\r
+         * @param {!Object} parent Parent definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseService = function(parent) {\r
+            var token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal service name at line "+this.tn.line+": "+token);\r
+            var name = token;\r
+            var svc = {\r
+                "name": name,\r
+                "rpc": {},\r
+                "options": {}\r
+            };\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (token === "option")\r
+                    this._parseOption(svc);\r
+                else if (token === 'rpc')\r
+                    this._parseServiceRPC(svc);\r
+                else\r
+                    throw Error("illegal service token: "+token);\r
+            }\r
+            this.tn.omit(";");\r
+            parent["services"].push(svc);\r
+        };\r
+\r
+        /**\r
+         * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)].\r
+         * @param {!Object} svc Service definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseServiceRPC = function(svc) {\r
+            var type = "rpc",\r
+                token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal rpc service method name: "+token);\r
+            var name = token;\r
+            var method = {\r
+                "request": null,\r
+                "response": null,\r
+                "request_stream": false,\r
+                "response_stream": false,\r
+                "options": {}\r
+            };\r
+            this.tn.skip("(");\r
+            token = this.tn.next();\r
+            if (token.toLowerCase() === "stream") {\r
+              method["request_stream"] = true;\r
+              token = this.tn.next();\r
+            }\r
+            if (!Lang.TYPEREF.test(token))\r
+                throw Error("illegal rpc service request type: "+token);\r
+            method["request"] = token;\r
+            this.tn.skip(")");\r
+            token = this.tn.next();\r
+            if (token.toLowerCase() !== "returns")\r
+                throw Error("illegal rpc service request type delimiter: "+token);\r
+            this.tn.skip("(");\r
+            token = this.tn.next();\r
+            if (token.toLowerCase() === "stream") {\r
+              method["response_stream"] = true;\r
+              token = this.tn.next();\r
+            }\r
+            method["response"] = token;\r
+            this.tn.skip(")");\r
+            token = this.tn.peek();\r
+            if (token === '{') {\r
+                this.tn.next();\r
+                while ((token = this.tn.next()) !== '}') {\r
+                    if (token === 'option')\r
+                        this._parseOption(method);\r
+                    else\r
+                        throw Error("illegal rpc service token: " + token);\r
+                }\r
+                this.tn.omit(";");\r
+            } else\r
+                this.tn.skip(";");\r
+            if (typeof svc[type] === 'undefined')\r
+                svc[type] = {};\r
+            svc[type][name] = method;\r
+        };\r
+\r
+        /**\r
+         * Parses a message definition.\r
+         * @param {!Object} parent Parent definition\r
+         * @param {!Object=} fld Field definition if this is a group\r
+         * @returns {!Object}\r
+         * @private\r
+         */\r
+        ParserPrototype._parseMessage = function(parent, fld) {\r
+            var isGroup = !!fld,\r
+                token = this.tn.next();\r
+            var msg = {\r
+                "name": "",\r
+                "fields": [],\r
+                "enums": [],\r
+                "messages": [],\r
+                "options": {},\r
+                "services": [],\r
+                "oneofs": {}\r
+                // "extensions": undefined\r
+            };\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal "+(isGroup ? "group" : "message")+" name: "+token);\r
+            msg["name"] = token;\r
+            if (isGroup) {\r
+                this.tn.skip("=");\r
+                fld["id"] = mkId(this.tn.next());\r
+                msg["isGroup"] = true;\r
+            }\r
+            token = this.tn.peek();\r
+            if (token === '[' &amp;&amp; fld)\r
+                this._parseFieldOptions(fld);\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (Lang.RULE.test(token))\r
+                    this._parseMessageField(msg, token);\r
+                else if (token === "oneof")\r
+                    this._parseMessageOneOf(msg);\r
+                else if (token === "enum")\r
+                    this._parseEnum(msg);\r
+                else if (token === "message")\r
+                    this._parseMessage(msg);\r
+                else if (token === "option")\r
+                    this._parseOption(msg);\r
+                else if (token === "service")\r
+                    this._parseService(msg);\r
+                else if (token === "extensions")\r
+                    if (msg.hasOwnProperty("extensions")) {\r
+                        msg["extensions"] = msg["extensions"].concat(this._parseExtensionRanges())\r
+                    } else {\r
+                        msg["extensions"] = this._parseExtensionRanges();\r
+                    }\r
+                else if (token === "reserved")\r
+                    this._parseIgnored(); // TODO\r
+                else if (token === "extend")\r
+                    this._parseExtend(msg);\r
+                else if (Lang.TYPEREF.test(token)) {\r
+                    if (!this.proto3)\r
+                        throw Error("illegal field rule: "+token);\r
+                    this._parseMessageField(msg, "optional", token);\r
+                } else\r
+                    throw Error("illegal message token: "+token);\r
+            }\r
+            this.tn.omit(";");\r
+            parent["messages"].push(msg);\r
+            return msg;\r
+        };\r
+\r
+        /**\r
+         * Parses an ignored statement.\r
+         * @private\r
+         */\r
+        ParserPrototype._parseIgnored = function() {\r
+            while (this.tn.peek() !== ';')\r
+                this.tn.next();\r
+            this.tn.skip(";");\r
+        };\r
+\r
+        /**\r
+         * Parses a message field.\r
+         * @param {!Object} msg Message definition\r
+         * @param {string} rule Field rule\r
+         * @param {string=} type Field type if already known (never known for maps)\r
+         * @returns {!Object} Field descriptor\r
+         * @private\r
+         */\r
+        ParserPrototype._parseMessageField = function(msg, rule, type) {\r
+            if (!Lang.RULE.test(rule))\r
+                throw Error("illegal message field rule: "+rule);\r
+            var fld = {\r
+                "rule": rule,\r
+                "type": "",\r
+                "name": "",\r
+                "options": {},\r
+                "id": 0\r
+            };\r
+            var token;\r
+            if (rule === "map") {\r
+\r
+                if (type)\r
+                    throw Error("illegal type: " + type);\r
+                this.tn.skip('&lt;');\r
+                token = this.tn.next();\r
+                if (!Lang.TYPE.test(token) &amp;&amp; !Lang.TYPEREF.test(token))\r
+                    throw Error("illegal message field type: " + token);\r
+                fld["keytype"] = token;\r
+                this.tn.skip(',');\r
+                token = this.tn.next();\r
+                if (!Lang.TYPE.test(token) &amp;&amp; !Lang.TYPEREF.test(token))\r
+                    throw Error("illegal message field: " + token);\r
+                fld["type"] = token;\r
+                this.tn.skip('>');\r
+                token = this.tn.next();\r
+                if (!Lang.NAME.test(token))\r
+                    throw Error("illegal message field name: " + token);\r
+                fld["name"] = token;\r
+                this.tn.skip("=");\r
+                fld["id"] = mkId(this.tn.next());\r
+                token = this.tn.peek();\r
+                if (token === '[')\r
+                    this._parseFieldOptions(fld);\r
+                this.tn.skip(";");\r
+\r
+            } else {\r
+\r
+                type = typeof type !== 'undefined' ? type : this.tn.next();\r
+\r
+                if (type === "group") {\r
+\r
+                    // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your\r
+                    // code, you can treat this message just as if it had a Result type field called result (the latter name is\r
+                    // converted to lower-case so that it does not conflict with the former)."\r
+                    var grp = this._parseMessage(msg, fld);\r
+                    if (!/^[A-Z]/.test(grp["name"]))\r
+                        throw Error('illegal group name: '+grp["name"]);\r
+                    fld["type"] = grp["name"];\r
+                    fld["name"] = grp["name"].toLowerCase();\r
+                    this.tn.omit(";");\r
+\r
+                } else {\r
+\r
+                    if (!Lang.TYPE.test(type) &amp;&amp; !Lang.TYPEREF.test(type))\r
+                        throw Error("illegal message field type: " + type);\r
+                    fld["type"] = type;\r
+                    token = this.tn.next();\r
+                    if (!Lang.NAME.test(token))\r
+                        throw Error("illegal message field name: " + token);\r
+                    fld["name"] = token;\r
+                    this.tn.skip("=");\r
+                    fld["id"] = mkId(this.tn.next());\r
+                    token = this.tn.peek();\r
+                    if (token === "[")\r
+                        this._parseFieldOptions(fld);\r
+                    this.tn.skip(";");\r
+\r
+                }\r
+            }\r
+            msg["fields"].push(fld);\r
+            return fld;\r
+        };\r
+\r
+        /**\r
+         * Parses a message oneof.\r
+         * @param {!Object} msg Message definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseMessageOneOf = function(msg) {\r
+            var token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal oneof name: "+token);\r
+            var name = token,\r
+                fld;\r
+            var fields = [];\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== "}") {\r
+                fld = this._parseMessageField(msg, "optional", token);\r
+                fld["oneof"] = name;\r
+                fields.push(fld["id"]);\r
+            }\r
+            this.tn.omit(";");\r
+            msg["oneofs"][name] = fields;\r
+        };\r
+\r
+        /**\r
+         * Parses a set of field option definitions.\r
+         * @param {!Object} fld Field definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseFieldOptions = function(fld) {\r
+            this.tn.skip("[");\r
+            var token,\r
+                first = true;\r
+            while ((token = this.tn.peek()) !== ']') {\r
+                if (!first)\r
+                    this.tn.skip(",");\r
+                this._parseOption(fld, true);\r
+                first = false;\r
+            }\r
+            this.tn.next();\r
+        };\r
+\r
+        /**\r
+         * Parses an enum.\r
+         * @param {!Object} msg Message definition\r
+         * @private\r
+         */\r
+        ParserPrototype._parseEnum = function(msg) {\r
+            var enm = {\r
+                "name": "",\r
+                "values": [],\r
+                "options": {}\r
+            };\r
+            var token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal name: "+token);\r
+            enm["name"] = token;\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (token === "option")\r
+                    this._parseOption(enm);\r
+                else {\r
+                    if (!Lang.NAME.test(token))\r
+                        throw Error("illegal name: "+token);\r
+                    this.tn.skip("=");\r
+                    var val = {\r
+                        "name": token,\r
+                        "id": mkId(this.tn.next(), true)\r
+                    };\r
+                    token = this.tn.peek();\r
+                    if (token === "[")\r
+                        this._parseFieldOptions({ "options": {} });\r
+                    this.tn.skip(";");\r
+                    enm["values"].push(val);\r
+                }\r
+            }\r
+            this.tn.omit(";");\r
+            msg["enums"].push(enm);\r
+        };\r
+\r
+        /**\r
+         * Parses extension / reserved ranges.\r
+         * @returns {!Array.&lt;!Array.&lt;number>>}\r
+         * @private\r
+         */\r
+        ParserPrototype._parseExtensionRanges = function() {\r
+            var ranges = [];\r
+            var token,\r
+                range,\r
+                value;\r
+            do {\r
+                range = [];\r
+                while (true) {\r
+                    token = this.tn.next();\r
+                    switch (token) {\r
+                        case "min":\r
+                            value = ProtoBuf.ID_MIN;\r
+                            break;\r
+                        case "max":\r
+                            value = ProtoBuf.ID_MAX;\r
+                            break;\r
+                        default:\r
+                            value = mkNumber(token);\r
+                            break;\r
+                    }\r
+                    range.push(value);\r
+                    if (range.length === 2)\r
+                        break;\r
+                    if (this.tn.peek() !== "to") {\r
+                        range.push(value);\r
+                        break;\r
+                    }\r
+                    this.tn.next();\r
+                }\r
+                ranges.push(range);\r
+            } while (this.tn.omit(","));\r
+            this.tn.skip(";");\r
+            return ranges;\r
+        };\r
+\r
+        /**\r
+         * Parses an extend block.\r
+         * @param {!Object} parent Parent object\r
+         * @private\r
+         */\r
+        ParserPrototype._parseExtend = function(parent) {\r
+            var token = this.tn.next();\r
+            if (!Lang.TYPEREF.test(token))\r
+                throw Error("illegal extend reference: "+token);\r
+            var ext = {\r
+                "ref": token,\r
+                "fields": []\r
+            };\r
+            this.tn.skip("{");\r
+            while ((token = this.tn.next()) !== '}') {\r
+                if (Lang.RULE.test(token))\r
+                    this._parseMessageField(ext, token);\r
+                else if (Lang.TYPEREF.test(token)) {\r
+                    if (!this.proto3)\r
+                        throw Error("illegal field rule: "+token);\r
+                    this._parseMessageField(ext, "optional", token);\r
+                } else\r
+                    throw Error("illegal extend token: "+token);\r
+            }\r
+            this.tn.omit(";");\r
+            parent["messages"].push(ext);\r
+            return ext;\r
+        };\r
+\r
+        // ----- General -----\r
+\r
+        /**\r
+         * Returns a string representation of this parser.\r
+         * @returns {string}\r
+         */\r
+        ParserPrototype.toString = function() {\r
+            return "Parser at line "+this.tn.line;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.DotProto.Parser\r
+         * @expose\r
+         */\r
+        DotProto.Parser = Parser;\r
+\r
+        return DotProto;\r
+\r
+    })(ProtoBuf, ProtoBuf.Lang);\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect\r
+     * @expose\r
+     */\r
+    ProtoBuf.Reflect = (function(ProtoBuf) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Reflection types.\r
+         * @exports ProtoBuf.Reflect\r
+         * @namespace\r
+         */\r
+        var Reflect = {};\r
+\r
+        /**\r
+         * Constructs a Reflect base class.\r
+         * @exports ProtoBuf.Reflect.T\r
+         * @constructor\r
+         * @abstract\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {?ProtoBuf.Reflect.T} parent Parent object\r
+         * @param {string} name Object name\r
+         */\r
+        var T = function(builder, parent, name) {\r
+\r
+            /**\r
+             * Builder reference.\r
+             * @type {!ProtoBuf.Builder}\r
+             * @expose\r
+             */\r
+            this.builder = builder;\r
+\r
+            /**\r
+             * Parent object.\r
+             * @type {?ProtoBuf.Reflect.T}\r
+             * @expose\r
+             */\r
+            this.parent = parent;\r
+\r
+            /**\r
+             * Object name in namespace.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.name = name;\r
+\r
+            /**\r
+             * Fully qualified class name\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.className;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.T.prototype\r
+         * @inner\r
+         */\r
+        var TPrototype = T.prototype;\r
+\r
+        /**\r
+         * Returns the fully qualified name of this object.\r
+         * @returns {string} Fully qualified name as of ".PATH.TO.THIS"\r
+         * @expose\r
+         */\r
+        TPrototype.fqn = function() {\r
+            var name = this.name,\r
+                ptr = this;\r
+            do {\r
+                ptr = ptr.parent;\r
+                if (ptr == null)\r
+                    break;\r
+                name = ptr.name+"."+name;\r
+            } while (true);\r
+            return name;\r
+        };\r
+\r
+        /**\r
+         * Returns a string representation of this Reflect object (its fully qualified name).\r
+         * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r
+         * @return String representation\r
+         * @expose\r
+         */\r
+        TPrototype.toString = function(includeClass) {\r
+            return (includeClass ? this.className + " " : "") + this.fqn();\r
+        };\r
+\r
+        /**\r
+         * Builds this type.\r
+         * @throws {Error} If this type cannot be built directly\r
+         * @expose\r
+         */\r
+        TPrototype.build = function() {\r
+            throw Error(this.toString(true)+" cannot be built directly");\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.T\r
+         * @expose\r
+         */\r
+        Reflect.T = T;\r
+\r
+        /**\r
+         * Constructs a new Namespace.\r
+         * @exports ProtoBuf.Reflect.Namespace\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r
+         * @param {string} name Namespace name\r
+         * @param {Object.&lt;string,*>=} options Namespace options\r
+         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Namespace = function(builder, parent, name, options, syntax) {\r
+            T.call(this, builder, parent, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Namespace";\r
+\r
+            /**\r
+             * Children inside the namespace.\r
+             * @type {!Array.&lt;ProtoBuf.Reflect.T>}\r
+             */\r
+            this.children = [];\r
+\r
+            /**\r
+             * Options.\r
+             * @type {!Object.&lt;string, *>}\r
+             */\r
+            this.options = options || {};\r
+\r
+            /**\r
+             * Syntax level (e.g., proto2 or proto3).\r
+             * @type {!string}\r
+             */\r
+            this.syntax = syntax || "proto2";\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Namespace.prototype\r
+         * @inner\r
+         */\r
+        var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * Returns an array of the namespace's children.\r
+         * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r
+         * @return {Array.&lt;ProtoBuf.Reflect.T>}\r
+         * @expose\r
+         */\r
+        NamespacePrototype.getChildren = function(type) {\r
+            type = type || null;\r
+            if (type == null)\r
+                return this.children.slice();\r
+            var children = [];\r
+            for (var i=0, k=this.children.length; i&lt;k; ++i)\r
+                if (this.children[i] instanceof type)\r
+                    children.push(this.children[i]);\r
+            return children;\r
+        };\r
+\r
+        /**\r
+         * Adds a child to the namespace.\r
+         * @param {ProtoBuf.Reflect.T} child Child\r
+         * @throws {Error} If the child cannot be added (duplicate)\r
+         * @expose\r
+         */\r
+        NamespacePrototype.addChild = function(child) {\r
+            var other;\r
+            if (other = this.getChild(child.name)) {\r
+                // Try to revert camelcase transformation on collision\r
+                if (other instanceof Message.Field &amp;&amp; other.name !== other.originalName &amp;&amp; this.getChild(other.originalName) === null)\r
+                    other.name = other.originalName; // Revert previous first (effectively keeps both originals)\r
+                else if (child instanceof Message.Field &amp;&amp; child.name !== child.originalName &amp;&amp; this.getChild(child.originalName) === null)\r
+                    child.name = child.originalName;\r
+                else\r
+                    throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);\r
+            }\r
+            this.children.push(child);\r
+        };\r
+\r
+        /**\r
+         * Gets a child by its name or id.\r
+         * @param {string|number} nameOrId Child name or id\r
+         * @return {?ProtoBuf.Reflect.T} The child or null if not found\r
+         * @expose\r
+         */\r
+        NamespacePrototype.getChild = function(nameOrId) {\r
+            var key = typeof nameOrId === 'number' ? 'id' : 'name';\r
+            for (var i=0, k=this.children.length; i&lt;k; ++i)\r
+                if (this.children[i][key] === nameOrId)\r
+                    return this.children[i];\r
+            return null;\r
+        };\r
+\r
+        /**\r
+         * Resolves a reflect object inside of this namespace.\r
+         * @param {string|!Array.&lt;string>} qn Qualified name to resolve\r
+         * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r
+         * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r
+         * @expose\r
+         */\r
+        NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r
+            var part = typeof qn === 'string' ? qn.split(".") : qn,\r
+                ptr = this,\r
+                i = 0;\r
+            if (part[i] === "") { // Fully qualified name, e.g. ".My.Message'\r
+                while (ptr.parent !== null)\r
+                    ptr = ptr.parent;\r
+                i++;\r
+            }\r
+            var child;\r
+            do {\r
+                do {\r
+                    if (!(ptr instanceof Reflect.Namespace)) {\r
+                        ptr = null;\r
+                        break;\r
+                    }\r
+                    child = ptr.getChild(part[i]);\r
+                    if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace &amp;&amp; !(child instanceof Reflect.Namespace))) {\r
+                        ptr = null;\r
+                        break;\r
+                    }\r
+                    ptr = child; i++;\r
+                } while (i &lt; part.length);\r
+                if (ptr != null)\r
+                    break; // Found\r
+                // Else search the parent\r
+                if (this.parent !== null)\r
+                    return this.parent.resolve(qn, excludeNonNamespace);\r
+            } while (ptr != null);\r
+            return ptr;\r
+        };\r
+\r
+        /**\r
+         * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r
+         * @param {!ProtoBuf.Reflect.T} t Reflection type\r
+         * @returns {string} The shortest qualified name or, if there is none, the fqn\r
+         * @expose\r
+         */\r
+        NamespacePrototype.qn = function(t) {\r
+            var part = [], ptr = t;\r
+            do {\r
+                part.unshift(ptr.name);\r
+                ptr = ptr.parent;\r
+            } while (ptr !== null);\r
+            for (var len=1; len &lt;= part.length; len++) {\r
+                var qn = part.slice(part.length-len);\r
+                if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r
+                    return qn.join(".");\r
+            }\r
+            return t.fqn();\r
+        };\r
+\r
+        /**\r
+         * Builds the namespace and returns the runtime counterpart.\r
+         * @return {Object.&lt;string,Function|Object>} Runtime namespace\r
+         * @expose\r
+         */\r
+        NamespacePrototype.build = function() {\r
+            /** @dict */\r
+            var ns = {};\r
+            var children = this.children;\r
+            for (var i=0, k=children.length, child; i&lt;k; ++i) {\r
+                child = children[i];\r
+                if (child instanceof Namespace)\r
+                    ns[child.name] = child.build();\r
+            }\r
+            if (Object.defineProperty)\r
+                Object.defineProperty(ns, "$options", { "value": this.buildOpt() });\r
+            return ns;\r
+        };\r
+\r
+        /**\r
+         * Builds the namespace's '$options' property.\r
+         * @return {Object.&lt;string,*>}\r
+         */\r
+        NamespacePrototype.buildOpt = function() {\r
+            var opt = {},\r
+                keys = Object.keys(this.options);\r
+            for (var i=0, k=keys.length; i&lt;k; ++i) {\r
+                var key = keys[i],\r
+                    val = this.options[keys[i]];\r
+                // TODO: Options are not resolved, yet.\r
+                // if (val instanceof Namespace) {\r
+                //     opt[key] = val.build();\r
+                // } else {\r
+                opt[key] = val;\r
+                // }\r
+            }\r
+            return opt;\r
+        };\r
+\r
+        /**\r
+         * Gets the value assigned to the option with the specified name.\r
+         * @param {string=} name Returns the option value if specified, otherwise all options are returned.\r
+         * @return {*|Object.&lt;string,*>}null} Option value or NULL if there is no such option\r
+         */\r
+        NamespacePrototype.getOption = function(name) {\r
+            if (typeof name === 'undefined')\r
+                return this.options;\r
+            return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Namespace\r
+         * @expose\r
+         */\r
+        Reflect.Namespace = Namespace;\r
+\r
+        /**\r
+         * Constructs a new Element implementation that checks and converts values for a\r
+         * particular field type, as appropriate.\r
+         *\r
+         * An Element represents a single value: either the value of a singular field,\r
+         * or a value contained in one entry of a repeated field or map field. This\r
+         * class does not implement these higher-level concepts; it only encapsulates\r
+         * the low-level typechecking and conversion.\r
+         *\r
+         * @exports ProtoBuf.Reflect.Element\r
+         * @param {{name: string, wireType: number}} type Resolved data type\r
+         * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r
+         * (e.g. submessage field).\r
+         * @param {boolean} isMapKey Is this element a Map key? The value will be\r
+         * converted to string form if so.\r
+         * @param {string} syntax Syntax level of defining message type, e.g.,\r
+         * proto2 or proto3.\r
+         * @param {string} name Name of the field containing this element (for error\r
+         * messages)\r
+         * @constructor\r
+         */\r
+        var Element = function(type, resolvedType, isMapKey, syntax, name) {\r
+\r
+            /**\r
+             * Element type, as a string (e.g., int32).\r
+             * @type {{name: string, wireType: number}}\r
+             */\r
+            this.type = type;\r
+\r
+            /**\r
+             * Element type reference to submessage or enum definition, if needed.\r
+             * @type {ProtoBuf.Reflect.T|null}\r
+             */\r
+            this.resolvedType = resolvedType;\r
+\r
+            /**\r
+             * Element is a map key.\r
+             * @type {boolean}\r
+             */\r
+            this.isMapKey = isMapKey;\r
+\r
+            /**\r
+             * Syntax level of defining message type, e.g., proto2 or proto3.\r
+             * @type {string}\r
+             */\r
+            this.syntax = syntax;\r
+\r
+            /**\r
+             * Name of the field containing this element (for error messages)\r
+             * @type {string}\r
+             */\r
+            this.name = name;\r
+\r
+            if (isMapKey &amp;&amp; ProtoBuf.MAP_KEY_TYPES.indexOf(type) &lt; 0)\r
+                throw Error("Invalid map key type: " + type.name);\r
+        };\r
+\r
+        var ElementPrototype = Element.prototype;\r
+\r
+        /**\r
+         * Obtains a (new) default value for the specified type.\r
+         * @param type {string|{name: string, wireType: number}} Field type\r
+         * @returns {*} Default value\r
+         * @inner\r
+         */\r
+        function mkDefault(type) {\r
+            if (typeof type === 'string')\r
+                type = ProtoBuf.TYPES[type];\r
+            if (typeof type.defaultValue === 'undefined')\r
+                throw Error("default value for type "+type.name+" is not supported");\r
+            if (type == ProtoBuf.TYPES["bytes"])\r
+                return new ByteBuffer(0);\r
+            return type.defaultValue;\r
+        }\r
+\r
+        /**\r
+         * Returns the default value for this field in proto3.\r
+         * @function\r
+         * @param type {string|{name: string, wireType: number}} the field type\r
+         * @returns {*} Default value\r
+         */\r
+        Element.defaultFieldValue = mkDefault;\r
+\r
+        /**\r
+         * Makes a Long from a value.\r
+         * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r
+         * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r
+         *  strings and numbers\r
+         * @returns {!Long}\r
+         * @throws {Error} If the value cannot be converted to a Long\r
+         * @inner\r
+         */\r
+        function mkLong(value, unsigned) {\r
+            if (value &amp;&amp; typeof value.low === 'number' &amp;&amp; typeof value.high === 'number' &amp;&amp; typeof value.unsigned === 'boolean'\r
+                &amp;&amp; value.low === value.low &amp;&amp; value.high === value.high)\r
+                return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r
+            if (typeof value === 'string')\r
+                return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r
+            if (typeof value === 'number')\r
+                return ProtoBuf.Long.fromNumber(value, unsigned || false);\r
+            throw Error("not convertible to Long");\r
+        }\r
+\r
+        ElementPrototype.toString = function() {\r
+            return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r
+        }\r
+\r
+        /**\r
+         * Checks if the given value can be set for an element of this type (singular\r
+         * field or one element of a repeated field or map).\r
+         * @param {*} value Value to check\r
+         * @return {*} Verified, maybe adjusted, value\r
+         * @throws {Error} If the value cannot be verified for this element slot\r
+         * @expose\r
+         */\r
+        ElementPrototype.verifyValue = function(value) {\r
+            var self = this;\r
+            function fail(val, msg) {\r
+                throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+            }\r
+            switch (this.type) {\r
+                // Signed 32bit\r
+                case ProtoBuf.TYPES["int32"]:\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                    // Account for !NaN: value === value\r
+                    if (typeof value !== 'number' || (value === value &amp;&amp; value % 1 !== 0))\r
+                        fail(typeof value, "not an integer");\r
+                    return value > 4294967295 ? value | 0 : value;\r
+\r
+                // Unsigned 32bit\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    if (typeof value !== 'number' || (value === value &amp;&amp; value % 1 !== 0))\r
+                        fail(typeof value, "not an integer");\r
+                    return value &lt; 0 ? value >>> 0 : value;\r
+\r
+                // Signed 64bit\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]: {\r
+                    if (ProtoBuf.Long)\r
+                        try {\r
+                            return mkLong(value, false);\r
+                        } catch (e) {\r
+                            fail(typeof value, e.message);\r
+                        }\r
+                    else\r
+                        fail(typeof value, "requires Long.js");\r
+                }\r
+\r
+                // Unsigned 64bit\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                case ProtoBuf.TYPES["fixed64"]: {\r
+                    if (ProtoBuf.Long)\r
+                        try {\r
+                            return mkLong(value, true);\r
+                        } catch (e) {\r
+                            fail(typeof value, e.message);\r
+                        }\r
+                    else\r
+                        fail(typeof value, "requires Long.js");\r
+                }\r
+\r
+                // Bool\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    if (typeof value !== 'boolean')\r
+                        fail(typeof value, "not a boolean");\r
+                    return value;\r
+\r
+                // Float\r
+                case ProtoBuf.TYPES["float"]:\r
+                case ProtoBuf.TYPES["double"]:\r
+                    if (typeof value !== 'number')\r
+                        fail(typeof value, "not a number");\r
+                    return value;\r
+\r
+                // Length-delimited string\r
+                case ProtoBuf.TYPES["string"]:\r
+                    if (typeof value !== 'string' &amp;&amp; !(value &amp;&amp; value instanceof String))\r
+                        fail(typeof value, "not a string");\r
+                    return ""+value; // Convert String object to string\r
+\r
+                // Length-delimited bytes\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    if (ByteBuffer.isByteBuffer(value))\r
+                        return value;\r
+                    return ByteBuffer.wrap(value, "base64");\r
+\r
+                // Constant enum value\r
+                case ProtoBuf.TYPES["enum"]: {\r
+                    var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r
+                    for (i=0; i&lt;values.length; i++)\r
+                        if (values[i].name == value)\r
+                            return values[i].id;\r
+                        else if (values[i].id == value)\r
+                            return values[i].id;\r
+\r
+                    if (this.syntax === 'proto3') {\r
+                        // proto3: just make sure it's an integer.\r
+                        if (typeof value !== 'number' || (value === value &amp;&amp; value % 1 !== 0))\r
+                            fail(typeof value, "not an integer");\r
+                        if (value > 4294967295 || value &lt; 0)\r
+                            fail(typeof value, "not in range for uint32")\r
+                        return value;\r
+                    } else {\r
+                        // proto2 requires enum values to be valid.\r
+                        fail(value, "not a valid enum value");\r
+                    }\r
+                }\r
+                // Embedded message\r
+                case ProtoBuf.TYPES["group"]:\r
+                case ProtoBuf.TYPES["message"]: {\r
+                    if (!value || typeof value !== 'object')\r
+                        fail(typeof value, "object expected");\r
+                    if (value instanceof this.resolvedType.clazz)\r
+                        return value;\r
+                    if (value instanceof ProtoBuf.Builder.Message) {\r
+                        // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r
+                        var obj = {};\r
+                        for (var i in value)\r
+                            if (value.hasOwnProperty(i))\r
+                                obj[i] = value[i];\r
+                        value = obj;\r
+                    }\r
+                    // Else let's try to construct one from a key-value object\r
+                    return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r
+                }\r
+            }\r
+\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");\r
+        };\r
+\r
+        /**\r
+         * Calculates the byte length of an element on the wire.\r
+         * @param {number} id Field number\r
+         * @param {*} value Field value\r
+         * @returns {number} Byte length\r
+         * @throws {Error} If the value cannot be calculated\r
+         * @expose\r
+         */\r
+        ElementPrototype.calculateLength = function(id, value) {\r
+            if (value === null) return 0; // Nothing to encode\r
+            // Tag has already been written\r
+            var n;\r
+            switch (this.type) {\r
+                case ProtoBuf.TYPES["int32"]:\r
+                    return value &lt; 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                    return ByteBuffer.calculateVarint32(value);\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                    return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                case ProtoBuf.TYPES["float"]:\r
+                    return 4;\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                    return ByteBuffer.calculateVarint64(value);\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                    return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                    return 8;\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    return 1;\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    return ByteBuffer.calculateVarint32(value);\r
+                case ProtoBuf.TYPES["double"]:\r
+                    return 8;\r
+                case ProtoBuf.TYPES["string"]:\r
+                    n = ByteBuffer.calculateUTF8Bytes(value);\r
+                    return ByteBuffer.calculateVarint32(n) + n;\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    if (value.remaining() &lt; 0)\r
+                        throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+                    return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r
+                case ProtoBuf.TYPES["message"]:\r
+                    n = this.resolvedType.calculate(value);\r
+                    return ByteBuffer.calculateVarint32(n) + n;\r
+                case ProtoBuf.TYPES["group"]:\r
+                    n = this.resolvedType.calculate(value);\r
+                    return n + ByteBuffer.calculateVarint32((id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+            }\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+        };\r
+\r
+        /**\r
+         * Encodes a value to the specified buffer. Does not encode the key.\r
+         * @param {number} id Field number\r
+         * @param {*} value Field value\r
+         * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+         * @return {ByteBuffer} The ByteBuffer for chaining\r
+         * @throws {Error} If the value cannot be encoded\r
+         * @expose\r
+         */\r
+        ElementPrototype.encodeValue = function(id, value, buffer) {\r
+            if (value === null) return buffer; // Nothing to encode\r
+            // Tag has already been written\r
+\r
+            switch (this.type) {\r
+                // 32bit signed varint\r
+                case ProtoBuf.TYPES["int32"]:\r
+                    // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r
+                    // long – it is, effectively, treated like a very large unsigned integer." (see #122)\r
+                    if (value &lt; 0)\r
+                        buffer.writeVarint64(value);\r
+                    else\r
+                        buffer.writeVarint32(value);\r
+                    break;\r
+\r
+                // 32bit unsigned varint\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                    buffer.writeVarint32(value);\r
+                    break;\r
+\r
+                // 32bit varint zig-zag\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                    buffer.writeVarint32ZigZag(value);\r
+                    break;\r
+\r
+                // Fixed unsigned 32bit\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    buffer.writeUint32(value);\r
+                    break;\r
+\r
+                // Fixed signed 32bit\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                    buffer.writeInt32(value);\r
+                    break;\r
+\r
+                // 64bit varint as-is\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                    buffer.writeVarint64(value); // throws\r
+                    break;\r
+\r
+                // 64bit varint zig-zag\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                    buffer.writeVarint64ZigZag(value); // throws\r
+                    break;\r
+\r
+                // Fixed unsigned 64bit\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                    buffer.writeUint64(value); // throws\r
+                    break;\r
+\r
+                // Fixed signed 64bit\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                    buffer.writeInt64(value); // throws\r
+                    break;\r
+\r
+                // Bool\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    if (typeof value === 'string')\r
+                        buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r
+                    else\r
+                        buffer.writeVarint32(value ? 1 : 0);\r
+                    break;\r
+\r
+                // Constant enum value\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    buffer.writeVarint32(value);\r
+                    break;\r
+\r
+                // 32bit float\r
+                case ProtoBuf.TYPES["float"]:\r
+                    buffer.writeFloat32(value);\r
+                    break;\r
+\r
+                // 64bit float\r
+                case ProtoBuf.TYPES["double"]:\r
+                    buffer.writeFloat64(value);\r
+                    break;\r
+\r
+                // Length-delimited string\r
+                case ProtoBuf.TYPES["string"]:\r
+                    buffer.writeVString(value);\r
+                    break;\r
+\r
+                // Length-delimited bytes\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    if (value.remaining() &lt; 0)\r
+                        throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+                    var prevOffset = value.offset;\r
+                    buffer.writeVarint32(value.remaining());\r
+                    buffer.append(value);\r
+                    value.offset = prevOffset;\r
+                    break;\r
+\r
+                // Embedded message\r
+                case ProtoBuf.TYPES["message"]:\r
+                    var bb = new ByteBuffer().LE();\r
+                    this.resolvedType.encode(value, bb);\r
+                    buffer.writeVarint32(bb.offset);\r
+                    buffer.append(bb.flip());\r
+                    break;\r
+\r
+                // Legacy group\r
+                case ProtoBuf.TYPES["group"]:\r
+                    this.resolvedType.encode(value, buffer);\r
+                    buffer.writeVarint32((id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+                    break;\r
+\r
+                default:\r
+                    // We should never end here\r
+                    throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+            }\r
+            return buffer;\r
+        };\r
+\r
+        /**\r
+         * Decode one element value from the specified buffer.\r
+         * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+         * @param {number} wireType The field wire type\r
+         * @param {number} id The field number\r
+         * @return {*} Decoded value\r
+         * @throws {Error} If the field cannot be decoded\r
+         * @expose\r
+         */\r
+        ElementPrototype.decode = function(buffer, wireType, id) {\r
+            if (wireType != this.type.wireType)\r
+                throw Error("Unexpected wire type for element");\r
+\r
+            var value, nBytes;\r
+            switch (this.type) {\r
+                // 32bit signed varint\r
+                case ProtoBuf.TYPES["int32"]:\r
+                    return buffer.readVarint32() | 0;\r
+\r
+                // 32bit unsigned varint\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                    return buffer.readVarint32() >>> 0;\r
+\r
+                // 32bit signed varint zig-zag\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                    return buffer.readVarint32ZigZag() | 0;\r
+\r
+                // Fixed 32bit unsigned\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    return buffer.readUint32() >>> 0;\r
+\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                    return buffer.readInt32() | 0;\r
+\r
+                // 64bit signed varint\r
+                case ProtoBuf.TYPES["int64"]:\r
+                    return buffer.readVarint64();\r
+\r
+                // 64bit unsigned varint\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                    return buffer.readVarint64().toUnsigned();\r
+\r
+                // 64bit signed varint zig-zag\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                    return buffer.readVarint64ZigZag();\r
+\r
+                // Fixed 64bit unsigned\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                    return buffer.readUint64();\r
+\r
+                // Fixed 64bit signed\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                    return buffer.readInt64();\r
+\r
+                // Bool varint\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    return !!buffer.readVarint32();\r
+\r
+                // Constant enum value (varint)\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    // The following Builder.Message#set will already throw\r
+                    return buffer.readVarint32();\r
+\r
+                // 32bit float\r
+                case ProtoBuf.TYPES["float"]:\r
+                    return buffer.readFloat();\r
+\r
+                // 64bit float\r
+                case ProtoBuf.TYPES["double"]:\r
+                    return buffer.readDouble();\r
+\r
+                // Length-delimited string\r
+                case ProtoBuf.TYPES["string"]:\r
+                    return buffer.readVString();\r
+\r
+                // Length-delimited bytes\r
+                case ProtoBuf.TYPES["bytes"]: {\r
+                    nBytes = buffer.readVarint32();\r
+                    if (buffer.remaining() &lt; nBytes)\r
+                        throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+                    value = buffer.clone(); // Offset already set\r
+                    value.limit = value.offset+nBytes;\r
+                    buffer.offset += nBytes;\r
+                    return value;\r
+                }\r
+\r
+                // Length-delimited embedded message\r
+                case ProtoBuf.TYPES["message"]: {\r
+                    nBytes = buffer.readVarint32();\r
+                    return this.resolvedType.decode(buffer, nBytes);\r
+                }\r
+\r
+                // Legacy group\r
+                case ProtoBuf.TYPES["group"]:\r
+                    return this.resolvedType.decode(buffer, -1, id);\r
+            }\r
+\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal decode type");\r
+        };\r
+\r
+        /**\r
+         * Converts a value from a string to the canonical element type.\r
+         *\r
+         * Legal only when isMapKey is true.\r
+         *\r
+         * @param {string} str The string value\r
+         * @returns {*} The value\r
+         */\r
+        ElementPrototype.valueFromString = function(str) {\r
+            if (!this.isMapKey) {\r
+                throw Error("valueFromString() called on non-map-key element");\r
+            }\r
+\r
+            switch (this.type) {\r
+                case ProtoBuf.TYPES["int32"]:\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    return this.verifyValue(parseInt(str));\r
+\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                      // Long-based fields support conversions from string already.\r
+                      return this.verifyValue(str);\r
+\r
+                case ProtoBuf.TYPES["bool"]:\r
+                      return str === "true";\r
+\r
+                case ProtoBuf.TYPES["string"]:\r
+                      return this.verifyValue(str);\r
+\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                      return ByteBuffer.fromBinary(str);\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Converts a value from the canonical element type to a string.\r
+         *\r
+         * It should be the case that `valueFromString(valueToString(val))` returns\r
+         * a value equivalent to `verifyValue(val)` for every legal value of `val`\r
+         * according to this element type.\r
+         *\r
+         * This may be used when the element must be stored or used as a string,\r
+         * e.g., as a map key on an Object.\r
+         *\r
+         * Legal only when isMapKey is true.\r
+         *\r
+         * @param {*} val The value\r
+         * @returns {string} The string form of the value.\r
+         */\r
+        ElementPrototype.valueToString = function(value) {\r
+            if (!this.isMapKey) {\r
+                throw Error("valueToString() called on non-map-key element");\r
+            }\r
+\r
+            if (this.type === ProtoBuf.TYPES["bytes"]) {\r
+                return value.toString("binary");\r
+            } else {\r
+                return value.toString();\r
+            }\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Element\r
+         * @expose\r
+         */\r
+        Reflect.Element = Element;\r
+\r
+        /**\r
+         * Constructs a new Message.\r
+         * @exports ProtoBuf.Reflect.Message\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r
+         * @param {string} name Message name\r
+         * @param {Object.&lt;string,*>=} options Message options\r
+         * @param {boolean=} isGroup `true` if this is a legacy group\r
+         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Namespace\r
+         */\r
+        var Message = function(builder, parent, name, options, isGroup, syntax) {\r
+            Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Message";\r
+\r
+            /**\r
+             * Extensions range.\r
+             * @type {!Array.&lt;number>|undefined}\r
+             * @expose\r
+             */\r
+            this.extensions = undefined;\r
+\r
+            /**\r
+             * Runtime message class.\r
+             * @type {?function(new:ProtoBuf.Builder.Message)}\r
+             * @expose\r
+             */\r
+            this.clazz = null;\r
+\r
+            /**\r
+             * Whether this is a legacy group or not.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.isGroup = !!isGroup;\r
+\r
+            // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r
+\r
+            /**\r
+             * Cached fields.\r
+             * @type {?Array.&lt;!ProtoBuf.Reflect.Message.Field>}\r
+             * @private\r
+             */\r
+            this._fields = null;\r
+\r
+            /**\r
+             * Cached fields by id.\r
+             * @type {?Object.&lt;number,!ProtoBuf.Reflect.Message.Field>}\r
+             * @private\r
+             */\r
+            this._fieldsById = null;\r
+\r
+            /**\r
+             * Cached fields by name.\r
+             * @type {?Object.&lt;string,!ProtoBuf.Reflect.Message.Field>}\r
+             * @private\r
+             */\r
+            this._fieldsByName = null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.prototype\r
+         * @inner\r
+         */\r
+        var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r
+\r
+        /**\r
+         * Builds the message and returns the runtime counterpart, which is a fully functional class.\r
+         * @see ProtoBuf.Builder.Message\r
+         * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r
+         * @return {ProtoBuf.Reflect.Message} Message class\r
+         * @throws {Error} If the message cannot be built\r
+         * @expose\r
+         */\r
+        MessagePrototype.build = function(rebuild) {\r
+            if (this.clazz &amp;&amp; !rebuild)\r
+                return this.clazz;\r
+\r
+            // Create the runtime Message class in its own scope\r
+            var clazz = (function(ProtoBuf, T) {\r
+\r
+                var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r
+                    oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r
+\r
+                /**\r
+                 * Constructs a new runtime Message.\r
+                 * @name ProtoBuf.Builder.Message\r
+                 * @class Barebone of all runtime messages.\r
+                 * @param {!Object.&lt;string,*>|string} values Preset values\r
+                 * @param {...string} var_args\r
+                 * @constructor\r
+                 * @throws {Error} If the message cannot be created\r
+                 */\r
+                var Message = function(values, var_args) {\r
+                    ProtoBuf.Builder.Message.call(this);\r
+\r
+                    // Create virtual oneof properties\r
+                    for (var i=0, k=oneofs.length; i&lt;k; ++i)\r
+                        this[oneofs[i].name] = null;\r
+                    // Create fields and set default values\r
+                    for (i=0, k=fields.length; i&lt;k; ++i) {\r
+                        var field = fields[i];\r
+                        this[field.name] =\r
+                            field.repeated ? [] :\r
+                            (field.map ? new ProtoBuf.Map(field) : null);\r
+                        if ((field.required || T.syntax === 'proto3') &amp;&amp;\r
+                            field.defaultValue !== null)\r
+                            this[field.name] = field.defaultValue;\r
+                    }\r
+\r
+                    if (arguments.length > 0) {\r
+                        var value;\r
+                        // Set field values from a values object\r
+                        if (arguments.length === 1 &amp;&amp; values !== null &amp;&amp; typeof values === 'object' &amp;&amp;\r
+                            /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &amp;&amp;\r
+                            /* not a repeated field */ !Array.isArray(values) &amp;&amp;\r
+                            /* not a Map */ !(values instanceof ProtoBuf.Map) &amp;&amp;\r
+                            /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &amp;&amp;\r
+                            /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &amp;&amp;\r
+                            /* not a Long */ !(ProtoBuf.Long &amp;&amp; values instanceof ProtoBuf.Long)) {\r
+                            this.$set(values);\r
+                        } else // Set field values from arguments, in declaration order\r
+                            for (i=0, k=arguments.length; i&lt;k; ++i)\r
+                                if (typeof (value = arguments[i]) !== 'undefined')\r
+                                    this.$set(fields[i].name, value); // May throw\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * @alias ProtoBuf.Builder.Message.prototype\r
+                 * @inner\r
+                 */\r
+                var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);\r
+\r
+                /**\r
+                 * Adds a value to a repeated field.\r
+                 * @name ProtoBuf.Builder.Message#add\r
+                 * @function\r
+                 * @param {string} key Field name\r
+                 * @param {*} value Value to add\r
+                 * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @throws {Error} If the value cannot be added\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.add = function(key, value, noAssert) {\r
+                    var field = T._fieldsByName[key];\r
+                    if (!noAssert) {\r
+                        if (!field)\r
+                            throw Error(this+"#"+key+" is undefined");\r
+                        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                            throw Error(this+"#"+key+" is not a field: "+field.toString(true)); // May throw if it's an enum or embedded message\r
+                        if (!field.repeated)\r
+                            throw Error(this+"#"+key+" is not a repeated field");\r
+                        value = field.verifyValue(value, true);\r
+                    }\r
+                    if (this[key] === null)\r
+                        this[key] = [];\r
+                    this[key].push(value);\r
+                    return this;\r
+                };\r
+\r
+                /**\r
+                 * Adds a value to a repeated field. This is an alias for {@link ProtoBuf.Builder.Message#add}.\r
+                 * @name ProtoBuf.Builder.Message#$add\r
+                 * @function\r
+                 * @param {string} key Field name\r
+                 * @param {*} value Value to add\r
+                 * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @throws {Error} If the value cannot be added\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.$add = MessagePrototype.add;\r
+\r
+                /**\r
+                 * Sets a field's value.\r
+                 * @name ProtoBuf.Builder.Message#set\r
+                 * @function\r
+                 * @param {string|!Object.&lt;string,*>} keyOrObj String key or plain object holding multiple values\r
+                 * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+                 * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @throws {Error} If the value cannot be set\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.set = function(keyOrObj, value, noAssert) {\r
+                    if (keyOrObj &amp;&amp; typeof keyOrObj === 'object') {\r
+                        noAssert = value;\r
+                        for (var ikey in keyOrObj) {\r
+                            // Check if virtual oneof field - don't set these\r
+                            if (keyOrObj.hasOwnProperty(ikey) &amp;&amp; typeof (value = keyOrObj[ikey]) !== 'undefined' &amp;&amp; T._oneofsByName[ikey] === undefined)\r
+                                this.$set(ikey, value, noAssert);\r
+                        }\r
+                        return this;\r
+                    }\r
+                    var field = T._fieldsByName[keyOrObj];\r
+                    if (!noAssert) {\r
+                        if (!field)\r
+                            throw Error(this+"#"+keyOrObj+" is not a field: undefined");\r
+                        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                            throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));\r
+                        this[field.name] = (value = field.verifyValue(value)); // May throw\r
+                    } else\r
+                        this[keyOrObj] = value;\r
+                    if (field &amp;&amp; field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+                        var currentField = this[field.oneof.name]; // Virtual field references currently set field\r
+                        if (value !== null) {\r
+                            if (currentField !== null &amp;&amp; currentField !== field.name)\r
+                                this[currentField] = null; // Clear currently set field\r
+                            this[field.oneof.name] = field.name; // Point virtual field at this field\r
+                        } else if (/* value === null &amp;&amp; */currentField === keyOrObj)\r
+                            this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r
+                    }\r
+                    return this;\r
+                };\r
+\r
+                /**\r
+                 * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r
+                 * @name ProtoBuf.Builder.Message#$set\r
+                 * @function\r
+                 * @param {string|!Object.&lt;string,*>} keyOrObj String key or plain object holding multiple values\r
+                 * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                 * @throws {Error} If the value cannot be set\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.$set = MessagePrototype.set;\r
+\r
+                /**\r
+                 * Gets a field's value.\r
+                 * @name ProtoBuf.Builder.Message#get\r
+                 * @function\r
+                 * @param {string} key Key\r
+                 * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r
+                 * @return {*} Value\r
+                 * @throws {Error} If there is no such field\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.get = function(key, noAssert) {\r
+                    if (noAssert)\r
+                        return this[key];\r
+                    var field = T._fieldsByName[key];\r
+                    if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                        throw Error(this+"#"+key+" is not a field: undefined");\r
+                    if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+                        throw Error(this+"#"+key+" is not a field: "+field.toString(true));\r
+                    return this[field.name];\r
+                };\r
+\r
+                /**\r
+                 * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r
+                 * @name ProtoBuf.Builder.Message#$get\r
+                 * @function\r
+                 * @param {string} key Key\r
+                 * @return {*} Value\r
+                 * @throws {Error} If there is no such field\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.$get = MessagePrototype.get;\r
+\r
+                // Getters and setters\r
+\r
+                for (var i=0; i&lt;fields.length; i++) {\r
+                    var field = fields[i];\r
+                    // no setters for extension fields as these are named by their fqn\r
+                    if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+                        continue;\r
+\r
+                    if (T.builder.options['populateAccessors'])\r
+                        (function(field) {\r
+                            // set/get[SomeValue]\r
+                            var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {\r
+                                return match.toUpperCase().replace('_','');\r
+                            });\r
+                            Name = Name.substring(0,1).toUpperCase() + Name.substring(1);\r
+\r
+                            // set/get_[some_value] FIXME: Do we really need these?\r
+                            var name = field.originalName.replace(/([A-Z])/g, function(match) {\r
+                                return "_"+match;\r
+                            });\r
+\r
+                            /**\r
+                             * The current field's unbound setter function.\r
+                             * @function\r
+                             * @param {*} value\r
+                             * @param {boolean=} noAssert\r
+                             * @returns {!ProtoBuf.Builder.Message}\r
+                             * @inner\r
+                             */\r
+                            var setter = function(value, noAssert) {\r
+                                this[field.name] = noAssert ? value : field.verifyValue(value);\r
+                                return this;\r
+                            };\r
+\r
+                            /**\r
+                             * The current field's unbound getter function.\r
+                             * @function\r
+                             * @returns {*}\r
+                             * @inner\r
+                             */\r
+                            var getter = function() {\r
+                                return this[field.name];\r
+                            };\r
+\r
+                            if (T.getChild("set"+Name) === null)\r
+                                /**\r
+                                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#set[SomeField]\r
+                                 * @function\r
+                                 * @param {*} value Value to set\r
+                                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                                 * @returns {!ProtoBuf.Builder.Message} this\r
+                                 * @abstract\r
+                                 * @throws {Error} If the value cannot be set\r
+                                 */\r
+                                MessagePrototype["set"+Name] = setter;\r
+\r
+                            if (T.getChild("set_"+name) === null)\r
+                                /**\r
+                                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#set_[some_field]\r
+                                 * @function\r
+                                 * @param {*} value Value to set\r
+                                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                                 * @returns {!ProtoBuf.Builder.Message} this\r
+                                 * @abstract\r
+                                 * @throws {Error} If the value cannot be set\r
+                                 */\r
+                                MessagePrototype["set_"+name] = setter;\r
+\r
+                            if (T.getChild("get"+Name) === null)\r
+                                /**\r
+                                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#get[SomeField]\r
+                                 * @function\r
+                                 * @abstract\r
+                                 * @return {*} The value\r
+                                 */\r
+                                MessagePrototype["get"+Name] = getter;\r
+\r
+                            if (T.getChild("get_"+name) === null)\r
+                                /**\r
+                                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                                 *  another field.\r
+                                 * @name ProtoBuf.Builder.Message#get_[some_field]\r
+                                 * @function\r
+                                 * @return {*} The value\r
+                                 * @abstract\r
+                                 */\r
+                                MessagePrototype["get_"+name] = getter;\r
+\r
+                        })(field);\r
+                }\r
+\r
+                // En-/decoding\r
+\r
+                /**\r
+                 * Encodes the message.\r
+                 * @name ProtoBuf.Builder.Message#$encode\r
+                 * @function\r
+                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 * @see ProtoBuf.Builder.Message#encode64\r
+                 * @see ProtoBuf.Builder.Message#encodeHex\r
+                 * @see ProtoBuf.Builder.Message#encodeAB\r
+                 */\r
+                MessagePrototype.encode = function(buffer, noVerify) {\r
+                    if (typeof buffer === 'boolean')\r
+                        noVerify = buffer,\r
+                        buffer = undefined;\r
+                    var isNew = false;\r
+                    if (!buffer)\r
+                        buffer = new ByteBuffer(),\r
+                        isNew = true;\r
+                    var le = buffer.littleEndian;\r
+                    try {\r
+                        T.encode(this, buffer.LE(), noVerify);\r
+                        return (isNew ? buffer.flip() : buffer).LE(le);\r
+                    } catch (e) {\r
+                        buffer.LE(le);\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Encodes a message using the specified data payload.\r
+                 * @param {!Object.&lt;string,*>} data Data payload\r
+                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+                 * @expose\r
+                 */\r
+                Message.encode = function(data, buffer, noVerify) {\r
+                    return new Message(data).encode(buffer, noVerify);\r
+                };\r
+\r
+                /**\r
+                 * Calculates the byte length of the message.\r
+                 * @name ProtoBuf.Builder.Message#calculate\r
+                 * @function\r
+                 * @returns {number} Byte length\r
+                 * @throws {Error} If the message cannot be calculated or if required fields are missing.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.calculate = function() {\r
+                    return T.calculate(this);\r
+                };\r
+\r
+                /**\r
+                 * Encodes the varint32 length-delimited message.\r
+                 * @name ProtoBuf.Builder.Message#encodeDelimited\r
+                 * @function\r
+                 * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+                 * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+                 * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r
+                    var isNew = false;\r
+                    if (!buffer)\r
+                        buffer = new ByteBuffer(),\r
+                        isNew = true;\r
+                    var enc = new ByteBuffer().LE();\r
+                    T.encode(this, enc, noVerify).flip();\r
+                    buffer.writeVarint32(enc.remaining());\r
+                    buffer.append(enc);\r
+                    return isNew ? buffer.flip() : buffer;\r
+                };\r
+\r
+                /**\r
+                 * Directly encodes the message to an ArrayBuffer.\r
+                 * @name ProtoBuf.Builder.Message#encodeAB\r
+                 * @function\r
+                 * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeAB = function() {\r
+                    try {\r
+                        return this.encode().toArrayBuffer();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r
+                 * @name ProtoBuf.Builder.Message#toArrayBuffer\r
+                 * @function\r
+                 * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r
+\r
+                /**\r
+                 * Directly encodes the message to a node Buffer.\r
+                 * @name ProtoBuf.Builder.Message#encodeNB\r
+                 * @function\r
+                 * @return {!Buffer}\r
+                 * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r
+                 *  missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeNB = function() {\r
+                    try {\r
+                        return this.encode().toBuffer();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r
+                 * @name ProtoBuf.Builder.Message#toBuffer\r
+                 * @function\r
+                 * @return {!Buffer}\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded node Buffer in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r
+\r
+                /**\r
+                 * Directly encodes the message to a base64 encoded string.\r
+                 * @name ProtoBuf.Builder.Message#encode64\r
+                 * @function\r
+                 * @return {string} Base64 encoded string\r
+                 * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+                 *  still returns the encoded base64 string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encode64 = function() {\r
+                    try {\r
+                        return this.encode().toBase64();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r
+                 * @name ProtoBuf.Builder.Message#toBase64\r
+                 * @function\r
+                 * @return {string} Base64 encoded string\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded base64 string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toBase64 = MessagePrototype.encode64;\r
+\r
+                /**\r
+                 * Directly encodes the message to a hex encoded string.\r
+                 * @name ProtoBuf.Builder.Message#encodeHex\r
+                 * @function\r
+                 * @return {string} Hex encoded string\r
+                 * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+                 *  still returns the encoded hex string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeHex = function() {\r
+                    try {\r
+                        return this.encode().toHex();\r
+                    } catch (e) {\r
+                        if (e["encoded"]) e["encoded"] = e["encoded"].toHex();\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r
+                 * @name ProtoBuf.Builder.Message#toHex\r
+                 * @function\r
+                 * @return {string} Hex encoded string\r
+                 * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+                 *  returns the encoded hex string in the `encoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toHex = MessagePrototype.encodeHex;\r
+\r
+                /**\r
+                 * Clones a message object or field value to a raw object.\r
+                 * @param {*} obj Object to clone\r
+                 * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r
+                 * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+                 * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r
+                 * @returns {*} Cloned object\r
+                 * @inner\r
+                 */\r
+                function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r
+                    if (obj === null || typeof obj !== 'object') {\r
+                        // Convert enum values to their respective names\r
+                        if (resolvedType &amp;&amp; resolvedType instanceof ProtoBuf.Reflect.Enum) {\r
+                            var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r
+                            if (name !== null)\r
+                                return name;\r
+                        }\r
+                        // Pass-through string, number, boolean, null...\r
+                        return obj;\r
+                    }\r
+                    // Convert ByteBuffers to raw buffer or strings\r
+                    if (ByteBuffer.isByteBuffer(obj))\r
+                        return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r
+                    // Convert Longs to proper objects or strings\r
+                    if (ProtoBuf.Long.isLong(obj))\r
+                        return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r
+                    var clone;\r
+                    // Clone arrays\r
+                    if (Array.isArray(obj)) {\r
+                        clone = [];\r
+                        obj.forEach(function(v, k) {\r
+                            clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r
+                        });\r
+                        return clone;\r
+                    }\r
+                    clone = {};\r
+                    // Convert maps to objects\r
+                    if (obj instanceof ProtoBuf.Map) {\r
+                        var it = obj.entries();\r
+                        for (var e = it.next(); !e.done; e = it.next())\r
+                            clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r
+                        return clone;\r
+                    }\r
+                    // Everything else is a non-null object\r
+                    var type = obj.$type,\r
+                        field = undefined;\r
+                    for (var i in obj)\r
+                        if (obj.hasOwnProperty(i)) {\r
+                            if (type &amp;&amp; (field = type.getChild(i)))\r
+                                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r
+                            else\r
+                                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r
+                        }\r
+                    return clone;\r
+                }\r
+\r
+                /**\r
+                 * Returns the message's raw payload.\r
+                 * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r
+                 * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+                 * @returns {Object.&lt;string,*>} Raw payload\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r
+                    return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r
+                };\r
+\r
+                /**\r
+                 * Encodes a message to JSON.\r
+                 * @returns {string} JSON string\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.encodeJSON = function() {\r
+                    return JSON.stringify(\r
+                        cloneRaw(this,\r
+                             /* binary-as-base64 */ true,\r
+                             /* longs-as-strings */ true,\r
+                             this.$type\r
+                        )\r
+                    );\r
+                };\r
+\r
+                /**\r
+                 * Decodes a message from the specified buffer or string.\r
+                 * @name ProtoBuf.Builder.Message.decode\r
+                 * @function\r
+                 * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+                 * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r
+                 * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 * @see ProtoBuf.Builder.Message.decode64\r
+                 * @see ProtoBuf.Builder.Message.decodeHex\r
+                 */\r
+                Message.decode = function(buffer, length, enc) {\r
+                    if (typeof length === 'string')\r
+                        enc = length,\r
+                        length = -1;\r
+                    if (typeof buffer === 'string')\r
+                        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+                    else if (!ByteBuffer.isByteBuffer(buffer))\r
+                        buffer = ByteBuffer.wrap(buffer); // May throw\r
+                    var le = buffer.littleEndian;\r
+                    try {\r
+                        var msg = T.decode(buffer.LE(), length);\r
+                        buffer.LE(le);\r
+                        return msg;\r
+                    } catch (e) {\r
+                        buffer.LE(le);\r
+                        throw(e);\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Decodes a varint32 length-delimited message from the specified buffer or string.\r
+                 * @name ProtoBuf.Builder.Message.decodeDelimited\r
+                 * @function\r
+                 * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+                 * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+                 * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                Message.decodeDelimited = function(buffer, enc) {\r
+                    if (typeof buffer === 'string')\r
+                        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+                    else if (!ByteBuffer.isByteBuffer(buffer))\r
+                        buffer = ByteBuffer.wrap(buffer); // May throw\r
+                    if (buffer.remaining() &lt; 1)\r
+                        return null;\r
+                    var off = buffer.offset,\r
+                        len = buffer.readVarint32();\r
+                    if (buffer.remaining() &lt; len) {\r
+                        buffer.offset = off;\r
+                        return null;\r
+                    }\r
+                    try {\r
+                        var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r
+                        buffer.offset += len;\r
+                        return msg;\r
+                    } catch (err) {\r
+                        buffer.offset += len;\r
+                        throw err;\r
+                    }\r
+                };\r
+\r
+                /**\r
+                 * Decodes the message from the specified base64 encoded string.\r
+                 * @name ProtoBuf.Builder.Message.decode64\r
+                 * @function\r
+                 * @param {string} str String to decode from\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                Message.decode64 = function(str) {\r
+                    return Message.decode(str, "base64");\r
+                };\r
+\r
+                /**\r
+                 * Decodes the message from the specified hex encoded string.\r
+                 * @name ProtoBuf.Builder.Message.decodeHex\r
+                 * @function\r
+                 * @param {string} str String to decode from\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+                 *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+                 * @expose\r
+                 */\r
+                Message.decodeHex = function(str) {\r
+                    return Message.decode(str, "hex");\r
+                };\r
+\r
+                /**\r
+                 * Decodes the message from a JSON string.\r
+                 * @name ProtoBuf.Builder.Message.decodeJSON\r
+                 * @function\r
+                 * @param {string} str String to decode from\r
+                 * @return {!ProtoBuf.Builder.Message} Decoded message\r
+                 * @throws {Error} If the message cannot be decoded or if required fields are\r
+                 * missing.\r
+                 * @expose\r
+                 */\r
+                Message.decodeJSON = function(str) {\r
+                    return new Message(JSON.parse(str));\r
+                };\r
+\r
+                // Utility\r
+\r
+                /**\r
+                 * Returns a string representation of this Message.\r
+                 * @name ProtoBuf.Builder.Message#toString\r
+                 * @function\r
+                 * @return {string} String representation as of ".Fully.Qualified.MessageName"\r
+                 * @expose\r
+                 */\r
+                MessagePrototype.toString = function() {\r
+                    return T.toString();\r
+                };\r
+\r
+                // Properties\r
+\r
+                /**\r
+                 * Message options.\r
+                 * @name ProtoBuf.Builder.Message.$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $optionsS; // cc needs this\r
+\r
+                /**\r
+                 * Message options.\r
+                 * @name ProtoBuf.Builder.Message#$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $options;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Message.$type\r
+                 * @type {!ProtoBuf.Reflect.Message}\r
+                 * @expose\r
+                 */\r
+                var $typeS;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Message#$type\r
+                 * @type {!ProtoBuf.Reflect.Message}\r
+                 * @expose\r
+                 */\r
+                var $type;\r
+\r
+                if (Object.defineProperty)\r
+                    Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),\r
+                    Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),\r
+                    Object.defineProperty(Message, "$type", { "value": T }),\r
+                    Object.defineProperty(MessagePrototype, "$type", { "value": T });\r
+\r
+                return Message;\r
+\r
+            })(ProtoBuf, this);\r
+\r
+            // Static enums and prototyped sub-messages / cached collections\r
+            this._fields = [];\r
+            this._fieldsById = {};\r
+            this._fieldsByName = {};\r
+            this._oneofsByName = {};\r
+            for (var i=0, k=this.children.length, child; i&lt;k; i++) {\r
+                child = this.children[i];\r
+                if (child instanceof Enum || child instanceof Message || child instanceof Service) {\r
+                    if (clazz.hasOwnProperty(child.name))\r
+                        throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");\r
+                    clazz[child.name] = child.build();\r
+                } else if (child instanceof Message.Field)\r
+                    child.build(),\r
+                    this._fields.push(child),\r
+                    this._fieldsById[child.id] = child,\r
+                    this._fieldsByName[child.name] = child;\r
+                else if (child instanceof Message.OneOf) {\r
+                    this._oneofsByName[child.name] = child;\r
+                }\r
+                else if (!(child instanceof Message.OneOf) &amp;&amp; !(child instanceof Extension)) // Not built\r
+                    throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));\r
+            }\r
+\r
+            return this.clazz = clazz;\r
+        };\r
+\r
+        /**\r
+         * Encodes a runtime message's contents to the specified buffer.\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+         * @param {ByteBuffer} buffer ByteBuffer to write to\r
+         * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+         * @return {ByteBuffer} The ByteBuffer for chaining\r
+         * @throws {Error} If required fields are missing or the message cannot be encoded for another reason\r
+         * @expose\r
+         */\r
+        MessagePrototype.encode = function(message, buffer, noVerify) {\r
+            var fieldMissing = null,\r
+                field;\r
+            for (var i=0, k=this._fields.length, val; i&lt;k; ++i) {\r
+                field = this._fields[i];\r
+                val = message[field.name];\r
+                if (field.required &amp;&amp; val === null) {\r
+                    if (fieldMissing === null)\r
+                        fieldMissing = field;\r
+                } else\r
+                    field.encode(noVerify ? val : field.verifyValue(val), buffer, message);\r
+            }\r
+            if (fieldMissing !== null) {\r
+                var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);\r
+                err["encoded"] = buffer; // Still expose what we got\r
+                throw(err);\r
+            }\r
+            return buffer;\r
+        };\r
+\r
+        /**\r
+         * Calculates a runtime message's byte length.\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+         * @returns {number} Byte length\r
+         * @throws {Error} If required fields are missing or the message cannot be calculated for another reason\r
+         * @expose\r
+         */\r
+        MessagePrototype.calculate = function(message) {\r
+            for (var n=0, i=0, k=this._fields.length, field, val; i&lt;k; ++i) {\r
+                field = this._fields[i];\r
+                val = message[field.name];\r
+                if (field.required &amp;&amp; val === null)\r
+                   throw Error("Missing at least one required field for "+this.toString(true)+": "+field);\r
+                else\r
+                    n += field.calculate(val, message);\r
+            }\r
+            return n;\r
+        };\r
+\r
+        /**\r
+         * Skips all data until the end of the specified group has been reached.\r
+         * @param {number} expectedId Expected GROUPEND id\r
+         * @param {!ByteBuffer} buf ByteBuffer\r
+         * @returns {boolean} `true` if a value as been skipped, `false` if the end has been reached\r
+         * @throws {Error} If it wasn't possible to find the end of the group (buffer overrun or end tag mismatch)\r
+         * @inner\r
+         */\r
+        function skipTillGroupEnd(expectedId, buf) {\r
+            var tag = buf.readVarint32(), // Throws on OOB\r
+                wireType = tag &amp; 0x07,\r
+                id = tag >>> 3;\r
+            switch (wireType) {\r
+                case ProtoBuf.WIRE_TYPES.VARINT:\r
+                    do tag = buf.readUint8();\r
+                    while ((tag &amp; 0x80) === 0x80);\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.BITS64:\r
+                    buf.offset += 8;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.LDELIM:\r
+                    tag = buf.readVarint32(); // reads the varint\r
+                    buf.offset += tag;        // skips n bytes\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+                    skipTillGroupEnd(id, buf);\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.ENDGROUP:\r
+                    if (id === expectedId)\r
+                        return false;\r
+                    else\r
+                        throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");\r
+                case ProtoBuf.WIRE_TYPES.BITS32:\r
+                    buf.offset += 4;\r
+                    break;\r
+                default:\r
+                    throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);\r
+            }\r
+            return true;\r
+        }\r
+\r
+        /**\r
+         * Decodes an encoded message and returns the decoded message.\r
+         * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+         * @param {number=} length Message length. Defaults to decode all remaining data.\r
+         * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r
+         * @return {ProtoBuf.Builder.Message} Decoded message\r
+         * @throws {Error} If the message cannot be decoded\r
+         * @expose\r
+         */\r
+        MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r
+            if (typeof length !== 'number')\r
+                length = -1;\r
+            var start = buffer.offset,\r
+                msg = new (this.clazz)(),\r
+                tag, wireType, id, field;\r
+            while (buffer.offset &lt; start+length || (length === -1 &amp;&amp; buffer.remaining() > 0)) {\r
+                tag = buffer.readVarint32();\r
+                wireType = tag &amp; 0x07;\r
+                id = tag >>> 3;\r
+                if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r
+                    if (id !== expectedGroupEndId)\r
+                        throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");\r
+                    break;\r
+                }\r
+                if (!(field = this._fieldsById[id])) {\r
+                    // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing."\r
+                    switch (wireType) {\r
+                        case ProtoBuf.WIRE_TYPES.VARINT:\r
+                            buffer.readVarint32();\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.BITS32:\r
+                            buffer.offset += 4;\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.BITS64:\r
+                            buffer.offset += 8;\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.LDELIM:\r
+                            var len = buffer.readVarint32();\r
+                            buffer.offset += len;\r
+                            break;\r
+                        case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+                            while (skipTillGroupEnd(id, buffer)) {}\r
+                            break;\r
+                        default:\r
+                            throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);\r
+                    }\r
+                    continue;\r
+                }\r
+                if (field.repeated &amp;&amp; !field.options["packed"]) {\r
+                    msg[field.name].push(field.decode(wireType, buffer));\r
+                } else if (field.map) {\r
+                    var keyval = field.decode(wireType, buffer);\r
+                    msg[field.name].set(keyval[0], keyval[1]);\r
+                } else {\r
+                    msg[field.name] = field.decode(wireType, buffer);\r
+                    if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+                        var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r
+                        if (currentField !== null &amp;&amp; currentField !== field.name)\r
+                            msg[currentField] = null; // Clear currently set field\r
+                        msg[field.oneof.name] = field.name; // Point virtual field at this field\r
+                    }\r
+                }\r
+            }\r
+\r
+            // Check if all required fields are present and set default values for optional fields that are not\r
+            for (var i=0, k=this._fields.length; i&lt;k; ++i) {\r
+                field = this._fields[i];\r
+                if (msg[field.name] === null) {\r
+                    if (this.syntax === "proto3") { // Proto3 sets default values by specification\r
+                        msg[field.name] = field.defaultValue;\r
+                    } else if (field.required) {\r
+                        var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);\r
+                        err["decoded"] = msg; // Still expose what we got\r
+                        throw(err);\r
+                    } else if (ProtoBuf.populateDefaults &amp;&amp; field.defaultValue !== null)\r
+                        msg[field.name] = field.defaultValue;\r
+                }\r
+            }\r
+            return msg;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message\r
+         * @expose\r
+         */\r
+        Reflect.Message = Message;\r
+\r
+        /**\r
+         * Constructs a new Message Field.\r
+         * @exports ProtoBuf.Reflect.Message.Field\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+         * @param {string} rule Rule, one of requried, optional, repeated\r
+         * @param {string?} keytype Key data type, if any.\r
+         * @param {string} type Data type, e.g. int32\r
+         * @param {string} name Field name\r
+         * @param {number} id Unique field id\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r
+         * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r
+            T.call(this, builder, message, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Message.Field";\r
+\r
+            /**\r
+             * Message field required flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.required = rule === "required";\r
+\r
+            /**\r
+             * Message field repeated flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.repeated = rule === "repeated";\r
+\r
+            /**\r
+             * Message field map flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.map = rule === "map";\r
+\r
+            /**\r
+             * Message field key type. Type reference string if unresolved, protobuf\r
+             * type if resolved. Valid only if this.map === true, null otherwise.\r
+             * @type {string|{name: string, wireType: number}|null}\r
+             * @expose\r
+             */\r
+            this.keyType = keytype || null;\r
+\r
+            /**\r
+             * Message field type. Type reference string if unresolved, protobuf type if\r
+             * resolved. In a map field, this is the value type.\r
+             * @type {string|{name: string, wireType: number}}\r
+             * @expose\r
+             */\r
+            this.type = type;\r
+\r
+            /**\r
+             * Resolved type reference inside the global namespace.\r
+             * @type {ProtoBuf.Reflect.T|null}\r
+             * @expose\r
+             */\r
+            this.resolvedType = null;\r
+\r
+            /**\r
+             * Unique message field id.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.id = id;\r
+\r
+            /**\r
+             * Message field options.\r
+             * @type {!Object.&lt;string,*>}\r
+             * @dict\r
+             * @expose\r
+             */\r
+            this.options = options || {};\r
+\r
+            /**\r
+             * Default value.\r
+             * @type {*}\r
+             * @expose\r
+             */\r
+            this.defaultValue = null;\r
+\r
+            /**\r
+             * Enclosing OneOf.\r
+             * @type {?ProtoBuf.Reflect.Message.OneOf}\r
+             * @expose\r
+             */\r
+            this.oneof = oneof || null;\r
+\r
+            /**\r
+             * Syntax level of this definition (e.g., proto3).\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.syntax = syntax || 'proto2';\r
+\r
+            /**\r
+             * Original field name.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r
+\r
+            /**\r
+             * Element implementation. Created in build() after types are resolved.\r
+             * @type {ProtoBuf.Element}\r
+             * @expose\r
+             */\r
+            this.element = null;\r
+\r
+            /**\r
+             * Key element implementation, for map fields. Created in build() after\r
+             * types are resolved.\r
+             * @type {ProtoBuf.Element}\r
+             * @expose\r
+             */\r
+            this.keyElement = null;\r
+\r
+            // Convert field names to camel case notation if the override is set\r
+            if (this.builder.options['convertFieldsToCamelCase'] &amp;&amp; !(this instanceof Message.ExtensionField))\r
+                this.name = ProtoBuf.Util.toCamelCase(this.name);\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.Field.prototype\r
+         * @inner\r
+         */\r
+        var FieldPrototype = Field.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * Builds the field.\r
+         * @override\r
+         * @expose\r
+         */\r
+        FieldPrototype.build = function() {\r
+            this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r
+            if (this.map)\r
+                this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r
+\r
+            // In proto3, fields do not have field presence, and every field is set to\r
+            // its type's default value ("", 0, 0.0, or false).\r
+            if (this.syntax === 'proto3' &amp;&amp; !this.repeated &amp;&amp; !this.map)\r
+                this.defaultValue = Element.defaultFieldValue(this.type);\r
+\r
+            // Otherwise, default values are present when explicitly specified\r
+            else if (typeof this.options['default'] !== 'undefined')\r
+                this.defaultValue = this.verifyValue(this.options['default']);\r
+        };\r
+\r
+        /**\r
+         * Checks if the given value can be set for this field.\r
+         * @param {*} value Value to check\r
+         * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r
+         * @return {*} Verified, maybe adjusted, value\r
+         * @throws {Error} If the value cannot be set for this field\r
+         * @expose\r
+         */\r
+        FieldPrototype.verifyValue = function(value, skipRepeated) {\r
+            skipRepeated = skipRepeated || false;\r
+            var self = this;\r
+            function fail(val, msg) {\r
+                throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+            }\r
+            if (value === null) { // NULL values for optional fields\r
+                if (this.required)\r
+                    fail(typeof value, "required");\r
+                if (this.syntax === 'proto3' &amp;&amp; this.type !== ProtoBuf.TYPES["message"])\r
+                    fail(typeof value, "proto3 field without field presence cannot be null");\r
+                return null;\r
+            }\r
+            var i;\r
+            if (this.repeated &amp;&amp; !skipRepeated) { // Repeated values as arrays\r
+                if (!Array.isArray(value))\r
+                    value = [value];\r
+                var res = [];\r
+                for (i=0; i&lt;value.length; i++)\r
+                    res.push(this.element.verifyValue(value[i]));\r
+                return res;\r
+            }\r
+            if (this.map &amp;&amp; !skipRepeated) { // Map values as objects\r
+                if (!(value instanceof ProtoBuf.Map)) {\r
+                    // If not already a Map, attempt to convert.\r
+                    if (!(value instanceof Object)) {\r
+                        fail(typeof value,\r
+                             "expected ProtoBuf.Map or raw object for map field");\r
+                    }\r
+                    return new ProtoBuf.Map(this, value);\r
+                } else {\r
+                    return value;\r
+                }\r
+            }\r
+            // All non-repeated fields expect no array\r
+            if (!this.repeated &amp;&amp; Array.isArray(value))\r
+                fail(typeof value, "no array expected");\r
+\r
+            return this.element.verifyValue(value);\r
+        };\r
+\r
+        /**\r
+         * Determines whether the field will have a presence on the wire given its\r
+         * value.\r
+         * @param {*} value Verified field value\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+         * @return {boolean} Whether the field will be present on the wire\r
+         */\r
+        FieldPrototype.hasWirePresence = function(value, message) {\r
+            if (this.syntax !== 'proto3')\r
+                return (value !== null);\r
+            if (this.oneof &amp;&amp; message[this.oneof.name] === this.name)\r
+                return true;\r
+            switch (this.type) {\r
+                case ProtoBuf.TYPES["int32"]:\r
+                case ProtoBuf.TYPES["sint32"]:\r
+                case ProtoBuf.TYPES["sfixed32"]:\r
+                case ProtoBuf.TYPES["uint32"]:\r
+                case ProtoBuf.TYPES["fixed32"]:\r
+                    return value !== 0;\r
+\r
+                case ProtoBuf.TYPES["int64"]:\r
+                case ProtoBuf.TYPES["sint64"]:\r
+                case ProtoBuf.TYPES["sfixed64"]:\r
+                case ProtoBuf.TYPES["uint64"]:\r
+                case ProtoBuf.TYPES["fixed64"]:\r
+                    return value.low !== 0 || value.high !== 0;\r
+\r
+                case ProtoBuf.TYPES["bool"]:\r
+                    return value;\r
+\r
+                case ProtoBuf.TYPES["float"]:\r
+                case ProtoBuf.TYPES["double"]:\r
+                    return value !== 0.0;\r
+\r
+                case ProtoBuf.TYPES["string"]:\r
+                    return value.length > 0;\r
+\r
+                case ProtoBuf.TYPES["bytes"]:\r
+                    return value.remaining() > 0;\r
+\r
+                case ProtoBuf.TYPES["enum"]:\r
+                    return value !== 0;\r
+\r
+                case ProtoBuf.TYPES["message"]:\r
+                    return value !== null;\r
+                default:\r
+                    return true;\r
+            }\r
+        };\r
+\r
+        /**\r
+         * Encodes the specified field value to the specified buffer.\r
+         * @param {*} value Verified field value\r
+         * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+         * @return {ByteBuffer} The ByteBuffer for chaining\r
+         * @throws {Error} If the field cannot be encoded\r
+         * @expose\r
+         */\r
+        FieldPrototype.encode = function(value, buffer, message) {\r
+            if (this.type === null || typeof this.type !== 'object')\r
+                throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+            if (value === null || (this.repeated &amp;&amp; value.length == 0))\r
+                return buffer; // Optional omitted\r
+            try {\r
+                if (this.repeated) {\r
+                    var i;\r
+                    // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r
+                    // types) can be declared 'packed'."\r
+                    if (this.options["packed"] &amp;&amp; ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                        // "All of the elements of the field are packed into a single key-value pair with wire type 2\r
+                        // (length-delimited). Each element is encoded the same way it would be normally, except without a\r
+                        // tag preceding it."\r
+                        buffer.writeVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r
+                        var start = buffer.offset; // Remember where the contents begin\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            this.element.encodeValue(this.id, value[i], buffer);\r
+                        var len = buffer.offset-start,\r
+                            varintLen = ByteBuffer.calculateVarint32(len);\r
+                        if (varintLen > 1) { // We need to move the contents\r
+                            var contents = buffer.slice(start, buffer.offset);\r
+                            start += varintLen-1;\r
+                            buffer.offset = start;\r
+                            buffer.append(contents);\r
+                        }\r
+                        buffer.writeVarint32(len, start-varintLen);\r
+                    } else {\r
+                        // "If your message definition has repeated elements (without the [packed=true] option), the encoded\r
+                        // message has zero or more key-value pairs with the same tag number"\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            buffer.writeVarint32((this.id &lt;&lt; 3) | this.type.wireType),\r
+                            this.element.encodeValue(this.id, value[i], buffer);\r
+                    }\r
+                } else if (this.map) {\r
+                    // Write out each map entry as a submessage.\r
+                    value.forEach(function(val, key, m) {\r
+                        // Compute the length of the submessage (key, val) pair.\r
+                        var length =\r
+                            ByteBuffer.calculateVarint32((1 &lt;&lt; 3) | this.keyType.wireType) +\r
+                            this.keyElement.calculateLength(1, key) +\r
+                            ByteBuffer.calculateVarint32((2 &lt;&lt; 3) | this.type.wireType) +\r
+                            this.element.calculateLength(2, val);\r
+\r
+                        // Submessage with wire type of length-delimited.\r
+                        buffer.writeVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        buffer.writeVarint32(length);\r
+\r
+                        // Write out the key and val.\r
+                        buffer.writeVarint32((1 &lt;&lt; 3) | this.keyType.wireType);\r
+                        this.keyElement.encodeValue(1, key, buffer);\r
+                        buffer.writeVarint32((2 &lt;&lt; 3) | this.type.wireType);\r
+                        this.element.encodeValue(2, val, buffer);\r
+                    }, this);\r
+                } else {\r
+                    if (this.hasWirePresence(value, message)) {\r
+                        buffer.writeVarint32((this.id &lt;&lt; 3) | this.type.wireType);\r
+                        this.element.encodeValue(this.id, value, buffer);\r
+                    }\r
+                }\r
+            } catch (e) {\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+            }\r
+            return buffer;\r
+        };\r
+\r
+        /**\r
+         * Calculates the length of this field's value on the network level.\r
+         * @param {*} value Field value\r
+         * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+         * @returns {number} Byte length\r
+         * @expose\r
+         */\r
+        FieldPrototype.calculate = function(value, message) {\r
+            value = this.verifyValue(value); // May throw\r
+            if (this.type === null || typeof this.type !== 'object')\r
+                throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+            if (value === null || (this.repeated &amp;&amp; value.length == 0))\r
+                return 0; // Optional omitted\r
+            var n = 0;\r
+            try {\r
+                if (this.repeated) {\r
+                    var i, ni;\r
+                    if (this.options["packed"] &amp;&amp; ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                        n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        ni = 0;\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            ni += this.element.calculateLength(this.id, value[i]);\r
+                        n += ByteBuffer.calculateVarint32(ni);\r
+                        n += ni;\r
+                    } else {\r
+                        for (i=0; i&lt;value.length; i++)\r
+                            n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | this.type.wireType),\r
+                            n += this.element.calculateLength(this.id, value[i]);\r
+                    }\r
+                } else if (this.map) {\r
+                    // Each map entry becomes a submessage.\r
+                    value.forEach(function(val, key, m) {\r
+                        // Compute the length of the submessage (key, val) pair.\r
+                        var length =\r
+                            ByteBuffer.calculateVarint32((1 &lt;&lt; 3) | this.keyType.wireType) +\r
+                            this.keyElement.calculateLength(1, key) +\r
+                            ByteBuffer.calculateVarint32((2 &lt;&lt; 3) | this.type.wireType) +\r
+                            this.element.calculateLength(2, val);\r
+\r
+                        n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                        n += ByteBuffer.calculateVarint32(length);\r
+                        n += length;\r
+                    }, this);\r
+                } else {\r
+                    if (this.hasWirePresence(value, message)) {\r
+                        n += ByteBuffer.calculateVarint32((this.id &lt;&lt; 3) | this.type.wireType);\r
+                        n += this.element.calculateLength(this.id, value);\r
+                    }\r
+                }\r
+            } catch (e) {\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+            }\r
+            return n;\r
+        };\r
+\r
+        /**\r
+         * Decode the field value from the specified buffer.\r
+         * @param {number} wireType Leading wire type\r
+         * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+         * @param {boolean=} skipRepeated Whether to skip the repeated check or not. Defaults to false.\r
+         * @return {*} Decoded value: array for packed repeated fields, [key, value] for\r
+         *             map fields, or an individual value otherwise.\r
+         * @throws {Error} If the field cannot be decoded\r
+         * @expose\r
+         */\r
+        FieldPrototype.decode = function(wireType, buffer, skipRepeated) {\r
+            var value, nBytes;\r
+\r
+            // We expect wireType to match the underlying type's wireType unless we see\r
+            // a packed repeated field, or unless this is a map field.\r
+            var wireTypeOK =\r
+                (!this.map &amp;&amp; wireType == this.type.wireType) ||\r
+                (!skipRepeated &amp;&amp; this.repeated &amp;&amp; this.options["packed"] &amp;&amp;\r
+                 wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||\r
+                (this.map &amp;&amp; wireType == ProtoBuf.WIRE_TYPES.LDELIM);\r
+            if (!wireTypeOK)\r
+                throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");\r
+\r
+            // Handle packed repeated fields.\r
+            if (wireType == ProtoBuf.WIRE_TYPES.LDELIM &amp;&amp; this.repeated &amp;&amp; this.options["packed"] &amp;&amp; ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                if (!skipRepeated) {\r
+                    nBytes = buffer.readVarint32();\r
+                    nBytes = buffer.offset + nBytes; // Limit\r
+                    var values = [];\r
+                    while (buffer.offset &lt; nBytes)\r
+                        values.push(this.decode(this.type.wireType, buffer, true));\r
+                    return values;\r
+                }\r
+                // Read the next value otherwise...\r
+            }\r
+\r
+            // Handle maps.\r
+            if (this.map) {\r
+                // Read one (key, value) submessage, and return [key, value]\r
+                var key = Element.defaultFieldValue(this.keyType);\r
+                value = Element.defaultFieldValue(this.type);\r
+\r
+                // Read the length\r
+                nBytes = buffer.readVarint32();\r
+                if (buffer.remaining() &lt; nBytes)\r
+                    throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+\r
+                // Get a sub-buffer of this key/value submessage\r
+                var msgbuf = buffer.clone();\r
+                msgbuf.limit = msgbuf.offset + nBytes;\r
+                buffer.offset += nBytes;\r
+\r
+                while (msgbuf.remaining() > 0) {\r
+                    var tag = msgbuf.readVarint32();\r
+                    wireType = tag &amp; 0x07;\r
+                    var id = tag >>> 3;\r
+                    if (id === 1) {\r
+                        key = this.keyElement.decode(msgbuf, wireType, id);\r
+                    } else if (id === 2) {\r
+                        value = this.element.decode(msgbuf, wireType, id);\r
+                    } else {\r
+                        throw Error("Unexpected tag in map field key/value submessage");\r
+                    }\r
+                }\r
+\r
+                return [key, value];\r
+            }\r
+\r
+            // Handle singular and non-packed repeated field values.\r
+            return this.element.decode(buffer, wireType, this.id);\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.Field\r
+         * @expose\r
+         */\r
+        Reflect.Message.Field = Field;\r
+\r
+        /**\r
+         * Constructs a new Message ExtensionField.\r
+         * @exports ProtoBuf.Reflect.Message.ExtensionField\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+         * @param {string} rule Rule, one of requried, optional, repeated\r
+         * @param {string} type Data type, e.g. int32\r
+         * @param {string} name Field name\r
+         * @param {number} id Unique field id\r
+         * @param {!Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Message.Field\r
+         */\r
+        var ExtensionField = function(builder, message, rule, type, name, id, options) {\r
+            Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r
+\r
+            /**\r
+             * Extension reference.\r
+             * @type {!ProtoBuf.Reflect.Extension}\r
+             * @expose\r
+             */\r
+            this.extension;\r
+        };\r
+\r
+        // Extends Field\r
+        ExtensionField.prototype = Object.create(Field.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.ExtensionField\r
+         * @expose\r
+         */\r
+        Reflect.Message.ExtensionField = ExtensionField;\r
+\r
+        /**\r
+         * Constructs a new Message OneOf.\r
+         * @exports ProtoBuf.Reflect.Message.OneOf\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+         * @param {string} name OneOf name\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var OneOf = function(builder, message, name) {\r
+            T.call(this, builder, message, name);\r
+\r
+            /**\r
+             * Enclosed fields.\r
+             * @type {!Array.&lt;!ProtoBuf.Reflect.Message.Field>}\r
+             * @expose\r
+             */\r
+            this.fields = [];\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Message.OneOf\r
+         * @expose\r
+         */\r
+        Reflect.Message.OneOf = OneOf;\r
+\r
+        /**\r
+         * Constructs a new Enum.\r
+         * @exports ProtoBuf.Reflect.Enum\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r
+         * @param {string} name Enum name\r
+         * @param {Object.&lt;string,*>=} options Enum options\r
+         * @param {string?} syntax The syntax level (e.g., proto3)\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Namespace\r
+         */\r
+        var Enum = function(builder, parent, name, options, syntax) {\r
+            Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Enum";\r
+\r
+            /**\r
+             * Runtime enum object.\r
+             * @type {Object.&lt;string,number>|null}\r
+             * @expose\r
+             */\r
+            this.object = null;\r
+        };\r
+\r
+        /**\r
+         * Gets the string name of an enum value.\r
+         * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r
+         * @param {number} value Enum value\r
+         * @returns {?string} Name or `null` if not present\r
+         * @expose\r
+         */\r
+        Enum.getName = function(enm, value) {\r
+            var keys = Object.keys(enm);\r
+            for (var i=0, key; i&lt;keys.length; ++i)\r
+                if (enm[key = keys[i]] === value)\r
+                    return key;\r
+            return null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Enum.prototype\r
+         * @inner\r
+         */\r
+        var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);\r
+\r
+        /**\r
+         * Builds this enum and returns the runtime counterpart.\r
+         * @param {boolean} rebuild Whether to rebuild or not, defaults to false\r
+         * @returns {!Object.&lt;string,number>}\r
+         * @expose\r
+         */\r
+        EnumPrototype.build = function(rebuild) {\r
+            if (this.object &amp;&amp; !rebuild)\r
+                return this.object;\r
+            var enm = new ProtoBuf.Builder.Enum(),\r
+                values = this.getChildren(Enum.Value);\r
+            for (var i=0, k=values.length; i&lt;k; ++i)\r
+                enm[values[i]['name']] = values[i]['id'];\r
+            if (Object.defineProperty)\r
+                Object.defineProperty(enm, '$options', {\r
+                    "value": this.buildOpt(),\r
+                    "enumerable": false\r
+                });\r
+            return this.object = enm;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Enum\r
+         * @expose\r
+         */\r
+        Reflect.Enum = Enum;\r
+\r
+        /**\r
+         * Constructs a new Enum Value.\r
+         * @exports ProtoBuf.Reflect.Enum.Value\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Enum} enm Enum reference\r
+         * @param {string} name Field name\r
+         * @param {number} id Unique field id\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Value = function(builder, enm, name, id) {\r
+            T.call(this, builder, enm, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Enum.Value";\r
+\r
+            /**\r
+             * Unique enum value id.\r
+             * @type {number}\r
+             * @expose\r
+             */\r
+            this.id = id;\r
+        };\r
+\r
+        // Extends T\r
+        Value.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Enum.Value\r
+         * @expose\r
+         */\r
+        Reflect.Enum.Value = Value;\r
+\r
+        /**\r
+         * An extension (field).\r
+         * @exports ProtoBuf.Reflect.Extension\r
+         * @constructor\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.T} parent Parent object\r
+         * @param {string} name Object name\r
+         * @param {!ProtoBuf.Reflect.Message.Field} field Extension field\r
+         */\r
+        var Extension = function(builder, parent, name, field) {\r
+            T.call(this, builder, parent, name);\r
+\r
+            /**\r
+             * Extended message field.\r
+             * @type {!ProtoBuf.Reflect.Message.Field}\r
+             * @expose\r
+             */\r
+            this.field = field;\r
+        };\r
+\r
+        // Extends T\r
+        Extension.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Extension\r
+         * @expose\r
+         */\r
+        Reflect.Extension = Extension;\r
+\r
+        /**\r
+         * Constructs a new Service.\r
+         * @exports ProtoBuf.Reflect.Service\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Namespace} root Root\r
+         * @param {string} name Service name\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Namespace\r
+         */\r
+        var Service = function(builder, root, name, options) {\r
+            Namespace.call(this, builder, root, name, options);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Service";\r
+\r
+            /**\r
+             * Built runtime service class.\r
+             * @type {?function(new:ProtoBuf.Builder.Service)}\r
+             */\r
+            this.clazz = null;\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.prototype\r
+         * @inner\r
+         */\r
+        var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r
+\r
+        /**\r
+         * Builds the service and returns the runtime counterpart, which is a fully functional class.\r
+         * @see ProtoBuf.Builder.Service\r
+         * @param {boolean=} rebuild Whether to rebuild or not\r
+         * @return {Function} Service class\r
+         * @throws {Error} If the message cannot be built\r
+         * @expose\r
+         */\r
+        ServicePrototype.build = function(rebuild) {\r
+            if (this.clazz &amp;&amp; !rebuild)\r
+                return this.clazz;\r
+\r
+            // Create the runtime Service class in its own scope\r
+            return this.clazz = (function(ProtoBuf, T) {\r
+\r
+                /**\r
+                 * Constructs a new runtime Service.\r
+                 * @name ProtoBuf.Builder.Service\r
+                 * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r
+                 * @class Barebone of all runtime services.\r
+                 * @constructor\r
+                 * @throws {Error} If the service cannot be created\r
+                 */\r
+                var Service = function(rpcImpl) {\r
+                    ProtoBuf.Builder.Service.call(this);\r
+\r
+                    /**\r
+                     * Service implementation.\r
+                     * @name ProtoBuf.Builder.Service#rpcImpl\r
+                     * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r
+                     * @expose\r
+                     */\r
+                    this.rpcImpl = rpcImpl || function(name, msg, callback) {\r
+                        // This is what a user has to implement: A function receiving the method name, the actual message to\r
+                        // send (type checked) and the callback that's either provided with the error as its first\r
+                        // argument or null and the actual response message.\r
+                        setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async!\r
+                    };\r
+                };\r
+\r
+                /**\r
+                 * @alias ProtoBuf.Builder.Service.prototype\r
+                 * @inner\r
+                 */\r
+                var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r
+\r
+                /**\r
+                 * Asynchronously performs an RPC call using the given RPC implementation.\r
+                 * @name ProtoBuf.Builder.Service.[Method]\r
+                 * @function\r
+                 * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r
+                 * @param {ProtoBuf.Builder.Message} req Request\r
+                 * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+                 *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+                 * @abstract\r
+                 */\r
+\r
+                /**\r
+                 * Asynchronously performs an RPC call using the instance's RPC implementation.\r
+                 * @name ProtoBuf.Builder.Service#[Method]\r
+                 * @function\r
+                 * @param {ProtoBuf.Builder.Message} req Request\r
+                 * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+                 *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+                 * @abstract\r
+                 */\r
+\r
+                var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r
+                for (var i=0; i&lt;rpc.length; i++) {\r
+                    (function(method) {\r
+\r
+                        // service#Method(message, callback)\r
+                        ServicePrototype[method.name] = function(req, callback) {\r
+                            try {\r
+                                try {\r
+                                    // If given as a buffer, decode the request. Will throw a TypeError if not a valid buffer.\r
+                                    req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));\r
+                                } catch (err) {\r
+                                    if (!(err instanceof TypeError))\r
+                                        throw err;\r
+                                }\r
+                                if (req === null || typeof req !== 'object')\r
+                                    throw Error("Illegal arguments");\r
+                                if (!(req instanceof method.resolvedRequestType.clazz))\r
+                                    req = new method.resolvedRequestType.clazz(req);\r
+                                this.rpcImpl(method.fqn(), req, function(err, res) { // Assumes that this is properly async\r
+                                    if (err) {\r
+                                        callback(err);\r
+                                        return;\r
+                                    }\r
+                                    // Coalesce to empty string when service response has empty content\r
+                                    if (res === null)\r
+                                        res = ''\r
+                                    try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}\r
+                                    if (!res || !(res instanceof method.resolvedResponseType.clazz)) {\r
+                                        callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));\r
+                                        return;\r
+                                    }\r
+                                    callback(null, res);\r
+                                });\r
+                            } catch (err) {\r
+                                setTimeout(callback.bind(this, err), 0);\r
+                            }\r
+                        };\r
+\r
+                        // Service.Method(rpcImpl, message, callback)\r
+                        Service[method.name] = function(rpcImpl, req, callback) {\r
+                            new Service(rpcImpl)[method.name](req, callback);\r
+                        };\r
+\r
+                        if (Object.defineProperty)\r
+                            Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),\r
+                            Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });\r
+                    })(rpc[i]);\r
+                }\r
+\r
+                // Properties\r
+\r
+                /**\r
+                 * Service options.\r
+                 * @name ProtoBuf.Builder.Service.$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $optionsS; // cc needs this\r
+\r
+                /**\r
+                 * Service options.\r
+                 * @name ProtoBuf.Builder.Service#$options\r
+                 * @type {Object.&lt;string,*>}\r
+                 * @expose\r
+                 */\r
+                var $options;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Service.$type\r
+                 * @type {!ProtoBuf.Reflect.Service}\r
+                 * @expose\r
+                 */\r
+                var $typeS;\r
+\r
+                /**\r
+                 * Reflection type.\r
+                 * @name ProtoBuf.Builder.Service#$type\r
+                 * @type {!ProtoBuf.Reflect.Service}\r
+                 * @expose\r
+                 */\r
+                var $type;\r
+\r
+                if (Object.defineProperty)\r
+                    Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),\r
+                    Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),\r
+                    Object.defineProperty(Service, "$type", { "value": T }),\r
+                    Object.defineProperty(ServicePrototype, "$type", { "value": T });\r
+\r
+                return Service;\r
+\r
+            })(ProtoBuf, this);\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service\r
+         * @expose\r
+         */\r
+        Reflect.Service = Service;\r
+\r
+        /**\r
+         * Abstract service method.\r
+         * @exports ProtoBuf.Reflect.Service.Method\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Service} svc Service\r
+         * @param {string} name Method name\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.T\r
+         */\r
+        var Method = function(builder, svc, name, options) {\r
+            T.call(this, builder, svc, name);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Service.Method";\r
+\r
+            /**\r
+             * Options.\r
+             * @type {Object.&lt;string, *>}\r
+             * @expose\r
+             */\r
+            this.options = options || {};\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.Method.prototype\r
+         * @inner\r
+         */\r
+        var MethodPrototype = Method.prototype = Object.create(T.prototype);\r
+\r
+        /**\r
+         * Builds the method's '$options' property.\r
+         * @name ProtoBuf.Reflect.Service.Method#buildOpt\r
+         * @function\r
+         * @return {Object.&lt;string,*>}\r
+         */\r
+        MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.Method\r
+         * @expose\r
+         */\r
+        Reflect.Service.Method = Method;\r
+\r
+        /**\r
+         * RPC service method.\r
+         * @exports ProtoBuf.Reflect.Service.RPCMethod\r
+         * @param {!ProtoBuf.Builder} builder Builder reference\r
+         * @param {!ProtoBuf.Reflect.Service} svc Service\r
+         * @param {string} name Method name\r
+         * @param {string} request Request message name\r
+         * @param {string} response Response message name\r
+         * @param {boolean} request_stream Whether requests are streamed\r
+         * @param {boolean} response_stream Whether responses are streamed\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         * @extends ProtoBuf.Reflect.Service.Method\r
+         */\r
+        var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r
+            Method.call(this, builder, svc, name, options);\r
+\r
+            /**\r
+             * @override\r
+             */\r
+            this.className = "Service.RPCMethod";\r
+\r
+            /**\r
+             * Request message name.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.requestName = request;\r
+\r
+            /**\r
+             * Response message name.\r
+             * @type {string}\r
+             * @expose\r
+             */\r
+            this.responseName = response;\r
+\r
+            /**\r
+             * Whether requests are streamed\r
+             * @type {bool}\r
+             * @expose\r
+             */\r
+            this.requestStream = request_stream;\r
+\r
+            /**\r
+             * Whether responses are streamed\r
+             * @type {bool}\r
+             * @expose\r
+             */\r
+            this.responseStream = response_stream;\r
+\r
+            /**\r
+             * Resolved request message type.\r
+             * @type {ProtoBuf.Reflect.Message}\r
+             * @expose\r
+             */\r
+            this.resolvedRequestType = null;\r
+\r
+            /**\r
+             * Resolved response message type.\r
+             * @type {ProtoBuf.Reflect.Message}\r
+             * @expose\r
+             */\r
+            this.resolvedResponseType = null;\r
+        };\r
+\r
+        // Extends Method\r
+        RPCMethod.prototype = Object.create(Method.prototype);\r
+\r
+        /**\r
+         * @alias ProtoBuf.Reflect.Service.RPCMethod\r
+         * @expose\r
+         */\r
+        Reflect.Service.RPCMethod = RPCMethod;\r
+\r
+        return Reflect;\r
+\r
+    })(ProtoBuf);\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder\r
+     * @expose\r
+     */\r
+    ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Constructs a new Builder.\r
+         * @exports ProtoBuf.Builder\r
+         * @class Provides the functionality to build protocol messages.\r
+         * @param {Object.&lt;string,*>=} options Options\r
+         * @constructor\r
+         */\r
+        var Builder = function(options) {\r
+\r
+            /**\r
+             * Namespace.\r
+             * @type {ProtoBuf.Reflect.Namespace}\r
+             * @expose\r
+             */\r
+            this.ns = new Reflect.Namespace(this, null, ""); // Global namespace\r
+\r
+            /**\r
+             * Namespace pointer.\r
+             * @type {ProtoBuf.Reflect.T}\r
+             * @expose\r
+             */\r
+            this.ptr = this.ns;\r
+\r
+            /**\r
+             * Resolved flag.\r
+             * @type {boolean}\r
+             * @expose\r
+             */\r
+            this.resolved = false;\r
+\r
+            /**\r
+             * The current building result.\r
+             * @type {Object.&lt;string,ProtoBuf.Builder.Message|Object>|null}\r
+             * @expose\r
+             */\r
+            this.result = null;\r
+\r
+            /**\r
+             * Imported files.\r
+             * @type {Array.&lt;string>}\r
+             * @expose\r
+             */\r
+            this.files = {};\r
+\r
+            /**\r
+             * Import root override.\r
+             * @type {?string}\r
+             * @expose\r
+             */\r
+            this.importRoot = null;\r
+\r
+            /**\r
+             * Options.\r
+             * @type {!Object.&lt;string, *>}\r
+             * @expose\r
+             */\r
+            this.options = options || {};\r
+        };\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.prototype\r
+         * @inner\r
+         */\r
+        var BuilderPrototype = Builder.prototype;\r
+\r
+        // ----- Definition tests -----\r
+\r
+        /**\r
+         * Tests if a definition most likely describes a message.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isMessage = function(def) {\r
+            // Messages require a string name\r
+            if (typeof def["name"] !== 'string')\r
+                return false;\r
+            // Messages do not contain values (enum) or rpc methods (service)\r
+            if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes a message field.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isMessageField = function(def) {\r
+            // Message fields require a string rule, name and type and an id\r
+            if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes an enum.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isEnum = function(def) {\r
+            // Enums require a string name\r
+            if (typeof def["name"] !== 'string')\r
+                return false;\r
+            // Enums require at least one value\r
+            if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes a service.\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isService = function(def) {\r
+            // Services require a string name and an rpc object\r
+            if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        /**\r
+         * Tests if a definition most likely describes an extended message\r
+         * @param {!Object} def\r
+         * @returns {boolean}\r
+         * @expose\r
+         */\r
+        Builder.isExtend = function(def) {\r
+            // Extends rquire a string ref\r
+            if (typeof def["ref"] !== 'string')\r
+                return false;\r
+            return true;\r
+        };\r
+\r
+        // ----- Building -----\r
+\r
+        /**\r
+         * Resets the pointer to the root namespace.\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @expose\r
+         */\r
+        BuilderPrototype.reset = function() {\r
+            this.ptr = this.ns;\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Defines a namespace on top of the current pointer position and places the pointer on it.\r
+         * @param {string} namespace\r
+         * @return {!ProtoBuf.Builder} this\r
+         * @expose\r
+         */\r
+        BuilderPrototype.define = function(namespace) {\r
+            if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r
+                throw Error("illegal namespace: "+namespace);\r
+            namespace.split(".").forEach(function(part) {\r
+                var ns = this.ptr.getChild(part);\r
+                if (ns === null) // Keep existing\r
+                    this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r
+                this.ptr = ns;\r
+            }, this);\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Creates the specified definitions at the current pointer position.\r
+         * @param {!Array.&lt;!Object>} defs Messages, enums or services to create\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @throws {Error} If a message definition is invalid\r
+         * @expose\r
+         */\r
+        BuilderPrototype.create = function(defs) {\r
+            if (!defs)\r
+                return this; // Nothing to create\r
+            if (!Array.isArray(defs))\r
+                defs = [defs];\r
+            else {\r
+                if (defs.length === 0)\r
+                    return this;\r
+                defs = defs.slice();\r
+            }\r
+\r
+            // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r
+            var stack = [defs];\r
+            while (stack.length > 0) {\r
+                defs = stack.pop();\r
+\r
+                if (!Array.isArray(defs)) // Stack always contains entire namespaces\r
+                    throw Error("not a valid namespace: "+JSON.stringify(defs));\r
+\r
+                while (defs.length > 0) {\r
+                    var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r
+\r
+                    if (Builder.isMessage(def)) {\r
+                        var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);\r
+\r
+                        // Create OneOfs\r
+                        var oneofs = {};\r
+                        if (def["oneofs"])\r
+                            Object.keys(def["oneofs"]).forEach(function(name) {\r
+                                obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r
+                            }, this);\r
+\r
+                        // Create fields\r
+                        if (def["fields"])\r
+                            def["fields"].forEach(function(fld) {\r
+                                if (obj.getChild(fld["id"]|0) !== null)\r
+                                    throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);\r
+                                if (fld["options"] &amp;&amp; typeof fld["options"] !== 'object')\r
+                                    throw Error("illegal field options in "+obj.name+"#"+fld["name"]);\r
+                                var oneof = null;\r
+                                if (typeof fld["oneof"] === 'string' &amp;&amp; !(oneof = oneofs[fld["oneof"]]))\r
+                                    throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);\r
+                                fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);\r
+                                if (oneof)\r
+                                    oneof.fields.push(fld);\r
+                                obj.addChild(fld);\r
+                            }, this);\r
+\r
+                        // Push children to stack\r
+                        var subObj = [];\r
+                        if (def["enums"])\r
+                            def["enums"].forEach(function(enm) {\r
+                                subObj.push(enm);\r
+                            });\r
+                        if (def["messages"])\r
+                            def["messages"].forEach(function(msg) {\r
+                                subObj.push(msg);\r
+                            });\r
+                        if (def["services"])\r
+                            def["services"].forEach(function(svc) {\r
+                                subObj.push(svc);\r
+                            });\r
+\r
+                        // Set extension ranges\r
+                        if (def["extensions"]) {\r
+                            if (typeof def["extensions"][0] === 'number') // pre 5.0.1\r
+                                obj.extensions = [ def["extensions"] ];\r
+                            else\r
+                                obj.extensions = def["extensions"];\r
+                        }\r
+\r
+                        // Create on top of current namespace\r
+                        this.ptr.addChild(obj);\r
+                        if (subObj.length > 0) {\r
+                            stack.push(defs); // Push the current level back\r
+                            defs = subObj; // Continue processing sub level\r
+                            subObj = null;\r
+                            this.ptr = obj; // And move the pointer to this namespace\r
+                            obj = null;\r
+                            continue;\r
+                        }\r
+                        subObj = null;\r
+\r
+                    } else if (Builder.isEnum(def)) {\r
+\r
+                        obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);\r
+                        def["values"].forEach(function(val) {\r
+                            obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));\r
+                        }, this);\r
+                        this.ptr.addChild(obj);\r
+\r
+                    } else if (Builder.isService(def)) {\r
+\r
+                        obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);\r
+                        Object.keys(def["rpc"]).forEach(function(name) {\r
+                            var mtd = def["rpc"][name];\r
+                            obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));\r
+                        }, this);\r
+                        this.ptr.addChild(obj);\r
+\r
+                    } else if (Builder.isExtend(def)) {\r
+\r
+                        obj = this.ptr.resolve(def["ref"], true);\r
+                        if (obj) {\r
+                            def["fields"].forEach(function(fld) {\r
+                                if (obj.getChild(fld['id']|0) !== null)\r
+                                    throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);\r
+                                // Check if field id is allowed to be extended\r
+                                if (obj.extensions) {\r
+                                    var valid = false;\r
+                                    obj.extensions.forEach(function(range) {\r
+                                        if (fld["id"] >= range[0] &amp;&amp; fld["id"] &lt;= range[1])\r
+                                            valid = true;\r
+                                    });\r
+                                    if (!valid)\r
+                                        throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");\r
+                                }\r
+                                // Convert extension field names to camel case notation if the override is set\r
+                                var name = fld["name"];\r
+                                if (this.options['convertFieldsToCamelCase'])\r
+                                    name = ProtoBuf.Util.toCamelCase(name);\r
+                                // see #161: Extensions use their fully qualified name as their runtime key and...\r
+                                var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);\r
+                                // ...are added on top of the current namespace as an extension which is used for\r
+                                // resolving their type later on (the extension always keeps the original name to\r
+                                // prevent naming collisions)\r
+                                var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);\r
+                                field.extension = ext;\r
+                                this.ptr.addChild(ext);\r
+                                obj.addChild(field);\r
+                            }, this);\r
+\r
+                        } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions\r
+                            throw Error("extended message "+def["ref"]+" is not defined");\r
+\r
+                    } else\r
+                        throw Error("not a valid definition: "+JSON.stringify(def));\r
+\r
+                    def = null;\r
+                    obj = null;\r
+                }\r
+                // Break goes here\r
+                defs = null;\r
+                this.ptr = this.ptr.parent; // Namespace done, continue at parent\r
+            }\r
+            this.resolved = false; // Require re-resolve\r
+            this.result = null; // Require re-build\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Propagates syntax to all children.\r
+         * @param {!Object} parent\r
+         * @inner\r
+         */\r
+        function propagateSyntax(parent) {\r
+            if (parent['messages']) {\r
+                parent['messages'].forEach(function(child) {\r
+                    child["syntax"] = parent["syntax"];\r
+                    propagateSyntax(child);\r
+                });\r
+            }\r
+            if (parent['enums']) {\r
+                parent['enums'].forEach(function(child) {\r
+                    child["syntax"] = parent["syntax"];\r
+                });\r
+            }\r
+        }\r
+\r
+        /**\r
+         * Imports another definition into this builder.\r
+         * @param {Object.&lt;string,*>} json Parsed import\r
+         * @param {(string|{root: string, file: string})=} filename Imported file name\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @throws {Error} If the definition or file cannot be imported\r
+         * @expose\r
+         */\r
+        BuilderPrototype["import"] = function(json, filename) {\r
+            var delim = '/';\r
+\r
+            // Make sure to skip duplicate imports\r
+\r
+            if (typeof filename === 'string') {\r
+\r
+                if (ProtoBuf.Util.IS_NODE)\r
+                    filename = require("path")['resolve'](filename);\r
+                if (this.files[filename] === true)\r
+                    return this.reset();\r
+                this.files[filename] = true;\r
+\r
+            } else if (typeof filename === 'object') { // Object with root, file.\r
+\r
+                var root = filename.root;\r
+                if (ProtoBuf.Util.IS_NODE)\r
+                    root = require("path")['resolve'](root);\r
+                if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)\r
+                    delim = '\\';\r
+                var fname;\r
+                if (ProtoBuf.Util.IS_NODE)\r
+                    fname = require("path")['join'](root, filename.file);\r
+                else\r
+                    fname = root + delim + filename.file;\r
+                if (this.files[fname] === true)\r
+                    return this.reset();\r
+                this.files[fname] = true;\r
+            }\r
+\r
+            // Import imports\r
+\r
+            if (json['imports'] &amp;&amp; json['imports'].length > 0) {\r
+                var importRoot,\r
+                    resetRoot = false;\r
+\r
+                if (typeof filename === 'object') { // If an import root is specified, override\r
+\r
+                    this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards\r
+                    importRoot = this.importRoot;\r
+                    filename = filename["file"];\r
+                    if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)\r
+                        delim = '\\';\r
+\r
+                } else if (typeof filename === 'string') {\r
+\r
+                    if (this.importRoot) // If import root is overridden, use it\r
+                        importRoot = this.importRoot;\r
+                    else { // Otherwise compute from filename\r
+                        if (filename.indexOf("/") >= 0) { // Unix\r
+                            importRoot = filename.replace(/\/[^\/]*$/, "");\r
+                            if (/* /file.proto */ importRoot === "")\r
+                                importRoot = "/";\r
+                        } else if (filename.indexOf("\\") >= 0) { // Windows\r
+                            importRoot = filename.replace(/\\[^\\]*$/, "");\r
+                            delim = '\\';\r
+                        } else\r
+                            importRoot = ".";\r
+                    }\r
+\r
+                } else\r
+                    importRoot = null;\r
+\r
+                for (var i=0; i&lt;json['imports'].length; i++) {\r
+                    if (typeof json['imports'][i] === 'string') { // Import file\r
+                        if (!importRoot)\r
+                            throw Error("cannot determine import root");\r
+                        var importFilename = json['imports'][i];\r
+                        if (importFilename === "google/protobuf/descriptor.proto")\r
+                            continue; // Not needed and therefore not used\r
+                        if (ProtoBuf.Util.IS_NODE)\r
+                            importFilename = require("path")['join'](importRoot, importFilename);\r
+                        else\r
+                            importFilename = importRoot + delim + importFilename;\r
+                        if (this.files[importFilename] === true)\r
+                            continue; // Already imported\r
+                        if (/\.proto$/i.test(importFilename) &amp;&amp; !ProtoBuf.DotProto)       // If this is a light build\r
+                            importFilename = importFilename.replace(/\.proto$/, ".json"); // always load the JSON file\r
+                        var contents = ProtoBuf.Util.fetch(importFilename);\r
+                        if (contents === null)\r
+                            throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");\r
+                        if (/\.json$/i.test(importFilename)) // Always possible\r
+                            this["import"](JSON.parse(contents+""), importFilename); // May throw\r
+                        else\r
+                            this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename); // May throw\r
+                    } else // Import structure\r
+                        if (!filename)\r
+                            this["import"](json['imports'][i]);\r
+                        else if (/\.(\w+)$/.test(filename)) // With extension: Append _importN to the name portion to make it unique\r
+                            this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));\r
+                        else // Without extension: Append _importN to make it unique\r
+                            this["import"](json['imports'][i], filename+"_import"+i);\r
+                }\r
+                if (resetRoot) // Reset import root override when all imports are done\r
+                    this.importRoot = null;\r
+            }\r
+\r
+            // Import structures\r
+\r
+            if (json['package'])\r
+                this.define(json['package']);\r
+            if (json['syntax'])\r
+                propagateSyntax(json);\r
+            var base = this.ptr;\r
+            if (json['options'])\r
+                Object.keys(json['options']).forEach(function(key) {\r
+                    base.options[key] = json['options'][key];\r
+                });\r
+            if (json['messages'])\r
+                this.create(json['messages']),\r
+                this.ptr = base;\r
+            if (json['enums'])\r
+                this.create(json['enums']),\r
+                this.ptr = base;\r
+            if (json['services'])\r
+                this.create(json['services']),\r
+                this.ptr = base;\r
+            if (json['extends'])\r
+                this.create(json['extends']);\r
+\r
+            return this.reset();\r
+        };\r
+\r
+        /**\r
+         * Resolves all namespace objects.\r
+         * @throws {Error} If a type cannot be resolved\r
+         * @returns {!ProtoBuf.Builder} this\r
+         * @expose\r
+         */\r
+        BuilderPrototype.resolveAll = function() {\r
+            // Resolve all reflected objects\r
+            var res;\r
+            if (this.ptr == null || typeof this.ptr.type === 'object')\r
+                return this; // Done (already resolved)\r
+\r
+            if (this.ptr instanceof Reflect.Namespace) { // Resolve children\r
+\r
+                this.ptr.children.forEach(function(child) {\r
+                    this.ptr = child;\r
+                    this.resolveAll();\r
+                }, this);\r
+\r
+            } else if (this.ptr instanceof Reflect.Message.Field) { // Resolve type\r
+\r
+                if (!Lang.TYPE.test(this.ptr.type)) {\r
+                    if (!Lang.TYPEREF.test(this.ptr.type))\r
+                        throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                    res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);\r
+                    if (!res)\r
+                        throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                    this.ptr.resolvedType = res;\r
+                    if (res instanceof Reflect.Enum) {\r
+                        this.ptr.type = ProtoBuf.TYPES["enum"];\r
+                        if (this.ptr.syntax === 'proto3' &amp;&amp; res.syntax !== 'proto3')\r
+                            throw Error("proto3 message cannot reference proto2 enum");\r
+                    }\r
+                    else if (res instanceof Reflect.Message)\r
+                        this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];\r
+                    else\r
+                        throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                } else\r
+                    this.ptr.type = ProtoBuf.TYPES[this.ptr.type];\r
+\r
+                // If it's a map field, also resolve the key type. The key type can be only a numeric, string, or bool type\r
+                // (i.e., no enums or messages), so we don't need to resolve against the current namespace.\r
+                if (this.ptr.map) {\r
+                    if (!Lang.TYPE.test(this.ptr.keyType))\r
+                        throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);\r
+                    this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];\r
+                }\r
+\r
+                // If it's a repeated and packable field then proto3 mandates it should be packed by\r
+                // default\r
+                if (\r
+                  this.ptr.syntax === 'proto3' &amp;&amp;\r
+                  this.ptr.repeated &amp;&amp; this.ptr.options.packed === undefined &amp;&amp;\r
+                  ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1\r
+                ) {\r
+                  this.ptr.options.packed = true;\r
+                }\r
+\r
+            } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {\r
+\r
+                if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {\r
+                    res = this.ptr.parent.resolve(this.ptr.requestName, true);\r
+                    if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                        throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);\r
+                    this.ptr.resolvedRequestType = res;\r
+                    res = this.ptr.parent.resolve(this.ptr.responseName, true);\r
+                    if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                        throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);\r
+                    this.ptr.resolvedResponseType = res;\r
+                } else // Should not happen as nothing else is implemented\r
+                    throw Error("illegal service type in "+this.ptr.toString(true));\r
+\r
+            } else if (\r
+                !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) &amp;&amp; // Not built\r
+                !(this.ptr instanceof ProtoBuf.Reflect.Extension) &amp;&amp; // Not built\r
+                !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value) // Built in enum\r
+            )\r
+                throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);\r
+\r
+            return this.reset();\r
+        };\r
+\r
+        /**\r
+         * Builds the protocol. This will first try to resolve all definitions and, if this has been successful,\r
+         * return the built package.\r
+         * @param {(string|Array.&lt;string>)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r
+         * @returns {!ProtoBuf.Builder.Message|!Object.&lt;string,*>}\r
+         * @throws {Error} If a type could not be resolved\r
+         * @expose\r
+         */\r
+        BuilderPrototype.build = function(path) {\r
+            this.reset();\r
+            if (!this.resolved)\r
+                this.resolveAll(),\r
+                this.resolved = true,\r
+                this.result = null; // Require re-build\r
+            if (this.result === null) // (Re-)Build\r
+                this.result = this.ns.build();\r
+            if (!path)\r
+                return this.result;\r
+            var part = typeof path === 'string' ? path.split(".") : path,\r
+                ptr = this.result; // Build namespace pointer (no hasChild etc.)\r
+            for (var i=0; i&lt;part.length; i++)\r
+                if (ptr[part[i]])\r
+                    ptr = ptr[part[i]];\r
+                else {\r
+                    ptr = null;\r
+                    break;\r
+                }\r
+            return ptr;\r
+        };\r
+\r
+        /**\r
+         * Similar to {@link ProtoBuf.Builder#build}, but looks up the internal reflection descriptor.\r
+         * @param {string=} path Specifies what to return. If omitted, the entire namespace wiil be returned.\r
+         * @param {boolean=} excludeNonNamespace Excludes non-namespace types like fields, defaults to `false`\r
+         * @returns {?ProtoBuf.Reflect.T} Reflection descriptor or `null` if not found\r
+         */\r
+        BuilderPrototype.lookup = function(path, excludeNonNamespace) {\r
+            return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;\r
+        };\r
+\r
+        /**\r
+         * Returns a string representation of this object.\r
+         * @return {string} String representation as of "Builder"\r
+         * @expose\r
+         */\r
+        BuilderPrototype.toString = function() {\r
+            return "Builder";\r
+        };\r
+\r
+        // ----- Base classes -----\r
+        // Exist for the sole purpose of being able to "... instanceof ProtoBuf.Builder.Message" etc.\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.Message\r
+         */\r
+        Builder.Message = function() {};\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.Enum\r
+         */\r
+        Builder.Enum = function() {};\r
+\r
+        /**\r
+         * @alias ProtoBuf.Builder.Message\r
+         */\r
+        Builder.Service = function() {};\r
+\r
+        return Builder;\r
+\r
+    })(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);\r
+\r
+    /**\r
+     * @alias ProtoBuf.Map\r
+     * @expose\r
+     */\r
+    ProtoBuf.Map = (function(ProtoBuf, Reflect) {\r
+        "use strict";\r
+\r
+        /**\r
+         * Constructs a new Map. A Map is a container that is used to implement map\r
+         * fields on message objects. It closely follows the ES6 Map API; however,\r
+         * it is distinct because we do not want to depend on external polyfills or\r
+         * on ES6 itself.\r
+         *\r
+         * @exports ProtoBuf.Map\r
+         * @param {!ProtoBuf.Reflect.Field} field Map field\r
+         * @param {Object.&lt;string,*>=} contents Initial contents\r
+         * @constructor\r
+         */\r
+        var Map = function(field, contents) {\r
+            if (!field.map)\r
+                throw Error("field is not a map");\r
+\r
+            /**\r
+             * The field corresponding to this map.\r
+             * @type {!ProtoBuf.Reflect.Field}\r
+             */\r
+            this.field = field;\r
+\r
+            /**\r
+             * Element instance corresponding to key type.\r
+             * @type {!ProtoBuf.Reflect.Element}\r
+             */\r
+            this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r
+\r
+            /**\r
+             * Element instance corresponding to value type.\r
+             * @type {!ProtoBuf.Reflect.Element}\r
+             */\r
+            this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r
+\r
+            /**\r
+             * Internal map: stores mapping of (string form of key) -> (key, value)\r
+             * pair.\r
+             *\r
+             * We provide map semantics for arbitrary key types, but we build on top\r
+             * of an Object, which has only string keys. In order to avoid the need\r
+             * to convert a string key back to its native type in many situations,\r
+             * we store the native key value alongside the value. Thus, we only need\r
+             * a one-way mapping from a key type to its string form that guarantees\r
+             * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r
+             * === K2).\r
+             *\r
+             * @type {!Object&lt;string, {key: *, value: *}>}\r
+             */\r
+            this.map = {};\r
+\r
+            /**\r
+             * Returns the number of elements in the map.\r
+             */\r
+            Object.defineProperty(this, "size", {\r
+                get: function() { return Object.keys(this.map).length; }\r
+            });\r
+\r
+            // Fill initial contents from a raw object.\r
+            if (contents) {\r
+                var keys = Object.keys(contents);\r
+                for (var i = 0; i &lt; keys.length; i++) {\r
+                    var key = this.keyElem.valueFromString(keys[i]);\r
+                    var val = this.valueElem.verifyValue(contents[keys[i]]);\r
+                    this.map[this.keyElem.valueToString(key)] =\r
+                        { key: key, value: val };\r
+                }\r
+            }\r
+        };\r
+\r
+        var MapPrototype = Map.prototype;\r
+\r
+        /**\r
+         * Helper: return an iterator over an array.\r
+         * @param {!Array&lt;*>} arr the array\r
+         * @returns {!Object} an iterator\r
+         * @inner\r
+         */\r
+        function arrayIterator(arr) {\r
+            var idx = 0;\r
+            return {\r
+                next: function() {\r
+                    if (idx &lt; arr.length)\r
+                        return { done: false, value: arr[idx++] };\r
+                    return { done: true };\r
+                }\r
+            }\r
+        }\r
+\r
+        /**\r
+         * Clears the map.\r
+         */\r
+        MapPrototype.clear = function() {\r
+            this.map = {};\r
+        };\r
+\r
+        /**\r
+         * Deletes a particular key from the map.\r
+         * @returns {boolean} Whether any entry with this key was deleted.\r
+         */\r
+        MapPrototype["delete"] = function(key) {\r
+            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+            var hadKey = keyValue in this.map;\r
+            delete this.map[keyValue];\r
+            return hadKey;\r
+        };\r
+\r
+        /**\r
+         * Returns an iterator over [key, value] pairs in the map.\r
+         * @returns {Object} The iterator\r
+         */\r
+        MapPrototype.entries = function() {\r
+            var entries = [];\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0, entry; i &lt; strKeys.length; i++)\r
+                entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r
+            return arrayIterator(entries);\r
+        };\r
+\r
+        /**\r
+         * Returns an iterator over keys in the map.\r
+         * @returns {Object} The iterator\r
+         */\r
+        MapPrototype.keys = function() {\r
+            var keys = [];\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0; i &lt; strKeys.length; i++)\r
+                keys.push(this.map[strKeys[i]].key);\r
+            return arrayIterator(keys);\r
+        };\r
+\r
+        /**\r
+         * Returns an iterator over values in the map.\r
+         * @returns {!Object} The iterator\r
+         */\r
+        MapPrototype.values = function() {\r
+            var values = [];\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0; i &lt; strKeys.length; i++)\r
+                values.push(this.map[strKeys[i]].value);\r
+            return arrayIterator(values);\r
+        };\r
+\r
+        /**\r
+         * Iterates over entries in the map, calling a function on each.\r
+         * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r
+         * @param {Object=} thisArg The `this` value for the callback\r
+         */\r
+        MapPrototype.forEach = function(cb, thisArg) {\r
+            var strKeys = Object.keys(this.map);\r
+            for (var i = 0, entry; i &lt; strKeys.length; i++)\r
+                cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r
+        };\r
+\r
+        /**\r
+         * Sets a key in the map to the given value.\r
+         * @param {*} key The key\r
+         * @param {*} value The value\r
+         * @returns {!ProtoBuf.Map} The map instance\r
+         */\r
+        MapPrototype.set = function(key, value) {\r
+            var keyValue = this.keyElem.verifyValue(key);\r
+            var valValue = this.valueElem.verifyValue(value);\r
+            this.map[this.keyElem.valueToString(keyValue)] =\r
+                { key: keyValue, value: valValue };\r
+            return this;\r
+        };\r
+\r
+        /**\r
+         * Gets the value corresponding to a key in the map.\r
+         * @param {*} key The key\r
+         * @returns {*|undefined} The value, or `undefined` if key not present\r
+         */\r
+        MapPrototype.get = function(key) {\r
+            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+            if (!(keyValue in this.map))\r
+                return undefined;\r
+            return this.map[keyValue].value;\r
+        };\r
+\r
+        /**\r
+         * Determines whether the given key is present in the map.\r
+         * @param {*} key The key\r
+         * @returns {boolean} `true` if the key is present\r
+         */\r
+        MapPrototype.has = function(key) {\r
+            var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+            return (keyValue in this.map);\r
+        };\r
+\r
+        return Map;\r
+    })(ProtoBuf, ProtoBuf.Reflect);\r
+\r
+\r
+    /**\r
+     * Loads a .proto string and returns the Builder.\r
+     * @param {string} proto .proto file contents\r
+     * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+     * @return {ProtoBuf.Builder} Builder to create new messages\r
+     * @throws {Error} If the definition cannot be parsed or built\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadProto = function(proto, builder, filename) {\r
+        if (typeof builder === 'string' || (builder &amp;&amp; typeof builder["file"] === 'string' &amp;&amp; typeof builder["root"] === 'string'))\r
+            filename = builder,\r
+            builder = undefined;\r
+        return ProtoBuf.loadJson(ProtoBuf.DotProto.Parser.parse(proto), builder, filename);\r
+    };\r
+\r
+    /**\r
+     * Loads a .proto string and returns the Builder. This is an alias of {@link ProtoBuf.loadProto}.\r
+     * @function\r
+     * @param {string} proto .proto file contents\r
+     * @param {(ProtoBuf.Builder|string)=} builder Builder to append to. Will create a new one if omitted.\r
+     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+     * @return {ProtoBuf.Builder} Builder to create new messages\r
+     * @throws {Error} If the definition cannot be parsed or built\r
+     * @expose\r
+     */\r
+    ProtoBuf.protoFromString = ProtoBuf.loadProto; // Legacy\r
+\r
+    /**\r
+     * Loads a .proto file and returns the Builder.\r
+     * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+     *  an overridden 'root' path for all imported files.\r
+     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+     *  file will be read synchronously and this function will return the Builder.\r
+     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+     * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+     *   request has failed), else undefined\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadProtoFile = function(filename, callback, builder) {\r
+        if (callback &amp;&amp; typeof callback === 'object')\r
+            builder = callback,\r
+            callback = null;\r
+        else if (!callback || typeof callback !== 'function')\r
+            callback = null;\r
+        if (callback)\r
+            return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+                if (contents === null) {\r
+                    callback(Error("Failed to fetch file"));\r
+                    return;\r
+                }\r
+                try {\r
+                    callback(null, ProtoBuf.loadProto(contents, builder, filename));\r
+                } catch (e) {\r
+                    callback(e);\r
+                }\r
+            });\r
+        var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+        return contents === null ? null : ProtoBuf.loadProto(contents, builder, filename);\r
+    };\r
+\r
+    /**\r
+     * Loads a .proto file and returns the Builder. This is an alias of {@link ProtoBuf.loadProtoFile}.\r
+     * @function\r
+     * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+     *  an overridden 'root' path for all imported files.\r
+     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+     *  file will be read synchronously and this function will return the Builder.\r
+     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+     * @return {!ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+     *   request has failed), else undefined\r
+     * @expose\r
+     */\r
+    ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile; // Legacy\r
+\r
+\r
+    /**\r
+     * Constructs a new empty Builder.\r
+     * @param {Object.&lt;string,*>=} options Builder options, defaults to global options set on ProtoBuf\r
+     * @return {!ProtoBuf.Builder} Builder\r
+     * @expose\r
+     */\r
+    ProtoBuf.newBuilder = function(options) {\r
+        options = options || {};\r
+        if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r
+            options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r
+        if (typeof options['populateAccessors'] === 'undefined')\r
+            options['populateAccessors'] = ProtoBuf.populateAccessors;\r
+        return new ProtoBuf.Builder(options);\r
+    };\r
+\r
+    /**\r
+     * Loads a .json definition and returns the Builder.\r
+     * @param {!*|string} json JSON definition\r
+     * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+     * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+     * @return {ProtoBuf.Builder} Builder to create new messages\r
+     * @throws {Error} If the definition cannot be parsed or built\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadJson = function(json, builder, filename) {\r
+        if (typeof builder === 'string' || (builder &amp;&amp; typeof builder["file"] === 'string' &amp;&amp; typeof builder["root"] === 'string'))\r
+            filename = builder,\r
+            builder = null;\r
+        if (!builder || typeof builder !== 'object')\r
+            builder = ProtoBuf.newBuilder();\r
+        if (typeof json === 'string')\r
+            json = JSON.parse(json);\r
+        builder["import"](json, filename);\r
+        builder.resolveAll();\r
+        return builder;\r
+    };\r
+\r
+    /**\r
+     * Loads a .json file and returns the Builder.\r
+     * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r
+     *  an overridden 'root' path for all imported files.\r
+     * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+     *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+     *  file will be read synchronously and this function will return the Builder.\r
+     * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+     * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+     *   request has failed), else undefined\r
+     * @expose\r
+     */\r
+    ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r
+        if (callback &amp;&amp; typeof callback === 'object')\r
+            builder = callback,\r
+            callback = null;\r
+        else if (!callback || typeof callback !== 'function')\r
+            callback = null;\r
+        if (callback)\r
+            return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+                if (contents === null) {\r
+                    callback(Error("Failed to fetch file"));\r
+                    return;\r
+                }\r
+                try {\r
+                    callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r
+                } catch (e) {\r
+                    callback(e);\r
+                }\r
+            });\r
+        var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+        return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r
+    };\r
+\r
+    return ProtoBuf;\r
+});\r
+</code></pre>
+        </article>
+    </section>
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot
new file mode 100644 (file)
index 0000000..5d20d91
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.eot differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.svg b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.svg
new file mode 100644 (file)
index 0000000..3ed7be4
--- /dev/null
@@ -0,0 +1,1830 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansbold" horiz-adv-x="1169" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1417" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM940 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150zM1258 0h-305v1118 h305v-1118z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1417" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1258 0h-305v1556h305v-1556z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="2208" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1571 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224 q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1730 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150zM2048 0h-305v1118h305v-1118z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="2208" d="M41 0zM778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM1571 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224 q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229zM2048 0h-305v1556h305v-1556z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="586" d="M416 485h-244l-51 977h346zM117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="&#x22;" horiz-adv-x="967" d="M412 1462l-41 -528h-197l-41 528h279zM834 1462l-41 -528h-197l-41 528h279z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M999 844l-47 -232h258v-206h-297l-77 -406h-220l78 406h-194l-76 -406h-215l74 406h-238v206h277l47 232h-252v209h289l77 407h219l-77 -407h198l78 407h215l-78 -407h240v-209h-279zM539 612h196l47 232h-196z" />
+<glyph unicode="$" d="M1092 457q0 -159 -115 -255.5t-322 -115.5v-205h-137v201q-244 5 -428 86v264q87 -43 209.5 -76t218.5 -39v310l-67 26q-198 78 -280.5 169.5t-82.5 226.5q0 145 113.5 238.5t316.5 113.5v153h137v-149q229 -10 414 -92l-94 -234q-156 64 -320 78v-295 q195 -75 277.5 -130t121 -121t38.5 -154zM791 442q0 42 -34 71t-102 60v-249q136 23 136 118zM389 1049q0 -44 30.5 -72.5t98.5 -58.5v235q-129 -19 -129 -104z" />
+<glyph unicode="%" horiz-adv-x="1845" d="M315 1024q0 -127 22.5 -189.5t72.5 -62.5q96 0 96 252q0 250 -96 250q-50 0 -72.5 -61.5t-22.5 -188.5zM758 1026q0 -230 -89 -345.5t-261 -115.5q-165 0 -255 118.5t-90 342.5q0 457 345 457q169 0 259.5 -118.5t90.5 -338.5zM1446 1462l-811 -1462h-240l811 1462h240z M1339 440q0 -127 22.5 -189.5t72.5 -62.5q96 0 96 252q0 250 -96 250q-50 0 -72.5 -61.5t-22.5 -188.5zM1782 442q0 -229 -89 -344.5t-261 -115.5q-165 0 -255 118.5t-90 341.5q0 457 345 457q169 0 259.5 -118.5t90.5 -338.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1536" d="M1536 0h-377l-115 113q-191 -133 -432 -133q-244 0 -387 112t-143 303q0 137 60.5 233.5t207.5 180.5q-75 86 -109 164.5t-34 171.5q0 152 116.5 245t311.5 93q186 0 297.5 -86.5t111.5 -231.5q0 -119 -69 -217.5t-223 -187.5l284 -277q71 117 123 301h318 q-36 -135 -99 -263.5t-143 -227.5zM403 424q0 -86 64.5 -137t165.5 -51q126 0 227 61l-332 330q-58 -44 -91.5 -92t-33.5 -111zM762 1133q0 53 -36 83.5t-93 30.5q-67 0 -105.5 -32t-38.5 -91q0 -88 95 -194q86 48 132 94.5t46 108.5z" />
+<glyph unicode="'" horiz-adv-x="545" d="M412 1462l-41 -528h-197l-41 528h279z" />
+<glyph unicode="(" horiz-adv-x="694" d="M82 561q0 265 77.5 496t223.5 405h250q-141 -193 -213 -424t-72 -475q0 -245 73.5 -473.5t209.5 -413.5h-248q-147 170 -224 397t-77 488z" />
+<glyph unicode=")" horiz-adv-x="694" d="M612 561q0 -263 -77.5 -490t-223.5 -395h-248q135 184 209 412.5t74 474.5q0 244 -72 475t-213 424h250q147 -175 224 -406.5t77 -494.5z" />
+<glyph unicode="*" horiz-adv-x="1116" d="M688 1556l-41 -368l373 104l33 -252l-340 -24l223 -297l-227 -121l-156 313l-137 -311l-236 119l221 297l-338 26l39 250l365 -104l-41 368h262z" />
+<glyph unicode="+" d="M475 612h-387v219h387v390h219v-390h387v-219h-387v-385h-219v385z" />
+<glyph unicode="," horiz-adv-x="594" d="M459 215q-52 -202 -176 -479h-220q65 266 101 502h280z" />
+<glyph unicode="-" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="." horiz-adv-x="584" d="M117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="/" horiz-adv-x="846" d="M836 1462l-545 -1462h-277l545 1462h277z" />
+<glyph unicode="0" d="M1096 731q0 -383 -125.5 -567t-386.5 -184q-253 0 -381.5 190t-128.5 561q0 387 125 570.5t385 183.5q253 0 382.5 -192t129.5 -562zM381 731q0 -269 46.5 -385.5t156.5 -116.5q108 0 156 118t48 384q0 269 -48.5 386.5t-155.5 117.5q-109 0 -156 -117.5t-47 -386.5z" />
+<glyph unicode="1" d="M846 0h-309v846l3 139l5 152q-77 -77 -107 -101l-168 -135l-149 186l471 375h254v-1462z" />
+<glyph unicode="2" d="M1104 0h-1022v215l367 371q163 167 213 231.5t72 119.5t22 114q0 88 -48.5 131t-129.5 43q-85 0 -165 -39t-167 -111l-168 199q108 92 179 130t155 58.5t188 20.5q137 0 242 -50t163 -140t58 -206q0 -101 -35.5 -189.5t-110 -181.5t-262.5 -265l-188 -177v-14h637v-260z " />
+<glyph unicode="3" d="M1047 1135q0 -137 -83 -233t-233 -132v-6q177 -22 268 -107.5t91 -230.5q0 -211 -153 -328.5t-437 -117.5q-238 0 -422 79v263q85 -43 187 -70t202 -27q153 0 226 52t73 167q0 103 -84 146t-268 43h-111v237h113q170 0 248.5 44.5t78.5 152.5q0 166 -208 166 q-72 0 -146.5 -24t-165.5 -83l-143 213q200 144 477 144q227 0 358.5 -92t131.5 -256z" />
+<glyph unicode="4" d="M1137 303h-176v-303h-302v303h-624v215l641 944h285v-919h176v-240zM659 543v248q0 62 5 180t8 137h-8q-37 -82 -89 -160l-268 -405h352z" />
+<glyph unicode="5" d="M614 934q212 0 337.5 -119t125.5 -326q0 -245 -151 -377t-432 -132q-244 0 -394 79v267q79 -42 184 -68.5t199 -26.5q283 0 283 232q0 221 -293 221q-53 0 -117 -10.5t-104 -22.5l-123 66l55 745h793v-262h-522l-27 -287l35 7q61 14 151 14z" />
+<glyph unicode="6" d="M72 621q0 434 183.5 646t549.5 212q125 0 196 -15v-247q-89 20 -176 20q-159 0 -259.5 -48t-150.5 -142t-59 -267h13q99 170 317 170q196 0 307 -123t111 -340q0 -234 -132 -370.5t-366 -136.5q-162 0 -282.5 75t-186 219t-65.5 347zM600 227q99 0 152 66.5t53 189.5 q0 107 -49.5 168.5t-149.5 61.5q-94 0 -160.5 -61t-66.5 -142q0 -119 62.5 -201t158.5 -82z" />
+<glyph unicode="7" d="M227 0l549 1200h-721v260h1049v-194l-553 -1266h-324z" />
+<glyph unicode="8" d="M586 1481q210 0 338.5 -95.5t128.5 -257.5q0 -112 -62 -199.5t-200 -156.5q164 -88 235.5 -183.5t71.5 -209.5q0 -180 -141 -289.5t-371 -109.5q-240 0 -377 102t-137 289q0 125 66.5 222t213.5 171q-125 79 -180 169t-55 197q0 157 130 254t339 97zM358 389 q0 -86 60 -134t164 -48q115 0 172 49.5t57 130.5q0 67 -56.5 125.5t-183.5 124.5q-213 -98 -213 -248zM584 1255q-79 0 -127.5 -40.5t-48.5 -108.5q0 -60 38.5 -107.5t139.5 -97.5q98 46 137 94t39 111q0 69 -50 109t-128 40z" />
+<glyph unicode="9" d="M1098 838q0 -432 -182 -645t-551 -213q-130 0 -197 14v248q84 -21 176 -21q155 0 255 45.5t153 143t61 268.5h-12q-58 -94 -134 -132t-190 -38q-191 0 -301 122.5t-110 340.5q0 235 133.5 371.5t363.5 136.5q162 0 283.5 -76t186.5 -220.5t65 -344.5zM569 1231 q-96 0 -150 -66t-54 -190q0 -106 49 -168t149 -62q94 0 161 61.5t67 141.5q0 119 -62.5 201t-159.5 82z" />
+<glyph unicode=":" horiz-adv-x="584" d="M117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5zM117 969q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -81 -46.5 -125.5t-127.5 -44.5q-84 0 -130 44t-46 126z" />
+<glyph unicode=";" horiz-adv-x="594" d="M444 238l15 -23q-52 -202 -176 -479h-220q65 266 101 502h280zM117 969q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -81 -46.5 -125.5t-127.5 -44.5q-84 0 -130 44t-46 126z" />
+<glyph unicode="&#x3c;" d="M1081 203l-993 438v143l993 496v-240l-684 -317l684 -281v-239z" />
+<glyph unicode="=" d="M88 805v219h993v-219h-993zM88 418v219h993v-219h-993z" />
+<glyph unicode="&#x3e;" d="M88 442l684 281l-684 317v240l993 -496v-143l-993 -438v239z" />
+<glyph unicode="?" horiz-adv-x="977" d="M276 485v74q0 96 41 167t150 151q105 75 138.5 122t33.5 105q0 65 -48 99t-134 34q-150 0 -342 -98l-109 219q223 125 473 125q206 0 327.5 -99t121.5 -264q0 -110 -50 -190t-190 -180q-96 -71 -121.5 -108t-25.5 -97v-60h-265zM244 143q0 84 45 127t131 43 q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="@" horiz-adv-x="1837" d="M1735 752q0 -144 -46 -263.5t-130 -187.5t-195 -68q-74 0 -131 35.5t-82 93.5h-16q-108 -129 -275 -129q-177 0 -279 106.5t-102 291.5q0 211 134 340t350 129q86 0 189.5 -16.5t170.5 -39.5l-23 -489q0 -139 76 -139q64 0 102 93.5t38 244.5q0 161 -67 284.5 t-188.5 188.5t-277.5 65q-202 0 -351 -83t-228.5 -239.5t-79.5 -361.5q0 -276 147.5 -423.5t427.5 -147.5q106 0 233 23.5t250 68.5v-192q-214 -91 -475 -91q-380 0 -592.5 200t-212.5 556q0 247 108.5 448.5t309 316t461.5 114.5q220 0 393 -90t267 -256t94 -383zM711 627 q0 -211 172 -211q90 0 137 63.5t57 206.5l13 221q-51 11 -115 11q-125 0 -194.5 -78t-69.5 -213z" />
+<glyph unicode="A" horiz-adv-x="1413" d="M1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381z" />
+<glyph unicode="B" horiz-adv-x="1376" d="M184 1462h455q311 0 451.5 -88.5t140.5 -281.5q0 -131 -61.5 -215t-163.5 -101v-10q139 -31 200.5 -116t61.5 -226q0 -200 -144.5 -312t-392.5 -112h-547v1462zM494 883h180q126 0 182.5 39t56.5 129q0 84 -61.5 120.5t-194.5 36.5h-163v-325zM494 637v-381h202 q128 0 189 49t61 150q0 182 -260 182h-192z" />
+<glyph unicode="C" horiz-adv-x="1305" d="M805 1225q-175 0 -271 -131.5t-96 -366.5q0 -489 367 -489q154 0 373 77v-260q-180 -75 -402 -75q-319 0 -488 193.5t-169 555.5q0 228 83 399.5t238.5 263t364.5 91.5q213 0 428 -103l-100 -252q-82 39 -165 68t-163 29z" />
+<glyph unicode="D" horiz-adv-x="1516" d="M1397 745q0 -361 -205.5 -553t-593.5 -192h-414v1462h459q358 0 556 -189t198 -528zM1075 737q0 471 -416 471h-165v-952h133q448 0 448 481z" />
+<glyph unicode="E" horiz-adv-x="1147" d="M1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256z" />
+<glyph unicode="F" horiz-adv-x="1124" d="M489 0h-305v1462h838v-254h-533v-377h496v-253h-496v-578z" />
+<glyph unicode="G" horiz-adv-x="1483" d="M739 821h580v-758q-141 -46 -265.5 -64.5t-254.5 -18.5q-331 0 -505.5 194.5t-174.5 558.5q0 354 202.5 552t561.5 198q225 0 434 -90l-103 -248q-160 80 -333 80q-201 0 -322 -135t-121 -363q0 -238 97.5 -363.5t283.5 -125.5q97 0 197 20v305h-277v258z" />
+<glyph unicode="H" horiz-adv-x="1567" d="M1382 0h-309v631h-579v-631h-310v1462h310v-573h579v573h309v-1462z" />
+<glyph unicode="I" horiz-adv-x="678" d="M184 0v1462h310v-1462h-310z" />
+<glyph unicode="J" horiz-adv-x="678" d="M31 -430q-105 0 -183 22v258q80 -20 146 -20q102 0 146 63.5t44 198.5v1370h310v-1368q0 -256 -117 -390t-346 -134z" />
+<glyph unicode="K" horiz-adv-x="1360" d="M1360 0h-352l-383 616l-131 -94v-522h-310v1462h310v-669l122 172l396 497h344l-510 -647z" />
+<glyph unicode="L" horiz-adv-x="1157" d="M184 0v1462h310v-1206h593v-256h-903z" />
+<glyph unicode="M" horiz-adv-x="1931" d="M803 0l-352 1147h-9q19 -350 19 -467v-680h-277v1462h422l346 -1118h6l367 1118h422v-1462h-289v692q0 49 1.5 113t13.5 340h-9l-377 -1145h-284z" />
+<glyph unicode="N" horiz-adv-x="1665" d="M1481 0h-394l-636 1106h-9q19 -293 19 -418v-688h-277v1462h391l635 -1095h7q-15 285 -15 403v692h279v-1462z" />
+<glyph unicode="O" horiz-adv-x="1630" d="M1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5z" />
+<glyph unicode="P" horiz-adv-x="1286" d="M494 774h102q143 0 214 56.5t71 164.5q0 109 -59.5 161t-186.5 52h-141v-434zM1194 1006q0 -236 -147.5 -361t-419.5 -125h-133v-520h-310v1462h467q266 0 404.5 -114.5t138.5 -341.5z" />
+<glyph unicode="Q" horiz-adv-x="1630" d="M1511 733q0 -258 -91.5 -432.5t-268.5 -255.5l352 -393h-397l-268 328h-23q-336 0 -516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5z" />
+<glyph unicode="R" horiz-adv-x="1352" d="M494 813h100q147 0 217 49t70 154q0 104 -71.5 148t-221.5 44h-94v-395zM494 561v-561h-310v1462h426q298 0 441 -108.5t143 -329.5q0 -129 -71 -229.5t-201 -157.5q330 -493 430 -637h-344l-349 561h-165z" />
+<glyph unicode="S" horiz-adv-x="1128" d="M1047 406q0 -198 -142.5 -312t-396.5 -114q-234 0 -414 88v288q148 -66 250.5 -93t187.5 -27q102 0 156.5 39t54.5 116q0 43 -24 76.5t-70.5 64.5t-189.5 99q-134 63 -201 121t-107 135t-40 180q0 194 131.5 305t363.5 111q114 0 217.5 -27t216.5 -76l-100 -241 q-117 48 -193.5 67t-150.5 19q-88 0 -135 -41t-47 -107q0 -41 19 -71.5t60.5 -59t196.5 -102.5q205 -98 281 -196.5t76 -241.5z" />
+<glyph unicode="T" horiz-adv-x="1186" d="M748 0h-310v1204h-397v258h1104v-258h-397v-1204z" />
+<glyph unicode="U" horiz-adv-x="1548" d="M1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309z" />
+<glyph unicode="V" horiz-adv-x="1331" d="M1018 1462h313l-497 -1462h-338l-496 1462h313l275 -870q23 -77 47.5 -179.5t30.5 -142.5q11 92 75 322z" />
+<glyph unicode="W" horiz-adv-x="1980" d="M1608 0h-353l-198 768q-11 41 -37.5 169.5t-30.5 172.5q-6 -54 -30 -173.5t-37 -170.5l-197 -766h-352l-373 1462h305l187 -798q49 -221 71 -383q6 57 27.5 176.5t40.5 185.5l213 819h293l213 -819q14 -55 35 -168t32 -194q10 78 32 194.5t40 188.5l186 798h305z" />
+<glyph unicode="X" horiz-adv-x="1366" d="M1366 0h-354l-340 553l-340 -553h-332l485 754l-454 708h342l315 -526l309 526h334l-459 -725z" />
+<glyph unicode="Y" horiz-adv-x="1278" d="M639 860l305 602h334l-485 -893v-569h-308v559l-485 903h336z" />
+<glyph unicode="Z" horiz-adv-x="1186" d="M1137 0h-1088v201l701 1005h-682v256h1050v-200l-700 -1006h719v-256z" />
+<glyph unicode="[" horiz-adv-x="678" d="M627 -324h-484v1786h484v-211h-224v-1364h224v-211z" />
+<glyph unicode="\" horiz-adv-x="846" d="M289 1462l545 -1462h-277l-545 1462h277z" />
+<glyph unicode="]" horiz-adv-x="678" d="M51 -113h223v1364h-223v211h484v-1786h-484v211z" />
+<glyph unicode="^" horiz-adv-x="1090" d="M8 520l438 950h144l495 -950h-239l-322 643l-280 -643h-236z" />
+<glyph unicode="_" horiz-adv-x="842" d="M846 -324h-850v140h850v-140z" />
+<glyph unicode="`" horiz-adv-x="1243" d="M707 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="a" horiz-adv-x="1237" d="M870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48t-65 -134 q0 -129 148 -129q106 0 169.5 61t63.5 162v92z" />
+<glyph unicode="b" horiz-adv-x="1296" d="M782 1139q198 0 310 -154.5t112 -423.5q0 -277 -115.5 -429t-314.5 -152q-197 0 -309 143h-21l-51 -123h-233v1556h305v-362q0 -69 -12 -221h12q107 166 317 166zM684 895q-113 0 -165 -69.5t-54 -229.5v-33q0 -180 53.5 -258t169.5 -78q94 0 149.5 86.5t55.5 251.5 t-56 247.5t-153 82.5z" />
+<glyph unicode="c" horiz-adv-x="1053" d="M614 -20q-522 0 -522 573q0 285 142 435.5t407 150.5q194 0 348 -76l-90 -236q-72 29 -134 47.5t-124 18.5q-238 0 -238 -338q0 -328 238 -328q88 0 163 23.5t150 73.5v-261q-74 -47 -149.5 -65t-190.5 -18z" />
+<glyph unicode="d" horiz-adv-x="1296" d="M514 -20q-197 0 -309.5 153t-112.5 424q0 275 114.5 428.5t315.5 153.5q211 0 322 -164h10q-23 125 -23 223v358h306v-1556h-234l-59 145h-13q-104 -165 -317 -165zM621 223q117 0 171.5 68t59.5 231v33q0 180 -55.5 258t-180.5 78q-102 0 -158.5 -86.5t-56.5 -251.5 t57 -247.5t163 -82.5z" />
+<glyph unicode="e" horiz-adv-x="1210" d="M623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z" />
+<glyph unicode="f" horiz-adv-x="793" d="M778 889h-264v-889h-305v889h-168v147l168 82v82q0 191 94 279t301 88q158 0 281 -47l-78 -224q-92 29 -170 29q-65 0 -94 -38.5t-29 -98.5v-70h264v-229z" />
+<glyph unicode="g" horiz-adv-x="1157" d="M1133 1118v-155l-175 -45q48 -75 48 -168q0 -180 -125.5 -280.5t-348.5 -100.5l-55 3l-45 5q-47 -36 -47 -80q0 -66 168 -66h190q184 0 280.5 -79t96.5 -232q0 -196 -163.5 -304t-469.5 -108q-234 0 -357.5 81.5t-123.5 228.5q0 101 63 169t185 97q-47 20 -82 65.5 t-35 96.5q0 64 37 106.5t107 83.5q-88 38 -139.5 122t-51.5 198q0 183 119 283t340 100q47 0 111.5 -8.5t82.5 -12.5h390zM270 -158q0 -63 60.5 -99t169.5 -36q164 0 257 45t93 123q0 63 -55 87t-170 24h-158q-84 0 -140.5 -39.5t-56.5 -104.5zM381 752q0 -91 41.5 -144 t126.5 -53q86 0 126 53t40 144q0 202 -166 202q-168 0 -168 -202z" />
+<glyph unicode="h" horiz-adv-x="1346" d="M1192 0h-305v653q0 242 -180 242q-128 0 -185 -87t-57 -282v-526h-305v1556h305v-317q0 -37 -7 -174l-7 -90h16q102 164 324 164q197 0 299 -106t102 -304v-729z" />
+<glyph unicode="i" horiz-adv-x="625" d="M147 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150zM465 0h-305v1118h305v-1118z" />
+<glyph unicode="j" horiz-adv-x="625" d="M70 -492q-117 0 -201 25v240q70 -19 143 -19q77 0 112.5 43t35.5 127v1194h305v-1239q0 -178 -103 -274.5t-292 -96.5zM147 1407q0 149 166 149t166 -149q0 -71 -41.5 -110.5t-124.5 -39.5q-166 0 -166 150z" />
+<glyph unicode="k" horiz-adv-x="1270" d="M453 608l133 170l313 340h344l-444 -485l471 -633h-352l-322 453l-131 -105v-348h-305v1556h305v-694l-16 -254h4z" />
+<glyph unicode="l" horiz-adv-x="625" d="M465 0h-305v1556h305v-1556z" />
+<glyph unicode="m" horiz-adv-x="2011" d="M1161 0h-305v653q0 121 -40.5 181.5t-127.5 60.5q-117 0 -170 -86t-53 -283v-526h-305v1118h233l41 -143h17q45 77 130 120.5t195 43.5q251 0 340 -164h27q45 78 132.5 121t197.5 43q190 0 287.5 -97.5t97.5 -312.5v-729h-306v653q0 121 -40.5 181.5t-127.5 60.5 q-112 0 -167.5 -80t-55.5 -254v-561z" />
+<glyph unicode="n" horiz-adv-x="1346" d="M1192 0h-305v653q0 121 -43 181.5t-137 60.5q-128 0 -185 -85.5t-57 -283.5v-526h-305v1118h233l41 -143h17q51 81 140.5 122.5t203.5 41.5q195 0 296 -105.5t101 -304.5v-729z" />
+<glyph unicode="o" horiz-adv-x="1268" d="M403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z" />
+<glyph unicode="p" horiz-adv-x="1296" d="M774 -20q-197 0 -309 143h-16q16 -140 16 -162v-453h-305v1610h248l43 -145h14q107 166 317 166q198 0 310 -153t112 -425q0 -179 -52.5 -311t-149.5 -201t-228 -69zM684 895q-113 0 -165 -69.5t-54 -229.5v-33q0 -180 53.5 -258t169.5 -78q205 0 205 338 q0 165 -50.5 247.5t-158.5 82.5z" />
+<glyph unicode="q" horiz-adv-x="1296" d="M623 219q116 0 170 66.5t59 232.5v37q0 180 -55.5 258t-178.5 78q-215 0 -215 -338q0 -168 53.5 -251t166.5 -83zM514 -20q-198 0 -310 152.5t-112 424.5q0 274 114.5 428t313.5 154q106 0 185 -40t139 -124h8l27 143h258v-1610h-306v469q0 61 13 168h-13 q-49 -81 -130 -123t-187 -42z" />
+<glyph unicode="r" horiz-adv-x="930" d="M784 1139q62 0 103 -9l-23 -286q-37 10 -90 10q-146 0 -227.5 -75t-81.5 -210v-569h-305v1118h231l45 -188h15q52 94 140.5 151.5t192.5 57.5z" />
+<glyph unicode="s" horiz-adv-x="1018" d="M940 332q0 -172 -119.5 -262t-357.5 -90q-122 0 -208 16.5t-161 48.5v252q85 -40 191.5 -67t187.5 -27q166 0 166 96q0 36 -22 58.5t-76 51t-144 66.5q-129 54 -189.5 100t-88 105.5t-27.5 146.5q0 149 115.5 230.5t327.5 81.5q202 0 393 -88l-92 -220q-84 36 -157 59 t-149 23q-135 0 -135 -73q0 -41 43.5 -71t190.5 -89q131 -53 192 -99t90 -106t29 -143z" />
+<glyph unicode="t" horiz-adv-x="889" d="M631 223q80 0 192 35v-227q-114 -51 -280 -51q-183 0 -266.5 92.5t-83.5 277.5v539h-146v129l168 102l88 236h195v-238h313v-229h-313v-539q0 -65 36.5 -96t96.5 -31z" />
+<glyph unicode="u" horiz-adv-x="1346" d="M952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234z" />
+<glyph unicode="v" horiz-adv-x="1165" d="M426 0l-426 1118h319l216 -637q36 -121 45 -229h6q5 96 45 229l215 637h319l-426 -1118h-313z" />
+<glyph unicode="w" horiz-adv-x="1753" d="M1079 0l-86 391l-116 494h-7l-204 -885h-328l-318 1118h304l129 -495q31 -133 63 -367h6q4 76 35 241l16 85l138 536h336l131 -536q4 -22 12.5 -65t16.5 -91.5t14.5 -95t7.5 -74.5h6q9 72 32 197.5t33 169.5l134 495h299l-322 -1118h-332z" />
+<glyph unicode="x" horiz-adv-x="1184" d="M389 571l-360 547h346l217 -356l219 356h346l-364 -547l381 -571h-347l-235 383l-236 -383h-346z" />
+<glyph unicode="y" horiz-adv-x="1165" d="M0 1118h334l211 -629q27 -82 37 -194h6q11 103 43 194l207 629h327l-473 -1261q-65 -175 -185.5 -262t-281.5 -87q-79 0 -155 17v242q55 -13 120 -13q81 0 141.5 49.5t94.5 149.5l18 55z" />
+<glyph unicode="z" horiz-adv-x="999" d="M938 0h-883v180l518 705h-487v233h834v-198l-504 -687h522v-233z" />
+<glyph unicode="{" horiz-adv-x="807" d="M287 270q0 87 -65.5 133t-190.5 46v239q126 0 191 44t65 126v8v318q0 153 97 215.5t341 62.5v-225q-99 -3 -136.5 -38t-37.5 -103v-299q-6 -188 -234 -222v-12q234 -35 234 -212v-9v-299q0 -68 37 -103t137 -38v-226q-244 0 -341 62.5t-97 216.5v315z" />
+<glyph unicode="|" horiz-adv-x="1128" d="M455 1550h219v-2015h-219v2015z" />
+<glyph unicode="}" horiz-adv-x="807" d="M520 -45q0 -112 -41 -169t-135.5 -83.5t-261.5 -26.5v226q99 2 136.5 36t37.5 105v299v11q0 86 59 139.5t174 70.5v12q-227 34 -233 222v299q0 70 -37 104t-137 37v225q167 0 262 -26.5t135.5 -84t40.5 -167.5v-318v-10q0 -84 61.5 -126t194.5 -42v-239 q-125 0 -190.5 -41t-65.5 -138v-315z" />
+<glyph unicode="~" d="M322 672q-55 0 -117.5 -33.5t-116.5 -87.5v231q103 109 256 109q73 0 137.5 -16t139.5 -48q129 -55 227 -55q53 0 116 32t117 89v-231q-101 -109 -256 -109q-66 0 -126 13t-150 50q-131 56 -227 56z" />
+<glyph unicode="&#xa1;" horiz-adv-x="586" d="M168 606h244l51 -975h-346zM467 948q0 -84 -45 -127t-131 -43q-83 0 -128.5 44t-45.5 126q0 81 46.5 125.5t127.5 44.5q84 0 130 -44t46 -126z" />
+<glyph unicode="&#xa2;" d="M563 176q-420 59 -420 565q0 261 104.5 403t315.5 173v166h178v-158q166 -9 299 -74l-90 -235q-72 29 -134 47t-124 18q-121 0 -179 -83.5t-58 -254.5q0 -327 237 -327q82 0 148 15.5t166 60.5v-254q-127 -61 -265 -70v-188h-178v196z" />
+<glyph unicode="&#xa3;" d="M700 1483q195 0 390 -82l-93 -230q-157 64 -272 64q-78 0 -120 -44.5t-42 -127.5v-193h375v-219h-375v-143q0 -170 -151 -248h718v-260h-1048v248q103 44 141.5 101t38.5 157v145h-178v219h178v195q0 201 114.5 309.5t323.5 108.5z" />
+<glyph unicode="&#xa4;" d="M188 723q0 102 54 197l-129 127l147 147l127 -127q91 53 197 53q105 0 196 -55l127 129l150 -143l-129 -129q53 -89 53 -199q0 -107 -53 -199l125 -125l-146 -145l-127 125q-95 -51 -196 -51q-115 0 -199 51l-125 -123l-145 145l127 125q-54 93 -54 197zM395 723 q0 -77 54.5 -132.5t134.5 -55.5q81 0 136.5 55t55.5 133q0 80 -56.5 135t-135.5 55q-78 0 -133.5 -56t-55.5 -134z" />
+<glyph unicode="&#xa5;" d="M584 860l264 602h313l-383 -747h195v-178h-246v-138h246v-178h-246v-221h-287v221h-247v178h247v138h-247v178h190l-377 747h316z" />
+<glyph unicode="&#xa6;" horiz-adv-x="1128" d="M455 1550h219v-815h-219v815zM455 350h219v-815h-219v815z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M121 805q0 79 36 144.5t97 105.5q-133 84 -133 233q0 131 111.5 210t293.5 79q170 0 363 -84l-82 -190q-68 32 -138.5 57.5t-148.5 25.5q-81 0 -118 -23t-37 -71q0 -49 49.5 -86t163.5 -82q163 -64 240 -148.5t77 -193.5q0 -177 -125 -260q62 -40 93.5 -92.5t31.5 -126.5 q0 -148 -119.5 -235.5t-320.5 -87.5q-203 0 -349 79v207q81 -41 180 -69.5t169 -28.5q194 0 194 117q0 39 -18.5 63t-63.5 49.5t-125 59.5q-183 74 -252 152.5t-69 195.5zM344 827q0 -67 65 -119t181 -98q78 57 78 146q0 68 -50.5 115t-183.5 96q-37 -14 -63.5 -53.5 t-26.5 -86.5z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1243" d="M279 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM682 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M895 1010q-97 0 -150 -74t-53 -205q0 -280 203 -280q57 0 123 15t123 44v-191q-120 -57 -252 -57q-204 0 -316 125t-112 346q0 220 110.5 342.5t309.5 122.5q149 0 305 -78l-74 -168q-113 58 -217 58zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275 t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM242 731q0 -164 82 -305.5t224 -223t304 -81.5q164 0 305.5 82t223 224t81.5 304q0 164 -82 305.5t-224 223t-304 81.5q-164 0 -305.5 -82t-223 -224t-81.5 -304z" />
+<glyph unicode="&#xaa;" horiz-adv-x="784" d="M561 764l-31 110q-43 -58 -105 -90t-136 -32q-117 0 -179.5 58.5t-62.5 164.5q0 109 82.5 163.5t267.5 63.5l99 4q0 117 -127 117q-81 0 -217 -61l-66 135q66 32 145.5 57t178.5 25q137 0 211.5 -71t74.5 -202v-442h-135zM252 977q0 -38 23 -56t55 -18q77 0 121.5 41.5 t44.5 106.5v36l-99 -6q-145 -10 -145 -104z" />
+<glyph unicode="&#xab;" horiz-adv-x="1260" d="M82 573l371 455l219 -119l-279 -348l279 -348l-219 -119l-371 453v26zM588 573l370 455l220 -119l-279 -348l279 -348l-220 -119l-370 453v26z" />
+<glyph unicode="&#xac;" d="M1081 248h-219v364h-774v219h993v-583z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M61 424zM61 424v250h537v-250h-537z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M1157 905q0 -170 -143 -233l237 -400h-254l-178 338h-47v-338h-229v916h264q181 0 265.5 -70t84.5 -213zM772 778h31q66 0 94.5 28.5t28.5 94.5q0 65 -28 92t-97 27h-29v-242zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275t101 -377q0 -197 -97 -370 t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM242 731q0 -164 82 -305.5t224 -223t304 -81.5q164 0 305.5 82t223 224t81.5 304q0 164 -82 305.5t-224 223t-304 81.5q-164 0 -305.5 -82t-223 -224t-81.5 -304z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036v201h1036v-201z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M92 1137q0 92 46 172t126 127t174 47q92 0 172.5 -46t127 -127t46.5 -173q0 -93 -46.5 -173.5t-126.5 -125.5t-173 -45q-145 0 -245.5 99.5t-100.5 244.5zM283 1137q0 -64 44.5 -109t110.5 -45t111 46t45 108q0 63 -45.5 110t-110.5 47q-64 0 -109.5 -46t-45.5 -111z" />
+<glyph unicode="&#xb1;" d="M475 674h-387v219h387v389h219v-389h387v-219h-387v-385h-219v385zM88 0v219h993v-219h-993z" />
+<glyph unicode="&#xb2;" horiz-adv-x="776" d="M702 586h-647v168l224 219q102 100 130.5 144.5t28.5 94.5q0 38 -24 58t-64 20q-81 0 -180 -88l-123 152q147 129 336 129q137 0 216 -66.5t79 -183.5q0 -85 -47 -160t-176 -192l-105 -95h352v-200z" />
+<glyph unicode="&#xb3;" horiz-adv-x="776" d="M666 1249q0 -143 -170 -198v-13q94 -20 146 -75t52 -134q0 -121 -88 -190.5t-274 -69.5q-143 0 -273 70v190q148 -90 271 -90q143 0 143 107q0 53 -44 79.5t-122 26.5h-112v160h92q83 0 123.5 26t40.5 83q0 38 -25 63t-76 25q-47 0 -89 -19t-99 -59l-101 141 q62 47 137.5 78t178.5 31q127 0 208 -64t81 -168z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1243" d="M332 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1352" d="M465 465q0 -121 44 -181.5t138 -60.5q126 0 183 86.5t57 282.5v526h305v-1118h-231l-43 150h-15q-42 -85 -102 -127.5t-148 -42.5q-62 0 -114 23t-84 67l5 -85l5 -157v-320h-305v1610h305v-653z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1167 -260h-161v1616h-166v-1616h-162v819q-62 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h604v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="584" d="M117 723q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -81 -46.5 -125.5t-127.5 -44.5q-84 0 -130 44t-46 126z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M418 -250q0 -128 -75.5 -185t-233.5 -57q-78 0 -146 21v168q27 -7 72.5 -14t70.5 -7q72 0 72 62q0 83 -166 108l78 154h193l-27 -61q74 -24 118 -74.5t44 -114.5z" />
+<glyph unicode="&#xb9;" horiz-adv-x="776" d="M584 586h-238v446l3 112l5 95q-27 -36 -75 -78l-78 -61l-109 127l301 235h191v-876z" />
+<glyph unicode="&#xba;" horiz-adv-x="795" d="M737 1116q0 -171 -91.5 -267.5t-250.5 -96.5q-153 0 -245.5 98.5t-92.5 265.5q0 169 89.5 266t252.5 97q152 0 245 -98.5t93 -264.5zM260 1116q0 -100 32.5 -150.5t104.5 -50.5t103.5 50.5t31.5 150.5t-31.5 149.5t-103.5 49.5t-104.5 -49.5t-32.5 -149.5z" />
+<glyph unicode="&#xbb;" horiz-adv-x="1260" d="M1178 547l-371 -453l-219 119l278 348l-278 348l219 119l371 -455v-26zM672 547l-371 -453l-219 119l278 348l-278 348l219 119l371 -455v-26z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1804" d="M46 0zM538 586h-238v446l3 112l5 95q-27 -36 -75 -78l-78 -61l-109 127l301 235h191v-876zM1370 1462l-811 -1462h-239l811 1462h239zM1682 152h-125v-151h-238v151h-383v154l385 577h236v-563h125v-168zM1319 320v164q0 86 6 184q-9 -26 -35.5 -80t-41.5 -77l-127 -191 h198z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1804" d="M46 0zM538 586h-238v446l3 112l5 95q-27 -36 -75 -78l-78 -61l-109 127l301 235h191v-876zM1370 1462l-811 -1462h-239l811 1462h239zM1716 1h-647v168l224 219q102 100 130.5 144.5t28.5 94.5q0 38 -24 58t-64 20q-81 0 -180 -88l-123 152q147 129 336 129 q137 0 216 -66.5t79 -183.5q0 -85 -47 -160t-176 -192l-105 -95h352v-200z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1804" d="M90 0zM697 1249q0 -143 -170 -198v-13q94 -20 146 -75t52 -134q0 -121 -88 -190.5t-274 -69.5q-143 0 -273 70v190q148 -90 271 -90q143 0 143 107q0 53 -44 79.5t-122 26.5h-112v160h92q83 0 123.5 26t40.5 83q0 38 -25 63t-76 25q-47 0 -89 -19t-99 -59l-101 141 q62 47 137.5 78t178.5 31q127 0 208 -64t81 -168zM1441 1462l-811 -1462h-239l811 1462h239zM1712 152h-125v-151h-238v151h-383v154l385 577h236v-563h125v-168zM1349 320v164q0 86 6 184q-9 -26 -35.5 -80t-41.5 -77l-127 -191h198z" />
+<glyph unicode="&#xbf;" horiz-adv-x="977" d="M713 606v-74q0 -98 -44.5 -169t-152.5 -148q-109 -78 -137.5 -122t-28.5 -107q0 -57 43.5 -94t132.5 -37q79 0 169 29t186 71l102 -221q-98 -56 -221.5 -90.5t-229.5 -34.5q-220 0 -345.5 96.5t-125.5 265.5q0 108 48.5 187t191.5 184q95 70 121.5 107t26.5 98v59h264z M745 948q0 -84 -45 -127t-131 -43q-83 0 -128.5 44t-45.5 126q0 81 46.5 125.5t127.5 44.5q84 0 130 -44t46 -126z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM713 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM541 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM938 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM543 1684q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16 q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM365 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM768 1743 q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1413" d="M0 0zM1079 0l-106 348h-533l-106 -348h-334l516 1468h379l518 -1468h-334zM899 608q-147 473 -165.5 535t-26.5 98q-33 -128 -189 -633h381zM959 1567q0 -108 -71 -174t-183 -66t-180 64t-68 174q0 108 67.5 172.5t180.5 64.5q110 0 182 -66t72 -169zM801 1565 q0 45 -27 70.5t-69 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69 26t27 71z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1950" d="M1829 0h-873v348h-491l-150 -348h-315l655 1462h1174v-254h-563v-321h526v-254h-526v-377h563v-256zM578 608h378v590h-127z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1305" d="M119 0zM805 1225q-175 0 -271 -131.5t-96 -366.5q0 -489 367 -489q154 0 373 77v-260q-180 -75 -402 -75q-319 0 -488 193.5t-169 555.5q0 228 83 399.5t238.5 263t364.5 91.5q213 0 428 -103l-100 -252q-82 39 -165 68t-163 29zM959 -250q0 -128 -75.5 -185t-233.5 -57 q-78 0 -146 21v168q27 -7 72.5 -14t70.5 -7q72 0 72 62q0 83 -166 108l78 154h193l-27 -61q74 -24 118 -74.5t44 -114.5z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1147" d="M184 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM634 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1147" d="M184 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM424 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xca;" horiz-adv-x="1147" d="M175 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM841 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1147" d="M184 0zM1026 0h-842v1462h842v-254h-532v-321h495v-254h-495v-377h532v-256zM272 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM675 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99 q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xcc;" horiz-adv-x="678" d="M0 0zM184 0v1462h310v-1462h-310zM317 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xcd;" horiz-adv-x="678" d="M167 0zM184 0v1462h310v-1462h-310zM167 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xce;" horiz-adv-x="678" d="M0 0zM184 0v1462h310v-1462h-310zM570 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xcf;" horiz-adv-x="678" d="M0 0zM184 0v1462h310v-1462h-310zM-3 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM400 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5 t-40.5 100.5z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1516" d="M47 850h137v612h459q358 0 556 -189t198 -528q0 -361 -205.5 -553t-593.5 -192h-414v596h-137v254zM1075 737q0 232 -104 351.5t-314 119.5h-163v-358h237v-254h-237v-340h131q450 0 450 481z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1665" d="M184 0zM1481 0h-394l-636 1106h-9q19 -293 19 -418v-688h-277v1462h391l635 -1095h7q-15 285 -15 403v692h279v-1462zM668 1684q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149 q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM824 1579q-63 44 -185 142.5t-190 164.5v21h342 q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM658 1579v27q172 200 235 301h342v-21 q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM1047 1579q-157 93 -234 176q-78 -81 -229 -176h-203 v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM652 1684q-31 0 -59.5 -26.5t-41.5 -80.5h-149 q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1630" d="M119 0zM1511 733q0 -363 -180 -558t-516 -195t-516 195t-180 560t180.5 557.5t517.5 192.5t515.5 -194t178.5 -558zM444 733q0 -245 93 -369t278 -124q371 0 371 493q0 494 -369 494q-185 0 -279 -124.5t-94 -369.5zM474 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37 t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM877 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xd7;" d="M428 723l-299 301l152 154l301 -299l305 299l153 -150l-305 -305l301 -303l-149 -152l-305 301l-301 -299l-150 152z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1630" d="M1511 733q0 -363 -180 -558t-516 -195q-197 0 -336 65l-90 -135l-162 108l90 136q-198 194 -198 581q0 365 180.5 557.5t517.5 192.5q198 0 344 -70l84 125l160 -104l-88 -131q194 -194 194 -572zM444 733q0 -191 56 -307l506 756q-84 45 -189 45q-185 0 -279 -124.5 t-94 -369.5zM1186 733q0 180 -51 297l-500 -751q76 -39 180 -39q371 0 371 493z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM750 1579q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xda;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM602 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM1006 1579q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357 q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1548" d="M174 0zM1374 1462v-946q0 -162 -72.5 -284t-209.5 -187t-324 -65q-282 0 -438 144.5t-156 395.5v942h309v-895q0 -169 68 -248t225 -79q152 0 220.5 79.5t68.5 249.5v893h309zM433 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5 q-64 0 -101.5 35t-37.5 98zM836 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1278" d="M0 0zM639 860l305 602h334l-485 -893v-569h-308v559l-485 903h336zM461 1579v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xde;" horiz-adv-x="1286" d="M1194 770q0 -229 -142.5 -353t-404.5 -124h-153v-293h-310v1462h310v-229h178q254 0 388 -119t134 -344zM494 543h100q145 0 216 52.5t71 174.5q0 107 -63.5 159t-199.5 52h-124v-438z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1456" d="M1249 1241q0 -64 -21 -112.5t-53 -86.5t-69 -67t-69 -53t-53 -45t-21 -43q0 -27 26.5 -53t92.5 -66q146 -91 198.5 -140t78 -110t25.5 -139q0 -172 -116.5 -259t-343.5 -87q-99 0 -171 14.5t-132 48.5v242q53 -36 135.5 -61t146.5 -25q168 0 168 123q0 41 -16 66.5 t-57 55.5t-115 72q-126 72 -175 131.5t-49 140.5q0 64 35 117t105 102q77 55 108 95t31 86q0 60 -63.5 100.5t-163.5 40.5q-116 0 -181 -52.5t-65 -148.5v-1128h-305v1139q0 201 146.5 314.5t404.5 113.5q244 0 391 -88.5t147 -237.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM614 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM441 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM843 1240q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM467 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36 t-73 16.5z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM285 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM688 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36 q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1237" d="M86 0zM870 0l-59 152h-8q-77 -97 -158.5 -134.5t-212.5 -37.5q-161 0 -253.5 92t-92.5 262q0 178 124.5 262.5t375.5 93.5l194 6v49q0 170 -174 170q-134 0 -315 -81l-101 206q193 101 428 101q225 0 345 -98t120 -298v-745h-213zM780 518l-118 -4q-133 -4 -198 -48 t-65 -134q0 -129 148 -129q106 0 169.5 61t63.5 162v92zM883 1479q0 -108 -71 -174t-183 -66t-180 64t-68 174q0 108 67.5 172.5t180.5 64.5q110 0 182 -66t72 -169zM725 1477q0 45 -27 70.5t-69 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69 26t27 71z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1878" d="M1329 -20q-137 0 -249.5 50.5t-184.5 155.5q-98 -117 -196.5 -161.5t-256.5 -44.5q-161 0 -258.5 94.5t-97.5 259.5q0 178 121 262.5t362 93.5l191 6v84q0 69 -44.5 102t-121.5 33q-140 0 -305 -77l-99 202q189 101 422 101q227 0 342 -131q66 64 152.5 96.5t206.5 32.5 q221 0 349 -137.5t128 -370.5v-148h-723q5 -130 77 -203t202 -73q196 0 380 88v-236q-79 -39 -171 -59t-226 -20zM760 518l-113 -4q-124 -4 -186 -47.5t-62 -134.5q0 -129 140 -129q101 0 161 61t60 162v92zM1307 922q-217 0 -234 -236h430q-2 112 -55 174t-141 62z" />
+<glyph unicode="&#xe7;" horiz-adv-x="1053" d="M92 0zM614 -20q-522 0 -522 573q0 285 142 435.5t407 150.5q194 0 348 -76l-90 -236q-72 29 -134 47.5t-124 18.5q-238 0 -238 -338q0 -328 238 -328q88 0 163 23.5t150 73.5v-261q-74 -47 -149.5 -65t-190.5 -18zM805 -250q0 -128 -75.5 -185t-233.5 -57q-78 0 -146 21 v168q27 -7 72.5 -14t70.5 -7q72 0 72 62q0 83 -166 108l78 154h193l-27 -61q74 -24 118 -74.5t44 -114.5z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M620 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M447 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xea;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M860 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1210" d="M92 0zM623 922q-97 0 -152 -61.5t-63 -174.5h428q-2 113 -59 174.5t-154 61.5zM666 -20q-270 0 -422 149t-152 422q0 281 140.5 434.5t388.5 153.5q237 0 369 -135t132 -373v-148h-721q5 -130 77 -203t202 -73q101 0 191 21t188 67v-236q-80 -40 -171 -59.5t-222 -19.5z M297 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM700 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xec;" horiz-adv-x="625" d="M0 0zM465 0h-305v1118h305v-1118zM274 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xed;" horiz-adv-x="625" d="M145 0zM465 0h-305v1118h305v-1118zM145 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xee;" horiz-adv-x="625" d="M0 0zM465 0h-305v1118h305v-1118zM544 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xef;" horiz-adv-x="625" d="M0 0zM465 0h-305v1118h305v-1118zM-29 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM374 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5 t-40.5 100.5z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1268" d="M510 1303q-80 53 -152 92l101 176q144 -65 258 -141l225 139l100 -154l-170 -104q156 -143 230 -324.5t74 -413.5q0 -280 -145 -436.5t-400 -156.5q-245 0 -392 137t-147 372q0 233 130 369.5t351 136.5q205 0 275 -98l8 4q-67 162 -192 281l-230 -142l-100 156zM864 532 q0 108 -61 173t-168 65q-121 0 -176.5 -68.5t-55.5 -214.5q0 -140 60 -211t172 -71q123 0 176 82t53 245z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1346" d="M160 0zM1192 0h-305v653q0 121 -43 181.5t-137 60.5q-128 0 -185 -85.5t-57 -283.5v-526h-305v1118h233l41 -143h17q51 81 140.5 122.5t203.5 41.5q195 0 296 -105.5t101 -304.5v-729zM508 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82 q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M612 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M467 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M864 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M469 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1268" d="M92 0zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1176 561q0 -273 -144 -427t-401 -154q-161 0 -284 70.5t-189 202.5t-66 308q0 274 143 426t402 152q161 0 284 -70t189 -201t66 -307z M291 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM694 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xf7;" d="M88 612v219h993v-219h-993zM444 373q0 76 37 113.5t103 37.5t102.5 -39t36.5 -112q0 -70 -37 -111t-102 -41t-102.5 39t-37.5 113zM444 1071q0 75 37 113.5t103 38.5q67 0 103 -40.5t36 -111.5q0 -70 -37 -110.5t-102 -40.5t-102.5 39t-37.5 112z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1268" d="M1176 561q0 -273 -144 -427t-401 -154q-126 0 -234 45l-67 -101l-154 105l68 100q-152 156 -152 432q0 274 143 426t402 152q132 0 248 -52l55 82l152 -108l-58 -84q142 -155 142 -416zM403 561q0 -94 19 -166l317 475q-43 23 -106 23q-122 0 -176 -82.5t-54 -249.5z M864 561q0 81 -12 141l-309 -462q38 -15 92 -15q122 0 175.5 84.5t53.5 251.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM620 1241q-63 44 -185 142.5t-190 164.5v21h342q63 -101 235 -301v-27h-202z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM498 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5h-203z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM901 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357 q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1346" d="M154 0zM952 0l-41 143h-16q-49 -78 -139 -120.5t-205 -42.5q-197 0 -297 105.5t-100 303.5v729h305v-653q0 -121 43 -181.5t137 -60.5q128 0 185 85.5t57 283.5v526h305v-1118h-234zM326 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5 t-103 -36.5q-64 0 -101.5 35t-37.5 98zM729 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1165" d="M0 0zM0 1118h334l211 -629q27 -82 37 -194h6q11 103 43 194l207 629h327l-473 -1261q-65 -175 -185.5 -262t-281.5 -87q-79 0 -155 17v242q55 -13 120 -13q81 0 141.5 49.5t94.5 149.5l18 55zM393 1241v27q172 200 235 301h342v-21q-52 -52 -177.5 -154.5t-196.5 -152.5 h-203z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1296" d="M465 973q50 81 131 123.5t186 42.5q198 0 310 -154.5t112 -423.5q0 -273 -111.5 -427t-310.5 -154q-213 0 -317 137h-14l7 -62l7 -94v-453h-305v2048h305v-391l-7 -120l-7 -72h14zM684 895q-113 0 -165 -69.5t-54 -229.5v-33q0 -180 53.5 -258t169.5 -78q205 0 205 338 q0 165 -50.5 247.5t-158.5 82.5z" />
+<glyph unicode="&#xff;" horiz-adv-x="1165" d="M0 0zM0 1118h334l211 -629q27 -82 37 -194h6q11 103 43 194l207 629h327l-473 -1261q-65 -175 -185.5 -262t-281.5 -87q-79 0 -155 17v242q55 -13 120 -13q81 0 141.5 49.5t94.5 149.5l18 55zM243 1405q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5 t-103 -36.5q-64 0 -101.5 35t-37.5 98zM646 1405q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#x131;" horiz-adv-x="625" d="M465 0h-305v1118h305v-1118z" />
+<glyph unicode="&#x152;" horiz-adv-x="1993" d="M1872 0h-873q-38 -9 -109 -14.5t-116 -5.5q-319 0 -487 197t-168 558q0 363 169.5 556.5t487.5 193.5q61 0 127 -7t101 -16h868v-254h-563v-321h526v-254h-526v-377h563v-256zM776 1227q-166 0 -252 -125.5t-86 -368.5q0 -244 86 -368.5t250 -124.5q65 0 126 10.5 t99 28.5v907q-35 19 -101.5 30t-121.5 11z" />
+<glyph unicode="&#x153;" horiz-adv-x="2003" d="M1446 -20q-271 0 -420 155q-141 -155 -391 -155q-162 0 -286 70t-190.5 202t-66.5 309q0 277 141.5 427.5t399.5 150.5q112 0 212 -39.5t171 -116.5q144 156 383 156q244 0 380 -135t136 -373v-148h-746v-8q7 -127 81.5 -197.5t207.5 -70.5q107 0 200 21t193 67v-236 q-81 -39 -175.5 -59t-229.5 -20zM403 561q0 -166 54.5 -251t177.5 -85q122 0 175.5 84.5t53.5 251.5q0 166 -54 249t-177 83q-122 0 -176 -82.5t-54 -249.5zM1405 922q-94 0 -156 -57.5t-71 -178.5h450q-2 111 -60.5 173.5t-162.5 62.5z" />
+<glyph unicode="&#x178;" horiz-adv-x="1278" d="M0 0zM639 860l305 602h334l-485 -893v-569h-308v559l-485 903h336zM297 1743q0 65 37.5 100t101.5 35q66 0 103.5 -37t37.5 -98q0 -60 -38 -96.5t-103 -36.5q-64 0 -101.5 35t-37.5 98zM700 1743q0 70 40.5 102.5t100.5 32.5q65 0 103.5 -36t38.5 -99q0 -61 -39 -97 t-103 -36q-60 0 -100.5 32.5t-40.5 100.5z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1243" d="M852 1241q-157 93 -234 176q-78 -81 -229 -176h-203v27q189 189 256 301h357q31 -52 107.5 -141.5t148.5 -159.5v-27h-203z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M842 1479q0 -108 -71 -174t-183 -66t-180 64t-68 174q0 108 67.5 172.5t180.5 64.5q110 0 182 -66t72 -169zM684 1477q0 45 -27 70.5t-69 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69 26t27 71z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1243" d="M457 1346q-31 0 -59.5 -26.5t-41.5 -80.5h-149q11 145 82.5 227t189.5 82q41 0 80.5 -16.5t78 -36t75.5 -35.5t73 -16q31 0 59.5 26t41.5 80h149q-11 -145 -83.5 -227t-188.5 -82q-41 0 -80.5 16.5t-78 36t-75.5 36t-73 16.5z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M61 424v250h537v-250h-537z" />
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M82 436v230h860v-230h-860z" />
+<glyph unicode="&#x2014;" horiz-adv-x="2048" d="M82 436v230h1884v-230h-1884z" />
+<glyph unicode="&#x2018;" horiz-adv-x="444" d="M39 961l-14 22q22 91 72.5 228.5t103.5 250.5h219q-66 -267 -101 -501h-280z" />
+<glyph unicode="&#x2019;" horiz-adv-x="444" d="M406 1462l14 -22q-50 -197 -176 -479h-219q69 296 100 501h281z" />
+<glyph unicode="&#x201a;" horiz-adv-x="596" d="M459 215q-52 -202 -176 -479h-220q65 266 101 502h280z" />
+<glyph unicode="&#x201c;" horiz-adv-x="911" d="M492 983q22 91 72.5 228.5t103.5 250.5h219q-66 -267 -101 -501h-280zM25 983q22 91 72.5 228.5t103.5 250.5h219q-66 -267 -101 -501h-280z" />
+<glyph unicode="&#x201d;" horiz-adv-x="911" d="M420 1440q-50 -197 -176 -479h-219q69 296 100 501h281zM887 1440q-50 -197 -176 -479h-219q69 296 100 501h280z" />
+<glyph unicode="&#x201e;" horiz-adv-x="1061" d="M459 215q-52 -202 -176 -479h-220q65 266 101 502h280zM926 215q-52 -202 -176 -479h-220q65 266 101 502h280z" />
+<glyph unicode="&#x2022;" horiz-adv-x="770" d="M98 748q0 154 74 235.5t213 81.5q137 0 212 -82t75 -235q0 -152 -75.5 -235t-211.5 -83q-138 0 -212.5 83t-74.5 235z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1751" d="M117 143q0 84 45 127t131 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5zM700 143q0 84 45 127t132 43q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-85 0 -131 44.5t-46 125.5zM1284 143q0 84 45 127t131 43 q83 0 128.5 -44t45.5 -126q0 -79 -46 -124.5t-128 -45.5q-84 0 -130 44.5t-46 125.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="754" d="M82 573l371 455l219 -119l-279 -348l279 -348l-219 -119l-371 453v26z" />
+<glyph unicode="&#x203a;" horiz-adv-x="754" d="M672 547l-371 -453l-219 119l278 348l-278 348l219 119l371 -455v-26z" />
+<glyph unicode="&#x2044;" horiz-adv-x="266" d="M657 1462l-811 -1462h-239l811 1462h239z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="776" d="M758 737h-125v-151h-238v151h-383v154l385 577h236v-563h125v-168zM395 905v164q0 86 6 184q-9 -26 -35.5 -80t-41.5 -77l-127 -191h198z" />
+<glyph unicode="&#x20ac;" d="M803 1225q-122 0 -201 -70.5t-102 -204.5h403v-176h-418l-2 -35v-47l2 -33h355v-178h-338q51 -243 321 -243q143 0 275 57v-256q-116 -59 -293 -59q-245 0 -403 133t-199 368h-137v178h118q-4 23 -4 62l2 53h-116v176h133q37 242 199 382.5t405 140.5q188 0 352 -82 l-98 -232q-69 31 -129 48.5t-125 17.5z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M381 741h-168v572h-197v149h564v-149h-199v-572zM956 741l-165 529h-7l4 -111v-418h-163v721h247l160 -510l170 510h240v-721h-168v408l4 121h-6l-174 -529h-142z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1120" d="M0 1120h1120v-1120h-1120v1120z" />
+<glyph horiz-adv-x="1296" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff
new file mode 100644 (file)
index 0000000..1205787
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Bold-webfont.woff differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot
new file mode 100644 (file)
index 0000000..1f639a1
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.eot differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.svg b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.svg
new file mode 100644 (file)
index 0000000..6a2607b
--- /dev/null
@@ -0,0 +1,1830 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansbold_italic" horiz-adv-x="1128" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1352" d="M0 0zM-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h219l-49 -229h-220l-215 -1010q-77 -371 -403 -371z M1065 1380q0 87 47.5 131.5t134.5 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-151 0 -151 123zM1081 0h-301l237 1118h301z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1352" d="M0 0zM-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h219l-49 -229h-220l-215 -1010q-77 -371 -403 -371z M1081 0h-301l330 1556h301z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="2048" d="M-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h395l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49 l-79 -224q-69 31 -134 31q-57 0 -91.5 -40t-47.5 -105l-12 -62h219l-49 -229h-219l-215 -1010q-77 -371 -404 -371q-104 0 -174 25v242q61 -21 115 -21q136 0 172 170l205 965h-396l-215 -1010q-77 -371 -403 -371zM1778 0h-301l237 1118h301zM1761 1380q0 87 48 131.5 t135 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-152 0 -152 123z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="2048" d="M-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h395l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49 l-79 -224q-69 31 -134 31q-57 0 -91.5 -40t-47.5 -105l-12 -62h219l-49 -229h-219l-215 -1010q-77 -371 -404 -371q-104 0 -174 25v242q61 -21 115 -21q136 0 172 170l205 965h-396l-215 -1010q-77 -371 -403 -371zM1778 0h-301l329 1556h301z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="586" d="M391 485h-241l157 977h340zM25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="&#x22;" horiz-adv-x="928" d="M549 1462l-152 -528h-196l71 528h277zM954 1462l-151 -528h-199l74 528h276z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M1036 846l-69 -232h258l-19 -206h-297l-116 -408h-220l117 408h-194l-115 -408h-215l113 408h-238l18 206h277l70 232h-252l18 209h289l119 407h217l-117 -407h199l116 407h215l-116 -407h239l-18 -209h-279zM553 614h197l69 232h-196z" />
+<glyph unicode="$" d="M1034 496q0 -184 -125.5 -291.5t-367.5 -124.5l-39 -199h-140l44 201q-209 12 -355 86v266q198 -107 404 -117l71 322q-163 61 -241 151t-78 214q0 173 127 279.5t350 121.5l35 151h139l-33 -151q166 -22 295 -90l-106 -232q-132 65 -242 74l-63 -299q131 -51 195 -99.5 t97 -113t33 -149.5zM594 322q63 9 102 45t39 98q0 46 -24.5 75.5t-59.5 43.5zM633 1157q-62 -7 -96.5 -41t-34.5 -94q0 -79 80 -111z" />
+<glyph unicode="%" horiz-adv-x="1753" d="M518 1274q-63 0 -110.5 -128.5t-47.5 -277.5q0 -96 56 -96q65 0 112 131t47 275q0 96 -57 96zM821 1165q0 -166 -56 -310t-151 -217t-217 -73q-139 0 -210.5 83.5t-71.5 236.5q0 169 55.5 311.5t148.5 214.5t216 72q137 0 211.5 -80t74.5 -238zM1554 1462l-1083 -1462 h-240l1088 1462h235zM1376 690q-39 0 -75 -56t-59 -154t-23 -195t55 -97q41 0 77 55t59.5 154.5t23.5 196.5q0 96 -58 96zM1679 590q0 -167 -54 -313.5t-148 -220.5t-215 -74q-144 0 -216.5 78.5t-72.5 222.5q0 177 53 322.5t148 219.5t219 74q137 0 211.5 -78.5 t74.5 -230.5z" />
+<glyph unicode="&#x26;" horiz-adv-x="1450" d="M1325 0h-350l-72 98q-175 -118 -403 -118q-209 0 -320.5 97.5t-111.5 280.5q0 145 78.5 248.5t273.5 200.5q-76 130 -76 258q0 195 117.5 307.5t316.5 112.5q169 0 266 -82.5t97 -224.5q0 -280 -365 -426l195 -263q44 57 80.5 121.5t78.5 173.5h300q-133 -313 -310 -497z M541 623q-88 -51 -123 -104.5t-35 -131.5q0 -65 45.5 -108t116.5 -43q115 0 221 59zM662 920q113 59 155.5 111t42.5 112q0 57 -30 82.5t-70 25.5q-66 0 -102.5 -46.5t-36.5 -119.5q0 -46 12 -92t29 -73z" />
+<glyph unicode="'" horiz-adv-x="522" d="M549 1462l-152 -528h-196l71 528h277z" />
+<glyph unicode="(" horiz-adv-x="694" d="M74 281q0 339 122.5 626.5t381.5 554.5h262q-255 -278 -377.5 -573.5t-122.5 -618.5q0 -308 117 -594h-234q-149 266 -149 605z" />
+<glyph unicode=")" horiz-adv-x="694" d="M618 858q0 -342 -124 -630.5t-379 -551.5h-262q499 545 499 1192q0 307 -116 594h233q149 -264 149 -604z" />
+<glyph unicode="*" horiz-adv-x="1116" d="M885 1522l-113 -353l387 29l-18 -254l-338 43l160 -336l-246 -73l-90 337l-197 -278l-207 164l275 248l-326 92l86 237l338 -174l33 369z" />
+<glyph unicode="+" d="M475 612h-366v219h366v369h219v-369h367v-219h-367v-364h-219v364z" />
+<glyph unicode="," horiz-adv-x="569" d="M377 238l8 -23q-118 -255 -262 -479h-225q74 167 194 502h285z" />
+<glyph unicode="-" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="." horiz-adv-x="584" d="M25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="/" horiz-adv-x="862" d="M1014 1462l-809 -1462h-295l809 1462h295z" />
+<glyph unicode="0" d="M1110 1012q0 -470 -168.5 -751t-472.5 -281q-198 0 -300.5 122t-102.5 365q0 297 84 537t228 360.5t333 120.5q399 0 399 -473zM684 1235q-80 0 -149.5 -104t-117.5 -302t-48 -368q0 -115 27.5 -173.5t97.5 -58.5q81 0 150.5 106t116 301t46.5 386q0 111 -30.5 162 t-92.5 51z" />
+<glyph unicode="1" d="M688 0h-305l180 829q35 152 76 287q-9 -8 -61.5 -47t-262.5 -170l-133 215l566 348h249z" />
+<glyph unicode="2" d="M913 0h-962l43 213l477 424q180 159 248.5 254.5t68.5 179.5q0 75 -41 114.5t-110 39.5q-66 0 -135.5 -33.5t-171.5 -118.5l-146 203q132 112 252 159.5t250 47.5q190 0 301 -98t111 -259q0 -107 -41 -201t-122.5 -188t-266.5 -245l-269 -222v-10h568z" />
+<glyph unicode="3" d="M1104 1149q0 -156 -94.5 -262t-261.5 -135v-4q131 -26 198.5 -106.5t67.5 -201.5q0 -133 -74 -238t-212 -163.5t-327 -58.5q-239 0 -387 79v267q84 -50 182 -75.5t191 -25.5q158 0 243 63.5t85 176.5q0 172 -258 172h-138l46 221h73q167 0 263 62t96 172q0 67 -43 104 t-121 37q-134 0 -287 -100l-127 204q124 81 232.5 113.5t246.5 32.5q190 0 298 -90.5t108 -243.5z" />
+<glyph unicode="4" d="M1028 303h-170l-63 -303h-293l63 303h-590l48 234l770 925h311l-195 -919h170zM616 543l58 248q12 58 40 164t42 141h-6q-35 -63 -132 -181l-313 -372h311z" />
+<glyph unicode="5" d="M623 922q183 0 289 -103t106 -287q0 -167 -71.5 -292t-208.5 -192.5t-330 -67.5q-117 0 -218.5 23t-162.5 58v269q174 -99 352 -99q154 0 241 71t87 194q0 94 -57.5 141t-166.5 47q-102 0 -213 -33l-104 78l207 733h755l-55 -262h-489l-88 -293q72 15 127 15z" />
+<glyph unicode="6" d="M88 469q0 202 61 395.5t167.5 335t256.5 213.5t357 72q125 0 223 -27l-51 -246q-84 25 -191 25q-194 0 -313.5 -108t-185.5 -345h4q115 166 311 166q157 0 242.5 -97t85.5 -273q0 -169 -71 -313.5t-190.5 -215.5t-277.5 -71q-212 0 -320 127t-108 362zM530 227 q99 0 161.5 94t62.5 236q0 71 -33.5 113.5t-102.5 42.5q-60 0 -114.5 -35.5t-87.5 -95.5t-33 -160q0 -91 40 -143t107 -52z" />
+<glyph unicode="7" d="M78 0l737 1202h-629l56 260h975l-41 -194l-752 -1268h-346z" />
+<glyph unicode="8" d="M721 1485q123 0 215.5 -42t141 -118t48.5 -174q0 -134 -80.5 -233.5t-230.5 -151.5q217 -141 217 -365q0 -122 -63.5 -218.5t-181 -149.5t-273.5 -53q-214 0 -336.5 100t-122.5 270q0 298 348 426q-165 132 -165 299q0 119 58 212.5t168 145.5t257 52zM582 643 q-116 -45 -173 -107t-57 -153q0 -81 50 -128.5t135 -47.5q93 0 147.5 53.5t54.5 138.5q0 73 -36.5 131.5t-120.5 112.5zM694 1260q-76 0 -121 -46.5t-45 -119.5q0 -132 123 -201q185 72 185 221q0 68 -39.5 107t-102.5 39z" />
+<glyph unicode="9" d="M1092 1001q0 -280 -99 -533t-264 -370.5t-403 -117.5q-128 0 -240 32v256q111 -41 227 -41q121 0 207.5 49t144 138.5t99.5 257.5h-4q-111 -158 -295 -158q-163 0 -252.5 103.5t-89.5 285.5q0 166 73 305.5t196 208t286 68.5q203 0 308.5 -123t105.5 -361zM645 1237 q-65 0 -115.5 -42t-78 -114t-27.5 -153q0 -87 37.5 -131.5t105.5 -44.5q60 0 111.5 36.5t82 100t30.5 158.5q0 84 -35.5 137t-110.5 53z" />
+<glyph unicode=":" horiz-adv-x="584" d="M207 940q0 92 55.5 145.5t149.5 53.5q68 0 108.5 -38.5t40.5 -107.5q0 -86 -54.5 -140t-144.5 -54q-72 0 -113.5 36.5t-41.5 104.5zM25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode=";" horiz-adv-x="584" d="M385 215q-118 -255 -262 -479h-225q74 167 194 502h285zM207 940q0 92 55.5 145.5t149.5 53.5q68 0 108.5 -38.5t40.5 -107.5q0 -86 -54.5 -140t-144.5 -54q-72 0 -113.5 36.5t-41.5 104.5z" />
+<glyph unicode="&#x3c;" d="M1061 203l-952 438v143l952 496v-240l-643 -317l643 -281v-239z" />
+<glyph unicode="=" d="M109 807v217h952v-217h-952zM109 418v219h952v-219h-952z" />
+<glyph unicode="&#x3e;" d="M109 442l643 281l-643 317v240l952 -496v-143l-952 -438v239z" />
+<glyph unicode="?" horiz-adv-x="940" d="M260 485l14 78q19 103 73.5 177t172.5 155q124 84 157.5 127t33.5 96q0 119 -133 119q-50 0 -106.5 -16t-201.5 -84l-92 221q230 125 445 125q177 0 280 -87.5t103 -244.5q0 -83 -28.5 -149.5t-82.5 -123t-190 -147.5q-64 -43 -96.5 -73t-52.5 -64.5t-38 -108.5h-258z M166 115q0 91 55 144.5t150 53.5q68 0 108.5 -38t40.5 -107q0 -87 -55 -141t-143 -54q-74 0 -115 38t-41 104z" />
+<glyph unicode="@" horiz-adv-x="1753" d="M1733 840q0 -173 -64 -321t-177.5 -231t-254.5 -83q-88 0 -144.5 38.5t-72.5 108.5h-6q-50 -77 -113 -112t-147 -35q-127 0 -198 79.5t-71 229.5q0 147 67.5 276.5t187.5 205t268 75.5q185 0 327 -55l-106 -420q-11 -44 -19 -76.5t-8 -64.5q0 -68 58 -68q66 0 124 64 t92.5 171t34.5 214q0 213 -123.5 325.5t-359.5 112.5q-203 0 -366.5 -94t-255 -266t-91.5 -392q0 -243 134 -380.5t376 -137.5q117 0 219.5 20t221.5 66v-186q-230 -90 -465 -90q-217 0 -378 85.5t-246 241.5t-85 359q0 279 120.5 497t343 341.5t497.5 123.5 q318 0 499 -163.5t181 -458.5zM995 889q-82 0 -145.5 -51.5t-100 -137t-36.5 -174.5q0 -65 24.5 -102t69.5 -37q141 0 213 270l57 222q-36 10 -82 10z" />
+<glyph unicode="A" horiz-adv-x="1286" d="M842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333z" />
+<glyph unicode="B" horiz-adv-x="1270" d="M788 1462q229 0 346 -81.5t117 -243.5q0 -150 -83 -247.5t-236 -129.5v-6q100 -26 159.5 -96.5t59.5 -180.5q0 -229 -153 -353t-423 -124h-522l309 1462h426zM545 883h149q121 0 181.5 48.5t60.5 139.5q0 137 -170 137h-152zM412 256h180q117 0 183.5 58t66.5 161 q0 162 -183 162h-165z" />
+<glyph unicode="C" horiz-adv-x="1253" d="M905 1227q-132 0 -237.5 -81t-169.5 -238.5t-64 -338.5q0 -167 68.5 -248t218.5 -81q146 0 338 77v-260q-199 -77 -400 -77q-254 0 -395 149.5t-141 423.5q0 262 104 482.5t278 335t400 114.5q125 0 222 -22.5t208 -82.5l-118 -250q-106 59 -175 78t-137 19z" />
+<glyph unicode="D" horiz-adv-x="1386" d="M1323 909q0 -280 -98 -486.5t-283.5 -314.5t-437.5 -108h-451l309 1462h396q270 0 417.5 -143t147.5 -410zM518 256q148 0 258 76t172 223.5t62 337.5q0 154 -72.5 234.5t-208.5 80.5h-115l-202 -952h106z" />
+<glyph unicode="E" horiz-adv-x="1110" d="M870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512z" />
+<glyph unicode="F" horiz-adv-x="1087" d="M358 0h-305l309 1462h814l-54 -254h-508l-79 -377h473l-56 -253h-473z" />
+<glyph unicode="G" horiz-adv-x="1413" d="M754 821h563l-162 -762q-134 -46 -248.5 -62.5t-242.5 -16.5q-259 0 -400 147t-141 422q0 268 107 484.5t301 334t448 117.5q218 0 410 -99l-115 -251q-74 40 -148 64t-161 24q-153 0 -273.5 -83t-189 -236.5t-68.5 -330.5q0 -172 72.5 -252.5t222.5 -80.5q76 0 170 24 l66 299h-267z" />
+<glyph unicode="H" horiz-adv-x="1434" d="M1135 0h-306l134 631h-471l-134 -631h-305l309 1462h306l-121 -573h471l121 573h305z" />
+<glyph unicode="I" horiz-adv-x="659" d="M53 0l312 1462h305l-312 -1462h-305z" />
+<glyph unicode="J" horiz-adv-x="678" d="M-135 -430q-94 0 -187 27v253q88 -20 164 -20q99 0 160.5 60.5t89.5 191.5l293 1380h305l-303 -1423q-52 -245 -175.5 -357t-346.5 -112z" />
+<glyph unicode="K" horiz-adv-x="1255" d="M1141 0h-338l-211 592l-125 -70l-109 -522h-305l309 1462h306l-152 -702l158 205l409 497h361l-594 -700z" />
+<glyph unicode="L" horiz-adv-x="1061" d="M53 0l309 1462h306l-256 -1206h512l-54 -256h-817z" />
+<glyph unicode="M" horiz-adv-x="1802" d="M838 369l551 1093h423l-309 -1462h-280l145 692q53 247 105 441h-5l-569 -1133h-281l-61 1133h-4q-11 -88 -38 -231t-187 -902h-275l309 1462h404l68 -1093h4z" />
+<glyph unicode="N" horiz-adv-x="1546" d="M1247 0h-342l-356 1106h-6l-4 -32q-32 -216 -66 -386l-145 -688h-275l309 1462h357l340 -1077h4q12 76 39 217t180 860h274z" />
+<glyph unicode="O" horiz-adv-x="1495" d="M1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246t56 357 q0 142 -65 219.5t-183 77.5z" />
+<glyph unicode="P" horiz-adv-x="1188" d="M522 774h56q142 0 223.5 69t81.5 185q0 180 -195 180h-74zM1190 1036q0 -241 -169.5 -378.5t-467.5 -137.5h-86l-109 -520h-305l309 1462h338q242 0 366 -106.5t124 -319.5z" />
+<glyph unicode="Q" horiz-adv-x="1495" d="M1432 938q0 -316 -122.5 -555.5t-334.5 -337.5l254 -393h-359l-178 328h-26q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87 t155.5 246t56 357q0 142 -65 219.5t-183 77.5z" />
+<glyph unicode="R" horiz-adv-x="1247" d="M530 813h78q131 0 204 57t73 174q0 82 -47.5 123t-149.5 41h-74zM477 561l-119 -561h-305l309 1462h359q237 0 356 -102t119 -299q0 -158 -83 -271.5t-239 -168.5l261 -621h-332l-207 561h-119z" />
+<glyph unicode="S" horiz-adv-x="1085" d="M946 432q0 -209 -148 -330.5t-401 -121.5q-221 0 -356 90v274q193 -108 358 -108q112 0 175 42.5t63 116.5q0 43 -13.5 75.5t-38.5 60.5t-124 102q-138 99 -194 196t-56 209q0 129 62 230.5t176.5 158t263.5 56.5q217 0 397 -99l-109 -233q-156 74 -288 74 q-83 0 -136 -45t-53 -119q0 -61 33 -106.5t148 -120.5q121 -80 181 -176.5t60 -225.5z" />
+<glyph unicode="T" horiz-adv-x="1087" d="M571 0h-305l254 1204h-352l55 258h1010l-55 -258h-353z" />
+<glyph unicode="U" horiz-adv-x="1415" d="M1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306z" />
+<glyph unicode="V" horiz-adv-x="1208" d="M535 299q78 221 110 283l432 880h316l-748 -1462h-334l-127 1462h295l51 -880q4 -45 4 -133q-2 -103 -6 -150h7z" />
+<glyph unicode="W" horiz-adv-x="1831" d="M1006 1018q-46 -146 -115 -299l-324 -719h-338l-45 1462h287l6 -798q0 -52 -4 -173t-10 -174h6q22 64 67 180.5t60 145.5l369 819h270l21 -873q0 -146 -9 -272h6q43 129 131 349l330 796h309l-647 -1462h-346l-22 721l-2 139q0 88 4 158h-4z" />
+<glyph unicode="X" horiz-adv-x="1241" d="M1124 0h-331l-172 543l-396 -543h-342l576 764l-238 698h320l153 -518l363 518h344l-545 -725z" />
+<glyph unicode="Y" horiz-adv-x="1155" d="M627 870l374 592h342l-618 -903l-119 -559h-303l119 559l-236 903h312z" />
+<glyph unicode="Z" horiz-adv-x="1098" d="M920 0h-981l38 201l777 1005h-543l53 256h936l-41 -202l-782 -1004h596z" />
+<glyph unicode="[" horiz-adv-x="678" d="M436 -324h-473l381 1786h473l-45 -211h-215l-291 -1364h215z" />
+<glyph unicode="\" horiz-adv-x="862" d="M481 1462l224 -1462h-267l-217 1462h260z" />
+<glyph unicode="]" horiz-adv-x="678" d="M-92 -113h213l291 1364h-215l45 211h473l-381 -1786h-471z" />
+<glyph unicode="^" horiz-adv-x="1081" d="M20 520l619 950h147l277 -950h-223l-174 633l-402 -633h-244z" />
+<glyph unicode="_" horiz-adv-x="819" d="M635 -324h-821l30 140h822z" />
+<glyph unicode="`" horiz-adv-x="1135" d="M934 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="a" horiz-adv-x="1217" d="M406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44z" />
+<glyph unicode="b" horiz-adv-x="1219" d="M813 1139q146 0 230.5 -108t84.5 -298t-68 -367.5t-187 -281.5t-263 -104q-194 0 -276 163h-8l-58 -143h-231l330 1556h301l-62 -288q-41 -182 -84 -299h8q78 98 142.5 134t140.5 36zM692 895q-68 0 -130 -65t-102 -180.5t-40 -250.5q0 -80 37 -128t102 -48q67 0 128 69 t98.5 189.5t37.5 237.5q0 176 -131 176z" />
+<glyph unicode="c" horiz-adv-x="989" d="M506 -20q-201 0 -308.5 107.5t-107.5 303.5q0 212 74.5 385.5t209.5 268t308 94.5q182 0 328 -72l-92 -229q-54 23 -106 40t-118 17q-85 0 -153.5 -64t-107 -175.5t-38.5 -239.5q0 -96 45.5 -144.5t126.5 -48.5q76 0 141 23.5t134 58.5v-246q-152 -79 -336 -79z" />
+<glyph unicode="d" horiz-adv-x="1217" d="M406 -20q-147 0 -231.5 107t-84.5 300q0 196 71.5 374.5t188.5 278t258 99.5q82 0 141.5 -37t112.5 -127h8l2 28q6 110 25 195l76 358h301l-330 -1556h-229l14 145h-4q-71 -87 -148.5 -126t-170.5 -39zM532 223q66 0 128.5 68.5t100.5 182.5t38 245q0 80 -37.5 128 t-102.5 48q-68 0 -129.5 -72t-98 -190t-36.5 -234q0 -176 137 -176z" />
+<glyph unicode="e" horiz-adv-x="1141" d="M696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5t147.5 -52.5 q87 0 158 19t172 67v-227q-172 -86 -390 -86z" />
+<glyph unicode="f" horiz-adv-x="764" d="M-45 -492q-104 0 -174 25v242q61 -21 115 -21q61 0 107 40t65 130l204 965h-163l30 145l183 84l18 84q41 190 138.5 277.5t273.5 87.5q131 0 235 -49l-80 -224q-69 31 -133 31q-57 0 -92 -40t-47 -105l-12 -62h219l-49 -229h-220l-215 -1010q-77 -371 -403 -371z" />
+<glyph unicode="g" horiz-adv-x="1108" d="M1186 1116l-35 -166l-174 -41q16 -52 16 -118q0 -195 -121 -308.5t-329 -113.5q-59 0 -99 10q-84 -27 -84 -78q0 -34 30 -49t89 -23l137 -18q163 -21 237.5 -84.5t74.5 -183.5q0 -211 -156 -323t-446 -112q-208 0 -324.5 75.5t-116.5 207.5q0 102 68.5 175.5t214.5 121.5 q-74 47 -74 133q0 71 44.5 122.5t146.5 98.5q-65 49 -96 112t-31 153q0 199 125.5 315.5t341.5 116.5q83 0 166 -23h395zM365 -6q-106 -14 -160.5 -57t-54.5 -109q0 -115 194 -115q151 0 228 45t77 127q0 39 -32.5 60t-137.5 35zM614 948q-77 0 -124.5 -76.5t-47.5 -191.5 q0 -119 103 -119q75 0 121.5 76.5t46.5 193.5t-99 117z" />
+<glyph unicode="h" horiz-adv-x="1237" d="M977 0h-301l137 653q16 68 16 119q0 123 -108 123q-92 0 -167 -114t-118 -318l-98 -463h-301l330 1556h301q-39 -181 -60 -278t-86 -309h8q62 77 138 123.5t176 46.5q138 0 213.5 -83.5t75.5 -238.5q0 -73 -23 -180z" />
+<glyph unicode="i" horiz-adv-x="608" d="M322 1380q0 87 47.5 131.5t134.5 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-151 0 -151 123zM338 0h-301l237 1118h301z" />
+<glyph unicode="j" horiz-adv-x="608" d="M-90 -492q-104 0 -174 25v242q61 -21 114 -21q137 0 173 170l253 1194h302l-265 -1239q-77 -371 -403 -371zM324 1380q0 87 47.5 131.5t134.5 44.5q73 0 111 -31t38 -89q0 -80 -44 -129.5t-136 -49.5q-151 0 -151 123z" />
+<glyph unicode="k" horiz-adv-x="1163" d="M920 1118h344l-498 -504l285 -614h-336l-183 420l-120 -72l-74 -348h-301l330 1556h301l-148 -694q-8 -41 -29 -117l-28 -102h4z" />
+<glyph unicode="l" horiz-adv-x="608" d="M338 0h-301l330 1556h301z" />
+<glyph unicode="m" horiz-adv-x="1853" d="M844 1139q219 0 262 -228h6q68 110 160.5 169t197.5 59q136 0 207.5 -85t71.5 -237q0 -76 -23 -180l-133 -637h-301l138 653q16 68 16 119q0 123 -98 123q-92 0 -166.5 -112t-118.5 -318l-96 -465h-301l137 653q16 68 16 119q0 123 -98 123q-92 0 -167 -114t-118 -318 l-98 -463h-301l237 1118h230l-21 -207h6q146 228 355 228z" />
+<glyph unicode="n" horiz-adv-x="1237" d="M977 0h-301l137 653q16 68 16 119q0 123 -108 123q-92 0 -167 -114t-118 -318l-98 -463h-301l237 1118h230l-21 -207h6q146 228 355 228q138 0 213.5 -83.5t75.5 -238.5q0 -73 -23 -180z" />
+<glyph unicode="o" horiz-adv-x="1198" d="M805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5q196 0 310 -118 t114 -325z" />
+<glyph unicode="p" horiz-adv-x="1219" d="M813 1139q146 0 230.5 -107.5t84.5 -300.5q0 -191 -68.5 -367.5t-187.5 -280t-262 -103.5q-83 0 -143 37t-111 126h-8q-12 -159 -43 -295l-72 -340h-301l342 1610h230l-17 -170h9q138 191 317 191zM692 895q-68 0 -131.5 -67.5t-102 -180t-38.5 -248.5q0 -80 37 -128 t102 -48q67 0 128 69t98.5 189.5t37.5 237.5q0 176 -131 176z" />
+<glyph unicode="q" horiz-adv-x="1217" d="M391 -20q-88 0 -156 47.5t-106.5 138.5t-38.5 219q0 198 72 377.5t189 278t257 98.5q86 0 152.5 -37.5t124.5 -126.5h8l57 143h232l-342 -1610h-301q47 218 73 337.5t84 304.5h-8q-72 -94 -143 -132t-154 -38zM535 223q64 0 127.5 70t100 181t36.5 245q0 80 -37.5 128 t-102.5 48q-68 0 -129.5 -72t-98 -190t-36.5 -234q0 -88 36.5 -132t103.5 -44z" />
+<glyph unicode="r" horiz-adv-x="862" d="M842 1139q59 0 96 -11l-66 -290q-45 16 -100 16q-116 0 -203.5 -91.5t-124.5 -262.5l-106 -500h-301l237 1118h230l-21 -207h6q147 228 353 228z" />
+<glyph unicode="s" horiz-adv-x="969" d="M829 369q0 -188 -124.5 -288.5t-346.5 -100.5q-107 0 -186.5 15t-148.5 50v248q157 -90 319 -90q80 0 131 32.5t51 88.5q0 43 -37 77t-131 86q-121 68 -169 135.5t-48 159.5q0 170 110.5 263.5t315.5 93.5q201 0 363 -95l-99 -215q-140 84 -258 84q-57 0 -92 -25.5 t-35 -68.5q0 -39 32 -68.5t120 -74.5q123 -63 178 -137t55 -170z" />
+<glyph unicode="t" horiz-adv-x="840" d="M514 223q65 0 162 35v-225q-111 -53 -266 -53q-150 0 -220.5 63t-70.5 195q0 50 12 112l115 539h-152l29 147l196 84l132 236h194l-49 -238h283l-50 -229h-282l-115 -539q-6 -30 -6 -53q0 -74 88 -74z" />
+<glyph unicode="u" horiz-adv-x="1237" d="M262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213z" />
+<glyph unicode="v" horiz-adv-x="1049" d="M455 301q55 153 92 223l297 594h323l-604 -1118h-323l-138 1118h295l45 -586q7 -133 7 -231h6z" />
+<glyph unicode="w" horiz-adv-x="1614" d="M856 860q-62 -178 -123 -319l-233 -541h-324l-51 1118h281l4 -495l-4 -167l-7 -171h4q6 20 14 41.5t51 136.5t46 119l231 536h328v-536q0 -142 -10 -297h6l28 80q73 208 95 258l219 495h307l-530 -1118h-330l-6 520q0 155 10 340h-6z" />
+<glyph unicode="x" horiz-adv-x="1087" d="M379 573l-225 545h321l115 -334l244 334h354l-467 -561l244 -557h-326l-125 342l-264 -342h-350z" />
+<glyph unicode="y" horiz-adv-x="1063" d="M102 1118h295l56 -518q14 -122 14 -293h6q20 51 44 119.5t65 153.5l260 538h327l-680 -1278q-177 -332 -483 -332q-90 0 -147 19v240q68 -13 116 -13q84 0 147.5 48t117.5 149l26 49z" />
+<glyph unicode="z" horiz-adv-x="932" d="M748 0h-795l35 180l575 705h-397l51 233h750l-43 -200l-566 -685h439z" />
+<glyph unicode="{" horiz-adv-x="727" d="M201 319q0 140 -209 140l45 229q122 0 192.5 41.5t92.5 138.5l61 285q38 170 131 239.5t270 69.5h84l-49 -225q-90 -2 -130.5 -34.5t-55.5 -106.5l-66 -297q-45 -207 -276 -236v-8q85 -26 126.5 -82.5t41.5 -134.5q0 -44 -15 -113l-36 -178q-7 -28 -7 -51q0 -54 33.5 -74 t91.5 -20v-226h-53q-167 0 -253.5 63.5t-86.5 184.5q0 57 14 125l39 184q15 69 15 86z" />
+<glyph unicode="|" d="M455 1550h219v-2015h-219v2015z" />
+<glyph unicode="}" horiz-adv-x="727" d="M256 1462q340 0 340 -248q0 -56 -14 -124l-39 -185q-15 -69 -15 -86q0 -139 209 -139l-45 -229q-122 0 -192.5 -42t-91.5 -139l-62 -284q-37 -170 -130.5 -240t-270.5 -70h-45v226q93 3 137 35.5t59 105.5l66 297q25 111 95 166t181 69v9q-168 51 -168 217q0 43 15 112 l37 179q6 30 6 51q0 54 -36.5 74t-109.5 20l41 225h33z" />
+<glyph unicode="~" d="M342 672q-54 0 -116.5 -33t-116.5 -88v231q101 109 256 109q64 0 117 -14t139 -50q64 -27 111 -41t95 -14q51 0 112 30.5t122 90.5v-231q-103 -109 -256 -109q-59 0 -109 11.5t-147 51.5q-89 38 -127 47t-80 9z" />
+<glyph unicode="&#xa1;" horiz-adv-x="586" d="M182 606h242l-158 -977h-340zM549 977q0 -92 -55.5 -145.5t-149.5 -53.5q-68 0 -108.5 38t-40.5 108q0 85 54 139.5t144 54.5q73 0 114.5 -37t41.5 -104z" />
+<glyph unicode="&#xa2;" d="M575 -20h-188l49 210q-134 36 -203 136t-69 258q0 193 62.5 355t178 262.5t267.5 123.5l33 158h188l-35 -158q118 -14 225 -65l-92 -230q-53 23 -105 40t-118 17q-133 0 -216 -143t-83 -336q0 -96 45 -144t127 -48q75 0 140 23.5t134 58.5v-246q-136 -71 -299 -80z" />
+<glyph unicode="&#xa3;" d="M872 1485q195 0 369 -86l-113 -232q-141 68 -237 68q-75 0 -123 -39.5t-68 -132.5l-47 -229h299l-45 -220h-299l-18 -84q-42 -195 -209 -270h655l-55 -260h-993l49 246q196 48 244 264l22 104h-192l45 220h192l49 247q41 197 162 300.5t313 103.5z" />
+<glyph unicode="&#xa4;" d="M190 723q0 102 54 197l-129 127l147 147l127 -127q91 53 197 53q105 0 196 -55l127 129l150 -143l-129 -129q53 -89 53 -199q0 -107 -53 -199l125 -125l-146 -145l-127 125q-95 -51 -196 -51q-115 0 -199 51l-125 -123l-145 145l127 125q-54 93 -54 197zM397 723 q0 -77 54.5 -132.5t134.5 -55.5q81 0 136.5 55t55.5 133q0 80 -56.5 135t-135.5 55q-78 0 -133.5 -56t-55.5 -134z" />
+<glyph unicode="&#xa5;" d="M608 872l371 590h311l-506 -747h203l-39 -178h-252l-28 -138h252l-37 -178h-252l-47 -221h-291l47 221h-252l37 178h252l29 138h-252l39 178h196l-192 747h297z" />
+<glyph unicode="&#xa6;" d="M455 1550h219v-815h-219v815zM455 350h219v-815h-219v815z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M150 760q0 89 47.5 163t154.5 142q-42 34 -70 84.5t-28 107.5q0 149 117 234.5t313 85.5q172 0 344 -88l-82 -193q-147 84 -282 84q-144 0 -144 -106q0 -43 40.5 -76t127.5 -72q242 -106 242 -303q0 -188 -193 -303q38 -35 64 -85.5t26 -108.5q0 -161 -126 -253.5 t-345 -92.5q-204 0 -336 75v224q172 -105 345 -105q99 0 144.5 35t45.5 92q0 39 -33 72.5t-127 79.5q-117 57 -181 131t-64 176zM506 967q-51 -25 -82 -70.5t-31 -99.5t43.5 -96.5t143.5 -88.5q49 31 75.5 78.5t26.5 95.5q0 109 -176 181z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1135" d="M397 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM799 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M932 1010q-111 0 -163 -73t-52 -214q0 -134 55.5 -203t159.5 -69q43 0 108.5 15.5t124.5 43.5v-191q-131 -57 -262 -57q-196 0 -307 122.5t-111 336.5q0 225 117.5 351t325.5 126q142 0 284 -72l-75 -174q-114 58 -205 58zM125 731q0 200 100 375t275 276t377 101 q199 0 373.5 -99t276 -275.5t101.5 -377.5q0 -199 -98.5 -373t-272.5 -276t-380 -102q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM266 731q0 -164 81.5 -305t224 -223t305.5 -82q167 0 308 83t221.5 223.5t80.5 303.5t-80.5 303.5t-222 223.5t-307.5 83 q-164 0 -306.5 -82.5t-223.5 -223.5t-81 -304z" />
+<glyph unicode="&#xaa;" horiz-adv-x="772" d="M369 752q-103 0 -160 70t-57 198q0 117 46 228t123 171t177 60q120 0 180 -103h6l39 90h154l-158 -702h-154l8 92h-2q-80 -104 -202 -104zM442 903q45 0 84 41.5t65.5 120t26.5 154.5q0 106 -88 106q-73 0 -123.5 -96t-50.5 -215q0 -111 86 -111z" />
+<glyph unicode="&#xab;" horiz-adv-x="1151" d="M72 569l401 463l191 -155l-279 -334l135 -350l-246 -103l-202 461v18zM559 569l402 463l190 -155l-279 -334l136 -350l-246 -103l-203 461v18z" />
+<glyph unicode="&#xac;" d="M1061 248h-219v364h-733v219h952v-583z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M41 424zM41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M1237 899q0 -86 -44 -149.5t-130 -96.5l197 -360h-254l-138 297h-67v-297h-230v874h308q173 0 265.5 -67.5t92.5 -200.5zM801 758h51q72 0 113 31t41 92q0 59 -35.5 88.5t-116.5 29.5h-53v-241zM125 731q0 200 100 375t275 276t377 101q199 0 373.5 -99t276 -275.5 t101.5 -377.5q0 -199 -98.5 -373t-272.5 -276t-380 -102q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM266 731q0 -164 81.5 -305t224 -223t305.5 -82q167 0 308 83t221.5 223.5t80.5 303.5t-80.5 303.5t-222 223.5t-307.5 83q-164 0 -306.5 -82.5t-223.5 -223.5t-81 -304z " />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036l45 201h1036z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M164 1137q0 93 46.5 173.5t127.5 126.5t172 46q93 0 173.5 -47t126.5 -127t46 -172q0 -93 -46 -173t-126 -125.5t-174 -45.5q-93 0 -173 45t-126.5 125t-46.5 174zM354 1137q0 -63 45.5 -108.5t110.5 -45.5q66 0 111 46t45 108q0 63 -45.5 110t-110.5 47t-110.5 -47.5 t-45.5 -109.5z" />
+<glyph unicode="&#xb1;" d="M475 674h-366v219h366v369h219v-369h367v-219h-367v-365h-219v365zM109 0v219h952v-219h-952z" />
+<glyph unicode="&#xb2;" horiz-adv-x="776" d="M707 586h-648l35 166l273 219q111 91 141 122t44.5 59t14.5 56q0 42 -25.5 62t-60.5 20q-86 0 -188 -82l-100 158q74 57 156 87t192 30q123 0 196.5 -63t73.5 -160q0 -70 -22 -123t-70 -103.5t-189 -152.5l-129 -95h347z" />
+<glyph unicode="&#xb3;" horiz-adv-x="776" d="M813 1270q0 -87 -51 -145.5t-166 -88.5v-4q154 -33 154 -176q0 -131 -107 -209t-285 -78q-75 0 -145.5 15.5t-120.5 40.5v192q125 -72 254 -72q76 0 125 30.5t49 88.5q0 37 -26 62.5t-88 25.5h-127l34 160h90q84 0 132.5 28t48.5 85q0 40 -26 60t-71 20q-86 0 -188 -66 l-82 150q142 92 313 92q130 0 206.5 -55.5t76.5 -155.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1135" d="M483 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1249" d="M424 348q0 -60 31.5 -92.5t79.5 -32.5q90 0 162.5 106.5t117.5 319.5l98 469h301l-237 -1118h-229l18 176h-6q-117 -196 -266 -196q-51 0 -89.5 19.5t-58.5 47.5h-6q-8 -66 -21.5 -139t-82.5 -400h-304l342 1610h301l-135 -645q-16 -70 -16 -125z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1202 -260h-162v1616h-166v-1616h-161v819q-62 -18 -146 -18q-216 0 -318 125t-102 376q0 256 107.5 385t343.5 129h604v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="584" d="M131 553zM131 695q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M262 -250q0 -116 -83 -179t-234 -63q-86 0 -152 23v168q63 -23 125 -23q102 0 102 82q0 34 -31 56.5t-110 31.5l96 154h185l-39 -72q141 -49 141 -178z" />
+<glyph unicode="&#xb9;" horiz-adv-x="776" d="M528 1462h207l-186 -876h-246l84 397q24 109 55 207q-16 -15 -80 -60l-131 -81l-102 165z" />
+<glyph unicode="&#xba;" horiz-adv-x="754" d="M809 1194q0 -128 -48.5 -232.5t-132.5 -157t-196 -52.5q-134 0 -202 75t-68 211q0 197 104 319t277 122q129 0 197.5 -73.5t68.5 -211.5zM522 1315q-64 0 -107.5 -89.5t-43.5 -199.5q0 -111 80 -111q63 0 105 85.5t42 207.5q0 107 -76 107z" />
+<glyph unicode="&#xbb;" horiz-adv-x="1151" d="M1079 535l-401 -463l-191 155l279 334l-135 350l246 103l202 -461v-18zM592 535l-402 -463l-190 155l279 334l-136 350l246 103l203 -461v-18z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1804" d="M97 0zM1500 1462l-1084 -1462h-239l1087 1462h236zM496 1462h207l-186 -876h-246l84 397q24 109 55 207q-16 -15 -80 -60l-131 -81l-102 165zM1573 152h-119l-32 -151h-238l33 151h-373l31 174l475 557h260l-121 -563h119zM1252 320l58 231l22 74q-13 -20 -43 -58 t-211 -247h174z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1804" d="M97 0zM1588 1h-648l35 166l273 219q111 91 141 122t44.5 59t14.5 56q0 42 -25.5 62t-60.5 20q-86 0 -188 -82l-100 158q74 57 156 87t192 30q123 0 196.5 -63t73.5 -160q0 -70 -22 -123t-70 -103.5t-189 -152.5l-129 -95h347zM496 1462h207l-186 -876h-246l84 397 q24 109 55 207q-16 -15 -80 -60l-131 -81l-102 165zM1500 1462l-1084 -1462h-239l1087 1462h236z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1804" d="M133 0zM1633 1462l-1084 -1462h-239l1087 1462h236zM1634 152h-119l-32 -151h-238l33 151h-373l31 174l475 557h260l-121 -563h119zM1313 320l58 231l22 74q-13 -20 -43 -58t-211 -247h174zM854 1270q0 -87 -51 -145.5t-166 -88.5v-4q154 -33 154 -176q0 -131 -107 -209 t-285 -78q-75 0 -145.5 15.5t-120.5 40.5v192q125 -72 254 -72q76 0 125 30.5t49 88.5q0 37 -26 62.5t-88 25.5h-127l34 160h90q84 0 132.5 28t48.5 85q0 40 -26 60t-71 20q-86 0 -188 -66l-82 150q142 92 313 92q130 0 206.5 -55.5t76.5 -155.5z" />
+<glyph unicode="&#xbf;" horiz-adv-x="940" d="M678 606l-14 -78q-19 -105 -76.5 -180t-169.5 -151q-122 -83 -156.5 -126t-34.5 -98q0 -118 133 -118q50 0 106.5 16t201.5 84l92 -221q-221 -125 -445 -125q-177 0 -280 87.5t-103 244.5q0 82 28.5 148.5t83.5 124t189 146.5q93 62 128 106.5t51 106.5l8 33h258z M772 977q0 -92 -55.5 -145.5t-149.5 -53.5q-68 0 -108.5 38t-40.5 108q0 86 54.5 140t143.5 54q73 0 114.5 -37t41.5 -104z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM965 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM735 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM1235 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z " />
+<glyph unicode="&#xc3;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM999 1579q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5 t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM516 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM918 1720q0 78 42 118t120 40 q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1286" d="M0 0zM842 348h-473l-172 -348h-320l766 1468h373l147 -1468h-297zM827 608l-26 350q-10 131 -10 253v36q-44 -120 -109 -254l-188 -385h333zM1087 1567q0 -107 -70 -173.5t-184 -66.5q-110 0 -179 63.5t-69 174.5q0 109 68.5 173t179.5 64q110 0 182 -65t72 -170z M930 1565q0 45 -27.5 70.5t-69.5 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69.5 26t27.5 71z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1833" d="M1593 0h-817l74 348h-426l-219 -348h-328l922 1462h1104l-54 -254h-512l-67 -321h477l-55 -254h-478l-79 -377h512zM905 608l127 600h-80l-364 -600h317z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1253" d="M123 0zM905 1227q-132 0 -237.5 -81t-169.5 -238.5t-64 -338.5q0 -167 68.5 -248t218.5 -81q146 0 338 77v-260q-199 -77 -400 -77q-254 0 -395 149.5t-141 423.5q0 262 104 482.5t278 335t400 114.5q125 0 222 -22.5t208 -82.5l-118 -250q-106 59 -175 78t-137 19z M825 -250q0 -116 -83 -179t-234 -63q-86 0 -152 23v168q63 -23 125 -23q102 0 102 82q0 34 -31 56.5t-110 31.5l96 154h185l-39 -72q141 -49 141 -178z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM906 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM608 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xca;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM1177 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1110" d="M53 0zM870 0h-817l309 1462h818l-54 -254h-512l-67 -321h477l-55 -254h-477l-80 -377h512zM438 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM840 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5 t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xcc;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM667 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM414 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xce;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM937 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xcf;" horiz-adv-x="659" d="M53 0zM53 0l312 1462h305l-312 -1462h-305zM222 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM624 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1386" d="M1323 909q0 -280 -98 -486.5t-283.5 -314.5t-437.5 -108h-451l125 596h-141l55 254h139l131 612h396q270 0 417.5 -143t147.5 -410zM518 256q148 0 258 76t172 223.5t62 337.5q0 154 -72.5 234.5t-208.5 80.5h-115l-75 -358h237l-55 -254h-238l-71 -340h106z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1546" d="M53 0zM1247 0h-342l-356 1106h-6l-4 -32q-32 -216 -66 -386l-145 -688h-275l309 1462h357l340 -1077h4q12 76 39 217t180 860h274zM1114 1579q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36 t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM1053 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM753 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM1308 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM1071 1579q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1495" d="M123 0zM1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q255 0 395 -144t140 -403zM872 1227q-121 0 -222 -91.5t-158.5 -251.5t-57.5 -347q0 -147 66.5 -222t187.5 -75t220.5 87t155.5 246 t56 357q0 142 -65 219.5t-183 77.5zM585 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM987 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xd7;" d="M428 723l-299 301l152 154l301 -299l305 299l153 -150l-305 -305l301 -303l-149 -152l-305 301l-301 -299l-150 152z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1495" d="M1432 938q0 -283 -99 -506.5t-271 -337.5t-396 -114q-180 0 -304 71l-108 -137l-154 115l121 151q-98 138 -98 357q0 265 99 487.5t273 341.5t402 119q182 0 305 -76l105 131l151 -117l-117 -145q91 -134 91 -340zM870 1233q-126 0 -229 -91.5t-160 -252.5t-57 -352 q0 -32 8 -101l596 754q-69 43 -158 43zM1133 930l-5 80l-589 -740q59 -37 153 -37q124 0 226 89t158.5 247.5t56.5 360.5z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM1002 1579h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311 q36 -148 115 -303v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM757 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5 t-194 -158.5h-209v25z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM1284 1579h-198q-63 53 -162 168q-105 -88 -232 -168h-217 v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1415" d="M141 0zM1434 1462l-201 -946q-57 -266 -218 -401t-419 -135q-212 0 -333.5 113.5t-121.5 307.5q0 72 15 138l196 923h305l-194 -919q-17 -74 -17 -125q0 -178 189 -178q123 0 195 76.5t104 228.5l194 917h306zM565 1720q0 78 42.5 118t119.5 40q133 0 133 -108 q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM967 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1155" d="M186 0zM627 870l374 592h342l-618 -903l-119 -559h-303l119 559l-236 903h312zM606 1604q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xde;" horiz-adv-x="1188" d="M1143 807q0 -243 -170.5 -378.5t-466.5 -135.5h-86l-62 -293h-305l309 1462h306l-50 -229h35q242 0 366 -106.5t124 -319.5zM475 547h55q139 0 222.5 66.5t83.5 185.5q0 180 -195 180h-74z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1350" d="M846 1567q208 0 331 -90t123 -240q0 -114 -49 -192t-178 -152q-73 -42 -96 -68.5t-23 -54.5q0 -23 22 -49.5t79 -69.5q107 -83 144.5 -150.5t37.5 -150.5q0 -170 -123.5 -270t-337.5 -100q-187 0 -297 61v240q128 -78 258 -78q101 0 148 33t47 86q0 40 -26.5 75 t-108.5 97q-94 72 -129 130t-35 126q0 84 45 145t162 127q66 37 104.5 76t38.5 96q0 62 -39.5 98.5t-124.5 36.5q-96 0 -156 -51.5t-85 -171.5l-254 -1219q-43 -198 -147 -288.5t-277 -90.5q-90 0 -160 25v242q61 -21 115 -21q133 0 170 178l254 1207q47 224 182 326 t385 102z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM869 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM598 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM1120 1240h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM884 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM397 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM799 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1217" d="M90 0zM406 -20q-147 0 -231.5 106.5t-84.5 298.5q0 198 72 377.5t189 278t257 98.5q97 0 167.5 -42t109.5 -122h8l57 143h232l-238 -1118h-229l14 145h-4q-134 -165 -319 -165zM524 223q69 0 133 67t103 181.5t39 259.5q0 71 -38.5 117.5t-101.5 46.5q-68 0 -129.5 -72 t-98 -190t-36.5 -234q0 -88 33.5 -132t95.5 -44zM1023 1479q0 -107 -70 -173.5t-184 -66.5q-110 0 -179 63.5t-69 174.5q0 109 68.5 173t179.5 64q110 0 182 -65t72 -170zM866 1477q0 45 -27.5 70.5t-69.5 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69.5 26t27.5 71z " />
+<glyph unicode="&#xe6;" horiz-adv-x="1786" d="M1206 -20q-109 0 -179.5 27t-117.5 87l-16 -94h-188l14 145h-6q-71 -88 -146.5 -126.5t-167.5 -38.5q-146 0 -227.5 109t-81.5 296q0 200 68.5 375.5t185 277t258.5 101.5q96 0 160.5 -38.5t114.5 -125.5h6l57 143h188l-18 -90q44 49 120.5 80t168.5 31 q157 0 246.5 -83.5t89.5 -221.5q0 -187 -167 -288.5t-476 -101.5h-52l-2 -19v-19q0 -96 55.5 -147.5t159.5 -51.5q66 0 152 23t162 63v-227q-179 -86 -361 -86zM518 223q72 0 134 68t99 184.5t37 243.5q0 80 -33 128t-102 48q-68 0 -128 -69t-95 -185.5t-35 -241.5 q0 -84 32.5 -130t90.5 -46zM1341 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95z" />
+<glyph unicode="&#xe7;" horiz-adv-x="989" d="M90 0zM506 -20q-201 0 -308.5 107.5t-107.5 303.5q0 212 74.5 385.5t209.5 268t308 94.5q182 0 328 -72l-92 -229q-54 23 -106 40t-118 17q-85 0 -153.5 -64t-107 -175.5t-38.5 -239.5q0 -96 45.5 -144.5t126.5 -48.5q76 0 141 23.5t134 58.5v-246q-152 -79 -336 -79z M653 -250q0 -116 -83 -179t-234 -63q-86 0 -152 23v168q63 -23 125 -23q102 0 102 82q0 34 -31 56.5t-110 31.5l96 154h185l-39 -72q141 -49 141 -178z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM849 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM528 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xea;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM1101 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1141" d="M90 0zM696 922q-88 0 -166 -80t-102 -195h45q155 0 241.5 48.5t86.5 131.5q0 95 -105 95zM532 -20q-210 0 -326 113t-116 319q0 207 82.5 377.5t223.5 260t319 89.5q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-477 -101.5h-51l-2 -21v-20q0 -91 51.5 -143.5 t147.5 -52.5q87 0 158 19t172 67v-227q-172 -86 -390 -86zM365 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM767 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xec;" horiz-adv-x="608" d="M37 0zM338 0h-301l237 1118h301zM579 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="608" d="M37 0zM338 0h-301l237 1118h301zM291 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xee;" horiz-adv-x="608" d="M36 0zM338 0h-301l237 1118h301zM845 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xef;" horiz-adv-x="608" d="M37 0zM338 0h-301l237 1118h301zM126 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM528 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1182" d="M618 1309q-34 34 -124 80l118 186q134 -61 232 -139l237 131l76 -152l-192 -106q81 -107 113 -235t32 -279q0 -249 -69.5 -432.5t-203.5 -283t-323 -99.5q-216 0 -329 110t-113 316q0 165 64.5 301t180.5 212t265 76q83 0 151.5 -31t114.5 -94h6q-20 213 -117 310 l-231 -131l-88 147zM528 205q66 0 122.5 55.5t89 148.5t32.5 193q0 77 -38.5 122.5t-108.5 45.5q-73 0 -130 -53t-88.5 -143t-31.5 -197q0 -81 39 -126.5t114 -45.5z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1237" d="M37 0zM977 0h-301l137 653q16 68 16 119q0 123 -108 123q-92 0 -167 -114t-118 -318l-98 -463h-301l237 1118h230l-21 -207h6q146 228 355 228q138 0 213.5 -83.5t75.5 -238.5q0 -73 -23 -180zM909 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28 t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM845 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311q36 -148 115 -303v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM571 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM1109 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM865 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1198" d="M90 0zM805 696q0 197 -143 197q-75 0 -134.5 -61t-97 -179t-37.5 -243q0 -185 150 -185q75 0 135 61.5t93.5 171t33.5 238.5zM1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-195 0 -311.5 117.5t-116.5 312.5q0 213 71.5 379.5t206.5 258t316 91.5 q196 0 310 -118t114 -325zM386 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM788 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xf7;" d="M109 612v219h952v-219h-952zM444 373q0 76 37 113.5t103 37.5t102.5 -39t36.5 -112q0 -70 -37 -111t-102 -41t-102.5 39t-37.5 113zM444 1071q0 75 37 113.5t103 38.5q67 0 103 -40.5t36 -111.5q0 -70 -37 -110.5t-102 -40.5t-102.5 39t-37.5 112z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1198" d="M1108 696q0 -211 -70.5 -374t-203.5 -252.5t-316 -89.5q-123 0 -225 53l-109 -135l-141 108l119 148q-72 107 -72 256q0 213 71.5 379.5t206.5 258t316 91.5q131 0 227 -56l70 88l145 -110l-84 -105q66 -107 66 -260zM662 903q-81 0 -144.5 -62.5t-98 -169.5t-34.5 -233 v-12l365 453q-35 24 -88 24zM543 215q114 0 193 133t79 318v16l-358 -444q11 -8 35.5 -15.5t50.5 -7.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM845 1241h-184q-71 69 -138.5 153.5t-103.5 153.5v21h311 q36 -148 115 -303v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM610 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209 v25z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM1143 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25 q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1237" d="M111 0zM262 1118h301l-137 -653q-16 -68 -16 -119q0 -123 108 -123q92 0 167 114t118 318l98 463h301l-237 -1118h-230l21 207h-6q-145 -227 -355 -227q-138 0 -211 82.5t-73 238.5q0 93 24 213zM411 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5 t-121 -43.5q-135 0 -135 110zM813 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1063" d="M0 0zM102 1118h295l56 -518q14 -122 14 -293h6q20 51 44 119.5t65 153.5l260 538h327l-680 -1278q-177 -332 -483 -332q-90 0 -147 19v240q68 -13 116 -13q84 0 147.5 48t117.5 149l26 49zM497 1266q79 88 222 303h335v-17q-46 -56 -154 -152.5t-194 -158.5h-209v25z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1219" d="M813 1139q150 0 232.5 -106.5t82.5 -301.5q0 -199 -69 -381t-182 -276t-250 -94q-178 0 -271 163h-8q-12 -159 -43 -295l-72 -340h-301l435 2048h301l-66 -307q-29 -131 -80 -280h8q131 170 283 170zM682 895q-71 0 -130 -65t-95.5 -184.5t-36.5 -246.5q0 -80 33.5 -128 t105.5 -48q69 0 129 65t97.5 183.5t37.5 247.5q0 88 -37.5 132t-103.5 44z" />
+<glyph unicode="&#xff;" horiz-adv-x="1063" d="M0 0zM102 1118h295l56 -518q14 -122 14 -293h6q20 51 44 119.5t65 153.5l260 538h327l-680 -1278q-177 -332 -483 -332q-90 0 -147 19v240q68 -13 116 -13q84 0 147.5 48t117.5 149l26 49zM310 1382q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5 q-135 0 -135 110zM712 1382q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5q-135 0 -135 110z" />
+<glyph unicode="&#x131;" horiz-adv-x="608" d="M338 0h-301l237 1118h301z" />
+<glyph unicode="&#x152;" horiz-adv-x="1845" d="M1606 0h-760q-93 -20 -180 -20q-256 0 -399.5 147.5t-143.5 409.5q0 265 99 487.5t273 341.5t402 119q140 0 209 -23h809l-53 -254h-512l-68 -321h477l-55 -254h-477l-80 -377h512zM688 240q88 0 158 32l194 916q-62 39 -168 39q-121 0 -222 -91.5t-158.5 -251.5 t-57.5 -347q0 -147 66.5 -222t187.5 -75z" />
+<glyph unicode="&#x153;" horiz-adv-x="1806" d="M1198 -20q-116 0 -208 38.5t-138 106.5q-63 -68 -147 -106.5t-207 -38.5q-187 0 -297.5 117t-110.5 317q0 216 69 380.5t200 254.5t309 90q209 0 313 -160q154 160 399 160q177 0 276 -81.5t99 -223.5q0 -187 -167 -288.5t-476 -101.5h-51l-2 -21v-20q0 -91 51 -143.5 t147 -52.5q87 0 158 19t172 67v-227q-93 -46 -185.5 -66t-203.5 -20zM645 893q-71 0 -127 -60.5t-90.5 -176.5t-34.5 -242q0 -91 36.5 -140t109.5 -49q109 0 179 134.5t70 336.5q0 96 -37 146.5t-106 50.5zM1362 922q-88 0 -165.5 -78.5t-102.5 -196.5h45q155 0 241 48.5 t86 131.5q0 95 -104 95z" />
+<glyph unicode="&#x178;" horiz-adv-x="1155" d="M186 0zM627 870l374 592h342l-618 -903l-119 -559h-303l119 559l-236 903h312zM432 1720q0 78 42.5 118t119.5 40q133 0 133 -108q0 -73 -39 -116.5t-121 -43.5q-135 0 -135 110zM834 1720q0 78 42 118t120 40q65 0 99 -28t34 -80q0 -73 -39.5 -116.5t-120.5 -43.5 q-135 0 -135 110z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1135" d="M1120 1241h-198q-63 53 -162 168q-105 -88 -232 -168h-217v25q63 57 153 147t142 156h338q22 -54 74 -142.5t102 -160.5v-25z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M1034 1479q0 -107 -70 -173.5t-184 -66.5q-110 0 -179 63.5t-69 174.5q0 109 68.5 173t179.5 64q110 0 182 -65t72 -170zM877 1477q0 45 -27.5 70.5t-69.5 25.5t-69 -25.5t-27 -70.5t24 -71t72 -26q42 0 69.5 26t27.5 71z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1135" d="M866 1241q-49 0 -86.5 16.5t-69.5 36t-61.5 36t-62.5 16.5q-31 0 -55.5 -28t-38.5 -79h-177q59 309 281 309q49 0 87.5 -16.5t71.5 -36t62 -35.5t60 -16q34 0 58 25.5t46 80.5h172q-66 -309 -287 -309z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M41 424l53 250h524l-53 -250h-524z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M41 436l49 230h852l-49 -230h-852z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1966" d="M41 436l49 230h1835l-49 -230h-1835z" />
+<glyph unicode="&#x2018;" horiz-adv-x="440" d="M123 961l-8 22q103 227 262 479h225q-91 -213 -194 -501h-285z" />
+<glyph unicode="&#x2019;" horiz-adv-x="440" d="M586 1462l8 -22q-103 -227 -262 -479h-226q89 206 195 501h285z" />
+<glyph unicode="&#x201a;" horiz-adv-x="569" d="M377 238l8 -23q-103 -227 -262 -479h-225q88 207 194 502h285z" />
+<glyph unicode="&#x201c;" horiz-adv-x="887" d="M569 961l-8 22q103 227 262 479h226q-97 -227 -195 -501h-285zM123 961l-8 22q103 227 262 479h225q-91 -213 -194 -501h-285z" />
+<glyph unicode="&#x201d;" horiz-adv-x="887" d="M586 1462l8 -22q-103 -227 -262 -479h-226q89 206 195 501h285zM1032 1462l8 -22q-103 -227 -262 -479h-225q23 53 46.5 111t148.5 390h284z" />
+<glyph unicode="&#x201e;" horiz-adv-x="1018" d="M377 238l8 -23q-103 -227 -262 -479h-225q88 207 194 502h285zM825 238l9 -23q-100 -221 -263 -479h-225q24 57 49 118.5t146 383.5h284z" />
+<glyph unicode="&#x2022;" horiz-adv-x="739" d="M104 686q0 106 42.5 194t120 136.5t182.5 48.5q120 0 182.5 -67t62.5 -191q0 -177 -91.5 -277t-248.5 -100q-117 0 -183.5 67t-66.5 189z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1706" d="M25 0zM25 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5zM586 115q0 90 53.5 144t150.5 54q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5zM1147 115q0 90 53.5 144t150.5 54 q68 0 109 -38t41 -107q0 -87 -55 -141t-144 -54q-73 0 -114 37.5t-41 104.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="664" d="M72 569l401 463l191 -155l-279 -334l135 -350l-246 -103l-202 461v18z" />
+<glyph unicode="&#x203a;" horiz-adv-x="664" d="M592 535l-402 -463l-190 155l279 334l-136 350l246 103l203 -461v-18z" />
+<glyph unicode="&#x2044;" horiz-adv-x="256" d="M791 1462l-1084 -1462h-239l1087 1462h236z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="776" d="M776 737h-119l-32 -151h-238l33 151h-373l31 174l475 557h260l-121 -563h119zM455 905l58 231l22 74q-13 -20 -43 -58t-211 -247h174z" />
+<glyph unicode="&#x20ac;" d="M899 1237q-97 0 -176 -74.5t-135 -212.5h348l-39 -176h-360q-11 -34 -25 -115h299l-37 -178h-280q0 -120 44.5 -181.5t147.5 -61.5q133 0 283 63v-258q-126 -63 -330 -63q-446 0 -446 501h-152l37 178h127q9 67 22 115h-125l39 176h135q87 252 250.5 393.5t374.5 141.5 q100 0 179 -23t165 -80l-125 -223q-87 49 -131 63.5t-90 14.5z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M471 741h-168v572h-197v149h564v-149h-199v-572zM1047 741l-166 529h-7l5 -111v-418h-164v721h248l159 -510l170 510h240v-721h-168v408l4 121h-6l-174 -529h-141z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1120" d="M0 1120h1120v-1120h-1120v1120z" />
+<glyph horiz-adv-x="1217" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff
new file mode 100644 (file)
index 0000000..ed760c0
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-BoldItalic-webfont.woff differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot
new file mode 100644 (file)
index 0000000..0c8a0ae
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.eot differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.svg b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.svg
new file mode 100644 (file)
index 0000000..e1075dc
--- /dev/null
@@ -0,0 +1,1830 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansitalic" horiz-adv-x="1128" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1165" d="M0 0zM-104 -492q-69 0 -125 21v141q64 -22 112 -22q76 0 117 62t66 177l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h238l-25 -127h-237l-232 -1098 q-39 -189 -120 -276t-213 -87zM870 0h-168l234 1096h168zM983 1376q0 56 32 91.5t83 35.5q88 0 88 -90q0 -55 -33.5 -93t-77.5 -38q-40 0 -66 24.5t-26 69.5z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1165" d="M0 0zM-104 -492q-69 0 -125 21v141q64 -22 112 -22q76 0 117 62t66 177l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h238l-25 -127h-237l-232 -1098 q-39 -189 -120 -276t-213 -87zM868 0h-168l332 1556h168z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1815" d="M545 -492q-71 0 -125 21v141q61 -22 115 -22q68 0 111 57.5t69 181.5l227 1082h-481l-232 -1098q-39 -189 -120 -276t-213 -87q-69 0 -125 21v141q64 -22 112 -22q70 0 114 58t69 181l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5 t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h482l24 108q45 197 126 280t243 83q41 0 97.5 -11t92.5 -26l-45 -129q-76 29 -137 29q-89 0 -135 -51t-74 -175l-24 -108h239l-26 -127h-238l-231 -1098q-43 -195 -123.5 -279t-210.5 -84z M1522 0h-168l233 1096h168zM1634 1376q0 54 32 90.5t83 36.5q88 0 88 -90q0 -55 -33.5 -93t-77.5 -38q-38 0 -65 24.5t-27 69.5z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1815" d="M1520 0h-168l331 1556h168zM545 -492q-71 0 -125 21v141q61 -22 115 -22q68 0 111 57.5t69 181.5l227 1082h-481l-232 -1098q-39 -189 -120 -276t-213 -87q-69 0 -125 21v141q64 -22 112 -22q70 0 114 58t69 181l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5 t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h482l24 108q45 197 126 280t243 83q41 0 97.5 -11t92.5 -26l-45 -129q-76 29 -137 29q-89 0 -135 -51t-74 -175l-24 -108h239l-26 -127h-238l-231 -1098 q-43 -195 -123.5 -279t-210.5 -84z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="530" d="M555 1462l-274 -1059h-109q49 307 176 1059h207zM43 78q0 76 39.5 120t107.5 44q45 0 73 -27.5t28 -81.5q0 -68 -39 -115t-105 -47q-49 0 -76.5 28t-27.5 79z" />
+<glyph unicode="&#x22;" horiz-adv-x="791" d="M485 1462l-153 -528h-107l72 528h188zM834 1462l-154 -528h-107l72 528h189z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M1036 899l-98 -340h285l-13 -129h-309l-125 -430h-139l129 430h-303l-127 -430h-133l121 430h-261l13 129h284l101 340h-277l13 127h301l123 436h139l-125 -436h305l127 436h133l-125 -436h264l-12 -127h-291zM500 559h303l96 340h-303z" />
+<glyph unicode="$" d="M942 492q0 -162 -112.5 -263t-309.5 -123l-49 -225h-133l49 223q-195 14 -315 72v154q82 -41 175.5 -63.5t166.5 -22.5l98 452q-139 49 -201.5 123.5t-62.5 188.5q0 159 108 255t299 113l39 176h133l-39 -178q159 -12 283 -76l-63 -135q-121 63 -248 72l-94 -440 q149 -55 212.5 -125t63.5 -178zM549 250q107 13 170 75t63 154q0 54 -33 96t-114 74zM627 1235q-108 -11 -167 -69t-59 -156q0 -53 34.5 -97.5t107.5 -70.5z" />
+<glyph unicode="%" horiz-adv-x="1624" d="M1468 1462l-1085 -1462h-152l1086 1462h151zM1284 772q-67 0 -119.5 -64.5t-84 -188.5t-31.5 -240q0 -173 106 -173q65 0 117 65t86.5 198.5t34.5 236.5q0 166 -109 166zM1532 621q0 -107 -31.5 -236t-82 -217.5t-121 -138t-156.5 -49.5q-110 0 -171 74.5t-61 219.5 q0 166 50.5 318.5t136.5 228.5t200 76q116 0 176 -71.5t60 -204.5zM543 1358q-66 0 -119 -63t-85 -187.5t-32 -243.5q0 -172 107 -172q52 0 94 39.5t73.5 114t50.5 175t19 171.5q0 166 -108 166zM791 1206q0 -108 -32 -237.5t-82.5 -217.5t-120.5 -137t-157 -49 q-109 0 -170 75t-61 220q0 166 50.5 318.5t136.5 228.5t200 76q116 0 176 -72t60 -205z" />
+<glyph unicode="&#x26;" horiz-adv-x="1372" d="M737 1348q-105 0 -163 -60t-58 -170q0 -120 82 -235q139 71 191 110t83 85t31 104q0 77 -42.5 121.5t-123.5 44.5zM471 119q87 0 168 33t195 124l-306 433q-128 -67 -184 -116t-85.5 -107.5t-29.5 -131.5q0 -106 66.5 -170.5t175.5 -64.5zM66 342q0 148 90 257.5 t303 211.5q-103 165 -103 309q0 164 106 264.5t281 100.5q149 0 236.5 -79t87.5 -212q0 -78 -32.5 -137t-87.5 -108t-127.5 -90t-153.5 -83l278 -389q127 110 199 295h168q-101 -236 -283 -412l203 -270h-201l-117 166q-120 -100 -230 -143t-247 -43q-168 0 -269 96 t-101 266z" />
+<glyph unicode="'" horiz-adv-x="444" d="M485 1462l-153 -528h-107l72 528h188z" />
+<glyph unicode="(" horiz-adv-x="584" d="M82 272q0 339 120 627t384 563h157q-246 -270 -371.5 -570t-125.5 -618q0 -339 114 -598h-131q-147 266 -147 596z" />
+<glyph unicode=")" horiz-adv-x="584" d="M500 864q0 -341 -121.5 -629.5t-382.5 -558.5h-156q496 551 496 1188q0 341 -113 598h131q146 -269 146 -598z" />
+<glyph unicode="*" horiz-adv-x="1130" d="M854 1528l-123 -383l422 18l-8 -157l-393 47l180 -383l-166 -52l-113 406l-258 -344l-116 121l309 284l-373 109l55 154l371 -185l41 400z" />
+<glyph unicode="+" d="M516 651h-389v142h389v391h141v-391h390v-142h-390v-387h-141v387z" />
+<glyph unicode="," horiz-adv-x="492" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187z" />
+<glyph unicode="-" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="." horiz-adv-x="518" d="M43 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="/" horiz-adv-x="717" d="M893 1462l-813 -1462h-174l813 1462h174z" />
+<glyph unicode="0" d="M1092 1014q0 -295 -78.5 -539t-214 -369.5t-314.5 -125.5q-176 0 -270 127.5t-94 369.5q0 270 82 514.5t216.5 369t307.5 124.5q365 0 365 -471zM717 1341q-113 0 -209 -115.5t-155.5 -323t-59.5 -423.5q0 -172 50 -264t161 -92q115 0 209 114t150.5 328t56.5 453 q0 323 -203 323z" />
+<glyph unicode="1" d="M588 0h-172l196 913q59 261 88 359q-50 -53 -139 -111l-178 -110l-80 127l449 284h149z" />
+<glyph unicode="2" d="M911 0h-899l31 147l465 420q102 93 176.5 163.5t123 133t72 124t23.5 136.5q0 99 -60 157t-163 58q-77 0 -150.5 -28.5t-162.5 -96.5l-82 115q191 154 413 154q176 0 278.5 -88.5t102.5 -243.5q0 -111 -39.5 -204t-131 -197t-294.5 -281l-352 -307v-8h678z" />
+<glyph unicode="3" d="M1073 1159q0 -156 -101 -264.5t-280 -140.5v-9q124 -23 195 -106.5t71 -208.5q0 -133 -62 -234.5t-181 -158.5t-283 -57q-210 0 -385 79v164q94 -49 199 -75.5t190 -26.5q162 0 252 79.5t90 217.5q0 131 -79 198.5t-220 67.5h-131l31 143h139q165 0 274 87t109 227 q0 92 -58 146t-157 54q-80 0 -157 -27t-175 -93l-80 118q195 144 424 144q179 0 277 -87t98 -237z" />
+<glyph unicode="4" d="M1067 334h-233l-72 -334h-164l74 334h-656l29 158l834 978h196l-207 -983h232zM705 487q46 220 78 373t116 445h-8q-17 -29 -66.5 -96.5t-72.5 -96.5l-533 -625h486z" />
+<glyph unicode="5" d="M598 893q182 0 289.5 -104.5t107.5 -282.5q0 -161 -73 -283t-204 -182.5t-308 -60.5q-193 0 -330 79v164q164 -102 334 -102q191 0 298 96t107 268q0 126 -73.5 199.5t-204.5 73.5q-48 0 -97 -6.5t-139 -30.5l-74 57l197 684h668l-33 -153h-522l-127 -439q87 23 184 23z " />
+<glyph unicode="6" d="M133 424q0 209 60.5 415t163.5 351.5t246 219t327 73.5q111 0 184 -23l-35 -145q-68 22 -170 22q-212 0 -356.5 -149t-212.5 -443h8q59 79 146.5 126t193.5 47q154 0 244 -98.5t90 -270.5q0 -161 -66.5 -294.5t-180.5 -204t-261 -70.5q-182 0 -281.5 115t-99.5 329z M532 121q94 0 167.5 54t114 149t40.5 208q0 248 -221 248q-66 0 -128 -28.5t-110 -76t-72 -104.5t-24 -155q0 -137 60.5 -216t172.5 -79z" />
+<glyph unicode="7" d="M174 0l768 1313h-719l31 149h891l-27 -139l-764 -1323h-180z" />
+<glyph unicode="8" d="M741 1485q174 0 271.5 -86.5t97.5 -235.5q0 -129 -78 -225t-266 -176q127 -78 180 -165t53 -202q0 -122 -60 -217.5t-172.5 -146.5t-264.5 -51q-190 0 -298 98.5t-108 267.5q0 148 95 256t296 184q-95 69 -135.5 144.5t-40.5 171.5q0 111 54.5 198.5t153.5 136t222 48.5z M608 700q-185 -60 -261.5 -143.5t-76.5 -202.5q0 -107 69 -170t181 -63q139 0 222 74t83 196q0 99 -52 174t-165 135zM729 1341q-114 0 -182 -65.5t-68 -175.5q0 -82 39 -144t127 -116q161 60 228 131.5t67 173.5q0 90 -57.5 143t-153.5 53z" />
+<glyph unicode="9" d="M1067 1034q0 -194 -56 -406.5t-147.5 -360t-221.5 -217.5t-302 -70q-136 0 -242 34v158q134 -47 246 -47q202 0 327 141t189 441h-10q-51 -75 -132.5 -118.5t-180.5 -43.5q-169 0 -261 98.5t-92 288.5q0 153 64.5 280.5t180 199t259.5 71.5q180 0 279.5 -114.5 t99.5 -334.5zM682 1341q-150 0 -241 -113t-91 -290q0 -124 54.5 -190t162.5 -66q76 0 140 28.5t108.5 81.5t65 114t20.5 151q0 131 -59 207.5t-160 76.5z" />
+<glyph unicode=":" horiz-adv-x="518" d="M43 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77zM203 956q0 77 40 122.5t111 45.5q97 0 97 -104q0 -73 -41.5 -119.5t-106.5 -46.5q-46 0 -73 26.5t-27 75.5z" />
+<glyph unicode=";" horiz-adv-x="518" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187zM203 956q0 77 40 122.5t111 45.5q97 0 97 -104q0 -73 -41.5 -119.5t-106.5 -46.5q-46 0 -73 26.5t-27 75.5z" />
+<glyph unicode="&#x3c;" d="M1040 242l-919 422v98l919 479v-149l-747 -371l747 -328v-151z" />
+<glyph unicode="=" d="M127 858v139h920v-139h-920zM127 444v142h920v-142h-920z" />
+<glyph unicode="&#x3e;" d="M121 393l745 328l-745 371v149l919 -479v-98l-919 -422v151z" />
+<glyph unicode="?" horiz-adv-x="874" d="M260 403q22 130 72.5 213.5t165.5 174.5q128 100 168 144t63 94t23 112q0 93 -51.5 143.5t-147.5 50.5q-81 0 -155 -25.5t-140 -56.5l-61 129q92 51 192 76t182 25q167 0 259 -84t92 -238q0 -123 -65.5 -226.5t-225.5 -223.5q-125 -91 -169 -147.5t-67 -160.5h-135z M158 74q0 77 40 122.5t111 45.5q44 0 70.5 -26t26.5 -79q0 -73 -41.5 -119.5t-106.5 -46.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="@" horiz-adv-x="1735" d="M1679 852q0 -179 -55 -324t-155 -227t-222 -82q-197 0 -213 184h-8q-111 -184 -291 -184q-115 0 -180.5 75.5t-65.5 209.5q0 157 68 284t188.5 199t260.5 72q65 0 127.5 -12t150.5 -48q-64 -242 -98 -368t-31 -172q0 -117 102 -117q78 0 141.5 67t100.5 183.5t37 243.5 q0 239 -128 367t-370 128q-228 0 -406.5 -107t-277 -295.5t-98.5 -416.5q0 -270 143.5 -418.5t409.5 -148.5q197 0 420 86v-127q-219 -90 -443 -90q-314 0 -494.5 184.5t-180.5 505.5q0 261 126.5 485.5t343.5 347.5t486 123q191 0 329 -75.5t210.5 -213.5t72.5 -319z M985 938q-94 0 -174 -55t-126 -153t-46 -212q0 -93 33 -134.5t98 -41.5q187 0 272 315l70 258q-63 23 -127 23z" />
+<glyph unicode="A" horiz-adv-x="1137" d="M813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394z" />
+<glyph unicode="B" horiz-adv-x="1225" d="M770 1462q432 0 432 -336q0 -141 -87 -238t-245 -126v-10q115 -32 176.5 -110.5t61.5 -188.5q0 -212 -152 -332.5t-407 -120.5h-463l309 1462h375zM434 836h248q156 0 249 73t93 199q0 104 -66.5 155.5t-209.5 51.5h-211zM287 145h266q181 0 278 80.5t97 227.5 q0 116 -74.5 177.5t-214.5 61.5h-236z" />
+<glyph unicode="C" horiz-adv-x="1198" d="M942 1331q-174 0 -311.5 -97t-218 -284.5t-80.5 -408.5q0 -187 97.5 -298.5t268.5 -111.5q139 0 322 57v-149q-86 -31 -164 -45t-188 -14q-242 0 -380 149.5t-138 407.5q0 261 105.5 485.5t283.5 342.5t403 118q197 0 348 -80l-69 -141q-138 69 -279 69z" />
+<glyph unicode="D" horiz-adv-x="1364" d="M1300 877q0 -261 -105 -461t-300 -308t-457 -108h-352l309 1462h342q276 0 419.5 -149.5t143.5 -435.5zM449 147q202 0 355 91.5t234.5 258.5t81.5 382t-103 325.5t-302 110.5h-178l-250 -1168h162z" />
+<glyph unicode="E" horiz-adv-x="1047" d="M821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565z" />
+<glyph unicode="F" horiz-adv-x="967" d="M258 0h-172l309 1462h735l-30 -153h-568l-110 -533h528l-32 -153h-529z" />
+<glyph unicode="G" horiz-adv-x="1386" d="M821 766h459l-154 -711q-216 -75 -419 -75q-264 0 -410.5 144.5t-146.5 403.5q0 269 101.5 489.5t281.5 343t399 122.5q117 0 219.5 -20t206.5 -64l-66 -152q-77 34 -165.5 59t-194.5 25q-169 0 -307.5 -101.5t-215.5 -283.5t-77 -407q0 -190 102.5 -299t286.5 -109 q154 0 260 39l96 444h-289z" />
+<glyph unicode="H" horiz-adv-x="1389" d="M1085 0h-167l143 688h-660l-145 -688h-170l309 1462h170l-131 -622h660l133 622h168z" />
+<glyph unicode="I" horiz-adv-x="559" d="M86 0l311 1462h168l-311 -1462h-168z" />
+<glyph unicode="J" horiz-adv-x="547" d="M-166 -385q-105 0 -153 25l6 147q69 -20 145 -20q100 0 165.5 62.5t90.5 182.5l307 1450h170l-309 -1468q-79 -379 -422 -379z" />
+<glyph unicode="K" horiz-adv-x="1141" d="M1034 0h-186q-72 181 -146.5 359.5t-146.5 361.5l-174 -131l-125 -590h-170l309 1462h170l-151 -710l700 710h209l-639 -637z" />
+<glyph unicode="L" horiz-adv-x="971" d="M86 0l309 1462h170l-276 -1308h565l-33 -154h-735z" />
+<glyph unicode="M" horiz-adv-x="1714" d="M676 0l-166 1296h-8q-7 -72 -28.5 -197.5t-37.5 -199.5l-190 -899h-162l309 1462h244l149 -1204h9l659 1204h266l-303 -1462h-174q126 590 193 905.5t94 392.5h-6l-717 -1298h-131z" />
+<glyph unicode="N" horiz-adv-x="1438" d="M1139 0h-181l-460 1223h-6q-32 -221 -74 -418l-172 -805h-162l309 1462h180l459 -1220h6q30 224 72 405l174 815h164z" />
+<glyph unicode="O" horiz-adv-x="1475" d="M1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5t70 403 q0 199 -94 310.5t-261 111.5z" />
+<glyph unicode="P" horiz-adv-x="1159" d="M1159 1085q0 -248 -164 -379t-481 -131h-135l-123 -575h-170l309 1462h330q214 0 324 -94.5t110 -282.5zM410 721h133q216 0 328 91t112 267q0 125 -69.5 180.5t-213.5 55.5h-163z" />
+<glyph unicode="Q" horiz-adv-x="1475" d="M874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q158 0 279 100t187.5 280.5t66.5 399.5q0 199 -94 310.5t-261 111.5zM725 -18l-17 -2h-16q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424 q0 -333 -139 -576t-375 -321l274 -358h-219z" />
+<glyph unicode="R" horiz-adv-x="1165" d="M385 608l-129 -608h-170l309 1462h320q446 0 446 -366q0 -348 -368 -449l239 -647h-186l-209 608h-252zM532 1313q-102 -494 -116 -559h168q193 0 297 85t104 244q0 121 -67.5 175.5t-219.5 54.5h-166z" />
+<glyph unicode="S" horiz-adv-x="1028" d="M913 424q0 -211 -140.5 -327.5t-395.5 -116.5q-106 0 -186.5 14.5t-151.5 48.5v170q162 -84 340 -84q162 0 257 75.5t95 207.5q0 78 -52.5 137.5t-195.5 140.5q-151 85 -209.5 170t-58.5 201q0 187 132 304.5t347 117.5q99 0 184.5 -19t180.5 -65l-66 -150 q-66 38 -148 60t-151 22q-134 0 -215.5 -69.5t-81.5 -188.5q0 -54 17 -92.5t54 -72.5t142 -95q147 -88 198.5 -138t78 -110.5t26.5 -140.5z" />
+<glyph unicode="T" horiz-adv-x="1020" d="M487 0h-172l277 1311h-406l33 151h985l-30 -151h-408z" />
+<glyph unicode="U" horiz-adv-x="1384" d="M1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170z" />
+<glyph unicode="V" horiz-adv-x="1122" d="M479 197q61 144 162 338l479 927h191l-781 -1462h-180l-162 1462h170l97 -930q20 -196 20 -335h4z" />
+<glyph unicode="W" horiz-adv-x="1745" d="M1257 0h-170l-49 965q-8 136 -8 282h-6q-25 -72 -61 -154.5t-504 -1092.5h-174l-62 1462h170l31 -901l2 -88q0 -98 -10 -258h6q89 243 156 383l405 864h178l43 -860q9 -153 9 -304l-1 -83h9q75 224 131 354l387 893h182z" />
+<glyph unicode="X" horiz-adv-x="1063" d="M956 0h-180l-213 641l-481 -641h-186l596 776l-263 686h172l203 -563l443 563h186l-555 -694z" />
+<glyph unicode="Y" horiz-adv-x="1030" d="M537 715l489 747h193l-627 -921l-113 -541h-172l119 549l-238 913h170z" />
+<glyph unicode="Z" horiz-adv-x="1087" d="M885 0h-901l28 137l924 1170h-655l32 155h858l-26 -139l-924 -1169h697z" />
+<glyph unicode="[" horiz-adv-x="586" d="M371 -324h-387l381 1786h387l-31 -141h-227l-318 -1503h227z" />
+<glyph unicode="\" horiz-adv-x="717" d="M375 1462l217 -1462h-154l-217 1462h154z" />
+<glyph unicode="]" horiz-adv-x="586" d="M-119 -182h225l320 1503h-227l30 141h389l-380 -1786h-388z" />
+<glyph unicode="^" horiz-adv-x="1059" d="M53 553l598 920h109l266 -920h-145l-201 747l-467 -747h-160z" />
+<glyph unicode="_" horiz-adv-x="807" d="M623 -324h-811l30 140h811z" />
+<glyph unicode="`" horiz-adv-x="1135" d="M903 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="a" horiz-adv-x="1157" d="M639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233t-51 -310 q0 -114 47 -170.5t132 -56.5z" />
+<glyph unicode="b" horiz-adv-x="1182" d="M545 -20q-97 0 -170.5 51t-110.5 139h-10l-70 -170h-125l330 1556h168q-51 -242 -78.5 -370.5t-75.5 -300.5h9q93 118 183.5 173.5t186.5 55.5q141 0 220 -99t79 -272q0 -209 -68.5 -386.5t-191 -277t-276.5 -99.5zM731 975q-96 0 -195.5 -95t-158 -239t-58.5 -295 q0 -110 55.5 -168.5t160.5 -58.5q99 0 184.5 81t137.5 230.5t52 317.5q0 227 -178 227z" />
+<glyph unicode="c" horiz-adv-x="922" d="M506 -20q-194 0 -301 107t-107 302q0 200 74 369t204.5 263.5t293.5 94.5q137 0 268 -51l-47 -141q-120 51 -219 51q-112 0 -204.5 -76.5t-145 -213t-52.5 -296.5q0 -128 66.5 -199t183.5 -71q72 0 136 20t126 47v-143q-124 -63 -276 -63z" />
+<glyph unicode="d" horiz-adv-x="1182" d="M639 1114q194 0 281 -190h10q17 155 45 274l78 358h166l-330 -1556h-139l22 209h-8q-101 -125 -189 -177t-182 -52q-139 0 -217 98t-78 272q0 214 72 392t194.5 275t274.5 97zM449 119q94 0 194 93.5t158.5 239t58.5 296.5q0 111 -54 169t-157 58q-101 0 -187.5 -82.5 t-139 -232t-52.5 -314.5q0 -227 179 -227z" />
+<glyph unicode="e" horiz-adv-x="1010" d="M492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35z" />
+<glyph unicode="f" horiz-adv-x="641" d="M-104 -492q-69 0 -125 21v141q64 -22 112 -22q76 0 117 62t66 177l227 1082h-193l13 67l206 66l23 100q46 200 127.5 282.5t241.5 82.5q40 0 98 -11.5t90 -25.5l-43 -129q-76 29 -137 29q-87 0 -133.5 -48.5t-75.5 -177.5l-25 -108h238l-25 -127h-237l-232 -1098 q-39 -189 -120 -276t-213 -87z" />
+<glyph unicode="g" horiz-adv-x="1026" d="M1100 1096l-25 -107l-211 -24q41 -62 41 -158q0 -191 -116.5 -304.5t-311.5 -113.5q-55 0 -84 8q-139 -53 -139 -131q0 -41 33 -54.5t96 -21.5l117 -14q181 -22 262.5 -88t81.5 -194q0 -184 -146 -285t-411 -101q-194 0 -304 73.5t-110 207.5q0 105 72 182t233 131 q-78 41 -78 121q0 69 51 118.5t142 92.5q-63 32 -103 94.5t-40 145.5q0 194 119.5 318t305.5 124q78 0 154 -20h371zM35 -195q0 -77 65 -122t193 -45q182 0 284.5 63.5t102.5 179.5q0 62 -54 98t-184 50l-159 16q-120 -25 -184 -88t-64 -152zM313 680q0 -85 45 -129.5 t125 -44.5q79 0 138 42t90.5 115.5t31.5 159.5q0 82 -44 125t-126 43q-78 0 -136.5 -40.5t-91 -113t-32.5 -157.5z" />
+<glyph unicode="h" horiz-adv-x="1182" d="M729 0l148 692q18 94 18 135q0 148 -147 148q-89 0 -173.5 -59t-149 -171.5t-97.5 -271.5l-101 -473h-168l330 1556h168q-18 -82 -34.5 -159t-34 -156.5t-38 -166.5t-47.5 -189h11q94 123 185.5 176t191.5 53q131 0 202.5 -72t71.5 -204q0 -62 -23 -166 q-39 -193 -145 -672h-168z" />
+<glyph unicode="i" horiz-adv-x="520" d="M227 0h-168l234 1096h168zM340 1376q0 56 32 91.5t83 35.5q88 0 88 -90q0 -55 -33.5 -93t-77.5 -38q-40 0 -66 24.5t-26 69.5z" />
+<glyph unicode="j" horiz-adv-x="520" d="M-135 -492q-69 0 -123 21v141q61 -22 119 -22q125 0 168 205l264 1243h166l-266 -1258q-36 -171 -114.5 -250.5t-213.5 -79.5zM340 1376q0 56 32 91.5t83 35.5q86 0 86 -90q0 -55 -33.5 -93t-77.5 -38q-38 0 -64 24.5t-26 69.5z" />
+<glyph unicode="k" horiz-adv-x="999" d="M330 559l526 537h201l-469 -467l295 -629h-187l-235 524l-152 -123l-82 -401h-170l330 1556h170l-129 -602t-102 -395h4z" />
+<glyph unicode="l" horiz-adv-x="520" d="M225 0h-168l332 1556h168z" />
+<glyph unicode="m" horiz-adv-x="1786" d="M696 0l148 692q18 94 18 135q0 70 -31 109t-106 39q-84 0 -163.5 -60t-140 -171.5t-93.5 -268.5l-101 -475h-168l234 1096h139l-22 -203h10q87 119 173.5 171t178.5 52q113 0 174 -65t72 -181h8q86 125 183 185.5t196 60.5q127 0 196.5 -68t69.5 -198q0 -68 -22 -178 l-144 -672h-170l148 692q20 104 20 146q0 62 -34.5 99.5t-108.5 37.5q-81 0 -160 -58t-138.5 -164.5t-90.5 -252.5l-107 -500h-168z" />
+<glyph unicode="n" horiz-adv-x="1182" d="M729 0l148 692q20 104 20 144q0 63 -35.5 101t-113.5 38q-89 0 -173.5 -60t-149 -171t-97.5 -269l-101 -475h-168l234 1096h139l-22 -203h10q96 122 185.5 172.5t185.5 50.5q127 0 200.5 -69.5t73.5 -194.5q0 -79 -23 -180l-143 -672h-170z" />
+<glyph unicode="o" horiz-adv-x="1149" d="M643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5z" />
+<glyph unicode="p" horiz-adv-x="1182" d="M545 -20q-97 0 -170 50t-113 140h-10l-4 -38q-3 -25 -10.5 -70t-114.5 -554h-166l336 1588h139l-26 -209h8q179 227 372 227q137 0 216 -97.5t79 -273.5q0 -212 -69 -389t-191 -275.5t-276 -98.5zM731 975q-96 0 -195.5 -95t-158 -239t-58.5 -295q0 -110 55.5 -168.5 t160.5 -58.5q99 0 184.5 81t137.5 230.5t52 317.5q0 227 -178 227z" />
+<glyph unicode="q" horiz-adv-x="1182" d="M641 1116q94 0 165.5 -50.5t108.5 -141.5h13l67 172h125l-336 -1588h-166l101 480q9 45 57 221h-8q-95 -121 -185 -175t-186 -54q-140 0 -219.5 97.5t-79.5 272.5q0 212 72.5 392t196 277t274.5 97zM449 119q92 0 190 92t158.5 237t60.5 300q0 105 -54.5 166t-152.5 61 q-101 0 -189 -84.5t-140 -233t-52 -311.5q0 -227 179 -227z" />
+<glyph unicode="r" horiz-adv-x="811" d="M752 1116q69 0 120 -14l-36 -150q-53 13 -105 13q-91 0 -170.5 -60t-139 -166.5t-87.5 -236.5l-107 -502h-168l234 1096h139l-22 -203h10q72 95 119 136.5t98.5 64t114.5 22.5z" />
+<glyph unicode="s" horiz-adv-x="877" d="M735 311q0 -156 -110.5 -243.5t-311.5 -87.5q-169 0 -305 69v158q70 -42 151 -65t150 -23q126 0 190 50t64 128q0 57 -35 96t-151 107q-130 73 -184 143t-54 166q0 138 101 222.5t266 84.5q171 0 330 -74l-54 -137l-56 25q-101 43 -220 43q-93 0 -146 -43.5t-53 -112.5 q0 -56 35.5 -96t146.5 -103q107 -60 153.5 -103t69.5 -92.5t23 -111.5z" />
+<glyph unicode="t" horiz-adv-x="664" d="M395 117q55 0 144 26v-129q-34 -14 -84 -24t-80 -10q-125 0 -191.5 59.5t-66.5 177.5q0 66 18 150l127 602h-172l14 73l185 78l125 228h98l-55 -252h274l-26 -127h-273l-129 -604q-18 -87 -18 -132q0 -56 29 -86t81 -30z" />
+<glyph unicode="u" horiz-adv-x="1182" d="M451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170z" />
+<glyph unicode="v" horiz-adv-x="946" d="M223 0l-125 1096h168l64 -613q24 -258 24 -362h6q127 275 179 371l325 604h178l-591 -1096h-228z" />
+<glyph unicode="w" horiz-adv-x="1468" d="M831 0l-32 602q-4 94 -4 172v156h-9l-50 -118l-83 -189l-291 -623h-202l-43 1096h164l18 -594v-88q0 -147 -8 -269h6q47 124 137 322l295 629h182l37 -594q6 -168 6 -262v-53l-2 -42h6q28 86 83 218.5t323 732.5h178l-506 -1096h-205z" />
+<glyph unicode="x" horiz-adv-x="979" d="M467 434l-346 -434h-195l475 565l-239 531h170l174 -412l330 412h194l-455 -539l252 -557h-168z" />
+<glyph unicode="y" horiz-adv-x="946" d="M98 1096h168l74 -545q10 -69 19.5 -203.5t9.5 -216.5h6q35 87 87 200t77 156l325 609h178l-696 -1282q-93 -172 -184 -239t-219 -67q-72 0 -140 21v135q63 -18 131 -18q82 0 140.5 50.5t113.5 149.5l76 136z" />
+<glyph unicode="z" horiz-adv-x="909" d="M690 0h-719l23 117l694 854h-479l27 125h657l-29 -140l-680 -831h531z" />
+<glyph unicode="{" horiz-adv-x="715" d="M442 -324q-141 0 -216.5 52.5t-75.5 171.5q0 52 20 141q33 146 51.5 227.5t14.5 102.5q0 143 -209 143l32 143q118 0 189.5 43.5t93.5 147.5l68 326q34 160 117.5 224t254.5 64h33l-31 -141q-105 0 -151 -36.5t-66 -123.5l-71 -321q-28 -123 -91 -184t-167 -78v-5 q151 -41 151 -213q0 -59 -18 -131l-47 -211q-15 -58 -15 -98q0 -53 36.5 -77.5t119.5 -24.5v-142h-23z" />
+<glyph unicode="|" d="M541 1556h139v-2052h-139v2052z" />
+<glyph unicode="}" horiz-adv-x="715" d="M285 1462q144 0 220.5 -52.5t76.5 -170.5q0 -48 -21 -141l-49 -219q-16 -68 -16 -111q0 -143 209 -143l-33 -144q-119 0 -190 -43t-93 -147l-67 -326q-36 -164 -119 -226.5t-264 -62.5h-13v142q115 0 167 36t71 123l72 322q25 117 88 179.5t170 80.5v6q-150 42 -150 211 q0 59 18 131l50 213q14 65 14 99q0 53 -40.5 77.5t-139.5 24.5l28 141h11z" />
+<glyph unicode="~" d="M348 713q-54 0 -118.5 -34.5t-114.5 -86.5v151q98 109 243 109q69 0 127 -14.5t144 -51.5q64 -27 112.5 -41t98.5 -14q55 0 119.5 33t115.5 88v-150q-100 -110 -244 -110q-72 0 -135 16.5t-135 48.5q-75 32 -120 44t-93 12z" />
+<glyph unicode="&#xa1;" horiz-adv-x="530" d="M260 684h109l-176 -1057h-207zM250 950q0 76 40.5 122t110.5 46q44 0 70.5 -26t26.5 -80q0 -71 -40.5 -117.5t-105.5 -46.5q-48 0 -75 25.5t-27 76.5z" />
+<glyph unicode="&#xa2;" d="M582 -20h-125l43 215q-132 34 -203.5 137.5t-71.5 257.5q0 185 63.5 344t178.5 258.5t260 120.5l35 170h123l-37 -168q119 -9 217 -49l-47 -142q-109 52 -219 52q-112 0 -204.5 -76.5t-145 -213t-52.5 -296.5q0 -125 66 -198t184 -73q72 0 136 20t126 48v-143 q-123 -62 -286 -66z" />
+<glyph unicode="&#xa3;" d="M842 1481q184 0 336 -86l-66 -133q-146 79 -278 79q-213 0 -263 -237l-69 -326h370l-26 -127h-371l-47 -219q-22 -98 -66 -166.5t-124 -111.5h725l-33 -154h-953l27 141q205 46 258 289l47 221h-200l26 127h201l76 350q75 353 430 353z" />
+<glyph unicode="&#xa4;" d="M229 723q0 117 68 215l-129 129l92 92l127 -129q103 70 217 70t215 -70l129 129l92 -90l-129 -129q70 -104 70 -217q0 -119 -70 -217l127 -127l-90 -90l-129 127q-98 -68 -215 -68q-119 0 -217 70l-127 -127l-90 90l127 127q-68 96 -68 215zM358 723q0 -103 71.5 -174.5 t174.5 -71.5q104 0 177 71.5t73 174.5q0 104 -73 177t-177 73q-102 0 -174 -72.5t-72 -177.5z" />
+<glyph unicode="&#xa5;" d="M582 715l491 747h187l-533 -770h231l-28 -133h-297l-33 -160h297l-29 -133h-295l-57 -266h-154l56 266h-291l29 133h290l33 160h-291l29 133h225l-202 770h163z" />
+<glyph unicode="&#xa6;" d="M541 1556h139v-776h-139v776zM541 281h139v-777h-139v777z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M174 770q0 201 238 307q-119 70 -119 203q0 127 103.5 206t279.5 79q189 0 321 -68l-53 -123q-148 60 -266 60q-102 0 -162.5 -40.5t-60.5 -109.5q0 -49 38 -83.5t162 -90.5q100 -44 149 -83.5t75 -89.5t26 -114q0 -97 -61 -180t-172 -139q114 -71 114 -189 q0 -152 -114 -237.5t-318 -85.5q-176 0 -295 61v148q56 -34 136.5 -56t156.5 -22q133 0 204 44.5t71 129.5q0 48 -50.5 89t-152.5 87q-138 61 -194 130.5t-56 166.5zM514 1010q-82 -26 -135 -87.5t-53 -131.5t50.5 -117t198.5 -111q80 44 127.5 107t47.5 131 q0 60 -49.5 105.5t-186.5 103.5z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1135" d="M457 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM821 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M928 1059q-125 0 -191.5 -87t-66.5 -241q0 -169 65 -249.5t193 -80.5q82 0 211 43v-122q-66 -28 -113 -38t-104 -10q-192 0 -297 119.5t-105 339.5q0 208 110 330.5t300 122.5q130 0 248 -60l-60 -120q-106 53 -190 53zM139 731q0 200 100 375t275 276t377 101 q197 0 370 -97t277 -272t104 -383q0 -204 -100.5 -376.5t-273 -273.5t-377.5 -101q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM244 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5q0 174 -87 323t-235.5 236.5t-324.5 87.5 q-174 0 -323 -87t-236.5 -235.5t-87.5 -324.5z" />
+<glyph unicode="&#xaa;" horiz-adv-x="686" d="M498 1479q114 0 153 -103h6l37 90h86l-139 -665h-92l14 117h-4q-40 -56 -90 -93t-123 -37q-77 0 -126.5 60t-49.5 166q0 127 41.5 234.5t116.5 169t170 61.5zM381 891q61 0 112.5 49t86 137.5t34.5 167.5q0 62 -28.5 96.5t-85.5 34.5q-92 0 -154.5 -103t-62.5 -243 q0 -139 98 -139z" />
+<glyph unicode="&#xab;" horiz-adv-x="958" d="M88 584l391 374l78 -81l-297 -328l172 -387l-113 -49l-231 442v29zM483 541l367 405l86 -69l-283 -365l158 -350l-113 -49l-215 397v31z" />
+<glyph unicode="&#xac;" d="M1047 793v-529h-140v387h-780v142h920z" />
+<glyph unicode="&#xad;" horiz-adv-x="639" d="M55 469zM55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M139 731q0 200 100 375t275 276t377 101q197 0 370 -97t277 -272t104 -383q0 -204 -100.5 -376.5t-273 -273.5t-377.5 -101q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM244 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5 q0 174 -87 323t-235.5 236.5t-324.5 87.5q-174 0 -323 -87t-236.5 -235.5t-87.5 -324.5zM1194 915q0 -78 -47.5 -141t-132.5 -98l227 -385h-149l-207 352h-113v-352h-127v880h229q163 0 241.5 -63t78.5 -193zM772 762h92q195 0 195 149q0 76 -47.5 107t-149.5 31h-90v-287z " />
+<glyph unicode="&#xaf;" horiz-adv-x="782" d="M1012 1556h-785l33 132h787z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M215 1171q0 128 90.5 220t220.5 92q83 0 155.5 -41.5t114.5 -114t42 -156.5q0 -128 -90.5 -218.5t-221.5 -90.5t-221 90.5t-90 218.5zM328 1171q0 -80 58 -138t140 -58q83 0 140 58.5t57 137.5q0 82 -57.5 140.5t-139.5 58.5q-80 0 -139 -58.5t-59 -140.5z" />
+<glyph unicode="&#xb1;" d="M516 643h-389v141h389v392h141v-392h390v-141h-390v-387h-141v387zM127 0v141h920v-141h-920z" />
+<glyph unicode="&#xb2;" horiz-adv-x="717" d="M657 586h-561l23 106l264 228q115 100 158.5 149.5t63.5 93t20 90.5q0 53 -31 85t-90 32q-90 0 -195 -80l-59 90q125 101 274 101q109 0 171.5 -56.5t62.5 -150.5q0 -99 -52.5 -179.5t-197.5 -205.5l-221 -187h395z" />
+<glyph unicode="&#xb3;" horiz-adv-x="717" d="M549 1036q69 -17 108 -68t39 -120q0 -132 -91 -205.5t-253 -73.5q-125 0 -233 56v127q125 -72 239 -72q205 0 205 170q0 137 -178 137h-90l22 107h95q97 0 155 41t58 112q0 60 -34.5 90.5t-93.5 30.5q-102 0 -196 -68l-55 93q109 88 268 88q114 0 178 -56t64 -151 q0 -180 -207 -234v-4z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1135" d="M532 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1194" d="M295 266q0 -147 147 -147q89 0 172 59t148.5 171t99.5 269l105 478h163l-233 -1096h-139l24 205h-12q-93 -121 -183 -173t-188 -52q-112 0 -163 96h-9q-11 -78 -22.5 -148t-83.5 -420h-164l336 1588h168l-148 -695q-18 -92 -18 -135z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1206 -260h-114v1661h-213v-1661h-115v819q-62 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h557v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="518" d="M170 587zM170 690q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M211 -276q0 -98 -81 -157t-214 -59q-41 0 -86 9v100q38 -6 68 -6q174 0 174 110q0 46 -39 67.5t-99 29.5l101 182h106l-61 -121q131 -38 131 -155z" />
+<glyph unicode="&#xb9;" horiz-adv-x="717" d="M537 1462h118l-186 -876h-135l112 526q25 103 58 225q-25 -25 -50 -46.5t-145 -100.5l-51 90z" />
+<glyph unicode="&#xba;" horiz-adv-x="688" d="M745 1219q0 -191 -88.5 -311t-240.5 -120q-113 0 -180.5 71t-67.5 196q0 117 42 215.5t117.5 153.5t174.5 55q117 0 180 -67t63 -193zM500 1376q-102 0 -160.5 -87.5t-58.5 -229.5q0 -85 38 -127.5t107 -42.5q94 0 152.5 88.5t58.5 232.5q0 166 -137 166z" />
+<glyph unicode="&#xbb;" horiz-adv-x="958" d="M872 485l-393 -370l-78 82l297 323l-172 391l113 50l233 -447v-29zM477 528l-368 -401l-86 70l282 360l-158 354l113 50l217 -402v-31z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1518" d="M123 0zM1362 1462l-1086 -1462h-153l1085 1462h154zM483 1462h118l-186 -876h-135l112 526q25 103 58 225q-25 -25 -50 -46.5t-145 -100.5l-51 90zM1327 203h-129l-43 -202h-127l43 202h-365l23 101l481 579h133l-121 -563h127zM1095 320q69 322 90 395 q-20 -36 -110 -149l-205 -246h225z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1518" d="M66 0zM427 1462h118l-186 -876h-135l112 526q25 103 58 225q-25 -25 -50 -46.5t-145 -100.5l-51 90zM1305 1462l-1086 -1462h-153l1085 1462h154zM1343 1h-561l23 106l264 228q115 100 158.5 149.5t63.5 93t20 90.5q0 53 -31 85t-90 32q-90 0 -195 -80l-59 90 q125 101 274 101q109 0 171.5 -56.5t62.5 -150.5q0 -99 -52.5 -179.5t-197.5 -205.5l-221 -187h395z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1565" d="M87 0zM517 1036q69 -17 108 -68t39 -120q0 -132 -91 -205.5t-253 -73.5q-125 0 -233 56v127q125 -72 239 -72q205 0 205 170q0 137 -178 137h-90l22 107h95q97 0 155 41t58 112q0 60 -34.5 90.5t-93.5 30.5q-102 0 -196 -68l-55 93q109 88 268 88q114 0 178 -56t64 -151 q0 -180 -207 -234v-4zM1512 1462l-1086 -1462h-153l1085 1462h154zM1477 203h-129l-43 -202h-127l43 202h-365l23 101l481 579h133l-121 -563h127zM1245 320q69 322 90 395q-20 -36 -110 -149l-205 -246h225z" />
+<glyph unicode="&#xbf;" horiz-adv-x="874" d="M657 680q-22 -130 -72 -212t-165 -175l-95 -75q-159 -127 -159 -275q0 -93 51.5 -144t147.5 -51q80 0 154 25.5t140 56.5l62 -129q-90 -48 -189 -74t-186 -26q-168 0 -259 83.5t-91 237.5q0 124 66 228t225 223q132 98 172.5 152.5t62.5 154.5h135zM760 1010 q0 -77 -40.5 -122.5t-111.5 -45.5q-43 0 -69.5 26t-26.5 78q0 71 40 118.5t107 47.5q47 0 74 -25.5t27 -76.5z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM863 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM679 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM1080 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27 z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM934 1581q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18 t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM523 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM887 1716q0 46 28 79.5 t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1137" d="M0 0zM813 465h-496l-245 -465h-189l799 1462h174l184 -1462h-170zM795 621l-35 299q-24 179 -29 350q-37 -88 -80.5 -175t-249.5 -474h394zM991 1585q0 -99 -60 -157t-159 -58q-101 0 -160 57.5t-59 155.5q0 94 62 152.5t157 58.5q101 0 160 -57t59 -152zM887 1583 q0 53 -32 84t-83 31q-49 0 -82 -31t-33 -84q0 -54 29.5 -84.5t85.5 -30.5q51 0 83 30.5t32 84.5z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1673" d="M1448 0h-737l98 465h-438l-293 -465h-197l938 1462h938l-33 -153h-565l-100 -469h528l-28 -150h-529l-115 -538h566zM840 621l147 688h-84l-434 -688h371z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1198" d="M150 0zM942 1331q-174 0 -311.5 -97t-218 -284.5t-80.5 -408.5q0 -187 97.5 -298.5t268.5 -111.5q139 0 322 57v-149q-86 -31 -164 -45t-188 -14q-242 0 -380 149.5t-138 407.5q0 261 105.5 485.5t283.5 342.5t403 118q197 0 348 -80l-69 -141q-138 69 -279 69zM758 -276 q0 -98 -81 -157t-214 -59q-41 0 -86 9v100q38 -6 68 -6q174 0 174 110q0 46 -39 67.5t-99 29.5l101 182h106l-61 -121q131 -38 131 -155z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM898 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM657 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xca;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM1084 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1047" d="M86 0zM821 0h-735l309 1462h735l-32 -153h-566l-98 -469h527l-29 -152h-529l-114 -536h565zM523 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM887 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34 q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xcc;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM593 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM412 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xce;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM808 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xcf;" horiz-adv-x="559" d="M86 0zM86 0l311 1462h168l-311 -1462h-168zM265 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM629 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1364" d="M1300 877q0 -261 -105 -461t-300 -308t-457 -108h-352l135 649h-149l32 150h150l141 663h342q276 0 419.5 -149.5t143.5 -435.5zM449 147q202 0 355 91.5t234.5 258.5t81.5 382t-103 325.5t-302 110.5h-178l-111 -516h330l-33 -150h-330l-106 -502h162z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1438" d="M84 0zM1139 0h-181l-460 1223h-6q-32 -221 -74 -418l-172 -805h-162l309 1462h180l459 -1220h6q30 224 72 405l174 815h164zM1102 1581q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5 t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM1007 1579h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM821 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM1227 1579h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM1067 1581q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1475" d="M150 0zM1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q244 0 384 -154t140 -424zM874 1333q-157 0 -281 -101t-192.5 -281t-68.5 -398q0 -199 98 -310.5t266 -111.5q152 0 272.5 97.5t190.5 279.5 t70 403q0 199 -94 310.5t-261 111.5zM664 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM1028 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xd7;" d="M487 723l-319 321l98 99l320 -320l323 320l99 -96l-324 -324l322 -322l-97 -96l-323 320l-320 -318l-96 96z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1475" d="M1411 907q0 -269 -88 -481.5t-252 -329t-379 -116.5q-200 0 -332 96l-129 -160l-112 92l137 170q-106 136 -106 371q0 264 96 482t263.5 336t377.5 118q99 0 178.5 -27t151.5 -84l131 166l114 -92l-149 -184q48 -62 73 -156t25 -201zM874 1333q-157 0 -281 -101 t-192.5 -281t-68.5 -398q0 -135 41 -227l737 919q-90 88 -236 88zM1229 911q0 118 -33 205l-733 -911q91 -74 233 -74q152 0 272.5 97.5t190.5 279.5t70 403z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM991 1579h-104q-61 61 -128.5 154 t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM823 1606q56 60 125.5 151.5t106.5 149.5 h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM1217 1579h-103q-57 48 -161 189 q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1384" d="M164 0zM1407 1462l-205 -966q-55 -263 -197.5 -389.5t-388.5 -126.5q-230 0 -341 104t-111 299q0 81 24 201l189 878h170l-191 -891q-22 -106 -22 -188q0 -117 73 -184.5t218 -67.5q172 0 267.5 87.5t139.5 289.5l205 954h170zM643 1716q0 46 28 79.5t74 33.5 q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM1007 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1030" d="M188 0zM537 715l489 747h193l-627 -921l-113 -541h-172l119 549l-238 913h170zM616 1606q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xde;" horiz-adv-x="1159" d="M1106 829q0 -248 -164 -379t-483 -131h-133l-70 -319h-170l309 1462h170l-53 -256h160q213 0 323.5 -95t110.5 -282zM354 465h135q215 0 328 91t113 267q0 126 -70 181t-215 55h-166z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1182" d="M-133 -492q-69 0 -123 21v143q61 -22 111 -22q65 0 107 47.5t65 157.5l280 1314q43 200 156 299t307 99q162 0 252 -71t90 -196q0 -57 -21 -106.5t-61.5 -95t-178.5 -150.5q-110 -83 -110 -151q0 -56 95 -122q47 -34 101 -87.5t79.5 -110t25.5 -123.5 q0 -175 -108.5 -274.5t-292.5 -99.5q-175 0 -268 71v160q51 -41 118.5 -66.5t129.5 -25.5q113 0 181 58t68 159q0 40 -10.5 71t-33.5 59t-89 83q-88 69 -122.5 124t-34.5 115q0 53 18.5 96t49.5 78.5t124 104.5q80 56 111 87.5t48 65t17 70.5q0 64 -52.5 100.5t-141.5 36.5 q-119 0 -186 -62.5t-95 -190.5l-274 -1303q-40 -189 -121 -276t-211 -87z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM824 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM600 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM1005 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM856 1243q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM454 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM818 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1157" d="M98 0zM639 1116q92 0 164 -49.5t112 -142.5h11l67 172h127l-233 -1096h-133l26 209h-8q-179 -229 -377 -229q-139 0 -218 99t-79 271q0 208 71 386t196 279t274 101zM449 119q97 0 193 92.5t156 241t60 297.5q0 103 -56 164t-147 61q-104 0 -193.5 -86t-140.5 -233 t-51 -310q0 -114 47 -170.5t132 -56.5zM951 1456q0 -99 -60 -157t-159 -58q-101 0 -160 57.5t-59 155.5q0 94 62 152.5t157 58.5q101 0 160 -57t59 -152zM847 1454q0 53 -32 84t-83 31q-49 0 -82 -31t-33 -84q0 -54 29.5 -84.5t85.5 -30.5q51 0 83 30.5t32 84.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1669" d="M1165 -20q-108 0 -189.5 39.5t-121.5 119.5l-31 -139h-114l26 209h-8q-109 -132 -191.5 -180.5t-177.5 -48.5q-122 0 -191 99t-69 269q0 206 70.5 385t191.5 281t263 102q82 0 145 -48.5t102 -143.5h11l67 172h109l-31 -146q123 166 332 166q119 0 192.5 -68t73.5 -184 q0 -182 -166.5 -283.5t-472.5 -101.5h-39l-4 -80q0 -131 62.5 -204.5t193.5 -73.5q55 0 116.5 16.5t178.5 67.5v-150q-164 -75 -328 -75zM412 119q95 0 188.5 91.5t153 240.5t59.5 299q0 103 -45.5 164t-122.5 61q-99 0 -187 -86.5t-138 -231.5t-50 -309q0 -114 37 -171.5 t105 -57.5zM1325 973q-117 0 -211 -94.5t-141 -260.5h14q226 0 348.5 58.5t122.5 169.5q0 61 -35 94t-98 33z" />
+<glyph unicode="&#xe7;" horiz-adv-x="922" d="M98 0zM506 -20q-194 0 -301 107t-107 302q0 200 74 369t204.5 263.5t293.5 94.5q137 0 268 -51l-47 -141q-120 51 -219 51q-112 0 -204.5 -76.5t-145 -213t-52.5 -296.5q0 -128 66.5 -199t183.5 -71q72 0 136 20t126 47v-143q-124 -63 -276 -63zM592 -276q0 -98 -81 -157 t-214 -59q-41 0 -86 9v100q38 -6 68 -6q174 0 174 110q0 46 -39 67.5t-99 29.5l101 182h106l-61 -121q131 -38 131 -155z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM777 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM585 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xea;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM966 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1010" d="M98 0zM492 -20q-184 0 -289 109t-105 302q0 188 74.5 360.5t197.5 268.5t271 96q153 0 230 -66.5t77 -185.5q0 -180 -166 -282.5t-475 -102.5h-33l-4 -80q0 -131 61.5 -204.5t190.5 -73.5q63 0 129.5 18t165.5 66v-146q-94 -44 -166 -61.5t-159 -17.5zM631 973 q-103 0 -193.5 -94t-138.5 -261h12q228 0 349.5 59.5t121.5 172.5q0 53 -36.5 88t-114.5 35zM413 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM777 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34 q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xec;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM492 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM324 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xee;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM708 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xef;" horiz-adv-x="520" d="M59 0zM227 0h-168l234 1096h168zM161 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM525 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1165" d="M676 1343q-66 58 -146 113l95 117q118 -84 188 -154l260 146l64 -105l-240 -133q87 -115 126.5 -240.5t39.5 -269.5q0 -253 -71.5 -447t-203 -292t-311.5 -98q-182 0 -284.5 104t-102.5 289q0 160 67.5 298t187 217t267.5 79q105 0 181.5 -45.5t111.5 -124.5l6 2v17 q0 136 -36.5 240t-110.5 197l-270 -149l-56 108zM487 121q107 0 190 56t134 168t51 226q0 118 -65.5 187t-178.5 69q-109 0 -189 -57.5t-123.5 -161t-43.5 -231.5q0 -126 57.5 -191t167.5 -65z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1182" d="M59 0zM729 0l148 692q20 104 20 144q0 63 -35.5 101t-113.5 38q-89 0 -173.5 -60t-149 -171t-97.5 -269l-101 -475h-168l234 1096h139l-22 -203h10q96 122 185.5 172.5t185.5 50.5q127 0 200.5 -69.5t73.5 -194.5q0 -79 -23 -180l-143 -672h-170zM871 1243 q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM798 1241h-104q-61 61 -128.5 154t-95.5 153v21h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM589 1268q56 60 125.5 151.5t106.5 149.5h190v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM997 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM844 1243q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1149" d="M98 0zM643 1110q190 0 300 -112.5t110 -309.5q0 -188 -72 -355t-195 -258t-278 -91q-192 0 -301 113t-109 309q0 190 73 357.5t197 257t275 89.5zM879 711q0 115 -62.5 186.5t-169.5 71.5q-109 0 -195.5 -74t-134 -205.5t-47.5 -292.5q0 -131 63.5 -202.5t182.5 -71.5 q104 0 187 73t129.5 207.5t46.5 307.5zM433 1378q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM797 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xf7;" d="M127 651v142h920v-142h-920zM475 373q0 121 111 121q53 0 82.5 -30.5t29.5 -90.5q0 -58 -30 -89.5t-82 -31.5t-81.5 31t-29.5 90zM475 1071q0 121 111 121q53 0 82.5 -30.5t29.5 -90.5q0 -58 -30 -89.5t-82 -31.5t-81.5 31t-29.5 90z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1149" d="M1047 705q0 -189 -69.5 -360t-191.5 -266t-276 -95q-146 0 -246 65l-98 -125l-105 82l109 135q-68 103 -68 265q0 194 73.5 361t195.5 255t272 88q146 0 252 -68l104 129l105 -79l-119 -129q62 -97 62 -258zM647 971q-108 0 -195.5 -73t-137.5 -202t-50 -280 q0 -92 17 -137l518 645q-54 47 -152 47zM885 688q0 84 -13 119l-514 -641q57 -45 158 -45q103 0 188.5 71.5t133 200.5t47.5 295z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM800 1241h-104q-61 61 -128.5 154t-95.5 153v21 h181q43 -136 147 -303v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM636 1268q56 60 125.5 151.5t106.5 149.5h190 v-21q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM1024 1241h-103q-57 48 -161 189 q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1182" d="M113 0zM451 1096l-150 -695q-18 -89 -18 -139q0 -143 147 -143q88 0 173 60t150 172t99 270l100 475h166l-231 -1096h-139l22 203h-12q-98 -125 -187 -174t-184 -49q-128 0 -201 69.5t-73 198.5q0 62 22 172l146 676h170zM457 1378q0 46 28 79.5t74 33.5q78 0 78 -80 q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM821 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#xfd;" horiz-adv-x="946" d="M0 0zM98 1096h168l74 -545q10 -69 19.5 -203.5t9.5 -216.5h6q35 87 87 200t77 156l325 609h178l-696 -1282q-93 -172 -184 -239t-219 -67q-72 0 -140 21v135q63 -18 131 -18q82 0 140.5 50.5t113.5 149.5l76 136zM500 1268q56 60 125.5 151.5t106.5 149.5h190v-21 q-38 -49 -140 -151t-177 -156h-105v27z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1182" d="M545 -20q-98 0 -172 51t-113 139h-10q-8 -104 -25 -176l-102 -486h-166l432 2048h168q-95 -441 -115 -522t-39 -149h9q101 125 189 177t183 52q139 0 218 -97.5t79 -273.5q0 -212 -69 -389t-191 -275.5t-276 -98.5zM731 975q-96 0 -195.5 -95t-158 -239t-58.5 -295 q0 -110 55.5 -168.5t160.5 -58.5q99 0 184.5 81t137.5 230.5t52 317.5q0 227 -178 227z" />
+<glyph unicode="&#xff;" horiz-adv-x="946" d="M0 0zM98 1096h168l74 -545q10 -69 19.5 -203.5t9.5 -216.5h6q35 87 87 200t77 156l325 609h178l-696 -1282q-93 -172 -184 -239t-219 -67q-72 0 -140 21v135q63 -18 131 -18q82 0 140.5 50.5t113.5 149.5l76 136zM335 1378q0 46 28 79.5t74 33.5q78 0 78 -80 q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM699 1378q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62z" />
+<glyph unicode="&#x131;" horiz-adv-x="520" d="M227 0h-168l234 1096h168z" />
+<glyph unicode="&#x152;" horiz-adv-x="1751" d="M1524 0h-674q-78 -20 -158 -20q-256 0 -399 149.5t-143 419.5q0 264 96 482t263.5 336t377.5 118q152 0 237 -23h709l-31 -153h-565l-100 -469h528l-31 -150h-528l-115 -538h565zM696 131q69 0 123 19l246 1161q-76 22 -191 22q-157 0 -281 -101t-192.5 -281t-68.5 -398 q0 -199 98 -310.5t266 -111.5z" />
+<glyph unicode="&#x153;" horiz-adv-x="1769" d="M1251 -20q-270 0 -356 225q-69 -107 -171.5 -164t-225.5 -57q-184 0 -292 114t-108 308q0 193 75 360t201 255.5t281 88.5q270 0 359 -225q75 109 177.5 170t221.5 61q139 0 217 -65.5t78 -186.5q0 -183 -164.5 -284t-468.5 -101h-41l-4 -80q0 -131 61.5 -204.5 t190.5 -73.5q75 0 145 24.5t150 59.5v-150q-162 -75 -326 -75zM649 969q-109 0 -196 -73t-135 -202t-48 -284q0 -141 62 -214t172 -73q177 0 278 160.5t101 427.5q0 124 -59.5 191t-174.5 67zM1413 973q-125 0 -220.5 -94.5t-139.5 -260.5h18q231 0 351 61t120 177 q0 48 -32 82.5t-97 34.5z" />
+<glyph unicode="&#x178;" horiz-adv-x="1030" d="M188 0zM537 715l489 747h193l-627 -921l-113 -541h-172l119 549l-238 913h170zM452 1716q0 46 28 79.5t74 33.5q78 0 78 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22t-23.5 62zM816 1716q0 46 28 79.5t75 33.5q77 0 77 -80q0 -49 -29.5 -83t-68.5 -34q-35 0 -58.5 22 t-23.5 62z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1135" d="M1014 1241h-103q-57 48 -161 189q-134 -119 -242 -189h-109v27q145 133 204.5 197.5t82.5 103.5h158q37 -99 128 -235l42 -66v-27z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M989 1456q0 -99 -60 -157t-159 -58q-101 0 -160 57.5t-59 155.5q0 94 62 152.5t157 58.5q101 0 160 -57t59 -152zM885 1454q0 53 -32 84t-83 31q-49 0 -82 -31t-33 -84q0 -54 29.5 -84.5t85.5 -30.5q51 0 83 30.5t32 84.5z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1135" d="M838 1243q-40 0 -77.5 17.5t-73 39t-69 39t-65.5 17.5q-44 0 -69.5 -28.5t-47.5 -86.5h-100q58 258 231 258q44 0 83.5 -18t75 -39.5t66.5 -39.5t58 -18q44 0 69.5 27t51.5 90h100q-66 -258 -233 -258z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#x2011;" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#x2012;" horiz-adv-x="639" d="M55 469l35 158h479l-34 -158h-480z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M55 469l35 160h823l-34 -160h-824z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1966" d="M55 469l35 160h1806l-34 -160h-1807z" />
+<glyph unicode="&#x2018;" horiz-adv-x="348" d="M129 961l-6 22q98 211 270 479h127q-147 -345 -203 -501h-188z" />
+<glyph unicode="&#x2019;" horiz-adv-x="348" d="M516 1462l8 -22q-40 -91 -111 -218.5t-159 -260.5h-129q134 298 203 501h188z" />
+<glyph unicode="&#x201a;" horiz-adv-x="492" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187z" />
+<glyph unicode="&#x201c;" horiz-adv-x="719" d="M500 961l-8 22q80 181 272 479h127q-162 -379 -203 -501h-188zM129 961l-6 22q98 211 270 479h127q-147 -345 -203 -501h-188z" />
+<glyph unicode="&#x201d;" horiz-adv-x="719" d="M516 1462l8 -22q-40 -91 -111 -218.5t-159 -260.5h-129q134 298 203 501h188zM885 1462l10 -22q-94 -206 -274 -479h-127q57 126 115.5 272.5t86.5 228.5h189z" />
+<glyph unicode="&#x201e;" horiz-adv-x="858" d="M291 238l8 -23q-113 -235 -270 -479h-129q126 286 204 502h187zM659 238l9 -23q-95 -205 -271 -479h-129q140 316 203 502h188z" />
+<glyph unicode="&#x2022;" horiz-adv-x="774" d="M199 684q0 145 73.5 231t198.5 86q92 0 139 -49t47 -141q0 -141 -74 -230t-202 -89q-89 0 -135.5 49.5t-46.5 142.5z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1563" d="M43 0zM563 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77zM1085 74q0 77 40.5 122.5t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77zM43 74q0 77 40.5 122.5 t111.5 45.5q43 0 69.5 -26t26.5 -79q0 -71 -40 -118.5t-108 -47.5q-46 0 -73 26t-27 77z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="580" d="M88 578l391 380l78 -81l-297 -334l172 -381l-113 -49l-231 436v29z" />
+<glyph unicode="&#x203a;" horiz-adv-x="580" d="M492 496l-392 -381l-77 82l296 333l-172 381l113 50l232 -437v-28z" />
+<glyph unicode="&#x2044;" horiz-adv-x="268" d="M752 1462l-1086 -1462h-153l1085 1462h154z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="717" d="M713 788h-129l-43 -202h-127l43 202h-365l23 101l481 579h133l-121 -563h127zM481 905q69 322 90 395q-20 -36 -110 -149l-205 -246h225z" />
+<glyph unicode="&#x20ac;" d="M928 1329q-140 0 -254 -99t-189 -298h426l-26 -133h-441q-21 -65 -32 -164h381l-29 -131h-361q0 -373 297 -373q123 0 256 55v-147q-127 -59 -278 -59q-212 0 -328.5 133.5t-116.5 378.5v12h-170l27 131h154q8 80 30 164h-151l27 133h159q97 267 259.5 408t369.5 141 q89 0 160 -21.5t141 -70.5l-80 -138q-113 78 -231 78z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M438 741h-121v617h-196v104h516v-104h-199v-617zM1014 741l-189 551h-6q4 -52 4 -121v-430h-118v721h180l182 -557l193 557h170v-721h-121v430q0 73 4 121h-6l-197 -551h-96z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1095" d="M0 1095h1095v-1095h-1095v1095z" />
+<glyph horiz-adv-x="1182" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff
new file mode 100644 (file)
index 0000000..ff652e6
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Italic-webfont.woff differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot
new file mode 100644 (file)
index 0000000..1486840
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.eot differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.svg b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.svg
new file mode 100644 (file)
index 0000000..11a472c
--- /dev/null
@@ -0,0 +1,1831 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sanslight" horiz-adv-x="1169" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1077" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM895 0h-99v1087h99v-1087zM782 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71 t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1077" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM895 0h-99v1556h99v-1556z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1692" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1200 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5 q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1510 0h-99v1087h99v-1087zM1397 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1692" d="M29 0zM586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1200 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5 q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86zM1510 0h-99v1556h99v-1556z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="492" d="M276 377h-61l-29 1085h119zM164 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="&#x22;" horiz-adv-x="723" d="M260 1462l-33 -528h-61l-33 528h127zM590 1462l-33 -528h-61l-33 528h127z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M967 928l-76 -398h303v-79h-320l-86 -451h-90l88 451h-360l-86 -451h-88l86 451h-283v79h299l76 398h-297v80h311l86 454h91l-89 -454h365l88 454h86l-88 -454h285v-80h-301zM440 530h363l78 398h-363z" />
+<glyph unicode="$" d="M991 440q0 -133 -99 -217t-274 -106v-236h-81v232q-92 2 -200.5 22.5t-172.5 50.5v103q75 -36 179.5 -61t193.5 -25v508q-145 44 -215 88t-102 104t-32 146q0 124 94.5 208.5t254.5 104.5v192h81v-190q197 -9 351 -72l-33 -90q-141 62 -318 72v-486q213 -66 293 -144 t80 -204zM881 444q0 85 -63 140.5t-200 95.5v-471q122 13 192.5 75t70.5 160zM297 1049q0 -86 57 -141t183 -93v453q-119 -16 -179.5 -76t-60.5 -143z" />
+<glyph unicode="%" horiz-adv-x="1653" d="M211 1026q0 -186 45 -279.5t141 -93.5q193 0 193 373q0 184 -49.5 276.5t-143.5 92.5q-96 0 -141 -92.5t-45 -276.5zM688 1026q0 -226 -75 -343.5t-216 -117.5q-133 0 -208.5 120.5t-75.5 340.5q0 223 72 340t212 117q139 0 215 -120.5t76 -336.5zM1063 438 q0 -185 45 -277.5t141 -92.5q193 0 193 370q0 369 -193 369q-96 0 -141 -91.5t-45 -277.5zM1540 438q0 -226 -74 -343.5t-215 -117.5q-136 0 -211 121.5t-75 339.5q0 225 73.5 341t212.5 116q137 0 213 -120t76 -337zM1280 1462l-811 -1462h-96l811 1462h96z" />
+<glyph unicode="&#x26;" horiz-adv-x="1460" d="M123 371q0 138 73.5 235t274.5 205l-75 82q-66 71 -98 139t-32 142q0 143 95.5 227t256.5 84q155 0 245.5 -81t90.5 -224q0 -105 -70 -192.5t-253 -194.5l452 -457q61 72 104 157t75 201h96q-63 -246 -209 -426l266 -268h-135l-193 197q-92 -90 -164 -131.5t-157.5 -63.5 t-194.5 -22q-209 0 -328.5 103t-119.5 288zM578 70q128 0 234.5 43.5t209.5 146.5l-483 485q-136 -72 -196.5 -122.5t-88 -109.5t-27.5 -138q0 -143 93 -224t258 -81zM373 1176q0 -79 40 -146t152 -174q159 85 221 159t62 169q0 94 -62 152.5t-168 58.5q-114 0 -179.5 -58 t-65.5 -161z" />
+<glyph unicode="'" horiz-adv-x="393" d="M260 1462l-33 -528h-61l-33 528h127z" />
+<glyph unicode="(" horiz-adv-x="557" d="M82 561q0 265 77.5 496t223.5 405h113q-148 -182 -227 -412.5t-79 -486.5q0 -483 304 -887h-111q-147 170 -224 397t-77 488z" />
+<glyph unicode=")" horiz-adv-x="557" d="M475 561q0 -263 -77.5 -490t-223.5 -395h-111q304 404 304 887q0 257 -79 487.5t-227 411.5h113q147 -175 224 -406.5t77 -494.5z" />
+<glyph unicode="*" horiz-adv-x="1128" d="M631 1556l-37 -405l405 104l21 -131l-395 -39l247 -340l-124 -71l-191 379l-180 -379l-125 71l242 340l-390 39l19 131l401 -104l-39 405h146z" />
+<glyph unicode="+" d="M625 764h434v-82h-434v-432h-82v432h-432v82h432v434h82v-434z" />
+<glyph unicode="," horiz-adv-x="440" d="M295 238l12 -21q-75 -265 -174 -481h-65q77 275 110 502h117z" />
+<glyph unicode="-" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="." horiz-adv-x="487" d="M162 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="/" horiz-adv-x="698" d="M674 1462l-545 -1462h-104l544 1462h105z" />
+<glyph unicode="0" d="M1055 735q0 -385 -117.5 -570t-355.5 -185q-229 0 -348 190.5t-119 564.5q0 382 115.5 566t351.5 184q231 0 352 -190.5t121 -559.5zM223 735q0 -340 89 -502.5t270 -162.5q189 0 275.5 168t86.5 497q0 324 -86.5 492t-275.5 168t-274 -168t-85 -492z" />
+<glyph unicode="1" d="M682 0h-98v1065q0 145 12 301q-15 -15 -31 -29t-309 -243l-57 71l397 297h86v-1462z" />
+<glyph unicode="2" d="M1028 0h-915v88l389 406q164 170 230 260t97 172t31 172q0 131 -86 213t-223 82q-183 0 -350 -133l-54 69q183 154 406 154q191 0 300.5 -102t109.5 -281q0 -145 -73.5 -280.5t-268.5 -334.5l-375 -385v-4h782v-96z" />
+<glyph unicode="3" d="M979 1118q0 -136 -85.5 -229t-229.5 -119v-6q176 -22 268 -112t92 -242q0 -205 -139.5 -317.5t-401.5 -112.5q-223 0 -389 83v99q84 -44 188.5 -69t196.5 -25q221 0 332 89.5t111 252.5q0 145 -113.5 223t-333.5 78h-158v96h160q182 0 288.5 86.5t106.5 234.5 q0 122 -86.5 195.5t-226.5 73.5q-109 0 -199 -30.5t-202 -104.5l-49 67q85 71 205 112.5t243 41.5q202 0 312 -95.5t110 -269.5z" />
+<glyph unicode="4" d="M1141 373h-252v-373h-94v373h-752v67l725 1030h121v-1011h252v-86zM795 459v418q0 302 14 507h-8q-20 -37 -123 -188l-516 -737h633z" />
+<glyph unicode="5" d="M537 879q234 0 368.5 -113t134.5 -311q0 -225 -140 -350t-386 -125q-109 0 -207 21.5t-164 61.5v103q108 -55 192 -76.5t179 -21.5q192 0 308 101.5t116 274.5q0 163 -113 256t-307 93q-130 0 -272 -39l-60 39l58 669h704v-96h-610l-45 -516q156 29 244 29z" />
+<glyph unicode="6" d="M131 623q0 285 77.5 479.5t220 288.5t343.5 94q94 0 172 -23v-88q-73 27 -176 27q-247 0 -384.5 -178t-154.5 -518h13q76 98 174 148t207 50q205 0 320.5 -117t115.5 -323q0 -224 -121.5 -353.5t-327.5 -129.5q-222 0 -350.5 169.5t-128.5 473.5zM610 68q164 0 255 103 t91 294q0 168 -90 262t-245 94q-102 0 -189.5 -45t-139.5 -119.5t-52 -152.5q0 -111 49.5 -213.5t134 -162.5t186.5 -60z" />
+<glyph unicode="7" d="M334 0l602 1366h-827v96h946v-73l-604 -1389h-117z" />
+<glyph unicode="8" d="M582 1487q186 0 299.5 -95t113.5 -257q0 -112 -70.5 -198t-228.5 -159q192 -79 270 -173t78 -228q0 -181 -126.5 -289t-339.5 -108q-221 0 -339 101t-118 294q0 131 83 230t257 169q-161 76 -227 160.5t-66 202.5q0 105 53 184.5t148.5 122.5t212.5 43zM223 360 q0 -138 93.5 -214t261.5 -76q164 0 264 80.5t100 218.5q0 124 -78.5 201.5t-302.5 162.5q-184 -71 -261 -157t-77 -216zM580 1397q-141 0 -226.5 -69.5t-85.5 -190.5q0 -70 31.5 -123.5t91 -97t199.5 -101.5q163 63 234 139t71 183q0 120 -84.5 190t-230.5 70z" />
+<glyph unicode="9" d="M1036 842q0 -288 -75.5 -482t-220 -287t-349.5 -93q-104 0 -192 26v86q43 -14 103.5 -21.5t92.5 -7.5q247 0 387 178.5t156 520.5h-12q-73 -96 -174 -147.5t-211 -51.5q-203 0 -316.5 112t-113.5 318q0 220 124.5 356t323.5 136q144 0 252 -75.5t166.5 -221.5t58.5 -346z M559 1397q-158 0 -252 -106.5t-94 -291.5q0 -174 87 -264t249 -90q101 0 188.5 45t139 119.5t51.5 151.5q0 117 -46.5 219t-130 159.5t-192.5 57.5z" />
+<glyph unicode=":" horiz-adv-x="487" d="M162 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98zM162 971q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode=";" horiz-adv-x="487" d="M303 238l12 -21q-75 -265 -174 -481h-65q29 97 62 245.5t48 256.5h117zM162 971q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#x3c;" d="M1059 266l-948 416v61l948 474v-95l-823 -405l823 -355v-96z" />
+<glyph unicode="=" d="M111 885v82h948v-82h-948zM111 477v82h948v-82h-948z" />
+<glyph unicode="&#x3e;" d="M111 362l823 355l-823 405v95l948 -474v-61l-948 -416v96z" />
+<glyph unicode="?" horiz-adv-x="862" d="M293 377v37q0 123 37.5 201t138.5 167l91 79q72 61 103 121t31 138q0 127 -83.5 202t-219.5 75q-79 0 -148 -17.5t-149 -56.5l-37 80q110 48 184.5 64t153.5 16q183 0 288 -98.5t105 -270.5q0 -68 -18 -119t-50.5 -94.5t-78.5 -84t-102 -87.5q-64 -54 -98.5 -98.5 t-50 -93.5t-15.5 -146v-14h-82zM260 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="@" horiz-adv-x="1815" d="M1702 725q0 -228 -90.5 -366t-245.5 -138q-89 0 -144.5 54t-64.5 147h-4q-43 -100 -124 -150.5t-189 -50.5q-148 0 -229 96.5t-81 270.5q0 202 120.5 330.5t314.5 128.5q138 0 286 -41l-22 -464v-30q0 -104 35 -156.5t116 -52.5q103 0 168.5 116.5t65.5 303.5 q0 194 -79 340t-225.5 224.5t-334.5 78.5q-230 0 -405.5 -99.5t-270 -281.5t-94.5 -418q0 -322 167 -497.5t474 -175.5q93 0 188.5 18t231.5 70v-99q-203 -80 -414 -80q-349 0 -544 200.5t-195 557.5q0 256 108.5 460.5t307 317.5t448.5 113q215 0 380.5 -89t255 -254.5 t89.5 -383.5zM633 590q0 -143 55 -215t174 -72q255 0 273 346l16 291q-79 27 -193 27q-149 0 -237 -102.5t-88 -274.5z" />
+<glyph unicode="A" horiz-adv-x="1229" d="M911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174z" />
+<glyph unicode="B" horiz-adv-x="1284" d="M207 1462h401q271 0 398 -92t127 -278q0 -127 -77.5 -211.5t-226.5 -108.5v-6q175 -26 257.5 -110.5t82.5 -235.5q0 -202 -134 -311t-380 -109h-448v1462zM309 811h322q206 0 299.5 68.5t93.5 214.5t-105.5 212t-314.5 66h-295v-561zM309 721v-631h344q406 0 406 330 q0 301 -428 301h-322z" />
+<glyph unicode="C" horiz-adv-x="1272" d="M831 1391q-275 0 -433 -176t-158 -482q0 -313 149 -486t426 -173q184 0 338 47v-90q-145 -51 -362 -51q-308 0 -485 199t-177 556q0 223 84.5 393t243 262.5t368.5 92.5q214 0 383 -80l-41 -92q-160 80 -336 80z" />
+<glyph unicode="D" horiz-adv-x="1446" d="M1317 745q0 -368 -193 -556.5t-567 -188.5h-350v1462h395q350 0 532.5 -183t182.5 -534zM1206 741q0 314 -159.5 472.5t-468.5 158.5h-269v-1282h242q655 0 655 651z" />
+<glyph unicode="E" horiz-adv-x="1130" d="M1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94z" />
+<glyph unicode="F" horiz-adv-x="1028" d="M309 0h-102v1462h801v-94h-699v-620h660v-95h-660v-653z" />
+<glyph unicode="G" horiz-adv-x="1481" d="M782 737h539v-667q-212 -90 -477 -90q-346 0 -530.5 195.5t-184.5 553.5q0 223 91.5 395.5t262 266.5t391.5 94q239 0 429 -88l-41 -92q-190 88 -394 88q-289 0 -458.5 -178.5t-169.5 -481.5q0 -330 161 -496.5t473 -166.5q202 0 343 57v514h-435v96z" />
+<glyph unicode="H" horiz-adv-x="1473" d="M1266 0h-103v719h-854v-719h-102v1462h102v-649h854v649h103v-1462z" />
+<glyph unicode="I" horiz-adv-x="516" d="M207 0v1462h102v-1462h-102z" />
+<glyph unicode="J" horiz-adv-x="506" d="M-33 -369q-92 0 -151 27v88q78 -20 149 -20q242 0 242 264v1472h102v-1462q0 -369 -342 -369z" />
+<glyph unicode="K" horiz-adv-x="1190" d="M1190 0h-125l-561 772l-195 -172v-600h-102v1462h102v-760l162 162l573 598h130l-599 -618z" />
+<glyph unicode="L" horiz-adv-x="1051" d="M207 0v1462h102v-1366h697v-96h-799z" />
+<glyph unicode="M" horiz-adv-x="1767" d="M850 0l-545 1350h-8q8 -124 8 -254v-1096h-98v1462h158l518 -1286h6l518 1286h154v-1462h-103v1108q0 116 12 240h-8l-547 -1348h-65z" />
+<glyph unicode="N" horiz-adv-x="1477" d="M1270 0h-103l-866 1298h-8q12 -232 12 -350v-948h-98v1462h102l865 -1296h6q-9 180 -9 342v954h99v-1462z" />
+<glyph unicode="O" horiz-adv-x="1565" d="M1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483z" />
+<glyph unicode="P" horiz-adv-x="1198" d="M1087 1042q0 -212 -144 -325t-408 -113h-226v-604h-102v1462h358q522 0 522 -420zM309 692h201q247 0 357 81.5t110 264.5q0 169 -104 250.5t-322 81.5h-242v-678z" />
+<glyph unicode="Q" horiz-adv-x="1565" d="M1436 733q0 -294 -126 -486.5t-349 -246.5l333 -348h-166l-282 330l-33 -2h-31q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5 t-401.5 168.5q-261 0 -402.5 -170t-141.5 -483z" />
+<glyph unicode="R" horiz-adv-x="1217" d="M309 637v-637h-102v1462h348q272 0 402 -100.5t130 -302.5q0 -147 -77.5 -248t-235.5 -145l397 -666h-122l-377 637h-363zM309 725h279q185 0 287 82.5t102 243.5q0 167 -100 243t-326 76h-242v-645z" />
+<glyph unicode="S" horiz-adv-x="1116" d="M1014 377q0 -183 -134.5 -290t-357.5 -107q-268 0 -411 59v102q158 -67 403 -67q180 0 285.5 82.5t105.5 216.5q0 83 -35 137.5t-114 99.5t-232 97q-224 77 -309.5 166.5t-85.5 238.5q0 164 128.5 267.5t330.5 103.5q206 0 387 -78l-37 -88q-182 76 -348 76 q-162 0 -258 -75t-96 -204q0 -81 29.5 -133t96.5 -93.5t230 -99.5q171 -59 257 -114.5t125.5 -126t39.5 -170.5z" />
+<glyph unicode="T" horiz-adv-x="1073" d="M588 0h-103v1366h-475v96h1053v-96h-475v-1366z" />
+<glyph unicode="U" horiz-adv-x="1473" d="M1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102z" />
+<glyph unicode="V" horiz-adv-x="1182" d="M1071 1462h111l-547 -1462h-90l-545 1462h109l368 -995q84 -225 113 -338q20 75 79 233z" />
+<glyph unicode="W" horiz-adv-x="1827" d="M1372 0h-84l-321 1128q-40 139 -60 228q-16 -87 -45.5 -200t-322.5 -1156h-86l-402 1462h107l256 -942q15 -57 28 -105.5t23.5 -91t19 -82t15.5 -79.5q24 136 102 413l250 887h113l293 -1018q51 -176 73 -284q13 72 33.5 153t308.5 1149h103z" />
+<glyph unicode="X" horiz-adv-x="1102" d="M1102 0h-117l-432 682l-440 -682h-113l492 762l-447 700h115l395 -626l401 626h109l-453 -698z" />
+<glyph unicode="Y" horiz-adv-x="1081" d="M543 662l428 800h110l-487 -897v-565h-105v557l-489 905h117z" />
+<glyph unicode="Z" horiz-adv-x="1180" d="M1098 0h-1016v76l856 1290h-817v96h954v-76l-858 -1290h881v-96z" />
+<glyph unicode="[" horiz-adv-x="653" d="M602 -324h-428v1786h428v-94h-330v-1597h330v-95z" />
+<glyph unicode="\" horiz-adv-x="698" d="M127 1462l547 -1462h-103l-546 1462h102z" />
+<glyph unicode="]" horiz-adv-x="653" d="M51 -229h330v1597h-330v94h428v-1786h-428v95z" />
+<glyph unicode="^" d="M88 561l465 912h68l460 -912h-100l-395 791l-398 -791h-100z" />
+<glyph unicode="_" horiz-adv-x="842" d="M846 -266h-850v82h850v-82z" />
+<glyph unicode="`" horiz-adv-x="1182" d="M776 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="a" horiz-adv-x="1085" d="M842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5z" />
+<glyph unicode="b" horiz-adv-x="1219" d="M641 1108q228 0 343.5 -143.5t115.5 -419.5q0 -271 -121.5 -418t-341.5 -147q-116 0 -209 48t-147 136h-9l-28 -164h-62v1556h99v-391q0 -88 -4 -162l-3 -85h7q62 98 149.5 144t210.5 46zM639 1018q-192 0 -275 -110t-83 -363v-17q0 -246 86.5 -353t269.5 -107 q178 0 268 124.5t90 354.5q0 471 -356 471z" />
+<glyph unicode="c" horiz-adv-x="973" d="M616 -20q-233 0 -365 147t-132 410q0 270 137 420.5t375 150.5q141 0 270 -49l-27 -88q-141 47 -245 47q-200 0 -303 -123.5t-103 -355.5q0 -220 103 -344.5t288 -124.5q148 0 275 53v-92q-104 -51 -273 -51z" />
+<glyph unicode="d" horiz-adv-x="1219" d="M580 1108q118 0 204 -43t154 -147h6q-6 126 -6 247v391h98v-1556h-65l-25 166h-8q-124 -186 -356 -186q-225 0 -344 140t-119 408q0 282 118 431t343 149zM580 1018q-178 0 -267.5 -125t-89.5 -363q0 -462 359 -462q184 0 270 107t86 353v17q0 252 -84.5 362.5 t-273.5 110.5z" />
+<glyph unicode="e" horiz-adv-x="1124" d="M621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5z" />
+<glyph unicode="f" horiz-adv-x="614" d="M586 1001h-256v-1001h-99v1001h-202v58l202 37v84q0 200 73.5 293.5t240.5 93.5q90 0 180 -27l-23 -86q-80 25 -159 25q-116 0 -164.5 -68.5t-48.5 -222.5v-101h256v-86z" />
+<glyph unicode="g" horiz-adv-x="1071" d="M1030 1087v-69l-225 -14q90 -112 90 -246q0 -157 -104.5 -254.5t-280.5 -97.5q-74 0 -104 6q-59 -31 -90 -73t-31 -89q0 -52 39.5 -76t132.5 -24h190q177 0 271 -71.5t94 -211.5q0 -172 -139.5 -265.5t-397.5 -93.5q-205 0 -317.5 79t-112.5 220q0 112 69.5 186 t188.5 101q-49 21 -78.5 59.5t-29.5 88.5q0 109 139 192q-95 39 -148 122.5t-53 191.5q0 163 103.5 261.5t279.5 98.5q107 0 166 -21h348zM150 -184q0 -224 333 -224q428 0 428 273q0 98 -67 142t-217 44h-178q-299 0 -299 -235zM233 748q0 -126 76.5 -195.5t204.5 -69.5 q136 0 208.5 69t72.5 200q0 139 -74.5 208.5t-208.5 69.5q-130 0 -204.5 -74.5t-74.5 -207.5z" />
+<glyph unicode="h" horiz-adv-x="1208" d="M940 0v705q0 164 -69 238.5t-214 74.5q-195 0 -285.5 -98.5t-90.5 -319.5v-600h-99v1556h99v-495l-5 -139h7q61 98 154 142t231 44q370 0 370 -397v-711h-98z" />
+<glyph unicode="i" horiz-adv-x="463" d="M281 0h-99v1087h99v-1087zM168 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="j" horiz-adv-x="463" d="M37 -492q-80 0 -135 25v86q69 -20 129 -20q151 0 151 176v1312h99v-1298q0 -135 -63.5 -208t-180.5 -73zM168 1389q0 96 63 96q31 0 48.5 -25t17.5 -71q0 -45 -17.5 -71t-48.5 -26q-63 0 -63 97z" />
+<glyph unicode="k" horiz-adv-x="991" d="M279 477l555 610h120l-428 -464l465 -623h-119l-413 549l-178 -162v-387h-99v1556h99v-780l-7 -299h5z" />
+<glyph unicode="l" horiz-adv-x="463" d="M281 0h-99v1556h99v-1556z" />
+<glyph unicode="m" horiz-adv-x="1808" d="M1540 0v713q0 159 -62 232t-190 73q-167 0 -247 -92t-80 -289v-637h-101v743q0 275 -252 275q-171 0 -249 -99.5t-78 -318.5v-600h-99v1087h82l21 -149h6q45 81 128 125.5t183 44.5q257 0 330 -193h4q53 93 142.5 143t203.5 50q178 0 267 -95t89 -302v-711h-98z" />
+<glyph unicode="n" horiz-adv-x="1208" d="M940 0v705q0 164 -69 238.5t-214 74.5q-195 0 -285.5 -98.5t-90.5 -319.5v-600h-99v1087h84l19 -149h6q106 170 377 170q370 0 370 -397v-711h-98z" />
+<glyph unicode="o" horiz-adv-x="1200" d="M1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5t-97.5 -349.5z " />
+<glyph unicode="p" horiz-adv-x="1219" d="M647 -20q-251 0 -366 188h-7l3 -84q4 -74 4 -162v-414h-99v1579h84l19 -155h6q112 176 358 176q220 0 335.5 -144.5t115.5 -420.5q0 -268 -121.5 -415.5t-331.5 -147.5zM645 68q167 0 258.5 124t91.5 347q0 479 -346 479q-190 0 -279 -104.5t-89 -340.5v-32 q0 -255 85.5 -364t278.5 -109z" />
+<glyph unicode="q" horiz-adv-x="1219" d="M569 -20q-214 0 -332 142t-118 410q0 275 118 425.5t338 150.5q236 0 353 -174h6l18 153h84v-1579h-98v414q0 122 6 248h-6q-118 -190 -369 -190zM571 68q198 0 282.5 109t84.5 366v12q0 245 -85 354t-271 109q-176 0 -267.5 -124t-91.5 -364q0 -229 89.5 -345.5 t258.5 -116.5z" />
+<glyph unicode="r" horiz-adv-x="797" d="M610 1108q69 0 148 -14l-19 -95q-68 17 -141 17q-139 0 -228 -118t-89 -298v-600h-99v1087h84l10 -196h7q67 120 143 168.5t184 48.5z" />
+<glyph unicode="s" horiz-adv-x="954" d="M856 283q0 -146 -111 -224.5t-315 -78.5q-218 0 -346 67v107q164 -82 346 -82q161 0 244.5 53.5t83.5 142.5q0 82 -66.5 138t-218.5 110q-163 59 -229 101.5t-99.5 96t-33.5 130.5q0 122 102.5 193t286.5 71q176 0 334 -66l-37 -90q-160 66 -297 66q-133 0 -211 -44 t-78 -122q0 -85 60.5 -136t236.5 -114q147 -53 214 -95.5t100.5 -96.5t33.5 -127z" />
+<glyph unicode="t" horiz-adv-x="686" d="M469 68q94 0 164 16v-80q-72 -24 -166 -24q-144 0 -212.5 77t-68.5 242v702h-161v58l161 45l50 246h51v-263h319v-86h-319v-688q0 -125 44 -185t138 -60z" />
+<glyph unicode="u" horiz-adv-x="1208" d="M268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98z" />
+<glyph unicode="v" horiz-adv-x="940" d="M420 0l-420 1087h102l281 -739q56 -142 84 -248h6q41 136 84 250l281 737h102l-420 -1087h-100z" />
+<glyph unicode="w" horiz-adv-x="1481" d="M1051 0l-238 727q-23 74 -59 217h-6l-21 -74l-45 -145l-242 -725h-98l-311 1087h106l174 -630q61 -234 80 -344h6q59 234 86 311l224 663h90l213 -661q72 -235 88 -311h6q8 65 80 348l166 624h100l-295 -1087h-104z" />
+<glyph unicode="x" horiz-adv-x="1020" d="M449 559l-379 528h114l324 -458l321 458h109l-373 -528l400 -559h-115l-342 485l-344 -485h-109z" />
+<glyph unicode="y" horiz-adv-x="940" d="M0 1087h102l230 -610q105 -281 133 -379h6q42 129 137 385l230 604h102l-487 -1263q-59 -154 -99 -208t-93.5 -81t-129.5 -27q-57 0 -127 21v86q58 -16 125 -16q51 0 90 24t70.5 74.5t73 160t53.5 142.5z" />
+<glyph unicode="z" horiz-adv-x="944" d="M858 0h-776v63l645 936h-598v88h727v-63l-649 -936h651v-88z" />
+<glyph unicode="{" horiz-adv-x="723" d="M389 -27q0 -102 59.5 -152.5t202.5 -53.5v-91q-195 0 -277.5 75t-82.5 231v337q0 205 -230 209v80q122 2 176 51t54 148v350q0 299 360 305v-90q-138 -5 -200 -58t-62 -157v-305q0 -130 -44 -194t-142 -85v-8q97 -20 141.5 -83.5t44.5 -186.5v-322z" />
+<glyph unicode="|" horiz-adv-x="1108" d="M508 1561h92v-2067h-92v2067z" />
+<glyph unicode="}" horiz-adv-x="723" d="M334 295q0 123 44.5 186.5t141.5 83.5v8q-97 20 -141.5 84t-44.5 195v305q0 103 -61.5 156.5t-200.5 58.5v90q174 0 267 -77.5t93 -227.5v-350q0 -100 54.5 -148.5t175.5 -50.5v-80q-230 -4 -230 -209v-337q0 -155 -82.5 -230.5t-277.5 -75.5v91q141 2 201.5 52.5 t60.5 153.5v322z" />
+<glyph unicode="~" d="M334 745q-49 0 -108 -30.5t-115 -89.5v94q108 110 233 110q61 0 115 -13.5t155 -57.5q126 -58 220 -58q56 0 109.5 30.5t115.5 94.5v-96q-48 -49 -104.5 -81t-129.5 -32q-116 0 -270 72q-124 57 -221 57z" />
+<glyph unicode="&#xa1;" horiz-adv-x="492" d="M215 711h61l29 -1086h-119zM166 1010q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#xa2;" d="M602 190q-186 30 -288.5 175t-102.5 380q0 232 102.5 381.5t288.5 182.5v174h82v-166h14q131 0 275 -55l-31 -84q-134 51 -237 51q-187 0 -288.5 -122.5t-101.5 -358.5q0 -225 100.5 -349.5t280.5 -124.5q131 0 267 58v-92q-110 -56 -267 -56h-12v-204h-82v210z" />
+<glyph unicode="&#xa3;" d="M412 676v-256q0 -116 -35 -196t-113 -128h809v-96h-995v84q110 21 171.5 110t61.5 224v258h-211v82h211v297q0 204 98 315t281 111q175 0 330 -68l-35 -86q-157 66 -295 66q-141 0 -209.5 -81t-68.5 -253v-301h411v-82h-411z" />
+<glyph unicode="&#xa4;" d="M991 723q0 -151 -90 -256l139 -141l-59 -60l-137 142q-110 -93 -260 -93q-153 0 -260 93l-138 -142l-59 60l139 141q-90 106 -90 256q0 147 90 258l-139 141l59 60l138 -142q103 93 260 93q155 0 260 -93l137 142l59 -60l-139 -141q90 -111 90 -258zM584 395 q134 0 228.5 95.5t94.5 232.5q0 136 -95 233t-228 97q-134 0 -229 -97t-95 -233t94.5 -232t229.5 -96z" />
+<glyph unicode="&#xa5;" d="M586 666l428 796h110l-432 -788h283v-82h-338v-205h338v-82h-338v-305h-105v305h-337v82h337v205h-337v82h278l-430 788h117z" />
+<glyph unicode="&#xa6;" horiz-adv-x="1108" d="M508 1561h92v-764h-92v764zM508 258h92v-764h-92v764z" />
+<glyph unicode="&#xa7;" horiz-adv-x="1057" d="M145 813q0 83 50.5 152.5t138.5 107.5q-86 47 -125 102t-39 136q0 117 101.5 183.5t275.5 66.5q175 0 336 -64l-35 -80q-91 34 -158.5 47t-144.5 13q-134 0 -205.5 -44.5t-71.5 -119.5q0 -54 25.5 -88.5t85.5 -65.5t188 -74q192 -64 264 -132.5t72 -170.5 q0 -173 -186 -274q86 -42 129 -96t43 -136q0 -135 -113 -207.5t-311 -72.5q-92 0 -171 15t-165 52v95q182 -78 332 -78q162 0 247 49.5t85 140.5q0 55 -25 87.5t-88.5 65.5t-190.5 79q-200 73 -272 141.5t-72 169.5zM246 825q0 -65 31.5 -104t105.5 -75t250 -99 q82 41 126 98t44 121q0 62 -32 102t-108.5 77t-236.5 87q-81 -23 -130.5 -79t-49.5 -128z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1182" d="M336 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM717 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M897 1092q-142 0 -222.5 -94.5t-80.5 -264.5q0 -186 74.5 -275t220.5 -89q84 0 198 43v-88q-102 -45 -208 -45q-187 0 -288.5 115t-101.5 331q0 208 111 332.5t297 124.5q119 0 227 -52l-37 -83q-98 45 -190 45zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100 t276 -275t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM193 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89t329.5 88.5t240.5 240.5t89 330q0 174 -85.5 325t-239 243t-334.5 92q-176 0 -328.5 -88.5t-241.5 -242.5t-89 -329z " />
+<glyph unicode="&#xaa;" horiz-adv-x="686" d="M512 813l-25 72q-84 -84 -202 -84q-95 0 -151 49t-56 139q0 100 80 151.5t241 59.5l95 4v43q0 77 -38 114.5t-106 37.5q-87 0 -196 -49l-33 73q117 56 231 56q228 0 228 -215v-451h-68zM168 993q0 -54 35 -85t96 -31q90 0 142.5 50t52.5 142v64l-88 -5 q-116 -6 -177 -36.5t-61 -98.5z" />
+<glyph unicode="&#xab;" horiz-adv-x="885" d="M82 543l309 393l62 -43l-254 -363l254 -362l-62 -43l-309 391v27zM442 543l310 393l61 -43l-254 -363l254 -362l-61 -43l-310 391v27z" />
+<glyph unicode="&#xac;" d="M1038 764v-494h-82v412h-845v82h927z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M92 512zM92 512v82h475v-82h-475z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M709 731h112q91 0 143 46.5t52 135.5q0 172 -197 172h-110v-354zM1120 918q0 -79 -38.5 -139.5t-110.5 -94.5l237 -393h-121l-210 360h-168v-360h-101v880h211q143 0 222 -62t79 -191zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275t101 -377 q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM193 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89t329.5 88.5t240.5 240.5t89 330q0 174 -85.5 325t-239 243t-334.5 92q-176 0 -328.5 -88.5t-241.5 -242.5t-89 -329z" />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036v82h1036v-82z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M139 1184q0 132 86.5 215.5t212.5 83.5t212.5 -83.5t86.5 -215.5t-86.5 -215.5t-212.5 -83.5q-130 0 -214.5 83t-84.5 216zM229 1184q0 -91 61 -154t148 -63q86 0 147.5 62t61.5 155q0 92 -60 154.5t-149 62.5q-90 0 -149.5 -64t-59.5 -153z" />
+<glyph unicode="&#xb1;" d="M111 1zM111 1v82h948v-82h-948zM625 764h434v-82h-434v-432h-82v432h-432v82h432v434h82v-434z" />
+<glyph unicode="&#xb2;" horiz-adv-x="688" d="M629 586h-576v78l242 237q125 121 172 193t47 149q0 71 -46.5 112.5t-123.5 41.5q-108 0 -217 -82l-49 65q119 103 270 103q124 0 194 -63.5t70 -174.5q0 -47 -13 -89t-40 -85.5t-68.5 -90t-308.5 -306.5h447v-88z" />
+<glyph unicode="&#xb3;" horiz-adv-x="688" d="M616 1260q0 -78 -44 -131.5t-117 -75.5q186 -45 186 -211q0 -130 -88.5 -201.5t-247.5 -71.5q-144 0 -264 60v88q136 -62 266 -62q115 0 174.5 49t59.5 136q0 83 -59.5 122t-178.5 39h-131v84h135q105 0 158 43.5t53 120.5q0 67 -47 107.5t-127 40.5q-128 0 -246 -78 l-47 70q130 94 293 94q127 0 199.5 -60t72.5 -163z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1182" d="M393 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1221" d="M281 1087v-704q0 -164 69 -238.5t213 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-50 -77 -150 -123.5t-217 -46.5q-99 0 -167.5 27.5t-119.5 84.5q5 -92 5 -170v-414h-99v1579h99z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1106 -260h-100v1722h-228v-1722h-100v819q-64 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h543v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="487" d="M162 623zM162 721q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M393 -291q0 -100 -67.5 -150.5t-188.5 -50.5q-68 0 -94 11v88q30 -10 92 -10q78 0 119 28t41 80q0 94 -193 121l93 174h96l-66 -117q168 -37 168 -174z" />
+<glyph unicode="&#xb9;" horiz-adv-x="688" d="M350 1462h92v-876h-98v547q0 99 12 233q-26 -23 -233 -145l-47 77z" />
+<glyph unicode="&#xba;" horiz-adv-x="739" d="M670 1141q0 -161 -80 -250.5t-223 -89.5t-220 86t-77 254q0 162 78 250t223 88q142 0 220.5 -87t78.5 -251zM160 1141q0 -264 209 -264t209 264q0 131 -50 194.5t-159 63.5t-159 -63.5t-50 -194.5z" />
+<glyph unicode="&#xbb;" horiz-adv-x="885" d="M803 518l-309 -393l-62 43l254 362l-254 363l62 43l309 -391v-27zM442 518l-309 -393l-61 43l254 362l-254 363l61 43l309 -391v-27z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1516" d="M59 0zM333 1462h92v-876h-98v547q0 99 12 233q-26 -23 -233 -145l-47 77zM1148 1462l-811 -1462h-94l811 1462h94zM1392 242h-129v-241h-90v241h-413v60l407 581h96v-563h129v-78zM1173 320v221q0 132 8 232q-6 -12 -21.5 -35.5t-295.5 -417.5h309z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1516" d="M11 0zM285 1462h92v-876h-98v547q0 99 12 233q-26 -23 -233 -145l-47 77zM1073 1462l-811 -1462h-94l811 1462h94zM1403 1h-576v78l242 237q125 121 172 193t47 149q0 71 -46.5 112.5t-123.5 41.5q-108 0 -217 -82l-49 65q119 103 270 103q124 0 194 -63.5t70 -174.5 q0 -47 -13 -89t-40 -85.5t-68.5 -90t-308.5 -306.5h447v-88z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1516" d="M41 0zM616 1260q0 -78 -44 -131.5t-117 -75.5q186 -45 186 -211q0 -130 -88.5 -201.5t-247.5 -71.5q-144 0 -264 60v88q136 -62 266 -62q115 0 174.5 49t59.5 136q0 83 -59.5 122t-178.5 39h-131v84h135q105 0 158 43.5t53 120.5q0 67 -47 107.5t-127 40.5 q-128 0 -246 -78l-47 70q130 94 293 94q127 0 199.5 -60t72.5 -163zM1300 1462l-811 -1462h-94l811 1462h94zM1495 242h-129v-241h-90v241h-413v60l407 581h96v-563h129v-78zM1276 320v221q0 132 8 232q-6 -12 -21.5 -35.5t-295.5 -417.5h309z" />
+<glyph unicode="&#xbf;" horiz-adv-x="862" d="M569 711v-37q0 -125 -39.5 -204.5t-136.5 -164.5l-90 -79q-73 -61 -104 -120.5t-31 -138.5q0 -124 82 -200t221 -76q125 0 233 46l64 27l37 -79q-111 -48 -185.5 -64t-152.5 -16q-184 0 -288.5 99t-104.5 269q0 70 20 124t58.5 102t171.5 159q64 53 98.5 98.5t49.5 94 t15 145.5v15h82zM440 1010q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM720 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM504 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM328 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM784 1581q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59 q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM367 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM748 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1229" d="M0 0zM911 516h-594l-204 -516h-113l588 1468h65l576 -1468h-115zM354 608h523l-199 527q-25 62 -60 172q-27 -96 -59 -174zM836 1610q0 -97 -60 -155t-157 -58t-157 58t-60 155q0 94 60 152.5t157 58.5t157 -59t60 -152zM482 1610q0 -66 37.5 -103.5t99.5 -37.5 t99.5 37.5t37.5 103.5q0 64 -39 101.5t-98 37.5q-62 0 -99.5 -38t-37.5 -101z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1653" d="M1528 0h-717v516h-475l-227 -516h-111l653 1462h877v-94h-615v-553h576v-94h-576v-627h615v-94zM377 608h434v760h-100z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1272" d="M129 0zM831 1391q-275 0 -433 -176t-158 -482q0 -313 149 -486t426 -173q184 0 338 47v-90q-145 -51 -362 -51q-308 0 -485 199t-177 556q0 223 84.5 393t243 262.5t368.5 92.5q214 0 383 -80l-41 -92q-160 80 -336 80zM911 -291q0 -100 -67.5 -150.5t-188.5 -50.5 q-68 0 -94 11v88q30 -10 92 -10q78 0 119 28t41 80q0 94 -193 121l93 174h96l-66 -117q168 -37 168 -174z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM697 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM463 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xca;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM315 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1130" d="M207 0zM1006 0h-799v1462h799v-94h-697v-553h658v-94h-658v-627h697v-94zM354 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM735 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xcc;" horiz-adv-x="516" d="M0 0zM207 0v1462h102v-1462h-102zM320 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xcd;" horiz-adv-x="516" d="M191 0zM207 0v1462h102v-1462h-102zM191 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xce;" horiz-adv-x="516" d="M0 0zM207 0v1462h102v-1462h-102zM-32 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xcf;" horiz-adv-x="516" d="M5 0zM207 0v1462h102v-1462h-102zM5 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM386 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1466" d="M1317 745q0 -368 -193 -556.5t-567 -188.5h-350v678h-160v94h160v690h395q350 0 532.5 -183t182.5 -534zM1206 741q0 314 -159.5 472.5t-468.5 158.5h-269v-600h406v-94h-406v-588h242q655 0 655 651z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1477" d="M207 0zM1270 0h-103l-866 1298h-8q12 -232 12 -350v-948h-98v1462h102l865 -1296h6q-9 180 -9 342v954h99v-1462zM897 1581q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59 q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM885 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM686 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM492 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM940 1581q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1565" d="M129 0zM1436 733q0 -348 -174 -550.5t-480 -202.5q-305 0 -479 202.5t-174 552.5q0 349 175.5 549.5t479.5 200.5q306 0 479 -201.5t173 -550.5zM240 733q0 -314 140 -485.5t402 -171.5q264 0 403.5 170t139.5 487q0 316 -139.5 484.5t-401.5 168.5q-261 0 -402.5 -170 t-141.5 -483zM529 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM910 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xd7;" d="M584 780l409 408l58 -58l-408 -407l406 -408l-58 -57l-407 408l-406 -408l-57 57l405 408l-407 407l57 58z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1565" d="M1436 733q0 -348 -174 -550.5t-480 -202.5q-236 0 -395 120l-86 -120l-74 59l90 127q-188 200 -188 569q0 349 175.5 549.5t479.5 200.5q232 0 392 -121l108 152l72 -60l-111 -153q191 -207 191 -570zM1325 733q0 315 -139 486l-742 -1037q133 -106 338 -106 q264 0 403.5 170t139.5 487zM240 733q0 -312 139 -483l739 1034q-133 102 -334 102q-261 0 -402.5 -170t-141.5 -483z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM833 1579h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xda;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM633 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM444 1595q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207 q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1473" d="M190 0zM1282 1462v-946q0 -252 -146 -394t-407 -142q-254 0 -396.5 142.5t-142.5 397.5v942h103v-946q0 -211 117 -328.5t331 -117.5q209 0 324 115.5t115 320.5v956h102zM481 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM862 1727q0 46 15.5 66 t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1081" d="M0 0zM543 662l428 800h110l-487 -897v-565h-105v557l-489 905h117zM434 1595q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xde;" horiz-adv-x="1198" d="M1087 778q0 -212 -144 -325t-408 -113h-226v-340h-102v1462h102v-264h256q522 0 522 -420zM309 428h201q247 0 357 81.5t110 264.5q0 169 -104 250.5t-322 81.5h-242v-678z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1194" d="M961 1284q0 -139 -139 -250q-81 -64 -110.5 -100.5t-29.5 -75.5q0 -44 14.5 -68t51.5 -57t102 -78q106 -75 151.5 -124.5t68 -103t22.5 -120.5q0 -156 -88 -241.5t-246 -85.5q-95 0 -174.5 18.5t-126.5 48.5v107q65 -38 148.5 -62t152.5 -24q114 0 174.5 54.5t60.5 160.5 q0 83 -39 144t-149 136q-127 87 -175 147t-48 146q0 60 32.5 110t106.5 108q74 57 106.5 105.5t32.5 106.5q0 93 -70 143t-202 50q-145 0 -226 -69t-81 -196v-1214h-99v1206q0 173 103.5 267t292.5 94q188 0 285.5 -72.5t97.5 -210.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM638 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM422 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM251 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM697 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5 h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM282 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM663 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1085" d="M98 0zM842 0l-25 172h-8q-82 -105 -168.5 -148.5t-204.5 -43.5q-160 0 -249 82t-89 227q0 159 132.5 247t383.5 93l207 6v72q0 155 -63 234t-203 79q-151 0 -313 -84l-37 86q179 84 354 84q179 0 267.5 -93t88.5 -290v-723h-73zM442 70q174 0 274.5 99.5t100.5 276.5v107 l-190 -8q-229 -11 -326.5 -71.5t-97.5 -188.5q0 -102 62.5 -158.5t176.5 -56.5zM759 1456q0 -97 -60 -155t-157 -58t-157 58t-60 155q0 94 60 152.5t157 58.5t157 -59t60 -152zM405 1456q0 -66 37.5 -103.5t99.5 -37.5t99.5 37.5t37.5 103.5q0 64 -39 101.5t-98 37.5 q-62 0 -99.5 -38t-37.5 -101z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1731" d="M1243 -20q-295 0 -397 256q-68 -133 -168 -194.5t-252 -61.5q-156 0 -242 82.5t-86 226.5q0 154 125 243t377 97l201 6v72q0 155 -61.5 234t-198.5 79q-148 0 -305 -84l-37 86q173 84 346 84q261 0 325 -211q111 213 347 213q184 0 289.5 -134.5t105.5 -363.5v-80h-715 q0 -460 348 -460q85 0 150 12t174 57v-90q-92 -41 -165 -55t-161 -14zM434 70q169 0 266 99.5t97 276.5v107l-187 -8q-219 -11 -313 -71.5t-94 -188.5q0 -102 61 -158.5t170 -56.5zM1217 1020q-284 0 -314 -402h604q0 188 -77.5 295t-212.5 107z" />
+<glyph unicode="&#xe7;" horiz-adv-x="973" d="M119 0zM616 -20q-233 0 -365 147t-132 410q0 270 137 420.5t375 150.5q141 0 270 -49l-27 -88q-141 47 -245 47q-200 0 -303 -123.5t-103 -355.5q0 -220 103 -344.5t288 -124.5q148 0 275 53v-92q-104 -51 -273 -51zM723 -291q0 -100 -67.5 -150.5t-188.5 -50.5 q-68 0 -94 11v88q30 -10 92 -10q78 0 119 28t41 80q0 94 -193 121l93 174h96l-66 -117q168 -37 168 -174z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM685 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM452 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xea;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM290 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1124" d="M119 0zM621 -20q-237 0 -369.5 146t-132.5 409q0 260 128 416.5t345 156.5q192 0 303 -134t111 -364v-80h-783q2 -224 104.5 -342t293.5 -118q93 0 163.5 13t178.5 56v-90q-92 -40 -170 -54.5t-172 -14.5zM592 1020q-157 0 -252 -103.5t-111 -298.5h672q0 189 -82 295.5 t-227 106.5zM331 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM712 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xec;" horiz-adv-x="463" d="M0 0zM281 0h-99v1087h99v-1087zM349 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xed;" horiz-adv-x="463" d="M107 0zM281 0h-99v1087h99v-1087zM107 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xee;" horiz-adv-x="463" d="M0 0zM281 0h-99v1087h99v-1087zM-58 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xef;" horiz-adv-x="463" d="M0 0zM281 0h-99v1087h99v-1087zM-21 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM360 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1174" d="M1055 559q0 -276 -124 -427.5t-349 -151.5q-214 0 -339.5 130t-125.5 361q0 228 126.5 357.5t342.5 129.5q108 0 187.5 -33t148.5 -96l4 2q-64 270 -269 459l-270 -157l-49 77l244 146q-86 62 -199 119l45 81q147 -69 248 -145l225 137l49 -84l-202 -121 q154 -151 230.5 -353t76.5 -431zM950 557q0 146 -97 228.5t-267 82.5q-185 0 -275 -100.5t-90 -304.5q0 -186 94.5 -289.5t268.5 -103.5q179 0 272.5 123t93.5 364z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1208" d="M182 0zM940 0v705q0 164 -69 238.5t-214 74.5q-195 0 -285.5 -98.5t-90.5 -319.5v-600h-99v1087h84l19 -149h6q106 170 377 170q370 0 370 -397v-711h-98zM779 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5 t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM718 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM499 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM309 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM761 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1200" d="M119 0zM1081 545q0 -266 -129 -415.5t-356 -149.5q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q224 0 351.5 -150.5t127.5 -412.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5t278.5 125.5t98.5 349.5q0 225 -99.5 349t-279.5 124t-277.5 -123.5 t-97.5 -349.5zM346 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM727 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xf7;" d="M111 682v82h948v-82h-948zM504 1075q0 99 80 99q82 0 82 -99q0 -52 -23.5 -75t-58.5 -23q-34 0 -57 23t-23 75zM504 371q0 98 80 98q82 0 82 -98q0 -53 -23.5 -76t-58.5 -23q-34 0 -57 23t-23 76z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1200" d="M1081 545q0 -266 -129 -415.5t-356 -149.5q-173 0 -291 98l-86 -113l-72 58l93 120q-121 153 -121 402q0 266 129 414.5t354 148.5q179 0 301 -104l96 124l74 -55l-104 -137q112 -147 112 -391zM223 545q0 -200 78 -322l543 705q-98 90 -246 90q-180 0 -277.5 -123.5 t-97.5 -349.5zM977 545q0 190 -72 309l-543 -702q94 -82 238 -82q180 0 278.5 125.5t98.5 349.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM687 1241h-69q-96 79 -188.5 171.5t-125.5 139.5v17h142q26 -48 98.5 -142t142.5 -170v-16z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM495 1257q73 79 144.5 171.5t97.5 140.5h141v-17q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM313 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70 v16z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1208" d="M170 0zM268 1087v-704q0 -164 69 -238.5t214 -74.5q194 0 285.5 98t91.5 319v600h98v-1087h-84l-18 150h-6q-106 -170 -377 -170q-371 0 -371 397v710h98zM350 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM731 1389q0 46 15.5 66t47.5 20q64 0 64 -86 t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#xfd;" horiz-adv-x="940" d="M0 0zM0 1087h102l230 -610q105 -281 133 -379h6q42 129 137 385l230 604h102l-487 -1263q-59 -154 -99 -208t-93.5 -81t-129.5 -27q-57 0 -127 21v86q58 -16 125 -16q51 0 90 24t70.5 74.5t73 160t53.5 142.5zM361 1257q73 79 144.5 171.5t97.5 140.5h141v-17 q-36 -52 -122.5 -138t-190.5 -173h-70v16z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1219" d="M281 918q114 190 368 190q220 0 335.5 -144.5t115.5 -420.5q0 -268 -121.5 -415.5t-331.5 -147.5q-251 0 -366 188h-7l3 -84q4 -74 4 -162v-414h-99v2048h99v-391l-7 -247h7zM645 68q167 0 258.5 124t91.5 347q0 479 -348 479q-193 0 -279.5 -105t-86.5 -354v-18 q0 -255 85.5 -364t278.5 -109z" />
+<glyph unicode="&#xff;" horiz-adv-x="940" d="M0 0zM0 1087h102l230 -610q105 -281 133 -379h6q42 129 137 385l230 604h102l-487 -1263q-59 -154 -99 -208t-93.5 -81t-129.5 -27q-57 0 -127 21v86q58 -16 125 -16q51 0 90 24t70.5 74.5t73 160t53.5 142.5zM214 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86 q-63 0 -63 86zM595 1389q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#x131;" horiz-adv-x="463" d="M281 0h-99v1087h99v-1087z" />
+<glyph unicode="&#x152;" horiz-adv-x="1839" d="M1714 0h-756q-76 -16 -176 -16q-305 0 -479 200t-174 551q0 347 174.5 545.5t480.5 198.5q78 0 183 -17h747v-94h-655v-553h616v-94h-616v-627h655v-94zM782 80q109 0 174 18v1266q-62 16 -172 16q-262 0 -403 -167.5t-141 -479.5q0 -315 140.5 -484t401.5 -169z" />
+<glyph unicode="&#x153;" horiz-adv-x="1942" d="M1438 -20q-156 0 -266.5 67.5t-165.5 198.5q-59 -128 -158 -197t-252 -69q-143 0 -252 69t-167 198t-58 298q0 266 129 414.5t354 148.5q151 0 251 -70t157 -209q110 279 399 279q192 0 303 -134t111 -364v-80h-762q2 -230 100.5 -345t276.5 -115q93 0 163.5 13t178.5 56 v-90q-92 -40 -170 -54.5t-172 -14.5zM223 545q0 -224 98.5 -349.5t278.5 -125.5q174 0 265 122.5t91 352.5q0 224 -93 348.5t-265 124.5q-180 0 -277.5 -123.5t-97.5 -349.5zM1409 1020q-155 0 -242 -104t-102 -298h653q0 189 -82 295.5t-227 106.5z" />
+<glyph unicode="&#x178;" horiz-adv-x="1081" d="M0 0zM543 662l428 800h110l-487 -897v-565h-105v557l-489 905h117zM288 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86zM669 1727q0 46 15.5 66t47.5 20q64 0 64 -86t-64 -86q-63 0 -63 86z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1182" d="M299 1257q62 67 131.5 156t110.5 156h98q68 -120 242 -312v-16h-70q-122 101 -221 207q-108 -114 -221 -207h-70v16z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M805 1456q0 -97 -60 -155t-157 -58t-157 58t-60 155q0 94 60 152.5t157 58.5t157 -59t60 -152zM451 1456q0 -66 37.5 -103.5t99.5 -37.5t99.5 37.5t37.5 103.5q0 64 -39 101.5t-98 37.5q-62 0 -99.5 -38t-37.5 -101z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1182" d="M780 1243q-36 0 -75 18.5t-101 71.5q-32 26 -62.5 46t-62.5 20q-45 0 -75 -34.5t-48 -121.5h-73q10 111 63 174.5t137 63.5q48 0 88 -25t82 -59q34 -28 66 -50t61 -22q46 0 77 36.5t48 119.5h76q-16 -116 -69 -177t-132 -61z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M92 512v82h475v-82h-475z" />
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M82 512v82h860v-82h-860z" />
+<glyph unicode="&#x2014;" horiz-adv-x="2048" d="M82 512v82h1884v-82h-1884z" />
+<glyph unicode="&#x2018;" horiz-adv-x="297" d="M41 961l-12 20q32 112 81.5 251t92.5 230h65q-30 -101 -64.5 -257t-45.5 -244h-117z" />
+<glyph unicode="&#x2019;" horiz-adv-x="297" d="M256 1462l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117z" />
+<glyph unicode="&#x201a;" horiz-adv-x="451" d="M68 0zM295 238l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117z" />
+<glyph unicode="&#x201c;" horiz-adv-x="614" d="M358 961l-12 20q34 120 83 255t91 226h66q-30 -98 -63 -248.5t-48 -252.5h-117zM41 961l-12 20q32 112 81.5 251t92.5 230h65q-30 -101 -64.5 -257t-45.5 -244h-117z" />
+<glyph unicode="&#x201d;" horiz-adv-x="614" d="M256 1462l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117zM573 1462l13 -20q-36 -128 -85 -261t-89 -220h-66q30 98 63 248.5t48 252.5h116z" />
+<glyph unicode="&#x201e;" horiz-adv-x="768" d="M68 0zM295 238l12 -20q-75 -265 -174 -481h-65q29 96 61 241.5t49 259.5h117zM612 238l13 -20q-36 -128 -85 -261t-89 -220h-66q30 98 63 248.5t48 252.5h116z" />
+<glyph unicode="&#x2022;" horiz-adv-x="770" d="M231 748q0 89 40.5 134.5t113.5 45.5t113.5 -47t40.5 -133q0 -85 -41 -133t-113 -48t-113 47t-41 134z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1466" d="M162 0zM162 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98zM651 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98zM1141 78q0 98 80 98q82 0 82 -98t-82 -98q-80 0 -80 98z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="524" d="M82 543l309 393l62 -43l-254 -363l254 -362l-62 -43l-309 391v27z" />
+<glyph unicode="&#x203a;" horiz-adv-x="524" d="M442 518l-309 -393l-61 43l254 362l-254 363l61 43l309 -391v-27z" />
+<glyph unicode="&#x2044;" horiz-adv-x="246" d="M573 1462l-811 -1462h-94l811 1462h94z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="688" d="M657 827h-129v-241h-90v241h-413v60l407 581h96v-563h129v-78zM438 905v221q0 132 8 232q-6 -12 -21.5 -35.5t-295.5 -417.5h309z" />
+<glyph unicode="&#x20ac;" d="M803 1397q-174 0 -288 -125.5t-155 -364.5h502v-82h-510l-4 -104v-24q0 -65 4 -87h449v-82h-443q30 -217 147.5 -338.5t301.5 -121.5q148 0 287 65v-94q-81 -34 -150.5 -46.5t-140.5 -12.5q-228 0 -367.5 140t-181.5 408h-180v82h172q-4 38 -4 113l4 102h-172v82h184 q39 272 183 425t362 153q88 0 161 -17t148 -57l-39 -86q-132 72 -270 72z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1485" d="M313 741h-86v643h-217v78h522v-78h-219v-643zM913 741l-221 609h-6l4 -201v-408h-82v721h125l221 -606l224 606h125v-721h-86v398l4 207h-7l-227 -605h-74z" />
+<glyph unicode="&#x2212;" d="M111 682v82h948v-82h-948z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1085" d="M0 1085h1085v-1085h-1085v1085z" />
+<glyph horiz-adv-x="1219" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff
new file mode 100644 (file)
index 0000000..e786074
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Light-webfont.woff differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot
new file mode 100644 (file)
index 0000000..8f44592
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.eot differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.svg b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.svg
new file mode 100644 (file)
index 0000000..431d7e3
--- /dev/null
@@ -0,0 +1,1835 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sanslight_italic" horiz-adv-x="1128" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb00;" horiz-adv-x="1155" d="M-131 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h477l35 160q35 168 116.5 244t227.5 76q73 0 166 -31 l-24 -80q-87 27 -148 27q-97 0 -154.5 -54.5t-82.5 -177.5l-35 -164h248l-17 -81h-248l-252 -1190q-34 -165 -105.5 -236.5t-193.5 -71.5q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l244 1166h-477l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1040" d="M0 0zM739 0h-98l231 1087h96zM915 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31 l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h248l-16 -81h-248l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1042" d="M0 0zM737 0h-94l334 1556h94zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h248l-16 -81h-248 l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1616" d="M0 0zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h477l35 160q35 168 116.5 244t227.5 76 q73 0 166 -31l-24 -80q-87 27 -148 27q-97 0 -154.5 -54.5t-82.5 -177.5l-35 -164h248l-17 -81h-248l-252 -1190q-34 -165 -105.5 -236.5t-193.5 -71.5q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l244 1166h-477l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z M1315 0h-98l231 1087h96zM1491 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1626" d="M0 0zM-148 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h477l35 160q35 168 116.5 244t227.5 76 q73 0 166 -31l-24 -80q-87 27 -148 27q-97 0 -154.5 -54.5t-82.5 -177.5l-35 -164h248l-17 -81h-248l-252 -1190q-34 -165 -105.5 -236.5t-193.5 -71.5q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l244 1166h-477l-252 -1190q-33 -161 -104 -234.5t-195 -73.5z M1321 0h-94l334 1556h94z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="502" d="M248 377h-62l203 1085h119zM80 57q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-68 -34.5q-67 0 -67 73z" />
+<glyph unicode="&#x22;" horiz-adv-x="721" d="M455 1462l-146 -528h-61l80 528h127zM784 1462l-145 -528h-61l79 528h127z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M389 530l119 398h-297l8 80h311l134 454h90l-136 -454h365l135 454h86l-135 -454h285l-8 -80h-302l-118 -398h303l-8 -79h-320l-133 -451h-90l135 451h-360l-134 -451h-88l134 451h-283l8 79h299zM475 530h363l120 398h-362z" />
+<glyph unicode="$" d="M928 467q0 -151 -110.5 -243t-297.5 -103l-53 -240h-82l51 240q-79 2 -158 18t-137 43v94q65 -34 153.5 -53.5t160.5 -19.5l110 512q-110 53 -153 91t-66.5 87.5t-23.5 116.5q0 155 105.5 250.5t272.5 99.5l41 192h80l-41 -192q149 -5 277 -68l-35 -78q-110 61 -256 70 l-109 -514q124 -60 172.5 -99.5t73.5 -88.5t25 -115zM537 203q142 7 223.5 74.5t81.5 183.5q0 76 -48 129.5t-157 97.5zM686 1284q-134 -9 -205 -80t-71 -186q0 -78 37 -128.5t137 -96.5z" />
+<glyph unicode="%" horiz-adv-x="1556" d="M1458 1462l-1139 -1462h-106l1135 1462h110zM1520 612q0 -175 -50 -327t-136 -230t-197 -78q-112 0 -172 75.5t-60 223.5q0 160 52 312t138 229.5t193 77.5q121 0 176.5 -71.5t55.5 -211.5zM1284 821q-80 0 -146.5 -72.5t-106.5 -202.5t-40 -263q0 -116 41 -174t113 -58 q130 0 209.5 166.5t79.5 386.5q0 109 -36 163t-114 54zM760 1198q0 -175 -50 -327t-136 -230t-197 -78q-112 0 -172 75.5t-60 223.5q0 160 52 312t138 229.5t193 77.5q232 0 232 -283zM524 1407q-79 0 -145 -71.5t-107 -203t-41 -264.5q0 -115 41 -173t113 -58 q84 0 148.5 72t102.5 204t38 277q0 109 -36 163t-114 54z" />
+<glyph unicode="&#x26;" horiz-adv-x="1331" d="M748 1395q-125 0 -194 -68t-69 -192q0 -132 109 -281q203 89 279.5 163.5t76.5 182.5q0 91 -56.5 143t-145.5 52zM465 63q108 0 211.5 42.5t222.5 146.5l-352 493q-164 -79 -232 -134.5t-103.5 -124t-35.5 -158.5q0 -119 78 -192t211 -73zM78 324q0 162 99 277.5 t325 215.5l-41 67q-78 128 -78 251q0 157 101 253.5t264 96.5q145 0 227 -76.5t82 -206.5q0 -85 -41 -154t-121 -128t-256 -138l330 -463q73 75 135.5 176.5t91.5 186.5h111q-102 -247 -285 -436l184 -246h-123l-131 184q-121 -108 -242 -156t-266 -48q-167 0 -266.5 94 t-99.5 250z" />
+<glyph unicode="'" horiz-adv-x="403" d="M461 1462l-146 -528h-61l80 528h127z" />
+<glyph unicode="(" horiz-adv-x="526" d="M104 270q0 343 122 633t382 559h105q-259 -276 -384.5 -568t-125.5 -618q0 -317 127 -600h-80q-146 262 -146 594z" />
+<glyph unicode=")" horiz-adv-x="526" d="M453 868q0 -345 -123.5 -636t-380.5 -556h-105q257 274 383.5 566.5t126.5 619.5q0 148 -28.5 294t-98.5 306h80q146 -262 146 -594z" />
+<glyph unicode="*" horiz-adv-x="1137" d="M834 1540l-109 -405l438 8l-8 -107l-416 29l181 -401l-115 -37l-135 417l-285 -348l-78 78l318 318l-392 125l39 102l394 -168l47 408z" />
+<glyph unicode="+" d="M563 672h-401v100h401v404h101v-404h401v-100h-401v-400h-101v400z" />
+<glyph unicode="," horiz-adv-x="451" d="M250 238l8 -23q-34 -92 -114 -233.5t-160 -245.5h-74q79 132 141 271t88 231h111z" />
+<glyph unicode="-" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="." horiz-adv-x="485" d="M82 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73z" />
+<glyph unicode="/" horiz-adv-x="641" d="M827 1462l-817 -1462h-110l815 1462h112z" />
+<glyph unicode="0" d="M1075 1016q0 -201 -41 -405t-116.5 -346t-183.5 -213.5t-242 -71.5q-176 0 -264.5 126.5t-88.5 387.5q0 186 44.5 381.5t124 334t187 207t240.5 68.5q340 0 340 -469zM723 1397q-134 0 -241.5 -113t-173.5 -329t-66 -451q0 -222 62.5 -329t197.5 -107q139 0 244 112 t166 337t61 489q0 199 -59.5 295t-190.5 96z" />
+<glyph unicode="1" d="M537 0h-105l225 1055q19 92 74 293q-42 -36 -75.5 -61t-249.5 -161l-52 78l406 258h90z" />
+<glyph unicode="2" d="M909 0h-870l22 104l449 402q198 177 284 276.5t126.5 186.5t40.5 180q0 112 -66 178t-197 66q-176 0 -333 -129l-54 73q180 146 394 146q173 0 268.5 -85t95.5 -237q0 -110 -43.5 -208.5t-141.5 -211.5t-311 -303l-383 -338v-4h736z" />
+<glyph unicode="3" d="M1049 1174q0 -162 -106 -275t-286 -143v-4q117 -24 185.5 -115.5t68.5 -226.5q0 -134 -64 -233t-179.5 -148t-274.5 -49q-96 0 -184.5 20.5t-153.5 52.5v101q172 -86 344 -86q197 0 303.5 89.5t106.5 252.5q0 145 -89 223t-247 78h-117l21 96h110q209 0 333 95.5 t124 258.5q0 114 -63.5 175t-188.5 61q-167 0 -344 -131l-49 75q84 67 188 104.5t218 37.5q161 0 252.5 -82.5t91.5 -226.5z" />
+<glyph unicode="4" d="M1071 371h-264l-80 -371h-96l80 371h-688l20 96l881 1010h118l-215 -1018h265zM729 459q79 369 119 558.5t86 354.5h-4q-66 -91 -129 -166l-651 -747h579z" />
+<glyph unicode="5" d="M582 879q188 0 292.5 -102t104.5 -279q0 -237 -148 -377.5t-407 -140.5q-84 0 -177.5 20t-158.5 51v107q170 -90 340 -90q208 0 328.5 114.5t120.5 313.5q0 140 -85 219.5t-225 79.5q-133 0 -243 -41l-66 49l193 659h624l-18 -96h-541l-149 -516q98 29 215 29z" />
+<glyph unicode="6" d="M170 428q0 283 105 544.5t269.5 385t383.5 123.5q123 0 182 -21l-18 -90q-86 23 -170 23q-233 0 -393.5 -174t-233.5 -502h8q68 94 164 143t211 49q161 0 250.5 -100.5t89.5 -282.5q0 -156 -60 -281t-171 -195t-257 -70q-171 0 -265.5 119t-94.5 329zM543 68 q112 0 196.5 58.5t130 162t45.5 229.5q0 146 -67 224.5t-195 78.5q-81 0 -154 -31.5t-129 -87t-78 -115t-22 -173.5q0 -164 72.5 -255t200.5 -91z" />
+<glyph unicode="7" d="M244 0l796 1366h-766l23 96h858l-20 -110l-779 -1352h-112z" />
+<glyph unicode="8" d="M737 1485q163 0 258 -85t95 -229q0 -138 -84 -234.5t-285 -172.5q130 -78 190 -170.5t60 -208.5t-58 -208t-165.5 -144.5t-260.5 -52.5q-178 0 -283.5 92.5t-105.5 253.5q0 159 100.5 268.5t321.5 187.5q-100 72 -144 152t-44 180q0 159 114 265t291 106zM610 733 q-218 -73 -313.5 -167.5t-95.5 -225.5q0 -136 77.5 -206.5t219.5 -70.5q168 0 270 91t102 233q0 104 -62 189t-198 157zM727 1399q-130 0 -214.5 -82t-84.5 -203q0 -91 41.5 -159t157.5 -142q192 62 279 144t87 206q0 109 -70.5 172.5t-195.5 63.5z" />
+<glyph unicode="9" d="M1059 1032q0 -288 -101.5 -548t-263.5 -382t-393 -122q-114 0 -186 22v90q87 -29 192 -29q474 0 627 674h-8q-140 -192 -367 -192q-162 0 -255 105t-93 284q0 155 59.5 281t170.5 196t257 70q174 0 267.5 -115.5t93.5 -333.5zM686 1393q-112 0 -197.5 -58.5 t-130.5 -162.5t-45 -230q0 -145 67.5 -225t192.5 -80q83 0 157.5 32.5t129 87.5t76.5 114t22 176q0 166 -71 256t-201 90z" />
+<glyph unicode=":" horiz-adv-x="485" d="M260 989q0 57 25.5 89t68.5 32q66 0 66 -72q0 -55 -25 -89t-67 -34q-68 0 -68 74zM102 55q0 56 25.5 88.5t69.5 32.5q65 0 65 -72q0 -55 -25.5 -88.5t-66.5 -33.5q-68 0 -68 73z" />
+<glyph unicode=";" horiz-adv-x="485" d="M287 238l8 -23q-35 -96 -118.5 -242t-156.5 -237h-73q79 132 141 271t88 231h111zM266 989q0 57 25.5 89t68.5 32q66 0 66 -72q0 -55 -25 -89t-67 -34q-68 0 -68 74z" />
+<glyph unicode="&#x3c;" d="M1051 262l-914 414v74l914 471v-103l-801 -399l801 -350v-107z" />
+<glyph unicode="=" d="M168 885v100h903v-100h-903zM168 461v98h903v-98h-903z" />
+<glyph unicode="&#x3e;" d="M170 369l801 350l-801 399v103l915 -471v-74l-915 -414v107z" />
+<glyph unicode="?" horiz-adv-x="799" d="M242 362l6 29q29 132 82 206.5t157 147.5q118 84 175 145.5t86.5 127.5t29.5 141q0 108 -67.5 170t-182.5 62q-139 0 -307 -101l-39 86q85 49 171.5 78t187.5 29q159 0 250.5 -84.5t91.5 -229.5q0 -127 -66 -234t-231 -226q-85 -61 -132.5 -108.5t-73 -95t-46.5 -143.5 h-92zM170 59q0 56 25 88.5t69 32.5q66 0 66 -71q0 -54 -24.5 -88.5t-67.5 -34.5q-68 0 -68 73z" />
+<glyph unicode="@" horiz-adv-x="1724" d="M1688 858q0 -179 -56 -323.5t-154.5 -227t-211.5 -82.5q-98 0 -154.5 55t-56.5 144h-4q-54 -97 -132.5 -148t-168.5 -51q-112 0 -178 73t-66 202q0 156 63 283t178 198.5t261 71.5q122 0 252 -52l-84 -315q-39 -140 -39 -221q0 -71 34.5 -111.5t100.5 -40.5 q86 0 160 73.5t117.5 198t43.5 251.5q0 156 -65 277t-187 188t-292 67q-235 0 -424.5 -108.5t-295.5 -304t-106 -439.5q0 -288 155 -449t435 -161q207 0 420 82v-90q-210 -82 -428 -82q-203 0 -357.5 82.5t-238.5 239t-84 370.5q0 276 121.5 493.5t337 337t473.5 119.5 q189 0 330.5 -72.5t221 -213t79.5 -314.5zM1008 969q-113 0 -204.5 -59t-142.5 -165.5t-51 -238.5q0 -92 40.5 -142.5t113.5 -50.5q101 0 180.5 89t124.5 255l78 289q-66 23 -139 23z" />
+<glyph unicode="A" horiz-adv-x="1059" d="M805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449z" />
+<glyph unicode="B" horiz-adv-x="1202" d="M412 1462h379q190 0 290.5 -84t100.5 -241q0 -153 -90 -249t-254 -124v-4q125 -31 188.5 -113.5t63.5 -204.5q0 -205 -140.5 -323.5t-390.5 -118.5h-457zM377 811h278q206 0 313 81t107 238q0 119 -78 180.5t-229 61.5h-272zM358 721l-135 -631h342q201 0 309.5 87.5 t108.5 256.5q0 145 -90 216t-275 71h-260z" />
+<glyph unicode="C" horiz-adv-x="1169" d="M961 1389q-197 0 -351.5 -104.5t-245 -304.5t-90.5 -441q0 -225 110.5 -346t317.5 -121q140 0 304 51v-94q-156 -49 -316 -49q-252 0 -386 145t-134 410q0 266 104.5 488t284.5 341t402 119q177 0 307 -68l-45 -90q-55 30 -124.5 47t-137.5 17z" />
+<glyph unicode="D" horiz-adv-x="1350" d="M1288 879q0 -253 -109.5 -461.5t-300.5 -313t-446 -104.5h-330l310 1462h305q282 0 426.5 -147.5t144.5 -435.5zM430 90q226 0 394.5 94.5t261 275.5t92.5 412q0 498 -476 498h-206l-275 -1280h209z" />
+<glyph unicode="E" horiz-adv-x="1067" d="M829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627z" />
+<glyph unicode="F" horiz-adv-x="981" d="M205 0h-103l310 1462h708l-20 -94h-604l-134 -620h570l-21 -95h-569z" />
+<glyph unicode="G" horiz-adv-x="1374" d="M856 735h406l-150 -682q-211 -73 -405 -73q-257 0 -397 146t-140 421q0 265 105 483.5t283.5 335.5t395.5 117q113 0 203 -19t184 -59l-38 -94q-110 46 -189.5 62t-167.5 16q-184 0 -339 -107.5t-244 -301.5t-89 -433q0 -229 114.5 -352t326.5 -123q155 0 309 47l117 526 h-303z" />
+<glyph unicode="H" horiz-adv-x="1366" d="M1063 0h-100l151 719h-760l-149 -719h-103l310 1462h102l-139 -649h760l137 649h100z" />
+<glyph unicode="I" horiz-adv-x="504" d="M102 0l310 1462h98l-309 -1462h-99z" />
+<glyph unicode="J" horiz-adv-x="477" d="M-180 -360q-48 0 -88 8t-56 16l11 92q57 -20 137 -20q213 0 262 241l309 1485h105l-314 -1491q-35 -170 -125 -250.5t-241 -80.5z" />
+<glyph unicode="K" horiz-adv-x="1122" d="M979 0h-111l-342 788l-190 -153l-131 -635h-103l310 1462h102l-158 -723l133 121l680 602h138l-699 -610z" />
+<glyph unicode="L" horiz-adv-x="938" d="M102 0l310 1462h102l-289 -1366h621l-23 -96h-721z" />
+<glyph unicode="M" horiz-adv-x="1669" d="M772 205l733 1257h150l-301 -1462h-101l191 901q79 369 100 447h-6l-780 -1348h-51l-222 1348h-6q-20 -154 -78 -426l-196 -922h-96l309 1462h143l205 -1257h6z" />
+<glyph unicode="N" horiz-adv-x="1372" d="M1069 0h-86l-516 1284h-8q-23 -149 -48 -273t-214 -1011h-95l310 1462h80l522 -1294h8q23 176 74 416l188 878h94z" />
+<glyph unicode="O" horiz-adv-x="1464" d="M1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300t79 430.5 q0 240 -104.5 364t-310.5 124z" />
+<glyph unicode="P" horiz-adv-x="1145" d="M1145 1102q0 -500 -610 -500h-201l-129 -602h-103l310 1462h315q202 0 310 -92.5t108 -267.5zM350 694h191q252 0 373.5 96.5t121.5 305.5q0 274 -329 274h-211z" />
+<glyph unicode="Q" horiz-adv-x="1464" d="M1403 911q0 -216 -70 -418t-186.5 -324t-274.5 -167l267 -350h-142l-231 332l-74 -4q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128 q169 0 300 98.5t210 300t79 430.5q0 240 -104.5 364t-310.5 124z" />
+<glyph unicode="R" horiz-adv-x="1145" d="M336 633l-131 -633h-103l310 1462h303q430 0 430 -360q0 -182 -103.5 -303t-281.5 -152q201 -591 221 -647h-111l-211 633h-323zM358 725h252q208 0 317 95.5t109 281.5q0 268 -329 268h-211z" />
+<glyph unicode="S" horiz-adv-x="1020" d="M895 403q0 -126 -65.5 -224.5t-179.5 -148.5t-269 -50q-88 0 -172.5 17t-171.5 58v109q163 -92 348 -92q188 0 295.5 86.5t107.5 232.5q0 61 -17 104.5t-52.5 78.5t-91 68t-131.5 75q-150 76 -209.5 164t-59.5 206t59 207.5t165 139t237 49.5q99 0 180 -17.5t168 -60.5 l-32 -94q-66 40 -151.5 63t-164.5 23q-163 0 -259.5 -82.5t-96.5 -218.5q0 -103 49 -170t182 -133q154 -79 213.5 -130t89 -113t29.5 -147z" />
+<glyph unicode="T" horiz-adv-x="985" d="M438 0h-102l289 1368h-432l20 94h973l-19 -94h-440z" />
+<glyph unicode="U" horiz-adv-x="1370" d="M1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101z" />
+<glyph unicode="V" horiz-adv-x="1079" d="M457 147q51 111 124 247l572 1068h117l-799 -1462h-88l-182 1462h100l117 -950q26 -217 35 -365h4z" />
+<glyph unicode="W" horiz-adv-x="1702" d="M1018 1341q-27 -76 -62 -153.5t-563 -1187.5h-82l-73 1462h100l47 -1031l4 -165l-2 -86h6q85 226 170 398l434 884h105l61 -878q19 -266 19 -410h6q30 86 61.5 163t493.5 1125h108q-169 -365 -330.5 -731t-328.5 -731h-78l-78 1075q-11 142 -11 219l1 47h-8z" />
+<glyph unicode="X" horiz-adv-x="971" d="M879 0h-107l-254 678l-526 -678h-127l608 766l-272 696h106l240 -626l483 626h119l-555 -719z" />
+<glyph unicode="Y" horiz-adv-x="965" d="M494 645l544 817h117l-631 -932l-108 -530h-105l119 545l-237 917h100z" />
+<glyph unicode="Z" d="M913 0h-925l22 92l1069 1276h-764l23 94h887l-19 -88l-1069 -1280h799z" />
+<glyph unicode="[" horiz-adv-x="537" d="M369 -324h-426l376 1786h429l-19 -90h-330l-340 -1605h330z" />
+<glyph unicode="\" horiz-adv-x="641" d="M295 1462l242 -1462h-82l-246 1462h86z" />
+<glyph unicode="]" horiz-adv-x="537" d="M203 1462h426l-377 -1786h-428l18 91h330l340 1605h-330z" />
+<glyph unicode="^" horiz-adv-x="1047" d="M70 569l587 906h91l260 -906h-105l-217 809l-500 -809h-116z" />
+<glyph unicode="_" horiz-adv-x="801" d="M625 -291h-807l18 86h807z" />
+<glyph unicode="`" horiz-adv-x="1135" d="M766 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="a" horiz-adv-x="1133" d="M655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82t-164 -245.5 t-64 -325.5q0 -152 50 -223.5t151 -71.5z" />
+<glyph unicode="b" horiz-adv-x="1151" d="M500 -16q-113 0 -186 59t-97 166h-6l-55 -209h-80l327 1556h95q-131 -628 -162 -751h6q93 156 199 229.5t231 73.5q281 0 281 -375q0 -203 -76 -380t-201 -273t-276 -96zM750 1018q-91 0 -180 -61.5t-160.5 -169.5t-106.5 -235t-35 -206q0 -129 64 -202.5t166 -73.5 q124 0 224 83t164 245t64 325q0 152 -49 223.5t-151 71.5z" />
+<glyph unicode="c" horiz-adv-x="887" d="M477 -20q-174 0 -274.5 110.5t-100.5 306.5q0 193 73.5 361.5t198.5 257t290 88.5q134 0 241 -43l-28 -90q-107 47 -218 47q-129 0 -232.5 -77t-162.5 -222t-59 -320q0 -158 73.5 -243.5t208.5 -85.5q71 0 131.5 13t131.5 46v-92q-116 -57 -273 -57z" />
+<glyph unicode="d" horiz-adv-x="1133" d="M655 1104q230 0 279 -219h4q12 66 143 671h99l-330 -1556h-82l45 274h-6q-173 -294 -424 -294q-281 0 -281 374q0 193 71.5 370t197.5 278.5t284 101.5zM406 70q89 0 178.5 62.5t160 168t106.5 231t36 209.5q0 126 -61.5 201.5t-168.5 75.5q-124 0 -224 -83t-164 -242.5 t-64 -327.5q0 -295 201 -295z" />
+<glyph unicode="e" horiz-adv-x="928" d="M469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5t-162.5 -308.5h49 q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5z" />
+<glyph unicode="f" horiz-adv-x="578" d="M-131 -492q-48 0 -102 19v90q53 -16 100 -16q88 0 134 53t75 186l246 1166h-205l14 67l205 14l35 160q35 168 116.5 244t227.5 76q73 0 166 -31l-25 -80q-87 27 -147 27q-96 0 -153.5 -53.5t-84.5 -178.5l-35 -164h248l-16 -81h-248l-252 -1190q-33 -161 -104 -234.5 t-195 -73.5z" />
+<glyph unicode="g" horiz-adv-x="1040" d="M1100 1087l-17 -79l-243 -11q26 -28 43.5 -84t17.5 -114q0 -109 -54.5 -206.5t-148 -145.5t-213.5 -48q-63 0 -77 9q-80 -33 -124 -73t-44 -81t31.5 -64.5t113.5 -31.5l121 -11q346 -31 346 -264q0 -112 -65 -197.5t-187 -131.5t-291 -46q-186 0 -291.5 72t-105.5 203 q0 236 309 334q-78 42 -78 123q0 123 191 202q-71 36 -110.5 105.5t-39.5 157.5q0 111 53.5 204t148 146t206.5 53q69 0 147 -21h361zM14 -207q0 -101 81 -150t224 -49q203 0 317 74.5t114 204.5q0 85 -62.5 130.5t-218.5 57.5l-160 15q-157 -45 -226 -114.5t-69 -168.5z M285 711q0 -112 58.5 -170t164.5 -58q88 0 154 37t102.5 114t36.5 169q0 104 -56 161.5t-157 57.5q-93 0 -161 -43t-105 -116t-37 -152z" />
+<glyph unicode="h" horiz-adv-x="1143" d="M764 0l149 692q21 92 21 156q0 80 -43.5 125t-134.5 45q-112 0 -210.5 -67t-166 -188t-103.5 -286l-102 -477h-98l332 1556h96l-86 -411q-44 -200 -66 -279h6q78 113 186.5 175.5t229.5 62.5q124 0 192 -65t68 -183q0 -70 -24 -182l-148 -674h-98z" />
+<glyph unicode="i" horiz-adv-x="475" d="M174 0h-98l231 1087h96zM350 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5z" />
+<glyph unicode="j" horiz-adv-x="475" d="M-166 -492q-62 0 -113 19v92q47 -22 113 -22q82 0 128.5 51.5t72.5 177.5l266 1261h96l-268 -1271q-35 -165 -106.5 -236.5t-188.5 -71.5zM350 1366q0 55 22 88t60 33q57 0 57 -72q0 -57 -22 -90t-57 -33q-29 0 -44.5 19.5t-15.5 54.5z" />
+<glyph unicode="k" horiz-adv-x="944" d="M270 477l609 610h125l-474 -469l297 -618h-106l-264 559l-205 -188l-80 -371h-96l330 1556h96l-166 -780l-70 -299h4z" />
+<glyph unicode="l" horiz-adv-x="475" d="M170 0h-94l334 1556h94z" />
+<glyph unicode="m" horiz-adv-x="1751" d="M711 0l147 674q25 125 25 162q0 182 -154 182q-106 0 -200 -67.5t-159 -188.5t-100 -287l-100 -475h-98l231 1087h80l-33 -210h6q80 113 181.5 170t212.5 57q106 0 163 -67t60 -195h6q77 129 181 195.5t222 66.5q117 0 182.5 -61.5t65.5 -176.5q0 -29 -2.5 -56.5 t-19.5 -119.5l-152 -690h-100l149 680q25 120 25 176q0 77 -43 119.5t-119 42.5q-157 0 -277.5 -137.5t-168.5 -362.5l-109 -518h-102z" />
+<glyph unicode="n" horiz-adv-x="1143" d="M764 0l149 692q21 92 21 156q0 80 -43.5 125t-134.5 45q-112 0 -210.5 -67t-166 -187.5t-103.5 -286.5l-102 -477h-98l231 1087h82l-37 -221h6q164 238 416 238q130 0 195 -64t65 -184q0 -70 -24 -182l-148 -674h-98z" />
+<glyph unicode="o" horiz-adv-x="1124" d="M649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83z" />
+<glyph unicode="p" horiz-adv-x="1149" d="M498 -16q-230 0 -279 219h-4q-13 -72 -149 -695h-99l336 1579h82l-45 -274h6q91 153 195.5 224t228.5 71q135 0 208 -92.5t73 -282.5q0 -195 -72 -371t-197.5 -277t-283.5 -101zM748 1018q-87 0 -174 -58.5t-161.5 -167.5t-110.5 -237.5t-36 -208.5q0 -125 61.5 -200.5 t168.5 -75.5q124 0 225 84t164 243.5t63 325.5q0 295 -200 295z" />
+<glyph unicode="q" horiz-adv-x="1157" d="M651 1104q109 0 183.5 -58t99.5 -167h6l55 208h80l-327 -1556h-95l98 470l64 282h-6q-93 -156 -199 -229.5t-231 -73.5q-281 0 -281 374q0 201 75.5 379t200.5 274.5t277 96.5zM401 70q92 0 182 62.5t160.5 171.5t105 236.5t34.5 200.5q0 130 -63.5 203.5t-166.5 73.5 q-124 0 -224 -83t-164 -245t-64 -325q0 -143 45.5 -219t154.5 -76z" />
+<glyph unicode="r" horiz-adv-x="752" d="M713 1106q69 0 123 -14l-21 -93q-47 15 -113 15q-94 0 -179 -64t-153 -192t-100 -277l-100 -481h-98l231 1087h80l-29 -204h6q73 94 123 135.5t106.5 64.5t123.5 23z" />
+<glyph unicode="s" horiz-adv-x="827" d="M713 295q0 -144 -103 -229.5t-280 -85.5q-173 0 -305 75v107q74 -46 153 -71t148 -25q138 0 211 57.5t73 163.5q0 42 -15.5 74t-50 61.5t-132.5 85.5q-148 80 -200 145.5t-52 159.5q0 128 98.5 209.5t259.5 81.5q75 0 158.5 -17.5t140.5 -46.5l-35 -88q-136 64 -264 64 q-116 0 -186 -53t-70 -138q0 -55 17 -88t60.5 -68.5t119.5 -76.5q114 -63 161.5 -103.5t70 -86.5t22.5 -107z" />
+<glyph unicode="t" horiz-adv-x="616" d="M694 1087l-18 -81h-283l-135 -635q-22 -99 -22 -164q0 -139 126 -139q68 0 152 26v-86q-101 -28 -170 -28q-99 0 -153 54.5t-54 158.5q0 73 29 206l129 607h-182l14 67l184 17l97 253h55l-55 -256h286z" />
+<glyph unicode="u" horiz-adv-x="1143" d="M381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100z" />
+<glyph unicode="v" horiz-adv-x="895" d="M276 0l-172 1087h101l108 -735q26 -165 33 -254h6q51 115 129 256l406 733h102l-600 -1087h-113z" />
+<glyph unicode="w" horiz-adv-x="1393" d="M838 0l-60 686q-14 224 -14 266h-6q-34 -92 -144 -290l-356 -662h-117l-20 1087h92l13 -821l-3 -157h6q61 134 150 297l373 681h77l64 -681q14 -147 14 -297h6l24 61l101 236l320 681h96l-508 -1087h-108z" />
+<glyph unicode="x" horiz-adv-x="922" d="M442 483l-393 -483h-121l471 559l-245 528h100l207 -462l373 462h120l-448 -534l258 -553h-98z" />
+<glyph unicode="y" horiz-adv-x="920" d="M123 1087h100l82 -548q51 -351 55 -449h11q43 105 186 367l348 630h103l-713 -1290q-72 -127 -122.5 -178t-114 -81t-146.5 -30q-68 0 -129 21v92q71 -27 137 -27q80 0 147 49.5t130 164.5t100 184z" />
+<glyph unicode="z" horiz-adv-x="887" d="M700 0h-729l15 72l776 932h-543l17 83h659l-18 -83l-762 -920h602z" />
+<glyph unicode="{" horiz-adv-x="709" d="M424 -324q-256 0 -256 199q0 45 16 115l56 252q18 90 18 127q0 159 -199 159l21 78q126 0 191 49t89 158l89 393q30 135 106 195.5t215 60.5h29l-17 -86q-86 -2 -129 -20.5t-69.5 -61.5t-44.5 -120l-74 -338q-30 -134 -91.5 -194.5t-164.5 -78.5v-4q68 -18 105.5 -68.5 t37.5 -121.5q0 -52 -24 -164l-47 -225q-13 -58 -13 -101q0 -61 37.5 -89t138.5 -28v-86h-20z" />
+<glyph unicode="|" d="M584 1561h100v-2071h-100v2071z" />
+<glyph unicode="}" horiz-adv-x="709" d="M332 1462q131 0 189.5 -51t58.5 -147q0 -41 -17 -115l-55 -252q-19 -95 -19 -127q0 -77 49.5 -118.5t149.5 -41.5l-20 -78q-125 0 -191 -48.5t-90 -157.5l-88 -394q-32 -139 -108.5 -197.5t-213.5 -58.5h-18v86q96 2 138 21t68.5 61t43.5 121l74 338q27 126 87.5 189.5 t168.5 82.5v5q-75 20 -109.5 72.5t-34.5 117.5q0 55 18 131l54 258q12 61 12 101q0 44 -18 69t-54 36t-116 11l20 86h21z" />
+<glyph unicode="~" d="M350 745q-49 0 -108 -30.5t-115 -89.5v94q108 110 233 110q61 0 115 -13.5t156 -57.5q126 -58 219 -58q54 0 107.5 29t117.5 96v-96q-111 -113 -233 -113q-117 0 -271 72q-62 29 -112.5 43t-108.5 14z" />
+<glyph unicode="&#xa1;" horiz-adv-x="502" d="M264 711h62l-203 -1086h-119zM432 1030q0 -56 -25 -88.5t-69 -32.5q-66 0 -66 72q0 55 25 89t68 34q67 0 67 -74z" />
+<glyph unicode="&#xa2;" d="M578 -20h-93l45 215q-132 25 -206 132.5t-74 272.5q0 184 63.5 341t178 253t256.5 111l36 178h90l-38 -176q116 -4 217 -43l-29 -90q-107 47 -217 47q-130 0 -233 -76t-162.5 -221t-59.5 -322q0 -164 74.5 -247t208.5 -83q127 0 264 60v-92q-118 -58 -281 -58z" />
+<glyph unicode="&#xa3;" d="M879 1479q170 0 313 -78l-39 -84l-54 26q-108 50 -231 50q-134 0 -220.5 -74.5t-117.5 -220.5l-73 -340h409l-18 -82h-408l-57 -268q-50 -225 -188 -314h759l-20 -94h-938l16 84q93 11 165.5 95.5t107.5 236.5l57 260h-199l17 82h198l76 350q41 187 155 279t290 92z" />
+<glyph unicode="&#xa4;" d="M262 723q0 118 74 225l-129 129l63 64l127 -129q105 78 230 78q118 0 223 -78l131 129l61 -62l-129 -129q78 -106 78 -227q0 -135 -78 -227l129 -127l-61 -62l-131 127q-104 -76 -223 -76q-126 0 -228 80l-129 -129l-61 62l127 127q-74 98 -74 225zM350 723 q0 -116 80 -196.5t197 -80.5t198.5 81t81.5 196q0 75 -36.5 140t-102.5 104t-141 39q-114 0 -195.5 -82t-81.5 -201z" />
+<glyph unicode="&#xa5;" d="M584 645l544 817h117l-559 -823h266l-16 -76h-315l-39 -190h317l-18 -84h-316l-59 -289h-105l64 289h-299l18 84h299l41 190h-301l17 76h258l-215 823h100z" />
+<glyph unicode="&#xa6;" d="M578 1561h100v-756h-100v756zM578 246h100v-756h-100v756z" />
+<glyph unicode="&#xa7;" horiz-adv-x="995" d="M211 778q0 101 69.5 182t198.5 130q-64 31 -103.5 85.5t-39.5 120.5q0 74 46 134.5t132.5 94.5t202.5 34q163 0 289 -58l-31 -80q-138 54 -264 54q-124 0 -202.5 -46.5t-78.5 -123.5q0 -59 46 -104.5t183 -106.5q112 -52 158.5 -89.5t71 -85t24.5 -110.5 q0 -197 -249 -317q122 -64 122 -197q0 -86 -48 -153.5t-139.5 -105.5t-221.5 -38q-157 0 -275 53v99q47 -27 126 -46.5t153 -19.5q149 0 228 52.5t79 150.5q0 62 -42.5 106t-166.5 96q-155 65 -211.5 130t-56.5 159zM559 1038q-119 -30 -187.5 -97.5t-68.5 -154.5 q0 -57 24.5 -96.5t81 -73t187.5 -81.5q103 49 162 113.5t59 156.5q0 72 -57.5 126t-200.5 107z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1135" d="M836 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM492 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M944 1092q-142 0 -222.5 -94.5t-80.5 -264.5q0 -186 74.5 -275t220.5 -89q85 0 199 43v-88q-104 -45 -209 -45q-187 0 -288 116t-101 330q0 207 110 332t297 125q119 0 227 -52l-36 -83q-99 45 -191 45zM147 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275 t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM240 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89q174 0 325 85.5t243 239t92 334.5q0 178 -89 330t-240.5 241t-330.5 89q-182 0 -335 -92t-238.5 -243t-85.5 -325z" />
+<glyph unicode="&#xaa;" horiz-adv-x="643" d="M487 1485q55 0 97.5 -29t66.5 -86h6l35 103h66l-137 -650h-72l22 125h-4q-96 -137 -223 -137q-80 0 -127 56.5t-47 164.5q0 189 90.5 321t226.5 132zM369 885q66 0 133.5 75.5t97.5 184.5q16 51 16 123q0 58 -36 100.5t-93 42.5q-94 0 -161.5 -111.5t-67.5 -271.5 q0 -143 111 -143z" />
+<glyph unicode="&#xab;" horiz-adv-x="860" d="M426 932l57 -49l-317 -336l213 -385l-64 -39l-254 418l2 26zM786 932l58 -49l-314 -336l209 -385l-63 -39l-254 418l2 26z" />
+<glyph unicode="&#xac;" d="M1028 772v-500h-100v400h-803v100h903z" />
+<glyph unicode="&#xad;" horiz-adv-x="629" d="M77 502zM77 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M758 731h112q93 0 144 46.5t51 135.5q0 172 -197 172h-110v-354zM1169 918q0 -80 -39.5 -141t-109.5 -93l237 -393h-120l-211 360h-168v-360h-101v880h211q143 0 222 -62t79 -191zM150 731q0 207 103.5 382t276.5 272.5t371 97.5q200 0 375 -100t276 -275t101 -377 q0 -197 -97 -370t-272 -277t-383 -104q-204 0 -376.5 100.5t-273.5 273t-101 377.5zM242 731q0 -178 88.5 -329.5t240.5 -240.5t330 -89q174 0 325 85.5t243 239t92 334.5q0 178 -89 330t-240.5 241t-330.5 89q-182 0 -335 -92t-238.5 -243t-85.5 -325z" />
+<glyph unicode="&#xaf;" horiz-adv-x="655" d="M1001 1556h-653l53 97h654z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M242 1190q0 120 85 206.5t208 86.5q122 0 207 -86.5t85 -206.5q0 -122 -85.5 -207.5t-206.5 -85.5q-122 0 -207.5 85.5t-85.5 207.5zM315 1190q0 -89 64.5 -153t155.5 -64q92 0 155.5 64t63.5 153q0 90 -64 155.5t-155 65.5q-90 0 -155 -65.5t-65 -155.5z" />
+<glyph unicode="&#xb1;" d="M528 629h-401v98h401v406h101v-406h401v-98h-401v-400h-101v400zM127 0v100h903v-100h-903z" />
+<glyph unicode="&#xb2;" horiz-adv-x="643" d="M604 586h-522l16 80l297 258q137 118 182.5 190.5t45.5 153.5q0 59 -38.5 97t-105.5 38q-95 0 -194 -76l-41 62q108 90 239 90q73 0 125 -27t78.5 -72t26.5 -100q0 -106 -59 -198.5t-183 -194.5l-266 -223h416z" />
+<glyph unicode="&#xb3;" horiz-adv-x="643" d="M705 1276q0 -85 -48.5 -148t-154.5 -88v-4q66 -16 105.5 -68t39.5 -124q0 -77 -39 -141t-109 -99t-161 -35q-59 0 -123.5 15.5t-105.5 40.5v90q46 -28 108 -48t125 -20q99 0 159 52.5t60 142.5q0 162 -196 162h-84l16 79h86q102 0 168.5 49.5t66.5 129.5 q0 68 -37.5 102.5t-105.5 34.5q-100 0 -199 -68l-40 64q109 86 251 86q100 0 159 -56.5t59 -148.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1135" d="M580 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1171" d="M238 242q0 -82 48.5 -127t135.5 -45q110 0 207 64.5t162.5 182.5t101.5 285l104 485h99l-234 -1087h-78l29 205h-6q-164 -221 -404 -221q-85 0 -139 32.5t-76 89.5h-6q-18 -132 -51 -284l-63 -314h-97l338 1579h101l-152 -698q-20 -96 -20 -147z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1208 -260h-100v1722h-227v-1722h-101v819q-64 -18 -145 -18q-216 0 -318 125t-102 376q0 260 109 387t342 127h542v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="485" d="M207 625zM207 698q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73z" />
+<glyph unicode="&#xb8;" horiz-adv-x="420" d="M197 -289q0 -94 -75.5 -148.5t-217.5 -54.5q-46 0 -78 7v79q30 -6 72 -6q198 0 198 115q0 97 -151 107l110 190h80l-78 -137q140 -30 140 -152z" />
+<glyph unicode="&#xb9;" horiz-adv-x="643" d="M512 1462h80l-186 -876h-84l118 569q5 21 11.5 50.5t14 60t15.5 59t15 49.5q-34 -31 -60 -51.5t-143 -93.5l-39 59z" />
+<glyph unicode="&#xba;" horiz-adv-x="655" d="M518 1479q105 0 165 -64t60 -180q0 -115 -40 -214t-114 -156.5t-175 -57.5q-114 0 -169 67.5t-55 184.5q0 112 41.5 209.5t116 154t170.5 56.5zM508 1405q-70 0 -124 -46.5t-84 -124.5t-30 -167q0 -186 156 -186q73 0 125.5 46.5t81.5 127.5t29 176q0 83 -39 128.5 t-115 45.5z" />
+<glyph unicode="&#xbb;" horiz-adv-x="860" d="M451 123l-58 49l314 336l-209 385l63 39l254 -418l-2 -27zM90 123l-57 49l313 336l-209 385l64 39l254 -418l-2 -27z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1481" d="M129 0zM1319 230h-131l-49 -229h-82l49 229h-391l21 76l506 577h86l-125 -581h133zM1121 302q61 294 79 365.5t29 105.5q-10 -16 -61 -79t-338 -392h291zM1323 1462l-1087 -1462h-107l1086 1462h108zM509 1462h80l-186 -876h-84l118 569q5 21 11.5 50.5t14 60t15.5 59 t15 49.5q-34 -31 -60 -51.5t-143 -93.5l-39 59z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1458" d="M53 0zM1278 1h-522l16 80l297 258q137 118 182.5 190.5t45.5 153.5q0 59 -38.5 97t-105.5 38q-95 0 -194 -76l-41 62q108 90 239 90q73 0 125 -27t78.5 -72t26.5 -100q0 -106 -59 -198.5t-183 -194.5l-266 -223h416zM431 1462h80l-186 -876h-84l118 569q5 21 11.5 50.5 t14 60t15.5 59t15 49.5q-34 -31 -60 -51.5t-143 -93.5l-39 59zM1247 1462l-1087 -1462h-107l1086 1462h108z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1458" d="M71 0zM1380 230h-131l-49 -229h-82l49 229h-391l21 76l506 577h86l-125 -581h133zM1182 302q61 294 79 365.5t29 105.5q-10 -16 -61 -79t-338 -392h291zM667 1276q0 -85 -48.5 -148t-154.5 -88v-4q66 -16 105.5 -68t39.5 -124q0 -77 -39 -141t-109 -99t-161 -35 q-59 0 -123.5 15.5t-105.5 40.5v90q46 -28 108 -48t125 -20q99 0 159 52.5t60 142.5q0 162 -196 162h-84l16 79h86q102 0 168.5 49.5t66.5 129.5q0 68 -37.5 102.5t-105.5 34.5q-100 0 -199 -68l-40 64q109 86 251 86q100 0 159 -56.5t59 -148.5zM1407 1462l-1087 -1462 h-107l1086 1462h108z" />
+<glyph unicode="&#xbf;" horiz-adv-x="799" d="M641 717l-6 -29q-28 -127 -79 -200t-161 -154q-118 -84 -175 -145.5t-86.5 -127.5t-29.5 -141q0 -106 65.5 -168.5t184.5 -62.5q141 0 308 100l38 -86q-85 -49 -170.5 -77.5t-187.5 -28.5q-159 0 -250.5 84.5t-91.5 228.5q0 133 70 240.5t227 220.5q85 61 133.5 109 t73 95t45.5 142h92zM713 1020q0 -56 -25.5 -88.5t-69.5 -32.5q-65 0 -65 72q0 56 25 89.5t67 33.5q68 0 68 -74z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM815 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM668 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM1007 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5 t92.5 -146.5v-29z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM911 1587q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5 q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM879 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM535 1704q0 49 20.5 78t56.5 29q54 0 54 -64 q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1059" d="M0 0zM805 520h-512l-287 -520h-117l822 1468h67l201 -1468h-105zM793 612l-39 291q-31 242 -39 402q-30 -63 -64.5 -130t-306.5 -563h449zM945 1600q0 -92 -57.5 -148.5t-145.5 -56.5q-93 0 -148 52t-55 145q0 88 59.5 144t149.5 56q88 0 142.5 -50t54.5 -142zM867 1598 q0 57 -33.5 90t-87.5 33q-60 0 -93.5 -36t-33.5 -93t33 -90t90 -33q56 0 90.5 36t34.5 93z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1640" d="M1403 0h-727l110 522h-444l-328 -522h-131l946 1462h883l-20 -94h-625l-117 -553h590l-20 -94h-588l-135 -627h626zM408 627h401l156 741h-88z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1169" d="M170 0zM961 1389q-197 0 -351.5 -104.5t-245 -304.5t-90.5 -441q0 -225 110.5 -346t317.5 -121q140 0 304 51v-94q-156 -49 -316 -49q-252 0 -386 145t-134 410q0 266 104.5 488t284.5 341t402 119q177 0 307 -68l-45 -90q-55 30 -124.5 47t-137.5 17zM752 -289 q0 -94 -75.5 -148.5t-217.5 -54.5q-46 0 -78 7v79q30 -6 72 -6q198 0 198 115q0 97 -151 107l110 190h80l-78 -137q140 -30 140 -152z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM891 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM654 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xca;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM1036 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1067" d="M102 0zM829 0h-727l310 1462h727l-21 -94h-624l-117 -553h590l-21 -94h-588l-135 -627h627zM902 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM558 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xcc;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM525 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM419 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xce;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM738 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xcf;" horiz-adv-x="504" d="M102 0zM102 0l310 1462h98l-309 -1462h-99zM604 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM260 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1352" d="M1288 879q0 -253 -109.5 -461.5t-300.5 -313t-446 -104.5h-330l144 676h-156l21 96h155l146 690h305q282 0 426.5 -147.5t144.5 -435.5zM430 90q226 0 394.5 94.5t261 275.5t92.5 412q0 498 -476 498h-206l-129 -598h378l-20 -96h-379l-125 -586h209z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1372" d="M102 0zM1069 0h-86l-516 1284h-8q-23 -149 -48 -273t-214 -1011h-95l310 1462h80l522 -1294h8q23 176 74 416l188 878h94zM1062 1587q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14 t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM989 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM844 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM1171 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM1077 1587q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z " />
+<glyph unicode="&#xd6;" horiz-adv-x="1464" d="M172 0zM1403 911q0 -255 -94 -481.5t-252 -338t-365 -111.5q-250 0 -385 149t-135 430q0 262 93 477.5t255 331t373 115.5q247 0 378.5 -148.5t131.5 -423.5zM879 1389q-174 0 -308.5 -101t-214.5 -298t-80 -417q0 -245 109.5 -373t319.5 -128q169 0 300 98.5t210 300 t79 430.5q0 240 -104.5 364t-310.5 124zM1031 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM687 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xd7;" d="M551 723l-330 332l70 69l330 -329l333 329l68 -67l-332 -334l332 -332l-68 -67l-333 329l-330 -327l-68 67z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1464" d="M1403 911q0 -187 -52 -365.5t-144.5 -304.5t-223 -193.5t-291.5 -67.5q-215 0 -348 112l-139 -170l-66 64l146 172q-113 149 -113 401q0 263 94 479.5t256.5 330.5t370.5 114q219 0 352 -121l133 168l70 -53l-145 -183q45 -51 72.5 -161t27.5 -222zM879 1389 q-134 0 -244 -59.5t-188.5 -170t-124.5 -267.5t-46 -319q0 -105 21.5 -191t56.5 -138l826 1032q-107 113 -301 113zM1294 901q0 85 -17.5 172t-43.5 129l-821 -1030q107 -100 293 -100q170 0 301 100t209.5 296.5t78.5 432.5z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM946 1579h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303 v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM838 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5 t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM1148 1579h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54 v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1370" d="M176 0zM1395 1462l-207 -977q-58 -270 -197 -387.5t-375 -117.5q-440 0 -440 401q0 83 27 201l186 880h103l-193 -899q-20 -89 -20 -184q0 -309 342 -309q195 0 307.5 96.5t158.5 318.5l207 977h101zM1022 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29 q-55 0 -55 63zM678 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xdd;" horiz-adv-x="965" d="M193 0zM494 645l544 817h117l-631 -932l-108 -530h-105l119 545l-237 917h100zM563 1600q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xde;" horiz-adv-x="1145" d="M1087 836q0 -247 -153 -373.5t-457 -126.5h-201l-71 -336h-103l310 1462h102l-57 -266h213q200 0 308.5 -92.5t108.5 -267.5zM293 428h190q256 0 376 98.5t120 302.5q0 275 -330 275h-211z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1094" d="M-162 -492q-73 0 -119 23v90q53 -24 115 -24q79 0 123 50.5t66 153.5l305 1409q80 357 405 357q137 0 215 -61.5t78 -174.5q0 -75 -44.5 -140.5t-166.5 -148.5q-107 -76 -141.5 -124.5t-34.5 -106.5q0 -51 34 -88.5t93 -75.5q96 -63 138 -133.5t42 -165.5 q0 -170 -106.5 -269t-286.5 -99q-143 0 -234 65v109q45 -36 112.5 -59t129.5 -23q132 0 208.5 71t76.5 195q0 75 -31.5 129t-109.5 108q-82 58 -119 110.5t-37 121.5q0 57 21 103t60.5 88.5t137.5 113.5q101 70 131.5 116t30.5 101q0 70 -55 110t-150 40q-129 0 -205 -76 t-108 -229l-291 -1377q-33 -152 -103.5 -220.5t-179.5 -68.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM809 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM586 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM955 1243h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM858 1249q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173 t-124.5 -55z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM835 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM491 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1133" d="M102 0zM655 1104q232 0 279 -219h6l59 202h80l-229 -1087h-82l45 274h-6q-84 -142 -187 -218t-237 -76q-281 0 -281 374q0 197 75 376t200.5 276.5t277.5 97.5zM406 70q89 0 177.5 62t159 166t107.5 230t37 213q0 79 -26 141.5t-77 99t-127 36.5q-124 0 -224 -82 t-164 -245.5t-64 -325.5q0 -152 50 -223.5t151 -71.5zM927 1448q0 -92 -57.5 -148.5t-145.5 -56.5q-93 0 -148 52t-55 145q0 88 59.5 144t149.5 56q88 0 142.5 -50t54.5 -142zM849 1446q0 57 -33.5 90t-87.5 33q-60 0 -93.5 -36t-33.5 -93t33 -90t90 -33q56 0 90.5 36 t34.5 93z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1602" d="M1155 -20q-123 0 -211 60t-117 165l-39 -205h-77l41 254h-9q-94 -142 -189 -208t-208 -66q-120 0 -182 94t-62 270q0 206 70.5 384.5t192.5 277t274 98.5q106 0 166 -56.5t74 -156.5h10l59 192h66l-35 -186q139 207 350 207q112 0 175 -61.5t63 -172.5 q0 -179 -158.5 -271.5t-470.5 -92.5h-39q-8 -51 -8 -96q0 -161 69.5 -250.5t217.5 -89.5q69 0 133.5 21t130.5 52v-94q-80 -37 -147 -53t-140 -16zM369 70q67 0 138.5 42t134 117.5t106 170.5t63.5 199t20 165q0 118 -49 186t-141 68q-123 0 -223 -86t-156.5 -240 t-56.5 -340q0 -150 42.5 -216t121.5 -66zM1317 1018q-119 0 -232 -115.5t-172 -308.5h48q263 0 383 67t120 203q0 71 -38.5 112.5t-108.5 41.5z" />
+<glyph unicode="&#xe7;" horiz-adv-x="887" d="M102 0zM477 -20q-174 0 -274.5 110.5t-100.5 306.5q0 193 73.5 361.5t198.5 257t290 88.5q134 0 241 -43l-28 -90q-107 47 -218 47q-129 0 -232.5 -77t-162.5 -222t-59 -320q0 -158 73.5 -243.5t208.5 -85.5q71 0 131.5 13t131.5 46v-92q-116 -57 -273 -57zM574 -289 q0 -94 -75.5 -148.5t-217.5 -54.5q-46 0 -78 7v79q30 -6 72 -6q198 0 198 115q0 97 -151 107l110 190h80l-78 -137q140 -30 140 -152z" />
+<glyph unicode="&#xe8;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM751 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM532 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xea;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM904 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xeb;" horiz-adv-x="928" d="M102 0zM469 -20q-173 0 -270 109.5t-97 305.5q0 181 71 347t195.5 264t274.5 98q114 0 182 -61t68 -166q0 -181 -163.5 -276t-485.5 -95h-33q-6 -44 -6 -98q0 -165 74 -251.5t213 -86.5q132 0 276 73v-94q-140 -69 -299 -69zM631 1018q-131 0 -243.5 -115.5 t-162.5 -308.5h49q517 0 517 270q0 67 -43.5 110.5t-116.5 43.5zM780 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM436 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xec;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM454 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM284 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xee;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM642 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xef;" horiz-adv-x="475" d="M76 0zM174 0h-98l231 1087h96zM515 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM171 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1124" d="M713 1364q-54 60 -158 139l59 68q32 -26 81 -66t100 -94l266 150l39 -74l-256 -141q87 -116 131.5 -276t44.5 -335q0 -355 -141.5 -555t-399.5 -200q-177 0 -277 106.5t-100 294.5q0 170 63 301.5t178.5 203.5t262.5 72q107 0 188 -49.5t121 -142.5h5q0 139 -43 289 t-115 243l-295 -163l-39 73zM489 70q118 0 208.5 61t144 186.5t53.5 270.5q0 77 -35 142t-100 101.5t-156 36.5q-124 0 -213.5 -61.5t-137.5 -169.5t-48 -248q0 -153 73.5 -236t210.5 -83z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1143" d="M76 0zM764 0l149 692q21 92 21 156q0 80 -43.5 125t-134.5 45q-112 0 -210.5 -67t-166 -187.5t-103.5 -286.5l-102 -477h-98l231 1087h82l-37 -221h6q164 238 416 238q130 0 195 -64t65 -184q0 -70 -24 -182l-148 -674h-98zM874 1249q-40 0 -77.5 19t-75.5 45 q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM744 1241h-66q-50 52 -114 144.5t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM573 1262q66 51 150.5 142t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM941 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM839 1249q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1124" d="M98 0zM649 1108q180 0 278.5 -108.5t98.5 -299.5q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5 q0 154 -73 237t-210 83zM812 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM468 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xf7;" d="M168 672v100h903v-100h-903zM522 373q0 106 96 106q48 0 73.5 -27.5t25.5 -78.5q0 -57 -29 -82t-70 -25q-96 0 -96 107zM522 1071q0 107 96 107q46 0 72.5 -27.5t26.5 -79.5q0 -57 -29 -81.5t-70 -24.5q-96 0 -96 106z" />
+<glyph unicode="&#xf8;" horiz-adv-x="1124" d="M164 127q-66 106 -66 276q0 191 73 358t197 257t281 90q150 0 250 -82l109 133l65 -53l-117 -143q70 -105 70 -263q0 -197 -71.5 -368.5t-195.5 -261.5t-286 -90q-163 0 -254 83l-110 -135l-64 54zM924 702q0 101 -35 179l-608 -742q67 -73 202 -73q127 0 225.5 77.5 t157 228t58.5 330.5zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -125 32 -197l605 739q-74 72 -197 72z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM774 1241h-66q-50 52 -114 144.5 t-99 162.5v21h115q46 -129 164 -303v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM627 1262q66 51 150.5 142 t129.5 165h137v-23q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM957 1241h-49q-70 60 -161 207 q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1143" d="M109 0zM381 1087l-152 -698q-22 -106 -22 -158q0 -74 47.5 -117.5t138.5 -43.5q110 0 207.5 65.5t164 187t99.5 279.5l105 485h98l-231 -1087h-80l28 205h-6q-167 -221 -403 -221q-131 0 -198.5 62t-67.5 181q0 60 22 170l150 690h100zM827 1366q0 49 20.5 78t56.5 29 q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM483 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#xfd;" horiz-adv-x="920" d="M0 0zM123 1087h100l82 -548q51 -351 55 -449h11q43 105 186 367l348 630h103l-713 -1290q-72 -127 -122.5 -178t-114 -81t-146.5 -30q-68 0 -129 21v92q71 -27 137 -27q80 0 147 49.5t130 164.5t100 184zM505 1262q66 51 150.5 142t129.5 165h137v-23 q-51 -66 -157.5 -158.5t-192.5 -146.5h-67v21z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1163" d="M498 -16q-230 0 -279 219h-4q-13 -72 -149 -695h-99l434 2048h99q-114 -535 -164 -751h6q93 156 199 229.5t231 73.5q133 0 206 -92.5t73 -282.5q0 -195 -72 -371t-197.5 -277t-283.5 -101zM748 1018q-86 0 -172.5 -57.5t-162.5 -169.5t-111.5 -238t-35.5 -207 q0 -125 61.5 -200.5t168.5 -75.5q124 0 225 84t164 243.5t63 325.5q0 295 -200 295z" />
+<glyph unicode="&#xff;" horiz-adv-x="920" d="M0 0zM123 1087h100l82 -548q51 -351 55 -449h11q43 105 186 367l348 630h103l-713 -1290q-72 -127 -122.5 -178t-114 -81t-146.5 -30q-68 0 -129 21v92q71 -27 137 -27q80 0 147 49.5t130 164.5t100 184zM698 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77 t-55 -29q-55 0 -55 63zM354 1366q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#x131;" horiz-adv-x="475" d="M174 0h-98l231 1087h96z" />
+<glyph unicode="&#x152;" horiz-adv-x="1767" d="M1530 0h-666q-25 -6 -77.5 -13t-94.5 -7q-251 0 -385.5 149.5t-134.5 429.5q0 263 96 482t262 330.5t381 111.5q130 0 240 -21h688l-20 -94h-625l-117 -553h590l-20 -94h-588l-135 -627h626zM705 72q68 0 116 12l271 1290q-110 15 -189 15q-182 0 -321.5 -98.5 t-222.5 -293.5t-83 -424q0 -245 109 -373t320 -128z" />
+<glyph unicode="&#x153;" horiz-adv-x="1720" d="M1262 -20q-135 0 -228 69t-125 201q-65 -127 -179 -198.5t-257 -71.5q-184 0 -279.5 109.5t-95.5 313.5q0 191 73 358t197 257t281 90q141 0 237 -74.5t126 -212.5q70 132 182.5 207.5t241.5 75.5q114 0 182 -61t68 -166q0 -181 -163.5 -276t-486.5 -95h-32 q-7 -38 -7 -98q0 -165 74 -251.5t213 -86.5q133 0 277 73v-94q-140 -69 -299 -69zM641 1022q-124 0 -223 -78.5t-158 -225t-59 -310.5q0 -342 282 -342q127 0 225.5 77.5t157 228t58.5 330.5q0 154 -73 237t-210 83zM1423 1018q-131 0 -243 -115t-162 -309h49q516 0 516 270 q0 70 -44.5 112t-115.5 42z" />
+<glyph unicode="&#x178;" horiz-adv-x="965" d="M193 0zM494 645l544 817h117l-631 -932l-108 -530h-105l119 545l-237 917h100zM798 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63zM454 1704q0 49 20.5 78t56.5 29q54 0 54 -64q0 -48 -21 -77t-55 -29q-55 0 -55 63z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1135" d="M958 1241h-49q-70 60 -161 207q-55 -57 -125 -114.5t-125 -92.5h-54v29q68 56 157.5 148.5t127.5 150.5h64q23 -64 72.5 -152.5t92.5 -146.5v-29z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M967 1448q0 -92 -57.5 -148.5t-145.5 -56.5q-93 0 -148 52t-55 145q0 88 59.5 144t149.5 56q88 0 142.5 -50t54.5 -142zM889 1446q0 57 -33.5 90t-87.5 33q-60 0 -93.5 -36t-33.5 -93t33 -90t90 -33q56 0 90.5 36t34.5 93z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1135" d="M831 1249q-40 0 -77.5 19t-75.5 45q-34 23 -64.5 41t-68.5 18q-45 0 -74 -28.5t-51 -100.5h-74q19 108 71 166.5t134 58.5q41 0 73.5 -14t117.5 -72q52 -36 94 -36q43 0 71.5 30.5t46.5 100.5h76q-26 -118 -74.5 -173t-124.5 -55z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#x2011;" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#x2012;" horiz-adv-x="629" d="M82 502l18 90h457l-16 -90h-459z" />
+<glyph unicode="&#x2013;" horiz-adv-x="983" d="M66 502l18 90h807l-17 -90h-808z" />
+<glyph unicode="&#x2014;" horiz-adv-x="1966" d="M68 502l18 90h1788l-16 -90h-1790z" />
+<glyph unicode="&#x2018;" horiz-adv-x="299" d="M133 961l-4 22q41 100 116 231t161 248h73q-66 -106 -129.5 -242.5t-103.5 -258.5h-113z" />
+<glyph unicode="&#x2019;" horiz-adv-x="299" d="M475 1462l4 -22q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 106 129.5 242.5t103.5 258.5h113z" />
+<glyph unicode="&#x201a;" horiz-adv-x="451" d="M246 238l4 -23q-40 -97 -115.5 -230t-161.5 -249h-73q68 110 131.5 248t101.5 254h113z" />
+<glyph unicode="&#x201c;" horiz-adv-x="631" d="M133 961l-4 22q41 100 116 231t161 248h73q-66 -106 -129.5 -242.5t-103.5 -258.5h-113zM467 961l-4 22q43 104 120 238.5t156 240.5h74q-66 -106 -129.5 -242.5t-103.5 -258.5h-113z" />
+<glyph unicode="&#x201d;" horiz-adv-x="631" d="M809 1462l4 -22q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 106 129.5 242.5t103.5 258.5h113zM475 1462l4 -22q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 106 129.5 242.5t103.5 258.5h113z" />
+<glyph unicode="&#x201e;" horiz-adv-x="776" d="M561 238l4 -23q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q66 108 129 242.5t105 259.5h112zM227 238l4 -23q-43 -105 -117.5 -235.5t-158.5 -243.5h-74q73 119 135.5 254.5t98.5 247.5h112z" />
+<glyph unicode="&#x2022;" horiz-adv-x="793" d="M248 682q0 137 63 213t172 76q76 0 116 -39.5t40 -118.5q0 -125 -66 -207t-176 -82q-149 0 -149 158z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1489" d="M69 0zM69 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73zM569 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73zM1071 55q0 56 25 88.5t69 32.5q66 0 66 -72q0 -53 -25 -87.5t-67 -34.5q-68 0 -68 73z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="537" d="M451 932l57 -49l-318 -336l213 -385l-63 -39l-254 418l2 26z" />
+<glyph unicode="&#x203a;" horiz-adv-x="537" d="M94 123l-57 49l317 336l-213 385l64 39l254 -418l-2 -27z" />
+<glyph unicode="&#x2044;" horiz-adv-x="274" d="M731 1462l-1087 -1462h-107l1086 1462h108z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="643" d="M657 815h-131l-49 -229h-82l49 229h-391l21 76l506 577h86l-125 -581h133zM459 887q61 294 79 365.5t29 105.5q-10 -16 -61 -79t-338 -392h291z" />
+<glyph unicode="&#x20ac;" d="M991 1389q-186 0 -330.5 -120.5t-226.5 -346.5h457l-21 -82h-460q-30 -98 -39 -217h442l-20 -82h-424q0 -243 89 -356t265 -113q115 0 252 57v-94q-129 -55 -270 -55q-209 0 -325 139.5t-116 394.5v27h-184l16 82h172q5 101 35 217h-170l19 82h174q95 273 270 417 t399 144q166 0 287 -90l-53 -82q-102 78 -238 78z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1534" d="M477 741h-86v643h-217v78h522v-78h-219v-643zM1077 741l-221 609h-6l4 -201v-408h-82v721h125l221 -606l223 606h125v-721h-86v398l4 207h-6l-227 -605h-74z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1085" d="M0 1085h1085v-1085h-1085v1085z" />
+<glyph horiz-adv-x="1133" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+<hkern g1="uniFB00" u2="&#x201d;" k="-123" />
+<hkern g1="uniFB00" u2="&#x2019;" k="-123" />
+<hkern g1="uniFB00" u2="&#x27;" k="-123" />
+<hkern g1="uniFB00" u2="&#x22;" k="-123" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff
new file mode 100644 (file)
index 0000000..43e8b9e
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-LightItalic-webfont.woff differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot
new file mode 100644 (file)
index 0000000..6bbc3cf
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.eot differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.svg b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.svg
new file mode 100644 (file)
index 0000000..25a3952
--- /dev/null
@@ -0,0 +1,1831 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="open_sansregular" horiz-adv-x="1171" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="532" />
+<glyph unicode="&#xfb01;" horiz-adv-x="1212" d="M29 0zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1036 0h-166v1096h166v-1096zM856 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5 q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="&#xfb02;" horiz-adv-x="1212" d="M29 0zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1036 0h-166v1556h166v-1556z" />
+<glyph unicode="&#xfb03;" horiz-adv-x="1909" d="M29 0zM1358 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31 q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1731 0h-166v1096h166v-1096zM1551 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="&#xfb04;" horiz-adv-x="1909" d="M29 0zM1358 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31 q-94 0 -139 -62.5t-45 -200.5v-71h279v-129zM1731 0h-166v1556h166v-1556z" />
+<glyph horiz-adv-x="2048" />
+<glyph horiz-adv-x="2048" />
+<glyph unicode="&#xd;" horiz-adv-x="1044" />
+<glyph unicode=" "  horiz-adv-x="532" />
+<glyph unicode="&#x09;" horiz-adv-x="532" />
+<glyph unicode="&#xa0;" horiz-adv-x="532" />
+<glyph unicode="!" horiz-adv-x="547" d="M326 403h-105l-51 1059h207zM152 106q0 136 120 136q58 0 89.5 -35t31.5 -101q0 -64 -32 -99.5t-89 -35.5q-52 0 -86 31.5t-34 103.5z" />
+<glyph unicode="&#x22;" horiz-adv-x="821" d="M319 1462l-40 -528h-105l-41 528h186zM688 1462l-41 -528h-104l-41 528h186z" />
+<glyph unicode="#" horiz-adv-x="1323" d="M981 899l-66 -340h283v-129h-307l-84 -430h-137l84 430h-303l-82 -430h-136l80 430h-262v129h287l68 340h-277v127h299l82 436h139l-82 -436h305l84 436h134l-84 -436h264v-127h-289zM475 559h303l66 340h-303z" />
+<glyph unicode="$" d="M1036 449q0 -136 -102 -224.5t-285 -111.5v-232h-129v223q-112 0 -217 17.5t-172 48.5v156q83 -37 191.5 -60.5t197.5 -23.5v440q-205 65 -287.5 151t-82.5 222q0 131 101.5 215t268.5 102v182h129v-180q184 -5 355 -74l-52 -131q-149 59 -303 70v-434q157 -50 235 -97.5 t115 -109t37 -149.5zM866 436q0 72 -44.5 116.5t-172.5 88.5v-389q217 30 217 184zM319 1057q0 -76 45 -122t156 -87v387q-99 -16 -150 -62.5t-51 -115.5z" />
+<glyph unicode="%" horiz-adv-x="1686" d="M242 1026q0 -170 37 -255t120 -85q164 0 164 340q0 338 -164 338q-83 0 -120 -84t-37 -254zM700 1026q0 -228 -76.5 -344.5t-224.5 -116.5q-140 0 -217.5 119t-77.5 342q0 227 74.5 342t220.5 115q145 0 223 -119t78 -338zM1122 440q0 -171 37 -255.5t121 -84.5t124 83.5 t40 256.5q0 171 -40 253.5t-124 82.5t-121 -82.5t-37 -253.5zM1581 440q0 -227 -76.5 -343.5t-224.5 -116.5q-142 0 -218.5 119t-76.5 341q0 227 74.5 342t220.5 115q142 0 221.5 -117.5t79.5 -339.5zM1323 1462l-811 -1462h-147l811 1462h147z" />
+<glyph unicode="&#x26;" horiz-adv-x="1495" d="M414 1171q0 -69 36 -131.5t123 -150.5q129 75 179.5 138.5t50.5 146.5q0 77 -51.5 125.5t-137.5 48.5q-89 0 -144.5 -48t-55.5 -129zM569 129q241 0 400 154l-437 424q-111 -68 -157 -112.5t-68 -95.5t-22 -116q0 -117 77.5 -185.5t206.5 -68.5zM113 379q0 130 69.5 230 t249.5 202q-85 95 -115.5 144t-48.5 102t-18 110q0 150 98 234t273 84q162 0 255 -83.5t93 -232.5q0 -107 -68 -197.5t-225 -183.5l407 -391q56 62 89.5 145.5t56.5 182.5h168q-68 -286 -205 -434l299 -291h-229l-185 178q-118 -106 -240 -152t-272 -46q-215 0 -333.5 106 t-118.5 293z" />
+<glyph unicode="'" horiz-adv-x="453" d="M319 1462l-40 -528h-105l-41 528h186z" />
+<glyph unicode="(" horiz-adv-x="606" d="M82 561q0 265 77.5 496t223.5 405h162q-144 -193 -216.5 -424t-72.5 -475q0 -240 74 -469t213 -418h-160q-147 170 -224 397t-77 488z" />
+<glyph unicode=")" horiz-adv-x="606" d="M524 561q0 -263 -77.5 -490t-223.5 -395h-160q139 188 213 417.5t74 469.5q0 244 -72.5 475t-216.5 424h162q147 -175 224 -406.5t77 -494.5z" />
+<glyph unicode="*" horiz-adv-x="1130" d="M657 1556l-43 -395l398 111l26 -182l-381 -31l248 -326l-172 -94l-176 362l-160 -362l-176 94l242 326l-377 31l29 182l391 -111l-43 395h194z" />
+<glyph unicode="+" d="M653 791h412v-138h-412v-426h-139v426h-410v138h410v428h139v-428z" />
+<glyph unicode="," horiz-adv-x="502" d="M350 238l15 -23q-26 -100 -75 -232.5t-102 -246.5h-125q27 104 59.5 257t45.5 245h182z" />
+<glyph unicode="-" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="." horiz-adv-x="545" d="M152 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode="/" horiz-adv-x="752" d="M731 1462l-545 -1462h-166l545 1462h166z" />
+<glyph unicode="0" d="M1069 733q0 -379 -119.5 -566t-365.5 -187q-236 0 -359 191.5t-123 561.5q0 382 119 567t363 185q238 0 361.5 -193t123.5 -559zM270 733q0 -319 75 -464.5t239 -145.5q166 0 240.5 147.5t74.5 462.5t-74.5 461.5t-240.5 146.5q-164 0 -239 -144.5t-75 -463.5z" />
+<glyph unicode="1" d="M715 0h-162v1042q0 130 8 246q-21 -21 -47 -44t-238 -195l-88 114l387 299h140v-1462z" />
+<glyph unicode="2" d="M1061 0h-961v143l385 387q176 178 232 254t84 148t28 155q0 117 -71 185.5t-197 68.5q-91 0 -172.5 -30t-181.5 -109l-88 113q202 168 440 168q206 0 323 -105.5t117 -283.5q0 -139 -78 -275t-292 -344l-320 -313v-8h752v-154z" />
+<glyph unicode="3" d="M1006 1118q0 -140 -78.5 -229t-222.5 -119v-8q176 -22 261 -112t85 -236q0 -209 -145 -321.5t-412 -112.5q-116 0 -212.5 17.5t-187.5 61.5v158q95 -47 202.5 -71.5t203.5 -24.5q379 0 379 297q0 266 -418 266h-144v143h146q171 0 271 75.5t100 209.5q0 107 -73.5 168 t-199.5 61q-96 0 -181 -26t-194 -96l-84 112q90 71 207.5 111.5t247.5 40.5q213 0 331 -97.5t118 -267.5z" />
+<glyph unicode="4" d="M1130 336h-217v-336h-159v336h-711v145l694 989h176v-983h217v-151zM754 487v486q0 143 10 323h-8q-48 -96 -90 -159l-457 -650h545z" />
+<glyph unicode="5" d="M557 893q231 0 363.5 -114.5t132.5 -313.5q0 -227 -144.5 -356t-398.5 -129q-247 0 -377 79v160q70 -45 174 -70.5t205 -25.5q176 0 273.5 83t97.5 240q0 306 -375 306q-95 0 -254 -29l-86 55l55 684h727v-153h-585l-37 -439q115 23 229 23z" />
+<glyph unicode="6" d="M117 625q0 431 167.5 644.5t495.5 213.5q113 0 178 -19v-143q-77 25 -176 25q-235 0 -359 -146.5t-136 -460.5h12q110 172 348 172q197 0 310.5 -119t113.5 -323q0 -228 -124.5 -358.5t-336.5 -130.5q-227 0 -360 170.5t-133 474.5zM608 121q142 0 220.5 89.5t78.5 258.5 q0 145 -73 228t-218 83q-90 0 -165 -37t-119.5 -102t-44.5 -135q0 -103 40 -192t113.5 -141t167.5 -52z" />
+<glyph unicode="7" d="M285 0l606 1309h-797v153h973v-133l-598 -1329h-184z" />
+<glyph unicode="8" d="M584 1483q200 0 317 -93t117 -257q0 -108 -67 -197t-214 -162q178 -85 253 -178.5t75 -216.5q0 -182 -127 -290.5t-348 -108.5q-234 0 -360 102.5t-126 290.5q0 251 306 391q-138 78 -198 168.5t-60 202.5q0 159 117.5 253.5t314.5 94.5zM268 369q0 -120 83.5 -187 t234.5 -67q149 0 232 70t83 192q0 97 -78 172.5t-272 146.5q-149 -64 -216 -141.5t-67 -185.5zM582 1348q-125 0 -196 -60t-71 -160q0 -92 59 -158t218 -132q143 60 202.5 129t59.5 161q0 101 -72.5 160.5t-199.5 59.5z" />
+<glyph unicode="9" d="M1061 838q0 -858 -664 -858q-116 0 -184 20v143q80 -26 182 -26q240 0 362.5 148.5t133.5 455.5h-12q-55 -83 -146 -126.5t-205 -43.5q-194 0 -308 116t-114 324q0 228 127.5 360t335.5 132q149 0 260.5 -76.5t171.5 -223t60 -345.5zM569 1341q-143 0 -221 -92t-78 -256 q0 -144 72 -226.5t219 -82.5q91 0 167.5 37t120.5 101t44 134q0 105 -41 194t-114.5 140t-168.5 51z" />
+<glyph unicode=":" horiz-adv-x="545" d="M152 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5zM152 989q0 135 118 135q123 0 123 -135q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode=";" horiz-adv-x="545" d="M350 238l15 -23q-26 -100 -75 -232.5t-102 -246.5h-125q27 104 59.5 257t45.5 245h182zM147 989q0 135 119 135q123 0 123 -135q0 -65 -33 -100t-90 -35q-58 0 -88.5 35t-30.5 100z" />
+<glyph unicode="&#x3c;" d="M1065 242l-961 422v98l961 479v-149l-782 -371l782 -328v-151z" />
+<glyph unicode="=" d="M119 858v137h930v-137h-930zM119 449v137h930v-137h-930z" />
+<glyph unicode="&#x3e;" d="M104 393l783 326l-783 373v149l961 -479v-98l-961 -422v151z" />
+<glyph unicode="?" horiz-adv-x="879" d="M289 403v54q0 117 36 192.5t134 159.5q136 115 171.5 173t35.5 140q0 102 -65.5 157.5t-188.5 55.5q-79 0 -154 -18.5t-172 -67.5l-59 135q189 99 395 99q191 0 297 -94t106 -265q0 -73 -19.5 -128.5t-57.5 -105t-164 -159.5q-101 -86 -133.5 -143t-32.5 -152v-33h-129z M240 106q0 136 120 136q58 0 89.5 -35t31.5 -101q0 -64 -32 -99.5t-89 -35.5q-52 0 -86 31.5t-34 103.5z" />
+<glyph unicode="@" horiz-adv-x="1841" d="M1720 729q0 -142 -44 -260t-124 -183t-184 -65q-86 0 -145 52t-70 133h-8q-40 -87 -114.5 -136t-176.5 -49q-150 0 -234.5 102.5t-84.5 278.5q0 204 118 331.5t310 127.5q68 0 154 -12.5t155 -34.5l-25 -470v-22q0 -178 133 -178q91 0 148 107.5t57 279.5q0 181 -74 317 t-210.5 209.5t-313.5 73.5q-223 0 -388 -92.5t-252 -264t-87 -396.5q0 -305 161 -469t464 -164q210 0 436 86v-133q-192 -84 -436 -84q-363 0 -563.5 199.5t-200.5 557.5q0 260 107 463t305 314.5t454 111.5q215 0 382.5 -90.5t259 -257t91.5 -383.5zM686 598 q0 -254 195 -254q207 0 225 313l14 261q-72 20 -157 20q-130 0 -203.5 -90t-73.5 -250z" />
+<glyph unicode="A" horiz-adv-x="1296" d="M1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473z" />
+<glyph unicode="B" horiz-adv-x="1327" d="M201 1462h413q291 0 421 -87t130 -275q0 -130 -72.5 -214.5t-211.5 -109.5v-10q333 -57 333 -350q0 -196 -132.5 -306t-370.5 -110h-510v1462zM371 836h280q180 0 259 56.5t79 190.5q0 123 -88 177.5t-280 54.5h-250v-479zM371 692v-547h305q177 0 266.5 68.5t89.5 214.5 q0 136 -91.5 200t-278.5 64h-291z" />
+<glyph unicode="C" horiz-adv-x="1292" d="M827 1331q-241 0 -380.5 -160.5t-139.5 -439.5q0 -287 134.5 -443.5t383.5 -156.5q153 0 349 55v-149q-152 -57 -375 -57q-323 0 -498.5 196t-175.5 557q0 226 84.5 396t244 262t375.5 92q230 0 402 -84l-72 -146q-166 78 -332 78z" />
+<glyph unicode="D" horiz-adv-x="1493" d="M1368 745q0 -362 -196.5 -553.5t-565.5 -191.5h-405v1462h448q341 0 530 -189t189 -528zM1188 739q0 286 -143.5 431t-426.5 145h-247v-1168h207q304 0 457 149.5t153 442.5z" />
+<glyph unicode="E" horiz-adv-x="1139" d="M1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152z" />
+<glyph unicode="F" horiz-adv-x="1057" d="M371 0h-170v1462h815v-151h-645v-535h606v-151h-606v-625z" />
+<glyph unicode="G" horiz-adv-x="1491" d="M844 766h497v-711q-116 -37 -236 -56t-278 -19q-332 0 -517 197.5t-185 553.5q0 228 91.5 399.5t263.5 262t403 90.5q234 0 436 -86l-66 -150q-198 84 -381 84q-267 0 -417 -159t-150 -441q0 -296 144.5 -449t424.5 -153q152 0 297 35v450h-327v152z" />
+<glyph unicode="H" horiz-adv-x="1511" d="M1311 0h-170v688h-770v-688h-170v1462h170v-622h770v622h170v-1462z" />
+<glyph unicode="I" horiz-adv-x="571" d="M201 0v1462h170v-1462h-170z" />
+<glyph unicode="J" horiz-adv-x="547" d="M-12 -385q-94 0 -148 27v145q71 -20 148 -20q99 0 150.5 60t51.5 173v1462h170v-1448q0 -190 -96 -294.5t-276 -104.5z" />
+<glyph unicode="K" horiz-adv-x="1257" d="M1257 0h-200l-533 709l-153 -136v-573h-170v1462h170v-725l663 725h201l-588 -635z" />
+<glyph unicode="L" horiz-adv-x="1063" d="M201 0v1462h170v-1308h645v-154h-815z" />
+<glyph unicode="M" horiz-adv-x="1849" d="M848 0l-496 1296h-8q14 -154 14 -366v-930h-157v1462h256l463 -1206h8l467 1206h254v-1462h-170v942q0 162 14 352h-8l-500 -1294h-137z" />
+<glyph unicode="N" horiz-adv-x="1544" d="M1343 0h-194l-799 1227h-8q16 -216 16 -396v-831h-157v1462h192l797 -1222h8q-2 27 -9 173.5t-5 209.5v839h159v-1462z" />
+<glyph unicode="O" horiz-adv-x="1595" d="M1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5z" />
+<glyph unicode="P" horiz-adv-x="1233" d="M1128 1036q0 -222 -151.5 -341.5t-433.5 -119.5h-172v-575h-170v1462h379q548 0 548 -426zM371 721h153q226 0 327 73t101 234q0 145 -95 216t-296 71h-190v-594z" />
+<glyph unicode="Q" horiz-adv-x="1595" d="M1470 733q0 -281 -113 -467t-319 -252l348 -362h-247l-285 330l-55 -2q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5 q-243 0 -369.5 -153.5t-126.5 -446.5z" />
+<glyph unicode="R" horiz-adv-x="1266" d="M371 608v-608h-170v1462h401q269 0 397.5 -103t128.5 -310q0 -290 -294 -392l397 -657h-201l-354 608h-305zM371 754h233q180 0 264 71.5t84 214.5q0 145 -85.5 209t-274.5 64h-221v-559z" />
+<glyph unicode="S" horiz-adv-x="1124" d="M1026 389q0 -193 -140 -301t-380 -108q-260 0 -400 67v164q90 -38 196 -60t210 -22q170 0 256 64.5t86 179.5q0 76 -30.5 124.5t-102 89.5t-217.5 93q-204 73 -291.5 173t-87.5 261q0 169 127 269t336 100q218 0 401 -80l-53 -148q-181 76 -352 76q-135 0 -211 -58 t-76 -161q0 -76 28 -124.5t94.5 -89t203.5 -89.5q230 -82 316.5 -176t86.5 -244z" />
+<glyph unicode="T" horiz-adv-x="1133" d="M651 0h-170v1311h-463v151h1096v-151h-463v-1311z" />
+<glyph unicode="U" horiz-adv-x="1491" d="M1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170z" />
+<glyph unicode="V" horiz-adv-x="1219" d="M1036 1462h183l-527 -1462h-168l-524 1462h180l336 -946q58 -163 92 -317q36 162 94 323z" />
+<glyph unicode="W" horiz-adv-x="1896" d="M1477 0h-168l-295 979q-21 65 -47 164t-27 119q-22 -132 -70 -289l-286 -973h-168l-389 1462h180l231 -903q48 -190 70 -344q27 183 80 358l262 889h180l275 -897q48 -155 81 -350q19 142 72 346l230 901h180z" />
+<glyph unicode="X" horiz-adv-x="1182" d="M1174 0h-193l-393 643l-400 -643h-180l486 764l-453 698h188l363 -579l366 579h181l-453 -692z" />
+<glyph unicode="Y" horiz-adv-x="1147" d="M573 731l390 731h184l-488 -895v-567h-172v559l-487 903h186z" />
+<glyph unicode="Z" horiz-adv-x="1169" d="M1087 0h-1005v133l776 1176h-752v153h959v-133l-776 -1175h798v-154z" />
+<glyph unicode="[" horiz-adv-x="674" d="M623 -324h-457v1786h457v-141h-289v-1503h289v-142z" />
+<glyph unicode="\" horiz-adv-x="752" d="M186 1462l547 -1462h-166l-544 1462h163z" />
+<glyph unicode="]" horiz-adv-x="674" d="M51 -182h289v1503h-289v141h457v-1786h-457v142z" />
+<glyph unicode="^" horiz-adv-x="1110" d="M49 551l434 922h99l477 -922h-152l-372 745l-334 -745h-152z" />
+<glyph unicode="_" horiz-adv-x="918" d="M922 -315h-926v131h926v-131z" />
+<glyph unicode="`" horiz-adv-x="1182" d="M786 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="a" horiz-adv-x="1139" d="M850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85t88.5 238 v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47z" />
+<glyph unicode="b" horiz-adv-x="1255" d="M686 1114q216 0 335.5 -147.5t119.5 -417.5t-120.5 -419.5t-334.5 -149.5q-107 0 -195.5 39.5t-148.5 121.5h-12l-35 -141h-119v1556h166v-378q0 -127 -8 -228h8q116 164 344 164zM662 975q-170 0 -245 -97.5t-75 -328.5t77 -330.5t247 -99.5q153 0 228 111.5t75 320.5 q0 214 -75 319t-232 105z" />
+<glyph unicode="c" horiz-adv-x="975" d="M614 -20q-238 0 -368.5 146.5t-130.5 414.5q0 275 132.5 425t377.5 150q79 0 158 -17t124 -40l-51 -141q-55 22 -120 36.5t-115 14.5q-334 0 -334 -426q0 -202 81.5 -310t241.5 -108q137 0 281 59v-147q-110 -57 -277 -57z" />
+<glyph unicode="d" horiz-adv-x="1255" d="M922 147h-9q-115 -167 -344 -167q-215 0 -334.5 147t-119.5 418t120 421t334 150q223 0 342 -162h13l-7 79l-4 77v446h166v-1556h-135zM590 119q170 0 246.5 92.5t76.5 298.5v35q0 233 -77.5 332.5t-247.5 99.5q-146 0 -223.5 -113.5t-77.5 -320.5q0 -210 77 -317 t226 -107z" />
+<glyph unicode="e" horiz-adv-x="1149" d="M639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5t-200 83.5z " />
+<glyph unicode="f" horiz-adv-x="694" d="M670 967h-279v-967h-166v967h-196v75l196 60v61q0 404 353 404q87 0 204 -35l-43 -133q-96 31 -164 31q-94 0 -139 -62.5t-45 -200.5v-71h279v-129z" />
+<glyph unicode="g" horiz-adv-x="1122" d="M1073 1096v-105l-203 -24q28 -35 50 -91.5t22 -127.5q0 -161 -110 -257t-302 -96q-49 0 -92 8q-106 -56 -106 -141q0 -45 37 -66.5t127 -21.5h194q178 0 273.5 -75t95.5 -218q0 -182 -146 -277.5t-426 -95.5q-215 0 -331.5 80t-116.5 226q0 100 64 173t180 99 q-42 19 -70.5 59t-28.5 93q0 60 32 105t101 87q-85 35 -138.5 119t-53.5 192q0 180 108 277.5t306 97.5q86 0 155 -20h379zM199 -184q0 -89 75 -135t215 -46q209 0 309.5 62.5t100.5 169.5q0 89 -55 123.5t-207 34.5h-199q-113 0 -176 -54t-63 -155zM289 745q0 -115 65 -174 t181 -59q243 0 243 236q0 247 -246 247q-117 0 -180 -63t-63 -187z" />
+<glyph unicode="h" horiz-adv-x="1257" d="M926 0v709q0 134 -61 200t-191 66q-173 0 -252.5 -94t-79.5 -308v-573h-166v1556h166v-471q0 -85 -8 -141h10q49 79 139.5 124.5t206.5 45.5q201 0 301.5 -95.5t100.5 -303.5v-715h-166z" />
+<glyph unicode="i" horiz-adv-x="518" d="M342 0h-166v1096h166v-1096zM162 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="j" horiz-adv-x="518" d="M43 -492q-95 0 -154 25v135q69 -20 136 -20q78 0 114.5 42.5t36.5 129.5v1276h166v-1264q0 -324 -299 -324zM162 1393q0 57 28 83.5t70 26.5q40 0 69 -27t29 -83t-29 -83.5t-69 -27.5q-42 0 -70 27.5t-28 83.5z" />
+<glyph unicode="k" horiz-adv-x="1075" d="M340 561q43 61 131 160l354 375h197l-444 -467l475 -629h-201l-387 518l-125 -108v-410h-164v1556h164v-825q0 -55 -8 -170h8z" />
+<glyph unicode="l" horiz-adv-x="518" d="M342 0h-166v1556h166v-1556z" />
+<glyph unicode="m" horiz-adv-x="1905" d="M1573 0v713q0 131 -56 196.5t-174 65.5q-155 0 -229 -89t-74 -274v-612h-166v713q0 131 -56 196.5t-175 65.5q-156 0 -228.5 -93.5t-72.5 -306.5v-575h-166v1096h135l27 -150h8q47 80 132.5 125t191.5 45q257 0 336 -186h8q49 86 142 136t212 50q186 0 278.5 -95.5 t92.5 -305.5v-715h-166z" />
+<glyph unicode="n" horiz-adv-x="1257" d="M926 0v709q0 134 -61 200t-191 66q-172 0 -252 -93t-80 -307v-575h-166v1096h135l27 -150h8q51 81 143 125.5t205 44.5q198 0 298 -95.5t100 -305.5v-715h-166z" />
+<glyph unicode="o" horiz-adv-x="1237" d="M1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z" />
+<glyph unicode="p" horiz-adv-x="1255" d="M686 -20q-107 0 -195.5 39.5t-148.5 121.5h-12q12 -96 12 -182v-451h-166v1588h135l23 -150h8q64 90 149 130t195 40q218 0 336.5 -149t118.5 -418q0 -270 -120.5 -419.5t-334.5 -149.5zM662 975q-168 0 -243 -93t-77 -296v-37q0 -231 77 -330.5t247 -99.5 q142 0 222.5 115t80.5 317q0 205 -80.5 314.5t-226.5 109.5z" />
+<glyph unicode="q" horiz-adv-x="1255" d="M590 119q166 0 242 89t81 300v37q0 230 -78 331t-247 101q-146 0 -223.5 -113.5t-77.5 -320.5t76.5 -315.5t226.5 -108.5zM565 -20q-212 0 -331 149t-119 416q0 269 120 420t334 151q225 0 346 -170h9l24 150h131v-1588h-166v469q0 100 11 170h-13q-115 -167 -346 -167z " />
+<glyph unicode="r" horiz-adv-x="836" d="M676 1116q73 0 131 -12l-23 -154q-68 15 -120 15q-133 0 -227.5 -108t-94.5 -269v-588h-166v1096h137l19 -203h8q61 107 147 165t189 58z" />
+<glyph unicode="s" horiz-adv-x="977" d="M883 299q0 -153 -114 -236t-320 -83q-218 0 -340 69v154q79 -40 169.5 -63t174.5 -23q130 0 200 41.5t70 126.5q0 64 -55.5 109.5t-216.5 107.5q-153 57 -217.5 99.5t-96 96.5t-31.5 129q0 134 109 211.5t299 77.5q177 0 346 -72l-59 -135q-165 68 -299 68 q-118 0 -178 -37t-60 -102q0 -44 22.5 -75t72.5 -59t192 -81q195 -71 263.5 -143t68.5 -181z" />
+<glyph unicode="t" horiz-adv-x="723" d="M530 117q44 0 85 6.5t65 13.5v-127q-27 -13 -79.5 -21.5t-94.5 -8.5q-318 0 -318 335v652h-157v80l157 69l70 234h96v-254h318v-129h-318v-645q0 -99 47 -152t129 -53z" />
+<glyph unicode="u" horiz-adv-x="1257" d="M332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168z" />
+<glyph unicode="v" horiz-adv-x="1026" d="M416 0l-416 1096h178l236 -650q80 -228 94 -296h8q11 53 69.5 219.5t262.5 726.5h178l-416 -1096h-194z" />
+<glyph unicode="w" horiz-adv-x="1593" d="M1071 0l-201 643q-19 59 -71 268h-8q-40 -175 -70 -270l-207 -641h-192l-299 1096h174q106 -413 161.5 -629t63.5 -291h8q11 57 35.5 147.5t42.5 143.5l201 629h180l196 -629q56 -172 76 -289h8q4 36 21.5 111t208.5 807h172l-303 -1096h-197z" />
+<glyph unicode="x" horiz-adv-x="1073" d="M440 561l-381 535h189l289 -420l288 420h187l-381 -535l401 -561h-188l-307 444l-310 -444h-188z" />
+<glyph unicode="y" horiz-adv-x="1032" d="M2 1096h178l240 -625q79 -214 98 -309h8q13 51 54.5 174.5t271.5 759.5h178l-471 -1248q-70 -185 -163.5 -262.5t-229.5 -77.5q-76 0 -150 17v133q55 -12 123 -12q171 0 244 192l61 156z" />
+<glyph unicode="z" horiz-adv-x="958" d="M877 0h-795v113l598 854h-561v129h743v-129l-590 -838h605v-129z" />
+<glyph unicode="{" horiz-adv-x="776" d="M475 12q0 -102 58.5 -148t171.5 -48v-140q-190 2 -294 87t-104 239v303q0 104 -63 148.5t-183 44.5v141q130 2 188 48t58 142v306q0 155 108 241t290 86v-139q-230 -6 -230 -199v-295q0 -215 -223 -254v-12q223 -39 223 -254v-297z" />
+<glyph unicode="|" horiz-adv-x="1128" d="M494 1556h141v-2052h-141v2052z" />
+<glyph unicode="}" horiz-adv-x="776" d="M522 575q-223 39 -223 254v295q0 193 -227 199v139q184 0 289.5 -87t105.5 -240v-306q0 -97 59 -142.5t189 -47.5v-141q-122 0 -185 -44.5t-63 -148.5v-303q0 -153 -102.5 -238.5t-292.5 -87.5v140q111 2 169 48t58 148v297q0 114 55 174t168 80v12z" />
+<glyph unicode="~" d="M338 713q-53 0 -116.5 -33.5t-117.5 -87.5v151q100 109 244 109q68 0 124.5 -14t145.5 -52q66 -28 115 -41.5t96 -13.5q54 0 118 32t118 89v-150q-102 -110 -244 -110q-72 0 -135 16.5t-135 48.5q-75 32 -120 44t-93 12z" />
+<glyph unicode="&#xa1;" horiz-adv-x="547" d="M219 684h105l51 -1057h-207zM393 983q0 -135 -121 -135q-60 0 -90 35.5t-30 99.5q0 63 31.5 99t88.5 36q51 0 86 -32t35 -103z" />
+<glyph unicode="&#xa2;" d="M971 240q-105 -54 -252 -60v-200h-133v206q-203 32 -299.5 168.5t-96.5 386.5q0 508 396 570v172h135v-164q75 -3 146 -19.5t120 -39.5l-49 -140q-133 51 -242 51q-172 0 -253 -105.5t-81 -322.5q0 -212 79.5 -313.5t246.5 -101.5q141 0 283 59v-147z" />
+<glyph unicode="&#xa3;" d="M682 1481q190 0 360 -84l-61 -133q-154 77 -297 77q-123 0 -185.5 -62t-62.5 -202v-295h422v-127h-422v-221q0 -100 -32.5 -168t-106.5 -112h795v-154h-1029v141q205 47 205 291v223h-198v127h198v316q0 178 112 280.5t302 102.5z" />
+<glyph unicode="&#xa4;" d="M184 723q0 122 74 229l-135 140l94 92l135 -133q104 73 234 73q127 0 229 -73l137 133l95 -92l-134 -138q74 -113 74 -231q0 -131 -74 -234l131 -135l-92 -92l-137 133q-102 -71 -229 -71q-134 0 -234 73l-135 -133l-92 92l133 136q-74 107 -74 231zM313 723 q0 -112 78.5 -192t194.5 -80t195 79.5t79 192.5q0 114 -80 195t-194 81q-116 0 -194.5 -82t-78.5 -194z" />
+<glyph unicode="&#xa5;" d="M584 735l379 727h174l-416 -770h262v-127h-317v-170h317v-127h-317v-268h-164v268h-316v127h316v170h-316v127h256l-411 770h178z" />
+<glyph unicode="&#xa6;" horiz-adv-x="1128" d="M494 1556h141v-776h-141v776zM494 281h141v-777h-141v777z" />
+<glyph unicode="&#xa7;" horiz-adv-x="1057" d="M139 809q0 86 43 154.5t121 105.5q-74 40 -116 95.5t-42 140.5q0 121 103.5 190.5t300.5 69.5q94 0 173.5 -14.5t176.5 -53.5l-53 -131q-98 39 -165.5 52.5t-143.5 13.5q-116 0 -174 -29.5t-58 -93.5q0 -60 61.5 -102t215.5 -97q186 -68 261 -143.5t75 -182.5 q0 -90 -41 -160.5t-115 -111.5q153 -81 153 -227q0 -140 -117 -216.5t-329 -76.5q-218 0 -346 65v148q78 -37 175 -59.5t179 -22.5q134 0 204.5 38t70.5 109q0 46 -24 75t-78 58t-169 72q-142 52 -209 97t-100 102t-33 135zM285 829q0 -77 66 -129.5t233 -113.5l49 -19 q137 80 137 191q0 83 -73.5 139t-258.5 113q-68 -19 -110.5 -69t-42.5 -112z" />
+<glyph unicode="&#xa8;" horiz-adv-x="1182" d="M309 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM690 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xa9;" horiz-adv-x="1704" d="M893 1059q-125 0 -192.5 -87t-67.5 -241q0 -168 63.5 -249t194.5 -81q86 0 211 45v-124q-48 -20 -98.5 -34t-120.5 -14q-194 0 -298 120.5t-104 336.5q0 209 110.5 332t301.5 123q128 0 246 -60l-58 -118q-108 51 -188 51zM100 731q0 200 100 375t275 276t377 101 q200 0 375 -100t276 -275t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM205 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5q0 174 -87 323t-235.5 236.5t-324.5 87.5q-174 0 -323 -87 t-236.5 -235.5t-87.5 -324.5z" />
+<glyph unicode="&#xaa;" horiz-adv-x="725" d="M532 801l-24 84q-92 -97 -232 -97q-95 0 -150.5 49.5t-55.5 151.5t77 154.5t242 58.5l117 4v39q0 133 -148 133q-100 0 -204 -51l-43 96q114 56 247 56q130 0 198.5 -52.5t68.5 -173.5v-452h-93zM193 989q0 -100 112 -100q201 0 201 180v49l-98 -4q-112 -4 -163.5 -32.5 t-51.5 -92.5z" />
+<glyph unicode="&#xab;" horiz-adv-x="1018" d="M82 551l342 407l119 -69l-289 -350l289 -351l-119 -71l-342 407v27zM477 551l344 407l117 -69l-287 -350l287 -351l-117 -71l-344 407v27z" />
+<glyph unicode="&#xac;" d="M1065 791v-527h-137v389h-824v138h961z" />
+<glyph unicode="&#xad;" horiz-adv-x="659" d="M84 473zM84 473v152h491v-152h-491z" />
+<glyph unicode="&#xae;" horiz-adv-x="1704" d="M723 762h108q80 0 128.5 41.5t48.5 105.5q0 75 -43 107.5t-136 32.5h-106v-287zM1157 913q0 -80 -42.5 -141.5t-119.5 -91.5l238 -395h-168l-207 354h-135v-354h-148v891h261q166 0 243.5 -65t77.5 -198zM100 731q0 200 100 375t275 276t377 101q200 0 375 -100t276 -275 t101 -377q0 -197 -97 -370t-272 -277t-383 -104q-207 0 -382 103.5t-272.5 276.5t-97.5 371zM205 731q0 -173 87 -323.5t237.5 -237t322.5 -86.5q174 0 323 87t236.5 235.5t87.5 324.5q0 174 -87 323t-235.5 236.5t-324.5 87.5q-174 0 -323 -87t-236.5 -235.5t-87.5 -324.5z " />
+<glyph unicode="&#xaf;" horiz-adv-x="1024" d="M1030 1556h-1036v127h1036v-127z" />
+<glyph unicode="&#xb0;" horiz-adv-x="877" d="M127 1171q0 130 90.5 221t220.5 91t221 -90.5t91 -221.5q0 -84 -41 -155.5t-114 -113.5t-157 -42q-130 0 -220.5 90t-90.5 221zM242 1171q0 -82 58.5 -139t139.5 -57q80 0 137.5 56.5t57.5 139.5q0 84 -56.5 140.5t-138.5 56.5q-83 0 -140.5 -57t-57.5 -140z" />
+<glyph unicode="&#xb1;" d="M104 1zM653 791h412v-138h-412v-426h-139v426h-410v138h410v428h139v-428zM104 1v138h961v-138h-961z" />
+<glyph unicode="&#xb2;" horiz-adv-x="711" d="M653 586h-604v104l236 230q89 86 130 134.5t57.5 86.5t16.5 92q0 68 -40 102.5t-103 34.5q-52 0 -101 -19t-118 -69l-66 88q131 111 283 111q132 0 205.5 -65t73.5 -177q0 -80 -44.5 -155.5t-191.5 -213.5l-174 -165h440v-119z" />
+<glyph unicode="&#xb3;" horiz-adv-x="711" d="M627 1255q0 -80 -41 -131.5t-109 -74.5q176 -47 176 -209q0 -128 -92 -199.5t-260 -71.5q-152 0 -268 56v123q147 -68 270 -68q211 0 211 162q0 145 -231 145h-117v107h119q103 0 152.5 39.5t49.5 107.5q0 61 -40 95t-107 34q-66 0 -122 -21.5t-112 -56.5l-69 90 q63 45 133 72t164 27q136 0 214.5 -59.5t78.5 -166.5z" />
+<glyph unicode="&#xb4;" horiz-adv-x="1182" d="M393 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xb5;" horiz-adv-x="1268" d="M342 381q0 -262 254 -262q171 0 250.5 94.5t79.5 306.5v576h166v-1096h-136l-26 147h-10q-111 -167 -340 -167q-150 0 -238 92h-10q10 -84 10 -244v-320h-166v1588h166v-715z" />
+<glyph unicode="&#xb6;" horiz-adv-x="1341" d="M1120 -260h-114v1712h-213v-1712h-115v819q-62 -18 -146 -18q-216 0 -317.5 125t-101.5 376q0 260 109 387t341 127h557v-1816z" />
+<glyph unicode="&#xb7;" horiz-adv-x="545" d="M152 723q0 66 31 100.5t87 34.5q58 0 90.5 -34.5t32.5 -100.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode="&#xb8;" horiz-adv-x="465" d="M436 -289q0 -97 -76.5 -150t-226.5 -53q-51 0 -96 9v106q45 -8 104 -8q79 0 119.5 20t40.5 74q0 43 -39.5 69.5t-148.5 43.5l88 178h110l-55 -115q180 -39 180 -174z" />
+<glyph unicode="&#xb9;" horiz-adv-x="711" d="M338 1462h143v-876h-133v579q0 91 6 181q-22 -22 -49 -44.5t-162 -117.5l-67 96z" />
+<glyph unicode="&#xba;" horiz-adv-x="768" d="M702 1135q0 -164 -85.5 -255.5t-235.5 -91.5q-146 0 -230.5 93t-84.5 254q0 163 84 253.5t235 90.5q152 0 234.5 -91t82.5 -253zM188 1135q0 -122 45.5 -183t149.5 -61q105 0 151 61t46 183q0 123 -46 182t-151 59q-103 0 -149 -59t-46 -182z" />
+<glyph unicode="&#xbb;" horiz-adv-x="1018" d="M936 524l-344 -407l-117 71l287 351l-287 350l117 69l344 -407v-27zM541 524l-344 -407l-117 71l287 351l-287 350l117 69l344 -407v-27z" />
+<glyph unicode="&#xbc;" horiz-adv-x="1597" d="M75 0zM1298 1462l-903 -1462h-143l903 1462h143zM337 1462h143v-876h-133v579q0 91 6 181q-22 -22 -49 -44.5t-162 -117.5l-67 96zM1489 203h-125v-202h-145v202h-402v101l408 579h139v-563h125v-117zM1219 320v195q0 134 6 209q-5 -12 -17 -31.5t-27 -42l-30 -45 t-26 -39.5l-168 -246h262z" />
+<glyph unicode="&#xbd;" horiz-adv-x="1597" d="M46 0zM1230 1462l-903 -1462h-143l903 1462h143zM308 1462h143v-876h-133v579q0 91 6 181q-22 -22 -49 -44.5t-162 -117.5l-67 96zM1499 1h-604v104l236 230q89 86 130 134.5t57.5 86.5t16.5 92q0 68 -40 102.5t-103 34.5q-52 0 -101 -19t-118 -69l-66 88 q131 111 283 111q132 0 205.5 -65t73.5 -177q0 -80 -44.5 -155.5t-191.5 -213.5l-174 -165h440v-119z" />
+<glyph unicode="&#xbe;" horiz-adv-x="1597" d="M26 0zM620 1255q0 -80 -41 -131.5t-109 -74.5q176 -47 176 -209q0 -128 -92 -199.5t-260 -71.5q-152 0 -268 56v123q147 -68 270 -68q211 0 211 162q0 145 -231 145h-117v107h119q103 0 152.5 39.5t49.5 107.5q0 61 -40 95t-107 34q-66 0 -122 -21.5t-112 -56.5l-69 90 q63 45 133 72t164 27q136 0 214.5 -59.5t78.5 -166.5zM1390 1462l-903 -1462h-143l903 1462h143zM1569 203h-125v-202h-145v202h-402v101l408 579h139v-563h125v-117zM1299 320v195q0 134 6 209q-5 -12 -17 -31.5t-27 -42l-30 -45t-26 -39.5l-168 -246h262z" />
+<glyph unicode="&#xbf;" horiz-adv-x="879" d="M590 684v-51q0 -122 -37.5 -196t-134.5 -158q-121 -106 -151.5 -143.5t-43 -76t-12.5 -94.5q0 -100 66 -156.5t188 -56.5q80 0 155 19t173 67l59 -135q-197 -96 -395 -96q-190 0 -298 93t-108 263q0 70 17.5 122.5t49.5 97t76.5 85.5t98.5 88q101 88 133.5 146t32.5 151 v31h131zM639 983q0 -135 -121 -135q-59 0 -90 34.5t-31 100.5q0 64 33 99.5t88 35.5q51 0 86 -32t35 -103z" />
+<glyph unicode="&#xc0;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM724 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xc1;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM526 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xc2;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM303 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186 h-115v23z" />
+<glyph unicode="&#xc3;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM792 1581q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5 q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xc4;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM364 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5z M745 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xc5;" horiz-adv-x="1296" d="M0 0zM1120 0l-182 465h-586l-180 -465h-172l578 1468h143l575 -1468h-176zM885 618l-170 453q-33 86 -68 211q-22 -96 -63 -211l-172 -453h473zM870 1587q0 -98 -61.5 -157.5t-163.5 -59.5q-101 0 -161 58.5t-60 156.5t60.5 155.5t160.5 57.5q101 0 163 -59.5t62 -151.5z M762 1585q0 56 -33 86.5t-84 30.5t-84 -30.5t-33 -86.5t30 -86.5t87 -30.5q52 0 84.5 30.5t32.5 86.5z" />
+<glyph unicode="&#xc6;" horiz-adv-x="1788" d="M1665 0h-750v465h-514l-227 -465h-176l698 1462h969v-151h-580v-471h541v-150h-541v-538h580v-152zM469 618h446v693h-118z" />
+<glyph unicode="&#xc7;" horiz-adv-x="1292" d="M125 0zM827 1331q-241 0 -380.5 -160.5t-139.5 -439.5q0 -287 134.5 -443.5t383.5 -156.5q153 0 349 55v-149q-152 -57 -375 -57q-323 0 -498.5 196t-175.5 557q0 226 84.5 396t244 262t375.5 92q230 0 402 -84l-72 -146q-166 78 -332 78zM950 -289q0 -97 -76.5 -150 t-226.5 -53q-51 0 -96 9v106q45 -8 104 -8q79 0 119.5 20t40.5 74q0 43 -39.5 69.5t-148.5 43.5l88 178h110l-55 -115q180 -39 180 -174z" />
+<glyph unicode="&#xc8;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM713 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xc9;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM456 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xca;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM263 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xcb;" horiz-adv-x="1139" d="M201 0zM1016 0h-815v1462h815v-151h-645v-471h606v-150h-606v-538h645v-152zM327 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM708 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5 t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xcc;" horiz-adv-x="571" d="M5 0zM201 0v1462h170v-1462h-170zM398 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xcd;" horiz-adv-x="571" d="M179 0zM201 0v1462h170v-1462h-170zM179 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xce;" horiz-adv-x="571" d="M0 0zM201 0v1462h170v-1462h-170zM-57 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xcf;" horiz-adv-x="571" d="M5 0zM201 0v1462h170v-1462h-170zM5 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM386 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xd0;" horiz-adv-x="1479" d="M1352 745q0 -362 -196.5 -553.5t-565.5 -191.5h-389v649h-154v150h154v663h434q337 0 527 -187.5t190 -529.5zM1171 739q0 576 -569 576h-231v-516h379v-150h-379v-502h190q610 0 610 592z" />
+<glyph unicode="&#xd1;" horiz-adv-x="1544" d="M201 0zM1343 0h-194l-799 1227h-8q16 -216 16 -396v-831h-157v1462h192l797 -1222h8q-2 27 -9 173.5t-5 209.5v839h159v-1462zM935 1581q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41 t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xd2;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM907 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xd3;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM659 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xd4;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM448 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xd5;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM942 1581q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xd6;" horiz-adv-x="1595" d="M125 0zM1470 733q0 -351 -177.5 -552t-493.5 -201q-323 0 -498.5 197.5t-175.5 557.5q0 357 176 553.5t500 196.5q315 0 492 -200t177 -552zM305 733q0 -297 126.5 -450.5t367.5 -153.5q243 0 367 153t124 451q0 295 -123.5 447.5t-365.5 152.5q-243 0 -369.5 -153.5 t-126.5 -446.5zM522 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM903 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xd7;" d="M940 1176l96 -99l-352 -354l350 -352l-96 -99l-354 351l-348 -351l-101 99l350 352l-352 352l100 101l353 -355z" />
+<glyph unicode="&#xd8;" horiz-adv-x="1595" d="M1470 733q0 -351 -177.5 -552t-493.5 -201q-235 0 -383 100l-101 -141l-120 79l108 154q-178 198 -178 563q0 357 176 553.5t500 196.5q209 0 366 -94l97 135l120 -80l-106 -148q192 -202 192 -565zM1290 733q0 272 -110 426l-672 -948q115 -82 291 -82q243 0 367 153 t124 451zM305 733q0 -262 101 -416l669 943q-106 73 -274 73q-243 0 -369.5 -153.5t-126.5 -446.5z" />
+<glyph unicode="&#xd9;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM856 1579h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xda;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM600 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xdb;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM393 1602q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186 q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xdc;" horiz-adv-x="1491" d="M186 0zM1305 1462v-946q0 -250 -151 -393t-415 -143t-408.5 144t-144.5 396v942h170v-954q0 -183 100 -281t294 -98q185 0 285 98.5t100 282.5v952h170zM461 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5 t-26.5 74.5zM842 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xdd;" horiz-adv-x="1147" d="M0 0zM573 731l390 731h184l-488 -895v-567h-172v559l-487 903h186zM442 1604q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xde;" horiz-adv-x="1251" d="M1145 784q0 -227 -151.5 -346t-438.5 -119h-184v-319h-170v1462h170v-256h215q281 0 420 -103.5t139 -318.5zM371 465h168q226 0 327 71.5t101 235.5q0 149 -95 218t-297 69h-204v-594z" />
+<glyph unicode="&#xdf;" horiz-adv-x="1274" d="M1049 1266q0 -135 -143 -250q-88 -70 -116 -103.5t-28 -66.5q0 -32 13.5 -53t49 -49.5t113.5 -79.5q140 -95 191 -173.5t51 -179.5q0 -160 -97 -245.5t-276 -85.5q-188 0 -295 69v154q63 -39 141 -62.5t150 -23.5q215 0 215 182q0 75 -41.5 128.5t-151.5 123.5 q-127 82 -175 143.5t-48 145.5q0 63 34.5 116t105.5 106q75 57 107 102t32 98q0 80 -68 122.5t-195 42.5q-276 0 -276 -223v-1204h-166v1202q0 178 110 271.5t332 93.5q206 0 318.5 -78.5t112.5 -222.5z" />
+<glyph unicode="&#xe0;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM672 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xe1;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM436 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xe2;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM228 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xe3;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM721 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99 q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xe4;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM279 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM660 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75 q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xe5;" horiz-adv-x="1139" d="M94 0zM850 0l-33 156h-8q-82 -103 -163.5 -139.5t-203.5 -36.5q-163 0 -255.5 84t-92.5 239q0 332 531 348l186 6v68q0 129 -55.5 190.5t-177.5 61.5q-137 0 -310 -84l-51 127q81 44 177.5 69t193.5 25q196 0 290.5 -87t94.5 -279v-748h-123zM475 117q155 0 243.5 85 t88.5 238v99l-166 -7q-198 -7 -285.5 -61.5t-87.5 -169.5q0 -90 54.5 -137t152.5 -47zM804 1458q0 -98 -61.5 -157.5t-163.5 -59.5q-101 0 -161 58.5t-60 156.5t60.5 155.5t160.5 57.5q101 0 163 -59.5t62 -151.5zM696 1456q0 56 -33 86.5t-84 30.5t-84 -30.5t-33 -86.5 t30 -86.5t87 -30.5q52 0 84.5 30.5t32.5 86.5z" />
+<glyph unicode="&#xe6;" horiz-adv-x="1757" d="M94 303q0 161 124 250.5t378 97.5l184 6v68q0 129 -58 190.5t-177 61.5q-144 0 -307 -84l-52 127q74 41 173.5 67.5t197.5 26.5q130 0 212.5 -43.5t123.5 -138.5q53 88 138.5 136t195.5 48q192 0 308 -133.5t116 -355.5v-107h-701q8 -395 322 -395q91 0 169.5 17.5 t162.5 56.5v-148q-86 -38 -160.5 -54.5t-175.5 -16.5q-289 0 -414 233q-81 -127 -179.5 -180t-232.5 -53q-163 0 -255.5 85t-92.5 238zM268 301q0 -95 53.5 -139.5t141.5 -44.5q145 0 229 84.5t84 238.5v99l-158 -7q-186 -8 -268 -62.5t-82 -168.5zM1225 977 q-121 0 -190.5 -83t-80.5 -241h519q0 156 -64 240t-184 84z" />
+<glyph unicode="&#xe7;" horiz-adv-x="975" d="M115 0zM614 -20q-238 0 -368.5 146.5t-130.5 414.5q0 275 132.5 425t377.5 150q79 0 158 -17t124 -40l-51 -141q-55 22 -120 36.5t-115 14.5q-334 0 -334 -426q0 -202 81.5 -310t241.5 -108q137 0 281 59v-147q-110 -57 -277 -57zM762 -289q0 -97 -76.5 -150t-226.5 -53 q-51 0 -96 9v106q45 -8 104 -8q79 0 119.5 20t40.5 74q0 43 -39.5 69.5t-148.5 43.5l88 178h110l-55 -115q180 -39 180 -174z" />
+<glyph unicode="&#xe8;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM711 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xe9;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM471 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xea;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM259 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xeb;" horiz-adv-x="1149" d="M115 0zM639 -20q-243 0 -383.5 148t-140.5 411q0 265 130.5 421t350.5 156q206 0 326 -135.5t120 -357.5v-105h-755q5 -193 97.5 -293t260.5 -100q177 0 350 74v-148q-88 -38 -166.5 -54.5t-189.5 -16.5zM594 977q-132 0 -210.5 -86t-92.5 -238h573q0 157 -70 240.5 t-200 83.5zM319 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM700 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xec;" horiz-adv-x="518" d="M0 0zM342 0h-166v1096h166v-1096zM355 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xed;" horiz-adv-x="518" d="M169 0zM342 0h-166v1096h166v-1096zM169 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xee;" horiz-adv-x="518" d="M0 0zM342 0h-166v1096h166v-1096zM-77 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xef;" horiz-adv-x="518" d="M0 0zM342 0h-166v1096h166v-1096zM-20 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM361 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xf0;" horiz-adv-x="1221" d="M1122 563q0 -281 -130.5 -432t-377.5 -151q-222 0 -361.5 134.5t-139.5 360.5q0 230 131.5 361t351.5 131q226 0 326 -121l8 4q-57 214 -262 405l-271 -155l-73 108l233 133q-92 62 -186 111l69 117q156 -73 258 -148l238 138l76 -107l-207 -119q152 -143 234.5 -342 t82.5 -428zM954 512q0 147 -90 232t-246 85q-337 0 -337 -360q0 -167 87.5 -258.5t249.5 -91.5q175 0 255.5 100.5t80.5 292.5z" />
+<glyph unicode="&#xf1;" horiz-adv-x="1257" d="M176 0zM926 0v709q0 134 -61 200t-191 66q-172 0 -252 -93t-80 -307v-575h-166v1096h135l27 -150h8q51 81 143 125.5t205 44.5q198 0 298 -95.5t100 -305.5v-715h-166zM802 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98 q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xf2;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M742 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xf3;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M479 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xf4;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M282 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xf5;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M773 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#xf6;" horiz-adv-x="1237" d="M115 0zM1122 549q0 -268 -135 -418.5t-373 -150.5q-147 0 -261 69t-176 198t-62 302q0 268 134 417.5t372 149.5q230 0 365.5 -153t135.5 -414zM287 549q0 -210 84 -320t247 -110t247.5 109.5t84.5 320.5q0 209 -84.5 317.5t-249.5 108.5q-163 0 -246 -107t-83 -319z M336 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM717 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xf7;" d="M104 653v138h961v-138h-961zM471 373q0 60 29.5 90.5t83.5 30.5q52 0 81 -31.5t29 -89.5q0 -57 -29.5 -89t-80.5 -32q-52 0 -82.5 31.5t-30.5 89.5zM471 1071q0 60 29.5 90.5t83.5 30.5q52 0 81 -31.5t29 -89.5q0 -57 -29.5 -89t-80.5 -32q-52 0 -82.5 31.5t-30.5 89.5z " />
+<glyph unicode="&#xf8;" horiz-adv-x="1237" d="M1122 549q0 -268 -135 -418.5t-373 -150.5q-154 0 -266 69l-84 -117l-114 78l94 131q-129 152 -129 408q0 268 134 417.5t372 149.5q154 0 270 -76l84 119l117 -76l-97 -133q127 -152 127 -401zM287 549q0 -171 53 -273l465 646q-75 53 -189 53q-163 0 -246 -107 t-83 -319zM950 549q0 164 -51 264l-465 -643q71 -51 184 -51q163 0 247.5 109.5t84.5 320.5z" />
+<glyph unicode="&#xf9;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM726 1241h-110q-65 52 -154 148t-129 159v21h203q32 -69 89 -159.5t101 -143.5v-25z" />
+<glyph unicode="&#xfa;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM506 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147h-111v25z" />
+<glyph unicode="&#xfb;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM286 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119 q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#xfc;" horiz-adv-x="1257" d="M164 0zM332 1096v-711q0 -134 61 -200t191 -66q172 0 251.5 94t79.5 307v576h166v-1096h-137l-24 147h-9q-51 -81 -141.5 -124t-206.5 -43q-200 0 -299.5 95t-99.5 304v717h168zM342 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5 q-37 0 -63.5 24.5t-26.5 74.5zM723 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#xfd;" horiz-adv-x="1032" d="M2 0zM2 1096h178l240 -625q79 -214 98 -309h8q13 51 54.5 174.5t271.5 759.5h178l-471 -1248q-70 -185 -163.5 -262.5t-229.5 -77.5q-76 0 -150 17v133q55 -12 123 -12q171 0 244 192l61 156zM411 1266q48 62 103.5 150t87.5 153h202v-21q-44 -65 -131 -160t-151 -147 h-111v25z" />
+<glyph unicode="&#xfe;" horiz-adv-x="1255" d="M344 948q66 89 151 128.5t191 39.5q215 0 335 -150t120 -417q0 -268 -120.5 -418.5t-334.5 -150.5q-222 0 -344 161h-12l4 -34q8 -77 8 -140v-459h-166v2048h166v-466q0 -52 -6 -142h8zM664 975q-168 0 -244 -92t-78 -293v-41q0 -231 77 -330.5t247 -99.5q303 0 303 432 q0 215 -74 319.5t-231 104.5z" />
+<glyph unicode="&#xff;" horiz-adv-x="1032" d="M2 0zM2 1096h178l240 -625q79 -214 98 -309h8q13 51 54.5 174.5t271.5 759.5h178l-471 -1248q-70 -185 -163.5 -262.5t-229.5 -77.5q-76 0 -150 17v133q55 -12 123 -12q171 0 244 192l61 156zM234 1393q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5 t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM615 1393q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#x131;" horiz-adv-x="518" d="M342 0h-166v1096h166v-1096z" />
+<glyph unicode="&#x152;" horiz-adv-x="1890" d="M1767 0h-768q-102 -20 -194 -20q-327 0 -503.5 196.5t-176.5 558.5q0 360 174 555t494 195q102 0 192 -23h782v-151h-589v-471h551v-150h-551v-538h589v-152zM811 1333q-249 0 -377.5 -152.5t-128.5 -447.5q0 -297 128.5 -450.5t375.5 -153.5q112 0 199 33v1141 q-87 30 -197 30z" />
+<glyph unicode="&#x153;" horiz-adv-x="1929" d="M1430 -20q-293 0 -418 235q-62 -116 -166.5 -175.5t-241.5 -59.5q-223 0 -357 152.5t-134 416.5q0 265 131 415t366 150q131 0 233.5 -59.5t164.5 -173.5q58 112 154 172.5t222 60.5q201 0 320 -132.5t119 -358.5v-105h-729q8 -393 338 -393q94 0 174.5 17.5t167.5 56.5 v-148q-88 -39 -164 -55t-180 -16zM287 549q0 -211 76 -320.5t243 -109.5q163 0 239.5 106.5t76.5 315.5q0 221 -77.5 327.5t-242.5 106.5q-166 0 -240.5 -108t-74.5 -318zM1382 975q-127 0 -199.5 -82t-84.5 -240h544q0 158 -66 240t-194 82z" />
+<glyph unicode="&#x178;" horiz-adv-x="1147" d="M0 0zM573 731l390 731h184l-488 -895v-567h-172v559l-487 903h186zM294 1731q0 52 26.5 75t63.5 23q38 0 65.5 -23t27.5 -75q0 -50 -27.5 -74.5t-65.5 -24.5q-37 0 -63.5 24.5t-26.5 74.5zM675 1731q0 52 26.5 75t63.5 23t64.5 -23t27.5 -75q0 -50 -27.5 -74.5 t-64.5 -24.5t-63.5 24.5t-26.5 74.5z" />
+<glyph unicode="&#x2c6;" horiz-adv-x="1212" d="M268 1264q127 136 178 200t74 105h166q22 -42 76.5 -108.5t179.5 -196.5v-23h-119q-88 55 -221 186q-136 -134 -219 -186h-115v23z" />
+<glyph unicode="&#x2da;" horiz-adv-x="1182" d="M813 1458q0 -98 -61.5 -157.5t-163.5 -59.5q-101 0 -161 58.5t-60 156.5t60.5 155.5t160.5 57.5q101 0 163 -59.5t62 -151.5zM705 1456q0 56 -33 86.5t-84 30.5t-84 -30.5t-33 -86.5t30 -86.5t87 -30.5q52 0 84.5 30.5t32.5 86.5z" />
+<glyph unicode="&#x2dc;" horiz-adv-x="1212" d="M788 1243q-43 0 -84 18.5t-80.5 41t-76 41t-70.5 18.5q-50 0 -75.5 -30t-39.5 -91h-98q13 121 70.5 189.5t148.5 68.5q46 0 89 -18.5t82 -41t75 -41t68 -18.5q49 0 73 29.5t39 91.5h99q-13 -121 -69.5 -189.5t-150.5 -68.5z" />
+<glyph unicode="&#x2000;" horiz-adv-x="953" />
+<glyph unicode="&#x2001;" horiz-adv-x="1907" />
+<glyph unicode="&#x2002;" horiz-adv-x="953" />
+<glyph unicode="&#x2003;" horiz-adv-x="1907" />
+<glyph unicode="&#x2004;" horiz-adv-x="635" />
+<glyph unicode="&#x2005;" horiz-adv-x="476" />
+<glyph unicode="&#x2006;" horiz-adv-x="317" />
+<glyph unicode="&#x2007;" horiz-adv-x="317" />
+<glyph unicode="&#x2008;" horiz-adv-x="238" />
+<glyph unicode="&#x2009;" horiz-adv-x="381" />
+<glyph unicode="&#x200a;" horiz-adv-x="105" />
+<glyph unicode="&#x2010;" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="&#x2011;" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="&#x2012;" horiz-adv-x="659" d="M84 473v152h491v-152h-491z" />
+<glyph unicode="&#x2013;" horiz-adv-x="1024" d="M82 473v152h860v-152h-860z" />
+<glyph unicode="&#x2014;" horiz-adv-x="2048" d="M82 473v152h1884v-152h-1884z" />
+<glyph unicode="&#x2018;" horiz-adv-x="348" d="M37 961l-12 22q22 90 71 224t105 255h123q-66 -254 -103 -501h-184z" />
+<glyph unicode="&#x2019;" horiz-adv-x="348" d="M309 1462l15 -22q-26 -100 -75 -232.5t-102 -246.5h-122q70 285 102 501h182z" />
+<glyph unicode="&#x201a;" horiz-adv-x="502" d="M63 0zM350 238l15 -23q-26 -100 -75 -232.5t-102 -246.5h-125q27 104 59.5 257t45.5 245h182z" />
+<glyph unicode="&#x201c;" horiz-adv-x="717" d="M406 961l-15 22q56 215 178 479h123q-30 -115 -59.5 -259.5t-42.5 -241.5h-184zM37 961l-12 22q22 90 71 224t105 255h123q-66 -254 -103 -501h-184z" />
+<glyph unicode="&#x201d;" horiz-adv-x="717" d="M309 1462l15 -22q-26 -100 -75 -232.5t-102 -246.5h-122q70 285 102 501h182zM678 1462l14 -22q-24 -91 -72 -224t-104 -255h-125q26 100 59 254t46 247h182z" />
+<glyph unicode="&#x201e;" horiz-adv-x="829" d="M25 0zM309 238l15 -22q-26 -100 -75 -232.5t-102 -246.5h-122q70 285 102 501h182zM678 238l14 -22q-24 -91 -72 -224t-104 -255h-125q26 100 59 254t46 247h182z" />
+<glyph unicode="&#x2022;" horiz-adv-x="770" d="M164 748q0 121 56.5 184t164.5 63q105 0 163 -62t58 -185q0 -119 -57.5 -183.5t-163.5 -64.5q-107 0 -164 65.5t-57 182.5z" />
+<glyph unicode="&#x2026;" horiz-adv-x="1606" d="M152 0zM152 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5zM682 106q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5zM1213 106 q0 67 30.5 101.5t87.5 34.5q58 0 90.5 -34.5t32.5 -101.5q0 -65 -33 -100t-90 -35q-51 0 -84.5 31.5t-33.5 103.5z" />
+<glyph unicode="&#x202f;" horiz-adv-x="381" />
+<glyph unicode="&#x2039;" horiz-adv-x="623" d="M82 551l342 407l119 -69l-289 -350l289 -351l-119 -71l-342 407v27z" />
+<glyph unicode="&#x203a;" horiz-adv-x="623" d="M541 524l-344 -407l-117 71l287 351l-287 350l117 69l344 -407v-27z" />
+<glyph unicode="&#x2044;" horiz-adv-x="266" d="M655 1462l-903 -1462h-143l903 1462h143z" />
+<glyph unicode="&#x205f;" horiz-adv-x="476" />
+<glyph unicode="&#x2074;" horiz-adv-x="711" d="M692 788h-125v-202h-145v202h-402v101l408 579h139v-563h125v-117zM422 905v195q0 134 6 209q-5 -12 -17 -31.5t-27 -42l-30 -45t-26 -39.5l-168 -246h262z" />
+<glyph unicode="&#x20ac;" horiz-adv-x="1208" d="M795 1333q-319 0 -398 -403h510v-129h-524l-2 -57v-64l2 -45h463v-129h-447q37 -180 138.5 -278.5t271.5 -98.5q156 0 309 66v-150q-146 -65 -317 -65q-237 0 -381.5 134.5t-190.5 391.5h-166v129h152l-2 42v44l2 80h-152v129h164q39 261 185 407t383 146q201 0 366 -97 l-71 -139q-166 86 -295 86z" />
+<glyph unicode="&#x2122;" horiz-adv-x="1589" d="M369 741h-123v615h-209v106h543v-106h-211v-615zM969 741l-201 559h-8l6 -129v-430h-119v721h187l196 -559l203 559h180v-721h-127v420l6 137h-8l-211 -557h-104z" />
+<glyph unicode="&#x2212;" d="M104 653v138h961v-138h-961z" />
+<glyph unicode="&#xe000;" horiz-adv-x="1095" d="M0 1095h1095v-1095h-1095v1095z" />
+<glyph horiz-adv-x="1255" d="M0 0z" />
+<hkern u1="&#x22;" u2="&#x178;" k="-20" />
+<hkern u1="&#x22;" u2="&#x153;" k="123" />
+<hkern u1="&#x22;" u2="&#xfc;" k="61" />
+<hkern u1="&#x22;" u2="&#xfb;" k="61" />
+<hkern u1="&#x22;" u2="&#xfa;" k="61" />
+<hkern u1="&#x22;" u2="&#xf9;" k="61" />
+<hkern u1="&#x22;" u2="&#xf8;" k="123" />
+<hkern u1="&#x22;" u2="&#xf6;" k="123" />
+<hkern u1="&#x22;" u2="&#xf5;" k="123" />
+<hkern u1="&#x22;" u2="&#xf4;" k="123" />
+<hkern u1="&#x22;" u2="&#xf3;" k="123" />
+<hkern u1="&#x22;" u2="&#xf2;" k="123" />
+<hkern u1="&#x22;" u2="&#xeb;" k="123" />
+<hkern u1="&#x22;" u2="&#xea;" k="123" />
+<hkern u1="&#x22;" u2="&#xe9;" k="123" />
+<hkern u1="&#x22;" u2="&#xe8;" k="123" />
+<hkern u1="&#x22;" u2="&#xe7;" k="123" />
+<hkern u1="&#x22;" u2="&#xe6;" k="82" />
+<hkern u1="&#x22;" u2="&#xe5;" k="82" />
+<hkern u1="&#x22;" u2="&#xe4;" k="82" />
+<hkern u1="&#x22;" u2="&#xe3;" k="82" />
+<hkern u1="&#x22;" u2="&#xe2;" k="82" />
+<hkern u1="&#x22;" u2="&#xe1;" k="82" />
+<hkern u1="&#x22;" u2="&#xe0;" k="123" />
+<hkern u1="&#x22;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x22;" u2="&#xc5;" k="143" />
+<hkern u1="&#x22;" u2="&#xc4;" k="143" />
+<hkern u1="&#x22;" u2="&#xc3;" k="143" />
+<hkern u1="&#x22;" u2="&#xc2;" k="143" />
+<hkern u1="&#x22;" u2="&#xc1;" k="143" />
+<hkern u1="&#x22;" u2="&#xc0;" k="143" />
+<hkern u1="&#x22;" u2="u" k="61" />
+<hkern u1="&#x22;" u2="s" k="61" />
+<hkern u1="&#x22;" u2="r" k="61" />
+<hkern u1="&#x22;" u2="q" k="123" />
+<hkern u1="&#x22;" u2="p" k="61" />
+<hkern u1="&#x22;" u2="o" k="123" />
+<hkern u1="&#x22;" u2="n" k="61" />
+<hkern u1="&#x22;" u2="m" k="61" />
+<hkern u1="&#x22;" u2="g" k="61" />
+<hkern u1="&#x22;" u2="e" k="123" />
+<hkern u1="&#x22;" u2="d" k="123" />
+<hkern u1="&#x22;" u2="c" k="123" />
+<hkern u1="&#x22;" u2="a" k="82" />
+<hkern u1="&#x22;" u2="Y" k="-20" />
+<hkern u1="&#x22;" u2="W" k="-41" />
+<hkern u1="&#x22;" u2="V" k="-41" />
+<hkern u1="&#x22;" u2="T" k="-41" />
+<hkern u1="&#x22;" u2="A" k="143" />
+<hkern u1="&#x27;" u2="&#x178;" k="-20" />
+<hkern u1="&#x27;" u2="&#x153;" k="123" />
+<hkern u1="&#x27;" u2="&#xfc;" k="61" />
+<hkern u1="&#x27;" u2="&#xfb;" k="61" />
+<hkern u1="&#x27;" u2="&#xfa;" k="61" />
+<hkern u1="&#x27;" u2="&#xf9;" k="61" />
+<hkern u1="&#x27;" u2="&#xf8;" k="123" />
+<hkern u1="&#x27;" u2="&#xf6;" k="123" />
+<hkern u1="&#x27;" u2="&#xf5;" k="123" />
+<hkern u1="&#x27;" u2="&#xf4;" k="123" />
+<hkern u1="&#x27;" u2="&#xf3;" k="123" />
+<hkern u1="&#x27;" u2="&#xf2;" k="123" />
+<hkern u1="&#x27;" u2="&#xeb;" k="123" />
+<hkern u1="&#x27;" u2="&#xea;" k="123" />
+<hkern u1="&#x27;" u2="&#xe9;" k="123" />
+<hkern u1="&#x27;" u2="&#xe8;" k="123" />
+<hkern u1="&#x27;" u2="&#xe7;" k="123" />
+<hkern u1="&#x27;" u2="&#xe6;" k="82" />
+<hkern u1="&#x27;" u2="&#xe5;" k="82" />
+<hkern u1="&#x27;" u2="&#xe4;" k="82" />
+<hkern u1="&#x27;" u2="&#xe3;" k="82" />
+<hkern u1="&#x27;" u2="&#xe2;" k="82" />
+<hkern u1="&#x27;" u2="&#xe1;" k="82" />
+<hkern u1="&#x27;" u2="&#xe0;" k="123" />
+<hkern u1="&#x27;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x27;" u2="&#xc5;" k="143" />
+<hkern u1="&#x27;" u2="&#xc4;" k="143" />
+<hkern u1="&#x27;" u2="&#xc3;" k="143" />
+<hkern u1="&#x27;" u2="&#xc2;" k="143" />
+<hkern u1="&#x27;" u2="&#xc1;" k="143" />
+<hkern u1="&#x27;" u2="&#xc0;" k="143" />
+<hkern u1="&#x27;" u2="u" k="61" />
+<hkern u1="&#x27;" u2="s" k="61" />
+<hkern u1="&#x27;" u2="r" k="61" />
+<hkern u1="&#x27;" u2="q" k="123" />
+<hkern u1="&#x27;" u2="p" k="61" />
+<hkern u1="&#x27;" u2="o" k="123" />
+<hkern u1="&#x27;" u2="n" k="61" />
+<hkern u1="&#x27;" u2="m" k="61" />
+<hkern u1="&#x27;" u2="g" k="61" />
+<hkern u1="&#x27;" u2="e" k="123" />
+<hkern u1="&#x27;" u2="d" k="123" />
+<hkern u1="&#x27;" u2="c" k="123" />
+<hkern u1="&#x27;" u2="a" k="82" />
+<hkern u1="&#x27;" u2="Y" k="-20" />
+<hkern u1="&#x27;" u2="W" k="-41" />
+<hkern u1="&#x27;" u2="V" k="-41" />
+<hkern u1="&#x27;" u2="T" k="-41" />
+<hkern u1="&#x27;" u2="A" k="143" />
+<hkern u1="&#x28;" u2="J" k="-184" />
+<hkern u1="&#x2c;" u2="&#x178;" k="123" />
+<hkern u1="&#x2c;" u2="&#x152;" k="102" />
+<hkern u1="&#x2c;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2c;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2c;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2c;" u2="&#xda;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2c;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2c;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2c;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2c;" u2="Y" k="123" />
+<hkern u1="&#x2c;" u2="W" k="123" />
+<hkern u1="&#x2c;" u2="V" k="123" />
+<hkern u1="&#x2c;" u2="U" k="41" />
+<hkern u1="&#x2c;" u2="T" k="143" />
+<hkern u1="&#x2c;" u2="Q" k="102" />
+<hkern u1="&#x2c;" u2="O" k="102" />
+<hkern u1="&#x2c;" u2="G" k="102" />
+<hkern u1="&#x2c;" u2="C" k="102" />
+<hkern u1="&#x2d;" u2="T" k="82" />
+<hkern u1="&#x2e;" u2="&#x178;" k="123" />
+<hkern u1="&#x2e;" u2="&#x152;" k="102" />
+<hkern u1="&#x2e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x2e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x2e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x2e;" u2="&#xda;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x2e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x2e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x2e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x2e;" u2="Y" k="123" />
+<hkern u1="&#x2e;" u2="W" k="123" />
+<hkern u1="&#x2e;" u2="V" k="123" />
+<hkern u1="&#x2e;" u2="U" k="41" />
+<hkern u1="&#x2e;" u2="T" k="143" />
+<hkern u1="&#x2e;" u2="Q" k="102" />
+<hkern u1="&#x2e;" u2="O" k="102" />
+<hkern u1="&#x2e;" u2="G" k="102" />
+<hkern u1="&#x2e;" u2="C" k="102" />
+<hkern u1="A" u2="&#x201d;" k="143" />
+<hkern u1="A" u2="&#x2019;" k="143" />
+<hkern u1="A" u2="&#x178;" k="123" />
+<hkern u1="A" u2="&#x152;" k="41" />
+<hkern u1="A" u2="&#xdd;" k="123" />
+<hkern u1="A" u2="&#xd8;" k="41" />
+<hkern u1="A" u2="&#xd6;" k="41" />
+<hkern u1="A" u2="&#xd5;" k="41" />
+<hkern u1="A" u2="&#xd4;" k="41" />
+<hkern u1="A" u2="&#xd3;" k="41" />
+<hkern u1="A" u2="&#xd2;" k="41" />
+<hkern u1="A" u2="&#xc7;" k="41" />
+<hkern u1="A" u2="Y" k="123" />
+<hkern u1="A" u2="W" k="82" />
+<hkern u1="A" u2="V" k="82" />
+<hkern u1="A" u2="T" k="143" />
+<hkern u1="A" u2="Q" k="41" />
+<hkern u1="A" u2="O" k="41" />
+<hkern u1="A" u2="J" k="-266" />
+<hkern u1="A" u2="G" k="41" />
+<hkern u1="A" u2="C" k="41" />
+<hkern u1="A" u2="&#x27;" k="143" />
+<hkern u1="A" u2="&#x22;" k="143" />
+<hkern u1="B" u2="&#x201e;" k="82" />
+<hkern u1="B" u2="&#x201a;" k="82" />
+<hkern u1="B" u2="&#x178;" k="20" />
+<hkern u1="B" u2="&#xdd;" k="20" />
+<hkern u1="B" u2="&#xc5;" k="41" />
+<hkern u1="B" u2="&#xc4;" k="41" />
+<hkern u1="B" u2="&#xc3;" k="41" />
+<hkern u1="B" u2="&#xc2;" k="41" />
+<hkern u1="B" u2="&#xc1;" k="41" />
+<hkern u1="B" u2="&#xc0;" k="41" />
+<hkern u1="B" u2="Z" k="20" />
+<hkern u1="B" u2="Y" k="20" />
+<hkern u1="B" u2="X" k="41" />
+<hkern u1="B" u2="W" k="20" />
+<hkern u1="B" u2="V" k="20" />
+<hkern u1="B" u2="T" k="61" />
+<hkern u1="B" u2="A" k="41" />
+<hkern u1="B" u2="&#x2e;" k="82" />
+<hkern u1="B" u2="&#x2c;" k="82" />
+<hkern u1="C" u2="&#x152;" k="41" />
+<hkern u1="C" u2="&#xd8;" k="41" />
+<hkern u1="C" u2="&#xd6;" k="41" />
+<hkern u1="C" u2="&#xd5;" k="41" />
+<hkern u1="C" u2="&#xd4;" k="41" />
+<hkern u1="C" u2="&#xd3;" k="41" />
+<hkern u1="C" u2="&#xd2;" k="41" />
+<hkern u1="C" u2="&#xc7;" k="41" />
+<hkern u1="C" u2="Q" k="41" />
+<hkern u1="C" u2="O" k="41" />
+<hkern u1="C" u2="G" k="41" />
+<hkern u1="C" u2="C" k="41" />
+<hkern u1="D" u2="&#x201e;" k="82" />
+<hkern u1="D" u2="&#x201a;" k="82" />
+<hkern u1="D" u2="&#x178;" k="20" />
+<hkern u1="D" u2="&#xdd;" k="20" />
+<hkern u1="D" u2="&#xc5;" k="41" />
+<hkern u1="D" u2="&#xc4;" k="41" />
+<hkern u1="D" u2="&#xc3;" k="41" />
+<hkern u1="D" u2="&#xc2;" k="41" />
+<hkern u1="D" u2="&#xc1;" k="41" />
+<hkern u1="D" u2="&#xc0;" k="41" />
+<hkern u1="D" u2="Z" k="20" />
+<hkern u1="D" u2="Y" k="20" />
+<hkern u1="D" u2="X" k="41" />
+<hkern u1="D" u2="W" k="20" />
+<hkern u1="D" u2="V" k="20" />
+<hkern u1="D" u2="T" k="61" />
+<hkern u1="D" u2="A" k="41" />
+<hkern u1="D" u2="&#x2e;" k="82" />
+<hkern u1="D" u2="&#x2c;" k="82" />
+<hkern u1="E" u2="J" k="-123" />
+<hkern u1="F" u2="&#x201e;" k="123" />
+<hkern u1="F" u2="&#x201a;" k="123" />
+<hkern u1="F" u2="&#xc5;" k="41" />
+<hkern u1="F" u2="&#xc4;" k="41" />
+<hkern u1="F" u2="&#xc3;" k="41" />
+<hkern u1="F" u2="&#xc2;" k="41" />
+<hkern u1="F" u2="&#xc1;" k="41" />
+<hkern u1="F" u2="&#xc0;" k="41" />
+<hkern u1="F" u2="A" k="41" />
+<hkern u1="F" u2="&#x3f;" k="-41" />
+<hkern u1="F" u2="&#x2e;" k="123" />
+<hkern u1="F" u2="&#x2c;" k="123" />
+<hkern u1="K" u2="&#x152;" k="41" />
+<hkern u1="K" u2="&#xd8;" k="41" />
+<hkern u1="K" u2="&#xd6;" k="41" />
+<hkern u1="K" u2="&#xd5;" k="41" />
+<hkern u1="K" u2="&#xd4;" k="41" />
+<hkern u1="K" u2="&#xd3;" k="41" />
+<hkern u1="K" u2="&#xd2;" k="41" />
+<hkern u1="K" u2="&#xc7;" k="41" />
+<hkern u1="K" u2="Q" k="41" />
+<hkern u1="K" u2="O" k="41" />
+<hkern u1="K" u2="G" k="41" />
+<hkern u1="K" u2="C" k="41" />
+<hkern u1="L" u2="&#x201d;" k="164" />
+<hkern u1="L" u2="&#x2019;" k="164" />
+<hkern u1="L" u2="&#x178;" k="61" />
+<hkern u1="L" u2="&#x152;" k="41" />
+<hkern u1="L" u2="&#xdd;" k="61" />
+<hkern u1="L" u2="&#xdc;" k="20" />
+<hkern u1="L" u2="&#xdb;" k="20" />
+<hkern u1="L" u2="&#xda;" k="20" />
+<hkern u1="L" u2="&#xd9;" k="20" />
+<hkern u1="L" u2="&#xd8;" k="41" />
+<hkern u1="L" u2="&#xd6;" k="41" />
+<hkern u1="L" u2="&#xd5;" k="41" />
+<hkern u1="L" u2="&#xd4;" k="41" />
+<hkern u1="L" u2="&#xd3;" k="41" />
+<hkern u1="L" u2="&#xd2;" k="41" />
+<hkern u1="L" u2="&#xc7;" k="41" />
+<hkern u1="L" u2="Y" k="61" />
+<hkern u1="L" u2="W" k="41" />
+<hkern u1="L" u2="V" k="41" />
+<hkern u1="L" u2="U" k="20" />
+<hkern u1="L" u2="T" k="41" />
+<hkern u1="L" u2="Q" k="41" />
+<hkern u1="L" u2="O" k="41" />
+<hkern u1="L" u2="G" k="41" />
+<hkern u1="L" u2="C" k="41" />
+<hkern u1="L" u2="&#x27;" k="164" />
+<hkern u1="L" u2="&#x22;" k="164" />
+<hkern u1="O" u2="&#x201e;" k="82" />
+<hkern u1="O" u2="&#x201a;" k="82" />
+<hkern u1="O" u2="&#x178;" k="20" />
+<hkern u1="O" u2="&#xdd;" k="20" />
+<hkern u1="O" u2="&#xc5;" k="41" />
+<hkern u1="O" u2="&#xc4;" k="41" />
+<hkern u1="O" u2="&#xc3;" k="41" />
+<hkern u1="O" u2="&#xc2;" k="41" />
+<hkern u1="O" u2="&#xc1;" k="41" />
+<hkern u1="O" u2="&#xc0;" k="41" />
+<hkern u1="O" u2="Z" k="20" />
+<hkern u1="O" u2="Y" k="20" />
+<hkern u1="O" u2="X" k="41" />
+<hkern u1="O" u2="W" k="20" />
+<hkern u1="O" u2="V" k="20" />
+<hkern u1="O" u2="T" k="61" />
+<hkern u1="O" u2="A" k="41" />
+<hkern u1="O" u2="&#x2e;" k="82" />
+<hkern u1="O" u2="&#x2c;" k="82" />
+<hkern u1="P" u2="&#x201e;" k="266" />
+<hkern u1="P" u2="&#x201a;" k="266" />
+<hkern u1="P" u2="&#xc5;" k="102" />
+<hkern u1="P" u2="&#xc4;" k="102" />
+<hkern u1="P" u2="&#xc3;" k="102" />
+<hkern u1="P" u2="&#xc2;" k="102" />
+<hkern u1="P" u2="&#xc1;" k="102" />
+<hkern u1="P" u2="&#xc0;" k="102" />
+<hkern u1="P" u2="Z" k="20" />
+<hkern u1="P" u2="X" k="41" />
+<hkern u1="P" u2="A" k="102" />
+<hkern u1="P" u2="&#x2e;" k="266" />
+<hkern u1="P" u2="&#x2c;" k="266" />
+<hkern u1="Q" u2="&#x201e;" k="82" />
+<hkern u1="Q" u2="&#x201a;" k="82" />
+<hkern u1="Q" u2="&#x178;" k="20" />
+<hkern u1="Q" u2="&#xdd;" k="20" />
+<hkern u1="Q" u2="&#xc5;" k="41" />
+<hkern u1="Q" u2="&#xc4;" k="41" />
+<hkern u1="Q" u2="&#xc3;" k="41" />
+<hkern u1="Q" u2="&#xc2;" k="41" />
+<hkern u1="Q" u2="&#xc1;" k="41" />
+<hkern u1="Q" u2="&#xc0;" k="41" />
+<hkern u1="Q" u2="Z" k="20" />
+<hkern u1="Q" u2="Y" k="20" />
+<hkern u1="Q" u2="X" k="41" />
+<hkern u1="Q" u2="W" k="20" />
+<hkern u1="Q" u2="V" k="20" />
+<hkern u1="Q" u2="T" k="61" />
+<hkern u1="Q" u2="A" k="41" />
+<hkern u1="Q" u2="&#x2e;" k="82" />
+<hkern u1="Q" u2="&#x2c;" k="82" />
+<hkern u1="T" u2="&#x201e;" k="123" />
+<hkern u1="T" u2="&#x201a;" k="123" />
+<hkern u1="T" u2="&#x2014;" k="82" />
+<hkern u1="T" u2="&#x2013;" k="82" />
+<hkern u1="T" u2="&#x153;" k="143" />
+<hkern u1="T" u2="&#x152;" k="41" />
+<hkern u1="T" u2="&#xfd;" k="41" />
+<hkern u1="T" u2="&#xfc;" k="102" />
+<hkern u1="T" u2="&#xfb;" k="102" />
+<hkern u1="T" u2="&#xfa;" k="102" />
+<hkern u1="T" u2="&#xf9;" k="102" />
+<hkern u1="T" u2="&#xf8;" k="143" />
+<hkern u1="T" u2="&#xf6;" k="143" />
+<hkern u1="T" u2="&#xf5;" k="143" />
+<hkern u1="T" u2="&#xf4;" k="143" />
+<hkern u1="T" u2="&#xf3;" k="143" />
+<hkern u1="T" u2="&#xf2;" k="143" />
+<hkern u1="T" u2="&#xeb;" k="143" />
+<hkern u1="T" u2="&#xea;" k="143" />
+<hkern u1="T" u2="&#xe9;" k="143" />
+<hkern u1="T" u2="&#xe8;" k="143" />
+<hkern u1="T" u2="&#xe7;" k="143" />
+<hkern u1="T" u2="&#xe6;" k="164" />
+<hkern u1="T" u2="&#xe5;" k="164" />
+<hkern u1="T" u2="&#xe4;" k="164" />
+<hkern u1="T" u2="&#xe3;" k="164" />
+<hkern u1="T" u2="&#xe2;" k="164" />
+<hkern u1="T" u2="&#xe1;" k="164" />
+<hkern u1="T" u2="&#xe0;" k="143" />
+<hkern u1="T" u2="&#xd8;" k="41" />
+<hkern u1="T" u2="&#xd6;" k="41" />
+<hkern u1="T" u2="&#xd5;" k="41" />
+<hkern u1="T" u2="&#xd4;" k="41" />
+<hkern u1="T" u2="&#xd3;" k="41" />
+<hkern u1="T" u2="&#xd2;" k="41" />
+<hkern u1="T" u2="&#xc7;" k="41" />
+<hkern u1="T" u2="&#xc5;" k="143" />
+<hkern u1="T" u2="&#xc4;" k="143" />
+<hkern u1="T" u2="&#xc3;" k="143" />
+<hkern u1="T" u2="&#xc2;" k="143" />
+<hkern u1="T" u2="&#xc1;" k="143" />
+<hkern u1="T" u2="&#xc0;" k="143" />
+<hkern u1="T" u2="z" k="82" />
+<hkern u1="T" u2="y" k="41" />
+<hkern u1="T" u2="x" k="41" />
+<hkern u1="T" u2="w" k="41" />
+<hkern u1="T" u2="v" k="41" />
+<hkern u1="T" u2="u" k="102" />
+<hkern u1="T" u2="s" k="123" />
+<hkern u1="T" u2="r" k="102" />
+<hkern u1="T" u2="q" k="143" />
+<hkern u1="T" u2="p" k="102" />
+<hkern u1="T" u2="o" k="143" />
+<hkern u1="T" u2="n" k="102" />
+<hkern u1="T" u2="m" k="102" />
+<hkern u1="T" u2="g" k="143" />
+<hkern u1="T" u2="e" k="143" />
+<hkern u1="T" u2="d" k="143" />
+<hkern u1="T" u2="c" k="143" />
+<hkern u1="T" u2="a" k="164" />
+<hkern u1="T" u2="T" k="-41" />
+<hkern u1="T" u2="Q" k="41" />
+<hkern u1="T" u2="O" k="41" />
+<hkern u1="T" u2="G" k="41" />
+<hkern u1="T" u2="C" k="41" />
+<hkern u1="T" u2="A" k="143" />
+<hkern u1="T" u2="&#x3f;" k="-41" />
+<hkern u1="T" u2="&#x2e;" k="123" />
+<hkern u1="T" u2="&#x2d;" k="82" />
+<hkern u1="T" u2="&#x2c;" k="123" />
+<hkern u1="U" u2="&#x201e;" k="41" />
+<hkern u1="U" u2="&#x201a;" k="41" />
+<hkern u1="U" u2="&#xc5;" k="20" />
+<hkern u1="U" u2="&#xc4;" k="20" />
+<hkern u1="U" u2="&#xc3;" k="20" />
+<hkern u1="U" u2="&#xc2;" k="20" />
+<hkern u1="U" u2="&#xc1;" k="20" />
+<hkern u1="U" u2="&#xc0;" k="20" />
+<hkern u1="U" u2="A" k="20" />
+<hkern u1="U" u2="&#x2e;" k="41" />
+<hkern u1="U" u2="&#x2c;" k="41" />
+<hkern u1="V" u2="&#x201e;" k="102" />
+<hkern u1="V" u2="&#x201a;" k="102" />
+<hkern u1="V" u2="&#x153;" k="41" />
+<hkern u1="V" u2="&#x152;" k="20" />
+<hkern u1="V" u2="&#xfc;" k="20" />
+<hkern u1="V" u2="&#xfb;" k="20" />
+<hkern u1="V" u2="&#xfa;" k="20" />
+<hkern u1="V" u2="&#xf9;" k="20" />
+<hkern u1="V" u2="&#xf8;" k="41" />
+<hkern u1="V" u2="&#xf6;" k="41" />
+<hkern u1="V" u2="&#xf5;" k="41" />
+<hkern u1="V" u2="&#xf4;" k="41" />
+<hkern u1="V" u2="&#xf3;" k="41" />
+<hkern u1="V" u2="&#xf2;" k="41" />
+<hkern u1="V" u2="&#xeb;" k="41" />
+<hkern u1="V" u2="&#xea;" k="41" />
+<hkern u1="V" u2="&#xe9;" k="41" />
+<hkern u1="V" u2="&#xe8;" k="41" />
+<hkern u1="V" u2="&#xe7;" k="41" />
+<hkern u1="V" u2="&#xe6;" k="41" />
+<hkern u1="V" u2="&#xe5;" k="41" />
+<hkern u1="V" u2="&#xe4;" k="41" />
+<hkern u1="V" u2="&#xe3;" k="41" />
+<hkern u1="V" u2="&#xe2;" k="41" />
+<hkern u1="V" u2="&#xe1;" k="41" />
+<hkern u1="V" u2="&#xe0;" k="41" />
+<hkern u1="V" u2="&#xd8;" k="20" />
+<hkern u1="V" u2="&#xd6;" k="20" />
+<hkern u1="V" u2="&#xd5;" k="20" />
+<hkern u1="V" u2="&#xd4;" k="20" />
+<hkern u1="V" u2="&#xd3;" k="20" />
+<hkern u1="V" u2="&#xd2;" k="20" />
+<hkern u1="V" u2="&#xc7;" k="20" />
+<hkern u1="V" u2="&#xc5;" k="82" />
+<hkern u1="V" u2="&#xc4;" k="82" />
+<hkern u1="V" u2="&#xc3;" k="82" />
+<hkern u1="V" u2="&#xc2;" k="82" />
+<hkern u1="V" u2="&#xc1;" k="82" />
+<hkern u1="V" u2="&#xc0;" k="82" />
+<hkern u1="V" u2="u" k="20" />
+<hkern u1="V" u2="s" k="20" />
+<hkern u1="V" u2="r" k="20" />
+<hkern u1="V" u2="q" k="41" />
+<hkern u1="V" u2="p" k="20" />
+<hkern u1="V" u2="o" k="41" />
+<hkern u1="V" u2="n" k="20" />
+<hkern u1="V" u2="m" k="20" />
+<hkern u1="V" u2="g" k="20" />
+<hkern u1="V" u2="e" k="41" />
+<hkern u1="V" u2="d" k="41" />
+<hkern u1="V" u2="c" k="41" />
+<hkern u1="V" u2="a" k="41" />
+<hkern u1="V" u2="Q" k="20" />
+<hkern u1="V" u2="O" k="20" />
+<hkern u1="V" u2="G" k="20" />
+<hkern u1="V" u2="C" k="20" />
+<hkern u1="V" u2="A" k="82" />
+<hkern u1="V" u2="&#x3f;" k="-41" />
+<hkern u1="V" u2="&#x2e;" k="102" />
+<hkern u1="V" u2="&#x2c;" k="102" />
+<hkern u1="W" u2="&#x201e;" k="102" />
+<hkern u1="W" u2="&#x201a;" k="102" />
+<hkern u1="W" u2="&#x153;" k="41" />
+<hkern u1="W" u2="&#x152;" k="20" />
+<hkern u1="W" u2="&#xfc;" k="20" />
+<hkern u1="W" u2="&#xfb;" k="20" />
+<hkern u1="W" u2="&#xfa;" k="20" />
+<hkern u1="W" u2="&#xf9;" k="20" />
+<hkern u1="W" u2="&#xf8;" k="41" />
+<hkern u1="W" u2="&#xf6;" k="41" />
+<hkern u1="W" u2="&#xf5;" k="41" />
+<hkern u1="W" u2="&#xf4;" k="41" />
+<hkern u1="W" u2="&#xf3;" k="41" />
+<hkern u1="W" u2="&#xf2;" k="41" />
+<hkern u1="W" u2="&#xeb;" k="41" />
+<hkern u1="W" u2="&#xea;" k="41" />
+<hkern u1="W" u2="&#xe9;" k="41" />
+<hkern u1="W" u2="&#xe8;" k="41" />
+<hkern u1="W" u2="&#xe7;" k="41" />
+<hkern u1="W" u2="&#xe6;" k="41" />
+<hkern u1="W" u2="&#xe5;" k="41" />
+<hkern u1="W" u2="&#xe4;" k="41" />
+<hkern u1="W" u2="&#xe3;" k="41" />
+<hkern u1="W" u2="&#xe2;" k="41" />
+<hkern u1="W" u2="&#xe1;" k="41" />
+<hkern u1="W" u2="&#xe0;" k="41" />
+<hkern u1="W" u2="&#xd8;" k="20" />
+<hkern u1="W" u2="&#xd6;" k="20" />
+<hkern u1="W" u2="&#xd5;" k="20" />
+<hkern u1="W" u2="&#xd4;" k="20" />
+<hkern u1="W" u2="&#xd3;" k="20" />
+<hkern u1="W" u2="&#xd2;" k="20" />
+<hkern u1="W" u2="&#xc7;" k="20" />
+<hkern u1="W" u2="&#xc5;" k="82" />
+<hkern u1="W" u2="&#xc4;" k="82" />
+<hkern u1="W" u2="&#xc3;" k="82" />
+<hkern u1="W" u2="&#xc2;" k="82" />
+<hkern u1="W" u2="&#xc1;" k="82" />
+<hkern u1="W" u2="&#xc0;" k="82" />
+<hkern u1="W" u2="u" k="20" />
+<hkern u1="W" u2="s" k="20" />
+<hkern u1="W" u2="r" k="20" />
+<hkern u1="W" u2="q" k="41" />
+<hkern u1="W" u2="p" k="20" />
+<hkern u1="W" u2="o" k="41" />
+<hkern u1="W" u2="n" k="20" />
+<hkern u1="W" u2="m" k="20" />
+<hkern u1="W" u2="g" k="20" />
+<hkern u1="W" u2="e" k="41" />
+<hkern u1="W" u2="d" k="41" />
+<hkern u1="W" u2="c" k="41" />
+<hkern u1="W" u2="a" k="41" />
+<hkern u1="W" u2="Q" k="20" />
+<hkern u1="W" u2="O" k="20" />
+<hkern u1="W" u2="G" k="20" />
+<hkern u1="W" u2="C" k="20" />
+<hkern u1="W" u2="A" k="82" />
+<hkern u1="W" u2="&#x3f;" k="-41" />
+<hkern u1="W" u2="&#x2e;" k="102" />
+<hkern u1="W" u2="&#x2c;" k="102" />
+<hkern u1="X" u2="&#x152;" k="41" />
+<hkern u1="X" u2="&#xd8;" k="41" />
+<hkern u1="X" u2="&#xd6;" k="41" />
+<hkern u1="X" u2="&#xd5;" k="41" />
+<hkern u1="X" u2="&#xd4;" k="41" />
+<hkern u1="X" u2="&#xd3;" k="41" />
+<hkern u1="X" u2="&#xd2;" k="41" />
+<hkern u1="X" u2="&#xc7;" k="41" />
+<hkern u1="X" u2="Q" k="41" />
+<hkern u1="X" u2="O" k="41" />
+<hkern u1="X" u2="G" k="41" />
+<hkern u1="X" u2="C" k="41" />
+<hkern u1="Y" u2="&#x201e;" k="123" />
+<hkern u1="Y" u2="&#x201a;" k="123" />
+<hkern u1="Y" u2="&#x153;" k="102" />
+<hkern u1="Y" u2="&#x152;" k="41" />
+<hkern u1="Y" u2="&#xfc;" k="61" />
+<hkern u1="Y" u2="&#xfb;" k="61" />
+<hkern u1="Y" u2="&#xfa;" k="61" />
+<hkern u1="Y" u2="&#xf9;" k="61" />
+<hkern u1="Y" u2="&#xf8;" k="102" />
+<hkern u1="Y" u2="&#xf6;" k="102" />
+<hkern u1="Y" u2="&#xf5;" k="102" />
+<hkern u1="Y" u2="&#xf4;" k="102" />
+<hkern u1="Y" u2="&#xf3;" k="102" />
+<hkern u1="Y" u2="&#xf2;" k="102" />
+<hkern u1="Y" u2="&#xeb;" k="102" />
+<hkern u1="Y" u2="&#xea;" k="102" />
+<hkern u1="Y" u2="&#xe9;" k="102" />
+<hkern u1="Y" u2="&#xe8;" k="102" />
+<hkern u1="Y" u2="&#xe7;" k="102" />
+<hkern u1="Y" u2="&#xe6;" k="102" />
+<hkern u1="Y" u2="&#xe5;" k="102" />
+<hkern u1="Y" u2="&#xe4;" k="102" />
+<hkern u1="Y" u2="&#xe3;" k="102" />
+<hkern u1="Y" u2="&#xe2;" k="102" />
+<hkern u1="Y" u2="&#xe1;" k="102" />
+<hkern u1="Y" u2="&#xe0;" k="102" />
+<hkern u1="Y" u2="&#xd8;" k="41" />
+<hkern u1="Y" u2="&#xd6;" k="41" />
+<hkern u1="Y" u2="&#xd5;" k="41" />
+<hkern u1="Y" u2="&#xd4;" k="41" />
+<hkern u1="Y" u2="&#xd3;" k="41" />
+<hkern u1="Y" u2="&#xd2;" k="41" />
+<hkern u1="Y" u2="&#xc7;" k="41" />
+<hkern u1="Y" u2="&#xc5;" k="123" />
+<hkern u1="Y" u2="&#xc4;" k="123" />
+<hkern u1="Y" u2="&#xc3;" k="123" />
+<hkern u1="Y" u2="&#xc2;" k="123" />
+<hkern u1="Y" u2="&#xc1;" k="123" />
+<hkern u1="Y" u2="&#xc0;" k="123" />
+<hkern u1="Y" u2="z" k="41" />
+<hkern u1="Y" u2="u" k="61" />
+<hkern u1="Y" u2="s" k="82" />
+<hkern u1="Y" u2="r" k="61" />
+<hkern u1="Y" u2="q" k="102" />
+<hkern u1="Y" u2="p" k="61" />
+<hkern u1="Y" u2="o" k="102" />
+<hkern u1="Y" u2="n" k="61" />
+<hkern u1="Y" u2="m" k="61" />
+<hkern u1="Y" u2="g" k="41" />
+<hkern u1="Y" u2="e" k="102" />
+<hkern u1="Y" u2="d" k="102" />
+<hkern u1="Y" u2="c" k="102" />
+<hkern u1="Y" u2="a" k="102" />
+<hkern u1="Y" u2="Q" k="41" />
+<hkern u1="Y" u2="O" k="41" />
+<hkern u1="Y" u2="G" k="41" />
+<hkern u1="Y" u2="C" k="41" />
+<hkern u1="Y" u2="A" k="123" />
+<hkern u1="Y" u2="&#x3f;" k="-41" />
+<hkern u1="Y" u2="&#x2e;" k="123" />
+<hkern u1="Y" u2="&#x2c;" k="123" />
+<hkern u1="Z" u2="&#x152;" k="20" />
+<hkern u1="Z" u2="&#xd8;" k="20" />
+<hkern u1="Z" u2="&#xd6;" k="20" />
+<hkern u1="Z" u2="&#xd5;" k="20" />
+<hkern u1="Z" u2="&#xd4;" k="20" />
+<hkern u1="Z" u2="&#xd3;" k="20" />
+<hkern u1="Z" u2="&#xd2;" k="20" />
+<hkern u1="Z" u2="&#xc7;" k="20" />
+<hkern u1="Z" u2="Q" k="20" />
+<hkern u1="Z" u2="O" k="20" />
+<hkern u1="Z" u2="G" k="20" />
+<hkern u1="Z" u2="C" k="20" />
+<hkern u1="[" u2="J" k="-184" />
+<hkern u1="a" u2="&#x201d;" k="20" />
+<hkern u1="a" u2="&#x2019;" k="20" />
+<hkern u1="a" u2="&#x27;" k="20" />
+<hkern u1="a" u2="&#x22;" k="20" />
+<hkern u1="b" u2="&#x201d;" k="20" />
+<hkern u1="b" u2="&#x2019;" k="20" />
+<hkern u1="b" u2="&#xfd;" k="41" />
+<hkern u1="b" u2="z" k="20" />
+<hkern u1="b" u2="y" k="41" />
+<hkern u1="b" u2="x" k="41" />
+<hkern u1="b" u2="w" k="41" />
+<hkern u1="b" u2="v" k="41" />
+<hkern u1="b" u2="&#x27;" k="20" />
+<hkern u1="b" u2="&#x22;" k="20" />
+<hkern u1="c" u2="&#x201d;" k="-41" />
+<hkern u1="c" u2="&#x2019;" k="-41" />
+<hkern u1="c" u2="&#x27;" k="-41" />
+<hkern u1="c" u2="&#x22;" k="-41" />
+<hkern u1="e" u2="&#x201d;" k="20" />
+<hkern u1="e" u2="&#x2019;" k="20" />
+<hkern u1="e" u2="&#xfd;" k="41" />
+<hkern u1="e" u2="z" k="20" />
+<hkern u1="e" u2="y" k="41" />
+<hkern u1="e" u2="x" k="41" />
+<hkern u1="e" u2="w" k="41" />
+<hkern u1="e" u2="v" k="41" />
+<hkern u1="e" u2="&#x27;" k="20" />
+<hkern u1="e" u2="&#x22;" k="20" />
+<hkern u1="f" u2="&#x201d;" k="-123" />
+<hkern u1="f" u2="&#x2019;" k="-123" />
+<hkern u1="f" u2="&#x27;" k="-123" />
+<hkern u1="f" u2="&#x22;" k="-123" />
+<hkern u1="h" u2="&#x201d;" k="20" />
+<hkern u1="h" u2="&#x2019;" k="20" />
+<hkern u1="h" u2="&#x27;" k="20" />
+<hkern u1="h" u2="&#x22;" k="20" />
+<hkern u1="k" u2="&#x153;" k="41" />
+<hkern u1="k" u2="&#xf8;" k="41" />
+<hkern u1="k" u2="&#xf6;" k="41" />
+<hkern u1="k" u2="&#xf5;" k="41" />
+<hkern u1="k" u2="&#xf4;" k="41" />
+<hkern u1="k" u2="&#xf3;" k="41" />
+<hkern u1="k" u2="&#xf2;" k="41" />
+<hkern u1="k" u2="&#xeb;" k="41" />
+<hkern u1="k" u2="&#xea;" k="41" />
+<hkern u1="k" u2="&#xe9;" k="41" />
+<hkern u1="k" u2="&#xe8;" k="41" />
+<hkern u1="k" u2="&#xe7;" k="41" />
+<hkern u1="k" u2="&#xe0;" k="41" />
+<hkern u1="k" u2="q" k="41" />
+<hkern u1="k" u2="o" k="41" />
+<hkern u1="k" u2="e" k="41" />
+<hkern u1="k" u2="d" k="41" />
+<hkern u1="k" u2="c" k="41" />
+<hkern u1="m" u2="&#x201d;" k="20" />
+<hkern u1="m" u2="&#x2019;" k="20" />
+<hkern u1="m" u2="&#x27;" k="20" />
+<hkern u1="m" u2="&#x22;" k="20" />
+<hkern u1="n" u2="&#x201d;" k="20" />
+<hkern u1="n" u2="&#x2019;" k="20" />
+<hkern u1="n" u2="&#x27;" k="20" />
+<hkern u1="n" u2="&#x22;" k="20" />
+<hkern u1="o" u2="&#x201d;" k="20" />
+<hkern u1="o" u2="&#x2019;" k="20" />
+<hkern u1="o" u2="&#xfd;" k="41" />
+<hkern u1="o" u2="z" k="20" />
+<hkern u1="o" u2="y" k="41" />
+<hkern u1="o" u2="x" k="41" />
+<hkern u1="o" u2="w" k="41" />
+<hkern u1="o" u2="v" k="41" />
+<hkern u1="o" u2="&#x27;" k="20" />
+<hkern u1="o" u2="&#x22;" k="20" />
+<hkern u1="p" u2="&#x201d;" k="20" />
+<hkern u1="p" u2="&#x2019;" k="20" />
+<hkern u1="p" u2="&#xfd;" k="41" />
+<hkern u1="p" u2="z" k="20" />
+<hkern u1="p" u2="y" k="41" />
+<hkern u1="p" u2="x" k="41" />
+<hkern u1="p" u2="w" k="41" />
+<hkern u1="p" u2="v" k="41" />
+<hkern u1="p" u2="&#x27;" k="20" />
+<hkern u1="p" u2="&#x22;" k="20" />
+<hkern u1="r" u2="&#x201d;" k="-82" />
+<hkern u1="r" u2="&#x2019;" k="-82" />
+<hkern u1="r" u2="&#x153;" k="41" />
+<hkern u1="r" u2="&#xf8;" k="41" />
+<hkern u1="r" u2="&#xf6;" k="41" />
+<hkern u1="r" u2="&#xf5;" k="41" />
+<hkern u1="r" u2="&#xf4;" k="41" />
+<hkern u1="r" u2="&#xf3;" k="41" />
+<hkern u1="r" u2="&#xf2;" k="41" />
+<hkern u1="r" u2="&#xeb;" k="41" />
+<hkern u1="r" u2="&#xea;" k="41" />
+<hkern u1="r" u2="&#xe9;" k="41" />
+<hkern u1="r" u2="&#xe8;" k="41" />
+<hkern u1="r" u2="&#xe7;" k="41" />
+<hkern u1="r" u2="&#xe6;" k="41" />
+<hkern u1="r" u2="&#xe5;" k="41" />
+<hkern u1="r" u2="&#xe4;" k="41" />
+<hkern u1="r" u2="&#xe3;" k="41" />
+<hkern u1="r" u2="&#xe2;" k="41" />
+<hkern u1="r" u2="&#xe1;" k="41" />
+<hkern u1="r" u2="&#xe0;" k="41" />
+<hkern u1="r" u2="q" k="41" />
+<hkern u1="r" u2="o" k="41" />
+<hkern u1="r" u2="g" k="20" />
+<hkern u1="r" u2="e" k="41" />
+<hkern u1="r" u2="d" k="41" />
+<hkern u1="r" u2="c" k="41" />
+<hkern u1="r" u2="a" k="41" />
+<hkern u1="r" u2="&#x27;" k="-82" />
+<hkern u1="r" u2="&#x22;" k="-82" />
+<hkern u1="t" u2="&#x201d;" k="-41" />
+<hkern u1="t" u2="&#x2019;" k="-41" />
+<hkern u1="t" u2="&#x27;" k="-41" />
+<hkern u1="t" u2="&#x22;" k="-41" />
+<hkern u1="v" u2="&#x201e;" k="82" />
+<hkern u1="v" u2="&#x201d;" k="-82" />
+<hkern u1="v" u2="&#x201a;" k="82" />
+<hkern u1="v" u2="&#x2019;" k="-82" />
+<hkern u1="v" u2="&#x3f;" k="-41" />
+<hkern u1="v" u2="&#x2e;" k="82" />
+<hkern u1="v" u2="&#x2c;" k="82" />
+<hkern u1="v" u2="&#x27;" k="-82" />
+<hkern u1="v" u2="&#x22;" k="-82" />
+<hkern u1="w" u2="&#x201e;" k="82" />
+<hkern u1="w" u2="&#x201d;" k="-82" />
+<hkern u1="w" u2="&#x201a;" k="82" />
+<hkern u1="w" u2="&#x2019;" k="-82" />
+<hkern u1="w" u2="&#x3f;" k="-41" />
+<hkern u1="w" u2="&#x2e;" k="82" />
+<hkern u1="w" u2="&#x2c;" k="82" />
+<hkern u1="w" u2="&#x27;" k="-82" />
+<hkern u1="w" u2="&#x22;" k="-82" />
+<hkern u1="x" u2="&#x153;" k="41" />
+<hkern u1="x" u2="&#xf8;" k="41" />
+<hkern u1="x" u2="&#xf6;" k="41" />
+<hkern u1="x" u2="&#xf5;" k="41" />
+<hkern u1="x" u2="&#xf4;" k="41" />
+<hkern u1="x" u2="&#xf3;" k="41" />
+<hkern u1="x" u2="&#xf2;" k="41" />
+<hkern u1="x" u2="&#xeb;" k="41" />
+<hkern u1="x" u2="&#xea;" k="41" />
+<hkern u1="x" u2="&#xe9;" k="41" />
+<hkern u1="x" u2="&#xe8;" k="41" />
+<hkern u1="x" u2="&#xe7;" k="41" />
+<hkern u1="x" u2="&#xe0;" k="41" />
+<hkern u1="x" u2="q" k="41" />
+<hkern u1="x" u2="o" k="41" />
+<hkern u1="x" u2="e" k="41" />
+<hkern u1="x" u2="d" k="41" />
+<hkern u1="x" u2="c" k="41" />
+<hkern u1="y" u2="&#x201e;" k="82" />
+<hkern u1="y" u2="&#x201d;" k="-82" />
+<hkern u1="y" u2="&#x201a;" k="82" />
+<hkern u1="y" u2="&#x2019;" k="-82" />
+<hkern u1="y" u2="&#x3f;" k="-41" />
+<hkern u1="y" u2="&#x2e;" k="82" />
+<hkern u1="y" u2="&#x2c;" k="82" />
+<hkern u1="y" u2="&#x27;" k="-82" />
+<hkern u1="y" u2="&#x22;" k="-82" />
+<hkern u1="&#x7b;" u2="J" k="-184" />
+<hkern u1="&#xc0;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc0;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc0;" u2="&#x178;" k="123" />
+<hkern u1="&#xc0;" u2="&#x152;" k="41" />
+<hkern u1="&#xc0;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc0;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc0;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc0;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc0;" u2="Y" k="123" />
+<hkern u1="&#xc0;" u2="W" k="82" />
+<hkern u1="&#xc0;" u2="V" k="82" />
+<hkern u1="&#xc0;" u2="T" k="143" />
+<hkern u1="&#xc0;" u2="Q" k="41" />
+<hkern u1="&#xc0;" u2="O" k="41" />
+<hkern u1="&#xc0;" u2="J" k="-266" />
+<hkern u1="&#xc0;" u2="G" k="41" />
+<hkern u1="&#xc0;" u2="C" k="41" />
+<hkern u1="&#xc0;" u2="&#x27;" k="143" />
+<hkern u1="&#xc0;" u2="&#x22;" k="143" />
+<hkern u1="&#xc1;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc1;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc1;" u2="&#x178;" k="123" />
+<hkern u1="&#xc1;" u2="&#x152;" k="41" />
+<hkern u1="&#xc1;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc1;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc1;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc1;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc1;" u2="Y" k="123" />
+<hkern u1="&#xc1;" u2="W" k="82" />
+<hkern u1="&#xc1;" u2="V" k="82" />
+<hkern u1="&#xc1;" u2="T" k="143" />
+<hkern u1="&#xc1;" u2="Q" k="41" />
+<hkern u1="&#xc1;" u2="O" k="41" />
+<hkern u1="&#xc1;" u2="J" k="-266" />
+<hkern u1="&#xc1;" u2="G" k="41" />
+<hkern u1="&#xc1;" u2="C" k="41" />
+<hkern u1="&#xc1;" u2="&#x27;" k="143" />
+<hkern u1="&#xc1;" u2="&#x22;" k="143" />
+<hkern u1="&#xc2;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc2;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc2;" u2="&#x178;" k="123" />
+<hkern u1="&#xc2;" u2="&#x152;" k="41" />
+<hkern u1="&#xc2;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc2;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc2;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc2;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc2;" u2="Y" k="123" />
+<hkern u1="&#xc2;" u2="W" k="82" />
+<hkern u1="&#xc2;" u2="V" k="82" />
+<hkern u1="&#xc2;" u2="T" k="143" />
+<hkern u1="&#xc2;" u2="Q" k="41" />
+<hkern u1="&#xc2;" u2="O" k="41" />
+<hkern u1="&#xc2;" u2="J" k="-266" />
+<hkern u1="&#xc2;" u2="G" k="41" />
+<hkern u1="&#xc2;" u2="C" k="41" />
+<hkern u1="&#xc2;" u2="&#x27;" k="143" />
+<hkern u1="&#xc2;" u2="&#x22;" k="143" />
+<hkern u1="&#xc3;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc3;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc3;" u2="&#x178;" k="123" />
+<hkern u1="&#xc3;" u2="&#x152;" k="41" />
+<hkern u1="&#xc3;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc3;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc3;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc3;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc3;" u2="Y" k="123" />
+<hkern u1="&#xc3;" u2="W" k="82" />
+<hkern u1="&#xc3;" u2="V" k="82" />
+<hkern u1="&#xc3;" u2="T" k="143" />
+<hkern u1="&#xc3;" u2="Q" k="41" />
+<hkern u1="&#xc3;" u2="O" k="41" />
+<hkern u1="&#xc3;" u2="J" k="-266" />
+<hkern u1="&#xc3;" u2="G" k="41" />
+<hkern u1="&#xc3;" u2="C" k="41" />
+<hkern u1="&#xc3;" u2="&#x27;" k="143" />
+<hkern u1="&#xc3;" u2="&#x22;" k="143" />
+<hkern u1="&#xc4;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc4;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc4;" u2="&#x178;" k="123" />
+<hkern u1="&#xc4;" u2="&#x152;" k="41" />
+<hkern u1="&#xc4;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc4;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc4;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc4;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc4;" u2="Y" k="123" />
+<hkern u1="&#xc4;" u2="W" k="82" />
+<hkern u1="&#xc4;" u2="V" k="82" />
+<hkern u1="&#xc4;" u2="T" k="143" />
+<hkern u1="&#xc4;" u2="Q" k="41" />
+<hkern u1="&#xc4;" u2="O" k="41" />
+<hkern u1="&#xc4;" u2="J" k="-266" />
+<hkern u1="&#xc4;" u2="G" k="41" />
+<hkern u1="&#xc4;" u2="C" k="41" />
+<hkern u1="&#xc4;" u2="&#x27;" k="143" />
+<hkern u1="&#xc4;" u2="&#x22;" k="143" />
+<hkern u1="&#xc5;" u2="&#x201d;" k="143" />
+<hkern u1="&#xc5;" u2="&#x2019;" k="143" />
+<hkern u1="&#xc5;" u2="&#x178;" k="123" />
+<hkern u1="&#xc5;" u2="&#x152;" k="41" />
+<hkern u1="&#xc5;" u2="&#xdd;" k="123" />
+<hkern u1="&#xc5;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc5;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc5;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc5;" u2="Y" k="123" />
+<hkern u1="&#xc5;" u2="W" k="82" />
+<hkern u1="&#xc5;" u2="V" k="82" />
+<hkern u1="&#xc5;" u2="T" k="143" />
+<hkern u1="&#xc5;" u2="Q" k="41" />
+<hkern u1="&#xc5;" u2="O" k="41" />
+<hkern u1="&#xc5;" u2="J" k="-266" />
+<hkern u1="&#xc5;" u2="G" k="41" />
+<hkern u1="&#xc5;" u2="C" k="41" />
+<hkern u1="&#xc5;" u2="&#x27;" k="143" />
+<hkern u1="&#xc5;" u2="&#x22;" k="143" />
+<hkern u1="&#xc6;" u2="J" k="-123" />
+<hkern u1="&#xc7;" u2="&#x152;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd8;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd6;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd5;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd4;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd3;" k="41" />
+<hkern u1="&#xc7;" u2="&#xd2;" k="41" />
+<hkern u1="&#xc7;" u2="&#xc7;" k="41" />
+<hkern u1="&#xc7;" u2="Q" k="41" />
+<hkern u1="&#xc7;" u2="O" k="41" />
+<hkern u1="&#xc7;" u2="G" k="41" />
+<hkern u1="&#xc7;" u2="C" k="41" />
+<hkern u1="&#xc8;" u2="J" k="-123" />
+<hkern u1="&#xc9;" u2="J" k="-123" />
+<hkern u1="&#xca;" u2="J" k="-123" />
+<hkern u1="&#xcb;" u2="J" k="-123" />
+<hkern u1="&#xd0;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd0;" u2="&#x178;" k="20" />
+<hkern u1="&#xd0;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd0;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd0;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd0;" u2="Z" k="20" />
+<hkern u1="&#xd0;" u2="Y" k="20" />
+<hkern u1="&#xd0;" u2="X" k="41" />
+<hkern u1="&#xd0;" u2="W" k="20" />
+<hkern u1="&#xd0;" u2="V" k="20" />
+<hkern u1="&#xd0;" u2="T" k="61" />
+<hkern u1="&#xd0;" u2="A" k="41" />
+<hkern u1="&#xd0;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd0;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd2;" u2="&#x178;" k="20" />
+<hkern u1="&#xd2;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd2;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd2;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd2;" u2="Z" k="20" />
+<hkern u1="&#xd2;" u2="Y" k="20" />
+<hkern u1="&#xd2;" u2="X" k="41" />
+<hkern u1="&#xd2;" u2="W" k="20" />
+<hkern u1="&#xd2;" u2="V" k="20" />
+<hkern u1="&#xd2;" u2="T" k="61" />
+<hkern u1="&#xd2;" u2="A" k="41" />
+<hkern u1="&#xd2;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd2;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd3;" u2="&#x178;" k="20" />
+<hkern u1="&#xd3;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd3;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd3;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd3;" u2="Z" k="20" />
+<hkern u1="&#xd3;" u2="Y" k="20" />
+<hkern u1="&#xd3;" u2="X" k="41" />
+<hkern u1="&#xd3;" u2="W" k="20" />
+<hkern u1="&#xd3;" u2="V" k="20" />
+<hkern u1="&#xd3;" u2="T" k="61" />
+<hkern u1="&#xd3;" u2="A" k="41" />
+<hkern u1="&#xd3;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd3;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd4;" u2="&#x178;" k="20" />
+<hkern u1="&#xd4;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd4;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd4;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd4;" u2="Z" k="20" />
+<hkern u1="&#xd4;" u2="Y" k="20" />
+<hkern u1="&#xd4;" u2="X" k="41" />
+<hkern u1="&#xd4;" u2="W" k="20" />
+<hkern u1="&#xd4;" u2="V" k="20" />
+<hkern u1="&#xd4;" u2="T" k="61" />
+<hkern u1="&#xd4;" u2="A" k="41" />
+<hkern u1="&#xd4;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd4;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd5;" u2="&#x178;" k="20" />
+<hkern u1="&#xd5;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd5;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd5;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd5;" u2="Z" k="20" />
+<hkern u1="&#xd5;" u2="Y" k="20" />
+<hkern u1="&#xd5;" u2="X" k="41" />
+<hkern u1="&#xd5;" u2="W" k="20" />
+<hkern u1="&#xd5;" u2="V" k="20" />
+<hkern u1="&#xd5;" u2="T" k="61" />
+<hkern u1="&#xd5;" u2="A" k="41" />
+<hkern u1="&#xd5;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd5;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd6;" u2="&#x178;" k="20" />
+<hkern u1="&#xd6;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd6;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd6;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd6;" u2="Z" k="20" />
+<hkern u1="&#xd6;" u2="Y" k="20" />
+<hkern u1="&#xd6;" u2="X" k="41" />
+<hkern u1="&#xd6;" u2="W" k="20" />
+<hkern u1="&#xd6;" u2="V" k="20" />
+<hkern u1="&#xd6;" u2="T" k="61" />
+<hkern u1="&#xd6;" u2="A" k="41" />
+<hkern u1="&#xd6;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd6;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x201a;" k="82" />
+<hkern u1="&#xd8;" u2="&#x178;" k="20" />
+<hkern u1="&#xd8;" u2="&#xdd;" k="20" />
+<hkern u1="&#xd8;" u2="&#xc5;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc4;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc3;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc2;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc1;" k="41" />
+<hkern u1="&#xd8;" u2="&#xc0;" k="41" />
+<hkern u1="&#xd8;" u2="Z" k="20" />
+<hkern u1="&#xd8;" u2="Y" k="20" />
+<hkern u1="&#xd8;" u2="X" k="41" />
+<hkern u1="&#xd8;" u2="W" k="20" />
+<hkern u1="&#xd8;" u2="V" k="20" />
+<hkern u1="&#xd8;" u2="T" k="61" />
+<hkern u1="&#xd8;" u2="A" k="41" />
+<hkern u1="&#xd8;" u2="&#x2e;" k="82" />
+<hkern u1="&#xd8;" u2="&#x2c;" k="82" />
+<hkern u1="&#xd9;" u2="&#x201e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x201a;" k="41" />
+<hkern u1="&#xd9;" u2="&#xc5;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc4;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc3;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc2;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc1;" k="20" />
+<hkern u1="&#xd9;" u2="&#xc0;" k="20" />
+<hkern u1="&#xd9;" u2="A" k="20" />
+<hkern u1="&#xd9;" u2="&#x2e;" k="41" />
+<hkern u1="&#xd9;" u2="&#x2c;" k="41" />
+<hkern u1="&#xda;" u2="&#x201e;" k="41" />
+<hkern u1="&#xda;" u2="&#x201a;" k="41" />
+<hkern u1="&#xda;" u2="&#xc5;" k="20" />
+<hkern u1="&#xda;" u2="&#xc4;" k="20" />
+<hkern u1="&#xda;" u2="&#xc3;" k="20" />
+<hkern u1="&#xda;" u2="&#xc2;" k="20" />
+<hkern u1="&#xda;" u2="&#xc1;" k="20" />
+<hkern u1="&#xda;" u2="&#xc0;" k="20" />
+<hkern u1="&#xda;" u2="A" k="20" />
+<hkern u1="&#xda;" u2="&#x2e;" k="41" />
+<hkern u1="&#xda;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdb;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdb;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdb;" u2="A" k="20" />
+<hkern u1="&#xdb;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdb;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x201a;" k="41" />
+<hkern u1="&#xdc;" u2="&#xc5;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc4;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc3;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc2;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc1;" k="20" />
+<hkern u1="&#xdc;" u2="&#xc0;" k="20" />
+<hkern u1="&#xdc;" u2="A" k="20" />
+<hkern u1="&#xdc;" u2="&#x2e;" k="41" />
+<hkern u1="&#xdc;" u2="&#x2c;" k="41" />
+<hkern u1="&#xdd;" u2="&#x201e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x201a;" k="123" />
+<hkern u1="&#xdd;" u2="&#x153;" k="102" />
+<hkern u1="&#xdd;" u2="&#x152;" k="41" />
+<hkern u1="&#xdd;" u2="&#xfc;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfb;" k="61" />
+<hkern u1="&#xdd;" u2="&#xfa;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf9;" k="61" />
+<hkern u1="&#xdd;" u2="&#xf8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xf2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xeb;" k="102" />
+<hkern u1="&#xdd;" u2="&#xea;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe9;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe8;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe7;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe6;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe5;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe4;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe3;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe2;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe1;" k="102" />
+<hkern u1="&#xdd;" u2="&#xe0;" k="102" />
+<hkern u1="&#xdd;" u2="&#xd8;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd6;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd5;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd4;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd3;" k="41" />
+<hkern u1="&#xdd;" u2="&#xd2;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc7;" k="41" />
+<hkern u1="&#xdd;" u2="&#xc5;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc4;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc3;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc2;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc1;" k="123" />
+<hkern u1="&#xdd;" u2="&#xc0;" k="123" />
+<hkern u1="&#xdd;" u2="z" k="41" />
+<hkern u1="&#xdd;" u2="u" k="61" />
+<hkern u1="&#xdd;" u2="s" k="82" />
+<hkern u1="&#xdd;" u2="r" k="61" />
+<hkern u1="&#xdd;" u2="q" k="102" />
+<hkern u1="&#xdd;" u2="p" k="61" />
+<hkern u1="&#xdd;" u2="o" k="102" />
+<hkern u1="&#xdd;" u2="n" k="61" />
+<hkern u1="&#xdd;" u2="m" k="61" />
+<hkern u1="&#xdd;" u2="g" k="41" />
+<hkern u1="&#xdd;" u2="e" k="102" />
+<hkern u1="&#xdd;" u2="d" k="102" />
+<hkern u1="&#xdd;" u2="c" k="102" />
+<hkern u1="&#xdd;" u2="a" k="102" />
+<hkern u1="&#xdd;" u2="Q" k="41" />
+<hkern u1="&#xdd;" u2="O" k="41" />
+<hkern u1="&#xdd;" u2="G" k="41" />
+<hkern u1="&#xdd;" u2="C" k="41" />
+<hkern u1="&#xdd;" u2="A" k="123" />
+<hkern u1="&#xdd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xdd;" u2="&#x2e;" k="123" />
+<hkern u1="&#xdd;" u2="&#x2c;" k="123" />
+<hkern u1="&#xde;" u2="&#x201e;" k="266" />
+<hkern u1="&#xde;" u2="&#x201a;" k="266" />
+<hkern u1="&#xde;" u2="&#xc5;" k="102" />
+<hkern u1="&#xde;" u2="&#xc4;" k="102" />
+<hkern u1="&#xde;" u2="&#xc3;" k="102" />
+<hkern u1="&#xde;" u2="&#xc2;" k="102" />
+<hkern u1="&#xde;" u2="&#xc1;" k="102" />
+<hkern u1="&#xde;" u2="&#xc0;" k="102" />
+<hkern u1="&#xde;" u2="Z" k="20" />
+<hkern u1="&#xde;" u2="X" k="41" />
+<hkern u1="&#xde;" u2="A" k="102" />
+<hkern u1="&#xde;" u2="&#x2e;" k="266" />
+<hkern u1="&#xde;" u2="&#x2c;" k="266" />
+<hkern u1="&#xe0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe0;" u2="&#x27;" k="20" />
+<hkern u1="&#xe0;" u2="&#x22;" k="20" />
+<hkern u1="&#xe1;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe1;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe1;" u2="&#x27;" k="20" />
+<hkern u1="&#xe1;" u2="&#x22;" k="20" />
+<hkern u1="&#xe2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe2;" u2="&#x27;" k="20" />
+<hkern u1="&#xe2;" u2="&#x22;" k="20" />
+<hkern u1="&#xe3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe3;" u2="&#x27;" k="20" />
+<hkern u1="&#xe3;" u2="&#x22;" k="20" />
+<hkern u1="&#xe4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe4;" u2="&#x27;" k="20" />
+<hkern u1="&#xe4;" u2="&#x22;" k="20" />
+<hkern u1="&#xe5;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe5;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe5;" u2="&#x27;" k="20" />
+<hkern u1="&#xe5;" u2="&#x22;" k="20" />
+<hkern u1="&#xe8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe8;" u2="z" k="20" />
+<hkern u1="&#xe8;" u2="y" k="41" />
+<hkern u1="&#xe8;" u2="x" k="41" />
+<hkern u1="&#xe8;" u2="w" k="41" />
+<hkern u1="&#xe8;" u2="v" k="41" />
+<hkern u1="&#xe8;" u2="&#x27;" k="20" />
+<hkern u1="&#xe8;" u2="&#x22;" k="20" />
+<hkern u1="&#xe9;" u2="&#x201d;" k="20" />
+<hkern u1="&#xe9;" u2="&#x2019;" k="20" />
+<hkern u1="&#xe9;" u2="&#xfd;" k="41" />
+<hkern u1="&#xe9;" u2="z" k="20" />
+<hkern u1="&#xe9;" u2="y" k="41" />
+<hkern u1="&#xe9;" u2="x" k="41" />
+<hkern u1="&#xe9;" u2="w" k="41" />
+<hkern u1="&#xe9;" u2="v" k="41" />
+<hkern u1="&#xe9;" u2="&#x27;" k="20" />
+<hkern u1="&#xe9;" u2="&#x22;" k="20" />
+<hkern u1="&#xea;" u2="&#x201d;" k="20" />
+<hkern u1="&#xea;" u2="&#x2019;" k="20" />
+<hkern u1="&#xea;" u2="&#xfd;" k="41" />
+<hkern u1="&#xea;" u2="z" k="20" />
+<hkern u1="&#xea;" u2="y" k="41" />
+<hkern u1="&#xea;" u2="x" k="41" />
+<hkern u1="&#xea;" u2="w" k="41" />
+<hkern u1="&#xea;" u2="v" k="41" />
+<hkern u1="&#xea;" u2="&#x27;" k="20" />
+<hkern u1="&#xea;" u2="&#x22;" k="20" />
+<hkern u1="&#xeb;" u2="&#x201d;" k="20" />
+<hkern u1="&#xeb;" u2="&#x2019;" k="20" />
+<hkern u1="&#xeb;" u2="&#xfd;" k="41" />
+<hkern u1="&#xeb;" u2="z" k="20" />
+<hkern u1="&#xeb;" u2="y" k="41" />
+<hkern u1="&#xeb;" u2="x" k="41" />
+<hkern u1="&#xeb;" u2="w" k="41" />
+<hkern u1="&#xeb;" u2="v" k="41" />
+<hkern u1="&#xeb;" u2="&#x27;" k="20" />
+<hkern u1="&#xeb;" u2="&#x22;" k="20" />
+<hkern u1="&#xf0;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf0;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf0;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf0;" u2="z" k="20" />
+<hkern u1="&#xf0;" u2="y" k="41" />
+<hkern u1="&#xf0;" u2="x" k="41" />
+<hkern u1="&#xf0;" u2="w" k="41" />
+<hkern u1="&#xf0;" u2="v" k="41" />
+<hkern u1="&#xf0;" u2="&#x27;" k="20" />
+<hkern u1="&#xf0;" u2="&#x22;" k="20" />
+<hkern u1="&#xf2;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf2;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf2;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf2;" u2="z" k="20" />
+<hkern u1="&#xf2;" u2="y" k="41" />
+<hkern u1="&#xf2;" u2="x" k="41" />
+<hkern u1="&#xf2;" u2="w" k="41" />
+<hkern u1="&#xf2;" u2="v" k="41" />
+<hkern u1="&#xf2;" u2="&#x27;" k="20" />
+<hkern u1="&#xf2;" u2="&#x22;" k="20" />
+<hkern u1="&#xf3;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf3;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf3;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf3;" u2="z" k="20" />
+<hkern u1="&#xf3;" u2="y" k="41" />
+<hkern u1="&#xf3;" u2="x" k="41" />
+<hkern u1="&#xf3;" u2="w" k="41" />
+<hkern u1="&#xf3;" u2="v" k="41" />
+<hkern u1="&#xf3;" u2="&#x27;" k="20" />
+<hkern u1="&#xf3;" u2="&#x22;" k="20" />
+<hkern u1="&#xf4;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf4;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf4;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf4;" u2="z" k="20" />
+<hkern u1="&#xf4;" u2="y" k="41" />
+<hkern u1="&#xf4;" u2="x" k="41" />
+<hkern u1="&#xf4;" u2="w" k="41" />
+<hkern u1="&#xf4;" u2="v" k="41" />
+<hkern u1="&#xf4;" u2="&#x27;" k="20" />
+<hkern u1="&#xf4;" u2="&#x22;" k="20" />
+<hkern u1="&#xf6;" u2="&#x201d;" k="41" />
+<hkern u1="&#xf6;" u2="&#x2019;" k="41" />
+<hkern u1="&#xf6;" u2="&#x27;" k="41" />
+<hkern u1="&#xf6;" u2="&#x22;" k="41" />
+<hkern u1="&#xf8;" u2="&#x201d;" k="20" />
+<hkern u1="&#xf8;" u2="&#x2019;" k="20" />
+<hkern u1="&#xf8;" u2="&#xfd;" k="41" />
+<hkern u1="&#xf8;" u2="z" k="20" />
+<hkern u1="&#xf8;" u2="y" k="41" />
+<hkern u1="&#xf8;" u2="x" k="41" />
+<hkern u1="&#xf8;" u2="w" k="41" />
+<hkern u1="&#xf8;" u2="v" k="41" />
+<hkern u1="&#xf8;" u2="&#x27;" k="20" />
+<hkern u1="&#xf8;" u2="&#x22;" k="20" />
+<hkern u1="&#xfd;" u2="&#x201e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x201a;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xfd;" u2="&#x2e;" k="82" />
+<hkern u1="&#xfd;" u2="&#x2c;" k="82" />
+<hkern u1="&#xfd;" u2="&#x27;" k="-82" />
+<hkern u1="&#xfd;" u2="&#x22;" k="-82" />
+<hkern u1="&#xfe;" u2="&#x201d;" k="20" />
+<hkern u1="&#xfe;" u2="&#x2019;" k="20" />
+<hkern u1="&#xfe;" u2="&#xfd;" k="41" />
+<hkern u1="&#xfe;" u2="z" k="20" />
+<hkern u1="&#xfe;" u2="y" k="41" />
+<hkern u1="&#xfe;" u2="x" k="41" />
+<hkern u1="&#xfe;" u2="w" k="41" />
+<hkern u1="&#xfe;" u2="v" k="41" />
+<hkern u1="&#xfe;" u2="&#x27;" k="20" />
+<hkern u1="&#xfe;" u2="&#x22;" k="20" />
+<hkern u1="&#xff;" u2="&#x201e;" k="82" />
+<hkern u1="&#xff;" u2="&#x201d;" k="-82" />
+<hkern u1="&#xff;" u2="&#x201a;" k="82" />
+<hkern u1="&#xff;" u2="&#x2019;" k="-82" />
+<hkern u1="&#xff;" u2="&#x3f;" k="-41" />
+<hkern u1="&#xff;" u2="&#x2e;" k="82" />
+<hkern u1="&#xff;" u2="&#x2c;" k="82" />
+<hkern u1="&#xff;" u2="&#x27;" k="-82" />
+<hkern u1="&#xff;" u2="&#x22;" k="-82" />
+<hkern u1="&#x152;" u2="J" k="-123" />
+<hkern u1="&#x178;" u2="&#x201e;" k="123" />
+<hkern u1="&#x178;" u2="&#x201a;" k="123" />
+<hkern u1="&#x178;" u2="&#x153;" k="102" />
+<hkern u1="&#x178;" u2="&#x152;" k="41" />
+<hkern u1="&#x178;" u2="&#xfc;" k="61" />
+<hkern u1="&#x178;" u2="&#xfb;" k="61" />
+<hkern u1="&#x178;" u2="&#xfa;" k="61" />
+<hkern u1="&#x178;" u2="&#xf9;" k="61" />
+<hkern u1="&#x178;" u2="&#xf8;" k="102" />
+<hkern u1="&#x178;" u2="&#xf6;" k="102" />
+<hkern u1="&#x178;" u2="&#xf5;" k="102" />
+<hkern u1="&#x178;" u2="&#xf4;" k="102" />
+<hkern u1="&#x178;" u2="&#xf3;" k="102" />
+<hkern u1="&#x178;" u2="&#xf2;" k="102" />
+<hkern u1="&#x178;" u2="&#xeb;" k="102" />
+<hkern u1="&#x178;" u2="&#xea;" k="102" />
+<hkern u1="&#x178;" u2="&#xe9;" k="102" />
+<hkern u1="&#x178;" u2="&#xe8;" k="102" />
+<hkern u1="&#x178;" u2="&#xe7;" k="102" />
+<hkern u1="&#x178;" u2="&#xe6;" k="102" />
+<hkern u1="&#x178;" u2="&#xe5;" k="102" />
+<hkern u1="&#x178;" u2="&#xe4;" k="102" />
+<hkern u1="&#x178;" u2="&#xe3;" k="102" />
+<hkern u1="&#x178;" u2="&#xe2;" k="102" />
+<hkern u1="&#x178;" u2="&#xe1;" k="102" />
+<hkern u1="&#x178;" u2="&#xe0;" k="102" />
+<hkern u1="&#x178;" u2="&#xd8;" k="41" />
+<hkern u1="&#x178;" u2="&#xd6;" k="41" />
+<hkern u1="&#x178;" u2="&#xd5;" k="41" />
+<hkern u1="&#x178;" u2="&#xd4;" k="41" />
+<hkern u1="&#x178;" u2="&#xd3;" k="41" />
+<hkern u1="&#x178;" u2="&#xd2;" k="41" />
+<hkern u1="&#x178;" u2="&#xc7;" k="41" />
+<hkern u1="&#x178;" u2="&#xc5;" k="123" />
+<hkern u1="&#x178;" u2="&#xc4;" k="123" />
+<hkern u1="&#x178;" u2="&#xc3;" k="123" />
+<hkern u1="&#x178;" u2="&#xc2;" k="123" />
+<hkern u1="&#x178;" u2="&#xc1;" k="123" />
+<hkern u1="&#x178;" u2="&#xc0;" k="123" />
+<hkern u1="&#x178;" u2="z" k="41" />
+<hkern u1="&#x178;" u2="u" k="61" />
+<hkern u1="&#x178;" u2="s" k="82" />
+<hkern u1="&#x178;" u2="r" k="61" />
+<hkern u1="&#x178;" u2="q" k="102" />
+<hkern u1="&#x178;" u2="p" k="61" />
+<hkern u1="&#x178;" u2="o" k="102" />
+<hkern u1="&#x178;" u2="n" k="61" />
+<hkern u1="&#x178;" u2="m" k="61" />
+<hkern u1="&#x178;" u2="g" k="41" />
+<hkern u1="&#x178;" u2="e" k="102" />
+<hkern u1="&#x178;" u2="d" k="102" />
+<hkern u1="&#x178;" u2="c" k="102" />
+<hkern u1="&#x178;" u2="a" k="102" />
+<hkern u1="&#x178;" u2="Q" k="41" />
+<hkern u1="&#x178;" u2="O" k="41" />
+<hkern u1="&#x178;" u2="G" k="41" />
+<hkern u1="&#x178;" u2="C" k="41" />
+<hkern u1="&#x178;" u2="A" k="123" />
+<hkern u1="&#x178;" u2="&#x3f;" k="-41" />
+<hkern u1="&#x178;" u2="&#x2e;" k="123" />
+<hkern u1="&#x178;" u2="&#x2c;" k="123" />
+<hkern u1="&#x2013;" u2="T" k="82" />
+<hkern u1="&#x2014;" u2="T" k="82" />
+<hkern u1="&#x2018;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2018;" u2="&#x153;" k="123" />
+<hkern u1="&#x2018;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2018;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2018;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2018;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2018;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2018;" u2="&#xea;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2018;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2018;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2018;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2018;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2018;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2018;" u2="u" k="61" />
+<hkern u1="&#x2018;" u2="s" k="61" />
+<hkern u1="&#x2018;" u2="r" k="61" />
+<hkern u1="&#x2018;" u2="q" k="123" />
+<hkern u1="&#x2018;" u2="p" k="61" />
+<hkern u1="&#x2018;" u2="o" k="123" />
+<hkern u1="&#x2018;" u2="n" k="61" />
+<hkern u1="&#x2018;" u2="m" k="61" />
+<hkern u1="&#x2018;" u2="g" k="61" />
+<hkern u1="&#x2018;" u2="e" k="123" />
+<hkern u1="&#x2018;" u2="d" k="123" />
+<hkern u1="&#x2018;" u2="c" k="123" />
+<hkern u1="&#x2018;" u2="a" k="82" />
+<hkern u1="&#x2018;" u2="Y" k="-20" />
+<hkern u1="&#x2018;" u2="W" k="-41" />
+<hkern u1="&#x2018;" u2="V" k="-41" />
+<hkern u1="&#x2018;" u2="T" k="-41" />
+<hkern u1="&#x2018;" u2="A" k="143" />
+<hkern u1="&#x2019;" u2="&#x178;" k="-20" />
+<hkern u1="&#x2019;" u2="&#x153;" k="123" />
+<hkern u1="&#x2019;" u2="&#xfc;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfb;" k="61" />
+<hkern u1="&#x2019;" u2="&#xfa;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf9;" k="61" />
+<hkern u1="&#x2019;" u2="&#xf8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf6;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf5;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf4;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf3;" k="123" />
+<hkern u1="&#x2019;" u2="&#xf2;" k="123" />
+<hkern u1="&#x2019;" u2="&#xeb;" k="123" />
+<hkern u1="&#x2019;" u2="&#xea;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe9;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe8;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe7;" k="123" />
+<hkern u1="&#x2019;" u2="&#xe6;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe5;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe4;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe3;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe2;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe1;" k="82" />
+<hkern u1="&#x2019;" u2="&#xe0;" k="123" />
+<hkern u1="&#x2019;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x2019;" u2="&#xc5;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc4;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc3;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc2;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc1;" k="143" />
+<hkern u1="&#x2019;" u2="&#xc0;" k="143" />
+<hkern u1="&#x2019;" u2="u" k="61" />
+<hkern u1="&#x2019;" u2="s" k="61" />
+<hkern u1="&#x2019;" u2="r" k="61" />
+<hkern u1="&#x2019;" u2="q" k="123" />
+<hkern u1="&#x2019;" u2="p" k="61" />
+<hkern u1="&#x2019;" u2="o" k="123" />
+<hkern u1="&#x2019;" u2="n" k="61" />
+<hkern u1="&#x2019;" u2="m" k="61" />
+<hkern u1="&#x2019;" u2="g" k="61" />
+<hkern u1="&#x2019;" u2="e" k="123" />
+<hkern u1="&#x2019;" u2="d" k="123" />
+<hkern u1="&#x2019;" u2="c" k="123" />
+<hkern u1="&#x2019;" u2="a" k="82" />
+<hkern u1="&#x2019;" u2="Y" k="-20" />
+<hkern u1="&#x2019;" u2="W" k="-41" />
+<hkern u1="&#x2019;" u2="V" k="-41" />
+<hkern u1="&#x2019;" u2="T" k="-41" />
+<hkern u1="&#x2019;" u2="A" k="143" />
+<hkern u1="&#x201a;" u2="&#x178;" k="123" />
+<hkern u1="&#x201a;" u2="&#x152;" k="102" />
+<hkern u1="&#x201a;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201a;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201a;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201a;" u2="&#xda;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201a;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201a;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201a;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201a;" u2="Y" k="123" />
+<hkern u1="&#x201a;" u2="W" k="123" />
+<hkern u1="&#x201a;" u2="V" k="123" />
+<hkern u1="&#x201a;" u2="U" k="41" />
+<hkern u1="&#x201a;" u2="T" k="143" />
+<hkern u1="&#x201a;" u2="Q" k="102" />
+<hkern u1="&#x201a;" u2="O" k="102" />
+<hkern u1="&#x201a;" u2="G" k="102" />
+<hkern u1="&#x201a;" u2="C" k="102" />
+<hkern u1="&#x201c;" u2="&#x178;" k="-20" />
+<hkern u1="&#x201c;" u2="&#x153;" k="123" />
+<hkern u1="&#x201c;" u2="&#xfc;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfb;" k="61" />
+<hkern u1="&#x201c;" u2="&#xfa;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf9;" k="61" />
+<hkern u1="&#x201c;" u2="&#xf8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf6;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf5;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf4;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf3;" k="123" />
+<hkern u1="&#x201c;" u2="&#xf2;" k="123" />
+<hkern u1="&#x201c;" u2="&#xeb;" k="123" />
+<hkern u1="&#x201c;" u2="&#xea;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe9;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe8;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe7;" k="123" />
+<hkern u1="&#x201c;" u2="&#xe6;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe5;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe4;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe3;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe2;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe1;" k="82" />
+<hkern u1="&#x201c;" u2="&#xe0;" k="123" />
+<hkern u1="&#x201c;" u2="&#xdd;" k="-20" />
+<hkern u1="&#x201c;" u2="&#xc5;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc4;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc3;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc2;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc1;" k="143" />
+<hkern u1="&#x201c;" u2="&#xc0;" k="143" />
+<hkern u1="&#x201c;" u2="u" k="61" />
+<hkern u1="&#x201c;" u2="s" k="61" />
+<hkern u1="&#x201c;" u2="r" k="61" />
+<hkern u1="&#x201c;" u2="q" k="123" />
+<hkern u1="&#x201c;" u2="p" k="61" />
+<hkern u1="&#x201c;" u2="o" k="123" />
+<hkern u1="&#x201c;" u2="n" k="61" />
+<hkern u1="&#x201c;" u2="m" k="61" />
+<hkern u1="&#x201c;" u2="g" k="61" />
+<hkern u1="&#x201c;" u2="e" k="123" />
+<hkern u1="&#x201c;" u2="d" k="123" />
+<hkern u1="&#x201c;" u2="c" k="123" />
+<hkern u1="&#x201c;" u2="a" k="82" />
+<hkern u1="&#x201c;" u2="Y" k="-20" />
+<hkern u1="&#x201c;" u2="W" k="-41" />
+<hkern u1="&#x201c;" u2="V" k="-41" />
+<hkern u1="&#x201c;" u2="T" k="-41" />
+<hkern u1="&#x201c;" u2="A" k="143" />
+<hkern u1="&#x201e;" u2="&#x178;" k="123" />
+<hkern u1="&#x201e;" u2="&#x152;" k="102" />
+<hkern u1="&#x201e;" u2="&#xdd;" k="123" />
+<hkern u1="&#x201e;" u2="&#xdc;" k="41" />
+<hkern u1="&#x201e;" u2="&#xdb;" k="41" />
+<hkern u1="&#x201e;" u2="&#xda;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd9;" k="41" />
+<hkern u1="&#x201e;" u2="&#xd8;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd6;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd5;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd4;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd3;" k="102" />
+<hkern u1="&#x201e;" u2="&#xd2;" k="102" />
+<hkern u1="&#x201e;" u2="&#xc7;" k="102" />
+<hkern u1="&#x201e;" u2="Y" k="123" />
+<hkern u1="&#x201e;" u2="W" k="123" />
+<hkern u1="&#x201e;" u2="V" k="123" />
+<hkern u1="&#x201e;" u2="U" k="41" />
+<hkern u1="&#x201e;" u2="T" k="143" />
+<hkern u1="&#x201e;" u2="Q" k="102" />
+<hkern u1="&#x201e;" u2="O" k="102" />
+<hkern u1="&#x201e;" u2="G" k="102" />
+<hkern u1="&#x201e;" u2="C" k="102" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff
new file mode 100644 (file)
index 0000000..e231183
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/docs/fonts/OpenSans-Regular-webfont.woff differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/index.html b/legacy-libs/grpc/node_modules/protobufjs/docs/index.html
new file mode 100644 (file)
index 0000000..3493d2f
--- /dev/null
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>JSDoc: Home</title>
+
+    <script src="scripts/prettify/prettify.js"> </script>
+    <script src="scripts/prettify/lang-css.js"> </script>
+    <!--[if lt IE 9]>
+      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
+    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
+</head>
+
+<body>
+
+<div id="main">
+
+    <h1 class="page-title">Home</h1>
+
+    
+
+
+
+    
+
+
+    <h3> </h3>
+
+
+
+
+
+
+
+
+
+
+    
+
+
+
+
+
+
+
+
+
+</div>
+
+<nav>
+    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="ProtoBuf.Builder.html">Builder</a></li><li><a href="ProtoBuf.Builder.Message.html">Message</a></li><li><a href="ProtoBuf.Builder.Service.html">Service</a></li><li><a href="ProtoBuf.DotProto.Parser.html">Parser</a></li><li><a href="ProtoBuf.DotProto.Tokenizer.html">Tokenizer</a></li><li><a href="ProtoBuf.Map.html">Map</a></li><li><a href="ProtoBuf.Reflect.Element.html">Element</a></li><li><a href="ProtoBuf.Reflect.Enum.html">Enum</a></li><li><a href="ProtoBuf.Reflect.Enum.Value.html">Value</a></li><li><a href="ProtoBuf.Reflect.Extension.html">Extension</a></li><li><a href="ProtoBuf.Reflect.Message.html">Message</a></li><li><a href="ProtoBuf.Reflect.Message.ExtensionField.html">ExtensionField</a></li><li><a href="ProtoBuf.Reflect.Message.Field.html">Field</a></li><li><a href="ProtoBuf.Reflect.Message.OneOf.html">OneOf</a></li><li><a href="ProtoBuf.Reflect.Namespace.html">Namespace</a></li><li><a href="ProtoBuf.Reflect.Service.html">Service</a></li><li><a href="ProtoBuf.Reflect.Service.Method.html">Method</a></li><li><a href="ProtoBuf.Reflect.Service.RPCMethod.html">RPCMethod</a></li><li><a href="ProtoBuf.Reflect.T.html">T</a></li></ul><h3>Namespaces</h3><ul><li><a href="ProtoBuf.html">ProtoBuf</a></li><li><a href="ProtoBuf.DotProto.html">DotProto</a></li><li><a href="ProtoBuf.Reflect.html">Reflect</a></li><li><a href="ProtoBuf.Util.html">Util</a></li></ul>
+</nav>
+
+<br class="clear">
+
+<footer>
+    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Fri Jan 27 2017 17:03:55 GMT+0100 (Mitteleuropäische Zeit)
+</footer>
+
+<script> prettyPrint(); </script>
+<script src="scripts/linenumber.js"> </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/linenumber.js b/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/linenumber.js
new file mode 100644 (file)
index 0000000..8d52f7e
--- /dev/null
@@ -0,0 +1,25 @@
+/*global document */
+(function() {
+    var source = document.getElementsByClassName('prettyprint source linenums');
+    var i = 0;
+    var lineNumber = 0;
+    var lineId;
+    var lines;
+    var totalLines;
+    var anchorHash;
+
+    if (source && source[0]) {
+        anchorHash = document.location.hash.substring(1);
+        lines = source[0].getElementsByTagName('li');
+        totalLines = lines.length;
+
+        for (; i < totalLines; i++) {
+            lineNumber++;
+            lineId = 'line' + lineNumber;
+            lines[i].id = lineId;
+            if (lineId === anchorHash) {
+                lines[i].className += ' selected';
+            }
+        }
+    }
+})();
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/Apache-License-2.0.txt b/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/Apache-License-2.0.txt
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/lang-css.js b/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/lang-css.js
new file mode 100644 (file)
index 0000000..041e1f5
--- /dev/null
@@ -0,0 +1,2 @@
+PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\f"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com",
+/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/prettify.js b/legacy-libs/grpc/node_modules/protobufjs/docs/scripts/prettify/prettify.js
new file mode 100644 (file)
index 0000000..eef5ad7
--- /dev/null
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
+f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
+(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
+{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
+t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
+"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
+m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
+a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
+j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
+250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
+PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/styles/jsdoc-default.css b/legacy-libs/grpc/node_modules/protobufjs/docs/styles/jsdoc-default.css
new file mode 100644 (file)
index 0000000..24aa20f
--- /dev/null
@@ -0,0 +1,353 @@
+@font-face {
+    font-family: 'Open Sans';
+    font-weight: normal;
+    font-style: normal;
+    src: url('../fonts/OpenSans-Regular-webfont.eot');
+    src:
+        local('Open Sans'),
+        local('OpenSans'),
+        url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
+        url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
+        url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
+}
+
+@font-face {
+    font-family: 'Open Sans Light';
+    font-weight: normal;
+    font-style: normal;
+    src: url('../fonts/OpenSans-Light-webfont.eot');
+    src:
+        local('Open Sans Light'),
+        local('OpenSans Light'),
+        url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
+        url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
+        url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
+}
+
+html
+{
+    overflow: auto;
+    background-color: #fff;
+    font-size: 14px;
+}
+
+body
+{
+    font-family: 'Open Sans', sans-serif;
+    line-height: 1.5;
+    color: #4d4e53;
+    background-color: white;
+}
+
+a, a:visited, a:active {
+    color: #0095dd;
+    text-decoration: none;
+}
+
+a:hover {
+    text-decoration: underline;
+}
+
+header
+{
+    display: block;
+    padding: 0px 4px;
+}
+
+tt, code, kbd, samp {
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+}
+
+.class-description {
+    font-size: 130%;
+    line-height: 140%;
+    margin-bottom: 1em;
+    margin-top: 1em;
+}
+
+.class-description:empty {
+    margin: 0;
+}
+
+#main {
+    float: left;
+    width: 70%;
+}
+
+article dl {
+    margin-bottom: 40px;
+}
+
+section
+{
+    display: block;
+    background-color: #fff;
+    padding: 12px 24px;
+    border-bottom: 1px solid #ccc;
+    margin-right: 30px;
+}
+
+.variation {
+    display: none;
+}
+
+.signature-attributes {
+    font-size: 60%;
+    color: #aaa;
+    font-style: italic;
+    font-weight: lighter;
+}
+
+nav
+{
+    display: block;
+    float: right;
+    margin-top: 28px;
+    width: 30%;
+    box-sizing: border-box;
+    border-left: 1px solid #ccc;
+    padding-left: 16px;
+}
+
+nav ul {
+    font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
+    font-size: 100%;
+    line-height: 17px;
+    padding: 0;
+    margin: 0;
+    list-style-type: none;
+}
+
+nav ul a, nav ul a:visited, nav ul a:active {
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+    line-height: 18px;
+    color: #4D4E53;
+}
+
+nav h3 {
+    margin-top: 12px;
+}
+
+nav li {
+    margin-top: 6px;
+}
+
+footer {
+    display: block;
+    padding: 6px;
+    margin-top: 12px;
+    font-style: italic;
+    font-size: 90%;
+}
+
+h1, h2, h3, h4 {
+    font-weight: 200;
+    margin: 0;
+}
+
+h1
+{
+    font-family: 'Open Sans Light', sans-serif;
+    font-size: 48px;
+    letter-spacing: -2px;
+    margin: 12px 24px 20px;
+}
+
+h2, h3
+{
+    font-size: 30px;
+    font-weight: 700;
+    letter-spacing: -1px;
+    margin-bottom: 12px;
+}
+
+h4
+{
+    font-size: 18px;
+    letter-spacing: -0.33px;
+    margin-bottom: 12px;
+    color: #4d4e53;
+}
+
+h5, .container-overview .subsection-title
+{
+    font-size: 120%;
+    font-weight: bold;
+    letter-spacing: -0.01em;
+    margin: 8px 0 3px 0;
+}
+
+h6
+{
+    font-size: 100%;
+    letter-spacing: -0.01em;
+    margin: 6px 0 3px 0;
+    font-style: italic;
+}
+
+.ancestors { color: #999; }
+.ancestors a
+{
+    color: #999 !important;
+    text-decoration: none;
+}
+
+.clear
+{
+    clear: both;
+}
+
+.important
+{
+    font-weight: bold;
+    color: #950B02;
+}
+
+.yes-def {
+    text-indent: -1000px;
+}
+
+.type-signature {
+    color: #aaa;
+}
+
+.name, .signature {
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+}
+
+.details { margin-top: 14px; border-left: 2px solid #DDD; }
+.details dt { width: 120px; float: left; padding-left: 10px;  padding-top: 6px; }
+.details dd { margin-left: 70px; }
+.details ul { margin: 0; }
+.details ul { list-style-type: none; }
+.details li { margin-left: 30px; padding-top: 6px; }
+.details pre.prettyprint { margin: 0 }
+.details .object-value { padding-top: 0; }
+
+.description {
+    margin-bottom: 1em;
+    margin-top: 1em;
+}
+
+.code-caption
+{
+    font-style: italic;
+    font-size: 107%;
+    margin: 0;
+}
+
+.prettyprint
+{
+    border: 1px solid #ddd;
+    width: 80%;
+    overflow: auto;
+}
+
+.prettyprint.source {
+    width: inherit;
+}
+
+.prettyprint code
+{
+    font-size: 100%;
+    line-height: 18px;
+    display: block;
+    padding: 4px 12px;
+    margin: 0;
+    background-color: #fff;
+    color: #4D4E53;
+}
+
+.prettyprint code span.line
+{
+  display: inline-block;
+}
+
+.prettyprint.linenums
+{
+  padding-left: 70px;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+.prettyprint.linenums ol
+{
+  padding-left: 0;
+}
+
+.prettyprint.linenums li
+{
+  border-left: 3px #ddd solid;
+}
+
+.prettyprint.linenums li.selected,
+.prettyprint.linenums li.selected *
+{
+  background-color: lightyellow;
+}
+
+.prettyprint.linenums li *
+{
+  -webkit-user-select: text;
+  -moz-user-select: text;
+  -ms-user-select: text;
+  user-select: text;
+}
+
+.params, .props
+{
+    border-spacing: 0;
+    border: 0;
+    border-collapse: collapse;
+}
+
+.params .name, .props .name, .name code {
+    color: #4D4E53;
+    font-family: Consolas, Monaco, 'Andale Mono', monospace;
+    font-size: 100%;
+}
+
+.params td, .params th, .props td, .props th
+{
+    border: 1px solid #ddd;
+    margin: 0px;
+    text-align: left;
+    vertical-align: top;
+    padding: 4px 6px;
+    display: table-cell;
+}
+
+.params thead tr, .props thead tr
+{
+    background-color: #ddd;
+    font-weight: bold;
+}
+
+.params .params thead tr, .props .props thead tr
+{
+    background-color: #fff;
+    font-weight: bold;
+}
+
+.params th, .props th { border-right: 1px solid #aaa; }
+.params thead .last, .props thead .last { border-right: 1px solid #ddd; }
+
+.params td.description > p:first-child,
+.props td.description > p:first-child
+{
+    margin-top: 0;
+    padding-top: 0;
+}
+
+.params td.description > p:last-child,
+.props td.description > p:last-child
+{
+    margin-bottom: 0;
+    padding-bottom: 0;
+}
+
+.disabled {
+    color: #454545;
+}
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/styles/prettify-jsdoc.css b/legacy-libs/grpc/node_modules/protobufjs/docs/styles/prettify-jsdoc.css
new file mode 100644 (file)
index 0000000..5a2526e
--- /dev/null
@@ -0,0 +1,111 @@
+/* JSDoc prettify.js theme */
+
+/* plain text */
+.pln {
+  color: #000000;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* string content */
+.str {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a keyword */
+.kwd {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* a comment */
+.com {
+  font-weight: normal;
+  font-style: italic;
+}
+
+/* a type name */
+.typ {
+  color: #000000;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a literal value */
+.lit {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* punctuation */
+.pun {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* lisp open bracket */
+.opn {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* lisp close bracket */
+.clo {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* a markup tag name */
+.tag {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a markup attribute name */
+.atn {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a markup attribute value */
+.atv {
+  color: #006400;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a declaration */
+.dec {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* a variable name */
+.var {
+  color: #000000;
+  font-weight: normal;
+  font-style: normal;
+}
+
+/* a function name */
+.fun {
+  color: #000000;
+  font-weight: bold;
+  font-style: normal;
+}
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+  margin-top: 0;
+  margin-bottom: 0;
+}
diff --git a/legacy-libs/grpc/node_modules/protobufjs/docs/styles/prettify-tomorrow.css b/legacy-libs/grpc/node_modules/protobufjs/docs/styles/prettify-tomorrow.css
new file mode 100644 (file)
index 0000000..b6f92a7
--- /dev/null
@@ -0,0 +1,132 @@
+/* Tomorrow Theme */
+/* Original theme - https://github.com/chriskempson/tomorrow-theme */
+/* Pretty printing styles. Used with prettify.js. */
+/* SPAN elements with the classes below are added by prettyprint. */
+/* plain text */
+.pln {
+  color: #4d4d4c; }
+
+@media screen {
+  /* string content */
+  .str {
+    color: #718c00; }
+
+  /* a keyword */
+  .kwd {
+    color: #8959a8; }
+
+  /* a comment */
+  .com {
+    color: #8e908c; }
+
+  /* a type name */
+  .typ {
+    color: #4271ae; }
+
+  /* a literal value */
+  .lit {
+    color: #f5871f; }
+
+  /* punctuation */
+  .pun {
+    color: #4d4d4c; }
+
+  /* lisp open bracket */
+  .opn {
+    color: #4d4d4c; }
+
+  /* lisp close bracket */
+  .clo {
+    color: #4d4d4c; }
+
+  /* a markup tag name */
+  .tag {
+    color: #c82829; }
+
+  /* a markup attribute name */
+  .atn {
+    color: #f5871f; }
+
+  /* a markup attribute value */
+  .atv {
+    color: #3e999f; }
+
+  /* a declaration */
+  .dec {
+    color: #f5871f; }
+
+  /* a variable name */
+  .var {
+    color: #c82829; }
+
+  /* a function name */
+  .fun {
+    color: #4271ae; } }
+/* Use higher contrast and text-weight for printable form. */
+@media print, projection {
+  .str {
+    color: #060; }
+
+  .kwd {
+    color: #006;
+    font-weight: bold; }
+
+  .com {
+    color: #600;
+    font-style: italic; }
+
+  .typ {
+    color: #404;
+    font-weight: bold; }
+
+  .lit {
+    color: #044; }
+
+  .pun, .opn, .clo {
+    color: #440; }
+
+  .tag {
+    color: #006;
+    font-weight: bold; }
+
+  .atn {
+    color: #404; }
+
+  .atv {
+    color: #060; } }
+/* Style */
+/*
+pre.prettyprint {
+  background: white;
+  font-family: Consolas, Monaco, 'Andale Mono', monospace;
+  font-size: 12px;
+  line-height: 1.5;
+  border: 1px solid #ccc;
+  padding: 10px; }
+*/
+
+/* Specify class=linenums on a pre to get line numbering */
+ol.linenums {
+  margin-top: 0;
+  margin-bottom: 0; }
+
+/* IE indents via margin-left */
+li.L0,
+li.L1,
+li.L2,
+li.L3,
+li.L4,
+li.L5,
+li.L6,
+li.L7,
+li.L8,
+li.L9 {
+  /* */ }
+
+/* Alternate shading for lines */
+li.L1,
+li.L3,
+li.L5,
+li.L7,
+li.L9 {
+  /* */ }
diff --git a/legacy-libs/grpc/node_modules/protobufjs/donate.png b/legacy-libs/grpc/node_modules/protobufjs/donate.png
new file mode 100644 (file)
index 0000000..207d001
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/donate.png differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/README.md b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/README.md
new file mode 100644 (file)
index 0000000..e82333b
--- /dev/null
@@ -0,0 +1,28 @@
+ProtoBuf.js protoify example\r
+============================\r
+This example shows the general usage of ProtoBuf.js by converting JSON structures to protocol buffers and vice versa\r
+using a definition describing JSON itself. While this works as an example, it does not provide any real world benefits\r
+(well, this is if you are not building a protobuf-backed database for JSON data, using inter-field substitution to\r
+minimize redundancy - nevermind, forget that).\r
+\r
+Instructions\r
+------------\r
+1. Set up dependencies: `npm install`\r
+2. Run: `npm test`\r
+\r
+Now you know no more and no less than that it works and you might want to inspect the following files to get the 'how':\r
+\r
+* **[index.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/index.js)**\r
+  contains the sample's source code\r
+\r
+* **[json.proto](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.proto)**\r
+  contains the protobuf definition used\r
+\r
+* **[json.json](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.json)**\r
+  contains the protobuf definition converted through `proto2js json.proto > json.json`\r
+\r
+* **[json.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/json.js)**\r
+  contains the protobuf definition converted through `proto2js json.proto -commonjs=js > json.js`\r
+\r
+* **[test.js](https://github.com/dcodeIO/ProtoBuf.js/blob/master/examples/protoify/test.js)**\r
+  contains our simple test suite\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/index.js b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/index.js
new file mode 100644 (file)
index 0000000..94f066a
--- /dev/null
@@ -0,0 +1,147 @@
+var ProtoBuf = require("protobufjs"),\r
+    ByteBuffer = ProtoBuf.ByteBuffer,                    // ProtoBuf.js uses and also exposes ByteBuffer.js\r
+    Long = ProtoBuf.Long;                                // as well as Long.js (not used in this example)\r
+\r
+// Option 1: Loading the .proto file directly\r
+var builder = ProtoBuf.loadProtoFile("./json.proto"),    // Creates the Builder\r
+    JS = builder.build("js");                            // Returns just the 'js' namespace if that's all we need\r
+\r
+// Option 2: Loading the .json file generated through 'proto2js json.proto > json.json'\r
+var root = ProtoBuf.loadJsonFile("./json.json").build(), // Here we make the Builder return the root namespace\r
+    JS = root.js;                                        // then we reference 'js' inside. Both is possible.\r
+\r
+// Option 3: Loading the module generated through 'proto2js json.proto -commonjs=js > json.js'\r
+var JS = require("./json.js");                           // Returns what is specified with -commonjs[=XX] (omitted=root)\r
+\r
+// `JS` now contains the js namespace from json.proto: Value, Array and Object\r
+\r
+// This is how we use these classes:\r
+\r
+/**\r
+ * Converts a JSON-like structure to JS-Namespace values.\r
+ * @param {*} val JSON\r
+ * @returns {!JS.Value} JS-Namespace value\r
+ * @inner\r
+ */\r
+function _protoify(val) {\r
+    switch (typeof val) {\r
+        case 'number':\r
+            if (val%1 === 0 && val >= (0x80000000|0) && val <= (0x7fffffff|0))\r
+                return new JS.Value(val); // sets the first field declared in .js.Value\r
+            else\r
+                return new JS.Value(null, val); // sets the second field\r
+        case 'string':\r
+            return new JS.Value({ 'string': val }); // uses object notation instead\r
+        case 'boolean':\r
+            return new JS.Value({ 'boolean': val });\r
+        case 'object':\r
+            if (val === null)\r
+                return new JS.Value({ 'null': true });\r
+            if (Object.prototype.toString.call(val) === "[object Array]") {\r
+                var arr = new JS.Array();\r
+                for (var i=0; i<val.length; ++i)\r
+                    arr['values'][i] = _protoify(val[i]);\r
+                return new JS.Value({ 'array': arr });\r
+            }\r
+            var obj = new JS.Object();\r
+            for (var key in val)\r
+                if (val.hasOwnProperty(key))\r
+                    obj['keys'].push(_protoify(key)),\r
+                        obj['values'].push(_protoify(val[key]));\r
+            return new JS.Value({ 'object': obj });\r
+        case 'undefined':\r
+            return new JS.Value(); // undefined\r
+        default:\r
+            throw Error("Unsupported type: "+(typeof val)); // symbol, function\r
+    }\r
+}\r
+\r
+/**\r
+ * Converts JS-Namespace values to JSON.\r
+ * @param {!JS.Value} value JS value\r
+ * @returns {*} JSON\r
+ * @inner\r
+ */\r
+function _jsonify(value) {\r
+    if (value.type === null)\r
+        return undefined;\r
+    switch (value.type) {\r
+        case 'null':\r
+            return null;\r
+        case 'array':\r
+            return (function() {\r
+                var values = value['array']['values'],\r
+                    i = 0,\r
+                    k = values.length,\r
+                    arr = new Array(k);\r
+                for (; i<k; ++i)\r
+                    arr[i] = _jsonify(values[i]);\r
+                return arr;\r
+            })();\r
+        case 'object':\r
+            return (function() {\r
+                var keys = value['object']['keys'],\r
+                    values = value['object']['values'],\r
+                    i = 0,\r
+                    k = keys.length,\r
+                    obj = {};\r
+                for (; i<k; ++i)\r
+                    obj[keys[i]['string'] /* is a JS.Value, here always a string */] = _jsonify(values[i]);\r
+                return obj;\r
+            })();\r
+        default:\r
+            return value[value.type];\r
+    }\r
+}\r
+\r
+// And this is how we actually encode and decode them:\r
+\r
+/**\r
+ * A temporary Buffer to speed up encoding.\r
+ * @type {!ByteBuffer}\r
+ * @inner\r
+ */\r
+var tempBuffer = ByteBuffer.allocate(1024);\r
+\r
+/**\r
+ * Converts a JSON structure to a Buffer.\r
+ * @param {*} json JSON\r
+ * @returns {!Buffer|!ArrayBuffer}\r
+ * @expose\r
+ */\r
+module.exports = function(json) {\r
+    return _protoify(json)     // Returns the root JS.Value\r
+           .encode(tempBuffer).flip() // Encodes it to a ByteBuffer, here: reusing tempBuffer forever\r
+                               // The non-tempBuffer alternative is just doing .encode()\r
+           .toBuffer();        // Converts it to a Buffer. In the browser, this returns an ArrayBuffer. To return an\r
+                               // ArrayBuffer explicitly both under node.js and in the browser, use .toArrayBuffer().\r
+                               // Performance note: This just returns a slice on the ByteBuffer's backing .buffer\r
+};\r
+\r
+/**\r
+ * Converts a Buffer to a JSON structure.\r
+ * @param {!Buffer|!ArrayBuffer} proto Buffer\r
+ * @returns {*} JSON\r
+ * @expose\r
+ */\r
+module.exports.parse = function(proto) {\r
+    return _jsonify(           // Processes JS-namespace objects\r
+        JS.Value.decode(proto) // Decodes the JS.Value from a ByteBuffer, a Buffer, an ArrayBuffer, an Uint8Array, ...\r
+    );\r
+};\r
+\r
+/**\r
+ * Performs maintenance.\r
+ * @expose\r
+ */\r
+module.exports.performMaintenance = function() {\r
+    if (tempBuffer.capacity() > 2048)\r
+        tempBuffer = ByteBuffer.allocate(1024);\r
+    // In case this module is running inside of a daemon, we'd just call this\r
+    // method every now and then to discard the tempBuffer if it becomes too\r
+    // large. This is just an example on how to reuse ByteBuffers effectively.\r
+    // You may consider something like this for the performance benefit, which\r
+    // is decreasing the memory allocation footprint of your app.\r
+};\r
+\r
+// Have a nice day!\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.js b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.js
new file mode 100644 (file)
index 0000000..3f78846
--- /dev/null
@@ -0,0 +1,123 @@
+module.exports = require("protobufjs").newBuilder({})["import"]({\r
+    "package": "js",\r
+    "messages": [\r
+        {\r
+            "name": "Value",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "sint32",\r
+                    "name": "integer",\r
+                    "id": 1,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "double",\r
+                    "name": "double",\r
+                    "id": 2,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "string",\r
+                    "id": 3,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "boolean",\r
+                    "id": 4,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "null",\r
+                    "id": 5,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Array",\r
+                    "name": "array",\r
+                    "id": 6,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Object",\r
+                    "name": "object",\r
+                    "id": 7,\r
+                    "oneof": "type"\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {\r
+                "type": [\r
+                    1,\r
+                    2,\r
+                    3,\r
+                    4,\r
+                    5,\r
+                    6,\r
+                    7\r
+                ]\r
+            }\r
+        },\r
+        {\r
+            "name": "Array",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 1\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        },\r
+        {\r
+            "name": "Object",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "keys",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {},\r
+    "services": []\r
+}).build("js");\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.json b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.json
new file mode 100644 (file)
index 0000000..26ed18f
--- /dev/null
@@ -0,0 +1,123 @@
+{\r
+    "package": "js",\r
+    "messages": [\r
+        {\r
+            "name": "Value",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "sint32",\r
+                    "name": "integer",\r
+                    "id": 1,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "double",\r
+                    "name": "double",\r
+                    "id": 2,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "string",\r
+                    "id": 3,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "boolean",\r
+                    "id": 4,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "null",\r
+                    "id": 5,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Array",\r
+                    "name": "array",\r
+                    "id": 6,\r
+                    "oneof": "type"\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "Object",\r
+                    "name": "object",\r
+                    "id": 7,\r
+                    "oneof": "type"\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {\r
+                "type": [\r
+                    1,\r
+                    2,\r
+                    3,\r
+                    4,\r
+                    5,\r
+                    6,\r
+                    7\r
+                ]\r
+            }\r
+        },\r
+        {\r
+            "name": "Array",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 1\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        },\r
+        {\r
+            "name": "Object",\r
+            "fields": [\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "keys",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "repeated",\r
+                    "options": {},\r
+                    "type": "Value",\r
+                    "name": "values",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.proto b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/json.proto
new file mode 100644 (file)
index 0000000..d543392
--- /dev/null
@@ -0,0 +1,30 @@
+// Everything below is located in the js-namespace\r
+package js;\r
+\r
+// Represents a JavaScript value.\r
+// Contains exactly one or zero fields.\r
+message Value {\r
+    oneof type {\r
+        sint32 integer = 1;\r
+        double double = 2;\r
+        string string = 3;\r
+        bool boolean = 4;\r
+        bool null = 5;\r
+        Array array = 6;\r
+        Object object = 7;\r
+        // if none is set: undefined\r
+    }\r
+}\r
+\r
+// Represents a JavaScript array.\r
+// Contains zero to N values.\r
+message Array {\r
+    repeated Value values = 1;\r
+}\r
+\r
+// Represents a JavaScript object.\r
+// Contains zero to N keys with associated values.\r
+message Object {\r
+    repeated Value keys = 1;\r
+    repeated Value values = 2;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/package.json b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/package.json
new file mode 100644 (file)
index 0000000..f03b843
--- /dev/null
@@ -0,0 +1,15 @@
+{\r
+    "name": "protobufjs-protoify-example",\r
+    "version": "1.0.0",\r
+    "main": "index.js",\r
+    "dependencies": {\r
+        "protobufjs": "~3.7"\r
+    },\r
+    "engines": {\r
+        "node": ">=0.8"\r
+    },\r
+    "scripts": {\r
+        "test": "node test.js"\r
+    },\r
+    "private": true\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/test.js b/legacy-libs/grpc/node_modules/protobufjs/examples/protoify/test.js
new file mode 100644 (file)
index 0000000..c6c9e0d
--- /dev/null
@@ -0,0 +1,56 @@
+var protoify = require("./index.js"),\r
+    ByteBuffer = require("protobufjs").ByteBuffer,\r
+    assert = require("assert");\r
+\r
+// Array of samples to test\r
+var samples = [\r
+    1, -1, 0x80000000|0, 0x7fffffff|0,                    // Integers\r
+    0.1, 0.2, 1.234,                                      // Doubles\r
+    "John",                                               // String\r
+    true, false,                                          // Booleans\r
+    null,                                                 // null\r
+    [],                                                   // Array\r
+    {},                                                   // Object\r
+    undefined,                                            // undefined\r
+    [                                                     // Array holding each data type\r
+        1,\r
+        0.1,\r
+        "John",\r
+        true,\r
+        false,\r
+        null,\r
+        [],\r
+        {},\r
+        undefined\r
+    ],\r
+    {                                                     // Object holding each data type\r
+        1: 1,\r
+        0.1: 0.1,\r
+        "John": "John",\r
+        true: true,\r
+        false: false,\r
+        null: null,\r
+        array: [],\r
+        object: {},\r
+        undefined: undefined\r
+    }\r
+];\r
+\r
+samples.forEach(function(sample) {\r
+    // Encode each sample to a Buffer\r
+    var buf = protoify(sample);\r
+\r
+    // Print some nice debugging information\r
+    console.log(JSON.stringify(sample));\r
+    console.log("-------------------------------------------------------------------");\r
+    console.log(ByteBuffer.wrap(buf).toDebug(true));\r
+\r
+    // Decode the Buffer back to JSON\r
+    var decodedSample = protoify.parse(buf);\r
+\r
+    // And assert that it's actually equal\r
+    assert.deepEqual(decodedSample, sample);\r
+});\r
+\r
+// If no assertion errors are thrown, print\r
+console.log("OK");\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/README.md b/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/README.md
new file mode 100644 (file)
index 0000000..6a2c403
--- /dev/null
@@ -0,0 +1,9 @@
+ProtoBuf.js WebSocket example\r
+=============================\r
+This example shows how to use binary websockets to transfer protocol buffers.\r
+\r
+Instructions\r
+------------\r
+1. Set up dependencies: `npm install`\r
+2. Run: `node server.js`\r
+3. Open [http://localhost:8080/](http://localhost:8080/) in a recent browser\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/package.json b/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/package.json
new file mode 100644 (file)
index 0000000..3090d31
--- /dev/null
@@ -0,0 +1,16 @@
+{\r
+    "name": "protobufjs-websocket-example",\r
+    "version": "1.1.0",\r
+    "dependencies": {\r
+        "protobufjs": "~3",\r
+        "ws": "~0.4",\r
+        "open": "0.0.3"\r
+    },\r
+    "engines": {\r
+        "node": ">=0.8"\r
+    },\r
+    "scripts": {\r
+        "run": "node server.js"\r
+    },\r
+    "private": true\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/server.js b/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/server.js
new file mode 100644 (file)
index 0000000..514cb15
--- /dev/null
@@ -0,0 +1,97 @@
+// Set up: npm install\r
+var http = require("http"),\r
+    fs = require("fs"),\r
+    path = require("path"),\r
+    ws = require("ws"),\r
+    open = require("open"),\r
+    ProtoBuf = require("protobufjs");\r
+\r
+// Copy dependencies to "www/" (example specific, you usually don't have to care\r
+var deps = [\r
+      ["Long.min.js", "./node_modules/long/dist/Long.min.js"],\r
+      ["ByteBufferAB.min.js", "./node_modules/bytebuffer/dist/ByteBufferAB.min.js"],\r
+      ["ProtoBuf.min.js", "./node_modules/protobufjs/dist/ProtoBuf.min.js"]\r
+];\r
+for (var i=0, dep, data; i<deps.length; i++) {\r
+    dep = deps[i];\r
+    if (!fs.existsSync(path.join(__dirname, "www", dep[0]))) {\r
+        console.log("Copying "+dep[0]+" from "+dep[1]);\r
+        try {\r
+            fs.writeFileSync(path.join(__dirname, "www", dep[0]), fs.readFileSync(path.join(__dirname, dep[1])));\r
+        } catch (err) {\r
+            console.log("Copying failed: "+err.message);\r
+            console.log("\nDid you run `npm install` ?");\r
+            process.exit(1);\r
+        }\r
+    }\r
+}\r
+\r
+// Initialize from .proto file\r
+var builder = ProtoBuf.loadProtoFile(path.join(__dirname, "www", "example.proto")),\r
+    Message = builder.build("Message");\r
+\r
+// HTTP server\r
+var server = http.createServer(function(req, res) {\r
+        var file = null,\r
+            type = "text/html";\r
+        if (req.url == "/") {\r
+            file = "index.html";\r
+        } else if (/^\/(\w+(?:\.min)?\.(?:js|html|proto))$/.test(req.url)) {\r
+            file = req.url.substring(1);\r
+            if (/\.js$/.test(file)) {\r
+                type = "text/javascript";\r
+            }\r
+        }\r
+        if (file) {\r
+            fs.readFile(path.join(__dirname, "www", file), function(err, data) {\r
+                if (err) {\r
+                    res.writeHead(500, {"Content-Type": type});\r
+                    res.end("Internal Server Error: "+err);\r
+                } else {\r
+                    res.writeHead(200, {"Content-Type": type});\r
+                    res.write(data);\r
+                    res.end();\r
+                    console.log("Served www/"+file);\r
+                }\r
+            });\r
+        } else {\r
+            res.writeHead(404, {"Content-Type": "text/html"});\r
+            res.end("Not Found");\r
+        }\r
+    });\r
+server.listen(8080);\r
+server.on("listening", function() {\r
+    console.log("Server started");\r
+    open("http://localhost:8080/");\r
+});\r
+server.on("error", function(err) {\r
+    console.log("Failed to start server:", err);\r
+    process.exit(1);\r
+});\r
+\r
+// WebSocket adapter\r
+var wss = new ws.Server({server: server});\r
+wss.on("connection", function(socket) {\r
+    console.log("New WebSocket connection");\r
+    socket.on("close", function() {\r
+        console.log("WebSocket disconnected");\r
+    });\r
+    socket.on("message", function(data, flags) {\r
+        if (flags.binary) {\r
+            try {\r
+                // Decode the Message\r
+                var msg = Message.decode(data);\r
+                console.log("Received: "+msg.text);\r
+                // Transform the text to upper case\r
+                msg.text = msg.text.toUpperCase();\r
+                // Re-encode it and send it back\r
+                socket.send(msg.toBuffer());\r
+                console.log("Sent: "+msg.text);\r
+            } catch (err) {\r
+                console.log("Processing failed:", err);\r
+            }\r
+        } else {\r
+            console.log("Not binary data");\r
+        }\r
+    });\r
+});\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/www/example.proto b/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/www/example.proto
new file mode 100644 (file)
index 0000000..f717bf3
--- /dev/null
@@ -0,0 +1,3 @@
+message Message {\r
+    required string text = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/www/index.html b/legacy-libs/grpc/node_modules/protobufjs/examples/websocket/www/index.html
new file mode 100644 (file)
index 0000000..cb2cf4b
--- /dev/null
@@ -0,0 +1,59 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>                                        <!-- Please copy the following files into here: -->\r
+<script src="./Long.min.js"></script>         <!-- https://raw.github.com/dcodeIO/Long.js/master/dist/Long.min.js -->\r
+<script src="./ByteBufferAB.min.js"></script> <!-- https://raw.github.com/dcodeIO/ByteBuffer.js/master/dist/ByteBufferAB.min.js -->\r
+<script src="./ProtoBuf.min.js"></script>     <!-- https://raw.github.com/dcodeIO/ProtoBuf.js/master/dist/ProtoBuf.min.js -->\r
+<script>\r
+if (typeof dcodeIO === 'undefined' || !dcodeIO.ProtoBuf) {\r
+    throw(new Error("ProtoBuf.js is not present. Please see www/index.html for manual setup instructions."));\r
+}\r
+// Initialize ProtoBuf.js\r
+var ProtoBuf = dcodeIO.ProtoBuf;\r
+var Message = ProtoBuf.loadProtoFile("./example.proto").build("Message");\r
+</script>\r
+</head>\r
+<body>\r
+<textarea id="log" style="width: 100%; height: 200px"></textarea><br />\r
+<input type="text" id="text" value="hello world!" /> <button onclick="send()">Send</button>\r
+\r
+<script>\r
+var log = document.getElementById("log");\r
+var text = document.getElementById("text");\r
+\r
+// Connect to our server: node server.js\r
+var socket = new WebSocket("ws://localhost:8080/ws");\r
+socket.binaryType = "arraybuffer"; // We are talking binary\r
+\r
+function send() {\r
+    if (socket.readyState == WebSocket.OPEN) {\r
+        var msg = new Message(text.value);\r
+        socket.send(msg.toArrayBuffer());\r
+        log.value += "Sent: "+msg.text+"\n";\r
+    } else {\r
+        log.value += "Not connected\n";\r
+    }\r
+}\r
+\r
+socket.onopen = function() {\r
+    log.value += "Connected\n";\r
+};\r
+\r
+socket.onclose = function() {\r
+    log.value += "Disconnected\n";\r
+};\r
+    \r
+socket.onmessage = function(evt) {\r
+    try {\r
+        // Decode the Message\r
+        var msg = Message.decode(evt.data);\r
+        log.value += "Received: "+msg.text+"\n";\r
+    } catch (err) {\r
+        log.value += "Error: "+err+"\n";\r
+    }\r
+};\r
+\r
+log.value = ""; // Clear log on reload\r
+</script>\r
+</body>\r
+</html>\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/externs/fs.js b/legacy-libs/grpc/node_modules/protobufjs/externs/fs.js
new file mode 100644 (file)
index 0000000..04b422d
--- /dev/null
@@ -0,0 +1,644 @@
+/*\r
+ * Copyright 2012 The Closure Compiler Authors.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @fileoverview Definitions for node's "fs" module.\r
+ * @see http://nodejs.org/api/fs.html\r
+ * @externs\r
+ * @author Daniel Wirtz <dcode@dcode.io>\r
+ */\r
+\r
+/**\r
+ BEGIN_NODE_INCLUDE\r
+ var fs = require('fs');\r
+ END_NODE_INCLUDE\r
+ */\r
+\r
+var fs = {};\r
+\r
+/**\r
+ * @param {string} oldPath\r
+ * @param {string} newPath\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.rename = function(oldPath, newPath, callback) {};\r
+\r
+/**\r
+ * @param {string} oldPath\r
+ * @param {string} newPath\r
+ */\r
+fs.renameSync = function(oldPath, newPath) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} len\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.truncate = function(fd, len, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} len\r
+ */\r
+fs.truncateSync = function(fd, len) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.chown = function(path, uid, gid, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ */\r
+fs.chownSync = function(path, uid, gid) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.fchown = function(fd, uid, gid, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ */\r
+fs.fchownSync = function(fd, uid, gid) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.lchown = function(path, uid, gid, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} uid\r
+ * @param {number} gid\r
+ */\r
+fs.lchownSync = function(path, uid, gid) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.chmod = function(path, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ */\r
+fs.chmodSync = function(path, mode) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.fchmod = function(fd, mode, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} mode\r
+ */\r
+fs.fchmodSync = function(fd, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.lchmod = function(path, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} mode\r
+ */\r
+fs.lchmodSync = function(path, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string, fs.Stats)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.stat = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {fs.Stats}\r
+ * @nosideeffects\r
+ */\r
+fs.statSync = function(path) {}\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {function(string, fs.Stats)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.fstat = function(fd, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @return {fs.Stats}\r
+ * @nosideeffects\r
+ */\r
+fs.fstatSync = function(fd) {}\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string, fs.Stats)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.lstat = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {fs.Stats}\r
+ * @nosideeffects\r
+ */\r
+fs.lstatSync = function(path) {}\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.link = function(srcpath, dstpath, callback) {};\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ */\r
+fs.linkSync = function(srcpath, dstpath) {};\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ * @param {string=} type\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.symlink = function(srcpath, dstpath, type, callback) {};\r
+\r
+/**\r
+ * @param {string} srcpath\r
+ * @param {string} dstpath\r
+ * @param {string=} type\r
+ */\r
+fs.symlinkSync = function(srcpath, dstpath, type) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string, string)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.readlink = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+fs.readlinkSync = function(path) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {object.<string,string>=|function(string, string)=} cache\r
+ * @param {function(string, string)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.realpath = function(path, cache, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {object.<string,string>=} cache\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+fs.realpathSync = function(path, cache) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.unlink = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ */\r
+fs.unlinkSync = function(path) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.rmdir = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ */\r
+fs.rmdirSync = function(path) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number=} mode\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.mkdir = function(path, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number=} mode\r
+ */\r
+fs.mkdirSync = function(path, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(string,array.<string>)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.readdir = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @return {array.<string>}\r
+ * @nosideeffects\r
+ */\r
+fs.readdirSync = function(path) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.close = function(fd, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ */\r
+fs.closeSync = function(fd) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {string} flags\r
+ * @param {number=} mode\r
+ * @param {function(string, *)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.open = function(path, flags, mode, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {string} flags\r
+ * @param {number=} mode\r
+ * @return {*}\r
+ * @nosideeffects\r
+ */\r
+fs.openSync = function(path, flags, mode) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @param {function(...)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.utimes = function(path, atime, mtime, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @nosideeffects\r
+ */\r
+fs.utimesSync = function(path, atime, mtime) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @param {function(...)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.futimes = function(fd, atime, mtime, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {number} atime\r
+ * @param {number} mtime\r
+ * @nosideeffects\r
+ */\r
+fs.futimesSync = function(fd, atime, mtime) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {function(...)=} callback\r
+ */\r
+fs.fsync = function(fd, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ */\r
+fs.fsyncSync = function(fd) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @param {function(string, number, *)=} callback\r
+ */\r
+fs.write = function(fd, buffer, offset, length, position, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @return {number}\r
+ */\r
+fs.writeSync = function(fd, buffer, offset, length, position) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @param {function(string, number, *)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.read = function(fd, buffer, offset, length, position, callback) {};\r
+\r
+/**\r
+ * @param {*} fd\r
+ * @param {*} buffer\r
+ * @param {number} offset\r
+ * @param {number} length\r
+ * @param {number} position\r
+ * @return {number}\r
+ * @nosideeffects\r
+ */\r
+fs.readSync = function(fd, buffer, offset, length, position) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {string=|function(string, *)=}encoding\r
+ * @param {function(string, *)=} callback\r
+ * @nosideeffects\r
+ */\r
+fs.readFile = function(filename, encoding, callback) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {string=} encoding\r
+ * @nosideeffects\r
+ */\r
+fs.readFileSync = function(filename, encoding) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=|function(string)=} encoding\r
+ * @param {function(string)=} callback\r
+ */\r
+fs.writeFile = function(filename, data, encoding, callback) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=} encoding\r
+ */\r
+fs.writeFileSync = function(filename, data, encoding) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=|function(string)=} encoding\r
+ * @param {function(string)=} callback\r
+ */\r
+fs.appendFile = function(filename, data, encoding, callback) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {*} data\r
+ * @param {string=|function(string)=} encoding\r
+ */\r
+fs.appendFileSync = function(filename, data, encoding) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {{persistent: boolean, interval: number}=|function(*,*)} options\r
+ * @param {function(*,*)=} listener\r
+ */\r
+fs.watchFile = function(filename, options, listener) {};\r
+\r
+/**\r
+ * @param {string} filename\r
+ * @param {function=} listener\r
+ */\r
+fs.unwatchFile = function(filename, listener) {};\r
+\r
+/**\r
+ * \r
+ * @param {string} filename\r
+ * @param {{persistent: boolean}=|function(string, string)} options\r
+ * @param {function(string, string)=} listener\r
+ * @return {fs.FSWatcher}\r
+ */\r
+fs.watch = function(filename, options, listener) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(boolean)} callback\r
+ * @nosideeffects\r
+ */\r
+fs.exists = function(path, callback) {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @nosideeffects\r
+ */\r
+fs.existsSync = function(path) {};\r
+\r
+/**\r
+ * @constructor\r
+ */\r
+fs.Stats = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isFile = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isDirectory = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isBlockDevice = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isCharacterDevice = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isSymbolicLink = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isFIFO = function() {};\r
+\r
+/**\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+fs.Stats.prototype.isSocket = function() {};\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.dev = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.ino = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.mode = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.nlink = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.uid = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.gid = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.rdev = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.size = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.blkSize = 0;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+fs.Stats.prototype.blocks = 0;\r
+\r
+/**\r
+ * @type {Date}\r
+ */\r
+fs.Stats.prototype.atime = 0;\r
+\r
+/**\r
+ * @type {Date}\r
+ */\r
+fs.Stats.prototype.mtime = 0;\r
+\r
+/**\r
+ * @type {Date}\r
+ */\r
+fs.Stats.prototype.ctime = 0;\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {{flags: string, encoding: ?string, fd: *, mode: number, bufferSize: number}=} options\r
+ * @nosideeffects\r
+ */\r
+fs.createReadStream = function(path, options) {};\r
+\r
+/**\r
+ * @constructor\r
+ * @extends {stream.ReadableStream}\r
+ */\r
+fs.ReadStream = function() {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {{flags: string, encoding: ?string, mode: number}=} options\r
+ * @nosideeffects\r
+ */\r
+fs.createWriteStream = function(path, options) {};\r
+\r
+/**\r
+ * @constructor\r
+ * @extends {stream.WritableStream}\r
+ */\r
+fs.WriteStream = function() {};\r
+\r
+/**\r
+ * @param {string} event\r
+ * @param {function(...)} callback\r
+ */\r
+fs.WriteStream.prototype.on = function(event, callback) {};\r
+\r
+/**\r
+ * @constructor\r
+ */\r
+fs.FSWatcher = function() {};\r
+\r
+/**\r
+ */\r
+fs.FSWatcher.prototype.close = function() {};\r
+\r
+/**\r
+ * @param {string} event\r
+ * @param {function(...)} callback\r
+ */\r
+fs.FSWatcher.prototype.on = function(event, callback) {};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/externs/protobuf.js b/legacy-libs/grpc/node_modules/protobufjs/externs/protobuf.js
new file mode 100644 (file)
index 0000000..a2ad4d1
--- /dev/null
@@ -0,0 +1,933 @@
+/*\r
+ * Copyright 2012 The Closure Compiler Authors.\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *     http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @fileoverview Externs for ProtoBuf.js.\r
+ * @see https://github.com/dcodeIO/ProtoBuf.js\r
+ * @externs\r
+ */\r
+\r
+/**\r
+ BEGIN_NODE_INCLUDE\r
+ var ProtoBuf = require('protobufjs');\r
+ END_NODE_INCLUDE\r
+ */\r
+\r
+/**\r
+ * @typedef {Array}\r
+ */\r
+var Buffer;\r
+\r
+/**\r
+ * @typedef {Object}\r
+ */\r
+var dcodeIO;\r
+\r
+/**\r
+ * {@type Object.<string.*>}\r
+ */\r
+var ProtoBuf = {};\r
+\r
+/**\r
+ * @type {string}\r
+ * @const\r
+ */\r
+ProtoBuf.VERSION;\r
+\r
+/**\r
+ * @type {!Object.<string,number>}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES = {};\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.VARINT;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS64;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.LDELIM;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.STARTGROUP;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.ENDGROUP;\r
+\r
+/**\r
+ * @type {number}\r
+ * @const\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS32;\r
+\r
+/**\r
+ * @type {!Array.<number>}\r
+ * @const\r
+ */\r
+ProtoBuf.PACKABLE_WIRE_TYPES;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.convertFieldsToCamelCase;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.populateAccessors;\r
+\r
+/**\r
+ * @dict\r
+ * @type {!Object<string,{name: string, wireType: number}>}\r
+ * @const\r
+ */\r
+ProtoBuf.TYPES;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.ID_MIN;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.ID_MAX;\r
+\r
+/**\r
+ * @type {!function(new: ByteBuffer, ...*)}\r
+ */\r
+ProtoBuf.ByteBuffer;\r
+\r
+/**\r
+ * @type {?function(new: Long, ...*)}\r
+ */\r
+ProtoBuf.Long;\r
+\r
+/**\r
+ * @type {!Object<string,string|RegExp>}\r
+ */\r
+ProtoBuf.Lang;\r
+\r
+/**\r
+ * @type {Object<string, function(*)>}\r
+ */\r
+ProtoBuf.DotProto;\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @constructor\r
+ */\r
+ProtoBuf.DotProto.Tokenizer = function(proto) {};\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.source;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.index;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.line;\r
+\r
+/**\r
+ * @type {Array.<string>}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.stack;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.readingString;\r
+\r
+/**\r
+ * @return {?string}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.next = function() {};\r
+\r
+/**\r
+ * @return {?string}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.peek = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.DotProto.Tokenizer.prototype.toString = function() {};\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @constructor\r
+ */\r
+ProtoBuf.DotProto.Parser = function(proto) {};\r
+\r
+/**\r
+ * @type {!ProtoBuf.DotProto.Tokenizer}\r
+ */\r
+ProtoBuf.DotProto.Parser.prototype.tn;\r
+\r
+/**\r
+ * @return {{package: (string|null), messages: Array.<Object>, enums: Array.<Object>, imports: Array.<string>, options: Object<string,*>}}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.DotProto.Parser.prototype.parse = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.DotProto.Parser.prototype.toString = function() {};\r
+\r
+/**\r
+ * @type {Object<string, function(*)>}\r
+ */\r
+ProtoBuf.Reflect.Reflect = {};\r
+\r
+/**\r
+ * @constructor\r
+ * @param {ProtoBuf.Reflect.T} parent\r
+ * @param {string} name Object name\r
+ */\r
+ProtoBuf.Reflect.T = function(parent, name) {};\r
+\r
+/**\r
+ * @type {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Reflect.T.prototype.parent;\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.T.prototype.name;\r
+\r
+/**\r
+ * @returns {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.T.prototype.fqn = function() {};\r
+\r
+/**\r
+ * @param {boolean=} includeClass\r
+ * @returns {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.T.prototype.toString = function(includeClass) {};\r
+\r
+/**\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.T.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {?ProtoBuf.Reflect.Namespace} parent\r
+ * @param {string} name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Namespace = function(parent, name) {};\r
+\r
+/**\r
+ * @type {Array.<ProtoBuf.Reflect.T>}\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.children;\r
+\r
+/**\r
+ * @param {ProtoBuf.Reflect.T=} type\r
+ * @return {Array.<ProtoBuf.Reflect.T>}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.getChildren = function(type) {};\r
+\r
+/**\r
+ * @param {ProtoBuf.Reflect.T} child\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.addChild = function(child) {};\r
+\r
+/**\r
+ * @param {string|number} nameOrId\r
+ * @returns {boolean}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.hasChild = function(nameOrId) {};\r
+\r
+/**\r
+ * @param {string|number} nameOrId\r
+ * @return {?ProtoBuf.Reflect.T}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.getChild = function(nameOrId) {};\r
+\r
+/**\r
+ * @param {string} qn\r
+ * @param {boolean=} excludeFields\r
+ * @return {?ProtoBuf.Reflect.Namespace}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.resolve = function(qn, excludeFields) {};\r
+\r
+/**\r
+ * @return {Object.<string,Function|Object>}\r
+ */\r
+ProtoBuf.Reflect.Namespace.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Namespace} parent\r
+ * @param {string} name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+ProtoBuf.Reflect.Message = function(parent, name) {};\r
+\r
+/**\r
+ * @type {?Array.<number>}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.extensions;\r
+\r
+/**\r
+ * @type {?ProtoBuf.Builder.Message}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.clazz;\r
+\r
+/**\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Builder.Message} message\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.encode = function(message, buffer) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Builder.Message} message\r
+ * @return {number}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.calculate = function(message) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Builder.Message} message\r
+ * @param {!ByteBuffer} buffer\r
+ * @param {boolean} noVerify\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.encodeDelimited = function(message, buffer, noVerify) {};\r
+\r
+/**\r
+ * @param {!ByteBuffer} buffer\r
+ * @param {number=} length\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.decode = function(buffer, length) {};\r
+\r
+/**\r
+ * @param {!ByteBuffer} buffer\r
+ * @param {number=} length\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.prototype.decodeDelimited = function(buffer, length) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Message} message\r
+ * @param {string} rule\r
+ * @param {string} type\r
+ * @param {string} name\r
+ * @param {number} id\r
+ * @param {Object<string>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Message.Field = function(message, rule, type, name, id, options) {};\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.required;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.repeated;\r
+\r
+/**\r
+ * @type {string|{name: string, wireType: number}}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.type;\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.id;\r
+\r
+/**\r
+ * @type {!Object.<string,*>}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.options;\r
+\r
+/**\r
+ * @type {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.resolvedType;\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.originalName;\r
+\r
+/**\r
+ * @param {*} value\r
+ * @param {boolean=} skipRepeated\r
+ * @return {*}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.verifyValue = function(value, skipRepeated) {};\r
+\r
+/**\r
+ * @param {*} value\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.encode = function(value, buffer) {};\r
+\r
+/**\r
+ * @param {*} value\r
+ * @return {number}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.calculate = function(value) {};\r
+\r
+/**\r
+ * @param {number} wireType\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {*}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.decode = function(wireType, buffer) {};\r
+\r
+/**\r
+ * @param {*} value\r
+ * @param {!ByteBuffer} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Message.Field.prototype.encodeValue = function(value, buffer) {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.T} parent\r
+ * @param {string} name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+ProtoBuf.Reflect.Enum = function(parent, name) {};\r
+\r
+/**\r
+ * @return {Object<string,*>}\r
+ */\r
+ProtoBuf.Reflect.Enum.prototype.build = function() {};\r
+\r
+/**\r
+ * @type {?Object.<string,number>}\r
+ */\r
+ProtoBuf.Reflect.Enum.prototype.object;\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Enum} enm\r
+ * @param {string} name\r
+ * @param {number} id \r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Enum.Value = function(enm, name, id) {};\r
+\r
+/**\r
+ * @type {number}\r
+ */\r
+ProtoBuf.Reflect.Enum.Value.prototype.id;\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Namespace} root\r
+ * @param {string} name Service name\r
+ * @param {Object.<string,*>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+ProtoBuf.Reflect.Service = function(root, name, options) {};\r
+\r
+/**\r
+ * @type {ProtoBuf.Builder.Service}\r
+ */\r
+ProtoBuf.Reflect.Service.prototype.clazz;\r
+\r
+/**\r
+ * @return {!ProtoBuf.Builder.Service}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Reflect.Service.prototype.build = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Service} svc\r
+ * @param {string} name\r
+ * @param {Object.<string,*>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+ProtoBuf.Reflect.Service.Method = function(svc, name, options) {};\r
+\r
+/**\r
+ * @return {Object.<string,*>}\r
+ */\r
+ProtoBuf.Reflect.Service.Method.prototype.buildOpt = function() {};\r
+\r
+/**\r
+ * @param {!ProtoBuf.Reflect.Service} svc\r
+ * @param {string} name\r
+ * @param {string} request\r
+ * @param {string} response\r
+ * @param {Object.<string,*>=} options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Service.Method\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod = function(svc, name, request, response, options) {};\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.requestName;\r
+\r
+/**\r
+ * @type {string}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.responseName;\r
+\r
+/**\r
+ * @type {ProtoBuf.Reflect.Message}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedRequestType;\r
+\r
+/**\r
+ * @type {ProtoBuf.Reflect.Message}\r
+ */\r
+ProtoBuf.Reflect.Service.RPCMethod.prototype.resolvedResponseType;\r
+\r
+/**\r
+ * @constructor\r
+ */\r
+ProtoBuf.Builder = function() {};\r
+\r
+/**\r
+ * @type {!ProtoBuf.Reflect.Namespace}\r
+ */\r
+ProtoBuf.Builder.prototype.ns;\r
+\r
+/**\r
+ * @type {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Builder.prototype.ptr;\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Builder.prototype.resolved;\r
+\r
+/**\r
+ * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}\r
+ */\r
+ProtoBuf.Builder.prototype.result;\r
+\r
+/**\r
+ * @type {Array.<string>}\r
+ */\r
+ProtoBuf.Builder.prototype.files;\r
+\r
+/**\r
+ * @type {?string}\r
+ */\r
+ProtoBuf.Builder.prototype.importRoot;\r
+\r
+/**\r
+ */\r
+ProtoBuf.Builder.prototype.reset = function() {};\r
+\r
+/**\r
+ * @param {string} pkg\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.define = function(pkg) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.isValidMessage = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.isValidMessageField = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Builder.isValidEnum = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Builder.isValidService = function(def) {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} def\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Builder.isValidExtend = function(def) {};\r
+\r
+/**\r
+ * @param {Array.<Object.<string,*>>} messages\r
+ * @return {ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.create = function(messages) {};\r
+\r
+/**\r
+ * @name ProtoBuf.Builder.prototype.import\r
+ * @function\r
+ * @param {ProtoBuf.Builder} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype["import"] = function(builder, filename) {};\r
+\r
+/**\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.resolveAll = function() {};\r
+\r
+/**\r
+ * @param {string=} path\r
+ * @return {ProtoBuf.Builder.Message|Object.<string,*>}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.prototype.build = function(path) {};\r
+\r
+/**\r
+ * @param {string=} path\r
+ * @return {?ProtoBuf.Reflect.T}\r
+ */\r
+ProtoBuf.Builder.prototype.lookup = function(path) {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.prototype.toString = function() {};\r
+\r
+/**\r
+ * @param {Object.<string,*>} values\r
+ * @constructor\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message = function(values) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.add = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.$add = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.set = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @param {*} value\r
+ * @param {boolean=} noAssert\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.$set = function(key, value, noAssert) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @return {*}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.get = function(key) {};\r
+\r
+/**\r
+ * @param {string} key\r
+ * @return {*}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.$get = function(key) {};\r
+\r
+/**\r
+ * @param {ByteBuffer=} buffer\r
+ * @return {!ByteBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encode = function(buffer) {};\r
+\r
+/**\r
+ * @return {number}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.calculate = function() {};\r
+\r
+/**\r
+ * @return {!ArrayBuffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encodeAB = function() {};\r
+\r
+/**\r
+ * @return {!ArrayBuffer}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toArrayBuffer = function() {};\r
+\r
+/**\r
+ * @return {!Buffer}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encodeNB = function() {};\r
+\r
+/**\r
+ * @return {!Buffer}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toBuffer = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encode64 = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toBase64 = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.encodeHex = function() {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toHex = function() {};\r
+\r
+/**\r
+ * @param {boolean=} includeBuffers\r
+ * @return {Object.<string,*>}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toRaw = function(includeBuffers) {};\r
+\r
+/**\r
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer\r
+ * @param {string=} enc\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.decode = function(buffer, enc) {};\r
+\r
+/**\r
+ * @param {string} str\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.decode64 = function(str) {};\r
+\r
+/**\r
+ * @param {string} str\r
+ * @return {!ProtoBuf.Builder.Message}\r
+ * @throws {Error}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.decodeHex = function(str) {};\r
+\r
+/**\r
+ * @return {string}\r
+ * @nosideeffects\r
+ */\r
+ProtoBuf.Builder.Message.prototype.toString = function() {};\r
+\r
+/**\r
+ * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl\r
+ * @constructor\r
+ */\r
+ProtoBuf.Builder.Service = function(rpcImpl) {};\r
+\r
+/**\r
+ * @type {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r
+ */\r
+ProtoBuf.Builder.prototype.rpcImpl;\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @param {(ProtoBuf.Builder|string)=} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadProto = function(proto, builder, filename) {};\r
+\r
+/**\r
+ * @param {string} proto\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.protoFromString = function(proto, builder, filename) {};\r
+\r
+/**\r
+ * @param {string|{root: string, file: string}} filename\r
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback\r
+ * @param {ProtoBuf.Builder=} builder\r
+ * @return {ProtoBuf.Builder|undefined}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadProtoFile = function(filename, callback, builder) {};\r
+\r
+/**\r
+ * @param {string|{root: string, file: string}} filename\r
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback\r
+ * @param {ProtoBuf.Builder=} builder\r
+ * @return {ProtoBuf.Builder|undefined}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.protoFromFile = function(filename, callback, builder) {};\r
+\r
+/**\r
+ * @param {!*|string} json\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder\r
+ * @param {(string|{root: string, file: string})=} filename\r
+ * @return {!ProtoBuf.Builder}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadJson = function(json, builder, filename) {};\r
+\r
+/**\r
+ * @param {string|{root: string, file: string}} filename\r
+ * @param {(function(ProtoBuf.Builder)|ProtoBuf.Builder)=} callback\r
+ * @param {ProtoBuf.Builder=} builder\r
+ * @return {ProtoBuf.Builder|undefined}\r
+ * @throws {Error}\r
+ */\r
+ProtoBuf.loadJsonFile = function(filename, callback, builder) {};\r
+\r
+/**\r
+ * @param {string=} pkg\r
+ * @return {!ProtoBuf.Builder}\r
+ */\r
+ProtoBuf.newBuilder = function(pkg) {};\r
+\r
+ProtoBuf.Util = {};\r
+\r
+/**\r
+ * @type {boolean}\r
+ */\r
+ProtoBuf.Util.IS_NODE;\r
+\r
+/**\r
+ * @return {XMLHttpRequest}\r
+ */\r
+ProtoBuf.Util.XHR = function() {};\r
+\r
+/**\r
+ * @param {string} path\r
+ * @param {function(?string)=} callback\r
+ * @return {?string|undefined}\r
+ */\r
+ProtoBuf.Util.fetch = function(path, callback) {};\r
+\r
+/**\r
+ * @param {*} obj\r
+ * @return {boolean}\r
+ */\r
+ProtoBuf.Util.isArray = function(obj) {};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/index.js b/legacy-libs/grpc/node_modules/protobufjs/index.js
new file mode 100644 (file)
index 0000000..989d3b0
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require("./dist/protobuf.js");\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/jsdoc.json b/legacy-libs/grpc/node_modules/protobufjs/jsdoc.json
new file mode 100644 (file)
index 0000000..5527efd
--- /dev/null
@@ -0,0 +1,12 @@
+{\r
+    "tags": {\r
+        "allowUnknownTags": true\r
+    },\r
+    "source": {\r
+        "include": ["dist/protobuf.js"]\r
+    },\r
+    "opts": {\r
+        "destination": "docs"\r
+    },\r
+    "plugins": ["plugins/markdown"]\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/package.json b/legacy-libs/grpc/node_modules/protobufjs/package.json
new file mode 100644 (file)
index 0000000..f775a72
--- /dev/null
@@ -0,0 +1,95 @@
+{
+  "author": {
+    "name": "Daniel Wirtz",
+    "email": "dcode@dcode.io"
+  },
+  "bin": {
+    "pbjs": "./bin/pbjs"
+  },
+  "browser": {
+    "fs": false,
+    "path": false
+  },
+  "bugs": {
+    "url": "https://github.com/dcodeIO/protobuf.js/issues"
+  },
+  "contributors": [
+    {
+      "name": "Frank Xu",
+      "email": "yyfrankyy@gmail.com"
+    }
+  ],
+  "dependencies": {
+    "ascli": "~1",
+    "bytebuffer": "~5",
+    "glob": "^7.0.5",
+    "yargs": "^3.10.0"
+  },
+  "description": "Protocol Buffers for JavaScript. Finally.",
+  "devDependencies": {
+    "closurecompiler": "~1",
+    "fixture-stdout": "^0.2.1",
+    "jsdoc": "~3.3.0-alpha10",
+    "metascript": ">=0.18 <1",
+    "testjs": "~1 >=1.0.4"
+  },
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-55Kcx1MhPZX0zTbVosMQEO5R6/rikNXd9b6RQK4KSPcrSIIwoXTtebIczUrXlwaSrbz4x8XUVThGPob1n8I4QA==",
+    "shasum": "e4dfe9fb67c90b2630d15868249bcc4961467a17",
+    "tarball": "https://registry.npmjs.org/protobufjs/-/protobufjs-5.0.3.tgz",
+    "fileCount": 189,
+    "unpackedSize": 3128808,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+/gjCRA9TVsSAnZWagAA4lAQAIQu/R1fQv2iN0SAWNaR\nDe6nwKeB3BTkxeIB/HNfwzhVEmSepbskJrzx4ZSGlnSKLI/R/RPjh1yvx6dG\nQ1+1ddWcSTbAj85enFcR1WIb3/rV92W+61sba8vh8+yYlPs/HO2aXc7RqjuH\nnWAHJ/WgQItMdiOLbXxtm1s0oFiK2/l9tLVU+xzIIjADzNjPSD/tHZkc4S1a\n7b+6AX0lviG2A9AxyQgF/WLoY8sY7xEHiukE6mFfu0l8c9u0IeM9zx/wtzyB\nPKaBjzjDgEkqbrLGVARuYTOT5oFd/DNESLfkpYRJWsYgTHluY+RUyxCM2n61\nRRSqNedYavPi602su160AQnANLH8wyQG+KSdaPPR9TmCYE+5+B1TZU77jYKL\nyCmwoNi/SV8U9HNESFrgh/lMqizYOyLjfmhdeegEw4+p6fDBcW6//JWRBo2k\no5hQgsgmcSDV3wPrZoRMOC5z1x0hm9DlojZ7lJk5fuoVYjT1/K4BhcM4OFFu\ndy77gZl9MSEQWxMDp8VHPYVCsnEjJtKdqPJgiB9sD9qqM+b9BxC2eiGjh5rw\n5/3zecpFTtdJ0zn4XlFk/JrBTF9+WNTI4akHqWmzOkFmrqdn8d+JgPD+FJph\nfPHLENcZ+AqwDhZhMxV4LKHZ8t2XlhCfvFu26nQ6sfXmpPUfo/Qj5gj5DIcS\nUf1W\r\n=4WLx\r\n-----END PGP SIGNATURE-----\r\n",
+    "signatures": [
+      {
+        "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
+        "sig": "MEYCIQCNjjw2GRdwG2F1J+hRI7YlyVJLp0awdgnwPxYsNu2SAQIhAJPM4WJeeyQWZfqlB8MzoC+Pk9qBCiFiYBX6WSwTVgIk"
+      }
+    ]
+  },
+  "engines": {
+    "node": ">=0.8"
+  },
+  "gitHead": "2c2ffbc084cb36c971885707c559cccdb242d08f",
+  "homepage": "https://github.com/dcodeIO/protobuf.js",
+  "keywords": [
+    "net",
+    "buffer",
+    "protobuf",
+    "serialization",
+    "bytebuffer",
+    "websocket",
+    "webrtc"
+  ],
+  "license": "Apache-2.0",
+  "main": "./dist/protobuf.js",
+  "maintainers": [
+    {
+      "name": "dcode",
+      "email": "dcode@dcode.io"
+    }
+  ],
+  "name": "protobufjs",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dcodeIO/protobuf.js.git"
+  },
+  "scripts": {
+    "build": "node scripts/build.js",
+    "compile": "npm run-script compile-full && npm run-script compile-light",
+    "compile-full": "ccjs dist/protobuf.js --create_source_map=dist/protobuf.min.map --compilation_level=SIMPLE_OPTIMIZATIONS > dist/protobuf.min.js",
+    "compile-light": "ccjs dist/protobuf-light.js --create_source_map=dist/protobuf-light.min.map --compilation_level=SIMPLE_OPTIMIZATIONS > dist/protobuf-light.min.js",
+    "compress": "npm run-script compress-full && npm run-script compress-light",
+    "compress-full": "gzip -c -9 dist/protobuf.min.js > dist/protobuf.min.js.gz",
+    "compress-light": "gzip -c -9 dist/protobuf-light.min.js > dist/protobuf-light.min.js.gz",
+    "descriptor2json": "node bin/pbjs src/google/protobuf/descriptor.proto --target=json > src/google/protobuf/descriptor.json",
+    "jsdoc": "node node_modules/jsdoc/jsdoc.js -c jsdoc.json",
+    "make": "npm run-script build && npm run-script compile && npm run-script descriptor2json && npm run-script compress && npm test && npm run-script jsdoc",
+    "prepublish": "npm test",
+    "test": "node bin/pbjs tests/complex.proto --target=json > tests/complex.json && node node_modules/testjs/bin/testjs tests/suite.js"
+  },
+  "version": "5.0.3"
+}
diff --git a/legacy-libs/grpc/node_modules/protobufjs/protobuf.png b/legacy-libs/grpc/node_modules/protobufjs/protobuf.png
new file mode 100644 (file)
index 0000000..7569a93
Binary files /dev/null and b/legacy-libs/grpc/node_modules/protobufjs/protobuf.png differ
diff --git a/legacy-libs/grpc/node_modules/protobufjs/scripts/build.js b/legacy-libs/grpc/node_modules/protobufjs/scripts/build.js
new file mode 100644 (file)
index 0000000..db3ab95
--- /dev/null
@@ -0,0 +1,53 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+var MetaScript = require("metascript"),\r
+    path = require("path"),\r
+    fs = require("fs");\r
+\r
+var rootDir = path.join(__dirname, ".."),\r
+    srcDir  = path.join(rootDir, "src"),\r
+    distDir = path.join(rootDir, "dist"),\r
+    pkg = require(path.join(rootDir, "package.json")),\r
+    filename;\r
+\r
+var scope = {\r
+    VERSION: pkg.version,           // Version\r
+    DOTPROTO: true                  // Whether to include the ProtoBuf.DotProto package for .proto syntax support\r
+};\r
+\r
+// Make full build\r
+console.log("Building protobuf.js with scope", JSON.stringify(scope, null, 2));\r
+fs.writeFileSync(\r
+    path.join(distDir, "protobuf.js"),\r
+    MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)\r
+);\r
+\r
+// Make light build\r
+scope.DOTPROTO = false;\r
+console.log("Building protobuf-light.js with scope", JSON.stringify(scope, null, 2));\r
+fs.writeFileSync(\r
+    path.join(distDir, "protobuf-light.js"),\r
+    MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "wrap.js")), filename, scope, srcDir)\r
+);\r
+\r
+// Update bower.json\r
+scope = { VERSION: pkg.version };\r
+console.log("Updating bower.json with scope", JSON.stringify(scope, null, 2));\r
+fs.writeFileSync(\r
+    path.join(rootDir, "bower.json"),\r
+    MetaScript.transform(fs.readFileSync(filename = path.join(srcDir, "bower.json.in")), filename, scope, srcDir)\r
+);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder.js
new file mode 100644 (file)
index 0000000..18eeba8
--- /dev/null
@@ -0,0 +1,634 @@
+/**\r
+ * @alias ProtoBuf.Builder\r
+ * @expose\r
+ */\r
+ProtoBuf.Builder = (function(ProtoBuf, Lang, Reflect) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Constructs a new Builder.\r
+     * @exports ProtoBuf.Builder\r
+     * @class Provides the functionality to build protocol messages.\r
+     * @param {Object.<string,*>=} options Options\r
+     * @constructor\r
+     */\r
+    var Builder = function(options) {\r
+\r
+        /**\r
+         * Namespace.\r
+         * @type {ProtoBuf.Reflect.Namespace}\r
+         * @expose\r
+         */\r
+        this.ns = new Reflect.Namespace(this, null, ""); // Global namespace\r
+\r
+        /**\r
+         * Namespace pointer.\r
+         * @type {ProtoBuf.Reflect.T}\r
+         * @expose\r
+         */\r
+        this.ptr = this.ns;\r
+\r
+        /**\r
+         * Resolved flag.\r
+         * @type {boolean}\r
+         * @expose\r
+         */\r
+        this.resolved = false;\r
+\r
+        /**\r
+         * The current building result.\r
+         * @type {Object.<string,ProtoBuf.Builder.Message|Object>|null}\r
+         * @expose\r
+         */\r
+        this.result = null;\r
+\r
+        /**\r
+         * Imported files.\r
+         * @type {Array.<string>}\r
+         * @expose\r
+         */\r
+        this.files = {};\r
+\r
+        /**\r
+         * Import root override.\r
+         * @type {?string}\r
+         * @expose\r
+         */\r
+        this.importRoot = null;\r
+\r
+        /**\r
+         * Options.\r
+         * @type {!Object.<string, *>}\r
+         * @expose\r
+         */\r
+        this.options = options || {};\r
+    };\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.prototype\r
+     * @inner\r
+     */\r
+    var BuilderPrototype = Builder.prototype;\r
+\r
+    // ----- Definition tests -----\r
+\r
+    /**\r
+     * Tests if a definition most likely describes a message.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isMessage = function(def) {\r
+        // Messages require a string name\r
+        if (typeof def["name"] !== 'string')\r
+            return false;\r
+        // Messages do not contain values (enum) or rpc methods (service)\r
+        if (typeof def["values"] !== 'undefined' || typeof def["rpc"] !== 'undefined')\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes a message field.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isMessageField = function(def) {\r
+        // Message fields require a string rule, name and type and an id\r
+        if (typeof def["rule"] !== 'string' || typeof def["name"] !== 'string' || typeof def["type"] !== 'string' || typeof def["id"] === 'undefined')\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes an enum.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isEnum = function(def) {\r
+        // Enums require a string name\r
+        if (typeof def["name"] !== 'string')\r
+            return false;\r
+        // Enums require at least one value\r
+        if (typeof def["values"] === 'undefined' || !Array.isArray(def["values"]) || def["values"].length === 0)\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes a service.\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isService = function(def) {\r
+        // Services require a string name and an rpc object\r
+        if (typeof def["name"] !== 'string' || typeof def["rpc"] !== 'object' || !def["rpc"])\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    /**\r
+     * Tests if a definition most likely describes an extended message\r
+     * @param {!Object} def\r
+     * @returns {boolean}\r
+     * @expose\r
+     */\r
+    Builder.isExtend = function(def) {\r
+        // Extends rquire a string ref\r
+        if (typeof def["ref"] !== 'string')\r
+            return false;\r
+        return true;\r
+    };\r
+\r
+    // ----- Building -----\r
+\r
+    /**\r
+     * Resets the pointer to the root namespace.\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @expose\r
+     */\r
+    BuilderPrototype.reset = function() {\r
+        this.ptr = this.ns;\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Defines a namespace on top of the current pointer position and places the pointer on it.\r
+     * @param {string} namespace\r
+     * @return {!ProtoBuf.Builder} this\r
+     * @expose\r
+     */\r
+    BuilderPrototype.define = function(namespace) {\r
+        if (typeof namespace !== 'string' || !Lang.TYPEREF.test(namespace))\r
+            throw Error("illegal namespace: "+namespace);\r
+        namespace.split(".").forEach(function(part) {\r
+            var ns = this.ptr.getChild(part);\r
+            if (ns === null) // Keep existing\r
+                this.ptr.addChild(ns = new Reflect.Namespace(this, this.ptr, part));\r
+            this.ptr = ns;\r
+        }, this);\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Creates the specified definitions at the current pointer position.\r
+     * @param {!Array.<!Object>} defs Messages, enums or services to create\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @throws {Error} If a message definition is invalid\r
+     * @expose\r
+     */\r
+    BuilderPrototype.create = function(defs) {\r
+        if (!defs)\r
+            return this; // Nothing to create\r
+        if (!Array.isArray(defs))\r
+            defs = [defs];\r
+        else {\r
+            if (defs.length === 0)\r
+                return this;\r
+            defs = defs.slice();\r
+        }\r
+\r
+        // It's quite hard to keep track of scopes and memory here, so let's do this iteratively.\r
+        var stack = [defs];\r
+        while (stack.length > 0) {\r
+            defs = stack.pop();\r
+\r
+            if (!Array.isArray(defs)) // Stack always contains entire namespaces\r
+                throw Error("not a valid namespace: "+JSON.stringify(defs));\r
+\r
+            while (defs.length > 0) {\r
+                var def = defs.shift(); // Namespaces always contain an array of messages, enums and services\r
+\r
+                if (Builder.isMessage(def)) {\r
+                    var obj = new Reflect.Message(this, this.ptr, def["name"], def["options"], def["isGroup"], def["syntax"]);\r
+\r
+                    // Create OneOfs\r
+                    var oneofs = {};\r
+                    if (def["oneofs"])\r
+                        Object.keys(def["oneofs"]).forEach(function(name) {\r
+                            obj.addChild(oneofs[name] = new Reflect.Message.OneOf(this, obj, name));\r
+                        }, this);\r
+\r
+                    // Create fields\r
+                    if (def["fields"])\r
+                        def["fields"].forEach(function(fld) {\r
+                            if (obj.getChild(fld["id"]|0) !== null)\r
+                                throw Error("duplicate or invalid field id in "+obj.name+": "+fld['id']);\r
+                            if (fld["options"] && typeof fld["options"] !== 'object')\r
+                                throw Error("illegal field options in "+obj.name+"#"+fld["name"]);\r
+                            var oneof = null;\r
+                            if (typeof fld["oneof"] === 'string' && !(oneof = oneofs[fld["oneof"]]))\r
+                                throw Error("illegal oneof in "+obj.name+"#"+fld["name"]+": "+fld["oneof"]);\r
+                            fld = new Reflect.Message.Field(this, obj, fld["rule"], fld["keytype"], fld["type"], fld["name"], fld["id"], fld["options"], oneof, def["syntax"]);\r
+                            if (oneof)\r
+                                oneof.fields.push(fld);\r
+                            obj.addChild(fld);\r
+                        }, this);\r
+\r
+                    // Push children to stack\r
+                    var subObj = [];\r
+                    if (def["enums"])\r
+                        def["enums"].forEach(function(enm) {\r
+                            subObj.push(enm);\r
+                        });\r
+                    if (def["messages"])\r
+                        def["messages"].forEach(function(msg) {\r
+                            subObj.push(msg);\r
+                        });\r
+                    if (def["services"])\r
+                        def["services"].forEach(function(svc) {\r
+                            subObj.push(svc);\r
+                        });\r
+\r
+                    // Set extension ranges\r
+                    if (def["extensions"]) {\r
+                        if (typeof def["extensions"][0] === 'number') // pre 5.0.1\r
+                            obj.extensions = [ def["extensions"] ];\r
+                        else\r
+                            obj.extensions = def["extensions"];\r
+                    }\r
+\r
+                    // Create on top of current namespace\r
+                    this.ptr.addChild(obj);\r
+                    if (subObj.length > 0) {\r
+                        stack.push(defs); // Push the current level back\r
+                        defs = subObj; // Continue processing sub level\r
+                        subObj = null;\r
+                        this.ptr = obj; // And move the pointer to this namespace\r
+                        obj = null;\r
+                        continue;\r
+                    }\r
+                    subObj = null;\r
+\r
+                } else if (Builder.isEnum(def)) {\r
+\r
+                    obj = new Reflect.Enum(this, this.ptr, def["name"], def["options"], def["syntax"]);\r
+                    def["values"].forEach(function(val) {\r
+                        obj.addChild(new Reflect.Enum.Value(this, obj, val["name"], val["id"]));\r
+                    }, this);\r
+                    this.ptr.addChild(obj);\r
+\r
+                } else if (Builder.isService(def)) {\r
+\r
+                    obj = new Reflect.Service(this, this.ptr, def["name"], def["options"]);\r
+                    Object.keys(def["rpc"]).forEach(function(name) {\r
+                        var mtd = def["rpc"][name];\r
+                        obj.addChild(new Reflect.Service.RPCMethod(this, obj, name, mtd["request"], mtd["response"], !!mtd["request_stream"], !!mtd["response_stream"], mtd["options"]));\r
+                    }, this);\r
+                    this.ptr.addChild(obj);\r
+\r
+                } else if (Builder.isExtend(def)) {\r
+\r
+                    obj = this.ptr.resolve(def["ref"], true);\r
+                    if (obj) {\r
+                        def["fields"].forEach(function(fld) {\r
+                            if (obj.getChild(fld['id']|0) !== null)\r
+                                throw Error("duplicate extended field id in "+obj.name+": "+fld['id']);\r
+                            // Check if field id is allowed to be extended\r
+                            if (obj.extensions) {\r
+                                var valid = false;\r
+                                obj.extensions.forEach(function(range) {\r
+                                    if (fld["id"] >= range[0] && fld["id"] <= range[1])\r
+                                        valid = true;\r
+                                });\r
+                                if (!valid)\r
+                                    throw Error("illegal extended field id in "+obj.name+": "+fld['id']+" (not within valid ranges)");\r
+                            }\r
+                            // Convert extension field names to camel case notation if the override is set\r
+                            var name = fld["name"];\r
+                            if (this.options['convertFieldsToCamelCase'])\r
+                                name = ProtoBuf.Util.toCamelCase(name);\r
+                            // see #161: Extensions use their fully qualified name as their runtime key and...\r
+                            var field = new Reflect.Message.ExtensionField(this, obj, fld["rule"], fld["type"], this.ptr.fqn()+'.'+name, fld["id"], fld["options"]);\r
+                            // ...are added on top of the current namespace as an extension which is used for\r
+                            // resolving their type later on (the extension always keeps the original name to\r
+                            // prevent naming collisions)\r
+                            var ext = new Reflect.Extension(this, this.ptr, fld["name"], field);\r
+                            field.extension = ext;\r
+                            this.ptr.addChild(ext);\r
+                            obj.addChild(field);\r
+                        }, this);\r
+\r
+                    } else if (!/\.?google\.protobuf\./.test(def["ref"])) // Silently skip internal extensions\r
+                        throw Error("extended message "+def["ref"]+" is not defined");\r
+\r
+                } else\r
+                    throw Error("not a valid definition: "+JSON.stringify(def));\r
+\r
+                def = null;\r
+                obj = null;\r
+            }\r
+            // Break goes here\r
+            defs = null;\r
+            this.ptr = this.ptr.parent; // Namespace done, continue at parent\r
+        }\r
+        this.resolved = false; // Require re-resolve\r
+        this.result = null; // Require re-build\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Propagates syntax to all children.\r
+     * @param {!Object} parent\r
+     * @inner\r
+     */\r
+    function propagateSyntax(parent) {\r
+        if (parent['messages']) {\r
+            parent['messages'].forEach(function(child) {\r
+                child["syntax"] = parent["syntax"];\r
+                propagateSyntax(child);\r
+            });\r
+        }\r
+        if (parent['enums']) {\r
+            parent['enums'].forEach(function(child) {\r
+                child["syntax"] = parent["syntax"];\r
+            });\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Imports another definition into this builder.\r
+     * @param {Object.<string,*>} json Parsed import\r
+     * @param {(string|{root: string, file: string})=} filename Imported file name\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @throws {Error} If the definition or file cannot be imported\r
+     * @expose\r
+     */\r
+    BuilderPrototype["import"] = function(json, filename) {\r
+        var delim = '/';\r
+\r
+        // Make sure to skip duplicate imports\r
+\r
+        if (typeof filename === 'string') {\r
+\r
+            if (ProtoBuf.Util.IS_NODE)\r
+                filename = require("path")['resolve'](filename);\r
+            if (this.files[filename] === true)\r
+                return this.reset();\r
+            this.files[filename] = true;\r
+\r
+        } else if (typeof filename === 'object') { // Object with root, file.\r
+\r
+            var root = filename.root;\r
+            if (ProtoBuf.Util.IS_NODE)\r
+                root = require("path")['resolve'](root);\r
+            if (root.indexOf("\\") >= 0 || filename.file.indexOf("\\") >= 0)\r
+                delim = '\\';\r
+            var fname;\r
+            if (ProtoBuf.Util.IS_NODE)\r
+                fname = require("path")['join'](root, filename.file);\r
+            else\r
+                fname = root + delim + filename.file;\r
+            if (this.files[fname] === true)\r
+                return this.reset();\r
+            this.files[fname] = true;\r
+        }\r
+\r
+        // Import imports\r
+\r
+        if (json['imports'] && json['imports'].length > 0) {\r
+            var importRoot,\r
+                resetRoot = false;\r
+\r
+            if (typeof filename === 'object') { // If an import root is specified, override\r
+\r
+                this.importRoot = filename["root"]; resetRoot = true; // ... and reset afterwards\r
+                importRoot = this.importRoot;\r
+                filename = filename["file"];\r
+                if (importRoot.indexOf("\\") >= 0 || filename.indexOf("\\") >= 0)\r
+                    delim = '\\';\r
+\r
+            } else if (typeof filename === 'string') {\r
+\r
+                if (this.importRoot) // If import root is overridden, use it\r
+                    importRoot = this.importRoot;\r
+                else { // Otherwise compute from filename\r
+                    if (filename.indexOf("/") >= 0) { // Unix\r
+                        importRoot = filename.replace(/\/[^\/]*$/, "");\r
+                        if (/* /file.proto */ importRoot === "")\r
+                            importRoot = "/";\r
+                    } else if (filename.indexOf("\\") >= 0) { // Windows\r
+                        importRoot = filename.replace(/\\[^\\]*$/, "");\r
+                        delim = '\\';\r
+                    } else\r
+                        importRoot = ".";\r
+                }\r
+\r
+            } else\r
+                importRoot = null;\r
+\r
+            for (var i=0; i<json['imports'].length; i++) {\r
+                if (typeof json['imports'][i] === 'string') { // Import file\r
+                    if (!importRoot)\r
+                        throw Error("cannot determine import root");\r
+                    var importFilename = json['imports'][i];\r
+                    if (importFilename === "google/protobuf/descriptor.proto")\r
+                        continue; // Not needed and therefore not used\r
+                    if (ProtoBuf.Util.IS_NODE)\r
+                        importFilename = require("path")['join'](importRoot, importFilename);\r
+                    else\r
+                        importFilename = importRoot + delim + importFilename;\r
+                    if (this.files[importFilename] === true)\r
+                        continue; // Already imported\r
+                    if (/\.proto$/i.test(importFilename) && !ProtoBuf.DotProto)       // If this is a light build\r
+                        importFilename = importFilename.replace(/\.proto$/, ".json"); // always load the JSON file\r
+                    var contents = ProtoBuf.Util.fetch(importFilename);\r
+                    if (contents === null)\r
+                        throw Error("failed to import '"+importFilename+"' in '"+filename+"': file not found");\r
+                    if (/\.json$/i.test(importFilename)) // Always possible\r
+                        this["import"](JSON.parse(contents+""), importFilename); // May throw\r
+                    else\r
+                        this["import"](ProtoBuf.DotProto.Parser.parse(contents), importFilename); // May throw\r
+                } else // Import structure\r
+                    if (!filename)\r
+                        this["import"](json['imports'][i]);\r
+                    else if (/\.(\w+)$/.test(filename)) // With extension: Append _importN to the name portion to make it unique\r
+                        this["import"](json['imports'][i], filename.replace(/^(.+)\.(\w+)$/, function($0, $1, $2) { return $1+"_import"+i+"."+$2; }));\r
+                    else // Without extension: Append _importN to make it unique\r
+                        this["import"](json['imports'][i], filename+"_import"+i);\r
+            }\r
+            if (resetRoot) // Reset import root override when all imports are done\r
+                this.importRoot = null;\r
+        }\r
+\r
+        // Import structures\r
+\r
+        if (json['package'])\r
+            this.define(json['package']);\r
+        if (json['syntax'])\r
+            propagateSyntax(json);\r
+        var base = this.ptr;\r
+        if (json['options'])\r
+            Object.keys(json['options']).forEach(function(key) {\r
+                base.options[key] = json['options'][key];\r
+            });\r
+        if (json['messages'])\r
+            this.create(json['messages']),\r
+            this.ptr = base;\r
+        if (json['enums'])\r
+            this.create(json['enums']),\r
+            this.ptr = base;\r
+        if (json['services'])\r
+            this.create(json['services']),\r
+            this.ptr = base;\r
+        if (json['extends'])\r
+            this.create(json['extends']);\r
+\r
+        return this.reset();\r
+    };\r
+\r
+    /**\r
+     * Resolves all namespace objects.\r
+     * @throws {Error} If a type cannot be resolved\r
+     * @returns {!ProtoBuf.Builder} this\r
+     * @expose\r
+     */\r
+    BuilderPrototype.resolveAll = function() {\r
+        // Resolve all reflected objects\r
+        var res;\r
+        if (this.ptr == null || typeof this.ptr.type === 'object')\r
+            return this; // Done (already resolved)\r
+\r
+        if (this.ptr instanceof Reflect.Namespace) { // Resolve children\r
+\r
+            this.ptr.children.forEach(function(child) {\r
+                this.ptr = child;\r
+                this.resolveAll();\r
+            }, this);\r
+\r
+        } else if (this.ptr instanceof Reflect.Message.Field) { // Resolve type\r
+\r
+            if (!Lang.TYPE.test(this.ptr.type)) {\r
+                if (!Lang.TYPEREF.test(this.ptr.type))\r
+                    throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                res = (this.ptr instanceof Reflect.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, true);\r
+                if (!res)\r
+                    throw Error("unresolvable type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+                this.ptr.resolvedType = res;\r
+                if (res instanceof Reflect.Enum) {\r
+                    this.ptr.type = ProtoBuf.TYPES["enum"];\r
+                    if (this.ptr.syntax === 'proto3' && res.syntax !== 'proto3')\r
+                        throw Error("proto3 message cannot reference proto2 enum");\r
+                }\r
+                else if (res instanceof Reflect.Message)\r
+                    this.ptr.type = res.isGroup ? ProtoBuf.TYPES["group"] : ProtoBuf.TYPES["message"];\r
+                else\r
+                    throw Error("illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.type);\r
+            } else\r
+                this.ptr.type = ProtoBuf.TYPES[this.ptr.type];\r
+\r
+            // If it's a map field, also resolve the key type. The key type can be only a numeric, string, or bool type\r
+            // (i.e., no enums or messages), so we don't need to resolve against the current namespace.\r
+            if (this.ptr.map) {\r
+                if (!Lang.TYPE.test(this.ptr.keyType))\r
+                    throw Error("illegal key type for map field in "+this.ptr.toString(true)+": "+this.ptr.keyType);\r
+                this.ptr.keyType = ProtoBuf.TYPES[this.ptr.keyType];\r
+            }\r
+\r
+            // If it's a repeated and packable field then proto3 mandates it should be packed by\r
+            // default\r
+            if (\r
+              this.ptr.syntax === 'proto3' &&\r
+              this.ptr.repeated && this.ptr.options.packed === undefined &&\r
+              ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType) !== -1\r
+            ) {\r
+              this.ptr.options.packed = true;\r
+            }\r
+\r
+        } else if (this.ptr instanceof ProtoBuf.Reflect.Service.Method) {\r
+\r
+            if (this.ptr instanceof ProtoBuf.Reflect.Service.RPCMethod) {\r
+                res = this.ptr.parent.resolve(this.ptr.requestName, true);\r
+                if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                    throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.requestName);\r
+                this.ptr.resolvedRequestType = res;\r
+                res = this.ptr.parent.resolve(this.ptr.responseName, true);\r
+                if (!res || !(res instanceof ProtoBuf.Reflect.Message))\r
+                    throw Error("Illegal type reference in "+this.ptr.toString(true)+": "+this.ptr.responseName);\r
+                this.ptr.resolvedResponseType = res;\r
+            } else // Should not happen as nothing else is implemented\r
+                throw Error("illegal service type in "+this.ptr.toString(true));\r
+\r
+        } else if (\r
+            !(this.ptr instanceof ProtoBuf.Reflect.Message.OneOf) && // Not built\r
+            !(this.ptr instanceof ProtoBuf.Reflect.Extension) && // Not built\r
+            !(this.ptr instanceof ProtoBuf.Reflect.Enum.Value) // Built in enum\r
+        )\r
+            throw Error("illegal object in namespace: "+typeof(this.ptr)+": "+this.ptr);\r
+\r
+        return this.reset();\r
+    };\r
+\r
+    /**\r
+     * Builds the protocol. This will first try to resolve all definitions and, if this has been successful,\r
+     * return the built package.\r
+     * @param {(string|Array.<string>)=} path Specifies what to return. If omitted, the entire namespace will be returned.\r
+     * @returns {!ProtoBuf.Builder.Message|!Object.<string,*>}\r
+     * @throws {Error} If a type could not be resolved\r
+     * @expose\r
+     */\r
+    BuilderPrototype.build = function(path) {\r
+        this.reset();\r
+        if (!this.resolved)\r
+            this.resolveAll(),\r
+            this.resolved = true,\r
+            this.result = null; // Require re-build\r
+        if (this.result === null) // (Re-)Build\r
+            this.result = this.ns.build();\r
+        if (!path)\r
+            return this.result;\r
+        var part = typeof path === 'string' ? path.split(".") : path,\r
+            ptr = this.result; // Build namespace pointer (no hasChild etc.)\r
+        for (var i=0; i<part.length; i++)\r
+            if (ptr[part[i]])\r
+                ptr = ptr[part[i]];\r
+            else {\r
+                ptr = null;\r
+                break;\r
+            }\r
+        return ptr;\r
+    };\r
+\r
+    /**\r
+     * Similar to {@link ProtoBuf.Builder#build}, but looks up the internal reflection descriptor.\r
+     * @param {string=} path Specifies what to return. If omitted, the entire namespace wiil be returned.\r
+     * @param {boolean=} excludeNonNamespace Excludes non-namespace types like fields, defaults to `false`\r
+     * @returns {?ProtoBuf.Reflect.T} Reflection descriptor or `null` if not found\r
+     */\r
+    BuilderPrototype.lookup = function(path, excludeNonNamespace) {\r
+        return path ? this.ns.resolve(path, excludeNonNamespace) : this.ns;\r
+    };\r
+\r
+    /**\r
+     * Returns a string representation of this object.\r
+     * @return {string} String representation as of "Builder"\r
+     * @expose\r
+     */\r
+    BuilderPrototype.toString = function() {\r
+        return "Builder";\r
+    };\r
+\r
+    // ----- Base classes -----\r
+    // Exist for the sole purpose of being able to "... instanceof ProtoBuf.Builder.Message" etc.\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.Message\r
+     */\r
+    Builder.Message = function() {};\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.Enum\r
+     */\r
+    Builder.Enum = function() {};\r
+\r
+    /**\r
+     * @alias ProtoBuf.Builder.Message\r
+     */\r
+    Builder.Service = function() {};\r
+\r
+    return Builder;\r
+\r
+})(ProtoBuf, ProtoBuf.Lang, ProtoBuf.Reflect);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Enum.js
new file mode 100644 (file)
index 0000000..f1e6ca9
--- /dev/null
@@ -0,0 +1,22 @@
+// This file is not included currently and exists for documentation purposes only.\r
+\r
+/*?\r
+ // --- Scope ------------------\r
+ // T : Reflect.Enum instance\r
+ */\r
+\r
+/**\r
+ * Constructs a new runtime Enum.\r
+ * @name ProtoBuf.Builder.Enum\r
+ * @class Barebone of all runtime enums.\r
+ * @constructor\r
+ */\r
+var Enum = function() {\r
+    ProtoBuf.Builder.Enum.call(this);\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Builder.Enum.prototype\r
+ * @inner\r
+ */\r
+var EnumPrototype = Enum.prototype = Object.create(ProtoBuf.Builder.Enum.prototype);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Message.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Message.js
new file mode 100644 (file)
index 0000000..fe95141
--- /dev/null
@@ -0,0 +1,721 @@
+/*?\r
+ // --- Scope ------------------\r
+ // T : Reflect.Message instance\r
+ */\r
+var fields = T.getChildren(ProtoBuf.Reflect.Message.Field),\r
+    oneofs = T.getChildren(ProtoBuf.Reflect.Message.OneOf);\r
+\r
+/**\r
+ * Constructs a new runtime Message.\r
+ * @name ProtoBuf.Builder.Message\r
+ * @class Barebone of all runtime messages.\r
+ * @param {!Object.<string,*>|string} values Preset values\r
+ * @param {...string} var_args\r
+ * @constructor\r
+ * @throws {Error} If the message cannot be created\r
+ */\r
+var Message = function(values, var_args) {\r
+    ProtoBuf.Builder.Message.call(this);\r
+\r
+    // Create virtual oneof properties\r
+    for (var i=0, k=oneofs.length; i<k; ++i)\r
+        this[oneofs[i].name] = null;\r
+    // Create fields and set default values\r
+    for (i=0, k=fields.length; i<k; ++i) {\r
+        var field = fields[i];\r
+        this[field.name] =\r
+            field.repeated ? [] :\r
+            (field.map ? new ProtoBuf.Map(field) : null);\r
+        if ((field.required || T.syntax === 'proto3') &&\r
+            field.defaultValue !== null)\r
+            this[field.name] = field.defaultValue;\r
+    }\r
+\r
+    if (arguments.length > 0) {\r
+        var value;\r
+        // Set field values from a values object\r
+        if (arguments.length === 1 && values !== null && typeof values === 'object' &&\r
+            /* not _another_ Message */ (typeof values.encode !== 'function' || values instanceof Message) &&\r
+            /* not a repeated field */ !Array.isArray(values) &&\r
+            /* not a Map */ !(values instanceof ProtoBuf.Map) &&\r
+            /* not a ByteBuffer */ !ByteBuffer.isByteBuffer(values) &&\r
+            /* not an ArrayBuffer */ !(values instanceof ArrayBuffer) &&\r
+            /* not a Long */ !(ProtoBuf.Long && values instanceof ProtoBuf.Long)) {\r
+            this.$set(values);\r
+        } else // Set field values from arguments, in declaration order\r
+            for (i=0, k=arguments.length; i<k; ++i)\r
+                if (typeof (value = arguments[i]) !== 'undefined')\r
+                    this.$set(fields[i].name, value); // May throw\r
+    }\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Builder.Message.prototype\r
+ * @inner\r
+ */\r
+var MessagePrototype = Message.prototype = Object.create(ProtoBuf.Builder.Message.prototype);\r
+\r
+/**\r
+ * Adds a value to a repeated field.\r
+ * @name ProtoBuf.Builder.Message#add\r
+ * @function\r
+ * @param {string} key Field name\r
+ * @param {*} value Value to add\r
+ * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+ * @returns {!ProtoBuf.Builder.Message} this\r
+ * @throws {Error} If the value cannot be added\r
+ * @expose\r
+ */\r
+MessagePrototype.add = function(key, value, noAssert) {\r
+    var field = T._fieldsByName[key];\r
+    if (!noAssert) {\r
+        if (!field)\r
+            throw Error(this+"#"+key+" is undefined");\r
+        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+            throw Error(this+"#"+key+" is not a field: "+field.toString(true)); // May throw if it's an enum or embedded message\r
+        if (!field.repeated)\r
+            throw Error(this+"#"+key+" is not a repeated field");\r
+        value = field.verifyValue(value, true);\r
+    }\r
+    if (this[key] === null)\r
+        this[key] = [];\r
+    this[key].push(value);\r
+    return this;\r
+};\r
+\r
+/**\r
+ * Adds a value to a repeated field. This is an alias for {@link ProtoBuf.Builder.Message#add}.\r
+ * @name ProtoBuf.Builder.Message#$add\r
+ * @function\r
+ * @param {string} key Field name\r
+ * @param {*} value Value to add\r
+ * @param {boolean=} noAssert Whether to assert the value or not (asserts by default)\r
+ * @returns {!ProtoBuf.Builder.Message} this\r
+ * @throws {Error} If the value cannot be added\r
+ * @expose\r
+ */\r
+MessagePrototype.$add = MessagePrototype.add;\r
+\r
+/**\r
+ * Sets a field's value.\r
+ * @name ProtoBuf.Builder.Message#set\r
+ * @function\r
+ * @param {string|!Object.<string,*>} keyOrObj String key or plain object holding multiple values\r
+ * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+ * @param {boolean=} noAssert Whether to not assert for an actual field / proper value type, defaults to `false`\r
+ * @returns {!ProtoBuf.Builder.Message} this\r
+ * @throws {Error} If the value cannot be set\r
+ * @expose\r
+ */\r
+MessagePrototype.set = function(keyOrObj, value, noAssert) {\r
+    if (keyOrObj && typeof keyOrObj === 'object') {\r
+        noAssert = value;\r
+        for (var ikey in keyOrObj) {\r
+            // Check if virtual oneof field - don't set these\r
+            if (keyOrObj.hasOwnProperty(ikey) && typeof (value = keyOrObj[ikey]) !== 'undefined' && T._oneofsByName[ikey] === undefined)\r
+                this.$set(ikey, value, noAssert);\r
+        }\r
+        return this;\r
+    }\r
+    var field = T._fieldsByName[keyOrObj];\r
+    if (!noAssert) {\r
+        if (!field)\r
+            throw Error(this+"#"+keyOrObj+" is not a field: undefined");\r
+        if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+            throw Error(this+"#"+keyOrObj+" is not a field: "+field.toString(true));\r
+        this[field.name] = (value = field.verifyValue(value)); // May throw\r
+    } else\r
+        this[keyOrObj] = value;\r
+    if (field && field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+        var currentField = this[field.oneof.name]; // Virtual field references currently set field\r
+        if (value !== null) {\r
+            if (currentField !== null && currentField !== field.name)\r
+                this[currentField] = null; // Clear currently set field\r
+            this[field.oneof.name] = field.name; // Point virtual field at this field\r
+        } else if (/* value === null && */currentField === keyOrObj)\r
+            this[field.oneof.name] = null; // Clear virtual field (current field explicitly cleared)\r
+    }\r
+    return this;\r
+};\r
+\r
+/**\r
+ * Sets a field's value. This is an alias for [@link ProtoBuf.Builder.Message#set}.\r
+ * @name ProtoBuf.Builder.Message#$set\r
+ * @function\r
+ * @param {string|!Object.<string,*>} keyOrObj String key or plain object holding multiple values\r
+ * @param {(*|boolean)=} value Value to set if key is a string, otherwise omitted\r
+ * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+ * @throws {Error} If the value cannot be set\r
+ * @expose\r
+ */\r
+MessagePrototype.$set = MessagePrototype.set;\r
+\r
+/**\r
+ * Gets a field's value.\r
+ * @name ProtoBuf.Builder.Message#get\r
+ * @function\r
+ * @param {string} key Key\r
+ * @param {boolean=} noAssert Whether to not assert for an actual field, defaults to `false`\r
+ * @return {*} Value\r
+ * @throws {Error} If there is no such field\r
+ * @expose\r
+ */\r
+MessagePrototype.get = function(key, noAssert) {\r
+    if (noAssert)\r
+        return this[key];\r
+    var field = T._fieldsByName[key];\r
+    if (!field || !(field instanceof ProtoBuf.Reflect.Message.Field))\r
+        throw Error(this+"#"+key+" is not a field: undefined");\r
+    if (!(field instanceof ProtoBuf.Reflect.Message.Field))\r
+        throw Error(this+"#"+key+" is not a field: "+field.toString(true));\r
+    return this[field.name];\r
+};\r
+\r
+/**\r
+ * Gets a field's value. This is an alias for {@link ProtoBuf.Builder.Message#$get}.\r
+ * @name ProtoBuf.Builder.Message#$get\r
+ * @function\r
+ * @param {string} key Key\r
+ * @return {*} Value\r
+ * @throws {Error} If there is no such field\r
+ * @expose\r
+ */\r
+MessagePrototype.$get = MessagePrototype.get;\r
+\r
+// Getters and setters\r
+\r
+for (var i=0; i<fields.length; i++) {\r
+    var field = fields[i];\r
+    // no setters for extension fields as these are named by their fqn\r
+    if (field instanceof ProtoBuf.Reflect.Message.ExtensionField)\r
+        continue;\r
+\r
+    if (T.builder.options['populateAccessors'])\r
+        (function(field) {\r
+            // set/get[SomeValue]\r
+            var Name = field.originalName.replace(/(_[a-zA-Z])/g, function(match) {\r
+                return match.toUpperCase().replace('_','');\r
+            });\r
+            Name = Name.substring(0,1).toUpperCase() + Name.substring(1);\r
+\r
+            // set/get_[some_value] FIXME: Do we really need these?\r
+            var name = field.originalName.replace(/([A-Z])/g, function(match) {\r
+                return "_"+match;\r
+            });\r
+\r
+            /**\r
+             * The current field's unbound setter function.\r
+             * @function\r
+             * @param {*} value\r
+             * @param {boolean=} noAssert\r
+             * @returns {!ProtoBuf.Builder.Message}\r
+             * @inner\r
+             */\r
+            var setter = function(value, noAssert) {\r
+                this[field.name] = noAssert ? value : field.verifyValue(value);\r
+                return this;\r
+            };\r
+\r
+            /**\r
+             * The current field's unbound getter function.\r
+             * @function\r
+             * @returns {*}\r
+             * @inner\r
+             */\r
+            var getter = function() {\r
+                return this[field.name];\r
+            };\r
+\r
+            if (T.getChild("set"+Name) === null)\r
+                /**\r
+                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#set[SomeField]\r
+                 * @function\r
+                 * @param {*} value Value to set\r
+                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @abstract\r
+                 * @throws {Error} If the value cannot be set\r
+                 */\r
+                MessagePrototype["set"+Name] = setter;\r
+\r
+            if (T.getChild("set_"+name) === null)\r
+                /**\r
+                 * Sets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#set_[some_field]\r
+                 * @function\r
+                 * @param {*} value Value to set\r
+                 * @param {boolean=} noAssert Whether to not assert the value, defaults to `false`\r
+                 * @returns {!ProtoBuf.Builder.Message} this\r
+                 * @abstract\r
+                 * @throws {Error} If the value cannot be set\r
+                 */\r
+                MessagePrototype["set_"+name] = setter;\r
+\r
+            if (T.getChild("get"+Name) === null)\r
+                /**\r
+                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#get[SomeField]\r
+                 * @function\r
+                 * @abstract\r
+                 * @return {*} The value\r
+                 */\r
+                MessagePrototype["get"+Name] = getter;\r
+\r
+            if (T.getChild("get_"+name) === null)\r
+                /**\r
+                 * Gets a value. This method is present for each field, but only if there is no name conflict with\r
+                 *  another field.\r
+                 * @name ProtoBuf.Builder.Message#get_[some_field]\r
+                 * @function\r
+                 * @return {*} The value\r
+                 * @abstract\r
+                 */\r
+                MessagePrototype["get_"+name] = getter;\r
+\r
+        })(field);\r
+}\r
+\r
+// En-/decoding\r
+\r
+/**\r
+ * Encodes the message.\r
+ * @name ProtoBuf.Builder.Message#$encode\r
+ * @function\r
+ * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ * @see ProtoBuf.Builder.Message#encode64\r
+ * @see ProtoBuf.Builder.Message#encodeHex\r
+ * @see ProtoBuf.Builder.Message#encodeAB\r
+ */\r
+MessagePrototype.encode = function(buffer, noVerify) {\r
+    if (typeof buffer === 'boolean')\r
+        noVerify = buffer,\r
+        buffer = undefined;\r
+    var isNew = false;\r
+    if (!buffer)\r
+        buffer = new ByteBuffer(),\r
+        isNew = true;\r
+    var le = buffer.littleEndian;\r
+    try {\r
+        T.encode(this, buffer.LE(), noVerify);\r
+        return (isNew ? buffer.flip() : buffer).LE(le);\r
+    } catch (e) {\r
+        buffer.LE(le);\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Encodes a message using the specified data payload.\r
+ * @param {!Object.<string,*>} data Data payload\r
+ * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+ * @expose\r
+ */\r
+Message.encode = function(data, buffer, noVerify) {\r
+    return new Message(data).encode(buffer, noVerify);\r
+};\r
+\r
+/**\r
+ * Calculates the byte length of the message.\r
+ * @name ProtoBuf.Builder.Message#calculate\r
+ * @function\r
+ * @returns {number} Byte length\r
+ * @throws {Error} If the message cannot be calculated or if required fields are missing.\r
+ * @expose\r
+ */\r
+MessagePrototype.calculate = function() {\r
+    return T.calculate(this);\r
+};\r
+\r
+/**\r
+ * Encodes the varint32 length-delimited message.\r
+ * @name ProtoBuf.Builder.Message#encodeDelimited\r
+ * @function\r
+ * @param {(!ByteBuffer|boolean)=} buffer ByteBuffer to encode to. Will create a new one and flip it if omitted.\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {!ByteBuffer} Encoded message as a ByteBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ByteBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeDelimited = function(buffer, noVerify) {\r
+    var isNew = false;\r
+    if (!buffer)\r
+        buffer = new ByteBuffer(),\r
+        isNew = true;\r
+    var enc = new ByteBuffer().LE();\r
+    T.encode(this, enc, noVerify).flip();\r
+    buffer.writeVarint32(enc.remaining());\r
+    buffer.append(enc);\r
+    return isNew ? buffer.flip() : buffer;\r
+};\r
+\r
+/**\r
+ * Directly encodes the message to an ArrayBuffer.\r
+ * @name ProtoBuf.Builder.Message#encodeAB\r
+ * @function\r
+ * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeAB = function() {\r
+    try {\r
+        return this.encode().toArrayBuffer();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toArrayBuffer();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as an ArrayBuffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeAB}.\r
+ * @name ProtoBuf.Builder.Message#toArrayBuffer\r
+ * @function\r
+ * @return {ArrayBuffer} Encoded message as ArrayBuffer\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded ArrayBuffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toArrayBuffer = MessagePrototype.encodeAB;\r
+\r
+/**\r
+ * Directly encodes the message to a node Buffer.\r
+ * @name ProtoBuf.Builder.Message#encodeNB\r
+ * @function\r
+ * @return {!Buffer}\r
+ * @throws {Error} If the message cannot be encoded, not running under node.js or if required fields are\r
+ *  missing. The later still returns the encoded node Buffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeNB = function() {\r
+    try {\r
+        return this.encode().toBuffer();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toBuffer();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as a node Buffer. This is an alias for {@link ProtoBuf.Builder.Message#encodeNB}.\r
+ * @name ProtoBuf.Builder.Message#toBuffer\r
+ * @function\r
+ * @return {!Buffer}\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded node Buffer in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toBuffer = MessagePrototype.encodeNB;\r
+\r
+/**\r
+ * Directly encodes the message to a base64 encoded string.\r
+ * @name ProtoBuf.Builder.Message#encode64\r
+ * @function\r
+ * @return {string} Base64 encoded string\r
+ * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+ *  still returns the encoded base64 string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encode64 = function() {\r
+    try {\r
+        return this.encode().toBase64();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toBase64();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as a base64 encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encode64}.\r
+ * @name ProtoBuf.Builder.Message#toBase64\r
+ * @function\r
+ * @return {string} Base64 encoded string\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded base64 string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toBase64 = MessagePrototype.encode64;\r
+\r
+/**\r
+ * Directly encodes the message to a hex encoded string.\r
+ * @name ProtoBuf.Builder.Message#encodeHex\r
+ * @function\r
+ * @return {string} Hex encoded string\r
+ * @throws {Error} If the underlying buffer cannot be encoded or if required fields are missing. The later\r
+ *  still returns the encoded hex string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeHex = function() {\r
+    try {\r
+        return this.encode().toHex();\r
+    } catch (e) {\r
+        if (e["encoded"]) e["encoded"] = e["encoded"].toHex();\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Returns the message as a hex encoded string. This is an alias for {@link ProtoBuf.Builder.Message#encodeHex}.\r
+ * @name ProtoBuf.Builder.Message#toHex\r
+ * @function\r
+ * @return {string} Hex encoded string\r
+ * @throws {Error} If the message cannot be encoded or if required fields are missing. The later still\r
+ *  returns the encoded hex string in the `encoded` property on the error.\r
+ * @expose\r
+ */\r
+MessagePrototype.toHex = MessagePrototype.encodeHex;\r
+\r
+/**\r
+ * Clones a message object or field value to a raw object.\r
+ * @param {*} obj Object to clone\r
+ * @param {boolean} binaryAsBase64 Whether to include binary data as base64 strings or as a buffer otherwise\r
+ * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+ * @param {!ProtoBuf.Reflect.T=} resolvedType The resolved field type if a field\r
+ * @returns {*} Cloned object\r
+ * @inner\r
+ */\r
+function cloneRaw(obj, binaryAsBase64, longsAsStrings, resolvedType) {\r
+    if (obj === null || typeof obj !== 'object') {\r
+        // Convert enum values to their respective names\r
+        if (resolvedType && resolvedType instanceof ProtoBuf.Reflect.Enum) {\r
+            var name = ProtoBuf.Reflect.Enum.getName(resolvedType.object, obj);\r
+            if (name !== null)\r
+                return name;\r
+        }\r
+        // Pass-through string, number, boolean, null...\r
+        return obj;\r
+    }\r
+    // Convert ByteBuffers to raw buffer or strings\r
+    if (ByteBuffer.isByteBuffer(obj))\r
+        return binaryAsBase64 ? obj.toBase64() : obj.toBuffer();\r
+    // Convert Longs to proper objects or strings\r
+    if (ProtoBuf.Long.isLong(obj))\r
+        return longsAsStrings ? obj.toString() : ProtoBuf.Long.fromValue(obj);\r
+    var clone;\r
+    // Clone arrays\r
+    if (Array.isArray(obj)) {\r
+        clone = [];\r
+        obj.forEach(function(v, k) {\r
+            clone[k] = cloneRaw(v, binaryAsBase64, longsAsStrings, resolvedType);\r
+        });\r
+        return clone;\r
+    }\r
+    clone = {};\r
+    // Convert maps to objects\r
+    if (obj instanceof ProtoBuf.Map) {\r
+        var it = obj.entries();\r
+        for (var e = it.next(); !e.done; e = it.next())\r
+            clone[obj.keyElem.valueToString(e.value[0])] = cloneRaw(e.value[1], binaryAsBase64, longsAsStrings, obj.valueElem.resolvedType);\r
+        return clone;\r
+    }\r
+    // Everything else is a non-null object\r
+    var type = obj.$type,\r
+        field = undefined;\r
+    for (var i in obj)\r
+        if (obj.hasOwnProperty(i)) {\r
+            if (type && (field = type.getChild(i)))\r
+                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings, field.resolvedType);\r
+            else\r
+                clone[i] = cloneRaw(obj[i], binaryAsBase64, longsAsStrings);\r
+        }\r
+    return clone;\r
+}\r
+\r
+/**\r
+ * Returns the message's raw payload.\r
+ * @param {boolean=} binaryAsBase64 Whether to include binary data as base64 strings instead of Buffers, defaults to `false`\r
+ * @param {boolean} longsAsStrings Whether to encode longs as strings\r
+ * @returns {Object.<string,*>} Raw payload\r
+ * @expose\r
+ */\r
+MessagePrototype.toRaw = function(binaryAsBase64, longsAsStrings) {\r
+    return cloneRaw(this, !!binaryAsBase64, !!longsAsStrings, this.$type);\r
+};\r
+\r
+/**\r
+ * Encodes a message to JSON.\r
+ * @returns {string} JSON string\r
+ * @expose\r
+ */\r
+MessagePrototype.encodeJSON = function() {\r
+    return JSON.stringify(\r
+        cloneRaw(this,\r
+             /* binary-as-base64 */ true,\r
+             /* longs-as-strings */ true,\r
+             this.$type\r
+        )\r
+    );\r
+};\r
+\r
+/**\r
+ * Decodes a message from the specified buffer or string.\r
+ * @name ProtoBuf.Builder.Message.decode\r
+ * @function\r
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+ * @param {(number|string)=} length Message length. Defaults to decode all the remainig data.\r
+ * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ * @see ProtoBuf.Builder.Message.decode64\r
+ * @see ProtoBuf.Builder.Message.decodeHex\r
+ */\r
+Message.decode = function(buffer, length, enc) {\r
+    if (typeof length === 'string')\r
+        enc = length,\r
+        length = -1;\r
+    if (typeof buffer === 'string')\r
+        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+    else if (!ByteBuffer.isByteBuffer(buffer))\r
+        buffer = ByteBuffer.wrap(buffer); // May throw\r
+    var le = buffer.littleEndian;\r
+    try {\r
+        var msg = T.decode(buffer.LE(), length);\r
+        buffer.LE(le);\r
+        return msg;\r
+    } catch (e) {\r
+        buffer.LE(le);\r
+        throw(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Decodes a varint32 length-delimited message from the specified buffer or string.\r
+ * @name ProtoBuf.Builder.Message.decodeDelimited\r
+ * @function\r
+ * @param {!ByteBuffer|!ArrayBuffer|!Buffer|string} buffer Buffer to decode from\r
+ * @param {string=} enc Encoding if buffer is a string: hex, utf8 (not recommended), defaults to base64\r
+ * @return {ProtoBuf.Builder.Message} Decoded message or `null` if not enough bytes are available yet\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ */\r
+Message.decodeDelimited = function(buffer, enc) {\r
+    if (typeof buffer === 'string')\r
+        buffer = ByteBuffer.wrap(buffer, enc ? enc : "base64");\r
+    else if (!ByteBuffer.isByteBuffer(buffer))\r
+        buffer = ByteBuffer.wrap(buffer); // May throw\r
+    if (buffer.remaining() < 1)\r
+        return null;\r
+    var off = buffer.offset,\r
+        len = buffer.readVarint32();\r
+    if (buffer.remaining() < len) {\r
+        buffer.offset = off;\r
+        return null;\r
+    }\r
+    try {\r
+        var msg = T.decode(buffer.slice(buffer.offset, buffer.offset + len).LE());\r
+        buffer.offset += len;\r
+        return msg;\r
+    } catch (err) {\r
+        buffer.offset += len;\r
+        throw err;\r
+    }\r
+};\r
+\r
+/**\r
+ * Decodes the message from the specified base64 encoded string.\r
+ * @name ProtoBuf.Builder.Message.decode64\r
+ * @function\r
+ * @param {string} str String to decode from\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ */\r
+Message.decode64 = function(str) {\r
+    return Message.decode(str, "base64");\r
+};\r
+\r
+/**\r
+ * Decodes the message from the specified hex encoded string.\r
+ * @name ProtoBuf.Builder.Message.decodeHex\r
+ * @function\r
+ * @param {string} str String to decode from\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are missing. The later still\r
+ *  returns the decoded message with missing fields in the `decoded` property on the error.\r
+ * @expose\r
+ */\r
+Message.decodeHex = function(str) {\r
+    return Message.decode(str, "hex");\r
+};\r
+\r
+/**\r
+ * Decodes the message from a JSON string.\r
+ * @name ProtoBuf.Builder.Message.decodeJSON\r
+ * @function\r
+ * @param {string} str String to decode from\r
+ * @return {!ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded or if required fields are\r
+ * missing.\r
+ * @expose\r
+ */\r
+Message.decodeJSON = function(str) {\r
+    return new Message(JSON.parse(str));\r
+};\r
+\r
+// Utility\r
+\r
+/**\r
+ * Returns a string representation of this Message.\r
+ * @name ProtoBuf.Builder.Message#toString\r
+ * @function\r
+ * @return {string} String representation as of ".Fully.Qualified.MessageName"\r
+ * @expose\r
+ */\r
+MessagePrototype.toString = function() {\r
+    return T.toString();\r
+};\r
+\r
+// Properties\r
+\r
+/**\r
+ * Message options.\r
+ * @name ProtoBuf.Builder.Message.$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $optionsS; // cc needs this\r
+\r
+/**\r
+ * Message options.\r
+ * @name ProtoBuf.Builder.Message#$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $options;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Message.$type\r
+ * @type {!ProtoBuf.Reflect.Message}\r
+ * @expose\r
+ */\r
+var $typeS;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Message#$type\r
+ * @type {!ProtoBuf.Reflect.Message}\r
+ * @expose\r
+ */\r
+var $type;\r
+\r
+if (Object.defineProperty)\r
+    Object.defineProperty(Message, '$options', { "value": T.buildOpt() }),\r
+    Object.defineProperty(MessagePrototype, "$options", { "value": Message["$options"] }),\r
+    Object.defineProperty(Message, "$type", { "value": T }),\r
+    Object.defineProperty(MessagePrototype, "$type", { "value": T });\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Service.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Builder/Service.js
new file mode 100644 (file)
index 0000000..43de942
--- /dev/null
@@ -0,0 +1,144 @@
+/*?\r
+ // --- Scope ------------------\r
+ // T : Reflect.Service instance\r
+ */\r
+/**\r
+ * Constructs a new runtime Service.\r
+ * @name ProtoBuf.Builder.Service\r
+ * @param {function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))=} rpcImpl RPC implementation receiving the method name and the message\r
+ * @class Barebone of all runtime services.\r
+ * @constructor\r
+ * @throws {Error} If the service cannot be created\r
+ */\r
+var Service = function(rpcImpl) {\r
+    ProtoBuf.Builder.Service.call(this);\r
+\r
+    /**\r
+     * Service implementation.\r
+     * @name ProtoBuf.Builder.Service#rpcImpl\r
+     * @type {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))}\r
+     * @expose\r
+     */\r
+    this.rpcImpl = rpcImpl || function(name, msg, callback) {\r
+        // This is what a user has to implement: A function receiving the method name, the actual message to\r
+        // send (type checked) and the callback that's either provided with the error as its first\r
+        // argument or null and the actual response message.\r
+        setTimeout(callback.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0); // Must be async!\r
+    };\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Builder.Service.prototype\r
+ * @inner\r
+ */\r
+var ServicePrototype = Service.prototype = Object.create(ProtoBuf.Builder.Service.prototype);\r
+\r
+/**\r
+ * Asynchronously performs an RPC call using the given RPC implementation.\r
+ * @name ProtoBuf.Builder.Service.[Method]\r
+ * @function\r
+ * @param {!function(string, ProtoBuf.Builder.Message, function(Error, ProtoBuf.Builder.Message=))} rpcImpl RPC implementation\r
+ * @param {ProtoBuf.Builder.Message} req Request\r
+ * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+ *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+ * @abstract\r
+ */\r
+\r
+/**\r
+ * Asynchronously performs an RPC call using the instance's RPC implementation.\r
+ * @name ProtoBuf.Builder.Service#[Method]\r
+ * @function\r
+ * @param {ProtoBuf.Builder.Message} req Request\r
+ * @param {function(Error, (ProtoBuf.Builder.Message|ByteBuffer|Buffer|string)=)} callback Callback receiving\r
+ *  the error if any and the response either as a pre-parsed message or as its raw bytes\r
+ * @abstract\r
+ */\r
+\r
+var rpc = T.getChildren(ProtoBuf.Reflect.Service.RPCMethod);\r
+for (var i=0; i<rpc.length; i++) {\r
+    (function(method) {\r
+\r
+        // service#Method(message, callback)\r
+        ServicePrototype[method.name] = function(req, callback) {\r
+            try {\r
+                try {\r
+                    // If given as a buffer, decode the request. Will throw a TypeError if not a valid buffer.\r
+                    req = method.resolvedRequestType.clazz.decode(ByteBuffer.wrap(req));\r
+                } catch (err) {\r
+                    if (!(err instanceof TypeError))\r
+                        throw err;\r
+                }\r
+                if (req === null || typeof req !== 'object')\r
+                    throw Error("Illegal arguments");\r
+                if (!(req instanceof method.resolvedRequestType.clazz))\r
+                    req = new method.resolvedRequestType.clazz(req);\r
+                this.rpcImpl(method.fqn(), req, function(err, res) { // Assumes that this is properly async\r
+                    if (err) {\r
+                        callback(err);\r
+                        return;\r
+                    }\r
+                    // Coalesce to empty string when service response has empty content\r
+                    if (res === null)\r
+                        res = ''\r
+                    try { res = method.resolvedResponseType.clazz.decode(res); } catch (notABuffer) {}\r
+                    if (!res || !(res instanceof method.resolvedResponseType.clazz)) {\r
+                        callback(Error("Illegal response type received in service method "+ T.name+"#"+method.name));\r
+                        return;\r
+                    }\r
+                    callback(null, res);\r
+                });\r
+            } catch (err) {\r
+                setTimeout(callback.bind(this, err), 0);\r
+            }\r
+        };\r
+\r
+        // Service.Method(rpcImpl, message, callback)\r
+        Service[method.name] = function(rpcImpl, req, callback) {\r
+            new Service(rpcImpl)[method.name](req, callback);\r
+        };\r
+\r
+        if (Object.defineProperty)\r
+            Object.defineProperty(Service[method.name], "$options", { "value": method.buildOpt() }),\r
+            Object.defineProperty(ServicePrototype[method.name], "$options", { "value": Service[method.name]["$options"] });\r
+    })(rpc[i]);\r
+}\r
+\r
+// Properties\r
+\r
+/**\r
+ * Service options.\r
+ * @name ProtoBuf.Builder.Service.$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $optionsS; // cc needs this\r
+\r
+/**\r
+ * Service options.\r
+ * @name ProtoBuf.Builder.Service#$options\r
+ * @type {Object.<string,*>}\r
+ * @expose\r
+ */\r
+var $options;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Service.$type\r
+ * @type {!ProtoBuf.Reflect.Service}\r
+ * @expose\r
+ */\r
+var $typeS;\r
+\r
+/**\r
+ * Reflection type.\r
+ * @name ProtoBuf.Builder.Service#$type\r
+ * @type {!ProtoBuf.Reflect.Service}\r
+ * @expose\r
+ */\r
+var $type;\r
+\r
+if (Object.defineProperty)\r
+    Object.defineProperty(Service, "$options", { "value": T.buildOpt() }),\r
+    Object.defineProperty(ServicePrototype, "$options", { "value": Service["$options"] }),\r
+    Object.defineProperty(Service, "$type", { "value": T }),\r
+    Object.defineProperty(ServicePrototype, "$type", { "value": T });\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto.js
new file mode 100644 (file)
index 0000000..f3cea78
--- /dev/null
@@ -0,0 +1,33 @@
+/**\r
+ * @alias ProtoBuf.DotProto\r
+ * @expose\r
+ */\r
+ProtoBuf.DotProto = (function(ProtoBuf, Lang) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Utilities to parse .proto files.\r
+     * @exports ProtoBuf.DotProto\r
+     * @namespace\r
+     */\r
+    var DotProto = {};\r
+    \r
+    //? include("DotProto/Tokenizer.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.DotProto.Tokenizer\r
+     * @expose\r
+     */\r
+    DotProto.Tokenizer = Tokenizer;\r
+    \r
+    //? include("DotProto/Parser.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.DotProto.Parser\r
+     * @expose\r
+     */\r
+    DotProto.Parser = Parser;\r
+    \r
+    return DotProto;\r
+    \r
+})(ProtoBuf, ProtoBuf.Lang);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto/Parser.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto/Parser.js
new file mode 100644 (file)
index 0000000..36595ee
--- /dev/null
@@ -0,0 +1,700 @@
+/*?\r
+ // --- Scope ----------------------\r
+ // Lang      : Language expressions\r
+ // Tokenizer : DotProto Tokenizer\r
+ */\r
+/**\r
+ * Constructs a new Parser.\r
+ * @exports ProtoBuf.DotProto.Parser\r
+ * @class prototype parser\r
+ * @param {string} source Source\r
+ * @constructor\r
+ */\r
+var Parser = function(source) {\r
+\r
+    /**\r
+     * Tokenizer.\r
+     * @type {!ProtoBuf.DotProto.Tokenizer}\r
+     * @expose\r
+     */\r
+    this.tn = new Tokenizer(source);\r
+\r
+    /**\r
+     * Whether parsing proto3 or not.\r
+     * @type {boolean}\r
+     */\r
+    this.proto3 = false;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.DotProto.Parser.prototype\r
+ * @inner\r
+ */\r
+var ParserPrototype = Parser.prototype;\r
+\r
+/**\r
+ * Parses the source.\r
+ * @returns {!Object}\r
+ * @throws {Error} If the source cannot be parsed\r
+ * @expose\r
+ */\r
+ParserPrototype.parse = function() {\r
+    var topLevel = {\r
+        "name": "[ROOT]", // temporary\r
+        "package": null,\r
+        "messages": [],\r
+        "enums": [],\r
+        "imports": [],\r
+        "options": {},\r
+        "services": []\r
+        // "syntax": undefined\r
+    };\r
+    var token,\r
+        head = true,\r
+        weak;\r
+    try {\r
+        while (token = this.tn.next()) {\r
+            switch (token) {\r
+                case 'package':\r
+                    if (!head || topLevel["package"] !== null)\r
+                        throw Error("unexpected 'package'");\r
+                    token = this.tn.next();\r
+                    if (!Lang.TYPEREF.test(token))\r
+                        throw Error("illegal package name: " + token);\r
+                    this.tn.skip(";");\r
+                    topLevel["package"] = token;\r
+                    break;\r
+                case 'import':\r
+                    if (!head)\r
+                        throw Error("unexpected 'import'");\r
+                    token = this.tn.peek();\r
+                    if (token === "public" || (weak = token === "weak")) // token ignored\r
+                        this.tn.next();\r
+                    token = this._readString();\r
+                    this.tn.skip(";");\r
+                    if (!weak) // import ignored\r
+                        topLevel["imports"].push(token);\r
+                    break;\r
+                case 'syntax':\r
+                    if (!head)\r
+                        throw Error("unexpected 'syntax'");\r
+                    this.tn.skip("=");\r
+                    if ((topLevel["syntax"] = this._readString()) === "proto3")\r
+                        this.proto3 = true;\r
+                    this.tn.skip(";");\r
+                    break;\r
+                case 'message':\r
+                    this._parseMessage(topLevel, null);\r
+                    head = false;\r
+                    break;\r
+                case 'enum':\r
+                    this._parseEnum(topLevel);\r
+                    head = false;\r
+                    break;\r
+                case 'option':\r
+                    this._parseOption(topLevel);\r
+                    break;\r
+                case 'service':\r
+                    this._parseService(topLevel);\r
+                    break;\r
+                case 'extend':\r
+                    this._parseExtend(topLevel);\r
+                    break;\r
+                default:\r
+                    throw Error("unexpected '" + token + "'");\r
+            }\r
+        }\r
+    } catch (e) {\r
+        e.message = "Parse error at line "+this.tn.line+": " + e.message;\r
+        throw e;\r
+    }\r
+    delete topLevel["name"];\r
+    return topLevel;\r
+};\r
+\r
+/**\r
+ * Parses the specified source.\r
+ * @returns {!Object}\r
+ * @throws {Error} If the source cannot be parsed\r
+ * @expose\r
+ */\r
+Parser.parse = function(source) {\r
+    return new Parser(source).parse();\r
+};\r
+\r
+// ----- Conversion ------\r
+\r
+/**\r
+ * Converts a numerical string to an id.\r
+ * @param {string} value\r
+ * @param {boolean=} mayBeNegative\r
+ * @returns {number}\r
+ * @inner\r
+ */\r
+function mkId(value, mayBeNegative) {\r
+    var id = -1,\r
+        sign = 1;\r
+    if (value.charAt(0) == '-') {\r
+        sign = -1;\r
+        value = value.substring(1);\r
+    }\r
+    if (Lang.NUMBER_DEC.test(value))\r
+        id = parseInt(value);\r
+    else if (Lang.NUMBER_HEX.test(value))\r
+        id = parseInt(value.substring(2), 16);\r
+    else if (Lang.NUMBER_OCT.test(value))\r
+        id = parseInt(value.substring(1), 8);\r
+    else\r
+        throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value);\r
+    id = (sign*id)|0; // Force to 32bit\r
+    if (!mayBeNegative && id < 0)\r
+        throw Error("illegal id value: " + (sign < 0 ? '-' : '') + value);\r
+    return id;\r
+}\r
+\r
+/**\r
+ * Converts a numerical string to a number.\r
+ * @param {string} val\r
+ * @returns {number}\r
+ * @inner\r
+ */\r
+function mkNumber(val) {\r
+    var sign = 1;\r
+    if (val.charAt(0) == '-') {\r
+        sign = -1;\r
+        val = val.substring(1);\r
+    }\r
+    if (Lang.NUMBER_DEC.test(val))\r
+        return sign * parseInt(val, 10);\r
+    else if (Lang.NUMBER_HEX.test(val))\r
+        return sign * parseInt(val.substring(2), 16);\r
+    else if (Lang.NUMBER_OCT.test(val))\r
+        return sign * parseInt(val.substring(1), 8);\r
+    else if (val === 'inf')\r
+        return sign * Infinity;\r
+    else if (val === 'nan')\r
+        return NaN;\r
+    else if (Lang.NUMBER_FLT.test(val))\r
+        return sign * parseFloat(val);\r
+    throw Error("illegal number value: " + (sign < 0 ? '-' : '') + val);\r
+}\r
+\r
+// ----- Reading ------\r
+\r
+/**\r
+ * Reads a string.\r
+ * @returns {string}\r
+ * @private\r
+ */\r
+ParserPrototype._readString = function() {\r
+    var value = "",\r
+        token,\r
+        delim;\r
+    do {\r
+        delim = this.tn.next();\r
+        if (delim !== "'" && delim !== '"')\r
+            throw Error("illegal string delimiter: "+delim);\r
+        value += this.tn.next();\r
+        this.tn.skip(delim);\r
+        token = this.tn.peek();\r
+    } while (token === '"' || token === '"'); // multi line?\r
+    return value;\r
+};\r
+\r
+/**\r
+ * Reads a value.\r
+ * @param {boolean=} mayBeTypeRef\r
+ * @returns {number|boolean|string}\r
+ * @private\r
+ */\r
+ParserPrototype._readValue = function(mayBeTypeRef) {\r
+    var token = this.tn.peek(),\r
+        value;\r
+    if (token === '"' || token === "'")\r
+        return this._readString();\r
+    this.tn.next();\r
+    if (Lang.NUMBER.test(token))\r
+        return mkNumber(token);\r
+    if (Lang.BOOL.test(token))\r
+        return (token.toLowerCase() === 'true');\r
+    if (mayBeTypeRef && Lang.TYPEREF.test(token))\r
+        return token;\r
+    throw Error("illegal value: "+token);\r
+\r
+};\r
+\r
+// ----- Parsing constructs -----\r
+\r
+/**\r
+ * Parses a namespace option.\r
+ * @param {!Object} parent Parent definition\r
+ * @param {boolean=} isList\r
+ * @private\r
+ */\r
+ParserPrototype._parseOption = function(parent, isList) {\r
+    var token = this.tn.next(),\r
+        custom = false;\r
+    if (token === '(') {\r
+        custom = true;\r
+        token = this.tn.next();\r
+    }\r
+    if (!Lang.TYPEREF.test(token))\r
+        // we can allow options of the form google.protobuf.* since they will just get ignored anyways\r
+        // if (!/google\.protobuf\./.test(token)) // FIXME: Why should that not be a valid typeref?\r
+            throw Error("illegal option name: "+token);\r
+    var name = token;\r
+    if (custom) { // (my_method_option).foo, (my_method_option), some_method_option, (foo.my_option).bar\r
+        this.tn.skip(')');\r
+        name = '('+name+')';\r
+        token = this.tn.peek();\r
+        if (Lang.FQTYPEREF.test(token)) {\r
+            name += token;\r
+            this.tn.next();\r
+        }\r
+    }\r
+    this.tn.skip('=');\r
+    this._parseOptionValue(parent, name);\r
+    if (!isList)\r
+        this.tn.skip(";");\r
+};\r
+\r
+/**\r
+ * Sets an option on the specified options object.\r
+ * @param {!Object.<string,*>} options\r
+ * @param {string} name\r
+ * @param {string|number|boolean} value\r
+ * @inner\r
+ */\r
+function setOption(options, name, value) {\r
+    if (typeof options[name] === 'undefined')\r
+        options[name] = value;\r
+    else {\r
+        if (!Array.isArray(options[name]))\r
+            options[name] = [ options[name] ];\r
+        options[name].push(value);\r
+    }\r
+}\r
+\r
+/**\r
+ * Parses an option value.\r
+ * @param {!Object} parent\r
+ * @param {string} name\r
+ * @private\r
+ */\r
+ParserPrototype._parseOptionValue = function(parent, name) {\r
+    var token = this.tn.peek();\r
+    if (token !== '{') { // Plain value\r
+        setOption(parent["options"], name, this._readValue(true));\r
+    } else { // Aggregate options\r
+        this.tn.skip("{");\r
+        while ((token = this.tn.next()) !== '}') {\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal option name: " + name + "." + token);\r
+            if (this.tn.omit(":"))\r
+                setOption(parent["options"], name + "." + token, this._readValue(true));\r
+            else\r
+                this._parseOptionValue(parent, name + "." + token);\r
+        }\r
+    }\r
+};\r
+\r
+/**\r
+ * Parses a service definition.\r
+ * @param {!Object} parent Parent definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseService = function(parent) {\r
+    var token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal service name at line "+this.tn.line+": "+token);\r
+    var name = token;\r
+    var svc = {\r
+        "name": name,\r
+        "rpc": {},\r
+        "options": {}\r
+    };\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (token === "option")\r
+            this._parseOption(svc);\r
+        else if (token === 'rpc')\r
+            this._parseServiceRPC(svc);\r
+        else\r
+            throw Error("illegal service token: "+token);\r
+    }\r
+    this.tn.omit(";");\r
+    parent["services"].push(svc);\r
+};\r
+\r
+/**\r
+ * Parses a RPC service definition of the form ['rpc', name, (request), 'returns', (response)].\r
+ * @param {!Object} svc Service definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseServiceRPC = function(svc) {\r
+    var type = "rpc",\r
+        token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal rpc service method name: "+token);\r
+    var name = token;\r
+    var method = {\r
+        "request": null,\r
+        "response": null,\r
+        "request_stream": false,\r
+        "response_stream": false,\r
+        "options": {}\r
+    };\r
+    this.tn.skip("(");\r
+    token = this.tn.next();\r
+    if (token.toLowerCase() === "stream") {\r
+      method["request_stream"] = true;\r
+      token = this.tn.next();\r
+    }\r
+    if (!Lang.TYPEREF.test(token))\r
+        throw Error("illegal rpc service request type: "+token);\r
+    method["request"] = token;\r
+    this.tn.skip(")");\r
+    token = this.tn.next();\r
+    if (token.toLowerCase() !== "returns")\r
+        throw Error("illegal rpc service request type delimiter: "+token);\r
+    this.tn.skip("(");\r
+    token = this.tn.next();\r
+    if (token.toLowerCase() === "stream") {\r
+      method["response_stream"] = true;\r
+      token = this.tn.next();\r
+    }\r
+    method["response"] = token;\r
+    this.tn.skip(")");\r
+    token = this.tn.peek();\r
+    if (token === '{') {\r
+        this.tn.next();\r
+        while ((token = this.tn.next()) !== '}') {\r
+            if (token === 'option')\r
+                this._parseOption(method);\r
+            else\r
+                throw Error("illegal rpc service token: " + token);\r
+        }\r
+        this.tn.omit(";");\r
+    } else\r
+        this.tn.skip(";");\r
+    if (typeof svc[type] === 'undefined')\r
+        svc[type] = {};\r
+    svc[type][name] = method;\r
+};\r
+\r
+/**\r
+ * Parses a message definition.\r
+ * @param {!Object} parent Parent definition\r
+ * @param {!Object=} fld Field definition if this is a group\r
+ * @returns {!Object}\r
+ * @private\r
+ */\r
+ParserPrototype._parseMessage = function(parent, fld) {\r
+    var isGroup = !!fld,\r
+        token = this.tn.next();\r
+    var msg = {\r
+        "name": "",\r
+        "fields": [],\r
+        "enums": [],\r
+        "messages": [],\r
+        "options": {},\r
+        "services": [],\r
+        "oneofs": {}\r
+        // "extensions": undefined\r
+    };\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal "+(isGroup ? "group" : "message")+" name: "+token);\r
+    msg["name"] = token;\r
+    if (isGroup) {\r
+        this.tn.skip("=");\r
+        fld["id"] = mkId(this.tn.next());\r
+        msg["isGroup"] = true;\r
+    }\r
+    token = this.tn.peek();\r
+    if (token === '[' && fld)\r
+        this._parseFieldOptions(fld);\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (Lang.RULE.test(token))\r
+            this._parseMessageField(msg, token);\r
+        else if (token === "oneof")\r
+            this._parseMessageOneOf(msg);\r
+        else if (token === "enum")\r
+            this._parseEnum(msg);\r
+        else if (token === "message")\r
+            this._parseMessage(msg);\r
+        else if (token === "option")\r
+            this._parseOption(msg);\r
+        else if (token === "service")\r
+            this._parseService(msg);\r
+        else if (token === "extensions")\r
+            if (msg.hasOwnProperty("extensions")) {\r
+                msg["extensions"] = msg["extensions"].concat(this._parseExtensionRanges())\r
+            } else {\r
+                msg["extensions"] = this._parseExtensionRanges();\r
+            }\r
+        else if (token === "reserved")\r
+            this._parseIgnored(); // TODO\r
+        else if (token === "extend")\r
+            this._parseExtend(msg);\r
+        else if (Lang.TYPEREF.test(token)) {\r
+            if (!this.proto3)\r
+                throw Error("illegal field rule: "+token);\r
+            this._parseMessageField(msg, "optional", token);\r
+        } else\r
+            throw Error("illegal message token: "+token);\r
+    }\r
+    this.tn.omit(";");\r
+    parent["messages"].push(msg);\r
+    return msg;\r
+};\r
+\r
+/**\r
+ * Parses an ignored statement.\r
+ * @private\r
+ */\r
+ParserPrototype._parseIgnored = function() {\r
+    while (this.tn.peek() !== ';')\r
+        this.tn.next();\r
+    this.tn.skip(";");\r
+};\r
+\r
+/**\r
+ * Parses a message field.\r
+ * @param {!Object} msg Message definition\r
+ * @param {string} rule Field rule\r
+ * @param {string=} type Field type if already known (never known for maps)\r
+ * @returns {!Object} Field descriptor\r
+ * @private\r
+ */\r
+ParserPrototype._parseMessageField = function(msg, rule, type) {\r
+    if (!Lang.RULE.test(rule))\r
+        throw Error("illegal message field rule: "+rule);\r
+    var fld = {\r
+        "rule": rule,\r
+        "type": "",\r
+        "name": "",\r
+        "options": {},\r
+        "id": 0\r
+    };\r
+    var token;\r
+    if (rule === "map") {\r
+\r
+        if (type)\r
+            throw Error("illegal type: " + type);\r
+        this.tn.skip('<');\r
+        token = this.tn.next();\r
+        if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token))\r
+            throw Error("illegal message field type: " + token);\r
+        fld["keytype"] = token;\r
+        this.tn.skip(',');\r
+        token = this.tn.next();\r
+        if (!Lang.TYPE.test(token) && !Lang.TYPEREF.test(token))\r
+            throw Error("illegal message field: " + token);\r
+        fld["type"] = token;\r
+        this.tn.skip('>');\r
+        token = this.tn.next();\r
+        if (!Lang.NAME.test(token))\r
+            throw Error("illegal message field name: " + token);\r
+        fld["name"] = token;\r
+        this.tn.skip("=");\r
+        fld["id"] = mkId(this.tn.next());\r
+        token = this.tn.peek();\r
+        if (token === '[')\r
+            this._parseFieldOptions(fld);\r
+        this.tn.skip(";");\r
+\r
+    } else {\r
+\r
+        type = typeof type !== 'undefined' ? type : this.tn.next();\r
+\r
+        if (type === "group") {\r
+\r
+            // "A [legacy] group simply combines a nested message type and a field into a single declaration. In your\r
+            // code, you can treat this message just as if it had a Result type field called result (the latter name is\r
+            // converted to lower-case so that it does not conflict with the former)."\r
+            var grp = this._parseMessage(msg, fld);\r
+            if (!/^[A-Z]/.test(grp["name"]))\r
+                throw Error('illegal group name: '+grp["name"]);\r
+            fld["type"] = grp["name"];\r
+            fld["name"] = grp["name"].toLowerCase();\r
+            this.tn.omit(";");\r
+\r
+        } else {\r
+\r
+            if (!Lang.TYPE.test(type) && !Lang.TYPEREF.test(type))\r
+                throw Error("illegal message field type: " + type);\r
+            fld["type"] = type;\r
+            token = this.tn.next();\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal message field name: " + token);\r
+            fld["name"] = token;\r
+            this.tn.skip("=");\r
+            fld["id"] = mkId(this.tn.next());\r
+            token = this.tn.peek();\r
+            if (token === "[")\r
+                this._parseFieldOptions(fld);\r
+            this.tn.skip(";");\r
+\r
+        }\r
+    }\r
+    msg["fields"].push(fld);\r
+    return fld;\r
+};\r
+\r
+/**\r
+ * Parses a message oneof.\r
+ * @param {!Object} msg Message definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseMessageOneOf = function(msg) {\r
+    var token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal oneof name: "+token);\r
+    var name = token,\r
+        fld;\r
+    var fields = [];\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== "}") {\r
+        fld = this._parseMessageField(msg, "optional", token);\r
+        fld["oneof"] = name;\r
+        fields.push(fld["id"]);\r
+    }\r
+    this.tn.omit(";");\r
+    msg["oneofs"][name] = fields;\r
+};\r
+\r
+/**\r
+ * Parses a set of field option definitions.\r
+ * @param {!Object} fld Field definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseFieldOptions = function(fld) {\r
+    this.tn.skip("[");\r
+    var token,\r
+        first = true;\r
+    while ((token = this.tn.peek()) !== ']') {\r
+        if (!first)\r
+            this.tn.skip(",");\r
+        this._parseOption(fld, true);\r
+        first = false;\r
+    }\r
+    this.tn.next();\r
+};\r
+\r
+/**\r
+ * Parses an enum.\r
+ * @param {!Object} msg Message definition\r
+ * @private\r
+ */\r
+ParserPrototype._parseEnum = function(msg) {\r
+    var enm = {\r
+        "name": "",\r
+        "values": [],\r
+        "options": {}\r
+    };\r
+    var token = this.tn.next();\r
+    if (!Lang.NAME.test(token))\r
+        throw Error("illegal name: "+token);\r
+    enm["name"] = token;\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (token === "option")\r
+            this._parseOption(enm);\r
+        else {\r
+            if (!Lang.NAME.test(token))\r
+                throw Error("illegal name: "+token);\r
+            this.tn.skip("=");\r
+            var val = {\r
+                "name": token,\r
+                "id": mkId(this.tn.next(), true)\r
+            };\r
+            token = this.tn.peek();\r
+            if (token === "[")\r
+                this._parseFieldOptions({ "options": {} });\r
+            this.tn.skip(";");\r
+            enm["values"].push(val);\r
+        }\r
+    }\r
+    this.tn.omit(";");\r
+    msg["enums"].push(enm);\r
+};\r
+\r
+/**\r
+ * Parses extension / reserved ranges.\r
+ * @returns {!Array.<!Array.<number>>}\r
+ * @private\r
+ */\r
+ParserPrototype._parseExtensionRanges = function() {\r
+    var ranges = [];\r
+    var token,\r
+        range,\r
+        value;\r
+    do {\r
+        range = [];\r
+        while (true) {\r
+            token = this.tn.next();\r
+            switch (token) {\r
+                case "min":\r
+                    value = ProtoBuf.ID_MIN;\r
+                    break;\r
+                case "max":\r
+                    value = ProtoBuf.ID_MAX;\r
+                    break;\r
+                default:\r
+                    value = mkNumber(token);\r
+                    break;\r
+            }\r
+            range.push(value);\r
+            if (range.length === 2)\r
+                break;\r
+            if (this.tn.peek() !== "to") {\r
+                range.push(value);\r
+                break;\r
+            }\r
+            this.tn.next();\r
+        }\r
+        ranges.push(range);\r
+    } while (this.tn.omit(","));\r
+    this.tn.skip(";");\r
+    return ranges;\r
+};\r
+\r
+/**\r
+ * Parses an extend block.\r
+ * @param {!Object} parent Parent object\r
+ * @private\r
+ */\r
+ParserPrototype._parseExtend = function(parent) {\r
+    var token = this.tn.next();\r
+    if (!Lang.TYPEREF.test(token))\r
+        throw Error("illegal extend reference: "+token);\r
+    var ext = {\r
+        "ref": token,\r
+        "fields": []\r
+    };\r
+    this.tn.skip("{");\r
+    while ((token = this.tn.next()) !== '}') {\r
+        if (Lang.RULE.test(token))\r
+            this._parseMessageField(ext, token);\r
+        else if (Lang.TYPEREF.test(token)) {\r
+            if (!this.proto3)\r
+                throw Error("illegal field rule: "+token);\r
+            this._parseMessageField(ext, "optional", token);\r
+        } else\r
+            throw Error("illegal extend token: "+token);\r
+    }\r
+    this.tn.omit(";");\r
+    parent["messages"].push(ext);\r
+    return ext;\r
+};\r
+\r
+// ----- General -----\r
+\r
+/**\r
+ * Returns a string representation of this parser.\r
+ * @returns {string}\r
+ */\r
+ParserPrototype.toString = function() {\r
+    return "Parser at line "+this.tn.line;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto/Tokenizer.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/DotProto/Tokenizer.js
new file mode 100644 (file)
index 0000000..10c1a1d
--- /dev/null
@@ -0,0 +1,190 @@
+/*?\r
+ // --- Scope -----------------\r
+ // Lang : Language expressions\r
+*/\r
+/**\r
+ * Constructs a new Tokenizer.\r
+ * @exports ProtoBuf.DotProto.Tokenizer\r
+ * @class prototype tokenizer\r
+ * @param {string} proto Proto to tokenize\r
+ * @constructor\r
+ */\r
+var Tokenizer = function(proto) {\r
+\r
+    /**\r
+     * Source to parse.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.source = proto+"";\r
+\r
+    /**\r
+     * Current index.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.index = 0;\r
+\r
+    /**\r
+     * Current line.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.line = 1;\r
+\r
+    /**\r
+     * Token stack.\r
+     * @type {!Array.<string>}\r
+     * @expose\r
+     */\r
+    this.stack = [];\r
+\r
+    /**\r
+     * Opening character of the current string read, if any.\r
+     * @type {?string}\r
+     * @private\r
+     */\r
+    this._stringOpen = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.DotProto.Tokenizer.prototype\r
+ * @inner\r
+ */\r
+var TokenizerPrototype = Tokenizer.prototype;\r
+\r
+/**\r
+ * Reads a string beginning at the current index.\r
+ * @return {string}\r
+ * @private\r
+ */\r
+TokenizerPrototype._readString = function() {\r
+    var re = this._stringOpen === '"'\r
+        ? Lang.STRING_DQ\r
+        : Lang.STRING_SQ;\r
+    re.lastIndex = this.index - 1; // Include the open quote\r
+    var match = re.exec(this.source);\r
+    if (!match)\r
+        throw Error("unterminated string");\r
+    this.index = re.lastIndex;\r
+    this.stack.push(this._stringOpen);\r
+    this._stringOpen = null;\r
+    return match[1];\r
+};\r
+\r
+/**\r
+ * Gets the next token and advances by one.\r
+ * @return {?string} Token or `null` on EOF\r
+ * @expose\r
+ */\r
+TokenizerPrototype.next = function() {\r
+    if (this.stack.length > 0)\r
+        return this.stack.shift();\r
+    if (this.index >= this.source.length)\r
+        return null;\r
+    if (this._stringOpen !== null)\r
+        return this._readString();\r
+\r
+    var repeat,\r
+        prev,\r
+        next;\r
+    do {\r
+        repeat = false;\r
+\r
+        // Strip white spaces\r
+        while (Lang.WHITESPACE.test(next = this.source.charAt(this.index))) {\r
+            if (next === '\n')\r
+                ++this.line;\r
+            if (++this.index === this.source.length)\r
+                return null;\r
+        }\r
+\r
+        // Strip comments\r
+        if (this.source.charAt(this.index) === '/') {\r
+            ++this.index;\r
+            if (this.source.charAt(this.index) === '/') { // Line\r
+                while (this.source.charAt(++this.index) !== '\n')\r
+                    if (this.index == this.source.length)\r
+                        return null;\r
+                ++this.index;\r
+                ++this.line;\r
+                repeat = true;\r
+            } else if ((next = this.source.charAt(this.index)) === '*') { /* Block */\r
+                do {\r
+                    if (next === '\n')\r
+                        ++this.line;\r
+                    if (++this.index === this.source.length)\r
+                        return null;\r
+                    prev = next;\r
+                    next = this.source.charAt(this.index);\r
+                } while (prev !== '*' || next !== '/');\r
+                ++this.index;\r
+                repeat = true;\r
+            } else\r
+                return '/';\r
+        }\r
+    } while (repeat);\r
+\r
+    if (this.index === this.source.length)\r
+        return null;\r
+\r
+    // Read the next token\r
+    var end = this.index;\r
+    Lang.DELIM.lastIndex = 0;\r
+    var delim = Lang.DELIM.test(this.source.charAt(end++));\r
+    if (!delim)\r
+        while(end < this.source.length && !Lang.DELIM.test(this.source.charAt(end)))\r
+            ++end;\r
+    var token = this.source.substring(this.index, this.index = end);\r
+    if (token === '"' || token === "'")\r
+        this._stringOpen = token;\r
+    return token;\r
+};\r
+\r
+/**\r
+ * Peeks for the next token.\r
+ * @return {?string} Token or `null` on EOF\r
+ * @expose\r
+ */\r
+TokenizerPrototype.peek = function() {\r
+    if (this.stack.length === 0) {\r
+        var token = this.next();\r
+        if (token === null)\r
+            return null;\r
+        this.stack.push(token);\r
+    }\r
+    return this.stack[0];\r
+};\r
+\r
+/**\r
+ * Skips a specific token and throws if it differs.\r
+ * @param {string} expected Expected token\r
+ * @throws {Error} If the actual token differs\r
+ */\r
+TokenizerPrototype.skip = function(expected) {\r
+    var actual = this.next();\r
+    if (actual !== expected)\r
+        throw Error("illegal '"+actual+"', '"+expected+"' expected");\r
+};\r
+\r
+/**\r
+ * Omits an optional token.\r
+ * @param {string} expected Expected optional token\r
+ * @returns {boolean} `true` if the token exists\r
+ */\r
+TokenizerPrototype.omit = function(expected) {\r
+    if (this.peek() === expected) {\r
+        this.next();\r
+        return true;\r
+    }\r
+    return false;\r
+};\r
+\r
+/**\r
+ * Returns a string representation of this object.\r
+ * @return {string} String representation as of "Tokenizer(index/length)"\r
+ * @expose\r
+ */\r
+TokenizerPrototype.toString = function() {\r
+    return "Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")";\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Lang.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Lang.js
new file mode 100644 (file)
index 0000000..a0fb768
--- /dev/null
@@ -0,0 +1,64 @@
+/**\r
+ * Language expressions.\r
+ * @type {!Object.<string,!RegExp>}\r
+ * @expose\r
+ */\r
+ProtoBuf.Lang = {\r
+\r
+    // Characters always ending a statement\r
+    DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,\r
+\r
+    // Field rules\r
+    RULE: /^(?:required|optional|repeated|map)$/,\r
+\r
+    // Field types\r
+    TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,\r
+\r
+    // Names\r
+    NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,\r
+\r
+    // Type definitions\r
+    TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,\r
+\r
+    // Type references\r
+    TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,\r
+\r
+    // Fully qualified type references\r
+    FQTYPEREF: /^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,\r
+\r
+    // All numbers\r
+    NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,\r
+\r
+    // Decimal numbers\r
+    NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,\r
+\r
+    // Hexadecimal numbers\r
+    NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,\r
+\r
+    // Octal numbers\r
+    NUMBER_OCT: /^0[0-7]+$/,\r
+\r
+    // Floating point numbers\r
+    NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,\r
+\r
+    // Booleans\r
+    BOOL: /^(?:true|false)$/i,\r
+\r
+    // Id numbers\r
+    ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+    // Negative id numbers (enum values)\r
+    NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,\r
+\r
+    // Whitespaces\r
+    WHITESPACE: /\s/,\r
+\r
+    // All strings\r
+    STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,\r
+\r
+    // Double quoted strings\r
+    STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,\r
+\r
+    // Single quoted strings\r
+    STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Map.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Map.js
new file mode 100644 (file)
index 0000000..ca2e88a
--- /dev/null
@@ -0,0 +1,197 @@
+/**\r
+ * @alias ProtoBuf.Map\r
+ * @expose\r
+ */\r
+ProtoBuf.Map = (function(ProtoBuf, Reflect) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Constructs a new Map. A Map is a container that is used to implement map\r
+     * fields on message objects. It closely follows the ES6 Map API; however,\r
+     * it is distinct because we do not want to depend on external polyfills or\r
+     * on ES6 itself.\r
+     *\r
+     * @exports ProtoBuf.Map\r
+     * @param {!ProtoBuf.Reflect.Field} field Map field\r
+     * @param {Object.<string,*>=} contents Initial contents\r
+     * @constructor\r
+     */\r
+    var Map = function(field, contents) {\r
+        if (!field.map)\r
+            throw Error("field is not a map");\r
+\r
+        /**\r
+         * The field corresponding to this map.\r
+         * @type {!ProtoBuf.Reflect.Field}\r
+         */\r
+        this.field = field;\r
+\r
+        /**\r
+         * Element instance corresponding to key type.\r
+         * @type {!ProtoBuf.Reflect.Element}\r
+         */\r
+        this.keyElem = new Reflect.Element(field.keyType, null, true, field.syntax);\r
+\r
+        /**\r
+         * Element instance corresponding to value type.\r
+         * @type {!ProtoBuf.Reflect.Element}\r
+         */\r
+        this.valueElem = new Reflect.Element(field.type, field.resolvedType, false, field.syntax);\r
+\r
+        /**\r
+         * Internal map: stores mapping of (string form of key) -> (key, value)\r
+         * pair.\r
+         *\r
+         * We provide map semantics for arbitrary key types, but we build on top\r
+         * of an Object, which has only string keys. In order to avoid the need\r
+         * to convert a string key back to its native type in many situations,\r
+         * we store the native key value alongside the value. Thus, we only need\r
+         * a one-way mapping from a key type to its string form that guarantees\r
+         * uniqueness and equality (i.e., str(K1) === str(K2) if and only if K1\r
+         * === K2).\r
+         *\r
+         * @type {!Object<string, {key: *, value: *}>}\r
+         */\r
+        this.map = {};\r
+\r
+        /**\r
+         * Returns the number of elements in the map.\r
+         */\r
+        Object.defineProperty(this, "size", {\r
+            get: function() { return Object.keys(this.map).length; }\r
+        });\r
+\r
+        // Fill initial contents from a raw object.\r
+        if (contents) {\r
+            var keys = Object.keys(contents);\r
+            for (var i = 0; i < keys.length; i++) {\r
+                var key = this.keyElem.valueFromString(keys[i]);\r
+                var val = this.valueElem.verifyValue(contents[keys[i]]);\r
+                this.map[this.keyElem.valueToString(key)] =\r
+                    { key: key, value: val };\r
+            }\r
+        }\r
+    };\r
+\r
+    var MapPrototype = Map.prototype;\r
+\r
+    /**\r
+     * Helper: return an iterator over an array.\r
+     * @param {!Array<*>} arr the array\r
+     * @returns {!Object} an iterator\r
+     * @inner\r
+     */\r
+    function arrayIterator(arr) {\r
+        var idx = 0;\r
+        return {\r
+            next: function() {\r
+                if (idx < arr.length)\r
+                    return { done: false, value: arr[idx++] };\r
+                return { done: true };\r
+            }\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Clears the map.\r
+     */\r
+    MapPrototype.clear = function() {\r
+        this.map = {};\r
+    };\r
+\r
+    /**\r
+     * Deletes a particular key from the map.\r
+     * @returns {boolean} Whether any entry with this key was deleted.\r
+     */\r
+    MapPrototype["delete"] = function(key) {\r
+        var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+        var hadKey = keyValue in this.map;\r
+        delete this.map[keyValue];\r
+        return hadKey;\r
+    };\r
+\r
+    /**\r
+     * Returns an iterator over [key, value] pairs in the map.\r
+     * @returns {Object} The iterator\r
+     */\r
+    MapPrototype.entries = function() {\r
+        var entries = [];\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0, entry; i < strKeys.length; i++)\r
+            entries.push([(entry=this.map[strKeys[i]]).key, entry.value]);\r
+        return arrayIterator(entries);\r
+    };\r
+\r
+    /**\r
+     * Returns an iterator over keys in the map.\r
+     * @returns {Object} The iterator\r
+     */\r
+    MapPrototype.keys = function() {\r
+        var keys = [];\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0; i < strKeys.length; i++)\r
+            keys.push(this.map[strKeys[i]].key);\r
+        return arrayIterator(keys);\r
+    };\r
+\r
+    /**\r
+     * Returns an iterator over values in the map.\r
+     * @returns {!Object} The iterator\r
+     */\r
+    MapPrototype.values = function() {\r
+        var values = [];\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0; i < strKeys.length; i++)\r
+            values.push(this.map[strKeys[i]].value);\r
+        return arrayIterator(values);\r
+    };\r
+\r
+    /**\r
+     * Iterates over entries in the map, calling a function on each.\r
+     * @param {function(this:*, *, *, *)} cb The callback to invoke with value, key, and map arguments.\r
+     * @param {Object=} thisArg The `this` value for the callback\r
+     */\r
+    MapPrototype.forEach = function(cb, thisArg) {\r
+        var strKeys = Object.keys(this.map);\r
+        for (var i = 0, entry; i < strKeys.length; i++)\r
+            cb.call(thisArg, (entry=this.map[strKeys[i]]).value, entry.key, this);\r
+    };\r
+\r
+    /**\r
+     * Sets a key in the map to the given value.\r
+     * @param {*} key The key\r
+     * @param {*} value The value\r
+     * @returns {!ProtoBuf.Map} The map instance\r
+     */\r
+    MapPrototype.set = function(key, value) {\r
+        var keyValue = this.keyElem.verifyValue(key);\r
+        var valValue = this.valueElem.verifyValue(value);\r
+        this.map[this.keyElem.valueToString(keyValue)] =\r
+            { key: keyValue, value: valValue };\r
+        return this;\r
+    };\r
+\r
+    /**\r
+     * Gets the value corresponding to a key in the map.\r
+     * @param {*} key The key\r
+     * @returns {*|undefined} The value, or `undefined` if key not present\r
+     */\r
+    MapPrototype.get = function(key) {\r
+        var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+        if (!(keyValue in this.map))\r
+            return undefined;\r
+        return this.map[keyValue].value;\r
+    };\r
+\r
+    /**\r
+     * Determines whether the given key is present in the map.\r
+     * @param {*} key The key\r
+     * @returns {boolean} `true` if the key is present\r
+     */\r
+    MapPrototype.has = function(key) {\r
+        var keyValue = this.keyElem.valueToString(this.keyElem.verifyValue(key));\r
+        return (keyValue in this.map);\r
+    };\r
+\r
+    return Map;\r
+})(ProtoBuf, ProtoBuf.Reflect);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect.js
new file mode 100644 (file)
index 0000000..8172bb9
--- /dev/null
@@ -0,0 +1,121 @@
+/**\r
+ * @alias ProtoBuf.Reflect\r
+ * @expose\r
+ */\r
+ProtoBuf.Reflect = (function(ProtoBuf) {\r
+    "use strict";\r
+\r
+    /**\r
+     * Reflection types.\r
+     * @exports ProtoBuf.Reflect\r
+     * @namespace\r
+     */\r
+    var Reflect = {};\r
+    \r
+    //? include("Reflect/T.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.T\r
+     * @expose\r
+     */\r
+    Reflect.T = T;\r
+\r
+    //? include("Reflect/Namespace.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Namespace\r
+     * @expose\r
+     */\r
+    Reflect.Namespace = Namespace;\r
+\r
+    //? include("Reflect/Element.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Element\r
+     * @expose\r
+     */\r
+    Reflect.Element = Element;\r
+    \r
+    //? include("Reflect/Message.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message\r
+     * @expose\r
+     */\r
+    Reflect.Message = Message;\r
+    \r
+    //? include("Reflect/Message/Field.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message.Field\r
+     * @expose\r
+     */\r
+    Reflect.Message.Field = Field;\r
+\r
+    //? include("Reflect/Message/ExtensionField.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message.ExtensionField\r
+     * @expose\r
+     */\r
+    Reflect.Message.ExtensionField = ExtensionField;\r
+\r
+    //? include("Reflect/Message/OneOf.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Message.OneOf\r
+     * @expose\r
+     */\r
+    Reflect.Message.OneOf = OneOf;\r
+\r
+    //? include("Reflect/Enum.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Enum\r
+     * @expose\r
+     */\r
+    Reflect.Enum = Enum;\r
+    \r
+    //? include("Reflect/Enum/Value.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Enum.Value\r
+     * @expose\r
+     */\r
+    Reflect.Enum.Value = Value;\r
+\r
+    //? include("Reflect/Extension.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Extension\r
+     * @expose\r
+     */\r
+    Reflect.Extension = Extension;\r
+\r
+    //? include("Reflect/Service.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Service\r
+     * @expose\r
+     */\r
+    Reflect.Service = Service;\r
+\r
+    //? include("Reflect/Service/Method.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Service.Method\r
+     * @expose\r
+     */\r
+    Reflect.Service.Method = Method;\r
+    \r
+    //? include("Reflect/Service/RPCMethod.js");\r
+\r
+    /**\r
+     * @alias ProtoBuf.Reflect.Service.RPCMethod\r
+     * @expose\r
+     */\r
+    Reflect.Service.RPCMethod = RPCMethod;\r
+\r
+    return Reflect;\r
+\r
+})(ProtoBuf);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Element.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Element.js
new file mode 100644 (file)
index 0000000..0e7b8ee
--- /dev/null
@@ -0,0 +1,580 @@
+/**\r
+ * Constructs a new Element implementation that checks and converts values for a\r
+ * particular field type, as appropriate.\r
+ *\r
+ * An Element represents a single value: either the value of a singular field,\r
+ * or a value contained in one entry of a repeated field or map field. This\r
+ * class does not implement these higher-level concepts; it only encapsulates\r
+ * the low-level typechecking and conversion.\r
+ *\r
+ * @exports ProtoBuf.Reflect.Element\r
+ * @param {{name: string, wireType: number}} type Resolved data type\r
+ * @param {ProtoBuf.Reflect.T|null} resolvedType Resolved type, if relevant\r
+ * (e.g. submessage field).\r
+ * @param {boolean} isMapKey Is this element a Map key? The value will be\r
+ * converted to string form if so.\r
+ * @param {string} syntax Syntax level of defining message type, e.g.,\r
+ * proto2 or proto3.\r
+ * @param {string} name Name of the field containing this element (for error\r
+ * messages)\r
+ * @constructor\r
+ */\r
+var Element = function(type, resolvedType, isMapKey, syntax, name) {\r
+\r
+    /**\r
+     * Element type, as a string (e.g., int32).\r
+     * @type {{name: string, wireType: number}}\r
+     */\r
+    this.type = type;\r
+\r
+    /**\r
+     * Element type reference to submessage or enum definition, if needed.\r
+     * @type {ProtoBuf.Reflect.T|null}\r
+     */\r
+    this.resolvedType = resolvedType;\r
+\r
+    /**\r
+     * Element is a map key.\r
+     * @type {boolean}\r
+     */\r
+    this.isMapKey = isMapKey;\r
+\r
+    /**\r
+     * Syntax level of defining message type, e.g., proto2 or proto3.\r
+     * @type {string}\r
+     */\r
+    this.syntax = syntax;\r
+\r
+    /**\r
+     * Name of the field containing this element (for error messages)\r
+     * @type {string}\r
+     */\r
+    this.name = name;\r
+\r
+    if (isMapKey && ProtoBuf.MAP_KEY_TYPES.indexOf(type) < 0)\r
+        throw Error("Invalid map key type: " + type.name);\r
+};\r
+\r
+var ElementPrototype = Element.prototype;\r
+\r
+/**\r
+ * Obtains a (new) default value for the specified type.\r
+ * @param type {string|{name: string, wireType: number}} Field type\r
+ * @returns {*} Default value\r
+ * @inner\r
+ */\r
+function mkDefault(type) {\r
+    if (typeof type === 'string')\r
+        type = ProtoBuf.TYPES[type];\r
+    if (typeof type.defaultValue === 'undefined')\r
+        throw Error("default value for type "+type.name+" is not supported");\r
+    if (type == ProtoBuf.TYPES["bytes"])\r
+        return new ByteBuffer(0);\r
+    return type.defaultValue;\r
+}\r
+\r
+/**\r
+ * Returns the default value for this field in proto3.\r
+ * @function\r
+ * @param type {string|{name: string, wireType: number}} the field type\r
+ * @returns {*} Default value\r
+ */\r
+Element.defaultFieldValue = mkDefault;\r
+\r
+/**\r
+ * Makes a Long from a value.\r
+ * @param {{low: number, high: number, unsigned: boolean}|string|number} value Value\r
+ * @param {boolean=} unsigned Whether unsigned or not, defaults to reuse it from Long-like objects or to signed for\r
+ *  strings and numbers\r
+ * @returns {!Long}\r
+ * @throws {Error} If the value cannot be converted to a Long\r
+ * @inner\r
+ */\r
+function mkLong(value, unsigned) {\r
+    if (value && typeof value.low === 'number' && typeof value.high === 'number' && typeof value.unsigned === 'boolean'\r
+        && value.low === value.low && value.high === value.high)\r
+        return new ProtoBuf.Long(value.low, value.high, typeof unsigned === 'undefined' ? value.unsigned : unsigned);\r
+    if (typeof value === 'string')\r
+        return ProtoBuf.Long.fromString(value, unsigned || false, 10);\r
+    if (typeof value === 'number')\r
+        return ProtoBuf.Long.fromNumber(value, unsigned || false);\r
+    throw Error("not convertible to Long");\r
+}\r
+\r
+ElementPrototype.toString = function() {\r
+    return (this.name || '') + (this.isMapKey ? 'map' : 'value') + ' element';\r
+}\r
+\r
+/**\r
+ * Checks if the given value can be set for an element of this type (singular\r
+ * field or one element of a repeated field or map).\r
+ * @param {*} value Value to check\r
+ * @return {*} Verified, maybe adjusted, value\r
+ * @throws {Error} If the value cannot be verified for this element slot\r
+ * @expose\r
+ */\r
+ElementPrototype.verifyValue = function(value) {\r
+    var self = this;\r
+    function fail(val, msg) {\r
+        throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+    }\r
+    switch (this.type) {\r
+        // Signed 32bit\r
+        case ProtoBuf.TYPES["int32"]:\r
+        case ProtoBuf.TYPES["sint32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+            // Account for !NaN: value === value\r
+            if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r
+                fail(typeof value, "not an integer");\r
+            return value > 4294967295 ? value | 0 : value;\r
+\r
+        // Unsigned 32bit\r
+        case ProtoBuf.TYPES["uint32"]:\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r
+                fail(typeof value, "not an integer");\r
+            return value < 0 ? value >>> 0 : value;\r
+\r
+        // Signed 64bit\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["sint64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]: {\r
+            if (ProtoBuf.Long)\r
+                try {\r
+                    return mkLong(value, false);\r
+                } catch (e) {\r
+                    fail(typeof value, e.message);\r
+                }\r
+            else\r
+                fail(typeof value, "requires Long.js");\r
+        }\r
+\r
+        // Unsigned 64bit\r
+        case ProtoBuf.TYPES["uint64"]:\r
+        case ProtoBuf.TYPES["fixed64"]: {\r
+            if (ProtoBuf.Long)\r
+                try {\r
+                    return mkLong(value, true);\r
+                } catch (e) {\r
+                    fail(typeof value, e.message);\r
+                }\r
+            else\r
+                fail(typeof value, "requires Long.js");\r
+        }\r
+\r
+        // Bool\r
+        case ProtoBuf.TYPES["bool"]:\r
+            if (typeof value !== 'boolean')\r
+                fail(typeof value, "not a boolean");\r
+            return value;\r
+\r
+        // Float\r
+        case ProtoBuf.TYPES["float"]:\r
+        case ProtoBuf.TYPES["double"]:\r
+            if (typeof value !== 'number')\r
+                fail(typeof value, "not a number");\r
+            return value;\r
+\r
+        // Length-delimited string\r
+        case ProtoBuf.TYPES["string"]:\r
+            if (typeof value !== 'string' && !(value && value instanceof String))\r
+                fail(typeof value, "not a string");\r
+            return ""+value; // Convert String object to string\r
+\r
+        // Length-delimited bytes\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            if (ByteBuffer.isByteBuffer(value))\r
+                return value;\r
+            return ByteBuffer.wrap(value, "base64");\r
+\r
+        // Constant enum value\r
+        case ProtoBuf.TYPES["enum"]: {\r
+            var values = this.resolvedType.getChildren(ProtoBuf.Reflect.Enum.Value);\r
+            for (i=0; i<values.length; i++)\r
+                if (values[i].name == value)\r
+                    return values[i].id;\r
+                else if (values[i].id == value)\r
+                    return values[i].id;\r
+\r
+            if (this.syntax === 'proto3') {\r
+                // proto3: just make sure it's an integer.\r
+                if (typeof value !== 'number' || (value === value && value % 1 !== 0))\r
+                    fail(typeof value, "not an integer");\r
+                if (value > 4294967295 || value < 0)\r
+                    fail(typeof value, "not in range for uint32")\r
+                return value;\r
+            } else {\r
+                // proto2 requires enum values to be valid.\r
+                fail(value, "not a valid enum value");\r
+            }\r
+        }\r
+        // Embedded message\r
+        case ProtoBuf.TYPES["group"]:\r
+        case ProtoBuf.TYPES["message"]: {\r
+            if (!value || typeof value !== 'object')\r
+                fail(typeof value, "object expected");\r
+            if (value instanceof this.resolvedType.clazz)\r
+                return value;\r
+            if (value instanceof ProtoBuf.Builder.Message) {\r
+                // Mismatched type: Convert to object (see: https://github.com/dcodeIO/ProtoBuf.js/issues/180)\r
+                var obj = {};\r
+                for (var i in value)\r
+                    if (value.hasOwnProperty(i))\r
+                        obj[i] = value[i];\r
+                value = obj;\r
+            }\r
+            // Else let's try to construct one from a key-value object\r
+            return new (this.resolvedType.clazz)(value); // May throw for a hundred of reasons\r
+        }\r
+    }\r
+\r
+    // We should never end here\r
+    throw Error("[INTERNAL] Illegal value for "+this.toString(true)+": "+value+" (undefined type "+this.type+")");\r
+};\r
+\r
+/**\r
+ * Calculates the byte length of an element on the wire.\r
+ * @param {number} id Field number\r
+ * @param {*} value Field value\r
+ * @returns {number} Byte length\r
+ * @throws {Error} If the value cannot be calculated\r
+ * @expose\r
+ */\r
+ElementPrototype.calculateLength = function(id, value) {\r
+    if (value === null) return 0; // Nothing to encode\r
+    // Tag has already been written\r
+    var n;\r
+    switch (this.type) {\r
+        case ProtoBuf.TYPES["int32"]:\r
+            return value < 0 ? ByteBuffer.calculateVarint64(value) : ByteBuffer.calculateVarint32(value);\r
+        case ProtoBuf.TYPES["uint32"]:\r
+            return ByteBuffer.calculateVarint32(value);\r
+        case ProtoBuf.TYPES["sint32"]:\r
+            return ByteBuffer.calculateVarint32(ByteBuffer.zigZagEncode32(value));\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+        case ProtoBuf.TYPES["float"]:\r
+            return 4;\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+            return ByteBuffer.calculateVarint64(value);\r
+        case ProtoBuf.TYPES["sint64"]:\r
+            return ByteBuffer.calculateVarint64(ByteBuffer.zigZagEncode64(value));\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+            return 8;\r
+        case ProtoBuf.TYPES["bool"]:\r
+            return 1;\r
+        case ProtoBuf.TYPES["enum"]:\r
+            return ByteBuffer.calculateVarint32(value);\r
+        case ProtoBuf.TYPES["double"]:\r
+            return 8;\r
+        case ProtoBuf.TYPES["string"]:\r
+            n = ByteBuffer.calculateUTF8Bytes(value);\r
+            return ByteBuffer.calculateVarint32(n) + n;\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            if (value.remaining() < 0)\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+            return ByteBuffer.calculateVarint32(value.remaining()) + value.remaining();\r
+        case ProtoBuf.TYPES["message"]:\r
+            n = this.resolvedType.calculate(value);\r
+            return ByteBuffer.calculateVarint32(n) + n;\r
+        case ProtoBuf.TYPES["group"]:\r
+            n = this.resolvedType.calculate(value);\r
+            return n + ByteBuffer.calculateVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+    }\r
+    // We should never end here\r
+    throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+};\r
+\r
+/**\r
+ * Encodes a value to the specified buffer. Does not encode the key.\r
+ * @param {number} id Field number\r
+ * @param {*} value Field value\r
+ * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+ * @return {ByteBuffer} The ByteBuffer for chaining\r
+ * @throws {Error} If the value cannot be encoded\r
+ * @expose\r
+ */\r
+ElementPrototype.encodeValue = function(id, value, buffer) {\r
+    if (value === null) return buffer; // Nothing to encode\r
+    // Tag has already been written\r
+\r
+    switch (this.type) {\r
+        // 32bit signed varint\r
+        case ProtoBuf.TYPES["int32"]:\r
+            // "If you use int32 or int64 as the type for a negative number, the resulting varint is always ten bytes\r
+            // long – it is, effectively, treated like a very large unsigned integer." (see #122)\r
+            if (value < 0)\r
+                buffer.writeVarint64(value);\r
+            else\r
+                buffer.writeVarint32(value);\r
+            break;\r
+\r
+        // 32bit unsigned varint\r
+        case ProtoBuf.TYPES["uint32"]:\r
+            buffer.writeVarint32(value);\r
+            break;\r
+\r
+        // 32bit varint zig-zag\r
+        case ProtoBuf.TYPES["sint32"]:\r
+            buffer.writeVarint32ZigZag(value);\r
+            break;\r
+\r
+        // Fixed unsigned 32bit\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            buffer.writeUint32(value);\r
+            break;\r
+\r
+        // Fixed signed 32bit\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+            buffer.writeInt32(value);\r
+            break;\r
+\r
+        // 64bit varint as-is\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+            buffer.writeVarint64(value); // throws\r
+            break;\r
+\r
+        // 64bit varint zig-zag\r
+        case ProtoBuf.TYPES["sint64"]:\r
+            buffer.writeVarint64ZigZag(value); // throws\r
+            break;\r
+\r
+        // Fixed unsigned 64bit\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+            buffer.writeUint64(value); // throws\r
+            break;\r
+\r
+        // Fixed signed 64bit\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+            buffer.writeInt64(value); // throws\r
+            break;\r
+\r
+        // Bool\r
+        case ProtoBuf.TYPES["bool"]:\r
+            if (typeof value === 'string')\r
+                buffer.writeVarint32(value.toLowerCase() === 'false' ? 0 : !!value);\r
+            else\r
+                buffer.writeVarint32(value ? 1 : 0);\r
+            break;\r
+\r
+        // Constant enum value\r
+        case ProtoBuf.TYPES["enum"]:\r
+            buffer.writeVarint32(value);\r
+            break;\r
+\r
+        // 32bit float\r
+        case ProtoBuf.TYPES["float"]:\r
+            buffer.writeFloat32(value);\r
+            break;\r
+\r
+        // 64bit float\r
+        case ProtoBuf.TYPES["double"]:\r
+            buffer.writeFloat64(value);\r
+            break;\r
+\r
+        // Length-delimited string\r
+        case ProtoBuf.TYPES["string"]:\r
+            buffer.writeVString(value);\r
+            break;\r
+\r
+        // Length-delimited bytes\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            if (value.remaining() < 0)\r
+                throw Error("Illegal value for "+this.toString(true)+": "+value.remaining()+" bytes remaining");\r
+            var prevOffset = value.offset;\r
+            buffer.writeVarint32(value.remaining());\r
+            buffer.append(value);\r
+            value.offset = prevOffset;\r
+            break;\r
+\r
+        // Embedded message\r
+        case ProtoBuf.TYPES["message"]:\r
+            var bb = new ByteBuffer().LE();\r
+            this.resolvedType.encode(value, bb);\r
+            buffer.writeVarint32(bb.offset);\r
+            buffer.append(bb.flip());\r
+            break;\r
+\r
+        // Legacy group\r
+        case ProtoBuf.TYPES["group"]:\r
+            this.resolvedType.encode(value, buffer);\r
+            buffer.writeVarint32((id << 3) | ProtoBuf.WIRE_TYPES.ENDGROUP);\r
+            break;\r
+\r
+        default:\r
+            // We should never end here\r
+            throw Error("[INTERNAL] Illegal value to encode in "+this.toString(true)+": "+value+" (unknown type)");\r
+    }\r
+    return buffer;\r
+};\r
+\r
+/**\r
+ * Decode one element value from the specified buffer.\r
+ * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+ * @param {number} wireType The field wire type\r
+ * @param {number} id The field number\r
+ * @return {*} Decoded value\r
+ * @throws {Error} If the field cannot be decoded\r
+ * @expose\r
+ */\r
+ElementPrototype.decode = function(buffer, wireType, id) {\r
+    if (wireType != this.type.wireType)\r
+        throw Error("Unexpected wire type for element");\r
+\r
+    var value, nBytes;\r
+    switch (this.type) {\r
+        // 32bit signed varint\r
+        case ProtoBuf.TYPES["int32"]:\r
+            return buffer.readVarint32() | 0;\r
+\r
+        // 32bit unsigned varint\r
+        case ProtoBuf.TYPES["uint32"]:\r
+            return buffer.readVarint32() >>> 0;\r
+\r
+        // 32bit signed varint zig-zag\r
+        case ProtoBuf.TYPES["sint32"]:\r
+            return buffer.readVarint32ZigZag() | 0;\r
+\r
+        // Fixed 32bit unsigned\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            return buffer.readUint32() >>> 0;\r
+\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+            return buffer.readInt32() | 0;\r
+\r
+        // 64bit signed varint\r
+        case ProtoBuf.TYPES["int64"]:\r
+            return buffer.readVarint64();\r
+\r
+        // 64bit unsigned varint\r
+        case ProtoBuf.TYPES["uint64"]:\r
+            return buffer.readVarint64().toUnsigned();\r
+\r
+        // 64bit signed varint zig-zag\r
+        case ProtoBuf.TYPES["sint64"]:\r
+            return buffer.readVarint64ZigZag();\r
+\r
+        // Fixed 64bit unsigned\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+            return buffer.readUint64();\r
+\r
+        // Fixed 64bit signed\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+            return buffer.readInt64();\r
+\r
+        // Bool varint\r
+        case ProtoBuf.TYPES["bool"]:\r
+            return !!buffer.readVarint32();\r
+\r
+        // Constant enum value (varint)\r
+        case ProtoBuf.TYPES["enum"]:\r
+            // The following Builder.Message#set will already throw\r
+            return buffer.readVarint32();\r
+\r
+        // 32bit float\r
+        case ProtoBuf.TYPES["float"]:\r
+            return buffer.readFloat();\r
+\r
+        // 64bit float\r
+        case ProtoBuf.TYPES["double"]:\r
+            return buffer.readDouble();\r
+\r
+        // Length-delimited string\r
+        case ProtoBuf.TYPES["string"]:\r
+            return buffer.readVString();\r
+\r
+        // Length-delimited bytes\r
+        case ProtoBuf.TYPES["bytes"]: {\r
+            nBytes = buffer.readVarint32();\r
+            if (buffer.remaining() < nBytes)\r
+                throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+            value = buffer.clone(); // Offset already set\r
+            value.limit = value.offset+nBytes;\r
+            buffer.offset += nBytes;\r
+            return value;\r
+        }\r
+\r
+        // Length-delimited embedded message\r
+        case ProtoBuf.TYPES["message"]: {\r
+            nBytes = buffer.readVarint32();\r
+            return this.resolvedType.decode(buffer, nBytes);\r
+        }\r
+\r
+        // Legacy group\r
+        case ProtoBuf.TYPES["group"]:\r
+            return this.resolvedType.decode(buffer, -1, id);\r
+    }\r
+\r
+    // We should never end here\r
+    throw Error("[INTERNAL] Illegal decode type");\r
+};\r
+\r
+/**\r
+ * Converts a value from a string to the canonical element type.\r
+ *\r
+ * Legal only when isMapKey is true.\r
+ *\r
+ * @param {string} str The string value\r
+ * @returns {*} The value\r
+ */\r
+ElementPrototype.valueFromString = function(str) {\r
+    if (!this.isMapKey) {\r
+        throw Error("valueFromString() called on non-map-key element");\r
+    }\r
+\r
+    switch (this.type) {\r
+        case ProtoBuf.TYPES["int32"]:\r
+        case ProtoBuf.TYPES["sint32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+        case ProtoBuf.TYPES["uint32"]:\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            return this.verifyValue(parseInt(str));\r
+\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["sint64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+              // Long-based fields support conversions from string already.\r
+              return this.verifyValue(str);\r
+\r
+        case ProtoBuf.TYPES["bool"]:\r
+              return str === "true";\r
+\r
+        case ProtoBuf.TYPES["string"]:\r
+              return this.verifyValue(str);\r
+\r
+        case ProtoBuf.TYPES["bytes"]:\r
+              return ByteBuffer.fromBinary(str);\r
+    }\r
+};\r
+\r
+/**\r
+ * Converts a value from the canonical element type to a string.\r
+ *\r
+ * It should be the case that `valueFromString(valueToString(val))` returns\r
+ * a value equivalent to `verifyValue(val)` for every legal value of `val`\r
+ * according to this element type.\r
+ *\r
+ * This may be used when the element must be stored or used as a string,\r
+ * e.g., as a map key on an Object.\r
+ *\r
+ * Legal only when isMapKey is true.\r
+ *\r
+ * @param {*} val The value\r
+ * @returns {string} The string form of the value.\r
+ */\r
+ElementPrototype.valueToString = function(value) {\r
+    if (!this.isMapKey) {\r
+        throw Error("valueToString() called on non-map-key element");\r
+    }\r
+\r
+    if (this.type === ProtoBuf.TYPES["bytes"]) {\r
+        return value.toString("binary");\r
+    } else {\r
+        return value.toString();\r
+    }\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum.js
new file mode 100644 (file)
index 0000000..87c05e6
--- /dev/null
@@ -0,0 +1,68 @@
+/**\r
+ * Constructs a new Enum.\r
+ * @exports ProtoBuf.Reflect.Enum\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.T} parent Parent Reflect object\r
+ * @param {string} name Enum name\r
+ * @param {Object.<string,*>=} options Enum options\r
+ * @param {string?} syntax The syntax level (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Enum = function(builder, parent, name, options, syntax) {\r
+    Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Enum";\r
+\r
+    /**\r
+     * Runtime enum object.\r
+     * @type {Object.<string,number>|null}\r
+     * @expose\r
+     */\r
+    this.object = null;\r
+};\r
+\r
+/**\r
+ * Gets the string name of an enum value.\r
+ * @param {!ProtoBuf.Builder.Enum} enm Runtime enum\r
+ * @param {number} value Enum value\r
+ * @returns {?string} Name or `null` if not present\r
+ * @expose\r
+ */\r
+Enum.getName = function(enm, value) {\r
+    var keys = Object.keys(enm);\r
+    for (var i=0, key; i<keys.length; ++i)\r
+        if (enm[key = keys[i]] === value)\r
+            return key;\r
+    return null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Enum.prototype\r
+ * @inner\r
+ */\r
+var EnumPrototype = Enum.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds this enum and returns the runtime counterpart.\r
+ * @param {boolean} rebuild Whether to rebuild or not, defaults to false\r
+ * @returns {!Object.<string,number>}\r
+ * @expose\r
+ */\r
+EnumPrototype.build = function(rebuild) {\r
+    if (this.object && !rebuild)\r
+        return this.object;\r
+    var enm = new ProtoBuf.Builder.Enum(),\r
+        values = this.getChildren(Enum.Value);\r
+    for (var i=0, k=values.length; i<k; ++i)\r
+        enm[values[i]['name']] = values[i]['id'];\r
+    if (Object.defineProperty)\r
+        Object.defineProperty(enm, '$options', {\r
+            "value": this.buildOpt(),\r
+            "enumerable": false\r
+        });\r
+    return this.object = enm;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum/Value.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Enum/Value.js
new file mode 100644 (file)
index 0000000..9c809fa
--- /dev/null
@@ -0,0 +1,28 @@
+/**\r
+ * Constructs a new Enum Value.\r
+ * @exports ProtoBuf.Reflect.Enum.Value\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Enum} enm Enum reference\r
+ * @param {string} name Field name\r
+ * @param {number} id Unique field id\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Value = function(builder, enm, name, id) {\r
+    T.call(this, builder, enm, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Enum.Value";\r
+\r
+    /**\r
+     * Unique enum value id.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.id = id;\r
+};\r
+\r
+// Extends T\r
+Value.prototype = Object.create(T.prototype);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Extension.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Extension.js
new file mode 100644 (file)
index 0000000..4559a4f
--- /dev/null
@@ -0,0 +1,22 @@
+/**\r
+ * An extension (field).\r
+ * @exports ProtoBuf.Reflect.Extension\r
+ * @constructor\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.T} parent Parent object\r
+ * @param {string} name Object name\r
+ * @param {!ProtoBuf.Reflect.Message.Field} field Extension field\r
+ */\r
+var Extension = function(builder, parent, name, field) {\r
+    T.call(this, builder, parent, name);\r
+\r
+    /**\r
+     * Extended message field.\r
+     * @type {!ProtoBuf.Reflect.Message.Field}\r
+     * @expose\r
+     */\r
+    this.field = field;\r
+};\r
+\r
+// Extends T\r
+Extension.prototype = Object.create(T.prototype);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message.js
new file mode 100644 (file)
index 0000000..f802aff
--- /dev/null
@@ -0,0 +1,287 @@
+/**\r
+ * Constructs a new Message.\r
+ * @exports ProtoBuf.Reflect.Message\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Namespace} parent Parent message or namespace\r
+ * @param {string} name Message name\r
+ * @param {Object.<string,*>=} options Message options\r
+ * @param {boolean=} isGroup `true` if this is a legacy group\r
+ * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Message = function(builder, parent, name, options, isGroup, syntax) {\r
+    Namespace.call(this, builder, parent, name, options, syntax);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Message";\r
+\r
+    /**\r
+     * Extensions range.\r
+     * @type {!Array.<number>|undefined}\r
+     * @expose\r
+     */\r
+    this.extensions = undefined;\r
+\r
+    /**\r
+     * Runtime message class.\r
+     * @type {?function(new:ProtoBuf.Builder.Message)}\r
+     * @expose\r
+     */\r
+    this.clazz = null;\r
+\r
+    /**\r
+     * Whether this is a legacy group or not.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.isGroup = !!isGroup;\r
+\r
+    // The following cached collections are used to efficiently iterate over or look up fields when decoding.\r
+\r
+    /**\r
+     * Cached fields.\r
+     * @type {?Array.<!ProtoBuf.Reflect.Message.Field>}\r
+     * @private\r
+     */\r
+    this._fields = null;\r
+\r
+    /**\r
+     * Cached fields by id.\r
+     * @type {?Object.<number,!ProtoBuf.Reflect.Message.Field>}\r
+     * @private\r
+     */\r
+    this._fieldsById = null;\r
+\r
+    /**\r
+     * Cached fields by name.\r
+     * @type {?Object.<string,!ProtoBuf.Reflect.Message.Field>}\r
+     * @private\r
+     */\r
+    this._fieldsByName = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Message.prototype\r
+ * @inner\r
+ */\r
+var MessagePrototype = Message.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds the message and returns the runtime counterpart, which is a fully functional class.\r
+ * @see ProtoBuf.Builder.Message\r
+ * @param {boolean=} rebuild Whether to rebuild or not, defaults to false\r
+ * @return {ProtoBuf.Reflect.Message} Message class\r
+ * @throws {Error} If the message cannot be built\r
+ * @expose\r
+ */\r
+MessagePrototype.build = function(rebuild) {\r
+    if (this.clazz && !rebuild)\r
+        return this.clazz;\r
+\r
+    // Create the runtime Message class in its own scope\r
+    var clazz = (function(ProtoBuf, T) {\r
+\r
+        //? include("../Builder/Message.js");\r
+\r
+        return Message;\r
+\r
+    })(ProtoBuf, this);\r
+\r
+    // Static enums and prototyped sub-messages / cached collections\r
+    this._fields = [];\r
+    this._fieldsById = {};\r
+    this._fieldsByName = {};\r
+    this._oneofsByName = {};\r
+    for (var i=0, k=this.children.length, child; i<k; i++) {\r
+        child = this.children[i];\r
+        if (child instanceof Enum || child instanceof Message || child instanceof Service) {\r
+            if (clazz.hasOwnProperty(child.name))\r
+                throw Error("Illegal reflect child of "+this.toString(true)+": "+child.toString(true)+" cannot override static property '"+child.name+"'");\r
+            clazz[child.name] = child.build();\r
+        } else if (child instanceof Message.Field)\r
+            child.build(),\r
+            this._fields.push(child),\r
+            this._fieldsById[child.id] = child,\r
+            this._fieldsByName[child.name] = child;\r
+        else if (child instanceof Message.OneOf) {\r
+            this._oneofsByName[child.name] = child;\r
+        }\r
+        else if (!(child instanceof Message.OneOf) && !(child instanceof Extension)) // Not built\r
+            throw Error("Illegal reflect child of "+this.toString(true)+": "+this.children[i].toString(true));\r
+    }\r
+\r
+    return this.clazz = clazz;\r
+};\r
+\r
+/**\r
+ * Encodes a runtime message's contents to the specified buffer.\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+ * @param {ByteBuffer} buffer ByteBuffer to write to\r
+ * @param {boolean=} noVerify Whether to not verify field values, defaults to `false`\r
+ * @return {ByteBuffer} The ByteBuffer for chaining\r
+ * @throws {Error} If required fields are missing or the message cannot be encoded for another reason\r
+ * @expose\r
+ */\r
+MessagePrototype.encode = function(message, buffer, noVerify) {\r
+    var fieldMissing = null,\r
+        field;\r
+    for (var i=0, k=this._fields.length, val; i<k; ++i) {\r
+        field = this._fields[i];\r
+        val = message[field.name];\r
+        if (field.required && val === null) {\r
+            if (fieldMissing === null)\r
+                fieldMissing = field;\r
+        } else\r
+            field.encode(noVerify ? val : field.verifyValue(val), buffer, message);\r
+    }\r
+    if (fieldMissing !== null) {\r
+        var err = Error("Missing at least one required field for "+this.toString(true)+": "+fieldMissing);\r
+        err["encoded"] = buffer; // Still expose what we got\r
+        throw(err);\r
+    }\r
+    return buffer;\r
+};\r
+\r
+/**\r
+ * Calculates a runtime message's byte length.\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message to encode\r
+ * @returns {number} Byte length\r
+ * @throws {Error} If required fields are missing or the message cannot be calculated for another reason\r
+ * @expose\r
+ */\r
+MessagePrototype.calculate = function(message) {\r
+    for (var n=0, i=0, k=this._fields.length, field, val; i<k; ++i) {\r
+        field = this._fields[i];\r
+        val = message[field.name];\r
+        if (field.required && val === null)\r
+           throw Error("Missing at least one required field for "+this.toString(true)+": "+field);\r
+        else\r
+            n += field.calculate(val, message);\r
+    }\r
+    return n;\r
+};\r
+\r
+/**\r
+ * Skips all data until the end of the specified group has been reached.\r
+ * @param {number} expectedId Expected GROUPEND id\r
+ * @param {!ByteBuffer} buf ByteBuffer\r
+ * @returns {boolean} `true` if a value as been skipped, `false` if the end has been reached\r
+ * @throws {Error} If it wasn't possible to find the end of the group (buffer overrun or end tag mismatch)\r
+ * @inner\r
+ */\r
+function skipTillGroupEnd(expectedId, buf) {\r
+    var tag = buf.readVarint32(), // Throws on OOB\r
+        wireType = tag & 0x07,\r
+        id = tag >>> 3;\r
+    switch (wireType) {\r
+        case ProtoBuf.WIRE_TYPES.VARINT:\r
+            do tag = buf.readUint8();\r
+            while ((tag & 0x80) === 0x80);\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.BITS64:\r
+            buf.offset += 8;\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.LDELIM:\r
+            tag = buf.readVarint32(); // reads the varint\r
+            buf.offset += tag;        // skips n bytes\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+            skipTillGroupEnd(id, buf);\r
+            break;\r
+        case ProtoBuf.WIRE_TYPES.ENDGROUP:\r
+            if (id === expectedId)\r
+                return false;\r
+            else\r
+                throw Error("Illegal GROUPEND after unknown group: "+id+" ("+expectedId+" expected)");\r
+        case ProtoBuf.WIRE_TYPES.BITS32:\r
+            buf.offset += 4;\r
+            break;\r
+        default:\r
+            throw Error("Illegal wire type in unknown group "+expectedId+": "+wireType);\r
+    }\r
+    return true;\r
+}\r
+\r
+/**\r
+ * Decodes an encoded message and returns the decoded message.\r
+ * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+ * @param {number=} length Message length. Defaults to decode all remaining data.\r
+ * @param {number=} expectedGroupEndId Expected GROUPEND id if this is a legacy group\r
+ * @return {ProtoBuf.Builder.Message} Decoded message\r
+ * @throws {Error} If the message cannot be decoded\r
+ * @expose\r
+ */\r
+MessagePrototype.decode = function(buffer, length, expectedGroupEndId) {\r
+    if (typeof length !== 'number')\r
+        length = -1;\r
+    var start = buffer.offset,\r
+        msg = new (this.clazz)(),\r
+        tag, wireType, id, field;\r
+    while (buffer.offset < start+length || (length === -1 && buffer.remaining() > 0)) {\r
+        tag = buffer.readVarint32();\r
+        wireType = tag & 0x07;\r
+        id = tag >>> 3;\r
+        if (wireType === ProtoBuf.WIRE_TYPES.ENDGROUP) {\r
+            if (id !== expectedGroupEndId)\r
+                throw Error("Illegal group end indicator for "+this.toString(true)+": "+id+" ("+(expectedGroupEndId ? expectedGroupEndId+" expected" : "not a group")+")");\r
+            break;\r
+        }\r
+        if (!(field = this._fieldsById[id])) {\r
+            // "messages created by your new code can be parsed by your old code: old binaries simply ignore the new field when parsing."\r
+            switch (wireType) {\r
+                case ProtoBuf.WIRE_TYPES.VARINT:\r
+                    buffer.readVarint32();\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.BITS32:\r
+                    buffer.offset += 4;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.BITS64:\r
+                    buffer.offset += 8;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.LDELIM:\r
+                    var len = buffer.readVarint32();\r
+                    buffer.offset += len;\r
+                    break;\r
+                case ProtoBuf.WIRE_TYPES.STARTGROUP:\r
+                    while (skipTillGroupEnd(id, buffer)) {}\r
+                    break;\r
+                default:\r
+                    throw Error("Illegal wire type for unknown field "+id+" in "+this.toString(true)+"#decode: "+wireType);\r
+            }\r
+            continue;\r
+        }\r
+        if (field.repeated && !field.options["packed"]) {\r
+            msg[field.name].push(field.decode(wireType, buffer));\r
+        } else if (field.map) {\r
+            var keyval = field.decode(wireType, buffer);\r
+            msg[field.name].set(keyval[0], keyval[1]);\r
+        } else {\r
+            msg[field.name] = field.decode(wireType, buffer);\r
+            if (field.oneof) { // Field is part of an OneOf (not a virtual OneOf field)\r
+                var currentField = msg[field.oneof.name]; // Virtual field references currently set field\r
+                if (currentField !== null && currentField !== field.name)\r
+                    msg[currentField] = null; // Clear currently set field\r
+                msg[field.oneof.name] = field.name; // Point virtual field at this field\r
+            }\r
+        }\r
+    }\r
+\r
+    // Check if all required fields are present and set default values for optional fields that are not\r
+    for (var i=0, k=this._fields.length; i<k; ++i) {\r
+        field = this._fields[i];\r
+        if (msg[field.name] === null) {\r
+            if (this.syntax === "proto3") { // Proto3 sets default values by specification\r
+                msg[field.name] = field.defaultValue;\r
+            } else if (field.required) {\r
+                var err = Error("Missing at least one required field for " + this.toString(true) + ": " + field.name);\r
+                err["decoded"] = msg; // Still expose what we got\r
+                throw(err);\r
+            } else if (ProtoBuf.populateDefaults && field.defaultValue !== null)\r
+                msg[field.name] = field.defaultValue;\r
+        }\r
+    }\r
+    return msg;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/ExtensionField.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/ExtensionField.js
new file mode 100644 (file)
index 0000000..5052191
--- /dev/null
@@ -0,0 +1,26 @@
+/**\r
+ * Constructs a new Message ExtensionField.\r
+ * @exports ProtoBuf.Reflect.Message.ExtensionField\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+ * @param {string} rule Rule, one of requried, optional, repeated\r
+ * @param {string} type Data type, e.g. int32\r
+ * @param {string} name Field name\r
+ * @param {number} id Unique field id\r
+ * @param {!Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Message.Field\r
+ */\r
+var ExtensionField = function(builder, message, rule, type, name, id, options) {\r
+    Field.call(this, builder, message, rule, /* keytype = */ null, type, name, id, options);\r
+\r
+    /**\r
+     * Extension reference.\r
+     * @type {!ProtoBuf.Reflect.Extension}\r
+     * @expose\r
+     */\r
+    this.extension;\r
+};\r
+\r
+// Extends Field\r
+ExtensionField.prototype = Object.create(Field.prototype);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/Field.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/Field.js
new file mode 100644 (file)
index 0000000..d7c3b64
--- /dev/null
@@ -0,0 +1,458 @@
+/**\r
+ * Constructs a new Message Field.\r
+ * @exports ProtoBuf.Reflect.Message.Field\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+ * @param {string} rule Rule, one of requried, optional, repeated\r
+ * @param {string?} keytype Key data type, if any.\r
+ * @param {string} type Data type, e.g. int32\r
+ * @param {string} name Field name\r
+ * @param {number} id Unique field id\r
+ * @param {Object.<string,*>=} options Options\r
+ * @param {!ProtoBuf.Reflect.Message.OneOf=} oneof Enclosing OneOf\r
+ * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Field = function(builder, message, rule, keytype, type, name, id, options, oneof, syntax) {\r
+    T.call(this, builder, message, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Message.Field";\r
+\r
+    /**\r
+     * Message field required flag.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.required = rule === "required";\r
+\r
+    /**\r
+     * Message field repeated flag.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.repeated = rule === "repeated";\r
+\r
+    /**\r
+     * Message field map flag.\r
+     * @type {boolean}\r
+     * @expose\r
+     */\r
+    this.map = rule === "map";\r
+\r
+    /**\r
+     * Message field key type. Type reference string if unresolved, protobuf\r
+     * type if resolved. Valid only if this.map === true, null otherwise.\r
+     * @type {string|{name: string, wireType: number}|null}\r
+     * @expose\r
+     */\r
+    this.keyType = keytype || null;\r
+\r
+    /**\r
+     * Message field type. Type reference string if unresolved, protobuf type if\r
+     * resolved. In a map field, this is the value type.\r
+     * @type {string|{name: string, wireType: number}}\r
+     * @expose\r
+     */\r
+    this.type = type;\r
+\r
+    /**\r
+     * Resolved type reference inside the global namespace.\r
+     * @type {ProtoBuf.Reflect.T|null}\r
+     * @expose\r
+     */\r
+    this.resolvedType = null;\r
+\r
+    /**\r
+     * Unique message field id.\r
+     * @type {number}\r
+     * @expose\r
+     */\r
+    this.id = id;\r
+\r
+    /**\r
+     * Message field options.\r
+     * @type {!Object.<string,*>}\r
+     * @dict\r
+     * @expose\r
+     */\r
+    this.options = options || {};\r
+\r
+    /**\r
+     * Default value.\r
+     * @type {*}\r
+     * @expose\r
+     */\r
+    this.defaultValue = null;\r
+\r
+    /**\r
+     * Enclosing OneOf.\r
+     * @type {?ProtoBuf.Reflect.Message.OneOf}\r
+     * @expose\r
+     */\r
+    this.oneof = oneof || null;\r
+\r
+    /**\r
+     * Syntax level of this definition (e.g., proto3).\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.syntax = syntax || 'proto2';\r
+\r
+    /**\r
+     * Original field name.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.originalName = this.name; // Used to revert camelcase transformation on naming collisions\r
+\r
+    /**\r
+     * Element implementation. Created in build() after types are resolved.\r
+     * @type {ProtoBuf.Element}\r
+     * @expose\r
+     */\r
+    this.element = null;\r
+\r
+    /**\r
+     * Key element implementation, for map fields. Created in build() after\r
+     * types are resolved.\r
+     * @type {ProtoBuf.Element}\r
+     * @expose\r
+     */\r
+    this.keyElement = null;\r
+\r
+    // Convert field names to camel case notation if the override is set\r
+    if (this.builder.options['convertFieldsToCamelCase'] && !(this instanceof Message.ExtensionField))\r
+        this.name = ProtoBuf.Util.toCamelCase(this.name);\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Message.Field.prototype\r
+ * @inner\r
+ */\r
+var FieldPrototype = Field.prototype = Object.create(T.prototype);\r
+\r
+/**\r
+ * Builds the field.\r
+ * @override\r
+ * @expose\r
+ */\r
+FieldPrototype.build = function() {\r
+    this.element = new Element(this.type, this.resolvedType, false, this.syntax, this.name);\r
+    if (this.map)\r
+        this.keyElement = new Element(this.keyType, undefined, true, this.syntax, this.name);\r
+\r
+    // In proto3, fields do not have field presence, and every field is set to\r
+    // its type's default value ("", 0, 0.0, or false).\r
+    if (this.syntax === 'proto3' && !this.repeated && !this.map)\r
+        this.defaultValue = Element.defaultFieldValue(this.type);\r
+\r
+    // Otherwise, default values are present when explicitly specified\r
+    else if (typeof this.options['default'] !== 'undefined')\r
+        this.defaultValue = this.verifyValue(this.options['default']);\r
+};\r
+\r
+/**\r
+ * Checks if the given value can be set for this field.\r
+ * @param {*} value Value to check\r
+ * @param {boolean=} skipRepeated Whether to skip the repeated value check or not. Defaults to false.\r
+ * @return {*} Verified, maybe adjusted, value\r
+ * @throws {Error} If the value cannot be set for this field\r
+ * @expose\r
+ */\r
+FieldPrototype.verifyValue = function(value, skipRepeated) {\r
+    skipRepeated = skipRepeated || false;\r
+    var self = this;\r
+    function fail(val, msg) {\r
+        throw Error("Illegal value for "+self.toString(true)+" of type "+self.type.name+": "+val+" ("+msg+")");\r
+    }\r
+    if (value === null) { // NULL values for optional fields\r
+        if (this.required)\r
+            fail(typeof value, "required");\r
+        if (this.syntax === 'proto3' && this.type !== ProtoBuf.TYPES["message"])\r
+            fail(typeof value, "proto3 field without field presence cannot be null");\r
+        return null;\r
+    }\r
+    var i;\r
+    if (this.repeated && !skipRepeated) { // Repeated values as arrays\r
+        if (!Array.isArray(value))\r
+            value = [value];\r
+        var res = [];\r
+        for (i=0; i<value.length; i++)\r
+            res.push(this.element.verifyValue(value[i]));\r
+        return res;\r
+    }\r
+    if (this.map && !skipRepeated) { // Map values as objects\r
+        if (!(value instanceof ProtoBuf.Map)) {\r
+            // If not already a Map, attempt to convert.\r
+            if (!(value instanceof Object)) {\r
+                fail(typeof value,\r
+                     "expected ProtoBuf.Map or raw object for map field");\r
+            }\r
+            return new ProtoBuf.Map(this, value);\r
+        } else {\r
+            return value;\r
+        }\r
+    }\r
+    // All non-repeated fields expect no array\r
+    if (!this.repeated && Array.isArray(value))\r
+        fail(typeof value, "no array expected");\r
+\r
+    return this.element.verifyValue(value);\r
+};\r
+\r
+/**\r
+ * Determines whether the field will have a presence on the wire given its\r
+ * value.\r
+ * @param {*} value Verified field value\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+ * @return {boolean} Whether the field will be present on the wire\r
+ */\r
+FieldPrototype.hasWirePresence = function(value, message) {\r
+    if (this.syntax !== 'proto3')\r
+        return (value !== null);\r
+    if (this.oneof && message[this.oneof.name] === this.name)\r
+        return true;\r
+    switch (this.type) {\r
+        case ProtoBuf.TYPES["int32"]:\r
+        case ProtoBuf.TYPES["sint32"]:\r
+        case ProtoBuf.TYPES["sfixed32"]:\r
+        case ProtoBuf.TYPES["uint32"]:\r
+        case ProtoBuf.TYPES["fixed32"]:\r
+            return value !== 0;\r
+\r
+        case ProtoBuf.TYPES["int64"]:\r
+        case ProtoBuf.TYPES["sint64"]:\r
+        case ProtoBuf.TYPES["sfixed64"]:\r
+        case ProtoBuf.TYPES["uint64"]:\r
+        case ProtoBuf.TYPES["fixed64"]:\r
+            return value.low !== 0 || value.high !== 0;\r
+\r
+        case ProtoBuf.TYPES["bool"]:\r
+            return value;\r
+\r
+        case ProtoBuf.TYPES["float"]:\r
+        case ProtoBuf.TYPES["double"]:\r
+            return value !== 0.0;\r
+\r
+        case ProtoBuf.TYPES["string"]:\r
+            return value.length > 0;\r
+\r
+        case ProtoBuf.TYPES["bytes"]:\r
+            return value.remaining() > 0;\r
+\r
+        case ProtoBuf.TYPES["enum"]:\r
+            return value !== 0;\r
+\r
+        case ProtoBuf.TYPES["message"]:\r
+            return value !== null;\r
+        default:\r
+            return true;\r
+    }\r
+};\r
+\r
+/**\r
+ * Encodes the specified field value to the specified buffer.\r
+ * @param {*} value Verified field value\r
+ * @param {ByteBuffer} buffer ByteBuffer to encode to\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+ * @return {ByteBuffer} The ByteBuffer for chaining\r
+ * @throws {Error} If the field cannot be encoded\r
+ * @expose\r
+ */\r
+FieldPrototype.encode = function(value, buffer, message) {\r
+    if (this.type === null || typeof this.type !== 'object')\r
+        throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+    if (value === null || (this.repeated && value.length == 0))\r
+        return buffer; // Optional omitted\r
+    try {\r
+        if (this.repeated) {\r
+            var i;\r
+            // "Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire\r
+            // types) can be declared 'packed'."\r
+            if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                // "All of the elements of the field are packed into a single key-value pair with wire type 2\r
+                // (length-delimited). Each element is encoded the same way it would be normally, except without a\r
+                // tag preceding it."\r
+                buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                buffer.ensureCapacity(buffer.offset += 1); // We do not know the length yet, so let's assume a varint of length 1\r
+                var start = buffer.offset; // Remember where the contents begin\r
+                for (i=0; i<value.length; i++)\r
+                    this.element.encodeValue(this.id, value[i], buffer);\r
+                var len = buffer.offset-start,\r
+                    varintLen = ByteBuffer.calculateVarint32(len);\r
+                if (varintLen > 1) { // We need to move the contents\r
+                    var contents = buffer.slice(start, buffer.offset);\r
+                    start += varintLen-1;\r
+                    buffer.offset = start;\r
+                    buffer.append(contents);\r
+                }\r
+                buffer.writeVarint32(len, start-varintLen);\r
+            } else {\r
+                // "If your message definition has repeated elements (without the [packed=true] option), the encoded\r
+                // message has zero or more key-value pairs with the same tag number"\r
+                for (i=0; i<value.length; i++)\r
+                    buffer.writeVarint32((this.id << 3) | this.type.wireType),\r
+                    this.element.encodeValue(this.id, value[i], buffer);\r
+            }\r
+        } else if (this.map) {\r
+            // Write out each map entry as a submessage.\r
+            value.forEach(function(val, key, m) {\r
+                // Compute the length of the submessage (key, val) pair.\r
+                var length =\r
+                    ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +\r
+                    this.keyElement.calculateLength(1, key) +\r
+                    ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +\r
+                    this.element.calculateLength(2, val);\r
+\r
+                // Submessage with wire type of length-delimited.\r
+                buffer.writeVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                buffer.writeVarint32(length);\r
+\r
+                // Write out the key and val.\r
+                buffer.writeVarint32((1 << 3) | this.keyType.wireType);\r
+                this.keyElement.encodeValue(1, key, buffer);\r
+                buffer.writeVarint32((2 << 3) | this.type.wireType);\r
+                this.element.encodeValue(2, val, buffer);\r
+            }, this);\r
+        } else {\r
+            if (this.hasWirePresence(value, message)) {\r
+                buffer.writeVarint32((this.id << 3) | this.type.wireType);\r
+                this.element.encodeValue(this.id, value, buffer);\r
+            }\r
+        }\r
+    } catch (e) {\r
+        throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+    }\r
+    return buffer;\r
+};\r
+\r
+/**\r
+ * Calculates the length of this field's value on the network level.\r
+ * @param {*} value Field value\r
+ * @param {!ProtoBuf.Builder.Message} message Runtime message\r
+ * @returns {number} Byte length\r
+ * @expose\r
+ */\r
+FieldPrototype.calculate = function(value, message) {\r
+    value = this.verifyValue(value); // May throw\r
+    if (this.type === null || typeof this.type !== 'object')\r
+        throw Error("[INTERNAL] Unresolved type in "+this.toString(true)+": "+this.type);\r
+    if (value === null || (this.repeated && value.length == 0))\r
+        return 0; // Optional omitted\r
+    var n = 0;\r
+    try {\r
+        if (this.repeated) {\r
+            var i, ni;\r
+            if (this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+                n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                ni = 0;\r
+                for (i=0; i<value.length; i++)\r
+                    ni += this.element.calculateLength(this.id, value[i]);\r
+                n += ByteBuffer.calculateVarint32(ni);\r
+                n += ni;\r
+            } else {\r
+                for (i=0; i<value.length; i++)\r
+                    n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType),\r
+                    n += this.element.calculateLength(this.id, value[i]);\r
+            }\r
+        } else if (this.map) {\r
+            // Each map entry becomes a submessage.\r
+            value.forEach(function(val, key, m) {\r
+                // Compute the length of the submessage (key, val) pair.\r
+                var length =\r
+                    ByteBuffer.calculateVarint32((1 << 3) | this.keyType.wireType) +\r
+                    this.keyElement.calculateLength(1, key) +\r
+                    ByteBuffer.calculateVarint32((2 << 3) | this.type.wireType) +\r
+                    this.element.calculateLength(2, val);\r
+\r
+                n += ByteBuffer.calculateVarint32((this.id << 3) | ProtoBuf.WIRE_TYPES.LDELIM);\r
+                n += ByteBuffer.calculateVarint32(length);\r
+                n += length;\r
+            }, this);\r
+        } else {\r
+            if (this.hasWirePresence(value, message)) {\r
+                n += ByteBuffer.calculateVarint32((this.id << 3) | this.type.wireType);\r
+                n += this.element.calculateLength(this.id, value);\r
+            }\r
+        }\r
+    } catch (e) {\r
+        throw Error("Illegal value for "+this.toString(true)+": "+value+" ("+e+")");\r
+    }\r
+    return n;\r
+};\r
+\r
+/**\r
+ * Decode the field value from the specified buffer.\r
+ * @param {number} wireType Leading wire type\r
+ * @param {ByteBuffer} buffer ByteBuffer to decode from\r
+ * @param {boolean=} skipRepeated Whether to skip the repeated check or not. Defaults to false.\r
+ * @return {*} Decoded value: array for packed repeated fields, [key, value] for\r
+ *             map fields, or an individual value otherwise.\r
+ * @throws {Error} If the field cannot be decoded\r
+ * @expose\r
+ */\r
+FieldPrototype.decode = function(wireType, buffer, skipRepeated) {\r
+    var value, nBytes;\r
+\r
+    // We expect wireType to match the underlying type's wireType unless we see\r
+    // a packed repeated field, or unless this is a map field.\r
+    var wireTypeOK =\r
+        (!this.map && wireType == this.type.wireType) ||\r
+        (!skipRepeated && this.repeated && this.options["packed"] &&\r
+         wireType == ProtoBuf.WIRE_TYPES.LDELIM) ||\r
+        (this.map && wireType == ProtoBuf.WIRE_TYPES.LDELIM);\r
+    if (!wireTypeOK)\r
+        throw Error("Illegal wire type for field "+this.toString(true)+": "+wireType+" ("+this.type.wireType+" expected)");\r
+\r
+    // Handle packed repeated fields.\r
+    if (wireType == ProtoBuf.WIRE_TYPES.LDELIM && this.repeated && this.options["packed"] && ProtoBuf.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {\r
+        if (!skipRepeated) {\r
+            nBytes = buffer.readVarint32();\r
+            nBytes = buffer.offset + nBytes; // Limit\r
+            var values = [];\r
+            while (buffer.offset < nBytes)\r
+                values.push(this.decode(this.type.wireType, buffer, true));\r
+            return values;\r
+        }\r
+        // Read the next value otherwise...\r
+    }\r
+\r
+    // Handle maps.\r
+    if (this.map) {\r
+        // Read one (key, value) submessage, and return [key, value]\r
+        var key = Element.defaultFieldValue(this.keyType);\r
+        value = Element.defaultFieldValue(this.type);\r
+\r
+        // Read the length\r
+        nBytes = buffer.readVarint32();\r
+        if (buffer.remaining() < nBytes)\r
+            throw Error("Illegal number of bytes for "+this.toString(true)+": "+nBytes+" required but got only "+buffer.remaining());\r
+\r
+        // Get a sub-buffer of this key/value submessage\r
+        var msgbuf = buffer.clone();\r
+        msgbuf.limit = msgbuf.offset + nBytes;\r
+        buffer.offset += nBytes;\r
+\r
+        while (msgbuf.remaining() > 0) {\r
+            var tag = msgbuf.readVarint32();\r
+            wireType = tag & 0x07;\r
+            var id = tag >>> 3;\r
+            if (id === 1) {\r
+                key = this.keyElement.decode(msgbuf, wireType, id);\r
+            } else if (id === 2) {\r
+                value = this.element.decode(msgbuf, wireType, id);\r
+            } else {\r
+                throw Error("Unexpected tag in map field key/value submessage");\r
+            }\r
+        }\r
+\r
+        return [key, value];\r
+    }\r
+\r
+    // Handle singular and non-packed repeated field values.\r
+    return this.element.decode(buffer, wireType, this.id);\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/OneOf.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Message/OneOf.js
new file mode 100644 (file)
index 0000000..07a896f
--- /dev/null
@@ -0,0 +1,19 @@
+/**\r
+ * Constructs a new Message OneOf.\r
+ * @exports ProtoBuf.Reflect.Message.OneOf\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Message} message Message reference\r
+ * @param {string} name OneOf name\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var OneOf = function(builder, message, name) {\r
+    T.call(this, builder, message, name);\r
+\r
+    /**\r
+     * Enclosed fields.\r
+     * @type {!Array.<!ProtoBuf.Reflect.Message.Field>}\r
+     * @expose\r
+     */\r
+    this.fields = [];\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Namespace.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Namespace.js
new file mode 100644 (file)
index 0000000..b5c96c9
--- /dev/null
@@ -0,0 +1,203 @@
+/**\r
+ * Constructs a new Namespace.\r
+ * @exports ProtoBuf.Reflect.Namespace\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {?ProtoBuf.Reflect.Namespace} parent Namespace parent\r
+ * @param {string} name Namespace name\r
+ * @param {Object.<string,*>=} options Namespace options\r
+ * @param {string?} syntax The syntax level of this definition (e.g., proto3)\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Namespace = function(builder, parent, name, options, syntax) {\r
+    T.call(this, builder, parent, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Namespace";\r
+\r
+    /**\r
+     * Children inside the namespace.\r
+     * @type {!Array.<ProtoBuf.Reflect.T>}\r
+     */\r
+    this.children = [];\r
+\r
+    /**\r
+     * Options.\r
+     * @type {!Object.<string, *>}\r
+     */\r
+    this.options = options || {};\r
+\r
+    /**\r
+     * Syntax level (e.g., proto2 or proto3).\r
+     * @type {!string}\r
+     */\r
+    this.syntax = syntax || "proto2";\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Namespace.prototype\r
+ * @inner\r
+ */\r
+var NamespacePrototype = Namespace.prototype = Object.create(T.prototype);\r
+\r
+/**\r
+ * Returns an array of the namespace's children.\r
+ * @param {ProtoBuf.Reflect.T=} type Filter type (returns instances of this type only). Defaults to null (all children).\r
+ * @return {Array.<ProtoBuf.Reflect.T>}\r
+ * @expose\r
+ */\r
+NamespacePrototype.getChildren = function(type) {\r
+    type = type || null;\r
+    if (type == null)\r
+        return this.children.slice();\r
+    var children = [];\r
+    for (var i=0, k=this.children.length; i<k; ++i)\r
+        if (this.children[i] instanceof type)\r
+            children.push(this.children[i]);\r
+    return children;\r
+};\r
+\r
+/**\r
+ * Adds a child to the namespace.\r
+ * @param {ProtoBuf.Reflect.T} child Child\r
+ * @throws {Error} If the child cannot be added (duplicate)\r
+ * @expose\r
+ */\r
+NamespacePrototype.addChild = function(child) {\r
+    var other;\r
+    if (other = this.getChild(child.name)) {\r
+        // Try to revert camelcase transformation on collision\r
+        if (other instanceof Message.Field && other.name !== other.originalName && this.getChild(other.originalName) === null)\r
+            other.name = other.originalName; // Revert previous first (effectively keeps both originals)\r
+        else if (child instanceof Message.Field && child.name !== child.originalName && this.getChild(child.originalName) === null)\r
+            child.name = child.originalName;\r
+        else\r
+            throw Error("Duplicate name in namespace "+this.toString(true)+": "+child.name);\r
+    }\r
+    this.children.push(child);\r
+};\r
+\r
+/**\r
+ * Gets a child by its name or id.\r
+ * @param {string|number} nameOrId Child name or id\r
+ * @return {?ProtoBuf.Reflect.T} The child or null if not found\r
+ * @expose\r
+ */\r
+NamespacePrototype.getChild = function(nameOrId) {\r
+    var key = typeof nameOrId === 'number' ? 'id' : 'name';\r
+    for (var i=0, k=this.children.length; i<k; ++i)\r
+        if (this.children[i][key] === nameOrId)\r
+            return this.children[i];\r
+    return null;\r
+};\r
+\r
+/**\r
+ * Resolves a reflect object inside of this namespace.\r
+ * @param {string|!Array.<string>} qn Qualified name to resolve\r
+ * @param {boolean=} excludeNonNamespace Excludes non-namespace types, defaults to `false`\r
+ * @return {?ProtoBuf.Reflect.Namespace} The resolved type or null if not found\r
+ * @expose\r
+ */\r
+NamespacePrototype.resolve = function(qn, excludeNonNamespace) {\r
+    var part = typeof qn === 'string' ? qn.split(".") : qn,\r
+        ptr = this,\r
+        i = 0;\r
+    if (part[i] === "") { // Fully qualified name, e.g. ".My.Message'\r
+        while (ptr.parent !== null)\r
+            ptr = ptr.parent;\r
+        i++;\r
+    }\r
+    var child;\r
+    do {\r
+        do {\r
+            if (!(ptr instanceof Reflect.Namespace)) {\r
+                ptr = null;\r
+                break;\r
+            }\r
+            child = ptr.getChild(part[i]);\r
+            if (!child || !(child instanceof Reflect.T) || (excludeNonNamespace && !(child instanceof Reflect.Namespace))) {\r
+                ptr = null;\r
+                break;\r
+            }\r
+            ptr = child; i++;\r
+        } while (i < part.length);\r
+        if (ptr != null)\r
+            break; // Found\r
+        // Else search the parent\r
+        if (this.parent !== null)\r
+            return this.parent.resolve(qn, excludeNonNamespace);\r
+    } while (ptr != null);\r
+    return ptr;\r
+};\r
+\r
+/**\r
+ * Determines the shortest qualified name of the specified type, if any, relative to this namespace.\r
+ * @param {!ProtoBuf.Reflect.T} t Reflection type\r
+ * @returns {string} The shortest qualified name or, if there is none, the fqn\r
+ * @expose\r
+ */\r
+NamespacePrototype.qn = function(t) {\r
+    var part = [], ptr = t;\r
+    do {\r
+        part.unshift(ptr.name);\r
+        ptr = ptr.parent;\r
+    } while (ptr !== null);\r
+    for (var len=1; len <= part.length; len++) {\r
+        var qn = part.slice(part.length-len);\r
+        if (t === this.resolve(qn, t instanceof Reflect.Namespace))\r
+            return qn.join(".");\r
+    }\r
+    return t.fqn();\r
+};\r
+\r
+/**\r
+ * Builds the namespace and returns the runtime counterpart.\r
+ * @return {Object.<string,Function|Object>} Runtime namespace\r
+ * @expose\r
+ */\r
+NamespacePrototype.build = function() {\r
+    /** @dict */\r
+    var ns = {};\r
+    var children = this.children;\r
+    for (var i=0, k=children.length, child; i<k; ++i) {\r
+        child = children[i];\r
+        if (child instanceof Namespace)\r
+            ns[child.name] = child.build();\r
+    }\r
+    if (Object.defineProperty)\r
+        Object.defineProperty(ns, "$options", { "value": this.buildOpt() });\r
+    return ns;\r
+};\r
+\r
+/**\r
+ * Builds the namespace's '$options' property.\r
+ * @return {Object.<string,*>}\r
+ */\r
+NamespacePrototype.buildOpt = function() {\r
+    var opt = {},\r
+        keys = Object.keys(this.options);\r
+    for (var i=0, k=keys.length; i<k; ++i) {\r
+        var key = keys[i],\r
+            val = this.options[keys[i]];\r
+        // TODO: Options are not resolved, yet.\r
+        // if (val instanceof Namespace) {\r
+        //     opt[key] = val.build();\r
+        // } else {\r
+        opt[key] = val;\r
+        // }\r
+    }\r
+    return opt;\r
+};\r
+\r
+/**\r
+ * Gets the value assigned to the option with the specified name.\r
+ * @param {string=} name Returns the option value if specified, otherwise all options are returned.\r
+ * @return {*|Object.<string,*>}null} Option value or NULL if there is no such option\r
+ */\r
+NamespacePrototype.getOption = function(name) {\r
+    if (typeof name === 'undefined')\r
+        return this.options;\r
+    return typeof this.options[name] !== 'undefined' ? this.options[name] : null;\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service.js
new file mode 100644 (file)
index 0000000..025df11
--- /dev/null
@@ -0,0 +1,52 @@
+/**\r
+ * Constructs a new Service.\r
+ * @exports ProtoBuf.Reflect.Service\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Namespace} root Root\r
+ * @param {string} name Service name\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Namespace\r
+ */\r
+var Service = function(builder, root, name, options) {\r
+    Namespace.call(this, builder, root, name, options);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service";\r
+\r
+    /**\r
+     * Built runtime service class.\r
+     * @type {?function(new:ProtoBuf.Builder.Service)}\r
+     */\r
+    this.clazz = null;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Service.prototype\r
+ * @inner\r
+ */\r
+var ServicePrototype = Service.prototype = Object.create(Namespace.prototype);\r
+\r
+/**\r
+ * Builds the service and returns the runtime counterpart, which is a fully functional class.\r
+ * @see ProtoBuf.Builder.Service\r
+ * @param {boolean=} rebuild Whether to rebuild or not\r
+ * @return {Function} Service class\r
+ * @throws {Error} If the message cannot be built\r
+ * @expose\r
+ */\r
+ServicePrototype.build = function(rebuild) {\r
+    if (this.clazz && !rebuild)\r
+        return this.clazz;\r
+\r
+    // Create the runtime Service class in its own scope\r
+    return this.clazz = (function(ProtoBuf, T) {\r
+\r
+        //? include("../Builder/Service.js");\r
+\r
+        return Service;\r
+\r
+    })(ProtoBuf, this);\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/Method.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/Method.js
new file mode 100644 (file)
index 0000000..9d56ef6
--- /dev/null
@@ -0,0 +1,39 @@
+/**\r
+ * Abstract service method.\r
+ * @exports ProtoBuf.Reflect.Service.Method\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Service} svc Service\r
+ * @param {string} name Method name\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.T\r
+ */\r
+var Method = function(builder, svc, name, options) {\r
+    T.call(this, builder, svc, name);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service.Method";\r
+\r
+    /**\r
+     * Options.\r
+     * @type {Object.<string, *>}\r
+     * @expose\r
+     */\r
+    this.options = options || {};\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.Service.Method.prototype\r
+ * @inner\r
+ */\r
+var MethodPrototype = Method.prototype = Object.create(T.prototype);\r
+\r
+/**\r
+ * Builds the method's '$options' property.\r
+ * @name ProtoBuf.Reflect.Service.Method#buildOpt\r
+ * @function\r
+ * @return {Object.<string,*>}\r
+ */\r
+MethodPrototype.buildOpt = NamespacePrototype.buildOpt;\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/RPCMethod.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/Service/RPCMethod.js
new file mode 100644 (file)
index 0000000..3c12b02
--- /dev/null
@@ -0,0 +1,67 @@
+/**\r
+ * RPC service method.\r
+ * @exports ProtoBuf.Reflect.Service.RPCMethod\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {!ProtoBuf.Reflect.Service} svc Service\r
+ * @param {string} name Method name\r
+ * @param {string} request Request message name\r
+ * @param {string} response Response message name\r
+ * @param {boolean} request_stream Whether requests are streamed\r
+ * @param {boolean} response_stream Whether responses are streamed\r
+ * @param {Object.<string,*>=} options Options\r
+ * @constructor\r
+ * @extends ProtoBuf.Reflect.Service.Method\r
+ */\r
+var RPCMethod = function(builder, svc, name, request, response, request_stream, response_stream, options) {\r
+    Method.call(this, builder, svc, name, options);\r
+\r
+    /**\r
+     * @override\r
+     */\r
+    this.className = "Service.RPCMethod";\r
+\r
+    /**\r
+     * Request message name.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.requestName = request;\r
+\r
+    /**\r
+     * Response message name.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.responseName = response;\r
+\r
+    /**\r
+     * Whether requests are streamed\r
+     * @type {bool}\r
+     * @expose\r
+     */\r
+    this.requestStream = request_stream;\r
+\r
+    /**\r
+     * Whether responses are streamed\r
+     * @type {bool}\r
+     * @expose\r
+     */\r
+    this.responseStream = response_stream;\r
+\r
+    /**\r
+     * Resolved request message type.\r
+     * @type {ProtoBuf.Reflect.Message}\r
+     * @expose\r
+     */\r
+    this.resolvedRequestType = null;\r
+\r
+    /**\r
+     * Resolved response message type.\r
+     * @type {ProtoBuf.Reflect.Message}\r
+     * @expose\r
+     */\r
+    this.resolvedResponseType = null;\r
+};\r
+\r
+// Extends Method\r
+RPCMethod.prototype = Object.create(Method.prototype);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/T.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Reflect/T.js
new file mode 100644 (file)
index 0000000..12d2b13
--- /dev/null
@@ -0,0 +1,81 @@
+/**\r
+ * Constructs a Reflect base class.\r
+ * @exports ProtoBuf.Reflect.T\r
+ * @constructor\r
+ * @abstract\r
+ * @param {!ProtoBuf.Builder} builder Builder reference\r
+ * @param {?ProtoBuf.Reflect.T} parent Parent object\r
+ * @param {string} name Object name\r
+ */\r
+var T = function(builder, parent, name) {\r
+\r
+    /**\r
+     * Builder reference.\r
+     * @type {!ProtoBuf.Builder}\r
+     * @expose\r
+     */\r
+    this.builder = builder;\r
+\r
+    /**\r
+     * Parent object.\r
+     * @type {?ProtoBuf.Reflect.T}\r
+     * @expose\r
+     */\r
+    this.parent = parent;\r
+\r
+    /**\r
+     * Object name in namespace.\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.name = name;\r
+\r
+    /**\r
+     * Fully qualified class name\r
+     * @type {string}\r
+     * @expose\r
+     */\r
+    this.className;\r
+};\r
+\r
+/**\r
+ * @alias ProtoBuf.Reflect.T.prototype\r
+ * @inner\r
+ */\r
+var TPrototype = T.prototype;\r
+\r
+/**\r
+ * Returns the fully qualified name of this object.\r
+ * @returns {string} Fully qualified name as of ".PATH.TO.THIS"\r
+ * @expose\r
+ */\r
+TPrototype.fqn = function() {\r
+    var name = this.name,\r
+        ptr = this;\r
+    do {\r
+        ptr = ptr.parent;\r
+        if (ptr == null)\r
+            break;\r
+        name = ptr.name+"."+name;\r
+    } while (true);\r
+    return name;\r
+};\r
+\r
+/**\r
+ * Returns a string representation of this Reflect object (its fully qualified name).\r
+ * @param {boolean=} includeClass Set to true to include the class name. Defaults to false.\r
+ * @return String representation\r
+ * @expose\r
+ */\r
+TPrototype.toString = function(includeClass) {\r
+    return (includeClass ? this.className + " " : "") + this.fqn();\r
+};\r
+\r
+/**\r
+ * Builds this type.\r
+ * @throws {Error} If this type cannot be built directly\r
+ * @expose\r
+ */\r
+TPrototype.build = function() {\r
+    throw Error(this.toString(true)+" cannot be built directly");\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Util.js b/legacy-libs/grpc/node_modules/protobufjs/src/ProtoBuf/Util.js
new file mode 100644 (file)
index 0000000..d8dc06e
--- /dev/null
@@ -0,0 +1,116 @@
+/**\r
+ * @alias ProtoBuf.Util\r
+ * @expose\r
+ */\r
+ProtoBuf.Util = (function() {\r
+    "use strict";\r
+\r
+    /**\r
+     * ProtoBuf utilities.\r
+     * @exports ProtoBuf.Util\r
+     * @namespace\r
+     */\r
+    var Util = {};\r
+\r
+    /**\r
+     * Flag if running in node or not.\r
+     * @type {boolean}\r
+     * @const\r
+     * @expose\r
+     */\r
+    Util.IS_NODE = !!(\r
+        typeof process === 'object' && process+'' === '[object process]' && !process['browser']\r
+    );\r
+\r
+    /**\r
+     * Constructs a XMLHttpRequest object.\r
+     * @return {XMLHttpRequest}\r
+     * @throws {Error} If XMLHttpRequest is not supported\r
+     * @expose\r
+     */\r
+    Util.XHR = function() {\r
+        // No dependencies please, ref: http://www.quirksmode.org/js/xmlhttp.html\r
+        var XMLHttpFactories = [\r
+            function () {return new XMLHttpRequest()},\r
+            function () {return new ActiveXObject("Msxml2.XMLHTTP")},\r
+            function () {return new ActiveXObject("Msxml3.XMLHTTP")},\r
+            function () {return new ActiveXObject("Microsoft.XMLHTTP")}\r
+        ];\r
+        /** @type {?XMLHttpRequest} */\r
+        var xhr = null;\r
+        for (var i=0;i<XMLHttpFactories.length;i++) {\r
+            try { xhr = XMLHttpFactories[i](); }\r
+            catch (e) { continue; }\r
+            break;\r
+        }\r
+        if (!xhr)\r
+            throw Error("XMLHttpRequest is not supported");\r
+        return xhr;\r
+    };\r
+\r
+    /**\r
+     * Fetches a resource.\r
+     * @param {string} path Resource path\r
+     * @param {function(?string)=} callback Callback receiving the resource's contents. If omitted the resource will\r
+     *   be fetched synchronously. If the request failed, contents will be null.\r
+     * @return {?string|undefined} Resource contents if callback is omitted (null if the request failed), else undefined.\r
+     * @expose\r
+     */\r
+    Util.fetch = function(path, callback) {\r
+        if (callback && typeof callback != 'function')\r
+            callback = null;\r
+        if (Util.IS_NODE) {\r
+            var fs = require("fs");\r
+            if (callback) {\r
+                fs.readFile(path, function(err, data) {\r
+                    if (err)\r
+                        callback(null);\r
+                    else\r
+                        callback(""+data);\r
+                });\r
+            } else\r
+                try {\r
+                    return fs.readFileSync(path);\r
+                } catch (e) {\r
+                    return null;\r
+                }\r
+        } else {\r
+            var xhr = Util.XHR();\r
+            xhr.open('GET', path, callback ? true : false);\r
+            // xhr.setRequestHeader('User-Agent', 'XMLHTTP/1.0');\r
+            xhr.setRequestHeader('Accept', 'text/plain');\r
+            if (typeof xhr.overrideMimeType === 'function') xhr.overrideMimeType('text/plain');\r
+            if (callback) {\r
+                xhr.onreadystatechange = function() {\r
+                    if (xhr.readyState != 4) return;\r
+                    if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 && typeof xhr.responseText === 'string'))\r
+                        callback(xhr.responseText);\r
+                    else\r
+                        callback(null);\r
+                };\r
+                if (xhr.readyState == 4)\r
+                    return;\r
+                xhr.send(null);\r
+            } else {\r
+                xhr.send(null);\r
+                if (/* remote */ xhr.status == 200 || /* local */ (xhr.status == 0 && typeof xhr.responseText === 'string'))\r
+                    return xhr.responseText;\r
+                return null;\r
+            }\r
+        }\r
+    };\r
+\r
+    /**\r
+     * Converts a string to camel case.\r
+     * @param {string} str\r
+     * @returns {string}\r
+     * @expose\r
+     */\r
+    Util.toCamelCase = function(str) {\r
+        return str.replace(/_([a-zA-Z])/g, function ($0, $1) {\r
+            return $1.toUpperCase();\r
+        });\r
+    };\r
+    \r
+    return Util;\r
+})();\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/bower.json.in b/legacy-libs/grpc/node_modules/protobufjs/src/bower.json.in
new file mode 100644 (file)
index 0000000..11e30fb
--- /dev/null
@@ -0,0 +1,19 @@
+{\r
+    "name": "protobuf",\r
+    "description": "Protocol Buffers for JavaScript. Finally.",\r
+    "version": /*?== VERSION */,\r
+    "main": "dist/protobuf.js",\r
+    "license": "Apache-2.0",\r
+    "homepage": "http://dcode.io/",\r
+    "dependencies": {\r
+        "bytebuffer": "~5"\r
+    },\r
+    "keywords": ["net", "buffer", "protobuf", "serialization", "bytebuffer", "websocket", "webrtc"],\r
+    "ignore": [\r
+        "**/.*",\r
+        "node_modules",\r
+        "bower_components",\r
+        "test",\r
+        "tests"\r
+    ]\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/es5.js b/legacy-libs/grpc/node_modules/protobufjs/src/es5.js
new file mode 100644 (file)
index 0000000..83b4c71
--- /dev/null
@@ -0,0 +1,43 @@
+// Starting with ProtoBuf.js 4.X we are no longer bundling any ES5 polyfills with the library.\r
+// It is now up to the user to provide these as needed. For reference, this is what we use:\r
+\r
+// ref: https://developer.mozilla.org/de/docs/JavaScript/Reference/Global_Objects/Object/create\r
+if (!Object.create)\r
+    /** @expose */\r
+    Object.create = function (o) {\r
+        if (arguments.length > 1)\r
+            throw Error('illegal number of arguments');\r
+        function F() {}\r
+        F.prototype = o;\r
+        return new F();\r
+    };\r
+\r
+// ref: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\r
+if (!Array.isArray)\r
+    /** @expose */\r
+    Array.isArray = function(o) {\r
+        return Object.prototype.toString.call(o) === "[object Array]";\r
+    };\r
+\r
+// ref: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\r
+if (!Array.prototype.forEach)\r
+    /** @expose */\r
+    Array.prototype.forEach = function(callback, thisArg) {\r
+        var T, k;\r
+        if (this == null)\r
+            throw new TypeError('this is null or not defined');\r
+        var O = Object(this);\r
+        var len = O.length >>> 0;\r
+        if (typeof callback !== "function")\r
+            throw new TypeError(callback + ' is not a function');\r
+        if (arguments.length > 1)\r
+            T = thisArg;\r
+        k = 0;\r
+        while (k < len) {\r
+            var kValue;\r
+            if (k in O)\r
+                kValue = O[k],\r
+                callback.call(T, kValue, k, O);\r
+            k++;\r
+        }\r
+    };\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/README.md b/legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/README.md
new file mode 100644 (file)
index 0000000..9f0c426
--- /dev/null
@@ -0,0 +1,13 @@
+These files are by default not used by ProtoBuf.js and are here for the purpose of completeness. The library does not\r
+need and therefore does not use these files by design. In most use cases including the descriptor isn't even required\r
+and would just add about 10KB (minified JSON) to your application.\r
+\r
+### Though it's possible to include them:\r
+\r
+1. You may explicitly reference them by providing a relative or absolute path in your .proto files. E.g. use\r
+   `./google/protobuf/descriptor.proto` and bundle the file with your application.\r
+   \r
+2. If you use the `proto2js` command line utility with the `-legacy` option and the descriptor namespace is explicitly\r
+   referenced, it is included in the generated output.\r
+\r
+You are then able to work with it as if it'd be no more and no less than a standard import.\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/descriptor.json b/legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/descriptor.json
new file mode 100644 (file)
index 0000000..2cb3cc1
--- /dev/null
@@ -0,0 +1,849 @@
+{
+    "package": "google.protobuf",
+    "syntax": "proto2",
+    "options": {
+        "java_package": "com.google.protobuf",
+        "java_outer_classname": "DescriptorProtos",
+        "optimize_for": "SPEED"
+    },
+    "messages": [
+        {
+            "name": "FileDescriptorSet",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "FileDescriptorProto",
+                    "name": "file",
+                    "id": 1
+                }
+            ]
+        },
+        {
+            "name": "FileDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "package",
+                    "id": 2
+                },
+                {
+                    "rule": "repeated",
+                    "type": "string",
+                    "name": "dependency",
+                    "id": 3
+                },
+                {
+                    "rule": "repeated",
+                    "type": "int32",
+                    "name": "public_dependency",
+                    "id": 10
+                },
+                {
+                    "rule": "repeated",
+                    "type": "int32",
+                    "name": "weak_dependency",
+                    "id": 11
+                },
+                {
+                    "rule": "repeated",
+                    "type": "DescriptorProto",
+                    "name": "message_type",
+                    "id": 4
+                },
+                {
+                    "rule": "repeated",
+                    "type": "EnumDescriptorProto",
+                    "name": "enum_type",
+                    "id": 5
+                },
+                {
+                    "rule": "repeated",
+                    "type": "ServiceDescriptorProto",
+                    "name": "service",
+                    "id": 6
+                },
+                {
+                    "rule": "repeated",
+                    "type": "FieldDescriptorProto",
+                    "name": "extension",
+                    "id": 7
+                },
+                {
+                    "rule": "optional",
+                    "type": "FileOptions",
+                    "name": "options",
+                    "id": 8
+                },
+                {
+                    "rule": "optional",
+                    "type": "SourceCodeInfo",
+                    "name": "source_code_info",
+                    "id": 9
+                }
+            ]
+        },
+        {
+            "name": "DescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "repeated",
+                    "type": "FieldDescriptorProto",
+                    "name": "field",
+                    "id": 2
+                },
+                {
+                    "rule": "repeated",
+                    "type": "FieldDescriptorProto",
+                    "name": "extension",
+                    "id": 6
+                },
+                {
+                    "rule": "repeated",
+                    "type": "DescriptorProto",
+                    "name": "nested_type",
+                    "id": 3
+                },
+                {
+                    "rule": "repeated",
+                    "type": "EnumDescriptorProto",
+                    "name": "enum_type",
+                    "id": 4
+                },
+                {
+                    "rule": "repeated",
+                    "type": "ExtensionRange",
+                    "name": "extension_range",
+                    "id": 5
+                },
+                {
+                    "rule": "optional",
+                    "type": "MessageOptions",
+                    "name": "options",
+                    "id": 7
+                }
+            ],
+            "messages": [
+                {
+                    "name": "ExtensionRange",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "optional",
+                            "type": "int32",
+                            "name": "start",
+                            "id": 1
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "int32",
+                            "name": "end",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "FieldDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "int32",
+                    "name": "number",
+                    "id": 3
+                },
+                {
+                    "rule": "optional",
+                    "type": "Label",
+                    "name": "label",
+                    "id": 4
+                },
+                {
+                    "rule": "optional",
+                    "type": "Type",
+                    "name": "type",
+                    "id": 5
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "type_name",
+                    "id": 6
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "extendee",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "default_value",
+                    "id": 7
+                },
+                {
+                    "rule": "optional",
+                    "type": "FieldOptions",
+                    "name": "options",
+                    "id": 8
+                }
+            ],
+            "enums": [
+                {
+                    "name": "Type",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "TYPE_DOUBLE",
+                            "id": 1
+                        },
+                        {
+                            "name": "TYPE_FLOAT",
+                            "id": 2
+                        },
+                        {
+                            "name": "TYPE_INT64",
+                            "id": 3
+                        },
+                        {
+                            "name": "TYPE_UINT64",
+                            "id": 4
+                        },
+                        {
+                            "name": "TYPE_INT32",
+                            "id": 5
+                        },
+                        {
+                            "name": "TYPE_FIXED64",
+                            "id": 6
+                        },
+                        {
+                            "name": "TYPE_FIXED32",
+                            "id": 7
+                        },
+                        {
+                            "name": "TYPE_BOOL",
+                            "id": 8
+                        },
+                        {
+                            "name": "TYPE_STRING",
+                            "id": 9
+                        },
+                        {
+                            "name": "TYPE_GROUP",
+                            "id": 10
+                        },
+                        {
+                            "name": "TYPE_MESSAGE",
+                            "id": 11
+                        },
+                        {
+                            "name": "TYPE_BYTES",
+                            "id": 12
+                        },
+                        {
+                            "name": "TYPE_UINT32",
+                            "id": 13
+                        },
+                        {
+                            "name": "TYPE_ENUM",
+                            "id": 14
+                        },
+                        {
+                            "name": "TYPE_SFIXED32",
+                            "id": 15
+                        },
+                        {
+                            "name": "TYPE_SFIXED64",
+                            "id": 16
+                        },
+                        {
+                            "name": "TYPE_SINT32",
+                            "id": 17
+                        },
+                        {
+                            "name": "TYPE_SINT64",
+                            "id": 18
+                        }
+                    ]
+                },
+                {
+                    "name": "Label",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "LABEL_OPTIONAL",
+                            "id": 1
+                        },
+                        {
+                            "name": "LABEL_REQUIRED",
+                            "id": 2
+                        },
+                        {
+                            "name": "LABEL_REPEATED",
+                            "id": 3
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "EnumDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "repeated",
+                    "type": "EnumValueDescriptorProto",
+                    "name": "value",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "EnumOptions",
+                    "name": "options",
+                    "id": 3
+                }
+            ]
+        },
+        {
+            "name": "EnumValueDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "int32",
+                    "name": "number",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "EnumValueOptions",
+                    "name": "options",
+                    "id": 3
+                }
+            ]
+        },
+        {
+            "name": "ServiceDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "repeated",
+                    "type": "MethodDescriptorProto",
+                    "name": "method",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "ServiceOptions",
+                    "name": "options",
+                    "id": 3
+                }
+            ]
+        },
+        {
+            "name": "MethodDescriptorProto",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "name",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "input_type",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "output_type",
+                    "id": 3
+                },
+                {
+                    "rule": "optional",
+                    "type": "MethodOptions",
+                    "name": "options",
+                    "id": 4
+                }
+            ]
+        },
+        {
+            "name": "FileOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "java_package",
+                    "id": 1
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "java_outer_classname",
+                    "id": 8
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "java_multiple_files",
+                    "id": 10,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "java_generate_equals_and_hash",
+                    "id": 20,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "OptimizeMode",
+                    "name": "optimize_for",
+                    "id": 9,
+                    "options": {
+                        "default": "SPEED"
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "go_package",
+                    "id": 11
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "cc_generic_services",
+                    "id": 16,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "java_generic_services",
+                    "id": 17,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "py_generic_services",
+                    "id": 18,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ],
+            "enums": [
+                {
+                    "name": "OptimizeMode",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "SPEED",
+                            "id": 1
+                        },
+                        {
+                            "name": "CODE_SIZE",
+                            "id": 2
+                        },
+                        {
+                            "name": "LITE_RUNTIME",
+                            "id": 3
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "MessageOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "message_set_wire_format",
+                    "id": 1,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "no_standard_descriptor_accessor",
+                    "id": 2,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "FieldOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "CType",
+                    "name": "ctype",
+                    "id": 1,
+                    "options": {
+                        "default": "STRING"
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "packed",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "lazy",
+                    "id": 5,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "deprecated",
+                    "id": 3,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "experimental_map_key",
+                    "id": 9
+                },
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "weak",
+                    "id": 10,
+                    "options": {
+                        "default": false
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ],
+            "enums": [
+                {
+                    "name": "CType",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "STRING",
+                            "id": 0
+                        },
+                        {
+                            "name": "CORD",
+                            "id": 1
+                        },
+                        {
+                            "name": "STRING_PIECE",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "EnumOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "optional",
+                    "type": "bool",
+                    "name": "allow_alias",
+                    "id": 2,
+                    "options": {
+                        "default": true
+                    }
+                },
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "EnumValueOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "ServiceOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "MethodOptions",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "UninterpretedOption",
+                    "name": "uninterpreted_option",
+                    "id": 999
+                }
+            ],
+            "extensions": [
+                [
+                    1000,
+                    536870911
+                ]
+            ]
+        },
+        {
+            "name": "UninterpretedOption",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "NamePart",
+                    "name": "name",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "identifier_value",
+                    "id": 3
+                },
+                {
+                    "rule": "optional",
+                    "type": "uint64",
+                    "name": "positive_int_value",
+                    "id": 4
+                },
+                {
+                    "rule": "optional",
+                    "type": "int64",
+                    "name": "negative_int_value",
+                    "id": 5
+                },
+                {
+                    "rule": "optional",
+                    "type": "double",
+                    "name": "double_value",
+                    "id": 6
+                },
+                {
+                    "rule": "optional",
+                    "type": "bytes",
+                    "name": "string_value",
+                    "id": 7
+                },
+                {
+                    "rule": "optional",
+                    "type": "string",
+                    "name": "aggregate_value",
+                    "id": 8
+                }
+            ],
+            "messages": [
+                {
+                    "name": "NamePart",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "required",
+                            "type": "string",
+                            "name": "name_part",
+                            "id": 1
+                        },
+                        {
+                            "rule": "required",
+                            "type": "bool",
+                            "name": "is_extension",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "name": "SourceCodeInfo",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "repeated",
+                    "type": "Location",
+                    "name": "location",
+                    "id": 1
+                }
+            ],
+            "messages": [
+                {
+                    "name": "Location",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "repeated",
+                            "type": "int32",
+                            "name": "path",
+                            "id": 1,
+                            "options": {
+                                "packed": true
+                            }
+                        },
+                        {
+                            "rule": "repeated",
+                            "type": "int32",
+                            "name": "span",
+                            "id": 2,
+                            "options": {
+                                "packed": true
+                            }
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "string",
+                            "name": "leading_comments",
+                            "id": 3
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "string",
+                            "name": "trailing_comments",
+                            "id": 4
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "isNamespace": true
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/descriptor.proto b/legacy-libs/grpc/node_modules/protobufjs/src/google/protobuf/descriptor.proto
new file mode 100644 (file)
index 0000000..83fe2e1
--- /dev/null
@@ -0,0 +1,620 @@
+// Protocol Buffers - Google's data interchange format\r
+// Copyright 2008 Google Inc.  All rights reserved.\r
+// http://code.google.com/p/protobuf/\r
+//\r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are\r
+// met:\r
+//\r
+//     * Redistributions of source code must retain the above copyright\r
+// notice, this list of conditions and the following disclaimer.\r
+//     * Redistributions in binary form must reproduce the above\r
+// copyright notice, this list of conditions and the following disclaimer\r
+// in the documentation and/or other materials provided with the\r
+// distribution.\r
+//     * Neither the name of Google Inc. nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+//\r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+// Author: kenton@google.com (Kenton Varda)\r
+//  Based on original Protocol Buffers design by\r
+//  Sanjay Ghemawat, Jeff Dean, and others.\r
+//\r
+// The messages in this file describe the definitions found in .proto files.\r
+// A valid .proto file can be translated directly to a FileDescriptorProto\r
+// without any other information (e.g. without reading its imports).\r
+\r
+\r
+\r
+package google.protobuf;\r
+option java_package = "com.google.protobuf";\r
+option java_outer_classname = "DescriptorProtos";\r
+\r
+// descriptor.proto must be optimized for speed because reflection-based\r
+// algorithms don't work during bootstrapping.\r
+option optimize_for = SPEED;\r
+\r
+// The protocol compiler can output a FileDescriptorSet containing the .proto\r
+// files it parses.\r
+message FileDescriptorSet {\r
+  repeated FileDescriptorProto file = 1;\r
+}\r
+\r
+// Describes a complete .proto file.\r
+message FileDescriptorProto {\r
+  optional string name = 1;       // file name, relative to root of source tree\r
+  optional string package = 2;    // e.g. "foo", "foo.bar", etc.\r
+\r
+  // Names of files imported by this file.\r
+  repeated string dependency = 3;\r
+  // Indexes of the public imported files in the dependency list above.\r
+  repeated int32 public_dependency = 10;\r
+  // Indexes of the weak imported files in the dependency list.\r
+  // For Google-internal migration only. Do not use.\r
+  repeated int32 weak_dependency = 11;\r
+\r
+  // All top-level definitions in this file.\r
+  repeated DescriptorProto message_type = 4;\r
+  repeated EnumDescriptorProto enum_type = 5;\r
+  repeated ServiceDescriptorProto service = 6;\r
+  repeated FieldDescriptorProto extension = 7;\r
+\r
+  optional FileOptions options = 8;\r
+\r
+  // This field contains optional information about the original source code.\r
+  // You may safely remove this entire field whithout harming runtime\r
+  // functionality of the descriptors -- the information is needed only by\r
+  // development tools.\r
+  optional SourceCodeInfo source_code_info = 9;\r
+}\r
+\r
+// Describes a message type.\r
+message DescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated FieldDescriptorProto field = 2;\r
+  repeated FieldDescriptorProto extension = 6;\r
+\r
+  repeated DescriptorProto nested_type = 3;\r
+  repeated EnumDescriptorProto enum_type = 4;\r
+\r
+  message ExtensionRange {\r
+    optional int32 start = 1;\r
+    optional int32 end = 2;\r
+  }\r
+  repeated ExtensionRange extension_range = 5;\r
+\r
+  optional MessageOptions options = 7;\r
+}\r
+\r
+// Describes a field within a message.\r
+message FieldDescriptorProto {\r
+  enum Type {\r
+    // 0 is reserved for errors.\r
+    // Order is weird for historical reasons.\r
+    TYPE_DOUBLE         = 1;\r
+    TYPE_FLOAT          = 2;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\r
+    // negative values are likely.\r
+    TYPE_INT64          = 3;\r
+    TYPE_UINT64         = 4;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\r
+    // negative values are likely.\r
+    TYPE_INT32          = 5;\r
+    TYPE_FIXED64        = 6;\r
+    TYPE_FIXED32        = 7;\r
+    TYPE_BOOL           = 8;\r
+    TYPE_STRING         = 9;\r
+    TYPE_GROUP          = 10;  // Tag-delimited aggregate.\r
+    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.\r
+\r
+    // New in version 2.\r
+    TYPE_BYTES          = 12;\r
+    TYPE_UINT32         = 13;\r
+    TYPE_ENUM           = 14;\r
+    TYPE_SFIXED32       = 15;\r
+    TYPE_SFIXED64       = 16;\r
+    TYPE_SINT32         = 17;  // Uses ZigZag encoding.\r
+    TYPE_SINT64         = 18;  // Uses ZigZag encoding.\r
+  };\r
+\r
+  enum Label {\r
+    // 0 is reserved for errors\r
+    LABEL_OPTIONAL      = 1;\r
+    LABEL_REQUIRED      = 2;\r
+    LABEL_REPEATED      = 3;\r
+    // TODO(sanjay): Should we add LABEL_MAP?\r
+  };\r
+\r
+  optional string name = 1;\r
+  optional int32 number = 3;\r
+  optional Label label = 4;\r
+\r
+  // If type_name is set, this need not be set.  If both this and type_name\r
+  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.\r
+  optional Type type = 5;\r
+\r
+  // For message and enum types, this is the name of the type.  If the name\r
+  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\r
+  // rules are used to find the type (i.e. first the nested types within this\r
+  // message are searched, then within the parent, on up to the root\r
+  // namespace).\r
+  optional string type_name = 6;\r
+\r
+  // For extensions, this is the name of the type being extended.  It is\r
+  // resolved in the same manner as type_name.\r
+  optional string extendee = 2;\r
+\r
+  // For numeric types, contains the original text representation of the value.\r
+  // For booleans, "true" or "false".\r
+  // For strings, contains the default text contents (not escaped in any way).\r
+  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\r
+  // TODO(kenton):  Base-64 encode?\r
+  optional string default_value = 7;\r
+\r
+  optional FieldOptions options = 8;\r
+}\r
+\r
+// Describes an enum type.\r
+message EnumDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated EnumValueDescriptorProto value = 2;\r
+\r
+  optional EnumOptions options = 3;\r
+}\r
+\r
+// Describes a value within an enum.\r
+message EnumValueDescriptorProto {\r
+  optional string name = 1;\r
+  optional int32 number = 2;\r
+\r
+  optional EnumValueOptions options = 3;\r
+}\r
+\r
+// Describes a service.\r
+message ServiceDescriptorProto {\r
+  optional string name = 1;\r
+  repeated MethodDescriptorProto method = 2;\r
+\r
+  optional ServiceOptions options = 3;\r
+}\r
+\r
+// Describes a method of a service.\r
+message MethodDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  // Input and output type names.  These are resolved in the same way as\r
+  // FieldDescriptorProto.type_name, but must refer to a message type.\r
+  optional string input_type = 2;\r
+  optional string output_type = 3;\r
+\r
+  optional MethodOptions options = 4;\r
+}\r
+\r
+\r
+// ===================================================================\r
+// Options\r
+\r
+// Each of the definitions above may have "options" attached.  These are\r
+// just annotations which may cause code to be generated slightly differently\r
+// or may contain hints for code that manipulates protocol messages.\r
+//\r
+// Clients may define custom options as extensions of the *Options messages.\r
+// These extensions may not yet be known at parsing time, so the parser cannot\r
+// store the values in them.  Instead it stores them in a field in the *Options\r
+// message called uninterpreted_option. This field must have the same name\r
+// across all *Options messages. We then use this field to populate the\r
+// extensions when we build a descriptor, at which point all protos have been\r
+// parsed and so all extensions are known.\r
+//\r
+// Extension numbers for custom options may be chosen as follows:\r
+// * For options which will only be used within a single application or\r
+//   organization, or for experimental options, use field numbers 50000\r
+//   through 99999.  It is up to you to ensure that you do not use the\r
+//   same number for multiple options.\r
+// * For options which will be published and used publicly by multiple\r
+//   independent entities, e-mail protobuf-global-extension-registry@google.com\r
+//   to reserve extension numbers. Simply provide your project name (e.g.\r
+//   Object-C plugin) and your porject website (if available) -- there's no need\r
+//   to explain how you intend to use them. Usually you only need one extension\r
+//   number. You can declare multiple options with only one extension number by\r
+//   putting them in a sub-message. See the Custom Options section of the docs\r
+//   for examples:\r
+//   http://code.google.com/apis/protocolbuffers/docs/proto.html#options\r
+//   If this turns out to be popular, a web service will be set up\r
+//   to automatically assign option numbers.\r
+\r
+\r
+message FileOptions {\r
+\r
+  // Sets the Java package where classes generated from this .proto will be\r
+  // placed.  By default, the proto package is used, but this is often\r
+  // inappropriate because proto packages do not normally start with backwards\r
+  // domain names.\r
+  optional string java_package = 1;\r
+\r
+\r
+  // If set, all the classes from the .proto file are wrapped in a single\r
+  // outer class with the given name.  This applies to both Proto1\r
+  // (equivalent to the old "--one_java_file" option) and Proto2 (where\r
+  // a .proto always translates to a single class, but you may want to\r
+  // explicitly choose the class name).\r
+  optional string java_outer_classname = 8;\r
+\r
+  // If set true, then the Java code generator will generate a separate .java\r
+  // file for each top-level message, enum, and service defined in the .proto\r
+  // file.  Thus, these types will *not* be nested inside the outer class\r
+  // named by java_outer_classname.  However, the outer class will still be\r
+  // generated to contain the file's getDescriptor() method as well as any\r
+  // top-level extensions defined in the file.\r
+  optional bool java_multiple_files = 10 [default=false];\r
+\r
+  // If set true, then the Java code generator will generate equals() and\r
+  // hashCode() methods for all messages defined in the .proto file. This is\r
+  // purely a speed optimization, as the AbstractMessage base class includes\r
+  // reflection-based implementations of these methods.\r
+  optional bool java_generate_equals_and_hash = 20 [default=false];\r
+\r
+  // Generated classes can be optimized for speed or code size.\r
+  enum OptimizeMode {\r
+    SPEED = 1;        // Generate complete code for parsing, serialization,\r
+                      // etc.\r
+    CODE_SIZE = 2;    // Use ReflectionOps to implement these methods.\r
+    LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\r
+  }\r
+  optional OptimizeMode optimize_for = 9 [default=SPEED];\r
+\r
+  // Sets the Go package where structs generated from this .proto will be\r
+  // placed.  There is no default.\r
+  optional string go_package = 11;\r
+\r
+\r
+\r
+  // Should generic services be generated in each language?  "Generic" services\r
+  // are not specific to any particular RPC system.  They are generated by the\r
+  // main code generators in each language (without additional plugins).\r
+  // Generic services were the only kind of service generation supported by\r
+  // early versions of proto2.\r
+  //\r
+  // Generic services are now considered deprecated in favor of using plugins\r
+  // that generate code specific to your particular RPC system.  Therefore,\r
+  // these default to false.  Old code which depends on generic services should\r
+  // explicitly set them to true.\r
+  optional bool cc_generic_services = 16 [default=false];\r
+  optional bool java_generic_services = 17 [default=false];\r
+  optional bool py_generic_services = 18 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MessageOptions {\r
+  // Set true to use the old proto1 MessageSet wire format for extensions.\r
+  // This is provided for backwards-compatibility with the MessageSet wire\r
+  // format.  You should not use this for any other reason:  It's less\r
+  // efficient, has fewer features, and is more complicated.\r
+  //\r
+  // The message must be defined exactly as follows:\r
+  //   message Foo {\r
+  //     option message_set_wire_format = true;\r
+  //     extensions 4 to max;\r
+  //   }\r
+  // Note that the message cannot have any defined fields; MessageSets only\r
+  // have extensions.\r
+  //\r
+  // All extensions of your type must be singular messages; e.g. they cannot\r
+  // be int32s, enums, or repeated messages.\r
+  //\r
+  // Because this is an option, the above two restrictions are not enforced by\r
+  // the protocol compiler.\r
+  optional bool message_set_wire_format = 1 [default=false];\r
+\r
+  // Disables the generation of the standard "descriptor()" accessor, which can\r
+  // conflict with a field of the same name.  This is meant to make migration\r
+  // from proto1 easier; new code should avoid fields named "descriptor".\r
+  optional bool no_standard_descriptor_accessor = 2 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message FieldOptions {\r
+  // The ctype option instructs the C++ code generator to use a different\r
+  // representation of the field than it normally would.  See the specific\r
+  // options below.  This option is not yet implemented in the open source\r
+  // release -- sorry, we'll try to include it in a future version!\r
+  optional CType ctype = 1 [default = STRING];\r
+  enum CType {\r
+    // Default mode.\r
+    STRING = 0;\r
+\r
+    CORD = 1;\r
+\r
+    STRING_PIECE = 2;\r
+  }\r
+  // The packed option can be enabled for repeated primitive fields to enable\r
+  // a more efficient representation on the wire. Rather than repeatedly\r
+  // writing the tag and type for each element, the entire array is encoded as\r
+  // a single length-delimited blob.\r
+  optional bool packed = 2;\r
+\r
+\r
+\r
+  // Should this field be parsed lazily?  Lazy applies only to message-type\r
+  // fields.  It means that when the outer message is initially parsed, the\r
+  // inner message's contents will not be parsed but instead stored in encoded\r
+  // form.  The inner message will actually be parsed when it is first accessed.\r
+  //\r
+  // This is only a hint.  Implementations are free to choose whether to use\r
+  // eager or lazy parsing regardless of the value of this option.  However,\r
+  // setting this option true suggests that the protocol author believes that\r
+  // using lazy parsing on this field is worth the additional bookkeeping\r
+  // overhead typically needed to implement it.\r
+  //\r
+  // This option does not affect the public interface of any generated code;\r
+  // all method signatures remain the same.  Furthermore, thread-safety of the\r
+  // interface is not affected by this option; const methods remain safe to\r
+  // call from multiple threads concurrently, while non-const methods continue\r
+  // to require exclusive access.\r
+  //\r
+  //\r
+  // Note that implementations may choose not to check required fields within\r
+  // a lazy sub-message.  That is, calling IsInitialized() on the outher message\r
+  // may return true even if the inner message has missing required fields.\r
+  // This is necessary because otherwise the inner message would have to be\r
+  // parsed in order to perform the check, defeating the purpose of lazy\r
+  // parsing.  An implementation which chooses not to check required fields\r
+  // must be consistent about it.  That is, for any particular sub-message, the\r
+  // implementation must either *always* check its required fields, or *never*\r
+  // check its required fields, regardless of whether or not the message has\r
+  // been parsed.\r
+  optional bool lazy = 5 [default=false];\r
+\r
+  // Is this field deprecated?\r
+  // Depending on the target platform, this can emit Deprecated annotations\r
+  // for accessors, or it will be completely ignored; in the very least, this\r
+  // is a formalization for deprecating fields.\r
+  optional bool deprecated = 3 [default=false];\r
+\r
+  // EXPERIMENTAL.  DO NOT USE.\r
+  // For "map" fields, the name of the field in the enclosed type that\r
+  // is the key for this map.  For example, suppose we have:\r
+  //   message Item {\r
+  //     required string name = 1;\r
+  //     required string value = 2;\r
+  //   }\r
+  //   message Config {\r
+  //     repeated Item items = 1 [experimental_map_key="name"];\r
+  //   }\r
+  // In this situation, the map key for Item will be set to "name".\r
+  // TODO: Fully-implement this, then remove the "experimental_" prefix.\r
+  optional string experimental_map_key = 9;\r
+\r
+  // For Google-internal migration only. Do not use.\r
+  optional bool weak = 10 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumOptions {\r
+\r
+  // Set this option to false to disallow mapping different tag names to a same\r
+  // value.\r
+  optional bool allow_alias = 2 [default=true];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumValueOptions {\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message ServiceOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MethodOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+\r
+// A message representing a option the parser does not recognize. This only\r
+// appears in options protos created by the compiler::Parser class.\r
+// DescriptorPool resolves these when building Descriptor objects. Therefore,\r
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),\r
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\r
+// in them.\r
+message UninterpretedOption {\r
+  // The name of the uninterpreted option.  Each string represents a segment in\r
+  // a dot-separated name.  is_extension is true iff a segment represents an\r
+  // extension (denoted with parentheses in options specs in .proto files).\r
+  // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents\r
+  // "foo.(bar.baz).qux".\r
+  message NamePart {\r
+    required string name_part = 1;\r
+    required bool is_extension = 2;\r
+  }\r
+  repeated NamePart name = 2;\r
+\r
+  // The value of the uninterpreted option, in whatever type the tokenizer\r
+  // identified it as during parsing. Exactly one of these should be set.\r
+  optional string identifier_value = 3;\r
+  optional uint64 positive_int_value = 4;\r
+  optional int64 negative_int_value = 5;\r
+  optional double double_value = 6;\r
+  optional bytes string_value = 7;\r
+  optional string aggregate_value = 8;\r
+}\r
+\r
+// ===================================================================\r
+// Optional source code info\r
+\r
+// Encapsulates information about the original source file from which a\r
+// FileDescriptorProto was generated.\r
+message SourceCodeInfo {\r
+  // A Location identifies a piece of source code in a .proto file which\r
+  // corresponds to a particular definition.  This information is intended\r
+  // to be useful to IDEs, code indexers, documentation generators, and similar\r
+  // tools.\r
+  //\r
+  // For example, say we have a file like:\r
+  //   message Foo {\r
+  //     optional string foo = 1;\r
+  //   }\r
+  // Let's look at just the field definition:\r
+  //   optional string foo = 1;\r
+  //   ^       ^^     ^^  ^  ^^^\r
+  //   a       bc     de  f  ghi\r
+  // We have the following locations:\r
+  //   span   path               represents\r
+  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\r
+  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\r
+  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\r
+  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\r
+  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\r
+  //\r
+  // Notes:\r
+  // - A location may refer to a repeated field itself (i.e. not to any\r
+  //   particular index within it).  This is used whenever a set of elements are\r
+  //   logically enclosed in a single code segment.  For example, an entire\r
+  //   extend block (possibly containing multiple extension definitions) will\r
+  //   have an outer location whose path refers to the "extensions" repeated\r
+  //   field without an index.\r
+  // - Multiple locations may have the same path.  This happens when a single\r
+  //   logical declaration is spread out across multiple places.  The most\r
+  //   obvious example is the "extend" block again -- there may be multiple\r
+  //   extend blocks in the same scope, each of which will have the same path.\r
+  // - A location's span is not always a subset of its parent's span.  For\r
+  //   example, the "extendee" of an extension declaration appears at the\r
+  //   beginning of the "extend" block and is shared by all extensions within\r
+  //   the block.\r
+  // - Just because a location's span is a subset of some other location's span\r
+  //   does not mean that it is a descendent.  For example, a "group" defines\r
+  //   both a type and a field in a single declaration.  Thus, the locations\r
+  //   corresponding to the type and field and their components will overlap.\r
+  // - Code which tries to interpret locations should probably be designed to\r
+  //   ignore those that it doesn't understand, as more types of locations could\r
+  //   be recorded in the future.\r
+  repeated Location location = 1;\r
+  message Location {\r
+    // Identifies which part of the FileDescriptorProto was defined at this\r
+    // location.\r
+    //\r
+    // Each element is a field number or an index.  They form a path from\r
+    // the root FileDescriptorProto to the place where the definition.  For\r
+    // example, this path:\r
+    //   [ 4, 3, 2, 7, 1 ]\r
+    // refers to:\r
+    //   file.message_type(3)  // 4, 3\r
+    //       .field(7)         // 2, 7\r
+    //       .name()           // 1\r
+    // This is because FileDescriptorProto.message_type has field number 4:\r
+    //   repeated DescriptorProto message_type = 4;\r
+    // and DescriptorProto.field has field number 2:\r
+    //   repeated FieldDescriptorProto field = 2;\r
+    // and FieldDescriptorProto.name has field number 1:\r
+    //   optional string name = 1;\r
+    //\r
+    // Thus, the above path gives the location of a field name.  If we removed\r
+    // the last element:\r
+    //   [ 4, 3, 2, 7 ]\r
+    // this path refers to the whole field declaration (from the beginning\r
+    // of the label to the terminating semicolon).\r
+    repeated int32 path = 1 [packed=true];\r
+\r
+    // Always has exactly three or four elements: start line, start column,\r
+    // end line (optional, otherwise assumed same as start line), end column.\r
+    // These are packed into a single field for efficiency.  Note that line\r
+    // and column numbers are zero-based -- typically you will want to add\r
+    // 1 to each before displaying to a user.\r
+    repeated int32 span = 2 [packed=true];\r
+\r
+    // If this SourceCodeInfo represents a complete declaration, these are any\r
+    // comments appearing before and after the declaration which appear to be\r
+    // attached to the declaration.\r
+    //\r
+    // A series of line comments appearing on consecutive lines, with no other\r
+    // tokens appearing on those lines, will be treated as a single comment.\r
+    //\r
+    // Only the comment content is provided; comment markers (e.g. //) are\r
+    // stripped out.  For block comments, leading whitespace and an asterisk\r
+    // will be stripped from the beginning of each line other than the first.\r
+    // Newlines are included in the output.\r
+    //\r
+    // Examples:\r
+    //\r
+    //   optional int32 foo = 1;  // Comment attached to foo.\r
+    //   // Comment attached to bar.\r
+    //   optional int32 bar = 2;\r
+    //\r
+    //   optional string baz = 3;\r
+    //   // Comment attached to baz.\r
+    //   // Another line attached to baz.\r
+    //\r
+    //   // Comment attached to qux.\r
+    //   //\r
+    //   // Another line attached to qux.\r
+    //   optional double qux = 4;\r
+    //\r
+    //   optional string corge = 5;\r
+    //   /* Block comment attached\r
+    //    * to corge.  Leading asterisks\r
+    //    * will be removed. */\r
+    //   /* Block comment attached to\r
+    //    * grault. */\r
+    //   optional int32 grault = 6;\r
+    optional string leading_comments = 3;\r
+    optional string trailing_comments = 4;\r
+  }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/protobuf.js b/legacy-libs/grpc/node_modules/protobufjs/src/protobuf.js
new file mode 100644 (file)
index 0000000..6efc681
--- /dev/null
@@ -0,0 +1,421 @@
+/**\r
+ * The ProtoBuf namespace.\r
+ * @exports ProtoBuf\r
+ * @namespace\r
+ * @expose\r
+ */\r
+var ProtoBuf = {};\r
+\r
+/**\r
+ * @type {!function(new: ByteBuffer, ...[*])}\r
+ * @expose\r
+ */\r
+ProtoBuf.ByteBuffer = ByteBuffer;\r
+\r
+/**\r
+ * @type {?function(new: Long, ...[*])}\r
+ * @expose\r
+ */\r
+ProtoBuf.Long = ByteBuffer.Long || null;\r
+\r
+/**\r
+ * ProtoBuf.js version.\r
+ * @type {string}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.VERSION = "/*?= VERSION */";\r
+\r
+/**\r
+ * Wire types.\r
+ * @type {Object.<string,number>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES = {};\r
+\r
+/**\r
+ * Varint wire type.\r
+ * @type {number}\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.VARINT = 0;\r
+\r
+/**\r
+ * Fixed 64 bits wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS64 = 1;\r
+\r
+/**\r
+ * Length delimited wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.LDELIM = 2;\r
+\r
+/**\r
+ * Start group wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.STARTGROUP = 3;\r
+\r
+/**\r
+ * End group wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.ENDGROUP = 4;\r
+\r
+/**\r
+ * Fixed 32 bits wire type.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.WIRE_TYPES.BITS32 = 5;\r
+\r
+/**\r
+ * Packable wire types.\r
+ * @type {!Array.<number>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.PACKABLE_WIRE_TYPES = [\r
+    ProtoBuf.WIRE_TYPES.VARINT,\r
+    ProtoBuf.WIRE_TYPES.BITS64,\r
+    ProtoBuf.WIRE_TYPES.BITS32\r
+];\r
+\r
+/**\r
+ * Types.\r
+ * @dict\r
+ * @type {!Object.<string,{name: string, wireType: number, defaultValue: *}>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.TYPES = {\r
+    // According to the protobuf spec.\r
+    "int32": {\r
+        name: "int32",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "uint32": {\r
+        name: "uint32",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "sint32": {\r
+        name: "sint32",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "int64": {\r
+        name: "int64",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+    },\r
+    "uint64": {\r
+        name: "uint64",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+    },\r
+    "sint64": {\r
+        name: "sint64",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+    },\r
+    "bool": {\r
+        name: "bool",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: false\r
+    },\r
+    "double": {\r
+        name: "double",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+        defaultValue: 0\r
+    },\r
+    "string": {\r
+        name: "string",\r
+        wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+        defaultValue: ""\r
+    },\r
+    "bytes": {\r
+        name: "bytes",\r
+        wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+        defaultValue: null // overridden in the code, must be a unique instance\r
+    },\r
+    "fixed32": {\r
+        name: "fixed32",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+        defaultValue: 0\r
+    },\r
+    "sfixed32": {\r
+        name: "sfixed32",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+        defaultValue: 0\r
+    },\r
+    "fixed64": {\r
+        name: "fixed64",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+        defaultValue:  ProtoBuf.Long ? ProtoBuf.Long.UZERO : undefined\r
+    },\r
+    "sfixed64": {\r
+        name: "sfixed64",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS64,\r
+        defaultValue: ProtoBuf.Long ? ProtoBuf.Long.ZERO : undefined\r
+    },\r
+    "float": {\r
+        name: "float",\r
+        wireType: ProtoBuf.WIRE_TYPES.BITS32,\r
+        defaultValue: 0\r
+    },\r
+    "enum": {\r
+        name: "enum",\r
+        wireType: ProtoBuf.WIRE_TYPES.VARINT,\r
+        defaultValue: 0\r
+    },\r
+    "message": {\r
+        name: "message",\r
+        wireType: ProtoBuf.WIRE_TYPES.LDELIM,\r
+        defaultValue: null\r
+    },\r
+    "group": {\r
+        name: "group",\r
+        wireType: ProtoBuf.WIRE_TYPES.STARTGROUP,\r
+        defaultValue: null\r
+    }\r
+};\r
+\r
+/**\r
+ * Valid map key types.\r
+ * @type {!Array.<!Object.<string,{name: string, wireType: number, defaultValue: *}>>}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.MAP_KEY_TYPES = [\r
+    ProtoBuf.TYPES["int32"],\r
+    ProtoBuf.TYPES["sint32"],\r
+    ProtoBuf.TYPES["sfixed32"],\r
+    ProtoBuf.TYPES["uint32"],\r
+    ProtoBuf.TYPES["fixed32"],\r
+    ProtoBuf.TYPES["int64"],\r
+    ProtoBuf.TYPES["sint64"],\r
+    ProtoBuf.TYPES["sfixed64"],\r
+    ProtoBuf.TYPES["uint64"],\r
+    ProtoBuf.TYPES["fixed64"],\r
+    ProtoBuf.TYPES["bool"],\r
+    ProtoBuf.TYPES["string"],\r
+    ProtoBuf.TYPES["bytes"]\r
+];\r
+\r
+/**\r
+ * Minimum field id.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.ID_MIN = 1;\r
+\r
+/**\r
+ * Maximum field id.\r
+ * @type {number}\r
+ * @const\r
+ * @expose\r
+ */\r
+ProtoBuf.ID_MAX = 0x1FFFFFFF;\r
+\r
+/**\r
+ * If set to `true`, field names will be converted from underscore notation to camel case. Defaults to `false`.\r
+ *  Must be set prior to parsing.\r
+ * @type {boolean}\r
+ * @expose\r
+ */\r
+ProtoBuf.convertFieldsToCamelCase = false;\r
+\r
+/**\r
+ * By default, messages are populated with (setX, set_x) accessors for each field. This can be disabled by\r
+ *  setting this to `false` prior to building messages.\r
+ * @type {boolean}\r
+ * @expose\r
+ */\r
+ProtoBuf.populateAccessors = true;\r
+\r
+/**\r
+ * By default, messages are populated with default values if a field is not present on the wire. To disable\r
+ *  this behavior, set this setting to `false`.\r
+ * @type {boolean}\r
+ * @expose\r
+ */\r
+ProtoBuf.populateDefaults = true;\r
+\r
+//? include("ProtoBuf/Util.js");\r
+\r
+//? include("ProtoBuf/Lang.js");\r
+\r
+//? if (DOTPROTO) include("ProtoBuf/DotProto.js");\r
+\r
+//? include("ProtoBuf/Reflect.js");\r
+\r
+//? include("ProtoBuf/Builder.js");\r
+\r
+//? include("ProtoBuf/Map.js");\r
+\r
+//? if (DOTPROTO) {\r
+\r
+/**\r
+ * Loads a .proto string and returns the Builder.\r
+ * @param {string} proto .proto file contents\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+ * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+ * @return {ProtoBuf.Builder} Builder to create new messages\r
+ * @throws {Error} If the definition cannot be parsed or built\r
+ * @expose\r
+ */\r
+ProtoBuf.loadProto = function(proto, builder, filename) {\r
+    if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))\r
+        filename = builder,\r
+        builder = undefined;\r
+    return ProtoBuf.loadJson(ProtoBuf.DotProto.Parser.parse(proto), builder, filename);\r
+};\r
+\r
+/**\r
+ * Loads a .proto string and returns the Builder. This is an alias of {@link ProtoBuf.loadProto}.\r
+ * @function\r
+ * @param {string} proto .proto file contents\r
+ * @param {(ProtoBuf.Builder|string)=} builder Builder to append to. Will create a new one if omitted.\r
+ * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+ * @return {ProtoBuf.Builder} Builder to create new messages\r
+ * @throws {Error} If the definition cannot be parsed or built\r
+ * @expose\r
+ */\r
+ProtoBuf.protoFromString = ProtoBuf.loadProto; // Legacy\r
+\r
+/**\r
+ * Loads a .proto file and returns the Builder.\r
+ * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+ *  an overridden 'root' path for all imported files.\r
+ * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+ *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+ *  file will be read synchronously and this function will return the Builder.\r
+ * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+ * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+ *   request has failed), else undefined\r
+ * @expose\r
+ */\r
+ProtoBuf.loadProtoFile = function(filename, callback, builder) {\r
+    if (callback && typeof callback === 'object')\r
+        builder = callback,\r
+        callback = null;\r
+    else if (!callback || typeof callback !== 'function')\r
+        callback = null;\r
+    if (callback)\r
+        return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+            if (contents === null) {\r
+                callback(Error("Failed to fetch file"));\r
+                return;\r
+            }\r
+            try {\r
+                callback(null, ProtoBuf.loadProto(contents, builder, filename));\r
+            } catch (e) {\r
+                callback(e);\r
+            }\r
+        });\r
+    var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+    return contents === null ? null : ProtoBuf.loadProto(contents, builder, filename);\r
+};\r
+\r
+/**\r
+ * Loads a .proto file and returns the Builder. This is an alias of {@link ProtoBuf.loadProtoFile}.\r
+ * @function\r
+ * @param {string|{root: string, file: string}} filename Path to proto file or an object specifying 'file' with\r
+ *  an overridden 'root' path for all imported files.\r
+ * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+ *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+ *  file will be read synchronously and this function will return the Builder.\r
+ * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+ * @return {!ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+ *   request has failed), else undefined\r
+ * @expose\r
+ */\r
+ProtoBuf.protoFromFile = ProtoBuf.loadProtoFile; // Legacy\r
+\r
+//? } // DOTPROTO\r
+\r
+/**\r
+ * Constructs a new empty Builder.\r
+ * @param {Object.<string,*>=} options Builder options, defaults to global options set on ProtoBuf\r
+ * @return {!ProtoBuf.Builder} Builder\r
+ * @expose\r
+ */\r
+ProtoBuf.newBuilder = function(options) {\r
+    options = options || {};\r
+    if (typeof options['convertFieldsToCamelCase'] === 'undefined')\r
+        options['convertFieldsToCamelCase'] = ProtoBuf.convertFieldsToCamelCase;\r
+    if (typeof options['populateAccessors'] === 'undefined')\r
+        options['populateAccessors'] = ProtoBuf.populateAccessors;\r
+    return new ProtoBuf.Builder(options);\r
+};\r
+\r
+/**\r
+ * Loads a .json definition and returns the Builder.\r
+ * @param {!*|string} json JSON definition\r
+ * @param {(ProtoBuf.Builder|string|{root: string, file: string})=} builder Builder to append to. Will create a new one if omitted.\r
+ * @param {(string|{root: string, file: string})=} filename The corresponding file name if known. Must be specified for imports.\r
+ * @return {ProtoBuf.Builder} Builder to create new messages\r
+ * @throws {Error} If the definition cannot be parsed or built\r
+ * @expose\r
+ */\r
+ProtoBuf.loadJson = function(json, builder, filename) {\r
+    if (typeof builder === 'string' || (builder && typeof builder["file"] === 'string' && typeof builder["root"] === 'string'))\r
+        filename = builder,\r
+        builder = null;\r
+    if (!builder || typeof builder !== 'object')\r
+        builder = ProtoBuf.newBuilder();\r
+    if (typeof json === 'string')\r
+        json = JSON.parse(json);\r
+    builder["import"](json, filename);\r
+    builder.resolveAll();\r
+    return builder;\r
+};\r
+\r
+/**\r
+ * Loads a .json file and returns the Builder.\r
+ * @param {string|!{root: string, file: string}} filename Path to json file or an object specifying 'file' with\r
+ *  an overridden 'root' path for all imported files.\r
+ * @param {function(?Error, !ProtoBuf.Builder=)=} callback Callback that will receive `null` as the first and\r
+ *  the Builder as its second argument on success, otherwise the error as its first argument. If omitted, the\r
+ *  file will be read synchronously and this function will return the Builder.\r
+ * @param {ProtoBuf.Builder=} builder Builder to append to. Will create a new one if omitted.\r
+ * @return {?ProtoBuf.Builder|undefined} The Builder if synchronous (no callback specified, will be NULL if the\r
+ *   request has failed), else undefined\r
+ * @expose\r
+ */\r
+ProtoBuf.loadJsonFile = function(filename, callback, builder) {\r
+    if (callback && typeof callback === 'object')\r
+        builder = callback,\r
+        callback = null;\r
+    else if (!callback || typeof callback !== 'function')\r
+        callback = null;\r
+    if (callback)\r
+        return ProtoBuf.Util.fetch(typeof filename === 'string' ? filename : filename["root"]+"/"+filename["file"], function(contents) {\r
+            if (contents === null) {\r
+                callback(Error("Failed to fetch file"));\r
+                return;\r
+            }\r
+            try {\r
+                callback(null, ProtoBuf.loadJson(JSON.parse(contents), builder, filename));\r
+            } catch (e) {\r
+                callback(e);\r
+            }\r
+        });\r
+    var contents = ProtoBuf.Util.fetch(typeof filename === 'object' ? filename["root"]+"/"+filename["file"] : filename);\r
+    return contents === null ? null : ProtoBuf.loadJson(JSON.parse(contents), builder, filename);\r
+};\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/src/wrap.js b/legacy-libs/grpc/node_modules/protobufjs/src/wrap.js
new file mode 100644 (file)
index 0000000..3fabafd
--- /dev/null
@@ -0,0 +1,37 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+/**\r
+ * @license protobuf.js (c) 2013 Daniel Wirtz <dcode@dcode.io>\r
+ * Released under the Apache License, Version 2.0\r
+ * see: https://github.com/dcodeIO/protobuf.js for details\r
+ */\r
+(function(global, factory) {\r
+\r
+    /* AMD */ if (typeof define === 'function' && define["amd"])\r
+        define(["bytebuffer"], factory);\r
+    /* CommonJS */ else if (typeof require === "function" && typeof module === "object" && module && module["exports"])\r
+        module["exports"] = factory(require("bytebuffer"), true);\r
+    /* Global */ else\r
+        (global["dcodeIO"] = global["dcodeIO"] || {})["ProtoBuf"] = factory(global["dcodeIO"]["ByteBuffer"]);\r
+\r
+})(this, function(ByteBuffer, isCommonJS) {\r
+    "use strict";\r
+\r
+    //? include("protobuf.js");\r
+\r
+    return ProtoBuf;\r
+});\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/PingExample.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/PingExample.proto
new file mode 100644 (file)
index 0000000..013c362
--- /dev/null
@@ -0,0 +1,12 @@
+message Message {\r
+    optional Ping ping = 1;\r
+    optional Pong pong = 2;\r
+    \r
+    message Ping {\r
+        required uint32 time = 1;\r
+    }\r
+    \r
+    message Pong {\r
+        required uint32 time = 1;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/T139.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/T139.proto
new file mode 100644 (file)
index 0000000..d0c0599
--- /dev/null
@@ -0,0 +1,4 @@
+message T139 {\r
+    required int32 a = 1;\r
+    required uint32 b = 2;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/T263.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/T263.proto
new file mode 100644 (file)
index 0000000..db0c4eb
--- /dev/null
@@ -0,0 +1,13 @@
+package services;\r
+\r
+message resume {\r
+    message Resume {\r
+        repeated string experience = 1;\r
+    }\r
+}\r
+\r
+message profile {\r
+    message Profile {\r
+        optional services.resume.Resume resume = 1;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/annotations.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/annotations.proto
new file mode 100644 (file)
index 0000000..d7d2896
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2015, Google Inc.\r
+//\r
+// Licensed under the Apache License, Version 2.0 (the "License");\r
+// you may not use this file except in compliance with the License.\r
+// You may obtain a copy of the License at\r
+//\r
+//     http://www.apache.org/licenses/LICENSE-2.0\r
+//\r
+// Unless required by applicable law or agreed to in writing, software\r
+// distributed under the License is distributed on an "AS IS" BASIS,\r
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+// See the License for the specific language governing permissions and\r
+// limitations under the License.\r
+\r
+syntax = "proto3";\r
+\r
+package google.api;\r
+\r
+// import "google/api/http.proto";\r
+// import "google/protobuf/descriptor.proto";\r
+\r
+option java_multiple_files = true;\r
+option java_outer_classname = "AnnotationsProto";\r
+option java_package = "com.google.api";\r
+\r
+extend google.protobuf.MethodOptions {\r
+  // See `HttpRule`.\r
+  HttpRule http = 72295728;\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/bench.js b/legacy-libs/grpc/node_modules/protobufjs/tests/bench.js
new file mode 100644 (file)
index 0000000..7f3c0cd
--- /dev/null
@@ -0,0 +1,48 @@
+var ProtoBuf = require("../index.js");\r
+\r
+var sample = {\r
+    id: 1,\r
+    name: "John123",\r
+    password: "helloworld"\r
+};\r
+\r
+console.log("Sample: `"+JSON.stringify(sample, null, 4));\r
+console.log("\n");\r
+\r
+var proto = " message Sample {" +\r
+    "required uint32 id = 1;" +\r
+    "required string name = 2;" +\r
+    "required string password = 3;" +\r
+    "}";\r
+\r
+var builder = ProtoBuf.loadProto(proto, "bench.proto"),\r
+    Sample = builder.build("Sample");\r
+\r
+// Compare size\r
+console.log("Encoding size");\r
+console.log("-------------");\r
+var jsonData = new Buffer(JSON.stringify(sample), "utf8"),\r
+    protoData = new Sample(sample).toBuffer();\r
+console.log("* Encoded sample size as JSON: "+jsonData.length+" bytes");\r
+console.log("* Encoded sample size as protocol buffer: "+protoData.length+" bytes");\r
+console.log("");\r
+\r
+// Compare encoding speed\r
+console.log("Encoding speed");\r
+console.log("--------------");\r
+(function() {\r
+    // Assuming that a receive buffer is used\r
+    var buf = ProtoBuf.ByteBuffer.allocate(64);\r
+    var protoSample = new Sample(sample),\r
+        n = 100000, k = (n/1000)+'k';\r
+    console.time("* ProtoBuf encode "+k);\r
+    for (var i=0; i<n; ++i)\r
+        protoSample.encode(buf, true),\r
+        buf.flip();\r
+    console.timeEnd("* ProtoBuf encode "+k);\r
+    console.time("* ProtoBuf decode "+k);\r
+    for (var i=0; i<n; ++i)\r
+        Sample.decode(buf),\r
+        buf.flip();\r
+    console.timeEnd("* ProtoBuf decode "+k);\r
+})();\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/bench.txt b/legacy-libs/grpc/node_modules/protobufjs/tests/bench.txt
new file mode 100644 (file)
index 0000000..aa847b2
--- /dev/null
@@ -0,0 +1,373 @@
+Statistical profiling result from v8.log, (1544 ticks, 944 unaccounted, 0 excluded).\r
+\r
+ [Unknown]:\r
+   ticks  total  nonlib   name\r
+    944   61.1%\r
+\r
+ [Shared libraries]:\r
+   ticks  total  nonlib   name\r
+\r
+ [JavaScript]:\r
+   ticks  total  nonlib   name\r
+    248   16.1%   16.1%  LazyCompile: *Buffer.write buffer.js:315\r
+    190   12.3%   12.3%  LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+    189   12.2%   12.2%  LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    188   12.2%   12.2%  LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    142    9.2%    9.2%  LazyCompile: *Buffer.toString buffer.js:392\r
+     84    5.4%    5.4%  LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     62    4.0%    4.0%  LazyCompile: *toLowerCase native string.js:739\r
+     47    3.0%    3.0%  LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     38    2.5%    2.5%  LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+     36    2.3%    2.3%  LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     27    1.7%    1.7%  LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     25    1.6%    1.6%  LazyCompile: *module.exports.ByteBuffer.readVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1272\r
+     25    1.6%    1.6%  Builtin: A builtin from the snapshot\r
+     24    1.6%    1.6%  Stub: CompareICStub\r
+     15    1.0%    1.0%  Stub: CEntryStub\r
+     15    1.0%    1.0%  LazyCompile: <anonymous> native string.js:36\r
+     15    1.0%    1.0%  LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+     11    0.7%    0.7%  Stub: InstanceofStub\r
+     11    0.7%    0.7%  LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     11    0.7%    0.7%  KeyedLoadIC: A keyed load IC from the snapshot\r
+     10    0.6%    0.6%  LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+      9    0.6%    0.6%  LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+      9    0.6%    0.6%  LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+      8    0.5%    0.5%  LazyCompile: ~NativeModule.compile node.js:892\r
+      7    0.5%    0.5%  Stub: KeyedLoadElementStub\r
+      6    0.4%    0.4%  Stub: CompareICStub {2}\r
+      6    0.4%    0.4%  LazyCompile: *module.exports.ByteBuffer.LE x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2299\r
+      6    0.4%    0.4%  LazyCompile: *isFinite native v8natives.js:103\r
+      5    0.3%    0.3%  Stub: ToBooleanStub_UndefinedSpecObject\r
+      5    0.3%    0.3%  LazyCompile: ~Module._compile module.js:374\r
+      5    0.3%    0.3%  Builtin: A builtin from the snapshot {3}\r
+      4    0.3%    0.3%  Stub: ToBooleanStub\r
+      4    0.3%    0.3%  Stub: KeyedLoadElementStub {1}\r
+      4    0.3%    0.3%  LazyCompile: *module.exports.ByteBuffer.remaining x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2397\r
+      3    0.2%    0.2%  KeyedStoreIC: A keyed store IC from the snapshot\r
+      2    0.1%    0.1%  Stub: BinaryOpStub_SHR_Alloc_SMI\r
+      2    0.1%    0.1%  Stub: BinaryOpStub_SHL_Alloc_SMI\r
+      2    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      2    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      2    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferAB.js:23\r
+      2    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\dist\ProtoBuf.js:22\r
+      2    0.1%    0.1%  Function: ~<anonymous> net.js:1\r
+      1    0.1%    0.1%  Stub: ToBooleanStub {1}\r
+      1    0.1%    0.1%  Stub: CompareICStub {1}\r
+      1    0.1%    0.1%  Stub: CallConstructStub\r
+      1    0.1%    0.1%  Stub: BinaryOpStub_MUL_Alloc_SMI\r
+      1    0.1%    0.1%  Stub: BinaryOpStub_BIT_OR_OverwriteLeft_SMI\r
+      1    0.1%    0.1%  LazyCompile: ~tryFile module.js:138\r
+      1    0.1%    0.1%  LazyCompile: ~nextTick node.js:334\r
+      1    0.1%    0.1%  LazyCompile: ~module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+      1    0.1%    0.1%  LazyCompile: ~join native array.js:410\r
+      1    0.1%    0.1%  LazyCompile: ~fs.statSync fs.js:687\r
+      1    0.1%    0.1%  LazyCompile: ~fs.openSync fs.js:429\r
+      1    0.1%    0.1%  LazyCompile: ~fs.fstatSync fs.js:678\r
+      1    0.1%    0.1%  LazyCompile: ~filter native array.js:1036\r
+      1    0.1%    0.1%  LazyCompile: ~exec native regexp.js:168\r
+      1    0.1%    0.1%  LazyCompile: ~createWriteReq net.js:658\r
+      1    0.1%    0.1%  LazyCompile: ~createWritableStdioStream node.js:550\r
+      1    0.1%    0.1%  LazyCompile: ~bind native v8natives.js:1578\r
+      1    0.1%    0.1%  LazyCompile: ~StringSplitOnRegExp native string.js:591\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.Reflect.Field x:\public\ProtoBuf\dist\ProtoBuf.js:2401\r
+      1    0.1%    0.1%  LazyCompile: ~ProtoBuf.DotProto.Parser._parseId x:\public\ProtoBuf\dist\ProtoBuf.js:724\r
+      1    0.1%    0.1%  LazyCompile: ~Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+      1    0.1%    0.1%  LazyCompile: ~Buffer.write buffer.js:315\r
+      1    0.1%    0.1%  LazyCompile: ~Buffer buffer.js:156\r
+      1    0.1%    0.1%  LazyCompile: statPath module.js:88\r
+      1    0.1%    0.1%  KeyedLoadIC: args_count: 0\r
+      1    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      1    0.1%    0.1%  Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\node_modules\long\dist\Long.js:23\r
+      1    0.1%    0.1%  Function: ~<anonymous> fs.js:1\r
+      1    0.1%    0.1%  Builtin: A builtin from the snapshot {2}\r
+      1    0.1%    0.1%  Builtin: A builtin from the snapshot {1}\r
+\r
+ [C++]:\r
+   ticks  total  nonlib   name\r
+\r
+ [GC]:\r
+   ticks  total  nonlib   name\r
+      2    0.1%\r
+\r
+ [Bottom up (heavy) profile]:\r
+  Note: percentage shows a share of a particular caller in the total\r
+  amount of its parent calls.\r
+  Callers occupying less than 2.0% are not shown.\r
+\r
+   ticks parent  name\r
+    248   16.1%  LazyCompile: *Buffer.write buffer.js:315\r
+    247   99.6%    LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    247  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+    247  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+    247  100.0%          LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+    247  100.0%            LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+\r
+    190   12.3%  LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+    190  100.0%    LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    190  100.0%      LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    182   95.8%        LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+    182  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+    182  100.0%            LazyCompile: ~Module._compile module.js:374\r
+      8    4.2%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      8  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      8  100.0%            LazyCompile: ~Module._compile module.js:374\r
+\r
+    189   12.2%  LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    189  100.0%    LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    183   96.8%      LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+    183  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+    183  100.0%          LazyCompile: ~Module._compile module.js:374\r
+    183  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+      6    3.2%      Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      6  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      6  100.0%          LazyCompile: ~Module._compile module.js:374\r
+      6  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+\r
+    188   12.2%  LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    188  100.0%    LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+    188  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+    187   99.5%        LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+    187  100.0%          LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+    178   95.2%            LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      9    4.8%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+\r
+    142    9.2%  LazyCompile: *Buffer.toString buffer.js:392\r
+    142  100.0%    LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+    141   99.3%      LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+    141  100.0%        LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    141  100.0%          LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    132   93.6%            LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      9    6.4%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+\r
+     84    5.4%  LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     82   97.6%    LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     82  100.0%      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     82  100.0%        LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     79   96.3%          LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     79  100.0%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      3    3.7%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      3  100.0%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      2    2.4%    LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      2  100.0%      LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+      2  100.0%        LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      2  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      2  100.0%            LazyCompile: ~Module._compile module.js:374\r
+\r
+     62    4.0%  LazyCompile: *toLowerCase native string.js:739\r
+     36   58.1%    LazyCompile: *Buffer.write buffer.js:315\r
+     36  100.0%      LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+     36  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     36  100.0%          LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     36  100.0%            LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     23   37.1%    LazyCompile: *Buffer.toString buffer.js:392\r
+     23  100.0%      LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+     23  100.0%        LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     23  100.0%          LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     23  100.0%            LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+      2    3.2%    LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+      2  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      2  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      2  100.0%          LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      2  100.0%            LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+\r
+     47    3.0%  LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     46   97.9%    LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     46  100.0%      LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+     44   95.7%        LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     44  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+     44  100.0%            LazyCompile: ~Module._compile module.js:374\r
+      2    4.3%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      2  100.0%          Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      2  100.0%            LazyCompile: ~Module._compile module.js:374\r
+\r
+     38    2.5%  LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+     26   68.4%    LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     26  100.0%      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     26  100.0%        LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     26  100.0%          LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     26  100.0%            Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      6   15.8%    LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      6  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      6  100.0%        LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      6  100.0%          LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+      6  100.0%            LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      6   15.8%    LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+      6  100.0%      LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      6  100.0%        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      6  100.0%          LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      6  100.0%            LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+\r
+     36    2.3%  LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     35   97.2%    LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     32   91.4%      LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     32  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+     32  100.0%          LazyCompile: ~Module._compile module.js:374\r
+     32  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+      3    8.6%      Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+      3  100.0%        Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+      3  100.0%          LazyCompile: ~Module._compile module.js:374\r
+      3  100.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+\r
+\r
+ [Top down (heavy) profile]:\r
+  Note: callees occupying less than 0.1% are not shown.\r
+\r
+  inclusive      self           name\r
+  ticks   total  ticks   total\r
+   1533   99.3%      0    0.0%  Function: ~<anonymous> node.js:27\r
+   1533   99.3%      0    0.0%    LazyCompile: ~startup node.js:30\r
+   1527   98.9%      0    0.0%      LazyCompile: ~Module.runMain module.js:495\r
+   1527   98.9%      0    0.0%        LazyCompile: Module._load module.js:275\r
+   1524   98.7%      0    0.0%          LazyCompile: ~Module.load module.js:346\r
+   1523   98.6%      0    0.0%            LazyCompile: ~Module._extensions..js module.js:472\r
+   1523   98.6%      0    0.0%              LazyCompile: ~Module._compile module.js:374\r
+   1523   98.6%      1    0.1%                Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:1\r
+   1413   91.5%     11    0.7%                  LazyCompile: *<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+    701   45.4%      9    0.6%                    LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+    681   44.1%     32    2.1%                      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+    631   40.9%     22    1.4%                        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+    576   37.3%     79    5.1%                          LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+    473   30.6%    178   11.5%                            LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+    286   18.5%    236   15.3%                              LazyCompile: *Buffer.write buffer.js:315\r
+     37    2.4%     35    2.3%                                LazyCompile: *toLowerCase native string.js:739\r
+      2    0.1%      2    0.1%                                  Stub: CEntryStub\r
+      5    0.3%      5    0.3%                                LazyCompile: *isFinite native v8natives.js:103\r
+      3    0.2%      3    0.2%                                Stub: CompareICStub {2}\r
+      3    0.2%      2    0.1%                                LazyCompile: <anonymous> native string.js:36\r
+      6    0.4%      6    0.4%                              LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+      2    0.1%      2    0.1%                              LazyCompile: *toLowerCase native string.js:739\r
+     13    0.8%     13    0.8%                            Stub: CompareICStub\r
+      6    0.4%      6    0.4%                            LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+      4    0.3%      4    0.3%                            Builtin: A builtin from the snapshot\r
+     26    1.7%     26    1.7%                          LazyCompile: *module.exports.ByteBuffer.writeVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1193\r
+      3    0.2%      3    0.2%                          Builtin: A builtin from the snapshot\r
+      2    0.1%      2    0.1%                          Stub: BinaryOpStub_SHL_Alloc_SMI\r
+      8    0.5%      8    0.5%                        Stub: InstanceofStub\r
+      6    0.4%      6    0.4%                        KeyedLoadIC: A keyed load IC from the snapshot\r
+      2    0.1%      2    0.1%                        Stub: CEntryStub\r
+      2    0.1%      2    0.1%                        LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+      5    0.3%      5    0.3%                      Stub: ToBooleanStub_UndefinedSpecObject\r
+      3    0.2%      3    0.2%                      LazyCompile: *module.exports.ByteBuffer.LE x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2299\r
+      2    0.1%      2    0.1%                      Stub: ToBooleanStub\r
+    697   45.1%     10    0.6%                    LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+    679   44.0%    183   11.9%                      LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+    257   16.6%     44    2.8%                        LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+    199   12.9%     15    1.0%                          LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+    173   11.2%    132    8.5%                            LazyCompile: *Buffer.toString buffer.js:392\r
+     23    1.5%     21    1.4%                              LazyCompile: *toLowerCase native string.js:739\r
+      2    0.1%      2    0.1%                                Stub: CEntryStub\r
+     13    0.8%     13    0.8%                              LazyCompile: <anonymous> native string.js:36\r
+      3    0.2%      3    0.2%                              Stub: CompareICStub {2}\r
+     10    0.6%     10    0.6%                            LazyCompile: *module.exports.ByteBuffer.readVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1272\r
+      9    0.6%      9    0.6%                          Stub: CompareICStub\r
+      3    0.2%      3    0.2%                          Builtin: A builtin from the snapshot\r
+    183   11.9%    182   11.8%                        LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+     14    0.9%     14    0.9%                        LazyCompile: *module.exports.ByteBuffer.readVarint32 x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1272\r
+      8    0.5%      8    0.5%                        Builtin: A builtin from the snapshot\r
+      7    0.5%      7    0.5%                        Stub: KeyedLoadElementStub\r
+      5    0.3%      5    0.3%                        Builtin: A builtin from the snapshot {3}\r
+      4    0.3%      4    0.3%                        Stub: KeyedLoadElementStub {1}\r
+      4    0.3%      4    0.3%                        Stub: CEntryStub\r
+      4    0.3%      4    0.3%                        LazyCompile: *module.exports.ByteBuffer.remaining x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2397\r
+      4    0.3%      4    0.3%                        KeyedLoadIC: A keyed load IC from the snapshot\r
+      2    0.1%      2    0.1%                        KeyedStoreIC: A keyed store IC from the snapshot\r
+      3    0.2%      3    0.2%                      Stub: InstanceofStub\r
+      3    0.2%      3    0.2%                      Builtin: A builtin from the snapshot\r
+      2    0.1%      2    0.1%                      LazyCompile: *module.exports.ByteBuffer.LE x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2299\r
+      3    0.2%      3    0.2%                    LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+     77    5.0%      2    0.1%                  Function: ~<anonymous> x:\public\ProtoBuf\tests\bench.js:33\r
+     37    2.4%      0    0.0%                    LazyCompile: Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:1870\r
+     32    2.1%      3    0.2%                      LazyCompile: *ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+     29    1.9%      4    0.3%                        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+     25    1.6%      3    0.2%                          LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     21    1.4%      9    0.6%                            LazyCompile: *module.exports.ByteBuffer.writeVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1893\r
+     12    0.8%     11    0.7%                              LazyCompile: *Buffer.write buffer.js:315\r
+      5    0.3%      1    0.1%                      LazyCompile: ~ProtoBuf.Reflect.Message.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2233\r
+      4    0.3%      0    0.0%                        LazyCompile: ProtoBuf.Reflect.Field.encode x:\public\ProtoBuf\dist\ProtoBuf.js:2651\r
+      2    0.1%      0    0.0%                          LazyCompile: ProtoBuf.Reflect.Field.encodeValue x:\public\ProtoBuf\dist\ProtoBuf.js:2703\r
+     37    2.4%      0    0.0%                    LazyCompile: Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2083\r
+     34    2.2%      6    0.4%                      LazyCompile: ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     16    1.0%      2    0.1%                        LazyCompile: ProtoBuf.Reflect.Field.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2919\r
+     12    0.8%      0    0.0%                          LazyCompile: *module.exports.ByteBuffer.readVString x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1932\r
+     12    0.8%      9    0.6%                            LazyCompile: *Buffer.toString buffer.js:392\r
+      3    0.2%      2    0.1%                              LazyCompile: *toLowerCase native string.js:739\r
+      9    0.6%      8    0.5%                        LazyCompile: *Message x:\public\ProtoBuf\dist\ProtoBuf.js:1629\r
+      2    0.1%      1    0.1%                      LazyCompile: ~ProtoBuf.Reflect.Message.decode x:\public\ProtoBuf\dist\ProtoBuf.js:2325\r
+     17    1.1%      0    0.0%                  LazyCompile: ~require module.js:379\r
+     17    1.1%      0    0.0%                    LazyCompile: ~Module.require module.js:361\r
+     17    1.1%      0    0.0%                      LazyCompile: Module._load module.js:275\r
+     17    1.1%      0    0.0%                        LazyCompile: ~Module.load module.js:346\r
+     17    1.1%      0    0.0%                          LazyCompile: ~Module._extensions..js module.js:472\r
+     17    1.1%      0    0.0%                            LazyCompile: ~Module._compile module.js:374\r
+     17    1.1%      0    0.0%                              Function: ~<anonymous> x:\public\ProtoBuf\index.js:1\r
+     17    1.1%      0    0.0%                                LazyCompile: ~require module.js:379\r
+     17    1.1%      0    0.0%                                  LazyCompile: ~Module.require module.js:361\r
+     17    1.1%      0    0.0%                                    LazyCompile: Module._load module.js:275\r
+     17    1.1%      0    0.0%                                      LazyCompile: ~Module.load module.js:346\r
+     17    1.1%      0    0.0%                                        LazyCompile: ~Module._extensions..js module.js:472\r
+     16    1.0%      2    0.1%                                          LazyCompile: ~Module._compile module.js:374\r
+     14    0.9%      0    0.0%                                            Function: ~<anonymous> x:\public\ProtoBuf\dist\ProtoBuf.js:1\r
+     14    0.9%      2    0.1%                                              Function: ~<anonymous> x:\public\ProtoBuf\dist\ProtoBuf.js:22\r
+     12    0.8%      0    0.0%                                                LazyCompile: ~require module.js:379\r
+     12    0.8%      0    0.0%                                                  LazyCompile: ~Module.require module.js:361\r
+     12    0.8%      0    0.0%                                                    LazyCompile: Module._load module.js:275\r
+     11    0.7%      0    0.0%                                                      LazyCompile: ~Module.load module.js:346\r
+     11    0.7%      0    0.0%                                                        LazyCompile: ~Module._extensions..js module.js:472\r
+     11    0.7%      0    0.0%                                                          LazyCompile: ~Module._compile module.js:374\r
+     11    0.7%      0    0.0%                                                            Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\index.js:1\r
+     11    0.7%      0    0.0%                                                              LazyCompile: ~require module.js:379\r
+     11    0.7%      0    0.0%                                                                LazyCompile: ~Module.require module.js:361\r
+     11    0.7%      0    0.0%                                                                  LazyCompile: Module._load module.js:275\r
+     10    0.6%      0    0.0%                                                                    LazyCompile: ~Module.load module.js:346\r
+     10    0.6%      0    0.0%                                                                      LazyCompile: ~Module._extensions..js module.js:472\r
+      9    0.6%      3    0.2%                                                                        LazyCompile: ~Module._compile module.js:374\r
+      4    0.3%      0    0.0%                                                                          Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:1\r
+      4    0.3%      0    0.0%                                                                            Function: <anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:23\r
+      4    0.3%      0    0.0%                                                                              LazyCompile: ~require module.js:379\r
+      4    0.3%      0    0.0%                                                                                LazyCompile: ~Module.require module.js:361\r
+      4    0.3%      0    0.0%                                                                                  LazyCompile: Module._load module.js:275\r
+      3    0.2%      0    0.0%                                                                                    LazyCompile: ~Module._resolveFilename module.js:323\r
+      3    0.2%      0    0.0%                                                                                      LazyCompile: ~Module._findPath module.js:160\r
+      2    0.1%      0    0.0%                                                                                        LazyCompile: ~tryExtensions module.js:148\r
+      2    0.1%      0    0.0%                                                                                          LazyCompile: ~tryFile module.js:138\r
+      2    0.1%      1    0.1%                                                                                            LazyCompile: statPath module.js:88\r
+      2    0.1%      0    0.0%                                                                          Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferAB.js:1\r
+      2    0.1%      2    0.1%                                                                            Function: ~<anonymous> x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferAB.js:23\r
+      6    0.4%      0    0.0%                  LazyCompile: ~<anonymous> node.js:204\r
+      6    0.4%      0    0.0%                    LazyCompile: ~NativeModule.require node.js:847\r
+      6    0.4%      1    0.1%                      LazyCompile: ~NativeModule.compile node.js:892\r
+      5    0.3%      0    0.0%                        Function: ~<anonymous> console.js:1\r
+      4    0.3%      0    0.0%                          LazyCompile: ~<anonymous> node.js:615\r
+      4    0.3%      1    0.1%                            LazyCompile: ~createWritableStdioStream node.js:550\r
+      3    0.2%      0    0.0%                              LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      0    0.0%                                LazyCompile: ~NativeModule.compile node.js:892\r
+      3    0.2%      0    0.0%                                  Function: ~<anonymous> tty.js:1\r
+      3    0.2%      0    0.0%                                    LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      1    0.1%                                      LazyCompile: ~NativeModule.compile node.js:892\r
+      2    0.1%      2    0.1%                                        Function: ~<anonymous> net.js:1\r
+      2    0.1%      0    0.0%                  LazyCompile: ~b native v8natives.js:1582\r
+      2    0.1%      0    0.0%                    LazyCompile: ~Console.log console.js:52\r
+      2    0.1%      0    0.0%                      LazyCompile: ~Socket.write net.js:612\r
+      2    0.1%      0    0.0%                        LazyCompile: ~Writable.write _stream_writable.js:162\r
+      2    0.1%      0    0.0%                          LazyCompile: ~writeOrBuffer _stream_writable.js:199\r
+      2    0.1%      0    0.0%                            LazyCompile: ~doWrite _stream_writable.js:220\r
+      2    0.1%      0    0.0%                              LazyCompile: ~Socket._write net.js:619\r
+      2    0.1%      0    0.0%                  LazyCompile: ~ProtoBuf.loadProto x:\public\ProtoBuf\dist\ProtoBuf.js:3983\r
+      2    0.1%      2    0.1%                  LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+      2    0.1%      2    0.1%                  Builtin: A builtin from the snapshot\r
+      3    0.2%      0    0.0%          LazyCompile: ~Module._resolveFilename module.js:323\r
+      3    0.2%      0    0.0%            LazyCompile: ~Module._findPath module.js:160\r
+      3    0.2%      0    0.0%              LazyCompile: ~tryFile module.js:138\r
+      3    0.2%      0    0.0%                LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      1    0.1%                  LazyCompile: ~NativeModule.compile node.js:892\r
+      2    0.1%      1    0.1%                    Function: ~<anonymous> fs.js:1\r
+      3    0.2%      0    0.0%      LazyCompile: ~NativeModule.require node.js:847\r
+      3    0.2%      2    0.1%        LazyCompile: ~NativeModule.compile node.js:892\r
+      2    0.1%      0    0.0%      LazyCompile: ~startup.globalVariables node.js:160\r
+      2    0.1%      0    0.0%        LazyCompile: ~NativeModule.require node.js:847\r
+      2    0.1%      1    0.1%          LazyCompile: ~NativeModule.compile node.js:892\r
+\r
+      3    0.2%      3    0.2%  LazyCompile: *module.exports.ByteBuffer.flip x:\public\ProtoBuf\node_modules\bytebuffer\dist\ByteBufferNB.js:2252\r
+\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/camelcase.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/camelcase.proto
new file mode 100644 (file)
index 0000000..03de070
--- /dev/null
@@ -0,0 +1,14 @@
+message Test {\r
+    \r
+    // Case 1: Revert 1st\r
+    required int32 some_field = 1; // -> someField, reverted\r
+    required int32 someField = 2; // kept\r
+    \r
+    // Case 2: Revert 2nd\r
+    required int32 aField = 3; // kept\r
+    required int32 a_field = 4; // -> aField, reverted\r
+    \r
+    // No revert\r
+    required int32 its_a_field = 5; // -> itsAField\r
+    \r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/comments.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/comments.proto
new file mode 100644 (file)
index 0000000..9f808f7
--- /dev/null
@@ -0,0 +1,10 @@
+// single line comment\r
+\r
+/**\r
+ * Naranjas.\r
+ */\r
+message TestC { // one more\r
+    required /***** uncommon block ****/int32 a = 1; // another more\r
+}\r
+\r
+// the end.
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/complex.json b/legacy-libs/grpc/node_modules/protobufjs/tests/complex.json
new file mode 100644 (file)
index 0000000..534f1ba
--- /dev/null
@@ -0,0 +1,114 @@
+{
+    "package": "Game.Cars",
+    "syntax": "proto2",
+    "messages": [
+        {
+            "name": "Car",
+            "syntax": "proto2",
+            "fields": [
+                {
+                    "rule": "required",
+                    "type": "string",
+                    "name": "model",
+                    "id": 1
+                },
+                {
+                    "rule": "required",
+                    "type": "Vendor",
+                    "name": "vendor",
+                    "id": 2
+                },
+                {
+                    "rule": "optional",
+                    "type": "Speed",
+                    "name": "speed",
+                    "id": 3,
+                    "options": {
+                        "default": "FAST"
+                    }
+                }
+            ],
+            "messages": [
+                {
+                    "name": "Vendor",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "required",
+                            "type": "string",
+                            "name": "name",
+                            "id": 1
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "Address",
+                            "name": "address",
+                            "id": 2
+                        },
+                        {
+                            "rule": "repeated",
+                            "type": "string",
+                            "name": "models",
+                            "id": 3
+                        }
+                    ],
+                    "messages": [
+                        {
+                            "name": "Address",
+                            "syntax": "proto2",
+                            "fields": [
+                                {
+                                    "rule": "required",
+                                    "type": "string",
+                                    "name": "country",
+                                    "id": 1
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "name": "Holder",
+                    "syntax": "proto2",
+                    "fields": [
+                        {
+                            "rule": "optional",
+                            "type": "string",
+                            "name": "first_name",
+                            "id": 1
+                        },
+                        {
+                            "rule": "required",
+                            "type": "string",
+                            "name": "last_name",
+                            "id": 2
+                        },
+                        {
+                            "rule": "optional",
+                            "type": "Vendor.Address",
+                            "name": "address",
+                            "id": 3
+                        }
+                    ]
+                }
+            ],
+            "enums": [
+                {
+                    "name": "Speed",
+                    "syntax": "proto2",
+                    "values": [
+                        {
+                            "name": "FAST",
+                            "id": 1
+                        },
+                        {
+                            "name": "SUPERFAST",
+                            "id": 2
+                        }
+                    ]
+                }
+            ]
+        }
+    ],
+    "isNamespace": true
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/complex.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/complex.proto
new file mode 100644 (file)
index 0000000..4e55c59
--- /dev/null
@@ -0,0 +1,35 @@
+package Game.Cars;\r
+\r
+// Car\r
+message Car {\r
+    \r
+    // Car Vendor\r
+    message Vendor {\r
+        required string name = 1;\r
+        \r
+        // Car Vendor Address\r
+        message Address {\r
+            required string country = 1;\r
+        }\r
+        \r
+        optional Address address = 2;\r
+        repeated string models = 3;               // The models sold here.\r
+    }\r
+    \r
+    required  string  model  = 1;                 // Model name\r
+    required  Vendor  vendor = 2;                 // Vendor information\r
+    optional  Speed   speed  = 3 [default=FAST];  // Car speed\r
+    \r
+    // Car speed enum\r
+    enum Speed {\r
+        FAST      = 1;\r
+        SUPERFAST = 2;\r
+    }\r
+    \r
+    // Car Holder\r
+    message Holder {\r
+        optional  string          first_name = 1;\r
+        required  string          last_name  = 2;\r
+        optional  Vendor.Address  address    = 3;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/custom-options.json b/legacy-libs/grpc/node_modules/protobufjs/tests/custom-options.json
new file mode 100644 (file)
index 0000000..d60c0ba
--- /dev/null
@@ -0,0 +1,169 @@
+{\r
+    "package": null,\r
+    "messages": [\r
+        {\r
+            "ref": "google.protobuf.FileOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "my_file_option",\r
+                    "id": 50000\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.MessageOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "int32",\r
+                    "name": "my_message_option",\r
+                    "id": 50001\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.FieldOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "float",\r
+                    "name": "my_field_option",\r
+                    "id": 50002\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.EnumOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "bool",\r
+                    "name": "my_enum_option",\r
+                    "id": 50003\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.EnumValueOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "uint32",\r
+                    "name": "my_enum_value_option",\r
+                    "id": 50004\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.ServiceOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "MyEnum",\r
+                    "name": "my_service_option",\r
+                    "id": 50005\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "ref": "google.protobuf.MethodOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "MyMessage",\r
+                    "name": "my_method_option",\r
+                    "id": 50006\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "name": "MyMessage",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {\r
+                        "(my_field_option)": 4.5\r
+                    },\r
+                    "type": "int32",\r
+                    "name": "foo",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "bar",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {\r
+                "(my_message_option)": 1234\r
+            }\r
+        },\r
+        {\r
+            "name": "RequestType",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {}\r
+        },\r
+        {\r
+            "name": "ResponseType",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {}\r
+        }\r
+    ],\r
+    "enums": [\r
+        {\r
+            "name": "MyEnum",\r
+            "values": [\r
+                {\r
+                    "name": "FOO",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "name": "BAR",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "options": {\r
+                "(my_enum_option)": true\r
+            }\r
+        }\r
+    ],\r
+    "imports": [],\r
+    "options": {\r
+        "(my_file_option)": "Hello world!"\r
+    },\r
+    "services": [\r
+        {\r
+            "name": "MyService",\r
+            "rpc": {\r
+                "MyMethod": {\r
+                    "request": "RequestType",\r
+                    "response": "ResponseType",\r
+                    "options": {\r
+                        "(my_method_option).foo": 567,\r
+                        "(my_method_option).bar": "Some string"\r
+                    }\r
+                }\r
+            },\r
+            "options": {\r
+                "(my_service_option)": "FOO"\r
+            }\r
+        }\r
+    ]\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/custom-options.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/custom-options.proto
new file mode 100644 (file)
index 0000000..01f9773
--- /dev/null
@@ -0,0 +1,53 @@
+import "google/protobuf/descriptor.proto";\r
+\r
+extend google.protobuf.FileOptions {\r
+  optional string my_file_option = 50000;\r
+}\r
+extend google.protobuf.MessageOptions {\r
+  optional int32 my_message_option = 50001;\r
+}\r
+extend google.protobuf.FieldOptions {\r
+  optional float my_field_option = 50002;\r
+}\r
+extend google.protobuf.EnumOptions {\r
+  optional bool my_enum_option = 50003;\r
+}\r
+extend google.protobuf.EnumValueOptions {\r
+  optional uint32 my_enum_value_option = 50004;\r
+}\r
+extend google.protobuf.ServiceOptions {\r
+  optional MyEnum my_service_option = 50005;\r
+}\r
+extend google.protobuf.MethodOptions {\r
+  optional MyMessage my_method_option = 50006;\r
+}\r
+\r
+option (my_file_option) = "Hello world!";\r
+\r
+message MyMessage {\r
+  option (my_message_option) = 1234;\r
+\r
+  optional int32 foo = 1 [(my_field_option) = 4.5];\r
+  optional string bar = 2;\r
+}\r
+\r
+enum MyEnum {\r
+  option (my_enum_option) = true;\r
+\r
+  FOO = 1 [(my_enum_value_option) = 321];\r
+  BAR = 2;\r
+}\r
+\r
+message RequestType {}\r
+message ResponseType {}\r
+\r
+service MyService {\r
+  option (my_service_option) = FOO;\r
+\r
+  rpc MyMethod(RequestType) returns(ResponseType) {\r
+    // Note: my_method_option has type MyMessage. We can set each field\r
+    // within it using a separate "option" line.\r
+    option (my_method_option).foo = 567;\r
+    option (my_method_option).bar = "Some string";\r
+  }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/common.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/common.proto
new file mode 100644 (file)
index 0000000..7845c1d
--- /dev/null
@@ -0,0 +1,5 @@
+package main;\r
+\r
+message Common {\r
+    optional string commonField = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/dep1.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/dep1.proto
new file mode 100644 (file)
index 0000000..897916f
--- /dev/null
@@ -0,0 +1,7 @@
+package main;\r
+\r
+import "common.proto";\r
+\r
+message Dep1 {\r
+    optional main.Common test1 = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/dep2.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/dep2.proto
new file mode 100644 (file)
index 0000000..5f6ff6b
--- /dev/null
@@ -0,0 +1,8 @@
+package main;\r
+\r
+import "dep1.proto";\r
+\r
+message Dep2 {\r
+    optional main.Dep1 test1 = 1;\r
+    optional main.Common test2 = 2;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/main.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/dupimport/main.proto
new file mode 100644 (file)
index 0000000..fc2c7b5
--- /dev/null
@@ -0,0 +1,11 @@
+package main;\r
+\r
+import "dep1.proto";\r
+import "dep2.proto";\r
+import "common.proto";\r
+\r
+message MainMessage {\r
+    optional main.Dep1 test1 = 1;\r
+    optional main.Dep2 test2 = 2;\r
+    optional main.Common test3 = 3;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/example1.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/example1.proto
new file mode 100644 (file)
index 0000000..dd3c96e
--- /dev/null
@@ -0,0 +1,5 @@
+message Test1 {\r
+    required int32 a = 1;\r
+}\r
+\r
+// Test1 should encode to "08 96 01" with Test1#a=150\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/example1u.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/example1u.proto
new file mode 100644 (file)
index 0000000..2b91e8b
--- /dev/null
@@ -0,0 +1,3 @@
+message Test1u {\r
+    required uint32 a = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/example2.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/example2.proto
new file mode 100644 (file)
index 0000000..e00c4d2
--- /dev/null
@@ -0,0 +1,5 @@
+message Test2 {\r
+  required string b = 2;\r
+}\r
+\r
+// Test2 should encode to "12 07 74 65 73 74 69 6e 67" with Test2#b="testing"\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/example3.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/example3.proto
new file mode 100644 (file)
index 0000000..2ec5a97
--- /dev/null
@@ -0,0 +1,9 @@
+message Test1 {\r
+  required int32 a = 1;\r
+}\r
+\r
+message Test3 {\r
+  required Test1 c = 3;\r
+}\r
+\r
+// Test3 should encode to "1a 03 08 96 01" with Test1#a=150 \r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/example4.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/example4.proto
new file mode 100644 (file)
index 0000000..455ae94
--- /dev/null
@@ -0,0 +1,5 @@
+message Test4 {\r
+  repeated int32 d = 4 [packed=true];\r
+}\r
+\r
+// Test4 should encode to "<22 06 03 8E 02 9E A7 05>" with d=[3, 270, 86942]\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/example5.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/example5.proto
new file mode 100644 (file)
index 0000000..22a8156
--- /dev/null
@@ -0,0 +1,29 @@
+package Datastore;\r
+\r
+message LookupRequest {\r
+  repeated string key = 1;\r
+}\r
+\r
+message LookupResponse {\r
+  repeated string results = 1;\r
+}\r
+\r
+message RunQueryRequest {\r
+  required string query = 1;\r
+}\r
+\r
+message RunQueryResponse {\r
+  repeated string results = 1;\r
+}\r
+\r
+service LookupService {\r
+  // Look up some entities by key.\r
+  rpc Lookup(LookupRequest) returns (LookupResponse) {\r
+  }\r
+}\r
+\r
+service RunQueryService {\r
+  // Query for entities.\r
+  rpc RunQuery(RunQueryRequest) returns (RunQueryResponse) {\r
+  };\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/extend.json b/legacy-libs/grpc/node_modules/protobufjs/tests/extend.json
new file mode 100644 (file)
index 0000000..5027fd5
--- /dev/null
@@ -0,0 +1,71 @@
+{\r
+    "package": null,\r
+    "messages": [\r
+        {\r
+            "ref": "google.protobuf.MessageOptions",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "int32",\r
+                    "name": "foo",\r
+                    "id": 1001\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "name": "Foo",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "extensions": [\r
+                2,\r
+                536870911\r
+            ]\r
+        },\r
+        {\r
+            "ref": "Foo",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {},\r
+                    "type": "string",\r
+                    "name": "bar",\r
+                    "id": 2\r
+                }\r
+            ]\r
+        },\r
+        {\r
+            "name": "Bar",\r
+            "fields": [],\r
+            "enums": [],\r
+            "messages": [\r
+                {\r
+                    "name": "Foo",\r
+                    "fields": [],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {}\r
+                },\r
+                {\r
+                    "ref": "Foo",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "optional",\r
+                            "options": {},\r
+                            "type": "Foo",\r
+                            "name": "foo",\r
+                            "id": 3\r
+                        }\r
+                    ]\r
+                }\r
+            ],\r
+            "options": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/extend.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/extend.proto
new file mode 100644 (file)
index 0000000..20ea830
--- /dev/null
@@ -0,0 +1,23 @@
+import "google/protobuf/descriptor.proto"; // Ignored\r
+// import "./google/protobuf/descriptor.proto"; // Not ignored\r
+\r
+extend google.protobuf.MessageOptions {\r
+  optional int32 foo = 1001;\r
+}\r
+\r
+message Foo {\r
+    extensions 2 to max;\r
+}\r
+\r
+extend Foo {\r
+    optional string bar = 2;\r
+}\r
+\r
+message Bar {\r
+    message Foo {\r
+    }\r
+\r
+    extend .Foo {\r
+        optional Foo foo = 3; // references Bar.Foo\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/field_name_same_as_package/main.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/field_name_same_as_package/main.proto
new file mode 100644 (file)
index 0000000..6be8ba4
--- /dev/null
@@ -0,0 +1,7 @@
+package main;\r
+\r
+import "sub.proto";\r
+\r
+message MainMessage {\r
+    optional main.sub.Sub sub = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/field_name_same_as_package/sub.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/field_name_same_as_package/sub.proto
new file mode 100644 (file)
index 0000000..1c7ba4f
--- /dev/null
@@ -0,0 +1,5 @@
+package main.sub;\r
+\r
+message Sub {\r
+    optional string test1 = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/google/protobuf/descriptor.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/google/protobuf/descriptor.proto
new file mode 100644 (file)
index 0000000..83fe2e1
--- /dev/null
@@ -0,0 +1,620 @@
+// Protocol Buffers - Google's data interchange format\r
+// Copyright 2008 Google Inc.  All rights reserved.\r
+// http://code.google.com/p/protobuf/\r
+//\r
+// Redistribution and use in source and binary forms, with or without\r
+// modification, are permitted provided that the following conditions are\r
+// met:\r
+//\r
+//     * Redistributions of source code must retain the above copyright\r
+// notice, this list of conditions and the following disclaimer.\r
+//     * Redistributions in binary form must reproduce the above\r
+// copyright notice, this list of conditions and the following disclaimer\r
+// in the documentation and/or other materials provided with the\r
+// distribution.\r
+//     * Neither the name of Google Inc. nor the names of its\r
+// contributors may be used to endorse or promote products derived from\r
+// this software without specific prior written permission.\r
+//\r
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\r
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+\r
+// Author: kenton@google.com (Kenton Varda)\r
+//  Based on original Protocol Buffers design by\r
+//  Sanjay Ghemawat, Jeff Dean, and others.\r
+//\r
+// The messages in this file describe the definitions found in .proto files.\r
+// A valid .proto file can be translated directly to a FileDescriptorProto\r
+// without any other information (e.g. without reading its imports).\r
+\r
+\r
+\r
+package google.protobuf;\r
+option java_package = "com.google.protobuf";\r
+option java_outer_classname = "DescriptorProtos";\r
+\r
+// descriptor.proto must be optimized for speed because reflection-based\r
+// algorithms don't work during bootstrapping.\r
+option optimize_for = SPEED;\r
+\r
+// The protocol compiler can output a FileDescriptorSet containing the .proto\r
+// files it parses.\r
+message FileDescriptorSet {\r
+  repeated FileDescriptorProto file = 1;\r
+}\r
+\r
+// Describes a complete .proto file.\r
+message FileDescriptorProto {\r
+  optional string name = 1;       // file name, relative to root of source tree\r
+  optional string package = 2;    // e.g. "foo", "foo.bar", etc.\r
+\r
+  // Names of files imported by this file.\r
+  repeated string dependency = 3;\r
+  // Indexes of the public imported files in the dependency list above.\r
+  repeated int32 public_dependency = 10;\r
+  // Indexes of the weak imported files in the dependency list.\r
+  // For Google-internal migration only. Do not use.\r
+  repeated int32 weak_dependency = 11;\r
+\r
+  // All top-level definitions in this file.\r
+  repeated DescriptorProto message_type = 4;\r
+  repeated EnumDescriptorProto enum_type = 5;\r
+  repeated ServiceDescriptorProto service = 6;\r
+  repeated FieldDescriptorProto extension = 7;\r
+\r
+  optional FileOptions options = 8;\r
+\r
+  // This field contains optional information about the original source code.\r
+  // You may safely remove this entire field whithout harming runtime\r
+  // functionality of the descriptors -- the information is needed only by\r
+  // development tools.\r
+  optional SourceCodeInfo source_code_info = 9;\r
+}\r
+\r
+// Describes a message type.\r
+message DescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated FieldDescriptorProto field = 2;\r
+  repeated FieldDescriptorProto extension = 6;\r
+\r
+  repeated DescriptorProto nested_type = 3;\r
+  repeated EnumDescriptorProto enum_type = 4;\r
+\r
+  message ExtensionRange {\r
+    optional int32 start = 1;\r
+    optional int32 end = 2;\r
+  }\r
+  repeated ExtensionRange extension_range = 5;\r
+\r
+  optional MessageOptions options = 7;\r
+}\r
+\r
+// Describes a field within a message.\r
+message FieldDescriptorProto {\r
+  enum Type {\r
+    // 0 is reserved for errors.\r
+    // Order is weird for historical reasons.\r
+    TYPE_DOUBLE         = 1;\r
+    TYPE_FLOAT          = 2;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\r
+    // negative values are likely.\r
+    TYPE_INT64          = 3;\r
+    TYPE_UINT64         = 4;\r
+    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\r
+    // negative values are likely.\r
+    TYPE_INT32          = 5;\r
+    TYPE_FIXED64        = 6;\r
+    TYPE_FIXED32        = 7;\r
+    TYPE_BOOL           = 8;\r
+    TYPE_STRING         = 9;\r
+    TYPE_GROUP          = 10;  // Tag-delimited aggregate.\r
+    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.\r
+\r
+    // New in version 2.\r
+    TYPE_BYTES          = 12;\r
+    TYPE_UINT32         = 13;\r
+    TYPE_ENUM           = 14;\r
+    TYPE_SFIXED32       = 15;\r
+    TYPE_SFIXED64       = 16;\r
+    TYPE_SINT32         = 17;  // Uses ZigZag encoding.\r
+    TYPE_SINT64         = 18;  // Uses ZigZag encoding.\r
+  };\r
+\r
+  enum Label {\r
+    // 0 is reserved for errors\r
+    LABEL_OPTIONAL      = 1;\r
+    LABEL_REQUIRED      = 2;\r
+    LABEL_REPEATED      = 3;\r
+    // TODO(sanjay): Should we add LABEL_MAP?\r
+  };\r
+\r
+  optional string name = 1;\r
+  optional int32 number = 3;\r
+  optional Label label = 4;\r
+\r
+  // If type_name is set, this need not be set.  If both this and type_name\r
+  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.\r
+  optional Type type = 5;\r
+\r
+  // For message and enum types, this is the name of the type.  If the name\r
+  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\r
+  // rules are used to find the type (i.e. first the nested types within this\r
+  // message are searched, then within the parent, on up to the root\r
+  // namespace).\r
+  optional string type_name = 6;\r
+\r
+  // For extensions, this is the name of the type being extended.  It is\r
+  // resolved in the same manner as type_name.\r
+  optional string extendee = 2;\r
+\r
+  // For numeric types, contains the original text representation of the value.\r
+  // For booleans, "true" or "false".\r
+  // For strings, contains the default text contents (not escaped in any way).\r
+  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\r
+  // TODO(kenton):  Base-64 encode?\r
+  optional string default_value = 7;\r
+\r
+  optional FieldOptions options = 8;\r
+}\r
+\r
+// Describes an enum type.\r
+message EnumDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  repeated EnumValueDescriptorProto value = 2;\r
+\r
+  optional EnumOptions options = 3;\r
+}\r
+\r
+// Describes a value within an enum.\r
+message EnumValueDescriptorProto {\r
+  optional string name = 1;\r
+  optional int32 number = 2;\r
+\r
+  optional EnumValueOptions options = 3;\r
+}\r
+\r
+// Describes a service.\r
+message ServiceDescriptorProto {\r
+  optional string name = 1;\r
+  repeated MethodDescriptorProto method = 2;\r
+\r
+  optional ServiceOptions options = 3;\r
+}\r
+\r
+// Describes a method of a service.\r
+message MethodDescriptorProto {\r
+  optional string name = 1;\r
+\r
+  // Input and output type names.  These are resolved in the same way as\r
+  // FieldDescriptorProto.type_name, but must refer to a message type.\r
+  optional string input_type = 2;\r
+  optional string output_type = 3;\r
+\r
+  optional MethodOptions options = 4;\r
+}\r
+\r
+\r
+// ===================================================================\r
+// Options\r
+\r
+// Each of the definitions above may have "options" attached.  These are\r
+// just annotations which may cause code to be generated slightly differently\r
+// or may contain hints for code that manipulates protocol messages.\r
+//\r
+// Clients may define custom options as extensions of the *Options messages.\r
+// These extensions may not yet be known at parsing time, so the parser cannot\r
+// store the values in them.  Instead it stores them in a field in the *Options\r
+// message called uninterpreted_option. This field must have the same name\r
+// across all *Options messages. We then use this field to populate the\r
+// extensions when we build a descriptor, at which point all protos have been\r
+// parsed and so all extensions are known.\r
+//\r
+// Extension numbers for custom options may be chosen as follows:\r
+// * For options which will only be used within a single application or\r
+//   organization, or for experimental options, use field numbers 50000\r
+//   through 99999.  It is up to you to ensure that you do not use the\r
+//   same number for multiple options.\r
+// * For options which will be published and used publicly by multiple\r
+//   independent entities, e-mail protobuf-global-extension-registry@google.com\r
+//   to reserve extension numbers. Simply provide your project name (e.g.\r
+//   Object-C plugin) and your porject website (if available) -- there's no need\r
+//   to explain how you intend to use them. Usually you only need one extension\r
+//   number. You can declare multiple options with only one extension number by\r
+//   putting them in a sub-message. See the Custom Options section of the docs\r
+//   for examples:\r
+//   http://code.google.com/apis/protocolbuffers/docs/proto.html#options\r
+//   If this turns out to be popular, a web service will be set up\r
+//   to automatically assign option numbers.\r
+\r
+\r
+message FileOptions {\r
+\r
+  // Sets the Java package where classes generated from this .proto will be\r
+  // placed.  By default, the proto package is used, but this is often\r
+  // inappropriate because proto packages do not normally start with backwards\r
+  // domain names.\r
+  optional string java_package = 1;\r
+\r
+\r
+  // If set, all the classes from the .proto file are wrapped in a single\r
+  // outer class with the given name.  This applies to both Proto1\r
+  // (equivalent to the old "--one_java_file" option) and Proto2 (where\r
+  // a .proto always translates to a single class, but you may want to\r
+  // explicitly choose the class name).\r
+  optional string java_outer_classname = 8;\r
+\r
+  // If set true, then the Java code generator will generate a separate .java\r
+  // file for each top-level message, enum, and service defined in the .proto\r
+  // file.  Thus, these types will *not* be nested inside the outer class\r
+  // named by java_outer_classname.  However, the outer class will still be\r
+  // generated to contain the file's getDescriptor() method as well as any\r
+  // top-level extensions defined in the file.\r
+  optional bool java_multiple_files = 10 [default=false];\r
+\r
+  // If set true, then the Java code generator will generate equals() and\r
+  // hashCode() methods for all messages defined in the .proto file. This is\r
+  // purely a speed optimization, as the AbstractMessage base class includes\r
+  // reflection-based implementations of these methods.\r
+  optional bool java_generate_equals_and_hash = 20 [default=false];\r
+\r
+  // Generated classes can be optimized for speed or code size.\r
+  enum OptimizeMode {\r
+    SPEED = 1;        // Generate complete code for parsing, serialization,\r
+                      // etc.\r
+    CODE_SIZE = 2;    // Use ReflectionOps to implement these methods.\r
+    LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime.\r
+  }\r
+  optional OptimizeMode optimize_for = 9 [default=SPEED];\r
+\r
+  // Sets the Go package where structs generated from this .proto will be\r
+  // placed.  There is no default.\r
+  optional string go_package = 11;\r
+\r
+\r
+\r
+  // Should generic services be generated in each language?  "Generic" services\r
+  // are not specific to any particular RPC system.  They are generated by the\r
+  // main code generators in each language (without additional plugins).\r
+  // Generic services were the only kind of service generation supported by\r
+  // early versions of proto2.\r
+  //\r
+  // Generic services are now considered deprecated in favor of using plugins\r
+  // that generate code specific to your particular RPC system.  Therefore,\r
+  // these default to false.  Old code which depends on generic services should\r
+  // explicitly set them to true.\r
+  optional bool cc_generic_services = 16 [default=false];\r
+  optional bool java_generic_services = 17 [default=false];\r
+  optional bool py_generic_services = 18 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MessageOptions {\r
+  // Set true to use the old proto1 MessageSet wire format for extensions.\r
+  // This is provided for backwards-compatibility with the MessageSet wire\r
+  // format.  You should not use this for any other reason:  It's less\r
+  // efficient, has fewer features, and is more complicated.\r
+  //\r
+  // The message must be defined exactly as follows:\r
+  //   message Foo {\r
+  //     option message_set_wire_format = true;\r
+  //     extensions 4 to max;\r
+  //   }\r
+  // Note that the message cannot have any defined fields; MessageSets only\r
+  // have extensions.\r
+  //\r
+  // All extensions of your type must be singular messages; e.g. they cannot\r
+  // be int32s, enums, or repeated messages.\r
+  //\r
+  // Because this is an option, the above two restrictions are not enforced by\r
+  // the protocol compiler.\r
+  optional bool message_set_wire_format = 1 [default=false];\r
+\r
+  // Disables the generation of the standard "descriptor()" accessor, which can\r
+  // conflict with a field of the same name.  This is meant to make migration\r
+  // from proto1 easier; new code should avoid fields named "descriptor".\r
+  optional bool no_standard_descriptor_accessor = 2 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message FieldOptions {\r
+  // The ctype option instructs the C++ code generator to use a different\r
+  // representation of the field than it normally would.  See the specific\r
+  // options below.  This option is not yet implemented in the open source\r
+  // release -- sorry, we'll try to include it in a future version!\r
+  optional CType ctype = 1 [default = STRING];\r
+  enum CType {\r
+    // Default mode.\r
+    STRING = 0;\r
+\r
+    CORD = 1;\r
+\r
+    STRING_PIECE = 2;\r
+  }\r
+  // The packed option can be enabled for repeated primitive fields to enable\r
+  // a more efficient representation on the wire. Rather than repeatedly\r
+  // writing the tag and type for each element, the entire array is encoded as\r
+  // a single length-delimited blob.\r
+  optional bool packed = 2;\r
+\r
+\r
+\r
+  // Should this field be parsed lazily?  Lazy applies only to message-type\r
+  // fields.  It means that when the outer message is initially parsed, the\r
+  // inner message's contents will not be parsed but instead stored in encoded\r
+  // form.  The inner message will actually be parsed when it is first accessed.\r
+  //\r
+  // This is only a hint.  Implementations are free to choose whether to use\r
+  // eager or lazy parsing regardless of the value of this option.  However,\r
+  // setting this option true suggests that the protocol author believes that\r
+  // using lazy parsing on this field is worth the additional bookkeeping\r
+  // overhead typically needed to implement it.\r
+  //\r
+  // This option does not affect the public interface of any generated code;\r
+  // all method signatures remain the same.  Furthermore, thread-safety of the\r
+  // interface is not affected by this option; const methods remain safe to\r
+  // call from multiple threads concurrently, while non-const methods continue\r
+  // to require exclusive access.\r
+  //\r
+  //\r
+  // Note that implementations may choose not to check required fields within\r
+  // a lazy sub-message.  That is, calling IsInitialized() on the outher message\r
+  // may return true even if the inner message has missing required fields.\r
+  // This is necessary because otherwise the inner message would have to be\r
+  // parsed in order to perform the check, defeating the purpose of lazy\r
+  // parsing.  An implementation which chooses not to check required fields\r
+  // must be consistent about it.  That is, for any particular sub-message, the\r
+  // implementation must either *always* check its required fields, or *never*\r
+  // check its required fields, regardless of whether or not the message has\r
+  // been parsed.\r
+  optional bool lazy = 5 [default=false];\r
+\r
+  // Is this field deprecated?\r
+  // Depending on the target platform, this can emit Deprecated annotations\r
+  // for accessors, or it will be completely ignored; in the very least, this\r
+  // is a formalization for deprecating fields.\r
+  optional bool deprecated = 3 [default=false];\r
+\r
+  // EXPERIMENTAL.  DO NOT USE.\r
+  // For "map" fields, the name of the field in the enclosed type that\r
+  // is the key for this map.  For example, suppose we have:\r
+  //   message Item {\r
+  //     required string name = 1;\r
+  //     required string value = 2;\r
+  //   }\r
+  //   message Config {\r
+  //     repeated Item items = 1 [experimental_map_key="name"];\r
+  //   }\r
+  // In this situation, the map key for Item will be set to "name".\r
+  // TODO: Fully-implement this, then remove the "experimental_" prefix.\r
+  optional string experimental_map_key = 9;\r
+\r
+  // For Google-internal migration only. Do not use.\r
+  optional bool weak = 10 [default=false];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumOptions {\r
+\r
+  // Set this option to false to disallow mapping different tag names to a same\r
+  // value.\r
+  optional bool allow_alias = 2 [default=true];\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message EnumValueOptions {\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message ServiceOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+message MethodOptions {\r
+\r
+  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\r
+  //   framework.  We apologize for hoarding these numbers to ourselves, but\r
+  //   we were already using them long before we decided to release Protocol\r
+  //   Buffers.\r
+\r
+  // The parser stores options it doesn't recognize here. See above.\r
+  repeated UninterpretedOption uninterpreted_option = 999;\r
+\r
+  // Clients can define custom options in extensions of this message. See above.\r
+  extensions 1000 to max;\r
+}\r
+\r
+\r
+// A message representing a option the parser does not recognize. This only\r
+// appears in options protos created by the compiler::Parser class.\r
+// DescriptorPool resolves these when building Descriptor objects. Therefore,\r
+// options protos in descriptor objects (e.g. returned by Descriptor::options(),\r
+// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\r
+// in them.\r
+message UninterpretedOption {\r
+  // The name of the uninterpreted option.  Each string represents a segment in\r
+  // a dot-separated name.  is_extension is true iff a segment represents an\r
+  // extension (denoted with parentheses in options specs in .proto files).\r
+  // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents\r
+  // "foo.(bar.baz).qux".\r
+  message NamePart {\r
+    required string name_part = 1;\r
+    required bool is_extension = 2;\r
+  }\r
+  repeated NamePart name = 2;\r
+\r
+  // The value of the uninterpreted option, in whatever type the tokenizer\r
+  // identified it as during parsing. Exactly one of these should be set.\r
+  optional string identifier_value = 3;\r
+  optional uint64 positive_int_value = 4;\r
+  optional int64 negative_int_value = 5;\r
+  optional double double_value = 6;\r
+  optional bytes string_value = 7;\r
+  optional string aggregate_value = 8;\r
+}\r
+\r
+// ===================================================================\r
+// Optional source code info\r
+\r
+// Encapsulates information about the original source file from which a\r
+// FileDescriptorProto was generated.\r
+message SourceCodeInfo {\r
+  // A Location identifies a piece of source code in a .proto file which\r
+  // corresponds to a particular definition.  This information is intended\r
+  // to be useful to IDEs, code indexers, documentation generators, and similar\r
+  // tools.\r
+  //\r
+  // For example, say we have a file like:\r
+  //   message Foo {\r
+  //     optional string foo = 1;\r
+  //   }\r
+  // Let's look at just the field definition:\r
+  //   optional string foo = 1;\r
+  //   ^       ^^     ^^  ^  ^^^\r
+  //   a       bc     de  f  ghi\r
+  // We have the following locations:\r
+  //   span   path               represents\r
+  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\r
+  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\r
+  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\r
+  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\r
+  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\r
+  //\r
+  // Notes:\r
+  // - A location may refer to a repeated field itself (i.e. not to any\r
+  //   particular index within it).  This is used whenever a set of elements are\r
+  //   logically enclosed in a single code segment.  For example, an entire\r
+  //   extend block (possibly containing multiple extension definitions) will\r
+  //   have an outer location whose path refers to the "extensions" repeated\r
+  //   field without an index.\r
+  // - Multiple locations may have the same path.  This happens when a single\r
+  //   logical declaration is spread out across multiple places.  The most\r
+  //   obvious example is the "extend" block again -- there may be multiple\r
+  //   extend blocks in the same scope, each of which will have the same path.\r
+  // - A location's span is not always a subset of its parent's span.  For\r
+  //   example, the "extendee" of an extension declaration appears at the\r
+  //   beginning of the "extend" block and is shared by all extensions within\r
+  //   the block.\r
+  // - Just because a location's span is a subset of some other location's span\r
+  //   does not mean that it is a descendent.  For example, a "group" defines\r
+  //   both a type and a field in a single declaration.  Thus, the locations\r
+  //   corresponding to the type and field and their components will overlap.\r
+  // - Code which tries to interpret locations should probably be designed to\r
+  //   ignore those that it doesn't understand, as more types of locations could\r
+  //   be recorded in the future.\r
+  repeated Location location = 1;\r
+  message Location {\r
+    // Identifies which part of the FileDescriptorProto was defined at this\r
+    // location.\r
+    //\r
+    // Each element is a field number or an index.  They form a path from\r
+    // the root FileDescriptorProto to the place where the definition.  For\r
+    // example, this path:\r
+    //   [ 4, 3, 2, 7, 1 ]\r
+    // refers to:\r
+    //   file.message_type(3)  // 4, 3\r
+    //       .field(7)         // 2, 7\r
+    //       .name()           // 1\r
+    // This is because FileDescriptorProto.message_type has field number 4:\r
+    //   repeated DescriptorProto message_type = 4;\r
+    // and DescriptorProto.field has field number 2:\r
+    //   repeated FieldDescriptorProto field = 2;\r
+    // and FieldDescriptorProto.name has field number 1:\r
+    //   optional string name = 1;\r
+    //\r
+    // Thus, the above path gives the location of a field name.  If we removed\r
+    // the last element:\r
+    //   [ 4, 3, 2, 7 ]\r
+    // this path refers to the whole field declaration (from the beginning\r
+    // of the label to the terminating semicolon).\r
+    repeated int32 path = 1 [packed=true];\r
+\r
+    // Always has exactly three or four elements: start line, start column,\r
+    // end line (optional, otherwise assumed same as start line), end column.\r
+    // These are packed into a single field for efficiency.  Note that line\r
+    // and column numbers are zero-based -- typically you will want to add\r
+    // 1 to each before displaying to a user.\r
+    repeated int32 span = 2 [packed=true];\r
+\r
+    // If this SourceCodeInfo represents a complete declaration, these are any\r
+    // comments appearing before and after the declaration which appear to be\r
+    // attached to the declaration.\r
+    //\r
+    // A series of line comments appearing on consecutive lines, with no other\r
+    // tokens appearing on those lines, will be treated as a single comment.\r
+    //\r
+    // Only the comment content is provided; comment markers (e.g. //) are\r
+    // stripped out.  For block comments, leading whitespace and an asterisk\r
+    // will be stripped from the beginning of each line other than the first.\r
+    // Newlines are included in the output.\r
+    //\r
+    // Examples:\r
+    //\r
+    //   optional int32 foo = 1;  // Comment attached to foo.\r
+    //   // Comment attached to bar.\r
+    //   optional int32 bar = 2;\r
+    //\r
+    //   optional string baz = 3;\r
+    //   // Comment attached to baz.\r
+    //   // Another line attached to baz.\r
+    //\r
+    //   // Comment attached to qux.\r
+    //   //\r
+    //   // Another line attached to qux.\r
+    //   optional double qux = 4;\r
+    //\r
+    //   optional string corge = 5;\r
+    //   /* Block comment attached\r
+    //    * to corge.  Leading asterisks\r
+    //    * will be removed. */\r
+    //   /* Block comment attached to\r
+    //    * grault. */\r
+    //   optional int32 grault = 6;\r
+    optional string leading_comments = 3;\r
+    optional string trailing_comments = 4;\r
+  }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/groups.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/groups.proto
new file mode 100644 (file)
index 0000000..9e96720
--- /dev/null
@@ -0,0 +1,13 @@
+message Outer {\r
+  required string before = 1;\r
+  repeated group MyInner = 2 [deprecated=true] {\r
+    required string a = 3;\r
+  }\r
+  required string after = 4;\r
+  optional MyInner myInner2 = 5;\r
+}\r
+\r
+message OuterSparse {\r
+  required string before = 1;\r
+  required string after = 4;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file1.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file1.proto
new file mode 100644 (file)
index 0000000..eaf02ee
--- /dev/null
@@ -0,0 +1 @@
+import "importRoot/file2.proto";\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file2.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file2.proto
new file mode 100644 (file)
index 0000000..44c7794
--- /dev/null
@@ -0,0 +1 @@
+import "importRoot/file3.proto";\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file3.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/importRoot/file3.proto
new file mode 100644 (file)
index 0000000..24377d9
--- /dev/null
@@ -0,0 +1 @@
+message Test {}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/import_a.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/import_a.proto
new file mode 100644 (file)
index 0000000..f50242f
--- /dev/null
@@ -0,0 +1,5 @@
+import "import_common.proto";\r
+\r
+message A {\r
+    optional Common common = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/import_a_single_quote.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/import_a_single_quote.proto
new file mode 100644 (file)
index 0000000..6ea6844
--- /dev/null
@@ -0,0 +1,5 @@
+import 'import_common.proto';\r
+\r
+message A {\r
+    optional Common common = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/import_b.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/import_b.proto
new file mode 100644 (file)
index 0000000..4809bfd
--- /dev/null
@@ -0,0 +1,5 @@
+import "import_common.proto";\r
+\r
+message B {\r
+    optional Common common = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/import_common.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/import_common.proto
new file mode 100644 (file)
index 0000000..ad9bfe7
--- /dev/null
@@ -0,0 +1,2 @@
+message Common {\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/imports-toplevel.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/imports-toplevel.proto
new file mode 100644 (file)
index 0000000..ebca0ff
--- /dev/null
@@ -0,0 +1,13 @@
+import "toplevel.proto";\r
+\r
+package My;\r
+\r
+enum MyEnum1 {\r
+    ONE = 1;\r
+    TWO = 2;\r
+}\r
+\r
+message Test1 {\r
+    required MyEnum num = 1 [default=ONE];\r
+    required MyEnum1 num1 = 2 [default=ONE];\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/imports-weak.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/imports-weak.proto
new file mode 100644 (file)
index 0000000..a5986f1
--- /dev/null
@@ -0,0 +1,7 @@
+package My;\r
+\r
+import weak "example1.proto";\r
+\r
+message Test2 {\r
+    required Test1 test1 = 1;\r
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/imports.json b/legacy-libs/grpc/node_modules/protobufjs/tests/imports.json
new file mode 100644 (file)
index 0000000..c92a99c
--- /dev/null
@@ -0,0 +1,83 @@
+{\r
+    "package": "My",\r
+    "messages": [\r
+        {\r
+            "name": "Test3",\r
+            "fields": [\r
+                {\r
+                    "rule": "required",\r
+                    "options": {},\r
+                    "type": "Test1",\r
+                    "name": "test1",\r
+                    "id": 1\r
+                },\r
+                {\r
+                    "rule": "required",\r
+                    "options": {},\r
+                    "type": ".Test2",\r
+                    "name": "test2",\r
+                    "id": 2\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {},\r
+            "oneofs": {}\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [\r
+        {\r
+            "package": null,\r
+            "messages": [\r
+                {\r
+                    "name": "Test1",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "required",\r
+                            "options": {},\r
+                            "type": "int32",\r
+                            "name": "a",\r
+                            "id": 1\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {},\r
+                    "oneofs": {}\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "imports": [],\r
+            "options": {},\r
+            "services": []\r
+        },\r
+        {\r
+            "package": null,\r
+            "messages": [\r
+                {\r
+                    "name": "Test2",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "required",\r
+                            "options": {},\r
+                            "type": "string",\r
+                            "name": "b",\r
+                            "id": 2\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {},\r
+                    "oneofs": {}\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "imports": [],\r
+            "options": {},\r
+            "services": []\r
+        }\r
+    ],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/imports.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/imports.proto
new file mode 100644 (file)
index 0000000..e604dac
--- /dev/null
@@ -0,0 +1,9 @@
+package My;\r
+\r
+import public "example1.proto";\r
+import "example2.proto";\r
+\r
+message Test3 {\r
+    required Test1 test1 = 1;\r
+    required .Test2 test2 = 2;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/inner.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/inner.proto
new file mode 100644 (file)
index 0000000..c750f28
--- /dev/null
@@ -0,0 +1,10 @@
+message Foo {\r
+    required Bar bar = 1;\r
+    required Baz baz = 2;\r
+}\r
+message Bar {\r
+    required string blah = 1;\r
+}\r
+message Baz {\r
+    required string blah = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/negid.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/negid.proto
new file mode 100644 (file)
index 0000000..9b6a2ec
--- /dev/null
@@ -0,0 +1,9 @@
+message Test {\r
+    required LobbyType type = 1 [default=INVALID];\r
+    \r
+    enum LobbyType {\r
+        INVALID = -1;\r
+        MATCH = 0;\r
+        PRACTICE = 1;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/LICENSE b/legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/LICENSE
new file mode 100644 (file)
index 0000000..5dfdc43
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Caolan McMahon\r
+\r
+Permission is hereby granted, free of charge, to any person obtaining a copy\r
+of this software and associated documentation files (the "Software"), to deal\r
+in the Software without restriction, including without limitation the rights\r
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+copies of the Software, and to permit persons to whom the Software is\r
+furnished to do so, subject to the following conditions:\r
+\r
+The above copyright notice and this permission notice shall be included in\r
+all copies or substantial portions of the Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+THE SOFTWARE.\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.css b/legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.css
new file mode 100644 (file)
index 0000000..4c3f20c
--- /dev/null
@@ -0,0 +1,70 @@
+/*!\r
+ * Styles taken from qunit.css\r
+ */\r
+\r
+h1#nodeunit-header, h1.nodeunit-header {\r
+    padding: 15px;\r
+    font-size: large;\r
+    background-color: #06b;\r
+    color: white;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    margin: 0;\r
+}\r
+\r
+h1#nodeunit-header a {\r
+    color: white;\r
+}\r
+\r
+h2#nodeunit-banner {\r
+    height: 2em;\r
+    border-bottom: 1px solid white;\r
+    background-color: #eee;\r
+    margin: 0;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+}\r
+h2#nodeunit-banner.pass {\r
+    background-color: green;\r
+}\r
+h2#nodeunit-banner.fail {\r
+    background-color: red;\r
+}\r
+\r
+h2#nodeunit-userAgent, h2.nodeunit-userAgent {\r
+    padding: 10px;\r
+    background-color: #eee;\r
+    color: black;\r
+    margin: 0;\r
+    font-size: small;\r
+    font-weight: normal;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    font-size: 10pt;\r
+}\r
+\r
+div#nodeunit-testrunner-toolbar {\r
+    background: #eee;\r
+    border-top: 1px solid black;\r
+    padding: 10px;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    margin: 0;\r
+    font-size: 10pt;\r
+}\r
+\r
+ol#nodeunit-tests {\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+    font-size: 10pt;\r
+}\r
+ol#nodeunit-tests li strong {\r
+    cursor:pointer;\r
+}\r
+ol#nodeunit-tests .pass {\r
+    color: green;\r
+} \r
+ol#nodeunit-tests .fail {\r
+    color: red;\r
+} \r
+\r
+p#nodeunit-testresult {\r
+    margin-left: 1em;\r
+    font-size: 10pt;\r
+    font-family: 'trebuchet ms', verdana, arial;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.js b/legacy-libs/grpc/node_modules/protobufjs/tests/nodeunit-browser/nodeunit.js
new file mode 100644 (file)
index 0000000..2f8f20d
--- /dev/null
@@ -0,0 +1,2108 @@
+/*!\r
+ * Nodeunit\r
+ * https://github.com/caolan/nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * json2.js\r
+ * http://www.JSON.org/json2.js\r
+ * Public Domain.\r
+ * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\r
+ */\r
+nodeunit = (function(){\r
+/*\r
+    http://www.JSON.org/json2.js\r
+    2010-11-17\r
+\r
+    Public Domain.\r
+\r
+    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\r
+\r
+    See http://www.JSON.org/js.html\r
+\r
+\r
+    This code should be minified before deployment.\r
+    See http://javascript.crockford.com/jsmin.html\r
+\r
+    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\r
+    NOT CONTROL.\r
+\r
+\r
+    This file creates a global JSON object containing two methods: stringify\r
+    and parse.\r
+\r
+        JSON.stringify(value, replacer, space)\r
+            value       any JavaScript value, usually an object or array.\r
+\r
+            replacer    an optional parameter that determines how object\r
+                        values are stringified for objects. It can be a\r
+                        function or an array of strings.\r
+\r
+            space       an optional parameter that specifies the indentation\r
+                        of nested structures. If it is omitted, the text will\r
+                        be packed without extra whitespace. If it is a number,\r
+                        it will specify the number of spaces to indent at each\r
+                        level. If it is a string (such as '\t' or '&nbsp;'),\r
+                        it contains the characters used to indent at each level.\r
+\r
+            This method produces a JSON text from a JavaScript value.\r
+\r
+            When an object value is found, if the object contains a toJSON\r
+            method, its toJSON method will be called and the result will be\r
+            stringified. A toJSON method does not serialize: it returns the\r
+            value represented by the name/value pair that should be serialized,\r
+            or undefined if nothing should be serialized. The toJSON method\r
+            will be passed the key associated with the value, and this will be\r
+            bound to the value\r
+\r
+            For example, this would serialize Dates as ISO strings.\r
+\r
+                Date.prototype.toJSON = function (key) {\r
+                    function f(n) {\r
+                        // Format integers to have at least two digits.\r
+                        return n < 10 ? '0' + n : n;\r
+                    }\r
+\r
+                    return this.getUTCFullYear()   + '-' +\r
+                         f(this.getUTCMonth() + 1) + '-' +\r
+                         f(this.getUTCDate())      + 'T' +\r
+                         f(this.getUTCHours())     + ':' +\r
+                         f(this.getUTCMinutes())   + ':' +\r
+                         f(this.getUTCSeconds())   + 'Z';\r
+                };\r
+\r
+            You can provide an optional replacer method. It will be passed the\r
+            key and value of each member, with this bound to the containing\r
+            object. The value that is returned from your method will be\r
+            serialized. If your method returns undefined, then the member will\r
+            be excluded from the serialization.\r
+\r
+            If the replacer parameter is an array of strings, then it will be\r
+            used to select the members to be serialized. It filters the results\r
+            such that only members with keys listed in the replacer array are\r
+            stringified.\r
+\r
+            Values that do not have JSON representations, such as undefined or\r
+            functions, will not be serialized. Such values in objects will be\r
+            dropped; in arrays they will be replaced with null. You can use\r
+            a replacer function to replace those with JSON values.\r
+            JSON.stringify(undefined) returns undefined.\r
+\r
+            The optional space parameter produces a stringification of the\r
+            value that is filled with line breaks and indentation to make it\r
+            easier to read.\r
+\r
+            If the space parameter is a non-empty string, then that string will\r
+            be used for indentation. If the space parameter is a number, then\r
+            the indentation will be that many spaces.\r
+\r
+            Example:\r
+\r
+            text = JSON.stringify(['e', {pluribus: 'unum'}]);\r
+            // text is '["e",{"pluribus":"unum"}]'\r
+\r
+\r
+            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');\r
+            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'\r
+\r
+            text = JSON.stringify([new Date()], function (key, value) {\r
+                return this[key] instanceof Date ?\r
+                    'Date(' + this[key] + ')' : value;\r
+            });\r
+            // text is '["Date(---current time---)"]'\r
+\r
+\r
+        JSON.parse(text, reviver)\r
+            This method parses a JSON text to produce an object or array.\r
+            It can throw a SyntaxError exception.\r
+\r
+            The optional reviver parameter is a function that can filter and\r
+            transform the results. It receives each of the keys and values,\r
+            and its return value is used instead of the original value.\r
+            If it returns what it received, then the structure is not modified.\r
+            If it returns undefined then the member is deleted.\r
+\r
+            Example:\r
+\r
+            // Parse the text. Values that look like ISO date strings will\r
+            // be converted to Date objects.\r
+\r
+            myData = JSON.parse(text, function (key, value) {\r
+                var a;\r
+                if (typeof value === 'string') {\r
+                    a =\r
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);\r
+                    if (a) {\r
+                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\r
+                            +a[5], +a[6]));\r
+                    }\r
+                }\r
+                return value;\r
+            });\r
+\r
+            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {\r
+                var d;\r
+                if (typeof value === 'string' &&\r
+                        value.slice(0, 5) === 'Date(' &&\r
+                        value.slice(-1) === ')') {\r
+                    d = new Date(value.slice(5, -1));\r
+                    if (d) {\r
+                        return d;\r
+                    }\r
+                }\r
+                return value;\r
+            });\r
+\r
+\r
+    This is a reference implementation. You are free to copy, modify, or\r
+    redistribute.\r
+*/\r
+\r
+/*jslint evil: true, strict: false, regexp: false */\r
+\r
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,\r
+    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\r
+    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\r
+    lastIndex, length, parse, prototype, push, replace, slice, stringify,\r
+    test, toJSON, toString, valueOf\r
+*/\r
+\r
+\r
+// Create a JSON object only if one does not already exist. We create the\r
+// methods in a closure to avoid creating global variables.\r
+\r
+var JSON = {};\r
+\r
+(function () {\r
+    "use strict";\r
+\r
+    function f(n) {\r
+        // Format integers to have at least two digits.\r
+        return n < 10 ? '0' + n : n;\r
+    }\r
+\r
+    if (typeof Date.prototype.toJSON !== 'function') {\r
+\r
+        Date.prototype.toJSON = function (key) {\r
+\r
+            return isFinite(this.valueOf()) ?\r
+                   this.getUTCFullYear()   + '-' +\r
+                 f(this.getUTCMonth() + 1) + '-' +\r
+                 f(this.getUTCDate())      + 'T' +\r
+                 f(this.getUTCHours())     + ':' +\r
+                 f(this.getUTCMinutes())   + ':' +\r
+                 f(this.getUTCSeconds())   + 'Z' : null;\r
+        };\r
+\r
+        String.prototype.toJSON =\r
+        Number.prototype.toJSON =\r
+        Boolean.prototype.toJSON = function (key) {\r
+            return this.valueOf();\r
+        };\r
+    }\r
+\r
+    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,\r
+        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,\r
+        gap,\r
+        indent,\r
+        meta = {    // table of character substitutions\r
+            '\b': '\\b',\r
+            '\t': '\\t',\r
+            '\n': '\\n',\r
+            '\f': '\\f',\r
+            '\r': '\\r',\r
+            '"' : '\\"',\r
+            '\\': '\\\\'\r
+        },\r
+        rep;\r
+\r
+\r
+    function quote(string) {\r
+\r
+// If the string contains no control characters, no quote characters, and no\r
+// backslash characters, then we can safely slap some quotes around it.\r
+// Otherwise we must also replace the offending characters with safe escape\r
+// sequences.\r
+\r
+        escapable.lastIndex = 0;\r
+        return escapable.test(string) ?\r
+            '"' + string.replace(escapable, function (a) {\r
+                var c = meta[a];\r
+                return typeof c === 'string' ? c :\r
+                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\r
+            }) + '"' :\r
+            '"' + string + '"';\r
+    }\r
+\r
+\r
+    function str(key, holder) {\r
+\r
+// Produce a string from holder[key].\r
+\r
+        var i,          // The loop counter.\r
+            k,          // The member key.\r
+            v,          // The member value.\r
+            length,\r
+            mind = gap,\r
+            partial,\r
+            value = holder[key];\r
+\r
+// If the value has a toJSON method, call it to obtain a replacement value.\r
+\r
+        if (value && typeof value === 'object' &&\r
+                typeof value.toJSON === 'function') {\r
+            value = value.toJSON(key);\r
+        }\r
+\r
+// If we were called with a replacer function, then call the replacer to\r
+// obtain a replacement value.\r
+\r
+        if (typeof rep === 'function') {\r
+            value = rep.call(holder, key, value);\r
+        }\r
+\r
+// What happens next depends on the value's type.\r
+\r
+        switch (typeof value) {\r
+        case 'string':\r
+            return quote(value);\r
+\r
+        case 'number':\r
+\r
+// JSON numbers must be finite. Encode non-finite numbers as null.\r
+\r
+            return isFinite(value) ? String(value) : 'null';\r
+\r
+        case 'boolean':\r
+        case 'null':\r
+\r
+// If the value is a boolean or null, convert it to a string. Note:\r
+// typeof null does not produce 'null'. The case is included here in\r
+// the remote chance that this gets fixed someday.\r
+\r
+            return String(value);\r
+\r
+// If the type is 'object', we might be dealing with an object or an array or\r
+// null.\r
+\r
+        case 'object':\r
+\r
+// Due to a specification blunder in ECMAScript, typeof null is 'object',\r
+// so watch out for that case.\r
+\r
+            if (!value) {\r
+                return 'null';\r
+            }\r
+\r
+// Make an array to hold the partial results of stringifying this object value.\r
+\r
+            gap += indent;\r
+            partial = [];\r
+\r
+// Is the value an array?\r
+\r
+            if (Object.prototype.toString.apply(value) === '[object Array]') {\r
+\r
+// The value is an array. Stringify every element. Use null as a placeholder\r
+// for non-JSON values.\r
+\r
+                length = value.length;\r
+                for (i = 0; i < length; i += 1) {\r
+                    partial[i] = str(i, value) || 'null';\r
+                }\r
+\r
+// Join all of the elements together, separated with commas, and wrap them in\r
+// brackets.\r
+\r
+                v = partial.length === 0 ? '[]' :\r
+                    gap ? '[\n' + gap +\r
+                            partial.join(',\n' + gap) + '\n' +\r
+                                mind + ']' :\r
+                          '[' + partial.join(',') + ']';\r
+                gap = mind;\r
+                return v;\r
+            }\r
+\r
+// If the replacer is an array, use it to select the members to be stringified.\r
+\r
+            if (rep && typeof rep === 'object') {\r
+                length = rep.length;\r
+                for (i = 0; i < length; i += 1) {\r
+                    k = rep[i];\r
+                    if (typeof k === 'string') {\r
+                        v = str(k, value);\r
+                        if (v) {\r
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);\r
+                        }\r
+                    }\r
+                }\r
+            } else {\r
+\r
+// Otherwise, iterate through all of the keys in the object.\r
+\r
+                for (k in value) {\r
+                    if (Object.hasOwnProperty.call(value, k)) {\r
+                        v = str(k, value);\r
+                        if (v) {\r
+                            partial.push(quote(k) + (gap ? ': ' : ':') + v);\r
+                        }\r
+                    }\r
+                }\r
+            }\r
+\r
+// Join all of the member texts together, separated with commas,\r
+// and wrap them in braces.\r
+\r
+            v = partial.length === 0 ? '{}' :\r
+                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +\r
+                        mind + '}' : '{' + partial.join(',') + '}';\r
+            gap = mind;\r
+            return v;\r
+        }\r
+    }\r
+\r
+// If the JSON object does not yet have a stringify method, give it one.\r
+\r
+    if (typeof JSON.stringify !== 'function') {\r
+        JSON.stringify = function (value, replacer, space) {\r
+\r
+// The stringify method takes a value and an optional replacer, and an optional\r
+// space parameter, and returns a JSON text. The replacer can be a function\r
+// that can replace values, or an array of strings that will select the keys.\r
+// A default replacer method can be provided. Use of the space parameter can\r
+// produce text that is more easily readable.\r
+\r
+            var i;\r
+            gap = '';\r
+            indent = '';\r
+\r
+// If the space parameter is a number, make an indent string containing that\r
+// many spaces.\r
+\r
+            if (typeof space === 'number') {\r
+                for (i = 0; i < space; i += 1) {\r
+                    indent += ' ';\r
+                }\r
+\r
+// If the space parameter is a string, it will be used as the indent string.\r
+\r
+            } else if (typeof space === 'string') {\r
+                indent = space;\r
+            }\r
+\r
+// If there is a replacer, it must be a function or an array.\r
+// Otherwise, throw an error.\r
+\r
+            rep = replacer;\r
+            if (replacer && typeof replacer !== 'function' &&\r
+                    (typeof replacer !== 'object' ||\r
+                     typeof replacer.length !== 'number')) {\r
+                throw new Error('JSON.stringify');\r
+            }\r
+\r
+// Make a fake root object containing our value under the key of ''.\r
+// Return the result of stringifying the value.\r
+\r
+            return str('', {'': value});\r
+        };\r
+    }\r
+\r
+\r
+// If the JSON object does not yet have a parse method, give it one.\r
+\r
+    if (typeof JSON.parse !== 'function') {\r
+        JSON.parse = function (text, reviver) {\r
+\r
+// The parse method takes a text and an optional reviver function, and returns\r
+// a JavaScript value if the text is a valid JSON text.\r
+\r
+            var j;\r
+\r
+            function walk(holder, key) {\r
+\r
+// The walk method is used to recursively walk the resulting structure so\r
+// that modifications can be made.\r
+\r
+                var k, v, value = holder[key];\r
+                if (value && typeof value === 'object') {\r
+                    for (k in value) {\r
+                        if (Object.hasOwnProperty.call(value, k)) {\r
+                            v = walk(value, k);\r
+                            if (v !== undefined) {\r
+                                value[k] = v;\r
+                            } else {\r
+                                delete value[k];\r
+                            }\r
+                        }\r
+                    }\r
+                }\r
+                return reviver.call(holder, key, value);\r
+            }\r
+\r
+\r
+// Parsing happens in four stages. In the first stage, we replace certain\r
+// Unicode characters with escape sequences. JavaScript handles many characters\r
+// incorrectly, either silently deleting them, or treating them as line endings.\r
+\r
+            text = String(text);\r
+            cx.lastIndex = 0;\r
+            if (cx.test(text)) {\r
+                text = text.replace(cx, function (a) {\r
+                    return '\\u' +\r
+                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);\r
+                });\r
+            }\r
+\r
+// In the second stage, we run the text against regular expressions that look\r
+// for non-JSON patterns. We are especially concerned with '()' and 'new'\r
+// because they can cause invocation, and '=' because it can cause mutation.\r
+// But just to be safe, we want to reject all unexpected forms.\r
+\r
+// We split the second stage into 4 regexp operations in order to work around\r
+// crippling inefficiencies in IE's and Safari's regexp engines. First we\r
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we\r
+// replace all simple value tokens with ']' characters. Third, we delete all\r
+// open brackets that follow a colon or comma or that begin the text. Finally,\r
+// we look to see that the remaining characters are only whitespace or ']' or\r
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.\r
+\r
+            if (/^[\],:{}\s]*$/\r
+.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')\r
+.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')\r
+.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {\r
+\r
+// In the third stage we use the eval function to compile the text into a\r
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity\r
+// in JavaScript: it can begin a block or an object literal. We wrap the text\r
+// in parens to eliminate the ambiguity.\r
+\r
+                j = eval('(' + text + ')');\r
+\r
+// In the optional fourth stage, we recursively walk the new structure, passing\r
+// each name/value pair to a reviver function for possible transformation.\r
+\r
+                return typeof reviver === 'function' ?\r
+                    walk({'': j}, '') : j;\r
+            }\r
+\r
+// If the text is not JSON parseable, then a SyntaxError is thrown.\r
+\r
+            throw new SyntaxError('JSON.parse');\r
+        };\r
+    }\r
+}());\r
+var assert = this.assert = {};\r
+var types = {};\r
+var core = {};\r
+var nodeunit = {};\r
+var reporter = {};\r
+/*global setTimeout: false, console: false */\r
+(function () {\r
+\r
+    var async = {};\r
+\r
+    // global on the server, window in the browser\r
+    var root = this,\r
+        previous_async = root.async;\r
+\r
+    if (typeof module !== 'undefined' && module.exports) {\r
+        module.exports = async;\r
+    }\r
+    else {\r
+        root.async = async;\r
+    }\r
+\r
+    async.noConflict = function () {\r
+        root.async = previous_async;\r
+        return async;\r
+    };\r
+\r
+    //// cross-browser compatiblity functions ////\r
+\r
+    var _forEach = function (arr, iterator) {\r
+        if (arr.forEach) {\r
+            return arr.forEach(iterator);\r
+        }\r
+        for (var i = 0; i < arr.length; i += 1) {\r
+            iterator(arr[i], i, arr);\r
+        }\r
+    };\r
+\r
+    var _map = function (arr, iterator) {\r
+        if (arr.map) {\r
+            return arr.map(iterator);\r
+        }\r
+        var results = [];\r
+        _forEach(arr, function (x, i, a) {\r
+            results.push(iterator(x, i, a));\r
+        });\r
+        return results;\r
+    };\r
+\r
+    var _reduce = function (arr, iterator, memo) {\r
+        if (arr.reduce) {\r
+            return arr.reduce(iterator, memo);\r
+        }\r
+        _forEach(arr, function (x, i, a) {\r
+            memo = iterator(memo, x, i, a);\r
+        });\r
+        return memo;\r
+    };\r
+\r
+    var _keys = function (obj) {\r
+        if (Object.keys) {\r
+            return Object.keys(obj);\r
+        }\r
+        var keys = [];\r
+        for (var k in obj) {\r
+            if (obj.hasOwnProperty(k)) {\r
+                keys.push(k);\r
+            }\r
+        }\r
+        return keys;\r
+    };\r
+\r
+    var _indexOf = function (arr, item) {\r
+        if (arr.indexOf) {\r
+            return arr.indexOf(item);\r
+        }\r
+        for (var i = 0; i < arr.length; i += 1) {\r
+            if (arr[i] === item) {\r
+                return i;\r
+            }\r
+        }\r
+        return -1;\r
+    };\r
+\r
+    //// exported async module functions ////\r
+\r
+    //// nextTick implementation with browser-compatible fallback ////\r
+    if (typeof process === 'undefined' || !(process.nextTick)) {\r
+        async.nextTick = function (fn) {\r
+            setTimeout(fn, 0);\r
+        };\r
+    }\r
+    else {\r
+        async.nextTick = process.nextTick;\r
+    }\r
+\r
+    async.forEach = function (arr, iterator, callback) {\r
+        if (!arr.length) {\r
+            return callback();\r
+        }\r
+        var completed = 0;\r
+        _forEach(arr, function (x) {\r
+            iterator(x, function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    completed += 1;\r
+                    if (completed === arr.length) {\r
+                        callback();\r
+                    }\r
+                }\r
+            });\r
+        });\r
+    };\r
+\r
+    async.forEachSeries = function (arr, iterator, callback) {\r
+        if (!arr.length) {\r
+            return callback();\r
+        }\r
+        var completed = 0;\r
+        var iterate = function () {\r
+            iterator(arr[completed], function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    completed += 1;\r
+                    if (completed === arr.length) {\r
+                        callback();\r
+                    }\r
+                    else {\r
+                        iterate();\r
+                    }\r
+                }\r
+            });\r
+        };\r
+        iterate();\r
+    };\r
+\r
+\r
+    var doParallel = function (fn) {\r
+        return function () {\r
+            var args = Array.prototype.slice.call(arguments);\r
+            return fn.apply(null, [async.forEach].concat(args));\r
+        };\r
+    };\r
+    var doSeries = function (fn) {\r
+        return function () {\r
+            var args = Array.prototype.slice.call(arguments);\r
+            return fn.apply(null, [async.forEachSeries].concat(args));\r
+        };\r
+    };\r
+\r
+\r
+    var _asyncMap = function (eachfn, arr, iterator, callback) {\r
+        var results = [];\r
+        arr = _map(arr, function (x, i) {\r
+            return {index: i, value: x};\r
+        });\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x.value, function (err, v) {\r
+                results[x.index] = v;\r
+                callback(err);\r
+            });\r
+        }, function (err) {\r
+            callback(err, results);\r
+        });\r
+    };\r
+    async.map = doParallel(_asyncMap);\r
+    async.mapSeries = doSeries(_asyncMap);\r
+\r
+\r
+    // reduce only has a series version, as doing reduce in parallel won't\r
+    // work in many situations.\r
+    async.reduce = function (arr, memo, iterator, callback) {\r
+        async.forEachSeries(arr, function (x, callback) {\r
+            iterator(memo, x, function (err, v) {\r
+                memo = v;\r
+                callback(err);\r
+            });\r
+        }, function (err) {\r
+            callback(err, memo);\r
+        });\r
+    };\r
+    // inject alias\r
+    async.inject = async.reduce;\r
+    // foldl alias\r
+    async.foldl = async.reduce;\r
+\r
+    async.reduceRight = function (arr, memo, iterator, callback) {\r
+        var reversed = _map(arr, function (x) {\r
+            return x;\r
+        }).reverse();\r
+        async.reduce(reversed, memo, iterator, callback);\r
+    };\r
+    // foldr alias\r
+    async.foldr = async.reduceRight;\r
+\r
+    var _filter = function (eachfn, arr, iterator, callback) {\r
+        var results = [];\r
+        arr = _map(arr, function (x, i) {\r
+            return {index: i, value: x};\r
+        });\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x.value, function (v) {\r
+                if (v) {\r
+                    results.push(x);\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            callback(_map(results.sort(function (a, b) {\r
+                return a.index - b.index;\r
+            }), function (x) {\r
+                return x.value;\r
+            }));\r
+        });\r
+    };\r
+    async.filter = doParallel(_filter);\r
+    async.filterSeries = doSeries(_filter);\r
+    // select alias\r
+    async.select = async.filter;\r
+    async.selectSeries = async.filterSeries;\r
+\r
+    var _reject = function (eachfn, arr, iterator, callback) {\r
+        var results = [];\r
+        arr = _map(arr, function (x, i) {\r
+            return {index: i, value: x};\r
+        });\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x.value, function (v) {\r
+                if (!v) {\r
+                    results.push(x);\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            callback(_map(results.sort(function (a, b) {\r
+                return a.index - b.index;\r
+            }), function (x) {\r
+                return x.value;\r
+            }));\r
+        });\r
+    };\r
+    async.reject = doParallel(_reject);\r
+    async.rejectSeries = doSeries(_reject);\r
+\r
+    var _detect = function (eachfn, arr, iterator, main_callback) {\r
+        eachfn(arr, function (x, callback) {\r
+            iterator(x, function (result) {\r
+                if (result) {\r
+                    main_callback(x);\r
+                }\r
+                else {\r
+                    callback();\r
+                }\r
+            });\r
+        }, function (err) {\r
+            main_callback();\r
+        });\r
+    };\r
+    async.detect = doParallel(_detect);\r
+    async.detectSeries = doSeries(_detect);\r
+\r
+    async.some = function (arr, iterator, main_callback) {\r
+        async.forEach(arr, function (x, callback) {\r
+            iterator(x, function (v) {\r
+                if (v) {\r
+                    main_callback(true);\r
+                    main_callback = function () {};\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            main_callback(false);\r
+        });\r
+    };\r
+    // any alias\r
+    async.any = async.some;\r
+\r
+    async.every = function (arr, iterator, main_callback) {\r
+        async.forEach(arr, function (x, callback) {\r
+            iterator(x, function (v) {\r
+                if (!v) {\r
+                    main_callback(false);\r
+                    main_callback = function () {};\r
+                }\r
+                callback();\r
+            });\r
+        }, function (err) {\r
+            main_callback(true);\r
+        });\r
+    };\r
+    // all alias\r
+    async.all = async.every;\r
+\r
+    async.sortBy = function (arr, iterator, callback) {\r
+        async.map(arr, function (x, callback) {\r
+            iterator(x, function (err, criteria) {\r
+                if (err) {\r
+                    callback(err);\r
+                }\r
+                else {\r
+                    callback(null, {value: x, criteria: criteria});\r
+                }\r
+            });\r
+        }, function (err, results) {\r
+            if (err) {\r
+                return callback(err);\r
+            }\r
+            else {\r
+                var fn = function (left, right) {\r
+                    var a = left.criteria, b = right.criteria;\r
+                    return a < b ? -1 : a > b ? 1 : 0;\r
+                };\r
+                callback(null, _map(results.sort(fn), function (x) {\r
+                    return x.value;\r
+                }));\r
+            }\r
+        });\r
+    };\r
+\r
+    async.auto = function (tasks, callback) {\r
+        callback = callback || function () {};\r
+        var keys = _keys(tasks);\r
+        if (!keys.length) {\r
+            return callback(null);\r
+        }\r
+\r
+        var completed = [];\r
+\r
+        var listeners = [];\r
+        var addListener = function (fn) {\r
+            listeners.unshift(fn);\r
+        };\r
+        var removeListener = function (fn) {\r
+            for (var i = 0; i < listeners.length; i += 1) {\r
+                if (listeners[i] === fn) {\r
+                    listeners.splice(i, 1);\r
+                    return;\r
+                }\r
+            }\r
+        };\r
+        var taskComplete = function () {\r
+            _forEach(listeners, function (fn) {\r
+                fn();\r
+            });\r
+        };\r
+\r
+        addListener(function () {\r
+            if (completed.length === keys.length) {\r
+                callback(null);\r
+            }\r
+        });\r
+\r
+        _forEach(keys, function (k) {\r
+            var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];\r
+            var taskCallback = function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    // stop subsequent errors hitting callback multiple times\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    completed.push(k);\r
+                    taskComplete();\r
+                }\r
+            };\r
+            var requires = task.slice(0, Math.abs(task.length - 1)) || [];\r
+            var ready = function () {\r
+                return _reduce(requires, function (a, x) {\r
+                    return (a && _indexOf(completed, x) !== -1);\r
+                }, true);\r
+            };\r
+            if (ready()) {\r
+                task[task.length - 1](taskCallback);\r
+            }\r
+            else {\r
+                var listener = function () {\r
+                    if (ready()) {\r
+                        removeListener(listener);\r
+                        task[task.length - 1](taskCallback);\r
+                    }\r
+                };\r
+                addListener(listener);\r
+            }\r
+        });\r
+    };\r
+\r
+    async.waterfall = function (tasks, callback) {\r
+        if (!tasks.length) {\r
+            return callback();\r
+        }\r
+        callback = callback || function () {};\r
+        var wrapIterator = function (iterator) {\r
+            return function (err) {\r
+                if (err) {\r
+                    callback(err);\r
+                    callback = function () {};\r
+                }\r
+                else {\r
+                    var args = Array.prototype.slice.call(arguments, 1);\r
+                    var next = iterator.next();\r
+                    if (next) {\r
+                        args.push(wrapIterator(next));\r
+                    }\r
+                    else {\r
+                        args.push(callback);\r
+                    }\r
+                    async.nextTick(function () {\r
+                        iterator.apply(null, args);\r
+                    });\r
+                }\r
+            };\r
+        };\r
+        wrapIterator(async.iterator(tasks))();\r
+    };\r
+\r
+    async.parallel = function (tasks, callback) {\r
+        callback = callback || function () {};\r
+        if (tasks.constructor === Array) {\r
+            async.map(tasks, function (fn, callback) {\r
+                if (fn) {\r
+                    fn(function (err) {\r
+                        var args = Array.prototype.slice.call(arguments, 1);\r
+                        if (args.length <= 1) {\r
+                            args = args[0];\r
+                        }\r
+                        callback.call(null, err, args || null);\r
+                    });\r
+                }\r
+            }, callback);\r
+        }\r
+        else {\r
+            var results = {};\r
+            async.forEach(_keys(tasks), function (k, callback) {\r
+                tasks[k](function (err) {\r
+                    var args = Array.prototype.slice.call(arguments, 1);\r
+                    if (args.length <= 1) {\r
+                        args = args[0];\r
+                    }\r
+                    results[k] = args;\r
+                    callback(err);\r
+                });\r
+            }, function (err) {\r
+                callback(err, results);\r
+            });\r
+        }\r
+    };\r
+\r
+    async.series = function (tasks, callback) {\r
+        callback = callback || function () {};\r
+        if (tasks.constructor === Array) {\r
+            async.mapSeries(tasks, function (fn, callback) {\r
+                if (fn) {\r
+                    fn(function (err) {\r
+                        var args = Array.prototype.slice.call(arguments, 1);\r
+                        if (args.length <= 1) {\r
+                            args = args[0];\r
+                        }\r
+                        callback.call(null, err, args || null);\r
+                    });\r
+                }\r
+            }, callback);\r
+        }\r
+        else {\r
+            var results = {};\r
+            async.forEachSeries(_keys(tasks), function (k, callback) {\r
+                tasks[k](function (err) {\r
+                    var args = Array.prototype.slice.call(arguments, 1);\r
+                    if (args.length <= 1) {\r
+                        args = args[0];\r
+                    }\r
+                    results[k] = args;\r
+                    callback(err);\r
+                });\r
+            }, function (err) {\r
+                callback(err, results);\r
+            });\r
+        }\r
+    };\r
+\r
+    async.iterator = function (tasks) {\r
+        var makeCallback = function (index) {\r
+            var fn = function () {\r
+                if (tasks.length) {\r
+                    tasks[index].apply(null, arguments);\r
+                }\r
+                return fn.next();\r
+            };\r
+            fn.next = function () {\r
+                return (index < tasks.length - 1) ? makeCallback(index + 1): null;\r
+            };\r
+            return fn;\r
+        };\r
+        return makeCallback(0);\r
+    };\r
+\r
+    async.apply = function (fn) {\r
+        var args = Array.prototype.slice.call(arguments, 1);\r
+        return function () {\r
+            return fn.apply(\r
+                null, args.concat(Array.prototype.slice.call(arguments))\r
+            );\r
+        };\r
+    };\r
+\r
+    var _concat = function (eachfn, arr, fn, callback) {\r
+        var r = [];\r
+        eachfn(arr, function (x, cb) {\r
+            fn(x, function (err, y) {\r
+                r = r.concat(y || []);\r
+                cb(err);\r
+            });\r
+        }, function (err) {\r
+            callback(err, r);\r
+        });\r
+    };\r
+    async.concat = doParallel(_concat);\r
+    async.concatSeries = doSeries(_concat);\r
+\r
+    async.whilst = function (test, iterator, callback) {\r
+        if (test()) {\r
+            iterator(function (err) {\r
+                if (err) {\r
+                    return callback(err);\r
+                }\r
+                async.whilst(test, iterator, callback);\r
+            });\r
+        }\r
+        else {\r
+            callback();\r
+        }\r
+    };\r
+\r
+    async.until = function (test, iterator, callback) {\r
+        if (!test()) {\r
+            iterator(function (err) {\r
+                if (err) {\r
+                    return callback(err);\r
+                }\r
+                async.until(test, iterator, callback);\r
+            });\r
+        }\r
+        else {\r
+            callback();\r
+        }\r
+    };\r
+\r
+    async.queue = function (worker, concurrency) {\r
+        var workers = 0;\r
+        var tasks = [];\r
+        var q = {\r
+            concurrency: concurrency,\r
+            push: function (data, callback) {\r
+                tasks.push({data: data, callback: callback});\r
+                async.nextTick(q.process);\r
+            },\r
+            process: function () {\r
+                if (workers < q.concurrency && tasks.length) {\r
+                    var task = tasks.splice(0, 1)[0];\r
+                    workers += 1;\r
+                    worker(task.data, function () {\r
+                        workers -= 1;\r
+                        if (task.callback) {\r
+                            task.callback.apply(task, arguments);\r
+                        }\r
+                        q.process();\r
+                    });\r
+                }\r
+            },\r
+            length: function () {\r
+                return tasks.length;\r
+            }\r
+        };\r
+        return q;\r
+    };\r
+\r
+    var _console_fn = function (name) {\r
+        return function (fn) {\r
+            var args = Array.prototype.slice.call(arguments, 1);\r
+            fn.apply(null, args.concat([function (err) {\r
+                var args = Array.prototype.slice.call(arguments, 1);\r
+                if (typeof console !== 'undefined') {\r
+                    if (err) {\r
+                        if (console.error) {\r
+                            console.error(err);\r
+                        }\r
+                    }\r
+                    else if (console[name]) {\r
+                        _forEach(args, function (x) {\r
+                            console[name](x);\r
+                        });\r
+                    }\r
+                }\r
+            }]));\r
+        };\r
+    };\r
+    async.log = _console_fn('log');\r
+    async.dir = _console_fn('dir');\r
+    /*async.info = _console_fn('info');\r
+    async.warn = _console_fn('warn');\r
+    async.error = _console_fn('error');*/\r
+\r
+    async.memoize = function (fn, hasher) {\r
+        var memo = {};\r
+        hasher = hasher || function (x) {\r
+            return x;\r
+        };\r
+        return function () {\r
+            var args = Array.prototype.slice.call(arguments);\r
+            var callback = args.pop();\r
+            var key = hasher.apply(null, args);\r
+            if (key in memo) {\r
+                callback.apply(null, memo[key]);\r
+            }\r
+            else {\r
+                fn.apply(null, args.concat([function () {\r
+                    memo[key] = arguments;\r
+                    callback.apply(null, arguments);\r
+                }]));\r
+            }\r
+        };\r
+    };\r
+\r
+}());\r
+(function(exports){\r
+/**\r
+ * This file is based on the node.js assert module, but with some small\r
+ * changes for browser-compatibility\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ */\r
+\r
+\r
+/**\r
+ * Added for browser compatibility\r
+ */\r
+\r
+var _keys = function(obj){\r
+    if(Object.keys) return Object.keys(obj);\r
+    if (typeof obj != 'object' && typeof obj != 'function') {\r
+        throw new TypeError('-');\r
+    }\r
+    var keys = [];\r
+    for(var k in obj){\r
+        if(obj.hasOwnProperty(k)) keys.push(k);\r
+    }\r
+    return keys;\r
+};\r
+\r
+\r
+\r
+// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\r
+//\r
+// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\r
+//\r
+// Originally from narwhal.js (http://narwhaljs.org)\r
+// Copyright (c) 2009 Thomas Robinson <280north.com>\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining a copy\r
+// of this software and associated documentation files (the 'Software'), to\r
+// deal in the Software without restriction, including without limitation the\r
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\r
+// sell copies of the Software, and to permit persons to whom the Software is\r
+// furnished to do so, subject to the following conditions:\r
+//\r
+// The above copyright notice and this permission notice shall be included in\r
+// all copies or substantial portions of the Software.\r
+//\r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\r
+// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+\r
+\r
+var pSlice = Array.prototype.slice;\r
+\r
+// 1. The assert module provides functions that throw\r
+// AssertionError's when particular conditions are not met. The\r
+// assert module must conform to the following interface.\r
+\r
+var assert = exports;\r
+\r
+// 2. The AssertionError is defined in assert.\r
+// new assert.AssertionError({message: message, actual: actual, expected: expected})\r
+\r
+assert.AssertionError = function AssertionError (options) {\r
+  this.name = "AssertionError";\r
+  this.message = options.message;\r
+  this.actual = options.actual;\r
+  this.expected = options.expected;\r
+  this.operator = options.operator;\r
+  var stackStartFunction = options.stackStartFunction || fail;\r
+\r
+  if (Error.captureStackTrace) {\r
+    Error.captureStackTrace(this, stackStartFunction);\r
+  }\r
+};\r
+// code from util.inherits in node\r
+assert.AssertionError.super_ = Error;\r
+\r
+\r
+// EDITED FOR BROWSER COMPATIBILITY: replaced Object.create call\r
+// TODO: test what effect this may have\r
+var ctor = function () { this.constructor = assert.AssertionError; };\r
+ctor.prototype = Error.prototype;\r
+assert.AssertionError.prototype = new ctor();\r
+\r
+\r
+assert.AssertionError.prototype.toString = function() {\r
+  if (this.message) {\r
+    return [this.name+":", this.message].join(' ');\r
+  } else {\r
+    return [ this.name+":"\r
+           , JSON.stringify(this.expected )\r
+           , this.operator\r
+           , JSON.stringify(this.actual)\r
+           ].join(" ");\r
+  }\r
+};\r
+\r
+// assert.AssertionError instanceof Error\r
+\r
+assert.AssertionError.__proto__ = Error.prototype;\r
+\r
+// At present only the three keys mentioned above are used and\r
+// understood by the spec. Implementations or sub modules can pass\r
+// other keys to the AssertionError's constructor - they will be\r
+// ignored.\r
+\r
+// 3. All of the following functions must throw an AssertionError\r
+// when a corresponding condition is not met, with a message that\r
+// may be undefined if not provided.  All assertion methods provide\r
+// both the actual and expected values to the assertion error for\r
+// display purposes.\r
+\r
+function fail(actual, expected, message, operator, stackStartFunction) {\r
+  throw new assert.AssertionError({\r
+    message: message,\r
+    actual: actual,\r
+    expected: expected,\r
+    operator: operator,\r
+    stackStartFunction: stackStartFunction\r
+  });\r
+}\r
+\r
+// EXTENSION! allows for well behaved errors defined elsewhere.\r
+assert.fail = fail;\r
+\r
+// 4. Pure assertion tests whether a value is truthy, as determined\r
+// by !!guard.\r
+// assert.ok(guard, message_opt);\r
+// This statement is equivalent to assert.equal(true, guard,\r
+// message_opt);. To test strictly for the value true, use\r
+// assert.strictEqual(true, guard, message_opt);.\r
+\r
+assert.ok = function ok(value, message) {\r
+  if (!!!value) fail(value, true, message, "==", assert.ok);\r
+};\r
+\r
+// 5. The equality assertion tests shallow, coercive equality with\r
+// ==.\r
+// assert.equal(actual, expected, message_opt);\r
+\r
+assert.equal = function equal(actual, expected, message) {\r
+  if (actual != expected) fail(actual, expected, message, "==", assert.equal);\r
+};\r
+\r
+// 6. The non-equality assertion tests for whether two objects are not equal\r
+// with != assert.notEqual(actual, expected, message_opt);\r
+\r
+assert.notEqual = function notEqual(actual, expected, message) {\r
+  if (actual == expected) {\r
+    fail(actual, expected, message, "!=", assert.notEqual);\r
+  }\r
+};\r
+\r
+// 7. The equivalence assertion tests a deep equality relation.\r
+// assert.deepEqual(actual, expected, message_opt);\r
+\r
+assert.deepEqual = function deepEqual(actual, expected, message) {\r
+  if (!_deepEqual(actual, expected)) {\r
+    fail(actual, expected, message, "deepEqual", assert.deepEqual);\r
+  }\r
+};\r
+\r
+var Buffer = null;\r
+if (typeof require !== 'undefined' && typeof process !== 'undefined') {\r
+    try {\r
+        Buffer = require('buffer').Buffer;\r
+    }\r
+    catch (e) {\r
+        // May be a CommonJS environment other than Node.js\r
+        Buffer = null;\r
+    }\r
+}\r
+\r
+function _deepEqual(actual, expected) {\r
+  // 7.1. All identical values are equivalent, as determined by ===.\r
+  if (actual === expected) {\r
+    return true;\r
+  // 7.2. If the expected value is a Date object, the actual value is\r
+  // equivalent if it is also a Date object that refers to the same time.\r
+  } else if (actual instanceof Date && expected instanceof Date) {\r
+    return actual.getTime() === expected.getTime();\r
+\r
+  // 7.2.1 If the expcted value is a RegExp object, the actual value is\r
+  // equivalent if it is also a RegExp object that refers to the same source and options\r
+  } else if (actual instanceof RegExp && expected instanceof RegExp) {\r
+    return actual.source === expected.source &&\r
+           actual.global === expected.global &&\r
+           actual.ignoreCase === expected.ignoreCase &&\r
+           actual.multiline === expected.multiline;\r
+\r
+  } else if (Buffer && actual instanceof Buffer && expected instanceof Buffer) {\r
+    return (function() {\r
+      var i, len;\r
+\r
+      for (i = 0, len = expected.length; i < len; i++) {\r
+        if (actual[i] !== expected[i]) {\r
+          return false;\r
+        }\r
+      }\r
+      return actual.length === expected.length;\r
+    })();\r
+  // 7.3. Other pairs that do not both pass typeof value == "object",\r
+  // equivalence is determined by ==.\r
+  } else if (typeof actual != 'object' && typeof expected != 'object') {\r
+    return actual == expected;\r
+\r
+  // 7.4. For all other Object pairs, including Array objects, equivalence is\r
+  // determined by having the same number of owned properties (as verified\r
+  // with Object.prototype.hasOwnProperty.call), the same set of keys\r
+  // (although not necessarily the same order), equivalent values for every\r
+  // corresponding key, and an identical "prototype" property. Note: this\r
+  // accounts for both named and indexed properties on Arrays.\r
+  } else {\r
+    return objEquiv(actual, expected);\r
+  }\r
+}\r
+\r
+function isUndefinedOrNull (value) {\r
+  return value === null || value === undefined;\r
+}\r
+\r
+function isArguments (object) {\r
+  return Object.prototype.toString.call(object) == '[object Arguments]';\r
+}\r
+\r
+function objEquiv (a, b) {\r
+  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\r
+    return false;\r
+  // an identical "prototype" property.\r
+  if (a.prototype !== b.prototype) return false;\r
+  //~~~I've managed to break Object.keys through screwy arguments passing.\r
+  //   Converting to array solves the problem.\r
+  if (isArguments(a)) {\r
+    if (!isArguments(b)) {\r
+      return false;\r
+    }\r
+    a = pSlice.call(a);\r
+    b = pSlice.call(b);\r
+    return _deepEqual(a, b);\r
+  }\r
+  try{\r
+    var ka = _keys(a),\r
+      kb = _keys(b),\r
+      key, i;\r
+  } catch (e) {//happens when one is a string literal and the other isn't\r
+    return false;\r
+  }\r
+  // having the same number of owned properties (keys incorporates hasOwnProperty)\r
+  if (ka.length != kb.length)\r
+    return false;\r
+  //the same set of keys (although not necessarily the same order),\r
+  ka.sort();\r
+  kb.sort();\r
+  //~~~cheap key test\r
+  for (i = ka.length - 1; i >= 0; i--) {\r
+    if (ka[i] != kb[i])\r
+      return false;\r
+  }\r
+  //equivalent values for every corresponding key, and\r
+  //~~~possibly expensive deep test\r
+  for (i = ka.length - 1; i >= 0; i--) {\r
+    key = ka[i];\r
+    if (!_deepEqual(a[key], b[key] ))\r
+       return false;\r
+  }\r
+  return true;\r
+}\r
+\r
+// 8. The non-equivalence assertion tests for any deep inequality.\r
+// assert.notDeepEqual(actual, expected, message_opt);\r
+\r
+assert.notDeepEqual = function notDeepEqual(actual, expected, message) {\r
+  if (_deepEqual(actual, expected)) {\r
+    fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);\r
+  }\r
+};\r
+\r
+// 9. The strict equality assertion tests strict equality, as determined by ===.\r
+// assert.strictEqual(actual, expected, message_opt);\r
+\r
+assert.strictEqual = function strictEqual(actual, expected, message) {\r
+  if (actual !== expected) {\r
+    fail(actual, expected, message, "===", assert.strictEqual);\r
+  }\r
+};\r
+\r
+// 10. The strict non-equality assertion tests for strict inequality, as determined by !==.\r
+// assert.notStrictEqual(actual, expected, message_opt);\r
+\r
+assert.notStrictEqual = function notStrictEqual(actual, expected, message) {\r
+  if (actual === expected) {\r
+    fail(actual, expected, message, "!==", assert.notStrictEqual);\r
+  }\r
+};\r
+\r
+function expectedException(actual, expected) {\r
+  if (!actual || !expected) {\r
+    return false;\r
+  }\r
+\r
+  if (expected instanceof RegExp) {\r
+    return expected.test(actual.message || actual);\r
+  } else if (actual instanceof expected) {\r
+    return true;\r
+  } else if (expected.call({}, actual) === true) {\r
+    return true;\r
+  }\r
+\r
+  return false;\r
+}\r
+\r
+function _throws(shouldThrow, block, expected, message) {\r
+  var actual;\r
+\r
+  if (typeof expected === 'string') {\r
+    message = expected;\r
+    expected = null;\r
+  }\r
+\r
+  try {\r
+    block();\r
+  } catch (e) {\r
+    actual = e;\r
+  }\r
+\r
+  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\r
+            (message ? ' ' + message : '.');\r
+\r
+  if (shouldThrow && !actual) {\r
+    fail('Missing expected exception' + message);\r
+  }\r
+\r
+  if (!shouldThrow && expectedException(actual, expected)) {\r
+    fail('Got unwanted exception' + message);\r
+  }\r
+\r
+  if ((shouldThrow && actual && expected &&\r
+      !expectedException(actual, expected)) || (!shouldThrow && actual)) {\r
+    throw actual;\r
+  }\r
+}\r
+\r
+// 11. Expected to throw an error:\r
+// assert.throws(block, Error_opt, message_opt);\r
+\r
+assert.throws = function(block, /*optional*/error, /*optional*/message) {\r
+  _throws.apply(this, [true].concat(pSlice.call(arguments)));\r
+};\r
+\r
+// EXTENSION! This is annoying to write outside this module.\r
+assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {\r
+  _throws.apply(this, [false].concat(pSlice.call(arguments)));\r
+};\r
+\r
+assert.ifError = function (err) { if (err) {throw err;}};\r
+})(assert);\r
+(function(exports){\r
+/*!\r
+ * Nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ * Only code on that line will be removed, it's mostly to avoid requiring code\r
+ * that is node specific\r
+ */\r
+\r
+/**\r
+ * Module dependencies\r
+ */\r
+\r
+\r
+\r
+/**\r
+ * Creates assertion objects representing the result of an assert call.\r
+ * Accepts an object or AssertionError as its argument.\r
+ *\r
+ * @param {object} obj\r
+ * @api public\r
+ */\r
+\r
+exports.assertion = function (obj) {\r
+    return {\r
+        method: obj.method || '',\r
+        message: obj.message || (obj.error && obj.error.message) || '',\r
+        error: obj.error,\r
+        passed: function () {\r
+            return !this.error;\r
+        },\r
+        failed: function () {\r
+            return Boolean(this.error);\r
+        }\r
+    };\r
+};\r
+\r
+/**\r
+ * Creates an assertion list object representing a group of assertions.\r
+ * Accepts an array of assertion objects.\r
+ *\r
+ * @param {Array} arr\r
+ * @param {Number} duration\r
+ * @api public\r
+ */\r
+\r
+exports.assertionList = function (arr, duration) {\r
+    var that = arr || [];\r
+    that.failures = function () {\r
+        var failures = 0;\r
+        for (var i = 0; i < this.length; i += 1) {\r
+            if (this[i].failed()) {\r
+                failures += 1;\r
+            }\r
+        }\r
+        return failures;\r
+    };\r
+    that.passes = function () {\r
+        return that.length - that.failures();\r
+    };\r
+    that.duration = duration || 0;\r
+    return that;\r
+};\r
+\r
+/**\r
+ * Create a wrapper function for assert module methods. Executes a callback\r
+ * after it's complete with an assertion object representing the result.\r
+ *\r
+ * @param {Function} callback\r
+ * @api private\r
+ */\r
+\r
+var assertWrapper = function (callback) {\r
+    return function (new_method, assert_method, arity) {\r
+        return function () {\r
+            var message = arguments[arity - 1];\r
+            var a = exports.assertion({method: new_method, message: message});\r
+            try {\r
+                assert[assert_method].apply(null, arguments);\r
+            }\r
+            catch (e) {\r
+                a.error = e;\r
+            }\r
+            callback(a);\r
+        };\r
+    };\r
+};\r
+\r
+/**\r
+ * Creates the 'test' object that gets passed to every test function.\r
+ * Accepts the name of the test function as its first argument, followed by\r
+ * the start time in ms, the options object and a callback function.\r
+ *\r
+ * @param {String} name\r
+ * @param {Number} start\r
+ * @param {Object} options\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.test = function (name, start, options, callback) {\r
+    var expecting;\r
+    var a_list = [];\r
+\r
+    var wrapAssert = assertWrapper(function (a) {\r
+        a_list.push(a);\r
+        if (options.log) {\r
+            async.nextTick(function () {\r
+                options.log(a);\r
+            });\r
+        }\r
+    });\r
+\r
+    var test = {\r
+        done: function (err) {\r
+            if (expecting !== undefined && expecting !== a_list.length) {\r
+                var e = new Error(\r
+                    'Expected ' + expecting + ' assertions, ' +\r
+                    a_list.length + ' ran'\r
+                );\r
+                var a1 = exports.assertion({method: 'expect', error: e});\r
+                a_list.push(a1);\r
+                if (options.log) {\r
+                    async.nextTick(function () {\r
+                        options.log(a1);\r
+                    });\r
+                }\r
+            }\r
+            if (err) {\r
+                var a2 = exports.assertion({error: err});\r
+                a_list.push(a2);\r
+                if (options.log) {\r
+                    async.nextTick(function () {\r
+                        options.log(a2);\r
+                    });\r
+                }\r
+            }\r
+            var end = new Date().getTime();\r
+            async.nextTick(function () {\r
+                var assertion_list = exports.assertionList(a_list, end - start);\r
+                options.testDone(name, assertion_list);\r
+                callback(null, a_list);\r
+            });\r
+        },\r
+        ok: wrapAssert('ok', 'ok', 2),\r
+        same: wrapAssert('same', 'deepEqual', 3),\r
+        equals: wrapAssert('equals', 'equal', 3),\r
+        expect: function (num) {\r
+            expecting = num;\r
+        },\r
+        _assertion_list: a_list\r
+    };\r
+    // add all functions from the assert module\r
+    for (var k in assert) {\r
+        if (assert.hasOwnProperty(k)) {\r
+            test[k] = wrapAssert(k, k, assert[k].length);\r
+        }\r
+    }\r
+    return test;\r
+};\r
+\r
+/**\r
+ * Ensures an options object has all callbacks, adding empty callback functions\r
+ * if any are missing.\r
+ *\r
+ * @param {Object} opt\r
+ * @return {Object}\r
+ * @api public\r
+ */\r
+\r
+exports.options = function (opt) {\r
+    var optionalCallback = function (name) {\r
+        opt[name] = opt[name] || function () {};\r
+    };\r
+\r
+    optionalCallback('moduleStart');\r
+    optionalCallback('moduleDone');\r
+    optionalCallback('testStart');\r
+    optionalCallback('testDone');\r
+    //optionalCallback('log');\r
+\r
+    // 'done' callback is not optional.\r
+\r
+    return opt;\r
+};\r
+})(types);\r
+(function(exports){\r
+/*!\r
+ * Nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ * Only code on that line will be removed, it's mostly to avoid requiring code\r
+ * that is node specific\r
+ */\r
+\r
+/**\r
+ * Module dependencies\r
+ */\r
+\r
+\r
+\r
+/**\r
+ * Added for browser compatibility\r
+ */\r
+\r
+var _keys = function (obj) {\r
+    if (Object.keys) {\r
+        return Object.keys(obj);\r
+    }\r
+    var keys = [];\r
+    for (var k in obj) {\r
+        if (obj.hasOwnProperty(k)) {\r
+            keys.push(k);\r
+        }\r
+    }\r
+    return keys;\r
+};\r
+\r
+\r
+var _copy = function (obj) {\r
+    var nobj = {};\r
+    var keys = _keys(obj);\r
+    for (var i = 0; i <  keys.length; i += 1) {\r
+        nobj[keys[i]] = obj[keys[i]];\r
+    }\r
+    return nobj;\r
+};\r
+\r
+\r
+/**\r
+ * Runs a test function (fn) from a loaded module. After the test function\r
+ * calls test.done(), the callback is executed with an assertionList as its\r
+ * second argument.\r
+ *\r
+ * @param {String} name\r
+ * @param {Function} fn\r
+ * @param {Object} opt\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.runTest = function (name, fn, opt, callback) {\r
+    var options = types.options(opt);\r
+\r
+    options.testStart(name);\r
+    var start = new Date().getTime();\r
+    var test = types.test(name, start, options, callback);\r
+\r
+    try {\r
+        fn(test);\r
+    }\r
+    catch (e) {\r
+        test.done(e);\r
+    }\r
+};\r
+\r
+/**\r
+ * Takes an object containing test functions or other test suites as properties\r
+ * and runs each in series. After all tests have completed, the callback is\r
+ * called with a list of all assertions as the second argument.\r
+ *\r
+ * If a name is passed to this function it is prepended to all test and suite\r
+ * names that run within it.\r
+ *\r
+ * @param {String} name\r
+ * @param {Object} suite\r
+ * @param {Object} opt\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.runSuite = function (name, suite, opt, callback) {\r
+    suite = wrapGroup(suite);\r
+    var keys = _keys(suite);\r
+\r
+    async.concatSeries(keys, function (k, cb) {\r
+        var prop = suite[k], _name;\r
+\r
+        _name = name ? [].concat(name, k) : [k];\r
+        _name.toString = function () {\r
+            // fallback for old one\r
+            return this.join(' - ');\r
+        };\r
+\r
+        if (typeof prop === 'function') {\r
+            var in_name = false,\r
+                in_specific_test = (_name.toString() === opt.testFullSpec) ? true : false;\r
+            for (var i = 0; i < _name.length; i += 1) {\r
+                if (_name[i] === opt.testspec) {\r
+                    in_name = true;\r
+                }\r
+            }\r
+\r
+            if ((!opt.testFullSpec || in_specific_test) && (!opt.testspec || in_name)) {\r
+                if (opt.moduleStart) {\r
+                    opt.moduleStart();\r
+                }\r
+                exports.runTest(_name, suite[k], opt, cb);\r
+            }\r
+            else {\r
+                return cb();\r
+            }\r
+        }\r
+        else {\r
+            exports.runSuite(_name, suite[k], opt, cb);\r
+        }\r
+    }, callback);\r
+};\r
+\r
+/**\r
+ * Run each exported test function or test suite from a loaded module.\r
+ *\r
+ * @param {String} name\r
+ * @param {Object} mod\r
+ * @param {Object} opt\r
+ * @param {Function} callback\r
+ * @api public\r
+ */\r
+\r
+exports.runModule = function (name, mod, opt, callback) {\r
+    var options = _copy(types.options(opt));\r
+\r
+    var _run = false;\r
+    var _moduleStart = options.moduleStart;\r
+\r
+    mod = wrapGroup(mod);\r
+\r
+    function run_once() {\r
+        if (!_run) {\r
+            _run = true;\r
+            _moduleStart(name);\r
+        }\r
+    }\r
+    options.moduleStart = run_once;\r
+\r
+    var start = new Date().getTime();\r
+\r
+    exports.runSuite(null, mod, options, function (err, a_list) {\r
+        var end = new Date().getTime();\r
+        var assertion_list = types.assertionList(a_list, end - start);\r
+        options.moduleDone(name, assertion_list);\r
+        if (nodeunit.complete) {\r
+            nodeunit.complete(name, assertion_list);\r
+        }\r
+        callback(null, a_list);\r
+    });\r
+};\r
+\r
+/**\r
+ * Treats an object literal as a list of modules keyed by name. Runs each\r
+ * module and finished with calling 'done'. You can think of this as a browser\r
+ * safe alternative to runFiles in the nodeunit module.\r
+ *\r
+ * @param {Object} modules\r
+ * @param {Object} opt\r
+ * @api public\r
+ */\r
+\r
+// TODO: add proper unit tests for this function\r
+exports.runModules = function (modules, opt) {\r
+    var all_assertions = [];\r
+    var options = types.options(opt);\r
+    var start = new Date().getTime();\r
+\r
+    async.concatSeries(_keys(modules), function (k, cb) {\r
+        exports.runModule(k, modules[k], options, cb);\r
+    },\r
+    function (err, all_assertions) {\r
+        var end = new Date().getTime();\r
+        options.done(types.assertionList(all_assertions, end - start));\r
+    });\r
+};\r
+\r
+\r
+/**\r
+ * Wraps a test function with setUp and tearDown functions.\r
+ * Used by testCase.\r
+ *\r
+ * @param {Function} setUp\r
+ * @param {Function} tearDown\r
+ * @param {Function} fn\r
+ * @api private\r
+ */\r
+\r
+var wrapTest = function (setUp, tearDown, fn) {\r
+    return function (test) {\r
+        var context = {};\r
+        if (tearDown) {\r
+            var done = test.done;\r
+            test.done = function (err) {\r
+                try {\r
+                    tearDown.call(context, function (err2) {\r
+                        if (err && err2) {\r
+                            test._assertion_list.push(\r
+                                types.assertion({error: err})\r
+                            );\r
+                            return done(err2);\r
+                        }\r
+                        done(err || err2);\r
+                    });\r
+                }\r
+                catch (e) {\r
+                    done(e);\r
+                }\r
+            };\r
+        }\r
+        if (setUp) {\r
+            setUp.call(context, function (err) {\r
+                if (err) {\r
+                    return test.done(err);\r
+                }\r
+                fn.call(context, test);\r
+            });\r
+        }\r
+        else {\r
+            fn.call(context, test);\r
+        }\r
+    };\r
+};\r
+\r
+\r
+/**\r
+ * Returns a serial callback from two functions.\r
+ *\r
+ * @param {Function} funcFirst\r
+ * @param {Function} funcSecond\r
+ * @api private\r
+ */\r
+\r
+var getSerialCallback = function (fns) {\r
+    if (!fns.length) {\r
+        return null;\r
+    }\r
+    return function (callback) {\r
+        var that = this;\r
+        var bound_fns = [];\r
+        for (var i = 0, len = fns.length; i < len; i++) {\r
+            (function (j) {\r
+                bound_fns.push(function () {\r
+                    return fns[j].apply(that, arguments);\r
+                });\r
+            })(i);\r
+        }\r
+        return async.series(bound_fns, callback);\r
+    };\r
+};\r
+\r
+\r
+/**\r
+ * Wraps a group of tests with setUp and tearDown functions.\r
+ * Used by testCase.\r
+ *\r
+ * @param {Object} group\r
+ * @param {Array} setUps - parent setUp functions\r
+ * @param {Array} tearDowns - parent tearDown functions\r
+ * @api private\r
+ */\r
+\r
+var wrapGroup = function (group, setUps, tearDowns) {\r
+    var tests = {};\r
+\r
+    var setUps = setUps ? setUps.slice(): [];\r
+    var tearDowns = tearDowns ? tearDowns.slice(): [];\r
+\r
+    if (group.setUp) {\r
+        setUps.push(group.setUp);\r
+        delete group.setUp;\r
+    }\r
+    if (group.tearDown) {\r
+        tearDowns.unshift(group.tearDown);\r
+        delete group.tearDown;\r
+    }\r
+\r
+    var keys = _keys(group);\r
+\r
+    for (var i = 0; i < keys.length; i += 1) {\r
+        var k = keys[i];\r
+        if (typeof group[k] === 'function') {\r
+            tests[k] = wrapTest(\r
+                getSerialCallback(setUps),\r
+                getSerialCallback(tearDowns),\r
+                group[k]\r
+            );\r
+        }\r
+        else if (typeof group[k] === 'object') {\r
+            tests[k] = wrapGroup(group[k], setUps, tearDowns);\r
+        }\r
+    }\r
+    return tests;\r
+};\r
+\r
+\r
+/**\r
+ * Backwards compatibility for test suites using old testCase API\r
+ */\r
+\r
+exports.testCase = function (suite) {\r
+    return suite;\r
+};\r
+})(core);\r
+(function(exports){\r
+/*!\r
+ * Nodeunit\r
+ * Copyright (c) 2010 Caolan McMahon\r
+ * MIT Licensed\r
+ *\r
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!\r
+ * Only code on that line will be removed, its mostly to avoid requiring code\r
+ * that is node specific\r
+ */\r
+\r
+\r
+/**\r
+ * NOTE: this test runner is not listed in index.js because it cannot be\r
+ * used with the command-line tool, only inside the browser.\r
+ */\r
+\r
+\r
+/**\r
+ * Reporter info string\r
+ */\r
+\r
+exports.info = "Browser-based test reporter";\r
+\r
+\r
+/**\r
+ * Run all tests within each module, reporting the results\r
+ *\r
+ * @param {Array} files\r
+ * @api public\r
+ */\r
+\r
+exports.run = function (modules, options) {\r
+    var start = new Date().getTime(), div;\r
+       options = options || {};\r
+       div = options.div || document.body;\r
+\r
+    function setText(el, txt) {\r
+        if ('innerText' in el) {\r
+            el.innerText = txt;\r
+        }\r
+        else if ('textContent' in el){\r
+            el.textContent = txt;\r
+        }\r
+    }\r
+\r
+    function getOrCreate(tag, id) {\r
+        var el = document.getElementById(id);\r
+        if (!el) {\r
+            el = document.createElement(tag);\r
+            el.id = id;\r
+            div.appendChild(el);\r
+        }\r
+        return el;\r
+    };\r
+\r
+    var header = getOrCreate('h1', 'nodeunit-header');\r
+    var banner = getOrCreate('h2', 'nodeunit-banner');\r
+    var userAgent = getOrCreate('h2', 'nodeunit-userAgent');\r
+    var tests = getOrCreate('ol', 'nodeunit-tests');\r
+    var result = getOrCreate('p', 'nodeunit-testresult');\r
+\r
+    setText(userAgent, navigator.userAgent);\r
+\r
+    nodeunit.runModules(modules, {\r
+        moduleStart: function (name) {\r
+            /*var mheading = document.createElement('h2');\r
+            mheading.innerText = name;\r
+            results.appendChild(mheading);\r
+            module = document.createElement('ol');\r
+            results.appendChild(module);*/\r
+        },\r
+        testDone: function (name, assertions) {\r
+            var test = document.createElement('li');\r
+            var strong = document.createElement('strong');\r
+            strong.innerHTML = name + ' <b style="color: black;">(' +\r
+                '<b class="fail">' + assertions.failures() + '</b>, ' +\r
+                '<b class="pass">' + assertions.passes() + '</b>, ' +\r
+                assertions.length +\r
+            ')</b>';\r
+            test.className = assertions.failures() ? 'fail': 'pass';\r
+            test.appendChild(strong);\r
+\r
+            var aList = document.createElement('ol');\r
+            aList.style.display = 'none';\r
+            test.onclick = function () {\r
+                var d = aList.style.display;\r
+                aList.style.display = (d == 'none') ? 'block': 'none';\r
+            };\r
+            for (var i=0; i<assertions.length; i++) {\r
+                var li = document.createElement('li');\r
+                var a = assertions[i];\r
+                if (a.failed()) {\r
+                    li.innerHTML = (a.message || a.method || 'no message') +\r
+                        '<pre>' + (a.error.stack || a.error) + '</pre>';\r
+                    li.className = 'fail';\r
+                }\r
+                else {\r
+                    li.innerHTML = a.message || a.method || 'no message';\r
+                    li.className = 'pass';\r
+                }\r
+                aList.appendChild(li);\r
+            }\r
+            test.appendChild(aList);\r
+            tests.appendChild(test);\r
+        },\r
+        done: function (assertions) {\r
+            var end = new Date().getTime();\r
+            var duration = end - start;\r
+\r
+            var failures = assertions.failures();\r
+            banner.className = failures ? 'fail': 'pass';\r
+\r
+            result.innerHTML = 'Tests completed in ' + duration +\r
+                ' milliseconds.<br/><span class="passed">' +\r
+                assertions.passes() + '</span> assertions of ' +\r
+                '<span class="all">' + assertions.length + '<span> passed, ' +\r
+                assertions.failures() + ' failed.';\r
+        }\r
+    });\r
+};\r
+})(reporter);\r
+nodeunit = core;\r
+nodeunit.assert = assert;\r
+nodeunit.reporter = reporter;\r
+nodeunit.run = reporter.run;\r
+return nodeunit; })();\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/numberformats.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/numberformats.proto
new file mode 100644 (file)
index 0000000..79a07f8
--- /dev/null
@@ -0,0 +1,18 @@
+enum Formats {\r
+    DEC = 1;\r
+    HEX = 0x1F;\r
+    OCT = 017;\r
+}\r
+\r
+message Msg {\r
+    required int32 dec = 1 [default=-1];\r
+    required int32 hex = 2 [default=-0x1F];\r
+    required int32 oct = 3 [default=-017];\r
+    required double exp = 4 [default=0.1e5];\r
+    required double nod = 5 [default=1.];\r
+    required double exn = 6 [default=1e8];\r
+    required double sp1 = 7 [default=inf];\r
+    required double sp2 = 8 [default=-inf];\r
+    required double sp3 = 9 [default=nan];\r
+    required int32 hexUC = 10 [default=0X209];\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/oneof.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/oneof.proto
new file mode 100644 (file)
index 0000000..52a618b
--- /dev/null
@@ -0,0 +1,6 @@
+message MyOneOf {\r
+    oneof my_oneof {\r
+        uint32 id = 1;\r
+        string name = 2;\r
+    }\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/optional.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/optional.proto
new file mode 100644 (file)
index 0000000..92fbfc5
--- /dev/null
@@ -0,0 +1,12 @@
+message Test1 {\r
+    optional int32 a = 1;\r
+    optional Test2 b = 2;\r
+}\r
+\r
+message Test2 {\r
+    optional int32 c = 1;\r
+    optional Test3 d = 2;\r
+}\r
+\r
+message Test3 {\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/options.json b/legacy-libs/grpc/node_modules/protobufjs/tests/options.json
new file mode 100644 (file)
index 0000000..405450e
--- /dev/null
@@ -0,0 +1,32 @@
+{\r
+    "package": "My",\r
+    "messages": [\r
+        {\r
+            "name": "Test",\r
+            "fields": [\r
+                {\r
+                    "rule": "optional",\r
+                    "options": {\r
+                        "default": "Max"\r
+                    },\r
+                    "type": "string",\r
+                    "name": "name",\r
+                    "id": 1\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "messages": [],\r
+            "options": {\r
+                "(inmessage)": "My.Test",\r
+                "(foo.my_option).bar": false\r
+            }\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [],\r
+    "options": {\r
+        "(toplevel_1)": 10,\r
+        "(toplevel_2)": "Hello world!"\r
+    },\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/options.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/options.proto
new file mode 100644 (file)
index 0000000..f96da6d
--- /dev/null
@@ -0,0 +1,13 @@
+option (toplevel_1) = 10;\r
+package My;\r
+option (toplevel_2) = "Hello world!";\r
+\r
+message Test {\r
+    optional string name = 1 [default="Max"];\r
+    optional string desc1 = 2 [default="Shouldn't mix quotes"];\r
+    optional string desc2 = 3 [default='Shouldn"t mix quotes'];\r
+    optional string desc3 = 4 [(foo_options) = { opt1: 123 opt2: "baz" }];\r
+    optional string desc4 = 5 [(foo_options) = {options { opt1: 1234 opt2: "baz" } options { opt1: 4321 opt2: "foo" }} ];\r
+    option (inmessage) = My.Test;\r
+    option (foo.my_option).bar = false;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/packed.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/packed.proto
new file mode 100644 (file)
index 0000000..b9ee7a0
--- /dev/null
@@ -0,0 +1,4 @@
+message Message {\r
+    repeated int32 a = 1 [packed = true];\r
+    repeated int32 b = 2;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Bar.json b/legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Bar.json
new file mode 100644 (file)
index 0000000..3c4712a
--- /dev/null
@@ -0,0 +1,46 @@
+{\r
+    "package": null,\r
+    "messages": [\r
+        {\r
+            "ref": "Foo",\r
+            "fields": [\r
+                {\r
+                    "rule": "required",\r
+                    "type": "string",\r
+                    "name": "buzz",\r
+                    "id": 2,\r
+                    "options": {}\r
+                }\r
+            ]\r
+        }\r
+    ],\r
+    "enums": [],\r
+    "imports": [\r
+        {\r
+            "package": null,\r
+            "messages": [\r
+                {\r
+                    "name": "Foo",\r
+                    "fields": [\r
+                        {\r
+                            "rule": "required",\r
+                            "type": "string",\r
+                            "name": "fizz",\r
+                            "id": 1,\r
+                            "options": {}\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "messages": [],\r
+                    "options": {}\r
+                }\r
+            ],\r
+            "enums": [],\r
+            "imports": [],\r
+            "options": {},\r
+            "services": []\r
+        }\r
+    ],\r
+    "options": {},\r
+    "services": []\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Bar.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Bar.proto
new file mode 100644 (file)
index 0000000..309157b
--- /dev/null
@@ -0,0 +1,7 @@
+// Bar.proto\r
+import "Foo.proto";\r
+\r
+// really extend Bar but that produces an empty constructor. \r
+extend Foo {\r
+    required string buzz = 2;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Foo.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/proto2js/Foo.proto
new file mode 100644 (file)
index 0000000..f56944a
--- /dev/null
@@ -0,0 +1,4 @@
+// Foo.proto\r
+message Foo {\r
+    required string fizz = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/proto3.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/proto3.proto
new file mode 100644 (file)
index 0000000..9f99fbb
--- /dev/null
@@ -0,0 +1,7 @@
+syntax = "proto3";\r
+\r
+package test;\r
+\r
+message Foo {\r
+  int32 optional_int32 = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/protobufnet.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/protobufnet.proto
new file mode 100644 (file)
index 0000000..1d255c2
--- /dev/null
@@ -0,0 +1,19 @@
+message IMeshImp {\r
+}\r
+message Mesh {\r
+   optional IMeshImp _meshImp = 1;\r
+   repeated float3 _vertices = 2;\r
+   repeated uint32 _colors = 3;\r
+   repeated float3 _normals = 4;\r
+   repeated float2 _uvs = 5;\r
+   repeated int32 _triangles = 6;\r
+}\r
+message float2 {\r
+   optional float x = 1 [default = 0];\r
+   optional float y = 2 [default = 0];\r
+}\r
+message float3 {\r
+   optional float x = 1 [default = 0];\r
+   optional float y = 2 [default = 0];\r
+   optional float z = 3 [default = 0];\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/repeated.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/repeated.proto
new file mode 100644 (file)
index 0000000..4ed169b
--- /dev/null
@@ -0,0 +1,12 @@
+message Outer {\r
+       // As of: https://developers.google.com/protocol-buffers/docs/encoding#optional\r
+       \r
+       repeated Inner inner = 1;\r
+       // "If your message definition has repeated elements (without the [packed=true] option), the encoded message has\r
+       // zero or more key-value pairs with the same tag number."\r
+       \r
+}\r
+\r
+message Inner {\r
+       optional uint32 inner_value = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/services.js b/legacy-libs/grpc/node_modules/protobufjs/tests/services.js
new file mode 100644 (file)
index 0000000..c59995d
--- /dev/null
@@ -0,0 +1,39 @@
+var root = require("..").newBuilder({\r
+    "convertFieldsToCamelCase": true,\r
+    "populateAccessors": false\r
+})['import']({\r
+    "package": "my.namespace",\r
+    "messages": [\r
+        {\r
+            "name": "something",\r
+            "fields": [],\r
+            "messages": [\r
+                {\r
+                    "name": "v1",\r
+                    "fields": [],\r
+                    "messages": [\r
+                        {\r
+                            "name": "GetRequest",\r
+                            "fields": []\r
+                        },\r
+                        {\r
+                            "name": "GetResponse",\r
+                            "fields": []\r
+                        }\r
+                    ],\r
+                    "enums": [],\r
+                    "services": [{\r
+                        "name": "SomeService",\r
+                        "rpc": {\r
+                            "get": {\r
+                                "request": "GetRequest",\r
+                                "response": "GetResponse"\r
+                            }\r
+                        }\r
+                    }]\r
+                }\r
+            ]\r
+        }\r
+    ]\r
+}).build();\r
+console.log(require("util").inspect(root, { depth: 10}));
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/setarray.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/setarray.proto
new file mode 100644 (file)
index 0000000..8bbcc32
--- /dev/null
@@ -0,0 +1,7 @@
+message Outer {\r
+    repeated Inner inners = 4;\r
+}\r
+\r
+message Inner {\r
+    required string str = 1;\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/string_single_quote.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/string_single_quote.proto
new file mode 100644 (file)
index 0000000..082cff8
--- /dev/null
@@ -0,0 +1,3 @@
+message TestSingleQuoteString {\r
+    required string a = 1 [ default = 'hello world' ];\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/suite.html b/legacy-libs/grpc/node_modules/protobufjs/tests/suite.html
new file mode 100644 (file)
index 0000000..ed15eaa
--- /dev/null
@@ -0,0 +1,16 @@
+<!DOCTYPE html>\r
+<html>\r
+<head>\r
+    <title>ProtoBuf.js Test Suite</title>\r
+    <link rel="stylesheet" href="nodeunit-browser/nodeunit.css" type="text/css" />\r
+    <script src="nodeunit-browser/nodeunit.js"></script>\r
+    <script src="https://raw.github.com/dcodeIO/Long.js/master/Long.min.js"></script>\r
+    <script src="https://raw.github.com/dcodeIO/ByteBuffer.js/master/ByteBuffer.min.js"></script>\r
+    <script src="../ProtoBuf.min.js"></script>\r
+    <script src="suite.js"></script>\r
+</head>\r
+<body>\r
+    <h1 id="nodeunit-header">ProtoBuf.js Test Suite</h1>\r
+    <script>nodeunit.run({ "suite": suite });</script>\r
+</body>\r
+</html>\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/suite.js b/legacy-libs/grpc/node_modules/protobufjs/tests/suite.js
new file mode 100644 (file)
index 0000000..da0b087
--- /dev/null
@@ -0,0 +1,2267 @@
+/*\r
+ Copyright 2013 Daniel Wirtz <dcode@dcode.io>\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ */\r
+\r
+/**\r
+ * ProtoBuf.js Test Suite.\r
+ * @author Daniel Wirtz <dcode@dcode.io>\r
+ */\r
+(function(global) {\r
+\r
+    var FILE = "protobuf.js";\r
+    var BROWSER = !!global.window;\r
+    var StdOutFixture = require('fixture-stdout');\r
+    var fixture = new StdOutFixture();\r
+\r
+    var ProtoBuf = BROWSER ? global.dcodeIO.ProtoBuf : require(__dirname+"/../dist/"+FILE),\r
+        ByteBuffer = BROWSER ? global.dcodeIO.ByteBuffer : ByteBuffer || require("bytebuffer"),\r
+        util = BROWSER ? null : require("util"),\r
+        fs = BROWSER ? null : require("fs");\r
+\r
+        if (typeof __dirname == 'undefined') {\r
+            __dirname = document.location.href.replace(/[\/\\][^\/\\]*$/, "");\r
+        }\r
+\r
+    /**\r
+     * Constructs a new Sandbox for module loaders and shim testing.\r
+     * @param {Object.<string,*>} properties Additional properties to set\r
+     * @constructor\r
+     */\r
+    var Sandbox = function(properties) {\r
+        this.ByteBuffer = function() {};\r
+        for (var i in properties) {\r
+            this[i] = properties[i];\r
+        }\r
+        this.console = {\r
+            log: function(s) {\r
+                console.log(s);\r
+            }\r
+        };\r
+    };\r
+\r
+    function fail(e) {\r
+        throw(e);\r
+    }\r
+\r
+    /**\r
+     * Validates the complexDotProto and complexInline tests.\r
+     * @param {*} test Nodeunit test\r
+     * @param {Object} Game Game namespace\r
+     */\r
+    function validateComplex(test, Game) {\r
+        var Car = Game.Cars.Car,\r
+            Vendor = Car.Vendor,\r
+            Speed = Car.Speed;\r
+\r
+        var vendor;\r
+        // Car from class with argument list properties\r
+        var car = new Car(\r
+            "Rusty",\r
+            // Vendor from class with object properties\r
+            vendor = new Vendor({\r
+                "name": "Iron Inc.",\r
+                // Address from object\r
+                "address": {\r
+                    "country": "US"\r
+                },\r
+                "models": ["m1"]\r
+            }),\r
+            // Speed from enum object\r
+            Speed.SUPERFAST\r
+        );\r
+        test.equal(car.model, "Rusty");\r
+        test.equal(car.vendor.name, "Iron Inc.");\r
+        test.equal(car.vendor.address.country, "US");\r
+        test.equal(car.vendor.address.country, car.getVendor().get_address().country);\r
+        var bb = new ByteBuffer(32);\r
+        car.encode(bb);\r
+        test.equal(bb.flip().toString("debug"), "<0A 05 52 75 73 74 79 12 15 0A 09 49 72 6F 6E 20 49 6E 63 2E 12 04 0A 02 55 53 1A 02 6D 31 18 02>");\r
+        var carDec = Car.decode(bb);\r
+        test.equal(carDec.model, "Rusty");\r
+        test.equal(carDec.vendor.name, "Iron Inc.");\r
+        test.equal(carDec.vendor.address.country, "US");\r
+        test.equal(carDec.vendor.address.country, carDec.getVendor().get_address().country);\r
+        test.equal(carDec.vendor.models[0], "m1");\r
+    }\r
+\r
+    /**\r
+     * Test suite.\r
+     * @type {Object.<string,function>}\r
+     */\r
+    var suite = {\r
+\r
+        "init": function(test) {\r
+            test.ok(typeof ProtoBuf == "object");\r
+            test.ok(typeof ProtoBuf.Reflect == 'object');\r
+            test.ok(typeof ProtoBuf.loadProto == "function");\r
+            test.ok(typeof ProtoBuf.loadProtoFile == "function");\r
+            test.strictEqual(ProtoBuf.loadProto, ProtoBuf.protoFromString);\r
+            test.strictEqual(ProtoBuf.loadProtoFile, ProtoBuf.protoFromFile);\r
+            test.ok(ProtoBuf.ByteBuffer);\r
+            test.done();\r
+        },\r
+\r
+        "IS_NODE": function(test) {\r
+            test.ok(ProtoBuf.Util.IS_NODE);\r
+            test.done();\r
+        },\r
+\r
+        // Example "A Simple Message" from the protobuf docs\r
+        // https://developers.google.com/protocol-buffers/docs/encoding#simple\r
+        "example1": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example1.proto");\r
+                var Test1 = builder.build("Test1");\r
+                test.ok(typeof Test1 == 'function');\r
+                var inst = new Test1(150);\r
+                test.ok(inst instanceof ProtoBuf.Builder.Message);\r
+                test.equal(inst.a, 150);\r
+                test.equal(inst.getA(), 150);\r
+                test.equal(inst.get_a(), 150);\r
+                inst.setA(151);\r
+                test.equal(inst.a, 151);\r
+                test.equal(inst.getA(), 151);\r
+                test.equal(inst.get_a(), 151);\r
+                inst.set_a(152);\r
+                test.equal(inst.a, 152);\r
+                test.equal(inst.toString(), ".Test1");\r
+                test.throws(function() {\r
+                    inst.setA(null); // required\r
+                });\r
+                test.throws(function() {\r
+                    inst.setA([]);\r
+                });\r
+                var size = inst.calculate();\r
+                var bb = new ByteBuffer(3);\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<08 98 01>");\r
+                var instDec = Test1.decode(bb);\r
+                test.equal(instDec.a, 152);\r
+\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Basically the same as example1, but with an unsigned value.\r
+        "example1u": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example1u.proto");\r
+                var Test1u = builder.build("Test1u");\r
+                test.ok(typeof Test1u == 'function');\r
+                var inst = new Test1u(-1);\r
+                test.strictEqual(inst.a, 4294967295);\r
+                var bb = new ByteBuffer(6);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<08 FF FF FF FF 0F>");\r
+                var instDec = Test1u.decode(bb);\r
+                test.strictEqual(instDec.a, 4294967295);\r
+\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Example "Strings" from the protobuf docs\r
+        // https://developers.google.com/protocol-buffers/docs/encoding#types\r
+        "example2": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example2.proto");\r
+                var Test2 = builder.build("Test2");\r
+                var inst = new Test2("testing");\r
+                var bb = new ByteBuffer(9);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<12 07 74 65 73 74 69 6E 67>");\r
+                var instDec = Test2.decode(bb);\r
+                test.equal(instDec.b, "testing");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Example "Embedded Messages" from the protobuf docs\r
+        // https://developers.google.com/protocol-buffers/docs/encoding#embedded\r
+        "example3": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example3.proto");\r
+                var root = builder.build();\r
+                var Test1 = root.Test1;\r
+                var Test3 = root.Test3;\r
+                var inst = new Test3(new Test1(150));\r
+                var bb = new ByteBuffer(5);\r
+                test.equal(inst.c.a, 150);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<1A 03 08 96 01>");\r
+                var instDec = Test3.decode(bb);\r
+                test.equal(instDec.c.a, 150);\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "example4": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example4.proto");\r
+                var Test4 = builder.build("Test4");\r
+                var inst = new Test4([3, 270, 86942]);\r
+                var bb = new ByteBuffer(8);\r
+                test.equal(inst.d.length, 3);\r
+                var size = inst.calculate();\r
+                inst.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<22 06 03 8E 02 9E A7 05>");\r
+                var instDec = Test4.decode(bb);\r
+                test.equal(bb.toString("debug"), "22 06 03 8E 02 9E A7 05|");\r
+                test.equal(instDec.d.length, 3);\r
+                test.equal(instDec.d[2], 86942);\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "example5": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example5.proto");\r
+                builder.build();\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "constructor": function(test) {\r
+            var builder = ProtoBuf.loadProtoFile(__dirname+"/example1.proto");\r
+            var Test1 = builder.build("Test1");\r
+            var t1 = new Test1(123),\r
+                t2 = new Test1({a: 123}),\r
+                t3 = new Test1(t1);\r
+            test.deepEqual(t1, t2);\r
+            test.deepEqual(t2, t3);\r
+            test.done();\r
+        },\r
+        \r
+        "constructorWithOneofs": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/oneof.proto"),\r
+                    MyOneOf = builder.build("MyOneOf"),\r
+                    TOneOf = builder.lookup(".MyOneOf");\r
+                test.ok(TOneOf.getChild("my_oneof"));\r
+                \r
+                var myOneOf = new MyOneOf();\r
+                test.strictEqual(myOneOf.my_oneof, null);\r
+                myOneOf.set("id", 1);\r
+                test.strictEqual(myOneOf.my_oneof, "id");\r
+                myOneOf.set("name", "me");\r
+                test.strictEqual(myOneOf.my_oneof, "name");\r
+                test.strictEqual(myOneOf.id, null);\r
+                \r
+                var copy = new MyOneOf(myOneOf); // this line is what was failing\r
+                // Error: .MyOneOf#my_oneof is not a field: undefined\r
+                \r
+                test.deepEqual(myOneOf, copy);\r
+                \r
+                // Test same things are there\r
+                test.strictEqual(copy.my_oneof, "name");\r
+                test.strictEqual(copy.name, "me");\r
+                test.strictEqual(copy.id, null);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "numberFormats": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/numberformats.proto");\r
+                var Formats = builder.build("Formats");\r
+                test.strictEqual(Formats.DEC, 1);\r
+                test.strictEqual(Formats.HEX, 31);\r
+                test.strictEqual(Formats.OCT, 15);\r
+                var Msg = builder.build("Msg");\r
+                var msg = new Msg();\r
+                test.strictEqual(msg.dec, -1);\r
+                test.strictEqual(msg.hex, -31);\r
+                test.strictEqual(msg.hexUC, 521);\r
+                test.strictEqual(msg.oct, -15);\r
+                test.strictEqual(msg.exp, 0.1e5);\r
+                test.strictEqual(msg.nod, 1.);\r
+                test.strictEqual(msg.exn, 1e8);\r
+                test.strictEqual(msg.sp1, Infinity);\r
+                test.strictEqual(msg.sp2, -Infinity);\r
+                test.ok(isNaN(msg.sp3));\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Check encode/decode against a table of known correct pairs.\r
+        // Note that javascript ArrayBuffer does not support signed Zero or NaN\r
+        // bertdouglas (https://github.com/bertdouglas)\r
+        "float": function(test) {\r
+            try {\r
+                var str_proto = "message Float {"\r
+                    + " required float f = 1;"\r
+                    + "}";\r
+                var builder = ProtoBuf.loadProto(str_proto);\r
+                var root = builder.build();\r
+                var Float = root.Float;\r
+\r
+                var in_tolerance = function (reference,actual) {\r
+                    var tol = 1e-6;\r
+                    var scale = 1.0;\r
+                    if (reference != 0.0 ) {\r
+                        scale = reference;\r
+                    };\r
+                    var err = Math.abs(reference - actual)/scale;\r
+                    return err < tol;\r
+                };\r
+\r
+                var f_vals = [\r
+                    // hex values are shown here in big-endian following IEEE754 notation\r
+                    // protobuf is little-endian\r
+                    // { f: -0.0 , b: "80 00 00 00" },\r
+                    { f: +0.0 , b: "00 00 00 00" },\r
+                    { f: -1e-10 , b: "AE DB E6 FF" },\r
+                    { f: +1e-10 , b: "2E DB E6 FF" },\r
+                    { f: -2e+10 , b: "D0 95 02 F9" },\r
+                    { f: +2e+10 , b: "50 95 02 F9" },\r
+                    { f: -3e-30 , b: "8E 73 63 90" },\r
+                    { f: +3e-30 , b: "0E 73 63 90" },\r
+                    { f: -4e+30 , b: "F2 49 F2 CA" },\r
+                    { f: +4e+30 , b: "72 49 F2 CA" },\r
+                    { f: -123456789.0 , b: "CC EB 79 A3" },\r
+                    { f: +123456789.0 , b: "4C EB 79 A3" },\r
+                    { f: -0.987654321 , b: "BF 7C D6 EA" },\r
+                    { f: +0.987654321 , b: "3F 7C D6 EA" },\r
+                    { f: -Infinity , b: "FF 80 00 00" },\r
+                    { f: +Infinity , b: "7F 80 00 00" }\r
+                    // { f: -NaN , b: "FF C0 00 00>" },\r
+                    // { f: +NaN , b: "7F C0 00 00" }\r
+                ];\r
+\r
+                f_vals.map( function(x) {\r
+                    // check encode\r
+                    var m1 = new Float();\r
+                    var b1 = new ByteBuffer();\r
+                    m1.f = x.f;\r
+                    m1.encode(b1);\r
+                    var q1 = b1.slice(1,5).compact().reverse();\r
+                    test.strictEqual('<' + x.b + '>', q1.toString("debug"));\r
+\r
+                    // check decode\r
+                    var b2 = new ByteBuffer();\r
+                    var s1 = x.b + ' 0D';\r
+                    var s2 = s1.split(" ");\r
+                    var s3 = s2.reverse();\r
+                    var i1 = s3.map(function(y) { return parseInt(y,16) } );\r
+                    i1.map(function(y) { b2.writeUint8(y) });\r
+                    b2.limit = b2.offset;\r
+                    b2.offset = 0;\r
+                    var m2 = Float.decode(b2);\r
+\r
+                    var s4 = "" + x.f +" " + m2.f;\r
+                    if ( isNaN(x.f) ) {\r
+                        test.ok( isNaN(m2.f), s4 );\r
+                    }\r
+                    else if ( ! isFinite( x.f) ) {\r
+                        test.ok( x.f === m2.f, s4 );\r
+                    }\r
+                    else {\r
+                        test.ok( in_tolerance(x.f, m2.f), s4 );\r
+                    }\r
+                });\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "bytes": function(test) {\r
+            try {\r
+                var str_proto = "message Test { required bytes b = 1; }";\r
+                var builder = ProtoBuf.loadProto(str_proto);\r
+                var Test = builder.build("Test");\r
+                var bb = new ByteBuffer(4).writeUint32(0x12345678).flip();\r
+                var myTest = new Test(bb);\r
+                test.strictEqual(myTest.b.array, bb.array);\r
+                var bb2 = new ByteBuffer(6);\r
+                var size = myTest.calculate();\r
+                myTest.encode(bb2);\r
+                test.strictEqual(bb2.offset, size);\r
+                test.equal(bb2.flip().toString("debug"), "<0A 04 12 34 56 78>");\r
+                myTest = Test.decode(bb2);\r
+                test.equal(myTest.b.BE().readUint32(), 0x12345678);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "bytesFromFile": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Image { required bytes data = 1; }"),\r
+                    Image = builder.build("Image"),\r
+                    data = fs.readFileSync(__dirname+"/../protobuf.png"),\r
+                    image = new Image({ data: data }),\r
+                    bb = image.encode(),\r
+                    imageDec = Image.decode(bb),\r
+                    dataDec = imageDec.data.toBuffer();\r
+                test.strictEqual(data.length, dataDec.length);\r
+                test.deepEqual(data, dataDec);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "notEnoughBytes": function(test) {\r
+            var builder = ProtoBuf.loadProto("message Test { required bytes b = 1; }");\r
+            var Test = builder.build("Test");\r
+            var bb = new ByteBuffer().writeUint32(0x12345678).flip();\r
+            var encoded = new ByteBuffer(6);\r
+            new Test(bb).encode(encoded);\r
+            test.equal(encoded.flip().toString("debug"), "<0A 04 12 34 56 78>");\r
+            encoded = encoded.slice(0, 5); // chop off the last byte\r
+            var err = null;\r
+            try {\r
+                Test.decode(encoded);\r
+            } catch (caught) {\r
+                err = caught;\r
+            }\r
+            test.ok(err && err.message && err.message.indexOf(": 4 required but got only 3") >= 0);\r
+            test.done();\r
+        },\r
+\r
+        "bool": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test { optional bool ok = 1 [ default = false ]; }"),\r
+                    Test = builder.build("Test"),\r
+                    t =  new Test();\r
+                test.strictEqual(t.ok, null); // Not set as it is optional\r
+                t.setOk(true);\r
+                test.strictEqual(t.ok, true);\r
+                test.strictEqual(Test.decode(t.encode()).ok, true);\r
+                t.setOk(false);\r
+                test.strictEqual(t.ok, false);\r
+                t.setOk(null); // Not set\r
+                test.strictEqual(Test.decode(t.encode()).ok, false); // = default when missing\r
+            } catch (err) {\r
+                fail(err);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // As mentioned by Bill Katz\r
+        "T139": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/T139.proto");\r
+                var T139 = builder.build("T139");\r
+                test.ok(typeof T139 == 'function');\r
+                var inst = new T139(139,139);\r
+                test.equal(inst.a, 139);\r
+                test.equal(inst.b, 139);\r
+                inst.setA(139);\r
+                inst.setB(139);\r
+                test.equal(inst.a, 139);\r
+                test.equal(inst.b, 139);\r
+                var bb = new ByteBuffer(3);\r
+                inst.encode(bb);\r
+                test.equal(bb.flip().toString("debug"), "<08 8B 01 10 8B 01>");\r
+                var instDec = T139.decode(bb);\r
+                test.equal(instDec.a, 139);\r
+                test.equal(instDec.b, 139);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "emptyDefaultString": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test1 { required string test = 1 [default = \"\"]; }");\r
+                var Test1;\r
+                test.doesNotThrow(function() {\r
+                    Test1 = builder.build("Test1");\r
+                });\r
+                var test1 = new Test1();\r
+                test.strictEqual(test1.test, "");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "trailingSemicolon": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test1 { optional string test = 1; };");\r
+                test.doesNotThrow(function() {\r
+                    var Test1 = builder.build("Test1");\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "inner": {\r
+\r
+            "longstr": function(test) {\r
+                try {\r
+                    var builder = ProtoBuf.loadProto("message Test { required Inner a = 1; message Inner { required string b = 1; } }");\r
+                    var Test = builder.build("Test");\r
+                    var t = new Test();\r
+                    var data = "0123456789"; // 10: 20, 40, 80, 160, 320 bytes\r
+                    for (var i=0; i<5; i++) data += data;\r
+                    test.equal(data.length, 320);\r
+                    t.a = new Test.Inner(data);\r
+                    var bb = t.encode();\r
+                    var t2 = Test.decode(bb);\r
+                    test.equal(t2.a.b.length, 320);\r
+                    test.equal(data, t2.a.b);\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            },\r
+\r
+            "multiple": function(test) {\r
+                try {\r
+                    var str = "";\r
+                    for (var i=0; i<200; i++) str += 'a';\r
+                    var builder = ProtoBuf.loadProtoFile(__dirname+"/inner.proto");\r
+                    var fooCls = builder.build("Foo");\r
+                    var barCls = builder.build("Bar");\r
+                    var bazCls = builder.build("Baz");\r
+                    var foo = new fooCls(new barCls(str), new bazCls(str));\r
+                    var fooEncoded = foo.encode();\r
+                    test.doesNotThrow(function() {\r
+                        fooCls.decode(fooEncoded);\r
+                    });\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            },\r
+\r
+            "float": function(test) {\r
+                try {\r
+                    var builder = ProtoBuf.loadProto("message Foo { required Bar bar = 1; } message Bar { required float baz = 1; }");\r
+                    var root = builder.build();\r
+                    var foo = new root.Foo(new root.Bar(4));\r
+                    var bb = foo.encode();\r
+                    var foo2 = root.Foo.decode(bb);\r
+                    test.equal(foo.bar.baz, 4);\r
+                    test.equal(foo2.bar.baz, foo.bar.baz);\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            }\r
+\r
+        },\r
+\r
+        "truncated": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test { required int32 a = 1; required int32 b = 2; }");\r
+                var Test = builder.build("Test");\r
+                var t = new Test(), bb = new ByteBuffer(2);\r
+                t.setA(1);\r
+                try {\r
+                    bb = t.encode(bb).flip();\r
+                    test.ok(false);\r
+                } catch (e) {\r
+                    test.ok(e.encoded);\r
+                    bb = e.encoded.flip();\r
+                    test.equal(bb.toString("debug"), "<08 01>");\r
+                }\r
+                var t2;\r
+                try /* to decode truncated message */ {\r
+                    t2 = Test.decode(bb);\r
+                    test.ok(false); // ^ throws\r
+                } catch (e) {\r
+                    // But still be able to access the rest\r
+                    var t3 = e.decoded;\r
+                    test.strictEqual(t3.a, 1);\r
+                    test.strictEqual(t3.b, null);\r
+                }\r
+                test.strictEqual(t2, undefined);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Options on all levels\r
+        "options": {\r
+\r
+            "parse": function(test) {\r
+                try {\r
+                    var parser = new ProtoBuf.DotProto.Parser(ProtoBuf.Util.fetch(__dirname+"/options.proto"));\r
+                    var root = parser.parse();\r
+                    test.equal(root["package"], "My");\r
+                    test.strictEqual(root["options"]["(toplevel_1)"], 10);\r
+                    test.equal(root["options"]["(toplevel_2)"], "Hello world!");\r
+                    var opt = root["messages"][0]["fields"][0]["options"];\r
+                    test.equal(opt["default"], "Max");\r
+                    opt = root["messages"][0]["options"];\r
+                    test.strictEqual(opt["(inmessage)"], "My.Test");\r
+                    test.strictEqual(opt["(foo.my_option).bar"], false);\r
+                    opt = root["messages"][0]["fields"][1]["options"];\r
+                    test.strictEqual(opt["default"], "Shouldn't mix quotes");\r
+                    opt = root["messages"][0]["fields"][2]["options"];\r
+                    test.strictEqual(opt["default"], 'Shouldn"t mix quotes');\r
+                    opt = root["messages"][0]["fields"][3]["options"];\r
+                    test.strictEqual(opt["(foo_options).opt1"], 123);\r
+                    test.strictEqual(opt["(foo_options).opt2"], "baz");\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            },\r
+\r
+            "export": function(test) {\r
+                try {\r
+                    var builder = ProtoBuf.loadProtoFile(__dirname+"/options.proto");\r
+                    var My = builder.build("My");\r
+                    test.deepEqual(My.$options, {\r
+                        "(toplevel_1)": 10,\r
+                        "(toplevel_2)": "Hello world!"\r
+                    });\r
+                    test.strictEqual(My.$options['(toplevel_1)'], 10);\r
+                    test.deepEqual(My.Test.$options, {\r
+                        "(inmessage)": "My.Test",\r
+                        "(foo.my_option).bar": false\r
+                    });\r
+                } catch (e) {\r
+                    fail(e);\r
+                }\r
+                test.done();\r
+            }\r
+        },\r
+\r
+        // Comments\r
+        "comments": function(test) {\r
+            try {\r
+                var tn = new ProtoBuf.DotProto.Tokenizer(ProtoBuf.Util.fetch(__dirname+'/comments.proto'));\r
+                var token, tokens = [];\r
+                do {\r
+                    token = tn.next();\r
+                    tokens.push(token);\r
+                } while (token !== null);\r
+                test.deepEqual(tokens, ['message', 'TestC', '{', 'required', 'int32', 'a', '=', '1', ';', '}', null]);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // A more or less complex proto with type references\r
+        "complexProto": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/complex.proto");\r
+                validateComplex(test, builder.build("Game"));\r
+                var TCars = builder.lookup("Game.Cars");\r
+                test.strictEqual(TCars.fqn(), ".Game.Cars");\r
+            } catch(e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // The same created without calling upon the parser to do so\r
+        "complexJSON": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadJsonFile(__dirname+"/complex.json");\r
+                validateComplex(test, builder.build("Game"));\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Test error messages\r
+        "errorMessage": function(test) {\r
+            test.throws(function() {\r
+                var builder = ProtoBuf.loadJsonFile(__dirname+"/complex.json");\r
+                var Game = builder.build("Game");\r
+                var car = new Game.Cars.Car();\r
+                car.speed = "hello";\r
+                car.encode();\r
+            }, /Illegal value for speed/);\r
+            test.done();\r
+        },\r
+\r
+        // Builder reused to add definitions from multiple sources\r
+        "multiBuilder": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/example1.proto");\r
+                ProtoBuf.loadProtoFile(__dirname+"/example2.proto", builder);\r
+                var ns = builder.build();\r
+                test.ok(!!ns.Test1);\r
+                test.ok(!!ns.Test2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Inner messages test\r
+        "inner": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/repeated.proto");\r
+                var root = builder.build(),\r
+                    Outer = root.Outer,\r
+                    Inner = root.Inner;\r
+                // Empty\r
+                var outer = new Outer();\r
+                var bb = new ByteBuffer(1).fill(0).flip();\r
+                outer.encode(bb);\r
+                test.equal(bb.flip().toString("debug"), "|00");\r
+                var douter = Outer.decode(bb);\r
+                test.ok(douter.inner instanceof Array);\r
+                test.equal(douter.inner.length, 0);\r
+                // Multiple\r
+                outer = new Outer({ inner: [new Inner(1), new Inner(2)] });\r
+                bb = new ByteBuffer(8);\r
+                var size = outer.calculate();\r
+                outer.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<0A 02 08 01 0A 02 08 02>");\r
+                douter = Outer.decode(bb);\r
+                test.ok(douter.inner instanceof Array);\r
+                test.equal(douter.inner.length, 2);\r
+                test.equal(douter.inner[0].inner_value, 1);\r
+                test.equal(douter.inner[1].inner_value, 2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Packed vs. not packed repeated fields test\r
+        "packed": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/packed.proto");\r
+                var Message = builder.build("Message");\r
+                // Both empty\r
+                var message = new Message();\r
+                var bb = new ByteBuffer(1).fill(0).flip();\r
+                var size = message.calculate();\r
+                message.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "|00");\r
+                message = Message.decode(bb);\r
+                test.ok(message.a instanceof Array);\r
+                test.equal(message.a.length, 0);\r
+                test.ok(message.b instanceof Array);\r
+                test.equal(message.b.length, 0);\r
+                // Both non-empty\r
+                message = new Message([1,2,3], [1,2,3]);\r
+                size = message.calculate();\r
+                message.encode(bb.resize(11));\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<0A 03 01 02 03 10 01 10 02 10 03>");\r
+                message = Message.decode(bb);\r
+                test.ok(message.a instanceof Array);\r
+                test.equal(message.a.length, 3);\r
+                test.deepEqual(message.a, [1,2,3]);\r
+                test.ok(message.b instanceof Array);\r
+                test.equal(message.b.length, 3);\r
+                test.deepEqual(message.b, [1,2,3]);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Legacy groups test\r
+        "groups": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/groups.proto");\r
+                var root = builder.build();\r
+                var Outer = root.Outer;\r
+                var TOuter = builder.ns.getChild("Outer");\r
+                var TInner = TOuter.getChild("MyInner");\r
+                test.ok(TInner instanceof ProtoBuf.Reflect.Message);\r
+                test.strictEqual(TInner.isGroup, true);\r
+                var Tinner = TOuter.getChild("myinner");\r
+                test.ok(Tinner instanceof ProtoBuf.Reflect.Message.Field);\r
+                test.strictEqual(Tinner.id, 2);\r
+                test.deepEqual(Tinner.options, { "deprecated": true });\r
+                var Inner = root.Outer.MyInner;\r
+                var outer = new Outer("a", [new Inner("hello")], "b", new Inner("world"));\r
+                var bb = new ByteBuffer();\r
+                var size = outer.calculate();\r
+                outer.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                bb.flip().compact();\r
+                var wiredMsg = [\r
+                    "0A", // 1|010 = id 1, wire type 2 (ldelim)\r
+                    "01", // length 1\r
+                    "61", // "a"\r
+                    "13", // 10|011 = id 2, wire type 3 (start group)\r
+                    "1A", // 11|010 = id 3, wire type 2 (ldelim)\r
+                    "05", // length 5\r
+                    "68 65 6C 6C 6F", // "hello"\r
+                    "14", // 10|100 = id 2, wire type 4 (end group)\r
+                    "22", // 100|010 = id 4, wire type 2 (ldelim)\r
+                    "01", // length 1\r
+                    "62", // "b"\r
+                    "2B", // 101|011 = id 5, wire type = 3 (start group)\r
+                    "1A", // 11|010 = id 3, wire type = 2 (ldelim)\r
+                    "05", // length 5\r
+                    "77 6F 72 6C 64", // "world"\r
+                    "2C" // 101|100 = id 5, wire type = 4 (end group)\r
+                ];\r
+                test.equal(bb.toString("debug"), "<" +wiredMsg.join(" ") + ">");\r
+                var douter = Outer.decode(bb);\r
+                test.strictEqual(douter.before, "a");\r
+                test.strictEqual(douter.myinner.length, 1);\r
+                test.strictEqual(douter.myinner[0].a, "hello");\r
+                test.strictEqual(douter.after, "b");\r
+                bb.offset = 0;\r
+                douter = root.OuterSparse.decode(bb);\r
+                test.strictEqual(bb.offset, bb.limit);\r
+                test.strictEqual(douter.before, "a");\r
+                test.strictEqual(douter.after, "b");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "x64Fixed": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/x64.proto");\r
+                var Test = builder.build("Test");\r
+                var myTest = new Test();\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -1);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 1);\r
+                myTest.setVal(-2);\r
+                myTest.setUval(2);\r
+                var bb = new ByteBuffer(18); // 2x tag + 2x 64bit\r
+                var size = myTest.calculate();\r
+                myTest.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<09 FE FF FF FF FF FF FF FF 11 02 00 00 00 00 00 00 00>");\r
+                //                         ^ wireType=1, id=1         ^ wireType=1, id=2\r
+                myTest = Test.decode(bb);\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -2);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "x64Varint": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/x64.proto");\r
+                var Test = builder.build("Test2");\r
+                var Test = builder.build("Test2");\r
+                var myTest = new Test();\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -1);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 1);\r
+                test.ok(myTest.sval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.sval.unsigned, false);\r
+                test.equal(myTest.sval.toNumber(), -2);\r
+\r
+                myTest.setVal(-2);\r
+                myTest.setUval(2);\r
+                myTest.setSval(-3);\r
+                var bb = new ByteBuffer(3+10+2); // 3x tag + 1x varint 10byte + 2x varint 1byte\r
+                var size = myTest.calculate();\r
+                myTest.encode(bb);\r
+                test.strictEqual(bb.offset, size);\r
+                test.equal(bb.flip().toString("debug"), "<08 FE FF FF FF FF FF FF FF FF 01 10 02 18 05>");\r
+                // 08: wireType=0, id=1, 18: wireType=0, id=2, ?: wireType=0, id=3\r
+                myTest = Test.decode(bb);\r
+                test.ok(myTest.val instanceof ByteBuffer.Long);\r
+                test.equal(myTest.val.unsigned, false);\r
+                test.equal(myTest.val.toNumber(), -2);\r
+                test.ok(myTest.uval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.uval.unsigned, true);\r
+                test.equal(myTest.uval.toNumber(), 2);\r
+                test.ok(myTest.sval instanceof ByteBuffer.Long);\r
+                test.equal(myTest.sval.unsigned, false);\r
+                test.equal(myTest.sval.toNumber(), -3);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "keywords": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Reserved { optional string get = 1; }");\r
+                var My = builder.build();\r
+                var myTest = new My.Reserved("a");\r
+                test.doesNotThrow(function() {\r
+                    myTest.encode();\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "imports": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/imports.proto");\r
+                var root = builder.build();\r
+                test.ok(!!root.Test1);\r
+                test.ok(!!root.Test2);\r
+                test.ok(!!root.My.Test3);\r
+                test.notEqual(root.Test2, root.My.Test2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "weakImports": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/imports-weak.proto");\r
+                var root = builder.build();\r
+            } catch (e) {\r
+                test.ok(e.message.indexOf("unresolvable type reference") >= 0);\r
+                test.done();\r
+                return;\r
+            }\r
+            var e = new Error("Weak import was imported.");\r
+            fail(e);\r
+        },\r
+\r
+        "importExtensions": function(test) {\r
+            var x = "package x; \\r
+            message Test { \\r
+                extensions 1 to 10; \\r
+            } \\r
+            extend Test { \\r
+                optional int32 first_val = 1; \\r
+            }";\r
+            var y = "package y; \\r
+            extend x.Test { \\r
+                optional int32 second_val = 2; \\r
+            }";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(x, builder);\r
+            ProtoBuf.loadProto(y, builder);\r
+            var Test = builder.build('x.Test');\r
+            var inst = new Test();\r
+            test.strictEqual(inst[".x.first_val"], null);\r
+            test.strictEqual(inst[".y.second_val"], null);\r
+            test.done();\r
+        },\r
+\r
+        "toplevel": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/toplevel.proto");\r
+                var My = builder.build("My");\r
+                test.ok(!!My.MyEnum);\r
+                test.equal(My.MyEnum.ONE, 1);\r
+                test.equal(My.MyEnum.TWO, 2);\r
+                test.ok(!!My.Test);\r
+                var myTest = new My.Test();\r
+                test.equal(myTest.num, My.MyEnum.ONE);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importsToplevel": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/imports-toplevel.proto");\r
+                var My = builder.build("My");\r
+                test.ok(!!My.MyEnum);\r
+                test.equal(My.MyEnum1.ONE, 1);\r
+                test.equal(My.MyEnum1.TWO, 2);\r
+                test.ok(!!My.Test1);\r
+                var myTest = new My.Test1();\r
+                test.equal(myTest.num, My.MyEnum.ONE);\r
+                test.equal(myTest.num1, My.MyEnum1.ONE);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importDuplicate": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/import_a.proto");\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/import_b.proto", builder);\r
+                });\r
+                var root = builder.build();\r
+                test.ok(root.A);\r
+                test.ok(root.B);\r
+                test.ok(root.Common);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importDuplicateDifferentBuilder": function(test) {\r
+            try {\r
+                var builderA = ProtoBuf.loadProtoFile(__dirname+"/import_a.proto");\r
+                var builderB;\r
+                test.doesNotThrow(function() {\r
+                    builderB = ProtoBuf.loadProtoFile(__dirname+"/import_b.proto");\r
+                });\r
+                var rootA = builderA.build();\r
+                var rootB = builderB.build();\r
+                test.ok(rootA.A);\r
+                test.ok(rootB.B);\r
+                test.ok(rootA.Common);\r
+                test.ok(rootB.Common);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "dupimport": function(test) {\r
+            try {\r
+                // Suppress logging result to stdout\r
+                fixture.capture(function() { return false;});\r
+                require(__dirname+"/../cli/pbjs.js").main(["node", "bin/pbjs", __dirname+"/dupimport/main.proto", "--quiet"]);\r
+                fixture.release();\r
+            } catch (e) {\r
+                fixture.release();\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "field_name_same_as_package": function(test) {\r
+            try {\r
+                fixture.capture(function() { return false;});\r
+                require(__dirname+"/../cli/pbjs.js").main(["node", "bin/pbjs", __dirname+"/field_name_same_as_package/main.proto", "--quiet"]);\r
+                fixture.release();\r
+            } catch (e) {\r
+                fixture.release();\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importRoot": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile({\r
+                    root: __dirname,\r
+                    file: "importRoot/file1.proto"\r
+                });\r
+                var Test = builder.build("Test");\r
+                test.ok(new Test() instanceof ProtoBuf.Builder.Message);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "extend": function(test) {\r
+            try {\r
+                var ast = new ProtoBuf.DotProto.Parser(fs.readFileSync(__dirname+"/extend.proto")).parse();\r
+                test.deepEqual(ast, { package: null,\r
+                    messages:\r
+                        [ { ref: 'google.protobuf.MessageOptions',\r
+                            fields:\r
+                                [ { rule: 'optional',\r
+                                    type: 'int32',\r
+                                    name: 'foo',\r
+                                    options: {},\r
+                                    id: 1001 } ] },\r
+                            { name: 'Foo',\r
+                                fields: [],\r
+                                enums: [],\r
+                                messages: [],\r
+                                options: {},\r
+                                services: [],\r
+                                oneofs: {},\r
+                                extensions: [ [ 2, 536870911 ] ] },\r
+                            { ref: 'Foo',\r
+                                fields:\r
+                                    [ { rule: 'optional',\r
+                                        type: 'string',\r
+                                        name: 'bar',\r
+                                        options: {},\r
+                                        id: 2 } ] },\r
+                            { name: 'Bar',\r
+                                fields: [],\r
+                                enums: [],\r
+                                messages:\r
+                                    [ { name: 'Foo',\r
+                                        fields: [],\r
+                                        enums: [],\r
+                                        messages: [],\r
+                                        options: {},\r
+                                        services: [],\r
+                                        oneofs: {} },\r
+                                        { ref: '.Foo',\r
+                                            fields: [ { rule: 'optional', type: 'Foo', name: 'foo', options: {}, id: 3 } ] } ],\r
+                                options: {},\r
+                                services: [],\r
+                                oneofs: {} } ],\r
+                    enums: [],\r
+                    imports: [ 'google/protobuf/descriptor.proto' ],\r
+                    options: {},\r
+                    services: [] }\r
+                );\r
+\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/extend.proto");\r
+                var TFoo = builder.lookup(".Foo"),\r
+                    TBar = builder.lookup(".Bar"),\r
+                    TBarFoo = builder.lookup(".Bar.Foo"),\r
+                    fields = TFoo.getChildren(ProtoBuf.Reflect.Message.Field);\r
+                test.strictEqual(fields.length, 2);\r
+                test.strictEqual(fields[0].name, ".bar");\r
+                test.strictEqual(fields[0].id, 2);\r
+                test.strictEqual(fields[1].name, ".Bar.foo");\r
+                test.strictEqual(fields[1].id, 3);\r
+                test.deepEqual(TFoo.extensions, [[2, ProtoBuf.ID_MAX]]); // explicitly defined\r
+                test.strictEqual(TBar.extensions, undefined); // none defined\r
+                test.deepEqual(TBar.getChild("foo"), { builder: builder, parent: TBar, name: "foo", field: TFoo.getChild('.Bar.foo') });\r
+                test.strictEqual(TBar.getChildren(ProtoBuf.Reflect.Message.Field).length, 0);\r
+                var root = builder.build();\r
+                test.strictEqual(TFoo.getChild(".Bar.foo").resolvedType, TBarFoo); // .Bar.Foo, not .Foo\r
+                var foo = new root.Foo(),\r
+                    bar = new root.Bar();\r
+                foo['.bar'] = "123";\r
+                foo['.Bar.foo'] = bar;\r
+                test.equal(foo.encode().compact().toString("debug"), "<12 03 31 32 33 1A 00>");\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // Custom options on all levels\r
+        // victorr (https://github.com/victorr)\r
+        "customOptions": function(test) {\r
+            try {\r
+                var parser = new ProtoBuf.DotProto.Parser(ProtoBuf.Util.fetch(__dirname+"/custom-options.proto"));\r
+                var root = parser.parse();\r
+                test.equal(root["options"]["(my_file_option)"], "Hello world!");\r
+                test.equal(root["messages"][7]["options"]["(my_message_option)"], 1234);\r
+                test.equal(root["messages"][7]["fields"][0]["options"]["(my_field_option)"], 4.5);\r
+                // test.equal(root["services"]["MyService"]["options"]["my_service_option"], "FOO");\r
+                // TODO: add tests for my_enum_option, my_enum_value_option\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "oneofs": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/oneof.proto"),\r
+                    MyOneOf = builder.build("MyOneOf"),\r
+                    TOneOf = builder.lookup(".MyOneOf");\r
+                test.ok(TOneOf.getChild("my_oneof"));\r
+                var myOneOf = new MyOneOf();\r
+                test.strictEqual(myOneOf.my_oneof, null);\r
+                myOneOf.set("id", 1);\r
+                test.strictEqual(myOneOf.my_oneof, "id");\r
+                myOneOf.set("name", "me");\r
+                test.strictEqual(myOneOf.my_oneof, "name");\r
+                test.strictEqual(myOneOf.id, null);\r
+                var bb = myOneOf.encode().compact();\r
+                test.strictEqual(bb.toString("debug"), "<12 02 6D 65>"); // id 2, wt 2, len 2\r
+                myOneOf = MyOneOf.decode(bb);\r
+                test.strictEqual(myOneOf.my_oneof, "name");\r
+                test.strictEqual(myOneOf.name, "me");\r
+                test.strictEqual(myOneOf.id, null);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "services": function(test) {\r
+            try {\r
+                var parser = new ProtoBuf.DotProto.Parser(ProtoBuf.Util.fetch(__dirname+"/custom-options.proto"));\r
+                var root = parser.parse();\r
+                test.deepEqual(root["services"], [{\r
+                    "name": "MyService",\r
+                    "rpc": {\r
+                        "MyMethod": {\r
+                            "request": "RequestType",\r
+                            "response": "ResponseType",\r
+                            "request_stream": false,\r
+                            "response_stream": false,\r
+                            "options": {\r
+                                "(my_method_option).foo": 567,\r
+                                "(my_method_option).bar": "Some string"\r
+                            }\r
+                        }\r
+                    },\r
+                    "options": {\r
+                        "(my_service_option)": "FOO"\r
+                    }\r
+                }]);\r
+\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/custom-options.proto");\r
+                var root = builder.build(),\r
+                    MyService = root.MyService,\r
+                    RequestType = root.RequestType,\r
+                    ResponseType = root.ResponseType,\r
+                    called = false;\r
+\r
+                test.deepEqual(MyService.$options, {\r
+                    "(my_service_option)": "FOO"\r
+                });\r
+                test.deepEqual(MyService.MyMethod.$options, {\r
+                    "(my_method_option).foo": 567,\r
+                    "(my_method_option).bar": "Some string"\r
+                });\r
+\r
+                // Provide the service with your actual RPC implementation based on whatever framework you like most.\r
+                var myService = new MyService(function(method, req, callback) {\r
+                    test.strictEqual(method, ".MyService.MyMethod");\r
+                    test.ok(req instanceof RequestType);\r
+                    called = true;\r
+\r
+                    // In this case we just return no error and our pre-built response. This must be properly async!\r
+                    setTimeout(callback.bind(this, null, (new ResponseType()).encode() /* as raw bytes for debugging */ ));\r
+                });\r
+\r
+                test.deepEqual(myService.$options, MyService.$options);\r
+                test.deepEqual(myService.MyMethod.$options, MyService.MyMethod.$options);\r
+\r
+                // Call the service with your request message and provide a callback. This will call your actual service\r
+                // implementation to perform the request and gather a response before calling the callback. If the\r
+                // request or response type is invalid i.e. not an instance of RequestType or ResponseType, your\r
+                // implementation will not be called as ProtoBuf.js handles this case internally and directly hands the\r
+                // error to your callback below.\r
+                myService.MyMethod(new RequestType(), function(err, res) {\r
+                    // We get: err = null, res = our prebuilt response. And that's it.\r
+                    if (err !== null) {\r
+                        fail(err);\r
+                    }\r
+                    test.strictEqual(called, true);\r
+                    test.ok(res instanceof ResponseType);\r
+                    test.done();\r
+                });\r
+                myService.MyMethod(new RequestType().encode(), function(err, res) {\r
+                    // We get: err = null, res = our prebuilt response. And that's it.\r
+                    if (err !== null) {\r
+                        fail(err);\r
+                    }\r
+                    test.strictEqual(called, true);\r
+                    test.ok(res instanceof ResponseType);\r
+                    test.done();\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+        },\r
+\r
+        // Properly ignore "syntax" and "extensions" keywords\r
+        // The corresponding .proto file has been removed upon request\r
+        /* "gtfs-realtime": function(test) {\r
+            try {\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/gtfs-realtime.proto");\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        }, */\r
+\r
+        "delimited": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Position { required int32 x = 1; required int32 y = 2; }");\r
+                var Position = builder.build("Position");\r
+                var bb = new ByteBuffer();\r
+                for (var i=0; i<2; i++) {\r
+                    var position = new Position(10,10);\r
+                    position.encodeDelimited(bb);\r
+                }\r
+                bb.flip();\r
+                for (i=0; i<2; i++) {\r
+                    position = Position.decodeDelimited(bb);\r
+                    test.strictEqual(position.x, 10);\r
+                    test.strictEqual(position.y, 10);\r
+                }\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "stringify": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Position { required int32 x = 1; required int64 y = 2; }");\r
+                var Position = builder.build("Position");\r
+                var position = new Position(1, ProtoBuf.Long.fromNumber(2));\r
+                var json = JSON.stringify(position);\r
+                test.strictEqual(json, '{"x":1,"y":{"low":2,"high":0,"unsigned":false}}');\r
+                position = new Position(JSON.parse(json));\r
+                test.strictEqual(position.x, 1);\r
+                test.ok(position.y instanceof ProtoBuf.Long);\r
+                test.deepEqual(position.y, {"low":2,"high":0,"unsigned":false});\r
+                // Also test if this encodes and decodes properly\r
+                position = Position.decode(position.encode());\r
+                test.ok(position.y instanceof ProtoBuf.Long);\r
+                test.deepEqual(position.y, {"low": 2, "high": 0, "unsigned": false });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "fields": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/optional.proto");\r
+                var Test1 = builder.build("Test1");\r
+                var test1 = new Test1();\r
+                test.strictEqual(test1.a, null);\r
+                test.deepEqual(Object.keys(test1), ['a','b']);\r
+                var bb = test1.encode();\r
+                test1 = Test1.decode(bb);\r
+                test.strictEqual(test1.a, null);\r
+                test.deepEqual(Object.keys(test1), ['a','b']);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "fieldsToCamelCase": function(test) {\r
+            try {\r
+                ProtoBuf.convertFieldsToCamelCase = true;\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/camelcase.proto");\r
+                var Test = builder.build("Test"),\r
+                    TTest = builder.lookup("Test");\r
+                var msg = new Test();\r
+\r
+                // Reverted collision on 1st\r
+                test.strictEqual(msg.some_field, null);\r
+                test.strictEqual(msg.someField, null);\r
+                test.equal(TTest.getChild("some_field").id, 1);\r
+                test.equal(TTest.getChild("someField").id, 2);\r
+\r
+\r
+                // Reverted collision on 2nd\r
+                test.strictEqual(msg.aField, null);\r
+                test.strictEqual(msg.a_field, null);\r
+                test.equal(TTest.getChild("aField").id, 3);\r
+                test.equal(TTest.getChild("a_field").id, 4);\r
+\r
+                // No collision\r
+                test.strictEqual(msg.itsAField, null);\r
+                test.equal(TTest.getChild("itsAField").id, 5);\r
+\r
+                test.ok(typeof msg.set_its_a_field === "function");\r
+                test.ok(typeof msg.setItsAField === "function");\r
+\r
+                ProtoBuf.convertFieldsToCamelCase = false;\r
+            } catch (e) {\r
+                ProtoBuf.convertFieldsToCamelCase = false;\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "setarray": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/setarray.proto");\r
+                var root = builder.build(),\r
+                    Outer = root.Outer,\r
+                    Inner = root.Inner,\r
+                    inners = [];\r
+\r
+                // Array of repeated messages\r
+                inners.push(new Inner("a"), new Inner("b"), new Inner("c"));\r
+                var outer = new Outer();\r
+                outer.setInners(inners);\r
+                test.deepEqual(outer.inners, inners);\r
+\r
+                // Array of repeated message objects\r
+                inners = [];\r
+                inners.push({ str: 'a' }, { str: 'b' }, { str: 'c' });\r
+                outer.setInners(inners); // Converts\r
+                test.ok(outer.inners[0] instanceof Inner);\r
+                test.deepEqual(outer.inners, inners);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+\r
+        // Make sure that our example at https://github.com/dcodeIO/ProtoBuf.js/wiki is not nonsense\r
+        "pingexample": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/PingExample.proto");\r
+                var Message = builder.build("Message");\r
+                var msg = new Message();\r
+                msg.ping = new Message.Ping(123456789);\r
+                var bb = msg.encode();\r
+                test.strictEqual(bb.limit, 7);\r
+                msg = Message.decode(bb);\r
+                test.ok(msg.ping);\r
+                test.notOk(msg.pong);\r
+                test.strictEqual(msg.ping.time, 123456789);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "negInt32": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message Test { required int32 value = 2; }");\r
+                var Test = builder.build("Test");\r
+                var t = new Test(-1);\r
+                var size = t.calculate();\r
+                var bb = t.encode(); // flips\r
+                test.strictEqual(bb.remaining(), size);\r
+                test.strictEqual(bb.toBase64(), "EP///////////wE=");\r
+                t = Test.decode(bb);\r
+                test.strictEqual(t.value, -1);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "negEnumId": function(test) {\r
+            try {\r
+                test.doesNotThrow(function() {\r
+                    var builder = ProtoBuf.loadProtoFile(__dirname+"/negid.proto");\r
+                    var Test = builder.build("Test");\r
+                    test.strictEqual(Test.LobbyType.INVALID, -1);\r
+                    var t = new Test(Test.LobbyType.INVALID);\r
+                    test.strictEqual(t.type, -1);\r
+                    var size = t.calculate();\r
+                    var bb = t.encode(); // flips\r
+                    test.strictEqual(bb.remaining(), size);\r
+                    t = Test.decode(bb);\r
+                    test.strictEqual(t.type, -1);\r
+                });\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "base64": function(test) {\r
+            try {\r
+                var Message = ProtoBuf.loadProto("message Message { required string s = 1; }").build("Message");\r
+                var msg = new Message("ProtoBuf.js");\r
+                var b64 = msg.toBase64();\r
+                test.strictEqual(b64, "CgtQcm90b0J1Zi5qcw==");\r
+                var msg2 = Message.decode64(b64);\r
+                test.deepEqual(msg, msg2);\r
+                msg2 = Message.decode(b64, "base64");\r
+                test.deepEqual(msg, msg2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "hex": function(test) {\r
+            try {\r
+                var Message = ProtoBuf.loadProto("message Message { required string s = 1; }").build("Message");\r
+                var msg = new Message("ProtoBuf.js");\r
+                var hex = msg.toHex();\r
+                test.strictEqual(hex, "0a0b50726f746f4275662e6a73");\r
+                var msg2 = Message.decodeHex(hex);\r
+                test.deepEqual(msg, msg2);\r
+                msg2 = Message.decode(hex, "hex");\r
+                test.deepEqual(msg, msg2);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "forwardComp": function(test) {\r
+            try {\r
+                var Message = ProtoBuf.loadProto("message Message { required int32 a = 1; required string b = 2; required float c = 3; }").build("Message");\r
+                var msg = new Message(123, "abc", 0.123);\r
+                var bb = msg.encode();\r
+                Message = ProtoBuf.loadProto("message Message {}").build("Message");\r
+                test.doesNotThrow(function() {\r
+                    Message.decode(bb);\r
+                });\r
+                test.strictEqual(bb.offset, bb.limit);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "tokenizerLine": function(test) {\r
+            try {\r
+                var parser = new ProtoBuf.DotProto.Parser("package test;\n\nmessage Message {\n\trequired string invalid = 1;}ERROR\n"),\r
+                    ast = null, err = null;\r
+                try {\r
+                    ast = parser.parse();\r
+                } catch (caught) {\r
+                    err = caught;\r
+                }\r
+                test.ok(err);\r
+                test.notOk(ast);\r
+                test.ok(err.message.indexOf("line 4:") >= 0);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "excludeFields": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message A { required int32 i = 1; } message B { required A A = 1; }");\r
+                builder.build();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "proto2jsExtend": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadJsonFile(__dirname+"/proto2js/Bar.json");\r
+                builder.build();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "emptyMessage": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message EmptyMessage {}"),\r
+                    EmptyMessage = builder.build("EmptyMessage");\r
+\r
+                var msg = new EmptyMessage(),\r
+                    ab = msg.toArrayBuffer();\r
+                test.strictEqual(ab.byteLength, 0);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "toRaw": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProto("message MyMessage { required int32 a = 1; required int32 b = 2; required bytes c = 3; }"),\r
+                    MyMessage = builder.build("MyMessage");\r
+                var raw = { a: 1, b: 2, c: "YWJj" },\r
+                    myMessage = new MyMessage(raw);\r
+                test.deepEqual(myMessage.c.toBase64(), raw.c);\r
+                test.deepEqual(myMessage.toRaw(true), raw);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "singleQuotedString": function(test) {\r
+            try{\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/string_single_quote.proto");\r
+                var TestSingleQuoteString = builder.build("TestSingleQuoteString");\r
+                test.ok(typeof TestSingleQuoteString == 'function');\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importDuplicateSingleQuote": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/import_a_single_quote.proto");\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/import_b.proto", builder);\r
+                });\r
+                var root = builder.build();\r
+                test.ok(root.A);\r
+                test.ok(root.B);\r
+                test.ok(root.Common);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "importStringSuccessively": function(test) {\r
+            try {\r
+                var proto1 = "message A { required string a = 1; };";\r
+                var proto2 = "import \"proto1.proto\"; message B { required A a = 1; };";\r
+                var builder = ProtoBuf.loadProto(proto1, "proto1.proto");\r
+                ProtoBuf.loadProto(proto2, builder, "proto2.proto");\r
+                var root = builder.build();\r
+                test.ok(root.A);\r
+                test.ok(root.B);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "multilineString": function(test) {\r
+            try {\r
+                var proto = "message TestMessage { required string test = 1 [default = \"1\"   \"2\"\n\"3\"];}";\r
+                var builder = ProtoBuf.loadProto(proto, "multilineString.proto");\r
+                var TestMessage = builder.build("TestMessage"),\r
+                    testMessage = new TestMessage();\r
+                test.strictEqual(testMessage.test, "123");\r
+                test.done();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "packable": function(test) {\r
+            try {\r
+                var proto = 'message Inner { required int32 id=2; }\nmessage Outer { repeated Inner inner = 1 [packed=true]; }';\r
+                var builder = ProtoBuf.loadProto(proto);\r
+                var root = builder.build();\r
+                var inner = new root.Inner(1),\r
+                    outer = new root.Outer(inner);\r
+                var bb = outer.encode().compact();\r
+                test.strictEqual(bb.toDebug(), "<0A 02 10 01>");\r
+                // 0A: wt 2, id 1\r
+                // 02: len 2\r
+                // 10: wt 0, id 2\r
+                // 01: 1\r
+                var outer2 = root.Outer.decode(bb);\r
+                test.strictEqual(outer2.inner.id, 1);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "$type": function(test) {\r
+            var builder = ProtoBuf.loadProto("message Test {}");\r
+            var Test = builder.build("Test"),\r
+                TTest = builder.lookup("Test");\r
+            test.strictEqual(new Test().$type, TTest);\r
+            test.done();\r
+        },\r
+\r
+        "descriptor": function(test) {\r
+            try {\r
+                var proto = 'import "./google/protobuf/descriptor.proto";';\r
+                var builder = ProtoBuf.loadProto(proto, "tests/proto.proto");\r
+                var root = builder.build("google.protobuf");\r
+                test.ok(root.FileDescriptorSet);\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "mismatchedNesting": function(test) {\r
+            try {\r
+                var proto = "message Child { optional uint32 foo = 1; } message FakeChild { optional uint32 foo = 1; } message Parent { optional Child child = 1; }";\r
+                var builder = ProtoBuf.loadProto(proto, "tests/mismatchedNesting.proto");\r
+                var root = builder.build();\r
+                var foo = new root.Parent({ child: new root.FakeChild({ foo: 1 })});\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        /* "mismatchedType": function(test) {\r
+            try {\r
+                var proto  = "message Test1 { optional string foo = 1; }";\r
+                    proto += "message Test2 { optional int32 foo = 1; }";\r
+                var builder = ProtoBuf.loadProto(proto, "tests/mistmatchedType.proto");\r
+                var root = builder.build();\r
+                var test1 = new root.Test1({ foo: 'bar' });\r
+                var test2 = root.Test2.decode(test1.encode());\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        }, */\r
+\r
+        "builderOptions": function(test) {\r
+            try {\r
+                var proto = "message Foo { optional uint32 foo_bar = 1; }";\r
+                var builder = ProtoBuf.newBuilder({\r
+                    convertFieldsToCamelCase: true\r
+                });\r
+                ProtoBuf.loadProto(proto, builder, "tests/builderOptions.proto");\r
+                var Foo = builder.build("Foo");\r
+                test.strictEqual(ProtoBuf.convertFieldsToCamelCase, false);\r
+                test.strictEqual(builder.options.convertFieldsToCamelCase, true);\r
+                var foo = new Foo();\r
+                test.ok(typeof foo.fooBar !== 'undefined');\r
+                test.ok(typeof foo.foo_bar === 'undefined');\r
+                test.done();\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        "proto3": function(test) {\r
+            try {\r
+                var builder = ProtoBuf.loadProtoFile(__dirname+"/proto3.proto");\r
+                test.doesNotThrow(function() {\r
+                    ProtoBuf.loadProtoFile(__dirname+"/proto3.proto", builder);\r
+                });\r
+                var root = builder.build();\r
+                test.ok(root.test.Foo.$type.syntax === 'proto3');\r
+            } catch (e) {\r
+                fail(e);\r
+            }\r
+            test.done();\r
+        },\r
+\r
+        // FIXME: This test relied on some bloated builder functionality that has been removed.\r
+        // Is it even mandatory to strictly disallow proto2/3 mixing, even if that would be illegal in the official\r
+        // implementation?\r
+        /* "proto3DisallowedFeatures": function(test) {\r
+            try {\r
+                // Required field\r
+                var proto = "syntax = \"proto3\"; message Foo { required int32 field = 1; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Field with default value\r
+                var proto = "syntax = \"proto3\"; message Foo { int32 field = 1 [default=42]; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Message with extension range\r
+                var proto = "syntax = \"proto3\"; message Foo { extensions 100 to max; } ";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Message with extension\r
+                var proto = "syntax = \"proto3\"; message Foo { extensions 100 to max; } " +\r
+                            "message Bar { extend Foo { optional Bar bar = 100; } }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Enum with non-zero first entry.\r
+                var proto = "syntax = \"proto3\"; enum E { A = 1; B = 2; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto, builder, "tests/proto3DisallowedFeatures.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Not a valid definition/.test(e.message));\r
+            }\r
+\r
+            try {\r
+                // Proto3 message referring to proto2 enum.\r
+                var proto2 = "syntax = \"proto2\"; enum E { A = 1; B = 2; }";\r
+                var proto3 = "syntax = \"proto3\"; message Test { E enum_field = 1; }";\r
+                var builder = ProtoBuf.newBuilder();\r
+                ProtoBuf.loadProto(proto2, builder, "tests/proto3DisallowedFeatures1.proto");\r
+                ProtoBuf.loadProto(proto3, builder, "tests/proto3DisallowedFeatures3.proto");\r
+                test.ok(false);  // ^ should throw\r
+            } catch (e) {\r
+                test.ok(/^Proto3 message refers to proto2 enum/.test(e.message));\r
+            }\r
+\r
+            test.done();\r
+        }, */\r
+\r
+        "proto3FieldPresence": function(test) {\r
+            var proto =\r
+                "syntax = \"proto3\";\n" +\r
+                "message Test {\n" +\r
+                "  int32 field_int32 = 1;\n" +\r
+                "  int64 field_int64 = 2;\n" +\r
+                "  string field_str = 3;\n" +\r
+                "  bytes field_bytes = 4;\n" +\r
+                "  Test field_msg = 5;\n" +\r
+                "  Enum field_enum = 6;\n" +\r
+                "  repeated int32 rpt_int32 = 11;\n" +\r
+                "  repeated int64 rpt_int64 = 12;\n" +\r
+                "  repeated string rpt_str = 13;\n" +\r
+                "  repeated bytes rpt_bytes = 14;\n" +\r
+                "  repeated Test rpt_msg = 15;\n" +\r
+                "  repeated Enum rpt_enum = 16;\n" +\r
+                "  oneof oneof_type { bool oneof_bool = 17; };\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/proto3FieldPresence.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            test.strictEqual(testMsg.field_int32, 0);\r
+            test.strictEqual(testMsg.field_int64.low, 0);\r
+            test.strictEqual(testMsg.field_int64.high, 0);\r
+            test.strictEqual(testMsg.field_str, "");\r
+            test.strictEqual(testMsg.field_msg, null);\r
+            test.ok(testMsg.field_bytes instanceof ByteBuffer);\r
+            test.strictEqual(testMsg.field_bytes.remaining(), 0);\r
+            test.strictEqual(testMsg.rpt_int32.length, 0);\r
+            test.strictEqual(testMsg.oneof_type, null);\r
+            test.strictEqual(testMsg.oneof_bool, false);\r
+\r
+            // No fields should go on the wire, even though they're set\r
+            var encoded = testMsg.encode();\r
+            test.strictEqual(encoded.remaining(), 0);\r
+            testMsg.field_int32 = 42;\r
+            encoded = testMsg.encode();\r
+            test.strictEqual(encoded.remaining(), 2);\r
+            testMsg.field_int32 = 0;\r
+            encoded = testMsg.encode();\r
+            test.strictEqual(encoded.remaining(), 0);\r
+\r
+            // Enum fields should be able to carry arbitrary values.\r
+            testMsg.field_enum = 42;\r
+            test.strictEqual(testMsg.field_enum, 42);\r
+            encoded = testMsg.encode();\r
+            testMsg = Test.decode(encoded);\r
+            test.strictEqual(testMsg.field_enum, 42);\r
+\r
+            // Explicitly set fields that are part of an oneof should\r
+            // be encoded even if set to their default value\r
+            testMsg = new Test();\r
+            testMsg.set("oneof_bool", false);\r
+            test.strictEqual(testMsg.oneof_type, "oneof_bool");\r
+            encoded = testMsg.encode().compact();\r
+            test.strictEqual(encoded.toString("debug"), "<88 01 00>"); // 17|varint (0term) + varint 0\r
+            var decoded = Test.decode(encoded);\r
+            test.strictEqual(decoded.oneof_type, "oneof_bool");\r
+            test.strictEqual(decoded.oneof_bool, false);\r
+\r
+            test.done();\r
+        },\r
+\r
+        "mapContainer": function(test) {\r
+            var proto =\r
+                "message Test {\n" +\r
+                "  map<string, int32> map_string_int32 = 1;\n" +\r
+                "  map<string, int64> map_string_int64 = 2;\n" +\r
+                "  map<string, string> map_string_string = 3;\n" +\r
+                "  map<string, Test> map_string_msg = 4;\n" +\r
+                "  map<string, Enum> map_string_enum = 5;\n" +\r
+                "  map<int32, string> map_int32_string = 6;\n" +\r
+                "  map<int64, string> map_int64_string = 7;\n" +\r
+                "  map<bool, string> map_bool_string = 9;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapContainer.proto");\r
+\r
+            var map_string_int32 =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_string_int32"));\r
+            test.strictEqual(map_string_int32.size, 0);\r
+            test.strictEqual(map_string_int32.has("asdf"), false);\r
+            test.strictEqual(map_string_int32.get("asdf"), undefined);\r
+            map_string_int32.set("asdf", 42);\r
+            test.strictEqual(map_string_int32.has("asdf"), true);\r
+            test.strictEqual(map_string_int32.get("asdf"), 42);\r
+\r
+            var it = map_string_int32.keys();\r
+            var itVal = it.next();\r
+            test.strictEqual(itVal.done, false);\r
+            test.strictEqual(itVal.value, "asdf");\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, true);\r
+\r
+            it = map_string_int32.values();\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, false);\r
+            test.strictEqual(itVal.value, 42);\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, true);\r
+\r
+            it = map_string_int32.entries();\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, false);\r
+            test.deepEqual(itVal.value, ["asdf", 42]);\r
+            itVal = it.next();\r
+            test.strictEqual(itVal.done, true);\r
+\r
+            map_string_int32.set("jkl;", 84);\r
+            test.strictEqual(map_string_int32.has("jkl;"), true);\r
+            test.strictEqual(map_string_int32.has("asdf"), true);\r
+            test.strictEqual(map_string_int32.size, 2);\r
+            map_string_int32.delete("jkl;");\r
+            test.strictEqual(map_string_int32.has("jkl;"), false);\r
+            test.strictEqual(map_string_int32.get("jkl;"), undefined);\r
+            test.strictEqual(map_string_int32.size, 1);\r
+\r
+            map_string_int32.clear();\r
+            test.strictEqual(map_string_int32.size, 0);\r
+\r
+            try {\r
+                map_string_int32.set("asdf", 42.1);\r
+                test.ok(false); // ^ should throw\r
+            } catch(e) {\r
+                test.ok(e.message.match(/not an integer/));\r
+            }\r
+\r
+            try {\r
+                map_string_int32.set(42, 42);\r
+                test.ok(false); // ^ should throw\r
+            } catch(e) {\r
+                test.ok(e.message.match(/not a string/));\r
+            }\r
+\r
+            // Test various key types to ensure that value->string->value\r
+            // conversion works.\r
+            var map_int32_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int32_string"));\r
+            test.strictEqual(map_int32_string.size, 0);\r
+            map_int32_string.set(12345678, "asdf");\r
+            test.strictEqual(map_int32_string.size, 1);\r
+            test.strictEqual(map_int32_string.has(12345678), true);\r
+            test.strictEqual(map_int32_string.get(12345678), "asdf");\r
+\r
+            var map_int64_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int64_string"));\r
+            test.strictEqual(map_int64_string.size, 0);\r
+            map_int64_string.set("9223372036854775807", "asdf");\r
+            test.strictEqual(map_int64_string.size, 1);\r
+            test.strictEqual(map_int64_string.has("9223372036854775807"), true);\r
+            test.strictEqual(map_int64_string.get("9223372036854775807"), "asdf");\r
+\r
+            // Ensure that initialization from a raw object works.\r
+            var map_int32_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int32_string"),\r
+                                 { 42: "asdf" });\r
+            test.strictEqual(map_int32_string.size, 1);\r
+            test.strictEqual(map_int32_string.keys().next().value, 42);\r
+\r
+            var map_int64_string =\r
+                new ProtoBuf.Map(builder.lookup("Test.map_int64_string"),\r
+                                 { "9223372036854775807": "asdf" });\r
+            test.strictEqual(map_int64_string.size, 1);\r
+            var i64 = map_int64_string.keys().next().value;\r
+            test.ok(i64 instanceof ProtoBuf.Long);\r
+            test.strictEqual(i64.toString(), "9223372036854775807");\r
+\r
+            test.done();\r
+        },\r
+\r
+        "mapField": function(test) {\r
+            var proto =\r
+                "message Test {\n" +\r
+                "  map<string, int32> map_string_int32 = 1;\n" +\r
+                "  map<string, int64> map_string_int64 = 2;\n" +\r
+                "  map<string, string> map_string_string = 3;\n" +\r
+                "  map<string, Test> map_string_msg = 4;\n" +\r
+                "  map<string, Enum> map_string_enum = 5;\n" +\r
+                "  map<int32, string> map_int32_string = 6;\n" +\r
+                "  map<int64, string> map_int64_string = 7;\n" +\r
+                "  map<bool, string> map_bool_string = 9;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapField.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            test.strictEqual(testMsg.map_string_int32.size, 0);\r
+            test.strictEqual(testMsg.map_string_int64.size, 0);\r
+            test.strictEqual(testMsg.map_string_string.size, 0);\r
+            test.strictEqual(testMsg.map_string_msg.size, 0);\r
+            test.strictEqual(testMsg.map_string_enum.size, 0);\r
+            test.strictEqual(testMsg.map_int32_string.size, 0);\r
+            test.strictEqual(testMsg.map_int64_string.size, 0);\r
+            test.strictEqual(testMsg.map_bool_string.size, 0);\r
+\r
+            testMsg.$set('map_string_int32', { 'asdf': 42 });\r
+\r
+            try {\r
+                testMsg.$set('map_string_int32', { 'asdf': 42.1 });\r
+                test.ok(false); // ^ should throw\r
+            } catch (e) {\r
+                test.ok(e.message.match(/Illegal/));\r
+            }\r
+\r
+            test.done();\r
+        },\r
+\r
+        "mapEncodeDecode": function(test) {\r
+            var proto =\r
+                "message Test {\n" +\r
+                "  map<string, int32> map_string_int32 = 1;\n" +\r
+                "  map<string, int64> map_string_int64 = 2;\n" +\r
+                "  map<string, string> map_string_string = 3;\n" +\r
+                "  map<string, Test> map_string_msg = 4;\n" +\r
+                "  map<string, Enum> map_string_enum = 5;\n" +\r
+                "  map<int32, string> map_int32_string = 6;\n" +\r
+                "  map<int64, string> map_int64_string = 7;\n" +\r
+                "  map<bool, string> map_bool_string = 9;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapField.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            testMsg.map_string_int32.set("a", 1);\r
+            testMsg.map_string_int32.set("b", 2);\r
+            testMsg.map_string_int64.set("c", "12345678901234");\r
+            testMsg.map_string_int64.set("d", "98765432109876");\r
+            testMsg.map_string_string.set("e", "asdf");\r
+            testMsg.map_string_string.set("f", "jkl;");\r
+            testMsg.map_string_enum.set("g", Enum.A);\r
+            testMsg.map_string_enum.set("h", Enum.B);\r
+            testMsg.map_int32_string.set(9, "a");\r
+            testMsg.map_int32_string.set(10, "b");\r
+            testMsg.map_int64_string.set("12345678901234", "a");\r
+            testMsg.map_int64_string.set("98765432109876", "b");\r
+            testMsg.map_bool_string.set(false, "a");\r
+            testMsg.map_bool_string.set(true, "b");\r
+\r
+            var encoded = testMsg.encode();\r
+            testMsg = Test.decode(encoded);\r
+\r
+            test.strictEqual(testMsg.map_string_int32.get("a"), 1);\r
+            test.strictEqual(testMsg.map_string_int32.get("b"), 2);\r
+            test.strictEqual(testMsg.map_string_int64.get("c").toString(), "12345678901234");\r
+            test.strictEqual(testMsg.map_string_int64.get("d").toString(), "98765432109876");\r
+            test.strictEqual(testMsg.map_string_string.get("e"), "asdf");\r
+            test.strictEqual(testMsg.map_string_string.get("f"), "jkl;");\r
+            test.strictEqual(testMsg.map_string_enum.get("g"), Enum.A);\r
+            test.strictEqual(testMsg.map_string_enum.get("h"), Enum.B);\r
+            test.strictEqual(testMsg.map_int32_string.get(9), "a");\r
+            test.strictEqual(testMsg.map_int32_string.get(10), "b");\r
+            test.strictEqual(testMsg.map_int64_string.get("12345678901234"), "a");\r
+            test.strictEqual(testMsg.map_int64_string.get("98765432109876"), "b");\r
+            test.strictEqual(testMsg.map_bool_string.get(false), "a");\r
+            test.strictEqual(testMsg.map_bool_string.get(true), "b");\r
+\r
+            test.done();\r
+        },\r
+\r
+        "proto3Json": function(test) {\r
+            var proto =\r
+                "syntax = \"proto3\";\n" +\r
+                "message Test {\n" +\r
+                "  int32 optional_int32 = 1;\n" +\r
+                "  int64 optional_int64 = 2;\n" +\r
+                "  string optional_string = 3;\n" +\r
+                "  bytes optional_bytes = 4;\n" +\r
+                "  bool optional_bool = 5;\n" +\r
+                "  Enum optional_enum = 6;\n" +\r
+                "  repeated int32 repeated_int32 = 11;\n" +\r
+                "  repeated int64 repeated_int64 = 12;\n" +\r
+                "  repeated string repeated_string = 13;\n" +\r
+                "  repeated bytes repeated_bytes = 14;\n" +\r
+                "  repeated bool repeated_bool = 15;\n" +\r
+                "  repeated Enum repeated_enum = 16;\n" +\r
+                "  map<string, int32> map_string_int32 = 20;\n" +\r
+                "  map<string, int64> map_string_int64 = 21;\n" +\r
+                "  map<string, string> map_string_string = 22;\n" +\r
+                "  map<string, Enum> map_string_enum = 24;\n" +\r
+                "  map<int32, string> map_int32_string = 25;\n" +\r
+                "  map<int64, string> map_int64_string = 26;\n" +\r
+                "  map<bool, string> map_bool_string = 27;\n" +\r
+                "}\n" +\r
+                "enum Enum { Default = 0; A = 1; B = 2; }\n";\r
+            var builder = ProtoBuf.newBuilder();\r
+            ProtoBuf.loadProto(proto, builder, "test/mapField.proto");\r
+            var Test = builder.build('Test'),\r
+                Enum = builder.build('Enum');\r
+\r
+            var testMsg = new Test();\r
+            testMsg.optional_int32 = 1;\r
+            testMsg.optional_int64 = "12345678901234";\r
+            testMsg.optional_string = "hello";\r
+            testMsg.optional_bytes = ProtoBuf.ByteBuffer.fromBinary("\x00\xFF\x80");\r
+            testMsg.optional_bool = true;\r
+            testMsg.optional_enum = Enum.A;\r
+            testMsg.repeated_int32.push(1);\r
+            testMsg.repeated_int64.push("12345678901234");\r
+            testMsg.repeated_string.push("hello");\r
+            testMsg.repeated_bytes.push(ProtoBuf.ByteBuffer.fromBinary("\x00\xFF\x80"));\r
+            testMsg.repeated_bool.push(true);\r
+            testMsg.repeated_enum.push(Enum.A);\r
+            testMsg.map_string_int32.set("a", 1);\r
+            testMsg.map_string_int32.set("b", 2);\r
+            testMsg.map_string_int64.set("c", "12345678901234");\r
+            testMsg.map_string_int64.set("d", "98765432109876");\r
+            testMsg.map_string_string.set("e", "asdf");\r
+            testMsg.map_string_string.set("f", "jkl;");\r
+            testMsg.map_string_enum.set("g", Enum.A);\r
+            testMsg.map_string_enum.set("h", Enum.B);\r
+            testMsg.map_int32_string.set(9, "a");\r
+            testMsg.map_int32_string.set(10, "b");\r
+            testMsg.map_int64_string.set("12345678901234", "a");\r
+            testMsg.map_int64_string.set("98765432109876", "b");\r
+            testMsg.map_bool_string.set(false, "a");\r
+            testMsg.map_bool_string.set(true, "b");\r
+\r
+            var jsonObj = JSON.parse(testMsg.encodeJSON());\r
+            test.deepEqual(jsonObj,\r
+                {\r
+                    optional_int32: 1,\r
+                    optional_int64: "12345678901234",\r
+                    optional_string: "hello",\r
+                    optional_bytes: "AP+A",  // base64\r
+                    optional_bool: true,\r
+                    optional_enum: "A",\r
+                    repeated_int32: [1],\r
+                    repeated_int64: ["12345678901234"],\r
+                    repeated_string: ["hello"],\r
+                    repeated_bytes: ["AP+A"],  // base64\r
+                    repeated_bool: [true],\r
+                    repeated_enum: ["A"],\r
+                    map_string_int32: { "a": 1, "b": 2 },\r
+                    map_string_int64: { "c": "12345678901234", "d": "98765432109876" },\r
+                    map_string_string: { "e": "asdf", "f": "jkl;" },\r
+                    map_string_enum: { "g": "A", "h": "B" },\r
+                    map_int32_string: { "9": "a", "10": "b" },\r
+                    map_int64_string: { "12345678901234": "a", "98765432109876": "b" },\r
+                    map_bool_string: { "false": "a", "true": "b" },\r
+                });\r
+\r
+            var testMsg2 = Test.decodeJSON(testMsg.encodeJSON());\r
+            test.strictEqual(testMsg2.encodeJSON(), testMsg.encodeJSON());\r
+\r
+            test.done();\r
+        },\r
+\r
+        // Node.js only\r
+        "loaders": BROWSER ? {} : {\r
+\r
+            "commonjs": function(test) {\r
+                var fs = require("fs")\r
+                  , vm = require("vm")\r
+                  , util = require('util');\r
+\r
+                var code = fs.readFileSync(__dirname+"/../dist/"+FILE);\r
+                var exports = {};\r
+                var sandbox = new Sandbox({\r
+                    module: {\r
+                        exports: exports,\r
+                        id: "protobufjs"\r
+                    },\r
+                    exports: exports,\r
+                    require: (function() {\r
+                        function require(mod) {\r
+                            if (mod == 'bytebuffer') require.called = true;\r
+                            return ByteBuffer;\r
+                        }\r
+                        require.called = false;\r
+                        return require;\r
+                    })()\r
+                });\r
+                vm.runInNewContext(code, sandbox, "ProtoBuf.js in CommonJS-VM");\r
+                // console.log(util.inspect(sandbox));\r
+                test.ok(typeof sandbox.module.exports == 'object');\r
+                test.ok(typeof sandbox.require != 'undefined' && sandbox.require.called);\r
+                test.done();\r
+            },\r
+\r
+            "amd": function(test) {\r
+                var fs = require("fs")\r
+                  , vm = require("vm")\r
+                  , util = require('util');\r
+\r
+                var code = fs.readFileSync(__dirname+"/../dist/"+FILE);\r
+                var sandbox = new Sandbox({\r
+                    define: (function() {\r
+                        function define() {\r
+                            define.called = true;\r
+                        }\r
+                        define.amd = true;\r
+                        define.called = false;\r
+                        return define;\r
+                    })()\r
+                });\r
+                vm.runInNewContext(code, sandbox, "ProtoBuf.js in AMD-VM");\r
+                // console.log(util.inspect(sandbox));\r
+                test.ok(sandbox.define.called == true);\r
+                test.done();\r
+            },\r
+\r
+            "shim": function(test) {\r
+                var fs = require("fs")\r
+                  , vm = require("vm")\r
+                  , util = require('util');\r
+\r
+                var code = fs.readFileSync(__dirname+"/../dist/"+FILE);\r
+                var sandbox = new Sandbox({\r
+                    dcodeIO: {\r
+                        ByteBuffer: ByteBuffer\r
+                    }\r
+                });\r
+                vm.runInNewContext(code, sandbox, "ProtoBuf.js in shim-VM");\r
+                // console.log(util.inspect(sandbox));\r
+                test.ok(typeof sandbox.dcodeIO != 'undefined' && typeof sandbox.dcodeIO.ProtoBuf != 'undefined');\r
+                test.done();\r
+            }\r
+        }\r
+    };\r
+\r
+    if (typeof module != 'undefined' && module.exports) {\r
+        module.exports = suite;\r
+    } else {\r
+        global["suite"] = suite;\r
+    }\r
+\r
+})(this);\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/toplevel.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/toplevel.proto
new file mode 100644 (file)
index 0000000..eec948e
--- /dev/null
@@ -0,0 +1,10 @@
+package My;\r
+\r
+enum MyEnum {\r
+    ONE = 1;\r
+    TWO = 2;\r
+}\r
+\r
+message Test {\r
+    required MyEnum num = 1 [default=ONE];\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/protobufjs/tests/x64.proto b/legacy-libs/grpc/node_modules/protobufjs/tests/x64.proto
new file mode 100644 (file)
index 0000000..18ea2d3
--- /dev/null
@@ -0,0 +1,10 @@
+message Test {\r
+    required sfixed64 val = 1 [default=-1];\r
+    required fixed64 uval = 2 [default=1];\r
+}\r
+\r
+message Test2 {\r
+    required int64 val = 1 [default=-1];\r
+    required uint64 uval = 2 [default=1];\r
+    required sint64 sval = 3 [default=-2];\r
+}\r
diff --git a/legacy-libs/grpc/node_modules/rc/LICENSE.APACHE2 b/legacy-libs/grpc/node_modules/rc/LICENSE.APACHE2
new file mode 100644 (file)
index 0000000..6366c04
--- /dev/null
@@ -0,0 +1,15 @@
+Apache License, Version 2.0
+
+Copyright (c) 2011 Dominic Tarr
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/legacy-libs/grpc/node_modules/rc/LICENSE.BSD b/legacy-libs/grpc/node_modules/rc/LICENSE.BSD
new file mode 100644 (file)
index 0000000..96bb796
--- /dev/null
@@ -0,0 +1,26 @@
+Copyright (c) 2013, Dominic Tarr
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met: 
+
+1. Redistributions of source code must retain the above copyright notice, this
+   list of conditions and the following disclaimer. 
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those
+of the authors and should not be interpreted as representing official policies, 
+either expressed or implied, of the FreeBSD Project.
diff --git a/legacy-libs/grpc/node_modules/rc/LICENSE.MIT b/legacy-libs/grpc/node_modules/rc/LICENSE.MIT
new file mode 100644 (file)
index 0000000..6eafbd7
--- /dev/null
@@ -0,0 +1,24 @@
+The MIT License
+
+Copyright (c) 2011 Dominic Tarr
+
+Permission is hereby granted, free of charge, 
+to any person obtaining a copy of this software and 
+associated documentation files (the "Software"), to 
+deal in the Software without restriction, including 
+without limitation the rights to use, copy, modify, 
+merge, publish, distribute, sublicense, and/or sell 
+copies of the Software, and to permit persons to whom 
+the Software is furnished to do so, 
+subject to the following conditions:
+
+The above copyright notice and this permission notice 
+shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/rc/README.md b/legacy-libs/grpc/node_modules/rc/README.md
new file mode 100644 (file)
index 0000000..e6522e2
--- /dev/null
@@ -0,0 +1,227 @@
+# rc
+
+The non-configurable configuration loader for lazy people.
+
+## Usage
+
+The only option is to pass rc the name of your app, and your default configuration.
+
+```javascript
+var conf = require('rc')(appname, {
+  //defaults go here.
+  port: 2468,
+
+  //defaults which are objects will be merged, not replaced
+  views: {
+    engine: 'jade'
+  }
+});
+```
+
+`rc` will return your configuration options merged with the defaults you specify.
+If you pass in a predefined defaults object, it will be mutated:
+
+```javascript
+var conf = {};
+require('rc')(appname, conf);
+```
+
+If `rc` finds any config files for your app, the returned config object will have
+a `configs` array containing their paths:
+
+```javascript
+var appCfg = require('rc')(appname, conf);
+appCfg.configs[0] // /etc/appnamerc
+appCfg.configs[1] // /home/dominictarr/.config/appname
+appCfg.config // same as appCfg.configs[appCfg.configs.length - 1]
+```
+
+## Standards
+
+Given your application name (`appname`), rc will look in all the obvious places for configuration.
+
+  * command line arguments, parsed by minimist _(e.g. `--foo baz`, also nested: `--foo.bar=baz`)_
+  * environment variables prefixed with `${appname}_`
+    * or use "\_\_" to indicate nested properties <br/> _(e.g. `appname_foo__bar__baz` => `foo.bar.baz`)_
+  * if you passed an option `--config file` then from that file
+  * a local `.${appname}rc` or the first found looking in `./ ../ ../../ ../../../` etc.
+  * `$HOME/.${appname}rc`
+  * `$HOME/.${appname}/config`
+  * `$HOME/.config/${appname}`
+  * `$HOME/.config/${appname}/config`
+  * `/etc/${appname}rc`
+  * `/etc/${appname}/config`
+  * the defaults object you passed in.
+
+All configuration sources that were found will be flattened into one object,
+so that sources **earlier** in this list override later ones.
+
+
+## Configuration File Formats
+
+Configuration files (e.g. `.appnamerc`) may be in either [json](http://json.org/example) or [ini](http://en.wikipedia.org/wiki/INI_file) format. **No** file extension (`.json` or `.ini`) should be used. The example configurations below are equivalent:
+
+
+#### Formatted as `ini`
+
+```
+; You can include comments in `ini` format if you want.
+
+dependsOn=0.10.0
+
+
+; `rc` has built-in support for ini sections, see?
+
+[commands]
+  www     = ./commands/www
+  console = ./commands/repl
+
+
+; You can even do nested sections
+
+[generators.options]
+  engine  = ejs
+
+[generators.modules]
+  new     = generate-new
+  engine  = generate-backend
+
+```
+
+#### Formatted as `json`
+
+```javascript
+{
+  // You can even comment your JSON, if you want
+  "dependsOn": "0.10.0",
+  "commands": {
+    "www": "./commands/www",
+    "console": "./commands/repl"
+  },
+  "generators": {
+    "options": {
+      "engine": "ejs"
+    },
+    "modules": {
+      "new": "generate-new",
+      "backend": "generate-backend"
+    }
+  }
+}
+```
+
+Comments are stripped from JSON config via [strip-json-comments](https://github.com/sindresorhus/strip-json-comments).
+
+> Since ini, and env variables do not have a standard for types, your application needs be prepared for strings.
+
+To ensure that string representations of booleans and numbers are always converted into their proper types (especially useful if you intend to do strict `===` comparisons), consider using a module such as [parse-strings-in-object](https://github.com/anselanza/parse-strings-in-object) to wrap the config object returned from rc.
+
+
+## Simple example demonstrating precedence
+Assume you have an application like this (notice the hard-coded defaults passed to rc):
+```
+const conf = require('rc')('myapp', {
+    port: 12345,
+    mode: 'test'
+});
+
+console.log(JSON.stringify(conf, null, 2));
+```
+You also have a file `config.json`, with these contents:
+```
+{
+  "port": 9000,
+  "foo": "from config json",
+  "something": "else"
+}
+```
+And a file `.myapprc` in the same folder, with these contents:
+```
+{
+  "port": "3001",
+  "foo": "bar"
+}
+```
+Here is the expected output from various commands:
+
+`node .`
+```
+{
+  "port": "3001",
+  "mode": "test",
+  "foo": "bar",
+  "_": [],
+  "configs": [
+    "/Users/stephen/repos/conftest/.myapprc"
+  ],
+  "config": "/Users/stephen/repos/conftest/.myapprc"
+}
+```
+*Default `mode` from hard-coded object is retained, but port is overridden by `.myapprc` file (automatically found based on appname match), and `foo` is added.*
+
+
+`node . --foo baz`
+```
+{
+  "port": "3001",
+  "mode": "test",
+  "foo": "baz",
+  "_": [],
+  "configs": [
+    "/Users/stephen/repos/conftest/.myapprc"
+  ],
+  "config": "/Users/stephen/repos/conftest/.myapprc"
+}
+```
+*Same result as above but `foo` is overridden because command-line arguments take precedence over `.myapprc` file.*
+
+`node . --foo barbar --config config.json`
+```
+{
+  "port": 9000,
+  "mode": "test",
+  "foo": "barbar",
+  "something": "else",
+  "_": [],
+  "config": "config.json",
+  "configs": [
+    "/Users/stephen/repos/conftest/.myapprc",
+    "config.json"
+  ]
+}
+```
+*Now the `port` comes from the `config.json` file specified (overriding the value from `.myapprc`), and `foo` value is overriden by command-line despite also being specified in the `config.json` file.*
+
+
+## Advanced Usage
+
+#### Pass in your own `argv`
+
+You may pass in your own `argv` as the third argument to `rc`.  This is in case you want to [use your own command-line opts parser](https://github.com/dominictarr/rc/pull/12).
+
+```javascript
+require('rc')(appname, defaults, customArgvParser);
+```
+
+## Pass in your own parser
+
+If you have a special need to use a non-standard parser,
+you can do so by passing in the parser as the 4th argument.
+(leave the 3rd as null to get the default args parser)
+
+```javascript
+require('rc')(appname, defaults, null, parser);
+```
+
+This may also be used to force a more strict format,
+such as strict, valid JSON only.
+
+## Note on Performance
+
+`rc` is running `fs.statSync`-- so make sure you don't use it in a hot code path (e.g. a request handler) 
+
+
+## License
+
+Multi-licensed under the two-clause BSD License, MIT License, or Apache License, version 2.0
diff --git a/legacy-libs/grpc/node_modules/rc/browser.js b/legacy-libs/grpc/node_modules/rc/browser.js
new file mode 100644 (file)
index 0000000..8c230c5
--- /dev/null
@@ -0,0 +1,7 @@
+
+// when this is loaded into the browser, 
+// just use the defaults...
+
+module.exports = function (name, defaults) {
+  return defaults
+}
diff --git a/legacy-libs/grpc/node_modules/rc/cli.js b/legacy-libs/grpc/node_modules/rc/cli.js
new file mode 100644 (file)
index 0000000..ab05b60
--- /dev/null
@@ -0,0 +1,4 @@
+#! /usr/bin/env node
+var rc = require('./index')
+
+console.log(JSON.stringify(rc(process.argv[2]), false, 2))
diff --git a/legacy-libs/grpc/node_modules/rc/index.js b/legacy-libs/grpc/node_modules/rc/index.js
new file mode 100644 (file)
index 0000000..65eb47a
--- /dev/null
@@ -0,0 +1,53 @@
+var cc   = require('./lib/utils')
+var join = require('path').join
+var deepExtend = require('deep-extend')
+var etc = '/etc'
+var win = process.platform === "win32"
+var home = win
+           ? process.env.USERPROFILE
+           : process.env.HOME
+
+module.exports = function (name, defaults, argv, parse) {
+  if('string' !== typeof name)
+    throw new Error('rc(name): name *must* be string')
+  if(!argv)
+    argv = require('minimist')(process.argv.slice(2))
+  defaults = (
+      'string' === typeof defaults
+    ? cc.json(defaults) : defaults
+    ) || {}
+
+  parse = parse || cc.parse
+
+  var env = cc.env(name + '_')
+
+  var configs = [defaults]
+  var configFiles = []
+  function addConfigFile (file) {
+    if (configFiles.indexOf(file) >= 0) return
+    var fileConfig = cc.file(file)
+    if (fileConfig) {
+      configs.push(parse(fileConfig))
+      configFiles.push(file)
+    }
+  }
+
+  // which files do we look at?
+  if (!win)
+   [join(etc, name, 'config'),
+    join(etc, name + 'rc')].forEach(addConfigFile)
+  if (home)
+   [join(home, '.config', name, 'config'),
+    join(home, '.config', name),
+    join(home, '.' + name, 'config'),
+    join(home, '.' + name + 'rc')].forEach(addConfigFile)
+  addConfigFile(cc.find('.'+name+'rc'))
+  if (env.config) addConfigFile(env.config)
+  if (argv.config) addConfigFile(argv.config)
+
+  return deepExtend.apply(null, configs.concat([
+    env,
+    argv,
+    configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
+  ]))
+}
diff --git a/legacy-libs/grpc/node_modules/rc/lib/utils.js b/legacy-libs/grpc/node_modules/rc/lib/utils.js
new file mode 100644 (file)
index 0000000..8b3beff
--- /dev/null
@@ -0,0 +1,104 @@
+'use strict';
+var fs   = require('fs')
+var ini  = require('ini')
+var path = require('path')
+var stripJsonComments = require('strip-json-comments')
+
+var parse = exports.parse = function (content) {
+
+  //if it ends in .json or starts with { then it must be json.
+  //must be done this way, because ini accepts everything.
+  //can't just try and parse it and let it throw if it's not ini.
+  //everything is ini. even json with a syntax error.
+
+  if(/^\s*{/.test(content))
+    return JSON.parse(stripJsonComments(content))
+  return ini.parse(content)
+
+}
+
+var file = exports.file = function () {
+  var args = [].slice.call(arguments).filter(function (arg) { return arg != null })
+
+  //path.join breaks if it's a not a string, so just skip this.
+  for(var i in args)
+    if('string' !== typeof args[i])
+      return
+
+  var file = path.join.apply(null, args)
+  var content
+  try {
+    return fs.readFileSync(file,'utf-8')
+  } catch (err) {
+    return
+  }
+}
+
+var json = exports.json = function () {
+  var content = file.apply(null, arguments)
+  return content ? parse(content) : null
+}
+
+var env = exports.env = function (prefix, env) {
+  env = env || process.env
+  var obj = {}
+  var l = prefix.length
+  for(var k in env) {
+    if(k.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
+
+      var keypath = k.substring(l).split('__')
+
+      // Trim empty strings from keypath array
+      var _emptyStringIndex
+      while ((_emptyStringIndex=keypath.indexOf('')) > -1) {
+        keypath.splice(_emptyStringIndex, 1)
+      }
+
+      var cursor = obj
+      keypath.forEach(function _buildSubObj(_subkey,i){
+
+        // (check for _subkey first so we ignore empty strings)
+        // (check for cursor to avoid assignment to primitive objects)
+        if (!_subkey || typeof cursor !== 'object')
+          return
+
+        // If this is the last key, just stuff the value in there
+        // Assigns actual value from env variable to final key
+        // (unless it's just an empty string- in that case use the last valid key)
+        if (i === keypath.length-1)
+          cursor[_subkey] = env[k]
+
+
+        // Build sub-object if nothing already exists at the keypath
+        if (cursor[_subkey] === undefined)
+          cursor[_subkey] = {}
+
+        // Increment cursor used to track the object at the current depth
+        cursor = cursor[_subkey]
+
+      })
+
+    }
+
+  }
+
+  return obj
+}
+
+var find = exports.find = function () {
+  var rel = path.join.apply(null, [].slice.call(arguments))
+
+  function find(start, rel) {
+    var file = path.join(start, rel)
+    try {
+      fs.statSync(file)
+      return file
+    } catch (err) {
+      if(path.dirname(start) !== start) // root
+        return find(path.dirname(start), rel)
+    }
+  }
+  return find(process.cwd(), rel)
+}
+
+
diff --git a/legacy-libs/grpc/node_modules/rc/package.json b/legacy-libs/grpc/node_modules/rc/package.json
new file mode 100644 (file)
index 0000000..12ee566
--- /dev/null
@@ -0,0 +1,72 @@
+{
+  "_args": [
+    [
+      "rc@1.2.8",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "rc@1.2.8",
+  "_id": "rc@1.2.8",
+  "_inBundle": false,
+  "_integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
+  "_location": "/grpc/rc",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "rc@1.2.8",
+    "name": "rc",
+    "escapedName": "rc",
+    "rawSpec": "1.2.8",
+    "saveSpec": null,
+    "fetchSpec": "1.2.8"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.2.8",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Dominic Tarr",
+    "email": "dominic.tarr@gmail.com",
+    "url": "dominictarr.com"
+  },
+  "bin": {
+    "rc": "./cli.js"
+  },
+  "browser": "browser.js",
+  "bugs": {
+    "url": "https://github.com/dominictarr/rc/issues"
+  },
+  "dependencies": {
+    "deep-extend": "^0.6.0",
+    "ini": "~1.3.0",
+    "minimist": "^1.2.0",
+    "strip-json-comments": "~2.0.1"
+  },
+  "description": "hardwired configuration loader",
+  "devDependencies": {},
+  "homepage": "https://github.com/dominictarr/rc#readme",
+  "keywords": [
+    "config",
+    "rc",
+    "unix",
+    "defaults"
+  ],
+  "license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
+  "main": "index.js",
+  "name": "rc",
+  "optionalDependencies": {},
+  "readme": "# rc\n\nThe non-configurable configuration loader for lazy people.\n\n## Usage\n\nThe only option is to pass rc the name of your app, and your default configuration.\n\n```javascript\nvar conf = require('rc')(appname, {\n  //defaults go here.\n  port: 2468,\n\n  //defaults which are objects will be merged, not replaced\n  views: {\n    engine: 'jade'\n  }\n});\n```\n\n`rc` will return your configuration options merged with the defaults you specify.\nIf you pass in a predefined defaults object, it will be mutated:\n\n```javascript\nvar conf = {};\nrequire('rc')(appname, conf);\n```\n\nIf `rc` finds any config files for your app, the returned config object will have\na `configs` array containing their paths:\n\n```javascript\nvar appCfg = require('rc')(appname, conf);\nappCfg.configs[0] // /etc/appnamerc\nappCfg.configs[1] // /home/dominictarr/.config/appname\nappCfg.config // same as appCfg.configs[appCfg.configs.length - 1]\n```\n\n## Standards\n\nGiven your application name (`appname`), rc will look in all the obvious places for configuration.\n\n  * command line arguments, parsed by minimist _(e.g. `--foo baz`, also nested: `--foo.bar=baz`)_\n  * environment variables prefixed with `${appname}_`\n    * or use \"\\_\\_\" to indicate nested properties <br/> _(e.g. `appname_foo__bar__baz` => `foo.bar.baz`)_\n  * if you passed an option `--config file` then from that file\n  * a local `.${appname}rc` or the first found looking in `./ ../ ../../ ../../../` etc.\n  * `$HOME/.${appname}rc`\n  * `$HOME/.${appname}/config`\n  * `$HOME/.config/${appname}`\n  * `$HOME/.config/${appname}/config`\n  * `/etc/${appname}rc`\n  * `/etc/${appname}/config`\n  * the defaults object you passed in.\n\nAll configuration sources that were found will be flattened into one object,\nso that sources **earlier** in this list override later ones.\n\n\n## Configuration File Formats\n\nConfiguration files (e.g. `.appnamerc`) may be in either [json](http://json.org/example) or [ini](http://en.wikipedia.org/wiki/INI_file) format. **No** file extension (`.json` or `.ini`) should be used. The example configurations below are equivalent:\n\n\n#### Formatted as `ini`\n\n```\n; You can include comments in `ini` format if you want.\n\ndependsOn=0.10.0\n\n\n; `rc` has built-in support for ini sections, see?\n\n[commands]\n  www     = ./commands/www\n  console = ./commands/repl\n\n\n; You can even do nested sections\n\n[generators.options]\n  engine  = ejs\n\n[generators.modules]\n  new     = generate-new\n  engine  = generate-backend\n\n```\n\n#### Formatted as `json`\n\n```javascript\n{\n  // You can even comment your JSON, if you want\n  \"dependsOn\": \"0.10.0\",\n  \"commands\": {\n    \"www\": \"./commands/www\",\n    \"console\": \"./commands/repl\"\n  },\n  \"generators\": {\n    \"options\": {\n      \"engine\": \"ejs\"\n    },\n    \"modules\": {\n      \"new\": \"generate-new\",\n      \"backend\": \"generate-backend\"\n    }\n  }\n}\n```\n\nComments are stripped from JSON config via [strip-json-comments](https://github.com/sindresorhus/strip-json-comments).\n\n> Since ini, and env variables do not have a standard for types, your application needs be prepared for strings.\n\nTo ensure that string representations of booleans and numbers are always converted into their proper types (especially useful if you intend to do strict `===` comparisons), consider using a module such as [parse-strings-in-object](https://github.com/anselanza/parse-strings-in-object) to wrap the config object returned from rc.\n\n\n## Simple example demonstrating precedence\nAssume you have an application like this (notice the hard-coded defaults passed to rc):\n```\nconst conf = require('rc')('myapp', {\n    port: 12345,\n    mode: 'test'\n});\n\nconsole.log(JSON.stringify(conf, null, 2));\n```\nYou also have a file `config.json`, with these contents:\n```\n{\n  \"port\": 9000,\n  \"foo\": \"from config json\",\n  \"something\": \"else\"\n}\n```\nAnd a file `.myapprc` in the same folder, with these contents:\n```\n{\n  \"port\": \"3001\",\n  \"foo\": \"bar\"\n}\n```\nHere is the expected output from various commands:\n\n`node .`\n```\n{\n  \"port\": \"3001\",\n  \"mode\": \"test\",\n  \"foo\": \"bar\",\n  \"_\": [],\n  \"configs\": [\n    \"/Users/stephen/repos/conftest/.myapprc\"\n  ],\n  \"config\": \"/Users/stephen/repos/conftest/.myapprc\"\n}\n```\n*Default `mode` from hard-coded object is retained, but port is overridden by `.myapprc` file (automatically found based on appname match), and `foo` is added.*\n\n\n`node . --foo baz`\n```\n{\n  \"port\": \"3001\",\n  \"mode\": \"test\",\n  \"foo\": \"baz\",\n  \"_\": [],\n  \"configs\": [\n    \"/Users/stephen/repos/conftest/.myapprc\"\n  ],\n  \"config\": \"/Users/stephen/repos/conftest/.myapprc\"\n}\n```\n*Same result as above but `foo` is overridden because command-line arguments take precedence over `.myapprc` file.*\n\n`node . --foo barbar --config config.json`\n```\n{\n  \"port\": 9000,\n  \"mode\": \"test\",\n  \"foo\": \"barbar\",\n  \"something\": \"else\",\n  \"_\": [],\n  \"config\": \"config.json\",\n  \"configs\": [\n    \"/Users/stephen/repos/conftest/.myapprc\",\n    \"config.json\"\n  ]\n}\n```\n*Now the `port` comes from the `config.json` file specified (overriding the value from `.myapprc`), and `foo` value is overriden by command-line despite also being specified in the `config.json` file.*\n \n\n\n## Advanced Usage\n\n#### Pass in your own `argv`\n\nYou may pass in your own `argv` as the third argument to `rc`.  This is in case you want to [use your own command-line opts parser](https://github.com/dominictarr/rc/pull/12).\n\n```javascript\nrequire('rc')(appname, defaults, customArgvParser);\n```\n\n## Pass in your own parser\n\nIf you have a special need to use a non-standard parser,\nyou can do so by passing in the parser as the 4th argument.\n(leave the 3rd as null to get the default args parser)\n\n```javascript\nrequire('rc')(appname, defaults, null, parser);\n```\n\nThis may also be used to force a more strict format,\nsuch as strict, valid JSON only.\n\n## Note on Performance\n\n`rc` is running `fs.statSync`-- so make sure you don't use it in a hot code path (e.g. a request handler) \n\n\n## License\n\nMulti-licensed under the two-clause BSD License, MIT License, or Apache License, version 2.0\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/dominictarr/rc.git"
+  },
+  "scripts": {
+    "test": "set -e; node test/test.js; node test/ini.js; node test/nested-env-vars.js"
+  },
+  "version": "1.2.8"
+}
diff --git a/legacy-libs/grpc/node_modules/rc/test/ini.js b/legacy-libs/grpc/node_modules/rc/test/ini.js
new file mode 100644 (file)
index 0000000..e6857f8
--- /dev/null
@@ -0,0 +1,16 @@
+var cc =require('../lib/utils')
+var INI = require('ini')
+var assert = require('assert')
+
+function test(obj) {
+
+  var _json, _ini
+  var json = cc.parse (_json = JSON.stringify(obj))
+  var ini = cc.parse (_ini = INI.stringify(obj))
+  console.log(_ini, _json)
+  assert.deepEqual(json, ini)
+}
+
+
+test({hello: true})
+
diff --git a/legacy-libs/grpc/node_modules/rc/test/nested-env-vars.js b/legacy-libs/grpc/node_modules/rc/test/nested-env-vars.js
new file mode 100644 (file)
index 0000000..0ecd176
--- /dev/null
@@ -0,0 +1,50 @@
+
+var seed = Math.random();
+var n = 'rc'+ seed;
+var N = 'RC'+ seed;
+var assert = require('assert')
+
+
+// Basic usage
+process.env[n+'_someOpt__a'] = 42
+process.env[n+'_someOpt__x__'] = 99
+process.env[n+'_someOpt__a__b'] = 186
+process.env[n+'_someOpt__a__b__c'] = 243
+process.env[n+'_someOpt__x__y'] = 1862
+process.env[n+'_someOpt__z'] = 186577
+
+// Should ignore empty strings from orphaned '__'
+process.env[n+'_someOpt__z__x__'] = 18629
+process.env[n+'_someOpt__w__w__'] = 18629
+
+// Leading '__' should ignore everything up to 'z'
+process.env[n+'___z__i__'] = 9999
+
+// should ignore case for config name section.
+process.env[N+'_test_upperCase'] = 187
+
+function testPrefix(prefix) {
+       var config = require('../')(prefix, {
+         option: true
+       })
+
+       console.log('\n\n------ nested-env-vars ------\n',{prefix: prefix}, '\n', config);
+
+       assert.equal(config.option, true)
+       assert.equal(config.someOpt.a, 42)
+       assert.equal(config.someOpt.x, 99)
+       // Should not override `a` once it's been set
+       assert.equal(config.someOpt.a/*.b*/, 42)
+       // Should not override `x` once it's been set
+       assert.equal(config.someOpt.x/*.y*/, 99)
+       assert.equal(config.someOpt.z, 186577)
+       // Should not override `z` once it's been set
+       assert.equal(config.someOpt.z/*.x*/, 186577)
+       assert.equal(config.someOpt.w.w, 18629)
+       assert.equal(config.z.i, 9999)
+
+       assert.equal(config.test_upperCase, 187)
+}
+
+testPrefix(n);
+testPrefix(N);
diff --git a/legacy-libs/grpc/node_modules/rc/test/test.js b/legacy-libs/grpc/node_modules/rc/test/test.js
new file mode 100644 (file)
index 0000000..4f63351
--- /dev/null
@@ -0,0 +1,59 @@
+
+var n = 'rc'+Math.random()
+var assert = require('assert')
+
+process.env[n+'_envOption'] = 42
+
+var config = require('../')(n, {
+  option: true
+})
+
+console.log(config)
+
+assert.equal(config.option, true)
+assert.equal(config.envOption, 42)
+
+var customArgv = require('../')(n, {
+  option: true
+}, { // nopt-like argv
+  option: false,
+  envOption: 24,
+  argv: {
+    remain: [],
+    cooked: ['--no-option', '--envOption', '24'],
+    original: ['--no-option', '--envOption=24']
+  }
+})
+
+console.log(customArgv)
+
+assert.equal(customArgv.option, false)
+assert.equal(customArgv.envOption, 24)
+
+var fs = require('fs')
+var path = require('path')
+var jsonrc = path.resolve('.' + n + 'rc');
+
+fs.writeFileSync(jsonrc, [
+  '{',
+    '// json overrides default',
+    '"option": false,',
+    '/* env overrides json */',
+    '"envOption": 24',
+  '}'
+].join('\n'));
+
+var commentedJSON = require('../')(n, {
+  option: true
+})
+
+fs.unlinkSync(jsonrc);
+
+console.log(commentedJSON)
+
+assert.equal(commentedJSON.option, false)
+assert.equal(commentedJSON.envOption, 42)
+
+assert.equal(commentedJSON.config, jsonrc)
+assert.equal(commentedJSON.configs.length, 1)
+assert.equal(commentedJSON.configs[0], jsonrc)
diff --git a/legacy-libs/grpc/node_modules/readable-stream/CONTRIBUTING.md b/legacy-libs/grpc/node_modules/readable-stream/CONTRIBUTING.md
new file mode 100644 (file)
index 0000000..f478d58
--- /dev/null
@@ -0,0 +1,38 @@
+# Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+  have the right to submit it under the open source license
+  indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+  of my knowledge, is covered under an appropriate open source
+  license and I have the right under that license to submit that
+  work with modifications, whether created in whole or in part
+  by me, under the same open source license (unless I am
+  permitted to submit under a different license), as indicated
+  in the file; or
+
+* (c) The contribution was provided directly to me by some other
+  person who certified (a), (b) or (c) and I have not modified
+  it.
+
+* (d) I understand and agree that this project and the contribution
+  are public and that a record of the contribution (including all
+  personal information I submit with it, including my sign-off) is
+  maintained indefinitely and may be redistributed consistent with
+  this project or the open source license(s) involved.
+
+## Moderation Policy
+
+The [Node.js Moderation Policy] applies to this WG.
+
+## Code of Conduct
+
+The [Node.js Code of Conduct][] applies to this WG.
+
+[Node.js Code of Conduct]:
+https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
+[Node.js Moderation Policy]:
+https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/legacy-libs/grpc/node_modules/readable-stream/GOVERNANCE.md b/legacy-libs/grpc/node_modules/readable-stream/GOVERNANCE.md
new file mode 100644 (file)
index 0000000..16ffb93
--- /dev/null
@@ -0,0 +1,136 @@
+### Streams Working Group
+
+The Node.js Streams is jointly governed by a Working Group
+(WG)
+that is responsible for high-level guidance of the project.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Conduct guidelines
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project
+[README.md](./README.md#current-project-team-members).
+
+### Collaborators
+
+The readable-stream GitHub repository is
+maintained by the WG and additional Collaborators who are added by the
+WG on an ongoing basis.
+
+Individuals making significant and valuable contributions are made
+Collaborators and given commit-access to the project. These
+individuals are identified by the WG and their addition as
+Collaborators is discussed during the WG meeting.
+
+_Note:_ If you make a significant contribution and are not considered
+for commit-access log an issue or contact a WG member directly and it
+will be brought up in the next WG meeting.
+
+Modifications of the contents of the readable-stream repository are
+made on
+a collaborative basis. Anybody with a GitHub account may propose a
+modification via pull request and it will be considered by the project
+Collaborators. All pull requests must be reviewed and accepted by a
+Collaborator with sufficient expertise who is able to take full
+responsibility for the change. In the case of pull requests proposed
+by an existing Collaborator, an additional Collaborator is required
+for sign-off. Consensus should be sought if additional Collaborators
+participate and there is disagreement around a particular
+modification. See _Consensus Seeking Process_ below for further detail
+on the consensus model used for governance.
+
+Collaborators may opt to elevate significant or controversial
+modifications, or modifications that have not found consensus to the
+WG for discussion by assigning the ***WG-agenda*** tag to a pull
+request or issue. The WG should serve as the final arbiter where
+required.
+
+For the current list of Collaborators, see the project
+[README.md](./README.md#members).
+
+### WG Membership
+
+WG seats are not time-limited.  There is no fixed size of the WG.
+However, the expected target is between 6 and 12, to ensure adequate
+coverage of important areas of expertise, balanced with the ability to
+make decisions efficiently.
+
+There is no specific set of requirements or qualifications for WG
+membership beyond these rules.
+
+The WG may add additional members to the WG by unanimous consensus.
+
+A WG member may be removed from the WG by voluntary resignation, or by
+unanimous consensus of all other WG members.
+
+Changes to WG membership should be posted in the agenda, and may be
+suggested as any other agenda item (see "WG Meetings" below).
+
+If an addition or removal is proposed during a meeting, and the full
+WG is not in attendance to participate, then the addition or removal
+is added to the agenda for the subsequent meeting.  This is to ensure
+that all members are given the opportunity to participate in all
+membership decisions.  If a WG member is unable to attend a meeting
+where a planned membership decision is being made, then their consent
+is assumed.
+
+No more than 1/3 of the WG members may be affiliated with the same
+employer.  If removal or resignation of a WG member, or a change of
+employment by a WG member, creates a situation where more than 1/3 of
+the WG membership shares an employer, then the situation must be
+immediately remedied by the resignation or removal of one or more WG
+members affiliated with the over-represented employer(s).
+
+### WG Meetings
+
+The WG meets occasionally on a Google Hangout On Air. A designated moderator
+approved by the WG runs the meeting. Each meeting should be
+published to YouTube.
+
+Items are added to the WG agenda that are considered contentious or
+are modifications of governance, contribution policy, WG membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches;
+that should happen continuously on GitHub and be handled by the larger
+group of Collaborators.
+
+Any community member or contributor can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
+WG member or the moderator can add the item to the agenda by adding
+the ***WG-agenda*** tag to the issue.
+
+Prior to each WG meeting the moderator will share the Agenda with
+members of the WG. WG members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the WG
+cannot veto or remove items.
+
+The WG may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sends it as a pull request after the meeting.
+
+### Consensus Seeking Process
+
+The WG follows a
+[Consensus
+Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision-making model.
+
+When an agenda item has appeared to reach a consensus the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus a WG member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be seconded by a majority of the WG
+or else the discussion will continue. Simple majority wins.
+
+Note that changes to WG membership require a majority consensus.  See
+"WG Membership" above.
diff --git a/legacy-libs/grpc/node_modules/readable-stream/LICENSE b/legacy-libs/grpc/node_modules/readable-stream/LICENSE
new file mode 100644 (file)
index 0000000..2873b3b
--- /dev/null
@@ -0,0 +1,47 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
diff --git a/legacy-libs/grpc/node_modules/readable-stream/README.md b/legacy-libs/grpc/node_modules/readable-stream/README.md
new file mode 100644 (file)
index 0000000..23fe3f3
--- /dev/null
@@ -0,0 +1,58 @@
+# readable-stream
+
+***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
+
+
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams Working Group
+
+`readable-stream` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+  project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+  notice of changes.
+
+<a name="members"></a>
+## Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;
+  - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;
+  - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;
+  - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;
+* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) &lt;matteo.collina@gmail.com&gt;
+  - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
+* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) &lt;shestak.irina@gmail.com&gt;
diff --git a/legacy-libs/grpc/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/legacy-libs/grpc/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644 (file)
index 0000000..83275f1
--- /dev/null
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+  but, we lose the opportunity to change the model
+  may not be backwards incompatible (double check keys)
+
+  **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+  * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/legacy-libs/grpc/node_modules/readable-stream/duplex-browser.js b/legacy-libs/grpc/node_modules/readable-stream/duplex-browser.js
new file mode 100644 (file)
index 0000000..f8b2db8
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_duplex.js');
diff --git a/legacy-libs/grpc/node_modules/readable-stream/duplex.js b/legacy-libs/grpc/node_modules/readable-stream/duplex.js
new file mode 100644 (file)
index 0000000..46924cb
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./readable').Duplex
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_duplex.js b/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644 (file)
index 0000000..a1ca813
--- /dev/null
@@ -0,0 +1,131 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+  var keys = [];
+  for (var key in obj) {
+    keys.push(key);
+  }return keys;
+};
+/*</replacement>*/
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+{
+  // avoid scope creep, the keys array can then be collected
+  var keys = objectKeys(Writable.prototype);
+  for (var v = 0; v < keys.length; v++) {
+    var method = keys[v];
+    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+  }
+}
+
+function Duplex(options) {
+  if (!(this instanceof Duplex)) return new Duplex(options);
+
+  Readable.call(this, options);
+  Writable.call(this, options);
+
+  if (options && options.readable === false) this.readable = false;
+
+  if (options && options.writable === false) this.writable = false;
+
+  this.allowHalfOpen = true;
+  if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+
+  this.once('end', onend);
+}
+
+Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
+  // making it explicit this property is not enumerable
+  // because otherwise some prototype manipulation in
+  // userland will fail
+  enumerable: false,
+  get: function () {
+    return this._writableState.highWaterMark;
+  }
+});
+
+// the no-half-open enforcer
+function onend() {
+  // if we allow half-open state, or if the writable side ended,
+  // then we're ok.
+  if (this.allowHalfOpen || this._writableState.ended) return;
+
+  // no more data can be written.
+  // But allow more writes to happen in this tick.
+  pna.nextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+  self.end();
+}
+
+Object.defineProperty(Duplex.prototype, 'destroyed', {
+  get: function () {
+    if (this._readableState === undefined || this._writableState === undefined) {
+      return false;
+    }
+    return this._readableState.destroyed && this._writableState.destroyed;
+  },
+  set: function (value) {
+    // we ignore the value if the stream
+    // has not been initialized yet
+    if (this._readableState === undefined || this._writableState === undefined) {
+      return;
+    }
+
+    // backward compatibility, the user is explicitly
+    // managing destroyed
+    this._readableState.destroyed = value;
+    this._writableState.destroyed = value;
+  }
+});
+
+Duplex.prototype._destroy = function (err, cb) {
+  this.push(null);
+  this.end();
+
+  pna.nextTick(cb, err);
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_passthrough.js b/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644 (file)
index 0000000..a9c8358
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+  if (!(this instanceof PassThrough)) return new PassThrough(options);
+
+  Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+  cb(null, chunk);
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_readable.js b/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644 (file)
index 0000000..bf34ac6
--- /dev/null
@@ -0,0 +1,1019 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+module.exports = Readable;
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+/*<replacement>*/
+var Duplex;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+/*<replacement>*/
+var EE = require('events').EventEmitter;
+
+var EElistenerCount = function (emitter, type) {
+  return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+/*<replacement>*/
+var Stream = require('./internal/streams/stream');
+/*</replacement>*/
+
+/*<replacement>*/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+  return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/*</replacement>*/
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+/*<replacement>*/
+var debugUtil = require('util');
+var debug = void 0;
+if (debugUtil && debugUtil.debuglog) {
+  debug = debugUtil.debuglog('stream');
+} else {
+  debug = function () {};
+}
+/*</replacement>*/
+
+var BufferList = require('./internal/streams/BufferList');
+var destroyImpl = require('./internal/streams/destroy');
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
+
+function prependListener(emitter, event, fn) {
+  // Sadly this is not cacheable as some libraries bundle their own
+  // event emitter implementation with them.
+  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
+
+  // This is a hack to make sure that our error handler is attached before any
+  // userland ones.  NEVER DO THIS. This is here only because this code needs
+  // to continue to work with older versions of Node.js that do not include
+  // the prependListener() method. The goal is to eventually remove this hack.
+  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+
+function ReadableState(options, stream) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  options = options || {};
+
+  // Duplex streams are both readable and writable, but share
+  // the same options object.
+  // However, some cases require setting options to different
+  // values for the readable and the writable sides of the duplex stream.
+  // These options can be provided separately as readableXXX and writableXXX.
+  var isDuplex = stream instanceof Duplex;
+
+  // object stream flag. Used to make read(n) ignore n and to
+  // make all the buffer merging and length checks go away
+  this.objectMode = !!options.objectMode;
+
+  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+  // the point at which it stops calling _read() to fill the buffer
+  // Note: 0 is a valid value, means "don't call _read preemptively ever"
+  var hwm = options.highWaterMark;
+  var readableHwm = options.readableHighWaterMark;
+  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
+
+  // cast to ints.
+  this.highWaterMark = Math.floor(this.highWaterMark);
+
+  // A linked list is used to store data chunks instead of an array because the
+  // linked list can remove elements from the beginning faster than
+  // array.shift()
+  this.buffer = new BufferList();
+  this.length = 0;
+  this.pipes = null;
+  this.pipesCount = 0;
+  this.flowing = null;
+  this.ended = false;
+  this.endEmitted = false;
+  this.reading = false;
+
+  // a flag to be able to tell if the event 'readable'/'data' is emitted
+  // immediately, or on a later tick.  We set this to true at first, because
+  // any actions that shouldn't happen until "later" should generally also
+  // not happen before the first read call.
+  this.sync = true;
+
+  // whenever we return null, then we set a flag to say
+  // that we're awaiting a 'readable' event emission.
+  this.needReadable = false;
+  this.emittedReadable = false;
+  this.readableListening = false;
+  this.resumeScheduled = false;
+
+  // has it been destroyed
+  this.destroyed = false;
+
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // the number of writers that are awaiting a drain event in .pipe()s
+  this.awaitDrain = 0;
+
+  // if true, a maybeReadMore has been scheduled
+  this.readingMore = false;
+
+  this.decoder = null;
+  this.encoding = null;
+  if (options.encoding) {
+    if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+    this.decoder = new StringDecoder(options.encoding);
+    this.encoding = options.encoding;
+  }
+}
+
+function Readable(options) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  if (!(this instanceof Readable)) return new Readable(options);
+
+  this._readableState = new ReadableState(options, this);
+
+  // legacy
+  this.readable = true;
+
+  if (options) {
+    if (typeof options.read === 'function') this._read = options.read;
+
+    if (typeof options.destroy === 'function') this._destroy = options.destroy;
+  }
+
+  Stream.call(this);
+}
+
+Object.defineProperty(Readable.prototype, 'destroyed', {
+  get: function () {
+    if (this._readableState === undefined) {
+      return false;
+    }
+    return this._readableState.destroyed;
+  },
+  set: function (value) {
+    // we ignore the value if the stream
+    // has not been initialized yet
+    if (!this._readableState) {
+      return;
+    }
+
+    // backward compatibility, the user is explicitly
+    // managing destroyed
+    this._readableState.destroyed = value;
+  }
+});
+
+Readable.prototype.destroy = destroyImpl.destroy;
+Readable.prototype._undestroy = destroyImpl.undestroy;
+Readable.prototype._destroy = function (err, cb) {
+  this.push(null);
+  cb(err);
+};
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+  var state = this._readableState;
+  var skipChunkCheck;
+
+  if (!state.objectMode) {
+    if (typeof chunk === 'string') {
+      encoding = encoding || state.defaultEncoding;
+      if (encoding !== state.encoding) {
+        chunk = Buffer.from(chunk, encoding);
+        encoding = '';
+      }
+      skipChunkCheck = true;
+    }
+  } else {
+    skipChunkCheck = true;
+  }
+
+  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+  return readableAddChunk(this, chunk, null, true, false);
+};
+
+function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
+  var state = stream._readableState;
+  if (chunk === null) {
+    state.reading = false;
+    onEofChunk(stream, state);
+  } else {
+    var er;
+    if (!skipChunkCheck) er = chunkInvalid(state, chunk);
+    if (er) {
+      stream.emit('error', er);
+    } else if (state.objectMode || chunk && chunk.length > 0) {
+      if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
+        chunk = _uint8ArrayToBuffer(chunk);
+      }
+
+      if (addToFront) {
+        if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
+      } else if (state.ended) {
+        stream.emit('error', new Error('stream.push() after EOF'));
+      } else {
+        state.reading = false;
+        if (state.decoder && !encoding) {
+          chunk = state.decoder.write(chunk);
+          if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
+        } else {
+          addChunk(stream, state, chunk, false);
+        }
+      }
+    } else if (!addToFront) {
+      state.reading = false;
+    }
+  }
+
+  return needMoreData(state);
+}
+
+function addChunk(stream, state, chunk, addToFront) {
+  if (state.flowing && state.length === 0 && !state.sync) {
+    stream.emit('data', chunk);
+    stream.read(0);
+  } else {
+    // update the buffer info.
+    state.length += state.objectMode ? 1 : chunk.length;
+    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+
+    if (state.needReadable) emitReadable(stream);
+  }
+  maybeReadMore(stream, state);
+}
+
+function chunkInvalid(state, chunk) {
+  var er;
+  if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+    er = new TypeError('Invalid non-string/buffer chunk');
+  }
+  return er;
+}
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes.  This is to work around cases where hwm=0,
+// such as the repl.  Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+  return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+
+Readable.prototype.isPaused = function () {
+  return this._readableState.flowing === false;
+};
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+  if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+  this._readableState.decoder = new StringDecoder(enc);
+  this._readableState.encoding = enc;
+  return this;
+};
+
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+  if (n >= MAX_HWM) {
+    n = MAX_HWM;
+  } else {
+    // Get the next highest power of 2 to prevent increasing hwm excessively in
+    // tiny amounts
+    n--;
+    n |= n >>> 1;
+    n |= n >>> 2;
+    n |= n >>> 4;
+    n |= n >>> 8;
+    n |= n >>> 16;
+    n++;
+  }
+  return n;
+}
+
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function howMuchToRead(n, state) {
+  if (n <= 0 || state.length === 0 && state.ended) return 0;
+  if (state.objectMode) return 1;
+  if (n !== n) {
+    // Only flow one buffer at a time
+    if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
+  }
+  // If we're asking for more than the current hwm, then raise the hwm.
+  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+  if (n <= state.length) return n;
+  // Don't have enough
+  if (!state.ended) {
+    state.needReadable = true;
+    return 0;
+  }
+  return state.length;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+  debug('read', n);
+  n = parseInt(n, 10);
+  var state = this._readableState;
+  var nOrig = n;
+
+  if (n !== 0) state.emittedReadable = false;
+
+  // if we're doing read(0) to trigger a readable event, but we
+  // already have a bunch of data in the buffer, then just trigger
+  // the 'readable' event and move on.
+  if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+    debug('read: emitReadable', state.length, state.ended);
+    if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+    return null;
+  }
+
+  n = howMuchToRead(n, state);
+
+  // if we've ended, and we're now clear, then finish it up.
+  if (n === 0 && state.ended) {
+    if (state.length === 0) endReadable(this);
+    return null;
+  }
+
+  // All the actual chunk generation logic needs to be
+  // *below* the call to _read.  The reason is that in certain
+  // synthetic stream cases, such as passthrough streams, _read
+  // may be a completely synchronous operation which may change
+  // the state of the read buffer, providing enough data when
+  // before there was *not* enough.
+  //
+  // So, the steps are:
+  // 1. Figure out what the state of things will be after we do
+  // a read from the buffer.
+  //
+  // 2. If that resulting state will trigger a _read, then call _read.
+  // Note that this may be asynchronous, or synchronous.  Yes, it is
+  // deeply ugly to write APIs this way, but that still doesn't mean
+  // that the Readable class should behave improperly, as streams are
+  // designed to be sync/async agnostic.
+  // Take note if the _read call is sync or async (ie, if the read call
+  // has returned yet), so that we know whether or not it's safe to emit
+  // 'readable' etc.
+  //
+  // 3. Actually pull the requested chunks out of the buffer and return.
+
+  // if we need a readable event, then we need to do some reading.
+  var doRead = state.needReadable;
+  debug('need readable', doRead);
+
+  // if we currently have less than the highWaterMark, then also read some
+  if (state.length === 0 || state.length - n < state.highWaterMark) {
+    doRead = true;
+    debug('length less than watermark', doRead);
+  }
+
+  // however, if we've ended, then there's no point, and if we're already
+  // reading, then it's unnecessary.
+  if (state.ended || state.reading) {
+    doRead = false;
+    debug('reading or ended', doRead);
+  } else if (doRead) {
+    debug('do read');
+    state.reading = true;
+    state.sync = true;
+    // if the length is currently zero, then we *need* a readable event.
+    if (state.length === 0) state.needReadable = true;
+    // call internal read method
+    this._read(state.highWaterMark);
+    state.sync = false;
+    // If _read pushed data synchronously, then `reading` will be false,
+    // and we need to re-evaluate how much data we can return to the user.
+    if (!state.reading) n = howMuchToRead(nOrig, state);
+  }
+
+  var ret;
+  if (n > 0) ret = fromList(n, state);else ret = null;
+
+  if (ret === null) {
+    state.needReadable = true;
+    n = 0;
+  } else {
+    state.length -= n;
+  }
+
+  if (state.length === 0) {
+    // If we have nothing in the buffer, then we want to know
+    // as soon as we *do* get something into the buffer.
+    if (!state.ended) state.needReadable = true;
+
+    // If we tried to read() past the EOF, then emit end on the next tick.
+    if (nOrig !== n && state.ended) endReadable(this);
+  }
+
+  if (ret !== null) this.emit('data', ret);
+
+  return ret;
+};
+
+function onEofChunk(stream, state) {
+  if (state.ended) return;
+  if (state.decoder) {
+    var chunk = state.decoder.end();
+    if (chunk && chunk.length) {
+      state.buffer.push(chunk);
+      state.length += state.objectMode ? 1 : chunk.length;
+    }
+  }
+  state.ended = true;
+
+  // emit 'readable' now to make sure it gets picked up.
+  emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow.  This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+  var state = stream._readableState;
+  state.needReadable = false;
+  if (!state.emittedReadable) {
+    debug('emitReadable', state.flowing);
+    state.emittedReadable = true;
+    if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
+  }
+}
+
+function emitReadable_(stream) {
+  debug('emit readable');
+  stream.emit('readable');
+  flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data.  that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+  if (!state.readingMore) {
+    state.readingMore = true;
+    pna.nextTick(maybeReadMore_, stream, state);
+  }
+}
+
+function maybeReadMore_(stream, state) {
+  var len = state.length;
+  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+    debug('maybeReadMore read 0');
+    stream.read(0);
+    if (len === state.length)
+      // didn't get any data, stop spinning.
+      break;else len = state.length;
+  }
+  state.readingMore = false;
+}
+
+// abstract method.  to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+  this.emit('error', new Error('_read() is not implemented'));
+};
+
+Readable.prototype.pipe = function (dest, pipeOpts) {
+  var src = this;
+  var state = this._readableState;
+
+  switch (state.pipesCount) {
+    case 0:
+      state.pipes = dest;
+      break;
+    case 1:
+      state.pipes = [state.pipes, dest];
+      break;
+    default:
+      state.pipes.push(dest);
+      break;
+  }
+  state.pipesCount += 1;
+  debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+
+  var endFn = doEnd ? onend : unpipe;
+  if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
+
+  dest.on('unpipe', onunpipe);
+  function onunpipe(readable, unpipeInfo) {
+    debug('onunpipe');
+    if (readable === src) {
+      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
+        unpipeInfo.hasUnpiped = true;
+        cleanup();
+      }
+    }
+  }
+
+  function onend() {
+    debug('onend');
+    dest.end();
+  }
+
+  // when the dest drains, it reduces the awaitDrain counter
+  // on the source.  This would be more elegant with a .once()
+  // handler in flow(), but adding and removing repeatedly is
+  // too slow.
+  var ondrain = pipeOnDrain(src);
+  dest.on('drain', ondrain);
+
+  var cleanedUp = false;
+  function cleanup() {
+    debug('cleanup');
+    // cleanup event handlers once the pipe is broken
+    dest.removeListener('close', onclose);
+    dest.removeListener('finish', onfinish);
+    dest.removeListener('drain', ondrain);
+    dest.removeListener('error', onerror);
+    dest.removeListener('unpipe', onunpipe);
+    src.removeListener('end', onend);
+    src.removeListener('end', unpipe);
+    src.removeListener('data', ondata);
+
+    cleanedUp = true;
+
+    // if the reader is waiting for a drain event from this
+    // specific writer, then it would cause it to never start
+    // flowing again.
+    // So, if this is awaiting a drain, then we just call it now.
+    // If we don't know, then assume that we are waiting for one.
+    if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+  }
+
+  // If the user pushes more data while we're writing to dest then we'll end up
+  // in ondata again. However, we only want to increase awaitDrain once because
+  // dest will only emit one 'drain' event for the multiple writes.
+  // => Introduce a guard on increasing awaitDrain.
+  var increasedAwaitDrain = false;
+  src.on('data', ondata);
+  function ondata(chunk) {
+    debug('ondata');
+    increasedAwaitDrain = false;
+    var ret = dest.write(chunk);
+    if (false === ret && !increasedAwaitDrain) {
+      // If the user unpiped during `dest.write()`, it is possible
+      // to get stuck in a permanently paused state if that write
+      // also returned false.
+      // => Check whether `dest` is still a piping destination.
+      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
+        debug('false write response, pause', src._readableState.awaitDrain);
+        src._readableState.awaitDrain++;
+        increasedAwaitDrain = true;
+      }
+      src.pause();
+    }
+  }
+
+  // if the dest has an error, then stop piping into it.
+  // however, don't suppress the throwing behavior for this.
+  function onerror(er) {
+    debug('onerror', er);
+    unpipe();
+    dest.removeListener('error', onerror);
+    if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+  }
+
+  // Make sure our error handler is attached before userland ones.
+  prependListener(dest, 'error', onerror);
+
+  // Both close and finish should trigger unpipe, but only once.
+  function onclose() {
+    dest.removeListener('finish', onfinish);
+    unpipe();
+  }
+  dest.once('close', onclose);
+  function onfinish() {
+    debug('onfinish');
+    dest.removeListener('close', onclose);
+    unpipe();
+  }
+  dest.once('finish', onfinish);
+
+  function unpipe() {
+    debug('unpipe');
+    src.unpipe(dest);
+  }
+
+  // tell the dest that it's being piped to
+  dest.emit('pipe', src);
+
+  // start the flow if it hasn't been started already.
+  if (!state.flowing) {
+    debug('pipe resume');
+    src.resume();
+  }
+
+  return dest;
+};
+
+function pipeOnDrain(src) {
+  return function () {
+    var state = src._readableState;
+    debug('pipeOnDrain', state.awaitDrain);
+    if (state.awaitDrain) state.awaitDrain--;
+    if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+      state.flowing = true;
+      flow(src);
+    }
+  };
+}
+
+Readable.prototype.unpipe = function (dest) {
+  var state = this._readableState;
+  var unpipeInfo = { hasUnpiped: false };
+
+  // if we're not piping anywhere, then do nothing.
+  if (state.pipesCount === 0) return this;
+
+  // just one destination.  most common case.
+  if (state.pipesCount === 1) {
+    // passed in one, but it's not the right one.
+    if (dest && dest !== state.pipes) return this;
+
+    if (!dest) dest = state.pipes;
+
+    // got a match.
+    state.pipes = null;
+    state.pipesCount = 0;
+    state.flowing = false;
+    if (dest) dest.emit('unpipe', this, unpipeInfo);
+    return this;
+  }
+
+  // slow case. multiple pipe destinations.
+
+  if (!dest) {
+    // remove all.
+    var dests = state.pipes;
+    var len = state.pipesCount;
+    state.pipes = null;
+    state.pipesCount = 0;
+    state.flowing = false;
+
+    for (var i = 0; i < len; i++) {
+      dests[i].emit('unpipe', this, unpipeInfo);
+    }return this;
+  }
+
+  // try to find the right one.
+  var index = indexOf(state.pipes, dest);
+  if (index === -1) return this;
+
+  state.pipes.splice(index, 1);
+  state.pipesCount -= 1;
+  if (state.pipesCount === 1) state.pipes = state.pipes[0];
+
+  dest.emit('unpipe', this, unpipeInfo);
+
+  return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+  var res = Stream.prototype.on.call(this, ev, fn);
+
+  if (ev === 'data') {
+    // Start flowing on next tick if stream isn't explicitly paused
+    if (this._readableState.flowing !== false) this.resume();
+  } else if (ev === 'readable') {
+    var state = this._readableState;
+    if (!state.endEmitted && !state.readableListening) {
+      state.readableListening = state.needReadable = true;
+      state.emittedReadable = false;
+      if (!state.reading) {
+        pna.nextTick(nReadingNextTick, this);
+      } else if (state.length) {
+        emitReadable(this);
+      }
+    }
+  }
+
+  return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+  debug('readable nexttick read 0');
+  self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+  var state = this._readableState;
+  if (!state.flowing) {
+    debug('resume');
+    state.flowing = true;
+    resume(this, state);
+  }
+  return this;
+};
+
+function resume(stream, state) {
+  if (!state.resumeScheduled) {
+    state.resumeScheduled = true;
+    pna.nextTick(resume_, stream, state);
+  }
+}
+
+function resume_(stream, state) {
+  if (!state.reading) {
+    debug('resume read 0');
+    stream.read(0);
+  }
+
+  state.resumeScheduled = false;
+  state.awaitDrain = 0;
+  stream.emit('resume');
+  flow(stream);
+  if (state.flowing && !state.reading) stream.read(0);
+}
+
+Readable.prototype.pause = function () {
+  debug('call pause flowing=%j', this._readableState.flowing);
+  if (false !== this._readableState.flowing) {
+    debug('pause');
+    this._readableState.flowing = false;
+    this.emit('pause');
+  }
+  return this;
+};
+
+function flow(stream) {
+  var state = stream._readableState;
+  debug('flow', state.flowing);
+  while (state.flowing && stream.read() !== null) {}
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+  var _this = this;
+
+  var state = this._readableState;
+  var paused = false;
+
+  stream.on('end', function () {
+    debug('wrapped end');
+    if (state.decoder && !state.ended) {
+      var chunk = state.decoder.end();
+      if (chunk && chunk.length) _this.push(chunk);
+    }
+
+    _this.push(null);
+  });
+
+  stream.on('data', function (chunk) {
+    debug('wrapped data');
+    if (state.decoder) chunk = state.decoder.write(chunk);
+
+    // don't skip over falsy values in objectMode
+    if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+
+    var ret = _this.push(chunk);
+    if (!ret) {
+      paused = true;
+      stream.pause();
+    }
+  });
+
+  // proxy all the other methods.
+  // important when wrapping filters and duplexes.
+  for (var i in stream) {
+    if (this[i] === undefined && typeof stream[i] === 'function') {
+      this[i] = function (method) {
+        return function () {
+          return stream[method].apply(stream, arguments);
+        };
+      }(i);
+    }
+  }
+
+  // proxy certain important events.
+  for (var n = 0; n < kProxyEvents.length; n++) {
+    stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
+  }
+
+  // when we try to consume some more bytes, simply unpause the
+  // underlying stream.
+  this._read = function (n) {
+    debug('wrapped _read', n);
+    if (paused) {
+      paused = false;
+      stream.resume();
+    }
+  };
+
+  return this;
+};
+
+Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
+  // making it explicit this property is not enumerable
+  // because otherwise some prototype manipulation in
+  // userland will fail
+  enumerable: false,
+  get: function () {
+    return this._readableState.highWaterMark;
+  }
+});
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromList(n, state) {
+  // nothing buffered
+  if (state.length === 0) return null;
+
+  var ret;
+  if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
+    // read it all, truncate the list
+    if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
+    state.buffer.clear();
+  } else {
+    // read part of list
+    ret = fromListPartial(n, state.buffer, state.decoder);
+  }
+
+  return ret;
+}
+
+// Extracts only enough buffered data to satisfy the amount requested.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromListPartial(n, list, hasStrings) {
+  var ret;
+  if (n < list.head.data.length) {
+    // slice is the same for buffers and strings
+    ret = list.head.data.slice(0, n);
+    list.head.data = list.head.data.slice(n);
+  } else if (n === list.head.data.length) {
+    // first chunk is a perfect match
+    ret = list.shift();
+  } else {
+    // result spans more than one buffer
+    ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
+  }
+  return ret;
+}
+
+// Copies a specified amount of characters from the list of buffered data
+// chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBufferString(n, list) {
+  var p = list.head;
+  var c = 1;
+  var ret = p.data;
+  n -= ret.length;
+  while (p = p.next) {
+    var str = p.data;
+    var nb = n > str.length ? str.length : n;
+    if (nb === str.length) ret += str;else ret += str.slice(0, n);
+    n -= nb;
+    if (n === 0) {
+      if (nb === str.length) {
+        ++c;
+        if (p.next) list.head = p.next;else list.head = list.tail = null;
+      } else {
+        list.head = p;
+        p.data = str.slice(nb);
+      }
+      break;
+    }
+    ++c;
+  }
+  list.length -= c;
+  return ret;
+}
+
+// Copies a specified amount of bytes from the list of buffered data chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBuffer(n, list) {
+  var ret = Buffer.allocUnsafe(n);
+  var p = list.head;
+  var c = 1;
+  p.data.copy(ret);
+  n -= p.data.length;
+  while (p = p.next) {
+    var buf = p.data;
+    var nb = n > buf.length ? buf.length : n;
+    buf.copy(ret, ret.length - n, 0, nb);
+    n -= nb;
+    if (n === 0) {
+      if (nb === buf.length) {
+        ++c;
+        if (p.next) list.head = p.next;else list.head = list.tail = null;
+      } else {
+        list.head = p;
+        p.data = buf.slice(nb);
+      }
+      break;
+    }
+    ++c;
+  }
+  list.length -= c;
+  return ret;
+}
+
+function endReadable(stream) {
+  var state = stream._readableState;
+
+  // If we get here before consuming all the bytes, then that is a
+  // bug in node.  Should never happen.
+  if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+
+  if (!state.endEmitted) {
+    state.ended = true;
+    pna.nextTick(endReadableNT, state, stream);
+  }
+}
+
+function endReadableNT(state, stream) {
+  // Check that we didn't get one last unshift.
+  if (!state.endEmitted && state.length === 0) {
+    state.endEmitted = true;
+    stream.readable = false;
+    stream.emit('end');
+  }
+}
+
+function indexOf(xs, x) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    if (xs[i] === x) return i;
+  }
+  return -1;
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_transform.js b/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644 (file)
index 0000000..5d1f8b8
--- /dev/null
@@ -0,0 +1,214 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a transform stream is a readable/writable stream where you do
+// something with the data.  Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored.  (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation.  For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes.  When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up.  When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer.  When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks.  If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk.  However,
+// a pathological inflate type of transform can cause excessive buffering
+// here.  For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output.  In this case, you could write a very small
+// amount of input, and end up with a very large amount of output.  In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform.  A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+function afterTransform(er, data) {
+  var ts = this._transformState;
+  ts.transforming = false;
+
+  var cb = ts.writecb;
+
+  if (!cb) {
+    return this.emit('error', new Error('write callback called multiple times'));
+  }
+
+  ts.writechunk = null;
+  ts.writecb = null;
+
+  if (data != null) // single equals check for both `null` and `undefined`
+    this.push(data);
+
+  cb(er);
+
+  var rs = this._readableState;
+  rs.reading = false;
+  if (rs.needReadable || rs.length < rs.highWaterMark) {
+    this._read(rs.highWaterMark);
+  }
+}
+
+function Transform(options) {
+  if (!(this instanceof Transform)) return new Transform(options);
+
+  Duplex.call(this, options);
+
+  this._transformState = {
+    afterTransform: afterTransform.bind(this),
+    needTransform: false,
+    transforming: false,
+    writecb: null,
+    writechunk: null,
+    writeencoding: null
+  };
+
+  // start out asking for a readable event once data is transformed.
+  this._readableState.needReadable = true;
+
+  // we have implemented the _read method, and done the other things
+  // that Readable wants before the first _read call, so unset the
+  // sync guard flag.
+  this._readableState.sync = false;
+
+  if (options) {
+    if (typeof options.transform === 'function') this._transform = options.transform;
+
+    if (typeof options.flush === 'function') this._flush = options.flush;
+  }
+
+  // When the writable side finishes, then flush out anything remaining.
+  this.on('prefinish', prefinish);
+}
+
+function prefinish() {
+  var _this = this;
+
+  if (typeof this._flush === 'function') {
+    this._flush(function (er, data) {
+      done(_this, er, data);
+    });
+  } else {
+    done(this, null, null);
+  }
+}
+
+Transform.prototype.push = function (chunk, encoding) {
+  this._transformState.needTransform = false;
+  return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side.  You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk.  If you pass
+// an error, then that'll put the hurt on the whole operation.  If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+  throw new Error('_transform() is not implemented');
+};
+
+Transform.prototype._write = function (chunk, encoding, cb) {
+  var ts = this._transformState;
+  ts.writecb = cb;
+  ts.writechunk = chunk;
+  ts.writeencoding = encoding;
+  if (!ts.transforming) {
+    var rs = this._readableState;
+    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+  }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+  var ts = this._transformState;
+
+  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+    ts.transforming = true;
+    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+  } else {
+    // mark that we need a transform, so that any data that comes in
+    // will get processed, now that we've asked for it.
+    ts.needTransform = true;
+  }
+};
+
+Transform.prototype._destroy = function (err, cb) {
+  var _this2 = this;
+
+  Duplex.prototype._destroy.call(this, err, function (err2) {
+    cb(err2);
+    _this2.emit('close');
+  });
+};
+
+function done(stream, er, data) {
+  if (er) return stream.emit('error', er);
+
+  if (data != null) // single equals check for both `null` and `undefined`
+    stream.push(data);
+
+  // if there's nothing in the write buffer, then that means
+  // that nothing more will ever be provided
+  if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
+
+  if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
+
+  return stream.push(null);
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_writable.js b/legacy-libs/grpc/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644 (file)
index 0000000..b3f4e85
--- /dev/null
@@ -0,0 +1,687 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+module.exports = Writable;
+
+/* <replacement> */
+function WriteReq(chunk, encoding, cb) {
+  this.chunk = chunk;
+  this.encoding = encoding;
+  this.callback = cb;
+  this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+  var _this = this;
+
+  this.next = null;
+  this.entry = null;
+  this.finish = function () {
+    onCorkedFinish(_this, state);
+  };
+}
+/* </replacement> */
+
+/*<replacement>*/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
+/*</replacement>*/
+
+/*<replacement>*/
+var Duplex;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+/*<replacement>*/
+var util = require('core-util-is');
+util.inherits = require('inherits');
+/*</replacement>*/
+
+/*<replacement>*/
+var internalUtil = {
+  deprecate: require('util-deprecate')
+};
+/*</replacement>*/
+
+/*<replacement>*/
+var Stream = require('./internal/streams/stream');
+/*</replacement>*/
+
+/*<replacement>*/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+  return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/*</replacement>*/
+
+var destroyImpl = require('./internal/streams/destroy');
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WritableState(options, stream) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  options = options || {};
+
+  // Duplex streams are both readable and writable, but share
+  // the same options object.
+  // However, some cases require setting options to different
+  // values for the readable and the writable sides of the duplex stream.
+  // These options can be provided separately as readableXXX and writableXXX.
+  var isDuplex = stream instanceof Duplex;
+
+  // object stream flag to indicate whether or not this stream
+  // contains buffers or objects.
+  this.objectMode = !!options.objectMode;
+
+  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+  // the point at which write() starts returning false
+  // Note: 0 is a valid value, means that we always return false if
+  // the entire buffer is not flushed immediately on write()
+  var hwm = options.highWaterMark;
+  var writableHwm = options.writableHighWaterMark;
+  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+
+  // cast to ints.
+  this.highWaterMark = Math.floor(this.highWaterMark);
+
+  // if _final has been called
+  this.finalCalled = false;
+
+  // drain event flag.
+  this.needDrain = false;
+  // at the start of calling end()
+  this.ending = false;
+  // when end() has been called, and returned
+  this.ended = false;
+  // when 'finish' is emitted
+  this.finished = false;
+
+  // has it been destroyed
+  this.destroyed = false;
+
+  // should we decode strings into buffers before passing to _write?
+  // this is here so that some node-core streams can optimize string
+  // handling at a lower level.
+  var noDecode = options.decodeStrings === false;
+  this.decodeStrings = !noDecode;
+
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // not an actual buffer we keep track of, but a measurement
+  // of how much we're waiting to get pushed to some underlying
+  // socket or file.
+  this.length = 0;
+
+  // a flag to see when we're in the middle of a write.
+  this.writing = false;
+
+  // when true all writes will be buffered until .uncork() call
+  this.corked = 0;
+
+  // a flag to be able to tell if the onwrite cb is called immediately,
+  // or on a later tick.  We set this to true at first, because any
+  // actions that shouldn't happen until "later" should generally also
+  // not happen before the first write call.
+  this.sync = true;
+
+  // a flag to know if we're processing previously buffered items, which
+  // may call the _write() callback in the same tick, so that we don't
+  // end up in an overlapped onwrite situation.
+  this.bufferProcessing = false;
+
+  // the callback that's passed to _write(chunk,cb)
+  this.onwrite = function (er) {
+    onwrite(stream, er);
+  };
+
+  // the callback that the user supplies to write(chunk,encoding,cb)
+  this.writecb = null;
+
+  // the amount that is being written when _write is called.
+  this.writelen = 0;
+
+  this.bufferedRequest = null;
+  this.lastBufferedRequest = null;
+
+  // number of pending user-supplied write callbacks
+  // this must be 0 before 'finish' can be emitted
+  this.pendingcb = 0;
+
+  // emit prefinish if the only thing we're waiting for is _write cbs
+  // This is relevant for synchronous Transform streams
+  this.prefinished = false;
+
+  // True if the error was already emitted and should not be thrown again
+  this.errorEmitted = false;
+
+  // count buffered requests
+  this.bufferedRequestCount = 0;
+
+  // allocate the first CorkedRequest, there is always
+  // one allocated and free to use, and we maintain at most two
+  this.corkedRequestsFree = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function getBuffer() {
+  var current = this.bufferedRequest;
+  var out = [];
+  while (current) {
+    out.push(current);
+    current = current.next;
+  }
+  return out;
+};
+
+(function () {
+  try {
+    Object.defineProperty(WritableState.prototype, 'buffer', {
+      get: internalUtil.deprecate(function () {
+        return this.getBuffer();
+      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+    });
+  } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+  realHasInstance = Function.prototype[Symbol.hasInstance];
+  Object.defineProperty(Writable, Symbol.hasInstance, {
+    value: function (object) {
+      if (realHasInstance.call(this, object)) return true;
+      if (this !== Writable) return false;
+
+      return object && object._writableState instanceof WritableState;
+    }
+  });
+} else {
+  realHasInstance = function (object) {
+    return object instanceof this;
+  };
+}
+
+function Writable(options) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  // Writable ctor is applied to Duplexes, too.
+  // `realHasInstance` is necessary because using plain `instanceof`
+  // would return false, as no `_writableState` property is attached.
+
+  // Trying to use the custom `instanceof` for Writable here will also break the
+  // Node.js LazyTransform implementation, which has a non-trivial getter for
+  // `_writableState` that would lead to infinite recursion.
+  if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+    return new Writable(options);
+  }
+
+  this._writableState = new WritableState(options, this);
+
+  // legacy.
+  this.writable = true;
+
+  if (options) {
+    if (typeof options.write === 'function') this._write = options.write;
+
+    if (typeof options.writev === 'function') this._writev = options.writev;
+
+    if (typeof options.destroy === 'function') this._destroy = options.destroy;
+
+    if (typeof options.final === 'function') this._final = options.final;
+  }
+
+  Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+  this.emit('error', new Error('Cannot pipe, not readable'));
+};
+
+function writeAfterEnd(stream, cb) {
+  var er = new Error('write after end');
+  // TODO: defer error events consistently everywhere, not just the cb
+  stream.emit('error', er);
+  pna.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+  var valid = true;
+  var er = false;
+
+  if (chunk === null) {
+    er = new TypeError('May not write null values to stream');
+  } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+    er = new TypeError('Invalid non-string/buffer chunk');
+  }
+  if (er) {
+    stream.emit('error', er);
+    pna.nextTick(cb, er);
+    valid = false;
+  }
+  return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+  var state = this._writableState;
+  var ret = false;
+  var isBuf = !state.objectMode && _isUint8Array(chunk);
+
+  if (isBuf && !Buffer.isBuffer(chunk)) {
+    chunk = _uint8ArrayToBuffer(chunk);
+  }
+
+  if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+
+  if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+  if (typeof cb !== 'function') cb = nop;
+
+  if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+    state.pendingcb++;
+    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+  }
+
+  return ret;
+};
+
+Writable.prototype.cork = function () {
+  var state = this._writableState;
+
+  state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+  var state = this._writableState;
+
+  if (state.corked) {
+    state.corked--;
+
+    if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+  }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+  // node::ParseEncoding() requires lower case.
+  if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+  if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+  this._writableState.defaultEncoding = encoding;
+  return this;
+};
+
+function decodeChunk(state, chunk, encoding) {
+  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+    chunk = Buffer.from(chunk, encoding);
+  }
+  return chunk;
+}
+
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+  // making it explicit this property is not enumerable
+  // because otherwise some prototype manipulation in
+  // userland will fail
+  enumerable: false,
+  get: function () {
+    return this._writableState.highWaterMark;
+  }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn.  Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+  if (!isBuf) {
+    var newChunk = decodeChunk(state, chunk, encoding);
+    if (chunk !== newChunk) {
+      isBuf = true;
+      encoding = 'buffer';
+      chunk = newChunk;
+    }
+  }
+  var len = state.objectMode ? 1 : chunk.length;
+
+  state.length += len;
+
+  var ret = state.length < state.highWaterMark;
+  // we must ensure that previous needDrain will not be reset to false.
+  if (!ret) state.needDrain = true;
+
+  if (state.writing || state.corked) {
+    var last = state.lastBufferedRequest;
+    state.lastBufferedRequest = {
+      chunk: chunk,
+      encoding: encoding,
+      isBuf: isBuf,
+      callback: cb,
+      next: null
+    };
+    if (last) {
+      last.next = state.lastBufferedRequest;
+    } else {
+      state.bufferedRequest = state.lastBufferedRequest;
+    }
+    state.bufferedRequestCount += 1;
+  } else {
+    doWrite(stream, state, false, len, chunk, encoding, cb);
+  }
+
+  return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+  state.writelen = len;
+  state.writecb = cb;
+  state.writing = true;
+  state.sync = true;
+  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+  state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+  --state.pendingcb;
+
+  if (sync) {
+    // defer the callback if we are being called synchronously
+    // to avoid piling up things on the stack
+    pna.nextTick(cb, er);
+    // this can emit finish, and it will always happen
+    // after error
+    pna.nextTick(finishMaybe, stream, state);
+    stream._writableState.errorEmitted = true;
+    stream.emit('error', er);
+  } else {
+    // the caller expect this to happen before if
+    // it is async
+    cb(er);
+    stream._writableState.errorEmitted = true;
+    stream.emit('error', er);
+    // this can emit finish, but finish must
+    // always follow error
+    finishMaybe(stream, state);
+  }
+}
+
+function onwriteStateUpdate(state) {
+  state.writing = false;
+  state.writecb = null;
+  state.length -= state.writelen;
+  state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+  var state = stream._writableState;
+  var sync = state.sync;
+  var cb = state.writecb;
+
+  onwriteStateUpdate(state);
+
+  if (er) onwriteError(stream, state, sync, er, cb);else {
+    // Check if we're actually ready to finish, but don't emit yet
+    var finished = needFinish(state);
+
+    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+      clearBuffer(stream, state);
+    }
+
+    if (sync) {
+      /*<replacement>*/
+      asyncWrite(afterWrite, stream, state, finished, cb);
+      /*</replacement>*/
+    } else {
+      afterWrite(stream, state, finished, cb);
+    }
+  }
+}
+
+function afterWrite(stream, state, finished, cb) {
+  if (!finished) onwriteDrain(stream, state);
+  state.pendingcb--;
+  cb();
+  finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+  if (state.length === 0 && state.needDrain) {
+    state.needDrain = false;
+    stream.emit('drain');
+  }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+  state.bufferProcessing = true;
+  var entry = state.bufferedRequest;
+
+  if (stream._writev && entry && entry.next) {
+    // Fast case, write everything using _writev()
+    var l = state.bufferedRequestCount;
+    var buffer = new Array(l);
+    var holder = state.corkedRequestsFree;
+    holder.entry = entry;
+
+    var count = 0;
+    var allBuffers = true;
+    while (entry) {
+      buffer[count] = entry;
+      if (!entry.isBuf) allBuffers = false;
+      entry = entry.next;
+      count += 1;
+    }
+    buffer.allBuffers = allBuffers;
+
+    doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+    // doWrite is almost always async, defer these to save a bit of time
+    // as the hot path ends with doWrite
+    state.pendingcb++;
+    state.lastBufferedRequest = null;
+    if (holder.next) {
+      state.corkedRequestsFree = holder.next;
+      holder.next = null;
+    } else {
+      state.corkedRequestsFree = new CorkedRequest(state);
+    }
+    state.bufferedRequestCount = 0;
+  } else {
+    // Slow case, write chunks one-by-one
+    while (entry) {
+      var chunk = entry.chunk;
+      var encoding = entry.encoding;
+      var cb = entry.callback;
+      var len = state.objectMode ? 1 : chunk.length;
+
+      doWrite(stream, state, false, len, chunk, encoding, cb);
+      entry = entry.next;
+      state.bufferedRequestCount--;
+      // if we didn't call the onwrite immediately, then
+      // it means that we need to wait until it does.
+      // also, that means that the chunk and cb are currently
+      // being processed, so move the buffer counter past them.
+      if (state.writing) {
+        break;
+      }
+    }
+
+    if (entry === null) state.lastBufferedRequest = null;
+  }
+
+  state.bufferedRequest = entry;
+  state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+  cb(new Error('_write() is not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+  var state = this._writableState;
+
+  if (typeof chunk === 'function') {
+    cb = chunk;
+    chunk = null;
+    encoding = null;
+  } else if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+
+  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+  // .end() fully uncorks
+  if (state.corked) {
+    state.corked = 1;
+    this.uncork();
+  }
+
+  // ignore unnecessary end() calls.
+  if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+  stream._final(function (err) {
+    state.pendingcb--;
+    if (err) {
+      stream.emit('error', err);
+    }
+    state.prefinished = true;
+    stream.emit('prefinish');
+    finishMaybe(stream, state);
+  });
+}
+function prefinish(stream, state) {
+  if (!state.prefinished && !state.finalCalled) {
+    if (typeof stream._final === 'function') {
+      state.pendingcb++;
+      state.finalCalled = true;
+      pna.nextTick(callFinal, stream, state);
+    } else {
+      state.prefinished = true;
+      stream.emit('prefinish');
+    }
+  }
+}
+
+function finishMaybe(stream, state) {
+  var need = needFinish(state);
+  if (need) {
+    prefinish(stream, state);
+    if (state.pendingcb === 0) {
+      state.finished = true;
+      stream.emit('finish');
+    }
+  }
+  return need;
+}
+
+function endWritable(stream, state, cb) {
+  state.ending = true;
+  finishMaybe(stream, state);
+  if (cb) {
+    if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+  }
+  state.ended = true;
+  stream.writable = false;
+}
+
+function onCorkedFinish(corkReq, state, err) {
+  var entry = corkReq.entry;
+  corkReq.entry = null;
+  while (entry) {
+    var cb = entry.callback;
+    state.pendingcb--;
+    cb(err);
+    entry = entry.next;
+  }
+  if (state.corkedRequestsFree) {
+    state.corkedRequestsFree.next = corkReq;
+  } else {
+    state.corkedRequestsFree = corkReq;
+  }
+}
+
+Object.defineProperty(Writable.prototype, 'destroyed', {
+  get: function () {
+    if (this._writableState === undefined) {
+      return false;
+    }
+    return this._writableState.destroyed;
+  },
+  set: function (value) {
+    // we ignore the value if the stream
+    // has not been initialized yet
+    if (!this._writableState) {
+      return;
+    }
+
+    // backward compatibility, the user is explicitly
+    // managing destroyed
+    this._writableState.destroyed = value;
+  }
+});
+
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+  this.end();
+  cb(err);
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/BufferList.js b/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/BufferList.js
new file mode 100644 (file)
index 0000000..aefc68b
--- /dev/null
@@ -0,0 +1,79 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Buffer = require('safe-buffer').Buffer;
+var util = require('util');
+
+function copyBuffer(src, target, offset) {
+  src.copy(target, offset);
+}
+
+module.exports = function () {
+  function BufferList() {
+    _classCallCheck(this, BufferList);
+
+    this.head = null;
+    this.tail = null;
+    this.length = 0;
+  }
+
+  BufferList.prototype.push = function push(v) {
+    var entry = { data: v, next: null };
+    if (this.length > 0) this.tail.next = entry;else this.head = entry;
+    this.tail = entry;
+    ++this.length;
+  };
+
+  BufferList.prototype.unshift = function unshift(v) {
+    var entry = { data: v, next: this.head };
+    if (this.length === 0) this.tail = entry;
+    this.head = entry;
+    ++this.length;
+  };
+
+  BufferList.prototype.shift = function shift() {
+    if (this.length === 0) return;
+    var ret = this.head.data;
+    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
+    --this.length;
+    return ret;
+  };
+
+  BufferList.prototype.clear = function clear() {
+    this.head = this.tail = null;
+    this.length = 0;
+  };
+
+  BufferList.prototype.join = function join(s) {
+    if (this.length === 0) return '';
+    var p = this.head;
+    var ret = '' + p.data;
+    while (p = p.next) {
+      ret += s + p.data;
+    }return ret;
+  };
+
+  BufferList.prototype.concat = function concat(n) {
+    if (this.length === 0) return Buffer.alloc(0);
+    if (this.length === 1) return this.head.data;
+    var ret = Buffer.allocUnsafe(n >>> 0);
+    var p = this.head;
+    var i = 0;
+    while (p) {
+      copyBuffer(p.data, ret, i);
+      i += p.data.length;
+      p = p.next;
+    }
+    return ret;
+  };
+
+  return BufferList;
+}();
+
+if (util && util.inspect && util.inspect.custom) {
+  module.exports.prototype[util.inspect.custom] = function () {
+    var obj = util.inspect({ length: this.length });
+    return this.constructor.name + ' ' + obj;
+  };
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/destroy.js b/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/destroy.js
new file mode 100644 (file)
index 0000000..5a0a0d8
--- /dev/null
@@ -0,0 +1,74 @@
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+// undocumented cb() API, needed for core, not for public API
+function destroy(err, cb) {
+  var _this = this;
+
+  var readableDestroyed = this._readableState && this._readableState.destroyed;
+  var writableDestroyed = this._writableState && this._writableState.destroyed;
+
+  if (readableDestroyed || writableDestroyed) {
+    if (cb) {
+      cb(err);
+    } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
+      pna.nextTick(emitErrorNT, this, err);
+    }
+    return this;
+  }
+
+  // we set destroyed to true before firing error callbacks in order
+  // to make it re-entrance safe in case destroy() is called within callbacks
+
+  if (this._readableState) {
+    this._readableState.destroyed = true;
+  }
+
+  // if this is a duplex stream mark the writable part as destroyed as well
+  if (this._writableState) {
+    this._writableState.destroyed = true;
+  }
+
+  this._destroy(err || null, function (err) {
+    if (!cb && err) {
+      pna.nextTick(emitErrorNT, _this, err);
+      if (_this._writableState) {
+        _this._writableState.errorEmitted = true;
+      }
+    } else if (cb) {
+      cb(err);
+    }
+  });
+
+  return this;
+}
+
+function undestroy() {
+  if (this._readableState) {
+    this._readableState.destroyed = false;
+    this._readableState.reading = false;
+    this._readableState.ended = false;
+    this._readableState.endEmitted = false;
+  }
+
+  if (this._writableState) {
+    this._writableState.destroyed = false;
+    this._writableState.ended = false;
+    this._writableState.ending = false;
+    this._writableState.finished = false;
+    this._writableState.errorEmitted = false;
+  }
+}
+
+function emitErrorNT(self, err) {
+  self.emit('error', err);
+}
+
+module.exports = {
+  destroy: destroy,
+  undestroy: undestroy
+};
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/stream-browser.js
new file mode 100644 (file)
index 0000000..9332a3f
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('events').EventEmitter;
diff --git a/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/stream.js b/legacy-libs/grpc/node_modules/readable-stream/lib/internal/streams/stream.js
new file mode 100644 (file)
index 0000000..ce2ad5b
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('stream');
diff --git a/legacy-libs/grpc/node_modules/readable-stream/package.json b/legacy-libs/grpc/node_modules/readable-stream/package.json
new file mode 100644 (file)
index 0000000..3c5aac2
--- /dev/null
@@ -0,0 +1,88 @@
+{
+  "_args": [
+    [
+      "readable-stream@2.3.6",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "readable-stream@2.3.6",
+  "_id": "readable-stream@2.3.6",
+  "_inBundle": false,
+  "_integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
+  "_location": "/grpc/readable-stream",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "readable-stream@2.3.6",
+    "name": "readable-stream",
+    "escapedName": "readable-stream",
+    "rawSpec": "2.3.6",
+    "saveSpec": null,
+    "fetchSpec": "2.3.6"
+  },
+  "_requiredBy": [
+    "/grpc/are-we-there-yet"
+  ],
+  "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.3.6",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "browser": {
+    "util": false,
+    "./readable.js": "./readable-browser.js",
+    "./writable.js": "./writable-browser.js",
+    "./duplex.js": "./duplex-browser.js",
+    "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
+  },
+  "bugs": {
+    "url": "https://github.com/nodejs/readable-stream/issues"
+  },
+  "dependencies": {
+    "core-util-is": "~1.0.0",
+    "inherits": "~2.0.3",
+    "isarray": "~1.0.0",
+    "process-nextick-args": "~2.0.0",
+    "safe-buffer": "~5.1.1",
+    "string_decoder": "~1.1.1",
+    "util-deprecate": "~1.0.1"
+  },
+  "description": "Streams3, a user-land copy of the stream library from Node.js",
+  "devDependencies": {
+    "assert": "^1.4.0",
+    "babel-polyfill": "^6.9.1",
+    "buffer": "^4.9.0",
+    "lolex": "^2.3.2",
+    "nyc": "^6.4.0",
+    "tap": "^0.7.0",
+    "tape": "^4.8.0"
+  },
+  "homepage": "https://github.com/nodejs/readable-stream#readme",
+  "keywords": [
+    "readable",
+    "stream",
+    "pipe"
+  ],
+  "license": "MIT",
+  "main": "readable.js",
+  "name": "readable-stream",
+  "nyc": {
+    "include": [
+      "lib/**.js"
+    ]
+  },
+  "optionalDependencies": {},
+  "readme": "# readable-stream\n\n***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core.\n\nFull documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning.\n\n# Streams Working Group\n\n`readable-stream` is maintained by the Streams Working Group, which\noversees the development and maintenance of the Streams API within\nNode.js. The responsibilities of the Streams Working Group include:\n\n* Addressing stream issues on the Node.js issue tracker.\n* Authoring and editing stream documentation within the Node.js project.\n* Reviewing changes to stream subclasses within the Node.js project.\n* Redirecting changes to streams from the Node.js project to this\n  project.\n* Assisting in the implementation of stream providers within Node.js.\n* Recommending versions of `readable-stream` to be included in Node.js.\n* Messaging about the future of streams to give the community advance\n  notice of changes.\n\n<a name=\"members\"></a>\n## Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;\n  - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;\n  - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;\n  - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;\n* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) &lt;matteo.collina@gmail.com&gt;\n  - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E\n* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) &lt;shestak.irina@gmail.com&gt;\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nodejs/readable-stream.git"
+  },
+  "scripts": {
+    "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+    "cover": "nyc npm test",
+    "report": "nyc report --reporter=lcov",
+    "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js"
+  },
+  "version": "2.3.6"
+}
diff --git a/legacy-libs/grpc/node_modules/readable-stream/passthrough.js b/legacy-libs/grpc/node_modules/readable-stream/passthrough.js
new file mode 100644 (file)
index 0000000..ffd791d
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./readable').PassThrough
diff --git a/legacy-libs/grpc/node_modules/readable-stream/readable-browser.js b/legacy-libs/grpc/node_modules/readable-stream/readable-browser.js
new file mode 100644 (file)
index 0000000..e503725
--- /dev/null
@@ -0,0 +1,7 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/legacy-libs/grpc/node_modules/readable-stream/readable.js b/legacy-libs/grpc/node_modules/readable-stream/readable.js
new file mode 100644 (file)
index 0000000..ec89ec5
--- /dev/null
@@ -0,0 +1,19 @@
+var Stream = require('stream');
+if (process.env.READABLE_STREAM === 'disable' && Stream) {
+  module.exports = Stream;
+  exports = module.exports = Stream.Readable;
+  exports.Readable = Stream.Readable;
+  exports.Writable = Stream.Writable;
+  exports.Duplex = Stream.Duplex;
+  exports.Transform = Stream.Transform;
+  exports.PassThrough = Stream.PassThrough;
+  exports.Stream = Stream;
+} else {
+  exports = module.exports = require('./lib/_stream_readable.js');
+  exports.Stream = Stream || exports;
+  exports.Readable = exports;
+  exports.Writable = require('./lib/_stream_writable.js');
+  exports.Duplex = require('./lib/_stream_duplex.js');
+  exports.Transform = require('./lib/_stream_transform.js');
+  exports.PassThrough = require('./lib/_stream_passthrough.js');
+}
diff --git a/legacy-libs/grpc/node_modules/readable-stream/transform.js b/legacy-libs/grpc/node_modules/readable-stream/transform.js
new file mode 100644 (file)
index 0000000..b1baba2
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./readable').Transform
diff --git a/legacy-libs/grpc/node_modules/readable-stream/writable-browser.js b/legacy-libs/grpc/node_modules/readable-stream/writable-browser.js
new file mode 100644 (file)
index 0000000..ebdde6a
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_writable.js');
diff --git a/legacy-libs/grpc/node_modules/readable-stream/writable.js b/legacy-libs/grpc/node_modules/readable-stream/writable.js
new file mode 100644 (file)
index 0000000..3211a6f
--- /dev/null
@@ -0,0 +1,8 @@
+var Stream = require("stream")
+var Writable = require("./lib/_stream_writable.js")
+
+if (process.env.READABLE_STREAM === 'disable') {
+  module.exports = Stream && Stream.Writable || Writable
+} else {
+  module.exports = Writable
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/LICENSE b/legacy-libs/grpc/node_modules/rimraf/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/rimraf/README.md b/legacy-libs/grpc/node_modules/rimraf/README.md
new file mode 100644 (file)
index 0000000..423b8cf
--- /dev/null
@@ -0,0 +1,101 @@
+[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)
+
+The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
+
+Install with `npm install rimraf`, or just drop rimraf.js somewhere.
+
+## API
+
+`rimraf(f, [opts], callback)`
+
+The first parameter will be interpreted as a globbing pattern for files. If you
+want to disable globbing you can do so with `opts.disableGlob` (defaults to
+`false`). This might be handy, for instance, if you have filenames that contain
+globbing wildcard characters.
+
+The callback will be called with an error if there is one.  Certain
+errors are handled for you:
+
+* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
+  `opts.maxBusyTries` times before giving up, adding 100ms of wait
+  between each attempt.  The default `maxBusyTries` is 3.
+* `ENOENT` - If the file doesn't exist, rimraf will return
+  successfully, since your desired outcome is already the case.
+* `EMFILE` - Since `readdir` requires opening a file descriptor, it's
+  possible to hit `EMFILE` if too many file descriptors are in use.
+  In the sync case, there's nothing to be done for this.  But in the
+  async case, rimraf will gradually back off with timeouts up to
+  `opts.emfileWait` ms, which defaults to 1000.
+
+## options
+
+* unlink, chmod, stat, lstat, rmdir, readdir,
+  unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
+
+    In order to use a custom file system library, you can override
+    specific fs functions on the options object.
+
+    If any of these functions are present on the options object, then
+    the supplied function will be used instead of the default fs
+    method.
+
+    Sync methods are only relevant for `rimraf.sync()`, of course.
+
+    For example:
+
+    ```javascript
+    var myCustomFS = require('some-custom-fs')
+
+    rimraf('some-thing', myCustomFS, callback)
+    ```
+
+* maxBusyTries
+
+    If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered
+    on Windows systems, then rimraf will retry with a linear backoff
+    wait of 100ms longer on each try.  The default maxBusyTries is 3.
+
+    Only relevant for async usage.
+
+* emfileWait
+
+    If an `EMFILE` error is encountered, then rimraf will retry
+    repeatedly with a linear backoff of 1ms longer on each try, until
+    the timeout counter hits this max.  The default limit is 1000.
+
+    If you repeatedly encounter `EMFILE` errors, then consider using
+    [graceful-fs](http://npm.im/graceful-fs) in your program.
+
+    Only relevant for async usage.
+
+* glob
+
+    Set to `false` to disable [glob](http://npm.im/glob) pattern
+    matching.
+
+    Set to an object to pass options to the glob module.  The default
+    glob options are `{ nosort: true, silent: true }`.
+
+    Glob version 6 is used in this module.
+
+    Relevant for both sync and async usage.
+
+* disableGlob
+
+    Set to any non-falsey value to disable globbing entirely.
+    (Equivalent to setting `glob: false`.)
+
+## rimraf.sync
+
+It can remove stuff synchronously, too.  But that's not so good.  Use
+the async API.  It's better.
+
+## CLI
+
+If installed with `npm install rimraf -g` it can be used as a global
+command `rimraf <path> [<path> ...]` which is useful for cross platform support.
+
+## mkdirp
+
+If you need to create a directory recursively, check out
+[mkdirp](https://github.com/substack/node-mkdirp).
diff --git a/legacy-libs/grpc/node_modules/rimraf/bin.js b/legacy-libs/grpc/node_modules/rimraf/bin.js
new file mode 100644 (file)
index 0000000..0d1e17b
--- /dev/null
@@ -0,0 +1,50 @@
+#!/usr/bin/env node
+
+var rimraf = require('./')
+
+var help = false
+var dashdash = false
+var noglob = false
+var args = process.argv.slice(2).filter(function(arg) {
+  if (dashdash)
+    return !!arg
+  else if (arg === '--')
+    dashdash = true
+  else if (arg === '--no-glob' || arg === '-G')
+    noglob = true
+  else if (arg === '--glob' || arg === '-g')
+    noglob = false
+  else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
+    help = true
+  else
+    return !!arg
+})
+
+if (help || args.length === 0) {
+  // If they didn't ask for help, then this is not a "success"
+  var log = help ? console.log : console.error
+  log('Usage: rimraf <path> [<path> ...]')
+  log('')
+  log('  Deletes all files and folders at "path" recursively.')
+  log('')
+  log('Options:')
+  log('')
+  log('  -h, --help     Display this usage info')
+  log('  -G, --no-glob  Do not expand glob patterns in arguments')
+  log('  -g, --glob     Expand glob patterns in arguments (default)')
+  process.exit(help ? 0 : 1)
+} else
+  go(0)
+
+function go (n) {
+  if (n >= args.length)
+    return
+  var options = {}
+  if (noglob)
+    options = { glob: false }
+  rimraf(args[n], options, function (er) {
+    if (er)
+      throw er
+    go(n+1)
+  })
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/LICENSE b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/LICENSE
new file mode 100644 (file)
index 0000000..42ca266
--- /dev/null
@@ -0,0 +1,21 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+## Glob Logo
+
+Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
+under a Creative Commons Attribution-ShareAlike 4.0 International License
+https://creativecommons.org/licenses/by-sa/4.0/
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/README.md b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/README.md
new file mode 100644 (file)
index 0000000..e71b967
--- /dev/null
@@ -0,0 +1,373 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript.  It uses the `minimatch`
+library to do its matching.
+
+![](logo/glob.png)
+
+## Usage
+
+Install with npm
+
+```
+npm i glob
+```
+
+```javascript
+var glob = require("glob")
+
+// options is optional
+glob("**/*.js", options, function (er, files) {
+  // files is an array of filenames.
+  // If the `nonull` option is set, and nothing
+  // was found, then files is ["**/*.js"]
+  // er is an error object or null.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set.  Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within.  Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+  If the first character of the range is `!` or `^` then it matches
+  any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+  any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+  patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+  patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+  provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+  zero or more directories and subdirectories searching for matches.
+  It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename.  For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned.  This
+differs from the shell, where the pattern itself is returned.  For
+example:
+
+    $ echo a*s*d*f
+    a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results.  If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## glob(pattern, [options], cb)
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* `cb` `{Function}`
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Perform an asynchronous glob search.
+
+## glob.sync(pattern, [options])
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* return: `{Array<String>}` filenames found matching the pattern
+
+Perform a synchronous glob search.
+
+## Class: glob.Glob
+
+Create a Glob object by instantiating the `glob.Glob` class.
+
+```javascript
+var Glob = require("glob").Glob
+var mg = new Glob(pattern, options, cb)
+```
+
+It's an EventEmitter, and starts walking the filesystem to find matches
+immediately.
+
+### new glob.Glob(pattern, [options], [cb])
+
+* `pattern` `{String}` pattern to search for
+* `options` `{Object}`
+* `cb` `{Function}` Called when an error occurs, or matches are found
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Note that if the `sync` flag is set in the options, then matches will
+be immediately available on the `g.found` member.
+
+### Properties
+
+* `minimatch` The minimatch object that the glob uses.
+* `options` The options object passed in.
+* `aborted` Boolean which is set to true when calling `abort()`.  There
+  is no way at this time to continue a glob search after aborting, but
+  you can re-use the statCache to avoid having to duplicate syscalls.
+* `cache` Convenience object.  Each field has the following possible
+  values:
+  * `false` - Path does not exist
+  * `true` - Path exists
+  * `'FILE'` - Path exists, and is not a directory
+  * `'DIR'` - Path exists, and is a directory
+  * `[file, entries, ...]` - Path exists, is a directory, and the
+    array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+  path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+  relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+  to minimize unnecessary syscalls.  It is stored on the instantiated
+  Glob object, and may be re-used.
+
+### Events
+
+* `end` When the matching is finished, this is emitted with all the
+  matches found.  If the `nonull` option is set, and no match was found,
+  then the `matches` list contains the original pattern.  The matches
+  are sorted, unless the `nosort` flag is set.
+* `match` Every time a match is found, this is emitted with the specific
+  thing that matched. It is not deduplicated or resolved to a realpath.
+* `error` Emitted when an unexpected error is encountered, or whenever
+  any fs error occurs if `options.strict` is set.
+* `abort` When `abort()` is called, this event is raised.
+
+### Methods
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### Options
+
+All the options that can be passed to Minimatch can also be passed to
+Glob to change pattern matching behavior.  Also, some have been added,
+or have glob-specific ramifications.
+
+All options are false by default, unless otherwise noted.
+
+All options are added to the Glob object, as well.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls.  At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `cwd` The current working directory in which to search.  Defaults
+  to `process.cwd()`.
+* `root` The place where patterns starting with `/` will be mounted
+  onto.  Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
+  systems, and `C:\` or some such on Windows.)
+* `dot` Include `.dot` files in normal matches and `globstar` matches.
+  Note that an explicit dot in a portion of the pattern will always
+  match dot files.
+* `nomount` By default, a pattern starting with a forward-slash will be
+  "mounted" onto the root setting, so that a valid filesystem path is
+  returned.  Set this flag to disable that behavior.
+* `mark` Add a `/` character to directory matches.  Note that this
+  requires additional stat calls.
+* `nosort` Don't sort the results.
+* `stat` Set to true to stat *all* results.  This reduces performance
+  somewhat, and is completely unnecessary, unless `readdir` is presumed
+  to be an untrustworthy indicator of file existence.
+* `silent` When an unusual error is encountered when attempting to
+  read a directory, a warning will be printed to stderr.  Set the
+  `silent` option to true to suppress these warnings.
+* `strict` When an unusual error is encountered when attempting to
+  read a directory, the process will just continue on in search of
+  other matches.  Set the `strict` option to raise an error in these
+  cases.
+* `cache` See `cache` property above.  Pass in a previously generated
+  cache object to save some fs calls.
+* `statCache` A cache of results of filesystem information, to prevent
+  unnecessary stat calls.  While it should not normally be necessary
+  to set this, you may pass the statCache from one glob() call to the
+  options object of another, if you know that the filesystem will not
+  change between calls.  (See "Race Conditions" below.)
+* `symlinks` A cache of known symbolic links.  You may pass in a
+  previously generated `symlinks` object to save `lstat` calls when
+  resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `nounique` In some cases, brace-expanded patterns can result in the
+  same file showing up multiple times in the result set.  By default,
+  this implementation prevents duplicates in the result set.  Set this
+  flag to disable that behavior.
+* `nonull` Set to never return an empty set, instead returning a set
+  containing the pattern itself.  This is the default in glob(3).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames.  (Ie,
+  treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match.  Note: on
+  case-insensitive filesystems, non-magic patterns will match by
+  default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+  contain any slash characters.  That is, `*.js` would be treated as
+  equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files.  (Note: to match
+  *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+  Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+  of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+  Note that this can result in a lot of duplicate references in the
+  presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+  In the case of a symlink that cannot be resolved, the full absolute
+  path to the matched entry is returned (though it will usually be a
+  broken symlink)
+* `absolute` Set to true to always receive absolute paths for matched
+  files.  Unlike `realpath`, this also affects the values returned in
+  the `match` event.
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between node-glob and other
+implementations, and are intentional.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.3, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+Note that symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern.  This prevents infinite loops and duplicates and the like.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then glob returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## Windows
+
+**Please only use forward-slashes in glob expressions.**
+
+Though windows uses either `/` or `\` as its path separator, only `/`
+characters are used by this glob implementation.  You must use
+forward-slashes **only** in glob expressions.  Back-slashes will always
+be interpreted as escape characters, not path separators.
+
+Results from absolute patterns such as `/foo/*` are mounted onto the
+root setting using `path.join`.  On windows, this will by default result
+in `/foo/*` matching `C:\foo\bar.txt`.
+
+## Race Conditions
+
+Glob searching, by its very nature, is susceptible to race conditions,
+since it relies on directory walking and such.
+
+As a result, it is possible that a file that exists when glob looks for
+it may have been deleted or modified by the time it returns the result.
+
+As part of its internal implementation, this program caches all stat
+and readdir calls that it makes, in order to cut down on system
+overhead.  However, this also makes it even more susceptible to races,
+especially if the cache or statCache objects are reused between glob
+calls.
+
+Users are thus advised not to use a glob result as a guarantee of
+filesystem state in the face of rapid changes.  For the vast majority
+of operations, this is never a problem.
+
+## Glob Logo
+Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo).
+
+The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/changelog.md b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/changelog.md
new file mode 100644 (file)
index 0000000..4163677
--- /dev/null
@@ -0,0 +1,67 @@
+## 7.0
+
+- Raise error if `options.cwd` is specified, and not a directory
+
+## 6.0
+
+- Remove comment and negation pattern support
+- Ignore patterns are always in `dot:true` mode
+
+## 5.0
+
+- Deprecate comment and negation patterns
+- Fix regression in `mark` and `nodir` options from making all cache
+  keys absolute path.
+- Abort if `fs.readdir` returns an error that's unexpected
+- Don't emit `match` events for ignored items
+- Treat ENOTSUP like ENOTDIR in readdir
+
+## 4.5
+
+- Add `options.follow` to always follow directory symlinks in globstar
+- Add `options.realpath` to call `fs.realpath` on all results
+- Always cache based on absolute path
+
+## 4.4
+
+- Add `options.ignore`
+- Fix handling of broken symlinks
+
+## 4.3
+
+- Bump minimatch to 2.x
+- Pass all tests on Windows
+
+## 4.2
+
+- Add `glob.hasMagic` function
+- Add `options.nodir` flag
+
+## 4.1
+
+- Refactor sync and async implementations for performance
+- Throw if callback provided to sync glob function
+- Treat symbolic links in globstar results the same as Bash 4.3
+
+## 4.0
+
+- Use `^` for dependency versions (bumped major because this breaks
+  older npm versions)
+- Ensure callbacks are only ever called once
+- switch to ISC license
+
+## 3.x
+
+- Rewrite in JavaScript
+- Add support for setting root, cwd, and windows support
+- Cache many fs calls
+- Add globstar support
+- emit match events
+
+## 2.x
+
+- Use `glob.h` and `fnmatch.h` from NetBSD
+
+## 1.x
+
+- `glob.h` static binding.
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/common.js b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/common.js
new file mode 100644 (file)
index 0000000..66651bb
--- /dev/null
@@ -0,0 +1,240 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+  return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+  return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+  return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+  self.ignore = options.ignore || []
+
+  if (!Array.isArray(self.ignore))
+    self.ignore = [self.ignore]
+
+  if (self.ignore.length) {
+    self.ignore = self.ignore.map(ignoreMap)
+  }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+  var gmatcher = null
+  if (pattern.slice(-3) === '/**') {
+    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+    gmatcher = new Minimatch(gpattern, { dot: true })
+  }
+
+  return {
+    matcher: new Minimatch(pattern, { dot: true }),
+    gmatcher: gmatcher
+  }
+}
+
+function setopts (self, pattern, options) {
+  if (!options)
+    options = {}
+
+  // base-matching: just use globstar for that.
+  if (options.matchBase && -1 === pattern.indexOf("/")) {
+    if (options.noglobstar) {
+      throw new Error("base matching requires globstar")
+    }
+    pattern = "**/" + pattern
+  }
+
+  self.silent = !!options.silent
+  self.pattern = pattern
+  self.strict = options.strict !== false
+  self.realpath = !!options.realpath
+  self.realpathCache = options.realpathCache || Object.create(null)
+  self.follow = !!options.follow
+  self.dot = !!options.dot
+  self.mark = !!options.mark
+  self.nodir = !!options.nodir
+  if (self.nodir)
+    self.mark = true
+  self.sync = !!options.sync
+  self.nounique = !!options.nounique
+  self.nonull = !!options.nonull
+  self.nosort = !!options.nosort
+  self.nocase = !!options.nocase
+  self.stat = !!options.stat
+  self.noprocess = !!options.noprocess
+  self.absolute = !!options.absolute
+
+  self.maxLength = options.maxLength || Infinity
+  self.cache = options.cache || Object.create(null)
+  self.statCache = options.statCache || Object.create(null)
+  self.symlinks = options.symlinks || Object.create(null)
+
+  setupIgnores(self, options)
+
+  self.changedCwd = false
+  var cwd = process.cwd()
+  if (!ownProp(options, "cwd"))
+    self.cwd = cwd
+  else {
+    self.cwd = path.resolve(options.cwd)
+    self.changedCwd = self.cwd !== cwd
+  }
+
+  self.root = options.root || path.resolve(self.cwd, "/")
+  self.root = path.resolve(self.root)
+  if (process.platform === "win32")
+    self.root = self.root.replace(/\\/g, "/")
+
+  // TODO: is an absolute `cwd` supposed to be resolved against `root`?
+  // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
+  self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
+  if (process.platform === "win32")
+    self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
+  self.nomount = !!options.nomount
+
+  // disable comments and negation in Minimatch.
+  // Note that they are not supported in Glob itself anyway.
+  options.nonegate = true
+  options.nocomment = true
+
+  self.minimatch = new Minimatch(pattern, options)
+  self.options = self.minimatch.options
+}
+
+function finish (self) {
+  var nou = self.nounique
+  var all = nou ? [] : Object.create(null)
+
+  for (var i = 0, l = self.matches.length; i < l; i ++) {
+    var matches = self.matches[i]
+    if (!matches || Object.keys(matches).length === 0) {
+      if (self.nonull) {
+        // do like the shell, and spit out the literal glob
+        var literal = self.minimatch.globSet[i]
+        if (nou)
+          all.push(literal)
+        else
+          all[literal] = true
+      }
+    } else {
+      // had matches
+      var m = Object.keys(matches)
+      if (nou)
+        all.push.apply(all, m)
+      else
+        m.forEach(function (m) {
+          all[m] = true
+        })
+    }
+  }
+
+  if (!nou)
+    all = Object.keys(all)
+
+  if (!self.nosort)
+    all = all.sort(self.nocase ? alphasorti : alphasort)
+
+  // at *some* point we statted all of these
+  if (self.mark) {
+    for (var i = 0; i < all.length; i++) {
+      all[i] = self._mark(all[i])
+    }
+    if (self.nodir) {
+      all = all.filter(function (e) {
+        var notDir = !(/\/$/.test(e))
+        var c = self.cache[e] || self.cache[makeAbs(self, e)]
+        if (notDir && c)
+          notDir = c !== 'DIR' && !Array.isArray(c)
+        return notDir
+      })
+    }
+  }
+
+  if (self.ignore.length)
+    all = all.filter(function(m) {
+      return !isIgnored(self, m)
+    })
+
+  self.found = all
+}
+
+function mark (self, p) {
+  var abs = makeAbs(self, p)
+  var c = self.cache[abs]
+  var m = p
+  if (c) {
+    var isDir = c === 'DIR' || Array.isArray(c)
+    var slash = p.slice(-1) === '/'
+
+    if (isDir && !slash)
+      m += '/'
+    else if (!isDir && slash)
+      m = m.slice(0, -1)
+
+    if (m !== p) {
+      var mabs = makeAbs(self, m)
+      self.statCache[mabs] = self.statCache[abs]
+      self.cache[mabs] = self.cache[abs]
+    }
+  }
+
+  return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+  var abs = f
+  if (f.charAt(0) === '/') {
+    abs = path.join(self.root, f)
+  } else if (isAbsolute(f) || f === '') {
+    abs = f
+  } else if (self.changedCwd) {
+    abs = path.resolve(self.cwd, f)
+  } else {
+    abs = path.resolve(f)
+  }
+
+  if (process.platform === 'win32')
+    abs = abs.replace(/\\/g, '/')
+
+  return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
+
+function childrenIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/glob.js b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/glob.js
new file mode 100644 (file)
index 0000000..58dec0f
--- /dev/null
@@ -0,0 +1,790 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together.  This is PREFIX.
+//   If there is no more remaining, then stat(PREFIX) and
+//   add to matches if it succeeds.  END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+//   set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+//   If fail, END
+//
+// with ENTRIES
+//   If pattern[n] is GLOBSTAR
+//     // handle the case where the globstar match is empty
+//     // by pruning it out, and testing the resulting pattern
+//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+//     // handle other cases.
+//     for ENTRY in ENTRIES (not dotfiles)
+//       // attach globstar + tail onto the entry
+//       // Mark that this entry is a globstar match
+//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+//   else // not globstar
+//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+//       Test ENTRY against pattern[n]
+//       If fails, continue
+//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+//   Cache all stats and readdirs results to minimize syscall.  Since all
+//   we ever care about is existence and directory-ness, we can just keep
+//   `true` for files, and [children,...] for directories, or `false` for
+//   things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var rp = require('fs.realpath')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+  if (typeof options === 'function') cb = options, options = {}
+  if (!options) options = {}
+
+  if (options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return globSync(pattern, options)
+  }
+
+  return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+  if (add === null || typeof add !== 'object') {
+    return origin
+  }
+
+  var keys = Object.keys(add)
+  var i = keys.length
+  while (i--) {
+    origin[keys[i]] = add[keys[i]]
+  }
+  return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+  var options = extend({}, options_)
+  options.noprocess = true
+
+  var g = new Glob(pattern, options)
+  var set = g.minimatch.set
+
+  if (!pattern)
+    return false
+
+  if (set.length > 1)
+    return true
+
+  for (var j = 0; j < set[0].length; j++) {
+    if (typeof set[0][j] !== 'string')
+      return true
+  }
+
+  return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = null
+  }
+
+  if (options && options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return new GlobSync(pattern, options)
+  }
+
+  if (!(this instanceof Glob))
+    return new Glob(pattern, options, cb)
+
+  setopts(this, pattern, options)
+  this._didRealPath = false
+
+  // process each pattern in the minimatch set
+  var n = this.minimatch.set.length
+
+  // The matches are stored as {<filename>: true,...} so that
+  // duplicates are automagically pruned.
+  // Later, we do an Object.keys() on these.
+  // Keep them as a list so we can fill in when nonull is set.
+  this.matches = new Array(n)
+
+  if (typeof cb === 'function') {
+    cb = once(cb)
+    this.on('error', cb)
+    this.on('end', function (matches) {
+      cb(null, matches)
+    })
+  }
+
+  var self = this
+  this._processing = 0
+
+  this._emitQueue = []
+  this._processQueue = []
+  this.paused = false
+
+  if (this.noprocess)
+    return this
+
+  if (n === 0)
+    return done()
+
+  var sync = true
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false, done)
+  }
+  sync = false
+
+  function done () {
+    --self._processing
+    if (self._processing <= 0) {
+      if (sync) {
+        process.nextTick(function () {
+          self._finish()
+        })
+      } else {
+        self._finish()
+      }
+    }
+  }
+}
+
+Glob.prototype._finish = function () {
+  assert(this instanceof Glob)
+  if (this.aborted)
+    return
+
+  if (this.realpath && !this._didRealpath)
+    return this._realpath()
+
+  common.finish(this)
+  this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+  if (this._didRealpath)
+    return
+
+  this._didRealpath = true
+
+  var n = this.matches.length
+  if (n === 0)
+    return this._finish()
+
+  var self = this
+  for (var i = 0; i < this.matches.length; i++)
+    this._realpathSet(i, next)
+
+  function next () {
+    if (--n === 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+  var matchset = this.matches[index]
+  if (!matchset)
+    return cb()
+
+  var found = Object.keys(matchset)
+  var self = this
+  var n = found.length
+
+  if (n === 0)
+    return cb()
+
+  var set = this.matches[index] = Object.create(null)
+  found.forEach(function (p, i) {
+    // If there's a problem with the stat, then it means that
+    // one or more of the links in the realpath couldn't be
+    // resolved.  just return the abs value in that case.
+    p = self._makeAbs(p)
+    rp.realpath(p, self.realpathCache, function (er, real) {
+      if (!er)
+        set[real] = true
+      else if (er.syscall === 'stat')
+        set[p] = true
+      else
+        self.emit('error', er) // srsly wtf right here
+
+      if (--n === 0) {
+        self.matches[index] = set
+        cb()
+      }
+    })
+  })
+}
+
+Glob.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+  this.aborted = true
+  this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+  if (!this.paused) {
+    this.paused = true
+    this.emit('pause')
+  }
+}
+
+Glob.prototype.resume = function () {
+  if (this.paused) {
+    this.emit('resume')
+    this.paused = false
+    if (this._emitQueue.length) {
+      var eq = this._emitQueue.slice(0)
+      this._emitQueue.length = 0
+      for (var i = 0; i < eq.length; i ++) {
+        var e = eq[i]
+        this._emitMatch(e[0], e[1])
+      }
+    }
+    if (this._processQueue.length) {
+      var pq = this._processQueue.slice(0)
+      this._processQueue.length = 0
+      for (var i = 0; i < pq.length; i ++) {
+        var p = pq[i]
+        this._processing--
+        this._process(p[0], p[1], p[2], p[3])
+      }
+    }
+  }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+  assert(this instanceof Glob)
+  assert(typeof cb === 'function')
+
+  if (this.aborted)
+    return
+
+  this._processing++
+  if (this.paused) {
+    this._processQueue.push([pattern, index, inGlobStar, cb])
+    return
+  }
+
+  //console.error('PROCESS %d', this._processing, pattern)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // see if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index, cb)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip _processing
+  if (childrenIgnored(this, read))
+    return cb()
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return cb()
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return cb()
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return cb()
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix) {
+      if (prefix !== '/')
+        e = prefix + '/' + e
+      else
+        e = prefix + e
+    }
+    this._process([e].concat(remain), index, inGlobStar, cb)
+  }
+  cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+  if (this.aborted)
+    return
+
+  if (isIgnored(this, e))
+    return
+
+  if (this.paused) {
+    this._emitQueue.push([index, e])
+    return
+  }
+
+  var abs = isAbsolute(e) ? e : this._makeAbs(e)
+
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.absolute)
+    e = abs
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+
+  var st = this.statCache[abs]
+  if (st)
+    this.emit('stat', e, st)
+
+  this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+  if (this.aborted)
+    return
+
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false, cb)
+
+  var lstatkey = 'lstat\0' + abs
+  var self = this
+  var lstatcb = inflight(lstatkey, lstatcb_)
+
+  if (lstatcb)
+    fs.lstat(abs, lstatcb)
+
+  function lstatcb_ (er, lstat) {
+    if (er && er.code === 'ENOENT')
+      return cb()
+
+    var isSym = lstat && lstat.isSymbolicLink()
+    self.symlinks[abs] = isSym
+
+    // If it's not a symlink or a dir, then it's definitely a regular file.
+    // don't bother doing a readdir in that case.
+    if (!isSym && lstat && !lstat.isDirectory()) {
+      self.cache[abs] = 'FILE'
+      cb()
+    } else
+      self._readdir(abs, false, cb)
+  }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+  if (this.aborted)
+    return
+
+  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+  if (!cb)
+    return
+
+  //console.error('RD %j %j', +inGlobStar, abs)
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs, cb)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return cb()
+
+    if (Array.isArray(c))
+      return cb(null, c)
+  }
+
+  var self = this
+  fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+  return function (er, entries) {
+    if (er)
+      self._readdirError(abs, er, cb)
+    else
+      self._readdirEntries(abs, entries, cb)
+  }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+  if (this.aborted)
+    return
+
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+  return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+  if (this.aborted)
+    return
+
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      var abs = this._makeAbs(f)
+      this.cache[abs] = 'FILE'
+      if (abs === this.cwdAbs) {
+        var error = new Error(er.code + ' invalid cwd ' + this.cwd)
+        error.path = this.cwd
+        error.code = er.code
+        this.emit('error', error)
+        this.abort()
+      }
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict) {
+        this.emit('error', er)
+        // If the error is handled, then we abort
+        // if not, we threw out of here
+        this.abort()
+      }
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+
+  return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+  //console.error('pgs2', prefix, remain[0], entries)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return cb()
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false, cb)
+
+  var isSym = this.symlinks[abs]
+  var len = entries.length
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return cb()
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true, cb)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true, cb)
+  }
+
+  cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var self = this
+  this._stat(prefix, function (er, exists) {
+    self._processSimple2(prefix, index, er, exists, cb)
+  })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+  //console.error('ps2', prefix, exists)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return cb()
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+  cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return cb()
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return cb(null, c)
+
+    if (needDir && c === 'FILE')
+      return cb()
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (stat !== undefined) {
+    if (stat === false)
+      return cb(null, stat)
+    else {
+      var type = stat.isDirectory() ? 'DIR' : 'FILE'
+      if (needDir && type === 'FILE')
+        return cb()
+      else
+        return cb(null, type, stat)
+    }
+  }
+
+  var self = this
+  var statcb = inflight('stat\0' + abs, lstatcb_)
+  if (statcb)
+    fs.lstat(abs, statcb)
+
+  function lstatcb_ (er, lstat) {
+    if (lstat && lstat.isSymbolicLink()) {
+      // If it's a symlink, then treat it as the target, unless
+      // the target does not exist, then treat it as a file.
+      return fs.stat(abs, function (er, stat) {
+        if (er)
+          self._stat2(f, abs, null, lstat, cb)
+        else
+          self._stat2(f, abs, er, stat, cb)
+      })
+    } else {
+      self._stat2(f, abs, er, lstat, cb)
+    }
+  }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+  if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
+    this.statCache[abs] = false
+    return cb()
+  }
+
+  var needDir = f.slice(-1) === '/'
+  this.statCache[abs] = stat
+
+  if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
+    return cb(null, false, stat)
+
+  var c = true
+  if (stat)
+    c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c === 'FILE')
+    return cb()
+
+  return cb(null, c, stat)
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/package.json b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/package.json
new file mode 100644 (file)
index 0000000..02962a6
--- /dev/null
@@ -0,0 +1,80 @@
+{
+  "_from": "glob@^7.1.3",
+  "_id": "glob@7.1.4",
+  "_inBundle": false,
+  "_integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
+  "_location": "/grpc/rimraf/glob",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "glob@^7.1.3",
+    "name": "glob",
+    "escapedName": "glob",
+    "rawSpec": "^7.1.3",
+    "saveSpec": null,
+    "fetchSpec": "^7.1.3"
+  },
+  "_requiredBy": [
+    "/grpc/rimraf"
+  ],
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
+  "_shasum": "aa608a2f6c577ad357e1ae5a5c26d9a8d1969255",
+  "_shrinkwrap": null,
+  "_spec": "glob@^7.1.3",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/rimraf",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/node-glob/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "fs.realpath": "^1.0.0",
+    "inflight": "^1.0.4",
+    "inherits": "2",
+    "minimatch": "^3.0.4",
+    "once": "^1.3.0",
+    "path-is-absolute": "^1.0.0"
+  },
+  "deprecated": false,
+  "description": "a little globber",
+  "devDependencies": {
+    "mkdirp": "0",
+    "rimraf": "^2.2.8",
+    "tap": "^12.0.1",
+    "tick": "0.0.6"
+  },
+  "engines": {
+    "node": "*"
+  },
+  "files": [
+    "glob.js",
+    "sync.js",
+    "common.js"
+  ],
+  "homepage": "https://github.com/isaacs/node-glob#readme",
+  "license": "ISC",
+  "main": "glob.js",
+  "name": "glob",
+  "optionalDependencies": {},
+  "readme": "# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\n[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)\n\nThis is a glob implementation in JavaScript.  It uses the `minimatch`\nlibrary to do its matching.\n\n![](logo/glob.png)\n\n## Usage\n\nInstall with npm\n\n```\nnpm i glob\n```\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n  // files is an array of filenames.\n  // If the `nonull` option is set, and nothing\n  // was found, then files is [\"**/*.js\"]\n  // er is an error object or null.\n})\n```\n\n## Glob Primer\n\n\"Globs\" are the patterns you type when you do stuff like `ls *.js` on\nthe command line, or put `build/*` in a `.gitignore` file.\n\nBefore parsing the path part patterns, braced sections are expanded\ninto a set.  Braced sections start with `{` and end with `}`, with any\nnumber of comma-delimited sections within.  Braced sections may contain\nslash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.\n\nThe following characters have special magic meaning when used in a\npath portion:\n\n* `*` Matches 0 or more characters in a single path portion\n* `?` Matches 1 character\n* `[...]` Matches a range of characters, similar to a RegExp range.\n  If the first character of the range is `!` or `^` then it matches\n  any character not in the range.\n* `!(pattern|pattern|pattern)` Matches anything that does not match\n  any of the patterns provided.\n* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the\n  patterns provided.\n* `+(pattern|pattern|pattern)` Matches one or more occurrences of the\n  patterns provided.\n* `*(a|b|c)` Matches zero or more occurrences of the patterns provided\n* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns\n  provided\n* `**` If a \"globstar\" is alone in a path portion, then it matches\n  zero or more directories and subdirectories searching for matches.\n  It does not crawl symlinked directories.\n\n### Dots\n\nIf a file or directory path portion has a `.` as the first character,\nthen it will not match any glob pattern unless that pattern's\ncorresponding path part also has a `.` as its first character.\n\nFor example, the pattern `a/.*/c` would match the file at `a/.b/c`.\nHowever the pattern `a/*/c` would not, because `*` does not start with\na dot character.\n\nYou can make glob treat dots as normal characters by setting\n`dot:true` in the options.\n\n### Basename Matching\n\nIf you set `matchBase:true` in the options, and the pattern has no\nslashes in it, then it will seek for any file anywhere in the tree\nwith a matching basename.  For example, `*.js` would match\n`test/simple/basic.js`.\n\n### Empty Sets\n\nIf no matching files are found, then an empty array is returned.  This\ndiffers from the shell, where the pattern itself is returned.  For\nexample:\n\n    $ echo a*s*d*f\n    a*s*d*f\n\nTo get the bash-style behavior, set the `nonull:true` in the options.\n\n### See Also:\n\n* `man sh`\n* `man bash` (Search for \"Pattern Matching\")\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob.hasMagic(pattern, [options])\n\nReturns `true` if there are any special characters in the pattern, and\n`false` otherwise.\n\nNote that the options affect the results.  If `noext:true` is set in\nthe options object, then `+(a|b)` will not be considered a magic\npattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`\nthen that is considered magical, unless `nobrace:true` is set in the\noptions.\n\n## glob(pattern, [options], cb)\n\n* `pattern` `{String}` Pattern to be matched\n* `options` `{Object}`\n* `cb` `{Function}`\n  * `err` `{Error | null}`\n  * `matches` `{Array<String>}` filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` `{String}` Pattern to be matched\n* `options` `{Object}`\n* return: `{Array<String>}` filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instantiating the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` `{String}` pattern to search for\n* `options` `{Object}`\n* `cb` `{Function}` Called when an error occurs, or matches are found\n  * `err` `{Error | null}`\n  * `matches` `{Array<String>}` filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `aborted` Boolean which is set to true when calling `abort()`.  There\n  is no way at this time to continue a glob search after aborting, but\n  you can re-use the statCache to avoid having to duplicate syscalls.\n* `cache` Convenience object.  Each field has the following possible\n  values:\n  * `false` - Path does not exist\n  * `true` - Path exists\n  * `'FILE'` - Path exists, and is not a directory\n  * `'DIR'` - Path exists, and is a directory\n  * `[file, entries, ...]` - Path exists, is a directory, and the\n    array value is the results of `fs.readdir`\n* `statCache` Cache of `fs.stat` results, to prevent statting the same\n  path multiple times.\n* `symlinks` A record of which paths are symbolic links, which is\n  relevant in resolving `**` patterns.\n* `realpathCache` An optional object which is passed to `fs.realpath`\n  to minimize unnecessary syscalls.  It is stored on the instantiated\n  Glob object, and may be re-used.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n  matches found.  If the `nonull` option is set, and no match was found,\n  then the `matches` list contains the original pattern.  The matches\n  are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the specific\n  thing that matched. It is not deduplicated or resolved to a realpath.\n* `error` Emitted when an unexpected error is encountered, or whenever\n  any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `pause` Temporarily stop the search\n* `resume` Resume the search\n* `abort` Stop the search forever\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior.  Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the Glob object, as well.\n\nIf you are running many `glob` operations, you can pass a Glob object\nas the `options` argument to a subsequent operation to shortcut some\n`stat` and `readdir` calls.  At the very least, you may pass in shared\n`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that\nparallel glob operations will be sped up by sharing information about\nthe filesystem.\n\n* `cwd` The current working directory in which to search.  Defaults\n  to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n  onto.  Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n  systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n  Note that an explicit dot in a portion of the pattern will always\n  match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n  \"mounted\" onto the root setting, so that a valid filesystem path is\n  returned.  Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches.  Note that this\n  requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results.  This reduces performance\n  somewhat, and is completely unnecessary, unless `readdir` is presumed\n  to be an untrustworthy indicator of file existence.\n* `silent` When an unusual error is encountered when attempting to\n  read a directory, a warning will be printed to stderr.  Set the\n  `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered when attempting to\n  read a directory, the process will just continue on in search of\n  other matches.  Set the `strict` option to raise an error in these\n  cases.\n* `cache` See `cache` property above.  Pass in a previously generated\n  cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n  unnecessary stat calls.  While it should not normally be necessary\n  to set this, you may pass the statCache from one glob() call to the\n  options object of another, if you know that the filesystem will not\n  change between calls.  (See \"Race Conditions\" below.)\n* `symlinks` A cache of known symbolic links.  You may pass in a\n  previously generated `symlinks` object to save `lstat` calls when\n  resolving `**` matches.\n* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.\n* `nounique` In some cases, brace-expanded patterns can result in the\n  same file showing up multiple times in the result set.  By default,\n  this implementation prevents duplicates in the result set.  Set this\n  flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n  containing the pattern itself.  This is the default in glob(3).\n* `debug` Set to enable debug logging in minimatch and glob.\n* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.\n* `noglobstar` Do not match `**` against multiple filenames.  (Ie,\n  treat it as a normal `*` instead.)\n* `noext` Do not match `+(a|b)` \"extglob\" patterns.\n* `nocase` Perform a case-insensitive match.  Note: on\n  case-insensitive filesystems, non-magic patterns will match by\n  default, since `stat` and `readdir` will not raise errors.\n* `matchBase` Perform a basename-only match if the pattern does not\n  contain any slash characters.  That is, `*.js` would be treated as\n  equivalent to `**/*.js`, matching all js files in all directories.\n* `nodir` Do not match directories, only files.  (Note: to match\n  *only* directories, simply put a `/` at the end of the pattern.)\n* `ignore` Add a pattern or an array of glob patterns to exclude matches.\n  Note: `ignore` patterns are *always* in `dot:true` mode, regardless\n  of any other settings.\n* `follow` Follow symlinked directories when expanding `**` patterns.\n  Note that this can result in a lot of duplicate references in the\n  presence of cyclic links.\n* `realpath` Set to true to call `fs.realpath` on all of the results.\n  In the case of a symlink that cannot be resolved, the full absolute\n  path to the matched entry is returned (though it will usually be a\n  broken symlink)\n* `absolute` Set to true to always receive absolute paths for matched\n  files.  Unlike `realpath`, this also affects the values returned in\n  the `match` event.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set.  This is supported in the manner of bsdglob\nand bash 4.3, where `**` only has special significance if it is the only\nthing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nNote that symlinked directories are not crawled as part of a `**`,\nthough their contents may match against subsequent portions of the\npattern.  This prevents infinite loops and duplicates and the like.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes.  For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`.  This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern.  Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity.  Since those two are valid, matching proceeds.\n\n### Comments and Negation\n\nPreviously, this module let you mark a pattern as a \"comment\" if it\nstarted with a `#` character, or a \"negated\" pattern if it started\nwith a `!` character.\n\nThese options were deprecated in version 5, and removed in version 6.\n\nTo specify things that should not match, use the `ignore` option.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation.  You must use\nforward-slashes **only** in glob expressions.  Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`.  On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead.  However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes.  For the vast majority\nof operations, this is never a problem.\n\n## Glob Logo\nGlob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo).\n\nThe logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).\n\n## Contributing\n\nAny change to behavior (including bugfixes) must come with a test.\n\nPatches that fail tests or reduce performance will be rejected.\n\n```\n# to run tests\nnpm test\n\n# to re-generate test fixtures\nnpm run test-regen\n\n# to benchmark against bash/zsh\nnpm run bench\n\n# to profile javascript\nnpm run prof\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-glob.git"
+  },
+  "scripts": {
+    "bench": "bash benchmark.sh",
+    "benchclean": "node benchclean.js",
+    "prepublish": "npm run benchclean",
+    "prof": "bash prof.sh && cat profile.txt",
+    "profclean": "rm -f v8.log profile.txt",
+    "test": "tap test/*.js --cov",
+    "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js"
+  },
+  "version": "7.1.4"
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/sync.js b/legacy-libs/grpc/node_modules/rimraf/node_modules/glob/sync.js
new file mode 100644 (file)
index 0000000..c952134
--- /dev/null
@@ -0,0 +1,486 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var rp = require('fs.realpath')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+function globSync (pattern, options) {
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+  if (!pattern)
+    throw new Error('must provide pattern')
+
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  if (!(this instanceof GlobSync))
+    return new GlobSync(pattern, options)
+
+  setopts(this, pattern, options)
+
+  if (this.noprocess)
+    return this
+
+  var n = this.minimatch.set.length
+  this.matches = new Array(n)
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false)
+  }
+  this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+  assert(this instanceof GlobSync)
+  if (this.realpath) {
+    var self = this
+    this.matches.forEach(function (matchset, index) {
+      var set = self.matches[index] = Object.create(null)
+      for (var p in matchset) {
+        try {
+          p = self._makeAbs(p)
+          var real = rp.realpathSync(p, self.realpathCache)
+          set[real] = true
+        } catch (er) {
+          if (er.syscall === 'stat')
+            set[self._makeAbs(p)] = true
+          else
+            throw er
+        }
+      }
+    })
+  }
+  common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+  assert(this instanceof GlobSync)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // See if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip processing
+  if (childrenIgnored(this, read))
+    return
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+  var entries = this._readdir(abs, inGlobStar)
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix.slice(-1) !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix)
+      newPattern = [prefix, e]
+    else
+      newPattern = [e]
+    this._process(newPattern.concat(remain), index, inGlobStar)
+  }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+  if (isIgnored(this, e))
+    return
+
+  var abs = this._makeAbs(e)
+
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.absolute) {
+    e = abs
+  }
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+
+  if (this.stat)
+    this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false)
+
+  var entries
+  var lstat
+  var stat
+  try {
+    lstat = fs.lstatSync(abs)
+  } catch (er) {
+    if (er.code === 'ENOENT') {
+      // lstat failed, doesn't exist
+      return null
+    }
+  }
+
+  var isSym = lstat && lstat.isSymbolicLink()
+  this.symlinks[abs] = isSym
+
+  // If it's not a symlink or a dir, then it's definitely a regular file.
+  // don't bother doing a readdir in that case.
+  if (!isSym && lstat && !lstat.isDirectory())
+    this.cache[abs] = 'FILE'
+  else
+    entries = this._readdir(abs, false)
+
+  return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+  var entries
+
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return null
+
+    if (Array.isArray(c))
+      return c
+  }
+
+  try {
+    return this._readdirEntries(abs, fs.readdirSync(abs))
+  } catch (er) {
+    this._readdirError(abs, er)
+    return null
+  }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+
+  // mark and cache dir-ness
+  return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      var abs = this._makeAbs(f)
+      this.cache[abs] = 'FILE'
+      if (abs === this.cwdAbs) {
+        var error = new Error(er.code + ' invalid cwd ' + this.cwd)
+        error.path = this.cwd
+        error.code = er.code
+        throw error
+      }
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict)
+        throw er
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+  var entries = this._readdir(abs, inGlobStar)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false)
+
+  var len = entries.length
+  var isSym = this.symlinks[abs]
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true)
+  }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var exists = this._stat(prefix)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return false
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return c
+
+    if (needDir && c === 'FILE')
+      return false
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (!stat) {
+    var lstat
+    try {
+      lstat = fs.lstatSync(abs)
+    } catch (er) {
+      if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
+        this.statCache[abs] = false
+        return false
+      }
+    }
+
+    if (lstat && lstat.isSymbolicLink()) {
+      try {
+        stat = fs.statSync(abs)
+      } catch (er) {
+        stat = lstat
+      }
+    } else {
+      stat = lstat
+    }
+  }
+
+  this.statCache[abs] = stat
+
+  var c = true
+  if (stat)
+    c = stat.isDirectory() ? 'DIR' : 'FILE'
+
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c === 'FILE')
+    return false
+
+  return c
+}
+
+GlobSync.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/package.json b/legacy-libs/grpc/node_modules/rimraf/package.json
new file mode 100644 (file)
index 0000000..1896924
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_from": "rimraf@^2.6.1",
+  "_id": "rimraf@2.6.3",
+  "_inBundle": false,
+  "_integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
+  "_location": "/grpc/rimraf",
+  "_phantomChildren": {
+    "fs.realpath": "1.0.0",
+    "inflight": "1.0.6",
+    "inherits": "2.0.3",
+    "minimatch": "3.0.4",
+    "once": "1.4.0",
+    "path-is-absolute": "1.0.1"
+  },
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "rimraf@^2.6.1",
+    "name": "rimraf",
+    "escapedName": "rimraf",
+    "rawSpec": "^2.6.1",
+    "saveSpec": null,
+    "fetchSpec": "^2.6.1"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
+  "_shasum": "b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab",
+  "_shrinkwrap": null,
+  "_spec": "rimraf@^2.6.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/node-pre-gyp",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bin": {
+    "rimraf": "./bin.js"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/rimraf/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "glob": "^7.1.3"
+  },
+  "deprecated": false,
+  "description": "A deep deletion module for node (like `rm -rf`)",
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "tap": "^12.1.1"
+  },
+  "files": [
+    "LICENSE",
+    "README.md",
+    "bin.js",
+    "rimraf.js"
+  ],
+  "homepage": "https://github.com/isaacs/rimraf#readme",
+  "license": "ISC",
+  "main": "rimraf.js",
+  "name": "rimraf",
+  "optionalDependencies": {},
+  "readme": "[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)\n\nThe [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, [opts], callback)`\n\nThe first parameter will be interpreted as a globbing pattern for files. If you\nwant to disable globbing you can do so with `opts.disableGlob` (defaults to\n`false`). This might be handy, for instance, if you have filenames that contain\nglobbing wildcard characters.\n\nThe callback will be called with an error if there is one.  Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n  `opts.maxBusyTries` times before giving up, adding 100ms of wait\n  between each attempt.  The default `maxBusyTries` is 3.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n  successfully, since your desired outcome is already the case.\n* `EMFILE` - Since `readdir` requires opening a file descriptor, it's\n  possible to hit `EMFILE` if too many file descriptors are in use.\n  In the sync case, there's nothing to be done for this.  But in the\n  async case, rimraf will gradually back off with timeouts up to\n  `opts.emfileWait` ms, which defaults to 1000.\n\n## options\n\n* unlink, chmod, stat, lstat, rmdir, readdir,\n  unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync\n\n    In order to use a custom file system library, you can override\n    specific fs functions on the options object.\n\n    If any of these functions are present on the options object, then\n    the supplied function will be used instead of the default fs\n    method.\n\n    Sync methods are only relevant for `rimraf.sync()`, of course.\n\n    For example:\n\n    ```javascript\n    var myCustomFS = require('some-custom-fs')\n\n    rimraf('some-thing', myCustomFS, callback)\n    ```\n\n* maxBusyTries\n\n    If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered\n    on Windows systems, then rimraf will retry with a linear backoff\n    wait of 100ms longer on each try.  The default maxBusyTries is 3.\n\n    Only relevant for async usage.\n\n* emfileWait\n\n    If an `EMFILE` error is encountered, then rimraf will retry\n    repeatedly with a linear backoff of 1ms longer on each try, until\n    the timeout counter hits this max.  The default limit is 1000.\n\n    If you repeatedly encounter `EMFILE` errors, then consider using\n    [graceful-fs](http://npm.im/graceful-fs) in your program.\n\n    Only relevant for async usage.\n\n* glob\n\n    Set to `false` to disable [glob](http://npm.im/glob) pattern\n    matching.\n\n    Set to an object to pass options to the glob module.  The default\n    glob options are `{ nosort: true, silent: true }`.\n\n    Glob version 6 is used in this module.\n\n    Relevant for both sync and async usage.\n\n* disableGlob\n\n    Set to any non-falsey value to disable globbing entirely.\n    (Equivalent to setting `glob: false`.)\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too.  But that's not so good.  Use\nthe async API.  It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf <path> [<path> ...]` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/rimraf.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js"
+  },
+  "version": "2.6.3"
+}
diff --git a/legacy-libs/grpc/node_modules/rimraf/rimraf.js b/legacy-libs/grpc/node_modules/rimraf/rimraf.js
new file mode 100644 (file)
index 0000000..e80dd10
--- /dev/null
@@ -0,0 +1,364 @@
+module.exports = rimraf
+rimraf.sync = rimrafSync
+
+var assert = require("assert")
+var path = require("path")
+var fs = require("fs")
+var glob = require("glob")
+var _0666 = parseInt('666', 8)
+
+var defaultGlobOpts = {
+  nosort: true,
+  silent: true
+}
+
+// for EMFILE handling
+var timeout = 0
+
+var isWindows = (process.platform === "win32")
+
+function defaults (options) {
+  var methods = [
+    'unlink',
+    'chmod',
+    'stat',
+    'lstat',
+    'rmdir',
+    'readdir'
+  ]
+  methods.forEach(function(m) {
+    options[m] = options[m] || fs[m]
+    m = m + 'Sync'
+    options[m] = options[m] || fs[m]
+  })
+
+  options.maxBusyTries = options.maxBusyTries || 3
+  options.emfileWait = options.emfileWait || 1000
+  if (options.glob === false) {
+    options.disableGlob = true
+  }
+  options.disableGlob = options.disableGlob || false
+  options.glob = options.glob || defaultGlobOpts
+}
+
+function rimraf (p, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = {}
+  }
+
+  assert(p, 'rimraf: missing path')
+  assert.equal(typeof p, 'string', 'rimraf: path should be a string')
+  assert.equal(typeof cb, 'function', 'rimraf: callback function required')
+  assert(options, 'rimraf: invalid options argument provided')
+  assert.equal(typeof options, 'object', 'rimraf: options should be object')
+
+  defaults(options)
+
+  var busyTries = 0
+  var errState = null
+  var n = 0
+
+  if (options.disableGlob || !glob.hasMagic(p))
+    return afterGlob(null, [p])
+
+  options.lstat(p, function (er, stat) {
+    if (!er)
+      return afterGlob(null, [p])
+
+    glob(p, options.glob, afterGlob)
+  })
+
+  function next (er) {
+    errState = errState || er
+    if (--n === 0)
+      cb(errState)
+  }
+
+  function afterGlob (er, results) {
+    if (er)
+      return cb(er)
+
+    n = results.length
+    if (n === 0)
+      return cb()
+
+    results.forEach(function (p) {
+      rimraf_(p, options, function CB (er) {
+        if (er) {
+          if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
+              busyTries < options.maxBusyTries) {
+            busyTries ++
+            var time = busyTries * 100
+            // try again, with the same exact callback as this one.
+            return setTimeout(function () {
+              rimraf_(p, options, CB)
+            }, time)
+          }
+
+          // this one won't happen if graceful-fs is used.
+          if (er.code === "EMFILE" && timeout < options.emfileWait) {
+            return setTimeout(function () {
+              rimraf_(p, options, CB)
+            }, timeout ++)
+          }
+
+          // already gone
+          if (er.code === "ENOENT") er = null
+        }
+
+        timeout = 0
+        next(er)
+      })
+    })
+  }
+}
+
+// Two possible strategies.
+// 1. Assume it's a file.  unlink it, then do the dir stuff on EPERM or EISDIR
+// 2. Assume it's a directory.  readdir, then do the file stuff on ENOTDIR
+//
+// Both result in an extra syscall when you guess wrong.  However, there
+// are likely far more normal files in the world than directories.  This
+// is based on the assumption that a the average number of files per
+// directory is >= 1.
+//
+// If anyone ever complains about this, then I guess the strategy could
+// be made configurable somehow.  But until then, YAGNI.
+function rimraf_ (p, options, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+
+  // sunos lets the root user unlink directories, which is... weird.
+  // so we have to lstat here and make sure it's not a dir.
+  options.lstat(p, function (er, st) {
+    if (er && er.code === "ENOENT")
+      return cb(null)
+
+    // Windows can EPERM on stat.  Life is suffering.
+    if (er && er.code === "EPERM" && isWindows)
+      fixWinEPERM(p, options, er, cb)
+
+    if (st && st.isDirectory())
+      return rmdir(p, options, er, cb)
+
+    options.unlink(p, function (er) {
+      if (er) {
+        if (er.code === "ENOENT")
+          return cb(null)
+        if (er.code === "EPERM")
+          return (isWindows)
+            ? fixWinEPERM(p, options, er, cb)
+            : rmdir(p, options, er, cb)
+        if (er.code === "EISDIR")
+          return rmdir(p, options, er, cb)
+      }
+      return cb(er)
+    })
+  })
+}
+
+function fixWinEPERM (p, options, er, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+  if (er)
+    assert(er instanceof Error)
+
+  options.chmod(p, _0666, function (er2) {
+    if (er2)
+      cb(er2.code === "ENOENT" ? null : er)
+    else
+      options.stat(p, function(er3, stats) {
+        if (er3)
+          cb(er3.code === "ENOENT" ? null : er)
+        else if (stats.isDirectory())
+          rmdir(p, options, er, cb)
+        else
+          options.unlink(p, cb)
+      })
+  })
+}
+
+function fixWinEPERMSync (p, options, er) {
+  assert(p)
+  assert(options)
+  if (er)
+    assert(er instanceof Error)
+
+  try {
+    options.chmodSync(p, _0666)
+  } catch (er2) {
+    if (er2.code === "ENOENT")
+      return
+    else
+      throw er
+  }
+
+  try {
+    var stats = options.statSync(p)
+  } catch (er3) {
+    if (er3.code === "ENOENT")
+      return
+    else
+      throw er
+  }
+
+  if (stats.isDirectory())
+    rmdirSync(p, options, er)
+  else
+    options.unlinkSync(p)
+}
+
+function rmdir (p, options, originalEr, cb) {
+  assert(p)
+  assert(options)
+  if (originalEr)
+    assert(originalEr instanceof Error)
+  assert(typeof cb === 'function')
+
+  // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
+  // if we guessed wrong, and it's not a directory, then
+  // raise the original error.
+  options.rmdir(p, function (er) {
+    if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
+      rmkids(p, options, cb)
+    else if (er && er.code === "ENOTDIR")
+      cb(originalEr)
+    else
+      cb(er)
+  })
+}
+
+function rmkids(p, options, cb) {
+  assert(p)
+  assert(options)
+  assert(typeof cb === 'function')
+
+  options.readdir(p, function (er, files) {
+    if (er)
+      return cb(er)
+    var n = files.length
+    if (n === 0)
+      return options.rmdir(p, cb)
+    var errState
+    files.forEach(function (f) {
+      rimraf(path.join(p, f), options, function (er) {
+        if (errState)
+          return
+        if (er)
+          return cb(errState = er)
+        if (--n === 0)
+          options.rmdir(p, cb)
+      })
+    })
+  })
+}
+
+// this looks simpler, and is strictly *faster*, but will
+// tie up the JavaScript thread and fail on excessively
+// deep directory trees.
+function rimrafSync (p, options) {
+  options = options || {}
+  defaults(options)
+
+  assert(p, 'rimraf: missing path')
+  assert.equal(typeof p, 'string', 'rimraf: path should be a string')
+  assert(options, 'rimraf: missing options')
+  assert.equal(typeof options, 'object', 'rimraf: options should be object')
+
+  var results
+
+  if (options.disableGlob || !glob.hasMagic(p)) {
+    results = [p]
+  } else {
+    try {
+      options.lstatSync(p)
+      results = [p]
+    } catch (er) {
+      results = glob.sync(p, options.glob)
+    }
+  }
+
+  if (!results.length)
+    return
+
+  for (var i = 0; i < results.length; i++) {
+    var p = results[i]
+
+    try {
+      var st = options.lstatSync(p)
+    } catch (er) {
+      if (er.code === "ENOENT")
+        return
+
+      // Windows can EPERM on stat.  Life is suffering.
+      if (er.code === "EPERM" && isWindows)
+        fixWinEPERMSync(p, options, er)
+    }
+
+    try {
+      // sunos lets the root user unlink directories, which is... weird.
+      if (st && st.isDirectory())
+        rmdirSync(p, options, null)
+      else
+        options.unlinkSync(p)
+    } catch (er) {
+      if (er.code === "ENOENT")
+        return
+      if (er.code === "EPERM")
+        return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
+      if (er.code !== "EISDIR")
+        throw er
+
+      rmdirSync(p, options, er)
+    }
+  }
+}
+
+function rmdirSync (p, options, originalEr) {
+  assert(p)
+  assert(options)
+  if (originalEr)
+    assert(originalEr instanceof Error)
+
+  try {
+    options.rmdirSync(p)
+  } catch (er) {
+    if (er.code === "ENOENT")
+      return
+    if (er.code === "ENOTDIR")
+      throw originalEr
+    if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
+      rmkidsSync(p, options)
+  }
+}
+
+function rmkidsSync (p, options) {
+  assert(p)
+  assert(options)
+  options.readdirSync(p).forEach(function (f) {
+    rimrafSync(path.join(p, f), options)
+  })
+
+  // We only end up here once we got ENOTEMPTY at least once, and
+  // at this point, we are guaranteed to have removed all the kids.
+  // So, we know that it won't be ENOENT or ENOTDIR or anything else.
+  // try really hard to delete stuff on windows, because it has a
+  // PROFOUNDLY annoying habit of not closing handles promptly when
+  // files are deleted, resulting in spurious ENOTEMPTY errors.
+  var retries = isWindows ? 100 : 1
+  var i = 0
+  do {
+    var threw = true
+    try {
+      var ret = options.rmdirSync(p, options)
+      threw = false
+      return ret
+    } finally {
+      if (++i < retries && threw)
+        continue
+    }
+  } while (true)
+}
diff --git a/legacy-libs/grpc/node_modules/safe-buffer/LICENSE b/legacy-libs/grpc/node_modules/safe-buffer/LICENSE
new file mode 100644 (file)
index 0000000..0c068ce
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Feross Aboukhadijeh
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/safe-buffer/README.md b/legacy-libs/grpc/node_modules/safe-buffer/README.md
new file mode 100644 (file)
index 0000000..e9a81af
--- /dev/null
@@ -0,0 +1,584 @@
+# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
+
+[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg
+[travis-url]: https://travis-ci.org/feross/safe-buffer
+[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg
+[npm-url]: https://npmjs.org/package/safe-buffer
+[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg
+[downloads-url]: https://npmjs.org/package/safe-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+
+#### Safer Node.js Buffer API
+
+**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,
+`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**
+
+**Uses the built-in implementation when available.**
+
+## install
+
+```
+npm install safe-buffer
+```
+
+## usage
+
+The goal of this package is to provide a safe replacement for the node.js `Buffer`.
+
+It's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to
+the top of your node.js modules:
+
+```js
+var Buffer = require('safe-buffer').Buffer
+
+// Existing buffer code will continue to work without issues:
+
+new Buffer('hey', 'utf8')
+new Buffer([1, 2, 3], 'utf8')
+new Buffer(obj)
+new Buffer(16) // create an uninitialized buffer (potentially unsafe)
+
+// But you can use these new explicit APIs to make clear what you want:
+
+Buffer.from('hey', 'utf8') // convert from many types to a Buffer
+Buffer.alloc(16) // create a zero-filled buffer (safe)
+Buffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)
+```
+
+## api
+
+### Class Method: Buffer.from(array)
+<!-- YAML
+added: v3.0.0
+-->
+
+* `array` {Array}
+
+Allocates a new `Buffer` using an `array` of octets.
+
+```js
+const buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);
+  // creates a new Buffer containing ASCII bytes
+  // ['b','u','f','f','e','r']
+```
+
+A `TypeError` will be thrown if `array` is not an `Array`.
+
+### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])
+<!-- YAML
+added: v5.10.0
+-->
+
+* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or
+  a `new ArrayBuffer()`
+* `byteOffset` {Number} Default: `0`
+* `length` {Number} Default: `arrayBuffer.length - byteOffset`
+
+When passed a reference to the `.buffer` property of a `TypedArray` instance,
+the newly created `Buffer` will share the same allocated memory as the
+TypedArray.
+
+```js
+const arr = new Uint16Array(2);
+arr[0] = 5000;
+arr[1] = 4000;
+
+const buf = Buffer.from(arr.buffer); // shares the memory with arr;
+
+console.log(buf);
+  // Prints: <Buffer 88 13 a0 0f>
+
+// changing the TypedArray changes the Buffer also
+arr[1] = 6000;
+
+console.log(buf);
+  // Prints: <Buffer 88 13 70 17>
+```
+
+The optional `byteOffset` and `length` arguments specify a memory range within
+the `arrayBuffer` that will be shared by the `Buffer`.
+
+```js
+const ab = new ArrayBuffer(10);
+const buf = Buffer.from(ab, 0, 2);
+console.log(buf.length);
+  // Prints: 2
+```
+
+A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.
+
+### Class Method: Buffer.from(buffer)
+<!-- YAML
+added: v3.0.0
+-->
+
+* `buffer` {Buffer}
+
+Copies the passed `buffer` data onto a new `Buffer` instance.
+
+```js
+const buf1 = Buffer.from('buffer');
+const buf2 = Buffer.from(buf1);
+
+buf1[0] = 0x61;
+console.log(buf1.toString());
+  // 'auffer'
+console.log(buf2.toString());
+  // 'buffer' (copy is not changed)
+```
+
+A `TypeError` will be thrown if `buffer` is not a `Buffer`.
+
+### Class Method: Buffer.from(str[, encoding])
+<!-- YAML
+added: v5.10.0
+-->
+
+* `str` {String} String to encode.
+* `encoding` {String} Encoding to use, Default: `'utf8'`
+
+Creates a new `Buffer` containing the given JavaScript string `str`. If
+provided, the `encoding` parameter identifies the character encoding.
+If not provided, `encoding` defaults to `'utf8'`.
+
+```js
+const buf1 = Buffer.from('this is a tést');
+console.log(buf1.toString());
+  // prints: this is a tést
+console.log(buf1.toString('ascii'));
+  // prints: this is a tC)st
+
+const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
+console.log(buf2.toString());
+  // prints: this is a tést
+```
+
+A `TypeError` will be thrown if `str` is not a string.
+
+### Class Method: Buffer.alloc(size[, fill[, encoding]])
+<!-- YAML
+added: v5.10.0
+-->
+
+* `size` {Number}
+* `fill` {Value} Default: `undefined`
+* `encoding` {String} Default: `utf8`
+
+Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the
+`Buffer` will be *zero-filled*.
+
+```js
+const buf = Buffer.alloc(5);
+console.log(buf);
+  // <Buffer 00 00 00 00 00>
+```
+
+The `size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+If `fill` is specified, the allocated `Buffer` will be initialized by calling
+`buf.fill(fill)`. See [`buf.fill()`][] for more information.
+
+```js
+const buf = Buffer.alloc(5, 'a');
+console.log(buf);
+  // <Buffer 61 61 61 61 61>
+```
+
+If both `fill` and `encoding` are specified, the allocated `Buffer` will be
+initialized by calling `buf.fill(fill, encoding)`. For example:
+
+```js
+const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
+console.log(buf);
+  // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
+```
+
+Calling `Buffer.alloc(size)` can be significantly slower than the alternative
+`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance
+contents will *never contain sensitive data*.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### Class Method: Buffer.allocUnsafe(size)
+<!-- YAML
+added: v5.10.0
+-->
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* `Buffer` of `size` bytes.  The `size` must
+be less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit
+architectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is
+thrown. A zero-length Buffer will be created if a `size` less than or equal to
+0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+```js
+const buf = Buffer.allocUnsafe(5);
+console.log(buf);
+  // <Buffer 78 e0 82 02 01>
+  // (octets will be different, every time)
+buf.fill(0);
+console.log(buf);
+  // <Buffer 00 00 00 00 00>
+```
+
+A `TypeError` will be thrown if `size` is not a number.
+
+Note that the `Buffer` module pre-allocates an internal `Buffer` instance of
+size `Buffer.poolSize` that is used as a pool for the fast allocation of new
+`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated
+`new Buffer(size)` constructor) only when `size` is less than or equal to
+`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default
+value of `Buffer.poolSize` is `8192` but can be modified.
+
+Use of this pre-allocated internal memory pool is a key difference between
+calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
+Specifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer
+pool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal
+Buffer pool if `size` is less than or equal to half `Buffer.poolSize`. The
+difference is subtle but can be important when an application requires the
+additional performance that `Buffer.allocUnsafe(size)` provides.
+
+### Class Method: Buffer.allocUnsafeSlow(size)
+<!-- YAML
+added: v5.10.0
+-->
+
+* `size` {Number}
+
+Allocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes.  The
+`size` must be less than or equal to the value of
+`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is
+`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will
+be created if a `size` less than or equal to 0 is specified.
+
+The underlying memory for `Buffer` instances created in this way is *not
+initialized*. The contents of the newly created `Buffer` are unknown and
+*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such
+`Buffer` instances to zeroes.
+
+When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
+allocations under 4KB are, by default, sliced from a single pre-allocated
+`Buffer`. This allows applications to avoid the garbage collection overhead of
+creating many individually allocated Buffers. This approach improves both
+performance and memory usage by eliminating the need to track and cleanup as
+many `Persistent` objects.
+
+However, in the case where a developer may need to retain a small chunk of
+memory from a pool for an indeterminate amount of time, it may be appropriate
+to create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then
+copy out the relevant bits.
+
+```js
+// need to keep around a few small chunks of memory
+const store = [];
+
+socket.on('readable', () => {
+  const data = socket.read();
+  // allocate for retained data
+  const sb = Buffer.allocUnsafeSlow(10);
+  // copy the data into the new allocation
+  data.copy(sb, 0, 0, 10);
+  store.push(sb);
+});
+```
+
+Use of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*
+a developer has observed undue memory retention in their applications.
+
+A `TypeError` will be thrown if `size` is not a number.
+
+### All the Rest
+
+The rest of the `Buffer` API is exactly the same as in node.js.
+[See the docs](https://nodejs.org/api/buffer.html).
+
+
+## Related links
+
+- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)
+- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)
+
+## Why is `Buffer` unsafe?
+
+Today, the node.js `Buffer` constructor is overloaded to handle many different argument
+types like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),
+`ArrayBuffer`, and also `Number`.
+
+The API is optimized for convenience: you can throw any type at it, and it will try to do
+what you want.
+
+Because the Buffer constructor is so powerful, you often see code like this:
+
+```js
+// Convert UTF-8 strings to hex
+function toHex (str) {
+  return new Buffer(str).toString('hex')
+}
+```
+
+***But what happens if `toHex` is called with a `Number` argument?***
+
+### Remote Memory Disclosure
+
+If an attacker can make your program call the `Buffer` constructor with a `Number`
+argument, then they can make it allocate uninitialized memory from the node.js process.
+This could potentially disclose TLS private keys, user data, or database passwords.
+
+When the `Buffer` constructor is passed a `Number` argument, it returns an
+**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like
+this, you **MUST** overwrite the contents before returning it to the user.
+
+From the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):
+
+> `new Buffer(size)`
+>
+> - `size` Number
+>
+> The underlying memory for `Buffer` instances created in this way is not initialized.
+> **The contents of a newly created `Buffer` are unknown and could contain sensitive
+> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.
+
+(Emphasis our own.)
+
+Whenever the programmer intended to create an uninitialized `Buffer` you often see code
+like this:
+
+```js
+var buf = new Buffer(16)
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+  buf[i] = otherBuf[i]
+}
+```
+
+
+### Would this ever be a problem in real code?
+
+Yes. It's surprisingly common to forget to check the type of your variables in a
+dynamically-typed language like JavaScript.
+
+Usually the consequences of assuming the wrong type is that your program crashes with an
+uncaught exception. But the failure mode for forgetting to check the type of arguments to
+the `Buffer` constructor is more catastrophic.
+
+Here's an example of a vulnerable service that takes a JSON payload and converts it to
+hex:
+
+```js
+// Take a JSON payload {str: "some string"} and convert it to hex
+var server = http.createServer(function (req, res) {
+  var data = ''
+  req.setEncoding('utf8')
+  req.on('data', function (chunk) {
+    data += chunk
+  })
+  req.on('end', function () {
+    var body = JSON.parse(data)
+    res.end(new Buffer(body.str).toString('hex'))
+  })
+})
+
+server.listen(8080)
+```
+
+In this example, an http client just has to send:
+
+```json
+{
+  "str": 1000
+}
+```
+
+and it will get back 1,000 bytes of uninitialized memory from the server.
+
+This is a very serious bug. It's similar in severity to the
+[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process
+memory by remote attackers.
+
+
+### Which real-world packages were vulnerable?
+
+#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)
+
+[Mathias Buus](https://github.com/mafintosh) and I
+([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,
+[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow
+anyone on the internet to send a series of messages to a user of `bittorrent-dht` and get
+them to reveal 20 bytes at a time of uninitialized memory from the node.js process.
+
+Here's
+[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)
+that fixed it. We released a new fixed version, created a
+[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all
+vulnerable versions on npm so users will get a warning to upgrade to a newer version.
+
+#### [`ws`](https://www.npmjs.com/package/ws)
+
+That got us wondering if there were other vulnerable packages. Sure enough, within a short
+period of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the
+most popular WebSocket implementation in node.js.
+
+If certain APIs were called with `Number` parameters instead of `String` or `Buffer` as
+expected, then uninitialized server memory would be disclosed to the remote peer.
+
+These were the vulnerable methods:
+
+```js
+socket.send(number)
+socket.ping(number)
+socket.pong(number)
+```
+
+Here's a vulnerable socket server with some echo functionality:
+
+```js
+server.on('connection', function (socket) {
+  socket.on('message', function (message) {
+    message = JSON.parse(message)
+    if (message.type === 'echo') {
+      socket.send(message.data) // send back the user's message
+    }
+  })
+})
+```
+
+`socket.send(number)` called on the server, will disclose server memory.
+
+Here's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue
+was fixed, with a more detailed explanation. Props to
+[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the
+[Node Security Project disclosure](https://nodesecurity.io/advisories/67).
+
+
+### What's the solution?
+
+It's important that node.js offers a fast way to get memory otherwise performance-critical
+applications would needlessly get a lot slower.
+
+But we need a better way to *signal our intent* as programmers. **When we want
+uninitialized memory, we should request it explicitly.**
+
+Sensitive functionality should not be packed into a developer-friendly API that loosely
+accepts many different types. This type of API encourages the lazy practice of passing
+variables in without checking the type very carefully.
+
+#### A new API: `Buffer.allocUnsafe(number)`
+
+The functionality of creating buffers with uninitialized memory should be part of another
+API. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that
+frequently gets user input of all sorts of different types passed into it.
+
+```js
+var buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!
+
+// Immediately overwrite the uninitialized buffer with data from another buffer
+for (var i = 0; i < buf.length; i++) {
+  buf[i] = otherBuf[i]
+}
+```
+
+
+### How do we fix node.js core?
+
+We sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as
+`semver-major`) which defends against one case:
+
+```js
+var str = 16
+new Buffer(str, 'utf8')
+```
+
+In this situation, it's implied that the programmer intended the first argument to be a
+string, since they passed an encoding as a second argument. Today, node.js will allocate
+uninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not
+what the programmer intended.
+
+But this is only a partial solution, since if the programmer does `new Buffer(variable)`
+(without an `encoding` parameter) there's no way to know what they intended. If `variable`
+is sometimes a number, then uninitialized memory will sometimes be returned.
+
+### What's the real long-term fix?
+
+We could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when
+we need uninitialized memory. But that would break 1000s of packages.
+
+~~We believe the best solution is to:~~
+
+~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~
+
+~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~
+
+#### Update
+
+We now support adding three new APIs:
+
+- `Buffer.from(value)` - convert from any type to a buffer
+- `Buffer.alloc(size)` - create a zero-filled buffer
+- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size
+
+This solves the core problem that affected `ws` and `bittorrent-dht` which is
+`Buffer(variable)` getting tricked into taking a number argument.
+
+This way, existing code continues working and the impact on the npm ecosystem will be
+minimal. Over time, npm maintainers can migrate performance-critical code to use
+`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.
+
+
+### Conclusion
+
+We think there's a serious design issue with the `Buffer` API as it exists today. It
+promotes insecure software by putting high-risk functionality into a convenient API
+with friendly "developer ergonomics".
+
+This wasn't merely a theoretical exercise because we found the issue in some of the
+most popular npm packages.
+
+Fortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of
+`buffer`.
+
+```js
+var Buffer = require('safe-buffer').Buffer
+```
+
+Eventually, we hope that node.js core can switch to this new, safer behavior. We believe
+the impact on the ecosystem would be minimal since it's not a breaking change.
+Well-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while
+older, insecure packages would magically become safe from this attack vector.
+
+
+## links
+
+- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)
+- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)
+- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)
+
+
+## credit
+
+The original issues in `bittorrent-dht`
+([disclosure](https://nodesecurity.io/advisories/68)) and
+`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by
+[Mathias Buus](https://github.com/mafintosh) and
+[Feross Aboukhadijeh](http://feross.org/).
+
+Thanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues
+and for his work running the [Node Security Project](https://nodesecurity.io/).
+
+Thanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and
+auditing the code.
+
+
+## license
+
+MIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)
diff --git a/legacy-libs/grpc/node_modules/safe-buffer/index.d.ts b/legacy-libs/grpc/node_modules/safe-buffer/index.d.ts
new file mode 100644 (file)
index 0000000..e9fed80
--- /dev/null
@@ -0,0 +1,187 @@
+declare module "safe-buffer" {
+  export class Buffer {
+    length: number
+    write(string: string, offset?: number, length?: number, encoding?: string): number;
+    toString(encoding?: string, start?: number, end?: number): string;
+    toJSON(): { type: 'Buffer', data: any[] };
+    equals(otherBuffer: Buffer): boolean;
+    compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
+    copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+    slice(start?: number, end?: number): Buffer;
+    writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+    writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+    writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+    writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
+    readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+    readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+    readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
+    readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
+    readUInt8(offset: number, noAssert?: boolean): number;
+    readUInt16LE(offset: number, noAssert?: boolean): number;
+    readUInt16BE(offset: number, noAssert?: boolean): number;
+    readUInt32LE(offset: number, noAssert?: boolean): number;
+    readUInt32BE(offset: number, noAssert?: boolean): number;
+    readInt8(offset: number, noAssert?: boolean): number;
+    readInt16LE(offset: number, noAssert?: boolean): number;
+    readInt16BE(offset: number, noAssert?: boolean): number;
+    readInt32LE(offset: number, noAssert?: boolean): number;
+    readInt32BE(offset: number, noAssert?: boolean): number;
+    readFloatLE(offset: number, noAssert?: boolean): number;
+    readFloatBE(offset: number, noAssert?: boolean): number;
+    readDoubleLE(offset: number, noAssert?: boolean): number;
+    readDoubleBE(offset: number, noAssert?: boolean): number;
+    swap16(): Buffer;
+    swap32(): Buffer;
+    swap64(): Buffer;
+    writeUInt8(value: number, offset: number, noAssert?: boolean): number;
+    writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
+    writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
+    writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
+    writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
+    writeInt8(value: number, offset: number, noAssert?: boolean): number;
+    writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
+    writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
+    writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
+    writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
+    writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
+    writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
+    writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
+    writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
+    fill(value: any, offset?: number, end?: number): this;
+    indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+    lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
+    includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
+
+    /**
+     * Allocates a new buffer containing the given {str}.
+     *
+     * @param str String to store in buffer.
+     * @param encoding encoding to use, optional.  Default is 'utf8'
+     */
+     constructor (str: string, encoding?: string);
+    /**
+     * Allocates a new buffer of {size} octets.
+     *
+     * @param size count of octets to allocate.
+     */
+    constructor (size: number);
+    /**
+     * Allocates a new buffer containing the given {array} of octets.
+     *
+     * @param array The octets to store.
+     */
+    constructor (array: Uint8Array);
+    /**
+     * Produces a Buffer backed by the same allocated memory as
+     * the given {ArrayBuffer}.
+     *
+     *
+     * @param arrayBuffer The ArrayBuffer with which to share memory.
+     */
+    constructor (arrayBuffer: ArrayBuffer);
+    /**
+     * Allocates a new buffer containing the given {array} of octets.
+     *
+     * @param array The octets to store.
+     */
+    constructor (array: any[]);
+    /**
+     * Copies the passed {buffer} data onto a new {Buffer} instance.
+     *
+     * @param buffer The buffer to copy.
+     */
+    constructor (buffer: Buffer);
+    prototype: Buffer;
+    /**
+     * Allocates a new Buffer using an {array} of octets.
+     *
+     * @param array
+     */
+    static from(array: any[]): Buffer;
+    /**
+     * When passed a reference to the .buffer property of a TypedArray instance,
+     * the newly created Buffer will share the same allocated memory as the TypedArray.
+     * The optional {byteOffset} and {length} arguments specify a memory range
+     * within the {arrayBuffer} that will be shared by the Buffer.
+     *
+     * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
+     * @param byteOffset
+     * @param length
+     */
+    static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
+    /**
+     * Copies the passed {buffer} data onto a new Buffer instance.
+     *
+     * @param buffer
+     */
+    static from(buffer: Buffer): Buffer;
+    /**
+     * Creates a new Buffer containing the given JavaScript string {str}.
+     * If provided, the {encoding} parameter identifies the character encoding.
+     * If not provided, {encoding} defaults to 'utf8'.
+     *
+     * @param str
+     */
+    static from(str: string, encoding?: string): Buffer;
+    /**
+     * Returns true if {obj} is a Buffer
+     *
+     * @param obj object to test.
+     */
+    static isBuffer(obj: any): obj is Buffer;
+    /**
+     * Returns true if {encoding} is a valid encoding argument.
+     * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+     *
+     * @param encoding string to test.
+     */
+    static isEncoding(encoding: string): boolean;
+    /**
+     * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+     * This is not the same as String.prototype.length since that returns the number of characters in a string.
+     *
+     * @param string string to test.
+     * @param encoding encoding used to evaluate (defaults to 'utf8')
+     */
+    static byteLength(string: string, encoding?: string): number;
+    /**
+     * Returns a buffer which is the result of concatenating all the buffers in the list together.
+     *
+     * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+     * If the list has exactly one item, then the first item of the list is returned.
+     * If the list has more than one item, then a new Buffer is created.
+     *
+     * @param list An array of Buffer objects to concatenate
+     * @param totalLength Total length of the buffers when concatenated.
+     *   If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+     */
+    static concat(list: Buffer[], totalLength?: number): Buffer;
+    /**
+     * The same as buf1.compare(buf2).
+     */
+    static compare(buf1: Buffer, buf2: Buffer): number;
+    /**
+     * Allocates a new buffer of {size} octets.
+     *
+     * @param size count of octets to allocate.
+     * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+     *    If parameter is omitted, buffer will be filled with zeros.
+     * @param encoding encoding used for call to buf.fill while initalizing
+     */
+    static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
+    /**
+     * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+     * of the newly created Buffer are unknown and may contain sensitive data.
+     *
+     * @param size count of octets to allocate
+     */
+    static allocUnsafe(size: number): Buffer;
+    /**
+     * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+     * of the newly created Buffer are unknown and may contain sensitive data.
+     *
+     * @param size count of octets to allocate
+     */
+    static allocUnsafeSlow(size: number): Buffer;
+  }
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/safe-buffer/index.js b/legacy-libs/grpc/node_modules/safe-buffer/index.js
new file mode 100644 (file)
index 0000000..22438da
--- /dev/null
@@ -0,0 +1,62 @@
+/* eslint-disable node/no-deprecated-api */
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+// alternative to using Object.keys for old browsers
+function copyProps (src, dst) {
+  for (var key in src) {
+    dst[key] = src[key]
+  }
+}
+if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
+  module.exports = buffer
+} else {
+  // Copy properties from require('buffer')
+  copyProps(buffer, exports)
+  exports.Buffer = SafeBuffer
+}
+
+function SafeBuffer (arg, encodingOrOffset, length) {
+  return Buffer(arg, encodingOrOffset, length)
+}
+
+// Copy static methods from Buffer
+copyProps(Buffer, SafeBuffer)
+
+SafeBuffer.from = function (arg, encodingOrOffset, length) {
+  if (typeof arg === 'number') {
+    throw new TypeError('Argument must not be a number')
+  }
+  return Buffer(arg, encodingOrOffset, length)
+}
+
+SafeBuffer.alloc = function (size, fill, encoding) {
+  if (typeof size !== 'number') {
+    throw new TypeError('Argument must be a number')
+  }
+  var buf = Buffer(size)
+  if (fill !== undefined) {
+    if (typeof encoding === 'string') {
+      buf.fill(fill, encoding)
+    } else {
+      buf.fill(fill)
+    }
+  } else {
+    buf.fill(0)
+  }
+  return buf
+}
+
+SafeBuffer.allocUnsafe = function (size) {
+  if (typeof size !== 'number') {
+    throw new TypeError('Argument must be a number')
+  }
+  return Buffer(size)
+}
+
+SafeBuffer.allocUnsafeSlow = function (size) {
+  if (typeof size !== 'number') {
+    throw new TypeError('Argument must be a number')
+  }
+  return buffer.SlowBuffer(size)
+}
diff --git a/legacy-libs/grpc/node_modules/safe-buffer/package.json b/legacy-libs/grpc/node_modules/safe-buffer/package.json
new file mode 100644 (file)
index 0000000..5ec6350
--- /dev/null
@@ -0,0 +1,73 @@
+{
+  "_args": [
+    [
+      "safe-buffer@5.1.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "safe-buffer@5.1.2",
+  "_id": "safe-buffer@5.1.2",
+  "_inBundle": false,
+  "_integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+  "_location": "/grpc/safe-buffer",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "safe-buffer@5.1.2",
+    "name": "safe-buffer",
+    "escapedName": "safe-buffer",
+    "rawSpec": "5.1.2",
+    "saveSpec": null,
+    "fetchSpec": "5.1.2"
+  },
+  "_requiredBy": [
+    "/grpc/minipass",
+    "/grpc/readable-stream",
+    "/grpc/string_decoder",
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "5.1.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Feross Aboukhadijeh",
+    "email": "feross@feross.org",
+    "url": "http://feross.org"
+  },
+  "bugs": {
+    "url": "https://github.com/feross/safe-buffer/issues"
+  },
+  "dependencies": {},
+  "description": "Safer Node.js Buffer API",
+  "devDependencies": {
+    "standard": "*",
+    "tape": "^4.0.0"
+  },
+  "homepage": "https://github.com/feross/safe-buffer",
+  "keywords": [
+    "buffer",
+    "buffer allocate",
+    "node security",
+    "safe",
+    "safe-buffer",
+    "security",
+    "uninitialized"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "safe-buffer",
+  "optionalDependencies": {},
+  "readme": "# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg\n[travis-url]: https://travis-ci.org/feross/safe-buffer\n[npm-image]: https://img.shields.io/npm/v/safe-buffer.svg\n[npm-url]: https://npmjs.org/package/safe-buffer\n[downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg\n[downloads-url]: https://npmjs.org/package/safe-buffer\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n#### Safer Node.js Buffer API\n\n**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`,\n`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.**\n\n**Uses the built-in implementation when available.**\n\n## install\n\n```\nnpm install safe-buffer\n```\n\n## usage\n\nThe goal of this package is to provide a safe replacement for the node.js `Buffer`.\n\nIt's a drop-in replacement for `Buffer`. You can use it by adding one `require` line to\nthe top of your node.js modules:\n\n```js\nvar Buffer = require('safe-buffer').Buffer\n\n// Existing buffer code will continue to work without issues:\n\nnew Buffer('hey', 'utf8')\nnew Buffer([1, 2, 3], 'utf8')\nnew Buffer(obj)\nnew Buffer(16) // create an uninitialized buffer (potentially unsafe)\n\n// But you can use these new explicit APIs to make clear what you want:\n\nBuffer.from('hey', 'utf8') // convert from many types to a Buffer\nBuffer.alloc(16) // create a zero-filled buffer (safe)\nBuffer.allocUnsafe(16) // create an uninitialized buffer (potentially unsafe)\n```\n\n## api\n\n### Class Method: Buffer.from(array)\n<!-- YAML\nadded: v3.0.0\n-->\n\n* `array` {Array}\n\nAllocates a new `Buffer` using an `array` of octets.\n\n```js\nconst buf = Buffer.from([0x62,0x75,0x66,0x66,0x65,0x72]);\n  // creates a new Buffer containing ASCII bytes\n  // ['b','u','f','f','e','r']\n```\n\nA `TypeError` will be thrown if `array` is not an `Array`.\n\n### Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]])\n<!-- YAML\nadded: v5.10.0\n-->\n\n* `arrayBuffer` {ArrayBuffer} The `.buffer` property of a `TypedArray` or\n  a `new ArrayBuffer()`\n* `byteOffset` {Number} Default: `0`\n* `length` {Number} Default: `arrayBuffer.length - byteOffset`\n\nWhen passed a reference to the `.buffer` property of a `TypedArray` instance,\nthe newly created `Buffer` will share the same allocated memory as the\nTypedArray.\n\n```js\nconst arr = new Uint16Array(2);\narr[0] = 5000;\narr[1] = 4000;\n\nconst buf = Buffer.from(arr.buffer); // shares the memory with arr;\n\nconsole.log(buf);\n  // Prints: <Buffer 88 13 a0 0f>\n\n// changing the TypedArray changes the Buffer also\narr[1] = 6000;\n\nconsole.log(buf);\n  // Prints: <Buffer 88 13 70 17>\n```\n\nThe optional `byteOffset` and `length` arguments specify a memory range within\nthe `arrayBuffer` that will be shared by the `Buffer`.\n\n```js\nconst ab = new ArrayBuffer(10);\nconst buf = Buffer.from(ab, 0, 2);\nconsole.log(buf.length);\n  // Prints: 2\n```\n\nA `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer`.\n\n### Class Method: Buffer.from(buffer)\n<!-- YAML\nadded: v3.0.0\n-->\n\n* `buffer` {Buffer}\n\nCopies the passed `buffer` data onto a new `Buffer` instance.\n\n```js\nconst buf1 = Buffer.from('buffer');\nconst buf2 = Buffer.from(buf1);\n\nbuf1[0] = 0x61;\nconsole.log(buf1.toString());\n  // 'auffer'\nconsole.log(buf2.toString());\n  // 'buffer' (copy is not changed)\n```\n\nA `TypeError` will be thrown if `buffer` is not a `Buffer`.\n\n### Class Method: Buffer.from(str[, encoding])\n<!-- YAML\nadded: v5.10.0\n-->\n\n* `str` {String} String to encode.\n* `encoding` {String} Encoding to use, Default: `'utf8'`\n\nCreates a new `Buffer` containing the given JavaScript string `str`. If\nprovided, the `encoding` parameter identifies the character encoding.\nIf not provided, `encoding` defaults to `'utf8'`.\n\n```js\nconst buf1 = Buffer.from('this is a tést');\nconsole.log(buf1.toString());\n  // prints: this is a tést\nconsole.log(buf1.toString('ascii'));\n  // prints: this is a tC)st\n\nconst buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');\nconsole.log(buf2.toString());\n  // prints: this is a tést\n```\n\nA `TypeError` will be thrown if `str` is not a string.\n\n### Class Method: Buffer.alloc(size[, fill[, encoding]])\n<!-- YAML\nadded: v5.10.0\n-->\n\n* `size` {Number}\n* `fill` {Value} Default: `undefined`\n* `encoding` {String} Default: `utf8`\n\nAllocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the\n`Buffer` will be *zero-filled*.\n\n```js\nconst buf = Buffer.alloc(5);\nconsole.log(buf);\n  // <Buffer 00 00 00 00 00>\n```\n\nThe `size` must be less than or equal to the value of\n`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is\n`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will\nbe created if a `size` less than or equal to 0 is specified.\n\nIf `fill` is specified, the allocated `Buffer` will be initialized by calling\n`buf.fill(fill)`. See [`buf.fill()`][] for more information.\n\n```js\nconst buf = Buffer.alloc(5, 'a');\nconsole.log(buf);\n  // <Buffer 61 61 61 61 61>\n```\n\nIf both `fill` and `encoding` are specified, the allocated `Buffer` will be\ninitialized by calling `buf.fill(fill, encoding)`. For example:\n\n```js\nconst buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');\nconsole.log(buf);\n  // <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>\n```\n\nCalling `Buffer.alloc(size)` can be significantly slower than the alternative\n`Buffer.allocUnsafe(size)` but ensures that the newly created `Buffer` instance\ncontents will *never contain sensitive data*.\n\nA `TypeError` will be thrown if `size` is not a number.\n\n### Class Method: Buffer.allocUnsafe(size)\n<!-- YAML\nadded: v5.10.0\n-->\n\n* `size` {Number}\n\nAllocates a new *non-zero-filled* `Buffer` of `size` bytes.  The `size` must\nbe less than or equal to the value of `require('buffer').kMaxLength` (on 64-bit\narchitectures, `kMaxLength` is `(2^31)-1`). Otherwise, a [`RangeError`][] is\nthrown. A zero-length Buffer will be created if a `size` less than or equal to\n0 is specified.\n\nThe underlying memory for `Buffer` instances created in this way is *not\ninitialized*. The contents of the newly created `Buffer` are unknown and\n*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such\n`Buffer` instances to zeroes.\n\n```js\nconst buf = Buffer.allocUnsafe(5);\nconsole.log(buf);\n  // <Buffer 78 e0 82 02 01>\n  // (octets will be different, every time)\nbuf.fill(0);\nconsole.log(buf);\n  // <Buffer 00 00 00 00 00>\n```\n\nA `TypeError` will be thrown if `size` is not a number.\n\nNote that the `Buffer` module pre-allocates an internal `Buffer` instance of\nsize `Buffer.poolSize` that is used as a pool for the fast allocation of new\n`Buffer` instances created using `Buffer.allocUnsafe(size)` (and the deprecated\n`new Buffer(size)` constructor) only when `size` is less than or equal to\n`Buffer.poolSize >> 1` (floor of `Buffer.poolSize` divided by two). The default\nvalue of `Buffer.poolSize` is `8192` but can be modified.\n\nUse of this pre-allocated internal memory pool is a key difference between\ncalling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.\nSpecifically, `Buffer.alloc(size, fill)` will *never* use the internal Buffer\npool, while `Buffer.allocUnsafe(size).fill(fill)` *will* use the internal\nBuffer pool if `size` is less than or equal to half `Buffer.poolSize`. The\ndifference is subtle but can be important when an application requires the\nadditional performance that `Buffer.allocUnsafe(size)` provides.\n\n### Class Method: Buffer.allocUnsafeSlow(size)\n<!-- YAML\nadded: v5.10.0\n-->\n\n* `size` {Number}\n\nAllocates a new *non-zero-filled* and non-pooled `Buffer` of `size` bytes.  The\n`size` must be less than or equal to the value of\n`require('buffer').kMaxLength` (on 64-bit architectures, `kMaxLength` is\n`(2^31)-1`). Otherwise, a [`RangeError`][] is thrown. A zero-length Buffer will\nbe created if a `size` less than or equal to 0 is specified.\n\nThe underlying memory for `Buffer` instances created in this way is *not\ninitialized*. The contents of the newly created `Buffer` are unknown and\n*may contain sensitive data*. Use [`buf.fill(0)`][] to initialize such\n`Buffer` instances to zeroes.\n\nWhen using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,\nallocations under 4KB are, by default, sliced from a single pre-allocated\n`Buffer`. This allows applications to avoid the garbage collection overhead of\ncreating many individually allocated Buffers. This approach improves both\nperformance and memory usage by eliminating the need to track and cleanup as\nmany `Persistent` objects.\n\nHowever, in the case where a developer may need to retain a small chunk of\nmemory from a pool for an indeterminate amount of time, it may be appropriate\nto create an un-pooled Buffer instance using `Buffer.allocUnsafeSlow()` then\ncopy out the relevant bits.\n\n```js\n// need to keep around a few small chunks of memory\nconst store = [];\n\nsocket.on('readable', () => {\n  const data = socket.read();\n  // allocate for retained data\n  const sb = Buffer.allocUnsafeSlow(10);\n  // copy the data into the new allocation\n  data.copy(sb, 0, 0, 10);\n  store.push(sb);\n});\n```\n\nUse of `Buffer.allocUnsafeSlow()` should be used only as a last resort *after*\na developer has observed undue memory retention in their applications.\n\nA `TypeError` will be thrown if `size` is not a number.\n\n### All the Rest\n\nThe rest of the `Buffer` API is exactly the same as in node.js.\n[See the docs](https://nodejs.org/api/buffer.html).\n\n\n## Related links\n\n- [Node.js issue: Buffer(number) is unsafe](https://github.com/nodejs/node/issues/4660)\n- [Node.js Enhancement Proposal: Buffer.from/Buffer.alloc/Buffer.zalloc/Buffer() soft-deprecate](https://github.com/nodejs/node-eps/pull/4)\n\n## Why is `Buffer` unsafe?\n\nToday, the node.js `Buffer` constructor is overloaded to handle many different argument\ntypes like `String`, `Array`, `Object`, `TypedArrayView` (`Uint8Array`, etc.),\n`ArrayBuffer`, and also `Number`.\n\nThe API is optimized for convenience: you can throw any type at it, and it will try to do\nwhat you want.\n\nBecause the Buffer constructor is so powerful, you often see code like this:\n\n```js\n// Convert UTF-8 strings to hex\nfunction toHex (str) {\n  return new Buffer(str).toString('hex')\n}\n```\n\n***But what happens if `toHex` is called with a `Number` argument?***\n\n### Remote Memory Disclosure\n\nIf an attacker can make your program call the `Buffer` constructor with a `Number`\nargument, then they can make it allocate uninitialized memory from the node.js process.\nThis could potentially disclose TLS private keys, user data, or database passwords.\n\nWhen the `Buffer` constructor is passed a `Number` argument, it returns an\n**UNINITIALIZED** block of memory of the specified `size`. When you create a `Buffer` like\nthis, you **MUST** overwrite the contents before returning it to the user.\n\nFrom the [node.js docs](https://nodejs.org/api/buffer.html#buffer_new_buffer_size):\n\n> `new Buffer(size)`\n>\n> - `size` Number\n>\n> The underlying memory for `Buffer` instances created in this way is not initialized.\n> **The contents of a newly created `Buffer` are unknown and could contain sensitive\n> data.** Use `buf.fill(0)` to initialize a Buffer to zeroes.\n\n(Emphasis our own.)\n\nWhenever the programmer intended to create an uninitialized `Buffer` you often see code\nlike this:\n\n```js\nvar buf = new Buffer(16)\n\n// Immediately overwrite the uninitialized buffer with data from another buffer\nfor (var i = 0; i < buf.length; i++) {\n  buf[i] = otherBuf[i]\n}\n```\n\n\n### Would this ever be a problem in real code?\n\nYes. It's surprisingly common to forget to check the type of your variables in a\ndynamically-typed language like JavaScript.\n\nUsually the consequences of assuming the wrong type is that your program crashes with an\nuncaught exception. But the failure mode for forgetting to check the type of arguments to\nthe `Buffer` constructor is more catastrophic.\n\nHere's an example of a vulnerable service that takes a JSON payload and converts it to\nhex:\n\n```js\n// Take a JSON payload {str: \"some string\"} and convert it to hex\nvar server = http.createServer(function (req, res) {\n  var data = ''\n  req.setEncoding('utf8')\n  req.on('data', function (chunk) {\n    data += chunk\n  })\n  req.on('end', function () {\n    var body = JSON.parse(data)\n    res.end(new Buffer(body.str).toString('hex'))\n  })\n})\n\nserver.listen(8080)\n```\n\nIn this example, an http client just has to send:\n\n```json\n{\n  \"str\": 1000\n}\n```\n\nand it will get back 1,000 bytes of uninitialized memory from the server.\n\nThis is a very serious bug. It's similar in severity to the\n[the Heartbleed bug](http://heartbleed.com/) that allowed disclosure of OpenSSL process\nmemory by remote attackers.\n\n\n### Which real-world packages were vulnerable?\n\n#### [`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht)\n\n[Mathias Buus](https://github.com/mafintosh) and I\n([Feross Aboukhadijeh](http://feross.org/)) found this issue in one of our own packages,\n[`bittorrent-dht`](https://www.npmjs.com/package/bittorrent-dht). The bug would allow\nanyone on the internet to send a series of messages to a user of `bittorrent-dht` and get\nthem to reveal 20 bytes at a time of uninitialized memory from the node.js process.\n\nHere's\n[the commit](https://github.com/feross/bittorrent-dht/commit/6c7da04025d5633699800a99ec3fbadf70ad35b8)\nthat fixed it. We released a new fixed version, created a\n[Node Security Project disclosure](https://nodesecurity.io/advisories/68), and deprecated all\nvulnerable versions on npm so users will get a warning to upgrade to a newer version.\n\n#### [`ws`](https://www.npmjs.com/package/ws)\n\nThat got us wondering if there were other vulnerable packages. Sure enough, within a short\nperiod of time, we found the same issue in [`ws`](https://www.npmjs.com/package/ws), the\nmost popular WebSocket implementation in node.js.\n\nIf certain APIs were called with `Number` parameters instead of `String` or `Buffer` as\nexpected, then uninitialized server memory would be disclosed to the remote peer.\n\nThese were the vulnerable methods:\n\n```js\nsocket.send(number)\nsocket.ping(number)\nsocket.pong(number)\n```\n\nHere's a vulnerable socket server with some echo functionality:\n\n```js\nserver.on('connection', function (socket) {\n  socket.on('message', function (message) {\n    message = JSON.parse(message)\n    if (message.type === 'echo') {\n      socket.send(message.data) // send back the user's message\n    }\n  })\n})\n```\n\n`socket.send(number)` called on the server, will disclose server memory.\n\nHere's [the release](https://github.com/websockets/ws/releases/tag/1.0.1) where the issue\nwas fixed, with a more detailed explanation. Props to\n[Arnout Kazemier](https://github.com/3rd-Eden) for the quick fix. Here's the\n[Node Security Project disclosure](https://nodesecurity.io/advisories/67).\n\n\n### What's the solution?\n\nIt's important that node.js offers a fast way to get memory otherwise performance-critical\napplications would needlessly get a lot slower.\n\nBut we need a better way to *signal our intent* as programmers. **When we want\nuninitialized memory, we should request it explicitly.**\n\nSensitive functionality should not be packed into a developer-friendly API that loosely\naccepts many different types. This type of API encourages the lazy practice of passing\nvariables in without checking the type very carefully.\n\n#### A new API: `Buffer.allocUnsafe(number)`\n\nThe functionality of creating buffers with uninitialized memory should be part of another\nAPI. We propose `Buffer.allocUnsafe(number)`. This way, it's not part of an API that\nfrequently gets user input of all sorts of different types passed into it.\n\n```js\nvar buf = Buffer.allocUnsafe(16) // careful, uninitialized memory!\n\n// Immediately overwrite the uninitialized buffer with data from another buffer\nfor (var i = 0; i < buf.length; i++) {\n  buf[i] = otherBuf[i]\n}\n```\n\n\n### How do we fix node.js core?\n\nWe sent [a PR to node.js core](https://github.com/nodejs/node/pull/4514) (merged as\n`semver-major`) which defends against one case:\n\n```js\nvar str = 16\nnew Buffer(str, 'utf8')\n```\n\nIn this situation, it's implied that the programmer intended the first argument to be a\nstring, since they passed an encoding as a second argument. Today, node.js will allocate\nuninitialized memory in the case of `new Buffer(number, encoding)`, which is probably not\nwhat the programmer intended.\n\nBut this is only a partial solution, since if the programmer does `new Buffer(variable)`\n(without an `encoding` parameter) there's no way to know what they intended. If `variable`\nis sometimes a number, then uninitialized memory will sometimes be returned.\n\n### What's the real long-term fix?\n\nWe could deprecate and remove `new Buffer(number)` and use `Buffer.allocUnsafe(number)` when\nwe need uninitialized memory. But that would break 1000s of packages.\n\n~~We believe the best solution is to:~~\n\n~~1. Change `new Buffer(number)` to return safe, zeroed-out memory~~\n\n~~2. Create a new API for creating uninitialized Buffers. We propose: `Buffer.allocUnsafe(number)`~~\n\n#### Update\n\nWe now support adding three new APIs:\n\n- `Buffer.from(value)` - convert from any type to a buffer\n- `Buffer.alloc(size)` - create a zero-filled buffer\n- `Buffer.allocUnsafe(size)` - create an uninitialized buffer with given size\n\nThis solves the core problem that affected `ws` and `bittorrent-dht` which is\n`Buffer(variable)` getting tricked into taking a number argument.\n\nThis way, existing code continues working and the impact on the npm ecosystem will be\nminimal. Over time, npm maintainers can migrate performance-critical code to use\n`Buffer.allocUnsafe(number)` instead of `new Buffer(number)`.\n\n\n### Conclusion\n\nWe think there's a serious design issue with the `Buffer` API as it exists today. It\npromotes insecure software by putting high-risk functionality into a convenient API\nwith friendly \"developer ergonomics\".\n\nThis wasn't merely a theoretical exercise because we found the issue in some of the\nmost popular npm packages.\n\nFortunately, there's an easy fix that can be applied today. Use `safe-buffer` in place of\n`buffer`.\n\n```js\nvar Buffer = require('safe-buffer').Buffer\n```\n\nEventually, we hope that node.js core can switch to this new, safer behavior. We believe\nthe impact on the ecosystem would be minimal since it's not a breaking change.\nWell-maintained, popular packages would be updated to use `Buffer.alloc` quickly, while\nolder, insecure packages would magically become safe from this attack vector.\n\n\n## links\n\n- [Node.js PR: buffer: throw if both length and enc are passed](https://github.com/nodejs/node/pull/4514)\n- [Node Security Project disclosure for `ws`](https://nodesecurity.io/advisories/67)\n- [Node Security Project disclosure for`bittorrent-dht`](https://nodesecurity.io/advisories/68)\n\n\n## credit\n\nThe original issues in `bittorrent-dht`\n([disclosure](https://nodesecurity.io/advisories/68)) and\n`ws` ([disclosure](https://nodesecurity.io/advisories/67)) were discovered by\n[Mathias Buus](https://github.com/mafintosh) and\n[Feross Aboukhadijeh](http://feross.org/).\n\nThanks to [Adam Baldwin](https://github.com/evilpacket) for helping disclose these issues\nand for his work running the [Node Security Project](https://nodesecurity.io/).\n\nThanks to [John Hiesey](https://github.com/jhiesey) for proofreading this README and\nauditing the code.\n\n\n## license\n\nMIT. Copyright (C) [Feross Aboukhadijeh](http://feross.org)\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/feross/safe-buffer.git"
+  },
+  "scripts": {
+    "test": "standard && tape test/*.js"
+  },
+  "types": "index.d.ts",
+  "version": "5.1.2"
+}
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/LICENSE b/legacy-libs/grpc/node_modules/safer-buffer/LICENSE
new file mode 100644 (file)
index 0000000..4fe9e6f
--- /dev/null
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2018 Nikita Skovoroda <chalkerx@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/Porting-Buffer.md b/legacy-libs/grpc/node_modules/safer-buffer/Porting-Buffer.md
new file mode 100644 (file)
index 0000000..68d86ba
--- /dev/null
@@ -0,0 +1,268 @@
+# Porting to the Buffer.from/Buffer.alloc API
+
+<a id="overview"></a>
+## Overview
+
+- [Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.](#variant-1) (*recommended*)
+- [Variant 2: Use a polyfill](#variant-2)
+- [Variant 3: manual detection, with safeguards](#variant-3)
+
+### Finding problematic bits of code using grep
+
+Just run `grep -nrE '[^a-zA-Z](Slow)?Buffer\s*\(' --exclude-dir node_modules`.
+
+It will find all the potentially unsafe places in your own code (with some considerably unlikely
+exceptions).
+
+### Finding problematic bits of code using Node.js 8
+
+If you’re using Node.js ≥ 8.0.0 (which is recommended), Node.js exposes multiple options that help with finding the relevant pieces of code:
+
+- `--trace-warnings` will make Node.js show a stack trace for this warning and other warnings that are printed by Node.js.
+- `--trace-deprecation` does the same thing, but only for deprecation warnings.
+- `--pending-deprecation` will show more types of deprecation warnings. In particular, it will show the `Buffer()` deprecation warning, even on Node.js 8.
+
+You can set these flags using an environment variable:
+
+```console
+$ export NODE_OPTIONS='--trace-warnings --pending-deprecation'
+$ cat example.js
+'use strict';
+const foo = new Buffer('foo');
+$ node example.js
+(node:7147) [DEP0005] DeprecationWarning: The Buffer() and new Buffer() constructors are not recommended for use due to security and usability concerns. Please use the new Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() construction methods instead.
+    at showFlaggedDeprecation (buffer.js:127:13)
+    at new Buffer (buffer.js:148:3)
+    at Object.<anonymous> (/path/to/example.js:2:13)
+    [... more stack trace lines ...]
+```
+
+### Finding problematic bits of code using linters
+
+Eslint rules [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
+or
+[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
+also find calls to deprecated `Buffer()` API. Those rules are included in some pre-sets.
+
+There is a drawback, though, that it doesn't always
+[work correctly](https://github.com/chalker/safer-buffer#why-not-safe-buffer) when `Buffer` is
+overriden e.g. with a polyfill, so recommended is a combination of this and some other method
+described above.
+
+<a id="variant-1"></a>
+## Variant 1: Drop support for Node.js ≤ 4.4.x and 5.0.0 — 5.9.x.
+
+This is the recommended solution nowadays that would imply only minimal overhead.
+
+The Node.js 5.x release line has been unsupported since July 2016, and the Node.js 4.x release line reaches its End of Life in April 2018 (→ [Schedule](https://github.com/nodejs/Release#release-schedule)). This means that these versions of Node.js will *not* receive any updates, even in case of security issues, so using these release lines should be avoided, if at all possible.
+
+What you would do in this case is to convert all `new Buffer()` or `Buffer()` calls to use `Buffer.alloc()` or `Buffer.from()`, in the following way:
+
+- For `new Buffer(number)`, replace it with `Buffer.alloc(number)`.
+- For `new Buffer(string)` (or `new Buffer(string, encoding)`), replace it with `Buffer.from(string)` (or `Buffer.from(string, encoding)`).
+- For all other combinations of arguments (these are much rarer), also replace `new Buffer(...arguments)` with `Buffer.from(...arguments)`.
+
+Note that `Buffer.alloc()` is also _faster_ on the current Node.js versions than
+`new Buffer(size).fill(0)`, which is what you would otherwise need to ensure zero-filling.
+
+Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
+or
+[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
+is recommended to avoid accidential unsafe Buffer API usage.
+
+There is also a [JSCodeshift codemod](https://github.com/joyeecheung/node-dep-codemod#dep005)
+for automatically migrating Buffer constructors to `Buffer.alloc()` or `Buffer.from()`.
+Note that it currently only works with cases where the arguments are literals or where the
+constructor is invoked with two arguments.
+
+_If you currently support those older Node.js versions and dropping them would be a semver-major change
+for you, or if you support older branches of your packages, consider using [Variant 2](#variant-2)
+or [Variant 3](#variant-3) on older branches, so people using those older branches will also receive
+the fix. That way, you will eradicate potential issues caused by unguarded Buffer API usage and
+your users will not observe a runtime deprecation warning when running your code on Node.js 10._
+
+<a id="variant-2"></a>
+## Variant 2: Use a polyfill
+
+Utilize [safer-buffer](https://www.npmjs.com/package/safer-buffer) as a polyfill to support older
+Node.js versions.
+
+You would take exacly the same steps as in [Variant 1](#variant-1), but with a polyfill
+`const Buffer = require('safer-buffer').Buffer` in all files where you use the new `Buffer` api.
+
+Make sure that you do not use old `new Buffer` API — in any files where the line above is added,
+using old `new Buffer()` API will _throw_. It will be easy to notice that in CI, though.
+
+Alternatively, you could use [buffer-from](https://www.npmjs.com/package/buffer-from) and/or
+[buffer-alloc](https://www.npmjs.com/package/buffer-alloc) [ponyfills](https://ponyfill.com/) —
+those are great, the only downsides being 4 deps in the tree and slightly more code changes to
+migrate off them (as you would be using e.g. `Buffer.from` under a different name). If you need only
+`Buffer.from` polyfilled — `buffer-from` alone which comes with no extra dependencies.
+
+_Alternatively, you could use [safe-buffer](https://www.npmjs.com/package/safe-buffer) — it also
+provides a polyfill, but takes a different approach which has
+[it's drawbacks](https://github.com/chalker/safer-buffer#why-not-safe-buffer). It will allow you
+to also use the older `new Buffer()` API in your code, though — but that's arguably a benefit, as
+it is problematic, can cause issues in your code, and will start emitting runtime deprecation
+warnings starting with Node.js 10._
+
+Note that in either case, it is important that you also remove all calls to the old Buffer
+API manually — just throwing in `safe-buffer` doesn't fix the problem by itself, it just provides
+a polyfill for the new API. I have seen people doing that mistake.
+
+Enabling eslint rule [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor)
+or
+[node/no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)
+is recommended.
+
+_Don't forget to drop the polyfill usage once you drop support for Node.js < 4.5.0._
+
+<a id="variant-3"></a>
+## Variant 3 — manual detection, with safeguards
+
+This is useful if you create Buffer instances in only a few places (e.g. one), or you have your own
+wrapper around them.
+
+### Buffer(0)
+
+This special case for creating empty buffers can be safely replaced with `Buffer.concat([])`, which
+returns the same result all the way down to Node.js 0.8.x.
+
+### Buffer(notNumber)
+
+Before:
+
+```js
+var buf = new Buffer(notNumber, encoding);
+```
+
+After:
+
+```js
+var buf;
+if (Buffer.from && Buffer.from !== Uint8Array.from) {
+  buf = Buffer.from(notNumber, encoding);
+} else {
+  if (typeof notNumber === 'number')
+    throw new Error('The "size" argument must be of type number.');
+  buf = new Buffer(notNumber, encoding);
+}
+```
+
+`encoding` is optional.
+
+Note that the `typeof notNumber` before `new Buffer` is required (for cases when `notNumber` argument is not
+hard-coded) and _is not caused by the deprecation of Buffer constructor_ — it's exactly _why_ the
+Buffer constructor is deprecated. Ecosystem packages lacking this type-check caused numereous
+security issues — situations when unsanitized user input could end up in the `Buffer(arg)` create
+problems ranging from DoS to leaking sensitive information to the attacker from the process memory.
+
+When `notNumber` argument is hardcoded (e.g. literal `"abc"` or `[0,1,2]`), the `typeof` check can
+be omitted.
+
+Also note that using TypeScript does not fix this problem for you — when libs written in
+`TypeScript` are used from JS, or when user input ends up there — it behaves exactly as pure JS, as
+all type checks are translation-time only and are not present in the actual JS code which TS
+compiles to.
+
+### Buffer(number)
+
+For Node.js 0.10.x (and below) support:
+
+```js
+var buf;
+if (Buffer.alloc) {
+  buf = Buffer.alloc(number);
+} else {
+  buf = new Buffer(number);
+  buf.fill(0);
+}
+```
+
+Otherwise (Node.js ≥ 0.12.x):
+
+```js
+const buf = Buffer.alloc ? Buffer.alloc(number) : new Buffer(number).fill(0);
+```
+
+## Regarding Buffer.allocUnsafe
+
+Be extra cautious when using `Buffer.allocUnsafe`:
+ * Don't use it if you don't have a good reason to
+   * e.g. you probably won't ever see a performance difference for small buffers, in fact, those
+     might be even faster with `Buffer.alloc()`,
+   * if your code is not in the hot code path — you also probably won't notice a difference,
+   * keep in mind that zero-filling minimizes the potential risks.
+ * If you use it, make sure that you never return the buffer in a partially-filled state,
+   * if you are writing to it sequentially — always truncate it to the actuall written length
+
+Errors in handling buffers allocated with `Buffer.allocUnsafe` could result in various issues,
+ranged from undefined behaviour of your code to sensitive data (user input, passwords, certs)
+leaking to the remote attacker.
+
+_Note that the same applies to `new Buffer` usage without zero-filling, depending on the Node.js
+version (and lacking type checks also adds DoS to the list of potential problems)._
+
+<a id="faq"></a>
+## FAQ
+
+<a id="design-flaws"></a>
+### What is wrong with the `Buffer` constructor?
+
+The `Buffer` constructor could be used to create a buffer in many different ways:
+
+- `new Buffer(42)` creates a `Buffer` of 42 bytes. Before Node.js 8, this buffer contained
+  *arbitrary memory* for performance reasons, which could include anything ranging from
+  program source code to passwords and encryption keys.
+- `new Buffer('abc')` creates a `Buffer` that contains the UTF-8-encoded version of
+  the string `'abc'`. A second argument could specify another encoding: For example,
+  `new Buffer(string, 'base64')` could be used to convert a Base64 string into the original
+  sequence of bytes that it represents.
+- There are several other combinations of arguments.
+
+This meant that, in code like `var buffer = new Buffer(foo);`, *it is not possible to tell
+what exactly the contents of the generated buffer are* without knowing the type of `foo`.
+
+Sometimes, the value of `foo` comes from an external source. For example, this function
+could be exposed as a service on a web server, converting a UTF-8 string into its Base64 form:
+
+```
+function stringToBase64(req, res) {
+  // The request body should have the format of `{ string: 'foobar' }`
+  const rawBytes = new Buffer(req.body.string)
+  const encoded = rawBytes.toString('base64')
+  res.end({ encoded: encoded })
+}
+```
+
+Note that this code does *not* validate the type of `req.body.string`:
+
+- `req.body.string` is expected to be a string. If this is the case, all goes well.
+- `req.body.string` is controlled by the client that sends the request.
+- If `req.body.string` is the *number* `50`, the `rawBytes` would be 50 bytes:
+  - Before Node.js 8, the content would be uninitialized
+  - After Node.js 8, the content would be `50` bytes with the value `0`
+
+Because of the missing type check, an attacker could intentionally send a number
+as part of the request. Using this, they can either:
+
+- Read uninitialized memory. This **will** leak passwords, encryption keys and other
+  kinds of sensitive information. (Information leak)
+- Force the program to allocate a large amount of memory. For example, when specifying
+  `500000000` as the input value, each request will allocate 500MB of memory.
+  This can be used to either exhaust the memory available of a program completely
+  and make it crash, or slow it down significantly. (Denial of Service)
+
+Both of these scenarios are considered serious security issues in a real-world
+web server context.
+
+when using `Buffer.from(req.body.string)` instead, passing a number will always
+throw an exception instead, giving a controlled behaviour that can always be
+handled by the program.
+
+<a id="ecosystem-usage"></a>
+### The `Buffer()` constructor has been deprecated for a while. Is this really an issue?
+
+Surveys of code in the `npm` ecosystem have shown that the `Buffer()` constructor is still
+widely used. This includes new code, and overall usage of such code has actually been
+*increasing*.
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/Readme.md b/legacy-libs/grpc/node_modules/safer-buffer/Readme.md
new file mode 100644 (file)
index 0000000..14b0822
--- /dev/null
@@ -0,0 +1,156 @@
+# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url]
+
+[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master
+[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer
+[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg
+[npm-url]: https://npmjs.org/package/safer-buffer
+[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
+[standard-url]: https://standardjs.com
+[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg
+[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md
+
+Modern Buffer API polyfill without footguns, working on Node.js from 0.8 to current.
+
+## How to use?
+
+First, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API.
+
+Then, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use
+`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new
+Buffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._
+
+Also, see the
+[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide.
+
+## Do I need it?
+
+Hopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that
+is the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()`
+though.
+
+See the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md)
+for a better description.
+
+## Why not [safe-buffer](https://npmjs.com/safe-buffer)?
+
+_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and
+itself contains footguns._
+
+`safe-buffer` could be used safely to get the new API while still keeping support for older
+Node.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API
+I found out that `safe-buffer` is itself causing problems in some cases.
+
+For example, consider the following snippet:
+
+```console
+$ cat example.unsafe.js
+console.log(Buffer(20))
+$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js
+<Buffer 0a 00 00 00 00 00 00 00 28 13 de 02 00 00 00 00 05 00 00 00>
+$ standard example.unsafe.js
+standard: Use JavaScript Standard Style (https://standardjs.com)
+  /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead.
+```
+
+This is allocates and writes to console an uninitialized chunk of memory.
+[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people
+to avoid using unsafe API.
+
+Let's now throw in `safe-buffer`!
+
+```console
+$ cat example.safe-buffer.js
+const Buffer = require('safe-buffer').Buffer
+console.log(Buffer(20))
+$ standard example.safe-buffer.js
+$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js
+<Buffer 08 00 00 00 00 00 00 00 28 58 01 82 fe 7f 00 00 00 00 00 00>
+```
+
+See the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior
+remains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out
+chunks of uninitialized memory.
+_And this code will still emit runtime warnings on Node.js 10.x and above._
+
+That was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or
+emitting warnings on it, but that significantly diverges from `safe-buffer` design. After some
+discussion, it was decided to move my approach into a separate package, and _this is that separate
+package_.
+
+This footgun is not imaginary — I observed top-downloaded packages doing that kind of thing,
+«fixing» the lint warning by blindly including `safe-buffer` without any actual changes.
+
+Also in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request
+can bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go
+unnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even
+pass CI. _I also observed that being done in popular packages._
+
+Some examples:
+ * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31)
+   (a module with 548 759 downloads/month),
+ * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61)
+   (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)),
+ * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c)
+   (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)),
+ * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec)
+   (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)),
+ * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1)
+   (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)).
+ * And there are a lot more over the ecosystem.
+
+I filed a PR at
+[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to
+partially fix that (for cases when that lint rule is used), but it is a semver-major change for
+linter rules and presets, so it would take significant time for that to reach actual setups.
+_It also hasn't been released yet (2018-03-20)._
+
+Also, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake.
+It still supports it with an explicit concern barier, by placing it under
+`require('safer-buffer/dangereous')`.
+
+## But isn't throwing bad?
+
+Not really. It's an error that could be noticed and fixed early, instead of causing havoc later like
+unguarded `new Buffer()` calls that end up receiving user input can do.
+
+This package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so
+it is really simple to keep track of things and make sure that you don't mix old API usage with that.
+Also, CI should hint anything that you might have missed.
+
+New commits, if tested, won't land new usage of unsafe Buffer API this way.
+_Node.js 10.x also deals with that by printing a runtime depecation warning._
+
+### Would it affect third-party modules?
+
+No, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`.
+Don't do that.
+
+### But I don't want throwing…
+
+That is also fine!
+
+Also, it could be better in some cases when you don't comprehensive enough test coverage.
+
+In that case — just don't override `Buffer` and use
+`var SaferBuffer = require('safer-buffer').Buffer` instead.
+
+That way, everything using `Buffer` natively would still work, but there would be two drawbacks:
+
+* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and
+  `SaferBuffer.alloc` instead.
+* You are still open to accidentally using the insecure deprecated API — use a linter to catch that.
+
+Note that using a linter to catch accidential `Buffer` constructor usage in this case is strongly
+recommended. `Buffer` is not overriden in this usecase, so linters won't get confused.
+
+## «Without footguns»?
+
+Well, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property
+on older versions and duping things from there. You shouldn't do that in your code, probabably.
+
+The intention is to remove the most significant footguns that affect lots of packages in the
+ecosystem, and to do it in the proper way.
+
+Also, this package doesn't protect against security issues affecting some Node.js versions, so for
+usage in your own production code, it is still recommended to update to a Node.js version
+[supported by upstream](https://github.com/nodejs/release#release-schedule).
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/dangerous.js b/legacy-libs/grpc/node_modules/safer-buffer/dangerous.js
new file mode 100644 (file)
index 0000000..ca41fdc
--- /dev/null
@@ -0,0 +1,58 @@
+/* eslint-disable node/no-deprecated-api */
+
+'use strict'
+
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+var safer = require('./safer.js')
+var Safer = safer.Buffer
+
+var dangerous = {}
+
+var key
+
+for (key in safer) {
+  if (!safer.hasOwnProperty(key)) continue
+  dangerous[key] = safer[key]
+}
+
+var Dangereous = dangerous.Buffer = {}
+
+// Copy Safer API
+for (key in Safer) {
+  if (!Safer.hasOwnProperty(key)) continue
+  Dangereous[key] = Safer[key]
+}
+
+// Copy those missing unsafe methods, if they are present
+for (key in Buffer) {
+  if (!Buffer.hasOwnProperty(key)) continue
+  if (Dangereous.hasOwnProperty(key)) continue
+  Dangereous[key] = Buffer[key]
+}
+
+if (!Dangereous.allocUnsafe) {
+  Dangereous.allocUnsafe = function (size) {
+    if (typeof size !== 'number') {
+      throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
+    }
+    if (size < 0 || size >= 2 * (1 << 30)) {
+      throw new RangeError('The value "' + size + '" is invalid for option "size"')
+    }
+    return Buffer(size)
+  }
+}
+
+if (!Dangereous.allocUnsafeSlow) {
+  Dangereous.allocUnsafeSlow = function (size) {
+    if (typeof size !== 'number') {
+      throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
+    }
+    if (size < 0 || size >= 2 * (1 << 30)) {
+      throw new RangeError('The value "' + size + '" is invalid for option "size"')
+    }
+    return buffer.SlowBuffer(size)
+  }
+}
+
+module.exports = dangerous
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/package.json b/legacy-libs/grpc/node_modules/safer-buffer/package.json
new file mode 100644 (file)
index 0000000..b517537
--- /dev/null
@@ -0,0 +1,68 @@
+{
+  "_args": [
+    [
+      "safer-buffer@2.1.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "safer-buffer@2.1.2",
+  "_id": "safer-buffer@2.1.2",
+  "_inBundle": false,
+  "_integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+  "_location": "/grpc/safer-buffer",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "safer-buffer@2.1.2",
+    "name": "safer-buffer",
+    "escapedName": "safer-buffer",
+    "rawSpec": "2.1.2",
+    "saveSpec": null,
+    "fetchSpec": "2.1.2"
+  },
+  "_requiredBy": [
+    "/grpc/iconv-lite"
+  ],
+  "_resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.1.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Nikita Skovoroda",
+    "email": "chalkerx@gmail.com",
+    "url": "https://github.com/ChALkeR"
+  },
+  "bugs": {
+    "url": "https://github.com/ChALkeR/safer-buffer/issues"
+  },
+  "dependencies": {},
+  "description": "Modern Buffer API polyfill without footguns",
+  "devDependencies": {
+    "standard": "^11.0.1",
+    "tape": "^4.9.0"
+  },
+  "files": [
+    "Porting-Buffer.md",
+    "Readme.md",
+    "tests.js",
+    "dangerous.js",
+    "safer.js"
+  ],
+  "homepage": "https://github.com/ChALkeR/safer-buffer#readme",
+  "license": "MIT",
+  "main": "safer.js",
+  "name": "safer-buffer",
+  "optionalDependencies": {},
+  "readme": "# safer-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![javascript style guide][standard-image]][standard-url] [![Security Responsible Disclosure][secuirty-image]][secuirty-url]\n\n[travis-image]: https://travis-ci.org/ChALkeR/safer-buffer.svg?branch=master\n[travis-url]: https://travis-ci.org/ChALkeR/safer-buffer\n[npm-image]: https://img.shields.io/npm/v/safer-buffer.svg\n[npm-url]: https://npmjs.org/package/safer-buffer\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n[secuirty-image]: https://img.shields.io/badge/Security-Responsible%20Disclosure-green.svg\n[secuirty-url]: https://github.com/nodejs/security-wg/blob/master/processes/responsible_disclosure_template.md\n\nModern Buffer API polyfill without footguns, working on Node.js from 0.8 to current.\n\n## How to use?\n\nFirst, port all `Buffer()` and `new Buffer()` calls to `Buffer.alloc()` and `Buffer.from()` API.\n\nThen, to achieve compatibility with outdated Node.js versions (`<4.5.0` and 5.x `<5.9.0`), use\n`const Buffer = require('safer-buffer').Buffer` in all files where you make calls to the new\nBuffer API. _Use `var` instead of `const` if you need that for your Node.js version range support._\n\nAlso, see the\n[porting Buffer](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md) guide.\n\n## Do I need it?\n\nHopefully, not — dropping support for outdated Node.js versions should be fine nowdays, and that\nis the recommended path forward. You _do_ need to port to the `Buffer.alloc()` and `Buffer.from()`\nthough.\n\nSee the [porting guide](https://github.com/ChALkeR/safer-buffer/blob/master/Porting-Buffer.md)\nfor a better description.\n\n## Why not [safe-buffer](https://npmjs.com/safe-buffer)?\n\n_In short: while `safe-buffer` serves as a polyfill for the new API, it allows old API usage and\nitself contains footguns._\n\n`safe-buffer` could be used safely to get the new API while still keeping support for older\nNode.js versions (like this module), but while analyzing ecosystem usage of the old Buffer API\nI found out that `safe-buffer` is itself causing problems in some cases.\n\nFor example, consider the following snippet:\n\n```console\n$ cat example.unsafe.js\nconsole.log(Buffer(20))\n$ ./node-v6.13.0-linux-x64/bin/node example.unsafe.js\n<Buffer 0a 00 00 00 00 00 00 00 28 13 de 02 00 00 00 00 05 00 00 00>\n$ standard example.unsafe.js\nstandard: Use JavaScript Standard Style (https://standardjs.com)\n  /home/chalker/repo/safer-buffer/example.unsafe.js:2:13: 'Buffer()' was deprecated since v6. Use 'Buffer.alloc()' or 'Buffer.from()' (use 'https://www.npmjs.com/package/safe-buffer' for '<4.5.0') instead.\n```\n\nThis is allocates and writes to console an uninitialized chunk of memory.\n[standard](https://www.npmjs.com/package/standard) linter (among others) catch that and warn people\nto avoid using unsafe API.\n\nLet's now throw in `safe-buffer`!\n\n```console\n$ cat example.safe-buffer.js\nconst Buffer = require('safe-buffer').Buffer\nconsole.log(Buffer(20))\n$ standard example.safe-buffer.js\n$ ./node-v6.13.0-linux-x64/bin/node example.safe-buffer.js\n<Buffer 08 00 00 00 00 00 00 00 28 58 01 82 fe 7f 00 00 00 00 00 00>\n```\n\nSee the problem? Adding in `safe-buffer` _magically removes the lint warning_, but the behavior\nremains identiсal to what we had before, and when launched on Node.js 6.x LTS — this dumps out\nchunks of uninitialized memory.\n_And this code will still emit runtime warnings on Node.js 10.x and above._\n\nThat was done by design. I first considered changing `safe-buffer`, prohibiting old API usage or\nemitting warnings on it, but that significantly diverges from `safe-buffer` design. After some\ndiscussion, it was decided to move my approach into a separate package, and _this is that separate\npackage_.\n\nThis footgun is not imaginary — I observed top-downloaded packages doing that kind of thing,\n«fixing» the lint warning by blindly including `safe-buffer` without any actual changes.\n\nAlso in some cases, even if the API _was_ migrated to use of safe Buffer API — a random pull request\ncan bring unsafe Buffer API usage back to the codebase by adding new calls — and that could go\nunnoticed even if you have a linter prohibiting that (becase of the reason stated above), and even\npass CI. _I also observed that being done in popular packages._\n\nSome examples:\n * [webdriverio](https://github.com/webdriverio/webdriverio/commit/05cbd3167c12e4930f09ef7cf93b127ba4effae4#diff-124380949022817b90b622871837d56cR31)\n   (a module with 548 759 downloads/month),\n * [websocket-stream](https://github.com/maxogden/websocket-stream/commit/c9312bd24d08271687d76da0fe3c83493871cf61)\n   (218 288 d/m, fix in [maxogden/websocket-stream#142](https://github.com/maxogden/websocket-stream/pull/142)),\n * [node-serialport](https://github.com/node-serialport/node-serialport/commit/e8d9d2b16c664224920ce1c895199b1ce2def48c)\n   (113 138 d/m, fix in [node-serialport/node-serialport#1510](https://github.com/node-serialport/node-serialport/pull/1510)),\n * [karma](https://github.com/karma-runner/karma/commit/3d94b8cf18c695104ca195334dc75ff054c74eec)\n   (3 973 193 d/m, fix in [karma-runner/karma#2947](https://github.com/karma-runner/karma/pull/2947)),\n * [spdy-transport](https://github.com/spdy-http2/spdy-transport/commit/5375ac33f4a62a4f65bcfc2827447d42a5dbe8b1)\n   (5 970 727 d/m, fix in [spdy-http2/spdy-transport#53](https://github.com/spdy-http2/spdy-transport/pull/53)).\n * And there are a lot more over the ecosystem.\n\nI filed a PR at\n[mysticatea/eslint-plugin-node#110](https://github.com/mysticatea/eslint-plugin-node/pull/110) to\npartially fix that (for cases when that lint rule is used), but it is a semver-major change for\nlinter rules and presets, so it would take significant time for that to reach actual setups.\n_It also hasn't been released yet (2018-03-20)._\n\nAlso, `safer-buffer` discourages the usage of `.allocUnsafe()`, which is often done by a mistake.\nIt still supports it with an explicit concern barier, by placing it under\n`require('safer-buffer/dangereous')`.\n\n## But isn't throwing bad?\n\nNot really. It's an error that could be noticed and fixed early, instead of causing havoc later like\nunguarded `new Buffer()` calls that end up receiving user input can do.\n\nThis package affects only the files where `var Buffer = require('safer-buffer').Buffer` was done, so\nit is really simple to keep track of things and make sure that you don't mix old API usage with that.\nAlso, CI should hint anything that you might have missed.\n\nNew commits, if tested, won't land new usage of unsafe Buffer API this way.\n_Node.js 10.x also deals with that by printing a runtime depecation warning._\n\n### Would it affect third-party modules?\n\nNo, unless you explicitly do an awful thing like monkey-patching or overriding the built-in `Buffer`.\nDon't do that.\n\n### But I don't want throwing…\n\nThat is also fine!\n\nAlso, it could be better in some cases when you don't comprehensive enough test coverage.\n\nIn that case — just don't override `Buffer` and use\n`var SaferBuffer = require('safer-buffer').Buffer` instead.\n\nThat way, everything using `Buffer` natively would still work, but there would be two drawbacks:\n\n* `Buffer.from`/`Buffer.alloc` won't be polyfilled — use `SaferBuffer.from` and\n  `SaferBuffer.alloc` instead.\n* You are still open to accidentally using the insecure deprecated API — use a linter to catch that.\n\nNote that using a linter to catch accidential `Buffer` constructor usage in this case is strongly\nrecommended. `Buffer` is not overriden in this usecase, so linters won't get confused.\n\n## «Without footguns»?\n\nWell, it is still possible to do _some_ things with `Buffer` API, e.g. accessing `.buffer` property\non older versions and duping things from there. You shouldn't do that in your code, probabably.\n\nThe intention is to remove the most significant footguns that affect lots of packages in the\necosystem, and to do it in the proper way.\n\nAlso, this package doesn't protect against security issues affecting some Node.js versions, so for\nusage in your own production code, it is still recommended to update to a Node.js version\n[supported by upstream](https://github.com/nodejs/release#release-schedule).\n",
+  "readmeFilename": "Readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/ChALkeR/safer-buffer.git"
+  },
+  "scripts": {
+    "browserify-test": "browserify --external tape tests.js > browserify-tests.js && tape browserify-tests.js",
+    "test": "standard && tape tests.js"
+  },
+  "version": "2.1.2"
+}
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/safer.js b/legacy-libs/grpc/node_modules/safer-buffer/safer.js
new file mode 100644 (file)
index 0000000..37c7e1a
--- /dev/null
@@ -0,0 +1,77 @@
+/* eslint-disable node/no-deprecated-api */
+
+'use strict'
+
+var buffer = require('buffer')
+var Buffer = buffer.Buffer
+
+var safer = {}
+
+var key
+
+for (key in buffer) {
+  if (!buffer.hasOwnProperty(key)) continue
+  if (key === 'SlowBuffer' || key === 'Buffer') continue
+  safer[key] = buffer[key]
+}
+
+var Safer = safer.Buffer = {}
+for (key in Buffer) {
+  if (!Buffer.hasOwnProperty(key)) continue
+  if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
+  Safer[key] = Buffer[key]
+}
+
+safer.Buffer.prototype = Buffer.prototype
+
+if (!Safer.from || Safer.from === Uint8Array.from) {
+  Safer.from = function (value, encodingOrOffset, length) {
+    if (typeof value === 'number') {
+      throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
+    }
+    if (value && typeof value.length === 'undefined') {
+      throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
+    }
+    return Buffer(value, encodingOrOffset, length)
+  }
+}
+
+if (!Safer.alloc) {
+  Safer.alloc = function (size, fill, encoding) {
+    if (typeof size !== 'number') {
+      throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
+    }
+    if (size < 0 || size >= 2 * (1 << 30)) {
+      throw new RangeError('The value "' + size + '" is invalid for option "size"')
+    }
+    var buf = Buffer(size)
+    if (!fill || fill.length === 0) {
+      buf.fill(0)
+    } else if (typeof encoding === 'string') {
+      buf.fill(fill, encoding)
+    } else {
+      buf.fill(fill)
+    }
+    return buf
+  }
+}
+
+if (!safer.kStringMaxLength) {
+  try {
+    safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
+  } catch (e) {
+    // we can't determine kStringMaxLength in environments where process.binding
+    // is unsupported, so let's not set it
+  }
+}
+
+if (!safer.constants) {
+  safer.constants = {
+    MAX_LENGTH: safer.kMaxLength
+  }
+  if (safer.kStringMaxLength) {
+    safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
+  }
+}
+
+module.exports = safer
diff --git a/legacy-libs/grpc/node_modules/safer-buffer/tests.js b/legacy-libs/grpc/node_modules/safer-buffer/tests.js
new file mode 100644 (file)
index 0000000..7ed2777
--- /dev/null
@@ -0,0 +1,406 @@
+/* eslint-disable node/no-deprecated-api */
+
+'use strict'
+
+var test = require('tape')
+
+var buffer = require('buffer')
+
+var index = require('./')
+var safer = require('./safer')
+var dangerous = require('./dangerous')
+
+/* Inheritance tests */
+
+test('Default is Safer', function (t) {
+  t.equal(index, safer)
+  t.notEqual(safer, dangerous)
+  t.notEqual(index, dangerous)
+  t.end()
+})
+
+test('Is not a function', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.equal(typeof impl, 'object')
+    t.equal(typeof impl.Buffer, 'object')
+  });
+  [buffer].forEach(function (impl) {
+    t.equal(typeof impl, 'object')
+    t.equal(typeof impl.Buffer, 'function')
+  })
+  t.end()
+})
+
+test('Constructor throws', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.throws(function () { impl.Buffer() })
+    t.throws(function () { impl.Buffer(0) })
+    t.throws(function () { impl.Buffer('a') })
+    t.throws(function () { impl.Buffer('a', 'utf-8') })
+    t.throws(function () { return new impl.Buffer() })
+    t.throws(function () { return new impl.Buffer(0) })
+    t.throws(function () { return new impl.Buffer('a') })
+    t.throws(function () { return new impl.Buffer('a', 'utf-8') })
+  })
+  t.end()
+})
+
+test('Safe methods exist', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.equal(typeof impl.Buffer.alloc, 'function', 'alloc')
+    t.equal(typeof impl.Buffer.from, 'function', 'from')
+  })
+  t.end()
+})
+
+test('Unsafe methods exist only in Dangerous', function (t) {
+  [index, safer].forEach(function (impl) {
+    t.equal(typeof impl.Buffer.allocUnsafe, 'undefined')
+    t.equal(typeof impl.Buffer.allocUnsafeSlow, 'undefined')
+  });
+  [dangerous].forEach(function (impl) {
+    t.equal(typeof impl.Buffer.allocUnsafe, 'function')
+    t.equal(typeof impl.Buffer.allocUnsafeSlow, 'function')
+  })
+  t.end()
+})
+
+test('Generic methods/properties are defined and equal', function (t) {
+  ['poolSize', 'isBuffer', 'concat', 'byteLength'].forEach(function (method) {
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl.Buffer[method], buffer.Buffer[method], method)
+      t.notEqual(typeof impl.Buffer[method], 'undefined', method)
+    })
+  })
+  t.end()
+})
+
+test('Built-in buffer static methods/properties are inherited', function (t) {
+  Object.keys(buffer).forEach(function (method) {
+    if (method === 'SlowBuffer' || method === 'Buffer') return;
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl[method], buffer[method], method)
+      t.notEqual(typeof impl[method], 'undefined', method)
+    })
+  })
+  t.end()
+})
+
+test('Built-in Buffer static methods/properties are inherited', function (t) {
+  Object.keys(buffer.Buffer).forEach(function (method) {
+    if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl.Buffer[method], buffer.Buffer[method], method)
+      t.notEqual(typeof impl.Buffer[method], 'undefined', method)
+    })
+  })
+  t.end()
+})
+
+test('.prototype property of Buffer is inherited', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.equal(impl.Buffer.prototype, buffer.Buffer.prototype, 'prototype')
+    t.notEqual(typeof impl.Buffer.prototype, 'undefined', 'prototype')
+  })
+  t.end()
+})
+
+test('All Safer methods are present in Dangerous', function (t) {
+  Object.keys(safer).forEach(function (method) {
+    if (method === 'Buffer') return;
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl[method], safer[method], method)
+      if (method !== 'kStringMaxLength') {
+        t.notEqual(typeof impl[method], 'undefined', method)
+      }
+    })
+  })
+  Object.keys(safer.Buffer).forEach(function (method) {
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl.Buffer[method], safer.Buffer[method], method)
+      t.notEqual(typeof impl.Buffer[method], 'undefined', method)
+    })
+  })
+  t.end()
+})
+
+test('Safe methods from Dangerous methods are present in Safer', function (t) {
+  Object.keys(dangerous).forEach(function (method) {
+    if (method === 'Buffer') return;
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl[method], dangerous[method], method)
+      if (method !== 'kStringMaxLength') {
+        t.notEqual(typeof impl[method], 'undefined', method)
+      }
+    })
+  })
+  Object.keys(dangerous.Buffer).forEach(function (method) {
+    if (method === 'allocUnsafe' || method === 'allocUnsafeSlow') return;
+    [index, safer, dangerous].forEach(function (impl) {
+      t.equal(impl.Buffer[method], dangerous.Buffer[method], method)
+      t.notEqual(typeof impl.Buffer[method], 'undefined', method)
+    })
+  })
+  t.end()
+})
+
+/* Behaviour tests */
+
+test('Methods return Buffers', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0)))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 10)))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(0, 'a')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10)))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(10, 'x')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.alloc(9, 'ab')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('string', 'utf-8')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64')))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([0, 42, 3])))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from(new Uint8Array([0, 42, 3]))))
+    t.ok(buffer.Buffer.isBuffer(impl.Buffer.from([])))
+  });
+  ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
+    t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](0)))
+    t.ok(buffer.Buffer.isBuffer(dangerous.Buffer[method](10)))
+  })
+  t.end()
+})
+
+test('Constructor is buffer.Buffer', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.equal(impl.Buffer.alloc(0).constructor, buffer.Buffer)
+    t.equal(impl.Buffer.alloc(0, 10).constructor, buffer.Buffer)
+    t.equal(impl.Buffer.alloc(0, 'a').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.alloc(10).constructor, buffer.Buffer)
+    t.equal(impl.Buffer.alloc(10, 'x').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.alloc(9, 'ab').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from('').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from('string').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from('string', 'utf-8').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from([0, 42, 3]).constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).constructor, buffer.Buffer)
+    t.equal(impl.Buffer.from([]).constructor, buffer.Buffer)
+  });
+  [0, 10, 100].forEach(function (arg) {
+    t.equal(dangerous.Buffer.allocUnsafe(arg).constructor, buffer.Buffer)
+    t.equal(dangerous.Buffer.allocUnsafeSlow(arg).constructor, buffer.SlowBuffer(0).constructor)
+  })
+  t.end()
+})
+
+test('Invalid calls throw', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.throws(function () { impl.Buffer.from(0) })
+    t.throws(function () { impl.Buffer.from(10) })
+    t.throws(function () { impl.Buffer.from(10, 'utf-8') })
+    t.throws(function () { impl.Buffer.from('string', 'invalid encoding') })
+    t.throws(function () { impl.Buffer.from(-10) })
+    t.throws(function () { impl.Buffer.from(1e90) })
+    t.throws(function () { impl.Buffer.from(Infinity) })
+    t.throws(function () { impl.Buffer.from(-Infinity) })
+    t.throws(function () { impl.Buffer.from(NaN) })
+    t.throws(function () { impl.Buffer.from(null) })
+    t.throws(function () { impl.Buffer.from(undefined) })
+    t.throws(function () { impl.Buffer.from() })
+    t.throws(function () { impl.Buffer.from({}) })
+    t.throws(function () { impl.Buffer.alloc('') })
+    t.throws(function () { impl.Buffer.alloc('string') })
+    t.throws(function () { impl.Buffer.alloc('string', 'utf-8') })
+    t.throws(function () { impl.Buffer.alloc('b25ldHdvdGhyZWU=', 'base64') })
+    t.throws(function () { impl.Buffer.alloc(-10) })
+    t.throws(function () { impl.Buffer.alloc(1e90) })
+    t.throws(function () { impl.Buffer.alloc(2 * (1 << 30)) })
+    t.throws(function () { impl.Buffer.alloc(Infinity) })
+    t.throws(function () { impl.Buffer.alloc(-Infinity) })
+    t.throws(function () { impl.Buffer.alloc(null) })
+    t.throws(function () { impl.Buffer.alloc(undefined) })
+    t.throws(function () { impl.Buffer.alloc() })
+    t.throws(function () { impl.Buffer.alloc([]) })
+    t.throws(function () { impl.Buffer.alloc([0, 42, 3]) })
+    t.throws(function () { impl.Buffer.alloc({}) })
+  });
+  ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
+    t.throws(function () { dangerous.Buffer[method]('') })
+    t.throws(function () { dangerous.Buffer[method]('string') })
+    t.throws(function () { dangerous.Buffer[method]('string', 'utf-8') })
+    t.throws(function () { dangerous.Buffer[method](2 * (1 << 30)) })
+    t.throws(function () { dangerous.Buffer[method](Infinity) })
+    if (dangerous.Buffer[method] === buffer.Buffer.allocUnsafe) {
+      t.skip('Skipping, older impl of allocUnsafe coerced negative sizes to 0')
+    } else {
+      t.throws(function () { dangerous.Buffer[method](-10) })
+      t.throws(function () { dangerous.Buffer[method](-1e90) })
+      t.throws(function () { dangerous.Buffer[method](-Infinity) })
+    }
+    t.throws(function () { dangerous.Buffer[method](null) })
+    t.throws(function () { dangerous.Buffer[method](undefined) })
+    t.throws(function () { dangerous.Buffer[method]() })
+    t.throws(function () { dangerous.Buffer[method]([]) })
+    t.throws(function () { dangerous.Buffer[method]([0, 42, 3]) })
+    t.throws(function () { dangerous.Buffer[method]({}) })
+  })
+  t.end()
+})
+
+test('Buffers have appropriate lengths', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.equal(impl.Buffer.alloc(0).length, 0)
+    t.equal(impl.Buffer.alloc(10).length, 10)
+    t.equal(impl.Buffer.from('').length, 0)
+    t.equal(impl.Buffer.from('string').length, 6)
+    t.equal(impl.Buffer.from('string', 'utf-8').length, 6)
+    t.equal(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64').length, 11)
+    t.equal(impl.Buffer.from([0, 42, 3]).length, 3)
+    t.equal(impl.Buffer.from(new Uint8Array([0, 42, 3])).length, 3)
+    t.equal(impl.Buffer.from([]).length, 0)
+  });
+  ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
+    t.equal(dangerous.Buffer[method](0).length, 0)
+    t.equal(dangerous.Buffer[method](10).length, 10)
+  })
+  t.end()
+})
+
+test('Buffers have appropriate lengths (2)', function (t) {
+  t.equal(index.Buffer.alloc, safer.Buffer.alloc)
+  t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
+  var ok = true;
+  [ safer.Buffer.alloc,
+    dangerous.Buffer.allocUnsafe,
+    dangerous.Buffer.allocUnsafeSlow
+  ].forEach(function (method) {
+    for (var i = 0; i < 1e2; i++) {
+      var length = Math.round(Math.random() * 1e5)
+      var buf = method(length)
+      if (!buffer.Buffer.isBuffer(buf)) ok = false
+      if (buf.length !== length) ok = false
+    }
+  })
+  t.ok(ok)
+  t.end()
+})
+
+test('.alloc(size) is zero-filled and has correct length', function (t) {
+  t.equal(index.Buffer.alloc, safer.Buffer.alloc)
+  t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
+  var ok = true
+  for (var i = 0; i < 1e2; i++) {
+    var length = Math.round(Math.random() * 2e6)
+    var buf = index.Buffer.alloc(length)
+    if (!buffer.Buffer.isBuffer(buf)) ok = false
+    if (buf.length !== length) ok = false
+    var j
+    for (j = 0; j < length; j++) {
+      if (buf[j] !== 0) ok = false
+    }
+    buf.fill(1)
+    for (j = 0; j < length; j++) {
+      if (buf[j] !== 1) ok = false
+    }
+  }
+  t.ok(ok)
+  t.end()
+})
+
+test('.allocUnsafe / .allocUnsafeSlow are fillable and have correct lengths', function (t) {
+  ['allocUnsafe', 'allocUnsafeSlow'].forEach(function (method) {
+    var ok = true
+    for (var i = 0; i < 1e2; i++) {
+      var length = Math.round(Math.random() * 2e6)
+      var buf = dangerous.Buffer[method](length)
+      if (!buffer.Buffer.isBuffer(buf)) ok = false
+      if (buf.length !== length) ok = false
+      buf.fill(0, 0, length)
+      var j
+      for (j = 0; j < length; j++) {
+        if (buf[j] !== 0) ok = false
+      }
+      buf.fill(1, 0, length)
+      for (j = 0; j < length; j++) {
+        if (buf[j] !== 1) ok = false
+      }
+    }
+    t.ok(ok, method)
+  })
+  t.end()
+})
+
+test('.alloc(size, fill) is `fill`-filled', function (t) {
+  t.equal(index.Buffer.alloc, safer.Buffer.alloc)
+  t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
+  var ok = true
+  for (var i = 0; i < 1e2; i++) {
+    var length = Math.round(Math.random() * 2e6)
+    var fill = Math.round(Math.random() * 255)
+    var buf = index.Buffer.alloc(length, fill)
+    if (!buffer.Buffer.isBuffer(buf)) ok = false
+    if (buf.length !== length) ok = false
+    for (var j = 0; j < length; j++) {
+      if (buf[j] !== fill) ok = false
+    }
+  }
+  t.ok(ok)
+  t.end()
+})
+
+test('.alloc(size, fill) is `fill`-filled', function (t) {
+  t.equal(index.Buffer.alloc, safer.Buffer.alloc)
+  t.equal(index.Buffer.alloc, dangerous.Buffer.alloc)
+  var ok = true
+  for (var i = 0; i < 1e2; i++) {
+    var length = Math.round(Math.random() * 2e6)
+    var fill = Math.round(Math.random() * 255)
+    var buf = index.Buffer.alloc(length, fill)
+    if (!buffer.Buffer.isBuffer(buf)) ok = false
+    if (buf.length !== length) ok = false
+    for (var j = 0; j < length; j++) {
+      if (buf[j] !== fill) ok = false
+    }
+  }
+  t.ok(ok)
+  t.deepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 97))
+  t.notDeepEqual(index.Buffer.alloc(9, 'a'), index.Buffer.alloc(9, 98))
+
+  var tmp = new buffer.Buffer(2)
+  tmp.fill('ok')
+  if (tmp[1] === tmp[0]) {
+    // Outdated Node.js
+    t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('ooooo'))
+  } else {
+    t.deepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('okoko'))
+  }
+  t.notDeepEqual(index.Buffer.alloc(5, 'ok'), index.Buffer.from('kokok'))
+
+  t.end()
+})
+
+test('safer.Buffer.from returns results same as Buffer constructor', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.deepEqual(impl.Buffer.from(''), new buffer.Buffer(''))
+    t.deepEqual(impl.Buffer.from('string'), new buffer.Buffer('string'))
+    t.deepEqual(impl.Buffer.from('string', 'utf-8'), new buffer.Buffer('string', 'utf-8'))
+    t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), new buffer.Buffer('b25ldHdvdGhyZWU=', 'base64'))
+    t.deepEqual(impl.Buffer.from([0, 42, 3]), new buffer.Buffer([0, 42, 3]))
+    t.deepEqual(impl.Buffer.from(new Uint8Array([0, 42, 3])), new buffer.Buffer(new Uint8Array([0, 42, 3])))
+    t.deepEqual(impl.Buffer.from([]), new buffer.Buffer([]))
+  })
+  t.end()
+})
+
+test('safer.Buffer.from returns consistent results', function (t) {
+  [index, safer, dangerous].forEach(function (impl) {
+    t.deepEqual(impl.Buffer.from(''), impl.Buffer.alloc(0))
+    t.deepEqual(impl.Buffer.from([]), impl.Buffer.alloc(0))
+    t.deepEqual(impl.Buffer.from(new Uint8Array([])), impl.Buffer.alloc(0))
+    t.deepEqual(impl.Buffer.from('string', 'utf-8'), impl.Buffer.from('string'))
+    t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from([115, 116, 114, 105, 110, 103]))
+    t.deepEqual(impl.Buffer.from('string'), impl.Buffer.from(impl.Buffer.from('string')))
+    t.deepEqual(impl.Buffer.from('b25ldHdvdGhyZWU=', 'base64'), impl.Buffer.from('onetwothree'))
+    t.notDeepEqual(impl.Buffer.from('b25ldHdvdGhyZWU='), impl.Buffer.from('onetwothree'))
+  })
+  t.end()
+})
diff --git a/legacy-libs/grpc/node_modules/sax/LICENSE b/legacy-libs/grpc/node_modules/sax/LICENSE
new file mode 100644 (file)
index 0000000..ccffa08
--- /dev/null
@@ -0,0 +1,41 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+====
+
+`String.fromCodePoint` by Mathias Bynens used according to terms of MIT
+License, as follows:
+
+    Copyright Mathias Bynens <https://mathiasbynens.be/>
+
+    Permission is hereby granted, free of charge, to any person obtaining
+    a copy of this software and associated documentation files (the
+    "Software"), to deal in the Software without restriction, including
+    without limitation the rights to use, copy, modify, merge, publish,
+    distribute, sublicense, and/or sell copies of the Software, and to
+    permit persons to whom the Software is furnished to do so, subject to
+    the following conditions:
+
+    The above copyright notice and this permission notice shall be
+    included in all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+    LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+    WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/sax/README.md b/legacy-libs/grpc/node_modules/sax/README.md
new file mode 100644 (file)
index 0000000..afcd3f3
--- /dev/null
@@ -0,0 +1,225 @@
+# sax js
+
+A sax-style parser for XML and HTML.
+
+Designed with [node](http://nodejs.org/) in mind, but should work fine in
+the browser or other CommonJS implementations.
+
+## What This Is
+
+* A very simple tool to parse through an XML string.
+* A stepping stone to a streaming HTML parser.
+* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML
+  docs.
+
+## What This Is (probably) Not
+
+* An HTML Parser - That's a fine goal, but this isn't it.  It's just
+  XML.
+* A DOM Builder - You can use it to build an object model out of XML,
+  but it doesn't do that out of the box.
+* XSLT - No DOM = no querying.
+* 100% Compliant with (some other SAX implementation) - Most SAX
+  implementations are in Java and do a lot more than this does.
+* An XML Validator - It does a little validation when in strict mode, but
+  not much.
+* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic
+  masochism.
+* A DTD-aware Thing - Fetching DTDs is a much bigger job.
+
+## Regarding `<!DOCTYPE`s and `<!ENTITY`s
+
+The parser will handle the basic XML entities in text nodes and attribute
+values: `&amp; &lt; &gt; &apos; &quot;`. It's possible to define additional
+entities in XML by putting them in the DTD. This parser doesn't do anything
+with that. If you want to listen to the `ondoctype` event, and then fetch
+the doctypes, and read the entities and add them to `parser.ENTITIES`, then
+be my guest.
+
+Unknown entities will fail in strict mode, and in loose mode, will pass
+through unmolested.
+
+## Usage
+
+```javascript
+var sax = require("./lib/sax"),
+  strict = true, // set to false for html-mode
+  parser = sax.parser(strict);
+
+parser.onerror = function (e) {
+  // an error happened.
+};
+parser.ontext = function (t) {
+  // got some text.  t is the string of text.
+};
+parser.onopentag = function (node) {
+  // opened a tag.  node has "name" and "attributes"
+};
+parser.onattribute = function (attr) {
+  // an attribute.  attr has "name" and "value"
+};
+parser.onend = function () {
+  // parser stream is done, and ready to have more stuff written to it.
+};
+
+parser.write('<xml>Hello, <who name="world">world</who>!</xml>').close();
+
+// stream usage
+// takes the same options as the parser
+var saxStream = require("sax").createStream(strict, options)
+saxStream.on("error", function (e) {
+  // unhandled errors will throw, since this is a proper node
+  // event emitter.
+  console.error("error!", e)
+  // clear the error
+  this._parser.error = null
+  this._parser.resume()
+})
+saxStream.on("opentag", function (node) {
+  // same object as above
+})
+// pipe is supported, and it's readable/writable
+// same chunks coming in also go out.
+fs.createReadStream("file.xml")
+  .pipe(saxStream)
+  .pipe(fs.createWriteStream("file-copy.xml"))
+```
+
+
+## Arguments
+
+Pass the following arguments to the parser function.  All are optional.
+
+`strict` - Boolean. Whether or not to be a jerk. Default: `false`.
+
+`opt` - Object bag of settings regarding string formatting.  All default to `false`.
+
+Settings supported:
+
+* `trim` - Boolean. Whether or not to trim text and comment nodes.
+* `normalize` - Boolean. If true, then turn any whitespace into a single
+  space.
+* `lowercase` - Boolean. If true, then lowercase tag names and attribute names
+  in loose mode, rather than uppercasing them.
+* `xmlns` - Boolean. If true, then namespaces are supported.
+* `position` - Boolean. If false, then don't track line/col/position.
+* `strictEntities` - Boolean. If true, only parse [predefined XML
+  entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)
+  (`&amp;`, `&apos;`, `&gt;`, `&lt;`, and `&quot;`)
+
+## Methods
+
+`write` - Write bytes onto the stream. You don't have to do this all at
+once. You can keep writing as much as you want.
+
+`close` - Close the stream. Once closed, no more data may be written until
+it is done processing the buffer, which is signaled by the `end` event.
+
+`resume` - To gracefully handle errors, assign a listener to the `error`
+event. Then, when the error is taken care of, you can call `resume` to
+continue parsing. Otherwise, the parser will not continue while in an error
+state.
+
+## Members
+
+At all times, the parser object will have the following members:
+
+`line`, `column`, `position` - Indications of the position in the XML
+document where the parser currently is looking.
+
+`startTagPosition` - Indicates the position where the current tag starts.
+
+`closed` - Boolean indicating whether or not the parser can be written to.
+If it's `true`, then wait for the `ready` event to write again.
+
+`strict` - Boolean indicating whether or not the parser is a jerk.
+
+`opt` - Any options passed into the constructor.
+
+`tag` - The current tag being dealt with.
+
+And a bunch of other stuff that you probably shouldn't touch.
+
+## Events
+
+All events emit with a single argument. To listen to an event, assign a
+function to `on<eventname>`. Functions get executed in the this-context of
+the parser object. The list of supported events are also in the exported
+`EVENTS` array.
+
+When using the stream interface, assign handlers using the EventEmitter
+`on` function in the normal fashion.
+
+`error` - Indication that something bad happened. The error will be hanging
+out on `parser.error`, and must be deleted before parsing can continue. By
+listening to this event, you can keep an eye on that kind of stuff. Note:
+this happens *much* more in strict mode. Argument: instance of `Error`.
+
+`text` - Text node. Argument: string of text.
+
+`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string.
+
+`processinginstruction` - Stuff like `<?xml foo="blerg" ?>`. Argument:
+object with `name` and `body` members. Attributes are not parsed, as
+processing instructions have implementation dependent semantics.
+
+`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>`
+would trigger this kind of event. This is a weird thing to support, so it
+might go away at some point. SAX isn't intended to be used to parse SGML,
+after all.
+
+`opentagstart` - Emitted immediately when the tag name is available,
+but before any attributes are encountered.  Argument: object with a
+`name` field and an empty `attributes` set.  Note that this is the
+same object that will later be emitted in the `opentag` event.
+
+`opentag` - An opening tag. Argument: object with `name` and `attributes`.
+In non-strict mode, tag names are uppercased, unless the `lowercase`
+option is set.  If the `xmlns` option is set, then it will contain
+namespace binding information on the `ns` member, and will have a
+`local`, `prefix`, and `uri` member.
+
+`closetag` - A closing tag. In loose mode, tags are auto-closed if their
+parent closes. In strict mode, well-formedness is enforced. Note that
+self-closing tags will have `closeTag` emitted immediately after `openTag`.
+Argument: tag name.
+
+`attribute` - An attribute node.  Argument: object with `name` and `value`.
+In non-strict mode, attribute names are uppercased, unless the `lowercase`
+option is set.  If the `xmlns` option is set, it will also contains namespace
+information.
+
+`comment` - A comment node.  Argument: the string of the comment.
+
+`opencdata` - The opening tag of a `<![CDATA[` block.
+
+`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get
+quite large, this event may fire multiple times for a single block, if it
+is broken up into multiple `write()`s. Argument: the string of random
+character data.
+
+`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block.
+
+`opennamespace` - If the `xmlns` option is set, then this event will
+signal the start of a new namespace binding.
+
+`closenamespace` - If the `xmlns` option is set, then this event will
+signal the end of a namespace binding.
+
+`end` - Indication that the closed stream has ended.
+
+`ready` - Indication that the stream has reset, and is ready to be written
+to.
+
+`noscript` - In non-strict mode, `<script>` tags trigger a `"script"`
+event, and their contents are not checked for special xml characters.
+If you pass `noscript: true`, then this behavior is suppressed.
+
+## Reporting Problems
+
+It's best to write a failing test if you find an issue.  I will always
+accept pull requests with failing tests if they demonstrate intended
+behavior, but it is very hard to figure out what issue you're describing
+without a test.  Writing a test is also the best way for you yourself
+to figure out if you really understand the issue you think you have with
+sax-js.
diff --git a/legacy-libs/grpc/node_modules/sax/lib/sax.js b/legacy-libs/grpc/node_modules/sax/lib/sax.js
new file mode 100644 (file)
index 0000000..795d607
--- /dev/null
@@ -0,0 +1,1565 @@
+;(function (sax) { // wrapper for non-node envs
+  sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }
+  sax.SAXParser = SAXParser
+  sax.SAXStream = SAXStream
+  sax.createStream = createStream
+
+  // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.
+  // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),
+  // since that's the earliest that a buffer overrun could occur.  This way, checks are
+  // as rare as required, but as often as necessary to ensure never crossing this bound.
+  // Furthermore, buffers are only tested at most once per write(), so passing a very
+  // large string into write() might have undesirable effects, but this is manageable by
+  // the caller, so it is assumed to be safe.  Thus, a call to write() may, in the extreme
+  // edge case, result in creating at most one complete copy of the string passed in.
+  // Set to Infinity to have unlimited buffers.
+  sax.MAX_BUFFER_LENGTH = 64 * 1024
+
+  var buffers = [
+    'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',
+    'procInstName', 'procInstBody', 'entity', 'attribName',
+    'attribValue', 'cdata', 'script'
+  ]
+
+  sax.EVENTS = [
+    'text',
+    'processinginstruction',
+    'sgmldeclaration',
+    'doctype',
+    'comment',
+    'opentagstart',
+    'attribute',
+    'opentag',
+    'closetag',
+    'opencdata',
+    'cdata',
+    'closecdata',
+    'error',
+    'end',
+    'ready',
+    'script',
+    'opennamespace',
+    'closenamespace'
+  ]
+
+  function SAXParser (strict, opt) {
+    if (!(this instanceof SAXParser)) {
+      return new SAXParser(strict, opt)
+    }
+
+    var parser = this
+    clearBuffers(parser)
+    parser.q = parser.c = ''
+    parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH
+    parser.opt = opt || {}
+    parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags
+    parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'
+    parser.tags = []
+    parser.closed = parser.closedRoot = parser.sawRoot = false
+    parser.tag = parser.error = null
+    parser.strict = !!strict
+    parser.noscript = !!(strict || parser.opt.noscript)
+    parser.state = S.BEGIN
+    parser.strictEntities = parser.opt.strictEntities
+    parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)
+    parser.attribList = []
+
+    // namespaces form a prototype chain.
+    // it always points at the current tag,
+    // which protos to its parent tag.
+    if (parser.opt.xmlns) {
+      parser.ns = Object.create(rootNS)
+    }
+
+    // mostly just for error reporting
+    parser.trackPosition = parser.opt.position !== false
+    if (parser.trackPosition) {
+      parser.position = parser.line = parser.column = 0
+    }
+    emit(parser, 'onready')
+  }
+
+  if (!Object.create) {
+    Object.create = function (o) {
+      function F () {}
+      F.prototype = o
+      var newf = new F()
+      return newf
+    }
+  }
+
+  if (!Object.keys) {
+    Object.keys = function (o) {
+      var a = []
+      for (var i in o) if (o.hasOwnProperty(i)) a.push(i)
+      return a
+    }
+  }
+
+  function checkBufferLength (parser) {
+    var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)
+    var maxActual = 0
+    for (var i = 0, l = buffers.length; i < l; i++) {
+      var len = parser[buffers[i]].length
+      if (len > maxAllowed) {
+        // Text/cdata nodes can get big, and since they're buffered,
+        // we can get here under normal conditions.
+        // Avoid issues by emitting the text node now,
+        // so at least it won't get any bigger.
+        switch (buffers[i]) {
+          case 'textNode':
+            closeText(parser)
+            break
+
+          case 'cdata':
+            emitNode(parser, 'oncdata', parser.cdata)
+            parser.cdata = ''
+            break
+
+          case 'script':
+            emitNode(parser, 'onscript', parser.script)
+            parser.script = ''
+            break
+
+          default:
+            error(parser, 'Max buffer length exceeded: ' + buffers[i])
+        }
+      }
+      maxActual = Math.max(maxActual, len)
+    }
+    // schedule the next check for the earliest possible buffer overrun.
+    var m = sax.MAX_BUFFER_LENGTH - maxActual
+    parser.bufferCheckPosition = m + parser.position
+  }
+
+  function clearBuffers (parser) {
+    for (var i = 0, l = buffers.length; i < l; i++) {
+      parser[buffers[i]] = ''
+    }
+  }
+
+  function flushBuffers (parser) {
+    closeText(parser)
+    if (parser.cdata !== '') {
+      emitNode(parser, 'oncdata', parser.cdata)
+      parser.cdata = ''
+    }
+    if (parser.script !== '') {
+      emitNode(parser, 'onscript', parser.script)
+      parser.script = ''
+    }
+  }
+
+  SAXParser.prototype = {
+    end: function () { end(this) },
+    write: write,
+    resume: function () { this.error = null; return this },
+    close: function () { return this.write(null) },
+    flush: function () { flushBuffers(this) }
+  }
+
+  var Stream
+  try {
+    Stream = require('stream').Stream
+  } catch (ex) {
+    Stream = function () {}
+  }
+
+  var streamWraps = sax.EVENTS.filter(function (ev) {
+    return ev !== 'error' && ev !== 'end'
+  })
+
+  function createStream (strict, opt) {
+    return new SAXStream(strict, opt)
+  }
+
+  function SAXStream (strict, opt) {
+    if (!(this instanceof SAXStream)) {
+      return new SAXStream(strict, opt)
+    }
+
+    Stream.apply(this)
+
+    this._parser = new SAXParser(strict, opt)
+    this.writable = true
+    this.readable = true
+
+    var me = this
+
+    this._parser.onend = function () {
+      me.emit('end')
+    }
+
+    this._parser.onerror = function (er) {
+      me.emit('error', er)
+
+      // if didn't throw, then means error was handled.
+      // go ahead and clear error, so we can write again.
+      me._parser.error = null
+    }
+
+    this._decoder = null
+
+    streamWraps.forEach(function (ev) {
+      Object.defineProperty(me, 'on' + ev, {
+        get: function () {
+          return me._parser['on' + ev]
+        },
+        set: function (h) {
+          if (!h) {
+            me.removeAllListeners(ev)
+            me._parser['on' + ev] = h
+            return h
+          }
+          me.on(ev, h)
+        },
+        enumerable: true,
+        configurable: false
+      })
+    })
+  }
+
+  SAXStream.prototype = Object.create(Stream.prototype, {
+    constructor: {
+      value: SAXStream
+    }
+  })
+
+  SAXStream.prototype.write = function (data) {
+    if (typeof Buffer === 'function' &&
+      typeof Buffer.isBuffer === 'function' &&
+      Buffer.isBuffer(data)) {
+      if (!this._decoder) {
+        var SD = require('string_decoder').StringDecoder
+        this._decoder = new SD('utf8')
+      }
+      data = this._decoder.write(data)
+    }
+
+    this._parser.write(data.toString())
+    this.emit('data', data)
+    return true
+  }
+
+  SAXStream.prototype.end = function (chunk) {
+    if (chunk && chunk.length) {
+      this.write(chunk)
+    }
+    this._parser.end()
+    return true
+  }
+
+  SAXStream.prototype.on = function (ev, handler) {
+    var me = this
+    if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {
+      me._parser['on' + ev] = function () {
+        var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)
+        args.splice(0, 0, ev)
+        me.emit.apply(me, args)
+      }
+    }
+
+    return Stream.prototype.on.call(me, ev, handler)
+  }
+
+  // this really needs to be replaced with character classes.
+  // XML allows all manner of ridiculous numbers and digits.
+  var CDATA = '[CDATA['
+  var DOCTYPE = 'DOCTYPE'
+  var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'
+  var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'
+  var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }
+
+  // http://www.w3.org/TR/REC-xml/#NT-NameStartChar
+  // This implementation works on strings, a single character at a time
+  // as such, it cannot ever support astral-plane characters (10000-EFFFF)
+  // without a significant breaking change to either this  parser, or the
+  // JavaScript language.  Implementation of an emoji-capable xml parser
+  // is left as an exercise for the reader.
+  var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+
+  var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+  var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/
+  var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/
+
+  function isWhitespace (c) {
+    return c === ' ' || c === '\n' || c === '\r' || c === '\t'
+  }
+
+  function isQuote (c) {
+    return c === '"' || c === '\''
+  }
+
+  function isAttribEnd (c) {
+    return c === '>' || isWhitespace(c)
+  }
+
+  function isMatch (regex, c) {
+    return regex.test(c)
+  }
+
+  function notMatch (regex, c) {
+    return !isMatch(regex, c)
+  }
+
+  var S = 0
+  sax.STATE = {
+    BEGIN: S++, // leading byte order mark or whitespace
+    BEGIN_WHITESPACE: S++, // leading whitespace
+    TEXT: S++, // general stuff
+    TEXT_ENTITY: S++, // &amp and such.
+    OPEN_WAKA: S++, // <
+    SGML_DECL: S++, // <!BLARG
+    SGML_DECL_QUOTED: S++, // <!BLARG foo "bar
+    DOCTYPE: S++, // <!DOCTYPE
+    DOCTYPE_QUOTED: S++, // <!DOCTYPE "//blah
+    DOCTYPE_DTD: S++, // <!DOCTYPE "//blah" [ ...
+    DOCTYPE_DTD_QUOTED: S++, // <!DOCTYPE "//blah" [ "foo
+    COMMENT_STARTING: S++, // <!-
+    COMMENT: S++, // <!--
+    COMMENT_ENDING: S++, // <!-- blah -
+    COMMENT_ENDED: S++, // <!-- blah --
+    CDATA: S++, // <![CDATA[ something
+    CDATA_ENDING: S++, // ]
+    CDATA_ENDING_2: S++, // ]]
+    PROC_INST: S++, // <?hi
+    PROC_INST_BODY: S++, // <?hi there
+    PROC_INST_ENDING: S++, // <?hi "there" ?
+    OPEN_TAG: S++, // <strong
+    OPEN_TAG_SLASH: S++, // <strong /
+    ATTRIB: S++, // <a
+    ATTRIB_NAME: S++, // <a foo
+    ATTRIB_NAME_SAW_WHITE: S++, // <a foo _
+    ATTRIB_VALUE: S++, // <a foo=
+    ATTRIB_VALUE_QUOTED: S++, // <a foo="bar
+    ATTRIB_VALUE_CLOSED: S++, // <a foo="bar"
+    ATTRIB_VALUE_UNQUOTED: S++, // <a foo=bar
+    ATTRIB_VALUE_ENTITY_Q: S++, // <foo bar="&quot;"
+    ATTRIB_VALUE_ENTITY_U: S++, // <foo bar=&quot
+    CLOSE_TAG: S++, // </a
+    CLOSE_TAG_SAW_WHITE: S++, // </a   >
+    SCRIPT: S++, // <script> ...
+    SCRIPT_ENDING: S++ // <script> ... <
+  }
+
+  sax.XML_ENTITIES = {
+    'amp': '&',
+    'gt': '>',
+    'lt': '<',
+    'quot': '"',
+    'apos': "'"
+  }
+
+  sax.ENTITIES = {
+    'amp': '&',
+    'gt': '>',
+    'lt': '<',
+    'quot': '"',
+    'apos': "'",
+    'AElig': 198,
+    'Aacute': 193,
+    'Acirc': 194,
+    'Agrave': 192,
+    'Aring': 197,
+    'Atilde': 195,
+    'Auml': 196,
+    'Ccedil': 199,
+    'ETH': 208,
+    'Eacute': 201,
+    'Ecirc': 202,
+    'Egrave': 200,
+    'Euml': 203,
+    'Iacute': 205,
+    'Icirc': 206,
+    'Igrave': 204,
+    'Iuml': 207,
+    'Ntilde': 209,
+    'Oacute': 211,
+    'Ocirc': 212,
+    'Ograve': 210,
+    'Oslash': 216,
+    'Otilde': 213,
+    'Ouml': 214,
+    'THORN': 222,
+    'Uacute': 218,
+    'Ucirc': 219,
+    'Ugrave': 217,
+    'Uuml': 220,
+    'Yacute': 221,
+    'aacute': 225,
+    'acirc': 226,
+    'aelig': 230,
+    'agrave': 224,
+    'aring': 229,
+    'atilde': 227,
+    'auml': 228,
+    'ccedil': 231,
+    'eacute': 233,
+    'ecirc': 234,
+    'egrave': 232,
+    'eth': 240,
+    'euml': 235,
+    'iacute': 237,
+    'icirc': 238,
+    'igrave': 236,
+    'iuml': 239,
+    'ntilde': 241,
+    'oacute': 243,
+    'ocirc': 244,
+    'ograve': 242,
+    'oslash': 248,
+    'otilde': 245,
+    'ouml': 246,
+    'szlig': 223,
+    'thorn': 254,
+    'uacute': 250,
+    'ucirc': 251,
+    'ugrave': 249,
+    'uuml': 252,
+    'yacute': 253,
+    'yuml': 255,
+    'copy': 169,
+    'reg': 174,
+    'nbsp': 160,
+    'iexcl': 161,
+    'cent': 162,
+    'pound': 163,
+    'curren': 164,
+    'yen': 165,
+    'brvbar': 166,
+    'sect': 167,
+    'uml': 168,
+    'ordf': 170,
+    'laquo': 171,
+    'not': 172,
+    'shy': 173,
+    'macr': 175,
+    'deg': 176,
+    'plusmn': 177,
+    'sup1': 185,
+    'sup2': 178,
+    'sup3': 179,
+    'acute': 180,
+    'micro': 181,
+    'para': 182,
+    'middot': 183,
+    'cedil': 184,
+    'ordm': 186,
+    'raquo': 187,
+    'frac14': 188,
+    'frac12': 189,
+    'frac34': 190,
+    'iquest': 191,
+    'times': 215,
+    'divide': 247,
+    'OElig': 338,
+    'oelig': 339,
+    'Scaron': 352,
+    'scaron': 353,
+    'Yuml': 376,
+    'fnof': 402,
+    'circ': 710,
+    'tilde': 732,
+    'Alpha': 913,
+    'Beta': 914,
+    'Gamma': 915,
+    'Delta': 916,
+    'Epsilon': 917,
+    'Zeta': 918,
+    'Eta': 919,
+    'Theta': 920,
+    'Iota': 921,
+    'Kappa': 922,
+    'Lambda': 923,
+    'Mu': 924,
+    'Nu': 925,
+    'Xi': 926,
+    'Omicron': 927,
+    'Pi': 928,
+    'Rho': 929,
+    'Sigma': 931,
+    'Tau': 932,
+    'Upsilon': 933,
+    'Phi': 934,
+    'Chi': 935,
+    'Psi': 936,
+    'Omega': 937,
+    'alpha': 945,
+    'beta': 946,
+    'gamma': 947,
+    'delta': 948,
+    'epsilon': 949,
+    'zeta': 950,
+    'eta': 951,
+    'theta': 952,
+    'iota': 953,
+    'kappa': 954,
+    'lambda': 955,
+    'mu': 956,
+    'nu': 957,
+    'xi': 958,
+    'omicron': 959,
+    'pi': 960,
+    'rho': 961,
+    'sigmaf': 962,
+    'sigma': 963,
+    'tau': 964,
+    'upsilon': 965,
+    'phi': 966,
+    'chi': 967,
+    'psi': 968,
+    'omega': 969,
+    'thetasym': 977,
+    'upsih': 978,
+    'piv': 982,
+    'ensp': 8194,
+    'emsp': 8195,
+    'thinsp': 8201,
+    'zwnj': 8204,
+    'zwj': 8205,
+    'lrm': 8206,
+    'rlm': 8207,
+    'ndash': 8211,
+    'mdash': 8212,
+    'lsquo': 8216,
+    'rsquo': 8217,
+    'sbquo': 8218,
+    'ldquo': 8220,
+    'rdquo': 8221,
+    'bdquo': 8222,
+    'dagger': 8224,
+    'Dagger': 8225,
+    'bull': 8226,
+    'hellip': 8230,
+    'permil': 8240,
+    'prime': 8242,
+    'Prime': 8243,
+    'lsaquo': 8249,
+    'rsaquo': 8250,
+    'oline': 8254,
+    'frasl': 8260,
+    'euro': 8364,
+    'image': 8465,
+    'weierp': 8472,
+    'real': 8476,
+    'trade': 8482,
+    'alefsym': 8501,
+    'larr': 8592,
+    'uarr': 8593,
+    'rarr': 8594,
+    'darr': 8595,
+    'harr': 8596,
+    'crarr': 8629,
+    'lArr': 8656,
+    'uArr': 8657,
+    'rArr': 8658,
+    'dArr': 8659,
+    'hArr': 8660,
+    'forall': 8704,
+    'part': 8706,
+    'exist': 8707,
+    'empty': 8709,
+    'nabla': 8711,
+    'isin': 8712,
+    'notin': 8713,
+    'ni': 8715,
+    'prod': 8719,
+    'sum': 8721,
+    'minus': 8722,
+    'lowast': 8727,
+    'radic': 8730,
+    'prop': 8733,
+    'infin': 8734,
+    'ang': 8736,
+    'and': 8743,
+    'or': 8744,
+    'cap': 8745,
+    'cup': 8746,
+    'int': 8747,
+    'there4': 8756,
+    'sim': 8764,
+    'cong': 8773,
+    'asymp': 8776,
+    'ne': 8800,
+    'equiv': 8801,
+    'le': 8804,
+    'ge': 8805,
+    'sub': 8834,
+    'sup': 8835,
+    'nsub': 8836,
+    'sube': 8838,
+    'supe': 8839,
+    'oplus': 8853,
+    'otimes': 8855,
+    'perp': 8869,
+    'sdot': 8901,
+    'lceil': 8968,
+    'rceil': 8969,
+    'lfloor': 8970,
+    'rfloor': 8971,
+    'lang': 9001,
+    'rang': 9002,
+    'loz': 9674,
+    'spades': 9824,
+    'clubs': 9827,
+    'hearts': 9829,
+    'diams': 9830
+  }
+
+  Object.keys(sax.ENTITIES).forEach(function (key) {
+    var e = sax.ENTITIES[key]
+    var s = typeof e === 'number' ? String.fromCharCode(e) : e
+    sax.ENTITIES[key] = s
+  })
+
+  for (var s in sax.STATE) {
+    sax.STATE[sax.STATE[s]] = s
+  }
+
+  // shorthand
+  S = sax.STATE
+
+  function emit (parser, event, data) {
+    parser[event] && parser[event](data)
+  }
+
+  function emitNode (parser, nodeType, data) {
+    if (parser.textNode) closeText(parser)
+    emit(parser, nodeType, data)
+  }
+
+  function closeText (parser) {
+    parser.textNode = textopts(parser.opt, parser.textNode)
+    if (parser.textNode) emit(parser, 'ontext', parser.textNode)
+    parser.textNode = ''
+  }
+
+  function textopts (opt, text) {
+    if (opt.trim) text = text.trim()
+    if (opt.normalize) text = text.replace(/\s+/g, ' ')
+    return text
+  }
+
+  function error (parser, er) {
+    closeText(parser)
+    if (parser.trackPosition) {
+      er += '\nLine: ' + parser.line +
+        '\nColumn: ' + parser.column +
+        '\nChar: ' + parser.c
+    }
+    er = new Error(er)
+    parser.error = er
+    emit(parser, 'onerror', er)
+    return parser
+  }
+
+  function end (parser) {
+    if (parser.sawRoot && !parser.closedRoot) strictFail(parser, 'Unclosed root tag')
+    if ((parser.state !== S.BEGIN) &&
+      (parser.state !== S.BEGIN_WHITESPACE) &&
+      (parser.state !== S.TEXT)) {
+      error(parser, 'Unexpected end')
+    }
+    closeText(parser)
+    parser.c = ''
+    parser.closed = true
+    emit(parser, 'onend')
+    SAXParser.call(parser, parser.strict, parser.opt)
+    return parser
+  }
+
+  function strictFail (parser, message) {
+    if (typeof parser !== 'object' || !(parser instanceof SAXParser)) {
+      throw new Error('bad call to strictFail')
+    }
+    if (parser.strict) {
+      error(parser, message)
+    }
+  }
+
+  function newTag (parser) {
+    if (!parser.strict) parser.tagName = parser.tagName[parser.looseCase]()
+    var parent = parser.tags[parser.tags.length - 1] || parser
+    var tag = parser.tag = { name: parser.tagName, attributes: {} }
+
+    // will be overridden if tag contails an xmlns="foo" or xmlns:foo="bar"
+    if (parser.opt.xmlns) {
+      tag.ns = parent.ns
+    }
+    parser.attribList.length = 0
+    emitNode(parser, 'onopentagstart', tag)
+  }
+
+  function qname (name, attribute) {
+    var i = name.indexOf(':')
+    var qualName = i < 0 ? [ '', name ] : name.split(':')
+    var prefix = qualName[0]
+    var local = qualName[1]
+
+    // <x "xmlns"="http://foo">
+    if (attribute && name === 'xmlns') {
+      prefix = 'xmlns'
+      local = ''
+    }
+
+    return { prefix: prefix, local: local }
+  }
+
+  function attrib (parser) {
+    if (!parser.strict) {
+      parser.attribName = parser.attribName[parser.looseCase]()
+    }
+
+    if (parser.attribList.indexOf(parser.attribName) !== -1 ||
+      parser.tag.attributes.hasOwnProperty(parser.attribName)) {
+      parser.attribName = parser.attribValue = ''
+      return
+    }
+
+    if (parser.opt.xmlns) {
+      var qn = qname(parser.attribName, true)
+      var prefix = qn.prefix
+      var local = qn.local
+
+      if (prefix === 'xmlns') {
+        // namespace binding attribute. push the binding into scope
+        if (local === 'xml' && parser.attribValue !== XML_NAMESPACE) {
+          strictFail(parser,
+            'xml: prefix must be bound to ' + XML_NAMESPACE + '\n' +
+            'Actual: ' + parser.attribValue)
+        } else if (local === 'xmlns' && parser.attribValue !== XMLNS_NAMESPACE) {
+          strictFail(parser,
+            'xmlns: prefix must be bound to ' + XMLNS_NAMESPACE + '\n' +
+            'Actual: ' + parser.attribValue)
+        } else {
+          var tag = parser.tag
+          var parent = parser.tags[parser.tags.length - 1] || parser
+          if (tag.ns === parent.ns) {
+            tag.ns = Object.create(parent.ns)
+          }
+          tag.ns[local] = parser.attribValue
+        }
+      }
+
+      // defer onattribute events until all attributes have been seen
+      // so any new bindings can take effect. preserve attribute order
+      // so deferred events can be emitted in document order
+      parser.attribList.push([parser.attribName, parser.attribValue])
+    } else {
+      // in non-xmlns mode, we can emit the event right away
+      parser.tag.attributes[parser.attribName] = parser.attribValue
+      emitNode(parser, 'onattribute', {
+        name: parser.attribName,
+        value: parser.attribValue
+      })
+    }
+
+    parser.attribName = parser.attribValue = ''
+  }
+
+  function openTag (parser, selfClosing) {
+    if (parser.opt.xmlns) {
+      // emit namespace binding events
+      var tag = parser.tag
+
+      // add namespace info to tag
+      var qn = qname(parser.tagName)
+      tag.prefix = qn.prefix
+      tag.local = qn.local
+      tag.uri = tag.ns[qn.prefix] || ''
+
+      if (tag.prefix && !tag.uri) {
+        strictFail(parser, 'Unbound namespace prefix: ' +
+          JSON.stringify(parser.tagName))
+        tag.uri = qn.prefix
+      }
+
+      var parent = parser.tags[parser.tags.length - 1] || parser
+      if (tag.ns && parent.ns !== tag.ns) {
+        Object.keys(tag.ns).forEach(function (p) {
+          emitNode(parser, 'onopennamespace', {
+            prefix: p,
+            uri: tag.ns[p]
+          })
+        })
+      }
+
+      // handle deferred onattribute events
+      // Note: do not apply default ns to attributes:
+      //   http://www.w3.org/TR/REC-xml-names/#defaulting
+      for (var i = 0, l = parser.attribList.length; i < l; i++) {
+        var nv = parser.attribList[i]
+        var name = nv[0]
+        var value = nv[1]
+        var qualName = qname(name, true)
+        var prefix = qualName.prefix
+        var local = qualName.local
+        var uri = prefix === '' ? '' : (tag.ns[prefix] || '')
+        var a = {
+          name: name,
+          value: value,
+          prefix: prefix,
+          local: local,
+          uri: uri
+        }
+
+        // if there's any attributes with an undefined namespace,
+        // then fail on them now.
+        if (prefix && prefix !== 'xmlns' && !uri) {
+          strictFail(parser, 'Unbound namespace prefix: ' +
+            JSON.stringify(prefix))
+          a.uri = prefix
+        }
+        parser.tag.attributes[name] = a
+        emitNode(parser, 'onattribute', a)
+      }
+      parser.attribList.length = 0
+    }
+
+    parser.tag.isSelfClosing = !!selfClosing
+
+    // process the tag
+    parser.sawRoot = true
+    parser.tags.push(parser.tag)
+    emitNode(parser, 'onopentag', parser.tag)
+    if (!selfClosing) {
+      // special case for <script> in non-strict mode.
+      if (!parser.noscript && parser.tagName.toLowerCase() === 'script') {
+        parser.state = S.SCRIPT
+      } else {
+        parser.state = S.TEXT
+      }
+      parser.tag = null
+      parser.tagName = ''
+    }
+    parser.attribName = parser.attribValue = ''
+    parser.attribList.length = 0
+  }
+
+  function closeTag (parser) {
+    if (!parser.tagName) {
+      strictFail(parser, 'Weird empty close tag.')
+      parser.textNode += '</>'
+      parser.state = S.TEXT
+      return
+    }
+
+    if (parser.script) {
+      if (parser.tagName !== 'script') {
+        parser.script += '</' + parser.tagName + '>'
+        parser.tagName = ''
+        parser.state = S.SCRIPT
+        return
+      }
+      emitNode(parser, 'onscript', parser.script)
+      parser.script = ''
+    }
+
+    // first make sure that the closing tag actually exists.
+    // <a><b></c></b></a> will close everything, otherwise.
+    var t = parser.tags.length
+    var tagName = parser.tagName
+    if (!parser.strict) {
+      tagName = tagName[parser.looseCase]()
+    }
+    var closeTo = tagName
+    while (t--) {
+      var close = parser.tags[t]
+      if (close.name !== closeTo) {
+        // fail the first time in strict mode
+        strictFail(parser, 'Unexpected close tag')
+      } else {
+        break
+      }
+    }
+
+    // didn't find it.  we already failed for strict, so just abort.
+    if (t < 0) {
+      strictFail(parser, 'Unmatched closing tag: ' + parser.tagName)
+      parser.textNode += '</' + parser.tagName + '>'
+      parser.state = S.TEXT
+      return
+    }
+    parser.tagName = tagName
+    var s = parser.tags.length
+    while (s-- > t) {
+      var tag = parser.tag = parser.tags.pop()
+      parser.tagName = parser.tag.name
+      emitNode(parser, 'onclosetag', parser.tagName)
+
+      var x = {}
+      for (var i in tag.ns) {
+        x[i] = tag.ns[i]
+      }
+
+      var parent = parser.tags[parser.tags.length - 1] || parser
+      if (parser.opt.xmlns && tag.ns !== parent.ns) {
+        // remove namespace bindings introduced by tag
+        Object.keys(tag.ns).forEach(function (p) {
+          var n = tag.ns[p]
+          emitNode(parser, 'onclosenamespace', { prefix: p, uri: n })
+        })
+      }
+    }
+    if (t === 0) parser.closedRoot = true
+    parser.tagName = parser.attribValue = parser.attribName = ''
+    parser.attribList.length = 0
+    parser.state = S.TEXT
+  }
+
+  function parseEntity (parser) {
+    var entity = parser.entity
+    var entityLC = entity.toLowerCase()
+    var num
+    var numStr = ''
+
+    if (parser.ENTITIES[entity]) {
+      return parser.ENTITIES[entity]
+    }
+    if (parser.ENTITIES[entityLC]) {
+      return parser.ENTITIES[entityLC]
+    }
+    entity = entityLC
+    if (entity.charAt(0) === '#') {
+      if (entity.charAt(1) === 'x') {
+        entity = entity.slice(2)
+        num = parseInt(entity, 16)
+        numStr = num.toString(16)
+      } else {
+        entity = entity.slice(1)
+        num = parseInt(entity, 10)
+        numStr = num.toString(10)
+      }
+    }
+    entity = entity.replace(/^0+/, '')
+    if (isNaN(num) || numStr.toLowerCase() !== entity) {
+      strictFail(parser, 'Invalid character entity')
+      return '&' + parser.entity + ';'
+    }
+
+    return String.fromCodePoint(num)
+  }
+
+  function beginWhiteSpace (parser, c) {
+    if (c === '<') {
+      parser.state = S.OPEN_WAKA
+      parser.startTagPosition = parser.position
+    } else if (!isWhitespace(c)) {
+      // have to process this as a text node.
+      // weird, but happens.
+      strictFail(parser, 'Non-whitespace before first tag.')
+      parser.textNode = c
+      parser.state = S.TEXT
+    }
+  }
+
+  function charAt (chunk, i) {
+    var result = ''
+    if (i < chunk.length) {
+      result = chunk.charAt(i)
+    }
+    return result
+  }
+
+  function write (chunk) {
+    var parser = this
+    if (this.error) {
+      throw this.error
+    }
+    if (parser.closed) {
+      return error(parser,
+        'Cannot write after close. Assign an onready handler.')
+    }
+    if (chunk === null) {
+      return end(parser)
+    }
+    if (typeof chunk === 'object') {
+      chunk = chunk.toString()
+    }
+    var i = 0
+    var c = ''
+    while (true) {
+      c = charAt(chunk, i++)
+      parser.c = c
+
+      if (!c) {
+        break
+      }
+
+      if (parser.trackPosition) {
+        parser.position++
+        if (c === '\n') {
+          parser.line++
+          parser.column = 0
+        } else {
+          parser.column++
+        }
+      }
+
+      switch (parser.state) {
+        case S.BEGIN:
+          parser.state = S.BEGIN_WHITESPACE
+          if (c === '\uFEFF') {
+            continue
+          }
+          beginWhiteSpace(parser, c)
+          continue
+
+        case S.BEGIN_WHITESPACE:
+          beginWhiteSpace(parser, c)
+          continue
+
+        case S.TEXT:
+          if (parser.sawRoot && !parser.closedRoot) {
+            var starti = i - 1
+            while (c && c !== '<' && c !== '&') {
+              c = charAt(chunk, i++)
+              if (c && parser.trackPosition) {
+                parser.position++
+                if (c === '\n') {
+                  parser.line++
+                  parser.column = 0
+                } else {
+                  parser.column++
+                }
+              }
+            }
+            parser.textNode += chunk.substring(starti, i - 1)
+          }
+          if (c === '<' && !(parser.sawRoot && parser.closedRoot && !parser.strict)) {
+            parser.state = S.OPEN_WAKA
+            parser.startTagPosition = parser.position
+          } else {
+            if (!isWhitespace(c) && (!parser.sawRoot || parser.closedRoot)) {
+              strictFail(parser, 'Text data outside of root node.')
+            }
+            if (c === '&') {
+              parser.state = S.TEXT_ENTITY
+            } else {
+              parser.textNode += c
+            }
+          }
+          continue
+
+        case S.SCRIPT:
+          // only non-strict
+          if (c === '<') {
+            parser.state = S.SCRIPT_ENDING
+          } else {
+            parser.script += c
+          }
+          continue
+
+        case S.SCRIPT_ENDING:
+          if (c === '/') {
+            parser.state = S.CLOSE_TAG
+          } else {
+            parser.script += '<' + c
+            parser.state = S.SCRIPT
+          }
+          continue
+
+        case S.OPEN_WAKA:
+          // either a /, ?, !, or text is coming next.
+          if (c === '!') {
+            parser.state = S.SGML_DECL
+            parser.sgmlDecl = ''
+          } else if (isWhitespace(c)) {
+            // wait for it...
+          } else if (isMatch(nameStart, c)) {
+            parser.state = S.OPEN_TAG
+            parser.tagName = c
+          } else if (c === '/') {
+            parser.state = S.CLOSE_TAG
+            parser.tagName = ''
+          } else if (c === '?') {
+            parser.state = S.PROC_INST
+            parser.procInstName = parser.procInstBody = ''
+          } else {
+            strictFail(parser, 'Unencoded <')
+            // if there was some whitespace, then add that in.
+            if (parser.startTagPosition + 1 < parser.position) {
+              var pad = parser.position - parser.startTagPosition
+              c = new Array(pad).join(' ') + c
+            }
+            parser.textNode += '<' + c
+            parser.state = S.TEXT
+          }
+          continue
+
+        case S.SGML_DECL:
+          if ((parser.sgmlDecl + c).toUpperCase() === CDATA) {
+            emitNode(parser, 'onopencdata')
+            parser.state = S.CDATA
+            parser.sgmlDecl = ''
+            parser.cdata = ''
+          } else if (parser.sgmlDecl + c === '--') {
+            parser.state = S.COMMENT
+            parser.comment = ''
+            parser.sgmlDecl = ''
+          } else if ((parser.sgmlDecl + c).toUpperCase() === DOCTYPE) {
+            parser.state = S.DOCTYPE
+            if (parser.doctype || parser.sawRoot) {
+              strictFail(parser,
+                'Inappropriately located doctype declaration')
+            }
+            parser.doctype = ''
+            parser.sgmlDecl = ''
+          } else if (c === '>') {
+            emitNode(parser, 'onsgmldeclaration', parser.sgmlDecl)
+            parser.sgmlDecl = ''
+            parser.state = S.TEXT
+          } else if (isQuote(c)) {
+            parser.state = S.SGML_DECL_QUOTED
+            parser.sgmlDecl += c
+          } else {
+            parser.sgmlDecl += c
+          }
+          continue
+
+        case S.SGML_DECL_QUOTED:
+          if (c === parser.q) {
+            parser.state = S.SGML_DECL
+            parser.q = ''
+          }
+          parser.sgmlDecl += c
+          continue
+
+        case S.DOCTYPE:
+          if (c === '>') {
+            parser.state = S.TEXT
+            emitNode(parser, 'ondoctype', parser.doctype)
+            parser.doctype = true // just remember that we saw it.
+          } else {
+            parser.doctype += c
+            if (c === '[') {
+              parser.state = S.DOCTYPE_DTD
+            } else if (isQuote(c)) {
+              parser.state = S.DOCTYPE_QUOTED
+              parser.q = c
+            }
+          }
+          continue
+
+        case S.DOCTYPE_QUOTED:
+          parser.doctype += c
+          if (c === parser.q) {
+            parser.q = ''
+            parser.state = S.DOCTYPE
+          }
+          continue
+
+        case S.DOCTYPE_DTD:
+          parser.doctype += c
+          if (c === ']') {
+            parser.state = S.DOCTYPE
+          } else if (isQuote(c)) {
+            parser.state = S.DOCTYPE_DTD_QUOTED
+            parser.q = c
+          }
+          continue
+
+        case S.DOCTYPE_DTD_QUOTED:
+          parser.doctype += c
+          if (c === parser.q) {
+            parser.state = S.DOCTYPE_DTD
+            parser.q = ''
+          }
+          continue
+
+        case S.COMMENT:
+          if (c === '-') {
+            parser.state = S.COMMENT_ENDING
+          } else {
+            parser.comment += c
+          }
+          continue
+
+        case S.COMMENT_ENDING:
+          if (c === '-') {
+            parser.state = S.COMMENT_ENDED
+            parser.comment = textopts(parser.opt, parser.comment)
+            if (parser.comment) {
+              emitNode(parser, 'oncomment', parser.comment)
+            }
+            parser.comment = ''
+          } else {
+            parser.comment += '-' + c
+            parser.state = S.COMMENT
+          }
+          continue
+
+        case S.COMMENT_ENDED:
+          if (c !== '>') {
+            strictFail(parser, 'Malformed comment')
+            // allow <!-- blah -- bloo --> in non-strict mode,
+            // which is a comment of " blah -- bloo "
+            parser.comment += '--' + c
+            parser.state = S.COMMENT
+          } else {
+            parser.state = S.TEXT
+          }
+          continue
+
+        case S.CDATA:
+          if (c === ']') {
+            parser.state = S.CDATA_ENDING
+          } else {
+            parser.cdata += c
+          }
+          continue
+
+        case S.CDATA_ENDING:
+          if (c === ']') {
+            parser.state = S.CDATA_ENDING_2
+          } else {
+            parser.cdata += ']' + c
+            parser.state = S.CDATA
+          }
+          continue
+
+        case S.CDATA_ENDING_2:
+          if (c === '>') {
+            if (parser.cdata) {
+              emitNode(parser, 'oncdata', parser.cdata)
+            }
+            emitNode(parser, 'onclosecdata')
+            parser.cdata = ''
+            parser.state = S.TEXT
+          } else if (c === ']') {
+            parser.cdata += ']'
+          } else {
+            parser.cdata += ']]' + c
+            parser.state = S.CDATA
+          }
+          continue
+
+        case S.PROC_INST:
+          if (c === '?') {
+            parser.state = S.PROC_INST_ENDING
+          } else if (isWhitespace(c)) {
+            parser.state = S.PROC_INST_BODY
+          } else {
+            parser.procInstName += c
+          }
+          continue
+
+        case S.PROC_INST_BODY:
+          if (!parser.procInstBody && isWhitespace(c)) {
+            continue
+          } else if (c === '?') {
+            parser.state = S.PROC_INST_ENDING
+          } else {
+            parser.procInstBody += c
+          }
+          continue
+
+        case S.PROC_INST_ENDING:
+          if (c === '>') {
+            emitNode(parser, 'onprocessinginstruction', {
+              name: parser.procInstName,
+              body: parser.procInstBody
+            })
+            parser.procInstName = parser.procInstBody = ''
+            parser.state = S.TEXT
+          } else {
+            parser.procInstBody += '?' + c
+            parser.state = S.PROC_INST_BODY
+          }
+          continue
+
+        case S.OPEN_TAG:
+          if (isMatch(nameBody, c)) {
+            parser.tagName += c
+          } else {
+            newTag(parser)
+            if (c === '>') {
+              openTag(parser)
+            } else if (c === '/') {
+              parser.state = S.OPEN_TAG_SLASH
+            } else {
+              if (!isWhitespace(c)) {
+                strictFail(parser, 'Invalid character in tag name')
+              }
+              parser.state = S.ATTRIB
+            }
+          }
+          continue
+
+        case S.OPEN_TAG_SLASH:
+          if (c === '>') {
+            openTag(parser, true)
+            closeTag(parser)
+          } else {
+            strictFail(parser, 'Forward-slash in opening tag not followed by >')
+            parser.state = S.ATTRIB
+          }
+          continue
+
+        case S.ATTRIB:
+          // haven't read the attribute name yet.
+          if (isWhitespace(c)) {
+            continue
+          } else if (c === '>') {
+            openTag(parser)
+          } else if (c === '/') {
+            parser.state = S.OPEN_TAG_SLASH
+          } else if (isMatch(nameStart, c)) {
+            parser.attribName = c
+            parser.attribValue = ''
+            parser.state = S.ATTRIB_NAME
+          } else {
+            strictFail(parser, 'Invalid attribute name')
+          }
+          continue
+
+        case S.ATTRIB_NAME:
+          if (c === '=') {
+            parser.state = S.ATTRIB_VALUE
+          } else if (c === '>') {
+            strictFail(parser, 'Attribute without value')
+            parser.attribValue = parser.attribName
+            attrib(parser)
+            openTag(parser)
+          } else if (isWhitespace(c)) {
+            parser.state = S.ATTRIB_NAME_SAW_WHITE
+          } else if (isMatch(nameBody, c)) {
+            parser.attribName += c
+          } else {
+            strictFail(parser, 'Invalid attribute name')
+          }
+          continue
+
+        case S.ATTRIB_NAME_SAW_WHITE:
+          if (c === '=') {
+            parser.state = S.ATTRIB_VALUE
+          } else if (isWhitespace(c)) {
+            continue
+          } else {
+            strictFail(parser, 'Attribute without value')
+            parser.tag.attributes[parser.attribName] = ''
+            parser.attribValue = ''
+            emitNode(parser, 'onattribute', {
+              name: parser.attribName,
+              value: ''
+            })
+            parser.attribName = ''
+            if (c === '>') {
+              openTag(parser)
+            } else if (isMatch(nameStart, c)) {
+              parser.attribName = c
+              parser.state = S.ATTRIB_NAME
+            } else {
+              strictFail(parser, 'Invalid attribute name')
+              parser.state = S.ATTRIB
+            }
+          }
+          continue
+
+        case S.ATTRIB_VALUE:
+          if (isWhitespace(c)) {
+            continue
+          } else if (isQuote(c)) {
+            parser.q = c
+            parser.state = S.ATTRIB_VALUE_QUOTED
+          } else {
+            strictFail(parser, 'Unquoted attribute value')
+            parser.state = S.ATTRIB_VALUE_UNQUOTED
+            parser.attribValue = c
+          }
+          continue
+
+        case S.ATTRIB_VALUE_QUOTED:
+          if (c !== parser.q) {
+            if (c === '&') {
+              parser.state = S.ATTRIB_VALUE_ENTITY_Q
+            } else {
+              parser.attribValue += c
+            }
+            continue
+          }
+          attrib(parser)
+          parser.q = ''
+          parser.state = S.ATTRIB_VALUE_CLOSED
+          continue
+
+        case S.ATTRIB_VALUE_CLOSED:
+          if (isWhitespace(c)) {
+            parser.state = S.ATTRIB
+          } else if (c === '>') {
+            openTag(parser)
+          } else if (c === '/') {
+            parser.state = S.OPEN_TAG_SLASH
+          } else if (isMatch(nameStart, c)) {
+            strictFail(parser, 'No whitespace between attributes')
+            parser.attribName = c
+            parser.attribValue = ''
+            parser.state = S.ATTRIB_NAME
+          } else {
+            strictFail(parser, 'Invalid attribute name')
+          }
+          continue
+
+        case S.ATTRIB_VALUE_UNQUOTED:
+          if (!isAttribEnd(c)) {
+            if (c === '&') {
+              parser.state = S.ATTRIB_VALUE_ENTITY_U
+            } else {
+              parser.attribValue += c
+            }
+            continue
+          }
+          attrib(parser)
+          if (c === '>') {
+            openTag(parser)
+          } else {
+            parser.state = S.ATTRIB
+          }
+          continue
+
+        case S.CLOSE_TAG:
+          if (!parser.tagName) {
+            if (isWhitespace(c)) {
+              continue
+            } else if (notMatch(nameStart, c)) {
+              if (parser.script) {
+                parser.script += '</' + c
+                parser.state = S.SCRIPT
+              } else {
+                strictFail(parser, 'Invalid tagname in closing tag.')
+              }
+            } else {
+              parser.tagName = c
+            }
+          } else if (c === '>') {
+            closeTag(parser)
+          } else if (isMatch(nameBody, c)) {
+            parser.tagName += c
+          } else if (parser.script) {
+            parser.script += '</' + parser.tagName
+            parser.tagName = ''
+            parser.state = S.SCRIPT
+          } else {
+            if (!isWhitespace(c)) {
+              strictFail(parser, 'Invalid tagname in closing tag')
+            }
+            parser.state = S.CLOSE_TAG_SAW_WHITE
+          }
+          continue
+
+        case S.CLOSE_TAG_SAW_WHITE:
+          if (isWhitespace(c)) {
+            continue
+          }
+          if (c === '>') {
+            closeTag(parser)
+          } else {
+            strictFail(parser, 'Invalid characters in closing tag')
+          }
+          continue
+
+        case S.TEXT_ENTITY:
+        case S.ATTRIB_VALUE_ENTITY_Q:
+        case S.ATTRIB_VALUE_ENTITY_U:
+          var returnState
+          var buffer
+          switch (parser.state) {
+            case S.TEXT_ENTITY:
+              returnState = S.TEXT
+              buffer = 'textNode'
+              break
+
+            case S.ATTRIB_VALUE_ENTITY_Q:
+              returnState = S.ATTRIB_VALUE_QUOTED
+              buffer = 'attribValue'
+              break
+
+            case S.ATTRIB_VALUE_ENTITY_U:
+              returnState = S.ATTRIB_VALUE_UNQUOTED
+              buffer = 'attribValue'
+              break
+          }
+
+          if (c === ';') {
+            parser[buffer] += parseEntity(parser)
+            parser.entity = ''
+            parser.state = returnState
+          } else if (isMatch(parser.entity.length ? entityBody : entityStart, c)) {
+            parser.entity += c
+          } else {
+            strictFail(parser, 'Invalid character in entity name')
+            parser[buffer] += '&' + parser.entity + c
+            parser.entity = ''
+            parser.state = returnState
+          }
+
+          continue
+
+        default:
+          throw new Error(parser, 'Unknown state: ' + parser.state)
+      }
+    } // while
+
+    if (parser.position >= parser.bufferCheckPosition) {
+      checkBufferLength(parser)
+    }
+    return parser
+  }
+
+  /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */
+  /* istanbul ignore next */
+  if (!String.fromCodePoint) {
+    (function () {
+      var stringFromCharCode = String.fromCharCode
+      var floor = Math.floor
+      var fromCodePoint = function () {
+        var MAX_SIZE = 0x4000
+        var codeUnits = []
+        var highSurrogate
+        var lowSurrogate
+        var index = -1
+        var length = arguments.length
+        if (!length) {
+          return ''
+        }
+        var result = ''
+        while (++index < length) {
+          var codePoint = Number(arguments[index])
+          if (
+            !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`
+            codePoint < 0 || // not a valid Unicode code point
+            codePoint > 0x10FFFF || // not a valid Unicode code point
+            floor(codePoint) !== codePoint // not an integer
+          ) {
+            throw RangeError('Invalid code point: ' + codePoint)
+          }
+          if (codePoint <= 0xFFFF) { // BMP code point
+            codeUnits.push(codePoint)
+          } else { // Astral code point; split in surrogate halves
+            // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
+            codePoint -= 0x10000
+            highSurrogate = (codePoint >> 10) + 0xD800
+            lowSurrogate = (codePoint % 0x400) + 0xDC00
+            codeUnits.push(highSurrogate, lowSurrogate)
+          }
+          if (index + 1 === length || codeUnits.length > MAX_SIZE) {
+            result += stringFromCharCode.apply(null, codeUnits)
+            codeUnits.length = 0
+          }
+        }
+        return result
+      }
+      /* istanbul ignore next */
+      if (Object.defineProperty) {
+        Object.defineProperty(String, 'fromCodePoint', {
+          value: fromCodePoint,
+          configurable: true,
+          writable: true
+        })
+      } else {
+        String.fromCodePoint = fromCodePoint
+      }
+    }())
+  }
+})(typeof exports === 'undefined' ? this.sax = {} : exports)
diff --git a/legacy-libs/grpc/node_modules/sax/package.json b/legacy-libs/grpc/node_modules/sax/package.json
new file mode 100644 (file)
index 0000000..9d32b4e
--- /dev/null
@@ -0,0 +1,69 @@
+{
+  "_args": [
+    [
+      "sax@1.2.4",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "sax@1.2.4",
+  "_id": "sax@1.2.4",
+  "_inBundle": false,
+  "_integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
+  "_location": "/grpc/sax",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "sax@1.2.4",
+    "name": "sax",
+    "escapedName": "sax",
+    "rawSpec": "1.2.4",
+    "saveSpec": null,
+    "fetchSpec": "1.2.4"
+  },
+  "_requiredBy": [
+    "/grpc/needle"
+  ],
+  "_resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.2.4",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/sax-js/issues"
+  },
+  "dependencies": {},
+  "description": "An evented streaming XML parser in JavaScript",
+  "devDependencies": {
+    "standard": "^8.6.0",
+    "tap": "^10.5.1"
+  },
+  "files": [
+    "lib/sax.js",
+    "LICENSE",
+    "README.md"
+  ],
+  "homepage": "https://github.com/isaacs/sax-js#readme",
+  "license": "ISC",
+  "main": "lib/sax.js",
+  "name": "sax",
+  "optionalDependencies": {},
+  "readme": "# sax js\n\nA sax-style parser for XML and HTML.\n\nDesigned with [node](http://nodejs.org/) in mind, but should work fine in\nthe browser or other CommonJS implementations.\n\n## What This Is\n\n* A very simple tool to parse through an XML string.\n* A stepping stone to a streaming HTML parser.\n* A handy way to deal with RSS and other mostly-ok-but-kinda-broken XML\n  docs.\n\n## What This Is (probably) Not\n\n* An HTML Parser - That's a fine goal, but this isn't it.  It's just\n  XML.\n* A DOM Builder - You can use it to build an object model out of XML,\n  but it doesn't do that out of the box.\n* XSLT - No DOM = no querying.\n* 100% Compliant with (some other SAX implementation) - Most SAX\n  implementations are in Java and do a lot more than this does.\n* An XML Validator - It does a little validation when in strict mode, but\n  not much.\n* A Schema-Aware XSD Thing - Schemas are an exercise in fetishistic\n  masochism.\n* A DTD-aware Thing - Fetching DTDs is a much bigger job.\n\n## Regarding `<!DOCTYPE`s and `<!ENTITY`s\n\nThe parser will handle the basic XML entities in text nodes and attribute\nvalues: `&amp; &lt; &gt; &apos; &quot;`. It's possible to define additional\nentities in XML by putting them in the DTD. This parser doesn't do anything\nwith that. If you want to listen to the `ondoctype` event, and then fetch\nthe doctypes, and read the entities and add them to `parser.ENTITIES`, then\nbe my guest.\n\nUnknown entities will fail in strict mode, and in loose mode, will pass\nthrough unmolested.\n\n## Usage\n\n```javascript\nvar sax = require(\"./lib/sax\"),\n  strict = true, // set to false for html-mode\n  parser = sax.parser(strict);\n\nparser.onerror = function (e) {\n  // an error happened.\n};\nparser.ontext = function (t) {\n  // got some text.  t is the string of text.\n};\nparser.onopentag = function (node) {\n  // opened a tag.  node has \"name\" and \"attributes\"\n};\nparser.onattribute = function (attr) {\n  // an attribute.  attr has \"name\" and \"value\"\n};\nparser.onend = function () {\n  // parser stream is done, and ready to have more stuff written to it.\n};\n\nparser.write('<xml>Hello, <who name=\"world\">world</who>!</xml>').close();\n\n// stream usage\n// takes the same options as the parser\nvar saxStream = require(\"sax\").createStream(strict, options)\nsaxStream.on(\"error\", function (e) {\n  // unhandled errors will throw, since this is a proper node\n  // event emitter.\n  console.error(\"error!\", e)\n  // clear the error\n  this._parser.error = null\n  this._parser.resume()\n})\nsaxStream.on(\"opentag\", function (node) {\n  // same object as above\n})\n// pipe is supported, and it's readable/writable\n// same chunks coming in also go out.\nfs.createReadStream(\"file.xml\")\n  .pipe(saxStream)\n  .pipe(fs.createWriteStream(\"file-copy.xml\"))\n```\n\n\n## Arguments\n\nPass the following arguments to the parser function.  All are optional.\n\n`strict` - Boolean. Whether or not to be a jerk. Default: `false`.\n\n`opt` - Object bag of settings regarding string formatting.  All default to `false`.\n\nSettings supported:\n\n* `trim` - Boolean. Whether or not to trim text and comment nodes.\n* `normalize` - Boolean. If true, then turn any whitespace into a single\n  space.\n* `lowercase` - Boolean. If true, then lowercase tag names and attribute names\n  in loose mode, rather than uppercasing them.\n* `xmlns` - Boolean. If true, then namespaces are supported.\n* `position` - Boolean. If false, then don't track line/col/position.\n* `strictEntities` - Boolean. If true, only parse [predefined XML\n  entities](http://www.w3.org/TR/REC-xml/#sec-predefined-ent)\n  (`&amp;`, `&apos;`, `&gt;`, `&lt;`, and `&quot;`)\n\n## Methods\n\n`write` - Write bytes onto the stream. You don't have to do this all at\nonce. You can keep writing as much as you want.\n\n`close` - Close the stream. Once closed, no more data may be written until\nit is done processing the buffer, which is signaled by the `end` event.\n\n`resume` - To gracefully handle errors, assign a listener to the `error`\nevent. Then, when the error is taken care of, you can call `resume` to\ncontinue parsing. Otherwise, the parser will not continue while in an error\nstate.\n\n## Members\n\nAt all times, the parser object will have the following members:\n\n`line`, `column`, `position` - Indications of the position in the XML\ndocument where the parser currently is looking.\n\n`startTagPosition` - Indicates the position where the current tag starts.\n\n`closed` - Boolean indicating whether or not the parser can be written to.\nIf it's `true`, then wait for the `ready` event to write again.\n\n`strict` - Boolean indicating whether or not the parser is a jerk.\n\n`opt` - Any options passed into the constructor.\n\n`tag` - The current tag being dealt with.\n\nAnd a bunch of other stuff that you probably shouldn't touch.\n\n## Events\n\nAll events emit with a single argument. To listen to an event, assign a\nfunction to `on<eventname>`. Functions get executed in the this-context of\nthe parser object. The list of supported events are also in the exported\n`EVENTS` array.\n\nWhen using the stream interface, assign handlers using the EventEmitter\n`on` function in the normal fashion.\n\n`error` - Indication that something bad happened. The error will be hanging\nout on `parser.error`, and must be deleted before parsing can continue. By\nlistening to this event, you can keep an eye on that kind of stuff. Note:\nthis happens *much* more in strict mode. Argument: instance of `Error`.\n\n`text` - Text node. Argument: string of text.\n\n`doctype` - The `<!DOCTYPE` declaration. Argument: doctype string.\n\n`processinginstruction` - Stuff like `<?xml foo=\"blerg\" ?>`. Argument:\nobject with `name` and `body` members. Attributes are not parsed, as\nprocessing instructions have implementation dependent semantics.\n\n`sgmldeclaration` - Random SGML declarations. Stuff like `<!ENTITY p>`\nwould trigger this kind of event. This is a weird thing to support, so it\nmight go away at some point. SAX isn't intended to be used to parse SGML,\nafter all.\n\n`opentagstart` - Emitted immediately when the tag name is available,\nbut before any attributes are encountered.  Argument: object with a\n`name` field and an empty `attributes` set.  Note that this is the\nsame object that will later be emitted in the `opentag` event.\n\n`opentag` - An opening tag. Argument: object with `name` and `attributes`.\nIn non-strict mode, tag names are uppercased, unless the `lowercase`\noption is set.  If the `xmlns` option is set, then it will contain\nnamespace binding information on the `ns` member, and will have a\n`local`, `prefix`, and `uri` member.\n\n`closetag` - A closing tag. In loose mode, tags are auto-closed if their\nparent closes. In strict mode, well-formedness is enforced. Note that\nself-closing tags will have `closeTag` emitted immediately after `openTag`.\nArgument: tag name.\n\n`attribute` - An attribute node.  Argument: object with `name` and `value`.\nIn non-strict mode, attribute names are uppercased, unless the `lowercase`\noption is set.  If the `xmlns` option is set, it will also contains namespace\ninformation.\n\n`comment` - A comment node.  Argument: the string of the comment.\n\n`opencdata` - The opening tag of a `<![CDATA[` block.\n\n`cdata` - The text of a `<![CDATA[` block. Since `<![CDATA[` blocks can get\nquite large, this event may fire multiple times for a single block, if it\nis broken up into multiple `write()`s. Argument: the string of random\ncharacter data.\n\n`closecdata` - The closing tag (`]]>`) of a `<![CDATA[` block.\n\n`opennamespace` - If the `xmlns` option is set, then this event will\nsignal the start of a new namespace binding.\n\n`closenamespace` - If the `xmlns` option is set, then this event will\nsignal the end of a namespace binding.\n\n`end` - Indication that the closed stream has ended.\n\n`ready` - Indication that the stream has reset, and is ready to be written\nto.\n\n`noscript` - In non-strict mode, `<script>` tags trigger a `\"script\"`\nevent, and their contents are not checked for special xml characters.\nIf you pass `noscript: true`, then this behavior is suppressed.\n\n## Reporting Problems\n\nIt's best to write a failing test if you find an issue.  I will always\naccept pull requests with failing tests if they demonstrate intended\nbehavior, but it is very hard to figure out what issue you're describing\nwithout a test.  Writing a test is also the best way for you yourself\nto figure out if you really understand the issue you think you have with\nsax-js.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/sax-js.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "posttest": "standard -F test/*.js lib/*.js",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --cov -j4"
+  },
+  "version": "1.2.4"
+}
diff --git a/legacy-libs/grpc/node_modules/semver/CHANGELOG.md b/legacy-libs/grpc/node_modules/semver/CHANGELOG.md
new file mode 100644 (file)
index 0000000..66304fd
--- /dev/null
@@ -0,0 +1,39 @@
+# changes log
+
+## 5.7
+
+* Add `minVersion` method
+
+## 5.6
+
+* Move boolean `loose` param to an options object, with
+  backwards-compatibility protection.
+* Add ability to opt out of special prerelease version handling with
+  the `includePrerelease` option flag.
+
+## 5.5
+
+* Add version coercion capabilities
+
+## 5.4
+
+* Add intersection checking
+
+## 5.3
+
+* Add `minSatisfying` method
+
+## 5.2
+
+* Add `prerelease(v)` that returns prerelease components
+
+## 5.1
+
+* Add Backus-Naur for ranges
+* Remove excessively cute inspection methods
+
+## 5.0
+
+* Remove AMD/Browserified build artifacts
+* Fix ltr and gtr when using the `*` range
+* Fix for range `*` with a prerelease identifier
diff --git a/legacy-libs/grpc/node_modules/semver/LICENSE b/legacy-libs/grpc/node_modules/semver/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/semver/README.md b/legacy-libs/grpc/node_modules/semver/README.md
new file mode 100644 (file)
index 0000000..e5ccece
--- /dev/null
@@ -0,0 +1,411 @@
+semver(1) -- The semantic versioner for npm
+===========================================
+
+## Install
+
+```bash
+npm install --save semver
+````
+
+## Usage
+
+As a node module:
+
+```js
+const semver = require('semver')
+
+semver.valid('1.2.3') // '1.2.3'
+semver.valid('a.b.c') // null
+semver.clean('  =v1.2.3   ') // '1.2.3'
+semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
+semver.gt('1.2.3', '9.8.7') // false
+semver.lt('1.2.3', '9.8.7') // true
+semver.minVersion('>=1.0.0') // '1.0.0'
+semver.valid(semver.coerce('v2')) // '2.0.0'
+semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
+```
+
+As a command-line utility:
+
+```
+$ semver -h
+
+A JavaScript implementation of the https://semver.org/ specification
+Copyright Isaac Z. Schlueter
+
+Usage: semver [options] <version> [<version> [...]]
+Prints valid versions sorted by SemVer precedence
+
+Options:
+-r --range <range>
+        Print versions that match the specified range.
+
+-i --increment [<level>]
+        Increment a version by the specified level.  Level can
+        be one of: major, minor, patch, premajor, preminor,
+        prepatch, or prerelease.  Default level is 'patch'.
+        Only one version may be specified.
+
+--preid <identifier>
+        Identifier to be used to prefix premajor, preminor,
+        prepatch or prerelease version increments.
+
+-l --loose
+        Interpret versions and ranges loosely
+
+-p --include-prerelease
+        Always include prerelease versions in range matching
+
+-c --coerce
+        Coerce a string into SemVer if possible
+        (does not imply --loose)
+
+Program exits successfully if any valid version satisfies
+all supplied ranges, and prints all satisfying versions.
+
+If no satisfying versions are found, then exits failure.
+
+Versions are printed in ascending order, so supplying
+multiple versions to the utility will just sort them.
+```
+
+## Versions
+
+A "version" is described by the `v2.0.0` specification found at
+<https://semver.org/>.
+
+A leading `"="` or `"v"` character is stripped off and ignored.
+
+## Ranges
+
+A `version range` is a set of `comparators` which specify versions
+that satisfy the range.
+
+A `comparator` is composed of an `operator` and a `version`.  The set
+of primitive `operators` is:
+
+* `<` Less than
+* `<=` Less than or equal to
+* `>` Greater than
+* `>=` Greater than or equal to
+* `=` Equal.  If no operator is specified, then equality is assumed,
+  so this operator is optional, but MAY be included.
+
+For example, the comparator `>=1.2.7` would match the versions
+`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
+or `1.1.0`.
+
+Comparators can be joined by whitespace to form a `comparator set`,
+which is satisfied by the **intersection** of all of the comparators
+it includes.
+
+A range is composed of one or more comparator sets, joined by `||`.  A
+version matches a range if and only if every comparator in at least
+one of the `||`-separated comparator sets is satisfied by the version.
+
+For example, the range `>=1.2.7 <1.3.0` would match the versions
+`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
+or `1.1.0`.
+
+The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
+`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
+
+### Prerelease Tags
+
+If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
+it will only be allowed to satisfy comparator sets if at least one
+comparator with the same `[major, minor, patch]` tuple also has a
+prerelease tag.
+
+For example, the range `>1.2.3-alpha.3` would be allowed to match the
+version `1.2.3-alpha.7`, but it would *not* be satisfied by
+`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
+than" `1.2.3-alpha.3` according to the SemVer sort rules.  The version
+range only accepts prerelease tags on the `1.2.3` version.  The
+version `3.4.5` *would* satisfy the range, because it does not have a
+prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
+
+The purpose for this behavior is twofold.  First, prerelease versions
+frequently are updated very quickly, and contain many breaking changes
+that are (by the author's design) not yet fit for public consumption.
+Therefore, by default, they are excluded from range matching
+semantics.
+
+Second, a user who has opted into using a prerelease version has
+clearly indicated the intent to use *that specific* set of
+alpha/beta/rc versions.  By including a prerelease tag in the range,
+the user is indicating that they are aware of the risk.  However, it
+is still not appropriate to assume that they have opted into taking a
+similar risk on the *next* set of prerelease versions.
+
+Note that this behavior can be suppressed (treating all prerelease
+versions as if they were normal versions, for the purpose of range
+matching) by setting the `includePrerelease` flag on the options
+object to any
+[functions](https://github.com/npm/node-semver#functions) that do
+range matching.
+
+#### Prerelease Identifiers
+
+The method `.inc` takes an additional `identifier` string argument that
+will append the value of the string as a prerelease identifier:
+
+```javascript
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
+```
+
+command-line example:
+
+```bash
+$ semver 1.2.3 -i prerelease --preid beta
+1.2.4-beta.0
+```
+
+Which then can be used to increment further:
+
+```bash
+$ semver 1.2.4-beta.0 -i prerelease
+1.2.4-beta.1
+```
+
+### Advanced Range Syntax
+
+Advanced range syntax desugars to primitive comparators in
+deterministic ways.
+
+Advanced ranges may be combined in the same way as primitive
+comparators using white space or `||`.
+
+#### Hyphen Ranges `X.Y.Z - A.B.C`
+
+Specifies an inclusive set.
+
+* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
+
+If a partial version is provided as the first version in the inclusive
+range, then the missing pieces are replaced with zeroes.
+
+* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
+
+If a partial version is provided as the second version in the
+inclusive range, then all versions that start with the supplied parts
+of the tuple are accepted, but nothing that would be greater than the
+provided tuple parts.
+
+* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
+* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
+
+#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
+
+Any of `X`, `x`, or `*` may be used to "stand in" for one of the
+numeric values in the `[major, minor, patch]` tuple.
+
+* `*` := `>=0.0.0` (Any version satisfies)
+* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
+* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
+
+A partial version range is treated as an X-Range, so the special
+character is in fact optional.
+
+* `""` (empty string) := `*` := `>=0.0.0`
+* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
+* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
+
+#### Tilde Ranges `~1.2.3` `~1.2` `~1`
+
+Allows patch-level changes if a minor version is specified on the
+comparator.  Allows minor-level changes if not.
+
+* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
+* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
+* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
+* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
+* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
+* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
+* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
+  the `1.2.3` version will be allowed, if they are greater than or
+  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
+  `1.2.4-beta.2` would not, because it is a prerelease of a
+  different `[major, minor, patch]` tuple.
+
+#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
+
+Allows changes that do not modify the left-most non-zero digit in the
+`[major, minor, patch]` tuple.  In other words, this allows patch and
+minor updates for versions `1.0.0` and above, patch updates for
+versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
+
+Many authors treat a `0.x` version as if the `x` were the major
+"breaking-change" indicator.
+
+Caret ranges are ideal when an author may make breaking changes
+between `0.2.4` and `0.3.0` releases, which is a common practice.
+However, it presumes that there will *not* be breaking changes between
+`0.2.4` and `0.2.5`.  It allows for changes that are presumed to be
+additive (but non-breaking), according to commonly observed practices.
+
+* `^1.2.3` := `>=1.2.3 <2.0.0`
+* `^0.2.3` := `>=0.2.3 <0.3.0`
+* `^0.0.3` := `>=0.0.3 <0.0.4`
+* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
+  the `1.2.3` version will be allowed, if they are greater than or
+  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
+  `1.2.4-beta.2` would not, because it is a prerelease of a
+  different `[major, minor, patch]` tuple.
+* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4`  Note that prereleases in the
+  `0.0.3` version *only* will be allowed, if they are greater than or
+  equal to `beta`.  So, `0.0.3-pr.2` would be allowed.
+
+When parsing caret ranges, a missing `patch` value desugars to the
+number `0`, but will allow flexibility within that value, even if the
+major and minor versions are both `0`.
+
+* `^1.2.x` := `>=1.2.0 <2.0.0`
+* `^0.0.x` := `>=0.0.0 <0.1.0`
+* `^0.0` := `>=0.0.0 <0.1.0`
+
+A missing `minor` and `patch` values will desugar to zero, but also
+allow flexibility within those values, even if the major version is
+zero.
+
+* `^1.x` := `>=1.0.0 <2.0.0`
+* `^0.x` := `>=0.0.0 <1.0.0`
+
+### Range Grammar
+
+Putting all this together, here is a Backus-Naur grammar for ranges,
+for the benefit of parser authors:
+
+```bnf
+range-set  ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range      ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen     ::= partial ' - ' partial
+simple     ::= primitive | partial | tilde | caret
+primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr         ::= 'x' | 'X' | '*' | nr
+nr         ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
+tilde      ::= '~' partial
+caret      ::= '^' partial
+qualifier  ::= ( '-' pre )? ( '+' build )?
+pre        ::= parts
+build      ::= parts
+parts      ::= part ( '.' part ) *
+part       ::= nr | [-0-9A-Za-z]+
+```
+
+## Functions
+
+All methods and classes take a final `options` object argument.  All
+options in this object are `false` by default.  The options supported
+are:
+
+- `loose`  Be more forgiving about not-quite-valid semver strings.
+  (Any resulting output will always be 100% strict compliant, of
+  course.)  For backwards compatibility reasons, if the `options`
+  argument is a boolean value instead of an object, it is interpreted
+  to be the `loose` param.
+- `includePrerelease`  Set to suppress the [default
+  behavior](https://github.com/npm/node-semver#prerelease-tags) of
+  excluding prerelease tagged versions from ranges unless they are
+  explicitly opted into.
+
+Strict-mode Comparators and Ranges will be strict about the SemVer
+strings that they parse.
+
+* `valid(v)`: Return the parsed version, or null if it's not valid.
+* `inc(v, release)`: Return the version incremented by the release
+  type (`major`,   `premajor`, `minor`, `preminor`, `patch`,
+  `prepatch`, or `prerelease`), or null if it's not valid
+  * `premajor` in one call will bump the version up to the next major
+    version and down to a prerelease of that major version.
+    `preminor`, and `prepatch` work the same way.
+  * If called from a non-prerelease version, the `prerelease` will work the
+    same as `prepatch`. It increments the patch version, then makes a
+    prerelease. If the input version is already a prerelease it simply
+    increments it.
+* `prerelease(v)`: Returns an array of prerelease components, or null
+  if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
+* `major(v)`: Return the major version number.
+* `minor(v)`: Return the minor version number.
+* `patch(v)`: Return the patch version number.
+* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
+  or comparators intersect.
+* `parse(v)`: Attempt to parse a string as a semantic version, returning either
+  a `SemVer` object or `null`.
+
+### Comparison
+
+* `gt(v1, v2)`: `v1 > v2`
+* `gte(v1, v2)`: `v1 >= v2`
+* `lt(v1, v2)`: `v1 < v2`
+* `lte(v1, v2)`: `v1 <= v2`
+* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
+  even if they're not the exact same string.  You already know how to
+  compare strings.
+* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
+* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
+  the corresponding function above.  `"==="` and `"!=="` do simple
+  string comparison, but are included for completeness.  Throws if an
+  invalid comparison string is provided.
+* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
+  `v2` is greater.  Sorts in ascending order if passed to `Array.sort()`.
+* `rcompare(v1, v2)`: The reverse of compare.  Sorts an array of versions
+  in descending order when passed to `Array.sort()`.
+* `diff(v1, v2)`: Returns difference between two versions by the release type
+  (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
+  or null if the versions are the same.
+
+### Comparators
+
+* `intersects(comparator)`: Return true if the comparators intersect
+
+### Ranges
+
+* `validRange(range)`: Return the valid range or null if it's not valid
+* `satisfies(version, range)`: Return true if the version satisfies the
+  range.
+* `maxSatisfying(versions, range)`: Return the highest version in the list
+  that satisfies the range, or `null` if none of them do.
+* `minSatisfying(versions, range)`: Return the lowest version in the list
+  that satisfies the range, or `null` if none of them do.
+* `minVersion(range)`: Return the lowest version that can possibly match
+  the given range.
+* `gtr(version, range)`: Return `true` if version is greater than all the
+  versions possible in the range.
+* `ltr(version, range)`: Return `true` if version is less than all the
+  versions possible in the range.
+* `outside(version, range, hilo)`: Return true if the version is outside
+  the bounds of the range in either the high or low direction.  The
+  `hilo` argument must be either the string `'>'` or `'<'`.  (This is
+  the function called by `gtr` and `ltr`.)
+* `intersects(range)`: Return true if any of the ranges comparators intersect
+
+Note that, since ranges may be non-contiguous, a version might not be
+greater than a range, less than a range, *or* satisfy a range!  For
+example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
+until `2.0.0`, so the version `1.2.10` would not be greater than the
+range (because `2.0.1` satisfies, which is higher), nor less than the
+range (since `1.2.8` satisfies, which is lower), and it also does not
+satisfy the range.
+
+If you want to know if a version satisfies or does not satisfy a
+range, use the `satisfies(version, range)` function.
+
+### Coercion
+
+* `coerce(version)`: Coerces a string to semver if possible
+
+This aims to provide a very forgiving translation of a non-semver
+string to semver. It looks for the first digit in a string, and
+consumes all remaining characters which satisfy at least a partial semver
+(e.g., `1`, `1.2`, `1.2.3`) up to the max permitted length (256 characters).
+Longer versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`).
+All surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes `3.4.0`).
+Only text which lacks digits will fail coercion (`version one` is not valid).
+The maximum  length for any semver component considered for coercion is 16 characters;
+longer components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`).
+The maximum value for any semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`;
+higher value components are invalid (`9999999999999999.4.7.4` is likely invalid).
diff --git a/legacy-libs/grpc/node_modules/semver/bin/semver b/legacy-libs/grpc/node_modules/semver/bin/semver
new file mode 100644 (file)
index 0000000..801e77f
--- /dev/null
@@ -0,0 +1,160 @@
+#!/usr/bin/env node
+// Standalone semver comparison program.
+// Exits successfully and prints matching version(s) if
+// any supplied version is valid and passes all tests.
+
+var argv = process.argv.slice(2)
+
+var versions = []
+
+var range = []
+
+var inc = null
+
+var version = require('../package.json').version
+
+var loose = false
+
+var includePrerelease = false
+
+var coerce = false
+
+var identifier
+
+var semver = require('../semver')
+
+var reverse = false
+
+var options = {}
+
+main()
+
+function main () {
+  if (!argv.length) return help()
+  while (argv.length) {
+    var a = argv.shift()
+    var indexOfEqualSign = a.indexOf('=')
+    if (indexOfEqualSign !== -1) {
+      a = a.slice(0, indexOfEqualSign)
+      argv.unshift(a.slice(indexOfEqualSign + 1))
+    }
+    switch (a) {
+      case '-rv': case '-rev': case '--rev': case '--reverse':
+        reverse = true
+        break
+      case '-l': case '--loose':
+        loose = true
+        break
+      case '-p': case '--include-prerelease':
+        includePrerelease = true
+        break
+      case '-v': case '--version':
+        versions.push(argv.shift())
+        break
+      case '-i': case '--inc': case '--increment':
+        switch (argv[0]) {
+          case 'major': case 'minor': case 'patch': case 'prerelease':
+          case 'premajor': case 'preminor': case 'prepatch':
+            inc = argv.shift()
+            break
+          default:
+            inc = 'patch'
+            break
+        }
+        break
+      case '--preid':
+        identifier = argv.shift()
+        break
+      case '-r': case '--range':
+        range.push(argv.shift())
+        break
+      case '-c': case '--coerce':
+        coerce = true
+        break
+      case '-h': case '--help': case '-?':
+        return help()
+      default:
+        versions.push(a)
+        break
+    }
+  }
+
+  var options = { loose: loose, includePrerelease: includePrerelease }
+
+  versions = versions.map(function (v) {
+    return coerce ? (semver.coerce(v) || { version: v }).version : v
+  }).filter(function (v) {
+    return semver.valid(v)
+  })
+  if (!versions.length) return fail()
+  if (inc && (versions.length !== 1 || range.length)) { return failInc() }
+
+  for (var i = 0, l = range.length; i < l; i++) {
+    versions = versions.filter(function (v) {
+      return semver.satisfies(v, range[i], options)
+    })
+    if (!versions.length) return fail()
+  }
+  return success(versions)
+}
+
+function failInc () {
+  console.error('--inc can only be used on a single version with no range')
+  fail()
+}
+
+function fail () { process.exit(1) }
+
+function success () {
+  var compare = reverse ? 'rcompare' : 'compare'
+  versions.sort(function (a, b) {
+    return semver[compare](a, b, options)
+  }).map(function (v) {
+    return semver.clean(v, options)
+  }).map(function (v) {
+    return inc ? semver.inc(v, inc, options, identifier) : v
+  }).forEach(function (v, i, _) { console.log(v) })
+}
+
+function help () {
+  console.log(['SemVer ' + version,
+    '',
+    'A JavaScript implementation of the https://semver.org/ specification',
+    'Copyright Isaac Z. Schlueter',
+    '',
+    'Usage: semver [options] <version> [<version> [...]]',
+    'Prints valid versions sorted by SemVer precedence',
+    '',
+    'Options:',
+    '-r --range <range>',
+    '        Print versions that match the specified range.',
+    '',
+    '-i --increment [<level>]',
+    '        Increment a version by the specified level.  Level can',
+    '        be one of: major, minor, patch, premajor, preminor,',
+    "        prepatch, or prerelease.  Default level is 'patch'.",
+    '        Only one version may be specified.',
+    '',
+    '--preid <identifier>',
+    '        Identifier to be used to prefix premajor, preminor,',
+    '        prepatch or prerelease version increments.',
+    '',
+    '-l --loose',
+    '        Interpret versions and ranges loosely',
+    '',
+    '-p --include-prerelease',
+    '        Always include prerelease versions in range matching',
+    '',
+    '-c --coerce',
+    '        Coerce a string into SemVer if possible',
+    '        (does not imply --loose)',
+    '',
+    'Program exits successfully if any valid version satisfies',
+    'all supplied ranges, and prints all satisfying versions.',
+    '',
+    'If no satisfying versions are found, then exits failure.',
+    '',
+    'Versions are printed in ascending order, so supplying',
+    'multiple versions to the utility will just sort them.'
+  ].join('\n'))
+}
diff --git a/legacy-libs/grpc/node_modules/semver/package.json b/legacy-libs/grpc/node_modules/semver/package.json
new file mode 100644 (file)
index 0000000..a97b859
--- /dev/null
@@ -0,0 +1,65 @@
+{
+  "_from": "semver@^5.3.0",
+  "_id": "semver@5.7.0",
+  "_inBundle": false,
+  "_integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
+  "_location": "/grpc/semver",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "semver@^5.3.0",
+    "name": "semver",
+    "escapedName": "semver",
+    "rawSpec": "^5.3.0",
+    "saveSpec": null,
+    "fetchSpec": "^5.3.0"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
+  "_shasum": "790a7cf6fea5459bac96110b29b60412dc8ff96b",
+  "_shrinkwrap": null,
+  "_spec": "semver@^5.3.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/node-pre-gyp",
+  "bin": {
+    "semver": "./bin/semver"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/node-semver/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "The semantic version parser used by npm.",
+  "devDependencies": {
+    "tap": "^13.0.0-rc.18"
+  },
+  "files": [
+    "bin",
+    "range.bnf",
+    "semver.js"
+  ],
+  "homepage": "https://github.com/npm/node-semver#readme",
+  "license": "ISC",
+  "main": "semver.js",
+  "name": "semver",
+  "optionalDependencies": {},
+  "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Install\n\n```bash\nnpm install --save semver\n````\n\n## Usage\n\nAs a node module:\n\n```js\nconst semver = require('semver')\n\nsemver.valid('1.2.3') // '1.2.3'\nsemver.valid('a.b.c') // null\nsemver.clean('  =v1.2.3   ') // '1.2.3'\nsemver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\nsemver.gt('1.2.3', '9.8.7') // false\nsemver.lt('1.2.3', '9.8.7') // true\nsemver.minVersion('>=1.0.0') // '1.0.0'\nsemver.valid(semver.coerce('v2')) // '2.0.0'\nsemver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'\n```\n\nAs a command-line utility:\n\n```\n$ semver -h\n\nA JavaScript implementation of the https://semver.org/ specification\nCopyright Isaac Z. Schlueter\n\nUsage: semver [options] <version> [<version> [...]]\nPrints valid versions sorted by SemVer precedence\n\nOptions:\n-r --range <range>\n        Print versions that match the specified range.\n\n-i --increment [<level>]\n        Increment a version by the specified level.  Level can\n        be one of: major, minor, patch, premajor, preminor,\n        prepatch, or prerelease.  Default level is 'patch'.\n        Only one version may be specified.\n\n--preid <identifier>\n        Identifier to be used to prefix premajor, preminor,\n        prepatch or prerelease version increments.\n\n-l --loose\n        Interpret versions and ranges loosely\n\n-p --include-prerelease\n        Always include prerelease versions in range matching\n\n-c --coerce\n        Coerce a string into SemVer if possible\n        (does not imply --loose)\n\nProgram exits successfully if any valid version satisfies\nall supplied ranges, and prints all satisfying versions.\n\nIf no satisfying versions are found, then exits failure.\n\nVersions are printed in ascending order, so supplying\nmultiple versions to the utility will just sort them.\n```\n\n## Versions\n\nA \"version\" is described by the `v2.0.0` specification found at\n<https://semver.org/>.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nA `version range` is a set of `comparators` which specify versions\nthat satisfy the range.\n\nA `comparator` is composed of an `operator` and a `version`.  The set\nof primitive `operators` is:\n\n* `<` Less than\n* `<=` Less than or equal to\n* `>` Greater than\n* `>=` Greater than or equal to\n* `=` Equal.  If no operator is specified, then equality is assumed,\n  so this operator is optional, but MAY be included.\n\nFor example, the comparator `>=1.2.7` would match the versions\n`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`\nor `1.1.0`.\n\nComparators can be joined by whitespace to form a `comparator set`,\nwhich is satisfied by the **intersection** of all of the comparators\nit includes.\n\nA range is composed of one or more comparator sets, joined by `||`.  A\nversion matches a range if and only if every comparator in at least\none of the `||`-separated comparator sets is satisfied by the version.\n\nFor example, the range `>=1.2.7 <1.3.0` would match the versions\n`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,\nor `1.1.0`.\n\nThe range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,\n`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.\n\n### Prerelease Tags\n\nIf a version has a prerelease tag (for example, `1.2.3-alpha.3`) then\nit will only be allowed to satisfy comparator sets if at least one\ncomparator with the same `[major, minor, patch]` tuple also has a\nprerelease tag.\n\nFor example, the range `>1.2.3-alpha.3` would be allowed to match the\nversion `1.2.3-alpha.7`, but it would *not* be satisfied by\n`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically \"greater\nthan\" `1.2.3-alpha.3` according to the SemVer sort rules.  The version\nrange only accepts prerelease tags on the `1.2.3` version.  The\nversion `3.4.5` *would* satisfy the range, because it does not have a\nprerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.\n\nThe purpose for this behavior is twofold.  First, prerelease versions\nfrequently are updated very quickly, and contain many breaking changes\nthat are (by the author's design) not yet fit for public consumption.\nTherefore, by default, they are excluded from range matching\nsemantics.\n\nSecond, a user who has opted into using a prerelease version has\nclearly indicated the intent to use *that specific* set of\nalpha/beta/rc versions.  By including a prerelease tag in the range,\nthe user is indicating that they are aware of the risk.  However, it\nis still not appropriate to assume that they have opted into taking a\nsimilar risk on the *next* set of prerelease versions.\n\nNote that this behavior can be suppressed (treating all prerelease\nversions as if they were normal versions, for the purpose of range\nmatching) by setting the `includePrerelease` flag on the options\nobject to any\n[functions](https://github.com/npm/node-semver#functions) that do\nrange matching.\n\n#### Prerelease Identifiers\n\nThe method `.inc` takes an additional `identifier` string argument that\nwill append the value of the string as a prerelease identifier:\n\n```javascript\nsemver.inc('1.2.3', 'prerelease', 'beta')\n// '1.2.4-beta.0'\n```\n\ncommand-line example:\n\n```bash\n$ semver 1.2.3 -i prerelease --preid beta\n1.2.4-beta.0\n```\n\nWhich then can be used to increment further:\n\n```bash\n$ semver 1.2.4-beta.0 -i prerelease\n1.2.4-beta.1\n```\n\n### Advanced Range Syntax\n\nAdvanced range syntax desugars to primitive comparators in\ndeterministic ways.\n\nAdvanced ranges may be combined in the same way as primitive\ncomparators using white space or `||`.\n\n#### Hyphen Ranges `X.Y.Z - A.B.C`\n\nSpecifies an inclusive set.\n\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n\nIf a partial version is provided as the first version in the inclusive\nrange, then the missing pieces are replaced with zeroes.\n\n* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`\n\nIf a partial version is provided as the second version in the\ninclusive range, then all versions that start with the supplied parts\nof the tuple are accepted, but nothing that would be greater than the\nprovided tuple parts.\n\n* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`\n* `1.2.3 - 2` := `>=1.2.3 <3.0.0`\n\n#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`\n\nAny of `X`, `x`, or `*` may be used to \"stand in\" for one of the\nnumeric values in the `[major, minor, patch]` tuple.\n\n* `*` := `>=0.0.0` (Any version satisfies)\n* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)\n* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)\n\nA partial version range is treated as an X-Range, so the special\ncharacter is in fact optional.\n\n* `\"\"` (empty string) := `*` := `>=0.0.0`\n* `1` := `1.x.x` := `>=1.0.0 <2.0.0`\n* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`\n\n#### Tilde Ranges `~1.2.3` `~1.2` `~1`\n\nAllows patch-level changes if a minor version is specified on the\ncomparator.  Allows minor-level changes if not.\n\n* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`\n* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)\n* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)\n* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`\n* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)\n* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)\n* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in\n  the `1.2.3` version will be allowed, if they are greater than or\n  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but\n  `1.2.4-beta.2` would not, because it is a prerelease of a\n  different `[major, minor, patch]` tuple.\n\n#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`\n\nAllows changes that do not modify the left-most non-zero digit in the\n`[major, minor, patch]` tuple.  In other words, this allows patch and\nminor updates for versions `1.0.0` and above, patch updates for\nversions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.\n\nMany authors treat a `0.x` version as if the `x` were the major\n\"breaking-change\" indicator.\n\nCaret ranges are ideal when an author may make breaking changes\nbetween `0.2.4` and `0.3.0` releases, which is a common practice.\nHowever, it presumes that there will *not* be breaking changes between\n`0.2.4` and `0.2.5`.  It allows for changes that are presumed to be\nadditive (but non-breaking), according to commonly observed practices.\n\n* `^1.2.3` := `>=1.2.3 <2.0.0`\n* `^0.2.3` := `>=0.2.3 <0.3.0`\n* `^0.0.3` := `>=0.0.3 <0.0.4`\n* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in\n  the `1.2.3` version will be allowed, if they are greater than or\n  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but\n  `1.2.4-beta.2` would not, because it is a prerelease of a\n  different `[major, minor, patch]` tuple.\n* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4`  Note that prereleases in the\n  `0.0.3` version *only* will be allowed, if they are greater than or\n  equal to `beta`.  So, `0.0.3-pr.2` would be allowed.\n\nWhen parsing caret ranges, a missing `patch` value desugars to the\nnumber `0`, but will allow flexibility within that value, even if the\nmajor and minor versions are both `0`.\n\n* `^1.2.x` := `>=1.2.0 <2.0.0`\n* `^0.0.x` := `>=0.0.0 <0.1.0`\n* `^0.0` := `>=0.0.0 <0.1.0`\n\nA missing `minor` and `patch` values will desugar to zero, but also\nallow flexibility within those values, even if the major version is\nzero.\n\n* `^1.x` := `>=1.0.0 <2.0.0`\n* `^0.x` := `>=0.0.0 <1.0.0`\n\n### Range Grammar\n\nPutting all this together, here is a Backus-Naur grammar for ranges,\nfor the benefit of parser authors:\n\n```bnf\nrange-set  ::= range ( logical-or range ) *\nlogical-or ::= ( ' ' ) * '||' ( ' ' ) *\nrange      ::= hyphen | simple ( ' ' simple ) * | ''\nhyphen     ::= partial ' - ' partial\nsimple     ::= primitive | partial | tilde | caret\nprimitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial\npartial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?\nxr         ::= 'x' | 'X' | '*' | nr\nnr         ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *\ntilde      ::= '~' partial\ncaret      ::= '^' partial\nqualifier  ::= ( '-' pre )? ( '+' build )?\npre        ::= parts\nbuild      ::= parts\nparts      ::= part ( '.' part ) *\npart       ::= nr | [-0-9A-Za-z]+\n```\n\n## Functions\n\nAll methods and classes take a final `options` object argument.  All\noptions in this object are `false` by default.  The options supported\nare:\n\n- `loose`  Be more forgiving about not-quite-valid semver strings.\n  (Any resulting output will always be 100% strict compliant, of\n  course.)  For backwards compatibility reasons, if the `options`\n  argument is a boolean value instead of an object, it is interpreted\n  to be the `loose` param.\n- `includePrerelease`  Set to suppress the [default\n  behavior](https://github.com/npm/node-semver#prerelease-tags) of\n  excluding prerelease tagged versions from ranges unless they are\n  explicitly opted into.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* `valid(v)`: Return the parsed version, or null if it's not valid.\n* `inc(v, release)`: Return the version incremented by the release\n  type (`major`,   `premajor`, `minor`, `preminor`, `patch`,\n  `prepatch`, or `prerelease`), or null if it's not valid\n  * `premajor` in one call will bump the version up to the next major\n    version and down to a prerelease of that major version.\n    `preminor`, and `prepatch` work the same way.\n  * If called from a non-prerelease version, the `prerelease` will work the\n    same as `prepatch`. It increments the patch version, then makes a\n    prerelease. If the input version is already a prerelease it simply\n    increments it.\n* `prerelease(v)`: Returns an array of prerelease components, or null\n  if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`\n* `major(v)`: Return the major version number.\n* `minor(v)`: Return the minor version number.\n* `patch(v)`: Return the patch version number.\n* `intersects(r1, r2, loose)`: Return true if the two supplied ranges\n  or comparators intersect.\n* `parse(v)`: Attempt to parse a string as a semantic version, returning either\n  a `SemVer` object or `null`.\n\n### Comparison\n\n* `gt(v1, v2)`: `v1 > v2`\n* `gte(v1, v2)`: `v1 >= v2`\n* `lt(v1, v2)`: `v1 < v2`\n* `lte(v1, v2)`: `v1 <= v2`\n* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,\n  even if they're not the exact same string.  You already know how to\n  compare strings.\n* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.\n* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call\n  the corresponding function above.  `\"===\"` and `\"!==\"` do simple\n  string comparison, but are included for completeness.  Throws if an\n  invalid comparison string is provided.\n* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if\n  `v2` is greater.  Sorts in ascending order if passed to `Array.sort()`.\n* `rcompare(v1, v2)`: The reverse of compare.  Sorts an array of versions\n  in descending order when passed to `Array.sort()`.\n* `diff(v1, v2)`: Returns difference between two versions by the release type\n  (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),\n  or null if the versions are the same.\n\n### Comparators\n\n* `intersects(comparator)`: Return true if the comparators intersect\n\n### Ranges\n\n* `validRange(range)`: Return the valid range or null if it's not valid\n* `satisfies(version, range)`: Return true if the version satisfies the\n  range.\n* `maxSatisfying(versions, range)`: Return the highest version in the list\n  that satisfies the range, or `null` if none of them do.\n* `minSatisfying(versions, range)`: Return the lowest version in the list\n  that satisfies the range, or `null` if none of them do.\n* `minVersion(range)`: Return the lowest version that can possibly match\n  the given range.\n* `gtr(version, range)`: Return `true` if version is greater than all the\n  versions possible in the range.\n* `ltr(version, range)`: Return `true` if version is less than all the\n  versions possible in the range.\n* `outside(version, range, hilo)`: Return true if the version is outside\n  the bounds of the range in either the high or low direction.  The\n  `hilo` argument must be either the string `'>'` or `'<'`.  (This is\n  the function called by `gtr` and `ltr`.)\n* `intersects(range)`: Return true if any of the ranges comparators intersect\n\nNote that, since ranges may be non-contiguous, a version might not be\ngreater than a range, less than a range, *or* satisfy a range!  For\nexample, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`\nuntil `2.0.0`, so the version `1.2.10` would not be greater than the\nrange (because `2.0.1` satisfies, which is higher), nor less than the\nrange (since `1.2.8` satisfies, which is lower), and it also does not\nsatisfy the range.\n\nIf you want to know if a version satisfies or does not satisfy a\nrange, use the `satisfies(version, range)` function.\n\n### Coercion\n\n* `coerce(version)`: Coerces a string to semver if possible\n\nThis aims to provide a very forgiving translation of a non-semver\nstring to semver. It looks for the first digit in a string, and\nconsumes all remaining characters which satisfy at least a partial semver\n(e.g., `1`, `1.2`, `1.2.3`) up to the max permitted length (256 characters).\nLonger versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`).\nAll surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes `3.4.0`).\nOnly text which lacks digits will fail coercion (`version one` is not valid).\nThe maximum  length for any semver component considered for coercion is 16 characters;\nlonger components will be ignored (`10000000000000000.4.7.4` becomes `4.7.4`).\nThe maximum value for any semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`;\nhigher value components are invalid (`9999999999999999.4.7.4` is likely invalid).\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/node-semver.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap"
+  },
+  "tap": {
+    "check-coverage": true
+  },
+  "version": "5.7.0"
+}
diff --git a/legacy-libs/grpc/node_modules/semver/range.bnf b/legacy-libs/grpc/node_modules/semver/range.bnf
new file mode 100644 (file)
index 0000000..d4c6ae0
--- /dev/null
@@ -0,0 +1,16 @@
+range-set  ::= range ( logical-or range ) *
+logical-or ::= ( ' ' ) * '||' ( ' ' ) *
+range      ::= hyphen | simple ( ' ' simple ) * | ''
+hyphen     ::= partial ' - ' partial
+simple     ::= primitive | partial | tilde | caret
+primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
+partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
+xr         ::= 'x' | 'X' | '*' | nr
+nr         ::= '0' | [1-9] ( [0-9] ) *
+tilde      ::= '~' partial
+caret      ::= '^' partial
+qualifier  ::= ( '-' pre )? ( '+' build )?
+pre        ::= parts
+build      ::= parts
+parts      ::= part ( '.' part ) *
+part       ::= nr | [-0-9A-Za-z]+
diff --git a/legacy-libs/grpc/node_modules/semver/semver.js b/legacy-libs/grpc/node_modules/semver/semver.js
new file mode 100644 (file)
index 0000000..d315d5d
--- /dev/null
@@ -0,0 +1,1483 @@
+exports = module.exports = SemVer
+
+var debug
+/* istanbul ignore next */
+if (typeof process === 'object' &&
+    process.env &&
+    process.env.NODE_DEBUG &&
+    /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+  debug = function () {
+    var args = Array.prototype.slice.call(arguments, 0)
+    args.unshift('SEMVER')
+    console.log.apply(console, args)
+  }
+} else {
+  debug = function () {}
+}
+
+// Note: this is the semver.org version of the spec that it implements
+// Not necessarily the package version of this code.
+exports.SEMVER_SPEC_VERSION = '2.0.0'
+
+var MAX_LENGTH = 256
+var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
+  /* istanbul ignore next */ 9007199254740991
+
+// Max safe segment length for coercion.
+var MAX_SAFE_COMPONENT_LENGTH = 16
+
+// The actual regexps go on exports.re
+var re = exports.re = []
+var src = exports.src = []
+var R = 0
+
+// The following Regular Expressions can be used for tokenizing,
+// validating, and parsing SemVer version strings.
+
+// ## Numeric Identifier
+// A single `0`, or a non-zero digit followed by zero or more digits.
+
+var NUMERICIDENTIFIER = R++
+src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
+var NUMERICIDENTIFIERLOOSE = R++
+src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
+
+// ## Non-numeric Identifier
+// Zero or more digits, followed by a letter or hyphen, and then zero or
+// more letters, digits, or hyphens.
+
+var NONNUMERICIDENTIFIER = R++
+src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
+
+// ## Main Version
+// Three dot-separated numeric identifiers.
+
+var MAINVERSION = R++
+src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+                   '(' + src[NUMERICIDENTIFIER] + ')\\.' +
+                   '(' + src[NUMERICIDENTIFIER] + ')'
+
+var MAINVERSIONLOOSE = R++
+src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
+                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
+
+// ## Pre-release Version Identifier
+// A numeric identifier, or a non-numeric identifier.
+
+var PRERELEASEIDENTIFIER = R++
+src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
+                            '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+var PRERELEASEIDENTIFIERLOOSE = R++
+src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
+                                 '|' + src[NONNUMERICIDENTIFIER] + ')'
+
+// ## Pre-release Version
+// Hyphen, followed by one or more dot-separated pre-release version
+// identifiers.
+
+var PRERELEASE = R++
+src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
+                  '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
+
+var PRERELEASELOOSE = R++
+src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
+                       '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
+
+// ## Build Metadata Identifier
+// Any combination of digits, letters, or hyphens.
+
+var BUILDIDENTIFIER = R++
+src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
+
+// ## Build Metadata
+// Plus sign, followed by one or more period-separated build metadata
+// identifiers.
+
+var BUILD = R++
+src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
+             '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
+
+// ## Full Version String
+// A main version, followed optionally by a pre-release version and
+// build metadata.
+
+// Note that the only major, minor, patch, and pre-release sections of
+// the version string are capturing groups.  The build metadata is not a
+// capturing group, because it should not ever be used in version
+// comparison.
+
+var FULL = R++
+var FULLPLAIN = 'v?' + src[MAINVERSION] +
+                src[PRERELEASE] + '?' +
+                src[BUILD] + '?'
+
+src[FULL] = '^' + FULLPLAIN + '$'
+
+// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
+// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
+// common in the npm registry.
+var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
+                 src[PRERELEASELOOSE] + '?' +
+                 src[BUILD] + '?'
+
+var LOOSE = R++
+src[LOOSE] = '^' + LOOSEPLAIN + '$'
+
+var GTLT = R++
+src[GTLT] = '((?:<|>)?=?)'
+
+// Something like "2.*" or "1.2.x".
+// Note that "x.x" is a valid xRange identifer, meaning "any version"
+// Only the first item is strictly required.
+var XRANGEIDENTIFIERLOOSE = R++
+src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
+var XRANGEIDENTIFIER = R++
+src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
+
+var XRANGEPLAIN = R++
+src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
+                   '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+                   '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
+                   '(?:' + src[PRERELEASE] + ')?' +
+                   src[BUILD] + '?' +
+                   ')?)?'
+
+var XRANGEPLAINLOOSE = R++
+src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+                        '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+                        '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
+                        '(?:' + src[PRERELEASELOOSE] + ')?' +
+                        src[BUILD] + '?' +
+                        ')?)?'
+
+var XRANGE = R++
+src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
+var XRANGELOOSE = R++
+src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
+
+// Coercion.
+// Extract anything that could conceivably be a part of a valid semver
+var COERCE = R++
+src[COERCE] = '(?:^|[^\\d])' +
+              '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
+              '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+              '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
+              '(?:$|[^\\d])'
+
+// Tilde ranges.
+// Meaning is "reasonably at or greater than"
+var LONETILDE = R++
+src[LONETILDE] = '(?:~>?)'
+
+var TILDETRIM = R++
+src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
+re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
+var tildeTrimReplace = '$1~'
+
+var TILDE = R++
+src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
+var TILDELOOSE = R++
+src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
+
+// Caret ranges.
+// Meaning is "at least and backwards compatible with"
+var LONECARET = R++
+src[LONECARET] = '(?:\\^)'
+
+var CARETTRIM = R++
+src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
+re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
+var caretTrimReplace = '$1^'
+
+var CARET = R++
+src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
+var CARETLOOSE = R++
+src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
+
+// A simple gt/lt/eq thing, or just "" to indicate "any version"
+var COMPARATORLOOSE = R++
+src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
+var COMPARATOR = R++
+src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
+
+// An expression to strip any whitespace between the gtlt and the thing
+// it modifies, so that `> 1.2.3` ==> `>1.2.3`
+var COMPARATORTRIM = R++
+src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
+                      '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
+
+// this one has to use the /g flag
+re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
+var comparatorTrimReplace = '$1$2$3'
+
+// Something like `1.2.3 - 1.2.4`
+// Note that these all use the loose form, because they'll be
+// checked against either the strict or loose comparator form
+// later.
+var HYPHENRANGE = R++
+src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
+                   '\\s+-\\s+' +
+                   '(' + src[XRANGEPLAIN] + ')' +
+                   '\\s*$'
+
+var HYPHENRANGELOOSE = R++
+src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
+                        '\\s+-\\s+' +
+                        '(' + src[XRANGEPLAINLOOSE] + ')' +
+                        '\\s*$'
+
+// Star ranges basically just allow anything at all.
+var STAR = R++
+src[STAR] = '(<|>)?=?\\s*\\*'
+
+// Compile to actual regexp objects.
+// All are flag-free, unless they were created above with a flag.
+for (var i = 0; i < R; i++) {
+  debug(i, src[i])
+  if (!re[i]) {
+    re[i] = new RegExp(src[i])
+  }
+}
+
+exports.parse = parse
+function parse (version, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  if (version instanceof SemVer) {
+    return version
+  }
+
+  if (typeof version !== 'string') {
+    return null
+  }
+
+  if (version.length > MAX_LENGTH) {
+    return null
+  }
+
+  var r = options.loose ? re[LOOSE] : re[FULL]
+  if (!r.test(version)) {
+    return null
+  }
+
+  try {
+    return new SemVer(version, options)
+  } catch (er) {
+    return null
+  }
+}
+
+exports.valid = valid
+function valid (version, options) {
+  var v = parse(version, options)
+  return v ? v.version : null
+}
+
+exports.clean = clean
+function clean (version, options) {
+  var s = parse(version.trim().replace(/^[=v]+/, ''), options)
+  return s ? s.version : null
+}
+
+exports.SemVer = SemVer
+
+function SemVer (version, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+  if (version instanceof SemVer) {
+    if (version.loose === options.loose) {
+      return version
+    } else {
+      version = version.version
+    }
+  } else if (typeof version !== 'string') {
+    throw new TypeError('Invalid Version: ' + version)
+  }
+
+  if (version.length > MAX_LENGTH) {
+    throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
+  }
+
+  if (!(this instanceof SemVer)) {
+    return new SemVer(version, options)
+  }
+
+  debug('SemVer', version, options)
+  this.options = options
+  this.loose = !!options.loose
+
+  var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
+
+  if (!m) {
+    throw new TypeError('Invalid Version: ' + version)
+  }
+
+  this.raw = version
+
+  // these are actually numbers
+  this.major = +m[1]
+  this.minor = +m[2]
+  this.patch = +m[3]
+
+  if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+    throw new TypeError('Invalid major version')
+  }
+
+  if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+    throw new TypeError('Invalid minor version')
+  }
+
+  if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+    throw new TypeError('Invalid patch version')
+  }
+
+  // numberify any prerelease numeric ids
+  if (!m[4]) {
+    this.prerelease = []
+  } else {
+    this.prerelease = m[4].split('.').map(function (id) {
+      if (/^[0-9]+$/.test(id)) {
+        var num = +id
+        if (num >= 0 && num < MAX_SAFE_INTEGER) {
+          return num
+        }
+      }
+      return id
+    })
+  }
+
+  this.build = m[5] ? m[5].split('.') : []
+  this.format()
+}
+
+SemVer.prototype.format = function () {
+  this.version = this.major + '.' + this.minor + '.' + this.patch
+  if (this.prerelease.length) {
+    this.version += '-' + this.prerelease.join('.')
+  }
+  return this.version
+}
+
+SemVer.prototype.toString = function () {
+  return this.version
+}
+
+SemVer.prototype.compare = function (other) {
+  debug('SemVer.compare', this.version, this.options, other)
+  if (!(other instanceof SemVer)) {
+    other = new SemVer(other, this.options)
+  }
+
+  return this.compareMain(other) || this.comparePre(other)
+}
+
+SemVer.prototype.compareMain = function (other) {
+  if (!(other instanceof SemVer)) {
+    other = new SemVer(other, this.options)
+  }
+
+  return compareIdentifiers(this.major, other.major) ||
+         compareIdentifiers(this.minor, other.minor) ||
+         compareIdentifiers(this.patch, other.patch)
+}
+
+SemVer.prototype.comparePre = function (other) {
+  if (!(other instanceof SemVer)) {
+    other = new SemVer(other, this.options)
+  }
+
+  // NOT having a prerelease is > having one
+  if (this.prerelease.length && !other.prerelease.length) {
+    return -1
+  } else if (!this.prerelease.length && other.prerelease.length) {
+    return 1
+  } else if (!this.prerelease.length && !other.prerelease.length) {
+    return 0
+  }
+
+  var i = 0
+  do {
+    var a = this.prerelease[i]
+    var b = other.prerelease[i]
+    debug('prerelease compare', i, a, b)
+    if (a === undefined && b === undefined) {
+      return 0
+    } else if (b === undefined) {
+      return 1
+    } else if (a === undefined) {
+      return -1
+    } else if (a === b) {
+      continue
+    } else {
+      return compareIdentifiers(a, b)
+    }
+  } while (++i)
+}
+
+// preminor will bump the version up to the next minor release, and immediately
+// down to pre-release. premajor and prepatch work the same way.
+SemVer.prototype.inc = function (release, identifier) {
+  switch (release) {
+    case 'premajor':
+      this.prerelease.length = 0
+      this.patch = 0
+      this.minor = 0
+      this.major++
+      this.inc('pre', identifier)
+      break
+    case 'preminor':
+      this.prerelease.length = 0
+      this.patch = 0
+      this.minor++
+      this.inc('pre', identifier)
+      break
+    case 'prepatch':
+      // If this is already a prerelease, it will bump to the next version
+      // drop any prereleases that might already exist, since they are not
+      // relevant at this point.
+      this.prerelease.length = 0
+      this.inc('patch', identifier)
+      this.inc('pre', identifier)
+      break
+    // If the input is a non-prerelease version, this acts the same as
+    // prepatch.
+    case 'prerelease':
+      if (this.prerelease.length === 0) {
+        this.inc('patch', identifier)
+      }
+      this.inc('pre', identifier)
+      break
+
+    case 'major':
+      // If this is a pre-major version, bump up to the same major version.
+      // Otherwise increment major.
+      // 1.0.0-5 bumps to 1.0.0
+      // 1.1.0 bumps to 2.0.0
+      if (this.minor !== 0 ||
+          this.patch !== 0 ||
+          this.prerelease.length === 0) {
+        this.major++
+      }
+      this.minor = 0
+      this.patch = 0
+      this.prerelease = []
+      break
+    case 'minor':
+      // If this is a pre-minor version, bump up to the same minor version.
+      // Otherwise increment minor.
+      // 1.2.0-5 bumps to 1.2.0
+      // 1.2.1 bumps to 1.3.0
+      if (this.patch !== 0 || this.prerelease.length === 0) {
+        this.minor++
+      }
+      this.patch = 0
+      this.prerelease = []
+      break
+    case 'patch':
+      // If this is not a pre-release version, it will increment the patch.
+      // If it is a pre-release it will bump up to the same patch version.
+      // 1.2.0-5 patches to 1.2.0
+      // 1.2.0 patches to 1.2.1
+      if (this.prerelease.length === 0) {
+        this.patch++
+      }
+      this.prerelease = []
+      break
+    // This probably shouldn't be used publicly.
+    // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+    case 'pre':
+      if (this.prerelease.length === 0) {
+        this.prerelease = [0]
+      } else {
+        var i = this.prerelease.length
+        while (--i >= 0) {
+          if (typeof this.prerelease[i] === 'number') {
+            this.prerelease[i]++
+            i = -2
+          }
+        }
+        if (i === -1) {
+          // didn't increment anything
+          this.prerelease.push(0)
+        }
+      }
+      if (identifier) {
+        // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
+        // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
+        if (this.prerelease[0] === identifier) {
+          if (isNaN(this.prerelease[1])) {
+            this.prerelease = [identifier, 0]
+          }
+        } else {
+          this.prerelease = [identifier, 0]
+        }
+      }
+      break
+
+    default:
+      throw new Error('invalid increment argument: ' + release)
+  }
+  this.format()
+  this.raw = this.version
+  return this
+}
+
+exports.inc = inc
+function inc (version, release, loose, identifier) {
+  if (typeof (loose) === 'string') {
+    identifier = loose
+    loose = undefined
+  }
+
+  try {
+    return new SemVer(version, loose).inc(release, identifier).version
+  } catch (er) {
+    return null
+  }
+}
+
+exports.diff = diff
+function diff (version1, version2) {
+  if (eq(version1, version2)) {
+    return null
+  } else {
+    var v1 = parse(version1)
+    var v2 = parse(version2)
+    var prefix = ''
+    if (v1.prerelease.length || v2.prerelease.length) {
+      prefix = 'pre'
+      var defaultResult = 'prerelease'
+    }
+    for (var key in v1) {
+      if (key === 'major' || key === 'minor' || key === 'patch') {
+        if (v1[key] !== v2[key]) {
+          return prefix + key
+        }
+      }
+    }
+    return defaultResult // may be undefined
+  }
+}
+
+exports.compareIdentifiers = compareIdentifiers
+
+var numeric = /^[0-9]+$/
+function compareIdentifiers (a, b) {
+  var anum = numeric.test(a)
+  var bnum = numeric.test(b)
+
+  if (anum && bnum) {
+    a = +a
+    b = +b
+  }
+
+  return a === b ? 0
+    : (anum && !bnum) ? -1
+    : (bnum && !anum) ? 1
+    : a < b ? -1
+    : 1
+}
+
+exports.rcompareIdentifiers = rcompareIdentifiers
+function rcompareIdentifiers (a, b) {
+  return compareIdentifiers(b, a)
+}
+
+exports.major = major
+function major (a, loose) {
+  return new SemVer(a, loose).major
+}
+
+exports.minor = minor
+function minor (a, loose) {
+  return new SemVer(a, loose).minor
+}
+
+exports.patch = patch
+function patch (a, loose) {
+  return new SemVer(a, loose).patch
+}
+
+exports.compare = compare
+function compare (a, b, loose) {
+  return new SemVer(a, loose).compare(new SemVer(b, loose))
+}
+
+exports.compareLoose = compareLoose
+function compareLoose (a, b) {
+  return compare(a, b, true)
+}
+
+exports.rcompare = rcompare
+function rcompare (a, b, loose) {
+  return compare(b, a, loose)
+}
+
+exports.sort = sort
+function sort (list, loose) {
+  return list.sort(function (a, b) {
+    return exports.compare(a, b, loose)
+  })
+}
+
+exports.rsort = rsort
+function rsort (list, loose) {
+  return list.sort(function (a, b) {
+    return exports.rcompare(a, b, loose)
+  })
+}
+
+exports.gt = gt
+function gt (a, b, loose) {
+  return compare(a, b, loose) > 0
+}
+
+exports.lt = lt
+function lt (a, b, loose) {
+  return compare(a, b, loose) < 0
+}
+
+exports.eq = eq
+function eq (a, b, loose) {
+  return compare(a, b, loose) === 0
+}
+
+exports.neq = neq
+function neq (a, b, loose) {
+  return compare(a, b, loose) !== 0
+}
+
+exports.gte = gte
+function gte (a, b, loose) {
+  return compare(a, b, loose) >= 0
+}
+
+exports.lte = lte
+function lte (a, b, loose) {
+  return compare(a, b, loose) <= 0
+}
+
+exports.cmp = cmp
+function cmp (a, op, b, loose) {
+  switch (op) {
+    case '===':
+      if (typeof a === 'object')
+        a = a.version
+      if (typeof b === 'object')
+        b = b.version
+      return a === b
+
+    case '!==':
+      if (typeof a === 'object')
+        a = a.version
+      if (typeof b === 'object')
+        b = b.version
+      return a !== b
+
+    case '':
+    case '=':
+    case '==':
+      return eq(a, b, loose)
+
+    case '!=':
+      return neq(a, b, loose)
+
+    case '>':
+      return gt(a, b, loose)
+
+    case '>=':
+      return gte(a, b, loose)
+
+    case '<':
+      return lt(a, b, loose)
+
+    case '<=':
+      return lte(a, b, loose)
+
+    default:
+      throw new TypeError('Invalid operator: ' + op)
+  }
+}
+
+exports.Comparator = Comparator
+function Comparator (comp, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  if (comp instanceof Comparator) {
+    if (comp.loose === !!options.loose) {
+      return comp
+    } else {
+      comp = comp.value
+    }
+  }
+
+  if (!(this instanceof Comparator)) {
+    return new Comparator(comp, options)
+  }
+
+  debug('comparator', comp, options)
+  this.options = options
+  this.loose = !!options.loose
+  this.parse(comp)
+
+  if (this.semver === ANY) {
+    this.value = ''
+  } else {
+    this.value = this.operator + this.semver.version
+  }
+
+  debug('comp', this)
+}
+
+var ANY = {}
+Comparator.prototype.parse = function (comp) {
+  var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+  var m = comp.match(r)
+
+  if (!m) {
+    throw new TypeError('Invalid comparator: ' + comp)
+  }
+
+  this.operator = m[1]
+  if (this.operator === '=') {
+    this.operator = ''
+  }
+
+  // if it literally is just '>' or '' then allow anything.
+  if (!m[2]) {
+    this.semver = ANY
+  } else {
+    this.semver = new SemVer(m[2], this.options.loose)
+  }
+}
+
+Comparator.prototype.toString = function () {
+  return this.value
+}
+
+Comparator.prototype.test = function (version) {
+  debug('Comparator.test', version, this.options.loose)
+
+  if (this.semver === ANY) {
+    return true
+  }
+
+  if (typeof version === 'string') {
+    version = new SemVer(version, this.options)
+  }
+
+  return cmp(version, this.operator, this.semver, this.options)
+}
+
+Comparator.prototype.intersects = function (comp, options) {
+  if (!(comp instanceof Comparator)) {
+    throw new TypeError('a Comparator is required')
+  }
+
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  var rangeTmp
+
+  if (this.operator === '') {
+    rangeTmp = new Range(comp.value, options)
+    return satisfies(this.value, rangeTmp, options)
+  } else if (comp.operator === '') {
+    rangeTmp = new Range(this.value, options)
+    return satisfies(comp.semver, rangeTmp, options)
+  }
+
+  var sameDirectionIncreasing =
+    (this.operator === '>=' || this.operator === '>') &&
+    (comp.operator === '>=' || comp.operator === '>')
+  var sameDirectionDecreasing =
+    (this.operator === '<=' || this.operator === '<') &&
+    (comp.operator === '<=' || comp.operator === '<')
+  var sameSemVer = this.semver.version === comp.semver.version
+  var differentDirectionsInclusive =
+    (this.operator === '>=' || this.operator === '<=') &&
+    (comp.operator === '>=' || comp.operator === '<=')
+  var oppositeDirectionsLessThan =
+    cmp(this.semver, '<', comp.semver, options) &&
+    ((this.operator === '>=' || this.operator === '>') &&
+    (comp.operator === '<=' || comp.operator === '<'))
+  var oppositeDirectionsGreaterThan =
+    cmp(this.semver, '>', comp.semver, options) &&
+    ((this.operator === '<=' || this.operator === '<') &&
+    (comp.operator === '>=' || comp.operator === '>'))
+
+  return sameDirectionIncreasing || sameDirectionDecreasing ||
+    (sameSemVer && differentDirectionsInclusive) ||
+    oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
+}
+
+exports.Range = Range
+function Range (range, options) {
+  if (!options || typeof options !== 'object') {
+    options = {
+      loose: !!options,
+      includePrerelease: false
+    }
+  }
+
+  if (range instanceof Range) {
+    if (range.loose === !!options.loose &&
+        range.includePrerelease === !!options.includePrerelease) {
+      return range
+    } else {
+      return new Range(range.raw, options)
+    }
+  }
+
+  if (range instanceof Comparator) {
+    return new Range(range.value, options)
+  }
+
+  if (!(this instanceof Range)) {
+    return new Range(range, options)
+  }
+
+  this.options = options
+  this.loose = !!options.loose
+  this.includePrerelease = !!options.includePrerelease
+
+  // First, split based on boolean or ||
+  this.raw = range
+  this.set = range.split(/\s*\|\|\s*/).map(function (range) {
+    return this.parseRange(range.trim())
+  }, this).filter(function (c) {
+    // throw out any that are not relevant for whatever reason
+    return c.length
+  })
+
+  if (!this.set.length) {
+    throw new TypeError('Invalid SemVer Range: ' + range)
+  }
+
+  this.format()
+}
+
+Range.prototype.format = function () {
+  this.range = this.set.map(function (comps) {
+    return comps.join(' ').trim()
+  }).join('||').trim()
+  return this.range
+}
+
+Range.prototype.toString = function () {
+  return this.range
+}
+
+Range.prototype.parseRange = function (range) {
+  var loose = this.options.loose
+  range = range.trim()
+  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
+  var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
+  range = range.replace(hr, hyphenReplace)
+  debug('hyphen replace', range)
+  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
+  range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
+  debug('comparator trim', range, re[COMPARATORTRIM])
+
+  // `~ 1.2.3` => `~1.2.3`
+  range = range.replace(re[TILDETRIM], tildeTrimReplace)
+
+  // `^ 1.2.3` => `^1.2.3`
+  range = range.replace(re[CARETTRIM], caretTrimReplace)
+
+  // normalize spaces
+  range = range.split(/\s+/).join(' ')
+
+  // At this point, the range is completely trimmed and
+  // ready to be split into comparators.
+
+  var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
+  var set = range.split(' ').map(function (comp) {
+    return parseComparator(comp, this.options)
+  }, this).join(' ').split(/\s+/)
+  if (this.options.loose) {
+    // in loose mode, throw out any that are not valid comparators
+    set = set.filter(function (comp) {
+      return !!comp.match(compRe)
+    })
+  }
+  set = set.map(function (comp) {
+    return new Comparator(comp, this.options)
+  }, this)
+
+  return set
+}
+
+Range.prototype.intersects = function (range, options) {
+  if (!(range instanceof Range)) {
+    throw new TypeError('a Range is required')
+  }
+
+  return this.set.some(function (thisComparators) {
+    return thisComparators.every(function (thisComparator) {
+      return range.set.some(function (rangeComparators) {
+        return rangeComparators.every(function (rangeComparator) {
+          return thisComparator.intersects(rangeComparator, options)
+        })
+      })
+    })
+  })
+}
+
+// Mostly just for testing and legacy API reasons
+exports.toComparators = toComparators
+function toComparators (range, options) {
+  return new Range(range, options).set.map(function (comp) {
+    return comp.map(function (c) {
+      return c.value
+    }).join(' ').trim().split(' ')
+  })
+}
+
+// comprised of xranges, tildes, stars, and gtlt's at this point.
+// already replaced the hyphen ranges
+// turn into a set of JUST comparators.
+function parseComparator (comp, options) {
+  debug('comp', comp, options)
+  comp = replaceCarets(comp, options)
+  debug('caret', comp)
+  comp = replaceTildes(comp, options)
+  debug('tildes', comp)
+  comp = replaceXRanges(comp, options)
+  debug('xrange', comp)
+  comp = replaceStars(comp, options)
+  debug('stars', comp)
+  return comp
+}
+
+function isX (id) {
+  return !id || id.toLowerCase() === 'x' || id === '*'
+}
+
+// ~, ~> --> * (any, kinda silly)
+// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
+// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
+// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
+// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
+// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
+function replaceTildes (comp, options) {
+  return comp.trim().split(/\s+/).map(function (comp) {
+    return replaceTilde(comp, options)
+  }).join(' ')
+}
+
+function replaceTilde (comp, options) {
+  var r = options.loose ? re[TILDELOOSE] : re[TILDE]
+  return comp.replace(r, function (_, M, m, p, pr) {
+    debug('tilde', comp, _, M, m, p, pr)
+    var ret
+
+    if (isX(M)) {
+      ret = ''
+    } else if (isX(m)) {
+      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+    } else if (isX(p)) {
+      // ~1.2 == >=1.2.0 <1.3.0
+      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+    } else if (pr) {
+      debug('replaceTilde pr', pr)
+      ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+            ' <' + M + '.' + (+m + 1) + '.0'
+    } else {
+      // ~1.2.3 == >=1.2.3 <1.3.0
+      ret = '>=' + M + '.' + m + '.' + p +
+            ' <' + M + '.' + (+m + 1) + '.0'
+    }
+
+    debug('tilde return', ret)
+    return ret
+  })
+}
+
+// ^ --> * (any, kinda silly)
+// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
+// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
+// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
+// ^1.2.3 --> >=1.2.3 <2.0.0
+// ^1.2.0 --> >=1.2.0 <2.0.0
+function replaceCarets (comp, options) {
+  return comp.trim().split(/\s+/).map(function (comp) {
+    return replaceCaret(comp, options)
+  }).join(' ')
+}
+
+function replaceCaret (comp, options) {
+  debug('caret', comp, options)
+  var r = options.loose ? re[CARETLOOSE] : re[CARET]
+  return comp.replace(r, function (_, M, m, p, pr) {
+    debug('caret', comp, _, M, m, p, pr)
+    var ret
+
+    if (isX(M)) {
+      ret = ''
+    } else if (isX(m)) {
+      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+    } else if (isX(p)) {
+      if (M === '0') {
+        ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+      } else {
+        ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
+      }
+    } else if (pr) {
+      debug('replaceCaret pr', pr)
+      if (M === '0') {
+        if (m === '0') {
+          ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+                ' <' + M + '.' + m + '.' + (+p + 1)
+        } else {
+          ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+                ' <' + M + '.' + (+m + 1) + '.0'
+        }
+      } else {
+        ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
+              ' <' + (+M + 1) + '.0.0'
+      }
+    } else {
+      debug('no pr')
+      if (M === '0') {
+        if (m === '0') {
+          ret = '>=' + M + '.' + m + '.' + p +
+                ' <' + M + '.' + m + '.' + (+p + 1)
+        } else {
+          ret = '>=' + M + '.' + m + '.' + p +
+                ' <' + M + '.' + (+m + 1) + '.0'
+        }
+      } else {
+        ret = '>=' + M + '.' + m + '.' + p +
+              ' <' + (+M + 1) + '.0.0'
+      }
+    }
+
+    debug('caret return', ret)
+    return ret
+  })
+}
+
+function replaceXRanges (comp, options) {
+  debug('replaceXRanges', comp, options)
+  return comp.split(/\s+/).map(function (comp) {
+    return replaceXRange(comp, options)
+  }).join(' ')
+}
+
+function replaceXRange (comp, options) {
+  comp = comp.trim()
+  var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
+  return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
+    debug('xRange', comp, ret, gtlt, M, m, p, pr)
+    var xM = isX(M)
+    var xm = xM || isX(m)
+    var xp = xm || isX(p)
+    var anyX = xp
+
+    if (gtlt === '=' && anyX) {
+      gtlt = ''
+    }
+
+    if (xM) {
+      if (gtlt === '>' || gtlt === '<') {
+        // nothing is allowed
+        ret = '<0.0.0'
+      } else {
+        // nothing is forbidden
+        ret = '*'
+      }
+    } else if (gtlt && anyX) {
+      // we know patch is an x, because we have any x at all.
+      // replace X with 0
+      if (xm) {
+        m = 0
+      }
+      p = 0
+
+      if (gtlt === '>') {
+        // >1 => >=2.0.0
+        // >1.2 => >=1.3.0
+        // >1.2.3 => >= 1.2.4
+        gtlt = '>='
+        if (xm) {
+          M = +M + 1
+          m = 0
+          p = 0
+        } else {
+          m = +m + 1
+          p = 0
+        }
+      } else if (gtlt === '<=') {
+        // <=0.7.x is actually <0.8.0, since any 0.7.x should
+        // pass.  Similarly, <=7.x is actually <8.0.0, etc.
+        gtlt = '<'
+        if (xm) {
+          M = +M + 1
+        } else {
+          m = +m + 1
+        }
+      }
+
+      ret = gtlt + M + '.' + m + '.' + p
+    } else if (xm) {
+      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
+    } else if (xp) {
+      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
+    }
+
+    debug('xRange return', ret)
+
+    return ret
+  })
+}
+
+// Because * is AND-ed with everything else in the comparator,
+// and '' means "any version", just remove the *s entirely.
+function replaceStars (comp, options) {
+  debug('replaceStars', comp, options)
+  // Looseness is ignored here.  star is always as loose as it gets!
+  return comp.trim().replace(re[STAR], '')
+}
+
+// This function is passed to string.replace(re[HYPHENRANGE])
+// M, m, patch, prerelease, build
+// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
+// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
+// 1.2 - 3.4 => >=1.2.0 <3.5.0
+function hyphenReplace ($0,
+  from, fM, fm, fp, fpr, fb,
+  to, tM, tm, tp, tpr, tb) {
+  if (isX(fM)) {
+    from = ''
+  } else if (isX(fm)) {
+    from = '>=' + fM + '.0.0'
+  } else if (isX(fp)) {
+    from = '>=' + fM + '.' + fm + '.0'
+  } else {
+    from = '>=' + from
+  }
+
+  if (isX(tM)) {
+    to = ''
+  } else if (isX(tm)) {
+    to = '<' + (+tM + 1) + '.0.0'
+  } else if (isX(tp)) {
+    to = '<' + tM + '.' + (+tm + 1) + '.0'
+  } else if (tpr) {
+    to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
+  } else {
+    to = '<=' + to
+  }
+
+  return (from + ' ' + to).trim()
+}
+
+// if ANY of the sets match ALL of its comparators, then pass
+Range.prototype.test = function (version) {
+  if (!version) {
+    return false
+  }
+
+  if (typeof version === 'string') {
+    version = new SemVer(version, this.options)
+  }
+
+  for (var i = 0; i < this.set.length; i++) {
+    if (testSet(this.set[i], version, this.options)) {
+      return true
+    }
+  }
+  return false
+}
+
+function testSet (set, version, options) {
+  for (var i = 0; i < set.length; i++) {
+    if (!set[i].test(version)) {
+      return false
+    }
+  }
+
+  if (version.prerelease.length && !options.includePrerelease) {
+    // Find the set of versions that are allowed to have prereleases
+    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
+    // That should allow `1.2.3-pr.2` to pass.
+    // However, `1.2.4-alpha.notready` should NOT be allowed,
+    // even though it's within the range set by the comparators.
+    for (i = 0; i < set.length; i++) {
+      debug(set[i].semver)
+      if (set[i].semver === ANY) {
+        continue
+      }
+
+      if (set[i].semver.prerelease.length > 0) {
+        var allowed = set[i].semver
+        if (allowed.major === version.major &&
+            allowed.minor === version.minor &&
+            allowed.patch === version.patch) {
+          return true
+        }
+      }
+    }
+
+    // Version has a -pre, but it's not one of the ones we like.
+    return false
+  }
+
+  return true
+}
+
+exports.satisfies = satisfies
+function satisfies (version, range, options) {
+  try {
+    range = new Range(range, options)
+  } catch (er) {
+    return false
+  }
+  return range.test(version)
+}
+
+exports.maxSatisfying = maxSatisfying
+function maxSatisfying (versions, range, options) {
+  var max = null
+  var maxSV = null
+  try {
+    var rangeObj = new Range(range, options)
+  } catch (er) {
+    return null
+  }
+  versions.forEach(function (v) {
+    if (rangeObj.test(v)) {
+      // satisfies(v, range, options)
+      if (!max || maxSV.compare(v) === -1) {
+        // compare(max, v, true)
+        max = v
+        maxSV = new SemVer(max, options)
+      }
+    }
+  })
+  return max
+}
+
+exports.minSatisfying = minSatisfying
+function minSatisfying (versions, range, options) {
+  var min = null
+  var minSV = null
+  try {
+    var rangeObj = new Range(range, options)
+  } catch (er) {
+    return null
+  }
+  versions.forEach(function (v) {
+    if (rangeObj.test(v)) {
+      // satisfies(v, range, options)
+      if (!min || minSV.compare(v) === 1) {
+        // compare(min, v, true)
+        min = v
+        minSV = new SemVer(min, options)
+      }
+    }
+  })
+  return min
+}
+
+exports.minVersion = minVersion
+function minVersion (range, loose) {
+  range = new Range(range, loose)
+
+  var minver = new SemVer('0.0.0')
+  if (range.test(minver)) {
+    return minver
+  }
+
+  minver = new SemVer('0.0.0-0')
+  if (range.test(minver)) {
+    return minver
+  }
+
+  minver = null
+  for (var i = 0; i < range.set.length; ++i) {
+    var comparators = range.set[i]
+
+    comparators.forEach(function (comparator) {
+      // Clone to avoid manipulating the comparator's semver object.
+      var compver = new SemVer(comparator.semver.version)
+      switch (comparator.operator) {
+        case '>':
+          if (compver.prerelease.length === 0) {
+            compver.patch++
+          } else {
+            compver.prerelease.push(0)
+          }
+          compver.raw = compver.format()
+          /* fallthrough */
+        case '':
+        case '>=':
+          if (!minver || gt(minver, compver)) {
+            minver = compver
+          }
+          break
+        case '<':
+        case '<=':
+          /* Ignore maximum versions */
+          break
+        /* istanbul ignore next */
+        default:
+          throw new Error('Unexpected operation: ' + comparator.operator)
+      }
+    })
+  }
+
+  if (minver && range.test(minver)) {
+    return minver
+  }
+
+  return null
+}
+
+exports.validRange = validRange
+function validRange (range, options) {
+  try {
+    // Return '*' instead of '' so that truthiness works.
+    // This will throw if it's invalid anyway
+    return new Range(range, options).range || '*'
+  } catch (er) {
+    return null
+  }
+}
+
+// Determine if version is less than all the versions possible in the range
+exports.ltr = ltr
+function ltr (version, range, options) {
+  return outside(version, range, '<', options)
+}
+
+// Determine if version is greater than all the versions possible in the range.
+exports.gtr = gtr
+function gtr (version, range, options) {
+  return outside(version, range, '>', options)
+}
+
+exports.outside = outside
+function outside (version, range, hilo, options) {
+  version = new SemVer(version, options)
+  range = new Range(range, options)
+
+  var gtfn, ltefn, ltfn, comp, ecomp
+  switch (hilo) {
+    case '>':
+      gtfn = gt
+      ltefn = lte
+      ltfn = lt
+      comp = '>'
+      ecomp = '>='
+      break
+    case '<':
+      gtfn = lt
+      ltefn = gte
+      ltfn = gt
+      comp = '<'
+      ecomp = '<='
+      break
+    default:
+      throw new TypeError('Must provide a hilo val of "<" or ">"')
+  }
+
+  // If it satisifes the range it is not outside
+  if (satisfies(version, range, options)) {
+    return false
+  }
+
+  // From now on, variable terms are as if we're in "gtr" mode.
+  // but note that everything is flipped for the "ltr" function.
+
+  for (var i = 0; i < range.set.length; ++i) {
+    var comparators = range.set[i]
+
+    var high = null
+    var low = null
+
+    comparators.forEach(function (comparator) {
+      if (comparator.semver === ANY) {
+        comparator = new Comparator('>=0.0.0')
+      }
+      high = high || comparator
+      low = low || comparator
+      if (gtfn(comparator.semver, high.semver, options)) {
+        high = comparator
+      } else if (ltfn(comparator.semver, low.semver, options)) {
+        low = comparator
+      }
+    })
+
+    // If the edge version comparator has a operator then our version
+    // isn't outside it
+    if (high.operator === comp || high.operator === ecomp) {
+      return false
+    }
+
+    // If the lowest version comparator has an operator and our version
+    // is less than it then it isn't higher than the range
+    if ((!low.operator || low.operator === comp) &&
+        ltefn(version, low.semver)) {
+      return false
+    } else if (low.operator === ecomp && ltfn(version, low.semver)) {
+      return false
+    }
+  }
+  return true
+}
+
+exports.prerelease = prerelease
+function prerelease (version, options) {
+  var parsed = parse(version, options)
+  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
+}
+
+exports.intersects = intersects
+function intersects (r1, r2, options) {
+  r1 = new Range(r1, options)
+  r2 = new Range(r2, options)
+  return r1.intersects(r2)
+}
+
+exports.coerce = coerce
+function coerce (version) {
+  if (version instanceof SemVer) {
+    return version
+  }
+
+  if (typeof version !== 'string') {
+    return null
+  }
+
+  var match = version.match(re[COERCE])
+
+  if (match == null) {
+    return null
+  }
+
+  return parse(match[1] +
+    '.' + (match[2] || '0') +
+    '.' + (match[3] || '0'))
+}
diff --git a/legacy-libs/grpc/node_modules/set-blocking/CHANGELOG.md b/legacy-libs/grpc/node_modules/set-blocking/CHANGELOG.md
new file mode 100644 (file)
index 0000000..03bf591
--- /dev/null
@@ -0,0 +1,26 @@
+# Change Log
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+<a name="2.0.0"></a>
+# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17)
+
+
+### Features
+
+* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277))
+
+
+### BREAKING CHANGES
+
+* stdio/stderr will not be set to blocking if isTTY === false
+
+
+
+<a name="1.0.0"></a>
+# 1.0.0 (2016-05-14)
+
+
+### Features
+
+* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0))
diff --git a/legacy-libs/grpc/node_modules/set-blocking/LICENSE.txt b/legacy-libs/grpc/node_modules/set-blocking/LICENSE.txt
new file mode 100644 (file)
index 0000000..836440b
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2016, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/set-blocking/README.md b/legacy-libs/grpc/node_modules/set-blocking/README.md
new file mode 100644 (file)
index 0000000..e93b420
--- /dev/null
@@ -0,0 +1,31 @@
+# set-blocking
+
+[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking)
+[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking)
+[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master)
+[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
+
+set blocking `stdio` and `stderr` ensuring that terminal output does not truncate.
+
+```js
+const setBlocking = require('set-blocking')
+setBlocking(true)
+console.log(someLargeStringToOutput)
+```
+
+## Historical Context/Word of Warning
+
+This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on
+newer versions of Node.js (`0.12+`), truncating terminal output.
+
+You should be mindful of the side-effects caused by using `set-blocking`:
+
+* if your module sets blocking to `true`, it will effect other modules
+  consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call
+  `setBlocking(true)` once we already know we are about to call `process.exit(code)`.
+* this patch will not apply to subprocesses spawned with `isTTY = true`, this is
+  the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).
+
+## License
+
+ISC
diff --git a/legacy-libs/grpc/node_modules/set-blocking/index.js b/legacy-libs/grpc/node_modules/set-blocking/index.js
new file mode 100644 (file)
index 0000000..6f78774
--- /dev/null
@@ -0,0 +1,7 @@
+module.exports = function (blocking) {
+  [process.stdout, process.stderr].forEach(function (stream) {
+    if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') {
+      stream._handle.setBlocking(blocking)
+    }
+  })
+}
diff --git a/legacy-libs/grpc/node_modules/set-blocking/package.json b/legacy-libs/grpc/node_modules/set-blocking/package.json
new file mode 100644 (file)
index 0000000..f9d586a
--- /dev/null
@@ -0,0 +1,78 @@
+{
+  "_args": [
+    [
+      "set-blocking@2.0.0",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "set-blocking@2.0.0",
+  "_id": "set-blocking@2.0.0",
+  "_inBundle": false,
+  "_integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+  "_location": "/grpc/set-blocking",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "set-blocking@2.0.0",
+    "name": "set-blocking",
+    "escapedName": "set-blocking",
+    "rawSpec": "2.0.0",
+    "saveSpec": null,
+    "fetchSpec": "2.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/npmlog"
+  ],
+  "_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Ben Coe",
+    "email": "ben@npmjs.com"
+  },
+  "bugs": {
+    "url": "https://github.com/yargs/set-blocking/issues"
+  },
+  "dependencies": {},
+  "description": "set blocking stdio and stderr ensuring that terminal output does not truncate",
+  "devDependencies": {
+    "chai": "^3.5.0",
+    "coveralls": "^2.11.9",
+    "mocha": "^2.4.5",
+    "nyc": "^6.4.4",
+    "standard": "^7.0.1",
+    "standard-version": "^2.2.1"
+  },
+  "files": [
+    "index.js",
+    "LICENSE.txt"
+  ],
+  "homepage": "https://github.com/yargs/set-blocking#readme",
+  "keywords": [
+    "flush",
+    "terminal",
+    "blocking",
+    "shim",
+    "stdio",
+    "stderr"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "set-blocking",
+  "optionalDependencies": {},
+  "readme": "# set-blocking\n\n[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking)\n[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking)\n[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master)\n[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)\n\nset blocking `stdio` and `stderr` ensuring that terminal output does not truncate.\n\n```js\nconst setBlocking = require('set-blocking')\nsetBlocking(true)\nconsole.log(someLargeStringToOutput)\n```\n\n## Historical Context/Word of Warning\n\nThis was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on\nnewer versions of Node.js (`0.12+`), truncating terminal output.\n\nYou should be mindful of the side-effects caused by using `set-blocking`:\n\n* if your module sets blocking to `true`, it will effect other modules\n  consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call\n  `setBlocking(true)` once we already know we are about to call `process.exit(code)`.\n* this patch will not apply to subprocesses spawned with `isTTY = true`, this is\n  the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).\n\n## License\n\nISC\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/yargs/set-blocking.git"
+  },
+  "scripts": {
+    "coverage": "nyc report --reporter=text-lcov | coveralls",
+    "pretest": "standard",
+    "test": "nyc mocha ./test/*.js",
+    "version": "standard-version"
+  },
+  "version": "2.0.0"
+}
diff --git a/legacy-libs/grpc/node_modules/signal-exit/CHANGELOG.md b/legacy-libs/grpc/node_modules/signal-exit/CHANGELOG.md
new file mode 100644 (file)
index 0000000..e2f70d2
--- /dev/null
@@ -0,0 +1,27 @@
+# Change Log
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+<a name="3.0.1"></a>
+## [3.0.1](https://github.com/tapjs/signal-exit/compare/v3.0.0...v3.0.1) (2016-09-08)
+
+
+### Bug Fixes
+
+* do not listen on SIGBUS, SIGFPE, SIGSEGV and SIGILL ([#40](https://github.com/tapjs/signal-exit/issues/40)) ([5b105fb](https://github.com/tapjs/signal-exit/commit/5b105fb))
+
+
+
+<a name="3.0.0"></a>
+# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13)
+
+
+### Bug Fixes
+
+* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8))
+* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c))
+
+
+### BREAKING CHANGES
+
+* signal-exit no longer wires into SIGPROF
diff --git a/legacy-libs/grpc/node_modules/signal-exit/LICENSE.txt b/legacy-libs/grpc/node_modules/signal-exit/LICENSE.txt
new file mode 100644 (file)
index 0000000..eead04a
--- /dev/null
@@ -0,0 +1,16 @@
+The ISC License
+
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/signal-exit/README.md b/legacy-libs/grpc/node_modules/signal-exit/README.md
new file mode 100644 (file)
index 0000000..8ebccab
--- /dev/null
@@ -0,0 +1,40 @@
+# signal-exit
+
+[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit)
+[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master)
+[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit)
+[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit)
+[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
+
+When you want to fire an event no matter how a process exits:
+
+* reaching the end of execution.
+* explicitly having `process.exit(code)` called.
+* having `process.kill(pid, sig)` called.
+* receiving a fatal signal from outside the process
+
+Use `signal-exit`.
+
+```js
+var onExit = require('signal-exit')
+
+onExit(function (code, signal) {
+  console.log('process exited!')
+})
+```
+
+## API
+
+`var remove = onExit(function (code, signal) {}, options)`
+
+The return value of the function is a function that will remove the
+handler.
+
+Note that the function *only* fires for signals if the signal would
+cause the proces to exit.  That is, there are no other listeners, and
+it is a fatal signal.
+
+## Options
+
+* `alwaysLast`: Run this handler after any other signal or exit
+  handlers.  This causes `process.emit` to be monkeypatched.
diff --git a/legacy-libs/grpc/node_modules/signal-exit/index.js b/legacy-libs/grpc/node_modules/signal-exit/index.js
new file mode 100644 (file)
index 0000000..7dd8d91
--- /dev/null
@@ -0,0 +1,148 @@
+// Note: since nyc uses this module to output coverage, any lines
+// that are in the direct sync flow of nyc's outputCoverage are
+// ignored, since we can never get coverage for them.
+var assert = require('assert')
+var signals = require('./signals.js')
+
+var EE = require('events')
+/* istanbul ignore if */
+if (typeof EE !== 'function') {
+  EE = EE.EventEmitter
+}
+
+var emitter
+if (process.__signal_exit_emitter__) {
+  emitter = process.__signal_exit_emitter__
+} else {
+  emitter = process.__signal_exit_emitter__ = new EE()
+  emitter.count = 0
+  emitter.emitted = {}
+}
+
+module.exports = function (cb, opts) {
+  assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
+
+  if (loaded === false) {
+    load()
+  }
+
+  var ev = 'exit'
+  if (opts && opts.alwaysLast) {
+    ev = 'afterexit'
+  }
+
+  var remove = function () {
+    emitter.removeListener(ev, cb)
+    if (emitter.listeners('exit').length === 0 &&
+        emitter.listeners('afterexit').length === 0) {
+      unload()
+    }
+  }
+  emitter.on(ev, cb)
+
+  return remove
+}
+
+module.exports.unload = unload
+function unload () {
+  if (!loaded) {
+    return
+  }
+  loaded = false
+
+  signals.forEach(function (sig) {
+    try {
+      process.removeListener(sig, sigListeners[sig])
+    } catch (er) {}
+  })
+  process.emit = originalProcessEmit
+  process.reallyExit = originalProcessReallyExit
+  emitter.count -= 1
+}
+
+function emit (event, code, signal) {
+  if (emitter.emitted[event]) {
+    return
+  }
+  emitter.emitted[event] = true
+  emitter.emit(event, code, signal)
+}
+
+// { <signal>: <listener fn>, ... }
+var sigListeners = {}
+signals.forEach(function (sig) {
+  sigListeners[sig] = function listener () {
+    // If there are no other listeners, an exit is coming!
+    // Simplest way: remove us and then re-send the signal.
+    // We know that this will kill the process, so we can
+    // safely emit now.
+    var listeners = process.listeners(sig)
+    if (listeners.length === emitter.count) {
+      unload()
+      emit('exit', null, sig)
+      /* istanbul ignore next */
+      emit('afterexit', null, sig)
+      /* istanbul ignore next */
+      process.kill(process.pid, sig)
+    }
+  }
+})
+
+module.exports.signals = function () {
+  return signals
+}
+
+module.exports.load = load
+
+var loaded = false
+
+function load () {
+  if (loaded) {
+    return
+  }
+  loaded = true
+
+  // This is the number of onSignalExit's that are in play.
+  // It's important so that we can count the correct number of
+  // listeners on signals, and don't wait for the other one to
+  // handle it instead of us.
+  emitter.count += 1
+
+  signals = signals.filter(function (sig) {
+    try {
+      process.on(sig, sigListeners[sig])
+      return true
+    } catch (er) {
+      return false
+    }
+  })
+
+  process.emit = processEmit
+  process.reallyExit = processReallyExit
+}
+
+var originalProcessReallyExit = process.reallyExit
+function processReallyExit (code) {
+  process.exitCode = code || 0
+  emit('exit', process.exitCode, null)
+  /* istanbul ignore next */
+  emit('afterexit', process.exitCode, null)
+  /* istanbul ignore next */
+  originalProcessReallyExit.call(process, process.exitCode)
+}
+
+var originalProcessEmit = process.emit
+function processEmit (ev, arg) {
+  if (ev === 'exit') {
+    if (arg !== undefined) {
+      process.exitCode = arg
+    }
+    var ret = originalProcessEmit.apply(this, arguments)
+    emit('exit', process.exitCode, null)
+    /* istanbul ignore next */
+    emit('afterexit', process.exitCode, null)
+    return ret
+  } else {
+    return originalProcessEmit.apply(this, arguments)
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/signal-exit/package.json b/legacy-libs/grpc/node_modules/signal-exit/package.json
new file mode 100644 (file)
index 0000000..3ba3818
--- /dev/null
@@ -0,0 +1,71 @@
+{
+  "_from": "signal-exit@^3.0.0",
+  "_id": "signal-exit@3.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-WkyISZK2OnrNm623iUw+6c/MrYE=",
+  "_location": "/grpc/signal-exit",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "signal-exit@^3.0.0",
+    "name": "signal-exit",
+    "escapedName": "signal-exit",
+    "rawSpec": "^3.0.0",
+    "saveSpec": null,
+    "fetchSpec": "^3.0.0"
+  },
+  "_requiredBy": [
+    "/grpc/gauge"
+  ],
+  "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.1.tgz",
+  "_shasum": "5a4c884992b63a7acd9badb7894c3ee9cfccad81",
+  "_shrinkwrap": null,
+  "_spec": "signal-exit@^3.0.0",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/gauge",
+  "author": {
+    "name": "Ben Coe",
+    "email": "ben@npmjs.com"
+  },
+  "bugs": {
+    "url": "https://github.com/tapjs/signal-exit/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "when you want to fire an event no matter how a process exits.",
+  "devDependencies": {
+    "chai": "^3.5.0",
+    "coveralls": "^2.11.10",
+    "nyc": "^8.1.0",
+    "standard": "^7.1.2",
+    "standard-version": "^2.3.0",
+    "tap": "^7.1.0"
+  },
+  "files": [
+    "index.js",
+    "signals.js"
+  ],
+  "homepage": "https://github.com/tapjs/signal-exit",
+  "keywords": [
+    "signal",
+    "exit"
+  ],
+  "license": "ISC",
+  "main": "index.js",
+  "name": "signal-exit",
+  "optionalDependencies": {},
+  "readme": "# signal-exit\n\n[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit)\n[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master)\n[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit)\n[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit)\n[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)\n\nWhen you want to fire an event no matter how a process exits:\n\n* reaching the end of execution.\n* explicitly having `process.exit(code)` called.\n* having `process.kill(pid, sig)` called.\n* receiving a fatal signal from outside the process\n\nUse `signal-exit`.\n\n```js\nvar onExit = require('signal-exit')\n\nonExit(function (code, signal) {\n  console.log('process exited!')\n})\n```\n\n## API\n\n`var remove = onExit(function (code, signal) {}, options)`\n\nThe return value of the function is a function that will remove the\nhandler.\n\nNote that the function *only* fires for signals if the signal would\ncause the proces to exit.  That is, there are no other listeners, and\nit is a fatal signal.\n\n## Options\n\n* `alwaysLast`: Run this handler after any other signal or exit\n  handlers.  This causes `process.emit` to be monkeypatched.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/tapjs/signal-exit.git"
+  },
+  "scripts": {
+    "coverage": "nyc report --reporter=text-lcov | coveralls",
+    "pretest": "standard",
+    "release": "standard-version",
+    "test": "tap --timeout=240 ./test/*.js --cov"
+  },
+  "version": "3.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/signal-exit/signals.js b/legacy-libs/grpc/node_modules/signal-exit/signals.js
new file mode 100644 (file)
index 0000000..3bd67a8
--- /dev/null
@@ -0,0 +1,53 @@
+// This is not the set of all possible signals.
+//
+// It IS, however, the set of all signals that trigger
+// an exit on either Linux or BSD systems.  Linux is a
+// superset of the signal names supported on BSD, and
+// the unknown signals just fail to register, so we can
+// catch that easily enough.
+//
+// Don't bother with SIGKILL.  It's uncatchable, which
+// means that we can't fire any callbacks anyway.
+//
+// If a user does happen to register a handler on a non-
+// fatal signal like SIGWINCH or something, and then
+// exit, it'll end up firing `process.emit('exit')`, so
+// the handler will be fired anyway.
+//
+// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
+// artificially, inherently leave the process in a
+// state from which it is not safe to try and enter JS
+// listeners.
+module.exports = [
+  'SIGABRT',
+  'SIGALRM',
+  'SIGHUP',
+  'SIGINT',
+  'SIGTERM'
+]
+
+if (process.platform !== 'win32') {
+  module.exports.push(
+    'SIGVTALRM',
+    'SIGXCPU',
+    'SIGXFSZ',
+    'SIGUSR2',
+    'SIGTRAP',
+    'SIGSYS',
+    'SIGQUIT',
+    'SIGIOT'
+    // should detect profiler and enable/disable accordingly.
+    // see #21
+    // 'SIGPROF'
+  )
+}
+
+if (process.platform === 'linux') {
+  module.exports.push(
+    'SIGIO',
+    'SIGPOLL',
+    'SIGPWR',
+    'SIGSTKFLT',
+    'SIGUNUSED'
+  )
+}
diff --git a/legacy-libs/grpc/node_modules/string-width/index.js b/legacy-libs/grpc/node_modules/string-width/index.js
new file mode 100644 (file)
index 0000000..b9bec62
--- /dev/null
@@ -0,0 +1,37 @@
+'use strict';
+var stripAnsi = require('strip-ansi');
+var codePointAt = require('code-point-at');
+var isFullwidthCodePoint = require('is-fullwidth-code-point');
+
+// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
+module.exports = function (str) {
+       if (typeof str !== 'string' || str.length === 0) {
+               return 0;
+       }
+
+       var width = 0;
+
+       str = stripAnsi(str);
+
+       for (var i = 0; i < str.length; i++) {
+               var code = codePointAt(str, i);
+
+               // ignore control characters
+               if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
+                       continue;
+               }
+
+               // surrogates
+               if (code >= 0x10000) {
+                       i++;
+               }
+
+               if (isFullwidthCodePoint(code)) {
+                       width += 2;
+               } else {
+                       width++;
+               }
+       }
+
+       return width;
+};
diff --git a/legacy-libs/grpc/node_modules/string-width/license b/legacy-libs/grpc/node_modules/string-width/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/string-width/package.json b/legacy-libs/grpc/node_modules/string-width/package.json
new file mode 100644 (file)
index 0000000..bff8141
--- /dev/null
@@ -0,0 +1,96 @@
+{
+  "_args": [
+    [
+      "string-width@1.0.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "string-width@1.0.2",
+  "_id": "string-width@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
+  "_location": "/grpc/string-width",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "string-width@1.0.2",
+    "name": "string-width",
+    "escapedName": "string-width",
+    "rawSpec": "1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "1.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/gauge",
+    "/grpc/wide-align"
+  ],
+  "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/string-width/issues"
+  },
+  "dependencies": {
+    "code-point-at": "^1.0.0",
+    "is-fullwidth-code-point": "^1.0.0",
+    "strip-ansi": "^3.0.0"
+  },
+  "description": "Get the visual width of a string - the number of columns required to display it",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/string-width#readme",
+  "keywords": [
+    "string",
+    "str",
+    "character",
+    "char",
+    "unicode",
+    "width",
+    "visual",
+    "column",
+    "columns",
+    "fullwidth",
+    "full-width",
+    "full",
+    "ansi",
+    "escape",
+    "codes",
+    "cli",
+    "command-line",
+    "terminal",
+    "console",
+    "cjk",
+    "chinese",
+    "japanese",
+    "korean",
+    "fixed-width"
+  ],
+  "license": "MIT",
+  "name": "string-width",
+  "optionalDependencies": {},
+  "readme": "# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width)\n\n> Get the visual width of a string - the number of columns required to display it\n\nSome Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.\n\nUseful to be able to measure the actual width of command-line output.\n\n\n## Install\n\n```\n$ npm install --save string-width\n```\n\n\n## Usage\n\n```js\nconst stringWidth = require('string-width');\n\nstringWidth('古');\n//=> 2\n\nstringWidth('\\u001b[1m古\\u001b[22m');\n//=> 2\n\nstringWidth('a');\n//=> 1\n```\n\n\n## Related\n\n- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module\n- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string\n- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/string-width.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc/node_modules/string-width/readme.md b/legacy-libs/grpc/node_modules/string-width/readme.md
new file mode 100644 (file)
index 0000000..1ab42c9
--- /dev/null
@@ -0,0 +1,42 @@
+# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width)
+
+> Get the visual width of a string - the number of columns required to display it
+
+Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
+
+Useful to be able to measure the actual width of command-line output.
+
+
+## Install
+
+```
+$ npm install --save string-width
+```
+
+
+## Usage
+
+```js
+const stringWidth = require('string-width');
+
+stringWidth('古');
+//=> 2
+
+stringWidth('\u001b[1m古\u001b[22m');
+//=> 2
+
+stringWidth('a');
+//=> 1
+```
+
+
+## Related
+
+- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
+- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
+- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/string_decoder/LICENSE b/legacy-libs/grpc/node_modules/string_decoder/LICENSE
new file mode 100644 (file)
index 0000000..778edb2
--- /dev/null
@@ -0,0 +1,48 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
diff --git a/legacy-libs/grpc/node_modules/string_decoder/README.md b/legacy-libs/grpc/node_modules/string_decoder/README.md
new file mode 100644 (file)
index 0000000..5fd5831
--- /dev/null
@@ -0,0 +1,47 @@
+# string_decoder
+
+***Node-core v8.9.4 string_decoder for userland***
+
+
+[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)
+[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)
+
+
+```bash
+npm install --save string_decoder
+```
+
+***Node-core string_decoder for userland***
+
+This package is a mirror of the string_decoder implementation in Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
+
+As of version 1.0.0 **string_decoder** uses semantic versioning.
+
+## Previous versions
+
+Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
+
+## Update
+
+The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
+
+## Streams Working Group
+
+`string_decoder` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+  project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+  notice of changes.
+
+See [readable-stream](https://github.com/nodejs/readable-stream) for
+more details.
diff --git a/legacy-libs/grpc/node_modules/string_decoder/lib/string_decoder.js b/legacy-libs/grpc/node_modules/string_decoder/lib/string_decoder.js
new file mode 100644 (file)
index 0000000..2e89e63
--- /dev/null
@@ -0,0 +1,296 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/*<replacement>*/
+
+var Buffer = require('safe-buffer').Buffer;
+/*</replacement>*/
+
+var isEncoding = Buffer.isEncoding || function (encoding) {
+  encoding = '' + encoding;
+  switch (encoding && encoding.toLowerCase()) {
+    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
+      return true;
+    default:
+      return false;
+  }
+};
+
+function _normalizeEncoding(enc) {
+  if (!enc) return 'utf8';
+  var retried;
+  while (true) {
+    switch (enc) {
+      case 'utf8':
+      case 'utf-8':
+        return 'utf8';
+      case 'ucs2':
+      case 'ucs-2':
+      case 'utf16le':
+      case 'utf-16le':
+        return 'utf16le';
+      case 'latin1':
+      case 'binary':
+        return 'latin1';
+      case 'base64':
+      case 'ascii':
+      case 'hex':
+        return enc;
+      default:
+        if (retried) return; // undefined
+        enc = ('' + enc).toLowerCase();
+        retried = true;
+    }
+  }
+};
+
+// Do not cache `Buffer.isEncoding` when checking encoding names as some
+// modules monkey-patch it to support additional encodings
+function normalizeEncoding(enc) {
+  var nenc = _normalizeEncoding(enc);
+  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
+  return nenc || enc;
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters.
+exports.StringDecoder = StringDecoder;
+function StringDecoder(encoding) {
+  this.encoding = normalizeEncoding(encoding);
+  var nb;
+  switch (this.encoding) {
+    case 'utf16le':
+      this.text = utf16Text;
+      this.end = utf16End;
+      nb = 4;
+      break;
+    case 'utf8':
+      this.fillLast = utf8FillLast;
+      nb = 4;
+      break;
+    case 'base64':
+      this.text = base64Text;
+      this.end = base64End;
+      nb = 3;
+      break;
+    default:
+      this.write = simpleWrite;
+      this.end = simpleEnd;
+      return;
+  }
+  this.lastNeed = 0;
+  this.lastTotal = 0;
+  this.lastChar = Buffer.allocUnsafe(nb);
+}
+
+StringDecoder.prototype.write = function (buf) {
+  if (buf.length === 0) return '';
+  var r;
+  var i;
+  if (this.lastNeed) {
+    r = this.fillLast(buf);
+    if (r === undefined) return '';
+    i = this.lastNeed;
+    this.lastNeed = 0;
+  } else {
+    i = 0;
+  }
+  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
+  return r || '';
+};
+
+StringDecoder.prototype.end = utf8End;
+
+// Returns only complete characters in a Buffer
+StringDecoder.prototype.text = utf8Text;
+
+// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
+StringDecoder.prototype.fillLast = function (buf) {
+  if (this.lastNeed <= buf.length) {
+    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
+    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+  }
+  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
+  this.lastNeed -= buf.length;
+};
+
+// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
+// continuation byte. If an invalid byte is detected, -2 is returned.
+function utf8CheckByte(byte) {
+  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
+  return byte >> 6 === 0x02 ? -1 : -2;
+}
+
+// Checks at most 3 bytes at the end of a Buffer in order to detect an
+// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
+// needed to complete the UTF-8 character (if applicable) are returned.
+function utf8CheckIncomplete(self, buf, i) {
+  var j = buf.length - 1;
+  if (j < i) return 0;
+  var nb = utf8CheckByte(buf[j]);
+  if (nb >= 0) {
+    if (nb > 0) self.lastNeed = nb - 1;
+    return nb;
+  }
+  if (--j < i || nb === -2) return 0;
+  nb = utf8CheckByte(buf[j]);
+  if (nb >= 0) {
+    if (nb > 0) self.lastNeed = nb - 2;
+    return nb;
+  }
+  if (--j < i || nb === -2) return 0;
+  nb = utf8CheckByte(buf[j]);
+  if (nb >= 0) {
+    if (nb > 0) {
+      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
+    }
+    return nb;
+  }
+  return 0;
+}
+
+// Validates as many continuation bytes for a multi-byte UTF-8 character as
+// needed or are available. If we see a non-continuation byte where we expect
+// one, we "replace" the validated continuation bytes we've seen so far with
+// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
+// behavior. The continuation byte check is included three times in the case
+// where all of the continuation bytes for a character exist in the same buffer.
+// It is also done this way as a slight performance increase instead of using a
+// loop.
+function utf8CheckExtraBytes(self, buf, p) {
+  if ((buf[0] & 0xC0) !== 0x80) {
+    self.lastNeed = 0;
+    return '\ufffd';
+  }
+  if (self.lastNeed > 1 && buf.length > 1) {
+    if ((buf[1] & 0xC0) !== 0x80) {
+      self.lastNeed = 1;
+      return '\ufffd';
+    }
+    if (self.lastNeed > 2 && buf.length > 2) {
+      if ((buf[2] & 0xC0) !== 0x80) {
+        self.lastNeed = 2;
+        return '\ufffd';
+      }
+    }
+  }
+}
+
+// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
+function utf8FillLast(buf) {
+  var p = this.lastTotal - this.lastNeed;
+  var r = utf8CheckExtraBytes(this, buf, p);
+  if (r !== undefined) return r;
+  if (this.lastNeed <= buf.length) {
+    buf.copy(this.lastChar, p, 0, this.lastNeed);
+    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+  }
+  buf.copy(this.lastChar, p, 0, buf.length);
+  this.lastNeed -= buf.length;
+}
+
+// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
+// partial character, the character's bytes are buffered until the required
+// number of bytes are available.
+function utf8Text(buf, i) {
+  var total = utf8CheckIncomplete(this, buf, i);
+  if (!this.lastNeed) return buf.toString('utf8', i);
+  this.lastTotal = total;
+  var end = buf.length - (total - this.lastNeed);
+  buf.copy(this.lastChar, 0, end);
+  return buf.toString('utf8', i, end);
+}
+
+// For UTF-8, a replacement character is added when ending on a partial
+// character.
+function utf8End(buf) {
+  var r = buf && buf.length ? this.write(buf) : '';
+  if (this.lastNeed) return r + '\ufffd';
+  return r;
+}
+
+// UTF-16LE typically needs two bytes per character, but even if we have an even
+// number of bytes available, we need to check if we end on a leading/high
+// surrogate. In that case, we need to wait for the next two bytes in order to
+// decode the last character properly.
+function utf16Text(buf, i) {
+  if ((buf.length - i) % 2 === 0) {
+    var r = buf.toString('utf16le', i);
+    if (r) {
+      var c = r.charCodeAt(r.length - 1);
+      if (c >= 0xD800 && c <= 0xDBFF) {
+        this.lastNeed = 2;
+        this.lastTotal = 4;
+        this.lastChar[0] = buf[buf.length - 2];
+        this.lastChar[1] = buf[buf.length - 1];
+        return r.slice(0, -1);
+      }
+    }
+    return r;
+  }
+  this.lastNeed = 1;
+  this.lastTotal = 2;
+  this.lastChar[0] = buf[buf.length - 1];
+  return buf.toString('utf16le', i, buf.length - 1);
+}
+
+// For UTF-16LE we do not explicitly append special replacement characters if we
+// end on a partial character, we simply let v8 handle that.
+function utf16End(buf) {
+  var r = buf && buf.length ? this.write(buf) : '';
+  if (this.lastNeed) {
+    var end = this.lastTotal - this.lastNeed;
+    return r + this.lastChar.toString('utf16le', 0, end);
+  }
+  return r;
+}
+
+function base64Text(buf, i) {
+  var n = (buf.length - i) % 3;
+  if (n === 0) return buf.toString('base64', i);
+  this.lastNeed = 3 - n;
+  this.lastTotal = 3;
+  if (n === 1) {
+    this.lastChar[0] = buf[buf.length - 1];
+  } else {
+    this.lastChar[0] = buf[buf.length - 2];
+    this.lastChar[1] = buf[buf.length - 1];
+  }
+  return buf.toString('base64', i, buf.length - n);
+}
+
+function base64End(buf) {
+  var r = buf && buf.length ? this.write(buf) : '';
+  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
+  return r;
+}
+
+// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
+function simpleWrite(buf) {
+  return buf.toString(this.encoding);
+}
+
+function simpleEnd(buf) {
+  return buf && buf.length ? this.write(buf) : '';
+}
\ No newline at end of file
diff --git a/legacy-libs/grpc/node_modules/string_decoder/package.json b/legacy-libs/grpc/node_modules/string_decoder/package.json
new file mode 100644 (file)
index 0000000..7ca48cb
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_args": [
+    [
+      "string_decoder@1.1.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "string_decoder@1.1.1",
+  "_id": "string_decoder@1.1.1",
+  "_inBundle": false,
+  "_integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+  "_location": "/grpc/string_decoder",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "string_decoder@1.1.1",
+    "name": "string_decoder",
+    "escapedName": "string_decoder",
+    "rawSpec": "1.1.1",
+    "saveSpec": null,
+    "fetchSpec": "1.1.1"
+  },
+  "_requiredBy": [
+    "/grpc/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "bugs": {
+    "url": "https://github.com/nodejs/string_decoder/issues"
+  },
+  "dependencies": {
+    "safe-buffer": "~5.1.0"
+  },
+  "description": "The string_decoder module from Node core",
+  "devDependencies": {
+    "babel-polyfill": "^6.23.0",
+    "core-util-is": "^1.0.2",
+    "inherits": "^2.0.3",
+    "tap": "~0.4.8"
+  },
+  "homepage": "https://github.com/nodejs/string_decoder",
+  "keywords": [
+    "string",
+    "decoder",
+    "browser",
+    "browserify"
+  ],
+  "license": "MIT",
+  "main": "lib/string_decoder.js",
+  "name": "string_decoder",
+  "optionalDependencies": {},
+  "readme": "# string_decoder\n\n***Node-core v8.9.4 string_decoder for userland***\n\n\n[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)\n[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)\n\n\n```bash\nnpm install --save string_decoder\n```\n\n***Node-core string_decoder for userland***\n\nThis package is a mirror of the string_decoder implementation in Node-core.\n\nFull documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).\n\nAs of version 1.0.0 **string_decoder** uses semantic versioning.\n\n## Previous versions\n\nPrevious version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.\n\n## Update\n\nThe *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.\n\n## Streams Working Group\n\n`string_decoder` is maintained by the Streams Working Group, which\noversees the development and maintenance of the Streams API within\nNode.js. The responsibilities of the Streams Working Group include:\n\n* Addressing stream issues on the Node.js issue tracker.\n* Authoring and editing stream documentation within the Node.js project.\n* Reviewing changes to stream subclasses within the Node.js project.\n* Redirecting changes to streams from the Node.js project to this\n  project.\n* Assisting in the implementation of stream providers within Node.js.\n* Recommending versions of `readable-stream` to be included in Node.js.\n* Messaging about the future of streams to give the community advance\n  notice of changes.\n\nSee [readable-stream](https://github.com/nodejs/readable-stream) for\nmore details.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nodejs/string_decoder.git"
+  },
+  "scripts": {
+    "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+    "test": "tap test/parallel/*.js && node test/verify-dependencies"
+  },
+  "version": "1.1.1"
+}
diff --git a/legacy-libs/grpc/node_modules/strip-ansi/index.js b/legacy-libs/grpc/node_modules/strip-ansi/index.js
new file mode 100644 (file)
index 0000000..099480f
--- /dev/null
@@ -0,0 +1,6 @@
+'use strict';
+var ansiRegex = require('ansi-regex')();
+
+module.exports = function (str) {
+       return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
+};
diff --git a/legacy-libs/grpc/node_modules/strip-ansi/license b/legacy-libs/grpc/node_modules/strip-ansi/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/strip-ansi/package.json b/legacy-libs/grpc/node_modules/strip-ansi/package.json
new file mode 100644 (file)
index 0000000..6747da8
--- /dev/null
@@ -0,0 +1,109 @@
+{
+  "_args": [
+    [
+      "strip-ansi@3.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "strip-ansi@3.0.1",
+  "_id": "strip-ansi@3.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+  "_location": "/grpc/strip-ansi",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "strip-ansi@3.0.1",
+    "name": "strip-ansi",
+    "escapedName": "strip-ansi",
+    "rawSpec": "3.0.1",
+    "saveSpec": null,
+    "fetchSpec": "3.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/gauge",
+    "/grpc/string-width"
+  ],
+  "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "3.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/chalk/strip-ansi/issues"
+  },
+  "dependencies": {
+    "ansi-regex": "^2.0.0"
+  },
+  "description": "Strip ANSI escape codes",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/chalk/strip-ansi#readme",
+  "keywords": [
+    "strip",
+    "trim",
+    "remove",
+    "ansi",
+    "styles",
+    "color",
+    "colour",
+    "colors",
+    "terminal",
+    "console",
+    "string",
+    "tty",
+    "escape",
+    "formatting",
+    "rgb",
+    "256",
+    "shell",
+    "xterm",
+    "log",
+    "logging",
+    "command-line",
+    "text"
+  ],
+  "license": "MIT",
+  "maintainers": [
+    {
+      "name": "Sindre Sorhus",
+      "email": "sindresorhus@gmail.com",
+      "url": "sindresorhus.com"
+    },
+    {
+      "name": "Joshua Boy Nicolai Appelman",
+      "email": "joshua@jbna.nl",
+      "url": "jbna.nl"
+    },
+    {
+      "name": "JD Ballard",
+      "email": "i.am.qix@gmail.com",
+      "url": "github.com/qix-"
+    }
+  ],
+  "name": "strip-ansi",
+  "optionalDependencies": {},
+  "readme": "# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)\n\n> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save strip-ansi\n```\n\n\n## Usage\n\n```js\nvar stripAnsi = require('strip-ansi');\n\nstripAnsi('\\u001b[4mcake\\u001b[0m');\n//=> 'cake'\n```\n\n\n## Related\n\n- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module\n- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes\n- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/chalk/strip-ansi.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "3.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/strip-ansi/readme.md b/legacy-libs/grpc/node_modules/strip-ansi/readme.md
new file mode 100644 (file)
index 0000000..cb7d9ff
--- /dev/null
@@ -0,0 +1,33 @@
+# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
+
+> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```
+$ npm install --save strip-ansi
+```
+
+
+## Usage
+
+```js
+var stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001b[4mcake\u001b[0m');
+//=> 'cake'
+```
+
+
+## Related
+
+- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
+- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
+- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/strip-json-comments/index.js b/legacy-libs/grpc/node_modules/strip-json-comments/index.js
new file mode 100644 (file)
index 0000000..4e6576e
--- /dev/null
@@ -0,0 +1,70 @@
+'use strict';
+var singleComment = 1;
+var multiComment = 2;
+
+function stripWithoutWhitespace() {
+       return '';
+}
+
+function stripWithWhitespace(str, start, end) {
+       return str.slice(start, end).replace(/\S/g, ' ');
+}
+
+module.exports = function (str, opts) {
+       opts = opts || {};
+
+       var currentChar;
+       var nextChar;
+       var insideString = false;
+       var insideComment = false;
+       var offset = 0;
+       var ret = '';
+       var strip = opts.whitespace === false ? stripWithoutWhitespace : stripWithWhitespace;
+
+       for (var i = 0; i < str.length; i++) {
+               currentChar = str[i];
+               nextChar = str[i + 1];
+
+               if (!insideComment && currentChar === '"') {
+                       var escaped = str[i - 1] === '\\' && str[i - 2] !== '\\';
+                       if (!escaped) {
+                               insideString = !insideString;
+                       }
+               }
+
+               if (insideString) {
+                       continue;
+               }
+
+               if (!insideComment && currentChar + nextChar === '//') {
+                       ret += str.slice(offset, i);
+                       offset = i;
+                       insideComment = singleComment;
+                       i++;
+               } else if (insideComment === singleComment && currentChar + nextChar === '\r\n') {
+                       i++;
+                       insideComment = false;
+                       ret += strip(str, offset, i);
+                       offset = i;
+                       continue;
+               } else if (insideComment === singleComment && currentChar === '\n') {
+                       insideComment = false;
+                       ret += strip(str, offset, i);
+                       offset = i;
+               } else if (!insideComment && currentChar + nextChar === '/*') {
+                       ret += str.slice(offset, i);
+                       offset = i;
+                       insideComment = multiComment;
+                       i++;
+                       continue;
+               } else if (insideComment === multiComment && currentChar + nextChar === '*/') {
+                       i++;
+                       insideComment = false;
+                       ret += strip(str, offset, i + 1);
+                       offset = i + 1;
+                       continue;
+               }
+       }
+
+       return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
+};
diff --git a/legacy-libs/grpc/node_modules/strip-json-comments/license b/legacy-libs/grpc/node_modules/strip-json-comments/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/strip-json-comments/package.json b/legacy-libs/grpc/node_modules/strip-json-comments/package.json
new file mode 100644 (file)
index 0000000..7eb39a9
--- /dev/null
@@ -0,0 +1,82 @@
+{
+  "_args": [
+    [
+      "strip-json-comments@2.0.1",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "strip-json-comments@2.0.1",
+  "_id": "strip-json-comments@2.0.1",
+  "_inBundle": false,
+  "_integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
+  "_location": "/grpc/strip-json-comments",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "strip-json-comments@2.0.1",
+    "name": "strip-json-comments",
+    "escapedName": "strip-json-comments",
+    "rawSpec": "2.0.1",
+    "saveSpec": null,
+    "fetchSpec": "2.0.1"
+  },
+  "_requiredBy": [
+    "/grpc/rc"
+  ],
+  "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+  "_shrinkwrap": null,
+  "_spec": "2.0.1",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "bugs": {
+    "url": "https://github.com/sindresorhus/strip-json-comments/issues"
+  },
+  "dependencies": {},
+  "description": "Strip comments from JSON. Lets you use comments in your JSON files!",
+  "devDependencies": {
+    "ava": "*",
+    "xo": "*"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "files": [
+    "index.js"
+  ],
+  "homepage": "https://github.com/sindresorhus/strip-json-comments#readme",
+  "keywords": [
+    "json",
+    "strip",
+    "remove",
+    "delete",
+    "trim",
+    "comments",
+    "multiline",
+    "parse",
+    "config",
+    "configuration",
+    "conf",
+    "settings",
+    "util",
+    "env",
+    "environment"
+  ],
+  "license": "MIT",
+  "name": "strip-json-comments",
+  "optionalDependencies": {},
+  "readme": "# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments)\n\n> Strip comments from JSON. Lets you use comments in your JSON files!\n\nThis is now possible:\n\n```js\n{\n\t// rainbows\n\t\"unicorn\": /* ❤ */ \"cake\"\n}\n```\n\nIt will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.\n\nAlso available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.\n\n\n## Install\n\n```\n$ npm install --save strip-json-comments\n```\n\n\n## Usage\n\n```js\nconst json = '{/*rainbows*/\"unicorn\":\"cake\"}';\n\nJSON.parse(stripJsonComments(json));\n//=> {unicorn: 'cake'}\n```\n\n\n## API\n\n### stripJsonComments(input, [options])\n\n#### input\n\nType: `string`\n\nAccepts a string with JSON and returns a string without comments.\n\n#### options\n\n##### whitespace\n\nType: `boolean`  \nDefault: `true`\n\nReplace comments with whitespace instead of stripping them entirely.\n\n\n## Related\n\n- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module\n- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
+  "readmeFilename": "readme.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/strip-json-comments.git"
+  },
+  "scripts": {
+    "test": "xo && ava"
+  },
+  "version": "2.0.1"
+}
diff --git a/legacy-libs/grpc/node_modules/strip-json-comments/readme.md b/legacy-libs/grpc/node_modules/strip-json-comments/readme.md
new file mode 100644 (file)
index 0000000..0ee58df
--- /dev/null
@@ -0,0 +1,64 @@
+# strip-json-comments [![Build Status](https://travis-ci.org/sindresorhus/strip-json-comments.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-json-comments)
+
+> Strip comments from JSON. Lets you use comments in your JSON files!
+
+This is now possible:
+
+```js
+{
+       // rainbows
+       "unicorn": /* ❤ */ "cake"
+}
+```
+
+It will replace single-line comments `//` and multi-line comments `/**/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
+
+Also available as a [gulp](https://github.com/sindresorhus/gulp-strip-json-comments)/[grunt](https://github.com/sindresorhus/grunt-strip-json-comments)/[broccoli](https://github.com/sindresorhus/broccoli-strip-json-comments) plugin.
+
+
+## Install
+
+```
+$ npm install --save strip-json-comments
+```
+
+
+## Usage
+
+```js
+const json = '{/*rainbows*/"unicorn":"cake"}';
+
+JSON.parse(stripJsonComments(json));
+//=> {unicorn: 'cake'}
+```
+
+
+## API
+
+### stripJsonComments(input, [options])
+
+#### input
+
+Type: `string`
+
+Accepts a string with JSON and returns a string without comments.
+
+#### options
+
+##### whitespace
+
+Type: `boolean`  
+Default: `true`
+
+Replace comments with whitespace instead of stripping them entirely.
+
+
+## Related
+
+- [strip-json-comments-cli](https://github.com/sindresorhus/strip-json-comments-cli) - CLI for this module
+- [strip-css-comments](https://github.com/sindresorhus/strip-css-comments) - Strip comments from CSS
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/legacy-libs/grpc/node_modules/tar/LICENSE b/legacy-libs/grpc/node_modules/tar/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/tar/README.md b/legacy-libs/grpc/node_modules/tar/README.md
new file mode 100644 (file)
index 0000000..034e486
--- /dev/null
@@ -0,0 +1,954 @@
+# node-tar
+
+[![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar)
+
+[Fast](./benchmarks) and full-featured Tar for Node.js
+
+The API is designed to mimic the behavior of `tar(1)` on unix systems.
+If you are familiar with how tar works, most of this will hopefully be
+straightforward for you.  If not, then hopefully this module can teach
+you useful unix skills that may come in handy someday :)
+
+## Background
+
+A "tar file" or "tarball" is an archive of file system entries
+(directories, files, links, etc.)  The name comes from "tape archive".
+If you run `man tar` on almost any Unix command line, you'll learn
+quite a bit about what it can do, and its history.
+
+Tar has 5 main top-level commands:
+
+* `c` Create an archive
+* `r` Replace entries within an archive
+* `u` Update entries within an archive (ie, replace if they're newer)
+* `t` List out the contents of an archive
+* `x` Extract an archive to disk
+
+The other flags and options modify how this top level function works.
+
+## High-Level API
+
+These 5 functions are the high-level API.  All of them have a
+single-character name (for unix nerds familiar with `tar(1)`) as well
+as a long name (for everyone else).
+
+All the high-level functions take the following arguments, all three
+of which are optional and may be omitted.
+
+1. `options` - An optional object specifying various options
+2. `paths` - An array of paths to add or extract
+3. `callback` - Called when the command is completed, if async.  (If
+   sync or no file specified, providing a callback throws a
+   `TypeError`.)
+
+If the command is sync (ie, if `options.sync=true`), then the
+callback is not allowed, since the action will be completed immediately.
+
+If a `file` argument is specified, and the command is async, then a
+`Promise` is returned.  In this case, if async, a callback may be
+provided which is called when the command is completed.
+
+If a `file` option is not specified, then a stream is returned.  For
+`create`, this is a readable stream of the generated archive.  For
+`list` and `extract` this is a writable stream that an archive should
+be written into.  If a file is not specified, then a callback is not
+allowed, because you're already getting a stream to work with.
+
+`replace` and `update` only work on existing archives, and so require
+a `file` argument.
+
+Sync commands without a file argument return a stream that acts on its
+input immediately in the same tick.  For readable streams, this means
+that all of the data is immediately available by calling
+`stream.read()`.  For writable streams, it will be acted upon as soon
+as it is provided, but this can be at any time.
+
+### Warnings
+
+Some things cause tar to emit a warning, but should usually not cause
+the entire operation to fail.  There are three ways to handle
+warnings:
+
+1. **Ignore them** (default) Invalid entries won't be put in the
+   archive, and invalid entries won't be unpacked.  This is usually
+   fine, but can hide failures that you might care about.
+2. **Notice them**  Add an `onwarn` function to the options, or listen
+   to the `'warn'` event on any tar stream.  The function will get
+   called as `onwarn(message, data)`.  Handle as appropriate.
+3. **Explode them.**  Set `strict: true` in the options object, and
+   `warn` messages will be emitted as `'error'` events instead.  If
+   there's no `error` handler, this causes the program to crash.  If
+   used with a promise-returning/callback-taking method, then it'll
+   send the error to the promise/callback.
+
+### Examples
+
+The API mimics the `tar(1)` command line functionality, with aliases
+for more human-readable option and function names.  The goal is that
+if you know how to use `tar(1)` in Unix, then you know how to use
+`require('tar')` in JavaScript.
+
+To replicate `tar czf my-tarball.tgz files and folders`, you'd do:
+
+```js
+tar.c(
+  {
+    gzip: <true|gzip options>,
+    file: 'my-tarball.tgz'
+  },
+  ['some', 'files', 'and', 'folders']
+).then(_ => { .. tarball has been created .. })
+```
+
+To replicate `tar cz files and folders > my-tarball.tgz`, you'd do:
+
+```js
+tar.c( // or tar.create
+  {
+    gzip: <true|gzip options>
+  },
+  ['some', 'files', 'and', 'folders']
+).pipe(fs.createWriteStream('my-tarball.tgz'))
+```
+
+To replicate `tar xf my-tarball.tgz` you'd do:
+
+```js
+tar.x(  // or tar.extract(
+  {
+    file: 'my-tarball.tgz'
+  }
+).then(_=> { .. tarball has been dumped in cwd .. })
+```
+
+To replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`:
+
+```js
+fs.createReadStream('my-tarball.tgz').pipe(
+  tar.x({
+    strip: 1,
+    C: 'some-dir' // alias for cwd:'some-dir', also ok
+  })
+)
+```
+
+To replicate `tar tf my-tarball.tgz`, do this:
+
+```js
+tar.t({
+  file: 'my-tarball.tgz',
+  onentry: entry => { .. do whatever with it .. }
+})
+```
+
+To replicate `cat my-tarball.tgz | tar t` do:
+
+```js
+fs.createReadStream('my-tarball.tgz')
+  .pipe(tar.t())
+  .on('entry', entry => { .. do whatever with it .. })
+```
+
+To do anything synchronous, add `sync: true` to the options.  Note
+that sync functions don't take a callback and don't return a promise.
+When the function returns, it's already done.  Sync methods without a
+file argument return a sync stream, which flushes immediately.  But,
+of course, it still won't be done until you `.end()` it.
+
+To filter entries, add `filter: <function>` to the options.
+Tar-creating methods call the filter with `filter(path, stat)`.
+Tar-reading methods (including extraction) call the filter with
+`filter(path, entry)`.  The filter is called in the `this`-context of
+the `Pack` or `Unpack` stream object.
+
+The arguments list to `tar t` and `tar x` specify a list of filenames
+to extract or list, so they're equivalent to a filter that tests if
+the file is in the list.
+
+For those who _aren't_ fans of tar's single-character command names:
+
+```
+tar.c === tar.create
+tar.r === tar.replace (appends to archive, file is required)
+tar.u === tar.update (appends if newer, file is required)
+tar.x === tar.extract
+tar.t === tar.list
+```
+
+Keep reading for all the command descriptions and options, as well as
+the low-level API that they are built on.
+
+### tar.c(options, fileList, callback) [alias: tar.create]
+
+Create a tarball archive.
+
+The `fileList` is an array of paths to add to the tarball.  Adding a
+directory also adds its children recursively.
+
+An entry in `fileList` that starts with an `@` symbol is a tar archive
+whose entries will be added.  To add a file that starts with `@`,
+prepend it with `./`.
+
+The following options are supported:
+
+- `file` Write the tarball archive to the specified filename.  If this
+  is specified, then the callback will be fired when the file has been
+  written, and a promise will be returned that resolves when the file
+  is written.  If a filename is not specified, then a Readable Stream
+  will be returned which will emit the file data. [Alias: `f`]
+- `sync` Act synchronously.  If this is set, then any provided file
+  will be fully written after the call to `tar.c`.  If this is set,
+  and a file is not provided, then the resulting stream will already
+  have the data ready to `read` or `emit('data')` as soon as you
+  request it.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `cwd` The current working directory for creating the archive.
+  Defaults to `process.cwd()`.  [Alias: `C`]
+- `prefix` A path portion to prefix onto the entries in the archive.
+- `gzip` Set to any truthy value to create a gzipped archive, or an
+  object with settings for `zlib.Gzip()` [Alias: `z`]
+- `filter` A function that gets called with `(path, stat)` for each
+  entry being added.  Return `true` to add the entry to the archive,
+  or `false` to omit it.
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths. [Alias: `P`]
+- `mode` The mode to set on the created file archive
+- `noDirRecurse` Do not recursively archive the contents of
+  directories. [Alias: `n`]
+- `follow` Set to true to pack the targets of symbolic links.  Without
+  this option, symbolic links are archived as such. [Alias: `L`, `h`]
+- `noPax` Suppress pax extended headers.  Note that this means that
+  long paths and linkpaths will be truncated, and large or negative
+  numeric values may be interpreted incorrectly.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+  [Alias: `m`, `no-mtime`]
+- `mtime` Set to a `Date` object to force a specific `mtime` for
+  everything added to the archive.  Overridden by `noMtime`.
+
+
+The following options are mostly internal, but can be modified in some
+advanced use cases, such as re-using caches between runs.
+
+- `linkCache` A Map object containing the device and inode value for
+  any file whose nlink is > 1, to identify hard links.
+- `statCache` A Map object that caches calls `lstat`.
+- `readdirCache` A Map object that caches calls to `readdir`.
+- `jobs` A number specifying how many concurrent jobs to run.
+  Defaults to 4.
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 16 MB.
+
+### tar.x(options, fileList, callback) [alias: tar.extract]
+
+Extract a tarball archive.
+
+The `fileList` is an array of paths to extract from the tarball.  If
+no paths are provided, then all the entries are extracted.
+
+If the archive is gzipped, then tar will detect this and unzip it.
+
+Note that all directories that are created will be forced to be
+writable, readable, and listable by their owner, to avoid cases where
+a directory prevents extraction of child entries by virtue of its
+mode.
+
+Most extraction errors will cause a `warn` event to be emitted.  If
+the `cwd` is missing, or not a directory, then the extraction will
+fail completely.
+
+The following options are supported:
+
+- `cwd` Extract files relative to the specified directory.  Defaults
+  to `process.cwd()`.  If provided, this must exist and must be a
+  directory. [Alias: `C`]
+- `file` The archive file to extract.  If not specified, then a
+  Writable stream is returned where the archive data should be
+  written. [Alias: `f`]
+- `sync` Create files and directories synchronously.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `filter` A function that gets called with `(path, entry)` for each
+  entry being unpacked.  Return `true` to unpack the entry from the
+  archive, or `false` to skip it.
+- `newer` Set to true to keep the existing file on disk if it's newer
+  than the file in the archive. [Alias: `keep-newer`,
+  `keep-newer-files`]
+- `keep` Do not overwrite existing files.  In particular, if a file
+  appears more than once in an archive, later copies will not
+  overwrite earlier copies. [Alias: `k`, `keep-existing`]
+- `preservePaths` Allow absolute paths, paths containing `..`, and
+  extracting through symbolic links.  By default, `/` is stripped from
+  absolute paths, `..` paths are not extracted, and any file whose
+  location would be modified by a symbolic link is not extracted.
+  [Alias: `P`]
+- `unlink` Unlink files before creating them.  Without this option,
+  tar overwrites existing files, which preserves existing hardlinks.
+  With this option, existing hardlinks will be broken, as will any
+  symlink that would affect the location of an extracted file. [Alias:
+  `U`]
+- `strip` Remove the specified number of leading path elements.
+  Pathnames with fewer elements will be silently skipped.  Note that
+  the pathname is edited after applying the filter, but before
+  security checks. [Alias: `strip-components`, `stripComponents`]
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `preserveOwner` If true, tar will set the `uid` and `gid` of
+  extracted entries to the `uid` and `gid` fields in the archive.
+  This defaults to true when run as root, and false otherwise.  If
+  false, then files and directories will be set with the owner and
+  group of the user running the process.  This is similar to `-p` in
+  `tar(1)`, but ACLs and other system-specific data is never unpacked
+  in this implementation, and modes are set by default already.
+  [Alias: `p`]
+- `uid` Set to a number to force ownership of all extracted files and
+  folders, and all implicitly created directories, to be owned by the
+  specified user id, regardless of the `uid` field in the archive.
+  Cannot be used along with `preserveOwner`.  Requires also setting a
+  `gid` option.
+- `gid` Set to a number to force ownership of all extracted files and
+  folders, and all implicitly created directories, to be owned by the
+  specified group id, regardless of the `gid` field in the archive.
+  Cannot be used along with `preserveOwner`.  Requires also setting a
+  `uid` option.
+- `noMtime` Set to true to omit writing `mtime` value for extracted
+  entries. [Alias: `m`, `no-mtime`]
+- `transform` Provide a function that takes an `entry` object, and
+  returns a stream, or any falsey value.  If a stream is provided,
+  then that stream's data will be written instead of the contents of
+  the archive entry.  If a falsey value is provided, then the entry is
+  written to disk as normal.  (To exclude items from extraction, use
+  the `filter` option described above.)
+- `onentry` A function that gets called with `(entry)` for each entry
+  that passes the filter.
+
+The following options are mostly internal, but can be modified in some
+advanced use cases, such as re-using caches between runs.
+
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 16 MB.
+- `umask` Filter the modes of entries like `process.umask()`.
+- `dmode` Default mode for directories
+- `fmode` Default mode for files
+- `dirCache` A Map object of which directories exist.
+- `maxMetaEntrySize` The maximum size of meta entries that is
+  supported.  Defaults to 1 MB.
+
+Note that using an asynchronous stream type with the `transform`
+option will cause undefined behavior in sync extractions.
+[MiniPass](http://npm.im/minipass)-based streams are designed for this
+use case.
+
+### tar.t(options, fileList, callback) [alias: tar.list]
+
+List the contents of a tarball archive.
+
+The `fileList` is an array of paths to list from the tarball.  If
+no paths are provided, then all the entries are listed.
+
+If the archive is gzipped, then tar will detect this and unzip it.
+
+Returns an event emitter that emits `entry` events with
+`tar.ReadEntry` objects.  However, they don't emit `'data'` or `'end'`
+events.  (If you want to get actual readable entries, use the
+`tar.Parse` class instead.)
+
+The following options are supported:
+
+- `cwd` Extract files relative to the specified directory.  Defaults
+  to `process.cwd()`. [Alias: `C`]
+- `file` The archive file to list.  If not specified, then a
+  Writable stream is returned where the archive data should be
+  written. [Alias: `f`]
+- `sync` Read the specified file synchronously.  (This has no effect
+  when a file option isn't specified, because entries are emitted as
+  fast as they are parsed from the stream anyway.)
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `filter` A function that gets called with `(path, entry)` for each
+  entry being listed.  Return `true` to emit the entry from the
+  archive, or `false` to skip it.
+- `onentry` A function that gets called with `(entry)` for each entry
+  that passes the filter.  This is important for when both `file` and
+  `sync` are set, because it will be called synchronously.
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 16 MB.
+- `noResume` By default, `entry` streams are resumed immediately after
+  the call to `onentry`.  Set `noResume: true` to suppress this
+  behavior.  Note that by opting into this, the stream will never
+  complete until the entry data is consumed.
+
+### tar.u(options, fileList, callback) [alias: tar.update]
+
+Add files to an archive if they are newer than the entry already in
+the tarball archive.
+
+The `fileList` is an array of paths to add to the tarball.  Adding a
+directory also adds its children recursively.
+
+An entry in `fileList` that starts with an `@` symbol is a tar archive
+whose entries will be added.  To add a file that starts with `@`,
+prepend it with `./`.
+
+The following options are supported:
+
+- `file` Required. Write the tarball archive to the specified
+  filename. [Alias: `f`]
+- `sync` Act synchronously.  If this is set, then any provided file
+  will be fully written after the call to `tar.c`.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `cwd` The current working directory for adding entries to the
+  archive.  Defaults to `process.cwd()`.  [Alias: `C`]
+- `prefix` A path portion to prefix onto the entries in the archive.
+- `gzip` Set to any truthy value to create a gzipped archive, or an
+  object with settings for `zlib.Gzip()` [Alias: `z`]
+- `filter` A function that gets called with `(path, stat)` for each
+  entry being added.  Return `true` to add the entry to the archive,
+  or `false` to omit it.
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths. [Alias: `P`]
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 16 MB.
+- `noDirRecurse` Do not recursively archive the contents of
+  directories. [Alias: `n`]
+- `follow` Set to true to pack the targets of symbolic links.  Without
+  this option, symbolic links are archived as such. [Alias: `L`, `h`]
+- `noPax` Suppress pax extended headers.  Note that this means that
+  long paths and linkpaths will be truncated, and large or negative
+  numeric values may be interpreted incorrectly.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+  [Alias: `m`, `no-mtime`]
+- `mtime` Set to a `Date` object to force a specific `mtime` for
+  everything added to the archive.  Overridden by `noMtime`.
+
+### tar.r(options, fileList, callback) [alias: tar.replace]
+
+Add files to an existing archive.  Because later entries override
+earlier entries, this effectively replaces any existing entries.
+
+The `fileList` is an array of paths to add to the tarball.  Adding a
+directory also adds its children recursively.
+
+An entry in `fileList` that starts with an `@` symbol is a tar archive
+whose entries will be added.  To add a file that starts with `@`,
+prepend it with `./`.
+
+The following options are supported:
+
+- `file` Required. Write the tarball archive to the specified
+  filename. [Alias: `f`]
+- `sync` Act synchronously.  If this is set, then any provided file
+  will be fully written after the call to `tar.c`.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `cwd` The current working directory for adding entries to the
+  archive.  Defaults to `process.cwd()`.  [Alias: `C`]
+- `prefix` A path portion to prefix onto the entries in the archive.
+- `gzip` Set to any truthy value to create a gzipped archive, or an
+  object with settings for `zlib.Gzip()` [Alias: `z`]
+- `filter` A function that gets called with `(path, stat)` for each
+  entry being added.  Return `true` to add the entry to the archive,
+  or `false` to omit it.
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths. [Alias: `P`]
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 16 MB.
+- `noDirRecurse` Do not recursively archive the contents of
+  directories. [Alias: `n`]
+- `follow` Set to true to pack the targets of symbolic links.  Without
+  this option, symbolic links are archived as such. [Alias: `L`, `h`]
+- `noPax` Suppress pax extended headers.  Note that this means that
+  long paths and linkpaths will be truncated, and large or negative
+  numeric values may be interpreted incorrectly.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+  [Alias: `m`, `no-mtime`]
+- `mtime` Set to a `Date` object to force a specific `mtime` for
+  everything added to the archive.  Overridden by `noMtime`.
+
+
+## Low-Level API
+
+### class tar.Pack
+
+A readable tar stream.
+
+Has all the standard readable stream interface stuff.  `'data'` and
+`'end'` events, `read()` method, `pause()` and `resume()`, etc.
+
+#### constructor(options)
+
+The following options are supported:
+
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `cwd` The current working directory for creating the archive.
+  Defaults to `process.cwd()`.
+- `prefix` A path portion to prefix onto the entries in the archive.
+- `gzip` Set to any truthy value to create a gzipped archive, or an
+  object with settings for `zlib.Gzip()`
+- `filter` A function that gets called with `(path, stat)` for each
+  entry being added.  Return `true` to add the entry to the archive,
+  or `false` to omit it.
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths.
+- `linkCache` A Map object containing the device and inode value for
+  any file whose nlink is > 1, to identify hard links.
+- `statCache` A Map object that caches calls `lstat`.
+- `readdirCache` A Map object that caches calls to `readdir`.
+- `jobs` A number specifying how many concurrent jobs to run.
+  Defaults to 4.
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 16 MB.
+- `noDirRecurse` Do not recursively archive the contents of
+  directories.
+- `follow` Set to true to pack the targets of symbolic links.  Without
+  this option, symbolic links are archived as such.
+- `noPax` Suppress pax extended headers.  Note that this means that
+  long paths and linkpaths will be truncated, and large or negative
+  numeric values may be interpreted incorrectly.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+- `mtime` Set to a `Date` object to force a specific `mtime` for
+  everything added to the archive.  Overridden by `noMtime`.
+
+#### add(path)
+
+Adds an entry to the archive.  Returns the Pack stream.
+
+#### write(path)
+
+Adds an entry to the archive.  Returns true if flushed.
+
+#### end()
+
+Finishes the archive.
+
+### class tar.Pack.Sync
+
+Synchronous version of `tar.Pack`.
+
+### class tar.Unpack
+
+A writable stream that unpacks a tar archive onto the file system.
+
+All the normal writable stream stuff is supported.  `write()` and
+`end()` methods, `'drain'` events, etc.
+
+Note that all directories that are created will be forced to be
+writable, readable, and listable by their owner, to avoid cases where
+a directory prevents extraction of child entries by virtue of its
+mode.
+
+`'close'` is emitted when it's done writing stuff to the file system.
+
+Most unpack errors will cause a `warn` event to be emitted.  If the
+`cwd` is missing, or not a directory, then an error will be emitted.
+
+#### constructor(options)
+
+- `cwd` Extract files relative to the specified directory.  Defaults
+  to `process.cwd()`.  If provided, this must exist and must be a
+  directory.
+- `filter` A function that gets called with `(path, entry)` for each
+  entry being unpacked.  Return `true` to unpack the entry from the
+  archive, or `false` to skip it.
+- `newer` Set to true to keep the existing file on disk if it's newer
+  than the file in the archive.
+- `keep` Do not overwrite existing files.  In particular, if a file
+  appears more than once in an archive, later copies will not
+  overwrite earlier copies.
+- `preservePaths` Allow absolute paths, paths containing `..`, and
+  extracting through symbolic links.  By default, `/` is stripped from
+  absolute paths, `..` paths are not extracted, and any file whose
+  location would be modified by a symbolic link is not extracted.
+- `unlink` Unlink files before creating them.  Without this option,
+  tar overwrites existing files, which preserves existing hardlinks.
+  With this option, existing hardlinks will be broken, as will any
+  symlink that would affect the location of an extracted file.
+- `strip` Remove the specified number of leading path elements.
+  Pathnames with fewer elements will be silently skipped.  Note that
+  the pathname is edited after applying the filter, but before
+  security checks.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `umask` Filter the modes of entries like `process.umask()`.
+- `dmode` Default mode for directories
+- `fmode` Default mode for files
+- `dirCache` A Map object of which directories exist.
+- `maxMetaEntrySize` The maximum size of meta entries that is
+  supported.  Defaults to 1 MB.
+- `preserveOwner` If true, tar will set the `uid` and `gid` of
+  extracted entries to the `uid` and `gid` fields in the archive.
+  This defaults to true when run as root, and false otherwise.  If
+  false, then files and directories will be set with the owner and
+  group of the user running the process.  This is similar to `-p` in
+  `tar(1)`, but ACLs and other system-specific data is never unpacked
+  in this implementation, and modes are set by default already.
+- `win32` True if on a windows platform.  Causes behavior where
+  filenames containing `<|>?` chars are converted to
+  windows-compatible values while being unpacked.
+- `uid` Set to a number to force ownership of all extracted files and
+  folders, and all implicitly created directories, to be owned by the
+  specified user id, regardless of the `uid` field in the archive.
+  Cannot be used along with `preserveOwner`.  Requires also setting a
+  `gid` option.
+- `gid` Set to a number to force ownership of all extracted files and
+  folders, and all implicitly created directories, to be owned by the
+  specified group id, regardless of the `gid` field in the archive.
+  Cannot be used along with `preserveOwner`.  Requires also setting a
+  `uid` option.
+- `noMtime` Set to true to omit writing `mtime` value for extracted
+  entries.
+- `transform` Provide a function that takes an `entry` object, and
+  returns a stream, or any falsey value.  If a stream is provided,
+  then that stream's data will be written instead of the contents of
+  the archive entry.  If a falsey value is provided, then the entry is
+  written to disk as normal.  (To exclude items from extraction, use
+  the `filter` option described above.)
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `onentry` A function that gets called with `(entry)` for each entry
+  that passes the filter.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+
+### class tar.Unpack.Sync
+
+Synchronous version of `tar.Unpack`.
+
+Note that using an asynchronous stream type with the `transform`
+option will cause undefined behavior in sync unpack streams.
+[MiniPass](http://npm.im/minipass)-based streams are designed for this
+use case.
+
+### class tar.Parse
+
+A writable stream that parses a tar archive stream.  All the standard
+writable stream stuff is supported.
+
+If the archive is gzipped, then tar will detect this and unzip it.
+
+Emits `'entry'` events with `tar.ReadEntry` objects, which are
+themselves readable streams that you can pipe wherever.
+
+Each `entry` will not emit until the one before it is flushed through,
+so make sure to either consume the data (with `on('data', ...)` or
+`.pipe(...)`) or throw it away with `.resume()` to keep the stream
+flowing.
+
+#### constructor(options)
+
+Returns an event emitter that emits `entry` events with
+`tar.ReadEntry` objects.
+
+The following options are supported:
+
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `filter` A function that gets called with `(path, entry)` for each
+  entry being listed.  Return `true` to emit the entry from the
+  archive, or `false` to skip it.
+- `onentry` A function that gets called with `(entry)` for each entry
+  that passes the filter.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+
+#### abort(message, error)
+
+Stop all parsing activities.  This is called when there are zlib
+errors.  It also emits a warning with the message and error provided.
+
+### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass)
+
+A representation of an entry that is being read out of a tar archive.
+
+It has the following fields:
+
+- `extended` The extended metadata object provided to the constructor.
+- `globalExtended` The global extended metadata object provided to the
+  constructor.
+- `remain` The number of bytes remaining to be written into the
+  stream.
+- `blockRemain` The number of 512-byte blocks remaining to be written
+  into the stream.
+- `ignore` Whether this entry should be ignored.
+- `meta` True if this represents metadata about the next entry, false
+  if it represents a filesystem object.
+- All the fields from the header, extended header, and global extended
+  header are added to the ReadEntry object.  So it has `path`, `type`,
+  `size, `mode`, and so on.
+
+#### constructor(header, extended, globalExtended)
+
+Create a new ReadEntry object with the specified header, extended
+header, and global extended header values.
+
+### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass)
+
+A representation of an entry that is being written from the file
+system into a tar archive.
+
+Emits data for the Header, and for the Pax Extended Header if one is
+required, as well as any body data.
+
+Creating a WriteEntry for a directory does not also create
+WriteEntry objects for all of the directory contents.
+
+It has the following fields:
+
+- `path` The path field that will be written to the archive.  By
+  default, this is also the path from the cwd to the file system
+  object.
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `myuid` If supported, the uid of the user running the current
+  process.
+- `myuser` The `env.USER` string if set, or `''`.  Set as the entry
+  `uname` field if the file's `uid` matches `this.myuid`.
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 1 MB.
+- `linkCache` A Map object containing the device and inode value for
+  any file whose nlink is > 1, to identify hard links.
+- `statCache` A Map object that caches calls `lstat`.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths.
+- `cwd` The current working directory for creating the archive.
+  Defaults to `process.cwd()`.
+- `absolute` The absolute path to the entry on the filesystem.  By
+  default, this is `path.resolve(this.cwd, this.path)`, but it can be
+  overridden explicitly.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `win32` True if on a windows platform.  Causes behavior where paths
+  replace `\` with `/` and filenames containing the windows-compatible
+  forms of `<|>?:` characters are converted to actual `<|>?:` characters
+  in the archive.
+- `noPax` Suppress pax extended headers.  Note that this means that
+  long paths and linkpaths will be truncated, and large or negative
+  numeric values may be interpreted incorrectly.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+
+
+#### constructor(path, options)
+
+`path` is the path of the entry as it is written in the archive.
+
+The following options are supported:
+
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `maxReadSize` The maximum buffer size for `fs.read()` operations.
+  Defaults to 1 MB.
+- `linkCache` A Map object containing the device and inode value for
+  any file whose nlink is > 1, to identify hard links.
+- `statCache` A Map object that caches calls `lstat`.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths.
+- `cwd` The current working directory for creating the archive.
+  Defaults to `process.cwd()`.
+- `absolute` The absolute path to the entry on the filesystem.  By
+  default, this is `path.resolve(this.cwd, this.path)`, but it can be
+  overridden explicitly.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `win32` True if on a windows platform.  Causes behavior where paths
+  replace `\` with `/`.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+- `umask` Set to restrict the modes on the entries in the archive,
+  somewhat like how umask works on file creation.  Defaults to
+  `process.umask()` on unix systems, or `0o22` on Windows.
+
+#### warn(message, data)
+
+If strict, emit an error with the provided message.
+
+Othewise, emit a `'warn'` event with the provided message and data.
+
+### class tar.WriteEntry.Sync
+
+Synchronous version of tar.WriteEntry
+
+### class tar.WriteEntry.Tar
+
+A version of tar.WriteEntry that gets its data from a tar.ReadEntry
+instead of from the filesystem.
+
+#### constructor(readEntry, options)
+
+`readEntry` is the entry being read out of another archive.
+
+The following options are supported:
+
+- `portable` Omit metadata that is system-specific: `ctime`, `atime`,
+  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note
+  that `mtime` is still included, because this is necessary other
+  time-based operations.
+- `preservePaths` Allow absolute paths.  By default, `/` is stripped
+  from absolute paths.
+- `strict` Treat warnings as crash-worthy errors.  Default false.
+- `onwarn` A function that will get called with `(message, data)` for
+  any warnings encountered.
+- `noMtime` Set to true to omit writing `mtime` values for entries.
+  Note that this prevents using other mtime-based features like
+  `tar.update` or the `keepNewer` option with the resulting tar archive.
+
+### class tar.Header
+
+A class for reading and writing header blocks.
+
+It has the following fields:
+
+- `nullBlock` True if decoding a block which is entirely composed of
+  `0x00` null bytes.  (Useful because tar files are terminated by
+  at least 2 null blocks.)
+- `cksumValid` True if the checksum in the header is valid, false
+  otherwise.
+- `needPax` True if the values, as encoded, will require a Pax
+  extended header.
+- `path` The path of the entry.
+- `mode` The 4 lowest-order octal digits of the file mode.  That is,
+  read/write/execute permissions for world, group, and owner, and the
+  setuid, setgid, and sticky bits.
+- `uid` Numeric user id of the file owner
+- `gid` Numeric group id of the file owner
+- `size` Size of the file in bytes
+- `mtime` Modified time of the file
+- `cksum` The checksum of the header.  This is generated by adding all
+  the bytes of the header block, treating the checksum field itself as
+  all ascii space characters (that is, `0x20`).
+- `type` The human-readable name of the type of entry this represents,
+  or the alphanumeric key if unknown.
+- `typeKey` The alphanumeric key for the type of entry this header
+  represents.
+- `linkpath` The target of Link and SymbolicLink entries.
+- `uname` Human-readable user name of the file owner
+- `gname` Human-readable group name of the file owner
+- `devmaj` The major portion of the device number.  Always `0` for
+  files, directories, and links.
+- `devmin` The minor portion of the device number.  Always `0` for
+  files, directories, and links.
+- `atime` File access time.
+- `ctime` File change time.
+
+#### constructor(data, [offset=0])
+
+`data` is optional.  It is either a Buffer that should be interpreted
+as a tar Header starting at the specified offset and continuing for
+512 bytes, or a data object of keys and values to set on the header
+object, and eventually encode as a tar Header.
+
+#### decode(block, offset)
+
+Decode the provided buffer starting at the specified offset.
+
+Buffer length must be greater than 512 bytes.
+
+#### set(data)
+
+Set the fields in the data object.
+
+#### encode(buffer, offset)
+
+Encode the header fields into the buffer at the specified offset.
+
+Returns `this.needPax` to indicate whether a Pax Extended Header is
+required to properly encode the specified data.
+
+### class tar.Pax
+
+An object representing a set of key-value pairs in an Pax extended
+header entry.
+
+It has the following fields.  Where the same name is used, they have
+the same semantics as the tar.Header field of the same name.
+
+- `global` True if this represents a global extended header, or false
+  if it is for a single entry.
+- `atime`
+- `charset`
+- `comment`
+- `ctime`
+- `gid`
+- `gname`
+- `linkpath`
+- `mtime`
+- `path`
+- `size`
+- `uid`
+- `uname`
+- `dev`
+- `ino`
+- `nlink`
+
+#### constructor(object, global)
+
+Set the fields set in the object.  `global` is a boolean that defaults
+to false.
+
+#### encode()
+
+Return a Buffer containing the header and body for the Pax extended
+header entry, or `null` if there is nothing to encode.
+
+#### encodeBody()
+
+Return a string representing the body of the pax extended header
+entry.
+
+#### encodeField(fieldName)
+
+Return a string representing the key/value encoding for the specified
+fieldName, or `''` if the field is unset.
+
+### tar.Pax.parse(string, extended, global)
+
+Return a new Pax object created by parsing the contents of the string
+provided.
+
+If the `extended` object is set, then also add the fields from that
+object.  (This is necessary because multiple metadata entries can
+occur in sequence.)
+
+### tar.types
+
+A translation table for the `type` field in tar headers.
+
+#### tar.types.name.get(code)
+
+Get the human-readable name for a given alphanumeric code.
+
+#### tar.types.code.get(name)
+
+Get the alphanumeric code for a given human-readable name.
diff --git a/legacy-libs/grpc/node_modules/tar/index.js b/legacy-libs/grpc/node_modules/tar/index.js
new file mode 100644 (file)
index 0000000..c9ae06e
--- /dev/null
@@ -0,0 +1,18 @@
+'use strict'
+
+// high-level commands
+exports.c = exports.create = require('./lib/create.js')
+exports.r = exports.replace = require('./lib/replace.js')
+exports.t = exports.list = require('./lib/list.js')
+exports.u = exports.update = require('./lib/update.js')
+exports.x = exports.extract = require('./lib/extract.js')
+
+// classes
+exports.Pack = require('./lib/pack.js')
+exports.Unpack = require('./lib/unpack.js')
+exports.Parse = require('./lib/parse.js')
+exports.ReadEntry = require('./lib/read-entry.js')
+exports.WriteEntry = require('./lib/write-entry.js')
+exports.Header = require('./lib/header.js')
+exports.Pax = require('./lib/pax.js')
+exports.types = require('./lib/types.js')
diff --git a/legacy-libs/grpc/node_modules/tar/lib/buffer.js b/legacy-libs/grpc/node_modules/tar/lib/buffer.js
new file mode 100644 (file)
index 0000000..7876d5b
--- /dev/null
@@ -0,0 +1,11 @@
+'use strict'
+
+// Buffer in node 4.x < 4.5.0 doesn't have working Buffer.from
+// or Buffer.alloc, and Buffer in node 10 deprecated the ctor.
+// .M, this is fine .\^/M..
+let B = Buffer
+/* istanbul ignore next */
+if (!B.alloc) {
+  B = require('safe-buffer').Buffer
+}
+module.exports = B
diff --git a/legacy-libs/grpc/node_modules/tar/lib/create.js b/legacy-libs/grpc/node_modules/tar/lib/create.js
new file mode 100644 (file)
index 0000000..a37aa52
--- /dev/null
@@ -0,0 +1,105 @@
+'use strict'
+
+// tar -c
+const hlo = require('./high-level-opt.js')
+
+const Pack = require('./pack.js')
+const fs = require('fs')
+const fsm = require('fs-minipass')
+const t = require('./list.js')
+const path = require('path')
+
+const c = module.exports = (opt_, files, cb) => {
+  if (typeof files === 'function')
+    cb = files
+
+  if (Array.isArray(opt_))
+    files = opt_, opt_ = {}
+
+  if (!files || !Array.isArray(files) || !files.length)
+    throw new TypeError('no files or directories specified')
+
+  files = Array.from(files)
+
+  const opt = hlo(opt_)
+
+  if (opt.sync && typeof cb === 'function')
+    throw new TypeError('callback not supported for sync tar functions')
+
+  if (!opt.file && typeof cb === 'function')
+    throw new TypeError('callback only supported with file option')
+
+  return opt.file && opt.sync ? createFileSync(opt, files)
+    : opt.file ? createFile(opt, files, cb)
+    : opt.sync ? createSync(opt, files)
+    : create(opt, files)
+}
+
+const createFileSync = (opt, files) => {
+  const p = new Pack.Sync(opt)
+  const stream = new fsm.WriteStreamSync(opt.file, {
+    mode: opt.mode || 0o666
+  })
+  p.pipe(stream)
+  addFilesSync(p, files)
+}
+
+const createFile = (opt, files, cb) => {
+  const p = new Pack(opt)
+  const stream = new fsm.WriteStream(opt.file, {
+    mode: opt.mode || 0o666
+  })
+  p.pipe(stream)
+
+  const promise = new Promise((res, rej) => {
+    stream.on('error', rej)
+    stream.on('close', res)
+    p.on('error', rej)
+  })
+
+  addFilesAsync(p, files)
+
+  return cb ? promise.then(cb, cb) : promise
+}
+
+const addFilesSync = (p, files) => {
+  files.forEach(file => {
+    if (file.charAt(0) === '@')
+      t({
+        file: path.resolve(p.cwd, file.substr(1)),
+        sync: true,
+        noResume: true,
+        onentry: entry => p.add(entry)
+      })
+    else
+      p.add(file)
+  })
+  p.end()
+}
+
+const addFilesAsync = (p, files) => {
+  while (files.length) {
+    const file = files.shift()
+    if (file.charAt(0) === '@')
+      return t({
+        file: path.resolve(p.cwd, file.substr(1)),
+        noResume: true,
+        onentry: entry => p.add(entry)
+      }).then(_ => addFilesAsync(p, files))
+    else
+      p.add(file)
+  }
+  p.end()
+}
+
+const createSync = (opt, files) => {
+  const p = new Pack.Sync(opt)
+  addFilesSync(p, files)
+  return p
+}
+
+const create = (opt, files) => {
+  const p = new Pack(opt)
+  addFilesAsync(p, files)
+  return p
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/extract.js b/legacy-libs/grpc/node_modules/tar/lib/extract.js
new file mode 100644 (file)
index 0000000..cbb458a
--- /dev/null
@@ -0,0 +1,112 @@
+'use strict'
+
+// tar -x
+const hlo = require('./high-level-opt.js')
+const Unpack = require('./unpack.js')
+const fs = require('fs')
+const fsm = require('fs-minipass')
+const path = require('path')
+
+const x = module.exports = (opt_, files, cb) => {
+  if (typeof opt_ === 'function')
+    cb = opt_, files = null, opt_ = {}
+  else if (Array.isArray(opt_))
+    files = opt_, opt_ = {}
+
+  if (typeof files === 'function')
+    cb = files, files = null
+
+  if (!files)
+    files = []
+  else
+    files = Array.from(files)
+
+  const opt = hlo(opt_)
+
+  if (opt.sync && typeof cb === 'function')
+    throw new TypeError('callback not supported for sync tar functions')
+
+  if (!opt.file && typeof cb === 'function')
+    throw new TypeError('callback only supported with file option')
+
+  if (files.length)
+    filesFilter(opt, files)
+
+  return opt.file && opt.sync ? extractFileSync(opt)
+    : opt.file ? extractFile(opt, cb)
+    : opt.sync ? extractSync(opt)
+    : extract(opt)
+}
+
+// construct a filter that limits the file entries listed
+// include child entries if a dir is included
+const filesFilter = (opt, files) => {
+  const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true]))
+  const filter = opt.filter
+
+  const mapHas = (file, r) => {
+    const root = r || path.parse(file).root || '.'
+    const ret = file === root ? false
+      : map.has(file) ? map.get(file)
+      : mapHas(path.dirname(file), root)
+
+    map.set(file, ret)
+    return ret
+  }
+
+  opt.filter = filter
+    ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, ''))
+    : file => mapHas(file.replace(/\/+$/, ''))
+}
+
+const extractFileSync = opt => {
+  const u = new Unpack.Sync(opt)
+
+  const file = opt.file
+  let threw = true
+  let fd
+  const stat = fs.statSync(file)
+  // This trades a zero-byte read() syscall for a stat
+  // However, it will usually result in less memory allocation
+  const readSize = opt.maxReadSize || 16*1024*1024
+  const stream = new fsm.ReadStreamSync(file, {
+    readSize: readSize,
+    size: stat.size
+  })
+  stream.pipe(u)
+}
+
+const extractFile = (opt, cb) => {
+  const u = new Unpack(opt)
+  const readSize = opt.maxReadSize || 16*1024*1024
+
+  const file = opt.file
+  const p = new Promise((resolve, reject) => {
+    u.on('error', reject)
+    u.on('close', resolve)
+
+    // This trades a zero-byte read() syscall for a stat
+    // However, it will usually result in less memory allocation
+    fs.stat(file, (er, stat) => {
+      if (er)
+        reject(er)
+      else {
+        const stream = new fsm.ReadStream(file, {
+          readSize: readSize,
+          size: stat.size
+        })
+        stream.on('error', reject)
+        stream.pipe(u)
+      }
+    })
+  })
+  return cb ? p.then(cb, cb) : p
+}
+
+const extractSync = opt => {
+  return new Unpack.Sync(opt)
+}
+
+const extract = opt => {
+  return new Unpack(opt)
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/header.js b/legacy-libs/grpc/node_modules/tar/lib/header.js
new file mode 100644 (file)
index 0000000..d29c3b9
--- /dev/null
@@ -0,0 +1,289 @@
+'use strict'
+// parse a 512-byte header block to a data object, or vice-versa
+// encode returns `true` if a pax extended header is needed, because
+// the data could not be faithfully encoded in a simple header.
+// (Also, check header.needPax to see if it needs a pax header.)
+
+const Buffer = require('./buffer.js')
+const types = require('./types.js')
+const pathModule = require('path').posix
+const large = require('./large-numbers.js')
+
+const SLURP = Symbol('slurp')
+const TYPE = Symbol('type')
+
+class Header {
+  constructor (data, off, ex, gex) {
+    this.cksumValid = false
+    this.needPax = false
+    this.nullBlock = false
+
+    this.block = null
+    this.path = null
+    this.mode = null
+    this.uid = null
+    this.gid = null
+    this.size = null
+    this.mtime = null
+    this.cksum = null
+    this[TYPE] = '0'
+    this.linkpath = null
+    this.uname = null
+    this.gname = null
+    this.devmaj = 0
+    this.devmin = 0
+    this.atime = null
+    this.ctime = null
+
+    if (Buffer.isBuffer(data))
+      this.decode(data, off || 0, ex, gex)
+    else if (data)
+      this.set(data)
+  }
+
+  decode (buf, off, ex, gex) {
+    if (!off)
+      off = 0
+
+    if (!buf || !(buf.length >= off + 512))
+      throw new Error('need 512 bytes for header')
+
+    this.path = decString(buf, off, 100)
+    this.mode = decNumber(buf, off + 100, 8)
+    this.uid = decNumber(buf, off + 108, 8)
+    this.gid = decNumber(buf, off + 116, 8)
+    this.size = decNumber(buf, off + 124, 12)
+    this.mtime = decDate(buf, off + 136, 12)
+    this.cksum = decNumber(buf, off + 148, 12)
+
+    // if we have extended or global extended headers, apply them now
+    // See https://github.com/npm/node-tar/pull/187
+    this[SLURP](ex)
+    this[SLURP](gex, true)
+
+    // old tar versions marked dirs as a file with a trailing /
+    this[TYPE] = decString(buf, off + 156, 1)
+    if (this[TYPE] === '')
+      this[TYPE] = '0'
+    if (this[TYPE] === '0' && this.path.substr(-1) === '/')
+      this[TYPE] = '5'
+
+    // tar implementations sometimes incorrectly put the stat(dir).size
+    // as the size in the tarball, even though Directory entries are
+    // not able to have any body at all.  In the very rare chance that
+    // it actually DOES have a body, we weren't going to do anything with
+    // it anyway, and it'll just be a warning about an invalid header.
+    if (this[TYPE] === '5')
+      this.size = 0
+
+    this.linkpath = decString(buf, off + 157, 100)
+    if (buf.slice(off + 257, off + 265).toString() === 'ustar\u000000') {
+      this.uname = decString(buf, off + 265, 32)
+      this.gname = decString(buf, off + 297, 32)
+      this.devmaj = decNumber(buf, off + 329, 8)
+      this.devmin = decNumber(buf, off + 337, 8)
+      if (buf[off + 475] !== 0) {
+        // definitely a prefix, definitely >130 chars.
+        const prefix = decString(buf, off + 345, 155)
+        this.path = prefix + '/' + this.path
+      } else {
+        const prefix = decString(buf, off + 345, 130)
+        if (prefix)
+          this.path = prefix + '/' + this.path
+        this.atime = decDate(buf, off + 476, 12)
+        this.ctime = decDate(buf, off + 488, 12)
+      }
+    }
+
+    let sum = 8 * 0x20
+    for (let i = off; i < off + 148; i++) {
+      sum += buf[i]
+    }
+    for (let i = off + 156; i < off + 512; i++) {
+      sum += buf[i]
+    }
+    this.cksumValid = sum === this.cksum
+    if (this.cksum === null && sum === 8 * 0x20)
+      this.nullBlock = true
+  }
+
+  [SLURP] (ex, global) {
+    for (let k in ex) {
+      // we slurp in everything except for the path attribute in
+      // a global extended header, because that's weird.
+      if (ex[k] !== null && ex[k] !== undefined &&
+          !(global && k === 'path'))
+        this[k] = ex[k]
+    }
+  }
+
+  encode (buf, off) {
+    if (!buf) {
+      buf = this.block = Buffer.alloc(512)
+      off = 0
+    }
+
+    if (!off)
+      off = 0
+
+    if (!(buf.length >= off + 512))
+      throw new Error('need 512 bytes for header')
+
+    const prefixSize = this.ctime || this.atime ? 130 : 155
+    const split = splitPrefix(this.path || '', prefixSize)
+    const path = split[0]
+    const prefix = split[1]
+    this.needPax = split[2]
+
+    this.needPax = encString(buf, off, 100, path) || this.needPax
+    this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax
+    this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax
+    this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax
+    this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax
+    this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax
+    buf[off + 156] = this[TYPE].charCodeAt(0)
+    this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax
+    buf.write('ustar\u000000', off + 257, 8)
+    this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax
+    this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax
+    this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax
+    this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax
+    this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax
+    if (buf[off + 475] !== 0)
+      this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax
+    else {
+      this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax
+      this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax
+      this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax
+    }
+
+    let sum = 8 * 0x20
+    for (let i = off; i < off + 148; i++) {
+      sum += buf[i]
+    }
+    for (let i = off + 156; i < off + 512; i++) {
+      sum += buf[i]
+    }
+    this.cksum = sum
+    encNumber(buf, off + 148, 8, this.cksum)
+    this.cksumValid = true
+
+    return this.needPax
+  }
+
+  set (data) {
+    for (let i in data) {
+      if (data[i] !== null && data[i] !== undefined)
+        this[i] = data[i]
+    }
+  }
+
+  get type () {
+    return types.name.get(this[TYPE]) || this[TYPE]
+  }
+
+  get typeKey () {
+    return this[TYPE]
+  }
+
+  set type (type) {
+    if (types.code.has(type))
+      this[TYPE] = types.code.get(type)
+    else
+      this[TYPE] = type
+  }
+}
+
+const splitPrefix = (p, prefixSize) => {
+  const pathSize = 100
+  let pp = p
+  let prefix = ''
+  let ret
+  const root = pathModule.parse(p).root || '.'
+
+  if (Buffer.byteLength(pp) < pathSize)
+    ret = [pp, prefix, false]
+  else {
+    // first set prefix to the dir, and path to the base
+    prefix = pathModule.dirname(pp)
+    pp = pathModule.basename(pp)
+
+    do {
+      // both fit!
+      if (Buffer.byteLength(pp) <= pathSize &&
+          Buffer.byteLength(prefix) <= prefixSize)
+        ret = [pp, prefix, false]
+
+      // prefix fits in prefix, but path doesn't fit in path
+      else if (Buffer.byteLength(pp) > pathSize &&
+          Buffer.byteLength(prefix) <= prefixSize)
+        ret = [pp.substr(0, pathSize - 1), prefix, true]
+
+      else {
+        // make path take a bit from prefix
+        pp = pathModule.join(pathModule.basename(prefix), pp)
+        prefix = pathModule.dirname(prefix)
+      }
+    } while (prefix !== root && !ret)
+
+    // at this point, found no resolution, just truncate
+    if (!ret)
+      ret = [p.substr(0, pathSize - 1), '', true]
+  }
+  return ret
+}
+
+const decString = (buf, off, size) =>
+  buf.slice(off, off + size).toString('utf8').replace(/\0.*/, '')
+
+const decDate = (buf, off, size) =>
+  numToDate(decNumber(buf, off, size))
+
+const numToDate = num => num === null ? null : new Date(num * 1000)
+
+const decNumber = (buf, off, size) =>
+  buf[off] & 0x80 ? large.parse(buf.slice(off, off + size))
+    : decSmallNumber(buf, off, size)
+
+const nanNull = value => isNaN(value) ? null : value
+
+const decSmallNumber = (buf, off, size) =>
+  nanNull(parseInt(
+    buf.slice(off, off + size)
+      .toString('utf8').replace(/\0.*$/, '').trim(), 8))
+
+// the maximum encodable as a null-terminated octal, by field size
+const MAXNUM = {
+  12: 0o77777777777,
+  8 : 0o7777777
+}
+
+const encNumber = (buf, off, size, number) =>
+  number === null ? false :
+  number > MAXNUM[size] || number < 0
+    ? (large.encode(number, buf.slice(off, off + size)), true)
+    : (encSmallNumber(buf, off, size, number), false)
+
+const encSmallNumber = (buf, off, size, number) =>
+  buf.write(octalString(number, size), off, size, 'ascii')
+
+const octalString = (number, size) =>
+  padOctal(Math.floor(number).toString(8), size)
+
+const padOctal = (string, size) =>
+  (string.length === size - 1 ? string
+  : new Array(size - string.length - 1).join('0') + string + ' ') + '\0'
+
+const encDate = (buf, off, size, date) =>
+  date === null ? false :
+  encNumber(buf, off, size, date.getTime() / 1000)
+
+// enough to fill the longest string we've got
+const NULLS = new Array(156).join('\0')
+// pad with nulls, return true if it's longer or non-ascii
+const encString = (buf, off, size, string) =>
+  string === null ? false :
+  (buf.write(string + NULLS, off, size, 'utf8'),
+   string.length !== Buffer.byteLength(string) || string.length > size)
+
+module.exports = Header
diff --git a/legacy-libs/grpc/node_modules/tar/lib/high-level-opt.js b/legacy-libs/grpc/node_modules/tar/lib/high-level-opt.js
new file mode 100644 (file)
index 0000000..7333db9
--- /dev/null
@@ -0,0 +1,29 @@
+'use strict'
+
+// turn tar(1) style args like `C` into the more verbose things like `cwd`
+
+const argmap = new Map([
+  ['C', 'cwd'],
+  ['f', 'file'],
+  ['z', 'gzip'],
+  ['P', 'preservePaths'],
+  ['U', 'unlink'],
+  ['strip-components', 'strip'],
+  ['stripComponents', 'strip'],
+  ['keep-newer', 'newer'],
+  ['keepNewer', 'newer'],
+  ['keep-newer-files', 'newer'],
+  ['keepNewerFiles', 'newer'],
+  ['k', 'keep'],
+  ['keep-existing', 'keep'],
+  ['keepExisting', 'keep'],
+  ['m', 'noMtime'],
+  ['no-mtime', 'noMtime'],
+  ['p', 'preserveOwner'],
+  ['L', 'follow'],
+  ['h', 'follow']
+])
+
+const parse = module.exports = opt => opt ? Object.keys(opt).map(k => [
+  argmap.has(k) ? argmap.get(k) : k, opt[k]
+]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/large-numbers.js b/legacy-libs/grpc/node_modules/tar/lib/large-numbers.js
new file mode 100644 (file)
index 0000000..3e5c992
--- /dev/null
@@ -0,0 +1,97 @@
+'use strict'
+// Tar can encode large and negative numbers using a leading byte of
+// 0xff for negative, and 0x80 for positive.
+
+const encode = exports.encode = (num, buf) => {
+  if (!Number.isSafeInteger(num))
+    // The number is so large that javascript cannot represent it with integer
+    // precision.
+    throw TypeError('cannot encode number outside of javascript safe integer range')
+  else if (num < 0)
+    encodeNegative(num, buf)
+  else
+    encodePositive(num, buf)
+  return buf
+}
+
+const encodePositive = (num, buf) => {
+  buf[0] = 0x80
+
+  for (var i = buf.length; i > 1; i--) {
+    buf[i-1] = num & 0xff
+    num = Math.floor(num / 0x100)
+  }
+}
+
+const encodeNegative = (num, buf) => {
+  buf[0] = 0xff
+  var flipped = false
+  num = num * -1
+  for (var i = buf.length; i > 1; i--) {
+    var byte = num & 0xff
+    num = Math.floor(num / 0x100)
+    if (flipped)
+      buf[i-1] = onesComp(byte)
+    else if (byte === 0)
+      buf[i-1] = 0
+    else {
+      flipped = true
+      buf[i-1] = twosComp(byte)
+    }
+  }
+}
+
+const parse = exports.parse = (buf) => {
+  var post = buf[buf.length - 1]
+  var pre = buf[0]
+  var value;
+  if (pre === 0x80)
+    value = pos(buf.slice(1, buf.length))
+  else if (pre === 0xff)
+    value = twos(buf)
+  else
+    throw TypeError('invalid base256 encoding')
+
+  if (!Number.isSafeInteger(value))
+    // The number is so large that javascript cannot represent it with integer
+    // precision.
+    throw TypeError('parsed number outside of javascript safe integer range')
+
+  return value
+}
+
+const twos = (buf) => {
+  var len = buf.length
+  var sum = 0
+  var flipped = false
+  for (var i = len - 1; i > -1; i--) {
+    var byte = buf[i]
+    var f
+    if (flipped)
+      f = onesComp(byte)
+    else if (byte === 0)
+      f = byte
+    else {
+      flipped = true
+      f = twosComp(byte)
+    }
+    if (f !== 0)
+      sum -= f * Math.pow(256, len - i - 1)
+  }
+  return sum
+}
+
+const pos = (buf) => {
+  var len = buf.length
+  var sum = 0
+  for (var i = len - 1; i > -1; i--) {
+    var byte = buf[i]
+    if (byte !== 0)
+      sum += byte * Math.pow(256, len - i - 1)
+  }
+  return sum
+}
+
+const onesComp = byte => (0xff ^ byte) & 0xff
+
+const twosComp = byte => ((0xff ^ byte) + 1) & 0xff
diff --git a/legacy-libs/grpc/node_modules/tar/lib/list.js b/legacy-libs/grpc/node_modules/tar/lib/list.js
new file mode 100644 (file)
index 0000000..250ebe0
--- /dev/null
@@ -0,0 +1,130 @@
+'use strict'
+
+const Buffer = require('./buffer.js')
+
+// XXX: This shares a lot in common with extract.js
+// maybe some DRY opportunity here?
+
+// tar -t
+const hlo = require('./high-level-opt.js')
+const Parser = require('./parse.js')
+const fs = require('fs')
+const fsm = require('fs-minipass')
+const path = require('path')
+
+const t = module.exports = (opt_, files, cb) => {
+  if (typeof opt_ === 'function')
+    cb = opt_, files = null, opt_ = {}
+  else if (Array.isArray(opt_))
+    files = opt_, opt_ = {}
+
+  if (typeof files === 'function')
+    cb = files, files = null
+
+  if (!files)
+    files = []
+  else
+    files = Array.from(files)
+
+  const opt = hlo(opt_)
+
+  if (opt.sync && typeof cb === 'function')
+    throw new TypeError('callback not supported for sync tar functions')
+
+  if (!opt.file && typeof cb === 'function')
+    throw new TypeError('callback only supported with file option')
+
+  if (files.length)
+    filesFilter(opt, files)
+
+  if (!opt.noResume)
+    onentryFunction(opt)
+
+  return opt.file && opt.sync ? listFileSync(opt)
+    : opt.file ? listFile(opt, cb)
+    : list(opt)
+}
+
+const onentryFunction = opt => {
+  const onentry = opt.onentry
+  opt.onentry = onentry ? e => {
+    onentry(e)
+    e.resume()
+  } : e => e.resume()
+}
+
+// construct a filter that limits the file entries listed
+// include child entries if a dir is included
+const filesFilter = (opt, files) => {
+  const map = new Map(files.map(f => [f.replace(/\/+$/, ''), true]))
+  const filter = opt.filter
+
+  const mapHas = (file, r) => {
+    const root = r || path.parse(file).root || '.'
+    const ret = file === root ? false
+      : map.has(file) ? map.get(file)
+      : mapHas(path.dirname(file), root)
+
+    map.set(file, ret)
+    return ret
+  }
+
+  opt.filter = filter
+    ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\/+$/, ''))
+    : file => mapHas(file.replace(/\/+$/, ''))
+}
+
+const listFileSync = opt => {
+  const p = list(opt)
+  const file = opt.file
+  let threw = true
+  let fd
+  try {
+    const stat = fs.statSync(file)
+    const readSize = opt.maxReadSize || 16*1024*1024
+    if (stat.size < readSize) {
+      p.end(fs.readFileSync(file))
+    } else {
+      let pos = 0
+      const buf = Buffer.allocUnsafe(readSize)
+      fd = fs.openSync(file, 'r')
+      while (pos < stat.size) {
+        let bytesRead = fs.readSync(fd, buf, 0, readSize, pos)
+        pos += bytesRead
+        p.write(buf.slice(0, bytesRead))
+      }
+      p.end()
+    }
+    threw = false
+  } finally {
+    if (threw && fd)
+      try { fs.closeSync(fd) } catch (er) {}
+  }
+}
+
+const listFile = (opt, cb) => {
+  const parse = new Parser(opt)
+  const readSize = opt.maxReadSize || 16*1024*1024
+
+  const file = opt.file
+  const p = new Promise((resolve, reject) => {
+    parse.on('error', reject)
+    parse.on('end', resolve)
+
+    fs.stat(file, (er, stat) => {
+      if (er)
+        reject(er)
+      else {
+        const stream = new fsm.ReadStream(file, {
+          readSize: readSize,
+          size: stat.size
+        })
+        stream.on('error', reject)
+        stream.pipe(parse)
+      }
+    })
+  })
+  return cb ? p.then(cb, cb) : p
+}
+
+const list = opt => new Parser(opt)
diff --git a/legacy-libs/grpc/node_modules/tar/lib/mkdir.js b/legacy-libs/grpc/node_modules/tar/lib/mkdir.js
new file mode 100644 (file)
index 0000000..c6a154c
--- /dev/null
@@ -0,0 +1,206 @@
+'use strict'
+// wrapper around mkdirp for tar's needs.
+
+// TODO: This should probably be a class, not functionally
+// passing around state in a gazillion args.
+
+const mkdirp = require('mkdirp')
+const fs = require('fs')
+const path = require('path')
+const chownr = require('chownr')
+
+class SymlinkError extends Error {
+  constructor (symlink, path) {
+    super('Cannot extract through symbolic link')
+    this.path = path
+    this.symlink = symlink
+  }
+
+  get name () {
+    return 'SylinkError'
+  }
+}
+
+class CwdError extends Error {
+  constructor (path, code) {
+    super(code + ': Cannot cd into \'' + path + '\'')
+    this.path = path
+    this.code = code
+  }
+
+  get name () {
+    return 'CwdError'
+  }
+}
+
+const mkdir = module.exports = (dir, opt, cb) => {
+  // if there's any overlap between mask and mode,
+  // then we'll need an explicit chmod
+  const umask = opt.umask
+  const mode = opt.mode | 0o0700
+  const needChmod = (mode & umask) !== 0
+
+  const uid = opt.uid
+  const gid = opt.gid
+  const doChown = typeof uid === 'number' &&
+    typeof gid === 'number' &&
+    ( uid !== opt.processUid || gid !== opt.processGid )
+
+  const preserve = opt.preserve
+  const unlink = opt.unlink
+  const cache = opt.cache
+  const cwd = opt.cwd
+
+  const done = (er, created) => {
+    if (er)
+      cb(er)
+    else {
+      cache.set(dir, true)
+      if (created && doChown)
+        chownr(created, uid, gid, er => done(er))
+      else if (needChmod)
+        fs.chmod(dir, mode, cb)
+      else
+        cb()
+    }
+  }
+
+  if (cache && cache.get(dir) === true)
+    return done()
+
+  if (dir === cwd)
+    return fs.stat(dir, (er, st) => {
+      if (er || !st.isDirectory())
+        er = new CwdError(dir, er && er.code || 'ENOTDIR')
+      done(er)
+    })
+
+  if (preserve)
+    return mkdirp(dir, mode, done)
+
+  const sub = path.relative(cwd, dir)
+  const parts = sub.split(/\/|\\/)
+  mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done)
+}
+
+const mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {
+  if (!parts.length)
+    return cb(null, created)
+  const p = parts.shift()
+  const part = base + '/' + p
+  if (cache.get(part))
+    return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
+  fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))
+}
+
+const onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {
+  if (er) {
+    if (er.path && path.dirname(er.path) === cwd &&
+        (er.code === 'ENOTDIR' || er.code === 'ENOENT'))
+      return cb(new CwdError(cwd, er.code))
+
+    fs.lstat(part, (statEr, st) => {
+      if (statEr)
+        cb(statEr)
+      else if (st.isDirectory())
+        mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
+      else if (unlink)
+        fs.unlink(part, er => {
+          if (er)
+            return cb(er)
+          fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))
+        })
+      else if (st.isSymbolicLink())
+        return cb(new SymlinkError(part, part + '/' + parts.join('/')))
+      else
+        cb(er)
+    })
+  } else {
+    created = created || part
+    mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)
+  }
+}
+
+const mkdirSync = module.exports.sync = (dir, opt) => {
+  // if there's any overlap between mask and mode,
+  // then we'll need an explicit chmod
+  const umask = opt.umask
+  const mode = opt.mode | 0o0700
+  const needChmod = (mode & umask) !== 0
+
+  const uid = opt.uid
+  const gid = opt.gid
+  const doChown = typeof uid === 'number' &&
+    typeof gid === 'number' &&
+    ( uid !== opt.processUid || gid !== opt.processGid )
+
+  const preserve = opt.preserve
+  const unlink = opt.unlink
+  const cache = opt.cache
+  const cwd = opt.cwd
+
+  const done = (created) => {
+    cache.set(dir, true)
+    if (created && doChown)
+      chownr.sync(created, uid, gid)
+    if (needChmod)
+      fs.chmodSync(dir, mode)
+  }
+
+  if (cache && cache.get(dir) === true)
+    return done()
+
+  if (dir === cwd) {
+    let ok = false
+    let code = 'ENOTDIR'
+    try {
+      ok = fs.statSync(dir).isDirectory()
+    } catch (er) {
+      code = er.code
+    } finally {
+      if (!ok)
+        throw new CwdError(dir, code)
+    }
+    done()
+    return
+  }
+
+  if (preserve)
+    return done(mkdirp.sync(dir, mode))
+
+  const sub = path.relative(cwd, dir)
+  const parts = sub.split(/\/|\\/)
+  let created = null
+  for (let p = parts.shift(), part = cwd;
+       p && (part += '/' + p);
+       p = parts.shift()) {
+
+    if (cache.get(part))
+      continue
+
+    try {
+      fs.mkdirSync(part, mode)
+      created = created || part
+      cache.set(part, true)
+    } catch (er) {
+      if (er.path && path.dirname(er.path) === cwd &&
+          (er.code === 'ENOTDIR' || er.code === 'ENOENT'))
+        return new CwdError(cwd, er.code)
+
+      const st = fs.lstatSync(part)
+      if (st.isDirectory()) {
+        cache.set(part, true)
+        continue
+      } else if (unlink) {
+        fs.unlinkSync(part)
+        fs.mkdirSync(part, mode)
+        created = created || part
+        cache.set(part, true)
+        continue
+      } else if (st.isSymbolicLink())
+        return new SymlinkError(part, part + '/' + parts.join('/'))
+    }
+  }
+
+  return done(created)
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/mode-fix.js b/legacy-libs/grpc/node_modules/tar/lib/mode-fix.js
new file mode 100644 (file)
index 0000000..3363a3b
--- /dev/null
@@ -0,0 +1,14 @@
+'use strict'
+module.exports = (mode, isDir) => {
+  mode &= 0o7777
+  // if dirs are readable, then they should be listable
+  if (isDir) {
+    if (mode & 0o400)
+      mode |= 0o100
+    if (mode & 0o40)
+      mode |= 0o10
+    if (mode & 0o4)
+      mode |= 0o1
+  }
+  return mode
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/pack.js b/legacy-libs/grpc/node_modules/tar/lib/pack.js
new file mode 100644 (file)
index 0000000..857cea9
--- /dev/null
@@ -0,0 +1,404 @@
+'use strict'
+
+const Buffer = require('./buffer.js')
+
+// A readable tar stream creator
+// Technically, this is a transform stream that you write paths into,
+// and tar format comes out of.
+// The `add()` method is like `write()` but returns this,
+// and end() return `this` as well, so you can
+// do `new Pack(opt).add('files').add('dir').end().pipe(output)
+// You could also do something like:
+// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar'))
+
+class PackJob {
+  constructor (path, absolute) {
+    this.path = path || './'
+    this.absolute = absolute
+    this.entry = null
+    this.stat = null
+    this.readdir = null
+    this.pending = false
+    this.ignore = false
+    this.piped = false
+  }
+}
+
+const MiniPass = require('minipass')
+const zlib = require('minizlib')
+const ReadEntry = require('./read-entry.js')
+const WriteEntry = require('./write-entry.js')
+const WriteEntrySync = WriteEntry.Sync
+const WriteEntryTar = WriteEntry.Tar
+const Yallist = require('yallist')
+const EOF = Buffer.alloc(1024)
+const ONSTAT = Symbol('onStat')
+const ENDED = Symbol('ended')
+const QUEUE = Symbol('queue')
+const CURRENT = Symbol('current')
+const PROCESS = Symbol('process')
+const PROCESSING = Symbol('processing')
+const PROCESSJOB = Symbol('processJob')
+const JOBS = Symbol('jobs')
+const JOBDONE = Symbol('jobDone')
+const ADDFSENTRY = Symbol('addFSEntry')
+const ADDTARENTRY = Symbol('addTarEntry')
+const STAT = Symbol('stat')
+const READDIR = Symbol('readdir')
+const ONREADDIR = Symbol('onreaddir')
+const PIPE = Symbol('pipe')
+const ENTRY = Symbol('entry')
+const ENTRYOPT = Symbol('entryOpt')
+const WRITEENTRYCLASS = Symbol('writeEntryClass')
+const WRITE = Symbol('write')
+const ONDRAIN = Symbol('ondrain')
+
+const fs = require('fs')
+const path = require('path')
+const warner = require('./warn-mixin.js')
+
+const Pack = warner(class Pack extends MiniPass {
+  constructor (opt) {
+    super(opt)
+    opt = opt || Object.create(null)
+    this.opt = opt
+    this.cwd = opt.cwd || process.cwd()
+    this.maxReadSize = opt.maxReadSize
+    this.preservePaths = !!opt.preservePaths
+    this.strict = !!opt.strict
+    this.noPax = !!opt.noPax
+    this.prefix = (opt.prefix || '').replace(/(\\|\/)+$/, '')
+    this.linkCache = opt.linkCache || new Map()
+    this.statCache = opt.statCache || new Map()
+    this.readdirCache = opt.readdirCache || new Map()
+
+    this[WRITEENTRYCLASS] = WriteEntry
+    if (typeof opt.onwarn === 'function')
+      this.on('warn', opt.onwarn)
+
+    this.zip = null
+    if (opt.gzip) {
+      if (typeof opt.gzip !== 'object')
+        opt.gzip = {}
+      this.zip = new zlib.Gzip(opt.gzip)
+      this.zip.on('data', chunk => super.write(chunk))
+      this.zip.on('end', _ => super.end())
+      this.zip.on('drain', _ => this[ONDRAIN]())
+      this.on('resume', _ => this.zip.resume())
+    } else
+      this.on('drain', this[ONDRAIN])
+
+    this.portable = !!opt.portable
+    this.noDirRecurse = !!opt.noDirRecurse
+    this.follow = !!opt.follow
+    this.noMtime = !!opt.noMtime
+    this.mtime = opt.mtime || null
+
+    this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true
+
+    this[QUEUE] = new Yallist
+    this[JOBS] = 0
+    this.jobs = +opt.jobs || 4
+    this[PROCESSING] = false
+    this[ENDED] = false
+  }
+
+  [WRITE] (chunk) {
+    return super.write(chunk)
+  }
+
+  add (path) {
+    this.write(path)
+    return this
+  }
+
+  end (path) {
+    if (path)
+      this.write(path)
+    this[ENDED] = true
+    this[PROCESS]()
+    return this
+  }
+
+  write (path) {
+    if (this[ENDED])
+      throw new Error('write after end')
+
+    if (path instanceof ReadEntry)
+      this[ADDTARENTRY](path)
+    else
+      this[ADDFSENTRY](path)
+    return this.flowing
+  }
+
+  [ADDTARENTRY] (p) {
+    const absolute = path.resolve(this.cwd, p.path)
+    if (this.prefix)
+      p.path = this.prefix + '/' + p.path.replace(/^\.(\/+|$)/, '')
+
+    // in this case, we don't have to wait for the stat
+    if (!this.filter(p.path, p))
+      p.resume()
+    else {
+      const job = new PackJob(p.path, absolute, false)
+      job.entry = new WriteEntryTar(p, this[ENTRYOPT](job))
+      job.entry.on('end', _ => this[JOBDONE](job))
+      this[JOBS] += 1
+      this[QUEUE].push(job)
+    }
+
+    this[PROCESS]()
+  }
+
+  [ADDFSENTRY] (p) {
+    const absolute = path.resolve(this.cwd, p)
+    if (this.prefix)
+      p = this.prefix + '/' + p.replace(/^\.(\/+|$)/, '')
+
+    this[QUEUE].push(new PackJob(p, absolute))
+    this[PROCESS]()
+  }
+
+  [STAT] (job) {
+    job.pending = true
+    this[JOBS] += 1
+    const stat = this.follow ? 'stat' : 'lstat'
+    fs[stat](job.absolute, (er, stat) => {
+      job.pending = false
+      this[JOBS] -= 1
+      if (er)
+        this.emit('error', er)
+      else
+        this[ONSTAT](job, stat)
+    })
+  }
+
+  [ONSTAT] (job, stat) {
+    this.statCache.set(job.absolute, stat)
+    job.stat = stat
+
+    // now we have the stat, we can filter it.
+    if (!this.filter(job.path, stat))
+      job.ignore = true
+
+    this[PROCESS]()
+  }
+
+  [READDIR] (job) {
+    job.pending = true
+    this[JOBS] += 1
+    fs.readdir(job.absolute, (er, entries) => {
+      job.pending = false
+      this[JOBS] -= 1
+      if (er)
+        return this.emit('error', er)
+      this[ONREADDIR](job, entries)
+    })
+  }
+
+  [ONREADDIR] (job, entries) {
+    this.readdirCache.set(job.absolute, entries)
+    job.readdir = entries
+    this[PROCESS]()
+  }
+
+  [PROCESS] () {
+    if (this[PROCESSING])
+      return
+
+    this[PROCESSING] = true
+    for (let w = this[QUEUE].head;
+         w !== null && this[JOBS] < this.jobs;
+         w = w.next) {
+      this[PROCESSJOB](w.value)
+      if (w.value.ignore) {
+        const p = w.next
+        this[QUEUE].removeNode(w)
+        w.next = p
+      }
+    }
+
+    this[PROCESSING] = false
+
+    if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) {
+      if (this.zip)
+        this.zip.end(EOF)
+      else {
+        super.write(EOF)
+        super.end()
+      }
+    }
+  }
+
+  get [CURRENT] () {
+    return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value
+  }
+
+  [JOBDONE] (job) {
+    this[QUEUE].shift()
+    this[JOBS] -= 1
+    this[PROCESS]()
+  }
+
+  [PROCESSJOB] (job) {
+    if (job.pending)
+      return
+
+    if (job.entry) {
+      if (job === this[CURRENT] && !job.piped)
+        this[PIPE](job)
+      return
+    }
+
+    if (!job.stat) {
+      if (this.statCache.has(job.absolute))
+        this[ONSTAT](job, this.statCache.get(job.absolute))
+      else
+        this[STAT](job)
+    }
+    if (!job.stat)
+      return
+
+    // filtered out!
+    if (job.ignore)
+      return
+
+    if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {
+      if (this.readdirCache.has(job.absolute))
+        this[ONREADDIR](job, this.readdirCache.get(job.absolute))
+      else
+        this[READDIR](job)
+      if (!job.readdir)
+        return
+    }
+
+    // we know it doesn't have an entry, because that got checked above
+    job.entry = this[ENTRY](job)
+    if (!job.entry) {
+      job.ignore = true
+      return
+    }
+
+    if (job === this[CURRENT] && !job.piped)
+      this[PIPE](job)
+  }
+
+  [ENTRYOPT] (job) {
+    return {
+      onwarn: (msg, data) => {
+        this.warn(msg, data)
+      },
+      noPax: this.noPax,
+      cwd: this.cwd,
+      absolute: job.absolute,
+      preservePaths: this.preservePaths,
+      maxReadSize: this.maxReadSize,
+      strict: this.strict,
+      portable: this.portable,
+      linkCache: this.linkCache,
+      statCache: this.statCache,
+      noMtime: this.noMtime,
+      mtime: this.mtime
+    }
+  }
+
+  [ENTRY] (job) {
+    this[JOBS] += 1
+    try {
+      return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job))
+        .on('end', () => this[JOBDONE](job))
+        .on('error', er => this.emit('error', er))
+    } catch (er) {
+      this.emit('error', er)
+    }
+  }
+
+  [ONDRAIN] () {
+    if (this[CURRENT] && this[CURRENT].entry)
+      this[CURRENT].entry.resume()
+  }
+
+  // like .pipe() but using super, because our write() is special
+  [PIPE] (job) {
+    job.piped = true
+
+    if (job.readdir)
+      job.readdir.forEach(entry => {
+        const p = this.prefix ?
+          job.path.slice(this.prefix.length + 1) || './'
+          : job.path
+
+        const base = p === './' ? '' : p.replace(/\/*$/, '/')
+        this[ADDFSENTRY](base + entry)
+      })
+
+    const source = job.entry
+    const zip = this.zip
+
+    if (zip)
+      source.on('data', chunk => {
+        if (!zip.write(chunk))
+          source.pause()
+      })
+    else
+      source.on('data', chunk => {
+        if (!super.write(chunk))
+          source.pause()
+      })
+  }
+
+  pause () {
+    if (this.zip)
+      this.zip.pause()
+    return super.pause()
+  }
+})
+
+class PackSync extends Pack {
+  constructor (opt) {
+    super(opt)
+    this[WRITEENTRYCLASS] = WriteEntrySync
+  }
+
+  // pause/resume are no-ops in sync streams.
+  pause () {}
+  resume () {}
+
+  [STAT] (job) {
+    const stat = this.follow ? 'statSync' : 'lstatSync'
+    this[ONSTAT](job, fs[stat](job.absolute))
+  }
+
+  [READDIR] (job, stat) {
+    this[ONREADDIR](job, fs.readdirSync(job.absolute))
+  }
+
+  // gotta get it all in this tick
+  [PIPE] (job) {
+    const source = job.entry
+    const zip = this.zip
+
+    if (job.readdir)
+      job.readdir.forEach(entry => {
+        const p = this.prefix ?
+          job.path.slice(this.prefix.length + 1) || './'
+          : job.path
+
+        const base = p === './' ? '' : p.replace(/\/*$/, '/')
+        this[ADDFSENTRY](base + entry)
+      })
+
+    if (zip)
+      source.on('data', chunk => {
+        zip.write(chunk)
+      })
+    else
+      source.on('data', chunk => {
+        super[WRITE](chunk)
+      })
+  }
+}
+
+Pack.Sync = PackSync
+
+module.exports = Pack
diff --git a/legacy-libs/grpc/node_modules/tar/lib/parse.js b/legacy-libs/grpc/node_modules/tar/lib/parse.js
new file mode 100644 (file)
index 0000000..34e3cd7
--- /dev/null
@@ -0,0 +1,423 @@
+'use strict'
+
+// this[BUFFER] is the remainder of a chunk if we're waiting for
+// the full 512 bytes of a header to come in.  We will Buffer.concat()
+// it to the next write(), which is a mem copy, but a small one.
+//
+// this[QUEUE] is a Yallist of entries that haven't been emitted
+// yet this can only get filled up if the user keeps write()ing after
+// a write() returns false, or does a write() with more than one entry
+//
+// We don't buffer chunks, we always parse them and either create an
+// entry, or push it into the active entry.  The ReadEntry class knows
+// to throw data away if .ignore=true
+//
+// Shift entry off the buffer when it emits 'end', and emit 'entry' for
+// the next one in the list.
+//
+// At any time, we're pushing body chunks into the entry at WRITEENTRY,
+// and waiting for 'end' on the entry at READENTRY
+//
+// ignored entries get .resume() called on them straight away
+
+const warner = require('./warn-mixin.js')
+const path = require('path')
+const Header = require('./header.js')
+const EE = require('events')
+const Yallist = require('yallist')
+const maxMetaEntrySize = 1024 * 1024
+const Entry = require('./read-entry.js')
+const Pax = require('./pax.js')
+const zlib = require('minizlib')
+const Buffer = require('./buffer.js')
+
+const gzipHeader = Buffer.from([0x1f, 0x8b])
+const STATE = Symbol('state')
+const WRITEENTRY = Symbol('writeEntry')
+const READENTRY = Symbol('readEntry')
+const NEXTENTRY = Symbol('nextEntry')
+const PROCESSENTRY = Symbol('processEntry')
+const EX = Symbol('extendedHeader')
+const GEX = Symbol('globalExtendedHeader')
+const META = Symbol('meta')
+const EMITMETA = Symbol('emitMeta')
+const BUFFER = Symbol('buffer')
+const QUEUE = Symbol('queue')
+const ENDED = Symbol('ended')
+const EMITTEDEND = Symbol('emittedEnd')
+const EMIT = Symbol('emit')
+const UNZIP = Symbol('unzip')
+const CONSUMECHUNK = Symbol('consumeChunk')
+const CONSUMECHUNKSUB = Symbol('consumeChunkSub')
+const CONSUMEBODY = Symbol('consumeBody')
+const CONSUMEMETA = Symbol('consumeMeta')
+const CONSUMEHEADER = Symbol('consumeHeader')
+const CONSUMING = Symbol('consuming')
+const BUFFERCONCAT = Symbol('bufferConcat')
+const MAYBEEND = Symbol('maybeEnd')
+const WRITING = Symbol('writing')
+const ABORTED = Symbol('aborted')
+const DONE = Symbol('onDone')
+
+const noop = _ => true
+
+module.exports = warner(class Parser extends EE {
+  constructor (opt) {
+    opt = opt || {}
+    super(opt)
+
+    if (opt.ondone)
+      this.on(DONE, opt.ondone)
+    else
+      this.on(DONE, _ => {
+        this.emit('prefinish')
+        this.emit('finish')
+        this.emit('end')
+        this.emit('close')
+      })
+
+    this.strict = !!opt.strict
+    this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize
+    this.filter = typeof opt.filter === 'function' ? opt.filter : noop
+
+    // have to set this so that streams are ok piping into it
+    this.writable = true
+    this.readable = false
+
+    this[QUEUE] = new Yallist()
+    this[BUFFER] = null
+    this[READENTRY] = null
+    this[WRITEENTRY] = null
+    this[STATE] = 'begin'
+    this[META] = ''
+    this[EX] = null
+    this[GEX] = null
+    this[ENDED] = false
+    this[UNZIP] = null
+    this[ABORTED] = false
+    if (typeof opt.onwarn === 'function')
+      this.on('warn', opt.onwarn)
+    if (typeof opt.onentry === 'function')
+      this.on('entry', opt.onentry)
+  }
+
+  [CONSUMEHEADER] (chunk, position) {
+    const header = new Header(chunk, position, this[EX], this[GEX])
+
+    if (header.nullBlock)
+      this[EMIT]('nullBlock')
+    else if (!header.cksumValid)
+      this.warn('invalid entry', header)
+    else if (!header.path)
+      this.warn('invalid: path is required', header)
+    else {
+      const type = header.type
+      if (/^(Symbolic)?Link$/.test(type) && !header.linkpath)
+        this.warn('invalid: linkpath required', header)
+      else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath)
+        this.warn('invalid: linkpath forbidden', header)
+      else {
+        const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX])
+
+        if (entry.meta) {
+          if (entry.size > this.maxMetaEntrySize) {
+            entry.ignore = true
+            this[EMIT]('ignoredEntry', entry)
+            this[STATE] = 'ignore'
+          } else if (entry.size > 0) {
+            this[META] = ''
+            entry.on('data', c => this[META] += c)
+            this[STATE] = 'meta'
+          }
+        } else {
+
+          this[EX] = null
+          entry.ignore = entry.ignore || !this.filter(entry.path, entry)
+          if (entry.ignore) {
+            this[EMIT]('ignoredEntry', entry)
+            this[STATE] = entry.remain ? 'ignore' : 'begin'
+          } else {
+            if (entry.remain)
+              this[STATE] = 'body'
+            else {
+              this[STATE] = 'begin'
+              entry.end()
+            }
+
+            if (!this[READENTRY]) {
+              this[QUEUE].push(entry)
+              this[NEXTENTRY]()
+            } else
+              this[QUEUE].push(entry)
+          }
+        }
+      }
+    }
+  }
+
+  [PROCESSENTRY] (entry) {
+    let go = true
+
+    if (!entry) {
+      this[READENTRY] = null
+      go = false
+    } else if (Array.isArray(entry))
+      this.emit.apply(this, entry)
+    else {
+      this[READENTRY] = entry
+      this.emit('entry', entry)
+      if (!entry.emittedEnd) {
+        entry.on('end', _ => this[NEXTENTRY]())
+        go = false
+      }
+    }
+
+    return go
+  }
+
+  [NEXTENTRY] () {
+    do {} while (this[PROCESSENTRY](this[QUEUE].shift()))
+
+    if (!this[QUEUE].length) {
+      // At this point, there's nothing in the queue, but we may have an
+      // entry which is being consumed (readEntry).
+      // If we don't, then we definitely can handle more data.
+      // If we do, and either it's flowing, or it has never had any data
+      // written to it, then it needs more.
+      // The only other possibility is that it has returned false from a
+      // write() call, so we wait for the next drain to continue.
+      const re = this[READENTRY]
+      const drainNow = !re || re.flowing || re.size === re.remain
+      if (drainNow) {
+        if (!this[WRITING])
+          this.emit('drain')
+      } else
+        re.once('drain', _ => this.emit('drain'))
+     }
+  }
+
+  [CONSUMEBODY] (chunk, position) {
+    // write up to but no  more than writeEntry.blockRemain
+    const entry = this[WRITEENTRY]
+    const br = entry.blockRemain
+    const c = (br >= chunk.length && position === 0) ? chunk
+      : chunk.slice(position, position + br)
+
+    entry.write(c)
+
+    if (!entry.blockRemain) {
+      this[STATE] = 'begin'
+      this[WRITEENTRY] = null
+      entry.end()
+    }
+
+    return c.length
+  }
+
+  [CONSUMEMETA] (chunk, position) {
+    const entry = this[WRITEENTRY]
+    const ret = this[CONSUMEBODY](chunk, position)
+
+    // if we finished, then the entry is reset
+    if (!this[WRITEENTRY])
+      this[EMITMETA](entry)
+
+    return ret
+  }
+
+  [EMIT] (ev, data, extra) {
+    if (!this[QUEUE].length && !this[READENTRY])
+      this.emit(ev, data, extra)
+    else
+      this[QUEUE].push([ev, data, extra])
+  }
+
+  [EMITMETA] (entry) {
+    this[EMIT]('meta', this[META])
+    switch (entry.type) {
+      case 'ExtendedHeader':
+      case 'OldExtendedHeader':
+        this[EX] = Pax.parse(this[META], this[EX], false)
+        break
+
+      case 'GlobalExtendedHeader':
+        this[GEX] = Pax.parse(this[META], this[GEX], true)
+        break
+
+      case 'NextFileHasLongPath':
+      case 'OldGnuLongPath':
+        this[EX] = this[EX] || Object.create(null)
+        this[EX].path = this[META].replace(/\0.*/, '')
+        break
+
+      case 'NextFileHasLongLinkpath':
+        this[EX] = this[EX] || Object.create(null)
+        this[EX].linkpath = this[META].replace(/\0.*/, '')
+        break
+
+      /* istanbul ignore next */
+      default: throw new Error('unknown meta: ' + entry.type)
+    }
+  }
+
+  abort (msg, error) {
+    this[ABORTED] = true
+    this.warn(msg, error)
+    this.emit('abort', error)
+    this.emit('error', error)
+  }
+
+  write (chunk) {
+    if (this[ABORTED])
+      return
+
+    // first write, might be gzipped
+    if (this[UNZIP] === null && chunk) {
+      if (this[BUFFER]) {
+        chunk = Buffer.concat([this[BUFFER], chunk])
+        this[BUFFER] = null
+      }
+      if (chunk.length < gzipHeader.length) {
+        this[BUFFER] = chunk
+        return true
+      }
+      for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {
+        if (chunk[i] !== gzipHeader[i])
+          this[UNZIP] = false
+      }
+      if (this[UNZIP] === null) {
+        const ended = this[ENDED]
+        this[ENDED] = false
+        this[UNZIP] = new zlib.Unzip()
+        this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk))
+        this[UNZIP].on('error', er =>
+          this.abort(er.message, er))
+        this[UNZIP].on('end', _ => {
+          this[ENDED] = true
+          this[CONSUMECHUNK]()
+        })
+        this[WRITING] = true
+        const ret = this[UNZIP][ended ? 'end' : 'write' ](chunk)
+        this[WRITING] = false
+        return ret
+      }
+    }
+
+    this[WRITING] = true
+    if (this[UNZIP])
+      this[UNZIP].write(chunk)
+    else
+      this[CONSUMECHUNK](chunk)
+    this[WRITING] = false
+
+    // return false if there's a queue, or if the current entry isn't flowing
+    const ret =
+      this[QUEUE].length ? false :
+      this[READENTRY] ? this[READENTRY].flowing :
+      true
+
+    // if we have no queue, then that means a clogged READENTRY
+    if (!ret && !this[QUEUE].length)
+      this[READENTRY].once('drain', _ => this.emit('drain'))
+
+    return ret
+  }
+
+  [BUFFERCONCAT] (c) {
+    if (c && !this[ABORTED])
+      this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c
+  }
+
+  [MAYBEEND] () {
+    if (this[ENDED] &&
+        !this[EMITTEDEND] &&
+        !this[ABORTED] &&
+        !this[CONSUMING]) {
+      this[EMITTEDEND] = true
+      const entry = this[WRITEENTRY]
+      if (entry && entry.blockRemain) {
+        const have = this[BUFFER] ? this[BUFFER].length : 0
+        this.warn('Truncated input (needed ' + entry.blockRemain +
+                  ' more bytes, only ' + have + ' available)', entry)
+        if (this[BUFFER])
+          entry.write(this[BUFFER])
+        entry.end()
+      }
+      this[EMIT](DONE)
+    }
+  }
+
+  [CONSUMECHUNK] (chunk) {
+    if (this[CONSUMING]) {
+      this[BUFFERCONCAT](chunk)
+    } else if (!chunk && !this[BUFFER]) {
+      this[MAYBEEND]()
+    } else {
+      this[CONSUMING] = true
+      if (this[BUFFER]) {
+        this[BUFFERCONCAT](chunk)
+        const c = this[BUFFER]
+        this[BUFFER] = null
+        this[CONSUMECHUNKSUB](c)
+      } else {
+        this[CONSUMECHUNKSUB](chunk)
+      }
+
+      while (this[BUFFER] && this[BUFFER].length >= 512 && !this[ABORTED]) {
+        const c = this[BUFFER]
+        this[BUFFER] = null
+        this[CONSUMECHUNKSUB](c)
+      }
+      this[CONSUMING] = false
+    }
+
+    if (!this[BUFFER] || this[ENDED])
+      this[MAYBEEND]()
+  }
+
+  [CONSUMECHUNKSUB] (chunk) {
+    // we know that we are in CONSUMING mode, so anything written goes into
+    // the buffer.  Advance the position and put any remainder in the buffer.
+    let position = 0
+    let length = chunk.length
+    while (position + 512 <= length && !this[ABORTED]) {
+      switch (this[STATE]) {
+        case 'begin':
+          this[CONSUMEHEADER](chunk, position)
+          position += 512
+          break
+
+        case 'ignore':
+        case 'body':
+          position += this[CONSUMEBODY](chunk, position)
+          break
+
+        case 'meta':
+          position += this[CONSUMEMETA](chunk, position)
+          break
+
+        /* istanbul ignore next */
+        default:
+          throw new Error('invalid state: ' + this[STATE])
+      }
+    }
+
+    if (position < length) {
+      if (this[BUFFER])
+        this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]])
+      else
+        this[BUFFER] = chunk.slice(position)
+    }
+  }
+
+  end (chunk) {
+    if (!this[ABORTED]) {
+      if (this[UNZIP])
+        this[UNZIP].end(chunk)
+      else {
+        this[ENDED] = true
+        this.write(chunk)
+      }
+    }
+  }
+})
diff --git a/legacy-libs/grpc/node_modules/tar/lib/pax.js b/legacy-libs/grpc/node_modules/tar/lib/pax.js
new file mode 100644 (file)
index 0000000..9d7e4ab
--- /dev/null
@@ -0,0 +1,146 @@
+'use strict'
+const Buffer = require('./buffer.js')
+const Header = require('./header.js')
+const path = require('path')
+
+class Pax {
+  constructor (obj, global) {
+    this.atime = obj.atime || null
+    this.charset = obj.charset || null
+    this.comment = obj.comment || null
+    this.ctime = obj.ctime || null
+    this.gid = obj.gid || null
+    this.gname = obj.gname || null
+    this.linkpath = obj.linkpath || null
+    this.mtime = obj.mtime || null
+    this.path = obj.path || null
+    this.size = obj.size || null
+    this.uid = obj.uid || null
+    this.uname = obj.uname || null
+    this.dev = obj.dev || null
+    this.ino = obj.ino || null
+    this.nlink = obj.nlink || null
+    this.global = global || false
+  }
+
+  encode () {
+    const body = this.encodeBody()
+    if (body === '')
+      return null
+
+    const bodyLen = Buffer.byteLength(body)
+    // round up to 512 bytes
+    // add 512 for header
+    const bufLen = 512 * Math.ceil(1 + bodyLen / 512)
+    const buf = Buffer.allocUnsafe(bufLen)
+
+    // 0-fill the header section, it might not hit every field
+    for (let i = 0; i < 512; i++) {
+      buf[i] = 0
+    }
+
+    new Header({
+      // XXX split the path
+      // then the path should be PaxHeader + basename, but less than 99,
+      // prepend with the dirname
+      path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99),
+      mode: this.mode || 0o644,
+      uid: this.uid || null,
+      gid: this.gid || null,
+      size: bodyLen,
+      mtime: this.mtime || null,
+      type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader',
+      linkpath: '',
+      uname: this.uname || '',
+      gname: this.gname || '',
+      devmaj: 0,
+      devmin: 0,
+      atime: this.atime || null,
+      ctime: this.ctime || null
+    }).encode(buf)
+
+    buf.write(body, 512, bodyLen, 'utf8')
+
+    // null pad after the body
+    for (let i = bodyLen + 512; i < buf.length; i++) {
+      buf[i] = 0
+    }
+
+    return buf
+  }
+
+  encodeBody () {
+    return (
+      this.encodeField('path') +
+      this.encodeField('ctime') +
+      this.encodeField('atime') +
+      this.encodeField('dev') +
+      this.encodeField('ino') +
+      this.encodeField('nlink') +
+      this.encodeField('charset') +
+      this.encodeField('comment') +
+      this.encodeField('gid') +
+      this.encodeField('gname') +
+      this.encodeField('linkpath') +
+      this.encodeField('mtime') +
+      this.encodeField('size') +
+      this.encodeField('uid') +
+      this.encodeField('uname')
+    )
+  }
+
+  encodeField (field) {
+    if (this[field] === null || this[field] === undefined)
+      return ''
+    const v = this[field] instanceof Date ? this[field].getTime() / 1000
+      : this[field]
+    const s = ' ' +
+      (field === 'dev' || field === 'ino' || field === 'nlink'
+       ? 'SCHILY.' : '') +
+      field + '=' + v + '\n'
+    const byteLen = Buffer.byteLength(s)
+    // the digits includes the length of the digits in ascii base-10
+    // so if it's 9 characters, then adding 1 for the 9 makes it 10
+    // which makes it 11 chars.
+    let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1
+    if (byteLen + digits >= Math.pow(10, digits))
+      digits += 1
+    const len = digits + byteLen
+    return len + s
+  }
+}
+
+Pax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g)
+
+const merge = (a, b) =>
+  b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a
+
+const parseKV = string =>
+  string
+    .replace(/\n$/, '')
+    .split('\n')
+    .reduce(parseKVLine, Object.create(null))
+
+const parseKVLine = (set, line) => {
+  const n = parseInt(line, 10)
+
+  // XXX Values with \n in them will fail this.
+  // Refactor to not be a naive line-by-line parse.
+  if (n !== Buffer.byteLength(line) + 1)
+    return set
+
+  line = line.substr((n + ' ').length)
+  const kv = line.split('=')
+  const k = kv.shift().replace(/^SCHILY\.(dev|ino|nlink)/, '$1')
+  if (!k)
+    return set
+
+  const v = kv.join('=')
+  set[k] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(k)
+    ?  new Date(v * 1000)
+    : /^[0-9]+$/.test(v) ? +v
+    : v
+  return set
+}
+
+module.exports = Pax
diff --git a/legacy-libs/grpc/node_modules/tar/lib/read-entry.js b/legacy-libs/grpc/node_modules/tar/lib/read-entry.js
new file mode 100644 (file)
index 0000000..aa369c7
--- /dev/null
@@ -0,0 +1,94 @@
+'use strict'
+const types = require('./types.js')
+const MiniPass = require('minipass')
+
+const SLURP = Symbol('slurp')
+module.exports = class ReadEntry extends MiniPass {
+  constructor (header, ex, gex) {
+    super()
+    this.extended = ex
+    this.globalExtended = gex
+    this.header = header
+    this.startBlockSize = 512 * Math.ceil(header.size / 512)
+    this.blockRemain = this.startBlockSize
+    this.remain = header.size
+    this.type = header.type
+    this.meta = false
+    this.ignore = false
+    switch (this.type) {
+      case 'File':
+      case 'OldFile':
+      case 'Link':
+      case 'SymbolicLink':
+      case 'CharacterDevice':
+      case 'BlockDevice':
+      case 'Directory':
+      case 'FIFO':
+      case 'ContiguousFile':
+      case 'GNUDumpDir':
+        break
+
+      case 'NextFileHasLongLinkpath':
+      case 'NextFileHasLongPath':
+      case 'OldGnuLongPath':
+      case 'GlobalExtendedHeader':
+      case 'ExtendedHeader':
+      case 'OldExtendedHeader':
+        this.meta = true
+        break
+
+      // NOTE: gnutar and bsdtar treat unrecognized types as 'File'
+      // it may be worth doing the same, but with a warning.
+      default:
+        this.ignore = true
+    }
+
+    this.path = header.path
+    this.mode = header.mode
+    if (this.mode)
+      this.mode = this.mode & 0o7777
+    this.uid = header.uid
+    this.gid = header.gid
+    this.uname = header.uname
+    this.gname = header.gname
+    this.size = header.size
+    this.mtime = header.mtime
+    this.atime = header.atime
+    this.ctime = header.ctime
+    this.linkpath = header.linkpath
+    this.uname = header.uname
+    this.gname = header.gname
+
+    if (ex) this[SLURP](ex)
+    if (gex) this[SLURP](gex, true)
+  }
+
+  write (data) {
+    const writeLen = data.length
+    if (writeLen > this.blockRemain)
+      throw new Error('writing more to entry than is appropriate')
+
+    const r = this.remain
+    const br = this.blockRemain
+    this.remain = Math.max(0, r - writeLen)
+    this.blockRemain = Math.max(0, br - writeLen)
+    if (this.ignore)
+      return true
+
+    if (r >= writeLen)
+      return super.write(data)
+
+    // r < writeLen
+    return super.write(data.slice(0, r))
+  }
+
+  [SLURP] (ex, global) {
+    for (let k in ex) {
+      // we slurp in everything except for the path attribute in
+      // a global extended header, because that's weird.
+      if (ex[k] !== null && ex[k] !== undefined &&
+          !(global && k === 'path'))
+        this[k] = ex[k]
+    }
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/replace.js b/legacy-libs/grpc/node_modules/tar/lib/replace.js
new file mode 100644 (file)
index 0000000..571cee9
--- /dev/null
@@ -0,0 +1,220 @@
+'use strict'
+const Buffer = require('./buffer.js')
+
+// tar -r
+const hlo = require('./high-level-opt.js')
+const Pack = require('./pack.js')
+const Parse = require('./parse.js')
+const fs = require('fs')
+const fsm = require('fs-minipass')
+const t = require('./list.js')
+const path = require('path')
+
+// starting at the head of the file, read a Header
+// If the checksum is invalid, that's our position to start writing
+// If it is, jump forward by the specified size (round up to 512)
+// and try again.
+// Write the new Pack stream starting there.
+
+const Header = require('./header.js')
+
+const r = module.exports = (opt_, files, cb) => {
+  const opt = hlo(opt_)
+
+  if (!opt.file)
+    throw new TypeError('file is required')
+
+  if (opt.gzip)
+    throw new TypeError('cannot append to compressed archives')
+
+  if (!files || !Array.isArray(files) || !files.length)
+    throw new TypeError('no files or directories specified')
+
+  files = Array.from(files)
+
+  return opt.sync ? replaceSync(opt, files)
+    : replace(opt, files, cb)
+}
+
+const replaceSync = (opt, files) => {
+  const p = new Pack.Sync(opt)
+
+  let threw = true
+  let fd
+  let position
+
+  try {
+    try {
+      fd = fs.openSync(opt.file, 'r+')
+    } catch (er) {
+      if (er.code === 'ENOENT')
+        fd = fs.openSync(opt.file, 'w+')
+      else
+        throw er
+    }
+
+    const st = fs.fstatSync(fd)
+    const headBuf = Buffer.alloc(512)
+
+    POSITION: for (position = 0; position < st.size; position += 512) {
+      for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {
+        bytes = fs.readSync(
+          fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos
+        )
+
+        if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)
+          throw new Error('cannot append to compressed archives')
+
+        if (!bytes)
+          break POSITION
+      }
+
+      let h = new Header(headBuf)
+      if (!h.cksumValid)
+        break
+      let entryBlockSize = 512 * Math.ceil(h.size / 512)
+      if (position + entryBlockSize + 512 > st.size)
+        break
+      // the 512 for the header we just parsed will be added as well
+      // also jump ahead all the blocks for the body
+      position += entryBlockSize
+      if (opt.mtimeCache)
+        opt.mtimeCache.set(h.path, h.mtime)
+    }
+    threw = false
+
+    streamSync(opt, p, position, fd, files)
+  } finally {
+    if (threw)
+      try { fs.closeSync(fd) } catch (er) {}
+  }
+}
+
+const streamSync = (opt, p, position, fd, files) => {
+  const stream = new fsm.WriteStreamSync(opt.file, {
+    fd: fd,
+    start: position
+  })
+  p.pipe(stream)
+  addFilesSync(p, files)
+}
+
+const replace = (opt, files, cb) => {
+  files = Array.from(files)
+  const p = new Pack(opt)
+
+  const getPos = (fd, size, cb_) => {
+    const cb = (er, pos) => {
+      if (er)
+        fs.close(fd, _ => cb_(er))
+      else
+        cb_(null, pos)
+    }
+
+    let position = 0
+    if (size === 0)
+      return cb(null, 0)
+
+    let bufPos = 0
+    const headBuf = Buffer.alloc(512)
+    const onread = (er, bytes) => {
+      if (er)
+        return cb(er)
+      bufPos += bytes
+      if (bufPos < 512 && bytes)
+        return fs.read(
+          fd, headBuf, bufPos, headBuf.length - bufPos,
+          position + bufPos, onread
+        )
+
+      if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)
+        return cb(new Error('cannot append to compressed archives'))
+
+      // truncated header
+      if (bufPos < 512)
+        return cb(null, position)
+
+      const h = new Header(headBuf)
+      if (!h.cksumValid)
+        return cb(null, position)
+
+      const entryBlockSize = 512 * Math.ceil(h.size / 512)
+      if (position + entryBlockSize + 512 > size)
+        return cb(null, position)
+
+      position += entryBlockSize + 512
+      if (position >= size)
+        return cb(null, position)
+
+      if (opt.mtimeCache)
+        opt.mtimeCache.set(h.path, h.mtime)
+      bufPos = 0
+      fs.read(fd, headBuf, 0, 512, position, onread)
+    }
+    fs.read(fd, headBuf, 0, 512, position, onread)
+  }
+
+  const promise = new Promise((resolve, reject) => {
+    p.on('error', reject)
+    let flag = 'r+'
+    const onopen = (er, fd) => {
+      if (er && er.code === 'ENOENT' && flag === 'r+') {
+        flag = 'w+'
+        return fs.open(opt.file, flag, onopen)
+      }
+
+      if (er)
+        return reject(er)
+
+      fs.fstat(fd, (er, st) => {
+        if (er)
+          return reject(er)
+        getPos(fd, st.size, (er, position) => {
+          if (er)
+            return reject(er)
+          const stream = new fsm.WriteStream(opt.file, {
+            fd: fd,
+            start: position
+          })
+          p.pipe(stream)
+          stream.on('error', reject)
+          stream.on('close', resolve)
+          addFilesAsync(p, files)
+        })
+      })
+    }
+    fs.open(opt.file, flag, onopen)
+  })
+
+  return cb ? promise.then(cb, cb) : promise
+}
+
+const addFilesSync = (p, files) => {
+  files.forEach(file => {
+    if (file.charAt(0) === '@')
+      t({
+        file: path.resolve(p.cwd, file.substr(1)),
+        sync: true,
+        noResume: true,
+        onentry: entry => p.add(entry)
+      })
+    else
+      p.add(file)
+  })
+  p.end()
+}
+
+const addFilesAsync = (p, files) => {
+  while (files.length) {
+    const file = files.shift()
+    if (file.charAt(0) === '@')
+      return t({
+        file: path.resolve(p.cwd, file.substr(1)),
+        noResume: true,
+        onentry: entry => p.add(entry)
+      }).then(_ => addFilesAsync(p, files))
+    else
+      p.add(file)
+  }
+  p.end()
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/types.js b/legacy-libs/grpc/node_modules/tar/lib/types.js
new file mode 100644 (file)
index 0000000..df42565
--- /dev/null
@@ -0,0 +1,44 @@
+'use strict'
+// map types from key to human-friendly name
+exports.name = new Map([
+  ['0', 'File'],
+  // same as File
+  ['', 'OldFile'],
+  ['1', 'Link'],
+  ['2', 'SymbolicLink'],
+  // Devices and FIFOs aren't fully supported
+  // they are parsed, but skipped when unpacking
+  ['3', 'CharacterDevice'],
+  ['4', 'BlockDevice'],
+  ['5', 'Directory'],
+  ['6', 'FIFO'],
+  // same as File
+  ['7', 'ContiguousFile'],
+  // pax headers
+  ['g', 'GlobalExtendedHeader'],
+  ['x', 'ExtendedHeader'],
+  // vendor-specific stuff
+  // skip
+  ['A', 'SolarisACL'],
+  // like 5, but with data, which should be skipped
+  ['D', 'GNUDumpDir'],
+  // metadata only, skip
+  ['I', 'Inode'],
+  // data = link path of next file
+  ['K', 'NextFileHasLongLinkpath'],
+  // data = path of next file
+  ['L', 'NextFileHasLongPath'],
+  // skip
+  ['M', 'ContinuationFile'],
+  // like L
+  ['N', 'OldGnuLongPath'],
+  // skip
+  ['S', 'SparseFile'],
+  // skip
+  ['V', 'TapeVolumeHeader'],
+  // like x
+  ['X', 'OldExtendedHeader']
+])
+
+// map the other direction
+exports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]]))
diff --git a/legacy-libs/grpc/node_modules/tar/lib/unpack.js b/legacy-libs/grpc/node_modules/tar/lib/unpack.js
new file mode 100644 (file)
index 0000000..fc76509
--- /dev/null
@@ -0,0 +1,621 @@
+'use strict'
+
+const assert = require('assert')
+const EE = require('events').EventEmitter
+const Parser = require('./parse.js')
+const fs = require('fs')
+const fsm = require('fs-minipass')
+const path = require('path')
+const mkdir = require('./mkdir.js')
+const mkdirSync = mkdir.sync
+const wc = require('./winchars.js')
+
+const ONENTRY = Symbol('onEntry')
+const CHECKFS = Symbol('checkFs')
+const ISREUSABLE = Symbol('isReusable')
+const MAKEFS = Symbol('makeFs')
+const FILE = Symbol('file')
+const DIRECTORY = Symbol('directory')
+const LINK = Symbol('link')
+const SYMLINK = Symbol('symlink')
+const HARDLINK = Symbol('hardlink')
+const UNSUPPORTED = Symbol('unsupported')
+const UNKNOWN = Symbol('unknown')
+const CHECKPATH = Symbol('checkPath')
+const MKDIR = Symbol('mkdir')
+const ONERROR = Symbol('onError')
+const PENDING = Symbol('pending')
+const PEND = Symbol('pend')
+const UNPEND = Symbol('unpend')
+const ENDED = Symbol('ended')
+const MAYBECLOSE = Symbol('maybeClose')
+const SKIP = Symbol('skip')
+const DOCHOWN = Symbol('doChown')
+const UID = Symbol('uid')
+const GID = Symbol('gid')
+const crypto = require('crypto')
+
+// Unlinks on Windows are not atomic.
+//
+// This means that if you have a file entry, followed by another
+// file entry with an identical name, and you cannot re-use the file
+// (because it's a hardlink, or because unlink:true is set, or it's
+// Windows, which does not have useful nlink values), then the unlink
+// will be committed to the disk AFTER the new file has been written
+// over the old one, deleting the new file.
+//
+// To work around this, on Windows systems, we rename the file and then
+// delete the renamed file.  It's a sloppy kludge, but frankly, I do not
+// know of a better way to do this, given windows' non-atomic unlink
+// semantics.
+//
+// See: https://github.com/npm/node-tar/issues/183
+/* istanbul ignore next */
+const unlinkFile = (path, cb) => {
+  if (process.platform !== 'win32')
+    return fs.unlink(path, cb)
+
+  const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')
+  fs.rename(path, name, er => {
+    if (er)
+      return cb(er)
+    fs.unlink(name, cb)
+  })
+}
+
+/* istanbul ignore next */
+const unlinkFileSync = path => {
+  if (process.platform !== 'win32')
+    return fs.unlinkSync(path)
+
+  const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')
+  fs.renameSync(path, name)
+  fs.unlinkSync(name)
+}
+
+// this.gid, entry.gid, this.processUid
+const uint32 = (a, b, c) =>
+  a === a >>> 0 ? a
+  : b === b >>> 0 ? b
+  : c
+
+class Unpack extends Parser {
+  constructor (opt) {
+    if (!opt)
+      opt = {}
+
+    opt.ondone = _ => {
+      this[ENDED] = true
+      this[MAYBECLOSE]()
+    }
+
+    super(opt)
+
+    this.transform = typeof opt.transform === 'function' ? opt.transform : null
+
+    this.writable = true
+    this.readable = false
+
+    this[PENDING] = 0
+    this[ENDED] = false
+
+    this.dirCache = opt.dirCache || new Map()
+
+    if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {
+      // need both or neither
+      if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number')
+        throw new TypeError('cannot set owner without number uid and gid')
+      if (opt.preserveOwner)
+        throw new TypeError(
+          'cannot preserve owner in archive and also set owner explicitly')
+      this.uid = opt.uid
+      this.gid = opt.gid
+      this.setOwner = true
+    } else {
+      this.uid = null
+      this.gid = null
+      this.setOwner = false
+    }
+
+    // default true for root
+    if (opt.preserveOwner === undefined && typeof opt.uid !== 'number')
+      this.preserveOwner = process.getuid && process.getuid() === 0
+    else
+      this.preserveOwner = !!opt.preserveOwner
+
+    this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ?
+      process.getuid() : null
+    this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ?
+      process.getgid() : null
+
+    // mostly just for testing, but useful in some cases.
+    // Forcibly trigger a chown on every entry, no matter what
+    this.forceChown = opt.forceChown === true
+
+    // turn ><?| in filenames into 0xf000-higher encoded forms
+    this.win32 = !!opt.win32 || process.platform === 'win32'
+
+    // do not unpack over files that are newer than what's in the archive
+    this.newer = !!opt.newer
+
+    // do not unpack over ANY files
+    this.keep = !!opt.keep
+
+    // do not set mtime/atime of extracted entries
+    this.noMtime = !!opt.noMtime
+
+    // allow .., absolute path entries, and unpacking through symlinks
+    // without this, warn and skip .., relativize absolutes, and error
+    // on symlinks in extraction path
+    this.preservePaths = !!opt.preservePaths
+
+    // unlink files and links before writing. This breaks existing hard
+    // links, and removes symlink directories rather than erroring
+    this.unlink = !!opt.unlink
+
+    this.cwd = path.resolve(opt.cwd || process.cwd())
+    this.strip = +opt.strip || 0
+    this.processUmask = process.umask()
+    this.umask = typeof opt.umask === 'number' ? opt.umask : this.processUmask
+    // default mode for dirs created as parents
+    this.dmode = opt.dmode || (0o0777 & (~this.umask))
+    this.fmode = opt.fmode || (0o0666 & (~this.umask))
+    this.on('entry', entry => this[ONENTRY](entry))
+  }
+
+  [MAYBECLOSE] () {
+    if (this[ENDED] && this[PENDING] === 0) {
+      this.emit('prefinish')
+      this.emit('finish')
+      this.emit('end')
+      this.emit('close')
+    }
+  }
+
+  [CHECKPATH] (entry) {
+    if (this.strip) {
+      const parts = entry.path.split(/\/|\\/)
+      if (parts.length < this.strip)
+        return false
+      entry.path = parts.slice(this.strip).join('/')
+
+      if (entry.type === 'Link') {
+        const linkparts = entry.linkpath.split(/\/|\\/)
+        if (linkparts.length >= this.strip)
+          entry.linkpath = linkparts.slice(this.strip).join('/')
+      }
+    }
+
+    if (!this.preservePaths) {
+      const p = entry.path
+      if (p.match(/(^|\/|\\)\.\.(\\|\/|$)/)) {
+        this.warn('path contains \'..\'', p)
+        return false
+      }
+
+      // absolutes on posix are also absolutes on win32
+      // so we only need to test this one to get both
+      if (path.win32.isAbsolute(p)) {
+        const parsed = path.win32.parse(p)
+        this.warn('stripping ' + parsed.root + ' from absolute path', p)
+        entry.path = p.substr(parsed.root.length)
+      }
+    }
+
+    // only encode : chars that aren't drive letter indicators
+    if (this.win32) {
+      const parsed = path.win32.parse(entry.path)
+      entry.path = parsed.root === '' ? wc.encode(entry.path)
+        : parsed.root + wc.encode(entry.path.substr(parsed.root.length))
+    }
+
+    if (path.isAbsolute(entry.path))
+      entry.absolute = entry.path
+    else
+      entry.absolute = path.resolve(this.cwd, entry.path)
+
+    return true
+  }
+
+  [ONENTRY] (entry) {
+    if (!this[CHECKPATH](entry))
+      return entry.resume()
+
+    assert.equal(typeof entry.absolute, 'string')
+
+    switch (entry.type) {
+      case 'Directory':
+      case 'GNUDumpDir':
+        if (entry.mode)
+          entry.mode = entry.mode | 0o700
+
+      case 'File':
+      case 'OldFile':
+      case 'ContiguousFile':
+      case 'Link':
+      case 'SymbolicLink':
+        return this[CHECKFS](entry)
+
+      case 'CharacterDevice':
+      case 'BlockDevice':
+      case 'FIFO':
+        return this[UNSUPPORTED](entry)
+    }
+  }
+
+  [ONERROR] (er, entry) {
+    // Cwd has to exist, or else nothing works. That's serious.
+    // Other errors are warnings, which raise the error in strict
+    // mode, but otherwise continue on.
+    if (er.name === 'CwdError')
+      this.emit('error', er)
+    else {
+      this.warn(er.message, er)
+      this[UNPEND]()
+      entry.resume()
+    }
+  }
+
+  [MKDIR] (dir, mode, cb) {
+    mkdir(dir, {
+      uid: this.uid,
+      gid: this.gid,
+      processUid: this.processUid,
+      processGid: this.processGid,
+      umask: this.processUmask,
+      preserve: this.preservePaths,
+      unlink: this.unlink,
+      cache: this.dirCache,
+      cwd: this.cwd,
+      mode: mode
+    }, cb)
+  }
+
+  [DOCHOWN] (entry) {
+    // in preserve owner mode, chown if the entry doesn't match process
+    // in set owner mode, chown if setting doesn't match process
+    return this.forceChown ||
+      this.preserveOwner &&
+      ( typeof entry.uid === 'number' && entry.uid !== this.processUid ||
+        typeof entry.gid === 'number' && entry.gid !== this.processGid )
+      ||
+      ( typeof this.uid === 'number' && this.uid !== this.processUid ||
+        typeof this.gid === 'number' && this.gid !== this.processGid )
+  }
+
+  [UID] (entry) {
+    return uint32(this.uid, entry.uid, this.processUid)
+  }
+
+  [GID] (entry) {
+    return uint32(this.gid, entry.gid, this.processGid)
+  }
+
+  [FILE] (entry) {
+    const mode = entry.mode & 0o7777 || this.fmode
+    const stream = new fsm.WriteStream(entry.absolute, {
+      mode: mode,
+      autoClose: false
+    })
+    stream.on('error', er => this[ONERROR](er, entry))
+
+    let actions = 1
+    const done = er => {
+      if (er)
+        return this[ONERROR](er, entry)
+
+      if (--actions === 0)
+        fs.close(stream.fd, _ => this[UNPEND]())
+    }
+
+    stream.on('finish', _ => {
+      // if futimes fails, try utimes
+      // if utimes fails, fail with the original error
+      // same for fchown/chown
+      const abs = entry.absolute
+      const fd = stream.fd
+
+      if (entry.mtime && !this.noMtime) {
+        actions++
+        const atime = entry.atime || new Date()
+        const mtime = entry.mtime
+        fs.futimes(fd, atime, mtime, er =>
+          er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er))
+          : done())
+      }
+
+      if (this[DOCHOWN](entry)) {
+        actions++
+        const uid = this[UID](entry)
+        const gid = this[GID](entry)
+        fs.fchown(fd, uid, gid, er =>
+          er ? fs.chown(abs, uid, gid, er2 => done(er2 && er))
+          : done())
+      }
+
+      done()
+    })
+
+    const tx = this.transform ? this.transform(entry) || entry : entry
+    if (tx !== entry) {
+      tx.on('error', er => this[ONERROR](er, entry))
+      entry.pipe(tx)
+    }
+    tx.pipe(stream)
+  }
+
+  [DIRECTORY] (entry) {
+    const mode = entry.mode & 0o7777 || this.dmode
+    this[MKDIR](entry.absolute, mode, er => {
+      if (er)
+        return this[ONERROR](er, entry)
+
+      let actions = 1
+      const done = _ => {
+        if (--actions === 0) {
+          this[UNPEND]()
+          entry.resume()
+        }
+      }
+
+      if (entry.mtime && !this.noMtime) {
+        actions++
+        fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done)
+      }
+
+      if (this[DOCHOWN](entry)) {
+        actions++
+        fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done)
+      }
+
+      done()
+    })
+  }
+
+  [UNSUPPORTED] (entry) {
+    this.warn('unsupported entry type: ' + entry.type, entry)
+    entry.resume()
+  }
+
+  [SYMLINK] (entry) {
+    this[LINK](entry, entry.linkpath, 'symlink')
+  }
+
+  [HARDLINK] (entry) {
+    this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link')
+  }
+
+  [PEND] () {
+    this[PENDING]++
+  }
+
+  [UNPEND] () {
+    this[PENDING]--
+    this[MAYBECLOSE]()
+  }
+
+  [SKIP] (entry) {
+    this[UNPEND]()
+    entry.resume()
+  }
+
+  // Check if we can reuse an existing filesystem entry safely and
+  // overwrite it, rather than unlinking and recreating
+  // Windows doesn't report a useful nlink, so we just never reuse entries
+  [ISREUSABLE] (entry, st) {
+    return entry.type === 'File' &&
+      !this.unlink &&
+      st.isFile() &&
+      st.nlink <= 1 &&
+      process.platform !== 'win32'
+  }
+
+  // check if a thing is there, and if so, try to clobber it
+  [CHECKFS] (entry) {
+    this[PEND]()
+    this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {
+      if (er)
+        return this[ONERROR](er, entry)
+      fs.lstat(entry.absolute, (er, st) => {
+        if (st && (this.keep || this.newer && st.mtime > entry.mtime))
+          this[SKIP](entry)
+        else if (er || this[ISREUSABLE](entry, st))
+          this[MAKEFS](null, entry)
+        else if (st.isDirectory()) {
+          if (entry.type === 'Directory') {
+            if (!entry.mode || (st.mode & 0o7777) === entry.mode)
+              this[MAKEFS](null, entry)
+            else
+              fs.chmod(entry.absolute, entry.mode, er => this[MAKEFS](er, entry))
+          } else
+            fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry))
+        } else
+          unlinkFile(entry.absolute, er => this[MAKEFS](er, entry))
+      })
+    })
+  }
+
+  [MAKEFS] (er, entry) {
+    if (er)
+      return this[ONERROR](er, entry)
+
+    switch (entry.type) {
+      case 'File':
+      case 'OldFile':
+      case 'ContiguousFile':
+        return this[FILE](entry)
+
+      case 'Link':
+        return this[HARDLINK](entry)
+
+      case 'SymbolicLink':
+        return this[SYMLINK](entry)
+
+      case 'Directory':
+      case 'GNUDumpDir':
+        return this[DIRECTORY](entry)
+    }
+  }
+
+  [LINK] (entry, linkpath, link) {
+    // XXX: get the type ('file' or 'dir') for windows
+    fs[link](linkpath, entry.absolute, er => {
+      if (er)
+        return this[ONERROR](er, entry)
+      this[UNPEND]()
+      entry.resume()
+    })
+  }
+}
+
+class UnpackSync extends Unpack {
+  constructor (opt) {
+    super(opt)
+  }
+
+  [CHECKFS] (entry) {
+    const er = this[MKDIR](path.dirname(entry.absolute), this.dmode)
+    if (er)
+      return this[ONERROR](er, entry)
+    try {
+      const st = fs.lstatSync(entry.absolute)
+      if (this.keep || this.newer && st.mtime > entry.mtime)
+        return this[SKIP](entry)
+      else if (this[ISREUSABLE](entry, st))
+        return this[MAKEFS](null, entry)
+      else {
+        try {
+          if (st.isDirectory()) {
+            if (entry.type === 'Directory') {
+              if (entry.mode && (st.mode & 0o7777) !== entry.mode)
+                fs.chmodSync(entry.absolute, entry.mode)
+            } else
+              fs.rmdirSync(entry.absolute)
+          } else
+            unlinkFileSync(entry.absolute)
+          return this[MAKEFS](null, entry)
+        } catch (er) {
+          return this[ONERROR](er, entry)
+        }
+      }
+    } catch (er) {
+      return this[MAKEFS](null, entry)
+    }
+  }
+
+  [FILE] (entry) {
+    const mode = entry.mode & 0o7777 || this.fmode
+
+    const oner = er => {
+      try { fs.closeSync(fd) } catch (_) {}
+      if (er)
+        this[ONERROR](er, entry)
+    }
+
+    let stream
+    let fd
+    try {
+      fd = fs.openSync(entry.absolute, 'w', mode)
+    } catch (er) {
+      return oner(er)
+    }
+    const tx = this.transform ? this.transform(entry) || entry : entry
+    if (tx !== entry) {
+      tx.on('error', er => this[ONERROR](er, entry))
+      entry.pipe(tx)
+    }
+
+    tx.on('data', chunk => {
+      try {
+        fs.writeSync(fd, chunk, 0, chunk.length)
+      } catch (er) {
+        oner(er)
+      }
+    })
+
+    tx.on('end', _ => {
+      let er = null
+      // try both, falling futimes back to utimes
+      // if either fails, handle the first error
+      if (entry.mtime && !this.noMtime) {
+        const atime = entry.atime || new Date()
+        const mtime = entry.mtime
+        try {
+          fs.futimesSync(fd, atime, mtime)
+        } catch (futimeser) {
+          try {
+            fs.utimesSync(entry.absolute, atime, mtime)
+          } catch (utimeser) {
+            er = futimeser
+          }
+        }
+      }
+
+      if (this[DOCHOWN](entry)) {
+        const uid = this[UID](entry)
+        const gid = this[GID](entry)
+
+        try {
+          fs.fchownSync(fd, uid, gid)
+        } catch (fchowner) {
+          try {
+            fs.chownSync(entry.absolute, uid, gid)
+          } catch (chowner) {
+            er = er || fchowner
+          }
+        }
+      }
+
+      oner(er)
+    })
+  }
+
+  [DIRECTORY] (entry) {
+    const mode = entry.mode & 0o7777 || this.dmode
+    const er = this[MKDIR](entry.absolute, mode)
+    if (er)
+      return this[ONERROR](er, entry)
+    if (entry.mtime && !this.noMtime) {
+      try {
+        fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime)
+      } catch (er) {}
+    }
+    if (this[DOCHOWN](entry)) {
+      try {
+        fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry))
+      } catch (er) {}
+    }
+    entry.resume()
+  }
+
+  [MKDIR] (dir, mode) {
+    try {
+      return mkdir.sync(dir, {
+        uid: this.uid,
+        gid: this.gid,
+        processUid: this.processUid,
+        processGid: this.processGid,
+        umask: this.processUmask,
+        preserve: this.preservePaths,
+        unlink: this.unlink,
+        cache: this.dirCache,
+        cwd: this.cwd,
+        mode: mode
+      })
+    } catch (er) {
+      return er
+    }
+  }
+
+  [LINK] (entry, linkpath, link) {
+    try {
+      fs[link + 'Sync'](linkpath, entry.absolute)
+      entry.resume()
+    } catch (er) {
+      return this[ONERROR](er, entry)
+    }
+  }
+}
+
+Unpack.Sync = UnpackSync
+module.exports = Unpack
diff --git a/legacy-libs/grpc/node_modules/tar/lib/update.js b/legacy-libs/grpc/node_modules/tar/lib/update.js
new file mode 100644 (file)
index 0000000..16c3e93
--- /dev/null
@@ -0,0 +1,36 @@
+'use strict'
+
+// tar -u
+
+const hlo = require('./high-level-opt.js')
+const r = require('./replace.js')
+// just call tar.r with the filter and mtimeCache
+
+const u = module.exports = (opt_, files, cb) => {
+  const opt = hlo(opt_)
+
+  if (!opt.file)
+    throw new TypeError('file is required')
+
+  if (opt.gzip)
+    throw new TypeError('cannot append to compressed archives')
+
+  if (!files || !Array.isArray(files) || !files.length)
+    throw new TypeError('no files or directories specified')
+
+  files = Array.from(files)
+
+  mtimeFilter(opt)
+  return r(opt, files, cb)
+}
+
+const mtimeFilter = opt => {
+  const filter = opt.filter
+
+  if (!opt.mtimeCache)
+    opt.mtimeCache = new Map()
+
+  opt.filter = filter ? (path, stat) =>
+    filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime)
+    : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime)
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/warn-mixin.js b/legacy-libs/grpc/node_modules/tar/lib/warn-mixin.js
new file mode 100644 (file)
index 0000000..94a4b9b
--- /dev/null
@@ -0,0 +1,14 @@
+'use strict'
+module.exports = Base => class extends Base {
+  warn (msg, data) {
+    if (!this.strict)
+      this.emit('warn', msg, data)
+    else if (data instanceof Error)
+      this.emit('error', data)
+    else {
+      const er = new Error(msg)
+      er.data = data
+      this.emit('error', er)
+    }
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/winchars.js b/legacy-libs/grpc/node_modules/tar/lib/winchars.js
new file mode 100644 (file)
index 0000000..cf6ea06
--- /dev/null
@@ -0,0 +1,23 @@
+'use strict'
+
+// When writing files on Windows, translate the characters to their
+// 0xf000 higher-encoded versions.
+
+const raw = [
+  '|',
+  '<',
+  '>',
+  '?',
+  ':'
+]
+
+const win = raw.map(char =>
+  String.fromCharCode(0xf000 + char.charCodeAt(0)))
+
+const toWin = new Map(raw.map((char, i) => [char, win[i]]))
+const toRaw = new Map(win.map((char, i) => [char, raw[i]]))
+
+module.exports = {
+  encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s),
+  decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s)
+}
diff --git a/legacy-libs/grpc/node_modules/tar/lib/write-entry.js b/legacy-libs/grpc/node_modules/tar/lib/write-entry.js
new file mode 100644 (file)
index 0000000..63f7494
--- /dev/null
@@ -0,0 +1,422 @@
+'use strict'
+const Buffer = require('./buffer.js')
+const MiniPass = require('minipass')
+const Pax = require('./pax.js')
+const Header = require('./header.js')
+const ReadEntry = require('./read-entry.js')
+const fs = require('fs')
+const path = require('path')
+
+const types = require('./types.js')
+const maxReadSize = 16 * 1024 * 1024
+const PROCESS = Symbol('process')
+const FILE = Symbol('file')
+const DIRECTORY = Symbol('directory')
+const SYMLINK = Symbol('symlink')
+const HARDLINK = Symbol('hardlink')
+const HEADER = Symbol('header')
+const READ = Symbol('read')
+const LSTAT = Symbol('lstat')
+const ONLSTAT = Symbol('onlstat')
+const ONREAD = Symbol('onread')
+const ONREADLINK = Symbol('onreadlink')
+const OPENFILE = Symbol('openfile')
+const ONOPENFILE = Symbol('onopenfile')
+const CLOSE = Symbol('close')
+const MODE = Symbol('mode')
+const warner = require('./warn-mixin.js')
+const winchars = require('./winchars.js')
+
+const modeFix = require('./mode-fix.js')
+
+const WriteEntry = warner(class WriteEntry extends MiniPass {
+  constructor (p, opt) {
+    opt = opt || {}
+    super(opt)
+    if (typeof p !== 'string')
+      throw new TypeError('path is required')
+    this.path = p
+    // suppress atime, ctime, uid, gid, uname, gname
+    this.portable = !!opt.portable
+    // until node has builtin pwnam functions, this'll have to do
+    this.myuid = process.getuid && process.getuid()
+    this.myuser = process.env.USER || ''
+    this.maxReadSize = opt.maxReadSize || maxReadSize
+    this.linkCache = opt.linkCache || new Map()
+    this.statCache = opt.statCache || new Map()
+    this.preservePaths = !!opt.preservePaths
+    this.cwd = opt.cwd || process.cwd()
+    this.strict = !!opt.strict
+    this.noPax = !!opt.noPax
+    this.noMtime = !!opt.noMtime
+    this.mtime = opt.mtime || null
+
+    if (typeof opt.onwarn === 'function')
+      this.on('warn', opt.onwarn)
+
+    if (!this.preservePaths && path.win32.isAbsolute(p)) {
+      // absolutes on posix are also absolutes on win32
+      // so we only need to test this one to get both
+      const parsed = path.win32.parse(p)
+      this.warn('stripping ' + parsed.root + ' from absolute path', p)
+      this.path = p.substr(parsed.root.length)
+    }
+
+    this.win32 = !!opt.win32 || process.platform === 'win32'
+    if (this.win32) {
+      this.path = winchars.decode(this.path.replace(/\\/g, '/'))
+      p = p.replace(/\\/g, '/')
+    }
+
+    this.absolute = opt.absolute || path.resolve(this.cwd, p)
+
+    if (this.path === '')
+      this.path = './'
+
+    if (this.statCache.has(this.absolute))
+      this[ONLSTAT](this.statCache.get(this.absolute))
+    else
+      this[LSTAT]()
+  }
+
+  [LSTAT] () {
+    fs.lstat(this.absolute, (er, stat) => {
+      if (er)
+        return this.emit('error', er)
+      this[ONLSTAT](stat)
+    })
+  }
+
+  [ONLSTAT] (stat) {
+    this.statCache.set(this.absolute, stat)
+    this.stat = stat
+    if (!stat.isFile())
+      stat.size = 0
+    this.type = getType(stat)
+    this.emit('stat', stat)
+    this[PROCESS]()
+  }
+
+  [PROCESS] () {
+    switch (this.type) {
+      case 'File': return this[FILE]()
+      case 'Directory': return this[DIRECTORY]()
+      case 'SymbolicLink': return this[SYMLINK]()
+      // unsupported types are ignored.
+      default: return this.end()
+    }
+  }
+
+  [MODE] (mode) {
+    return modeFix(mode, this.type === 'Directory')
+  }
+
+  [HEADER] () {
+    if (this.type === 'Directory' && this.portable)
+      this.noMtime = true
+
+    this.header = new Header({
+      path: this.path,
+      linkpath: this.linkpath,
+      // only the permissions and setuid/setgid/sticky bitflags
+      // not the higher-order bits that specify file type
+      mode: this[MODE](this.stat.mode),
+      uid: this.portable ? null : this.stat.uid,
+      gid: this.portable ? null : this.stat.gid,
+      size: this.stat.size,
+      mtime: this.noMtime ? null : this.mtime || this.stat.mtime,
+      type: this.type,
+      uname: this.portable ? null :
+        this.stat.uid === this.myuid ? this.myuser : '',
+      atime: this.portable ? null : this.stat.atime,
+      ctime: this.portable ? null : this.stat.ctime
+    })
+
+    if (this.header.encode() && !this.noPax)
+      this.write(new Pax({
+        atime: this.portable ? null : this.header.atime,
+        ctime: this.portable ? null : this.header.ctime,
+        gid: this.portable ? null : this.header.gid,
+        mtime: this.noMtime ? null : this.mtime || this.header.mtime,
+        path: this.path,
+        linkpath: this.linkpath,
+        size: this.header.size,
+        uid: this.portable ? null : this.header.uid,
+        uname: this.portable ? null : this.header.uname,
+        dev: this.portable ? null : this.stat.dev,
+        ino: this.portable ? null : this.stat.ino,
+        nlink: this.portable ? null : this.stat.nlink
+      }).encode())
+    this.write(this.header.block)
+  }
+
+  [DIRECTORY] () {
+    if (this.path.substr(-1) !== '/')
+      this.path += '/'
+    this.stat.size = 0
+    this[HEADER]()
+    this.end()
+  }
+
+  [SYMLINK] () {
+    fs.readlink(this.absolute, (er, linkpath) => {
+      if (er)
+        return this.emit('error', er)
+      this[ONREADLINK](linkpath)
+    })
+  }
+
+  [ONREADLINK] (linkpath) {
+    this.linkpath = linkpath
+    this[HEADER]()
+    this.end()
+  }
+
+  [HARDLINK] (linkpath) {
+    this.type = 'Link'
+    this.linkpath = path.relative(this.cwd, linkpath)
+    this.stat.size = 0
+    this[HEADER]()
+    this.end()
+  }
+
+  [FILE] () {
+    if (this.stat.nlink > 1) {
+      const linkKey = this.stat.dev + ':' + this.stat.ino
+      if (this.linkCache.has(linkKey)) {
+        const linkpath = this.linkCache.get(linkKey)
+        if (linkpath.indexOf(this.cwd) === 0)
+          return this[HARDLINK](linkpath)
+      }
+      this.linkCache.set(linkKey, this.absolute)
+    }
+
+    this[HEADER]()
+    if (this.stat.size === 0)
+      return this.end()
+
+    this[OPENFILE]()
+  }
+
+  [OPENFILE] () {
+    fs.open(this.absolute, 'r', (er, fd) => {
+      if (er)
+        return this.emit('error', er)
+      this[ONOPENFILE](fd)
+    })
+  }
+
+  [ONOPENFILE] (fd) {
+    const blockLen = 512 * Math.ceil(this.stat.size / 512)
+    const bufLen = Math.min(blockLen, this.maxReadSize)
+    const buf = Buffer.allocUnsafe(bufLen)
+    this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen)
+  }
+
+  [READ] (fd, buf, offset, length, pos, remain, blockRemain) {
+    fs.read(fd, buf, offset, length, pos, (er, bytesRead) => {
+      if (er)
+        return this[CLOSE](fd, _ => this.emit('error', er))
+      this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)
+    })
+  }
+
+  [CLOSE] (fd, cb) {
+    fs.close(fd, cb)
+  }
+
+  [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) {
+    if (bytesRead <= 0 && remain > 0) {
+      const er = new Error('encountered unexpected EOF')
+      er.path = this.absolute
+      er.syscall = 'read'
+      er.code = 'EOF'
+      this[CLOSE](fd)
+      return this.emit('error', er)
+    }
+
+    if (bytesRead > remain) {
+      const er = new Error('did not encounter expected EOF')
+      er.path = this.absolute
+      er.syscall = 'read'
+      er.code = 'EOF'
+      this[CLOSE](fd)
+      return this.emit('error', er)
+    }
+
+    // null out the rest of the buffer, if we could fit the block padding
+    if (bytesRead === remain) {
+      for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) {
+        buf[i + offset] = 0
+        bytesRead ++
+        remain ++
+      }
+    }
+
+    const writeBuf = offset === 0 && bytesRead === buf.length ?
+      buf : buf.slice(offset, offset + bytesRead)
+    remain -= bytesRead
+    blockRemain -= bytesRead
+    pos += bytesRead
+    offset += bytesRead
+
+    this.write(writeBuf)
+
+    if (!remain) {
+      if (blockRemain)
+        this.write(Buffer.alloc(blockRemain))
+      this.end()
+      this[CLOSE](fd, _ => _)
+      return
+    }
+
+    if (offset >= length) {
+      buf = Buffer.allocUnsafe(length)
+      offset = 0
+    }
+    length = buf.length - offset
+    this[READ](fd, buf, offset, length, pos, remain, blockRemain)
+  }
+})
+
+class WriteEntrySync extends WriteEntry {
+  constructor (path, opt) {
+    super(path, opt)
+  }
+
+  [LSTAT] () {
+    this[ONLSTAT](fs.lstatSync(this.absolute))
+  }
+
+  [SYMLINK] () {
+    this[ONREADLINK](fs.readlinkSync(this.absolute))
+  }
+
+  [OPENFILE] () {
+    this[ONOPENFILE](fs.openSync(this.absolute, 'r'))
+  }
+
+  [READ] (fd, buf, offset, length, pos, remain, blockRemain) {
+    let threw = true
+    try {
+      const bytesRead = fs.readSync(fd, buf, offset, length, pos)
+      this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)
+      threw = false
+    } finally {
+      if (threw)
+        try { this[CLOSE](fd) } catch (er) {}
+    }
+  }
+
+  [CLOSE] (fd) {
+    fs.closeSync(fd)
+  }
+}
+
+const WriteEntryTar = warner(class WriteEntryTar extends MiniPass {
+  constructor (readEntry, opt) {
+    opt = opt || {}
+    super(opt)
+    this.preservePaths = !!opt.preservePaths
+    this.portable = !!opt.portable
+    this.strict = !!opt.strict
+    this.noPax = !!opt.noPax
+    this.noMtime = !!opt.noMtime
+
+    this.readEntry = readEntry
+    this.type = readEntry.type
+    if (this.type === 'Directory' && this.portable)
+      this.noMtime = true
+
+    this.path = readEntry.path
+    this.mode = this[MODE](readEntry.mode)
+    this.uid = this.portable ? null : readEntry.uid
+    this.gid = this.portable ? null : readEntry.gid
+    this.uname = this.portable ? null : readEntry.uname
+    this.gname = this.portable ? null : readEntry.gname
+    this.size = readEntry.size
+    this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime
+    this.atime = this.portable ? null : readEntry.atime
+    this.ctime = this.portable ? null : readEntry.ctime
+    this.linkpath = readEntry.linkpath
+
+    if (typeof opt.onwarn === 'function')
+      this.on('warn', opt.onwarn)
+
+    if (path.isAbsolute(this.path) && !this.preservePaths) {
+      const parsed = path.parse(this.path)
+      this.warn(
+        'stripping ' + parsed.root + ' from absolute path',
+        this.path
+      )
+      this.path = this.path.substr(parsed.root.length)
+    }
+
+    this.remain = readEntry.size
+    this.blockRemain = readEntry.startBlockSize
+
+    this.header = new Header({
+      path: this.path,
+      linkpath: this.linkpath,
+      // only the permissions and setuid/setgid/sticky bitflags
+      // not the higher-order bits that specify file type
+      mode: this.mode,
+      uid: this.portable ? null : this.uid,
+      gid: this.portable ? null : this.gid,
+      size: this.size,
+      mtime: this.noMtime ? null : this.mtime,
+      type: this.type,
+      uname: this.portable ? null : this.uname,
+      atime: this.portable ? null : this.atime,
+      ctime: this.portable ? null : this.ctime
+    })
+
+    if (this.header.encode() && !this.noPax)
+      super.write(new Pax({
+        atime: this.portable ? null : this.atime,
+        ctime: this.portable ? null : this.ctime,
+        gid: this.portable ? null : this.gid,
+        mtime: this.noMtime ? null : this.mtime,
+        path: this.path,
+        linkpath: this.linkpath,
+        size: this.size,
+        uid: this.portable ? null : this.uid,
+        uname: this.portable ? null : this.uname,
+        dev: this.portable ? null : this.readEntry.dev,
+        ino: this.portable ? null : this.readEntry.ino,
+        nlink: this.portable ? null : this.readEntry.nlink
+      }).encode())
+
+    super.write(this.header.block)
+    readEntry.pipe(this)
+  }
+
+  [MODE] (mode) {
+    return modeFix(mode, this.type === 'Directory')
+  }
+
+  write (data) {
+    const writeLen = data.length
+    if (writeLen > this.blockRemain)
+      throw new Error('writing more to entry than is appropriate')
+    this.blockRemain -= writeLen
+    return super.write(data)
+  }
+
+  end () {
+    if (this.blockRemain)
+      this.write(Buffer.alloc(this.blockRemain))
+    return super.end()
+  }
+})
+
+WriteEntry.Sync = WriteEntrySync
+WriteEntry.Tar = WriteEntryTar
+
+const getType = stat =>
+  stat.isFile() ? 'File'
+  : stat.isDirectory() ? 'Directory'
+  : stat.isSymbolicLink() ? 'SymbolicLink'
+  : 'Unsupported'
+
+module.exports = WriteEntry
diff --git a/legacy-libs/grpc/node_modules/tar/package.json b/legacy-libs/grpc/node_modules/tar/package.json
new file mode 100644 (file)
index 0000000..cc12992
--- /dev/null
@@ -0,0 +1,86 @@
+{
+  "_from": "tar@^4",
+  "_id": "tar@4.4.10",
+  "_inBundle": false,
+  "_integrity": "sha512-g2SVs5QIxvo6OLp0GudTqEf05maawKUxXru104iaayWA09551tFCTI8f1Asb4lPfkBr91k07iL4c11XO3/b0tA==",
+  "_location": "/grpc/tar",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "tar@^4",
+    "name": "tar",
+    "escapedName": "tar",
+    "rawSpec": "^4",
+    "saveSpec": null,
+    "fetchSpec": "^4"
+  },
+  "_requiredBy": [
+    "/grpc/node-pre-gyp"
+  ],
+  "_resolved": "https://registry.npmjs.org/tar/-/tar-4.4.10.tgz",
+  "_shasum": "946b2810b9a5e0b26140cf78bea6b0b0d689eba1",
+  "_shrinkwrap": null,
+  "_spec": "tar@^4",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/node-pre-gyp",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/node-tar/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {
+    "chownr": "^1.1.1",
+    "fs-minipass": "^1.2.5",
+    "minipass": "^2.3.5",
+    "minizlib": "^1.2.1",
+    "mkdirp": "^0.5.0",
+    "safe-buffer": "^5.1.2",
+    "yallist": "^3.0.3"
+  },
+  "deprecated": false,
+  "description": "tar for node",
+  "devDependencies": {
+    "chmodr": "^1.2.0",
+    "end-of-stream": "^1.4.1",
+    "events-to-array": "^1.1.2",
+    "mutate-fs": "^2.1.1",
+    "rimraf": "^2.6.3",
+    "tap": "^14.2.0",
+    "tar-fs": "^1.16.3",
+    "tar-stream": "^1.6.2"
+  },
+  "engines": {
+    "node": ">=4.5"
+  },
+  "files": [
+    "index.js",
+    "lib/"
+  ],
+  "homepage": "https://github.com/npm/node-tar#readme",
+  "license": "ISC",
+  "name": "tar",
+  "optionalDependencies": {},
+  "readme": "# node-tar\n\n[![Build Status](https://travis-ci.org/npm/node-tar.svg?branch=master)](https://travis-ci.org/npm/node-tar)\n\n[Fast](./benchmarks) and full-featured Tar for Node.js\n\nThe API is designed to mimic the behavior of `tar(1)` on unix systems.\nIf you are familiar with how tar works, most of this will hopefully be\nstraightforward for you.  If not, then hopefully this module can teach\nyou useful unix skills that may come in handy someday :)\n\n## Background\n\nA \"tar file\" or \"tarball\" is an archive of file system entries\n(directories, files, links, etc.)  The name comes from \"tape archive\".\nIf you run `man tar` on almost any Unix command line, you'll learn\nquite a bit about what it can do, and its history.\n\nTar has 5 main top-level commands:\n\n* `c` Create an archive\n* `r` Replace entries within an archive\n* `u` Update entries within an archive (ie, replace if they're newer)\n* `t` List out the contents of an archive\n* `x` Extract an archive to disk\n\nThe other flags and options modify how this top level function works.\n\n## High-Level API\n\nThese 5 functions are the high-level API.  All of them have a\nsingle-character name (for unix nerds familiar with `tar(1)`) as well\nas a long name (for everyone else).\n\nAll the high-level functions take the following arguments, all three\nof which are optional and may be omitted.\n\n1. `options` - An optional object specifying various options\n2. `paths` - An array of paths to add or extract\n3. `callback` - Called when the command is completed, if async.  (If\n   sync or no file specified, providing a callback throws a\n   `TypeError`.)\n\nIf the command is sync (ie, if `options.sync=true`), then the\ncallback is not allowed, since the action will be completed immediately.\n\nIf a `file` argument is specified, and the command is async, then a\n`Promise` is returned.  In this case, if async, a callback may be\nprovided which is called when the command is completed.\n\nIf a `file` option is not specified, then a stream is returned.  For\n`create`, this is a readable stream of the generated archive.  For\n`list` and `extract` this is a writable stream that an archive should\nbe written into.  If a file is not specified, then a callback is not\nallowed, because you're already getting a stream to work with.\n\n`replace` and `update` only work on existing archives, and so require\na `file` argument.\n\nSync commands without a file argument return a stream that acts on its\ninput immediately in the same tick.  For readable streams, this means\nthat all of the data is immediately available by calling\n`stream.read()`.  For writable streams, it will be acted upon as soon\nas it is provided, but this can be at any time.\n\n### Warnings\n\nSome things cause tar to emit a warning, but should usually not cause\nthe entire operation to fail.  There are three ways to handle\nwarnings:\n\n1. **Ignore them** (default) Invalid entries won't be put in the\n   archive, and invalid entries won't be unpacked.  This is usually\n   fine, but can hide failures that you might care about.\n2. **Notice them**  Add an `onwarn` function to the options, or listen\n   to the `'warn'` event on any tar stream.  The function will get\n   called as `onwarn(message, data)`.  Handle as appropriate.\n3. **Explode them.**  Set `strict: true` in the options object, and\n   `warn` messages will be emitted as `'error'` events instead.  If\n   there's no `error` handler, this causes the program to crash.  If\n   used with a promise-returning/callback-taking method, then it'll\n   send the error to the promise/callback.\n\n### Examples\n\nThe API mimics the `tar(1)` command line functionality, with aliases\nfor more human-readable option and function names.  The goal is that\nif you know how to use `tar(1)` in Unix, then you know how to use\n`require('tar')` in JavaScript.\n\nTo replicate `tar czf my-tarball.tgz files and folders`, you'd do:\n\n```js\ntar.c(\n  {\n    gzip: <true|gzip options>,\n    file: 'my-tarball.tgz'\n  },\n  ['some', 'files', 'and', 'folders']\n).then(_ => { .. tarball has been created .. })\n```\n\nTo replicate `tar cz files and folders > my-tarball.tgz`, you'd do:\n\n```js\ntar.c( // or tar.create\n  {\n    gzip: <true|gzip options>\n  },\n  ['some', 'files', 'and', 'folders']\n).pipe(fs.createWriteStream('my-tarball.tgz'))\n```\n\nTo replicate `tar xf my-tarball.tgz` you'd do:\n\n```js\ntar.x(  // or tar.extract(\n  {\n    file: 'my-tarball.tgz'\n  }\n).then(_=> { .. tarball has been dumped in cwd .. })\n```\n\nTo replicate `cat my-tarball.tgz | tar x -C some-dir --strip=1`:\n\n```js\nfs.createReadStream('my-tarball.tgz').pipe(\n  tar.x({\n    strip: 1,\n    C: 'some-dir' // alias for cwd:'some-dir', also ok\n  })\n)\n```\n\nTo replicate `tar tf my-tarball.tgz`, do this:\n\n```js\ntar.t({\n  file: 'my-tarball.tgz',\n  onentry: entry => { .. do whatever with it .. }\n})\n```\n\nTo replicate `cat my-tarball.tgz | tar t` do:\n\n```js\nfs.createReadStream('my-tarball.tgz')\n  .pipe(tar.t())\n  .on('entry', entry => { .. do whatever with it .. })\n```\n\nTo do anything synchronous, add `sync: true` to the options.  Note\nthat sync functions don't take a callback and don't return a promise.\nWhen the function returns, it's already done.  Sync methods without a\nfile argument return a sync stream, which flushes immediately.  But,\nof course, it still won't be done until you `.end()` it.\n\nTo filter entries, add `filter: <function>` to the options.\nTar-creating methods call the filter with `filter(path, stat)`.\nTar-reading methods (including extraction) call the filter with\n`filter(path, entry)`.  The filter is called in the `this`-context of\nthe `Pack` or `Unpack` stream object.\n\nThe arguments list to `tar t` and `tar x` specify a list of filenames\nto extract or list, so they're equivalent to a filter that tests if\nthe file is in the list.\n\nFor those who _aren't_ fans of tar's single-character command names:\n\n```\ntar.c === tar.create\ntar.r === tar.replace (appends to archive, file is required)\ntar.u === tar.update (appends if newer, file is required)\ntar.x === tar.extract\ntar.t === tar.list\n```\n\nKeep reading for all the command descriptions and options, as well as\nthe low-level API that they are built on.\n\n### tar.c(options, fileList, callback) [alias: tar.create]\n\nCreate a tarball archive.\n\nThe `fileList` is an array of paths to add to the tarball.  Adding a\ndirectory also adds its children recursively.\n\nAn entry in `fileList` that starts with an `@` symbol is a tar archive\nwhose entries will be added.  To add a file that starts with `@`,\nprepend it with `./`.\n\nThe following options are supported:\n\n- `file` Write the tarball archive to the specified filename.  If this\n  is specified, then the callback will be fired when the file has been\n  written, and a promise will be returned that resolves when the file\n  is written.  If a filename is not specified, then a Readable Stream\n  will be returned which will emit the file data. [Alias: `f`]\n- `sync` Act synchronously.  If this is set, then any provided file\n  will be fully written after the call to `tar.c`.  If this is set,\n  and a file is not provided, then the resulting stream will already\n  have the data ready to `read` or `emit('data')` as soon as you\n  request it.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `cwd` The current working directory for creating the archive.\n  Defaults to `process.cwd()`.  [Alias: `C`]\n- `prefix` A path portion to prefix onto the entries in the archive.\n- `gzip` Set to any truthy value to create a gzipped archive, or an\n  object with settings for `zlib.Gzip()` [Alias: `z`]\n- `filter` A function that gets called with `(path, stat)` for each\n  entry being added.  Return `true` to add the entry to the archive,\n  or `false` to omit it.\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths. [Alias: `P`]\n- `mode` The mode to set on the created file archive\n- `noDirRecurse` Do not recursively archive the contents of\n  directories. [Alias: `n`]\n- `follow` Set to true to pack the targets of symbolic links.  Without\n  this option, symbolic links are archived as such. [Alias: `L`, `h`]\n- `noPax` Suppress pax extended headers.  Note that this means that\n  long paths and linkpaths will be truncated, and large or negative\n  numeric values may be interpreted incorrectly.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n  [Alias: `m`, `no-mtime`]\n- `mtime` Set to a `Date` object to force a specific `mtime` for\n  everything added to the archive.  Overridden by `noMtime`.\n\n\nThe following options are mostly internal, but can be modified in some\nadvanced use cases, such as re-using caches between runs.\n\n- `linkCache` A Map object containing the device and inode value for\n  any file whose nlink is > 1, to identify hard links.\n- `statCache` A Map object that caches calls `lstat`.\n- `readdirCache` A Map object that caches calls to `readdir`.\n- `jobs` A number specifying how many concurrent jobs to run.\n  Defaults to 4.\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 16 MB.\n\n### tar.x(options, fileList, callback) [alias: tar.extract]\n\nExtract a tarball archive.\n\nThe `fileList` is an array of paths to extract from the tarball.  If\nno paths are provided, then all the entries are extracted.\n\nIf the archive is gzipped, then tar will detect this and unzip it.\n\nNote that all directories that are created will be forced to be\nwritable, readable, and listable by their owner, to avoid cases where\na directory prevents extraction of child entries by virtue of its\nmode.\n\nMost extraction errors will cause a `warn` event to be emitted.  If\nthe `cwd` is missing, or not a directory, then the extraction will\nfail completely.\n\nThe following options are supported:\n\n- `cwd` Extract files relative to the specified directory.  Defaults\n  to `process.cwd()`.  If provided, this must exist and must be a\n  directory. [Alias: `C`]\n- `file` The archive file to extract.  If not specified, then a\n  Writable stream is returned where the archive data should be\n  written. [Alias: `f`]\n- `sync` Create files and directories synchronously.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `filter` A function that gets called with `(path, entry)` for each\n  entry being unpacked.  Return `true` to unpack the entry from the\n  archive, or `false` to skip it.\n- `newer` Set to true to keep the existing file on disk if it's newer\n  than the file in the archive. [Alias: `keep-newer`,\n  `keep-newer-files`]\n- `keep` Do not overwrite existing files.  In particular, if a file\n  appears more than once in an archive, later copies will not\n  overwrite earlier copies. [Alias: `k`, `keep-existing`]\n- `preservePaths` Allow absolute paths, paths containing `..`, and\n  extracting through symbolic links.  By default, `/` is stripped from\n  absolute paths, `..` paths are not extracted, and any file whose\n  location would be modified by a symbolic link is not extracted.\n  [Alias: `P`]\n- `unlink` Unlink files before creating them.  Without this option,\n  tar overwrites existing files, which preserves existing hardlinks.\n  With this option, existing hardlinks will be broken, as will any\n  symlink that would affect the location of an extracted file. [Alias:\n  `U`]\n- `strip` Remove the specified number of leading path elements.\n  Pathnames with fewer elements will be silently skipped.  Note that\n  the pathname is edited after applying the filter, but before\n  security checks. [Alias: `strip-components`, `stripComponents`]\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `preserveOwner` If true, tar will set the `uid` and `gid` of\n  extracted entries to the `uid` and `gid` fields in the archive.\n  This defaults to true when run as root, and false otherwise.  If\n  false, then files and directories will be set with the owner and\n  group of the user running the process.  This is similar to `-p` in\n  `tar(1)`, but ACLs and other system-specific data is never unpacked\n  in this implementation, and modes are set by default already.\n  [Alias: `p`]\n- `uid` Set to a number to force ownership of all extracted files and\n  folders, and all implicitly created directories, to be owned by the\n  specified user id, regardless of the `uid` field in the archive.\n  Cannot be used along with `preserveOwner`.  Requires also setting a\n  `gid` option.\n- `gid` Set to a number to force ownership of all extracted files and\n  folders, and all implicitly created directories, to be owned by the\n  specified group id, regardless of the `gid` field in the archive.\n  Cannot be used along with `preserveOwner`.  Requires also setting a\n  `uid` option.\n- `noMtime` Set to true to omit writing `mtime` value for extracted\n  entries. [Alias: `m`, `no-mtime`]\n- `transform` Provide a function that takes an `entry` object, and\n  returns a stream, or any falsey value.  If a stream is provided,\n  then that stream's data will be written instead of the contents of\n  the archive entry.  If a falsey value is provided, then the entry is\n  written to disk as normal.  (To exclude items from extraction, use\n  the `filter` option described above.)\n- `onentry` A function that gets called with `(entry)` for each entry\n  that passes the filter.\n\nThe following options are mostly internal, but can be modified in some\nadvanced use cases, such as re-using caches between runs.\n\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 16 MB.\n- `umask` Filter the modes of entries like `process.umask()`.\n- `dmode` Default mode for directories\n- `fmode` Default mode for files\n- `dirCache` A Map object of which directories exist.\n- `maxMetaEntrySize` The maximum size of meta entries that is\n  supported.  Defaults to 1 MB.\n\nNote that using an asynchronous stream type with the `transform`\noption will cause undefined behavior in sync extractions.\n[MiniPass](http://npm.im/minipass)-based streams are designed for this\nuse case.\n\n### tar.t(options, fileList, callback) [alias: tar.list]\n\nList the contents of a tarball archive.\n\nThe `fileList` is an array of paths to list from the tarball.  If\nno paths are provided, then all the entries are listed.\n\nIf the archive is gzipped, then tar will detect this and unzip it.\n\nReturns an event emitter that emits `entry` events with\n`tar.ReadEntry` objects.  However, they don't emit `'data'` or `'end'`\nevents.  (If you want to get actual readable entries, use the\n`tar.Parse` class instead.)\n\nThe following options are supported:\n\n- `cwd` Extract files relative to the specified directory.  Defaults\n  to `process.cwd()`. [Alias: `C`]\n- `file` The archive file to list.  If not specified, then a\n  Writable stream is returned where the archive data should be\n  written. [Alias: `f`]\n- `sync` Read the specified file synchronously.  (This has no effect\n  when a file option isn't specified, because entries are emitted as\n  fast as they are parsed from the stream anyway.)\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `filter` A function that gets called with `(path, entry)` for each\n  entry being listed.  Return `true` to emit the entry from the\n  archive, or `false` to skip it.\n- `onentry` A function that gets called with `(entry)` for each entry\n  that passes the filter.  This is important for when both `file` and\n  `sync` are set, because it will be called synchronously.\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 16 MB.\n- `noResume` By default, `entry` streams are resumed immediately after\n  the call to `onentry`.  Set `noResume: true` to suppress this\n  behavior.  Note that by opting into this, the stream will never\n  complete until the entry data is consumed.\n\n### tar.u(options, fileList, callback) [alias: tar.update]\n\nAdd files to an archive if they are newer than the entry already in\nthe tarball archive.\n\nThe `fileList` is an array of paths to add to the tarball.  Adding a\ndirectory also adds its children recursively.\n\nAn entry in `fileList` that starts with an `@` symbol is a tar archive\nwhose entries will be added.  To add a file that starts with `@`,\nprepend it with `./`.\n\nThe following options are supported:\n\n- `file` Required. Write the tarball archive to the specified\n  filename. [Alias: `f`]\n- `sync` Act synchronously.  If this is set, then any provided file\n  will be fully written after the call to `tar.c`.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `cwd` The current working directory for adding entries to the\n  archive.  Defaults to `process.cwd()`.  [Alias: `C`]\n- `prefix` A path portion to prefix onto the entries in the archive.\n- `gzip` Set to any truthy value to create a gzipped archive, or an\n  object with settings for `zlib.Gzip()` [Alias: `z`]\n- `filter` A function that gets called with `(path, stat)` for each\n  entry being added.  Return `true` to add the entry to the archive,\n  or `false` to omit it.\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths. [Alias: `P`]\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 16 MB.\n- `noDirRecurse` Do not recursively archive the contents of\n  directories. [Alias: `n`]\n- `follow` Set to true to pack the targets of symbolic links.  Without\n  this option, symbolic links are archived as such. [Alias: `L`, `h`]\n- `noPax` Suppress pax extended headers.  Note that this means that\n  long paths and linkpaths will be truncated, and large or negative\n  numeric values may be interpreted incorrectly.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n  [Alias: `m`, `no-mtime`]\n- `mtime` Set to a `Date` object to force a specific `mtime` for\n  everything added to the archive.  Overridden by `noMtime`.\n\n### tar.r(options, fileList, callback) [alias: tar.replace]\n\nAdd files to an existing archive.  Because later entries override\nearlier entries, this effectively replaces any existing entries.\n\nThe `fileList` is an array of paths to add to the tarball.  Adding a\ndirectory also adds its children recursively.\n\nAn entry in `fileList` that starts with an `@` symbol is a tar archive\nwhose entries will be added.  To add a file that starts with `@`,\nprepend it with `./`.\n\nThe following options are supported:\n\n- `file` Required. Write the tarball archive to the specified\n  filename. [Alias: `f`]\n- `sync` Act synchronously.  If this is set, then any provided file\n  will be fully written after the call to `tar.c`.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `cwd` The current working directory for adding entries to the\n  archive.  Defaults to `process.cwd()`.  [Alias: `C`]\n- `prefix` A path portion to prefix onto the entries in the archive.\n- `gzip` Set to any truthy value to create a gzipped archive, or an\n  object with settings for `zlib.Gzip()` [Alias: `z`]\n- `filter` A function that gets called with `(path, stat)` for each\n  entry being added.  Return `true` to add the entry to the archive,\n  or `false` to omit it.\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths. [Alias: `P`]\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 16 MB.\n- `noDirRecurse` Do not recursively archive the contents of\n  directories. [Alias: `n`]\n- `follow` Set to true to pack the targets of symbolic links.  Without\n  this option, symbolic links are archived as such. [Alias: `L`, `h`]\n- `noPax` Suppress pax extended headers.  Note that this means that\n  long paths and linkpaths will be truncated, and large or negative\n  numeric values may be interpreted incorrectly.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n  [Alias: `m`, `no-mtime`]\n- `mtime` Set to a `Date` object to force a specific `mtime` for\n  everything added to the archive.  Overridden by `noMtime`.\n\n\n## Low-Level API\n\n### class tar.Pack\n\nA readable tar stream.\n\nHas all the standard readable stream interface stuff.  `'data'` and\n`'end'` events, `read()` method, `pause()` and `resume()`, etc.\n\n#### constructor(options)\n\nThe following options are supported:\n\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `cwd` The current working directory for creating the archive.\n  Defaults to `process.cwd()`.\n- `prefix` A path portion to prefix onto the entries in the archive.\n- `gzip` Set to any truthy value to create a gzipped archive, or an\n  object with settings for `zlib.Gzip()`\n- `filter` A function that gets called with `(path, stat)` for each\n  entry being added.  Return `true` to add the entry to the archive,\n  or `false` to omit it.\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths.\n- `linkCache` A Map object containing the device and inode value for\n  any file whose nlink is > 1, to identify hard links.\n- `statCache` A Map object that caches calls `lstat`.\n- `readdirCache` A Map object that caches calls to `readdir`.\n- `jobs` A number specifying how many concurrent jobs to run.\n  Defaults to 4.\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 16 MB.\n- `noDirRecurse` Do not recursively archive the contents of\n  directories.\n- `follow` Set to true to pack the targets of symbolic links.  Without\n  this option, symbolic links are archived as such.\n- `noPax` Suppress pax extended headers.  Note that this means that\n  long paths and linkpaths will be truncated, and large or negative\n  numeric values may be interpreted incorrectly.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n- `mtime` Set to a `Date` object to force a specific `mtime` for\n  everything added to the archive.  Overridden by `noMtime`.\n\n#### add(path)\n\nAdds an entry to the archive.  Returns the Pack stream.\n\n#### write(path)\n\nAdds an entry to the archive.  Returns true if flushed.\n\n#### end()\n\nFinishes the archive.\n\n### class tar.Pack.Sync\n\nSynchronous version of `tar.Pack`.\n\n### class tar.Unpack\n\nA writable stream that unpacks a tar archive onto the file system.\n\nAll the normal writable stream stuff is supported.  `write()` and\n`end()` methods, `'drain'` events, etc.\n\nNote that all directories that are created will be forced to be\nwritable, readable, and listable by their owner, to avoid cases where\na directory prevents extraction of child entries by virtue of its\nmode.\n\n`'close'` is emitted when it's done writing stuff to the file system.\n\nMost unpack errors will cause a `warn` event to be emitted.  If the\n`cwd` is missing, or not a directory, then an error will be emitted.\n\n#### constructor(options)\n\n- `cwd` Extract files relative to the specified directory.  Defaults\n  to `process.cwd()`.  If provided, this must exist and must be a\n  directory.\n- `filter` A function that gets called with `(path, entry)` for each\n  entry being unpacked.  Return `true` to unpack the entry from the\n  archive, or `false` to skip it.\n- `newer` Set to true to keep the existing file on disk if it's newer\n  than the file in the archive.\n- `keep` Do not overwrite existing files.  In particular, if a file\n  appears more than once in an archive, later copies will not\n  overwrite earlier copies.\n- `preservePaths` Allow absolute paths, paths containing `..`, and\n  extracting through symbolic links.  By default, `/` is stripped from\n  absolute paths, `..` paths are not extracted, and any file whose\n  location would be modified by a symbolic link is not extracted.\n- `unlink` Unlink files before creating them.  Without this option,\n  tar overwrites existing files, which preserves existing hardlinks.\n  With this option, existing hardlinks will be broken, as will any\n  symlink that would affect the location of an extracted file.\n- `strip` Remove the specified number of leading path elements.\n  Pathnames with fewer elements will be silently skipped.  Note that\n  the pathname is edited after applying the filter, but before\n  security checks.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `umask` Filter the modes of entries like `process.umask()`.\n- `dmode` Default mode for directories\n- `fmode` Default mode for files\n- `dirCache` A Map object of which directories exist.\n- `maxMetaEntrySize` The maximum size of meta entries that is\n  supported.  Defaults to 1 MB.\n- `preserveOwner` If true, tar will set the `uid` and `gid` of\n  extracted entries to the `uid` and `gid` fields in the archive.\n  This defaults to true when run as root, and false otherwise.  If\n  false, then files and directories will be set with the owner and\n  group of the user running the process.  This is similar to `-p` in\n  `tar(1)`, but ACLs and other system-specific data is never unpacked\n  in this implementation, and modes are set by default already.\n- `win32` True if on a windows platform.  Causes behavior where\n  filenames containing `<|>?` chars are converted to\n  windows-compatible values while being unpacked.\n- `uid` Set to a number to force ownership of all extracted files and\n  folders, and all implicitly created directories, to be owned by the\n  specified user id, regardless of the `uid` field in the archive.\n  Cannot be used along with `preserveOwner`.  Requires also setting a\n  `gid` option.\n- `gid` Set to a number to force ownership of all extracted files and\n  folders, and all implicitly created directories, to be owned by the\n  specified group id, regardless of the `gid` field in the archive.\n  Cannot be used along with `preserveOwner`.  Requires also setting a\n  `uid` option.\n- `noMtime` Set to true to omit writing `mtime` value for extracted\n  entries.\n- `transform` Provide a function that takes an `entry` object, and\n  returns a stream, or any falsey value.  If a stream is provided,\n  then that stream's data will be written instead of the contents of\n  the archive entry.  If a falsey value is provided, then the entry is\n  written to disk as normal.  (To exclude items from extraction, use\n  the `filter` option described above.)\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `onentry` A function that gets called with `(entry)` for each entry\n  that passes the filter.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n\n### class tar.Unpack.Sync\n\nSynchronous version of `tar.Unpack`.\n\nNote that using an asynchronous stream type with the `transform`\noption will cause undefined behavior in sync unpack streams.\n[MiniPass](http://npm.im/minipass)-based streams are designed for this\nuse case.\n\n### class tar.Parse\n\nA writable stream that parses a tar archive stream.  All the standard\nwritable stream stuff is supported.\n\nIf the archive is gzipped, then tar will detect this and unzip it.\n\nEmits `'entry'` events with `tar.ReadEntry` objects, which are\nthemselves readable streams that you can pipe wherever.\n\nEach `entry` will not emit until the one before it is flushed through,\nso make sure to either consume the data (with `on('data', ...)` or\n`.pipe(...)`) or throw it away with `.resume()` to keep the stream\nflowing.\n\n#### constructor(options)\n\nReturns an event emitter that emits `entry` events with\n`tar.ReadEntry` objects.\n\nThe following options are supported:\n\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `filter` A function that gets called with `(path, entry)` for each\n  entry being listed.  Return `true` to emit the entry from the\n  archive, or `false` to skip it.\n- `onentry` A function that gets called with `(entry)` for each entry\n  that passes the filter.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n\n#### abort(message, error)\n\nStop all parsing activities.  This is called when there are zlib\nerrors.  It also emits a warning with the message and error provided.\n\n### class tar.ReadEntry extends [MiniPass](http://npm.im/minipass)\n\nA representation of an entry that is being read out of a tar archive.\n\nIt has the following fields:\n\n- `extended` The extended metadata object provided to the constructor.\n- `globalExtended` The global extended metadata object provided to the\n  constructor.\n- `remain` The number of bytes remaining to be written into the\n  stream.\n- `blockRemain` The number of 512-byte blocks remaining to be written\n  into the stream.\n- `ignore` Whether this entry should be ignored.\n- `meta` True if this represents metadata about the next entry, false\n  if it represents a filesystem object.\n- All the fields from the header, extended header, and global extended\n  header are added to the ReadEntry object.  So it has `path`, `type`,\n  `size, `mode`, and so on.\n\n#### constructor(header, extended, globalExtended)\n\nCreate a new ReadEntry object with the specified header, extended\nheader, and global extended header values.\n\n### class tar.WriteEntry extends [MiniPass](http://npm.im/minipass)\n\nA representation of an entry that is being written from the file\nsystem into a tar archive.\n\nEmits data for the Header, and for the Pax Extended Header if one is\nrequired, as well as any body data.\n\nCreating a WriteEntry for a directory does not also create\nWriteEntry objects for all of the directory contents.\n\nIt has the following fields:\n\n- `path` The path field that will be written to the archive.  By\n  default, this is also the path from the cwd to the file system\n  object.\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `myuid` If supported, the uid of the user running the current\n  process.\n- `myuser` The `env.USER` string if set, or `''`.  Set as the entry\n  `uname` field if the file's `uid` matches `this.myuid`.\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 1 MB.\n- `linkCache` A Map object containing the device and inode value for\n  any file whose nlink is > 1, to identify hard links.\n- `statCache` A Map object that caches calls `lstat`.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths.\n- `cwd` The current working directory for creating the archive.\n  Defaults to `process.cwd()`.\n- `absolute` The absolute path to the entry on the filesystem.  By\n  default, this is `path.resolve(this.cwd, this.path)`, but it can be\n  overridden explicitly.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `win32` True if on a windows platform.  Causes behavior where paths\n  replace `\\` with `/` and filenames containing the windows-compatible\n  forms of `<|>?:` characters are converted to actual `<|>?:` characters\n  in the archive.\n- `noPax` Suppress pax extended headers.  Note that this means that\n  long paths and linkpaths will be truncated, and large or negative\n  numeric values may be interpreted incorrectly.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n\n\n#### constructor(path, options)\n\n`path` is the path of the entry as it is written in the archive.\n\nThe following options are supported:\n\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `maxReadSize` The maximum buffer size for `fs.read()` operations.\n  Defaults to 1 MB.\n- `linkCache` A Map object containing the device and inode value for\n  any file whose nlink is > 1, to identify hard links.\n- `statCache` A Map object that caches calls `lstat`.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths.\n- `cwd` The current working directory for creating the archive.\n  Defaults to `process.cwd()`.\n- `absolute` The absolute path to the entry on the filesystem.  By\n  default, this is `path.resolve(this.cwd, this.path)`, but it can be\n  overridden explicitly.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `win32` True if on a windows platform.  Causes behavior where paths\n  replace `\\` with `/`.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n- `umask` Set to restrict the modes on the entries in the archive,\n  somewhat like how umask works on file creation.  Defaults to\n  `process.umask()` on unix systems, or `0o22` on Windows.\n\n#### warn(message, data)\n\nIf strict, emit an error with the provided message.\n\nOthewise, emit a `'warn'` event with the provided message and data.\n\n### class tar.WriteEntry.Sync\n\nSynchronous version of tar.WriteEntry\n\n### class tar.WriteEntry.Tar\n\nA version of tar.WriteEntry that gets its data from a tar.ReadEntry\ninstead of from the filesystem.\n\n#### constructor(readEntry, options)\n\n`readEntry` is the entry being read out of another archive.\n\nThe following options are supported:\n\n- `portable` Omit metadata that is system-specific: `ctime`, `atime`,\n  `uid`, `gid`, `uname`, `gname`, `dev`, `ino`, and `nlink`.  Note\n  that `mtime` is still included, because this is necessary other\n  time-based operations.\n- `preservePaths` Allow absolute paths.  By default, `/` is stripped\n  from absolute paths.\n- `strict` Treat warnings as crash-worthy errors.  Default false.\n- `onwarn` A function that will get called with `(message, data)` for\n  any warnings encountered.\n- `noMtime` Set to true to omit writing `mtime` values for entries.\n  Note that this prevents using other mtime-based features like\n  `tar.update` or the `keepNewer` option with the resulting tar archive.\n\n### class tar.Header\n\nA class for reading and writing header blocks.\n\nIt has the following fields:\n\n- `nullBlock` True if decoding a block which is entirely composed of\n  `0x00` null bytes.  (Useful because tar files are terminated by\n  at least 2 null blocks.)\n- `cksumValid` True if the checksum in the header is valid, false\n  otherwise.\n- `needPax` True if the values, as encoded, will require a Pax\n  extended header.\n- `path` The path of the entry.\n- `mode` The 4 lowest-order octal digits of the file mode.  That is,\n  read/write/execute permissions for world, group, and owner, and the\n  setuid, setgid, and sticky bits.\n- `uid` Numeric user id of the file owner\n- `gid` Numeric group id of the file owner\n- `size` Size of the file in bytes\n- `mtime` Modified time of the file\n- `cksum` The checksum of the header.  This is generated by adding all\n  the bytes of the header block, treating the checksum field itself as\n  all ascii space characters (that is, `0x20`).\n- `type` The human-readable name of the type of entry this represents,\n  or the alphanumeric key if unknown.\n- `typeKey` The alphanumeric key for the type of entry this header\n  represents.\n- `linkpath` The target of Link and SymbolicLink entries.\n- `uname` Human-readable user name of the file owner\n- `gname` Human-readable group name of the file owner\n- `devmaj` The major portion of the device number.  Always `0` for\n  files, directories, and links.\n- `devmin` The minor portion of the device number.  Always `0` for\n  files, directories, and links.\n- `atime` File access time.\n- `ctime` File change time.\n\n#### constructor(data, [offset=0])\n\n`data` is optional.  It is either a Buffer that should be interpreted\nas a tar Header starting at the specified offset and continuing for\n512 bytes, or a data object of keys and values to set on the header\nobject, and eventually encode as a tar Header.\n\n#### decode(block, offset)\n\nDecode the provided buffer starting at the specified offset.\n\nBuffer length must be greater than 512 bytes.\n\n#### set(data)\n\nSet the fields in the data object.\n\n#### encode(buffer, offset)\n\nEncode the header fields into the buffer at the specified offset.\n\nReturns `this.needPax` to indicate whether a Pax Extended Header is\nrequired to properly encode the specified data.\n\n### class tar.Pax\n\nAn object representing a set of key-value pairs in an Pax extended\nheader entry.\n\nIt has the following fields.  Where the same name is used, they have\nthe same semantics as the tar.Header field of the same name.\n\n- `global` True if this represents a global extended header, or false\n  if it is for a single entry.\n- `atime`\n- `charset`\n- `comment`\n- `ctime`\n- `gid`\n- `gname`\n- `linkpath`\n- `mtime`\n- `path`\n- `size`\n- `uid`\n- `uname`\n- `dev`\n- `ino`\n- `nlink`\n\n#### constructor(object, global)\n\nSet the fields set in the object.  `global` is a boolean that defaults\nto false.\n\n#### encode()\n\nReturn a Buffer containing the header and body for the Pax extended\nheader entry, or `null` if there is nothing to encode.\n\n#### encodeBody()\n\nReturn a string representing the body of the pax extended header\nentry.\n\n#### encodeField(fieldName)\n\nReturn a string representing the key/value encoding for the specified\nfieldName, or `''` if the field is unset.\n\n### tar.Pax.parse(string, extended, global)\n\nReturn a new Pax object created by parsing the contents of the string\nprovided.\n\nIf the `extended` object is set, then also add the fields from that\nobject.  (This is necessary because multiple metadata entries can\noccur in sequence.)\n\n### tar.types\n\nA translation table for the `type` field in tar headers.\n\n#### tar.types.name.get(code)\n\nGet the human-readable name for a given alphanumeric code.\n\n#### tar.types.code.get(name)\n\nGet the alphanumeric code for a given human-readable name.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/node-tar.git"
+  },
+  "scripts": {
+    "bench": "for i in benchmarks/*/*.js; do echo $i; for j in {1..5}; do node $i || break; done; done",
+    "genparse": "node scripts/generate-parse-fixtures.js",
+    "postpublish": "git push origin --follow-tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap"
+  },
+  "tap": {
+    "coverage-map": "map.js",
+    "check-coverage": true
+  },
+  "version": "4.4.10"
+}
diff --git a/legacy-libs/grpc/node_modules/util-deprecate/History.md b/legacy-libs/grpc/node_modules/util-deprecate/History.md
new file mode 100644 (file)
index 0000000..acc8675
--- /dev/null
@@ -0,0 +1,16 @@
+
+1.0.2 / 2015-10-07
+==================
+
+  * use try/catch when checking `localStorage` (#3, @kumavis)
+
+1.0.1 / 2014-11-25
+==================
+
+  * browser: use `console.warn()` for deprecation calls
+  * browser: more jsdocs
+
+1.0.0 / 2014-04-30
+==================
+
+  * initial commit
diff --git a/legacy-libs/grpc/node_modules/util-deprecate/LICENSE b/legacy-libs/grpc/node_modules/util-deprecate/LICENSE
new file mode 100644 (file)
index 0000000..6a60e8c
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/util-deprecate/README.md b/legacy-libs/grpc/node_modules/util-deprecate/README.md
new file mode 100644 (file)
index 0000000..75622fa
--- /dev/null
@@ -0,0 +1,53 @@
+util-deprecate
+==============
+### The Node.js `util.deprecate()` function with browser support
+
+In Node.js, this module simply re-exports the `util.deprecate()` function.
+
+In the web browser (i.e. via browserify), a browser-specific implementation
+of the `util.deprecate()` function is used.
+
+
+## API
+
+A `deprecate()` function is the only thing exposed by this module.
+
+``` javascript
+// setup:
+exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
+
+
+// users see:
+foo();
+// foo() is deprecated, use bar() instead
+foo();
+foo();
+```
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/util-deprecate/browser.js b/legacy-libs/grpc/node_modules/util-deprecate/browser.js
new file mode 100644 (file)
index 0000000..549ae2f
--- /dev/null
@@ -0,0 +1,67 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+  if (config('noDeprecation')) {
+    return fn;
+  }
+
+  var warned = false;
+  function deprecated() {
+    if (!warned) {
+      if (config('throwDeprecation')) {
+        throw new Error(msg);
+      } else if (config('traceDeprecation')) {
+        console.trace(msg);
+      } else {
+        console.warn(msg);
+      }
+      warned = true;
+    }
+    return fn.apply(this, arguments);
+  }
+
+  return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+  try {
+    if (!global.localStorage) return false;
+  } catch (_) {
+    return false;
+  }
+  var val = global.localStorage[name];
+  if (null == val) return false;
+  return String(val).toLowerCase() === 'true';
+}
diff --git a/legacy-libs/grpc/node_modules/util-deprecate/node.js b/legacy-libs/grpc/node_modules/util-deprecate/node.js
new file mode 100644 (file)
index 0000000..5e6fcff
--- /dev/null
@@ -0,0 +1,6 @@
+
+/**
+ * For Node.js, simply re-export the core `util.deprecate` function.
+ */
+
+module.exports = require('util').deprecate;
diff --git a/legacy-libs/grpc/node_modules/util-deprecate/package.json b/legacy-libs/grpc/node_modules/util-deprecate/package.json
new file mode 100644 (file)
index 0000000..7695504
--- /dev/null
@@ -0,0 +1,65 @@
+{
+  "_args": [
+    [
+      "util-deprecate@1.0.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "util-deprecate@1.0.2",
+  "_id": "util-deprecate@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
+  "_location": "/grpc/util-deprecate",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "util-deprecate@1.0.2",
+    "name": "util-deprecate",
+    "escapedName": "util-deprecate",
+    "rawSpec": "1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "1.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/readable-stream"
+  ],
+  "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Nathan Rajlich",
+    "email": "nathan@tootallnate.net",
+    "url": "http://n8.io/"
+  },
+  "browser": "browser.js",
+  "bugs": {
+    "url": "https://github.com/TooTallNate/util-deprecate/issues"
+  },
+  "dependencies": {},
+  "description": "The Node.js `util.deprecate()` function with browser support",
+  "devDependencies": {},
+  "homepage": "https://github.com/TooTallNate/util-deprecate",
+  "keywords": [
+    "util",
+    "deprecate",
+    "browserify",
+    "browser",
+    "node"
+  ],
+  "license": "MIT",
+  "main": "node.js",
+  "name": "util-deprecate",
+  "optionalDependencies": {},
+  "readme": "util-deprecate\n==============\n### The Node.js `util.deprecate()` function with browser support\n\nIn Node.js, this module simply re-exports the `util.deprecate()` function.\n\nIn the web browser (i.e. via browserify), a browser-specific implementation\nof the `util.deprecate()` function is used.\n\n\n## API\n\nA `deprecate()` function is the only thing exposed by this module.\n\n``` javascript\n// setup:\nexports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');\n\n\n// users see:\nfoo();\n// foo() is deprecated, use bar() instead\nfoo();\nfoo();\n```\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/TooTallNate/util-deprecate.git"
+  },
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc/node_modules/wide-align/LICENSE b/legacy-libs/grpc/node_modules/wide-align/LICENSE
new file mode 100644 (file)
index 0000000..f4be44d
--- /dev/null
@@ -0,0 +1,14 @@
+Copyright (c) 2015, Rebecca Turner <me@re-becca.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/legacy-libs/grpc/node_modules/wide-align/README.md b/legacy-libs/grpc/node_modules/wide-align/README.md
new file mode 100644 (file)
index 0000000..32f1be0
--- /dev/null
@@ -0,0 +1,47 @@
+wide-align
+----------
+
+A wide-character aware text alignment function for use in terminals / on the
+console.
+
+### Usage
+
+```
+var align = require('wide-align')
+
+// Note that if you view this on a unicode console, all of the slashes are
+// aligned. This is because on a console, all narrow characters are
+// an en wide and all wide characters are an em. In browsers, this isn't
+// held to and wide characters like "古" can be less than two narrow
+// characters even with a fixed width font.
+
+console.log(align.center('abc', 10))     // '   abc    '
+console.log(align.center('古古古', 10))  // '  古古古  '
+console.log(align.left('abc', 10))       // 'abc       '
+console.log(align.left('古古古', 10))    // '古古古    '
+console.log(align.right('abc', 10))      // '       abc'
+console.log(align.right('古古古', 10))   // '    古古古'
+```
+
+### Functions
+
+#### `align.center(str, length)` → `str`
+
+Returns *str* with spaces added to both sides such that that it is *length*
+chars long and centered in the spaces.
+
+#### `align.left(str, length)` → `str`
+
+Returns *str* with spaces to the right such that it is *length* chars long.
+
+### `align.right(str, length)` → `str`
+
+Returns *str* with spaces to the left such that it is *length* chars long.
+
+### Origins
+
+These functions were originally taken from 
+[cliui](https://npmjs.com/package/cliui). Changes include switching to the
+MUCH faster pad generation function from
+[lodash](https://npmjs.com/package/lodash), making center alignment pad
+both sides and adding left alignment.
diff --git a/legacy-libs/grpc/node_modules/wide-align/align.js b/legacy-libs/grpc/node_modules/wide-align/align.js
new file mode 100644 (file)
index 0000000..4f94ca4
--- /dev/null
@@ -0,0 +1,65 @@
+'use strict'
+var stringWidth = require('string-width')
+
+exports.center = alignCenter
+exports.left = alignLeft
+exports.right = alignRight
+
+// lodash's way of generating pad characters.
+
+function createPadding (width) {
+  var result = ''
+  var string = ' '
+  var n = width
+  do {
+    if (n % 2) {
+      result += string;
+    }
+    n = Math.floor(n / 2);
+    string += string;
+  } while (n);
+
+  return result;
+}
+
+function alignLeft (str, width) {
+  var trimmed = str.trimRight()
+  if (trimmed.length === 0 && str.length >= width) return str
+  var padding = ''
+  var strWidth = stringWidth(trimmed)
+
+  if (strWidth < width) {
+    padding = createPadding(width - strWidth)
+  }
+
+  return trimmed + padding
+}
+
+function alignRight (str, width) {
+  var trimmed = str.trimLeft()
+  if (trimmed.length === 0 && str.length >= width) return str
+  var padding = ''
+  var strWidth = stringWidth(trimmed)
+
+  if (strWidth < width) {
+    padding = createPadding(width - strWidth)
+  }
+
+  return padding + trimmed
+}
+
+function alignCenter (str, width) {
+  var trimmed = str.trim()
+  if (trimmed.length === 0 && str.length >= width) return str
+  var padLeft = ''
+  var padRight = ''
+  var strWidth = stringWidth(trimmed)
+
+  if (strWidth < width) {
+    var padLeftBy = parseInt((width - strWidth) / 2, 10) 
+    padLeft = createPadding(padLeftBy)
+    padRight = createPadding(width - (strWidth + padLeftBy))
+  }
+
+  return padLeft + trimmed + padRight
+}
diff --git a/legacy-libs/grpc/node_modules/wide-align/package.json b/legacy-libs/grpc/node_modules/wide-align/package.json
new file mode 100644 (file)
index 0000000..5df8f7e
--- /dev/null
@@ -0,0 +1,73 @@
+{
+  "_args": [
+    [
+      "wide-align@1.1.3",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "wide-align@1.1.3",
+  "_id": "wide-align@1.1.3",
+  "_inBundle": false,
+  "_integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
+  "_location": "/grpc/wide-align",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "wide-align@1.1.3",
+    "name": "wide-align",
+    "escapedName": "wide-align",
+    "rawSpec": "1.1.3",
+    "saveSpec": null,
+    "fetchSpec": "1.1.3"
+  },
+  "_requiredBy": [
+    "/grpc/gauge"
+  ],
+  "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.1.3",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Rebecca Turner",
+    "email": "me@re-becca.org",
+    "url": "http://re-becca.org/"
+  },
+  "bugs": {
+    "url": "https://github.com/iarna/wide-align/issues"
+  },
+  "dependencies": {
+    "string-width": "^1.0.2 || 2"
+  },
+  "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.",
+  "devDependencies": {
+    "tap": "10 || 11 || 12"
+  },
+  "files": [
+    "align.js"
+  ],
+  "homepage": "https://github.com/iarna/wide-align#readme",
+  "keywords": [
+    "wide",
+    "double",
+    "unicode",
+    "cjkv",
+    "pad",
+    "align"
+  ],
+  "license": "ISC",
+  "main": "align.js",
+  "name": "wide-align",
+  "optionalDependencies": {},
+  "readme": "wide-align\n----------\n\nA wide-character aware text alignment function for use in terminals / on the\nconsole.\n\n### Usage\n\n```\nvar align = require('wide-align')\n\n// Note that if you view this on a unicode console, all of the slashes are\n// aligned. This is because on a console, all narrow characters are\n// an en wide and all wide characters are an em. In browsers, this isn't\n// held to and wide characters like \"古\" can be less than two narrow\n// characters even with a fixed width font.\n\nconsole.log(align.center('abc', 10))     // '   abc    '\nconsole.log(align.center('古古古', 10))  // '  古古古  '\nconsole.log(align.left('abc', 10))       // 'abc       '\nconsole.log(align.left('古古古', 10))    // '古古古    '\nconsole.log(align.right('abc', 10))      // '       abc'\nconsole.log(align.right('古古古', 10))   // '    古古古'\n```\n\n### Functions\n\n#### `align.center(str, length)` → `str`\n\nReturns *str* with spaces added to both sides such that that it is *length*\nchars long and centered in the spaces.\n\n#### `align.left(str, length)` → `str`\n\nReturns *str* with spaces to the right such that it is *length* chars long.\n\n### `align.right(str, length)` → `str`\n\nReturns *str* with spaces to the left such that it is *length* chars long.\n\n### Origins\n\nThese functions were originally taken from \n[cliui](https://npmjs.com/package/cliui). Changes include switching to the\nMUCH faster pad generation function from\n[lodash](https://npmjs.com/package/lodash), making center alignment pad\nboth sides and adding left alignment.\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/iarna/wide-align.git"
+  },
+  "scripts": {
+    "test": "tap --coverage test/*.js",
+    "version": "perl -pi -e 's/^(  \"version\": $ENV{npm_config_node_version}\").*?\",/$1abc\",/' package-lock.json ; git add package-lock.json"
+  },
+  "version": "1.1.3"
+}
diff --git a/legacy-libs/grpc/node_modules/wrappy/LICENSE b/legacy-libs/grpc/node_modules/wrappy/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/wrappy/README.md b/legacy-libs/grpc/node_modules/wrappy/README.md
new file mode 100644 (file)
index 0000000..98eab25
--- /dev/null
@@ -0,0 +1,36 @@
+# wrappy
+
+Callback wrapping utility
+
+## USAGE
+
+```javascript
+var wrappy = require("wrappy")
+
+// var wrapper = wrappy(wrapperFunction)
+
+// make sure a cb is called only once
+// See also: http://npm.im/once for this specific use case
+var once = wrappy(function (cb) {
+  var called = false
+  return function () {
+    if (called) return
+    called = true
+    return cb.apply(this, arguments)
+  }
+})
+
+function printBoo () {
+  console.log('boo')
+}
+// has some rando property
+printBoo.iAmBooPrinter = true
+
+var onlyPrintOnce = once(printBoo)
+
+onlyPrintOnce() // prints 'boo'
+onlyPrintOnce() // does nothing
+
+// random property is retained!
+assert.equal(onlyPrintOnce.iAmBooPrinter, true)
+```
diff --git a/legacy-libs/grpc/node_modules/wrappy/package.json b/legacy-libs/grpc/node_modules/wrappy/package.json
new file mode 100644 (file)
index 0000000..d4b163d
--- /dev/null
@@ -0,0 +1,66 @@
+{
+  "_args": [
+    [
+      "wrappy@1.0.2",
+      "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core"
+    ]
+  ],
+  "_from": "wrappy@1.0.2",
+  "_id": "wrappy@1.0.2",
+  "_inBundle": false,
+  "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+  "_location": "/grpc/wrappy",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "wrappy@1.0.2",
+    "name": "wrappy",
+    "escapedName": "wrappy",
+    "rawSpec": "1.0.2",
+    "saveSpec": null,
+    "fetchSpec": "1.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/inflight",
+    "/grpc/once"
+  ],
+  "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+  "_shrinkwrap": null,
+  "_spec": "1.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/npm/wrappy/issues"
+  },
+  "dependencies": {},
+  "description": "Callback wrapping utility",
+  "devDependencies": {
+    "tap": "^2.3.1"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "wrappy.js"
+  ],
+  "homepage": "https://github.com/npm/wrappy",
+  "license": "ISC",
+  "main": "wrappy.js",
+  "name": "wrappy",
+  "optionalDependencies": {},
+  "readme": "# wrappy\n\nCallback wrapping utility\n\n## USAGE\n\n```javascript\nvar wrappy = require(\"wrappy\")\n\n// var wrapper = wrappy(wrapperFunction)\n\n// make sure a cb is called only once\n// See also: http://npm.im/once for this specific use case\nvar once = wrappy(function (cb) {\n  var called = false\n  return function () {\n    if (called) return\n    called = true\n    return cb.apply(this, arguments)\n  }\n})\n\nfunction printBoo () {\n  console.log('boo')\n}\n// has some rando property\nprintBoo.iAmBooPrinter = true\n\nvar onlyPrintOnce = once(printBoo)\n\nonlyPrintOnce() // prints 'boo'\nonlyPrintOnce() // does nothing\n\n// random property is retained!\nassert.equal(onlyPrintOnce.iAmBooPrinter, true)\n```\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/npm/wrappy.git"
+  },
+  "scripts": {
+    "test": "tap --coverage test/*.js"
+  },
+  "version": "1.0.2"
+}
diff --git a/legacy-libs/grpc/node_modules/wrappy/wrappy.js b/legacy-libs/grpc/node_modules/wrappy/wrappy.js
new file mode 100644 (file)
index 0000000..bb7e7d6
--- /dev/null
@@ -0,0 +1,33 @@
+// Returns a wrapper function that returns a wrapped callback
+// The wrapper function should do some stuff, and return a
+// presumably different callback function.
+// This makes sure that own properties are retained, so that
+// decorations and such are not lost along the way.
+module.exports = wrappy
+function wrappy (fn, cb) {
+  if (fn && cb) return wrappy(fn)(cb)
+
+  if (typeof fn !== 'function')
+    throw new TypeError('need wrapper function')
+
+  Object.keys(fn).forEach(function (k) {
+    wrapper[k] = fn[k]
+  })
+
+  return wrapper
+
+  function wrapper() {
+    var args = new Array(arguments.length)
+    for (var i = 0; i < args.length; i++) {
+      args[i] = arguments[i]
+    }
+    var ret = fn.apply(this, args)
+    var cb = args[args.length-1]
+    if (typeof ret === 'function' && ret !== cb) {
+      Object.keys(cb).forEach(function (k) {
+        ret[k] = cb[k]
+      })
+    }
+    return ret
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/yallist/LICENSE b/legacy-libs/grpc/node_modules/yallist/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/legacy-libs/grpc/node_modules/yallist/README.md b/legacy-libs/grpc/node_modules/yallist/README.md
new file mode 100644 (file)
index 0000000..f586101
--- /dev/null
@@ -0,0 +1,204 @@
+# yallist
+
+Yet Another Linked List
+
+There are many doubly-linked list implementations like it, but this
+one is mine.
+
+For when an array would be too big, and a Map can't be iterated in
+reverse order.
+
+
+[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist)
+
+## basic usage
+
+```javascript
+var yallist = require('yallist')
+var myList = yallist.create([1, 2, 3])
+myList.push('foo')
+myList.unshift('bar')
+// of course pop() and shift() are there, too
+console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo']
+myList.forEach(function (k) {
+  // walk the list head to tail
+})
+myList.forEachReverse(function (k, index, list) {
+  // walk the list tail to head
+})
+var myDoubledList = myList.map(function (k) {
+  return k + k
+})
+// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo']
+// mapReverse is also a thing
+var myDoubledListReverse = myList.mapReverse(function (k) {
+  return k + k
+}) // ['foofoo', 6, 4, 2, 'barbar']
+
+var reduced = myList.reduce(function (set, entry) {
+  set += entry
+  return set
+}, 'start')
+console.log(reduced) // 'startfoo123bar'
+```
+
+## api
+
+The whole API is considered "public".
+
+Functions with the same name as an Array method work more or less the
+same way.
+
+There's reverse versions of most things because that's the point.
+
+### Yallist
+
+Default export, the class that holds and manages a list.
+
+Call it with either a forEach-able (like an array) or a set of
+arguments, to initialize the list.
+
+The Array-ish methods all act like you'd expect.  No magic length,
+though, so if you change that it won't automatically prune or add
+empty spots.
+
+### Yallist.create(..)
+
+Alias for Yallist function.  Some people like factories.
+
+#### yallist.head
+
+The first node in the list
+
+#### yallist.tail
+
+The last node in the list
+
+#### yallist.length
+
+The number of nodes in the list.  (Change this at your peril.  It is
+not magic like Array length.)
+
+#### yallist.toArray()
+
+Convert the list to an array.
+
+#### yallist.forEach(fn, [thisp])
+
+Call a function on each item in the list.
+
+#### yallist.forEachReverse(fn, [thisp])
+
+Call a function on each item in the list, in reverse order.
+
+#### yallist.get(n)
+
+Get the data at position `n` in the list.  If you use this a lot,
+probably better off just using an Array.
+
+#### yallist.getReverse(n)
+
+Get the data at position `n`, counting from the tail.
+
+#### yallist.map(fn, thisp)
+
+Create a new Yallist with the result of calling the function on each
+item.
+
+#### yallist.mapReverse(fn, thisp)
+
+Same as `map`, but in reverse.
+
+#### yallist.pop()
+
+Get the data from the list tail, and remove the tail from the list.
+
+#### yallist.push(item, ...)
+
+Insert one or more items to the tail of the list.
+
+#### yallist.reduce(fn, initialValue)
+
+Like Array.reduce.
+
+#### yallist.reduceReverse
+
+Like Array.reduce, but in reverse.
+
+#### yallist.reverse
+
+Reverse the list in place.
+
+#### yallist.shift()
+
+Get the data from the list head, and remove the head from the list.
+
+#### yallist.slice([from], [to])
+
+Just like Array.slice, but returns a new Yallist.
+
+#### yallist.sliceReverse([from], [to])
+
+Just like yallist.slice, but the result is returned in reverse.
+
+#### yallist.toArray()
+
+Create an array representation of the list.
+
+#### yallist.toArrayReverse()
+
+Create a reversed array representation of the list.
+
+#### yallist.unshift(item, ...)
+
+Insert one or more items to the head of the list.
+
+#### yallist.unshiftNode(node)
+
+Move a Node object to the front of the list.  (That is, pull it out of
+wherever it lives, and make it the new head.)
+
+If the node belongs to a different list, then that list will remove it
+first.
+
+#### yallist.pushNode(node)
+
+Move a Node object to the end of the list.  (That is, pull it out of
+wherever it lives, and make it the new tail.)
+
+If the node belongs to a list already, then that list will remove it
+first.
+
+#### yallist.removeNode(node)
+
+Remove a node from the list, preserving referential integrity of head
+and tail and other nodes.
+
+Will throw an error if you try to have a list remove a node that
+doesn't belong to it.
+
+### Yallist.Node
+
+The class that holds the data and is actually the list.
+
+Call with `var n = new Node(value, previousNode, nextNode)`
+
+Note that if you do direct operations on Nodes themselves, it's very
+easy to get into weird states where the list is broken.  Be careful :)
+
+#### node.next
+
+The next node in the list.
+
+#### node.prev
+
+The previous node in the list.
+
+#### node.value
+
+The data the node contains.
+
+#### node.list
+
+The list to which this node belongs.  (Null if it does not belong to
+any list.)
diff --git a/legacy-libs/grpc/node_modules/yallist/iterator.js b/legacy-libs/grpc/node_modules/yallist/iterator.js
new file mode 100644 (file)
index 0000000..d41c97a
--- /dev/null
@@ -0,0 +1,8 @@
+'use strict'
+module.exports = function (Yallist) {
+  Yallist.prototype[Symbol.iterator] = function* () {
+    for (let walker = this.head; walker; walker = walker.next) {
+      yield walker.value
+    }
+  }
+}
diff --git a/legacy-libs/grpc/node_modules/yallist/package.json b/legacy-libs/grpc/node_modules/yallist/package.json
new file mode 100644 (file)
index 0000000..7ea729d
--- /dev/null
@@ -0,0 +1,67 @@
+{
+  "_from": "yallist@^3.0.2",
+  "_id": "yallist@3.0.3",
+  "_inBundle": false,
+  "_integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
+  "_location": "/grpc/yallist",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "range",
+    "registry": true,
+    "raw": "yallist@^3.0.2",
+    "name": "yallist",
+    "escapedName": "yallist",
+    "rawSpec": "^3.0.2",
+    "saveSpec": null,
+    "fetchSpec": "^3.0.2"
+  },
+  "_requiredBy": [
+    "/grpc/minipass",
+    "/grpc/tar"
+  ],
+  "_resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
+  "_shasum": "b4b049e314be545e3ce802236d6cd22cd91c3de9",
+  "_shrinkwrap": null,
+  "_spec": "yallist@^3.0.2",
+  "_where": "/usr/local/google/home/mlumish/grpc-node/packages/grpc-native-core/node_modules/tar",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "bugs": {
+    "url": "https://github.com/isaacs/yallist/issues"
+  },
+  "bundleDependencies": false,
+  "dependencies": {},
+  "deprecated": false,
+  "description": "Yet Another Linked List",
+  "devDependencies": {
+    "tap": "^12.1.0"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "files": [
+    "yallist.js",
+    "iterator.js"
+  ],
+  "homepage": "https://github.com/isaacs/yallist#readme",
+  "license": "ISC",
+  "main": "yallist.js",
+  "name": "yallist",
+  "optionalDependencies": {},
+  "readme": "# yallist\n\nYet Another Linked List\n\nThere are many doubly-linked list implementations like it, but this\none is mine.\n\nFor when an array would be too big, and a Map can't be iterated in\nreverse order.\n\n\n[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist)\n\n## basic usage\n\n```javascript\nvar yallist = require('yallist')\nvar myList = yallist.create([1, 2, 3])\nmyList.push('foo')\nmyList.unshift('bar')\n// of course pop() and shift() are there, too\nconsole.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo']\nmyList.forEach(function (k) {\n  // walk the list head to tail\n})\nmyList.forEachReverse(function (k, index, list) {\n  // walk the list tail to head\n})\nvar myDoubledList = myList.map(function (k) {\n  return k + k\n})\n// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo']\n// mapReverse is also a thing\nvar myDoubledListReverse = myList.mapReverse(function (k) {\n  return k + k\n}) // ['foofoo', 6, 4, 2, 'barbar']\n\nvar reduced = myList.reduce(function (set, entry) {\n  set += entry\n  return set\n}, 'start')\nconsole.log(reduced) // 'startfoo123bar'\n```\n\n## api\n\nThe whole API is considered \"public\".\n\nFunctions with the same name as an Array method work more or less the\nsame way.\n\nThere's reverse versions of most things because that's the point.\n\n### Yallist\n\nDefault export, the class that holds and manages a list.\n\nCall it with either a forEach-able (like an array) or a set of\narguments, to initialize the list.\n\nThe Array-ish methods all act like you'd expect.  No magic length,\nthough, so if you change that it won't automatically prune or add\nempty spots.\n\n### Yallist.create(..)\n\nAlias for Yallist function.  Some people like factories.\n\n#### yallist.head\n\nThe first node in the list\n\n#### yallist.tail\n\nThe last node in the list\n\n#### yallist.length\n\nThe number of nodes in the list.  (Change this at your peril.  It is\nnot magic like Array length.)\n\n#### yallist.toArray()\n\nConvert the list to an array.\n\n#### yallist.forEach(fn, [thisp])\n\nCall a function on each item in the list.\n\n#### yallist.forEachReverse(fn, [thisp])\n\nCall a function on each item in the list, in reverse order.\n\n#### yallist.get(n)\n\nGet the data at position `n` in the list.  If you use this a lot,\nprobably better off just using an Array.\n\n#### yallist.getReverse(n)\n\nGet the data at position `n`, counting from the tail.\n\n#### yallist.map(fn, thisp)\n\nCreate a new Yallist with the result of calling the function on each\nitem.\n\n#### yallist.mapReverse(fn, thisp)\n\nSame as `map`, but in reverse.\n\n#### yallist.pop()\n\nGet the data from the list tail, and remove the tail from the list.\n\n#### yallist.push(item, ...)\n\nInsert one or more items to the tail of the list.\n\n#### yallist.reduce(fn, initialValue)\n\nLike Array.reduce.\n\n#### yallist.reduceReverse\n\nLike Array.reduce, but in reverse.\n\n#### yallist.reverse\n\nReverse the list in place.\n\n#### yallist.shift()\n\nGet the data from the list head, and remove the head from the list.\n\n#### yallist.slice([from], [to])\n\nJust like Array.slice, but returns a new Yallist.\n\n#### yallist.sliceReverse([from], [to])\n\nJust like yallist.slice, but the result is returned in reverse.\n\n#### yallist.toArray()\n\nCreate an array representation of the list.\n\n#### yallist.toArrayReverse()\n\nCreate a reversed array representation of the list.\n\n#### yallist.unshift(item, ...)\n\nInsert one or more items to the head of the list.\n\n#### yallist.unshiftNode(node)\n\nMove a Node object to the front of the list.  (That is, pull it out of\nwherever it lives, and make it the new head.)\n\nIf the node belongs to a different list, then that list will remove it\nfirst.\n\n#### yallist.pushNode(node)\n\nMove a Node object to the end of the list.  (That is, pull it out of\nwherever it lives, and make it the new tail.)\n\nIf the node belongs to a list already, then that list will remove it\nfirst.\n\n#### yallist.removeNode(node)\n\nRemove a node from the list, preserving referential integrity of head\nand tail and other nodes.\n\nWill throw an error if you try to have a list remove a node that\ndoesn't belong to it.\n\n### Yallist.Node\n\nThe class that holds the data and is actually the list.\n\nCall with `var n = new Node(value, previousNode, nextNode)`\n\nNote that if you do direct operations on Nodes themselves, it's very\neasy to get into weird states where the list is broken.  Be careful :)\n\n#### node.next\n\nThe next node in the list.\n\n#### node.prev\n\nThe previous node in the list.\n\n#### node.value\n\nThe data the node contains.\n\n#### node.list\n\nThe list to which this node belongs.  (Null if it does not belong to\nany list.)\n",
+  "readmeFilename": "README.md",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/yallist.git"
+  },
+  "scripts": {
+    "postpublish": "git push origin --all; git push origin --tags",
+    "postversion": "npm publish",
+    "preversion": "npm test",
+    "test": "tap test/*.js --100"
+  },
+  "version": "3.0.3"
+}
diff --git a/legacy-libs/grpc/node_modules/yallist/yallist.js b/legacy-libs/grpc/node_modules/yallist/yallist.js
new file mode 100644 (file)
index 0000000..b0ab36c
--- /dev/null
@@ -0,0 +1,376 @@
+'use strict'
+module.exports = Yallist
+
+Yallist.Node = Node
+Yallist.create = Yallist
+
+function Yallist (list) {
+  var self = this
+  if (!(self instanceof Yallist)) {
+    self = new Yallist()
+  }
+
+  self.tail = null
+  self.head = null
+  self.length = 0
+
+  if (list && typeof list.forEach === 'function') {
+    list.forEach(function (item) {
+      self.push(item)
+    })
+  } else if (arguments.length > 0) {
+    for (var i = 0, l = arguments.length; i < l; i++) {
+      self.push(arguments[i])
+    }
+  }
+
+  return self
+}
+
+Yallist.prototype.removeNode = function (node) {
+  if (node.list !== this) {
+    throw new Error('removing node which does not belong to this list')
+  }
+
+  var next = node.next
+  var prev = node.prev
+
+  if (next) {
+    next.prev = prev
+  }
+
+  if (prev) {
+    prev.next = next
+  }
+
+  if (node === this.head) {
+    this.head = next
+  }
+  if (node === this.tail) {
+    this.tail = prev
+  }
+
+  node.list.length--
+  node.next = null
+  node.prev = null
+  node.list = null
+}
+
+Yallist.prototype.unshiftNode = function (node) {
+  if (node === this.head) {
+    return
+  }
+
+  if (node.list) {
+    node.list.removeNode(node)
+  }
+
+  var head = this.head
+  node.list = this
+  node.next = head
+  if (head) {
+    head.prev = node
+  }
+
+  this.head = node
+  if (!this.tail) {
+    this.tail = node
+  }
+  this.length++
+}
+
+Yallist.prototype.pushNode = function (node) {
+  if (node === this.tail) {
+    return
+  }
+
+  if (node.list) {
+    node.list.removeNode(node)
+  }
+
+  var tail = this.tail
+  node.list = this
+  node.prev = tail
+  if (tail) {
+    tail.next = node
+  }
+
+  this.tail = node
+  if (!this.head) {
+    this.head = node
+  }
+  this.length++
+}
+
+Yallist.prototype.push = function () {
+  for (var i = 0, l = arguments.length; i < l; i++) {
+    push(this, arguments[i])
+  }
+  return this.length
+}
+
+Yallist.prototype.unshift = function () {
+  for (var i = 0, l = arguments.length; i < l; i++) {
+    unshift(this, arguments[i])
+  }
+  return this.length
+}
+
+Yallist.prototype.pop = function () {
+  if (!this.tail) {
+    return undefined
+  }
+
+  var res = this.tail.value
+  this.tail = this.tail.prev
+  if (this.tail) {
+    this.tail.next = null
+  } else {
+    this.head = null
+  }
+  this.length--
+  return res
+}
+
+Yallist.prototype.shift = function () {
+  if (!this.head) {
+    return undefined
+  }
+
+  var res = this.head.value
+  this.head = this.head.next
+  if (this.head) {
+    this.head.prev = null
+  } else {
+    this.tail = null
+  }
+  this.length--
+  return res
+}
+
+Yallist.prototype.forEach = function (fn, thisp) {
+  thisp = thisp || this
+  for (var walker = this.head, i = 0; walker !== null; i++) {
+    fn.call(thisp, walker.value, i, this)
+    walker = walker.next
+  }
+}
+
+Yallist.prototype.forEachReverse = function (fn, thisp) {
+  thisp = thisp || this
+  for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
+    fn.call(thisp, walker.value, i, this)
+    walker = walker.prev
+  }
+}
+
+Yallist.prototype.get = function (n) {
+  for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
+    // abort out of the list early if we hit a cycle
+    walker = walker.next
+  }
+  if (i === n && walker !== null) {
+    return walker.value
+  }
+}
+
+Yallist.prototype.getReverse = function (n) {
+  for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
+    // abort out of the list early if we hit a cycle
+    walker = walker.prev
+  }
+  if (i === n && walker !== null) {
+    return walker.value
+  }
+}
+
+Yallist.prototype.map = function (fn, thisp) {
+  thisp = thisp || this
+  var res = new Yallist()
+  for (var walker = this.head; walker !== null;) {
+    res.push(fn.call(thisp, walker.value, this))
+    walker = walker.next
+  }
+  return res
+}
+
+Yallist.prototype.mapReverse = function (fn, thisp) {
+  thisp = thisp || this
+  var res = new Yallist()
+  for (var walker = this.tail; walker !== null;) {
+    res.push(fn.call(thisp, walker.value, this))
+    walker = walker.prev
+  }
+  return res
+}
+
+Yallist.prototype.reduce = function (fn, initial) {
+  var acc
+  var walker = this.head
+  if (arguments.length > 1) {
+    acc = initial
+  } else if (this.head) {
+    walker = this.head.next
+    acc = this.head.value
+  } else {
+    throw new TypeError('Reduce of empty list with no initial value')
+  }
+
+  for (var i = 0; walker !== null; i++) {
+    acc = fn(acc, walker.value, i)
+    walker = walker.next
+  }
+
+  return acc
+}
+
+Yallist.prototype.reduceReverse = function (fn, initial) {
+  var acc
+  var walker = this.tail
+  if (arguments.length > 1) {
+    acc = initial
+  } else if (this.tail) {
+    walker = this.tail.prev
+    acc = this.tail.value
+  } else {
+    throw new TypeError('Reduce of empty list with no initial value')
+  }
+
+  for (var i = this.length - 1; walker !== null; i--) {
+    acc = fn(acc, walker.value, i)
+    walker = walker.prev
+  }
+
+  return acc
+}
+
+Yallist.prototype.toArray = function () {
+  var arr = new Array(this.length)
+  for (var i = 0, walker = this.head; walker !== null; i++) {
+    arr[i] = walker.value
+    walker = walker.next
+  }
+  return arr
+}
+
+Yallist.prototype.toArrayReverse = function () {
+  var arr = new Array(this.length)
+  for (var i = 0, walker = this.tail; walker !== null; i++) {
+    arr[i] = walker.value
+    walker = walker.prev
+  }
+  return arr
+}
+
+Yallist.prototype.slice = function (from, to) {
+  to = to || this.length
+  if (to < 0) {
+    to += this.length
+  }
+  from = from || 0
+  if (from < 0) {
+    from += this.length
+  }
+  var ret = new Yallist()
+  if (to < from || to < 0) {
+    return ret
+  }
+  if (from < 0) {
+    from = 0
+  }
+  if (to > this.length) {
+    to = this.length
+  }
+  for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
+    walker = walker.next
+  }
+  for (; walker !== null && i < to; i++, walker = walker.next) {
+    ret.push(walker.value)
+  }
+  return ret
+}
+
+Yallist.prototype.sliceReverse = function (from, to) {
+  to = to || this.length
+  if (to < 0) {
+    to += this.length
+  }
+  from = from || 0
+  if (from < 0) {
+    from += this.length
+  }
+  var ret = new Yallist()
+  if (to < from || to < 0) {
+    return ret
+  }
+  if (from < 0) {
+    from = 0
+  }
+  if (to > this.length) {
+    to = this.length
+  }
+  for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
+    walker = walker.prev
+  }
+  for (; walker !== null && i > from; i--, walker = walker.prev) {
+    ret.push(walker.value)
+  }
+  return ret
+}
+
+Yallist.prototype.reverse = function () {
+  var head = this.head
+  var tail = this.tail
+  for (var walker = head; walker !== null; walker = walker.prev) {
+    var p = walker.prev
+    walker.prev = walker.next
+    walker.next = p
+  }
+  this.head = tail
+  this.tail = head
+  return this
+}
+
+function push (self, item) {
+  self.tail = new Node(item, self.tail, null, self)
+  if (!self.head) {
+    self.head = self.tail
+  }
+  self.length++
+}
+
+function unshift (self, item) {
+  self.head = new Node(item, null, self.head, self)
+  if (!self.tail) {
+    self.tail = self.head
+  }
+  self.length++
+}
+
+function Node (value, prev, next, list) {
+  if (!(this instanceof Node)) {
+    return new Node(value, prev, next, list)
+  }
+
+  this.list = list
+  this.value = value
+
+  if (prev) {
+    prev.next = this
+    this.prev = prev
+  } else {
+    this.prev = null
+  }
+
+  if (next) {
+    next.prev = this
+    this.next = next
+  } else {
+    this.next = null
+  }
+}
+
+try {
+  // add if support for Symbol.iterator is present
+  require('./iterator.js')(Yallist)
+} catch (er) {}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/LICENSE b/legacy-libs/protobufjs/node_modules/@types/node/LICENSE
new file mode 100644 (file)
index 0000000..9e841e7
--- /dev/null
@@ -0,0 +1,21 @@
+    MIT License
+
+    Copyright (c) Microsoft Corporation.
+
+    Permission is hereby granted, free of charge, to any person obtaining a copy
+    of this software and associated documentation files (the "Software"), to deal
+    in the Software without restriction, including without limitation the rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in all
+    copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+    SOFTWARE
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/README.md b/legacy-libs/protobufjs/node_modules/@types/node/README.md
new file mode 100644 (file)
index 0000000..fd338d9
--- /dev/null
@@ -0,0 +1,16 @@
+# Installation\r
+> `npm install --save @types/node`\r
+\r
+# Summary\r
+This package contains type definitions for Node.js (http://nodejs.org/).\r
+\r
+# Details\r
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v13.\r
+\r
+### Additional Details\r
+ * Last updated: Wed, 23 Dec 2020 20:23:17 GMT\r
+ * Dependencies: none\r
+ * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`\r
+\r
+# Credits\r
+These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alexander T.](https://github.com/a-tarasyuk), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Bruno Scheufler](https://github.com/brunoscheufler), [Chigozirim C.](https://github.com/smac89), [Christian Vaagland Tellnes](https://github.com/tellnes), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Flarna](https://github.com/Flarna), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Jordi Oliveras Rovira](https://github.com/j-oliveras), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Jason Kwok](https://github.com/JasonHK).\r
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/assert.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/assert.d.ts
new file mode 100644 (file)
index 0000000..9a260e1
--- /dev/null
@@ -0,0 +1,102 @@
+declare module 'assert' {
+    function assert(value: any, message?: string | Error): asserts value;
+    namespace assert {
+        class AssertionError implements Error {
+            name: string;
+            message: string;
+            actual: any;
+            expected: any;
+            operator: string;
+            generatedMessage: boolean;
+            code: 'ERR_ASSERTION';
+
+            constructor(options?: {
+                message?: string;
+                actual?: any;
+                expected?: any;
+                operator?: string;
+                // tslint:disable-next-line:ban-types
+                stackStartFn?: Function;
+            });
+        }
+
+        type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
+
+        function fail(message?: string | Error): never;
+        /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
+        function fail(
+            actual: any,
+            expected: any,
+            message?: string | Error,
+            operator?: string,
+            // tslint:disable-next-line:ban-types
+            stackStartFn?: Function,
+        ): never;
+        function ok(value: any, message?: string | Error): asserts value;
+        /** @deprecated since v9.9.0 - use strictEqual() instead. */
+        function equal(actual: any, expected: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
+        function notEqual(actual: any, expected: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
+        function deepEqual(actual: any, expected: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
+        function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
+        function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
+        function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
+        function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
+        function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
+
+        function throws(block: () => any, message?: string | Error): void;
+        function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
+        function doesNotThrow(block: () => any, message?: string | Error): void;
+        function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
+
+        function ifError(value: any): asserts value is null | undefined;
+
+        function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
+        function rejects(
+            block: (() => Promise<any>) | Promise<any>,
+            error: AssertPredicate,
+            message?: string | Error,
+        ): Promise<void>;
+        function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
+        function doesNotReject(
+            block: (() => Promise<any>) | Promise<any>,
+            error: AssertPredicate,
+            message?: string | Error,
+        ): Promise<void>;
+
+        function match(value: string, regExp: RegExp, message?: string | Error): void;
+        function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
+
+        const strict: Omit<
+            typeof assert,
+            | 'equal'
+            | 'notEqual'
+            | 'deepEqual'
+            | 'notDeepEqual'
+            | 'ok'
+            | 'strictEqual'
+            | 'deepStrictEqual'
+            | 'ifError'
+            | 'strict'
+        > & {
+            (value: any, message?: string | Error): asserts value;
+            equal: typeof strictEqual;
+            notEqual: typeof notStrictEqual;
+            deepEqual: typeof deepStrictEqual;
+            notDeepEqual: typeof notDeepStrictEqual;
+
+            // Mapped types and assertion functions are incompatible?
+            // TS2775: Assertions require every name in the call target
+            // to be declared with an explicit type annotation.
+            ok: typeof ok;
+            strictEqual: typeof strictEqual;
+            deepStrictEqual: typeof deepStrictEqual;
+            ifError: typeof ifError;
+            strict: typeof strict;
+        };
+    }
+
+    export = assert;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/async_hooks.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/async_hooks.d.ts
new file mode 100644 (file)
index 0000000..a32036a
--- /dev/null
@@ -0,0 +1,247 @@
+/**
+ * Async Hooks module: https://nodejs.org/api/async_hooks.html
+ */
+declare module "async_hooks" {
+    /**
+     * Returns the asyncId of the current execution context.
+     */
+    function executionAsyncId(): number;
+
+    /**
+     * The resource representing the current execution.
+     *  Useful to store data within the resource.
+     *
+     * Resource objects returned by `executionAsyncResource()` are most often internal
+     * Node.js handle objects with undocumented APIs. Using any functions or properties
+     * on the object is likely to crash your application and should be avoided.
+     *
+     * Using `executionAsyncResource()` in the top-level execution context will
+     * return an empty object as there is no handle or request object to use,
+     * but having an object representing the top-level can be helpful.
+     */
+    function executionAsyncResource(): object;
+
+    /**
+     * Returns the ID of the resource responsible for calling the callback that is currently being executed.
+     */
+    function triggerAsyncId(): number;
+
+    interface HookCallbacks {
+        /**
+         * Called when a class is constructed that has the possibility to emit an asynchronous event.
+         * @param asyncId a unique ID for the async resource
+         * @param type the type of the async resource
+         * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
+         * @param resource reference to the resource representing the async operation, needs to be released during destroy
+         */
+        init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
+
+        /**
+         * When an asynchronous operation is initiated or completes a callback is called to notify the user.
+         * The before callback is called just before said callback is executed.
+         * @param asyncId the unique identifier assigned to the resource about to execute the callback.
+         */
+        before?(asyncId: number): void;
+
+        /**
+         * Called immediately after the callback specified in before is completed.
+         * @param asyncId the unique identifier assigned to the resource which has executed the callback.
+         */
+        after?(asyncId: number): void;
+
+        /**
+         * Called when a promise has resolve() called. This may not be in the same execution id
+         * as the promise itself.
+         * @param asyncId the unique id for the promise that was resolve()d.
+         */
+        promiseResolve?(asyncId: number): void;
+
+        /**
+         * Called after the resource corresponding to asyncId is destroyed
+         * @param asyncId a unique ID for the async resource
+         */
+        destroy?(asyncId: number): void;
+    }
+
+    interface AsyncHook {
+        /**
+         * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
+         */
+        enable(): this;
+
+        /**
+         * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
+         */
+        disable(): this;
+    }
+
+    /**
+     * Registers functions to be called for different lifetime events of each async operation.
+     * @param options the callbacks to register
+     * @return an AsyncHooks instance used for disabling and enabling hooks
+     */
+    function createHook(options: HookCallbacks): AsyncHook;
+
+    interface AsyncResourceOptions {
+      /**
+       * The ID of the execution context that created this async event.
+       * Default: `executionAsyncId()`
+       */
+      triggerAsyncId?: number;
+
+      /**
+       * Disables automatic `emitDestroy` when the object is garbage collected.
+       * This usually does not need to be set (even if `emitDestroy` is called
+       * manually), unless the resource's `asyncId` is retrieved and the
+       * sensitive API's `emitDestroy` is called with it.
+       * Default: `false`
+       */
+      requireManualDestroy?: boolean;
+    }
+
+    /**
+     * The class AsyncResource was designed to be extended by the embedder's async resources.
+     * Using this users can easily trigger the lifetime events of their own resources.
+     */
+    class AsyncResource {
+        /**
+         * AsyncResource() is meant to be extended. Instantiating a
+         * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
+         * async_hook.executionAsyncId() is used.
+         * @param type The type of async event.
+         * @param triggerAsyncId The ID of the execution context that created
+         *   this async event (default: `executionAsyncId()`), or an
+         *   AsyncResourceOptions object (since 9.3)
+         */
+        constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
+
+        /**
+         * Call the provided function with the provided arguments in the
+         * execution context of the async resource. This will establish the
+         * context, trigger the AsyncHooks before callbacks, call the function,
+         * trigger the AsyncHooks after callbacks, and then restore the original
+         * execution context.
+         * @param fn The function to call in the execution context of this
+         *   async resource.
+         * @param thisArg The receiver to be used for the function call.
+         * @param args Optional arguments to pass to the function.
+         */
+        runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
+
+        /**
+         * Call AsyncHooks destroy callbacks.
+         */
+        emitDestroy(): void;
+
+        /**
+         * @return the unique ID assigned to this AsyncResource instance.
+         */
+        asyncId(): number;
+
+        /**
+         * @return the trigger ID for this AsyncResource instance.
+         */
+        triggerAsyncId(): number;
+    }
+
+    /**
+     * When having multiple instances of `AsyncLocalStorage`, they are independent
+     * from each other. It is safe to instantiate this class multiple times.
+     */
+    class AsyncLocalStorage<T> {
+        /**
+         * This method disables the instance of `AsyncLocalStorage`. All subsequent calls
+         * to `asyncLocalStorage.getStore()` will return `undefined` until
+         * `asyncLocalStorage.run()` or `asyncLocalStorage.runSyncAndReturn()`
+         * is called again.
+         *
+         * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
+         * instance will be exited.
+         *
+         * Calling `asyncLocalStorage.disable()` is required before the
+         * `asyncLocalStorage` can be garbage collected. This does not apply to stores
+         * provided by the `asyncLocalStorage`, as those objects are garbage collected
+         * along with the corresponding async resources.
+         *
+         * This method is to be used when the `asyncLocalStorage` is not in use anymore
+         * in the current process.
+         */
+        disable(): void;
+
+        /**
+         * This method returns the current store.
+         * If this method is called outside of an asynchronous context initialized by
+         * calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will
+         * return `undefined`.
+         */
+        getStore(): T | undefined;
+
+        /**
+         * Calling `asyncLocalStorage.run(callback)` will create a new asynchronous
+         * context.
+         * Within the callback function and the asynchronous operations from the callback,
+         * `asyncLocalStorage.getStore()` will return an instance of `Map` known as
+         * "the store". This store will be persistent through the following
+         * asynchronous calls.
+         *
+         * The callback will be ran asynchronously. Optionally, arguments can be passed
+         * to the function. They will be passed to the callback function.
+         *
+         * If an error is thrown by the callback function, it will not be caught by
+         * a `try/catch` block as the callback is ran in a new asynchronous resource.
+         * Also, the stacktrace will be impacted by the asynchronous call.
+         */
+        // TODO: Apply generic vararg once available
+        run(store: T, callback: (...args: any[]) => void, ...args: any[]): void;
+
+        /**
+         * Calling `asyncLocalStorage.exit(callback)` will create a new asynchronous
+         * context.
+         * Within the callback function and the asynchronous operations from the callback,
+         * `asyncLocalStorage.getStore()` will return `undefined`.
+         *
+         * The callback will be ran asynchronously. Optionally, arguments can be passed
+         * to the function. They will be passed to the callback function.
+         *
+         * If an error is thrown by the callback function, it will not be caught by
+         * a `try/catch` block as the callback is ran in a new asynchronous resource.
+         * Also, the stacktrace will be impacted by the asynchronous call.
+         */
+        exit(callback: (...args: any[]) => void, ...args: any[]): void;
+
+        /**
+         * This methods runs a function synchronously within a context and return its
+         * return value. The store is not accessible outside of the callback function or
+         * the asynchronous operations created within the callback.
+         *
+         * Optionally, arguments can be passed to the function. They will be passed to
+         * the callback function.
+         *
+         * If the callback function throws an error, it will be thrown by
+         * `runSyncAndReturn` too. The stacktrace will not be impacted by this call and
+         * the context will be exited.
+         */
+        runSyncAndReturn<R>(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
+
+        /**
+         * This methods runs a function synchronously outside of a context and return its
+         * return value. The store is not accessible within the callback function or
+         * the asynchronous operations created within the callback.
+         *
+         * Optionally, arguments can be passed to the function. They will be passed to
+         * the callback function.
+         *
+         * If the callback function throws an error, it will be thrown by
+         * `exitSyncAndReturn` too. The stacktrace will not be impacted by this call and
+         * the context will be re-entered.
+         */
+        exitSyncAndReturn<R>(callback: (...args: any[]) => R, ...args: any[]): R;
+
+        /**
+         * Calling `asyncLocalStorage.enterWith(store)` will transition into the context
+         * for the remainder of the current synchronous execution and will persist
+         * through any following asynchronous calls.
+         */
+        enterWith(store: T): void;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/base.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/base.d.ts
new file mode 100644 (file)
index 0000000..fa67179
--- /dev/null
@@ -0,0 +1,19 @@
+// NOTE: These definitions support NodeJS and TypeScript 3.7.
+
+// NOTE: TypeScript version-specific augmentations can be found in the following paths:
+//          - ~/base.d.ts         - Shared definitions common to all TypeScript versions
+//          - ~/index.d.ts        - Definitions specific to TypeScript 2.1
+//          - ~/ts3.7/base.d.ts   - Definitions specific to TypeScript 3.7
+//          - ~/ts3.7/index.d.ts  - Definitions specific to TypeScript 3.7 with assert pulled in
+
+// Reference required types from the default lib:
+/// <reference lib="es2018" />
+/// <reference lib="esnext.asynciterable" />
+/// <reference lib="esnext.intl" />
+/// <reference lib="esnext.bigint" />
+
+// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
+/// <reference path="ts3.6/base.d.ts" />
+
+// TypeScript 3.7-specific augmentations:
+/// <reference path="assert.d.ts" />
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/buffer.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/buffer.d.ts
new file mode 100644 (file)
index 0000000..7eb1061
--- /dev/null
@@ -0,0 +1,22 @@
+declare module "buffer" {
+    export const INSPECT_MAX_BYTES: number;
+    export const kMaxLength: number;
+    export const kStringMaxLength: number;
+    export const constants: {
+        MAX_LENGTH: number;
+        MAX_STRING_LENGTH: number;
+    };
+    const BuffType: typeof Buffer;
+
+    export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
+
+    export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
+
+    export const SlowBuffer: {
+        /** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */
+        new(size: number): Buffer;
+        prototype: Buffer;
+    };
+
+    export { BuffType as Buffer };
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/child_process.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/child_process.d.ts
new file mode 100644 (file)
index 0000000..66b3ef2
--- /dev/null
@@ -0,0 +1,504 @@
+declare module "child_process" {
+    import * as events from "events";
+    import * as net from "net";
+    import { Writable, Readable, Stream, Pipe } from "stream";
+
+    type Serializable = string | object | number | boolean;
+    type SendHandle = net.Socket | net.Server;
+
+    interface ChildProcess extends events.EventEmitter {
+        stdin: Writable | null;
+        stdout: Readable | null;
+        stderr: Readable | null;
+        readonly channel?: Pipe | null;
+        readonly stdio: [
+            Writable | null, // stdin
+            Readable | null, // stdout
+            Readable | null, // stderr
+            Readable | Writable | null | undefined, // extra
+            Readable | Writable | null | undefined // extra
+        ];
+        readonly killed: boolean;
+        readonly pid: number;
+        readonly connected: boolean;
+        readonly exitCode: number | null;
+        readonly signalCode: number | null;
+        readonly spawnargs: string[];
+        readonly spawnfile: string;
+        kill(signal?: NodeJS.Signals | number): boolean;
+        send(message: Serializable, callback?: (error: Error | null) => void): boolean;
+        send(message: Serializable, sendHandle?: SendHandle, callback?: (error: Error | null) => void): boolean;
+        send(message: Serializable, sendHandle?: SendHandle, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
+        disconnect(): void;
+        unref(): void;
+        ref(): void;
+
+        /**
+         * events.EventEmitter
+         * 1. close
+         * 2. disconnect
+         * 3. error
+         * 4. exit
+         * 5. message
+         */
+
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
+        addListener(event: "disconnect", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+        addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "close", code: number, signal: NodeJS.Signals): boolean;
+        emit(event: "disconnect"): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
+        emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
+        on(event: "disconnect", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+        on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
+        once(event: "disconnect", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+        once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
+        prependListener(event: "disconnect", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+        prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
+        prependOnceListener(event: "disconnect", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
+        prependOnceListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
+    }
+
+    // return this object when stdio option is undefined or not specified
+    interface ChildProcessWithoutNullStreams extends ChildProcess {
+        stdin: Writable;
+        stdout: Readable;
+        stderr: Readable;
+        readonly stdio: [
+            Writable, // stdin
+            Readable, // stdout
+            Readable, // stderr
+            Readable | Writable | null | undefined, // extra, no modification
+            Readable | Writable | null | undefined // extra, no modification
+        ];
+    }
+
+    // return this object when stdio option is a tuple of 3
+    interface ChildProcessByStdio<
+        I extends null | Writable,
+        O extends null | Readable,
+        E extends null | Readable,
+    > extends ChildProcess {
+        stdin: I;
+        stdout: O;
+        stderr: E;
+        readonly stdio: [
+            I,
+            O,
+            E,
+            Readable | Writable | null | undefined, // extra, no modification
+            Readable | Writable | null | undefined // extra, no modification
+        ];
+    }
+
+    interface MessageOptions {
+        keepOpen?: boolean;
+    }
+
+    type StdioOptions = "pipe" | "ignore" | "inherit" | Array<("pipe" | "ipc" | "ignore" | "inherit" | Stream | number | null | undefined)>;
+
+    type SerializationType = 'json' | 'advanced';
+
+    interface MessagingOptions {
+        /**
+         * Specify the kind of serialization used for sending messages between processes.
+         * @default 'json'
+         */
+        serialization?: SerializationType;
+    }
+
+    interface ProcessEnvOptions {
+        uid?: number;
+        gid?: number;
+        cwd?: string;
+        env?: NodeJS.ProcessEnv;
+    }
+
+    interface CommonOptions extends ProcessEnvOptions {
+        /**
+         * @default true
+         */
+        windowsHide?: boolean;
+        /**
+         * @default 0
+         */
+        timeout?: number;
+    }
+
+    interface CommonSpawnOptions extends CommonOptions, MessagingOptions {
+        argv0?: string;
+        stdio?: StdioOptions;
+        shell?: boolean | string;
+        windowsVerbatimArguments?: boolean;
+    }
+
+    interface SpawnOptions extends CommonSpawnOptions {
+        detached?: boolean;
+    }
+
+    interface SpawnOptionsWithoutStdio extends SpawnOptions {
+        stdio?: 'pipe' | Array<null | undefined | 'pipe'>;
+    }
+
+    type StdioNull = 'inherit' | 'ignore' | Stream;
+    type StdioPipe = undefined | null | 'pipe';
+
+    interface SpawnOptionsWithStdioTuple<
+        Stdin extends StdioNull | StdioPipe,
+        Stdout extends StdioNull | StdioPipe,
+        Stderr extends StdioNull | StdioPipe,
+    > extends SpawnOptions {
+        stdio: [Stdin, Stdout, Stderr];
+    }
+
+    // overloads of spawn without 'args'
+    function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
+    ): ChildProcessByStdio<Writable, Readable, Readable>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
+    ): ChildProcessByStdio<Writable, Readable, null>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
+    ): ChildProcessByStdio<Writable, null, Readable>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
+    ): ChildProcessByStdio<null, Readable, Readable>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
+    ): ChildProcessByStdio<Writable, null, null>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
+    ): ChildProcessByStdio<null, Readable, null>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
+    ): ChildProcessByStdio<null, null, Readable>;
+    function spawn(
+        command: string,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
+    ): ChildProcessByStdio<null, null, null>;
+
+    function spawn(command: string, options: SpawnOptions): ChildProcess;
+
+    // overloads of spawn with 'args'
+    function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
+
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
+    ): ChildProcessByStdio<Writable, Readable, Readable>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
+    ): ChildProcessByStdio<Writable, Readable, null>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
+    ): ChildProcessByStdio<Writable, null, Readable>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
+    ): ChildProcessByStdio<null, Readable, Readable>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
+    ): ChildProcessByStdio<Writable, null, null>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
+    ): ChildProcessByStdio<null, Readable, null>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
+    ): ChildProcessByStdio<null, null, Readable>;
+    function spawn(
+        command: string,
+        args: ReadonlyArray<string>,
+        options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
+    ): ChildProcessByStdio<null, null, null>;
+
+    function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
+
+    interface ExecOptions extends CommonOptions {
+        shell?: string;
+        maxBuffer?: number;
+        killSignal?: NodeJS.Signals | number;
+    }
+
+    interface ExecOptionsWithStringEncoding extends ExecOptions {
+        encoding: BufferEncoding;
+    }
+
+    interface ExecOptionsWithBufferEncoding extends ExecOptions {
+        encoding: string | null; // specify `null`.
+    }
+
+    interface ExecException extends Error {
+        cmd?: string;
+        killed?: boolean;
+        code?: number;
+        signal?: NodeJS.Signals;
+    }
+
+    // no `options` definitely means stdout/stderr are `string`.
+    function exec(command: string, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+    // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+    function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+
+    // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+    function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+    // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+    // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+    function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess;
+
+    // `options` without an `encoding` means stdout/stderr are definitely `string`.
+    function exec(command: string, options: ExecOptions, callback?: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+    // fallback if nothing else matches. Worst case is always `string | Buffer`.
+    function exec(
+        command: string,
+        options: ({ encoding?: string | null } & ExecOptions) | undefined | null,
+        callback?: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+    ): ChildProcess;
+
+    interface PromiseWithChild<T> extends Promise<T> {
+        child: ChildProcess;
+    }
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace exec {
+        function __promisify__(command: string): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
+        function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(command: string, options: ExecOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+    }
+
+    interface ExecFileOptions extends CommonOptions {
+        maxBuffer?: number;
+        killSignal?: NodeJS.Signals | number;
+        windowsVerbatimArguments?: boolean;
+        shell?: boolean | string;
+    }
+    interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {
+        encoding: BufferEncoding;
+    }
+    interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {
+        encoding: 'buffer' | null;
+    }
+    interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
+        encoding: string;
+    }
+
+    function execFile(file: string): ChildProcess;
+    function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
+    function execFile(file: string, args?: ReadonlyArray<string> | null): ChildProcess;
+    function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
+
+    // no `options` definitely means stdout/stderr are `string`.
+    function execFile(file: string, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+    function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+
+    // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
+    function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
+    function execFile(
+        file: string,
+        args: ReadonlyArray<string> | undefined | null,
+        options: ExecFileOptionsWithBufferEncoding,
+        callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
+    ): ChildProcess;
+
+    // `options` with well known `encoding` means stdout/stderr are definitely `string`.
+    function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+    function execFile(
+        file: string,
+        args: ReadonlyArray<string> | undefined | null,
+        options: ExecFileOptionsWithStringEncoding,
+        callback: (error: ExecException | null, stdout: string, stderr: string) => void,
+    ): ChildProcess;
+
+    // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
+    // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`.
+    function execFile(
+        file: string,
+        options: ExecFileOptionsWithOtherEncoding,
+        callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+    ): ChildProcess;
+    function execFile(
+        file: string,
+        args: ReadonlyArray<string> | undefined | null,
+        options: ExecFileOptionsWithOtherEncoding,
+        callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
+    ): ChildProcess;
+
+    // `options` without an `encoding` means stdout/stderr are definitely `string`.
+    function execFile(file: string, options: ExecFileOptions, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
+    function execFile(
+        file: string,
+        args: ReadonlyArray<string> | undefined | null,
+        options: ExecFileOptions,
+        callback: (error: ExecException | null, stdout: string, stderr: string) => void
+    ): ChildProcess;
+
+    // fallback if nothing else matches. Worst case is always `string | Buffer`.
+    function execFile(
+        file: string,
+        options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
+        callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
+    ): ChildProcess;
+    function execFile(
+        file: string,
+        args: ReadonlyArray<string> | undefined | null,
+        options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
+        callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
+    ): ChildProcess;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace execFile {
+        function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
+        function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
+        function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+        function __promisify__(
+            file: string,
+            args: ReadonlyArray<string> | undefined | null,
+            options: ExecFileOptionsWithOtherEncoding,
+        ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+        function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
+        function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+        function __promisify__(
+            file: string,
+            args: ReadonlyArray<string> | undefined | null,
+            options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
+        ): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
+    }
+
+    interface ForkOptions extends ProcessEnvOptions, MessagingOptions {
+        execPath?: string;
+        execArgv?: string[];
+        silent?: boolean;
+        stdio?: StdioOptions;
+        detached?: boolean;
+        windowsVerbatimArguments?: boolean;
+    }
+    function fork(modulePath: string, options?: ForkOptions): ChildProcess;
+    function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
+
+    interface SpawnSyncOptions extends CommonSpawnOptions {
+        input?: string | NodeJS.ArrayBufferView;
+        killSignal?: NodeJS.Signals | number;
+        maxBuffer?: number;
+        encoding?: string;
+    }
+    interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {
+        encoding: BufferEncoding;
+    }
+    interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {
+        encoding: string; // specify `null`.
+    }
+    interface SpawnSyncReturns<T> {
+        pid: number;
+        output: string[];
+        stdout: T;
+        stderr: T;
+        status: number | null;
+        signal: NodeJS.Signals | null;
+        error?: Error;
+    }
+    function spawnSync(command: string): SpawnSyncReturns<Buffer>;
+    function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
+    function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
+    function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
+    function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;
+    function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;
+    function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
+
+    interface ExecSyncOptions extends CommonOptions {
+        input?: string | Uint8Array;
+        stdio?: StdioOptions;
+        shell?: string;
+        killSignal?: NodeJS.Signals | number;
+        maxBuffer?: number;
+        encoding?: string;
+    }
+    interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
+        encoding: BufferEncoding;
+    }
+    interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
+        encoding: string; // specify `null`.
+    }
+    function execSync(command: string): Buffer;
+    function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;
+    function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;
+    function execSync(command: string, options?: ExecSyncOptions): Buffer;
+
+    interface ExecFileSyncOptions extends CommonOptions {
+        input?: string | NodeJS.ArrayBufferView;
+        stdio?: StdioOptions;
+        killSignal?: NodeJS.Signals | number;
+        maxBuffer?: number;
+        encoding?: string;
+        shell?: boolean | string;
+    }
+    interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {
+        encoding: BufferEncoding;
+    }
+    interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {
+        encoding: string; // specify `null`.
+    }
+    function execFileSync(command: string): Buffer;
+    function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;
+    function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+    function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;
+    function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithStringEncoding): string;
+    function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;
+    function execFileSync(command: string, args?: ReadonlyArray<string>, options?: ExecFileSyncOptions): Buffer;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/cluster.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/cluster.d.ts
new file mode 100644 (file)
index 0000000..0ef6c2a
--- /dev/null
@@ -0,0 +1,262 @@
+declare module "cluster" {
+    import * as child from "child_process";
+    import * as events from "events";
+    import * as net from "net";
+
+    // interfaces
+    interface ClusterSettings {
+        execArgv?: string[]; // default: process.execArgv
+        exec?: string;
+        args?: string[];
+        silent?: boolean;
+        stdio?: any[];
+        uid?: number;
+        gid?: number;
+        inspectPort?: number | (() => number);
+    }
+
+    interface Address {
+        address: string;
+        port: number;
+        addressType: number | "udp4" | "udp6";  // 4, 6, -1, "udp4", "udp6"
+    }
+
+    class Worker extends events.EventEmitter {
+        id: number;
+        process: child.ChildProcess;
+        send(message: child.Serializable, sendHandle?: child.SendHandle, callback?: (error: Error | null) => void): boolean;
+        kill(signal?: string): void;
+        destroy(signal?: string): void;
+        disconnect(): void;
+        isConnected(): boolean;
+        isDead(): boolean;
+        exitedAfterDisconnect: boolean;
+
+        /**
+         * events.EventEmitter
+         *   1. disconnect
+         *   2. error
+         *   3. exit
+         *   4. listening
+         *   5. message
+         *   6. online
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "disconnect", listener: () => void): this;
+        addListener(event: "error", listener: (error: Error) => void): this;
+        addListener(event: "exit", listener: (code: number, signal: string) => void): this;
+        addListener(event: "listening", listener: (address: Address) => void): this;
+        addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        addListener(event: "online", listener: () => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "disconnect"): boolean;
+        emit(event: "error", error: Error): boolean;
+        emit(event: "exit", code: number, signal: string): boolean;
+        emit(event: "listening", address: Address): boolean;
+        emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
+        emit(event: "online"): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "disconnect", listener: () => void): this;
+        on(event: "error", listener: (error: Error) => void): this;
+        on(event: "exit", listener: (code: number, signal: string) => void): this;
+        on(event: "listening", listener: (address: Address) => void): this;
+        on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        on(event: "online", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "disconnect", listener: () => void): this;
+        once(event: "error", listener: (error: Error) => void): this;
+        once(event: "exit", listener: (code: number, signal: string) => void): this;
+        once(event: "listening", listener: (address: Address) => void): this;
+        once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        once(event: "online", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "disconnect", listener: () => void): this;
+        prependListener(event: "error", listener: (error: Error) => void): this;
+        prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
+        prependListener(event: "listening", listener: (address: Address) => void): this;
+        prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        prependListener(event: "online", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "disconnect", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (error: Error) => void): this;
+        prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
+        prependOnceListener(event: "listening", listener: (address: Address) => void): this;
+        prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        prependOnceListener(event: "online", listener: () => void): this;
+    }
+
+    interface Cluster extends events.EventEmitter {
+        Worker: Worker;
+        disconnect(callback?: () => void): void;
+        fork(env?: any): Worker;
+        isMaster: boolean;
+        isWorker: boolean;
+        schedulingPolicy: number;
+        settings: ClusterSettings;
+        setupMaster(settings?: ClusterSettings): void;
+        worker?: Worker;
+        workers?: NodeJS.Dict<Worker>;
+
+        readonly SCHED_NONE: number;
+        readonly SCHED_RR: number;
+
+        /**
+         * events.EventEmitter
+         *   1. disconnect
+         *   2. exit
+         *   3. fork
+         *   4. listening
+         *   5. message
+         *   6. online
+         *   7. setup
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "disconnect", listener: (worker: Worker) => void): this;
+        addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+        addListener(event: "fork", listener: (worker: Worker) => void): this;
+        addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+        addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        addListener(event: "online", listener: (worker: Worker) => void): this;
+        addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "disconnect", worker: Worker): boolean;
+        emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
+        emit(event: "fork", worker: Worker): boolean;
+        emit(event: "listening", worker: Worker, address: Address): boolean;
+        emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
+        emit(event: "online", worker: Worker): boolean;
+        emit(event: "setup", settings: ClusterSettings): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "disconnect", listener: (worker: Worker) => void): this;
+        on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+        on(event: "fork", listener: (worker: Worker) => void): this;
+        on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+        on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        on(event: "online", listener: (worker: Worker) => void): this;
+        on(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "disconnect", listener: (worker: Worker) => void): this;
+        once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+        once(event: "fork", listener: (worker: Worker) => void): this;
+        once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+        once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        once(event: "online", listener: (worker: Worker) => void): this;
+        once(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
+        prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+        prependListener(event: "fork", listener: (worker: Worker) => void): this;
+        prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+        prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.
+        prependListener(event: "online", listener: (worker: Worker) => void): this;
+        prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
+        prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
+        prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
+        prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
+        // the handle is a net.Socket or net.Server object, or undefined.
+        prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;
+        prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
+        prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
+    }
+
+    const SCHED_NONE: number;
+    const SCHED_RR: number;
+
+    function disconnect(callback?: () => void): void;
+    function fork(env?: any): Worker;
+    const isMaster: boolean;
+    const isWorker: boolean;
+    let schedulingPolicy: number;
+    const settings: ClusterSettings;
+    function setupMaster(settings?: ClusterSettings): void;
+    const worker: Worker;
+    const workers: NodeJS.Dict<Worker>;
+
+    /**
+     * events.EventEmitter
+     *   1. disconnect
+     *   2. exit
+     *   3. fork
+     *   4. listening
+     *   5. message
+     *   6. online
+     *   7. setup
+     */
+    function addListener(event: string, listener: (...args: any[]) => void): Cluster;
+    function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+    function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+    function addListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+    function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+     // the handle is a net.Socket or net.Server object, or undefined.
+    function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
+    function addListener(event: "online", listener: (worker: Worker) => void): Cluster;
+    function addListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+    function emit(event: string | symbol, ...args: any[]): boolean;
+    function emit(event: "disconnect", worker: Worker): boolean;
+    function emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
+    function emit(event: "fork", worker: Worker): boolean;
+    function emit(event: "listening", worker: Worker, address: Address): boolean;
+    function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
+    function emit(event: "online", worker: Worker): boolean;
+    function emit(event: "setup", settings: ClusterSettings): boolean;
+
+    function on(event: string, listener: (...args: any[]) => void): Cluster;
+    function on(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+    function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+    function on(event: "fork", listener: (worker: Worker) => void): Cluster;
+    function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+    function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.
+    function on(event: "online", listener: (worker: Worker) => void): Cluster;
+    function on(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+    function once(event: string, listener: (...args: any[]) => void): Cluster;
+    function once(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+    function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+    function once(event: "fork", listener: (worker: Worker) => void): Cluster;
+    function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+    function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.
+    function once(event: "online", listener: (worker: Worker) => void): Cluster;
+    function once(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+    function removeListener(event: string, listener: (...args: any[]) => void): Cluster;
+    function removeAllListeners(event?: string): Cluster;
+    function setMaxListeners(n: number): Cluster;
+    function getMaxListeners(): number;
+    function listeners(event: string): Function[];
+    function listenerCount(type: string): number;
+
+    function prependListener(event: string, listener: (...args: any[]) => void): Cluster;
+    function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+    function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+    function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+    function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+     // the handle is a net.Socket or net.Server object, or undefined.
+    function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
+    function prependListener(event: "online", listener: (worker: Worker) => void): Cluster;
+    function prependListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+    function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster;
+    function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster;
+    function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster;
+    function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster;
+    function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster;
+     // the handle is a net.Socket or net.Server object, or undefined.
+    function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;
+    function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster;
+    function prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): Cluster;
+
+    function eventNames(): string[];
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/console.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/console.d.ts
new file mode 100644 (file)
index 0000000..d30d13f
--- /dev/null
@@ -0,0 +1,3 @@
+declare module "console" {
+    export = console;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/constants.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/constants.d.ts
new file mode 100644 (file)
index 0000000..d124ae6
--- /dev/null
@@ -0,0 +1,8 @@
+/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
+declare module "constants" {
+    import { constants as osConstants, SignalConstants } from 'os';
+    import { constants as cryptoConstants } from 'crypto';
+    import { constants as fsConstants } from 'fs';
+    const exp: typeof osConstants.errno & typeof osConstants.priority & SignalConstants & typeof cryptoConstants & typeof fsConstants;
+    export = exp;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/crypto.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/crypto.d.ts
new file mode 100644 (file)
index 0000000..3c7f1cb
--- /dev/null
@@ -0,0 +1,819 @@
+declare module 'crypto' {
+    import * as stream from 'stream';
+
+    interface Certificate {
+        exportChallenge(spkac: BinaryLike): Buffer;
+        exportPublicKey(spkac: BinaryLike): Buffer;
+        verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
+    }
+    const Certificate: {
+        new (): Certificate;
+        (): Certificate;
+    };
+
+    namespace constants {
+        // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
+        const OPENSSL_VERSION_NUMBER: number;
+
+        /** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
+        const SSL_OP_ALL: number;
+        /** Allows legacy insecure renegotiation between OpenSSL and unpatched clients or servers. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+        const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
+        /** Attempts to use the server's preferences instead of the client's when selecting a cipher. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html. */
+        const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
+        /** Instructs OpenSSL to use Cisco's "speshul" version of DTLS_BAD_VER. */
+        const SSL_OP_CISCO_ANYCONNECT: number;
+        /** Instructs OpenSSL to turn on cookie exchange. */
+        const SSL_OP_COOKIE_EXCHANGE: number;
+        /** Instructs OpenSSL to add server-hello extension from an early version of the cryptopro draft. */
+        const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
+        /** Instructs OpenSSL to disable a SSL 3.0/TLS 1.0 vulnerability workaround added in OpenSSL 0.9.6d. */
+        const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
+        /** Instructs OpenSSL to always use the tmp_rsa key when performing RSA operations. */
+        const SSL_OP_EPHEMERAL_RSA: number;
+        /** Allows initial connection to servers that do not support RI. */
+        const SSL_OP_LEGACY_SERVER_CONNECT: number;
+        const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
+        const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
+        /** Instructs OpenSSL to disable the workaround for a man-in-the-middle protocol-version vulnerability in the SSL 2.0 server implementation. */
+        const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
+        const SSL_OP_NETSCAPE_CA_DN_BUG: number;
+        const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
+        const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
+        const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
+        /** Instructs OpenSSL to disable support for SSL/TLS compression. */
+        const SSL_OP_NO_COMPRESSION: number;
+        const SSL_OP_NO_QUERY_MTU: number;
+        /** Instructs OpenSSL to always start a new session when performing renegotiation. */
+        const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
+        const SSL_OP_NO_SSLv2: number;
+        const SSL_OP_NO_SSLv3: number;
+        const SSL_OP_NO_TICKET: number;
+        const SSL_OP_NO_TLSv1: number;
+        const SSL_OP_NO_TLSv1_1: number;
+        const SSL_OP_NO_TLSv1_2: number;
+        const SSL_OP_PKCS1_CHECK_1: number;
+        const SSL_OP_PKCS1_CHECK_2: number;
+        /** Instructs OpenSSL to always create a new key when using temporary/ephemeral DH parameters. */
+        const SSL_OP_SINGLE_DH_USE: number;
+        /** Instructs OpenSSL to always create a new key when using temporary/ephemeral ECDH parameters. */
+        const SSL_OP_SINGLE_ECDH_USE: number;
+        const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
+        const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
+        const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
+        const SSL_OP_TLS_D5_BUG: number;
+        /** Instructs OpenSSL to disable version rollback attack detection. */
+        const SSL_OP_TLS_ROLLBACK_BUG: number;
+
+        const ENGINE_METHOD_RSA: number;
+        const ENGINE_METHOD_DSA: number;
+        const ENGINE_METHOD_DH: number;
+        const ENGINE_METHOD_RAND: number;
+        const ENGINE_METHOD_EC: number;
+        const ENGINE_METHOD_CIPHERS: number;
+        const ENGINE_METHOD_DIGESTS: number;
+        const ENGINE_METHOD_PKEY_METHS: number;
+        const ENGINE_METHOD_PKEY_ASN1_METHS: number;
+        const ENGINE_METHOD_ALL: number;
+        const ENGINE_METHOD_NONE: number;
+
+        const DH_CHECK_P_NOT_SAFE_PRIME: number;
+        const DH_CHECK_P_NOT_PRIME: number;
+        const DH_UNABLE_TO_CHECK_GENERATOR: number;
+        const DH_NOT_SUITABLE_GENERATOR: number;
+
+        const ALPN_ENABLED: number;
+
+        const RSA_PKCS1_PADDING: number;
+        const RSA_SSLV23_PADDING: number;
+        const RSA_NO_PADDING: number;
+        const RSA_PKCS1_OAEP_PADDING: number;
+        const RSA_X931_PADDING: number;
+        const RSA_PKCS1_PSS_PADDING: number;
+        /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the digest size when signing or verifying. */
+        const RSA_PSS_SALTLEN_DIGEST: number;
+        /** Sets the salt length for RSA_PKCS1_PSS_PADDING to the maximum permissible value when signing data. */
+        const RSA_PSS_SALTLEN_MAX_SIGN: number;
+        /** Causes the salt length for RSA_PKCS1_PSS_PADDING to be determined automatically when verifying a signature. */
+        const RSA_PSS_SALTLEN_AUTO: number;
+
+        const POINT_CONVERSION_COMPRESSED: number;
+        const POINT_CONVERSION_UNCOMPRESSED: number;
+        const POINT_CONVERSION_HYBRID: number;
+
+        /** Specifies the built-in default cipher list used by Node.js (colon-separated values). */
+        const defaultCoreCipherList: string;
+        /** Specifies the active default cipher list used by the current Node.js process  (colon-separated values). */
+        const defaultCipherList: string;
+    }
+
+    interface HashOptions extends stream.TransformOptions {
+        /**
+         * For XOF hash functions such as `shake256`, the
+         * outputLength option can be used to specify the desired output length in bytes.
+         */
+        outputLength?: number;
+    }
+
+    /** @deprecated since v10.0.0 */
+    const fips: boolean;
+
+    function createHash(algorithm: string, options?: HashOptions): Hash;
+    function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
+
+    type Utf8AsciiLatin1Encoding = 'utf8' | 'ascii' | 'latin1';
+    type HexBase64Latin1Encoding = 'latin1' | 'hex' | 'base64';
+    type Utf8AsciiBinaryEncoding = 'utf8' | 'ascii' | 'binary';
+    type HexBase64BinaryEncoding = 'binary' | 'base64' | 'hex';
+    type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
+
+    class Hash extends stream.Transform {
+        private constructor();
+        copy(): Hash;
+        update(data: BinaryLike): Hash;
+        update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
+        digest(): Buffer;
+        digest(encoding: HexBase64Latin1Encoding): string;
+    }
+    class Hmac extends stream.Transform {
+        private constructor();
+        update(data: BinaryLike): Hmac;
+        update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
+        digest(): Buffer;
+        digest(encoding: HexBase64Latin1Encoding): string;
+    }
+
+    type KeyObjectType = 'secret' | 'public' | 'private';
+
+    interface KeyExportOptions<T extends KeyFormat> {
+        type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
+        format: T;
+        cipher?: string;
+        passphrase?: string | Buffer;
+    }
+
+    class KeyObject {
+        private constructor();
+        asymmetricKeyType?: KeyType;
+        /**
+         * For asymmetric keys, this property represents the size of the embedded key in
+         * bytes. This property is `undefined` for symmetric keys.
+         */
+        asymmetricKeySize?: number;
+        export(options: KeyExportOptions<'pem'>): string | Buffer;
+        export(options?: KeyExportOptions<'der'>): Buffer;
+        symmetricKeySize?: number;
+        type: KeyObjectType;
+    }
+
+    type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm' | 'chacha20-poly1305';
+    type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
+
+    type BinaryLike = string | NodeJS.ArrayBufferView;
+
+    type CipherKey = BinaryLike | KeyObject;
+
+    interface CipherCCMOptions extends stream.TransformOptions {
+        authTagLength: number;
+    }
+    interface CipherGCMOptions extends stream.TransformOptions {
+        authTagLength?: number;
+    }
+    /** @deprecated since v10.0.0 use createCipheriv() */
+    function createCipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): CipherCCM;
+    /** @deprecated since v10.0.0 use createCipheriv() */
+    function createCipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): CipherGCM;
+    /** @deprecated since v10.0.0 use createCipheriv() */
+    function createCipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Cipher;
+
+    function createCipheriv(
+        algorithm: CipherCCMTypes,
+        key: CipherKey,
+        iv: BinaryLike | null,
+        options: CipherCCMOptions,
+    ): CipherCCM;
+    function createCipheriv(
+        algorithm: CipherGCMTypes,
+        key: CipherKey,
+        iv: BinaryLike | null,
+        options?: CipherGCMOptions,
+    ): CipherGCM;
+    function createCipheriv(
+        algorithm: string,
+        key: CipherKey,
+        iv: BinaryLike | null,
+        options?: stream.TransformOptions,
+    ): Cipher;
+
+    class Cipher extends stream.Transform {
+        private constructor();
+        update(data: BinaryLike): Buffer;
+        update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
+        update(
+            data: NodeJS.ArrayBufferView,
+            input_encoding: undefined,
+            output_encoding: HexBase64BinaryEncoding,
+        ): string;
+        update(
+            data: string,
+            input_encoding: Utf8AsciiBinaryEncoding | undefined,
+            output_encoding: HexBase64BinaryEncoding,
+        ): string;
+        final(): Buffer;
+        final(output_encoding: string): string;
+        setAutoPadding(auto_padding?: boolean): this;
+        // getAuthTag(): Buffer;
+        // setAAD(buffer: Buffer): this; // docs only say buffer
+    }
+    interface CipherCCM extends Cipher {
+        setAAD(buffer: Buffer, options: { plaintextLength: number }): this;
+        getAuthTag(): Buffer;
+    }
+    interface CipherGCM extends Cipher {
+        setAAD(buffer: Buffer, options?: { plaintextLength: number }): this;
+        getAuthTag(): Buffer;
+    }
+    /** @deprecated since v10.0.0 use createDecipheriv() */
+    function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM;
+    /** @deprecated since v10.0.0 use createDecipheriv() */
+    function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
+    /** @deprecated since v10.0.0 use createDecipheriv() */
+    function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
+
+    function createDecipheriv(
+        algorithm: CipherCCMTypes,
+        key: CipherKey,
+        iv: BinaryLike | null,
+        options: CipherCCMOptions,
+    ): DecipherCCM;
+    function createDecipheriv(
+        algorithm: CipherGCMTypes,
+        key: CipherKey,
+        iv: BinaryLike | null,
+        options?: CipherGCMOptions,
+    ): DecipherGCM;
+    function createDecipheriv(
+        algorithm: string,
+        key: CipherKey,
+        iv: BinaryLike | null,
+        options?: stream.TransformOptions,
+    ): Decipher;
+
+    class Decipher extends stream.Transform {
+        private constructor();
+        update(data: NodeJS.ArrayBufferView): Buffer;
+        update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
+        update(
+            data: NodeJS.ArrayBufferView,
+            input_encoding: HexBase64BinaryEncoding | undefined,
+            output_encoding: Utf8AsciiBinaryEncoding,
+        ): string;
+        update(
+            data: string,
+            input_encoding: HexBase64BinaryEncoding | undefined,
+            output_encoding: Utf8AsciiBinaryEncoding,
+        ): string;
+        final(): Buffer;
+        final(output_encoding: string): string;
+        setAutoPadding(auto_padding?: boolean): this;
+        // setAuthTag(tag: NodeJS.ArrayBufferView): this;
+        // setAAD(buffer: NodeJS.ArrayBufferView): this;
+    }
+    interface DecipherCCM extends Decipher {
+        setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+        setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this;
+    }
+    interface DecipherGCM extends Decipher {
+        setAuthTag(buffer: NodeJS.ArrayBufferView): this;
+        setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this;
+    }
+
+    interface PrivateKeyInput {
+        key: string | Buffer;
+        format?: KeyFormat;
+        type?: 'pkcs1' | 'pkcs8' | 'sec1';
+        passphrase?: string | Buffer;
+    }
+
+    interface PublicKeyInput {
+        key: string | Buffer;
+        format?: KeyFormat;
+        type?: 'pkcs1' | 'spki';
+    }
+
+    function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
+    function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
+    function createSecretKey(key: Buffer): KeyObject;
+
+    function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
+
+    interface SigningOptions {
+        /**
+         * @See crypto.constants.RSA_PKCS1_PADDING
+         */
+        padding?: number;
+        saltLength?: number;
+    }
+
+    interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
+
+    type KeyLike = string | Buffer | KeyObject;
+
+    class Signer extends stream.Writable {
+        private constructor();
+
+        update(data: BinaryLike): Signer;
+        update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
+        sign(private_key: SignPrivateKeyInput | KeyLike): Buffer;
+        sign(private_key: SignPrivateKeyInput | KeyLike, output_format: HexBase64Latin1Encoding): string;
+    }
+
+    function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
+    class Verify extends stream.Writable {
+        private constructor();
+
+        update(data: BinaryLike): Verify;
+        update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
+        verify(object: object | KeyLike, signature: NodeJS.ArrayBufferView): boolean;
+        verify(object: object | KeyLike, signature: string, signature_format?: HexBase64Latin1Encoding): boolean;
+        // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
+        // The signature field accepts a TypedArray type, but it is only available starting ES2017
+    }
+    function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
+    function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
+    function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
+    function createDiffieHellman(
+        prime: string,
+        prime_encoding: HexBase64Latin1Encoding,
+        generator: number | NodeJS.ArrayBufferView,
+    ): DiffieHellman;
+    function createDiffieHellman(
+        prime: string,
+        prime_encoding: HexBase64Latin1Encoding,
+        generator: string,
+        generator_encoding: HexBase64Latin1Encoding,
+    ): DiffieHellman;
+    class DiffieHellman {
+        private constructor();
+        generateKeys(): Buffer;
+        generateKeys(encoding: HexBase64Latin1Encoding): string;
+        computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
+        computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
+        computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
+        computeSecret(
+            other_public_key: string,
+            input_encoding: HexBase64Latin1Encoding,
+            output_encoding: HexBase64Latin1Encoding,
+        ): string;
+        getPrime(): Buffer;
+        getPrime(encoding: HexBase64Latin1Encoding): string;
+        getGenerator(): Buffer;
+        getGenerator(encoding: HexBase64Latin1Encoding): string;
+        getPublicKey(): Buffer;
+        getPublicKey(encoding: HexBase64Latin1Encoding): string;
+        getPrivateKey(): Buffer;
+        getPrivateKey(encoding: HexBase64Latin1Encoding): string;
+        setPublicKey(public_key: NodeJS.ArrayBufferView): void;
+        setPublicKey(public_key: string, encoding: string): void;
+        setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
+        setPrivateKey(private_key: string, encoding: string): void;
+        verifyError: number;
+    }
+    function getDiffieHellman(group_name: string): DiffieHellman;
+    function pbkdf2(
+        password: BinaryLike,
+        salt: BinaryLike,
+        iterations: number,
+        keylen: number,
+        digest: string,
+        callback: (err: Error | null, derivedKey: Buffer) => any,
+    ): void;
+    function pbkdf2Sync(
+        password: BinaryLike,
+        salt: BinaryLike,
+        iterations: number,
+        keylen: number,
+        digest: string,
+    ): Buffer;
+
+    function randomBytes(size: number): Buffer;
+    function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+    function pseudoRandomBytes(size: number): Buffer;
+    function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
+
+    function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
+    function randomFill<T extends NodeJS.ArrayBufferView>(
+        buffer: T,
+        callback: (err: Error | null, buf: T) => void,
+    ): void;
+    function randomFill<T extends NodeJS.ArrayBufferView>(
+        buffer: T,
+        offset: number,
+        callback: (err: Error | null, buf: T) => void,
+    ): void;
+    function randomFill<T extends NodeJS.ArrayBufferView>(
+        buffer: T,
+        offset: number,
+        size: number,
+        callback: (err: Error | null, buf: T) => void,
+    ): void;
+
+    interface ScryptOptions {
+        cost?: number;
+        blockSize?: number;
+        parallelization?: number;
+        N?: number;
+        r?: number;
+        p?: number;
+        maxmem?: number;
+    }
+    function scrypt(
+        password: BinaryLike,
+        salt: BinaryLike,
+        keylen: number,
+        callback: (err: Error | null, derivedKey: Buffer) => void,
+    ): void;
+    function scrypt(
+        password: BinaryLike,
+        salt: BinaryLike,
+        keylen: number,
+        options: ScryptOptions,
+        callback: (err: Error | null, derivedKey: Buffer) => void,
+    ): void;
+    function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): Buffer;
+
+    interface RsaPublicKey {
+        key: KeyLike;
+        padding?: number;
+    }
+    interface RsaPrivateKey {
+        key: KeyLike;
+        passphrase?: string;
+        /**
+         * @default 'sha1'
+         */
+        oaepHash?: string;
+        oaepLabel?: NodeJS.TypedArray;
+        padding?: number;
+    }
+    function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+    function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+    function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+    function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
+    function getCiphers(): string[];
+    function getCurves(): string[];
+    function getFips(): 1 | 0;
+    function getHashes(): string[];
+    class ECDH {
+        private constructor();
+        static convertKey(
+            key: BinaryLike,
+            curve: string,
+            inputEncoding?: HexBase64Latin1Encoding,
+            outputEncoding?: 'latin1' | 'hex' | 'base64',
+            format?: 'uncompressed' | 'compressed' | 'hybrid',
+        ): Buffer | string;
+        generateKeys(): Buffer;
+        generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
+        computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
+        computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
+        computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
+        computeSecret(
+            other_public_key: string,
+            input_encoding: HexBase64Latin1Encoding,
+            output_encoding: HexBase64Latin1Encoding,
+        ): string;
+        getPrivateKey(): Buffer;
+        getPrivateKey(encoding: HexBase64Latin1Encoding): string;
+        getPublicKey(): Buffer;
+        getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
+        setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
+        setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
+    }
+    function createECDH(curve_name: string): ECDH;
+    function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
+    /** @deprecated since v10.0.0 */
+    const DEFAULT_ENCODING: string;
+
+    type KeyType = 'rsa' | 'dsa' | 'ec';
+    type KeyFormat = 'pem' | 'der';
+
+    interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
+        format: T;
+        cipher?: string;
+        passphrase?: string;
+    }
+
+    interface KeyPairKeyObjectResult {
+        publicKey: KeyObject;
+        privateKey: KeyObject;
+    }
+
+    interface ECKeyPairKeyObjectOptions {
+        /**
+         * Name of the curve to use.
+         */
+        namedCurve: string;
+    }
+
+    interface RSAKeyPairKeyObjectOptions {
+        /**
+         * Key size in bits
+         */
+        modulusLength: number;
+
+        /**
+         * @default 0x10001
+         */
+        publicExponent?: number;
+    }
+
+    interface DSAKeyPairKeyObjectOptions {
+        /**
+         * Key size in bits
+         */
+        modulusLength: number;
+
+        /**
+         * Size of q in bits
+         */
+        divisorLength: number;
+    }
+
+    interface RSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+        /**
+         * Key size in bits
+         */
+        modulusLength: number;
+        /**
+         * @default 0x10001
+         */
+        publicExponent?: number;
+
+        publicKeyEncoding: {
+            type: 'pkcs1' | 'spki';
+            format: PubF;
+        };
+        privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+            type: 'pkcs1' | 'pkcs8';
+        };
+    }
+
+    interface DSAKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+        /**
+         * Key size in bits
+         */
+        modulusLength: number;
+        /**
+         * Size of q in bits
+         */
+        divisorLength: number;
+
+        publicKeyEncoding: {
+            type: 'spki';
+            format: PubF;
+        };
+        privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+            type: 'pkcs8';
+        };
+    }
+
+    interface ECKeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
+        /**
+         * Name of the curve to use.
+         */
+        namedCurve: string;
+
+        publicKeyEncoding: {
+            type: 'pkcs1' | 'spki';
+            format: PubF;
+        };
+        privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
+            type: 'sec1' | 'pkcs8';
+        };
+    }
+
+    interface KeyPairSyncResult<T1 extends string | Buffer, T2 extends string | Buffer> {
+        publicKey: T1;
+        privateKey: T2;
+    }
+
+    function generateKeyPairSync(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'pem', 'pem'>,
+    ): KeyPairSyncResult<string, string>;
+    function generateKeyPairSync(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'pem', 'der'>,
+    ): KeyPairSyncResult<string, Buffer>;
+    function generateKeyPairSync(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'der', 'pem'>,
+    ): KeyPairSyncResult<Buffer, string>;
+    function generateKeyPairSync(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'der', 'der'>,
+    ): KeyPairSyncResult<Buffer, Buffer>;
+    function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+    function generateKeyPairSync(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'pem', 'pem'>,
+    ): KeyPairSyncResult<string, string>;
+    function generateKeyPairSync(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'pem', 'der'>,
+    ): KeyPairSyncResult<string, Buffer>;
+    function generateKeyPairSync(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'der', 'pem'>,
+    ): KeyPairSyncResult<Buffer, string>;
+    function generateKeyPairSync(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'der', 'der'>,
+    ): KeyPairSyncResult<Buffer, Buffer>;
+    function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+    function generateKeyPairSync(
+        type: 'ec',
+        options: ECKeyPairOptions<'pem', 'pem'>,
+    ): KeyPairSyncResult<string, string>;
+    function generateKeyPairSync(
+        type: 'ec',
+        options: ECKeyPairOptions<'pem', 'der'>,
+    ): KeyPairSyncResult<string, Buffer>;
+    function generateKeyPairSync(
+        type: 'ec',
+        options: ECKeyPairOptions<'der', 'pem'>,
+    ): KeyPairSyncResult<Buffer, string>;
+    function generateKeyPairSync(
+        type: 'ec',
+        options: ECKeyPairOptions<'der', 'der'>,
+    ): KeyPairSyncResult<Buffer, Buffer>;
+    function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
+
+    function generateKeyPair(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'pem', 'pem'>,
+        callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'pem', 'der'>,
+        callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'der', 'pem'>,
+        callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'rsa',
+        options: RSAKeyPairOptions<'der', 'der'>,
+        callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'rsa',
+        options: RSAKeyPairKeyObjectOptions,
+        callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+    ): void;
+
+    function generateKeyPair(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'pem', 'pem'>,
+        callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'pem', 'der'>,
+        callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'der', 'pem'>,
+        callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'dsa',
+        options: DSAKeyPairOptions<'der', 'der'>,
+        callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'dsa',
+        options: DSAKeyPairKeyObjectOptions,
+        callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+    ): void;
+
+    function generateKeyPair(
+        type: 'ec',
+        options: ECKeyPairOptions<'pem', 'pem'>,
+        callback: (err: Error | null, publicKey: string, privateKey: string) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'ec',
+        options: ECKeyPairOptions<'pem', 'der'>,
+        callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'ec',
+        options: ECKeyPairOptions<'der', 'pem'>,
+        callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'ec',
+        options: ECKeyPairOptions<'der', 'der'>,
+        callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
+    ): void;
+    function generateKeyPair(
+        type: 'ec',
+        options: ECKeyPairKeyObjectOptions,
+        callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
+    ): void;
+
+    namespace generateKeyPair {
+        function __promisify__(
+            type: 'rsa',
+            options: RSAKeyPairOptions<'pem', 'pem'>,
+        ): Promise<{ publicKey: string; privateKey: string }>;
+        function __promisify__(
+            type: 'rsa',
+            options: RSAKeyPairOptions<'pem', 'der'>,
+        ): Promise<{ publicKey: string; privateKey: Buffer }>;
+        function __promisify__(
+            type: 'rsa',
+            options: RSAKeyPairOptions<'der', 'pem'>,
+        ): Promise<{ publicKey: Buffer; privateKey: string }>;
+        function __promisify__(
+            type: 'rsa',
+            options: RSAKeyPairOptions<'der', 'der'>,
+        ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
+        function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+
+        function __promisify__(
+            type: 'dsa',
+            options: DSAKeyPairOptions<'pem', 'pem'>,
+        ): Promise<{ publicKey: string; privateKey: string }>;
+        function __promisify__(
+            type: 'dsa',
+            options: DSAKeyPairOptions<'pem', 'der'>,
+        ): Promise<{ publicKey: string; privateKey: Buffer }>;
+        function __promisify__(
+            type: 'dsa',
+            options: DSAKeyPairOptions<'der', 'pem'>,
+        ): Promise<{ publicKey: Buffer; privateKey: string }>;
+        function __promisify__(
+            type: 'dsa',
+            options: DSAKeyPairOptions<'der', 'der'>,
+        ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
+        function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+
+        function __promisify__(
+            type: 'ec',
+            options: ECKeyPairOptions<'pem', 'pem'>,
+        ): Promise<{ publicKey: string; privateKey: string }>;
+        function __promisify__(
+            type: 'ec',
+            options: ECKeyPairOptions<'pem', 'der'>,
+        ): Promise<{ publicKey: string; privateKey: Buffer }>;
+        function __promisify__(
+            type: 'ec',
+            options: ECKeyPairOptions<'der', 'pem'>,
+        ): Promise<{ publicKey: Buffer; privateKey: string }>;
+        function __promisify__(
+            type: 'ec',
+            options: ECKeyPairOptions<'der', 'der'>,
+        ): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
+        function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
+    }
+
+    /**
+     * Calculates and returns the signature for `data` using the given private key and
+     * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
+     * dependent upon the key type (especially Ed25519 and Ed448).
+     *
+     * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
+     * passed to [`crypto.createPrivateKey()`][].
+     */
+    function sign(
+        algorithm: string | null | undefined,
+        data: NodeJS.ArrayBufferView,
+        key: KeyLike | SignPrivateKeyInput,
+    ): Buffer;
+
+    interface VerifyKeyWithOptions extends KeyObject, SigningOptions {}
+
+    /**
+     * Calculates and returns the signature for `data` using the given private key and
+     * algorithm. If `algorithm` is `null` or `undefined`, then the algorithm is
+     * dependent upon the key type (especially Ed25519 and Ed448).
+     *
+     * If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
+     * passed to [`crypto.createPublicKey()`][].
+     */
+    function verify(
+        algorithm: string | null | undefined,
+        data: NodeJS.ArrayBufferView,
+        key: KeyLike | VerifyKeyWithOptions,
+        signature: NodeJS.ArrayBufferView,
+    ): boolean;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/dgram.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/dgram.d.ts
new file mode 100644 (file)
index 0000000..73f2aa7
--- /dev/null
@@ -0,0 +1,141 @@
+declare module "dgram" {
+    import { AddressInfo } from "net";
+    import * as dns from "dns";
+    import * as events from "events";
+
+    interface RemoteInfo {
+        address: string;
+        family: 'IPv4' | 'IPv6';
+        port: number;
+        size: number;
+    }
+
+    interface BindOptions {
+        port?: number;
+        address?: string;
+        exclusive?: boolean;
+        fd?: number;
+    }
+
+    type SocketType = "udp4" | "udp6";
+
+    interface SocketOptions {
+        type: SocketType;
+        reuseAddr?: boolean;
+        /**
+         * @default false
+         */
+        ipv6Only?: boolean;
+        recvBufferSize?: number;
+        sendBufferSize?: number;
+        lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
+    }
+
+    function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+    function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
+
+    class Socket extends events.EventEmitter {
+        addMembership(multicastAddress: string, multicastInterface?: string): void;
+        address(): AddressInfo;
+        bind(port?: number, address?: string, callback?: () => void): void;
+        bind(port?: number, callback?: () => void): void;
+        bind(callback?: () => void): void;
+        bind(options: BindOptions, callback?: () => void): void;
+        close(callback?: () => void): void;
+        connect(port: number, address?: string, callback?: () => void): void;
+        connect(port: number, callback: () => void): void;
+        disconnect(): void;
+        dropMembership(multicastAddress: string, multicastInterface?: string): void;
+        getRecvBufferSize(): number;
+        getSendBufferSize(): number;
+        ref(): this;
+        remoteAddress(): AddressInfo;
+        send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
+        send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
+        send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
+        send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
+        send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
+        send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
+        setBroadcast(flag: boolean): void;
+        setMulticastInterface(multicastInterface: string): void;
+        setMulticastLoopback(flag: boolean): void;
+        setMulticastTTL(ttl: number): void;
+        setRecvBufferSize(size: number): void;
+        setSendBufferSize(size: number): void;
+        setTTL(ttl: number): void;
+        unref(): this;
+        /**
+         * Tells the kernel to join a source-specific multicast channel at the given
+         * `sourceAddress` and `groupAddress`, using the `multicastInterface` with the
+         * `IP_ADD_SOURCE_MEMBERSHIP` socket option.
+         * If the `multicastInterface` argument
+         * is not specified, the operating system will choose one interface and will add
+         * membership to it.
+         * To add membership to every available interface, call
+         * `socket.addSourceSpecificMembership()` multiple times, once per interface.
+         */
+        addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
+
+        /**
+         * Instructs the kernel to leave a source-specific multicast channel at the given
+         * `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`
+         * socket option. This method is automatically called by the kernel when the
+         * socket is closed or the process terminates, so most apps will never have
+         * reason to call this.
+         *
+         * If `multicastInterface` is not specified, the operating system will attempt to
+         * drop membership on all valid interfaces.
+         */
+        dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
+
+        /**
+         * events.EventEmitter
+         * 1. close
+         * 2. connect
+         * 3. error
+         * 4. listening
+         * 5. message
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "connect", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "listening", listener: () => void): this;
+        addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "close"): boolean;
+        emit(event: "connect"): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: "listening"): boolean;
+        emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "close", listener: () => void): this;
+        on(event: "connect", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "listening", listener: () => void): this;
+        on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "close", listener: () => void): this;
+        once(event: "connect", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "listening", listener: () => void): this;
+        once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "connect", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "listening", listener: () => void): this;
+        prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "connect", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "listening", listener: () => void): this;
+        prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/dns.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/dns.d.ts
new file mode 100644 (file)
index 0000000..32cba61
--- /dev/null
@@ -0,0 +1,371 @@
+declare module "dns" {
+    // Supported getaddrinfo flags.
+    const ADDRCONFIG: number;
+    const V4MAPPED: number;
+    /**
+     * If `dns.V4MAPPED` is specified, return resolved IPv6 addresses as
+     * well as IPv4 mapped IPv6 addresses.
+     */
+    const ALL: number;
+
+    interface LookupOptions {
+        family?: number;
+        hints?: number;
+        all?: boolean;
+        verbatim?: boolean;
+    }
+
+    interface LookupOneOptions extends LookupOptions {
+        all?: false;
+    }
+
+    interface LookupAllOptions extends LookupOptions {
+        all: true;
+    }
+
+    interface LookupAddress {
+        address: string;
+        family: number;
+    }
+
+    function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
+    function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
+    function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void): void;
+    function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family: number) => void): void;
+    function lookup(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace lookup {
+        function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
+        function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
+        function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
+    }
+
+    function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;
+
+    namespace lookupService {
+        function __promisify__(address: string, port: number): Promise<{ hostname: string, service: string }>;
+    }
+
+    interface ResolveOptions {
+        ttl: boolean;
+    }
+
+    interface ResolveWithTtlOptions extends ResolveOptions {
+        ttl: true;
+    }
+
+    interface RecordWithTtl {
+        address: string;
+        ttl: number;
+    }
+
+    /** @deprecated Use AnyARecord or AnyAaaaRecord instead. */
+    type AnyRecordWithTtl = AnyARecord | AnyAaaaRecord;
+
+    interface AnyARecord extends RecordWithTtl {
+        type: "A";
+    }
+
+    interface AnyAaaaRecord extends RecordWithTtl {
+        type: "AAAA";
+    }
+
+    interface MxRecord {
+        priority: number;
+        exchange: string;
+    }
+
+    interface AnyMxRecord extends MxRecord {
+        type: "MX";
+    }
+
+    interface NaptrRecord {
+        flags: string;
+        service: string;
+        regexp: string;
+        replacement: string;
+        order: number;
+        preference: number;
+    }
+
+    interface AnyNaptrRecord extends NaptrRecord {
+        type: "NAPTR";
+    }
+
+    interface SoaRecord {
+        nsname: string;
+        hostmaster: string;
+        serial: number;
+        refresh: number;
+        retry: number;
+        expire: number;
+        minttl: number;
+    }
+
+    interface AnySoaRecord extends SoaRecord {
+        type: "SOA";
+    }
+
+    interface SrvRecord {
+        priority: number;
+        weight: number;
+        port: number;
+        name: string;
+    }
+
+    interface AnySrvRecord extends SrvRecord {
+        type: "SRV";
+    }
+
+    interface AnyTxtRecord {
+        type: "TXT";
+        entries: string[];
+    }
+
+    interface AnyNsRecord {
+        type: "NS";
+        value: string;
+    }
+
+    interface AnyPtrRecord {
+        type: "PTR";
+        value: string;
+    }
+
+    interface AnyCnameRecord {
+        type: "CNAME";
+        value: string;
+    }
+
+    type AnyRecord = AnyARecord |
+        AnyAaaaRecord |
+        AnyCnameRecord |
+        AnyMxRecord |
+        AnyNaptrRecord |
+        AnyNsRecord |
+        AnyPtrRecord |
+        AnySoaRecord |
+        AnySrvRecord |
+        AnyTxtRecord;
+
+    function resolve(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve(hostname: string, rrtype: "ANY", callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
+    function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
+    function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
+    function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException | null, addresses: SoaRecord) => void): void;
+    function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
+    function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
+    function resolve(
+        hostname: string,
+        rrtype: string,
+        callback: (err: NodeJS.ErrnoException | null, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]) => void,
+    ): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace resolve {
+        function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise<string[]>;
+        function __promisify__(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
+        function __promisify__(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
+        function __promisify__(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
+        function __promisify__(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
+        function __promisify__(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
+        function __promisify__(hostname: string, rrtype: "TXT"): Promise<string[][]>;
+        function __promisify__(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
+    }
+
+    function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
+    function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace resolve4 {
+        function __promisify__(hostname: string): Promise<string[]>;
+        function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+        function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+    }
+
+    function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException | null, addresses: RecordWithTtl[]) => void): void;
+    function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException | null, addresses: string[] | RecordWithTtl[]) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace resolve6 {
+        function __promisify__(hostname: string): Promise<string[]>;
+        function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+        function __promisify__(hostname: string, options?: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+    }
+
+    function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    namespace resolveCname {
+        function __promisify__(hostname: string): Promise<string[]>;
+    }
+
+    function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: MxRecord[]) => void): void;
+    namespace resolveMx {
+        function __promisify__(hostname: string): Promise<MxRecord[]>;
+    }
+
+    function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: NaptrRecord[]) => void): void;
+    namespace resolveNaptr {
+        function __promisify__(hostname: string): Promise<NaptrRecord[]>;
+    }
+
+    function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    namespace resolveNs {
+        function __promisify__(hostname: string): Promise<string[]>;
+    }
+
+    function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[]) => void): void;
+    namespace resolvePtr {
+        function __promisify__(hostname: string): Promise<string[]>;
+    }
+
+    function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException | null, address: SoaRecord) => void): void;
+    namespace resolveSoa {
+        function __promisify__(hostname: string): Promise<SoaRecord>;
+    }
+
+    function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: SrvRecord[]) => void): void;
+    namespace resolveSrv {
+        function __promisify__(hostname: string): Promise<SrvRecord[]>;
+    }
+
+    function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: string[][]) => void): void;
+    namespace resolveTxt {
+        function __promisify__(hostname: string): Promise<string[][]>;
+    }
+
+    function resolveAny(hostname: string, callback: (err: NodeJS.ErrnoException | null, addresses: AnyRecord[]) => void): void;
+    namespace resolveAny {
+        function __promisify__(hostname: string): Promise<AnyRecord[]>;
+    }
+
+    function reverse(ip: string, callback: (err: NodeJS.ErrnoException | null, hostnames: string[]) => void): void;
+    function setServers(servers: ReadonlyArray<string>): void;
+    function getServers(): string[];
+
+    // Error codes
+    const NODATA: string;
+    const FORMERR: string;
+    const SERVFAIL: string;
+    const NOTFOUND: string;
+    const NOTIMP: string;
+    const REFUSED: string;
+    const BADQUERY: string;
+    const BADNAME: string;
+    const BADFAMILY: string;
+    const BADRESP: string;
+    const CONNREFUSED: string;
+    const TIMEOUT: string;
+    const EOF: string;
+    const FILE: string;
+    const NOMEM: string;
+    const DESTRUCTION: string;
+    const BADSTR: string;
+    const BADFLAGS: string;
+    const NONAME: string;
+    const BADHINTS: string;
+    const NOTINITIALIZED: string;
+    const LOADIPHLPAPI: string;
+    const ADDRGETNETWORKPARAMS: string;
+    const CANCELLED: string;
+
+    class Resolver {
+        getServers: typeof getServers;
+        setServers: typeof setServers;
+        resolve: typeof resolve;
+        resolve4: typeof resolve4;
+        resolve6: typeof resolve6;
+        resolveAny: typeof resolveAny;
+        resolveCname: typeof resolveCname;
+        resolveMx: typeof resolveMx;
+        resolveNaptr: typeof resolveNaptr;
+        resolveNs: typeof resolveNs;
+        resolvePtr: typeof resolvePtr;
+        resolveSoa: typeof resolveSoa;
+        resolveSrv: typeof resolveSrv;
+        resolveTxt: typeof resolveTxt;
+        reverse: typeof reverse;
+        cancel(): void;
+    }
+
+    namespace promises {
+        function getServers(): string[];
+
+        function lookup(hostname: string, family: number): Promise<LookupAddress>;
+        function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
+        function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
+        function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
+        function lookup(hostname: string): Promise<LookupAddress>;
+
+        function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>;
+
+        function resolve(hostname: string): Promise<string[]>;
+        function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
+        function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
+        function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
+        function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
+        function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
+        function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
+        function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
+        function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
+        function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
+        function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
+        function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
+        function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
+
+        function resolve4(hostname: string): Promise<string[]>;
+        function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+        function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+
+        function resolve6(hostname: string): Promise<string[]>;
+        function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
+        function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
+
+        function resolveAny(hostname: string): Promise<AnyRecord[]>;
+
+        function resolveCname(hostname: string): Promise<string[]>;
+
+        function resolveMx(hostname: string): Promise<MxRecord[]>;
+
+        function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
+
+        function resolveNs(hostname: string): Promise<string[]>;
+
+        function resolvePtr(hostname: string): Promise<string[]>;
+
+        function resolveSoa(hostname: string): Promise<SoaRecord>;
+
+        function resolveSrv(hostname: string): Promise<SrvRecord[]>;
+
+        function resolveTxt(hostname: string): Promise<string[][]>;
+
+        function reverse(ip: string): Promise<string[]>;
+
+        function setServers(servers: ReadonlyArray<string>): void;
+
+        class Resolver {
+            getServers: typeof getServers;
+            resolve: typeof resolve;
+            resolve4: typeof resolve4;
+            resolve6: typeof resolve6;
+            resolveAny: typeof resolveAny;
+            resolveCname: typeof resolveCname;
+            resolveMx: typeof resolveMx;
+            resolveNaptr: typeof resolveNaptr;
+            resolveNs: typeof resolveNs;
+            resolvePtr: typeof resolvePtr;
+            resolveSoa: typeof resolveSoa;
+            resolveSrv: typeof resolveSrv;
+            resolveTxt: typeof resolveTxt;
+            reverse: typeof reverse;
+            setServers: typeof setServers;
+        }
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/domain.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/domain.d.ts
new file mode 100644 (file)
index 0000000..c7fa9b8
--- /dev/null
@@ -0,0 +1,16 @@
+declare module "domain" {
+    import { EventEmitter } from "events";
+
+    class Domain extends EventEmitter implements NodeJS.Domain {
+        run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
+        add(emitter: EventEmitter | NodeJS.Timer): void;
+        remove(emitter: EventEmitter | NodeJS.Timer): void;
+        bind<T extends Function>(cb: T): T;
+        intercept<T extends Function>(cb: T): T;
+        members: Array<EventEmitter | NodeJS.Timer>;
+        enter(): void;
+        exit(): void;
+    }
+
+    function create(): Domain;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/events.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/events.d.ts
new file mode 100644 (file)
index 0000000..b07defc
--- /dev/null
@@ -0,0 +1,50 @@
+declare module "events" {
+    interface EventEmitterOptions {
+        /**
+         * Enables automatic capturing of promise rejection.
+         */
+        captureRejections?: boolean;
+    }
+
+    interface NodeEventTarget {
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    interface DOMEventTarget {
+        addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
+    }
+
+    namespace EventEmitter {
+        function once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
+        function once(emitter: DOMEventTarget, event: string): Promise<any[]>;
+        function on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>;
+        const captureRejectionSymbol: unique symbol;
+
+        /**
+         * This symbol shall be used to install a listener for only monitoring `'error'`
+         * events. Listeners installed using this symbol are called before the regular
+         * `'error'` listeners are called.
+         *
+         * Installing a listener using this symbol does not change the behavior once an
+         * `'error'` event is emitted, therefore the process will still crash if no
+         * regular `'error'` listener is installed.
+         */
+        const errorMonitor: unique symbol;
+        /**
+         * Sets or gets the default captureRejection value for all emitters.
+         */
+        let captureRejections: boolean;
+
+        interface EventEmitter extends NodeJS.EventEmitter {
+        }
+
+        class EventEmitter {
+            constructor(options?: EventEmitterOptions);
+            /** @deprecated since v4.0.0 */
+            static listenerCount(emitter: EventEmitter, event: string | symbol): number;
+            static defaultMaxListeners: number;
+        }
+    }
+
+    export = EventEmitter;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/fs.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/fs.d.ts
new file mode 100644 (file)
index 0000000..c81c5fd
--- /dev/null
@@ -0,0 +1,2665 @@
+declare module "fs" {
+    import * as stream from "stream";
+    import * as events from "events";
+    import { URL } from "url";
+
+    /**
+     * Valid types for path values in "fs".
+     */
+    type PathLike = string | Buffer | URL;
+
+    type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
+
+    interface StatsBase<T> {
+        isFile(): boolean;
+        isDirectory(): boolean;
+        isBlockDevice(): boolean;
+        isCharacterDevice(): boolean;
+        isSymbolicLink(): boolean;
+        isFIFO(): boolean;
+        isSocket(): boolean;
+
+        dev: T;
+        ino: T;
+        mode: T;
+        nlink: T;
+        uid: T;
+        gid: T;
+        rdev: T;
+        size: T;
+        blksize: T;
+        blocks: T;
+        atimeMs: T;
+        mtimeMs: T;
+        ctimeMs: T;
+        birthtimeMs: T;
+        atime: Date;
+        mtime: Date;
+        ctime: Date;
+        birthtime: Date;
+    }
+
+    interface Stats extends StatsBase<number> {
+    }
+
+    class Stats {
+    }
+
+    class Dirent {
+        isFile(): boolean;
+        isDirectory(): boolean;
+        isBlockDevice(): boolean;
+        isCharacterDevice(): boolean;
+        isSymbolicLink(): boolean;
+        isFIFO(): boolean;
+        isSocket(): boolean;
+        name: string;
+    }
+
+    /**
+     * A class representing a directory stream.
+     */
+    class Dir {
+        readonly path: string;
+
+        /**
+         * Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
+         */
+        [Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
+
+        /**
+         * Asynchronously close the directory's underlying resource handle.
+         * Subsequent reads will result in errors.
+         */
+        close(): Promise<void>;
+        close(cb: NoParamCallback): void;
+
+        /**
+         * Synchronously close the directory's underlying resource handle.
+         * Subsequent reads will result in errors.
+         */
+        closeSync(): void;
+
+        /**
+         * Asynchronously read the next directory entry via `readdir(3)` as an `Dirent`.
+         * After the read is completed, a value is returned that will be resolved with an `Dirent`, or `null` if there are no more directory entries to read.
+         * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
+         */
+        read(): Promise<Dirent | null>;
+        read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void;
+
+        /**
+         * Synchronously read the next directory entry via `readdir(3)` as a `Dirent`.
+         * If there are no more directory entries to read, null will be returned.
+         * Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
+         */
+        readSync(): Dirent;
+    }
+
+    interface FSWatcher extends events.EventEmitter {
+        close(): void;
+
+        /**
+         * events.EventEmitter
+         *   1. change
+         *   2. error
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+        addListener(event: "error", listener: (error: Error) => void): this;
+        addListener(event: "close", listener: () => void): this;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+        on(event: "error", listener: (error: Error) => void): this;
+        on(event: "close", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+        once(event: "error", listener: (error: Error) => void): this;
+        once(event: "close", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+        prependListener(event: "error", listener: (error: Error) => void): this;
+        prependListener(event: "close", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
+        prependOnceListener(event: "error", listener: (error: Error) => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+    }
+
+    class ReadStream extends stream.Readable {
+        close(): void;
+        bytesRead: number;
+        path: string | Buffer;
+        pending: boolean;
+
+        /**
+         * events.EventEmitter
+         *   1. open
+         *   2. close
+         *   3. ready
+         */
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        addListener(event: "end", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "open", listener: (fd: number) => void): this;
+        addListener(event: "pause", listener: () => void): this;
+        addListener(event: "readable", listener: () => void): this;
+        addListener(event: "ready", listener: () => void): this;
+        addListener(event: "resume", listener: () => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        on(event: "close", listener: () => void): this;
+        on(event: "data", listener: (chunk: Buffer | string) => void): this;
+        on(event: "end", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "open", listener: (fd: number) => void): this;
+        on(event: "pause", listener: () => void): this;
+        on(event: "readable", listener: () => void): this;
+        on(event: "ready", listener: () => void): this;
+        on(event: "resume", listener: () => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "close", listener: () => void): this;
+        once(event: "data", listener: (chunk: Buffer | string) => void): this;
+        once(event: "end", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "open", listener: (fd: number) => void): this;
+        once(event: "pause", listener: () => void): this;
+        once(event: "readable", listener: () => void): this;
+        once(event: "ready", listener: () => void): this;
+        once(event: "resume", listener: () => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        prependListener(event: "end", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "open", listener: (fd: number) => void): this;
+        prependListener(event: "pause", listener: () => void): this;
+        prependListener(event: "readable", listener: () => void): this;
+        prependListener(event: "ready", listener: () => void): this;
+        prependListener(event: "resume", listener: () => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        prependOnceListener(event: "end", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "open", listener: (fd: number) => void): this;
+        prependOnceListener(event: "pause", listener: () => void): this;
+        prependOnceListener(event: "readable", listener: () => void): this;
+        prependOnceListener(event: "ready", listener: () => void): this;
+        prependOnceListener(event: "resume", listener: () => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    class WriteStream extends stream.Writable {
+        close(): void;
+        bytesWritten: number;
+        path: string | Buffer;
+        pending: boolean;
+
+        /**
+         * events.EventEmitter
+         *   1. open
+         *   2. close
+         *   3. ready
+         */
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "drain", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "finish", listener: () => void): this;
+        addListener(event: "open", listener: (fd: number) => void): this;
+        addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        addListener(event: "ready", listener: () => void): this;
+        addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        on(event: "close", listener: () => void): this;
+        on(event: "drain", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "finish", listener: () => void): this;
+        on(event: "open", listener: (fd: number) => void): this;
+        on(event: "pipe", listener: (src: stream.Readable) => void): this;
+        on(event: "ready", listener: () => void): this;
+        on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "close", listener: () => void): this;
+        once(event: "drain", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "finish", listener: () => void): this;
+        once(event: "open", listener: (fd: number) => void): this;
+        once(event: "pipe", listener: (src: stream.Readable) => void): this;
+        once(event: "ready", listener: () => void): this;
+        once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "drain", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "finish", listener: () => void): this;
+        prependListener(event: "open", listener: (fd: number) => void): this;
+        prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        prependListener(event: "ready", listener: () => void): this;
+        prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "drain", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "finish", listener: () => void): this;
+        prependOnceListener(event: "open", listener: (fd: number) => void): this;
+        prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: "ready", listener: () => void): this;
+        prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    /**
+     * Asynchronous rename(2) - Change the name or location of a file or directory.
+     * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace rename {
+        /**
+         * Asynchronous rename(2) - Change the name or location of a file or directory.
+         * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         */
+        function __promisify__(oldPath: PathLike, newPath: PathLike): Promise<void>;
+    }
+
+    /**
+     * Synchronous rename(2) - Change the name or location of a file or directory.
+     * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function renameSync(oldPath: PathLike, newPath: PathLike): void;
+
+    /**
+     * Asynchronous truncate(2) - Truncate a file to a specified length.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param len If not specified, defaults to `0`.
+     */
+    function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronous truncate(2) - Truncate a file to a specified length.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function truncate(path: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace truncate {
+        /**
+         * Asynchronous truncate(2) - Truncate a file to a specified length.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param len If not specified, defaults to `0`.
+         */
+        function __promisify__(path: PathLike, len?: number | null): Promise<void>;
+    }
+
+    /**
+     * Synchronous truncate(2) - Truncate a file to a specified length.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param len If not specified, defaults to `0`.
+     */
+    function truncateSync(path: PathLike, len?: number | null): void;
+
+    /**
+     * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+     * @param fd A file descriptor.
+     * @param len If not specified, defaults to `0`.
+     */
+    function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+     * @param fd A file descriptor.
+     */
+    function ftruncate(fd: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace ftruncate {
+        /**
+         * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+         * @param fd A file descriptor.
+         * @param len If not specified, defaults to `0`.
+         */
+        function __promisify__(fd: number, len?: number | null): Promise<void>;
+    }
+
+    /**
+     * Synchronous ftruncate(2) - Truncate a file to a specified length.
+     * @param fd A file descriptor.
+     * @param len If not specified, defaults to `0`.
+     */
+    function ftruncateSync(fd: number, len?: number | null): void;
+
+    /**
+     * Asynchronous chown(2) - Change ownership of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace chown {
+        /**
+         * Asynchronous chown(2) - Change ownership of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
+    }
+
+    /**
+     * Synchronous chown(2) - Change ownership of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function chownSync(path: PathLike, uid: number, gid: number): void;
+
+    /**
+     * Asynchronous fchown(2) - Change ownership of a file.
+     * @param fd A file descriptor.
+     */
+    function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace fchown {
+        /**
+         * Asynchronous fchown(2) - Change ownership of a file.
+         * @param fd A file descriptor.
+         */
+        function __promisify__(fd: number, uid: number, gid: number): Promise<void>;
+    }
+
+    /**
+     * Synchronous fchown(2) - Change ownership of a file.
+     * @param fd A file descriptor.
+     */
+    function fchownSync(fd: number, uid: number, gid: number): void;
+
+    /**
+     * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace lchown {
+        /**
+         * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(path: PathLike, uid: number, gid: number): Promise<void>;
+    }
+
+    /**
+     * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function lchownSync(path: PathLike, uid: number, gid: number): void;
+
+    /**
+     * Asynchronous chmod(2) - Change permissions of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+     */
+    function chmod(path: PathLike, mode: string | number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace chmod {
+        /**
+         * Asynchronous chmod(2) - Change permissions of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+         */
+        function __promisify__(path: PathLike, mode: string | number): Promise<void>;
+    }
+
+    /**
+     * Synchronous chmod(2) - Change permissions of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+     */
+    function chmodSync(path: PathLike, mode: string | number): void;
+
+    /**
+     * Asynchronous fchmod(2) - Change permissions of a file.
+     * @param fd A file descriptor.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+     */
+    function fchmod(fd: number, mode: string | number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace fchmod {
+        /**
+         * Asynchronous fchmod(2) - Change permissions of a file.
+         * @param fd A file descriptor.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+         */
+        function __promisify__(fd: number, mode: string | number): Promise<void>;
+    }
+
+    /**
+     * Synchronous fchmod(2) - Change permissions of a file.
+     * @param fd A file descriptor.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+     */
+    function fchmodSync(fd: number, mode: string | number): void;
+
+    /**
+     * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+     */
+    function lchmod(path: PathLike, mode: string | number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace lchmod {
+        /**
+         * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+         */
+        function __promisify__(path: PathLike, mode: string | number): Promise<void>;
+    }
+
+    /**
+     * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+     */
+    function lchmodSync(path: PathLike, mode: string | number): void;
+
+    /**
+     * Asynchronous stat(2) - Get file status.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function stat(path: PathLike, options: BigIntOptions, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
+    function stat(path: PathLike, options: StatOptions, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
+    function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace stat {
+        /**
+         * Asynchronous stat(2) - Get file status.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(path: PathLike, options: BigIntOptions): Promise<BigIntStats>;
+        function __promisify__(path: PathLike, options: StatOptions): Promise<Stats | BigIntStats>;
+        function __promisify__(path: PathLike): Promise<Stats>;
+    }
+
+    /**
+     * Synchronous stat(2) - Get file status.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function statSync(path: PathLike, options: BigIntOptions): BigIntStats;
+    function statSync(path: PathLike, options: StatOptions): Stats | BigIntStats;
+    function statSync(path: PathLike): Stats;
+
+    /**
+     * Asynchronous fstat(2) - Get file status.
+     * @param fd A file descriptor.
+     */
+    function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace fstat {
+        /**
+         * Asynchronous fstat(2) - Get file status.
+         * @param fd A file descriptor.
+         */
+        function __promisify__(fd: number): Promise<Stats>;
+    }
+
+    /**
+     * Synchronous fstat(2) - Get file status.
+     * @param fd A file descriptor.
+     */
+    function fstatSync(fd: number): Stats;
+
+    /**
+     * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace lstat {
+        /**
+         * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(path: PathLike): Promise<Stats>;
+    }
+
+    /**
+     * Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function lstatSync(path: PathLike): Stats;
+
+    /**
+     * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
+     * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace link {
+        /**
+         * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
+         * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
+    }
+
+    /**
+     * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file.
+     * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function linkSync(existingPath: PathLike, newPath: PathLike): void;
+
+    /**
+     * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+     * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+     * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+     * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
+     * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
+     */
+    function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+     * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+     * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+     */
+    function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace symlink {
+        /**
+         * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+         * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+         * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+         * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
+         * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
+         */
+        function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
+
+        type Type = "dir" | "file" | "junction";
+    }
+
+    /**
+     * Synchronous symlink(2) - Create a new symbolic link to an existing file.
+     * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+     * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+     * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
+     * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
+     */
+    function symlinkSync(target: PathLike, path: PathLike, type?: symlink.Type | null): void;
+
+    /**
+     * Asynchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readlink(
+        path: PathLike,
+        options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, linkString: string) => void
+    ): void;
+
+    /**
+     * Asynchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, linkString: Buffer) => void): void;
+
+    /**
+     * Asynchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, linkString: string | Buffer) => void): void;
+
+    /**
+     * Asynchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null, linkString: string) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace readlink {
+        /**
+         * Asynchronous readlink(2) - read value of a symbolic link.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
+
+        /**
+         * Asynchronous readlink(2) - read value of a symbolic link.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
+
+        /**
+         * Asynchronous readlink(2) - read value of a symbolic link.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
+    }
+
+    /**
+     * Synchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readlinkSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
+
+    /**
+     * Synchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readlinkSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
+
+    /**
+     * Synchronous readlink(2) - read value of a symbolic link.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readlinkSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
+
+    /**
+     * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function realpath(
+        path: PathLike,
+        options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void
+    ): void;
+
+    /**
+     * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
+
+    /**
+     * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
+
+    /**
+     * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace realpath {
+        /**
+         * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
+
+        /**
+         * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
+
+        /**
+         * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
+
+        function native(
+            path: PathLike,
+            options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null,
+            callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void
+        ): void;
+        function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException | null, resolvedPath: Buffer) => void): void;
+        function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string | Buffer) => void): void;
+        function native(path: PathLike, callback: (err: NodeJS.ErrnoException | null, resolvedPath: string) => void): void;
+    }
+
+    /**
+     * Synchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function realpathSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
+
+    /**
+     * Synchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function realpathSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
+
+    /**
+     * Synchronous realpath(3) - return the canonicalized absolute pathname.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
+
+    namespace realpathSync {
+        function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
+        function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer;
+        function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer;
+    }
+
+    /**
+     * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function unlink(path: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace unlink {
+        /**
+         * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(path: PathLike): Promise<void>;
+    }
+
+    /**
+     * Synchronous unlink(2) - delete a name and possibly the file it refers to.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function unlinkSync(path: PathLike): void;
+
+    interface RmDirOptions {
+        /**
+         * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
+         * `EPERM` error is encountered, Node.js will retry the operation with a linear
+         * backoff wait of `retryDelay` ms longer on each try. This option represents the
+         * number of retries. This option is ignored if the `recursive` option is not
+         * `true`.
+         * @default 0
+         */
+        maxRetries?: number;
+        /**
+         * If `true`, perform a recursive directory removal. In
+         * recursive mode, errors are not reported if `path` does not exist, and
+         * operations are retried on failure.
+         * @experimental
+         * @default false
+         */
+        recursive?: boolean;
+        /**
+         * The amount of time in milliseconds to wait between retries.
+         * This option is ignored if the `recursive` option is not `true`.
+         * @default 100
+         */
+        retryDelay?: number;
+    }
+
+    /**
+     * Asynchronous rmdir(2) - delete a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function rmdir(path: PathLike, callback: NoParamCallback): void;
+    function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace rmdir {
+        /**
+         * Asynchronous rmdir(2) - delete a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
+    }
+
+    /**
+     * Synchronous rmdir(2) - delete a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function rmdirSync(path: PathLike, options?: RmDirOptions): void;
+
+    interface MakeDirectoryOptions {
+        /**
+         * Indicates whether parent folders should be created.
+         * If a folder was created, the path to the first created folder will be returned.
+         * @default false
+         */
+        recursive?: boolean;
+        /**
+         * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
+         * @default 0o777
+         */
+        mode?: number | string;
+    }
+
+    /**
+     * Asynchronous mkdir(2) - create a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+     * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+     */
+    function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path: string) => void): void;
+
+    /**
+     * Asynchronous mkdir(2) - create a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+     * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+     */
+    function mkdir(path: PathLike, options: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null | undefined, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronous mkdir(2) - create a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+     * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+     */
+    function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path: string | undefined) => void): void;
+
+    /**
+     * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function mkdir(path: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace mkdir {
+        /**
+         * Asynchronous mkdir(2) - create a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+         * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+         */
+        function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
+
+        /**
+         * Asynchronous mkdir(2) - create a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+         * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+         */
+        function __promisify__(path: PathLike, options?: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise<void>;
+
+        /**
+         * Asynchronous mkdir(2) - create a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+         * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+         */
+        function __promisify__(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<string | undefined>;
+    }
+
+    /**
+     * Synchronous mkdir(2) - create a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+     * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+     */
+    function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string;
+
+    /**
+     * Synchronous mkdir(2) - create a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+     * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+     */
+    function mkdirSync(path: PathLike, options?: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null): void;
+
+    /**
+     * Synchronous mkdir(2) - create a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+     * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+     */
+    function mkdirSync(path: PathLike, options?: number | string | MakeDirectoryOptions | null): string | undefined;
+
+    /**
+     * Asynchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
+
+    /**
+     * Asynchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException | null, folder: Buffer) => void): void;
+
+    /**
+     * Asynchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, folder: string | Buffer) => void): void;
+
+    /**
+     * Asynchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     */
+    function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException | null, folder: string) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace mkdtemp {
+        /**
+         * Asynchronously creates a unique temporary directory.
+         * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
+
+        /**
+         * Asynchronously creates a unique temporary directory.
+         * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
+
+        /**
+         * Asynchronously creates a unique temporary directory.
+         * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(prefix: string, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
+    }
+
+    /**
+     * Synchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function mkdtempSync(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string;
+
+    /**
+     * Synchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function mkdtempSync(prefix: string, options: { encoding: "buffer" } | "buffer"): Buffer;
+
+    /**
+     * Synchronously creates a unique temporary directory.
+     * Generates six random characters to be appended behind a required prefix to create a unique temporary directory.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function mkdtempSync(prefix: string, options?: { encoding?: string | null } | string | null): string | Buffer;
+
+    /**
+     * Asynchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readdir(
+        path: PathLike,
+        options: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, files: string[]) => void,
+    ): void;
+
+    /**
+     * Asynchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer", callback: (err: NodeJS.ErrnoException | null, files: Buffer[]) => void): void;
+
+    /**
+     * Asynchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readdir(
+        path: PathLike,
+        options: { encoding?: string | null; withFileTypes?: false } | string | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void,
+    ): void;
+
+    /**
+     * Asynchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null, files: string[]) => void): void;
+
+    /**
+     * Asynchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+     */
+    function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace readdir {
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise<string[]>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer"; withFileTypes?: false }): Promise<Buffer[]>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function __promisify__(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): Promise<string[] | Buffer[]>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options If called with `withFileTypes: true` the result data will be an array of Dirent
+         */
+        function __promisify__(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise<Dirent[]>;
+    }
+
+    /**
+     * Synchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): string[];
+
+    /**
+     * Synchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readdirSync(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Buffer[];
+
+    /**
+     * Synchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+     */
+    function readdirSync(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): string[] | Buffer[];
+
+    /**
+     * Synchronous readdir(3) - read a directory.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+     */
+    function readdirSync(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Dirent[];
+
+    /**
+     * Asynchronous close(2) - close a file descriptor.
+     * @param fd A file descriptor.
+     */
+    function close(fd: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace close {
+        /**
+         * Asynchronous close(2) - close a file descriptor.
+         * @param fd A file descriptor.
+         */
+        function __promisify__(fd: number): Promise<void>;
+    }
+
+    /**
+     * Synchronous close(2) - close a file descriptor.
+     * @param fd A file descriptor.
+     */
+    function closeSync(fd: number): void;
+
+    /**
+     * Asynchronous open(2) - open and possibly create a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
+     */
+    function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
+
+    /**
+     * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     */
+    function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException | null, fd: number) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace open {
+        /**
+         * Asynchronous open(2) - open and possibly create a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
+         */
+        function __promisify__(path: PathLike, flags: string | number, mode?: string | number | null): Promise<number>;
+    }
+
+    /**
+     * Synchronous open(2) - open and possibly create a file, returning a file descriptor..
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`.
+     */
+    function openSync(path: PathLike, flags: string | number, mode?: string | number | null): number;
+
+    /**
+     * Asynchronously change file timestamps of the file referenced by the supplied path.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param atime The last access time. If a string is provided, it will be coerced to number.
+     * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+     */
+    function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace utimes {
+        /**
+         * Asynchronously change file timestamps of the file referenced by the supplied path.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param atime The last access time. If a string is provided, it will be coerced to number.
+         * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+         */
+        function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
+    }
+
+    /**
+     * Synchronously change file timestamps of the file referenced by the supplied path.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * @param atime The last access time. If a string is provided, it will be coerced to number.
+     * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+     */
+    function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void;
+
+    /**
+     * Asynchronously change file timestamps of the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param atime The last access time. If a string is provided, it will be coerced to number.
+     * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+     */
+    function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace futimes {
+        /**
+         * Asynchronously change file timestamps of the file referenced by the supplied file descriptor.
+         * @param fd A file descriptor.
+         * @param atime The last access time. If a string is provided, it will be coerced to number.
+         * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+         */
+        function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
+    }
+
+    /**
+     * Synchronously change file timestamps of the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param atime The last access time. If a string is provided, it will be coerced to number.
+     * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+     */
+    function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void;
+
+    /**
+     * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+     * @param fd A file descriptor.
+     */
+    function fsync(fd: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace fsync {
+        /**
+         * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+         * @param fd A file descriptor.
+         */
+        function __promisify__(fd: number): Promise<void>;
+    }
+
+    /**
+     * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+     * @param fd A file descriptor.
+     */
+    function fsyncSync(fd: number): void;
+
+    /**
+     * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+     * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+     * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+     */
+    function write<TBuffer extends NodeJS.ArrayBufferView>(
+        fd: number,
+        buffer: TBuffer,
+        offset: number | undefined | null,
+        length: number | undefined | null,
+        position: number | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+    ): void;
+
+    /**
+     * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+     * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+     */
+    function write<TBuffer extends NodeJS.ArrayBufferView>(
+        fd: number,
+        buffer: TBuffer,
+        offset: number | undefined | null,
+        length: number | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
+    ): void;
+
+    /**
+     * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+     */
+    function write<TBuffer extends NodeJS.ArrayBufferView>(
+        fd: number,
+        buffer: TBuffer,
+        offset: number | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void
+    ): void;
+
+    /**
+     * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     */
+    function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
+
+    /**
+     * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+     * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+     * @param encoding The expected string encoding.
+     */
+    function write(
+        fd: number,
+        string: any,
+        position: number | undefined | null,
+        encoding: string | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void,
+    ): void;
+
+    /**
+     * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+     * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+     */
+    function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
+
+    /**
+     * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+     */
+    function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException | null, written: number, str: string) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace write {
+        /**
+         * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
+         * @param fd A file descriptor.
+         * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+         * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+         * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+         */
+        function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+            fd: number,
+            buffer?: TBuffer,
+            offset?: number,
+            length?: number,
+            position?: number | null,
+        ): Promise<{ bytesWritten: number, buffer: TBuffer }>;
+
+        /**
+         * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
+         * @param fd A file descriptor.
+         * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+         * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+         * @param encoding The expected string encoding.
+         */
+        function __promisify__(fd: number, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>;
+    }
+
+    /**
+     * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written.
+     * @param fd A file descriptor.
+     * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+     * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+     * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+     */
+    function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number;
+
+    /**
+     * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written.
+     * @param fd A file descriptor.
+     * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+     * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+     * @param encoding The expected string encoding.
+     */
+    function writeSync(fd: number, string: any, position?: number | null, encoding?: string | null): number;
+
+    /**
+     * Asynchronously reads data from the file referenced by the supplied file descriptor.
+     * @param fd A file descriptor.
+     * @param buffer The buffer that the data will be written to.
+     * @param offset The offset in the buffer at which to start writing.
+     * @param length The number of bytes to read.
+     * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
+     */
+    function read<TBuffer extends NodeJS.ArrayBufferView>(
+        fd: number,
+        buffer: TBuffer,
+        offset: number,
+        length: number,
+        position: number | null,
+        callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void,
+    ): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace read {
+        /**
+         * @param fd A file descriptor.
+         * @param buffer The buffer that the data will be written to.
+         * @param offset The offset in the buffer at which to start writing.
+         * @param length The number of bytes to read.
+         * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
+         */
+        function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
+            fd: number,
+            buffer: TBuffer,
+            offset: number,
+            length: number,
+            position: number | null
+        ): Promise<{ bytesRead: number, buffer: TBuffer }>;
+    }
+
+    interface ReadSyncOptions {
+        /**
+         * @default 0
+         */
+        offset?: number;
+        /**
+         * @default `length of buffer`
+         */
+        length?: number;
+        /**
+         * @default null
+         */
+        position?: number | null;
+    }
+
+    /**
+     * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read.
+     * @param fd A file descriptor.
+     * @param buffer The buffer that the data will be written to.
+     * @param offset The offset in the buffer at which to start writing.
+     * @param length The number of bytes to read.
+     * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
+     */
+    function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: number | null): number;
+
+    /**
+     * Similar to the above `fs.readSync` function, this version takes an optional `options` object.
+     * If no `options` object is specified, it will default with the above values.
+     */
+    function readSync(fd: number, buffer: NodeJS.ArrayBufferView, opts?: ReadSyncOptions): number;
+
+    /**
+     * Asynchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param options An object that may contain an optional flag.
+     * If a flag is not provided, it defaults to `'r'`.
+     */
+    function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
+
+    /**
+     * Asynchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+     * If a flag is not provided, it defaults to `'r'`.
+     */
+    function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException | null, data: string) => void): void;
+
+    /**
+     * Asynchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+     * If a flag is not provided, it defaults to `'r'`.
+     */
+    function readFile(
+        path: PathLike | number,
+        options: { encoding?: string | null; flag?: string; } | string | undefined | null,
+        callback: (err: NodeJS.ErrnoException | null, data: string | Buffer) => void,
+    ): void;
+
+    /**
+     * Asynchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     */
+    function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException | null, data: Buffer) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace readFile {
+        /**
+         * Asynchronously reads the entire contents of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+         * @param options An object that may contain an optional flag.
+         * If a flag is not provided, it defaults to `'r'`.
+         */
+        function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise<Buffer>;
+
+        /**
+         * Asynchronously reads the entire contents of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+         * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+         * If a flag is not provided, it defaults to `'r'`.
+         */
+        function __promisify__(path: PathLike | number, options: { encoding: string; flag?: string; } | string): Promise<string>;
+
+        /**
+         * Asynchronously reads the entire contents of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+         * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+         * If a flag is not provided, it defaults to `'r'`.
+         */
+        function __promisify__(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): Promise<string | Buffer>;
+    }
+
+    /**
+     * Synchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`.
+     */
+    function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer;
+
+    /**
+     * Synchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+     * If a flag is not provided, it defaults to `'r'`.
+     */
+    function readFileSync(path: PathLike | number, options: { encoding: string; flag?: string; } | string): string;
+
+    /**
+     * Synchronously reads the entire contents of a file.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag.
+     * If a flag is not provided, it defaults to `'r'`.
+     */
+    function readFileSync(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): string | Buffer;
+
+    type WriteFileOptions = { encoding?: string | null; mode?: number | string; flag?: string; } | string | null;
+
+    /**
+     * Asynchronously writes data to a file, replacing the file if it already exists.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+     * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `mode` is not supplied, the default of `0o666` is used.
+     * If `mode` is a string, it is parsed as an octal integer.
+     * If `flag` is not supplied, the default of `'w'` is used.
+     */
+    function writeFile(path: PathLike | number, data: any, options: WriteFileOptions, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronously writes data to a file, replacing the file if it already exists.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+     */
+    function writeFile(path: PathLike | number, data: any, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace writeFile {
+        /**
+         * Asynchronously writes data to a file, replacing the file if it already exists.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+         * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+         * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+         * If `encoding` is not supplied, the default of `'utf8'` is used.
+         * If `mode` is not supplied, the default of `0o666` is used.
+         * If `mode` is a string, it is parsed as an octal integer.
+         * If `flag` is not supplied, the default of `'w'` is used.
+         */
+        function __promisify__(path: PathLike | number, data: any, options?: WriteFileOptions): Promise<void>;
+    }
+
+    /**
+     * Synchronously writes data to a file, replacing the file if it already exists.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+     * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `mode` is not supplied, the default of `0o666` is used.
+     * If `mode` is a string, it is parsed as an octal integer.
+     * If `flag` is not supplied, the default of `'w'` is used.
+     */
+    function writeFileSync(path: PathLike | number, data: any, options?: WriteFileOptions): void;
+
+    /**
+     * Asynchronously append data to a file, creating the file if it does not exist.
+     * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+     * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `mode` is not supplied, the default of `0o666` is used.
+     * If `mode` is a string, it is parsed as an octal integer.
+     * If `flag` is not supplied, the default of `'a'` is used.
+     */
+    function appendFile(file: PathLike | number, data: any, options: WriteFileOptions, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronously append data to a file, creating the file if it does not exist.
+     * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+     */
+    function appendFile(file: PathLike | number, data: any, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace appendFile {
+        /**
+         * Asynchronously append data to a file, creating the file if it does not exist.
+         * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+         * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+         * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+         * If `encoding` is not supplied, the default of `'utf8'` is used.
+         * If `mode` is not supplied, the default of `0o666` is used.
+         * If `mode` is a string, it is parsed as an octal integer.
+         * If `flag` is not supplied, the default of `'a'` is used.
+         */
+        function __promisify__(file: PathLike | number, data: any, options?: WriteFileOptions): Promise<void>;
+    }
+
+    /**
+     * Synchronously append data to a file, creating the file if it does not exist.
+     * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * If a file descriptor is provided, the underlying file will _not_ be closed automatically.
+     * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
+     * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `mode` is not supplied, the default of `0o666` is used.
+     * If `mode` is a string, it is parsed as an octal integer.
+     * If `flag` is not supplied, the default of `'a'` is used.
+     */
+    function appendFileSync(file: PathLike | number, data: any, options?: WriteFileOptions): void;
+
+    /**
+     * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
+     */
+    function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void;
+
+    /**
+     * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
+     * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void;
+
+    /**
+     * Stop watching for changes on `filename`.
+     * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void;
+
+    /**
+     * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+     * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `persistent` is not supplied, the default of `true` is used.
+     * If `recursive` is not supplied, the default of `false` is used.
+     */
+    function watch(
+        filename: PathLike,
+        options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null,
+        listener?: (event: string, filename: string) => void,
+    ): FSWatcher;
+
+    /**
+     * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+     * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `persistent` is not supplied, the default of `true` is used.
+     * If `recursive` is not supplied, the default of `false` is used.
+     */
+    function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher;
+
+    /**
+     * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+     * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options.
+     * If `encoding` is not supplied, the default of `'utf8'` is used.
+     * If `persistent` is not supplied, the default of `true` is used.
+     * If `recursive` is not supplied, the default of `false` is used.
+     */
+    function watch(
+        filename: PathLike,
+        options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | null,
+        listener?: (event: string, filename: string | Buffer) => void,
+    ): FSWatcher;
+
+    /**
+     * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
+     * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher;
+
+    /**
+     * Asynchronously tests whether or not the given path exists by checking with the file system.
+     * @deprecated
+     * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function exists(path: PathLike, callback: (exists: boolean) => void): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace exists {
+        /**
+         * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         */
+        function __promisify__(path: PathLike): Promise<boolean>;
+    }
+
+    /**
+     * Synchronously tests whether or not the given path exists by checking with the file system.
+     * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function existsSync(path: PathLike): boolean;
+
+    namespace constants {
+        // File Access Constants
+
+        /** Constant for fs.access(). File is visible to the calling process. */
+        const F_OK: number;
+
+        /** Constant for fs.access(). File can be read by the calling process. */
+        const R_OK: number;
+
+        /** Constant for fs.access(). File can be written by the calling process. */
+        const W_OK: number;
+
+        /** Constant for fs.access(). File can be executed by the calling process. */
+        const X_OK: number;
+
+        // File Copy Constants
+
+        /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */
+        const COPYFILE_EXCL: number;
+
+        /**
+         * Constant for fs.copyFile. copy operation will attempt to create a copy-on-write reflink.
+         * If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used.
+         */
+        const COPYFILE_FICLONE: number;
+
+        /**
+         * Constant for fs.copyFile. Copy operation will attempt to create a copy-on-write reflink.
+         * If the underlying platform does not support copy-on-write, then the operation will fail with an error.
+         */
+        const COPYFILE_FICLONE_FORCE: number;
+
+        // File Open Constants
+
+        /** Constant for fs.open(). Flag indicating to open a file for read-only access. */
+        const O_RDONLY: number;
+
+        /** Constant for fs.open(). Flag indicating to open a file for write-only access. */
+        const O_WRONLY: number;
+
+        /** Constant for fs.open(). Flag indicating to open a file for read-write access. */
+        const O_RDWR: number;
+
+        /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */
+        const O_CREAT: number;
+
+        /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */
+        const O_EXCL: number;
+
+        /**
+         * Constant for fs.open(). Flag indicating that if path identifies a terminal device,
+         * opening the path shall not cause that terminal to become the controlling terminal for the process
+         * (if the process does not already have one).
+         */
+        const O_NOCTTY: number;
+
+        /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */
+        const O_TRUNC: number;
+
+        /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */
+        const O_APPEND: number;
+
+        /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */
+        const O_DIRECTORY: number;
+
+        /**
+         * constant for fs.open().
+         * Flag indicating reading accesses to the file system will no longer result in
+         * an update to the atime information associated with the file.
+         * This flag is available on Linux operating systems only.
+         */
+        const O_NOATIME: number;
+
+        /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */
+        const O_NOFOLLOW: number;
+
+        /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */
+        const O_SYNC: number;
+
+        /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */
+        const O_DSYNC: number;
+
+        /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */
+        const O_SYMLINK: number;
+
+        /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */
+        const O_DIRECT: number;
+
+        /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */
+        const O_NONBLOCK: number;
+
+        // File Type Constants
+
+        /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */
+        const S_IFMT: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */
+        const S_IFREG: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */
+        const S_IFDIR: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */
+        const S_IFCHR: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */
+        const S_IFBLK: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */
+        const S_IFIFO: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */
+        const S_IFLNK: number;
+
+        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */
+        const S_IFSOCK: number;
+
+        // File Mode Constants
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */
+        const S_IRWXU: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */
+        const S_IRUSR: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */
+        const S_IWUSR: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */
+        const S_IXUSR: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */
+        const S_IRWXG: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */
+        const S_IRGRP: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */
+        const S_IWGRP: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */
+        const S_IXGRP: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */
+        const S_IRWXO: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */
+        const S_IROTH: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */
+        const S_IWOTH: number;
+
+        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
+        const S_IXOTH: number;
+
+        /**
+         * When set, a memory file mapping is used to access the file. This flag
+         * is available on Windows operating systems only. On other operating systems,
+         * this flag is ignored.
+         */
+        const UV_FS_O_FILEMAP: number;
+    }
+
+    /**
+     * Asynchronously tests a user's permissions for the file specified by path.
+     * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
+
+    /**
+     * Asynchronously tests a user's permissions for the file specified by path.
+     * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function access(path: PathLike, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace access {
+        /**
+         * Asynchronously tests a user's permissions for the file specified by path.
+         * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         */
+        function __promisify__(path: PathLike, mode?: number): Promise<void>;
+    }
+
+    /**
+     * Synchronously tests a user's permissions for the file specified by path.
+     * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function accessSync(path: PathLike, mode?: number): void;
+
+    /**
+     * Returns a new `ReadStream` object.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function createReadStream(path: PathLike, options?: string | {
+        flags?: string;
+        encoding?: string;
+        fd?: number;
+        mode?: number;
+        autoClose?: boolean;
+        /**
+         * @default false
+         */
+        emitClose?: boolean;
+        start?: number;
+        end?: number;
+        highWaterMark?: number;
+    }): ReadStream;
+
+    /**
+     * Returns a new `WriteStream` object.
+     * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+     * URL support is _experimental_.
+     */
+    function createWriteStream(path: PathLike, options?: string | {
+        flags?: string;
+        encoding?: string;
+        fd?: number;
+        mode?: number;
+        autoClose?: boolean;
+        emitClose?: boolean;
+        start?: number;
+        highWaterMark?: number;
+    }): WriteStream;
+
+    /**
+     * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+     * @param fd A file descriptor.
+     */
+    function fdatasync(fd: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace fdatasync {
+        /**
+         * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+         * @param fd A file descriptor.
+         */
+        function __promisify__(fd: number): Promise<void>;
+    }
+
+    /**
+     * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+     * @param fd A file descriptor.
+     */
+    function fdatasyncSync(fd: number): void;
+
+    /**
+     * Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
+     * No arguments other than a possible exception are given to the callback function.
+     * Node.js makes no guarantees about the atomicity of the copy operation.
+     * If an error occurs after the destination file has been opened for writing, Node.js will attempt
+     * to remove the destination.
+     * @param src A path to the source file.
+     * @param dest A path to the destination file.
+     */
+    function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
+    /**
+     * Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
+     * No arguments other than a possible exception are given to the callback function.
+     * Node.js makes no guarantees about the atomicity of the copy operation.
+     * If an error occurs after the destination file has been opened for writing, Node.js will attempt
+     * to remove the destination.
+     * @param src A path to the source file.
+     * @param dest A path to the destination file.
+     * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.
+     */
+    function copyFile(src: PathLike, dest: PathLike, flags: number, callback: NoParamCallback): void;
+
+    // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
+    namespace copyFile {
+        /**
+         * Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
+         * No arguments other than a possible exception are given to the callback function.
+         * Node.js makes no guarantees about the atomicity of the copy operation.
+         * If an error occurs after the destination file has been opened for writing, Node.js will attempt
+         * to remove the destination.
+         * @param src A path to the source file.
+         * @param dest A path to the destination file.
+         * @param flags An optional integer that specifies the behavior of the copy operation.
+         * The only supported flag is fs.constants.COPYFILE_EXCL,
+         * which causes the copy operation to fail if dest already exists.
+         */
+        function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise<void>;
+    }
+
+    /**
+     * Synchronously copies src to dest. By default, dest is overwritten if it already exists.
+     * Node.js makes no guarantees about the atomicity of the copy operation.
+     * If an error occurs after the destination file has been opened for writing, Node.js will attempt
+     * to remove the destination.
+     * @param src A path to the source file.
+     * @param dest A path to the destination file.
+     * @param flags An optional integer that specifies the behavior of the copy operation.
+     * The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.
+     */
+    function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void;
+
+    /**
+     * Write an array of ArrayBufferViews to the file specified by fd using writev().
+     * position is the offset from the beginning of the file where this data should be written.
+     * It is unsafe to use fs.writev() multiple times on the same file without waiting for the callback. For this scenario, use fs.createWriteStream().
+     * On Linux, positional writes don't work when the file is opened in append mode.
+     * The kernel ignores the position argument and always appends the data to the end of the file.
+     */
+    function writev(
+        fd: number,
+        buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
+        cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
+    ): void;
+    function writev(
+        fd: number,
+        buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
+        position: number,
+        cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
+    ): void;
+
+    interface WriteVResult {
+        bytesWritten: number;
+        buffers: NodeJS.ArrayBufferView[];
+    }
+
+    namespace writev {
+        function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
+    }
+
+    /**
+     * See `writev`.
+     */
+    function writevSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
+
+    function readv(
+        fd: number,
+        buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
+        cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void
+    ): void;
+    function readv(
+        fd: number,
+        buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
+        position: number,
+        cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void
+    ): void;
+
+    interface ReadVResult {
+        bytesRead: number;
+        buffers: NodeJS.ArrayBufferView[];
+    }
+
+    namespace readv {
+        function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
+    }
+
+    /**
+     * See `readv`.
+     */
+    function readvSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
+
+    interface OpenDirOptions {
+        encoding?: BufferEncoding;
+        /**
+         * Number of directory entries that are buffered
+         * internally when reading from the directory. Higher values lead to better
+         * performance but higher memory usage.
+         * @default 32
+         */
+        bufferSize?: number;
+    }
+
+    function opendirSync(path: string, options?: OpenDirOptions): Dir;
+
+    function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
+    function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
+
+    namespace opendir {
+        function __promisify__(path: string, options?: OpenDirOptions): Promise<Dir>;
+    }
+
+    namespace promises {
+        interface FileHandle {
+            /**
+             * Gets the file descriptor for this file handle.
+             */
+            readonly fd: number;
+
+            /**
+             * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically.
+             * The `FileHandle` must have been opened for appending.
+             * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
+             * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+             * If `encoding` is not supplied, the default of `'utf8'` is used.
+             * If `mode` is not supplied, the default of `0o666` is used.
+             * If `mode` is a string, it is parsed as an octal integer.
+             * If `flag` is not supplied, the default of `'a'` is used.
+             */
+            appendFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
+
+            /**
+             * Asynchronous fchown(2) - Change ownership of a file.
+             */
+            chown(uid: number, gid: number): Promise<void>;
+
+            /**
+             * Asynchronous fchmod(2) - Change permissions of a file.
+             * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+             */
+            chmod(mode: string | number): Promise<void>;
+
+            /**
+             * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+             */
+            datasync(): Promise<void>;
+
+            /**
+             * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+             */
+            sync(): Promise<void>;
+
+            /**
+             * Asynchronously reads data from the file.
+             * The `FileHandle` must have been opened for reading.
+             * @param buffer The buffer that the data will be written to.
+             * @param offset The offset in the buffer at which to start writing.
+             * @param length The number of bytes to read.
+             * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
+             */
+            read<TBuffer extends Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
+
+            /**
+             * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+             * The `FileHandle` must have been opened for reading.
+             * @param options An object that may contain an optional flag.
+             * If a flag is not provided, it defaults to `'r'`.
+             */
+            readFile(options?: { encoding?: null, flag?: string | number } | null): Promise<Buffer>;
+
+            /**
+             * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+             * The `FileHandle` must have been opened for reading.
+             * @param options An object that may contain an optional flag.
+             * If a flag is not provided, it defaults to `'r'`.
+             */
+            readFile(options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise<string>;
+
+            /**
+             * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
+             * The `FileHandle` must have been opened for reading.
+             * @param options An object that may contain an optional flag.
+             * If a flag is not provided, it defaults to `'r'`.
+             */
+            readFile(options?: { encoding?: string | null, flag?: string | number } | string | null): Promise<string | Buffer>;
+
+            /**
+             * Asynchronous fstat(2) - Get file status.
+             */
+            stat(): Promise<Stats>;
+
+            /**
+             * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+             * @param len If not specified, defaults to `0`.
+             */
+            truncate(len?: number): Promise<void>;
+
+            /**
+             * Asynchronously change file timestamps of the file.
+             * @param atime The last access time. If a string is provided, it will be coerced to number.
+             * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+             */
+            utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>;
+
+            /**
+             * Asynchronously writes `buffer` to the file.
+             * The `FileHandle` must have been opened for writing.
+             * @param buffer The buffer that the data will be written to.
+             * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+             * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+             * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+             */
+            write<TBuffer extends Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
+
+            /**
+             * Asynchronously writes `string` to the file.
+             * The `FileHandle` must have been opened for writing.
+             * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise`
+             * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended.
+             * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+             * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+             * @param encoding The expected string encoding.
+             */
+            write(data: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>;
+
+            /**
+             * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically.
+             * The `FileHandle` must have been opened for writing.
+             * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected).
+             * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
+             * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+             * If `encoding` is not supplied, the default of `'utf8'` is used.
+             * If `mode` is not supplied, the default of `0o666` is used.
+             * If `mode` is a string, it is parsed as an octal integer.
+             * If `flag` is not supplied, the default of `'w'` is used.
+             */
+            writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
+
+            /**
+             * See `fs.writev` promisified version.
+             */
+            writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
+
+            /**
+             * See `fs.readv` promisified version.
+             */
+            readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
+
+            /**
+             * Asynchronous close(2) - close a `FileHandle`.
+             */
+            close(): Promise<void>;
+        }
+
+        /**
+         * Asynchronously tests a user's permissions for the file specified by path.
+         * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         */
+        function access(path: PathLike, mode?: number): Promise<void>;
+
+        /**
+         * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists.
+         * Node.js makes no guarantees about the atomicity of the copy operation.
+         * If an error occurs after the destination file has been opened for writing, Node.js will attempt
+         * to remove the destination.
+         * @param src A path to the source file.
+         * @param dest A path to the destination file.
+         * @param flags An optional integer that specifies the behavior of the copy operation. The only
+         * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if
+         * `dest` already exists.
+         */
+        function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise<void>;
+
+        /**
+         * Asynchronous open(2) - open and possibly create a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not
+         * supplied, defaults to `0o666`.
+         */
+        function open(path: PathLike, flags: string | number, mode?: string | number): Promise<FileHandle>;
+
+        /**
+         * Asynchronously reads data from the file referenced by the supplied `FileHandle`.
+         * @param handle A `FileHandle`.
+         * @param buffer The buffer that the data will be written to.
+         * @param offset The offset in the buffer at which to start writing.
+         * @param length The number of bytes to read.
+         * @param position The offset from the beginning of the file from which data should be read. If
+         * `null`, data will be read from the current position.
+         */
+        function read<TBuffer extends Uint8Array>(
+            handle: FileHandle,
+            buffer: TBuffer,
+            offset?: number | null,
+            length?: number | null,
+            position?: number | null,
+        ): Promise<{ bytesRead: number, buffer: TBuffer }>;
+
+        /**
+         * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`.
+         * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise`
+         * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended.
+         * @param handle A `FileHandle`.
+         * @param buffer The buffer that the data will be written to.
+         * @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
+         * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
+         * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+         */
+        function write<TBuffer extends Uint8Array>(
+            handle: FileHandle,
+            buffer: TBuffer,
+            offset?: number | null,
+            length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
+
+        /**
+         * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`.
+         * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise`
+         * to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended.
+         * @param handle A `FileHandle`.
+         * @param string A string to write. If something other than a string is supplied it will be coerced to a string.
+         * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
+         * @param encoding The expected string encoding.
+         */
+        function write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>;
+
+        /**
+         * Asynchronous rename(2) - Change the name or location of a file or directory.
+         * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         */
+        function rename(oldPath: PathLike, newPath: PathLike): Promise<void>;
+
+        /**
+         * Asynchronous truncate(2) - Truncate a file to a specified length.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param len If not specified, defaults to `0`.
+         */
+        function truncate(path: PathLike, len?: number): Promise<void>;
+
+        /**
+         * Asynchronous ftruncate(2) - Truncate a file to a specified length.
+         * @param handle A `FileHandle`.
+         * @param len If not specified, defaults to `0`.
+         */
+        function ftruncate(handle: FileHandle, len?: number): Promise<void>;
+
+        /**
+         * Asynchronous rmdir(2) - delete a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
+
+        /**
+         * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
+         * @param handle A `FileHandle`.
+         */
+        function fdatasync(handle: FileHandle): Promise<void>;
+
+        /**
+         * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
+         * @param handle A `FileHandle`.
+         */
+        function fsync(handle: FileHandle): Promise<void>;
+
+        /**
+         * Asynchronous mkdir(2) - create a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+         * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+         */
+        function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
+
+        /**
+         * Asynchronous mkdir(2) - create a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+         * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+         */
+        function mkdir(path: PathLike, options?: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise<void>;
+
+        /**
+         * Asynchronous mkdir(2) - create a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
+         * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
+         */
+        function mkdir(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<string | undefined>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise<string[]>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Promise<Buffer[]>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function readdir(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): Promise<string[] | Buffer[]>;
+
+        /**
+         * Asynchronous readdir(3) - read a directory.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
+         */
+        function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise<Dirent[]>;
+
+        /**
+         * Asynchronous readlink(2) - read value of a symbolic link.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function readlink(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
+
+        /**
+         * Asynchronous readlink(2) - read value of a symbolic link.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
+
+        /**
+         * Asynchronous readlink(2) - read value of a symbolic link.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function readlink(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
+
+        /**
+         * Asynchronous symlink(2) - Create a new symbolic link to an existing file.
+         * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
+         * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
+         * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
+         * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
+         */
+        function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
+
+        /**
+         * Asynchronous fstat(2) - Get file status.
+         * @param handle A `FileHandle`.
+         */
+        function fstat(handle: FileHandle): Promise<Stats>;
+
+        /**
+         * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function lstat(path: PathLike): Promise<Stats>;
+
+        /**
+         * Asynchronous stat(2) - Get file status.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function stat(path: PathLike): Promise<Stats>;
+
+        /**
+         * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
+         * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
+
+        /**
+         * Asynchronous unlink(2) - delete a name and possibly the file it refers to.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function unlink(path: PathLike): Promise<void>;
+
+        /**
+         * Asynchronous fchmod(2) - Change permissions of a file.
+         * @param handle A `FileHandle`.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+         */
+        function fchmod(handle: FileHandle, mode: string | number): Promise<void>;
+
+        /**
+         * Asynchronous chmod(2) - Change permissions of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+         */
+        function chmod(path: PathLike, mode: string | number): Promise<void>;
+
+        /**
+         * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param mode A file mode. If a string is passed, it is parsed as an octal integer.
+         */
+        function lchmod(path: PathLike, mode: string | number): Promise<void>;
+
+        /**
+         * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
+
+        /**
+         * Asynchronous fchown(2) - Change ownership of a file.
+         * @param handle A `FileHandle`.
+         */
+        function fchown(handle: FileHandle, uid: number, gid: number): Promise<void>;
+
+        /**
+         * Asynchronous chown(2) - Change ownership of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         */
+        function chown(path: PathLike, uid: number, gid: number): Promise<void>;
+
+        /**
+         * Asynchronously change file timestamps of the file referenced by the supplied path.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param atime The last access time. If a string is provided, it will be coerced to number.
+         * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+         */
+        function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
+
+        /**
+         * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`.
+         * @param handle A `FileHandle`.
+         * @param atime The last access time. If a string is provided, it will be coerced to number.
+         * @param mtime The last modified time. If a string is provided, it will be coerced to number.
+         */
+        function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
+
+        /**
+         * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function realpath(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
+
+        /**
+         * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
+
+        /**
+         * Asynchronous realpath(3) - return the canonicalized absolute pathname.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function realpath(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
+
+        /**
+         * Asynchronously creates a unique temporary directory.
+         * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function mkdtemp(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string>;
+
+        /**
+         * Asynchronously creates a unique temporary directory.
+         * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function mkdtemp(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise<Buffer>;
+
+        /**
+         * Asynchronously creates a unique temporary directory.
+         * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory.
+         * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
+         */
+        function mkdtemp(prefix: string, options?: { encoding?: string | null } | string | null): Promise<string | Buffer>;
+
+        /**
+         * Asynchronously writes data to a file, replacing the file if it already exists.
+         * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected).
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+         * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
+         * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+         * If `encoding` is not supplied, the default of `'utf8'` is used.
+         * If `mode` is not supplied, the default of `0o666` is used.
+         * If `mode` is a string, it is parsed as an octal integer.
+         * If `flag` is not supplied, the default of `'w'` is used.
+         */
+        function writeFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
+
+        /**
+         * Asynchronously append data to a file, creating the file if it does not exist.
+         * @param file A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * URL support is _experimental_.
+         * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+         * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string.
+         * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag.
+         * If `encoding` is not supplied, the default of `'utf8'` is used.
+         * If `mode` is not supplied, the default of `0o666` is used.
+         * If `mode` is a string, it is parsed as an octal integer.
+         * If `flag` is not supplied, the default of `'a'` is used.
+         */
+        function appendFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
+
+        /**
+         * Asynchronously reads the entire contents of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+         * @param options An object that may contain an optional flag.
+         * If a flag is not provided, it defaults to `'r'`.
+         */
+        function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: string | number } | null): Promise<Buffer>;
+
+        /**
+         * Asynchronously reads the entire contents of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+         * @param options An object that may contain an optional flag.
+         * If a flag is not provided, it defaults to `'r'`.
+         */
+        function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise<string>;
+
+        /**
+         * Asynchronously reads the entire contents of a file.
+         * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
+         * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
+         * @param options An object that may contain an optional flag.
+         * If a flag is not provided, it defaults to `'r'`.
+         */
+        function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise<string | Buffer>;
+
+        function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
+    }
+
+    interface BigIntStats extends StatsBase<bigint> {
+    }
+
+    class BigIntStats {
+        atimeNs: bigint;
+        mtimeNs: bigint;
+        ctimeNs: bigint;
+        birthtimeNs: bigint;
+    }
+
+    interface BigIntOptions {
+        bigint: true;
+    }
+
+    interface StatOptions {
+        bigint: boolean;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/globals.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/globals.d.ts
new file mode 100644 (file)
index 0000000..b45bbf3
--- /dev/null
@@ -0,0 +1,1147 @@
+// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
+interface Console {
+    Console: NodeJS.ConsoleConstructor;
+    /**
+     * A simple assertion test that verifies whether `value` is truthy.
+     * If it is not, an `AssertionError` is thrown.
+     * If provided, the error `message` is formatted using `util.format()` and used as the error message.
+     */
+    assert(value: any, message?: string, ...optionalParams: any[]): void;
+    /**
+     * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
+     * When `stdout` is not a TTY, this method does nothing.
+     */
+    clear(): void;
+    /**
+     * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
+     */
+    count(label?: string): void;
+    /**
+     * Resets the internal counter specific to `label`.
+     */
+    countReset(label?: string): void;
+    /**
+     * The `console.debug()` function is an alias for {@link console.log()}.
+     */
+    debug(message?: any, ...optionalParams: any[]): void;
+    /**
+     * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`.
+     * This function bypasses any custom `inspect()` function defined on `obj`.
+     */
+    dir(obj: any, options?: NodeJS.InspectOptions): void;
+    /**
+     * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting
+     */
+    dirxml(...data: any[]): void;
+    /**
+     * Prints to `stderr` with newline.
+     */
+    error(message?: any, ...optionalParams: any[]): void;
+    /**
+     * Increases indentation of subsequent lines by two spaces.
+     * If one or more `label`s are provided, those are printed first without the additional indentation.
+     */
+    group(...label: any[]): void;
+    /**
+     * The `console.groupCollapsed()` function is an alias for {@link console.group()}.
+     */
+    groupCollapsed(...label: any[]): void;
+    /**
+     * Decreases indentation of subsequent lines by two spaces.
+     */
+    groupEnd(): void;
+    /**
+     * The {@link console.info()} function is an alias for {@link console.log()}.
+     */
+    info(message?: any, ...optionalParams: any[]): void;
+    /**
+     * Prints to `stdout` with newline.
+     */
+    log(message?: any, ...optionalParams: any[]): void;
+    /**
+     * This method does not display anything unless used in the inspector.
+     *  Prints to `stdout` the array `array` formatted as a table.
+     */
+    table(tabularData: any, properties?: ReadonlyArray<string>): void;
+    /**
+     * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
+     */
+    time(label?: string): void;
+    /**
+     * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`.
+     */
+    timeEnd(label?: string): void;
+    /**
+     * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`.
+     */
+    timeLog(label?: string, ...data: any[]): void;
+    /**
+     * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.
+     */
+    trace(message?: any, ...optionalParams: any[]): void;
+    /**
+     * The {@link console.warn()} function is an alias for {@link console.error()}.
+     */
+    warn(message?: any, ...optionalParams: any[]): void;
+
+    // --- Inspector mode only ---
+    /**
+     * This method does not display anything unless used in the inspector.
+     *  Starts a JavaScript CPU profile with an optional label.
+     */
+    profile(label?: string): void;
+    /**
+     * This method does not display anything unless used in the inspector.
+     *  Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
+     */
+    profileEnd(label?: string): void;
+    /**
+     * This method does not display anything unless used in the inspector.
+     *  Adds an event with the label `label` to the Timeline panel of the inspector.
+     */
+    timeStamp(label?: string): void;
+}
+
+// Declare "static" methods in Error
+interface ErrorConstructor {
+    /** Create .stack property on a target object */
+    captureStackTrace(targetObject: object, constructorOpt?: Function): void;
+
+    /**
+     * Optional override for formatting stack traces
+     *
+     * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
+     */
+    prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any;
+
+    stackTraceLimit: number;
+}
+
+// Node.js ESNEXT support
+interface String {
+    /** Removes whitespace from the left end of a string. */
+    trimLeft(): string;
+    /** Removes whitespace from the right end of a string. */
+    trimRight(): string;
+
+    /** Returns a copy with leading whitespace removed. */
+    trimStart(): string;
+    /** Returns a copy with trailing whitespace removed. */
+    trimEnd(): string;
+}
+
+interface ImportMeta {
+    url: string;
+}
+
+/*-----------------------------------------------*
+ *                                               *
+ *                   GLOBAL                      *
+ *                                               *
+ ------------------------------------------------*/
+
+// For backwards compability
+interface NodeRequire extends NodeJS.Require {}
+interface RequireResolve extends NodeJS.RequireResolve {}
+interface NodeModule extends NodeJS.Module {}
+
+declare var process: NodeJS.Process;
+declare var console: Console;
+
+declare var __filename: string;
+declare var __dirname: string;
+
+declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
+declare namespace setTimeout {
+    function __promisify__(ms: number): Promise<void>;
+    function __promisify__<T>(ms: number, value: T): Promise<T>;
+}
+declare function clearTimeout(timeoutId: NodeJS.Timeout): void;
+declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
+declare function clearInterval(intervalId: NodeJS.Timeout): void;
+declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
+declare namespace setImmediate {
+    function __promisify__(): Promise<void>;
+    function __promisify__<T>(value: T): Promise<T>;
+}
+declare function clearImmediate(immediateId: NodeJS.Immediate): void;
+
+declare function queueMicrotask(callback: () => void): void;
+
+declare var require: NodeRequire;
+declare var module: NodeModule;
+
+// Same as module.exports
+declare var exports: any;
+
+// Buffer class
+type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
+
+/**
+ * Raw data is stored in instances of the Buffer class.
+ * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap.  A Buffer cannot be resized.
+ * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+ */
+declare class Buffer extends Uint8Array {
+    /**
+     * Allocates a new buffer containing the given {str}.
+     *
+     * @param str String to store in buffer.
+     * @param encoding encoding to use, optional.  Default is 'utf8'
+     * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
+     */
+    constructor(str: string, encoding?: BufferEncoding);
+    /**
+     * Allocates a new buffer of {size} octets.
+     *
+     * @param size count of octets to allocate.
+     * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
+     */
+    constructor(size: number);
+    /**
+     * Allocates a new buffer containing the given {array} of octets.
+     *
+     * @param array The octets to store.
+     * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+     */
+    constructor(array: Uint8Array);
+    /**
+     * Produces a Buffer backed by the same allocated memory as
+     * the given {ArrayBuffer}/{SharedArrayBuffer}.
+     *
+     *
+     * @param arrayBuffer The ArrayBuffer with which to share memory.
+     * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
+     */
+    constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer);
+    /**
+     * Allocates a new buffer containing the given {array} of octets.
+     *
+     * @param array The octets to store.
+     * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
+     */
+    constructor(array: ReadonlyArray<any>);
+    /**
+     * Copies the passed {buffer} data onto a new {Buffer} instance.
+     *
+     * @param buffer The buffer to copy.
+     * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
+     */
+    constructor(buffer: Buffer);
+    /**
+     * When passed a reference to the .buffer property of a TypedArray instance,
+     * the newly created Buffer will share the same allocated memory as the TypedArray.
+     * The optional {byteOffset} and {length} arguments specify a memory range
+     * within the {arrayBuffer} that will be shared by the Buffer.
+     *
+     * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
+     */
+    static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
+    /**
+     * Creates a new Buffer using the passed {data}
+     * @param data data to create a new Buffer
+     */
+    static from(data: ReadonlyArray<number>): Buffer;
+    static from(data: Uint8Array): Buffer;
+    /**
+     * Creates a new buffer containing the coerced value of an object
+     * A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
+     * @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
+     */
+    static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
+    /**
+     * Creates a new Buffer containing the given JavaScript string {str}.
+     * If provided, the {encoding} parameter identifies the character encoding.
+     * If not provided, {encoding} defaults to 'utf8'.
+     */
+    static from(str: string, encoding?: BufferEncoding): Buffer;
+    /**
+     * Creates a new Buffer using the passed {data}
+     * @param values to create a new Buffer
+     */
+    static of(...items: number[]): Buffer;
+    /**
+     * Returns true if {obj} is a Buffer
+     *
+     * @param obj object to test.
+     */
+    static isBuffer(obj: any): obj is Buffer;
+    /**
+     * Returns true if {encoding} is a valid encoding argument.
+     * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
+     *
+     * @param encoding string to test.
+     */
+    static isEncoding(encoding: string): encoding is BufferEncoding;
+    /**
+     * Gives the actual byte length of a string. encoding defaults to 'utf8'.
+     * This is not the same as String.prototype.length since that returns the number of characters in a string.
+     *
+     * @param string string to test.
+     * @param encoding encoding used to evaluate (defaults to 'utf8')
+     */
+    static byteLength(
+        string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
+        encoding?: BufferEncoding
+    ): number;
+    /**
+     * Returns a buffer which is the result of concatenating all the buffers in the list together.
+     *
+     * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
+     * If the list has exactly one item, then the first item of the list is returned.
+     * If the list has more than one item, then a new Buffer is created.
+     *
+     * @param list An array of Buffer objects to concatenate
+     * @param totalLength Total length of the buffers when concatenated.
+     *   If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
+     */
+    static concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
+    /**
+     * The same as buf1.compare(buf2).
+     */
+    static compare(buf1: Uint8Array, buf2: Uint8Array): number;
+    /**
+     * Allocates a new buffer of {size} octets.
+     *
+     * @param size count of octets to allocate.
+     * @param fill if specified, buffer will be initialized by calling buf.fill(fill).
+     *    If parameter is omitted, buffer will be filled with zeros.
+     * @param encoding encoding used for call to buf.fill while initalizing
+     */
+    static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
+    /**
+     * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
+     * of the newly created Buffer are unknown and may contain sensitive data.
+     *
+     * @param size count of octets to allocate
+     */
+    static allocUnsafe(size: number): Buffer;
+    /**
+     * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
+     * of the newly created Buffer are unknown and may contain sensitive data.
+     *
+     * @param size count of octets to allocate
+     */
+    static allocUnsafeSlow(size: number): Buffer;
+    /**
+     * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.
+     */
+    static poolSize: number;
+
+    write(string: string, encoding?: BufferEncoding): number;
+    write(string: string, offset: number, encoding?: BufferEncoding): number;
+    write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
+    toString(encoding?: string, start?: number, end?: number): string;
+    toJSON(): { type: 'Buffer'; data: number[] };
+    equals(otherBuffer: Uint8Array): boolean;
+    compare(
+        otherBuffer: Uint8Array,
+        targetStart?: number,
+        targetEnd?: number,
+        sourceStart?: number,
+        sourceEnd?: number
+    ): number;
+    copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
+    /**
+     * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
+     *
+     * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
+     *
+     * @param begin Where the new `Buffer` will start. Default: `0`.
+     * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
+     */
+    slice(begin?: number, end?: number): Buffer;
+    /**
+     * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
+     *
+     * This method is compatible with `Uint8Array#subarray()`.
+     *
+     * @param begin Where the new `Buffer` will start. Default: `0`.
+     * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
+     */
+    subarray(begin?: number, end?: number): Buffer;
+    writeUIntLE(value: number, offset: number, byteLength: number): number;
+    writeUIntBE(value: number, offset: number, byteLength: number): number;
+    writeIntLE(value: number, offset: number, byteLength: number): number;
+    writeIntBE(value: number, offset: number, byteLength: number): number;
+    readUIntLE(offset: number, byteLength: number): number;
+    readUIntBE(offset: number, byteLength: number): number;
+    readIntLE(offset: number, byteLength: number): number;
+    readIntBE(offset: number, byteLength: number): number;
+    readUInt8(offset?: number): number;
+    readUInt16LE(offset?: number): number;
+    readUInt16BE(offset?: number): number;
+    readUInt32LE(offset?: number): number;
+    readUInt32BE(offset?: number): number;
+    readInt8(offset?: number): number;
+    readInt16LE(offset?: number): number;
+    readInt16BE(offset?: number): number;
+    readInt32LE(offset?: number): number;
+    readInt32BE(offset?: number): number;
+    readFloatLE(offset?: number): number;
+    readFloatBE(offset?: number): number;
+    readDoubleLE(offset?: number): number;
+    readDoubleBE(offset?: number): number;
+    reverse(): this;
+    swap16(): Buffer;
+    swap32(): Buffer;
+    swap64(): Buffer;
+    writeUInt8(value: number, offset?: number): number;
+    writeUInt16LE(value: number, offset?: number): number;
+    writeUInt16BE(value: number, offset?: number): number;
+    writeUInt32LE(value: number, offset?: number): number;
+    writeUInt32BE(value: number, offset?: number): number;
+    writeInt8(value: number, offset?: number): number;
+    writeInt16LE(value: number, offset?: number): number;
+    writeInt16BE(value: number, offset?: number): number;
+    writeInt32LE(value: number, offset?: number): number;
+    writeInt32BE(value: number, offset?: number): number;
+    writeFloatLE(value: number, offset?: number): number;
+    writeFloatBE(value: number, offset?: number): number;
+    writeDoubleLE(value: number, offset?: number): number;
+    writeDoubleBE(value: number, offset?: number): number;
+
+    fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
+
+    indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+    lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
+    entries(): IterableIterator<[number, number]>;
+    includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
+    keys(): IterableIterator<number>;
+    values(): IterableIterator<number>;
+}
+
+interface Buffer extends Uint8Array {
+    readBigUInt64BE(offset?: number): bigint;
+    readBigUInt64LE(offset?: number): bigint;
+    readBigInt64BE(offset?: number): bigint;
+    readBigInt64LE(offset?: number): bigint;
+    writeBigInt64BE(value: bigint, offset?: number): number;
+    writeBigInt64LE(value: bigint, offset?: number): number;
+    writeBigUInt64BE(value: bigint, offset?: number): number;
+    writeBigUInt64LE(value: bigint, offset?: number): number;
+}
+
+/*----------------------------------------------*
+*                                               *
+*               GLOBAL INTERFACES               *
+*                                               *
+*-----------------------------------------------*/
+declare namespace NodeJS {
+    interface InspectOptions {
+        /**
+         * If set to `true`, getters are going to be
+         * inspected as well. If set to `'get'` only getters without setter are going
+         * to be inspected. If set to `'set'` only getters having a corresponding
+         * setter are going to be inspected. This might cause side effects depending on
+         * the getter function.
+         * @default `false`
+         */
+        getters?: 'get' | 'set' | boolean;
+        showHidden?: boolean;
+        /**
+         * @default 2
+         */
+        depth?: number | null;
+        colors?: boolean;
+        customInspect?: boolean;
+        showProxy?: boolean;
+        maxArrayLength?: number | null;
+        /**
+         * Specifies the maximum number of characters to
+         * include when formatting. Set to `null` or `Infinity` to show all elements.
+         * Set to `0` or negative to show no characters.
+         * @default Infinity
+         */
+        maxStringLength?: number | null;
+        breakLength?: number;
+        /**
+         * Setting this to `false` causes each object key
+         * to be displayed on a new line. It will also add new lines to text that is
+         * longer than `breakLength`. If set to a number, the most `n` inner elements
+         * are united on a single line as long as all properties fit into
+         * `breakLength`. Short array elements are also grouped together. Note that no
+         * text will be reduced below 16 characters, no matter the `breakLength` size.
+         * For more information, see the example below.
+         * @default `true`
+         */
+        compact?: boolean | number;
+        sorted?: boolean | ((a: string, b: string) => number);
+    }
+
+    interface ConsoleConstructorOptions {
+        stdout: WritableStream;
+        stderr?: WritableStream;
+        ignoreErrors?: boolean;
+        colorMode?: boolean | 'auto';
+        inspectOptions?: InspectOptions;
+    }
+
+    interface ConsoleConstructor {
+        prototype: Console;
+        new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
+        new(options: ConsoleConstructorOptions): Console;
+    }
+
+    interface CallSite {
+        /**
+         * Value of "this"
+         */
+        getThis(): any;
+
+        /**
+         * Type of "this" as a string.
+         * This is the name of the function stored in the constructor field of
+         * "this", if available.  Otherwise the object's [[Class]] internal
+         * property.
+         */
+        getTypeName(): string | null;
+
+        /**
+         * Current function
+         */
+        getFunction(): Function | undefined;
+
+        /**
+         * Name of the current function, typically its name property.
+         * If a name property is not available an attempt will be made to try
+         * to infer a name from the function's context.
+         */
+        getFunctionName(): string | null;
+
+        /**
+         * Name of the property [of "this" or one of its prototypes] that holds
+         * the current function
+         */
+        getMethodName(): string | null;
+
+        /**
+         * Name of the script [if this function was defined in a script]
+         */
+        getFileName(): string | null;
+
+        /**
+         * Current line number [if this function was defined in a script]
+         */
+        getLineNumber(): number | null;
+
+        /**
+         * Current column number [if this function was defined in a script]
+         */
+        getColumnNumber(): number | null;
+
+        /**
+         * A call site object representing the location where eval was called
+         * [if this function was created using a call to eval]
+         */
+        getEvalOrigin(): string | undefined;
+
+        /**
+         * Is this a toplevel invocation, that is, is "this" the global object?
+         */
+        isToplevel(): boolean;
+
+        /**
+         * Does this call take place in code defined by a call to eval?
+         */
+        isEval(): boolean;
+
+        /**
+         * Is this call in native V8 code?
+         */
+        isNative(): boolean;
+
+        /**
+         * Is this a constructor call?
+         */
+        isConstructor(): boolean;
+    }
+
+    interface ErrnoException extends Error {
+        errno?: number;
+        code?: string;
+        path?: string;
+        syscall?: string;
+        stack?: string;
+    }
+
+    interface EventEmitter {
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+        removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+        off(event: string | symbol, listener: (...args: any[]) => void): this;
+        removeAllListeners(event?: string | symbol): this;
+        setMaxListeners(n: number): this;
+        getMaxListeners(): number;
+        listeners(event: string | symbol): Function[];
+        rawListeners(event: string | symbol): Function[];
+        emit(event: string | symbol, ...args: any[]): boolean;
+        listenerCount(type: string | symbol): number;
+        // Added in Node 6...
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+        eventNames(): Array<string | symbol>;
+    }
+
+    interface ReadableStream extends EventEmitter {
+        readable: boolean;
+        read(size?: number): string | Buffer;
+        setEncoding(encoding: string): this;
+        pause(): this;
+        resume(): this;
+        isPaused(): boolean;
+        pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
+        unpipe(destination?: WritableStream): this;
+        unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
+        wrap(oldStream: ReadableStream): this;
+        [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
+    }
+
+    interface WritableStream extends EventEmitter {
+        writable: boolean;
+        write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
+        write(str: string, encoding?: string, cb?: (err?: Error | null) => void): boolean;
+        end(cb?: () => void): void;
+        end(data: string | Uint8Array, cb?: () => void): void;
+        end(str: string, encoding?: string, cb?: () => void): void;
+    }
+
+    interface ReadWriteStream extends ReadableStream, WritableStream { }
+
+    interface Domain extends EventEmitter {
+        run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
+        add(emitter: EventEmitter | Timer): void;
+        remove(emitter: EventEmitter | Timer): void;
+        bind<T extends Function>(cb: T): T;
+        intercept<T extends Function>(cb: T): T;
+
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        on(event: string, listener: (...args: any[]) => void): this;
+        once(event: string, listener: (...args: any[]) => void): this;
+        removeListener(event: string, listener: (...args: any[]) => void): this;
+        removeAllListeners(event?: string): this;
+    }
+
+    interface MemoryUsage {
+        rss: number;
+        heapTotal: number;
+        heapUsed: number;
+        external: number;
+        arrayBuffers: number;
+    }
+
+    interface CpuUsage {
+        user: number;
+        system: number;
+    }
+
+    interface ProcessRelease {
+        name: string;
+        sourceUrl?: string;
+        headersUrl?: string;
+        libUrl?: string;
+        lts?: string;
+    }
+
+    interface ProcessVersions {
+        http_parser: string;
+        node: string;
+        v8: string;
+        ares: string;
+        uv: string;
+        zlib: string;
+        modules: string;
+        openssl: string;
+    }
+
+    type Platform = 'aix'
+        | 'android'
+        | 'darwin'
+        | 'freebsd'
+        | 'linux'
+        | 'openbsd'
+        | 'sunos'
+        | 'win32'
+        | 'cygwin'
+        | 'netbsd';
+
+    type Signals =
+        "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
+        "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" |
+        "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" |
+        "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
+
+    type MultipleResolveType = 'resolve' | 'reject';
+
+    type BeforeExitListener = (code: number) => void;
+    type DisconnectListener = () => void;
+    type ExitListener = (code: number) => void;
+    type RejectionHandledListener = (promise: Promise<any>) => void;
+    type UncaughtExceptionListener = (error: Error) => void;
+    type UnhandledRejectionListener = (reason: {} | null | undefined, promise: Promise<any>) => void;
+    type WarningListener = (warning: Error) => void;
+    type MessageListener = (message: any, sendHandle: any) => void;
+    type SignalsListener = (signal: Signals) => void;
+    type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
+    type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void;
+    type MultipleResolveListener = (type: MultipleResolveType, promise: Promise<any>, value: any) => void;
+
+    interface Socket extends ReadWriteStream {
+        isTTY?: true;
+    }
+
+    // Alias for compatibility
+    interface ProcessEnv extends Dict<string> {}
+
+    interface HRTime {
+        (time?: [number, number]): [number, number];
+        bigint(): bigint;
+    }
+
+    interface ProcessReport {
+        /**
+         * Directory where the report is written.
+         * working directory of the Node.js process.
+         * @default '' indicating that reports are written to the current
+         */
+        directory: string;
+
+        /**
+         * Filename where the report is written.
+         * The default value is the empty string.
+         * @default '' the output filename will be comprised of a timestamp,
+         * PID, and sequence number.
+         */
+        filename: string;
+
+        /**
+         * Returns a JSON-formatted diagnostic report for the running process.
+         * The report's JavaScript stack trace is taken from err, if present.
+         */
+        getReport(err?: Error): string;
+
+        /**
+         * If true, a diagnostic report is generated on fatal errors,
+         * such as out of memory errors or failed C++ assertions.
+         * @default false
+         */
+        reportOnFatalError: boolean;
+
+        /**
+         * If true, a diagnostic report is generated when the process
+         * receives the signal specified by process.report.signal.
+         * @defaul false
+         */
+        reportOnSignal: boolean;
+
+        /**
+         * If true, a diagnostic report is generated on uncaught exception.
+         * @default false
+         */
+        reportOnUncaughtException: boolean;
+
+        /**
+         * The signal used to trigger the creation of a diagnostic report.
+         * @default 'SIGUSR2'
+         */
+        signal: Signals;
+
+        /**
+         * Writes a diagnostic report to a file. If filename is not provided, the default filename
+         * includes the date, time, PID, and a sequence number.
+         * The report's JavaScript stack trace is taken from err, if present.
+         *
+         * @param fileName Name of the file where the report is written.
+         * This should be a relative path, that will be appended to the directory specified in
+         * `process.report.directory`, or the current working directory of the Node.js process,
+         * if unspecified.
+         * @param error A custom error used for reporting the JavaScript stack.
+         * @return Filename of the generated report.
+         */
+        writeReport(fileName?: string): string;
+        writeReport(error?: Error): string;
+        writeReport(fileName?: string, err?: Error): string;
+    }
+
+    interface ResourceUsage {
+        fsRead: number;
+        fsWrite: number;
+        involuntaryContextSwitches: number;
+        ipcReceived: number;
+        ipcSent: number;
+        majorPageFault: number;
+        maxRSS: number;
+        minorPageFault: number;
+        sharedMemorySize: number;
+        signalsCount: number;
+        swappedOut: number;
+        systemCPUTime: number;
+        unsharedDataSize: number;
+        unsharedStackSize: number;
+        userCPUTime: number;
+        voluntaryContextSwitches: number;
+    }
+
+    interface Process extends EventEmitter {
+        /**
+         * Can also be a tty.WriteStream, not typed due to limitation.s
+         */
+        stdout: WriteStream;
+        /**
+         * Can also be a tty.WriteStream, not typed due to limitation.s
+         */
+        stderr: WriteStream;
+        stdin: ReadStream;
+        openStdin(): Socket;
+        argv: string[];
+        argv0: string;
+        execArgv: string[];
+        execPath: string;
+        abort(): never;
+        chdir(directory: string): void;
+        cwd(): string;
+        debugPort: number;
+        emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
+        env: ProcessEnv;
+        exit(code?: number): never;
+        exitCode?: number;
+        getgid(): number;
+        setgid(id: number | string): void;
+        getuid(): number;
+        setuid(id: number | string): void;
+        geteuid(): number;
+        seteuid(id: number | string): void;
+        getegid(): number;
+        setegid(id: number | string): void;
+        getgroups(): number[];
+        setgroups(groups: ReadonlyArray<string | number>): void;
+        setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
+        hasUncaughtExceptionCaptureCallback(): boolean;
+        version: string;
+        versions: ProcessVersions;
+        config: {
+            target_defaults: {
+                cflags: any[];
+                default_configuration: string;
+                defines: string[];
+                include_dirs: string[];
+                libraries: string[];
+            };
+            variables: {
+                clang: number;
+                host_arch: string;
+                node_install_npm: boolean;
+                node_install_waf: boolean;
+                node_prefix: string;
+                node_shared_openssl: boolean;
+                node_shared_v8: boolean;
+                node_shared_zlib: boolean;
+                node_use_dtrace: boolean;
+                node_use_etw: boolean;
+                node_use_openssl: boolean;
+                target_arch: string;
+                v8_no_strict_aliasing: number;
+                v8_use_snapshot: boolean;
+                visibility: string;
+            };
+        };
+        kill(pid: number, signal?: string | number): void;
+        pid: number;
+        ppid: number;
+        title: string;
+        arch: string;
+        platform: Platform;
+        mainModule?: Module;
+        memoryUsage(): MemoryUsage;
+        cpuUsage(previousValue?: CpuUsage): CpuUsage;
+        nextTick(callback: Function, ...args: any[]): void;
+        release: ProcessRelease;
+        features: {
+            inspector: boolean;
+            debug: boolean;
+            uv: boolean;
+            ipv6: boolean;
+            tls_alpn: boolean;
+            tls_sni: boolean;
+            tls_ocsp: boolean;
+            tls: boolean;
+        };
+        /**
+         * Can only be set if not in worker thread.
+         */
+        umask(mask?: string | number): number;
+        uptime(): number;
+        hrtime: HRTime;
+        domain: Domain;
+
+        // Worker
+        send?(message: any, sendHandle?: any, options?: { swallowErrors?: boolean}, callback?: (error: Error | null) => void): boolean;
+        disconnect(): void;
+        connected: boolean;
+
+        /**
+         * The `process.allowedNodeEnvironmentFlags` property is a special,
+         * read-only `Set` of flags allowable within the [`NODE_OPTIONS`][]
+         * environment variable.
+         */
+        allowedNodeEnvironmentFlags: ReadonlySet<string>;
+
+        /**
+         * Only available with `--experimental-report`
+         */
+        report?: ProcessReport;
+
+        resourceUsage(): ResourceUsage;
+
+        /* EventEmitter */
+        addListener(event: "beforeExit", listener: BeforeExitListener): this;
+        addListener(event: "disconnect", listener: DisconnectListener): this;
+        addListener(event: "exit", listener: ExitListener): this;
+        addListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+        addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+        addListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+        addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+        addListener(event: "warning", listener: WarningListener): this;
+        addListener(event: "message", listener: MessageListener): this;
+        addListener(event: Signals, listener: SignalsListener): this;
+        addListener(event: "newListener", listener: NewListenerListener): this;
+        addListener(event: "removeListener", listener: RemoveListenerListener): this;
+        addListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+
+        emit(event: "beforeExit", code: number): boolean;
+        emit(event: "disconnect"): boolean;
+        emit(event: "exit", code: number): boolean;
+        emit(event: "rejectionHandled", promise: Promise<any>): boolean;
+        emit(event: "uncaughtException", error: Error): boolean;
+        emit(event: "uncaughtExceptionMonitor", error: Error): boolean;
+        emit(event: "unhandledRejection", reason: any, promise: Promise<any>): boolean;
+        emit(event: "warning", warning: Error): boolean;
+        emit(event: "message", message: any, sendHandle: any): this;
+        emit(event: Signals, signal: Signals): boolean;
+        emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this;
+        emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this;
+        emit(event: "multipleResolves", listener: MultipleResolveListener): this;
+
+        on(event: "beforeExit", listener: BeforeExitListener): this;
+        on(event: "disconnect", listener: DisconnectListener): this;
+        on(event: "exit", listener: ExitListener): this;
+        on(event: "rejectionHandled", listener: RejectionHandledListener): this;
+        on(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+        on(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+        on(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+        on(event: "warning", listener: WarningListener): this;
+        on(event: "message", listener: MessageListener): this;
+        on(event: Signals, listener: SignalsListener): this;
+        on(event: "newListener", listener: NewListenerListener): this;
+        on(event: "removeListener", listener: RemoveListenerListener): this;
+        on(event: "multipleResolves", listener: MultipleResolveListener): this;
+
+        once(event: "beforeExit", listener: BeforeExitListener): this;
+        once(event: "disconnect", listener: DisconnectListener): this;
+        once(event: "exit", listener: ExitListener): this;
+        once(event: "rejectionHandled", listener: RejectionHandledListener): this;
+        once(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+        once(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+        once(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+        once(event: "warning", listener: WarningListener): this;
+        once(event: "message", listener: MessageListener): this;
+        once(event: Signals, listener: SignalsListener): this;
+        once(event: "newListener", listener: NewListenerListener): this;
+        once(event: "removeListener", listener: RemoveListenerListener): this;
+        once(event: "multipleResolves", listener: MultipleResolveListener): this;
+
+        prependListener(event: "beforeExit", listener: BeforeExitListener): this;
+        prependListener(event: "disconnect", listener: DisconnectListener): this;
+        prependListener(event: "exit", listener: ExitListener): this;
+        prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+        prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+        prependListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+        prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+        prependListener(event: "warning", listener: WarningListener): this;
+        prependListener(event: "message", listener: MessageListener): this;
+        prependListener(event: Signals, listener: SignalsListener): this;
+        prependListener(event: "newListener", listener: NewListenerListener): this;
+        prependListener(event: "removeListener", listener: RemoveListenerListener): this;
+        prependListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+
+        prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this;
+        prependOnceListener(event: "disconnect", listener: DisconnectListener): this;
+        prependOnceListener(event: "exit", listener: ExitListener): this;
+        prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this;
+        prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this;
+        prependOnceListener(event: "uncaughtExceptionMonitor", listener: UncaughtExceptionListener): this;
+        prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this;
+        prependOnceListener(event: "warning", listener: WarningListener): this;
+        prependOnceListener(event: "message", listener: MessageListener): this;
+        prependOnceListener(event: Signals, listener: SignalsListener): this;
+        prependOnceListener(event: "newListener", listener: NewListenerListener): this;
+        prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this;
+        prependOnceListener(event: "multipleResolves", listener: MultipleResolveListener): this;
+
+        listeners(event: "beforeExit"): BeforeExitListener[];
+        listeners(event: "disconnect"): DisconnectListener[];
+        listeners(event: "exit"): ExitListener[];
+        listeners(event: "rejectionHandled"): RejectionHandledListener[];
+        listeners(event: "uncaughtException"): UncaughtExceptionListener[];
+        listeners(event: "uncaughtExceptionMonitor"): UncaughtExceptionListener[];
+        listeners(event: "unhandledRejection"): UnhandledRejectionListener[];
+        listeners(event: "warning"): WarningListener[];
+        listeners(event: "message"): MessageListener[];
+        listeners(event: Signals): SignalsListener[];
+        listeners(event: "newListener"): NewListenerListener[];
+        listeners(event: "removeListener"): RemoveListenerListener[];
+        listeners(event: "multipleResolves"): MultipleResolveListener[];
+    }
+
+    interface Global {
+        Array: typeof Array;
+        ArrayBuffer: typeof ArrayBuffer;
+        Boolean: typeof Boolean;
+        Buffer: typeof Buffer;
+        DataView: typeof DataView;
+        Date: typeof Date;
+        Error: typeof Error;
+        EvalError: typeof EvalError;
+        Float32Array: typeof Float32Array;
+        Float64Array: typeof Float64Array;
+        Function: typeof Function;
+        GLOBAL: Global;
+        Infinity: typeof Infinity;
+        Int16Array: typeof Int16Array;
+        Int32Array: typeof Int32Array;
+        Int8Array: typeof Int8Array;
+        Intl: typeof Intl;
+        JSON: typeof JSON;
+        Map: MapConstructor;
+        Math: typeof Math;
+        NaN: typeof NaN;
+        Number: typeof Number;
+        Object: typeof Object;
+        Promise: typeof Promise;
+        RangeError: typeof RangeError;
+        ReferenceError: typeof ReferenceError;
+        RegExp: typeof RegExp;
+        Set: SetConstructor;
+        String: typeof String;
+        Symbol: Function;
+        SyntaxError: typeof SyntaxError;
+        TypeError: typeof TypeError;
+        URIError: typeof URIError;
+        Uint16Array: typeof Uint16Array;
+        Uint32Array: typeof Uint32Array;
+        Uint8Array: typeof Uint8Array;
+        Uint8ClampedArray: typeof Uint8ClampedArray;
+        WeakMap: WeakMapConstructor;
+        WeakSet: WeakSetConstructor;
+        clearImmediate: (immediateId: Immediate) => void;
+        clearInterval: (intervalId: Timeout) => void;
+        clearTimeout: (timeoutId: Timeout) => void;
+        console: typeof console;
+        decodeURI: typeof decodeURI;
+        decodeURIComponent: typeof decodeURIComponent;
+        encodeURI: typeof encodeURI;
+        encodeURIComponent: typeof encodeURIComponent;
+        escape: (str: string) => string;
+        eval: typeof eval;
+        global: Global;
+        isFinite: typeof isFinite;
+        isNaN: typeof isNaN;
+        parseFloat: typeof parseFloat;
+        parseInt: typeof parseInt;
+        process: Process;
+        /**
+         * @deprecated Use `global`.
+         */
+        root: Global;
+        setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
+        setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
+        setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
+        queueMicrotask: typeof queueMicrotask;
+        undefined: typeof undefined;
+        unescape: (str: string) => string;
+        gc: () => void;
+        v8debug?: any;
+    }
+
+    interface RefCounted {
+        ref(): this;
+        unref(): this;
+    }
+
+    // compatibility with older typings
+    interface Timer extends RefCounted {
+        hasRef(): boolean;
+        refresh(): this;
+    }
+
+    interface Immediate extends RefCounted {
+        hasRef(): boolean;
+        _onImmediate: Function; // to distinguish it from the Timeout class
+    }
+
+    interface Timeout extends Timer {
+        hasRef(): boolean;
+        refresh(): this;
+    }
+
+    type TypedArray =
+        | Uint8Array
+        | Uint8ClampedArray
+        | Uint16Array
+        | Uint32Array
+        | Int8Array
+        | Int16Array
+        | Int32Array
+        | BigUint64Array
+        | BigInt64Array
+        | Float32Array
+        | Float64Array;
+    type ArrayBufferView = TypedArray | DataView;
+
+    interface Require {
+        (id: string): any;
+        resolve: RequireResolve;
+        cache: Dict<NodeModule>;
+        /**
+         * @deprecated
+         */
+        extensions: RequireExtensions;
+        main: Module | undefined;
+    }
+
+    interface RequireResolve {
+        (id: string, options?: { paths?: string[]; }): string;
+        paths(request: string): string[] | null;
+    }
+
+    interface RequireExtensions extends Dict<(m: Module, filename: string) => any> {
+        '.js': (m: Module, filename: string) => any;
+        '.json': (m: Module, filename: string) => any;
+        '.node': (m: Module, filename: string) => any;
+    }
+    interface Module {
+        exports: any;
+        require: Require;
+        id: string;
+        filename: string;
+        loaded: boolean;
+        /**
+         * @since 11.14.0
+         *
+         * The directory name of the module. This is usually the same as the path.dirname() of the module.id.
+         */
+        path: string;
+        parent: Module | null;
+        children: Module[];
+        paths: string[];
+    }
+
+    interface Dict<T> {
+        [key: string]: T | undefined;
+    }
+
+    interface ReadOnlyDict<T> {
+        readonly [key: string]: T | undefined;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/globals.global.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/globals.global.d.ts
new file mode 100644 (file)
index 0000000..d66acba
--- /dev/null
@@ -0,0 +1 @@
+declare var global: NodeJS.Global & typeof globalThis;
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/http.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/http.d.ts
new file mode 100644 (file)
index 0000000..e326d7d
--- /dev/null
@@ -0,0 +1,403 @@
+declare module "http" {
+    import * as events from "events";
+    import * as stream from "stream";
+    import { URL } from "url";
+    import { Socket, Server as NetServer } from "net";
+
+    // incoming headers will never contain number
+    interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
+        'accept'?: string;
+        'accept-language'?: string;
+        'accept-patch'?: string;
+        'accept-ranges'?: string;
+        'access-control-allow-credentials'?: string;
+        'access-control-allow-headers'?: string;
+        'access-control-allow-methods'?: string;
+        'access-control-allow-origin'?: string;
+        'access-control-expose-headers'?: string;
+        'access-control-max-age'?: string;
+        'access-control-request-headers'?: string;
+        'access-control-request-method'?: string;
+        'age'?: string;
+        'allow'?: string;
+        'alt-svc'?: string;
+        'authorization'?: string;
+        'cache-control'?: string;
+        'connection'?: string;
+        'content-disposition'?: string;
+        'content-encoding'?: string;
+        'content-language'?: string;
+        'content-length'?: string;
+        'content-location'?: string;
+        'content-range'?: string;
+        'content-type'?: string;
+        'cookie'?: string;
+        'date'?: string;
+        'expect'?: string;
+        'expires'?: string;
+        'forwarded'?: string;
+        'from'?: string;
+        'host'?: string;
+        'if-match'?: string;
+        'if-modified-since'?: string;
+        'if-none-match'?: string;
+        'if-unmodified-since'?: string;
+        'last-modified'?: string;
+        'location'?: string;
+        'origin'?: string;
+        'pragma'?: string;
+        'proxy-authenticate'?: string;
+        'proxy-authorization'?: string;
+        'public-key-pins'?: string;
+        'range'?: string;
+        'referer'?: string;
+        'retry-after'?: string;
+        'set-cookie'?: string[];
+        'strict-transport-security'?: string;
+        'tk'?: string;
+        'trailer'?: string;
+        'transfer-encoding'?: string;
+        'upgrade'?: string;
+        'user-agent'?: string;
+        'vary'?: string;
+        'via'?: string;
+        'warning'?: string;
+        'www-authenticate'?: string;
+    }
+
+    // outgoing headers allows numbers (as they are converted internally to strings)
+    interface OutgoingHttpHeaders extends NodeJS.Dict<number | string | string[]> {
+    }
+
+    interface ClientRequestArgs {
+        protocol?: string | null;
+        host?: string | null;
+        hostname?: string | null;
+        family?: number;
+        port?: number | string | null;
+        defaultPort?: number | string;
+        localAddress?: string;
+        socketPath?: string;
+        /**
+         * @default 8192
+         */
+        maxHeaderSize?: number;
+        method?: string;
+        path?: string | null;
+        headers?: OutgoingHttpHeaders;
+        auth?: string | null;
+        agent?: Agent | boolean;
+        _defaultAgent?: Agent;
+        timeout?: number;
+        setHost?: boolean;
+        // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278
+        createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: Socket) => void) => Socket;
+    }
+
+    interface ServerOptions {
+        IncomingMessage?: typeof IncomingMessage;
+        ServerResponse?: typeof ServerResponse;
+        /**
+         * Optionally overrides the value of
+         * [`--max-http-header-size`][] for requests received by this server, i.e.
+         * the maximum length of request headers in bytes.
+         * @default 8192
+         */
+        maxHeaderSize?: number;
+        /**
+         * Use an insecure HTTP parser that accepts invalid HTTP headers when true.
+         * Using the insecure parser should be avoided.
+         * See --insecure-http-parser for more information.
+         * @default false
+         */
+        insecureHTTPParser?: boolean;
+    }
+
+    type RequestListener = (req: IncomingMessage, res: ServerResponse) => void;
+
+    interface HttpBase {
+        setTimeout(msecs?: number, callback?: () => void): this;
+        setTimeout(callback: () => void): this;
+        /**
+         * Limits maximum incoming headers count. If set to 0, no limit will be applied.
+         * @default 2000
+         * {@link https://nodejs.org/api/http.html#http_server_maxheaderscount}
+         */
+        maxHeadersCount: number | null;
+        timeout: number;
+        /**
+         * Limit the amount of time the parser will wait to receive the complete HTTP headers.
+         * @default 60000
+         * {@link https://nodejs.org/api/http.html#http_server_headerstimeout}
+         */
+        headersTimeout: number;
+        keepAliveTimeout: number;
+    }
+
+    interface Server extends HttpBase {}
+    class Server extends NetServer {
+        constructor(requestListener?: RequestListener);
+        constructor(options: ServerOptions, requestListener?: RequestListener);
+    }
+
+    // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js
+    class OutgoingMessage extends stream.Writable {
+        upgrading: boolean;
+        chunkedEncoding: boolean;
+        shouldKeepAlive: boolean;
+        useChunkedEncodingByDefault: boolean;
+        sendDate: boolean;
+        /**
+         * @deprecated Use `writableEnded` instead.
+         */
+        finished: boolean;
+        headersSent: boolean;
+        /**
+         * @deprecate Use `socket` instead.
+         */
+        connection: Socket;
+        socket: Socket;
+
+        constructor();
+
+        setTimeout(msecs: number, callback?: () => void): this;
+        setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
+        getHeader(name: string): number | string | string[] | undefined;
+        getHeaders(): OutgoingHttpHeaders;
+        getHeaderNames(): string[];
+        hasHeader(name: string): boolean;
+        removeHeader(name: string): void;
+        addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
+        flushHeaders(): void;
+    }
+
+    // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256
+    class ServerResponse extends OutgoingMessage {
+        statusCode: number;
+        statusMessage: string;
+
+        constructor(req: IncomingMessage);
+
+        assignSocket(socket: Socket): void;
+        detachSocket(socket: Socket): void;
+        // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
+        // no args in writeContinue callback
+        writeContinue(callback?: () => void): void;
+        writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
+        writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
+        writeProcessing(): void;
+    }
+
+    interface InformationEvent {
+        statusCode: number;
+        statusMessage: string;
+        httpVersion: string;
+        httpVersionMajor: number;
+        httpVersionMinor: number;
+        headers: IncomingHttpHeaders;
+        rawHeaders: string[];
+    }
+
+    // https://github.com/nodejs/node/blob/v13.14.0/lib/_http_client.js#L86
+    class ClientRequest extends OutgoingMessage {
+        /**
+         * @deprecate Use `socket` instead.
+         */
+        connection: Socket;
+        socket: Socket;
+        aborted: boolean;
+
+        constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
+
+        method: string;
+        path: string;
+        abort(): void;
+        onSocket(socket: Socket): void;
+        setTimeout(timeout: number, callback?: () => void): this;
+        setNoDelay(noDelay?: boolean): void;
+        setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
+
+        addListener(event: 'abort', listener: () => void): this;
+        addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        addListener(event: 'continue', listener: () => void): this;
+        addListener(event: 'information', listener: (info: InformationEvent) => void): this;
+        addListener(event: 'response', listener: (response: IncomingMessage) => void): this;
+        addListener(event: 'socket', listener: (socket: Socket) => void): this;
+        addListener(event: 'timeout', listener: () => void): this;
+        addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        addListener(event: 'close', listener: () => void): this;
+        addListener(event: 'drain', listener: () => void): this;
+        addListener(event: 'error', listener: (err: Error) => void): this;
+        addListener(event: 'finish', listener: () => void): this;
+        addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
+        addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        on(event: 'abort', listener: () => void): this;
+        on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        on(event: 'continue', listener: () => void): this;
+        on(event: 'information', listener: (info: InformationEvent) => void): this;
+        on(event: 'response', listener: (response: IncomingMessage) => void): this;
+        on(event: 'socket', listener: (socket: Socket) => void): this;
+        on(event: 'timeout', listener: () => void): this;
+        on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        on(event: 'close', listener: () => void): this;
+        on(event: 'drain', listener: () => void): this;
+        on(event: 'error', listener: (err: Error) => void): this;
+        on(event: 'finish', listener: () => void): this;
+        on(event: 'pipe', listener: (src: stream.Readable) => void): this;
+        on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: 'abort', listener: () => void): this;
+        once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        once(event: 'continue', listener: () => void): this;
+        once(event: 'information', listener: (info: InformationEvent) => void): this;
+        once(event: 'response', listener: (response: IncomingMessage) => void): this;
+        once(event: 'socket', listener: (socket: Socket) => void): this;
+        once(event: 'timeout', listener: () => void): this;
+        once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        once(event: 'close', listener: () => void): this;
+        once(event: 'drain', listener: () => void): this;
+        once(event: 'error', listener: (err: Error) => void): this;
+        once(event: 'finish', listener: () => void): this;
+        once(event: 'pipe', listener: (src: stream.Readable) => void): this;
+        once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: 'abort', listener: () => void): this;
+        prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        prependListener(event: 'continue', listener: () => void): this;
+        prependListener(event: 'information', listener: (info: InformationEvent) => void): this;
+        prependListener(event: 'response', listener: (response: IncomingMessage) => void): this;
+        prependListener(event: 'socket', listener: (socket: Socket) => void): this;
+        prependListener(event: 'timeout', listener: () => void): this;
+        prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        prependListener(event: 'close', listener: () => void): this;
+        prependListener(event: 'drain', listener: () => void): this;
+        prependListener(event: 'error', listener: (err: Error) => void): this;
+        prependListener(event: 'finish', listener: () => void): this;
+        prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
+        prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: 'abort', listener: () => void): this;
+        prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        prependOnceListener(event: 'continue', listener: () => void): this;
+        prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this;
+        prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this;
+        prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this;
+        prependOnceListener(event: 'timeout', listener: () => void): this;
+        prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
+        prependOnceListener(event: 'close', listener: () => void): this;
+        prependOnceListener(event: 'drain', listener: () => void): this;
+        prependOnceListener(event: 'error', listener: (err: Error) => void): this;
+        prependOnceListener(event: 'finish', listener: () => void): this;
+        prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    class IncomingMessage extends stream.Readable {
+        constructor(socket: Socket);
+
+        aborted: boolean;
+        httpVersion: string;
+        httpVersionMajor: number;
+        httpVersionMinor: number;
+        complete: boolean;
+        /**
+         * @deprecate Use `socket` instead.
+         */
+        connection: Socket;
+        socket: Socket;
+        headers: IncomingHttpHeaders;
+        rawHeaders: string[];
+        trailers: NodeJS.Dict<string>;
+        rawTrailers: string[];
+        setTimeout(msecs: number, callback?: () => void): this;
+        /**
+         * Only valid for request obtained from http.Server.
+         */
+        method?: string;
+        /**
+         * Only valid for request obtained from http.Server.
+         */
+        url?: string;
+        /**
+         * Only valid for response obtained from http.ClientRequest.
+         */
+        statusCode?: number;
+        /**
+         * Only valid for response obtained from http.ClientRequest.
+         */
+        statusMessage?: string;
+        destroy(error?: Error): void;
+    }
+
+    interface AgentOptions {
+        /**
+         * Keep sockets around in a pool to be used by other requests in the future. Default = false
+         */
+        keepAlive?: boolean;
+        /**
+         * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.
+         * Only relevant if keepAlive is set to true.
+         */
+        keepAliveMsecs?: number;
+        /**
+         * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
+         */
+        maxSockets?: number;
+        /**
+         * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
+         */
+        maxFreeSockets?: number;
+        /**
+         * Socket timeout in milliseconds. This will set the timeout after the socket is connected.
+         */
+        timeout?: number;
+    }
+
+    class Agent {
+        maxFreeSockets: number;
+        maxSockets: number;
+        readonly sockets: NodeJS.ReadOnlyDict<Socket[]>;
+        readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
+
+        constructor(opts?: AgentOptions);
+
+        /**
+         * Destroy any sockets that are currently in use by the agent.
+         * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,
+         * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,
+         * sockets may hang open for quite a long time before the server terminates them.
+         */
+        destroy(): void;
+    }
+
+    const METHODS: string[];
+
+    const STATUS_CODES: {
+        [errorCode: number]: string | undefined;
+        [errorCode: string]: string | undefined;
+    };
+
+    function createServer(requestListener?: RequestListener): Server;
+    function createServer(options: ServerOptions, requestListener?: RequestListener): Server;
+
+    // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly,
+    // create interface RequestOptions would make the naming more clear to developers
+    interface RequestOptions extends ClientRequestArgs { }
+    function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
+    function request(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
+    function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest;
+    function get(url: string | URL, options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;
+    let globalAgent: Agent;
+
+    /**
+     * Read-only property specifying the maximum allowed size of HTTP headers in bytes.
+     * Defaults to 16KB. Configurable using the [`--max-http-header-size`][] CLI option.
+     */
+    const maxHeaderSize: number;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/http2.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/http2.d.ts
new file mode 100644 (file)
index 0000000..2ac1c31
--- /dev/null
@@ -0,0 +1,948 @@
+declare module "http2" {
+    import * as events from "events";
+    import * as fs from "fs";
+    import * as net from "net";
+    import * as stream from "stream";
+    import * as tls from "tls";
+    import * as url from "url";
+
+    import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from "http";
+    export { OutgoingHttpHeaders } from "http";
+
+    export interface IncomingHttpStatusHeader {
+        ":status"?: number;
+    }
+
+    export interface IncomingHttpHeaders extends Http1IncomingHttpHeaders {
+        ":path"?: string;
+        ":method"?: string;
+        ":authority"?: string;
+        ":scheme"?: string;
+    }
+
+    // Http2Stream
+
+    export interface StreamPriorityOptions {
+        exclusive?: boolean;
+        parent?: number;
+        weight?: number;
+        silent?: boolean;
+    }
+
+    export interface StreamState {
+        localWindowSize?: number;
+        state?: number;
+        localClose?: number;
+        remoteClose?: number;
+        sumDependencyWeight?: number;
+        weight?: number;
+    }
+
+    export interface ServerStreamResponseOptions {
+        endStream?: boolean;
+        waitForTrailers?: boolean;
+    }
+
+    export interface StatOptions {
+        offset: number;
+        length: number;
+    }
+
+    export interface ServerStreamFileResponseOptions {
+        statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
+        waitForTrailers?: boolean;
+        offset?: number;
+        length?: number;
+    }
+
+    export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
+        onError?(err: NodeJS.ErrnoException): void;
+    }
+
+    export interface Http2Stream extends stream.Duplex {
+        readonly aborted: boolean;
+        readonly bufferSize: number;
+        readonly closed: boolean;
+        readonly destroyed: boolean;
+        /**
+         * Set the true if the END_STREAM flag was set in the request or response HEADERS frame received,
+         * indicating that no additional data should be received and the readable side of the Http2Stream will be closed.
+         */
+        readonly endAfterHeaders: boolean;
+        readonly id?: number;
+        readonly pending: boolean;
+        readonly rstCode: number;
+        readonly sentHeaders: OutgoingHttpHeaders;
+        readonly sentInfoHeaders?: OutgoingHttpHeaders[];
+        readonly sentTrailers?: OutgoingHttpHeaders;
+        readonly session: Http2Session;
+        readonly state: StreamState;
+
+        close(code?: number, callback?: () => void): void;
+        priority(options: StreamPriorityOptions): void;
+        setTimeout(msecs: number, callback?: () => void): void;
+        sendTrailers(headers: OutgoingHttpHeaders): void;
+
+        addListener(event: "aborted", listener: () => void): this;
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        addListener(event: "drain", listener: () => void): this;
+        addListener(event: "end", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "finish", listener: () => void): this;
+        addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+        addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        addListener(event: "streamClosed", listener: (code: number) => void): this;
+        addListener(event: "timeout", listener: () => void): this;
+        addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+        addListener(event: "wantTrailers", listener: () => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "aborted"): boolean;
+        emit(event: "close"): boolean;
+        emit(event: "data", chunk: Buffer | string): boolean;
+        emit(event: "drain"): boolean;
+        emit(event: "end"): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: "finish"): boolean;
+        emit(event: "frameError", frameType: number, errorCode: number): boolean;
+        emit(event: "pipe", src: stream.Readable): boolean;
+        emit(event: "unpipe", src: stream.Readable): boolean;
+        emit(event: "streamClosed", code: number): boolean;
+        emit(event: "timeout"): boolean;
+        emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean;
+        emit(event: "wantTrailers"): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "aborted", listener: () => void): this;
+        on(event: "close", listener: () => void): this;
+        on(event: "data", listener: (chunk: Buffer | string) => void): this;
+        on(event: "drain", listener: () => void): this;
+        on(event: "end", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "finish", listener: () => void): this;
+        on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+        on(event: "pipe", listener: (src: stream.Readable) => void): this;
+        on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        on(event: "streamClosed", listener: (code: number) => void): this;
+        on(event: "timeout", listener: () => void): this;
+        on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+        on(event: "wantTrailers", listener: () => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "aborted", listener: () => void): this;
+        once(event: "close", listener: () => void): this;
+        once(event: "data", listener: (chunk: Buffer | string) => void): this;
+        once(event: "drain", listener: () => void): this;
+        once(event: "end", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "finish", listener: () => void): this;
+        once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+        once(event: "pipe", listener: (src: stream.Readable) => void): this;
+        once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        once(event: "streamClosed", listener: (code: number) => void): this;
+        once(event: "timeout", listener: () => void): this;
+        once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+        once(event: "wantTrailers", listener: () => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "aborted", listener: () => void): this;
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        prependListener(event: "drain", listener: () => void): this;
+        prependListener(event: "end", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "finish", listener: () => void): this;
+        prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+        prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        prependListener(event: "streamClosed", listener: (code: number) => void): this;
+        prependListener(event: "timeout", listener: () => void): this;
+        prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+        prependListener(event: "wantTrailers", listener: () => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "aborted", listener: () => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        prependOnceListener(event: "drain", listener: () => void): this;
+        prependOnceListener(event: "end", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "finish", listener: () => void): this;
+        prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this;
+        prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: "streamClosed", listener: (code: number) => void): this;
+        prependOnceListener(event: "timeout", listener: () => void): this;
+        prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this;
+        prependOnceListener(event: "wantTrailers", listener: () => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    export interface ClientHttp2Stream extends Http2Stream {
+        addListener(event: "continue", listener: () => {}): this;
+        addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+        addListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "continue"): boolean;
+        emit(event: "headers", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+        emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean;
+        emit(event: "response", headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "continue", listener: () => {}): this;
+        on(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+        on(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "continue", listener: () => {}): this;
+        once(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+        once(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "continue", listener: () => {}): this;
+        prependListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "continue", listener: () => {}): this;
+        prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    export interface ServerHttp2Stream extends Http2Stream {
+        readonly headersSent: boolean;
+        readonly pushAllowed: boolean;
+        additionalHeaders(headers: OutgoingHttpHeaders): void;
+        pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
+        pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
+        respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
+        respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
+        respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
+    }
+
+    // Http2Session
+
+    export interface Settings {
+        headerTableSize?: number;
+        enablePush?: boolean;
+        initialWindowSize?: number;
+        maxFrameSize?: number;
+        maxConcurrentStreams?: number;
+        maxHeaderListSize?: number;
+        enableConnectProtocol?: boolean;
+    }
+
+    export interface ClientSessionRequestOptions {
+        endStream?: boolean;
+        exclusive?: boolean;
+        parent?: number;
+        weight?: number;
+        waitForTrailers?: boolean;
+    }
+
+    export interface SessionState {
+        effectiveLocalWindowSize?: number;
+        effectiveRecvDataLength?: number;
+        nextStreamID?: number;
+        localWindowSize?: number;
+        lastProcStreamID?: number;
+        remoteWindowSize?: number;
+        outboundQueueSize?: number;
+        deflateDynamicTableSize?: number;
+        inflateDynamicTableSize?: number;
+    }
+
+    export interface Http2Session extends events.EventEmitter {
+        readonly alpnProtocol?: string;
+        readonly closed: boolean;
+        readonly connecting: boolean;
+        readonly destroyed: boolean;
+        readonly encrypted?: boolean;
+        readonly localSettings: Settings;
+        readonly originSet?: string[];
+        readonly pendingSettingsAck: boolean;
+        readonly remoteSettings: Settings;
+        readonly socket: net.Socket | tls.TLSSocket;
+        readonly state: SessionState;
+        readonly type: number;
+
+        close(callback?: () => void): void;
+        destroy(error?: Error, code?: number): void;
+        goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
+        ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
+        ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
+        ref(): void;
+        setTimeout(msecs: number, callback?: () => void): void;
+        settings(settings: Settings): void;
+        unref(): void;
+
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+        addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
+        addListener(event: "localSettings", listener: (settings: Settings) => void): this;
+        addListener(event: "ping", listener: () => void): this;
+        addListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+        addListener(event: "timeout", listener: () => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "close"): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean;
+        emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean;
+        emit(event: "localSettings", settings: Settings): boolean;
+        emit(event: "ping"): boolean;
+        emit(event: "remoteSettings", settings: Settings): boolean;
+        emit(event: "timeout"): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "close", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+        on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
+        on(event: "localSettings", listener: (settings: Settings) => void): this;
+        on(event: "ping", listener: () => void): this;
+        on(event: "remoteSettings", listener: (settings: Settings) => void): this;
+        on(event: "timeout", listener: () => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "close", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+        once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
+        once(event: "localSettings", listener: (settings: Settings) => void): this;
+        once(event: "ping", listener: () => void): this;
+        once(event: "remoteSettings", listener: (settings: Settings) => void): this;
+        once(event: "timeout", listener: () => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+        prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
+        prependListener(event: "localSettings", listener: (settings: Settings) => void): this;
+        prependListener(event: "ping", listener: () => void): this;
+        prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+        prependListener(event: "timeout", listener: () => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this;
+        prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this;
+        prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this;
+        prependOnceListener(event: "ping", listener: () => void): this;
+        prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this;
+        prependOnceListener(event: "timeout", listener: () => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    export interface ClientHttp2Session extends Http2Session {
+        request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
+
+        addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+        addListener(event: "origin", listener: (origins: string[]) => void): this;
+        addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
+        emit(event: "origin", origins: ReadonlyArray<string>): boolean;
+        emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
+        emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+        on(event: "origin", listener: (origins: string[]) => void): this;
+        on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+        once(event: "origin", listener: (origins: string[]) => void): this;
+        once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+        prependListener(event: "origin", listener: (origins: string[]) => void): this;
+        prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
+        prependOnceListener(event: "origin", listener: (origins: string[]) => void): this;
+        prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    export interface AlternativeServiceOptions {
+        origin: number | string | url.URL;
+    }
+
+    export interface ServerHttp2Session extends Http2Session {
+        readonly server: Http2Server | Http2SecureServer;
+
+        altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
+        origin(...args: Array<string | url.URL | { origin: string }>): void;
+
+        addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
+        emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
+        prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    // Http2Server
+
+    export interface SessionOptions {
+        maxDeflateDynamicTableSize?: number;
+        maxSessionMemory?: number;
+        maxHeaderListPairs?: number;
+        maxOutstandingPings?: number;
+        maxSendHeaderBlockLength?: number;
+        paddingStrategy?: number;
+        peerMaxConcurrentStreams?: number;
+        settings?: Settings;
+
+        selectPadding?(frameLen: number, maxFrameLen: number): number;
+        createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
+    }
+
+    export interface ClientSessionOptions extends SessionOptions {
+        maxReservedRemoteStreams?: number;
+        createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
+        protocol?: 'http:' | 'https:';
+    }
+
+    export interface ServerSessionOptions extends SessionOptions {
+        Http1IncomingMessage?: typeof IncomingMessage;
+        Http1ServerResponse?: typeof ServerResponse;
+        Http2ServerRequest?: typeof Http2ServerRequest;
+        Http2ServerResponse?: typeof Http2ServerResponse;
+    }
+
+    export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { }
+    export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { }
+
+    export interface ServerOptions extends ServerSessionOptions { }
+
+    export interface SecureServerOptions extends SecureServerSessionOptions {
+        allowHTTP1?: boolean;
+        origins?: string[];
+    }
+
+    export interface Http2Server extends net.Server {
+        addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        addListener(event: "sessionError", listener: (err: Error) => void): this;
+        addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        addListener(event: "timeout", listener: () => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+        emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+        emit(event: "session", session: ServerHttp2Session): boolean;
+        emit(event: "sessionError", err: Error): boolean;
+        emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+        emit(event: "timeout"): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        on(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        on(event: "sessionError", listener: (err: Error) => void): this;
+        on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        on(event: "timeout", listener: () => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        once(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        once(event: "sessionError", listener: (err: Error) => void): this;
+        once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        once(event: "timeout", listener: () => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        prependListener(event: "sessionError", listener: (err: Error) => void): this;
+        prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependListener(event: "timeout", listener: () => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
+        prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependOnceListener(event: "timeout", listener: () => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        setTimeout(msec?: number, callback?: () => void): this;
+    }
+
+    export interface Http2SecureServer extends tls.Server {
+        addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        addListener(event: "sessionError", listener: (err: Error) => void): this;
+        addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        addListener(event: "timeout", listener: () => void): this;
+        addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+        emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean;
+        emit(event: "session", session: ServerHttp2Session): boolean;
+        emit(event: "sessionError", err: Error): boolean;
+        emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean;
+        emit(event: "timeout"): boolean;
+        emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        on(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        on(event: "sessionError", listener: (err: Error) => void): this;
+        on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        on(event: "timeout", listener: () => void): this;
+        on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        once(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        once(event: "sessionError", listener: (err: Error) => void): this;
+        once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        once(event: "timeout", listener: () => void): this;
+        once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        prependListener(event: "sessionError", listener: (err: Error) => void): this;
+        prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependListener(event: "timeout", listener: () => void): this;
+        prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
+        prependOnceListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
+        prependOnceListener(event: "sessionError", listener: (err: Error) => void): this;
+        prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
+        prependOnceListener(event: "timeout", listener: () => void): this;
+        prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        setTimeout(msec?: number, callback?: () => void): this;
+    }
+
+    export class Http2ServerRequest extends stream.Readable {
+        constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray<string>);
+
+        readonly aborted: boolean;
+        readonly authority: string;
+        readonly headers: IncomingHttpHeaders;
+        readonly httpVersion: string;
+        readonly method: string;
+        readonly rawHeaders: string[];
+        readonly rawTrailers: string[];
+        readonly scheme: string;
+        readonly socket: net.Socket | tls.TLSSocket;
+        readonly stream: ServerHttp2Stream;
+        readonly trailers: IncomingHttpHeaders;
+        readonly url: string;
+
+        setTimeout(msecs: number, callback?: () => void): void;
+        read(size?: number): Buffer | string | null;
+
+        addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        addListener(event: "end", listener: () => void): this;
+        addListener(event: "readable", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "aborted", hadError: boolean, code: number): boolean;
+        emit(event: "close"): boolean;
+        emit(event: "data", chunk: Buffer | string): boolean;
+        emit(event: "end"): boolean;
+        emit(event: "readable"): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+        on(event: "close", listener: () => void): this;
+        on(event: "data", listener: (chunk: Buffer | string) => void): this;
+        on(event: "end", listener: () => void): this;
+        on(event: "readable", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+        once(event: "close", listener: () => void): this;
+        once(event: "data", listener: (chunk: Buffer | string) => void): this;
+        once(event: "end", listener: () => void): this;
+        once(event: "readable", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        prependListener(event: "end", listener: () => void): this;
+        prependListener(event: "readable", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
+        prependOnceListener(event: "end", listener: () => void): this;
+        prependOnceListener(event: "readable", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    export class Http2ServerResponse extends stream.Stream {
+        constructor(stream: ServerHttp2Stream);
+
+        readonly connection: net.Socket | tls.TLSSocket;
+        readonly finished: boolean;
+        readonly headersSent: boolean;
+        readonly socket: net.Socket | tls.TLSSocket;
+        readonly stream: ServerHttp2Stream;
+        sendDate: boolean;
+        statusCode: number;
+        statusMessage: '';
+        addTrailers(trailers: OutgoingHttpHeaders): void;
+        end(callback?: () => void): void;
+        end(data: string | Uint8Array, callback?: () => void): void;
+        end(data: string | Uint8Array, encoding: string, callback?: () => void): void;
+        getHeader(name: string): string;
+        getHeaderNames(): string[];
+        getHeaders(): OutgoingHttpHeaders;
+        hasHeader(name: string): boolean;
+        removeHeader(name: string): void;
+        setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
+        setTimeout(msecs: number, callback?: () => void): void;
+        write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
+        write(chunk: string | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean;
+        writeContinue(): void;
+        writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
+        writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this;
+        createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void;
+
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "drain", listener: () => void): this;
+        addListener(event: "error", listener: (error: Error) => void): this;
+        addListener(event: "finish", listener: () => void): this;
+        addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "close"): boolean;
+        emit(event: "drain"): boolean;
+        emit(event: "error", error: Error): boolean;
+        emit(event: "finish"): boolean;
+        emit(event: "pipe", src: stream.Readable): boolean;
+        emit(event: "unpipe", src: stream.Readable): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "close", listener: () => void): this;
+        on(event: "drain", listener: () => void): this;
+        on(event: "error", listener: (error: Error) => void): this;
+        on(event: "finish", listener: () => void): this;
+        on(event: "pipe", listener: (src: stream.Readable) => void): this;
+        on(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "close", listener: () => void): this;
+        once(event: "drain", listener: () => void): this;
+        once(event: "error", listener: (error: Error) => void): this;
+        once(event: "finish", listener: () => void): this;
+        once(event: "pipe", listener: (src: stream.Readable) => void): this;
+        once(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "drain", listener: () => void): this;
+        prependListener(event: "error", listener: (error: Error) => void): this;
+        prependListener(event: "finish", listener: () => void): this;
+        prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "drain", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (error: Error) => void): this;
+        prependOnceListener(event: "finish", listener: () => void): this;
+        prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    // Public API
+
+    export namespace constants {
+        const NGHTTP2_SESSION_SERVER: number;
+        const NGHTTP2_SESSION_CLIENT: number;
+        const NGHTTP2_STREAM_STATE_IDLE: number;
+        const NGHTTP2_STREAM_STATE_OPEN: number;
+        const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number;
+        const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number;
+        const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number;
+        const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number;
+        const NGHTTP2_STREAM_STATE_CLOSED: number;
+        const NGHTTP2_NO_ERROR: number;
+        const NGHTTP2_PROTOCOL_ERROR: number;
+        const NGHTTP2_INTERNAL_ERROR: number;
+        const NGHTTP2_FLOW_CONTROL_ERROR: number;
+        const NGHTTP2_SETTINGS_TIMEOUT: number;
+        const NGHTTP2_STREAM_CLOSED: number;
+        const NGHTTP2_FRAME_SIZE_ERROR: number;
+        const NGHTTP2_REFUSED_STREAM: number;
+        const NGHTTP2_CANCEL: number;
+        const NGHTTP2_COMPRESSION_ERROR: number;
+        const NGHTTP2_CONNECT_ERROR: number;
+        const NGHTTP2_ENHANCE_YOUR_CALM: number;
+        const NGHTTP2_INADEQUATE_SECURITY: number;
+        const NGHTTP2_HTTP_1_1_REQUIRED: number;
+        const NGHTTP2_ERR_FRAME_SIZE_ERROR: number;
+        const NGHTTP2_FLAG_NONE: number;
+        const NGHTTP2_FLAG_END_STREAM: number;
+        const NGHTTP2_FLAG_END_HEADERS: number;
+        const NGHTTP2_FLAG_ACK: number;
+        const NGHTTP2_FLAG_PADDED: number;
+        const NGHTTP2_FLAG_PRIORITY: number;
+        const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number;
+        const DEFAULT_SETTINGS_ENABLE_PUSH: number;
+        const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number;
+        const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number;
+        const MAX_MAX_FRAME_SIZE: number;
+        const MIN_MAX_FRAME_SIZE: number;
+        const MAX_INITIAL_WINDOW_SIZE: number;
+        const NGHTTP2_DEFAULT_WEIGHT: number;
+        const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number;
+        const NGHTTP2_SETTINGS_ENABLE_PUSH: number;
+        const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number;
+        const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number;
+        const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number;
+        const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number;
+        const PADDING_STRATEGY_NONE: number;
+        const PADDING_STRATEGY_MAX: number;
+        const PADDING_STRATEGY_CALLBACK: number;
+        const HTTP2_HEADER_STATUS: string;
+        const HTTP2_HEADER_METHOD: string;
+        const HTTP2_HEADER_AUTHORITY: string;
+        const HTTP2_HEADER_SCHEME: string;
+        const HTTP2_HEADER_PATH: string;
+        const HTTP2_HEADER_ACCEPT_CHARSET: string;
+        const HTTP2_HEADER_ACCEPT_ENCODING: string;
+        const HTTP2_HEADER_ACCEPT_LANGUAGE: string;
+        const HTTP2_HEADER_ACCEPT_RANGES: string;
+        const HTTP2_HEADER_ACCEPT: string;
+        const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string;
+        const HTTP2_HEADER_AGE: string;
+        const HTTP2_HEADER_ALLOW: string;
+        const HTTP2_HEADER_AUTHORIZATION: string;
+        const HTTP2_HEADER_CACHE_CONTROL: string;
+        const HTTP2_HEADER_CONNECTION: string;
+        const HTTP2_HEADER_CONTENT_DISPOSITION: string;
+        const HTTP2_HEADER_CONTENT_ENCODING: string;
+        const HTTP2_HEADER_CONTENT_LANGUAGE: string;
+        const HTTP2_HEADER_CONTENT_LENGTH: string;
+        const HTTP2_HEADER_CONTENT_LOCATION: string;
+        const HTTP2_HEADER_CONTENT_MD5: string;
+        const HTTP2_HEADER_CONTENT_RANGE: string;
+        const HTTP2_HEADER_CONTENT_TYPE: string;
+        const HTTP2_HEADER_COOKIE: string;
+        const HTTP2_HEADER_DATE: string;
+        const HTTP2_HEADER_ETAG: string;
+        const HTTP2_HEADER_EXPECT: string;
+        const HTTP2_HEADER_EXPIRES: string;
+        const HTTP2_HEADER_FROM: string;
+        const HTTP2_HEADER_HOST: string;
+        const HTTP2_HEADER_IF_MATCH: string;
+        const HTTP2_HEADER_IF_MODIFIED_SINCE: string;
+        const HTTP2_HEADER_IF_NONE_MATCH: string;
+        const HTTP2_HEADER_IF_RANGE: string;
+        const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string;
+        const HTTP2_HEADER_LAST_MODIFIED: string;
+        const HTTP2_HEADER_LINK: string;
+        const HTTP2_HEADER_LOCATION: string;
+        const HTTP2_HEADER_MAX_FORWARDS: string;
+        const HTTP2_HEADER_PREFER: string;
+        const HTTP2_HEADER_PROXY_AUTHENTICATE: string;
+        const HTTP2_HEADER_PROXY_AUTHORIZATION: string;
+        const HTTP2_HEADER_RANGE: string;
+        const HTTP2_HEADER_REFERER: string;
+        const HTTP2_HEADER_REFRESH: string;
+        const HTTP2_HEADER_RETRY_AFTER: string;
+        const HTTP2_HEADER_SERVER: string;
+        const HTTP2_HEADER_SET_COOKIE: string;
+        const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string;
+        const HTTP2_HEADER_TRANSFER_ENCODING: string;
+        const HTTP2_HEADER_TE: string;
+        const HTTP2_HEADER_UPGRADE: string;
+        const HTTP2_HEADER_USER_AGENT: string;
+        const HTTP2_HEADER_VARY: string;
+        const HTTP2_HEADER_VIA: string;
+        const HTTP2_HEADER_WWW_AUTHENTICATE: string;
+        const HTTP2_HEADER_HTTP2_SETTINGS: string;
+        const HTTP2_HEADER_KEEP_ALIVE: string;
+        const HTTP2_HEADER_PROXY_CONNECTION: string;
+        const HTTP2_METHOD_ACL: string;
+        const HTTP2_METHOD_BASELINE_CONTROL: string;
+        const HTTP2_METHOD_BIND: string;
+        const HTTP2_METHOD_CHECKIN: string;
+        const HTTP2_METHOD_CHECKOUT: string;
+        const HTTP2_METHOD_CONNECT: string;
+        const HTTP2_METHOD_COPY: string;
+        const HTTP2_METHOD_DELETE: string;
+        const HTTP2_METHOD_GET: string;
+        const HTTP2_METHOD_HEAD: string;
+        const HTTP2_METHOD_LABEL: string;
+        const HTTP2_METHOD_LINK: string;
+        const HTTP2_METHOD_LOCK: string;
+        const HTTP2_METHOD_MERGE: string;
+        const HTTP2_METHOD_MKACTIVITY: string;
+        const HTTP2_METHOD_MKCALENDAR: string;
+        const HTTP2_METHOD_MKCOL: string;
+        const HTTP2_METHOD_MKREDIRECTREF: string;
+        const HTTP2_METHOD_MKWORKSPACE: string;
+        const HTTP2_METHOD_MOVE: string;
+        const HTTP2_METHOD_OPTIONS: string;
+        const HTTP2_METHOD_ORDERPATCH: string;
+        const HTTP2_METHOD_PATCH: string;
+        const HTTP2_METHOD_POST: string;
+        const HTTP2_METHOD_PRI: string;
+        const HTTP2_METHOD_PROPFIND: string;
+        const HTTP2_METHOD_PROPPATCH: string;
+        const HTTP2_METHOD_PUT: string;
+        const HTTP2_METHOD_REBIND: string;
+        const HTTP2_METHOD_REPORT: string;
+        const HTTP2_METHOD_SEARCH: string;
+        const HTTP2_METHOD_TRACE: string;
+        const HTTP2_METHOD_UNBIND: string;
+        const HTTP2_METHOD_UNCHECKOUT: string;
+        const HTTP2_METHOD_UNLINK: string;
+        const HTTP2_METHOD_UNLOCK: string;
+        const HTTP2_METHOD_UPDATE: string;
+        const HTTP2_METHOD_UPDATEREDIRECTREF: string;
+        const HTTP2_METHOD_VERSION_CONTROL: string;
+        const HTTP_STATUS_CONTINUE: number;
+        const HTTP_STATUS_SWITCHING_PROTOCOLS: number;
+        const HTTP_STATUS_PROCESSING: number;
+        const HTTP_STATUS_OK: number;
+        const HTTP_STATUS_CREATED: number;
+        const HTTP_STATUS_ACCEPTED: number;
+        const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number;
+        const HTTP_STATUS_NO_CONTENT: number;
+        const HTTP_STATUS_RESET_CONTENT: number;
+        const HTTP_STATUS_PARTIAL_CONTENT: number;
+        const HTTP_STATUS_MULTI_STATUS: number;
+        const HTTP_STATUS_ALREADY_REPORTED: number;
+        const HTTP_STATUS_IM_USED: number;
+        const HTTP_STATUS_MULTIPLE_CHOICES: number;
+        const HTTP_STATUS_MOVED_PERMANENTLY: number;
+        const HTTP_STATUS_FOUND: number;
+        const HTTP_STATUS_SEE_OTHER: number;
+        const HTTP_STATUS_NOT_MODIFIED: number;
+        const HTTP_STATUS_USE_PROXY: number;
+        const HTTP_STATUS_TEMPORARY_REDIRECT: number;
+        const HTTP_STATUS_PERMANENT_REDIRECT: number;
+        const HTTP_STATUS_BAD_REQUEST: number;
+        const HTTP_STATUS_UNAUTHORIZED: number;
+        const HTTP_STATUS_PAYMENT_REQUIRED: number;
+        const HTTP_STATUS_FORBIDDEN: number;
+        const HTTP_STATUS_NOT_FOUND: number;
+        const HTTP_STATUS_METHOD_NOT_ALLOWED: number;
+        const HTTP_STATUS_NOT_ACCEPTABLE: number;
+        const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number;
+        const HTTP_STATUS_REQUEST_TIMEOUT: number;
+        const HTTP_STATUS_CONFLICT: number;
+        const HTTP_STATUS_GONE: number;
+        const HTTP_STATUS_LENGTH_REQUIRED: number;
+        const HTTP_STATUS_PRECONDITION_FAILED: number;
+        const HTTP_STATUS_PAYLOAD_TOO_LARGE: number;
+        const HTTP_STATUS_URI_TOO_LONG: number;
+        const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number;
+        const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number;
+        const HTTP_STATUS_EXPECTATION_FAILED: number;
+        const HTTP_STATUS_TEAPOT: number;
+        const HTTP_STATUS_MISDIRECTED_REQUEST: number;
+        const HTTP_STATUS_UNPROCESSABLE_ENTITY: number;
+        const HTTP_STATUS_LOCKED: number;
+        const HTTP_STATUS_FAILED_DEPENDENCY: number;
+        const HTTP_STATUS_UNORDERED_COLLECTION: number;
+        const HTTP_STATUS_UPGRADE_REQUIRED: number;
+        const HTTP_STATUS_PRECONDITION_REQUIRED: number;
+        const HTTP_STATUS_TOO_MANY_REQUESTS: number;
+        const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number;
+        const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number;
+        const HTTP_STATUS_INTERNAL_SERVER_ERROR: number;
+        const HTTP_STATUS_NOT_IMPLEMENTED: number;
+        const HTTP_STATUS_BAD_GATEWAY: number;
+        const HTTP_STATUS_SERVICE_UNAVAILABLE: number;
+        const HTTP_STATUS_GATEWAY_TIMEOUT: number;
+        const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number;
+        const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number;
+        const HTTP_STATUS_INSUFFICIENT_STORAGE: number;
+        const HTTP_STATUS_LOOP_DETECTED: number;
+        const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number;
+        const HTTP_STATUS_NOT_EXTENDED: number;
+        const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number;
+    }
+
+    export function getDefaultSettings(): Settings;
+    export function getPackedSettings(settings: Settings): Buffer;
+    export function getUnpackedSettings(buf: Uint8Array): Settings;
+
+    export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
+    export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
+
+    export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
+    export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
+
+    export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
+    export function connect(
+        authority: string | url.URL,
+        options?: ClientSessionOptions | SecureClientSessionOptions,
+        listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void
+    ): ClientHttp2Session;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/https.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/https.d.ts
new file mode 100644 (file)
index 0000000..24326c9
--- /dev/null
@@ -0,0 +1,37 @@
+declare module "https" {
+    import * as tls from "tls";
+    import * as events from "events";
+    import * as http from "http";
+    import { URL } from "url";
+
+    type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
+
+    type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
+        rejectUnauthorized?: boolean; // Defaults to true
+        servername?: string; // SNI TLS Extension
+    };
+
+    interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
+        rejectUnauthorized?: boolean;
+        maxCachedSessions?: number;
+    }
+
+    class Agent extends http.Agent {
+        constructor(options?: AgentOptions);
+        options: AgentOptions;
+    }
+
+    interface Server extends http.HttpBase {}
+    class Server extends tls.Server {
+        constructor(requestListener?: http.RequestListener);
+        constructor(options: ServerOptions, requestListener?: http.RequestListener);
+    }
+
+    function createServer(requestListener?: http.RequestListener): Server;
+    function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
+    function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
+    function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
+    function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
+    function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
+    let globalAgent: Agent;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/index.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/index.d.ts
new file mode 100644 (file)
index 0000000..5b09a1d
--- /dev/null
@@ -0,0 +1,52 @@
+// Type definitions for non-npm package Node.js 13.13
+// Project: http://nodejs.org/
+// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
+//                 DefinitelyTyped <https://github.com/DefinitelyTyped>
+//                 Alberto Schiabel <https://github.com/jkomyno>
+//                 Alexander T. <https://github.com/a-tarasyuk>
+//                 Alvis HT Tang <https://github.com/alvis>
+//                 Andrew Makarov <https://github.com/r3nya>
+//                 Benjamin Toueg <https://github.com/btoueg>
+//                 Bruno Scheufler <https://github.com/brunoscheufler>
+//                 Chigozirim C. <https://github.com/smac89>
+//                 Christian Vaagland Tellnes <https://github.com/tellnes>
+//                 David Junger <https://github.com/touffy>
+//                 Deividas Bakanas <https://github.com/DeividasBakanas>
+//                 Eugene Y. Q. Shen <https://github.com/eyqs>
+//                 Flarna <https://github.com/Flarna>
+//                 Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
+//                 Hoàng Văn Khải <https://github.com/KSXGitHub>
+//                 Huw <https://github.com/hoo29>
+//                 Kelvin Jin <https://github.com/kjin>
+//                 Klaus Meinhardt <https://github.com/ajafff>
+//                 Lishude <https://github.com/islishude>
+//                 Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
+//                 Mohsen Azimi <https://github.com/mohsen1>
+//                 Nicolas Even <https://github.com/n-e>
+//                 Nikita Galkin <https://github.com/galkin>
+//                 Parambir Singh <https://github.com/parambirs>
+//                 Sebastian Silbermann <https://github.com/eps1lon>
+//                 Simon Schick <https://github.com/SimonSchick>
+//                 Thomas den Hollander <https://github.com/ThomasdenH>
+//                 Wilco Bakker <https://github.com/WilcoBakker>
+//                 wwwy3y3 <https://github.com/wwwy3y3>
+//                 Samuel Ainsworth <https://github.com/samuela>
+//                 Kyle Uehlein <https://github.com/kuehlein>
+//                 Jordi Oliveras Rovira <https://github.com/j-oliveras>
+//                 Thanik Bhongbhibhat <https://github.com/bhongy>
+//                 Marcin Kopacz <https://github.com/chyzwar>
+//                 Trivikram Kamat <https://github.com/trivikr>
+//                 Minh Son Nguyen <https://github.com/nguymin4>
+//                 Junxiao Shi <https://github.com/yoursunny>
+//                 Ilia Baryshnikov <https://github.com/qwelias>
+//                 ExE Boss <https://github.com/ExE-Boss>
+//                 Surasak Chaisurin <https://github.com/Ryan-Willpower>
+//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
+//                 Jason Kwok <https://github.com/JasonHK>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+// NOTE: These definitions support NodeJS and TypeScript 3.7.
+// This isn't strictly needed since 3.7 has the assert module, but this way we're consistent.
+// Typically type modificatons should be made in base.d.ts instead of here
+
+/// <reference path="base.d.ts" />
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/inspector.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/inspector.d.ts
new file mode 100644 (file)
index 0000000..b14aed2
--- /dev/null
@@ -0,0 +1,3034 @@
+// tslint:disable-next-line:dt-header
+// Type definitions for inspector
+
+// These definitions are auto-generated.
+// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330
+// for more information.
+
+// tslint:disable:max-line-length
+
+/**
+ * The inspector module provides an API for interacting with the V8 inspector.
+ */
+declare module "inspector" {
+    import { EventEmitter } from 'events';
+
+    interface InspectorNotification<T> {
+        method: string;
+        params: T;
+    }
+
+    namespace Schema {
+        /**
+         * Description of the protocol domain.
+         */
+        interface Domain {
+            /**
+             * Domain name.
+             */
+            name: string;
+            /**
+             * Domain version.
+             */
+            version: string;
+        }
+
+        interface GetDomainsReturnType {
+            /**
+             * List of supported domains.
+             */
+            domains: Domain[];
+        }
+    }
+
+    namespace Runtime {
+        /**
+         * Unique script identifier.
+         */
+        type ScriptId = string;
+
+        /**
+         * Unique object identifier.
+         */
+        type RemoteObjectId = string;
+
+        /**
+         * Primitive value which cannot be JSON-stringified.
+         */
+        type UnserializableValue = string;
+
+        /**
+         * Mirror object referencing original JavaScript object.
+         */
+        interface RemoteObject {
+            /**
+             * Object type.
+             */
+            type: string;
+            /**
+             * Object subtype hint. Specified for <code>object</code> type values only.
+             */
+            subtype?: string;
+            /**
+             * Object class (constructor) name. Specified for <code>object</code> type values only.
+             */
+            className?: string;
+            /**
+             * Remote object value in case of primitive values or JSON values (if it was requested).
+             */
+            value?: any;
+            /**
+             * Primitive value which can not be JSON-stringified does not have <code>value</code>, but gets this property.
+             */
+            unserializableValue?: UnserializableValue;
+            /**
+             * String representation of the object.
+             */
+            description?: string;
+            /**
+             * Unique object identifier (for non-primitive values).
+             */
+            objectId?: RemoteObjectId;
+            /**
+             * Preview containing abbreviated property values. Specified for <code>object</code> type values only.
+             * @experimental
+             */
+            preview?: ObjectPreview;
+            /**
+             * @experimental
+             */
+            customPreview?: CustomPreview;
+        }
+
+        /**
+         * @experimental
+         */
+        interface CustomPreview {
+            header: string;
+            hasBody: boolean;
+            formatterObjectId: RemoteObjectId;
+            bindRemoteObjectFunctionId: RemoteObjectId;
+            configObjectId?: RemoteObjectId;
+        }
+
+        /**
+         * Object containing abbreviated remote object value.
+         * @experimental
+         */
+        interface ObjectPreview {
+            /**
+             * Object type.
+             */
+            type: string;
+            /**
+             * Object subtype hint. Specified for <code>object</code> type values only.
+             */
+            subtype?: string;
+            /**
+             * String representation of the object.
+             */
+            description?: string;
+            /**
+             * True iff some of the properties or entries of the original object did not fit.
+             */
+            overflow: boolean;
+            /**
+             * List of the properties.
+             */
+            properties: PropertyPreview[];
+            /**
+             * List of the entries. Specified for <code>map</code> and <code>set</code> subtype values only.
+             */
+            entries?: EntryPreview[];
+        }
+
+        /**
+         * @experimental
+         */
+        interface PropertyPreview {
+            /**
+             * Property name.
+             */
+            name: string;
+            /**
+             * Object type. Accessor means that the property itself is an accessor property.
+             */
+            type: string;
+            /**
+             * User-friendly property value string.
+             */
+            value?: string;
+            /**
+             * Nested value preview.
+             */
+            valuePreview?: ObjectPreview;
+            /**
+             * Object subtype hint. Specified for <code>object</code> type values only.
+             */
+            subtype?: string;
+        }
+
+        /**
+         * @experimental
+         */
+        interface EntryPreview {
+            /**
+             * Preview of the key. Specified for map-like collection entries.
+             */
+            key?: ObjectPreview;
+            /**
+             * Preview of the value.
+             */
+            value: ObjectPreview;
+        }
+
+        /**
+         * Object property descriptor.
+         */
+        interface PropertyDescriptor {
+            /**
+             * Property name or symbol description.
+             */
+            name: string;
+            /**
+             * The value associated with the property.
+             */
+            value?: RemoteObject;
+            /**
+             * True if the value associated with the property may be changed (data descriptors only).
+             */
+            writable?: boolean;
+            /**
+             * A function which serves as a getter for the property, or <code>undefined</code> if there is no getter (accessor descriptors only).
+             */
+            get?: RemoteObject;
+            /**
+             * A function which serves as a setter for the property, or <code>undefined</code> if there is no setter (accessor descriptors only).
+             */
+            set?: RemoteObject;
+            /**
+             * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object.
+             */
+            configurable: boolean;
+            /**
+             * True if this property shows up during enumeration of the properties on the corresponding object.
+             */
+            enumerable: boolean;
+            /**
+             * True if the result was thrown during the evaluation.
+             */
+            wasThrown?: boolean;
+            /**
+             * True if the property is owned for the object.
+             */
+            isOwn?: boolean;
+            /**
+             * Property symbol object, if the property is of the <code>symbol</code> type.
+             */
+            symbol?: RemoteObject;
+        }
+
+        /**
+         * Object internal property descriptor. This property isn't normally visible in JavaScript code.
+         */
+        interface InternalPropertyDescriptor {
+            /**
+             * Conventional property name.
+             */
+            name: string;
+            /**
+             * The value associated with the property.
+             */
+            value?: RemoteObject;
+        }
+
+        /**
+         * Represents function call argument. Either remote object id <code>objectId</code>, primitive <code>value</code>, unserializable primitive value or neither of (for undefined) them should be specified.
+         */
+        interface CallArgument {
+            /**
+             * Primitive value or serializable javascript object.
+             */
+            value?: any;
+            /**
+             * Primitive value which can not be JSON-stringified.
+             */
+            unserializableValue?: UnserializableValue;
+            /**
+             * Remote object handle.
+             */
+            objectId?: RemoteObjectId;
+        }
+
+        /**
+         * Id of an execution context.
+         */
+        type ExecutionContextId = number;
+
+        /**
+         * Description of an isolated world.
+         */
+        interface ExecutionContextDescription {
+            /**
+             * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed.
+             */
+            id: ExecutionContextId;
+            /**
+             * Execution context origin.
+             */
+            origin: string;
+            /**
+             * Human readable name describing given context.
+             */
+            name: string;
+            /**
+             * Embedder-specific auxiliary data.
+             */
+            auxData?: {};
+        }
+
+        /**
+         * Detailed information about exception (or error) that was thrown during script compilation or execution.
+         */
+        interface ExceptionDetails {
+            /**
+             * Exception id.
+             */
+            exceptionId: number;
+            /**
+             * Exception text, which should be used together with exception object when available.
+             */
+            text: string;
+            /**
+             * Line number of the exception location (0-based).
+             */
+            lineNumber: number;
+            /**
+             * Column number of the exception location (0-based).
+             */
+            columnNumber: number;
+            /**
+             * Script ID of the exception location.
+             */
+            scriptId?: ScriptId;
+            /**
+             * URL of the exception location, to be used when the script was not reported.
+             */
+            url?: string;
+            /**
+             * JavaScript stack trace if available.
+             */
+            stackTrace?: StackTrace;
+            /**
+             * Exception object if available.
+             */
+            exception?: RemoteObject;
+            /**
+             * Identifier of the context where exception happened.
+             */
+            executionContextId?: ExecutionContextId;
+        }
+
+        /**
+         * Number of milliseconds since epoch.
+         */
+        type Timestamp = number;
+
+        /**
+         * Stack entry for runtime errors and assertions.
+         */
+        interface CallFrame {
+            /**
+             * JavaScript function name.
+             */
+            functionName: string;
+            /**
+             * JavaScript script id.
+             */
+            scriptId: ScriptId;
+            /**
+             * JavaScript script name or url.
+             */
+            url: string;
+            /**
+             * JavaScript script line number (0-based).
+             */
+            lineNumber: number;
+            /**
+             * JavaScript script column number (0-based).
+             */
+            columnNumber: number;
+        }
+
+        /**
+         * Call frames for assertions or error messages.
+         */
+        interface StackTrace {
+            /**
+             * String label of this stack trace. For async traces this may be a name of the function that initiated the async call.
+             */
+            description?: string;
+            /**
+             * JavaScript function name.
+             */
+            callFrames: CallFrame[];
+            /**
+             * Asynchronous JavaScript stack trace that preceded this stack, if available.
+             */
+            parent?: StackTrace;
+            /**
+             * Asynchronous JavaScript stack trace that preceded this stack, if available.
+             * @experimental
+             */
+            parentId?: StackTraceId;
+        }
+
+        /**
+         * Unique identifier of current debugger.
+         * @experimental
+         */
+        type UniqueDebuggerId = string;
+
+        /**
+         * If <code>debuggerId</code> is set stack trace comes from another debugger and can be resolved there. This allows to track cross-debugger calls. See <code>Runtime.StackTrace</code> and <code>Debugger.paused</code> for usages.
+         * @experimental
+         */
+        interface StackTraceId {
+            id: string;
+            debuggerId?: UniqueDebuggerId;
+        }
+
+        interface EvaluateParameterType {
+            /**
+             * Expression to evaluate.
+             */
+            expression: string;
+            /**
+             * Symbolic group name that can be used to release multiple objects.
+             */
+            objectGroup?: string;
+            /**
+             * Determines whether Command Line API should be available during the evaluation.
+             */
+            includeCommandLineAPI?: boolean;
+            /**
+             * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+             */
+            silent?: boolean;
+            /**
+             * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+             */
+            contextId?: ExecutionContextId;
+            /**
+             * Whether the result is expected to be a JSON object that should be sent by value.
+             */
+            returnByValue?: boolean;
+            /**
+             * Whether preview should be generated for the result.
+             * @experimental
+             */
+            generatePreview?: boolean;
+            /**
+             * Whether execution should be treated as initiated by user in the UI.
+             */
+            userGesture?: boolean;
+            /**
+             * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+             */
+            awaitPromise?: boolean;
+        }
+
+        interface AwaitPromiseParameterType {
+            /**
+             * Identifier of the promise.
+             */
+            promiseObjectId: RemoteObjectId;
+            /**
+             * Whether the result is expected to be a JSON object that should be sent by value.
+             */
+            returnByValue?: boolean;
+            /**
+             * Whether preview should be generated for the result.
+             */
+            generatePreview?: boolean;
+        }
+
+        interface CallFunctionOnParameterType {
+            /**
+             * Declaration of the function to call.
+             */
+            functionDeclaration: string;
+            /**
+             * Identifier of the object to call function on. Either objectId or executionContextId should be specified.
+             */
+            objectId?: RemoteObjectId;
+            /**
+             * Call arguments. All call arguments must belong to the same JavaScript world as the target object.
+             */
+            arguments?: CallArgument[];
+            /**
+             * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+             */
+            silent?: boolean;
+            /**
+             * Whether the result is expected to be a JSON object which should be sent by value.
+             */
+            returnByValue?: boolean;
+            /**
+             * Whether preview should be generated for the result.
+             * @experimental
+             */
+            generatePreview?: boolean;
+            /**
+             * Whether execution should be treated as initiated by user in the UI.
+             */
+            userGesture?: boolean;
+            /**
+             * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+             */
+            awaitPromise?: boolean;
+            /**
+             * Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified.
+             */
+            executionContextId?: ExecutionContextId;
+            /**
+             * Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object.
+             */
+            objectGroup?: string;
+        }
+
+        interface GetPropertiesParameterType {
+            /**
+             * Identifier of the object to return properties for.
+             */
+            objectId: RemoteObjectId;
+            /**
+             * If true, returns properties belonging only to the element itself, not to its prototype chain.
+             */
+            ownProperties?: boolean;
+            /**
+             * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either.
+             * @experimental
+             */
+            accessorPropertiesOnly?: boolean;
+            /**
+             * Whether preview should be generated for the results.
+             * @experimental
+             */
+            generatePreview?: boolean;
+        }
+
+        interface ReleaseObjectParameterType {
+            /**
+             * Identifier of the object to release.
+             */
+            objectId: RemoteObjectId;
+        }
+
+        interface ReleaseObjectGroupParameterType {
+            /**
+             * Symbolic object group name.
+             */
+            objectGroup: string;
+        }
+
+        interface SetCustomObjectFormatterEnabledParameterType {
+            enabled: boolean;
+        }
+
+        interface CompileScriptParameterType {
+            /**
+             * Expression to compile.
+             */
+            expression: string;
+            /**
+             * Source url to be set for the script.
+             */
+            sourceURL: string;
+            /**
+             * Specifies whether the compiled script should be persisted.
+             */
+            persistScript: boolean;
+            /**
+             * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+             */
+            executionContextId?: ExecutionContextId;
+        }
+
+        interface RunScriptParameterType {
+            /**
+             * Id of the script to run.
+             */
+            scriptId: ScriptId;
+            /**
+             * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page.
+             */
+            executionContextId?: ExecutionContextId;
+            /**
+             * Symbolic group name that can be used to release multiple objects.
+             */
+            objectGroup?: string;
+            /**
+             * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+             */
+            silent?: boolean;
+            /**
+             * Determines whether Command Line API should be available during the evaluation.
+             */
+            includeCommandLineAPI?: boolean;
+            /**
+             * Whether the result is expected to be a JSON object which should be sent by value.
+             */
+            returnByValue?: boolean;
+            /**
+             * Whether preview should be generated for the result.
+             */
+            generatePreview?: boolean;
+            /**
+             * Whether execution should <code>await</code> for resulting value and return once awaited promise is resolved.
+             */
+            awaitPromise?: boolean;
+        }
+
+        interface QueryObjectsParameterType {
+            /**
+             * Identifier of the prototype to return objects for.
+             */
+            prototypeObjectId: RemoteObjectId;
+        }
+
+        interface GlobalLexicalScopeNamesParameterType {
+            /**
+             * Specifies in which execution context to lookup global scope variables.
+             */
+            executionContextId?: ExecutionContextId;
+        }
+
+        interface EvaluateReturnType {
+            /**
+             * Evaluation result.
+             */
+            result: RemoteObject;
+            /**
+             * Exception details.
+             */
+            exceptionDetails?: ExceptionDetails;
+        }
+
+        interface AwaitPromiseReturnType {
+            /**
+             * Promise result. Will contain rejected value if promise was rejected.
+             */
+            result: RemoteObject;
+            /**
+             * Exception details if stack strace is available.
+             */
+            exceptionDetails?: ExceptionDetails;
+        }
+
+        interface CallFunctionOnReturnType {
+            /**
+             * Call result.
+             */
+            result: RemoteObject;
+            /**
+             * Exception details.
+             */
+            exceptionDetails?: ExceptionDetails;
+        }
+
+        interface GetPropertiesReturnType {
+            /**
+             * Object properties.
+             */
+            result: PropertyDescriptor[];
+            /**
+             * Internal object properties (only of the element itself).
+             */
+            internalProperties?: InternalPropertyDescriptor[];
+            /**
+             * Exception details.
+             */
+            exceptionDetails?: ExceptionDetails;
+        }
+
+        interface CompileScriptReturnType {
+            /**
+             * Id of the script.
+             */
+            scriptId?: ScriptId;
+            /**
+             * Exception details.
+             */
+            exceptionDetails?: ExceptionDetails;
+        }
+
+        interface RunScriptReturnType {
+            /**
+             * Run result.
+             */
+            result: RemoteObject;
+            /**
+             * Exception details.
+             */
+            exceptionDetails?: ExceptionDetails;
+        }
+
+        interface QueryObjectsReturnType {
+            /**
+             * Array with objects.
+             */
+            objects: RemoteObject;
+        }
+
+        interface GlobalLexicalScopeNamesReturnType {
+            names: string[];
+        }
+
+        interface ExecutionContextCreatedEventDataType {
+            /**
+             * A newly created execution context.
+             */
+            context: ExecutionContextDescription;
+        }
+
+        interface ExecutionContextDestroyedEventDataType {
+            /**
+             * Id of the destroyed context
+             */
+            executionContextId: ExecutionContextId;
+        }
+
+        interface ExceptionThrownEventDataType {
+            /**
+             * Timestamp of the exception.
+             */
+            timestamp: Timestamp;
+            exceptionDetails: ExceptionDetails;
+        }
+
+        interface ExceptionRevokedEventDataType {
+            /**
+             * Reason describing why exception was revoked.
+             */
+            reason: string;
+            /**
+             * The id of revoked exception, as reported in <code>exceptionThrown</code>.
+             */
+            exceptionId: number;
+        }
+
+        interface ConsoleAPICalledEventDataType {
+            /**
+             * Type of the call.
+             */
+            type: string;
+            /**
+             * Call arguments.
+             */
+            args: RemoteObject[];
+            /**
+             * Identifier of the context where the call was made.
+             */
+            executionContextId: ExecutionContextId;
+            /**
+             * Call timestamp.
+             */
+            timestamp: Timestamp;
+            /**
+             * Stack trace captured when the call was made.
+             */
+            stackTrace?: StackTrace;
+            /**
+             * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context.
+             * @experimental
+             */
+            context?: string;
+        }
+
+        interface InspectRequestedEventDataType {
+            object: RemoteObject;
+            hints: {};
+        }
+    }
+
+    namespace Debugger {
+        /**
+         * Breakpoint identifier.
+         */
+        type BreakpointId = string;
+
+        /**
+         * Call frame identifier.
+         */
+        type CallFrameId = string;
+
+        /**
+         * Location in the source code.
+         */
+        interface Location {
+            /**
+             * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * Line number in the script (0-based).
+             */
+            lineNumber: number;
+            /**
+             * Column number in the script (0-based).
+             */
+            columnNumber?: number;
+        }
+
+        /**
+         * Location in the source code.
+         * @experimental
+         */
+        interface ScriptPosition {
+            lineNumber: number;
+            columnNumber: number;
+        }
+
+        /**
+         * JavaScript call frame. Array of call frames form the call stack.
+         */
+        interface CallFrame {
+            /**
+             * Call frame identifier. This identifier is only valid while the virtual machine is paused.
+             */
+            callFrameId: CallFrameId;
+            /**
+             * Name of the JavaScript function called on this call frame.
+             */
+            functionName: string;
+            /**
+             * Location in the source code.
+             */
+            functionLocation?: Location;
+            /**
+             * Location in the source code.
+             */
+            location: Location;
+            /**
+             * JavaScript script name or url.
+             */
+            url: string;
+            /**
+             * Scope chain for this call frame.
+             */
+            scopeChain: Scope[];
+            /**
+             * <code>this</code> object for this call frame.
+             */
+            this: Runtime.RemoteObject;
+            /**
+             * The value being returned, if the function is at return point.
+             */
+            returnValue?: Runtime.RemoteObject;
+        }
+
+        /**
+         * Scope description.
+         */
+        interface Scope {
+            /**
+             * Scope type.
+             */
+            type: string;
+            /**
+             * Object representing the scope. For <code>global</code> and <code>with</code> scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.
+             */
+            object: Runtime.RemoteObject;
+            name?: string;
+            /**
+             * Location in the source code where scope starts
+             */
+            startLocation?: Location;
+            /**
+             * Location in the source code where scope ends
+             */
+            endLocation?: Location;
+        }
+
+        /**
+         * Search match for resource.
+         */
+        interface SearchMatch {
+            /**
+             * Line number in resource content.
+             */
+            lineNumber: number;
+            /**
+             * Line with match content.
+             */
+            lineContent: string;
+        }
+
+        interface BreakLocation {
+            /**
+             * Script identifier as reported in the <code>Debugger.scriptParsed</code>.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * Line number in the script (0-based).
+             */
+            lineNumber: number;
+            /**
+             * Column number in the script (0-based).
+             */
+            columnNumber?: number;
+            type?: string;
+        }
+
+        interface SetBreakpointsActiveParameterType {
+            /**
+             * New value for breakpoints active state.
+             */
+            active: boolean;
+        }
+
+        interface SetSkipAllPausesParameterType {
+            /**
+             * New value for skip pauses state.
+             */
+            skip: boolean;
+        }
+
+        interface SetBreakpointByUrlParameterType {
+            /**
+             * Line number to set breakpoint at.
+             */
+            lineNumber: number;
+            /**
+             * URL of the resources to set breakpoint on.
+             */
+            url?: string;
+            /**
+             * Regex pattern for the URLs of the resources to set breakpoints on. Either <code>url</code> or <code>urlRegex</code> must be specified.
+             */
+            urlRegex?: string;
+            /**
+             * Script hash of the resources to set breakpoint on.
+             */
+            scriptHash?: string;
+            /**
+             * Offset in the line to set breakpoint at.
+             */
+            columnNumber?: number;
+            /**
+             * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
+             */
+            condition?: string;
+        }
+
+        interface SetBreakpointParameterType {
+            /**
+             * Location to set breakpoint in.
+             */
+            location: Location;
+            /**
+             * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
+             */
+            condition?: string;
+        }
+
+        interface RemoveBreakpointParameterType {
+            breakpointId: BreakpointId;
+        }
+
+        interface GetPossibleBreakpointsParameterType {
+            /**
+             * Start of range to search possible breakpoint locations in.
+             */
+            start: Location;
+            /**
+             * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
+             */
+            end?: Location;
+            /**
+             * Only consider locations which are in the same (non-nested) function as start.
+             */
+            restrictToFunction?: boolean;
+        }
+
+        interface ContinueToLocationParameterType {
+            /**
+             * Location to continue to.
+             */
+            location: Location;
+            targetCallFrames?: string;
+        }
+
+        interface PauseOnAsyncCallParameterType {
+            /**
+             * Debugger will pause when async call with given stack trace is started.
+             */
+            parentStackTraceId: Runtime.StackTraceId;
+        }
+
+        interface StepIntoParameterType {
+            /**
+             * Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause.
+             * @experimental
+             */
+            breakOnAsyncCall?: boolean;
+        }
+
+        interface GetStackTraceParameterType {
+            stackTraceId: Runtime.StackTraceId;
+        }
+
+        interface SearchInContentParameterType {
+            /**
+             * Id of the script to search in.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * String to search for.
+             */
+            query: string;
+            /**
+             * If true, search is case sensitive.
+             */
+            caseSensitive?: boolean;
+            /**
+             * If true, treats string parameter as regex.
+             */
+            isRegex?: boolean;
+        }
+
+        interface SetScriptSourceParameterType {
+            /**
+             * Id of the script to edit.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * New content of the script.
+             */
+            scriptSource: string;
+            /**
+             *  If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
+             */
+            dryRun?: boolean;
+        }
+
+        interface RestartFrameParameterType {
+            /**
+             * Call frame identifier to evaluate on.
+             */
+            callFrameId: CallFrameId;
+        }
+
+        interface GetScriptSourceParameterType {
+            /**
+             * Id of the script to get source for.
+             */
+            scriptId: Runtime.ScriptId;
+        }
+
+        interface SetPauseOnExceptionsParameterType {
+            /**
+             * Pause on exceptions mode.
+             */
+            state: string;
+        }
+
+        interface EvaluateOnCallFrameParameterType {
+            /**
+             * Call frame identifier to evaluate on.
+             */
+            callFrameId: CallFrameId;
+            /**
+             * Expression to evaluate.
+             */
+            expression: string;
+            /**
+             * String object group name to put result into (allows rapid releasing resulting object handles using <code>releaseObjectGroup</code>).
+             */
+            objectGroup?: string;
+            /**
+             * Specifies whether command line API should be available to the evaluated expression, defaults to false.
+             */
+            includeCommandLineAPI?: boolean;
+            /**
+             * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides <code>setPauseOnException</code> state.
+             */
+            silent?: boolean;
+            /**
+             * Whether the result is expected to be a JSON object that should be sent by value.
+             */
+            returnByValue?: boolean;
+            /**
+             * Whether preview should be generated for the result.
+             * @experimental
+             */
+            generatePreview?: boolean;
+            /**
+             * Whether to throw an exception if side effect cannot be ruled out during evaluation.
+             */
+            throwOnSideEffect?: boolean;
+        }
+
+        interface SetVariableValueParameterType {
+            /**
+             * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
+             */
+            scopeNumber: number;
+            /**
+             * Variable name.
+             */
+            variableName: string;
+            /**
+             * New variable value.
+             */
+            newValue: Runtime.CallArgument;
+            /**
+             * Id of callframe that holds variable.
+             */
+            callFrameId: CallFrameId;
+        }
+
+        interface SetReturnValueParameterType {
+            /**
+             * New return value.
+             */
+            newValue: Runtime.CallArgument;
+        }
+
+        interface SetAsyncCallStackDepthParameterType {
+            /**
+             * Maximum depth of async call stacks. Setting to <code>0</code> will effectively disable collecting async call stacks (default).
+             */
+            maxDepth: number;
+        }
+
+        interface SetBlackboxPatternsParameterType {
+            /**
+             * Array of regexps that will be used to check script url for blackbox state.
+             */
+            patterns: string[];
+        }
+
+        interface SetBlackboxedRangesParameterType {
+            /**
+             * Id of the script.
+             */
+            scriptId: Runtime.ScriptId;
+            positions: ScriptPosition[];
+        }
+
+        interface EnableReturnType {
+            /**
+             * Unique identifier of the debugger.
+             * @experimental
+             */
+            debuggerId: Runtime.UniqueDebuggerId;
+        }
+
+        interface SetBreakpointByUrlReturnType {
+            /**
+             * Id of the created breakpoint for further reference.
+             */
+            breakpointId: BreakpointId;
+            /**
+             * List of the locations this breakpoint resolved into upon addition.
+             */
+            locations: Location[];
+        }
+
+        interface SetBreakpointReturnType {
+            /**
+             * Id of the created breakpoint for further reference.
+             */
+            breakpointId: BreakpointId;
+            /**
+             * Location this breakpoint resolved into.
+             */
+            actualLocation: Location;
+        }
+
+        interface GetPossibleBreakpointsReturnType {
+            /**
+             * List of the possible breakpoint locations.
+             */
+            locations: BreakLocation[];
+        }
+
+        interface GetStackTraceReturnType {
+            stackTrace: Runtime.StackTrace;
+        }
+
+        interface SearchInContentReturnType {
+            /**
+             * List of search matches.
+             */
+            result: SearchMatch[];
+        }
+
+        interface SetScriptSourceReturnType {
+            /**
+             * New stack trace in case editing has happened while VM was stopped.
+             */
+            callFrames?: CallFrame[];
+            /**
+             * Whether current call stack  was modified after applying the changes.
+             */
+            stackChanged?: boolean;
+            /**
+             * Async stack trace, if any.
+             */
+            asyncStackTrace?: Runtime.StackTrace;
+            /**
+             * Async stack trace, if any.
+             * @experimental
+             */
+            asyncStackTraceId?: Runtime.StackTraceId;
+            /**
+             * Exception details if any.
+             */
+            exceptionDetails?: Runtime.ExceptionDetails;
+        }
+
+        interface RestartFrameReturnType {
+            /**
+             * New stack trace.
+             */
+            callFrames: CallFrame[];
+            /**
+             * Async stack trace, if any.
+             */
+            asyncStackTrace?: Runtime.StackTrace;
+            /**
+             * Async stack trace, if any.
+             * @experimental
+             */
+            asyncStackTraceId?: Runtime.StackTraceId;
+        }
+
+        interface GetScriptSourceReturnType {
+            /**
+             * Script source.
+             */
+            scriptSource: string;
+        }
+
+        interface EvaluateOnCallFrameReturnType {
+            /**
+             * Object wrapper for the evaluation result.
+             */
+            result: Runtime.RemoteObject;
+            /**
+             * Exception details.
+             */
+            exceptionDetails?: Runtime.ExceptionDetails;
+        }
+
+        interface ScriptParsedEventDataType {
+            /**
+             * Identifier of the script parsed.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * URL or name of the script parsed (if any).
+             */
+            url: string;
+            /**
+             * Line offset of the script within the resource with given URL (for script tags).
+             */
+            startLine: number;
+            /**
+             * Column offset of the script within the resource with given URL.
+             */
+            startColumn: number;
+            /**
+             * Last line of the script.
+             */
+            endLine: number;
+            /**
+             * Length of the last line of the script.
+             */
+            endColumn: number;
+            /**
+             * Specifies script creation context.
+             */
+            executionContextId: Runtime.ExecutionContextId;
+            /**
+             * Content hash of the script.
+             */
+            hash: string;
+            /**
+             * Embedder-specific auxiliary data.
+             */
+            executionContextAuxData?: {};
+            /**
+             * True, if this script is generated as a result of the live edit operation.
+             * @experimental
+             */
+            isLiveEdit?: boolean;
+            /**
+             * URL of source map associated with script (if any).
+             */
+            sourceMapURL?: string;
+            /**
+             * True, if this script has sourceURL.
+             */
+            hasSourceURL?: boolean;
+            /**
+             * True, if this script is ES6 module.
+             */
+            isModule?: boolean;
+            /**
+             * This script length.
+             */
+            length?: number;
+            /**
+             * JavaScript top stack frame of where the script parsed event was triggered if available.
+             * @experimental
+             */
+            stackTrace?: Runtime.StackTrace;
+        }
+
+        interface ScriptFailedToParseEventDataType {
+            /**
+             * Identifier of the script parsed.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * URL or name of the script parsed (if any).
+             */
+            url: string;
+            /**
+             * Line offset of the script within the resource with given URL (for script tags).
+             */
+            startLine: number;
+            /**
+             * Column offset of the script within the resource with given URL.
+             */
+            startColumn: number;
+            /**
+             * Last line of the script.
+             */
+            endLine: number;
+            /**
+             * Length of the last line of the script.
+             */
+            endColumn: number;
+            /**
+             * Specifies script creation context.
+             */
+            executionContextId: Runtime.ExecutionContextId;
+            /**
+             * Content hash of the script.
+             */
+            hash: string;
+            /**
+             * Embedder-specific auxiliary data.
+             */
+            executionContextAuxData?: {};
+            /**
+             * URL of source map associated with script (if any).
+             */
+            sourceMapURL?: string;
+            /**
+             * True, if this script has sourceURL.
+             */
+            hasSourceURL?: boolean;
+            /**
+             * True, if this script is ES6 module.
+             */
+            isModule?: boolean;
+            /**
+             * This script length.
+             */
+            length?: number;
+            /**
+             * JavaScript top stack frame of where the script parsed event was triggered if available.
+             * @experimental
+             */
+            stackTrace?: Runtime.StackTrace;
+        }
+
+        interface BreakpointResolvedEventDataType {
+            /**
+             * Breakpoint unique identifier.
+             */
+            breakpointId: BreakpointId;
+            /**
+             * Actual breakpoint location.
+             */
+            location: Location;
+        }
+
+        interface PausedEventDataType {
+            /**
+             * Call stack the virtual machine stopped on.
+             */
+            callFrames: CallFrame[];
+            /**
+             * Pause reason.
+             */
+            reason: string;
+            /**
+             * Object containing break-specific auxiliary properties.
+             */
+            data?: {};
+            /**
+             * Hit breakpoints IDs
+             */
+            hitBreakpoints?: string[];
+            /**
+             * Async stack trace, if any.
+             */
+            asyncStackTrace?: Runtime.StackTrace;
+            /**
+             * Async stack trace, if any.
+             * @experimental
+             */
+            asyncStackTraceId?: Runtime.StackTraceId;
+            /**
+             * Just scheduled async call will have this stack trace as parent stack during async execution. This field is available only after <code>Debugger.stepInto</code> call with <code>breakOnAsynCall</code> flag.
+             * @experimental
+             */
+            asyncCallStackTraceId?: Runtime.StackTraceId;
+        }
+    }
+
+    namespace Console {
+        /**
+         * Console message.
+         */
+        interface ConsoleMessage {
+            /**
+             * Message source.
+             */
+            source: string;
+            /**
+             * Message severity.
+             */
+            level: string;
+            /**
+             * Message text.
+             */
+            text: string;
+            /**
+             * URL of the message origin.
+             */
+            url?: string;
+            /**
+             * Line number in the resource that generated this message (1-based).
+             */
+            line?: number;
+            /**
+             * Column number in the resource that generated this message (1-based).
+             */
+            column?: number;
+        }
+
+        interface MessageAddedEventDataType {
+            /**
+             * Console message that has been added.
+             */
+            message: ConsoleMessage;
+        }
+    }
+
+    namespace Profiler {
+        /**
+         * Profile node. Holds callsite information, execution statistics and child nodes.
+         */
+        interface ProfileNode {
+            /**
+             * Unique id of the node.
+             */
+            id: number;
+            /**
+             * Function location.
+             */
+            callFrame: Runtime.CallFrame;
+            /**
+             * Number of samples where this node was on top of the call stack.
+             */
+            hitCount?: number;
+            /**
+             * Child node ids.
+             */
+            children?: number[];
+            /**
+             * The reason of being not optimized. The function may be deoptimized or marked as don't optimize.
+             */
+            deoptReason?: string;
+            /**
+             * An array of source position ticks.
+             */
+            positionTicks?: PositionTickInfo[];
+        }
+
+        /**
+         * Profile.
+         */
+        interface Profile {
+            /**
+             * The list of profile nodes. First item is the root node.
+             */
+            nodes: ProfileNode[];
+            /**
+             * Profiling start timestamp in microseconds.
+             */
+            startTime: number;
+            /**
+             * Profiling end timestamp in microseconds.
+             */
+            endTime: number;
+            /**
+             * Ids of samples top nodes.
+             */
+            samples?: number[];
+            /**
+             * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
+             */
+            timeDeltas?: number[];
+        }
+
+        /**
+         * Specifies a number of samples attributed to a certain source position.
+         */
+        interface PositionTickInfo {
+            /**
+             * Source line number (1-based).
+             */
+            line: number;
+            /**
+             * Number of samples attributed to the source line.
+             */
+            ticks: number;
+        }
+
+        /**
+         * Coverage data for a source range.
+         */
+        interface CoverageRange {
+            /**
+             * JavaScript script source offset for the range start.
+             */
+            startOffset: number;
+            /**
+             * JavaScript script source offset for the range end.
+             */
+            endOffset: number;
+            /**
+             * Collected execution count of the source range.
+             */
+            count: number;
+        }
+
+        /**
+         * Coverage data for a JavaScript function.
+         */
+        interface FunctionCoverage {
+            /**
+             * JavaScript function name.
+             */
+            functionName: string;
+            /**
+             * Source ranges inside the function with coverage data.
+             */
+            ranges: CoverageRange[];
+            /**
+             * Whether coverage data for this function has block granularity.
+             */
+            isBlockCoverage: boolean;
+        }
+
+        /**
+         * Coverage data for a JavaScript script.
+         */
+        interface ScriptCoverage {
+            /**
+             * JavaScript script id.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * JavaScript script name or url.
+             */
+            url: string;
+            /**
+             * Functions contained in the script that has coverage data.
+             */
+            functions: FunctionCoverage[];
+        }
+
+        /**
+         * Describes a type collected during runtime.
+         * @experimental
+         */
+        interface TypeObject {
+            /**
+             * Name of a type collected with type profiling.
+             */
+            name: string;
+        }
+
+        /**
+         * Source offset and types for a parameter or return value.
+         * @experimental
+         */
+        interface TypeProfileEntry {
+            /**
+             * Source offset of the parameter or end of function for return values.
+             */
+            offset: number;
+            /**
+             * The types for this parameter or return value.
+             */
+            types: TypeObject[];
+        }
+
+        /**
+         * Type profile data collected during runtime for a JavaScript script.
+         * @experimental
+         */
+        interface ScriptTypeProfile {
+            /**
+             * JavaScript script id.
+             */
+            scriptId: Runtime.ScriptId;
+            /**
+             * JavaScript script name or url.
+             */
+            url: string;
+            /**
+             * Type profile entries for parameters and return values of the functions in the script.
+             */
+            entries: TypeProfileEntry[];
+        }
+
+        interface SetSamplingIntervalParameterType {
+            /**
+             * New sampling interval in microseconds.
+             */
+            interval: number;
+        }
+
+        interface StartPreciseCoverageParameterType {
+            /**
+             * Collect accurate call counts beyond simple 'covered' or 'not covered'.
+             */
+            callCount?: boolean;
+            /**
+             * Collect block-based coverage.
+             */
+            detailed?: boolean;
+        }
+
+        interface StopReturnType {
+            /**
+             * Recorded profile.
+             */
+            profile: Profile;
+        }
+
+        interface TakePreciseCoverageReturnType {
+            /**
+             * Coverage data for the current isolate.
+             */
+            result: ScriptCoverage[];
+        }
+
+        interface GetBestEffortCoverageReturnType {
+            /**
+             * Coverage data for the current isolate.
+             */
+            result: ScriptCoverage[];
+        }
+
+        interface TakeTypeProfileReturnType {
+            /**
+             * Type profile for all scripts since startTypeProfile() was turned on.
+             */
+            result: ScriptTypeProfile[];
+        }
+
+        interface ConsoleProfileStartedEventDataType {
+            id: string;
+            /**
+             * Location of console.profile().
+             */
+            location: Debugger.Location;
+            /**
+             * Profile title passed as an argument to console.profile().
+             */
+            title?: string;
+        }
+
+        interface ConsoleProfileFinishedEventDataType {
+            id: string;
+            /**
+             * Location of console.profileEnd().
+             */
+            location: Debugger.Location;
+            profile: Profile;
+            /**
+             * Profile title passed as an argument to console.profile().
+             */
+            title?: string;
+        }
+    }
+
+    namespace HeapProfiler {
+        /**
+         * Heap snapshot object id.
+         */
+        type HeapSnapshotObjectId = string;
+
+        /**
+         * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes.
+         */
+        interface SamplingHeapProfileNode {
+            /**
+             * Function location.
+             */
+            callFrame: Runtime.CallFrame;
+            /**
+             * Allocations size in bytes for the node excluding children.
+             */
+            selfSize: number;
+            /**
+             * Child nodes.
+             */
+            children: SamplingHeapProfileNode[];
+        }
+
+        /**
+         * Profile.
+         */
+        interface SamplingHeapProfile {
+            head: SamplingHeapProfileNode;
+        }
+
+        interface StartTrackingHeapObjectsParameterType {
+            trackAllocations?: boolean;
+        }
+
+        interface StopTrackingHeapObjectsParameterType {
+            /**
+             * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.
+             */
+            reportProgress?: boolean;
+        }
+
+        interface TakeHeapSnapshotParameterType {
+            /**
+             * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.
+             */
+            reportProgress?: boolean;
+        }
+
+        interface GetObjectByHeapObjectIdParameterType {
+            objectId: HeapSnapshotObjectId;
+            /**
+             * Symbolic group name that can be used to release multiple objects.
+             */
+            objectGroup?: string;
+        }
+
+        interface AddInspectedHeapObjectParameterType {
+            /**
+             * Heap snapshot object id to be accessible by means of $x command line API.
+             */
+            heapObjectId: HeapSnapshotObjectId;
+        }
+
+        interface GetHeapObjectIdParameterType {
+            /**
+             * Identifier of the object to get heap object id for.
+             */
+            objectId: Runtime.RemoteObjectId;
+        }
+
+        interface StartSamplingParameterType {
+            /**
+             * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.
+             */
+            samplingInterval?: number;
+        }
+
+        interface GetObjectByHeapObjectIdReturnType {
+            /**
+             * Evaluation result.
+             */
+            result: Runtime.RemoteObject;
+        }
+
+        interface GetHeapObjectIdReturnType {
+            /**
+             * Id of the heap snapshot object corresponding to the passed remote object id.
+             */
+            heapSnapshotObjectId: HeapSnapshotObjectId;
+        }
+
+        interface StopSamplingReturnType {
+            /**
+             * Recorded sampling heap profile.
+             */
+            profile: SamplingHeapProfile;
+        }
+
+        interface GetSamplingProfileReturnType {
+            /**
+             * Return the sampling profile being collected.
+             */
+            profile: SamplingHeapProfile;
+        }
+
+        interface AddHeapSnapshotChunkEventDataType {
+            chunk: string;
+        }
+
+        interface ReportHeapSnapshotProgressEventDataType {
+            done: number;
+            total: number;
+            finished?: boolean;
+        }
+
+        interface LastSeenObjectIdEventDataType {
+            lastSeenObjectId: number;
+            timestamp: number;
+        }
+
+        interface HeapStatsUpdateEventDataType {
+            /**
+             * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.
+             */
+            statsUpdate: number[];
+        }
+    }
+
+    namespace NodeTracing {
+        interface TraceConfig {
+            /**
+             * Controls how the trace buffer stores data.
+             */
+            recordMode?: string;
+            /**
+             * Included category filters.
+             */
+            includedCategories: string[];
+        }
+
+        interface StartParameterType {
+            traceConfig: TraceConfig;
+        }
+
+        interface GetCategoriesReturnType {
+            /**
+             * A list of supported tracing categories.
+             */
+            categories: string[];
+        }
+
+        interface DataCollectedEventDataType {
+            value: Array<{}>;
+        }
+    }
+
+    namespace NodeWorker {
+        type WorkerID = string;
+
+        /**
+         * Unique identifier of attached debugging session.
+         */
+        type SessionID = string;
+
+        interface WorkerInfo {
+            workerId: WorkerID;
+            type: string;
+            title: string;
+            url: string;
+        }
+
+        interface SendMessageToWorkerParameterType {
+            message: string;
+            /**
+             * Identifier of the session.
+             */
+            sessionId: SessionID;
+        }
+
+        interface EnableParameterType {
+            /**
+             * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
+             * message to run them.
+             */
+            waitForDebuggerOnStart: boolean;
+        }
+
+        interface DetachParameterType {
+            sessionId: SessionID;
+        }
+
+        interface AttachedToWorkerEventDataType {
+            /**
+             * Identifier assigned to the session used to send/receive messages.
+             */
+            sessionId: SessionID;
+            workerInfo: WorkerInfo;
+            waitingForDebugger: boolean;
+        }
+
+        interface DetachedFromWorkerEventDataType {
+            /**
+             * Detached session identifier.
+             */
+            sessionId: SessionID;
+        }
+
+        interface ReceivedMessageFromWorkerEventDataType {
+            /**
+             * Identifier of a session which sends a message.
+             */
+            sessionId: SessionID;
+            message: string;
+        }
+    }
+
+    namespace NodeRuntime {
+        interface NotifyWhenWaitingForDisconnectParameterType {
+            enabled: boolean;
+        }
+    }
+
+    /**
+     * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.
+     */
+    class Session extends EventEmitter {
+        /**
+         * Create a new instance of the inspector.Session class.
+         * The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend.
+         */
+        constructor();
+
+        /**
+         * Connects a session to the inspector back-end.
+         * An exception will be thrown if there is already a connected session established either
+         * through the API or by a front-end connected to the Inspector WebSocket port.
+         */
+        connect(): void;
+
+        /**
+         * Immediately close the session. All pending message callbacks will be called with an error.
+         * session.connect() will need to be called to be able to send messages again.
+         * Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints.
+         */
+        disconnect(): void;
+
+        /**
+         * Posts a message to the inspector back-end. callback will be notified when a response is received.
+         * callback is a function that accepts two optional arguments - error and message-specific result.
+         */
+        post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void;
+        post(method: string, callback?: (err: Error | null, params?: {}) => void): void;
+
+        /**
+         * Returns supported domains.
+         */
+        post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void;
+
+        /**
+         * Evaluates expression on global object.
+         */
+        post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
+        post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void;
+
+        /**
+         * Add handler to promise with given promise object id.
+         */
+        post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
+        post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void;
+
+        /**
+         * Calls function with given declaration on the given object. Object group of the result is inherited from the target object.
+         */
+        post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
+        post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void;
+
+        /**
+         * Returns properties of a given object. Object group of the result is inherited from the target object.
+         */
+        post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
+        post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void;
+
+        /**
+         * Releases remote object with given id.
+         */
+        post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Releases all remote objects that belong to a given group.
+         */
+        post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Tells inspected instance to run if it was waiting for debugger to attach.
+         */
+        post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Enables reporting of execution contexts creation by means of <code>executionContextCreated</code> event. When the reporting gets enabled the event will be sent immediately for each existing execution context.
+         */
+        post(method: "Runtime.enable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Disables reporting of execution contexts creation.
+         */
+        post(method: "Runtime.disable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Discards collected exceptions and console API calls.
+         */
+        post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void;
+
+        /**
+         * @experimental
+         */
+        post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Compiles expression.
+         */
+        post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
+        post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void;
+
+        /**
+         * Runs script with given id in a given context.
+         */
+        post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
+        post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void;
+
+        post(method: "Runtime.queryObjects", params?: Runtime.QueryObjectsParameterType, callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
+        post(method: "Runtime.queryObjects", callback?: (err: Error | null, params: Runtime.QueryObjectsReturnType) => void): void;
+
+        /**
+         * Returns all let, const and class variables from global scope.
+         */
+        post(
+            method: "Runtime.globalLexicalScopeNames",
+            params?: Runtime.GlobalLexicalScopeNamesParameterType,
+            callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void
+        ): void;
+        post(method: "Runtime.globalLexicalScopeNames", callback?: (err: Error | null, params: Runtime.GlobalLexicalScopeNamesReturnType) => void): void;
+
+        /**
+         * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received.
+         */
+        post(method: "Debugger.enable", callback?: (err: Error | null, params: Debugger.EnableReturnType) => void): void;
+
+        /**
+         * Disables debugger for given page.
+         */
+        post(method: "Debugger.disable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Activates / deactivates all breakpoints on the page.
+         */
+        post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc).
+         */
+        post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in <code>locations</code> property. Further matching script parsing will result in subsequent <code>breakpointResolved</code> events issued. This logical breakpoint will survive page reloads.
+         */
+        post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
+        post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void;
+
+        /**
+         * Sets JavaScript breakpoint at a given location.
+         */
+        post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
+        post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void;
+
+        /**
+         * Removes JavaScript breakpoint.
+         */
+        post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same.
+         */
+        post(
+            method: "Debugger.getPossibleBreakpoints",
+            params?: Debugger.GetPossibleBreakpointsParameterType,
+            callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void
+        ): void;
+        post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void;
+
+        /**
+         * Continues execution until specific location is reached.
+         */
+        post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void;
+
+        /**
+         * @experimental
+         */
+        post(method: "Debugger.pauseOnAsyncCall", params?: Debugger.PauseOnAsyncCallParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.pauseOnAsyncCall", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Steps over the statement.
+         */
+        post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Steps into the function call.
+         */
+        post(method: "Debugger.stepInto", params?: Debugger.StepIntoParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Steps out of the function call.
+         */
+        post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Stops on the next JavaScript statement.
+         */
+        post(method: "Debugger.pause", callback?: (err: Error | null) => void): void;
+
+        /**
+         * This method is deprecated - use Debugger.stepInto with breakOnAsyncCall and Debugger.pauseOnAsyncTask instead. Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called.
+         * @experimental
+         */
+        post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Resumes JavaScript execution.
+         */
+        post(method: "Debugger.resume", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Returns stack trace with given <code>stackTraceId</code>.
+         * @experimental
+         */
+        post(method: "Debugger.getStackTrace", params?: Debugger.GetStackTraceParameterType, callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
+        post(method: "Debugger.getStackTrace", callback?: (err: Error | null, params: Debugger.GetStackTraceReturnType) => void): void;
+
+        /**
+         * Searches for given string in script content.
+         */
+        post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
+        post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void;
+
+        /**
+         * Edits JavaScript source live.
+         */
+        post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
+        post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void;
+
+        /**
+         * Restarts particular call frame from the beginning.
+         */
+        post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
+        post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void;
+
+        /**
+         * Returns source for the script with given id.
+         */
+        post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
+        post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void;
+
+        /**
+         * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is <code>none</code>.
+         */
+        post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Evaluates expression on a given call frame.
+         */
+        post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
+        post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void;
+
+        /**
+         * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually.
+         */
+        post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Changes return value in top frame. Available only at return break position.
+         * @experimental
+         */
+        post(method: "Debugger.setReturnValue", params?: Debugger.SetReturnValueParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setReturnValue", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Enables or disables async call stacks tracking.
+         */
+        post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful.
+         * @experimental
+         */
+        post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted.
+         * @experimental
+         */
+        post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Enables console domain, sends the messages collected so far to the client by means of the <code>messageAdded</code> notification.
+         */
+        post(method: "Console.enable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Disables console domain, prevents further console messages from being reported to the client.
+         */
+        post(method: "Console.disable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Does nothing.
+         */
+        post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void;
+
+        post(method: "Profiler.enable", callback?: (err: Error | null) => void): void;
+
+        post(method: "Profiler.disable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
+         */
+        post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void;
+
+        post(method: "Profiler.start", callback?: (err: Error | null) => void): void;
+
+        post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void;
+
+        /**
+         * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.
+         */
+        post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
+         */
+        post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
+         */
+        post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void;
+
+        /**
+         * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
+         */
+        post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void;
+
+        /**
+         * Enable type profile.
+         * @experimental
+         */
+        post(method: "Profiler.startTypeProfile", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Disable type profile. Disabling releases type profile data collected so far.
+         * @experimental
+         */
+        post(method: "Profiler.stopTypeProfile", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Collect type profile.
+         * @experimental
+         */
+        post(method: "Profiler.takeTypeProfile", callback?: (err: Error | null, params: Profiler.TakeTypeProfileReturnType) => void): void;
+
+        post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void;
+
+        post(
+            method: "HeapProfiler.getObjectByHeapObjectId",
+            params?: HeapProfiler.GetObjectByHeapObjectIdParameterType,
+            callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void
+        ): void;
+        post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void;
+
+        /**
+         * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).
+         */
+        post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
+        post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void;
+
+        post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void;
+
+        post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void;
+
+        post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
+
+        /**
+         * Gets supported tracing categories.
+         */
+        post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
+
+        /**
+         * Start trace events collection.
+         */
+        post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Stop trace events collection. Remaining collected events will be sent as a sequence of
+         * dataCollected events followed by tracingComplete event.
+         */
+        post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Sends protocol message over session with given id.
+         */
+        post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Instructs the inspector to attach to running workers. Will also attach to new workers
+         * as they start
+         */
+        post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Detaches from all running workers and disables attaching to new workers as they are started.
+         */
+        post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Detached from the worker with given sessionId.
+         */
+        post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void;
+
+        /**
+         * Enable the `NodeRuntime.waitingForDisconnect`.
+         */
+        post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
+        post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void;
+
+        // Events
+
+        addListener(event: string, listener: (...args: any[]) => void): this;
+
+        /**
+         * Emitted when any notification from the V8 Inspector is received.
+         */
+        addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
+
+        /**
+         * Issued when new execution context is created.
+         */
+        addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+
+        /**
+         * Issued when execution context is destroyed.
+         */
+        addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+
+        /**
+         * Issued when all executionContexts were cleared in browser
+         */
+        addListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
+
+        /**
+         * Issued when exception was thrown and unhandled.
+         */
+        addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+
+        /**
+         * Issued when unhandled exception was revoked.
+         */
+        addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+
+        /**
+         * Issued when console API was called.
+         */
+        addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+
+        /**
+         * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+         */
+        addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+         */
+        addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine fails to parse the script.
+         */
+        addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+
+        /**
+         * Fired when breakpoint is resolved to an actual script and location.
+         */
+        addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+         */
+        addListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine resumed execution.
+         */
+        addListener(event: "Debugger.resumed", listener: () => void): this;
+
+        /**
+         * Issued when new console message is added.
+         */
+        addListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+
+        /**
+         * Sent when new profile recording is started using console.profile() call.
+         */
+        addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+
+        addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+        addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+        addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
+        addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+         */
+        addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend may send update for one or more fragments
+         */
+        addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+
+        /**
+         * Contains an bucket of collected trace events.
+         */
+        addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+
+        /**
+         * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+         * delivered via dataCollected events.
+         */
+        addListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
+
+        /**
+         * Issued when attached to a worker.
+         */
+        addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+
+        /**
+         * Issued when detached from the worker.
+         */
+        addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+
+        /**
+         * Notifies about a new protocol message received from the session
+         * (session ID is provided in attachedToWorker notification).
+         */
+        addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+
+        /**
+         * This event is fired instead of `Runtime.executionContextDestroyed` when
+         * enabled.
+         * It is fired when the Node process finished all code execution and is
+         * waiting for all frontends to disconnect.
+         */
+        addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean;
+        emit(event: "Runtime.executionContextCreated", message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
+        emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>): boolean;
+        emit(event: "Runtime.executionContextsCleared"): boolean;
+        emit(event: "Runtime.exceptionThrown", message: InspectorNotification<Runtime.ExceptionThrownEventDataType>): boolean;
+        emit(event: "Runtime.exceptionRevoked", message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>): boolean;
+        emit(event: "Runtime.consoleAPICalled", message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>): boolean;
+        emit(event: "Runtime.inspectRequested", message: InspectorNotification<Runtime.InspectRequestedEventDataType>): boolean;
+        emit(event: "Debugger.scriptParsed", message: InspectorNotification<Debugger.ScriptParsedEventDataType>): boolean;
+        emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>): boolean;
+        emit(event: "Debugger.breakpointResolved", message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>): boolean;
+        emit(event: "Debugger.paused", message: InspectorNotification<Debugger.PausedEventDataType>): boolean;
+        emit(event: "Debugger.resumed"): boolean;
+        emit(event: "Console.messageAdded", message: InspectorNotification<Console.MessageAddedEventDataType>): boolean;
+        emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>): boolean;
+        emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>): boolean;
+        emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>): boolean;
+        emit(event: "HeapProfiler.resetProfiles"): boolean;
+        emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
+        emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
+        emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
+        emit(event: "NodeTracing.dataCollected", message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
+        emit(event: "NodeTracing.tracingComplete"): boolean;
+        emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
+        emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
+        emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
+        emit(event: "NodeRuntime.waitingForDisconnect"): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+
+        /**
+         * Emitted when any notification from the V8 Inspector is received.
+         */
+        on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
+
+        /**
+         * Issued when new execution context is created.
+         */
+        on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+
+        /**
+         * Issued when execution context is destroyed.
+         */
+        on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+
+        /**
+         * Issued when all executionContexts were cleared in browser
+         */
+        on(event: "Runtime.executionContextsCleared", listener: () => void): this;
+
+        /**
+         * Issued when exception was thrown and unhandled.
+         */
+        on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+
+        /**
+         * Issued when unhandled exception was revoked.
+         */
+        on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+
+        /**
+         * Issued when console API was called.
+         */
+        on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+
+        /**
+         * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+         */
+        on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+         */
+        on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine fails to parse the script.
+         */
+        on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+
+        /**
+         * Fired when breakpoint is resolved to an actual script and location.
+         */
+        on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+         */
+        on(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine resumed execution.
+         */
+        on(event: "Debugger.resumed", listener: () => void): this;
+
+        /**
+         * Issued when new console message is added.
+         */
+        on(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+
+        /**
+         * Sent when new profile recording is started using console.profile() call.
+         */
+        on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+
+        on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+        on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+        on(event: "HeapProfiler.resetProfiles", listener: () => void): this;
+        on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+         */
+        on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend may send update for one or more fragments
+         */
+        on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+
+        /**
+         * Contains an bucket of collected trace events.
+         */
+        on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+
+        /**
+         * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+         * delivered via dataCollected events.
+         */
+        on(event: "NodeTracing.tracingComplete", listener: () => void): this;
+
+        /**
+         * Issued when attached to a worker.
+         */
+        on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+
+        /**
+         * Issued when detached from the worker.
+         */
+        on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+
+        /**
+         * Notifies about a new protocol message received from the session
+         * (session ID is provided in attachedToWorker notification).
+         */
+        on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+
+        /**
+         * This event is fired instead of `Runtime.executionContextDestroyed` when
+         * enabled.
+         * It is fired when the Node process finished all code execution and is
+         * waiting for all frontends to disconnect.
+         */
+        on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+
+        /**
+         * Emitted when any notification from the V8 Inspector is received.
+         */
+        once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
+
+        /**
+         * Issued when new execution context is created.
+         */
+        once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+
+        /**
+         * Issued when execution context is destroyed.
+         */
+        once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+
+        /**
+         * Issued when all executionContexts were cleared in browser
+         */
+        once(event: "Runtime.executionContextsCleared", listener: () => void): this;
+
+        /**
+         * Issued when exception was thrown and unhandled.
+         */
+        once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+
+        /**
+         * Issued when unhandled exception was revoked.
+         */
+        once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+
+        /**
+         * Issued when console API was called.
+         */
+        once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+
+        /**
+         * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+         */
+        once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+         */
+        once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine fails to parse the script.
+         */
+        once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+
+        /**
+         * Fired when breakpoint is resolved to an actual script and location.
+         */
+        once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+         */
+        once(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine resumed execution.
+         */
+        once(event: "Debugger.resumed", listener: () => void): this;
+
+        /**
+         * Issued when new console message is added.
+         */
+        once(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+
+        /**
+         * Sent when new profile recording is started using console.profile() call.
+         */
+        once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+
+        once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+        once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+        once(event: "HeapProfiler.resetProfiles", listener: () => void): this;
+        once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+         */
+        once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend may send update for one or more fragments
+         */
+        once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+
+        /**
+         * Contains an bucket of collected trace events.
+         */
+        once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+
+        /**
+         * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+         * delivered via dataCollected events.
+         */
+        once(event: "NodeTracing.tracingComplete", listener: () => void): this;
+
+        /**
+         * Issued when attached to a worker.
+         */
+        once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+
+        /**
+         * Issued when detached from the worker.
+         */
+        once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+
+        /**
+         * Notifies about a new protocol message received from the session
+         * (session ID is provided in attachedToWorker notification).
+         */
+        once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+
+        /**
+         * This event is fired instead of `Runtime.executionContextDestroyed` when
+         * enabled.
+         * It is fired when the Node process finished all code execution and is
+         * waiting for all frontends to disconnect.
+         */
+        once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+
+        /**
+         * Emitted when any notification from the V8 Inspector is received.
+         */
+        prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
+
+        /**
+         * Issued when new execution context is created.
+         */
+        prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+
+        /**
+         * Issued when execution context is destroyed.
+         */
+        prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+
+        /**
+         * Issued when all executionContexts were cleared in browser
+         */
+        prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
+
+        /**
+         * Issued when exception was thrown and unhandled.
+         */
+        prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+
+        /**
+         * Issued when unhandled exception was revoked.
+         */
+        prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+
+        /**
+         * Issued when console API was called.
+         */
+        prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+
+        /**
+         * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+         */
+        prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+         */
+        prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine fails to parse the script.
+         */
+        prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+
+        /**
+         * Fired when breakpoint is resolved to an actual script and location.
+         */
+        prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+         */
+        prependListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine resumed execution.
+         */
+        prependListener(event: "Debugger.resumed", listener: () => void): this;
+
+        /**
+         * Issued when new console message is added.
+         */
+        prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+
+        /**
+         * Sent when new profile recording is started using console.profile() call.
+         */
+        prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+
+        prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+        prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+        prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
+        prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+         */
+        prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend may send update for one or more fragments
+         */
+        prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+
+        /**
+         * Contains an bucket of collected trace events.
+         */
+        prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+
+        /**
+         * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+         * delivered via dataCollected events.
+         */
+        prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
+
+        /**
+         * Issued when attached to a worker.
+         */
+        prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+
+        /**
+         * Issued when detached from the worker.
+         */
+        prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+
+        /**
+         * Notifies about a new protocol message received from the session
+         * (session ID is provided in attachedToWorker notification).
+         */
+        prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+
+        /**
+         * This event is fired instead of `Runtime.executionContextDestroyed` when
+         * enabled.
+         * It is fired when the Node process finished all code execution and is
+         * waiting for all frontends to disconnect.
+         */
+        prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+
+        /**
+         * Emitted when any notification from the V8 Inspector is received.
+         */
+        prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this;
+
+        /**
+         * Issued when new execution context is created.
+         */
+        prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>) => void): this;
+
+        /**
+         * Issued when execution context is destroyed.
+         */
+        prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification<Runtime.ExecutionContextDestroyedEventDataType>) => void): this;
+
+        /**
+         * Issued when all executionContexts were cleared in browser
+         */
+        prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this;
+
+        /**
+         * Issued when exception was thrown and unhandled.
+         */
+        prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification<Runtime.ExceptionThrownEventDataType>) => void): this;
+
+        /**
+         * Issued when unhandled exception was revoked.
+         */
+        prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification<Runtime.ExceptionRevokedEventDataType>) => void): this;
+
+        /**
+         * Issued when console API was called.
+         */
+        prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification<Runtime.ConsoleAPICalledEventDataType>) => void): this;
+
+        /**
+         * Issued when object should be inspected (for example, as a result of inspect() command line API call).
+         */
+        prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification<Runtime.InspectRequestedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger.
+         */
+        prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification<Debugger.ScriptParsedEventDataType>) => void): this;
+
+        /**
+         * Fired when virtual machine fails to parse the script.
+         */
+        prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification<Debugger.ScriptFailedToParseEventDataType>) => void): this;
+
+        /**
+         * Fired when breakpoint is resolved to an actual script and location.
+         */
+        prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification<Debugger.BreakpointResolvedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria.
+         */
+        prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification<Debugger.PausedEventDataType>) => void): this;
+
+        /**
+         * Fired when the virtual machine resumed execution.
+         */
+        prependOnceListener(event: "Debugger.resumed", listener: () => void): this;
+
+        /**
+         * Issued when new console message is added.
+         */
+        prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification<Console.MessageAddedEventDataType>) => void): this;
+
+        /**
+         * Sent when new profile recording is started using console.profile() call.
+         */
+        prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification<Profiler.ConsoleProfileStartedEventDataType>) => void): this;
+
+        prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification<Profiler.ConsoleProfileFinishedEventDataType>) => void): this;
+        prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification<HeapProfiler.AddHeapSnapshotChunkEventDataType>) => void): this;
+        prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this;
+        prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.
+         */
+        prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>) => void): this;
+
+        /**
+         * If heap objects tracking has been started then backend may send update for one or more fragments
+         */
+        prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
+
+        /**
+         * Contains an bucket of collected trace events.
+         */
+        prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
+
+        /**
+         * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
+         * delivered via dataCollected events.
+         */
+        prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
+
+        /**
+         * Issued when attached to a worker.
+         */
+        prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
+
+        /**
+         * Issued when detached from the worker.
+         */
+        prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
+
+        /**
+         * Notifies about a new protocol message received from the session
+         * (session ID is provided in attachedToWorker notification).
+         */
+        prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
+
+        /**
+         * This event is fired instead of `Runtime.executionContextDestroyed` when
+         * enabled.
+         * It is fired when the Node process finished all code execution and is
+         * waiting for all frontends to disconnect.
+         */
+        prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
+    }
+
+    // Top Level API
+
+    /**
+     * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started.
+     * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client.
+     * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI.
+     * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI.
+     * @param wait Block until a client has connected. Optional, defaults to false.
+     */
+    function open(port?: number, host?: string, wait?: boolean): void;
+
+    /**
+     * Deactivate the inspector. Blocks until there are no active connections.
+     */
+    function close(): void;
+
+    /**
+     * Return the URL of the active inspector, or `undefined` if there is none.
+     */
+    function url(): string | undefined;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/module.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/module.d.ts
new file mode 100644 (file)
index 0000000..2654f42
--- /dev/null
@@ -0,0 +1,58 @@
+declare module "module" {
+    import { URL } from "url";
+    namespace Module {
+        /**
+         * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
+         * It does not add or remove exported names from the ES Modules.
+         */
+        function syncBuiltinESMExports(): void;
+
+        /**
+         * @experimental
+         */
+        function findSourceMap(path: string, error?: Error): SourceMap;
+        interface SourceMapPayload {
+            file: string;
+            version: number;
+            sources: string[];
+            sourcesContent: string[];
+            names: string[];
+            mappings: string;
+            sourceRoot: string;
+        }
+
+        interface SourceMapping {
+            generatedLine: number;
+            generatedColumn: number;
+            originalSource: string;
+            originalLine: number;
+            originalColumn: number;
+        }
+
+        /**
+         * @experimental
+         */
+        class SourceMap {
+            readonly payload: SourceMapPayload;
+            constructor(payload: SourceMapPayload);
+            findEntry(line: number, column: number): SourceMapping;
+        }
+    }
+    interface Module extends NodeModule {}
+    class Module {
+        static runMain(): void;
+        static wrap(code: string): string;
+
+        /**
+         * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
+         */
+        static createRequireFromPath(path: string): NodeRequire;
+        static createRequire(path: string | URL): NodeRequire;
+        static builtinModules: string[];
+
+        static Module: typeof Module;
+
+        constructor(id: string, parent?: Module);
+    }
+    export = Module;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/net.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/net.d.ts
new file mode 100644 (file)
index 0000000..8eb5c7b
--- /dev/null
@@ -0,0 +1,268 @@
+declare module "net" {
+    import * as stream from "stream";
+    import * as events from "events";
+    import * as dns from "dns";
+
+    type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
+
+    interface AddressInfo {
+        address: string;
+        family: string;
+        port: number;
+    }
+
+    interface SocketConstructorOpts {
+        fd?: number;
+        allowHalfOpen?: boolean;
+        readable?: boolean;
+        writable?: boolean;
+    }
+
+    interface OnReadOpts {
+        buffer: Uint8Array | (() => Uint8Array);
+        /**
+         * This function is called for every chunk of incoming data.
+         * Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
+         * Return false from this function to implicitly pause() the socket.
+         */
+        callback(bytesWritten: number, buf: Uint8Array): boolean;
+    }
+
+    interface ConnectOpts {
+        /**
+         * If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
+         * Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
+         * still be emitted as normal and methods like pause() and resume() will also behave as expected.
+         */
+        onread?: OnReadOpts;
+    }
+
+    interface TcpSocketConnectOpts extends ConnectOpts {
+        port: number;
+        host?: string;
+        localAddress?: string;
+        localPort?: number;
+        hints?: number;
+        family?: number;
+        lookup?: LookupFunction;
+    }
+
+    interface IpcSocketConnectOpts extends ConnectOpts {
+        path: string;
+    }
+
+    type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts;
+
+    class Socket extends stream.Duplex {
+        constructor(options?: SocketConstructorOpts);
+
+        // Extended base methods
+        write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
+        write(str: Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
+
+        connect(options: SocketConnectOpts, connectionListener?: () => void): this;
+        connect(port: number, host: string, connectionListener?: () => void): this;
+        connect(port: number, connectionListener?: () => void): this;
+        connect(path: string, connectionListener?: () => void): this;
+
+        setEncoding(encoding?: string): this;
+        pause(): this;
+        resume(): this;
+        setTimeout(timeout: number, callback?: () => void): this;
+        setNoDelay(noDelay?: boolean): this;
+        setKeepAlive(enable?: boolean, initialDelay?: number): this;
+        address(): AddressInfo | string;
+        unref(): this;
+        ref(): this;
+
+        readonly bufferSize: number;
+        readonly bytesRead: number;
+        readonly bytesWritten: number;
+        readonly connecting: boolean;
+        readonly destroyed: boolean;
+        readonly localAddress: string;
+        readonly localPort: number;
+        readonly remoteAddress?: string;
+        readonly remoteFamily?: string;
+        readonly remotePort?: number;
+
+        // Extended base methods
+        end(cb?: () => void): void;
+        end(buffer: Uint8Array | string, cb?: () => void): void;
+        end(str: Uint8Array | string, encoding?: string, cb?: () => void): void;
+
+        /**
+         * events.EventEmitter
+         *   1. close
+         *   2. connect
+         *   3. data
+         *   4. drain
+         *   5. end
+         *   6. error
+         *   7. lookup
+         *   8. timeout
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "close", listener: (had_error: boolean) => void): this;
+        addListener(event: "connect", listener: () => void): this;
+        addListener(event: "data", listener: (data: Buffer) => void): this;
+        addListener(event: "drain", listener: () => void): this;
+        addListener(event: "end", listener: () => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+        addListener(event: "timeout", listener: () => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "close", had_error: boolean): boolean;
+        emit(event: "connect"): boolean;
+        emit(event: "data", data: Buffer): boolean;
+        emit(event: "drain"): boolean;
+        emit(event: "end"): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
+        emit(event: "timeout"): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "close", listener: (had_error: boolean) => void): this;
+        on(event: "connect", listener: () => void): this;
+        on(event: "data", listener: (data: Buffer) => void): this;
+        on(event: "drain", listener: () => void): this;
+        on(event: "end", listener: () => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+        on(event: "timeout", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "close", listener: (had_error: boolean) => void): this;
+        once(event: "connect", listener: () => void): this;
+        once(event: "data", listener: (data: Buffer) => void): this;
+        once(event: "drain", listener: () => void): this;
+        once(event: "end", listener: () => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+        once(event: "timeout", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "close", listener: (had_error: boolean) => void): this;
+        prependListener(event: "connect", listener: () => void): this;
+        prependListener(event: "data", listener: (data: Buffer) => void): this;
+        prependListener(event: "drain", listener: () => void): this;
+        prependListener(event: "end", listener: () => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+        prependListener(event: "timeout", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "close", listener: (had_error: boolean) => void): this;
+        prependOnceListener(event: "connect", listener: () => void): this;
+        prependOnceListener(event: "data", listener: (data: Buffer) => void): this;
+        prependOnceListener(event: "drain", listener: () => void): this;
+        prependOnceListener(event: "end", listener: () => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
+        prependOnceListener(event: "timeout", listener: () => void): this;
+    }
+
+    interface ListenOptions {
+        port?: number;
+        host?: string;
+        backlog?: number;
+        path?: string;
+        exclusive?: boolean;
+        readableAll?: boolean;
+        writableAll?: boolean;
+        /**
+         * @default false
+         */
+        ipv6Only?: boolean;
+    }
+
+    // https://github.com/nodejs/node/blob/master/lib/net.js
+    class Server extends events.EventEmitter {
+        constructor(connectionListener?: (socket: Socket) => void);
+        constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
+
+        listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
+        listen(port?: number, hostname?: string, listeningListener?: () => void): this;
+        listen(port?: number, backlog?: number, listeningListener?: () => void): this;
+        listen(port?: number, listeningListener?: () => void): this;
+        listen(path: string, backlog?: number, listeningListener?: () => void): this;
+        listen(path: string, listeningListener?: () => void): this;
+        listen(options: ListenOptions, listeningListener?: () => void): this;
+        listen(handle: any, backlog?: number, listeningListener?: () => void): this;
+        listen(handle: any, listeningListener?: () => void): this;
+        close(callback?: (err?: Error) => void): this;
+        address(): AddressInfo | string | null;
+        getConnections(cb: (error: Error | null, count: number) => void): void;
+        ref(): this;
+        unref(): this;
+        maxConnections: number;
+        connections: number;
+        listening: boolean;
+
+        /**
+         * events.EventEmitter
+         *   1. close
+         *   2. connection
+         *   3. error
+         *   4. listening
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "connection", listener: (socket: Socket) => void): this;
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "listening", listener: () => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "close"): boolean;
+        emit(event: "connection", socket: Socket): boolean;
+        emit(event: "error", err: Error): boolean;
+        emit(event: "listening"): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "close", listener: () => void): this;
+        on(event: "connection", listener: (socket: Socket) => void): this;
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "listening", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "close", listener: () => void): this;
+        once(event: "connection", listener: (socket: Socket) => void): this;
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "listening", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "connection", listener: (socket: Socket) => void): this;
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "listening", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "connection", listener: (socket: Socket) => void): this;
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "listening", listener: () => void): this;
+    }
+
+    interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts {
+        timeout?: number;
+    }
+
+    interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts {
+        timeout?: number;
+    }
+
+    type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
+
+    function createServer(connectionListener?: (socket: Socket) => void): Server;
+    function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
+    function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
+    function connect(port: number, host?: string, connectionListener?: () => void): Socket;
+    function connect(path: string, connectionListener?: () => void): Socket;
+    function createConnection(options: NetConnectOpts, connectionListener?: () => void): Socket;
+    function createConnection(port: number, host?: string, connectionListener?: () => void): Socket;
+    function createConnection(path: string, connectionListener?: () => void): Socket;
+    function isIP(input: string): number;
+    function isIPv4(input: string): boolean;
+    function isIPv6(input: string): boolean;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/os.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/os.d.ts
new file mode 100644 (file)
index 0000000..d98a145
--- /dev/null
@@ -0,0 +1,239 @@
+declare module "os" {
+    interface CpuInfo {
+        model: string;
+        speed: number;
+        times: {
+            user: number;
+            nice: number;
+            sys: number;
+            idle: number;
+            irq: number;
+        };
+    }
+
+    interface NetworkInterfaceBase {
+        address: string;
+        netmask: string;
+        mac: string;
+        internal: boolean;
+        cidr: string | null;
+    }
+
+    interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
+        family: "IPv4";
+    }
+
+    interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
+        family: "IPv6";
+        scopeid: number;
+    }
+
+    interface UserInfo<T> {
+        username: T;
+        uid: number;
+        gid: number;
+        shell: T;
+        homedir: T;
+    }
+
+    type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
+
+    function hostname(): string;
+    function loadavg(): number[];
+    function uptime(): number;
+    function freemem(): number;
+    function totalmem(): number;
+    function cpus(): CpuInfo[];
+    function type(): string;
+    function release(): string;
+    function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
+    function homedir(): string;
+    function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
+    function userInfo(options?: { encoding: string }): UserInfo<string>;
+
+    type SignalConstants = {
+        [key in NodeJS.Signals]: number;
+    };
+
+    namespace constants {
+        const UV_UDP_REUSEADDR: number;
+        namespace signals {}
+        const signals: SignalConstants;
+        namespace errno {
+            const E2BIG: number;
+            const EACCES: number;
+            const EADDRINUSE: number;
+            const EADDRNOTAVAIL: number;
+            const EAFNOSUPPORT: number;
+            const EAGAIN: number;
+            const EALREADY: number;
+            const EBADF: number;
+            const EBADMSG: number;
+            const EBUSY: number;
+            const ECANCELED: number;
+            const ECHILD: number;
+            const ECONNABORTED: number;
+            const ECONNREFUSED: number;
+            const ECONNRESET: number;
+            const EDEADLK: number;
+            const EDESTADDRREQ: number;
+            const EDOM: number;
+            const EDQUOT: number;
+            const EEXIST: number;
+            const EFAULT: number;
+            const EFBIG: number;
+            const EHOSTUNREACH: number;
+            const EIDRM: number;
+            const EILSEQ: number;
+            const EINPROGRESS: number;
+            const EINTR: number;
+            const EINVAL: number;
+            const EIO: number;
+            const EISCONN: number;
+            const EISDIR: number;
+            const ELOOP: number;
+            const EMFILE: number;
+            const EMLINK: number;
+            const EMSGSIZE: number;
+            const EMULTIHOP: number;
+            const ENAMETOOLONG: number;
+            const ENETDOWN: number;
+            const ENETRESET: number;
+            const ENETUNREACH: number;
+            const ENFILE: number;
+            const ENOBUFS: number;
+            const ENODATA: number;
+            const ENODEV: number;
+            const ENOENT: number;
+            const ENOEXEC: number;
+            const ENOLCK: number;
+            const ENOLINK: number;
+            const ENOMEM: number;
+            const ENOMSG: number;
+            const ENOPROTOOPT: number;
+            const ENOSPC: number;
+            const ENOSR: number;
+            const ENOSTR: number;
+            const ENOSYS: number;
+            const ENOTCONN: number;
+            const ENOTDIR: number;
+            const ENOTEMPTY: number;
+            const ENOTSOCK: number;
+            const ENOTSUP: number;
+            const ENOTTY: number;
+            const ENXIO: number;
+            const EOPNOTSUPP: number;
+            const EOVERFLOW: number;
+            const EPERM: number;
+            const EPIPE: number;
+            const EPROTO: number;
+            const EPROTONOSUPPORT: number;
+            const EPROTOTYPE: number;
+            const ERANGE: number;
+            const EROFS: number;
+            const ESPIPE: number;
+            const ESRCH: number;
+            const ESTALE: number;
+            const ETIME: number;
+            const ETIMEDOUT: number;
+            const ETXTBSY: number;
+            const EWOULDBLOCK: number;
+            const EXDEV: number;
+            const WSAEINTR: number;
+            const WSAEBADF: number;
+            const WSAEACCES: number;
+            const WSAEFAULT: number;
+            const WSAEINVAL: number;
+            const WSAEMFILE: number;
+            const WSAEWOULDBLOCK: number;
+            const WSAEINPROGRESS: number;
+            const WSAEALREADY: number;
+            const WSAENOTSOCK: number;
+            const WSAEDESTADDRREQ: number;
+            const WSAEMSGSIZE: number;
+            const WSAEPROTOTYPE: number;
+            const WSAENOPROTOOPT: number;
+            const WSAEPROTONOSUPPORT: number;
+            const WSAESOCKTNOSUPPORT: number;
+            const WSAEOPNOTSUPP: number;
+            const WSAEPFNOSUPPORT: number;
+            const WSAEAFNOSUPPORT: number;
+            const WSAEADDRINUSE: number;
+            const WSAEADDRNOTAVAIL: number;
+            const WSAENETDOWN: number;
+            const WSAENETUNREACH: number;
+            const WSAENETRESET: number;
+            const WSAECONNABORTED: number;
+            const WSAECONNRESET: number;
+            const WSAENOBUFS: number;
+            const WSAEISCONN: number;
+            const WSAENOTCONN: number;
+            const WSAESHUTDOWN: number;
+            const WSAETOOMANYREFS: number;
+            const WSAETIMEDOUT: number;
+            const WSAECONNREFUSED: number;
+            const WSAELOOP: number;
+            const WSAENAMETOOLONG: number;
+            const WSAEHOSTDOWN: number;
+            const WSAEHOSTUNREACH: number;
+            const WSAENOTEMPTY: number;
+            const WSAEPROCLIM: number;
+            const WSAEUSERS: number;
+            const WSAEDQUOT: number;
+            const WSAESTALE: number;
+            const WSAEREMOTE: number;
+            const WSASYSNOTREADY: number;
+            const WSAVERNOTSUPPORTED: number;
+            const WSANOTINITIALISED: number;
+            const WSAEDISCON: number;
+            const WSAENOMORE: number;
+            const WSAECANCELLED: number;
+            const WSAEINVALIDPROCTABLE: number;
+            const WSAEINVALIDPROVIDER: number;
+            const WSAEPROVIDERFAILEDINIT: number;
+            const WSASYSCALLFAILURE: number;
+            const WSASERVICE_NOT_FOUND: number;
+            const WSATYPE_NOT_FOUND: number;
+            const WSA_E_NO_MORE: number;
+            const WSA_E_CANCELLED: number;
+            const WSAEREFUSED: number;
+        }
+        namespace priority {
+            const PRIORITY_LOW: number;
+            const PRIORITY_BELOW_NORMAL: number;
+            const PRIORITY_NORMAL: number;
+            const PRIORITY_ABOVE_NORMAL: number;
+            const PRIORITY_HIGH: number;
+            const PRIORITY_HIGHEST: number;
+        }
+    }
+
+    function arch(): string;
+    /**
+     * Returns a string identifying the kernel version.
+     * On POSIX systems, the operating system release is determined by calling
+     * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available,
+     * `GetVersionExW()` will be used. See
+     * https://en.wikipedia.org/wiki/Uname#Examples for more information.
+     */
+    function version(): string;
+    function platform(): NodeJS.Platform;
+    function tmpdir(): string;
+    const EOL: string;
+    function endianness(): "BE" | "LE";
+    /**
+     * Gets the priority of a process.
+     * Defaults to current process.
+     */
+    function getPriority(pid?: number): number;
+    /**
+     * Sets the priority of the current process.
+     * @param priority Must be in range of -20 to 19
+     */
+    function setPriority(priority: number): void;
+    /**
+     * Sets the priority of the process specified process.
+     * @param priority Must be in range of -20 to 19
+     */
+    function setPriority(pid: number, priority: number): void;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/package.json b/legacy-libs/protobufjs/node_modules/@types/node/package.json
new file mode 100644 (file)
index 0000000..ddd9738
--- /dev/null
@@ -0,0 +1,270 @@
+{
+  "_args": [
+    [
+      {
+        "raw": "@types/node@^13.7.0",
+        "scope": "@types",
+        "escapedName": "@types%2fnode",
+        "name": "@types/node",
+        "rawSpec": "^13.7.0",
+        "spec": ">=13.7.0 <14.0.0",
+        "type": "range"
+      },
+      "/var/opt/motion2/node_modules/protobufjs"
+    ]
+  ],
+  "_from": "@types/node@>=13.7.0 <14.0.0",
+  "_hasShrinkwrap": false,
+  "_id": "@types/node@13.13.38",
+  "_inCache": true,
+  "_location": "/protobufjs/@types/node",
+  "_npmOperationalInternal": {
+    "host": "s3://npm-registry-packages",
+    "tmp": "tmp/node_13.13.38_1608755122629_0.3436982029522171"
+  },
+  "_npmUser": {
+    "name": "types",
+    "email": "ts-npm-types@microsoft.com"
+  },
+  "_phantomChildren": {},
+  "_requested": {
+    "raw": "@types/node@^13.7.0",
+    "scope": "@types",
+    "escapedName": "@types%2fnode",
+    "name": "@types/node",
+    "rawSpec": "^13.7.0",
+    "spec": ">=13.7.0 <14.0.0",
+    "type": "range"
+  },
+  "_requiredBy": [
+    "/protobufjs"
+  ],
+  "_resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.38.tgz",
+  "_shasum": "66a7c068305dbd64cf167d0f6b6b6be71dd453e1",
+  "_shrinkwrap": null,
+  "_spec": "@types/node@^13.7.0",
+  "_where": "/var/opt/motion2/node_modules/protobufjs",
+  "bugs": {
+    "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
+  },
+  "contributors": [
+    {
+      "name": "Microsoft TypeScript",
+      "url": "https://github.com/Microsoft"
+    },
+    {
+      "name": "DefinitelyTyped",
+      "url": "https://github.com/DefinitelyTyped"
+    },
+    {
+      "name": "Alberto Schiabel",
+      "url": "https://github.com/jkomyno"
+    },
+    {
+      "name": "Alexander T.",
+      "url": "https://github.com/a-tarasyuk"
+    },
+    {
+      "name": "Alvis HT Tang",
+      "url": "https://github.com/alvis"
+    },
+    {
+      "name": "Andrew Makarov",
+      "url": "https://github.com/r3nya"
+    },
+    {
+      "name": "Benjamin Toueg",
+      "url": "https://github.com/btoueg"
+    },
+    {
+      "name": "Bruno Scheufler",
+      "url": "https://github.com/brunoscheufler"
+    },
+    {
+      "name": "Chigozirim C.",
+      "url": "https://github.com/smac89"
+    },
+    {
+      "name": "Christian Vaagland Tellnes",
+      "url": "https://github.com/tellnes"
+    },
+    {
+      "name": "David Junger",
+      "url": "https://github.com/touffy"
+    },
+    {
+      "name": "Deividas Bakanas",
+      "url": "https://github.com/DeividasBakanas"
+    },
+    {
+      "name": "Eugene Y. Q. Shen",
+      "url": "https://github.com/eyqs"
+    },
+    {
+      "name": "Flarna",
+      "url": "https://github.com/Flarna"
+    },
+    {
+      "name": "Hannes Magnusson",
+      "url": "https://github.com/Hannes-Magnusson-CK"
+    },
+    {
+      "name": "Hoàng Văn Khải",
+      "url": "https://github.com/KSXGitHub"
+    },
+    {
+      "name": "Huw",
+      "url": "https://github.com/hoo29"
+    },
+    {
+      "name": "Kelvin Jin",
+      "url": "https://github.com/kjin"
+    },
+    {
+      "name": "Klaus Meinhardt",
+      "url": "https://github.com/ajafff"
+    },
+    {
+      "name": "Lishude",
+      "url": "https://github.com/islishude"
+    },
+    {
+      "name": "Mariusz Wiktorczyk",
+      "url": "https://github.com/mwiktorczyk"
+    },
+    {
+      "name": "Mohsen Azimi",
+      "url": "https://github.com/mohsen1"
+    },
+    {
+      "name": "Nicolas Even",
+      "url": "https://github.com/n-e"
+    },
+    {
+      "name": "Nikita Galkin",
+      "url": "https://github.com/galkin"
+    },
+    {
+      "name": "Parambir Singh",
+      "url": "https://github.com/parambirs"
+    },
+    {
+      "name": "Sebastian Silbermann",
+      "url": "https://github.com/eps1lon"
+    },
+    {
+      "name": "Simon Schick",
+      "url": "https://github.com/SimonSchick"
+    },
+    {
+      "name": "Thomas den Hollander",
+      "url": "https://github.com/ThomasdenH"
+    },
+    {
+      "name": "Wilco Bakker",
+      "url": "https://github.com/WilcoBakker"
+    },
+    {
+      "name": "wwwy3y3",
+      "url": "https://github.com/wwwy3y3"
+    },
+    {
+      "name": "Samuel Ainsworth",
+      "url": "https://github.com/samuela"
+    },
+    {
+      "name": "Kyle Uehlein",
+      "url": "https://github.com/kuehlein"
+    },
+    {
+      "name": "Jordi Oliveras Rovira",
+      "url": "https://github.com/j-oliveras"
+    },
+    {
+      "name": "Thanik Bhongbhibhat",
+      "url": "https://github.com/bhongy"
+    },
+    {
+      "name": "Marcin Kopacz",
+      "url": "https://github.com/chyzwar"
+    },
+    {
+      "name": "Trivikram Kamat",
+      "url": "https://github.com/trivikr"
+    },
+    {
+      "name": "Minh Son Nguyen",
+      "url": "https://github.com/nguymin4"
+    },
+    {
+      "name": "Junxiao Shi",
+      "url": "https://github.com/yoursunny"
+    },
+    {
+      "name": "Ilia Baryshnikov",
+      "url": "https://github.com/qwelias"
+    },
+    {
+      "name": "ExE Boss",
+      "url": "https://github.com/ExE-Boss"
+    },
+    {
+      "name": "Surasak Chaisurin",
+      "url": "https://github.com/Ryan-Willpower"
+    },
+    {
+      "name": "Piotr Błażejewicz",
+      "url": "https://github.com/peterblazejewicz"
+    },
+    {
+      "name": "Jason Kwok",
+      "url": "https://github.com/JasonHK"
+    }
+  ],
+  "dependencies": {},
+  "description": "TypeScript definitions for Node.js",
+  "devDependencies": {},
+  "directories": {},
+  "dist": {
+    "integrity": "sha512-oxo8j9doh7ab9NwDA9bCeFfjHRF/uzk+fTljCy8lMjZ3YzZGAXNDKhTE3Byso/oy32UTUQIXB3HCVHu3d2T3xg==",
+    "shasum": "66a7c068305dbd64cf167d0f6b6b6be71dd453e1",
+    "tarball": "https://registry.npmjs.org/@types/node/-/node-13.13.38.tgz",
+    "fileCount": 55,
+    "unpackedSize": 710416,
+    "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf46ezCRA9TVsSAnZWagAASDYP/3OC7Nvlei0Hcov0zCZV\nPeKnwVJCbmImCTcpPobkX+TCG8k4KqY0ZOLvVO/uYzpTx5KBW02GvbSiXiev\nTAoTCVetXZ+yU6Jm8qOXwwvHG11vRZMB4w3ii/JCIyUjt4oQzhfWU8RWsx5v\n5eqY75p2AjPpBnR0nzGDa7GJHZvgQ8ZKsRNvxpHcM/BZfEuwsqp8dntRK96D\nhFqC4TzMwnzHPLfREtub2HxQfX1hI3x8xRKweZk3yh6KA2xpS10BVDW8MvnB\nrSmQHf1PLLy9IG1hd+fCsZfSLJVFCTLlFs8xdcXQMvDLoSJoCysytvXlwPhS\nrZhqnms+jfH/xc4uk0c0yP3HLZVdsX+330iBaKJAtd7Pcad2iq5Ii4DUN8ad\nDENhYwGAGtwphnw3KbLSept1i+xn2xCeCsPh/l25kRRg6JKKrC3LYzdY0ORT\nDXMRaVoa/sM2ub4Vh4b/j0iRf9Cmgabkvx3qBuewQWwxVxs5ZABXs/NQIU1k\n3/zazWkPqWMZWl+cv5QY8sa6RZGClQe6inhD+K/C/8ONDh87HkPIn1rPy7z1\nfaBWV+WJucRdLNiw68ZJd5K3YuXPNXisysJ58GwnosBTk36GPSP2fh52LdDx\nttOE8+h41FXw+5FVv5q2Nsv3x3YVINZtx5IJ7LW7qPxGKl81mUUYoBpl4kYw\nO7ui\r\n=PGJJ\r\n-----END PGP SIGNATURE-----\r\n"
+  },
+  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
+  "license": "MIT",
+  "main": "",
+  "maintainers": [
+    {
+      "name": "types",
+      "email": "ts-npm-types@microsoft.com"
+    }
+  ],
+  "name": "@types/node",
+  "optionalDependencies": {},
+  "readme": "ERROR: No README data found!",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
+    "directory": "types/node"
+  },
+  "scripts": {},
+  "typeScriptVersion": "3.3",
+  "types": "index.d.ts",
+  "typesPublisherContentHash": "2f0a913abc06b00df8bc39ba0c81a72f72e621b42107bdaffb48eccf1a999af7",
+  "typesVersions": {
+    "<=3.4": {
+      "*": [
+        "ts3.4/*"
+      ]
+    },
+    "<=3.6": {
+      "*": [
+        "ts3.6/*"
+      ]
+    }
+  },
+  "version": "13.13.38"
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/path.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/path.d.ts
new file mode 100644 (file)
index 0000000..0273d58
--- /dev/null
@@ -0,0 +1,153 @@
+declare module "path" {
+    namespace path {
+        /**
+         * A parsed path object generated by path.parse() or consumed by path.format().
+         */
+        interface ParsedPath {
+            /**
+             * The root of the path such as '/' or 'c:\'
+             */
+            root: string;
+            /**
+             * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+             */
+            dir: string;
+            /**
+             * The file name including extension (if any) such as 'index.html'
+             */
+            base: string;
+            /**
+             * The file extension (if any) such as '.html'
+             */
+            ext: string;
+            /**
+             * The file name without extension (if any) such as 'index'
+             */
+            name: string;
+        }
+
+        interface FormatInputPathObject {
+            /**
+             * The root of the path such as '/' or 'c:\'
+             */
+            root?: string;
+            /**
+             * The full directory path such as '/home/user/dir' or 'c:\path\dir'
+             */
+            dir?: string;
+            /**
+             * The file name including extension (if any) such as 'index.html'
+             */
+            base?: string;
+            /**
+             * The file extension (if any) such as '.html'
+             */
+            ext?: string;
+            /**
+             * The file name without extension (if any) such as 'index'
+             */
+            name?: string;
+        }
+
+        interface PlatformPath {
+            /**
+             * Normalize a string path, reducing '..' and '.' parts.
+             * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
+             *
+             * @param p string path to normalize.
+             */
+            normalize(p: string): string;
+            /**
+             * Join all arguments together and normalize the resulting path.
+             * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
+             *
+             * @param paths paths to join.
+             */
+            join(...paths: string[]): string;
+            /**
+             * The right-most parameter is considered {to}.  Other parameters are considered an array of {from}.
+             *
+             * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
+             *
+             * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
+             * until an absolute path is found. If after using all {from} paths still no absolute path is found,
+             * the current working directory is used as well. The resulting path is normalized,
+             * and trailing slashes are removed unless the path gets resolved to the root directory.
+             *
+             * @param pathSegments string paths to join.  Non-string arguments are ignored.
+             */
+            resolve(...pathSegments: string[]): string;
+            /**
+             * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
+             *
+             * @param path path to test.
+             */
+            isAbsolute(p: string): boolean;
+            /**
+             * Solve the relative path from {from} to {to}.
+             * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
+             */
+            relative(from: string, to: string): string;
+            /**
+             * Return the directory name of a path. Similar to the Unix dirname command.
+             *
+             * @param p the path to evaluate.
+             */
+            dirname(p: string): string;
+            /**
+             * Return the last portion of a path. Similar to the Unix basename command.
+             * Often used to extract the file name from a fully qualified path.
+             *
+             * @param p the path to evaluate.
+             * @param ext optionally, an extension to remove from the result.
+             */
+            basename(p: string, ext?: string): string;
+            /**
+             * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
+             * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
+             *
+             * @param p the path to evaluate.
+             */
+            extname(p: string): string;
+            /**
+             * The platform-specific file separator. '\\' or '/'.
+             */
+            readonly sep: string;
+            /**
+             * The platform-specific file delimiter. ';' or ':'.
+             */
+            readonly delimiter: string;
+            /**
+             * Returns an object from a path string - the opposite of format().
+             *
+             * @param pathString path to evaluate.
+             */
+            parse(p: string): ParsedPath;
+            /**
+             * Returns a path string from an object - the opposite of parse().
+             *
+             * @param pathString path to evaluate.
+             */
+            format(pP: FormatInputPathObject): string;
+            /**
+             * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
+             * If path is not a string, path will be returned without modifications.
+             * This method is meaningful only on Windows system.
+             * On POSIX systems, the method is non-operational and always returns path without modifications.
+             */
+            toNamespacedPath(path: string): string;
+            /**
+             * Posix specific pathing.
+             * Same as parent object on posix.
+             */
+            readonly posix: PlatformPath;
+            /**
+             * Windows specific pathing.
+             * Same as parent object on windows
+             */
+            readonly win32: PlatformPath;
+        }
+    }
+    const path: path.PlatformPath;
+    export = path;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/perf_hooks.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/perf_hooks.d.ts
new file mode 100644 (file)
index 0000000..a12082e
--- /dev/null
@@ -0,0 +1,255 @@
+declare module 'perf_hooks' {
+    import { AsyncResource } from 'async_hooks';
+
+    type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
+
+    interface PerformanceEntry {
+        /**
+         * The total number of milliseconds elapsed for this entry.
+         * This value will not be meaningful for all Performance Entry types.
+         */
+        readonly duration: number;
+
+        /**
+         * The name of the performance entry.
+         */
+        readonly name: string;
+
+        /**
+         * The high resolution millisecond timestamp marking the starting time of the Performance Entry.
+         */
+        readonly startTime: number;
+
+        /**
+         * The type of the performance entry.
+         * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'.
+         */
+        readonly entryType: EntryType;
+
+        /**
+         * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
+         * the type of garbage collection operation that occurred.
+         * See perf_hooks.constants for valid values.
+         */
+        readonly kind?: number;
+
+        /**
+         * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
+         * property contains additional information about garbage collection operation.
+         * See perf_hooks.constants for valid values.
+         */
+        readonly flags?: number;
+    }
+
+    interface PerformanceNodeTiming extends PerformanceEntry {
+        /**
+         * The high resolution millisecond timestamp at which the Node.js process completed bootstrap.
+         * If bootstrapping has not yet finished, the property has the value of -1.
+         */
+        readonly bootstrapComplete: number;
+
+        /**
+         * The high resolution millisecond timestamp at which the Node.js process completed bootstrapping.
+         * If bootstrapping has not yet finished, the property has the value of -1.
+         */
+        readonly environment: number;
+
+        /**
+         * The high resolution millisecond timestamp at which the Node.js event loop exited.
+         * If the event loop has not yet exited, the property has the value of -1.
+         * It can only have a value of not -1 in a handler of the 'exit' event.
+         */
+        readonly loopExit: number;
+
+        /**
+         * The high resolution millisecond timestamp at which the Node.js event loop started.
+         * If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1.
+         */
+        readonly loopStart: number;
+
+        /**
+         * The high resolution millisecond timestamp at which the Node.js process was initialized.
+         */
+        readonly nodeStart: number;
+
+        /**
+         * The high resolution millisecond timestamp at which the V8 platform was initialized.
+         */
+        readonly v8Start: number;
+    }
+
+    interface Performance {
+        /**
+         * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
+         * If name is provided, removes only the named mark.
+         * @param name
+         */
+        clearMarks(name?: string): void;
+
+        /**
+         * Creates a new PerformanceMark entry in the Performance Timeline.
+         * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
+         * and whose performanceEntry.duration is always 0.
+         * Performance marks are used to mark specific significant moments in the Performance Timeline.
+         * @param name
+         */
+        mark(name?: string): void;
+
+        /**
+         * Creates a new PerformanceMeasure entry in the Performance Timeline.
+         * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
+         * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
+         *
+         * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
+         * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
+         * then startMark is set to timeOrigin by default.
+         *
+         * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
+         * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
+         * @param name
+         * @param startMark
+         * @param endMark
+         */
+        measure(name: string, startMark: string, endMark: string): void;
+
+        /**
+         * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
+         */
+        readonly nodeTiming: PerformanceNodeTiming;
+
+        /**
+         * @return the current high resolution millisecond timestamp
+         */
+        now(): number;
+
+        /**
+         * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
+         */
+        readonly timeOrigin: number;
+
+        /**
+         * Wraps a function within a new function that measures the running time of the wrapped function.
+         * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
+         * @param fn
+         */
+        timerify<T extends (...optionalParams: any[]) => any>(fn: T): T;
+    }
+
+    interface PerformanceObserverEntryList {
+        /**
+         * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime.
+         */
+        getEntries(): PerformanceEntry[];
+
+        /**
+         * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
+         * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
+         */
+        getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
+
+        /**
+         * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
+         * whose performanceEntry.entryType is equal to type.
+         */
+        getEntriesByType(type: EntryType): PerformanceEntry[];
+    }
+
+    type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
+
+    class PerformanceObserver extends AsyncResource {
+        constructor(callback: PerformanceObserverCallback);
+
+        /**
+         * Disconnects the PerformanceObserver instance from all notifications.
+         */
+        disconnect(): void;
+
+        /**
+         * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes.
+         * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance.
+         * Property buffered defaults to false.
+         * @param options
+         */
+        observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
+    }
+
+    namespace constants {
+        const NODE_PERFORMANCE_GC_MAJOR: number;
+        const NODE_PERFORMANCE_GC_MINOR: number;
+        const NODE_PERFORMANCE_GC_INCREMENTAL: number;
+        const NODE_PERFORMANCE_GC_WEAKCB: number;
+
+        const NODE_PERFORMANCE_GC_FLAGS_NO: number;
+        const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
+        const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
+        const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
+        const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
+        const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
+        const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
+    }
+
+    const performance: Performance;
+
+    interface EventLoopMonitorOptions {
+        /**
+         * The sampling rate in milliseconds.
+         * Must be greater than zero.
+         * @default 10
+         */
+        resolution?: number;
+    }
+
+    interface EventLoopDelayMonitor {
+        /**
+         * Enables the event loop delay sample timer. Returns `true` if the timer was started, `false` if it was already started.
+         */
+        enable(): boolean;
+        /**
+         * Disables the event loop delay sample timer. Returns `true` if the timer was stopped, `false` if it was already stopped.
+         */
+        disable(): boolean;
+
+        /**
+         * Resets the collected histogram data.
+         */
+        reset(): void;
+
+        /**
+         * Returns the value at the given percentile.
+         * @param percentile A percentile value between 1 and 100.
+         */
+        percentile(percentile: number): number;
+
+        /**
+         * A `Map` object detailing the accumulated percentile distribution.
+         */
+        readonly percentiles: Map<number, number>;
+
+        /**
+         * The number of times the event loop delay exceeded the maximum 1 hour eventloop delay threshold.
+         */
+        readonly exceeds: number;
+
+        /**
+         * The minimum recorded event loop delay.
+         */
+        readonly min: number;
+
+        /**
+         * The maximum recorded event loop delay.
+         */
+        readonly max: number;
+
+        /**
+         * The mean of the recorded event loop delays.
+         */
+        readonly mean: number;
+
+        /**
+         * The standard deviation of the recorded event loop delays.
+         */
+        readonly stddev: number;
+    }
+
+    function monitorEventLoopDelay(options?: EventLoopMonitorOptions): EventLoopDelayMonitor;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/process.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/process.d.ts
new file mode 100644 (file)
index 0000000..d007d4e
--- /dev/null
@@ -0,0 +1,15 @@
+declare module "process" {
+    import * as tty from "tty";
+
+    global {
+        namespace NodeJS {
+            // this namespace merge is here because these are specifically used
+            // as the type for process.stdin, process.stdout, and process.stderr.
+            // they can't live in tty.d.ts because we need to disambiguate the imported name.
+            interface ReadStream extends tty.ReadStream {}
+            interface WriteStream extends tty.WriteStream {}
+        }
+    }
+
+    export = process;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/punycode.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/punycode.d.ts
new file mode 100644 (file)
index 0000000..2b771d4
--- /dev/null
@@ -0,0 +1,68 @@
+declare module "punycode" {
+    /**
+     * @deprecated since v7.0.0
+     * The version of the punycode module bundled in Node.js is being deprecated.
+     * In a future major version of Node.js this module will be removed.
+     * Users currently depending on the punycode module should switch to using
+     * the userland-provided Punycode.js module instead.
+     */
+    function decode(string: string): string;
+    /**
+     * @deprecated since v7.0.0
+     * The version of the punycode module bundled in Node.js is being deprecated.
+     * In a future major version of Node.js this module will be removed.
+     * Users currently depending on the punycode module should switch to using
+     * the userland-provided Punycode.js module instead.
+     */
+    function encode(string: string): string;
+    /**
+     * @deprecated since v7.0.0
+     * The version of the punycode module bundled in Node.js is being deprecated.
+     * In a future major version of Node.js this module will be removed.
+     * Users currently depending on the punycode module should switch to using
+     * the userland-provided Punycode.js module instead.
+     */
+    function toUnicode(domain: string): string;
+    /**
+     * @deprecated since v7.0.0
+     * The version of the punycode module bundled in Node.js is being deprecated.
+     * In a future major version of Node.js this module will be removed.
+     * Users currently depending on the punycode module should switch to using
+     * the userland-provided Punycode.js module instead.
+     */
+    function toASCII(domain: string): string;
+    /**
+     * @deprecated since v7.0.0
+     * The version of the punycode module bundled in Node.js is being deprecated.
+     * In a future major version of Node.js this module will be removed.
+     * Users currently depending on the punycode module should switch to using
+     * the userland-provided Punycode.js module instead.
+     */
+    const ucs2: ucs2;
+    interface ucs2 {
+        /**
+         * @deprecated since v7.0.0
+         * The version of the punycode module bundled in Node.js is being deprecated.
+         * In a future major version of Node.js this module will be removed.
+         * Users currently depending on the punycode module should switch to using
+         * the userland-provided Punycode.js module instead.
+         */
+        decode(string: string): number[];
+        /**
+         * @deprecated since v7.0.0
+         * The version of the punycode module bundled in Node.js is being deprecated.
+         * In a future major version of Node.js this module will be removed.
+         * Users currently depending on the punycode module should switch to using
+         * the userland-provided Punycode.js module instead.
+         */
+        encode(codePoints: ReadonlyArray<number>): string;
+    }
+    /**
+     * @deprecated since v7.0.0
+     * The version of the punycode module bundled in Node.js is being deprecated.
+     * In a future major version of Node.js this module will be removed.
+     * Users currently depending on the punycode module should switch to using
+     * the userland-provided Punycode.js module instead.
+     */
+    const version: string;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/querystring.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/querystring.d.ts
new file mode 100644 (file)
index 0000000..be1bbf9
--- /dev/null
@@ -0,0 +1,28 @@
+declare module "querystring" {
+    interface StringifyOptions {
+        encodeURIComponent?: (str: string) => string;
+    }
+
+    interface ParseOptions {
+        maxKeys?: number;
+        decodeURIComponent?: (str: string) => string;
+    }
+
+    interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
+
+    interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | string[] | number[] | boolean[] | null> {
+    }
+
+    function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
+    function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
+    /**
+     * The querystring.encode() function is an alias for querystring.stringify().
+     */
+    const encode: typeof stringify;
+    /**
+     * The querystring.decode() function is an alias for querystring.parse().
+     */
+    const decode: typeof parse;
+    function escape(str: string): string;
+    function unescape(str: string): string;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/readline.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/readline.d.ts
new file mode 100644 (file)
index 0000000..fbe4836
--- /dev/null
@@ -0,0 +1,171 @@
+declare module "readline" {
+    import * as events from "events";
+    import * as stream from "stream";
+
+    interface Key {
+        sequence?: string;
+        name?: string;
+        ctrl?: boolean;
+        meta?: boolean;
+        shift?: boolean;
+    }
+
+    class Interface extends events.EventEmitter {
+        readonly terminal: boolean;
+
+        // Need direct access to line/cursor data, for use in external processes
+        // see: https://github.com/nodejs/node/issues/30347
+        /** The current input data */
+        readonly line: string;
+        /** The current cursor position in the input line */
+        readonly cursor: number;
+
+        /**
+         * NOTE: According to the documentation:
+         *
+         * > Instances of the `readline.Interface` class are constructed using the
+         * > `readline.createInterface()` method.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
+         */
+        protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
+        /**
+         * NOTE: According to the documentation:
+         *
+         * > Instances of the `readline.Interface` class are constructed using the
+         * > `readline.createInterface()` method.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
+         */
+        protected constructor(options: ReadLineOptions);
+
+        setPrompt(prompt: string): void;
+        prompt(preserveCursor?: boolean): void;
+        question(query: string, callback: (answer: string) => void): void;
+        pause(): this;
+        resume(): this;
+        close(): void;
+        write(data: string | Buffer, key?: Key): void;
+
+        /**
+         * Returns the real position of the cursor in relation to the input
+         * prompt + string.  Long input (wrapping) strings, as well as multiple
+         * line prompts are included in the calculations.
+         */
+        getCursorPos(): CursorPos;
+
+        /**
+         * events.EventEmitter
+         * 1. close
+         * 2. line
+         * 3. pause
+         * 4. resume
+         * 5. SIGCONT
+         * 6. SIGINT
+         * 7. SIGTSTP
+         */
+
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "line", listener: (input: string) => void): this;
+        addListener(event: "pause", listener: () => void): this;
+        addListener(event: "resume", listener: () => void): this;
+        addListener(event: "SIGCONT", listener: () => void): this;
+        addListener(event: "SIGINT", listener: () => void): this;
+        addListener(event: "SIGTSTP", listener: () => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "close"): boolean;
+        emit(event: "line", input: string): boolean;
+        emit(event: "pause"): boolean;
+        emit(event: "resume"): boolean;
+        emit(event: "SIGCONT"): boolean;
+        emit(event: "SIGINT"): boolean;
+        emit(event: "SIGTSTP"): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "close", listener: () => void): this;
+        on(event: "line", listener: (input: string) => void): this;
+        on(event: "pause", listener: () => void): this;
+        on(event: "resume", listener: () => void): this;
+        on(event: "SIGCONT", listener: () => void): this;
+        on(event: "SIGINT", listener: () => void): this;
+        on(event: "SIGTSTP", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "close", listener: () => void): this;
+        once(event: "line", listener: (input: string) => void): this;
+        once(event: "pause", listener: () => void): this;
+        once(event: "resume", listener: () => void): this;
+        once(event: "SIGCONT", listener: () => void): this;
+        once(event: "SIGINT", listener: () => void): this;
+        once(event: "SIGTSTP", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "line", listener: (input: string) => void): this;
+        prependListener(event: "pause", listener: () => void): this;
+        prependListener(event: "resume", listener: () => void): this;
+        prependListener(event: "SIGCONT", listener: () => void): this;
+        prependListener(event: "SIGINT", listener: () => void): this;
+        prependListener(event: "SIGTSTP", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "line", listener: (input: string) => void): this;
+        prependOnceListener(event: "pause", listener: () => void): this;
+        prependOnceListener(event: "resume", listener: () => void): this;
+        prependOnceListener(event: "SIGCONT", listener: () => void): this;
+        prependOnceListener(event: "SIGINT", listener: () => void): this;
+        prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+        [Symbol.asyncIterator](): AsyncIterableIterator<string>;
+    }
+
+    type ReadLine = Interface; // type forwarded for backwards compatiblity
+
+    type Completer = (line: string) => CompleterResult;
+    type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
+
+    type CompleterResult = [string[], string];
+
+    interface ReadLineOptions {
+        input: NodeJS.ReadableStream;
+        output?: NodeJS.WritableStream;
+        completer?: Completer | AsyncCompleter;
+        terminal?: boolean;
+        historySize?: number;
+        prompt?: string;
+        crlfDelay?: number;
+        removeHistoryDuplicates?: boolean;
+        escapeCodeTimeout?: number;
+        tabSize?: number;
+    }
+
+    function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
+    function createInterface(options: ReadLineOptions): Interface;
+    function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
+
+    type Direction = -1 | 0 | 1;
+
+    interface CursorPos {
+        rows: number;
+        cols: number;
+    }
+
+    /**
+     * Clears the current line of this WriteStream in a direction identified by `dir`.
+     */
+    function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
+    /**
+     * Clears this `WriteStream` from the current cursor down.
+     */
+    function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
+    /**
+     * Moves this WriteStream's cursor to the specified position.
+     */
+    function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
+    /**
+     * Moves this WriteStream's cursor relative to its current position.
+     */
+    function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/repl.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/repl.d.ts
new file mode 100644 (file)
index 0000000..2515625
--- /dev/null
@@ -0,0 +1,395 @@
+declare module "repl" {
+    import { Interface, Completer, AsyncCompleter } from "readline";
+    import { Context } from "vm";
+    import { InspectOptions } from "util";
+
+    interface ReplOptions {
+        /**
+         * The input prompt to display.
+         * Default: `"> "`
+         */
+        prompt?: string;
+        /**
+         * The `Readable` stream from which REPL input will be read.
+         * Default: `process.stdin`
+         */
+        input?: NodeJS.ReadableStream;
+        /**
+         * The `Writable` stream to which REPL output will be written.
+         * Default: `process.stdout`
+         */
+        output?: NodeJS.WritableStream;
+        /**
+         * If `true`, specifies that the output should be treated as a TTY terminal, and have
+         * ANSI/VT100 escape codes written to it.
+         * Default: checking the value of the `isTTY` property on the output stream upon
+         * instantiation.
+         */
+        terminal?: boolean;
+        /**
+         * The function to be used when evaluating each given line of input.
+         * Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
+         * error with `repl.Recoverable` to indicate the input was incomplete and prompt for
+         * additional lines.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
+         */
+        eval?: REPLEval;
+        /**
+         * Defines if the repl prints output previews or not.
+         * @default `true` Always `false` in case `terminal` is falsy.
+         */
+        preview?: boolean;
+        /**
+         * If `true`, specifies that the default `writer` function should include ANSI color
+         * styling to REPL output. If a custom `writer` function is provided then this has no
+         * effect.
+         * Default: the REPL instance's `terminal` value.
+         */
+        useColors?: boolean;
+        /**
+         * If `true`, specifies that the default evaluation function will use the JavaScript
+         * `global` as the context as opposed to creating a new separate context for the REPL
+         * instance. The node CLI REPL sets this value to `true`.
+         * Default: `false`.
+         */
+        useGlobal?: boolean;
+        /**
+         * If `true`, specifies that the default writer will not output the return value of a
+         * command if it evaluates to `undefined`.
+         * Default: `false`.
+         */
+        ignoreUndefined?: boolean;
+        /**
+         * The function to invoke to format the output of each command before writing to `output`.
+         * Default: a wrapper for `util.inspect`.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
+         */
+        writer?: REPLWriter;
+        /**
+         * An optional function used for custom Tab auto completion.
+         *
+         * @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
+         */
+        completer?: Completer | AsyncCompleter;
+        /**
+         * A flag that specifies whether the default evaluator executes all JavaScript commands in
+         * strict mode or default (sloppy) mode.
+         * Accepted values are:
+         * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
+         * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
+         *   prefacing every repl statement with `'use strict'`.
+         */
+        replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
+        /**
+         * Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
+         * pressed. This cannot be used together with a custom `eval` function.
+         * Default: `false`.
+         */
+        breakEvalOnSigint?: boolean;
+    }
+
+    type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
+    type REPLWriter = (this: REPLServer, obj: any) => string;
+
+    /**
+     * This is the default "writer" value, if none is passed in the REPL options,
+     * and it can be overridden by custom print functions.
+     */
+    const writer: REPLWriter & { options: InspectOptions };
+
+    type REPLCommandAction = (this: REPLServer, text: string) => void;
+
+    interface REPLCommand {
+        /**
+         * Help text to be displayed when `.help` is entered.
+         */
+        help?: string;
+        /**
+         * The function to execute, optionally accepting a single string argument.
+         */
+        action: REPLCommandAction;
+    }
+
+    /**
+     * Provides a customizable Read-Eval-Print-Loop (REPL).
+     *
+     * Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those
+     * according to a user-defined evaluation function, then output the result. Input and output
+     * may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`.
+     *
+     * Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style
+     * line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session
+     * state, error recovery, and customizable evaluation functions.
+     *
+     * Instances of `repl.REPLServer` are created using the `repl.start()` method and _should not_
+     * be created directly using the JavaScript `new` keyword.
+     *
+     * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl
+     */
+    class REPLServer extends Interface {
+        /**
+         * The `vm.Context` provided to the `eval` function to be used for JavaScript
+         * evaluation.
+         */
+        readonly context: Context;
+        /**
+         * Outdated alias for `input`.
+         */
+        readonly inputStream: NodeJS.ReadableStream;
+        /**
+         * Outdated alias for `output`.
+         */
+        readonly outputStream: NodeJS.WritableStream;
+        /**
+         * The `Readable` stream from which REPL input will be read.
+         */
+        readonly input: NodeJS.ReadableStream;
+        /**
+         * The `Writable` stream to which REPL output will be written.
+         */
+        readonly output: NodeJS.WritableStream;
+        /**
+         * The commands registered via `replServer.defineCommand()`.
+         */
+        readonly commands: NodeJS.ReadOnlyDict<REPLCommand>;
+        /**
+         * A value indicating whether the REPL is currently in "editor mode".
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
+         */
+        readonly editorMode: boolean;
+        /**
+         * A value indicating whether the `_` variable has been assigned.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+         */
+        readonly underscoreAssigned: boolean;
+        /**
+         * The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+         */
+        readonly last: any;
+        /**
+         * A value indicating whether the `_error` variable has been assigned.
+         *
+         * @since v9.8.0
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+         */
+        readonly underscoreErrAssigned: boolean;
+        /**
+         * The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
+         *
+         * @since v9.8.0
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
+         */
+        readonly lastError: any;
+        /**
+         * Specified in the REPL options, this is the function to be used when evaluating each
+         * given line of input. If not specified in the REPL options, this is an async wrapper
+         * for the JavaScript `eval()` function.
+         */
+        readonly eval: REPLEval;
+        /**
+         * Specified in the REPL options, this is a value indicating whether the default
+         * `writer` function should include ANSI color styling to REPL output.
+         */
+        readonly useColors: boolean;
+        /**
+         * Specified in the REPL options, this is a value indicating whether the default `eval`
+         * function will use the JavaScript `global` as the context as opposed to creating a new
+         * separate context for the REPL instance.
+         */
+        readonly useGlobal: boolean;
+        /**
+         * Specified in the REPL options, this is a value indicating whether the default `writer`
+         * function should output the result of a command if it evaluates to `undefined`.
+         */
+        readonly ignoreUndefined: boolean;
+        /**
+         * Specified in the REPL options, this is the function to invoke to format the output of
+         * each command before writing to `outputStream`. If not specified in the REPL options,
+         * this will be a wrapper for `util.inspect`.
+         */
+        readonly writer: REPLWriter;
+        /**
+         * Specified in the REPL options, this is the function to use for custom Tab auto-completion.
+         */
+        readonly completer: Completer | AsyncCompleter;
+        /**
+         * Specified in the REPL options, this is a flag that specifies whether the default `eval`
+         * function should execute all JavaScript commands in strict mode or default (sloppy) mode.
+         * Possible values are:
+         * - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
+         * - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
+         *    prefacing every repl statement with `'use strict'`.
+         */
+        readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
+
+        /**
+         * NOTE: According to the documentation:
+         *
+         * > Instances of `repl.REPLServer` are created using the `repl.start()` method and
+         * > _should not_ be created directly using the JavaScript `new` keyword.
+         *
+         * `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
+         */
+        private constructor();
+
+        /**
+         * Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked
+         * by typing a `.` followed by the `keyword`.
+         *
+         * @param keyword The command keyword (_without_ a leading `.` character).
+         * @param cmd The function to invoke when the command is processed.
+         *
+         * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd
+         */
+        defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
+        /**
+         * Readies the REPL instance for input from the user, printing the configured `prompt` to a
+         * new line in the `output` and resuming the `input` to accept new input.
+         *
+         * When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'.
+         *
+         * This method is primarily intended to be called from within the action function for
+         * commands registered using the `replServer.defineCommand()` method.
+         *
+         * @param preserveCursor When `true`, the cursor placement will not be reset to `0`.
+         */
+        displayPrompt(preserveCursor?: boolean): void;
+        /**
+         * Clears any command that has been buffered but not yet executed.
+         *
+         * This method is primarily intended to be called from within the action function for
+         * commands registered using the `replServer.defineCommand()` method.
+         *
+         * @since v9.0.0
+         */
+        clearBufferedCommand(): void;
+
+        /**
+         * Initializes a history log file for the REPL instance. When executing the
+         * Node.js binary and using the command line REPL, a history file is initialized
+         * by default. However, this is not the case when creating a REPL
+         * programmatically. Use this method to initialize a history log file when working
+         * with REPL instances programmatically.
+         * @param path The path to the history file
+         */
+        setupHistory(path: string, cb: (err: Error | null, repl: this) => void): void;
+
+        /**
+         * events.EventEmitter
+         * 1. close - inherited from `readline.Interface`
+         * 2. line - inherited from `readline.Interface`
+         * 3. pause - inherited from `readline.Interface`
+         * 4. resume - inherited from `readline.Interface`
+         * 5. SIGCONT - inherited from `readline.Interface`
+         * 6. SIGINT - inherited from `readline.Interface`
+         * 7. SIGTSTP - inherited from `readline.Interface`
+         * 8. exit
+         * 9. reset
+         */
+
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "line", listener: (input: string) => void): this;
+        addListener(event: "pause", listener: () => void): this;
+        addListener(event: "resume", listener: () => void): this;
+        addListener(event: "SIGCONT", listener: () => void): this;
+        addListener(event: "SIGINT", listener: () => void): this;
+        addListener(event: "SIGTSTP", listener: () => void): this;
+        addListener(event: "exit", listener: () => void): this;
+        addListener(event: "reset", listener: (context: Context) => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "close"): boolean;
+        emit(event: "line", input: string): boolean;
+        emit(event: "pause"): boolean;
+        emit(event: "resume"): boolean;
+        emit(event: "SIGCONT"): boolean;
+        emit(event: "SIGINT"): boolean;
+        emit(event: "SIGTSTP"): boolean;
+        emit(event: "exit"): boolean;
+        emit(event: "reset", context: Context): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "close", listener: () => void): this;
+        on(event: "line", listener: (input: string) => void): this;
+        on(event: "pause", listener: () => void): this;
+        on(event: "resume", listener: () => void): this;
+        on(event: "SIGCONT", listener: () => void): this;
+        on(event: "SIGINT", listener: () => void): this;
+        on(event: "SIGTSTP", listener: () => void): this;
+        on(event: "exit", listener: () => void): this;
+        on(event: "reset", listener: (context: Context) => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "close", listener: () => void): this;
+        once(event: "line", listener: (input: string) => void): this;
+        once(event: "pause", listener: () => void): this;
+        once(event: "resume", listener: () => void): this;
+        once(event: "SIGCONT", listener: () => void): this;
+        once(event: "SIGINT", listener: () => void): this;
+        once(event: "SIGTSTP", listener: () => void): this;
+        once(event: "exit", listener: () => void): this;
+        once(event: "reset", listener: (context: Context) => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "line", listener: (input: string) => void): this;
+        prependListener(event: "pause", listener: () => void): this;
+        prependListener(event: "resume", listener: () => void): this;
+        prependListener(event: "SIGCONT", listener: () => void): this;
+        prependListener(event: "SIGINT", listener: () => void): this;
+        prependListener(event: "SIGTSTP", listener: () => void): this;
+        prependListener(event: "exit", listener: () => void): this;
+        prependListener(event: "reset", listener: (context: Context) => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "line", listener: (input: string) => void): this;
+        prependOnceListener(event: "pause", listener: () => void): this;
+        prependOnceListener(event: "resume", listener: () => void): this;
+        prependOnceListener(event: "SIGCONT", listener: () => void): this;
+        prependOnceListener(event: "SIGINT", listener: () => void): this;
+        prependOnceListener(event: "SIGTSTP", listener: () => void): this;
+        prependOnceListener(event: "exit", listener: () => void): this;
+        prependOnceListener(event: "reset", listener: (context: Context) => void): this;
+    }
+
+    /**
+     * A flag passed in the REPL options. Evaluates expressions in sloppy mode.
+     */
+    const REPL_MODE_SLOPPY: unique symbol;
+
+    /**
+     * A flag passed in the REPL options. Evaluates expressions in strict mode.
+     * This is equivalent to prefacing every repl statement with `'use strict'`.
+     */
+    const REPL_MODE_STRICT: unique symbol;
+
+    /**
+     * Creates and starts a `repl.REPLServer` instance.
+     *
+     * @param options The options for the `REPLServer`. If `options` is a string, then it specifies
+     * the input prompt.
+     */
+    function start(options?: string | ReplOptions): REPLServer;
+
+    /**
+     * Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
+     *
+     * @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
+     */
+    class Recoverable extends SyntaxError {
+        err: Error;
+
+        constructor(err: Error);
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/stream.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/stream.d.ts
new file mode 100644 (file)
index 0000000..574bfef
--- /dev/null
@@ -0,0 +1,354 @@
+declare module "stream" {
+    import * as events from "events";
+
+    class internal extends events.EventEmitter {
+        pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
+    }
+
+    namespace internal {
+        class Stream extends internal {
+            constructor(opts?: ReadableOptions);
+        }
+
+        interface ReadableOptions {
+            highWaterMark?: number;
+            encoding?: string;
+            objectMode?: boolean;
+            read?(this: Readable, size: number): void;
+            destroy?(this: Readable, error: Error | null, callback: (error: Error | null) => void): void;
+            autoDestroy?: boolean;
+        }
+
+        class Readable extends Stream implements NodeJS.ReadableStream {
+            /**
+             * A utility method for creating Readable Streams out of iterators.
+             */
+            static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
+
+            readable: boolean;
+            readonly readableEncoding: BufferEncoding | null;
+            readonly readableEnded: boolean;
+            readonly readableFlowing: boolean | null;
+            readonly readableHighWaterMark: number;
+            readonly readableLength: number;
+            readonly readableObjectMode: boolean;
+            destroyed: boolean;
+            constructor(opts?: ReadableOptions);
+            _read(size: number): void;
+            read(size?: number): any;
+            setEncoding(encoding: string): this;
+            pause(): this;
+            resume(): this;
+            isPaused(): boolean;
+            unpipe(destination?: NodeJS.WritableStream): this;
+            unshift(chunk: any, encoding?: BufferEncoding): void;
+            wrap(oldStream: NodeJS.ReadableStream): this;
+            push(chunk: any, encoding?: string): boolean;
+            _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
+            destroy(error?: Error): void;
+
+            /**
+             * Event emitter
+             * The defined events on documents including:
+             * 1. close
+             * 2. data
+             * 3. end
+             * 4. error
+             * 5. pause
+             * 6. readable
+             * 7. resume
+             */
+            addListener(event: "close", listener: () => void): this;
+            addListener(event: "data", listener: (chunk: any) => void): this;
+            addListener(event: "end", listener: () => void): this;
+            addListener(event: "error", listener: (err: Error) => void): this;
+            addListener(event: "pause", listener: () => void): this;
+            addListener(event: "readable", listener: () => void): this;
+            addListener(event: "resume", listener: () => void): this;
+            addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            emit(event: "close"): boolean;
+            emit(event: "data", chunk: any): boolean;
+            emit(event: "end"): boolean;
+            emit(event: "error", err: Error): boolean;
+            emit(event: "pause"): boolean;
+            emit(event: "readable"): boolean;
+            emit(event: "resume"): boolean;
+            emit(event: string | symbol, ...args: any[]): boolean;
+
+            on(event: "close", listener: () => void): this;
+            on(event: "data", listener: (chunk: any) => void): this;
+            on(event: "end", listener: () => void): this;
+            on(event: "error", listener: (err: Error) => void): this;
+            on(event: "pause", listener: () => void): this;
+            on(event: "readable", listener: () => void): this;
+            on(event: "resume", listener: () => void): this;
+            on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            once(event: "close", listener: () => void): this;
+            once(event: "data", listener: (chunk: any) => void): this;
+            once(event: "end", listener: () => void): this;
+            once(event: "error", listener: (err: Error) => void): this;
+            once(event: "pause", listener: () => void): this;
+            once(event: "readable", listener: () => void): this;
+            once(event: "resume", listener: () => void): this;
+            once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            prependListener(event: "close", listener: () => void): this;
+            prependListener(event: "data", listener: (chunk: any) => void): this;
+            prependListener(event: "end", listener: () => void): this;
+            prependListener(event: "error", listener: (err: Error) => void): this;
+            prependListener(event: "pause", listener: () => void): this;
+            prependListener(event: "readable", listener: () => void): this;
+            prependListener(event: "resume", listener: () => void): this;
+            prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            prependOnceListener(event: "close", listener: () => void): this;
+            prependOnceListener(event: "data", listener: (chunk: any) => void): this;
+            prependOnceListener(event: "end", listener: () => void): this;
+            prependOnceListener(event: "error", listener: (err: Error) => void): this;
+            prependOnceListener(event: "pause", listener: () => void): this;
+            prependOnceListener(event: "readable", listener: () => void): this;
+            prependOnceListener(event: "resume", listener: () => void): this;
+            prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            removeListener(event: "close", listener: () => void): this;
+            removeListener(event: "data", listener: (chunk: any) => void): this;
+            removeListener(event: "end", listener: () => void): this;
+            removeListener(event: "error", listener: (err: Error) => void): this;
+            removeListener(event: "pause", listener: () => void): this;
+            removeListener(event: "readable", listener: () => void): this;
+            removeListener(event: "resume", listener: () => void): this;
+            removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            [Symbol.asyncIterator](): AsyncIterableIterator<any>;
+        }
+
+        interface WritableOptions {
+            highWaterMark?: number;
+            decodeStrings?: boolean;
+            defaultEncoding?: string;
+            objectMode?: boolean;
+            emitClose?: boolean;
+            write?(this: Writable, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
+            writev?(this: Writable, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
+            destroy?(this: Writable, error: Error | null, callback: (error: Error | null) => void): void;
+            final?(this: Writable, callback: (error?: Error | null) => void): void;
+            autoDestroy?: boolean;
+        }
+
+        class Writable extends Stream implements NodeJS.WritableStream {
+            readonly writable: boolean;
+            readonly writableEnded: boolean;
+            readonly writableFinished: boolean;
+            readonly writableHighWaterMark: number;
+            readonly writableLength: number;
+            readonly writableObjectMode: boolean;
+            readonly writableCorked: number;
+            destroyed: boolean;
+            constructor(opts?: WritableOptions);
+            _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
+            _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
+            _destroy(error: Error | null, callback: (error?: Error | null) => void): void;
+            _final(callback: (error?: Error | null) => void): void;
+            write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
+            write(chunk: any, encoding: string, cb?: (error: Error | null | undefined) => void): boolean;
+            setDefaultEncoding(encoding: string): this;
+            end(cb?: () => void): void;
+            end(chunk: any, cb?: () => void): void;
+            end(chunk: any, encoding: string, cb?: () => void): void;
+            cork(): void;
+            uncork(): void;
+            destroy(error?: Error): void;
+
+            /**
+             * Event emitter
+             * The defined events on documents including:
+             * 1. close
+             * 2. drain
+             * 3. error
+             * 4. finish
+             * 5. pipe
+             * 6. unpipe
+             */
+            addListener(event: "close", listener: () => void): this;
+            addListener(event: "drain", listener: () => void): this;
+            addListener(event: "error", listener: (err: Error) => void): this;
+            addListener(event: "finish", listener: () => void): this;
+            addListener(event: "pipe", listener: (src: Readable) => void): this;
+            addListener(event: "unpipe", listener: (src: Readable) => void): this;
+            addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            emit(event: "close"): boolean;
+            emit(event: "drain"): boolean;
+            emit(event: "error", err: Error): boolean;
+            emit(event: "finish"): boolean;
+            emit(event: "pipe", src: Readable): boolean;
+            emit(event: "unpipe", src: Readable): boolean;
+            emit(event: string | symbol, ...args: any[]): boolean;
+
+            on(event: "close", listener: () => void): this;
+            on(event: "drain", listener: () => void): this;
+            on(event: "error", listener: (err: Error) => void): this;
+            on(event: "finish", listener: () => void): this;
+            on(event: "pipe", listener: (src: Readable) => void): this;
+            on(event: "unpipe", listener: (src: Readable) => void): this;
+            on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            once(event: "close", listener: () => void): this;
+            once(event: "drain", listener: () => void): this;
+            once(event: "error", listener: (err: Error) => void): this;
+            once(event: "finish", listener: () => void): this;
+            once(event: "pipe", listener: (src: Readable) => void): this;
+            once(event: "unpipe", listener: (src: Readable) => void): this;
+            once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            prependListener(event: "close", listener: () => void): this;
+            prependListener(event: "drain", listener: () => void): this;
+            prependListener(event: "error", listener: (err: Error) => void): this;
+            prependListener(event: "finish", listener: () => void): this;
+            prependListener(event: "pipe", listener: (src: Readable) => void): this;
+            prependListener(event: "unpipe", listener: (src: Readable) => void): this;
+            prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            prependOnceListener(event: "close", listener: () => void): this;
+            prependOnceListener(event: "drain", listener: () => void): this;
+            prependOnceListener(event: "error", listener: (err: Error) => void): this;
+            prependOnceListener(event: "finish", listener: () => void): this;
+            prependOnceListener(event: "pipe", listener: (src: Readable) => void): this;
+            prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this;
+            prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+            removeListener(event: "close", listener: () => void): this;
+            removeListener(event: "drain", listener: () => void): this;
+            removeListener(event: "error", listener: (err: Error) => void): this;
+            removeListener(event: "finish", listener: () => void): this;
+            removeListener(event: "pipe", listener: (src: Readable) => void): this;
+            removeListener(event: "unpipe", listener: (src: Readable) => void): this;
+            removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+        }
+
+        interface DuplexOptions extends ReadableOptions, WritableOptions {
+            allowHalfOpen?: boolean;
+            readableObjectMode?: boolean;
+            writableObjectMode?: boolean;
+            readableHighWaterMark?: number;
+            writableHighWaterMark?: number;
+            writableCorked?: number;
+            read?(this: Duplex, size: number): void;
+            write?(this: Duplex, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
+            writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
+            final?(this: Duplex, callback: (error?: Error | null) => void): void;
+            destroy?(this: Duplex, error: Error | null, callback: (error: Error | null) => void): void;
+        }
+
+        // Note: Duplex extends both Readable and Writable.
+        class Duplex extends Readable implements Writable {
+            readonly writable: boolean;
+            readonly writableEnded: boolean;
+            readonly writableFinished: boolean;
+            readonly writableHighWaterMark: number;
+            readonly writableLength: number;
+            readonly writableObjectMode: boolean;
+            readonly writableCorked: number;
+            constructor(opts?: DuplexOptions);
+            _write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
+            _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
+            _destroy(error: Error | null, callback: (error: Error | null) => void): void;
+            _final(callback: (error?: Error | null) => void): void;
+            write(chunk: any, encoding?: string, cb?: (error: Error | null | undefined) => void): boolean;
+            write(chunk: any, cb?: (error: Error | null | undefined) => void): boolean;
+            setDefaultEncoding(encoding: string): this;
+            end(cb?: () => void): void;
+            end(chunk: any, cb?: () => void): void;
+            end(chunk: any, encoding?: string, cb?: () => void): void;
+            cork(): void;
+            uncork(): void;
+        }
+
+        type TransformCallback = (error?: Error | null, data?: any) => void;
+
+        interface TransformOptions extends DuplexOptions {
+            read?(this: Transform, size: number): void;
+            write?(this: Transform, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
+            writev?(this: Transform, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
+            final?(this: Transform, callback: (error?: Error | null) => void): void;
+            destroy?(this: Transform, error: Error | null, callback: (error: Error | null) => void): void;
+            transform?(this: Transform, chunk: any, encoding: string, callback: TransformCallback): void;
+            flush?(this: Transform, callback: TransformCallback): void;
+        }
+
+        class Transform extends Duplex {
+            constructor(opts?: TransformOptions);
+            _transform(chunk: any, encoding: string, callback: TransformCallback): void;
+            _flush(callback: TransformCallback): void;
+        }
+
+        class PassThrough extends Transform { }
+
+        interface FinishedOptions {
+            error?: boolean;
+            readable?: boolean;
+            writable?: boolean;
+        }
+        function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
+        function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
+        namespace finished {
+            function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
+        }
+
+        function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException | null) => void): T;
+        function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException | null) => void): T;
+        function pipeline<T extends NodeJS.WritableStream>(
+            stream1: NodeJS.ReadableStream,
+            stream2: NodeJS.ReadWriteStream,
+            stream3: NodeJS.ReadWriteStream,
+            stream4: T,
+            callback?: (err: NodeJS.ErrnoException | null) => void,
+        ): T;
+        function pipeline<T extends NodeJS.WritableStream>(
+            stream1: NodeJS.ReadableStream,
+            stream2: NodeJS.ReadWriteStream,
+            stream3: NodeJS.ReadWriteStream,
+            stream4: NodeJS.ReadWriteStream,
+            stream5: T,
+            callback?: (err: NodeJS.ErrnoException | null) => void,
+        ): T;
+        function pipeline(
+            streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
+            callback?: (err: NodeJS.ErrnoException | null) => void,
+        ): NodeJS.WritableStream;
+        function pipeline(
+            stream1: NodeJS.ReadableStream,
+            stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+            ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | ((err: NodeJS.ErrnoException | null) => void)>,
+        ): NodeJS.WritableStream;
+        namespace pipeline {
+            function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.WritableStream): Promise<void>;
+            function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.WritableStream): Promise<void>;
+            function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.WritableStream): Promise<void>;
+            function __promisify__(
+                stream1: NodeJS.ReadableStream,
+                stream2: NodeJS.ReadWriteStream,
+                stream3: NodeJS.ReadWriteStream,
+                stream4: NodeJS.ReadWriteStream,
+                stream5: NodeJS.WritableStream,
+            ): Promise<void>;
+            function __promisify__(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
+            function __promisify__(
+                stream1: NodeJS.ReadableStream,
+                stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
+                ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream>,
+            ): Promise<void>;
+        }
+
+        interface Pipe {
+            close(): void;
+            hasRef(): boolean;
+            ref(): void;
+            unref(): void;
+        }
+    }
+
+    export = internal;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/string_decoder.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/string_decoder.d.ts
new file mode 100644 (file)
index 0000000..fe0e0b4
--- /dev/null
@@ -0,0 +1,7 @@
+declare module "string_decoder" {
+    class StringDecoder {
+        constructor(encoding?: string);
+        write(buffer: Buffer): string;
+        end(buffer?: Buffer): string;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/timers.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/timers.d.ts
new file mode 100644 (file)
index 0000000..e64a673
--- /dev/null
@@ -0,0 +1,16 @@
+declare module "timers" {
+    function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
+    namespace setTimeout {
+        function __promisify__(ms: number): Promise<void>;
+        function __promisify__<T>(ms: number, value: T): Promise<T>;
+    }
+    function clearTimeout(timeoutId: NodeJS.Timeout): void;
+    function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
+    function clearInterval(intervalId: NodeJS.Timeout): void;
+    function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
+    namespace setImmediate {
+        function __promisify__(): Promise<void>;
+        function __promisify__<T>(value: T): Promise<T>;
+    }
+    function clearImmediate(immediateId: NodeJS.Immediate): void;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/tls.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/tls.d.ts
new file mode 100644 (file)
index 0000000..4ae0bb2
--- /dev/null
@@ -0,0 +1,768 @@
+declare module "tls" {
+    import * as crypto from "crypto";
+    import * as dns from "dns";
+    import * as net from "net";
+    import * as stream from "stream";
+
+    const CLIENT_RENEG_LIMIT: number;
+    const CLIENT_RENEG_WINDOW: number;
+
+    interface Certificate {
+        /**
+         * Country code.
+         */
+        C: string;
+        /**
+         * Street.
+         */
+        ST: string;
+        /**
+         * Locality.
+         */
+        L: string;
+        /**
+         * Organization.
+         */
+        O: string;
+        /**
+         * Organizational unit.
+         */
+        OU: string;
+        /**
+         * Common name.
+         */
+        CN: string;
+    }
+
+    interface PeerCertificate {
+        subject: Certificate;
+        issuer: Certificate;
+        subjectaltname: string;
+        infoAccess: NodeJS.Dict<string[]>;
+        modulus: string;
+        exponent: string;
+        valid_from: string;
+        valid_to: string;
+        fingerprint: string;
+        fingerprint256: string;
+        ext_key_usage: string[];
+        serialNumber: string;
+        raw: Buffer;
+    }
+
+    interface DetailedPeerCertificate extends PeerCertificate {
+        issuerCertificate: DetailedPeerCertificate;
+    }
+
+    interface CipherNameAndProtocol {
+        /**
+         * The cipher name.
+         */
+        name: string;
+        /**
+         * SSL/TLS protocol version.
+         */
+        version: string;
+
+        /**
+         * IETF name for the cipher suite.
+         */
+        standardName: string;
+    }
+
+    interface EphemeralKeyInfo {
+        /**
+         * The supported types are 'DH' and 'ECDH'.
+         */
+        type: string;
+        /**
+         * The name property is available only when type is 'ECDH'.
+         */
+        name?: string;
+        /**
+         * The size of parameter of an ephemeral key exchange.
+         */
+        size: number;
+    }
+
+    interface KeyObject {
+        /**
+         * Private keys in PEM format.
+         */
+        pem: string | Buffer;
+        /**
+         * Optional passphrase.
+         */
+        passphrase?: string;
+    }
+
+    interface PxfObject {
+        /**
+         * PFX or PKCS12 encoded private key and certificate chain.
+         */
+        buf: string | Buffer;
+        /**
+         * Optional passphrase.
+         */
+        passphrase?: string;
+    }
+
+    interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
+        /**
+         * If true the TLS socket will be instantiated in server-mode.
+         * Defaults to false.
+         */
+        isServer?: boolean;
+        /**
+         * An optional net.Server instance.
+         */
+        server?: net.Server;
+
+        /**
+         * An optional Buffer instance containing a TLS session.
+         */
+        session?: Buffer;
+        /**
+         * If true, specifies that the OCSP status request extension will be
+         * added to the client hello and an 'OCSPResponse' event will be
+         * emitted on the socket before establishing a secure communication
+         */
+        requestOCSP?: boolean;
+    }
+
+    class TLSSocket extends net.Socket {
+        /**
+         * Construct a new tls.TLSSocket object from an existing TCP socket.
+         */
+        constructor(socket: net.Socket, options?: TLSSocketOptions);
+
+        /**
+         * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.
+         */
+        authorized: boolean;
+        /**
+         * The reason why the peer's certificate has not been verified.
+         * This property becomes available only when tlsSocket.authorized === false.
+         */
+        authorizationError: Error;
+        /**
+         * Static boolean value, always true.
+         * May be used to distinguish TLS sockets from regular ones.
+         */
+        encrypted: boolean;
+
+        /**
+         * String containing the selected ALPN protocol.
+         * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.
+         */
+        alpnProtocol?: string;
+
+        /**
+         * Returns an object representing the local certificate. The returned
+         * object has some properties corresponding to the fields of the
+         * certificate.
+         *
+         * See tls.TLSSocket.getPeerCertificate() for an example of the
+         * certificate structure.
+         *
+         * If there is no local certificate, an empty object will be returned.
+         * If the socket has been destroyed, null will be returned.
+         */
+        getCertificate(): PeerCertificate | object | null;
+        /**
+         * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
+         * @returns Returns an object representing the cipher name
+         * and the SSL/TLS protocol version of the current connection.
+         */
+        getCipher(): CipherNameAndProtocol;
+        /**
+         * Returns an object representing the type, name, and size of parameter
+         * of an ephemeral key exchange in Perfect Forward Secrecy on a client
+         * connection. It returns an empty object when the key exchange is not
+         * ephemeral. As this is only supported on a client socket; null is
+         * returned if called on a server socket. The supported types are 'DH'
+         * and 'ECDH'. The name property is available only when type is 'ECDH'.
+         *
+         * For example: { type: 'ECDH', name: 'prime256v1', size: 256 }.
+         */
+        getEphemeralKeyInfo(): EphemeralKeyInfo | object | null;
+        /**
+         * Returns the latest Finished message that has
+         * been sent to the socket as part of a SSL/TLS handshake, or undefined
+         * if no Finished message has been sent yet.
+         *
+         * As the Finished messages are message digests of the complete
+         * handshake (with a total of 192 bits for TLS 1.0 and more for SSL
+         * 3.0), they can be used for external authentication procedures when
+         * the authentication provided by SSL/TLS is not desired or is not
+         * enough.
+         *
+         * Corresponds to the SSL_get_finished routine in OpenSSL and may be
+         * used to implement the tls-unique channel binding from RFC 5929.
+         */
+        getFinished(): Buffer | undefined;
+        /**
+         * Returns an object representing the peer's certificate.
+         * The returned object has some properties corresponding to the field of the certificate.
+         * If detailed argument is true the full chain with issuer property will be returned,
+         * if false only the top certificate without issuer property.
+         * If the peer does not provide a certificate, it returns null or an empty object.
+         * @param detailed - If true; the full chain with issuer property will be returned.
+         * @returns An object representing the peer's certificate.
+         */
+        getPeerCertificate(detailed: true): DetailedPeerCertificate;
+        getPeerCertificate(detailed?: false): PeerCertificate;
+        getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
+        /**
+         * Returns the latest Finished message that is expected or has actually
+         * been received from the socket as part of a SSL/TLS handshake, or
+         * undefined if there is no Finished message so far.
+         *
+         * As the Finished messages are message digests of the complete
+         * handshake (with a total of 192 bits for TLS 1.0 and more for SSL
+         * 3.0), they can be used for external authentication procedures when
+         * the authentication provided by SSL/TLS is not desired or is not
+         * enough.
+         *
+         * Corresponds to the SSL_get_peer_finished routine in OpenSSL and may
+         * be used to implement the tls-unique channel binding from RFC 5929.
+         */
+        getPeerFinished(): Buffer | undefined;
+        /**
+         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.
+         * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process.
+         * The value `null` will be returned for server sockets or disconnected client sockets.
+         * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information.
+         * @returns negotiated SSL/TLS protocol version of the current connection
+         */
+        getProtocol(): string | null;
+        /**
+         * Could be used to speed up handshake establishment when reconnecting to the server.
+         * @returns ASN.1 encoded TLS session or undefined if none was negotiated.
+         */
+        getSession(): Buffer | undefined;
+        /**
+         * Returns a list of signature algorithms shared between the server and
+         * the client in the order of decreasing preference.
+         */
+        getSharedSigalgs(): string[];
+        /**
+         * NOTE: Works only with client TLS sockets.
+         * Useful only for debugging, for session reuse provide session option to tls.connect().
+         * @returns TLS session ticket or undefined if none was negotiated.
+         */
+        getTLSTicket(): Buffer | undefined;
+        /**
+         * Returns true if the session was reused, false otherwise.
+         */
+        isSessionReused(): boolean;
+        /**
+         * Initiate TLS renegotiation process.
+         *
+         * NOTE: Can be used to request peer's certificate after the secure connection has been established.
+         * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.
+         * @param options - The options may contain the following fields: rejectUnauthorized,
+         * requestCert (See tls.createServer() for details).
+         * @param callback - callback(err) will be executed with null as err, once the renegotiation
+         * is successfully completed.
+         * @return `undefined` when socket is destroy, `false` if negotiaion can't be initiated.
+         */
+        renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): undefined | boolean;
+        /**
+         * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).
+         * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by
+         * the TLS layer until the entire fragment is received and its integrity is verified;
+         * large fragments can span multiple roundtrips, and their processing can be delayed due to packet
+         * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead,
+         * which may decrease overall server throughput.
+         * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512).
+         * @returns Returns true on success, false otherwise.
+         */
+        setMaxSendFragment(size: number): boolean;
+
+        /**
+         * Disables TLS renegotiation for this TLSSocket instance. Once called,
+         * attempts to renegotiate will trigger an 'error' event on the
+         * TLSSocket.
+         */
+        disableRenegotiation(): void;
+
+        /**
+         * When enabled, TLS packet trace information is written to `stderr`. This can be
+         * used to debug TLS connection problems.
+         *
+         * Note: The format of the output is identical to the output of `openssl s_client
+         * -trace` or `openssl s_server -trace`. While it is produced by OpenSSL's
+         * `SSL_trace()` function, the format is undocumented, can change without notice,
+         * and should not be relied on.
+         */
+        enableTrace(): void;
+
+        /**
+         * @param length number of bytes to retrieve from keying material
+         * @param label an application specific label, typically this will be a value from the
+         * [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
+         * @param context optionally provide a context.
+         */
+        exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
+
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+        addListener(event: "secureConnect", listener: () => void): this;
+        addListener(event: "session", listener: (session: Buffer) => void): this;
+        addListener(event: "keylog", listener: (line: Buffer) => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "OCSPResponse", response: Buffer): boolean;
+        emit(event: "secureConnect"): boolean;
+        emit(event: "session", session: Buffer): boolean;
+        emit(event: "keylog", line: Buffer): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+        on(event: "secureConnect", listener: () => void): this;
+        on(event: "session", listener: (session: Buffer) => void): this;
+        on(event: "keylog", listener: (line: Buffer) => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+        once(event: "secureConnect", listener: () => void): this;
+        once(event: "session", listener: (session: Buffer) => void): this;
+        once(event: "keylog", listener: (line: Buffer) => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+        prependListener(event: "secureConnect", listener: () => void): this;
+        prependListener(event: "session", listener: (session: Buffer) => void): this;
+        prependListener(event: "keylog", listener: (line: Buffer) => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
+        prependOnceListener(event: "secureConnect", listener: () => void): this;
+        prependOnceListener(event: "session", listener: (session: Buffer) => void): this;
+        prependOnceListener(event: "keylog", listener: (line: Buffer) => void): this;
+    }
+
+    interface CommonConnectionOptions {
+        /**
+         * An optional TLS context object from tls.createSecureContext()
+         */
+        secureContext?: SecureContext;
+
+        /**
+         * When enabled, TLS packet trace information is written to `stderr`. This can be
+         * used to debug TLS connection problems.
+         * @default false
+         */
+        enableTrace?: boolean;
+        /**
+         * If true the server will request a certificate from clients that
+         * connect and attempt to verify that certificate. Defaults to
+         * false.
+         */
+        requestCert?: boolean;
+        /**
+         * An array of strings or a Buffer naming possible ALPN protocols.
+         * (Protocols should be ordered by their priority.)
+         */
+        ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
+        /**
+         * SNICallback(servername, cb) <Function> A function that will be
+         * called if the client supports SNI TLS extension. Two arguments
+         * will be passed when called: servername and cb. SNICallback should
+         * invoke cb(null, ctx), where ctx is a SecureContext instance.
+         * (tls.createSecureContext(...) can be used to get a proper
+         * SecureContext.) If SNICallback wasn't provided the default callback
+         * with high-level API will be used (see below).
+         */
+        SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void;
+        /**
+         * If true the server will reject any connection which is not
+         * authorized with the list of supplied CAs. This option only has an
+         * effect if requestCert is true.
+         * @default true
+         */
+        rejectUnauthorized?: boolean;
+    }
+
+    interface TlsOptions extends SecureContextOptions, CommonConnectionOptions {
+        /**
+         * Abort the connection if the SSL/TLS handshake does not finish in the
+         * specified number of milliseconds. A 'tlsClientError' is emitted on
+         * the tls.Server object whenever a handshake times out. Default:
+         * 120000 (120 seconds).
+         */
+        handshakeTimeout?: number;
+        /**
+         * The number of seconds after which a TLS session created by the
+         * server will no longer be resumable. See Session Resumption for more
+         * information. Default: 300.
+         */
+        sessionTimeout?: number;
+        /**
+         * 48-bytes of cryptographically strong pseudo-random data.
+         */
+        ticketKeys?: Buffer;
+
+        /**
+         *
+         * @param socket
+         * @param identity identity parameter sent from the client.
+         * @return pre-shared key that must either be
+         * a buffer or `null` to stop the negotiation process. Returned PSK must be
+         * compatible with the selected cipher's digest.
+         *
+         * When negotiating TLS-PSK (pre-shared keys), this function is called
+         * with the identity provided by the client.
+         * If the return value is `null` the negotiation process will stop and an
+         * "unknown_psk_identity" alert message will be sent to the other party.
+         * If the server wishes to hide the fact that the PSK identity was not known,
+         * the callback must provide some random data as `psk` to make the connection
+         * fail with "decrypt_error" before negotiation is finished.
+         * PSK ciphers are disabled by default, and using TLS-PSK thus
+         * requires explicitly specifying a cipher suite with the `ciphers` option.
+         * More information can be found in the RFC 4279.
+         */
+
+        pskCallback?(socket: TLSSocket, identity: string): DataView | NodeJS.TypedArray | null;
+        /**
+         * hint to send to a client to help
+         * with selecting the identity during TLS-PSK negotiation. Will be ignored
+         * in TLS 1.3. Upon failing to set pskIdentityHint `tlsClientError` will be
+         * emitted with `ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED` code.
+         */
+        pskIdentityHint?: string;
+    }
+
+    interface PSKCallbackNegotation {
+        psk: DataView | NodeJS.TypedArray;
+        identity: string;
+    }
+
+    interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
+        host?: string;
+        port?: number;
+        path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored.
+        socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket
+        checkServerIdentity?: typeof checkServerIdentity;
+        servername?: string; // SNI TLS Extension
+        session?: Buffer;
+        minDHSize?: number;
+        lookup?: net.LookupFunction;
+        timeout?: number;
+        /**
+         * When negotiating TLS-PSK (pre-shared keys), this function is called
+         * with optional identity `hint` provided by the server or `null`
+         * in case of TLS 1.3 where `hint` was removed.
+         * It will be necessary to provide a custom `tls.checkServerIdentity()`
+         * for the connection as the default one will try to check hostname/IP
+         * of the server against the certificate but that's not applicable for PSK
+         * because there won't be a certificate present.
+         * More information can be found in the RFC 4279.
+         *
+         * @param hint message sent from the server to help client
+         * decide which identity to use during negotiation.
+         * Always `null` if TLS 1.3 is used.
+         * @returns Return `null` to stop the negotiation process. `psk` must be
+         * compatible with the selected cipher's digest.
+         * `identity` must use UTF-8 encoding.
+         */
+        pskCallback?(hint: string | null): PSKCallbackNegotation | null;
+    }
+
+    class Server extends net.Server {
+        /**
+         * The server.addContext() method adds a secure context that will be
+         * used if the client request's SNI name matches the supplied hostname
+         * (or wildcard).
+         */
+        addContext(hostName: string, credentials: SecureContextOptions): void;
+        /**
+         * Returns the session ticket keys.
+         */
+        getTicketKeys(): Buffer;
+        /**
+         *
+         * The server.setSecureContext() method replaces the
+         * secure context of an existing server. Existing connections to the
+         * server are not interrupted.
+         */
+        setSecureContext(details: SecureContextOptions): void;
+        /**
+         * The server.setSecureContext() method replaces the secure context of
+         * an existing server. Existing connections to the server are not
+         * interrupted.
+         */
+        setTicketKeys(keys: Buffer): void;
+
+        /**
+         * events.EventEmitter
+         * 1. tlsClientError
+         * 2. newSession
+         * 3. OCSPRequest
+         * 4. resumeSession
+         * 5. secureConnection
+         * 6. keylog
+         */
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+        addListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
+        addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
+        addListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
+        addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+        addListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean;
+        emit(event: "newSession", sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void): boolean;
+        emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void): boolean;
+        emit(event: "resumeSession", sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void): boolean;
+        emit(event: "secureConnection", tlsSocket: TLSSocket): boolean;
+        emit(event: "keylog", line: Buffer, tlsSocket: TLSSocket): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+        on(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
+        on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
+        on(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
+        on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+        on(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+        once(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
+        once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
+        once(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
+        once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+        once(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+        prependListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
+        prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
+        prependListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
+        prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+        prependListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
+        prependOnceListener(event: "newSession", listener: (sessionId: Buffer, sessionData: Buffer, callback: (err: Error, resp: Buffer) => void) => void): this;
+        prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: (err: Error | null, resp: Buffer) => void) => void): this;
+        prependOnceListener(event: "resumeSession", listener: (sessionId: Buffer, callback: (err: Error, sessionData: Buffer) => void) => void): this;
+        prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this;
+        prependOnceListener(event: "keylog", listener: (line: Buffer, tlsSocket: TLSSocket) => void): this;
+    }
+
+    interface SecurePair {
+        encrypted: TLSSocket;
+        cleartext: TLSSocket;
+    }
+
+    type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
+
+    interface SecureContextOptions {
+        /**
+         * Optionally override the trusted CA certificates. Default is to trust
+         * the well-known CAs curated by Mozilla. Mozilla's CAs are completely
+         * replaced when CAs are explicitly specified using this option.
+         */
+        ca?: string | Buffer | Array<string | Buffer>;
+        /**
+         *  Cert chains in PEM format. One cert chain should be provided per
+         *  private key. Each cert chain should consist of the PEM formatted
+         *  certificate for a provided private key, followed by the PEM
+         *  formatted intermediate certificates (if any), in order, and not
+         *  including the root CA (the root CA must be pre-known to the peer,
+         *  see ca). When providing multiple cert chains, they do not have to
+         *  be in the same order as their private keys in key. If the
+         *  intermediate certificates are not provided, the peer will not be
+         *  able to validate the certificate, and the handshake will fail.
+         */
+        cert?: string | Buffer | Array<string | Buffer>;
+        /**
+         *  Colon-separated list of supported signature algorithms. The list
+         *  can contain digest algorithms (SHA256, MD5 etc.), public key
+         *  algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
+         *  'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
+         */
+        sigalgs?: string;
+        /**
+         * Cipher suite specification, replacing the default. For more
+         * information, see modifying the default cipher suite. Permitted
+         * ciphers can be obtained via tls.getCiphers(). Cipher names must be
+         * uppercased in order for OpenSSL to accept them.
+         */
+        ciphers?: string;
+        /**
+         * Name of an OpenSSL engine which can provide the client certificate.
+         */
+        clientCertEngine?: string;
+        /**
+         * PEM formatted CRLs (Certificate Revocation Lists).
+         */
+        crl?: string | Buffer | Array<string | Buffer>;
+        /**
+         * Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
+         * openssl dhparam to create the parameters. The key length must be
+         * greater than or equal to 1024 bits or else an error will be thrown.
+         * Although 1024 bits is permissible, use 2048 bits or larger for
+         * stronger security. If omitted or invalid, the parameters are
+         * silently discarded and DHE ciphers will not be available.
+         */
+        dhparam?: string | Buffer;
+        /**
+         * A string describing a named curve or a colon separated list of curve
+         * NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
+         * agreement. Set to auto to select the curve automatically. Use
+         * crypto.getCurves() to obtain a list of available curve names. On
+         * recent releases, openssl ecparam -list_curves will also display the
+         * name and description of each available elliptic curve. Default:
+         * tls.DEFAULT_ECDH_CURVE.
+         */
+        ecdhCurve?: string;
+        /**
+         * Attempt to use the server's cipher suite preferences instead of the
+         * client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
+         * set in secureOptions
+         */
+        honorCipherOrder?: boolean;
+        /**
+         * Private keys in PEM format. PEM allows the option of private keys
+         * being encrypted. Encrypted keys will be decrypted with
+         * options.passphrase. Multiple keys using different algorithms can be
+         * provided either as an array of unencrypted key strings or buffers,
+         * or an array of objects in the form {pem: <string|buffer>[,
+         * passphrase: <string>]}. The object form can only occur in an array.
+         * object.passphrase is optional. Encrypted keys will be decrypted with
+         * object.passphrase if provided, or options.passphrase if it is not.
+         */
+        key?: string | Buffer | Array<Buffer | KeyObject>;
+        /**
+         * Name of an OpenSSL engine to get private key from. Should be used
+         * together with privateKeyIdentifier.
+         */
+        privateKeyEngine?: string;
+        /**
+         * Identifier of a private key managed by an OpenSSL engine. Should be
+         * used together with privateKeyEngine. Should not be set together with
+         * key, because both options define a private key in different ways.
+         */
+        privateKeyIdentifier?: string;
+        /**
+         * Optionally set the maximum TLS version to allow. One
+         * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
+         * `secureProtocol` option, use one or the other.
+         * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using
+         * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
+         * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
+         */
+        maxVersion?: SecureVersion;
+        /**
+         * Optionally set the minimum TLS version to allow. One
+         * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
+         * `secureProtocol` option, use one or the other.  It is not recommended to use
+         * less than TLSv1.2, but it may be required for interoperability.
+         * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using
+         * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to
+         * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
+         * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
+         */
+        minVersion?: SecureVersion;
+        /**
+         * Shared passphrase used for a single private key and/or a PFX.
+         */
+        passphrase?: string;
+        /**
+         * PFX or PKCS12 encoded private key and certificate chain. pfx is an
+         * alternative to providing key and cert individually. PFX is usually
+         * encrypted, if it is, passphrase will be used to decrypt it. Multiple
+         * PFX can be provided either as an array of unencrypted PFX buffers,
+         * or an array of objects in the form {buf: <string|buffer>[,
+         * passphrase: <string>]}. The object form can only occur in an array.
+         * object.passphrase is optional. Encrypted PFX will be decrypted with
+         * object.passphrase if provided, or options.passphrase if it is not.
+         */
+        pfx?: string | Buffer | Array<string | Buffer | PxfObject>;
+        /**
+         * Optionally affect the OpenSSL protocol behavior, which is not
+         * usually necessary. This should be used carefully if at all! Value is
+         * a numeric bitmask of the SSL_OP_* options from OpenSSL Options
+         */
+        secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
+        /**
+         * Legacy mechanism to select the TLS protocol version to use, it does
+         * not support independent control of the minimum and maximum version,
+         * and does not support limiting the protocol to TLSv1.3. Use
+         * minVersion and maxVersion instead. The possible values are listed as
+         * SSL_METHODS, use the function names as strings. For example, use
+         * 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow
+         * any TLS protocol version up to TLSv1.3. It is not recommended to use
+         * TLS versions less than 1.2, but it may be required for
+         * interoperability. Default: none, see minVersion.
+         */
+        secureProtocol?: string;
+        /**
+         * Opaque identifier used by servers to ensure session state is not
+         * shared between applications. Unused by clients.
+         */
+        sessionIdContext?: string;
+    }
+
+    interface SecureContext {
+        context: any;
+    }
+
+    /*
+     * Verifies the certificate `cert` is issued to host `host`.
+     * @host The hostname to verify the certificate against
+     * @cert PeerCertificate representing the peer's certificate
+     *
+     * Returns Error object, populating it with the reason, host and cert on failure.  On success, returns undefined.
+     */
+    function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined;
+    function createServer(secureConnectionListener?: (socket: TLSSocket) => void): Server;
+    function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;
+    function connect(options: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+    function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+    function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;
+    /**
+     * @deprecated
+     */
+    function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
+    function createSecureContext(options?: SecureContextOptions): SecureContext;
+    function getCiphers(): string[];
+
+    /**
+     * The default curve name to use for ECDH key agreement in a tls server.
+     * The default value is 'auto'. See tls.createSecureContext() for further
+     * information.
+     */
+    let DEFAULT_ECDH_CURVE: string;
+    /**
+     * The default value of the maxVersion option of
+     * tls.createSecureContext(). It can be assigned any of the supported TLS
+     * protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default:
+     * 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets
+     * the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to
+     * 'TLSv1.3'. If multiple of the options are provided, the highest maximum
+     * is used.
+     */
+    let DEFAULT_MAX_VERSION: SecureVersion;
+    /**
+     * The default value of the minVersion option of tls.createSecureContext().
+     * It can be assigned any of the supported TLS protocol versions,
+     * 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless
+     * changed using CLI options. Using --tls-min-v1.0 sets the default to
+     * 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using
+     * --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options
+     * are provided, the lowest minimum is used.
+     */
+    let DEFAULT_MIN_VERSION: SecureVersion;
+
+    /**
+     * An immutable array of strings representing the root certificates (in PEM
+     * format) used for verifying peer certificates. This is the default value
+     * of the ca option to tls.createSecureContext().
+     */
+    const rootCertificates: ReadonlyArray<string>;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/trace_events.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/trace_events.d.ts
new file mode 100644 (file)
index 0000000..1f3a89c
--- /dev/null
@@ -0,0 +1,61 @@
+declare module "trace_events" {
+    /**
+     * The `Tracing` object is used to enable or disable tracing for sets of
+     * categories. Instances are created using the
+     * `trace_events.createTracing()` method.
+     *
+     * When created, the `Tracing` object is disabled. Calling the
+     * `tracing.enable()` method adds the categories to the set of enabled trace
+     * event categories. Calling `tracing.disable()` will remove the categories
+     * from the set of enabled trace event categories.
+     */
+    interface Tracing {
+        /**
+         * A comma-separated list of the trace event categories covered by this
+         * `Tracing` object.
+         */
+        readonly categories: string;
+
+        /**
+         * Disables this `Tracing` object.
+         *
+         * Only trace event categories _not_ covered by other enabled `Tracing`
+         * objects and _not_ specified by the `--trace-event-categories` flag
+         * will be disabled.
+         */
+        disable(): void;
+
+        /**
+         * Enables this `Tracing` object for the set of categories covered by
+         * the `Tracing` object.
+         */
+        enable(): void;
+
+        /**
+         * `true` only if the `Tracing` object has been enabled.
+         */
+        readonly enabled: boolean;
+    }
+
+    interface CreateTracingOptions {
+        /**
+         * An array of trace category names. Values included in the array are
+         * coerced to a string when possible. An error will be thrown if the
+         * value cannot be coerced.
+         */
+        categories: string[];
+    }
+
+    /**
+     * Creates and returns a Tracing object for the given set of categories.
+     */
+    function createTracing(options: CreateTracingOptions): Tracing;
+
+    /**
+     * Returns a comma-separated list of all currently-enabled trace event
+     * categories. The current set of enabled trace event categories is
+     * determined by the union of all currently-enabled `Tracing` objects and
+     * any categories enabled using the `--trace-event-categories` flag.
+     */
+    function getEnabledCategories(): string | undefined;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/assert.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/assert.d.ts
new file mode 100644 (file)
index 0000000..c43c59a
--- /dev/null
@@ -0,0 +1,76 @@
+declare module 'assert' {
+    function assert(value: any, message?: string | Error): void;
+    namespace assert {
+        class AssertionError implements Error {
+            name: string;
+            message: string;
+            actual: any;
+            expected: any;
+            operator: string;
+            generatedMessage: boolean;
+            code: 'ERR_ASSERTION';
+
+            constructor(options?: {
+                message?: string;
+                actual?: any;
+                expected?: any;
+                operator?: string;
+                // tslint:disable-next-line:ban-types
+                stackStartFn?: Function;
+            });
+        }
+
+        type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
+
+        function fail(message?: string | Error): never;
+        /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
+        function fail(
+            actual: any,
+            expected: any,
+            message?: string | Error,
+            operator?: string,
+            // tslint:disable-next-line:ban-types
+            stackStartFn?: Function,
+        ): never;
+        function ok(value: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use strictEqual() instead. */
+        function equal(actual: any, expected: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
+        function notEqual(actual: any, expected: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
+        function deepEqual(actual: any, expected: any, message?: string | Error): void;
+        /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
+        function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
+        function strictEqual(actual: any, expected: any, message?: string | Error): void;
+        function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
+        function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
+        function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
+
+        function throws(block: () => any, message?: string | Error): void;
+        function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
+        function doesNotThrow(block: () => any, message?: string | Error): void;
+        function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
+
+        function ifError(value: any): void;
+
+        function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
+        function rejects(
+            block: (() => Promise<any>) | Promise<any>,
+            error: AssertPredicate,
+            message?: string | Error,
+        ): Promise<void>;
+        function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
+        function doesNotReject(
+            block: (() => Promise<any>) | Promise<any>,
+            error: AssertPredicate,
+            message?: string | Error,
+        ): Promise<void>;
+
+        function match(value: string, regExp: RegExp, message?: string | Error): void;
+        function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
+
+        const strict: typeof assert;
+    }
+
+    export = assert;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/base.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/base.d.ts
new file mode 100644 (file)
index 0000000..b0b2007
--- /dev/null
@@ -0,0 +1,54 @@
+// NOTE: These definitions support NodeJS and TypeScript 3.2.
+
+// NOTE: TypeScript version-specific augmentations can be found in the following paths:
+//          - ~/base.d.ts         - Shared definitions common to all TypeScript versions
+//          - ~/index.d.ts        - Definitions specific to TypeScript 2.1
+//          - ~/ts3.2/base.d.ts   - Definitions specific to TypeScript 3.2
+//          - ~/ts3.2/index.d.ts  - Definitions specific to TypeScript 3.2 with global and assert pulled in
+
+// Reference required types from the default lib:
+/// <reference lib="es2018" />
+/// <reference lib="esnext.asynciterable" />
+/// <reference lib="esnext.intl" />
+/// <reference lib="esnext.bigint" />
+
+// base definitions for all NodeJS modules that are not specific to any version of TypeScript
+/// <reference path="../globals.d.ts" />
+/// <reference path="../async_hooks.d.ts" />
+/// <reference path="../buffer.d.ts" />
+/// <reference path="../child_process.d.ts" />
+/// <reference path="../cluster.d.ts" />
+/// <reference path="../console.d.ts" />
+/// <reference path="../constants.d.ts" />
+/// <reference path="../crypto.d.ts" />
+/// <reference path="../dgram.d.ts" />
+/// <reference path="../dns.d.ts" />
+/// <reference path="../domain.d.ts" />
+/// <reference path="../events.d.ts" />
+/// <reference path="../fs.d.ts" />
+/// <reference path="../http.d.ts" />
+/// <reference path="../http2.d.ts" />
+/// <reference path="../https.d.ts" />
+/// <reference path="../inspector.d.ts" />
+/// <reference path="../module.d.ts" />
+/// <reference path="../net.d.ts" />
+/// <reference path="../os.d.ts" />
+/// <reference path="../path.d.ts" />
+/// <reference path="../perf_hooks.d.ts" />
+/// <reference path="../process.d.ts" />
+/// <reference path="../punycode.d.ts" />
+/// <reference path="../querystring.d.ts" />
+/// <reference path="../readline.d.ts" />
+/// <reference path="../repl.d.ts" />
+/// <reference path="../stream.d.ts" />
+/// <reference path="../string_decoder.d.ts" />
+/// <reference path="../timers.d.ts" />
+/// <reference path="../tls.d.ts" />
+/// <reference path="../trace_events.d.ts" />
+/// <reference path="../tty.d.ts" />
+/// <reference path="../url.d.ts" />
+/// <reference path="../util.d.ts" />
+/// <reference path="../v8.d.ts" />
+/// <reference path="../vm.d.ts" />
+/// <reference path="../worker_threads.d.ts" />
+/// <reference path="../zlib.d.ts" />
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/globals.global.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/globals.global.d.ts
new file mode 100644 (file)
index 0000000..8e85466
--- /dev/null
@@ -0,0 +1 @@
+declare var global: NodeJS.Global;
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/index.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/ts3.4/index.d.ts
new file mode 100644 (file)
index 0000000..f069170
--- /dev/null
@@ -0,0 +1,8 @@
+// NOTE: These definitions support NodeJS and TypeScript 3.2.
+// This is requried to enable globalThis support for global in ts3.5 without causing errors
+// This is requried to enable typing assert in ts3.7 without causing errors
+// Typically type modifiations should be made in base.d.ts instead of here
+
+/// <reference path="base.d.ts" />
+/// <reference path="assert.d.ts" />
+/// <reference path="globals.global.d.ts" />
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/ts3.6/base.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/ts3.6/base.d.ts
new file mode 100644 (file)
index 0000000..93567d6
--- /dev/null
@@ -0,0 +1,22 @@
+// NOTE: These definitions support NodeJS and TypeScript 3.5.
+
+// NOTE: TypeScript version-specific augmentations can be found in the following paths:
+//          - ~/base.d.ts         - Shared definitions common to all TypeScript versions
+//          - ~/index.d.ts        - Definitions specific to TypeScript 2.1
+//          - ~/ts3.5/base.d.ts   - Definitions specific to TypeScript 3.5
+//          - ~/ts3.5/index.d.ts  - Definitions specific to TypeScript 3.5 with assert pulled in
+
+// Reference required types from the default lib:
+/// <reference lib="es2018" />
+/// <reference lib="esnext.asynciterable" />
+/// <reference lib="esnext.intl" />
+/// <reference lib="esnext.bigint" />
+
+// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
+/// <reference path="../ts3.4/base.d.ts" />
+
+// TypeScript 3.4-specific augmentations:
+/// <reference path="../globals.global.d.ts" />
+
+// TypeScript 3.5-specific augmentations:
+/// <reference path="../wasi.d.ts" />
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/ts3.6/index.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/ts3.6/index.d.ts
new file mode 100644 (file)
index 0000000..7f947fa
--- /dev/null
@@ -0,0 +1,7 @@
+// NOTE: These definitions support NodeJS and TypeScript 3.5.
+// This is requried to enable typing assert in ts3.7 without causing errors
+// Typically type modifiations should be made in base.d.ts instead of here
+
+/// <reference path="base.d.ts" />
+
+/// <reference path="../ts3.4/assert.d.ts" />
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/tty.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/tty.d.ts
new file mode 100644 (file)
index 0000000..7854366
--- /dev/null
@@ -0,0 +1,66 @@
+declare module "tty" {
+    import * as net from "net";
+
+    function isatty(fd: number): boolean;
+    class ReadStream extends net.Socket {
+        constructor(fd: number, options?: net.SocketConstructorOpts);
+        isRaw: boolean;
+        setRawMode(mode: boolean): this;
+        isTTY: boolean;
+    }
+    /**
+     * -1 - to the left from cursor
+     *  0 - the entire line
+     *  1 - to the right from cursor
+     */
+    type Direction = -1 | 0 | 1;
+    class WriteStream extends net.Socket {
+        constructor(fd: number);
+        addListener(event: string, listener: (...args: any[]) => void): this;
+        addListener(event: "resize", listener: () => void): this;
+
+        emit(event: string | symbol, ...args: any[]): boolean;
+        emit(event: "resize"): boolean;
+
+        on(event: string, listener: (...args: any[]) => void): this;
+        on(event: "resize", listener: () => void): this;
+
+        once(event: string, listener: (...args: any[]) => void): this;
+        once(event: "resize", listener: () => void): this;
+
+        prependListener(event: string, listener: (...args: any[]) => void): this;
+        prependListener(event: "resize", listener: () => void): this;
+
+        prependOnceListener(event: string, listener: (...args: any[]) => void): this;
+        prependOnceListener(event: "resize", listener: () => void): this;
+
+        /**
+         * Clears the current line of this WriteStream in a direction identified by `dir`.
+         */
+        clearLine(dir: Direction, callback?: () => void): boolean;
+        /**
+         * Clears this `WriteStream` from the current cursor down.
+         */
+        clearScreenDown(callback?: () => void): boolean;
+        /**
+         * Moves this WriteStream's cursor to the specified position.
+         */
+        cursorTo(x: number, y?: number, callback?: () => void): boolean;
+        cursorTo(x: number, callback: () => void): boolean;
+        /**
+         * Moves this WriteStream's cursor relative to its current position.
+         */
+        moveCursor(dx: number, dy: number, callback?: () => void): boolean;
+        /**
+         * @default `process.env`
+         */
+        getColorDepth(env?: {}): number;
+        hasColors(depth?: number): boolean;
+        hasColors(env?: {}): boolean;
+        hasColors(depth: number, env?: {}): boolean;
+        getWindowSize(): [number, number];
+        columns: number;
+        rows: number;
+        isTTY: boolean;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/url.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/url.d.ts
new file mode 100644 (file)
index 0000000..2490c35
--- /dev/null
@@ -0,0 +1,110 @@
+declare module "url" {
+    import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
+
+    // Input to `url.format`
+    interface UrlObject {
+        auth?: string | null;
+        hash?: string | null;
+        host?: string | null;
+        hostname?: string | null;
+        href?: string | null;
+        pathname?: string | null;
+        protocol?: string | null;
+        search?: string | null;
+        slashes?: boolean | null;
+        port?: string | number | null;
+        query?: string | null | ParsedUrlQueryInput;
+    }
+
+    // Output of `url.parse`
+    interface Url {
+        auth: string | null;
+        hash: string | null;
+        host: string | null;
+        hostname: string | null;
+        href: string;
+        path: string | null;
+        pathname: string | null;
+        protocol: string | null;
+        search: string | null;
+        slashes: boolean | null;
+        port: string | null;
+        query: string | null | ParsedUrlQuery;
+    }
+
+    interface UrlWithParsedQuery extends Url {
+        query: ParsedUrlQuery;
+    }
+
+    interface UrlWithStringQuery extends Url {
+        query: string | null;
+    }
+
+    function parse(urlStr: string): UrlWithStringQuery;
+    function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
+    function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
+    function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
+
+    function format(URL: URL, options?: URLFormatOptions): string;
+    function format(urlObject: UrlObject | string): string;
+    function resolve(from: string, to: string): string;
+
+    function domainToASCII(domain: string): string;
+    function domainToUnicode(domain: string): string;
+
+    /**
+     * This function ensures the correct decodings of percent-encoded characters as
+     * well as ensuring a cross-platform valid absolute path string.
+     * @param url The file URL string or URL object to convert to a path.
+     */
+    function fileURLToPath(url: string | URL): string;
+
+    /**
+     * This function ensures that path is resolved absolutely, and that the URL
+     * control characters are correctly encoded when converting into a File URL.
+     * @param url The path to convert to a File URL.
+     */
+    function pathToFileURL(url: string): URL;
+
+    interface URLFormatOptions {
+        auth?: boolean;
+        fragment?: boolean;
+        search?: boolean;
+        unicode?: boolean;
+    }
+
+    class URL {
+        constructor(input: string, base?: string | URL);
+        hash: string;
+        host: string;
+        hostname: string;
+        href: string;
+        readonly origin: string;
+        password: string;
+        pathname: string;
+        port: string;
+        protocol: string;
+        search: string;
+        readonly searchParams: URLSearchParams;
+        username: string;
+        toString(): string;
+        toJSON(): string;
+    }
+
+    class URLSearchParams implements Iterable<[string, string]> {
+        constructor(init?: URLSearchParams | string | NodeJS.Dict<string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
+        append(name: string, value: string): void;
+        delete(name: string): void;
+        entries(): IterableIterator<[string, string]>;
+        forEach(callback: (value: string, name: string, searchParams: this) => void): void;
+        get(name: string): string | null;
+        getAll(name: string): string[];
+        has(name: string): boolean;
+        keys(): IterableIterator<string>;
+        set(name: string, value: string): void;
+        sort(): void;
+        toString(): string;
+        values(): IterableIterator<string>;
+        [Symbol.iterator](): IterableIterator<[string, string]>;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/util.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/util.d.ts
new file mode 100644 (file)
index 0000000..32508a4
--- /dev/null
@@ -0,0 +1,209 @@
+declare module "util" {
+    interface InspectOptions extends NodeJS.InspectOptions { }
+    type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
+    type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
+    interface InspectOptionsStylized extends InspectOptions {
+        stylize(text: string, styleType: Style): string;
+    }
+    function format(format?: any, ...param: any[]): string;
+    function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
+    /** @deprecated since v0.11.3 - use a third party module instead. */
+    function log(string: string): void;
+    function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
+    function inspect(object: any, options: InspectOptions): string;
+    namespace inspect {
+        let colors: NodeJS.Dict<[number, number]>;
+        let styles: {
+            [K in Style]: string
+        };
+        let defaultOptions: InspectOptions;
+        /**
+         * Allows changing inspect settings from the repl.
+         */
+        let replDefaults: InspectOptions;
+        const custom: unique symbol;
+    }
+    /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */
+    function isArray(object: any): object is any[];
+    /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */
+    function isRegExp(object: any): object is RegExp;
+    /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */
+    function isDate(object: any): object is Date;
+    /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */
+    function isError(object: any): object is Error;
+    function inherits(constructor: any, superConstructor: any): void;
+    function debuglog(key: string): (msg: string, ...param: any[]) => void;
+    /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */
+    function isBoolean(object: any): object is boolean;
+    /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */
+    function isBuffer(object: any): object is Buffer;
+    /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */
+    function isFunction(object: any): boolean;
+    /** @deprecated since v4.0.0 - use `value === null` instead. */
+    function isNull(object: any): object is null;
+    /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */
+    function isNullOrUndefined(object: any): object is null | undefined;
+    /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */
+    function isNumber(object: any): object is number;
+    /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */
+    function isObject(object: any): boolean;
+    /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */
+    function isPrimitive(object: any): boolean;
+    /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */
+    function isString(object: any): object is string;
+    /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */
+    function isSymbol(object: any): object is symbol;
+    /** @deprecated since v4.0.0 - use `value === undefined` instead. */
+    function isUndefined(object: any): object is undefined;
+    function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
+    function isDeepStrictEqual(val1: any, val2: any): boolean;
+
+    function callbackify(fn: () => Promise<void>): (callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<TResult>(fn: () => Promise<TResult>): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
+    function callbackify<T1>(fn: (arg1: T1) => Promise<void>): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<T1, TResult>(fn: (arg1: T1) => Promise<TResult>): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void;
+    function callbackify<T1, T2>(fn: (arg1: T1, arg2: T2) => Promise<void>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2) => Promise<TResult>): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+    function callbackify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<T1, T2, T3, TResult>(
+        fn: (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+    function callbackify<T1, T2, T3, T4>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<T1, T2, T3, T4, TResult>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+    function callbackify<T1, T2, T3, T4, T5>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<T1, T2, T3, T4, T5, TResult>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>,
+    ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+    function callbackify<T1, T2, T3, T4, T5, T6>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<void>,
+    ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void;
+    function callbackify<T1, T2, T3, T4, T5, T6, TResult>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise<TResult>
+    ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
+
+    interface CustomPromisifyLegacy<TCustom extends Function> extends Function {
+        __promisify__: TCustom;
+    }
+
+    interface CustomPromisifySymbol<TCustom extends Function> extends Function {
+        [promisify.custom]: TCustom;
+    }
+
+    type CustomPromisify<TCustom extends Function> = CustomPromisifySymbol<TCustom> | CustomPromisifyLegacy<TCustom>;
+
+    function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
+    function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
+    function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
+    function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
+    function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
+    function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
+    function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
+    function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
+        (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
+    function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
+    function promisify<T1, T2, T3, T4, TResult>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
+    ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
+    function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
+        (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
+    function promisify<T1, T2, T3, T4, T5, TResult>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
+    ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
+    function promisify<T1, T2, T3, T4, T5>(
+        fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
+    ): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
+    function promisify(fn: Function): Function;
+    namespace promisify {
+        const custom: unique symbol;
+    }
+
+    namespace types {
+        function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
+        function isArgumentsObject(object: any): object is IArguments;
+        function isArrayBuffer(object: any): object is ArrayBuffer;
+        function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
+        function isAsyncFunction(object: any): boolean;
+        function isBigInt64Array(value: any): value is BigInt64Array;
+        function isBigUint64Array(value: any): value is BigUint64Array;
+        function isBooleanObject(object: any): object is Boolean;
+        function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
+        function isDataView(object: any): object is DataView;
+        function isDate(object: any): object is Date;
+        function isExternal(object: any): boolean;
+        function isFloat32Array(object: any): object is Float32Array;
+        function isFloat64Array(object: any): object is Float64Array;
+        function isGeneratorFunction(object: any): object is GeneratorFunction;
+        function isGeneratorObject(object: any): object is Generator;
+        function isInt8Array(object: any): object is Int8Array;
+        function isInt16Array(object: any): object is Int16Array;
+        function isInt32Array(object: any): object is Int32Array;
+        function isMap<T>(
+            object: T | {},
+        ): object is T extends ReadonlyMap<any, any>
+            ? unknown extends T
+                ? never
+                : ReadonlyMap<any, any>
+            : Map<any, any>;
+        function isMapIterator(object: any): boolean;
+        function isModuleNamespaceObject(value: any): boolean;
+        function isNativeError(object: any): object is Error;
+        function isNumberObject(object: any): object is Number;
+        function isPromise(object: any): object is Promise<any>;
+        function isProxy(object: any): boolean;
+        function isRegExp(object: any): object is RegExp;
+        function isSet<T>(
+            object: T | {},
+        ): object is T extends ReadonlySet<any>
+            ? unknown extends T
+                ? never
+                : ReadonlySet<any>
+            : Set<any>;
+        function isSetIterator(object: any): boolean;
+        function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
+        function isStringObject(object: any): object is String;
+        function isSymbolObject(object: any): object is Symbol;
+        function isTypedArray(object: any): object is NodeJS.TypedArray;
+        function isUint8Array(object: any): object is Uint8Array;
+        function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
+        function isUint16Array(object: any): object is Uint16Array;
+        function isUint32Array(object: any): object is Uint32Array;
+        function isWeakMap(object: any): object is WeakMap<any, any>;
+        function isWeakSet(object: any): object is WeakSet<any>;
+        /** @deprecated Removed in v14.0.0 */
+        function isWebAssemblyCompiledModule(object: any): boolean;
+    }
+
+    class TextDecoder {
+        readonly encoding: string;
+        readonly fatal: boolean;
+        readonly ignoreBOM: boolean;
+        constructor(
+          encoding?: string,
+          options?: { fatal?: boolean; ignoreBOM?: boolean }
+        );
+        decode(
+          input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
+          options?: { stream?: boolean }
+        ): string;
+    }
+
+    interface EncodeIntoResult {
+        /**
+         * The read Unicode code units of input.
+         */
+
+        read: number;
+        /**
+         * The written UTF-8 bytes of output.
+         */
+        written: number;
+    }
+
+    class TextEncoder {
+        readonly encoding: string;
+        encode(input?: string): Uint8Array;
+        encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/v8.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/v8.d.ts
new file mode 100644 (file)
index 0000000..7d95082
--- /dev/null
@@ -0,0 +1,187 @@
+declare module "v8" {
+    import { Readable } from "stream";
+
+    interface HeapSpaceInfo {
+        space_name: string;
+        space_size: number;
+        space_used_size: number;
+        space_available_size: number;
+        physical_space_size: number;
+    }
+
+    // ** Signifies if the --zap_code_space option is enabled or not.  1 == enabled, 0 == disabled. */
+    type DoesZapCodeSpaceFlag = 0 | 1;
+
+    interface HeapInfo {
+        total_heap_size: number;
+        total_heap_size_executable: number;
+        total_physical_size: number;
+        total_available_size: number;
+        used_heap_size: number;
+        heap_size_limit: number;
+        malloced_memory: number;
+        peak_malloced_memory: number;
+        does_zap_garbage: DoesZapCodeSpaceFlag;
+        number_of_native_contexts: number;
+        number_of_detached_contexts: number;
+    }
+
+    interface HeapCodeStatistics {
+        code_and_metadata_size: number;
+        bytecode_and_metadata_size: number;
+        external_script_source_size: number;
+    }
+
+    /**
+     * Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features.
+     * This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8.
+     */
+    function cachedDataVersionTag(): number;
+
+    function getHeapStatistics(): HeapInfo;
+    function getHeapSpaceStatistics(): HeapSpaceInfo[];
+    function setFlagsFromString(flags: string): void;
+    /**
+     * Generates a snapshot of the current V8 heap and returns a Readable
+     * Stream that may be used to read the JSON serialized representation.
+     * This conversation was marked as resolved by joyeecheung
+     * This JSON stream format is intended to be used with tools such as
+     * Chrome DevTools. The JSON schema is undocumented and specific to the
+     * V8 engine, and may change from one version of V8 to the next.
+     */
+    function getHeapSnapshot(): Readable;
+
+    /**
+     *
+     * @param fileName The file path where the V8 heap snapshot is to be
+     * saved. If not specified, a file name with the pattern
+     * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
+     * generated, where `{pid}` will be the PID of the Node.js process,
+     * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
+     * the main Node.js thread or the id of a worker thread.
+     */
+    function writeHeapSnapshot(fileName?: string): string;
+
+    function getHeapCodeStatistics(): HeapCodeStatistics;
+
+    class Serializer {
+        /**
+         * Writes out a header, which includes the serialization format version.
+         */
+        writeHeader(): void;
+
+        /**
+         * Serializes a JavaScript value and adds the serialized representation to the internal buffer.
+         * This throws an error if value cannot be serialized.
+         */
+        writeValue(val: any): boolean;
+
+        /**
+         * Returns the stored internal buffer.
+         * This serializer should not be used once the buffer is released.
+         * Calling this method results in undefined behavior if a previous write has failed.
+         */
+        releaseBuffer(): Buffer;
+
+        /**
+         * Marks an ArrayBuffer as having its contents transferred out of band.\
+         * Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().
+         */
+        transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
+
+        /**
+         * Write a raw 32-bit unsigned integer.
+         */
+        writeUint32(value: number): void;
+
+        /**
+         * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
+         */
+        writeUint64(hi: number, lo: number): void;
+
+        /**
+         * Write a JS number value.
+         */
+        writeDouble(value: number): void;
+
+        /**
+         * Write raw bytes into the serializer’s internal buffer.
+         * The deserializer will require a way to compute the length of the buffer.
+         */
+        writeRawBytes(buffer: NodeJS.TypedArray): void;
+    }
+
+    /**
+     * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
+     * and only stores the part of their underlying `ArrayBuffers` that they are referring to.
+     */
+    class DefaultSerializer extends Serializer {
+    }
+
+    class Deserializer {
+        constructor(data: NodeJS.TypedArray);
+        /**
+         * Reads and validates a header (including the format version).
+         * May, for example, reject an invalid or unsupported wire format.
+         * In that case, an Error is thrown.
+         */
+        readHeader(): boolean;
+
+        /**
+         * Deserializes a JavaScript value from the buffer and returns it.
+         */
+        readValue(): any;
+
+        /**
+         * Marks an ArrayBuffer as having its contents transferred out of band.
+         * Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer()
+         * (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).
+         */
+        transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
+
+        /**
+         * Reads the underlying wire format version.
+         * Likely mostly to be useful to legacy code reading old wire format versions.
+         * May not be called before .readHeader().
+         */
+        getWireFormatVersion(): number;
+
+        /**
+         * Read a raw 32-bit unsigned integer and return it.
+         */
+        readUint32(): number;
+
+        /**
+         * Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.
+         */
+        readUint64(): [number, number];
+
+        /**
+         * Read a JS number value.
+         */
+        readDouble(): number;
+
+        /**
+         * Read raw bytes from the deserializer’s internal buffer.
+         * The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().
+         */
+        readRawBytes(length: number): Buffer;
+    }
+
+    /**
+     * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
+     * and only stores the part of their underlying `ArrayBuffers` that they are referring to.
+     */
+    class DefaultDeserializer extends Deserializer {
+    }
+
+    /**
+     * Uses a `DefaultSerializer` to serialize value into a buffer.
+     */
+    function serialize(value: any): Buffer;
+
+    /**
+     * Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
+     */
+    function deserialize(data: NodeJS.TypedArray): any;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/vm.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/vm.d.ts
new file mode 100644 (file)
index 0000000..66bea63
--- /dev/null
@@ -0,0 +1,142 @@
+declare module "vm" {
+    interface Context extends NodeJS.Dict<any> { }
+    interface BaseOptions {
+        /**
+         * Specifies the filename used in stack traces produced by this script.
+         * Default: `''`.
+         */
+        filename?: string;
+        /**
+         * Specifies the line number offset that is displayed in stack traces produced by this script.
+         * Default: `0`.
+         */
+        lineOffset?: number;
+        /**
+         * Specifies the column number offset that is displayed in stack traces produced by this script.
+         * Default: `0`
+         */
+        columnOffset?: number;
+    }
+    interface ScriptOptions extends BaseOptions {
+        displayErrors?: boolean;
+        timeout?: number;
+        cachedData?: Buffer;
+        produceCachedData?: boolean;
+    }
+    interface RunningScriptOptions extends BaseOptions {
+        /**
+         * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
+         * Default: `true`.
+         */
+        displayErrors?: boolean;
+        /**
+         * Specifies the number of milliseconds to execute code before terminating execution.
+         * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
+         */
+        timeout?: number;
+        /**
+         * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
+         * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
+         * If execution is terminated, an `Error` will be thrown.
+         * Default: `false`.
+         */
+        breakOnSigint?: boolean;
+    }
+    interface CompileFunctionOptions extends BaseOptions {
+        /**
+         * Provides an optional data with V8's code cache data for the supplied source.
+         */
+        cachedData?: Buffer;
+        /**
+         * Specifies whether to produce new cache data.
+         * Default: `false`,
+         */
+        produceCachedData?: boolean;
+        /**
+         * The sandbox/context in which the said function should be compiled in.
+         */
+        parsingContext?: Context;
+
+        /**
+         * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
+         */
+        contextExtensions?: Object[];
+    }
+
+    interface CreateContextOptions {
+        /**
+         * Human-readable name of the newly created context.
+         * @default 'VM Context i' Where i is an ascending numerical index of the created context.
+         */
+        name?: string;
+        /**
+         * Corresponds to the newly created context for display purposes.
+         * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
+         * like the value of the `url.origin` property of a URL object.
+         * Most notably, this string should omit the trailing slash, as that denotes a path.
+         * @default ''
+         */
+        origin?: string;
+        codeGeneration?: {
+            /**
+             * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
+             * will throw an EvalError.
+             * @default true
+             */
+            strings?: boolean;
+            /**
+             * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
+             * @default true
+             */
+            wasm?: boolean;
+        };
+    }
+
+    type MeasureMemoryMode = 'summary' | 'detailed';
+
+    interface MeasureMemoryOptions {
+        /**
+         * @default 'summary'
+         */
+        mode?: MeasureMemoryMode;
+        context?: Context;
+    }
+
+    interface MemoryMeasurement {
+        total: {
+            jsMemoryEstimate: number;
+            jsMemoryRange: [number, number];
+        };
+    }
+
+    class Script {
+        constructor(code: string, options?: ScriptOptions);
+        runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
+        runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
+        runInThisContext(options?: RunningScriptOptions): any;
+        createCachedData(): Buffer;
+    }
+    function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
+    function isContext(sandbox: Context): boolean;
+    function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
+    function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
+    function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
+    function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function;
+
+    /**
+     * Measure the memory known to V8 and used by the current execution context or a specified context.
+     *
+     * The format of the object that the returned Promise may resolve with is
+     * specific to the V8 engine and may change from one version of V8 to the next.
+     *
+     * The returned result is different from the statistics returned by
+     * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures
+     * the memory reachable by V8 from a specific context, while
+     * `v8.getHeapSpaceStatistics()` measures the memory used by an instance
+     * of V8 engine, which can switch among multiple contexts that reference
+     * objects in the heap of one engine.
+     *
+     * @experimental
+     */
+    function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/wasi.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/wasi.d.ts
new file mode 100644 (file)
index 0000000..21f64fa
--- /dev/null
@@ -0,0 +1,55 @@
+declare module 'wasi' {
+    interface WASIOptions {
+        /**
+         * An array of strings that the WebAssembly application will
+         * see as command line arguments. The first argument is the virtual path to the
+         * WASI command itself.
+         */
+        args?: string[];
+
+        /**
+         * An object similar to `process.env` that the WebAssembly
+         * application will see as its environment.
+         */
+        env?: object;
+
+        /**
+         * This object represents the WebAssembly application's
+         * sandbox directory structure. The string keys of `preopens` are treated as
+         * directories within the sandbox. The corresponding values in `preopens` are
+         * the real paths to those directories on the host machine.
+         */
+        preopens?: NodeJS.Dict<string>;
+
+        /**
+         * By default, WASI applications terminate the Node.js
+         * process via the `__wasi_proc_exit()` function. Setting this option to `true`
+         * causes `wasi.start()` to return the exit code rather than terminate the
+         * process.
+         * @default false
+         */
+        returnOnExit?: boolean;
+    }
+
+    class WASI {
+        constructor(options?: WASIOptions);
+        /**
+         *
+         * Attempt to begin execution of `instance` by invoking its `_start()` export.
+         * If `instance` does not contain a `_start()` export, then `start()` attempts to
+         * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
+         * is present on `instance`, then `start()` does nothing.
+         *
+         * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
+         * `memory`. If `instance` does not have a `memory` export an exception is thrown.
+         */
+        start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
+
+        /**
+         * Is an object that implements the WASI system call API. This object
+         * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
+         * [`WebAssembly.Instance`][].
+         */
+        readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
+    }
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/worker_threads.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/worker_threads.d.ts
new file mode 100644 (file)
index 0000000..8a54db6
--- /dev/null
@@ -0,0 +1,209 @@
+declare module "worker_threads" {
+    import { Context } from "vm";
+    import { EventEmitter } from "events";
+    import { Readable, Writable } from "stream";
+    import { URL } from "url";
+
+    const isMainThread: boolean;
+    const parentPort: null | MessagePort;
+    const resourceLimits: ResourceLimits;
+    const SHARE_ENV: unique symbol;
+    const threadId: number;
+    const workerData: any;
+
+    class MessageChannel {
+        readonly port1: MessagePort;
+        readonly port2: MessagePort;
+    }
+
+    type TransferListItem = ArrayBuffer | MessagePort;
+
+    class MessagePort extends EventEmitter {
+        close(): void;
+        postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void;
+        ref(): void;
+        unref(): void;
+        start(): void;
+
+        addListener(event: "close", listener: () => void): this;
+        addListener(event: "message", listener: (value: any) => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "close"): boolean;
+        emit(event: "message", value: any): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "close", listener: () => void): this;
+        on(event: "message", listener: (value: any) => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "close", listener: () => void): this;
+        once(event: "message", listener: (value: any) => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "close", listener: () => void): this;
+        prependListener(event: "message", listener: (value: any) => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "close", listener: () => void): this;
+        prependOnceListener(event: "message", listener: (value: any) => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        removeListener(event: "close", listener: () => void): this;
+        removeListener(event: "message", listener: (value: any) => void): this;
+        removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        off(event: "close", listener: () => void): this;
+        off(event: "message", listener: (value: any) => void): this;
+        off(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    interface WorkerOptions {
+        /**
+         * List of arguments which would be stringified and appended to
+         * `process.argv` in the worker. This is mostly similar to the `workerData`
+         * but the values will be available on the global `process.argv` as if they
+         * were passed as CLI options to the script.
+         */
+        argv?: any[];
+        env?: NodeJS.Dict<string> | typeof SHARE_ENV;
+        eval?: boolean;
+        workerData?: any;
+        stdin?: boolean;
+        stdout?: boolean;
+        stderr?: boolean;
+        execArgv?: string[];
+        resourceLimits?: ResourceLimits;
+        /**
+         * Additional data to send in the first worker message.
+         */
+        transferList?: TransferListItem[];
+    }
+
+    interface ResourceLimits {
+        maxYoungGenerationSizeMb?: number;
+        maxOldGenerationSizeMb?: number;
+        codeRangeSizeMb?: number;
+    }
+
+    interface ResourceLimits {
+        /**
+         * The maximum size of a heap space for recently created objects.
+         */
+        maxYoungGenerationSizeMb?: number;
+        /**
+         * The maximum size of the main heap in MB.
+         */
+        maxOldGenerationSizeMb?: number;
+        /**
+         * The size of a pre-allocated memory range used for generated code.
+         */
+        codeRangeSizeMb?: number;
+    }
+
+    class Worker extends EventEmitter {
+        readonly stdin: Writable | null;
+        readonly stdout: Readable;
+        readonly stderr: Readable;
+        readonly threadId: number;
+        readonly resourceLimits?: ResourceLimits;
+
+        /**
+         * @param filename  The path to the Worker’s main script or module.
+         *                  Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with ./ or ../,
+         *                  or a WHATWG URL object using file: protocol. If options.eval is true, this is a string containing JavaScript code rather than a path.
+         */
+        constructor(filename: string | URL, options?: WorkerOptions);
+
+        postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void;
+        ref(): void;
+        unref(): void;
+        /**
+         * Stop all JavaScript execution in the worker thread as soon as possible.
+         * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted.
+         */
+        terminate(): Promise<number>;
+
+        /**
+         * Returns a readable stream for a V8 snapshot of the current state of the Worker.
+         * See [`v8.getHeapSnapshot()`][] for more details.
+         *
+         * If the Worker thread is no longer running, which may occur before the
+         * [`'exit'` event][] is emitted, the returned `Promise` will be rejected
+         * immediately with an [`ERR_WORKER_NOT_RUNNING`][] error
+         */
+        getHeapSnapshot(): Promise<Readable>;
+
+        addListener(event: "error", listener: (err: Error) => void): this;
+        addListener(event: "exit", listener: (exitCode: number) => void): this;
+        addListener(event: "message", listener: (value: any) => void): this;
+        addListener(event: "online", listener: () => void): this;
+        addListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        emit(event: "error", err: Error): boolean;
+        emit(event: "exit", exitCode: number): boolean;
+        emit(event: "message", value: any): boolean;
+        emit(event: "online"): boolean;
+        emit(event: string | symbol, ...args: any[]): boolean;
+
+        on(event: "error", listener: (err: Error) => void): this;
+        on(event: "exit", listener: (exitCode: number) => void): this;
+        on(event: "message", listener: (value: any) => void): this;
+        on(event: "online", listener: () => void): this;
+        on(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        once(event: "error", listener: (err: Error) => void): this;
+        once(event: "exit", listener: (exitCode: number) => void): this;
+        once(event: "message", listener: (value: any) => void): this;
+        once(event: "online", listener: () => void): this;
+        once(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependListener(event: "error", listener: (err: Error) => void): this;
+        prependListener(event: "exit", listener: (exitCode: number) => void): this;
+        prependListener(event: "message", listener: (value: any) => void): this;
+        prependListener(event: "online", listener: () => void): this;
+        prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        prependOnceListener(event: "error", listener: (err: Error) => void): this;
+        prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
+        prependOnceListener(event: "message", listener: (value: any) => void): this;
+        prependOnceListener(event: "online", listener: () => void): this;
+        prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        removeListener(event: "error", listener: (err: Error) => void): this;
+        removeListener(event: "exit", listener: (exitCode: number) => void): this;
+        removeListener(event: "message", listener: (value: any) => void): this;
+        removeListener(event: "online", listener: () => void): this;
+        removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
+
+        off(event: "error", listener: (err: Error) => void): this;
+        off(event: "exit", listener: (exitCode: number) => void): this;
+        off(event: "message", listener: (value: any) => void): this;
+        off(event: "online", listener: () => void): this;
+        off(event: string | symbol, listener: (...args: any[]) => void): this;
+    }
+
+    /**
+     * Transfer a `MessagePort` to a different `vm` Context. The original `port`
+     * object will be rendered unusable, and the returned `MessagePort` instance will
+     * take its place.
+     *
+     * The returned `MessagePort` will be an object in the target context, and will
+     * inherit from its global `Object` class. Objects passed to the
+     * `port.onmessage()` listener will also be created in the target context
+     * and inherit from its global `Object` class.
+     *
+     * However, the created `MessagePort` will no longer inherit from
+     * `EventEmitter`, and only `port.onmessage()` can be used to receive
+     * events using it.
+     */
+    function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
+
+    /**
+     * Receive a single message from a given `MessagePort`. If no message is available,
+     * `undefined` is returned, otherwise an object with a single `message` property
+     * that contains the message payload, corresponding to the oldest message in the
+     * `MessagePort`’s queue.
+     */
+    function receiveMessageOnPort(port: MessagePort): { message: any } | undefined;
+}
diff --git a/legacy-libs/protobufjs/node_modules/@types/node/zlib.d.ts b/legacy-libs/protobufjs/node_modules/@types/node/zlib.d.ts
new file mode 100644 (file)
index 0000000..95ba18f
--- /dev/null
@@ -0,0 +1,353 @@
+declare module "zlib" {
+    import * as stream from "stream";
+
+    interface ZlibOptions {
+        /**
+         * @default constants.Z_NO_FLUSH
+         */
+        flush?: number;
+        /**
+         * @default constants.Z_FINISH
+         */
+        finishFlush?: number;
+        /**
+         * @default 16*1024
+         */
+        chunkSize?: number;
+        windowBits?: number;
+        level?: number; // compression only
+        memLevel?: number; // compression only
+        strategy?: number; // compression only
+        dictionary?: NodeJS.ArrayBufferView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
+        info?: boolean;
+    }
+
+    interface BrotliOptions {
+        /**
+         * @default constants.BROTLI_OPERATION_PROCESS
+         */
+        flush?: number;
+        /**
+         * @default constants.BROTLI_OPERATION_FINISH
+         */
+        finishFlush?: number;
+        /**
+         * @default 16*1024
+         */
+        chunkSize?: number;
+        params?: {
+            /**
+             * Each key is a `constants.BROTLI_*` constant.
+             */
+            [key: number]: boolean | number;
+        };
+    }
+
+    interface Zlib {
+        /** @deprecated Use bytesWritten instead. */
+        readonly bytesRead: number;
+        readonly bytesWritten: number;
+        shell?: boolean | string;
+        close(callback?: () => void): void;
+        flush(kind?: number | (() => void), callback?: () => void): void;
+    }
+
+    interface ZlibParams {
+        params(level: number, strategy: number, callback: () => void): void;
+    }
+
+    interface ZlibReset {
+        reset(): void;
+    }
+
+    interface BrotliCompress extends stream.Transform, Zlib { }
+    interface BrotliDecompress extends stream.Transform, Zlib { }
+    interface Gzip extends stream.Transform, Zlib { }
+    interface Gunzip extends stream.Transform, Zlib { }
+    interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { }
+    interface Inflate extends stream.Transform, Zlib, ZlibReset { }
+    interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { }
+    interface InflateRaw extends stream.Transform, Zlib, ZlibReset { }
+    interface Unzip extends stream.Transform, Zlib { }
+
+    function createBrotliCompress(options?: BrotliOptions): BrotliCompress;
+    function createBrotliDecompress(options?: BrotliOptions): BrotliDecompress;
+    function createGzip(options?: ZlibOptions): Gzip;
+    function createGunzip(options?: ZlibOptions): Gunzip;
+    function createDeflate(options?: ZlibOptions): Deflate;
+    function createInflate(options?: ZlibOptions): Inflate;
+    function createDeflateRaw(options?: ZlibOptions): DeflateRaw;
+    function createInflateRaw(options?: ZlibOptions): InflateRaw;
+    function createUnzip(options?: ZlibOptions): Unzip;
+
+    type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
+
+    type CompressCallback = (error: Error | null, result: Buffer) => void;
+
+    function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
+    function brotliCompress(buf: InputType, callback: CompressCallback): void;
+    function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
+    function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
+    function brotliDecompress(buf: InputType, callback: CompressCallback): void;
+    function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
+    function deflate(buf: InputType, callback: CompressCallback): void;
+    function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
+    function deflateRaw(buf: InputType, callback: CompressCallback): void;
+    function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
+    function gzip(buf: InputType, callback: CompressCallback): void;
+    function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+    function gunzip(buf: InputType, callback: CompressCallback): void;
+    function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+    function inflate(buf: InputType, callback: CompressCallback): void;
+    function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
+    function inflateRaw(buf: InputType, callback: CompressCallback): void;
+    function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
+    function unzip(buf: InputType, callback: CompressCallback): void;
+    function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
+    function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
+
+    namespace constants {
+        const BROTLI_DECODE: number;
+        const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
+        const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: number;
+        const BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: number;
+        const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: number;
+        const BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: number;
+        const BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: number;
+        const BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: number;
+        const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: number;
+        const BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: number;
+        const BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: number;
+        const BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: number;
+        const BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: number;
+        const BROTLI_DECODER_ERROR_FORMAT_DISTANCE: number;
+        const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: number;
+        const BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: number;
+        const BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: number;
+        const BROTLI_DECODER_ERROR_FORMAT_PADDING_1: number;
+        const BROTLI_DECODER_ERROR_FORMAT_PADDING_2: number;
+        const BROTLI_DECODER_ERROR_FORMAT_RESERVED: number;
+        const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: number;
+        const BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: number;
+        const BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: number;
+        const BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: number;
+        const BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: number;
+        const BROTLI_DECODER_ERROR_UNREACHABLE: number;
+        const BROTLI_DECODER_NEEDS_MORE_INPUT: number;
+        const BROTLI_DECODER_NEEDS_MORE_OUTPUT: number;
+        const BROTLI_DECODER_NO_ERROR: number;
+        const BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: number;
+        const BROTLI_DECODER_PARAM_LARGE_WINDOW: number;
+        const BROTLI_DECODER_RESULT_ERROR: number;
+        const BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: number;
+        const BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: number;
+        const BROTLI_DECODER_RESULT_SUCCESS: number;
+        const BROTLI_DECODER_SUCCESS: number;
+
+        const BROTLI_DEFAULT_MODE: number;
+        const BROTLI_DEFAULT_QUALITY: number;
+        const BROTLI_DEFAULT_WINDOW: number;
+        const BROTLI_ENCODE: number;
+        const BROTLI_LARGE_MAX_WINDOW_BITS: number;
+        const BROTLI_MAX_INPUT_BLOCK_BITS: number;
+        const BROTLI_MAX_QUALITY: number;
+        const BROTLI_MAX_WINDOW_BITS: number;
+        const BROTLI_MIN_INPUT_BLOCK_BITS: number;
+        const BROTLI_MIN_QUALITY: number;
+        const BROTLI_MIN_WINDOW_BITS: number;
+
+        const BROTLI_MODE_FONT: number;
+        const BROTLI_MODE_GENERIC: number;
+        const BROTLI_MODE_TEXT: number;
+
+        const BROTLI_OPERATION_EMIT_METADATA: number;
+        const BROTLI_OPERATION_FINISH: number;
+        const BROTLI_OPERATION_FLUSH: number;
+        const BROTLI_OPERATION_PROCESS: number;
+
+        const BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: number;
+        const BROTLI_PARAM_LARGE_WINDOW: number;
+        const BROTLI_PARAM_LGBLOCK: number;
+        const BROTLI_PARAM_LGWIN: number;
+        const BROTLI_PARAM_MODE: number;
+        const BROTLI_PARAM_NDIRECT: number;
+        const BROTLI_PARAM_NPOSTFIX: number;
+        const BROTLI_PARAM_QUALITY: number;
+        const BROTLI_PARAM_SIZE_HINT: number;
+
+        const DEFLATE: number;
+        const DEFLATERAW: number;
+        const GUNZIP: number;
+        const GZIP: number;
+        const INFLATE: number;
+        const INFLATERAW: number;
+        const UNZIP: number;
+
+        const Z_BEST_COMPRESSION: number;
+        const Z_BEST_SPEED: number;
+        const Z_BLOCK: number;
+        const Z_BUF_ERROR: number;
+        const Z_DATA_ERROR: number;
+
+        const Z_DEFAULT_CHUNK: number;
+        const Z_DEFAULT_COMPRESSION: number;
+        const Z_DEFAULT_LEVEL: number;
+        const Z_DEFAULT_MEMLEVEL: number;
+        const Z_DEFAULT_STRATEGY: number;
+        const Z_DEFAULT_WINDOWBITS: number;
+
+        const Z_ERRNO: number;
+        const Z_FILTERED: number;
+        const Z_FINISH: number;
+        const Z_FIXED: number;
+        const Z_FULL_FLUSH: number;
+        const Z_HUFFMAN_ONLY: number;
+        const Z_MAX_CHUNK: number;
+        const Z_MAX_LEVEL: number;
+        const Z_MAX_MEMLEVEL: number;
+        const Z_MAX_WINDOWBITS: number;
+        const Z_MEM_ERROR: number;
+        const Z_MIN_CHUNK: number;
+        const Z_MIN_LEVEL: number;
+        const Z_MIN_MEMLEVEL: number;
+        const Z_MIN_WINDOWBITS: number;
+        const Z_NEED_DICT: number;
+        const Z_NO_COMPRESSION: number;
+        const Z_NO_FLUSH: number;
+        const Z_OK: number;
+        const Z_PARTIAL_FLUSH: number;
+        const Z_RLE: number;
+        const Z_STREAM_END: number;
+        const Z_STREAM_ERROR: number;
+        const Z_SYNC_FLUSH: number;
+        const Z_VERSION_ERROR: number;
+        const ZLIB_VERNUM: number;
+    }
+
+    /**
+     * @deprecated
+     */
+    const Z_NO_FLUSH: number;
+    /**
+     * @deprecated
+     */
+    const Z_PARTIAL_FLUSH: number;
+    /**
+     * @deprecated
+     */
+    const Z_SYNC_FLUSH: number;
+    /**
+     * @deprecated
+     */
+    const Z_FULL_FLUSH: number;
+    /**
+     * @deprecated
+     */
+    const Z_FINISH: number;
+    /**
+     * @deprecated
+     */
+    const Z_BLOCK: number;
+    /**
+     * @deprecated
+     */
+    const Z_TREES: number;
+    /**
+     * @deprecated
+     */
+    const Z_OK: number;
+    /**
+     * @deprecated
+     */
+    const Z_STREAM_END: number;
+    /**
+     * @deprecated
+     */
+    const Z_NEED_DICT: number;
+    /**
+     * @deprecated
+     */
+    const Z_ERRNO: number;
+    /**
+     * @deprecated
+     */
+    const Z_STREAM_ERROR: number;
+    /**
+     * @deprecated
+     */
+    const Z_DATA_ERROR: number;
+    /**
+     * @deprecated
+     */
+    const Z_MEM_ERROR: number;
+    /**
+     * @deprecated
+     */
+    const Z_BUF_ERROR: number;
+    /**
+     * @deprecated
+     */
+    const Z_VERSION_ERROR: number;
+    /**
+     * @deprecated
+     */
+    const Z_NO_COMPRESSION: number;
+    /**
+     * @deprecated
+     */
+    const Z_BEST_SPEED: number;
+    /**
+     * @deprecated
+     */
+    const Z_BEST_COMPRESSION: number;
+    /**
+     * @deprecated
+     */
+    const Z_DEFAULT_COMPRESSION: number;
+    /**
+     * @deprecated
+     */
+    const Z_FILTERED: number;
+    /**
+     * @deprecated
+     */
+    const Z_HUFFMAN_ONLY: number;
+    /**
+     * @deprecated
+     */
+    const Z_RLE: number;
+    /**
+     * @deprecated
+     */
+    const Z_FIXED: number;
+    /**
+     * @deprecated
+     */
+    const Z_DEFAULT_STRATEGY: number;
+    /**
+     * @deprecated
+     */
+    const Z_BINARY: number;
+    /**
+     * @deprecated
+     */
+    const Z_TEXT: number;
+    /**
+     * @deprecated
+     */
+    const Z_ASCII: number;
+    /**
+     * @deprecated
+     */
+    const Z_UNKNOWN: number;
+    /**
+     * @deprecated
+     */
+    const Z_DEFLATED: number;
+}
index 51f357d..d1aad3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6722=['contactManager','integration','motionbar','jscripty','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0xb38b0,_0x312844){var _0x1f6b89=function(_0x34ccf1){while(--_0x34ccf1){_0xb38b0['push'](_0xb38b0['shift']());}};_0x1f6b89(++_0x312844);}(_0x6722,0x12d));var _0x2672=function(_0x47e80f,_0x38f1f6){_0x47e80f=_0x47e80f-0x0;var _0x4a7fe2=_0x6722[_0x47e80f];return _0x4a7fe2;};'use strict';var Sequelize=require(_0x2672('0x0'));module[_0x2672('0x1')]={'name':{'type':Sequelize[_0x2672('0x2')],'get':function(_0x372687){return this[_0x2672('0x3')]('action');}},'action':{'type':Sequelize[_0x2672('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2672('0x5'),_0x2672('0x6'),_0x2672('0x7'),_0x2672('0x8'),'urlForward',_0x2672('0x9'),_0x2672('0xa'),'script']],'msg':_0x2672('0xb')}},'comment':_0x2672('0xb')},'data1':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xc')},'data2':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xd')},'data3':{'type':Sequelize[_0x2672('0x4')](0x1000),'comment':_0x2672('0xe')},'data4':{'type':Sequelize[_0x2672('0x4')](0x1000),'comments':_0x2672('0xf')},'data5':{'type':Sequelize[_0x2672('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x2672('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize['TEXT'],'comments':_0x2672('0x10')}};
\ No newline at end of file
+var _0x7588=['urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'];(function(_0x43946b,_0x22fa8d){var _0x683065=function(_0x131c44){while(--_0x131c44){_0x43946b['push'](_0x43946b['shift']());}};_0x683065(++_0x22fa8d);}(_0x7588,0x97));var _0x8758=function(_0x49319d,_0x463ab9){_0x49319d=_0x49319d-0x0;var _0x510c9d=_0x7588[_0x49319d];return _0x510c9d;};'use strict';var Sequelize=require(_0x8758('0x0'));module[_0x8758('0x1')]={'name':{'type':Sequelize[_0x8758('0x2')],'get':function(_0x53a575){return this[_0x8758('0x3')](_0x8758('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8758('0x5'),_0x8758('0x6'),'motionbar',_0x8758('0x7'),_0x8758('0x8'),_0x8758('0x9'),_0x8758('0xa'),_0x8758('0xb')]],'msg':_0x8758('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x8758('0xd')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8758('0xe')},'data3':{'type':Sequelize[_0x8758('0xd')](0x1000),'comment':_0x8758('0xf')},'data4':{'type':Sequelize[_0x8758('0xd')](0x1000),'comments':_0x8758('0x10')},'data5':{'type':Sequelize[_0x8758('0xd')](0x1000),'comments':_0x8758('0x11')},'data6':{'type':Sequelize[_0x8758('0xd')],'comments':_0x8758('0x12')},'data7':{'type':Sequelize[_0x8758('0x13')],'comments':_0x8758('0x14')}};
\ No newline at end of file
index cc9e7f8..66e75ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc65c=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','save','update','destroy','error','stack','name','send','body','Action','find','params','then','catch','eml-format','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x424a50,_0x1fd66d){var _0x1427b2=function(_0x35f2a0){while(--_0x35f2a0){_0x424a50['push'](_0x424a50['shift']());}};_0x1427b2(++_0x1fd66d);}(_0xc65c,0x124));var _0xcc65=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xc65c[_0x4ea413];return _0x51cf25;};'use strict';var emlformat=require(_0xcc65('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcc65('0x1'));var moment=require(_0xcc65('0x2'));var BPromise=require(_0xcc65('0x3'));var Mustache=require(_0xcc65('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcc65('0x5'));var ejs=require(_0xcc65('0x6'));var fs=require('fs');var fs_extra=require(_0xcc65('0x7'));var _=require(_0xcc65('0x8'));var squel=require(_0xcc65('0x9'));var crypto=require(_0xcc65('0xa'));var jsforce=require(_0xcc65('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcc65('0x5'));var querystring=require(_0xcc65('0xc'));var Papa=require(_0xcc65('0xd'));var Redis=require(_0xcc65('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcc65('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcc65('0x10'));var logger=require(_0xcc65('0x11'))('api');var utils=require(_0xcc65('0x12'));var config=require(_0xcc65('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xcc65('0x14'))['db'];function respondWithStatusCode(_0x1fb428,_0xf105aa){_0xf105aa=_0xf105aa||0xcc;return function(_0x1a4aee){if(_0x1a4aee){return _0x1fb428[_0xcc65('0x15')](_0xf105aa);}return _0x1fb428[_0xcc65('0x16')](_0xf105aa)[_0xcc65('0x17')]();};}function respondWithResult(_0x212a2d,_0x3bfd84){_0x3bfd84=_0x3bfd84||0xc8;return function(_0x37c403){if(_0x37c403){return _0x212a2d[_0xcc65('0x16')](_0x3bfd84)['json'](_0x37c403);}};}function respondWithFilteredResult(_0xbc44cf,_0x1d0612){return function(_0x56bb39){if(_0x56bb39){var _0x2ce91e=typeof _0x1d0612[_0xcc65('0x18')]===_0xcc65('0x19')&&typeof _0x1d0612['limit']===_0xcc65('0x19');var _0xe676f7=_0x56bb39[_0xcc65('0x1a')];var _0x16bb3f=_0x2ce91e?0x0:_0x1d0612['offset'];var _0x541eef=_0x2ce91e?_0x56bb39['count']:_0x1d0612['offset']+_0x1d0612[_0xcc65('0x1b')];var _0x104fd8;if(_0x541eef>=_0xe676f7){_0x541eef=_0xe676f7;_0x104fd8=0xc8;}else{_0x104fd8=0xce;}_0xbc44cf[_0xcc65('0x16')](_0x104fd8);return _0xbc44cf[_0xcc65('0x1c')]('Content-Range',_0x16bb3f+'-'+_0x541eef+'/'+_0xe676f7)[_0xcc65('0x1d')](_0x56bb39);}return null;};}function patchUpdates(_0xac8918){return function(_0x456dbe){try{jsonpatch['apply'](_0x456dbe,_0xac8918,!![]);}catch(_0x4ee09c){return BPromise[_0xcc65('0x1e')](_0x4ee09c);}return _0x456dbe[_0xcc65('0x1f')]();};}function saveUpdates(_0x6b36b7,_0x296e71){return function(_0x4c99da){if(_0x4c99da){return _0x4c99da[_0xcc65('0x20')](_0x6b36b7)['then'](function(_0x347d87){return _0x347d87;});}return null;};}function removeEntity(_0x5168d8,_0x37ea5f){return function(_0x5dfd4e){if(_0x5dfd4e){return _0x5dfd4e[_0xcc65('0x21')]()['then'](function(){_0x5168d8[_0xcc65('0x16')](0xcc)[_0xcc65('0x17')]();});}};}function handleEntityNotFound(_0x2d9374,_0x190137){return function(_0x2afc46){if(!_0x2afc46){_0x2d9374[_0xcc65('0x15')](0x194);}return _0x2afc46;};}function handleError(_0x39d57d,_0x1d9b11){_0x1d9b11=_0x1d9b11||0x1f4;return function(_0x2949ec){logger[_0xcc65('0x22')](_0x2949ec[_0xcc65('0x23')]);if(_0x2949ec[_0xcc65('0x24')]){delete _0x2949ec['name'];}_0x39d57d[_0xcc65('0x16')](_0x1d9b11)[_0xcc65('0x25')](_0x2949ec);};}exports[_0xcc65('0x20')]=function(_0x411823,_0x45f444){if(_0x411823[_0xcc65('0x26')]['id']){delete _0x411823[_0xcc65('0x26')]['id'];}return db[_0xcc65('0x27')][_0xcc65('0x28')]({'where':{'id':_0x411823[_0xcc65('0x29')]['id']}})[_0xcc65('0x2a')](handleEntityNotFound(_0x45f444,null))[_0xcc65('0x2a')](saveUpdates(_0x411823[_0xcc65('0x26')],null))[_0xcc65('0x2a')](respondWithResult(_0x45f444,null))[_0xcc65('0x2b')](handleError(_0x45f444,null));};exports[_0xcc65('0x21')]=function(_0x366c27,_0x63510){return db[_0xcc65('0x27')][_0xcc65('0x28')]({'where':{'id':_0x366c27[_0xcc65('0x29')]['id']}})['then'](handleEntityNotFound(_0x63510,null))[_0xcc65('0x2a')](removeEntity(_0x63510,null))[_0xcc65('0x2b')](handleError(_0x63510,null));};
\ No newline at end of file
+var _0x37d9=['path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','find','params','catch','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x4889b1,_0x119316){var _0x226cd4=function(_0x163577){while(--_0x163577){_0x4889b1['push'](_0x4889b1['shift']());}};_0x226cd4(++_0x119316);}(_0x37d9,0xdf));var _0x937d=function(_0x567058,_0x58309e){_0x567058=_0x567058-0x0;var _0x3f8fda=_0x37d9[_0x567058];return _0x3f8fda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x937d('0x0'));var zipdir=require(_0x937d('0x1'));var jsonpatch=require(_0x937d('0x2'));var rp=require('request-promise');var moment=require(_0x937d('0x3'));var BPromise=require(_0x937d('0x4'));var Mustache=require(_0x937d('0x5'));var util=require(_0x937d('0x6'));var path=require(_0x937d('0x7'));var sox=require(_0x937d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x937d('0x9'));var _=require('lodash');var squel=require(_0x937d('0xa'));var crypto=require(_0x937d('0xb'));var jsforce=require(_0x937d('0xc'));var deskjs=require(_0x937d('0xd'));var toCsv=require(_0x937d('0xe'));var querystring=require(_0x937d('0xf'));var Papa=require('papaparse');var Redis=require(_0x937d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x937d('0x11'));var as=require(_0x937d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x937d('0x13'))(_0x937d('0x14'));var utils=require(_0x937d('0x15'));var config=require(_0x937d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x937d('0x17'))['db'];function respondWithStatusCode(_0x2fc73e,_0x1626a8){_0x1626a8=_0x1626a8||0xcc;return function(_0x1323b7){if(_0x1323b7){return _0x2fc73e[_0x937d('0x18')](_0x1626a8);}return _0x2fc73e[_0x937d('0x19')](_0x1626a8)[_0x937d('0x1a')]();};}function respondWithResult(_0x20f0e2,_0x3e09b7){_0x3e09b7=_0x3e09b7||0xc8;return function(_0xb7061){if(_0xb7061){return _0x20f0e2['status'](_0x3e09b7)[_0x937d('0x1b')](_0xb7061);}};}function respondWithFilteredResult(_0x564196,_0x5a6956){return function(_0x999048){if(_0x999048){var _0x5b91b1=typeof _0x5a6956['offset']==='undefined'&&typeof _0x5a6956[_0x937d('0x1c')]==='undefined';var _0x3102dc=_0x999048[_0x937d('0x1d')];var _0x35ce50=_0x5b91b1?0x0:_0x5a6956['offset'];var _0x45c5d7=_0x5b91b1?_0x999048['count']:_0x5a6956[_0x937d('0x1e')]+_0x5a6956[_0x937d('0x1c')];var _0x239140;if(_0x45c5d7>=_0x3102dc){_0x45c5d7=_0x3102dc;_0x239140=0xc8;}else{_0x239140=0xce;}_0x564196['status'](_0x239140);return _0x564196[_0x937d('0x1f')](_0x937d('0x20'),_0x35ce50+'-'+_0x45c5d7+'/'+_0x3102dc)[_0x937d('0x1b')](_0x999048);}return null;};}function patchUpdates(_0x23398e){return function(_0x24e10f){try{jsonpatch[_0x937d('0x21')](_0x24e10f,_0x23398e,!![]);}catch(_0x13baad){return BPromise[_0x937d('0x22')](_0x13baad);}return _0x24e10f[_0x937d('0x23')]();};}function saveUpdates(_0x2e6df1,_0x2c8608){return function(_0x2ee9a5){if(_0x2ee9a5){return _0x2ee9a5[_0x937d('0x24')](_0x2e6df1)[_0x937d('0x25')](function(_0x1bfd2f){return _0x1bfd2f;});}return null;};}function removeEntity(_0x3f195d,_0x56e606){return function(_0x1f5fb7){if(_0x1f5fb7){return _0x1f5fb7[_0x937d('0x26')]()[_0x937d('0x25')](function(){_0x3f195d['status'](0xcc)[_0x937d('0x1a')]();});}};}function handleEntityNotFound(_0x5dc039,_0x591fab){return function(_0x33ed8a){if(!_0x33ed8a){_0x5dc039[_0x937d('0x18')](0x194);}return _0x33ed8a;};}function handleError(_0x580503,_0x369061){_0x369061=_0x369061||0x1f4;return function(_0xeda6ec){logger[_0x937d('0x27')](_0xeda6ec[_0x937d('0x28')]);if(_0xeda6ec[_0x937d('0x29')]){delete _0xeda6ec[_0x937d('0x29')];}_0x580503[_0x937d('0x19')](_0x369061)['send'](_0xeda6ec);};}exports['update']=function(_0x431e45,_0x11b530){if(_0x431e45['body']['id']){delete _0x431e45[_0x937d('0x2a')]['id'];}return db['Action'][_0x937d('0x2b')]({'where':{'id':_0x431e45[_0x937d('0x2c')]['id']}})[_0x937d('0x25')](handleEntityNotFound(_0x11b530,null))[_0x937d('0x25')](saveUpdates(_0x431e45[_0x937d('0x2a')],null))[_0x937d('0x25')](respondWithResult(_0x11b530,null))[_0x937d('0x2d')](handleError(_0x11b530,null));};exports[_0x937d('0x26')]=function(_0x53524b,_0x546ae4){return db['Action'][_0x937d('0x2b')]({'where':{'id':_0x53524b[_0x937d('0x2c')]['id']}})[_0x937d('0x25')](handleEntityNotFound(_0x546ae4,null))['then'](removeEntity(_0x546ae4,null))[_0x937d('0x2d')](handleError(_0x546ae4,null));};
\ No newline at end of file
index 3a0cdf4..e02d8fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad58=['exports','Action','lodash','util','../../config/logger','moment','request-promise','rimraf','./action.attributes'];(function(_0x26df5a,_0xda2483){var _0x4e6eee=function(_0x488ddb){while(--_0x488ddb){_0x26df5a['push'](_0x26df5a['shift']());}};_0x4e6eee(++_0xda2483);}(_0xad58,0x1df));var _0x8ad5=function(_0x217832,_0x34fdea){_0x217832=_0x217832-0x0;var _0x5c0a8b=_0xad58[_0x217832];return _0x5c0a8b;};'use strict';var _=require(_0x8ad5('0x0'));var util=require(_0x8ad5('0x1'));var logger=require(_0x8ad5('0x2'))('api');var moment=require(_0x8ad5('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ad5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8ad5('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ad5('0x6'));module[_0x8ad5('0x7')]=function(_0x288f6a,_0x46af87){return _0x288f6a['define'](_0x8ad5('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2fe5=['path','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util','moment','bluebird','request-promise'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x2fe5,0x14b));var _0x52fe=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fe5[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rp=require(_0x52fe('0x4'));var fs=require('fs');var path=require(_0x52fe('0x5'));var rimraf=require(_0x52fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x52fe('0x7'));module[_0x52fe('0x8')]=function(_0x584af7,_0x2efcaa){return _0x584af7[_0x52fe('0x9')](_0x52fe('0xa'),attributes,{'tableName':_0x52fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 21344da..7bb8e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x2cceac,_0x4f089c){var _0x15ed38=function(_0x326c89){while(--_0x326c89){_0x2cceac['push'](_0x2cceac['shift']());}};_0x15ed38(++_0x4f089c);}(_0xabce,0x103));var _0xeabc=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0xabce[_0x494d1f];return _0x457b6e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x226f31,_0x3d1cfa){var _0x14a410=function(_0x40c762){while(--_0x40c762){_0x226f31['push'](_0x226f31['shift']());}};_0x14a410(++_0x3d1cfa);}(_0xe14b,0x93));var _0xbe14=function(_0xe9e47b,_0x570674){_0xe9e47b=_0xe9e47b-0x0;var _0x171e2d=_0xe14b[_0xe9e47b];return _0x171e2d;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
index 2b2d842..3500ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53d9=['fs-extra','../../config/environment','./action.controller','put','/:id','isAuthenticated','delete','destroy','multer','path','express','Router'];(function(_0x77d76e,_0x106ed2){var _0x5620c8=function(_0x481b37){while(--_0x481b37){_0x77d76e['push'](_0x77d76e['shift']());}};_0x5620c8(++_0x106ed2);}(_0x53d9,0x188));var _0x953d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x953d('0x0'));var util=require('util');var path=require(_0x953d('0x1'));var timeout=require('connect-timeout');var express=require(_0x953d('0x2'));var router=express[_0x953d('0x3')]();var fs_extra=require(_0x953d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x953d('0x5'));var controller=require(_0x953d('0x6'));router[_0x953d('0x7')](_0x953d('0x8'),auth[_0x953d('0x9')](),controller['update']);router[_0x953d('0xa')](_0x953d('0x8'),auth['isAuthenticated'](),controller[_0x953d('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x33c9=['../../components/auth/service','../../components/interaction/service','put','/:id','update','delete','isAuthenticated','destroy','exports','express','Router','fs-extra'];(function(_0x4d4f4f,_0x32b2e2){var _0x5d48bc=function(_0x5a15de){while(--_0x5a15de){_0x4d4f4f['push'](_0x4d4f4f['shift']());}};_0x5d48bc(++_0x32b2e2);}(_0x33c9,0x14d));var _0x933c=function(_0x40373a,_0x51c2c9){_0x40373a=_0x40373a-0x0;var _0x20240e=_0x33c9[_0x40373a];return _0x20240e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x933c('0x0'));var router=express[_0x933c('0x1')]();var fs_extra=require(_0x933c('0x2'));var auth=require(_0x933c('0x3'));var interaction=require(_0x933c('0x4'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x933c('0x5')](_0x933c('0x6'),auth['isAuthenticated'](),controller[_0x933c('0x7')]);router[_0x933c('0x8')]('/:id',auth[_0x933c('0x9')](),controller[_0x933c('0xa')]);module[_0x933c('0xb')]=router;
\ No newline at end of file
index 358e36b..b938d36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x1c28a6,_0x5c2381){var _0x5d622e=function(_0x1f39a9){while(--_0x1f39a9){_0x1c28a6['push'](_0x1c28a6['shift']());}};_0x5d622e(++_0x5c2381);}(_0x5fc3,0xa8));var _0x35fc=function(_0x211fef,_0x4ab716){_0x211fef=_0x211fef-0x0;var _0x5447bf=_0x5fc3[_0x211fef];return _0x5447bf;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x5e56f2,_0x283e7b){var _0x4f71e5=function(_0x7a11e3){while(--_0x7a11e3){_0x5e56f2['push'](_0x5e56f2['shift']());}};_0x4f71e5(++_0x283e7b);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4fa932,_0x2fa9ee){_0x4fa932=_0x4fa932-0x0;var _0x5386f3=_0x3f8a[_0x4fa932];return _0x5386f3;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
index 23997a0..1252413 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cef=['SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','operator','group','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','DATE(%s)','IS\x20NOT\x20EMPTY','table','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','toString','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','metric','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','AnalyticCustomReport','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','user','role','CustomReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'];(function(_0x450e1f,_0x485e1d){var _0x167d06=function(_0x1edd10){while(--_0x1edd10){_0x450e1f['push'](_0x450e1f['shift']());}};_0x167d06(++_0x485e1d);}(_0x0cef,0xe0));var _0xf0ce=function(_0x45adaf,_0x21c3c1){_0x45adaf=_0x45adaf-0x0;var _0x15d189=_0x0cef[_0x45adaf];return _0x15d189;};'use strict';var emlformat=require(_0xf0ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf0ce('0x1'));var jsonpatch=require(_0xf0ce('0x2'));var rp=require(_0xf0ce('0x3'));var moment=require(_0xf0ce('0x4'));var BPromise=require(_0xf0ce('0x5'));var Mustache=require(_0xf0ce('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf0ce('0x7'));var csv=require(_0xf0ce('0x8'));var ejs=require(_0xf0ce('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ce('0xa'));var _=require('lodash');var squel=require(_0xf0ce('0xb'));var crypto=require(_0xf0ce('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0ce('0xd'));var toCsv=require(_0xf0ce('0x8'));var querystring=require(_0xf0ce('0xe'));var Papa=require(_0xf0ce('0xf'));var Redis=require(_0xf0ce('0x10'));var authService=require(_0xf0ce('0x11'));var qs=require(_0xf0ce('0x12'));var as=require(_0xf0ce('0x13'));var hardwareService=require(_0xf0ce('0x14'));var logger=require(_0xf0ce('0x15'))('api');var utils=require(_0xf0ce('0x16'));var config=require(_0xf0ce('0x17'));var licenseUtil=require(_0xf0ce('0x18'));var db=require(_0xf0ce('0x19'))['db'];var dbH=require(_0xf0ce('0x19'))['dbH'];function respondWithStatusCode(_0x599ff9,_0x1a5a6a){_0x1a5a6a=_0x1a5a6a||0xcc;return function(_0x430181){if(_0x430181){return _0x599ff9[_0xf0ce('0x1a')](_0x1a5a6a);}return _0x599ff9['status'](_0x1a5a6a)[_0xf0ce('0x1b')]();};}function respondWithResult(_0x2f4915,_0x544c55){_0x544c55=_0x544c55||0xc8;return function(_0x130661){if(_0x130661){return _0x2f4915[_0xf0ce('0x1c')](_0x544c55)[_0xf0ce('0x1d')](_0x130661);}};}function respondWithFilteredResult(_0x2300fe,_0x5c053c){return function(_0x3612ef){if(_0x3612ef){var _0x4a34ff=typeof _0x5c053c['offset']===_0xf0ce('0x1e')&&typeof _0x5c053c[_0xf0ce('0x1f')]==='undefined';var _0xd4e389=_0x3612ef[_0xf0ce('0x20')];var _0x7d1dac=_0x4a34ff?0x0:_0x5c053c[_0xf0ce('0x21')];var _0x4d7ce8=_0x4a34ff?_0x3612ef['count']:_0x5c053c[_0xf0ce('0x21')]+_0x5c053c[_0xf0ce('0x1f')];var _0x485a91;if(_0x4d7ce8>=_0xd4e389){_0x4d7ce8=_0xd4e389;_0x485a91=0xc8;}else{_0x485a91=0xce;}_0x2300fe[_0xf0ce('0x1c')](_0x485a91);return _0x2300fe[_0xf0ce('0x22')]('Content-Range',_0x7d1dac+'-'+_0x4d7ce8+'/'+_0xd4e389)['json'](_0x3612ef);}return null;};}function patchUpdates(_0x12bc04){return function(_0x3bc652){try{jsonpatch[_0xf0ce('0x23')](_0x3bc652,_0x12bc04,!![]);}catch(_0x5d1db5){return BPromise[_0xf0ce('0x24')](_0x5d1db5);}return _0x3bc652[_0xf0ce('0x25')]();};}function saveUpdates(_0x594015,_0x419999){return function(_0x126177){if(_0x126177){return _0x126177['update'](_0x594015)[_0xf0ce('0x26')](function(_0x50006e){return _0x50006e;});}return null;};}function removeEntity(_0x429f72,_0x3c637b){return function(_0x43d03a){if(_0x43d03a){return _0x43d03a['destroy']()[_0xf0ce('0x26')](function(){var _0x27ed97=_0x43d03a[_0xf0ce('0x27')]({'plain':!![]});var _0x55a42b='CustomReports';return db[_0xf0ce('0x28')]['destroy']({'where':{'type':_0x55a42b,'resourceId':_0x27ed97['id']}})['then'](function(){return _0x43d03a;});})[_0xf0ce('0x26')](function(){_0x429f72['status'](0xcc)[_0xf0ce('0x1b')]();});}};}function handleEntityNotFound(_0x280730,_0x501f1d){return function(_0xac6e5){if(!_0xac6e5){_0x280730[_0xf0ce('0x1a')](0x194);}return _0xac6e5;};}function handleError(_0x15505b,_0x1a796f){_0x1a796f=_0x1a796f||0x1f4;return function(_0x40533c){logger[_0xf0ce('0x29')](_0x40533c[_0xf0ce('0x2a')]);if(_0x40533c[_0xf0ce('0x2b')]){delete _0x40533c['name'];}_0x15505b[_0xf0ce('0x1c')](_0x1a796f)[_0xf0ce('0x2c')](_0x40533c);};}exports['index']=function(_0x57cc29,_0x3ddd44){var _0x1032f1={},_0x2ecf58={},_0x307875={'count':0x0,'rows':[]};var _0x308603=_['map'](db[_0xf0ce('0x2d')][_0xf0ce('0x2e')],function(_0x112c66){return{'name':_0x112c66['fieldName'],'type':_0x112c66[_0xf0ce('0x2f')][_0xf0ce('0x30')]};});_0x2ecf58[_0xf0ce('0x31')]=_[_0xf0ce('0x32')](_0x308603,_0xf0ce('0x2b'));_0x2ecf58[_0xf0ce('0x33')]=_[_0xf0ce('0x34')](_0x57cc29[_0xf0ce('0x33')]);_0x2ecf58[_0xf0ce('0x35')]=_['intersection'](_0x2ecf58[_0xf0ce('0x31')],_0x2ecf58[_0xf0ce('0x33')]);_0x1032f1[_0xf0ce('0x36')]=_[_0xf0ce('0x37')](_0x2ecf58[_0xf0ce('0x31')],qs['fields'](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x38')]));_0x1032f1[_0xf0ce('0x36')]=_0x1032f1[_0xf0ce('0x36')][_0xf0ce('0x39')]?_0x1032f1[_0xf0ce('0x36')]:_0x2ecf58[_0xf0ce('0x31')];if(!_0x57cc29['query']['hasOwnProperty']('nolimit')){_0x1032f1[_0xf0ce('0x1f')]=qs['limit'](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x1f')]);_0x1032f1[_0xf0ce('0x21')]=qs[_0xf0ce('0x21')](_0x57cc29['query'][_0xf0ce('0x21')]);}_0x1032f1[_0xf0ce('0x3a')]=qs[_0xf0ce('0x3b')](_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3b')]);_0x1032f1[_0xf0ce('0x3c')]=qs[_0xf0ce('0x35')](_[_0xf0ce('0x3d')](_0x57cc29[_0xf0ce('0x33')],_0x2ecf58['filters']),_0x308603);if(_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3e')]){_0x1032f1[_0xf0ce('0x3c')]=_[_0xf0ce('0x3f')](_0x1032f1[_0xf0ce('0x3c')],{'$or':_['map'](_0x308603,function(_0x1aba99){if(_0x1aba99['type']!==_0xf0ce('0x40')){var _0xa4de4e={};_0xa4de4e[_0x1aba99[_0xf0ce('0x2b')]]={'$like':'%'+_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x3e')]+'%'};return _0xa4de4e;}})});}_0x1032f1=_[_0xf0ce('0x3f')]({},_0x1032f1,_0x57cc29[_0xf0ce('0x41')]);var _0x37dc3e={'where':_0x1032f1[_0xf0ce('0x3c')]};return db[_0xf0ce('0x2d')]['count'](_0x37dc3e)['then'](function(_0x4348e9){_0x307875['count']=_0x4348e9;if(_0x57cc29[_0xf0ce('0x33')][_0xf0ce('0x42')]){_0x1032f1[_0xf0ce('0x43')]=[{'all':!![]}];}return db[_0xf0ce('0x2d')][_0xf0ce('0x44')](_0x1032f1);})['then'](function(_0xc4382a){_0x307875[_0xf0ce('0x45')]=_0xc4382a;return _0x307875;})[_0xf0ce('0x26')](respondWithFilteredResult(_0x3ddd44,_0x1032f1))['catch'](handleError(_0x3ddd44,null));};exports[_0xf0ce('0x46')]=function(_0x4349e7,_0x254478){var _0x3bbf41={'raw':![],'where':{'id':_0x4349e7[_0xf0ce('0x47')]['id']}},_0x4c650d={};_0x4c650d['model']=_[_0xf0ce('0x34')](db[_0xf0ce('0x2d')][_0xf0ce('0x2e')]);_0x4c650d['query']=_[_0xf0ce('0x34')](_0x4349e7[_0xf0ce('0x33')]);_0x4c650d[_0xf0ce('0x35')]=_[_0xf0ce('0x37')](_0x4c650d[_0xf0ce('0x31')],_0x4c650d[_0xf0ce('0x33')]);_0x3bbf41[_0xf0ce('0x36')]=_[_0xf0ce('0x37')](_0x4c650d[_0xf0ce('0x31')],qs[_0xf0ce('0x38')](_0x4349e7[_0xf0ce('0x33')][_0xf0ce('0x38')]));_0x3bbf41[_0xf0ce('0x36')]=_0x3bbf41['attributes'][_0xf0ce('0x39')]?_0x3bbf41[_0xf0ce('0x36')]:_0x4c650d[_0xf0ce('0x31')];if(_0x4349e7['query'][_0xf0ce('0x42')]){_0x3bbf41[_0xf0ce('0x43')]=[{'all':!![]}];}_0x3bbf41=_[_0xf0ce('0x3f')]({},_0x3bbf41,_0x4349e7[_0xf0ce('0x41')]);return db['AnalyticCustomReport'][_0xf0ce('0x48')](_0x3bbf41)[_0xf0ce('0x26')](handleEntityNotFound(_0x254478,null))['then'](respondWithResult(_0x254478,null))['catch'](handleError(_0x254478,null));};exports[_0xf0ce('0x49')]=function(_0x194f90,_0x4955fe){return db['AnalyticCustomReport'][_0xf0ce('0x49')](_0x194f90[_0xf0ce('0x4a')],{})['then'](function(_0x5cc50a){var _0x259321=_0x194f90[_0xf0ce('0x4b')][_0xf0ce('0x27')]({'plain':!![]});if(!_0x259321)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x259321[_0xf0ce('0x4c')]==='user'){var _0x1a1738=_0x5cc50a['get']({'plain':!![]});var _0x3ce5da='Reports';return db['UserProfileSection']['find']({'where':{'name':_0x3ce5da,'userProfileId':_0x259321['userProfileId']},'raw':!![]})[_0xf0ce('0x26')](function(_0x7f1189){if(_0x7f1189&&_0x7f1189['autoAssociation']===0x0){return db[_0xf0ce('0x28')][_0xf0ce('0x49')]({'name':_0x1a1738['name'],'resourceId':_0x1a1738['id'],'type':_0xf0ce('0x4d'),'sectionId':_0x7f1189['id']},{})[_0xf0ce('0x26')](function(){return _0x5cc50a;});}else{return _0x5cc50a;}})[_0xf0ce('0x4e')](function(_0x229a55){logger[_0xf0ce('0x29')](_0xf0ce('0x4f'),_0x229a55);throw _0x229a55;});}return _0x5cc50a;})[_0xf0ce('0x26')](respondWithResult(_0x4955fe,0xc9))[_0xf0ce('0x4e')](handleError(_0x4955fe,null));};exports[_0xf0ce('0x50')]=function(_0x41f350,_0x33fcc0){if(_0x41f350[_0xf0ce('0x4a')]['id']){delete _0x41f350['body']['id'];}return db[_0xf0ce('0x2d')]['find']({'where':{'id':_0x41f350['params']['id']}})[_0xf0ce('0x26')](handleEntityNotFound(_0x33fcc0,null))['then'](saveUpdates(_0x41f350[_0xf0ce('0x4a')],null))[_0xf0ce('0x26')](respondWithResult(_0x33fcc0,null))['catch'](handleError(_0x33fcc0,null));};exports['destroy']=function(_0x378a81,_0x5b5ee7){return db[_0xf0ce('0x2d')][_0xf0ce('0x48')]({'where':{'id':_0x378a81[_0xf0ce('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b5ee7,null))[_0xf0ce('0x26')](removeEntity(_0x5b5ee7,null))[_0xf0ce('0x4e')](handleError(_0x5b5ee7,null));};exports[_0xf0ce('0x51')]=function(_0x98e247,_0x2afd81){var _0x575d7d=0xa;var _0x1f3e58=[_0xf0ce('0x52'),_0xf0ce('0x53'),'right_join',_0xf0ce('0x54')];var _0x5a1c6d={'SUM':_0xf0ce('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':_0xf0ce('0x5a'),'GROUP_CONCAT DESC':_0xf0ce('0x5b')};var _0x16fea2={'SEC_TO_TIME':_0xf0ce('0x5c'),'DATE':'DATE(%s)','HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x11e8fe=function(_0x5bca08){return!_[_0xf0ce('0x60')]([_0xf0ce('0x61'),_0xf0ce('0x62'),_0xf0ce('0x63'),'IS\x20NOT\x20EMPTY'],_0x5bca08);};var _0x46f3a0=function(_0x22a36a){if(!_0x22a36a||!_0x22a36a['rules'][_0xf0ce('0x39')]){return'';}for(var _0x1f160e='(',_0x1151a7=0x0;_0x1151a7<_0x22a36a['rules'][_0xf0ce('0x39')];_0x1151a7+=0x1){_0x1151a7>0x0&&(_0x1f160e+='\x20'+_0x22a36a[_0xf0ce('0x64')]+'\x20');_0x1f160e+=_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x65')]?_0x46f3a0(_0x22a36a[_0xf0ce('0x66')][_0x1151a7][_0xf0ce('0x65')]):_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x67')]+'\x20'+_0x22a36a[_0xf0ce('0x66')][_0x1151a7]['condition']+(_0x11e8fe(_0x22a36a[_0xf0ce('0x66')][_0x1151a7][_0xf0ce('0x68')])?'\x20'+_0x22a36a['rules'][_0x1151a7][_0xf0ce('0x69')]:'');}return _0x1f160e+')';};var _0x4be9c1={'where':{'id':_0x98e247[_0xf0ce('0x47')]['id']}},_0x4e66bc,_0x9e1efc,_0x28aed4,_0x1f9d63,_0x36be17;_0x4be9c1=_[_0xf0ce('0x3f')]({},_0x4be9c1,_0x98e247[_0xf0ce('0x41')]);return db['AnalyticCustomReport'][_0xf0ce('0x48')](_0x4be9c1)[_0xf0ce('0x26')](function(_0x479653){if(_0x479653){_0x4e66bc=_0x479653;return _0x479653[_0xf0ce('0x6a')]();}return null;})['then'](function(_0x3273ea){if(_0x3273ea){if(!_0x3273ea[_0xf0ce('0x39')]){throw new db[(_0xf0ce('0x6b'))][(_0xf0ce('0x6c'))](_0xf0ce('0x6d'),0x193);}_0x9e1efc=_0x3273ea;return db[_0xf0ce('0x6e')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x5a706c){if(_0x5a706c){_0x28aed4=_[_0xf0ce('0x6f')](_0x5a706c,'id');var _0x30c3df;var _0x23a282=squel[_0xf0ce('0x70')]();_0x23a282[_0xf0ce('0x71')](_0x4e66bc['table']);for(var _0x705231=0x0;_0x705231<_0x9e1efc[_0xf0ce('0x39')];_0x705231+=0x1){_0x30c3df=_0x9e1efc[_0x705231][_0xf0ce('0x72')]?_0x28aed4[_0x9e1efc[_0x705231]['MetricId']]['metric']:_0x9e1efc[_0x705231][_0xf0ce('0x67')];_0x30c3df=_0x9e1efc[_0x705231]['function']?_['replace'](_0x5a1c6d[_0x9e1efc[_0x705231][_0xf0ce('0x73')]],'%s',_0x30c3df):_0x30c3df;_0x30c3df=_0x9e1efc[_0x705231][_0xf0ce('0x74')]?_[_0xf0ce('0x75')](_0x16fea2[_0x9e1efc[_0x705231]['format']],'%s',_0x30c3df):_0x30c3df;if(_0x9e1efc[_0x705231][_0xf0ce('0x76')]){_0x23a282[_0xf0ce('0x65')](_0x30c3df);}_0x9e1efc[_0x705231]['orderBy']&&_0x23a282[_0xf0ce('0x3a')](_0x30c3df,_0x9e1efc[_0x705231][_0xf0ce('0x77')]===_0xf0ce('0x78')?![]:!![]);_0x23a282[_0xf0ce('0x67')](_0x30c3df,_0x9e1efc[_0x705231]['alias']||_0x30c3df);}if(_0x4e66bc['joins']){_0x4e66bc[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x4e66bc[_0xf0ce('0x79')]);for(var _0x2ed129=0x0;_0x2ed129<_0x4e66bc[_0xf0ce('0x79')]['length'];_0x2ed129+=0x1){if(_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')]&&_[_0xf0ce('0x60')](_0x1f3e58,_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')])&&_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7b')]&&_0x4e66bc['joins'][_0x2ed129][_0xf0ce('0x7c')]&&_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7d')]){_0x23a282[_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x2f')]](_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7c')],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x4e66bc['table'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129]['parentKey'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129]['foreignTable'],_0x4e66bc[_0xf0ce('0x79')][_0x2ed129][_0xf0ce('0x7d')]));}}}if(_0x4e66bc['conditions']){_0x4e66bc['conditions']=JSON[_0xf0ce('0x7a')](_0x4e66bc[_0xf0ce('0x7f')]);_0x23a282[_0xf0ce('0x3c')](_0x46f3a0(_0x4e66bc[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x36be17=_0x23a282['clone']();_0x23a282[_0xf0ce('0x1f')](_0x575d7d);_0x23a282[_0xf0ce('0x21')](0x0);logger['debug'](_0xf0ce('0x80'),_0x23a282['toString']());return dbH[_0xf0ce('0x81')][_0xf0ce('0x33')](_0x23a282['toString'](),{'type':dbH['sequelize'][_0xf0ce('0x82')][_0xf0ce('0x83')]});}})['then'](respondWithResult(_0x2afd81,null))[_0xf0ce('0x4e')](handleError(_0x2afd81,null));};function runReport(_0x1d370f,_0xbb748f,_0x524053){var _0x4c358c=_0xbb748f[_0xf0ce('0x2b')];var _0x101fd6=0xa;var _0x532c13=[_0xf0ce('0x52'),_0xf0ce('0x53'),_0xf0ce('0x84'),_0xf0ce('0x54')];var _0x154a8f={'SUM':_0xf0ce('0x55'),'COUNT':_0xf0ce('0x85'),'COUNT DISTINCT':_0xf0ce('0x86'),'MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xf0ce('0x5b')};var _0x5cdbf6={'SEC_TO_TIME':_0xf0ce('0x5c'),'DATE':_0xf0ce('0x87'),'HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x16ad05=function(_0x345c40){return!_['includes'](['IS\x20NULL',_0xf0ce('0x62'),_0xf0ce('0x63'),_0xf0ce('0x88')],_0x345c40);};var _0x525233=function(_0x17d82c){if(!_0x17d82c||!_0x17d82c[_0xf0ce('0x66')][_0xf0ce('0x39')]){return'';}for(var _0x321f73='(',_0x21560f=0x0;_0x21560f<_0x17d82c[_0xf0ce('0x66')][_0xf0ce('0x39')];_0x21560f+=0x1){_0x21560f>0x0&&(_0x321f73+='\x20'+_0x17d82c[_0xf0ce('0x64')]+'\x20');_0x321f73+=_0x17d82c[_0xf0ce('0x66')][_0x21560f]['group']?_0x525233(_0x17d82c[_0xf0ce('0x66')][_0x21560f]['group']):_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x67')]+'\x20'+_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x68')]+(_0x16ad05(_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x68')])?'\x20'+_0x17d82c[_0xf0ce('0x66')][_0x21560f][_0xf0ce('0x69')]:'');}return _0x321f73+')';};var _0x2f3cbd={'where':{'id':_0x1d370f['id']}},_0x1c793c,_0x13ed5e,_0x4314a7,_0x354e43,_0x191683;_0x2f3cbd=_[_0xf0ce('0x3f')]({},_0x2f3cbd,_0x524053);return db[_0xf0ce('0x2d')][_0xf0ce('0x48')](_0x2f3cbd)[_0xf0ce('0x26')](function(_0xd20ebb){if(_0xd20ebb){_0x1c793c=_0xd20ebb;return _0xd20ebb[_0xf0ce('0x6a')]();}return null;})['then'](function(_0x1dc7b8){if(_0x1dc7b8){if(!_0x1dc7b8[_0xf0ce('0x39')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x13ed5e=_0x1dc7b8;return db[_0xf0ce('0x6e')][_0xf0ce('0x44')]({'raw':!![]});}return null;})[_0xf0ce('0x26')](function(_0x1725ba){if(_0x1725ba){_0x4314a7=_[_0xf0ce('0x6f')](_0x1725ba,'id');var _0x2278fb;var _0x1a07f0=squel[_0xf0ce('0x70')]();_0x1a07f0[_0xf0ce('0x71')](_0x1c793c[_0xf0ce('0x89')]);for(var _0x1ef550=0x0;_0x1ef550<_0x13ed5e[_0xf0ce('0x39')];_0x1ef550+=0x1){_0x2278fb=_0x13ed5e[_0x1ef550][_0xf0ce('0x72')]?_0x4314a7[_0x13ed5e[_0x1ef550][_0xf0ce('0x72')]]['metric']:_0x13ed5e[_0x1ef550][_0xf0ce('0x67')];_0x2278fb=_0x13ed5e[_0x1ef550]['function']?_[_0xf0ce('0x75')](_0x154a8f[_0x13ed5e[_0x1ef550][_0xf0ce('0x73')]],'%s',_0x2278fb):_0x2278fb;_0x2278fb=_0x13ed5e[_0x1ef550]['format']?_[_0xf0ce('0x75')](_0x5cdbf6[_0x13ed5e[_0x1ef550][_0xf0ce('0x74')]],'%s',_0x2278fb):_0x2278fb;if(_0x13ed5e[_0x1ef550]['groupBy']){_0x1a07f0[_0xf0ce('0x65')](_0x2278fb);}_0x13ed5e[_0x1ef550][_0xf0ce('0x77')]&&_0x1a07f0['order'](_0x2278fb,_0x13ed5e[_0x1ef550][_0xf0ce('0x77')]==='DESC'?![]:!![]);_0x1a07f0[_0xf0ce('0x67')](_0x2278fb,_0x13ed5e[_0x1ef550][_0xf0ce('0x8a')]||_0x2278fb);}if(_0x1c793c[_0xf0ce('0x79')]){_0x1c793c[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x1c793c['joins']);for(var _0x332fdd=0x0;_0x332fdd<_0x1c793c[_0xf0ce('0x79')]['length'];_0x332fdd+=0x1){if(_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x2f')]&&_[_0xf0ce('0x60')](_0x532c13,_0x1c793c['joins'][_0x332fdd][_0xf0ce('0x2f')])&&_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x7b')]&&_0x1c793c['joins'][_0x332fdd][_0xf0ce('0x7c')]&&_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignKey']){_0x1a07f0[_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['type']](_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignTable'],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x1c793c[_0xf0ce('0x89')],_0x1c793c['joins'][_0x332fdd]['parentKey'],_0x1c793c[_0xf0ce('0x79')][_0x332fdd][_0xf0ce('0x7c')],_0x1c793c[_0xf0ce('0x79')][_0x332fdd]['foreignKey']));}}}if(_0x1c793c['conditions']){_0x1c793c[_0xf0ce('0x7f')]=JSON['parse'](_0x1c793c[_0xf0ce('0x7f')]);_0x1a07f0[_0xf0ce('0x3c')](_0x525233(_0x1c793c[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x191683=_0x1a07f0['clone']();_0x1a07f0['limit'](_0x101fd6);_0x1a07f0[_0xf0ce('0x21')](0x0);return;}})[_0xf0ce('0x26')](function(){if(_0xbb748f[_0xf0ce('0x8b')]===_0xf0ce('0x8c')){return null;}var _0x13f6ac=_[_0xf0ce('0x3f')](_0xbb748f,{'name':_0xbb748f[_0xf0ce('0x8d')]||_0xbb748f[_0xf0ce('0x2b')]||_0x1c793c[_0xf0ce('0x2b')],'basename':_0x4c358c,'savename':util[_0xf0ce('0x74')](_0xf0ce('0x8e'),_0xbb748f[_0xf0ce('0x2b')]||_0x1c793c[_0xf0ce('0x2b')],require(_0xf0ce('0x8f'))[_0xf0ce('0x90')](0x4),_0xbb748f[_0xf0ce('0x8b')]||_0xf0ce('0x91')),'reportId':_0x1c793c['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xf0ce('0x49')](_0x13f6ac,{'raw':!![]});})[_0xf0ce('0x26')](function(_0x23f7cf){if(_0x1c793c[_0xf0ce('0x89')]==='cdr'){_0x191683['where'](_0x1c793c[_0xf0ce('0x89')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0xbb748f[_0xf0ce('0x92')],_0xbb748f['endDate']);}else{_0x191683[_0xf0ce('0x3c')](_0x1c793c['table']+_0xf0ce('0x93'),_0xbb748f['startDate'],_0xbb748f['endDate']);}if(_0x23f7cf){logger['info']('Run\x20Query:',_0x191683[_0xf0ce('0x94')]());require('child_process')[_0xf0ce('0x95')](path[_0xf0ce('0x52')](__dirname,_0xf0ce('0x96'),_0x23f7cf['output']),[_0x23f7cf['id'],_0x191683[_0xf0ce('0x94')](),path[_0xf0ce('0x52')](__dirname,_0xf0ce('0x97'),_0x23f7cf[_0xf0ce('0x98')]),_0x4c358c]);return _0x23f7cf;}else{var _0x48c48f=squel[_0xf0ce('0x70')]();_0x48c48f[_0xf0ce('0x71')]('('+_0x191683[_0xf0ce('0x94')]()+')',_0xf0ce('0x99'));_0x48c48f[_0xf0ce('0x67')](_0xf0ce('0x9a'),'count');_0x191683[_0xf0ce('0x1f')](_0xbb748f['limit']||_0x101fd6);_0x191683[_0xf0ce('0x21')](_0xbb748f['offset']||0x0);return dbH['sequelize'][_0xf0ce('0x33')](_0x48c48f['toString'](),{'type':dbH[_0xf0ce('0x81')]['QueryTypes']['SELECT']})[_0xf0ce('0x26')](function(_0x5a9079){if(!_0x5a9079[_0xf0ce('0x39')]){_0x354e43=0x0;}else{_0x354e43=_0x5a9079[0x0]['count']||0x0;}return dbH[_0xf0ce('0x81')][_0xf0ce('0x33')](_0x191683[_0xf0ce('0x94')](),{'type':dbH[_0xf0ce('0x81')]['QueryTypes']['SELECT']});})[_0xf0ce('0x26')](function(_0x302ba0){return{'rows':_0x302ba0||[],'count':_0x354e43};});}});}exports['run']=function(_0x5e8650,_0x3ebbad){return runReport(_0x5e8650[_0xf0ce('0x47')],_0x5e8650[_0xf0ce('0x33')],_0x5e8650[_0xf0ce('0x41')])[_0xf0ce('0x26')](respondWithResult(_0x3ebbad,null))['catch'](handleError(_0x3ebbad,null));};exports[_0xf0ce('0x9b')]=runReport;exports[_0xf0ce('0x33')]=function(_0x149497,_0x5d3210){var _0x4f02bc=0xa;var _0x5adbf1=[_0xf0ce('0x52'),_0xf0ce('0x53'),_0xf0ce('0x84'),'cross_join'];var _0x2b2b2e={'SUM':_0xf0ce('0x55'),'COUNT':_0xf0ce('0x85'),'COUNT DISTINCT':_0xf0ce('0x86'),'MAX':_0xf0ce('0x56'),'MIN':_0xf0ce('0x57'),'AVG':_0xf0ce('0x58'),'GROUP_CONCAT':_0xf0ce('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3fd7f9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xf0ce('0x87'),'HOUR':_0xf0ce('0x5d'),'ROUND':_0xf0ce('0x5e'),'UNIX_TIMESTAMP':_0xf0ce('0x5f')};var _0x49785b=function(_0x2e0054){return!_[_0xf0ce('0x60')]([_0xf0ce('0x61'),_0xf0ce('0x62'),_0xf0ce('0x63'),_0xf0ce('0x88')],_0x2e0054);};var _0x43d753=function(_0x333b23){if(!_0x333b23||!_0x333b23['rules']['length']){return'';}for(var _0x3db831='(',_0xfdd3db=0x0;_0xfdd3db<_0x333b23[_0xf0ce('0x66')][_0xf0ce('0x39')];_0xfdd3db+=0x1){_0xfdd3db>0x0&&(_0x3db831+='\x20'+_0x333b23[_0xf0ce('0x64')]+'\x20');_0x3db831+=_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x65')]?_0x43d753(_0x333b23[_0xf0ce('0x66')][_0xfdd3db]['group']):_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x67')]+'\x20'+_0x333b23[_0xf0ce('0x66')][_0xfdd3db][_0xf0ce('0x68')]+(_0x49785b(_0x333b23['rules'][_0xfdd3db][_0xf0ce('0x68')])?'\x20'+_0x333b23['rules'][_0xfdd3db]['value']:'');}return _0x3db831+')';};var _0x246e4f={'where':{'id':_0x149497['params']['id']}},_0x3fcdf0,_0x100b4a,_0x238651,_0x549783,_0x48fe42;_0x246e4f=_[_0xf0ce('0x3f')]({},_0x246e4f,_0x149497[_0xf0ce('0x41')]);return db[_0xf0ce('0x2d')][_0xf0ce('0x48')](_0x246e4f)[_0xf0ce('0x26')](function(_0x40ba6b){if(_0x40ba6b){_0x3fcdf0=_0x40ba6b;return _0x40ba6b[_0xf0ce('0x6a')]();}return null;})[_0xf0ce('0x26')](function(_0x56d82b){if(_0x56d82b){if(!_0x56d82b[_0xf0ce('0x39')]){throw new db[(_0xf0ce('0x6b'))][(_0xf0ce('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x100b4a=_0x56d82b;return db[_0xf0ce('0x6e')][_0xf0ce('0x44')]({'raw':!![]});}return null;})[_0xf0ce('0x26')](function(_0x33763e){if(_0x33763e){_0x238651=_[_0xf0ce('0x6f')](_0x33763e,'id');var _0x609d4d;var _0x5297d9=squel['select']();_0x5297d9[_0xf0ce('0x71')](_0x3fcdf0[_0xf0ce('0x89')]);for(var _0x577ce8=0x0;_0x577ce8<_0x100b4a[_0xf0ce('0x39')];_0x577ce8+=0x1){_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x72')]?_0x238651[_0x100b4a[_0x577ce8][_0xf0ce('0x72')]][_0xf0ce('0x9c')]:_0x100b4a[_0x577ce8][_0xf0ce('0x67')];_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x73')]?_[_0xf0ce('0x75')](_0x2b2b2e[_0x100b4a[_0x577ce8][_0xf0ce('0x73')]],'%s',_0x609d4d):_0x609d4d;_0x609d4d=_0x100b4a[_0x577ce8][_0xf0ce('0x74')]?_[_0xf0ce('0x75')](_0x3fd7f9[_0x100b4a[_0x577ce8]['format']],'%s',_0x609d4d):_0x609d4d;if(_0x100b4a[_0x577ce8]['groupBy']){_0x5297d9[_0xf0ce('0x65')](_0x609d4d);}_0x100b4a[_0x577ce8]['orderBy']&&_0x5297d9[_0xf0ce('0x3a')](_0x609d4d,_0x100b4a[_0x577ce8][_0xf0ce('0x77')]===_0xf0ce('0x78')?![]:!![]);_0x5297d9[_0xf0ce('0x67')](_0x609d4d,_0x100b4a[_0x577ce8]['alias']||_0x609d4d);}if(_0x3fcdf0[_0xf0ce('0x79')]){_0x3fcdf0[_0xf0ce('0x79')]=JSON[_0xf0ce('0x7a')](_0x3fcdf0['joins']);for(var _0x20cdda=0x0;_0x20cdda<_0x3fcdf0[_0xf0ce('0x79')][_0xf0ce('0x39')];_0x20cdda+=0x1){if(_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x2f')]&&_['includes'](_0x5adbf1,_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x2f')])&&_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7b')]&&_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7c')]&&_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x7d')]){_0x5297d9[_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda]['type']](_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda]['foreignTable'],null,util[_0xf0ce('0x74')](_0xf0ce('0x7e'),_0x3fcdf0[_0xf0ce('0x89')],_0x3fcdf0['joins'][_0x20cdda][_0xf0ce('0x7b')],_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7c')],_0x3fcdf0[_0xf0ce('0x79')][_0x20cdda][_0xf0ce('0x7d')]));}}}if(_0x3fcdf0['conditions']){_0x3fcdf0[_0xf0ce('0x7f')]=JSON[_0xf0ce('0x7a')](_0x3fcdf0[_0xf0ce('0x7f')]);_0x5297d9[_0xf0ce('0x3c')](_0x43d753(_0x3fcdf0[_0xf0ce('0x7f')][_0xf0ce('0x65')]));}_0x48fe42=_0x5297d9[_0xf0ce('0x9d')]();_0x5297d9[_0xf0ce('0x1f')](_0x4f02bc);_0x5297d9[_0xf0ce('0x21')](0x0);logger['debug']('Limited\x20Query:',_0x5297d9['toString']());return dbH[_0xf0ce('0x81')]['query'](_0x5297d9[_0xf0ce('0x94')](),{'type':dbH[_0xf0ce('0x81')][_0xf0ce('0x82')][_0xf0ce('0x83')]});}})[_0xf0ce('0x26')](function(){return{'sql':_0x48fe42['toString']()};})[_0xf0ce('0x26')](respondWithResult(_0x5d3210,null))[_0xf0ce('0x4e')](handleError(_0x5d3210,null));};
\ No newline at end of file
+var _0x5e9a=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticCustomReport','includeAll','include','findAll','catch','show','params','keys','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','parse','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20EMPTY','keyBy','from','alias','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','COUNT(%s)','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','CustomReports','UserProfileResource','name','index','map','fieldName','type','key','model','query','filters','attributes','fields','length'];(function(_0x430e18,_0x6f36a0){var _0x54eff2=function(_0x1f2e48){while(--_0x1f2e48){_0x430e18['push'](_0x430e18['shift']());}};_0x54eff2(++_0x6f36a0);}(_0x5e9a,0x72));var _0xa5e9=function(_0x22e175,_0x2dadbc){_0x22e175=_0x22e175-0x0;var _0x5b84dd=_0x5e9a[_0x22e175];return _0x5b84dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5e9('0x0'));var zipdir=require(_0xa5e9('0x1'));var jsonpatch=require(_0xa5e9('0x2'));var rp=require(_0xa5e9('0x3'));var moment=require(_0xa5e9('0x4'));var BPromise=require(_0xa5e9('0x5'));var Mustache=require(_0xa5e9('0x6'));var util=require(_0xa5e9('0x7'));var path=require(_0xa5e9('0x8'));var sox=require(_0xa5e9('0x9'));var csv=require(_0xa5e9('0xa'));var ejs=require(_0xa5e9('0xb'));var fs=require('fs');var fs_extra=require(_0xa5e9('0xc'));var _=require(_0xa5e9('0xd'));var squel=require(_0xa5e9('0xe'));var crypto=require(_0xa5e9('0xf'));var jsforce=require(_0xa5e9('0x10'));var deskjs=require(_0xa5e9('0x11'));var toCsv=require(_0xa5e9('0xa'));var querystring=require(_0xa5e9('0x12'));var Papa=require(_0xa5e9('0x13'));var Redis=require(_0xa5e9('0x14'));var authService=require(_0xa5e9('0x15'));var qs=require(_0xa5e9('0x16'));var as=require(_0xa5e9('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5e9('0x18'))(_0xa5e9('0x19'));var utils=require(_0xa5e9('0x1a'));var config=require(_0xa5e9('0x1b'));var licenseUtil=require(_0xa5e9('0x1c'));var db=require(_0xa5e9('0x1d'))['db'];var dbH=require(_0xa5e9('0x1d'))['dbH'];function respondWithStatusCode(_0x4fb181,_0x4e3e3d){_0x4e3e3d=_0x4e3e3d||0xcc;return function(_0x484a16){if(_0x484a16){return _0x4fb181['sendStatus'](_0x4e3e3d);}return _0x4fb181[_0xa5e9('0x1e')](_0x4e3e3d)[_0xa5e9('0x1f')]();};}function respondWithResult(_0x4dff28,_0x491080){_0x491080=_0x491080||0xc8;return function(_0x5713b9){if(_0x5713b9){return _0x4dff28['status'](_0x491080)[_0xa5e9('0x20')](_0x5713b9);}};}function respondWithFilteredResult(_0x142d43,_0x369cac){return function(_0x218458){if(_0x218458){var _0x3c1553=typeof _0x369cac[_0xa5e9('0x21')]===_0xa5e9('0x22')&&typeof _0x369cac['limit']===_0xa5e9('0x22');var _0x2c004e=_0x218458[_0xa5e9('0x23')];var _0x4360a2=_0x3c1553?0x0:_0x369cac[_0xa5e9('0x21')];var _0xaf4d8e=_0x3c1553?_0x218458[_0xa5e9('0x23')]:_0x369cac['offset']+_0x369cac[_0xa5e9('0x24')];var _0x2c2f7e;if(_0xaf4d8e>=_0x2c004e){_0xaf4d8e=_0x2c004e;_0x2c2f7e=0xc8;}else{_0x2c2f7e=0xce;}_0x142d43[_0xa5e9('0x1e')](_0x2c2f7e);return _0x142d43[_0xa5e9('0x25')](_0xa5e9('0x26'),_0x4360a2+'-'+_0xaf4d8e+'/'+_0x2c004e)['json'](_0x218458);}return null;};}function patchUpdates(_0x595ca5){return function(_0x1fd63a){try{jsonpatch[_0xa5e9('0x27')](_0x1fd63a,_0x595ca5,!![]);}catch(_0x110d31){return BPromise[_0xa5e9('0x28')](_0x110d31);}return _0x1fd63a['save']();};}function saveUpdates(_0x2a9d3c,_0x152caf){return function(_0x518776){if(_0x518776){return _0x518776['update'](_0x2a9d3c)[_0xa5e9('0x29')](function(_0x4aa3bd){return _0x4aa3bd;});}return null;};}function removeEntity(_0x2313dd,_0x5d4177){return function(_0x3761c0){if(_0x3761c0){return _0x3761c0[_0xa5e9('0x2a')]()[_0xa5e9('0x29')](function(){var _0x2de03a=_0x3761c0[_0xa5e9('0x2b')]({'plain':!![]});var _0x295ef5=_0xa5e9('0x2c');return db[_0xa5e9('0x2d')][_0xa5e9('0x2a')]({'where':{'type':_0x295ef5,'resourceId':_0x2de03a['id']}})['then'](function(){return _0x3761c0;});})[_0xa5e9('0x29')](function(){_0x2313dd['status'](0xcc)[_0xa5e9('0x1f')]();});}};}function handleEntityNotFound(_0xe2593,_0x3843a5){return function(_0x93c4a4){if(!_0x93c4a4){_0xe2593['sendStatus'](0x194);}return _0x93c4a4;};}function handleError(_0x515198,_0x50224f){_0x50224f=_0x50224f||0x1f4;return function(_0x12df76){logger['error'](_0x12df76['stack']);if(_0x12df76[_0xa5e9('0x2e')]){delete _0x12df76[_0xa5e9('0x2e')];}_0x515198['status'](_0x50224f)['send'](_0x12df76);};}exports[_0xa5e9('0x2f')]=function(_0x1da525,_0x130ca8){var _0x554c50={},_0x2700f4={},_0x2a3fa4={'count':0x0,'rows':[]};var _0x217d41=_[_0xa5e9('0x30')](db['AnalyticCustomReport']['rawAttributes'],function(_0x317a47){return{'name':_0x317a47[_0xa5e9('0x31')],'type':_0x317a47[_0xa5e9('0x32')][_0xa5e9('0x33')]};});_0x2700f4[_0xa5e9('0x34')]=_['map'](_0x217d41,_0xa5e9('0x2e'));_0x2700f4['query']=_['keys'](_0x1da525[_0xa5e9('0x35')]);_0x2700f4[_0xa5e9('0x36')]=_['intersection'](_0x2700f4[_0xa5e9('0x34')],_0x2700f4['query']);_0x554c50[_0xa5e9('0x37')]=_['intersection'](_0x2700f4[_0xa5e9('0x34')],qs[_0xa5e9('0x38')](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x38')]));_0x554c50[_0xa5e9('0x37')]=_0x554c50[_0xa5e9('0x37')][_0xa5e9('0x39')]?_0x554c50[_0xa5e9('0x37')]:_0x2700f4['model'];if(!_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x3a')]('nolimit')){_0x554c50[_0xa5e9('0x24')]=qs[_0xa5e9('0x24')](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x24')]);_0x554c50['offset']=qs['offset'](_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x21')]);}_0x554c50[_0xa5e9('0x3b')]=qs['sort'](_0x1da525['query'][_0xa5e9('0x3c')]);_0x554c50[_0xa5e9('0x3d')]=qs[_0xa5e9('0x36')](_[_0xa5e9('0x3e')](_0x1da525[_0xa5e9('0x35')],_0x2700f4[_0xa5e9('0x36')]),_0x217d41);if(_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x3f')]){_0x554c50[_0xa5e9('0x3d')]=_[_0xa5e9('0x40')](_0x554c50[_0xa5e9('0x3d')],{'$or':_[_0xa5e9('0x30')](_0x217d41,function(_0x36dcb8){if(_0x36dcb8[_0xa5e9('0x32')]!==_0xa5e9('0x41')){var _0x39af09={};_0x39af09[_0x36dcb8[_0xa5e9('0x2e')]]={'$like':'%'+_0x1da525['query'][_0xa5e9('0x3f')]+'%'};return _0x39af09;}})});}_0x554c50=_[_0xa5e9('0x40')]({},_0x554c50,_0x1da525[_0xa5e9('0x42')]);var _0x19f783={'where':_0x554c50[_0xa5e9('0x3d')]};return db[_0xa5e9('0x43')][_0xa5e9('0x23')](_0x19f783)[_0xa5e9('0x29')](function(_0x46189b){_0x2a3fa4[_0xa5e9('0x23')]=_0x46189b;if(_0x1da525[_0xa5e9('0x35')][_0xa5e9('0x44')]){_0x554c50[_0xa5e9('0x45')]=[{'all':!![]}];}return db[_0xa5e9('0x43')][_0xa5e9('0x46')](_0x554c50);})[_0xa5e9('0x29')](function(_0x4baecb){_0x2a3fa4['rows']=_0x4baecb;return _0x2a3fa4;})['then'](respondWithFilteredResult(_0x130ca8,_0x554c50))[_0xa5e9('0x47')](handleError(_0x130ca8,null));};exports[_0xa5e9('0x48')]=function(_0x1e9d9a,_0x245586){var _0x49d4b6={'raw':![],'where':{'id':_0x1e9d9a[_0xa5e9('0x49')]['id']}},_0x364718={};_0x364718[_0xa5e9('0x34')]=_[_0xa5e9('0x4a')](db['AnalyticCustomReport'][_0xa5e9('0x4b')]);_0x364718[_0xa5e9('0x35')]=_[_0xa5e9('0x4a')](_0x1e9d9a[_0xa5e9('0x35')]);_0x364718[_0xa5e9('0x36')]=_[_0xa5e9('0x4c')](_0x364718[_0xa5e9('0x34')],_0x364718[_0xa5e9('0x35')]);_0x49d4b6[_0xa5e9('0x37')]=_[_0xa5e9('0x4c')](_0x364718[_0xa5e9('0x34')],qs[_0xa5e9('0x38')](_0x1e9d9a[_0xa5e9('0x35')][_0xa5e9('0x38')]));_0x49d4b6[_0xa5e9('0x37')]=_0x49d4b6[_0xa5e9('0x37')][_0xa5e9('0x39')]?_0x49d4b6[_0xa5e9('0x37')]:_0x364718[_0xa5e9('0x34')];if(_0x1e9d9a['query']['includeAll']){_0x49d4b6['include']=[{'all':!![]}];}_0x49d4b6=_[_0xa5e9('0x40')]({},_0x49d4b6,_0x1e9d9a[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x49d4b6)[_0xa5e9('0x29')](handleEntityNotFound(_0x245586,null))[_0xa5e9('0x29')](respondWithResult(_0x245586,null))[_0xa5e9('0x47')](handleError(_0x245586,null));};exports['create']=function(_0xb4ef4e,_0x256ad1){return db['AnalyticCustomReport'][_0xa5e9('0x4e')](_0xb4ef4e[_0xa5e9('0x4f')],{})[_0xa5e9('0x29')](function(_0x4e640c){var _0x323b5f=_0xb4ef4e[_0xa5e9('0x50')]['get']({'plain':!![]});if(!_0x323b5f)throw new Error(_0xa5e9('0x51'));if(_0x323b5f[_0xa5e9('0x52')]==='user'){var _0x1e5a75=_0x4e640c[_0xa5e9('0x2b')]({'plain':!![]});var _0x3cc26f=_0xa5e9('0x53');return db[_0xa5e9('0x54')][_0xa5e9('0x4d')]({'where':{'name':_0x3cc26f,'userProfileId':_0x323b5f['userProfileId']},'raw':!![]})['then'](function(_0x2965a3){if(_0x2965a3&&_0x2965a3['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1e5a75[_0xa5e9('0x2e')],'resourceId':_0x1e5a75['id'],'type':_0xa5e9('0x2c'),'sectionId':_0x2965a3['id']},{})['then'](function(){return _0x4e640c;});}else{return _0x4e640c;}})['catch'](function(_0x4ba4de){logger[_0xa5e9('0x55')](_0xa5e9('0x56'),_0x4ba4de);throw _0x4ba4de;});}return _0x4e640c;})[_0xa5e9('0x29')](respondWithResult(_0x256ad1,0xc9))['catch'](handleError(_0x256ad1,null));};exports['update']=function(_0x77c59c,_0x17630f){if(_0x77c59c[_0xa5e9('0x4f')]['id']){delete _0x77c59c['body']['id'];}return db[_0xa5e9('0x43')][_0xa5e9('0x4d')]({'where':{'id':_0x77c59c[_0xa5e9('0x49')]['id']}})[_0xa5e9('0x29')](handleEntityNotFound(_0x17630f,null))[_0xa5e9('0x29')](saveUpdates(_0x77c59c[_0xa5e9('0x4f')],null))[_0xa5e9('0x29')](respondWithResult(_0x17630f,null))[_0xa5e9('0x47')](handleError(_0x17630f,null));};exports[_0xa5e9('0x2a')]=function(_0x4b4334,_0xf1a301){return db[_0xa5e9('0x43')][_0xa5e9('0x4d')]({'where':{'id':_0x4b4334[_0xa5e9('0x49')]['id']}})[_0xa5e9('0x29')](handleEntityNotFound(_0xf1a301,null))['then'](removeEntity(_0xf1a301,null))[_0xa5e9('0x47')](handleError(_0xf1a301,null));};exports[_0xa5e9('0x57')]=function(_0x5badd6,_0x20453e){var _0x27ea6f=0xa;var _0x3dc5ad=[_0xa5e9('0x58'),'left_join',_0xa5e9('0x59'),_0xa5e9('0x5a')];var _0x449ad1={'SUM':_0xa5e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xa5e9('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':_0xa5e9('0x5e')};var _0xd89b3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':_0xa5e9('0x61'),'UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x5288df=function(_0xea78a4){return!_[_0xa5e9('0x63')]([_0xa5e9('0x64'),_0xa5e9('0x65'),'IS\x20EMPTY',_0xa5e9('0x66')],_0xea78a4);};var _0x5a4046=function(_0x44a044){if(!_0x44a044||!_0x44a044['rules'][_0xa5e9('0x39')]){return'';}for(var _0x24f779='(',_0x26b116=0x0;_0x26b116<_0x44a044[_0xa5e9('0x67')][_0xa5e9('0x39')];_0x26b116+=0x1){_0x26b116>0x0&&(_0x24f779+='\x20'+_0x44a044[_0xa5e9('0x68')]+'\x20');_0x24f779+=_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x69')]?_0x5a4046(_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x69')]):_0x44a044['rules'][_0x26b116][_0xa5e9('0x6a')]+'\x20'+_0x44a044['rules'][_0x26b116][_0xa5e9('0x6b')]+(_0x5288df(_0x44a044[_0xa5e9('0x67')][_0x26b116]['condition'])?'\x20'+_0x44a044[_0xa5e9('0x67')][_0x26b116][_0xa5e9('0x6c')]:'');}return _0x24f779+')';};var _0x303db2={'where':{'id':_0x5badd6[_0xa5e9('0x49')]['id']}},_0x4cb61b,_0x1c60d4,_0x5d33c0,_0x1a5689,_0x10686c;_0x303db2=_[_0xa5e9('0x40')]({},_0x303db2,_0x5badd6[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x303db2)['then'](function(_0x3c84dd){if(_0x3c84dd){_0x4cb61b=_0x3c84dd;return _0x3c84dd[_0xa5e9('0x6d')]();}return null;})[_0xa5e9('0x29')](function(_0x2cb066){if(_0x2cb066){if(!_0x2cb066[_0xa5e9('0x39')]){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x1c60d4=_0x2cb066;return db[_0xa5e9('0x71')][_0xa5e9('0x46')]({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x244a48){if(_0x244a48){_0x5d33c0=_['keyBy'](_0x244a48,'id');var _0x29f672;var _0x202269=squel[_0xa5e9('0x72')]();_0x202269['from'](_0x4cb61b[_0xa5e9('0x73')]);for(var _0x3121fe=0x0;_0x3121fe<_0x1c60d4[_0xa5e9('0x39')];_0x3121fe+=0x1){_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x74')]?_0x5d33c0[_0x1c60d4[_0x3121fe][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x1c60d4[_0x3121fe][_0xa5e9('0x6a')];_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x76')]?_[_0xa5e9('0x77')](_0x449ad1[_0x1c60d4[_0x3121fe]['function']],'%s',_0x29f672):_0x29f672;_0x29f672=_0x1c60d4[_0x3121fe][_0xa5e9('0x78')]?_[_0xa5e9('0x77')](_0xd89b3[_0x1c60d4[_0x3121fe][_0xa5e9('0x78')]],'%s',_0x29f672):_0x29f672;if(_0x1c60d4[_0x3121fe][_0xa5e9('0x79')]){_0x202269[_0xa5e9('0x69')](_0x29f672);}_0x1c60d4[_0x3121fe][_0xa5e9('0x7a')]&&_0x202269[_0xa5e9('0x3b')](_0x29f672,_0x1c60d4[_0x3121fe]['orderBy']===_0xa5e9('0x7b')?![]:!![]);_0x202269[_0xa5e9('0x6a')](_0x29f672,_0x1c60d4[_0x3121fe]['alias']||_0x29f672);}if(_0x4cb61b['joins']){_0x4cb61b['joins']=JSON[_0xa5e9('0x7c')](_0x4cb61b[_0xa5e9('0x7d')]);for(var _0x6bac60=0x0;_0x6bac60<_0x4cb61b[_0xa5e9('0x7d')]['length'];_0x6bac60+=0x1){if(_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x32')]&&_[_0xa5e9('0x63')](_0x3dc5ad,_0x4cb61b['joins'][_0x6bac60]['type'])&&_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x7e')]&&_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60]['foreignTable']&&_0x4cb61b['joins'][_0x6bac60][_0xa5e9('0x7f')]){_0x202269[_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x32')]](_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x4cb61b['table'],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60]['parentKey'],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x80')],_0x4cb61b[_0xa5e9('0x7d')][_0x6bac60][_0xa5e9('0x7f')]));}}}if(_0x4cb61b[_0xa5e9('0x82')]){_0x4cb61b['conditions']=JSON['parse'](_0x4cb61b[_0xa5e9('0x82')]);_0x202269[_0xa5e9('0x3d')](_0x5a4046(_0x4cb61b[_0xa5e9('0x82')][_0xa5e9('0x69')]));}_0x10686c=_0x202269[_0xa5e9('0x83')]();_0x202269['limit'](_0x27ea6f);_0x202269[_0xa5e9('0x21')](0x0);logger[_0xa5e9('0x84')](_0xa5e9('0x85'),_0x202269[_0xa5e9('0x86')]());return dbH[_0xa5e9('0x87')]['query'](_0x202269[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});}})[_0xa5e9('0x29')](respondWithResult(_0x20453e,null))['catch'](handleError(_0x20453e,null));};function runReport(_0x3f888d,_0x1f6032,_0x17b00e){var _0xa48ea9=_0x1f6032[_0xa5e9('0x2e')];var _0x13d97c=0xa;var _0x437bd1=[_0xa5e9('0x58'),_0xa5e9('0x8a'),_0xa5e9('0x59'),'cross_join'];var _0xaba560={'SUM':_0xa5e9('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xa5e9('0x8b'),'MAX':_0xa5e9('0x8c'),'MIN':_0xa5e9('0x5c'),'AVG':_0xa5e9('0x8d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x400dc8={'SEC_TO_TIME':_0xa5e9('0x8e'),'DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x5ee766=function(_0x20d35a){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xa5e9('0x8f'),_0xa5e9('0x66')],_0x20d35a);};var _0x2537f4=function(_0x1d75a0){if(!_0x1d75a0||!_0x1d75a0['rules']['length']){return'';}for(var _0x148a71='(',_0x1a162c=0x0;_0x1a162c<_0x1d75a0[_0xa5e9('0x67')][_0xa5e9('0x39')];_0x1a162c+=0x1){_0x1a162c>0x0&&(_0x148a71+='\x20'+_0x1d75a0[_0xa5e9('0x68')]+'\x20');_0x148a71+=_0x1d75a0['rules'][_0x1a162c][_0xa5e9('0x69')]?_0x2537f4(_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x69')]):_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6a')]+'\x20'+_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6b')]+(_0x5ee766(_0x1d75a0[_0xa5e9('0x67')][_0x1a162c][_0xa5e9('0x6b')])?'\x20'+_0x1d75a0['rules'][_0x1a162c][_0xa5e9('0x6c')]:'');}return _0x148a71+')';};var _0x4a6086={'where':{'id':_0x3f888d['id']}},_0x5327d2,_0x585f46,_0x45443c,_0x2a4a8a,_0x362272;_0x4a6086=_['merge']({},_0x4a6086,_0x17b00e);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x4a6086)[_0xa5e9('0x29')](function(_0xf31b28){if(_0xf31b28){_0x5327d2=_0xf31b28;return _0xf31b28[_0xa5e9('0x6d')]();}return null;})[_0xa5e9('0x29')](function(_0x147b74){if(_0x147b74){if(!_0x147b74[_0xa5e9('0x39')]){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x585f46=_0x147b74;return db[_0xa5e9('0x71')]['findAll']({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x57e62b){if(_0x57e62b){_0x45443c=_[_0xa5e9('0x90')](_0x57e62b,'id');var _0x2b5f72;var _0x58890e=squel[_0xa5e9('0x72')]();_0x58890e[_0xa5e9('0x91')](_0x5327d2[_0xa5e9('0x73')]);for(var _0x46e22c=0x0;_0x46e22c<_0x585f46[_0xa5e9('0x39')];_0x46e22c+=0x1){_0x2b5f72=_0x585f46[_0x46e22c][_0xa5e9('0x74')]?_0x45443c[_0x585f46[_0x46e22c][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x585f46[_0x46e22c][_0xa5e9('0x6a')];_0x2b5f72=_0x585f46[_0x46e22c]['function']?_[_0xa5e9('0x77')](_0xaba560[_0x585f46[_0x46e22c]['function']],'%s',_0x2b5f72):_0x2b5f72;_0x2b5f72=_0x585f46[_0x46e22c]['format']?_[_0xa5e9('0x77')](_0x400dc8[_0x585f46[_0x46e22c]['format']],'%s',_0x2b5f72):_0x2b5f72;if(_0x585f46[_0x46e22c][_0xa5e9('0x79')]){_0x58890e[_0xa5e9('0x69')](_0x2b5f72);}_0x585f46[_0x46e22c][_0xa5e9('0x7a')]&&_0x58890e[_0xa5e9('0x3b')](_0x2b5f72,_0x585f46[_0x46e22c][_0xa5e9('0x7a')]===_0xa5e9('0x7b')?![]:!![]);_0x58890e[_0xa5e9('0x6a')](_0x2b5f72,_0x585f46[_0x46e22c][_0xa5e9('0x92')]||_0x2b5f72);}if(_0x5327d2[_0xa5e9('0x7d')]){_0x5327d2[_0xa5e9('0x7d')]=JSON['parse'](_0x5327d2[_0xa5e9('0x7d')]);for(var _0x5d70c8=0x0;_0x5d70c8<_0x5327d2[_0xa5e9('0x7d')]['length'];_0x5d70c8+=0x1){if(_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x32')]&&_[_0xa5e9('0x63')](_0x437bd1,_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8]['type'])&&_0x5327d2['joins'][_0x5d70c8][_0xa5e9('0x7e')]&&_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x80')]&&_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7f')]){_0x58890e[_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x32')]](_0x5327d2['joins'][_0x5d70c8][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x5327d2[_0xa5e9('0x73')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7e')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x80')],_0x5327d2[_0xa5e9('0x7d')][_0x5d70c8][_0xa5e9('0x7f')]));}}}if(_0x5327d2['conditions']){_0x5327d2[_0xa5e9('0x82')]=JSON[_0xa5e9('0x7c')](_0x5327d2[_0xa5e9('0x82')]);_0x58890e[_0xa5e9('0x3d')](_0x2537f4(_0x5327d2[_0xa5e9('0x82')][_0xa5e9('0x69')]));}_0x362272=_0x58890e[_0xa5e9('0x83')]();_0x58890e[_0xa5e9('0x24')](_0x13d97c);_0x58890e[_0xa5e9('0x21')](0x0);return;}})[_0xa5e9('0x29')](function(){if(_0x1f6032['output']===_0xa5e9('0x93')){return null;}var _0x4a68a3=_['merge'](_0x1f6032,{'name':_0x1f6032[_0xa5e9('0x94')]||_0x1f6032[_0xa5e9('0x2e')]||_0x5327d2[_0xa5e9('0x2e')],'basename':_0xa48ea9,'savename':util[_0xa5e9('0x78')](_0xa5e9('0x95'),_0x1f6032[_0xa5e9('0x2e')]||_0x5327d2[_0xa5e9('0x2e')],require(_0xa5e9('0x96'))[_0xa5e9('0x97')](0x4),_0x1f6032[_0xa5e9('0x98')]||_0xa5e9('0x99')),'reportId':_0x5327d2['id'],'reportType':_0xa5e9('0x9a')});return db['AnalyticExtractedReport']['create'](_0x4a68a3,{'raw':!![]});})[_0xa5e9('0x29')](function(_0x5c4db6){if(_0x5327d2[_0xa5e9('0x73')]===_0xa5e9('0x9b')){_0x362272[_0xa5e9('0x3d')](_0x5327d2[_0xa5e9('0x73')]+_0xa5e9('0x9c'),_0x1f6032[_0xa5e9('0x9d')],_0x1f6032[_0xa5e9('0x9e')]);}else{_0x362272[_0xa5e9('0x3d')](_0x5327d2[_0xa5e9('0x73')]+_0xa5e9('0x9f'),_0x1f6032[_0xa5e9('0x9d')],_0x1f6032[_0xa5e9('0x9e')]);}if(_0x5c4db6){logger[_0xa5e9('0xa0')](_0xa5e9('0xa1'),_0x362272[_0xa5e9('0x86')]());require(_0xa5e9('0xa2'))[_0xa5e9('0xa3')](path[_0xa5e9('0x58')](__dirname,_0xa5e9('0xa4'),_0x5c4db6[_0xa5e9('0x98')]),[_0x5c4db6['id'],_0x362272[_0xa5e9('0x86')](),path[_0xa5e9('0x58')](__dirname,_0xa5e9('0xa5'),_0x5c4db6[_0xa5e9('0xa6')]),_0xa48ea9]);return _0x5c4db6;}else{var _0x48e099=squel[_0xa5e9('0x72')]();_0x48e099[_0xa5e9('0x91')]('('+_0x362272[_0xa5e9('0x86')]()+')',_0xa5e9('0xa7'));_0x48e099[_0xa5e9('0x6a')](_0xa5e9('0xa8'),_0xa5e9('0x23'));_0x362272['limit'](_0x1f6032[_0xa5e9('0x24')]||_0x13d97c);_0x362272[_0xa5e9('0x21')](_0x1f6032[_0xa5e9('0x21')]||0x0);return dbH[_0xa5e9('0x87')]['query'](_0x48e099[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]})[_0xa5e9('0x29')](function(_0x19b160){if(!_0x19b160[_0xa5e9('0x39')]){_0x2a4a8a=0x0;}else{_0x2a4a8a=_0x19b160[0x0][_0xa5e9('0x23')]||0x0;}return dbH[_0xa5e9('0x87')]['query'](_0x362272['toString'](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});})['then'](function(_0x22d71c){return{'rows':_0x22d71c||[],'count':_0x2a4a8a};});}});}exports[_0xa5e9('0xa9')]=function(_0x4ac5d0,_0xe83279){return runReport(_0x4ac5d0[_0xa5e9('0x49')],_0x4ac5d0[_0xa5e9('0x35')],_0x4ac5d0[_0xa5e9('0x42')])['then'](respondWithResult(_0xe83279,null))['catch'](handleError(_0xe83279,null));};exports[_0xa5e9('0xaa')]=runReport;exports[_0xa5e9('0x35')]=function(_0x4050c2,_0x23ce0b){var _0x36c001=0xa;var _0x4f7c1e=['join',_0xa5e9('0x8a'),_0xa5e9('0x59'),_0xa5e9('0x5a')];var _0x541131={'SUM':_0xa5e9('0x5b'),'COUNT':_0xa5e9('0xab'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa5e9('0x8c'),'MIN':_0xa5e9('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa5e9('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xe43a55={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa5e9('0x5f'),'HOUR':_0xa5e9('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa5e9('0x62')};var _0x556b3a=function(_0x5bf54b){return!_[_0xa5e9('0x63')]([_0xa5e9('0x64'),_0xa5e9('0x65'),'IS\x20EMPTY',_0xa5e9('0x66')],_0x5bf54b);};var _0x60a994=function(_0x3b118b){if(!_0x3b118b||!_0x3b118b['rules'][_0xa5e9('0x39')]){return'';}for(var _0x165009='(',_0x50435b=0x0;_0x50435b<_0x3b118b['rules'][_0xa5e9('0x39')];_0x50435b+=0x1){_0x50435b>0x0&&(_0x165009+='\x20'+_0x3b118b[_0xa5e9('0x68')]+'\x20');_0x165009+=_0x3b118b['rules'][_0x50435b][_0xa5e9('0x69')]?_0x60a994(_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x69')]):_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x6a')]+'\x20'+_0x3b118b['rules'][_0x50435b][_0xa5e9('0x6b')]+(_0x556b3a(_0x3b118b[_0xa5e9('0x67')][_0x50435b][_0xa5e9('0x6b')])?'\x20'+_0x3b118b['rules'][_0x50435b][_0xa5e9('0x6c')]:'');}return _0x165009+')';};var _0x8af981={'where':{'id':_0x4050c2['params']['id']}},_0x22118d,_0x12dcc0,_0x15c06b,_0x160562,_0x496aec;_0x8af981=_[_0xa5e9('0x40')]({},_0x8af981,_0x4050c2[_0xa5e9('0x42')]);return db[_0xa5e9('0x43')][_0xa5e9('0x4d')](_0x8af981)[_0xa5e9('0x29')](function(_0x486fa3){if(_0x486fa3){_0x22118d=_0x486fa3;return _0x486fa3[_0xa5e9('0x6d')]();}return null;})['then'](function(_0x43a6cb){if(_0x43a6cb){if(!_0x43a6cb['length']){throw new db[(_0xa5e9('0x6e'))][(_0xa5e9('0x6f'))](_0xa5e9('0x70'),0x193);}_0x12dcc0=_0x43a6cb;return db['AnalyticMetric'][_0xa5e9('0x46')]({'raw':!![]});}return null;})[_0xa5e9('0x29')](function(_0x37a4db){if(_0x37a4db){_0x15c06b=_['keyBy'](_0x37a4db,'id');var _0x175bdf;var _0x16d798=squel['select']();_0x16d798[_0xa5e9('0x91')](_0x22118d['table']);for(var _0x27aacb=0x0;_0x27aacb<_0x12dcc0[_0xa5e9('0x39')];_0x27aacb+=0x1){_0x175bdf=_0x12dcc0[_0x27aacb][_0xa5e9('0x74')]?_0x15c06b[_0x12dcc0[_0x27aacb][_0xa5e9('0x74')]][_0xa5e9('0x75')]:_0x12dcc0[_0x27aacb][_0xa5e9('0x6a')];_0x175bdf=_0x12dcc0[_0x27aacb][_0xa5e9('0x76')]?_[_0xa5e9('0x77')](_0x541131[_0x12dcc0[_0x27aacb][_0xa5e9('0x76')]],'%s',_0x175bdf):_0x175bdf;_0x175bdf=_0x12dcc0[_0x27aacb]['format']?_[_0xa5e9('0x77')](_0xe43a55[_0x12dcc0[_0x27aacb]['format']],'%s',_0x175bdf):_0x175bdf;if(_0x12dcc0[_0x27aacb][_0xa5e9('0x79')]){_0x16d798[_0xa5e9('0x69')](_0x175bdf);}_0x12dcc0[_0x27aacb]['orderBy']&&_0x16d798[_0xa5e9('0x3b')](_0x175bdf,_0x12dcc0[_0x27aacb][_0xa5e9('0x7a')]===_0xa5e9('0x7b')?![]:!![]);_0x16d798['field'](_0x175bdf,_0x12dcc0[_0x27aacb][_0xa5e9('0x92')]||_0x175bdf);}if(_0x22118d[_0xa5e9('0x7d')]){_0x22118d[_0xa5e9('0x7d')]=JSON[_0xa5e9('0x7c')](_0x22118d[_0xa5e9('0x7d')]);for(var _0x4f12e5=0x0;_0x4f12e5<_0x22118d['joins']['length'];_0x4f12e5+=0x1){if(_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['type']&&_[_0xa5e9('0x63')](_0x4f7c1e,_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x32')])&&_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['parentKey']&&_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x80')]&&_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['foreignKey']){_0x16d798[_0x22118d[_0xa5e9('0x7d')][_0x4f12e5][_0xa5e9('0x32')]](_0x22118d['joins'][_0x4f12e5][_0xa5e9('0x80')],null,util[_0xa5e9('0x78')](_0xa5e9('0x81'),_0x22118d[_0xa5e9('0x73')],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['parentKey'],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5]['foreignTable'],_0x22118d[_0xa5e9('0x7d')][_0x4f12e5][_0xa5e9('0x7f')]));}}}if(_0x22118d[_0xa5e9('0x82')]){_0x22118d[_0xa5e9('0x82')]=JSON[_0xa5e9('0x7c')](_0x22118d[_0xa5e9('0x82')]);_0x16d798['where'](_0x60a994(_0x22118d['conditions'][_0xa5e9('0x69')]));}_0x496aec=_0x16d798[_0xa5e9('0x83')]();_0x16d798['limit'](_0x36c001);_0x16d798[_0xa5e9('0x21')](0x0);logger['debug'](_0xa5e9('0x85'),_0x16d798[_0xa5e9('0x86')]());return dbH[_0xa5e9('0x87')][_0xa5e9('0x35')](_0x16d798[_0xa5e9('0x86')](),{'type':dbH[_0xa5e9('0x87')][_0xa5e9('0x88')][_0xa5e9('0x89')]});}})[_0xa5e9('0x29')](function(){return{'sql':_0x496aec[_0xa5e9('0x86')]()};})[_0xa5e9('0x29')](respondWithResult(_0x23ce0b,null))[_0xa5e9('0x47')](handleError(_0x23ce0b,null));};
\ No newline at end of file
index c783f5b..9c63bb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb28=['./analyticCustomReport.attributes','exports','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5e2610,_0xe56978){var _0x4ce655=function(_0x325978){while(--_0x325978){_0x5e2610['push'](_0x5e2610['shift']());}};_0x4ce655(++_0xe56978);}(_0xeb28,0x9f));var _0x8eb2=function(_0x1748fd,_0x2c52a0){_0x1748fd=_0x1748fd-0x0;var _0x4575e8=_0xeb28[_0x1748fd];return _0x4575e8;};'use strict';var _=require(_0x8eb2('0x0'));var util=require(_0x8eb2('0x1'));var logger=require(_0x8eb2('0x2'))(_0x8eb2('0x3'));var moment=require(_0x8eb2('0x4'));var BPromise=require(_0x8eb2('0x5'));var rp=require(_0x8eb2('0x6'));var fs=require('fs');var path=require(_0x8eb2('0x7'));var rimraf=require(_0x8eb2('0x8'));var config=require('../../config/environment');var attributes=require(_0x8eb2('0x9'));module[_0x8eb2('0xa')]=function(_0x3f2d0b,_0x500a6){return _0x3f2d0b['define']('AnalyticCustomReport',attributes,{'tableName':_0x8eb2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7803=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x179351,_0x59cee4){var _0x11d0ec=function(_0x204a10){while(--_0x204a10){_0x179351['push'](_0x179351['shift']());}};_0x11d0ec(++_0x59cee4);}(_0x7803,0x1b1));var _0x3780=function(_0x3b2d4f,_0x1ebc96){_0x3b2d4f=_0x3b2d4f-0x0;var _0x4babfb=_0x7803[_0x3b2d4f];return _0x4babfb;};'use strict';var _=require(_0x3780('0x0'));var util=require(_0x3780('0x1'));var logger=require(_0x3780('0x2'))(_0x3780('0x3'));var moment=require(_0x3780('0x4'));var BPromise=require('bluebird');var rp=require(_0x3780('0x5'));var fs=require('fs');var path=require(_0x3780('0x6'));var rimraf=require('rimraf');var config=require(_0x3780('0x7'));var attributes=require(_0x3780('0x8'));module[_0x3780('0x9')]=function(_0x4197da,_0x5759f3){return _0x4197da[_0x3780('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0x3780('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 34bdcd5..f88a177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa76=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2a815a,_0x46e71b){var _0x11296b=function(_0x392bc1){while(--_0x392bc1){_0x2a815a['push'](_0x2a815a['shift']());}};_0x11296b(++_0x46e71b);}(_0xfa76,0x18f));var _0x6fa7=function(_0x456a43,_0x471c3a){_0x456a43=_0x456a43-0x0;var _0xfe97de=_0xfa76[_0x456a43];return _0xfe97de;};'use strict';var _=require(_0x6fa7('0x0'));var util=require(_0x6fa7('0x1'));var moment=require(_0x6fa7('0x2'));var BPromise=require(_0x6fa7('0x3'));var rs=require(_0x6fa7('0x4'));var fs=require('fs');var Redis=require(_0x6fa7('0x5'));var db=require(_0x6fa7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fa7('0x7'))(_0x6fa7('0x8'));var config=require('../../config/environment');var jayson=require(_0x6fa7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bcb54,_0x53ec8f,_0x2a6f50){return new BPromise(function(_0x503e1a,_0x5299db){return client[_0x6fa7('0xa')](_0x1bcb54,_0x2a6f50)[_0x6fa7('0xb')](function(_0x2f1cc5){logger[_0x6fa7('0xc')](_0x6fa7('0xd'),_0x53ec8f,_0x6fa7('0xe'));logger[_0x6fa7('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x53ec8f,'request\x20sent',JSON[_0x6fa7('0x10')](_0x2f1cc5));if(_0x2f1cc5[_0x6fa7('0x11')]){if(_0x2f1cc5['error'][_0x6fa7('0x12')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x53ec8f,_0x2f1cc5[_0x6fa7('0x11')][_0x6fa7('0x13')]);return _0x5299db(_0x2f1cc5['error'][_0x6fa7('0x13')]);}logger['error'](_0x6fa7('0xd'),_0x53ec8f,_0x2f1cc5[_0x6fa7('0x11')]['message']);return _0x503e1a(_0x2f1cc5[_0x6fa7('0x11')][_0x6fa7('0x13')]);}else{logger['info'](_0x6fa7('0xd'),_0x53ec8f,'request\x20sent');_0x503e1a(_0x2f1cc5[_0x6fa7('0x14')][_0x6fa7('0x13')]);}})[_0x6fa7('0x15')](function(_0x13bbb8){logger[_0x6fa7('0x11')](_0x6fa7('0xd'),_0x53ec8f,_0x13bbb8);_0x5299db(_0x13bbb8);});});}
\ No newline at end of file
+var _0x3be1=['AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x3be1,0x1bd));var _0x13be=function(_0x2b3f39,_0x137ea5){_0x2b3f39=_0x2b3f39-0x0;var _0x16b06f=_0x3be1[_0x2b3f39];return _0x16b06f;};'use strict';var _=require('lodash');var util=require(_0x13be('0x0'));var moment=require(_0x13be('0x1'));var BPromise=require(_0x13be('0x2'));var rs=require(_0x13be('0x3'));var fs=require('fs');var Redis=require(_0x13be('0x4'));var db=require(_0x13be('0x5'))['db'];var utils=require(_0x13be('0x6'));var logger=require(_0x13be('0x7'))(_0x13be('0x8'));var config=require('../../config/environment');var jayson=require(_0x13be('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6fa2,_0x2105c8,_0x44ef7b){return new BPromise(function(_0x53d160,_0x141d88){return client['request'](_0x5b6fa2,_0x44ef7b)['then'](function(_0x4e015c){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2105c8,_0x13be('0xa'));logger['debug'](_0x13be('0xb'),_0x2105c8,_0x13be('0xa'),JSON[_0x13be('0xc')](_0x4e015c));if(_0x4e015c[_0x13be('0xd')]){if(_0x4e015c['error'][_0x13be('0xe')]===0x1f4){logger[_0x13be('0xd')](_0x13be('0xf'),_0x2105c8,_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);return _0x141d88(_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);}logger[_0x13be('0xd')](_0x13be('0xf'),_0x2105c8,_0x4e015c[_0x13be('0xd')]['message']);return _0x53d160(_0x4e015c[_0x13be('0xd')][_0x13be('0x10')]);}else{logger[_0x13be('0x11')](_0x13be('0xf'),_0x2105c8,_0x13be('0xa'));_0x53d160(_0x4e015c[_0x13be('0x12')][_0x13be('0x10')]);}})[_0x13be('0x13')](function(_0x40771e){logger[_0x13be('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2105c8,_0x40771e);_0x141d88(_0x40771e);});});}
\ No newline at end of file
index acf268d..2b089eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe93d=['query','post','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x315b9f,_0x5463c9){var _0x5c2907=function(_0x5607df){while(--_0x5607df){_0x315b9f['push'](_0x315b9f['shift']());}};_0x5c2907(++_0x5463c9);}(_0xe93d,0x1be));var _0xde93=function(_0xe2d486,_0x375089){_0xe2d486=_0xe2d486-0x0;var _0x414ffe=_0xe93d[_0xe2d486];return _0x414ffe;};'use strict';var multer=require(_0xde93('0x0'));var util=require(_0xde93('0x1'));var path=require('path');var timeout=require(_0xde93('0x2'));var express=require(_0xde93('0x3'));var router=express['Router']();var fs_extra=require(_0xde93('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde93('0x5'));var controller=require(_0xde93('0x6'));router[_0xde93('0x7')]('/',auth[_0xde93('0x8')](),controller['index']);router[_0xde93('0x7')](_0xde93('0x9'),auth['isAuthenticated'](),controller[_0xde93('0xa')]);router[_0xde93('0x7')](_0xde93('0xb'),auth[_0xde93('0x8')](),controller[_0xde93('0xc')]);router[_0xde93('0x7')](_0xde93('0xd'),auth[_0xde93('0x8')](),controller[_0xde93('0xe')]);router[_0xde93('0x7')](_0xde93('0xf'),auth[_0xde93('0x8')](),controller[_0xde93('0x10')]);router[_0xde93('0x11')]('/',auth[_0xde93('0x8')](),controller['create']);router[_0xde93('0x12')](_0xde93('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xde93('0x9'),auth['isAuthenticated'](),controller[_0xde93('0x13')]);module[_0xde93('0x14')]=router;
\ No newline at end of file
+var _0x0b45=['create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post'];(function(_0x3db456,_0x3b93b5){var _0x2402a1=function(_0x3ae218){while(--_0x3ae218){_0x3db456['push'](_0x3db456['shift']());}};_0x2402a1(++_0x3b93b5);}(_0x0b45,0xb3));var _0x50b4=function(_0x4b5a95,_0x4b046c){_0x4b5a95=_0x4b5a95-0x0;var _0x28d360=_0x0b45[_0x4b5a95];return _0x28d360;};'use strict';var multer=require(_0x50b4('0x0'));var util=require(_0x50b4('0x1'));var path=require(_0x50b4('0x2'));var timeout=require(_0x50b4('0x3'));var express=require(_0x50b4('0x4'));var router=express[_0x50b4('0x5')]();var fs_extra=require(_0x50b4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50b4('0x7'));var config=require(_0x50b4('0x8'));var controller=require('./analyticCustomReport.controller');router[_0x50b4('0x9')]('/',auth['isAuthenticated'](),controller[_0x50b4('0xa')]);router[_0x50b4('0x9')](_0x50b4('0xb'),auth['isAuthenticated'](),controller[_0x50b4('0xc')]);router[_0x50b4('0x9')](_0x50b4('0xd'),auth[_0x50b4('0xe')](),controller[_0x50b4('0xf')]);router[_0x50b4('0x9')](_0x50b4('0x10'),auth['isAuthenticated'](),controller[_0x50b4('0x11')]);router[_0x50b4('0x9')](_0x50b4('0x12'),auth[_0x50b4('0xe')](),controller[_0x50b4('0x13')]);router[_0x50b4('0x14')]('/',auth[_0x50b4('0xe')](),controller[_0x50b4('0x15')]);router['put'](_0x50b4('0xb'),auth[_0x50b4('0xe')](),controller[_0x50b4('0x16')]);router[_0x50b4('0x17')]('/:id',auth[_0x50b4('0xe')](),controller[_0x50b4('0x18')]);module['exports']=router;
\ No newline at end of file
index b0d41fd..7b44de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x35ebae,_0x4f86c4){var _0x1924cf=function(_0x5788fe){while(--_0x5788fe){_0x35ebae['push'](_0x35ebae['shift']());}};_0x1924cf(++_0x4f86c4);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0x24ca[_0x2c0ded];return _0x4473e5;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}};
\ No newline at end of file
+var _0x5d58=['TEXT','STRING'];(function(_0x3e1740,_0x46f1b6){var _0x507cb0=function(_0x5afe84){while(--_0x5afe84){_0x3e1740['push'](_0x3e1740['shift']());}};_0x507cb0(++_0x46f1b6);}(_0x5d58,0x187));var _0x85d5=function(_0x121325,_0x47ec9a){_0x121325=_0x121325-0x0;var _0x1c5f43=_0x5d58[_0x121325];return _0x1c5f43;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 409848d..5df5bf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['set','Content-Range','apply','reject','save','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','groupBy','orderBy','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','SEC_TO_TIME(%s)','ROUND(%s)','IS\x20EMPTY','getFields','format','foreignKey','web','%s-%s.%s','randomstring','generate','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20NOT\x20EMPTY','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','dbH','status','json','offset','limit','undefined','count'];(function(_0xfc84ed,_0x32ee8a){var _0xb5fba1=function(_0x1e3938){while(--_0x1e3938){_0xfc84ed['push'](_0xfc84ed['shift']());}};_0xb5fba1(++_0x32ee8a);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];var dbH=require(_0xee2f('0x10'))[_0xee2f('0x11')];function respondWithStatusCode(_0x100449,_0x131874){_0x131874=_0x131874||0xcc;return function(_0x3ab91f){if(_0x3ab91f){return _0x100449['sendStatus'](_0x131874);}return _0x100449[_0xee2f('0x12')](_0x131874)['end']();};}function respondWithResult(_0x36db10,_0x271c1d){_0x271c1d=_0x271c1d||0xc8;return function(_0x48b30c){if(_0x48b30c){return _0x36db10[_0xee2f('0x12')](_0x271c1d)[_0xee2f('0x13')](_0x48b30c);}};}function respondWithFilteredResult(_0x28b614,_0x1bbf7d){return function(_0x390c2c){if(_0x390c2c){var _0x58f42a=typeof _0x1bbf7d[_0xee2f('0x14')]==='undefined'&&typeof _0x1bbf7d[_0xee2f('0x15')]===_0xee2f('0x16');var _0x502eb6=_0x390c2c['count'];var _0x40b5bc=_0x58f42a?0x0:_0x1bbf7d['offset'];var _0x69db88=_0x58f42a?_0x390c2c[_0xee2f('0x17')]:_0x1bbf7d[_0xee2f('0x14')]+_0x1bbf7d['limit'];var _0x35e1a4;if(_0x69db88>=_0x502eb6){_0x69db88=_0x502eb6;_0x35e1a4=0xc8;}else{_0x35e1a4=0xce;}_0x28b614[_0xee2f('0x12')](_0x35e1a4);return _0x28b614[_0xee2f('0x18')](_0xee2f('0x19'),_0x40b5bc+'-'+_0x69db88+'/'+_0x502eb6)[_0xee2f('0x13')](_0x390c2c);}return null;};}function patchUpdates(_0x5d36d4){return function(_0x5e73ad){try{jsonpatch[_0xee2f('0x1a')](_0x5e73ad,_0x5d36d4,!![]);}catch(_0x3a1852){return BPromise[_0xee2f('0x1b')](_0x3a1852);}return _0x5e73ad[_0xee2f('0x1c')]();};}function saveUpdates(_0x472e3b,_0xf278cc){return function(_0x39a39c){if(_0x39a39c){return _0x39a39c['update'](_0x472e3b)[_0xee2f('0x1d')](function(_0x2c47c5){return _0x2c47c5;});}return null;};}function removeEntity(_0x15ceda,_0x70e308){return function(_0x820101){if(_0x820101){return _0x820101[_0xee2f('0x1e')]()[_0xee2f('0x1d')](function(){var _0x13013f=_0x820101[_0xee2f('0x1f')]({'plain':!![]});var _0x1e394f=_0xee2f('0x20');return db[_0xee2f('0x21')][_0xee2f('0x1e')]({'where':{'type':_0x1e394f,'resourceId':_0x13013f['id']}})[_0xee2f('0x1d')](function(){return _0x820101;});})['then'](function(){_0x15ceda['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18bdbb,_0x18ff19){return function(_0x2cb0cb){if(!_0x2cb0cb){_0x18bdbb[_0xee2f('0x22')](0x194);}return _0x2cb0cb;};}function handleError(_0x892a4e,_0x3737fd){_0x3737fd=_0x3737fd||0x1f4;return function(_0x4d8398){logger[_0xee2f('0x23')](_0x4d8398['stack']);if(_0x4d8398[_0xee2f('0x24')]){delete _0x4d8398[_0xee2f('0x24')];}_0x892a4e[_0xee2f('0x12')](_0x3737fd)[_0xee2f('0x25')](_0x4d8398);};}exports[_0xee2f('0x26')]=function(_0x47d5a6,_0x310c0b){var _0xd16e35={},_0x56706e={},_0x4ee0e1={'count':0x0,'rows':[]};var _0xd1aaac=_['map'](db[_0xee2f('0x27')][_0xee2f('0x28')],function(_0x53d9b7){return{'name':_0x53d9b7[_0xee2f('0x29')],'type':_0x53d9b7['type']['key']};});_0x56706e['model']=_[_0xee2f('0x2a')](_0xd1aaac,_0xee2f('0x24'));_0x56706e['query']=_[_0xee2f('0x2b')](_0x47d5a6[_0xee2f('0x2c')]);_0x56706e[_0xee2f('0x2d')]=_[_0xee2f('0x2e')](_0x56706e[_0xee2f('0x2f')],_0x56706e['query']);_0xd16e35[_0xee2f('0x30')]=_['intersection'](_0x56706e[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x47d5a6[_0xee2f('0x2c')]['fields']));_0xd16e35[_0xee2f('0x30')]=_0xd16e35['attributes'][_0xee2f('0x32')]?_0xd16e35['attributes']:_0x56706e[_0xee2f('0x2f')];if(!_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x33')](_0xee2f('0x34'))){_0xd16e35[_0xee2f('0x15')]=qs[_0xee2f('0x15')](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x15')]);_0xd16e35[_0xee2f('0x14')]=qs[_0xee2f('0x14')](_0x47d5a6[_0xee2f('0x2c')]['offset']);}_0xd16e35[_0xee2f('0x35')]=qs['sort'](_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x36')]);_0xd16e35[_0xee2f('0x37')]=qs[_0xee2f('0x2d')](_[_0xee2f('0x38')](_0x47d5a6[_0xee2f('0x2c')],_0x56706e[_0xee2f('0x2d')]),_0xd1aaac);if(_0x47d5a6[_0xee2f('0x2c')]['filter']){_0xd16e35['where']=_['merge'](_0xd16e35[_0xee2f('0x37')],{'$or':_['map'](_0xd1aaac,function(_0x4501c4){if(_0x4501c4['type']!=='VIRTUAL'){var _0x5027a6={};_0x5027a6[_0x4501c4['name']]={'$like':'%'+_0x47d5a6[_0xee2f('0x2c')][_0xee2f('0x39')]+'%'};return _0x5027a6;}})});}_0xd16e35=_[_0xee2f('0x3a')]({},_0xd16e35,_0x47d5a6[_0xee2f('0x3b')]);var _0x4823a7={'where':_0xd16e35['where']};return db[_0xee2f('0x27')]['count'](_0x4823a7)['then'](function(_0x8204dc){_0x4ee0e1[_0xee2f('0x17')]=_0x8204dc;if(_0x47d5a6[_0xee2f('0x2c')]['includeAll']){_0xd16e35[_0xee2f('0x3c')]=[{'all':!![]}];}return db[_0xee2f('0x27')][_0xee2f('0x3d')](_0xd16e35);})['then'](function(_0x5896f6){_0x4ee0e1[_0xee2f('0x3e')]=_0x5896f6;return _0x4ee0e1;})[_0xee2f('0x1d')](respondWithFilteredResult(_0x310c0b,_0xd16e35))[_0xee2f('0x3f')](handleError(_0x310c0b,null));};exports[_0xee2f('0x40')]=function(_0x541fa0,_0x20697e){var _0x1df63d={'raw':!![],'where':{'id':_0x541fa0[_0xee2f('0x41')]['id']}},_0x242e91={};_0x242e91[_0xee2f('0x2f')]=_[_0xee2f('0x2b')](db[_0xee2f('0x27')][_0xee2f('0x28')]);_0x242e91[_0xee2f('0x2c')]=_[_0xee2f('0x2b')](_0x541fa0['query']);_0x242e91['filters']=_['intersection'](_0x242e91['model'],_0x242e91[_0xee2f('0x2c')]);_0x1df63d[_0xee2f('0x30')]=_[_0xee2f('0x2e')](_0x242e91[_0xee2f('0x2f')],qs[_0xee2f('0x31')](_0x541fa0['query'][_0xee2f('0x31')]));_0x1df63d[_0xee2f('0x30')]=_0x1df63d[_0xee2f('0x30')][_0xee2f('0x32')]?_0x1df63d['attributes']:_0x242e91['model'];if(_0x541fa0['query'][_0xee2f('0x42')]){_0x1df63d['include']=[{'all':!![]}];}_0x1df63d=_['merge']({},_0x1df63d,_0x541fa0['options']);return db['AnalyticDefaultReport'][_0xee2f('0x43')](_0x1df63d)[_0xee2f('0x1d')](handleEntityNotFound(_0x20697e,null))[_0xee2f('0x1d')](respondWithResult(_0x20697e,null))['catch'](handleError(_0x20697e,null));};exports[_0xee2f('0x44')]=function(_0x57f65d,_0x3d95b8){return db[_0xee2f('0x27')][_0xee2f('0x44')](_0x57f65d[_0xee2f('0x45')],{})[_0xee2f('0x1d')](function(_0x4978eb){var _0x533ad0=_0x57f65d[_0xee2f('0x46')]['get']({'plain':!![]});if(!_0x533ad0)throw new Error(_0xee2f('0x47'));if(_0x533ad0[_0xee2f('0x48')]===_0xee2f('0x46')){var _0x88e683=_0x4978eb['get']({'plain':!![]});var _0x5df503=_0xee2f('0x49');return db[_0xee2f('0x4a')][_0xee2f('0x43')]({'where':{'name':_0x5df503,'userProfileId':_0x533ad0[_0xee2f('0x4b')]},'raw':!![]})[_0xee2f('0x1d')](function(_0x2a450f){if(_0x2a450f&&_0x2a450f[_0xee2f('0x4c')]===0x0){return db[_0xee2f('0x21')][_0xee2f('0x44')]({'name':_0x88e683[_0xee2f('0x24')],'resourceId':_0x88e683['id'],'type':_0xee2f('0x20'),'sectionId':_0x2a450f['id']},{})[_0xee2f('0x1d')](function(){return _0x4978eb;});}else{return _0x4978eb;}})['catch'](function(_0x34cb51){logger[_0xee2f('0x23')](_0xee2f('0x4d'),_0x34cb51);throw _0x34cb51;});}return _0x4978eb;})[_0xee2f('0x1d')](respondWithResult(_0x3d95b8,0xc9))['catch'](handleError(_0x3d95b8,null));};exports[_0xee2f('0x4e')]=function(_0xb3bf3f,_0x3a476f){if(_0xb3bf3f[_0xee2f('0x45')]['id']){delete _0xb3bf3f[_0xee2f('0x45')]['id'];}return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0xb3bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3a476f,null))[_0xee2f('0x1d')](saveUpdates(_0xb3bf3f[_0xee2f('0x45')],null))[_0xee2f('0x1d')](respondWithResult(_0x3a476f,null))[_0xee2f('0x3f')](handleError(_0x3a476f,null));};exports[_0xee2f('0x1e')]=function(_0x101e09,_0x20aaca){return db['AnalyticDefaultReport'][_0xee2f('0x43')]({'where':{'id':_0x101e09[_0xee2f('0x41')]['id']}})[_0xee2f('0x1d')](handleEntityNotFound(_0x20aaca,null))[_0xee2f('0x1d')](removeEntity(_0x20aaca,null))[_0xee2f('0x3f')](handleError(_0x20aaca,null));};exports[_0xee2f('0x4f')]=function(_0xcba6fc,_0x2b9636){var _0x1373a1=0xa;var _0x5d6c40=[_0xee2f('0x50'),'left_join',_0xee2f('0x51'),_0xee2f('0x52')];var _0x1dbbf2={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':_0xee2f('0x56'),'AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4fb159={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x1421da=function(_0xd967e9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),_0xee2f('0x5d'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xd967e9);};var _0x1708c5=function(_0x58e464){if(!_0x58e464||!_0x58e464[_0xee2f('0x5e')]['length']){return'';}for(var _0x7167f9='(',_0x59af84=0x0;_0x59af84<_0x58e464[_0xee2f('0x5e')][_0xee2f('0x32')];_0x59af84+=0x1){_0x59af84>0x0&&(_0x7167f9+='\x20'+_0x58e464[_0xee2f('0x5f')]+'\x20');_0x7167f9+=_0x58e464['rules'][_0x59af84][_0xee2f('0x60')]?_0x1708c5(_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x60')]):_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x61')]+'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x62')]+(_0x1421da(_0x58e464['rules'][_0x59af84][_0xee2f('0x62')])?'\x20'+_0x58e464[_0xee2f('0x5e')][_0x59af84][_0xee2f('0x63')]:'');}return _0x7167f9+')';};var _0x353bd9={'where':{'id':_0xcba6fc[_0xee2f('0x41')]['id']}},_0x5280c7,_0x3c9d47,_0x8ccc9d,_0x15c7ff,_0x191af8;_0x353bd9=_[_0xee2f('0x3a')]({},_0x353bd9,_0xcba6fc['options']);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x353bd9)['then'](function(_0x9252e3){if(_0x9252e3){_0x5280c7=_0x9252e3;return _0x9252e3['getFields']();}return null;})[_0xee2f('0x1d')](function(_0x4ed7c9){if(_0x4ed7c9){if(!_0x4ed7c9['length']){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x3c9d47=_0x4ed7c9;return db[_0xee2f('0x67')][_0xee2f('0x3d')]({'raw':!![]});}return null;})['then'](function(_0x238e7d){if(_0x238e7d){_0x8ccc9d=_[_0xee2f('0x68')](_0x238e7d,'id');var _0x42fae8;var _0x5d4fe8=squel[_0xee2f('0x69')]();_0x5d4fe8[_0xee2f('0x6a')](_0x5280c7['table']);for(var _0x1f1c55=0x0;_0x1f1c55<_0x3c9d47[_0xee2f('0x32')];_0x1f1c55+=0x1){_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]?_0x8ccc9d[_0x3c9d47[_0x1f1c55][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x3c9d47[_0x1f1c55][_0xee2f('0x61')];_0x42fae8=_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x1dbbf2[_0x3c9d47[_0x1f1c55][_0xee2f('0x6d')]],'%s',_0x42fae8):_0x42fae8;_0x42fae8=_0x3c9d47[_0x1f1c55]['format']?_['replace'](_0x4fb159[_0x3c9d47[_0x1f1c55]['format']],'%s',_0x42fae8):_0x42fae8;if(_0x3c9d47[_0x1f1c55][_0xee2f('0x6f')]){_0x5d4fe8[_0xee2f('0x60')](_0x42fae8);}_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]&&_0x5d4fe8[_0xee2f('0x35')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x5d4fe8[_0xee2f('0x61')](_0x42fae8,_0x3c9d47[_0x1f1c55][_0xee2f('0x71')]||_0x42fae8);}if(_0x5280c7['joins']){_0x5280c7[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x72')]);for(var _0x5a7b6c=0x0;_0x5a7b6c<_0x5280c7[_0xee2f('0x72')]['length'];_0x5a7b6c+=0x1){if(_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]&&_['includes'](_0x5d6c40,_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')])&&_0x5280c7['joins'][_0x5a7b6c]['parentKey']&&_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')]&&_0x5280c7['joins'][_0x5a7b6c]['foreignKey']){_0x5d4fe8[_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x74')]](_0x5280c7['joins'][_0x5a7b6c][_0xee2f('0x75')],null,util['format'](_0xee2f('0x76'),_0x5280c7[_0xee2f('0x77')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x78')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c][_0xee2f('0x75')],_0x5280c7[_0xee2f('0x72')][_0x5a7b6c]['foreignKey']));}}}if(_0x5280c7[_0xee2f('0x79')]){_0x5280c7[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x5280c7[_0xee2f('0x79')]);_0x5d4fe8[_0xee2f('0x37')](_0x1708c5(_0x5280c7['conditions'][_0xee2f('0x60')]));}_0x191af8=_0x5d4fe8[_0xee2f('0x7a')]();_0x5d4fe8[_0xee2f('0x15')](_0x1373a1);_0x5d4fe8[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x5d4fe8['toString']());return dbH['sequelize'][_0xee2f('0x2c')](_0x5d4fe8[_0xee2f('0x7d')](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](respondWithResult(_0x2b9636,null))[_0xee2f('0x3f')](handleError(_0x2b9636,null));};function runReport(_0x58c49e,_0x5b7b55,_0x2ad26d){var _0x27eabc=_0x5b7b55[_0xee2f('0x24')];var _0xc92046=0xa;var _0x38ee46=[_0xee2f('0x50'),_0xee2f('0x81'),_0xee2f('0x51'),_0xee2f('0x52')];var _0x21ac2d={'SUM':_0xee2f('0x53'),'COUNT':_0xee2f('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xee2f('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2ea31f={'SEC_TO_TIME':_0xee2f('0x82'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':_0xee2f('0x5a')};var _0x18e191=function(_0x4fad8f){return!_['includes']([_0xee2f('0x5c'),_0xee2f('0x5d'),_0xee2f('0x84'),'IS\x20NOT\x20EMPTY'],_0x4fad8f);};var _0xd7c8f8=function(_0x4b0611){if(!_0x4b0611||!_0x4b0611[_0xee2f('0x5e')]['length']){return'';}for(var _0x378fc9='(',_0x25a3b9=0x0;_0x25a3b9<_0x4b0611[_0xee2f('0x5e')]['length'];_0x25a3b9+=0x1){_0x25a3b9>0x0&&(_0x378fc9+='\x20'+_0x4b0611['operator']+'\x20');_0x378fc9+=_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x60')]?_0xd7c8f8(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9]['group']):_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x61')]+'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')]+(_0x18e191(_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x62')])?'\x20'+_0x4b0611[_0xee2f('0x5e')][_0x25a3b9][_0xee2f('0x63')]:'');}return _0x378fc9+')';};var _0x449656={'where':{'id':_0x58c49e['id']}},_0x1db0b5,_0x9f06f9,_0x659080,_0x28bde7,_0x214f94;_0x449656=_['merge']({},_0x449656,_0x2ad26d);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x449656)[_0xee2f('0x1d')](function(_0x2f5ed7){if(_0x2f5ed7){_0x1db0b5=_0x2f5ed7;return _0x2f5ed7[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x34cd09){if(_0x34cd09){if(!_0x34cd09[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))](_0xee2f('0x66'),0x193);}_0x9f06f9=_0x34cd09;return db['AnalyticMetric'][_0xee2f('0x3d')]({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x1422e9){if(_0x1422e9){_0x659080=_[_0xee2f('0x68')](_0x1422e9,'id');var _0x53d769;var _0x15ca4e=squel[_0xee2f('0x69')]();_0x15ca4e[_0xee2f('0x6a')](_0x1db0b5['table']);for(var _0x4f02aa=0x0;_0x4f02aa<_0x9f06f9[_0xee2f('0x32')];_0x4f02aa+=0x1){_0x53d769=_0x9f06f9[_0x4f02aa]['MetricId']?_0x659080[_0x9f06f9[_0x4f02aa]['MetricId']]['metric']:_0x9f06f9[_0x4f02aa][_0xee2f('0x61')];_0x53d769=_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0x21ac2d[_0x9f06f9[_0x4f02aa][_0xee2f('0x6d')]],'%s',_0x53d769):_0x53d769;_0x53d769=_0x9f06f9[_0x4f02aa]['format']?_[_0xee2f('0x6e')](_0x2ea31f[_0x9f06f9[_0x4f02aa][_0xee2f('0x86')]],'%s',_0x53d769):_0x53d769;if(_0x9f06f9[_0x4f02aa][_0xee2f('0x6f')]){_0x15ca4e['group'](_0x53d769);}_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]&&_0x15ca4e['order'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x70')]==='DESC'?![]:!![]);_0x15ca4e['field'](_0x53d769,_0x9f06f9[_0x4f02aa][_0xee2f('0x71')]||_0x53d769);}if(_0x1db0b5['joins']){_0x1db0b5[_0xee2f('0x72')]=JSON['parse'](_0x1db0b5['joins']);for(var _0x149d7f=0x0;_0x149d7f<_0x1db0b5[_0xee2f('0x72')]['length'];_0x149d7f+=0x1){if(_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x74')]&&_['includes'](_0x38ee46,_0x1db0b5['joins'][_0x149d7f][_0xee2f('0x74')])&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['parentKey']&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')]&&_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]){_0x15ca4e[_0x1db0b5[_0xee2f('0x72')][_0x149d7f]['type']](_0x1db0b5['joins'][_0x149d7f]['foreignTable'],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x1db0b5[_0xee2f('0x77')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x78')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x75')],_0x1db0b5[_0xee2f('0x72')][_0x149d7f][_0xee2f('0x87')]));}}}if(_0x1db0b5[_0xee2f('0x79')]){_0x1db0b5[_0xee2f('0x79')]=JSON[_0xee2f('0x73')](_0x1db0b5[_0xee2f('0x79')]);_0x15ca4e[_0xee2f('0x37')](_0xd7c8f8(_0x1db0b5[_0xee2f('0x79')][_0xee2f('0x60')]));}_0x214f94=_0x15ca4e['clone']();_0x15ca4e['limit'](_0xc92046);_0x15ca4e[_0xee2f('0x14')](0x0);return;}})[_0xee2f('0x1d')](function(){if(_0x5b7b55['output']===_0xee2f('0x88')){return null;}var _0x444c39=_[_0xee2f('0x3a')](_0x5b7b55,{'name':_0x5b7b55['fullPath']||_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],'basename':_0x27eabc,'savename':util[_0xee2f('0x86')](_0xee2f('0x89'),_0x5b7b55[_0xee2f('0x24')]||_0x1db0b5[_0xee2f('0x24')],require(_0xee2f('0x8a'))[_0xee2f('0x8b')](0x4),_0x5b7b55[_0xee2f('0x8c')]||'csv'),'reportId':_0x1db0b5['id'],'reportType':_0xee2f('0x8d')});return db[_0xee2f('0x8e')][_0xee2f('0x44')](_0x444c39,{'raw':!![]});})[_0xee2f('0x1d')](function(_0xe7e196){if(_0x1db0b5[_0xee2f('0x77')]===_0xee2f('0x8f')){_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+_0xee2f('0x90'),_0x5b7b55[_0xee2f('0x91')],_0x5b7b55['endDate']);}else{_0x214f94[_0xee2f('0x37')](_0x1db0b5['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b7b55[_0xee2f('0x91')],_0x5b7b55[_0xee2f('0x92')]);}if(_0xe7e196){logger[_0xee2f('0x93')](_0xee2f('0x94'),_0x214f94[_0xee2f('0x7d')]());require(_0xee2f('0x95'))['fork'](path[_0xee2f('0x50')](__dirname,_0xee2f('0x96'),_0xe7e196['output']),[_0xe7e196['id'],_0x214f94[_0xee2f('0x7d')](),path[_0xee2f('0x50')](__dirname,'../../files/reports',_0xe7e196[_0xee2f('0x97')]),_0x27eabc]);return _0xe7e196;}else{var _0x26dd6c=squel[_0xee2f('0x69')]();_0x26dd6c[_0xee2f('0x6a')]('('+_0x214f94[_0xee2f('0x7d')]()+')',_0xee2f('0x98'));_0x26dd6c[_0xee2f('0x61')](_0xee2f('0x99'),_0xee2f('0x17'));_0x214f94[_0xee2f('0x15')](_0x5b7b55[_0xee2f('0x15')]||_0xc92046);_0x214f94[_0xee2f('0x14')](_0x5b7b55['offset']||0x0);return dbH[_0xee2f('0x7e')]['query'](_0x26dd6c['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')]['SELECT']})[_0xee2f('0x1d')](function(_0x472f83){if(!_0x472f83[_0xee2f('0x32')]){_0x28bde7=0x0;}else{_0x28bde7=_0x472f83[0x0]['count']||0x0;}return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x214f94['toString'](),{'type':dbH[_0xee2f('0x7e')][_0xee2f('0x7f')][_0xee2f('0x80')]});})[_0xee2f('0x1d')](function(_0x121a34){return{'rows':_0x121a34||[],'count':_0x28bde7};});}});}exports[_0xee2f('0x9a')]=function(_0x3d8c56,_0x5c8550){return runReport(_0x3d8c56[_0xee2f('0x41')],_0x3d8c56[_0xee2f('0x2c')],_0x3d8c56['options'])[_0xee2f('0x1d')](respondWithResult(_0x5c8550,null))[_0xee2f('0x3f')](handleError(_0x5c8550,null));};exports[_0xee2f('0x9b')]=runReport;exports['query']=function(_0x40fa57,_0x1fafcc){var _0x1163f1=0xa;var _0x162014=[_0xee2f('0x50'),_0xee2f('0x81'),'right_join',_0xee2f('0x52')];var _0xb93091={'SUM':_0xee2f('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xee2f('0x55'),'MIN':'MIN(%s)','AVG':_0xee2f('0x57'),'GROUP_CONCAT':_0xee2f('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xee2f('0x9c')};var _0x39922f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xee2f('0x59'),'ROUND':_0xee2f('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1c9f70=function(_0xa93dc9){return!_[_0xee2f('0x5b')]([_0xee2f('0x5c'),'IS\x20NOT\x20NULL',_0xee2f('0x84'),_0xee2f('0x9d')],_0xa93dc9);};var _0x44b06b=function(_0x541ac7){if(!_0x541ac7||!_0x541ac7[_0xee2f('0x5e')][_0xee2f('0x32')]){return'';}for(var _0xa89897='(',_0x2def5c=0x0;_0x2def5c<_0x541ac7['rules']['length'];_0x2def5c+=0x1){_0x2def5c>0x0&&(_0xa89897+='\x20'+_0x541ac7[_0xee2f('0x5f')]+'\x20');_0xa89897+=_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x60')]?_0x44b06b(_0x541ac7['rules'][_0x2def5c][_0xee2f('0x60')]):_0x541ac7[_0xee2f('0x5e')][_0x2def5c]['field']+'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')]+(_0x1c9f70(_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x62')])?'\x20'+_0x541ac7[_0xee2f('0x5e')][_0x2def5c][_0xee2f('0x63')]:'');}return _0xa89897+')';};var _0x3f9188={'where':{'id':_0x40fa57['params']['id']}},_0x236b63,_0x4ad336,_0x3370de,_0x3c8c20,_0xc9228;_0x3f9188=_[_0xee2f('0x3a')]({},_0x3f9188,_0x40fa57[_0xee2f('0x3b')]);return db[_0xee2f('0x27')][_0xee2f('0x43')](_0x3f9188)[_0xee2f('0x1d')](function(_0xa0dfdd){if(_0xa0dfdd){_0x236b63=_0xa0dfdd;return _0xa0dfdd[_0xee2f('0x85')]();}return null;})[_0xee2f('0x1d')](function(_0x298dfa){if(_0x298dfa){if(!_0x298dfa[_0xee2f('0x32')]){throw new db[(_0xee2f('0x64'))][(_0xee2f('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ad336=_0x298dfa;return db[_0xee2f('0x67')]['findAll']({'raw':!![]});}return null;})[_0xee2f('0x1d')](function(_0x35a1c9){if(_0x35a1c9){_0x3370de=_['keyBy'](_0x35a1c9,'id');var _0x464e9e;var _0x738f35=squel[_0xee2f('0x69')]();_0x738f35[_0xee2f('0x6a')](_0x236b63[_0xee2f('0x77')]);for(var _0xe24a8a=0x0;_0xe24a8a<_0x4ad336['length'];_0xe24a8a+=0x1){_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]?_0x3370de[_0x4ad336[_0xe24a8a][_0xee2f('0x6b')]][_0xee2f('0x6c')]:_0x4ad336[_0xe24a8a][_0xee2f('0x61')];_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]?_[_0xee2f('0x6e')](_0xb93091[_0x4ad336[_0xe24a8a][_0xee2f('0x6d')]],'%s',_0x464e9e):_0x464e9e;_0x464e9e=_0x4ad336[_0xe24a8a][_0xee2f('0x86')]?_[_0xee2f('0x6e')](_0x39922f[_0x4ad336[_0xe24a8a][_0xee2f('0x86')]],'%s',_0x464e9e):_0x464e9e;if(_0x4ad336[_0xe24a8a]['groupBy']){_0x738f35[_0xee2f('0x60')](_0x464e9e);}_0x4ad336[_0xe24a8a][_0xee2f('0x70')]&&_0x738f35[_0xee2f('0x35')](_0x464e9e,_0x4ad336[_0xe24a8a]['orderBy']==='DESC'?![]:!![]);_0x738f35[_0xee2f('0x61')](_0x464e9e,_0x4ad336[_0xe24a8a][_0xee2f('0x71')]||_0x464e9e);}if(_0x236b63[_0xee2f('0x72')]){_0x236b63[_0xee2f('0x72')]=JSON[_0xee2f('0x73')](_0x236b63['joins']);for(var _0x1cee16=0x0;_0x1cee16<_0x236b63[_0xee2f('0x72')]['length'];_0x1cee16+=0x1){if(_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]&&_[_0xee2f('0x5b')](_0x162014,_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')])&&_0x236b63[_0xee2f('0x72')][_0x1cee16]['parentKey']&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')]&&_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]){_0x738f35[_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x74')]](_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],null,util[_0xee2f('0x86')](_0xee2f('0x76'),_0x236b63[_0xee2f('0x77')],_0x236b63['joins'][_0x1cee16][_0xee2f('0x78')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x75')],_0x236b63[_0xee2f('0x72')][_0x1cee16][_0xee2f('0x87')]));}}}if(_0x236b63[_0xee2f('0x79')]){_0x236b63['conditions']=JSON[_0xee2f('0x73')](_0x236b63[_0xee2f('0x79')]);_0x738f35[_0xee2f('0x37')](_0x44b06b(_0x236b63[_0xee2f('0x79')]['group']));}_0xc9228=_0x738f35[_0xee2f('0x7a')]();_0x738f35[_0xee2f('0x15')](_0x1163f1);_0x738f35[_0xee2f('0x14')](0x0);logger[_0xee2f('0x7b')](_0xee2f('0x7c'),_0x738f35[_0xee2f('0x7d')]());return dbH[_0xee2f('0x7e')][_0xee2f('0x2c')](_0x738f35['toString'](),{'type':dbH['sequelize'][_0xee2f('0x7f')][_0xee2f('0x80')]});}})[_0xee2f('0x1d')](function(){return{'sql':_0xc9228['toString']()};})[_0xee2f('0x1d')](respondWithResult(_0x1fafcc,null))['catch'](handleError(_0x1fafcc,null));};
\ No newline at end of file
+var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x3088cb,_0x3de8ad){var _0x1fb9f3=function(_0x44e19a){while(--_0x44e19a){_0x3088cb['push'](_0x3088cb['shift']());}};_0x1fb9f3(++_0x3de8ad);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5b4f01,_0x2d4c06){_0x5b4f01=_0x5b4f01-0x0;var _0xf8df07=_0x1cb9[_0x5b4f01];return _0xf8df07;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
index 5e6c9ad..5230690 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61a3=['define','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1a5d29,_0x46f6cb){var _0x2b8467=function(_0x3ecee3){while(--_0x3ecee3){_0x1a5d29['push'](_0x1a5d29['shift']());}};_0x2b8467(++_0x46f6cb);}(_0x61a3,0x171));var _0x361a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61a3[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x361a('0x0'));var logger=require('../../config/logger')(_0x361a('0x1'));var moment=require(_0x361a('0x2'));var BPromise=require(_0x361a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x361a('0x4'));var rimraf=require(_0x361a('0x5'));var config=require(_0x361a('0x6'));var attributes=require('./analyticDefaultReport.attributes');module['exports']=function(_0x22b087,_0x7411c1){return _0x22b087[_0x361a('0x7')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3272=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes'];(function(_0x4f6c8d,_0x5dab1f){var _0x322d13=function(_0x1805b9){while(--_0x1805b9){_0x4f6c8d['push'](_0x4f6c8d['shift']());}};_0x322d13(++_0x5dab1f);}(_0x3272,0x70));var _0x2327=function(_0x3671e7,_0x212b07){_0x3671e7=_0x3671e7-0x0;var _0x10bfc0=_0x3272[_0x3671e7];return _0x10bfc0;};'use strict';var _=require(_0x2327('0x0'));var util=require('util');var logger=require(_0x2327('0x1'))(_0x2327('0x2'));var moment=require('moment');var BPromise=require(_0x2327('0x3'));var rp=require(_0x2327('0x4'));var fs=require('fs');var path=require(_0x2327('0x5'));var rimraf=require(_0x2327('0x6'));var config=require('../../config/environment');var attributes=require(_0x2327('0x7'));module[_0x2327('0x8')]=function(_0x4d946e,_0x470137){return _0x4d946e[_0x2327('0x9')](_0x2327('0xa'),attributes,{'tableName':_0x2327('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4c94a0..14372c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31d8=['../../config/logger','rpc','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2cb633,_0x5caee0){var _0x4b1a20=function(_0x4ea50f){while(--_0x4ea50f){_0x2cb633['push'](_0x2cb633['shift']());}};_0x4b1a20(++_0x5caee0);}(_0x31d8,0x1c7));var _0x831d=function(_0x3eda3d,_0x232089){_0x3eda3d=_0x3eda3d-0x0;var _0x2efe88=_0x31d8[_0x3eda3d];return _0x2efe88;};'use strict';var _=require('lodash');var util=require(_0x831d('0x0'));var moment=require(_0x831d('0x1'));var BPromise=require(_0x831d('0x2'));var rs=require(_0x831d('0x3'));var fs=require('fs');var Redis=require(_0x831d('0x4'));var db=require(_0x831d('0x5'))['db'];var utils=require(_0x831d('0x6'));var logger=require(_0x831d('0x7'))(_0x831d('0x8'));var config=require('../../config/environment');var jayson=require(_0x831d('0x9'));var client=jayson[_0x831d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x254715,_0x361c11,_0xac8ca9){return new BPromise(function(_0x317125,_0x1a716f){return client[_0x831d('0xb')](_0x254715,_0xac8ca9)[_0x831d('0xc')](function(_0x4b4d6c){logger[_0x831d('0xd')](_0x831d('0xe'),_0x361c11,_0x831d('0xf'));logger[_0x831d('0x10')](_0x831d('0x11'),_0x361c11,_0x831d('0xf'),JSON[_0x831d('0x12')](_0x4b4d6c));if(_0x4b4d6c['error']){if(_0x4b4d6c[_0x831d('0x13')]['code']===0x1f4){logger[_0x831d('0x13')](_0x831d('0xe'),_0x361c11,_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);return _0x1a716f(_0x4b4d6c['error'][_0x831d('0x14')]);}logger['error'](_0x831d('0xe'),_0x361c11,_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);return _0x317125(_0x4b4d6c[_0x831d('0x13')][_0x831d('0x14')]);}else{logger[_0x831d('0xd')](_0x831d('0xe'),_0x361c11,'request\x20sent');_0x317125(_0x4b4d6c['result'][_0x831d('0x14')]);}})['catch'](function(_0x3eeb0d){logger[_0x831d('0x13')](_0x831d('0xe'),_0x361c11,_0x3eeb0d);_0x1a716f(_0x3eeb0d);});});}
\ No newline at end of file
+var _0xb55b=['info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xb55b,0x1d7));var _0xbb55=function(_0xa8b074,_0xeabb35){_0xa8b074=_0xa8b074-0x0;var _0x41f89e=_0xb55b[_0xa8b074];return _0x41f89e;};'use strict';var _=require(_0xbb55('0x0'));var util=require(_0xbb55('0x1'));var moment=require(_0xbb55('0x2'));var BPromise=require(_0xbb55('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb55('0x4'))['db'];var utils=require(_0xbb55('0x5'));var logger=require(_0xbb55('0x6'))(_0xbb55('0x7'));var config=require(_0xbb55('0x8'));var jayson=require(_0xbb55('0x9'));var client=jayson[_0xbb55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x233c90,_0x341aa6,_0x19dc98){return new BPromise(function(_0x4395a5,_0x253361){return client['request'](_0x233c90,_0x19dc98)[_0xbb55('0xb')](function(_0x41919e){logger[_0xbb55('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0xbb55('0xd'));logger[_0xbb55('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x341aa6,_0xbb55('0xd'),JSON[_0xbb55('0xf')](_0x41919e));if(_0x41919e[_0xbb55('0x10')]){if(_0x41919e[_0xbb55('0x10')][_0xbb55('0x11')]===0x1f4){logger[_0xbb55('0x10')](_0xbb55('0x12'),_0x341aa6,_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);return _0x253361(_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0x41919e['error'][_0xbb55('0x13')]);return _0x4395a5(_0x41919e[_0xbb55('0x10')][_0xbb55('0x13')]);}else{logger[_0xbb55('0xc')](_0xbb55('0x12'),_0x341aa6,_0xbb55('0xd'));_0x4395a5(_0x41919e['result']['message']);}})[_0xbb55('0x14')](function(_0x252856){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x341aa6,_0x252856);_0x253361(_0x252856);});});}
\ No newline at end of file
index 5e15ccb..14c75d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe55d=['Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','isAuthenticated','index','get','show','/:id/run','run','/:id/query','query','post','create','update','delete','/:id','destroy','exports','multer','connect-timeout','express'];(function(_0x3ba60c,_0x27b3a3){var _0x5de53d=function(_0x4b3396){while(--_0x4b3396){_0x3ba60c['push'](_0x3ba60c['shift']());}};_0x5de53d(++_0x27b3a3);}(_0xe55d,0x15d));var _0xde55=function(_0x4af6b8,_0x59f8a1){_0x4af6b8=_0x4af6b8-0x0;var _0x1b3b4b=_0xe55d[_0x4af6b8];return _0x1b3b4b;};'use strict';var multer=require(_0xde55('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xde55('0x1'));var express=require(_0xde55('0x2'));var router=express[_0xde55('0x3')]();var fs_extra=require(_0xde55('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xde55('0x5'));var config=require('../../config/environment');var controller=require(_0xde55('0x6'));router['get']('/',auth[_0xde55('0x7')](),controller[_0xde55('0x8')]);router[_0xde55('0x9')]('/:id',auth[_0xde55('0x7')](),controller[_0xde55('0xa')]);router[_0xde55('0x9')]('/:id/preview',auth[_0xde55('0x7')](),controller['preview']);router['get'](_0xde55('0xb'),auth[_0xde55('0x7')](),controller[_0xde55('0xc')]);router[_0xde55('0x9')](_0xde55('0xd'),auth[_0xde55('0x7')](),controller[_0xde55('0xe')]);router[_0xde55('0xf')]('/',auth[_0xde55('0x7')](),controller[_0xde55('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xde55('0x11')]);router[_0xde55('0x12')](_0xde55('0x13'),auth[_0xde55('0x7')](),controller[_0xde55('0x14')]);module[_0xde55('0x15')]=router;
\ No newline at end of file
+var _0xdf7c=['/:id','isAuthenticated','/:id/preview','run','/:id/query','query','post','create','update','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','index'];(function(_0x484c5c,_0x5d67b2){var _0x1b8928=function(_0xdfcff4){while(--_0xdfcff4){_0x484c5c['push'](_0x484c5c['shift']());}};_0x1b8928(++_0x5d67b2);}(_0xdf7c,0x149));var _0xcdf7=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xdf7c[_0x310a1b];return _0xdea206;};'use strict';var multer=require('multer');var util=require(_0xcdf7('0x0'));var path=require(_0xcdf7('0x1'));var timeout=require(_0xcdf7('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcdf7('0x3'));var interaction=require(_0xcdf7('0x4'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xcdf7('0x5')]('/',auth['isAuthenticated'](),controller[_0xcdf7('0x6')]);router['get'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['show']);router[_0xcdf7('0x5')](_0xcdf7('0x9'),auth[_0xcdf7('0x8')](),controller['preview']);router[_0xcdf7('0x5')]('/:id/run',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xa')]);router[_0xcdf7('0x5')](_0xcdf7('0xb'),auth['isAuthenticated'](),controller[_0xcdf7('0xc')]);router[_0xcdf7('0xd')]('/',auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xe')]);router['put'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller[_0xcdf7('0xf')]);router['delete'](_0xcdf7('0x7'),auth[_0xcdf7('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f55dbef..e0051d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63da=['ENUM','csv','xlsx','DATE','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING'];(function(_0x4f72aa,_0x101b06){var _0x328dfe=function(_0x4bb1b5){while(--_0x4bb1b5){_0x4f72aa['push'](_0x4f72aa['shift']());}};_0x328dfe(++_0x101b06);}(_0x63da,0x1d6));var _0xa63d=function(_0x10d128,_0x1d80f6){_0x10d128=_0x10d128-0x0;var _0x52dc8a=_0x63da[_0x10d128];return _0x52dc8a;};'use strict';var Sequelize=require(_0xa63d('0x0'));var moment=require('moment');module[_0xa63d('0x1')]={'name':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xa63d('0x3')](_0xa63d('0x4'),'pdf',_0xa63d('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xa63d('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa63d('0x6')]},'endDate':{'type':Sequelize[_0xa63d('0x6')]},'status':{'type':Sequelize[_0xa63d('0x2')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xa63d('0x3')](_0xa63d('0x7'),_0xa63d('0x8')),'allowNull':![],'defaultValue':_0xa63d('0x7')},'reportId':{'type':Sequelize[_0xa63d('0x9')](0xb)[_0xa63d('0xa')]},'reportType':{'type':Sequelize[_0xa63d('0x2')]}};
\ No newline at end of file
+var _0x5162=['pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5162,0x7d));var _0x2516=function(_0x2d6df9,_0x45da50){_0x2d6df9=_0x2d6df9-0x0;var _0x429b18=_0x5162[_0x2d6df9];return _0x429b18;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2516('0x0'));module[_0x2516('0x1')]={'name':{'type':Sequelize[_0x2516('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2516('0x3')](_0x2516('0x4'),_0x2516('0x5'),_0x2516('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2516('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2516('0x7')]},'endDate':{'type':Sequelize[_0x2516('0x7')]},'status':{'type':Sequelize[_0x2516('0x2')],'defaultValue':_0x2516('0x8')},'type':{'type':Sequelize[_0x2516('0x3')](_0x2516('0x9'),_0x2516('0xa')),'allowNull':![],'defaultValue':_0x2516('0x9')},'reportId':{'type':Sequelize[_0x2516('0xb')](0xb)[_0x2516('0xc')]},'reportType':{'type':Sequelize[_0x2516('0x2')]}};
\ No newline at end of file
index 7ac71b2..8297d33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x868c=['userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','basename','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','undefined','count','limit','set','Content-Range','apply','save','then','UserProfileResource','error','name','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','UserProfileSection'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x868c,0x6a));var _0xc868=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x868c[_0x2c7b86];return _0x256735;};'use strict';var emlformat=require(_0xc868('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc868('0x1'));var jsonpatch=require(_0xc868('0x2'));var rp=require(_0xc868('0x3'));var moment=require(_0xc868('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc868('0x5'));var util=require('util');var path=require(_0xc868('0x6'));var sox=require('sox');var csv=require(_0xc868('0x7'));var ejs=require(_0xc868('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc868('0x9'));var squel=require(_0xc868('0xa'));var crypto=require(_0xc868('0xb'));var jsforce=require(_0xc868('0xc'));var deskjs=require(_0xc868('0xd'));var toCsv=require(_0xc868('0x7'));var querystring=require(_0xc868('0xe'));var Papa=require('papaparse');var Redis=require(_0xc868('0xf'));var authService=require(_0xc868('0x10'));var qs=require(_0xc868('0x11'));var as=require(_0xc868('0x12'));var hardwareService=require(_0xc868('0x13'));var logger=require(_0xc868('0x14'))(_0xc868('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc868('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d8701,_0x390945){_0x390945=_0x390945||0xcc;return function(_0x2a10a3){if(_0x2a10a3){return _0x5d8701[_0xc868('0x17')](_0x390945);}return _0x5d8701['status'](_0x390945)[_0xc868('0x18')]();};}function respondWithResult(_0x28249e,_0x43d366){_0x43d366=_0x43d366||0xc8;return function(_0x427f2a){if(_0x427f2a){return _0x28249e[_0xc868('0x19')](_0x43d366)[_0xc868('0x1a')](_0x427f2a);}};}function respondWithFilteredResult(_0x5cacf3,_0xb18435){return function(_0x5d3241){if(_0x5d3241){var _0x2d6704=typeof _0xb18435['offset']===_0xc868('0x1b')&&typeof _0xb18435['limit']===_0xc868('0x1b');var _0x13c72a=_0x5d3241[_0xc868('0x1c')];var _0x2d3930=_0x2d6704?0x0:_0xb18435['offset'];var _0x3f823d=_0x2d6704?_0x5d3241[_0xc868('0x1c')]:_0xb18435['offset']+_0xb18435[_0xc868('0x1d')];var _0x4d279f;if(_0x3f823d>=_0x13c72a){_0x3f823d=_0x13c72a;_0x4d279f=0xc8;}else{_0x4d279f=0xce;}_0x5cacf3['status'](_0x4d279f);return _0x5cacf3[_0xc868('0x1e')](_0xc868('0x1f'),_0x2d3930+'-'+_0x3f823d+'/'+_0x13c72a)[_0xc868('0x1a')](_0x5d3241);}return null;};}function patchUpdates(_0x1a40b3){return function(_0x35021){try{jsonpatch[_0xc868('0x20')](_0x35021,_0x1a40b3,!![]);}catch(_0x1219a0){return BPromise['reject'](_0x1219a0);}return _0x35021[_0xc868('0x21')]();};}function saveUpdates(_0x5b6ad8,_0x2f356c){return function(_0x2764dc){if(_0x2764dc){return _0x2764dc['update'](_0x5b6ad8)[_0xc868('0x22')](function(_0x3756f7){return _0x3756f7;});}return null;};}function removeEntity(_0x5cad42,_0x248be9){return function(_0x4ac71f){if(_0x4ac71f){return _0x4ac71f['destroy']()[_0xc868('0x22')](function(){var _0x42f85d=_0x4ac71f['get']({'plain':!![]});var _0xa5acf='ExtractedReports';return db[_0xc868('0x23')]['destroy']({'where':{'type':_0xa5acf,'resourceId':_0x42f85d['id']}})[_0xc868('0x22')](function(){return _0x4ac71f;});})[_0xc868('0x22')](function(){_0x5cad42['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fbedb,_0x4c0fb7){return function(_0x54bcda){if(!_0x54bcda){_0x2fbedb['sendStatus'](0x194);}return _0x54bcda;};}function handleError(_0x453d84,_0x4d94ab){_0x4d94ab=_0x4d94ab||0x1f4;return function(_0x555507){logger[_0xc868('0x24')](_0x555507['stack']);if(_0x555507[_0xc868('0x25')]){delete _0x555507[_0xc868('0x25')];}_0x453d84[_0xc868('0x19')](_0x4d94ab)['send'](_0x555507);};}exports[_0xc868('0x26')]=function(_0x212539,_0x1014d5){var _0x5b3ee3={},_0x389522={},_0xb5a86f={'count':0x0,'rows':[]};var _0x24cde4=_[_0xc868('0x27')](db[_0xc868('0x28')][_0xc868('0x29')],function(_0x2eeb1a){return{'name':_0x2eeb1a[_0xc868('0x2a')],'type':_0x2eeb1a['type'][_0xc868('0x2b')]};});_0x389522['model']=_['map'](_0x24cde4,_0xc868('0x25'));_0x389522[_0xc868('0x2c')]=_['keys'](_0x212539[_0xc868('0x2c')]);_0x389522[_0xc868('0x2d')]=_[_0xc868('0x2e')](_0x389522[_0xc868('0x2f')],_0x389522[_0xc868('0x2c')]);_0x5b3ee3[_0xc868('0x30')]=_['intersection'](_0x389522[_0xc868('0x2f')],qs['fields'](_0x212539[_0xc868('0x2c')][_0xc868('0x31')]));_0x5b3ee3[_0xc868('0x30')]=_0x5b3ee3[_0xc868('0x30')][_0xc868('0x32')]?_0x5b3ee3[_0xc868('0x30')]:_0x389522[_0xc868('0x2f')];if(!_0x212539[_0xc868('0x2c')]['hasOwnProperty'](_0xc868('0x33'))){_0x5b3ee3[_0xc868('0x1d')]=qs[_0xc868('0x1d')](_0x212539['query'][_0xc868('0x1d')]);_0x5b3ee3[_0xc868('0x34')]=qs[_0xc868('0x34')](_0x212539[_0xc868('0x2c')]['offset']);}_0x5b3ee3[_0xc868('0x35')]=qs[_0xc868('0x36')](_0x212539[_0xc868('0x2c')][_0xc868('0x36')]);_0x5b3ee3[_0xc868('0x37')]=qs['filters'](_[_0xc868('0x38')](_0x212539[_0xc868('0x2c')],_0x389522[_0xc868('0x2d')]),_0x24cde4);if(_0x212539['query']['filter']){_0x5b3ee3[_0xc868('0x37')]=_[_0xc868('0x39')](_0x5b3ee3['where'],{'$or':_[_0xc868('0x27')](_0x24cde4,function(_0x4064fa){if(_0x4064fa['type']!=='VIRTUAL'){var _0x50625e={};_0x50625e[_0x4064fa[_0xc868('0x25')]]={'$like':'%'+_0x212539[_0xc868('0x2c')][_0xc868('0x3a')]+'%'};return _0x50625e;}})});}_0x5b3ee3=_['merge']({},_0x5b3ee3,_0x212539[_0xc868('0x3b')]);var _0x5e2edc={'where':_0x5b3ee3['where']};return db['AnalyticExtractedReport']['count'](_0x5e2edc)[_0xc868('0x22')](function(_0x43612b){_0xb5a86f[_0xc868('0x1c')]=_0x43612b;if(_0x212539['query']['includeAll']){_0x5b3ee3[_0xc868('0x3c')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xc868('0x3d')](_0x5b3ee3);})[_0xc868('0x22')](function(_0x5e515a){_0xb5a86f[_0xc868('0x3e')]=_0x5e515a;return _0xb5a86f;})[_0xc868('0x22')](respondWithFilteredResult(_0x1014d5,_0x5b3ee3))[_0xc868('0x3f')](handleError(_0x1014d5,null));};exports['show']=function(_0x85ce5c,_0x575ce4){var _0x30f4b5={'raw':!![],'where':{'id':_0x85ce5c[_0xc868('0x40')]['id']}},_0x94c26d={};_0x94c26d[_0xc868('0x2f')]=_[_0xc868('0x41')](db[_0xc868('0x28')][_0xc868('0x29')]);_0x94c26d[_0xc868('0x2c')]=_[_0xc868('0x41')](_0x85ce5c[_0xc868('0x2c')]);_0x94c26d['filters']=_[_0xc868('0x2e')](_0x94c26d[_0xc868('0x2f')],_0x94c26d[_0xc868('0x2c')]);_0x30f4b5['attributes']=_[_0xc868('0x2e')](_0x94c26d['model'],qs[_0xc868('0x31')](_0x85ce5c[_0xc868('0x2c')][_0xc868('0x31')]));_0x30f4b5['attributes']=_0x30f4b5[_0xc868('0x30')][_0xc868('0x32')]?_0x30f4b5['attributes']:_0x94c26d[_0xc868('0x2f')];if(_0x85ce5c[_0xc868('0x2c')][_0xc868('0x42')]){_0x30f4b5[_0xc868('0x3c')]=[{'all':!![]}];}_0x30f4b5=_[_0xc868('0x39')]({},_0x30f4b5,_0x85ce5c[_0xc868('0x3b')]);return db[_0xc868('0x28')][_0xc868('0x43')](_0x30f4b5)[_0xc868('0x22')](handleEntityNotFound(_0x575ce4,null))[_0xc868('0x22')](respondWithResult(_0x575ce4,null))[_0xc868('0x3f')](handleError(_0x575ce4,null));};exports[_0xc868('0x44')]=function(_0xcf461b,_0x358d09){return db[_0xc868('0x28')]['create'](_0xcf461b[_0xc868('0x45')],{})[_0xc868('0x22')](function(_0x6f74ae){var _0x2bcd86=_0xcf461b[_0xc868('0x46')]['get']({'plain':!![]});if(!_0x2bcd86)throw new Error(_0xc868('0x47'));if(_0x2bcd86['role']===_0xc868('0x46')){var _0x4f8291=_0x6f74ae['get']({'plain':!![]});var _0x194185=_0xc868('0x48');return db[_0xc868('0x49')][_0xc868('0x43')]({'where':{'name':_0x194185,'userProfileId':_0x2bcd86[_0xc868('0x4a')]},'raw':!![]})[_0xc868('0x22')](function(_0x3d7d7d){if(_0x3d7d7d&&_0x3d7d7d['autoAssociation']===0x0){return db['UserProfileResource'][_0xc868('0x44')]({'name':_0x4f8291['name'],'resourceId':_0x4f8291['id'],'type':_0x3d7d7d[_0xc868('0x25')],'sectionId':_0x3d7d7d['id']},{})[_0xc868('0x22')](function(){return _0x6f74ae;});}else{return _0x6f74ae;}})[_0xc868('0x3f')](function(_0x30ecc9){logger['error'](_0xc868('0x4b'),_0x30ecc9);throw _0x30ecc9;});}return _0x6f74ae;})['then'](respondWithResult(_0x358d09,0xc9))[_0xc868('0x3f')](handleError(_0x358d09,null));};exports[_0xc868('0x4c')]=function(_0x49563e,_0x2fe358){if(_0x49563e[_0xc868('0x45')]['id']){delete _0x49563e[_0xc868('0x45')]['id'];}return db['AnalyticExtractedReport'][_0xc868('0x43')]({'where':{'id':_0x49563e[_0xc868('0x40')]['id']}})['then'](handleEntityNotFound(_0x2fe358,null))[_0xc868('0x22')](saveUpdates(_0x49563e[_0xc868('0x45')],null))['then'](respondWithResult(_0x2fe358,null))[_0xc868('0x3f')](handleError(_0x2fe358,null));};exports['destroy']=function(_0x3d4acd,_0x365642){return db[_0xc868('0x28')][_0xc868('0x43')]({'where':{'id':_0x3d4acd[_0xc868('0x40')]['id']}})[_0xc868('0x22')](handleEntityNotFound(_0x365642,null))[_0xc868('0x22')](removeEntity(_0x365642,null))[_0xc868('0x3f')](handleError(_0x365642,null));};exports['download']=function(_0x4aaf7e,_0x2a1155,_0x2505ab){return db[_0xc868('0x28')][_0xc868('0x43')]({'where':{'id':_0x4aaf7e[_0xc868('0x40')]['id']},'attributes':['name','basename',_0xc868('0x4d'),_0xc868('0x4e')],'raw':!![]})[_0xc868('0x22')](handleEntityNotFound(_0x2a1155,null))[_0xc868('0x22')](function(_0x357364){if(_0x357364){if(!fs[_0xc868('0x4f')](path[_0xc868('0x50')](config[_0xc868('0x51')],_0xc868('0x52'),_0x357364[_0xc868('0x4d')]))){throw new db[(_0xc868('0x53'))][(_0xc868('0x54'))](_0xc868('0x55'));}if(_0x4aaf7e['query'][_0xc868('0x56')]){return _0x2a1155['sendStatus'](0xc8);}return _0x2a1155['download'](path[_0xc868('0x50')](config[_0xc868('0x51')],_0xc868('0x52'),_0x357364[_0xc868('0x4d')]),util['format'](_0xc868('0x57'),_0x357364[_0xc868('0x58')]||_0x357364['name'],_0x357364[_0xc868('0x4e')][_0xc868('0x59')]()));}})[_0xc868('0x3f')](handleError(_0x2a1155,null));};
\ No newline at end of file
+var _0xc56a=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','then','error','stack','name','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','%s.%s','basename','toLowerCase','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status'];(function(_0x3e14bf,_0x19c6ee){var _0x2efa39=function(_0x5f4231){while(--_0x5f4231){_0x3e14bf['push'](_0x3e14bf['shift']());}};_0x2efa39(++_0x19c6ee);}(_0xc56a,0xff));var _0xac56=function(_0x499e75,_0x2f89e3){_0x499e75=_0x499e75-0x0;var _0x24834d=_0xc56a[_0x499e75];return _0x24834d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac56('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xac56('0x1'));var moment=require(_0xac56('0x2'));var BPromise=require(_0xac56('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac56('0x4'));var sox=require(_0xac56('0x5'));var csv=require(_0xac56('0x6'));var ejs=require(_0xac56('0x7'));var fs=require('fs');var fs_extra=require(_0xac56('0x8'));var _=require(_0xac56('0x9'));var squel=require(_0xac56('0xa'));var crypto=require(_0xac56('0xb'));var jsforce=require(_0xac56('0xc'));var deskjs=require(_0xac56('0xd'));var toCsv=require(_0xac56('0x6'));var querystring=require(_0xac56('0xe'));var Papa=require(_0xac56('0xf'));var Redis=require(_0xac56('0x10'));var authService=require(_0xac56('0x11'));var qs=require(_0xac56('0x12'));var as=require(_0xac56('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac56('0x14'))(_0xac56('0x15'));var utils=require('../../config/utils');var config=require(_0xac56('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xac56('0x17'))['db'];function respondWithStatusCode(_0x5b7e93,_0xc9058){_0xc9058=_0xc9058||0xcc;return function(_0xf18ef0){if(_0xf18ef0){return _0x5b7e93[_0xac56('0x18')](_0xc9058);}return _0x5b7e93['status'](_0xc9058)[_0xac56('0x19')]();};}function respondWithResult(_0x5ee8aa,_0x1145d8){_0x1145d8=_0x1145d8||0xc8;return function(_0x431800){if(_0x431800){return _0x5ee8aa[_0xac56('0x1a')](_0x1145d8)[_0xac56('0x1b')](_0x431800);}};}function respondWithFilteredResult(_0x277263,_0x447274){return function(_0x2b2395){if(_0x2b2395){var _0x68a377=typeof _0x447274['offset']===_0xac56('0x1c')&&typeof _0x447274[_0xac56('0x1d')]===_0xac56('0x1c');var _0x506c87=_0x2b2395[_0xac56('0x1e')];var _0x470bae=_0x68a377?0x0:_0x447274[_0xac56('0x1f')];var _0x1b1e6a=_0x68a377?_0x2b2395[_0xac56('0x1e')]:_0x447274[_0xac56('0x1f')]+_0x447274[_0xac56('0x1d')];var _0xd72f01;if(_0x1b1e6a>=_0x506c87){_0x1b1e6a=_0x506c87;_0xd72f01=0xc8;}else{_0xd72f01=0xce;}_0x277263[_0xac56('0x1a')](_0xd72f01);return _0x277263[_0xac56('0x20')](_0xac56('0x21'),_0x470bae+'-'+_0x1b1e6a+'/'+_0x506c87)[_0xac56('0x1b')](_0x2b2395);}return null;};}function patchUpdates(_0x525b93){return function(_0x17bc60){try{jsonpatch[_0xac56('0x22')](_0x17bc60,_0x525b93,!![]);}catch(_0x15f278){return BPromise[_0xac56('0x23')](_0x15f278);}return _0x17bc60[_0xac56('0x24')]();};}function saveUpdates(_0x52af78,_0x3f725b){return function(_0x507445){if(_0x507445){return _0x507445[_0xac56('0x25')](_0x52af78)['then'](function(_0x30cc2e){return _0x30cc2e;});}return null;};}function removeEntity(_0x4b7ee2,_0x3b51f0){return function(_0x25dfca){if(_0x25dfca){return _0x25dfca[_0xac56('0x26')]()['then'](function(){var _0x4b1514=_0x25dfca[_0xac56('0x27')]({'plain':!![]});var _0x348d89='ExtractedReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x348d89,'resourceId':_0x4b1514['id']}})[_0xac56('0x28')](function(){return _0x25dfca;});})[_0xac56('0x28')](function(){_0x4b7ee2[_0xac56('0x1a')](0xcc)[_0xac56('0x19')]();});}};}function handleEntityNotFound(_0x177879,_0x351c07){return function(_0xdd34a1){if(!_0xdd34a1){_0x177879['sendStatus'](0x194);}return _0xdd34a1;};}function handleError(_0x93e866,_0x2bfb8f){_0x2bfb8f=_0x2bfb8f||0x1f4;return function(_0x3d77d0){logger[_0xac56('0x29')](_0x3d77d0[_0xac56('0x2a')]);if(_0x3d77d0[_0xac56('0x2b')]){delete _0x3d77d0[_0xac56('0x2b')];}_0x93e866['status'](_0x2bfb8f)['send'](_0x3d77d0);};}exports['index']=function(_0x4b4781,_0x45494f){var _0x5e4ad2={},_0x5c5ab3={},_0x294bd2={'count':0x0,'rows':[]};var _0x44c0d6=_[_0xac56('0x2c')](db[_0xac56('0x2d')][_0xac56('0x2e')],function(_0x4b37c4){return{'name':_0x4b37c4[_0xac56('0x2f')],'type':_0x4b37c4['type'][_0xac56('0x30')]};});_0x5c5ab3['model']=_['map'](_0x44c0d6,'name');_0x5c5ab3[_0xac56('0x31')]=_[_0xac56('0x32')](_0x4b4781['query']);_0x5c5ab3[_0xac56('0x33')]=_[_0xac56('0x34')](_0x5c5ab3['model'],_0x5c5ab3[_0xac56('0x31')]);_0x5e4ad2[_0xac56('0x35')]=_[_0xac56('0x34')](_0x5c5ab3[_0xac56('0x36')],qs[_0xac56('0x37')](_0x4b4781[_0xac56('0x31')][_0xac56('0x37')]));_0x5e4ad2['attributes']=_0x5e4ad2['attributes'][_0xac56('0x38')]?_0x5e4ad2['attributes']:_0x5c5ab3[_0xac56('0x36')];if(!_0x4b4781[_0xac56('0x31')]['hasOwnProperty'](_0xac56('0x39'))){_0x5e4ad2[_0xac56('0x1d')]=qs[_0xac56('0x1d')](_0x4b4781['query'][_0xac56('0x1d')]);_0x5e4ad2[_0xac56('0x1f')]=qs[_0xac56('0x1f')](_0x4b4781['query'][_0xac56('0x1f')]);}_0x5e4ad2[_0xac56('0x3a')]=qs['sort'](_0x4b4781[_0xac56('0x31')][_0xac56('0x3b')]);_0x5e4ad2[_0xac56('0x3c')]=qs[_0xac56('0x33')](_[_0xac56('0x3d')](_0x4b4781[_0xac56('0x31')],_0x5c5ab3[_0xac56('0x33')]),_0x44c0d6);if(_0x4b4781[_0xac56('0x31')][_0xac56('0x3e')]){_0x5e4ad2[_0xac56('0x3c')]=_[_0xac56('0x3f')](_0x5e4ad2[_0xac56('0x3c')],{'$or':_[_0xac56('0x2c')](_0x44c0d6,function(_0x51e132){if(_0x51e132['type']!=='VIRTUAL'){var _0x13d50e={};_0x13d50e[_0x51e132[_0xac56('0x2b')]]={'$like':'%'+_0x4b4781[_0xac56('0x31')]['filter']+'%'};return _0x13d50e;}})});}_0x5e4ad2=_[_0xac56('0x3f')]({},_0x5e4ad2,_0x4b4781[_0xac56('0x40')]);var _0xd8a37f={'where':_0x5e4ad2['where']};return db[_0xac56('0x2d')][_0xac56('0x1e')](_0xd8a37f)[_0xac56('0x28')](function(_0x17d803){_0x294bd2[_0xac56('0x1e')]=_0x17d803;if(_0x4b4781['query'][_0xac56('0x41')]){_0x5e4ad2[_0xac56('0x42')]=[{'all':!![]}];}return db[_0xac56('0x2d')]['findAll'](_0x5e4ad2);})[_0xac56('0x28')](function(_0x2a4c9a){_0x294bd2['rows']=_0x2a4c9a;return _0x294bd2;})[_0xac56('0x28')](respondWithFilteredResult(_0x45494f,_0x5e4ad2))[_0xac56('0x43')](handleError(_0x45494f,null));};exports['show']=function(_0x44f31b,_0x401567){var _0x1399b1={'raw':!![],'where':{'id':_0x44f31b[_0xac56('0x44')]['id']}},_0xdc62cd={};_0xdc62cd[_0xac56('0x36')]=_[_0xac56('0x32')](db[_0xac56('0x2d')]['rawAttributes']);_0xdc62cd[_0xac56('0x31')]=_[_0xac56('0x32')](_0x44f31b[_0xac56('0x31')]);_0xdc62cd['filters']=_['intersection'](_0xdc62cd['model'],_0xdc62cd[_0xac56('0x31')]);_0x1399b1[_0xac56('0x35')]=_[_0xac56('0x34')](_0xdc62cd[_0xac56('0x36')],qs[_0xac56('0x37')](_0x44f31b[_0xac56('0x31')][_0xac56('0x37')]));_0x1399b1[_0xac56('0x35')]=_0x1399b1['attributes']['length']?_0x1399b1[_0xac56('0x35')]:_0xdc62cd[_0xac56('0x36')];if(_0x44f31b[_0xac56('0x31')][_0xac56('0x41')]){_0x1399b1[_0xac56('0x42')]=[{'all':!![]}];}_0x1399b1=_[_0xac56('0x3f')]({},_0x1399b1,_0x44f31b['options']);return db[_0xac56('0x2d')][_0xac56('0x45')](_0x1399b1)['then'](handleEntityNotFound(_0x401567,null))[_0xac56('0x28')](respondWithResult(_0x401567,null))[_0xac56('0x43')](handleError(_0x401567,null));};exports[_0xac56('0x46')]=function(_0x40c512,_0x5a132e){return db[_0xac56('0x2d')][_0xac56('0x46')](_0x40c512[_0xac56('0x47')],{})[_0xac56('0x28')](function(_0x2023e7){var _0x3878bf=_0x40c512[_0xac56('0x48')][_0xac56('0x27')]({'plain':!![]});if(!_0x3878bf)throw new Error(_0xac56('0x49'));if(_0x3878bf[_0xac56('0x4a')]===_0xac56('0x48')){var _0x3ebfa5=_0x2023e7[_0xac56('0x27')]({'plain':!![]});var _0x50069a=_0xac56('0x4b');return db[_0xac56('0x4c')][_0xac56('0x45')]({'where':{'name':_0x50069a,'userProfileId':_0x3878bf['userProfileId']},'raw':!![]})['then'](function(_0xa4c4a8){if(_0xa4c4a8&&_0xa4c4a8[_0xac56('0x4d')]===0x0){return db[_0xac56('0x4e')][_0xac56('0x46')]({'name':_0x3ebfa5[_0xac56('0x2b')],'resourceId':_0x3ebfa5['id'],'type':_0xa4c4a8[_0xac56('0x2b')],'sectionId':_0xa4c4a8['id']},{})[_0xac56('0x28')](function(){return _0x2023e7;});}else{return _0x2023e7;}})[_0xac56('0x43')](function(_0x3d68f1){logger['error'](_0xac56('0x4f'),_0x3d68f1);throw _0x3d68f1;});}return _0x2023e7;})[_0xac56('0x28')](respondWithResult(_0x5a132e,0xc9))[_0xac56('0x43')](handleError(_0x5a132e,null));};exports[_0xac56('0x25')]=function(_0x2dfbb4,_0x543eca){if(_0x2dfbb4[_0xac56('0x47')]['id']){delete _0x2dfbb4[_0xac56('0x47')]['id'];}return db['AnalyticExtractedReport'][_0xac56('0x45')]({'where':{'id':_0x2dfbb4[_0xac56('0x44')]['id']}})[_0xac56('0x28')](handleEntityNotFound(_0x543eca,null))[_0xac56('0x28')](saveUpdates(_0x2dfbb4['body'],null))[_0xac56('0x28')](respondWithResult(_0x543eca,null))[_0xac56('0x43')](handleError(_0x543eca,null));};exports[_0xac56('0x26')]=function(_0x85c1bc,_0x3f4915){return db['AnalyticExtractedReport'][_0xac56('0x45')]({'where':{'id':_0x85c1bc['params']['id']}})['then'](handleEntityNotFound(_0x3f4915,null))[_0xac56('0x28')](removeEntity(_0x3f4915,null))[_0xac56('0x43')](handleError(_0x3f4915,null));};exports['download']=function(_0x4767bc,_0x2a19fd,_0x2fb057){return db[_0xac56('0x2d')]['find']({'where':{'id':_0x4767bc['params']['id']},'attributes':[_0xac56('0x2b'),'basename',_0xac56('0x50'),_0xac56('0x51')],'raw':!![]})[_0xac56('0x28')](handleEntityNotFound(_0x2a19fd,null))[_0xac56('0x28')](function(_0x519ca1){if(_0x519ca1){if(!fs[_0xac56('0x52')](path[_0xac56('0x53')](config[_0xac56('0x54')],_0xac56('0x55'),_0x519ca1[_0xac56('0x50')]))){throw new db[(_0xac56('0x56'))][(_0xac56('0x57'))](_0xac56('0x58'));}if(_0x4767bc['query'][_0xac56('0x59')]){return _0x2a19fd[_0xac56('0x18')](0xc8);}return _0x2a19fd[_0xac56('0x5a')](path[_0xac56('0x53')](config[_0xac56('0x54')],'server/files/reports',_0x519ca1[_0xac56('0x50')]),util['format'](_0xac56('0x5b'),_0x519ca1[_0xac56('0x5c')]||_0x519ca1[_0xac56('0x2b')],_0x519ca1[_0xac56('0x51')][_0xac56('0x5d')]()));}})['catch'](handleError(_0x2a19fd,null));};
\ No newline at end of file
index aaec26e..23d53d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38c8=['api','bluebird','request-promise','path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util'];(function(_0xd9a887,_0x51bfb3){var _0x331b9f=function(_0x22f5bb){while(--_0x22f5bb){_0xd9a887['push'](_0xd9a887['shift']());}};_0x331b9f(++_0x51bfb3);}(_0x38c8,0x1e2));var _0x838c=function(_0x4667b2,_0x135b67){_0x4667b2=_0x4667b2-0x0;var _0x1070f2=_0x38c8[_0x4667b2];return _0x1070f2;};'use strict';var _=require(_0x838c('0x0'));var util=require(_0x838c('0x1'));var logger=require('../../config/logger')(_0x838c('0x2'));var moment=require('moment');var BPromise=require(_0x838c('0x3'));var rp=require(_0x838c('0x4'));var fs=require('fs');var path=require(_0x838c('0x5'));var rimraf=require(_0x838c('0x6'));var config=require('../../config/environment');var attributes=require(_0x838c('0x7'));module[_0x838c('0x8')]=function(_0x5bb480,_0xc948ca){return _0x5bb480[_0x838c('0x9')](_0x838c('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2885=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x103072,_0x1251a4){var _0x329c7e=function(_0x17e85c){while(--_0x17e85c){_0x103072['push'](_0x103072['shift']());}};_0x329c7e(++_0x1251a4);}(_0x2885,0x182));var _0x5288=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x2885[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var logger=require('../../config/logger')(_0x5288('0x2'));var moment=require(_0x5288('0x3'));var BPromise=require(_0x5288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5288('0x5'));var rimraf=require('rimraf');var config=require(_0x5288('0x6'));var attributes=require(_0x5288('0x7'));module[_0x5288('0x8')]=function(_0x953bc3,_0xf8094d){return _0x953bc3[_0x5288('0x9')](_0x5288('0xa'),attributes,{'tableName':_0x5288('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f1b630..bf88cdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f7f=['result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x26df46,_0x5badde){var _0x1722bf=function(_0x38d7cf){while(--_0x38d7cf){_0x26df46['push'](_0x26df46['shift']());}};_0x1722bf(++_0x5badde);}(_0x0f7f,0x1cf));var _0xf0f7=function(_0x1156e1,_0x1844bc){_0x1156e1=_0x1156e1-0x0;var _0x18969e=_0x0f7f[_0x1156e1];return _0x18969e;};'use strict';var _=require(_0xf0f7('0x0'));var util=require('util');var moment=require(_0xf0f7('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0f7('0x2'));var fs=require('fs');var Redis=require(_0xf0f7('0x3'));var db=require(_0xf0f7('0x4'))['db'];var utils=require(_0xf0f7('0x5'));var logger=require('../../config/logger')(_0xf0f7('0x6'));var config=require(_0xf0f7('0x7'));var jayson=require(_0xf0f7('0x8'));var client=jayson[_0xf0f7('0x9')][_0xf0f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56c01b,_0x165652,_0x47835a){return new BPromise(function(_0x413ea3,_0x22ba33){return client[_0xf0f7('0xb')](_0x56c01b,_0x47835a)[_0xf0f7('0xc')](function(_0x2d2473){logger['info'](_0xf0f7('0xd'),_0x165652,_0xf0f7('0xe'));logger[_0xf0f7('0xf')](_0xf0f7('0x10'),_0x165652,_0xf0f7('0xe'),JSON['stringify'](_0x2d2473));if(_0x2d2473[_0xf0f7('0x11')]){if(_0x2d2473['error'][_0xf0f7('0x12')]===0x1f4){logger[_0xf0f7('0x11')](_0xf0f7('0xd'),_0x165652,_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);return _0x22ba33(_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);}logger['error'](_0xf0f7('0xd'),_0x165652,_0x2d2473['error'][_0xf0f7('0x13')]);return _0x413ea3(_0x2d2473[_0xf0f7('0x11')][_0xf0f7('0x13')]);}else{logger[_0xf0f7('0x14')](_0xf0f7('0xd'),_0x165652,_0xf0f7('0xe'));_0x413ea3(_0x2d2473[_0xf0f7('0x15')]['message']);}})['catch'](function(_0x2c14c8){logger[_0xf0f7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x165652,_0x2c14c8);_0x22ba33(_0x2c14c8);});});}
\ No newline at end of file
+var _0xe764=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe764,0x90));var _0x4e76=function(_0x4801a0,_0x252c24){_0x4801a0=_0x4801a0-0x0;var _0x338e26=_0xe764[_0x4801a0];return _0x338e26;};'use strict';var _=require(_0x4e76('0x0'));var util=require(_0x4e76('0x1'));var moment=require(_0x4e76('0x2'));var BPromise=require(_0x4e76('0x3'));var rs=require(_0x4e76('0x4'));var fs=require('fs');var Redis=require(_0x4e76('0x5'));var db=require(_0x4e76('0x6'))['db'];var utils=require(_0x4e76('0x7'));var logger=require(_0x4e76('0x8'))(_0x4e76('0x9'));var config=require(_0x4e76('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4e76('0xb')][_0x4e76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed0e3,_0x2656b7,_0x5d0837){return new BPromise(function(_0x3d7eb2,_0x26a3da){return client[_0x4e76('0xd')](_0x2ed0e3,_0x5d0837)[_0x4e76('0xe')](function(_0x1a1c93){logger[_0x4e76('0xf')](_0x4e76('0x10'),_0x2656b7,'request\x20sent');logger[_0x4e76('0x11')](_0x4e76('0x12'),_0x2656b7,_0x4e76('0x13'),JSON[_0x4e76('0x14')](_0x1a1c93));if(_0x1a1c93[_0x4e76('0x15')]){if(_0x1a1c93['error'][_0x4e76('0x16')]===0x1f4){logger[_0x4e76('0x15')](_0x4e76('0x10'),_0x2656b7,_0x1a1c93[_0x4e76('0x15')][_0x4e76('0x17')]);return _0x26a3da(_0x1a1c93['error'][_0x4e76('0x17')]);}logger[_0x4e76('0x15')](_0x4e76('0x10'),_0x2656b7,_0x1a1c93[_0x4e76('0x15')]['message']);return _0x3d7eb2(_0x1a1c93[_0x4e76('0x15')][_0x4e76('0x17')]);}else{logger[_0x4e76('0xf')](_0x4e76('0x10'),_0x2656b7,_0x4e76('0x13'));_0x3d7eb2(_0x1a1c93['result'][_0x4e76('0x17')]);}})[_0x4e76('0x18')](function(_0x5ab9c4){logger[_0x4e76('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2656b7,_0x5ab9c4);_0x26a3da(_0x5ab9c4);});});}
\ No newline at end of file
index 8ba2f7d..cf9f8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa197=['show','/:id/download','download','post','create','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id'];(function(_0x1302ef,_0x57e326){var _0x5f3c4e=function(_0x4ca663){while(--_0x4ca663){_0x1302ef['push'](_0x1302ef['shift']());}};_0x5f3c4e(++_0x57e326);}(_0xa197,0x8c));var _0x7a19=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0xa197[_0x519756];return _0x37047e;};'use strict';var multer=require(_0x7a19('0x0'));var util=require(_0x7a19('0x1'));var path=require(_0x7a19('0x2'));var timeout=require(_0x7a19('0x3'));var express=require('express');var router=express[_0x7a19('0x4')]();var fs_extra=require(_0x7a19('0x5'));var auth=require(_0x7a19('0x6'));var interaction=require(_0x7a19('0x7'));var config=require(_0x7a19('0x8'));var controller=require(_0x7a19('0x9'));router[_0x7a19('0xa')]('/',auth[_0x7a19('0xb')](),controller[_0x7a19('0xc')]);router[_0x7a19('0xa')](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller[_0x7a19('0xe')]);router[_0x7a19('0xa')](_0x7a19('0xf'),auth[_0x7a19('0xb')](),controller[_0x7a19('0x10')]);router[_0x7a19('0x11')]('/',auth[_0x7a19('0xb')](),controller[_0x7a19('0x12')]);router['put'](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller[_0x7a19('0x13')]);router[_0x7a19('0x14')](_0x7a19('0xd'),auth[_0x7a19('0xb')](),controller['destroy']);module[_0x7a19('0x15')]=router;
\ No newline at end of file
+var _0xe929=['update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xe929,0x93));var _0x9e92=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xe929[_0x4ba380];return _0x4b111b;};'use strict';var multer=require(_0x9e92('0x0'));var util=require(_0x9e92('0x1'));var path=require('path');var timeout=require(_0x9e92('0x2'));var express=require(_0x9e92('0x3'));var router=express['Router']();var fs_extra=require(_0x9e92('0x4'));var auth=require(_0x9e92('0x5'));var interaction=require(_0x9e92('0x6'));var config=require('../../config/environment');var controller=require(_0x9e92('0x7'));router[_0x9e92('0x8')]('/',auth[_0x9e92('0x9')](),controller[_0x9e92('0xa')]);router[_0x9e92('0x8')](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0xc')]);router[_0x9e92('0x8')]('/:id/download',auth[_0x9e92('0x9')](),controller['download']);router[_0x9e92('0xd')]('/',auth['isAuthenticated'](),controller[_0x9e92('0xe')]);router['put'](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0xf')]);router[_0x9e92('0x10')](_0x9e92('0xb'),auth[_0x9e92('0x9')](),controller[_0x9e92('0x11')]);module['exports']=router;
\ No newline at end of file
index 6b1412c..a4b2376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe1f=['exports','STRING','BOOLEAN','sequelize'];(function(_0x366e75,_0x533d1d){var _0x3b167b=function(_0x3e9f1d){while(--_0x3e9f1d){_0x366e75['push'](_0x366e75['shift']());}};_0x3b167b(++_0x533d1d);}(_0xfe1f,0x97));var _0xffe1=function(_0x295143,_0x105ade){_0x295143=_0x295143-0x0;var _0x7982e4=_0xfe1f[_0x295143];return _0x7982e4;};'use strict';var Sequelize=require(_0xffe1('0x0'));module[_0xffe1('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xffe1('0x2')]},'groupBy':{'type':Sequelize[_0xffe1('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xffe1('0x2')]},'custom':{'type':Sequelize[_0xffe1('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2059=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x1db481,_0x1627b2){var _0x3db95b=function(_0x2d54e4){while(--_0x2d54e4){_0x1db481['push'](_0x1db481['shift']());}};_0x3db95b(++_0x1627b2);}(_0x2059,0x7c));var _0x9205=function(_0x44454f,_0x4bfbe8){_0x44454f=_0x44454f-0x0;var _0x475150=_0x2059[_0x44454f];return _0x475150;};'use strict';var Sequelize=require(_0x9205('0x0'));module['exports']={'field':{'type':Sequelize[_0x9205('0x1')]},'alias':{'type':Sequelize[_0x9205('0x2')]},'function':{'type':Sequelize[_0x9205('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x9205('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x9205('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 4d548e3..8bf89fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd147=['rows','catch','show','keys','merge','options','find','create','body','bulkCreate','params','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','end','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','type','VIRTUAL','includeAll','include'];(function(_0x193e28,_0x3dac1d){var _0x20ef59=function(_0x48047e){while(--_0x48047e){_0x193e28['push'](_0x193e28['shift']());}};_0x20ef59(++_0x3dac1d);}(_0xd147,0xb1));var _0x7d14=function(_0x4791bb,_0x191223){_0x4791bb=_0x4791bb-0x0;var _0x3431b2=_0xd147[_0x4791bb];return _0x3431b2;};'use strict';var emlformat=require(_0x7d14('0x0'));var rimraf=require(_0x7d14('0x1'));var zipdir=require(_0x7d14('0x2'));var jsonpatch=require(_0x7d14('0x3'));var rp=require(_0x7d14('0x4'));var moment=require(_0x7d14('0x5'));var BPromise=require(_0x7d14('0x6'));var Mustache=require(_0x7d14('0x7'));var util=require(_0x7d14('0x8'));var path=require(_0x7d14('0x9'));var sox=require(_0x7d14('0xa'));var csv=require(_0x7d14('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d14('0xc'));var _=require(_0x7d14('0xd'));var squel=require('squel');var crypto=require(_0x7d14('0xe'));var jsforce=require(_0x7d14('0xf'));var deskjs=require(_0x7d14('0x10'));var toCsv=require(_0x7d14('0xb'));var querystring=require(_0x7d14('0x11'));var Papa=require('papaparse');var Redis=require(_0x7d14('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7d14('0x13'));var as=require(_0x7d14('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d14('0x15'))('api');var utils=require(_0x7d14('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7d14('0x17'));var db=require(_0x7d14('0x18'))['db'];function respondWithStatusCode(_0x20e251,_0x40833a){_0x40833a=_0x40833a||0xcc;return function(_0x3c9123){if(_0x3c9123){return _0x20e251[_0x7d14('0x19')](_0x40833a);}return _0x20e251[_0x7d14('0x1a')](_0x40833a)['end']();};}function respondWithResult(_0xda8910,_0x599115){_0x599115=_0x599115||0xc8;return function(_0x4369e8){if(_0x4369e8){return _0xda8910[_0x7d14('0x1a')](_0x599115)[_0x7d14('0x1b')](_0x4369e8);}};}function respondWithFilteredResult(_0x5e58f3,_0x2b159a){return function(_0x22a594){if(_0x22a594){var _0xaaceba=typeof _0x2b159a[_0x7d14('0x1c')]===_0x7d14('0x1d')&&typeof _0x2b159a[_0x7d14('0x1e')]===_0x7d14('0x1d');var _0x2d5ca7=_0x22a594[_0x7d14('0x1f')];var _0x447729=_0xaaceba?0x0:_0x2b159a['offset'];var _0x4ae848=_0xaaceba?_0x22a594[_0x7d14('0x1f')]:_0x2b159a[_0x7d14('0x1c')]+_0x2b159a['limit'];var _0xac70a9;if(_0x4ae848>=_0x2d5ca7){_0x4ae848=_0x2d5ca7;_0xac70a9=0xc8;}else{_0xac70a9=0xce;}_0x5e58f3[_0x7d14('0x1a')](_0xac70a9);return _0x5e58f3[_0x7d14('0x20')]('Content-Range',_0x447729+'-'+_0x4ae848+'/'+_0x2d5ca7)['json'](_0x22a594);}return null;};}function patchUpdates(_0x47e05a){return function(_0x4cea4d){try{jsonpatch[_0x7d14('0x21')](_0x4cea4d,_0x47e05a,!![]);}catch(_0x25005f){return BPromise[_0x7d14('0x22')](_0x25005f);}return _0x4cea4d['save']();};}function saveUpdates(_0x1ee50b,_0x152f7d){return function(_0x156ada){if(_0x156ada){return _0x156ada[_0x7d14('0x23')](_0x1ee50b)[_0x7d14('0x24')](function(_0x216f18){return _0x216f18;});}return null;};}function removeEntity(_0x29c28d,_0x565bf6){return function(_0xf1cf06){if(_0xf1cf06){return _0xf1cf06[_0x7d14('0x25')]()[_0x7d14('0x24')](function(){_0x29c28d[_0x7d14('0x1a')](0xcc)[_0x7d14('0x26')]();});}};}function handleEntityNotFound(_0x346350,_0xce1af7){return function(_0x18dad3){if(!_0x18dad3){_0x346350[_0x7d14('0x19')](0x194);}return _0x18dad3;};}function handleError(_0x12db7e,_0x2acaa4){_0x2acaa4=_0x2acaa4||0x1f4;return function(_0x55f7ce){logger[_0x7d14('0x27')](_0x55f7ce[_0x7d14('0x28')]);if(_0x55f7ce[_0x7d14('0x29')]){delete _0x55f7ce[_0x7d14('0x29')];}_0x12db7e[_0x7d14('0x1a')](_0x2acaa4)['send'](_0x55f7ce);};}exports[_0x7d14('0x2a')]=function(_0x494ef5,_0x25f456){var _0x1c7d47={},_0x2bf100={},_0x510e20={'count':0x0,'rows':[]};var _0x43ded7=_[_0x7d14('0x2b')](db[_0x7d14('0x2c')][_0x7d14('0x2d')],function(_0x117e22){return{'name':_0x117e22[_0x7d14('0x2e')],'type':_0x117e22['type']['key']};});_0x2bf100['model']=_[_0x7d14('0x2b')](_0x43ded7,_0x7d14('0x29'));_0x2bf100[_0x7d14('0x2f')]=_['keys'](_0x494ef5['query']);_0x2bf100[_0x7d14('0x30')]=_[_0x7d14('0x31')](_0x2bf100[_0x7d14('0x32')],_0x2bf100[_0x7d14('0x2f')]);_0x1c7d47[_0x7d14('0x33')]=_[_0x7d14('0x31')](_0x2bf100[_0x7d14('0x32')],qs['fields'](_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x34')]));_0x1c7d47[_0x7d14('0x33')]=_0x1c7d47[_0x7d14('0x33')][_0x7d14('0x35')]?_0x1c7d47[_0x7d14('0x33')]:_0x2bf100[_0x7d14('0x32')];if(!_0x494ef5['query']['hasOwnProperty'](_0x7d14('0x36'))){_0x1c7d47['limit']=qs[_0x7d14('0x1e')](_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x1e')]);_0x1c7d47[_0x7d14('0x1c')]=qs[_0x7d14('0x1c')](_0x494ef5['query'][_0x7d14('0x1c')]);}_0x1c7d47[_0x7d14('0x37')]=qs[_0x7d14('0x38')](_0x494ef5[_0x7d14('0x2f')]['sort']);_0x1c7d47['where']=qs['filters'](_['pick'](_0x494ef5['query'],_0x2bf100[_0x7d14('0x30')]),_0x43ded7);if(_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x39')]){_0x1c7d47[_0x7d14('0x3a')]=_['merge'](_0x1c7d47['where'],{'$or':_[_0x7d14('0x2b')](_0x43ded7,function(_0x5b9c88){if(_0x5b9c88[_0x7d14('0x3b')]!==_0x7d14('0x3c')){var _0x3c3e66={};_0x3c3e66[_0x5b9c88[_0x7d14('0x29')]]={'$like':'%'+_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x39')]+'%'};return _0x3c3e66;}})});}_0x1c7d47=_['merge']({},_0x1c7d47,_0x494ef5['options']);var _0x4432d9={'where':_0x1c7d47[_0x7d14('0x3a')]};return db[_0x7d14('0x2c')][_0x7d14('0x1f')](_0x4432d9)[_0x7d14('0x24')](function(_0x15b569){_0x510e20[_0x7d14('0x1f')]=_0x15b569;if(_0x494ef5[_0x7d14('0x2f')][_0x7d14('0x3d')]){_0x1c7d47[_0x7d14('0x3e')]=[{'all':!![]}];}return db[_0x7d14('0x2c')]['findAll'](_0x1c7d47);})[_0x7d14('0x24')](function(_0x57b514){_0x510e20[_0x7d14('0x3f')]=_0x57b514;return _0x510e20;})[_0x7d14('0x24')](respondWithFilteredResult(_0x25f456,_0x1c7d47))[_0x7d14('0x40')](handleError(_0x25f456,null));};exports[_0x7d14('0x41')]=function(_0x371be0,_0x1affd5){var _0x34563f={'raw':![],'where':{'id':_0x371be0['params']['id']}},_0x4519bf={};_0x4519bf['model']=_['keys'](db[_0x7d14('0x2c')][_0x7d14('0x2d')]);_0x4519bf[_0x7d14('0x2f')]=_[_0x7d14('0x42')](_0x371be0[_0x7d14('0x2f')]);_0x4519bf['filters']=_[_0x7d14('0x31')](_0x4519bf[_0x7d14('0x32')],_0x4519bf['query']);_0x34563f['attributes']=_[_0x7d14('0x31')](_0x4519bf[_0x7d14('0x32')],qs[_0x7d14('0x34')](_0x371be0[_0x7d14('0x2f')][_0x7d14('0x34')]));_0x34563f['attributes']=_0x34563f[_0x7d14('0x33')][_0x7d14('0x35')]?_0x34563f[_0x7d14('0x33')]:_0x4519bf[_0x7d14('0x32')];if(_0x371be0[_0x7d14('0x2f')][_0x7d14('0x3d')]){_0x34563f[_0x7d14('0x3e')]=[{'all':!![]}];}_0x34563f=_[_0x7d14('0x43')]({},_0x34563f,_0x371be0[_0x7d14('0x44')]);return db[_0x7d14('0x2c')][_0x7d14('0x45')](_0x34563f)['then'](handleEntityNotFound(_0x1affd5,null))[_0x7d14('0x24')](respondWithResult(_0x1affd5,null))['catch'](handleError(_0x1affd5,null));};exports[_0x7d14('0x46')]=function(_0x5c90a0,_0x4414bc){return db[_0x7d14('0x2c')][_0x7d14('0x46')](_0x5c90a0[_0x7d14('0x47')],{})[_0x7d14('0x24')](respondWithResult(_0x4414bc,0xc9))[_0x7d14('0x40')](handleError(_0x4414bc,null));};exports[_0x7d14('0x48')]=function(_0x549ec6,_0xff1fda){return db['AnalyticFieldReport']['bulkCreate'](_0x549ec6[_0x7d14('0x47')],{'raw':![],'individualHooks':!![]})[_0x7d14('0x24')](respondWithResult(_0xff1fda,0xc9))[_0x7d14('0x40')](handleError(_0xff1fda,null));};exports[_0x7d14('0x23')]=function(_0x3a810e,_0x1a049a){if(_0x3a810e['body']['id']){delete _0x3a810e[_0x7d14('0x47')]['id'];}return db['AnalyticFieldReport'][_0x7d14('0x45')]({'where':{'id':_0x3a810e[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x1a049a,null))[_0x7d14('0x24')](saveUpdates(_0x3a810e[_0x7d14('0x47')],null))[_0x7d14('0x24')](respondWithResult(_0x1a049a,null))[_0x7d14('0x40')](handleError(_0x1a049a,null));};exports[_0x7d14('0x25')]=function(_0x2bfc0c,_0x340429){return db[_0x7d14('0x2c')][_0x7d14('0x45')]({'where':{'id':_0x2bfc0c[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x340429,null))[_0x7d14('0x24')](removeEntity(_0x340429,null))[_0x7d14('0x40')](handleError(_0x340429,null));};exports['bulkDestroy']=function(_0x223cf4,_0x436de1){return db[_0x7d14('0x2c')][_0x7d14('0x25')]({'where':{'id':_0x223cf4[_0x7d14('0x2f')][_0x7d14('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x7d14('0x24')](respondWithResult(_0x436de1,0xcc))[_0x7d14('0x40')](handleError(_0x436de1,null));};exports[_0x7d14('0x4b')]=function(_0x21353a,_0x3263d8,_0x1ad263){return db[_0x7d14('0x4c')]['findOne']({'where':{'id':_0x21353a[_0x7d14('0x49')]['id']}})[_0x7d14('0x24')](handleEntityNotFound(_0x3263d8,null))[_0x7d14('0x24')](function(_0x2f766e){if(_0x2f766e){return db[_0x7d14('0x4d')][_0x7d14('0x4e')](function(_0x1fa00e){return db[_0x7d14('0x2c')][_0x7d14('0x25')]({'where':{'CustomReportId':_0x21353a[_0x7d14('0x49')]['id']},'transaction':_0x1fa00e})['then'](function(_0x982741){var _0x14bc5b=_['map'](_0x21353a[_0x7d14('0x47')],function(_0x20c627){delete _0x20c627['id'];_0x20c627[_0x7d14('0x4f')]=_0x21353a[_0x7d14('0x49')]['id'];return _0x20c627;});return db[_0x7d14('0x2c')][_0x7d14('0x48')](_0x14bc5b,{'transaction':_0x1fa00e});});})[_0x7d14('0x24')](function(){return db[_0x7d14('0x2c')]['findAll']({'where':{'CustomReportId':_0x21353a[_0x7d14('0x49')]['id']}});});}})['then'](respondWithResult(_0x3263d8,null))[_0x7d14('0x40')](handleError(_0x3263d8,null));};
\ No newline at end of file
+var _0x7079=['includeAll','findAll','rows','catch','params','include','merge','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','then'];(function(_0x465c8d,_0x308d2e){var _0x3e64a8=function(_0x4ded4e){while(--_0x4ded4e){_0x465c8d['push'](_0x465c8d['shift']());}};_0x3e64a8(++_0x308d2e);}(_0x7079,0x68));var _0x9707=function(_0x3b145d,_0x3a2aba){_0x3b145d=_0x3b145d-0x0;var _0x320f0a=_0x7079[_0x3b145d];return _0x320f0a;};'use strict';var emlformat=require(_0x9707('0x0'));var rimraf=require(_0x9707('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9707('0x2'));var rp=require(_0x9707('0x3'));var moment=require('moment');var BPromise=require(_0x9707('0x4'));var Mustache=require(_0x9707('0x5'));var util=require(_0x9707('0x6'));var path=require('path');var sox=require(_0x9707('0x7'));var csv=require(_0x9707('0x8'));var ejs=require(_0x9707('0x9'));var fs=require('fs');var fs_extra=require(_0x9707('0xa'));var _=require(_0x9707('0xb'));var squel=require(_0x9707('0xc'));var crypto=require(_0x9707('0xd'));var jsforce=require(_0x9707('0xe'));var deskjs=require(_0x9707('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9707('0x10'));var Redis=require(_0x9707('0x11'));var authService=require(_0x9707('0x12'));var qs=require(_0x9707('0x13'));var as=require(_0x9707('0x14'));var hardwareService=require(_0x9707('0x15'));var logger=require(_0x9707('0x16'))('api');var utils=require(_0x9707('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9707('0x18'));var db=require(_0x9707('0x19'))['db'];function respondWithStatusCode(_0x3364b8,_0x29fde8){_0x29fde8=_0x29fde8||0xcc;return function(_0x3a845a){if(_0x3a845a){return _0x3364b8['sendStatus'](_0x29fde8);}return _0x3364b8[_0x9707('0x1a')](_0x29fde8)['end']();};}function respondWithResult(_0x3b2de1,_0x191cbe){_0x191cbe=_0x191cbe||0xc8;return function(_0x3557bd){if(_0x3557bd){return _0x3b2de1['status'](_0x191cbe)[_0x9707('0x1b')](_0x3557bd);}};}function respondWithFilteredResult(_0x48652a,_0x2f94f8){return function(_0x44c3e7){if(_0x44c3e7){var _0x279662=typeof _0x2f94f8['offset']===_0x9707('0x1c')&&typeof _0x2f94f8[_0x9707('0x1d')]==='undefined';var _0x4e6e85=_0x44c3e7[_0x9707('0x1e')];var _0x4084eb=_0x279662?0x0:_0x2f94f8[_0x9707('0x1f')];var _0x3be78c=_0x279662?_0x44c3e7['count']:_0x2f94f8['offset']+_0x2f94f8[_0x9707('0x1d')];var _0xfe46a7;if(_0x3be78c>=_0x4e6e85){_0x3be78c=_0x4e6e85;_0xfe46a7=0xc8;}else{_0xfe46a7=0xce;}_0x48652a[_0x9707('0x1a')](_0xfe46a7);return _0x48652a[_0x9707('0x20')](_0x9707('0x21'),_0x4084eb+'-'+_0x3be78c+'/'+_0x4e6e85)[_0x9707('0x1b')](_0x44c3e7);}return null;};}function patchUpdates(_0x13b413){return function(_0x14d2b6){try{jsonpatch[_0x9707('0x22')](_0x14d2b6,_0x13b413,!![]);}catch(_0x4c2ec4){return BPromise[_0x9707('0x23')](_0x4c2ec4);}return _0x14d2b6[_0x9707('0x24')]();};}function saveUpdates(_0x4fcf1b,_0x5a3081){return function(_0x1c5ee8){if(_0x1c5ee8){return _0x1c5ee8[_0x9707('0x25')](_0x4fcf1b)['then'](function(_0x52c4b1){return _0x52c4b1;});}return null;};}function removeEntity(_0x57ac1c,_0x1f1e00){return function(_0x434b48){if(_0x434b48){return _0x434b48[_0x9707('0x26')]()['then'](function(){_0x57ac1c['status'](0xcc)[_0x9707('0x27')]();});}};}function handleEntityNotFound(_0x2f4671,_0x3bf90c){return function(_0x3f7428){if(!_0x3f7428){_0x2f4671[_0x9707('0x28')](0x194);}return _0x3f7428;};}function handleError(_0x27ea0e,_0x182540){_0x182540=_0x182540||0x1f4;return function(_0x382ad5){logger[_0x9707('0x29')](_0x382ad5[_0x9707('0x2a')]);if(_0x382ad5[_0x9707('0x2b')]){delete _0x382ad5[_0x9707('0x2b')];}_0x27ea0e[_0x9707('0x1a')](_0x182540)[_0x9707('0x2c')](_0x382ad5);};}exports[_0x9707('0x2d')]=function(_0xff5a53,_0xa12368){var _0x2487e4={},_0x19accd={},_0x15dc75={'count':0x0,'rows':[]};var _0x58fdb1=_[_0x9707('0x2e')](db[_0x9707('0x2f')][_0x9707('0x30')],function(_0x20d27a){return{'name':_0x20d27a[_0x9707('0x31')],'type':_0x20d27a[_0x9707('0x32')][_0x9707('0x33')]};});_0x19accd[_0x9707('0x34')]=_[_0x9707('0x2e')](_0x58fdb1,_0x9707('0x2b'));_0x19accd[_0x9707('0x35')]=_[_0x9707('0x36')](_0xff5a53['query']);_0x19accd['filters']=_[_0x9707('0x37')](_0x19accd['model'],_0x19accd[_0x9707('0x35')]);_0x2487e4[_0x9707('0x38')]=_[_0x9707('0x37')](_0x19accd[_0x9707('0x34')],qs['fields'](_0xff5a53[_0x9707('0x35')][_0x9707('0x39')]));_0x2487e4[_0x9707('0x38')]=_0x2487e4['attributes'][_0x9707('0x3a')]?_0x2487e4[_0x9707('0x38')]:_0x19accd[_0x9707('0x34')];if(!_0xff5a53[_0x9707('0x35')][_0x9707('0x3b')](_0x9707('0x3c'))){_0x2487e4['limit']=qs[_0x9707('0x1d')](_0xff5a53[_0x9707('0x35')][_0x9707('0x1d')]);_0x2487e4['offset']=qs[_0x9707('0x1f')](_0xff5a53[_0x9707('0x35')][_0x9707('0x1f')]);}_0x2487e4[_0x9707('0x3d')]=qs[_0x9707('0x3e')](_0xff5a53[_0x9707('0x35')][_0x9707('0x3e')]);_0x2487e4[_0x9707('0x3f')]=qs[_0x9707('0x40')](_[_0x9707('0x41')](_0xff5a53[_0x9707('0x35')],_0x19accd['filters']),_0x58fdb1);if(_0xff5a53[_0x9707('0x35')][_0x9707('0x42')]){_0x2487e4[_0x9707('0x3f')]=_['merge'](_0x2487e4[_0x9707('0x3f')],{'$or':_[_0x9707('0x2e')](_0x58fdb1,function(_0x557b51){if(_0x557b51['type']!==_0x9707('0x43')){var _0x2e052e={};_0x2e052e[_0x557b51['name']]={'$like':'%'+_0xff5a53[_0x9707('0x35')][_0x9707('0x42')]+'%'};return _0x2e052e;}})});}_0x2487e4=_['merge']({},_0x2487e4,_0xff5a53[_0x9707('0x44')]);var _0x3416f0={'where':_0x2487e4[_0x9707('0x3f')]};return db[_0x9707('0x2f')][_0x9707('0x1e')](_0x3416f0)[_0x9707('0x45')](function(_0x44f8e6){_0x15dc75[_0x9707('0x1e')]=_0x44f8e6;if(_0xff5a53[_0x9707('0x35')][_0x9707('0x46')]){_0x2487e4['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9707('0x47')](_0x2487e4);})[_0x9707('0x45')](function(_0x106149){_0x15dc75[_0x9707('0x48')]=_0x106149;return _0x15dc75;})[_0x9707('0x45')](respondWithFilteredResult(_0xa12368,_0x2487e4))[_0x9707('0x49')](handleError(_0xa12368,null));};exports['show']=function(_0x14c59a,_0x488bcb){var _0x315762={'raw':![],'where':{'id':_0x14c59a[_0x9707('0x4a')]['id']}},_0x515801={};_0x515801[_0x9707('0x34')]=_[_0x9707('0x36')](db[_0x9707('0x2f')]['rawAttributes']);_0x515801[_0x9707('0x35')]=_[_0x9707('0x36')](_0x14c59a['query']);_0x515801[_0x9707('0x40')]=_[_0x9707('0x37')](_0x515801[_0x9707('0x34')],_0x515801['query']);_0x315762[_0x9707('0x38')]=_[_0x9707('0x37')](_0x515801[_0x9707('0x34')],qs[_0x9707('0x39')](_0x14c59a[_0x9707('0x35')][_0x9707('0x39')]));_0x315762[_0x9707('0x38')]=_0x315762['attributes'][_0x9707('0x3a')]?_0x315762[_0x9707('0x38')]:_0x515801[_0x9707('0x34')];if(_0x14c59a[_0x9707('0x35')]['includeAll']){_0x315762[_0x9707('0x4b')]=[{'all':!![]}];}_0x315762=_[_0x9707('0x4c')]({},_0x315762,_0x14c59a[_0x9707('0x44')]);return db[_0x9707('0x2f')][_0x9707('0x4d')](_0x315762)[_0x9707('0x45')](handleEntityNotFound(_0x488bcb,null))['then'](respondWithResult(_0x488bcb,null))[_0x9707('0x49')](handleError(_0x488bcb,null));};exports['create']=function(_0x18dfda,_0x12e475){return db['AnalyticFieldReport'][_0x9707('0x4e')](_0x18dfda[_0x9707('0x4f')],{})[_0x9707('0x45')](respondWithResult(_0x12e475,0xc9))[_0x9707('0x49')](handleError(_0x12e475,null));};exports[_0x9707('0x50')]=function(_0x1d3ff9,_0x1e6f7a){return db[_0x9707('0x2f')]['bulkCreate'](_0x1d3ff9['body'],{'raw':![],'individualHooks':!![]})[_0x9707('0x45')](respondWithResult(_0x1e6f7a,0xc9))['catch'](handleError(_0x1e6f7a,null));};exports['update']=function(_0x2e2806,_0x1dddf2){if(_0x2e2806[_0x9707('0x4f')]['id']){delete _0x2e2806[_0x9707('0x4f')]['id'];}return db[_0x9707('0x2f')][_0x9707('0x4d')]({'where':{'id':_0x2e2806[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x1dddf2,null))[_0x9707('0x45')](saveUpdates(_0x2e2806[_0x9707('0x4f')],null))[_0x9707('0x45')](respondWithResult(_0x1dddf2,null))[_0x9707('0x49')](handleError(_0x1dddf2,null));};exports[_0x9707('0x26')]=function(_0x5a7c4d,_0x2ac133){return db['AnalyticFieldReport'][_0x9707('0x4d')]({'where':{'id':_0x5a7c4d[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x2ac133,null))[_0x9707('0x45')](removeEntity(_0x2ac133,null))[_0x9707('0x49')](handleError(_0x2ac133,null));};exports['bulkDestroy']=function(_0x42872c,_0xcc1894){return db[_0x9707('0x2f')][_0x9707('0x26')]({'where':{'id':_0x42872c[_0x9707('0x35')][_0x9707('0x51')]||[]},'raw':![],'individualHooks':!![]})[_0x9707('0x45')](respondWithResult(_0xcc1894,0xcc))[_0x9707('0x49')](handleError(_0xcc1894,null));};exports[_0x9707('0x52')]=function(_0x5b3be7,_0x1102c5,_0x357901){return db[_0x9707('0x53')][_0x9707('0x54')]({'where':{'id':_0x5b3be7[_0x9707('0x4a')]['id']}})[_0x9707('0x45')](handleEntityNotFound(_0x1102c5,null))[_0x9707('0x45')](function(_0x5770b9){if(_0x5770b9){return db['sequelize'][_0x9707('0x55')](function(_0x45b0a4){return db['AnalyticFieldReport'][_0x9707('0x26')]({'where':{'CustomReportId':_0x5b3be7['params']['id']},'transaction':_0x45b0a4})['then'](function(_0x2086a3){var _0x5645ce=_[_0x9707('0x2e')](_0x5b3be7[_0x9707('0x4f')],function(_0x2ff46b){delete _0x2ff46b['id'];_0x2ff46b[_0x9707('0x56')]=_0x5b3be7['params']['id'];return _0x2ff46b;});return db['AnalyticFieldReport'][_0x9707('0x50')](_0x5645ce,{'transaction':_0x45b0a4});});})['then'](function(){return db[_0x9707('0x2f')][_0x9707('0x47')]({'where':{'CustomReportId':_0x5b3be7[_0x9707('0x4a')]['id']}});});}})['then'](respondWithResult(_0x1102c5,null))['catch'](handleError(_0x1102c5,null));};
\ No newline at end of file
index 1434ba9..b80fd92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb347=['bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment'];(function(_0x130507,_0x55a00e){var _0x34e1d5=function(_0x4f88bf){while(--_0x4f88bf){_0x130507['push'](_0x130507['shift']());}};_0x34e1d5(++_0x55a00e);}(_0xb347,0x104));var _0x7b34=function(_0x3df874,_0x819192){_0x3df874=_0x3df874-0x0;var _0x1d6b01=_0xb347[_0x3df874];return _0x1d6b01;};'use strict';var _=require(_0x7b34('0x0'));var util=require(_0x7b34('0x1'));var logger=require(_0x7b34('0x2'))('api');var moment=require(_0x7b34('0x3'));var BPromise=require(_0x7b34('0x4'));var rp=require(_0x7b34('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b34('0x6'));var config=require(_0x7b34('0x7'));var attributes=require(_0x7b34('0x8'));module[_0x7b34('0x9')]=function(_0x37737f,_0x4f56fd){return _0x37737f['define'](_0x7b34('0xa'),attributes,{'tableName':_0x7b34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8dd=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe8dd,0x65));var _0xde8d=function(_0x45af6b,_0x1a4ea8){_0x45af6b=_0x45af6b-0x0;var _0x3bf8a7=_0xe8dd[_0x45af6b];return _0x3bf8a7;};'use strict';var _=require(_0xde8d('0x0'));var util=require(_0xde8d('0x1'));var logger=require(_0xde8d('0x2'))(_0xde8d('0x3'));var moment=require(_0xde8d('0x4'));var BPromise=require(_0xde8d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xde8d('0x6'));var config=require(_0xde8d('0x7'));var attributes=require(_0xde8d('0x8'));module[_0xde8d('0x9')]=function(_0x89d73b,_0x5a66c8){return _0x89d73b[_0xde8d('0xa')](_0xde8d('0xb'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 431ef6a..2ad8936 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c6=['../../config/environment','jayson/promise','client','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xb9c6,0x1aa));var _0x6b9c=function(_0x15c0a8,_0x3b0c8b){_0x15c0a8=_0x15c0a8-0x0;var _0x4a1943=_0xb9c6[_0x15c0a8];return _0x4a1943;};'use strict';var _=require(_0x6b9c('0x0'));var util=require(_0x6b9c('0x1'));var moment=require(_0x6b9c('0x2'));var BPromise=require(_0x6b9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b9c('0x4'));var db=require(_0x6b9c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6b9c('0x6'));var jayson=require(_0x6b9c('0x7'));var client=jayson[_0x6b9c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44b505,_0x91dd39,_0x48a116){return new BPromise(function(_0x353bd3,_0xa3c8a){return client['request'](_0x44b505,_0x48a116)[_0x6b9c('0x9')](function(_0x1e5ce8){logger['info'](_0x6b9c('0xa'),_0x91dd39,_0x6b9c('0xb'));logger['debug'](_0x6b9c('0xc'),_0x91dd39,_0x6b9c('0xb'),JSON['stringify'](_0x1e5ce8));if(_0x1e5ce8[_0x6b9c('0xd')]){if(_0x1e5ce8['error']['code']===0x1f4){logger[_0x6b9c('0xd')](_0x6b9c('0xa'),_0x91dd39,_0x1e5ce8[_0x6b9c('0xd')][_0x6b9c('0xe')]);return _0xa3c8a(_0x1e5ce8[_0x6b9c('0xd')][_0x6b9c('0xe')]);}logger[_0x6b9c('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x91dd39,_0x1e5ce8['error'][_0x6b9c('0xe')]);return _0x353bd3(_0x1e5ce8['error'][_0x6b9c('0xe')]);}else{logger[_0x6b9c('0xf')](_0x6b9c('0xa'),_0x91dd39,_0x6b9c('0xb'));_0x353bd3(_0x1e5ce8[_0x6b9c('0x10')]['message']);}})[_0x6b9c('0x11')](function(_0x837a13){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x91dd39,_0x837a13);_0xa3c8a(_0x837a13);});});}
\ No newline at end of file
+var _0x8faa=['request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x8faa,0x9a));var _0xa8fa=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8faa[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0xa8fa('0x0'));var util=require(_0xa8fa('0x1'));var moment=require(_0xa8fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xa8fa('0x3'));var fs=require('fs');var Redis=require(_0xa8fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa8fa('0x5'))(_0xa8fa('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8fa('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x511c6f,_0x5412db,_0x1d65fd){return new BPromise(function(_0xf073f,_0x4419c5){return client[_0xa8fa('0x8')](_0x511c6f,_0x1d65fd)[_0xa8fa('0x9')](function(_0x1fa7d4){logger[_0xa8fa('0xa')](_0xa8fa('0xb'),_0x5412db,'request\x20sent');logger['debug'](_0xa8fa('0xc'),_0x5412db,'request\x20sent',JSON[_0xa8fa('0xd')](_0x1fa7d4));if(_0x1fa7d4[_0xa8fa('0xe')]){if(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0xf')]===0x1f4){logger[_0xa8fa('0xe')](_0xa8fa('0xb'),_0x5412db,_0x1fa7d4['error'][_0xa8fa('0x10')]);return _0x4419c5(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0x10')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5412db,_0x1fa7d4['error'][_0xa8fa('0x10')]);return _0xf073f(_0x1fa7d4[_0xa8fa('0xe')][_0xa8fa('0x10')]);}else{logger[_0xa8fa('0xa')](_0xa8fa('0xb'),_0x5412db,_0xa8fa('0x11'));_0xf073f(_0x1fa7d4[_0xa8fa('0x12')][_0xa8fa('0x10')]);}})['catch'](function(_0x1188a2){logger[_0xa8fa('0xe')](_0xa8fa('0xb'),_0x5412db,_0x1188a2);_0x4419c5(_0x1188a2);});});}
\ No newline at end of file
index 24ee471..d85c5a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x25f743,_0x27841d){var _0x48bba1=function(_0x59430c){while(--_0x59430c){_0x25f743['push'](_0x25f743['shift']());}};_0x48bba1(++_0x27841d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x55bf5e,_0x36933f){var _0x459419=function(_0x45ddc3){while(--_0x45ddc3){_0x55bf5e['push'](_0x55bf5e['shift']());}};_0x459419(++_0x36933f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
index cc0c500..b86b92a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd957=['exports','name','STRING','sequelize'];(function(_0x2191fb,_0x4497b2){var _0x435aa6=function(_0x55b09d){while(--_0x55b09d){_0x2191fb['push'](_0x2191fb['shift']());}};_0x435aa6(++_0x4497b2);}(_0xd957,0x153));var _0x7d95=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd957[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}};
\ No newline at end of file
+var _0x282b=['sequelize','exports','STRING','name'];(function(_0x206969,_0x2106e4){var _0x20a94d=function(_0x4dd625){while(--_0x4dd625){_0x206969['push'](_0x206969['shift']());}};_0x20a94d(++_0x2106e4);}(_0x282b,0xec));var _0xb282=function(_0x111780,_0xe5970b){_0x111780=_0x111780-0x0;var _0x5edc21=_0x282b[_0x111780];return _0x5edc21;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'name':{'type':Sequelize[_0xb282('0x2')],'allowNull':![],'unique':_0xb282('0x3')},'table':{'type':Sequelize[_0xb282('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index aec5ec5..9aadbf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','merge'];(function(_0x10c7e0,_0x484507){var _0x330990=function(_0x3b5317){while(--_0x3b5317){_0x10c7e0['push'](_0x10c7e0['shift']());}};_0x330990(++_0x484507);}(_0x425d,0x1e0));var _0xd425=function(_0x2eb207,_0x504197){_0x2eb207=_0x2eb207-0x0;var _0x3afb71=_0x425d[_0x2eb207];return _0x3afb71;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];function respondWithStatusCode(_0x9bb611,_0x3cacf7){_0x3cacf7=_0x3cacf7||0xcc;return function(_0x3b5de8){if(_0x3b5de8){return _0x9bb611[_0xd425('0x1d')](_0x3cacf7);}return _0x9bb611['status'](_0x3cacf7)[_0xd425('0x1e')]();};}function respondWithResult(_0x17a498,_0x336dc3){_0x336dc3=_0x336dc3||0xc8;return function(_0x5d3d60){if(_0x5d3d60){return _0x17a498[_0xd425('0x1f')](_0x336dc3)[_0xd425('0x20')](_0x5d3d60);}};}function respondWithFilteredResult(_0x643fd2,_0x41f34d){return function(_0x1fc822){if(_0x1fc822){var _0x538a0a=typeof _0x41f34d[_0xd425('0x21')]===_0xd425('0x22')&&typeof _0x41f34d[_0xd425('0x23')]===_0xd425('0x22');var _0x5d6585=_0x1fc822[_0xd425('0x24')];var _0x434d97=_0x538a0a?0x0:_0x41f34d[_0xd425('0x21')];var _0x1155bc=_0x538a0a?_0x1fc822['count']:_0x41f34d['offset']+_0x41f34d['limit'];var _0x4b293a;if(_0x1155bc>=_0x5d6585){_0x1155bc=_0x5d6585;_0x4b293a=0xc8;}else{_0x4b293a=0xce;}_0x643fd2[_0xd425('0x1f')](_0x4b293a);return _0x643fd2[_0xd425('0x25')](_0xd425('0x26'),_0x434d97+'-'+_0x1155bc+'/'+_0x5d6585)['json'](_0x1fc822);}return null;};}function patchUpdates(_0x355af0){return function(_0x7e982e){try{jsonpatch['apply'](_0x7e982e,_0x355af0,!![]);}catch(_0x2e1ec4){return BPromise[_0xd425('0x27')](_0x2e1ec4);}return _0x7e982e[_0xd425('0x28')]();};}function saveUpdates(_0x1d3fc0,_0x3e93db){return function(_0xb240c4){if(_0xb240c4){return _0xb240c4[_0xd425('0x29')](_0x1d3fc0)[_0xd425('0x2a')](function(_0x314201){return _0x314201;});}return null;};}function removeEntity(_0x2b030b,_0x151ad9){return function(_0x40e84b){if(_0x40e84b){return _0x40e84b['destroy']()[_0xd425('0x2a')](function(){var _0x264b0e=_0x40e84b[_0xd425('0x2b')]({'plain':!![]});var _0x1908a5=_0xd425('0x2c');return db[_0xd425('0x2d')][_0xd425('0x2e')]({'where':{'type':_0x1908a5,'resourceId':_0x264b0e['id']}})['then'](function(){return _0x40e84b;});})[_0xd425('0x2a')](function(){_0x2b030b[_0xd425('0x1f')](0xcc)[_0xd425('0x1e')]();});}};}function handleEntityNotFound(_0x57c950,_0x27ef8a){return function(_0x3ad9bd){if(!_0x3ad9bd){_0x57c950[_0xd425('0x1d')](0x194);}return _0x3ad9bd;};}function handleError(_0x999fb9,_0x27d29a){_0x27d29a=_0x27d29a||0x1f4;return function(_0x185d7e){logger[_0xd425('0x2f')](_0x185d7e[_0xd425('0x30')]);if(_0x185d7e[_0xd425('0x31')]){delete _0x185d7e[_0xd425('0x31')];}_0x999fb9['status'](_0x27d29a)[_0xd425('0x32')](_0x185d7e);};}exports[_0xd425('0x33')]=function(_0x298602,_0x3695dd){var _0x3275b1={},_0x1abf33={},_0x47405f={'count':0x0,'rows':[]};var _0x40c392=_[_0xd425('0x34')](db[_0xd425('0x35')][_0xd425('0x36')],function(_0x5f3dab){return{'name':_0x5f3dab[_0xd425('0x37')],'type':_0x5f3dab[_0xd425('0x38')][_0xd425('0x39')]};});_0x1abf33[_0xd425('0x3a')]=_[_0xd425('0x34')](_0x40c392,'name');_0x1abf33[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x298602['query']);_0x1abf33['filters']=_['intersection'](_0x1abf33[_0xd425('0x3a')],_0x1abf33[_0xd425('0x3b')]);_0x3275b1[_0xd425('0x3d')]=_[_0xd425('0x3e')](_0x1abf33['model'],qs[_0xd425('0x3f')](_0x298602[_0xd425('0x3b')][_0xd425('0x3f')]));_0x3275b1[_0xd425('0x3d')]=_0x3275b1[_0xd425('0x3d')][_0xd425('0x40')]?_0x3275b1[_0xd425('0x3d')]:_0x1abf33['model'];if(!_0x298602[_0xd425('0x3b')]['hasOwnProperty'](_0xd425('0x41'))){_0x3275b1[_0xd425('0x23')]=qs[_0xd425('0x23')](_0x298602['query'][_0xd425('0x23')]);_0x3275b1[_0xd425('0x21')]=qs[_0xd425('0x21')](_0x298602[_0xd425('0x3b')]['offset']);}_0x3275b1[_0xd425('0x42')]=qs[_0xd425('0x43')](_0x298602['query']['sort']);_0x3275b1['where']=qs[_0xd425('0x44')](_[_0xd425('0x45')](_0x298602[_0xd425('0x3b')],_0x1abf33['filters']),_0x40c392);if(_0x298602['query']['filter']){_0x3275b1[_0xd425('0x46')]=_[_0xd425('0x47')](_0x3275b1[_0xd425('0x46')],{'$or':_[_0xd425('0x34')](_0x40c392,function(_0xa9fd7c){if(_0xa9fd7c[_0xd425('0x38')]!==_0xd425('0x48')){var _0x4b922f={};_0x4b922f[_0xa9fd7c[_0xd425('0x31')]]={'$like':'%'+_0x298602[_0xd425('0x3b')][_0xd425('0x49')]+'%'};return _0x4b922f;}})});}_0x3275b1=_['merge']({},_0x3275b1,_0x298602[_0xd425('0x4a')]);var _0x2dffc7={'where':_0x3275b1[_0xd425('0x46')]};return db['AnalyticMetric'][_0xd425('0x24')](_0x2dffc7)[_0xd425('0x2a')](function(_0x1c5ba6){_0x47405f[_0xd425('0x24')]=_0x1c5ba6;if(_0x298602['query'][_0xd425('0x4b')]){_0x3275b1[_0xd425('0x4c')]=[{'all':!![]}];}return db[_0xd425('0x35')][_0xd425('0x4d')](_0x3275b1);})[_0xd425('0x2a')](function(_0x2f6bf7){_0x47405f[_0xd425('0x4e')]=_0x2f6bf7;return _0x47405f;})['then'](respondWithFilteredResult(_0x3695dd,_0x3275b1))[_0xd425('0x4f')](handleError(_0x3695dd,null));};exports[_0xd425('0x50')]=function(_0x5b65fe,_0x1a44a8){var _0x491c51={'raw':!![],'where':{'id':_0x5b65fe[_0xd425('0x51')]['id']}},_0x5e12bf={};_0x5e12bf['model']=_[_0xd425('0x3c')](db['AnalyticMetric'][_0xd425('0x36')]);_0x5e12bf[_0xd425('0x3b')]=_[_0xd425('0x3c')](_0x5b65fe[_0xd425('0x3b')]);_0x5e12bf[_0xd425('0x44')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],_0x5e12bf['query']);_0x491c51[_0xd425('0x3d')]=_['intersection'](_0x5e12bf[_0xd425('0x3a')],qs[_0xd425('0x3f')](_0x5b65fe[_0xd425('0x3b')][_0xd425('0x3f')]));_0x491c51[_0xd425('0x3d')]=_0x491c51['attributes'][_0xd425('0x40')]?_0x491c51[_0xd425('0x3d')]:_0x5e12bf[_0xd425('0x3a')];if(_0x5b65fe[_0xd425('0x3b')][_0xd425('0x4b')]){_0x491c51['include']=[{'all':!![]}];}_0x491c51=_[_0xd425('0x47')]({},_0x491c51,_0x5b65fe[_0xd425('0x4a')]);return db[_0xd425('0x35')][_0xd425('0x52')](_0x491c51)[_0xd425('0x2a')](handleEntityNotFound(_0x1a44a8,null))[_0xd425('0x2a')](respondWithResult(_0x1a44a8,null))['catch'](handleError(_0x1a44a8,null));};exports[_0xd425('0x53')]=function(_0x128cb3,_0x5bfac6){return db[_0xd425('0x35')][_0xd425('0x53')](_0x128cb3[_0xd425('0x54')],{})[_0xd425('0x2a')](function(_0x5c0219){var _0x54f1d=_0x128cb3[_0xd425('0x55')][_0xd425('0x2b')]({'plain':!![]});if(!_0x54f1d)throw new Error(_0xd425('0x56'));if(_0x54f1d[_0xd425('0x57')]==='user'){var _0x4be6fa=_0x5c0219[_0xd425('0x2b')]({'plain':!![]});var _0x5496d8=_0xd425('0x2c');return db[_0xd425('0x58')]['find']({'where':{'name':_0x5496d8,'userProfileId':_0x54f1d[_0xd425('0x59')]},'raw':!![]})['then'](function(_0x48d5b8){if(_0x48d5b8&&_0x48d5b8[_0xd425('0x5a')]===0x0){return db[_0xd425('0x2d')][_0xd425('0x53')]({'name':_0x4be6fa[_0xd425('0x31')],'resourceId':_0x4be6fa['id'],'type':_0x48d5b8[_0xd425('0x31')],'sectionId':_0x48d5b8['id']},{})[_0xd425('0x2a')](function(){return _0x5c0219;});}else{return _0x5c0219;}})[_0xd425('0x4f')](function(_0x4118fe){logger['error'](_0xd425('0x5b'),_0x4118fe);throw _0x4118fe;});}return _0x5c0219;})[_0xd425('0x2a')](respondWithResult(_0x5bfac6,0xc9))[_0xd425('0x4f')](handleError(_0x5bfac6,null));};exports[_0xd425('0x29')]=function(_0x7b1080,_0x1c80c2){if(_0x7b1080[_0xd425('0x54')]['id']){delete _0x7b1080[_0xd425('0x54')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0x7b1080['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x1c80c2,null))[_0xd425('0x2a')](saveUpdates(_0x7b1080[_0xd425('0x54')],null))[_0xd425('0x2a')](respondWithResult(_0x1c80c2,null))['catch'](handleError(_0x1c80c2,null));};exports['destroy']=function(_0x499a60,_0x5e1294){return db[_0xd425('0x35')][_0xd425('0x52')]({'where':{'id':_0x499a60['params']['id']}})[_0xd425('0x2a')](handleEntityNotFound(_0x5e1294,null))[_0xd425('0x2a')](removeEntity(_0x5e1294,null))[_0xd425('0x4f')](handleError(_0x5e1294,null));};
\ No newline at end of file
+var _0x008c=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','get','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x2d136c,_0x2bd813){var _0x483850=function(_0xec695e){while(--_0xec695e){_0x2d136c['push'](_0x2d136c['shift']());}};_0x483850(++_0x2bd813);}(_0x008c,0x188));var _0xc008=function(_0x48e6f1,_0x1bd3e8){_0x48e6f1=_0x48e6f1-0x0;var _0x154ae1=_0x008c[_0x48e6f1];return _0x154ae1;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){var _0x2e3cfb=_0x58a6ea[_0xc008('0x23')]({'plain':!![]});var _0x5410f5='Metrics';return db['UserProfileResource'][_0xc008('0x22')]({'where':{'type':_0x5410f5,'resourceId':_0x2e3cfb['id']}})[_0xc008('0x21')](function(){return _0x58a6ea;});})[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e2aca,_0x4fce9c){return function(_0x4adbab){if(!_0x4adbab){_0x5e2aca['sendStatus'](0x194);}return _0x4adbab;};}function handleError(_0x3865c0,_0x29ba43){_0x29ba43=_0x29ba43||0x1f4;return function(_0x25eae4){logger['error'](_0x25eae4[_0xc008('0x24')]);if(_0x25eae4[_0xc008('0x25')]){delete _0x25eae4[_0xc008('0x25')];}_0x3865c0[_0xc008('0x19')](_0x29ba43)['send'](_0x25eae4);};}exports[_0xc008('0x26')]=function(_0x2e0b4e,_0x53ed35){var _0x58db82={},_0x539766={},_0x1032b2={'count':0x0,'rows':[]};var _0x267abd=_[_0xc008('0x27')](db[_0xc008('0x28')][_0xc008('0x29')],function(_0xceebc3){return{'name':_0xceebc3[_0xc008('0x2a')],'type':_0xceebc3[_0xc008('0x2b')][_0xc008('0x2c')]};});_0x539766[_0xc008('0x2d')]=_[_0xc008('0x27')](_0x267abd,_0xc008('0x25'));_0x539766['query']=_[_0xc008('0x2e')](_0x2e0b4e[_0xc008('0x2f')]);_0x539766['filters']=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],_0x539766[_0xc008('0x2f')]);_0x58db82[_0xc008('0x31')]=_[_0xc008('0x30')](_0x539766[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x32')]));_0x58db82['attributes']=_0x58db82[_0xc008('0x31')][_0xc008('0x33')]?_0x58db82[_0xc008('0x31')]:_0x539766[_0xc008('0x2d')];if(!_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x34')](_0xc008('0x35'))){_0x58db82['limit']=qs[_0xc008('0x1d')](_0x2e0b4e[_0xc008('0x2f')]['limit']);_0x58db82[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x2e0b4e['query'][_0xc008('0x1b')]);}_0x58db82[_0xc008('0x36')]=qs[_0xc008('0x37')](_0x2e0b4e['query']['sort']);_0x58db82['where']=qs[_0xc008('0x38')](_['pick'](_0x2e0b4e[_0xc008('0x2f')],_0x539766[_0xc008('0x38')]),_0x267abd);if(_0x2e0b4e[_0xc008('0x2f')][_0xc008('0x39')]){_0x58db82[_0xc008('0x3a')]=_[_0xc008('0x3b')](_0x58db82[_0xc008('0x3a')],{'$or':_[_0xc008('0x27')](_0x267abd,function(_0xffd2b3){if(_0xffd2b3[_0xc008('0x2b')]!==_0xc008('0x3c')){var _0xdfca2e={};_0xdfca2e[_0xffd2b3[_0xc008('0x25')]]={'$like':'%'+_0x2e0b4e[_0xc008('0x2f')]['filter']+'%'};return _0xdfca2e;}})});}_0x58db82=_[_0xc008('0x3b')]({},_0x58db82,_0x2e0b4e[_0xc008('0x3d')]);var _0x30b7df={'where':_0x58db82[_0xc008('0x3a')]};return db['AnalyticMetric'][_0xc008('0x1e')](_0x30b7df)[_0xc008('0x21')](function(_0xc8cb91){_0x1032b2[_0xc008('0x1e')]=_0xc8cb91;if(_0x2e0b4e[_0xc008('0x2f')]['includeAll']){_0x58db82[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x28')][_0xc008('0x3f')](_0x58db82);})[_0xc008('0x21')](function(_0x7279e8){_0x1032b2['rows']=_0x7279e8;return _0x1032b2;})[_0xc008('0x21')](respondWithFilteredResult(_0x53ed35,_0x58db82))[_0xc008('0x40')](handleError(_0x53ed35,null));};exports[_0xc008('0x41')]=function(_0x408192,_0x4b80f3){var _0x26cd05={'raw':!![],'where':{'id':_0x408192[_0xc008('0x42')]['id']}},_0xe37446={};_0xe37446['model']=_[_0xc008('0x2e')](db['AnalyticMetric'][_0xc008('0x29')]);_0xe37446['query']=_[_0xc008('0x2e')](_0x408192[_0xc008('0x2f')]);_0xe37446['filters']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],_0xe37446[_0xc008('0x2f')]);_0x26cd05['attributes']=_[_0xc008('0x30')](_0xe37446[_0xc008('0x2d')],qs[_0xc008('0x32')](_0x408192[_0xc008('0x2f')][_0xc008('0x32')]));_0x26cd05[_0xc008('0x31')]=_0x26cd05['attributes']['length']?_0x26cd05['attributes']:_0xe37446[_0xc008('0x2d')];if(_0x408192[_0xc008('0x2f')][_0xc008('0x43')]){_0x26cd05[_0xc008('0x3e')]=[{'all':!![]}];}_0x26cd05=_[_0xc008('0x3b')]({},_0x26cd05,_0x408192[_0xc008('0x3d')]);return db[_0xc008('0x28')][_0xc008('0x44')](_0x26cd05)['then'](handleEntityNotFound(_0x4b80f3,null))['then'](respondWithResult(_0x4b80f3,null))['catch'](handleError(_0x4b80f3,null));};exports[_0xc008('0x45')]=function(_0x2651cf,_0x158eae){return db['AnalyticMetric'][_0xc008('0x45')](_0x2651cf[_0xc008('0x46')],{})[_0xc008('0x21')](function(_0x1c2c50){var _0x4981b4=_0x2651cf[_0xc008('0x47')][_0xc008('0x23')]({'plain':!![]});if(!_0x4981b4)throw new Error(_0xc008('0x48'));if(_0x4981b4[_0xc008('0x49')]===_0xc008('0x47')){var _0x52c444=_0x1c2c50['get']({'plain':!![]});var _0x223056='Metrics';return db[_0xc008('0x4a')][_0xc008('0x44')]({'where':{'name':_0x223056,'userProfileId':_0x4981b4[_0xc008('0x4b')]},'raw':!![]})['then'](function(_0x144ab2){if(_0x144ab2&&_0x144ab2[_0xc008('0x4c')]===0x0){return db[_0xc008('0x4d')][_0xc008('0x45')]({'name':_0x52c444[_0xc008('0x25')],'resourceId':_0x52c444['id'],'type':_0x144ab2['name'],'sectionId':_0x144ab2['id']},{})[_0xc008('0x21')](function(){return _0x1c2c50;});}else{return _0x1c2c50;}})[_0xc008('0x40')](function(_0x4b4c6d){logger[_0xc008('0x4e')](_0xc008('0x4f'),_0x4b4c6d);throw _0x4b4c6d;});}return _0x1c2c50;})['then'](respondWithResult(_0x158eae,0xc9))['catch'](handleError(_0x158eae,null));};exports[_0xc008('0x20')]=function(_0xd47b74,_0x20947b){if(_0xd47b74[_0xc008('0x46')]['id']){delete _0xd47b74[_0xc008('0x46')]['id'];}return db['AnalyticMetric']['find']({'where':{'id':_0xd47b74[_0xc008('0x42')]['id']}})['then'](handleEntityNotFound(_0x20947b,null))[_0xc008('0x21')](saveUpdates(_0xd47b74[_0xc008('0x46')],null))[_0xc008('0x21')](respondWithResult(_0x20947b,null))[_0xc008('0x40')](handleError(_0x20947b,null));};exports[_0xc008('0x22')]=function(_0x27a167,_0x49d8b0){return db[_0xc008('0x28')][_0xc008('0x44')]({'where':{'id':_0x27a167[_0xc008('0x42')]['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x49d8b0,null))[_0xc008('0x21')](removeEntity(_0x49d8b0,null))['catch'](handleError(_0x49d8b0,null));};
\ No newline at end of file
index fa835c5..52bf436 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f6b=['bluebird','path','rimraf','./analyticMetric.attributes','define','analytics_metrics','lodash','util','../../config/logger','moment'];(function(_0x31c3ec,_0x41a015){var _0x319164=function(_0x52c298){while(--_0x52c298){_0x31c3ec['push'](_0x31c3ec['shift']());}};_0x319164(++_0x41a015);}(_0x8f6b,0x146));var _0xb8f6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x8f6b[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xb8f6('0x0'));var util=require(_0xb8f6('0x1'));var logger=require(_0xb8f6('0x2'))('api');var moment=require(_0xb8f6('0x3'));var BPromise=require(_0xb8f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8f6('0x5'));var rimraf=require(_0xb8f6('0x6'));var config=require('../../config/environment');var attributes=require(_0xb8f6('0x7'));module['exports']=function(_0x332ce0,_0x4c73ad){return _0x332ce0[_0xb8f6('0x8')]('AnalyticMetric',attributes,{'tableName':_0xb8f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5785=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','../../config/logger','api','moment'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5785,0x119));var _0x5578=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x5785[_0x1f9f37];return _0x21c080;};'use strict';var _=require(_0x5578('0x0'));var util=require(_0x5578('0x1'));var logger=require(_0x5578('0x2'))(_0x5578('0x3'));var moment=require(_0x5578('0x4'));var BPromise=require('bluebird');var rp=require(_0x5578('0x5'));var fs=require('fs');var path=require(_0x5578('0x6'));var rimraf=require(_0x5578('0x7'));var config=require(_0x5578('0x8'));var attributes=require(_0x5578('0x9'));module[_0x5578('0xa')]=function(_0x35a1f4,_0x1a9d73){return _0x35a1f4[_0x5578('0xb')](_0x5578('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8014eb..27fb5bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0639=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','moment','bluebird'];(function(_0x35b7a3,_0x9e0044){var _0x3be8e4=function(_0x1407ae){while(--_0x1407ae){_0x35b7a3['push'](_0x35b7a3['shift']());}};_0x3be8e4(++_0x9e0044);}(_0x0639,0x173));var _0x9063=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x0639[_0x1b70e3];return _0x1452ab;};'use strict';var _=require(_0x9063('0x0'));var util=require('util');var moment=require(_0x9063('0x1'));var BPromise=require(_0x9063('0x2'));var rs=require(_0x9063('0x3'));var fs=require('fs');var Redis=require(_0x9063('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9063('0x5'));var logger=require(_0x9063('0x6'))(_0x9063('0x7'));var config=require(_0x9063('0x8'));var jayson=require(_0x9063('0x9'));var client=jayson[_0x9063('0xa')][_0x9063('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x582d15,_0x46bc11,_0x34398d){return new BPromise(function(_0x1b1940,_0x5b1cd5){return client[_0x9063('0xc')](_0x582d15,_0x34398d)['then'](function(_0x23bcdc){logger[_0x9063('0xd')](_0x9063('0xe'),_0x46bc11,_0x9063('0xf'));logger[_0x9063('0x10')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x46bc11,_0x9063('0xf'),JSON[_0x9063('0x11')](_0x23bcdc));if(_0x23bcdc['error']){if(_0x23bcdc['error'][_0x9063('0x12')]===0x1f4){logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);return _0x5b1cd5(_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);}logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x23bcdc[_0x9063('0x13')][_0x9063('0x14')]);return _0x1b1940(_0x23bcdc['error'][_0x9063('0x14')]);}else{logger['info'](_0x9063('0xe'),_0x46bc11,_0x9063('0xf'));_0x1b1940(_0x23bcdc['result'][_0x9063('0x14')]);}})[_0x9063('0x15')](function(_0x29c1bf){logger[_0x9063('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x46bc11,_0x29c1bf);_0x5b1cd5(_0x29c1bf);});});}
\ No newline at end of file
+var _0xd289=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x11c361,_0x4f5b42){var _0x1f5355=function(_0x259200){while(--_0x259200){_0x11c361['push'](_0x11c361['shift']());}};_0x1f5355(++_0x4f5b42);}(_0xd289,0x123));var _0x9d28=function(_0x2e78db,_0x5ab8a1){_0x2e78db=_0x2e78db-0x0;var _0x195fb4=_0xd289[_0x2e78db];return _0x195fb4;};'use strict';var _=require(_0x9d28('0x0'));var util=require(_0x9d28('0x1'));var moment=require(_0x9d28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d28('0x3'));var db=require(_0x9d28('0x4'))['db'];var utils=require(_0x9d28('0x5'));var logger=require('../../config/logger')(_0x9d28('0x6'));var config=require(_0x9d28('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d28('0x8')][_0x9d28('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43e67c,_0x57c717,_0x504f45){return new BPromise(function(_0x125afb,_0x372542){return client[_0x9d28('0xa')](_0x43e67c,_0x504f45)[_0x9d28('0xb')](function(_0x1cbe67){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x57c717,_0x9d28('0xc'));logger[_0x9d28('0xd')](_0x9d28('0xe'),_0x57c717,_0x9d28('0xc'),JSON[_0x9d28('0xf')](_0x1cbe67));if(_0x1cbe67[_0x9d28('0x10')]){if(_0x1cbe67[_0x9d28('0x10')]['code']===0x1f4){logger[_0x9d28('0x10')](_0x9d28('0x11'),_0x57c717,_0x1cbe67['error'][_0x9d28('0x12')]);return _0x372542(_0x1cbe67['error']['message']);}logger[_0x9d28('0x10')](_0x9d28('0x11'),_0x57c717,_0x1cbe67[_0x9d28('0x10')][_0x9d28('0x12')]);return _0x125afb(_0x1cbe67[_0x9d28('0x10')][_0x9d28('0x12')]);}else{logger[_0x9d28('0x13')](_0x9d28('0x11'),_0x57c717,'request\x20sent');_0x125afb(_0x1cbe67[_0x9d28('0x14')]['message']);}})['catch'](function(_0x545b3b){logger['error'](_0x9d28('0x11'),_0x57c717,_0x545b3b);_0x372542(_0x545b3b);});});}
\ No newline at end of file
index e89adc8..f3d81df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf842=['isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x47878f,_0x48d3bf){var _0x4b05b8=function(_0x3d6597){while(--_0x3d6597){_0x47878f['push'](_0x47878f['shift']());}};_0x4b05b8(++_0x48d3bf);}(_0xf842,0x172));var _0x2f84=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0xf842[_0x1fa759];return _0x2da9f4;};'use strict';var multer=require(_0x2f84('0x0'));var util=require(_0x2f84('0x1'));var path=require(_0x2f84('0x2'));var timeout=require(_0x2f84('0x3'));var express=require('express');var router=express[_0x2f84('0x4')]();var fs_extra=require(_0x2f84('0x5'));var auth=require(_0x2f84('0x6'));var interaction=require(_0x2f84('0x7'));var config=require(_0x2f84('0x8'));var controller=require('./analyticMetric.controller');router[_0x2f84('0x9')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xb')]);router['get'](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0xd')]);router[_0x2f84('0xe')]('/',auth[_0x2f84('0xa')](),controller[_0x2f84('0xf')]);router[_0x2f84('0x10')](_0x2f84('0xc'),auth[_0x2f84('0xa')](),controller[_0x2f84('0x11')]);router['delete'](_0x2f84('0xc'),auth['isAuthenticated'](),controller[_0x2f84('0x12')]);module[_0x2f84('0x13')]=router;
\ No newline at end of file
+var _0x07d7=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x349942,_0xaf2dc4){var _0x40a55b=function(_0x460e5c){while(--_0x460e5c){_0x349942['push'](_0x349942['shift']());}};_0x40a55b(++_0xaf2dc4);}(_0x07d7,0x85));var _0x707d=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x07d7[_0x1fcaf1];return _0x55f464;};'use strict';var multer=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var path=require(_0x707d('0x2'));var timeout=require(_0x707d('0x3'));var express=require(_0x707d('0x4'));var router=express[_0x707d('0x5')]();var fs_extra=require(_0x707d('0x6'));var auth=require(_0x707d('0x7'));var interaction=require(_0x707d('0x8'));var config=require(_0x707d('0x9'));var controller=require(_0x707d('0xa'));router[_0x707d('0xb')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0xd')]);router[_0x707d('0xb')](_0x707d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x707d('0xf')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0x10')]);router[_0x707d('0x11')](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x12')]);router[_0x707d('0x13')](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x14')]);module[_0x707d('0x15')]=router;
\ No newline at end of file
index 83897c8..c52194e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83bd=['sequelize','TEXT'];(function(_0x55e537,_0x464d61){var _0x2dbbe1=function(_0x158d9f){while(--_0x158d9f){_0x55e537['push'](_0x55e537['shift']());}};_0x2dbbe1(++_0x464d61);}(_0x83bd,0x160));var _0xd83b=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x83bd[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0xd83b('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd83b('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xb50a=['sequelize'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0xb50a,0x105));var _0xab50=function(_0x3eddab,_0x2179e6){_0x3eddab=_0x3eddab-0x0;var _0x2c6877=_0xb50a[_0x3eddab];return _0x2c6877;};'use strict';var Sequelize=require(_0xab50('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
index f07deb7..17933e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa784=['reject','save','update','then','destroy','sendStatus','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','include','includeAll','options','find','catch','create','body','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x2bea18,_0x4aee7d){var _0x1d5d79=function(_0x3af13f){while(--_0x3af13f){_0x2bea18['push'](_0x2bea18['shift']());}};_0x1d5d79(++_0x4aee7d);}(_0xa784,0x149));var _0x4a78=function(_0x5898d5,_0x316204){_0x5898d5=_0x5898d5-0x0;var _0x2b3c4e=_0xa784[_0x5898d5];return _0x2b3c4e;};'use strict';var emlformat=require(_0x4a78('0x0'));var rimraf=require(_0x4a78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a78('0x2'));var rp=require('request-promise');var moment=require(_0x4a78('0x3'));var BPromise=require(_0x4a78('0x4'));var Mustache=require(_0x4a78('0x5'));var util=require(_0x4a78('0x6'));var path=require(_0x4a78('0x7'));var sox=require(_0x4a78('0x8'));var csv=require(_0x4a78('0x9'));var ejs=require(_0x4a78('0xa'));var fs=require('fs');var fs_extra=require(_0x4a78('0xb'));var _=require(_0x4a78('0xc'));var squel=require(_0x4a78('0xd'));var crypto=require(_0x4a78('0xe'));var jsforce=require(_0x4a78('0xf'));var deskjs=require(_0x4a78('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4a78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4a78('0x12'));var as=require(_0x4a78('0x13'));var hardwareService=require(_0x4a78('0x14'));var logger=require(_0x4a78('0x15'))(_0x4a78('0x16'));var utils=require('../../config/utils');var config=require(_0x4a78('0x17'));var licenseUtil=require(_0x4a78('0x18'));var db=require(_0x4a78('0x19'))['db'];function respondWithStatusCode(_0x25f65b,_0x2eaf72){_0x2eaf72=_0x2eaf72||0xcc;return function(_0xfa8ff3){if(_0xfa8ff3){return _0x25f65b['sendStatus'](_0x2eaf72);}return _0x25f65b['status'](_0x2eaf72)[_0x4a78('0x1a')]();};}function respondWithResult(_0x1fa64e,_0x2686dd){_0x2686dd=_0x2686dd||0xc8;return function(_0x384964){if(_0x384964){return _0x1fa64e[_0x4a78('0x1b')](_0x2686dd)[_0x4a78('0x1c')](_0x384964);}};}function respondWithFilteredResult(_0x90a53e,_0x2dd995){return function(_0x564fdd){if(_0x564fdd){var _0xaba8eb=typeof _0x2dd995[_0x4a78('0x1d')]===_0x4a78('0x1e')&&typeof _0x2dd995['limit']===_0x4a78('0x1e');var _0x272b0e=_0x564fdd[_0x4a78('0x1f')];var _0x3796da=_0xaba8eb?0x0:_0x2dd995[_0x4a78('0x1d')];var _0x5c7ae8=_0xaba8eb?_0x564fdd['count']:_0x2dd995['offset']+_0x2dd995[_0x4a78('0x20')];var _0x947a0;if(_0x5c7ae8>=_0x272b0e){_0x5c7ae8=_0x272b0e;_0x947a0=0xc8;}else{_0x947a0=0xce;}_0x90a53e['status'](_0x947a0);return _0x90a53e[_0x4a78('0x21')](_0x4a78('0x22'),_0x3796da+'-'+_0x5c7ae8+'/'+_0x272b0e)[_0x4a78('0x1c')](_0x564fdd);}return null;};}function patchUpdates(_0x453d3b){return function(_0xe181fc){try{jsonpatch[_0x4a78('0x23')](_0xe181fc,_0x453d3b,!![]);}catch(_0x3c09ab){return BPromise[_0x4a78('0x24')](_0x3c09ab);}return _0xe181fc[_0x4a78('0x25')]();};}function saveUpdates(_0x1e15c0,_0x42d77d){return function(_0x1ba18c){if(_0x1ba18c){return _0x1ba18c[_0x4a78('0x26')](_0x1e15c0)[_0x4a78('0x27')](function(_0x1f6079){return _0x1f6079;});}return null;};}function removeEntity(_0x5e1314,_0x26dfe7){return function(_0x2f7019){if(_0x2f7019){return _0x2f7019[_0x4a78('0x28')]()[_0x4a78('0x27')](function(){_0x5e1314[_0x4a78('0x1b')](0xcc)[_0x4a78('0x1a')]();});}};}function handleEntityNotFound(_0x366a1f,_0x1011bf){return function(_0xe5c85e){if(!_0xe5c85e){_0x366a1f[_0x4a78('0x29')](0x194);}return _0xe5c85e;};}function handleError(_0x3f8925,_0x56d7f7){_0x56d7f7=_0x56d7f7||0x1f4;return function(_0x3c9985){logger['error'](_0x3c9985[_0x4a78('0x2a')]);if(_0x3c9985[_0x4a78('0x2b')]){delete _0x3c9985['name'];}_0x3f8925[_0x4a78('0x1b')](_0x56d7f7)[_0x4a78('0x2c')](_0x3c9985);};}exports['index']=function(_0x4ce339,_0x12ae8c){var _0x43f3ab={},_0x218202={},_0x550d83={'count':0x0,'rows':[]};var _0x2b856c=_[_0x4a78('0x2d')](db[_0x4a78('0x2e')][_0x4a78('0x2f')],function(_0x4693ac){return{'name':_0x4693ac[_0x4a78('0x30')],'type':_0x4693ac[_0x4a78('0x31')][_0x4a78('0x32')]};});_0x218202[_0x4a78('0x33')]=_['map'](_0x2b856c,_0x4a78('0x2b'));_0x218202[_0x4a78('0x34')]=_[_0x4a78('0x35')](_0x4ce339[_0x4a78('0x34')]);_0x218202[_0x4a78('0x36')]=_[_0x4a78('0x37')](_0x218202['model'],_0x218202[_0x4a78('0x34')]);_0x43f3ab[_0x4a78('0x38')]=_[_0x4a78('0x37')](_0x218202[_0x4a78('0x33')],qs[_0x4a78('0x39')](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x39')]));_0x43f3ab[_0x4a78('0x38')]=_0x43f3ab['attributes'][_0x4a78('0x3a')]?_0x43f3ab[_0x4a78('0x38')]:_0x218202['model'];if(!_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3b')]('nolimit')){_0x43f3ab[_0x4a78('0x20')]=qs['limit'](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x20')]);_0x43f3ab[_0x4a78('0x1d')]=qs['offset'](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x1d')]);}_0x43f3ab[_0x4a78('0x3c')]=qs[_0x4a78('0x3d')](_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3d')]);_0x43f3ab[_0x4a78('0x3e')]=qs['filters'](_['pick'](_0x4ce339['query'],_0x218202['filters']),_0x2b856c);if(_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3f')]){_0x43f3ab[_0x4a78('0x3e')]=_[_0x4a78('0x40')](_0x43f3ab[_0x4a78('0x3e')],{'$or':_[_0x4a78('0x2d')](_0x2b856c,function(_0x2a4af6){if(_0x2a4af6[_0x4a78('0x31')]!=='VIRTUAL'){var _0x1ec030={};_0x1ec030[_0x2a4af6[_0x4a78('0x2b')]]={'$like':'%'+_0x4ce339[_0x4a78('0x34')][_0x4a78('0x3f')]+'%'};return _0x1ec030;}})});}_0x43f3ab=_[_0x4a78('0x40')]({},_0x43f3ab,_0x4ce339['options']);var _0xf6fac6={'where':_0x43f3ab[_0x4a78('0x3e')]};return db[_0x4a78('0x2e')][_0x4a78('0x1f')](_0xf6fac6)[_0x4a78('0x27')](function(_0x5a28b0){_0x550d83['count']=_0x5a28b0;if(_0x4ce339[_0x4a78('0x34')]['includeAll']){_0x43f3ab[_0x4a78('0x41')]=[{'all':!![]}];}return db[_0x4a78('0x2e')]['findAll'](_0x43f3ab);})[_0x4a78('0x27')](function(_0xc54919){_0x550d83['rows']=_0xc54919;return _0x550d83;})[_0x4a78('0x27')](respondWithFilteredResult(_0x12ae8c,_0x43f3ab))['catch'](handleError(_0x12ae8c,null));};exports['show']=function(_0x1a9bd2,_0x2ac901){var _0x31bfdf={'raw':!![],'where':{'id':_0x1a9bd2['params']['id']}},_0x1a89cd={};_0x1a89cd[_0x4a78('0x33')]=_['keys'](db[_0x4a78('0x2e')][_0x4a78('0x2f')]);_0x1a89cd[_0x4a78('0x34')]=_[_0x4a78('0x35')](_0x1a9bd2[_0x4a78('0x34')]);_0x1a89cd[_0x4a78('0x36')]=_[_0x4a78('0x37')](_0x1a89cd[_0x4a78('0x33')],_0x1a89cd[_0x4a78('0x34')]);_0x31bfdf['attributes']=_[_0x4a78('0x37')](_0x1a89cd[_0x4a78('0x33')],qs[_0x4a78('0x39')](_0x1a9bd2['query'][_0x4a78('0x39')]));_0x31bfdf[_0x4a78('0x38')]=_0x31bfdf[_0x4a78('0x38')][_0x4a78('0x3a')]?_0x31bfdf[_0x4a78('0x38')]:_0x1a89cd[_0x4a78('0x33')];if(_0x1a9bd2[_0x4a78('0x34')][_0x4a78('0x42')]){_0x31bfdf[_0x4a78('0x41')]=[{'all':!![]}];}_0x31bfdf=_[_0x4a78('0x40')]({},_0x31bfdf,_0x1a9bd2[_0x4a78('0x43')]);return db[_0x4a78('0x2e')][_0x4a78('0x44')](_0x31bfdf)[_0x4a78('0x27')](handleEntityNotFound(_0x2ac901,null))[_0x4a78('0x27')](respondWithResult(_0x2ac901,null))[_0x4a78('0x45')](handleError(_0x2ac901,null));};exports[_0x4a78('0x46')]=function(_0x174133,_0x1a4d1f){return db['AnalyticTreeReport'][_0x4a78('0x46')](_0x174133[_0x4a78('0x47')],{})['then'](respondWithResult(_0x1a4d1f,0xc9))[_0x4a78('0x45')](handleError(_0x1a4d1f,null));};exports[_0x4a78('0x26')]=function(_0x5df4bc,_0x5c5e05){if(_0x5df4bc[_0x4a78('0x47')]['id']){delete _0x5df4bc['body']['id'];}return db[_0x4a78('0x2e')][_0x4a78('0x44')]({'where':{'id':_0x5df4bc['params']['id']}})['then'](handleEntityNotFound(_0x5c5e05,null))[_0x4a78('0x27')](saveUpdates(_0x5df4bc[_0x4a78('0x47')],null))[_0x4a78('0x27')](respondWithResult(_0x5c5e05,null))[_0x4a78('0x45')](handleError(_0x5c5e05,null));};exports['destroy']=function(_0x2d96e7,_0x264751){return db[_0x4a78('0x2e')][_0x4a78('0x44')]({'where':{'id':_0x2d96e7[_0x4a78('0x48')]['id']}})['then'](handleEntityNotFound(_0x264751,null))[_0x4a78('0x27')](removeEntity(_0x264751,null))[_0x4a78('0x45')](handleError(_0x264751,null));};
\ No newline at end of file
+var _0x73fc=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','sendStatus','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x73fc,0x115));var _0xc73f=function(_0x4d30ce,_0x2b0b62){_0x4d30ce=_0x4d30ce-0x0;var _0xe8d9cc=_0x73fc[_0x4d30ce];return _0xe8d9cc;};'use strict';var emlformat=require(_0xc73f('0x0'));var rimraf=require(_0xc73f('0x1'));var zipdir=require(_0xc73f('0x2'));var jsonpatch=require(_0xc73f('0x3'));var rp=require(_0xc73f('0x4'));var moment=require(_0xc73f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc73f('0x6'));var path=require(_0xc73f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc73f('0x8'));var fs=require('fs');var fs_extra=require(_0xc73f('0x9'));var _=require(_0xc73f('0xa'));var squel=require(_0xc73f('0xb'));var crypto=require('crypto');var jsforce=require(_0xc73f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc73f('0xd'));var querystring=require(_0xc73f('0xe'));var Papa=require(_0xc73f('0xf'));var Redis=require(_0xc73f('0x10'));var authService=require(_0xc73f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc73f('0x12'));var hardwareService=require(_0xc73f('0x13'));var logger=require(_0xc73f('0x14'))(_0xc73f('0x15'));var utils=require(_0xc73f('0x16'));var config=require(_0xc73f('0x17'));var licenseUtil=require(_0xc73f('0x18'));var db=require(_0xc73f('0x19'))['db'];function respondWithStatusCode(_0x3c1b7a,_0x55fbf7){_0x55fbf7=_0x55fbf7||0xcc;return function(_0x4be378){if(_0x4be378){return _0x3c1b7a['sendStatus'](_0x55fbf7);}return _0x3c1b7a[_0xc73f('0x1a')](_0x55fbf7)[_0xc73f('0x1b')]();};}function respondWithResult(_0x291334,_0x52bb88){_0x52bb88=_0x52bb88||0xc8;return function(_0x36d3ba){if(_0x36d3ba){return _0x291334[_0xc73f('0x1a')](_0x52bb88)[_0xc73f('0x1c')](_0x36d3ba);}};}function respondWithFilteredResult(_0x2bdf0b,_0x1640d4){return function(_0x5f52de){if(_0x5f52de){var _0x2e55db=typeof _0x1640d4[_0xc73f('0x1d')]==='undefined'&&typeof _0x1640d4[_0xc73f('0x1e')]===_0xc73f('0x1f');var _0x4955ca=_0x5f52de[_0xc73f('0x20')];var _0x6b7fb8=_0x2e55db?0x0:_0x1640d4[_0xc73f('0x1d')];var _0x21345b=_0x2e55db?_0x5f52de['count']:_0x1640d4[_0xc73f('0x1d')]+_0x1640d4[_0xc73f('0x1e')];var _0x3133a8;if(_0x21345b>=_0x4955ca){_0x21345b=_0x4955ca;_0x3133a8=0xc8;}else{_0x3133a8=0xce;}_0x2bdf0b[_0xc73f('0x1a')](_0x3133a8);return _0x2bdf0b[_0xc73f('0x21')]('Content-Range',_0x6b7fb8+'-'+_0x21345b+'/'+_0x4955ca)[_0xc73f('0x1c')](_0x5f52de);}return null;};}function patchUpdates(_0x385c0b){return function(_0x4b5f70){try{jsonpatch[_0xc73f('0x22')](_0x4b5f70,_0x385c0b,!![]);}catch(_0xeddbf5){return BPromise['reject'](_0xeddbf5);}return _0x4b5f70[_0xc73f('0x23')]();};}function saveUpdates(_0x37c418,_0x3f25d2){return function(_0x4c4818){if(_0x4c4818){return _0x4c4818[_0xc73f('0x24')](_0x37c418)[_0xc73f('0x25')](function(_0x50a1b5){return _0x50a1b5;});}return null;};}function removeEntity(_0x2abecf,_0x3242fe){return function(_0x48b2a2){if(_0x48b2a2){return _0x48b2a2[_0xc73f('0x26')]()[_0xc73f('0x25')](function(){_0x2abecf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x154be0,_0x399193){return function(_0x3fc8d1){if(!_0x3fc8d1){_0x154be0[_0xc73f('0x27')](0x194);}return _0x3fc8d1;};}function handleError(_0x43e0bb,_0x13bfbb){_0x13bfbb=_0x13bfbb||0x1f4;return function(_0x293bfd){logger['error'](_0x293bfd['stack']);if(_0x293bfd[_0xc73f('0x28')]){delete _0x293bfd[_0xc73f('0x28')];}_0x43e0bb[_0xc73f('0x1a')](_0x13bfbb)['send'](_0x293bfd);};}exports[_0xc73f('0x29')]=function(_0x228fb5,_0x529fd1){var _0x8c873d={},_0x404620={},_0x4f247e={'count':0x0,'rows':[]};var _0x2bcfa6=_[_0xc73f('0x2a')](db['AnalyticTreeReport'][_0xc73f('0x2b')],function(_0x15d8b9){return{'name':_0x15d8b9[_0xc73f('0x2c')],'type':_0x15d8b9['type']['key']};});_0x404620[_0xc73f('0x2d')]=_[_0xc73f('0x2a')](_0x2bcfa6,_0xc73f('0x28'));_0x404620[_0xc73f('0x2e')]=_[_0xc73f('0x2f')](_0x228fb5['query']);_0x404620[_0xc73f('0x30')]=_[_0xc73f('0x31')](_0x404620[_0xc73f('0x2d')],_0x404620[_0xc73f('0x2e')]);_0x8c873d[_0xc73f('0x32')]=_[_0xc73f('0x31')](_0x404620[_0xc73f('0x2d')],qs[_0xc73f('0x33')](_0x228fb5['query'][_0xc73f('0x33')]));_0x8c873d[_0xc73f('0x32')]=_0x8c873d['attributes']['length']?_0x8c873d[_0xc73f('0x32')]:_0x404620[_0xc73f('0x2d')];if(!_0x228fb5['query'][_0xc73f('0x34')](_0xc73f('0x35'))){_0x8c873d[_0xc73f('0x1e')]=qs[_0xc73f('0x1e')](_0x228fb5[_0xc73f('0x2e')]['limit']);_0x8c873d[_0xc73f('0x1d')]=qs['offset'](_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x1d')]);}_0x8c873d['order']=qs['sort'](_0x228fb5['query'][_0xc73f('0x36')]);_0x8c873d[_0xc73f('0x37')]=qs[_0xc73f('0x30')](_[_0xc73f('0x38')](_0x228fb5[_0xc73f('0x2e')],_0x404620[_0xc73f('0x30')]),_0x2bcfa6);if(_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x39')]){_0x8c873d[_0xc73f('0x37')]=_[_0xc73f('0x3a')](_0x8c873d[_0xc73f('0x37')],{'$or':_['map'](_0x2bcfa6,function(_0x16cfbe){if(_0x16cfbe[_0xc73f('0x3b')]!==_0xc73f('0x3c')){var _0x4bdd75={};_0x4bdd75[_0x16cfbe[_0xc73f('0x28')]]={'$like':'%'+_0x228fb5['query'][_0xc73f('0x39')]+'%'};return _0x4bdd75;}})});}_0x8c873d=_['merge']({},_0x8c873d,_0x228fb5[_0xc73f('0x3d')]);var _0x314f95={'where':_0x8c873d[_0xc73f('0x37')]};return db[_0xc73f('0x3e')][_0xc73f('0x20')](_0x314f95)[_0xc73f('0x25')](function(_0x781c62){_0x4f247e['count']=_0x781c62;if(_0x228fb5[_0xc73f('0x2e')][_0xc73f('0x3f')]){_0x8c873d[_0xc73f('0x40')]=[{'all':!![]}];}return db[_0xc73f('0x3e')]['findAll'](_0x8c873d);})[_0xc73f('0x25')](function(_0x50baf4){_0x4f247e[_0xc73f('0x41')]=_0x50baf4;return _0x4f247e;})['then'](respondWithFilteredResult(_0x529fd1,_0x8c873d))[_0xc73f('0x42')](handleError(_0x529fd1,null));};exports[_0xc73f('0x43')]=function(_0x397f3d,_0x45613f){var _0x2aa746={'raw':!![],'where':{'id':_0x397f3d[_0xc73f('0x44')]['id']}},_0x42a770={};_0x42a770['model']=_[_0xc73f('0x2f')](db[_0xc73f('0x3e')][_0xc73f('0x2b')]);_0x42a770[_0xc73f('0x2e')]=_[_0xc73f('0x2f')](_0x397f3d[_0xc73f('0x2e')]);_0x42a770[_0xc73f('0x30')]=_['intersection'](_0x42a770[_0xc73f('0x2d')],_0x42a770[_0xc73f('0x2e')]);_0x2aa746[_0xc73f('0x32')]=_[_0xc73f('0x31')](_0x42a770['model'],qs[_0xc73f('0x33')](_0x397f3d[_0xc73f('0x2e')][_0xc73f('0x33')]));_0x2aa746[_0xc73f('0x32')]=_0x2aa746[_0xc73f('0x32')][_0xc73f('0x45')]?_0x2aa746[_0xc73f('0x32')]:_0x42a770[_0xc73f('0x2d')];if(_0x397f3d[_0xc73f('0x2e')][_0xc73f('0x3f')]){_0x2aa746[_0xc73f('0x40')]=[{'all':!![]}];}_0x2aa746=_[_0xc73f('0x3a')]({},_0x2aa746,_0x397f3d[_0xc73f('0x3d')]);return db[_0xc73f('0x3e')][_0xc73f('0x46')](_0x2aa746)['then'](handleEntityNotFound(_0x45613f,null))[_0xc73f('0x25')](respondWithResult(_0x45613f,null))[_0xc73f('0x42')](handleError(_0x45613f,null));};exports['create']=function(_0x5e43f2,_0x509bcd){return db['AnalyticTreeReport'][_0xc73f('0x47')](_0x5e43f2['body'],{})[_0xc73f('0x25')](respondWithResult(_0x509bcd,0xc9))['catch'](handleError(_0x509bcd,null));};exports[_0xc73f('0x24')]=function(_0x3db903,_0xf8a2aa){if(_0x3db903[_0xc73f('0x48')]['id']){delete _0x3db903[_0xc73f('0x48')]['id'];}return db[_0xc73f('0x3e')][_0xc73f('0x46')]({'where':{'id':_0x3db903['params']['id']}})['then'](handleEntityNotFound(_0xf8a2aa,null))['then'](saveUpdates(_0x3db903[_0xc73f('0x48')],null))[_0xc73f('0x25')](respondWithResult(_0xf8a2aa,null))['catch'](handleError(_0xf8a2aa,null));};exports['destroy']=function(_0x15d8b4,_0x16f742){return db[_0xc73f('0x3e')][_0xc73f('0x46')]({'where':{'id':_0x15d8b4[_0xc73f('0x44')]['id']}})[_0xc73f('0x25')](handleEntityNotFound(_0x16f742,null))[_0xc73f('0x25')](removeEntity(_0x16f742,null))[_0xc73f('0x42')](handleError(_0x16f742,null));};
\ No newline at end of file
index ce46b89..fb2ae5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd68=['analytics_report_trees','util','../../config/logger','api','moment','bluebird','path','rimraf','define','AnalyticTreeReport'];(function(_0x2c505a,_0x3f7365){var _0x436bfb=function(_0x5863dc){while(--_0x5863dc){_0x2c505a['push'](_0x2c505a['shift']());}};_0x436bfb(++_0x3f7365);}(_0xdd68,0x119));var _0x8dd6=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xdd68[_0xee3051];return _0x139e81;};'use strict';var _=require('lodash');var util=require(_0x8dd6('0x0'));var logger=require(_0x8dd6('0x1'))(_0x8dd6('0x2'));var moment=require(_0x8dd6('0x3'));var BPromise=require(_0x8dd6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dd6('0x5'));var rimraf=require(_0x8dd6('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x20580a,_0x331c3c){return _0x20580a[_0x8dd6('0x7')](_0x8dd6('0x8'),attributes,{'tableName':_0x8dd6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4975=['path','rimraf','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3690df,_0x4c761c){var _0x17b3ca=function(_0x274924){while(--_0x274924){_0x3690df['push'](_0x3690df['shift']());}};_0x17b3ca(++_0x4c761c);}(_0x4975,0x1f2));var _0x5497=function(_0x3d51bf,_0x28ee2a){_0x3d51bf=_0x3d51bf-0x0;var _0x42c7f8=_0x4975[_0x3d51bf];return _0x42c7f8;};'use strict';var _=require(_0x5497('0x0'));var util=require(_0x5497('0x1'));var logger=require('../../config/logger')(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x5497('0x8')]=function(_0x37677a,_0x4a640c){return _0x37677a[_0x5497('0x9')](_0x5497('0xa'),attributes,{'tableName':_0x5497('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c9b6b0e..1c250b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x398dd5,_0x2c8907){_0x398dd5=_0x398dd5-0x0;var _0x4f8b53=_0x7a54[_0x398dd5];return _0x4f8b53;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x28015a,_0x37d2d7){var _0x43bbd5=function(_0x146b86){while(--_0x146b86){_0x28015a['push'](_0x28015a['shift']());}};_0x43bbd5(++_0x37d2d7);}(_0x2ef3,0xba));var _0x32ef=function(_0x23da12,_0x11c25a){_0x23da12=_0x23da12-0x0;var _0x1d524b=_0x2ef3[_0x23da12];return _0x1d524b;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index 8e6b97f..f8dd109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f6f=['post','create','put','update','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','index','get','/:id','isAuthenticated','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f6f,0x1a4));var _0xf9f6=function(_0x1af82a,_0x57001c){_0x1af82a=_0x1af82a-0x0;var _0x37220d=_0x9f6f[_0x1af82a];return _0x37220d;};'use strict';var multer=require(_0xf9f6('0x0'));var util=require(_0xf9f6('0x1'));var path=require('path');var timeout=require(_0xf9f6('0x2'));var express=require(_0xf9f6('0x3'));var router=express[_0xf9f6('0x4')]();var fs_extra=require(_0xf9f6('0x5'));var auth=require(_0xf9f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticTreeReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf9f6('0x7')]);router[_0xf9f6('0x8')](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller[_0xf9f6('0xb')]);router[_0xf9f6('0xc')]('/',auth['isAuthenticated'](),controller[_0xf9f6('0xd')]);router[_0xf9f6('0xe')](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller[_0xf9f6('0xf')]);router['delete'](_0xf9f6('0x9'),auth[_0xf9f6('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5e74=['update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','post'];(function(_0x222954,_0x16f849){var _0x28a79d=function(_0x21bc82){while(--_0x21bc82){_0x222954['push'](_0x222954['shift']());}};_0x28a79d(++_0x16f849);}(_0x5e74,0xbe));var _0x45e7=function(_0x3b889b,_0x276cd3){_0x3b889b=_0x3b889b-0x0;var _0xf1b31a=_0x5e74[_0x3b889b];return _0xf1b31a;};'use strict';var multer=require(_0x45e7('0x0'));var util=require(_0x45e7('0x1'));var path=require(_0x45e7('0x2'));var timeout=require('connect-timeout');var express=require(_0x45e7('0x3'));var router=express[_0x45e7('0x4')]();var fs_extra=require(_0x45e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var controller=require(_0x45e7('0x8'));router[_0x45e7('0x9')]('/',auth['isAuthenticated'](),controller[_0x45e7('0xa')]);router[_0x45e7('0x9')](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller['show']);router[_0x45e7('0xd')]('/',auth[_0x45e7('0xc')](),controller['create']);router['put'](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller[_0x45e7('0xe')]);router[_0x45e7('0xf')](_0x45e7('0xb'),auth[_0x45e7('0xc')](),controller['destroy']);module[_0x45e7('0x10')]=router;
\ No newline at end of file
index 41abb77..8d37f1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x864a=['sequelize','exports','STRING'];(function(_0x4b72f7,_0x5bc45d){var _0x4f3fb0=function(_0x44762e){while(--_0x44762e){_0x4b72f7['push'](_0x4b72f7['shift']());}};_0x4f3fb0(++_0x5bc45d);}(_0x864a,0x8a));var _0xa864=function(_0x274887,_0x929096){_0x274887=_0x274887-0x0;var _0x2c992e=_0x864a[_0x274887];return _0x2c992e;};'use strict';var Sequelize=require(_0xa864('0x0'));module[_0xa864('0x1')]={'name':{'type':Sequelize[_0xa864('0x2')]},'basename':{'type':Sequelize[_0xa864('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4156=['STRING','sequelize','exports'];(function(_0x46be5f,_0x170cab){var _0x192673=function(_0x304b3b){while(--_0x304b3b){_0x46be5f['push'](_0x46be5f['shift']());}};_0x192673(++_0x170cab);}(_0x4156,0xf1));var _0x6415=function(_0xc0ca5e,_0x531c0c){_0xc0ca5e=_0xc0ca5e-0x0;var _0x1d6bde=_0x4156[_0xc0ca5e];return _0x1d6bde;};'use strict';var Sequelize=require(_0x6415('0x0'));module[_0x6415('0x1')]={'name':{'type':Sequelize[_0x6415('0x2')]},'basename':{'type':Sequelize[_0x6415('0x2')]},'type':{'type':Sequelize[_0x6415('0x2')]}};
\ No newline at end of file
index d8d66ec..617518f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d97=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','rawAttributes','include','find','catch','get','omit','updatedAt','body','createdAt','file','filename','type','mimetype','create','download','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','moment','mustache','util','path','ejs','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','offset','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','Attachment','key','model','query','intersection','fields','attributes'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x4d97,0x77));var _0x74d9=function(_0xe64add,_0x513eec){_0xe64add=_0xe64add-0x0;var _0x3af097=_0x4d97[_0xe64add];return _0x3af097;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74d9('0x0'));var zipdir=require(_0x74d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x74d9('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x74d9('0x3'));var util=require(_0x74d9('0x4'));var path=require(_0x74d9('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74d9('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x74d9('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x74d9('0x8'));var toCsv=require(_0x74d9('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x74d9('0xa'));var authService=require(_0x74d9('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x74d9('0xc'));var hardwareService=require(_0x74d9('0xd'));var logger=require(_0x74d9('0xe'))(_0x74d9('0xf'));var utils=require(_0x74d9('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x74d9('0x11'));var db=require(_0x74d9('0x12'))['db'];function respondWithStatusCode(_0x8f6f40,_0x5aa494){_0x5aa494=_0x5aa494||0xcc;return function(_0x572614){if(_0x572614){return _0x8f6f40['sendStatus'](_0x5aa494);}return _0x8f6f40['status'](_0x5aa494)[_0x74d9('0x13')]();};}function respondWithResult(_0xc92a25,_0x2a72b5){_0x2a72b5=_0x2a72b5||0xc8;return function(_0x2d238a){if(_0x2d238a){return _0xc92a25[_0x74d9('0x14')](_0x2a72b5)['json'](_0x2d238a);}};}function respondWithFilteredResult(_0x53aaa7,_0x350596){return function(_0x4a04fe){if(_0x4a04fe){var _0x8c01ef=typeof _0x350596['offset']===_0x74d9('0x15')&&typeof _0x350596[_0x74d9('0x16')]===_0x74d9('0x15');var _0x33b47f=_0x4a04fe['count'];var _0x42a0d0=_0x8c01ef?0x0:_0x350596['offset'];var _0x44cca2=_0x8c01ef?_0x4a04fe[_0x74d9('0x17')]:_0x350596[_0x74d9('0x18')]+_0x350596['limit'];var _0x3cca66;if(_0x44cca2>=_0x33b47f){_0x44cca2=_0x33b47f;_0x3cca66=0xc8;}else{_0x3cca66=0xce;}_0x53aaa7['status'](_0x3cca66);return _0x53aaa7['set']('Content-Range',_0x42a0d0+'-'+_0x44cca2+'/'+_0x33b47f)[_0x74d9('0x19')](_0x4a04fe);}return null;};}function patchUpdates(_0x15d964){return function(_0x27d1ec){try{jsonpatch[_0x74d9('0x1a')](_0x27d1ec,_0x15d964,!![]);}catch(_0xcc45f6){return BPromise[_0x74d9('0x1b')](_0xcc45f6);}return _0x27d1ec[_0x74d9('0x1c')]();};}function saveUpdates(_0x1d81ba,_0x469c16){return function(_0xc56775){if(_0xc56775){return _0xc56775[_0x74d9('0x1d')](_0x1d81ba)[_0x74d9('0x1e')](function(_0x263cd0){return _0x263cd0;});}return null;};}function removeEntity(_0x3656c4,_0x5407ac){return function(_0x47bba7){if(_0x47bba7){return _0x47bba7['destroy']()[_0x74d9('0x1e')](function(){_0x3656c4['status'](0xcc)[_0x74d9('0x13')]();});}};}function handleEntityNotFound(_0x582e1a,_0x226d28){return function(_0x11554c){if(!_0x11554c){_0x582e1a[_0x74d9('0x1f')](0x194);}return _0x11554c;};}function handleError(_0x4d2255,_0x5371b7){_0x5371b7=_0x5371b7||0x1f4;return function(_0x1e5861){logger[_0x74d9('0x20')](_0x1e5861[_0x74d9('0x21')]);if(_0x1e5861[_0x74d9('0x22')]){delete _0x1e5861[_0x74d9('0x22')];}_0x4d2255[_0x74d9('0x14')](_0x5371b7)[_0x74d9('0x23')](_0x1e5861);};}exports[_0x74d9('0x24')]=function(_0x1f6db8,_0x265e92){var _0x5f3ac1={},_0x2075d0={},_0x553028={'count':0x0,'rows':[]};var _0x50f7d1=_[_0x74d9('0x25')](db[_0x74d9('0x26')]['rawAttributes'],function(_0x2e6a1c){return{'name':_0x2e6a1c['fieldName'],'type':_0x2e6a1c['type'][_0x74d9('0x27')]};});_0x2075d0[_0x74d9('0x28')]=_['map'](_0x50f7d1,_0x74d9('0x22'));_0x2075d0[_0x74d9('0x29')]=_['keys'](_0x1f6db8['query']);_0x2075d0['filters']=_[_0x74d9('0x2a')](_0x2075d0[_0x74d9('0x28')],_0x2075d0['query']);_0x5f3ac1['attributes']=_['intersection'](_0x2075d0[_0x74d9('0x28')],qs[_0x74d9('0x2b')](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x5f3ac1[_0x74d9('0x2c')]=_0x5f3ac1[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x5f3ac1[_0x74d9('0x2c')]:_0x2075d0[_0x74d9('0x28')];if(!_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x2e')](_0x74d9('0x2f'))){_0x5f3ac1['limit']=qs['limit'](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x16')]);_0x5f3ac1[_0x74d9('0x18')]=qs[_0x74d9('0x18')](_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x18')]);}_0x5f3ac1[_0x74d9('0x30')]=qs[_0x74d9('0x31')](_0x1f6db8['query']['sort']);_0x5f3ac1[_0x74d9('0x32')]=qs[_0x74d9('0x33')](_[_0x74d9('0x34')](_0x1f6db8[_0x74d9('0x29')],_0x2075d0[_0x74d9('0x33')]),_0x50f7d1);if(_0x1f6db8[_0x74d9('0x29')]['filter']){_0x5f3ac1[_0x74d9('0x32')]=_['merge'](_0x5f3ac1['where'],{'$or':_[_0x74d9('0x25')](_0x50f7d1,function(_0x392630){if(_0x392630['type']!==_0x74d9('0x35')){var _0x14ed55={};_0x14ed55[_0x392630[_0x74d9('0x22')]]={'$like':'%'+_0x1f6db8[_0x74d9('0x29')]['filter']+'%'};return _0x14ed55;}})});}_0x5f3ac1=_[_0x74d9('0x36')]({},_0x5f3ac1,_0x1f6db8[_0x74d9('0x37')]);var _0x392b6d={'where':_0x5f3ac1[_0x74d9('0x32')]};return db[_0x74d9('0x26')][_0x74d9('0x17')](_0x392b6d)[_0x74d9('0x1e')](function(_0x1c42f4){_0x553028[_0x74d9('0x17')]=_0x1c42f4;if(_0x1f6db8[_0x74d9('0x29')][_0x74d9('0x38')]){_0x5f3ac1['include']=[{'all':!![]}];}return db[_0x74d9('0x26')][_0x74d9('0x39')](_0x5f3ac1);})[_0x74d9('0x1e')](function(_0x4b424e){_0x553028[_0x74d9('0x3a')]=_0x4b424e;return _0x553028;})['then'](respondWithFilteredResult(_0x265e92,_0x5f3ac1))['catch'](handleError(_0x265e92,null));};exports[_0x74d9('0x3b')]=function(_0x41d6f7,_0x409717){var _0x3c1d15={'raw':!![],'where':{'id':_0x41d6f7[_0x74d9('0x3c')]['id']}},_0x526383={};_0x526383[_0x74d9('0x28')]=_[_0x74d9('0x3d')](db[_0x74d9('0x26')][_0x74d9('0x3e')]);_0x526383['query']=_[_0x74d9('0x3d')](_0x41d6f7[_0x74d9('0x29')]);_0x526383[_0x74d9('0x33')]=_['intersection'](_0x526383[_0x74d9('0x28')],_0x526383['query']);_0x3c1d15[_0x74d9('0x2c')]=_[_0x74d9('0x2a')](_0x526383['model'],qs['fields'](_0x41d6f7[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x3c1d15['attributes']=_0x3c1d15[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x3c1d15['attributes']:_0x526383[_0x74d9('0x28')];if(_0x41d6f7[_0x74d9('0x29')][_0x74d9('0x38')]){_0x3c1d15[_0x74d9('0x3f')]=[{'all':!![]}];}_0x3c1d15=_['merge']({},_0x3c1d15,_0x41d6f7[_0x74d9('0x37')]);return db['Attachment'][_0x74d9('0x40')](_0x3c1d15)[_0x74d9('0x1e')](handleEntityNotFound(_0x409717,null))[_0x74d9('0x1e')](respondWithResult(_0x409717,null))[_0x74d9('0x41')](handleError(_0x409717,null));};exports['clone']=function(_0x490fd3,_0x1dae36){var _0x5d9d9d={'where':{'id':_0x490fd3[_0x74d9('0x3c')]['id']}},_0x1d0671={};_0x1d0671['model']=_[_0x74d9('0x3d')](db[_0x74d9('0x26')]['rawAttributes']);_0x5d9d9d[_0x74d9('0x2c')]=_[_0x74d9('0x2a')](_0x1d0671[_0x74d9('0x28')],qs[_0x74d9('0x2b')](_0x490fd3[_0x74d9('0x29')][_0x74d9('0x2b')]));_0x5d9d9d[_0x74d9('0x2c')]=_0x5d9d9d[_0x74d9('0x2c')][_0x74d9('0x2d')]?_0x5d9d9d[_0x74d9('0x2c')]:_0x1d0671[_0x74d9('0x28')];if(_0x490fd3[_0x74d9('0x29')][_0x74d9('0x38')]){_0x5d9d9d[_0x74d9('0x3f')]=[{'all':!![]}];}_0x5d9d9d=_['merge']({},_0x5d9d9d,_0x490fd3['options']);return db[_0x74d9('0x26')][_0x74d9('0x40')](_0x5d9d9d)[_0x74d9('0x1e')](handleEntityNotFound(_0x1dae36,null))[_0x74d9('0x1e')](function(_0x4cf085){if(_0x4cf085){var _0x5ce857=_0x4cf085[_0x74d9('0x42')]({'plain':!![]});_0x5ce857=qs[_0x74d9('0x43')](_0x5ce857,['id','createdAt',_0x74d9('0x44')]);_0x490fd3[_0x74d9('0x45')]=_[_0x74d9('0x43')](_0x490fd3[_0x74d9('0x45')],['id',_0x74d9('0x46'),_0x74d9('0x44')]);return db[_0x74d9('0x26')]['create'](_[_0x74d9('0x36')](_0x5ce857,_0x490fd3['body']),{'include':_0x490fd3[_0x74d9('0x29')][_0x74d9('0x38')]?[{'all':!![]}]:undefined});}})[_0x74d9('0x1e')](respondWithResult(_0x1dae36,0xc9))[_0x74d9('0x41')](handleError(_0x1dae36,null));};exports[_0x74d9('0x1d')]=function(_0x2c52cf,_0x45528f){if(_0x2c52cf[_0x74d9('0x45')]['id']){delete _0x2c52cf[_0x74d9('0x45')]['id'];}return db[_0x74d9('0x26')][_0x74d9('0x40')]({'where':{'id':_0x2c52cf[_0x74d9('0x3c')]['id']}})[_0x74d9('0x1e')](handleEntityNotFound(_0x45528f,null))[_0x74d9('0x1e')](saveUpdates(_0x2c52cf['body'],null))[_0x74d9('0x1e')](respondWithResult(_0x45528f,null))['catch'](handleError(_0x45528f,null));};exports['destroy']=function(_0x5357d8,_0x1376cd){return db[_0x74d9('0x26')][_0x74d9('0x40')]({'where':{'id':_0x5357d8[_0x74d9('0x3c')]['id']}})[_0x74d9('0x1e')](handleEntityNotFound(_0x1376cd,null))[_0x74d9('0x1e')](removeEntity(_0x1376cd,null))[_0x74d9('0x41')](handleError(_0x1376cd,null));};exports['create']=function(_0x4e154c,_0x59c977,_0x38f2e6){_0x4e154c[_0x74d9('0x45')]['name']=_0x4e154c['file']['originalname'];_0x4e154c[_0x74d9('0x45')]['basename']=_0x4e154c[_0x74d9('0x47')][_0x74d9('0x48')];_0x4e154c[_0x74d9('0x45')][_0x74d9('0x49')]=_0x4e154c[_0x74d9('0x47')][_0x74d9('0x4a')];return db[_0x74d9('0x26')][_0x74d9('0x4b')](_0x4e154c[_0x74d9('0x45')])[_0x74d9('0x1e')](respondWithResult(_0x59c977,0xc9))[_0x74d9('0x41')](handleError(_0x59c977,null));};exports[_0x74d9('0x4c')]=function(_0x570306,_0x5773d6,_0x12f6ff){return db[_0x74d9('0x26')]['findOne']({'where':{'id':_0x570306[_0x74d9('0x3c')]['id']},'raw':!![]})[_0x74d9('0x1e')](handleEntityNotFound(_0x5773d6,null))['then'](function(_0x38a770){if(_0x38a770){var _0x42e714=_0x38a770[_0x74d9('0x4d')]!==null;var _0x1e623e=path[_0x74d9('0x4e')](config['root'],_0x74d9('0x4f'));if(_0x42e714){_0x1e623e=path[_0x74d9('0x4e')](_0x1e623e,_0x74d9('0x50'));}var _0x2a88f9=path['join'](_0x1e623e,_0x38a770[_0x74d9('0x51')]);return _0x5773d6[_0x74d9('0x4c')](_0x2a88f9);}})[_0x74d9('0x41')](handleError(_0x5773d6,null));};
\ No newline at end of file
+var _0x13a9=['offline-chat/','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','find','clone','params','omit','updatedAt','body','create','originalname','basename','file','filename','type','mimetype','findOne','root','server/files/attachments/','join'];(function(_0x1e60e5,_0xd7ac86){var _0x446b8f=function(_0x1961e8){while(--_0x1961e8){_0x1e60e5['push'](_0x1e60e5['shift']());}};_0x446b8f(++_0xd7ac86);}(_0x13a9,0xb2));var _0x913a=function(_0x491ace,_0x13ed1d){_0x491ace=_0x491ace-0x0;var _0x4d6014=_0x13a9[_0x491ace];return _0x4d6014;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x913a('0x0'));var zipdir=require(_0x913a('0x1'));var jsonpatch=require(_0x913a('0x2'));var rp=require(_0x913a('0x3'));var moment=require(_0x913a('0x4'));var BPromise=require(_0x913a('0x5'));var Mustache=require(_0x913a('0x6'));var util=require(_0x913a('0x7'));var path=require(_0x913a('0x8'));var sox=require(_0x913a('0x9'));var csv=require(_0x913a('0xa'));var ejs=require(_0x913a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x913a('0xc'));var squel=require(_0x913a('0xd'));var crypto=require(_0x913a('0xe'));var jsforce=require(_0x913a('0xf'));var deskjs=require(_0x913a('0x10'));var toCsv=require(_0x913a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x913a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x913a('0x12'));var hardwareService=require(_0x913a('0x13'));var logger=require(_0x913a('0x14'))(_0x913a('0x15'));var utils=require(_0x913a('0x16'));var config=require(_0x913a('0x17'));var licenseUtil=require(_0x913a('0x18'));var db=require(_0x913a('0x19'))['db'];function respondWithStatusCode(_0x2eb4b5,_0x2c9cbd){_0x2c9cbd=_0x2c9cbd||0xcc;return function(_0xb1e9f3){if(_0xb1e9f3){return _0x2eb4b5[_0x913a('0x1a')](_0x2c9cbd);}return _0x2eb4b5['status'](_0x2c9cbd)[_0x913a('0x1b')]();};}function respondWithResult(_0x6dcaa0,_0x3d64da){_0x3d64da=_0x3d64da||0xc8;return function(_0x3e4c1e){if(_0x3e4c1e){return _0x6dcaa0[_0x913a('0x1c')](_0x3d64da)[_0x913a('0x1d')](_0x3e4c1e);}};}function respondWithFilteredResult(_0x2829fc,_0x46e746){return function(_0x4698b6){if(_0x4698b6){var _0x8e1026=typeof _0x46e746[_0x913a('0x1e')]===_0x913a('0x1f')&&typeof _0x46e746['limit']==='undefined';var _0x1f40ca=_0x4698b6[_0x913a('0x20')];var _0x289891=_0x8e1026?0x0:_0x46e746[_0x913a('0x1e')];var _0x2c27b7=_0x8e1026?_0x4698b6[_0x913a('0x20')]:_0x46e746[_0x913a('0x1e')]+_0x46e746['limit'];var _0x3572b9;if(_0x2c27b7>=_0x1f40ca){_0x2c27b7=_0x1f40ca;_0x3572b9=0xc8;}else{_0x3572b9=0xce;}_0x2829fc['status'](_0x3572b9);return _0x2829fc[_0x913a('0x21')](_0x913a('0x22'),_0x289891+'-'+_0x2c27b7+'/'+_0x1f40ca)[_0x913a('0x1d')](_0x4698b6);}return null;};}function patchUpdates(_0x1f9427){return function(_0x28714c){try{jsonpatch[_0x913a('0x23')](_0x28714c,_0x1f9427,!![]);}catch(_0xb766a1){return BPromise['reject'](_0xb766a1);}return _0x28714c[_0x913a('0x24')]();};}function saveUpdates(_0x4259f6,_0x589cdd){return function(_0x3a48e7){if(_0x3a48e7){return _0x3a48e7[_0x913a('0x25')](_0x4259f6)[_0x913a('0x26')](function(_0x30318b){return _0x30318b;});}return null;};}function removeEntity(_0xaa27be,_0x2d4afd){return function(_0x754342){if(_0x754342){return _0x754342[_0x913a('0x27')]()['then'](function(){_0xaa27be[_0x913a('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe272ae,_0xb07dfd){return function(_0x4d632f){if(!_0x4d632f){_0xe272ae['sendStatus'](0x194);}return _0x4d632f;};}function handleError(_0x5593aa,_0x2281f2){_0x2281f2=_0x2281f2||0x1f4;return function(_0x329f90){logger[_0x913a('0x28')](_0x329f90[_0x913a('0x29')]);if(_0x329f90[_0x913a('0x2a')]){delete _0x329f90[_0x913a('0x2a')];}_0x5593aa[_0x913a('0x1c')](_0x2281f2)[_0x913a('0x2b')](_0x329f90);};}exports[_0x913a('0x2c')]=function(_0x19a3c7,_0x2152fd){var _0xe42360={},_0x25fac0={},_0x42a136={'count':0x0,'rows':[]};var _0x4e936f=_[_0x913a('0x2d')](db[_0x913a('0x2e')][_0x913a('0x2f')],function(_0x10514a){return{'name':_0x10514a['fieldName'],'type':_0x10514a['type'][_0x913a('0x30')]};});_0x25fac0[_0x913a('0x31')]=_[_0x913a('0x2d')](_0x4e936f,_0x913a('0x2a'));_0x25fac0[_0x913a('0x32')]=_[_0x913a('0x33')](_0x19a3c7[_0x913a('0x32')]);_0x25fac0[_0x913a('0x34')]=_['intersection'](_0x25fac0[_0x913a('0x31')],_0x25fac0[_0x913a('0x32')]);_0xe42360[_0x913a('0x35')]=_[_0x913a('0x36')](_0x25fac0[_0x913a('0x31')],qs['fields'](_0x19a3c7[_0x913a('0x32')][_0x913a('0x37')]));_0xe42360['attributes']=_0xe42360[_0x913a('0x35')][_0x913a('0x38')]?_0xe42360[_0x913a('0x35')]:_0x25fac0[_0x913a('0x31')];if(!_0x19a3c7[_0x913a('0x32')][_0x913a('0x39')](_0x913a('0x3a'))){_0xe42360[_0x913a('0x3b')]=qs[_0x913a('0x3b')](_0x19a3c7[_0x913a('0x32')]['limit']);_0xe42360['offset']=qs['offset'](_0x19a3c7['query']['offset']);}_0xe42360[_0x913a('0x3c')]=qs['sort'](_0x19a3c7[_0x913a('0x32')]['sort']);_0xe42360['where']=qs[_0x913a('0x34')](_['pick'](_0x19a3c7['query'],_0x25fac0[_0x913a('0x34')]),_0x4e936f);if(_0x19a3c7[_0x913a('0x32')]['filter']){_0xe42360[_0x913a('0x3d')]=_[_0x913a('0x3e')](_0xe42360[_0x913a('0x3d')],{'$or':_[_0x913a('0x2d')](_0x4e936f,function(_0xae058a){if(_0xae058a['type']!==_0x913a('0x3f')){var _0x20a358={};_0x20a358[_0xae058a[_0x913a('0x2a')]]={'$like':'%'+_0x19a3c7[_0x913a('0x32')]['filter']+'%'};return _0x20a358;}})});}_0xe42360=_['merge']({},_0xe42360,_0x19a3c7['options']);var _0x582cf1={'where':_0xe42360[_0x913a('0x3d')]};return db['Attachment']['count'](_0x582cf1)[_0x913a('0x26')](function(_0x44e565){_0x42a136['count']=_0x44e565;if(_0x19a3c7['query'][_0x913a('0x40')]){_0xe42360[_0x913a('0x41')]=[{'all':!![]}];}return db['Attachment'][_0x913a('0x42')](_0xe42360);})[_0x913a('0x26')](function(_0x5e2996){_0x42a136[_0x913a('0x43')]=_0x5e2996;return _0x42a136;})[_0x913a('0x26')](respondWithFilteredResult(_0x2152fd,_0xe42360))[_0x913a('0x44')](handleError(_0x2152fd,null));};exports['show']=function(_0x20a74e,_0x29d3cf){var _0x48de71={'raw':!![],'where':{'id':_0x20a74e['params']['id']}},_0x415d38={};_0x415d38['model']=_[_0x913a('0x33')](db['Attachment']['rawAttributes']);_0x415d38[_0x913a('0x32')]=_['keys'](_0x20a74e[_0x913a('0x32')]);_0x415d38[_0x913a('0x34')]=_[_0x913a('0x36')](_0x415d38[_0x913a('0x31')],_0x415d38[_0x913a('0x32')]);_0x48de71[_0x913a('0x35')]=_['intersection'](_0x415d38['model'],qs[_0x913a('0x37')](_0x20a74e[_0x913a('0x32')][_0x913a('0x37')]));_0x48de71[_0x913a('0x35')]=_0x48de71[_0x913a('0x35')][_0x913a('0x38')]?_0x48de71[_0x913a('0x35')]:_0x415d38[_0x913a('0x31')];if(_0x20a74e['query'][_0x913a('0x40')]){_0x48de71[_0x913a('0x41')]=[{'all':!![]}];}_0x48de71=_[_0x913a('0x3e')]({},_0x48de71,_0x20a74e['options']);return db[_0x913a('0x2e')][_0x913a('0x45')](_0x48de71)[_0x913a('0x26')](handleEntityNotFound(_0x29d3cf,null))[_0x913a('0x26')](respondWithResult(_0x29d3cf,null))[_0x913a('0x44')](handleError(_0x29d3cf,null));};exports[_0x913a('0x46')]=function(_0x594dd2,_0x248550){var _0x26c7e4={'where':{'id':_0x594dd2[_0x913a('0x47')]['id']}},_0x44d18b={};_0x44d18b[_0x913a('0x31')]=_[_0x913a('0x33')](db[_0x913a('0x2e')]['rawAttributes']);_0x26c7e4[_0x913a('0x35')]=_[_0x913a('0x36')](_0x44d18b[_0x913a('0x31')],qs[_0x913a('0x37')](_0x594dd2[_0x913a('0x32')][_0x913a('0x37')]));_0x26c7e4['attributes']=_0x26c7e4[_0x913a('0x35')][_0x913a('0x38')]?_0x26c7e4[_0x913a('0x35')]:_0x44d18b[_0x913a('0x31')];if(_0x594dd2['query'][_0x913a('0x40')]){_0x26c7e4[_0x913a('0x41')]=[{'all':!![]}];}_0x26c7e4=_[_0x913a('0x3e')]({},_0x26c7e4,_0x594dd2['options']);return db[_0x913a('0x2e')][_0x913a('0x45')](_0x26c7e4)[_0x913a('0x26')](handleEntityNotFound(_0x248550,null))['then'](function(_0x5eaf65){if(_0x5eaf65){var _0x2e10aa=_0x5eaf65['get']({'plain':!![]});_0x2e10aa=qs[_0x913a('0x48')](_0x2e10aa,['id','createdAt',_0x913a('0x49')]);_0x594dd2[_0x913a('0x4a')]=_['omit'](_0x594dd2[_0x913a('0x4a')],['id','createdAt',_0x913a('0x49')]);return db[_0x913a('0x2e')][_0x913a('0x4b')](_['merge'](_0x2e10aa,_0x594dd2[_0x913a('0x4a')]),{'include':_0x594dd2[_0x913a('0x32')][_0x913a('0x40')]?[{'all':!![]}]:undefined});}})[_0x913a('0x26')](respondWithResult(_0x248550,0xc9))['catch'](handleError(_0x248550,null));};exports[_0x913a('0x25')]=function(_0x4a9759,_0xf3f4fe){if(_0x4a9759[_0x913a('0x4a')]['id']){delete _0x4a9759['body']['id'];}return db['Attachment']['find']({'where':{'id':_0x4a9759['params']['id']}})[_0x913a('0x26')](handleEntityNotFound(_0xf3f4fe,null))['then'](saveUpdates(_0x4a9759[_0x913a('0x4a')],null))['then'](respondWithResult(_0xf3f4fe,null))[_0x913a('0x44')](handleError(_0xf3f4fe,null));};exports[_0x913a('0x27')]=function(_0x5f2641,_0x5ebc93){return db[_0x913a('0x2e')][_0x913a('0x45')]({'where':{'id':_0x5f2641[_0x913a('0x47')]['id']}})[_0x913a('0x26')](handleEntityNotFound(_0x5ebc93,null))[_0x913a('0x26')](removeEntity(_0x5ebc93,null))[_0x913a('0x44')](handleError(_0x5ebc93,null));};exports[_0x913a('0x4b')]=function(_0x331569,_0x26aea8,_0x5d9cc6){_0x331569[_0x913a('0x4a')]['name']=_0x331569['file'][_0x913a('0x4c')];_0x331569['body'][_0x913a('0x4d')]=_0x331569[_0x913a('0x4e')][_0x913a('0x4f')];_0x331569[_0x913a('0x4a')][_0x913a('0x50')]=_0x331569[_0x913a('0x4e')][_0x913a('0x51')];return db['Attachment'][_0x913a('0x4b')](_0x331569[_0x913a('0x4a')])[_0x913a('0x26')](respondWithResult(_0x26aea8,0xc9))[_0x913a('0x44')](handleError(_0x26aea8,null));};exports['download']=function(_0x32eb91,_0x41ab76,_0x26a7c8){return db[_0x913a('0x2e')][_0x913a('0x52')]({'where':{'id':_0x32eb91[_0x913a('0x47')]['id']},'raw':!![]})[_0x913a('0x26')](handleEntityNotFound(_0x41ab76,null))[_0x913a('0x26')](function(_0x2e5a6d){if(_0x2e5a6d){var _0x50fcba=_0x2e5a6d['ChatOfflineMessageId']!==null;var _0x315454=path['join'](config[_0x913a('0x53')],_0x913a('0x54'));if(_0x50fcba){_0x315454=path[_0x913a('0x55')](_0x315454,_0x913a('0x56'));}var _0x5180a1=path[_0x913a('0x55')](_0x315454,_0x2e5a6d[_0x913a('0x4d')]);return _0x41ab76[_0x913a('0x57')](_0x5180a1);}})[_0x913a('0x44')](handleError(_0x41ab76,null));};
\ No newline at end of file
index 58b191f..1f673ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb8a=['api','moment','bluebird','path','../../config/environment','./attachment.attributes','exports','define','attachments','util','../../config/logger'];(function(_0x1dc029,_0x17fb0d){var _0x510cb3=function(_0x5a42c0){while(--_0x5a42c0){_0x1dc029['push'](_0x1dc029['shift']());}};_0x510cb3(++_0x17fb0d);}(_0xbb8a,0xae));var _0xabb8=function(_0x2790ed,_0x35544c){_0x2790ed=_0x2790ed-0x0;var _0x1431cc=_0xbb8a[_0x2790ed];return _0x1431cc;};'use strict';var _=require('lodash');var util=require(_0xabb8('0x0'));var logger=require(_0xabb8('0x1'))(_0xabb8('0x2'));var moment=require(_0xabb8('0x3'));var BPromise=require(_0xabb8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xabb8('0x5'));var rimraf=require('rimraf');var config=require(_0xabb8('0x6'));var attributes=require(_0xabb8('0x7'));module[_0xabb8('0x8')]=function(_0x2c829e,_0x3d2a5c){return _0x2c829e[_0xabb8('0x9')]('Attachment',attributes,{'tableName':_0xabb8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8006=['../../config/logger','api','path','rimraf','./attachment.attributes','Attachment'];(function(_0x22c5fd,_0x110390){var _0x17d5c3=function(_0x8d7738){while(--_0x8d7738){_0x22c5fd['push'](_0x22c5fd['shift']());}};_0x17d5c3(++_0x110390);}(_0x8006,0xba));var _0x6800=function(_0x299f6a,_0x186ef2){_0x299f6a=_0x299f6a-0x0;var _0x5735e5=_0x8006[_0x299f6a];return _0x5735e5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6800('0x0'))(_0x6800('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6800('0x2'));var rimraf=require(_0x6800('0x3'));var config=require('../../config/environment');var attributes=require(_0x6800('0x4'));module['exports']=function(_0x46856a,_0x10b4eb){return _0x46856a['define'](_0x6800('0x5'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b76fbc3..7882d70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24cf=['code','message','catch','CreateAttachment','Attachment','create','body','options','raw','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error'];(function(_0x2283a9,_0x4e2e63){var _0x3cbc8c=function(_0x282ab5){while(--_0x282ab5){_0x2283a9['push'](_0x2283a9['shift']());}};_0x3cbc8c(++_0x4e2e63);}(_0x24cf,0x1d5));var _0xf24c=function(_0x19f9e9,_0x5ab385){_0x19f9e9=_0x19f9e9-0x0;var _0x2c23cb=_0x24cf[_0x19f9e9];return _0x2c23cb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf24c('0x0'));var BPromise=require(_0xf24c('0x1'));var rs=require(_0xf24c('0x2'));var fs=require('fs');var Redis=require(_0xf24c('0x3'));var db=require(_0xf24c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf24c('0x5'))(_0xf24c('0x6'));var config=require(_0xf24c('0x7'));var jayson=require(_0xf24c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5104bd,_0x272d25,_0x596e81){return new BPromise(function(_0x3b7cf1,_0x13163e){return client[_0xf24c('0x9')](_0x5104bd,_0x596e81)[_0xf24c('0xa')](function(_0x4b3ea3){logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));logger[_0xf24c('0xe')](_0xf24c('0xf'),_0x272d25,_0xf24c('0xd'),JSON['stringify'](_0x4b3ea3));if(_0x4b3ea3[_0xf24c('0x10')]){if(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x11')]===0x1f4){logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x13163e(_0x4b3ea3['error'][_0xf24c('0x12')]);}logger['error'](_0xf24c('0xc'),_0x272d25,_0x4b3ea3[_0xf24c('0x10')]['message']);return _0x3b7cf1(_0x4b3ea3[_0xf24c('0x10')][_0xf24c('0x12')]);}else{logger[_0xf24c('0xb')](_0xf24c('0xc'),_0x272d25,_0xf24c('0xd'));_0x3b7cf1(_0x4b3ea3['result']['message']);}})[_0xf24c('0x13')](function(_0x462801){logger['error'](_0xf24c('0xc'),_0x272d25,_0x462801);_0x13163e(_0x462801);});});}exports[_0xf24c('0x14')]=function(_0x2d9015){var _0x3eb8e1=this;return new Promise(function(_0x1a17c6,_0x3a0b61){return db[_0xf24c('0x15')][_0xf24c('0x16')](_0x2d9015[_0xf24c('0x17')],{'raw':_0x2d9015[_0xf24c('0x18')]?_0x2d9015[_0xf24c('0x18')][_0xf24c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x24bf58){logger[_0xf24c('0xb')]('CreateAttachment',_0x2d9015);logger[_0xf24c('0xe')](_0xf24c('0x14'),_0x2d9015,JSON[_0xf24c('0x1a')](_0x24bf58));_0x1a17c6(_0x24bf58);})['catch'](function(_0x5885a5){logger['error'](_0xf24c('0x14'),_0x5885a5[_0xf24c('0x12')],_0x2d9015);_0x3a0b61(_0x3eb8e1['error'](0x1f4,_0x5885a5[_0xf24c('0x12')]));});});};
\ No newline at end of file
+var _0xb201=['stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','Attachment,\x20%s,\x20%s','message','result','CreateAttachment','Attachment','create','body','options','raw'];(function(_0x1157e7,_0x55bda6){var _0x4da4ab=function(_0x36d590){while(--_0x36d590){_0x1157e7['push'](_0x1157e7['shift']());}};_0x4da4ab(++_0x55bda6);}(_0xb201,0x1b1));var _0x1b20=function(_0x5ca6b1,_0x4bd535){_0x5ca6b1=_0x5ca6b1-0x0;var _0x591553=_0xb201[_0x5ca6b1];return _0x591553;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var moment=require(_0x1b20('0x1'));var BPromise=require(_0x1b20('0x2'));var rs=require(_0x1b20('0x3'));var fs=require('fs');var Redis=require(_0x1b20('0x4'));var db=require(_0x1b20('0x5'))['db'];var utils=require(_0x1b20('0x6'));var logger=require('../../config/logger')(_0x1b20('0x7'));var config=require(_0x1b20('0x8'));var jayson=require(_0x1b20('0x9'));var client=jayson['client'][_0x1b20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50cdbc,_0x34304b,_0x2a184f){return new BPromise(function(_0x3cc600,_0x426ae9){return client['request'](_0x50cdbc,_0x2a184f)[_0x1b20('0xb')](function(_0x1f5ae4){logger[_0x1b20('0xc')]('Attachment,\x20%s,\x20%s',_0x34304b,_0x1b20('0xd'));logger['debug'](_0x1b20('0xe'),_0x34304b,'request\x20sent',JSON['stringify'](_0x1f5ae4));if(_0x1f5ae4[_0x1b20('0xf')]){if(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x10')]===0x1f4){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x426ae9(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x1f5ae4['error'][_0x1b20('0x12')]);return _0x3cc600(_0x1f5ae4[_0x1b20('0xf')][_0x1b20('0x12')]);}else{logger['info'](_0x1b20('0x11'),_0x34304b,'request\x20sent');_0x3cc600(_0x1f5ae4[_0x1b20('0x13')][_0x1b20('0x12')]);}})['catch'](function(_0x44e713){logger[_0x1b20('0xf')](_0x1b20('0x11'),_0x34304b,_0x44e713);_0x426ae9(_0x44e713);});});}exports[_0x1b20('0x14')]=function(_0xff7c72){var _0xf9078e=this;return new Promise(function(_0x34517f,_0x46bb09){return db[_0x1b20('0x15')][_0x1b20('0x16')](_0xff7c72[_0x1b20('0x17')],{'raw':_0xff7c72[_0x1b20('0x18')]?_0xff7c72[_0x1b20('0x18')][_0x1b20('0x19')]===undefined?!![]:![]:!![]})[_0x1b20('0xb')](function(_0x4823d4){logger[_0x1b20('0xc')]('CreateAttachment',_0xff7c72);logger['debug']('CreateAttachment',_0xff7c72,JSON[_0x1b20('0x1a')](_0x4823d4));_0x34517f(_0x4823d4);})['catch'](function(_0x5c3038){logger[_0x1b20('0xf')]('CreateAttachment',_0x5c3038[_0x1b20('0x12')],_0xff7c72);_0x46bb09(_0xf9078e['error'](0x1f4,_0x5c3038[_0x1b20('0x12')]));});});};
\ No newline at end of file
index e888d8d..a9f8f27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x35f9fe,_0x25746a){_0x35f9fe=_0x35f9fe-0x0;var _0x3327a1=_0xdb28[_0x35f9fe];return _0x3327a1;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x5f66=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','/:id/clone','clone','diskStorage','root','format','%s-%s','now','originalname','replace','post','single','file','create','delete','destroy','exports','util','connect-timeout','express','Router'];(function(_0x17a32f,_0x5a51a){var _0x15a293=function(_0x55fbd3){while(--_0x55fbd3){_0x17a32f['push'](_0x17a32f['shift']());}};_0x15a293(++_0x5a51a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./attachment.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['download']);router['post'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);var upload=multer({'storage':multer[_0x65f6('0xe')]({'destination':function(_0x50d26d,_0x41a7fd,_0x571436){_0x571436(null,path['join'](config[_0x65f6('0xf')],'server/files/attachments/'));},'filename':function(_0x419819,_0x4862a5,_0x2f964a){_0x2f964a(null,util[_0x65f6('0x10')](_0x65f6('0x11'),Date[_0x65f6('0x12')](),_0x4862a5[_0x65f6('0x13')][_0x65f6('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x65f6('0x15')]('/',upload[_0x65f6('0x16')](_0x65f6('0x17')),controller[_0x65f6('0x18')]);router['put'](_0x65f6('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x65f6('0x19')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x1a')]);module[_0x65f6('0x1b')]=router;
\ No newline at end of file
index a5e4e3f..ecea123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee6f=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','blocked','blockedAt','admin','then','name','add','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','User','passport','passport-local','Strategy','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0xee6f,0x1f3));var _0xfee6=function(_0xef4fc0,_0x33cc41){_0xef4fc0=_0xef4fc0-0x0;var _0x57dade=_0xee6f[_0xef4fc0];return _0x57dade;};'use strict';var passport=require(_0xfee6('0x0'));var LocalStrategy=require(_0xfee6('0x1'))[_0xfee6('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xfee6('0x3'));var BPromise=require('bluebird');var util=require(_0xfee6('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0xfee6('0x5'));var utils=require(_0xfee6('0x6'));var config=require(_0xfee6('0x7'));var logger=require(_0xfee6('0x8'))('api');function isActiveDirectoryConfigured(_0x382ca9){var _0x31a800=![];if(typeof _0x382ca9[_0xfee6('0x9')]!==_0xfee6('0xa')){_0x31a800=_0x382ca9[_0xfee6('0x9')][_0xfee6('0xb')]&&_0x382ca9[_0xfee6('0x9')][_0xfee6('0xc')]&&_0x382ca9['activedirectory'][_0xfee6('0xd')];}return _0x31a800;}function adAuthenticate(_0x415643,_0x3ad248,_0x58013b){return new BPromise(function(_0x441f2e,_0x39424d){try{var _0x333f5a=new ActiveDirectory(_0x415643);_0x333f5a[_0xfee6('0xe')](_0x3ad248,_0x58013b,function(_0x4412a4,_0x453194){if(_0x4412a4){logger['error'](_0xfee6('0xf'),_0x3ad248,util[_0xfee6('0x10')](_0x4412a4,{'showHidden':![],'depth':null}));_0x39424d(_0xfee6('0x11'));}else if(!_0x453194){logger[_0xfee6('0x12')](_0xfee6('0x13'),_0x3ad248);_0x39424d(_0xfee6('0x11'));}else{_0x441f2e(_0x453194);}});}catch(_0x2ae36d){_0x39424d(_0x2ae36d);}});}function ActiveDirectoryAuthenticate(_0x10ee4d,_0x735e3d,_0x6308ba,_0x206c9d){var _0x514d91,_0xd3cb2a;if(!isActiveDirectoryConfigured(config)){logger[_0xfee6('0x12')](_0xfee6('0x14'),_0x735e3d);return _0x206c9d(null,![],{'message':_0xfee6('0x11')});}return db['Setting'][_0xfee6('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xfee6('0x16')],'raw':!![]})['then'](function(_0x77d050){_0x514d91=_0x77d050;if(!_0x514d91['adSsoEnabled']){logger[_0xfee6('0x12')](_0xfee6('0x17'),_0x735e3d);throw new Error(_0xfee6('0x11'));}return _0x10ee4d[_0xfee6('0x15')]({'attributes':['id','name',_0xfee6('0x18'),_0xfee6('0x19'),_0xfee6('0x1a'),'disabled',_0xfee6('0x1b'),_0xfee6('0x1c'),'online'],'where':{'name':_0x735e3d,'role':{'$or':[_0xfee6('0x1d'),'user','agent']},'adSsoEnabled':!![]}});})[_0xfee6('0x1e')](function(_0x18123d){if(!_0x18123d||_0x18123d&&_0x18123d[_0xfee6('0x1f')]!==_0x735e3d){throw new Error(_0xfee6('0x11'));}_0xd3cb2a=_0x18123d;var _0x32e484=_0xd3cb2a['name']+'@'+config[_0xfee6('0x9')][_0xfee6('0xd')];return adAuthenticate(config['activedirectory'],_0x32e484,_0x6308ba);})[_0xfee6('0x1e')](function(_0x55ffad){if(_0xd3cb2a['disabled']){throw new Error(_0xfee6('0x11'));}if(_0x514d91[_0xfee6('0x16')]>0x0){if(_0xd3cb2a[_0xfee6('0x1b')]){if(moment(_0xd3cb2a[_0xfee6('0x1c')])[_0xfee6('0x20')](_0x514d91['blockDuration'],'minutes')>moment()){throw new Error(_0xfee6('0x11'));}return utils['clearBlockUser'](_0xd3cb2a,0x0,![],null)[_0xfee6('0x1e')](function(){return utils[_0xfee6('0x21')](_0xd3cb2a);})[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}else{return utils['getLicense'](_0xd3cb2a)[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}}else{return utils['getLicense'](_0xd3cb2a)[_0xfee6('0x1e')](function(){return _0x206c9d(null,_0xd3cb2a);});}})[_0xfee6('0x22')](function(_0x4bf912){return _0x206c9d(null,![],_0x4bf912);});}function handleError(_0x3951f3,_0x1f0de6,_0x2fdf88){return _0x3951f3['status'](_0x1f0de6||0x1f4)[_0xfee6('0x23')]({'message':_0x2fdf88?_0x2fdf88[_0xfee6('0x24')]||_0x2fdf88:''});}exports[_0xfee6('0x25')]=function(_0x30a32d,_0x1d347e,_0x3b6eb6){passport[_0xfee6('0xe')](_0xfee6('0x26'),function(_0x573376,_0x29d2ab,_0x30d0ac){var _0x5d41a9=_0x573376||_0x30d0ac;if(_0x5d41a9){return handleError(_0x1d347e,0x191,_0x5d41a9);}if(!_0x29d2ab){return handleError(_0x1d347e,0x194,{'message':_0xfee6('0x27')});}else{var _0x1f6e66={'payload':{'id':_0x29d2ab['id'],'role':_0x29d2ab['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1f6e66)[_0xfee6('0x1e')](function(_0x36c40b){_0x1d347e[_0xfee6('0x28')]({'id':_0x29d2ab['id'],'token':_0x36c40b,'statusCall':'','isAlreadyLogged':_0x29d2ab[_0xfee6('0x29')]});});}})(_0x30a32d,_0x1d347e,_0x3b6eb6);};passport['use'](_0xfee6('0x26'),new LocalStrategy({'usernameField':_0xfee6('0x1f'),'passwordField':_0xfee6('0x18')},function(_0x501917,_0x3d2823,_0xaa6320){return ActiveDirectoryAuthenticate(db[_0xfee6('0x2a')],_0x501917,_0x3d2823,_0xaa6320);}));
\ No newline at end of file
+var _0xbeca=['name','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','password','salt','role','disabled','blocked','blockedAt','user','agent','domain','add','clearBlockUser','getLicense','catch','status','send','message','login','ad-login','signToken','json','online','use'];(function(_0x589bc9,_0x49b8ec){var _0x36065b=function(_0x3d5264){while(--_0x3d5264){_0x589bc9['push'](_0x589bc9['shift']());}};_0x36065b(++_0x49b8ec);}(_0xbeca,0x66));var _0xabec=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xbeca[_0x529296];return _0x1796bf;};'use strict';var passport=require(_0xabec('0x0'));var LocalStrategy=require(_0xabec('0x1'))[_0xabec('0x2')];var moment=require(_0xabec('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xabec('0x4'));var util=require(_0xabec('0x5'));var db=require(_0xabec('0x6'))['db'];var authService=require(_0xabec('0x7'));var utils=require(_0xabec('0x8'));var config=require(_0xabec('0x9'));var logger=require(_0xabec('0xa'))(_0xabec('0xb'));function isActiveDirectoryConfigured(_0xda9982){var _0x5e7de2=![];if(typeof _0xda9982[_0xabec('0xc')]!==_0xabec('0xd')){_0x5e7de2=_0xda9982[_0xabec('0xc')][_0xabec('0xe')]&&_0xda9982[_0xabec('0xc')][_0xabec('0xf')]&&_0xda9982[_0xabec('0xc')]['domain'];}return _0x5e7de2;}function adAuthenticate(_0x3b29d7,_0x2921fe,_0x3db44e){return new BPromise(function(_0x525d83,_0x7a8719){try{var _0x32a777=new ActiveDirectory(_0x3b29d7);_0x32a777['authenticate'](_0x2921fe,_0x3db44e,function(_0x5b448e,_0x53a111){if(_0x5b448e){logger[_0xabec('0x10')](_0xabec('0x11'),_0x2921fe,util['inspect'](_0x5b448e,{'showHidden':![],'depth':null}));_0x7a8719('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x53a111){logger[_0xabec('0x10')](_0xabec('0x12'),_0x2921fe);_0x7a8719(_0xabec('0x13'));}else{_0x525d83(_0x53a111);}});}catch(_0x4a037a){_0x7a8719(_0x4a037a);}});}function ActiveDirectoryAuthenticate(_0x321550,_0x47f841,_0x328573,_0x456ace){var _0x37a0cc,_0x230d03;if(!isActiveDirectoryConfigured(config)){logger[_0xabec('0x10')](_0xabec('0x14'),_0x47f841);return _0x456ace(null,![],{'message':_0xabec('0x13')});}return db[_0xabec('0x15')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0xabec('0x16')],'raw':!![]})[_0xabec('0x17')](function(_0x825801){_0x37a0cc=_0x825801;if(!_0x37a0cc['adSsoEnabled']){logger[_0xabec('0x10')](_0xabec('0x18'),_0x47f841);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x321550[_0xabec('0x19')]({'attributes':['id','name',_0xabec('0x1a'),_0xabec('0x1b'),_0xabec('0x1c'),_0xabec('0x1d'),_0xabec('0x1e'),_0xabec('0x1f'),'online'],'where':{'name':_0x47f841,'role':{'$or':['admin',_0xabec('0x20'),_0xabec('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x992108){if(!_0x992108||_0x992108&&_0x992108['name']!==_0x47f841){throw new Error(_0xabec('0x13'));}_0x230d03=_0x992108;var _0x1f653b=_0x230d03['name']+'@'+config[_0xabec('0xc')][_0xabec('0x22')];return adAuthenticate(config[_0xabec('0xc')],_0x1f653b,_0x328573);})[_0xabec('0x17')](function(_0x13cbbe){if(_0x230d03['disabled']){throw new Error(_0xabec('0x13'));}if(_0x37a0cc['blockDuration']>0x0){if(_0x230d03[_0xabec('0x1e')]){if(moment(_0x230d03['blockedAt'])[_0xabec('0x23')](_0x37a0cc['blockDuration'],'minutes')>moment()){throw new Error(_0xabec('0x13'));}return utils[_0xabec('0x24')](_0x230d03,0x0,![],null)[_0xabec('0x17')](function(){return utils[_0xabec('0x25')](_0x230d03);})[_0xabec('0x17')](function(){return _0x456ace(null,_0x230d03);});}else{return utils['getLicense'](_0x230d03)['then'](function(){return _0x456ace(null,_0x230d03);});}}else{return utils[_0xabec('0x25')](_0x230d03)[_0xabec('0x17')](function(){return _0x456ace(null,_0x230d03);});}})[_0xabec('0x26')](function(_0xb395c0){return _0x456ace(null,![],_0xb395c0);});}function handleError(_0x5a95e2,_0x337346,_0x2f4c68){return _0x5a95e2[_0xabec('0x27')](_0x337346||0x1f4)[_0xabec('0x28')]({'message':_0x2f4c68?_0x2f4c68[_0xabec('0x29')]||_0x2f4c68:''});}exports[_0xabec('0x2a')]=function(_0x24096d,_0x1af9f3,_0x19bbb2){passport['authenticate'](_0xabec('0x2b'),function(_0x4ee4b0,_0x313d6b,_0x31a66d){var _0x140f86=_0x4ee4b0||_0x31a66d;if(_0x140f86){return handleError(_0x1af9f3,0x191,_0x140f86);}if(!_0x313d6b){return handleError(_0x1af9f3,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x50d18a={'payload':{'id':_0x313d6b['id'],'role':_0x313d6b[_0xabec('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xabec('0x2c')](_0x50d18a)[_0xabec('0x17')](function(_0x5df78a){_0x1af9f3[_0xabec('0x2d')]({'id':_0x313d6b['id'],'token':_0x5df78a,'statusCall':'','isAlreadyLogged':_0x313d6b[_0xabec('0x2e')]});});}})(_0x24096d,_0x1af9f3,_0x19bbb2);};passport[_0xabec('0x2f')](_0xabec('0x2b'),new LocalStrategy({'usernameField':_0xabec('0x30'),'passwordField':_0xabec('0x1a')},function(_0x43ef77,_0x767417,_0x262ff5){return ActiveDirectoryAuthenticate(db[_0xabec('0x31')],_0x43ef77,_0x767417,_0x262ff5);}));
\ No newline at end of file
index 3736e70..aead2f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e84=['express','Router','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e84,0x150));var _0x42e8=function(_0x436564,_0xeb94af){_0x436564=_0x436564-0x0;var _0x25f606=_0x2e84[_0x436564];return _0x25f606;};'use strict';var express=require(_0x42e8('0x0'));var router=express[_0x42e8('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x42e8('0x2')]('/',controller['login']);module['exports']=router;
\ No newline at end of file
+var _0x68f4=['post','login','exports','express','./authActiveDirectory.controller'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x68f4,0x134));var _0x468f=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x68f4[_0x284a61];return _0x220e3c;};'use strict';var express=require(_0x468f('0x0'));var router=express['Router']();var controller=require(_0x468f('0x1'));router[_0x468f('0x2')]('/',controller[_0x468f('0x3')]);module[_0x468f('0x4')]=router;
\ No newline at end of file
index 4abbce7..f04402f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x504dde,_0x207ebc){var _0x5333c4=function(_0x1136c4){while(--_0x1136c4){_0x504dde['push'](_0x504dde['shift']());}};_0x5333c4(++_0x207ebc);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x5b487a,_0x242987){var _0x4b0f34=function(_0x7de9ad){while(--_0x7de9ad){_0x5b487a['push'](_0x5b487a['shift']());}};_0x4b0f34(++_0x242987);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index 209b271..942caba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b8d=['./authGoogle.controller','../user/user.controller.js','get','/callback','callback','login','setTokenCookie','Router'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x8b8d,0x15f));var _0xd8b8=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x8b8d[_0x2576d7];return _0x16a08c;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0xd8b8('0x0')]();var controller=require(_0xd8b8('0x1'));var userController=require(_0xd8b8('0x2'));var authService=require('../../components/auth/service');router[_0xd8b8('0x3')]('/',controller['login']);router[_0xd8b8('0x3')](_0xd8b8('0x4'),controller[_0xd8b8('0x5')],authService['isMiddleware'],userController[_0xd8b8('0x6')],authService[_0xd8b8('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x5d6b=['../user/user.controller.js','../../components/auth/service','get','/callback','callback','isMiddleware','setTokenCookie','exports','passport','./authGoogle.controller'];(function(_0x52e77f,_0x368694){var _0x3aad87=function(_0x2a4f2e){while(--_0x2a4f2e){_0x52e77f['push'](_0x52e77f['shift']());}};_0x3aad87(++_0x368694);}(_0x5d6b,0xa8));var _0xb5d6=function(_0x5c298a,_0x579b14){_0x5c298a=_0x5c298a-0x0;var _0x3419fe=_0x5d6b[_0x5c298a];return _0x3419fe;};'use strict';var express=require('express');var passport=require(_0xb5d6('0x0'));var router=express['Router']();var controller=require(_0xb5d6('0x1'));var userController=require(_0xb5d6('0x2'));var authService=require(_0xb5d6('0x3'));router[_0xb5d6('0x4')]('/',controller['login']);router['get'](_0xb5d6('0x5'),controller[_0xb5d6('0x6')],authService[_0xb5d6('0x7')],userController['login'],authService[_0xb5d6('0x8')]);module[_0xb5d6('0x9')]=router;
\ No newline at end of file
index fc90f8c..1acfbb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe34f=['securePassword','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','resetPasswordToken','Password\x20reset!','catch','use','passport','passport-local','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','salt','role','disabled','blocked','blockedAt','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','minutes','clearBlockUser','add','getLicense','find','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','Smtp','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','login','authenticate','local-login','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','passwordHistoryLimit'];(function(_0x762129,_0x2014e2){var _0x327472=function(_0x15e8dd){while(--_0x15e8dd){_0x762129['push'](_0x762129['shift']());}};_0x327472(++_0x2014e2);}(_0xe34f,0x19e));var _0xfe34=function(_0x1d353d,_0x71f4f0){_0x1d353d=_0x1d353d-0x0;var _0x1d8714=_0xe34f[_0x1d353d];return _0x1d8714;};'use strict';var util=require('util');var passport=require(_0xfe34('0x0'));var LocalStrategy=require(_0xfe34('0x1'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xfe34('0x2'));var rs=require('randomstring');var moment=require(_0xfe34('0x3'));var db=require(_0xfe34('0x4'))['db'];var authService=require(_0xfe34('0x5'));var utils=require(_0xfe34('0x6'));var client=jayson[_0xfe34('0x7')][_0xfe34('0x8')]({'port':0x232b});function localAuthenticate(_0x288dac,_0x20917f,_0x9e2042,_0x58dee7){var _0x3a6a41,_0x8dcd63;return db[_0xfe34('0x9')][_0xfe34('0xa')]({'where':{'id':0x1},'attributes':[_0xfe34('0xb'),_0xfe34('0xc')],'raw':!![]})['then'](function(_0x25a03a){_0x3a6a41=_0x25a03a;return _0x288dac['findOne']({'attributes':['id',_0xfe34('0xd'),'password',_0xfe34('0xe'),_0xfe34('0xf'),_0xfe34('0x10'),_0xfe34('0x11'),_0xfe34('0x12'),'loginAttempts'],'where':{'name':_0x20917f,'role':{'$or':[_0xfe34('0x13'),_0xfe34('0x14'),_0xfe34('0x15')]}}});})[_0xfe34('0x16')](function(_0x4c2a27){if(!_0x4c2a27||_0x4c2a27&&_0x4c2a27[_0xfe34('0xd')]!==_0x20917f){throw new Error(_0xfe34('0x17'));}else{_0x8dcd63=_0x4c2a27;return _0x8dcd63;}})[_0xfe34('0x16')](function(){_0x8dcd63['authenticate'](_0x9e2042,function(_0x40a3a1,_0x4aa71e){var _0x19f9cc=_0x8dcd63[_0xfe34('0x18')]+0x1;if(_0x40a3a1){return _0x58dee7(_0x40a3a1);}else if(!_0x4aa71e){if(_0x8dcd63[_0xfe34('0x10')]){return _0x58dee7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3a6a41[_0xfe34('0xb')]>0x0){if(_0x8dcd63[_0xfe34('0x11')]){if(_0x3a6a41[_0xfe34('0xc')]>0x0){if(moment(_0x8dcd63[_0xfe34('0x12')])['add'](_0x3a6a41['blockDuration'],_0xfe34('0x19'))>moment()){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1a')](_0x8dcd63,_0x19f9cc,![],null)['then'](function(){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});});}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{if(_0x19f9cc>=_0x3a6a41[_0xfe34('0xb')]){return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,!![],moment())[_0xfe34('0x16')](function(){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});});}else{return utils['clearBlockUser'](_0x8dcd63,_0x19f9cc,![],null)[_0xfe34('0x16')](function(){return _0x58dee7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{if(_0x8dcd63[_0xfe34('0x10')]){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else if(_0x3a6a41['allowedLoginAttempts']>0x0){if(_0x8dcd63['blocked']){if(_0x3a6a41[_0xfe34('0xc')]>0x0){if(moment(_0x8dcd63[_0xfe34('0x12')])[_0xfe34('0x1b')](_0x3a6a41[_0xfe34('0xc')],_0xfe34('0x19'))>moment()){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,![],null)['then'](function(){return utils[_0xfe34('0x1c')](_0x8dcd63);})[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);});}}else{return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}}else{return utils[_0xfe34('0x1a')](_0x8dcd63,0x0,![],null)[_0xfe34('0x16')](function(){return utils[_0xfe34('0x1c')](_0x8dcd63);})[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);})['catch'](function(_0x5313e8){return _0x58dee7(null,![],_0x5313e8);});}}else{if(_0x8dcd63['blocked']){return _0x58dee7(null,![],{'message':_0xfe34('0x17')});}else{return utils[_0xfe34('0x1c')](_0x8dcd63)[_0xfe34('0x16')](function(){return _0x58dee7(null,_0x8dcd63);});}}}});})['catch'](function(_0x30e6bd){return _0x58dee7(null,![],_0x30e6bd);});}function sendServiceMail(_0x4f111e){return db['MailAccount'][_0xfe34('0x1d')]({'where':{'service':!![]},'attributes':['id',_0xfe34('0xd'),_0xfe34('0x1e')],'include':[{'model':db[_0xfe34('0x1f')],'as':'Smtp','include':[{'model':db[_0xfe34('0x20')],'as':'CloudProvider'}]}]})['then'](function(_0x3da0ad){if(!_0x3da0ad){throw new Error(_0xfe34('0x21'));}var _0x224893=_0x3da0ad['getSmtpOptions']();var _0x304852={'account':_0x224893,'message':_['merge']({'from':util[_0xfe34('0x22')](_0xfe34('0x23'),_0x3da0ad[_0xfe34('0xd')],_0x3da0ad['email']||_0x3da0ad[_0xfe34('0x24')]['user'])},_0x4f111e)};return client[_0xfe34('0x25')](_0xfe34('0x26'),_0x304852);})['then'](function(_0x56c260){if(_0x56c260[_0xfe34('0x27')]){throw new Error(util[_0xfe34('0x22')](_0xfe34('0x28'),_0x56c260[_0xfe34('0x27')]['message']||JSON[_0xfe34('0x29')](_0x56c260[_0xfe34('0x27')])));}return!![];});}function handleError(_0x3473ae,_0x118c94,_0x4b9430){return _0x3473ae[_0xfe34('0x2a')](_0x118c94||0x1f4)[_0xfe34('0x2b')]({'message':_0x4b9430?_0x4b9430[_0xfe34('0x2c')]||_0x4b9430:''});}exports[_0xfe34('0x2d')]=function(_0x382efb,_0x2df6e4,_0x5f1ab5){passport[_0xfe34('0x2e')](_0xfe34('0x2f'),function(_0x30336a,_0x4df23c,_0x379c18){var _0x32ce0d=_0x30336a||_0x379c18;if(_0x32ce0d){return handleError(_0x2df6e4,0x191,_0x32ce0d);}if(!_0x4df23c){return handleError(_0x2df6e4,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x152df1={'payload':{'id':_0x4df23c['id'],'role':_0x4df23c[_0xfe34('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0xfe34('0x30')](_0x152df1)[_0xfe34('0x16')](function(_0x48466b){_0x2df6e4[_0xfe34('0x31')]({'id':_0x4df23c['id'],'token':_0x48466b,'statusCall':'','isAlreadyLogged':_0x4df23c[_0xfe34('0x32')]});});}})(_0x382efb,_0x2df6e4,_0x5f1ab5);};exports['forgot']=function(_0x3f845d,_0xc1ddba){if(!_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')]){return handleError(_0xc1ddba,0x1f4,{'message':_0xfe34('0x34')});}var _0x5ad626=rs[_0xfe34('0x35')]();_0x3f845d['body']['email']=_0x3f845d['body'][_0xfe34('0x1e')]['trim']()['toLowerCase']();var _0xf204d6;return db[_0xfe34('0x9')][_0xfe34('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xfe34('0xc')],'raw':!![]})['then'](function(_0x39249b){_0xf204d6=_0x39249b;return db['User'][_0xfe34('0x1d')]({'where':{'email':_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')]}});})[_0xfe34('0x16')](function(_0x5949e2){if(!_0x5949e2){throw new Error(_0xfe34('0x36'));}if(_0x5949e2['disabled']){throw new Error(_0xfe34('0x37'));}if(_0x5949e2[_0xfe34('0x11')]){if(moment(_0x5949e2['blockedAt'])['add'](_0xf204d6[_0xfe34('0xc')],_0xfe34('0x19'))>moment()){throw new Error(_0xfe34('0x38'));}else{_0x5949e2[_0xfe34('0x11')]=![];_0x5949e2[_0xfe34('0x12')]=null;}}_0x5949e2['resetPasswordToken']=_0x5ad626;_0x5949e2[_0xfe34('0x39')]=Date['now']()+0x36ee80;return _0x5949e2[_0xfe34('0x3a')]();})['then'](function(){return sendServiceMail({'to':_0x3f845d[_0xfe34('0x33')][_0xfe34('0x1e')],'subject':_0xfe34('0x3b'),'text':_0xfe34('0x3c')+_0xfe34('0x3d')+'https://'+_0x3f845d[_0xfe34('0x3e')][_0xfe34('0x3f')]+_0xfe34('0x40')+_0x5ad626+'\x0a\x0a'+_0xfe34('0x41')});})['then'](function(){_0xc1ddba[_0xfe34('0x2a')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x4efd75){return handleError(_0xc1ddba,0x1f4,_0x4efd75);});};exports['reset']=function(_0x59278a,_0x5a4c6d){return db[_0xfe34('0x42')][_0xfe34('0x1d')]({'where':{'resetPasswordToken':_0x59278a[_0xfe34('0x43')][_0xfe34('0x44')],'resetPasswordExpires':{'$gt':Date[_0xfe34('0x45')]()}}})[_0xfe34('0x16')](function(_0x92a4aa){if(!_0x92a4aa){throw new Error(_0xfe34('0x46'));}return db[_0xfe34('0x9')]['findOne']({'attributes':['id','securePassword','enforcePasswordHistory',_0xfe34('0x47')]})[_0xfe34('0x16')](function(_0x341570){if(_0x341570[_0xfe34('0x48')])authService[_0xfe34('0x49')](_0x59278a[_0xfe34('0x33')][_0xfe34('0x4a')]);if(!_0x341570['enforcePasswordHistory']||!_0x92a4aa['previousPasswords'])return _0x92a4aa;authService[_0xfe34('0x4b')](_0x59278a[_0xfe34('0x33')]['password'],_0x92a4aa[_0xfe34('0x4c')],_0x341570['passwordHistoryLimit']);return _0x92a4aa;})['then'](function(){_0x92a4aa[_0xfe34('0x4a')]=_0x59278a['body'][_0xfe34('0x4a')];_0x92a4aa[_0xfe34('0x4d')]=null;_0x92a4aa['resetPasswordExpires']=null;return _0x92a4aa[_0xfe34('0x3a')]();});})['then'](function(){_0x5a4c6d[_0xfe34('0x2a')](0xc8)['send']({'message':_0xfe34('0x4e')});})[_0xfe34('0x4f')](function(_0x30d7ce){return handleError(_0x5a4c6d,0x1f4,_0x30d7ce);});};passport[_0xfe34('0x50')](_0xfe34('0x2f'),new LocalStrategy({'usernameField':_0xfe34('0xd'),'passwordField':_0xfe34('0x4a')},function(_0x3631bc,_0x3c3d09,_0x2c2a33){return localAuthenticate(db[_0xfe34('0x42')],_0x3631bc,_0x3c3d09,_0x2c2a33);}));
\ No newline at end of file
+var _0x862f=['online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','host','/reset/','status','Reset\x20Email\x20sent!','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','validatePasswordPattern','previousPasswords','save','use','local-login','util','passport','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','client','Setting','blockDuration','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','add','clearBlockUser','allowedLoginAttempts','minutes','getLicense','catch','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','user','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x31f2e2,_0x23a432){var _0x2136e5=function(_0x4e4554){while(--_0x4e4554){_0x31f2e2['push'](_0x31f2e2['shift']());}};_0x2136e5(++_0x23a432);}(_0x862f,0xf1));var _0xf862=function(_0x1f4811,_0x53abb2){_0x1f4811=_0x1f4811-0x0;var _0x28b51a=_0x862f[_0x1f4811];return _0x28b51a;};'use strict';var util=require(_0xf862('0x0'));var passport=require(_0xf862('0x1'));var LocalStrategy=require('passport-local')[_0xf862('0x2')];var jayson=require(_0xf862('0x3'));var _=require(_0xf862('0x4'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xf862('0x5'))['db'];var authService=require(_0xf862('0x6'));var utils=require('../../config/utils');var client=jayson[_0xf862('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x3ce5a8,_0xc9199a,_0x351eea,_0xf1f6cc){var _0x5db921,_0x368ba5;return db[_0xf862('0x8')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf862('0x9')],'raw':!![]})['then'](function(_0x28d58f){_0x5db921=_0x28d58f;return _0x3ce5a8['findOne']({'attributes':['id',_0xf862('0xa'),_0xf862('0xb'),_0xf862('0xc'),_0xf862('0xd'),_0xf862('0xe'),'blocked',_0xf862('0xf'),_0xf862('0x10')],'where':{'name':_0xc9199a,'role':{'$or':[_0xf862('0x11'),'user',_0xf862('0x12')]}}});})[_0xf862('0x13')](function(_0x58bf87){if(!_0x58bf87||_0x58bf87&&_0x58bf87['name']!==_0xc9199a){throw new Error(_0xf862('0x14'));}else{_0x368ba5=_0x58bf87;return _0x368ba5;}})[_0xf862('0x13')](function(){_0x368ba5[_0xf862('0x15')](_0x351eea,function(_0x2916ff,_0x37fa6b){var _0x5083e0=_0x368ba5[_0xf862('0x10')]+0x1;if(_0x2916ff){return _0xf1f6cc(_0x2916ff);}else if(!_0x37fa6b){if(_0x368ba5[_0xf862('0xe')]){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else if(_0x5db921['allowedLoginAttempts']>0x0){if(_0x368ba5[_0xf862('0x16')]){if(_0x5db921[_0xf862('0x9')]>0x0){if(moment(_0x368ba5['blockedAt'])[_0xf862('0x17')](_0x5db921[_0xf862('0x9')],'minutes')>moment()){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x18')](_0x368ba5,_0x5083e0,![],null)[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});});}}else{return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5083e0>=_0x5db921[_0xf862('0x19')]){return utils[_0xf862('0x18')](_0x368ba5,0x0,!![],moment())[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x368ba5,_0x5083e0,![],null)[_0xf862('0x13')](function(){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});});}}}else{return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}}else{if(_0x368ba5[_0xf862('0xe')]){return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x5db921[_0xf862('0x19')]>0x0){if(_0x368ba5[_0xf862('0x16')]){if(_0x5db921[_0xf862('0x9')]>0x0){if(moment(_0x368ba5[_0xf862('0xf')])[_0xf862('0x17')](_0x5db921[_0xf862('0x9')],_0xf862('0x1a'))>moment()){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x18')](_0x368ba5,0x0,![],null)[_0xf862('0x13')](function(){return utils[_0xf862('0x1b')](_0x368ba5);})[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);});}}else{return _0xf1f6cc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x368ba5,0x0,![],null)['then'](function(){return utils[_0xf862('0x1b')](_0x368ba5);})[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);})['catch'](function(_0xc86c67){return _0xf1f6cc(null,![],_0xc86c67);});}}else{if(_0x368ba5['blocked']){return _0xf1f6cc(null,![],{'message':_0xf862('0x14')});}else{return utils[_0xf862('0x1b')](_0x368ba5)[_0xf862('0x13')](function(){return _0xf1f6cc(null,_0x368ba5);});}}}});})[_0xf862('0x1c')](function(_0x217c51){return _0xf1f6cc(null,![],_0x217c51);});}function sendServiceMail(_0x326865){return db['MailAccount'][_0xf862('0x1d')]({'where':{'service':!![]},'attributes':['id','name',_0xf862('0x1e')],'include':[{'model':db[_0xf862('0x1f')],'as':_0xf862('0x20'),'include':[{'model':db[_0xf862('0x21')],'as':_0xf862('0x21')}]}]})[_0xf862('0x13')](function(_0x5121d6){if(!_0x5121d6){throw new Error(_0xf862('0x22'));}var _0x21a1cb=_0x5121d6[_0xf862('0x23')]();var _0x3fe678={'account':_0x21a1cb,'message':_[_0xf862('0x24')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x5121d6[_0xf862('0xa')],_0x5121d6[_0xf862('0x1e')]||_0x5121d6[_0xf862('0x20')][_0xf862('0x25')])},_0x326865)};return client['request'](_0xf862('0x26'),_0x3fe678);})[_0xf862('0x13')](function(_0x309f56){if(_0x309f56['error']){throw new Error(util['format'](_0xf862('0x27'),_0x309f56[_0xf862('0x28')][_0xf862('0x29')]||JSON['stringify'](_0x309f56[_0xf862('0x28')])));}return!![];});}function handleError(_0x3fd405,_0x22bc37,_0x154fd2){return _0x3fd405['status'](_0x22bc37||0x1f4)[_0xf862('0x2a')]({'message':_0x154fd2?_0x154fd2['message']||_0x154fd2:''});}exports[_0xf862('0x2b')]=function(_0x226ab5,_0x12fda3,_0x250814){passport[_0xf862('0x15')]('local-login',function(_0x50db8e,_0xfdb140,_0x472f58){var _0x23dc1d=_0x50db8e||_0x472f58;if(_0x23dc1d){return handleError(_0x12fda3,0x191,_0x23dc1d);}if(!_0xfdb140){return handleError(_0x12fda3,0x194,{'message':_0xf862('0x2c')});}else{var _0x137ad1={'payload':{'id':_0xfdb140['id'],'role':_0xfdb140[_0xf862('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xf862('0x2d')](_0x137ad1)[_0xf862('0x13')](function(_0x550698){_0x12fda3[_0xf862('0x2e')]({'id':_0xfdb140['id'],'token':_0x550698,'statusCall':'','isAlreadyLogged':_0xfdb140[_0xf862('0x2f')]});});}})(_0x226ab5,_0x12fda3,_0x250814);};exports[_0xf862('0x30')]=function(_0x504b56,_0x3f477d){if(!_0x504b56[_0xf862('0x31')]['email']){return handleError(_0x3f477d,0x1f4,{'message':_0xf862('0x32')});}var _0x8bb2bf=rs[_0xf862('0x33')]();_0x504b56[_0xf862('0x31')][_0xf862('0x1e')]=_0x504b56['body'][_0xf862('0x1e')][_0xf862('0x34')]()[_0xf862('0x35')]();var _0x13a57c;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf862('0x9')],'raw':!![]})['then'](function(_0x3dbeb2){_0x13a57c=_0x3dbeb2;return db[_0xf862('0x36')][_0xf862('0x1d')]({'where':{'email':_0x504b56['body']['email']}});})['then'](function(_0x4e0edd){if(!_0x4e0edd){throw new Error(_0xf862('0x37'));}if(_0x4e0edd[_0xf862('0xe')]){throw new Error(_0xf862('0x38'));}if(_0x4e0edd[_0xf862('0x16')]){if(moment(_0x4e0edd[_0xf862('0xf')])[_0xf862('0x17')](_0x13a57c[_0xf862('0x9')],'minutes')>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4e0edd[_0xf862('0x16')]=![];_0x4e0edd['blockedAt']=null;}}_0x4e0edd[_0xf862('0x39')]=_0x8bb2bf;_0x4e0edd[_0xf862('0x3a')]=Date[_0xf862('0x3b')]()+0x36ee80;return _0x4e0edd['save']();})[_0xf862('0x13')](function(){return sendServiceMail({'to':_0x504b56[_0xf862('0x31')][_0xf862('0x1e')],'subject':_0xf862('0x3c'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xf862('0x3d')+'https://'+_0x504b56['headers'][_0xf862('0x3e')]+_0xf862('0x3f')+_0x8bb2bf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})['then'](function(){_0x3f477d[_0xf862('0x40')](0xc8)[_0xf862('0x2a')]({'message':_0xf862('0x41')});})[_0xf862('0x1c')](function(_0xd9e635){return handleError(_0x3f477d,0x1f4,_0xd9e635);});};exports['reset']=function(_0x89aadd,_0x2502de){return db[_0xf862('0x36')][_0xf862('0x1d')]({'where':{'resetPasswordToken':_0x89aadd['params']['token'],'resetPasswordExpires':{'$gt':Date[_0xf862('0x3b')]()}}})[_0xf862('0x13')](function(_0x527b33){if(!_0x527b33){throw new Error(_0xf862('0x42'));}return db['Setting']['findOne']({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0xf862('0x13')](function(_0x46635e){if(_0x46635e['securePassword'])authService[_0xf862('0x43')](_0x89aadd[_0xf862('0x31')][_0xf862('0xb')]);if(!_0x46635e['enforcePasswordHistory']||!_0x527b33[_0xf862('0x44')])return _0x527b33;authService['validatePasswordHistory'](_0x89aadd[_0xf862('0x31')][_0xf862('0xb')],_0x527b33['previousPasswords'],_0x46635e['passwordHistoryLimit']);return _0x527b33;})['then'](function(){_0x527b33[_0xf862('0xb')]=_0x89aadd[_0xf862('0x31')][_0xf862('0xb')];_0x527b33[_0xf862('0x39')]=null;_0x527b33[_0xf862('0x3a')]=null;return _0x527b33[_0xf862('0x45')]();});})[_0xf862('0x13')](function(){_0x2502de['status'](0xc8)[_0xf862('0x2a')]({'message':'Password\x20reset!'});})['catch'](function(_0x306e83){return handleError(_0x2502de,0x1f4,_0x306e83);});};passport[_0xf862('0x46')](_0xf862('0x47'),new LocalStrategy({'usernameField':_0xf862('0xa'),'passwordField':_0xf862('0xb')},function(_0x38f157,_0x2eead7,_0x1b7bab){return localAuthenticate(db['User'],_0x38f157,_0x2eead7,_0x1b7bab);}));
\ No newline at end of file
index 1ea2441..873c20c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf5a=['login','post','/forgot','forgot','reset','exports','express','Router','./authLocal.controller'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0xbf5a,0x177));var _0xabf5=function(_0x242a25,_0x5e89fa){_0x242a25=_0x242a25-0x0;var _0x63ce6c=_0xbf5a[_0x242a25];return _0x63ce6c;};'use strict';var express=require(_0xabf5('0x0'));var router=express[_0xabf5('0x1')]();var controller=require(_0xabf5('0x2'));router['post']('/',controller[_0xabf5('0x3')]);router[_0xabf5('0x4')](_0xabf5('0x5'),controller[_0xabf5('0x6')]);router[_0xabf5('0x4')]('/reset/:token',controller[_0xabf5('0x7')]);module[_0xabf5('0x8')]=router;
\ No newline at end of file
+var _0xa9e2=['Router','post','/forgot','forgot','/reset/:token','reset','exports','express'];(function(_0x4e46ec,_0xa6c629){var _0x2fdfe0=function(_0x3a77ab){while(--_0x3a77ab){_0x4e46ec['push'](_0x4e46ec['shift']());}};_0x2fdfe0(++_0xa6c629);}(_0xa9e2,0xf7));var _0x2a9e=function(_0xf2691e,_0x2eafbe){_0xf2691e=_0xf2691e-0x0;var _0x439e8c=_0xa9e2[_0xf2691e];return _0x439e8c;};'use strict';var express=require(_0x2a9e('0x0'));var router=express[_0x2a9e('0x1')]();var controller=require('./authLocal.controller');router[_0x2a9e('0x2')]('/',controller['login']);router[_0x2a9e('0x2')](_0x2a9e('0x3'),controller[_0x2a9e('0x4')]);router['post'](_0x2a9e('0x5'),controller[_0x2a9e('0x6')]);module[_0x2a9e('0x7')]=router;
\ No newline at end of file
index ed0494f..46c043f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34d2=['exports','STRING','BOOLEAN','sequelize'];(function(_0x511f3c,_0x5a4c42){var _0x466c5a=function(_0x1821bd){while(--_0x1821bd){_0x511f3c['push'](_0x511f3c['shift']());}};_0x466c5a(++_0x5a4c42);}(_0x34d2,0x143));var _0x234d=function(_0x264733,_0x13200e){_0x264733=_0x264733-0x0;var _0x433704=_0x34d2[_0x264733];return _0x433704;};'use strict';var Sequelize=require(_0x234d('0x0'));module[_0x234d('0x1')]={'name':{'type':Sequelize[_0x234d('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x234d('0x2')]},'status':{'type':Sequelize[_0x234d('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}};
\ No newline at end of file
+var _0xebc9=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x4a379b,_0x334e8b){var _0x2e2509=function(_0x82c3b3){while(--_0x82c3b3){_0x4a379b['push'](_0x4a379b['shift']());}};_0x2e2509(++_0x334e8b);}(_0xebc9,0x95));var _0x9ebc=function(_0x3387bd,_0x4639d9){_0x3387bd=_0x3387bd-0x0;var _0x4cf483=_0xebc9[_0x3387bd];return _0x4cf483;};'use strict';var Sequelize=require(_0x9ebc('0x0'));module[_0x9ebc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9ebc('0x2')]},'description':{'type':Sequelize[_0x9ebc('0x2')]},'status':{'type':Sequelize[_0x9ebc('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9ebc('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index cd3e572..1518df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fb1=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','name','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Automation','includeAll','findAll','rows','show','params','keys','include','catch','create','update','body','find','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x2a3688,_0x3923aa){var _0x255227=function(_0x5d9443){while(--_0x5d9443){_0x2a3688['push'](_0x2a3688['shift']());}};_0x255227(++_0x3923aa);}(_0x9fb1,0x1e6));var _0x19fb=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x9fb1[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0x19fb('0x0'));var rimraf=require(_0x19fb('0x1'));var zipdir=require(_0x19fb('0x2'));var jsonpatch=require(_0x19fb('0x3'));var rp=require(_0x19fb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x19fb('0x5'));var util=require('util');var path=require(_0x19fb('0x6'));var sox=require(_0x19fb('0x7'));var csv=require(_0x19fb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19fb('0x9'));var _=require('lodash');var squel=require(_0x19fb('0xa'));var crypto=require(_0x19fb('0xb'));var jsforce=require(_0x19fb('0xc'));var deskjs=require(_0x19fb('0xd'));var toCsv=require(_0x19fb('0x8'));var querystring=require('querystring');var Papa=require(_0x19fb('0xe'));var Redis=require(_0x19fb('0xf'));var authService=require(_0x19fb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x19fb('0x11'));var hardwareService=require(_0x19fb('0x12'));var logger=require(_0x19fb('0x13'))(_0x19fb('0x14'));var utils=require(_0x19fb('0x15'));var config=require(_0x19fb('0x16'));var licenseUtil=require(_0x19fb('0x17'));var db=require(_0x19fb('0x18'))['db'];function respondWithStatusCode(_0x39ed49,_0x1fe4b4){_0x1fe4b4=_0x1fe4b4||0xcc;return function(_0x41188a){if(_0x41188a){return _0x39ed49[_0x19fb('0x19')](_0x1fe4b4);}return _0x39ed49[_0x19fb('0x1a')](_0x1fe4b4)[_0x19fb('0x1b')]();};}function respondWithResult(_0x3c627d,_0x8dc8de){_0x8dc8de=_0x8dc8de||0xc8;return function(_0x9de498){if(_0x9de498){return _0x3c627d[_0x19fb('0x1a')](_0x8dc8de)['json'](_0x9de498);}};}function respondWithFilteredResult(_0x4db650,_0xa476f0){return function(_0x10f11e){if(_0x10f11e){var _0x2d2e9c=typeof _0xa476f0[_0x19fb('0x1c')]===_0x19fb('0x1d')&&typeof _0xa476f0[_0x19fb('0x1e')]===_0x19fb('0x1d');var _0x317ccd=_0x10f11e[_0x19fb('0x1f')];var _0x41c719=_0x2d2e9c?0x0:_0xa476f0[_0x19fb('0x1c')];var _0x2d9f11=_0x2d2e9c?_0x10f11e[_0x19fb('0x1f')]:_0xa476f0['offset']+_0xa476f0['limit'];var _0x47266f;if(_0x2d9f11>=_0x317ccd){_0x2d9f11=_0x317ccd;_0x47266f=0xc8;}else{_0x47266f=0xce;}_0x4db650[_0x19fb('0x1a')](_0x47266f);return _0x4db650['set'](_0x19fb('0x20'),_0x41c719+'-'+_0x2d9f11+'/'+_0x317ccd)['json'](_0x10f11e);}return null;};}function patchUpdates(_0x491cd3){return function(_0x20d991){try{jsonpatch[_0x19fb('0x21')](_0x20d991,_0x491cd3,!![]);}catch(_0x3a1bf2){return BPromise[_0x19fb('0x22')](_0x3a1bf2);}return _0x20d991[_0x19fb('0x23')]();};}function saveUpdates(_0x2fc541,_0x231d4d){return function(_0x3737dd){if(_0x3737dd){return _0x3737dd['update'](_0x2fc541)[_0x19fb('0x24')](function(_0x9dc3){return _0x9dc3;});}return null;};}function removeEntity(_0xfd2fd1,_0x288790){return function(_0x364698){if(_0x364698){return _0x364698[_0x19fb('0x25')]()[_0x19fb('0x24')](function(){_0xfd2fd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xea3758,_0x3fe81c){return function(_0x410c44){if(!_0x410c44){_0xea3758[_0x19fb('0x19')](0x194);}return _0x410c44;};}function handleError(_0x8e3a9b,_0x3e9dff){_0x3e9dff=_0x3e9dff||0x1f4;return function(_0x2d9373){logger['error'](_0x2d9373['stack']);if(_0x2d9373[_0x19fb('0x26')]){delete _0x2d9373[_0x19fb('0x26')];}_0x8e3a9b['status'](_0x3e9dff)['send'](_0x2d9373);};}exports['index']=function(_0x3871c5,_0x50014a){var _0x184741={},_0x1b1e68={},_0x13c556={'count':0x0,'rows':[]};var _0x92f700=_[_0x19fb('0x27')](db['Automation'][_0x19fb('0x28')],function(_0xd4bcf3){return{'name':_0xd4bcf3[_0x19fb('0x29')],'type':_0xd4bcf3['type'][_0x19fb('0x2a')]};});_0x1b1e68[_0x19fb('0x2b')]=_[_0x19fb('0x27')](_0x92f700,'name');_0x1b1e68[_0x19fb('0x2c')]=_['keys'](_0x3871c5[_0x19fb('0x2c')]);_0x1b1e68[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x1b1e68[_0x19fb('0x2b')],_0x1b1e68[_0x19fb('0x2c')]);_0x184741['attributes']=_['intersection'](_0x1b1e68[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x184741[_0x19fb('0x30')]=_0x184741[_0x19fb('0x30')][_0x19fb('0x31')]?_0x184741[_0x19fb('0x30')]:_0x1b1e68['model'];if(!_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x32')]('nolimit')){_0x184741[_0x19fb('0x1e')]=qs[_0x19fb('0x1e')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x184741[_0x19fb('0x1c')]=qs[_0x19fb('0x1c')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x1c')]);}_0x184741[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x184741[_0x19fb('0x35')]=qs[_0x19fb('0x2d')](_[_0x19fb('0x36')](_0x3871c5[_0x19fb('0x2c')],_0x1b1e68['filters']),_0x92f700);if(_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x37')]){_0x184741[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x184741[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x92f700,function(_0x4b60c2){if(_0x4b60c2[_0x19fb('0x39')]!==_0x19fb('0x3a')){var _0x471b26={};_0x471b26[_0x4b60c2[_0x19fb('0x26')]]={'$like':'%'+_0x3871c5[_0x19fb('0x2c')]['filter']+'%'};return _0x471b26;}})});}_0x184741=_[_0x19fb('0x38')]({},_0x184741,_0x3871c5[_0x19fb('0x3b')]);var _0x18e493={'where':_0x184741[_0x19fb('0x35')]};return db[_0x19fb('0x3c')][_0x19fb('0x1f')](_0x18e493)['then'](function(_0x28fbe5){_0x13c556[_0x19fb('0x1f')]=_0x28fbe5;if(_0x3871c5[_0x19fb('0x2c')][_0x19fb('0x3d')]){_0x184741['include']=[{'all':!![]}];}return db['Automation'][_0x19fb('0x3e')](_0x184741);})[_0x19fb('0x24')](function(_0x402473){_0x13c556[_0x19fb('0x3f')]=_0x402473;return _0x13c556;})[_0x19fb('0x24')](respondWithFilteredResult(_0x50014a,_0x184741))['catch'](handleError(_0x50014a,null));};exports[_0x19fb('0x40')]=function(_0x2b4f3d,_0x5d946a){var _0x222b4b={'raw':![],'where':{'id':_0x2b4f3d[_0x19fb('0x41')]['id']}},_0x5becee={};_0x5becee[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x3c')][_0x19fb('0x28')]);_0x5becee[_0x19fb('0x2c')]=_[_0x19fb('0x42')](_0x2b4f3d[_0x19fb('0x2c')]);_0x5becee[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x5becee[_0x19fb('0x2b')],_0x5becee[_0x19fb('0x2c')]);_0x222b4b[_0x19fb('0x30')]=_[_0x19fb('0x2e')](_0x5becee[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x2b4f3d['query'][_0x19fb('0x2f')]));_0x222b4b[_0x19fb('0x30')]=_0x222b4b[_0x19fb('0x30')]['length']?_0x222b4b['attributes']:_0x5becee[_0x19fb('0x2b')];if(_0x2b4f3d[_0x19fb('0x2c')][_0x19fb('0x3d')]){_0x222b4b[_0x19fb('0x43')]=[{'all':!![]}];}_0x222b4b=_[_0x19fb('0x38')]({},_0x222b4b,_0x2b4f3d['options']);return db[_0x19fb('0x3c')]['find'](_0x222b4b)[_0x19fb('0x24')](handleEntityNotFound(_0x5d946a,null))[_0x19fb('0x24')](respondWithResult(_0x5d946a,null))[_0x19fb('0x44')](handleError(_0x5d946a,null));};exports[_0x19fb('0x45')]=function(_0xaeee6,_0x2ff938){return db[_0x19fb('0x3c')][_0x19fb('0x45')](_0xaeee6['body'],{})[_0x19fb('0x24')](respondWithResult(_0x2ff938,0xc9))[_0x19fb('0x44')](handleError(_0x2ff938,null));};exports[_0x19fb('0x46')]=function(_0xc65755,_0x109e07){if(_0xc65755[_0x19fb('0x47')]['id']){delete _0xc65755[_0x19fb('0x47')]['id'];}return db[_0x19fb('0x3c')][_0x19fb('0x48')]({'where':{'id':_0xc65755['params']['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x109e07,null))['then'](saveUpdates(_0xc65755[_0x19fb('0x47')],null))['then'](respondWithResult(_0x109e07,null))['catch'](handleError(_0x109e07,null));};exports[_0x19fb('0x25')]=function(_0x22bdb4,_0x335a64){return db['Automation'][_0x19fb('0x48')]({'where':{'id':_0x22bdb4[_0x19fb('0x41')]['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x335a64,null))[_0x19fb('0x24')](removeEntity(_0x335a64,null))['catch'](handleError(_0x335a64,null));};exports[_0x19fb('0x49')]=function(_0x33adb2,_0x47bb07,_0x2e1791){return db[_0x19fb('0x4a')]['find']({'where':{'id':_0x33adb2['params']['id']}})['then'](handleEntityNotFound(_0x47bb07,null))[_0x19fb('0x24')](function(_0xa05b4e){if(_0xa05b4e){return _0xa05b4e[_0x19fb('0x49')](_0x33adb2[_0x19fb('0x47')][_0x19fb('0x4b')],_[_0x19fb('0x4c')](_0x33adb2[_0x19fb('0x47')],[_0x19fb('0x4b'),'id'])||{});}})[_0x19fb('0x24')](respondWithResult(_0x47bb07,null))[_0x19fb('0x44')](handleError(_0x47bb07,null));};exports[_0x19fb('0x4d')]=function(_0x343f69,_0x397f13,_0x439524){var _0x4736c8={};var _0x39c152={};var _0x4111e2;var _0x186164;return db[_0x19fb('0x3c')][_0x19fb('0x4e')]({'where':{'id':_0x343f69[_0x19fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x397f13,null))['then'](function(_0x586dd8){if(_0x586dd8){_0x4111e2=_0x586dd8;_0x39c152[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x4a')][_0x19fb('0x28')]);_0x39c152[_0x19fb('0x2c')]=_[_0x19fb('0x42')](_0x343f69[_0x19fb('0x2c')]);_0x39c152[_0x19fb('0x2d')]=_[_0x19fb('0x2e')](_0x39c152[_0x19fb('0x2b')],_0x39c152[_0x19fb('0x2c')]);_0x4736c8[_0x19fb('0x30')]=_[_0x19fb('0x2e')](_0x39c152[_0x19fb('0x2b')],qs[_0x19fb('0x2f')](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x4736c8[_0x19fb('0x30')]=_0x4736c8[_0x19fb('0x30')][_0x19fb('0x31')]?_0x4736c8[_0x19fb('0x30')]:_0x39c152[_0x19fb('0x2b')];_0x4736c8[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x4736c8[_0x19fb('0x35')]=qs[_0x19fb('0x2d')](_[_0x19fb('0x36')](_0x343f69[_0x19fb('0x2c')],_0x39c152[_0x19fb('0x2d')]));if(_0x343f69['query']['filter']){_0x4736c8[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x4736c8[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x4736c8[_0x19fb('0x30')],function(_0x1810fd){var _0x2221d2={};_0x2221d2[_0x1810fd]={'$like':'%'+_0x343f69['query']['filter']+'%'};return _0x2221d2;})});}_0x4736c8=_['merge']({},_0x4736c8,_0x343f69[_0x19fb('0x3b')]);return _0x4111e2['getConditions'](_0x4736c8);}})[_0x19fb('0x24')](function(_0x36ec66){if(_0x36ec66){_0x186164=_0x36ec66[_0x19fb('0x31')];if(!_0x343f69[_0x19fb('0x2c')][_0x19fb('0x32')](_0x19fb('0x4f'))){_0x4736c8['limit']=qs['limit'](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x4736c8[_0x19fb('0x1c')]=qs['offset'](_0x343f69[_0x19fb('0x2c')][_0x19fb('0x1c')]);}return _0x4111e2[_0x19fb('0x4d')](_0x4736c8);}})[_0x19fb('0x24')](function(_0x42e115){if(_0x42e115){return _0x42e115?{'count':_0x186164,'rows':_0x42e115}:null;}})[_0x19fb('0x24')](respondWithResult(_0x397f13,null))[_0x19fb('0x44')](handleError(_0x397f13,null));};exports['addActions']=function(_0x16387c,_0x550b6c,_0xaf0ac7){return db[_0x19fb('0x50')]['find']({'where':{'id':_0x16387c[_0x19fb('0x41')]['id']}})[_0x19fb('0x24')](handleEntityNotFound(_0x550b6c,null))['then'](function(_0x4fb6cb){if(_0x4fb6cb){return _0x4fb6cb[_0x19fb('0x51')](_0x16387c['body'][_0x19fb('0x4b')],_['omit'](_0x16387c[_0x19fb('0x47')],[_0x19fb('0x4b'),'id'])||{});}})[_0x19fb('0x24')](respondWithResult(_0x550b6c,null))[_0x19fb('0x44')](handleError(_0x550b6c,null));};exports[_0x19fb('0x52')]=function(_0x5563b1,_0x4e0350,_0x1e155c){var _0x3f0a3b={};var _0x49f0ee={};var _0x8d460a;var _0x281c8c;return db[_0x19fb('0x3c')][_0x19fb('0x4e')]({'where':{'id':_0x5563b1[_0x19fb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e0350,null))[_0x19fb('0x24')](function(_0x424aae){if(_0x424aae){_0x8d460a=_0x424aae;_0x49f0ee[_0x19fb('0x2b')]=_[_0x19fb('0x42')](db[_0x19fb('0x50')][_0x19fb('0x28')]);_0x49f0ee[_0x19fb('0x2c')]=_['keys'](_0x5563b1[_0x19fb('0x2c')]);_0x49f0ee['filters']=_['intersection'](_0x49f0ee[_0x19fb('0x2b')],_0x49f0ee[_0x19fb('0x2c')]);_0x3f0a3b[_0x19fb('0x30')]=_['intersection'](_0x49f0ee[_0x19fb('0x2b')],qs['fields'](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x2f')]));_0x3f0a3b[_0x19fb('0x30')]=_0x3f0a3b[_0x19fb('0x30')][_0x19fb('0x31')]?_0x3f0a3b[_0x19fb('0x30')]:_0x49f0ee[_0x19fb('0x2b')];_0x3f0a3b[_0x19fb('0x33')]=qs[_0x19fb('0x34')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x34')]);_0x3f0a3b[_0x19fb('0x35')]=qs['filters'](_['pick'](_0x5563b1[_0x19fb('0x2c')],_0x49f0ee[_0x19fb('0x2d')]));if(_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x37')]){_0x3f0a3b[_0x19fb('0x35')]=_[_0x19fb('0x38')](_0x3f0a3b[_0x19fb('0x35')],{'$or':_[_0x19fb('0x27')](_0x3f0a3b[_0x19fb('0x30')],function(_0x510f6c){var _0x29cf26={};_0x29cf26[_0x510f6c]={'$like':'%'+_0x5563b1['query'][_0x19fb('0x37')]+'%'};return _0x29cf26;})});}_0x3f0a3b=_[_0x19fb('0x38')]({},_0x3f0a3b,_0x5563b1[_0x19fb('0x3b')]);return _0x8d460a[_0x19fb('0x52')](_0x3f0a3b);}})[_0x19fb('0x24')](function(_0x50dd79){if(_0x50dd79){_0x281c8c=_0x50dd79[_0x19fb('0x31')];if(!_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x32')](_0x19fb('0x4f'))){_0x3f0a3b['limit']=qs[_0x19fb('0x1e')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x1e')]);_0x3f0a3b[_0x19fb('0x1c')]=qs[_0x19fb('0x1c')](_0x5563b1[_0x19fb('0x2c')][_0x19fb('0x1c')]);}return _0x8d460a['getActions'](_0x3f0a3b);}})[_0x19fb('0x24')](function(_0x791811){if(_0x791811){return _0x791811?{'count':_0x281c8c,'rows':_0x791811}:null;}})[_0x19fb('0x24')](respondWithResult(_0x4e0350,null))['catch'](handleError(_0x4e0350,null));};
\ No newline at end of file
+var _0x35ab=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','options','find','catch','create','body','addConditions','ids','omit','getConditions','findOne','Condition','order','addActions','Action','pick','getActions','eml-format','rimraf','zip-dir'];(function(_0xb1b694,_0x3db15c){var _0x5dcaa3=function(_0x492140){while(--_0x492140){_0xb1b694['push'](_0xb1b694['shift']());}};_0x5dcaa3(++_0x3db15c);}(_0x35ab,0xaf));var _0xb35a=function(_0x4c32f5,_0x3dbbf1){_0x4c32f5=_0x4c32f5-0x0;var _0x19cae9=_0x35ab[_0x4c32f5];return _0x19cae9;};'use strict';var emlformat=require(_0xb35a('0x0'));var rimraf=require(_0xb35a('0x1'));var zipdir=require(_0xb35a('0x2'));var jsonpatch=require(_0xb35a('0x3'));var rp=require('request-promise');var moment=require(_0xb35a('0x4'));var BPromise=require(_0xb35a('0x5'));var Mustache=require(_0xb35a('0x6'));var util=require(_0xb35a('0x7'));var path=require(_0xb35a('0x8'));var sox=require(_0xb35a('0x9'));var csv=require(_0xb35a('0xa'));var ejs=require(_0xb35a('0xb'));var fs=require('fs');var fs_extra=require(_0xb35a('0xc'));var _=require(_0xb35a('0xd'));var squel=require(_0xb35a('0xe'));var crypto=require(_0xb35a('0xf'));var jsforce=require(_0xb35a('0x10'));var deskjs=require(_0xb35a('0x11'));var toCsv=require(_0xb35a('0xa'));var querystring=require(_0xb35a('0x12'));var Papa=require(_0xb35a('0x13'));var Redis=require(_0xb35a('0x14'));var authService=require(_0xb35a('0x15'));var qs=require(_0xb35a('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb35a('0x17'))(_0xb35a('0x18'));var utils=require(_0xb35a('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xb35a('0x1a'));var db=require(_0xb35a('0x1b'))['db'];function respondWithStatusCode(_0x5d5044,_0x413aa7){_0x413aa7=_0x413aa7||0xcc;return function(_0x4c274b){if(_0x4c274b){return _0x5d5044[_0xb35a('0x1c')](_0x413aa7);}return _0x5d5044[_0xb35a('0x1d')](_0x413aa7)['end']();};}function respondWithResult(_0x6e71fb,_0x30cbee){_0x30cbee=_0x30cbee||0xc8;return function(_0x466e96){if(_0x466e96){return _0x6e71fb[_0xb35a('0x1d')](_0x30cbee)[_0xb35a('0x1e')](_0x466e96);}};}function respondWithFilteredResult(_0x3ba8c5,_0x3e59eb){return function(_0x33e179){if(_0x33e179){var _0x293a72=typeof _0x3e59eb[_0xb35a('0x1f')]===_0xb35a('0x20')&&typeof _0x3e59eb[_0xb35a('0x21')]===_0xb35a('0x20');var _0x295131=_0x33e179['count'];var _0x1956b9=_0x293a72?0x0:_0x3e59eb[_0xb35a('0x1f')];var _0x314508=_0x293a72?_0x33e179[_0xb35a('0x22')]:_0x3e59eb['offset']+_0x3e59eb[_0xb35a('0x21')];var _0x55cdaf;if(_0x314508>=_0x295131){_0x314508=_0x295131;_0x55cdaf=0xc8;}else{_0x55cdaf=0xce;}_0x3ba8c5[_0xb35a('0x1d')](_0x55cdaf);return _0x3ba8c5[_0xb35a('0x23')](_0xb35a('0x24'),_0x1956b9+'-'+_0x314508+'/'+_0x295131)[_0xb35a('0x1e')](_0x33e179);}return null;};}function patchUpdates(_0x52c5b5){return function(_0x585cef){try{jsonpatch[_0xb35a('0x25')](_0x585cef,_0x52c5b5,!![]);}catch(_0x3a8102){return BPromise[_0xb35a('0x26')](_0x3a8102);}return _0x585cef[_0xb35a('0x27')]();};}function saveUpdates(_0x14e342,_0x6b3fcb){return function(_0x3b78ca){if(_0x3b78ca){return _0x3b78ca['update'](_0x14e342)[_0xb35a('0x28')](function(_0x25a2dd){return _0x25a2dd;});}return null;};}function removeEntity(_0x3e5378,_0x3a2252){return function(_0x140b07){if(_0x140b07){return _0x140b07[_0xb35a('0x29')]()[_0xb35a('0x28')](function(){_0x3e5378['status'](0xcc)[_0xb35a('0x2a')]();});}};}function handleEntityNotFound(_0x124fb6,_0x4c4d9b){return function(_0x32f7e6){if(!_0x32f7e6){_0x124fb6[_0xb35a('0x1c')](0x194);}return _0x32f7e6;};}function handleError(_0x8e058a,_0xa32e68){_0xa32e68=_0xa32e68||0x1f4;return function(_0x19294b){logger[_0xb35a('0x2b')](_0x19294b['stack']);if(_0x19294b[_0xb35a('0x2c')]){delete _0x19294b[_0xb35a('0x2c')];}_0x8e058a[_0xb35a('0x1d')](_0xa32e68)[_0xb35a('0x2d')](_0x19294b);};}exports[_0xb35a('0x2e')]=function(_0xcfb857,_0x51ff3c){var _0x243d96={},_0x3ad2d3={},_0x2d08cd={'count':0x0,'rows':[]};var _0x38792d=_[_0xb35a('0x2f')](db[_0xb35a('0x30')][_0xb35a('0x31')],function(_0x5b7deb){return{'name':_0x5b7deb[_0xb35a('0x32')],'type':_0x5b7deb[_0xb35a('0x33')][_0xb35a('0x34')]};});_0x3ad2d3[_0xb35a('0x35')]=_['map'](_0x38792d,_0xb35a('0x2c'));_0x3ad2d3[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0xcfb857['query']);_0x3ad2d3[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x3ad2d3['model'],_0x3ad2d3[_0xb35a('0x36')]);_0x243d96[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x3ad2d3[_0xb35a('0x35')],qs['fields'](_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x243d96[_0xb35a('0x3a')]=_0x243d96['attributes'][_0xb35a('0x3c')]?_0x243d96['attributes']:_0x3ad2d3['model'];if(!_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3d')](_0xb35a('0x3e'))){_0x243d96[_0xb35a('0x21')]=qs[_0xb35a('0x21')](_0xcfb857['query']['limit']);_0x243d96[_0xb35a('0x1f')]=qs[_0xb35a('0x1f')](_0xcfb857[_0xb35a('0x36')]['offset']);}_0x243d96['order']=qs['sort'](_0xcfb857[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x243d96[_0xb35a('0x40')]=qs[_0xb35a('0x38')](_['pick'](_0xcfb857[_0xb35a('0x36')],_0x3ad2d3[_0xb35a('0x38')]),_0x38792d);if(_0xcfb857[_0xb35a('0x36')][_0xb35a('0x41')]){_0x243d96[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x243d96['where'],{'$or':_[_0xb35a('0x2f')](_0x38792d,function(_0x139ae8){if(_0x139ae8[_0xb35a('0x33')]!==_0xb35a('0x43')){var _0x565e14={};_0x565e14[_0x139ae8[_0xb35a('0x2c')]]={'$like':'%'+_0xcfb857[_0xb35a('0x36')][_0xb35a('0x41')]+'%'};return _0x565e14;}})});}_0x243d96=_[_0xb35a('0x42')]({},_0x243d96,_0xcfb857['options']);var _0x26dbba={'where':_0x243d96[_0xb35a('0x40')]};return db['Automation'][_0xb35a('0x22')](_0x26dbba)[_0xb35a('0x28')](function(_0x28d19e){_0x2d08cd[_0xb35a('0x22')]=_0x28d19e;if(_0xcfb857[_0xb35a('0x36')][_0xb35a('0x44')]){_0x243d96['include']=[{'all':!![]}];}return db[_0xb35a('0x30')][_0xb35a('0x45')](_0x243d96);})[_0xb35a('0x28')](function(_0x5988a1){_0x2d08cd[_0xb35a('0x46')]=_0x5988a1;return _0x2d08cd;})[_0xb35a('0x28')](respondWithFilteredResult(_0x51ff3c,_0x243d96))['catch'](handleError(_0x51ff3c,null));};exports['show']=function(_0x1db02c,_0x1c777e){var _0x9908e7={'raw':![],'where':{'id':_0x1db02c[_0xb35a('0x47')]['id']}},_0x525553={};_0x525553['model']=_['keys'](db[_0xb35a('0x30')][_0xb35a('0x31')]);_0x525553[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0x1db02c[_0xb35a('0x36')]);_0x525553[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x525553['model'],_0x525553[_0xb35a('0x36')]);_0x9908e7[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x525553[_0xb35a('0x35')],qs['fields'](_0x1db02c[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x9908e7[_0xb35a('0x3a')]=_0x9908e7[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x9908e7[_0xb35a('0x3a')]:_0x525553['model'];if(_0x1db02c[_0xb35a('0x36')][_0xb35a('0x44')]){_0x9908e7[_0xb35a('0x48')]=[{'all':!![]}];}_0x9908e7=_[_0xb35a('0x42')]({},_0x9908e7,_0x1db02c[_0xb35a('0x49')]);return db[_0xb35a('0x30')][_0xb35a('0x4a')](_0x9908e7)['then'](handleEntityNotFound(_0x1c777e,null))[_0xb35a('0x28')](respondWithResult(_0x1c777e,null))[_0xb35a('0x4b')](handleError(_0x1c777e,null));};exports[_0xb35a('0x4c')]=function(_0x508baf,_0x54baf3){return db[_0xb35a('0x30')][_0xb35a('0x4c')](_0x508baf[_0xb35a('0x4d')],{})[_0xb35a('0x28')](respondWithResult(_0x54baf3,0xc9))[_0xb35a('0x4b')](handleError(_0x54baf3,null));};exports['update']=function(_0x1caa03,_0x58ffb5){if(_0x1caa03[_0xb35a('0x4d')]['id']){delete _0x1caa03[_0xb35a('0x4d')]['id'];}return db[_0xb35a('0x30')][_0xb35a('0x4a')]({'where':{'id':_0x1caa03['params']['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x58ffb5,null))[_0xb35a('0x28')](saveUpdates(_0x1caa03[_0xb35a('0x4d')],null))['then'](respondWithResult(_0x58ffb5,null))['catch'](handleError(_0x58ffb5,null));};exports[_0xb35a('0x29')]=function(_0x48f450,_0x4c870f){return db['Automation'][_0xb35a('0x4a')]({'where':{'id':_0x48f450['params']['id']}})['then'](handleEntityNotFound(_0x4c870f,null))[_0xb35a('0x28')](removeEntity(_0x4c870f,null))['catch'](handleError(_0x4c870f,null));};exports[_0xb35a('0x4e')]=function(_0x20e1eb,_0x1b77af,_0x3bbb02){return db['Condition'][_0xb35a('0x4a')]({'where':{'id':_0x20e1eb[_0xb35a('0x47')]['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x1b77af,null))['then'](function(_0x5dbe86){if(_0x5dbe86){return _0x5dbe86['addConditions'](_0x20e1eb[_0xb35a('0x4d')][_0xb35a('0x4f')],_[_0xb35a('0x50')](_0x20e1eb[_0xb35a('0x4d')],[_0xb35a('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x1b77af,null))['catch'](handleError(_0x1b77af,null));};exports[_0xb35a('0x51')]=function(_0x2f3935,_0x2f8bb7,_0x2d4bf7){var _0x4178d3={};var _0x2cc593={};var _0x41e002;var _0x2500c5;return db[_0xb35a('0x30')][_0xb35a('0x52')]({'where':{'id':_0x2f3935[_0xb35a('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f8bb7,null))[_0xb35a('0x28')](function(_0x1e8a34){if(_0x1e8a34){_0x41e002=_0x1e8a34;_0x2cc593['model']=_[_0xb35a('0x37')](db[_0xb35a('0x53')][_0xb35a('0x31')]);_0x2cc593[_0xb35a('0x36')]=_[_0xb35a('0x37')](_0x2f3935['query']);_0x2cc593[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x2cc593[_0xb35a('0x35')],_0x2cc593[_0xb35a('0x36')]);_0x4178d3[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x2cc593[_0xb35a('0x35')],qs[_0xb35a('0x3b')](_0x2f3935['query'][_0xb35a('0x3b')]));_0x4178d3[_0xb35a('0x3a')]=_0x4178d3[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x4178d3[_0xb35a('0x3a')]:_0x2cc593[_0xb35a('0x35')];_0x4178d3[_0xb35a('0x54')]=qs[_0xb35a('0x3f')](_0x2f3935[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x4178d3['where']=qs[_0xb35a('0x38')](_['pick'](_0x2f3935['query'],_0x2cc593[_0xb35a('0x38')]));if(_0x2f3935[_0xb35a('0x36')][_0xb35a('0x41')]){_0x4178d3[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x4178d3[_0xb35a('0x40')],{'$or':_[_0xb35a('0x2f')](_0x4178d3[_0xb35a('0x3a')],function(_0x24bee7){var _0x44b4de={};_0x44b4de[_0x24bee7]={'$like':'%'+_0x2f3935['query'][_0xb35a('0x41')]+'%'};return _0x44b4de;})});}_0x4178d3=_[_0xb35a('0x42')]({},_0x4178d3,_0x2f3935[_0xb35a('0x49')]);return _0x41e002[_0xb35a('0x51')](_0x4178d3);}})[_0xb35a('0x28')](function(_0xc1571f){if(_0xc1571f){_0x2500c5=_0xc1571f[_0xb35a('0x3c')];if(!_0x2f3935['query'][_0xb35a('0x3d')](_0xb35a('0x3e'))){_0x4178d3[_0xb35a('0x21')]=qs['limit'](_0x2f3935['query'][_0xb35a('0x21')]);_0x4178d3[_0xb35a('0x1f')]=qs['offset'](_0x2f3935[_0xb35a('0x36')]['offset']);}return _0x41e002[_0xb35a('0x51')](_0x4178d3);}})[_0xb35a('0x28')](function(_0xc4af3d){if(_0xc4af3d){return _0xc4af3d?{'count':_0x2500c5,'rows':_0xc4af3d}:null;}})['then'](respondWithResult(_0x2f8bb7,null))['catch'](handleError(_0x2f8bb7,null));};exports[_0xb35a('0x55')]=function(_0x243ee9,_0x5412a6,_0x1b471a){return db[_0xb35a('0x56')][_0xb35a('0x4a')]({'where':{'id':_0x243ee9['params']['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x5412a6,null))[_0xb35a('0x28')](function(_0x51289f){if(_0x51289f){return _0x51289f['addActions'](_0x243ee9[_0xb35a('0x4d')][_0xb35a('0x4f')],_[_0xb35a('0x50')](_0x243ee9[_0xb35a('0x4d')],[_0xb35a('0x4f'),'id'])||{});}})[_0xb35a('0x28')](respondWithResult(_0x5412a6,null))[_0xb35a('0x4b')](handleError(_0x5412a6,null));};exports['getActions']=function(_0x3881c3,_0x2bff72,_0x4c7cb7){var _0x30bebc={};var _0x20d30a={};var _0x5e01b5;var _0x54777d;return db[_0xb35a('0x30')][_0xb35a('0x52')]({'where':{'id':_0x3881c3[_0xb35a('0x47')]['id']}})[_0xb35a('0x28')](handleEntityNotFound(_0x2bff72,null))[_0xb35a('0x28')](function(_0x5c84b2){if(_0x5c84b2){_0x5e01b5=_0x5c84b2;_0x20d30a['model']=_[_0xb35a('0x37')](db['Action'][_0xb35a('0x31')]);_0x20d30a[_0xb35a('0x36')]=_['keys'](_0x3881c3[_0xb35a('0x36')]);_0x20d30a[_0xb35a('0x38')]=_[_0xb35a('0x39')](_0x20d30a[_0xb35a('0x35')],_0x20d30a[_0xb35a('0x36')]);_0x30bebc[_0xb35a('0x3a')]=_[_0xb35a('0x39')](_0x20d30a[_0xb35a('0x35')],qs[_0xb35a('0x3b')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x3b')]));_0x30bebc[_0xb35a('0x3a')]=_0x30bebc[_0xb35a('0x3a')][_0xb35a('0x3c')]?_0x30bebc[_0xb35a('0x3a')]:_0x20d30a[_0xb35a('0x35')];_0x30bebc[_0xb35a('0x54')]=qs[_0xb35a('0x3f')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x3f')]);_0x30bebc[_0xb35a('0x40')]=qs['filters'](_[_0xb35a('0x57')](_0x3881c3[_0xb35a('0x36')],_0x20d30a[_0xb35a('0x38')]));if(_0x3881c3[_0xb35a('0x36')][_0xb35a('0x41')]){_0x30bebc[_0xb35a('0x40')]=_[_0xb35a('0x42')](_0x30bebc[_0xb35a('0x40')],{'$or':_[_0xb35a('0x2f')](_0x30bebc[_0xb35a('0x3a')],function(_0x3abc21){var _0x188527={};_0x188527[_0x3abc21]={'$like':'%'+_0x3881c3[_0xb35a('0x36')][_0xb35a('0x41')]+'%'};return _0x188527;})});}_0x30bebc=_[_0xb35a('0x42')]({},_0x30bebc,_0x3881c3[_0xb35a('0x49')]);return _0x5e01b5[_0xb35a('0x58')](_0x30bebc);}})[_0xb35a('0x28')](function(_0x65ca47){if(_0x65ca47){_0x54777d=_0x65ca47[_0xb35a('0x3c')];if(!_0x3881c3['query']['hasOwnProperty'](_0xb35a('0x3e'))){_0x30bebc[_0xb35a('0x21')]=qs[_0xb35a('0x21')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x21')]);_0x30bebc[_0xb35a('0x1f')]=qs[_0xb35a('0x1f')](_0x3881c3[_0xb35a('0x36')][_0xb35a('0x1f')]);}return _0x5e01b5['getActions'](_0x30bebc);}})[_0xb35a('0x28')](function(_0x142137){if(_0x142137){return _0x142137?{'count':_0x54777d,'rows':_0x142137}:null;}})['then'](respondWithResult(_0x2bff72,null))['catch'](handleError(_0x2bff72,null));};
\ No newline at end of file
index bfb4c7f..dde8ebf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d0=['rimraf','../../config/environment','./automation.attributes','exports','Automation','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45df3d,_0x3be0d8){var _0x33f6bd=function(_0x21b6af){while(--_0x21b6af){_0x45df3d['push'](_0x45df3d['shift']());}};_0x33f6bd(++_0x3be0d8);}(_0x90d0,0x73));var _0x090d=function(_0x2545d0,_0x397e79){_0x2545d0=_0x2545d0-0x0;var _0x10111b=_0x90d0[_0x2545d0];return _0x10111b;};'use strict';var _=require(_0x090d('0x0'));var util=require(_0x090d('0x1'));var logger=require(_0x090d('0x2'))(_0x090d('0x3'));var moment=require(_0x090d('0x4'));var BPromise=require(_0x090d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x090d('0x6'));var config=require(_0x090d('0x7'));var attributes=require(_0x090d('0x8'));module[_0x090d('0x9')]=function(_0x3be0f9,_0x3e4912){return _0x3be0f9['define'](_0x090d('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc796=['../../config/logger','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','Automation','tools_automations','lodash','util'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xc796,0x17e));var _0x6c79=function(_0x219935,_0x5b7d02){_0x219935=_0x219935-0x0;var _0x130409=_0xc796[_0x219935];return _0x130409;};'use strict';var _=require(_0x6c79('0x0'));var util=require(_0x6c79('0x1'));var logger=require(_0x6c79('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c79('0x3'));var rp=require(_0x6c79('0x4'));var fs=require('fs');var path=require(_0x6c79('0x5'));var rimraf=require(_0x6c79('0x6'));var config=require('../../config/environment');var attributes=require(_0x6c79('0x7'));module[_0x6c79('0x8')]=function(_0x18e549,_0x138192){return _0x18e549[_0x6c79('0x9')](_0x6c79('0xa'),attributes,{'tableName':_0x6c79('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d3bfb3..f397b5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa03c=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5015cc,_0x35eb6b){var _0xa4fd74=function(_0x3d4cfe){while(--_0x3d4cfe){_0x5015cc['push'](_0x5015cc['shift']());}};_0xa4fd74(++_0x35eb6b);}(_0xa03c,0x94));var _0xca03=function(_0x1965df,_0x275b26){_0x1965df=_0x1965df-0x0;var _0x4a5ed6=_0xa03c[_0x1965df];return _0x4a5ed6;};'use strict';var _=require(_0xca03('0x0'));var util=require('util');var moment=require(_0xca03('0x1'));var BPromise=require(_0xca03('0x2'));var rs=require(_0xca03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca03('0x4'))['db'];var utils=require(_0xca03('0x5'));var logger=require(_0xca03('0x6'))('rpc');var config=require(_0xca03('0x7'));var jayson=require(_0xca03('0x8'));var client=jayson[_0xca03('0x9')][_0xca03('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27aac6,_0x9d2b3d,_0x52f12e){return new BPromise(function(_0x1832cc,_0x18ddee){return client[_0xca03('0xb')](_0x27aac6,_0x52f12e)[_0xca03('0xc')](function(_0x31e7be){logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));logger[_0xca03('0x10')](_0xca03('0x11'),_0x9d2b3d,'request\x20sent',JSON[_0xca03('0x12')](_0x31e7be));if(_0x31e7be[_0xca03('0x13')]){if(_0x31e7be[_0xca03('0x13')][_0xca03('0x14')]===0x1f4){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x18ddee(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);return _0x1832cc(_0x31e7be[_0xca03('0x13')][_0xca03('0x15')]);}else{logger[_0xca03('0xd')](_0xca03('0xe'),_0x9d2b3d,_0xca03('0xf'));_0x1832cc(_0x31e7be['result'][_0xca03('0x15')]);}})[_0xca03('0x16')](function(_0x184313){logger[_0xca03('0x13')](_0xca03('0xe'),_0x9d2b3d,_0x184313);_0x18ddee(_0x184313);});});}
\ No newline at end of file
+var _0x3f72=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x33d38c,_0x2ff27b){var _0x537b31=function(_0x152458){while(--_0x152458){_0x33d38c['push'](_0x33d38c['shift']());}};_0x537b31(++_0x2ff27b);}(_0x3f72,0xaf));var _0x23f7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f72[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x23f7('0x0'));var util=require(_0x23f7('0x1'));var moment=require(_0x23f7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x23f7('0x3'));var db=require(_0x23f7('0x4'))['db'];var utils=require(_0x23f7('0x5'));var logger=require(_0x23f7('0x6'))(_0x23f7('0x7'));var config=require('../../config/environment');var jayson=require(_0x23f7('0x8'));var client=jayson['client'][_0x23f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cc54a,_0x23e468,_0x2db48b){return new BPromise(function(_0x412d29,_0x258026){return client[_0x23f7('0xa')](_0x5cc54a,_0x2db48b)[_0x23f7('0xb')](function(_0x3a048c){logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));logger['debug'](_0x23f7('0xf'),_0x23e468,_0x23f7('0xe'),JSON[_0x23f7('0x10')](_0x3a048c));if(_0x3a048c['error']){if(_0x3a048c['error'][_0x23f7('0x11')]===0x1f4){logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);return _0x258026(_0x3a048c['error'][_0x23f7('0x13')]);}logger[_0x23f7('0x12')](_0x23f7('0xd'),_0x23e468,_0x3a048c[_0x23f7('0x12')]['message']);return _0x412d29(_0x3a048c[_0x23f7('0x12')][_0x23f7('0x13')]);}else{logger[_0x23f7('0xc')](_0x23f7('0xd'),_0x23e468,_0x23f7('0xe'));_0x412d29(_0x3a048c[_0x23f7('0x14')][_0x23f7('0x13')]);}})['catch'](function(_0x2669ab){logger[_0x23f7('0x12')]('Automation,\x20%s,\x20%s',_0x23e468,_0x2669ab);_0x258026(_0x2669ab);});});}
\ No newline at end of file
index 2cacc5b..66b9b6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a99=['./automation.controller','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','get','/:id/actions','getActions','create','post','addConditions','addActions','put','update','delete','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x287428,_0x5a62c2){var _0x5169c2=function(_0x5c4aee){while(--_0x5c4aee){_0x287428['push'](_0x287428['shift']());}};_0x5169c2(++_0x5a62c2);}(_0x4a99,0x1aa));var _0x94a9=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x4a99[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x94a9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x94a9('0x1'));var express=require(_0x94a9('0x2'));var router=express['Router']();var fs_extra=require(_0x94a9('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x94a9('0x4'));var config=require(_0x94a9('0x5'));var controller=require(_0x94a9('0x6'));router['get']('/',auth[_0x94a9('0x7')](),controller[_0x94a9('0x8')]);router['get'](_0x94a9('0x9'),auth[_0x94a9('0x7')](),controller[_0x94a9('0xa')]);router['get'](_0x94a9('0xb'),auth['isAuthenticated'](),controller[_0x94a9('0xc')]);router[_0x94a9('0xd')](_0x94a9('0xe'),auth[_0x94a9('0x7')](),controller[_0x94a9('0xf')]);router['post']('/',auth[_0x94a9('0x7')](),controller[_0x94a9('0x10')]);router[_0x94a9('0x11')](_0x94a9('0xb'),auth[_0x94a9('0x7')](),controller[_0x94a9('0x12')]);router[_0x94a9('0x11')]('/:id/actions',auth['isAuthenticated'](),controller[_0x94a9('0x13')]);router[_0x94a9('0x14')](_0x94a9('0x9'),auth[_0x94a9('0x7')](),controller[_0x94a9('0x15')]);router[_0x94a9('0x16')](_0x94a9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x94a9('0x17')]=router;
\ No newline at end of file
+var _0xac52=['/:id','show','/:id/conditions','getConditions','/:id/actions','post','create','addActions','put','delete','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./automation.controller','get','isAuthenticated'];(function(_0x2aa529,_0x1f3c07){var _0x789e1e=function(_0x1c82ab){while(--_0x1c82ab){_0x2aa529['push'](_0x2aa529['shift']());}};_0x789e1e(++_0x1f3c07);}(_0xac52,0x122));var _0x2ac5=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xac52[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require('multer');var util=require(_0x2ac5('0x0'));var path=require(_0x2ac5('0x1'));var timeout=require(_0x2ac5('0x2'));var express=require(_0x2ac5('0x3'));var router=express[_0x2ac5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ac5('0x5'));var interaction=require(_0x2ac5('0x6'));var config=require('../../config/environment');var controller=require(_0x2ac5('0x7'));router[_0x2ac5('0x8')]('/',auth[_0x2ac5('0x9')](),controller['index']);router['get'](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xb')]);router[_0x2ac5('0x8')](_0x2ac5('0xc'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0xd')]);router[_0x2ac5('0x8')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller['getActions']);router[_0x2ac5('0xf')]('/',auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x10')]);router[_0x2ac5('0xf')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router[_0x2ac5('0xf')](_0x2ac5('0xe'),auth[_0x2ac5('0x9')](),controller[_0x2ac5('0x11')]);router[_0x2ac5('0x12')]('/:id',auth[_0x2ac5('0x9')](),controller['update']);router[_0x2ac5('0x13')](_0x2ac5('0xa'),auth[_0x2ac5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 32cf218..0ee7899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03e5=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x4a7977,_0x4b0931){var _0x3c8a0d=function(_0x2c3977){while(--_0x2c3977){_0x4a7977['push'](_0x4a7977['shift']());}};_0x3c8a0d(++_0x4b0931);}(_0x03e5,0x64));var _0x503e=function(_0x5da55f,_0x2428f7){_0x5da55f=_0x5da55f-0x0;var _0x13c392=_0x03e5[_0x5da55f];return _0x13c392;};'use strict';var Sequelize=require(_0x503e('0x0'));module['exports']={'name':{'type':Sequelize[_0x503e('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x503e('0x2')](_0x503e('0x3')),'allowNull':![],'defaultValue':_0x503e('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x503e('0x4')],'defaultValue':0x0,'comment':_0x503e('0x5')},'limitCalls':{'type':Sequelize[_0x503e('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x503e('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x503e('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x503e('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'comment':_0x503e('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x503e('0xf')},'dialTimezone':{'type':Sequelize[_0x503e('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x503e('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x503e('0x2')](_0x503e('0x11'),_0x503e('0x12'),'onlyIfOpen'),'defaultValue':_0x503e('0x11')},'dialAMDActive':{'type':Sequelize[_0x503e('0x4')],'defaultValue':0x0,'comment':_0x503e('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x503e('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x503e('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x503e('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x503e('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x503e('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x503e('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x503e('0x6')](0x9)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x503e('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x503e('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x503e('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x503e('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x503e('0x2')]('DESC',_0x503e('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x503e('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x503e('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x503e('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x503e('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x503e('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x503e('0x6')](0x3)[_0x503e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x503e('0x6')](0x5)[_0x503e('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x503e('0x25')}};
\ No newline at end of file
+var _0x5b25=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x1eafb2,_0x3f3b67){var _0x4280e2=function(_0xb4d2db){while(--_0xb4d2db){_0x1eafb2['push'](_0x1eafb2['shift']());}};_0x4280e2(++_0x3f3b67);}(_0x5b25,0xc9));var _0x55b2=function(_0x35d2ec,_0x30848c){_0x35d2ec=_0x35d2ec-0x0;var _0x1ca87d=_0x5b25[_0x35d2ec];return _0x1ca87d;};'use strict';var Sequelize=require(_0x55b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x55b2('0x1')],'unique':_0x55b2('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x55b2('0x3')](_0x55b2('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x55b2('0x1')]},'active':{'type':Sequelize[_0x55b2('0x5')],'defaultValue':0x0,'comment':_0x55b2('0x6')},'limitCalls':{'type':Sequelize[_0x55b2('0x7')](0x4)[_0x55b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x55b2('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x55b2('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'comment':_0x55b2('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x55b2('0xf')},'dialTimezone':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always',_0x55b2('0x10'),_0x55b2('0x11')),'defaultValue':_0x55b2('0x12')},'dialAMDActive':{'type':Sequelize[_0x55b2('0x5')],'defaultValue':0x0,'comment':_0x55b2('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x55b2('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x55b2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x55b2('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55b2('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x55b2('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x55b2('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x55b2('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x55b2('0x7')](0x9)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x55b2('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x55b2('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x55b2('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x55b2('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x55b2('0x1b'),_0x55b2('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x55b2('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55b2('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x55b2('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x20')},'dialDropMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)[_0x55b2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x55b2('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x55b2('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x55b2('0x7')](0x5)[_0x55b2('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x55b2('0x26')}};
\ No newline at end of file
index 4fa0aca..84f9c95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc48e=['rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','createdAt','getHoppers','CmHopper','pick','findOne','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','NOW()','field','toString','from','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','h.id','ci.OrderBY','cm_contact_has_items','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','CmList','format','addBlackLists','spread','removeBlackLists','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include','Campaign','findAll','rows','show','params'];(function(_0x156e7b,_0x757e18){var _0x59ce42=function(_0x339b08){while(--_0x339b08){_0x156e7b['push'](_0x156e7b['shift']());}};_0x59ce42(++_0x757e18);}(_0xc48e,0xd7));var _0xec48=function(_0x381f0b,_0x2ad002){_0x381f0b=_0x381f0b-0x0;var _0x5e00e9=_0xc48e[_0x381f0b];return _0x5e00e9;};'use strict';var emlformat=require(_0xec48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec48('0x2'));var moment=require(_0xec48('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xec48('0x4'));var path=require(_0xec48('0x5'));var sox=require(_0xec48('0x6'));var csv=require(_0xec48('0x7'));var ejs=require(_0xec48('0x8'));var fs=require('fs');var fs_extra=require(_0xec48('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xec48('0xa'));var jsforce=require(_0xec48('0xb'));var deskjs=require(_0xec48('0xc'));var toCsv=require(_0xec48('0x7'));var querystring=require(_0xec48('0xd'));var Papa=require(_0xec48('0xe'));var Redis=require(_0xec48('0xf'));var authService=require(_0xec48('0x10'));var qs=require(_0xec48('0x11'));var as=require(_0xec48('0x12'));var hardwareService=require(_0xec48('0x13'));var logger=require('../../config/logger')(_0xec48('0x14'));var utils=require(_0xec48('0x15'));var config=require(_0xec48('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xec48('0x17'))['db'];function respondWithStatusCode(_0x4a4761,_0x4f17d7){_0x4f17d7=_0x4f17d7||0xcc;return function(_0x2fe7f1){if(_0x2fe7f1){return _0x4a4761[_0xec48('0x18')](_0x4f17d7);}return _0x4a4761[_0xec48('0x19')](_0x4f17d7)[_0xec48('0x1a')]();};}function respondWithResult(_0x3677a3,_0x3374c4){_0x3374c4=_0x3374c4||0xc8;return function(_0x5ef355){if(_0x5ef355){return _0x3677a3[_0xec48('0x19')](_0x3374c4)[_0xec48('0x1b')](_0x5ef355);}};}function respondWithFilteredResult(_0x42202a,_0xf77d40){return function(_0x4a9150){if(_0x4a9150){var _0x2ef68f=typeof _0xf77d40['offset']==='undefined'&&typeof _0xf77d40[_0xec48('0x1c')]===_0xec48('0x1d');var _0x3a9205=_0x4a9150[_0xec48('0x1e')];var _0x41a7e9=_0x2ef68f?0x0:_0xf77d40[_0xec48('0x1f')];var _0x211f24=_0x2ef68f?_0x4a9150['count']:_0xf77d40[_0xec48('0x1f')]+_0xf77d40['limit'];var _0x40f10e;if(_0x211f24>=_0x3a9205){_0x211f24=_0x3a9205;_0x40f10e=0xc8;}else{_0x40f10e=0xce;}_0x42202a[_0xec48('0x19')](_0x40f10e);return _0x42202a['set'](_0xec48('0x20'),_0x41a7e9+'-'+_0x211f24+'/'+_0x3a9205)[_0xec48('0x1b')](_0x4a9150);}return null;};}function patchUpdates(_0x5e7cb6){return function(_0x50ac10){try{jsonpatch['apply'](_0x50ac10,_0x5e7cb6,!![]);}catch(_0x5575c7){return BPromise[_0xec48('0x21')](_0x5575c7);}return _0x50ac10[_0xec48('0x22')]();};}function saveUpdates(_0x5840d6,_0x98a3b0){return function(_0x5ce57d){if(_0x5ce57d){return _0x5ce57d[_0xec48('0x23')](_0x5840d6)['then'](function(_0x54b55d){return _0x54b55d;});}return null;};}function removeEntity(_0x2a6613,_0x140978){return function(_0x5aeea1){if(_0x5aeea1){return _0x5aeea1[_0xec48('0x24')]()[_0xec48('0x25')](function(){var _0x1d389a=_0x5aeea1[_0xec48('0x26')]({'plain':!![]});var _0x3a6b56='IvrCampaigns';return db[_0xec48('0x27')][_0xec48('0x24')]({'where':{'type':_0x3a6b56,'resourceId':_0x1d389a['id']}})['then'](function(){return _0x5aeea1;});})[_0xec48('0x25')](function(){_0x2a6613['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c2270,_0x348293){return function(_0x32f12f){if(!_0x32f12f){_0x5c2270[_0xec48('0x18')](0x194);}return _0x32f12f;};}function handleError(_0x29ce4d,_0x5ea784){_0x5ea784=_0x5ea784||0x1f4;return function(_0x2426ed){logger[_0xec48('0x28')](_0x2426ed[_0xec48('0x29')]);if(_0x2426ed[_0xec48('0x2a')]){delete _0x2426ed[_0xec48('0x2a')];}_0x29ce4d['status'](_0x5ea784)['send'](_0x2426ed);};}exports['index']=function(_0x4eb580,_0x210abe){var _0x3f287f={},_0x34e423={},_0xaf5708={'count':0x0,'rows':[]};var _0x4ef91a=_['map'](db['Campaign']['rawAttributes'],function(_0x393d47){return{'name':_0x393d47['fieldName'],'type':_0x393d47[_0xec48('0x2b')][_0xec48('0x2c')]};});_0x34e423[_0xec48('0x2d')]=_[_0xec48('0x2e')](_0x4ef91a,_0xec48('0x2a'));_0x34e423[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x4eb580[_0xec48('0x2f')]);_0x34e423[_0xec48('0x31')]=_[_0xec48('0x32')](_0x34e423[_0xec48('0x2d')],_0x34e423['query']);_0x3f287f[_0xec48('0x33')]=_[_0xec48('0x32')](_0x34e423['model'],qs['fields'](_0x4eb580[_0xec48('0x2f')][_0xec48('0x34')]));_0x3f287f[_0xec48('0x33')]=_0x3f287f[_0xec48('0x33')][_0xec48('0x35')]?_0x3f287f['attributes']:_0x34e423[_0xec48('0x2d')];if(!_0x4eb580[_0xec48('0x2f')][_0xec48('0x36')](_0xec48('0x37'))){_0x3f287f[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x4eb580['query']['limit']);_0x3f287f[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x4eb580[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x3f287f[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x4eb580[_0xec48('0x2f')][_0xec48('0x39')]);_0x3f287f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_['pick'](_0x4eb580[_0xec48('0x2f')],_0x34e423[_0xec48('0x31')]),_0x4ef91a);if(_0x4eb580[_0xec48('0x2f')]['filter']){_0x3f287f[_0xec48('0x3a')]=_['merge'](_0x3f287f['where'],{'$or':_[_0xec48('0x2e')](_0x4ef91a,function(_0x9ebfd8){if(_0x9ebfd8['type']!==_0xec48('0x3b')){var _0x2f5bac={};_0x2f5bac[_0x9ebfd8['name']]={'$like':'%'+_0x4eb580[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x2f5bac;}})});}_0x3f287f=_[_0xec48('0x3d')]({},_0x3f287f,_0x4eb580[_0xec48('0x3e')]);var _0xa436af={'where':_0x3f287f[_0xec48('0x3a')]};return db['Campaign'][_0xec48('0x1e')](_0xa436af)[_0xec48('0x25')](function(_0x253d1a){_0xaf5708[_0xec48('0x1e')]=_0x253d1a;if(_0x4eb580[_0xec48('0x2f')]['includeAll']){_0x3f287f[_0xec48('0x3f')]=[{'all':!![]}];}return db[_0xec48('0x40')][_0xec48('0x41')](_0x3f287f);})['then'](function(_0x57008c){_0xaf5708[_0xec48('0x42')]=_0x57008c;return _0xaf5708;})[_0xec48('0x25')](respondWithFilteredResult(_0x210abe,_0x3f287f))['catch'](handleError(_0x210abe,null));};exports[_0xec48('0x43')]=function(_0x58b45f,_0x3f0ea1){var _0x4a8dfc={'raw':![],'where':{'id':_0x58b45f[_0xec48('0x44')]['id']}},_0xf6957={};_0xf6957[_0xec48('0x2d')]=_[_0xec48('0x30')](db['Campaign'][_0xec48('0x45')]);_0xf6957[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x58b45f[_0xec48('0x2f')]);_0xf6957[_0xec48('0x31')]=_[_0xec48('0x32')](_0xf6957[_0xec48('0x2d')],_0xf6957[_0xec48('0x2f')]);_0x4a8dfc[_0xec48('0x33')]=_[_0xec48('0x32')](_0xf6957[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x58b45f['query'][_0xec48('0x34')]));_0x4a8dfc[_0xec48('0x33')]=_0x4a8dfc[_0xec48('0x33')][_0xec48('0x35')]?_0x4a8dfc[_0xec48('0x33')]:_0xf6957['model'];if(_0x58b45f[_0xec48('0x2f')][_0xec48('0x46')]){_0x4a8dfc['include']=[{'all':!![]}];}_0x4a8dfc=_[_0xec48('0x3d')]({},_0x4a8dfc,_0x58b45f[_0xec48('0x3e')]);return db[_0xec48('0x40')][_0xec48('0x47')](_0x4a8dfc)[_0xec48('0x25')](handleEntityNotFound(_0x3f0ea1,null))[_0xec48('0x25')](respondWithResult(_0x3f0ea1,null))['catch'](handleError(_0x3f0ea1,null));};exports['create']=function(_0x1313fb,_0x5e88cb){return db[_0xec48('0x40')][_0xec48('0x48')](_0x1313fb[_0xec48('0x49')],{})['then'](function(_0x3c468d){var _0x44da3e=_0x1313fb[_0xec48('0x4a')][_0xec48('0x26')]({'plain':!![]});if(!_0x44da3e)throw new Error(_0xec48('0x4b'));if(_0x44da3e[_0xec48('0x4c')]===_0xec48('0x4a')){var _0x378288=_0x3c468d[_0xec48('0x26')]({'plain':!![]});var _0x1999c0=_0xec48('0x4d');return db['UserProfileSection'][_0xec48('0x47')]({'where':{'name':_0x1999c0,'userProfileId':_0x44da3e[_0xec48('0x4e')]},'raw':!![]})[_0xec48('0x25')](function(_0xffbfa1){if(_0xffbfa1&&_0xffbfa1[_0xec48('0x4f')]===0x0){return db[_0xec48('0x27')][_0xec48('0x48')]({'name':_0x378288[_0xec48('0x2a')],'resourceId':_0x378288['id'],'type':_0xffbfa1['name'],'sectionId':_0xffbfa1['id']},{})[_0xec48('0x25')](function(){return _0x3c468d;});}else{return _0x3c468d;}})['catch'](function(_0x172f57){logger['error'](_0xec48('0x50'),_0x172f57);throw _0x172f57;});}return _0x3c468d;})['then'](respondWithResult(_0x5e88cb,0xc9))[_0xec48('0x51')](handleError(_0x5e88cb,null));};exports[_0xec48('0x52')]=function(_0x496226,_0x28dd61){var _0x63629={'where':{'id':_0x496226[_0xec48('0x44')]['id']}},_0x578647={};_0x578647[_0xec48('0x2d')]=_[_0xec48('0x30')](db['Campaign'][_0xec48('0x45')]);_0x63629['attributes']=_[_0xec48('0x32')](_0x578647['model'],qs['fields'](_0x496226[_0xec48('0x2f')][_0xec48('0x34')]));_0x63629[_0xec48('0x33')]=_0x63629[_0xec48('0x33')][_0xec48('0x35')]?_0x63629['attributes']:_0x578647[_0xec48('0x2d')];if(_0x496226[_0xec48('0x2f')][_0xec48('0x46')]){_0x63629[_0xec48('0x3f')]=[{'all':!![]}];}_0x63629=_[_0xec48('0x3d')]({},_0x63629,_0x496226[_0xec48('0x3e')]);return db['Campaign'][_0xec48('0x47')](_0x63629)[_0xec48('0x25')](handleEntityNotFound(_0x28dd61,null))[_0xec48('0x25')](function(_0x214b3b){if(_0x214b3b){var _0x2ae6a1=_0x214b3b[_0xec48('0x26')]({'plain':!![]});_0x2ae6a1=qs[_0xec48('0x53')](_0x2ae6a1,['id',_0xec48('0x54'),'updatedAt']);_0x496226[_0xec48('0x49')]=_[_0xec48('0x53')](_0x496226[_0xec48('0x49')],['id',_0xec48('0x54'),'updatedAt']);return db['Campaign'][_0xec48('0x48')](_['merge'](_0x2ae6a1,_0x496226[_0xec48('0x49')]),{'include':_0x496226[_0xec48('0x2f')][_0xec48('0x46')]?[{'all':!![]}]:undefined})[_0xec48('0x25')](function(_0x4e3899){var _0x387421=_0x496226['user'][_0xec48('0x26')]({'plain':!![]});if(!_0x387421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x387421[_0xec48('0x4c')]==='user'){var _0x167a04=_0x4e3899[_0xec48('0x26')]({'plain':!![]});var _0x4e6507=_0xec48('0x4d');return db['UserProfileSection'][_0xec48('0x47')]({'where':{'name':_0x4e6507,'userProfileId':_0x387421[_0xec48('0x4e')]},'raw':!![]})[_0xec48('0x25')](function(_0x594388){if(_0x594388&&_0x594388['autoAssociation']===0x0){return db[_0xec48('0x27')][_0xec48('0x48')]({'name':_0x167a04[_0xec48('0x2a')],'resourceId':_0x167a04['id'],'type':_0x594388[_0xec48('0x2a')],'sectionId':_0x594388['id']},{})[_0xec48('0x25')](function(){return _0x4e3899;});}else{return _0x4e3899;}})[_0xec48('0x51')](function(_0x3fa36d){logger['error'](_0xec48('0x50'),_0x3fa36d);throw _0x3fa36d;});}return _0x4e3899;});}})['then'](respondWithResult(_0x28dd61,0xc9))[_0xec48('0x51')](handleError(_0x28dd61,null));};exports[_0xec48('0x23')]=function(_0x460172,_0x114ba3){if(_0x460172[_0xec48('0x49')]['id']){delete _0x460172[_0xec48('0x49')]['id'];}return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x460172[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x114ba3,null))[_0xec48('0x25')](saveUpdates(_0x460172[_0xec48('0x49')],null))[_0xec48('0x25')](respondWithResult(_0x114ba3,null))['catch'](handleError(_0x114ba3,null));};exports['destroy']=function(_0x2b3d30,_0xd3c82b){return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x2b3d30[_0xec48('0x44')]['id']}})[_0xec48('0x25')](handleEntityNotFound(_0xd3c82b,null))['then'](removeEntity(_0xd3c82b,null))['catch'](handleError(_0xd3c82b,null));};exports[_0xec48('0x55')]=function(_0x45371f,_0xfcb3df,_0x4d0c8d){var _0x4eb807={'raw':!![],'where':{}};var _0x5b33ef={};var _0x4a3974={'count':0x0,'rows':[]};return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x45371f[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0xfcb3df,null))[_0xec48('0x25')](function(_0x29e012){if(_0x29e012){_0x5b33ef[_0xec48('0x2d')]=_[_0xec48('0x30')](db[_0xec48('0x56')]['rawAttributes']);_0x5b33ef[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x45371f[_0xec48('0x2f')]);_0x5b33ef[_0xec48('0x31')]=_[_0xec48('0x32')](_0x5b33ef[_0xec48('0x2d')],_0x5b33ef[_0xec48('0x2f')]);_0x4eb807[_0xec48('0x33')]=_['intersection'](_0x5b33ef[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x45371f[_0xec48('0x2f')][_0xec48('0x34')]));_0x4eb807['attributes']=_0x4eb807[_0xec48('0x33')][_0xec48('0x35')]?_0x4eb807[_0xec48('0x33')]:_0x5b33ef[_0xec48('0x2d')];if(!_0x45371f[_0xec48('0x2f')]['hasOwnProperty'](_0xec48('0x37'))){_0x4eb807[_0xec48('0x1c')]=qs['limit'](_0x45371f[_0xec48('0x2f')]['limit']);_0x4eb807[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x45371f[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x4eb807['order']=qs[_0xec48('0x39')](_0x45371f[_0xec48('0x2f')][_0xec48('0x39')]);_0x4eb807[_0xec48('0x3a')]=qs['filters'](_[_0xec48('0x57')](_0x45371f[_0xec48('0x2f')],_0x5b33ef['filters']));_0x4eb807[_0xec48('0x3a')]['CampaignId']=_0x29e012['id'];if(_0x45371f['query'][_0xec48('0x3c')]){_0x4eb807[_0xec48('0x3a')]=_['merge'](_0x4eb807[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x4eb807[_0xec48('0x33')],function(_0x24a40a){var _0x5df7fc={};_0x5df7fc[_0x24a40a]={'$like':'%'+_0x45371f[_0xec48('0x2f')]['filter']+'%'};return _0x5df7fc;})});}_0x4eb807=_[_0xec48('0x3d')]({},_0x4eb807,_0x45371f[_0xec48('0x3e')]);return db[_0xec48('0x56')][_0xec48('0x1e')]({'where':_0x4eb807[_0xec48('0x3a')]})['then'](function(_0x516f34){_0x4a3974[_0xec48('0x1e')]=_0x516f34;if(_0x45371f[_0xec48('0x2f')][_0xec48('0x46')]){_0x4eb807[_0xec48('0x3f')]=[{'all':!![]}];}return db['CmHopper'][_0xec48('0x41')](_0x4eb807);})[_0xec48('0x25')](function(_0x2d874a){_0x4a3974['rows']=_0x2d874a;return _0x4a3974;});}})[_0xec48('0x25')](respondWithFilteredResult(_0xfcb3df,_0x4eb807))['catch'](handleError(_0xfcb3df,null));};exports['getHopperHistories']=function(_0x4012d6,_0x368838,_0x2fe4bd){var _0x5d5118={'raw':!![],'where':{}};var _0x38d97d={};var _0x54c790={'count':0x0,'rows':[]};return db[_0xec48('0x40')][_0xec48('0x58')]({'where':{'id':_0x4012d6[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x368838,null))[_0xec48('0x25')](function(_0x3708e7){if(_0x3708e7){_0x38d97d['model']=_[_0xec48('0x30')](db[_0xec48('0x59')][_0xec48('0x45')]);_0x38d97d[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x4012d6[_0xec48('0x2f')]);_0x38d97d[_0xec48('0x31')]=_[_0xec48('0x32')](_0x38d97d[_0xec48('0x2d')],_0x38d97d[_0xec48('0x2f')]);_0x5d5118[_0xec48('0x33')]=_['intersection'](_0x38d97d[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x34')]));_0x5d5118[_0xec48('0x33')]=_0x5d5118['attributes']['length']?_0x5d5118[_0xec48('0x33')]:_0x38d97d[_0xec48('0x2d')];if(!_0x4012d6['query'][_0xec48('0x36')](_0xec48('0x37'))){_0x5d5118[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x4012d6[_0xec48('0x2f')]['limit']);_0x5d5118[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x1f')]);}_0x5d5118[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x4012d6[_0xec48('0x2f')][_0xec48('0x39')]);_0x5d5118[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x4012d6[_0xec48('0x2f')],_0x38d97d[_0xec48('0x31')]));_0x5d5118['where'][_0xec48('0x5a')]=_0x3708e7['id'];if(_0x4012d6[_0xec48('0x2f')]['filter']){_0x5d5118['where']=_[_0xec48('0x3d')](_0x5d5118[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x5d5118[_0xec48('0x33')],function(_0x4fc35d){var _0x3fe956={};_0x3fe956[_0x4fc35d]={'$like':'%'+_0x4012d6['query']['filter']+'%'};return _0x3fe956;})});}_0x5d5118=_[_0xec48('0x3d')]({},_0x5d5118,_0x4012d6[_0xec48('0x3e')]);return db[_0xec48('0x59')]['count']({'where':_0x5d5118['where']})[_0xec48('0x25')](function(_0x1edb0c){_0x54c790[_0xec48('0x1e')]=_0x1edb0c;if(_0x4012d6[_0xec48('0x2f')]['includeAll']){_0x5d5118[_0xec48('0x3f')]=[{'all':!![]}];}return db[_0xec48('0x59')]['findAll'](_0x5d5118);})[_0xec48('0x25')](function(_0x55bd3f){_0x54c790[_0xec48('0x42')]=_0x55bd3f;return _0x54c790;});}})['then'](respondWithFilteredResult(_0x368838,_0x5d5118))[_0xec48('0x51')](handleError(_0x368838,null));};exports['getHopperFinals']=function(_0x14d1aa,_0x191ec0,_0x38c984){var _0x46d04f={'raw':!![],'where':{}};var _0x56223a={};var _0x288cd9={'count':0x0,'rows':[]};return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x14d1aa['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x191ec0,null))[_0xec48('0x25')](function(_0x97717c){if(_0x97717c){_0x56223a['model']=_['keys'](db[_0xec48('0x5b')][_0xec48('0x45')]);_0x56223a[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x14d1aa[_0xec48('0x2f')]);_0x56223a[_0xec48('0x31')]=_[_0xec48('0x32')](_0x56223a[_0xec48('0x2d')],_0x56223a['query']);_0x46d04f[_0xec48('0x33')]=_['intersection'](_0x56223a[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x14d1aa[_0xec48('0x2f')][_0xec48('0x34')]));_0x46d04f['attributes']=_0x46d04f[_0xec48('0x33')][_0xec48('0x35')]?_0x46d04f['attributes']:_0x56223a[_0xec48('0x2d')];if(!_0x14d1aa['query'][_0xec48('0x36')](_0xec48('0x37'))){_0x46d04f['limit']=qs[_0xec48('0x1c')](_0x14d1aa[_0xec48('0x2f')][_0xec48('0x1c')]);_0x46d04f[_0xec48('0x1f')]=qs['offset'](_0x14d1aa['query'][_0xec48('0x1f')]);}_0x46d04f['order']=qs[_0xec48('0x39')](_0x14d1aa['query'][_0xec48('0x39')]);_0x46d04f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x14d1aa[_0xec48('0x2f')],_0x56223a[_0xec48('0x31')]));_0x46d04f[_0xec48('0x3a')][_0xec48('0x5a')]=_0x97717c['id'];if(_0x14d1aa[_0xec48('0x2f')][_0xec48('0x3c')]){_0x46d04f['where']=_[_0xec48('0x3d')](_0x46d04f[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x46d04f[_0xec48('0x33')],function(_0x3bc9fd){var _0x3ba6bb={};_0x3ba6bb[_0x3bc9fd]={'$like':'%'+_0x14d1aa['query']['filter']+'%'};return _0x3ba6bb;})});}_0x46d04f=_[_0xec48('0x3d')]({},_0x46d04f,_0x14d1aa['options']);return db['CmHopperFinal'][_0xec48('0x1e')]({'where':_0x46d04f[_0xec48('0x3a')]})[_0xec48('0x25')](function(_0x39a06e){_0x288cd9[_0xec48('0x1e')]=_0x39a06e;if(_0x14d1aa[_0xec48('0x2f')][_0xec48('0x46')]){_0x46d04f[_0xec48('0x3f')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xec48('0x41')](_0x46d04f);})[_0xec48('0x25')](function(_0x1b2afa){_0x288cd9[_0xec48('0x42')]=_0x1b2afa;return _0x288cd9;});}})[_0xec48('0x25')](respondWithFilteredResult(_0x191ec0,_0x46d04f))['catch'](handleError(_0x191ec0,null));};exports[_0xec48('0x5c')]=function(_0x5a1881,_0x3a4f0d,_0x4f4da9){var _0x5c073f={'raw':!![],'where':{}};var _0xd33994={};var _0x422104={'count':0x0,'rows':[]};return db[_0xec48('0x40')][_0xec48('0x58')]({'where':{'id':_0x5a1881['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x3a4f0d,null))[_0xec48('0x25')](function(_0x42d386){if(_0x42d386){_0xd33994[_0xec48('0x2d')]=_[_0xec48('0x30')](db['CmHopperBlack'][_0xec48('0x45')]);_0xd33994[_0xec48('0x2f')]=_[_0xec48('0x30')](_0x5a1881[_0xec48('0x2f')]);_0xd33994['filters']=_[_0xec48('0x32')](_0xd33994[_0xec48('0x2d')],_0xd33994['query']);_0x5c073f['attributes']=_['intersection'](_0xd33994['model'],qs[_0xec48('0x34')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x34')]));_0x5c073f[_0xec48('0x33')]=_0x5c073f[_0xec48('0x33')]['length']?_0x5c073f['attributes']:_0xd33994['model'];if(!_0x5a1881['query'][_0xec48('0x36')]('nolimit')){_0x5c073f['limit']=qs[_0xec48('0x1c')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x1c')]);_0x5c073f[_0xec48('0x1f')]=qs['offset'](_0x5a1881['query'][_0xec48('0x1f')]);}_0x5c073f[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x5a1881[_0xec48('0x2f')][_0xec48('0x39')]);_0x5c073f[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x5a1881[_0xec48('0x2f')],_0xd33994[_0xec48('0x31')]));_0x5c073f[_0xec48('0x3a')][_0xec48('0x5a')]=_0x42d386['id'];if(_0x5a1881['query'][_0xec48('0x3c')]){_0x5c073f['where']=_[_0xec48('0x3d')](_0x5c073f[_0xec48('0x3a')],{'$or':_['map'](_0x5c073f[_0xec48('0x33')],function(_0x5d08e3){var _0x56a7da={};_0x56a7da[_0x5d08e3]={'$like':'%'+_0x5a1881[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x56a7da;})});}_0x5c073f=_[_0xec48('0x3d')]({},_0x5c073f,_0x5a1881[_0xec48('0x3e')]);return db['CmHopperBlack'][_0xec48('0x1e')]({'where':_0x5c073f[_0xec48('0x3a')]})[_0xec48('0x25')](function(_0x14cc3a){_0x422104['count']=_0x14cc3a;if(_0x5a1881[_0xec48('0x2f')]['includeAll']){_0x5c073f['include']=[{'all':!![]}];}return db[_0xec48('0x5d')]['findAll'](_0x5c073f);})[_0xec48('0x25')](function(_0x548e80){_0x422104[_0xec48('0x42')]=_0x548e80;return _0x422104;});}})[_0xec48('0x25')](respondWithFilteredResult(_0x3a4f0d,_0x5c073f))[_0xec48('0x51')](handleError(_0x3a4f0d,null));};exports['getLists']=function(_0x5a68bf,_0x4590a5,_0x2945c9){var _0x39447c={};var _0x3605d3={};var _0x33317c;var _0x48d9ed;return db['Campaign'][_0xec48('0x58')]({'where':{'id':_0x5a68bf[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x4590a5,null))[_0xec48('0x25')](function(_0x391a60){if(_0x391a60){_0x33317c=_0x391a60;_0x3605d3['model']=_[_0xec48('0x30')](db['CmList']['rawAttributes']);_0x3605d3['query']=_[_0xec48('0x30')](_0x5a68bf[_0xec48('0x2f')]);_0x3605d3[_0xec48('0x31')]=_['intersection'](_0x3605d3['model'],_0x3605d3[_0xec48('0x2f')]);_0x39447c['attributes']=_['intersection'](_0x3605d3[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x5a68bf['query'][_0xec48('0x34')]));_0x39447c[_0xec48('0x33')]=_0x39447c['attributes'][_0xec48('0x35')]?_0x39447c[_0xec48('0x33')]:_0x3605d3[_0xec48('0x2d')];_0x39447c['order']=qs['sort'](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x39')]);_0x39447c[_0xec48('0x3a')]=qs[_0xec48('0x31')](_['pick'](_0x5a68bf[_0xec48('0x2f')],_0x3605d3['filters']));if(_0x5a68bf['query'][_0xec48('0x3c')]){_0x39447c['where']=_['merge'](_0x39447c[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x39447c[_0xec48('0x33')],function(_0x678cc3){var _0x1de685={};_0x1de685[_0x678cc3]={'$like':'%'+_0x5a68bf['query'][_0xec48('0x3c')]+'%'};return _0x1de685;})});}_0x39447c=_[_0xec48('0x3d')]({},_0x39447c,_0x5a68bf[_0xec48('0x3e')]);return _0x33317c[_0xec48('0x5e')](_0x39447c);}})['then'](function(_0x2ee2c0){if(_0x2ee2c0){_0x48d9ed=_0x2ee2c0[_0xec48('0x35')];if(!_0x5a68bf[_0xec48('0x2f')][_0xec48('0x36')]('nolimit')){_0x39447c[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x1c')]);_0x39447c[_0xec48('0x1f')]=qs[_0xec48('0x1f')](_0x5a68bf[_0xec48('0x2f')][_0xec48('0x1f')]);}return _0x33317c[_0xec48('0x5e')](_0x39447c);}})[_0xec48('0x25')](function(_0x4a2c6e){if(_0x4a2c6e){return _0x4a2c6e?{'count':_0x48d9ed,'rows':_0x4a2c6e}:null;}})[_0xec48('0x25')](respondWithResult(_0x4590a5,null))[_0xec48('0x51')](handleError(_0x4590a5,null));};exports[_0xec48('0x5f')]=function(_0x3ddebc,_0x11c59a,_0x560a75){var _0x4eab6c,_0x5efb48;var _0x43a879=[];var _0x426004=moment()['format'](_0xec48('0x60'));return db['Campaign'][_0xec48('0x47')]({'where':{'id':_0x3ddebc['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x11c59a,null))[_0xec48('0x25')](function(_0x5c6c53){if(_0x5c6c53){_0x5efb48=_0x5c6c53;return _0x5c6c53['addLists'](_0x3ddebc['body'][_0xec48('0x61')],_['omit'](_0x3ddebc[_0xec48('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0xa38d94){var _0x2375a2;var _0x3a79af;_0x4eab6c=_0xa38d94||[];var _0x1ae869=[];if(_0xa38d94){for(var _0x4fe934=0x0;_0x4fe934<_0xa38d94[_0xec48('0x35')];_0x4fe934+=0x1){var _0x203cc4=_0xa38d94[_0x4fe934][_0xec48('0x26')]({'plain':!![]});_0x5efb48[_0xec48('0x62')]=_0x3ddebc[_0xec48('0x49')][_0xec48('0x62')]?_0x3ddebc[_0xec48('0x49')]['dialCheckDuplicateType']:_0x5efb48[_0xec48('0x62')];switch(_0x5efb48[_0xec48('0x62')]){case'always':_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))['fromQuery']([_0xec48('0x66'),_0xec48('0x67'),_0xec48('0x68'),_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()['field'](_0xec48('0x66'),_0xec48('0x66'))['field'](_0xec48('0x6c'),_0xec48('0x67'))['field']('id',_0xec48('0x68'))[_0xec48('0x6d')](_0x203cc4['CmListId'][_0xec48('0x6e')](),_0xec48('0x69'))['field'](_0x3ddebc['params']['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27','createdAt')[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x6a'))[_0xec48('0x6f')](_0xec48('0x70'))[_0xec48('0x3a')]('deletedAt\x20IS\x20NULL')[_0xec48('0x3a')](_0xec48('0x71'),_0x203cc4[_0xec48('0x72')][_0xec48('0x6e')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xec48('0x73'),squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x74'))[_0xec48('0x6f')](_0xec48('0x75'))['where'](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')]()))[_0xec48('0x3a')](_0xec48('0x73'),squel[_0xec48('0x6b')]()['field'](_0xec48('0x77'))[_0xec48('0x6f')](_0xec48('0x65'))[_0xec48('0x3a')](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id']['toString']())))[_0xec48('0x6e')]();break;case _0xec48('0x78'):_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))[_0xec48('0x79')]([_0xec48('0x66'),_0xec48('0x67'),'ContactId',_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x66'),_0xec48('0x66'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x67'))[_0xec48('0x6d')]('id',_0xec48('0x68'))[_0xec48('0x6d')](_0x203cc4[_0xec48('0x72')]['toString'](),'ListId')[_0xec48('0x6d')](_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x6a'))[_0xec48('0x6f')]('cm_contacts')[_0xec48('0x3a')](_0xec48('0x7a'))[_0xec48('0x3a')](_0xec48('0x71'),_0x203cc4['CmListId'][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x7b'))[_0xec48('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0xec48('0x6b')]()['field'](_0xec48('0x77'))[_0xec48('0x6f')](_0xec48('0x65'))[_0xec48('0x3a')](_0xec48('0x76'),_0x3ddebc[_0xec48('0x44')]['id'][_0xec48('0x6e')]())))[_0xec48('0x6e')]();break;default:_0x2375a2=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x65'))[_0xec48('0x79')](['phone','scheduledAt',_0xec48('0x68'),_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()['field'](_0xec48('0x66'),_0xec48('0x66'))[_0xec48('0x6d')](_0xec48('0x6c'),'scheduledAt')[_0xec48('0x6d')]('id','ContactId')[_0xec48('0x6d')](_0x203cc4[_0xec48('0x72')]['toString'](),_0xec48('0x69'))[_0xec48('0x6d')](_0x3ddebc[_0xec48('0x44')]['id']['toString'](),_0xec48('0x5a'))[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))['field']('\x27'+_0x426004+'\x27',_0xec48('0x6a'))['from']('cm_contacts')['where'](_0xec48('0x7a'))[_0xec48('0x3a')]('ListId\x20=\x20?',_0x203cc4[_0xec48('0x72')][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x7b')))[_0xec48('0x6e')]();}_0x3a79af=squel[_0xec48('0x63')]()[_0xec48('0x64')](_0xec48('0x7c'))[_0xec48('0x79')]([_0xec48('0x7d'),_0xec48('0x67'),_0xec48('0x66'),'OrderBy',_0xec48('0x54'),_0xec48('0x6a')],squel[_0xec48('0x6b')]()[_0xec48('0x6d')](_0xec48('0x7e'),'id')[_0xec48('0x6d')](_0xec48('0x6c'),'scheduledAt')[_0xec48('0x6d')]('ci.item','phone')[_0xec48('0x6d')](_0xec48('0x7f'),'OrderBy')[_0xec48('0x6d')]('\x27'+_0x426004+'\x27',_0xec48('0x54'))['field']('\x27'+_0x426004+'\x27',_0xec48('0x6a'))['from'](_0xec48('0x80'),'ci')['join'](_0xec48('0x65'),'h','h.ContactId\x20=\x20ci.CmContactId')[_0xec48('0x3a')](_0xec48('0x81'),_0x203cc4['CmListId'][_0xec48('0x6e')]())[_0xec48('0x3a')](_0xec48('0x82'),_0x3ddebc[_0xec48('0x44')]['id']['toString']())[_0xec48('0x3a')](_0xec48('0x83'),_0x426004))['toString']();_0x1ae869[_0xec48('0x84')](db[_0xec48('0x85')][_0xec48('0x2f')](_0x2375a2));_0x43a879[_0xec48('0x84')](db['sequelize']['query'](_0x3a79af));}return BPromise[_0xec48('0x86')](_0x1ae869);}})[_0xec48('0x25')](function(){return BPromise['all'](_0x43a879);})['then'](function(){return _0x4eab6c;})[_0xec48('0x25')](respondWithResult(_0x11c59a,null))[_0xec48('0x51')](handleError(_0x11c59a,null));};exports[_0xec48('0x87')]=function(_0x3c3ffc,_0x5662fe,_0x45b849){return db[_0xec48('0x40')]['find']({'where':{'id':_0x3c3ffc['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x5662fe,null))['then'](function(_0x100f3c){if(_0x100f3c){return _0x100f3c[_0xec48('0x87')](_0x3c3ffc[_0xec48('0x2f')][_0xec48('0x61')]);}})['then'](function(_0x389f08){if(_0x389f08){return db[_0xec48('0x56')][_0xec48('0x24')]({'where':{'ListId':_0x3c3ffc[_0xec48('0x2f')][_0xec48('0x61')],'CampaignId':_0x3c3ffc['params']['id']}})[_0xec48('0x25')](function(){return _0x389f08;});}})[_0xec48('0x25')](respondWithStatusCode(_0x5662fe,null))[_0xec48('0x51')](handleError(_0x5662fe,null));};exports[_0xec48('0x88')]=function(_0x282721,_0x4bc9e3,_0x5eff45){var _0x58b3e4={};var _0x19e37b={};var _0x2b1b9a;var _0x57871b;return db[_0xec48('0x40')]['findOne']({'where':{'id':_0x282721['params']['id']}})[_0xec48('0x25')](handleEntityNotFound(_0x4bc9e3,null))[_0xec48('0x25')](function(_0x1bb002){if(_0x1bb002){_0x2b1b9a=_0x1bb002;_0x19e37b[_0xec48('0x2d')]=_[_0xec48('0x30')](db[_0xec48('0x89')][_0xec48('0x45')]);_0x19e37b['query']=_[_0xec48('0x30')](_0x282721[_0xec48('0x2f')]);_0x19e37b['filters']=_['intersection'](_0x19e37b[_0xec48('0x2d')],_0x19e37b[_0xec48('0x2f')]);_0x58b3e4[_0xec48('0x33')]=_[_0xec48('0x32')](_0x19e37b[_0xec48('0x2d')],qs[_0xec48('0x34')](_0x282721[_0xec48('0x2f')][_0xec48('0x34')]));_0x58b3e4[_0xec48('0x33')]=_0x58b3e4[_0xec48('0x33')][_0xec48('0x35')]?_0x58b3e4[_0xec48('0x33')]:_0x19e37b[_0xec48('0x2d')];_0x58b3e4[_0xec48('0x38')]=qs[_0xec48('0x39')](_0x282721['query'][_0xec48('0x39')]);_0x58b3e4[_0xec48('0x3a')]=qs[_0xec48('0x31')](_[_0xec48('0x57')](_0x282721['query'],_0x19e37b['filters']));if(_0x282721[_0xec48('0x2f')][_0xec48('0x3c')]){_0x58b3e4[_0xec48('0x3a')]=_[_0xec48('0x3d')](_0x58b3e4[_0xec48('0x3a')],{'$or':_[_0xec48('0x2e')](_0x58b3e4[_0xec48('0x33')],function(_0x126301){var _0x488d5e={};_0x488d5e[_0x126301]={'$like':'%'+_0x282721[_0xec48('0x2f')][_0xec48('0x3c')]+'%'};return _0x488d5e;})});}_0x58b3e4=_['merge']({},_0x58b3e4,_0x282721[_0xec48('0x3e')]);return _0x2b1b9a[_0xec48('0x88')](_0x58b3e4);}})[_0xec48('0x25')](function(_0x2695e5){if(_0x2695e5){_0x57871b=_0x2695e5[_0xec48('0x35')];if(!_0x282721[_0xec48('0x2f')][_0xec48('0x36')](_0xec48('0x37'))){_0x58b3e4[_0xec48('0x1c')]=qs[_0xec48('0x1c')](_0x282721[_0xec48('0x2f')]['limit']);_0x58b3e4['offset']=qs['offset'](_0x282721[_0xec48('0x2f')][_0xec48('0x1f')]);}return _0x2b1b9a[_0xec48('0x88')](_0x58b3e4);}})[_0xec48('0x25')](function(_0x4fd407){if(_0x4fd407){return _0x4fd407?{'count':_0x57871b,'rows':_0x4fd407}:null;}})[_0xec48('0x25')](respondWithResult(_0x4bc9e3,null))[_0xec48('0x51')](handleError(_0x4bc9e3,null));};exports['addBlackLists']=function(_0x40d520,_0x9424e5,_0x1b51c1){var _0xd89d7,_0x4292ac;var _0xb44f1d=[];var _0x15bca9=moment()[_0xec48('0x8a')](_0xec48('0x60'));return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x40d520['params']['id']}})['then'](handleEntityNotFound(_0x9424e5,null))[_0xec48('0x25')](function(_0x2beae6){if(_0x2beae6){_0x4292ac=_0x2beae6;return _0x2beae6[_0xec48('0x8b')](_0x40d520[_0xec48('0x49')][_0xec48('0x61')],_[_0xec48('0x53')](_0x40d520[_0xec48('0x49')],['ids','id'])||{});}return null;})[_0xec48('0x8c')](function(_0x1ae850){var _0x33d84c;var _0x400c71;_0xd89d7=_0x1ae850||[];var _0x13171e=[];if(_0x1ae850){for(var _0x45f111=0x0;_0x45f111<_0x1ae850[_0xec48('0x35')];_0x45f111+=0x1){var _0x33d08d=_0x1ae850[_0x45f111][_0xec48('0x26')]({'plain':!![]});_0x33d84c=squel[_0xec48('0x63')]()[_0xec48('0x64')]('cm_hopper_black')[_0xec48('0x79')](['phone','ContactId',_0xec48('0x69'),_0xec48('0x5a'),_0xec48('0x54'),_0xec48('0x6a')],squel['select']()['field'](_0xec48('0x66'),_0xec48('0x66'))['field']('id',_0xec48('0x68'))['field'](_0x33d08d[_0xec48('0x72')][_0xec48('0x6e')](),_0xec48('0x69'))['field'](_0x40d520[_0xec48('0x44')]['id'][_0xec48('0x6e')](),_0xec48('0x5a'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x54'))[_0xec48('0x6d')](_0xec48('0x6c'),_0xec48('0x6a'))[_0xec48('0x6f')](_0xec48('0x70'))[_0xec48('0x3a')](_0xec48('0x7a'))[_0xec48('0x3a')](_0xec48('0x71'),_0x33d08d[_0xec48('0x72')][_0xec48('0x6e')]())[_0xec48('0x3a')]('phone\x20IS\x20NOT\x20NULL'))[_0xec48('0x6e')]();_0x13171e['push'](db['sequelize'][_0xec48('0x2f')](_0x33d84c));}return BPromise[_0xec48('0x86')](_0x13171e);}})[_0xec48('0x25')](function(){return _0xd89d7;})[_0xec48('0x25')](respondWithResult(_0x9424e5,null))[_0xec48('0x51')](handleError(_0x9424e5,null));};exports[_0xec48('0x8d')]=function(_0x576520,_0x4402b9,_0x1df1e9){return db[_0xec48('0x40')][_0xec48('0x47')]({'where':{'id':_0x576520[_0xec48('0x44')]['id']}})['then'](handleEntityNotFound(_0x4402b9,null))[_0xec48('0x25')](function(_0x1839b2){if(_0x1839b2){return _0x1839b2[_0xec48('0x8d')](_0x576520[_0xec48('0x2f')][_0xec48('0x61')]);}})['then'](function(_0x23f53e){if(_0x23f53e){return db[_0xec48('0x5d')][_0xec48('0x24')]({'where':{'ListId':_0x576520[_0xec48('0x2f')][_0xec48('0x61')],'CampaignId':_0x576520[_0xec48('0x44')]['id']}})[_0xec48('0x25')](function(){return _0x23f53e;});}})[_0xec48('0x25')](respondWithStatusCode(_0x4402b9,null))['catch'](handleError(_0x4402b9,null));};
\ No newline at end of file
+var _0x3306=['send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','includeAll','include','Campaign','findAll','rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','updatedAt','body','getHoppers','findOne','CmHopper','CampaignId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','createdAt','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','select','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','insert','cm_contacts','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name'];(function(_0x44c983,_0x3ae50b){var _0x151cfe=function(_0x12c635){while(--_0x12c635){_0x44c983['push'](_0x44c983['shift']());}};_0x151cfe(++_0x3ae50b);}(_0x3306,0x107));var _0x6330=function(_0x510700,_0x173958){_0x510700=_0x510700-0x0;var _0x1e0ccb=_0x3306[_0x510700];return _0x1e0ccb;};'use strict';var emlformat=require(_0x6330('0x0'));var rimraf=require(_0x6330('0x1'));var zipdir=require(_0x6330('0x2'));var jsonpatch=require(_0x6330('0x3'));var rp=require('request-promise');var moment=require(_0x6330('0x4'));var BPromise=require(_0x6330('0x5'));var Mustache=require(_0x6330('0x6'));var util=require(_0x6330('0x7'));var path=require(_0x6330('0x8'));var sox=require('sox');var csv=require(_0x6330('0x9'));var ejs=require(_0x6330('0xa'));var fs=require('fs');var fs_extra=require(_0x6330('0xb'));var _=require(_0x6330('0xc'));var squel=require(_0x6330('0xd'));var crypto=require(_0x6330('0xe'));var jsforce=require(_0x6330('0xf'));var deskjs=require(_0x6330('0x10'));var toCsv=require(_0x6330('0x9'));var querystring=require(_0x6330('0x11'));var Papa=require('papaparse');var Redis=require(_0x6330('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6330('0x13'));var as=require(_0x6330('0x14'));var hardwareService=require(_0x6330('0x15'));var logger=require(_0x6330('0x16'))(_0x6330('0x17'));var utils=require(_0x6330('0x18'));var config=require(_0x6330('0x19'));var licenseUtil=require(_0x6330('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a7e6c,_0x1d4767){_0x1d4767=_0x1d4767||0xcc;return function(_0x27ff9a){if(_0x27ff9a){return _0x5a7e6c[_0x6330('0x1b')](_0x1d4767);}return _0x5a7e6c[_0x6330('0x1c')](_0x1d4767)[_0x6330('0x1d')]();};}function respondWithResult(_0x4b4cce,_0x15fa68){_0x15fa68=_0x15fa68||0xc8;return function(_0x38367a){if(_0x38367a){return _0x4b4cce[_0x6330('0x1c')](_0x15fa68)[_0x6330('0x1e')](_0x38367a);}};}function respondWithFilteredResult(_0x5140e3,_0x4c6860){return function(_0x32b59f){if(_0x32b59f){var _0x476774=typeof _0x4c6860[_0x6330('0x1f')]==='undefined'&&typeof _0x4c6860[_0x6330('0x20')]===_0x6330('0x21');var _0x5a643e=_0x32b59f['count'];var _0x348b34=_0x476774?0x0:_0x4c6860[_0x6330('0x1f')];var _0x3ba601=_0x476774?_0x32b59f[_0x6330('0x22')]:_0x4c6860[_0x6330('0x1f')]+_0x4c6860[_0x6330('0x20')];var _0xfbafd6;if(_0x3ba601>=_0x5a643e){_0x3ba601=_0x5a643e;_0xfbafd6=0xc8;}else{_0xfbafd6=0xce;}_0x5140e3[_0x6330('0x1c')](_0xfbafd6);return _0x5140e3[_0x6330('0x23')](_0x6330('0x24'),_0x348b34+'-'+_0x3ba601+'/'+_0x5a643e)['json'](_0x32b59f);}return null;};}function patchUpdates(_0x1fdc20){return function(_0x206757){try{jsonpatch[_0x6330('0x25')](_0x206757,_0x1fdc20,!![]);}catch(_0x3c8ce5){return BPromise[_0x6330('0x26')](_0x3c8ce5);}return _0x206757['save']();};}function saveUpdates(_0x414fd6,_0x415840){return function(_0x282809){if(_0x282809){return _0x282809[_0x6330('0x27')](_0x414fd6)[_0x6330('0x28')](function(_0x186b91){return _0x186b91;});}return null;};}function removeEntity(_0x50af90,_0x54cbeb){return function(_0x59144c){if(_0x59144c){return _0x59144c[_0x6330('0x29')]()[_0x6330('0x28')](function(){var _0x24702b=_0x59144c[_0x6330('0x2a')]({'plain':!![]});var _0x5899f8=_0x6330('0x2b');return db[_0x6330('0x2c')][_0x6330('0x29')]({'where':{'type':_0x5899f8,'resourceId':_0x24702b['id']}})[_0x6330('0x28')](function(){return _0x59144c;});})[_0x6330('0x28')](function(){_0x50af90['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x255861,_0xfe629c){return function(_0x1aba87){if(!_0x1aba87){_0x255861['sendStatus'](0x194);}return _0x1aba87;};}function handleError(_0x206262,_0x1cb436){_0x1cb436=_0x1cb436||0x1f4;return function(_0x325037){logger[_0x6330('0x2d')](_0x325037['stack']);if(_0x325037[_0x6330('0x2e')]){delete _0x325037['name'];}_0x206262[_0x6330('0x1c')](_0x1cb436)[_0x6330('0x2f')](_0x325037);};}exports[_0x6330('0x30')]=function(_0x3e8efc,_0x4d41c5){var _0x102315={},_0x26a76e={},_0x547f35={'count':0x0,'rows':[]};var _0x3dca32=_[_0x6330('0x31')](db['Campaign'][_0x6330('0x32')],function(_0x47ce15){return{'name':_0x47ce15[_0x6330('0x33')],'type':_0x47ce15['type'][_0x6330('0x34')]};});_0x26a76e['model']=_['map'](_0x3dca32,_0x6330('0x2e'));_0x26a76e[_0x6330('0x35')]=_[_0x6330('0x36')](_0x3e8efc[_0x6330('0x35')]);_0x26a76e[_0x6330('0x37')]=_[_0x6330('0x38')](_0x26a76e[_0x6330('0x39')],_0x26a76e[_0x6330('0x35')]);_0x102315[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x26a76e[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3e8efc['query'][_0x6330('0x3b')]));_0x102315['attributes']=_0x102315[_0x6330('0x3a')][_0x6330('0x3c')]?_0x102315[_0x6330('0x3a')]:_0x26a76e[_0x6330('0x39')];if(!_0x3e8efc[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x102315[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x3e8efc[_0x6330('0x35')]['limit']);_0x102315[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x3e8efc['query']['offset']);}_0x102315[_0x6330('0x3f')]=qs['sort'](_0x3e8efc[_0x6330('0x35')][_0x6330('0x40')]);_0x102315[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x3e8efc[_0x6330('0x35')],_0x26a76e[_0x6330('0x37')]),_0x3dca32);if(_0x3e8efc[_0x6330('0x35')]['filter']){_0x102315[_0x6330('0x41')]=_[_0x6330('0x43')](_0x102315[_0x6330('0x41')],{'$or':_['map'](_0x3dca32,function(_0x4ea175){if(_0x4ea175[_0x6330('0x44')]!==_0x6330('0x45')){var _0x3d5440={};_0x3d5440[_0x4ea175['name']]={'$like':'%'+_0x3e8efc['query']['filter']+'%'};return _0x3d5440;}})});}_0x102315=_['merge']({},_0x102315,_0x3e8efc['options']);var _0x1e7964={'where':_0x102315['where']};return db['Campaign'][_0x6330('0x22')](_0x1e7964)[_0x6330('0x28')](function(_0x46f26c){_0x547f35[_0x6330('0x22')]=_0x46f26c;if(_0x3e8efc[_0x6330('0x35')][_0x6330('0x46')]){_0x102315[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x48')][_0x6330('0x49')](_0x102315);})[_0x6330('0x28')](function(_0x531c8a){_0x547f35[_0x6330('0x4a')]=_0x531c8a;return _0x547f35;})[_0x6330('0x28')](respondWithFilteredResult(_0x4d41c5,_0x102315))[_0x6330('0x4b')](handleError(_0x4d41c5,null));};exports[_0x6330('0x4c')]=function(_0x3b1fd3,_0x5d9cc9){var _0x2dd36a={'raw':![],'where':{'id':_0x3b1fd3['params']['id']}},_0x10811e={};_0x10811e[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x48')]['rawAttributes']);_0x10811e[_0x6330('0x35')]=_[_0x6330('0x36')](_0x3b1fd3[_0x6330('0x35')]);_0x10811e[_0x6330('0x37')]=_[_0x6330('0x38')](_0x10811e['model'],_0x10811e[_0x6330('0x35')]);_0x2dd36a[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x10811e[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3b1fd3[_0x6330('0x35')][_0x6330('0x3b')]));_0x2dd36a['attributes']=_0x2dd36a[_0x6330('0x3a')][_0x6330('0x3c')]?_0x2dd36a['attributes']:_0x10811e['model'];if(_0x3b1fd3['query'][_0x6330('0x46')]){_0x2dd36a['include']=[{'all':!![]}];}_0x2dd36a=_[_0x6330('0x43')]({},_0x2dd36a,_0x3b1fd3['options']);return db['Campaign'][_0x6330('0x4d')](_0x2dd36a)[_0x6330('0x28')](handleEntityNotFound(_0x5d9cc9,null))[_0x6330('0x28')](respondWithResult(_0x5d9cc9,null))[_0x6330('0x4b')](handleError(_0x5d9cc9,null));};exports['create']=function(_0x1f77e3,_0x66f6a2){return db['Campaign'][_0x6330('0x4e')](_0x1f77e3['body'],{})[_0x6330('0x28')](function(_0x2ffb53){var _0x42fbed=_0x1f77e3[_0x6330('0x4f')][_0x6330('0x2a')]({'plain':!![]});if(!_0x42fbed)throw new Error(_0x6330('0x50'));if(_0x42fbed[_0x6330('0x51')]==='user'){var _0x156b49=_0x2ffb53[_0x6330('0x2a')]({'plain':!![]});var _0x4101ea='IvrCampaigns';return db[_0x6330('0x52')]['find']({'where':{'name':_0x4101ea,'userProfileId':_0x42fbed[_0x6330('0x53')]},'raw':!![]})['then'](function(_0x2328f8){if(_0x2328f8&&_0x2328f8[_0x6330('0x54')]===0x0){return db[_0x6330('0x2c')][_0x6330('0x4e')]({'name':_0x156b49[_0x6330('0x2e')],'resourceId':_0x156b49['id'],'type':_0x2328f8['name'],'sectionId':_0x2328f8['id']},{})[_0x6330('0x28')](function(){return _0x2ffb53;});}else{return _0x2ffb53;}})[_0x6330('0x4b')](function(_0x1c6fda){logger[_0x6330('0x2d')](_0x6330('0x55'),_0x1c6fda);throw _0x1c6fda;});}return _0x2ffb53;})[_0x6330('0x28')](respondWithResult(_0x66f6a2,0xc9))['catch'](handleError(_0x66f6a2,null));};exports[_0x6330('0x56')]=function(_0x25a720,_0x14524a){var _0x1957ce={'where':{'id':_0x25a720[_0x6330('0x57')]['id']}},_0x445c4f={};_0x445c4f['model']=_[_0x6330('0x36')](db[_0x6330('0x48')][_0x6330('0x32')]);_0x1957ce[_0x6330('0x3a')]=_['intersection'](_0x445c4f[_0x6330('0x39')],qs['fields'](_0x25a720[_0x6330('0x35')][_0x6330('0x3b')]));_0x1957ce[_0x6330('0x3a')]=_0x1957ce['attributes'][_0x6330('0x3c')]?_0x1957ce[_0x6330('0x3a')]:_0x445c4f[_0x6330('0x39')];if(_0x25a720[_0x6330('0x35')][_0x6330('0x46')]){_0x1957ce[_0x6330('0x47')]=[{'all':!![]}];}_0x1957ce=_['merge']({},_0x1957ce,_0x25a720[_0x6330('0x58')]);return db['Campaign']['find'](_0x1957ce)[_0x6330('0x28')](handleEntityNotFound(_0x14524a,null))[_0x6330('0x28')](function(_0x1ae62f){if(_0x1ae62f){var _0x10c4ab=_0x1ae62f['get']({'plain':!![]});_0x10c4ab=qs[_0x6330('0x59')](_0x10c4ab,['id','createdAt',_0x6330('0x5a')]);_0x25a720[_0x6330('0x5b')]=_[_0x6330('0x59')](_0x25a720[_0x6330('0x5b')],['id','createdAt',_0x6330('0x5a')]);return db['Campaign'][_0x6330('0x4e')](_[_0x6330('0x43')](_0x10c4ab,_0x25a720[_0x6330('0x5b')]),{'include':_0x25a720[_0x6330('0x35')][_0x6330('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x527fdd){var _0x84fa67=_0x25a720['user'][_0x6330('0x2a')]({'plain':!![]});if(!_0x84fa67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x84fa67[_0x6330('0x51')]===_0x6330('0x4f')){var _0x260006=_0x527fdd[_0x6330('0x2a')]({'plain':!![]});var _0x47a841=_0x6330('0x2b');return db[_0x6330('0x52')][_0x6330('0x4d')]({'where':{'name':_0x47a841,'userProfileId':_0x84fa67[_0x6330('0x53')]},'raw':!![]})[_0x6330('0x28')](function(_0x5c57e7){if(_0x5c57e7&&_0x5c57e7[_0x6330('0x54')]===0x0){return db[_0x6330('0x2c')][_0x6330('0x4e')]({'name':_0x260006[_0x6330('0x2e')],'resourceId':_0x260006['id'],'type':_0x5c57e7[_0x6330('0x2e')],'sectionId':_0x5c57e7['id']},{})[_0x6330('0x28')](function(){return _0x527fdd;});}else{return _0x527fdd;}})[_0x6330('0x4b')](function(_0x44a035){logger['error'](_0x6330('0x55'),_0x44a035);throw _0x44a035;});}return _0x527fdd;});}})[_0x6330('0x28')](respondWithResult(_0x14524a,0xc9))['catch'](handleError(_0x14524a,null));};exports[_0x6330('0x27')]=function(_0x476790,_0x20758e){if(_0x476790['body']['id']){delete _0x476790[_0x6330('0x5b')]['id'];}return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x476790['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x20758e,null))['then'](saveUpdates(_0x476790[_0x6330('0x5b')],null))[_0x6330('0x28')](respondWithResult(_0x20758e,null))[_0x6330('0x4b')](handleError(_0x20758e,null));};exports[_0x6330('0x29')]=function(_0x3aee33,_0x4f1144){return db['Campaign'][_0x6330('0x4d')]({'where':{'id':_0x3aee33[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x4f1144,null))[_0x6330('0x28')](removeEntity(_0x4f1144,null))[_0x6330('0x4b')](handleError(_0x4f1144,null));};exports[_0x6330('0x5c')]=function(_0xd154cb,_0x5a5c7f,_0x4f1c4d){var _0x3d8b99={'raw':!![],'where':{}};var _0x12c59a={};var _0x261f62={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0xd154cb[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x5a5c7f,null))[_0x6330('0x28')](function(_0x2283c5){if(_0x2283c5){_0x12c59a['model']=_[_0x6330('0x36')](db[_0x6330('0x5e')]['rawAttributes']);_0x12c59a[_0x6330('0x35')]=_[_0x6330('0x36')](_0xd154cb[_0x6330('0x35')]);_0x12c59a[_0x6330('0x37')]=_[_0x6330('0x38')](_0x12c59a['model'],_0x12c59a['query']);_0x3d8b99['attributes']=_[_0x6330('0x38')](_0x12c59a[_0x6330('0x39')],qs[_0x6330('0x3b')](_0xd154cb[_0x6330('0x35')]['fields']));_0x3d8b99[_0x6330('0x3a')]=_0x3d8b99[_0x6330('0x3a')]['length']?_0x3d8b99[_0x6330('0x3a')]:_0x12c59a[_0x6330('0x39')];if(!_0xd154cb[_0x6330('0x35')][_0x6330('0x3d')]('nolimit')){_0x3d8b99[_0x6330('0x20')]=qs[_0x6330('0x20')](_0xd154cb['query'][_0x6330('0x20')]);_0x3d8b99[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0xd154cb[_0x6330('0x35')][_0x6330('0x1f')]);}_0x3d8b99['order']=qs[_0x6330('0x40')](_0xd154cb[_0x6330('0x35')][_0x6330('0x40')]);_0x3d8b99[_0x6330('0x41')]=qs[_0x6330('0x37')](_['pick'](_0xd154cb[_0x6330('0x35')],_0x12c59a[_0x6330('0x37')]));_0x3d8b99[_0x6330('0x41')][_0x6330('0x5f')]=_0x2283c5['id'];if(_0xd154cb['query'][_0x6330('0x60')]){_0x3d8b99[_0x6330('0x41')]=_[_0x6330('0x43')](_0x3d8b99[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x3d8b99[_0x6330('0x3a')],function(_0x53b1f2){var _0x53f521={};_0x53f521[_0x53b1f2]={'$like':'%'+_0xd154cb[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x53f521;})});}_0x3d8b99=_[_0x6330('0x43')]({},_0x3d8b99,_0xd154cb[_0x6330('0x58')]);return db[_0x6330('0x5e')][_0x6330('0x22')]({'where':_0x3d8b99['where']})['then'](function(_0x152dcd){_0x261f62[_0x6330('0x22')]=_0x152dcd;if(_0xd154cb[_0x6330('0x35')][_0x6330('0x46')]){_0x3d8b99['include']=[{'all':!![]}];}return db[_0x6330('0x5e')][_0x6330('0x49')](_0x3d8b99);})[_0x6330('0x28')](function(_0x5efaa6){_0x261f62[_0x6330('0x4a')]=_0x5efaa6;return _0x261f62;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x5a5c7f,_0x3d8b99))[_0x6330('0x4b')](handleError(_0x5a5c7f,null));};exports[_0x6330('0x61')]=function(_0x495868,_0x3c764b,_0x8ea670){var _0x1a61b4={'raw':!![],'where':{}};var _0x1f5020={};var _0x10c0da={'count':0x0,'rows':[]};return db['Campaign'][_0x6330('0x5d')]({'where':{'id':_0x495868['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x3c764b,null))['then'](function(_0x22cc13){if(_0x22cc13){_0x1f5020[_0x6330('0x39')]=_[_0x6330('0x36')](db['CmHopperHistory'][_0x6330('0x32')]);_0x1f5020[_0x6330('0x35')]=_[_0x6330('0x36')](_0x495868[_0x6330('0x35')]);_0x1f5020['filters']=_[_0x6330('0x38')](_0x1f5020[_0x6330('0x39')],_0x1f5020['query']);_0x1a61b4[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x1f5020['model'],qs[_0x6330('0x3b')](_0x495868[_0x6330('0x35')][_0x6330('0x3b')]));_0x1a61b4[_0x6330('0x3a')]=_0x1a61b4[_0x6330('0x3a')][_0x6330('0x3c')]?_0x1a61b4[_0x6330('0x3a')]:_0x1f5020[_0x6330('0x39')];if(!_0x495868['query'][_0x6330('0x3d')](_0x6330('0x3e'))){_0x1a61b4[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x495868[_0x6330('0x35')][_0x6330('0x20')]);_0x1a61b4[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x495868[_0x6330('0x35')]['offset']);}_0x1a61b4[_0x6330('0x3f')]=qs['sort'](_0x495868[_0x6330('0x35')][_0x6330('0x40')]);_0x1a61b4[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x495868['query'],_0x1f5020['filters']));_0x1a61b4[_0x6330('0x41')][_0x6330('0x5f')]=_0x22cc13['id'];if(_0x495868[_0x6330('0x35')]['filter']){_0x1a61b4[_0x6330('0x41')]=_['merge'](_0x1a61b4[_0x6330('0x41')],{'$or':_['map'](_0x1a61b4[_0x6330('0x3a')],function(_0x16332f){var _0x1583c0={};_0x1583c0[_0x16332f]={'$like':'%'+_0x495868[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x1583c0;})});}_0x1a61b4=_[_0x6330('0x43')]({},_0x1a61b4,_0x495868['options']);return db[_0x6330('0x62')][_0x6330('0x22')]({'where':_0x1a61b4[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x5d57fd){_0x10c0da['count']=_0x5d57fd;if(_0x495868[_0x6330('0x35')][_0x6330('0x46')]){_0x1a61b4[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x62')][_0x6330('0x49')](_0x1a61b4);})['then'](function(_0x527d33){_0x10c0da[_0x6330('0x4a')]=_0x527d33;return _0x10c0da;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x3c764b,_0x1a61b4))['catch'](handleError(_0x3c764b,null));};exports[_0x6330('0x63')]=function(_0x31ffc4,_0x370d75,_0x55e47e){var _0x48913d={'raw':!![],'where':{}};var _0x43e3c1={};var _0x2c464b={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0x31ffc4[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x370d75,null))[_0x6330('0x28')](function(_0xfc5f06){if(_0xfc5f06){_0x43e3c1['model']=_[_0x6330('0x36')](db[_0x6330('0x64')][_0x6330('0x32')]);_0x43e3c1[_0x6330('0x35')]=_[_0x6330('0x36')](_0x31ffc4[_0x6330('0x35')]);_0x43e3c1[_0x6330('0x37')]=_['intersection'](_0x43e3c1[_0x6330('0x39')],_0x43e3c1[_0x6330('0x35')]);_0x48913d[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x43e3c1[_0x6330('0x39')],qs['fields'](_0x31ffc4[_0x6330('0x35')][_0x6330('0x3b')]));_0x48913d['attributes']=_0x48913d[_0x6330('0x3a')][_0x6330('0x3c')]?_0x48913d[_0x6330('0x3a')]:_0x43e3c1[_0x6330('0x39')];if(!_0x31ffc4[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x48913d[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x31ffc4[_0x6330('0x35')][_0x6330('0x20')]);_0x48913d['offset']=qs['offset'](_0x31ffc4[_0x6330('0x35')]['offset']);}_0x48913d['order']=qs[_0x6330('0x40')](_0x31ffc4[_0x6330('0x35')]['sort']);_0x48913d[_0x6330('0x41')]=qs[_0x6330('0x37')](_['pick'](_0x31ffc4[_0x6330('0x35')],_0x43e3c1[_0x6330('0x37')]));_0x48913d[_0x6330('0x41')][_0x6330('0x5f')]=_0xfc5f06['id'];if(_0x31ffc4[_0x6330('0x35')][_0x6330('0x60')]){_0x48913d[_0x6330('0x41')]=_[_0x6330('0x43')](_0x48913d[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x48913d[_0x6330('0x3a')],function(_0x375c00){var _0x12eabf={};_0x12eabf[_0x375c00]={'$like':'%'+_0x31ffc4[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x12eabf;})});}_0x48913d=_[_0x6330('0x43')]({},_0x48913d,_0x31ffc4['options']);return db[_0x6330('0x64')][_0x6330('0x22')]({'where':_0x48913d[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x46e243){_0x2c464b[_0x6330('0x22')]=_0x46e243;if(_0x31ffc4[_0x6330('0x35')][_0x6330('0x46')]){_0x48913d[_0x6330('0x47')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x48913d);})[_0x6330('0x28')](function(_0x30ff61){_0x2c464b[_0x6330('0x4a')]=_0x30ff61;return _0x2c464b;});}})[_0x6330('0x28')](respondWithFilteredResult(_0x370d75,_0x48913d))[_0x6330('0x4b')](handleError(_0x370d75,null));};exports['getHopperBlacks']=function(_0x521794,_0xe7c69,_0x13e411){var _0x1f889e={'raw':!![],'where':{}};var _0x33e514={};var _0x52ffde={'count':0x0,'rows':[]};return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0x521794[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0xe7c69,null))[_0x6330('0x28')](function(_0x19a100){if(_0x19a100){_0x33e514[_0x6330('0x39')]=_['keys'](db[_0x6330('0x65')][_0x6330('0x32')]);_0x33e514[_0x6330('0x35')]=_['keys'](_0x521794['query']);_0x33e514[_0x6330('0x37')]=_[_0x6330('0x38')](_0x33e514[_0x6330('0x39')],_0x33e514[_0x6330('0x35')]);_0x1f889e[_0x6330('0x3a')]=_['intersection'](_0x33e514[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x521794[_0x6330('0x35')][_0x6330('0x3b')]));_0x1f889e[_0x6330('0x3a')]=_0x1f889e['attributes'][_0x6330('0x3c')]?_0x1f889e[_0x6330('0x3a')]:_0x33e514[_0x6330('0x39')];if(!_0x521794['query'][_0x6330('0x3d')]('nolimit')){_0x1f889e['limit']=qs[_0x6330('0x20')](_0x521794[_0x6330('0x35')][_0x6330('0x20')]);_0x1f889e[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x521794[_0x6330('0x35')][_0x6330('0x1f')]);}_0x1f889e[_0x6330('0x3f')]=qs['sort'](_0x521794[_0x6330('0x35')][_0x6330('0x40')]);_0x1f889e[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x521794[_0x6330('0x35')],_0x33e514[_0x6330('0x37')]));_0x1f889e[_0x6330('0x41')][_0x6330('0x5f')]=_0x19a100['id'];if(_0x521794[_0x6330('0x35')][_0x6330('0x60')]){_0x1f889e[_0x6330('0x41')]=_[_0x6330('0x43')](_0x1f889e[_0x6330('0x41')],{'$or':_[_0x6330('0x31')](_0x1f889e[_0x6330('0x3a')],function(_0x557516){var _0x14d5c1={};_0x14d5c1[_0x557516]={'$like':'%'+_0x521794[_0x6330('0x35')]['filter']+'%'};return _0x14d5c1;})});}_0x1f889e=_[_0x6330('0x43')]({},_0x1f889e,_0x521794[_0x6330('0x58')]);return db[_0x6330('0x65')]['count']({'where':_0x1f889e[_0x6330('0x41')]})[_0x6330('0x28')](function(_0x7b523a){_0x52ffde['count']=_0x7b523a;if(_0x521794['query'][_0x6330('0x46')]){_0x1f889e[_0x6330('0x47')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x1f889e);})[_0x6330('0x28')](function(_0x1bdd60){_0x52ffde['rows']=_0x1bdd60;return _0x52ffde;});}})[_0x6330('0x28')](respondWithFilteredResult(_0xe7c69,_0x1f889e))[_0x6330('0x4b')](handleError(_0xe7c69,null));};exports[_0x6330('0x66')]=function(_0x3ec0e9,_0x28a54e,_0x2cf290){var _0x48fc16={};var _0x206a0b={};var _0x21069f;var _0x29bc4d;return db['Campaign'][_0x6330('0x5d')]({'where':{'id':_0x3ec0e9['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x28a54e,null))['then'](function(_0x1925cd){if(_0x1925cd){_0x21069f=_0x1925cd;_0x206a0b[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x67')][_0x6330('0x32')]);_0x206a0b[_0x6330('0x35')]=_['keys'](_0x3ec0e9['query']);_0x206a0b['filters']=_[_0x6330('0x38')](_0x206a0b[_0x6330('0x39')],_0x206a0b[_0x6330('0x35')]);_0x48fc16[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x206a0b[_0x6330('0x39')],qs[_0x6330('0x3b')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x3b')]));_0x48fc16['attributes']=_0x48fc16[_0x6330('0x3a')]['length']?_0x48fc16[_0x6330('0x3a')]:_0x206a0b[_0x6330('0x39')];_0x48fc16[_0x6330('0x3f')]=qs[_0x6330('0x40')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x40')]);_0x48fc16[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0x3ec0e9[_0x6330('0x35')],_0x206a0b['filters']));if(_0x3ec0e9[_0x6330('0x35')][_0x6330('0x60')]){_0x48fc16[_0x6330('0x41')]=_[_0x6330('0x43')](_0x48fc16[_0x6330('0x41')],{'$or':_['map'](_0x48fc16[_0x6330('0x3a')],function(_0x28b8f3){var _0x4c91d0={};_0x4c91d0[_0x28b8f3]={'$like':'%'+_0x3ec0e9[_0x6330('0x35')][_0x6330('0x60')]+'%'};return _0x4c91d0;})});}_0x48fc16=_[_0x6330('0x43')]({},_0x48fc16,_0x3ec0e9[_0x6330('0x58')]);return _0x21069f[_0x6330('0x66')](_0x48fc16);}})['then'](function(_0x4f9692){if(_0x4f9692){_0x29bc4d=_0x4f9692[_0x6330('0x3c')];if(!_0x3ec0e9['query']['hasOwnProperty']('nolimit')){_0x48fc16[_0x6330('0x20')]=qs[_0x6330('0x20')](_0x3ec0e9[_0x6330('0x35')][_0x6330('0x20')]);_0x48fc16[_0x6330('0x1f')]=qs[_0x6330('0x1f')](_0x3ec0e9[_0x6330('0x35')]['offset']);}return _0x21069f[_0x6330('0x66')](_0x48fc16);}})['then'](function(_0x536f17){if(_0x536f17){return _0x536f17?{'count':_0x29bc4d,'rows':_0x536f17}:null;}})[_0x6330('0x28')](respondWithResult(_0x28a54e,null))[_0x6330('0x4b')](handleError(_0x28a54e,null));};exports[_0x6330('0x68')]=function(_0x26c3db,_0x1a5947,_0x448b45){var _0x4d0ae5,_0x23ddd3;var _0x4c06f7=[];var _0x173987=moment()[_0x6330('0x69')](_0x6330('0x6a'));return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x26c3db['params']['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x1a5947,null))[_0x6330('0x28')](function(_0x1d450f){if(_0x1d450f){_0x23ddd3=_0x1d450f;return _0x1d450f[_0x6330('0x68')](_0x26c3db[_0x6330('0x5b')][_0x6330('0x6b')],_[_0x6330('0x59')](_0x26c3db[_0x6330('0x5b')],['ids','id'])||{});}return null;})[_0x6330('0x6c')](function(_0x29c256){var _0x222c2e;var _0x51368b;_0x4d0ae5=_0x29c256||[];var _0x48fed2=[];if(_0x29c256){for(var _0x436f17=0x0;_0x436f17<_0x29c256['length'];_0x436f17+=0x1){var _0x335121=_0x29c256[_0x436f17][_0x6330('0x2a')]({'plain':!![]});_0x23ddd3[_0x6330('0x6d')]=_0x26c3db[_0x6330('0x5b')][_0x6330('0x6d')]?_0x26c3db[_0x6330('0x5b')]['dialCheckDuplicateType']:_0x23ddd3[_0x6330('0x6d')];switch(_0x23ddd3[_0x6330('0x6d')]){case _0x6330('0x6e'):_0x222c2e=squel['insert']()[_0x6330('0x6f')](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),_0x6330('0x73'),_0x6330('0x74'),_0x6330('0x75'),_0x6330('0x5f'),'createdAt','updatedAt'],squel['select']()[_0x6330('0x76')](_0x6330('0x72'),'phone')[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))['field']('id',_0x6330('0x74'))['field'](_0x335121[_0x6330('0x78')][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x26c3db['params']['id']['toString'](),'CampaignId')['field']('\x27'+_0x173987+'\x27',_0x6330('0x7a'))['field']('\x27'+_0x173987+'\x27','updatedAt')['from']('cm_contacts')[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x335121[_0x6330('0x78')][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x7d'))[_0x6330('0x41')](_0x6330('0x7e'),squel['select']()[_0x6330('0x76')](_0x6330('0x7f'))[_0x6330('0x80')](_0x6330('0x81'))['where']('CampaignId\x20=\x20?',_0x26c3db['params']['id'][_0x6330('0x79')]()))[_0x6330('0x41')](_0x6330('0x7e'),squel[_0x6330('0x82')]()['field'](_0x6330('0x83'))[_0x6330('0x80')]('cm_hopper')[_0x6330('0x41')](_0x6330('0x84'),_0x26c3db['params']['id'][_0x6330('0x79')]())))[_0x6330('0x79')]();break;case _0x6330('0x85'):_0x222c2e=squel[_0x6330('0x86')]()['into'](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),_0x6330('0x73'),_0x6330('0x74'),_0x6330('0x75'),_0x6330('0x5f'),_0x6330('0x7a'),_0x6330('0x5a')],squel['select']()['field'](_0x6330('0x72'),'phone')[_0x6330('0x76')]('NOW()',_0x6330('0x73'))[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x335121[_0x6330('0x78')][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')](),_0x6330('0x5f'))['field']('\x27'+_0x173987+'\x27',_0x6330('0x7a'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))['where'](_0x6330('0x7c'),_0x335121['CmListId']['toString']())[_0x6330('0x41')](_0x6330('0x7d'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x6330('0x82')]()['field'](_0x6330('0x83'))[_0x6330('0x80')](_0x6330('0x70'))[_0x6330('0x41')]('CampaignId\x20=\x20?',_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')]())))[_0x6330('0x79')]();break;default:_0x222c2e=squel[_0x6330('0x86')]()[_0x6330('0x6f')](_0x6330('0x70'))[_0x6330('0x71')]([_0x6330('0x72'),'scheduledAt',_0x6330('0x74'),'ListId',_0x6330('0x5f'),_0x6330('0x7a'),_0x6330('0x5a')],squel[_0x6330('0x82')]()['field'](_0x6330('0x72'),_0x6330('0x72'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x335121['CmListId'][_0x6330('0x79')](),'ListId')['field'](_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')](),'CampaignId')[_0x6330('0x76')]('\x27'+_0x173987+'\x27','createdAt')[_0x6330('0x76')]('\x27'+_0x173987+'\x27','updatedAt')[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x335121['CmListId']['toString']())['where'](_0x6330('0x7d')))[_0x6330('0x79')]();}_0x51368b=squel[_0x6330('0x86')]()[_0x6330('0x6f')](_0x6330('0x88'))[_0x6330('0x71')]([_0x6330('0x89'),_0x6330('0x73'),_0x6330('0x72'),'OrderBy',_0x6330('0x7a'),_0x6330('0x5a')],squel['select']()[_0x6330('0x76')](_0x6330('0x8a'),'id')[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x73'))[_0x6330('0x76')](_0x6330('0x8b'),_0x6330('0x72'))[_0x6330('0x76')](_0x6330('0x8c'),_0x6330('0x8d'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x7a'))[_0x6330('0x76')]('\x27'+_0x173987+'\x27',_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x8e'),'ci')[_0x6330('0x8f')](_0x6330('0x70'),'h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x6330('0x90'),_0x335121[_0x6330('0x78')][_0x6330('0x79')]())['where'](_0x6330('0x91'),_0x26c3db[_0x6330('0x57')]['id'][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x92'),_0x173987))['toString']();_0x48fed2[_0x6330('0x93')](db[_0x6330('0x94')][_0x6330('0x35')](_0x222c2e));_0x4c06f7['push'](db[_0x6330('0x94')]['query'](_0x51368b));}return BPromise['all'](_0x48fed2);}})[_0x6330('0x28')](function(){return BPromise[_0x6330('0x95')](_0x4c06f7);})['then'](function(){return _0x4d0ae5;})[_0x6330('0x28')](respondWithResult(_0x1a5947,null))[_0x6330('0x4b')](handleError(_0x1a5947,null));};exports[_0x6330('0x96')]=function(_0x59a2df,_0x45c24b,_0x11f802){return db[_0x6330('0x48')]['find']({'where':{'id':_0x59a2df[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x45c24b,null))[_0x6330('0x28')](function(_0x4f7c22){if(_0x4f7c22){return _0x4f7c22['removeLists'](_0x59a2df[_0x6330('0x35')][_0x6330('0x6b')]);}})[_0x6330('0x28')](function(_0xdf58db){if(_0xdf58db){return db[_0x6330('0x5e')][_0x6330('0x29')]({'where':{'ListId':_0x59a2df[_0x6330('0x35')]['ids'],'CampaignId':_0x59a2df[_0x6330('0x57')]['id']}})[_0x6330('0x28')](function(){return _0xdf58db;});}})[_0x6330('0x28')](respondWithStatusCode(_0x45c24b,null))['catch'](handleError(_0x45c24b,null));};exports['getBlackLists']=function(_0xc001e8,_0x331311,_0x498a2a){var _0x49605d={};var _0x45d314={};var _0x16ace2;var _0xe3dd85;return db[_0x6330('0x48')][_0x6330('0x5d')]({'where':{'id':_0xc001e8[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x331311,null))[_0x6330('0x28')](function(_0x375f18){if(_0x375f18){_0x16ace2=_0x375f18;_0x45d314[_0x6330('0x39')]=_[_0x6330('0x36')](db[_0x6330('0x67')][_0x6330('0x32')]);_0x45d314['query']=_['keys'](_0xc001e8[_0x6330('0x35')]);_0x45d314[_0x6330('0x37')]=_[_0x6330('0x38')](_0x45d314[_0x6330('0x39')],_0x45d314[_0x6330('0x35')]);_0x49605d[_0x6330('0x3a')]=_[_0x6330('0x38')](_0x45d314['model'],qs[_0x6330('0x3b')](_0xc001e8[_0x6330('0x35')]['fields']));_0x49605d['attributes']=_0x49605d[_0x6330('0x3a')]['length']?_0x49605d[_0x6330('0x3a')]:_0x45d314[_0x6330('0x39')];_0x49605d['order']=qs[_0x6330('0x40')](_0xc001e8[_0x6330('0x35')][_0x6330('0x40')]);_0x49605d[_0x6330('0x41')]=qs[_0x6330('0x37')](_[_0x6330('0x42')](_0xc001e8[_0x6330('0x35')],_0x45d314[_0x6330('0x37')]));if(_0xc001e8[_0x6330('0x35')][_0x6330('0x60')]){_0x49605d[_0x6330('0x41')]=_['merge'](_0x49605d['where'],{'$or':_[_0x6330('0x31')](_0x49605d['attributes'],function(_0x2a11a2){var _0x4c7fd8={};_0x4c7fd8[_0x2a11a2]={'$like':'%'+_0xc001e8['query'][_0x6330('0x60')]+'%'};return _0x4c7fd8;})});}_0x49605d=_['merge']({},_0x49605d,_0xc001e8[_0x6330('0x58')]);return _0x16ace2['getBlackLists'](_0x49605d);}})[_0x6330('0x28')](function(_0x2debb2){if(_0x2debb2){_0xe3dd85=_0x2debb2[_0x6330('0x3c')];if(!_0xc001e8[_0x6330('0x35')][_0x6330('0x3d')](_0x6330('0x3e'))){_0x49605d[_0x6330('0x20')]=qs[_0x6330('0x20')](_0xc001e8[_0x6330('0x35')][_0x6330('0x20')]);_0x49605d['offset']=qs[_0x6330('0x1f')](_0xc001e8['query'][_0x6330('0x1f')]);}return _0x16ace2[_0x6330('0x97')](_0x49605d);}})[_0x6330('0x28')](function(_0x21cec6){if(_0x21cec6){return _0x21cec6?{'count':_0xe3dd85,'rows':_0x21cec6}:null;}})[_0x6330('0x28')](respondWithResult(_0x331311,null))[_0x6330('0x4b')](handleError(_0x331311,null));};exports['addBlackLists']=function(_0x416f08,_0x3f26d7,_0xb22365){var _0x3bd46c,_0x43a1b8;var _0xa6884c=[];var _0x329e60=moment()[_0x6330('0x69')](_0x6330('0x6a'));return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x416f08[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x3f26d7,null))[_0x6330('0x28')](function(_0x3669b1){if(_0x3669b1){_0x43a1b8=_0x3669b1;return _0x3669b1[_0x6330('0x98')](_0x416f08[_0x6330('0x5b')]['ids'],_[_0x6330('0x59')](_0x416f08[_0x6330('0x5b')],[_0x6330('0x6b'),'id'])||{});}return null;})[_0x6330('0x6c')](function(_0x360582){var _0x5b0ca0;var _0x16d482;_0x3bd46c=_0x360582||[];var _0x468483=[];if(_0x360582){for(var _0x7bfad9=0x0;_0x7bfad9<_0x360582[_0x6330('0x3c')];_0x7bfad9+=0x1){var _0x22af72=_0x360582[_0x7bfad9][_0x6330('0x2a')]({'plain':!![]});_0x5b0ca0=squel[_0x6330('0x86')]()['into'](_0x6330('0x99'))[_0x6330('0x71')](['phone','ContactId',_0x6330('0x75'),_0x6330('0x5f'),_0x6330('0x7a'),'updatedAt'],squel[_0x6330('0x82')]()[_0x6330('0x76')](_0x6330('0x72'),'phone')[_0x6330('0x76')]('id',_0x6330('0x74'))[_0x6330('0x76')](_0x22af72['CmListId'][_0x6330('0x79')](),_0x6330('0x75'))[_0x6330('0x76')](_0x416f08[_0x6330('0x57')]['id'][_0x6330('0x79')](),_0x6330('0x5f'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x7a'))[_0x6330('0x76')](_0x6330('0x77'),_0x6330('0x5a'))[_0x6330('0x80')](_0x6330('0x87'))[_0x6330('0x41')](_0x6330('0x7b'))[_0x6330('0x41')](_0x6330('0x7c'),_0x22af72[_0x6330('0x78')][_0x6330('0x79')]())[_0x6330('0x41')](_0x6330('0x7d')))['toString']();_0x468483[_0x6330('0x93')](db[_0x6330('0x94')][_0x6330('0x35')](_0x5b0ca0));}return BPromise[_0x6330('0x95')](_0x468483);}})[_0x6330('0x28')](function(){return _0x3bd46c;})[_0x6330('0x28')](respondWithResult(_0x3f26d7,null))[_0x6330('0x4b')](handleError(_0x3f26d7,null));};exports[_0x6330('0x9a')]=function(_0x3fc251,_0x6433c4,_0x1d2176){return db[_0x6330('0x48')][_0x6330('0x4d')]({'where':{'id':_0x3fc251[_0x6330('0x57')]['id']}})[_0x6330('0x28')](handleEntityNotFound(_0x6433c4,null))['then'](function(_0x1c7542){if(_0x1c7542){return _0x1c7542['removeBlackLists'](_0x3fc251['query'][_0x6330('0x6b')]);}})['then'](function(_0x11beb0){if(_0x11beb0){return db[_0x6330('0x65')][_0x6330('0x29')]({'where':{'ListId':_0x3fc251['query'][_0x6330('0x6b')],'CampaignId':_0x3fc251['params']['id']}})[_0x6330('0x28')](function(){return _0x11beb0;});}})['then'](respondWithStatusCode(_0x6433c4,null))[_0x6330('0x4b')](handleError(_0x6433c4,null));};
\ No newline at end of file
index ff7cfa8..62ce57e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e36badf..4fc9068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7333=['info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xa3c06b,_0x490f99){var _0x33aa1d=function(_0x23a88e){while(--_0x23a88e){_0xa3c06b['push'](_0xa3c06b['shift']());}};_0x33aa1d(++_0x490f99);}(_0x7333,0xfc));var _0x3733=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7333[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var moment=require(_0x3733('0x1'));var BPromise=require('bluebird');var rs=require(_0x3733('0x2'));var fs=require('fs');var Redis=require(_0x3733('0x3'));var db=require(_0x3733('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3733('0x5'))(_0x3733('0x6'));var config=require(_0x3733('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3733('0x8')][_0x3733('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3330c6,_0x3aab36,_0x5b5a50){return new BPromise(function(_0x1ee542,_0x5b184b){return client[_0x3733('0xa')](_0x3330c6,_0x5b5a50)[_0x3733('0xb')](function(_0x3bf4bc){logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));logger['debug'](_0x3733('0xe'),_0x3aab36,_0x3733('0xd'),JSON[_0x3733('0xf')](_0x3bf4bc));if(_0x3bf4bc[_0x3733('0x10')]){if(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x11')]===0x1f4){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x5b184b(_0x3bf4bc[_0x3733('0x10')]['message']);}logger['error'](_0x3733('0x12'),_0x3aab36,_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);return _0x1ee542(_0x3bf4bc[_0x3733('0x10')][_0x3733('0x13')]);}else{logger[_0x3733('0xc')]('Campaign,\x20%s,\x20%s',_0x3aab36,_0x3733('0xd'));_0x1ee542(_0x3bf4bc[_0x3733('0x14')][_0x3733('0x13')]);}})[_0x3733('0x15')](function(_0x56c17a){logger[_0x3733('0x10')](_0x3733('0x12'),_0x3aab36,_0x56c17a);_0x5b184b(_0x56c17a);});});}exports[_0x3733('0x16')]=function(_0xd0f743){var _0x497600=this;return new Promise(function(_0x24a91e,_0x328490){return db[_0x3733('0x17')][_0x3733('0x18')]({'raw':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1a')]===undefined?!![]:![]:!![],'where':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')]['where']||null:null,'attributes':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1b')]||null:null,'limit':_0xd0f743['options']?_0xd0f743[_0x3733('0x19')][_0x3733('0x1c')]||null:null,'include':_0xd0f743[_0x3733('0x19')]?_0xd0f743[_0x3733('0x19')][_0x3733('0x1d')]?_[_0x3733('0x1e')](_0xd0f743[_0x3733('0x19')]['include'],function(_0x3187a3){return{'model':db[_0x3187a3['model']],'as':_0x3187a3['as'],'attributes':_0x3187a3[_0x3733('0x1b')],'include':_0x3187a3[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3187a3[_0x3733('0x1d')],function(_0x3f77d0){return{'model':db[_0x3f77d0[_0x3733('0x1f')]],'as':_0x3f77d0['as'],'attributes':_0x3f77d0[_0x3733('0x1b')],'include':_0x3f77d0[_0x3733('0x1d')]?_[_0x3733('0x1e')](_0x3f77d0['include'],function(_0x1ce6c1){return{'model':db[_0x1ce6c1['model']],'as':_0x1ce6c1['as'],'attributes':_0x1ce6c1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3733('0xb')](function(_0x12169e){logger[_0x3733('0xc')]('GetCampaign',_0xd0f743);logger[_0x3733('0x20')](_0x3733('0x16'),_0xd0f743,JSON[_0x3733('0xf')](_0x12169e));_0x24a91e(_0x12169e);})[_0x3733('0x15')](function(_0x13b66e){logger[_0x3733('0x10')](_0x3733('0x16'),_0x13b66e['message'],_0xd0f743);_0x328490(_0x497600[_0x3733('0x10')](0x1f4,_0x13b66e[_0x3733('0x13')]));});});};
\ No newline at end of file
+var _0x4c4e=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird'];(function(_0x385c20,_0xa43d3c){var _0x3787e4=function(_0x5f09bd){while(--_0x5f09bd){_0x385c20['push'](_0x385c20['shift']());}};_0x3787e4(++_0xa43d3c);}(_0x4c4e,0x152));var _0xe4c4=function(_0x41890e,_0x4f16fe){_0x41890e=_0x41890e-0x0;var _0xbfafe4=_0x4c4e[_0x41890e];return _0xbfafe4;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('Campaign,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});}exports[_0xe4c4('0x15')]=function(_0x42242c){var _0x3820c7=this;return new Promise(function(_0x43a9ce,_0x376585){return db['Campaign'][_0xe4c4('0x16')]({'raw':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x18')]===undefined?!![]:![]:!![],'where':_0x42242c['options']?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x19')]||null:null,'attributes':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1a')]||null:null,'limit':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1b')]||null:null,'include':_0x42242c[_0xe4c4('0x17')]?_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')]?_[_0xe4c4('0x1d')](_0x42242c[_0xe4c4('0x17')][_0xe4c4('0x1c')],function(_0x15873e){return{'model':db[_0x15873e['model']],'as':_0x15873e['as'],'attributes':_0x15873e['attributes'],'include':_0x15873e[_0xe4c4('0x1c')]?_['map'](_0x15873e[_0xe4c4('0x1c')],function(_0x5374fd){return{'model':db[_0x5374fd[_0xe4c4('0x1e')]],'as':_0x5374fd['as'],'attributes':_0x5374fd['attributes'],'include':_0x5374fd[_0xe4c4('0x1c')]?_['map'](_0x5374fd[_0xe4c4('0x1c')],function(_0x4a0199){return{'model':db[_0x4a0199['model']],'as':_0x4a0199['as'],'attributes':_0x4a0199['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3221cd){logger['info']('GetCampaign',_0x42242c);logger[_0xe4c4('0xe')](_0xe4c4('0x15'),_0x42242c,JSON['stringify'](_0x3221cd));_0x43a9ce(_0x3221cd);})['catch'](function(_0x7428ad){logger[_0xe4c4('0x10')]('GetCampaign',_0x7428ad[_0xe4c4('0x12')],_0x42242c);_0x376585(_0x3820c7[_0xe4c4('0x10')](0x1f4,_0x7428ad[_0xe4c4('0x12')]));});});};
\ No newline at end of file
index 695f03a..708a7a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf33=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','update','destroy','removeLists','delete','removeBlackLists','exports','multer','util','path'];(function(_0x25fc59,_0x4711cf){var _0x3bf8c5=function(_0x4f1ea2){while(--_0x4f1ea2){_0x25fc59['push'](_0x25fc59['shift']());}};_0x3bf8c5(++_0x4711cf);}(_0xcf33,0x10d));var _0x3cf3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcf33[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var path=require(_0x3cf3('0x2'));var timeout=require(_0x3cf3('0x3'));var express=require('express');var router=express[_0x3cf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3cf3('0x5'));var interaction=require(_0x3cf3('0x6'));var config=require(_0x3cf3('0x7'));var controller=require('./campaign.controller');router[_0x3cf3('0x8')]('/',auth[_0x3cf3('0x9')](),controller['index']);router[_0x3cf3('0x8')](_0x3cf3('0xa'),auth['isAuthenticated'](),controller[_0x3cf3('0xb')]);router['get'](_0x3cf3('0xc'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xd')]);router[_0x3cf3('0x8')]('/:id/hopper_histories',auth[_0x3cf3('0x9')](),controller['getHopperHistories']);router[_0x3cf3('0x8')]('/:id/hopper_finals',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xe')]);router[_0x3cf3('0x8')](_0x3cf3('0xf'),auth['isAuthenticated'](),controller[_0x3cf3('0x10')]);router['get'](_0x3cf3('0x11'),auth['isAuthenticated'](),controller[_0x3cf3('0x12')]);router[_0x3cf3('0x8')](_0x3cf3('0x13'),auth['isAuthenticated'](),controller[_0x3cf3('0x14')]);router[_0x3cf3('0x15')]('/',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x16')]);router['post'](_0x3cf3('0x17'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x18')]);router['post'](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x19')]);router[_0x3cf3('0x15')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1a')]);router[_0x3cf3('0x1b')](_0x3cf3('0xa'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1c')]);router['delete']('/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1d')]);router['delete'](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1e')]);router[_0x3cf3('0x1f')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x20')]);module[_0x3cf3('0x21')]=router;
\ No newline at end of file
+var _0xbf0b=['/:id/clone','addLists','addBlackLists','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0xe58ae2,_0x30a065){var _0x369b69=function(_0xa6a029){while(--_0xa6a029){_0xe58ae2['push'](_0xe58ae2['shift']());}};_0x369b69(++_0x30a065);}(_0xbf0b,0x16a));var _0xbbf0=function(_0x1ee4e9,_0x3f6b36){_0x1ee4e9=_0x1ee4e9-0x0;var _0x587b6a=_0xbf0b[_0x1ee4e9];return _0x587b6a;};'use strict';var multer=require(_0xbbf0('0x0'));var util=require(_0xbbf0('0x1'));var path=require(_0xbbf0('0x2'));var timeout=require(_0xbbf0('0x3'));var express=require('express');var router=express[_0xbbf0('0x4')]();var fs_extra=require(_0xbbf0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbbf0('0x6'));var config=require(_0xbbf0('0x7'));var controller=require('./campaign.controller');router[_0xbbf0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbf0('0x8')]('/:id',auth[_0xbbf0('0x9')](),controller['show']);router[_0xbbf0('0x8')](_0xbbf0('0xa'),auth['isAuthenticated'](),controller[_0xbbf0('0xb')]);router[_0xbbf0('0x8')](_0xbbf0('0xc'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0xd')]);router[_0xbbf0('0x8')](_0xbbf0('0xe'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0xf')]);router['get'](_0xbbf0('0x10'),auth[_0xbbf0('0x9')](),controller['getHopperBlacks']);router[_0xbbf0('0x8')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x12')]);router[_0xbbf0('0x8')](_0xbbf0('0x13'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x14')]);router[_0xbbf0('0x15')]('/',auth[_0xbbf0('0x9')](),controller['create']);router[_0xbbf0('0x15')](_0xbbf0('0x16'),auth[_0xbbf0('0x9')](),controller['clone']);router[_0xbbf0('0x15')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x17')]);router[_0xbbf0('0x15')](_0xbbf0('0x13'),auth['isAuthenticated'](),controller[_0xbbf0('0x18')]);router['put'](_0xbbf0('0x19'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1a')]);router[_0xbbf0('0x1b')](_0xbbf0('0x19'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1c')]);router[_0xbbf0('0x1b')](_0xbbf0('0x11'),auth[_0xbbf0('0x9')](),controller[_0xbbf0('0x1d')]);router[_0xbbf0('0x1b')](_0xbbf0('0x13'),auth['isAuthenticated'](),controller[_0xbbf0('0x1e')]);module[_0xbbf0('0x1f')]=router;
\ No newline at end of file
index 7c8458d..90ae4ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8daa=['exports','STRING','TEXT','VIRTUAL','getDataValue','key','sequelize'];(function(_0x15aadf,_0x144c83){var _0x75c612=function(_0x37bb40){while(--_0x37bb40){_0x15aadf['push'](_0x15aadf['shift']());}};_0x75c612(++_0x144c83);}(_0x8daa,0x102));var _0xa8da=function(_0x12b683,_0x124186){_0x12b683=_0x12b683-0x0;var _0xfb150b=_0x8daa[_0x12b683];return _0xfb150b;};'use strict';var Sequelize=require(_0xa8da('0x0'));module[_0xa8da('0x1')]={'key':{'type':Sequelize[_0xa8da('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xa8da('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa8da('0x4')],'get':function(){return this[_0xa8da('0x5')](_0xa8da('0x6'));}}};
\ No newline at end of file
+var _0x23d8=['key','sequelize','exports','TEXT','STRING','VIRTUAL','getDataValue'];(function(_0x1fc183,_0x9e2637){var _0x1301d5=function(_0x3fd342){while(--_0x3fd342){_0x1fc183['push'](_0x1fc183['shift']());}};_0x1301d5(++_0x9e2637);}(_0x23d8,0x127));var _0x823d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x23d8[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x823d('0x0'));module[_0x823d('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x823d('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x823d('0x3')]},'name':{'type':Sequelize[_0x823d('0x4')],'get':function(){return this[_0x823d('0x5')](_0x823d('0x6'));}}};
\ No newline at end of file
index 38eb8d7..f6b55be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d2d=['fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','body','find','params','create','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','CannedAnswers','error','name','send','index','map','CannedAnswer','rawAttributes'];(function(_0x51d3a8,_0x207ca2){var _0x53dbec=function(_0x312150){while(--_0x312150){_0x51d3a8['push'](_0x51d3a8['shift']());}};_0x53dbec(++_0x207ca2);}(_0x7d2d,0x7c));var _0xd7d2=function(_0x3047b4,_0x13059d){_0x3047b4=_0x3047b4-0x0;var _0x1ba017=_0x7d2d[_0x3047b4];return _0x1ba017;};'use strict';var emlformat=require(_0xd7d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd7d2('0x1'));var rp=require(_0xd7d2('0x2'));var moment=require(_0xd7d2('0x3'));var BPromise=require(_0xd7d2('0x4'));var Mustache=require(_0xd7d2('0x5'));var util=require(_0xd7d2('0x6'));var path=require(_0xd7d2('0x7'));var sox=require(_0xd7d2('0x8'));var csv=require(_0xd7d2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7d2('0xa'));var squel=require('squel');var crypto=require(_0xd7d2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd7d2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd7d2('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd7d2('0xe'));var qs=require(_0xd7d2('0xf'));var as=require(_0xd7d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd7d2('0x11'));var utils=require(_0xd7d2('0x12'));var config=require(_0xd7d2('0x13'));var licenseUtil=require(_0xd7d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc631e9,_0x55f25e){_0x55f25e=_0x55f25e||0xcc;return function(_0x9c5077){if(_0x9c5077){return _0xc631e9[_0xd7d2('0x15')](_0x55f25e);}return _0xc631e9['status'](_0x55f25e)[_0xd7d2('0x16')]();};}function respondWithResult(_0x1a7f59,_0x44d976){_0x44d976=_0x44d976||0xc8;return function(_0x5df645){if(_0x5df645){return _0x1a7f59[_0xd7d2('0x17')](_0x44d976)[_0xd7d2('0x18')](_0x5df645);}};}function respondWithFilteredResult(_0x4f8701,_0x4a6d25){return function(_0x14d029){if(_0x14d029){var _0x29eb39=typeof _0x4a6d25[_0xd7d2('0x19')]===_0xd7d2('0x1a')&&typeof _0x4a6d25['limit']===_0xd7d2('0x1a');var _0x20fb9d=_0x14d029[_0xd7d2('0x1b')];var _0x207161=_0x29eb39?0x0:_0x4a6d25[_0xd7d2('0x19')];var _0x342cac=_0x29eb39?_0x14d029[_0xd7d2('0x1b')]:_0x4a6d25[_0xd7d2('0x19')]+_0x4a6d25[_0xd7d2('0x1c')];var _0xf9786b;if(_0x342cac>=_0x20fb9d){_0x342cac=_0x20fb9d;_0xf9786b=0xc8;}else{_0xf9786b=0xce;}_0x4f8701[_0xd7d2('0x17')](_0xf9786b);return _0x4f8701[_0xd7d2('0x1d')](_0xd7d2('0x1e'),_0x207161+'-'+_0x342cac+'/'+_0x20fb9d)[_0xd7d2('0x18')](_0x14d029);}return null;};}function patchUpdates(_0x41bfce){return function(_0x30b893){try{jsonpatch[_0xd7d2('0x1f')](_0x30b893,_0x41bfce,!![]);}catch(_0x316a9f){return BPromise[_0xd7d2('0x20')](_0x316a9f);}return _0x30b893['save']();};}function saveUpdates(_0xcd699f,_0x2e19d0){return function(_0x348fb5){if(_0x348fb5){return _0x348fb5[_0xd7d2('0x21')](_0xcd699f)[_0xd7d2('0x22')](function(_0x260e79){return _0x260e79;});}return null;};}function removeEntity(_0x4a50e6,_0x415c9b){return function(_0x394724){if(_0x394724){return _0x394724[_0xd7d2('0x23')]()[_0xd7d2('0x22')](function(){var _0x4703d9=_0x394724['get']({'plain':!![]});var _0x1c8b86=_0xd7d2('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1c8b86,'resourceId':_0x4703d9['id']}})[_0xd7d2('0x22')](function(){return _0x394724;});})[_0xd7d2('0x22')](function(){_0x4a50e6[_0xd7d2('0x17')](0xcc)[_0xd7d2('0x16')]();});}};}function handleEntityNotFound(_0x8aa2da,_0x2718af){return function(_0x3dda3e){if(!_0x3dda3e){_0x8aa2da['sendStatus'](0x194);}return _0x3dda3e;};}function handleError(_0x1b4933,_0x16446a){_0x16446a=_0x16446a||0x1f4;return function(_0x429bde){logger[_0xd7d2('0x25')](_0x429bde['stack']);if(_0x429bde[_0xd7d2('0x26')]){delete _0x429bde[_0xd7d2('0x26')];}_0x1b4933['status'](_0x16446a)[_0xd7d2('0x27')](_0x429bde);};}exports[_0xd7d2('0x28')]=function(_0x2c7eee,_0x4df677){var _0x2e828f={},_0x2a0594={},_0x503f0e={'count':0x0,'rows':[]};var _0x32dff5=_[_0xd7d2('0x29')](db[_0xd7d2('0x2a')][_0xd7d2('0x2b')],function(_0x440f63){return{'name':_0x440f63[_0xd7d2('0x2c')],'type':_0x440f63[_0xd7d2('0x2d')][_0xd7d2('0x2e')]};});_0x2a0594[_0xd7d2('0x2f')]=_[_0xd7d2('0x29')](_0x32dff5,'name');_0x2a0594[_0xd7d2('0x30')]=_['keys'](_0x2c7eee[_0xd7d2('0x30')]);_0x2a0594[_0xd7d2('0x31')]=_[_0xd7d2('0x32')](_0x2a0594[_0xd7d2('0x2f')],_0x2a0594[_0xd7d2('0x30')]);_0x2e828f['attributes']=_[_0xd7d2('0x32')](_0x2a0594['model'],qs[_0xd7d2('0x33')](_0x2c7eee[_0xd7d2('0x30')]['fields']));_0x2e828f[_0xd7d2('0x34')]=_0x2e828f[_0xd7d2('0x34')]['length']?_0x2e828f[_0xd7d2('0x34')]:_0x2a0594[_0xd7d2('0x2f')];if(!_0x2c7eee['query'][_0xd7d2('0x35')](_0xd7d2('0x36'))){_0x2e828f[_0xd7d2('0x1c')]=qs['limit'](_0x2c7eee['query'][_0xd7d2('0x1c')]);_0x2e828f[_0xd7d2('0x19')]=qs[_0xd7d2('0x19')](_0x2c7eee[_0xd7d2('0x30')]['offset']);}_0x2e828f[_0xd7d2('0x37')]=qs[_0xd7d2('0x38')](_0x2c7eee['query'][_0xd7d2('0x38')]);_0x2e828f[_0xd7d2('0x39')]=qs['filters'](_[_0xd7d2('0x3a')](_0x2c7eee[_0xd7d2('0x30')],_0x2a0594[_0xd7d2('0x31')]),_0x32dff5);if(_0x2c7eee['query'][_0xd7d2('0x3b')]){_0x2e828f[_0xd7d2('0x39')]=_['merge'](_0x2e828f[_0xd7d2('0x39')],{'$or':[{'key':{'$like':'%'+_0x2c7eee['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2c7eee[_0xd7d2('0x30')][_0xd7d2('0x3b')]+'%'}}]});}_0x2e828f=_[_0xd7d2('0x3c')]({},_0x2e828f,_0x2c7eee[_0xd7d2('0x3d')]);var _0x25cbd3={'where':_0x2e828f[_0xd7d2('0x39')]};return db[_0xd7d2('0x2a')][_0xd7d2('0x1b')](_0x25cbd3)[_0xd7d2('0x22')](function(_0x2fcc23){_0x503f0e[_0xd7d2('0x1b')]=_0x2fcc23;if(_0x2c7eee[_0xd7d2('0x30')][_0xd7d2('0x3e')]){_0x2e828f[_0xd7d2('0x3f')]=[{'all':!![]}];}return db[_0xd7d2('0x2a')][_0xd7d2('0x40')](_0x2e828f);})[_0xd7d2('0x22')](function(_0x259855){_0x503f0e[_0xd7d2('0x41')]=_0x259855;return _0x503f0e;})[_0xd7d2('0x22')](respondWithFilteredResult(_0x4df677,_0x2e828f))[_0xd7d2('0x42')](handleError(_0x4df677,null));};exports[_0xd7d2('0x43')]=function(_0x5adc4b,_0x30f2d5){var _0x5721e6={'raw':!![],'where':{'id':_0x5adc4b['params']['id']}},_0x3115b9={};_0x3115b9['model']=_[_0xd7d2('0x44')](db[_0xd7d2('0x2a')][_0xd7d2('0x2b')]);_0x3115b9[_0xd7d2('0x30')]=_[_0xd7d2('0x44')](_0x5adc4b[_0xd7d2('0x30')]);_0x3115b9[_0xd7d2('0x31')]=_[_0xd7d2('0x32')](_0x3115b9[_0xd7d2('0x2f')],_0x3115b9[_0xd7d2('0x30')]);_0x5721e6[_0xd7d2('0x34')]=_['intersection'](_0x3115b9[_0xd7d2('0x2f')],qs['fields'](_0x5adc4b[_0xd7d2('0x30')][_0xd7d2('0x33')]));_0x5721e6[_0xd7d2('0x34')]=_0x5721e6[_0xd7d2('0x34')]['length']?_0x5721e6['attributes']:_0x3115b9[_0xd7d2('0x2f')];if(_0x5adc4b[_0xd7d2('0x30')]['includeAll']){_0x5721e6[_0xd7d2('0x3f')]=[{'all':!![]}];}_0x5721e6=_[_0xd7d2('0x3c')]({},_0x5721e6,_0x5adc4b[_0xd7d2('0x3d')]);return db['CannedAnswer']['find'](_0x5721e6)[_0xd7d2('0x22')](handleEntityNotFound(_0x30f2d5,null))[_0xd7d2('0x22')](respondWithResult(_0x30f2d5,null))['catch'](handleError(_0x30f2d5,null));};exports['update']=function(_0x31fe3f,_0x3b344c){if(_0x31fe3f['body']['id']){delete _0x31fe3f[_0xd7d2('0x45')]['id'];}return db[_0xd7d2('0x2a')][_0xd7d2('0x46')]({'where':{'id':_0x31fe3f[_0xd7d2('0x47')]['id']}})[_0xd7d2('0x22')](handleEntityNotFound(_0x3b344c,null))[_0xd7d2('0x22')](saveUpdates(_0x31fe3f[_0xd7d2('0x45')],null))['then'](respondWithResult(_0x3b344c,null))[_0xd7d2('0x42')](handleError(_0x3b344c,null));};exports[_0xd7d2('0x23')]=function(_0x57085a,_0x20ecd7){return db[_0xd7d2('0x2a')][_0xd7d2('0x46')]({'where':{'id':_0x57085a['params']['id']}})[_0xd7d2('0x22')](handleEntityNotFound(_0x20ecd7,null))[_0xd7d2('0x22')](removeEntity(_0x20ecd7,null))['catch'](handleError(_0x20ecd7,null));};exports[_0xd7d2('0x48')]=function(_0x400851,_0x4e9693){var _0x35dc01={'key':_0x400851['body'][_0xd7d2('0x2e')]};if(_0x400851[_0xd7d2('0x45')]['MailAccountId']){_0x35dc01['MailAccountId']=_0x400851[_0xd7d2('0x45')]['MailAccountId'];}else if(_0x400851['body']['SmsAccountId']){_0x35dc01[_0xd7d2('0x49')]=_0x400851[_0xd7d2('0x45')][_0xd7d2('0x49')];}else if(_0x400851['body'][_0xd7d2('0x4a')]){_0x35dc01[_0xd7d2('0x4a')]=_0x400851['body'][_0xd7d2('0x4a')];}else if(_0x400851['body']['ChatWebsiteId']){_0x35dc01[_0xd7d2('0x4b')]=_0x400851[_0xd7d2('0x45')][_0xd7d2('0x4b')];}return db[_0xd7d2('0x2a')]['find']({'where':_0x35dc01})[_0xd7d2('0x22')](function(_0x4bbc09){if(_0x4bbc09){throw new db[(_0xd7d2('0x4c'))][(_0xd7d2('0x4d'))](_0xd7d2('0x4e'));}return db[_0xd7d2('0x2a')][_0xd7d2('0x48')](_0x400851[_0xd7d2('0x45')]);})['then'](function(_0x57c42a){var _0x5aad93=_0x400851['user']['get']({'plain':!![]});if(!_0x5aad93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5aad93['role']===_0xd7d2('0x4f')){var _0x15e954=_0x57c42a['get']({'plain':!![]});return db[_0xd7d2('0x50')]['find']({'where':{'name':_0xd7d2('0x24'),'userProfileId':_0x5aad93['userProfileId']},'raw':!![]})[_0xd7d2('0x22')](function(_0x2ee5ce){if(_0x2ee5ce&&_0x2ee5ce[_0xd7d2('0x51')]===0x0){return db[_0xd7d2('0x52')][_0xd7d2('0x48')]({'name':_0x15e954[_0xd7d2('0x26')],'resourceId':_0x15e954['id'],'type':_0x2ee5ce[_0xd7d2('0x26')],'sectionId':_0x2ee5ce['id']},{})[_0xd7d2('0x22')](function(){return _0x57c42a;});}else{return _0x57c42a;}})[_0xd7d2('0x42')](function(_0x562d15){logger[_0xd7d2('0x25')](_0xd7d2('0x53'),_0x562d15);throw _0x562d15;});}return _0x57c42a;})['then'](respondWithResult(_0x4e9693,0xc9))[_0xd7d2('0x42')](handleError(_0x4e9693,null));};
\ No newline at end of file
+var _0xcff4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','catch','show','params','length','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x44f45c,_0x47c0d9){var _0x48de2c=function(_0x3a6045){while(--_0x3a6045){_0x44f45c['push'](_0x44f45c['shift']());}};_0x48de2c(++_0x47c0d9);}(_0xcff4,0x9c));var _0x4cff=function(_0xabbb9b,_0x1417cc){_0xabbb9b=_0xabbb9b-0x0;var _0x306a4e=_0xcff4[_0xabbb9b];return _0x306a4e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4cff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4cff('0x1'));var rp=require('request-promise');var moment=require(_0x4cff('0x2'));var BPromise=require(_0x4cff('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4cff('0x4'));var sox=require(_0x4cff('0x5'));var csv=require(_0x4cff('0x6'));var ejs=require(_0x4cff('0x7'));var fs=require('fs');var fs_extra=require(_0x4cff('0x8'));var _=require('lodash');var squel=require(_0x4cff('0x9'));var crypto=require(_0x4cff('0xa'));var jsforce=require(_0x4cff('0xb'));var deskjs=require(_0x4cff('0xc'));var toCsv=require(_0x4cff('0x6'));var querystring=require(_0x4cff('0xd'));var Papa=require(_0x4cff('0xe'));var Redis=require('ioredis');var authService=require(_0x4cff('0xf'));var qs=require(_0x4cff('0x10'));var as=require(_0x4cff('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4cff('0x12'))('api');var utils=require(_0x4cff('0x13'));var config=require(_0x4cff('0x14'));var licenseUtil=require(_0x4cff('0x15'));var db=require(_0x4cff('0x16'))['db'];function respondWithStatusCode(_0xbea3c1,_0x56c70c){_0x56c70c=_0x56c70c||0xcc;return function(_0x13304a){if(_0x13304a){return _0xbea3c1['sendStatus'](_0x56c70c);}return _0xbea3c1[_0x4cff('0x17')](_0x56c70c)[_0x4cff('0x18')]();};}function respondWithResult(_0x47dd6a,_0x4fa008){_0x4fa008=_0x4fa008||0xc8;return function(_0xf25e8a){if(_0xf25e8a){return _0x47dd6a[_0x4cff('0x17')](_0x4fa008)[_0x4cff('0x19')](_0xf25e8a);}};}function respondWithFilteredResult(_0x5bab79,_0x2aaab4){return function(_0x1f861c){if(_0x1f861c){var _0x583fd6=typeof _0x2aaab4[_0x4cff('0x1a')]===_0x4cff('0x1b')&&typeof _0x2aaab4[_0x4cff('0x1c')]===_0x4cff('0x1b');var _0x5632df=_0x1f861c['count'];var _0x4bdeaf=_0x583fd6?0x0:_0x2aaab4[_0x4cff('0x1a')];var _0x23c8b1=_0x583fd6?_0x1f861c['count']:_0x2aaab4['offset']+_0x2aaab4[_0x4cff('0x1c')];var _0x345fd5;if(_0x23c8b1>=_0x5632df){_0x23c8b1=_0x5632df;_0x345fd5=0xc8;}else{_0x345fd5=0xce;}_0x5bab79[_0x4cff('0x17')](_0x345fd5);return _0x5bab79['set']('Content-Range',_0x4bdeaf+'-'+_0x23c8b1+'/'+_0x5632df)[_0x4cff('0x19')](_0x1f861c);}return null;};}function patchUpdates(_0x5b1cca){return function(_0x51a2da){try{jsonpatch[_0x4cff('0x1d')](_0x51a2da,_0x5b1cca,!![]);}catch(_0x14c941){return BPromise[_0x4cff('0x1e')](_0x14c941);}return _0x51a2da['save']();};}function saveUpdates(_0x5dad64,_0x4a6a72){return function(_0xf9098e){if(_0xf9098e){return _0xf9098e[_0x4cff('0x1f')](_0x5dad64)[_0x4cff('0x20')](function(_0x2a587a){return _0x2a587a;});}return null;};}function removeEntity(_0x47bdb8,_0x41a439){return function(_0x241761){if(_0x241761){return _0x241761[_0x4cff('0x21')]()['then'](function(){var _0x1a0080=_0x241761['get']({'plain':!![]});var _0x214d71='CannedAnswers';return db['UserProfileResource'][_0x4cff('0x21')]({'where':{'type':_0x214d71,'resourceId':_0x1a0080['id']}})[_0x4cff('0x20')](function(){return _0x241761;});})[_0x4cff('0x20')](function(){_0x47bdb8[_0x4cff('0x17')](0xcc)[_0x4cff('0x18')]();});}};}function handleEntityNotFound(_0x110d81,_0x1f1248){return function(_0x2f0eef){if(!_0x2f0eef){_0x110d81[_0x4cff('0x22')](0x194);}return _0x2f0eef;};}function handleError(_0x1e941f,_0x1f1e10){_0x1f1e10=_0x1f1e10||0x1f4;return function(_0x19a34e){logger[_0x4cff('0x23')](_0x19a34e[_0x4cff('0x24')]);if(_0x19a34e[_0x4cff('0x25')]){delete _0x19a34e[_0x4cff('0x25')];}_0x1e941f['status'](_0x1f1e10)[_0x4cff('0x26')](_0x19a34e);};}exports[_0x4cff('0x27')]=function(_0x46cbcb,_0x5c5a02){var _0x303790={},_0x24206c={},_0x1ef498={'count':0x0,'rows':[]};var _0x10cc98=_[_0x4cff('0x28')](db[_0x4cff('0x29')][_0x4cff('0x2a')],function(_0x475b78){return{'name':_0x475b78[_0x4cff('0x2b')],'type':_0x475b78['type'][_0x4cff('0x2c')]};});_0x24206c['model']=_[_0x4cff('0x28')](_0x10cc98,_0x4cff('0x25'));_0x24206c['query']=_[_0x4cff('0x2d')](_0x46cbcb[_0x4cff('0x2e')]);_0x24206c[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x24206c[_0x4cff('0x31')],_0x24206c[_0x4cff('0x2e')]);_0x303790[_0x4cff('0x32')]=_['intersection'](_0x24206c[_0x4cff('0x31')],qs[_0x4cff('0x33')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x303790[_0x4cff('0x32')]=_0x303790[_0x4cff('0x32')]['length']?_0x303790[_0x4cff('0x32')]:_0x24206c[_0x4cff('0x31')];if(!_0x46cbcb['query'][_0x4cff('0x34')]('nolimit')){_0x303790['limit']=qs[_0x4cff('0x1c')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x1c')]);_0x303790[_0x4cff('0x1a')]=qs[_0x4cff('0x1a')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x1a')]);}_0x303790[_0x4cff('0x35')]=qs[_0x4cff('0x36')](_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x36')]);_0x303790[_0x4cff('0x37')]=qs[_0x4cff('0x2f')](_[_0x4cff('0x38')](_0x46cbcb[_0x4cff('0x2e')],_0x24206c['filters']),_0x10cc98);if(_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x39')]){_0x303790[_0x4cff('0x37')]=_[_0x4cff('0x3a')](_0x303790[_0x4cff('0x37')],{'$or':[{'key':{'$like':'%'+_0x46cbcb['query'][_0x4cff('0x39')]+'%'}},{'value':{'$like':'%'+_0x46cbcb[_0x4cff('0x2e')]['filter']+'%'}}]});}_0x303790=_[_0x4cff('0x3a')]({},_0x303790,_0x46cbcb[_0x4cff('0x3b')]);var _0x202035={'where':_0x303790[_0x4cff('0x37')]};return db[_0x4cff('0x29')][_0x4cff('0x3c')](_0x202035)[_0x4cff('0x20')](function(_0x909bb8){_0x1ef498[_0x4cff('0x3c')]=_0x909bb8;if(_0x46cbcb[_0x4cff('0x2e')][_0x4cff('0x3d')]){_0x303790[_0x4cff('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4cff('0x3f')](_0x303790);})[_0x4cff('0x20')](function(_0x4990ea){_0x1ef498['rows']=_0x4990ea;return _0x1ef498;})[_0x4cff('0x20')](respondWithFilteredResult(_0x5c5a02,_0x303790))[_0x4cff('0x40')](handleError(_0x5c5a02,null));};exports[_0x4cff('0x41')]=function(_0x300d2f,_0x47cc22){var _0x21548e={'raw':!![],'where':{'id':_0x300d2f[_0x4cff('0x42')]['id']}},_0x494b9f={};_0x494b9f[_0x4cff('0x31')]=_[_0x4cff('0x2d')](db[_0x4cff('0x29')][_0x4cff('0x2a')]);_0x494b9f['query']=_[_0x4cff('0x2d')](_0x300d2f[_0x4cff('0x2e')]);_0x494b9f[_0x4cff('0x2f')]=_[_0x4cff('0x30')](_0x494b9f[_0x4cff('0x31')],_0x494b9f[_0x4cff('0x2e')]);_0x21548e[_0x4cff('0x32')]=_[_0x4cff('0x30')](_0x494b9f['model'],qs[_0x4cff('0x33')](_0x300d2f[_0x4cff('0x2e')][_0x4cff('0x33')]));_0x21548e[_0x4cff('0x32')]=_0x21548e[_0x4cff('0x32')][_0x4cff('0x43')]?_0x21548e[_0x4cff('0x32')]:_0x494b9f[_0x4cff('0x31')];if(_0x300d2f[_0x4cff('0x2e')][_0x4cff('0x3d')]){_0x21548e[_0x4cff('0x3e')]=[{'all':!![]}];}_0x21548e=_[_0x4cff('0x3a')]({},_0x21548e,_0x300d2f[_0x4cff('0x3b')]);return db[_0x4cff('0x29')][_0x4cff('0x44')](_0x21548e)[_0x4cff('0x20')](handleEntityNotFound(_0x47cc22,null))[_0x4cff('0x20')](respondWithResult(_0x47cc22,null))[_0x4cff('0x40')](handleError(_0x47cc22,null));};exports[_0x4cff('0x1f')]=function(_0x51b6f9,_0x46e6a4){if(_0x51b6f9[_0x4cff('0x45')]['id']){delete _0x51b6f9['body']['id'];}return db[_0x4cff('0x29')][_0x4cff('0x44')]({'where':{'id':_0x51b6f9[_0x4cff('0x42')]['id']}})[_0x4cff('0x20')](handleEntityNotFound(_0x46e6a4,null))[_0x4cff('0x20')](saveUpdates(_0x51b6f9[_0x4cff('0x45')],null))[_0x4cff('0x20')](respondWithResult(_0x46e6a4,null))[_0x4cff('0x40')](handleError(_0x46e6a4,null));};exports[_0x4cff('0x21')]=function(_0x2693e8,_0x2c8506){return db['CannedAnswer'][_0x4cff('0x44')]({'where':{'id':_0x2693e8[_0x4cff('0x42')]['id']}})['then'](handleEntityNotFound(_0x2c8506,null))[_0x4cff('0x20')](removeEntity(_0x2c8506,null))['catch'](handleError(_0x2c8506,null));};exports['create']=function(_0x10209f,_0x465bb2){var _0x17731b={'key':_0x10209f[_0x4cff('0x45')][_0x4cff('0x2c')]};if(_0x10209f[_0x4cff('0x45')]['MailAccountId']){_0x17731b[_0x4cff('0x46')]=_0x10209f[_0x4cff('0x45')][_0x4cff('0x46')];}else if(_0x10209f[_0x4cff('0x45')][_0x4cff('0x47')]){_0x17731b[_0x4cff('0x47')]=_0x10209f['body'][_0x4cff('0x47')];}else if(_0x10209f[_0x4cff('0x45')][_0x4cff('0x48')]){_0x17731b[_0x4cff('0x48')]=_0x10209f['body']['OpenchannelAccountId'];}else if(_0x10209f['body'][_0x4cff('0x49')]){_0x17731b['ChatWebsiteId']=_0x10209f[_0x4cff('0x45')]['ChatWebsiteId'];}return db['CannedAnswer']['find']({'where':_0x17731b})[_0x4cff('0x20')](function(_0x29ffbc){if(_0x29ffbc){throw new db[(_0x4cff('0x4a'))][(_0x4cff('0x4b'))](_0x4cff('0x4c'));}return db['CannedAnswer'][_0x4cff('0x4d')](_0x10209f[_0x4cff('0x45')]);})[_0x4cff('0x20')](function(_0x14cd6a){var _0x55e946=_0x10209f[_0x4cff('0x4e')][_0x4cff('0x4f')]({'plain':!![]});if(!_0x55e946)throw new Error(_0x4cff('0x50'));if(_0x55e946[_0x4cff('0x51')]===_0x4cff('0x4e')){var _0x5ad994=_0x14cd6a[_0x4cff('0x4f')]({'plain':!![]});return db[_0x4cff('0x52')]['find']({'where':{'name':_0x4cff('0x53'),'userProfileId':_0x55e946[_0x4cff('0x54')]},'raw':!![]})[_0x4cff('0x20')](function(_0x5a06da){if(_0x5a06da&&_0x5a06da['autoAssociation']===0x0){return db['UserProfileResource'][_0x4cff('0x4d')]({'name':_0x5ad994[_0x4cff('0x25')],'resourceId':_0x5ad994['id'],'type':_0x5a06da['name'],'sectionId':_0x5a06da['id']},{})['then'](function(){return _0x14cd6a;});}else{return _0x14cd6a;}})['catch'](function(_0x3ab95c){logger[_0x4cff('0x23')](_0x4cff('0x55'),_0x3ab95c);throw _0x3ab95c;});}return _0x14cd6a;})[_0x4cff('0x20')](respondWithResult(_0x465bb2,0xc9))[_0x4cff('0x40')](handleError(_0x465bb2,null));};
\ No newline at end of file
index 94e13ed..8d6b1d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers'];(function(_0x3bf56d,_0xa0b1f1){var _0x518c54=function(_0x4ec245){while(--_0x4ec245){_0x3bf56d['push'](_0x3bf56d['shift']());}};_0x518c54(++_0xa0b1f1);}(_0x3fc3,0x110));var _0x33fc=function(_0x1c65ab,_0x31bd2f){_0x1c65ab=_0x1c65ab-0x0;var _0x2eaafb=_0x3fc3[_0x1c65ab];return _0x2eaafb;};'use strict';var _=require(_0x33fc('0x0'));var util=require(_0x33fc('0x1'));var logger=require(_0x33fc('0x2'))(_0x33fc('0x3'));var moment=require(_0x33fc('0x4'));var BPromise=require(_0x33fc('0x5'));var rp=require(_0x33fc('0x6'));var fs=require('fs');var path=require(_0x33fc('0x7'));var rimraf=require(_0x33fc('0x8'));var config=require(_0x33fc('0x9'));var attributes=require('./cannedAnswer.attributes');module[_0x33fc('0xa')]=function(_0x491a41,_0x5a4627){return _0x491a41['define'](_0x33fc('0xb'),attributes,{'tableName':_0x33fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33fc('0xd'),'collate':_0x33fc('0xe')});};
\ No newline at end of file
+var _0x10be=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers'];(function(_0x5b7b22,_0x5bc479){var _0x53dc9d=function(_0x5108c0){while(--_0x5108c0){_0x5b7b22['push'](_0x5b7b22['shift']());}};_0x53dc9d(++_0x5bc479);}(_0x10be,0x161));var _0xe10b=function(_0x5103a4,_0x4b7f5c){_0x5103a4=_0x5103a4-0x0;var _0x4f99e0=_0x10be[_0x5103a4];return _0x4f99e0;};'use strict';var _=require(_0xe10b('0x0'));var util=require('util');var logger=require(_0xe10b('0x1'))(_0xe10b('0x2'));var moment=require('moment');var BPromise=require(_0xe10b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe10b('0x4'));var rimraf=require(_0xe10b('0x5'));var config=require(_0xe10b('0x6'));var attributes=require(_0xe10b('0x7'));module['exports']=function(_0x241fd7,_0x25bda5){return _0x241fd7[_0xe10b('0x8')](_0xe10b('0x9'),attributes,{'tableName':_0xe10b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe10b('0xb'),'collate':_0xe10b('0xc')});};
\ No newline at end of file
index 63c784b..40bb775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4adbd8,_0x655861){var _0x22b303=function(_0x22af66){while(--_0x22af66){_0x4adbd8['push'](_0x4adbd8['shift']());}};_0x22b303(++_0x655861);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x465122,_0x107808){var _0x1fd7ee=function(_0xc762a3){while(--_0xc762a3){_0x465122['push'](_0x465122['shift']());}};_0x1fd7ee(++_0x107808);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 6c958ac..9426695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x420c=['index','isAuthenticated','show','create','/:id','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x1fff7d,_0xe8b9a){var _0x2996e0=function(_0x223f54){while(--_0x223f54){_0x1fff7d['push'](_0x1fff7d['shift']());}};_0x2996e0(++_0xe8b9a);}(_0x420c,0xd7));var _0xc420=function(_0xc5837d,_0x27cda1){_0xc5837d=_0xc5837d-0x0;var _0x59ccd4=_0x420c[_0xc5837d];return _0x59ccd4;};'use strict';var multer=require('multer');var util=require(_0xc420('0x0'));var path=require(_0xc420('0x1'));var timeout=require(_0xc420('0x2'));var express=require('express');var router=express[_0xc420('0x3')]();var fs_extra=require(_0xc420('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc420('0x5'));var config=require(_0xc420('0x6'));var controller=require(_0xc420('0x7'));router[_0xc420('0x8')]('/',auth['isAuthenticated'](),controller[_0xc420('0x9')]);router[_0xc420('0x8')]('/:id',auth[_0xc420('0xa')](),controller[_0xc420('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc420('0xc')]);router['put'](_0xc420('0xd'),auth[_0xc420('0xa')](),controller[_0xc420('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc420('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x0f08=['../../components/interaction/service','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x0f08,0x1ea));var _0x80f0=function(_0x308213,_0x224541){_0x308213=_0x308213-0x0;var _0x2e1619=_0x0f08[_0x308213];return _0x2e1619;};'use strict';var multer=require(_0x80f0('0x0'));var util=require(_0x80f0('0x1'));var path=require('path');var timeout=require(_0x80f0('0x2'));var express=require(_0x80f0('0x3'));var router=express[_0x80f0('0x4')]();var fs_extra=require(_0x80f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80f0('0x6'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x80f0('0x7')](),controller[_0x80f0('0x8')]);router['get'](_0x80f0('0x9'),auth['isAuthenticated'](),controller[_0x80f0('0xa')]);router[_0x80f0('0xb')]('/',auth[_0x80f0('0x7')](),controller[_0x80f0('0xc')]);router[_0x80f0('0xd')](_0x80f0('0x9'),auth[_0x80f0('0x7')](),controller['update']);router['delete'](_0x80f0('0x9'),auth['isAuthenticated'](),controller[_0x80f0('0xe')]);module[_0x80f0('0xf')]=router;
\ No newline at end of file
index c70a624..74c934d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x2a85f2,_0x458881){var _0x86e5a9=function(_0x44eb18){while(--_0x44eb18){_0x2a85f2['push'](_0x2a85f2['shift']());}};_0x86e5a9(++_0x458881);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0xe5b5[_0x3e7e96];return _0x13f6f0;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'calldate':{'type':Sequelize[_0x5e5b('0x2')],'allowNull':![],'defaultValue':_0x5e5b('0x3')},'clid':{'type':Sequelize[_0x5e5b('0x4')]},'src':{'type':Sequelize[_0x5e5b('0x4')]},'dst':{'type':Sequelize[_0x5e5b('0x4')]},'dcontext':{'type':Sequelize[_0x5e5b('0x4')]},'channel':{'type':Sequelize[_0x5e5b('0x4')]},'dstchannel':{'type':Sequelize[_0x5e5b('0x4')]},'lastapp':{'type':Sequelize[_0x5e5b('0x4')]},'lastdata':{'type':Sequelize[_0x5e5b('0x4')]},'duration':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5e5b('0x4')]},'amaflags':{'type':Sequelize[_0x5e5b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5e5b('0x4')]},'userfield':{'type':Sequelize[_0x5e5b('0x4')]},'uniqueid':{'type':Sequelize[_0x5e5b('0x4')]},'linkedid':{'type':Sequelize[_0x5e5b('0x4')]},'sequence':{'type':Sequelize[_0x5e5b('0x4')]},'peeraccount':{'type':Sequelize[_0x5e5b('0x4')]},'type':{'type':Sequelize[_0x5e5b('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb700=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb700,0x1d3));var _0x0b70=function(_0x3be2e2,_0x5c166d){_0x3be2e2=_0x3be2e2-0x0;var _0x53b9c5=_0xb700[_0x3be2e2];return _0x53b9c5;};'use strict';var Sequelize=require(_0x0b70('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x0b70('0x1')],'allowNull':![],'defaultValue':_0x0b70('0x2')},'clid':{'type':Sequelize[_0x0b70('0x3')]},'src':{'type':Sequelize[_0x0b70('0x3')]},'dst':{'type':Sequelize[_0x0b70('0x3')]},'dcontext':{'type':Sequelize[_0x0b70('0x3')]},'channel':{'type':Sequelize[_0x0b70('0x3')]},'dstchannel':{'type':Sequelize[_0x0b70('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0b70('0x3')]},'amaflags':{'type':Sequelize[_0x0b70('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0b70('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0b70('0x3')]},'linkedid':{'type':Sequelize[_0x0b70('0x3')]},'sequence':{'type':Sequelize[_0x0b70('0x3')]},'peeraccount':{'type':Sequelize[_0x0b70('0x3')]},'type':{'type':Sequelize[_0x0b70('0x3')]},'tag':{'type':Sequelize[_0x0b70('0x3')]}};
\ No newline at end of file
index 37736bc..163d4cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4873=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','rawAttributes','type','key','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','Cdr','catch','show','model','fields','includeAll','find','create','body','destroy','params','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x4873,0x1df));var _0x3487=function(_0xef2e27,_0x5ce104){_0xef2e27=_0xef2e27-0x0;var _0x1afb9b=_0x4873[_0xef2e27];return _0x1afb9b;};'use strict';var emlformat=require(_0x3487('0x0'));var rimraf=require(_0x3487('0x1'));var zipdir=require(_0x3487('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3487('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3487('0x4'));var util=require(_0x3487('0x5'));var path=require(_0x3487('0x6'));var sox=require(_0x3487('0x7'));var csv=require(_0x3487('0x8'));var ejs=require(_0x3487('0x9'));var fs=require('fs');var fs_extra=require(_0x3487('0xa'));var _=require(_0x3487('0xb'));var squel=require('squel');var crypto=require(_0x3487('0xc'));var jsforce=require(_0x3487('0xd'));var deskjs=require(_0x3487('0xe'));var toCsv=require(_0x3487('0x8'));var querystring=require(_0x3487('0xf'));var Papa=require('papaparse');var Redis=require(_0x3487('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3487('0x11'));var as=require(_0x3487('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3487('0x13'));var utils=require(_0x3487('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3487('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x557d64,_0x395774){_0x395774=_0x395774||0xcc;return function(_0x1be2e0){if(_0x1be2e0){return _0x557d64[_0x3487('0x16')](_0x395774);}return _0x557d64[_0x3487('0x17')](_0x395774)[_0x3487('0x18')]();};}function respondWithResult(_0x1e468b,_0x4fbd63){_0x4fbd63=_0x4fbd63||0xc8;return function(_0x23ce3b){if(_0x23ce3b){return _0x1e468b[_0x3487('0x17')](_0x4fbd63)[_0x3487('0x19')](_0x23ce3b);}};}function respondWithFilteredResult(_0x4f79f0,_0x156e80){return function(_0x1b19c4){if(_0x1b19c4){var _0x38c0c1=typeof _0x156e80[_0x3487('0x1a')]===_0x3487('0x1b')&&typeof _0x156e80[_0x3487('0x1c')]===_0x3487('0x1b');var _0x32ecde=_0x1b19c4[_0x3487('0x1d')];var _0x2fa630=_0x38c0c1?0x0:_0x156e80[_0x3487('0x1a')];var _0x41795b=_0x38c0c1?_0x1b19c4[_0x3487('0x1d')]:_0x156e80[_0x3487('0x1a')]+_0x156e80['limit'];var _0x320349;if(_0x41795b>=_0x32ecde){_0x41795b=_0x32ecde;_0x320349=0xc8;}else{_0x320349=0xce;}_0x4f79f0['status'](_0x320349);return _0x4f79f0[_0x3487('0x1e')](_0x3487('0x1f'),_0x2fa630+'-'+_0x41795b+'/'+_0x32ecde)[_0x3487('0x19')](_0x1b19c4);}return null;};}function patchUpdates(_0x29546f){return function(_0xd788f8){try{jsonpatch[_0x3487('0x20')](_0xd788f8,_0x29546f,!![]);}catch(_0x479354){return BPromise[_0x3487('0x21')](_0x479354);}return _0xd788f8[_0x3487('0x22')]();};}function saveUpdates(_0x28f8f7,_0x97013d){return function(_0x11437c){if(_0x11437c){return _0x11437c[_0x3487('0x23')](_0x28f8f7)['then'](function(_0x384792){return _0x384792;});}return null;};}function removeEntity(_0x3e63e8,_0x25ed9f){return function(_0x482551){if(_0x482551){return _0x482551['destroy']()[_0x3487('0x24')](function(){_0x3e63e8[_0x3487('0x17')](0xcc)[_0x3487('0x18')]();});}};}function handleEntityNotFound(_0x3a9d76,_0x4c6882){return function(_0x79a183){if(!_0x79a183){_0x3a9d76[_0x3487('0x16')](0x194);}return _0x79a183;};}function handleError(_0x5484f6,_0x1e7126){_0x1e7126=_0x1e7126||0x1f4;return function(_0x3fb245){logger['error'](_0x3fb245['stack']);if(_0x3fb245[_0x3487('0x25')]){delete _0x3fb245[_0x3487('0x25')];}_0x5484f6[_0x3487('0x17')](_0x1e7126)[_0x3487('0x26')](_0x3fb245);};}exports[_0x3487('0x27')]=function(_0x1a02d6,_0x1c5bd6){var _0x38af4a={},_0x25e123={},_0x4dada9={'count':0x0,'rows':[]};var _0x24532a=_['map'](db['Cdr'][_0x3487('0x28')],function(_0x56ee54){return{'name':_0x56ee54['fieldName'],'type':_0x56ee54[_0x3487('0x29')][_0x3487('0x2a')]};});_0x25e123['model']=_['map'](_0x24532a,_0x3487('0x25'));_0x25e123[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x1a02d6['query']);_0x25e123[_0x3487('0x2d')]=_['intersection'](_0x25e123['model'],_0x25e123['query']);_0x38af4a[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x25e123['model'],qs['fields'](_0x1a02d6[_0x3487('0x2b')]['fields']));_0x38af4a['attributes']=_0x38af4a[_0x3487('0x2e')][_0x3487('0x30')]?_0x38af4a[_0x3487('0x2e')]:_0x25e123['model'];if(!_0x1a02d6[_0x3487('0x2b')][_0x3487('0x31')](_0x3487('0x32'))){_0x38af4a[_0x3487('0x1c')]=qs['limit'](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1c')]);_0x38af4a['offset']=qs[_0x3487('0x1a')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x1a')]);}_0x38af4a[_0x3487('0x33')]=qs[_0x3487('0x34')](_0x1a02d6[_0x3487('0x2b')][_0x3487('0x34')]);_0x38af4a[_0x3487('0x35')]=qs[_0x3487('0x2d')](_['pick'](_0x1a02d6[_0x3487('0x2b')],_0x25e123[_0x3487('0x2d')]),_0x24532a);if(_0x1a02d6['query']['filter']){_0x38af4a[_0x3487('0x35')]=_[_0x3487('0x36')](_0x38af4a[_0x3487('0x35')],{'$or':_['map'](_0x24532a,function(_0x58006c){if(_0x58006c['type']!==_0x3487('0x37')){var _0x268674={};_0x268674[_0x58006c['name']]={'$like':'%'+_0x1a02d6[_0x3487('0x2b')][_0x3487('0x38')]+'%'};return _0x268674;}})});}_0x38af4a=_[_0x3487('0x36')]({},_0x38af4a,_0x1a02d6[_0x3487('0x39')]);var _0x106393={'where':_0x38af4a[_0x3487('0x35')]};return db[_0x3487('0x3a')][_0x3487('0x1d')](_0x106393)[_0x3487('0x24')](function(_0x565cb2){_0x4dada9[_0x3487('0x1d')]=_0x565cb2;if(_0x1a02d6[_0x3487('0x2b')]['includeAll']){_0x38af4a['include']=[{'all':!![]}];}return db[_0x3487('0x3a')]['findAll'](_0x38af4a);})['then'](function(_0x3eb68c){_0x4dada9['rows']=_0x3eb68c;return _0x4dada9;})['then'](respondWithFilteredResult(_0x1c5bd6,_0x38af4a))[_0x3487('0x3b')](handleError(_0x1c5bd6,null));};exports[_0x3487('0x3c')]=function(_0x58a4c8,_0x51b69c){var _0xc04317={'raw':!![],'where':{'id':_0x58a4c8['params']['id']}},_0x8cd06f={};_0x8cd06f[_0x3487('0x3d')]=_[_0x3487('0x2c')](db['Cdr'][_0x3487('0x28')]);_0x8cd06f[_0x3487('0x2b')]=_[_0x3487('0x2c')](_0x58a4c8['query']);_0x8cd06f[_0x3487('0x2d')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],_0x8cd06f[_0x3487('0x2b')]);_0xc04317[_0x3487('0x2e')]=_[_0x3487('0x2f')](_0x8cd06f[_0x3487('0x3d')],qs[_0x3487('0x3e')](_0x58a4c8['query'][_0x3487('0x3e')]));_0xc04317[_0x3487('0x2e')]=_0xc04317[_0x3487('0x2e')][_0x3487('0x30')]?_0xc04317[_0x3487('0x2e')]:_0x8cd06f[_0x3487('0x3d')];if(_0x58a4c8[_0x3487('0x2b')][_0x3487('0x3f')]){_0xc04317['include']=[{'all':!![]}];}_0xc04317=_['merge']({},_0xc04317,_0x58a4c8[_0x3487('0x39')]);return db[_0x3487('0x3a')][_0x3487('0x40')](_0xc04317)[_0x3487('0x24')](handleEntityNotFound(_0x51b69c,null))['then'](respondWithResult(_0x51b69c,null))['catch'](handleError(_0x51b69c,null));};exports[_0x3487('0x41')]=function(_0x122456,_0x3fe91f){return db[_0x3487('0x3a')][_0x3487('0x41')](_0x122456[_0x3487('0x42')],{})[_0x3487('0x24')](respondWithResult(_0x3fe91f,0xc9))[_0x3487('0x3b')](handleError(_0x3fe91f,null));};exports['update']=function(_0x585a44,_0x320351){if(_0x585a44[_0x3487('0x42')]['id']){delete _0x585a44['body']['id'];}return db[_0x3487('0x3a')]['find']({'where':{'id':_0x585a44['params']['id']}})[_0x3487('0x24')](handleEntityNotFound(_0x320351,null))[_0x3487('0x24')](saveUpdates(_0x585a44['body'],null))[_0x3487('0x24')](respondWithResult(_0x320351,null))[_0x3487('0x3b')](handleError(_0x320351,null));};exports[_0x3487('0x43')]=function(_0x4ab5f8,_0x761f95){return db[_0x3487('0x3a')][_0x3487('0x40')]({'where':{'id':_0x4ab5f8[_0x3487('0x44')]['id']}})['then'](handleEntityNotFound(_0x761f95,null))[_0x3487('0x24')](removeEntity(_0x761f95,null))[_0x3487('0x3b')](handleError(_0x761f95,null));};exports[_0x3487('0x45')]=function(_0x33e826,_0x11125d){return db[_0x3487('0x3a')][_0x3487('0x45')]()['then'](respondWithResult(_0x11125d,null))[_0x3487('0x3b')](handleError(_0x11125d,null));};
\ No newline at end of file
+var _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x473367,_0x8e5486){_0x473367=_0x473367-0x0;var _0x105e69=_0x6b8f[_0x473367];return _0x105e69;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));};
\ No newline at end of file
index 69c3508..89f8057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3e704c,_0x4b1eb4){var _0x41c075=function(_0x5f2140){while(--_0x5f2140){_0x3e704c['push'](_0x3e704c['shift']());}};_0x41c075(++_0x4b1eb4);}(_0x7a54,0x106));var _0x47a5=function(_0x3b062a,_0x5b324b){_0x3b062a=_0x3b062a-0x0;var _0x31c9d2=_0x7a54[_0x3b062a];return _0x31c9d2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x129924,_0x4ebbe7){var _0x3cf3b3=function(_0xa5362f){while(--_0xa5362f){_0x129924['push'](_0x129924['shift']());}};_0x3cf3b3(++_0x4ebbe7);}(_0x7a54,0x106));var _0x47a5=function(_0x346173,_0x113cb9){_0x346173=_0x346173-0x0;var _0x1a1e40=_0x7a54[_0x346173];return _0x1a1e40;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 1b9554b..e51b685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd8e=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x40b3de,_0x327d8b){var _0x269f49=function(_0x56d430){while(--_0x56d430){_0x40b3de['push'](_0x40b3de['shift']());}};_0x269f49(++_0x327d8b);}(_0xfd8e,0x127));var _0xefd8=function(_0x46e6e3,_0x59e170){_0x46e6e3=_0x46e6e3-0x0;var _0x348f17=_0xfd8e[_0x46e6e3];return _0x348f17;};'use strict';var _=require(_0xefd8('0x0'));var util=require(_0xefd8('0x1'));var moment=require('moment');var BPromise=require(_0xefd8('0x2'));var rs=require(_0xefd8('0x3'));var fs=require('fs');var Redis=require(_0xefd8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xefd8('0x5'))(_0xefd8('0x6'));var config=require('../../config/environment');var jayson=require(_0xefd8('0x7'));var client=jayson[_0xefd8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x461d6f,_0x2a57e3,_0x1fc457){return new BPromise(function(_0x407312,_0x656657){return client[_0xefd8('0x9')](_0x461d6f,_0x1fc457)[_0xefd8('0xa')](function(_0x1a85b0){logger[_0xefd8('0xb')](_0xefd8('0xc'),_0x2a57e3,_0xefd8('0xd'));logger['debug'](_0xefd8('0xe'),_0x2a57e3,_0xefd8('0xd'),JSON[_0xefd8('0xf')](_0x1a85b0));if(_0x1a85b0[_0xefd8('0x10')]){if(_0x1a85b0[_0xefd8('0x10')]['code']===0x1f4){logger[_0xefd8('0x10')](_0xefd8('0xc'),_0x2a57e3,_0x1a85b0['error'][_0xefd8('0x11')]);return _0x656657(_0x1a85b0[_0xefd8('0x10')]['message']);}logger['error'](_0xefd8('0xc'),_0x2a57e3,_0x1a85b0[_0xefd8('0x10')]['message']);return _0x407312(_0x1a85b0[_0xefd8('0x10')][_0xefd8('0x11')]);}else{logger[_0xefd8('0xb')](_0xefd8('0xc'),_0x2a57e3,_0xefd8('0xd'));_0x407312(_0x1a85b0['result'][_0xefd8('0x11')]);}})[_0xefd8('0x12')](function(_0x530042){logger[_0xefd8('0x10')](_0xefd8('0xc'),_0x2a57e3,_0x530042);_0x656657(_0x530042);});});}
\ No newline at end of file
+var _0x130c=['stringify','error','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x4b9d96,_0x515ffd){var _0x165387=function(_0x244f86){while(--_0x244f86){_0x4b9d96['push'](_0x4b9d96['shift']());}};_0x165387(++_0x515ffd);}(_0x130c,0x180));var _0xc130=function(_0xeb5495,_0x3373c8){_0xeb5495=_0xeb5495-0x0;var _0x5e17e0=_0x130c[_0xeb5495];return _0x5e17e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc130('0x0'));var BPromise=require(_0xc130('0x1'));var rs=require(_0xc130('0x2'));var fs=require('fs');var Redis=require(_0xc130('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc130('0x4'))(_0xc130('0x5'));var config=require(_0xc130('0x6'));var jayson=require(_0xc130('0x7'));var client=jayson[_0xc130('0x8')][_0xc130('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c3d20,_0x343345,_0x40c638){return new BPromise(function(_0x1c619d,_0xbd90bc){return client[_0xc130('0xa')](_0x1c3d20,_0x40c638)['then'](function(_0x4c1b50){logger['info'](_0xc130('0xb'),_0x343345,_0xc130('0xc'));logger[_0xc130('0xd')](_0xc130('0xe'),_0x343345,_0xc130('0xc'),JSON[_0xc130('0xf')](_0x4c1b50));if(_0x4c1b50[_0xc130('0x10')]){if(_0x4c1b50[_0xc130('0x10')]['code']===0x1f4){logger[_0xc130('0x10')]('Cdr,\x20%s,\x20%s',_0x343345,_0x4c1b50['error']['message']);return _0xbd90bc(_0x4c1b50[_0xc130('0x10')][_0xc130('0x11')]);}logger[_0xc130('0x10')]('Cdr,\x20%s,\x20%s',_0x343345,_0x4c1b50[_0xc130('0x10')][_0xc130('0x11')]);return _0x1c619d(_0x4c1b50['error'][_0xc130('0x11')]);}else{logger[_0xc130('0x12')](_0xc130('0xb'),_0x343345,_0xc130('0xc'));_0x1c619d(_0x4c1b50[_0xc130('0x13')]['message']);}})[_0xc130('0x14')](function(_0x20acc7){logger[_0xc130('0x10')](_0xc130('0xb'),_0x343345,_0x20acc7);_0xbd90bc(_0x20acc7);});});}
\ No newline at end of file
index 7492974..a7118be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x32d351,_0x44eb47){var _0xcde9fa=function(_0x24a26d){while(--_0x24a26d){_0x32d351['push'](_0x32d351['shift']());}};_0xcde9fa(++_0x44eb47);}(_0xb10b,0x12a));var _0xbb10=function(_0xfadccd,_0x290136){_0xfadccd=_0xfadccd-0x0;var _0x482ac4=_0xb10b[_0xfadccd];return _0x482ac4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4c974e,_0x513d9e){var _0x31327b=function(_0x5db97c){while(--_0x5db97c){_0x4c974e['push'](_0x4c974e['shift']());}};_0x31327b(++_0x513d9e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index 8cf696f..705a3c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4a3=['noop','TEXT','*,*,*,*','INTEGER','STRING'];(function(_0x54dfa3,_0x519df9){var _0x302fb9=function(_0x35c204){while(--_0x35c204){_0x54dfa3['push'](_0x54dfa3['shift']());}};_0x302fb9(++_0x519df9);}(_0xe4a3,0x107));var _0x3e4a=function(_0x938050,_0x5591e9){_0x938050=_0x938050-0x0;var _0x43da16=_0xe4a3[_0x938050];return _0x43da16;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x3e4a('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x3e4a('0x1')],'allowNull':![],'defaultValue':_0x3e4a('0x2')},'appdata':{'type':Sequelize[_0x3e4a('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3e4a('0x1')],'defaultValue':_0x3e4a('0x4')}};
\ No newline at end of file
+var _0xf74d=['noop','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0xa73aa,_0x4e1e22){var _0x2e8881=function(_0x443ee4){while(--_0x443ee4){_0xa73aa['push'](_0xa73aa['shift']());}};_0x2e8881(++_0x4e1e22);}(_0xf74d,0xe6));var _0xdf74=function(_0x1c4125,_0x169a60){_0x1c4125=_0x1c4125-0x0;var _0x2568a7=_0xf74d[_0x1c4125];return _0x2568a7;};'use strict';var Sequelize=require(_0xdf74('0x0'));module[_0xdf74('0x1')]={'priority':{'type':Sequelize[_0xdf74('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdf74('0x3')],'allowNull':![],'defaultValue':_0xdf74('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdf74('0x3')]},'interval':{'type':Sequelize[_0xdf74('0x3')],'defaultValue':_0xdf74('0x5')}};
\ No newline at end of file
index c2f94ae..4bd6420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e5=['sox','ejs','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','stack','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','find','catch','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x51fd4e,_0x4bf5fd){var _0x20beed=function(_0x4bd9f7){while(--_0x4bd9f7){_0x51fd4e['push'](_0x51fd4e['shift']());}};_0x20beed(++_0x4bf5fd);}(_0x58e5,0xd1));var _0x558e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x58e5[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x558e('0x0'));var rimraf=require(_0x558e('0x1'));var zipdir=require(_0x558e('0x2'));var jsonpatch=require(_0x558e('0x3'));var rp=require(_0x558e('0x4'));var moment=require(_0x558e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x558e('0x6'));var util=require('util');var path=require('path');var sox=require(_0x558e('0x7'));var csv=require('to-csv');var ejs=require(_0x558e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x558e('0x9'));var squel=require(_0x558e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x558e('0xb'));var Redis=require(_0x558e('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x558e('0xd'));var as=require(_0x558e('0xe'));var hardwareService=require(_0x558e('0xf'));var logger=require(_0x558e('0x10'))('api');var utils=require(_0x558e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x558e('0x12'));var db=require(_0x558e('0x13'))['db'];function respondWithStatusCode(_0x1328b5,_0x3bd154){_0x3bd154=_0x3bd154||0xcc;return function(_0x4a0889){if(_0x4a0889){return _0x1328b5[_0x558e('0x14')](_0x3bd154);}return _0x1328b5[_0x558e('0x15')](_0x3bd154)['end']();};}function respondWithResult(_0x288e2f,_0x9933cd){_0x9933cd=_0x9933cd||0xc8;return function(_0x4a6f57){if(_0x4a6f57){return _0x288e2f[_0x558e('0x15')](_0x9933cd)['json'](_0x4a6f57);}};}function respondWithFilteredResult(_0x134bdf,_0x13d3b1){return function(_0x5d61ab){if(_0x5d61ab){var _0x21552c=typeof _0x13d3b1[_0x558e('0x16')]===_0x558e('0x17')&&typeof _0x13d3b1[_0x558e('0x18')]==='undefined';var _0x2225d5=_0x5d61ab[_0x558e('0x19')];var _0x84da47=_0x21552c?0x0:_0x13d3b1[_0x558e('0x16')];var _0xb955b2=_0x21552c?_0x5d61ab[_0x558e('0x19')]:_0x13d3b1[_0x558e('0x16')]+_0x13d3b1['limit'];var _0x4afcfe;if(_0xb955b2>=_0x2225d5){_0xb955b2=_0x2225d5;_0x4afcfe=0xc8;}else{_0x4afcfe=0xce;}_0x134bdf[_0x558e('0x15')](_0x4afcfe);return _0x134bdf[_0x558e('0x1a')](_0x558e('0x1b'),_0x84da47+'-'+_0xb955b2+'/'+_0x2225d5)[_0x558e('0x1c')](_0x5d61ab);}return null;};}function patchUpdates(_0x208288){return function(_0xc046be){try{jsonpatch[_0x558e('0x1d')](_0xc046be,_0x208288,!![]);}catch(_0x2e3279){return BPromise[_0x558e('0x1e')](_0x2e3279);}return _0xc046be[_0x558e('0x1f')]();};}function saveUpdates(_0x4c402d,_0x39b61d){return function(_0x10d323){if(_0x10d323){return _0x10d323['update'](_0x4c402d)['then'](function(_0x448485){return _0x448485;});}return null;};}function removeEntity(_0x59a349,_0x87fb47){return function(_0x44b7fe){if(_0x44b7fe){return _0x44b7fe['destroy']()[_0x558e('0x20')](function(){_0x59a349[_0x558e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26874d,_0x4e9182){return function(_0x29caf3){if(!_0x29caf3){_0x26874d[_0x558e('0x14')](0x194);}return _0x29caf3;};}function handleError(_0x2ce831,_0x391da8){_0x391da8=_0x391da8||0x1f4;return function(_0x489f65){logger['error'](_0x489f65[_0x558e('0x21')]);if(_0x489f65['name']){delete _0x489f65['name'];}_0x2ce831[_0x558e('0x15')](_0x391da8)[_0x558e('0x22')](_0x489f65);};}exports[_0x558e('0x23')]=function(_0x17bf74,_0x42fb72){var _0x4deb75={'raw':!![],'where':{'id':_0x17bf74[_0x558e('0x24')]['id']}},_0x2e0166={};_0x2e0166[_0x558e('0x25')]=_['keys'](db[_0x558e('0x26')][_0x558e('0x27')]);_0x2e0166[_0x558e('0x28')]=_[_0x558e('0x29')](_0x17bf74[_0x558e('0x28')]);_0x2e0166[_0x558e('0x2a')]=_[_0x558e('0x2b')](_0x2e0166[_0x558e('0x25')],_0x2e0166[_0x558e('0x28')]);_0x4deb75[_0x558e('0x2c')]=_['intersection'](_0x2e0166[_0x558e('0x25')],qs[_0x558e('0x2d')](_0x17bf74[_0x558e('0x28')][_0x558e('0x2d')]));_0x4deb75['attributes']=_0x4deb75['attributes'][_0x558e('0x2e')]?_0x4deb75[_0x558e('0x2c')]:_0x2e0166[_0x558e('0x25')];if(_0x17bf74[_0x558e('0x28')]['includeAll']){_0x4deb75['include']=[{'all':!![]}];}_0x4deb75=_[_0x558e('0x2f')]({},_0x4deb75,_0x17bf74[_0x558e('0x30')]);return db[_0x558e('0x26')][_0x558e('0x31')](_0x4deb75)[_0x558e('0x20')](handleEntityNotFound(_0x42fb72,null))[_0x558e('0x20')](respondWithResult(_0x42fb72,null))[_0x558e('0x32')](handleError(_0x42fb72,null));};exports[_0x558e('0x33')]=function(_0x2225db,_0xdedffa){if(_0x2225db[_0x558e('0x34')]['id']){delete _0x2225db['body']['id'];}return db[_0x558e('0x26')][_0x558e('0x31')]({'where':{'id':_0x2225db['params']['id']}})['then'](handleEntityNotFound(_0xdedffa,null))['then'](saveUpdates(_0x2225db[_0x558e('0x34')],null))[_0x558e('0x20')](respondWithResult(_0xdedffa,null))['catch'](handleError(_0xdedffa,null));};exports[_0x558e('0x35')]=function(_0x2b555f,_0x449d74){return db[_0x558e('0x26')]['find']({'where':{'id':_0x2b555f[_0x558e('0x24')]['id']}})[_0x558e('0x20')](handleEntityNotFound(_0x449d74,null))['then'](removeEntity(_0x449d74,null))['catch'](handleError(_0x449d74,null));};
\ No newline at end of file
+var _0x50a8=['undefined','limit','count','set','Content-Range','json','apply','update','destroy','then','error','stack','name','send','show','params','model','keys','ChatApplication','query','filters','intersection','fields','attributes','length','includeAll','options','find','catch','body','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset'];(function(_0x27670b,_0x55ae98){var _0x5a27a9=function(_0x52117f){while(--_0x52117f){_0x27670b['push'](_0x27670b['shift']());}};_0x5a27a9(++_0x55ae98);}(_0x50a8,0x198));var _0x850a=function(_0x3d95e9,_0x45bb17){_0x3d95e9=_0x3d95e9-0x0;var _0x472c9a=_0x50a8[_0x3d95e9];return _0x472c9a;};'use strict';var emlformat=require(_0x850a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x850a('0x1'));var moment=require('moment');var BPromise=require(_0x850a('0x2'));var Mustache=require(_0x850a('0x3'));var util=require(_0x850a('0x4'));var path=require(_0x850a('0x5'));var sox=require(_0x850a('0x6'));var csv=require(_0x850a('0x7'));var ejs=require(_0x850a('0x8'));var fs=require('fs');var fs_extra=require(_0x850a('0x9'));var _=require(_0x850a('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x850a('0xb'));var deskjs=require(_0x850a('0xc'));var toCsv=require(_0x850a('0x7'));var querystring=require(_0x850a('0xd'));var Papa=require('papaparse');var Redis=require(_0x850a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x850a('0xf'));var hardwareService=require(_0x850a('0x10'));var logger=require(_0x850a('0x11'))(_0x850a('0x12'));var utils=require(_0x850a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b12a1,_0x4d591d){_0x4d591d=_0x4d591d||0xcc;return function(_0x45cd78){if(_0x45cd78){return _0x3b12a1[_0x850a('0x14')](_0x4d591d);}return _0x3b12a1[_0x850a('0x15')](_0x4d591d)[_0x850a('0x16')]();};}function respondWithResult(_0x3328e6,_0x50c199){_0x50c199=_0x50c199||0xc8;return function(_0x355a31){if(_0x355a31){return _0x3328e6['status'](_0x50c199)['json'](_0x355a31);}};}function respondWithFilteredResult(_0x537679,_0x4c0156){return function(_0x3e6e81){if(_0x3e6e81){var _0x5e0fbe=typeof _0x4c0156[_0x850a('0x17')]===_0x850a('0x18')&&typeof _0x4c0156[_0x850a('0x19')]===_0x850a('0x18');var _0x22d759=_0x3e6e81[_0x850a('0x1a')];var _0x3e2715=_0x5e0fbe?0x0:_0x4c0156[_0x850a('0x17')];var _0x57e789=_0x5e0fbe?_0x3e6e81[_0x850a('0x1a')]:_0x4c0156['offset']+_0x4c0156['limit'];var _0x49690e;if(_0x57e789>=_0x22d759){_0x57e789=_0x22d759;_0x49690e=0xc8;}else{_0x49690e=0xce;}_0x537679['status'](_0x49690e);return _0x537679[_0x850a('0x1b')](_0x850a('0x1c'),_0x3e2715+'-'+_0x57e789+'/'+_0x22d759)[_0x850a('0x1d')](_0x3e6e81);}return null;};}function patchUpdates(_0x5b2917){return function(_0x17eadb){try{jsonpatch[_0x850a('0x1e')](_0x17eadb,_0x5b2917,!![]);}catch(_0x15c39b){return BPromise['reject'](_0x15c39b);}return _0x17eadb['save']();};}function saveUpdates(_0x342b50,_0x285ef4){return function(_0x5758af){if(_0x5758af){return _0x5758af[_0x850a('0x1f')](_0x342b50)['then'](function(_0x5eb2a4){return _0x5eb2a4;});}return null;};}function removeEntity(_0x561fde,_0x4363d4){return function(_0x47d527){if(_0x47d527){return _0x47d527[_0x850a('0x20')]()[_0x850a('0x21')](function(){_0x561fde[_0x850a('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4606ef,_0xc52e71){return function(_0x33327e){if(!_0x33327e){_0x4606ef['sendStatus'](0x194);}return _0x33327e;};}function handleError(_0x1da9ad,_0xe46a27){_0xe46a27=_0xe46a27||0x1f4;return function(_0x4d715c){logger[_0x850a('0x22')](_0x4d715c[_0x850a('0x23')]);if(_0x4d715c[_0x850a('0x24')]){delete _0x4d715c[_0x850a('0x24')];}_0x1da9ad[_0x850a('0x15')](_0xe46a27)[_0x850a('0x25')](_0x4d715c);};}exports[_0x850a('0x26')]=function(_0x314d36,_0x3a228f){var _0x177dd6={'raw':!![],'where':{'id':_0x314d36[_0x850a('0x27')]['id']}},_0x44fb58={};_0x44fb58[_0x850a('0x28')]=_[_0x850a('0x29')](db[_0x850a('0x2a')]['rawAttributes']);_0x44fb58[_0x850a('0x2b')]=_['keys'](_0x314d36[_0x850a('0x2b')]);_0x44fb58[_0x850a('0x2c')]=_[_0x850a('0x2d')](_0x44fb58['model'],_0x44fb58['query']);_0x177dd6['attributes']=_[_0x850a('0x2d')](_0x44fb58['model'],qs[_0x850a('0x2e')](_0x314d36[_0x850a('0x2b')][_0x850a('0x2e')]));_0x177dd6[_0x850a('0x2f')]=_0x177dd6['attributes'][_0x850a('0x30')]?_0x177dd6[_0x850a('0x2f')]:_0x44fb58[_0x850a('0x28')];if(_0x314d36[_0x850a('0x2b')][_0x850a('0x31')]){_0x177dd6['include']=[{'all':!![]}];}_0x177dd6=_['merge']({},_0x177dd6,_0x314d36[_0x850a('0x32')]);return db['ChatApplication'][_0x850a('0x33')](_0x177dd6)[_0x850a('0x21')](handleEntityNotFound(_0x3a228f,null))[_0x850a('0x21')](respondWithResult(_0x3a228f,null))[_0x850a('0x34')](handleError(_0x3a228f,null));};exports[_0x850a('0x1f')]=function(_0x172050,_0x3d88bb){if(_0x172050[_0x850a('0x35')]['id']){delete _0x172050[_0x850a('0x35')]['id'];}return db[_0x850a('0x2a')]['find']({'where':{'id':_0x172050[_0x850a('0x27')]['id']}})[_0x850a('0x21')](handleEntityNotFound(_0x3d88bb,null))[_0x850a('0x21')](saveUpdates(_0x172050[_0x850a('0x35')],null))[_0x850a('0x21')](respondWithResult(_0x3d88bb,null))['catch'](handleError(_0x3d88bb,null));};exports[_0x850a('0x20')]=function(_0x376a12,_0x58d34d){return db[_0x850a('0x2a')][_0x850a('0x33')]({'where':{'id':_0x376a12[_0x850a('0x27')]['id']}})['then'](handleEntityNotFound(_0x58d34d,null))['then'](removeEntity(_0x58d34d,null))[_0x850a('0x34')](handleError(_0x58d34d,null));};
\ No newline at end of file
index 5b71f10..c7ac45b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4ba=['../../config/logger','api','moment','request-promise','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','util'];(function(_0x5eb236,_0x333496){var _0x795156=function(_0x57f85f){while(--_0x57f85f){_0x5eb236['push'](_0x5eb236['shift']());}};_0x795156(++_0x333496);}(_0xa4ba,0x1b7));var _0xaa4b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa4ba[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xaa4b('0x0'));var logger=require(_0xaa4b('0x1'))(_0xaa4b('0x2'));var moment=require(_0xaa4b('0x3'));var BPromise=require('bluebird');var rp=require(_0xaa4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xaa4b('0x5'));var attributes=require(_0xaa4b('0x6'));module[_0xaa4b('0x7')]=function(_0x146035,_0x4809a9){return _0x146035[_0xaa4b('0x8')]('ChatApplication',attributes,{'tableName':_0xaa4b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe920=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xe920,0xbe));var _0x0e92=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0xe920[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x0e92('0x0'));var util=require(_0x0e92('0x1'));var logger=require(_0x0e92('0x2'))(_0x0e92('0x3'));var moment=require(_0x0e92('0x4'));var BPromise=require(_0x0e92('0x5'));var rp=require(_0x0e92('0x6'));var fs=require('fs');var path=require(_0x0e92('0x7'));var rimraf=require(_0x0e92('0x8'));var config=require(_0x0e92('0x9'));var attributes=require('./chatApplication.attributes');module[_0x0e92('0xa')]=function(_0x5291e2,_0x40d9f2){return _0x5291e2[_0x0e92('0xb')](_0x0e92('0xc'),attributes,{'tableName':_0x0e92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0e92('0xe')});};
\ No newline at end of file
index ccb6a72..0541f9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff46=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','info','request\x20sent','debug','error','code','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','moment'];(function(_0x35085c,_0x292579){var _0x36d2b2=function(_0x2b2068){while(--_0x2b2068){_0x35085c['push'](_0x35085c['shift']());}};_0x36d2b2(++_0x292579);}(_0xff46,0x70));var _0x6ff4=function(_0x2e1e77,_0x1bc176){_0x2e1e77=_0x2e1e77-0x0;var _0x5403b6=_0xff46[_0x2e1e77];return _0x5403b6;};'use strict';var _=require(_0x6ff4('0x0'));var util=require('util');var moment=require(_0x6ff4('0x1'));var BPromise=require(_0x6ff4('0x2'));var rs=require(_0x6ff4('0x3'));var fs=require('fs');var Redis=require(_0x6ff4('0x4'));var db=require(_0x6ff4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6ff4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6ff4('0x7')][_0x6ff4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2fbe2e,_0x816b11,_0x290e71){return new BPromise(function(_0x351247,_0x102239){return client[_0x6ff4('0x9')](_0x2fbe2e,_0x290e71)['then'](function(_0x5b4fdb){logger[_0x6ff4('0xa')]('ChatApplication,\x20%s,\x20%s',_0x816b11,_0x6ff4('0xb'));logger[_0x6ff4('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x816b11,_0x6ff4('0xb'),JSON['stringify'](_0x5b4fdb));if(_0x5b4fdb[_0x6ff4('0xd')]){if(_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xe')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x816b11,_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xf')]);return _0x102239(_0x5b4fdb[_0x6ff4('0xd')]['message']);}logger[_0x6ff4('0xd')](_0x6ff4('0x10'),_0x816b11,_0x5b4fdb['error']['message']);return _0x351247(_0x5b4fdb[_0x6ff4('0xd')][_0x6ff4('0xf')]);}else{logger[_0x6ff4('0xa')](_0x6ff4('0x10'),_0x816b11,'request\x20sent');_0x351247(_0x5b4fdb[_0x6ff4('0x11')][_0x6ff4('0xf')]);}})[_0x6ff4('0x12')](function(_0x38bf93){logger[_0x6ff4('0xd')](_0x6ff4('0x10'),_0x816b11,_0x38bf93);_0x102239(_0x38bf93);});});}
\ No newline at end of file
+var _0x69a6=['info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','ChatApplication,\x20%s,\x20%s','message','result','catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x58c241,_0x13be02){var _0x358876=function(_0xf76fc6){while(--_0xf76fc6){_0x58c241['push'](_0x58c241['shift']());}};_0x358876(++_0x13be02);}(_0x69a6,0x10d));var _0x669a=function(_0x39e23a,_0x17845e){_0x39e23a=_0x39e23a-0x0;var _0x40eda6=_0x69a6[_0x39e23a];return _0x40eda6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x669a('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x669a('0x1'))['db'];var utils=require(_0x669a('0x2'));var logger=require(_0x669a('0x3'))(_0x669a('0x4'));var config=require(_0x669a('0x5'));var jayson=require(_0x669a('0x6'));var client=jayson[_0x669a('0x7')][_0x669a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f33ae,_0x45c78e,_0x16068d){return new BPromise(function(_0x255ed2,_0x452893){return client[_0x669a('0x9')](_0x2f33ae,_0x16068d)[_0x669a('0xa')](function(_0x26845a){logger[_0x669a('0xb')]('ChatApplication,\x20%s,\x20%s',_0x45c78e,_0x669a('0xc'));logger['debug'](_0x669a('0xd'),_0x45c78e,_0x669a('0xc'),JSON[_0x669a('0xe')](_0x26845a));if(_0x26845a[_0x669a('0xf')]){if(_0x26845a[_0x669a('0xf')]['code']===0x1f4){logger[_0x669a('0xf')](_0x669a('0x10'),_0x45c78e,_0x26845a[_0x669a('0xf')]['message']);return _0x452893(_0x26845a[_0x669a('0xf')][_0x669a('0x11')]);}logger[_0x669a('0xf')](_0x669a('0x10'),_0x45c78e,_0x26845a[_0x669a('0xf')][_0x669a('0x11')]);return _0x255ed2(_0x26845a[_0x669a('0xf')]['message']);}else{logger['info'](_0x669a('0x10'),_0x45c78e,_0x669a('0xc'));_0x255ed2(_0x26845a[_0x669a('0x12')][_0x669a('0x11')]);}})[_0x669a('0x13')](function(_0x2830e4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x45c78e,_0x2830e4);_0x452893(_0x2830e4);});});}
\ No newline at end of file
index 4dd745f..3deedcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26b1=['update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','get','/:id','isAuthenticated','show','put'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x26b1,0x13f));var _0x126b=function(_0x3f38f3,_0x22cad7){_0x3f38f3=_0x3f38f3-0x0;var _0x2e88c1=_0x26b1[_0x3f38f3];return _0x2e88c1;};'use strict';var multer=require(_0x126b('0x0'));var util=require(_0x126b('0x1'));var path=require(_0x126b('0x2'));var timeout=require('connect-timeout');var express=require(_0x126b('0x3'));var router=express[_0x126b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x126b('0x5'));var controller=require('./chatApplication.controller');router[_0x126b('0x6')](_0x126b('0x7'),auth[_0x126b('0x8')](),controller[_0x126b('0x9')]);router[_0x126b('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x126b('0xb')]);router[_0x126b('0xc')](_0x126b('0x7'),auth[_0x126b('0x8')](),controller[_0x126b('0xd')]);module[_0x126b('0xe')]=router;
\ No newline at end of file
+var _0x91c6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','delete','exports','multer','util','path','express','fs-extra'];(function(_0x47875a,_0x514333){var _0x50e74d=function(_0x108d24){while(--_0x108d24){_0x47875a['push'](_0x47875a['shift']());}};_0x50e74d(++_0x514333);}(_0x91c6,0x1db));var _0x691c=function(_0x122884,_0x9867c5){_0x122884=_0x122884-0x0;var _0x3b386f=_0x91c6[_0x122884];return _0x3b386f;};'use strict';var multer=require(_0x691c('0x0'));var util=require(_0x691c('0x1'));var path=require(_0x691c('0x2'));var timeout=require('connect-timeout');var express=require(_0x691c('0x3'));var router=express['Router']();var fs_extra=require(_0x691c('0x4'));var auth=require(_0x691c('0x5'));var interaction=require(_0x691c('0x6'));var config=require(_0x691c('0x7'));var controller=require(_0x691c('0x8'));router[_0x691c('0x9')]('/:id',auth[_0x691c('0xa')](),controller[_0x691c('0xb')]);router['put'](_0x691c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x691c('0xd')](_0x691c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x691c('0xe')]=router;
\ No newline at end of file
index 245562c..bb9f5a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f3d=['STRING','BOOLEAN','sequelize'];(function(_0x3b8363,_0x17bc8){var _0x4d8289=function(_0x520c1d){while(--_0x520c1d){_0x3b8363['push'](_0x3b8363['shift']());}};_0x4d8289(++_0x17bc8);}(_0x3f3d,0xd4));var _0xd3f3=function(_0x160148,_0x5c0639){_0x160148=_0x160148-0x0;var _0x5d4a2c=_0x3f3d[_0x160148];return _0x5d4a2c;};'use strict';var Sequelize=require(_0xd3f3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3f3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd3f3('0x1')]},'write':{'type':Sequelize[_0xd3f3('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc9d9=['sequelize','STRING','BOOLEAN'];(function(_0x4ce3b8,_0x4e86ea){var _0x39056c=function(_0x548e93){while(--_0x548e93){_0x4ce3b8['push'](_0x4ce3b8['shift']());}};_0x39056c(++_0x4e86ea);}(_0xc9d9,0x195));var _0x9c9d=function(_0x2c4ead,_0x6d53e2){_0x2c4ead=_0x2c4ead-0x0;var _0x8100f=_0xc9d9[_0x2c4ead];return _0x8100f;};'use strict';var Sequelize=require(_0x9c9d('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c9d('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x9c9d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
index 98b3eb1..d902502 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2caf=['index','map','ChatGroup','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','keys','length','includeAll','create','body','update','find','params','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatInternalMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','end','stack','name'];(function(_0x39a968,_0x364d93){var _0x47b0a5=function(_0x17c9dd){while(--_0x17c9dd){_0x39a968['push'](_0x39a968['shift']());}};_0x47b0a5(++_0x364d93);}(_0x2caf,0x96));var _0xf2ca=function(_0x53a68c,_0x540744){_0x53a68c=_0x53a68c-0x0;var _0x29f9c1=_0x2caf[_0x53a68c];return _0x29f9c1;};'use strict';var emlformat=require(_0xf2ca('0x0'));var rimraf=require(_0xf2ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2ca('0x2'));var rp=require('request-promise');var moment=require(_0xf2ca('0x3'));var BPromise=require(_0xf2ca('0x4'));var Mustache=require(_0xf2ca('0x5'));var util=require(_0xf2ca('0x6'));var path=require(_0xf2ca('0x7'));var sox=require(_0xf2ca('0x8'));var csv=require(_0xf2ca('0x9'));var ejs=require(_0xf2ca('0xa'));var fs=require('fs');var fs_extra=require(_0xf2ca('0xb'));var _=require(_0xf2ca('0xc'));var squel=require(_0xf2ca('0xd'));var crypto=require(_0xf2ca('0xe'));var jsforce=require(_0xf2ca('0xf'));var deskjs=require(_0xf2ca('0x10'));var toCsv=require(_0xf2ca('0x9'));var querystring=require(_0xf2ca('0x11'));var Papa=require(_0xf2ca('0x12'));var Redis=require(_0xf2ca('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xf2ca('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf2ca('0x15'))(_0xf2ca('0x16'));var utils=require(_0xf2ca('0x17'));var config=require(_0xf2ca('0x18'));var licenseUtil=require(_0xf2ca('0x19'));var db=require(_0xf2ca('0x1a'))['db'];config[_0xf2ca('0x1b')]=_[_0xf2ca('0x1c')](config[_0xf2ca('0x1b')],{'host':_0xf2ca('0x1d'),'port':0x18eb});var socket=require(_0xf2ca('0x1e'))(new Redis(config[_0xf2ca('0x1b')]));require(_0xf2ca('0x1f'))[_0xf2ca('0x20')](socket);function respondWithStatusCode(_0x45fab2,_0x1797c8){_0x1797c8=_0x1797c8||0xcc;return function(_0x5d8dcf){if(_0x5d8dcf){return _0x45fab2[_0xf2ca('0x21')](_0x1797c8);}return _0x45fab2['status'](_0x1797c8)['end']();};}function respondWithResult(_0x4dc664,_0x19244f){_0x19244f=_0x19244f||0xc8;return function(_0x13569b){if(_0x13569b){return _0x4dc664[_0xf2ca('0x22')](_0x19244f)[_0xf2ca('0x23')](_0x13569b);}};}function respondWithFilteredResult(_0xe74616,_0x1914f4){return function(_0x1d7048){if(_0x1d7048){var _0x1f47b9=typeof _0x1914f4[_0xf2ca('0x24')]===_0xf2ca('0x25')&&typeof _0x1914f4[_0xf2ca('0x26')]==='undefined';var _0x4831d6=_0x1d7048[_0xf2ca('0x27')];var _0x44cece=_0x1f47b9?0x0:_0x1914f4[_0xf2ca('0x24')];var _0x48195e=_0x1f47b9?_0x1d7048['count']:_0x1914f4[_0xf2ca('0x24')]+_0x1914f4[_0xf2ca('0x26')];var _0x1321d8;if(_0x48195e>=_0x4831d6){_0x48195e=_0x4831d6;_0x1321d8=0xc8;}else{_0x1321d8=0xce;}_0xe74616[_0xf2ca('0x22')](_0x1321d8);return _0xe74616[_0xf2ca('0x28')]('Content-Range',_0x44cece+'-'+_0x48195e+'/'+_0x4831d6)['json'](_0x1d7048);}return null;};}function patchUpdates(_0x2fc8e7){return function(_0x3057dd){try{jsonpatch[_0xf2ca('0x29')](_0x3057dd,_0x2fc8e7,!![]);}catch(_0x8cf96){return BPromise['reject'](_0x8cf96);}return _0x3057dd[_0xf2ca('0x2a')]();};}function saveUpdates(_0xbde9ad,_0x2185f8){return function(_0x11c4ac){if(_0x11c4ac){return _0x11c4ac['update'](_0xbde9ad)[_0xf2ca('0x2b')](function(_0x3766d3){return _0x3766d3;});}return null;};}function removeEntity(_0xb06112,_0x2c0c27){return function(_0x4e91df){if(_0x4e91df){return _0x4e91df[_0xf2ca('0x2c')]()['then'](function(){_0xb06112['status'](0xcc)[_0xf2ca('0x2d')]();});}};}function handleEntityNotFound(_0x473b31,_0x4a14d9){return function(_0x598132){if(!_0x598132){_0x473b31[_0xf2ca('0x21')](0x194);}return _0x598132;};}function handleError(_0x571ddf,_0x4e96cc){_0x4e96cc=_0x4e96cc||0x1f4;return function(_0x1d4a1b){logger['error'](_0x1d4a1b[_0xf2ca('0x2e')]);if(_0x1d4a1b[_0xf2ca('0x2f')]){delete _0x1d4a1b[_0xf2ca('0x2f')];}_0x571ddf[_0xf2ca('0x22')](_0x4e96cc)['send'](_0x1d4a1b);};}exports[_0xf2ca('0x30')]=function(_0x1ade32,_0x374c51){var _0x58ddbd={},_0x2e518f={},_0x161665={'count':0x0,'rows':[]};var _0x1ad8b8=_[_0xf2ca('0x31')](db[_0xf2ca('0x32')][_0xf2ca('0x33')],function(_0x3bbe8a){return{'name':_0x3bbe8a[_0xf2ca('0x34')],'type':_0x3bbe8a[_0xf2ca('0x35')]['key']};});_0x2e518f[_0xf2ca('0x36')]=_[_0xf2ca('0x31')](_0x1ad8b8,'name');_0x2e518f[_0xf2ca('0x37')]=_['keys'](_0x1ade32[_0xf2ca('0x37')]);_0x2e518f[_0xf2ca('0x38')]=_[_0xf2ca('0x39')](_0x2e518f[_0xf2ca('0x36')],_0x2e518f[_0xf2ca('0x37')]);_0x58ddbd[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0x2e518f[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x58ddbd[_0xf2ca('0x3a')]=_0x58ddbd['attributes']['length']?_0x58ddbd[_0xf2ca('0x3a')]:_0x2e518f['model'];if(!_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3c')](_0xf2ca('0x3d'))){_0x58ddbd['limit']=qs['limit'](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x58ddbd[_0xf2ca('0x24')]=qs[_0xf2ca('0x24')](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x24')]);}_0x58ddbd[_0xf2ca('0x3e')]=qs['sort'](_0x1ade32[_0xf2ca('0x37')][_0xf2ca('0x3f')]);_0x58ddbd[_0xf2ca('0x40')]=qs[_0xf2ca('0x38')](_['pick'](_0x1ade32[_0xf2ca('0x37')],_0x2e518f['filters']),_0x1ad8b8);if(_0x1ade32['query'][_0xf2ca('0x41')]){_0x58ddbd[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x58ddbd['where'],{'$or':_[_0xf2ca('0x31')](_0x1ad8b8,function(_0x40eca9){if(_0x40eca9[_0xf2ca('0x35')]!=='VIRTUAL'){var _0x23f5f7={};_0x23f5f7[_0x40eca9['name']]={'$like':'%'+_0x1ade32[_0xf2ca('0x37')]['filter']+'%'};return _0x23f5f7;}})});}_0x58ddbd=_['merge']({},_0x58ddbd,_0x1ade32[_0xf2ca('0x43')]);var _0x160683={'where':_0x58ddbd[_0xf2ca('0x40')]};return db[_0xf2ca('0x32')]['count'](_0x160683)['then'](function(_0x2243a5){_0x161665[_0xf2ca('0x27')]=_0x2243a5;if(_0x1ade32['query']['includeAll']){_0x58ddbd[_0xf2ca('0x44')]=[{'all':!![]}];}return db[_0xf2ca('0x32')][_0xf2ca('0x45')](_0x58ddbd);})[_0xf2ca('0x2b')](function(_0x1c5f51){_0x161665[_0xf2ca('0x46')]=_0x1c5f51;return _0x161665;})[_0xf2ca('0x2b')](respondWithFilteredResult(_0x374c51,_0x58ddbd))[_0xf2ca('0x47')](handleError(_0x374c51,null));};exports[_0xf2ca('0x48')]=function(_0x48b858,_0x1cb21f){var _0x44ef4a={'raw':!![],'where':{'id':_0x48b858['params']['id']}},_0xd63977={};_0xd63977['model']=_[_0xf2ca('0x49')](db['ChatGroup'][_0xf2ca('0x33')]);_0xd63977[_0xf2ca('0x37')]=_[_0xf2ca('0x49')](_0x48b858['query']);_0xd63977[_0xf2ca('0x38')]=_[_0xf2ca('0x39')](_0xd63977[_0xf2ca('0x36')],_0xd63977['query']);_0x44ef4a[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0xd63977[_0xf2ca('0x36')],qs['fields'](_0x48b858[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x44ef4a['attributes']=_0x44ef4a['attributes'][_0xf2ca('0x4a')]?_0x44ef4a[_0xf2ca('0x3a')]:_0xd63977['model'];if(_0x48b858[_0xf2ca('0x37')][_0xf2ca('0x4b')]){_0x44ef4a['include']=[{'all':!![]}];}_0x44ef4a=_[_0xf2ca('0x42')]({},_0x44ef4a,_0x48b858['options']);return db['ChatGroup']['find'](_0x44ef4a)[_0xf2ca('0x2b')](handleEntityNotFound(_0x1cb21f,null))[_0xf2ca('0x2b')](respondWithResult(_0x1cb21f,null))[_0xf2ca('0x47')](handleError(_0x1cb21f,null));};exports[_0xf2ca('0x4c')]=function(_0x3d599a,_0x492f05){return db[_0xf2ca('0x32')]['create'](_0x3d599a[_0xf2ca('0x4d')],{})[_0xf2ca('0x2b')](respondWithResult(_0x492f05,0xc9))[_0xf2ca('0x47')](handleError(_0x492f05,null));};exports[_0xf2ca('0x4e')]=function(_0xc33974,_0x310c8d){if(_0xc33974['body']['id']){delete _0xc33974[_0xf2ca('0x4d')]['id'];}return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0xc33974[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x310c8d,null))['then'](saveUpdates(_0xc33974[_0xf2ca('0x4d')],null))[_0xf2ca('0x2b')](respondWithResult(_0x310c8d,null))[_0xf2ca('0x47')](handleError(_0x310c8d,null));};exports['destroy']=function(_0x47e870,_0xdcbf5b){return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x47e870['params']['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0xdcbf5b,null))[_0xf2ca('0x2b')](removeEntity(_0xdcbf5b,null))[_0xf2ca('0x47')](handleError(_0xdcbf5b,null));};exports['describe']=function(_0x5ab2e2,_0xcdb771){return db[_0xf2ca('0x32')][_0xf2ca('0x51')]()[_0xf2ca('0x2b')](respondWithResult(_0xcdb771,null))[_0xf2ca('0x47')](handleError(_0xcdb771,null));};exports['getUnread']=function(_0x21453b,_0x5e331c,_0x26420d){return db['ChatInternalMessage'][_0xf2ca('0x27')]({'where':{'ChatGroupId':_0x21453b[_0xf2ca('0x50')]['id'],'ToId':_0x21453b[_0xf2ca('0x52')]['id'],'read':![]}})['then'](function(_0x2c0ae7){return{'id':_[_0xf2ca('0x53')](_0x21453b['params']['id']),'count':_0x2c0ae7};})[_0xf2ca('0x2b')](respondWithResult(_0x5e331c,null))['catch'](handleError(_0x5e331c,null));};exports[_0xf2ca('0x54')]=function(_0x8c2e2f,_0x559a98,_0x278028){return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x8c2e2f['params']['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x559a98,null))[_0xf2ca('0x2b')](function(_0x3b819b){if(_0x3b819b){return _0x3b819b[_0xf2ca('0x54')](_0x8c2e2f['body'][_0xf2ca('0x55')],_[_0xf2ca('0x56')](_0x8c2e2f[_0xf2ca('0x4d')],[_0xf2ca('0x55'),'id'])||{});}})[_0xf2ca('0x2b')](respondWithResult(_0x559a98,null))[_0xf2ca('0x47')](handleError(_0x559a98,null));};exports[_0xf2ca('0x57')]=function(_0xd50682,_0x72b8f,_0x36d334){var _0x23af16={};var _0x1d62ba={};var _0x40c3b7;var _0x52221a;return db['ChatGroup'][_0xf2ca('0x58')]({'where':{'id':_0xd50682[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x72b8f,null))[_0xf2ca('0x2b')](function(_0x5664db){if(_0x5664db){_0x40c3b7=_0x5664db;_0x1d62ba['model']=_[_0xf2ca('0x49')](db[_0xf2ca('0x59')][_0xf2ca('0x33')]);_0x1d62ba[_0xf2ca('0x37')]=_['keys'](_0xd50682[_0xf2ca('0x37')]);_0x1d62ba['filters']=_['intersection'](_0x1d62ba['model'],_0x1d62ba['query']);_0x23af16[_0xf2ca('0x3a')]=_[_0xf2ca('0x39')](_0x1d62ba[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x3b')]));_0x23af16[_0xf2ca('0x3a')]=_0x23af16[_0xf2ca('0x3a')][_0xf2ca('0x4a')]?_0x23af16['attributes']:_0x1d62ba[_0xf2ca('0x36')];_0x23af16['order']=qs[_0xf2ca('0x3f')](_0xd50682['query'][_0xf2ca('0x3f')]);_0x23af16[_0xf2ca('0x40')]=qs[_0xf2ca('0x38')](_[_0xf2ca('0x5a')](_0xd50682[_0xf2ca('0x37')],_0x1d62ba[_0xf2ca('0x38')]));if(_0xd50682['query'][_0xf2ca('0x41')]){_0x23af16[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x23af16['where'],{'$or':_['map'](_0x23af16[_0xf2ca('0x3a')],function(_0x5ab38b){var _0x556e97={};_0x556e97[_0x5ab38b]={'$like':'%'+_0xd50682[_0xf2ca('0x37')]['filter']+'%'};return _0x556e97;})});}_0x23af16=_[_0xf2ca('0x42')]({},_0x23af16,_0xd50682[_0xf2ca('0x43')]);return _0x40c3b7['getMembers'](_0x23af16);}})[_0xf2ca('0x2b')](function(_0x3d5c5a){if(_0x3d5c5a){_0x52221a=_0x3d5c5a[_0xf2ca('0x4a')];if(!_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x3c')](_0xf2ca('0x3d'))){_0x23af16[_0xf2ca('0x26')]=qs['limit'](_0xd50682[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x23af16[_0xf2ca('0x24')]=qs[_0xf2ca('0x24')](_0xd50682['query'][_0xf2ca('0x24')]);}return _0x40c3b7[_0xf2ca('0x57')](_0x23af16);}})[_0xf2ca('0x2b')](function(_0x815638){if(_0x815638){return _0x815638?{'count':_0x52221a,'rows':_0x815638}:null;}})[_0xf2ca('0x2b')](respondWithResult(_0x72b8f,null))['catch'](handleError(_0x72b8f,null));};exports[_0xf2ca('0x5b')]=function(_0x2508ec,_0x28be18,_0x39d46a){return db['ChatGroup'][_0xf2ca('0x4f')]({'where':{'id':_0x2508ec[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0x28be18,null))[_0xf2ca('0x2b')](function(_0x468a72){if(_0x468a72){return _0x468a72['removeMembers'](_0x2508ec['query']['ids']);}})[_0xf2ca('0x2b')](respondWithStatusCode(_0x28be18,null))['catch'](handleError(_0x28be18,null));};exports[_0xf2ca('0x5c')]=function(_0x106b04,_0x3b4ffb,_0x1077ea){if(_0x106b04['body']['id']){delete _0x106b04['body']['id'];}return db[_0xf2ca('0x32')][_0xf2ca('0x4f')]({'where':{'id':_0x106b04['params']['id']}})['then'](handleEntityNotFound(_0x3b4ffb,null))['then'](function(_0x2b7baf){if(_0x2b7baf){_0x106b04[_0xf2ca('0x4d')]['ChatGroupId']=_0x2b7baf['id'];return db[_0xf2ca('0x5d')][_0xf2ca('0x4c')](_0x106b04[_0xf2ca('0x4d')]);}})[_0xf2ca('0x2b')](respondWithResult(_0x3b4ffb,null))[_0xf2ca('0x47')](handleError(_0x3b4ffb,null));};exports[_0xf2ca('0x5e')]=function(_0x2157b3,_0xab284a,_0x173505){var _0x3a4658={};var _0x217c25={};var _0x40bc8b;var _0x4b41ce;return db['ChatGroup'][_0xf2ca('0x58')]({'where':{'id':_0x2157b3[_0xf2ca('0x50')]['id']}})[_0xf2ca('0x2b')](handleEntityNotFound(_0xab284a,null))[_0xf2ca('0x2b')](function(_0x1fb538){if(_0x1fb538){_0x40bc8b=_0x1fb538;_0x217c25[_0xf2ca('0x36')]=_[_0xf2ca('0x49')](db[_0xf2ca('0x5d')]['rawAttributes']);_0x217c25[_0xf2ca('0x37')]=_[_0xf2ca('0x49')](_0x2157b3[_0xf2ca('0x37')]);_0x217c25[_0xf2ca('0x38')]=_['intersection'](_0x217c25[_0xf2ca('0x36')],_0x217c25[_0xf2ca('0x37')]);_0x3a4658['attributes']=_[_0xf2ca('0x39')](_0x217c25[_0xf2ca('0x36')],qs[_0xf2ca('0x3b')](_0x2157b3['query'][_0xf2ca('0x3b')]));_0x3a4658['attributes']=_0x3a4658[_0xf2ca('0x3a')][_0xf2ca('0x4a')]?_0x3a4658[_0xf2ca('0x3a')]:_0x217c25[_0xf2ca('0x36')];_0x3a4658[_0xf2ca('0x3e')]=qs[_0xf2ca('0x3f')](_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x3f')]);_0x3a4658[_0xf2ca('0x40')]=qs['filters'](_['pick'](_0x2157b3['query'],_0x217c25[_0xf2ca('0x38')]));if(_0x2157b3['query']['filter']){_0x3a4658[_0xf2ca('0x40')]=_[_0xf2ca('0x42')](_0x3a4658[_0xf2ca('0x40')],{'$or':_[_0xf2ca('0x31')](_0x3a4658[_0xf2ca('0x3a')],function(_0x17ba04){var _0x433b7f={};_0x433b7f[_0x17ba04]={'$like':'%'+_0x2157b3['query']['filter']+'%'};return _0x433b7f;})});}if(_0x2157b3['query'][_0xf2ca('0x5f')]){var _0x24c227=_0x2157b3['query'][_0xf2ca('0x5f')][_0xf2ca('0x60')](',');var _0xde3057={};_0xde3057[_0x24c227[0x0]]={'$gte':moment(_0x24c227[0x1])[_0xf2ca('0x61')](_0xf2ca('0x62'))};_0x3a4658['where']=_[_0xf2ca('0x42')](_0x3a4658[_0xf2ca('0x40')],_0xde3057);}_0x3a4658=_[_0xf2ca('0x42')]({},_0x3a4658,_0x2157b3[_0xf2ca('0x43')]);return _0x40bc8b[_0xf2ca('0x5e')](_0x3a4658);}})['then'](function(_0x1b3d89){if(_0x1b3d89){_0x4b41ce=_0x1b3d89['length'];if(!_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x3c')]('nolimit')){_0x3a4658[_0xf2ca('0x26')]=qs[_0xf2ca('0x26')](_0x2157b3[_0xf2ca('0x37')][_0xf2ca('0x26')]);_0x3a4658['offset']=qs[_0xf2ca('0x24')](_0x2157b3['query']['offset']);}return _0x40bc8b['getMessages'](_0x3a4658);}})[_0xf2ca('0x2b')](function(_0x1397b3){if(_0x1397b3){return _0x1397b3?{'count':_0x4b41ce,'rows':_0x1397b3}:null;}})['then'](respondWithResult(_0xab284a,null))[_0xf2ca('0x47')](handleError(_0xab284a,null));};
\ No newline at end of file
+var _0x0d59=['reject','save','then','destroy','error','stack','name','index','ChatGroup','rawAttributes','fieldName','type','query','filters','model','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','params','keys','attributes','length','include','find','create','body','update','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','User','map','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x252cab,_0x228f2d){var _0x5c5f1e=function(_0xaf4d22){while(--_0xaf4d22){_0x252cab['push'](_0x252cab['shift']());}};_0x5c5f1e(++_0x228f2d);}(_0x0d59,0x1ac));var _0x90d5=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x0d59[_0xdaab62];return _0x13d767;};'use strict';var emlformat=require(_0x90d5('0x0'));var rimraf=require(_0x90d5('0x1'));var zipdir=require(_0x90d5('0x2'));var jsonpatch=require(_0x90d5('0x3'));var rp=require('request-promise');var moment=require(_0x90d5('0x4'));var BPromise=require(_0x90d5('0x5'));var Mustache=require(_0x90d5('0x6'));var util=require(_0x90d5('0x7'));var path=require(_0x90d5('0x8'));var sox=require(_0x90d5('0x9'));var csv=require(_0x90d5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90d5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x90d5('0xc'));var jsforce=require(_0x90d5('0xd'));var deskjs=require(_0x90d5('0xe'));var toCsv=require(_0x90d5('0xa'));var querystring=require(_0x90d5('0xf'));var Papa=require(_0x90d5('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x90d5('0x11'));var hardwareService=require(_0x90d5('0x12'));var logger=require(_0x90d5('0x13'))(_0x90d5('0x14'));var utils=require(_0x90d5('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x90d5('0x16'))['db'];config['redis']=_['defaults'](config[_0x90d5('0x17')],{'host':_0x90d5('0x18'),'port':0x18eb});var socket=require(_0x90d5('0x19'))(new Redis(config[_0x90d5('0x17')]));require('./chatGroup.socket')[_0x90d5('0x1a')](socket);function respondWithStatusCode(_0xb52769,_0x4941cc){_0x4941cc=_0x4941cc||0xcc;return function(_0x2b66a8){if(_0x2b66a8){return _0xb52769[_0x90d5('0x1b')](_0x4941cc);}return _0xb52769[_0x90d5('0x1c')](_0x4941cc)[_0x90d5('0x1d')]();};}function respondWithResult(_0x8cdf1f,_0x58bf80){_0x58bf80=_0x58bf80||0xc8;return function(_0x5ec7c5){if(_0x5ec7c5){return _0x8cdf1f['status'](_0x58bf80)[_0x90d5('0x1e')](_0x5ec7c5);}};}function respondWithFilteredResult(_0x39dae0,_0x4c4e90){return function(_0xbf63da){if(_0xbf63da){var _0x549de9=typeof _0x4c4e90[_0x90d5('0x1f')]===_0x90d5('0x20')&&typeof _0x4c4e90[_0x90d5('0x21')]===_0x90d5('0x20');var _0x3f754c=_0xbf63da[_0x90d5('0x22')];var _0x1ee93f=_0x549de9?0x0:_0x4c4e90['offset'];var _0x1a8fac=_0x549de9?_0xbf63da['count']:_0x4c4e90[_0x90d5('0x1f')]+_0x4c4e90['limit'];var _0x58608a;if(_0x1a8fac>=_0x3f754c){_0x1a8fac=_0x3f754c;_0x58608a=0xc8;}else{_0x58608a=0xce;}_0x39dae0['status'](_0x58608a);return _0x39dae0['set'](_0x90d5('0x23'),_0x1ee93f+'-'+_0x1a8fac+'/'+_0x3f754c)[_0x90d5('0x1e')](_0xbf63da);}return null;};}function patchUpdates(_0x5a6c06){return function(_0x47c566){try{jsonpatch[_0x90d5('0x24')](_0x47c566,_0x5a6c06,!![]);}catch(_0x1d3913){return BPromise[_0x90d5('0x25')](_0x1d3913);}return _0x47c566[_0x90d5('0x26')]();};}function saveUpdates(_0x46ccdb,_0x239f31){return function(_0x30bc9a){if(_0x30bc9a){return _0x30bc9a['update'](_0x46ccdb)[_0x90d5('0x27')](function(_0xe59bef){return _0xe59bef;});}return null;};}function removeEntity(_0x54ef5c,_0xc2df75){return function(_0x30d214){if(_0x30d214){return _0x30d214[_0x90d5('0x28')]()[_0x90d5('0x27')](function(){_0x54ef5c['status'](0xcc)[_0x90d5('0x1d')]();});}};}function handleEntityNotFound(_0x57d69e,_0x56a7b5){return function(_0x417d0f){if(!_0x417d0f){_0x57d69e[_0x90d5('0x1b')](0x194);}return _0x417d0f;};}function handleError(_0x36c585,_0x31d8af){_0x31d8af=_0x31d8af||0x1f4;return function(_0x1d1503){logger[_0x90d5('0x29')](_0x1d1503[_0x90d5('0x2a')]);if(_0x1d1503[_0x90d5('0x2b')]){delete _0x1d1503[_0x90d5('0x2b')];}_0x36c585[_0x90d5('0x1c')](_0x31d8af)['send'](_0x1d1503);};}exports[_0x90d5('0x2c')]=function(_0x43061e,_0x4c3749){var _0x528fc2={},_0x314815={},_0x112f0b={'count':0x0,'rows':[]};var _0x14aa0d=_['map'](db[_0x90d5('0x2d')][_0x90d5('0x2e')],function(_0x508bb3){return{'name':_0x508bb3[_0x90d5('0x2f')],'type':_0x508bb3[_0x90d5('0x30')]['key']};});_0x314815['model']=_['map'](_0x14aa0d,_0x90d5('0x2b'));_0x314815[_0x90d5('0x31')]=_['keys'](_0x43061e[_0x90d5('0x31')]);_0x314815[_0x90d5('0x32')]=_['intersection'](_0x314815[_0x90d5('0x33')],_0x314815[_0x90d5('0x31')]);_0x528fc2['attributes']=_[_0x90d5('0x34')](_0x314815['model'],qs[_0x90d5('0x35')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x35')]));_0x528fc2['attributes']=_0x528fc2['attributes']['length']?_0x528fc2['attributes']:_0x314815[_0x90d5('0x33')];if(!_0x43061e[_0x90d5('0x31')][_0x90d5('0x36')](_0x90d5('0x37'))){_0x528fc2[_0x90d5('0x21')]=qs[_0x90d5('0x21')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x21')]);_0x528fc2[_0x90d5('0x1f')]=qs['offset'](_0x43061e['query'][_0x90d5('0x1f')]);}_0x528fc2[_0x90d5('0x38')]=qs[_0x90d5('0x39')](_0x43061e[_0x90d5('0x31')][_0x90d5('0x39')]);_0x528fc2[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_[_0x90d5('0x3b')](_0x43061e[_0x90d5('0x31')],_0x314815[_0x90d5('0x32')]),_0x14aa0d);if(_0x43061e['query'][_0x90d5('0x3c')]){_0x528fc2[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x528fc2['where'],{'$or':_['map'](_0x14aa0d,function(_0xa78192){if(_0xa78192['type']!=='VIRTUAL'){var _0x203d59={};_0x203d59[_0xa78192[_0x90d5('0x2b')]]={'$like':'%'+_0x43061e['query'][_0x90d5('0x3c')]+'%'};return _0x203d59;}})});}_0x528fc2=_[_0x90d5('0x3d')]({},_0x528fc2,_0x43061e[_0x90d5('0x3e')]);var _0xb2a05e={'where':_0x528fc2['where']};return db[_0x90d5('0x2d')][_0x90d5('0x22')](_0xb2a05e)[_0x90d5('0x27')](function(_0x81ac87){_0x112f0b[_0x90d5('0x22')]=_0x81ac87;if(_0x43061e[_0x90d5('0x31')][_0x90d5('0x3f')]){_0x528fc2['include']=[{'all':!![]}];}return db[_0x90d5('0x2d')]['findAll'](_0x528fc2);})[_0x90d5('0x27')](function(_0xe44cb2){_0x112f0b['rows']=_0xe44cb2;return _0x112f0b;})[_0x90d5('0x27')](respondWithFilteredResult(_0x4c3749,_0x528fc2))[_0x90d5('0x40')](handleError(_0x4c3749,null));};exports['show']=function(_0x865f19,_0x2ffd01){var _0x1b41d2={'raw':!![],'where':{'id':_0x865f19[_0x90d5('0x41')]['id']}},_0x226f12={};_0x226f12[_0x90d5('0x33')]=_[_0x90d5('0x42')](db[_0x90d5('0x2d')][_0x90d5('0x2e')]);_0x226f12[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x865f19['query']);_0x226f12[_0x90d5('0x32')]=_['intersection'](_0x226f12['model'],_0x226f12[_0x90d5('0x31')]);_0x1b41d2['attributes']=_[_0x90d5('0x34')](_0x226f12['model'],qs['fields'](_0x865f19[_0x90d5('0x31')][_0x90d5('0x35')]));_0x1b41d2[_0x90d5('0x43')]=_0x1b41d2[_0x90d5('0x43')][_0x90d5('0x44')]?_0x1b41d2[_0x90d5('0x43')]:_0x226f12[_0x90d5('0x33')];if(_0x865f19['query']['includeAll']){_0x1b41d2[_0x90d5('0x45')]=[{'all':!![]}];}_0x1b41d2=_[_0x90d5('0x3d')]({},_0x1b41d2,_0x865f19[_0x90d5('0x3e')]);return db[_0x90d5('0x2d')][_0x90d5('0x46')](_0x1b41d2)[_0x90d5('0x27')](handleEntityNotFound(_0x2ffd01,null))['then'](respondWithResult(_0x2ffd01,null))[_0x90d5('0x40')](handleError(_0x2ffd01,null));};exports[_0x90d5('0x47')]=function(_0x343748,_0x4e5d16){return db[_0x90d5('0x2d')][_0x90d5('0x47')](_0x343748[_0x90d5('0x48')],{})[_0x90d5('0x27')](respondWithResult(_0x4e5d16,0xc9))[_0x90d5('0x40')](handleError(_0x4e5d16,null));};exports[_0x90d5('0x49')]=function(_0x38ed41,_0x2a2d84){if(_0x38ed41[_0x90d5('0x48')]['id']){delete _0x38ed41[_0x90d5('0x48')]['id'];}return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x38ed41['params']['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x2a2d84,null))['then'](saveUpdates(_0x38ed41[_0x90d5('0x48')],null))[_0x90d5('0x27')](respondWithResult(_0x2a2d84,null))[_0x90d5('0x40')](handleError(_0x2a2d84,null));};exports[_0x90d5('0x28')]=function(_0x2ce545,_0x1fa33f){return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x2ce545[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x1fa33f,null))['then'](removeEntity(_0x1fa33f,null))['catch'](handleError(_0x1fa33f,null));};exports[_0x90d5('0x4a')]=function(_0x43c8ec,_0x40f035){return db['ChatGroup'][_0x90d5('0x4a')]()[_0x90d5('0x27')](respondWithResult(_0x40f035,null))[_0x90d5('0x40')](handleError(_0x40f035,null));};exports[_0x90d5('0x4b')]=function(_0x3d3726,_0x2e73e3,_0x50d0b2){return db[_0x90d5('0x4c')][_0x90d5('0x22')]({'where':{'ChatGroupId':_0x3d3726[_0x90d5('0x41')]['id'],'ToId':_0x3d3726[_0x90d5('0x4d')]['id'],'read':![]}})['then'](function(_0x38bae3){return{'id':_[_0x90d5('0x4e')](_0x3d3726[_0x90d5('0x41')]['id']),'count':_0x38bae3};})[_0x90d5('0x27')](respondWithResult(_0x2e73e3,null))['catch'](handleError(_0x2e73e3,null));};exports[_0x90d5('0x4f')]=function(_0x1220a7,_0x1e56ac,_0x202b4c){return db['ChatGroup'][_0x90d5('0x46')]({'where':{'id':_0x1220a7[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x1e56ac,null))['then'](function(_0x288d8f){if(_0x288d8f){return _0x288d8f[_0x90d5('0x4f')](_0x1220a7[_0x90d5('0x48')][_0x90d5('0x50')],_['omit'](_0x1220a7['body'],[_0x90d5('0x50'),'id'])||{});}})[_0x90d5('0x27')](respondWithResult(_0x1e56ac,null))[_0x90d5('0x40')](handleError(_0x1e56ac,null));};exports['getMembers']=function(_0x53a8c9,_0x3f95e3,_0x4ca241){var _0x495daa={};var _0x4fd60b={};var _0x5b5f1c;var _0x1bb019;return db['ChatGroup']['findOne']({'where':{'id':_0x53a8c9['params']['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x3f95e3,null))['then'](function(_0xfb6524){if(_0xfb6524){_0x5b5f1c=_0xfb6524;_0x4fd60b[_0x90d5('0x33')]=_['keys'](db[_0x90d5('0x51')]['rawAttributes']);_0x4fd60b[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x53a8c9[_0x90d5('0x31')]);_0x4fd60b['filters']=_[_0x90d5('0x34')](_0x4fd60b[_0x90d5('0x33')],_0x4fd60b[_0x90d5('0x31')]);_0x495daa[_0x90d5('0x43')]=_[_0x90d5('0x34')](_0x4fd60b[_0x90d5('0x33')],qs[_0x90d5('0x35')](_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x35')]));_0x495daa[_0x90d5('0x43')]=_0x495daa[_0x90d5('0x43')][_0x90d5('0x44')]?_0x495daa[_0x90d5('0x43')]:_0x4fd60b[_0x90d5('0x33')];_0x495daa[_0x90d5('0x38')]=qs[_0x90d5('0x39')](_0x53a8c9['query'][_0x90d5('0x39')]);_0x495daa[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_[_0x90d5('0x3b')](_0x53a8c9[_0x90d5('0x31')],_0x4fd60b[_0x90d5('0x32')]));if(_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x3c')]){_0x495daa[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x495daa[_0x90d5('0x3a')],{'$or':_[_0x90d5('0x52')](_0x495daa[_0x90d5('0x43')],function(_0x4d3d40){var _0x3b2109={};_0x3b2109[_0x4d3d40]={'$like':'%'+_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x3c')]+'%'};return _0x3b2109;})});}_0x495daa=_[_0x90d5('0x3d')]({},_0x495daa,_0x53a8c9['options']);return _0x5b5f1c['getMembers'](_0x495daa);}})[_0x90d5('0x27')](function(_0x456137){if(_0x456137){_0x1bb019=_0x456137['length'];if(!_0x53a8c9['query'][_0x90d5('0x36')](_0x90d5('0x37'))){_0x495daa['limit']=qs[_0x90d5('0x21')](_0x53a8c9[_0x90d5('0x31')][_0x90d5('0x21')]);_0x495daa[_0x90d5('0x1f')]=qs['offset'](_0x53a8c9['query'][_0x90d5('0x1f')]);}return _0x5b5f1c[_0x90d5('0x53')](_0x495daa);}})['then'](function(_0x2eab72){if(_0x2eab72){return _0x2eab72?{'count':_0x1bb019,'rows':_0x2eab72}:null;}})[_0x90d5('0x27')](respondWithResult(_0x3f95e3,null))[_0x90d5('0x40')](handleError(_0x3f95e3,null));};exports[_0x90d5('0x54')]=function(_0x1bc26d,_0x28b925,_0x2d35b7){return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x1bc26d[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x28b925,null))[_0x90d5('0x27')](function(_0x345469){if(_0x345469){return _0x345469[_0x90d5('0x54')](_0x1bc26d[_0x90d5('0x31')]['ids']);}})[_0x90d5('0x27')](respondWithStatusCode(_0x28b925,null))[_0x90d5('0x40')](handleError(_0x28b925,null));};exports[_0x90d5('0x55')]=function(_0x3999da,_0x196ed5,_0x3e82ed){if(_0x3999da[_0x90d5('0x48')]['id']){delete _0x3999da[_0x90d5('0x48')]['id'];}return db[_0x90d5('0x2d')][_0x90d5('0x46')]({'where':{'id':_0x3999da[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x196ed5,null))[_0x90d5('0x27')](function(_0x258c3c){if(_0x258c3c){_0x3999da[_0x90d5('0x48')][_0x90d5('0x56')]=_0x258c3c['id'];return db[_0x90d5('0x4c')][_0x90d5('0x47')](_0x3999da[_0x90d5('0x48')]);}})['then'](respondWithResult(_0x196ed5,null))[_0x90d5('0x40')](handleError(_0x196ed5,null));};exports[_0x90d5('0x57')]=function(_0x4ab99c,_0x3249dd,_0xebfbf9){var _0x409917={};var _0x59faf8={};var _0x3f930e;var _0x1f7efe;return db['ChatGroup'][_0x90d5('0x58')]({'where':{'id':_0x4ab99c[_0x90d5('0x41')]['id']}})[_0x90d5('0x27')](handleEntityNotFound(_0x3249dd,null))[_0x90d5('0x27')](function(_0x48e524){if(_0x48e524){_0x3f930e=_0x48e524;_0x59faf8[_0x90d5('0x33')]=_[_0x90d5('0x42')](db['ChatInternalMessage'][_0x90d5('0x2e')]);_0x59faf8[_0x90d5('0x31')]=_[_0x90d5('0x42')](_0x4ab99c[_0x90d5('0x31')]);_0x59faf8[_0x90d5('0x32')]=_[_0x90d5('0x34')](_0x59faf8[_0x90d5('0x33')],_0x59faf8[_0x90d5('0x31')]);_0x409917['attributes']=_[_0x90d5('0x34')](_0x59faf8['model'],qs[_0x90d5('0x35')](_0x4ab99c[_0x90d5('0x31')]['fields']));_0x409917[_0x90d5('0x43')]=_0x409917[_0x90d5('0x43')][_0x90d5('0x44')]?_0x409917[_0x90d5('0x43')]:_0x59faf8['model'];_0x409917['order']=qs[_0x90d5('0x39')](_0x4ab99c[_0x90d5('0x31')]['sort']);_0x409917[_0x90d5('0x3a')]=qs[_0x90d5('0x32')](_['pick'](_0x4ab99c['query'],_0x59faf8[_0x90d5('0x32')]));if(_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x3c')]){_0x409917[_0x90d5('0x3a')]=_[_0x90d5('0x3d')](_0x409917[_0x90d5('0x3a')],{'$or':_['map'](_0x409917['attributes'],function(_0x4ad79b){var _0x5432d6={};_0x5432d6[_0x4ad79b]={'$like':'%'+_0x4ab99c[_0x90d5('0x31')]['filter']+'%'};return _0x5432d6;})});}if(_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x59')]){var _0x54aa84=_0x4ab99c['query'][_0x90d5('0x59')][_0x90d5('0x5a')](',');var _0x32ea3e={};_0x32ea3e[_0x54aa84[0x0]]={'$gte':moment(_0x54aa84[0x1])[_0x90d5('0x5b')](_0x90d5('0x5c'))};_0x409917['where']=_[_0x90d5('0x3d')](_0x409917[_0x90d5('0x3a')],_0x32ea3e);}_0x409917=_[_0x90d5('0x3d')]({},_0x409917,_0x4ab99c[_0x90d5('0x3e')]);return _0x3f930e['getMessages'](_0x409917);}})['then'](function(_0x5ab560){if(_0x5ab560){_0x1f7efe=_0x5ab560['length'];if(!_0x4ab99c['query'][_0x90d5('0x36')](_0x90d5('0x37'))){_0x409917[_0x90d5('0x21')]=qs[_0x90d5('0x21')](_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x21')]);_0x409917['offset']=qs[_0x90d5('0x1f')](_0x4ab99c[_0x90d5('0x31')][_0x90d5('0x1f')]);}return _0x3f930e[_0x90d5('0x57')](_0x409917);}})[_0x90d5('0x27')](function(_0x104688){if(_0x104688){return _0x104688?{'count':_0x1f7efe,'rows':_0x104688}:null;}})[_0x90d5('0x27')](respondWithResult(_0x3249dd,null))['catch'](handleError(_0x3249dd,null));};
\ No newline at end of file
index 5386afe..2af53c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3504=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x3504,0xce));var _0x4350=function(_0x53aad7,_0x3964c7){_0x53aad7=_0x53aad7-0x0;var _0x3be51e=_0x3504[_0x53aad7];return _0x3be51e;};'use strict';var EventEmitter=require(_0x4350('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4350('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4350('0x2'),'afterDestroy':_0x4350('0x3')};function emitEvent(_0x568470){return function(_0x1b5485,_0x3b0f42,_0x5aa5a3){ChatGroupEvents[_0x4350('0x4')](_0x568470+':'+_0x1b5485['id'],_0x1b5485);ChatGroupEvents[_0x4350('0x4')](_0x568470,_0x1b5485);_0x5aa5a3(null);};}for(var e in events){if(events[_0x4350('0x5')](e)){var event=events[e];ChatGroup[_0x4350('0x6')](e,emitEvent(event));}}module[_0x4350('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x340b=['setMaxListeners','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x8727fd,_0xdd4faa){var _0x1a3588=function(_0x5a514c){while(--_0x5a514c){_0x8727fd['push'](_0x8727fd['shift']());}};_0x1a3588(++_0xdd4faa);}(_0x340b,0x1b6));var _0xb340=function(_0x3c6f22,_0x4618d4){_0x3c6f22=_0x3c6f22-0x0;var _0x5dc5be=_0x340b[_0x3c6f22];return _0x5dc5be;};'use strict';var EventEmitter=require(_0xb340('0x0'));var ChatGroup=require(_0xb340('0x1'))['db'][_0xb340('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xb340('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5d2004){return function(_0x4a0526,_0x25a9b4,_0x1a7822){ChatGroupEvents[_0xb340('0x4')](_0x5d2004+':'+_0x4a0526['id'],_0x4a0526);ChatGroupEvents['emit'](_0x5d2004,_0x4a0526);_0x1a7822(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xb340('0x5')](e,emitEvent(event));}}module[_0xb340('0x6')]=ChatGroupEvents;
\ No newline at end of file
index b42bfce..6a5651f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b82=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4b82,0xb6));var _0x24b8=function(_0x1b3564,_0x16c919){_0x1b3564=_0x1b3564-0x0;var _0x504069=_0x4b82[_0x1b3564];return _0x504069;};'use strict';var _=require(_0x24b8('0x0'));var util=require(_0x24b8('0x1'));var logger=require(_0x24b8('0x2'))(_0x24b8('0x3'));var moment=require(_0x24b8('0x4'));var BPromise=require(_0x24b8('0x5'));var rp=require(_0x24b8('0x6'));var fs=require('fs');var path=require(_0x24b8('0x7'));var rimraf=require(_0x24b8('0x8'));var config=require(_0x24b8('0x9'));var attributes=require(_0x24b8('0xa'));module[_0x24b8('0xb')]=function(_0x2d82e0,_0x28c432){return _0x2d82e0[_0x24b8('0xc')](_0x24b8('0xd'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe18b=['ChatGroup','chat_groups','lodash','util','api','moment','request-promise','path','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe18b,0x1a6));var _0xbe18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe18b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbe18('0x0'));var util=require(_0xbe18('0x1'));var logger=require('../../config/logger')(_0xbe18('0x2'));var moment=require(_0xbe18('0x3'));var BPromise=require('bluebird');var rp=require(_0xbe18('0x4'));var fs=require('fs');var path=require(_0xbe18('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module[_0xbe18('0x6')]=function(_0x684159,_0x165d09){return _0x684159[_0xbe18('0x7')](_0xbe18('0x8'),attributes,{'tableName':_0xbe18('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cca9a8d..4dd749e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf88f=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3e19e3,_0x232e8c){var _0x59e523=function(_0x4a9240){while(--_0x4a9240){_0x3e19e3['push'](_0x3e19e3['shift']());}};_0x59e523(++_0x232e8c);}(_0xf88f,0x1bb));var _0xff88=function(_0x19b31d,_0x4ec9aa){_0x19b31d=_0x19b31d-0x0;var _0x498fbf=_0xf88f[_0x19b31d];return _0x498fbf;};'use strict';var _=require(_0xff88('0x0'));var util=require(_0xff88('0x1'));var moment=require(_0xff88('0x2'));var BPromise=require(_0xff88('0x3'));var rs=require(_0xff88('0x4'));var fs=require('fs');var Redis=require(_0xff88('0x5'));var db=require(_0xff88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xff88('0x7'))(_0xff88('0x8'));var config=require(_0xff88('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff88('0xa')][_0xff88('0xb')]({'port':0x232a});config[_0xff88('0xc')]=_[_0xff88('0xd')](config[_0xff88('0xc')],{'host':_0xff88('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xff88('0xc')]));require(_0xff88('0xf'))[_0xff88('0x10')](socket);function respondWithRpcPromise(_0x4715fc,_0x3d5534,_0x3dcefc){return new BPromise(function(_0x22bca3,_0x178fc4){return client[_0xff88('0x11')](_0x4715fc,_0x3dcefc)[_0xff88('0x12')](function(_0xc1ee70){logger[_0xff88('0x13')](_0xff88('0x14'),_0x3d5534,_0xff88('0x15'));logger[_0xff88('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3d5534,_0xff88('0x15'),JSON[_0xff88('0x17')](_0xc1ee70));if(_0xc1ee70[_0xff88('0x18')]){if(_0xc1ee70['error'][_0xff88('0x19')]===0x1f4){logger[_0xff88('0x18')](_0xff88('0x14'),_0x3d5534,_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);return _0x178fc4(_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);}logger[_0xff88('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3d5534,_0xc1ee70[_0xff88('0x18')][_0xff88('0x1a')]);return _0x22bca3(_0xc1ee70['error']['message']);}else{logger[_0xff88('0x13')](_0xff88('0x14'),_0x3d5534,'request\x20sent');_0x22bca3(_0xc1ee70[_0xff88('0x1b')][_0xff88('0x1a')]);}})['catch'](function(_0x2bafb1){logger[_0xff88('0x18')](_0xff88('0x14'),_0x3d5534,_0x2bafb1);_0x178fc4(_0x2bafb1);});});}
\ No newline at end of file
+var _0xbdba=['redis','defaults','socket.io-emitter','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0xbdba,0x107));var _0xabdb=function(_0x732d54,_0x5708f4){_0x732d54=_0x732d54-0x0;var _0x55e766=_0xbdba[_0x732d54];return _0x55e766;};'use strict';var _=require(_0xabdb('0x0'));var util=require('util');var moment=require(_0xabdb('0x1'));var BPromise=require(_0xabdb('0x2'));var rs=require(_0xabdb('0x3'));var fs=require('fs');var Redis=require(_0xabdb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xabdb('0x5'));var logger=require(_0xabdb('0x6'))('rpc');var config=require(_0xabdb('0x7'));var jayson=require(_0xabdb('0x8'));var client=jayson[_0xabdb('0x9')]['http']({'port':0x232a});config[_0xabdb('0xa')]=_[_0xabdb('0xb')](config[_0xabdb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xabdb('0xc'))(new Redis(config[_0xabdb('0xa')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x31227e,_0x4c0c1d,_0x418d19){return new BPromise(function(_0x365c4d,_0x5a258e){return client['request'](_0x31227e,_0x418d19)['then'](function(_0x163861){logger[_0xabdb('0xd')](_0xabdb('0xe'),_0x4c0c1d,_0xabdb('0xf'));logger[_0xabdb('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x4c0c1d,_0xabdb('0xf'),JSON[_0xabdb('0x11')](_0x163861));if(_0x163861[_0xabdb('0x12')]){if(_0x163861[_0xabdb('0x12')]['code']===0x1f4){logger[_0xabdb('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,_0x163861[_0xabdb('0x12')]['message']);return _0x5a258e(_0x163861[_0xabdb('0x12')][_0xabdb('0x13')]);}logger[_0xabdb('0x12')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,_0x163861['error'][_0xabdb('0x13')]);return _0x365c4d(_0x163861[_0xabdb('0x12')][_0xabdb('0x13')]);}else{logger[_0xabdb('0xd')]('ChatGroup,\x20%s,\x20%s',_0x4c0c1d,'request\x20sent');_0x365c4d(_0x163861['result']['message']);}})[_0xabdb('0x14')](function(_0x3ec1a){logger[_0xabdb('0x12')](_0xabdb('0xe'),_0x4c0c1d,_0x3ec1a);_0x5a258e(_0x3ec1a);});});}
\ No newline at end of file
index cd9a837..73dd5d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e68=['save','remove','emit','removeListener','register','length','./chatGroup.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e68,0x1e2));var _0x88e6=function(_0x277a4a,_0x4300e0){_0x277a4a=_0x277a4a-0x0;var _0x404ea6=_0x8e68[_0x277a4a];return _0x404ea6;};'use strict';var ChatGroupEvents=require(_0x88e6('0x0'));var events=[_0x88e6('0x1'),_0x88e6('0x2'),'update'];function createListener(_0x3acbaa,_0x10d1bf){return function(_0x10e2be){_0x10d1bf[_0x88e6('0x3')](_0x3acbaa,_0x10e2be);};}function removeListener(_0x5b83f7,_0x596e97){return function(){ChatGroupEvents[_0x88e6('0x4')](_0x5b83f7,_0x596e97);};}exports[_0x88e6('0x5')]=function(_0x34a1cc){for(var _0x5a214c=0x0,_0x100b9e=events[_0x88e6('0x6')];_0x5a214c<_0x100b9e;_0x5a214c++){var _0x1c72f4=events[_0x5a214c];var _0x5aea6c=createListener('chatGroup:'+_0x1c72f4,_0x34a1cc);ChatGroupEvents['on'](_0x1c72f4,_0x5aea6c);}};
\ No newline at end of file
+var _0xcc51=['length','chatGroup:','save','remove','update','emit','removeListener','register'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0xcc51,0xea));var _0x1cc5=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xcc51[_0xd1d19a];return _0x52a79d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x1cc5('0x0'),_0x1cc5('0x1'),_0x1cc5('0x2')];function createListener(_0x242c0d,_0x104e14){return function(_0x275837){_0x104e14[_0x1cc5('0x3')](_0x242c0d,_0x275837);};}function removeListener(_0x52153e,_0x18ab2a){return function(){ChatGroupEvents[_0x1cc5('0x4')](_0x52153e,_0x18ab2a);};}exports[_0x1cc5('0x5')]=function(_0x25d870){for(var _0x5d32ad=0x0,_0x551dab=events[_0x1cc5('0x6')];_0x5d32ad<_0x551dab;_0x5d32ad++){var _0x5efc9b=events[_0x5d32ad];var _0x351bfd=createListener(_0x1cc5('0x7')+_0x5efc9b,_0x25d870);ChatGroupEvents['on'](_0x5efc9b,_0x351bfd);}};
\ No newline at end of file
index 39cbe4f..1a87b22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x452e=['/:id/messages','post','/:id/members','addMembers','addMessage','put','update','destroy','delete','removeMembers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x452e,0x96));var _0xe452=function(_0x5d64b0,_0x27840e){_0x5d64b0=_0x5d64b0-0x0;var _0x1f7342=_0x452e[_0x5d64b0];return _0x1f7342;};'use strict';var multer=require(_0xe452('0x0'));var util=require(_0xe452('0x1'));var path=require('path');var timeout=require(_0xe452('0x2'));var express=require(_0xe452('0x3'));var router=express[_0xe452('0x4')]();var fs_extra=require(_0xe452('0x5'));var auth=require(_0xe452('0x6'));var interaction=require(_0xe452('0x7'));var config=require(_0xe452('0x8'));var controller=require('./chatGroup.controller');router[_0xe452('0x9')]('/',auth[_0xe452('0xa')](),controller[_0xe452('0xb')]);router[_0xe452('0x9')](_0xe452('0xc'),auth[_0xe452('0xa')](),controller[_0xe452('0xd')]);router[_0xe452('0x9')](_0xe452('0xe'),auth[_0xe452('0xa')](),controller[_0xe452('0xf')]);router[_0xe452('0x9')](_0xe452('0x10'),auth[_0xe452('0xa')](),controller[_0xe452('0x11')]);router[_0xe452('0x9')]('/:id/members',auth[_0xe452('0xa')](),controller['getMembers']);router[_0xe452('0x9')](_0xe452('0x12'),auth[_0xe452('0xa')](),controller['getMessages']);router[_0xe452('0x13')]('/',auth[_0xe452('0xa')](),controller['create']);router[_0xe452('0x13')](_0xe452('0x14'),auth[_0xe452('0xa')](),controller[_0xe452('0x15')]);router[_0xe452('0x13')](_0xe452('0x12'),auth[_0xe452('0xa')](),controller[_0xe452('0x16')]);router[_0xe452('0x17')](_0xe452('0xe'),auth['isAuthenticated'](),controller[_0xe452('0x18')]);router['delete'](_0xe452('0xe'),auth[_0xe452('0xa')](),controller[_0xe452('0x19')]);router[_0xe452('0x1a')]('/:id/members',auth[_0xe452('0xa')](),controller[_0xe452('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0x14ae=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','put','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','index','get','isAuthenticated','describe','/:id'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x14ae,0x152));var _0xe14a=function(_0x531da8,_0x1e61b1){_0x531da8=_0x531da8-0x0;var _0x3901a0=_0x14ae[_0x531da8];return _0x3901a0;};'use strict';var multer=require(_0xe14a('0x0'));var util=require(_0xe14a('0x1'));var path=require(_0xe14a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe14a('0x3'));var router=express[_0xe14a('0x4')]();var fs_extra=require(_0xe14a('0x5'));var auth=require(_0xe14a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe14a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe14a('0x8')]);router[_0xe14a('0x9')]('/describe',auth[_0xe14a('0xa')](),controller[_0xe14a('0xb')]);router[_0xe14a('0x9')](_0xe14a('0xc'),auth[_0xe14a('0xa')](),controller[_0xe14a('0xd')]);router[_0xe14a('0x9')](_0xe14a('0xe'),auth[_0xe14a('0xa')](),controller[_0xe14a('0xf')]);router['get'](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller['getMembers']);router[_0xe14a('0x9')](_0xe14a('0x11'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x12')]);router['post']('/',auth[_0xe14a('0xa')](),controller[_0xe14a('0x13')]);router[_0xe14a('0x14')](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x15')]);router[_0xe14a('0x14')](_0xe14a('0x11'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x16')]);router[_0xe14a('0x17')](_0xe14a('0xc'),auth[_0xe14a('0xa')](),controller[_0xe14a('0x18')]);router[_0xe14a('0x19')]('/:id',auth[_0xe14a('0xa')](),controller[_0xe14a('0x1a')]);router[_0xe14a('0x19')](_0xe14a('0x10'),auth[_0xe14a('0xa')](),controller['removeMembers']);module['exports']=router;
\ No newline at end of file
index 350cabf..d75b215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce3a=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','sequelize','exports','BOOLEAN'];(function(_0x893787,_0x2ecfe4){var _0x4d2cb0=function(_0x486640){while(--_0x486640){_0x893787['push'](_0x893787['shift']());}};_0x4d2cb0(++_0x2ecfe4);}(_0xce3a,0x194));var _0xace3=function(_0x37fadf,_0xb0cf13){_0x37fadf=_0x37fadf-0x0;var _0x5b8739=_0xce3a[_0x37fadf];return _0x5b8739;};'use strict';var Sequelize=require(_0xace3('0x0'));module[_0xace3('0x1')]={'closed':{'type':Sequelize[_0xace3('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xace3('0x3')]},'ratingType':{'type':Sequelize[_0xace3('0x4')](_0xace3('0x5'),_0xace3('0x6')),'defaultValue':_0xace3('0x5')},'ratingMessage':{'type':Sequelize[_0xace3('0x7')]},'pathTranscript':{'type':Sequelize[_0xace3('0x7')]},'mailTranscript':{'type':Sequelize[_0xace3('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xace3('0x9')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xace3('0x8')]},'thirdDisposition':{'type':Sequelize[_0xace3('0x8')]},'note':{'type':Sequelize[_0xace3('0x8')]},'browserName':{'type':Sequelize[_0xace3('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xace3('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xace3('0x8')]},'deviceVendor':{'type':Sequelize[_0xace3('0x8')]},'deviceType':{'type':Sequelize[_0xace3('0x8')]},'referer':{'type':Sequelize[_0xace3('0x7')]},'customerIp':{'type':Sequelize[_0xace3('0x8')]},'formData':{'type':Sequelize[_0xace3('0x7')](_0xace3('0xa'))},'read1stAt':{'type':Sequelize[_0xace3('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xace3('0x8')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xace3('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0c71=['BOOLEAN','exports','INTEGER','ENUM','star','TEXT','STRING','DATE','long','out'];(function(_0x16938f,_0x35e57f){var _0x5c66e9=function(_0x5167d7){while(--_0x5167d7){_0x16938f['push'](_0x16938f['shift']());}};_0x5c66e9(++_0x35e57f);}(_0x0c71,0xfb));var _0x10c7=function(_0x2474b0,_0x464f13){_0x2474b0=_0x2474b0-0x0;var _0x3c1022=_0x0c71[_0x2474b0];return _0x3c1022;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x10c7('0x1')]},'ratingType':{'type':Sequelize[_0x10c7('0x2')](_0x10c7('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x10c7('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x10c7('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x10c7('0x6')]},'disposition':{'type':Sequelize[_0x10c7('0x5')]},'secondDisposition':{'type':Sequelize[_0x10c7('0x5')]},'thirdDisposition':{'type':Sequelize[_0x10c7('0x5')]},'note':{'type':Sequelize[_0x10c7('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x10c7('0x5')]},'osName':{'type':Sequelize[_0x10c7('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x10c7('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x10c7('0x4')]},'customerIp':{'type':Sequelize[_0x10c7('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x10c7('0x7'))},'read1stAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgAt':{'type':Sequelize[_0x10c7('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x10c7('0x2')]('in',_0x10c7('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x10c7('0x5')]},'customerPort':{'type':Sequelize[_0x10c7('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x10c7('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x10c7('0x9')],'defaultValue':![]}};
\ No newline at end of file
index dc896d8..62651f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3677=['query','user','show','params','model','keys','intersection','attributes','includeAll','include','create','body','update','find','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','close','root','server/files/chat/upload/','now','pathTranscript','ChatMessage','Messages','ContactId','format','%s%d','agentAlias','UserId','System','customer','Visitor','User','alias','fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','addMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','fields','includeAgent','push','rows','addTags','setTags','spread','Tag','color','emit','chatInteractionTags:save','removeTags','download','unix','toString','server','tmp','files','attachments','transcript-%d-%s.zip','firstName','createdAt','read','Account','Owner','get','N.A.','browserName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','renderFile','views','transcript-','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','../../components/interaction/service','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','end','status','json','undefined','limit','offset','count','Content-Range','then','destroy','name','render','merge','contact','interaction','index','map','ChatInteraction','rawAttributes','type','key','getOptions','chat'];(function(_0x57c16a,_0x31eedc){var _0x506317=function(_0x5f192d){while(--_0x5f192d){_0x57c16a['push'](_0x57c16a['shift']());}};_0x506317(++_0x31eedc);}(_0x3677,0x163));var _0x7367=function(_0x1bc7fb,_0x1a6fa8){_0x1bc7fb=_0x1bc7fb-0x0;var _0x348f52=_0x3677[_0x1bc7fb];return _0x348f52;};'use strict';var rimraf=require(_0x7367('0x0'));var zipdir=require(_0x7367('0x1'));var rp=require(_0x7367('0x2'));var moment=require(_0x7367('0x3'));var BPromise=require(_0x7367('0x4'));var Mustache=require(_0x7367('0x5'));var util=require(_0x7367('0x6'));var path=require(_0x7367('0x7'));var ejs=require(_0x7367('0x8'));var fs=require('fs');var _=require(_0x7367('0x9'));var Redis=require('ioredis');var interaction=require(_0x7367('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0x7367('0xb'));var logger=require('../../config/logger')(_0x7367('0xc'));var config=require(_0x7367('0xd'));var db=require(_0x7367('0xe'))['db'];config[_0x7367('0xf')]=_[_0x7367('0x10')](config[_0x7367('0xf')],{'host':_0x7367('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7367('0xf')]));require(_0x7367('0x12'))[_0x7367('0x13')](socket);var jayson=require(_0x7367('0x14'));var client=jayson[_0x7367('0x15')][_0x7367('0x16')]({'port':0x232b});var client9004=jayson[_0x7367('0x15')]['http']({'port':0x232c});function respondWithRpcPromise(_0x3291a6,_0x531e8f,_0x4c7ace,_0x28d7ad){return new BPromise(function(_0x3468af,_0x4f75fe){var _0xd4df9c=_0x28d7ad||client;return _0xd4df9c[_0x7367('0x17')](_0x3291a6,_0x4c7ace)['then'](function(_0x34ea47){logger[_0x7367('0x18')](_0x7367('0x19'),_0x531e8f,'request\x20sent');logger['debug'](_0x7367('0x1a'),_0x531e8f,_0x7367('0x1b'),JSON[_0x7367('0x1c')](_0x34ea47));if(_0x34ea47['error']){if(_0x34ea47[_0x7367('0x1d')][_0x7367('0x1e')]===0x1f4){logger['error'](_0x7367('0x19'),_0x531e8f,_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);return _0x4f75fe(_0x34ea47['error'][_0x7367('0x1f')]);}logger[_0x7367('0x1d')](_0x7367('0x19'),_0x531e8f,_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);return _0x3468af(_0x34ea47[_0x7367('0x1d')][_0x7367('0x1f')]);}else{logger[_0x7367('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x531e8f,_0x7367('0x1b'));_0x3468af(_0x34ea47[_0x7367('0x20')][_0x7367('0x1f')]);}})[_0x7367('0x21')](function(_0x1af053){logger['error'](_0x7367('0x19'),_0x531e8f,_0x1af053);_0x4f75fe(_0x1af053);});});}function respondWithStatusCode(_0x11ce72,_0x36a4f4){_0x36a4f4=_0x36a4f4||0xcc;return function(_0x542748){if(_0x542748){return _0x11ce72['sendStatus'](_0x36a4f4);}return _0x11ce72['status'](_0x36a4f4)[_0x7367('0x22')]();};}function respondWithResult(_0x3907e8,_0x54c835){_0x54c835=_0x54c835||0xc8;return function(_0x5385bd){if(_0x5385bd){return _0x3907e8[_0x7367('0x23')](_0x54c835)[_0x7367('0x24')](_0x5385bd);}};}function respondWithFilteredResult(_0xb5d3dd,_0x2a2a21){return function(_0x4226b3){if(_0x4226b3){var _0x2c946b=typeof _0x2a2a21['offset']===_0x7367('0x25')&&typeof _0x2a2a21[_0x7367('0x26')]==='undefined';var _0x1e721b=_0x4226b3['count'];var _0x4e44f4=_0x2c946b?0x0:_0x2a2a21[_0x7367('0x27')];var _0x1fa03a=_0x2c946b?_0x4226b3[_0x7367('0x28')]:_0x2a2a21[_0x7367('0x27')]+_0x2a2a21[_0x7367('0x26')];var _0x292b3a;if(_0x1fa03a>=_0x1e721b){_0x1fa03a=_0x1e721b;_0x292b3a=0xc8;}else{_0x292b3a=0xce;}_0xb5d3dd[_0x7367('0x23')](_0x292b3a);return _0xb5d3dd['set'](_0x7367('0x29'),_0x4e44f4+'-'+_0x1fa03a+'/'+_0x1e721b)['json'](_0x4226b3);}return null;};}function saveUpdates(_0x469522){return function(_0xa04d1f){if(_0xa04d1f){return _0xa04d1f['update'](_0x469522)[_0x7367('0x2a')](function(_0x5355b1){return _0x5355b1;});}return null;};}function removeEntity(_0x4f4a6d){return function(_0x171647){if(_0x171647){return _0x171647[_0x7367('0x2b')]()[_0x7367('0x2a')](function(){_0x4f4a6d[_0x7367('0x23')](0xcc)[_0x7367('0x22')]();});}};}function handleEntityNotFound(_0x168eb5){return function(_0x15f272){if(!_0x15f272){_0x168eb5['sendStatus'](0x194);}return _0x15f272;};}function handleError(_0x554b0a,_0x36ed08){_0x36ed08=_0x36ed08||0x1f4;return function(_0x3d86a5){logger['error'](_0x3d86a5['stack']);if(_0x3d86a5[_0x7367('0x2c')]){delete _0x3d86a5[_0x7367('0x2c')];}_0x554b0a['status'](_0x36ed08)['send'](_0x3d86a5);};}function getMustacheRender(_0x543c90,_0x57361c){return Mustache[_0x7367('0x2d')](_0x543c90,_[_0x7367('0x2e')](_0x57361c['body'],{'contact':_0x57361c[_0x7367('0x2f')],'message':_0x57361c[_0x7367('0x1f')],'agent':_0x57361c['agent'],'interaction':_0x57361c[_0x7367('0x30')],'account':_0x57361c['account']}))||'';}exports[_0x7367('0x31')]=function(_0x52d920,_0x831a39){var _0xae077c={};var _0x209c13=_[_0x7367('0x32')](db[_0x7367('0x33')][_0x7367('0x34')],function(_0x201042){return{'name':_0x201042['fieldName'],'type':_0x201042[_0x7367('0x35')][_0x7367('0x36')]};});_0xae077c=qs[_0x7367('0x37')](_0x209c13,_0x52d920);return interaction['findAll'](_0x7367('0x38'),_0x52d920[_0x7367('0x39')],_0x52d920[_0x7367('0x3a')],_0xae077c,_0x209c13)[_0x7367('0x2a')](respondWithFilteredResult(_0x831a39,_0xae077c))[_0x7367('0x21')](handleError(_0x831a39,null));};exports[_0x7367('0x3b')]=function(_0x57f915,_0x474ec3){var _0x3645a8={'raw':![],'where':{'id':_0x57f915[_0x7367('0x3c')]['id']}},_0x185d3f={};_0x185d3f[_0x7367('0x3d')]=_[_0x7367('0x3e')](db[_0x7367('0x33')]['rawAttributes']);_0x185d3f[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x57f915[_0x7367('0x39')]);_0x185d3f['filters']=_[_0x7367('0x3f')](_0x185d3f[_0x7367('0x3d')],_0x185d3f[_0x7367('0x39')]);_0x3645a8[_0x7367('0x40')]=_[_0x7367('0x3f')](_0x185d3f[_0x7367('0x3d')],qs['fields'](_0x57f915[_0x7367('0x39')]['fields']));_0x3645a8[_0x7367('0x40')]=_0x3645a8[_0x7367('0x40')]['length']?_0x3645a8['attributes']:_0x185d3f['model'];if(_0x57f915[_0x7367('0x39')][_0x7367('0x41')]){_0x3645a8[_0x7367('0x42')]=[{'all':!![]}];}_0x3645a8=_[_0x7367('0x2e')]({},_0x3645a8,_0x57f915['options']);return db['ChatInteraction']['find'](_0x3645a8)[_0x7367('0x2a')](handleEntityNotFound(_0x474ec3,null))['then'](respondWithResult(_0x474ec3,null))[_0x7367('0x21')](handleError(_0x474ec3,null));};exports['create']=function(_0x3337d4,_0x5b6ef2){return db[_0x7367('0x33')][_0x7367('0x43')](_0x3337d4[_0x7367('0x44')],{})[_0x7367('0x2a')](respondWithResult(_0x5b6ef2,0xc9))[_0x7367('0x21')](handleError(_0x5b6ef2,null));};exports[_0x7367('0x45')]=function(_0x4a6824,_0x4118bc){if(_0x4a6824['body']['id']){delete _0x4a6824[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x4a6824[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4118bc,null))[_0x7367('0x2a')](saveUpdates(_0x4a6824['body'],null))[_0x7367('0x2a')](respondWithResult(_0x4118bc,null))[_0x7367('0x21')](handleError(_0x4118bc,null));};exports[_0x7367('0x2b')]=function(_0x43b55c,_0xf242ae){return db['ChatInteraction'][_0x7367('0x46')]({'where':{'id':_0x43b55c['params']['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0xf242ae,null))[_0x7367('0x2a')](removeEntity(_0xf242ae,null))[_0x7367('0x21')](handleError(_0xf242ae,null));};exports[_0x7367('0x47')]=function(_0x19541b,_0x200cad){return db['ChatInteraction'][_0x7367('0x47')]()[_0x7367('0x2a')](respondWithResult(_0x200cad,null))['catch'](handleError(_0x200cad,null));};exports['createVidaooSession']=function(_0x426f98,_0x2d999a){var _0x18a2e4=_0x426f98[_0x7367('0x3c')]['id'];var _0x24c703;var _0x5d3953;var _0x1a3c2e;return db['ChatInteraction'][_0x7367('0x48')]({'where':{'id':_0x18a2e4}})[_0x7367('0x2a')](function(_0x4dea20){_0x24c703=_0x4dea20;return db[_0x7367('0x49')][_0x7367('0x48')]({'where':{'id':_0x4dea20[_0x7367('0x4a')]},'attributes':['id',_0x7367('0x4b'),_0x7367('0x4c'),_0x7367('0x4d'),_0x7367('0x4e'),_0x7367('0x4f')],'raw':!![]});})[_0x7367('0x2a')](function(_0xf59466){if(_0xf59466&&_0xf59466['vidaooApiKey']&&_0xf59466[_0x7367('0x4c')]){_0x5d3953=_0xf59466;var _0x54c626={'interaction':{'id':_0x18a2e4},'agent':{'id':_0x426f98[_0x7367('0x3a')]['id'],'name':_0x426f98[_0x7367('0x3a')][_0x7367('0x2c')],'fullname':_0x426f98['user']['fullname'],'email':_0x426f98['user']['email']},'contact':_0x426f98[_0x7367('0x44')][_0x7367('0x2f')],'account':_0x426f98[_0x7367('0x44')]['account']};var _0x1633c5={'rejectUnauthorized':![],'method':'POST','url':_0x7367('0x50'),'headers':{'X-APIKEY':_0xf59466['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x426f98[_0x7367('0x3a')]['email']],'buttons':null,'topic':_0x5d3953[_0x7367('0x4d')],'note':_[_0x7367('0x51')](_0x5d3953[_0x7367('0x4e')])?null:getMustacheRender(_0x5d3953[_0x7367('0x4e')],_0x54c626),'metadata':null},'redirect':_0x7367('0x52'),'json':!![]};try{if(!_[_0x7367('0x51')](_0x5d3953[_0x7367('0x4f')])){var _0x4b0baf=getMustacheRender(_0x5d3953[_0x7367('0x4f')],_0x54c626);var _0x260953=JSON[_0x7367('0x53')](_0x4b0baf);_0x1633c5[_0x7367('0x44')][_0x7367('0x54')]=_0x260953;}}catch(_0x469e07){throw new db[(_0x7367('0x55'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x1633c5);}else{throw new db[(_0x7367('0x55'))][(_0x7367('0x56'))](_0x7367('0x57'));}})[_0x7367('0x2a')](function(_0x3d3d21){_0x1a3c2e=_0x3d3d21;if(_0x1a3c2e['id']){var _0x55492f={'body':_0x1a3c2e[_0x7367('0x58')],'ChatWebsiteId':_0x5d3953['id'],'ChatInteractionId':_0x24c703['id'],'direction':_0x7367('0x59'),'UserId':_0x426f98[_0x7367('0x3a')]['id']};return db['ChatMessage'][_0x7367('0x43')](_0x55492f,{});}else{throw new db['Sequelize']['ValidationError'](_0x7367('0x5a'));}})[_0x7367('0x2a')](function(){return _0x24c703[_0x7367('0x5b')]({'vidaooSessionId':_0x1a3c2e['id']});})['then'](respondWithResult(_0x2d999a,null))[_0x7367('0x21')](handleError(_0x2d999a,null));};exports[_0x7367('0x5c')]=function(_0x5f5517,_0x3f8def){if(_0x5f5517[_0x7367('0x44')]['id']){delete _0x5f5517[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')]['find']({'where':{'id':_0x5f5517[_0x7367('0x3c')]['id']},'include':[{'model':db[_0x7367('0x5d')],'as':_0x7367('0x5e')}]})['then'](handleEntityNotFound(_0x3f8def,null))[_0x7367('0x2a')](saveUpdates(_0x5f5517[_0x7367('0x44')],null))['then'](respondWithResult(_0x3f8def,null))[_0x7367('0x21')](handleError(_0x3f8def,null));};exports[_0x7367('0x5f')]=function(_0x5c0d43,_0x2b3be9){if(_0x5c0d43[_0x7367('0x44')]['id']){delete _0x5c0d43[_0x7367('0x44')]['id'];}return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x5c0d43[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](function(_0x3eeaa0){if(!_0x3eeaa0){logger[_0x7367('0x1d')](_0x7367('0x60'),'abandon',0x194,_0x7367('0x61'));_0x2b3be9[_0x7367('0x62')](0x194);}else{if(_0x3eeaa0['UserId']){throw new db['Sequelize'][(_0x7367('0x56'))](_0x7367('0x63'));}}return _0x3eeaa0;})[_0x7367('0x2a')](function(_0x14c8b4){if(_0x14c8b4){return _0x14c8b4['update']({'closed':_0x5c0d43[_0x7367('0x44')][_0x7367('0x64')],'disposition':_0x5c0d43[_0x7367('0x44')][_0x7367('0x65')]})[_0x7367('0x2a')](function(_0x2d6ebd){return _0x2d6ebd;});}})[_0x7367('0x2a')](function(){return respondWithRpcPromise('AbandonInteraction',_0x7367('0x5f'),_0x5c0d43[_0x7367('0x44')],client9004);})[_0x7367('0x2a')](respondWithResult(_0x2b3be9,null))[_0x7367('0x21')](handleError(_0x2b3be9,null));};exports[_0x7367('0x66')]=function(_0x1c194,_0x5ce300){_0x1c194[_0x7367('0x44')]['name']=_0x1c194[_0x7367('0x67')][_0x7367('0x68')];_0x1c194['body'][_0x7367('0x69')]=_0x1c194[_0x7367('0x67')][_0x7367('0x6a')];_0x1c194[_0x7367('0x44')][_0x7367('0x35')]=_0x1c194[_0x7367('0x67')][_0x7367('0x6b')];return db[_0x7367('0x6c')][_0x7367('0x43')](_0x1c194[_0x7367('0x44')])['then'](respondWithResult(_0x5ce300,0xc9))[_0x7367('0x21')](handleError(_0x5ce300,null));};exports[_0x7367('0x6d')]=function(_0x5cae34,_0x34750b){return db[_0x7367('0x33')][_0x7367('0x48')]({'where':{'id':_0x5cae34[_0x7367('0x3c')]['id']},'raw':!![]})[_0x7367('0x2a')](handleEntityNotFound(_0x34750b,null))[_0x7367('0x2a')](function(_0x3c975a){if(_0x3c975a){if(_0x3c975a[_0x7367('0x64')]){return _0x34750b[_0x7367('0x23')](0x193)['json']({'status':0x193,'message':_0x7367('0x6e')});}return db[_0x7367('0x6c')][_0x7367('0x48')]({'where':{'id':_0x5cae34[_0x7367('0x39')][_0x7367('0x6f')]},'raw':!![]})[_0x7367('0x2a')](handleEntityNotFound(_0x34750b,null));}})[_0x7367('0x2a')](function(_0x49812c){if(_0x49812c){var _0xfad70c=_0x49812c[_0x7367('0x70')]!==null;var _0x2e08c6=path[_0x7367('0x71')](config['root'],_0x7367('0x72'));if(_0xfad70c){_0x2e08c6=path[_0x7367('0x71')](_0x2e08c6,'offline-chat/');}var _0xcdc967=path['join'](_0x2e08c6,_0x49812c[_0x7367('0x69')]);return _0x34750b['download'](_0xcdc967);}})[_0x7367('0x21')](handleError(_0x34750b,null));};exports[_0x7367('0x73')]=function(_0xc51323,_0x29d04e){var _0x2d4e26=null;var _0x46c264=null;var _0x222fcd=null;if(_0xc51323[_0x7367('0x44')]['id']){delete _0xc51323['body']['id'];}if(_0xc51323[_0x7367('0x44')]['mailTranscript']){_0x222fcd=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0x75'),util['format']('transcript-%s.txt',Date[_0x7367('0x76')]()));_0xc51323[_0x7367('0x44')][_0x7367('0x77')]=_0x222fcd;}return db[_0x7367('0x33')]['find']({'where':{'id':_0xc51323[_0x7367('0x3c')]['id']},'include':[{'model':db[_0x7367('0x78')],'as':_0x7367('0x79'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x7367('0x2a')](handleEntityNotFound(_0x29d04e,null))['then'](saveUpdates(_0xc51323[_0x7367('0x44')],null))[_0x7367('0x2a')](function(_0x289e30){if(_0x289e30){_0x2d4e26=_0x289e30;return db['ChatWebsite'][_0x7367('0x46')]({'where':{'id':_0x2d4e26[_0x7367('0x4a')]}});}})['then'](function(_0x8a9cd3){if(_0x8a9cd3){_0x46c264=_0x8a9cd3;return db[_0x7367('0x5d')][_0x7367('0x46')]({'where':{'id':_0x2d4e26[_0x7367('0x7a')]}});}})[_0x7367('0x2a')](function(_0x1f7baf){if(_0x1f7baf){if(_0x222fcd){var _0x3e439c=null;for(var _0x4d3c25=0x1;_0x4d3c25<_0x2d4e26['Messages']['length'];++_0x4d3c25){_0x3e439c=_0x2d4e26[_0x7367('0x79')][_0x4d3c25];var _0x37378a=_0x3e439c['UserId']?util[_0x7367('0x7b')](_0x7367('0x7c'),_0x46c264[_0x7367('0x7d')],_0x3e439c[_0x7367('0x7e')]):_0x7367('0x7f');var _0x5cfa26=_0xc51323[_0x7367('0x44')][_0x7367('0x80')]||util[_0x7367('0x7b')](_0x7367('0x7c'),_0x7367('0x81'),_0x3e439c[_0x7367('0x7a')]);switch(_0x46c264['agentIdentifier']){case'website_alias':_0x37378a=_0x3e439c[_0x7367('0x7e')]?util['format'](_0x7367('0x7c'),_0x46c264[_0x7367('0x7d')],_0x3e439c[_0x7367('0x7e')]):_0x7367('0x7f');break;case'agent_alias':_0x37378a=_0x3e439c[_0x7367('0x7e')]?_0x3e439c[_0x7367('0x82')][_0x7367('0x83')]||_0x3e439c[_0x7367('0x82')][_0x7367('0x84')]:'System';break;case'agent_fullname':_0x37378a=_0x3e439c[_0x7367('0x7e')]?_0x3e439c[_0x7367('0x82')][_0x7367('0x84')]:_0x7367('0x7f');break;default:_0x37378a=_0x3e439c[_0x7367('0x7e')]?util['format'](_0x7367('0x7c'),_0x46c264['agentAlias'],_0x3e439c['UserId']):_0x7367('0x7f');}var _0x5dc52c=util[_0x7367('0x7b')](_0x7367('0x85'),moment(_0x3e439c['createdAt'])[_0x7367('0x7b')](_0x7367('0x86')),_0x3e439c[_0x7367('0x87')]==='in'?_0x5cfa26:_0x37378a,_0x3e439c[_0x7367('0x44')]);if(!_0x3e439c[_0x7367('0x88')]){fs[_0x7367('0x89')](_0x222fcd,_0x5dc52c);}}return db[_0x7367('0x8a')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x7367('0x8b')],'as':_0x7367('0x8c'),'raw':!![],'include':[{'model':db[_0x7367('0x8d')],'as':_0x7367('0x8d'),'raw':!![]}]}]});}}})[_0x7367('0x2a')](function(_0x4d50d2){if(!_0x4d50d2||!_0x4d50d2[_0x7367('0x8c')]||!_0xc51323[_0x7367('0x44')])return _0x2d4e26;var _0x534197=_0x4d50d2[_0x7367('0x8e')]();return respondWithRpcPromise('SendMail',_0x7367('0x8f'),{'account':_0x534197,'message':{'from':util[_0x7367('0x7b')](_0x7367('0x90'),_0x4d50d2[_0x7367('0x2c')],_0x4d50d2[_0x7367('0x91')]||_0x4d50d2[_0x7367('0x8c')][_0x7367('0x3a')]),'to':_0xc51323[_0x7367('0x44')][_0x7367('0x92')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xc51323[_0x7367('0x44')][_0x7367('0x92')]),'attachments':[{'path':_0x222fcd}]}})[_0x7367('0x2a')](function(){return _0x2d4e26;})[_0x7367('0x21')](function(_0x55d378){logger[_0x7367('0x1d')](_0x55d378);});})['then'](respondWithStatusCode(_0x29d04e,0xc8))[_0x7367('0x21')](handleError(_0x29d04e,null));};exports[_0x7367('0x93')]=function(_0x2e299c,_0x2df8ae){return db['ChatMessage']['find']({'where':{'id':_0x2e299c[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x2df8ae,null))['then'](function(_0x5c75cd){if(_0x5c75cd){return _0x5c75cd['addMessage'](_0x2e299c[_0x7367('0x44')][_0x7367('0x94')],_[_0x7367('0x95')](_0x2e299c[_0x7367('0x44')],[_0x7367('0x94'),'id'])||{});}})[_0x7367('0x2a')](respondWithResult(_0x2df8ae,null))[_0x7367('0x21')](handleError(_0x2df8ae,null));};exports[_0x7367('0x96')]=function(_0x9bb23d,_0x581d96){var _0x4cf8c9={'raw':![],'where':{}};var _0x4f2ca5={};var _0x5cab53={'count':0x0,'rows':[]};return db[_0x7367('0x33')][_0x7367('0x48')]({'where':{'id':_0x9bb23d[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x581d96,null))[_0x7367('0x2a')](function(_0x21a26c){if(_0x21a26c){_0x4f2ca5['model']=_[_0x7367('0x3e')](db[_0x7367('0x78')][_0x7367('0x34')]);_0x4f2ca5[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x9bb23d[_0x7367('0x39')]);_0x4f2ca5['filters']=_['intersection'](_0x4f2ca5[_0x7367('0x3d')],_0x4f2ca5[_0x7367('0x39')]);_0x4cf8c9['attributes']=_[_0x7367('0x3f')](_0x4f2ca5[_0x7367('0x3d')],qs['fields'](_0x9bb23d[_0x7367('0x39')]['fields']));_0x4cf8c9['attributes']=_0x4cf8c9[_0x7367('0x40')][_0x7367('0x97')]?_0x4cf8c9['attributes']:_0x4f2ca5['model'];if(!_0x9bb23d['query'][_0x7367('0x98')](_0x7367('0x99'))){_0x4cf8c9['limit']=qs['limit'](_0x9bb23d[_0x7367('0x39')][_0x7367('0x26')]);_0x4cf8c9[_0x7367('0x27')]=qs['offset'](_0x9bb23d[_0x7367('0x39')][_0x7367('0x27')]);}_0x4cf8c9[_0x7367('0x9a')]=qs[_0x7367('0x9b')](_0x9bb23d['query'][_0x7367('0x9b')]);_0x4cf8c9[_0x7367('0x9c')]=qs[_0x7367('0x9d')](_[_0x7367('0x9e')](_0x9bb23d[_0x7367('0x39')],_0x4f2ca5['filters']));_0x4cf8c9[_0x7367('0x9c')][_0x7367('0x9f')]=_0x21a26c['id'];if(_0x9bb23d[_0x7367('0x39')][_0x7367('0xa0')]){_0x4cf8c9['where']=_['merge'](_0x4cf8c9[_0x7367('0x9c')],{'$or':_['map'](_0x4cf8c9[_0x7367('0x40')],function(_0x2ab2c6){var _0x8bbf4c={};_0x8bbf4c[_0x2ab2c6]={'$like':'%'+_0x9bb23d[_0x7367('0x39')][_0x7367('0xa0')]+'%'};return _0x8bbf4c;})});}if(_0x9bb23d[_0x7367('0x39')][_0x7367('0xa1')]){var _0x8386c9=_0x9bb23d[_0x7367('0x39')][_0x7367('0xa1')][_0x7367('0xa2')](',');var _0x534ba5={};_0x534ba5[_0x8386c9[0x0]]={'$gte':moment(_0x8386c9[0x1])['format'](_0x7367('0xa3'))};_0x4cf8c9[_0x7367('0x9c')]=_[_0x7367('0x2e')](_0x4cf8c9[_0x7367('0x9c')],_0x534ba5);}_0x4cf8c9=_[_0x7367('0x2e')]({},_0x4cf8c9,_0x9bb23d[_0x7367('0xa4')]);return db[_0x7367('0x78')]['count']({'where':_0x4cf8c9['where']})[_0x7367('0x2a')](function(_0x2690e4){_0x5cab53[_0x7367('0x28')]=_0x2690e4;if(_0x9bb23d[_0x7367('0x39')]['includeAll']){_0x4cf8c9[_0x7367('0x42')]=[{'all':!![]}];}return db['ChatMessage'][_0x7367('0xa5')](_0x4cf8c9);})[_0x7367('0x2a')](function(_0x2cc397){_0x5cab53['rows']=_0x2cc397;return _0x5cab53;});}})[_0x7367('0x2a')](respondWithFilteredResult(_0x581d96,_0x4cf8c9))[_0x7367('0x21')](handleError(_0x581d96,null));};exports[_0x7367('0xa6')]=function(_0x5e5388,_0x4470f8){var _0xd40b1a={'where':{}},_0x4bcef5={},_0x553ae9={'count':0x0,'rows':[]};return db[_0x7367('0x33')]['findOne']({'where':{'id':_0x5e5388[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4470f8,null))['then'](function(_0x463723){if(_0x463723){_0x4bcef5[_0x7367('0x3d')]=_['keys'](db['ChatMessage'][_0x7367('0x34')]);_0x4bcef5[_0x7367('0x39')]=_[_0x7367('0x3e')](_0x5e5388[_0x7367('0x39')]);_0x4bcef5['filters']=_[_0x7367('0x3f')](_0x4bcef5[_0x7367('0x3d')],_0x4bcef5[_0x7367('0x39')]);_0xd40b1a[_0x7367('0x40')]=_[_0x7367('0x3f')](_0x4bcef5['model'],qs[_0x7367('0xa7')](_0x5e5388[_0x7367('0x39')]['fields']));_0xd40b1a[_0x7367('0x40')]=_0xd40b1a[_0x7367('0x40')][_0x7367('0x97')]?_0xd40b1a['attributes']:_0x4bcef5[_0x7367('0x3d')];if(!_0x5e5388[_0x7367('0x39')][_0x7367('0x98')](_0x7367('0x99'))){_0xd40b1a[_0x7367('0x26')]=qs[_0x7367('0x26')](_0x5e5388[_0x7367('0x39')][_0x7367('0x26')]);_0xd40b1a[_0x7367('0x27')]=qs[_0x7367('0x27')](_0x5e5388[_0x7367('0x39')][_0x7367('0x27')]);}_0xd40b1a[_0x7367('0x9a')]=qs['sort'](_0x5e5388['query']['sort']);_0xd40b1a[_0x7367('0x9c')]=qs['filters'](_['pick'](_0x5e5388[_0x7367('0x39')],_0x4bcef5[_0x7367('0x9d')]));_0xd40b1a[_0x7367('0x9c')][_0x7367('0x9f')]=_0x463723['id'];if(_0x5e5388[_0x7367('0x39')][_0x7367('0xa0')]){_0xd40b1a['where']=_[_0x7367('0x2e')](_0xd40b1a[_0x7367('0x9c')],{'$or':_[_0x7367('0x32')](_0xd40b1a[_0x7367('0x40')],function(_0x13fda0){var _0x2cdad6={};_0x2cdad6[_0x13fda0]={'$like':'%'+_0x5e5388['query']['filter']+'%'};return _0x2cdad6;})});}_0xd40b1a[_0x7367('0x9c')][_0x7367('0x88')]=![];if(_0x5e5388['query']['id']){_0xd40b1a[_0x7367('0x9c')]['id']={'$gt':_0x5e5388[_0x7367('0x39')]['id']};}_0xd40b1a=_['merge']({},_0xd40b1a,_0x5e5388[_0x7367('0xa4')]);return db['ChatMessage'][_0x7367('0x28')]({'where':_0xd40b1a['where']})[_0x7367('0x2a')](function(_0xf2288b){_0x553ae9[_0x7367('0x28')]=_0xf2288b;_0xd40b1a[_0x7367('0x42')]=[];if(_0x5e5388[_0x7367('0x39')][_0x7367('0xa8')]){_0xd40b1a[_0x7367('0x42')][_0x7367('0xa9')]({'model':db[_0x7367('0x82')],'as':_0x7367('0x82'),'attributes':['id',_0x7367('0x84'),'alias']});}if(_0x5e5388[_0x7367('0x39')][_0x7367('0x41')]){_0xd40b1a['include']=[{'all':!![]}];}return db[_0x7367('0x78')][_0x7367('0xa5')](_0xd40b1a);})[_0x7367('0x2a')](function(_0x3c8c72){_0x553ae9[_0x7367('0xaa')]=_0x3c8c72;return _0x553ae9;});}})[_0x7367('0x2a')](respondWithFilteredResult(_0x4470f8,_0xd40b1a))['catch'](handleError(_0x4470f8,null));};exports[_0x7367('0xab')]=function(_0x483564,_0xe12f0b){return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0x483564[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0xe12f0b,null))[_0x7367('0x2a')](function(_0x2b1919){if(_0x2b1919){return _0x2b1919[_0x7367('0xac')](_0x483564[_0x7367('0x44')][_0x7367('0x94')],_[_0x7367('0x95')](_0x483564['body'],[_0x7367('0x94'),'id'])||{})[_0x7367('0xad')](function(){return db[_0x7367('0xae')][_0x7367('0xa5')]({'attributes':['id',_0x7367('0x2c'),_0x7367('0xaf')],'where':{'id':_0x483564['body'][_0x7367('0x94')]}});})[_0x7367('0x2a')](function(_0x4affb9){socket[_0x7367('0xb0')](_0x7367('0xb1'),{'id':Number(_0x483564[_0x7367('0x3c')]['id']),'tags':_0x4affb9||[]});return{'id':Number(_0x483564[_0x7367('0x3c')]['id']),'tags':_0x4affb9||[]};});}})[_0x7367('0x2a')](respondWithResult(_0xe12f0b,null))[_0x7367('0x21')](handleError(_0xe12f0b,null));};exports[_0x7367('0xb2')]=function(_0xc1a7ce,_0x4c6902){return db[_0x7367('0x33')][_0x7367('0x46')]({'where':{'id':_0xc1a7ce[_0x7367('0x3c')]['id']}})[_0x7367('0x2a')](handleEntityNotFound(_0x4c6902,null))['then'](function(_0x2c8f6c){if(_0x2c8f6c){return _0x2c8f6c[_0x7367('0xb2')](_0xc1a7ce[_0x7367('0x39')][_0x7367('0x94')]);}})[_0x7367('0x2a')](respondWithStatusCode(_0x4c6902,null))['catch'](handleError(_0x4c6902,null));};exports[_0x7367('0xb3')]=function(_0x4852dc,_0x4aecd4){var _0x4a75b7=moment()[_0x7367('0xb4')]()[_0x7367('0xb5')]();var _0xb33935=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),'files',_0x7367('0xb7'));var _0x570b57=path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),_0x7367('0xb8'),_0x7367('0xb9'));var _0x33ef1e=path['join'](_0xb33935,_0x4a75b7);var _0x55673b=util[_0x7367('0x7b')](_0x7367('0xba'),_0x4852dc[_0x7367('0x3c')]['id'],_0x4a75b7);var _0x57d29c=path[_0x7367('0x71')](_0xb33935,_0x55673b);var _0x8e3402=[];_0x8e3402['push']({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x8e3402[_0x7367('0xa9')]({'model':db[_0x7367('0x5d')],'as':_0x7367('0x5e'),'attributes':['id',_0x7367('0xbb'),'lastName'],'raw':!![]});if(_0x4852dc['query'][_0x7367('0xb9')]){_0x8e3402[_0x7367('0xa9')]({'model':db[_0x7367('0x6c')],'as':_0x7367('0x6c'),'raw':!![]});}var _0x3cdb24=[{'model':db[_0x7367('0x78')],'as':'Messages','attributes':['id','body',_0x7367('0xbc'),_0x7367('0x87'),_0x7367('0x88'),_0x7367('0xbd')],'include':_0x8e3402}];_0x3cdb24[_0x7367('0xa9')]({'model':db['ChatWebsite'],'as':_0x7367('0xbe'),'attributes':['id','name']});_0x3cdb24[_0x7367('0xa9')]({'model':db['User'],'as':_0x7367('0xbf'),'attributes':['id',_0x7367('0x84')]});return db[_0x7367('0x33')]['find']({'where':{'id':_0x4852dc['params']['id']},'include':_0x3cdb24})[_0x7367('0x2a')](handleEntityNotFound(_0x4aecd4,null))[_0x7367('0x2a')](function(_0x52505c){if(_0x52505c){var _0x2717ee=_0x52505c[_0x7367('0xc0')]({'plain':!![]});fs['mkdirSync'](_0x33ef1e);var _0xf048dc={'channel':'Chat','account':_0x2717ee['Account'][_0x7367('0x2c')],'agent':_0x2717ee['Owner']?_0x2717ee['Owner'][_0x7367('0x84')]:_0x7367('0xc1'),'createdAt':moment(_0x2717ee[_0x7367('0xbc')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x7367('0xb5')](),'closedAt':_0x2717ee[_0x7367('0x64')]?moment(_0x2717ee['closedAt'])[_0x7367('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x2717ee[_0x7367('0x65')],'chatInfo':{'browser':_0x2717ee[_0x7367('0xc2')],'os':_0x2717ee['osName'],'referer':_0x2717ee['referer'],'customerIp':_0x2717ee[_0x7367('0xc3')],'customerPort':_0x2717ee[_0x7367('0xc4')]?_0x2717ee[_0x7367('0xc4')]:_0x7367('0xc1')},'messages':_(_0x2717ee[_0x7367('0x79')])[_0x7367('0xc5')]()[_0x7367('0xa0')]({'secret':![]})[_0x7367('0x32')](function(_0x36ee28){if(_0x36ee28[_0x7367('0x6c')]){var _0x2b4ac9=path[_0x7367('0x71')](_0x570b57,_0x36ee28[_0x7367('0x6c')][_0x7367('0x69')]);if(fs[_0x7367('0xc6')](_0x2b4ac9)){fs[_0x7367('0xc7')](_0x2b4ac9)[_0x7367('0xc8')](fs['createWriteStream'](path[_0x7367('0x71')](_0x33ef1e,_0x36ee28[_0x7367('0x6c')][_0x7367('0x69')])));}}return{'date':moment(_0x36ee28[_0x7367('0xbc')])[_0x7367('0x7b')](_0x7367('0xa3'))['toString'](),'sender':_0x36ee28[_0x7367('0x87')]===_0x7367('0x59')?_0x36ee28['User']?_0x36ee28[_0x7367('0x82')]['fullname']:_0x7367('0x7f'):_0x36ee28[_0x7367('0x5e')][_0x7367('0xbb')]+(_0x36ee28[_0x7367('0x5e')]['lastName']?'\x20'+_0x36ee28['Contact']['lastName']:''),'body':_0x36ee28[_0x7367('0x6c')]?_0x36ee28['Attachment'][_0x7367('0x69')]:_0x36ee28[_0x7367('0x44')],'direction':_0x36ee28[_0x7367('0x87')]===_0x7367('0x59')?'A':'C','secret':_0x36ee28[_0x7367('0x88')],'read':_0x36ee28[_0x7367('0xbd')],'attachment':_0x36ee28[_0x7367('0x6c')]};})['value']()};return ejs[_0x7367('0xc9')](path[_0x7367('0x71')](config[_0x7367('0x74')],_0x7367('0xb6'),_0x7367('0xca'),'downloadInteraction.ejs'),{'interaction':_0xf048dc})[_0x7367('0x2a')](function(_0x5eda9e){var _0x257888=path[_0x7367('0x71')](_0x33ef1e,_0x7367('0xcb')+_0x2717ee['id']+'-'+_0x4a75b7+_0x7367('0xcc'));var _0xa5132a={'path':_0x257888,'channel':'Chat','interactionId':_0x2717ee['id']};return pdf['createPdfFromHTML'](_0x5eda9e,_0xa5132a);})[_0x7367('0x2a')](function(){return new Promise(function(_0x39118b,_0x239240){zipdir(_0x33ef1e,{'saveTo':_0x57d29c},function(_0x5c9273,_0x4dd063){if(_0x5c9273)return _0x239240(_0x5c9273);return _0x39118b(_0x4dd063);});})[_0x7367('0x2a')](function(){return new BPromise(function(_0xb5cba8,_0x646f1d){rimraf(_0x33ef1e,function(_0x3960c9){if(_0x3960c9)_0x646f1d(_0x3960c9);return _0xb5cba8();});});})[_0x7367('0x2a')](function(){return _0x4aecd4[_0x7367('0xb3')](_0x57d29c,_0x55673b,function(_0x53109e){if(_0x53109e){logger[_0x7367('0x1d')]('err',_0x53109e);}else{fs[_0x7367('0xcd')](_0x57d29c);}});});});}else{return _0x4aecd4[_0x7367('0x62')](0xc8);}})[_0x7367('0x21')](handleError(_0x4aecd4,null));};
\ No newline at end of file
+var _0x9e92=['customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','zip-dir','moment','bluebird','mustache','util','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInteraction.socket','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','end','sendStatus','name','send','render','merge','body','contact','agent','interaction','index','map','rawAttributes','type','key','getOptions','findAll','query','show','params','model','keys','filters','attributes','intersection','length','options','ChatInteraction','find','catch','create','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','file','originalname','filename','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','basename','download','close','server/files/chat/upload/','format','now','ChatMessage','Messages','User','ContactId','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','fields','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','includeAll','rows','getMyMessages','include','includeAgent','addTags','setTags','spread','Tag','emit','removeTags','unix','toString','server','files','tmp','attachments','transcript-%d-%s.zip','push','CmContact','firstName','lastName','read','Account','get','mkdirSync','Chat','Owner','createdAt','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer'];(function(_0x47734e,_0x20b0a1){var _0xbd3d4=function(_0x38c9ac){while(--_0x38c9ac){_0x47734e['push'](_0x47734e['shift']());}};_0xbd3d4(++_0x20b0a1);}(_0x9e92,0x1b4));var _0x29e9=function(_0x54fa55,_0x3455a7){_0x54fa55=_0x54fa55-0x0;var _0xb79d2c=_0x9e92[_0x54fa55];return _0xb79d2c;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x29e9('0x0'));var rp=require('request-promise');var moment=require(_0x29e9('0x1'));var BPromise=require(_0x29e9('0x2'));var Mustache=require(_0x29e9('0x3'));var util=require(_0x29e9('0x4'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x29e9('0x5'));var Redis=require(_0x29e9('0x6'));var interaction=require(_0x29e9('0x7'));var qs=require(_0x29e9('0x8'));var pdf=require(_0x29e9('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x29e9('0xa'));var db=require(_0x29e9('0xb'))['db'];config['redis']=_[_0x29e9('0xc')](config[_0x29e9('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x29e9('0xe'))(new Redis(config['redis']));require(_0x29e9('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x29e9('0x10')][_0x29e9('0x11')]({'port':0x232b});var client9004=jayson['client'][_0x29e9('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x25136a,_0x37cd2f,_0x239897,_0x781bf2){return new BPromise(function(_0x463843,_0xccf684){var _0x422a8e=_0x781bf2||client;return _0x422a8e[_0x29e9('0x12')](_0x25136a,_0x239897)[_0x29e9('0x13')](function(_0x119536){logger[_0x29e9('0x14')](_0x29e9('0x15'),_0x37cd2f,_0x29e9('0x16'));logger[_0x29e9('0x17')](_0x29e9('0x18'),_0x37cd2f,_0x29e9('0x16'),JSON['stringify'](_0x119536));if(_0x119536['error']){if(_0x119536[_0x29e9('0x19')][_0x29e9('0x1a')]===0x1f4){logger[_0x29e9('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x37cd2f,_0x119536[_0x29e9('0x19')]['message']);return _0xccf684(_0x119536[_0x29e9('0x19')]['message']);}logger['error'](_0x29e9('0x15'),_0x37cd2f,_0x119536[_0x29e9('0x19')][_0x29e9('0x1b')]);return _0x463843(_0x119536[_0x29e9('0x19')][_0x29e9('0x1b')]);}else{logger['info'](_0x29e9('0x15'),_0x37cd2f,'request\x20sent');_0x463843(_0x119536[_0x29e9('0x1c')]['message']);}})['catch'](function(_0xbd96bb){logger[_0x29e9('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x37cd2f,_0xbd96bb);_0xccf684(_0xbd96bb);});});}function respondWithStatusCode(_0x27d907,_0x2cf27e){_0x2cf27e=_0x2cf27e||0xcc;return function(_0x15d4a4){if(_0x15d4a4){return _0x27d907['sendStatus'](_0x2cf27e);}return _0x27d907[_0x29e9('0x1d')](_0x2cf27e)['end']();};}function respondWithResult(_0x57794a,_0x3ec9b2){_0x3ec9b2=_0x3ec9b2||0xc8;return function(_0x104b8d){if(_0x104b8d){return _0x57794a[_0x29e9('0x1d')](_0x3ec9b2)['json'](_0x104b8d);}};}function respondWithFilteredResult(_0x216b04,_0x48cfdc){return function(_0x38758c){if(_0x38758c){var _0x1d6bbb=typeof _0x48cfdc[_0x29e9('0x1e')]===_0x29e9('0x1f')&&typeof _0x48cfdc[_0x29e9('0x20')]===_0x29e9('0x1f');var _0x3a53d2=_0x38758c[_0x29e9('0x21')];var _0x5d2445=_0x1d6bbb?0x0:_0x48cfdc[_0x29e9('0x1e')];var _0x2b4a8f=_0x1d6bbb?_0x38758c[_0x29e9('0x21')]:_0x48cfdc['offset']+_0x48cfdc[_0x29e9('0x20')];var _0xf9dcfc;if(_0x2b4a8f>=_0x3a53d2){_0x2b4a8f=_0x3a53d2;_0xf9dcfc=0xc8;}else{_0xf9dcfc=0xce;}_0x216b04['status'](_0xf9dcfc);return _0x216b04[_0x29e9('0x22')](_0x29e9('0x23'),_0x5d2445+'-'+_0x2b4a8f+'/'+_0x3a53d2)[_0x29e9('0x24')](_0x38758c);}return null;};}function saveUpdates(_0xf35b46){return function(_0x54ac02){if(_0x54ac02){return _0x54ac02[_0x29e9('0x25')](_0xf35b46)[_0x29e9('0x13')](function(_0xe8d624){return _0xe8d624;});}return null;};}function removeEntity(_0x324f34){return function(_0x2bdb91){if(_0x2bdb91){return _0x2bdb91[_0x29e9('0x26')]()[_0x29e9('0x13')](function(){_0x324f34[_0x29e9('0x1d')](0xcc)[_0x29e9('0x27')]();});}};}function handleEntityNotFound(_0x45693f){return function(_0x1c4640){if(!_0x1c4640){_0x45693f[_0x29e9('0x28')](0x194);}return _0x1c4640;};}function handleError(_0x471e01,_0x3c7839){_0x3c7839=_0x3c7839||0x1f4;return function(_0x244b14){logger[_0x29e9('0x19')](_0x244b14['stack']);if(_0x244b14['name']){delete _0x244b14[_0x29e9('0x29')];}_0x471e01[_0x29e9('0x1d')](_0x3c7839)[_0x29e9('0x2a')](_0x244b14);};}function getMustacheRender(_0x14a8d6,_0xbd163f){return Mustache[_0x29e9('0x2b')](_0x14a8d6,_[_0x29e9('0x2c')](_0xbd163f[_0x29e9('0x2d')],{'contact':_0xbd163f[_0x29e9('0x2e')],'message':_0xbd163f[_0x29e9('0x1b')],'agent':_0xbd163f[_0x29e9('0x2f')],'interaction':_0xbd163f[_0x29e9('0x30')],'account':_0xbd163f['account']}))||'';}exports[_0x29e9('0x31')]=function(_0x3f1766,_0x38adc6){var _0x4796d8={};var _0x4a36ba=_[_0x29e9('0x32')](db['ChatInteraction'][_0x29e9('0x33')],function(_0x248dc2){return{'name':_0x248dc2['fieldName'],'type':_0x248dc2[_0x29e9('0x34')][_0x29e9('0x35')]};});_0x4796d8=qs[_0x29e9('0x36')](_0x4a36ba,_0x3f1766);return interaction[_0x29e9('0x37')]('chat',_0x3f1766[_0x29e9('0x38')],_0x3f1766['user'],_0x4796d8,_0x4a36ba)[_0x29e9('0x13')](respondWithFilteredResult(_0x38adc6,_0x4796d8))['catch'](handleError(_0x38adc6,null));};exports[_0x29e9('0x39')]=function(_0xfe1ea4,_0x3b0b1b){var _0xfcb682={'raw':![],'where':{'id':_0xfe1ea4[_0x29e9('0x3a')]['id']}},_0x3fa1ee={};_0x3fa1ee[_0x29e9('0x3b')]=_[_0x29e9('0x3c')](db['ChatInteraction'][_0x29e9('0x33')]);_0x3fa1ee['query']=_[_0x29e9('0x3c')](_0xfe1ea4[_0x29e9('0x38')]);_0x3fa1ee[_0x29e9('0x3d')]=_['intersection'](_0x3fa1ee['model'],_0x3fa1ee[_0x29e9('0x38')]);_0xfcb682[_0x29e9('0x3e')]=_[_0x29e9('0x3f')](_0x3fa1ee[_0x29e9('0x3b')],qs['fields'](_0xfe1ea4[_0x29e9('0x38')]['fields']));_0xfcb682[_0x29e9('0x3e')]=_0xfcb682['attributes'][_0x29e9('0x40')]?_0xfcb682[_0x29e9('0x3e')]:_0x3fa1ee[_0x29e9('0x3b')];if(_0xfe1ea4[_0x29e9('0x38')]['includeAll']){_0xfcb682['include']=[{'all':!![]}];}_0xfcb682=_['merge']({},_0xfcb682,_0xfe1ea4[_0x29e9('0x41')]);return db[_0x29e9('0x42')][_0x29e9('0x43')](_0xfcb682)[_0x29e9('0x13')](handleEntityNotFound(_0x3b0b1b,null))['then'](respondWithResult(_0x3b0b1b,null))[_0x29e9('0x44')](handleError(_0x3b0b1b,null));};exports[_0x29e9('0x45')]=function(_0x47241b,_0x6f79e5){return db[_0x29e9('0x42')][_0x29e9('0x45')](_0x47241b[_0x29e9('0x2d')],{})[_0x29e9('0x13')](respondWithResult(_0x6f79e5,0xc9))['catch'](handleError(_0x6f79e5,null));};exports['update']=function(_0x38c8e3,_0x148f11){if(_0x38c8e3[_0x29e9('0x2d')]['id']){delete _0x38c8e3[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x38c8e3[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x148f11,null))[_0x29e9('0x13')](saveUpdates(_0x38c8e3[_0x29e9('0x2d')],null))[_0x29e9('0x13')](respondWithResult(_0x148f11,null))['catch'](handleError(_0x148f11,null));};exports[_0x29e9('0x26')]=function(_0x167ec3,_0x3d527b){return db[_0x29e9('0x42')]['find']({'where':{'id':_0x167ec3[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d527b,null))['then'](removeEntity(_0x3d527b,null))[_0x29e9('0x44')](handleError(_0x3d527b,null));};exports[_0x29e9('0x46')]=function(_0x4dab95,_0x2de73f){return db[_0x29e9('0x42')]['describe']()['then'](respondWithResult(_0x2de73f,null))[_0x29e9('0x44')](handleError(_0x2de73f,null));};exports[_0x29e9('0x47')]=function(_0x204e15,_0x9c8e2b){var _0x552c38=_0x204e15[_0x29e9('0x3a')]['id'];var _0x328f7f;var _0x32dd65;var _0x1d93a1;return db['ChatInteraction'][_0x29e9('0x48')]({'where':{'id':_0x552c38}})[_0x29e9('0x13')](function(_0x2a32e9){_0x328f7f=_0x2a32e9;return db[_0x29e9('0x49')][_0x29e9('0x48')]({'where':{'id':_0x2a32e9[_0x29e9('0x4a')]},'attributes':['id',_0x29e9('0x4b'),_0x29e9('0x4c'),_0x29e9('0x4d'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x29e9('0x13')](function(_0x45938f){if(_0x45938f&&_0x45938f[_0x29e9('0x4b')]&&_0x45938f[_0x29e9('0x4c')]){_0x32dd65=_0x45938f;var _0x5f2532={'interaction':{'id':_0x552c38},'agent':{'id':_0x204e15[_0x29e9('0x4e')]['id'],'name':_0x204e15['user'][_0x29e9('0x29')],'fullname':_0x204e15[_0x29e9('0x4e')][_0x29e9('0x4f')],'email':_0x204e15[_0x29e9('0x4e')][_0x29e9('0x50')]},'contact':_0x204e15['body'][_0x29e9('0x2e')],'account':_0x204e15['body'][_0x29e9('0x51')]};var _0x34bb51={'rejectUnauthorized':![],'method':_0x29e9('0x52'),'url':_0x29e9('0x53'),'headers':{'X-APIKEY':_0x45938f['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x204e15[_0x29e9('0x4e')][_0x29e9('0x50')]],'buttons':null,'topic':_0x32dd65['vidaooTopic'],'note':_[_0x29e9('0x54')](_0x32dd65['vidaooNote'])?null:getMustacheRender(_0x32dd65[_0x29e9('0x55')],_0x5f2532),'metadata':null},'redirect':_0x29e9('0x56'),'json':!![]};try{if(!_[_0x29e9('0x54')](_0x32dd65[_0x29e9('0x57')])){var _0x50be9d=getMustacheRender(_0x32dd65[_0x29e9('0x57')],_0x5f2532);var _0x389a77=JSON[_0x29e9('0x58')](_0x50be9d);_0x34bb51[_0x29e9('0x2d')][_0x29e9('0x59')]=_0x389a77;}}catch(_0x1db766){throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x5c'));}return rp(_0x34bb51);}else{throw new db[(_0x29e9('0x5a'))]['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})[_0x29e9('0x13')](function(_0x519cee){_0x1d93a1=_0x519cee;if(_0x1d93a1['id']){var _0x374b5c={'body':_0x1d93a1[_0x29e9('0x5d')],'ChatWebsiteId':_0x32dd65['id'],'ChatInteractionId':_0x328f7f['id'],'direction':_0x29e9('0x5e'),'UserId':_0x204e15[_0x29e9('0x4e')]['id']};return db['ChatMessage'][_0x29e9('0x45')](_0x374b5c,{});}else{throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x5f'));}})[_0x29e9('0x13')](function(){return _0x328f7f[_0x29e9('0x60')]({'vidaooSessionId':_0x1d93a1['id']});})[_0x29e9('0x13')](respondWithResult(_0x9c8e2b,null))[_0x29e9('0x44')](handleError(_0x9c8e2b,null));};exports[_0x29e9('0x61')]=function(_0x2d0a62,_0x40b4a3){if(_0x2d0a62[_0x29e9('0x2d')]['id']){delete _0x2d0a62[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x2d0a62[_0x29e9('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0x29e9('0x62')}]})[_0x29e9('0x13')](handleEntityNotFound(_0x40b4a3,null))[_0x29e9('0x13')](saveUpdates(_0x2d0a62[_0x29e9('0x2d')],null))['then'](respondWithResult(_0x40b4a3,null))['catch'](handleError(_0x40b4a3,null));};exports[_0x29e9('0x63')]=function(_0x726fb9,_0x4463b3){if(_0x726fb9[_0x29e9('0x2d')]['id']){delete _0x726fb9[_0x29e9('0x2d')]['id'];}return db[_0x29e9('0x42')][_0x29e9('0x43')]({'where':{'id':_0x726fb9[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](function(_0x777cb1){if(!_0x777cb1){logger[_0x29e9('0x19')](_0x29e9('0x64'),_0x29e9('0x63'),0x194,_0x29e9('0x65'));_0x4463b3[_0x29e9('0x28')](0x194);}else{if(_0x777cb1[_0x29e9('0x66')]){throw new db[(_0x29e9('0x5a'))][(_0x29e9('0x5b'))](_0x29e9('0x67'));}}return _0x777cb1;})[_0x29e9('0x13')](function(_0x5b1dc6){if(_0x5b1dc6){return _0x5b1dc6[_0x29e9('0x25')]({'closed':_0x726fb9[_0x29e9('0x2d')][_0x29e9('0x68')],'disposition':_0x726fb9[_0x29e9('0x2d')][_0x29e9('0x69')]})[_0x29e9('0x13')](function(_0x5bdb8a){return _0x5bdb8a;});}})[_0x29e9('0x13')](function(){return respondWithRpcPromise('AbandonInteraction',_0x29e9('0x63'),_0x726fb9['body'],client9004);})[_0x29e9('0x13')](respondWithResult(_0x4463b3,null))[_0x29e9('0x44')](handleError(_0x4463b3,null));};exports['attachmentUpload']=function(_0x12d948,_0x375a9e){_0x12d948[_0x29e9('0x2d')][_0x29e9('0x29')]=_0x12d948[_0x29e9('0x6a')][_0x29e9('0x6b')];_0x12d948[_0x29e9('0x2d')]['basename']=_0x12d948[_0x29e9('0x6a')][_0x29e9('0x6c')];_0x12d948['body']['type']=_0x12d948[_0x29e9('0x6a')]['mimetype'];return db[_0x29e9('0x6d')][_0x29e9('0x45')](_0x12d948[_0x29e9('0x2d')])[_0x29e9('0x13')](respondWithResult(_0x375a9e,0xc9))[_0x29e9('0x44')](handleError(_0x375a9e,null));};exports[_0x29e9('0x6e')]=function(_0x325fdf,_0x50dc3b){return db[_0x29e9('0x42')]['findOne']({'where':{'id':_0x325fdf[_0x29e9('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x50dc3b,null))[_0x29e9('0x13')](function(_0x3a611b){if(_0x3a611b){if(_0x3a611b['closed']){return _0x50dc3b[_0x29e9('0x1d')](0x193)[_0x29e9('0x24')]({'status':0x193,'message':_0x29e9('0x6f')});}return db[_0x29e9('0x6d')][_0x29e9('0x48')]({'where':{'id':_0x325fdf['query'][_0x29e9('0x70')]},'raw':!![]})[_0x29e9('0x13')](handleEntityNotFound(_0x50dc3b,null));}})['then'](function(_0x7ee748){if(_0x7ee748){var _0x2c786a=_0x7ee748['ChatOfflineMessageId']!==null;var _0xb08b0a=path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0x73'));if(_0x2c786a){_0xb08b0a=path[_0x29e9('0x71')](_0xb08b0a,'offline-chat/');}var _0x1dc781=path[_0x29e9('0x71')](_0xb08b0a,_0x7ee748[_0x29e9('0x74')]);return _0x50dc3b[_0x29e9('0x75')](_0x1dc781);}})[_0x29e9('0x44')](handleError(_0x50dc3b,null));};exports[_0x29e9('0x76')]=function(_0x4d778c,_0x1be1fa){var _0x978f3=null;var _0x58996f=null;var _0x2f39b2=null;if(_0x4d778c['body']['id']){delete _0x4d778c[_0x29e9('0x2d')]['id'];}if(_0x4d778c[_0x29e9('0x2d')]['mailTranscript']){_0x2f39b2=path['join'](config['root'],_0x29e9('0x77'),util[_0x29e9('0x78')]('transcript-%s.txt',Date[_0x29e9('0x79')]()));_0x4d778c[_0x29e9('0x2d')]['pathTranscript']=_0x2f39b2;}return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x4d778c[_0x29e9('0x3a')]['id']},'include':[{'model':db[_0x29e9('0x7a')],'as':_0x29e9('0x7b'),'include':[{'model':db[_0x29e9('0x7c')],'as':_0x29e9('0x7c')}]}]})['then'](handleEntityNotFound(_0x1be1fa,null))[_0x29e9('0x13')](saveUpdates(_0x4d778c[_0x29e9('0x2d')],null))[_0x29e9('0x13')](function(_0x417c0f){if(_0x417c0f){_0x978f3=_0x417c0f;return db[_0x29e9('0x49')][_0x29e9('0x43')]({'where':{'id':_0x978f3[_0x29e9('0x4a')]}});}})['then'](function(_0x4991e2){if(_0x4991e2){_0x58996f=_0x4991e2;return db['CmContact'][_0x29e9('0x43')]({'where':{'id':_0x978f3[_0x29e9('0x7d')]}});}})['then'](function(_0x408f9f){if(_0x408f9f){if(_0x2f39b2){var _0x2e43d5=null;for(var _0x50db62=0x1;_0x50db62<_0x978f3[_0x29e9('0x7b')][_0x29e9('0x40')];++_0x50db62){_0x2e43d5=_0x978f3[_0x29e9('0x7b')][_0x50db62];var _0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?util['format'](_0x29e9('0x7e'),_0x58996f[_0x29e9('0x7f')],_0x2e43d5[_0x29e9('0x66')]):'System';var _0x1cca10=_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x80')]||util[_0x29e9('0x78')]('%s%d',_0x29e9('0x81'),_0x2e43d5[_0x29e9('0x7d')]);switch(_0x58996f[_0x29e9('0x82')]){case _0x29e9('0x83'):_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?util['format']('%s%d',_0x58996f[_0x29e9('0x7f')],_0x2e43d5[_0x29e9('0x66')]):_0x29e9('0x84');break;case _0x29e9('0x85'):_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x86')]||_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x4f')]:_0x29e9('0x84');break;case'agent_fullname':_0x2b91c4=_0x2e43d5[_0x29e9('0x66')]?_0x2e43d5[_0x29e9('0x7c')][_0x29e9('0x4f')]:_0x29e9('0x84');break;default:_0x2b91c4=_0x2e43d5['UserId']?util[_0x29e9('0x78')](_0x29e9('0x7e'),_0x58996f[_0x29e9('0x7f')],_0x2e43d5['UserId']):_0x29e9('0x84');}var _0x5edd32=util[_0x29e9('0x78')](_0x29e9('0x87'),moment(_0x2e43d5['createdAt'])[_0x29e9('0x78')]('MM/DD/YYYY\x20HH:mm:ss'),_0x2e43d5[_0x29e9('0x88')]==='in'?_0x1cca10:_0x2b91c4,_0x2e43d5['body']);if(!_0x2e43d5[_0x29e9('0x89')]){fs[_0x29e9('0x8a')](_0x2f39b2,_0x5edd32);}}return db[_0x29e9('0x8b')][_0x29e9('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x29e9('0x8c'),'raw':!![],'include':[{'model':db[_0x29e9('0x8d')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x29e9('0x13')](function(_0x5c89ac){if(!_0x5c89ac||!_0x5c89ac[_0x29e9('0x8c')]||!_0x4d778c[_0x29e9('0x2d')])return _0x978f3;var _0x1a3072=_0x5c89ac[_0x29e9('0x8e')]();return respondWithRpcPromise('SendMail',_0x29e9('0x8f'),{'account':_0x1a3072,'message':{'from':util[_0x29e9('0x78')](_0x29e9('0x90'),_0x5c89ac[_0x29e9('0x29')],_0x5c89ac['email']||_0x5c89ac[_0x29e9('0x8c')]['user']),'to':_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x91')],'subject':_0x29e9('0x92'),'text':util[_0x29e9('0x78')](_0x29e9('0x93'),_0x4d778c[_0x29e9('0x2d')][_0x29e9('0x91')]),'attachments':[{'path':_0x2f39b2}]}})[_0x29e9('0x13')](function(){return _0x978f3;})[_0x29e9('0x44')](function(_0x129650){logger[_0x29e9('0x19')](_0x129650);});})[_0x29e9('0x13')](respondWithStatusCode(_0x1be1fa,0xc8))[_0x29e9('0x44')](handleError(_0x1be1fa,null));};exports[_0x29e9('0x94')]=function(_0x17f21d,_0x33c63d){return db[_0x29e9('0x7a')][_0x29e9('0x43')]({'where':{'id':_0x17f21d[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x33c63d,null))['then'](function(_0x318003){if(_0x318003){return _0x318003[_0x29e9('0x94')](_0x17f21d['body'][_0x29e9('0x95')],_[_0x29e9('0x96')](_0x17f21d[_0x29e9('0x2d')],[_0x29e9('0x95'),'id'])||{});}})[_0x29e9('0x13')](respondWithResult(_0x33c63d,null))['catch'](handleError(_0x33c63d,null));};exports[_0x29e9('0x97')]=function(_0x1e65c7,_0x307cc3){var _0x404426={'raw':![],'where':{}};var _0x49ac6e={};var _0x2e439c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x29e9('0x48')]({'where':{'id':_0x1e65c7[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x307cc3,null))[_0x29e9('0x13')](function(_0x2bb038){if(_0x2bb038){_0x49ac6e['model']=_[_0x29e9('0x3c')](db[_0x29e9('0x7a')][_0x29e9('0x33')]);_0x49ac6e[_0x29e9('0x38')]=_[_0x29e9('0x3c')](_0x1e65c7['query']);_0x49ac6e[_0x29e9('0x3d')]=_[_0x29e9('0x3f')](_0x49ac6e[_0x29e9('0x3b')],_0x49ac6e[_0x29e9('0x38')]);_0x404426[_0x29e9('0x3e')]=_['intersection'](_0x49ac6e[_0x29e9('0x3b')],qs[_0x29e9('0x98')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x98')]));_0x404426[_0x29e9('0x3e')]=_0x404426[_0x29e9('0x3e')]['length']?_0x404426[_0x29e9('0x3e')]:_0x49ac6e[_0x29e9('0x3b')];if(!_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x99')](_0x29e9('0x9a'))){_0x404426[_0x29e9('0x20')]=qs[_0x29e9('0x20')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x20')]);_0x404426['offset']=qs[_0x29e9('0x1e')](_0x1e65c7[_0x29e9('0x38')]['offset']);}_0x404426[_0x29e9('0x9b')]=qs[_0x29e9('0x9c')](_0x1e65c7[_0x29e9('0x38')][_0x29e9('0x9c')]);_0x404426[_0x29e9('0x9d')]=qs[_0x29e9('0x3d')](_[_0x29e9('0x9e')](_0x1e65c7[_0x29e9('0x38')],_0x49ac6e[_0x29e9('0x3d')]));_0x404426['where'][_0x29e9('0x9f')]=_0x2bb038['id'];if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa0')]){_0x404426['where']=_[_0x29e9('0x2c')](_0x404426['where'],{'$or':_['map'](_0x404426[_0x29e9('0x3e')],function(_0x473c96){var _0x265a56={};_0x265a56[_0x473c96]={'$like':'%'+_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa0')]+'%'};return _0x265a56;})});}if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa1')]){var _0xa4943a=_0x1e65c7['query'][_0x29e9('0xa1')][_0x29e9('0xa2')](',');var _0x52c783={};_0x52c783[_0xa4943a[0x0]]={'$gte':moment(_0xa4943a[0x1])[_0x29e9('0x78')]('YYYY-MM-DD\x20HH:mm:ss')};_0x404426[_0x29e9('0x9d')]=_['merge'](_0x404426[_0x29e9('0x9d')],_0x52c783);}_0x404426=_[_0x29e9('0x2c')]({},_0x404426,_0x1e65c7['options']);return db[_0x29e9('0x7a')]['count']({'where':_0x404426[_0x29e9('0x9d')]})[_0x29e9('0x13')](function(_0x4a5d83){_0x2e439c[_0x29e9('0x21')]=_0x4a5d83;if(_0x1e65c7[_0x29e9('0x38')][_0x29e9('0xa3')]){_0x404426['include']=[{'all':!![]}];}return db[_0x29e9('0x7a')][_0x29e9('0x37')](_0x404426);})[_0x29e9('0x13')](function(_0x57bf02){_0x2e439c[_0x29e9('0xa4')]=_0x57bf02;return _0x2e439c;});}})[_0x29e9('0x13')](respondWithFilteredResult(_0x307cc3,_0x404426))[_0x29e9('0x44')](handleError(_0x307cc3,null));};exports[_0x29e9('0xa5')]=function(_0x1e8a8d,_0x1cad1c){var _0x58cf23={'where':{}},_0x3fc806={},_0x13344e={'count':0x0,'rows':[]};return db[_0x29e9('0x42')][_0x29e9('0x48')]({'where':{'id':_0x1e8a8d[_0x29e9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x1cad1c,null))[_0x29e9('0x13')](function(_0x451d8b){if(_0x451d8b){_0x3fc806[_0x29e9('0x3b')]=_['keys'](db['ChatMessage'][_0x29e9('0x33')]);_0x3fc806[_0x29e9('0x38')]=_['keys'](_0x1e8a8d[_0x29e9('0x38')]);_0x3fc806[_0x29e9('0x3d')]=_[_0x29e9('0x3f')](_0x3fc806['model'],_0x3fc806[_0x29e9('0x38')]);_0x58cf23['attributes']=_['intersection'](_0x3fc806[_0x29e9('0x3b')],qs[_0x29e9('0x98')](_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0x98')]));_0x58cf23['attributes']=_0x58cf23[_0x29e9('0x3e')]['length']?_0x58cf23['attributes']:_0x3fc806['model'];if(!_0x1e8a8d[_0x29e9('0x38')]['hasOwnProperty']('nolimit')){_0x58cf23[_0x29e9('0x20')]=qs['limit'](_0x1e8a8d['query']['limit']);_0x58cf23[_0x29e9('0x1e')]=qs[_0x29e9('0x1e')](_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0x1e')]);}_0x58cf23[_0x29e9('0x9b')]=qs[_0x29e9('0x9c')](_0x1e8a8d[_0x29e9('0x38')]['sort']);_0x58cf23['where']=qs[_0x29e9('0x3d')](_['pick'](_0x1e8a8d['query'],_0x3fc806[_0x29e9('0x3d')]));_0x58cf23[_0x29e9('0x9d')][_0x29e9('0x9f')]=_0x451d8b['id'];if(_0x1e8a8d['query'][_0x29e9('0xa0')]){_0x58cf23[_0x29e9('0x9d')]=_[_0x29e9('0x2c')](_0x58cf23[_0x29e9('0x9d')],{'$or':_['map'](_0x58cf23['attributes'],function(_0x24c79f){var _0x329dd7={};_0x329dd7[_0x24c79f]={'$like':'%'+_0x1e8a8d['query'][_0x29e9('0xa0')]+'%'};return _0x329dd7;})});}_0x58cf23[_0x29e9('0x9d')][_0x29e9('0x89')]=![];if(_0x1e8a8d[_0x29e9('0x38')]['id']){_0x58cf23[_0x29e9('0x9d')]['id']={'$gt':_0x1e8a8d[_0x29e9('0x38')]['id']};}_0x58cf23=_['merge']({},_0x58cf23,_0x1e8a8d['options']);return db[_0x29e9('0x7a')][_0x29e9('0x21')]({'where':_0x58cf23[_0x29e9('0x9d')]})[_0x29e9('0x13')](function(_0x2d8b40){_0x13344e[_0x29e9('0x21')]=_0x2d8b40;_0x58cf23[_0x29e9('0xa6')]=[];if(_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0xa7')]){_0x58cf23['include']['push']({'model':db[_0x29e9('0x7c')],'as':_0x29e9('0x7c'),'attributes':['id',_0x29e9('0x4f'),_0x29e9('0x86')]});}if(_0x1e8a8d[_0x29e9('0x38')][_0x29e9('0xa3')]){_0x58cf23['include']=[{'all':!![]}];}return db[_0x29e9('0x7a')][_0x29e9('0x37')](_0x58cf23);})[_0x29e9('0x13')](function(_0x23414a){_0x13344e[_0x29e9('0xa4')]=_0x23414a;return _0x13344e;});}})[_0x29e9('0x13')](respondWithFilteredResult(_0x1cad1c,_0x58cf23))['catch'](handleError(_0x1cad1c,null));};exports[_0x29e9('0xa8')]=function(_0x4bed96,_0x3a346d){return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x4bed96['params']['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x3a346d,null))[_0x29e9('0x13')](function(_0x23f09b){if(_0x23f09b){return _0x23f09b[_0x29e9('0xa9')](_0x4bed96[_0x29e9('0x2d')]['ids'],_['omit'](_0x4bed96[_0x29e9('0x2d')],[_0x29e9('0x95'),'id'])||{})[_0x29e9('0xaa')](function(){return db[_0x29e9('0xab')][_0x29e9('0x37')]({'attributes':['id',_0x29e9('0x29'),'color'],'where':{'id':_0x4bed96[_0x29e9('0x2d')][_0x29e9('0x95')]}});})['then'](function(_0x35a444){socket[_0x29e9('0xac')]('chatInteractionTags:save',{'id':Number(_0x4bed96[_0x29e9('0x3a')]['id']),'tags':_0x35a444||[]});return{'id':Number(_0x4bed96[_0x29e9('0x3a')]['id']),'tags':_0x35a444||[]};});}})[_0x29e9('0x13')](respondWithResult(_0x3a346d,null))[_0x29e9('0x44')](handleError(_0x3a346d,null));};exports[_0x29e9('0xad')]=function(_0x2998b7,_0x38dff7){return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x2998b7[_0x29e9('0x3a')]['id']}})[_0x29e9('0x13')](handleEntityNotFound(_0x38dff7,null))[_0x29e9('0x13')](function(_0x23c56f){if(_0x23c56f){return _0x23c56f[_0x29e9('0xad')](_0x2998b7[_0x29e9('0x38')]['ids']);}})['then'](respondWithStatusCode(_0x38dff7,null))['catch'](handleError(_0x38dff7,null));};exports[_0x29e9('0x75')]=function(_0x162e1f,_0x19aea5){var _0x4486b7=moment()[_0x29e9('0xae')]()[_0x29e9('0xaf')]();var _0x458d4b=path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0xb0'),_0x29e9('0xb1'),_0x29e9('0xb2'));var _0x1377c9=path['join'](config[_0x29e9('0x72')],'server',_0x29e9('0xb1'),_0x29e9('0xb3'));var _0x3fd3be=path[_0x29e9('0x71')](_0x458d4b,_0x4486b7);var _0x1c81c1=util[_0x29e9('0x78')](_0x29e9('0xb4'),_0x162e1f['params']['id'],_0x4486b7);var _0x172204=path[_0x29e9('0x71')](_0x458d4b,_0x1c81c1);var _0x513362=[];_0x513362[_0x29e9('0xb5')]({'model':db['User'],'as':'User','attributes':['id',_0x29e9('0x4f')],'raw':!![]});_0x513362[_0x29e9('0xb5')]({'model':db[_0x29e9('0xb6')],'as':_0x29e9('0x62'),'attributes':['id',_0x29e9('0xb7'),_0x29e9('0xb8')],'raw':!![]});if(_0x162e1f[_0x29e9('0x38')][_0x29e9('0xb3')]){_0x513362[_0x29e9('0xb5')]({'model':db[_0x29e9('0x6d')],'as':_0x29e9('0x6d'),'raw':!![]});}var _0xaa3f79=[{'model':db[_0x29e9('0x7a')],'as':'Messages','attributes':['id',_0x29e9('0x2d'),'createdAt',_0x29e9('0x88'),_0x29e9('0x89'),_0x29e9('0xb9')],'include':_0x513362}];_0xaa3f79[_0x29e9('0xb5')]({'model':db[_0x29e9('0x49')],'as':_0x29e9('0xba'),'attributes':['id',_0x29e9('0x29')]});_0xaa3f79[_0x29e9('0xb5')]({'model':db[_0x29e9('0x7c')],'as':'Owner','attributes':['id',_0x29e9('0x4f')]});return db['ChatInteraction'][_0x29e9('0x43')]({'where':{'id':_0x162e1f[_0x29e9('0x3a')]['id']},'include':_0xaa3f79})['then'](handleEntityNotFound(_0x19aea5,null))['then'](function(_0x36e1d6){if(_0x36e1d6){var _0xa1ce62=_0x36e1d6[_0x29e9('0xbb')]({'plain':!![]});fs[_0x29e9('0xbc')](_0x3fd3be);var _0x3b32e0={'channel':_0x29e9('0xbd'),'account':_0xa1ce62[_0x29e9('0xba')][_0x29e9('0x29')],'agent':_0xa1ce62[_0x29e9('0xbe')]?_0xa1ce62[_0x29e9('0xbe')][_0x29e9('0x4f')]:'N.A.','createdAt':moment(_0xa1ce62[_0x29e9('0xbf')])[_0x29e9('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0x29e9('0xaf')](),'closedAt':_0xa1ce62[_0x29e9('0x68')]?moment(_0xa1ce62[_0x29e9('0xc0')])[_0x29e9('0x78')](_0x29e9('0xc1'))[_0x29e9('0xaf')]():'','disposition':_0xa1ce62['disposition'],'chatInfo':{'browser':_0xa1ce62[_0x29e9('0xc2')],'os':_0xa1ce62[_0x29e9('0xc3')],'referer':_0xa1ce62[_0x29e9('0xc4')],'customerIp':_0xa1ce62[_0x29e9('0xc5')],'customerPort':_0xa1ce62['customerPort']?_0xa1ce62[_0x29e9('0xc6')]:_0x29e9('0xc7')},'messages':_(_0xa1ce62[_0x29e9('0x7b')])[_0x29e9('0xc8')]()[_0x29e9('0xa0')]({'secret':![]})[_0x29e9('0x32')](function(_0x960fee){if(_0x960fee[_0x29e9('0x6d')]){var _0x1e8ffd=path[_0x29e9('0x71')](_0x1377c9,_0x960fee[_0x29e9('0x6d')][_0x29e9('0x74')]);if(fs[_0x29e9('0xc9')](_0x1e8ffd)){fs[_0x29e9('0xca')](_0x1e8ffd)[_0x29e9('0xcb')](fs['createWriteStream'](path[_0x29e9('0x71')](_0x3fd3be,_0x960fee[_0x29e9('0x6d')]['basename'])));}}return{'date':moment(_0x960fee[_0x29e9('0xbf')])['format'](_0x29e9('0xc1'))[_0x29e9('0xaf')](),'sender':_0x960fee['direction']==='out'?_0x960fee[_0x29e9('0x7c')]?_0x960fee[_0x29e9('0x7c')][_0x29e9('0x4f')]:'System':_0x960fee['Contact']['firstName']+(_0x960fee[_0x29e9('0x62')][_0x29e9('0xb8')]?'\x20'+_0x960fee[_0x29e9('0x62')][_0x29e9('0xb8')]:''),'body':_0x960fee[_0x29e9('0x6d')]?_0x960fee[_0x29e9('0x6d')][_0x29e9('0x74')]:_0x960fee[_0x29e9('0x2d')],'direction':_0x960fee[_0x29e9('0x88')]==='out'?'A':'C','secret':_0x960fee['secret'],'read':_0x960fee[_0x29e9('0xb9')],'attachment':_0x960fee[_0x29e9('0x6d')]};})[_0x29e9('0xcc')]()};return ejs[_0x29e9('0xcd')](path[_0x29e9('0x71')](config[_0x29e9('0x72')],_0x29e9('0xb0'),_0x29e9('0xce'),'downloadInteraction.ejs'),{'interaction':_0x3b32e0})[_0x29e9('0x13')](function(_0x45b8a6){var _0x4649b=path[_0x29e9('0x71')](_0x3fd3be,_0x29e9('0xcf')+_0xa1ce62['id']+'-'+_0x4486b7+_0x29e9('0xd0'));var _0x3ab764={'path':_0x4649b,'channel':_0x29e9('0xbd'),'interactionId':_0xa1ce62['id']};return pdf[_0x29e9('0xd1')](_0x45b8a6,_0x3ab764);})[_0x29e9('0x13')](function(){return new Promise(function(_0x40bcb1,_0x488ebb){zipdir(_0x3fd3be,{'saveTo':_0x172204},function(_0x78b3b0,_0x771bcc){if(_0x78b3b0)return _0x488ebb(_0x78b3b0);return _0x40bcb1(_0x771bcc);});})[_0x29e9('0x13')](function(){return new BPromise(function(_0xe9305,_0x4a5831){rimraf(_0x3fd3be,function(_0xf26cd0){if(_0xf26cd0)_0x4a5831(_0xf26cd0);return _0xe9305();});});})[_0x29e9('0x13')](function(){return _0x19aea5[_0x29e9('0x75')](_0x172204,_0x1c81c1,function(_0x16871b){if(_0x16871b){logger[_0x29e9('0x19')](_0x29e9('0xd2'),_0x16871b);}else{fs['unlinkSync'](_0x172204);}});});});}else{return _0x19aea5['sendStatus'](0xc8);}})[_0x29e9('0x44')](handleError(_0x19aea5,null));};
\ No newline at end of file
index 0d6fe73..6eaaf11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17d8=['../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x17d8,0x110));var _0x817d=function(_0x42d485,_0x2c2c7c){_0x42d485=_0x42d485-0x0;var _0x65ba00=_0x17d8[_0x42d485];return _0x65ba00;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x817d('0x0'))['db'][_0x817d('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x817d('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x817d('0x3')](0x0);var events={'afterCreate':_0x817d('0x4'),'afterUpdate':_0x817d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x349f1c){return function(_0x3c1b40,_0x3713ad,_0x5ed4d7){_0x3c1b40[_0x817d('0x6')]({'attributes':['id'],'raw':!![]})[_0x817d('0x7')](function(_0x3c8a28){_0x3c1b40['setDataValue'](_0x817d('0x8'),_0x3c8a28[_0x817d('0x9')](function(_0x1d445e){return{'id':_0x1d445e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x3c1b40['id'],'direction':'in','read':![]},'raw':!![]});})[_0x817d('0x7')](function(_0x41c7b1){_0x3c1b40[_0x817d('0xa')](_0x817d('0xb'),_0x41c7b1[_0x817d('0xc')]);ChatInteractionEvents['emit'](_0x349f1c+':'+_0x3c1b40['id'],_0x3c1b40);ChatInteractionEvents[_0x817d('0xd')](_0x349f1c,_0x3c1b40);_0x5ed4d7(null);})[_0x817d('0xe')](_0x5ed4d7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x817d('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x28f0=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','exports'];(function(_0x50b1c5,_0x1cf2a9){var _0x344f99=function(_0x5d6ef0){while(--_0x5d6ef0){_0x50b1c5['push'](_0x50b1c5['shift']());}};_0x344f99(++_0x1cf2a9);}(_0x28f0,0x168));var _0x028f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x28f0[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x028f('0x0'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x028f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x028f('0x2')](0x0);var events={'afterCreate':_0x028f('0x3'),'afterUpdate':'update','afterDestroy':_0x028f('0x4')};function emitEvent(_0x5a01a2){return function(_0x4e7b46,_0x2f9c78,_0x1805eb){_0x4e7b46[_0x028f('0x5')]({'attributes':['id'],'raw':!![]})[_0x028f('0x6')](function(_0x26c57c){_0x4e7b46[_0x028f('0x7')](_0x028f('0x8'),_0x26c57c[_0x028f('0x9')](function(_0x1ec8a1){return{'id':_0x1ec8a1['id']};}));return ChatMessage[_0x028f('0xa')]({'where':{'ChatInteractionId':_0x4e7b46['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e5fae){_0x4e7b46[_0x028f('0x7')](_0x028f('0xb'),_0x2e5fae[_0x028f('0xc')]);ChatInteractionEvents['emit'](_0x5a01a2+':'+_0x4e7b46['id'],_0x4e7b46);ChatInteractionEvents[_0x028f('0xd')](_0x5a01a2,_0x4e7b46);_0x1805eb(null);})['catch'](_0x1805eb(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x028f('0xe')]=ChatInteractionEvents;
\ No newline at end of file
index 325f276..9d098ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb915=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xb915,0xe1));var _0x5b91=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xb915[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x5b91('0x0'));var util=require(_0x5b91('0x1'));var logger=require(_0x5b91('0x2'))('api');var moment=require(_0x5b91('0x3'));var BPromise=require(_0x5b91('0x4'));var rp=require(_0x5b91('0x5'));var fs=require('fs');var path=require(_0x5b91('0x6'));var rimraf=require('rimraf');var config=require(_0x5b91('0x7'));var attributes=require(_0x5b91('0x8'));module[_0x5b91('0x9')]=function(_0xefebf2,_0x5a819a){return _0xefebf2['define'](_0x5b91('0xa'),attributes,{'tableName':_0x5b91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f254c,_0x512132,_0x417639){if(_0x3f254c['changed']('closed')){_0x3f254c['closedAt']=moment()[_0x5b91('0xc')](_0x5b91('0xd'));}_0x417639(null,_0x3f254c);}},'charset':'utf8mb4','collate':_0x5b91('0xe')});};
\ No newline at end of file
+var _0x5772=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x46450a,_0x15684e){var _0x1a02ad=function(_0x1eaeaf){while(--_0x1eaeaf){_0x46450a['push'](_0x46450a['shift']());}};_0x1a02ad(++_0x15684e);}(_0x5772,0x7c));var _0x2577=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5772[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2577('0x0'));var util=require(_0x2577('0x1'));var logger=require(_0x2577('0x2'))(_0x2577('0x3'));var moment=require(_0x2577('0x4'));var BPromise=require('bluebird');var rp=require(_0x2577('0x5'));var fs=require('fs');var path=require(_0x2577('0x6'));var rimraf=require(_0x2577('0x7'));var config=require(_0x2577('0x8'));var attributes=require(_0x2577('0x9'));module['exports']=function(_0x358608,_0x130a9e){return _0x358608[_0x2577('0xa')](_0x2577('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22756e,_0x9d2342,_0x14c96a){if(_0x22756e[_0x2577('0xc')](_0x2577('0xd'))){_0x22756e[_0x2577('0xe')]=moment()['format'](_0x2577('0xf'));}_0x14c96a(null,_0x22756e);}},'charset':_0x2577('0x10'),'collate':_0x2577('0x11')});};
\ No newline at end of file
index cdabc24..5d8c894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a3c=['AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','find','addTags','ids','spread'];(function(_0x347573,_0x3a1f04){var _0x15a549=function(_0x1aef7d){while(--_0x1aef7d){_0x347573['push'](_0x347573['shift']());}};_0x15a549(++_0x3a1f04);}(_0x8a3c,0x1c4));var _0xc8a3=function(_0xcd4d8e,_0x1fc2fd){_0xcd4d8e=_0xcd4d8e-0x0;var _0x1c3c61=_0x8a3c[_0xcd4d8e];return _0x1c3c61;};'use strict';var _=require(_0xc8a3('0x0'));var util=require(_0xc8a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc8a3('0x2'));var fs=require('fs');var Redis=require(_0xc8a3('0x3'));var db=require(_0xc8a3('0x4'))['db'];var utils=require(_0xc8a3('0x5'));var logger=require(_0xc8a3('0x6'))(_0xc8a3('0x7'));var config=require(_0xc8a3('0x8'));var jayson=require(_0xc8a3('0x9'));var client=jayson[_0xc8a3('0xa')][_0xc8a3('0xb')]({'port':0x232a});config[_0xc8a3('0xc')]=_[_0xc8a3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc8a3('0xe'))(new Redis(config[_0xc8a3('0xc')]));require(_0xc8a3('0xf'))['register'](socket);function respondWithRpcPromise(_0x5c5e29,_0x5ddbb1,_0x84d7c6){return new BPromise(function(_0x5a7ed0,_0x4d9bb6){return client['request'](_0x5c5e29,_0x84d7c6)[_0xc8a3('0x10')](function(_0x499583){logger['info'](_0xc8a3('0x11'),_0x5ddbb1,'request\x20sent');logger[_0xc8a3('0x12')](_0xc8a3('0x13'),_0x5ddbb1,_0xc8a3('0x14'),JSON[_0xc8a3('0x15')](_0x499583));if(_0x499583[_0xc8a3('0x16')]){if(_0x499583[_0xc8a3('0x16')]['code']===0x1f4){logger[_0xc8a3('0x16')](_0xc8a3('0x11'),_0x5ddbb1,_0x499583[_0xc8a3('0x16')]['message']);return _0x4d9bb6(_0x499583[_0xc8a3('0x16')][_0xc8a3('0x17')]);}logger[_0xc8a3('0x16')](_0xc8a3('0x11'),_0x5ddbb1,_0x499583['error'][_0xc8a3('0x17')]);return _0x5a7ed0(_0x499583['error'][_0xc8a3('0x17')]);}else{logger[_0xc8a3('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5ddbb1,_0xc8a3('0x14'));_0x5a7ed0(_0x499583[_0xc8a3('0x19')][_0xc8a3('0x17')]);}})[_0xc8a3('0x1a')](function(_0x5a79cc){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5ddbb1,_0x5a79cc);_0x4d9bb6(_0x5a79cc);});});}exports[_0xc8a3('0x1b')]=function(_0x57e150){var _0x2c81ab=this;return new Promise(function(_0x46e0b2,_0x551a1a){return db[_0xc8a3('0x1c')]['update'](_0x57e150[_0xc8a3('0x1d')],{'raw':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x20')]||null:null,'attributes':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x21')]||null:null,'limit':_0x57e150[_0xc8a3('0x1e')]?_0x57e150[_0xc8a3('0x1e')][_0xc8a3('0x22')]||null:null})[_0xc8a3('0x10')](function(_0x37cc0c){logger['info']('UpdateChatInteraction',_0x57e150);logger[_0xc8a3('0x12')](_0xc8a3('0x1b'),_0x57e150,JSON[_0xc8a3('0x15')](_0x37cc0c));_0x46e0b2(_0x37cc0c);})['catch'](function(_0x45a1fb){logger[_0xc8a3('0x16')](_0xc8a3('0x1b'),_0x45a1fb[_0xc8a3('0x17')],_0x57e150);_0x551a1a(_0x2c81ab[_0xc8a3('0x16')](0x1f4,_0x45a1fb['message']));});});};exports[_0xc8a3('0x23')]=function(_0x599525){return new Promise(function(_0xe3b33a,_0x45c8e6){return db[_0xc8a3('0x1c')][_0xc8a3('0x24')]({'where':_0x599525[_0xc8a3('0x1e')]?_0x599525[_0xc8a3('0x1e')][_0xc8a3('0x20')]||null:null})[_0xc8a3('0x10')](function(_0x11b93b){if(_0x11b93b){return _0x11b93b[_0xc8a3('0x25')](_0x599525[_0xc8a3('0x1d')][_0xc8a3('0x26')],_['omit'](_0x599525[_0xc8a3('0x1d')],['ids','id'])||{});}})[_0xc8a3('0x27')](function(_0x404d60){logger[_0xc8a3('0x18')](_0xc8a3('0x28'),_0x599525);logger[_0xc8a3('0x12')]('AddTags',_0x599525,JSON['stringify'](_0x404d60));_0xe3b33a(_0x404d60);})[_0xc8a3('0x1a')](function(_0x1a6c41){logger['error'](_0xc8a3('0x28'),_0x1a6c41[_0xc8a3('0x17')],_0x599525);_0x45c8e6(_this[_0xc8a3('0x16')](0x1f4,_0x1a6c41[_0xc8a3('0x17')]));});});};
\ No newline at end of file
+var _0x59a5=['randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatInteraction','update','body','options','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x59a5,0x183));var _0x559a=function(_0x553f0b,_0x177fc1){_0x553f0b=_0x553f0b-0x0;var _0x143135=_0x59a5[_0x553f0b];return _0x143135;};'use strict';var _=require(_0x559a('0x0'));var util=require(_0x559a('0x1'));var moment=require(_0x559a('0x2'));var BPromise=require('bluebird');var rs=require(_0x559a('0x3'));var fs=require('fs');var Redis=require(_0x559a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x559a('0x5'))(_0x559a('0x6'));var config=require('../../config/environment');var jayson=require(_0x559a('0x7'));var client=jayson[_0x559a('0x8')][_0x559a('0x9')]({'port':0x232a});config[_0x559a('0xa')]=_['defaults'](config[_0x559a('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x559a('0xa')]));require(_0x559a('0xb'))[_0x559a('0xc')](socket);function respondWithRpcPromise(_0x328ef3,_0x2732d0,_0x2e9537){return new BPromise(function(_0x13f2d0,_0x1682de){return client[_0x559a('0xd')](_0x328ef3,_0x2e9537)[_0x559a('0xe')](function(_0x26bff6){logger[_0x559a('0xf')](_0x559a('0x10'),_0x2732d0,_0x559a('0x11'));logger[_0x559a('0x12')](_0x559a('0x13'),_0x2732d0,_0x559a('0x11'),JSON[_0x559a('0x14')](_0x26bff6));if(_0x26bff6[_0x559a('0x15')]){if(_0x26bff6[_0x559a('0x15')][_0x559a('0x16')]===0x1f4){logger[_0x559a('0x15')](_0x559a('0x10'),_0x2732d0,_0x26bff6['error'][_0x559a('0x17')]);return _0x1682de(_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);}logger['error'](_0x559a('0x10'),_0x2732d0,_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);return _0x13f2d0(_0x26bff6[_0x559a('0x15')][_0x559a('0x17')]);}else{logger[_0x559a('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x2732d0,_0x559a('0x11'));_0x13f2d0(_0x26bff6['result'][_0x559a('0x17')]);}})[_0x559a('0x18')](function(_0x224016){logger['error'](_0x559a('0x10'),_0x2732d0,_0x224016);_0x1682de(_0x224016);});});}exports['UpdateChatInteraction']=function(_0x3dbbc0){var _0x53fa52=this;return new Promise(function(_0x372561,_0x37a5ea){return db[_0x559a('0x19')][_0x559a('0x1a')](_0x3dbbc0[_0x559a('0x1b')],{'raw':_0x3dbbc0[_0x559a('0x1c')]?_0x3dbbc0[_0x559a('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dbbc0[_0x559a('0x1c')]?_0x3dbbc0['options'][_0x559a('0x1d')]||null:null,'attributes':_0x3dbbc0['options']?_0x3dbbc0[_0x559a('0x1c')][_0x559a('0x1e')]||null:null,'limit':_0x3dbbc0['options']?_0x3dbbc0['options'][_0x559a('0x1f')]||null:null})[_0x559a('0xe')](function(_0x19974b){logger['info'](_0x559a('0x20'),_0x3dbbc0);logger[_0x559a('0x12')]('UpdateChatInteraction',_0x3dbbc0,JSON['stringify'](_0x19974b));_0x372561(_0x19974b);})[_0x559a('0x18')](function(_0x105d3a){logger[_0x559a('0x15')](_0x559a('0x20'),_0x105d3a[_0x559a('0x17')],_0x3dbbc0);_0x37a5ea(_0x53fa52[_0x559a('0x15')](0x1f4,_0x105d3a['message']));});});};exports[_0x559a('0x21')]=function(_0x595a8d){return new Promise(function(_0x147677,_0x18f12f){return db[_0x559a('0x19')][_0x559a('0x22')]({'where':_0x595a8d[_0x559a('0x1c')]?_0x595a8d[_0x559a('0x1c')]['where']||null:null})['then'](function(_0x30aef8){if(_0x30aef8){return _0x30aef8[_0x559a('0x23')](_0x595a8d[_0x559a('0x1b')][_0x559a('0x24')],_['omit'](_0x595a8d[_0x559a('0x1b')],['ids','id'])||{});}})[_0x559a('0x25')](function(_0x2ef3db){logger['info'](_0x559a('0x26'),_0x595a8d);logger['debug']('AddTags',_0x595a8d,JSON[_0x559a('0x14')](_0x2ef3db));_0x147677(_0x2ef3db);})[_0x559a('0x18')](function(_0x31de66){logger[_0x559a('0x15')](_0x559a('0x26'),_0x31de66[_0x559a('0x17')],_0x595a8d);_0x18f12f(_this['error'](0x1f4,_0x31de66['message']));});});};
\ No newline at end of file
index 9c91c54..7d76fc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7376=['save','remove','update','emit','removeListener','length','chatInteraction:'];(function(_0x2b92ec,_0x18e0e3){var _0x12be46=function(_0x18118b){while(--_0x18118b){_0x2b92ec['push'](_0x2b92ec['shift']());}};_0x12be46(++_0x18e0e3);}(_0x7376,0xa8));var _0x6737=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7376[_0x4b055c];return _0x4b62bb;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x6737('0x0'),_0x6737('0x1'),_0x6737('0x2')];function createListener(_0x3ad727,_0x45c267){return function(_0x2c9370){_0x45c267[_0x6737('0x3')](_0x3ad727,_0x2c9370);};}function removeListener(_0x5da8ea,_0x569bb8){return function(){ChatInteractionEvents[_0x6737('0x4')](_0x5da8ea,_0x569bb8);};}exports['register']=function(_0x1d0d44){for(var _0x12b8bc=0x0,_0x17eae0=events[_0x6737('0x5')];_0x12b8bc<_0x17eae0;_0x12b8bc++){var _0x579b64=events[_0x12b8bc];var _0x184a47=createListener(_0x6737('0x6')+_0x579b64,_0x1d0d44);ChatInteractionEvents['on'](_0x579b64,_0x184a47);}};
\ No newline at end of file
+var _0x1f36=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x460ece,_0x3312d3){var _0x29013c=function(_0xf1ae9e){while(--_0xf1ae9e){_0x460ece['push'](_0x460ece['shift']());}};_0x29013c(++_0x3312d3);}(_0x1f36,0x1ed));var _0x61f3=function(_0x4024a8,_0x24792b){_0x4024a8=_0x4024a8-0x0;var _0x4d7178=_0x1f36[_0x4024a8];return _0x4d7178;};'use strict';var ChatInteractionEvents=require(_0x61f3('0x0'));var events=[_0x61f3('0x1'),_0x61f3('0x2'),_0x61f3('0x3')];function createListener(_0x530c15,_0x43cb61){return function(_0x5f4742){_0x43cb61[_0x61f3('0x4')](_0x530c15,_0x5f4742);};}function removeListener(_0x596aab,_0x17d9bf){return function(){ChatInteractionEvents[_0x61f3('0x5')](_0x596aab,_0x17d9bf);};}exports[_0x61f3('0x6')]=function(_0x12c372){for(var _0x72af3d=0x0,_0x52a5eb=events[_0x61f3('0x7')];_0x72af3d<_0x52a5eb;_0x72af3d++){var _0x2f1f60=events[_0x72af3d];var _0x2bfda3=createListener(_0x61f3('0x8')+_0x2f1f60,_0x12c372);ChatInteractionEvents['on'](_0x2f1f60,_0x2bfda3);}};
\ No newline at end of file
index 1d2bce2..38c96ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dd8=['update','put','/:id/custom_update','/:id/abandon','abandon','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','file','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x5b67bd,_0x2bf7ef){var _0x2b795a=function(_0x124fea){while(--_0x124fea){_0x5b67bd['push'](_0x5b67bd['shift']());}};_0x2b795a(++_0x2bf7ef);}(_0x8dd8,0x188));var _0x88dd=function(_0x585ae6,_0x25aa5f){_0x585ae6=_0x585ae6-0x0;var _0x87f16b=_0x8dd8[_0x585ae6];return _0x87f16b;};'use strict';var multer=require(_0x88dd('0x0'));var util=require('util');var path=require(_0x88dd('0x1'));var timeout=require(_0x88dd('0x2'));var express=require(_0x88dd('0x3'));var router=express[_0x88dd('0x4')]();var fs_extra=require(_0x88dd('0x5'));var auth=require(_0x88dd('0x6'));var interaction=require(_0x88dd('0x7'));var config=require(_0x88dd('0x8'));var controller=require(_0x88dd('0x9'));router[_0x88dd('0xa')]('/',auth[_0x88dd('0xb')](),controller[_0x88dd('0xc')]);router[_0x88dd('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x88dd('0xd')]);router[_0x88dd('0xa')](_0x88dd('0xe'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x10')]);router[_0x88dd('0xa')](_0x88dd('0x11'),auth[_0x88dd('0xf')](),controller['attachmentDownload']);router[_0x88dd('0xa')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router[_0x88dd('0xa')](_0x88dd('0x12'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x13')]);router[_0x88dd('0xa')](_0x88dd('0x14'),auth[_0x88dd('0xb')](),controller[_0x88dd('0x15')]);router[_0x88dd('0x16')]('/',auth['isAuthenticated'](),controller[_0x88dd('0x17')]);router[_0x88dd('0x16')](_0x88dd('0x18'),auth[_0x88dd('0xb')](),controller[_0x88dd('0x19')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x388fca,_0xdb5b02,_0x7572d4){_0x7572d4(null,path[_0x88dd('0x1a')](config[_0x88dd('0x1b')],_0x88dd('0x1c')));},'filename':function(_0x4407c3,_0x24a9be,_0x24e59d){_0x24e59d(null,util[_0x88dd('0x1d')](_0x88dd('0x1e'),Date[_0x88dd('0x1f')](),_0x24a9be[_0x88dd('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x88dd('0x21'),upload[_0x88dd('0x22')](_0x88dd('0x23')),controller['attachmentUpload']);router[_0x88dd('0x16')]('/:id/messages',auth[_0x88dd('0xf')](),controller['addMessage']);router['post'](_0x88dd('0x24'),auth[_0x88dd('0xb')](),interaction[_0x88dd('0x25')](_0x88dd('0x26'),_0x88dd('0x27')),controller['addTags']);router['put']('/:id',auth[_0x88dd('0xb')](),interaction['tracked'](_0x88dd('0x26'),'chatinteraction:update'),controller[_0x88dd('0x28')]);router[_0x88dd('0x29')](_0x88dd('0x2a'),controller['customUpdate']);router['put'](_0x88dd('0x2b'),auth[_0x88dd('0xf')](),controller[_0x88dd('0x2c')]);router[_0x88dd('0x29')]('/:id/close',controller['close']);router[_0x88dd('0x2d')](_0x88dd('0xe'),auth[_0x88dd('0xb')](),interaction[_0x88dd('0x25')](_0x88dd('0x26'),'chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x88dd('0xb')](),controller[_0x88dd('0x2e')]);module[_0x88dd('0x2f')]=router;
\ No newline at end of file
+var _0x3a89=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','replace','post','/:id/attachment_upload','file','attachmentUpload','addMessage','tracked','chatinteraction:addtags','put','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized'];(function(_0x29eb3b,_0x32f55e){var _0x5da960=function(_0x68eca2){while(--_0x68eca2){_0x29eb3b['push'](_0x29eb3b['shift']());}};_0x5da960(++_0x32f55e);}(_0x3a89,0x192));var _0x93a8=function(_0x2e49ae,_0x2ce021){_0x2e49ae=_0x2e49ae-0x0;var _0x217ac0=_0x3a89[_0x2e49ae];return _0x217ac0;};'use strict';var multer=require(_0x93a8('0x0'));var util=require('util');var path=require(_0x93a8('0x1'));var timeout=require(_0x93a8('0x2'));var express=require(_0x93a8('0x3'));var router=express[_0x93a8('0x4')]();var fs_extra=require(_0x93a8('0x5'));var auth=require(_0x93a8('0x6'));var interaction=require(_0x93a8('0x7'));var config=require(_0x93a8('0x8'));var controller=require('./chatInteraction.controller');router[_0x93a8('0x9')]('/',auth[_0x93a8('0xa')](),controller['index']);router[_0x93a8('0x9')](_0x93a8('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x93a8('0x9')](_0x93a8('0xc'),auth[_0x93a8('0xd')](),controller['show']);router[_0x93a8('0x9')]('/:id/attachment_download',auth[_0x93a8('0xd')](),controller[_0x93a8('0xe')]);router['get'](_0x93a8('0xf'),auth['isAuthenticated'](),controller[_0x93a8('0x10')]);router[_0x93a8('0x9')](_0x93a8('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x93a8('0x12')]);router[_0x93a8('0x9')](_0x93a8('0x13'),auth['isAuthenticated'](),controller[_0x93a8('0x14')]);router['post']('/',auth[_0x93a8('0xa')](),controller['create']);router['post'](_0x93a8('0x15'),auth['isAuthenticated'](),controller[_0x93a8('0x16')]);var upload=multer({'storage':multer[_0x93a8('0x17')]({'destination':function(_0x274301,_0x332bf4,_0x36eabf){_0x36eabf(null,path[_0x93a8('0x18')](config[_0x93a8('0x19')],_0x93a8('0x1a')));},'filename':function(_0x3c3878,_0x48dd63,_0x39789e){_0x39789e(null,util[_0x93a8('0x1b')](_0x93a8('0x1c'),Date['now'](),_0x48dd63[_0x93a8('0x1d')][_0x93a8('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x93a8('0x1f')](_0x93a8('0x20'),upload['single'](_0x93a8('0x21')),controller[_0x93a8('0x22')]);router[_0x93a8('0x1f')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x93a8('0x23')]);router['post']('/:id/tags',auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')]('chat',_0x93a8('0x25')),controller['addTags']);router[_0x93a8('0x26')](_0x93a8('0xc'),auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')](_0x93a8('0x27'),_0x93a8('0x28')),controller[_0x93a8('0x29')]);router[_0x93a8('0x26')](_0x93a8('0x2a'),controller[_0x93a8('0x2b')]);router[_0x93a8('0x26')]('/:id/abandon',auth[_0x93a8('0xd')](),controller['abandon']);router['put'](_0x93a8('0x2c'),controller[_0x93a8('0x2d')]);router[_0x93a8('0x2e')]('/:id',auth[_0x93a8('0xa')](),interaction[_0x93a8('0x24')](_0x93a8('0x27'),_0x93a8('0x2f')),controller[_0x93a8('0x30')]);router[_0x93a8('0x2e')](_0x93a8('0x31'),auth[_0x93a8('0xa')](),controller[_0x93a8('0x32')]);module[_0x93a8('0x33')]=router;
\ No newline at end of file
index b8e6563..4a7e9cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc65c=['TEXT','medium','BOOLEAN','sequelize','exports'];(function(_0x3e0475,_0x4ee34c){var _0x1547c3=function(_0x415a52){while(--_0x415a52){_0x3e0475['push'](_0x3e0475['shift']());}};_0x1547c3(++_0x4ee34c);}(_0xc65c,0x11b));var _0xcc65=function(_0x5197eb,_0x745e93){_0x5197eb=_0x5197eb-0x0;var _0x19da1f=_0xc65c[_0x5197eb];return _0x19da1f;};'use strict';var Sequelize=require(_0xcc65('0x0'));module[_0xcc65('0x1')]={'body':{'type':Sequelize[_0xcc65('0x2')](_0xcc65('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcc65('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc0a5=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xc0a5,0x1e0));var _0x5c0a=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xc0a5[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x5c0a('0x0'));module[_0x5c0a('0x1')]={'body':{'type':Sequelize[_0x5c0a('0x2')](_0x5c0a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5c0a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5c0a('0x5')]}};
\ No newline at end of file
index 144525c..e1dd9da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc879=['update','destroy','stack','name','index','map','fieldName','query','filters','intersection','attributes','model','fields','length','nolimit','order','where','pick','filter','merge','type','VIRTUAL','ChatInternalMessage','then','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','online','lastLoginAt','sort','VoiceQueue','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save'];(function(_0x6595d5,_0x3f84e1){var _0x1b7304=function(_0x44f4f8){while(--_0x44f4f8){_0x6595d5['push'](_0x6595d5['shift']());}};_0x1b7304(++_0x3f84e1);}(_0xc879,0xae));var _0x9c87=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xc879[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x9c87('0x0'));var rimraf=require(_0x9c87('0x1'));var zipdir=require(_0x9c87('0x2'));var jsonpatch=require(_0x9c87('0x3'));var rp=require('request-promise');var moment=require(_0x9c87('0x4'));var BPromise=require(_0x9c87('0x5'));var Mustache=require('mustache');var util=require(_0x9c87('0x6'));var path=require(_0x9c87('0x7'));var sox=require(_0x9c87('0x8'));var csv=require(_0x9c87('0x9'));var ejs=require(_0x9c87('0xa'));var fs=require('fs');var fs_extra=require(_0x9c87('0xb'));var _=require('lodash');var squel=require(_0x9c87('0xc'));var crypto=require('crypto');var jsforce=require(_0x9c87('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9c87('0xe'));var Papa=require(_0x9c87('0xf'));var Redis=require(_0x9c87('0x10'));var authService=require(_0x9c87('0x11'));var qs=require(_0x9c87('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c87('0x13'));var logger=require('../../config/logger')(_0x9c87('0x14'));var utils=require(_0x9c87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9c87('0x16'));var db=require(_0x9c87('0x17'))['db'];config[_0x9c87('0x18')]=_[_0x9c87('0x19')](config[_0x9c87('0x18')],{'host':_0x9c87('0x1a'),'port':0x18eb});var socket=require(_0x9c87('0x1b'))(new Redis(config['redis']));require(_0x9c87('0x1c'))[_0x9c87('0x1d')](socket);function respondWithStatusCode(_0x1b1b4e,_0x472e9f){_0x472e9f=_0x472e9f||0xcc;return function(_0x2c928e){if(_0x2c928e){return _0x1b1b4e[_0x9c87('0x1e')](_0x472e9f);}return _0x1b1b4e[_0x9c87('0x1f')](_0x472e9f)[_0x9c87('0x20')]();};}function respondWithResult(_0x21d637,_0x1c7628){_0x1c7628=_0x1c7628||0xc8;return function(_0xa32f90){if(_0xa32f90){return _0x21d637['status'](_0x1c7628)[_0x9c87('0x21')](_0xa32f90);}};}function respondWithFilteredResult(_0x2dd586,_0x2507bb){return function(_0xeac869){if(_0xeac869){var _0x427240=typeof _0x2507bb[_0x9c87('0x22')]===_0x9c87('0x23')&&typeof _0x2507bb[_0x9c87('0x24')]===_0x9c87('0x23');var _0x322563=_0xeac869['count'];var _0x1a6a7f=_0x427240?0x0:_0x2507bb[_0x9c87('0x22')];var _0x226b5=_0x427240?_0xeac869[_0x9c87('0x25')]:_0x2507bb[_0x9c87('0x22')]+_0x2507bb[_0x9c87('0x24')];var _0x4016c8;if(_0x226b5>=_0x322563){_0x226b5=_0x322563;_0x4016c8=0xc8;}else{_0x4016c8=0xce;}_0x2dd586[_0x9c87('0x1f')](_0x4016c8);return _0x2dd586['set'](_0x9c87('0x26'),_0x1a6a7f+'-'+_0x226b5+'/'+_0x322563)[_0x9c87('0x21')](_0xeac869);}return null;};}function patchUpdates(_0x1bb5ee){return function(_0x506d84){try{jsonpatch[_0x9c87('0x27')](_0x506d84,_0x1bb5ee,!![]);}catch(_0x136ba1){return BPromise[_0x9c87('0x28')](_0x136ba1);}return _0x506d84[_0x9c87('0x29')]();};}function saveUpdates(_0x571065,_0x52e558){return function(_0x4d46a0){if(_0x4d46a0){return _0x4d46a0[_0x9c87('0x2a')](_0x571065)['then'](function(_0x33487f){return _0x33487f;});}return null;};}function removeEntity(_0x58a702,_0x40a06c){return function(_0x2b7ddf){if(_0x2b7ddf){return _0x2b7ddf[_0x9c87('0x2b')]()['then'](function(){_0x58a702['status'](0xcc)[_0x9c87('0x20')]();});}};}function handleEntityNotFound(_0x1e169b,_0x4633fb){return function(_0x1b94ec){if(!_0x1b94ec){_0x1e169b[_0x9c87('0x1e')](0x194);}return _0x1b94ec;};}function handleError(_0x396794,_0x5e2c6a){_0x5e2c6a=_0x5e2c6a||0x1f4;return function(_0x58029b){logger['error'](_0x58029b[_0x9c87('0x2c')]);if(_0x58029b[_0x9c87('0x2d')]){delete _0x58029b['name'];}_0x396794[_0x9c87('0x1f')](_0x5e2c6a)['send'](_0x58029b);};}exports[_0x9c87('0x2e')]=function(_0x4c2477,_0x12a939){var _0x2a6105={},_0xed8b2b={},_0x3a549d={'count':0x0,'rows':[]};var _0x4debec=_[_0x9c87('0x2f')](db['ChatInternalMessage']['rawAttributes'],function(_0x4f464a){return{'name':_0x4f464a[_0x9c87('0x30')],'type':_0x4f464a['type']['key']};});_0xed8b2b['model']=_['map'](_0x4debec,_0x9c87('0x2d'));_0xed8b2b[_0x9c87('0x31')]=_['keys'](_0x4c2477[_0x9c87('0x31')]);_0xed8b2b[_0x9c87('0x32')]=_[_0x9c87('0x33')](_0xed8b2b['model'],_0xed8b2b[_0x9c87('0x31')]);_0x2a6105[_0x9c87('0x34')]=_[_0x9c87('0x33')](_0xed8b2b[_0x9c87('0x35')],qs[_0x9c87('0x36')](_0x4c2477[_0x9c87('0x31')]['fields']));_0x2a6105[_0x9c87('0x34')]=_0x2a6105[_0x9c87('0x34')][_0x9c87('0x37')]?_0x2a6105['attributes']:_0xed8b2b[_0x9c87('0x35')];if(!_0x4c2477[_0x9c87('0x31')]['hasOwnProperty'](_0x9c87('0x38'))){_0x2a6105[_0x9c87('0x24')]=qs[_0x9c87('0x24')](_0x4c2477[_0x9c87('0x31')][_0x9c87('0x24')]);_0x2a6105[_0x9c87('0x22')]=qs[_0x9c87('0x22')](_0x4c2477[_0x9c87('0x31')][_0x9c87('0x22')]);}_0x2a6105[_0x9c87('0x39')]=qs['sort'](_0x4c2477[_0x9c87('0x31')]['sort']);_0x2a6105[_0x9c87('0x3a')]=qs[_0x9c87('0x32')](_[_0x9c87('0x3b')](_0x4c2477['query'],_0xed8b2b[_0x9c87('0x32')]),_0x4debec);if(_0x4c2477[_0x9c87('0x31')][_0x9c87('0x3c')]){_0x2a6105[_0x9c87('0x3a')]=_[_0x9c87('0x3d')](_0x2a6105[_0x9c87('0x3a')],{'$or':_['map'](_0x4debec,function(_0x324347){if(_0x324347[_0x9c87('0x3e')]!==_0x9c87('0x3f')){var _0x23dc90={};_0x23dc90[_0x324347['name']]={'$like':'%'+_0x4c2477[_0x9c87('0x31')][_0x9c87('0x3c')]+'%'};return _0x23dc90;}})});}_0x2a6105=_[_0x9c87('0x3d')]({},_0x2a6105,_0x4c2477['options']);var _0x4b5fd8={'where':_0x2a6105[_0x9c87('0x3a')]};return db[_0x9c87('0x40')]['count'](_0x4b5fd8)[_0x9c87('0x41')](function(_0x5cafce){_0x3a549d[_0x9c87('0x25')]=_0x5cafce;if(_0x4c2477['query']['includeAll']){_0x2a6105[_0x9c87('0x42')]=[{'all':!![]}];}return db[_0x9c87('0x40')][_0x9c87('0x43')](_0x2a6105);})[_0x9c87('0x41')](function(_0x6e8d3){_0x3a549d['rows']=_0x6e8d3;return _0x3a549d;})[_0x9c87('0x41')](respondWithFilteredResult(_0x12a939,_0x2a6105))[_0x9c87('0x44')](handleError(_0x12a939,null));};exports[_0x9c87('0x45')]=function(_0x1ad7b8,_0x27d1d5){var _0x54795a={'raw':!![],'where':{'id':_0x1ad7b8[_0x9c87('0x46')]['id']}},_0x3c25ad={};_0x3c25ad[_0x9c87('0x35')]=_[_0x9c87('0x47')](db['ChatInternalMessage']['rawAttributes']);_0x3c25ad[_0x9c87('0x31')]=_[_0x9c87('0x47')](_0x1ad7b8[_0x9c87('0x31')]);_0x3c25ad[_0x9c87('0x32')]=_[_0x9c87('0x33')](_0x3c25ad[_0x9c87('0x35')],_0x3c25ad['query']);_0x54795a[_0x9c87('0x34')]=_[_0x9c87('0x33')](_0x3c25ad[_0x9c87('0x35')],qs[_0x9c87('0x36')](_0x1ad7b8[_0x9c87('0x31')][_0x9c87('0x36')]));_0x54795a[_0x9c87('0x34')]=_0x54795a[_0x9c87('0x34')][_0x9c87('0x37')]?_0x54795a['attributes']:_0x3c25ad['model'];if(_0x1ad7b8[_0x9c87('0x31')][_0x9c87('0x48')]){_0x54795a[_0x9c87('0x42')]=[{'all':!![]}];}_0x54795a=_[_0x9c87('0x3d')]({},_0x54795a,_0x1ad7b8[_0x9c87('0x49')]);return db[_0x9c87('0x40')][_0x9c87('0x4a')](_0x54795a)['then'](handleEntityNotFound(_0x27d1d5,null))[_0x9c87('0x41')](respondWithResult(_0x27d1d5,null))['catch'](handleError(_0x27d1d5,null));};exports[_0x9c87('0x4b')]=function(_0x26a4db,_0x5a01d1){return db[_0x9c87('0x40')]['create'](_0x26a4db[_0x9c87('0x4c')],{})[_0x9c87('0x41')](respondWithResult(_0x5a01d1,0xc9))['catch'](handleError(_0x5a01d1,null));};exports[_0x9c87('0x2a')]=function(_0x3bb56e,_0x57cce2){if(_0x3bb56e[_0x9c87('0x4c')]['id']){delete _0x3bb56e[_0x9c87('0x4c')]['id'];}return db[_0x9c87('0x40')][_0x9c87('0x4a')]({'where':{'id':_0x3bb56e['params']['id']}})[_0x9c87('0x41')](handleEntityNotFound(_0x57cce2,null))['then'](saveUpdates(_0x3bb56e[_0x9c87('0x4c')],null))[_0x9c87('0x41')](respondWithResult(_0x57cce2,null))[_0x9c87('0x44')](handleError(_0x57cce2,null));};exports[_0x9c87('0x2b')]=function(_0x52e823,_0x1959bc){return db['ChatInternalMessage'][_0x9c87('0x4a')]({'where':{'id':_0x52e823[_0x9c87('0x46')]['id']}})[_0x9c87('0x41')](handleEntityNotFound(_0x1959bc,null))['then'](removeEntity(_0x1959bc,null))[_0x9c87('0x44')](handleError(_0x1959bc,null));};exports[_0x9c87('0x4d')]=function(_0x39cf27,_0x3da7a7){return db['ChatInternalMessage']['describe']()[_0x9c87('0x41')](respondWithResult(_0x3da7a7,null))[_0x9c87('0x44')](handleError(_0x3da7a7,null));};function wrapUser(_0x2beb00){return function(_0x8a948f){var _0x578c19=_0x2beb00[_0x9c87('0x4e')]({'plain':!![]});_0x578c19[_0x9c87('0x4f')]=[];if(_0x8a948f){_0x578c19[_0x9c87('0x50')]=_0x8a948f[_0x9c87('0x51')];_0x578c19[_0x9c87('0x52')]=_0x8a948f;}else{_0x578c19[_0x9c87('0x50')]=moment(0x0)[_0x9c87('0x53')](_0x9c87('0x54'));_0x578c19[_0x9c87('0x52')]={};}return _0x578c19;};}exports[_0x9c87('0x55')]=function(_0x39e627,_0x3e8d06,_0x15c080){var _0x878772=[];return db[_0x9c87('0x56')][_0x9c87('0x43')]({'where':{'role':['agent',_0x9c87('0x57'),'user']},'attributes':['id',_0x9c87('0x58'),_0x9c87('0x2d'),_0x9c87('0x59'),'userpic','internal',_0x9c87('0x5a'),_0x9c87('0x5b'),'allowmessenger','showWebBar'],'order':qs[_0x9c87('0x5c')]('-online'),'include':[{'model':db[_0x9c87('0x5d')],'as':_0x9c87('0x5e'),'attributes':['id',_0x9c87('0x2d'),_0x9c87('0x3e')],'through':{'attributes':[]}}]})[_0x9c87('0x41')](function(_0x3d14b0){if(_0x3d14b0){var _0x86440d=_0x39e627[_0x9c87('0x5f')][_0x9c87('0x4e')]({'plain':!![]});if(!_0x86440d)throw new Error(_0x9c87('0x60'));if(_0x86440d[_0x9c87('0x59')]===_0x9c87('0x5f')){return db[_0x9c87('0x61')]['find']({'where':{'name':'Agents','userProfileId':_0x86440d[_0x9c87('0x62')]},'raw':!![]})['then'](function(_0x21adf8){if(_0x21adf8){if(_0x21adf8[_0x9c87('0x63')]===0x0){return db[_0x9c87('0x64')]['findAll']({'where':{'sectionId':_0x21adf8['id']},'raw':!![]})[_0x9c87('0x41')](function(_0xa5092f){var _0x292c5f=[];if(_[_0x9c87('0x65')](_0xa5092f)){_0x292c5f=_['filter'](_0x3d14b0,function(_0x1ec3a7){if(_0x1ec3a7[_0x9c87('0x59')]!==_0x9c87('0x66')){return _0x1ec3a7;}});return _0x292c5f;}else{for(var _0x3c06eb=0x0;_0x3c06eb<_0x3d14b0[_0x9c87('0x37')];_0x3c06eb++){var _0x1820b5=_0x3d14b0[_0x3c06eb];if(_0x1820b5[_0x9c87('0x59')]===_0x9c87('0x66')){var _0x6ef7ef=_[_0x9c87('0x4a')](_0xa5092f,function(_0x116e7e){return _0x116e7e[_0x9c87('0x67')]===_0x1820b5['id'];});if(_0x6ef7ef)_0x292c5f[_0x9c87('0x68')](_0x1820b5);}else{_0x292c5f[_0x9c87('0x68')](_0x1820b5);}}return _0x292c5f;}});}else{return _0x3d14b0;}}else{var _0xeea046=_[_0x9c87('0x3c')](_0x3d14b0,function(_0x15ff74){if(_0x15ff74[_0x9c87('0x59')]!==_0x9c87('0x66')){return _0x15ff74;}});return _0xeea046;}});}else{return _0x3d14b0;}}})['then'](function(_0x31cff4){var _0x3b297d=[];if(_0x31cff4){_0x878772=_0x31cff4;for(var _0x200a55=0x0;_0x200a55<_0x31cff4[_0x9c87('0x37')];_0x200a55+=0x1){_0x878772[_0x200a55][_0x9c87('0x4f')]=[];_0x3b297d[_0x9c87('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x39e627['user']['id'],_0x31cff4[_0x200a55]['id']],'ToId':[_0x39e627['user']['id'],_0x31cff4[_0x200a55]['id']],'ChatGroupId':null},'attributes':['id',_0x9c87('0x51'),_0x9c87('0x69'),'ToId',_0x9c87('0x6a'),_0x9c87('0x4c')],'order':qs['sort'](_0x9c87('0x6b')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x31cff4[_0x200a55])));}return BPromise['all'](_0x3b297d);}return[];})['then'](function(_0x33e8a3){return{'rows':_0x33e8a3,'count':_0x33e8a3[_0x9c87('0x37')]};})['then'](respondWithResult(_0x3e8d06,null))[_0x9c87('0x44')](handleError(_0x3e8d06,null));};
\ No newline at end of file
+var _0x5b81=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','redis','./chatInternalMessage.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','end','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','destroy','describe','get','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x48d2f6,_0x27d596){var _0x219dba=function(_0x6d0dff){while(--_0x6d0dff){_0x48d2f6['push'](_0x48d2f6['shift']());}};_0x219dba(++_0x27d596);}(_0x5b81,0x65));var _0x15b8=function(_0x168600,_0x592ff9){_0x168600=_0x168600-0x0;var _0x36d379=_0x5b81[_0x168600];return _0x36d379;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15b8('0x0'));var zipdir=require(_0x15b8('0x1'));var jsonpatch=require(_0x15b8('0x2'));var rp=require(_0x15b8('0x3'));var moment=require(_0x15b8('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15b8('0x5'));var path=require(_0x15b8('0x6'));var sox=require(_0x15b8('0x7'));var csv=require(_0x15b8('0x8'));var ejs=require(_0x15b8('0x9'));var fs=require('fs');var fs_extra=require(_0x15b8('0xa'));var _=require(_0x15b8('0xb'));var squel=require(_0x15b8('0xc'));var crypto=require(_0x15b8('0xd'));var jsforce=require(_0x15b8('0xe'));var deskjs=require(_0x15b8('0xf'));var toCsv=require(_0x15b8('0x8'));var querystring=require(_0x15b8('0x10'));var Papa=require(_0x15b8('0x11'));var Redis=require(_0x15b8('0x12'));var authService=require(_0x15b8('0x13'));var qs=require(_0x15b8('0x14'));var as=require(_0x15b8('0x15'));var hardwareService=require(_0x15b8('0x16'));var logger=require(_0x15b8('0x17'))(_0x15b8('0x18'));var utils=require(_0x15b8('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x15b8('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x15b8('0x1b')](config['redis'],{'host':_0x15b8('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x15b8('0x1d')]));require(_0x15b8('0x1e'))[_0x15b8('0x1f')](socket);function respondWithStatusCode(_0x561ab6,_0x261018){_0x261018=_0x261018||0xcc;return function(_0x335752){if(_0x335752){return _0x561ab6[_0x15b8('0x20')](_0x261018);}return _0x561ab6['status'](_0x261018)['end']();};}function respondWithResult(_0xccc4af,_0x5679fa){_0x5679fa=_0x5679fa||0xc8;return function(_0x3fa648){if(_0x3fa648){return _0xccc4af[_0x15b8('0x21')](_0x5679fa)[_0x15b8('0x22')](_0x3fa648);}};}function respondWithFilteredResult(_0x4e1f7,_0x34c3c8){return function(_0x4d4c56){if(_0x4d4c56){var _0x2285f4=typeof _0x34c3c8['offset']===_0x15b8('0x23')&&typeof _0x34c3c8[_0x15b8('0x24')]==='undefined';var _0x2e55d8=_0x4d4c56[_0x15b8('0x25')];var _0x23aa13=_0x2285f4?0x0:_0x34c3c8[_0x15b8('0x26')];var _0x566d82=_0x2285f4?_0x4d4c56[_0x15b8('0x25')]:_0x34c3c8[_0x15b8('0x26')]+_0x34c3c8[_0x15b8('0x24')];var _0x390d84;if(_0x566d82>=_0x2e55d8){_0x566d82=_0x2e55d8;_0x390d84=0xc8;}else{_0x390d84=0xce;}_0x4e1f7['status'](_0x390d84);return _0x4e1f7['set'](_0x15b8('0x27'),_0x23aa13+'-'+_0x566d82+'/'+_0x2e55d8)[_0x15b8('0x22')](_0x4d4c56);}return null;};}function patchUpdates(_0x1c50fd){return function(_0x25a69e){try{jsonpatch[_0x15b8('0x28')](_0x25a69e,_0x1c50fd,!![]);}catch(_0x33b81f){return BPromise['reject'](_0x33b81f);}return _0x25a69e[_0x15b8('0x29')]();};}function saveUpdates(_0xf274c0,_0x4585c5){return function(_0x2aff5a){if(_0x2aff5a){return _0x2aff5a['update'](_0xf274c0)[_0x15b8('0x2a')](function(_0x2f09df){return _0x2f09df;});}return null;};}function removeEntity(_0x253ee6,_0x11c081){return function(_0x11c8b9){if(_0x11c8b9){return _0x11c8b9['destroy']()[_0x15b8('0x2a')](function(){_0x253ee6[_0x15b8('0x21')](0xcc)[_0x15b8('0x2b')]();});}};}function handleEntityNotFound(_0x2f61d3,_0x141729){return function(_0x141a20){if(!_0x141a20){_0x2f61d3[_0x15b8('0x20')](0x194);}return _0x141a20;};}function handleError(_0x2c7e7a,_0x236a42){_0x236a42=_0x236a42||0x1f4;return function(_0x4a8a23){logger[_0x15b8('0x2c')](_0x4a8a23[_0x15b8('0x2d')]);if(_0x4a8a23[_0x15b8('0x2e')]){delete _0x4a8a23['name'];}_0x2c7e7a[_0x15b8('0x21')](_0x236a42)[_0x15b8('0x2f')](_0x4a8a23);};}exports[_0x15b8('0x30')]=function(_0xab3c99,_0x6a074b){var _0x3a77fc={},_0x1f091f={},_0x220f96={'count':0x0,'rows':[]};var _0x2c1356=_[_0x15b8('0x31')](db[_0x15b8('0x32')][_0x15b8('0x33')],function(_0x5ec7c8){return{'name':_0x5ec7c8[_0x15b8('0x34')],'type':_0x5ec7c8[_0x15b8('0x35')][_0x15b8('0x36')]};});_0x1f091f['model']=_[_0x15b8('0x31')](_0x2c1356,_0x15b8('0x2e'));_0x1f091f[_0x15b8('0x37')]=_['keys'](_0xab3c99[_0x15b8('0x37')]);_0x1f091f[_0x15b8('0x38')]=_[_0x15b8('0x39')](_0x1f091f[_0x15b8('0x3a')],_0x1f091f[_0x15b8('0x37')]);_0x3a77fc['attributes']=_[_0x15b8('0x39')](_0x1f091f['model'],qs[_0x15b8('0x3b')](_0xab3c99[_0x15b8('0x37')]['fields']));_0x3a77fc[_0x15b8('0x3c')]=_0x3a77fc[_0x15b8('0x3c')][_0x15b8('0x3d')]?_0x3a77fc[_0x15b8('0x3c')]:_0x1f091f[_0x15b8('0x3a')];if(!_0xab3c99[_0x15b8('0x37')][_0x15b8('0x3e')]('nolimit')){_0x3a77fc[_0x15b8('0x24')]=qs[_0x15b8('0x24')](_0xab3c99[_0x15b8('0x37')]['limit']);_0x3a77fc[_0x15b8('0x26')]=qs[_0x15b8('0x26')](_0xab3c99['query'][_0x15b8('0x26')]);}_0x3a77fc[_0x15b8('0x3f')]=qs['sort'](_0xab3c99[_0x15b8('0x37')][_0x15b8('0x40')]);_0x3a77fc[_0x15b8('0x41')]=qs[_0x15b8('0x38')](_['pick'](_0xab3c99[_0x15b8('0x37')],_0x1f091f[_0x15b8('0x38')]),_0x2c1356);if(_0xab3c99['query'][_0x15b8('0x42')]){_0x3a77fc['where']=_['merge'](_0x3a77fc[_0x15b8('0x41')],{'$or':_[_0x15b8('0x31')](_0x2c1356,function(_0x42a177){if(_0x42a177[_0x15b8('0x35')]!=='VIRTUAL'){var _0x21cd70={};_0x21cd70[_0x42a177[_0x15b8('0x2e')]]={'$like':'%'+_0xab3c99[_0x15b8('0x37')]['filter']+'%'};return _0x21cd70;}})});}_0x3a77fc=_[_0x15b8('0x43')]({},_0x3a77fc,_0xab3c99['options']);var _0xe8b617={'where':_0x3a77fc['where']};return db['ChatInternalMessage'][_0x15b8('0x25')](_0xe8b617)[_0x15b8('0x2a')](function(_0x440192){_0x220f96[_0x15b8('0x25')]=_0x440192;if(_0xab3c99[_0x15b8('0x37')]['includeAll']){_0x3a77fc[_0x15b8('0x44')]=[{'all':!![]}];}return db[_0x15b8('0x32')][_0x15b8('0x45')](_0x3a77fc);})[_0x15b8('0x2a')](function(_0x43f006){_0x220f96[_0x15b8('0x46')]=_0x43f006;return _0x220f96;})[_0x15b8('0x2a')](respondWithFilteredResult(_0x6a074b,_0x3a77fc))[_0x15b8('0x47')](handleError(_0x6a074b,null));};exports[_0x15b8('0x48')]=function(_0x19399d,_0x3b4d20){var _0x55a787={'raw':!![],'where':{'id':_0x19399d[_0x15b8('0x49')]['id']}},_0xc691f8={};_0xc691f8[_0x15b8('0x3a')]=_['keys'](db[_0x15b8('0x32')]['rawAttributes']);_0xc691f8[_0x15b8('0x37')]=_[_0x15b8('0x4a')](_0x19399d['query']);_0xc691f8[_0x15b8('0x38')]=_['intersection'](_0xc691f8[_0x15b8('0x3a')],_0xc691f8['query']);_0x55a787[_0x15b8('0x3c')]=_['intersection'](_0xc691f8[_0x15b8('0x3a')],qs[_0x15b8('0x3b')](_0x19399d[_0x15b8('0x37')]['fields']));_0x55a787[_0x15b8('0x3c')]=_0x55a787[_0x15b8('0x3c')][_0x15b8('0x3d')]?_0x55a787[_0x15b8('0x3c')]:_0xc691f8[_0x15b8('0x3a')];if(_0x19399d[_0x15b8('0x37')][_0x15b8('0x4b')]){_0x55a787[_0x15b8('0x44')]=[{'all':!![]}];}_0x55a787=_[_0x15b8('0x43')]({},_0x55a787,_0x19399d['options']);return db[_0x15b8('0x32')][_0x15b8('0x4c')](_0x55a787)[_0x15b8('0x2a')](handleEntityNotFound(_0x3b4d20,null))[_0x15b8('0x2a')](respondWithResult(_0x3b4d20,null))[_0x15b8('0x47')](handleError(_0x3b4d20,null));};exports[_0x15b8('0x4d')]=function(_0x4ff971,_0x184ddd){return db['ChatInternalMessage'][_0x15b8('0x4d')](_0x4ff971[_0x15b8('0x4e')],{})['then'](respondWithResult(_0x184ddd,0xc9))[_0x15b8('0x47')](handleError(_0x184ddd,null));};exports['update']=function(_0x914da9,_0x4c933b){if(_0x914da9[_0x15b8('0x4e')]['id']){delete _0x914da9['body']['id'];}return db['ChatInternalMessage'][_0x15b8('0x4c')]({'where':{'id':_0x914da9['params']['id']}})['then'](handleEntityNotFound(_0x4c933b,null))[_0x15b8('0x2a')](saveUpdates(_0x914da9['body'],null))[_0x15b8('0x2a')](respondWithResult(_0x4c933b,null))[_0x15b8('0x47')](handleError(_0x4c933b,null));};exports[_0x15b8('0x4f')]=function(_0x992156,_0x208933){return db[_0x15b8('0x32')][_0x15b8('0x4c')]({'where':{'id':_0x992156['params']['id']}})['then'](handleEntityNotFound(_0x208933,null))[_0x15b8('0x2a')](removeEntity(_0x208933,null))[_0x15b8('0x47')](handleError(_0x208933,null));};exports[_0x15b8('0x50')]=function(_0x2a06e1,_0x4e53f6){return db[_0x15b8('0x32')][_0x15b8('0x50')]()['then'](respondWithResult(_0x4e53f6,null))[_0x15b8('0x47')](handleError(_0x4e53f6,null));};function wrapUser(_0x111df3){return function(_0x29ff0f){var _0x17d00c=_0x111df3[_0x15b8('0x51')]({'plain':!![]});_0x17d00c[_0x15b8('0x52')]=[];if(_0x29ff0f){_0x17d00c['lastMessageAt']=_0x29ff0f[_0x15b8('0x53')];_0x17d00c[_0x15b8('0x54')]=_0x29ff0f;}else{_0x17d00c[_0x15b8('0x55')]=moment(0x0)[_0x15b8('0x56')](_0x15b8('0x57'));_0x17d00c[_0x15b8('0x54')]={};}return _0x17d00c;};}exports[_0x15b8('0x58')]=function(_0x22cfdc,_0x226cf8,_0x5bfdea){var _0x2a416d=[];return db[_0x15b8('0x59')][_0x15b8('0x45')]({'where':{'role':[_0x15b8('0x5a'),_0x15b8('0x5b'),_0x15b8('0x5c')]},'attributes':['id',_0x15b8('0x5d'),_0x15b8('0x2e'),_0x15b8('0x5e'),_0x15b8('0x5f'),'internal',_0x15b8('0x60'),_0x15b8('0x61'),_0x15b8('0x62'),_0x15b8('0x63')],'order':qs[_0x15b8('0x40')](_0x15b8('0x64')),'include':[{'model':db[_0x15b8('0x65')],'as':_0x15b8('0x66'),'attributes':['id',_0x15b8('0x2e'),_0x15b8('0x35')],'through':{'attributes':[]}}]})[_0x15b8('0x2a')](function(_0x54b438){if(_0x54b438){var _0x12ea7d=_0x22cfdc[_0x15b8('0x5c')][_0x15b8('0x51')]({'plain':!![]});if(!_0x12ea7d)throw new Error(_0x15b8('0x67'));if(_0x12ea7d[_0x15b8('0x5e')]===_0x15b8('0x5c')){return db['UserProfileSection'][_0x15b8('0x4c')]({'where':{'name':_0x15b8('0x68'),'userProfileId':_0x12ea7d[_0x15b8('0x69')]},'raw':!![]})[_0x15b8('0x2a')](function(_0xc543dd){if(_0xc543dd){if(_0xc543dd['autoAssociation']===0x0){return db[_0x15b8('0x6a')]['findAll']({'where':{'sectionId':_0xc543dd['id']},'raw':!![]})['then'](function(_0x51412b){var _0x2da23f=[];if(_[_0x15b8('0x6b')](_0x51412b)){_0x2da23f=_[_0x15b8('0x42')](_0x54b438,function(_0x131eaa){if(_0x131eaa[_0x15b8('0x5e')]!==_0x15b8('0x5a')){return _0x131eaa;}});return _0x2da23f;}else{for(var _0x22c9a9=0x0;_0x22c9a9<_0x54b438[_0x15b8('0x3d')];_0x22c9a9++){var _0x532ec4=_0x54b438[_0x22c9a9];if(_0x532ec4['role']===_0x15b8('0x5a')){var _0x17d6ee=_[_0x15b8('0x4c')](_0x51412b,function(_0x4a23a3){return _0x4a23a3[_0x15b8('0x6c')]===_0x532ec4['id'];});if(_0x17d6ee)_0x2da23f[_0x15b8('0x6d')](_0x532ec4);}else{_0x2da23f[_0x15b8('0x6d')](_0x532ec4);}}return _0x2da23f;}});}else{return _0x54b438;}}else{var _0x477ae8=_[_0x15b8('0x42')](_0x54b438,function(_0x3ae1c2){if(_0x3ae1c2['role']!==_0x15b8('0x5a')){return _0x3ae1c2;}});return _0x477ae8;}});}else{return _0x54b438;}}})[_0x15b8('0x2a')](function(_0x1c2a4e){var _0x2442c8=[];if(_0x1c2a4e){_0x2a416d=_0x1c2a4e;for(var _0x5b7fef=0x0;_0x5b7fef<_0x1c2a4e[_0x15b8('0x3d')];_0x5b7fef+=0x1){_0x2a416d[_0x5b7fef]['messages']=[];_0x2442c8[_0x15b8('0x6d')](db[_0x15b8('0x32')][_0x15b8('0x4c')]({'where':{'FromId':[_0x22cfdc[_0x15b8('0x5c')]['id'],_0x1c2a4e[_0x5b7fef]['id']],'ToId':[_0x22cfdc[_0x15b8('0x5c')]['id'],_0x1c2a4e[_0x5b7fef]['id']],'ChatGroupId':null},'attributes':['id',_0x15b8('0x53'),_0x15b8('0x6e'),_0x15b8('0x6f'),_0x15b8('0x70'),'body'],'order':qs[_0x15b8('0x40')](_0x15b8('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x15b8('0x2a')](wrapUser(_0x1c2a4e[_0x5b7fef])));}return BPromise['all'](_0x2442c8);}return[];})[_0x15b8('0x2a')](function(_0x3cacc1){return{'rows':_0x3cacc1,'count':_0x3cacc1['length']};})[_0x15b8('0x2a')](respondWithResult(_0x226cf8,null))[_0x15b8('0x47')](handleError(_0x226cf8,null));};
\ No newline at end of file
index 6bf2050..89c608d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df6=['hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x6df6,0xb6));var _0x66df=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0x6df6[_0x597484];return _0x218e64;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x66df('0x0'))['db'][_0x66df('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x66df('0x2')](0x0);var events={'afterCreate':_0x66df('0x3'),'afterUpdate':'update','afterDestroy':_0x66df('0x4')};function emitEvent(_0x228964){return function(_0x1d6492,_0x465d71,_0x3cd814){ChatInternalMessageEvents['emit'](_0x228964+':'+_0x1d6492['id'],_0x1d6492);ChatInternalMessageEvents[_0x66df('0x5')](_0x228964,_0x1d6492);_0x3cd814(null);};}for(var e in events){if(events[_0x66df('0x6')](e)){var event=events[e];ChatInternalMessage[_0x66df('0x7')](e,emitEvent(event));}}module[_0x66df('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x90ad=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x2a9ec5,_0xed23b){var _0x52c7c0=function(_0x54b22d){while(--_0x54b22d){_0x2a9ec5['push'](_0x2a9ec5['shift']());}};_0x52c7c0(++_0xed23b);}(_0x90ad,0x195));var _0xd90a=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x90ad[_0x550d12];return _0x12103d;};'use strict';var EventEmitter=require(_0xd90a('0x0'));var ChatInternalMessage=require(_0xd90a('0x1'))['db'][_0xd90a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd90a('0x3')](0x0);var events={'afterCreate':_0xd90a('0x4'),'afterUpdate':'update','afterDestroy':_0xd90a('0x5')};function emitEvent(_0x844190){return function(_0x45e9f3,_0x5e9622,_0x2691eb){ChatInternalMessageEvents['emit'](_0x844190+':'+_0x45e9f3['id'],_0x45e9f3);ChatInternalMessageEvents[_0xd90a('0x6')](_0x844190,_0x45e9f3);_0x2691eb(null);};}for(var e in events){if(events[_0xd90a('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xd90a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
index aa18201..986fd47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe77d=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xe77d,0x163));var _0xde77=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xe77d[_0x581249];return _0x284bae;};'use strict';var _=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var logger=require(_0xde77('0x2'))(_0xde77('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xde77('0x4'));var fs=require('fs');var path=require(_0xde77('0x5'));var rimraf=require(_0xde77('0x6'));var config=require(_0xde77('0x7'));var attributes=require(_0xde77('0x8'));module['exports']=function(_0x41c6c2,_0x44d28a){return _0x41c6c2[_0xde77('0x9')](_0xde77('0xa'),attributes,{'tableName':_0xde77('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde77('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x19ca=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatInternalMessage.attributes','exports','define'];(function(_0x17bb6a,_0x20cbca){var _0x5346ec=function(_0x1fda6a){while(--_0x1fda6a){_0x17bb6a['push'](_0x17bb6a['shift']());}};_0x5346ec(++_0x20cbca);}(_0x19ca,0xda));var _0xa19c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x19ca[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xa19c('0x0'));var logger=require(_0xa19c('0x1'))(_0xa19c('0x2'));var moment=require(_0xa19c('0x3'));var BPromise=require(_0xa19c('0x4'));var rp=require(_0xa19c('0x5'));var fs=require('fs');var path=require(_0xa19c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa19c('0x7'));module[_0xa19c('0x8')]=function(_0x56b94b,_0x4058bc){return _0x56b94b[_0xa19c('0x9')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa19c('0xa'),'collate':_0xa19c('0xb')});};
\ No newline at end of file
index 10f081c..fb8a455 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf73=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2d8040,_0x3b44b1){var _0x2dfc90=function(_0xad65ee){while(--_0xad65ee){_0x2d8040['push'](_0x2d8040['shift']());}};_0x2dfc90(++_0x3b44b1);}(_0xaf73,0x19d));var _0x3af7=function(_0x3e2081,_0x55efd1){_0x3e2081=_0x3e2081-0x0;var _0x2897b0=_0xaf73[_0x3e2081];return _0x2897b0;};'use strict';var _=require(_0x3af7('0x0'));var util=require(_0x3af7('0x1'));var moment=require(_0x3af7('0x2'));var BPromise=require(_0x3af7('0x3'));var rs=require(_0x3af7('0x4'));var fs=require('fs');var Redis=require(_0x3af7('0x5'));var db=require(_0x3af7('0x6'))['db'];var utils=require(_0x3af7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3af7('0x8'));var jayson=require(_0x3af7('0x9'));var client=jayson[_0x3af7('0xa')][_0x3af7('0xb')]({'port':0x232a});config[_0x3af7('0xc')]=_[_0x3af7('0xd')](config[_0x3af7('0xc')],{'host':_0x3af7('0xe'),'port':0x18eb});var socket=require(_0x3af7('0xf'))(new Redis(config[_0x3af7('0xc')]));require(_0x3af7('0x10'))[_0x3af7('0x11')](socket);function respondWithRpcPromise(_0xc028c3,_0x53840e,_0x2506dd){return new BPromise(function(_0x2f3265,_0x421c26){return client[_0x3af7('0x12')](_0xc028c3,_0x2506dd)[_0x3af7('0x13')](function(_0x17705b){logger[_0x3af7('0x14')](_0x3af7('0x15'),_0x53840e,_0x3af7('0x16'));logger[_0x3af7('0x17')](_0x3af7('0x18'),_0x53840e,'request\x20sent',JSON[_0x3af7('0x19')](_0x17705b));if(_0x17705b[_0x3af7('0x1a')]){if(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1b')]===0x1f4){logger['error'](_0x3af7('0x15'),_0x53840e,_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);return _0x421c26(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);}logger[_0x3af7('0x1a')](_0x3af7('0x15'),_0x53840e,_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);return _0x2f3265(_0x17705b[_0x3af7('0x1a')][_0x3af7('0x1c')]);}else{logger[_0x3af7('0x14')](_0x3af7('0x15'),_0x53840e,'request\x20sent');_0x2f3265(_0x17705b[_0x3af7('0x1d')][_0x3af7('0x1c')]);}})['catch'](function(_0x4d8dfd){logger['error'](_0x3af7('0x15'),_0x53840e,_0x4d8dfd);_0x421c26(_0x4d8dfd);});});}
\ No newline at end of file
+var _0x3aca=['stringify','error','message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2a3c4d,_0x9c6b37){var _0x55c390=function(_0x4871cf){while(--_0x4871cf){_0x2a3c4d['push'](_0x2a3c4d['shift']());}};_0x55c390(++_0x9c6b37);}(_0x3aca,0x83));var _0xa3ac=function(_0x55d8c5,_0x10287a){_0x55d8c5=_0x55d8c5-0x0;var _0x225ae5=_0x3aca[_0x55d8c5];return _0x225ae5;};'use strict';var _=require(_0xa3ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa3ac('0x1'));var rs=require(_0xa3ac('0x2'));var fs=require('fs');var Redis=require(_0xa3ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3ac('0x4'));var logger=require(_0xa3ac('0x5'))(_0xa3ac('0x6'));var config=require(_0xa3ac('0x7'));var jayson=require(_0xa3ac('0x8'));var client=jayson['client'][_0xa3ac('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xa3ac('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xa3ac('0xb'))(new Redis(config[_0xa3ac('0xa')]));require(_0xa3ac('0xc'))[_0xa3ac('0xd')](socket);function respondWithRpcPromise(_0x29f541,_0x5e8f4f,_0x1d3727){return new BPromise(function(_0x3817e3,_0x234168){return client['request'](_0x29f541,_0x1d3727)[_0xa3ac('0xe')](function(_0x9d8ba){logger[_0xa3ac('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0xa3ac('0x10'));logger[_0xa3ac('0x11')](_0xa3ac('0x12'),_0x5e8f4f,_0xa3ac('0x10'),JSON[_0xa3ac('0x13')](_0x9d8ba));if(_0x9d8ba[_0xa3ac('0x14')]){if(_0x9d8ba[_0xa3ac('0x14')]['code']===0x1f4){logger[_0xa3ac('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x9d8ba['error']['message']);return _0x234168(_0x9d8ba[_0xa3ac('0x14')][_0xa3ac('0x15')]);}logger[_0xa3ac('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x9d8ba[_0xa3ac('0x14')][_0xa3ac('0x15')]);return _0x3817e3(_0x9d8ba['error'][_0xa3ac('0x15')]);}else{logger[_0xa3ac('0xf')](_0xa3ac('0x16'),_0x5e8f4f,_0xa3ac('0x10'));_0x3817e3(_0x9d8ba[_0xa3ac('0x17')]['message']);}})[_0xa3ac('0x18')](function(_0x1307be){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5e8f4f,_0x1307be);_0x234168(_0x1307be);});});}
\ No newline at end of file
index a4e77ed..88802dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13ae=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x13ae,0x8b));var _0xe13a=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x13ae[_0x2be8c2];return _0x97f531;};'use strict';var ChatInternalMessageEvents=require(_0xe13a('0x0'));var events=[_0xe13a('0x1'),_0xe13a('0x2'),_0xe13a('0x3')];function createListener(_0x5564db,_0x30c11b){return function(_0x241bca){_0x30c11b[_0xe13a('0x4')](_0x5564db,_0x241bca);};}function removeListener(_0x501902,_0x1fd819){return function(){ChatInternalMessageEvents[_0xe13a('0x5')](_0x501902,_0x1fd819);};}exports[_0xe13a('0x6')]=function(_0x4f4051){for(var _0x3359d1=0x0,_0x82892a=events[_0xe13a('0x7')];_0x3359d1<_0x82892a;_0x3359d1++){var _0x505f4f=events[_0x3359d1];var _0x5b098d=createListener(_0xe13a('0x8')+_0x505f4f,_0x4f4051);ChatInternalMessageEvents['on'](_0x505f4f,_0x5b098d);}};
\ No newline at end of file
+var _0x252a=['update','emit','chatInternalMessage:','save','remove'];(function(_0x3a07d4,_0xa80b88){var _0x2c352=function(_0x27926b){while(--_0x27926b){_0x3a07d4['push'](_0x3a07d4['shift']());}};_0x2c352(++_0xa80b88);}(_0x252a,0x8f));var _0xa252=function(_0xd361b3,_0x3c7724){_0xd361b3=_0xd361b3-0x0;var _0x59a458=_0x252a[_0xd361b3];return _0x59a458;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xa252('0x0'),_0xa252('0x1'),_0xa252('0x2')];function createListener(_0x7f85fd,_0x43f243){return function(_0x938ae1){_0x43f243[_0xa252('0x3')](_0x7f85fd,_0x938ae1);};}function removeListener(_0x1b4a83,_0x24c27a){return function(){ChatInternalMessageEvents['removeListener'](_0x1b4a83,_0x24c27a);};}exports['register']=function(_0x1d16d7){for(var _0x28de3d=0x0,_0x43df42=events['length'];_0x28de3d<_0x43df42;_0x28de3d++){var _0x5648da=events[_0x28de3d];var _0x54c7a1=createListener(_0xa252('0x4')+_0x5648da,_0x1d16d7);ChatInternalMessageEvents['on'](_0x5648da,_0x54c7a1);}};
\ No newline at end of file
index 0b271c2..e427d20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf12=['show','post','create','update','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','describe','/users','isAuthenticated','getUsers','/:id'];(function(_0xbcc312,_0x26429c){var _0x1edbb5=function(_0x17bb24){while(--_0x17bb24){_0xbcc312['push'](_0xbcc312['shift']());}};_0x1edbb5(++_0x26429c);}(_0xaf12,0x1cd));var _0x2af1=function(_0x3001e6,_0xec7ba1){_0x3001e6=_0x3001e6-0x0;var _0x578018=_0xaf12[_0x3001e6];return _0x578018;};'use strict';var multer=require(_0x2af1('0x0'));var util=require(_0x2af1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2af1('0x2'));var router=express['Router']();var fs_extra=require(_0x2af1('0x3'));var auth=require(_0x2af1('0x4'));var interaction=require(_0x2af1('0x5'));var config=require('../../config/environment');var controller=require(_0x2af1('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2af1('0x7')](_0x2af1('0x8'),auth['isAuthenticated'](),controller[_0x2af1('0x9')]);router[_0x2af1('0x7')](_0x2af1('0xa'),auth[_0x2af1('0xb')](),controller[_0x2af1('0xc')]);router[_0x2af1('0x7')](_0x2af1('0xd'),auth[_0x2af1('0xb')](),controller[_0x2af1('0xe')]);router[_0x2af1('0xf')]('/',auth[_0x2af1('0xb')](),controller[_0x2af1('0x10')]);router['put']('/:id',controller[_0x2af1('0x11')]);router['delete'](_0x2af1('0xd'),auth[_0x2af1('0xb')](),controller['destroy']);module[_0x2af1('0x12')]=router;
\ No newline at end of file
+var _0x0c99=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post'];(function(_0x429b8c,_0xa0de50){var _0x5033dc=function(_0x1c612f){while(--_0x1c612f){_0x429b8c['push'](_0x429b8c['shift']());}};_0x5033dc(++_0xa0de50);}(_0x0c99,0x186));var _0x90c9=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0x0c99[_0x26b5ff];return _0x58603e;};'use strict';var multer=require(_0x90c9('0x0'));var util=require('util');var path=require(_0x90c9('0x1'));var timeout=require(_0x90c9('0x2'));var express=require(_0x90c9('0x3'));var router=express[_0x90c9('0x4')]();var fs_extra=require(_0x90c9('0x5'));var auth=require(_0x90c9('0x6'));var interaction=require(_0x90c9('0x7'));var config=require(_0x90c9('0x8'));var controller=require(_0x90c9('0x9'));router[_0x90c9('0xa')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0xc')]);router['get'](_0x90c9('0xd'),auth['isAuthenticated'](),controller[_0x90c9('0xe')]);router[_0x90c9('0xa')](_0x90c9('0xf'),auth['isAuthenticated'](),controller['getUsers']);router[_0x90c9('0xa')](_0x90c9('0x10'),auth[_0x90c9('0xb')](),controller['show']);router[_0x90c9('0x11')]('/',auth[_0x90c9('0xb')](),controller[_0x90c9('0x12')]);router[_0x90c9('0x13')](_0x90c9('0x10'),controller[_0x90c9('0x14')]);router[_0x90c9('0x15')](_0x90c9('0x10'),auth[_0x90c9('0xb')](),controller[_0x90c9('0x16')]);module[_0x90c9('0x17')]=router;
\ No newline at end of file
index 9c34573..1f46d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x33bca9,_0x25672f){var _0x3190f0=function(_0x1cd6db){while(--_0x1cd6db){_0x33bca9['push'](_0x33bca9['shift']());}};_0x3190f0(++_0x25672f);}(_0x39c4,0x174));var _0x439c=function(_0xa233b,_0x234c9d){_0xa233b=_0xa233b-0x0;var _0x2471d7=_0x39c4[_0xa233b];return _0x2471d7;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}};
\ No newline at end of file
+var _0x6901=['medium','ENUM','out','STRING','sequelize','TEXT'];(function(_0x296955,_0x19b6cc){var _0x4a9f7d=function(_0x38c303){while(--_0x38c303){_0x296955['push'](_0x296955['shift']());}};_0x4a9f7d(++_0x19b6cc);}(_0x6901,0x100));var _0x1690=function(_0x22d52a,_0x20f13a){_0x22d52a=_0x22d52a-0x0;var _0x553752=_0x6901[_0x22d52a];return _0x553752;};'use strict';var Sequelize=require(_0x1690('0x0'));module['exports']={'body':{'type':Sequelize[_0x1690('0x1')](_0x1690('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1690('0x3')]('in',_0x1690('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x1690('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index d4eaf6e..708d4af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54b4=['sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','create','body','update','destroy','describe','../../config/logger','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat','RejectMessage','rejectMessage','reject','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatMessage.socket','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','save','then','stack','name','send','index','map','ChatMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order'];(function(_0x12e634,_0x452df4){var _0x19e23d=function(_0x24cdcd){while(--_0x24cdcd){_0x12e634['push'](_0x12e634['shift']());}};_0x19e23d(++_0x452df4);}(_0x54b4,0xc9));var _0x454b=function(_0x23a1b5,_0x57f4cb){_0x23a1b5=_0x23a1b5-0x0;var _0x34e70b=_0x54b4[_0x23a1b5];return _0x34e70b;};'use strict';var emlformat=require(_0x454b('0x0'));var rimraf=require(_0x454b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x454b('0x2'));var rp=require(_0x454b('0x3'));var moment=require('moment');var BPromise=require(_0x454b('0x4'));var Mustache=require(_0x454b('0x5'));var util=require(_0x454b('0x6'));var path=require(_0x454b('0x7'));var sox=require(_0x454b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x454b('0x9'));var _=require('lodash');var squel=require(_0x454b('0xa'));var crypto=require(_0x454b('0xb'));var jsforce=require(_0x454b('0xc'));var deskjs=require(_0x454b('0xd'));var toCsv=require(_0x454b('0xe'));var querystring=require(_0x454b('0xf'));var Papa=require('papaparse');var Redis=require(_0x454b('0x10'));var authService=require(_0x454b('0x11'));var qs=require(_0x454b('0x12'));var as=require(_0x454b('0x13'));var hardwareService=require(_0x454b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x454b('0x15'));var config=require(_0x454b('0x16'));var licenseUtil=require(_0x454b('0x17'));var db=require(_0x454b('0x18'))['db'];config['redis']=_[_0x454b('0x19')](config[_0x454b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x454b('0x1b'))(new Redis(config['redis']));require(_0x454b('0x1c'))['register'](socket);var jayson=require(_0x454b('0x1d'));var client=jayson[_0x454b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x454b('0x1e')][_0x454b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x8bea2f,_0x2914c2,_0x31788e,_0x14d1ab){return new BPromise(function(_0x12cd47,_0x44f748){var _0x23134=_0x14d1ab||client;return _0x23134[_0x454b('0x20')](_0x8bea2f,_0x31788e)['then'](function(_0x53a316){logger[_0x454b('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x454b('0x22'));logger[_0x454b('0x23')](_0x454b('0x24'),_0x2914c2,'request\x20sent',JSON[_0x454b('0x25')](_0x53a316));if(_0x53a316['error']){if(_0x53a316[_0x454b('0x26')][_0x454b('0x27')]===0x1f4){logger[_0x454b('0x26')](_0x454b('0x28'),_0x2914c2,_0x53a316[_0x454b('0x26')]['message']);return _0x44f748(_0x53a316[_0x454b('0x26')][_0x454b('0x29')]);}logger[_0x454b('0x26')](_0x454b('0x28'),_0x2914c2,_0x53a316['error'][_0x454b('0x29')]);return _0x12cd47(_0x53a316[_0x454b('0x26')][_0x454b('0x29')]);}else{logger[_0x454b('0x21')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x454b('0x22'));_0x12cd47(_0x53a316[_0x454b('0x2a')]['message']);}})[_0x454b('0x2b')](function(_0x5d2c09){logger[_0x454b('0x26')]('ChatMessage,\x20%s,\x20%s',_0x2914c2,_0x5d2c09);_0x44f748(_0x5d2c09);});});}function respondWithStatusCode(_0x4cd0fb,_0x54c38e){_0x54c38e=_0x54c38e||0xcc;return function(_0x4f1458){if(_0x4f1458){return _0x4cd0fb[_0x454b('0x2c')](_0x54c38e);}return _0x4cd0fb['status'](_0x54c38e)[_0x454b('0x2d')]();};}function respondWithResult(_0x474a69,_0x5c100b){_0x5c100b=_0x5c100b||0xc8;return function(_0xd2b082){if(_0xd2b082){return _0x474a69[_0x454b('0x2e')](_0x5c100b)[_0x454b('0x2f')](_0xd2b082);}};}function respondWithFilteredResult(_0x2f0ed8,_0x1eb774){return function(_0x5bda90){if(_0x5bda90){var _0x3f7e8a=typeof _0x1eb774[_0x454b('0x30')]==='undefined'&&typeof _0x1eb774[_0x454b('0x31')]===_0x454b('0x32');var _0x4147f3=_0x5bda90['count'];var _0x3ff96d=_0x3f7e8a?0x0:_0x1eb774[_0x454b('0x30')];var _0x1685b9=_0x3f7e8a?_0x5bda90['count']:_0x1eb774[_0x454b('0x30')]+_0x1eb774[_0x454b('0x31')];var _0x428f39;if(_0x1685b9>=_0x4147f3){_0x1685b9=_0x4147f3;_0x428f39=0xc8;}else{_0x428f39=0xce;}_0x2f0ed8[_0x454b('0x2e')](_0x428f39);return _0x2f0ed8[_0x454b('0x33')](_0x454b('0x34'),_0x3ff96d+'-'+_0x1685b9+'/'+_0x4147f3)[_0x454b('0x2f')](_0x5bda90);}return null;};}function patchUpdates(_0x20f73f){return function(_0x4e9678){try{jsonpatch[_0x454b('0x35')](_0x4e9678,_0x20f73f,!![]);}catch(_0x29b76c){return BPromise['reject'](_0x29b76c);}return _0x4e9678[_0x454b('0x36')]();};}function saveUpdates(_0x57da73,_0x480280){return function(_0x4a6b41){if(_0x4a6b41){return _0x4a6b41['update'](_0x57da73)[_0x454b('0x37')](function(_0x17f914){return _0x17f914;});}return null;};}function removeEntity(_0x4c9413,_0x56907e){return function(_0x7acfa7){if(_0x7acfa7){return _0x7acfa7['destroy']()['then'](function(){_0x4c9413['status'](0xcc)[_0x454b('0x2d')]();});}};}function handleEntityNotFound(_0x662a09,_0x52d453){return function(_0x495ab0){if(!_0x495ab0){_0x662a09['sendStatus'](0x194);}return _0x495ab0;};}function handleError(_0x5b6238,_0x4186fb){_0x4186fb=_0x4186fb||0x1f4;return function(_0x250ef4){logger[_0x454b('0x26')](_0x250ef4[_0x454b('0x38')]);if(_0x250ef4[_0x454b('0x39')]){delete _0x250ef4[_0x454b('0x39')];}_0x5b6238[_0x454b('0x2e')](_0x4186fb)[_0x454b('0x3a')](_0x250ef4);};}exports[_0x454b('0x3b')]=function(_0x3e533a,_0x41c317){var _0x323e0f={},_0x5dfbcd={},_0x51c85b={'count':0x0,'rows':[]};var _0x2d2980=_[_0x454b('0x3c')](db[_0x454b('0x3d')][_0x454b('0x3e')],function(_0x5d03a4){return{'name':_0x5d03a4['fieldName'],'type':_0x5d03a4[_0x454b('0x3f')][_0x454b('0x40')]};});_0x5dfbcd[_0x454b('0x41')]=_[_0x454b('0x3c')](_0x2d2980,_0x454b('0x39'));_0x5dfbcd[_0x454b('0x42')]=_[_0x454b('0x43')](_0x3e533a[_0x454b('0x42')]);_0x5dfbcd[_0x454b('0x44')]=_[_0x454b('0x45')](_0x5dfbcd['model'],_0x5dfbcd[_0x454b('0x42')]);_0x323e0f[_0x454b('0x46')]=_[_0x454b('0x45')](_0x5dfbcd[_0x454b('0x41')],qs[_0x454b('0x47')](_0x3e533a[_0x454b('0x42')]['fields']));_0x323e0f[_0x454b('0x46')]=_0x323e0f['attributes'][_0x454b('0x48')]?_0x323e0f[_0x454b('0x46')]:_0x5dfbcd[_0x454b('0x41')];if(!_0x3e533a['query']['hasOwnProperty'](_0x454b('0x49'))){_0x323e0f['limit']=qs[_0x454b('0x31')](_0x3e533a[_0x454b('0x42')][_0x454b('0x31')]);_0x323e0f[_0x454b('0x30')]=qs['offset'](_0x3e533a[_0x454b('0x42')][_0x454b('0x30')]);}_0x323e0f[_0x454b('0x4a')]=qs[_0x454b('0x4b')](_0x3e533a[_0x454b('0x42')][_0x454b('0x4b')]);_0x323e0f[_0x454b('0x4c')]=qs[_0x454b('0x44')](_[_0x454b('0x4d')](_0x3e533a[_0x454b('0x42')],_0x5dfbcd[_0x454b('0x44')]),_0x2d2980);if(_0x3e533a[_0x454b('0x42')][_0x454b('0x4e')]){_0x323e0f[_0x454b('0x4c')]=_[_0x454b('0x4f')](_0x323e0f[_0x454b('0x4c')],{'$or':_[_0x454b('0x3c')](_0x2d2980,function(_0x1a6740){if(_0x1a6740[_0x454b('0x3f')]!==_0x454b('0x50')){var _0x5d5490={};_0x5d5490[_0x1a6740[_0x454b('0x39')]]={'$like':'%'+_0x3e533a[_0x454b('0x42')][_0x454b('0x4e')]+'%'};return _0x5d5490;}})});}_0x323e0f=_[_0x454b('0x4f')]({},_0x323e0f,_0x3e533a[_0x454b('0x51')]);var _0x55ad74={'where':_0x323e0f['where']};return db['ChatMessage'][_0x454b('0x52')](_0x55ad74)[_0x454b('0x37')](function(_0x1bf3e6){_0x51c85b[_0x454b('0x52')]=_0x1bf3e6;if(_0x3e533a[_0x454b('0x42')][_0x454b('0x53')]){_0x323e0f[_0x454b('0x54')]=[{'all':!![]}];}return db['ChatMessage'][_0x454b('0x55')](_0x323e0f);})[_0x454b('0x37')](function(_0x313c1a){_0x51c85b[_0x454b('0x56')]=_0x313c1a;return _0x51c85b;})[_0x454b('0x37')](respondWithFilteredResult(_0x41c317,_0x323e0f))['catch'](handleError(_0x41c317,null));};exports[_0x454b('0x57')]=function(_0x31a844,_0x3d44a7){var _0xc5c195={'raw':!![],'where':{'id':_0x31a844[_0x454b('0x58')]['id']}},_0x32fd63={};_0x32fd63['model']=_[_0x454b('0x43')](db[_0x454b('0x3d')][_0x454b('0x3e')]);_0x32fd63[_0x454b('0x42')]=_['keys'](_0x31a844[_0x454b('0x42')]);_0x32fd63[_0x454b('0x44')]=_[_0x454b('0x45')](_0x32fd63['model'],_0x32fd63[_0x454b('0x42')]);_0xc5c195[_0x454b('0x46')]=_[_0x454b('0x45')](_0x32fd63[_0x454b('0x41')],qs[_0x454b('0x47')](_0x31a844[_0x454b('0x42')][_0x454b('0x47')]));_0xc5c195['attributes']=_0xc5c195[_0x454b('0x46')]['length']?_0xc5c195[_0x454b('0x46')]:_0x32fd63[_0x454b('0x41')];if(_0x31a844[_0x454b('0x42')][_0x454b('0x53')]){_0xc5c195['include']=[{'all':!![]}];}_0xc5c195=_[_0x454b('0x4f')]({},_0xc5c195,_0x31a844[_0x454b('0x51')]);return db[_0x454b('0x3d')][_0x454b('0x59')](_0xc5c195)['then'](handleEntityNotFound(_0x3d44a7,null))['then'](respondWithResult(_0x3d44a7,null))[_0x454b('0x2b')](handleError(_0x3d44a7,null));};exports[_0x454b('0x5a')]=function(_0x2e5cc0,_0x19ef79){return db[_0x454b('0x3d')][_0x454b('0x5a')](_0x2e5cc0[_0x454b('0x5b')],{})[_0x454b('0x37')](respondWithResult(_0x19ef79,0xc9))[_0x454b('0x2b')](handleError(_0x19ef79,null));};exports[_0x454b('0x5c')]=function(_0x190e48,_0x40e788){if(_0x190e48['body']['id']){delete _0x190e48[_0x454b('0x5b')]['id'];}return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x190e48['params']['id']}})[_0x454b('0x37')](handleEntityNotFound(_0x40e788,null))['then'](saveUpdates(_0x190e48[_0x454b('0x5b')],null))[_0x454b('0x37')](respondWithResult(_0x40e788,null))['catch'](handleError(_0x40e788,null));};exports[_0x454b('0x5d')]=function(_0x1764a6,_0x4e8bef){return db[_0x454b('0x3d')][_0x454b('0x59')]({'where':{'id':_0x1764a6[_0x454b('0x58')]['id']}})[_0x454b('0x37')](handleEntityNotFound(_0x4e8bef,null))['then'](removeEntity(_0x4e8bef,null))[_0x454b('0x2b')](handleError(_0x4e8bef,null));};exports[_0x454b('0x5e')]=function(_0x262c35,_0x445981){return db[_0x454b('0x3d')]['describe']()['then'](respondWithResult(_0x445981,null))['catch'](handleError(_0x445981,null));};var interaction_log=require(_0x454b('0x5f'))(_0x454b('0x60'));exports[_0x454b('0x61')]=function(_0x14ef9e,_0x304082,_0x4f08d0){var _0x4bdad3={'agent':{},'channel':'chat'};if(_0x14ef9e[_0x454b('0x5b')]['id']){delete _0x14ef9e['body']['id'];}_0x14ef9e[_0x454b('0x5b')]['read']=!![];_0x14ef9e['body'][_0x454b('0x62')]=moment()['format'](_0x454b('0x63'));_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')]=_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')]||_0x14ef9e[_0x454b('0x65')]['id'];_0x4bdad3['agent']['id']=_0x14ef9e[_0x454b('0x5b')]['UserId'];return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x14ef9e[_0x454b('0x58')]['id'],'UserId':null}})[_0x454b('0x37')](handleEntityNotFound(_0x304082,null))[_0x454b('0x37')](saveUpdates(_0x14ef9e[_0x454b('0x5b')],null))[_0x454b('0x37')](function(_0x93857c){if(_0x93857c){_0x4bdad3['message']=_0x93857c[_0x454b('0x66')]({'plain':!![]});return db[_0x454b('0x67')][_0x454b('0x59')]({'where':{'id':_0x93857c[_0x454b('0x68')]}});}return null;})[_0x454b('0x37')](handleEntityNotFound(_0x304082,null))[_0x454b('0x37')](function(_0x37d2a9){if(_0x37d2a9){return _0x37d2a9[_0x454b('0x5c')]({'UserId':_0x14ef9e['body'][_0x454b('0x64')],'read1stAt':_[_0x454b('0x69')](_0x37d2a9[_0x454b('0x6a')])?moment()[_0x454b('0x6b')](_0x454b('0x63')):undefined});}return null;})[_0x454b('0x37')](function(_0x44199f){if(_0x44199f){_0x4bdad3[_0x454b('0x6c')]=_0x44199f['get']({'plain':!![]});interaction_log['info'](_0x454b('0x6d'),_0x14ef9e[_0x454b('0x65')]['id'],_0x14ef9e[_0x454b('0x65')][_0x454b('0x39')],_0x14ef9e[_0x454b('0x65')][_0x454b('0x6e')],_0x4bdad3[_0x454b('0x6c')]['id'],_0x14ef9e[_0x454b('0x5b')]?JSON[_0x454b('0x25')](_0x14ef9e[_0x454b('0x5b')]):_0x454b('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x454b('0x70'),_0x4bdad3);}return null;})[_0x454b('0x37')](function(_0x181e36){var _0x3db2b0=_0x454b('0x71')+_0x181e36[_0x454b('0x29')][_0x454b('0x72')];return db[_0x454b('0x73')]['query'](_0x3db2b0,{'type':db[_0x454b('0x74')][_0x454b('0x75')][_0x454b('0x76')],'raw':!![]})[_0x454b('0x37')](function(_0x1d6be3){return _0x1d6be3;});})['then'](function(_0x34c651){if(_0x34c651){_0x4bdad3[_0x454b('0x29')][_0x454b('0x77')]=_0x34c651[0x0];if(!_0x14ef9e[_0x454b('0x5b')]['UserId'])return;return db[_0x454b('0x78')][_0x454b('0x59')]({'where':{'id':_0x14ef9e[_0x454b('0x5b')][_0x454b('0x64')],'role':_0x454b('0x79')},'attributes':['id',_0x454b('0x39'),_0x454b('0x7a'),_0x454b('0x7b'),_0x454b('0x7c')],'raw':!![]});}return null;})[_0x454b('0x37')](function(_0x179cb8){if(!_0x179cb8)return null;_0x4bdad3[_0x454b('0x29')][_0x454b('0x79')]=_0x179cb8;return _0x4bdad3;})[_0x454b('0x37')](function(_0x5c54ae){if(_0x5c54ae){if(_0x14ef9e[_0x454b('0x5b')]['manual']){_0x4bdad3[_0x454b('0x29')][_0x454b('0x7d')]=util['format'](_0x454b('0x7e'),_0x14ef9e[_0x454b('0x65')][_0x454b('0x39')]);_0x4bdad3['message']['channel']=_0x4bdad3[_0x454b('0x7f')];_0x4bdad3['message'][_0x454b('0x80')]=_0x4bdad3[_0x454b('0x7f')];_0x4bdad3[_0x454b('0x29')][_0x454b('0x81')]=_0x454b('0x61');return respondWithRpcPromise(_0x454b('0x82'),_0x454b('0x82'),{'event':_0x454b('0x83'),'message':_[_0x454b('0x4f')](_0x4bdad3[_0x454b('0x29')],JSON['parse'](_0x4bdad3[_0x454b('0x6c')][_0x454b('0x84')]))},client9002)[_0x454b('0x37')](function(){return _0x4bdad3;});}return _0x4bdad3;}return null;})['then'](respondWithResult(_0x304082,null))[_0x454b('0x2b')](handleError(_0x304082,null));};var interaction_log=require('../../config/logger')(_0x454b('0x60'));exports['reject']=function(_0x5a9b65,_0xd0bdbb,_0x1a90be){var _0x1b5ca8={'agent':{},'channel':_0x454b('0x85')};if(_0x5a9b65[_0x454b('0x5b')]['id']){delete _0x5a9b65[_0x454b('0x5b')]['id'];}_0x5a9b65[_0x454b('0x5b')][_0x454b('0x64')]=_0x5a9b65['body'][_0x454b('0x64')]||_0x5a9b65[_0x454b('0x65')]['id'];_0x1b5ca8[_0x454b('0x79')]['id']=_0x5a9b65['body'][_0x454b('0x64')];return db['ChatMessage'][_0x454b('0x59')]({'where':{'id':_0x5a9b65[_0x454b('0x58')]['id'],'UserId':null}})[_0x454b('0x37')](handleEntityNotFound(_0xd0bdbb,null))[_0x454b('0x37')](function(_0x4a858c){if(_0x4a858c){_0x1b5ca8[_0x454b('0x29')]=_0x4a858c[_0x454b('0x66')]({'plain':!![]});return db[_0x454b('0x67')][_0x454b('0x59')]({'where':{'id':_0x4a858c[_0x454b('0x68')]}});}return null;})[_0x454b('0x37')](handleEntityNotFound(_0xd0bdbb,null))[_0x454b('0x37')](function(_0x5a4c9d){if(_0x5a4c9d){_0x1b5ca8[_0x454b('0x6c')]=_0x5a4c9d[_0x454b('0x66')]({'plain':!![]});interaction_log[_0x454b('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5a9b65['user']['id'],_0x5a9b65[_0x454b('0x65')][_0x454b('0x39')],_0x5a9b65[_0x454b('0x65')][_0x454b('0x6e')],_0x1b5ca8[_0x454b('0x6c')]['id'],_0x5a9b65['body']?JSON['stringify'](_0x5a9b65[_0x454b('0x5b')]):_0x454b('0x6f'));return respondWithRpcPromise(_0x454b('0x86'),_0x454b('0x87'),_0x1b5ca8);}return null;})[_0x454b('0x37')](function(_0x59527c){var _0x4858e8=_0x454b('0x71')+_0x59527c[_0x454b('0x29')]['ContactId'];return db[_0x454b('0x73')][_0x454b('0x42')](_0x4858e8,{'type':db[_0x454b('0x74')][_0x454b('0x75')]['SELECT'],'raw':!![]})[_0x454b('0x37')](function(_0x51f7e8){return _0x51f7e8;});})[_0x454b('0x37')](function(_0x5beb6f){if(_0x5beb6f){_0x1b5ca8[_0x454b('0x29')][_0x454b('0x77')]=_0x5beb6f[0x0];if(!_0x5a9b65[_0x454b('0x5b')]['UserId'])return;return db[_0x454b('0x78')][_0x454b('0x59')]({'where':{'id':_0x5a9b65[_0x454b('0x5b')]['UserId'],'role':'agent'},'attributes':['id',_0x454b('0x39'),'fullname',_0x454b('0x7b'),_0x454b('0x7c')],'raw':!![]});}return null;})[_0x454b('0x37')](function(_0xa9e1e){if(!_0xa9e1e)return null;_0x1b5ca8['message'][_0x454b('0x79')]=_0xa9e1e;return _0x1b5ca8;})[_0x454b('0x37')](function(_0x4140c4){if(_0x4140c4){_0x4140c4[_0x454b('0x29')][_0x454b('0x7d')]=util[_0x454b('0x6b')](_0x454b('0x7e'),_0x5a9b65[_0x454b('0x65')]['name']);_0x4140c4[_0x454b('0x29')][_0x454b('0x7f')]=_0x1b5ca8['channel'];_0x4140c4['message'][_0x454b('0x80')]=_0x1b5ca8[_0x454b('0x7f')];_0x4140c4[_0x454b('0x29')]['event']=_0x454b('0x88');respondWithRpcPromise('EventManager','EventManager',{'event':_0x454b('0x89'),'message':_['merge'](_0x1b5ca8[_0x454b('0x29')],JSON['parse'](_0x1b5ca8['interaction'][_0x454b('0x84')]))},client9002);return _0x1b5ca8;}return null;})[_0x454b('0x37')](respondWithResult(_0xd0bdbb,null))[_0x454b('0x2b')](handleError(_0xd0bdbb,null));};
\ No newline at end of file
+var _0x1e9b=['catch','sendStatus','end','status','limit','undefined','count','offset','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','rawAttributes','ChatMessage','create','body','find','describe','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x1e9b,0xe2));var _0xb1e9=function(_0x31ebac,_0x58de2c){_0x31ebac=_0x31ebac-0x0;var _0x188a43=_0x1e9b[_0x31ebac];return _0x188a43;};'use strict';var emlformat=require(_0xb1e9('0x0'));var rimraf=require(_0xb1e9('0x1'));var zipdir=require(_0xb1e9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb1e9('0x3'));var moment=require(_0xb1e9('0x4'));var BPromise=require(_0xb1e9('0x5'));var Mustache=require(_0xb1e9('0x6'));var util=require(_0xb1e9('0x7'));var path=require(_0xb1e9('0x8'));var sox=require(_0xb1e9('0x9'));var csv=require(_0xb1e9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1e9('0xb'));var _=require(_0xb1e9('0xc'));var squel=require(_0xb1e9('0xd'));var crypto=require(_0xb1e9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb1e9('0xa'));var querystring=require('querystring');var Papa=require(_0xb1e9('0xf'));var Redis=require('ioredis');var authService=require(_0xb1e9('0x10'));var qs=require(_0xb1e9('0x11'));var as=require(_0xb1e9('0x12'));var hardwareService=require(_0xb1e9('0x13'));var logger=require(_0xb1e9('0x14'))('api');var utils=require(_0xb1e9('0x15'));var config=require(_0xb1e9('0x16'));var licenseUtil=require(_0xb1e9('0x17'));var db=require('../../mysqldb')['db'];config[_0xb1e9('0x18')]=_['defaults'](config[_0xb1e9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1e9('0x19'))(new Redis(config[_0xb1e9('0x18')]));require(_0xb1e9('0x1a'))[_0xb1e9('0x1b')](socket);var jayson=require(_0xb1e9('0x1c'));var client=jayson[_0xb1e9('0x1d')][_0xb1e9('0x1e')]({'port':0x232c});var client9002=jayson[_0xb1e9('0x1d')][_0xb1e9('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x210f98,_0x4fabb3,_0x43934c,_0x4b82a7){return new BPromise(function(_0x371150,_0x3668a4){var _0x906c7c=_0x4b82a7||client;return _0x906c7c[_0xb1e9('0x1f')](_0x210f98,_0x43934c)['then'](function(_0x1774ac){logger[_0xb1e9('0x20')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0xb1e9('0x21'));logger[_0xb1e9('0x22')](_0xb1e9('0x23'),_0x4fabb3,_0xb1e9('0x21'),JSON[_0xb1e9('0x24')](_0x1774ac));if(_0x1774ac[_0xb1e9('0x25')]){if(_0x1774ac['error'][_0xb1e9('0x26')]===0x1f4){logger[_0xb1e9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);return _0x3668a4(_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);}logger[_0xb1e9('0x25')](_0xb1e9('0x28'),_0x4fabb3,_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);return _0x371150(_0x1774ac[_0xb1e9('0x25')][_0xb1e9('0x27')]);}else{logger[_0xb1e9('0x20')](_0xb1e9('0x28'),_0x4fabb3,_0xb1e9('0x21'));_0x371150(_0x1774ac[_0xb1e9('0x29')]['message']);}})[_0xb1e9('0x2a')](function(_0x1afb1a){logger[_0xb1e9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x4fabb3,_0x1afb1a);_0x3668a4(_0x1afb1a);});});}function respondWithStatusCode(_0x5655b2,_0x2eb237){_0x2eb237=_0x2eb237||0xcc;return function(_0x42ea93){if(_0x42ea93){return _0x5655b2[_0xb1e9('0x2b')](_0x2eb237);}return _0x5655b2['status'](_0x2eb237)[_0xb1e9('0x2c')]();};}function respondWithResult(_0x254c7c,_0x25c898){_0x25c898=_0x25c898||0xc8;return function(_0x1094e1){if(_0x1094e1){return _0x254c7c[_0xb1e9('0x2d')](_0x25c898)['json'](_0x1094e1);}};}function respondWithFilteredResult(_0x34ff3a,_0x227595){return function(_0x1d553b){if(_0x1d553b){var _0x45cb07=typeof _0x227595['offset']==='undefined'&&typeof _0x227595[_0xb1e9('0x2e')]===_0xb1e9('0x2f');var _0xc85b16=_0x1d553b[_0xb1e9('0x30')];var _0x52a058=_0x45cb07?0x0:_0x227595['offset'];var _0x1e1322=_0x45cb07?_0x1d553b['count']:_0x227595[_0xb1e9('0x31')]+_0x227595[_0xb1e9('0x2e')];var _0x49cfce;if(_0x1e1322>=_0xc85b16){_0x1e1322=_0xc85b16;_0x49cfce=0xc8;}else{_0x49cfce=0xce;}_0x34ff3a[_0xb1e9('0x2d')](_0x49cfce);return _0x34ff3a['set'](_0xb1e9('0x32'),_0x52a058+'-'+_0x1e1322+'/'+_0xc85b16)['json'](_0x1d553b);}return null;};}function patchUpdates(_0x44c36a){return function(_0x3d61f3){try{jsonpatch[_0xb1e9('0x33')](_0x3d61f3,_0x44c36a,!![]);}catch(_0x59eab4){return BPromise[_0xb1e9('0x34')](_0x59eab4);}return _0x3d61f3[_0xb1e9('0x35')]();};}function saveUpdates(_0x50c896,_0x9ab3ef){return function(_0x202f49){if(_0x202f49){return _0x202f49[_0xb1e9('0x36')](_0x50c896)['then'](function(_0x2068ff){return _0x2068ff;});}return null;};}function removeEntity(_0x254256,_0x18678d){return function(_0x4aa218){if(_0x4aa218){return _0x4aa218[_0xb1e9('0x37')]()['then'](function(){_0x254256[_0xb1e9('0x2d')](0xcc)[_0xb1e9('0x2c')]();});}};}function handleEntityNotFound(_0x361afd,_0x522784){return function(_0x57b188){if(!_0x57b188){_0x361afd[_0xb1e9('0x2b')](0x194);}return _0x57b188;};}function handleError(_0x55ba59,_0x21c564){_0x21c564=_0x21c564||0x1f4;return function(_0x114162){logger[_0xb1e9('0x25')](_0x114162[_0xb1e9('0x38')]);if(_0x114162['name']){delete _0x114162[_0xb1e9('0x39')];}_0x55ba59[_0xb1e9('0x2d')](_0x21c564)[_0xb1e9('0x3a')](_0x114162);};}exports[_0xb1e9('0x3b')]=function(_0x278751,_0x1dc108){var _0x43dc5f={},_0x450a16={},_0x488b20={'count':0x0,'rows':[]};var _0x526d2c=_[_0xb1e9('0x3c')](db['ChatMessage']['rawAttributes'],function(_0x306526){return{'name':_0x306526['fieldName'],'type':_0x306526[_0xb1e9('0x3d')][_0xb1e9('0x3e')]};});_0x450a16['model']=_[_0xb1e9('0x3c')](_0x526d2c,'name');_0x450a16[_0xb1e9('0x3f')]=_[_0xb1e9('0x40')](_0x278751[_0xb1e9('0x3f')]);_0x450a16[_0xb1e9('0x41')]=_[_0xb1e9('0x42')](_0x450a16[_0xb1e9('0x43')],_0x450a16[_0xb1e9('0x3f')]);_0x43dc5f[_0xb1e9('0x44')]=_[_0xb1e9('0x42')](_0x450a16[_0xb1e9('0x43')],qs[_0xb1e9('0x45')](_0x278751['query'][_0xb1e9('0x45')]));_0x43dc5f[_0xb1e9('0x44')]=_0x43dc5f[_0xb1e9('0x44')][_0xb1e9('0x46')]?_0x43dc5f[_0xb1e9('0x44')]:_0x450a16['model'];if(!_0x278751['query'][_0xb1e9('0x47')](_0xb1e9('0x48'))){_0x43dc5f[_0xb1e9('0x2e')]=qs[_0xb1e9('0x2e')](_0x278751[_0xb1e9('0x3f')]['limit']);_0x43dc5f[_0xb1e9('0x31')]=qs[_0xb1e9('0x31')](_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x31')]);}_0x43dc5f[_0xb1e9('0x49')]=qs[_0xb1e9('0x4a')](_0x278751['query'][_0xb1e9('0x4a')]);_0x43dc5f['where']=qs[_0xb1e9('0x41')](_[_0xb1e9('0x4b')](_0x278751[_0xb1e9('0x3f')],_0x450a16[_0xb1e9('0x41')]),_0x526d2c);if(_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x4c')]){_0x43dc5f[_0xb1e9('0x4d')]=_[_0xb1e9('0x4e')](_0x43dc5f[_0xb1e9('0x4d')],{'$or':_['map'](_0x526d2c,function(_0x3e226f){if(_0x3e226f[_0xb1e9('0x3d')]!==_0xb1e9('0x4f')){var _0x2fb1bb={};_0x2fb1bb[_0x3e226f[_0xb1e9('0x39')]]={'$like':'%'+_0x278751[_0xb1e9('0x3f')][_0xb1e9('0x4c')]+'%'};return _0x2fb1bb;}})});}_0x43dc5f=_['merge']({},_0x43dc5f,_0x278751[_0xb1e9('0x50')]);var _0x38b47e={'where':_0x43dc5f[_0xb1e9('0x4d')]};return db['ChatMessage'][_0xb1e9('0x30')](_0x38b47e)[_0xb1e9('0x51')](function(_0x42e5b0){_0x488b20[_0xb1e9('0x30')]=_0x42e5b0;if(_0x278751['query'][_0xb1e9('0x52')]){_0x43dc5f[_0xb1e9('0x53')]=[{'all':!![]}];}return db['ChatMessage'][_0xb1e9('0x54')](_0x43dc5f);})[_0xb1e9('0x51')](function(_0x2114f9){_0x488b20[_0xb1e9('0x55')]=_0x2114f9;return _0x488b20;})[_0xb1e9('0x51')](respondWithFilteredResult(_0x1dc108,_0x43dc5f))[_0xb1e9('0x2a')](handleError(_0x1dc108,null));};exports[_0xb1e9('0x56')]=function(_0xd4c442,_0x188402){var _0x459b0c={'raw':!![],'where':{'id':_0xd4c442[_0xb1e9('0x57')]['id']}},_0x1ad874={};_0x1ad874[_0xb1e9('0x43')]=_['keys'](db['ChatMessage'][_0xb1e9('0x58')]);_0x1ad874[_0xb1e9('0x3f')]=_['keys'](_0xd4c442['query']);_0x1ad874[_0xb1e9('0x41')]=_[_0xb1e9('0x42')](_0x1ad874['model'],_0x1ad874['query']);_0x459b0c[_0xb1e9('0x44')]=_[_0xb1e9('0x42')](_0x1ad874[_0xb1e9('0x43')],qs[_0xb1e9('0x45')](_0xd4c442[_0xb1e9('0x3f')][_0xb1e9('0x45')]));_0x459b0c[_0xb1e9('0x44')]=_0x459b0c[_0xb1e9('0x44')][_0xb1e9('0x46')]?_0x459b0c[_0xb1e9('0x44')]:_0x1ad874['model'];if(_0xd4c442[_0xb1e9('0x3f')][_0xb1e9('0x52')]){_0x459b0c[_0xb1e9('0x53')]=[{'all':!![]}];}_0x459b0c=_['merge']({},_0x459b0c,_0xd4c442[_0xb1e9('0x50')]);return db['ChatMessage']['find'](_0x459b0c)[_0xb1e9('0x51')](handleEntityNotFound(_0x188402,null))['then'](respondWithResult(_0x188402,null))[_0xb1e9('0x2a')](handleError(_0x188402,null));};exports['create']=function(_0x8d2727,_0x2cd099){return db[_0xb1e9('0x59')][_0xb1e9('0x5a')](_0x8d2727[_0xb1e9('0x5b')],{})['then'](respondWithResult(_0x2cd099,0xc9))[_0xb1e9('0x2a')](handleError(_0x2cd099,null));};exports['update']=function(_0x237e3f,_0x56dd6e){if(_0x237e3f[_0xb1e9('0x5b')]['id']){delete _0x237e3f[_0xb1e9('0x5b')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x237e3f[_0xb1e9('0x57')]['id']}})[_0xb1e9('0x51')](handleEntityNotFound(_0x56dd6e,null))[_0xb1e9('0x51')](saveUpdates(_0x237e3f[_0xb1e9('0x5b')],null))[_0xb1e9('0x51')](respondWithResult(_0x56dd6e,null))[_0xb1e9('0x2a')](handleError(_0x56dd6e,null));};exports[_0xb1e9('0x37')]=function(_0x428414,_0x12c09d){return db['ChatMessage'][_0xb1e9('0x5c')]({'where':{'id':_0x428414[_0xb1e9('0x57')]['id']}})[_0xb1e9('0x51')](handleEntityNotFound(_0x12c09d,null))[_0xb1e9('0x51')](removeEntity(_0x12c09d,null))['catch'](handleError(_0x12c09d,null));};exports['describe']=function(_0x3b6e7b,_0x2b345d){return db[_0xb1e9('0x59')][_0xb1e9('0x5d')]()['then'](respondWithResult(_0x2b345d,null))[_0xb1e9('0x2a')](handleError(_0x2b345d,null));};var interaction_log=require(_0xb1e9('0x14'))('chat-interactions');exports[_0xb1e9('0x5e')]=function(_0xc52b2d,_0x572a98,_0x1a9f9d){var _0x2e6cf3={'agent':{},'channel':_0xb1e9('0x5f')};if(_0xc52b2d[_0xb1e9('0x5b')]['id']){delete _0xc52b2d[_0xb1e9('0x5b')]['id'];}_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x60')]=!![];_0xc52b2d[_0xb1e9('0x5b')]['readAt']=moment()[_0xb1e9('0x61')](_0xb1e9('0x62'));_0xc52b2d['body'][_0xb1e9('0x63')]=_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')]||_0xc52b2d[_0xb1e9('0x64')]['id'];_0x2e6cf3[_0xb1e9('0x65')]['id']=_0xc52b2d['body'][_0xb1e9('0x63')];return db[_0xb1e9('0x59')][_0xb1e9('0x5c')]({'where':{'id':_0xc52b2d[_0xb1e9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x572a98,null))['then'](saveUpdates(_0xc52b2d['body'],null))[_0xb1e9('0x51')](function(_0x461a2b){if(_0x461a2b){_0x2e6cf3[_0xb1e9('0x27')]=_0x461a2b['get']({'plain':!![]});return db['ChatInteraction'][_0xb1e9('0x5c')]({'where':{'id':_0x461a2b[_0xb1e9('0x66')]}});}return null;})[_0xb1e9('0x51')](handleEntityNotFound(_0x572a98,null))[_0xb1e9('0x51')](function(_0x4abef4){if(_0x4abef4){return _0x4abef4['update']({'UserId':_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')],'read1stAt':_['isNil'](_0x4abef4['read1stAt'])?moment()[_0xb1e9('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb1e9('0x51')](function(_0x8c9c03){if(_0x8c9c03){_0x2e6cf3[_0xb1e9('0x67')]=_0x8c9c03[_0xb1e9('0x68')]({'plain':!![]});interaction_log['info'](_0xb1e9('0x69'),_0xc52b2d[_0xb1e9('0x64')]['id'],_0xc52b2d[_0xb1e9('0x64')]['name'],_0xc52b2d[_0xb1e9('0x64')][_0xb1e9('0x6a')],_0x2e6cf3[_0xb1e9('0x67')]['id'],_0xc52b2d[_0xb1e9('0x5b')]?JSON[_0xb1e9('0x24')](_0xc52b2d[_0xb1e9('0x5b')]):_0xb1e9('0x6b'));return respondWithRpcPromise(_0xb1e9('0x6c'),'acceptMessage',_0x2e6cf3);}return null;})[_0xb1e9('0x51')](function(_0x36c621){var _0x511968=_0xb1e9('0x6d')+_0x36c621[_0xb1e9('0x27')][_0xb1e9('0x6e')];return db[_0xb1e9('0x6f')][_0xb1e9('0x3f')](_0x511968,{'type':db[_0xb1e9('0x70')][_0xb1e9('0x71')][_0xb1e9('0x72')],'raw':!![]})[_0xb1e9('0x51')](function(_0x27703b){return _0x27703b;});})[_0xb1e9('0x51')](function(_0x9c585d){if(_0x9c585d){_0x2e6cf3[_0xb1e9('0x27')]['contact']=_0x9c585d[0x0];if(!_0xc52b2d[_0xb1e9('0x5b')][_0xb1e9('0x63')])return;return db[_0xb1e9('0x73')][_0xb1e9('0x5c')]({'where':{'id':_0xc52b2d['body'][_0xb1e9('0x63')],'role':'agent'},'attributes':['id',_0xb1e9('0x39'),_0xb1e9('0x74'),_0xb1e9('0x75'),_0xb1e9('0x76')],'raw':!![]});}return null;})[_0xb1e9('0x51')](function(_0x22713c){if(!_0x22713c)return null;_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x65')]=_0x22713c;return _0x2e6cf3;})['then'](function(_0x5a6a96){if(_0x5a6a96){if(_0xc52b2d['body']['manual']){_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x77')]=util[_0xb1e9('0x61')](_0xb1e9('0x78'),_0xc52b2d['user'][_0xb1e9('0x39')]);_0x2e6cf3[_0xb1e9('0x27')]['channel']=_0x2e6cf3[_0xb1e9('0x79')];_0x2e6cf3[_0xb1e9('0x27')]['motionChannel']=_0x2e6cf3[_0xb1e9('0x79')];_0x2e6cf3[_0xb1e9('0x27')][_0xb1e9('0x7a')]=_0xb1e9('0x5e');return respondWithRpcPromise(_0xb1e9('0x7b'),'EventManager',{'event':_0xb1e9('0x7c'),'message':_[_0xb1e9('0x4e')](_0x2e6cf3['message'],JSON[_0xb1e9('0x7d')](_0x2e6cf3[_0xb1e9('0x67')][_0xb1e9('0x7e')]))},client9002)[_0xb1e9('0x51')](function(){return _0x2e6cf3;});}return _0x2e6cf3;}return null;})['then'](respondWithResult(_0x572a98,null))[_0xb1e9('0x2a')](handleError(_0x572a98,null));};var interaction_log=require(_0xb1e9('0x14'))(_0xb1e9('0x7f'));exports['reject']=function(_0x16817e,_0x18b042,_0x36f8fb){var _0x2384d0={'agent':{},'channel':_0xb1e9('0x5f')};if(_0x16817e['body']['id']){delete _0x16817e['body']['id'];}_0x16817e[_0xb1e9('0x5b')][_0xb1e9('0x63')]=_0x16817e['body'][_0xb1e9('0x63')]||_0x16817e[_0xb1e9('0x64')]['id'];_0x2384d0['agent']['id']=_0x16817e[_0xb1e9('0x5b')][_0xb1e9('0x63')];return db[_0xb1e9('0x59')][_0xb1e9('0x5c')]({'where':{'id':_0x16817e[_0xb1e9('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18b042,null))[_0xb1e9('0x51')](function(_0x5e8401){if(_0x5e8401){_0x2384d0[_0xb1e9('0x27')]=_0x5e8401[_0xb1e9('0x68')]({'plain':!![]});return db[_0xb1e9('0x80')][_0xb1e9('0x5c')]({'where':{'id':_0x5e8401['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x18b042,null))[_0xb1e9('0x51')](function(_0x3a1f8b){if(_0x3a1f8b){_0x2384d0['interaction']=_0x3a1f8b[_0xb1e9('0x68')]({'plain':!![]});interaction_log[_0xb1e9('0x20')](_0xb1e9('0x81'),_0x16817e[_0xb1e9('0x64')]['id'],_0x16817e['user'][_0xb1e9('0x39')],_0x16817e[_0xb1e9('0x64')]['role'],_0x2384d0[_0xb1e9('0x67')]['id'],_0x16817e['body']?JSON[_0xb1e9('0x24')](_0x16817e[_0xb1e9('0x5b')]):_0xb1e9('0x6b'));return respondWithRpcPromise(_0xb1e9('0x82'),_0xb1e9('0x83'),_0x2384d0);}return null;})[_0xb1e9('0x51')](function(_0x2b9dac){var _0x34bbd3=_0xb1e9('0x6d')+_0x2b9dac[_0xb1e9('0x27')]['ContactId'];return db['sequelize'][_0xb1e9('0x3f')](_0x34bbd3,{'type':db[_0xb1e9('0x70')][_0xb1e9('0x71')][_0xb1e9('0x72')],'raw':!![]})['then'](function(_0x143d8d){return _0x143d8d;});})[_0xb1e9('0x51')](function(_0x5a7e1b){if(_0x5a7e1b){_0x2384d0['message']['contact']=_0x5a7e1b[0x0];if(!_0x16817e['body'][_0xb1e9('0x63')])return;return db['User']['find']({'where':{'id':_0x16817e['body'][_0xb1e9('0x63')],'role':_0xb1e9('0x65')},'attributes':['id',_0xb1e9('0x39'),_0xb1e9('0x74'),'email',_0xb1e9('0x76')],'raw':!![]});}return null;})['then'](function(_0x44858a){if(!_0x44858a)return null;_0x2384d0[_0xb1e9('0x27')]['agent']=_0x44858a;return _0x2384d0;})[_0xb1e9('0x51')](function(_0x46c511){if(_0x46c511){_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x77')]=util[_0xb1e9('0x61')](_0xb1e9('0x78'),_0x16817e[_0xb1e9('0x64')][_0xb1e9('0x39')]);_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x79')]=_0x2384d0['channel'];_0x46c511[_0xb1e9('0x27')][_0xb1e9('0x84')]=_0x2384d0[_0xb1e9('0x79')];_0x46c511[_0xb1e9('0x27')]['event']=_0xb1e9('0x34');respondWithRpcPromise(_0xb1e9('0x7b'),_0xb1e9('0x7b'),{'event':_0xb1e9('0x85'),'message':_[_0xb1e9('0x4e')](_0x2384d0['message'],JSON[_0xb1e9('0x7d')](_0x2384d0['interaction'][_0xb1e9('0x7e')]))},client9002);return _0x2384d0;}return null;})['then'](respondWithResult(_0x18b042,null))[_0xb1e9('0x2a')](handleError(_0x18b042,null));};
\ No newline at end of file
index 01d6875..ad075b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfac0=['exports','../../mysqldb','ChatMessage','setMaxListeners','remove','hasOwnProperty'];(function(_0x23408e,_0x17bdce){var _0x58f607=function(_0x3f587d){while(--_0x3f587d){_0x23408e['push'](_0x23408e['shift']());}};_0x58f607(++_0x17bdce);}(_0xfac0,0x19f));var _0x0fac=function(_0xe24fb7,_0x1b4d12){_0xe24fb7=_0xe24fb7-0x0;var _0x56b975=_0xfac0[_0xe24fb7];return _0x56b975;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0fac('0x0'))['db'][_0x0fac('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0fac('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0fac('0x3')};function emitEvent(_0x311b37){return function(_0x52425a,_0xeae09a,_0x18ef54){ChatMessageEvents['emit'](_0x311b37+':'+_0x52425a['id'],_0x52425a);ChatMessageEvents['emit'](_0x311b37,_0x52425a);_0x18ef54(null);};}for(var e in events){if(events[_0x0fac('0x4')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x0fac('0x5')]=ChatMessageEvents;
\ No newline at end of file
+var _0x1386=['events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','hook'];(function(_0x4233f5,_0x23e9dd){var _0x45966c=function(_0x5024c4){while(--_0x5024c4){_0x4233f5['push'](_0x4233f5['shift']());}};_0x45966c(++_0x23e9dd);}(_0x1386,0x170));var _0x6138=function(_0x18145c,_0x23c102){_0x18145c=_0x18145c-0x0;var _0x52dd35=_0x1386[_0x18145c];return _0x52dd35;};'use strict';var EventEmitter=require(_0x6138('0x0'));var ChatMessage=require(_0x6138('0x1'))['db'][_0x6138('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x6138('0x3')](0x0);var events={'afterCreate':_0x6138('0x4'),'afterUpdate':_0x6138('0x5'),'afterDestroy':_0x6138('0x6')};function emitEvent(_0x395a9f){return function(_0x5d7d96,_0x522b8d,_0x17a78b){ChatMessageEvents['emit'](_0x395a9f+':'+_0x5d7d96['id'],_0x5d7d96);ChatMessageEvents['emit'](_0x395a9f,_0x5d7d96);_0x17a78b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x6138('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 932f3b3..025d77b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4318=['then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','ChatInteractionId'];(function(_0x47c566,_0x280943){var _0x5693c7=function(_0x4e07c9){while(--_0x4e07c9){_0x47c566['push'](_0x47c566['shift']());}};_0x5693c7(++_0x280943);}(_0x4318,0x1a7));var _0x8431=function(_0x3e7a4e,_0xe67c15){_0x3e7a4e=_0x3e7a4e-0x0;var _0x5912e1=_0x4318[_0x3e7a4e];return _0x5912e1;};'use strict';var _=require(_0x8431('0x0'));var util=require(_0x8431('0x1'));var logger=require(_0x8431('0x2'))(_0x8431('0x3'));var moment=require(_0x8431('0x4'));var BPromise=require(_0x8431('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8431('0x6'));var rimraf=require(_0x8431('0x7'));var config=require(_0x8431('0x8'));var attributes=require('./chatMessage.attributes');module[_0x8431('0x9')]=function(_0x391150,_0x35b031){return _0x391150[_0x8431('0xa')](_0x8431('0xb'),attributes,{'tableName':_0x8431('0xc'),'paranoid':![],'indexes':[{'name':_0x8431('0xd'),'fields':['body'],'type':_0x8431('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a22ae,_0x14d241,_0x17f4da){var _0x5c3360=_0x391150[_0x8431('0xf')];var _0xd90f8a=_0x4a22ae[_0x8431('0x10')]({'plain':!![]});if(_0xd90f8a[_0x8431('0x11')][_0x8431('0x12')]()==='in'||_0xd90f8a[_0x8431('0x11')][_0x8431('0x12')]()===_0x8431('0x13')&&!_0xd90f8a[_0x8431('0x14')]&&!_['isNil'](_0xd90f8a[_0x8431('0x15')])){_0x5c3360[_0x8431('0x16')][_0x8431('0x17')]({'where':{'id':_0xd90f8a[_0x8431('0x18')]}})[_0x8431('0x19')](function(_0x47cbac){if(_0x47cbac){_0x47cbac[_0x8431('0x1a')]({'lastMsgAt':_0xd90f8a[_0x8431('0x1b')],'lastMsgDirection':_0xd90f8a[_0x8431('0x11')]['toLowerCase']()});}})[_0x8431('0x1c')](function(_0x5718af){console[_0x8431('0x1d')](_0x5718af);});}_0x17f4da();}},'charset':_0x8431('0x1e'),'collate':_0x8431('0x1f')});};
\ No newline at end of file
+var _0xfe11=['direction','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','define','ChatMessage','chat_messages','body','FULLTEXT','models','get'];(function(_0x45c398,_0x3bed1d){var _0x54ab01=function(_0x3eb807){while(--_0x3eb807){_0x45c398['push'](_0x45c398['shift']());}};_0x54ab01(++_0x3bed1d);}(_0xfe11,0x94));var _0x1fe1=function(_0x531613,_0x24832c){_0x531613=_0x531613-0x0;var _0x3aadd2=_0xfe11[_0x531613];return _0x3aadd2;};'use strict';var _=require(_0x1fe1('0x0'));var util=require(_0x1fe1('0x1'));var logger=require(_0x1fe1('0x2'))(_0x1fe1('0x3'));var moment=require(_0x1fe1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fe1('0x5'));var rimraf=require(_0x1fe1('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module['exports']=function(_0x53145e,_0x16e421){return _0x53145e[_0x1fe1('0x7')](_0x1fe1('0x8'),attributes,{'tableName':_0x1fe1('0x9'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1fe1('0xa')],'type':_0x1fe1('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfdb9e0,_0x3a1784,_0x14b4a4){var _0x260e96=_0x53145e[_0x1fe1('0xc')];var _0x5e2a94=_0xfdb9e0[_0x1fe1('0xd')]({'plain':!![]});if(_0x5e2a94[_0x1fe1('0xe')]['toLowerCase']()==='in'||_0x5e2a94[_0x1fe1('0xe')][_0x1fe1('0xf')]()===_0x1fe1('0x10')&&!_0x5e2a94['secret']&&!_['isNil'](_0x5e2a94[_0x1fe1('0x11')])){_0x260e96[_0x1fe1('0x12')][_0x1fe1('0x13')]({'where':{'id':_0x5e2a94[_0x1fe1('0x14')]}})[_0x1fe1('0x15')](function(_0x4320e0){if(_0x4320e0){_0x4320e0[_0x1fe1('0x16')]({'lastMsgAt':_0x5e2a94[_0x1fe1('0x17')],'lastMsgDirection':_0x5e2a94[_0x1fe1('0xe')][_0x1fe1('0xf')]()});}})[_0x1fe1('0x18')](function(_0x405e77){console['error'](_0x405e77);});}_0x14b4a4();}},'charset':_0x1fe1('0x19'),'collate':_0x1fe1('0x1a')});};
\ No newline at end of file
index 1bc7972..b3c4ce9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8524=['result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1c41dd,_0x542e1c){var _0x3b54c7=function(_0x3b00c2){while(--_0x3b00c2){_0x1c41dd['push'](_0x1c41dd['shift']());}};_0x3b54c7(++_0x542e1c);}(_0x8524,0x84));var _0x4852=function(_0x17eb95,_0x25527a){_0x17eb95=_0x17eb95-0x0;var _0x311877=_0x8524[_0x17eb95];return _0x311877;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4852('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4852('0x1'));var db=require(_0x4852('0x2'))['db'];var utils=require(_0x4852('0x3'));var logger=require(_0x4852('0x4'))(_0x4852('0x5'));var config=require('../../config/environment');var jayson=require(_0x4852('0x6'));var client=jayson[_0x4852('0x7')][_0x4852('0x8')]({'port':0x232a});config[_0x4852('0x9')]=_[_0x4852('0xa')](config[_0x4852('0x9')],{'host':_0x4852('0xb'),'port':0x18eb});var socket=require(_0x4852('0xc'))(new Redis(config[_0x4852('0x9')]));require(_0x4852('0xd'))['register'](socket);function respondWithRpcPromise(_0x173eee,_0x3fdb83,_0x376582){return new BPromise(function(_0x28da5d,_0x54c66f){return client[_0x4852('0xe')](_0x173eee,_0x376582)['then'](function(_0x56739e){logger[_0x4852('0xf')](_0x4852('0x10'),_0x3fdb83,_0x4852('0x11'));logger[_0x4852('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3fdb83,_0x4852('0x11'),JSON[_0x4852('0x13')](_0x56739e));if(_0x56739e['error']){if(_0x56739e[_0x4852('0x14')][_0x4852('0x15')]===0x1f4){logger['error'](_0x4852('0x10'),_0x3fdb83,_0x56739e[_0x4852('0x14')]['message']);return _0x54c66f(_0x56739e['error']['message']);}logger[_0x4852('0x14')]('ChatMessage,\x20%s,\x20%s',_0x3fdb83,_0x56739e[_0x4852('0x14')][_0x4852('0x16')]);return _0x28da5d(_0x56739e[_0x4852('0x14')][_0x4852('0x16')]);}else{logger['info'](_0x4852('0x10'),_0x3fdb83,_0x4852('0x11'));_0x28da5d(_0x56739e[_0x4852('0x17')][_0x4852('0x16')]);}})[_0x4852('0x18')](function(_0x4201b7){logger[_0x4852('0x14')](_0x4852('0x10'),_0x3fdb83,_0x4201b7);_0x54c66f(_0x4201b7);});});}exports[_0x4852('0x19')]=function(_0x416c79){var _0x41a143=this;return new Promise(function(_0x748a93,_0x5c9ff1){return db[_0x4852('0x1a')][_0x4852('0x1b')](_0x416c79[_0x4852('0x1c')],{'raw':_0x416c79[_0x4852('0x1d')]?_0x416c79[_0x4852('0x1d')][_0x4852('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x251d0c){logger['info']('CreateChatMessage',_0x416c79);logger[_0x4852('0x12')](_0x4852('0x19'),_0x416c79,JSON[_0x4852('0x13')](_0x251d0c));_0x748a93(_0x251d0c);})['catch'](function(_0x5bfc7c){logger[_0x4852('0x14')](_0x4852('0x19'),_0x5bfc7c['message'],_0x416c79);_0x5c9ff1(_0x41a143[_0x4852('0x14')](0x1f4,_0x5bfc7c[_0x4852('0x16')]));});});};
\ No newline at end of file
+var _0xe4b0=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','create','body','options','raw','debug','catch','lodash','util'];(function(_0x137173,_0x38df2a){var _0x242689=function(_0x119101){while(--_0x119101){_0x137173['push'](_0x137173['shift']());}};_0x242689(++_0x38df2a);}(_0xe4b0,0x9e));var _0x0e4b=function(_0x202753,_0x209b89){_0x202753=_0x202753-0x0;var _0x2c4038=_0xe4b0[_0x202753];return _0x2c4038;};'use strict';var _=require(_0x0e4b('0x0'));var util=require(_0x0e4b('0x1'));var moment=require(_0x0e4b('0x2'));var BPromise=require(_0x0e4b('0x3'));var rs=require(_0x0e4b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0e4b('0x5'));var logger=require(_0x0e4b('0x6'))(_0x0e4b('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e4b('0x8'));var client=jayson[_0x0e4b('0x9')][_0x0e4b('0xa')]({'port':0x232a});config[_0x0e4b('0xb')]=_['defaults'](config[_0x0e4b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e4b('0xc'))(new Redis(config['redis']));require(_0x0e4b('0xd'))[_0x0e4b('0xe')](socket);function respondWithRpcPromise(_0x5c0846,_0x5a67d9,_0x2619ed){return new BPromise(function(_0x2bd148,_0x535fc3){return client['request'](_0x5c0846,_0x2619ed)[_0x0e4b('0xf')](function(_0x39bb2b){logger[_0x0e4b('0x10')](_0x0e4b('0x11'),_0x5a67d9,'request\x20sent');logger['debug'](_0x0e4b('0x12'),_0x5a67d9,_0x0e4b('0x13'),JSON[_0x0e4b('0x14')](_0x39bb2b));if(_0x39bb2b['error']){if(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x16')]===0x1f4){logger[_0x0e4b('0x15')]('ChatMessage,\x20%s,\x20%s',_0x5a67d9,_0x39bb2b['error'][_0x0e4b('0x17')]);return _0x535fc3(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);}logger[_0x0e4b('0x15')](_0x0e4b('0x11'),_0x5a67d9,_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);return _0x2bd148(_0x39bb2b[_0x0e4b('0x15')][_0x0e4b('0x17')]);}else{logger[_0x0e4b('0x10')](_0x0e4b('0x11'),_0x5a67d9,'request\x20sent');_0x2bd148(_0x39bb2b[_0x0e4b('0x18')][_0x0e4b('0x17')]);}})['catch'](function(_0x3817bc){logger[_0x0e4b('0x15')](_0x0e4b('0x11'),_0x5a67d9,_0x3817bc);_0x535fc3(_0x3817bc);});});}exports[_0x0e4b('0x19')]=function(_0x2ed880){var _0x1a94eb=this;return new Promise(function(_0x3cbdae,_0x2837ee){return db['ChatMessage'][_0x0e4b('0x1a')](_0x2ed880[_0x0e4b('0x1b')],{'raw':_0x2ed880[_0x0e4b('0x1c')]?_0x2ed880[_0x0e4b('0x1c')][_0x0e4b('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x551044){logger[_0x0e4b('0x10')]('CreateChatMessage',_0x2ed880);logger[_0x0e4b('0x1e')](_0x0e4b('0x19'),_0x2ed880,JSON['stringify'](_0x551044));_0x3cbdae(_0x551044);})[_0x0e4b('0x1f')](function(_0x4212b5){logger[_0x0e4b('0x15')](_0x0e4b('0x19'),_0x4212b5[_0x0e4b('0x17')],_0x2ed880);_0x2837ee(_0x1a94eb[_0x0e4b('0x15')](0x1f4,_0x4212b5['message']));});});};
\ No newline at end of file
index 221f143..b6e3441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ba0=['emit','removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x1b2bda,_0x11c750){var _0x5d955b=function(_0x2ae5fb){while(--_0x2ae5fb){_0x1b2bda['push'](_0x1b2bda['shift']());}};_0x5d955b(++_0x11c750);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x7ab04c,_0x3a7791){_0x7ab04c=_0x7ab04c-0x0;var _0x14add2=_0x8ba0[_0x7ab04c];return _0x14add2;};'use strict';var ChatMessageEvents=require(_0x08ba('0x0'));var events=[_0x08ba('0x1'),_0x08ba('0x2'),_0x08ba('0x3')];function createListener(_0x43ffb6,_0x5684f1){return function(_0x5e182a){_0x5684f1[_0x08ba('0x4')](_0x43ffb6,_0x5e182a);};}function removeListener(_0x802b7e,_0x3defcd){return function(){ChatMessageEvents[_0x08ba('0x5')](_0x802b7e,_0x3defcd);};}exports[_0x08ba('0x6')]=function(_0x161a9d){for(var _0x5f29fa=0x0,_0x235354=events[_0x08ba('0x7')];_0x5f29fa<_0x235354;_0x5f29fa++){var _0x37bcdf=events[_0x5f29fa];var _0x451f15=createListener(_0x08ba('0x8')+_0x37bcdf,_0x161a9d);ChatMessageEvents['on'](_0x37bcdf,_0x451f15);}};
\ No newline at end of file
+var _0x9879=['remove','emit','removeListener','register','chatMessage:','./chatMessage.events','save'];(function(_0x5e8282,_0x1f2962){var _0x5cd37d=function(_0x208ec7){while(--_0x208ec7){_0x5e8282['push'](_0x5e8282['shift']());}};_0x5cd37d(++_0x1f2962);}(_0x9879,0x98));var _0x9987=function(_0x3290a8,_0x37178b){_0x3290a8=_0x3290a8-0x0;var _0x6d3825=_0x9879[_0x3290a8];return _0x6d3825;};'use strict';var ChatMessageEvents=require(_0x9987('0x0'));var events=[_0x9987('0x1'),_0x9987('0x2'),'update'];function createListener(_0xadce9d,_0x525218){return function(_0x3a2473){_0x525218[_0x9987('0x3')](_0xadce9d,_0x3a2473);};}function removeListener(_0x1fd45d,_0xcc5722){return function(){ChatMessageEvents[_0x9987('0x4')](_0x1fd45d,_0xcc5722);};}exports[_0x9987('0x5')]=function(_0x4258df){for(var _0x4d479d=0x0,_0x34d2fd=events['length'];_0x4d479d<_0x34d2fd;_0x4d479d++){var _0x6cb988=events[_0x4d479d];var _0x3e5538=createListener(_0x9987('0x6')+_0x6cb988,_0x4258df);ChatMessageEvents['on'](_0x6cb988,_0x3e5538);}};
\ No newline at end of file
index 5606afc..52beee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa172=['create','put','/:id/accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','tracked'];(function(_0x2c66b3,_0x4ecbd1){var _0x14527e=function(_0x167b4a){while(--_0x167b4a){_0x2c66b3['push'](_0x2c66b3['shift']());}};_0x14527e(++_0x4ecbd1);}(_0xa172,0x1d2));var _0x2a17=function(_0x4e9208,_0x3e7809){_0x4e9208=_0x4e9208-0x0;var _0x32a86f=_0xa172[_0x4e9208];return _0x32a86f;};'use strict';var multer=require(_0x2a17('0x0'));var util=require(_0x2a17('0x1'));var path=require(_0x2a17('0x2'));var timeout=require(_0x2a17('0x3'));var express=require(_0x2a17('0x4'));var router=express['Router']();var fs_extra=require(_0x2a17('0x5'));var auth=require(_0x2a17('0x6'));var interaction=require(_0x2a17('0x7'));var config=require(_0x2a17('0x8'));var controller=require(_0x2a17('0x9'));router['get']('/',auth[_0x2a17('0xa')](),controller[_0x2a17('0xb')]);router[_0x2a17('0xc')](_0x2a17('0xd'),auth[_0x2a17('0xa')](),controller[_0x2a17('0xe')]);router[_0x2a17('0xc')](_0x2a17('0xf'),auth[_0x2a17('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction[_0x2a17('0x10')]('chat','chatmessage:create'),controller[_0x2a17('0x11')]);router[_0x2a17('0x12')]('/:id',controller['update']);router[_0x2a17('0x12')](_0x2a17('0x13'),auth[_0x2a17('0xa')](),controller['accept']);router['put'](_0x2a17('0x14'),auth[_0x2a17('0xa')](),controller[_0x2a17('0x15')]);router[_0x2a17('0x16')](_0x2a17('0xf'),auth[_0x2a17('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6a1e=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','destroy'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6a1e,0x6d));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe6a1('0x0'));var util=require(_0xe6a1('0x1'));var path=require(_0xe6a1('0x2'));var timeout=require(_0xe6a1('0x3'));var express=require(_0xe6a1('0x4'));var router=express[_0xe6a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe6a1('0x6'));var interaction=require(_0xe6a1('0x7'));var config=require('../../config/environment');var controller=require(_0xe6a1('0x8'));router[_0xe6a1('0x9')]('/',auth[_0xe6a1('0xa')](),controller[_0xe6a1('0xb')]);router[_0xe6a1('0x9')](_0xe6a1('0xc'),auth[_0xe6a1('0xa')](),controller['describe']);router[_0xe6a1('0x9')](_0xe6a1('0xd'),auth[_0xe6a1('0xa')](),controller[_0xe6a1('0xe')]);router[_0xe6a1('0xf')]('/',auth[_0xe6a1('0xa')](),interaction[_0xe6a1('0x10')](_0xe6a1('0x11'),_0xe6a1('0x12')),controller[_0xe6a1('0x13')]);router[_0xe6a1('0x14')](_0xe6a1('0xd'),controller[_0xe6a1('0x15')]);router[_0xe6a1('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0xe6a1('0x16')]);router[_0xe6a1('0x14')](_0xe6a1('0x17'),auth['isAuthenticated'](),controller[_0xe6a1('0x18')]);router['delete'](_0xe6a1('0xd'),auth[_0xe6a1('0xa')](),controller[_0xe6a1('0x19')]);module[_0xe6a1('0x1a')]=router;
\ No newline at end of file
index c3165bb..4e609bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x2eed97,_0x2f9a2a){var _0x260c3c=function(_0x39967d){while(--_0x39967d){_0x2eed97['push'](_0x2eed97['shift']());}};_0x260c3c(++_0x2f9a2a);}(_0xdb28,0x106));var _0x8db2=function(_0x3b0e21,_0x29d3bb){_0x3b0e21=_0x3b0e21-0x0;var _0x344841=_0xdb28[_0x3b0e21];return _0x344841;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xb10b=['medium','sequelize','TEXT'];(function(_0x458cea,_0x5ec209){var _0x2d11ae=function(_0x1f20a1){while(--_0x1f20a1){_0x458cea['push'](_0x458cea['shift']());}};_0x2d11ae(++_0x5ec209);}(_0xb10b,0x12a));var _0xbb10=function(_0x33199e,_0x428ded){_0x33199e=_0x33199e-0x0;var _0x2eef3c=_0xb10b[_0x33199e];return _0x2eef3c;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'body':{'type':Sequelize[_0xbb10('0x1')](_0xbb10('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xbb10('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
index 8a9a07e..a567d4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1f0cc0,_0x1e9eec){var _0x477658=function(_0x38fd09){while(--_0x38fd09){_0x1f0cc0['push'](_0x1f0cc0['shift']());}};_0x477658(++_0x1e9eec);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2210af,_0x47d68a){var _0x190bb4=function(_0x1d8bc9){while(--_0x1d8bc9){_0x2210af['push'](_0x2210af['shift']());}};_0x190bb4(++_0x47d68a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index 2f279d3..a3efda4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54c7=['hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','save','update','remove','emit'];(function(_0x332e95,_0x2d5ef2){var _0x387cb1=function(_0x168886){while(--_0x168886){_0x332e95['push'](_0x332e95['shift']());}};_0x387cb1(++_0x2d5ef2);}(_0x54c7,0x161));var _0x754c=function(_0x1ef2ac,_0x2589fd){_0x1ef2ac=_0x1ef2ac-0x0;var _0x30ca2d=_0x54c7[_0x1ef2ac];return _0x30ca2d;};'use strict';var EventEmitter=require(_0x754c('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x754c('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x754c('0x2')](0x0);var events={'afterCreate':_0x754c('0x3'),'afterUpdate':_0x754c('0x4'),'afterDestroy':_0x754c('0x5')};function emitEvent(_0x4bb46c){return function(_0x5000a8,_0x4a028d,_0x338ac1){ChatOfflineMessageEvents[_0x754c('0x6')](_0x4bb46c+':'+_0x5000a8['id'],_0x5000a8);ChatOfflineMessageEvents['emit'](_0x4bb46c,_0x5000a8);_0x338ac1(null);};}for(var e in events){if(events[_0x754c('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x754c('0x8')](e,emitEvent(event));}}module[_0x754c('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xd1f3=['emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','save','update','remove'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd1f3,0x16c));var _0x3d1f=function(_0x2af90c,_0x14fdac){_0x2af90c=_0x2af90c-0x0;var _0x1b493c=_0xd1f3[_0x2af90c];return _0x1b493c;};'use strict';var EventEmitter=require(_0x3d1f('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3d1f('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3d1f('0x2'),'afterUpdate':_0x3d1f('0x3'),'afterDestroy':_0x3d1f('0x4')};function emitEvent(_0x54ef8e){return function(_0x5cbc7f,_0x24345f,_0x16cb2d){ChatOfflineMessageEvents[_0x3d1f('0x5')](_0x54ef8e+':'+_0x5cbc7f['id'],_0x5cbc7f);ChatOfflineMessageEvents[_0x3d1f('0x5')](_0x54ef8e,_0x5cbc7f);_0x16cb2d(null);};}for(var e in events){if(events[_0x3d1f('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3d1f('0x7')](e,emitEvent(event));}}module[_0x3d1f('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
index 4580b20..53bc106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x165e=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0x165e,0xd3));var _0xe165=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x165e[_0x3d8ba1];return _0x87804e;};'use strict';var attributes=require(_0xe165('0x0'));module['exports']=function(_0x19b26b){return _0x19b26b[_0xe165('0x1')](_0xe165('0x2'),attributes,{'tableName':_0xe165('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe165('0x4')});};
\ No newline at end of file
+var _0x699d=['exports','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x215b17,_0x4de070){var _0x1dbe04=function(_0x47311e){while(--_0x47311e){_0x215b17['push'](_0x215b17['shift']());}};_0x1dbe04(++_0x4de070);}(_0x699d,0x1cd));var _0xd699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699d[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xd699('0x0'));module[_0xd699('0x1')]=function(_0x1521f6){return _0x1521f6['define'](_0xd699('0x2'),attributes,{'tableName':_0xd699('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd699('0x4'),'collate':_0xd699('0x5')});};
\ No newline at end of file
index 13d4ca8..7c1ec02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e3=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x25c326,_0x250137){var _0x762452=function(_0x50ce5e){while(--_0x50ce5e){_0x25c326['push'](_0x25c326['shift']());}};_0x762452(++_0x250137);}(_0x13e3,0x137));var _0x313e=function(_0x1d80be,_0x3a60ff){_0x1d80be=_0x1d80be-0x0;var _0xf9a4f3=_0x13e3[_0x1d80be];return _0xf9a4f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x313e('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x313e('0x1'));var db=require(_0x313e('0x2'))['db'];var utils=require(_0x313e('0x3'));var logger=require(_0x313e('0x4'))('rpc');var config=require(_0x313e('0x5'));var jayson=require(_0x313e('0x6'));var client=jayson[_0x313e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x65b347,_0x1fb2da,_0x5439c2){return new BPromise(function(_0x5cd7a0,_0x572930){return client[_0x313e('0x8')](_0x65b347,_0x5439c2)[_0x313e('0x9')](function(_0x1dbff1){logger[_0x313e('0xa')](_0x313e('0xb'),_0x1fb2da,_0x313e('0xc'));logger['debug'](_0x313e('0xd'),_0x1fb2da,_0x313e('0xc'),JSON['stringify'](_0x1dbff1));if(_0x1dbff1[_0x313e('0xe')]){if(_0x1dbff1[_0x313e('0xe')]['code']===0x1f4){logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);return _0x572930(_0x1dbff1[_0x313e('0xe')]['message']);}logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);return _0x5cd7a0(_0x1dbff1[_0x313e('0xe')][_0x313e('0xf')]);}else{logger[_0x313e('0xa')](_0x313e('0xb'),_0x1fb2da,_0x313e('0xc'));_0x5cd7a0(_0x1dbff1[_0x313e('0x10')]['message']);}})[_0x313e('0x11')](function(_0xb404d3){logger[_0x313e('0xe')](_0x313e('0xb'),_0x1fb2da,_0xb404d3);_0x572930(_0xb404d3);});});}
\ No newline at end of file
+var _0x221f=['request','then','debug','request\x20sent','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client'];(function(_0x513938,_0x3db266){var _0x20e2d3=function(_0x19189e){while(--_0x19189e){_0x513938['push'](_0x513938['shift']());}};_0x20e2d3(++_0x3db266);}(_0x221f,0x14e));var _0xf221=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0x221f[_0x4474c2];return _0x435fbb;};'use strict';var _=require(_0xf221('0x0'));var util=require(_0xf221('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf221('0x2'));var fs=require('fs');var Redis=require(_0xf221('0x3'));var db=require(_0xf221('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf221('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf221('0x6'));var client=jayson[_0xf221('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2402aa,_0xd54b8e,_0x1c6591){return new BPromise(function(_0x55dcf5,_0x50fe01){return client[_0xf221('0x8')](_0x2402aa,_0x1c6591)[_0xf221('0x9')](function(_0x1b6213){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0xd54b8e,'request\x20sent');logger[_0xf221('0xa')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xd54b8e,_0xf221('0xb'),JSON[_0xf221('0xc')](_0x1b6213));if(_0x1b6213[_0xf221('0xd')]){if(_0x1b6213['error'][_0xf221('0xe')]===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0xd54b8e,_0x1b6213['error'][_0xf221('0xf')]);return _0x50fe01(_0x1b6213['error'][_0xf221('0xf')]);}logger[_0xf221('0xd')](_0xf221('0x10'),_0xd54b8e,_0x1b6213[_0xf221('0xd')]['message']);return _0x55dcf5(_0x1b6213[_0xf221('0xd')]['message']);}else{logger[_0xf221('0x11')](_0xf221('0x10'),_0xd54b8e,_0xf221('0xb'));_0x55dcf5(_0x1b6213['result']['message']);}})['catch'](function(_0xda249e){logger[_0xf221('0xd')](_0xf221('0x10'),_0xd54b8e,_0xda249e);_0x50fe01(_0xda249e);});});}
\ No newline at end of file
index 35d73e4..eff80c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fa6=['/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0x1fa6,0x12d));var _0x61fa=function(_0x5e6d6b,_0x12c0f0){_0x5e6d6b=_0x5e6d6b-0x0;var _0xea6381=_0x1fa6[_0x5e6d6b];return _0xea6381;};'use strict';var multer=require(_0x61fa('0x0'));var util=require(_0x61fa('0x1'));var path=require(_0x61fa('0x2'));var timeout=require(_0x61fa('0x3'));var express=require(_0x61fa('0x4'));var router=express['Router']();var fs_extra=require(_0x61fa('0x5'));var auth=require(_0x61fa('0x6'));var interaction=require(_0x61fa('0x7'));var config=require(_0x61fa('0x8'));var controller=require(_0x61fa('0x9'));router[_0x61fa('0xa')]('/',auth[_0x61fa('0xb')](),controller[_0x61fa('0xc')]);router[_0x61fa('0xa')]('/describe',auth[_0x61fa('0xb')](),controller[_0x61fa('0xd')]);router['get'](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0xf')]);router[_0x61fa('0x10')]('/',auth[_0x61fa('0xb')](),controller[_0x61fa('0x11')]);router['put'](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0x12')]);router[_0x61fa('0x13')](_0x61fa('0xe'),auth[_0x61fa('0xb')](),controller[_0x61fa('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x520f=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated','describe'];(function(_0x8c1ea9,_0x460765){var _0x92f2ac=function(_0x564ebc){while(--_0x564ebc){_0x8c1ea9['push'](_0x8c1ea9['shift']());}};_0x92f2ac(++_0x460765);}(_0x520f,0x1e8));var _0xf520=function(_0x5a2c7b,_0x441265){_0x5a2c7b=_0x5a2c7b-0x0;var _0x3ad931=_0x520f[_0x5a2c7b];return _0x3ad931;};'use strict';var multer=require(_0xf520('0x0'));var util=require('util');var path=require(_0xf520('0x1'));var timeout=require(_0xf520('0x2'));var express=require('express');var router=express[_0xf520('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf520('0x4'));var interaction=require(_0xf520('0x5'));var config=require(_0xf520('0x6'));var controller=require(_0xf520('0x7'));router[_0xf520('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf520('0x8')](_0xf520('0x9'),auth[_0xf520('0xa')](),controller[_0xf520('0xb')]);router['get'](_0xf520('0xc'),auth[_0xf520('0xa')](),controller[_0xf520('0xd')]);router['post']('/',auth[_0xf520('0xa')](),controller[_0xf520('0xe')]);router[_0xf520('0xf')]('/:id',auth[_0xf520('0xa')](),controller[_0xf520('0x10')]);router[_0xf520('0x11')](_0xf520('0xc'),auth[_0xf520('0xa')](),controller[_0xf520('0x12')]);module[_0xf520('0x13')]=router;
\ No newline at end of file
index 4db8bcb..9961d15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae29=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x594c55,_0x2bf942){var _0x4801a5=function(_0x52a288){while(--_0x52a288){_0x594c55['push'](_0x594c55['shift']());}};_0x4801a5(++_0x2bf942);}(_0xae29,0xf3));var _0x9ae2=function(_0xada429,_0xdb476b){_0xada429=_0xada429-0x0;var _0x4d8c6d=_0xae29[_0xada429];return _0x4d8c6d;};'use strict';var Sequelize=require(_0x9ae2('0x0'));module[_0x9ae2('0x1')]={'name':{'type':Sequelize[_0x9ae2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9ae2('0x3')](_0x9ae2('0x4'),_0x9ae2('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x9ae2('0x2')]},'timeout':{'type':Sequelize[_0x9ae2('0x6')]}};
\ No newline at end of file
+var _0x76ef=['timeout','STRING','INTEGER','sequelize','exports','ENUM'];(function(_0x3f5238,_0x39e5b6){var _0x115624=function(_0x57db3a){while(--_0x57db3a){_0x3f5238['push'](_0x3f5238['shift']());}};_0x115624(++_0x39e5b6);}(_0x76ef,0x14d));var _0xf76e=function(_0x2574e7,_0x2165de){_0x2574e7=_0x2574e7-0x0;var _0x39b967=_0x76ef[_0x2574e7];return _0x39b967;};'use strict';var Sequelize=require(_0xf76e('0x0'));module[_0xf76e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf76e('0x2')]('mouseOver',_0xf76e('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xf76e('0x4')]},'timeout':{'type':Sequelize[_0xf76e('0x5')]}};
\ No newline at end of file
index 45eed99..c3a8754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa276=['querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','includeAll','merge','find','catch','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel'];(function(_0x2bad0d,_0x1a99c9){var _0x69f1e1=function(_0x152a30){while(--_0x152a30){_0x2bad0d['push'](_0x2bad0d['shift']());}};_0x69f1e1(++_0x1a99c9);}(_0xa276,0x9a));var _0x6a27=function(_0xd1f83b,_0xc10512){_0xd1f83b=_0xd1f83b-0x0;var _0x548b09=_0xa276[_0xd1f83b];return _0x548b09;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6a27('0x0'));var zipdir=require(_0x6a27('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a27('0x2'));var moment=require(_0x6a27('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6a27('0x4'));var util=require(_0x6a27('0x5'));var path=require(_0x6a27('0x6'));var sox=require('sox');var csv=require(_0x6a27('0x7'));var ejs=require(_0x6a27('0x8'));var fs=require('fs');var fs_extra=require(_0x6a27('0x9'));var _=require('lodash');var squel=require(_0x6a27('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6a27('0xb'));var Papa=require(_0x6a27('0xc'));var Redis=require(_0x6a27('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6a27('0xe'));var hardwareService=require(_0x6a27('0xf'));var logger=require(_0x6a27('0x10'))(_0x6a27('0x11'));var utils=require(_0x6a27('0x12'));var config=require(_0x6a27('0x13'));var licenseUtil=require(_0x6a27('0x14'));var db=require(_0x6a27('0x15'))['db'];function respondWithStatusCode(_0x394307,_0x4a7209){_0x4a7209=_0x4a7209||0xcc;return function(_0x96472c){if(_0x96472c){return _0x394307['sendStatus'](_0x4a7209);}return _0x394307['status'](_0x4a7209)[_0x6a27('0x16')]();};}function respondWithResult(_0x1e987f,_0x39ef85){_0x39ef85=_0x39ef85||0xc8;return function(_0x5b28c6){if(_0x5b28c6){return _0x1e987f[_0x6a27('0x17')](_0x39ef85)[_0x6a27('0x18')](_0x5b28c6);}};}function respondWithFilteredResult(_0x318b61,_0x8f297b){return function(_0x294ac7){if(_0x294ac7){var _0x523e6d=typeof _0x8f297b['offset']===_0x6a27('0x19')&&typeof _0x8f297b[_0x6a27('0x1a')]===_0x6a27('0x19');var _0x4339d3=_0x294ac7[_0x6a27('0x1b')];var _0x1d5925=_0x523e6d?0x0:_0x8f297b['offset'];var _0x3fd414=_0x523e6d?_0x294ac7[_0x6a27('0x1b')]:_0x8f297b[_0x6a27('0x1c')]+_0x8f297b[_0x6a27('0x1a')];var _0x50ddcc;if(_0x3fd414>=_0x4339d3){_0x3fd414=_0x4339d3;_0x50ddcc=0xc8;}else{_0x50ddcc=0xce;}_0x318b61[_0x6a27('0x17')](_0x50ddcc);return _0x318b61[_0x6a27('0x1d')](_0x6a27('0x1e'),_0x1d5925+'-'+_0x3fd414+'/'+_0x4339d3)[_0x6a27('0x18')](_0x294ac7);}return null;};}function patchUpdates(_0x57649a){return function(_0x531d60){try{jsonpatch[_0x6a27('0x1f')](_0x531d60,_0x57649a,!![]);}catch(_0x4231c3){return BPromise['reject'](_0x4231c3);}return _0x531d60[_0x6a27('0x20')]();};}function saveUpdates(_0x2a7fdf,_0x13fc15){return function(_0x167076){if(_0x167076){return _0x167076[_0x6a27('0x21')](_0x2a7fdf)[_0x6a27('0x22')](function(_0x29348c){return _0x29348c;});}return null;};}function removeEntity(_0x13e148,_0x5e3a2e){return function(_0x241029){if(_0x241029){return _0x241029[_0x6a27('0x23')]()[_0x6a27('0x22')](function(){_0x13e148[_0x6a27('0x17')](0xcc)[_0x6a27('0x16')]();});}};}function handleEntityNotFound(_0x5f4897,_0x5b725c){return function(_0x30454b){if(!_0x30454b){_0x5f4897[_0x6a27('0x24')](0x194);}return _0x30454b;};}function handleError(_0x73dc52,_0x354781){_0x354781=_0x354781||0x1f4;return function(_0x54fc6c){logger[_0x6a27('0x25')](_0x54fc6c['stack']);if(_0x54fc6c['name']){delete _0x54fc6c[_0x6a27('0x26')];}_0x73dc52[_0x6a27('0x17')](_0x354781)['send'](_0x54fc6c);};}exports[_0x6a27('0x27')]=function(_0x52cc5d,_0x35fe1c){var _0xa42f9c={'raw':!![],'where':{'id':_0x52cc5d[_0x6a27('0x28')]['id']}},_0x5140b2={};_0x5140b2[_0x6a27('0x29')]=_[_0x6a27('0x2a')](db[_0x6a27('0x2b')][_0x6a27('0x2c')]);_0x5140b2[_0x6a27('0x2d')]=_[_0x6a27('0x2a')](_0x52cc5d[_0x6a27('0x2d')]);_0x5140b2['filters']=_[_0x6a27('0x2e')](_0x5140b2[_0x6a27('0x29')],_0x5140b2[_0x6a27('0x2d')]);_0xa42f9c[_0x6a27('0x2f')]=_['intersection'](_0x5140b2['model'],qs[_0x6a27('0x30')](_0x52cc5d['query'][_0x6a27('0x30')]));_0xa42f9c[_0x6a27('0x2f')]=_0xa42f9c[_0x6a27('0x2f')][_0x6a27('0x31')]?_0xa42f9c[_0x6a27('0x2f')]:_0x5140b2[_0x6a27('0x29')];if(_0x52cc5d[_0x6a27('0x2d')][_0x6a27('0x32')]){_0xa42f9c['include']=[{'all':!![]}];}_0xa42f9c=_[_0x6a27('0x33')]({},_0xa42f9c,_0x52cc5d['options']);return db[_0x6a27('0x2b')][_0x6a27('0x34')](_0xa42f9c)[_0x6a27('0x22')](handleEntityNotFound(_0x35fe1c,null))[_0x6a27('0x22')](respondWithResult(_0x35fe1c,null))[_0x6a27('0x35')](handleError(_0x35fe1c,null));};exports['create']=function(_0xabaac8,_0x316bb5){return db['ChatProactiveAction']['create'](_0xabaac8[_0x6a27('0x36')],{})[_0x6a27('0x22')](respondWithResult(_0x316bb5,0xc9))[_0x6a27('0x35')](handleError(_0x316bb5,null));};exports[_0x6a27('0x21')]=function(_0x1d9c1c,_0x3c3ad2){if(_0x1d9c1c['body']['id']){delete _0x1d9c1c[_0x6a27('0x36')]['id'];}return db['ChatProactiveAction'][_0x6a27('0x34')]({'where':{'id':_0x1d9c1c[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x3c3ad2,null))[_0x6a27('0x22')](saveUpdates(_0x1d9c1c[_0x6a27('0x36')],null))[_0x6a27('0x22')](respondWithResult(_0x3c3ad2,null))[_0x6a27('0x35')](handleError(_0x3c3ad2,null));};exports[_0x6a27('0x23')]=function(_0x55020d,_0x43c9f3){return db['ChatProactiveAction']['find']({'where':{'id':_0x55020d[_0x6a27('0x28')]['id']}})[_0x6a27('0x22')](handleEntityNotFound(_0x43c9f3,null))[_0x6a27('0x22')](removeEntity(_0x43c9f3,null))[_0x6a27('0x35')](handleError(_0x43c9f3,null));};
\ No newline at end of file
+var _0x5243=['mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','catch','destroy','eml-format','fast-json-patch','request-promise'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0x5243,0x71));var _0x3524=function(_0x55eb4b,_0x2c3c51){_0x55eb4b=_0x55eb4b-0x0;var _0x525ca2=_0x5243[_0x55eb4b];return _0x525ca2;};'use strict';var emlformat=require(_0x3524('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3524('0x1'));var rp=require(_0x3524('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3524('0x3'));var util=require(_0x3524('0x4'));var path=require('path');var sox=require(_0x3524('0x5'));var csv=require('to-csv');var ejs=require(_0x3524('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var licenseUtil=require(_0x3524('0x14'));var db=require(_0x3524('0x15'))['db'];function respondWithStatusCode(_0x5d5a60,_0x4f49da){_0x4f49da=_0x4f49da||0xcc;return function(_0x50c11f){if(_0x50c11f){return _0x5d5a60['sendStatus'](_0x4f49da);}return _0x5d5a60[_0x3524('0x16')](_0x4f49da)[_0x3524('0x17')]();};}function respondWithResult(_0x58cd29,_0x3aa2da){_0x3aa2da=_0x3aa2da||0xc8;return function(_0x253d92){if(_0x253d92){return _0x58cd29[_0x3524('0x16')](_0x3aa2da)[_0x3524('0x18')](_0x253d92);}};}function respondWithFilteredResult(_0xe5df67,_0x235cfd){return function(_0x34d9a0){if(_0x34d9a0){var _0x8440a4=typeof _0x235cfd[_0x3524('0x19')]==='undefined'&&typeof _0x235cfd[_0x3524('0x1a')]==='undefined';var _0x2eb681=_0x34d9a0[_0x3524('0x1b')];var _0x44ee2e=_0x8440a4?0x0:_0x235cfd[_0x3524('0x19')];var _0x1ca615=_0x8440a4?_0x34d9a0[_0x3524('0x1b')]:_0x235cfd['offset']+_0x235cfd['limit'];var _0x1acbd1;if(_0x1ca615>=_0x2eb681){_0x1ca615=_0x2eb681;_0x1acbd1=0xc8;}else{_0x1acbd1=0xce;}_0xe5df67['status'](_0x1acbd1);return _0xe5df67[_0x3524('0x1c')](_0x3524('0x1d'),_0x44ee2e+'-'+_0x1ca615+'/'+_0x2eb681)[_0x3524('0x18')](_0x34d9a0);}return null;};}function patchUpdates(_0xd285a3){return function(_0x1d25f8){try{jsonpatch[_0x3524('0x1e')](_0x1d25f8,_0xd285a3,!![]);}catch(_0x4f584a){return BPromise[_0x3524('0x1f')](_0x4f584a);}return _0x1d25f8[_0x3524('0x20')]();};}function saveUpdates(_0x1ab2c5,_0xf1b3b1){return function(_0x2d20c8){if(_0x2d20c8){return _0x2d20c8['update'](_0x1ab2c5)[_0x3524('0x21')](function(_0x52600c){return _0x52600c;});}return null;};}function removeEntity(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(_0x101e9a){return _0x101e9a['destroy']()[_0x3524('0x21')](function(){_0x2eb72f[_0x3524('0x16')](0xcc)[_0x3524('0x17')]();});}};}function handleEntityNotFound(_0x27bd6a,_0x4dfd49){return function(_0x4256ca){if(!_0x4256ca){_0x27bd6a[_0x3524('0x22')](0x194);}return _0x4256ca;};}function handleError(_0x1765a4,_0x5dc071){_0x5dc071=_0x5dc071||0x1f4;return function(_0x1d351e){logger[_0x3524('0x23')](_0x1d351e['stack']);if(_0x1d351e[_0x3524('0x24')]){delete _0x1d351e[_0x3524('0x24')];}_0x1765a4['status'](_0x5dc071)['send'](_0x1d351e);};}exports[_0x3524('0x25')]=function(_0x3fddc1,_0x225b26){var _0x651f11={'raw':!![],'where':{'id':_0x3fddc1[_0x3524('0x26')]['id']}},_0x5bf38e={};_0x5bf38e['model']=_[_0x3524('0x27')](db[_0x3524('0x28')][_0x3524('0x29')]);_0x5bf38e['query']=_['keys'](_0x3fddc1[_0x3524('0x2a')]);_0x5bf38e[_0x3524('0x2b')]=_['intersection'](_0x5bf38e[_0x3524('0x2c')],_0x5bf38e[_0x3524('0x2a')]);_0x651f11[_0x3524('0x2d')]=_[_0x3524('0x2e')](_0x5bf38e[_0x3524('0x2c')],qs['fields'](_0x3fddc1[_0x3524('0x2a')][_0x3524('0x2f')]));_0x651f11[_0x3524('0x2d')]=_0x651f11['attributes'][_0x3524('0x30')]?_0x651f11[_0x3524('0x2d')]:_0x5bf38e[_0x3524('0x2c')];if(_0x3fddc1[_0x3524('0x2a')][_0x3524('0x31')]){_0x651f11[_0x3524('0x32')]=[{'all':!![]}];}_0x651f11=_[_0x3524('0x33')]({},_0x651f11,_0x3fddc1[_0x3524('0x34')]);return db[_0x3524('0x28')][_0x3524('0x35')](_0x651f11)[_0x3524('0x21')](handleEntityNotFound(_0x225b26,null))['then'](respondWithResult(_0x225b26,null))['catch'](handleError(_0x225b26,null));};exports['create']=function(_0x197f78,_0x48b54b){return db[_0x3524('0x28')][_0x3524('0x36')](_0x197f78[_0x3524('0x37')],{})['then'](respondWithResult(_0x48b54b,0xc9))[_0x3524('0x38')](handleError(_0x48b54b,null));};exports['update']=function(_0x18ee71,_0xcc63d5){if(_0x18ee71[_0x3524('0x37')]['id']){delete _0x18ee71[_0x3524('0x37')]['id'];}return db[_0x3524('0x28')]['find']({'where':{'id':_0x18ee71[_0x3524('0x26')]['id']}})[_0x3524('0x21')](handleEntityNotFound(_0xcc63d5,null))[_0x3524('0x21')](saveUpdates(_0x18ee71[_0x3524('0x37')],null))['then'](respondWithResult(_0xcc63d5,null))[_0x3524('0x38')](handleError(_0xcc63d5,null));};exports[_0x3524('0x39')]=function(_0x449c51,_0x97b711){return db[_0x3524('0x28')]['find']({'where':{'id':_0x449c51['params']['id']}})[_0x3524('0x21')](handleEntityNotFound(_0x97b711,null))[_0x3524('0x21')](removeEntity(_0x97b711,null))[_0x3524('0x38')](handleError(_0x97b711,null));};
\ No newline at end of file
index 0e22242..a81e884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf51=['chat_proactive_actions','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1abe5a,_0x3be795){var _0x54d205=function(_0x3c31f6){while(--_0x3c31f6){_0x1abe5a['push'](_0x1abe5a['shift']());}};_0x54d205(++_0x3be795);}(_0xbf51,0x12d));var _0x1bf5=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xbf51[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0x1bf5('0x0'));var util=require(_0x1bf5('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1bf5('0x2'));var rp=require(_0x1bf5('0x3'));var fs=require('fs');var path=require(_0x1bf5('0x4'));var rimraf=require(_0x1bf5('0x5'));var config=require(_0x1bf5('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x1bf5('0x7')]=function(_0x3eeaa3,_0x1d2f49){return _0x3eeaa3[_0x1bf5('0x8')]('ChatProactiveAction',attributes,{'tableName':_0x1bf5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6524=['moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','api'];(function(_0x3050c5,_0x51747a){var _0x1dd23c=function(_0x36f880){while(--_0x36f880){_0x3050c5['push'](_0x3050c5['shift']());}};_0x1dd23c(++_0x51747a);}(_0x6524,0x1e9));var _0x4652=function(_0x54781c,_0x5b5683){_0x54781c=_0x54781c-0x0;var _0x4804bc=_0x6524[_0x54781c];return _0x4804bc;};'use strict';var _=require(_0x4652('0x0'));var util=require(_0x4652('0x1'));var logger=require('../../config/logger')(_0x4652('0x2'));var moment=require(_0x4652('0x3'));var BPromise=require(_0x4652('0x4'));var rp=require(_0x4652('0x5'));var fs=require('fs');var path=require(_0x4652('0x6'));var rimraf=require(_0x4652('0x7'));var config=require('../../config/environment');var attributes=require(_0x4652('0x8'));module['exports']=function(_0x4e602e,_0x14864f){return _0x4e602e[_0x4652('0x9')](_0x4652('0xa'),attributes,{'tableName':_0x4652('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d3dccd..0543df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9220=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','ChatProactiveAction,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x52f2eb,_0x138336){var _0x3e344d=function(_0x2a7b7b){while(--_0x2a7b7b){_0x52f2eb['push'](_0x52f2eb['shift']());}};_0x3e344d(++_0x138336);}(_0x9220,0x162));var _0x0922=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9220[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x0922('0x0'));var util=require(_0x0922('0x1'));var moment=require(_0x0922('0x2'));var BPromise=require(_0x0922('0x3'));var rs=require(_0x0922('0x4'));var fs=require('fs');var Redis=require(_0x0922('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0922('0x6'));var logger=require(_0x0922('0x7'))(_0x0922('0x8'));var config=require(_0x0922('0x9'));var jayson=require(_0x0922('0xa'));var client=jayson[_0x0922('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x591d6c,_0x48ce8a,_0x41ba28){return new BPromise(function(_0x10cfb5,_0x33b528){return client[_0x0922('0xc')](_0x591d6c,_0x41ba28)[_0x0922('0xd')](function(_0xa849e){logger[_0x0922('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x48ce8a,'request\x20sent');logger[_0x0922('0xf')](_0x0922('0x10'),_0x48ce8a,_0x0922('0x11'),JSON[_0x0922('0x12')](_0xa849e));if(_0xa849e['error']){if(_0xa849e['error']['code']===0x1f4){logger['error'](_0x0922('0x13'),_0x48ce8a,_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);return _0x33b528(_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);}logger[_0x0922('0x14')](_0x0922('0x13'),_0x48ce8a,_0xa849e['error'][_0x0922('0x15')]);return _0x10cfb5(_0xa849e[_0x0922('0x14')][_0x0922('0x15')]);}else{logger['info'](_0x0922('0x13'),_0x48ce8a,_0x0922('0x11'));_0x10cfb5(_0xa849e[_0x0922('0x16')][_0x0922('0x15')]);}})[_0x0922('0x17')](function(_0x4c0e44){logger[_0x0922('0x14')](_0x0922('0x13'),_0x48ce8a,_0x4c0e44);_0x33b528(_0x4c0e44);});});}
\ No newline at end of file
+var _0xa167=['../../config/environment','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4b6778,_0x505a76){var _0x22dbb9=function(_0x4881eb){while(--_0x4881eb){_0x4b6778['push'](_0x4b6778['shift']());}};_0x22dbb9(++_0x505a76);}(_0xa167,0xce));var _0x7a16=function(_0x52b902,_0x43c4aa){_0x52b902=_0x52b902-0x0;var _0x397611=_0xa167[_0x52b902];return _0x397611;};'use strict';var _=require(_0x7a16('0x0'));var util=require(_0x7a16('0x1'));var moment=require(_0x7a16('0x2'));var BPromise=require(_0x7a16('0x3'));var rs=require(_0x7a16('0x4'));var fs=require('fs');var Redis=require(_0x7a16('0x5'));var db=require(_0x7a16('0x6'))['db'];var utils=require(_0x7a16('0x7'));var logger=require(_0x7a16('0x8'))(_0x7a16('0x9'));var config=require(_0x7a16('0xa'));var jayson=require(_0x7a16('0xb'));var client=jayson[_0x7a16('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x173fd5,_0x15c517,_0x2c9012){return new BPromise(function(_0x5b23cf,_0x116fe3){return client['request'](_0x173fd5,_0x2c9012)[_0x7a16('0xd')](function(_0x1570b0){logger['info'](_0x7a16('0xe'),_0x15c517,_0x7a16('0xf'));logger[_0x7a16('0x10')](_0x7a16('0x11'),_0x15c517,'request\x20sent',JSON['stringify'](_0x1570b0));if(_0x1570b0[_0x7a16('0x12')]){if(_0x1570b0[_0x7a16('0x12')][_0x7a16('0x13')]===0x1f4){logger['error'](_0x7a16('0xe'),_0x15c517,_0x1570b0[_0x7a16('0x12')][_0x7a16('0x14')]);return _0x116fe3(_0x1570b0[_0x7a16('0x12')]['message']);}logger[_0x7a16('0x12')](_0x7a16('0xe'),_0x15c517,_0x1570b0['error'][_0x7a16('0x14')]);return _0x5b23cf(_0x1570b0['error']['message']);}else{logger[_0x7a16('0x15')](_0x7a16('0xe'),_0x15c517,_0x7a16('0xf'));_0x5b23cf(_0x1570b0[_0x7a16('0x16')][_0x7a16('0x14')]);}})[_0x7a16('0x17')](function(_0x40a4da){logger[_0x7a16('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x15c517,_0x40a4da);_0x116fe3(_0x40a4da);});});}
\ No newline at end of file
index 6dabcc0..38f1fd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x330a10,_0x32a371){var _0x1d0b53=function(_0x596911){while(--_0x596911){_0x330a10['push'](_0x330a10['shift']());}};_0x1d0b53(++_0x32a371);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x24ca[_0x5b7788];return _0x573871;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0xc')]);router[_0xa24c('0xd')]('/',auth[_0xa24c('0xb')](),controller['create']);router[_0xa24c('0xe')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller['update']);router[_0xa24c('0xf')](_0xa24c('0xa'),auth[_0xa24c('0xb')](),controller[_0xa24c('0x10')]);module[_0xa24c('0x11')]=router;
\ No newline at end of file
+var _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x3093ea,_0x3a94bc){var _0x19d889=function(_0x858d3e){while(--_0x858d3e){_0x3093ea['push'](_0x3093ea['shift']());}};_0x19d889(++_0x3a94bc);}(_0xac9d,0x14d));var _0xdac9=function(_0x4a8227,_0x27ab19){_0x4a8227=_0x4a8227-0x0;var _0x403b2c=_0xac9d[_0x4a8227];return _0x403b2c;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router;
\ No newline at end of file
index 3f3c579..565eb8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d4=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory'];(function(_0x32e77d,_0x46cb63){var _0x583d3f=function(_0x30b4dc){while(--_0x30b4dc){_0x32e77d['push'](_0x32e77d['shift']());}};_0x583d3f(++_0x46cb63);}(_0x86d4,0x6d));var _0x486d=function(_0xa197e5,_0x574530){_0xa197e5=_0xa197e5-0x0;var _0xcea285=_0x86d4[_0xa197e5];return _0xcea285;};'use strict';var Sequelize=require(_0x486d('0x0'));module[_0x486d('0x1')]={'name':{'type':Sequelize[_0x486d('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x486d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x486d('0x4'),'beepall',_0x486d('0x5'))}};
\ No newline at end of file
+var _0x14dd=['STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x14dd,0x196));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd14d('0x0'));module[_0xd14d('0x1')]={'name':{'type':Sequelize[_0xd14d('0x2')],'unique':_0xd14d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd14d('0x2')]},'timeout':{'type':Sequelize[_0xd14d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd14d('0x5')]('rrmemory',_0xd14d('0x6'),_0xd14d('0x7'))}};
\ No newline at end of file
index 0c31d30..ec16ed2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcec=['omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','nolimit','addTeams','ids','User','voicePause','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','sequelize','removeAgents','userChatQueue:remove'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xdcec,0x1c0));var _0xcdce=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xdcec[_0x221ba2];return _0x47d08e;};'use strict';var emlformat=require(_0xcdce('0x0'));var rimraf=require(_0xcdce('0x1'));var zipdir=require(_0xcdce('0x2'));var jsonpatch=require(_0xcdce('0x3'));var rp=require(_0xcdce('0x4'));var moment=require(_0xcdce('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcdce('0x6'));var path=require(_0xcdce('0x7'));var sox=require('sox');var csv=require(_0xcdce('0x8'));var ejs=require(_0xcdce('0x9'));var fs=require('fs');var fs_extra=require(_0xcdce('0xa'));var _=require(_0xcdce('0xb'));var squel=require('squel');var crypto=require(_0xcdce('0xc'));var jsforce=require(_0xcdce('0xd'));var deskjs=require(_0xcdce('0xe'));var toCsv=require(_0xcdce('0x8'));var querystring=require(_0xcdce('0xf'));var Papa=require(_0xcdce('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcdce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcdce('0x12'));var utils=require(_0xcdce('0x13'));var config=require(_0xcdce('0x14'));var licenseUtil=require(_0xcdce('0x15'));var db=require(_0xcdce('0x16'))['db'];config['redis']=_[_0xcdce('0x17')](config[_0xcdce('0x18')],{'host':_0xcdce('0x19'),'port':0x18eb});var socket=require(_0xcdce('0x1a'))(new Redis(config['redis']));require(_0xcdce('0x1b'))[_0xcdce('0x1c')](socket);var jayson=require(_0xcdce('0x1d'));var client=jayson[_0xcdce('0x1e')][_0xcdce('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1cefd4,_0x5aae4e,_0x584f83,_0x4bd8fc){return new BPromise(function(_0x507dbe,_0x16075a){var _0x12e549=_0x4bd8fc||client;return _0x12e549[_0xcdce('0x20')](_0x1cefd4,_0x584f83)[_0xcdce('0x21')](function(_0x2e4b73){logger[_0xcdce('0x22')]('ChatQueue,\x20%s,\x20%s',_0x5aae4e,_0xcdce('0x23'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5aae4e,_0xcdce('0x23'),JSON['stringify'](_0x2e4b73));if(_0x2e4b73[_0xcdce('0x24')]){if(_0x2e4b73['error'][_0xcdce('0x25')]===0x1f4){logger[_0xcdce('0x24')](_0xcdce('0x26'),_0x5aae4e,_0x2e4b73['error']['message']);return _0x16075a(_0x2e4b73[_0xcdce('0x24')]['message']);}logger['error'](_0xcdce('0x26'),_0x5aae4e,_0x2e4b73[_0xcdce('0x24')][_0xcdce('0x27')]);return _0x507dbe(_0x2e4b73[_0xcdce('0x24')][_0xcdce('0x27')]);}else{logger[_0xcdce('0x22')](_0xcdce('0x26'),_0x5aae4e,_0xcdce('0x23'));_0x507dbe(_0x2e4b73[_0xcdce('0x28')][_0xcdce('0x27')]);}})['catch'](function(_0x1b5740){logger[_0xcdce('0x24')](_0xcdce('0x26'),_0x5aae4e,_0x1b5740);_0x16075a(_0x1b5740);});});}function respondWithStatusCode(_0x253b2a,_0x1d0e08){_0x1d0e08=_0x1d0e08||0xcc;return function(_0x559049){if(_0x559049){return _0x253b2a[_0xcdce('0x29')](_0x1d0e08);}return _0x253b2a[_0xcdce('0x2a')](_0x1d0e08)[_0xcdce('0x2b')]();};}function respondWithResult(_0xed7ad1,_0x35eb6b){_0x35eb6b=_0x35eb6b||0xc8;return function(_0x26bfed){if(_0x26bfed){return _0xed7ad1[_0xcdce('0x2a')](_0x35eb6b)[_0xcdce('0x2c')](_0x26bfed);}};}function respondWithFilteredResult(_0x38ce67,_0x3a1a4a){return function(_0x239512){if(_0x239512){var _0x1f813e=typeof _0x3a1a4a[_0xcdce('0x2d')]==='undefined'&&typeof _0x3a1a4a['limit']===_0xcdce('0x2e');var _0x277700=_0x239512['count'];var _0x56a7d4=_0x1f813e?0x0:_0x3a1a4a[_0xcdce('0x2d')];var _0x3db934=_0x1f813e?_0x239512[_0xcdce('0x2f')]:_0x3a1a4a[_0xcdce('0x2d')]+_0x3a1a4a['limit'];var _0xb93332;if(_0x3db934>=_0x277700){_0x3db934=_0x277700;_0xb93332=0xc8;}else{_0xb93332=0xce;}_0x38ce67[_0xcdce('0x2a')](_0xb93332);return _0x38ce67[_0xcdce('0x30')](_0xcdce('0x31'),_0x56a7d4+'-'+_0x3db934+'/'+_0x277700)[_0xcdce('0x2c')](_0x239512);}return null;};}function patchUpdates(_0x199883){return function(_0x446fe0){try{jsonpatch[_0xcdce('0x32')](_0x446fe0,_0x199883,!![]);}catch(_0x59c946){return BPromise['reject'](_0x59c946);}return _0x446fe0[_0xcdce('0x33')]();};}function saveUpdates(_0x45778b,_0x4eb92e){return function(_0x3d4cf0){if(_0x3d4cf0){return _0x3d4cf0[_0xcdce('0x34')](_0x45778b)['then'](function(_0x334822){return _0x334822;});}return null;};}function removeEntity(_0x370c54,_0x5a5cf0){return function(_0x102792){if(_0x102792){return _0x102792[_0xcdce('0x35')]()['then'](function(){var _0x3a55f5=_0x102792[_0xcdce('0x36')]({'plain':!![]});var _0x272f2b=_0xcdce('0x37');return db[_0xcdce('0x38')][_0xcdce('0x35')]({'where':{'type':_0x272f2b,'resourceId':_0x3a55f5['id']}})[_0xcdce('0x21')](function(){return _0x102792;});})[_0xcdce('0x21')](function(){_0x370c54['status'](0xcc)[_0xcdce('0x2b')]();});}};}function handleEntityNotFound(_0x540fa5,_0x4a74c2){return function(_0xf0d427){if(!_0xf0d427){_0x540fa5[_0xcdce('0x29')](0x194);}return _0xf0d427;};}function handleError(_0x26996,_0x3c9db4){_0x3c9db4=_0x3c9db4||0x1f4;return function(_0x9490c9){logger[_0xcdce('0x24')](_0x9490c9[_0xcdce('0x39')]);if(_0x9490c9[_0xcdce('0x3a')]){delete _0x9490c9[_0xcdce('0x3a')];}_0x26996['status'](_0x3c9db4)['send'](_0x9490c9);};}exports[_0xcdce('0x3b')]=function(_0x34783d,_0x132181){var _0x498cb0={},_0x196c33={},_0x70c391={'count':0x0,'rows':[]};var _0x2dc2af=_[_0xcdce('0x3c')](db[_0xcdce('0x3d')]['rawAttributes'],function(_0x3692d2){return{'name':_0x3692d2[_0xcdce('0x3e')],'type':_0x3692d2[_0xcdce('0x3f')][_0xcdce('0x40')]};});_0x196c33[_0xcdce('0x41')]=_[_0xcdce('0x3c')](_0x2dc2af,_0xcdce('0x3a'));_0x196c33[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x34783d['query']);_0x196c33[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x196c33[_0xcdce('0x41')],_0x196c33[_0xcdce('0x42')]);_0x498cb0[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x196c33['model'],qs[_0xcdce('0x47')](_0x34783d['query']['fields']));_0x498cb0['attributes']=_0x498cb0[_0xcdce('0x46')]['length']?_0x498cb0[_0xcdce('0x46')]:_0x196c33['model'];if(!_0x34783d[_0xcdce('0x42')][_0xcdce('0x48')]('nolimit')){_0x498cb0[_0xcdce('0x49')]=qs['limit'](_0x34783d[_0xcdce('0x42')]['limit']);_0x498cb0['offset']=qs[_0xcdce('0x2d')](_0x34783d['query']['offset']);}_0x498cb0['order']=qs[_0xcdce('0x4a')](_0x34783d[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x498cb0[_0xcdce('0x4b')]=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x34783d[_0xcdce('0x42')],_0x196c33[_0xcdce('0x44')]),_0x2dc2af);if(_0x34783d['query']['filter']){_0x498cb0[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x498cb0[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x2dc2af,function(_0x5dca90){if(_0x5dca90[_0xcdce('0x3f')]!==_0xcdce('0x4e')){var _0xb135de={};_0xb135de[_0x5dca90[_0xcdce('0x3a')]]={'$like':'%'+_0x34783d[_0xcdce('0x42')][_0xcdce('0x4f')]+'%'};return _0xb135de;}})});}_0x498cb0=_[_0xcdce('0x4d')]({},_0x498cb0,_0x34783d[_0xcdce('0x50')]);var _0x3d56ce={'where':_0x498cb0[_0xcdce('0x4b')]};return db[_0xcdce('0x3d')][_0xcdce('0x2f')](_0x3d56ce)[_0xcdce('0x21')](function(_0x10d3ff){_0x70c391[_0xcdce('0x2f')]=_0x10d3ff;if(_0x34783d[_0xcdce('0x42')][_0xcdce('0x51')]){_0x498cb0[_0xcdce('0x52')]=[{'all':!![]}];}return db['ChatQueue'][_0xcdce('0x53')](_0x498cb0);})[_0xcdce('0x21')](function(_0x61d3ea){_0x70c391[_0xcdce('0x54')]=_0x61d3ea;return _0x70c391;})[_0xcdce('0x21')](respondWithFilteredResult(_0x132181,_0x498cb0))[_0xcdce('0x55')](handleError(_0x132181,null));};exports[_0xcdce('0x56')]=function(_0x5d1440,_0x1b64d8){var _0x2c197b={'raw':!![],'where':{'id':_0x5d1440[_0xcdce('0x57')]['id']}},_0x22183f={};_0x22183f['model']=_[_0xcdce('0x43')](db[_0xcdce('0x3d')][_0xcdce('0x58')]);_0x22183f[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x5d1440[_0xcdce('0x42')]);_0x22183f[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x22183f[_0xcdce('0x41')],_0x22183f[_0xcdce('0x42')]);_0x2c197b['attributes']=_[_0xcdce('0x45')](_0x22183f[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x5d1440[_0xcdce('0x42')][_0xcdce('0x47')]));_0x2c197b[_0xcdce('0x46')]=_0x2c197b[_0xcdce('0x46')][_0xcdce('0x59')]?_0x2c197b[_0xcdce('0x46')]:_0x22183f['model'];if(_0x5d1440[_0xcdce('0x42')]['includeAll']){_0x2c197b[_0xcdce('0x52')]=[{'all':!![]}];}_0x2c197b=_['merge']({},_0x2c197b,_0x5d1440['options']);return db['ChatQueue']['find'](_0x2c197b)['then'](handleEntityNotFound(_0x1b64d8,null))[_0xcdce('0x21')](respondWithResult(_0x1b64d8,null))[_0xcdce('0x55')](handleError(_0x1b64d8,null));};exports[_0xcdce('0x5a')]=function(_0x121655,_0x137d2f){return db['ChatQueue'][_0xcdce('0x5a')](_0x121655['body'],{})[_0xcdce('0x21')](function(_0x3bb6c7){var _0x24c18c=_0x121655['user'][_0xcdce('0x36')]({'plain':!![]});if(!_0x24c18c)throw new Error(_0xcdce('0x5b'));if(_0x24c18c[_0xcdce('0x5c')]===_0xcdce('0x5d')){var _0x45cfc9=_0x3bb6c7[_0xcdce('0x36')]({'plain':!![]});var _0x535cc7='ChatQueues';return db[_0xcdce('0x5e')][_0xcdce('0x5f')]({'where':{'name':_0x535cc7,'userProfileId':_0x24c18c['userProfileId']},'raw':!![]})[_0xcdce('0x21')](function(_0x1288ff){if(_0x1288ff&&_0x1288ff['autoAssociation']===0x0){return db[_0xcdce('0x38')][_0xcdce('0x5a')]({'name':_0x45cfc9[_0xcdce('0x3a')],'resourceId':_0x45cfc9['id'],'type':_0x1288ff[_0xcdce('0x3a')],'sectionId':_0x1288ff['id']},{})['then'](function(){return _0x3bb6c7;});}else{return _0x3bb6c7;}})[_0xcdce('0x55')](function(_0x1fc1cc){logger['error'](_0xcdce('0x60'),_0x1fc1cc);throw _0x1fc1cc;});}return _0x3bb6c7;})[_0xcdce('0x21')](respondWithResult(_0x137d2f,0xc9))[_0xcdce('0x55')](handleError(_0x137d2f,null));};exports['update']=function(_0x56cb09,_0x53bdd0){if(_0x56cb09[_0xcdce('0x61')]['id']){delete _0x56cb09[_0xcdce('0x61')]['id'];}return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x56cb09[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x53bdd0,null))[_0xcdce('0x21')](saveUpdates(_0x56cb09['body'],null))[_0xcdce('0x21')](respondWithResult(_0x53bdd0,null))[_0xcdce('0x55')](handleError(_0x53bdd0,null));};exports[_0xcdce('0x35')]=function(_0x150f7f,_0x362ed1){return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x150f7f[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x362ed1,null))[_0xcdce('0x21')](removeEntity(_0x362ed1,null))[_0xcdce('0x55')](handleError(_0x362ed1,null));};exports[_0xcdce('0x62')]=function(_0x515bbe,_0x37791c){return db['ChatQueue'][_0xcdce('0x62')]()['then'](respondWithResult(_0x37791c,null))[_0xcdce('0x55')](handleError(_0x37791c,null));};exports[_0xcdce('0x63')]=function(_0x2581b0,_0x54c99e,_0x175677){var _0x1b8f0d={'raw':!![],'where':{}},_0x247418={},_0x598d78;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x2581b0[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x54c99e,null))[_0xcdce('0x21')](function(_0x28ca70){if(_0x28ca70){_0x598d78=_0x28ca70[_0xcdce('0x36')]({'plain':!![]});_0x247418['model']=_[_0xcdce('0x43')](db[_0xcdce('0x65')][_0xcdce('0x58')]);_0x247418[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x2581b0[_0xcdce('0x42')]);_0x247418[_0xcdce('0x44')]=_[_0xcdce('0x45')](_0x247418[_0xcdce('0x41')],_0x247418[_0xcdce('0x42')]);_0x1b8f0d[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x247418['model'],qs['fields'](_0x2581b0[_0xcdce('0x42')]['fields']));_0x1b8f0d[_0xcdce('0x46')]=_0x1b8f0d['attributes']['length']?_0x1b8f0d['attributes']:_0x247418[_0xcdce('0x41')];if(!_0x2581b0['query'][_0xcdce('0x48')]('nolimit')){_0x1b8f0d[_0xcdce('0x49')]=qs[_0xcdce('0x49')](_0x2581b0[_0xcdce('0x42')][_0xcdce('0x49')]);_0x1b8f0d[_0xcdce('0x2d')]=qs[_0xcdce('0x2d')](_0x2581b0[_0xcdce('0x42')]['offset']);}_0x1b8f0d[_0xcdce('0x66')]=qs[_0xcdce('0x4a')](_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x1b8f0d[_0xcdce('0x4b')]=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x2581b0[_0xcdce('0x42')],_0x247418[_0xcdce('0x44')]));_0x1b8f0d['where'][_0xcdce('0x67')]=_0x28ca70['id'];if(_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x1b8f0d[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x1b8f0d['where'],{'$or':_[_0xcdce('0x3c')](_0x1b8f0d[_0xcdce('0x46')],function(_0x436999){var _0x4912c1={};_0x4912c1[_0x436999]={'$like':'%'+_0x2581b0[_0xcdce('0x42')][_0xcdce('0x4f')]+'%'};return _0x4912c1;})});}_0x1b8f0d=_[_0xcdce('0x4d')]({},_0x1b8f0d,_0x2581b0['options']);return db[_0xcdce('0x65')]['findAll'](_0x1b8f0d);}})[_0xcdce('0x21')](function(_0x2f2fee){if(_0x2f2fee){return db['User'][_0xcdce('0x68')]({'where':{'id':_[_0xcdce('0x3c')](_0x2f2fee,_0xcdce('0x69')),'role':_0xcdce('0x6a')},'attributes':['id',_0xcdce('0x3a'),'chatPause',_0xcdce('0x6b'),_0xcdce('0x6c')]});}})['then'](function(_0x41645b){if(_0x41645b){return{'count':_0x41645b[_0xcdce('0x2f')],'rows':_[_0xcdce('0x3c')](_0x41645b[_0xcdce('0x54')],function(_0x59c377){return{'membername':_0x59c377['name'],'UserId':_0x59c377['id'],'queue_name':_0x598d78['name'],'ChatQueueId':_0x598d78['id'],'interface':util[_0xcdce('0x6d')](_0xcdce('0x6e'),_0xcdce('0x6f'),_0x59c377[_0xcdce('0x3a')]),'penalty':0x0,'paused':_0x59c377[_0xcdce('0x70')],'createdAt':_0x59c377['createdAt'],'updatedAt':_0x59c377['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xcdce('0x21')](respondWithFilteredResult(_0x54c99e,_0x1b8f0d))[_0xcdce('0x55')](handleError(_0x54c99e,null));};exports['getTeams']=function(_0x69d77c,_0x54e3af,_0x18196b){var _0x5918ad={};var _0x36e207={};var _0x1e8289;var _0x55f2c1;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x69d77c[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x54e3af,null))[_0xcdce('0x21')](function(_0x34d502){if(_0x34d502){_0x1e8289=_0x34d502;_0x36e207[_0xcdce('0x41')]=_[_0xcdce('0x43')](db[_0xcdce('0x71')][_0xcdce('0x58')]);_0x36e207[_0xcdce('0x42')]=_['keys'](_0x69d77c[_0xcdce('0x42')]);_0x36e207[_0xcdce('0x44')]=_['intersection'](_0x36e207['model'],_0x36e207[_0xcdce('0x42')]);_0x5918ad[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x36e207[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x69d77c['query'][_0xcdce('0x47')]));_0x5918ad[_0xcdce('0x46')]=_0x5918ad[_0xcdce('0x46')][_0xcdce('0x59')]?_0x5918ad['attributes']:_0x36e207[_0xcdce('0x41')];_0x5918ad[_0xcdce('0x66')]=qs[_0xcdce('0x4a')](_0x69d77c['query'][_0xcdce('0x4a')]);_0x5918ad[_0xcdce('0x4b')]=qs['filters'](_['pick'](_0x69d77c[_0xcdce('0x42')],_0x36e207[_0xcdce('0x44')]));if(_0x69d77c[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x5918ad[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x5918ad[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x5918ad['attributes'],function(_0x32eda4){var _0x5eb531={};_0x5eb531[_0x32eda4]={'$like':'%'+_0x69d77c[_0xcdce('0x42')]['filter']+'%'};return _0x5eb531;})});}_0x5918ad=_[_0xcdce('0x4d')]({},_0x5918ad,_0x69d77c[_0xcdce('0x50')]);return _0x1e8289[_0xcdce('0x72')](_0x5918ad);}})['then'](function(_0x4403d2){if(_0x4403d2){_0x55f2c1=_0x4403d2['length'];if(!_0x69d77c['query'][_0xcdce('0x48')](_0xcdce('0x73'))){_0x5918ad[_0xcdce('0x49')]=qs[_0xcdce('0x49')](_0x69d77c['query'][_0xcdce('0x49')]);_0x5918ad['offset']=qs[_0xcdce('0x2d')](_0x69d77c['query'][_0xcdce('0x2d')]);}return _0x1e8289[_0xcdce('0x72')](_0x5918ad);}})[_0xcdce('0x21')](function(_0x55386f){if(_0x55386f){return _0x55386f?{'count':_0x55f2c1,'rows':_0x55386f}:null;}})[_0xcdce('0x21')](respondWithResult(_0x54e3af,null))[_0xcdce('0x55')](handleError(_0x54e3af,null));};exports[_0xcdce('0x74')]=function(_0x3e2d5e,_0x1f7558,_0x36ce38){var _0x4e20a2=_0x3e2d5e['body'][_0xcdce('0x75')];return db[_0xcdce('0x71')][_0xcdce('0x53')]({'where':{'id':_0x4e20a2},'attributes':['id'],'include':[{'model':db[_0xcdce('0x76')],'as':'Agents','attributes':['id',_0xcdce('0x3a'),'online',_0xcdce('0x77'),'interface'],'raw':!![]}]})[_0xcdce('0x21')](function(_0x441b14){if(_0x441b14){var _0x4c76b5=_['flatMap'](_0x441b14,function(_0x36c0d0){var _0x39ebc3=_0x36c0d0[_0xcdce('0x36')]({'plain':!![]});return _0x39ebc3[_0xcdce('0x78')];});return db['ChatQueue']['find']({'where':{'id':_0x3e2d5e[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](function(_0x5e17b9){return db['sequelize'][_0xcdce('0x79')](function(_0x269758){return _0x5e17b9[_0xcdce('0x74')](_0x4e20a2,{'transaction':_0x269758})['then'](function(){return BPromise[_0xcdce('0x7a')](_0x4c76b5,function(_0x3f2757){return db['UserChatQueue'][_0xcdce('0x7b')]({'where':{'UserId':_0x3f2757['id'],'ChatQueueId':_0x3e2d5e[_0xcdce('0x57')]['id']},'transaction':_0x269758});});})[_0xcdce('0x21')](function(){_0x4c76b5[_0xcdce('0x7c')](function(_0xbdb99){socket[_0xcdce('0x7d')]('userChatQueue:save',{'UserId':_0xbdb99['id'],'ChatQueueId':_0x5e17b9['id']});});});});});}})[_0xcdce('0x21')](respondWithStatusCode(_0x1f7558,null))[_0xcdce('0x55')](handleError(_0x1f7558,null));};exports[_0xcdce('0x7e')]=function(_0x511497,_0x4a65c5,_0xdd38b5){return db[_0xcdce('0x71')][_0xcdce('0x53')]({'where':{'id':_0x511497[_0xcdce('0x42')][_0xcdce('0x75')]},'attributes':['id'],'include':[{'model':db[_0xcdce('0x76')],'as':_0xcdce('0x78'),'attributes':['id'],'raw':!![]}]})[_0xcdce('0x21')](handleEntityNotFound(_0x4a65c5,null))['then'](function(_0x5624b4){var _0x3c718e=_[_0xcdce('0x3c')](_0x5624b4,'id');var _0x3866ea=[];var _0x394338=[];var _0x4cbda9=squel[_0xcdce('0x7f')]();_0x4cbda9[_0xcdce('0x80')](_0xcdce('0x81'))['from']('team_has_chat_queues','tq')[_0xcdce('0x82')](_0xcdce('0x83'),'ut',_0xcdce('0x84'))[_0xcdce('0x4b')]('ChatQueueId\x20=\x20?',_0x511497['params']['id']);for(var _0x2d32af=0x0;_0x2d32af<_0x5624b4[_0xcdce('0x59')];_0x2d32af+=0x1){let _0x52c447=_0x5624b4[_0x2d32af];for(var _0x32fa7f=0x0;_0x32fa7f<_0x52c447['Agents'][_0xcdce('0x59')];_0x32fa7f+=0x1){let _0x302781=_0x52c447[_0xcdce('0x78')][_0x32fa7f];var _0xcd1477=_0x4cbda9[_0xcdce('0x85')]();_0xcd1477[_0xcdce('0x4b')](_0xcdce('0x86'),_0x302781['id']);_0x394338['push'](db['sequelize'][_0xcdce('0x42')](_0xcd1477[_0xcdce('0x87')](),{'type':db['sequelize']['QueryTypes'][_0xcdce('0x88')]})[_0xcdce('0x21')](function(_0x2c90a8){if(_0x2c90a8[_0xcdce('0x59')]===0x1){return _0x302781['id'];}else{var _0x121d1d=_[_0xcdce('0x89')](_[_0xcdce('0x3c')](_0x2c90a8,'TeamId'),function(_0x27a941){return _[_0xcdce('0x8a')](_0x3c718e,_0x27a941);});if(_0x121d1d){return _0x302781['id'];}}}));}}return BPromise[_0xcdce('0x8b')](_0x394338)['then'](function(_0x487269){_0x3866ea=_(_0x3866ea)[_0xcdce('0x8c')](_0x487269)['compact']()['value']();return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x511497[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](function(_0x38daaf){return db[_0xcdce('0x8d')][_0xcdce('0x79')](function(_0x411733){return _0x38daaf[_0xcdce('0x7e')](_0x511497['query'][_0xcdce('0x75')],{'transaction':_0x411733})[_0xcdce('0x21')](function(){if(!_['isEmpty'](_0x3866ea)){return _0x38daaf[_0xcdce('0x8e')](_0x3866ea,{'transaction':_0x411733});}})[_0xcdce('0x21')](function(){_0x3866ea['forEach'](function(_0x248f8e){socket[_0xcdce('0x7d')](_0xcdce('0x8f'),{'UserId':_0x248f8e,'ChatQueueId':_0x38daaf['id']});});});});});});})[_0xcdce('0x21')](respondWithStatusCode(_0x4a65c5,null))['catch'](handleError(_0x4a65c5,null));};exports['addAgents']=function(_0x1d60e2,_0x5730d0,_0x59119d){return db[_0xcdce('0x3d')][_0xcdce('0x5f')]({'where':{'id':_0x1d60e2['params']['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x5730d0,null))[_0xcdce('0x21')](function(_0x2684c7){if(_0x2684c7){return _0x2684c7['addAgents'](_0x1d60e2['body'][_0xcdce('0x75')],_[_0xcdce('0x90')](_0x1d60e2[_0xcdce('0x61')],[_0xcdce('0x75'),'id'])||{})[_0xcdce('0x91')](function(_0x2e89e9){for(var _0x389e4f=0x0;_0x389e4f<_0x1d60e2[_0xcdce('0x61')]['ids']['length'];_0x389e4f+=0x1){socket[_0xcdce('0x7d')](_0xcdce('0x92'),{'UserId':Number(_0x1d60e2[_0xcdce('0x61')][_0xcdce('0x75')][_0x389e4f]),'ChatQueueId':Number(_0x1d60e2[_0xcdce('0x57')]['id'])});}return _0x2e89e9;});}})[_0xcdce('0x21')](respondWithResult(_0x5730d0,null))[_0xcdce('0x55')](handleError(_0x5730d0,null));};exports[_0xcdce('0x8e')]=function(_0x51180a,_0x460d4c,_0x11aa41){return db['ChatQueue'][_0xcdce('0x5f')]({'where':{'id':_0x51180a[_0xcdce('0x57')]['id']}})['then'](handleEntityNotFound(_0x460d4c,null))[_0xcdce('0x21')](function(_0x25d859){if(_0x25d859){return _0x25d859['removeAgents'](_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')])['then'](function(){if(_['isArray'](_0x51180a[_0xcdce('0x42')]['ids'])){for(var _0x31270c=0x0;_0x31270c<_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')][_0xcdce('0x59')];_0x31270c+=0x1){socket[_0xcdce('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')][_0x31270c]),'ChatQueueId':Number(_0x51180a[_0xcdce('0x57')]['id'])});}}else{socket[_0xcdce('0x7d')](_0xcdce('0x8f'),{'UserId':Number(_0x51180a[_0xcdce('0x42')][_0xcdce('0x75')]),'ChatQueueId':Number(_0x51180a['params']['id'])});}});}})[_0xcdce('0x21')](respondWithStatusCode(_0x460d4c,null))[_0xcdce('0x55')](handleError(_0x460d4c,null));};exports[_0xcdce('0x93')]=function(_0x28975d,_0x2cf0b0,_0x36b308){var _0x4d59e4={};var _0x4d98b9={};var _0x29973e;var _0x3cce05;return db[_0xcdce('0x3d')][_0xcdce('0x64')]({'where':{'id':_0x28975d[_0xcdce('0x57')]['id']}})[_0xcdce('0x21')](handleEntityNotFound(_0x2cf0b0,null))['then'](function(_0x491588){if(_0x491588){_0x29973e=_0x491588;_0x4d98b9[_0xcdce('0x41')]=_[_0xcdce('0x43')](db[_0xcdce('0x76')][_0xcdce('0x58')]);_0x4d98b9[_0xcdce('0x42')]=_[_0xcdce('0x43')](_0x28975d[_0xcdce('0x42')]);_0x4d98b9['filters']=_['intersection'](_0x4d98b9[_0xcdce('0x41')],_0x4d98b9['query']);_0x4d59e4[_0xcdce('0x46')]=_[_0xcdce('0x45')](_0x4d98b9[_0xcdce('0x41')],qs[_0xcdce('0x47')](_0x28975d[_0xcdce('0x42')][_0xcdce('0x47')]));_0x4d59e4['attributes']=_0x4d59e4['attributes'][_0xcdce('0x59')]?_0x4d59e4[_0xcdce('0x46')]:_0x4d98b9['model'];_0x4d59e4['order']=qs['sort'](_0x28975d[_0xcdce('0x42')][_0xcdce('0x4a')]);_0x4d59e4['where']=qs[_0xcdce('0x44')](_[_0xcdce('0x4c')](_0x28975d[_0xcdce('0x42')],_0x4d98b9[_0xcdce('0x44')]));if(_0x28975d[_0xcdce('0x42')][_0xcdce('0x4f')]){_0x4d59e4[_0xcdce('0x4b')]=_[_0xcdce('0x4d')](_0x4d59e4[_0xcdce('0x4b')],{'$or':_[_0xcdce('0x3c')](_0x4d59e4[_0xcdce('0x46')],function(_0x320df1){var _0x5ac920={};_0x5ac920[_0x320df1]={'$like':'%'+_0x28975d[_0xcdce('0x42')]['filter']+'%'};return _0x5ac920;})});}_0x4d59e4=_[_0xcdce('0x4d')]({},_0x4d59e4,_0x28975d[_0xcdce('0x50')]);return _0x29973e['getAgents'](_0x4d59e4);}})['then'](function(_0x559e90){if(_0x559e90){_0x3cce05=_0x559e90[_0xcdce('0x59')];if(!_0x28975d[_0xcdce('0x42')][_0xcdce('0x48')]('nolimit')){_0x4d59e4['limit']=qs['limit'](_0x28975d[_0xcdce('0x42')]['limit']);_0x4d59e4[_0xcdce('0x2d')]=qs[_0xcdce('0x2d')](_0x28975d[_0xcdce('0x42')][_0xcdce('0x2d')]);}return _0x29973e[_0xcdce('0x93')](_0x4d59e4);}})['then'](function(_0x93dc12){if(_0x93dc12){return _0x93dc12?{'count':_0x3cce05,'rows':_0x93dc12}:null;}})[_0xcdce('0x21')](respondWithResult(_0x2cf0b0,null))[_0xcdce('0x55')](handleError(_0x2cf0b0,null));};
\ No newline at end of file
+var _0xfc18=['value','transaction','isEmpty','removeAgents','forEach','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','stack','name','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','ChatQueue','includeAll','include','findAll','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','getMembers','findOne','ChatQueueId','UserId','agent','chatPause','createdAt','format','getTeams','addTeams','User','Agents','online','interface','sequelize','each','UserChatQueue','findOrCreate','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact'];(function(_0x193249,_0x2104b6){var _0x224eb3=function(_0x2bccd2){while(--_0x2bccd2){_0x193249['push'](_0x193249['shift']());}};_0x224eb3(++_0x2104b6);}(_0xfc18,0x1da));var _0x8fc1=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xfc18[_0x4eafed];return _0x159c85;};'use strict';var emlformat=require(_0x8fc1('0x0'));var rimraf=require(_0x8fc1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8fc1('0x2'));var BPromise=require(_0x8fc1('0x3'));var Mustache=require(_0x8fc1('0x4'));var util=require('util');var path=require(_0x8fc1('0x5'));var sox=require(_0x8fc1('0x6'));var csv=require('to-csv');var ejs=require(_0x8fc1('0x7'));var fs=require('fs');var fs_extra=require(_0x8fc1('0x8'));var _=require(_0x8fc1('0x9'));var squel=require(_0x8fc1('0xa'));var crypto=require(_0x8fc1('0xb'));var jsforce=require(_0x8fc1('0xc'));var deskjs=require(_0x8fc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8fc1('0xe'));var Papa=require(_0x8fc1('0xf'));var Redis=require(_0x8fc1('0x10'));var authService=require(_0x8fc1('0x11'));var qs=require(_0x8fc1('0x12'));var as=require(_0x8fc1('0x13'));var hardwareService=require(_0x8fc1('0x14'));var logger=require(_0x8fc1('0x15'))(_0x8fc1('0x16'));var utils=require(_0x8fc1('0x17'));var config=require(_0x8fc1('0x18'));var licenseUtil=require(_0x8fc1('0x19'));var db=require(_0x8fc1('0x1a'))['db'];config[_0x8fc1('0x1b')]=_[_0x8fc1('0x1c')](config[_0x8fc1('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fc1('0x1d'))(new Redis(config[_0x8fc1('0x1b')]));require(_0x8fc1('0x1e'))[_0x8fc1('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8fc1('0x20')][_0x8fc1('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x894d0b,_0x4daac1,_0x395cf1,_0x1efc11){return new BPromise(function(_0x5ddf2d,_0x282589){var _0x52527f=_0x1efc11||client;return _0x52527f[_0x8fc1('0x22')](_0x894d0b,_0x395cf1)[_0x8fc1('0x23')](function(_0x177331){logger[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x4daac1,'request\x20sent');logger[_0x8fc1('0x26')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x4daac1,_0x8fc1('0x27'),JSON[_0x8fc1('0x28')](_0x177331));if(_0x177331['error']){if(_0x177331['error'][_0x8fc1('0x29')]===0x1f4){logger[_0x8fc1('0x2a')](_0x8fc1('0x25'),_0x4daac1,_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);return _0x282589(_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);}logger[_0x8fc1('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x4daac1,_0x177331['error'][_0x8fc1('0x2b')]);return _0x5ddf2d(_0x177331[_0x8fc1('0x2a')][_0x8fc1('0x2b')]);}else{logger[_0x8fc1('0x24')](_0x8fc1('0x25'),_0x4daac1,_0x8fc1('0x27'));_0x5ddf2d(_0x177331[_0x8fc1('0x2c')][_0x8fc1('0x2b')]);}})[_0x8fc1('0x2d')](function(_0x1dd479){logger[_0x8fc1('0x2a')](_0x8fc1('0x25'),_0x4daac1,_0x1dd479);_0x282589(_0x1dd479);});});}function respondWithStatusCode(_0x4d6caa,_0x194e44){_0x194e44=_0x194e44||0xcc;return function(_0x44a1ae){if(_0x44a1ae){return _0x4d6caa[_0x8fc1('0x2e')](_0x194e44);}return _0x4d6caa[_0x8fc1('0x2f')](_0x194e44)[_0x8fc1('0x30')]();};}function respondWithResult(_0x56af10,_0x5d2dd1){_0x5d2dd1=_0x5d2dd1||0xc8;return function(_0x4ab9cb){if(_0x4ab9cb){return _0x56af10['status'](_0x5d2dd1)[_0x8fc1('0x31')](_0x4ab9cb);}};}function respondWithFilteredResult(_0x2f34f9,_0x557a22){return function(_0x516b77){if(_0x516b77){var _0x224f9b=typeof _0x557a22[_0x8fc1('0x32')]===_0x8fc1('0x33')&&typeof _0x557a22[_0x8fc1('0x34')]==='undefined';var _0x4d7420=_0x516b77[_0x8fc1('0x35')];var _0x2cf6db=_0x224f9b?0x0:_0x557a22[_0x8fc1('0x32')];var _0x2c95fe=_0x224f9b?_0x516b77[_0x8fc1('0x35')]:_0x557a22[_0x8fc1('0x32')]+_0x557a22[_0x8fc1('0x34')];var _0x1d59eb;if(_0x2c95fe>=_0x4d7420){_0x2c95fe=_0x4d7420;_0x1d59eb=0xc8;}else{_0x1d59eb=0xce;}_0x2f34f9['status'](_0x1d59eb);return _0x2f34f9[_0x8fc1('0x36')](_0x8fc1('0x37'),_0x2cf6db+'-'+_0x2c95fe+'/'+_0x4d7420)[_0x8fc1('0x31')](_0x516b77);}return null;};}function patchUpdates(_0x380892){return function(_0x529592){try{jsonpatch[_0x8fc1('0x38')](_0x529592,_0x380892,!![]);}catch(_0x16d50f){return BPromise[_0x8fc1('0x39')](_0x16d50f);}return _0x529592[_0x8fc1('0x3a')]();};}function saveUpdates(_0x5cf19b,_0x19dbe9){return function(_0x47ab20){if(_0x47ab20){return _0x47ab20['update'](_0x5cf19b)[_0x8fc1('0x23')](function(_0x17689c){return _0x17689c;});}return null;};}function removeEntity(_0x505c92,_0x5a0982){return function(_0x31216f){if(_0x31216f){return _0x31216f['destroy']()[_0x8fc1('0x23')](function(){var _0x5d794b=_0x31216f[_0x8fc1('0x3b')]({'plain':!![]});var _0x4b8487='ChatQueues';return db[_0x8fc1('0x3c')][_0x8fc1('0x3d')]({'where':{'type':_0x4b8487,'resourceId':_0x5d794b['id']}})[_0x8fc1('0x23')](function(){return _0x31216f;});})['then'](function(){_0x505c92[_0x8fc1('0x2f')](0xcc)[_0x8fc1('0x30')]();});}};}function handleEntityNotFound(_0x1d8e78,_0x4845e6){return function(_0xe8e791){if(!_0xe8e791){_0x1d8e78[_0x8fc1('0x2e')](0x194);}return _0xe8e791;};}function handleError(_0x353104,_0x3e4631){_0x3e4631=_0x3e4631||0x1f4;return function(_0x320f01){logger[_0x8fc1('0x2a')](_0x320f01[_0x8fc1('0x3e')]);if(_0x320f01[_0x8fc1('0x3f')]){delete _0x320f01[_0x8fc1('0x3f')];}_0x353104['status'](_0x3e4631)['send'](_0x320f01);};}exports['index']=function(_0x3d9898,_0x11771b){var _0x39fd1b={},_0xdc39e3={},_0x1f477f={'count':0x0,'rows':[]};var _0x54eeb3=_['map'](db['ChatQueue'][_0x8fc1('0x40')],function(_0xc79d98){return{'name':_0xc79d98[_0x8fc1('0x41')],'type':_0xc79d98[_0x8fc1('0x42')][_0x8fc1('0x43')]};});_0xdc39e3['model']=_[_0x8fc1('0x44')](_0x54eeb3,_0x8fc1('0x3f'));_0xdc39e3[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x3d9898[_0x8fc1('0x45')]);_0xdc39e3['filters']=_[_0x8fc1('0x47')](_0xdc39e3[_0x8fc1('0x48')],_0xdc39e3[_0x8fc1('0x45')]);_0x39fd1b[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0xdc39e3['model'],qs[_0x8fc1('0x4a')](_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x39fd1b[_0x8fc1('0x49')]=_0x39fd1b[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x39fd1b[_0x8fc1('0x49')]:_0xdc39e3['model'];if(!_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x39fd1b[_0x8fc1('0x34')]=qs[_0x8fc1('0x34')](_0x3d9898['query'][_0x8fc1('0x34')]);_0x39fd1b['offset']=qs['offset'](_0x3d9898['query']['offset']);}_0x39fd1b[_0x8fc1('0x4e')]=qs[_0x8fc1('0x4f')](_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x4f')]);_0x39fd1b[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x3d9898['query'],_0xdc39e3[_0x8fc1('0x51')]),_0x54eeb3);if(_0x3d9898['query'][_0x8fc1('0x53')]){_0x39fd1b['where']=_['merge'](_0x39fd1b[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x54eeb3,function(_0x542634){if(_0x542634['type']!==_0x8fc1('0x54')){var _0x52efde={};_0x52efde[_0x542634[_0x8fc1('0x3f')]]={'$like':'%'+_0x3d9898['query'][_0x8fc1('0x53')]+'%'};return _0x52efde;}})});}_0x39fd1b=_[_0x8fc1('0x55')]({},_0x39fd1b,_0x3d9898[_0x8fc1('0x56')]);var _0x29ad45={'where':_0x39fd1b[_0x8fc1('0x50')]};return db[_0x8fc1('0x57')][_0x8fc1('0x35')](_0x29ad45)[_0x8fc1('0x23')](function(_0x5a1e2b){_0x1f477f[_0x8fc1('0x35')]=_0x5a1e2b;if(_0x3d9898[_0x8fc1('0x45')][_0x8fc1('0x58')]){_0x39fd1b[_0x8fc1('0x59')]=[{'all':!![]}];}return db[_0x8fc1('0x57')][_0x8fc1('0x5a')](_0x39fd1b);})['then'](function(_0x1b3f8a){_0x1f477f['rows']=_0x1b3f8a;return _0x1f477f;})[_0x8fc1('0x23')](respondWithFilteredResult(_0x11771b,_0x39fd1b))['catch'](handleError(_0x11771b,null));};exports[_0x8fc1('0x5b')]=function(_0x411551,_0x519962){var _0x34fd11={'raw':!![],'where':{'id':_0x411551['params']['id']}},_0xc0540c={};_0xc0540c[_0x8fc1('0x48')]=_[_0x8fc1('0x46')](db[_0x8fc1('0x57')]['rawAttributes']);_0xc0540c[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x411551['query']);_0xc0540c[_0x8fc1('0x51')]=_['intersection'](_0xc0540c[_0x8fc1('0x48')],_0xc0540c[_0x8fc1('0x45')]);_0x34fd11[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0xc0540c[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x411551[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x34fd11[_0x8fc1('0x49')]=_0x34fd11[_0x8fc1('0x49')]['length']?_0x34fd11[_0x8fc1('0x49')]:_0xc0540c[_0x8fc1('0x48')];if(_0x411551[_0x8fc1('0x45')]['includeAll']){_0x34fd11[_0x8fc1('0x59')]=[{'all':!![]}];}_0x34fd11=_[_0x8fc1('0x55')]({},_0x34fd11,_0x411551['options']);return db[_0x8fc1('0x57')]['find'](_0x34fd11)[_0x8fc1('0x23')](handleEntityNotFound(_0x519962,null))[_0x8fc1('0x23')](respondWithResult(_0x519962,null))[_0x8fc1('0x2d')](handleError(_0x519962,null));};exports['create']=function(_0x15dd10,_0x2ab9df){return db[_0x8fc1('0x57')][_0x8fc1('0x5c')](_0x15dd10['body'],{})[_0x8fc1('0x23')](function(_0x41bcee){var _0x2c4351=_0x15dd10[_0x8fc1('0x5d')]['get']({'plain':!![]});if(!_0x2c4351)throw new Error(_0x8fc1('0x5e'));if(_0x2c4351[_0x8fc1('0x5f')]===_0x8fc1('0x5d')){var _0x7e6e94=_0x41bcee['get']({'plain':!![]});var _0x4833ab=_0x8fc1('0x60');return db['UserProfileSection'][_0x8fc1('0x61')]({'where':{'name':_0x4833ab,'userProfileId':_0x2c4351[_0x8fc1('0x62')]},'raw':!![]})[_0x8fc1('0x23')](function(_0x1aa39e){if(_0x1aa39e&&_0x1aa39e[_0x8fc1('0x63')]===0x0){return db['UserProfileResource'][_0x8fc1('0x5c')]({'name':_0x7e6e94[_0x8fc1('0x3f')],'resourceId':_0x7e6e94['id'],'type':_0x1aa39e[_0x8fc1('0x3f')],'sectionId':_0x1aa39e['id']},{})[_0x8fc1('0x23')](function(){return _0x41bcee;});}else{return _0x41bcee;}})[_0x8fc1('0x2d')](function(_0x10c7f7){logger[_0x8fc1('0x2a')](_0x8fc1('0x64'),_0x10c7f7);throw _0x10c7f7;});}return _0x41bcee;})[_0x8fc1('0x23')](respondWithResult(_0x2ab9df,0xc9))[_0x8fc1('0x2d')](handleError(_0x2ab9df,null));};exports[_0x8fc1('0x65')]=function(_0x4a2309,_0x3a4094){if(_0x4a2309[_0x8fc1('0x66')]['id']){delete _0x4a2309['body']['id'];}return db[_0x8fc1('0x57')]['find']({'where':{'id':_0x4a2309[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x3a4094,null))[_0x8fc1('0x23')](saveUpdates(_0x4a2309['body'],null))[_0x8fc1('0x23')](respondWithResult(_0x3a4094,null))[_0x8fc1('0x2d')](handleError(_0x3a4094,null));};exports[_0x8fc1('0x3d')]=function(_0x48eb9a,_0x310ca2){return db['ChatQueue']['find']({'where':{'id':_0x48eb9a[_0x8fc1('0x67')]['id']}})['then'](handleEntityNotFound(_0x310ca2,null))[_0x8fc1('0x23')](removeEntity(_0x310ca2,null))[_0x8fc1('0x2d')](handleError(_0x310ca2,null));};exports[_0x8fc1('0x68')]=function(_0x372b44,_0xb84d9d){return db['ChatQueue'][_0x8fc1('0x68')]()[_0x8fc1('0x23')](respondWithResult(_0xb84d9d,null))[_0x8fc1('0x2d')](handleError(_0xb84d9d,null));};exports[_0x8fc1('0x69')]=function(_0x1c9f80,_0x42cbe5,_0x208948){var _0x589de0={'raw':!![],'where':{}},_0x21ac3f={},_0xe0ffff;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x1c9f80[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x42cbe5,null))[_0x8fc1('0x23')](function(_0x28e9a7){if(_0x28e9a7){_0xe0ffff=_0x28e9a7[_0x8fc1('0x3b')]({'plain':!![]});_0x21ac3f['model']=_[_0x8fc1('0x46')](db['UserChatQueue'][_0x8fc1('0x40')]);_0x21ac3f[_0x8fc1('0x45')]=_[_0x8fc1('0x46')](_0x1c9f80['query']);_0x21ac3f[_0x8fc1('0x51')]=_[_0x8fc1('0x47')](_0x21ac3f['model'],_0x21ac3f['query']);_0x589de0[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x21ac3f[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x589de0[_0x8fc1('0x49')]=_0x589de0[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x589de0[_0x8fc1('0x49')]:_0x21ac3f[_0x8fc1('0x48')];if(!_0x1c9f80[_0x8fc1('0x45')]['hasOwnProperty']('nolimit')){_0x589de0[_0x8fc1('0x34')]=qs[_0x8fc1('0x34')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x34')]);_0x589de0[_0x8fc1('0x32')]=qs[_0x8fc1('0x32')](_0x1c9f80[_0x8fc1('0x45')][_0x8fc1('0x32')]);}_0x589de0[_0x8fc1('0x4e')]=qs[_0x8fc1('0x4f')](_0x1c9f80[_0x8fc1('0x45')]['sort']);_0x589de0[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x1c9f80['query'],_0x21ac3f[_0x8fc1('0x51')]));_0x589de0['where'][_0x8fc1('0x6b')]=_0x28e9a7['id'];if(_0x1c9f80[_0x8fc1('0x45')]['filter']){_0x589de0[_0x8fc1('0x50')]=_[_0x8fc1('0x55')](_0x589de0[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x589de0[_0x8fc1('0x49')],function(_0x1dfcd0){var _0x4dd067={};_0x4dd067[_0x1dfcd0]={'$like':'%'+_0x1c9f80[_0x8fc1('0x45')]['filter']+'%'};return _0x4dd067;})});}_0x589de0=_[_0x8fc1('0x55')]({},_0x589de0,_0x1c9f80[_0x8fc1('0x56')]);return db['UserChatQueue'][_0x8fc1('0x5a')](_0x589de0);}})[_0x8fc1('0x23')](function(_0x3f7eb4){if(_0x3f7eb4){return db['User']['findAndCountAll']({'where':{'id':_[_0x8fc1('0x44')](_0x3f7eb4,_0x8fc1('0x6c')),'role':_0x8fc1('0x6d')},'attributes':['id','name',_0x8fc1('0x6e'),'updatedAt',_0x8fc1('0x6f')]});}})[_0x8fc1('0x23')](function(_0x5575dc){if(_0x5575dc){return{'count':_0x5575dc['count'],'rows':_[_0x8fc1('0x44')](_0x5575dc['rows'],function(_0x127210){return{'membername':_0x127210[_0x8fc1('0x3f')],'UserId':_0x127210['id'],'queue_name':_0xe0ffff['name'],'ChatQueueId':_0xe0ffff['id'],'interface':util[_0x8fc1('0x70')]('%s/%s','SIP',_0x127210[_0x8fc1('0x3f')]),'penalty':0x0,'paused':_0x127210['chatPause'],'createdAt':_0x127210[_0x8fc1('0x6f')],'updatedAt':_0x127210['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8fc1('0x23')](respondWithFilteredResult(_0x42cbe5,_0x589de0))[_0x8fc1('0x2d')](handleError(_0x42cbe5,null));};exports[_0x8fc1('0x71')]=function(_0x553c66,_0x200b65,_0x372f94){var _0x5bf3d0={};var _0x1b013f={};var _0x4ba9f4;var _0x3a79e4;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x553c66[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x200b65,null))['then'](function(_0x470fa4){if(_0x470fa4){_0x4ba9f4=_0x470fa4;_0x1b013f[_0x8fc1('0x48')]=_['keys'](db['Team']['rawAttributes']);_0x1b013f['query']=_[_0x8fc1('0x46')](_0x553c66['query']);_0x1b013f['filters']=_[_0x8fc1('0x47')](_0x1b013f[_0x8fc1('0x48')],_0x1b013f[_0x8fc1('0x45')]);_0x5bf3d0[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x1b013f[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x5bf3d0[_0x8fc1('0x49')]=_0x5bf3d0[_0x8fc1('0x49')][_0x8fc1('0x4b')]?_0x5bf3d0[_0x8fc1('0x49')]:_0x1b013f['model'];_0x5bf3d0['order']=qs[_0x8fc1('0x4f')](_0x553c66[_0x8fc1('0x45')]['sort']);_0x5bf3d0[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_['pick'](_0x553c66[_0x8fc1('0x45')],_0x1b013f[_0x8fc1('0x51')]));if(_0x553c66['query']['filter']){_0x5bf3d0['where']=_[_0x8fc1('0x55')](_0x5bf3d0[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x5bf3d0['attributes'],function(_0x1cd499){var _0xcd80ef={};_0xcd80ef[_0x1cd499]={'$like':'%'+_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x53')]+'%'};return _0xcd80ef;})});}_0x5bf3d0=_[_0x8fc1('0x55')]({},_0x5bf3d0,_0x553c66[_0x8fc1('0x56')]);return _0x4ba9f4[_0x8fc1('0x71')](_0x5bf3d0);}})[_0x8fc1('0x23')](function(_0x2deda9){if(_0x2deda9){_0x3a79e4=_0x2deda9[_0x8fc1('0x4b')];if(!_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x5bf3d0['limit']=qs[_0x8fc1('0x34')](_0x553c66['query'][_0x8fc1('0x34')]);_0x5bf3d0[_0x8fc1('0x32')]=qs['offset'](_0x553c66[_0x8fc1('0x45')][_0x8fc1('0x32')]);}return _0x4ba9f4[_0x8fc1('0x71')](_0x5bf3d0);}})[_0x8fc1('0x23')](function(_0x2ea34e){if(_0x2ea34e){return _0x2ea34e?{'count':_0x3a79e4,'rows':_0x2ea34e}:null;}})['then'](respondWithResult(_0x200b65,null))[_0x8fc1('0x2d')](handleError(_0x200b65,null));};exports[_0x8fc1('0x72')]=function(_0x58c089,_0x520a3d,_0x2c4644){var _0x1ef84c=_0x58c089['body']['ids'];return db['Team'][_0x8fc1('0x5a')]({'where':{'id':_0x1ef84c},'attributes':['id'],'include':[{'model':db[_0x8fc1('0x73')],'as':_0x8fc1('0x74'),'attributes':['id',_0x8fc1('0x3f'),_0x8fc1('0x75'),'voicePause',_0x8fc1('0x76')],'raw':!![]}]})['then'](function(_0x3b2c10){if(_0x3b2c10){var _0x16fc71=_['flatMap'](_0x3b2c10,function(_0x3e56f2){var _0x278202=_0x3e56f2['get']({'plain':!![]});return _0x278202[_0x8fc1('0x74')];});return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x58c089[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](function(_0x283407){return db[_0x8fc1('0x77')]['transaction'](function(_0x4179eb){return _0x283407['addTeams'](_0x1ef84c,{'transaction':_0x4179eb})[_0x8fc1('0x23')](function(){return BPromise[_0x8fc1('0x78')](_0x16fc71,function(_0x17f0f8){return db[_0x8fc1('0x79')][_0x8fc1('0x7a')]({'where':{'UserId':_0x17f0f8['id'],'ChatQueueId':_0x58c089['params']['id']},'transaction':_0x4179eb});});})[_0x8fc1('0x23')](function(){_0x16fc71['forEach'](function(_0x27e085){socket['emit']('userChatQueue:save',{'UserId':_0x27e085['id'],'ChatQueueId':_0x283407['id']});});});});});}})['then'](respondWithStatusCode(_0x520a3d,null))[_0x8fc1('0x2d')](handleError(_0x520a3d,null));};exports[_0x8fc1('0x7b')]=function(_0x17f0d6,_0x2394c4,_0x5da567){return db['Team'][_0x8fc1('0x5a')]({'where':{'id':_0x17f0d6['query'][_0x8fc1('0x7c')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8fc1('0x23')](handleEntityNotFound(_0x2394c4,null))[_0x8fc1('0x23')](function(_0x58e754){var _0xdda60e=_[_0x8fc1('0x44')](_0x58e754,'id');var _0x50bc47=[];var _0x249b7a=[];var _0xa8b307=squel[_0x8fc1('0x7d')]();_0xa8b307['field'](_0x8fc1('0x7e'))[_0x8fc1('0x7f')]('team_has_chat_queues','tq')[_0x8fc1('0x80')](_0x8fc1('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x8fc1('0x82'),_0x17f0d6[_0x8fc1('0x67')]['id']);for(var _0x161740=0x0;_0x161740<_0x58e754[_0x8fc1('0x4b')];_0x161740+=0x1){let _0x450019=_0x58e754[_0x161740];for(var _0x362a10=0x0;_0x362a10<_0x450019['Agents'][_0x8fc1('0x4b')];_0x362a10+=0x1){let _0x46aa9b=_0x450019[_0x8fc1('0x74')][_0x362a10];var _0x3b4c3e=_0xa8b307[_0x8fc1('0x83')]();_0x3b4c3e[_0x8fc1('0x50')](_0x8fc1('0x84'),_0x46aa9b['id']);_0x249b7a[_0x8fc1('0x85')](db[_0x8fc1('0x77')][_0x8fc1('0x45')](_0x3b4c3e[_0x8fc1('0x86')](),{'type':db[_0x8fc1('0x77')]['QueryTypes'][_0x8fc1('0x87')]})[_0x8fc1('0x23')](function(_0x2010f6){if(_0x2010f6[_0x8fc1('0x4b')]===0x1){return _0x46aa9b['id'];}else{var _0x2e6b8c=_[_0x8fc1('0x88')](_['map'](_0x2010f6,_0x8fc1('0x89')),function(_0x50b273){return _[_0x8fc1('0x8a')](_0xdda60e,_0x50b273);});if(_0x2e6b8c){return _0x46aa9b['id'];}}}));}}return BPromise[_0x8fc1('0x8b')](_0x249b7a)['then'](function(_0x3a0775){_0x50bc47=_(_0x50bc47)[_0x8fc1('0x8c')](_0x3a0775)[_0x8fc1('0x8d')]()[_0x8fc1('0x8e')]();return db['ChatQueue'][_0x8fc1('0x61')]({'where':{'id':_0x17f0d6[_0x8fc1('0x67')]['id']}})['then'](function(_0x41b2a6){return db['sequelize'][_0x8fc1('0x8f')](function(_0x539e3d){return _0x41b2a6[_0x8fc1('0x7b')](_0x17f0d6[_0x8fc1('0x45')][_0x8fc1('0x7c')],{'transaction':_0x539e3d})[_0x8fc1('0x23')](function(){if(!_[_0x8fc1('0x90')](_0x50bc47)){return _0x41b2a6[_0x8fc1('0x91')](_0x50bc47,{'transaction':_0x539e3d});}})[_0x8fc1('0x23')](function(){_0x50bc47[_0x8fc1('0x92')](function(_0x20c4df){socket[_0x8fc1('0x93')](_0x8fc1('0x94'),{'UserId':_0x20c4df,'ChatQueueId':_0x41b2a6['id']});});});});});});})['then'](respondWithStatusCode(_0x2394c4,null))[_0x8fc1('0x2d')](handleError(_0x2394c4,null));};exports['addAgents']=function(_0x3de89,_0x43e89a,_0x1ff9ad){return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x3de89[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x43e89a,null))[_0x8fc1('0x23')](function(_0x250c50){if(_0x250c50){return _0x250c50[_0x8fc1('0x95')](_0x3de89[_0x8fc1('0x66')][_0x8fc1('0x7c')],_[_0x8fc1('0x96')](_0x3de89[_0x8fc1('0x66')],[_0x8fc1('0x7c'),'id'])||{})[_0x8fc1('0x97')](function(_0x4b0d1d){for(var _0x2a193b=0x0;_0x2a193b<_0x3de89['body']['ids'][_0x8fc1('0x4b')];_0x2a193b+=0x1){socket[_0x8fc1('0x93')](_0x8fc1('0x98'),{'UserId':Number(_0x3de89[_0x8fc1('0x66')][_0x8fc1('0x7c')][_0x2a193b]),'ChatQueueId':Number(_0x3de89['params']['id'])});}return _0x4b0d1d;});}})[_0x8fc1('0x23')](respondWithResult(_0x43e89a,null))[_0x8fc1('0x2d')](handleError(_0x43e89a,null));};exports['removeAgents']=function(_0x28b78d,_0x1be480,_0x42c96e){return db[_0x8fc1('0x57')][_0x8fc1('0x61')]({'where':{'id':_0x28b78d[_0x8fc1('0x67')]['id']}})['then'](handleEntityNotFound(_0x1be480,null))[_0x8fc1('0x23')](function(_0x1e92de){if(_0x1e92de){return _0x1e92de[_0x8fc1('0x91')](_0x28b78d[_0x8fc1('0x45')][_0x8fc1('0x7c')])[_0x8fc1('0x23')](function(){if(_['isArray'](_0x28b78d[_0x8fc1('0x45')]['ids'])){for(var _0x1e859e=0x0;_0x1e859e<_0x28b78d[_0x8fc1('0x45')][_0x8fc1('0x7c')][_0x8fc1('0x4b')];_0x1e859e+=0x1){socket[_0x8fc1('0x93')]('userChatQueue:remove',{'UserId':Number(_0x28b78d['query']['ids'][_0x1e859e]),'ChatQueueId':Number(_0x28b78d[_0x8fc1('0x67')]['id'])});}}else{socket[_0x8fc1('0x93')]('userChatQueue:remove',{'UserId':Number(_0x28b78d[_0x8fc1('0x45')]['ids']),'ChatQueueId':Number(_0x28b78d[_0x8fc1('0x67')]['id'])});}});}})[_0x8fc1('0x23')](respondWithStatusCode(_0x1be480,null))[_0x8fc1('0x2d')](handleError(_0x1be480,null));};exports[_0x8fc1('0x99')]=function(_0x255809,_0x486794,_0x43a06f){var _0x197621={};var _0x4ad299={};var _0x35dc03;var _0x5e2c42;return db[_0x8fc1('0x57')][_0x8fc1('0x6a')]({'where':{'id':_0x255809[_0x8fc1('0x67')]['id']}})[_0x8fc1('0x23')](handleEntityNotFound(_0x486794,null))['then'](function(_0x3f2e7b){if(_0x3f2e7b){_0x35dc03=_0x3f2e7b;_0x4ad299[_0x8fc1('0x48')]=_['keys'](db[_0x8fc1('0x73')][_0x8fc1('0x40')]);_0x4ad299['query']=_['keys'](_0x255809[_0x8fc1('0x45')]);_0x4ad299[_0x8fc1('0x51')]=_[_0x8fc1('0x47')](_0x4ad299[_0x8fc1('0x48')],_0x4ad299[_0x8fc1('0x45')]);_0x197621[_0x8fc1('0x49')]=_[_0x8fc1('0x47')](_0x4ad299[_0x8fc1('0x48')],qs[_0x8fc1('0x4a')](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x4a')]));_0x197621['attributes']=_0x197621['attributes']['length']?_0x197621[_0x8fc1('0x49')]:_0x4ad299[_0x8fc1('0x48')];_0x197621[_0x8fc1('0x4e')]=qs['sort'](_0x255809['query'][_0x8fc1('0x4f')]);_0x197621[_0x8fc1('0x50')]=qs[_0x8fc1('0x51')](_[_0x8fc1('0x52')](_0x255809[_0x8fc1('0x45')],_0x4ad299[_0x8fc1('0x51')]));if(_0x255809[_0x8fc1('0x45')][_0x8fc1('0x53')]){_0x197621[_0x8fc1('0x50')]=_[_0x8fc1('0x55')](_0x197621[_0x8fc1('0x50')],{'$or':_[_0x8fc1('0x44')](_0x197621['attributes'],function(_0x168b25){var _0x304098={};_0x304098[_0x168b25]={'$like':'%'+_0x255809['query'][_0x8fc1('0x53')]+'%'};return _0x304098;})});}_0x197621=_[_0x8fc1('0x55')]({},_0x197621,_0x255809[_0x8fc1('0x56')]);return _0x35dc03[_0x8fc1('0x99')](_0x197621);}})['then'](function(_0x2b5e27){if(_0x2b5e27){_0x5e2c42=_0x2b5e27[_0x8fc1('0x4b')];if(!_0x255809[_0x8fc1('0x45')][_0x8fc1('0x4c')](_0x8fc1('0x4d'))){_0x197621[_0x8fc1('0x34')]=qs['limit'](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x34')]);_0x197621[_0x8fc1('0x32')]=qs[_0x8fc1('0x32')](_0x255809[_0x8fc1('0x45')][_0x8fc1('0x32')]);}return _0x35dc03[_0x8fc1('0x99')](_0x197621);}})[_0x8fc1('0x23')](function(_0x44c924){if(_0x44c924){return _0x44c924?{'count':_0x5e2c42,'rows':_0x44c924}:null;}})['then'](respondWithResult(_0x486794,null))[_0x8fc1('0x2d')](handleError(_0x486794,null));};
\ No newline at end of file
index a987057..4011e2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a7a=['events','../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x686d95,_0x5e9d91){var _0x1ee747=function(_0x1d1135){while(--_0x1d1135){_0x686d95['push'](_0x686d95['shift']());}};_0x1ee747(++_0x5e9d91);}(_0x6a7a,0x122));var _0xa6a7=function(_0x1fe402,_0xa1d716){_0x1fe402=_0x1fe402-0x0;var _0x11a809=_0x6a7a[_0x1fe402];return _0x11a809;};'use strict';var EventEmitter=require(_0xa6a7('0x0'));var ChatQueue=require(_0xa6a7('0x1'))['db'][_0xa6a7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xa6a7('0x3')](0x0);var events={'afterCreate':_0xa6a7('0x4'),'afterUpdate':_0xa6a7('0x5'),'afterDestroy':_0xa6a7('0x6')};function emitEvent(_0x37b38b){return function(_0x20570e,_0x30bf83,_0x2c447e){ChatQueueEvents['emit'](_0x37b38b+':'+_0x20570e['id'],_0x20570e);ChatQueueEvents[_0xa6a7('0x7')](_0x37b38b,_0x20570e);_0x2c447e(null);};}for(var e in events){if(events[_0xa6a7('0x8')](e)){var event=events[e];ChatQueue[_0xa6a7('0x9')](e,emitEvent(event));}}module['exports']=ChatQueueEvents;
\ No newline at end of file
+var _0xe5e7=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x1d0764,_0x2beb7c){var _0x423f49=function(_0x5334ee){while(--_0x5334ee){_0x1d0764['push'](_0x1d0764['shift']());}};_0x423f49(++_0x2beb7c);}(_0xe5e7,0x1ee));var _0x7e5e=function(_0xb72675,_0xae6a45){_0xb72675=_0xb72675-0x0;var _0x1a1d2e=_0xe5e7[_0xb72675];return _0x1a1d2e;};'use strict';var EventEmitter=require(_0x7e5e('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7e5e('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7e5e('0x2'),'afterDestroy':_0x7e5e('0x3')};function emitEvent(_0x14d122){return function(_0x336f3f,_0x1de085,_0xb36e08){ChatQueueEvents['emit'](_0x14d122+':'+_0x336f3f['id'],_0x336f3f);ChatQueueEvents[_0x7e5e('0x4')](_0x14d122,_0x336f3f);_0xb36e08(null);};}for(var e in events){if(events[_0x7e5e('0x5')](e)){var event=events[e];ChatQueue[_0x7e5e('0x6')](e,emitEvent(event));}}module[_0x7e5e('0x7')]=ChatQueueEvents;
\ No newline at end of file
index d20a87b..ee1c6bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc821=['define','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x5e88aa,_0x170b60){var _0x55ab65=function(_0xe2531d){while(--_0xe2531d){_0x5e88aa['push'](_0x5e88aa['shift']());}};_0x55ab65(++_0x170b60);}(_0xc821,0x9c));var _0x1c82=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc821[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1c82('0x0'));var logger=require(_0x1c82('0x1'))(_0x1c82('0x2'));var moment=require(_0x1c82('0x3'));var BPromise=require(_0x1c82('0x4'));var rp=require(_0x1c82('0x5'));var fs=require('fs');var path=require(_0x1c82('0x6'));var rimraf=require('rimraf');var config=require(_0x1c82('0x7'));var attributes=require('./chatQueue.attributes');module[_0x1c82('0x8')]=function(_0x52e4cf,_0x32dc7d){return _0x52e4cf[_0x1c82('0x9')]('ChatQueue',attributes,{'tableName':_0x1c82('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33c6=['ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x33c6,0xd2));var _0x633c=function(_0x4da9d8,_0x42fb50){_0x4da9d8=_0x4da9d8-0x0;var _0x468872=_0x33c6[_0x4da9d8];return _0x468872;};'use strict';var _=require('lodash');var util=require(_0x633c('0x0'));var logger=require(_0x633c('0x1'))(_0x633c('0x2'));var moment=require(_0x633c('0x3'));var BPromise=require(_0x633c('0x4'));var rp=require(_0x633c('0x5'));var fs=require('fs');var path=require(_0x633c('0x6'));var rimraf=require('rimraf');var config=require(_0x633c('0x7'));var attributes=require(_0x633c('0x8'));module[_0x633c('0x9')]=function(_0x41e5f4,_0x4872e0){return _0x41e5f4[_0x633c('0xa')](_0x633c('0xb'),attributes,{'tableName':_0x633c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 76d83a4..edffbd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa169=['error','code','ChatQueue,\x20%s,\x20%s','message','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','model','attributes','include','then','catch','ShowChatQueue','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','register','request','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x398544,_0x161cb3){var _0x46c9c4=function(_0x300fb1){while(--_0x300fb1){_0x398544['push'](_0x398544['shift']());}};_0x46c9c4(++_0x161cb3);}(_0xa169,0xaa));var _0x9a16=function(_0x48feb5,_0x333560){_0x48feb5=_0x48feb5-0x0;var _0x59761d=_0xa169[_0x48feb5];return _0x59761d;};'use strict';var _=require(_0x9a16('0x0'));var util=require(_0x9a16('0x1'));var moment=require(_0x9a16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a16('0x3'));var db=require(_0x9a16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a16('0x5'))(_0x9a16('0x6'));var config=require(_0x9a16('0x7'));var jayson=require(_0x9a16('0x8'));var client=jayson[_0x9a16('0x9')]['http']({'port':0x232a});config[_0x9a16('0xa')]=_[_0x9a16('0xb')](config[_0x9a16('0xa')],{'host':_0x9a16('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a16('0xa')]));require('./chatQueue.socket')[_0x9a16('0xd')](socket);function respondWithRpcPromise(_0x4a0bc6,_0x198eff,_0x41ac32){return new BPromise(function(_0x4f97c7,_0x956e25){return client[_0x9a16('0xe')](_0x4a0bc6,_0x41ac32)['then'](function(_0x5e385a){logger[_0x9a16('0xf')]('ChatQueue,\x20%s,\x20%s',_0x198eff,'request\x20sent');logger[_0x9a16('0x10')](_0x9a16('0x11'),_0x198eff,_0x9a16('0x12'),JSON[_0x9a16('0x13')](_0x5e385a));if(_0x5e385a['error']){if(_0x5e385a[_0x9a16('0x14')][_0x9a16('0x15')]===0x1f4){logger[_0x9a16('0x14')](_0x9a16('0x16'),_0x198eff,_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);return _0x956e25(_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);}logger['error'](_0x9a16('0x16'),_0x198eff,_0x5e385a[_0x9a16('0x14')][_0x9a16('0x17')]);return _0x4f97c7(_0x5e385a[_0x9a16('0x14')]['message']);}else{logger['info'](_0x9a16('0x16'),_0x198eff,_0x9a16('0x12'));_0x4f97c7(_0x5e385a['result'][_0x9a16('0x17')]);}})['catch'](function(_0x5f3f60){logger['error']('ChatQueue,\x20%s,\x20%s',_0x198eff,_0x5f3f60);_0x956e25(_0x5f3f60);});});}exports[_0x9a16('0x18')]=function(_0x3f684f){var _0x4e9732=this;return new Promise(function(_0x1bca76,_0x2d8950){return db[_0x9a16('0x19')][_0x9a16('0x1a')]({'raw':_0x3f684f['options']?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1d')]||null:null,'attributes':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f['options']['attributes']||null:null,'limit':_0x3f684f['options']?_0x3f684f[_0x9a16('0x1b')][_0x9a16('0x1e')]||null:null,'include':_0x3f684f[_0x9a16('0x1b')]?_0x3f684f[_0x9a16('0x1b')]['include']?_[_0x9a16('0x1f')](_0x3f684f[_0x9a16('0x1b')]['include'],function(_0x42bd3b){return{'model':db[_0x42bd3b[_0x9a16('0x20')]],'as':_0x42bd3b['as'],'attributes':_0x42bd3b[_0x9a16('0x21')],'include':_0x42bd3b[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x42bd3b[_0x9a16('0x22')],function(_0x1ac894){return{'model':db[_0x1ac894['model']],'as':_0x1ac894['as'],'attributes':_0x1ac894[_0x9a16('0x21')],'include':_0x1ac894[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x1ac894[_0x9a16('0x22')],function(_0x20290f){return{'model':db[_0x20290f[_0x9a16('0x20')]],'as':_0x20290f['as'],'attributes':_0x20290f[_0x9a16('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a16('0x23')](function(_0x241cda){logger['info'](_0x9a16('0x18'),_0x3f684f);logger[_0x9a16('0x10')](_0x9a16('0x18'),_0x3f684f,JSON[_0x9a16('0x13')](_0x241cda));_0x1bca76(_0x241cda);})[_0x9a16('0x24')](function(_0x7be0f5){logger[_0x9a16('0x14')](_0x9a16('0x18'),_0x7be0f5[_0x9a16('0x17')],_0x3f684f);_0x2d8950(_0x4e9732['error'](0x1f4,_0x7be0f5[_0x9a16('0x17')]));});});};exports[_0x9a16('0x25')]=function(_0x16ddc9){var _0x1302fc=this;return new Promise(function(_0x4ea7f5,_0x45f491){return db['ChatQueue']['find']({'raw':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x1c')]===undefined?!![]:![]:!![],'where':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x1d')]||null:null,'attributes':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')]['attributes']||null:null,'include':_0x16ddc9[_0x9a16('0x1b')]?_0x16ddc9[_0x9a16('0x1b')]['include']?_[_0x9a16('0x1f')](_0x16ddc9[_0x9a16('0x1b')][_0x9a16('0x22')],function(_0xb8c3a){return{'model':db[_0xb8c3a[_0x9a16('0x20')]],'as':_0xb8c3a['as'],'attributes':_0xb8c3a[_0x9a16('0x21')],'include':_0xb8c3a['include']?_[_0x9a16('0x1f')](_0xb8c3a[_0x9a16('0x22')],function(_0x4a53d3){return{'model':db[_0x4a53d3[_0x9a16('0x20')]],'as':_0x4a53d3['as'],'attributes':_0x4a53d3[_0x9a16('0x21')],'include':_0x4a53d3[_0x9a16('0x22')]?_[_0x9a16('0x1f')](_0x4a53d3['include'],function(_0x59510f){return{'model':db[_0x59510f[_0x9a16('0x20')]],'as':_0x59510f['as'],'attributes':_0x59510f[_0x9a16('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9a16('0x23')](function(_0x69de2e){logger[_0x9a16('0xf')](_0x9a16('0x25'),_0x16ddc9);logger[_0x9a16('0x10')](_0x9a16('0x25'),_0x16ddc9,JSON[_0x9a16('0x13')](_0x69de2e));_0x4ea7f5(_0x69de2e);})['catch'](function(_0x2a736a){logger[_0x9a16('0x14')](_0x9a16('0x25'),_0x2a736a[_0x9a16('0x17')],_0x16ddc9);_0x45f491(_0x1302fc[_0x9a16('0x14')](0x1f4,_0x2a736a[_0x9a16('0x17')]));});});};
\ No newline at end of file
+var _0xc15c=['http','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','model','map','info','debug','ChatQueue','find','raw','ShowChatQueue','moment','bluebird','randomstring','../../mysqldb','rpc','client'];(function(_0x47c199,_0x4ba09f){var _0x60c20b=function(_0x134218){while(--_0x134218){_0x47c199['push'](_0x47c199['shift']());}};_0x60c20b(++_0x4ba09f);}(_0xc15c,0xae));var _0xcc15=function(_0xee78c0,_0x23a380){_0xee78c0=_0xee78c0-0x0;var _0x294bec=_0xc15c[_0xee78c0];return _0x294bec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcc15('0x0'));var BPromise=require(_0xcc15('0x1'));var rs=require(_0xcc15('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc15('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc15('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc15('0x5')][_0xcc15('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0xcc15('0x7')],{'host':_0xcc15('0x8'),'port':0x18eb});var socket=require(_0xcc15('0x9'))(new Redis(config[_0xcc15('0x7')]));require(_0xcc15('0xa'))['register'](socket);function respondWithRpcPromise(_0x355a96,_0x363e58,_0x24316b){return new BPromise(function(_0x391197,_0x55a853){return client[_0xcc15('0xb')](_0x355a96,_0x24316b)[_0xcc15('0xc')](function(_0x40dded){logger['info']('ChatQueue,\x20%s,\x20%s',_0x363e58,_0xcc15('0xd'));logger['debug'](_0xcc15('0xe'),_0x363e58,'request\x20sent',JSON[_0xcc15('0xf')](_0x40dded));if(_0x40dded['error']){if(_0x40dded[_0xcc15('0x10')]['code']===0x1f4){logger[_0xcc15('0x10')](_0xcc15('0x11'),_0x363e58,_0x40dded[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x55a853(_0x40dded['error']['message']);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x363e58,_0x40dded[_0xcc15('0x10')][_0xcc15('0x12')]);return _0x391197(_0x40dded[_0xcc15('0x10')]['message']);}else{logger['info'](_0xcc15('0x11'),_0x363e58,'request\x20sent');_0x391197(_0x40dded[_0xcc15('0x13')][_0xcc15('0x12')]);}})[_0xcc15('0x14')](function(_0x47a574){logger['error'](_0xcc15('0x11'),_0x363e58,_0x47a574);_0x55a853(_0x47a574);});});}exports[_0xcc15('0x15')]=function(_0x590809){var _0x25de95=this;return new Promise(function(_0x3254a9,_0x3f574c){return db['ChatQueue'][_0xcc15('0x16')]({'raw':_0x590809['options']?_0x590809[_0xcc15('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x590809[_0xcc15('0x17')]?_0x590809[_0xcc15('0x17')][_0xcc15('0x18')]||null:null,'attributes':_0x590809[_0xcc15('0x17')]?_0x590809['options'][_0xcc15('0x19')]||null:null,'limit':_0x590809[_0xcc15('0x17')]?_0x590809[_0xcc15('0x17')][_0xcc15('0x1a')]||null:null,'include':_0x590809['options']?_0x590809[_0xcc15('0x17')][_0xcc15('0x1b')]?_['map'](_0x590809['options'][_0xcc15('0x1b')],function(_0x3ebade){return{'model':db[_0x3ebade[_0xcc15('0x1c')]],'as':_0x3ebade['as'],'attributes':_0x3ebade[_0xcc15('0x19')],'include':_0x3ebade['include']?_[_0xcc15('0x1d')](_0x3ebade[_0xcc15('0x1b')],function(_0x4f4af8){return{'model':db[_0x4f4af8[_0xcc15('0x1c')]],'as':_0x4f4af8['as'],'attributes':_0x4f4af8['attributes'],'include':_0x4f4af8['include']?_[_0xcc15('0x1d')](_0x4f4af8['include'],function(_0x481c4e){return{'model':db[_0x481c4e[_0xcc15('0x1c')]],'as':_0x481c4e['as'],'attributes':_0x481c4e[_0xcc15('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcc15('0xc')](function(_0x171a09){logger[_0xcc15('0x1e')]('GetChatQueue',_0x590809);logger[_0xcc15('0x1f')](_0xcc15('0x15'),_0x590809,JSON[_0xcc15('0xf')](_0x171a09));_0x3254a9(_0x171a09);})[_0xcc15('0x14')](function(_0x3c6102){logger[_0xcc15('0x10')](_0xcc15('0x15'),_0x3c6102[_0xcc15('0x12')],_0x590809);_0x3f574c(_0x25de95[_0xcc15('0x10')](0x1f4,_0x3c6102[_0xcc15('0x12')]));});});};exports['ShowChatQueue']=function(_0x57db3e){var _0x21b2fd=this;return new Promise(function(_0x4698e1,_0xf2b71c){return db[_0xcc15('0x20')][_0xcc15('0x21')]({'raw':_0x57db3e[_0xcc15('0x17')]?_0x57db3e['options'][_0xcc15('0x22')]===undefined?!![]:![]:!![],'where':_0x57db3e['options']?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x18')]||null:null,'attributes':_0x57db3e[_0xcc15('0x17')]?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x19')]||null:null,'include':_0x57db3e[_0xcc15('0x17')]?_0x57db3e[_0xcc15('0x17')][_0xcc15('0x1b')]?_[_0xcc15('0x1d')](_0x57db3e[_0xcc15('0x17')]['include'],function(_0xb0116){return{'model':db[_0xb0116[_0xcc15('0x1c')]],'as':_0xb0116['as'],'attributes':_0xb0116[_0xcc15('0x19')],'include':_0xb0116[_0xcc15('0x1b')]?_[_0xcc15('0x1d')](_0xb0116['include'],function(_0x3f8cd1){return{'model':db[_0x3f8cd1[_0xcc15('0x1c')]],'as':_0x3f8cd1['as'],'attributes':_0x3f8cd1[_0xcc15('0x19')],'include':_0x3f8cd1['include']?_['map'](_0x3f8cd1[_0xcc15('0x1b')],function(_0x979923){return{'model':db[_0x979923['model']],'as':_0x979923['as'],'attributes':_0x979923[_0xcc15('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x69ba47){logger[_0xcc15('0x1e')](_0xcc15('0x23'),_0x57db3e);logger[_0xcc15('0x1f')]('ShowChatQueue',_0x57db3e,JSON[_0xcc15('0xf')](_0x69ba47));_0x4698e1(_0x69ba47);})[_0xcc15('0x14')](function(_0x2d769a){logger[_0xcc15('0x10')](_0xcc15('0x23'),_0x2d769a[_0xcc15('0x12')],_0x57db3e);_0xf2b71c(_0x21b2fd[_0xcc15('0x10')](0x1f4,_0x2d769a[_0xcc15('0x12')]));});});};
\ No newline at end of file
index 2d8d39f..e1ad1dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x2b136c,_0xe706a0){var _0x3f4a87=function(_0x234ffe){while(--_0x234ffe){_0x2b136c['push'](_0x2b136c['shift']());}};_0x3f4a87(++_0xe706a0);}(_0xe107,0xb3));var _0x7e10=function(_0x54d1ce,_0x1b6bc0){_0x54d1ce=_0x54d1ce-0x0;var _0x35896f=_0xe107[_0x54d1ce];return _0x35896f;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
+var _0x3667=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x87c64,_0x54f61a){var _0x30ad6e=function(_0x5871d9){while(--_0x5871d9){_0x87c64['push'](_0x87c64['shift']());}};_0x30ad6e(++_0x54f61a);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var ChatQueueEvents=require(_0x7366('0x0'));var events=[_0x7366('0x1'),_0x7366('0x2'),_0x7366('0x3')];function createListener(_0x3c601d,_0x5d1072){return function(_0x27a90d){_0x5d1072[_0x7366('0x4')](_0x3c601d,_0x27a90d);};}function removeListener(_0x4b32a7,_0x27726b){return function(){ChatQueueEvents[_0x7366('0x5')](_0x4b32a7,_0x27726b);};}exports[_0x7366('0x6')]=function(_0x1c0cf4){for(var _0x101e3d=0x0,_0x589397=events[_0x7366('0x7')];_0x101e3d<_0x589397;_0x101e3d++){var _0xa1a3c5=events[_0x101e3d];var _0x2dd32b=createListener(_0x7366('0x8')+_0xa1a3c5,_0x1c0cf4);ChatQueueEvents['on'](_0xa1a3c5,_0x2dd32b);}};
\ No newline at end of file
index 9aae518..7172ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x503c5c,_0x38e24d){var _0x894667=function(_0x4f1b17){while(--_0x4f1b17){_0x503c5c['push'](_0x503c5c['shift']());}};_0x894667(++_0x38e24d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x521010,_0x2b9c5a){var _0x2f5e4f=function(_0x542e49){while(--_0x542e49){_0x521010['push'](_0x521010['shift']());}};_0x2f5e4f(++_0x2b9c5a);}(_0x7217,0x19e));var _0x7721=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x7217[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
index bb09fee..2723934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff58=['DATE','moment','sequelize','exports','STRING'];(function(_0x30af13,_0x243c55){var _0x20bd99=function(_0x5b21a2){while(--_0x5b21a2){_0x30af13['push'](_0x30af13['shift']());}};_0x20bd99(++_0x243c55);}(_0xff58,0x150));var _0x8ff5=function(_0x3e2e99,_0xad339){_0x3e2e99=_0x3e2e99-0x0;var _0x52ceef=_0xff58[_0x3e2e99];return _0x52ceef;};'use strict';var moment=require(_0x8ff5('0x0'));var Sequelize=require(_0x8ff5('0x1'));module[_0x8ff5('0x2')]={'uniqueid':{'type':Sequelize[_0x8ff5('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8ff5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8ff5('0x4')]},'exitAt':{'type':Sequelize[_0x8ff5('0x4')]},'reason':{'type':Sequelize[_0x8ff5('0x3')]}};
\ No newline at end of file
+var _0xfbd8=['STRING','DATE','moment','sequelize','exports'];(function(_0x3be036,_0x1a88a4){var _0x3751c7=function(_0x1daa6b){while(--_0x1daa6b){_0x3be036['push'](_0x3be036['shift']());}};_0x3751c7(++_0x1a88a4);}(_0xfbd8,0x1ba));var _0x8fbd=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0xfbd8[_0x557f5f];return _0x196eba;};'use strict';var moment=require(_0x8fbd('0x0'));var Sequelize=require(_0x8fbd('0x1'));module[_0x8fbd('0x2')]={'uniqueid':{'type':Sequelize[_0x8fbd('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8fbd('0x3')]},'joinAt':{'type':Sequelize[_0x8fbd('0x4')]},'leaveAt':{'type':Sequelize[_0x8fbd('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8fbd('0x4')]},'reason':{'type':Sequelize[_0x8fbd('0x3')]}};
\ No newline at end of file
index fc2212f..222fb3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc86=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x44dfea,_0x1adca9){var _0x14b889=function(_0x2ff7c9){while(--_0x2ff7c9){_0x44dfea['push'](_0x44dfea['shift']());}};_0x14b889(++_0x1adca9);}(_0xdc86,0x118));var _0x6dc8=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0xdc86[_0x11005e];return _0x29338f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6dc8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc8('0x1'));var rp=require('request-promise');var moment=require(_0x6dc8('0x2'));var BPromise=require(_0x6dc8('0x3'));var Mustache=require(_0x6dc8('0x4'));var util=require(_0x6dc8('0x5'));var path=require(_0x6dc8('0x6'));var sox=require('sox');var csv=require(_0x6dc8('0x7'));var ejs=require(_0x6dc8('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc8('0x9'));var _=require(_0x6dc8('0xa'));var squel=require(_0x6dc8('0xb'));var crypto=require(_0x6dc8('0xc'));var jsforce=require(_0x6dc8('0xd'));var deskjs=require(_0x6dc8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6dc8('0xf'));var Papa=require('papaparse');var Redis=require(_0x6dc8('0x10'));var authService=require(_0x6dc8('0x11'));var qs=require(_0x6dc8('0x12'));var as=require(_0x6dc8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc8('0x14'))(_0x6dc8('0x15'));var utils=require(_0x6dc8('0x16'));var config=require(_0x6dc8('0x17'));var licenseUtil=require(_0x6dc8('0x18'));var db=require(_0x6dc8('0x19'))['db'];function respondWithStatusCode(_0x49e474,_0x36e427){_0x36e427=_0x36e427||0xcc;return function(_0x542c8b){if(_0x542c8b){return _0x49e474['sendStatus'](_0x36e427);}return _0x49e474[_0x6dc8('0x1a')](_0x36e427)[_0x6dc8('0x1b')]();};}function respondWithResult(_0x21be3d,_0x58c295){_0x58c295=_0x58c295||0xc8;return function(_0x23acc6){if(_0x23acc6){return _0x21be3d[_0x6dc8('0x1a')](_0x58c295)[_0x6dc8('0x1c')](_0x23acc6);}};}function respondWithFilteredResult(_0x45a2f7,_0x28158d){return function(_0x4782c8){if(_0x4782c8){var _0x351c11=typeof _0x28158d[_0x6dc8('0x1d')]===_0x6dc8('0x1e')&&typeof _0x28158d['limit']==='undefined';var _0x2702c5=_0x4782c8[_0x6dc8('0x1f')];var _0x209ae4=_0x351c11?0x0:_0x28158d[_0x6dc8('0x1d')];var _0x2f3b94=_0x351c11?_0x4782c8['count']:_0x28158d['offset']+_0x28158d['limit'];var _0x2247c4;if(_0x2f3b94>=_0x2702c5){_0x2f3b94=_0x2702c5;_0x2247c4=0xc8;}else{_0x2247c4=0xce;}_0x45a2f7['status'](_0x2247c4);return _0x45a2f7[_0x6dc8('0x20')]('Content-Range',_0x209ae4+'-'+_0x2f3b94+'/'+_0x2702c5)[_0x6dc8('0x1c')](_0x4782c8);}return null;};}function patchUpdates(_0x4467a1){return function(_0x3e161a){try{jsonpatch[_0x6dc8('0x21')](_0x3e161a,_0x4467a1,!![]);}catch(_0x1949be){return BPromise[_0x6dc8('0x22')](_0x1949be);}return _0x3e161a[_0x6dc8('0x23')]();};}function saveUpdates(_0x38ce80,_0x1436d1){return function(_0x5526cd){if(_0x5526cd){return _0x5526cd[_0x6dc8('0x24')](_0x38ce80)[_0x6dc8('0x25')](function(_0x30afb5){return _0x30afb5;});}return null;};}function removeEntity(_0x49b5a8,_0xf69b){return function(_0x5c78db){if(_0x5c78db){return _0x5c78db[_0x6dc8('0x26')]()[_0x6dc8('0x25')](function(){_0x49b5a8[_0x6dc8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56895f,_0x1983f8){return function(_0x14ec58){if(!_0x14ec58){_0x56895f['sendStatus'](0x194);}return _0x14ec58;};}function handleError(_0x4596db,_0x4636be){_0x4636be=_0x4636be||0x1f4;return function(_0x36b904){logger['error'](_0x36b904['stack']);if(_0x36b904[_0x6dc8('0x27')]){delete _0x36b904[_0x6dc8('0x27')];}_0x4596db['status'](_0x4636be)[_0x6dc8('0x28')](_0x36b904);};}exports['index']=function(_0x482cc6,_0x4e9f46){var _0x63da34={},_0x283a42={},_0x35e1fc={'count':0x0,'rows':[]};var _0x1fde66=_[_0x6dc8('0x29')](db[_0x6dc8('0x2a')][_0x6dc8('0x2b')],function(_0x437671){return{'name':_0x437671[_0x6dc8('0x2c')],'type':_0x437671[_0x6dc8('0x2d')]['key']};});_0x283a42[_0x6dc8('0x2e')]=_['map'](_0x1fde66,'name');_0x283a42[_0x6dc8('0x2f')]=_[_0x6dc8('0x30')](_0x482cc6[_0x6dc8('0x2f')]);_0x283a42[_0x6dc8('0x31')]=_['intersection'](_0x283a42[_0x6dc8('0x2e')],_0x283a42['query']);_0x63da34[_0x6dc8('0x32')]=_['intersection'](_0x283a42[_0x6dc8('0x2e')],qs[_0x6dc8('0x33')](_0x482cc6['query'][_0x6dc8('0x33')]));_0x63da34[_0x6dc8('0x32')]=_0x63da34['attributes'][_0x6dc8('0x34')]?_0x63da34[_0x6dc8('0x32')]:_0x283a42[_0x6dc8('0x2e')];if(!_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x35')]('nolimit')){_0x63da34['limit']=qs[_0x6dc8('0x36')](_0x482cc6['query'][_0x6dc8('0x36')]);_0x63da34[_0x6dc8('0x1d')]=qs['offset'](_0x482cc6['query'][_0x6dc8('0x1d')]);}_0x63da34['order']=qs[_0x6dc8('0x37')](_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x37')]);_0x63da34[_0x6dc8('0x38')]=qs[_0x6dc8('0x31')](_[_0x6dc8('0x39')](_0x482cc6[_0x6dc8('0x2f')],_0x283a42['filters']),_0x1fde66);if(_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3a')]){_0x63da34[_0x6dc8('0x38')]=_[_0x6dc8('0x3b')](_0x63da34[_0x6dc8('0x38')],{'$or':_[_0x6dc8('0x29')](_0x1fde66,function(_0x14822f){if(_0x14822f[_0x6dc8('0x2d')]!==_0x6dc8('0x3c')){var _0x5b5e67={};_0x5b5e67[_0x14822f['name']]={'$like':'%'+_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3a')]+'%'};return _0x5b5e67;}})});}_0x63da34=_['merge']({},_0x63da34,_0x482cc6[_0x6dc8('0x3d')]);var _0x2f4078={'where':_0x63da34[_0x6dc8('0x38')]};return db[_0x6dc8('0x2a')][_0x6dc8('0x1f')](_0x2f4078)[_0x6dc8('0x25')](function(_0x400070){_0x35e1fc[_0x6dc8('0x1f')]=_0x400070;if(_0x482cc6[_0x6dc8('0x2f')][_0x6dc8('0x3e')]){_0x63da34[_0x6dc8('0x3f')]=[{'all':!![]}];}return db[_0x6dc8('0x2a')][_0x6dc8('0x40')](_0x63da34);})[_0x6dc8('0x25')](function(_0xc46154){_0x35e1fc[_0x6dc8('0x41')]=_0xc46154;return _0x35e1fc;})[_0x6dc8('0x25')](respondWithFilteredResult(_0x4e9f46,_0x63da34))[_0x6dc8('0x42')](handleError(_0x4e9f46,null));};exports['show']=function(_0x483868,_0x1b5d94){var _0x34d6ca={'raw':!![],'where':{'id':_0x483868[_0x6dc8('0x43')]['id']}},_0x2de273={};_0x2de273[_0x6dc8('0x2e')]=_[_0x6dc8('0x30')](db[_0x6dc8('0x2a')][_0x6dc8('0x2b')]);_0x2de273[_0x6dc8('0x2f')]=_['keys'](_0x483868[_0x6dc8('0x2f')]);_0x2de273[_0x6dc8('0x31')]=_[_0x6dc8('0x44')](_0x2de273[_0x6dc8('0x2e')],_0x2de273[_0x6dc8('0x2f')]);_0x34d6ca['attributes']=_[_0x6dc8('0x44')](_0x2de273['model'],qs[_0x6dc8('0x33')](_0x483868['query']['fields']));_0x34d6ca['attributes']=_0x34d6ca['attributes'][_0x6dc8('0x34')]?_0x34d6ca[_0x6dc8('0x32')]:_0x2de273[_0x6dc8('0x2e')];if(_0x483868[_0x6dc8('0x2f')][_0x6dc8('0x3e')]){_0x34d6ca[_0x6dc8('0x3f')]=[{'all':!![]}];}_0x34d6ca=_[_0x6dc8('0x3b')]({},_0x34d6ca,_0x483868[_0x6dc8('0x3d')]);return db[_0x6dc8('0x2a')][_0x6dc8('0x45')](_0x34d6ca)['then'](handleEntityNotFound(_0x1b5d94,null))['then'](respondWithResult(_0x1b5d94,null))[_0x6dc8('0x42')](handleError(_0x1b5d94,null));};exports[_0x6dc8('0x46')]=function(_0x151b05,_0x2b516a){return db[_0x6dc8('0x2a')][_0x6dc8('0x46')](_0x151b05[_0x6dc8('0x47')],{})[_0x6dc8('0x25')](respondWithResult(_0x2b516a,0xc9))[_0x6dc8('0x42')](handleError(_0x2b516a,null));};exports['update']=function(_0x8fe06e,_0x387f48){if(_0x8fe06e[_0x6dc8('0x47')]['id']){delete _0x8fe06e[_0x6dc8('0x47')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x8fe06e[_0x6dc8('0x43')]['id']}})['then'](handleEntityNotFound(_0x387f48,null))[_0x6dc8('0x25')](saveUpdates(_0x8fe06e[_0x6dc8('0x47')],null))['then'](respondWithResult(_0x387f48,null))['catch'](handleError(_0x387f48,null));};exports['destroy']=function(_0x3707f8,_0x6e3f57){return db[_0x6dc8('0x2a')]['find']({'where':{'id':_0x3707f8[_0x6dc8('0x43')]['id']}})[_0x6dc8('0x25')](handleEntityNotFound(_0x6e3f57,null))[_0x6dc8('0x25')](removeEntity(_0x6e3f57,null))[_0x6dc8('0x42')](handleError(_0x6e3f57,null));};exports[_0x6dc8('0x48')]=function(_0x2db363,_0x5e9e5d){return db[_0x6dc8('0x2a')][_0x6dc8('0x48')]()['then'](respondWithResult(_0x5e9e5d,null))[_0x6dc8('0x42')](handleError(_0x5e9e5d,null));};
\ No newline at end of file
+var _0x19fb=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','index','map','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','ChatQueueReport','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x369b7b,_0x3135a9){var _0x45f573=function(_0x175203){while(--_0x175203){_0x369b7b['push'](_0x369b7b['shift']());}};_0x45f573(++_0x3135a9);}(_0x19fb,0xdd));var _0xb19f=function(_0x12e6b5,_0x2ea21a){_0x12e6b5=_0x12e6b5-0x0;var _0x2a0a23=_0x19fb[_0x12e6b5];return _0x2a0a23;};'use strict';var emlformat=require(_0xb19f('0x0'));var rimraf=require(_0xb19f('0x1'));var zipdir=require(_0xb19f('0x2'));var jsonpatch=require(_0xb19f('0x3'));var rp=require(_0xb19f('0x4'));var moment=require(_0xb19f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb19f('0x6'));var path=require(_0xb19f('0x7'));var sox=require(_0xb19f('0x8'));var csv=require(_0xb19f('0x9'));var ejs=require(_0xb19f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb19f('0xb'));var squel=require(_0xb19f('0xc'));var crypto=require(_0xb19f('0xd'));var jsforce=require(_0xb19f('0xe'));var deskjs=require(_0xb19f('0xf'));var toCsv=require(_0xb19f('0x9'));var querystring=require(_0xb19f('0x10'));var Papa=require(_0xb19f('0x11'));var Redis=require('ioredis');var authService=require(_0xb19f('0x12'));var qs=require(_0xb19f('0x13'));var as=require(_0xb19f('0x14'));var hardwareService=require(_0xb19f('0x15'));var logger=require(_0xb19f('0x16'))(_0xb19f('0x17'));var utils=require(_0xb19f('0x18'));var config=require(_0xb19f('0x19'));var licenseUtil=require(_0xb19f('0x1a'));var db=require(_0xb19f('0x1b'))['db'];function respondWithStatusCode(_0x22272f,_0x26a1d1){_0x26a1d1=_0x26a1d1||0xcc;return function(_0xc4a0b5){if(_0xc4a0b5){return _0x22272f[_0xb19f('0x1c')](_0x26a1d1);}return _0x22272f[_0xb19f('0x1d')](_0x26a1d1)['end']();};}function respondWithResult(_0x214290,_0x3482f9){_0x3482f9=_0x3482f9||0xc8;return function(_0x34518a){if(_0x34518a){return _0x214290['status'](_0x3482f9)[_0xb19f('0x1e')](_0x34518a);}};}function respondWithFilteredResult(_0x13ebd4,_0x46b688){return function(_0x5640ea){if(_0x5640ea){var _0x11318c=typeof _0x46b688[_0xb19f('0x1f')]===_0xb19f('0x20')&&typeof _0x46b688['limit']===_0xb19f('0x20');var _0x49d304=_0x5640ea['count'];var _0x5b52d9=_0x11318c?0x0:_0x46b688[_0xb19f('0x1f')];var _0x3b4367=_0x11318c?_0x5640ea[_0xb19f('0x21')]:_0x46b688[_0xb19f('0x1f')]+_0x46b688['limit'];var _0x2aedec;if(_0x3b4367>=_0x49d304){_0x3b4367=_0x49d304;_0x2aedec=0xc8;}else{_0x2aedec=0xce;}_0x13ebd4[_0xb19f('0x1d')](_0x2aedec);return _0x13ebd4['set'](_0xb19f('0x22'),_0x5b52d9+'-'+_0x3b4367+'/'+_0x49d304)['json'](_0x5640ea);}return null;};}function patchUpdates(_0x3950c9){return function(_0x2acb39){try{jsonpatch[_0xb19f('0x23')](_0x2acb39,_0x3950c9,!![]);}catch(_0xb449b4){return BPromise[_0xb19f('0x24')](_0xb449b4);}return _0x2acb39[_0xb19f('0x25')]();};}function saveUpdates(_0x333198,_0x4eb288){return function(_0x9ab8fc){if(_0x9ab8fc){return _0x9ab8fc[_0xb19f('0x26')](_0x333198)[_0xb19f('0x27')](function(_0x34c638){return _0x34c638;});}return null;};}function removeEntity(_0x47e313,_0x25fbdc){return function(_0x33b4ad){if(_0x33b4ad){return _0x33b4ad[_0xb19f('0x28')]()[_0xb19f('0x27')](function(){_0x47e313[_0xb19f('0x1d')](0xcc)[_0xb19f('0x29')]();});}};}function handleEntityNotFound(_0x28e0ad,_0x388b28){return function(_0xf528d){if(!_0xf528d){_0x28e0ad[_0xb19f('0x1c')](0x194);}return _0xf528d;};}function handleError(_0x2e0544,_0x59ccde){_0x59ccde=_0x59ccde||0x1f4;return function(_0x3e1365){logger[_0xb19f('0x2a')](_0x3e1365['stack']);if(_0x3e1365[_0xb19f('0x2b')]){delete _0x3e1365[_0xb19f('0x2b')];}_0x2e0544['status'](_0x59ccde)['send'](_0x3e1365);};}exports[_0xb19f('0x2c')]=function(_0x17c22d,_0x3d2f84){var _0x46abbe={},_0x5e479a={},_0x5043b2={'count':0x0,'rows':[]};var _0x5e4a74=_[_0xb19f('0x2d')](db['ChatQueueReport']['rawAttributes'],function(_0x4b06eb){return{'name':_0x4b06eb[_0xb19f('0x2e')],'type':_0x4b06eb[_0xb19f('0x2f')][_0xb19f('0x30')]};});_0x5e479a[_0xb19f('0x31')]=_[_0xb19f('0x2d')](_0x5e4a74,_0xb19f('0x2b'));_0x5e479a['query']=_[_0xb19f('0x32')](_0x17c22d[_0xb19f('0x33')]);_0x5e479a['filters']=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],_0x5e479a[_0xb19f('0x33')]);_0x46abbe[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x5e479a[_0xb19f('0x31')],qs['fields'](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x36')]));_0x46abbe[_0xb19f('0x35')]=_0x46abbe[_0xb19f('0x35')][_0xb19f('0x37')]?_0x46abbe[_0xb19f('0x35')]:_0x5e479a['model'];if(!_0x17c22d[_0xb19f('0x33')][_0xb19f('0x38')](_0xb19f('0x39'))){_0x46abbe[_0xb19f('0x3a')]=qs[_0xb19f('0x3a')](_0x17c22d[_0xb19f('0x33')]['limit']);_0x46abbe[_0xb19f('0x1f')]=qs[_0xb19f('0x1f')](_0x17c22d[_0xb19f('0x33')][_0xb19f('0x1f')]);}_0x46abbe[_0xb19f('0x3b')]=qs[_0xb19f('0x3c')](_0x17c22d[_0xb19f('0x33')]['sort']);_0x46abbe[_0xb19f('0x3d')]=qs['filters'](_[_0xb19f('0x3e')](_0x17c22d[_0xb19f('0x33')],_0x5e479a[_0xb19f('0x3f')]),_0x5e4a74);if(_0x17c22d['query'][_0xb19f('0x40')]){_0x46abbe['where']=_[_0xb19f('0x41')](_0x46abbe[_0xb19f('0x3d')],{'$or':_['map'](_0x5e4a74,function(_0x1e0a79){if(_0x1e0a79[_0xb19f('0x2f')]!==_0xb19f('0x42')){var _0x13afe8={};_0x13afe8[_0x1e0a79['name']]={'$like':'%'+_0x17c22d[_0xb19f('0x33')][_0xb19f('0x40')]+'%'};return _0x13afe8;}})});}_0x46abbe=_[_0xb19f('0x41')]({},_0x46abbe,_0x17c22d[_0xb19f('0x43')]);var _0x2b4b5d={'where':_0x46abbe[_0xb19f('0x3d')]};return db['ChatQueueReport'][_0xb19f('0x21')](_0x2b4b5d)['then'](function(_0x1b85f6){_0x5043b2['count']=_0x1b85f6;if(_0x17c22d[_0xb19f('0x33')][_0xb19f('0x44')]){_0x46abbe['include']=[{'all':!![]}];}return db[_0xb19f('0x45')][_0xb19f('0x46')](_0x46abbe);})[_0xb19f('0x27')](function(_0x13cae8){_0x5043b2['rows']=_0x13cae8;return _0x5043b2;})[_0xb19f('0x27')](respondWithFilteredResult(_0x3d2f84,_0x46abbe))[_0xb19f('0x47')](handleError(_0x3d2f84,null));};exports[_0xb19f('0x48')]=function(_0x52c368,_0x2c68de){var _0x5772ac={'raw':!![],'where':{'id':_0x52c368[_0xb19f('0x49')]['id']}},_0x16bf0d={};_0x16bf0d[_0xb19f('0x31')]=_[_0xb19f('0x32')](db[_0xb19f('0x45')][_0xb19f('0x4a')]);_0x16bf0d[_0xb19f('0x33')]=_[_0xb19f('0x32')](_0x52c368['query']);_0x16bf0d[_0xb19f('0x3f')]=_[_0xb19f('0x34')](_0x16bf0d['model'],_0x16bf0d[_0xb19f('0x33')]);_0x5772ac[_0xb19f('0x35')]=_[_0xb19f('0x34')](_0x16bf0d['model'],qs[_0xb19f('0x36')](_0x52c368['query'][_0xb19f('0x36')]));_0x5772ac['attributes']=_0x5772ac[_0xb19f('0x35')]['length']?_0x5772ac[_0xb19f('0x35')]:_0x16bf0d[_0xb19f('0x31')];if(_0x52c368[_0xb19f('0x33')]['includeAll']){_0x5772ac['include']=[{'all':!![]}];}_0x5772ac=_[_0xb19f('0x41')]({},_0x5772ac,_0x52c368[_0xb19f('0x43')]);return db[_0xb19f('0x45')]['find'](_0x5772ac)['then'](handleEntityNotFound(_0x2c68de,null))['then'](respondWithResult(_0x2c68de,null))[_0xb19f('0x47')](handleError(_0x2c68de,null));};exports[_0xb19f('0x4b')]=function(_0x5dbfdc,_0x194910){return db['ChatQueueReport'][_0xb19f('0x4b')](_0x5dbfdc[_0xb19f('0x4c')],{})[_0xb19f('0x27')](respondWithResult(_0x194910,0xc9))[_0xb19f('0x47')](handleError(_0x194910,null));};exports[_0xb19f('0x26')]=function(_0x401787,_0x20da72){if(_0x401787[_0xb19f('0x4c')]['id']){delete _0x401787[_0xb19f('0x4c')]['id'];}return db[_0xb19f('0x45')][_0xb19f('0x4d')]({'where':{'id':_0x401787['params']['id']}})['then'](handleEntityNotFound(_0x20da72,null))[_0xb19f('0x27')](saveUpdates(_0x401787[_0xb19f('0x4c')],null))[_0xb19f('0x27')](respondWithResult(_0x20da72,null))[_0xb19f('0x47')](handleError(_0x20da72,null));};exports[_0xb19f('0x28')]=function(_0x57812a,_0x58b3c5){return db[_0xb19f('0x45')]['find']({'where':{'id':_0x57812a[_0xb19f('0x49')]['id']}})[_0xb19f('0x27')](handleEntityNotFound(_0x58b3c5,null))[_0xb19f('0x27')](removeEntity(_0x58b3c5,null))['catch'](handleError(_0x58b3c5,null));};exports[_0xb19f('0x4e')]=function(_0x12b227,_0x1b7e57){return db[_0xb19f('0x45')][_0xb19f('0x4e')]()[_0xb19f('0x27')](respondWithResult(_0x1b7e57,null))[_0xb19f('0x47')](handleError(_0x1b7e57,null));};
\ No newline at end of file
index e7331d2..7e05813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x32db19,_0x145d3a){var _0x130d3f=function(_0xdf8f97){while(--_0xdf8f97){_0x32db19['push'](_0x32db19['shift']());}};_0x130d3f(++_0x145d3a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x32d442,_0x318f79){var _0x544226=function(_0x241d65){while(--_0x241d65){_0x32d442['push'](_0x32d442['shift']());}};_0x544226(++_0x318f79);}(_0x757a,0xde));var _0xa757=function(_0x1f11cf,_0x450690){_0x1f11cf=_0x1f11cf-0x0;var _0x43cd9c=_0x757a[_0x1f11cf];return _0x43cd9c;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index aa1ca24..c1e7d84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd398=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','ChatQueueReport','body','options','CreateChatQueueReport','stringify','UpdateChatQueueReport','update','raw','where','limit','lodash','util','moment'];(function(_0xa4d0d9,_0x36a590){var _0x2cb66a=function(_0x16153e){while(--_0x16153e){_0xa4d0d9['push'](_0xa4d0d9['shift']());}};_0x2cb66a(++_0x36a590);}(_0xd398,0x1dd));var _0x8d39=function(_0x2aed6b,_0x14ddb2){_0x2aed6b=_0x2aed6b-0x0;var _0x3a703d=_0xd398[_0x2aed6b];return _0x3a703d;};'use strict';var _=require(_0x8d39('0x0'));var util=require(_0x8d39('0x1'));var moment=require(_0x8d39('0x2'));var BPromise=require(_0x8d39('0x3'));var rs=require(_0x8d39('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d39('0x5'))['db'];var utils=require(_0x8d39('0x6'));var logger=require(_0x8d39('0x7'))(_0x8d39('0x8'));var config=require(_0x8d39('0x9'));var jayson=require(_0x8d39('0xa'));var client=jayson[_0x8d39('0xb')][_0x8d39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38dd94,_0x1d8081,_0x41fe53){return new BPromise(function(_0x3405f3,_0x4711c7){return client['request'](_0x38dd94,_0x41fe53)[_0x8d39('0xd')](function(_0x3392e3){logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');logger[_0x8d39('0x10')](_0x8d39('0x11'),_0x1d8081,_0x8d39('0x12'),JSON['stringify'](_0x3392e3));if(_0x3392e3[_0x8d39('0x13')]){if(_0x3392e3[_0x8d39('0x13')]['code']===0x1f4){logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x4711c7(_0x3392e3[_0x8d39('0x13')]['message']);}logger['error'](_0x8d39('0xf'),_0x1d8081,_0x3392e3[_0x8d39('0x13')][_0x8d39('0x14')]);return _0x3405f3(_0x3392e3[_0x8d39('0x13')]['message']);}else{logger[_0x8d39('0xe')](_0x8d39('0xf'),_0x1d8081,'request\x20sent');_0x3405f3(_0x3392e3['result'][_0x8d39('0x14')]);}})[_0x8d39('0x15')](function(_0x182980){logger[_0x8d39('0x13')](_0x8d39('0xf'),_0x1d8081,_0x182980);_0x4711c7(_0x182980);});});}exports['CreateChatQueueReport']=function(_0x1eabfa){var _0x295ae5=this;return new Promise(function(_0x1e5f95,_0x531e41){return db[_0x8d39('0x16')]['create'](_0x1eabfa[_0x8d39('0x17')],{'raw':_0x1eabfa[_0x8d39('0x18')]?_0x1eabfa[_0x8d39('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x18e30d){logger[_0x8d39('0xe')](_0x8d39('0x19'),_0x1eabfa);logger['debug']('CreateChatQueueReport',_0x1eabfa,JSON[_0x8d39('0x1a')](_0x18e30d));_0x1e5f95(_0x18e30d);})[_0x8d39('0x15')](function(_0x48d0e2){logger['error']('CreateChatQueueReport',_0x48d0e2[_0x8d39('0x14')],_0x1eabfa);_0x531e41(_0x295ae5[_0x8d39('0x13')](0x1f4,_0x48d0e2[_0x8d39('0x14')]));});});};exports[_0x8d39('0x1b')]=function(_0x57e88d){var _0x2f4f85=this;return new Promise(function(_0x488451,_0x59e406){return db[_0x8d39('0x16')][_0x8d39('0x1c')](_0x57e88d[_0x8d39('0x17')],{'raw':_0x57e88d[_0x8d39('0x18')]?_0x57e88d['options'][_0x8d39('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57e88d[_0x8d39('0x18')]?_0x57e88d[_0x8d39('0x18')][_0x8d39('0x1e')]||null:null,'attributes':_0x57e88d[_0x8d39('0x18')]?_0x57e88d[_0x8d39('0x18')]['attributes']||null:null,'limit':_0x57e88d['options']?_0x57e88d[_0x8d39('0x18')][_0x8d39('0x1f')]||null:null})[_0x8d39('0xd')](function(_0x1120b6){logger[_0x8d39('0xe')](_0x8d39('0x1b'),_0x57e88d);logger[_0x8d39('0x10')](_0x8d39('0x1b'),_0x57e88d,JSON[_0x8d39('0x1a')](_0x1120b6));_0x488451(_0x1120b6);})[_0x8d39('0x15')](function(_0x57865a){logger[_0x8d39('0x13')]('UpdateChatQueueReport',_0x57865a[_0x8d39('0x14')],_0x57e88d);_0x59e406(_0x2f4f85[_0x8d39('0x13')](0x1f4,_0x57865a[_0x8d39('0x14')]));});});};
\ No newline at end of file
+var _0xd237=['debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','raw','stringify','update','options','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xd237,0x14f));var _0x7d23=function(_0x2c30ea,_0x3deb34){_0x2c30ea=_0x2c30ea-0x0;var _0x3e0406=_0xd237[_0x2c30ea];return _0x3e0406;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}exports[_0x7d23('0x17')]=function(_0x506a3b){var _0x313471=this;return new Promise(function(_0x3d6a7b,_0x49ce32){return db[_0x7d23('0x18')][_0x7d23('0x19')](_0x506a3b[_0x7d23('0x1a')],{'raw':_0x506a3b['options']?_0x506a3b['options'][_0x7d23('0x1b')]===undefined?!![]:![]:!![]})[_0x7d23('0xc')](function(_0x56b0ba){logger[_0x7d23('0xd')]('CreateChatQueueReport',_0x506a3b);logger[_0x7d23('0xf')]('CreateChatQueueReport',_0x506a3b,JSON[_0x7d23('0x1c')](_0x56b0ba));_0x3d6a7b(_0x56b0ba);})[_0x7d23('0x16')](function(_0x59522b){logger[_0x7d23('0x12')](_0x7d23('0x17'),_0x59522b[_0x7d23('0x14')],_0x506a3b);_0x49ce32(_0x313471['error'](0x1f4,_0x59522b[_0x7d23('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2e6d9f){var _0x354b2a=this;return new Promise(function(_0x1c007a,_0x3a5d87){return db[_0x7d23('0x18')][_0x7d23('0x1d')](_0x2e6d9f[_0x7d23('0x1a')],{'raw':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f['options'][_0x7d23('0x1f')]||null:null,'attributes':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x20')]||null:null,'limit':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x21')]||null:null})[_0x7d23('0xc')](function(_0x4808f2){logger[_0x7d23('0xd')](_0x7d23('0x22'),_0x2e6d9f);logger['debug'](_0x7d23('0x22'),_0x2e6d9f,JSON[_0x7d23('0x1c')](_0x4808f2));_0x1c007a(_0x4808f2);})[_0x7d23('0x16')](function(_0x4b1c92){logger[_0x7d23('0x12')](_0x7d23('0x22'),_0x4b1c92[_0x7d23('0x14')],_0x2e6d9f);_0x3a5d87(_0x354b2a[_0x7d23('0x12')](0x1f4,_0x4b1c92[_0x7d23('0x14')]));});});};
\ No newline at end of file
index 5cc0c9c..0fe77ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ade=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','/describe','describe','get','post','put'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x5ade,0x116));var _0xe5ad=function(_0x4d1002,_0x1575ac){_0x4d1002=_0x4d1002-0x0;var _0x441aba=_0x5ade[_0x4d1002];return _0x441aba;};'use strict';var multer=require(_0xe5ad('0x0'));var util=require(_0xe5ad('0x1'));var path=require(_0xe5ad('0x2'));var timeout=require(_0xe5ad('0x3'));var express=require('express');var router=express[_0xe5ad('0x4')]();var fs_extra=require(_0xe5ad('0x5'));var auth=require(_0xe5ad('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5ad('0x7'));var controller=require(_0xe5ad('0x8'));router['get']('/',auth[_0xe5ad('0x9')](),controller[_0xe5ad('0xa')]);router['get'](_0xe5ad('0xb'),auth[_0xe5ad('0x9')](),controller[_0xe5ad('0xc')]);router[_0xe5ad('0xd')]('/:id',auth[_0xe5ad('0x9')](),controller['show']);router[_0xe5ad('0xe')]('/',auth[_0xe5ad('0x9')](),controller['create']);router[_0xe5ad('0xf')](_0xe5ad('0x10'),auth['isAuthenticated'](),controller[_0xe5ad('0x11')]);router[_0xe5ad('0x12')](_0xe5ad('0x10'),auth[_0xe5ad('0x9')](),controller[_0xe5ad('0x13')]);module[_0xe5ad('0x14')]=router;
\ No newline at end of file
+var _0x61e9=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','index','get','/describe','/:id','isAuthenticated','post','put','update','delete','exports'];(function(_0x3911e0,_0x1e4327){var _0x5096fb=function(_0x4325f7){while(--_0x4325f7){_0x3911e0['push'](_0x3911e0['shift']());}};_0x5096fb(++_0x1e4327);}(_0x61e9,0x160));var _0x961e=function(_0x52f19f,_0x52164b){_0x52f19f=_0x52f19f-0x0;var _0x528dd8=_0x61e9[_0x52f19f];return _0x528dd8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x961e('0x0'));var timeout=require(_0x961e('0x1'));var express=require(_0x961e('0x2'));var router=express['Router']();var fs_extra=require(_0x961e('0x3'));var auth=require(_0x961e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x961e('0x5'));var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x961e('0x6')]);router[_0x961e('0x7')](_0x961e('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x961e('0x7')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller['show']);router[_0x961e('0xb')]('/',auth[_0x961e('0xa')](),controller['create']);router[_0x961e('0xc')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller[_0x961e('0xd')]);router[_0x961e('0xe')](_0x961e('0x9'),auth[_0x961e('0xa')](),controller['destroy']);module[_0x961e('0xf')]=router;
\ No newline at end of file
index 199e04e..14e8c11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x276c27,_0x5e56dd){var _0x56fbe4=function(_0x3ea975){while(--_0x3ea975){_0x276c27['push'](_0x276c27['shift']());}};_0x56fbe4(++_0x5e56dd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x1d4c60,_0xc3ffad){var _0x2252b4=function(_0x1121b7){while(--_0x1121b7){_0x1d4c60['push'](_0x1d4c60['shift']());}};_0x2252b4(++_0xc3ffad);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xcb91[_0x2dc96f];return _0xd012da;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index 34a6d06..39677ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a8f=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','params','include','find','create','body','destroy','describe','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','end','sendStatus','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x7a8f,0x1ed));var _0xf7a8=function(_0xe3d180,_0x1a2a7f){_0xe3d180=_0xe3d180-0x0;var _0x440869=_0x7a8f[_0xe3d180];return _0x440869;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7a8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7a8('0x1'));var rp=require('request-promise');var moment=require(_0xf7a8('0x2'));var BPromise=require(_0xf7a8('0x3'));var Mustache=require(_0xf7a8('0x4'));var util=require('util');var path=require(_0xf7a8('0x5'));var sox=require(_0xf7a8('0x6'));var csv=require(_0xf7a8('0x7'));var ejs=require(_0xf7a8('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7a8('0x9'));var squel=require(_0xf7a8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf7a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf7a8('0xc'));var Papa=require(_0xf7a8('0xd'));var Redis=require(_0xf7a8('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7a8('0xf'));var logger=require('../../config/logger')(_0xf7a8('0x10'));var utils=require(_0xf7a8('0x11'));var config=require(_0xf7a8('0x12'));var licenseUtil=require(_0xf7a8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28bec7,_0x3e970a){_0x3e970a=_0x3e970a||0xcc;return function(_0x5b0af9){if(_0x5b0af9){return _0x28bec7['sendStatus'](_0x3e970a);}return _0x28bec7[_0xf7a8('0x14')](_0x3e970a)['end']();};}function respondWithResult(_0x5c13e7,_0x43a604){_0x43a604=_0x43a604||0xc8;return function(_0x4a60d2){if(_0x4a60d2){return _0x5c13e7['status'](_0x43a604)['json'](_0x4a60d2);}};}function respondWithFilteredResult(_0x3b6769,_0x11a9b7){return function(_0x7655a3){if(_0x7655a3){var _0x339fdf=typeof _0x11a9b7['offset']===_0xf7a8('0x15')&&typeof _0x11a9b7[_0xf7a8('0x16')]===_0xf7a8('0x15');var _0x5457d2=_0x7655a3[_0xf7a8('0x17')];var _0x197b6f=_0x339fdf?0x0:_0x11a9b7['offset'];var _0x568db1=_0x339fdf?_0x7655a3['count']:_0x11a9b7[_0xf7a8('0x18')]+_0x11a9b7['limit'];var _0xc5b680;if(_0x568db1>=_0x5457d2){_0x568db1=_0x5457d2;_0xc5b680=0xc8;}else{_0xc5b680=0xce;}_0x3b6769[_0xf7a8('0x14')](_0xc5b680);return _0x3b6769[_0xf7a8('0x19')](_0xf7a8('0x1a'),_0x197b6f+'-'+_0x568db1+'/'+_0x5457d2)['json'](_0x7655a3);}return null;};}function patchUpdates(_0x4216db){return function(_0x1e8cdc){try{jsonpatch[_0xf7a8('0x1b')](_0x1e8cdc,_0x4216db,!![]);}catch(_0x37961a){return BPromise['reject'](_0x37961a);}return _0x1e8cdc[_0xf7a8('0x1c')]();};}function saveUpdates(_0x3d2f98,_0xccae90){return function(_0x186469){if(_0x186469){return _0x186469[_0xf7a8('0x1d')](_0x3d2f98)[_0xf7a8('0x1e')](function(_0x49ed45){return _0x49ed45;});}return null;};}function removeEntity(_0x32ab43,_0x332060){return function(_0x4976e9){if(_0x4976e9){return _0x4976e9['destroy']()[_0xf7a8('0x1e')](function(){_0x32ab43[_0xf7a8('0x14')](0xcc)[_0xf7a8('0x1f')]();});}};}function handleEntityNotFound(_0x203c8d,_0x21d53e){return function(_0x55c905){if(!_0x55c905){_0x203c8d[_0xf7a8('0x20')](0x194);}return _0x55c905;};}function handleError(_0xad5e79,_0x3337ed){_0x3337ed=_0x3337ed||0x1f4;return function(_0x1350ad){logger['error'](_0x1350ad[_0xf7a8('0x21')]);if(_0x1350ad[_0xf7a8('0x22')]){delete _0x1350ad[_0xf7a8('0x22')];}_0xad5e79[_0xf7a8('0x14')](_0x3337ed)[_0xf7a8('0x23')](_0x1350ad);};}exports[_0xf7a8('0x24')]=function(_0x29d995,_0x558779){var _0x222931={},_0x4d224d={},_0x57b6b7={'count':0x0,'rows':[]};var _0x3f43fa=_[_0xf7a8('0x25')](db[_0xf7a8('0x26')][_0xf7a8('0x27')],function(_0x18673c){return{'name':_0x18673c['fieldName'],'type':_0x18673c[_0xf7a8('0x28')][_0xf7a8('0x29')]};});_0x4d224d[_0xf7a8('0x2a')]=_['map'](_0x3f43fa,_0xf7a8('0x22'));_0x4d224d[_0xf7a8('0x2b')]=_[_0xf7a8('0x2c')](_0x29d995['query']);_0x4d224d[_0xf7a8('0x2d')]=_[_0xf7a8('0x2e')](_0x4d224d[_0xf7a8('0x2a')],_0x4d224d[_0xf7a8('0x2b')]);_0x222931[_0xf7a8('0x2f')]=_[_0xf7a8('0x2e')](_0x4d224d[_0xf7a8('0x2a')],qs[_0xf7a8('0x30')](_0x29d995['query'][_0xf7a8('0x30')]));_0x222931[_0xf7a8('0x2f')]=_0x222931[_0xf7a8('0x2f')][_0xf7a8('0x31')]?_0x222931[_0xf7a8('0x2f')]:_0x4d224d['model'];if(!_0x29d995['query'][_0xf7a8('0x32')]('nolimit')){_0x222931['limit']=qs[_0xf7a8('0x16')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x16')]);_0x222931[_0xf7a8('0x18')]=qs[_0xf7a8('0x18')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x18')]);}_0x222931[_0xf7a8('0x33')]=qs[_0xf7a8('0x34')](_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x34')]);_0x222931[_0xf7a8('0x35')]=qs[_0xf7a8('0x2d')](_[_0xf7a8('0x36')](_0x29d995[_0xf7a8('0x2b')],_0x4d224d[_0xf7a8('0x2d')]),_0x3f43fa);if(_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x37')]){_0x222931['where']=_[_0xf7a8('0x38')](_0x222931[_0xf7a8('0x35')],{'$or':_[_0xf7a8('0x25')](_0x3f43fa,function(_0x26c466){if(_0x26c466[_0xf7a8('0x28')]!==_0xf7a8('0x39')){var _0x28520c={};_0x28520c[_0x26c466[_0xf7a8('0x22')]]={'$like':'%'+_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x37')]+'%'};return _0x28520c;}})});}_0x222931=_[_0xf7a8('0x38')]({},_0x222931,_0x29d995[_0xf7a8('0x3a')]);var _0x50eb7c={'where':_0x222931[_0xf7a8('0x35')]};return db[_0xf7a8('0x26')][_0xf7a8('0x17')](_0x50eb7c)[_0xf7a8('0x1e')](function(_0x40073c){_0x57b6b7['count']=_0x40073c;if(_0x29d995[_0xf7a8('0x2b')][_0xf7a8('0x3b')]){_0x222931['include']=[{'all':!![]}];}return db[_0xf7a8('0x26')]['findAll'](_0x222931);})['then'](function(_0x3bde50){_0x57b6b7['rows']=_0x3bde50;return _0x57b6b7;})[_0xf7a8('0x1e')](respondWithFilteredResult(_0x558779,_0x222931))[_0xf7a8('0x3c')](handleError(_0x558779,null));};exports['show']=function(_0x1ed415,_0x344520){var _0x2a24e2={'raw':!![],'where':{'id':_0x1ed415[_0xf7a8('0x3d')]['id']}},_0x3c9da8={};_0x3c9da8[_0xf7a8('0x2a')]=_[_0xf7a8('0x2c')](db['ChatTransferReport']['rawAttributes']);_0x3c9da8['query']=_[_0xf7a8('0x2c')](_0x1ed415[_0xf7a8('0x2b')]);_0x3c9da8['filters']=_[_0xf7a8('0x2e')](_0x3c9da8[_0xf7a8('0x2a')],_0x3c9da8[_0xf7a8('0x2b')]);_0x2a24e2[_0xf7a8('0x2f')]=_[_0xf7a8('0x2e')](_0x3c9da8['model'],qs['fields'](_0x1ed415[_0xf7a8('0x2b')][_0xf7a8('0x30')]));_0x2a24e2[_0xf7a8('0x2f')]=_0x2a24e2[_0xf7a8('0x2f')][_0xf7a8('0x31')]?_0x2a24e2[_0xf7a8('0x2f')]:_0x3c9da8[_0xf7a8('0x2a')];if(_0x1ed415[_0xf7a8('0x2b')]['includeAll']){_0x2a24e2[_0xf7a8('0x3e')]=[{'all':!![]}];}_0x2a24e2=_[_0xf7a8('0x38')]({},_0x2a24e2,_0x1ed415[_0xf7a8('0x3a')]);return db[_0xf7a8('0x26')][_0xf7a8('0x3f')](_0x2a24e2)[_0xf7a8('0x1e')](handleEntityNotFound(_0x344520,null))[_0xf7a8('0x1e')](respondWithResult(_0x344520,null))['catch'](handleError(_0x344520,null));};exports[_0xf7a8('0x40')]=function(_0x4554aa,_0x401e65){return db['ChatTransferReport']['create'](_0x4554aa[_0xf7a8('0x41')],{})[_0xf7a8('0x1e')](respondWithResult(_0x401e65,0xc9))['catch'](handleError(_0x401e65,null));};exports[_0xf7a8('0x1d')]=function(_0x3063fb,_0xf9b5ee){if(_0x3063fb[_0xf7a8('0x41')]['id']){delete _0x3063fb[_0xf7a8('0x41')]['id'];}return db[_0xf7a8('0x26')][_0xf7a8('0x3f')]({'where':{'id':_0x3063fb[_0xf7a8('0x3d')]['id']}})[_0xf7a8('0x1e')](handleEntityNotFound(_0xf9b5ee,null))[_0xf7a8('0x1e')](saveUpdates(_0x3063fb['body'],null))['then'](respondWithResult(_0xf9b5ee,null))['catch'](handleError(_0xf9b5ee,null));};exports[_0xf7a8('0x42')]=function(_0xec247,_0x5d59b0){return db['ChatTransferReport'][_0xf7a8('0x3f')]({'where':{'id':_0xec247[_0xf7a8('0x3d')]['id']}})[_0xf7a8('0x1e')](handleEntityNotFound(_0x5d59b0,null))[_0xf7a8('0x1e')](removeEntity(_0x5d59b0,null))[_0xf7a8('0x3c')](handleError(_0x5d59b0,null));};exports['describe']=function(_0x55b380,_0x33f4cb){return db[_0xf7a8('0x26')][_0xf7a8('0x43')]()[_0xf7a8('0x1e')](respondWithResult(_0x33f4cb,null))[_0xf7a8('0x3c')](handleError(_0x33f4cb,null));};
\ No newline at end of file
+var _0x42fa=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','reject','save','update','destroy','error','name','send','index','map','ChatTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x45c957,_0x276317){var _0x1bf7f4=function(_0x51688b){while(--_0x51688b){_0x45c957['push'](_0x45c957['shift']());}};_0x1bf7f4(++_0x276317);}(_0x42fa,0xd8));var _0xa42f=function(_0xdbc0da,_0x376234){_0xdbc0da=_0xdbc0da-0x0;var _0x54157f=_0x42fa[_0xdbc0da];return _0x54157f;};'use strict';var emlformat=require(_0xa42f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa42f('0x1'));var rp=require('request-promise');var moment=require(_0xa42f('0x2'));var BPromise=require(_0xa42f('0x3'));var Mustache=require(_0xa42f('0x4'));var util=require(_0xa42f('0x5'));var path=require(_0xa42f('0x6'));var sox=require(_0xa42f('0x7'));var csv=require('to-csv');var ejs=require(_0xa42f('0x8'));var fs=require('fs');var fs_extra=require(_0xa42f('0x9'));var _=require(_0xa42f('0xa'));var squel=require(_0xa42f('0xb'));var crypto=require(_0xa42f('0xc'));var jsforce=require(_0xa42f('0xd'));var deskjs=require(_0xa42f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa42f('0xf'));var Papa=require(_0xa42f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa42f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa42f('0x12'));var logger=require('../../config/logger')(_0xa42f('0x13'));var utils=require(_0xa42f('0x14'));var config=require(_0xa42f('0x15'));var licenseUtil=require(_0xa42f('0x16'));var db=require(_0xa42f('0x17'))['db'];function respondWithStatusCode(_0x5f4f15,_0x2eb730){_0x2eb730=_0x2eb730||0xcc;return function(_0x1cfeaa){if(_0x1cfeaa){return _0x5f4f15[_0xa42f('0x18')](_0x2eb730);}return _0x5f4f15['status'](_0x2eb730)[_0xa42f('0x19')]();};}function respondWithResult(_0x56bc41,_0x1faa39){_0x1faa39=_0x1faa39||0xc8;return function(_0x444210){if(_0x444210){return _0x56bc41[_0xa42f('0x1a')](_0x1faa39)[_0xa42f('0x1b')](_0x444210);}};}function respondWithFilteredResult(_0x4522da,_0x547338){return function(_0x23a1b1){if(_0x23a1b1){var _0x20f2e4=typeof _0x547338[_0xa42f('0x1c')]==='undefined'&&typeof _0x547338[_0xa42f('0x1d')]===_0xa42f('0x1e');var _0x216d41=_0x23a1b1[_0xa42f('0x1f')];var _0x582eb1=_0x20f2e4?0x0:_0x547338[_0xa42f('0x1c')];var _0x3cf16f=_0x20f2e4?_0x23a1b1[_0xa42f('0x1f')]:_0x547338[_0xa42f('0x1c')]+_0x547338[_0xa42f('0x1d')];var _0x440d9b;if(_0x3cf16f>=_0x216d41){_0x3cf16f=_0x216d41;_0x440d9b=0xc8;}else{_0x440d9b=0xce;}_0x4522da[_0xa42f('0x1a')](_0x440d9b);return _0x4522da[_0xa42f('0x20')]('Content-Range',_0x582eb1+'-'+_0x3cf16f+'/'+_0x216d41)[_0xa42f('0x1b')](_0x23a1b1);}return null;};}function patchUpdates(_0x40ef63){return function(_0x1c5b14){try{jsonpatch['apply'](_0x1c5b14,_0x40ef63,!![]);}catch(_0x361824){return BPromise[_0xa42f('0x21')](_0x361824);}return _0x1c5b14[_0xa42f('0x22')]();};}function saveUpdates(_0x1bf246,_0x26a066){return function(_0x11cbfa){if(_0x11cbfa){return _0x11cbfa[_0xa42f('0x23')](_0x1bf246)['then'](function(_0x315bdf){return _0x315bdf;});}return null;};}function removeEntity(_0x1fb90b,_0x3e8de8){return function(_0x362d52){if(_0x362d52){return _0x362d52[_0xa42f('0x24')]()['then'](function(){_0x1fb90b[_0xa42f('0x1a')](0xcc)[_0xa42f('0x19')]();});}};}function handleEntityNotFound(_0x45fd28,_0x54e225){return function(_0x5a9dfc){if(!_0x5a9dfc){_0x45fd28[_0xa42f('0x18')](0x194);}return _0x5a9dfc;};}function handleError(_0x41fd77,_0x370bd4){_0x370bd4=_0x370bd4||0x1f4;return function(_0x4e14df){logger[_0xa42f('0x25')](_0x4e14df['stack']);if(_0x4e14df[_0xa42f('0x26')]){delete _0x4e14df[_0xa42f('0x26')];}_0x41fd77[_0xa42f('0x1a')](_0x370bd4)[_0xa42f('0x27')](_0x4e14df);};}exports[_0xa42f('0x28')]=function(_0x5987d7,_0x56218){var _0x597d0e={},_0x159c80={},_0x424f57={'count':0x0,'rows':[]};var _0x1576fd=_[_0xa42f('0x29')](db[_0xa42f('0x2a')]['rawAttributes'],function(_0x10816c){return{'name':_0x10816c[_0xa42f('0x2b')],'type':_0x10816c[_0xa42f('0x2c')][_0xa42f('0x2d')]};});_0x159c80[_0xa42f('0x2e')]=_[_0xa42f('0x29')](_0x1576fd,_0xa42f('0x26'));_0x159c80[_0xa42f('0x2f')]=_[_0xa42f('0x30')](_0x5987d7['query']);_0x159c80[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x159c80[_0xa42f('0x2e')],_0x159c80[_0xa42f('0x2f')]);_0x597d0e['attributes']=_[_0xa42f('0x32')](_0x159c80['model'],qs['fields'](_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x33')]));_0x597d0e[_0xa42f('0x34')]=_0x597d0e[_0xa42f('0x34')][_0xa42f('0x35')]?_0x597d0e['attributes']:_0x159c80[_0xa42f('0x2e')];if(!_0x5987d7['query'][_0xa42f('0x36')](_0xa42f('0x37'))){_0x597d0e[_0xa42f('0x1d')]=qs['limit'](_0x5987d7['query'][_0xa42f('0x1d')]);_0x597d0e[_0xa42f('0x1c')]=qs['offset'](_0x5987d7[_0xa42f('0x2f')]['offset']);}_0x597d0e[_0xa42f('0x38')]=qs[_0xa42f('0x39')](_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x39')]);_0x597d0e[_0xa42f('0x3a')]=qs[_0xa42f('0x31')](_[_0xa42f('0x3b')](_0x5987d7['query'],_0x159c80['filters']),_0x1576fd);if(_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x3c')]){_0x597d0e[_0xa42f('0x3a')]=_[_0xa42f('0x3d')](_0x597d0e[_0xa42f('0x3a')],{'$or':_[_0xa42f('0x29')](_0x1576fd,function(_0x44fe4a){if(_0x44fe4a['type']!==_0xa42f('0x3e')){var _0x4c8938={};_0x4c8938[_0x44fe4a[_0xa42f('0x26')]]={'$like':'%'+_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x3c')]+'%'};return _0x4c8938;}})});}_0x597d0e=_[_0xa42f('0x3d')]({},_0x597d0e,_0x5987d7['options']);var _0xbb5a68={'where':_0x597d0e['where']};return db[_0xa42f('0x2a')][_0xa42f('0x1f')](_0xbb5a68)[_0xa42f('0x3f')](function(_0x3faba3){_0x424f57[_0xa42f('0x1f')]=_0x3faba3;if(_0x5987d7[_0xa42f('0x2f')][_0xa42f('0x40')]){_0x597d0e[_0xa42f('0x41')]=[{'all':!![]}];}return db[_0xa42f('0x2a')][_0xa42f('0x42')](_0x597d0e);})[_0xa42f('0x3f')](function(_0x110c5e){_0x424f57['rows']=_0x110c5e;return _0x424f57;})[_0xa42f('0x3f')](respondWithFilteredResult(_0x56218,_0x597d0e))[_0xa42f('0x43')](handleError(_0x56218,null));};exports[_0xa42f('0x44')]=function(_0x2bac0d,_0x48c7fc){var _0x4f986d={'raw':!![],'where':{'id':_0x2bac0d['params']['id']}},_0x54ed5f={};_0x54ed5f['model']=_['keys'](db[_0xa42f('0x2a')]['rawAttributes']);_0x54ed5f[_0xa42f('0x2f')]=_[_0xa42f('0x30')](_0x2bac0d[_0xa42f('0x2f')]);_0x54ed5f[_0xa42f('0x31')]=_[_0xa42f('0x32')](_0x54ed5f[_0xa42f('0x2e')],_0x54ed5f[_0xa42f('0x2f')]);_0x4f986d['attributes']=_[_0xa42f('0x32')](_0x54ed5f[_0xa42f('0x2e')],qs[_0xa42f('0x33')](_0x2bac0d[_0xa42f('0x2f')][_0xa42f('0x33')]));_0x4f986d[_0xa42f('0x34')]=_0x4f986d[_0xa42f('0x34')][_0xa42f('0x35')]?_0x4f986d[_0xa42f('0x34')]:_0x54ed5f['model'];if(_0x2bac0d['query'][_0xa42f('0x40')]){_0x4f986d[_0xa42f('0x41')]=[{'all':!![]}];}_0x4f986d=_[_0xa42f('0x3d')]({},_0x4f986d,_0x2bac0d[_0xa42f('0x45')]);return db['ChatTransferReport'][_0xa42f('0x46')](_0x4f986d)[_0xa42f('0x3f')](handleEntityNotFound(_0x48c7fc,null))[_0xa42f('0x3f')](respondWithResult(_0x48c7fc,null))['catch'](handleError(_0x48c7fc,null));};exports[_0xa42f('0x47')]=function(_0x402622,_0x2eaa54){return db[_0xa42f('0x2a')]['create'](_0x402622['body'],{})[_0xa42f('0x3f')](respondWithResult(_0x2eaa54,0xc9))[_0xa42f('0x43')](handleError(_0x2eaa54,null));};exports[_0xa42f('0x23')]=function(_0x374c7c,_0x33b575){if(_0x374c7c['body']['id']){delete _0x374c7c[_0xa42f('0x48')]['id'];}return db[_0xa42f('0x2a')]['find']({'where':{'id':_0x374c7c['params']['id']}})[_0xa42f('0x3f')](handleEntityNotFound(_0x33b575,null))['then'](saveUpdates(_0x374c7c['body'],null))[_0xa42f('0x3f')](respondWithResult(_0x33b575,null))[_0xa42f('0x43')](handleError(_0x33b575,null));};exports[_0xa42f('0x24')]=function(_0x48db39,_0x41eac2){return db['ChatTransferReport'][_0xa42f('0x46')]({'where':{'id':_0x48db39[_0xa42f('0x49')]['id']}})[_0xa42f('0x3f')](handleEntityNotFound(_0x41eac2,null))[_0xa42f('0x3f')](removeEntity(_0x41eac2,null))[_0xa42f('0x43')](handleError(_0x41eac2,null));};exports[_0xa42f('0x4a')]=function(_0x465a88,_0x12a929){return db['ChatTransferReport'][_0xa42f('0x4a')]()[_0xa42f('0x3f')](respondWithResult(_0x12a929,null))['catch'](handleError(_0x12a929,null));};
\ No newline at end of file
index 8044a8b..036835f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f73=['util','../../config/logger','moment','bluebird','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','uniqueid','lodash'];(function(_0x7eb7d6,_0x52900e){var _0x1cabf5=function(_0x4a59d9){while(--_0x4a59d9){_0x7eb7d6['push'](_0x7eb7d6['shift']());}};_0x1cabf5(++_0x52900e);}(_0x0f73,0x117));var _0x30f7=function(_0x4145da,_0x1dcf93){_0x4145da=_0x4145da-0x0;var _0x2dd421=_0x0f73[_0x4145da];return _0x2dd421;};'use strict';var _=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var logger=require(_0x30f7('0x2'))('api');var moment=require(_0x30f7('0x3'));var BPromise=require(_0x30f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x30f7('0x5'));var config=require('../../config/environment');var attributes=require(_0x30f7('0x6'));module[_0x30f7('0x7')]=function(_0x1b8159,_0x43107f){return _0x1b8159['define'](_0x30f7('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x30f7('0x9'),'fields':[_0x30f7('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d07=['../../config/environment','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3d07,0xbb));var _0x73d0=function(_0x562ec5,_0x36b5a4){_0x562ec5=_0x562ec5-0x0;var _0x279c8c=_0x3d07[_0x562ec5];return _0x279c8c;};'use strict';var _=require(_0x73d0('0x0'));var util=require(_0x73d0('0x1'));var logger=require(_0x73d0('0x2'))(_0x73d0('0x3'));var moment=require(_0x73d0('0x4'));var BPromise=require(_0x73d0('0x5'));var rp=require(_0x73d0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73d0('0x7'));var config=require(_0x73d0('0x8'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x3203b3,_0x4b16fa){return _0x3203b3[_0x73d0('0x9')](_0x73d0('0xa'),attributes,{'tableName':_0x73d0('0xb'),'paranoid':![],'indexes':[{'name':_0x73d0('0xc'),'fields':[_0x73d0('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 60833dc..61d9363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73ef=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch'];(function(_0x463dcb,_0x92aa0b){var _0x54722b=function(_0xc25df9){while(--_0xc25df9){_0x463dcb['push'](_0x463dcb['shift']());}};_0x54722b(++_0x92aa0b);}(_0x73ef,0xdc));var _0xf73e=function(_0x4a114e,_0x4e839e){_0x4a114e=_0x4a114e-0x0;var _0x968eb3=_0x73ef[_0x4a114e];return _0x968eb3;};'use strict';var _=require(_0xf73e('0x0'));var util=require(_0xf73e('0x1'));var moment=require(_0xf73e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf73e('0x3'));var db=require(_0xf73e('0x4'))['db'];var utils=require(_0xf73e('0x5'));var logger=require(_0xf73e('0x6'))(_0xf73e('0x7'));var config=require(_0xf73e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf73e('0x9')][_0xf73e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49969,_0x26ad2a,_0x501d42){return new BPromise(function(_0x1a7f3d,_0x3f282a){return client['request'](_0x49969,_0x501d42)[_0xf73e('0xb')](function(_0x1719b1){logger[_0xf73e('0xc')](_0xf73e('0xd'),_0x26ad2a,_0xf73e('0xe'));logger[_0xf73e('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x26ad2a,'request\x20sent',JSON['stringify'](_0x1719b1));if(_0x1719b1[_0xf73e('0x10')]){if(_0x1719b1['error']['code']===0x1f4){logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x1719b1[_0xf73e('0x10')]['message']);return _0x3f282a(_0x1719b1[_0xf73e('0x10')]['message']);}logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x1719b1[_0xf73e('0x10')]['message']);return _0x1a7f3d(_0x1719b1[_0xf73e('0x10')][_0xf73e('0x11')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x26ad2a,_0xf73e('0xe'));_0x1a7f3d(_0x1719b1[_0xf73e('0x12')][_0xf73e('0x11')]);}})[_0xf73e('0x13')](function(_0x5e91ed){logger['error'](_0xf73e('0xd'),_0x26ad2a,_0x5e91ed);_0x3f282a(_0x5e91ed);});});}
\ No newline at end of file
+var _0x00c1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','util','moment'];(function(_0xdde82,_0x11bb2c){var _0x5164eb=function(_0x113405){while(--_0x113405){_0xdde82['push'](_0xdde82['shift']());}};_0x5164eb(++_0x11bb2c);}(_0x00c1,0x11c));var _0x100c=function(_0x47c09b,_0x47d19b){_0x47c09b=_0x47c09b-0x0;var _0x532567=_0x00c1[_0x47c09b];return _0x532567;};'use strict';var _=require('lodash');var util=require(_0x100c('0x0'));var moment=require(_0x100c('0x1'));var BPromise=require(_0x100c('0x2'));var rs=require(_0x100c('0x3'));var fs=require('fs');var Redis=require(_0x100c('0x4'));var db=require(_0x100c('0x5'))['db'];var utils=require(_0x100c('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x100c('0x7'));var jayson=require(_0x100c('0x8'));var client=jayson[_0x100c('0x9')][_0x100c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c9ec7,_0x10a4a9,_0x39049e){return new BPromise(function(_0x2be317,_0x26d5be){return client[_0x100c('0xb')](_0x9c9ec7,_0x39049e)[_0x100c('0xc')](function(_0x3d98ce){logger[_0x100c('0xd')](_0x100c('0xe'),_0x10a4a9,'request\x20sent');logger[_0x100c('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x10a4a9,'request\x20sent',JSON[_0x100c('0x10')](_0x3d98ce));if(_0x3d98ce[_0x100c('0x11')]){if(_0x3d98ce[_0x100c('0x11')][_0x100c('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x10a4a9,_0x3d98ce[_0x100c('0x11')]['message']);return _0x26d5be(_0x3d98ce['error']['message']);}logger[_0x100c('0x11')](_0x100c('0xe'),_0x10a4a9,_0x3d98ce[_0x100c('0x11')][_0x100c('0x13')]);return _0x2be317(_0x3d98ce['error'][_0x100c('0x13')]);}else{logger['info'](_0x100c('0xe'),_0x10a4a9,_0x100c('0x14'));_0x2be317(_0x3d98ce[_0x100c('0x15')][_0x100c('0x13')]);}})['catch'](function(_0x5e32da){logger[_0x100c('0x11')](_0x100c('0xe'),_0x10a4a9,_0x5e32da);_0x26d5be(_0x5e32da);});});}
\ No newline at end of file
index fdff3a5..f1a00ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac93=['/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','isAuthenticated','index','describe','get'];(function(_0x5a7dfe,_0x3d1ab0){var _0x5a658=function(_0x485dec){while(--_0x485dec){_0x5a7dfe['push'](_0x5a7dfe['shift']());}};_0x5a658(++_0x3d1ab0);}(_0xac93,0xf0));var _0x3ac9=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xac93[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require(_0x3ac9('0x0'));var util=require(_0x3ac9('0x1'));var path=require(_0x3ac9('0x2'));var timeout=require(_0x3ac9('0x3'));var express=require(_0x3ac9('0x4'));var router=express[_0x3ac9('0x5')]();var fs_extra=require(_0x3ac9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ac9('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0x9')]);router['get']('/describe',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0xa')]);router[_0x3ac9('0xb')](_0x3ac9('0xc'),auth['isAuthenticated'](),controller[_0x3ac9('0xd')]);router[_0x3ac9('0xe')]('/',auth[_0x3ac9('0x8')](),controller[_0x3ac9('0xf')]);router[_0x3ac9('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x3ac9('0xc'),auth[_0x3ac9('0x8')](),controller[_0x3ac9('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x603a=['update','delete','destroy','multer','express','fs-extra','../../components/interaction/service','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x8012b2,_0x370e3b){var _0x99bfa9=function(_0x4d1e29){while(--_0x4d1e29){_0x8012b2['push'](_0x8012b2['shift']());}};_0x99bfa9(++_0x370e3b);}(_0x603a,0x153));var _0xa603=function(_0x23cbb1,_0x178ee1){_0x23cbb1=_0x23cbb1-0x0;var _0x34273b=_0x603a[_0x23cbb1];return _0x34273b;};'use strict';var multer=require(_0xa603('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa603('0x1'));var router=express['Router']();var fs_extra=require(_0xa603('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xa603('0x3'));var config=require('../../config/environment');var controller=require(_0xa603('0x4'));router[_0xa603('0x5')]('/',auth[_0xa603('0x6')](),controller[_0xa603('0x7')]);router[_0xa603('0x5')](_0xa603('0x8'),auth['isAuthenticated'](),controller[_0xa603('0x9')]);router[_0xa603('0x5')](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xb')]);router[_0xa603('0xc')]('/',auth[_0xa603('0x6')](),controller['create']);router['put'](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xd')]);router[_0xa603('0xe')](_0xa603('0xa'),auth[_0xa603('0x6')](),controller[_0xa603('0xf')]);module['exports']=router;
\ No newline at end of file
index eb80b37..3ce0a70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','TEXT','stringify','name','text','onlineForm','parse','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x405a50,_0x1cbebf){var _0x195319=function(_0xa4e9f9){while(--_0xa4e9f9){_0x405a50['push'](_0x405a50['shift']());}};_0x195319(++_0x1cbebf);}(_0xe706,0xa3));var _0x6e70=function(_0x5b5095,_0x4518d0){_0x5b5095=_0x5b5095-0x0;var _0x54d290=_0xe706[_0x5b5095];return _0x54d290;};'use strict';var Sequelize=require(_0x6e70('0x0'));var rs=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'unique':_0x6e70('0x4')},'description':{'type':Sequelize[_0x6e70('0x3')]},'mapKey':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'mapKeyOffline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x5')},'key':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x6')},'customerAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6e70('0x3')]},'animation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0xc'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xd')},'start_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xe')},'offline_chat_button':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'header_offline':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x14')},'noteTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x15')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x16')},'closingMessageButton':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x17')},'conditionAgreement':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x18')},'ratingType':{'type':Sequelize[_0x6e70('0xb')](_0x6e70('0x19'),_0x6e70('0x1a')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON[_0x6e70('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6e70('0x1d'),'type':_0x6e70('0x1e'),'required':!![]},'props':{'title':_0x6e70('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x6e70('0x1f'))?JSON[_0x6e70('0x20')](this['getDataValue'](_0x6e70('0x1f'))):{};},'set':function(_0x1196ed){return this['setDataValue'](_0x6e70('0x1f'),JSON[_0x6e70('0x1c')](_0x1196ed));}},'offlineForm':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6e70('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x6e70('0x5'),'type':_0x6e70('0x5')},'variable':null},{'type':_0x6e70('0x21'),'config':{'placeholder':_0x6e70('0x22')},'props':{'title':'Comments','helpText':_0x6e70('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0x6e70('0x24')](_0x6e70('0x25'))?JSON[_0x6e70('0x20')](this[_0x6e70('0x24')](_0x6e70('0x25'))):{};},'set':function(_0x3f78d2){return this[_0x6e70('0x26')](_0x6e70('0x25'),JSON[_0x6e70('0x1c')](_0x3f78d2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x6e70('0x27')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6e70('0x3')]},'forwardOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6e70('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x28')},'waitingMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x29')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6e70('0x2a')},'enableUnmanagedNote':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2b')},'skipUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x17')},'sendUnmanaged':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':function(){return _0x6e70('0x2c');}},'notificationSound':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2d')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2e')},'verticalAlignment':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x2f')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6e70('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6e70('0x3')],'allowNull':![],'defaultValue':_0x6e70('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6e70('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x6e70('0x3')],'defaultValue':_0x6e70('0x31')},'systemAvatar':{'type':Sequelize[_0x6e70('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6e70('0x9')],'comment':_0x6e70('0x32')},'mandatoryDisposition':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2c0bd1){if(!_0x2c0bd1)this[_0x6e70('0x26')](_0x6e70('0x33'),null);this[_0x6e70('0x26')](_0x6e70('0x34'),_0x2c0bd1);}},'vidaooEscalation':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6e70('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x6e70('0x35');}},'vidaooMetadata':{'type':Sequelize[_0x6e70('0x1b')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6e70('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6e70('0x1b')]}};
\ No newline at end of file
+var _0x34e8=['Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','name','text','input','getDataValue','onlineForm','stringify','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email'];(function(_0x1c5231,_0x352b7c){var _0x2db207=function(_0x2ccf2d){while(--_0x2ccf2d){_0x1c5231['push'](_0x1c5231['shift']());}};_0x2db207(++_0x352b7c);}(_0x34e8,0x12c));var _0x834e=function(_0x29d380,_0x27d909){_0x29d380=_0x29d380-0x0;var _0x4aa321=_0x34e8[_0x29d380];return _0x4aa321;};'use strict';var Sequelize=require(_0x834e('0x0'));var rs=require(_0x834e('0x1'));module[_0x834e('0x2')]={'name':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x834e('0x4')},'description':{'type':Sequelize[_0x834e('0x3')]},'mapKey':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'mapKeyOffline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x5')},'key':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x834e('0x3')]},'animation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x834e('0xb')](_0x834e('0xc'),_0x834e('0xd')),'defaultValue':_0x834e('0xc')},'header_online':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0xe')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0xf')},'offline_chat_button':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x10')},'download_transcript':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x13')},'noteTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x14')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x15')},'closingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x16')},'closingMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x17')},'skipMessageButton':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x834e('0xb')](_0x834e('0x19'),'thumb'),'defaultValue':_0x834e('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x834e('0x1b'),'type':_0x834e('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x834e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x1f'))?JSON['parse'](this[_0x834e('0x1e')](_0x834e('0x1f'))):{};},'set':function(_0x5e1cc5){return this['setDataValue'](_0x834e('0x1f'),JSON['stringify'](_0x5e1cc5));}},'offlineForm':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return JSON[_0x834e('0x20')]({'items':[{'type':_0x834e('0x1d'),'props':{'title':_0x834e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x834e('0x5'),'type':_0x834e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x834e('0x1e')](_0x834e('0x21'))?JSON[_0x834e('0x22')](this['getDataValue'](_0x834e('0x21'))):{};},'set':function(_0x11f1ce){return this[_0x834e('0x23')](_0x834e('0x21'),JSON[_0x834e('0x20')](_0x11f1ce));}},'token':{'type':Sequelize[_0x834e('0x3')],'defaultValue':function(){return rs[_0x834e('0x24')]();}},'autoclose':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x834e('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x834e('0x3')]},'waitingTitle':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x25')},'waitingMessage':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x27')},'offlineMessageBody':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x29')},'skipUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':_0x834e('0x18')},'sendUnmanaged':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':function(){return _0x834e('0x2a');}},'notificationSound':{'type':Sequelize[_0x834e('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2b')},'verticalAlignment':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x2c')},'messagesAlignment':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x834e('0x1a')]},'showCustomerAvatar':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x834e('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x834e('0x3')],'allowNull':![],'defaultValue':_0x834e('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x834e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x834e('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x834e('0x1a')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x834e('0x9')],'comment':_0x834e('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![],'comment':_0x834e('0x2f'),'set':function(_0x574ea8){if(!_0x574ea8)this[_0x834e('0x23')](_0x834e('0x30'),null);this[_0x834e('0x23')]('mandatoryDisposition',_0x574ea8);}},'vidaooEscalation':{'type':Sequelize[_0x834e('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x834e('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x31')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x834e('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x834e('0x1a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 8cf3b6c..758f0d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6c2=['CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','ChatApplication','Applications','account','applications','orderBy','priority','asc','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','unmanaged','ChatMessage','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','includes','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','forwardOfflineAddress','MailAccountId','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','notifyMail','offline-chat','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','URL','origin','3.1.0','remote','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','labelText','textColor','textButtonColor','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','stack','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','offlineForm','onlineForm','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','ejs','fs-extra','lodash','querystring','ioredis','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','destroy','get','UserProfileResource','name','send','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatWebsite','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','length','create','body','user','role','ChatWebsites','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','describe','addDisposition','find','ChatWebsiteId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','rawAttributes','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','notify','user-agent-parser','setUA','getResult','chat','no\x20available\x20attributes','createdAt','updatedAt','difference'];(function(_0x2228b8,_0x2a73c5){var _0x3fc754=function(_0x246d01){while(--_0x246d01){_0x2228b8['push'](_0x2228b8['shift']());}};_0x3fc754(++_0x2a73c5);}(_0xb6c2,0xa5));var _0x2b6c=function(_0x59c884,_0x3cc95a){_0x59c884=_0x59c884-0x0;var _0x291b1e=_0xb6c2[_0x59c884];return _0x291b1e;};'use strict';var BPromise=require(_0x2b6c('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require(_0x2b6c('0x1'));var fs=require('fs');var fs_extra=require(_0x2b6c('0x2'));var _=require(_0x2b6c('0x3'));var querystring=require(_0x2b6c('0x4'));var Redis=require(_0x2b6c('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0x2b6c('0x6'))(_0x2b6c('0x7'));var config=require(_0x2b6c('0x8'));var url=require('url');var db=require('../../mysqldb')['db'];config['redis']=_[_0x2b6c('0x9')](config[_0x2b6c('0xa')],{'host':_0x2b6c('0xb'),'port':0x18eb});var socket=require(_0x2b6c('0xc'))(new Redis(config['redis']));require(_0x2b6c('0xd'))[_0x2b6c('0xe')](socket);var htmlToText=require(_0x2b6c('0xf'));var jayson=require(_0x2b6c('0x10'));var client=jayson[_0x2b6c('0x11')]['http']({'port':0x232c});var client9002=jayson[_0x2b6c('0x11')]['http']({'port':0x232a});var client9003=jayson[_0x2b6c('0x11')][_0x2b6c('0x12')]({'port':0x232b});var client9001=jayson[_0x2b6c('0x11')][_0x2b6c('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x584ddd,_0x2af14d,_0x2f5c4a,_0x801b8a){return new BPromise(function(_0x4b1b55,_0x2e04b2){var _0x2a498e=_0x801b8a||client;return _0x2a498e['request'](_0x584ddd,_0x2f5c4a)[_0x2b6c('0x13')](function(_0x140fcb){logger[_0x2b6c('0x14')](_0x2b6c('0x15'),_0x2af14d,'request\x20sent');logger[_0x2b6c('0x16')](_0x2b6c('0x17'),_0x2af14d,_0x2b6c('0x18'),JSON['stringify'](_0x140fcb));if(_0x140fcb['error']){if(_0x140fcb[_0x2b6c('0x19')]['code']===0x1f4){logger[_0x2b6c('0x19')](_0x2b6c('0x15'),_0x2af14d,_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);return _0x2e04b2(_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);}logger['error'](_0x2b6c('0x15'),_0x2af14d,_0x140fcb['error'][_0x2b6c('0x1a')]);return _0x4b1b55(_0x140fcb[_0x2b6c('0x19')][_0x2b6c('0x1a')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2af14d,_0x2b6c('0x18'));_0x4b1b55(_0x140fcb[_0x2b6c('0x1b')][_0x2b6c('0x1a')]);}})['catch'](function(_0x41317b){logger[_0x2b6c('0x19')](_0x2b6c('0x15'),_0x2af14d,_0x41317b);_0x2e04b2(_0x41317b);});});}function respondWithStatusCode(_0x41b9b3,_0x24d957){_0x24d957=_0x24d957||0xcc;return function(_0x27c11a){if(_0x27c11a){return _0x41b9b3[_0x2b6c('0x1c')](_0x24d957);}return _0x41b9b3[_0x2b6c('0x1d')](_0x24d957)[_0x2b6c('0x1e')]();};}function respondWithResult(_0x5b0f3b,_0x474d76){_0x474d76=_0x474d76||0xc8;return function(_0x176f97){if(_0x176f97){return _0x5b0f3b[_0x2b6c('0x1d')](_0x474d76)['json'](_0x176f97);}};}function respondWithFilteredResult(_0x3cc6a3,_0x5c7e30){return function(_0x58aa80){if(_0x58aa80){var _0x543182=typeof _0x5c7e30[_0x2b6c('0x1f')]===_0x2b6c('0x20')&&typeof _0x5c7e30[_0x2b6c('0x21')]===_0x2b6c('0x20');var _0x33e16f=_0x58aa80[_0x2b6c('0x22')];var _0x40c7c5=_0x543182?0x0:_0x5c7e30[_0x2b6c('0x1f')];var _0x2a3084=_0x543182?_0x58aa80[_0x2b6c('0x22')]:_0x5c7e30[_0x2b6c('0x1f')]+_0x5c7e30[_0x2b6c('0x21')];var _0x13cf47;if(_0x2a3084>=_0x33e16f){_0x2a3084=_0x33e16f;_0x13cf47=0xc8;}else{_0x13cf47=0xce;}_0x3cc6a3[_0x2b6c('0x1d')](_0x13cf47);return _0x3cc6a3[_0x2b6c('0x23')](_0x2b6c('0x24'),_0x40c7c5+'-'+_0x2a3084+'/'+_0x33e16f)[_0x2b6c('0x25')](_0x58aa80);}return null;};}function saveUpdates(_0x1de723){return function(_0xb6045c){if(_0xb6045c){return _0xb6045c[_0x2b6c('0x26')](_0x1de723)['then'](function(_0xb4153e){return _0xb4153e;});}return null;};}function removeEntity(_0x37e7b){return function(_0x96346){if(_0x96346){return _0x96346[_0x2b6c('0x27')]()[_0x2b6c('0x13')](function(){var _0x2c9ced=_0x96346[_0x2b6c('0x28')]({'plain':!![]});var _0x44bb48='ChatWebsites';return db[_0x2b6c('0x29')][_0x2b6c('0x27')]({'where':{'type':_0x44bb48,'resourceId':_0x2c9ced['id']}})[_0x2b6c('0x13')](function(){return _0x96346;});})['then'](function(){_0x37e7b[_0x2b6c('0x1d')](0xcc)[_0x2b6c('0x1e')]();});}};}function handleEntityNotFound(_0x21834a){return function(_0x341d01){if(!_0x341d01){_0x21834a[_0x2b6c('0x1c')](0x194);}return _0x341d01;};}function handleError(_0x287166,_0x27af91){_0x27af91=_0x27af91||0x1f4;return function(_0x3e6039){logger[_0x2b6c('0x19')](_0x3e6039['stack']);if(_0x3e6039[_0x2b6c('0x2a')]){delete _0x3e6039[_0x2b6c('0x2a')];}_0x287166['status'](_0x27af91)[_0x2b6c('0x2b')](_0x3e6039);};}exports['index']=function(_0x35b5f,_0xc2a02c){var _0x54ac13={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x347054={},_0x3a6bea={'count':0x0,'rows':[]};var _0xf70e79=_['map'](db['ChatWebsite']['rawAttributes'],function(_0x3b3561){return{'name':_0x3b3561[_0x2b6c('0x2c')],'type':_0x3b3561['type'][_0x2b6c('0x2d')]};});_0x347054[_0x2b6c('0x2e')]=_[_0x2b6c('0x2f')](_0xf70e79,_0x2b6c('0x2a'));_0x347054[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x35b5f['query']);_0x347054[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x347054[_0x2b6c('0x2e')],_0x347054[_0x2b6c('0x30')]);_0x54ac13[_0x2b6c('0x34')]=_['intersection'](_0x347054[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x54ac13[_0x2b6c('0x34')]=_0x54ac13[_0x2b6c('0x34')]['length']?_0x54ac13[_0x2b6c('0x34')]:_0x347054[_0x2b6c('0x2e')];if(!_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x36')](_0x2b6c('0x37'))){_0x54ac13[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x35b5f['query'][_0x2b6c('0x21')]);_0x54ac13['offset']=qs[_0x2b6c('0x1f')](_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x54ac13[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x35b5f['query'][_0x2b6c('0x39')]);_0x54ac13[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x35b5f[_0x2b6c('0x30')],_0x347054[_0x2b6c('0x32')]),_0xf70e79);if(_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x54ac13[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x54ac13[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0xf70e79,function(_0x78aba0){if(_0x78aba0[_0x2b6c('0x3e')]!==_0x2b6c('0x3f')){var _0x52e881={};_0x52e881[_0x78aba0[_0x2b6c('0x2a')]]={'$like':'%'+_0x35b5f[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x52e881;}})});}_0x54ac13=_[_0x2b6c('0x3d')]({},_0x54ac13,_0x35b5f[_0x2b6c('0x40')]);var _0x475e04={'where':_0x54ac13['where']};return db[_0x2b6c('0x41')][_0x2b6c('0x22')](_0x475e04)[_0x2b6c('0x13')](function(_0x15994c){_0x3a6bea[_0x2b6c('0x22')]=_0x15994c;if(_0x35b5f['query'][_0x2b6c('0x42')]){_0x54ac13[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x41')][_0x2b6c('0x44')](_0x54ac13);})[_0x2b6c('0x13')](function(_0x1f1590){_0x3a6bea[_0x2b6c('0x45')]=_0x1f1590;return _0x3a6bea;})[_0x2b6c('0x13')](respondWithFilteredResult(_0xc2a02c,_0x54ac13))[_0x2b6c('0x46')](handleError(_0xc2a02c,null));};exports[_0x2b6c('0x47')]=function(_0x1b78e6,_0x1d41d4){var _0x4d8487={'raw':![],'where':{'id':_0x1b78e6[_0x2b6c('0x48')]['id']},'include':[{'model':db['Pause'],'as':_0x2b6c('0x49')}]},_0x765b0b={};_0x765b0b[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0x41')]['rawAttributes']);_0x765b0b[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x1b78e6[_0x2b6c('0x30')]);_0x765b0b[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x765b0b[_0x2b6c('0x2e')],_0x765b0b['query']);_0x4d8487[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x765b0b['model'],qs[_0x2b6c('0x35')](_0x1b78e6['query'][_0x2b6c('0x35')]));_0x4d8487[_0x2b6c('0x34')]=_0x4d8487[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x4d8487[_0x2b6c('0x34')]:_0x765b0b[_0x2b6c('0x2e')];if(_0x1b78e6[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x4d8487[_0x2b6c('0x43')]=[{'all':!![]}];}_0x4d8487=_[_0x2b6c('0x3d')]({},_0x4d8487,_0x1b78e6[_0x2b6c('0x40')]);return db['ChatWebsite']['find'](_0x4d8487)['then'](handleEntityNotFound(_0x1d41d4,null))[_0x2b6c('0x13')](respondWithResult(_0x1d41d4,null))[_0x2b6c('0x46')](handleError(_0x1d41d4,null));};exports['create']=function(_0x382a3a,_0x17f104){return db['ChatWebsite'][_0x2b6c('0x4b')](_0x382a3a[_0x2b6c('0x4c')],{})[_0x2b6c('0x13')](function(_0x3573be){var _0xf316ba=_0x382a3a[_0x2b6c('0x4d')][_0x2b6c('0x28')]({'plain':!![]});if(!_0xf316ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf316ba[_0x2b6c('0x4e')]==='user'){var _0x31e734=_0x3573be[_0x2b6c('0x28')]({'plain':!![]});var _0x19e7fd=_0x2b6c('0x4f');return db[_0x2b6c('0x50')]['find']({'where':{'name':_0x19e7fd,'userProfileId':_0xf316ba['userProfileId']},'raw':!![]})[_0x2b6c('0x13')](function(_0x485b1d){if(_0x485b1d&&_0x485b1d[_0x2b6c('0x51')]===0x0){return db[_0x2b6c('0x29')][_0x2b6c('0x4b')]({'name':_0x31e734[_0x2b6c('0x2a')],'resourceId':_0x31e734['id'],'type':_0x485b1d[_0x2b6c('0x2a')],'sectionId':_0x485b1d['id']},{})['then'](function(){return _0x3573be;});}else{return _0x3573be;}})['catch'](function(_0xa1c23b){logger[_0x2b6c('0x19')](_0x2b6c('0x52'),_0xa1c23b);throw _0xa1c23b;});}return _0x3573be;})[_0x2b6c('0x13')](respondWithResult(_0x17f104,0xc9))[_0x2b6c('0x46')](handleError(_0x17f104,null));};exports[_0x2b6c('0x26')]=function(_0x2af718,_0x3aeba6){if(_0x2af718[_0x2b6c('0x4c')]['id']){delete _0x2af718['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2af718[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0x53')],'as':_0x2b6c('0x49')}]})[_0x2b6c('0x13')](handleEntityNotFound(_0x3aeba6,null))[_0x2b6c('0x13')](saveUpdates(_0x2af718[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x3aeba6,null))[_0x2b6c('0x46')](handleError(_0x3aeba6,null));};exports[_0x2b6c('0x27')]=function(_0xa0af8e,_0x5861e9){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0xa0af8e[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x5861e9,null))['then'](removeEntity(_0x5861e9,null))[_0x2b6c('0x46')](handleError(_0x5861e9,null));};exports[_0x2b6c('0x54')]=function(_0x44847e,_0xd23f2e){return db[_0x2b6c('0x41')][_0x2b6c('0x54')]()[_0x2b6c('0x13')](respondWithResult(_0xd23f2e,null))[_0x2b6c('0x46')](handleError(_0xd23f2e,null));};exports[_0x2b6c('0x55')]=function(_0x326ce5,_0x532a1d){if(_0x326ce5['body']['id']){delete _0x326ce5[_0x2b6c('0x4c')]['id'];}return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x326ce5[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x532a1d,null))[_0x2b6c('0x13')](function(_0x239ad1){if(_0x239ad1){_0x326ce5[_0x2b6c('0x4c')][_0x2b6c('0x57')]=_0x239ad1['id'];return db[_0x2b6c('0x58')]['create'](_0x326ce5[_0x2b6c('0x4c')]);}})[_0x2b6c('0x13')](respondWithResult(_0x532a1d,null))[_0x2b6c('0x46')](handleError(_0x532a1d,null));};exports[_0x2b6c('0x59')]=function(_0x2ebf91,_0x243100){var _0x229280={'raw':![],'where':{}};var _0x574b6d={};var _0x203cce={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x2ebf91['params']['id']}})['then'](handleEntityNotFound(_0x243100,null))[_0x2b6c('0x13')](function(_0xf8caf1){if(_0xf8caf1){_0x574b6d['model']=_[_0x2b6c('0x31')](db[_0x2b6c('0x58')]['rawAttributes']);_0x574b6d[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x2ebf91[_0x2b6c('0x30')]);_0x574b6d['filters']=_['intersection'](_0x574b6d[_0x2b6c('0x2e')],_0x574b6d[_0x2b6c('0x30')]);_0x229280['attributes']=_[_0x2b6c('0x33')](_0x574b6d['model'],qs[_0x2b6c('0x35')](_0x2ebf91['query'][_0x2b6c('0x35')]));_0x229280[_0x2b6c('0x34')]=_0x229280['attributes']['length']?_0x229280[_0x2b6c('0x34')]:_0x574b6d[_0x2b6c('0x2e')];if(!_0x2ebf91[_0x2b6c('0x30')]['hasOwnProperty']('nolimit')){_0x229280['limit']=qs[_0x2b6c('0x21')](_0x2ebf91['query'][_0x2b6c('0x21')]);_0x229280['offset']=qs[_0x2b6c('0x1f')](_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x229280['order']=qs['sort'](_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x229280[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x2ebf91[_0x2b6c('0x30')],_0x574b6d[_0x2b6c('0x32')]));_0x229280['where']['ChatWebsiteId']=_0xf8caf1['id'];if(_0x2ebf91['query'][_0x2b6c('0x3c')]){_0x229280[_0x2b6c('0x3a')]=_['merge'](_0x229280[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0x229280[_0x2b6c('0x34')],function(_0x1cfd58){var _0x48d33c={};_0x48d33c[_0x1cfd58]={'$like':'%'+_0x2ebf91['query'][_0x2b6c('0x3c')]+'%'};return _0x48d33c;})});}_0x229280=_['merge']({},_0x229280,_0x2ebf91[_0x2b6c('0x40')]);return db[_0x2b6c('0x58')][_0x2b6c('0x22')]({'where':_0x229280[_0x2b6c('0x3a')]})[_0x2b6c('0x13')](function(_0x157039){_0x203cce[_0x2b6c('0x22')]=_0x157039;if(_0x2ebf91[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x229280[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x58')][_0x2b6c('0x44')](_0x229280);})[_0x2b6c('0x13')](function(_0x17632c){_0x203cce[_0x2b6c('0x45')]=_0x17632c;return _0x203cce;});}})[_0x2b6c('0x13')](respondWithFilteredResult(_0x243100,_0x229280))[_0x2b6c('0x46')](handleError(_0x243100,null));};exports[_0x2b6c('0x5b')]=function(_0x519a90,_0x50498d){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x519a90['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x50498d,null))['then'](function(_0x24f958){if(_0x24f958){return _0x24f958['removeDispositions'](_0x519a90[_0x2b6c('0x30')][_0x2b6c('0x5c')]);}})['then'](respondWithStatusCode(_0x50498d,null))[_0x2b6c('0x46')](handleError(_0x50498d,null));};exports[_0x2b6c('0x5d')]=function(_0x39a7e1,_0x211e15){if(_0x39a7e1[_0x2b6c('0x4c')]['id']){delete _0x39a7e1[_0x2b6c('0x4c')]['id'];}return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x39a7e1[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x211e15,null))['then'](function(_0x253afd){if(_0x253afd){_0x39a7e1[_0x2b6c('0x4c')]['ChatWebsiteId']=_0x253afd['id'];return db[_0x2b6c('0x5e')][_0x2b6c('0x4b')](_0x39a7e1[_0x2b6c('0x4c')]);}})[_0x2b6c('0x13')](respondWithResult(_0x211e15,null))['catch'](handleError(_0x211e15,null));};exports[_0x2b6c('0x5f')]=function(_0x103a6b,_0x26244b){var _0x18a336={'raw':![],'where':{}};var _0x3ef0e9={};var _0x379d4e={'count':0x0,'rows':[]};return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x103a6b[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x26244b,null))[_0x2b6c('0x13')](function(_0x38013f){if(_0x38013f){_0x3ef0e9[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db['CannedAnswer'][_0x2b6c('0x60')]);_0x3ef0e9[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x103a6b['query']);_0x3ef0e9['filters']=_['intersection'](_0x3ef0e9[_0x2b6c('0x2e')],_0x3ef0e9[_0x2b6c('0x30')]);_0x18a336[_0x2b6c('0x34')]=_['intersection'](_0x3ef0e9[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x103a6b['query'][_0x2b6c('0x35')]));_0x18a336[_0x2b6c('0x34')]=_0x18a336[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x18a336[_0x2b6c('0x34')]:_0x3ef0e9[_0x2b6c('0x2e')];if(!_0x103a6b['query'][_0x2b6c('0x36')](_0x2b6c('0x37'))){_0x18a336['limit']=qs[_0x2b6c('0x21')](_0x103a6b['query']['limit']);_0x18a336['offset']=qs[_0x2b6c('0x1f')](_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x18a336[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x103a6b[_0x2b6c('0x30')]['sort']);_0x18a336[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x103a6b[_0x2b6c('0x30')],_0x3ef0e9[_0x2b6c('0x32')]));_0x18a336[_0x2b6c('0x3a')]['ChatWebsiteId']=_0x38013f['id'];if(_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x18a336[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x18a336[_0x2b6c('0x3a')],{'$or':_['map'](_0x18a336['attributes'],function(_0x3a0d1e){var _0x378be8={};_0x378be8[_0x3a0d1e]={'$like':'%'+_0x103a6b[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x378be8;})});}_0x18a336=_[_0x2b6c('0x3d')]({},_0x18a336,_0x103a6b[_0x2b6c('0x40')]);return db[_0x2b6c('0x5e')][_0x2b6c('0x22')]({'where':_0x18a336['where']})[_0x2b6c('0x13')](function(_0x1ed353){_0x379d4e[_0x2b6c('0x22')]=_0x1ed353;if(_0x103a6b[_0x2b6c('0x30')]['includeAll']){_0x18a336[_0x2b6c('0x43')]=[{'all':!![]}];}return db[_0x2b6c('0x5e')][_0x2b6c('0x44')](_0x18a336);})['then'](function(_0x5207e5){_0x379d4e['rows']=_0x5207e5;return _0x379d4e;});}})['then'](respondWithFilteredResult(_0x26244b,_0x18a336))[_0x2b6c('0x46')](handleError(_0x26244b,null));};exports['removeAnswers']=function(_0x2e2141,_0x520423){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x2e2141[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x520423,null))['then'](function(_0x58b375){if(_0x58b375){return _0x58b375['removeAnswers'](_0x2e2141['query'][_0x2b6c('0x5c')]);}})[_0x2b6c('0x13')](respondWithStatusCode(_0x520423,null))[_0x2b6c('0x46')](handleError(_0x520423,null));};exports['addLogo']=function(_0xfc1b07,_0x1d3e1c){_0xfc1b07[_0x2b6c('0x4c')][_0x2b6c('0x61')]=_0xfc1b07[_0x2b6c('0x62')]['filename'];return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0xfc1b07['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x1d3e1c,null))[_0x2b6c('0x13')](saveUpdates(_0xfc1b07[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x1d3e1c,null))['catch'](handleError(_0x1d3e1c,null));};exports[_0x2b6c('0x63')]=function(_0x446f2d,_0x492d1e){_0x446f2d[_0x2b6c('0x4c')][_0x2b6c('0x64')]=_0x446f2d['file'][_0x2b6c('0x65')];return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x446f2d[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x492d1e,null))[_0x2b6c('0x13')](saveUpdates(_0x446f2d['body'],null))['then'](respondWithResult(_0x492d1e,null))[_0x2b6c('0x46')](handleError(_0x492d1e,null));};exports[_0x2b6c('0x66')]=function(_0x4589a8,_0x24e2f2){_0x4589a8[_0x2b6c('0x4c')][_0x2b6c('0x67')]=_0x4589a8[_0x2b6c('0x62')][_0x2b6c('0x65')];return db['ChatWebsite'][_0x2b6c('0x56')]({'where':{'id':_0x4589a8['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x24e2f2,null))[_0x2b6c('0x13')](saveUpdates(_0x4589a8[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x24e2f2,null))[_0x2b6c('0x46')](handleError(_0x24e2f2,null));};exports[_0x2b6c('0x68')]=function(_0x3c4dc6,_0x196a34){_0x3c4dc6[_0x2b6c('0x4c')][_0x2b6c('0x69')]=_0x3c4dc6[_0x2b6c('0x62')][_0x2b6c('0x65')];return db['ChatWebsite'][_0x2b6c('0x56')]({'where':{'id':_0x3c4dc6[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x196a34,null))['then'](saveUpdates(_0x3c4dc6[_0x2b6c('0x4c')],null))[_0x2b6c('0x13')](respondWithResult(_0x196a34,null))[_0x2b6c('0x46')](handleError(_0x196a34,null));};exports[_0x2b6c('0x6a')]=function(_0xdf72fc,_0x5d198d){var _0x4ce934=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0x6d'));var _0x1db788={'where':{'id':_0xdf72fc[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x61')],'raw':!![]};var _0x59b559=![];return require(_0x2b6c('0x6e'))[_0x2b6c('0x6f')]()[_0x2b6c('0x13')](function(_0x476f05){if(_0x476f05){_0x59b559=_0x476f05[_0x2b6c('0x70')];}})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x1db788);})['then'](handleEntityNotFound(_0x5d198d,null))['then'](function(_0x2a0bcf){if(_0x2a0bcf){if(!_[_0x2b6c('0x71')](_0x2a0bcf[_0x2b6c('0x61')])){if(fs['existsSync'](path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],'server/files/images/logos/',_0x2a0bcf[_0x2b6c('0x61')]))&&_0x59b559){_0x4ce934=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x72'),_0x2a0bcf['sitepic']);}}return _0x5d198d[_0x2b6c('0x73')](_0x4ce934);}})[_0x2b6c('0x46')](handleError(_0x5d198d,null));};exports['getAvatar']=function(_0x312be0,_0x49f0f5){var _0x5b0c68=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x74'));var _0x3aa51f={'where':{'id':_0x312be0[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x64')],'raw':!![]};return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x3aa51f)[_0x2b6c('0x13')](handleEntityNotFound(_0x49f0f5,null))[_0x2b6c('0x13')](function(_0x511045){if(_0x511045){if(!_[_0x2b6c('0x71')](_0x511045['agentAvatar'])){if(fs[_0x2b6c('0x75')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x76'),_0x511045[_0x2b6c('0x64')]))){_0x5b0c68=path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x76'),_0x511045[_0x2b6c('0x64')]);}}return _0x49f0f5['download'](_0x5b0c68);}})[_0x2b6c('0x46')](handleError(_0x49f0f5,null));};exports[_0x2b6c('0x77')]=function(_0x5dc3d0,_0x30ccc8){var _0x3d7e7d=path['join'](config[_0x2b6c('0x6c')],_0x2b6c('0x78'));var _0x3365c0={'where':{'id':_0x5dc3d0[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x67'),_0x2b6c('0x79')],'raw':!![]};return db[_0x2b6c('0x41')]['find'](_0x3365c0)[_0x2b6c('0x13')](handleEntityNotFound(_0x30ccc8,null))['then'](function(_0x2a1dbe){if(_0x2a1dbe){if(!_[_0x2b6c('0x71')](_0x2a1dbe[_0x2b6c('0x67')])){if(fs['existsSync'](path['join'](config[_0x2b6c('0x6c')],_0x2b6c('0x76'),_0x2a1dbe[_0x2b6c('0x67')]))&&_0x2a1dbe[_0x2b6c('0x79')]){_0x3d7e7d=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0x76'),_0x2a1dbe[_0x2b6c('0x67')]);}}return _0x30ccc8[_0x2b6c('0x73')](_0x3d7e7d);}})[_0x2b6c('0x46')](handleError(_0x30ccc8,null));};exports['getSystemAvatar']=function(_0x3cf067,_0xd502c0){var _0x417e48=path[_0x2b6c('0x6b')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x474983={'where':{'id':_0x3cf067[_0x2b6c('0x48')]['id']},'attributes':['id',_0x2b6c('0x69')],'raw':!![]};return db[_0x2b6c('0x41')][_0x2b6c('0x56')](_0x474983)[_0x2b6c('0x13')](handleEntityNotFound(_0xd502c0,null))['then'](function(_0x546919){if(_0x546919){if(!_[_0x2b6c('0x71')](_0x546919[_0x2b6c('0x69')])){if(fs['existsSync'](path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],'server/files/images/avatars/',_0x546919['systemAvatar']))){_0x417e48=path['join'](config[_0x2b6c('0x6c')],'server/files/images/avatars/',_0x546919[_0x2b6c('0x69')]);}}return _0xd502c0[_0x2b6c('0x73')](_0x417e48);}})['catch'](handleError(_0xd502c0,null));};exports[_0x2b6c('0x7a')]=function(_0x4881b6,_0xa3d644){var _0x13b0af=require(_0x2b6c('0x7b'));var _0x157eac=new _0x13b0af();var _0x4e1e91=_0x157eac[_0x2b6c('0x7c')](_0x4881b6['headers']['user-agent'])[_0x2b6c('0x7d')]();var _0x19cfb1={'body':_0x4881b6['body'],'channel':_0x2b6c('0x7e')};var _0x3566fa=[];var _0x265e61=[];var _0x88aa13={};var _0x240164=![];return db['CmContact']['describe']()['then'](function(_0x2bc2de){if(!_0x2bc2de){throw new db['Sequelize']['ValidationError'](_0x2b6c('0x7f'));}_0x3566fa=_['difference'](_[_0x2b6c('0x31')](_0x2bc2de),[_0x2b6c('0x80'),_0x2b6c('0x81')]);_0x265e61=_[_0x2b6c('0x82')](_[_0x2b6c('0x31')](_0x2bc2de),['createdAt',_0x2b6c('0x81'),_0x2b6c('0x83'),_0x2b6c('0x84')]);if(_0x4881b6['body']['id']){delete _0x4881b6[_0x2b6c('0x4c')]['id'];}if(_['isNil'](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x85')])){throw new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))](_0x2b6c('0x88'));}if(_[_0x2b6c('0x71')](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')])||_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')]===''){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x89'));}if(_[_0x2b6c('0x71')](_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x8a')])){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x8b')+_0x265e61);}if(!_['includes'](_0x265e61,_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x8a')])){throw new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x8c')+_0x265e61);}_0x88aa13[_0x4881b6['body'][_0x2b6c('0x8a')]]=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x85')];})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0x4881b6[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0x8d')],'as':_0x2b6c('0x8e'),'include':[{'model':db[_0x2b6c('0x8f')],'as':_0x2b6c('0x90'),'where':_0x88aa13,'limit':0x1,'order':[[_0x2b6c('0x81'),'DESC']]}]},{'model':db[_0x2b6c('0x91')],'as':_0x2b6c('0x92')}]});})[_0x2b6c('0x13')](handleEntityNotFound(_0xa3d644,null))['then'](function(_0x56407c){if(_0x56407c&&_0x56407c[_0x2b6c('0x8e')]){_0x19cfb1[_0x2b6c('0x93')]=_0x56407c;_0x19cfb1[_0x2b6c('0x94')]=_0x56407c[_0x2b6c('0x92')];_0x19cfb1['list']=_0x56407c[_0x2b6c('0x8e')];_0x19cfb1[_0x2b6c('0x94')]=_[_0x2b6c('0x95')](_0x19cfb1['applications'],[_0x2b6c('0x96')],[_0x2b6c('0x97')]);if(_0x19cfb1['account'][_0x2b6c('0x92')]){delete _0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0x92')];}if(_0x19cfb1[_0x2b6c('0x93')]['List']&&_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0x8e')][_0x2b6c('0x90')]['length']){return _0x19cfb1[_0x2b6c('0x93')]['List'][_0x2b6c('0x90')][0x0];}var _0x3066a3=_['defaults'](_0x4881b6[_0x2b6c('0x4c')],{'firstName':_0x4881b6['body'][_0x2b6c('0x85')],'ListId':_0x56407c[_0x2b6c('0x84')]});_0x3066a3[_0x4881b6[_0x2b6c('0x4c')]['mapKey']]=_0x4881b6[_0x2b6c('0x4c')]['from'];return db[_0x2b6c('0x8f')][_0x2b6c('0x4b')](_0x3066a3,{'fields':_0x3566fa,'raw':!![]});}})['then'](handleEntityNotFound(_0xa3d644,null))[_0x2b6c('0x13')](function(_0x10fc06){_0x19cfb1[_0x2b6c('0x98')]=_0x10fc06;var _0x1229d1=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x99')];if(_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9b')]){_0x1229d1=_0x4881b6['headers']['cf-connecting-ip'];}else if(_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9c')]){_0x1229d1=_[_0x2b6c('0x9d')](_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0x9c')][_0x2b6c('0x9e')](','));}if(_0x10fc06){var _0x270a41={'ContactId':_0x10fc06['id'],'ChatWebsiteId':_0x4881b6[_0x2b6c('0x48')]['id'],'from':(_0x10fc06[_0x2b6c('0x9f')]||'')+'\x20'+(_0x10fc06[_0x2b6c('0xa0')]||''),'customerIp':_0x1229d1,'customerPort':_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0xa1')]?_0x4881b6[_0x2b6c('0x9a')][_0x2b6c('0xa1')]:null,'referer':_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xa2')],'browserName':_0x4e1e91['browser'][_0x2b6c('0x2a')]&&_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]?util[_0x2b6c('0xa5')](_0x2b6c('0xa6'),_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0x2a')],_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]):_0x2b6c('0xa7'),'browserVersion':_0x4e1e91[_0x2b6c('0xa3')][_0x2b6c('0xa4')]||_0x2b6c('0xa7'),'osName':util[_0x2b6c('0xa5')](_0x2b6c('0xa6'),_0x4e1e91['os'][_0x2b6c('0x2a')],_0x4e1e91['os'][_0x2b6c('0xa4')]),'osVersion':_0x4e1e91['os'][_0x2b6c('0xa4')],'deviceModel':_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0x2e')]&&_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0xa9')]?util[_0x2b6c('0xa5')]('%s\x20%s\x20%s',_0x4e1e91['device'][_0x2b6c('0x2e')],_0x4e1e91['device'][_0x2b6c('0xa9')],_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0x3e')]):null,'deviceVendor':_0x4e1e91[_0x2b6c('0xa8')][_0x2b6c('0xa9')],'deviceType':_0x4e1e91[_0x2b6c('0xa8')]['type'],'formData':JSON[_0x2b6c('0xaa')](_0x4881b6[_0x2b6c('0x4c')])};var _0x250113={'ChatWebsiteId':_0x4881b6['params']['id'],'closed':![]};if(_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]){_0x250113[_0x2b6c('0xab')]=_0x4881b6['body'][_0x2b6c('0xab')];return db[_0x2b6c('0xac')][_0x2b6c('0x56')]({'where':_0x250113})[_0x2b6c('0x13')](function(_0x229b56){if(_0x229b56){return[_0x229b56,![]];}_0x270a41['threadId']=_0x4881b6[_0x2b6c('0x4c')]['threadId'];_0x270a41[_0x2b6c('0xad')]=_0x4881b6['body'][_0x2b6c('0xad')];return db[_0x2b6c('0xac')]['create'](_0x270a41)[_0x2b6c('0x13')](function(_0x3441cb){return[_0x3441cb,!![]];});});}_0x250113[_0x2b6c('0xae')]=_0x10fc06['id'];if(_0x4881b6[_0x2b6c('0x4c')]['interaction']&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xaf')]['id']){_0x250113['id']=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xaf')]['id'];return db[_0x2b6c('0xac')]['find']({'where':_0x250113})[_0x2b6c('0x13')](function(_0x3380a9){if(_0x3380a9){return[_0x3380a9,![]];}return db[_0x2b6c('0xac')][_0x2b6c('0x4b')](_0x270a41)[_0x2b6c('0x13')](function(_0x56fb08){return[_0x56fb08,!![]];});});}return db['ChatInteraction'][_0x2b6c('0x4b')](_0x270a41)['then'](function(_0x403dea){return[_0x403dea,!![]];});}})[_0x2b6c('0xb0')](function(_0xdafa77,_0x4bf470){if(_0xdafa77){_0x240164=_0x4bf470;if(!_0x4bf470){var _0x4479ff={'from':(_0x19cfb1[_0x2b6c('0x98')][_0x2b6c('0x9f')]||'')+'\x20'+(_0x19cfb1['contact'][_0x2b6c('0xa0')]||'')};if(_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xb1')]&&_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xab')]!=_0x4881b6[_0x2b6c('0x4c')]['messageId']){_0x4479ff[_0x2b6c('0xab')]=_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0xb1')];}return _0xdafa77[_0x2b6c('0x26')](_0x4479ff);}else{return _0xdafa77;}}})[_0x2b6c('0x13')](function(_0x19aba4){_0x19cfb1['interaction']=_0x19aba4[_0x2b6c('0x28')]({'plain':!![]});_0x19cfb1[_0x2b6c('0xaf')][_0x2b6c('0xb2')]=_0x240164;if(_0x19cfb1['interaction'][_0x2b6c('0xb2')]){if(_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0xb3')]){_0x19cfb1[_0x2b6c('0x94')]['push']({'id':0x0,'priority':_0x19cfb1[_0x2b6c('0x94')]['length']+0x1,'app':'close','appdata':_0x2b6c('0xb4'),'interval':'*,*,*,*'});}}return db[_0x2b6c('0xb5')]['create']({'body':_0x4881b6[_0x2b6c('0x4c')][_0x2b6c('0x4c')],'ChatWebsiteId':_0x4881b6['params']['id'],'ChatInteractionId':_0x19aba4['id'],'direction':'in','ContactId':_0x19cfb1[_0x2b6c('0x98')]['id'],'AttachmentId':_0x4881b6[_0x2b6c('0x4c')]['AttachmentId']});})[_0x2b6c('0x13')](function(_0x30f36e){_0x19cfb1[_0x2b6c('0x1a')]=_0x30f36e;if(_0x19cfb1['interaction']['UserId']){return db['User'][_0x2b6c('0x56')]({'attributes':['id','name'],'where':{'id':_0x19cfb1[_0x2b6c('0xaf')][_0x2b6c('0xb6')]}})['then'](function(_0x534f98){if(_0x534f98){_0x19cfb1[_0x2b6c('0x94')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2b6c('0xb7'),'appdata':_0x534f98[_0x2b6c('0x2a')]+','+(_0x19cfb1[_0x2b6c('0x93')][_0x2b6c('0xb8')]||0xa),'interval':'*,*,*,*'});_0x19cfb1[_0x2b6c('0xb9')]=!![];}return respondWithRpcPromise(_0x2b6c('0xba'),'startRouting',_0x19cfb1);});}return respondWithRpcPromise(_0x2b6c('0xba'),_0x2b6c('0xbb'),_0x19cfb1);})[_0x2b6c('0x13')](function(_0x6cfcb){respondWithRpcPromise(_0x2b6c('0xbc'),_0x2b6c('0xbc'),{'event':'notify','message':_0x6cfcb},client9002);return _0x6cfcb;})[_0x2b6c('0x13')](respondWithResult(_0xa3d644,null))['catch'](handleError(_0xa3d644,null));};exports[_0x2b6c('0xbd')]=function(_0x1f2281,_0x52dbc1){var _0xed2c38,_0x174332,_0x5d8cf0;var _0x4033b2=[];var _0x1731e0={};var _0x17daac=_0x1f2281[_0x2b6c('0xbe')]||[];var _0x26db61=[];var _0x16ef22;return db[_0x2b6c('0x8f')][_0x2b6c('0x54')]()[_0x2b6c('0x13')](function(_0x13b089){if(!_0x13b089){throw new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))](_0x2b6c('0x7f'));}_0x4033b2=_[_0x2b6c('0x82')](_['keys'](_0x13b089),[_0x2b6c('0x80'),_0x2b6c('0x81'),_0x2b6c('0x83'),_0x2b6c('0x84')]);if(_0x1f2281[_0x2b6c('0x4c')]['id']){delete _0x1f2281[_0x2b6c('0x4c')]['id'];}if(_[_0x2b6c('0x71')](_0x1f2281[_0x2b6c('0x4c')]['from'])){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x88')));}if(_['isNil'](_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x4c')])||_0x1f2281[_0x2b6c('0x4c')]['body']===''){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db['Sequelize'][(_0x2b6c('0x87'))](_0x2b6c('0x89')));}if(_[_0x2b6c('0x71')](_0x1f2281[_0x2b6c('0x4c')]['mapKeyOffline'])){throw _0x52dbc1[_0x2b6c('0x1d')](0x1f4)[_0x2b6c('0x2b')](new db[(_0x2b6c('0x86'))][(_0x2b6c('0x87'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4033b2));}if(!_[_0x2b6c('0xbf')](_0x4033b2,_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0xc0')])){throw _0x52dbc1['status'](0x1f4)['send'](new db[(_0x2b6c('0x86'))]['ValidationError'](_0x2b6c('0xc1')+_0x4033b2));}_0x1731e0[_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0xc0')]]=_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')];})['then'](function(){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x1f2281[_0x2b6c('0x48')]['id']},'include':[{'model':db['CmList'],'as':_0x2b6c('0x8e')},{'model':db[_0x2b6c('0xc2')],'as':_0x2b6c('0xc2')}]});})[_0x2b6c('0x13')](handleEntityNotFound(_0x52dbc1,null))[_0x2b6c('0x13')](function(_0x5df218){if(_0x5df218&&_0x5df218[_0x2b6c('0x8e')]){_0x174332=_0x5df218;var _0x21a82e=_[_0x2b6c('0x9')](_0x1f2281[_0x2b6c('0x4c')],{'firstName':_0x1f2281['body'][_0x2b6c('0x85')],'phone':_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')],'ListId':_0x5df218[_0x2b6c('0x84')]});_0x21a82e[_0x1f2281[_0x2b6c('0x4c')]['mapKeyOffline']]=_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x85')];return db[_0x2b6c('0x8f')][_0x2b6c('0xc3')]({'where':_0x1731e0,'defaults':_0x21a82e});}})[_0x2b6c('0xb0')](function(_0x5ae640){if(_0x5ae640){_0x5d8cf0=_0x5ae640;var _0x2fd5e9=fs[_0x2b6c('0xc4')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0xc5')),_0x2b6c('0xc6'));var _0x1987be=ejs[_0x2b6c('0xc7')](_0x2fd5e9,{'body':_[_0x2b6c('0xc8')](_0x1f2281[_0x2b6c('0x4c')][_0x2b6c('0x4c')]),'bodyTitle':_0x174332['offlineMessageBody']});return db['ChatOfflineMessage'][_0x2b6c('0x4b')]({'body':_0x1987be,'plainBody':htmlToText[_0x2b6c('0xc9')](_0x1987be),'ContactId':_0x5ae640['id'],'ChatWebsiteId':_0x174332['id']});}})[_0x2b6c('0x13')](function(_0x190460){_0x16ef22=_0x190460;if(_0x17daac['length']){var _0x4953b2=_0x17daac[_0x2b6c('0x2f')](function(_0x37ba00){return{'name':_0x37ba00[_0x2b6c('0xca')],'basename':_0x37ba00['filename'],'type':_0x37ba00[_0x2b6c('0xcb')],'ChatOfflineMessageId':_0x190460['id']};});_0x26db61=_0x4953b2['map'](_0x28ae85=>{var _0xfb661a={'filename':_0x28ae85['name'],'path':path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0xcc'),_0x2b6c('0xbe'),_0x2b6c('0xcd'),'offline-chat',_0x28ae85[_0x2b6c('0xce')])};return _0xfb661a;});if(!_0x174332[_0x2b6c('0xcf')]){return db[_0x2b6c('0xd0')][_0x2b6c('0xd1')](function(_0xa5812){return db[_0x2b6c('0xd2')][_0x2b6c('0xd3')](_0x4953b2,{'transaction':_0xa5812});});}}})[_0x2b6c('0x13')](function(){if(_0x16ef22){_0xed2c38=_0x16ef22;return db[_0x2b6c('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2b6c('0xd4')],'as':_0x2b6c('0xd5'),'raw':!![],'include':[{'model':db[_0x2b6c('0xd6')],'as':_0x2b6c('0xd6'),'raw':!![]}]}]});}})[_0x2b6c('0x13')](function(_0x402de6){if(_0x402de6&&_0x402de6[_0x2b6c('0xd5')]&&_0x174332[_0x2b6c('0xd7')]&&_0x174332['forwardOfflineAddress']){var _0x1c8dc1=_0x402de6[_0x2b6c('0xd8')]();return respondWithRpcPromise('SendMail',_0x2b6c('0xd9'),{'account':_0x1c8dc1,'message':{'from':util[_0x2b6c('0xa5')](_0x2b6c('0xda'),_0x402de6[_0x2b6c('0x2a')],_0x402de6['email']||_0x402de6[_0x2b6c('0xd5')]['user']),'to':_0x174332[_0x2b6c('0xdb')],'subject':_0x174332['offlineMessageSubject'],'html':_0xed2c38[_0x2b6c('0x4c')],'attachments':_0x26db61}},client9003)[_0x2b6c('0x13')](function(){return _0xed2c38;})['catch'](function(_0x411bb0){logger[_0x2b6c('0x19')](_0x411bb0);});}})[_0x2b6c('0x13')](function(){if(_0x174332&&_0x174332[_0x2b6c('0xcf')]&&_0x174332[_0x2b6c('0xdc')]){var _0x2e5116=[];if(_0x17daac['length']){_0x2e5116=_0x17daac[_0x2b6c('0x2f')](function(_0x10c9bd){return{'name':_0x10c9bd[_0x2b6c('0xca')],'basename':_0x10c9bd['filename'],'type':_0x10c9bd['mimetype'],'ChatOfflineMessageId':_0x16ef22['id']};});}var _0x37f605;if(!_[_0x2b6c('0x71')](_0x174332[_0x2b6c('0xdd')])){var _0x50e425=_[_0x2b6c('0x2f')](_0x1f2281['body'],function(_0x13cc2d){return _0x13cc2d;});var _0x104368=_[_0x2b6c('0xde')](_0x50e425)[0x0];var _0x3bbcfc=_['mapValues'](_0x104368,function(_0x11c415){return _0x11c415;});_0x37f605=_0x3bbcfc[0x1][_0x174332['subjectOffline']];}var _0x3d4c34={'from':_0x5d8cf0[_0x2b6c('0xdf')],'firstName':_0x5d8cf0[_0x2b6c('0x9f')],'lastName':_0x5d8cf0[_0x2b6c('0xa0')],'mapKey':_0x2b6c('0xdf'),'message':{'from':_0x5d8cf0[_0x2b6c('0xdf')],'to':_0x174332[_0x2b6c('0xc2')]['email'],'cc':'','subject':_[_0x2b6c('0x71')](_0x37f605)?_0x174332['offlineMessageSubject']:_0x37f605,'messageId':'','sentAt':new Date(),'attach':_0x2e5116[_0x2b6c('0x4a')],'attachments':_0x2e5116,'originChannel':_0x2b6c('0xe0'),'ChatWebsiteId':_0x174332['id'],'ChatOfflineMessageId':_0xed2c38['id'],'originTo':_0x174332[_0x2b6c('0xc2')][_0x2b6c('0xdf')]},'body':_0xed2c38[_0x2b6c('0x4c')]};var _0x37ffca={'account':{'id':_0x174332['MailAccountId']},'body':_0x3d4c34,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x2b6c('0xe1'),_0x2b6c('0xe2'),_0x37ffca,client9001)[_0x2b6c('0x13')](function(){return _0xed2c38;})[_0x2b6c('0x46')](function(_0x5da751){logger[_0x2b6c('0x19')](_0x5da751);});}return;})[_0x2b6c('0x13')](function(){if(_0xed2c38){return _0xed2c38;}})[_0x2b6c('0x13')](respondWithResult(_0x52dbc1,null))['catch'](function(_0xc1e7e7){logger['error'](_0x2b6c('0x46'),_0xc1e7e7);for(var _0x303861 of _0x17daac){var _0x34e9b6=path[_0x2b6c('0x6b')](config[_0x2b6c('0x6c')],_0x2b6c('0xcc'),_0x2b6c('0xbe'),_0x2b6c('0xcd'),_0x2b6c('0xe3'),_0x303861['filename']);fs_extra[_0x2b6c('0xe4')](_0x34e9b6)[_0x2b6c('0x46')](function(_0x25481a){logger[_0x2b6c('0x19')](_0x2b6c('0xe5'),_0x34e9b6,_0x25481a);});}});};exports[_0x2b6c('0xe6')]=function(_0x162150,_0x155993){return db[_0x2b6c('0xac')][_0x2b6c('0x56')]({'where':{'id':_0x162150[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x155993,null))['then'](function(_0x5d1327){if(_0x5d1327){return _0x5d1327[_0x2b6c('0xe6')](_0x162150[_0x2b6c('0x4c')][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x162150['body'],[_0x2b6c('0x5c'),'id'])||{});}})[_0x2b6c('0x13')](respondWithResult(_0x155993,null))['catch'](handleError(_0x155993,null));};exports[_0x2b6c('0xe8')]=function(_0x102268,_0x58a0c6){var _0x12532b={'raw':![],'where':{}};var _0x75e521={};var _0x5dab61={'count':0x0,'rows':[]};return db[_0x2b6c('0x41')]['findOne']({'where':{'id':_0x102268[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x58a0c6,null))[_0x2b6c('0x13')](function(_0x80bfca){if(_0x80bfca){_0x75e521['model']=_[_0x2b6c('0x31')](db[_0x2b6c('0xac')][_0x2b6c('0x60')]);_0x75e521[_0x2b6c('0x30')]=_['keys'](_0x102268['query']);_0x75e521[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x75e521['model'],_0x75e521[_0x2b6c('0x30')]);_0x12532b[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x75e521[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x102268[_0x2b6c('0x30')]['fields']));_0x12532b[_0x2b6c('0x34')]=_0x12532b['attributes'][_0x2b6c('0x4a')]?_0x12532b[_0x2b6c('0x34')]:_0x75e521[_0x2b6c('0x2e')];if(!_0x102268[_0x2b6c('0x30')][_0x2b6c('0x36')]('nolimit')){_0x12532b[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x102268[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x12532b[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x102268[_0x2b6c('0x30')]['offset']);}_0x12532b[_0x2b6c('0x38')]=qs['sort'](_0x102268[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x12532b[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_[_0x2b6c('0x3b')](_0x102268[_0x2b6c('0x30')],_0x75e521['filters']));_0x12532b[_0x2b6c('0x3a')][_0x2b6c('0x57')]=_0x80bfca['id'];if(_0x102268[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x12532b['where']=_[_0x2b6c('0x3d')](_0x12532b['where'],{'$or':_[_0x2b6c('0x2f')](_0x12532b[_0x2b6c('0x34')],function(_0x3a274b){var _0x169b7d={};_0x169b7d[_0x3a274b]={'$like':'%'+_0x102268[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x169b7d;})});}_0x12532b=_[_0x2b6c('0x3d')]({},_0x12532b,_0x102268[_0x2b6c('0x40')]);return db[_0x2b6c('0xac')][_0x2b6c('0x22')]({'where':_0x12532b[_0x2b6c('0x3a')]})['then'](function(_0x1617ed){_0x5dab61['count']=_0x1617ed;if(_0x102268[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x12532b[_0x2b6c('0x43')]=[{'model':db['CmContact'],'as':_0x2b6c('0xe9'),'required':![]},{'model':db[_0x2b6c('0xea')],'as':_0x2b6c('0xeb'),'attributes':['name',_0x2b6c('0xec'),'internal'],'required':![]},{'model':db[_0x2b6c('0xed')],'as':_0x2b6c('0xee'),'attributes':['id',_0x2b6c('0x2a'),'color'],'where':_0x102268[_0x2b6c('0x30')][_0x2b6c('0xef')]?{'id':_0x102268[_0x2b6c('0x30')]['tag']}:undefined,'required':_0x102268[_0x2b6c('0x30')][_0x2b6c('0xef')]?!![]:![]}];}return db[_0x2b6c('0xac')][_0x2b6c('0x44')](_0x12532b);})[_0x2b6c('0x13')](function(_0x1effbc){_0x5dab61[_0x2b6c('0x45')]=_0x1effbc;return _0x5dab61;});}})['then'](respondWithFilteredResult(_0x58a0c6,_0x12532b))[_0x2b6c('0x46')](handleError(_0x58a0c6,null));};function iftimePromise(_0x5b6701,_0x54490d){return respondWithRpcPromise(_0x2b6c('0xf0'),'getSnippet',{'command':_0x54490d[_0x2b6c('0xf1')]?util[_0x2b6c('0xa5')]('iftime\x20%s,%s',_0x5b6701[_0x2b6c('0xf2')],_0x54490d['timezone']):util[_0x2b6c('0xa5')](_0x2b6c('0xf3'),_0x5b6701['interval'])},client9002)[_0x2b6c('0x13')](function(_0x2f3c8a){var _0x214409=_0x2f3c8a&&_0x2f3c8a[_0x2b6c('0xf4')](_0x2b6c('0xf5'))>=0x0?!![]:![];logger[_0x2b6c('0x14')](_0x2b6c('0xf6'),_0x54490d['id'],_0x5b6701['id'],_0x5b6701['interval'],_0x214409?'ONLINE':'OFFLINE',_0x54490d[_0x2b6c('0xf1')]?_0x54490d[_0x2b6c('0xf1')]:_0x2b6c('0xf7'));return _0x214409;})['catch'](function(_0x46a36c){logger[_0x2b6c('0x19')](_0x2b6c('0xf6'),_0x54490d['id'],_0x5b6701['id'],_0x5b6701[_0x2b6c('0xf2')],util[_0x2b6c('0xf8')](_0x46a36c,{'showHidden':![],'depth':null}),_0x54490d[_0x2b6c('0xf1')]?_0x54490d[_0x2b6c('0xf1')]:_0x2b6c('0xf7'));return![];});}exports[_0x2b6c('0xf9')]=function(_0x8e6594,_0x22626f){var _0x3ad52a=0x0;var _0x12b247=0x0;var _0x335490=![];var _0x3af4c1;var _0x464eea;return db['ChatWebsite']['find']({'where':{'id':_0x8e6594[_0x2b6c('0x48')]['id']},'include':[{'model':db[_0x2b6c('0xfa')],'as':_0x2b6c('0xfa'),'include':[{'model':db[_0x2b6c('0xfa')],'as':_0x2b6c('0xfb'),'attributes':['id',_0x2b6c('0xf2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x22626f,null))[_0x2b6c('0x13')](function(_0x56ff04){if(_0x56ff04){_0x3af4c1=_0x56ff04;return _0x56ff04[_0x2b6c('0xfc')]({'raw':!![]});}})[_0x2b6c('0x13')](function(_0x57c35f){if(_0x3af4c1){if(_0x57c35f){_0x464eea=_0x57c35f;}}return require('../../config/license/util')[_0x2b6c('0x6f')]();})[_0x2b6c('0x13')](function(_0x56c624){if(_0x56c624){_0x12b247=_0x56c624[_0x2b6c('0xfd')];_0x335490=_0x56c624['custom'];}})[_0x2b6c('0x13')](function(){return db[_0x2b6c('0xac')][_0x2b6c('0x22')]({'where':{'closed':![]}});})[_0x2b6c('0x13')](function(_0x55a265){_0x3ad52a=_0x55a265;if(_0x12b247&&_0x55a265>_0x12b247){return db[_0x2b6c('0xfe')][_0x2b6c('0x5a')]({'where':{'id':0x1}})['then'](function(_0x155cf7){if(_0x155cf7){_0x155cf7[_0x2b6c('0xff')](_0x2b6c('0x100'));}});}})[_0x2b6c('0x13')](function(){if(_0x3af4c1['Interval']&&_0x3af4c1['Interval']['Intervals']){var _0x26bcf1=[];for(var _0x520347=0x0;_0x520347<_0x3af4c1['Interval'][_0x2b6c('0xfb')][_0x2b6c('0x4a')];_0x520347++){var _0x2e327c=_0x3af4c1[_0x2b6c('0xfa')][_0x2b6c('0xfb')][_0x520347]['get']({'plain':!![]});_0x26bcf1[_0x2b6c('0x101')](iftimePromise(_0x2e327c,_0x3af4c1));}return BPromise[_0x2b6c('0x102')](_0x26bcf1)['then'](function(_0x3f3f53){return _[_0x2b6c('0x103')](_0x3f3f53);});}else{return!![];}})[_0x2b6c('0x13')](function(_0x105330){var _0x2898fe=fs[_0x2b6c('0xc4')](path[_0x2b6c('0x6b')](config['root'],_0x2b6c('0x104')),'utf8');var _0x142312=new url[(_0x2b6c('0x105'))](_0x3af4c1['address'])[_0x2b6c('0x106')];var _0x28ad7c=_0x2b6c('0x107');var _0x2d959a=![];var _0x4b244c={'chatVersion':_0x28ad7c,'chatWebsiteAddressOrigin':_0x142312,'remote':_0x3af4c1[_0x2b6c('0x108')],'query':querystring[_0x2b6c('0xaa')](_['merge'](_0x3af4c1[_0x2b6c('0x28')]({'plain':!![]}),{'customerIp':_0x8e6594[_0x2b6c('0x9a')][_0x2b6c('0x9c')]||_0x8e6594['headers'][_0x2b6c('0x109')]||_0x8e6594[_0x2b6c('0x10a')][_0x2b6c('0x10b')]||_0x8e6594['ip'],'referer':_0x8e6594['headers']['referer'],'openedInteractions':_0x3ad52a,'maxInteractions':_0x12b247,'virtual':_0x335490[_0x2b6c('0xfd')],'online':_0x105330,'custom':_0x335490}))['replace'](/'/g,'\x5c\x27')};_0x22626f[_0x2b6c('0x2b')](ejs[_0x2b6c('0xc7')](Mustache[_0x2b6c('0xc7')](_0x2898fe,_0x4b244c),{'proactiveActions':_0x464eea,'alignment':_0x3af4c1[_0x2b6c('0x10c')],'verticalAlignment':_0x3af4c1[_0x2b6c('0x10d')],'div_color':_0x3af4c1[_0x2b6c('0x10e')],'labelText':_0x3af4c1[_0x2b6c('0x10f')],'text_color':_0x3af4c1[_0x2b6c('0x110')],'text_button_color':_0x3af4c1[_0x2b6c('0x111')],'button_color':_0x3af4c1['color_button'],'background_color':_0x3af4c1[_0x2b6c('0x112')],'hideWhenOffline':_0x3af4c1['hideWhenOffline'],'intervalId':_0x3af4c1[_0x2b6c('0x113')],'isDevelopment':_0x2d959a,'chatVersion':_0x28ad7c}));})[_0x2b6c('0x46')](handleError(_0x22626f,null));};exports[_0x2b6c('0x114')]=function(_0x71c1cb,_0x52c016){var _0x4291e1=_0x71c1cb['params']['id'];var _0x270c86=_0x71c1cb['body'];var _0x21c7ef=0xc8;var _0x52f0bf=null;return db[_0x2b6c('0xd0')]['transaction']({'isolationLevel':db[_0x2b6c('0xd0')][_0x2b6c('0x115')][_0x2b6c('0x116')][_0x2b6c('0x117')]},function(_0x17e931){return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x4291e1},'transaction':_0x17e931})[_0x2b6c('0x13')](function(_0x4ea0eb){if(_0x4ea0eb){return db[_0x2b6c('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x4291e1},'transaction':_0x17e931})['then'](function(){var _0x87ba1e=_[_0x2b6c('0x2f')](_0x270c86,function(_0x93c6b9){_0x93c6b9[_0x2b6c('0x57')]=_0x4291e1;return _0x93c6b9;});return db['ChatApplication'][_0x2b6c('0xd3')](_0x87ba1e,{'transaction':_0x17e931});});}else{_0x21c7ef=0x194;_0x52f0bf=[];}});})[_0x2b6c('0x13')](function(){if(_0x21c7ef!==0x194){return db[_0x2b6c('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x4291e1},'order':_0x2b6c('0x96')})[_0x2b6c('0x13')](function(_0x195a75){_0x52f0bf=_0x195a75;});}})['catch'](function(_0x177a6b){_0x21c7ef=0x1f4;logger[_0x2b6c('0x19')](_0x177a6b[_0x2b6c('0x118')]);if(_0x177a6b['name']){delete _0x177a6b['name'];}_0x52f0bf=_0x177a6b;})['finally'](function(){if(_0x52f0bf===null){_0x52c016[_0x2b6c('0x1c')](_0x21c7ef);}else{if(_0x21c7ef===0x1f4){_0x52c016[_0x2b6c('0x1d')](_0x21c7ef)[_0x2b6c('0x2b')](_0x52f0bf);}else{_0x52c016[_0x2b6c('0x1d')](_0x21c7ef)[_0x2b6c('0x25')](_0x52f0bf);}}});};exports[_0x2b6c('0x119')]=function(_0x3b2e57,_0x22ec7b){var _0x52f108={};var _0x1888e8={};var _0x20d148;var _0x5a7fc5;return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x3b2e57[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x22ec7b,null))[_0x2b6c('0x13')](function(_0x1b8507){if(_0x1b8507){_0x20d148=_0x1b8507;_0x1888e8[_0x2b6c('0x2e')]=_['keys'](db[_0x2b6c('0x91')][_0x2b6c('0x60')]);_0x1888e8[_0x2b6c('0x30')]=_['keys'](_0x3b2e57[_0x2b6c('0x30')]);_0x1888e8[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x1888e8[_0x2b6c('0x2e')],_0x1888e8[_0x2b6c('0x30')]);_0x52f108[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x1888e8[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x3b2e57['query'][_0x2b6c('0x35')]));_0x52f108[_0x2b6c('0x34')]=_0x52f108[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x52f108[_0x2b6c('0x34')]:_0x1888e8[_0x2b6c('0x2e')];_0x52f108[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x3b2e57['query'][_0x2b6c('0x39')]);_0x52f108['where']=qs[_0x2b6c('0x32')](_['pick'](_0x3b2e57[_0x2b6c('0x30')],_0x1888e8[_0x2b6c('0x32')]));if(_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x52f108[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x52f108['where'],{'$or':_[_0x2b6c('0x2f')](_0x52f108[_0x2b6c('0x34')],function(_0x54a8df){var _0x11e100={};_0x11e100[_0x54a8df]={'$like':'%'+_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x3c')]+'%'};return _0x11e100;})});}_0x52f108=_[_0x2b6c('0x3d')]({},_0x52f108,_0x3b2e57[_0x2b6c('0x40')]);return _0x20d148[_0x2b6c('0x119')](_0x52f108);}})[_0x2b6c('0x13')](function(_0x55184d){if(_0x55184d){_0x5a7fc5=_0x55184d['length'];if(!_0x3b2e57[_0x2b6c('0x30')]['hasOwnProperty'](_0x2b6c('0x37'))){_0x52f108['limit']=qs[_0x2b6c('0x21')](_0x3b2e57[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x52f108[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x3b2e57[_0x2b6c('0x30')]['offset']);}return _0x20d148[_0x2b6c('0x119')](_0x52f108);}})['then'](function(_0xb9bb18){if(_0xb9bb18){return _0xb9bb18?{'count':_0x5a7fc5,'rows':_0xb9bb18}:null;}})[_0x2b6c('0x13')](respondWithResult(_0x22ec7b,null))[_0x2b6c('0x46')](handleError(_0x22ec7b,null));};exports[_0x2b6c('0x11a')]=function(_0x230ade,_0x1b1121){return db[_0x2b6c('0x11b')][_0x2b6c('0x56')]({'where':{'id':_0x230ade[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b1121,null))[_0x2b6c('0x13')](function(_0x1b307a){if(_0x1b307a){return _0x1b307a['addProactiveActions'](_0x230ade[_0x2b6c('0x4c')][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x230ade['body'],[_0x2b6c('0x5c'),'id'])||{});}})[_0x2b6c('0x13')](respondWithResult(_0x1b1121,null))['catch'](handleError(_0x1b1121,null));};exports['getProactiveActions']=function(_0x3283c8,_0x5f1159){var _0x14d3ca={};var _0x44f96e={};var _0x497c74;var _0x563443;return db[_0x2b6c('0x41')][_0x2b6c('0x5a')]({'where':{'id':_0x3283c8[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x5f1159,null))[_0x2b6c('0x13')](function(_0x4b9d75){if(_0x4b9d75){_0x497c74=_0x4b9d75;_0x44f96e[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0x11c')]['rawAttributes']);_0x44f96e[_0x2b6c('0x30')]=_['keys'](_0x3283c8[_0x2b6c('0x30')]);_0x44f96e[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x44f96e['model'],_0x44f96e['query']);_0x14d3ca[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x44f96e[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x3283c8['query'][_0x2b6c('0x35')]));_0x14d3ca['attributes']=_0x14d3ca[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x14d3ca['attributes']:_0x44f96e['model'];_0x14d3ca[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x3283c8[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x14d3ca[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x3283c8[_0x2b6c('0x30')],_0x44f96e[_0x2b6c('0x32')]));if(_0x3283c8['query'][_0x2b6c('0x3c')]){_0x14d3ca['where']=_['merge'](_0x14d3ca['where'],{'$or':_[_0x2b6c('0x2f')](_0x14d3ca[_0x2b6c('0x34')],function(_0x3c520e){var _0x12fa50={};_0x12fa50[_0x3c520e]={'$like':'%'+_0x3283c8['query']['filter']+'%'};return _0x12fa50;})});}_0x14d3ca=_[_0x2b6c('0x3d')]({},_0x14d3ca,_0x3283c8['options']);return _0x497c74[_0x2b6c('0xfc')](_0x14d3ca);}})['then'](function(_0xdf2863){if(_0xdf2863){_0x563443=_0xdf2863['length'];if(!_0x3283c8['query']['hasOwnProperty']('nolimit')){_0x14d3ca[_0x2b6c('0x21')]=qs[_0x2b6c('0x21')](_0x3283c8[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x14d3ca[_0x2b6c('0x1f')]=qs[_0x2b6c('0x1f')](_0x3283c8['query'][_0x2b6c('0x1f')]);}return _0x497c74[_0x2b6c('0xfc')](_0x14d3ca);}})[_0x2b6c('0x13')](function(_0x5464d2){if(_0x5464d2){return _0x5464d2?{'count':_0x563443,'rows':_0x5464d2}:null;}})[_0x2b6c('0x13')](respondWithResult(_0x5f1159,null))['catch'](handleError(_0x5f1159,null));};exports['getFields']=function(_0x5f31c4,_0x115a54){var _0x2a3a9a=_0x5f31c4[_0x2b6c('0x30')][_0x2b6c('0x11d')]==='false'?_0x2b6c('0x11e'):_0x2b6c('0x11f');return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'attributes':['id',_0x2a3a9a],'where':{'id':_0x5f31c4[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x115a54,null))['then'](function(_0x738986){if(_0x738986){var _0x578ed2=_0x738986[_0x2a3a9a];var _0x17d9cd=_0x578ed2&&_0x578ed2['items']?_0x578ed2['items']:[];_0x115a54['send']({'fromKey':_[_0x2b6c('0x71')](_0x578ed2['fromKey'])?undefined:_0x578ed2[_0x2b6c('0x120')],'count':_0x17d9cd[_0x2b6c('0x4a')],'rows':_0x17d9cd});}})[_0x2b6c('0x46')](handleError(_0x115a54,null));};exports[_0x2b6c('0x121')]=function(_0x4045be,_0x9306c5){var _0x8f32e9={'raw':![],'where':{}};var _0x473dff={};var _0x1b1951={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2b6c('0x5a')]({'where':{'id':_0x4045be['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x9306c5,null))[_0x2b6c('0x13')](function(_0x28b585){if(_0x28b585){_0x473dff[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db['ChatOfflineMessage'][_0x2b6c('0x60')]);_0x473dff[_0x2b6c('0x30')]=_['keys'](_0x4045be['query']);_0x473dff[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x473dff[_0x2b6c('0x2e')],_0x473dff[_0x2b6c('0x30')]);_0x8f32e9[_0x2b6c('0x34')]=_[_0x2b6c('0x33')](_0x473dff['model'],qs[_0x2b6c('0x35')](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x8f32e9[_0x2b6c('0x34')]=_0x8f32e9[_0x2b6c('0x34')][_0x2b6c('0x4a')]?_0x8f32e9[_0x2b6c('0x34')]:_0x473dff[_0x2b6c('0x2e')];if(!_0x4045be[_0x2b6c('0x30')]['hasOwnProperty'](_0x2b6c('0x37'))){_0x8f32e9['limit']=qs['limit'](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x8f32e9[_0x2b6c('0x1f')]=qs['offset'](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}_0x8f32e9[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x39')]);_0x8f32e9[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x4045be[_0x2b6c('0x30')],_0x473dff[_0x2b6c('0x32')]));_0x8f32e9[_0x2b6c('0x3a')][_0x2b6c('0x57')]=_0x28b585['id'];if(_0x4045be[_0x2b6c('0x30')]['filter']){_0x8f32e9[_0x2b6c('0x3a')]=_[_0x2b6c('0x3d')](_0x8f32e9[_0x2b6c('0x3a')],{'$or':_['map'](_0x8f32e9[_0x2b6c('0x34')],function(_0x114083){var _0x100d7d={};_0x100d7d[_0x114083]={'$like':'%'+_0x4045be[_0x2b6c('0x30')]['filter']+'%'};return _0x100d7d;})});}_0x8f32e9=_[_0x2b6c('0x3d')]({},_0x8f32e9,_0x4045be[_0x2b6c('0x40')]);return db['ChatOfflineMessage'][_0x2b6c('0x22')]({'where':_0x8f32e9[_0x2b6c('0x3a')]})[_0x2b6c('0x13')](function(_0x119724){_0x1b1951[_0x2b6c('0x22')]=_0x119724;if(_0x4045be[_0x2b6c('0x30')][_0x2b6c('0x42')]){_0x8f32e9['include']=[{'all':!![]}];}else{_0x8f32e9[_0x2b6c('0x43')]=[{'model':db[_0x2b6c('0x8f')],'as':_0x2b6c('0xe9'),'required':![]},{'model':db[_0x2b6c('0xd2')],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x2b6c('0x44')](_0x8f32e9);})[_0x2b6c('0x13')](function(_0x2dc3fe){_0x1b1951[_0x2b6c('0x45')]=_0x2dc3fe;return _0x1b1951;});}})['then'](respondWithFilteredResult(_0x9306c5,_0x8f32e9))[_0x2b6c('0x46')](handleError(_0x9306c5,null));};exports[_0x2b6c('0x122')]=function(_0x222071,_0x2957e1){return db[_0x2b6c('0x41')]['find']({'where':{'id':_0x222071[_0x2b6c('0x48')]['id']}})['then'](handleEntityNotFound(_0x2957e1,null))['then'](function(_0xc7de3c){if(_0xc7de3c){return _0xc7de3c[_0x2b6c('0x122')](_0x222071['body'][_0x2b6c('0x5c')],_[_0x2b6c('0xe7')](_0x222071[_0x2b6c('0x4c')],['ids','id'])||{})[_0x2b6c('0xb0')](function(_0x217908){for(var _0x3a7e37=0x0;_0x3a7e37<_0x222071[_0x2b6c('0x4c')][_0x2b6c('0x5c')][_0x2b6c('0x4a')];_0x3a7e37+=0x1){socket['emit'](_0x2b6c('0x123'),{'UserId':Number(_0x222071[_0x2b6c('0x4c')][_0x2b6c('0x5c')][_0x3a7e37]),'ChatWebsiteId':Number(_0x222071[_0x2b6c('0x48')]['id'])});}return _0x217908;});}})[_0x2b6c('0x13')](respondWithResult(_0x2957e1,null))[_0x2b6c('0x46')](handleError(_0x2957e1,null));};exports[_0x2b6c('0x124')]=function(_0x54f785,_0x2a6e46){return db[_0x2b6c('0x41')][_0x2b6c('0x56')]({'where':{'id':_0x54f785['params']['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x2a6e46,null))[_0x2b6c('0x13')](function(_0xef1e0f){if(_0xef1e0f){return _0xef1e0f[_0x2b6c('0x124')](_0x54f785[_0x2b6c('0x30')]['ids'])[_0x2b6c('0x13')](function(){if(_['isArray'](_0x54f785['query']['ids'])){for(var _0x30cae6=0x0;_0x30cae6<_0x54f785['query'][_0x2b6c('0x5c')][_0x2b6c('0x4a')];_0x30cae6+=0x1){socket[_0x2b6c('0x125')](_0x2b6c('0x126'),{'UserId':Number(_0x54f785[_0x2b6c('0x30')][_0x2b6c('0x5c')][_0x30cae6]),'ChatWebsiteId':Number(_0x54f785['params']['id'])});}}else{socket['emit'](_0x2b6c('0x126'),{'UserId':Number(_0x54f785[_0x2b6c('0x30')]['ids']),'ChatWebsiteId':Number(_0x54f785[_0x2b6c('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a6e46,null))[_0x2b6c('0x46')](handleError(_0x2a6e46,null));};exports['getAgents']=function(_0x2e65ce,_0x19aff4){var _0x34aa12={};var _0x1f27f3={};var _0x1a8a0e;var _0x1a976c;return db[_0x2b6c('0x41')]['findOne']({'where':{'id':_0x2e65ce[_0x2b6c('0x48')]['id']}})[_0x2b6c('0x13')](handleEntityNotFound(_0x19aff4,null))[_0x2b6c('0x13')](function(_0x32f5e8){if(_0x32f5e8){_0x1a8a0e=_0x32f5e8;_0x1f27f3[_0x2b6c('0x2e')]=_[_0x2b6c('0x31')](db[_0x2b6c('0xea')]['rawAttributes']);_0x1f27f3[_0x2b6c('0x30')]=_[_0x2b6c('0x31')](_0x2e65ce['query']);_0x1f27f3[_0x2b6c('0x32')]=_[_0x2b6c('0x33')](_0x1f27f3[_0x2b6c('0x2e')],_0x1f27f3[_0x2b6c('0x30')]);_0x34aa12['attributes']=_[_0x2b6c('0x33')](_0x1f27f3[_0x2b6c('0x2e')],qs[_0x2b6c('0x35')](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x35')]));_0x34aa12[_0x2b6c('0x34')]=_0x34aa12[_0x2b6c('0x34')]['length']?_0x34aa12[_0x2b6c('0x34')]:_0x1f27f3[_0x2b6c('0x2e')];_0x34aa12[_0x2b6c('0x38')]=qs[_0x2b6c('0x39')](_0x2e65ce[_0x2b6c('0x30')]['sort']);_0x34aa12[_0x2b6c('0x3a')]=qs[_0x2b6c('0x32')](_['pick'](_0x2e65ce[_0x2b6c('0x30')],_0x1f27f3[_0x2b6c('0x32')]));if(_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x3c')]){_0x34aa12['where']=_[_0x2b6c('0x3d')](_0x34aa12[_0x2b6c('0x3a')],{'$or':_[_0x2b6c('0x2f')](_0x34aa12[_0x2b6c('0x34')],function(_0x7de937){var _0x2313be={};_0x2313be[_0x7de937]={'$like':'%'+_0x2e65ce['query'][_0x2b6c('0x3c')]+'%'};return _0x2313be;})});}_0x34aa12=_['merge']({},_0x34aa12,_0x2e65ce[_0x2b6c('0x40')]);return _0x1a8a0e[_0x2b6c('0x127')](_0x34aa12);}})[_0x2b6c('0x13')](function(_0xd50fc1){if(_0xd50fc1){_0x1a976c=_0xd50fc1['length'];if(!_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x36')]('nolimit')){_0x34aa12[_0x2b6c('0x21')]=qs['limit'](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x21')]);_0x34aa12[_0x2b6c('0x1f')]=qs['offset'](_0x2e65ce[_0x2b6c('0x30')][_0x2b6c('0x1f')]);}return _0x1a8a0e[_0x2b6c('0x127')](_0x34aa12);}})[_0x2b6c('0x13')](function(_0x451ecc){if(_0x451ecc){return _0x451ecc?{'count':_0x1a976c,'rows':_0x451ecc}:null;}})['then'](respondWithResult(_0x19aff4,null))[_0x2b6c('0x46')](handleError(_0x19aff4,null));};
\ No newline at end of file
+var _0x176c=['destroy','findAndCountAll','priority','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','update','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','show','params','keys','intersection','includeAll','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','file','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','sitepic','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','headers','user-agent','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','ChatApplication','Applications','List','list','orderBy','asc','account','defaults','from','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','%s\x20%s','version','unknown','format','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','applications','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','offline','CompanyId','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','readFileSync','render','toPairs','offlineMessageBody','originalname','files','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','MailServerOut','CloudProvider','Smtp','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','subjectOffline','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','some','utf8','URL','origin','3.1.0','remote','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED'];(function(_0x269cd7,_0x35b9d9){var _0x2e103d=function(_0x2e1e72){while(--_0x2e1e72){_0x269cd7['push'](_0x269cd7['shift']());}};_0x2e103d(++_0x35b9d9);}(_0x176c,0x141));var _0xc176=function(_0x5d506f,_0x8da43f){_0x5d506f=_0x5d506f-0x0;var _0x7a9c9b=_0x176c[_0x5d506f];return _0x7a9c9b;};'use strict';var BPromise=require(_0xc176('0x0'));var Mustache=require(_0xc176('0x1'));var util=require(_0xc176('0x2'));var path=require(_0xc176('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc176('0x4'));var _=require(_0xc176('0x5'));var querystring=require(_0xc176('0x6'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xc176('0x7'))(_0xc176('0x8'));var config=require('../../config/environment');var url=require('url');var db=require(_0xc176('0x9'))['db'];config['redis']=_['defaults'](config[_0xc176('0xa')],{'host':_0xc176('0xb'),'port':0x18eb});var socket=require(_0xc176('0xc'))(new Redis(config[_0xc176('0xa')]));require(_0xc176('0xd'))[_0xc176('0xe')](socket);var htmlToText=require(_0xc176('0xf'));var jayson=require(_0xc176('0x10'));var client=jayson[_0xc176('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xc176('0x11')]['http']({'port':0x232a});var client9003=jayson['client'][_0xc176('0x12')]({'port':0x232b});var client9001=jayson[_0xc176('0x11')][_0xc176('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x4266ac,_0x32ac74,_0x9044f9,_0xc6ab06){return new BPromise(function(_0x405363,_0x56392a){var _0x15193d=_0xc6ab06||client;return _0x15193d[_0xc176('0x13')](_0x4266ac,_0x9044f9)[_0xc176('0x14')](function(_0x11164e){logger[_0xc176('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,'request\x20sent');logger[_0xc176('0x16')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x32ac74,_0xc176('0x17'),JSON['stringify'](_0x11164e));if(_0x11164e[_0xc176('0x18')]){if(_0x11164e['error'][_0xc176('0x19')]===0x1f4){logger[_0xc176('0x18')](_0xc176('0x1a'),_0x32ac74,_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);return _0x56392a(_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);}logger[_0xc176('0x18')](_0xc176('0x1a'),_0x32ac74,_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);return _0x405363(_0x11164e[_0xc176('0x18')][_0xc176('0x1b')]);}else{logger[_0xc176('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,_0xc176('0x17'));_0x405363(_0x11164e[_0xc176('0x1c')][_0xc176('0x1b')]);}})[_0xc176('0x1d')](function(_0x286c4c){logger[_0xc176('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x32ac74,_0x286c4c);_0x56392a(_0x286c4c);});});}function respondWithStatusCode(_0x52ea38,_0x491a58){_0x491a58=_0x491a58||0xcc;return function(_0x3f6bf4){if(_0x3f6bf4){return _0x52ea38[_0xc176('0x1e')](_0x491a58);}return _0x52ea38[_0xc176('0x1f')](_0x491a58)[_0xc176('0x20')]();};}function respondWithResult(_0x52f409,_0x18523d){_0x18523d=_0x18523d||0xc8;return function(_0x51c014){if(_0x51c014){return _0x52f409[_0xc176('0x1f')](_0x18523d)[_0xc176('0x21')](_0x51c014);}};}function respondWithFilteredResult(_0x547f83,_0x427311){return function(_0x3dfe05){if(_0x3dfe05){var _0xae0e39=typeof _0x427311[_0xc176('0x22')]===_0xc176('0x23')&&typeof _0x427311[_0xc176('0x24')]==='undefined';var _0x4d1349=_0x3dfe05[_0xc176('0x25')];var _0x529c40=_0xae0e39?0x0:_0x427311[_0xc176('0x22')];var _0x1a7b9d=_0xae0e39?_0x3dfe05[_0xc176('0x25')]:_0x427311[_0xc176('0x22')]+_0x427311['limit'];var _0x4a0f92;if(_0x1a7b9d>=_0x4d1349){_0x1a7b9d=_0x4d1349;_0x4a0f92=0xc8;}else{_0x4a0f92=0xce;}_0x547f83['status'](_0x4a0f92);return _0x547f83['set']('Content-Range',_0x529c40+'-'+_0x1a7b9d+'/'+_0x4d1349)[_0xc176('0x21')](_0x3dfe05);}return null;};}function saveUpdates(_0x37e565){return function(_0x4a4df1){if(_0x4a4df1){return _0x4a4df1[_0xc176('0x26')](_0x37e565)[_0xc176('0x14')](function(_0x4443ae){return _0x4443ae;});}return null;};}function removeEntity(_0x3a739c){return function(_0x5ccdb3){if(_0x5ccdb3){return _0x5ccdb3['destroy']()['then'](function(){var _0x4d9dae=_0x5ccdb3[_0xc176('0x27')]({'plain':!![]});var _0x39228a=_0xc176('0x28');return db[_0xc176('0x29')]['destroy']({'where':{'type':_0x39228a,'resourceId':_0x4d9dae['id']}})[_0xc176('0x14')](function(){return _0x5ccdb3;});})[_0xc176('0x14')](function(){_0x3a739c['status'](0xcc)[_0xc176('0x20')]();});}};}function handleEntityNotFound(_0xaecbb0){return function(_0x1272c7){if(!_0x1272c7){_0xaecbb0['sendStatus'](0x194);}return _0x1272c7;};}function handleError(_0x3c9b20,_0xb48e4){_0xb48e4=_0xb48e4||0x1f4;return function(_0x53c223){logger[_0xc176('0x18')](_0x53c223[_0xc176('0x2a')]);if(_0x53c223[_0xc176('0x2b')]){delete _0x53c223[_0xc176('0x2b')];}_0x3c9b20['status'](_0xb48e4)[_0xc176('0x2c')](_0x53c223);};}exports[_0xc176('0x2d')]=function(_0x14473d,_0x103dc4){var _0x1ed99c={'include':[{'model':db[_0xc176('0x2e')],'as':_0xc176('0x2f')}]},_0x39732a={},_0x55bdf2={'count':0x0,'rows':[]};var _0xa30f9e=_[_0xc176('0x30')](db[_0xc176('0x31')][_0xc176('0x32')],function(_0x5b0b51){return{'name':_0x5b0b51[_0xc176('0x33')],'type':_0x5b0b51[_0xc176('0x34')][_0xc176('0x35')]};});_0x39732a[_0xc176('0x36')]=_[_0xc176('0x30')](_0xa30f9e,'name');_0x39732a[_0xc176('0x37')]=_['keys'](_0x14473d['query']);_0x39732a[_0xc176('0x38')]=_['intersection'](_0x39732a['model'],_0x39732a[_0xc176('0x37')]);_0x1ed99c[_0xc176('0x39')]=_['intersection'](_0x39732a[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x14473d[_0xc176('0x37')][_0xc176('0x3a')]));_0x1ed99c[_0xc176('0x39')]=_0x1ed99c[_0xc176('0x39')][_0xc176('0x3b')]?_0x1ed99c[_0xc176('0x39')]:_0x39732a[_0xc176('0x36')];if(!_0x14473d[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x1ed99c[_0xc176('0x24')]=qs['limit'](_0x14473d[_0xc176('0x37')][_0xc176('0x24')]);_0x1ed99c[_0xc176('0x22')]=qs['offset'](_0x14473d['query'][_0xc176('0x22')]);}_0x1ed99c[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x14473d['query'][_0xc176('0x3e')]);_0x1ed99c[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x14473d[_0xc176('0x37')],_0x39732a['filters']),_0xa30f9e);if(_0x14473d[_0xc176('0x37')][_0xc176('0x41')]){_0x1ed99c[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x1ed99c['where'],{'$or':_[_0xc176('0x30')](_0xa30f9e,function(_0x3e348e){if(_0x3e348e[_0xc176('0x34')]!=='VIRTUAL'){var _0x3e0849={};_0x3e0849[_0x3e348e[_0xc176('0x2b')]]={'$like':'%'+_0x14473d[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x3e0849;}})});}_0x1ed99c=_['merge']({},_0x1ed99c,_0x14473d[_0xc176('0x43')]);var _0x330681={'where':_0x1ed99c[_0xc176('0x3f')]};return db[_0xc176('0x31')][_0xc176('0x25')](_0x330681)['then'](function(_0x53be6b){_0x55bdf2[_0xc176('0x25')]=_0x53be6b;if(_0x14473d[_0xc176('0x37')]['includeAll']){_0x1ed99c[_0xc176('0x44')]=[{'all':!![]}];}return db['ChatWebsite'][_0xc176('0x45')](_0x1ed99c);})[_0xc176('0x14')](function(_0x4a02a6){_0x55bdf2['rows']=_0x4a02a6;return _0x55bdf2;})[_0xc176('0x14')](respondWithFilteredResult(_0x103dc4,_0x1ed99c))[_0xc176('0x1d')](handleError(_0x103dc4,null));};exports[_0xc176('0x46')]=function(_0x5292f7,_0xcfb1ea){var _0x513e2e={'raw':![],'where':{'id':_0x5292f7[_0xc176('0x47')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1f646e={};_0x1f646e['model']=_['keys'](db[_0xc176('0x31')]['rawAttributes']);_0x1f646e[_0xc176('0x37')]=_[_0xc176('0x48')](_0x5292f7[_0xc176('0x37')]);_0x1f646e[_0xc176('0x38')]=_[_0xc176('0x49')](_0x1f646e[_0xc176('0x36')],_0x1f646e['query']);_0x513e2e[_0xc176('0x39')]=_[_0xc176('0x49')](_0x1f646e[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x5292f7[_0xc176('0x37')][_0xc176('0x3a')]));_0x513e2e[_0xc176('0x39')]=_0x513e2e[_0xc176('0x39')][_0xc176('0x3b')]?_0x513e2e['attributes']:_0x1f646e[_0xc176('0x36')];if(_0x5292f7['query'][_0xc176('0x4a')]){_0x513e2e[_0xc176('0x44')]=[{'all':!![]}];}_0x513e2e=_[_0xc176('0x42')]({},_0x513e2e,_0x5292f7[_0xc176('0x43')]);return db[_0xc176('0x31')][_0xc176('0x4b')](_0x513e2e)[_0xc176('0x14')](handleEntityNotFound(_0xcfb1ea,null))[_0xc176('0x14')](respondWithResult(_0xcfb1ea,null))['catch'](handleError(_0xcfb1ea,null));};exports['create']=function(_0x528b07,_0x27ac17){return db[_0xc176('0x31')]['create'](_0x528b07[_0xc176('0x4c')],{})['then'](function(_0x170442){var _0x3b6ea4=_0x528b07[_0xc176('0x4d')][_0xc176('0x27')]({'plain':!![]});if(!_0x3b6ea4)throw new Error(_0xc176('0x4e'));if(_0x3b6ea4[_0xc176('0x4f')]===_0xc176('0x4d')){var _0x4b7092=_0x170442['get']({'plain':!![]});var _0x6cd3ba=_0xc176('0x28');return db['UserProfileSection'][_0xc176('0x4b')]({'where':{'name':_0x6cd3ba,'userProfileId':_0x3b6ea4['userProfileId']},'raw':!![]})['then'](function(_0x24b605){if(_0x24b605&&_0x24b605[_0xc176('0x50')]===0x0){return db[_0xc176('0x29')][_0xc176('0x51')]({'name':_0x4b7092[_0xc176('0x2b')],'resourceId':_0x4b7092['id'],'type':_0x24b605[_0xc176('0x2b')],'sectionId':_0x24b605['id']},{})['then'](function(){return _0x170442;});}else{return _0x170442;}})[_0xc176('0x1d')](function(_0x563541){logger[_0xc176('0x18')](_0xc176('0x52'),_0x563541);throw _0x563541;});}return _0x170442;})[_0xc176('0x14')](respondWithResult(_0x27ac17,0xc9))[_0xc176('0x1d')](handleError(_0x27ac17,null));};exports[_0xc176('0x26')]=function(_0x160bb8,_0x33dd02){if(_0x160bb8[_0xc176('0x4c')]['id']){delete _0x160bb8[_0xc176('0x4c')]['id'];}return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x160bb8['params']['id']},'include':[{'model':db[_0xc176('0x2e')],'as':_0xc176('0x2f')}]})[_0xc176('0x14')](handleEntityNotFound(_0x33dd02,null))['then'](saveUpdates(_0x160bb8[_0xc176('0x4c')],null))['then'](respondWithResult(_0x33dd02,null))[_0xc176('0x1d')](handleError(_0x33dd02,null));};exports['destroy']=function(_0x4f40b9,_0x5d721b){return db['ChatWebsite']['find']({'where':{'id':_0x4f40b9[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x5d721b,null))['then'](removeEntity(_0x5d721b,null))[_0xc176('0x1d')](handleError(_0x5d721b,null));};exports[_0xc176('0x53')]=function(_0x152139,_0x59f38c){return db[_0xc176('0x31')][_0xc176('0x53')]()[_0xc176('0x14')](respondWithResult(_0x59f38c,null))['catch'](handleError(_0x59f38c,null));};exports[_0xc176('0x54')]=function(_0x397358,_0x23b0df){if(_0x397358['body']['id']){delete _0x397358[_0xc176('0x4c')]['id'];}return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x397358[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x23b0df,null))[_0xc176('0x14')](function(_0x231e1f){if(_0x231e1f){_0x397358['body'][_0xc176('0x55')]=_0x231e1f['id'];return db[_0xc176('0x56')]['create'](_0x397358['body']);}})[_0xc176('0x14')](respondWithResult(_0x23b0df,null))[_0xc176('0x1d')](handleError(_0x23b0df,null));};exports[_0xc176('0x57')]=function(_0x5554b3,_0x5b7f31){var _0x59a405={'raw':![],'where':{}};var _0x35cc6d={};var _0x146aaf={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x5554b3[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x5b7f31,null))[_0xc176('0x14')](function(_0x1f5cf5){if(_0x1f5cf5){_0x35cc6d[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0x56')][_0xc176('0x32')]);_0x35cc6d[_0xc176('0x37')]=_['keys'](_0x5554b3[_0xc176('0x37')]);_0x35cc6d['filters']=_['intersection'](_0x35cc6d[_0xc176('0x36')],_0x35cc6d[_0xc176('0x37')]);_0x59a405[_0xc176('0x39')]=_[_0xc176('0x49')](_0x35cc6d[_0xc176('0x36')],qs['fields'](_0x5554b3[_0xc176('0x37')][_0xc176('0x3a')]));_0x59a405['attributes']=_0x59a405[_0xc176('0x39')]['length']?_0x59a405[_0xc176('0x39')]:_0x35cc6d['model'];if(!_0x5554b3[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x59a405[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x5554b3[_0xc176('0x37')][_0xc176('0x24')]);_0x59a405[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x5554b3[_0xc176('0x37')][_0xc176('0x22')]);}_0x59a405[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x5554b3[_0xc176('0x37')][_0xc176('0x3e')]);_0x59a405[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x5554b3['query'],_0x35cc6d[_0xc176('0x38')]));_0x59a405[_0xc176('0x3f')][_0xc176('0x55')]=_0x1f5cf5['id'];if(_0x5554b3[_0xc176('0x37')][_0xc176('0x41')]){_0x59a405[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x59a405[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x59a405['attributes'],function(_0x3c92fd){var _0x24747d={};_0x24747d[_0x3c92fd]={'$like':'%'+_0x5554b3[_0xc176('0x37')]['filter']+'%'};return _0x24747d;})});}_0x59a405=_[_0xc176('0x42')]({},_0x59a405,_0x5554b3[_0xc176('0x43')]);return db['Disposition']['count']({'where':_0x59a405['where']})['then'](function(_0xe59f26){_0x146aaf['count']=_0xe59f26;if(_0x5554b3['query']['includeAll']){_0x59a405[_0xc176('0x44')]=[{'all':!![]}];}return db[_0xc176('0x56')][_0xc176('0x45')](_0x59a405);})[_0xc176('0x14')](function(_0x45682f){_0x146aaf[_0xc176('0x5a')]=_0x45682f;return _0x146aaf;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x5b7f31,_0x59a405))[_0xc176('0x1d')](handleError(_0x5b7f31,null));};exports[_0xc176('0x5b')]=function(_0x5c1f7e,_0xc550c8){return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x5c1f7e[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0xc550c8,null))[_0xc176('0x14')](function(_0x4819cc){if(_0x4819cc){return _0x4819cc[_0xc176('0x5b')](_0x5c1f7e['query'][_0xc176('0x5c')]);}})[_0xc176('0x14')](respondWithStatusCode(_0xc550c8,null))['catch'](handleError(_0xc550c8,null));};exports[_0xc176('0x5d')]=function(_0x3bce66,_0x51e7a1){if(_0x3bce66[_0xc176('0x4c')]['id']){delete _0x3bce66['body']['id'];}return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x3bce66[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x51e7a1,null))[_0xc176('0x14')](function(_0xf3ac47){if(_0xf3ac47){_0x3bce66[_0xc176('0x4c')]['ChatWebsiteId']=_0xf3ac47['id'];return db[_0xc176('0x5e')][_0xc176('0x51')](_0x3bce66[_0xc176('0x4c')]);}})['then'](respondWithResult(_0x51e7a1,null))[_0xc176('0x1d')](handleError(_0x51e7a1,null));};exports['getAnswers']=function(_0x73877e,_0xec286f){var _0x3993c9={'raw':![],'where':{}};var _0x206cf8={};var _0x4485bf={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x73877e[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xec286f,null))[_0xc176('0x14')](function(_0x56f492){if(_0x56f492){_0x206cf8['model']=_[_0xc176('0x48')](db['CannedAnswer']['rawAttributes']);_0x206cf8[_0xc176('0x37')]=_[_0xc176('0x48')](_0x73877e[_0xc176('0x37')]);_0x206cf8[_0xc176('0x38')]=_[_0xc176('0x49')](_0x206cf8[_0xc176('0x36')],_0x206cf8['query']);_0x3993c9[_0xc176('0x39')]=_['intersection'](_0x206cf8[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x73877e[_0xc176('0x37')]['fields']));_0x3993c9['attributes']=_0x3993c9[_0xc176('0x39')]['length']?_0x3993c9[_0xc176('0x39')]:_0x206cf8[_0xc176('0x36')];if(!_0x73877e[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x3993c9[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x73877e[_0xc176('0x37')][_0xc176('0x24')]);_0x3993c9['offset']=qs[_0xc176('0x22')](_0x73877e[_0xc176('0x37')]['offset']);}_0x3993c9[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x73877e['query'][_0xc176('0x3e')]);_0x3993c9[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x73877e[_0xc176('0x37')],_0x206cf8[_0xc176('0x38')]));_0x3993c9[_0xc176('0x3f')][_0xc176('0x55')]=_0x56f492['id'];if(_0x73877e[_0xc176('0x37')][_0xc176('0x41')]){_0x3993c9['where']=_['merge'](_0x3993c9['where'],{'$or':_[_0xc176('0x30')](_0x3993c9[_0xc176('0x39')],function(_0x3cc768){var _0x4368ec={};_0x4368ec[_0x3cc768]={'$like':'%'+_0x73877e[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x4368ec;})});}_0x3993c9=_[_0xc176('0x42')]({},_0x3993c9,_0x73877e[_0xc176('0x43')]);return db[_0xc176('0x5e')]['count']({'where':_0x3993c9[_0xc176('0x3f')]})[_0xc176('0x14')](function(_0x25e314){_0x4485bf[_0xc176('0x25')]=_0x25e314;if(_0x73877e['query'][_0xc176('0x4a')]){_0x3993c9[_0xc176('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc176('0x45')](_0x3993c9);})[_0xc176('0x14')](function(_0xf7b6d){_0x4485bf[_0xc176('0x5a')]=_0xf7b6d;return _0x4485bf;});}})[_0xc176('0x14')](respondWithFilteredResult(_0xec286f,_0x3993c9))['catch'](handleError(_0xec286f,null));};exports['removeAnswers']=function(_0x1fcc4,_0xed64ed){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x1fcc4[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xed64ed,null))[_0xc176('0x14')](function(_0x3e0c7f){if(_0x3e0c7f){return _0x3e0c7f[_0xc176('0x5f')](_0x1fcc4[_0xc176('0x37')][_0xc176('0x5c')]);}})[_0xc176('0x14')](respondWithStatusCode(_0xed64ed,null))['catch'](handleError(_0xed64ed,null));};exports['addLogo']=function(_0x38e701,_0x581610){_0x38e701[_0xc176('0x4c')]['sitepic']=_0x38e701['file'][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x38e701['params']['id']}})['then'](handleEntityNotFound(_0x581610,null))[_0xc176('0x14')](saveUpdates(_0x38e701[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x581610,null))[_0xc176('0x1d')](handleError(_0x581610,null));};exports[_0xc176('0x61')]=function(_0x2c82ec,_0x703d61){_0x2c82ec[_0xc176('0x4c')][_0xc176('0x62')]=_0x2c82ec['file']['filename'];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x2c82ec[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x703d61,null))['then'](saveUpdates(_0x2c82ec[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x703d61,null))['catch'](handleError(_0x703d61,null));};exports[_0xc176('0x63')]=function(_0x40661a,_0x24dc42){_0x40661a['body'][_0xc176('0x64')]=_0x40661a[_0xc176('0x65')][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x40661a[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x24dc42,null))[_0xc176('0x14')](saveUpdates(_0x40661a[_0xc176('0x4c')],null))[_0xc176('0x14')](respondWithResult(_0x24dc42,null))[_0xc176('0x1d')](handleError(_0x24dc42,null));};exports[_0xc176('0x66')]=function(_0x35fbc7,_0x19a216){_0x35fbc7[_0xc176('0x4c')][_0xc176('0x67')]=_0x35fbc7[_0xc176('0x65')][_0xc176('0x60')];return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x35fbc7[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x19a216,null))[_0xc176('0x14')](saveUpdates(_0x35fbc7['body'],null))[_0xc176('0x14')](respondWithResult(_0x19a216,null))[_0xc176('0x1d')](handleError(_0x19a216,null));};exports[_0xc176('0x68')]=function(_0x2eda37,_0x5ccaee){var _0x5b6f90=path['join'](config[_0xc176('0x69')],_0xc176('0x6a'));var _0x36b134={'where':{'id':_0x2eda37['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x15914e=![];return require(_0xc176('0x6b'))[_0xc176('0x6c')]()[_0xc176('0x14')](function(_0x7f5600){if(_0x7f5600){_0x15914e=_0x7f5600[_0xc176('0x6d')];}})[_0xc176('0x14')](function(){return db[_0xc176('0x31')][_0xc176('0x4b')](_0x36b134);})['then'](handleEntityNotFound(_0x5ccaee,null))[_0xc176('0x14')](function(_0x5e318f){if(_0x5e318f){if(!_[_0xc176('0x6e')](_0x5e318f[_0xc176('0x6f')])){if(fs[_0xc176('0x70')](path[_0xc176('0x71')](config['root'],_0xc176('0x72'),_0x5e318f['sitepic']))&&_0x15914e){_0x5b6f90=path[_0xc176('0x71')](config[_0xc176('0x69')],'server/files/images/logos/',_0x5e318f[_0xc176('0x6f')]);}}return _0x5ccaee[_0xc176('0x73')](_0x5b6f90);}})[_0xc176('0x1d')](handleError(_0x5ccaee,null));};exports['getAvatar']=function(_0x35e4f2,_0x298d2a){var _0x42f1d1=path['join'](config[_0xc176('0x69')],_0xc176('0x74'));var _0x1c371b={'where':{'id':_0x35e4f2[_0xc176('0x47')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x1c371b)['then'](handleEntityNotFound(_0x298d2a,null))[_0xc176('0x14')](function(_0x207a31){if(_0x207a31){if(!_[_0xc176('0x6e')](_0x207a31[_0xc176('0x62')])){if(fs[_0xc176('0x70')](path['join'](config[_0xc176('0x69')],_0xc176('0x75'),_0x207a31[_0xc176('0x62')]))){_0x42f1d1=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0x75'),_0x207a31[_0xc176('0x62')]);}}return _0x298d2a[_0xc176('0x73')](_0x42f1d1);}})[_0xc176('0x1d')](handleError(_0x298d2a,null));};exports[_0xc176('0x76')]=function(_0x13ea68,_0x36d2e3){var _0x527535=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0x77'));var _0x2e823b={'where':{'id':_0x13ea68['params']['id']},'attributes':['id',_0xc176('0x64'),_0xc176('0x78')],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x2e823b)[_0xc176('0x14')](handleEntityNotFound(_0x36d2e3,null))[_0xc176('0x14')](function(_0x324315){if(_0x324315){if(!_['isNil'](_0x324315[_0xc176('0x64')])){if(fs['existsSync'](path['join'](config[_0xc176('0x69')],'server/files/images/avatars/',_0x324315[_0xc176('0x64')]))&&_0x324315['showCustomerAvatar']){_0x527535=path[_0xc176('0x71')](config['root'],_0xc176('0x75'),_0x324315[_0xc176('0x64')]);}}return _0x36d2e3[_0xc176('0x73')](_0x527535);}})[_0xc176('0x1d')](handleError(_0x36d2e3,null));};exports[_0xc176('0x79')]=function(_0x7be092,_0x20455c){var _0x135501=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x196d86={'where':{'id':_0x7be092[_0xc176('0x47')]['id']},'attributes':['id',_0xc176('0x67')],'raw':!![]};return db[_0xc176('0x31')][_0xc176('0x4b')](_0x196d86)[_0xc176('0x14')](handleEntityNotFound(_0x20455c,null))[_0xc176('0x14')](function(_0x520aaf){if(_0x520aaf){if(!_[_0xc176('0x6e')](_0x520aaf[_0xc176('0x67')])){if(fs['existsSync'](path['join'](config['root'],_0xc176('0x75'),_0x520aaf['systemAvatar']))){_0x135501=path['join'](config[_0xc176('0x69')],'server/files/images/avatars/',_0x520aaf['systemAvatar']);}}return _0x20455c['download'](_0x135501);}})[_0xc176('0x1d')](handleError(_0x20455c,null));};exports[_0xc176('0x7a')]=function(_0x5b8eba,_0x1023af){var _0x45d0a0=require(_0xc176('0x7b'));var _0x8b34e8=new _0x45d0a0();var _0x3cf3f4=_0x8b34e8['setUA'](_0x5b8eba[_0xc176('0x7c')][_0xc176('0x7d')])['getResult']();var _0x5bac57={'body':_0x5b8eba['body'],'channel':_0xc176('0x7e')};var _0x488f1e=[];var _0x409a3e=[];var _0x2b5a01={};var _0x58664d=![];return db[_0xc176('0x7f')][_0xc176('0x53')]()['then'](function(_0xce7f8){if(!_0xce7f8){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x82'));}_0x488f1e=_[_0xc176('0x83')](_[_0xc176('0x48')](_0xce7f8),[_0xc176('0x84'),'updatedAt']);_0x409a3e=_[_0xc176('0x83')](_[_0xc176('0x48')](_0xce7f8),[_0xc176('0x84'),_0xc176('0x85'),'CompanyId',_0xc176('0x86')]);if(_0x5b8eba['body']['id']){delete _0x5b8eba[_0xc176('0x4c')]['id'];}if(_[_0xc176('0x6e')](_0x5b8eba[_0xc176('0x4c')]['from'])){throw new db['Sequelize'][(_0xc176('0x81'))](_0xc176('0x87'));}if(_[_0xc176('0x6e')](_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')])||_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')]===''){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x88'));}if(_[_0xc176('0x6e')](_0x5b8eba['body'][_0xc176('0x89')])){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x8a')+_0x409a3e);}if(!_[_0xc176('0x8b')](_0x409a3e,_0x5b8eba[_0xc176('0x4c')][_0xc176('0x89')])){throw new db[(_0xc176('0x80'))][(_0xc176('0x81'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x409a3e);}_0x2b5a01[_0x5b8eba['body'][_0xc176('0x89')]]=_0x5b8eba['body']['from'];})[_0xc176('0x14')](function(){return db['ChatWebsite'][_0xc176('0x4b')]({'where':{'id':_0x5b8eba[_0xc176('0x47')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xc176('0x7f')],'as':_0xc176('0x8c'),'where':_0x2b5a01,'limit':0x1,'order':[[_0xc176('0x85'),_0xc176('0x8d')]]}]},{'model':db[_0xc176('0x8e')],'as':_0xc176('0x8f')}]});})[_0xc176('0x14')](handleEntityNotFound(_0x1023af,null))[_0xc176('0x14')](function(_0x3cf3d2){if(_0x3cf3d2&&_0x3cf3d2[_0xc176('0x90')]){_0x5bac57['account']=_0x3cf3d2;_0x5bac57['applications']=_0x3cf3d2[_0xc176('0x8f')];_0x5bac57[_0xc176('0x91')]=_0x3cf3d2[_0xc176('0x90')];_0x5bac57['applications']=_[_0xc176('0x92')](_0x5bac57['applications'],['priority'],[_0xc176('0x93')]);if(_0x5bac57['account']['Applications']){delete _0x5bac57[_0xc176('0x94')][_0xc176('0x8f')];}if(_0x5bac57[_0xc176('0x94')]['List']&&_0x5bac57[_0xc176('0x94')][_0xc176('0x90')]['Contacts'][_0xc176('0x3b')]){return _0x5bac57[_0xc176('0x94')][_0xc176('0x90')][_0xc176('0x8c')][0x0];}var _0x159718=_[_0xc176('0x95')](_0x5b8eba['body'],{'firstName':_0x5b8eba[_0xc176('0x4c')]['from'],'ListId':_0x3cf3d2[_0xc176('0x86')]});_0x159718[_0x5b8eba[_0xc176('0x4c')]['mapKey']]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0x96')];return db[_0xc176('0x7f')][_0xc176('0x51')](_0x159718,{'fields':_0x488f1e,'raw':!![]});}})[_0xc176('0x14')](handleEntityNotFound(_0x1023af,null))[_0xc176('0x14')](function(_0x4d8caa){_0x5bac57[_0xc176('0x97')]=_0x4d8caa;var _0x11132c=_0x5b8eba[_0xc176('0x4c')][_0xc176('0x98')];if(_0x5b8eba[_0xc176('0x7c')][_0xc176('0x99')]){_0x11132c=_0x5b8eba[_0xc176('0x7c')]['cf-connecting-ip'];}else if(_0x5b8eba['headers'][_0xc176('0x9a')]){_0x11132c=_['first'](_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9a')][_0xc176('0x9b')](','));}if(_0x4d8caa){var _0x2fb464={'ContactId':_0x4d8caa['id'],'ChatWebsiteId':_0x5b8eba['params']['id'],'from':(_0x4d8caa[_0xc176('0x9c')]||'')+'\x20'+(_0x4d8caa[_0xc176('0x9d')]||''),'customerIp':_0x11132c,'customerPort':_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9e')]?_0x5b8eba[_0xc176('0x7c')][_0xc176('0x9e')]:null,'referer':_0x5b8eba[_0xc176('0x4c')][_0xc176('0x9f')],'browserName':_0x3cf3f4[_0xc176('0xa0')][_0xc176('0x2b')]&&_0x3cf3f4[_0xc176('0xa0')]['version']?util['format'](_0xc176('0xa1'),_0x3cf3f4['browser']['name'],_0x3cf3f4[_0xc176('0xa0')][_0xc176('0xa2')]):'unknown','browserVersion':_0x3cf3f4[_0xc176('0xa0')][_0xc176('0xa2')]||_0xc176('0xa3'),'osName':util[_0xc176('0xa4')](_0xc176('0xa1'),_0x3cf3f4['os'][_0xc176('0x2b')],_0x3cf3f4['os'][_0xc176('0xa2')]),'osVersion':_0x3cf3f4['os'][_0xc176('0xa2')],'deviceModel':_0x3cf3f4[_0xc176('0xa5')]['model']&&_0x3cf3f4[_0xc176('0xa5')][_0xc176('0xa6')]?util[_0xc176('0xa4')](_0xc176('0xa7'),_0x3cf3f4[_0xc176('0xa5')][_0xc176('0x36')],_0x3cf3f4['device'][_0xc176('0xa6')],_0x3cf3f4[_0xc176('0xa5')]['type']):null,'deviceVendor':_0x3cf3f4[_0xc176('0xa5')]['vendor'],'deviceType':_0x3cf3f4[_0xc176('0xa5')][_0xc176('0x34')],'formData':JSON['stringify'](_0x5b8eba[_0xc176('0x4c')])};var _0x5354f8={'ChatWebsiteId':_0x5b8eba[_0xc176('0x47')]['id'],'closed':![]};if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]){_0x5354f8[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')];return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':_0x5354f8})[_0xc176('0x14')](function(_0x301950){if(_0x301950){return[_0x301950,![]];}_0x2fb464[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')];_0x2fb464[_0xc176('0xaa')]=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xaa')];return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)[_0xc176('0x14')](function(_0x3dd10a){return[_0x3dd10a,!![]];});});}_0x5354f8[_0xc176('0xab')]=_0x4d8caa['id'];if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xac')]&&_0x5b8eba['body'][_0xc176('0xac')]['id']){_0x5354f8['id']=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xac')]['id'];return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':_0x5354f8})[_0xc176('0x14')](function(_0x114f60){if(_0x114f60){return[_0x114f60,![]];}return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)['then'](function(_0x5078db){return[_0x5078db,!![]];});});}return db[_0xc176('0xa9')][_0xc176('0x51')](_0x2fb464)[_0xc176('0x14')](function(_0x1feb6b){return[_0x1feb6b,!![]];});}})['spread'](function(_0x77312b,_0xe8a1e6){if(_0x77312b){_0x58664d=_0xe8a1e6;if(!_0xe8a1e6){var _0xe433d4={'from':(_0x5bac57[_0xc176('0x97')][_0xc176('0x9c')]||'')+'\x20'+(_0x5bac57[_0xc176('0x97')][_0xc176('0x9d')]||'')};if(_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]&&_0x5b8eba['body'][_0xc176('0xad')]&&_0x5b8eba[_0xc176('0x4c')][_0xc176('0xa8')]!=_0x5b8eba[_0xc176('0x4c')][_0xc176('0xad')]){_0xe433d4[_0xc176('0xa8')]=_0x5b8eba[_0xc176('0x4c')]['messageId'];}return _0x77312b[_0xc176('0x26')](_0xe433d4);}else{return _0x77312b;}}})[_0xc176('0x14')](function(_0x307ea6){_0x5bac57[_0xc176('0xac')]=_0x307ea6[_0xc176('0x27')]({'plain':!![]});_0x5bac57[_0xc176('0xac')][_0xc176('0xae')]=_0x58664d;if(_0x5bac57[_0xc176('0xac')][_0xc176('0xae')]){if(_0x5bac57[_0xc176('0x94')]['autoclose']){_0x5bac57[_0xc176('0xaf')][_0xc176('0xb0')]({'id':0x0,'priority':_0x5bac57[_0xc176('0xaf')]['length']+0x1,'app':_0xc176('0xb1'),'appdata':_0xc176('0xb2'),'interval':_0xc176('0xb3')});}}return db[_0xc176('0xb4')][_0xc176('0x51')]({'body':_0x5b8eba[_0xc176('0x4c')][_0xc176('0x4c')],'ChatWebsiteId':_0x5b8eba[_0xc176('0x47')]['id'],'ChatInteractionId':_0x307ea6['id'],'direction':'in','ContactId':_0x5bac57['contact']['id'],'AttachmentId':_0x5b8eba[_0xc176('0x4c')][_0xc176('0xb5')]});})[_0xc176('0x14')](function(_0x53e07b){_0x5bac57[_0xc176('0x1b')]=_0x53e07b;if(_0x5bac57[_0xc176('0xac')][_0xc176('0xb6')]){return db[_0xc176('0xb7')][_0xc176('0x4b')]({'attributes':['id',_0xc176('0x2b')],'where':{'id':_0x5bac57[_0xc176('0xac')]['UserId']}})[_0xc176('0x14')](function(_0x196abb){if(_0x196abb){_0x5bac57[_0xc176('0xaf')][_0xc176('0xb8')]({'id':0x0,'priority':0x0,'app':_0xc176('0xb9'),'appdata':_0x196abb['name']+','+(_0x5bac57[_0xc176('0x94')][_0xc176('0xba')]||0xa),'interval':_0xc176('0xb3')});_0x5bac57[_0xc176('0xbb')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x5bac57);});}return respondWithRpcPromise('Start',_0xc176('0xbc'),_0x5bac57);})['then'](function(_0x304735){respondWithRpcPromise(_0xc176('0xbd'),_0xc176('0xbd'),{'event':_0xc176('0x7a'),'message':_0x304735},client9002);return _0x304735;})['then'](respondWithResult(_0x1023af,null))[_0xc176('0x1d')](handleError(_0x1023af,null));};exports[_0xc176('0xbe')]=function(_0x12a308,_0x3208d9){var _0x4405d8,_0x29f4ac,_0x2c81ac;var _0x363673=[];var _0xd84481={};var _0x312107=_0x12a308['files']||[];var _0x9a527f=[];var _0x46a574;return db[_0xc176('0x7f')][_0xc176('0x53')]()[_0xc176('0x14')](function(_0x5e8863){if(!_0x5e8863){throw new db['Sequelize'][(_0xc176('0x81'))](_0xc176('0x82'));}_0x363673=_[_0xc176('0x83')](_[_0xc176('0x48')](_0x5e8863),[_0xc176('0x84'),_0xc176('0x85'),_0xc176('0xbf'),'ListId']);if(_0x12a308[_0xc176('0x4c')]['id']){delete _0x12a308['body']['id'];}if(_[_0xc176('0x6e')](_0x12a308[_0xc176('0x4c')][_0xc176('0x96')])){throw _0x3208d9[_0xc176('0x1f')](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x87')));}if(_['isNil'](_0x12a308[_0xc176('0x4c')][_0xc176('0x4c')])||_0x12a308[_0xc176('0x4c')][_0xc176('0x4c')]===''){throw _0x3208d9[_0xc176('0x1f')](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0x88')));}if(_['isNil'](_0x12a308['body']['mapKeyOffline'])){throw _0x3208d9['status'](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))](_0xc176('0xc0')+_0x363673));}if(!_[_0xc176('0x8b')](_0x363673,_0x12a308[_0xc176('0x4c')]['mapKeyOffline'])){throw _0x3208d9['status'](0x1f4)[_0xc176('0x2c')](new db[(_0xc176('0x80'))][(_0xc176('0x81'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x363673));}_0xd84481[_0x12a308[_0xc176('0x4c')]['mapKeyOffline']]=_0x12a308['body'][_0xc176('0x96')];})[_0xc176('0x14')](function(){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x12a308['params']['id']},'include':[{'model':db[_0xc176('0xc1')],'as':_0xc176('0x90')},{'model':db[_0xc176('0xc2')],'as':_0xc176('0xc2')}]});})[_0xc176('0x14')](handleEntityNotFound(_0x3208d9,null))['then'](function(_0xdac1a1){if(_0xdac1a1&&_0xdac1a1['List']){_0x29f4ac=_0xdac1a1;var _0x2be313=_[_0xc176('0x95')](_0x12a308[_0xc176('0x4c')],{'firstName':_0x12a308[_0xc176('0x4c')][_0xc176('0x96')],'phone':_0x12a308[_0xc176('0x4c')][_0xc176('0x96')],'ListId':_0xdac1a1['ListId']});_0x2be313[_0x12a308[_0xc176('0x4c')]['mapKeyOffline']]=_0x12a308[_0xc176('0x4c')]['from'];return db[_0xc176('0x7f')][_0xc176('0xc3')]({'where':_0xd84481,'defaults':_0x2be313});}})[_0xc176('0xc4')](function(_0x311e9f){if(_0x311e9f){_0x2c81ac=_0x311e9f;var _0x5b7b97=fs[_0xc176('0xc5')](path['join'](config[_0xc176('0x69')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x51718e=ejs[_0xc176('0xc6')](_0x5b7b97,{'body':_[_0xc176('0xc7')](_0x12a308[_0xc176('0x4c')]['body']),'bodyTitle':_0x29f4ac[_0xc176('0xc8')]});return db['ChatOfflineMessage']['create']({'body':_0x51718e,'plainBody':htmlToText['fromString'](_0x51718e),'ContactId':_0x311e9f['id'],'ChatWebsiteId':_0x29f4ac['id']});}})[_0xc176('0x14')](function(_0x28b229){_0x46a574=_0x28b229;if(_0x312107[_0xc176('0x3b')]){var _0x259c98=_0x312107[_0xc176('0x30')](function(_0x4ddad9){return{'name':_0x4ddad9[_0xc176('0xc9')],'basename':_0x4ddad9['filename'],'type':_0x4ddad9['mimetype'],'ChatOfflineMessageId':_0x28b229['id']};});_0x9a527f=_0x259c98[_0xc176('0x30')](_0x11276d=>{var _0x5aa8e3={'filename':_0x11276d['name'],'path':path[_0xc176('0x71')](config[_0xc176('0x69')],'server',_0xc176('0xca'),_0xc176('0xcb'),_0xc176('0xcc'),_0x11276d[_0xc176('0xcd')])};return _0x5aa8e3;});if(!_0x29f4ac[_0xc176('0xce')]){return db[_0xc176('0xcf')][_0xc176('0xd0')](function(_0x56a409){return db['Attachment'][_0xc176('0xd1')](_0x259c98,{'transaction':_0x56a409});});}}})['then'](function(){if(_0x46a574){_0x4405d8=_0x46a574;return db[_0xc176('0xc2')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xc176('0xd2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xc176('0xd3')],'as':_0xc176('0xd3'),'raw':!![]}]}]});}})[_0xc176('0x14')](function(_0x1b2857){if(_0x1b2857&&_0x1b2857[_0xc176('0xd4')]&&_0x29f4ac['forwardOffline']&&_0x29f4ac[_0xc176('0xd5')]){var _0x3debd1=_0x1b2857['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xc176('0xd6'),{'account':_0x3debd1,'message':{'from':util['format'](_0xc176('0xd7'),_0x1b2857[_0xc176('0x2b')],_0x1b2857[_0xc176('0xd8')]||_0x1b2857[_0xc176('0xd4')][_0xc176('0x4d')]),'to':_0x29f4ac[_0xc176('0xd5')],'subject':_0x29f4ac[_0xc176('0xd9')],'html':_0x4405d8[_0xc176('0x4c')],'attachments':_0x9a527f}},client9003)['then'](function(){return _0x4405d8;})['catch'](function(_0x34685a){logger[_0xc176('0x18')](_0x34685a);});}})[_0xc176('0x14')](function(){if(_0x29f4ac&&_0x29f4ac[_0xc176('0xce')]&&_0x29f4ac[_0xc176('0xda')]){var _0x2e45a9=[];if(_0x312107['length']){_0x2e45a9=_0x312107[_0xc176('0x30')](function(_0x50a753){return{'name':_0x50a753[_0xc176('0xc9')],'basename':_0x50a753[_0xc176('0x60')],'type':_0x50a753[_0xc176('0xdb')],'ChatOfflineMessageId':_0x46a574['id']};});}var _0x5285c;if(!_[_0xc176('0x6e')](_0x29f4ac[_0xc176('0xdc')])){var _0x1f7ff6=_[_0xc176('0x30')](_0x12a308[_0xc176('0x4c')],function(_0x63eb3d){return _0x63eb3d;});var _0x1afa4a=_['toPairsIn'](_0x1f7ff6)[0x0];var _0x3b5542=_['mapValues'](_0x1afa4a,function(_0x455afb){return _0x455afb;});_0x5285c=_0x3b5542[0x1][_0x29f4ac[_0xc176('0xdc')]];}var _0x3474ec={'from':_0x2c81ac['email'],'firstName':_0x2c81ac[_0xc176('0x9c')],'lastName':_0x2c81ac[_0xc176('0x9d')],'mapKey':_0xc176('0xd8'),'message':{'from':_0x2c81ac[_0xc176('0xd8')],'to':_0x29f4ac['MailAccount'][_0xc176('0xd8')],'cc':'','subject':_['isNil'](_0x5285c)?_0x29f4ac[_0xc176('0xd9')]:_0x5285c,'messageId':'','sentAt':new Date(),'attach':_0x2e45a9[_0xc176('0x3b')],'attachments':_0x2e45a9,'originChannel':_0xc176('0xdd'),'ChatWebsiteId':_0x29f4ac['id'],'ChatOfflineMessageId':_0x4405d8['id'],'originTo':_0x29f4ac[_0xc176('0xc2')][_0xc176('0xd8')]},'body':_0x4405d8['body']};var _0x7b1f60={'account':{'id':_0x29f4ac[_0xc176('0xda')]},'body':_0x3474ec,'log':_0xc176('0xde')};return respondWithRpcPromise(_0xc176('0xde'),_0xc176('0xdf'),_0x7b1f60,client9001)['then'](function(){return _0x4405d8;})[_0xc176('0x1d')](function(_0x747e38){logger['error'](_0x747e38);});}return;})['then'](function(){if(_0x4405d8){return _0x4405d8;}})['then'](respondWithResult(_0x3208d9,null))[_0xc176('0x1d')](function(_0x1ace02){logger[_0xc176('0x18')](_0xc176('0x1d'),_0x1ace02);for(var _0xab20ea of _0x312107){var _0x1f2295=path[_0xc176('0x71')](config[_0xc176('0x69')],_0xc176('0xe0'),'files',_0xc176('0xcb'),_0xc176('0xcc'),_0xab20ea[_0xc176('0x60')]);fs_extra[_0xc176('0xe1')](_0x1f2295)[_0xc176('0x1d')](function(_0x24d3e9){logger[_0xc176('0x18')](_0xc176('0xe2'),_0x1f2295,_0x24d3e9);});}});};exports[_0xc176('0xe3')]=function(_0x136924,_0x42ad0d){return db[_0xc176('0xa9')][_0xc176('0x4b')]({'where':{'id':_0x136924['params']['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x42ad0d,null))[_0xc176('0x14')](function(_0x4acc7f){if(_0x4acc7f){return _0x4acc7f[_0xc176('0xe3')](_0x136924[_0xc176('0x4c')][_0xc176('0x5c')],_['omit'](_0x136924[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{});}})[_0xc176('0x14')](respondWithResult(_0x42ad0d,null))[_0xc176('0x1d')](handleError(_0x42ad0d,null));};exports[_0xc176('0xe4')]=function(_0x23d78b,_0x3dbd17){var _0x4f60ea={'raw':![],'where':{}};var _0xe0ac73={};var _0x397f51={'count':0x0,'rows':[]};return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x23d78b['params']['id']}})['then'](handleEntityNotFound(_0x3dbd17,null))[_0xc176('0x14')](function(_0x112e98){if(_0x112e98){_0xe0ac73[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0xa9')][_0xc176('0x32')]);_0xe0ac73[_0xc176('0x37')]=_[_0xc176('0x48')](_0x23d78b[_0xc176('0x37')]);_0xe0ac73[_0xc176('0x38')]=_[_0xc176('0x49')](_0xe0ac73[_0xc176('0x36')],_0xe0ac73['query']);_0x4f60ea[_0xc176('0x39')]=_[_0xc176('0x49')](_0xe0ac73['model'],qs[_0xc176('0x3a')](_0x23d78b[_0xc176('0x37')][_0xc176('0x3a')]));_0x4f60ea[_0xc176('0x39')]=_0x4f60ea[_0xc176('0x39')][_0xc176('0x3b')]?_0x4f60ea[_0xc176('0x39')]:_0xe0ac73[_0xc176('0x36')];if(!_0x23d78b[_0xc176('0x37')][_0xc176('0x3c')](_0xc176('0x59'))){_0x4f60ea[_0xc176('0x24')]=qs['limit'](_0x23d78b[_0xc176('0x37')][_0xc176('0x24')]);_0x4f60ea['offset']=qs[_0xc176('0x22')](_0x23d78b['query'][_0xc176('0x22')]);}_0x4f60ea[_0xc176('0x3d')]=qs['sort'](_0x23d78b['query']['sort']);_0x4f60ea[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x23d78b['query'],_0xe0ac73[_0xc176('0x38')]));_0x4f60ea[_0xc176('0x3f')][_0xc176('0x55')]=_0x112e98['id'];if(_0x23d78b[_0xc176('0x37')][_0xc176('0x41')]){_0x4f60ea[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x4f60ea[_0xc176('0x3f')],{'$or':_['map'](_0x4f60ea[_0xc176('0x39')],function(_0x5b0f3b){var _0x4fd3c4={};_0x4fd3c4[_0x5b0f3b]={'$like':'%'+_0x23d78b['query'][_0xc176('0x41')]+'%'};return _0x4fd3c4;})});}_0x4f60ea=_[_0xc176('0x42')]({},_0x4f60ea,_0x23d78b['options']);return db[_0xc176('0xa9')][_0xc176('0x25')]({'where':_0x4f60ea[_0xc176('0x3f')]})['then'](function(_0x140c16){_0x397f51[_0xc176('0x25')]=_0x140c16;if(_0x23d78b['query'][_0xc176('0x4a')]){_0x4f60ea[_0xc176('0x44')]=[{'model':db[_0xc176('0x7f')],'as':_0xc176('0xe5'),'required':![]},{'model':db[_0xc176('0xb7')],'as':_0xc176('0xe6'),'attributes':['name',_0xc176('0xe7'),_0xc176('0xe8')],'required':![]},{'model':db[_0xc176('0xe9')],'as':_0xc176('0xea'),'attributes':['id',_0xc176('0x2b'),_0xc176('0xeb')],'where':_0x23d78b[_0xc176('0x37')][_0xc176('0xec')]?{'id':_0x23d78b['query'][_0xc176('0xec')]}:undefined,'required':_0x23d78b['query'][_0xc176('0xec')]?!![]:![]}];}return db[_0xc176('0xa9')][_0xc176('0x45')](_0x4f60ea);})['then'](function(_0x5001bc){_0x397f51['rows']=_0x5001bc;return _0x397f51;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x3dbd17,_0x4f60ea))['catch'](handleError(_0x3dbd17,null));};function iftimePromise(_0xa63d8c,_0xa688ab){return respondWithRpcPromise('Command',_0xc176('0xed'),{'command':_0xa688ab[_0xc176('0xee')]?util[_0xc176('0xa4')](_0xc176('0xef'),_0xa63d8c[_0xc176('0xf0')],_0xa688ab['timezone']):util[_0xc176('0xa4')](_0xc176('0xf1'),_0xa63d8c[_0xc176('0xf0')])},client9002)['then'](function(_0x5b597b){var _0x41a2c1=_0x5b597b&&_0x5b597b['indexOf'](_0xc176('0xf2'))>=0x0?!![]:![];logger[_0xc176('0x15')](_0xc176('0xf3'),_0xa688ab['id'],_0xa63d8c['id'],_0xa63d8c['interval'],_0x41a2c1?_0xc176('0xf4'):_0xc176('0xf5'),_0xa688ab[_0xc176('0xee')]?_0xa688ab[_0xc176('0xee')]:_0xc176('0xf6'));return _0x41a2c1;})[_0xc176('0x1d')](function(_0x5c6920){logger[_0xc176('0x18')](_0xc176('0xf3'),_0xa688ab['id'],_0xa63d8c['id'],_0xa63d8c['interval'],util[_0xc176('0xf7')](_0x5c6920,{'showHidden':![],'depth':null}),_0xa688ab[_0xc176('0xee')]?_0xa688ab['timezone']:_0xc176('0xf6'));return![];});}exports[_0xc176('0xed')]=function(_0x3cb3d5,_0x30534c){var _0x5d85a6=0x0;var _0x55c610=0x0;var _0xc0463b=![];var _0x18da2b;var _0x3a622a;return db['ChatWebsite']['find']({'where':{'id':_0x3cb3d5[_0xc176('0x47')]['id']},'include':[{'model':db[_0xc176('0xf8')],'as':_0xc176('0xf8'),'include':[{'model':db[_0xc176('0xf8')],'as':_0xc176('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x30534c,null))[_0xc176('0x14')](function(_0x1b5ab9){if(_0x1b5ab9){_0x18da2b=_0x1b5ab9;return _0x1b5ab9[_0xc176('0xfa')]({'raw':!![]});}})[_0xc176('0x14')](function(_0x4fa164){if(_0x18da2b){if(_0x4fa164){_0x3a622a=_0x4fa164;}}return require(_0xc176('0x6b'))[_0xc176('0x6c')]();})[_0xc176('0x14')](function(_0x48c800){if(_0x48c800){_0x55c610=_0x48c800['virtual'];_0xc0463b=_0x48c800['custom'];}})[_0xc176('0x14')](function(){return db['ChatInteraction'][_0xc176('0x25')]({'where':{'closed':![]}});})['then'](function(_0x4ee060){_0x5d85a6=_0x4ee060;if(_0x55c610&&_0x4ee060>_0x55c610){return db['License'][_0xc176('0x58')]({'where':{'id':0x1}})[_0xc176('0x14')](function(_0x4435e7){if(_0x4435e7){_0x4435e7[_0xc176('0xfb')](_0xc176('0xfc'));}});}})[_0xc176('0x14')](function(){if(_0x18da2b['Interval']&&_0x18da2b[_0xc176('0xf8')]['Intervals']){var _0x687223=[];for(var _0x33bd67=0x0;_0x33bd67<_0x18da2b[_0xc176('0xf8')][_0xc176('0xf9')][_0xc176('0x3b')];_0x33bd67++){var _0x2cc243=_0x18da2b[_0xc176('0xf8')][_0xc176('0xf9')][_0x33bd67][_0xc176('0x27')]({'plain':!![]});_0x687223['push'](iftimePromise(_0x2cc243,_0x18da2b));}return BPromise[_0xc176('0xfd')](_0x687223)[_0xc176('0x14')](function(_0x104b8a){return _[_0xc176('0xfe')](_0x104b8a);});}else{return!![];}})[_0xc176('0x14')](function(_0x15f9d9){var _0x261f89=fs['readFileSync'](path[_0xc176('0x71')](config[_0xc176('0x69')],'server/files/chat/iframe.ejs'),_0xc176('0xff'));var _0x4d7dcd=new url[(_0xc176('0x100'))](_0x18da2b['address'])[_0xc176('0x101')];var _0x87d09d=_0xc176('0x102');var _0x3abb15=![];var _0x136a38={'chatVersion':_0x87d09d,'chatWebsiteAddressOrigin':_0x4d7dcd,'remote':_0x18da2b[_0xc176('0x103')],'query':querystring['stringify'](_[_0xc176('0x42')](_0x18da2b[_0xc176('0x27')]({'plain':!![]}),{'customerIp':_0x3cb3d5[_0xc176('0x7c')]['x-forwarded-for']||_0x3cb3d5[_0xc176('0x7c')][_0xc176('0x104')]||_0x3cb3d5[_0xc176('0x105')]['remoteAddress']||_0x3cb3d5['ip'],'referer':_0x3cb3d5[_0xc176('0x7c')][_0xc176('0x9f')],'openedInteractions':_0x5d85a6,'maxInteractions':_0x55c610,'virtual':_0xc0463b[_0xc176('0x106')],'online':_0x15f9d9,'custom':_0xc0463b}))[_0xc176('0x107')](/'/g,'\x5c\x27')};_0x30534c[_0xc176('0x2c')](ejs['render'](Mustache['render'](_0x261f89,_0x136a38),{'proactiveActions':_0x3a622a,'alignment':_0x18da2b[_0xc176('0x108')],'verticalAlignment':_0x18da2b[_0xc176('0x109')],'div_color':_0x18da2b[_0xc176('0xeb')],'labelText':_0x18da2b[_0xc176('0x10a')],'text_color':_0x18da2b[_0xc176('0x10b')],'text_button_color':_0x18da2b[_0xc176('0x10c')],'button_color':_0x18da2b[_0xc176('0x10d')],'background_color':_0x18da2b[_0xc176('0x10e')],'hideWhenOffline':_0x18da2b[_0xc176('0x10f')],'intervalId':_0x18da2b[_0xc176('0x110')],'isDevelopment':_0x3abb15,'chatVersion':_0x87d09d}));})[_0xc176('0x1d')](handleError(_0x30534c,null));};exports[_0xc176('0x111')]=function(_0x33b9c0,_0x5be755){var _0x2f2044=_0x33b9c0['params']['id'];var _0x3c50b5=_0x33b9c0['body'];var _0x1ce584=0xc8;var _0x24dd17=null;return db[_0xc176('0xcf')]['transaction']({'isolationLevel':db[_0xc176('0xcf')][_0xc176('0x112')][_0xc176('0x113')][_0xc176('0x114')]},function(_0x505d45){return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x2f2044},'transaction':_0x505d45})[_0xc176('0x14')](function(_0xb2157b){if(_0xb2157b){return db[_0xc176('0x8e')][_0xc176('0x115')]({'where':{'ChatWebsiteId':_0x2f2044},'transaction':_0x505d45})[_0xc176('0x14')](function(){var _0x17e089=_['map'](_0x3c50b5,function(_0x11c0b4){_0x11c0b4[_0xc176('0x55')]=_0x2f2044;return _0x11c0b4;});return db[_0xc176('0x8e')]['bulkCreate'](_0x17e089,{'transaction':_0x505d45});});}else{_0x1ce584=0x194;_0x24dd17=[];}});})[_0xc176('0x14')](function(){if(_0x1ce584!==0x194){return db[_0xc176('0x8e')][_0xc176('0x116')]({'where':{'ChatWebsiteId':_0x2f2044},'order':_0xc176('0x117')})[_0xc176('0x14')](function(_0x47990f){_0x24dd17=_0x47990f;});}})[_0xc176('0x1d')](function(_0x5624d2){_0x1ce584=0x1f4;logger[_0xc176('0x18')](_0x5624d2[_0xc176('0x2a')]);if(_0x5624d2[_0xc176('0x2b')]){delete _0x5624d2[_0xc176('0x2b')];}_0x24dd17=_0x5624d2;})[_0xc176('0x118')](function(){if(_0x24dd17===null){_0x5be755[_0xc176('0x1e')](_0x1ce584);}else{if(_0x1ce584===0x1f4){_0x5be755[_0xc176('0x1f')](_0x1ce584)[_0xc176('0x2c')](_0x24dd17);}else{_0x5be755[_0xc176('0x1f')](_0x1ce584)[_0xc176('0x21')](_0x24dd17);}}});};exports['getApplications']=function(_0x35ca0c,_0x3fe310){var _0x53d3da={};var _0x11ac6f={};var _0x52c9bd;var _0x6e00f1;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x35ca0c['params']['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x3fe310,null))[_0xc176('0x14')](function(_0x5776fd){if(_0x5776fd){_0x52c9bd=_0x5776fd;_0x11ac6f[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0x8e')][_0xc176('0x32')]);_0x11ac6f['query']=_[_0xc176('0x48')](_0x35ca0c[_0xc176('0x37')]);_0x11ac6f[_0xc176('0x38')]=_[_0xc176('0x49')](_0x11ac6f['model'],_0x11ac6f[_0xc176('0x37')]);_0x53d3da[_0xc176('0x39')]=_[_0xc176('0x49')](_0x11ac6f[_0xc176('0x36')],qs['fields'](_0x35ca0c['query'][_0xc176('0x3a')]));_0x53d3da['attributes']=_0x53d3da[_0xc176('0x39')][_0xc176('0x3b')]?_0x53d3da['attributes']:_0x11ac6f[_0xc176('0x36')];_0x53d3da[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x35ca0c['query'][_0xc176('0x3e')]);_0x53d3da['where']=qs[_0xc176('0x38')](_['pick'](_0x35ca0c[_0xc176('0x37')],_0x11ac6f[_0xc176('0x38')]));if(_0x35ca0c[_0xc176('0x37')][_0xc176('0x41')]){_0x53d3da[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x53d3da[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x53d3da['attributes'],function(_0x1596f8){var _0x519a04={};_0x519a04[_0x1596f8]={'$like':'%'+_0x35ca0c[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x519a04;})});}_0x53d3da=_['merge']({},_0x53d3da,_0x35ca0c[_0xc176('0x43')]);return _0x52c9bd[_0xc176('0x119')](_0x53d3da);}})[_0xc176('0x14')](function(_0x5214ca){if(_0x5214ca){_0x6e00f1=_0x5214ca[_0xc176('0x3b')];if(!_0x35ca0c[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x53d3da[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x35ca0c[_0xc176('0x37')][_0xc176('0x24')]);_0x53d3da[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x35ca0c[_0xc176('0x37')][_0xc176('0x22')]);}return _0x52c9bd[_0xc176('0x119')](_0x53d3da);}})[_0xc176('0x14')](function(_0x4b5c1d){if(_0x4b5c1d){return _0x4b5c1d?{'count':_0x6e00f1,'rows':_0x4b5c1d}:null;}})[_0xc176('0x14')](respondWithResult(_0x3fe310,null))['catch'](handleError(_0x3fe310,null));};exports[_0xc176('0x11a')]=function(_0x5f17b9,_0x402fac){return db['chatProactiveAction'][_0xc176('0x4b')]({'where':{'id':_0x5f17b9[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x402fac,null))[_0xc176('0x14')](function(_0x1244a4){if(_0x1244a4){return _0x1244a4[_0xc176('0x11a')](_0x5f17b9[_0xc176('0x4c')][_0xc176('0x5c')],_[_0xc176('0x11b')](_0x5f17b9[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{});}})[_0xc176('0x14')](respondWithResult(_0x402fac,null))['catch'](handleError(_0x402fac,null));};exports['getProactiveActions']=function(_0x38885c,_0x3f5535){var _0x69614a={};var _0x3aa269={};var _0x168cb4;var _0x277cd2;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x38885c[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f5535,null))['then'](function(_0x26a0c6){if(_0x26a0c6){_0x168cb4=_0x26a0c6;_0x3aa269[_0xc176('0x36')]=_['keys'](db[_0xc176('0x11c')][_0xc176('0x32')]);_0x3aa269[_0xc176('0x37')]=_['keys'](_0x38885c[_0xc176('0x37')]);_0x3aa269[_0xc176('0x38')]=_['intersection'](_0x3aa269[_0xc176('0x36')],_0x3aa269[_0xc176('0x37')]);_0x69614a[_0xc176('0x39')]=_[_0xc176('0x49')](_0x3aa269['model'],qs['fields'](_0x38885c['query'][_0xc176('0x3a')]));_0x69614a['attributes']=_0x69614a[_0xc176('0x39')][_0xc176('0x3b')]?_0x69614a[_0xc176('0x39')]:_0x3aa269[_0xc176('0x36')];_0x69614a['order']=qs[_0xc176('0x3e')](_0x38885c[_0xc176('0x37')][_0xc176('0x3e')]);_0x69614a[_0xc176('0x3f')]=qs['filters'](_[_0xc176('0x40')](_0x38885c[_0xc176('0x37')],_0x3aa269[_0xc176('0x38')]));if(_0x38885c[_0xc176('0x37')][_0xc176('0x41')]){_0x69614a['where']=_[_0xc176('0x42')](_0x69614a[_0xc176('0x3f')],{'$or':_[_0xc176('0x30')](_0x69614a[_0xc176('0x39')],function(_0xea3c6){var _0x2f95b4={};_0x2f95b4[_0xea3c6]={'$like':'%'+_0x38885c[_0xc176('0x37')]['filter']+'%'};return _0x2f95b4;})});}_0x69614a=_[_0xc176('0x42')]({},_0x69614a,_0x38885c[_0xc176('0x43')]);return _0x168cb4[_0xc176('0xfa')](_0x69614a);}})[_0xc176('0x14')](function(_0xa31cb2){if(_0xa31cb2){_0x277cd2=_0xa31cb2['length'];if(!_0x38885c[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x69614a['limit']=qs[_0xc176('0x24')](_0x38885c[_0xc176('0x37')][_0xc176('0x24')]);_0x69614a[_0xc176('0x22')]=qs['offset'](_0x38885c[_0xc176('0x37')]['offset']);}return _0x168cb4[_0xc176('0xfa')](_0x69614a);}})[_0xc176('0x14')](function(_0x3638c8){if(_0x3638c8){return _0x3638c8?{'count':_0x277cd2,'rows':_0x3638c8}:null;}})['then'](respondWithResult(_0x3f5535,null))[_0xc176('0x1d')](handleError(_0x3f5535,null));};exports[_0xc176('0x11d')]=function(_0x42a3af,_0x18831f){var _0x309007=_0x42a3af[_0xc176('0x37')][_0xc176('0x11e')]===_0xc176('0x11f')?_0xc176('0x120'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x309007],'where':{'id':_0x42a3af[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x18831f,null))[_0xc176('0x14')](function(_0x43ce5b){if(_0x43ce5b){var _0x37f4b3=_0x43ce5b[_0x309007];var _0x6e7346=_0x37f4b3&&_0x37f4b3['items']?_0x37f4b3[_0xc176('0x121')]:[];_0x18831f[_0xc176('0x2c')]({'fromKey':_[_0xc176('0x6e')](_0x37f4b3[_0xc176('0x122')])?undefined:_0x37f4b3[_0xc176('0x122')],'count':_0x6e7346[_0xc176('0x3b')],'rows':_0x6e7346});}})[_0xc176('0x1d')](handleError(_0x18831f,null));};exports[_0xc176('0x123')]=function(_0x1d1d3b,_0x1f464b){var _0x52d435={'raw':![],'where':{}};var _0x160279={};var _0x51c7c4={'count':0x0,'rows':[]};return db[_0xc176('0x31')]['findOne']({'where':{'id':_0x1d1d3b[_0xc176('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f464b,null))[_0xc176('0x14')](function(_0x1dae1d){if(_0x1dae1d){_0x160279['model']=_['keys'](db[_0xc176('0x124')]['rawAttributes']);_0x160279['query']=_['keys'](_0x1d1d3b['query']);_0x160279[_0xc176('0x38')]=_[_0xc176('0x49')](_0x160279['model'],_0x160279[_0xc176('0x37')]);_0x52d435[_0xc176('0x39')]=_['intersection'](_0x160279[_0xc176('0x36')],qs['fields'](_0x1d1d3b[_0xc176('0x37')][_0xc176('0x3a')]));_0x52d435[_0xc176('0x39')]=_0x52d435[_0xc176('0x39')][_0xc176('0x3b')]?_0x52d435[_0xc176('0x39')]:_0x160279['model'];if(!_0x1d1d3b[_0xc176('0x37')][_0xc176('0x3c')]('nolimit')){_0x52d435[_0xc176('0x24')]=qs[_0xc176('0x24')](_0x1d1d3b['query'][_0xc176('0x24')]);_0x52d435[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x1d1d3b['query'][_0xc176('0x22')]);}_0x52d435[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x1d1d3b[_0xc176('0x37')]['sort']);_0x52d435[_0xc176('0x3f')]=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x1d1d3b['query'],_0x160279[_0xc176('0x38')]));_0x52d435['where']['ChatWebsiteId']=_0x1dae1d['id'];if(_0x1d1d3b['query'][_0xc176('0x41')]){_0x52d435[_0xc176('0x3f')]=_[_0xc176('0x42')](_0x52d435[_0xc176('0x3f')],{'$or':_['map'](_0x52d435[_0xc176('0x39')],function(_0x4fabbc){var _0x8f8164={};_0x8f8164[_0x4fabbc]={'$like':'%'+_0x1d1d3b[_0xc176('0x37')][_0xc176('0x41')]+'%'};return _0x8f8164;})});}_0x52d435=_[_0xc176('0x42')]({},_0x52d435,_0x1d1d3b[_0xc176('0x43')]);return db[_0xc176('0x124')][_0xc176('0x25')]({'where':_0x52d435[_0xc176('0x3f')]})[_0xc176('0x14')](function(_0x17d03e){_0x51c7c4['count']=_0x17d03e;if(_0x1d1d3b['query'][_0xc176('0x4a')]){_0x52d435[_0xc176('0x44')]=[{'all':!![]}];}else{_0x52d435['include']=[{'model':db[_0xc176('0x7f')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xc176('0x124')]['findAll'](_0x52d435);})[_0xc176('0x14')](function(_0x8d5a1f){_0x51c7c4[_0xc176('0x5a')]=_0x8d5a1f;return _0x51c7c4;});}})[_0xc176('0x14')](respondWithFilteredResult(_0x1f464b,_0x52d435))['catch'](handleError(_0x1f464b,null));};exports[_0xc176('0x125')]=function(_0x52a6fe,_0x478ac1){return db[_0xc176('0x31')][_0xc176('0x4b')]({'where':{'id':_0x52a6fe[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0x478ac1,null))[_0xc176('0x14')](function(_0x204ddc){if(_0x204ddc){return _0x204ddc[_0xc176('0x125')](_0x52a6fe['body'][_0xc176('0x5c')],_['omit'](_0x52a6fe[_0xc176('0x4c')],[_0xc176('0x5c'),'id'])||{})[_0xc176('0xc4')](function(_0x5106fb){for(var _0x5d4dfa=0x0;_0x5d4dfa<_0x52a6fe['body']['ids'][_0xc176('0x3b')];_0x5d4dfa+=0x1){socket[_0xc176('0x126')](_0xc176('0x127'),{'UserId':Number(_0x52a6fe[_0xc176('0x4c')][_0xc176('0x5c')][_0x5d4dfa]),'ChatWebsiteId':Number(_0x52a6fe[_0xc176('0x47')]['id'])});}return _0x5106fb;});}})[_0xc176('0x14')](respondWithResult(_0x478ac1,null))['catch'](handleError(_0x478ac1,null));};exports[_0xc176('0x128')]=function(_0x31a4ce,_0xc3fbca){return db[_0xc176('0x31')]['find']({'where':{'id':_0x31a4ce[_0xc176('0x47')]['id']}})[_0xc176('0x14')](handleEntityNotFound(_0xc3fbca,null))['then'](function(_0x2b0f02){if(_0x2b0f02){return _0x2b0f02['removeAgents'](_0x31a4ce['query']['ids'])[_0xc176('0x14')](function(){if(_['isArray'](_0x31a4ce[_0xc176('0x37')][_0xc176('0x5c')])){for(var _0x586e6f=0x0;_0x586e6f<_0x31a4ce[_0xc176('0x37')][_0xc176('0x5c')][_0xc176('0x3b')];_0x586e6f+=0x1){socket[_0xc176('0x126')](_0xc176('0x129'),{'UserId':Number(_0x31a4ce['query'][_0xc176('0x5c')][_0x586e6f]),'ChatWebsiteId':Number(_0x31a4ce[_0xc176('0x47')]['id'])});}}else{socket[_0xc176('0x126')](_0xc176('0x129'),{'UserId':Number(_0x31a4ce['query'][_0xc176('0x5c')]),'ChatWebsiteId':Number(_0x31a4ce[_0xc176('0x47')]['id'])});}});}})[_0xc176('0x14')](respondWithStatusCode(_0xc3fbca,null))[_0xc176('0x1d')](handleError(_0xc3fbca,null));};exports[_0xc176('0x12a')]=function(_0x598ad9,_0x51e939){var _0xcb47f9={};var _0x1048eb={};var _0x46238d;var _0x96b9e4;return db[_0xc176('0x31')][_0xc176('0x58')]({'where':{'id':_0x598ad9['params']['id']}})['then'](handleEntityNotFound(_0x51e939,null))[_0xc176('0x14')](function(_0xed25c7){if(_0xed25c7){_0x46238d=_0xed25c7;_0x1048eb[_0xc176('0x36')]=_[_0xc176('0x48')](db[_0xc176('0xb7')][_0xc176('0x32')]);_0x1048eb[_0xc176('0x37')]=_[_0xc176('0x48')](_0x598ad9[_0xc176('0x37')]);_0x1048eb[_0xc176('0x38')]=_[_0xc176('0x49')](_0x1048eb[_0xc176('0x36')],_0x1048eb[_0xc176('0x37')]);_0xcb47f9['attributes']=_['intersection'](_0x1048eb[_0xc176('0x36')],qs[_0xc176('0x3a')](_0x598ad9['query'][_0xc176('0x3a')]));_0xcb47f9['attributes']=_0xcb47f9[_0xc176('0x39')][_0xc176('0x3b')]?_0xcb47f9[_0xc176('0x39')]:_0x1048eb[_0xc176('0x36')];_0xcb47f9[_0xc176('0x3d')]=qs[_0xc176('0x3e')](_0x598ad9[_0xc176('0x37')]['sort']);_0xcb47f9['where']=qs[_0xc176('0x38')](_[_0xc176('0x40')](_0x598ad9[_0xc176('0x37')],_0x1048eb[_0xc176('0x38')]));if(_0x598ad9[_0xc176('0x37')]['filter']){_0xcb47f9[_0xc176('0x3f')]=_[_0xc176('0x42')](_0xcb47f9['where'],{'$or':_[_0xc176('0x30')](_0xcb47f9[_0xc176('0x39')],function(_0x23f329){var _0x2ab59b={};_0x2ab59b[_0x23f329]={'$like':'%'+_0x598ad9['query'][_0xc176('0x41')]+'%'};return _0x2ab59b;})});}_0xcb47f9=_['merge']({},_0xcb47f9,_0x598ad9[_0xc176('0x43')]);return _0x46238d[_0xc176('0x12a')](_0xcb47f9);}})['then'](function(_0x8a617d){if(_0x8a617d){_0x96b9e4=_0x8a617d[_0xc176('0x3b')];if(!_0x598ad9['query'][_0xc176('0x3c')](_0xc176('0x59'))){_0xcb47f9[_0xc176('0x24')]=qs['limit'](_0x598ad9[_0xc176('0x37')][_0xc176('0x24')]);_0xcb47f9[_0xc176('0x22')]=qs[_0xc176('0x22')](_0x598ad9[_0xc176('0x37')]['offset']);}return _0x46238d[_0xc176('0x12a')](_0xcb47f9);}})[_0xc176('0x14')](function(_0x2553fc){if(_0x2553fc){return _0x2553fc?{'count':_0x96b9e4,'rows':_0x2553fc}:null;}})[_0xc176('0x14')](respondWithResult(_0x51e939,null))[_0xc176('0x1d')](handleError(_0x51e939,null));};
\ No newline at end of file
index b94e5d6..7fcc331 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ef3=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x166435,_0x16391f){var _0xe4713a=function(_0xea464f){while(--_0xea464f){_0x166435['push'](_0x166435['shift']());}};_0xe4713a(++_0x16391f);}(_0x1ef3,0x69));var _0x31ef=function(_0x189516,_0x14a8f6){_0x189516=_0x189516-0x0;var _0x1cdd69=_0x1ef3[_0x189516];return _0x1cdd69;};'use strict';var EventEmitter=require(_0x31ef('0x0'));var ChatWebsite=require(_0x31ef('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x31ef('0x2')](0x0);var events={'afterCreate':_0x31ef('0x3'),'afterUpdate':_0x31ef('0x4'),'afterDestroy':'remove'};function emitEvent(_0x311a32){return function(_0x58388a,_0x49ce87,_0x1a8d7f){ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32+':'+_0x58388a['id'],_0x58388a);ChatWebsiteEvents[_0x31ef('0x5')](_0x311a32,_0x58388a);_0x1a8d7f(null);};}for(var e in events){if(events[_0x31ef('0x6')](e)){var event=events[e];ChatWebsite[_0x31ef('0x7')](e,emitEvent(event));}}module[_0x31ef('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x06f4=['setMaxListeners','save','emit','hook','events','../../mysqldb'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x06f4,0x136));var _0x406f=function(_0x5a41bd,_0x488422){_0x5a41bd=_0x5a41bd-0x0;var _0x1c4b84=_0x06f4[_0x5a41bd];return _0x1c4b84;};'use strict';var EventEmitter=require(_0x406f('0x0'));var ChatWebsite=require(_0x406f('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x406f('0x2')](0x0);var events={'afterCreate':_0x406f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3a4ff0){return function(_0x5ed32f,_0x32abfd,_0x275c63){ChatWebsiteEvents[_0x406f('0x4')](_0x3a4ff0+':'+_0x5ed32f['id'],_0x5ed32f);ChatWebsiteEvents[_0x406f('0x4')](_0x3a4ff0,_0x5ed32f);_0x275c63(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x406f('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
index 39dbece..c1b01cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0137=['rimraf','exports','define','chat_websites','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x183f7e,_0xa61ba7){var _0x590260=function(_0x109b31){while(--_0x109b31){_0x183f7e['push'](_0x183f7e['shift']());}};_0x590260(++_0xa61ba7);}(_0x0137,0x1a8));var _0x7013=function(_0x173ec0,_0x4374db){_0x173ec0=_0x173ec0-0x0;var _0xcbf53d=_0x0137[_0x173ec0];return _0xcbf53d;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var logger=require(_0x7013('0x2'))(_0x7013('0x3'));var moment=require(_0x7013('0x4'));var BPromise=require(_0x7013('0x5'));var rp=require(_0x7013('0x6'));var fs=require('fs');var path=require(_0x7013('0x7'));var rimraf=require(_0x7013('0x8'));var config=require('../../config/environment');var attributes=require('./chatWebsite.attributes');module[_0x7013('0x9')]=function(_0x2d7771,_0x38a446){return _0x2d7771[_0x7013('0xa')]('ChatWebsite',attributes,{'tableName':_0x7013('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc70e=['lodash','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x14dc28,_0x9e76c0){var _0x24f9b0=function(_0x2d68e3){while(--_0x2d68e3){_0x14dc28['push'](_0x14dc28['shift']());}};_0x24f9b0(++_0x9e76c0);}(_0xc70e,0xfa));var _0xec70=function(_0x3ad62c,_0x465700){_0x3ad62c=_0x3ad62c-0x0;var _0x18e4f3=_0xc70e[_0x3ad62c];return _0x18e4f3;};'use strict';var _=require(_0xec70('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xec70('0x1'));var BPromise=require(_0xec70('0x2'));var rp=require(_0xec70('0x3'));var fs=require('fs');var path=require(_0xec70('0x4'));var rimraf=require('rimraf');var config=require(_0xec70('0x5'));var attributes=require(_0xec70('0x6'));module[_0xec70('0x7')]=function(_0x5c931a,_0x409405){return _0x5c931a[_0xec70('0x8')](_0xec70('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f1dd87..56f6544 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe803=['register','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0xe803,0x90));var _0x3e80=function(_0x472a2d,_0x7b6a64){_0x472a2d=_0x472a2d-0x0;var _0x58c1eb=_0xe803[_0x472a2d];return _0x58c1eb;};'use strict';var _=require('lodash');var util=require(_0x3e80('0x0'));var moment=require(_0x3e80('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e80('0x2'));var fs=require('fs');var Redis=require(_0x3e80('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e80('0x4'));var logger=require(_0x3e80('0x5'))(_0x3e80('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e80('0x7')][_0x3e80('0x8')]({'port':0x232a});config[_0x3e80('0x9')]=_[_0x3e80('0xa')](config[_0x3e80('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3e80('0xb'))(new Redis(config[_0x3e80('0x9')]));require('./chatWebsite.socket')[_0x3e80('0xc')](socket);function respondWithRpcPromise(_0x1712b9,_0x417fc4,_0x3fbc8d){return new BPromise(function(_0x2d31db,_0x1230de){return client[_0x3e80('0xd')](_0x1712b9,_0x3fbc8d)[_0x3e80('0xe')](function(_0x4520ce){logger[_0x3e80('0xf')]('ChatWebsite,\x20%s,\x20%s',_0x417fc4,_0x3e80('0x10'));logger[_0x3e80('0x11')](_0x3e80('0x12'),_0x417fc4,_0x3e80('0x10'),JSON[_0x3e80('0x13')](_0x4520ce));if(_0x4520ce[_0x3e80('0x14')]){if(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x15')]===0x1f4){logger[_0x3e80('0x14')](_0x3e80('0x16'),_0x417fc4,_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);return _0x1230de(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);}logger[_0x3e80('0x14')](_0x3e80('0x16'),_0x417fc4,_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);return _0x2d31db(_0x4520ce[_0x3e80('0x14')][_0x3e80('0x17')]);}else{logger['info'](_0x3e80('0x16'),_0x417fc4,_0x3e80('0x10'));_0x2d31db(_0x4520ce[_0x3e80('0x18')][_0x3e80('0x17')]);}})[_0x3e80('0x19')](function(_0x52d6f){logger['error'](_0x3e80('0x16'),_0x417fc4,_0x52d6f);_0x1230de(_0x52d6f);});});}
\ No newline at end of file
+var _0xcfc6=['rpc','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','redis','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','lodash','util','bluebird','ioredis','../../config/logger'];(function(_0x398c23,_0x294a30){var _0x5392c0=function(_0x4dc9b3){while(--_0x4dc9b3){_0x398c23['push'](_0x398c23['shift']());}};_0x5392c0(++_0x294a30);}(_0xcfc6,0x11b));var _0x6cfc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcfc6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6cfc('0x0'));var util=require(_0x6cfc('0x1'));var moment=require('moment');var BPromise=require(_0x6cfc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6cfc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cfc('0x4'))(_0x6cfc('0x5'));var config=require(_0x6cfc('0x6'));var jayson=require(_0x6cfc('0x7'));var client=jayson[_0x6cfc('0x8')][_0x6cfc('0x9')]({'port':0x232a});config['redis']=_[_0x6cfc('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6cfc('0xb'))(new Redis(config[_0x6cfc('0xc')]));require(_0x6cfc('0xd'))[_0x6cfc('0xe')](socket);function respondWithRpcPromise(_0x4aee93,_0x29102b,_0x1f1320){return new BPromise(function(_0x570e53,_0x24a7fe){return client[_0x6cfc('0xf')](_0x4aee93,_0x1f1320)[_0x6cfc('0x10')](function(_0x17366d){logger['info'](_0x6cfc('0x11'),_0x29102b,'request\x20sent');logger['debug'](_0x6cfc('0x12'),_0x29102b,'request\x20sent',JSON['stringify'](_0x17366d));if(_0x17366d['error']){if(_0x17366d[_0x6cfc('0x13')]['code']===0x1f4){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x29102b,_0x17366d['error'][_0x6cfc('0x14')]);return _0x24a7fe(_0x17366d['error'][_0x6cfc('0x14')]);}logger['error'](_0x6cfc('0x11'),_0x29102b,_0x17366d['error'][_0x6cfc('0x14')]);return _0x570e53(_0x17366d[_0x6cfc('0x13')][_0x6cfc('0x14')]);}else{logger[_0x6cfc('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x29102b,_0x6cfc('0x16'));_0x570e53(_0x17366d[_0x6cfc('0x17')][_0x6cfc('0x14')]);}})['catch'](function(_0x46a7b0){logger['error'](_0x6cfc('0x11'),_0x29102b,_0x46a7b0);_0x24a7fe(_0x46a7b0);});});}
\ No newline at end of file
index 0c58fa3..85c6fd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x602f=['emit','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x265596,_0x23947a){var _0x3f8d6b=function(_0x46349d){while(--_0x46349d){_0x265596['push'](_0x265596['shift']());}};_0x3f8d6b(++_0x23947a);}(_0x602f,0x1f4));var _0xf602=function(_0x429b19,_0x23615c){_0x429b19=_0x429b19-0x0;var _0x5849fa=_0x602f[_0x429b19];return _0x5849fa;};'use strict';var ChatWebsiteEvents=require(_0xf602('0x0'));var events=[_0xf602('0x1'),_0xf602('0x2'),_0xf602('0x3')];function createListener(_0x48a35d,_0x581259){return function(_0x366680){_0x581259[_0xf602('0x4')](_0x48a35d,_0x366680);};}function removeListener(_0x30f82f,_0x4a51d9){return function(){ChatWebsiteEvents['removeListener'](_0x30f82f,_0x4a51d9);};}exports['register']=function(_0x5552cc){for(var _0x52691d=0x0,_0x19f993=events[_0xf602('0x5')];_0x52691d<_0x19f993;_0x52691d++){var _0x466324=events[_0x52691d];var _0x420e8c=createListener(_0xf602('0x6')+_0x466324,_0x5552cc);ChatWebsiteEvents['on'](_0x466324,_0x420e8c);}};
\ No newline at end of file
+var _0x7c29=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x7c29,0xb6));var _0x97c2=function(_0x5eb839,_0x553a7f){_0x5eb839=_0x5eb839-0x0;var _0x3f3c71=_0x7c29[_0x5eb839];return _0x3f3c71;};'use strict';var ChatWebsiteEvents=require(_0x97c2('0x0'));var events=[_0x97c2('0x1'),_0x97c2('0x2'),'update'];function createListener(_0x4da097,_0x4899e9){return function(_0xfa655b){_0x4899e9[_0x97c2('0x3')](_0x4da097,_0xfa655b);};}function removeListener(_0x542649,_0x5a04e3){return function(){ChatWebsiteEvents[_0x97c2('0x4')](_0x542649,_0x5a04e3);};}exports[_0x97c2('0x5')]=function(_0x169ff0){for(var _0x2dfa75=0x0,_0xd2ff51=events[_0x97c2('0x6')];_0x2dfa75<_0xd2ff51;_0x2dfa75++){var _0x1f7be1=events[_0x2dfa75];var _0x3d9cec=createListener(_0x97c2('0x7')+_0x1f7be1,_0x169ff0);ChatWebsiteEvents['on'](_0x1f7be1,_0x3d9cec);}};
\ No newline at end of file
index b3f4a40..0ac670f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed77=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addProactiveActions','addAgents','delete','removeAnswers','removeAgents','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet'];(function(_0x4d4ea2,_0x4858f4){var _0x1ba039=function(_0x14c589){while(--_0x14c589){_0x4d4ea2['push'](_0x4d4ea2['shift']());}};_0x1ba039(++_0x4858f4);}(_0xed77,0x147));var _0x7ed7=function(_0x241b38,_0x59a7b1){_0x241b38=_0x241b38-0x0;var _0x9619ea=_0xed77[_0x241b38];return _0x9619ea;};'use strict';var multer=require(_0x7ed7('0x0'));var util=require('util');var path=require(_0x7ed7('0x1'));var timeout=require('connect-timeout');var express=require(_0x7ed7('0x2'));var router=express[_0x7ed7('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7ed7('0x4'));var config=require(_0x7ed7('0x5'));var controller=require(_0x7ed7('0x6'));router['get']('/',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x8')]);router[_0x7ed7('0x9')](_0x7ed7('0xa'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0xb')]);router[_0x7ed7('0x9')](_0x7ed7('0xc'),auth['isAuthenticated'](),controller[_0x7ed7('0xd')]);router[_0x7ed7('0x9')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0xf')]);router['get'](_0x7ed7('0x10'),auth[_0x7ed7('0x7')](),controller['getAnswers']);router[_0x7ed7('0x9')]('/:id/logo',controller['getLogo']);router[_0x7ed7('0x9')]('/:id/avatar',controller['getAvatar']);router['get'](_0x7ed7('0x11'),controller['getCustomerAvatar']);router['get'](_0x7ed7('0x12'),controller[_0x7ed7('0x13')]);router[_0x7ed7('0x9')]('/:id/interactions',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x14')]);router['get'](_0x7ed7('0x15'),controller[_0x7ed7('0x16')]);router[_0x7ed7('0x9')](_0x7ed7('0x17'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x18')]);router[_0x7ed7('0x9')](_0x7ed7('0x19'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x1a')]);router[_0x7ed7('0x9')](_0x7ed7('0x1b'),controller[_0x7ed7('0x1c')]);router[_0x7ed7('0x9')](_0x7ed7('0x1d'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x1e')]);router[_0x7ed7('0x9')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x20')]);router[_0x7ed7('0x21')]('/',auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x22')]);router[_0x7ed7('0x21')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x23')]);router[_0x7ed7('0x21')](_0x7ed7('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x7ed7('0x24')]({'destination':function(_0xfc0d36,_0x1ef40e,_0xc94603){_0xc94603(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x27')));},'filename':function(_0x3d4e38,_0x189696,_0x304f62){_0x304f62(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date['now'](),_0x189696[_0x7ed7('0x2a')]));}})});router['post'](_0x7ed7('0x2b'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller[_0x7ed7('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ebc83,_0x374476,_0x5e4922){_0x5e4922(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x44276e,_0x25bdf0,_0x56e670){_0x56e670(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0x25bdf0[_0x7ed7('0x2a')]));}})});router[_0x7ed7('0x21')](_0x7ed7('0x31'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller[_0x7ed7('0x32')]);var upload=multer({'storage':multer[_0x7ed7('0x24')]({'destination':function(_0x42edb0,_0x26d0a4,_0x2a8cf2){_0x2a8cf2(null,path['join'](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x1a2dde,_0x13d762,_0x4ea07d){_0x4ea07d(null,util['format'](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0x13d762[_0x7ed7('0x2a')]));}})});router['post'](_0x7ed7('0x11'),upload[_0x7ed7('0x2c')](_0x7ed7('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x10c7ac,_0x2d4e3b,_0x1b79a5){_0x1b79a5(null,path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x2f')));},'filename':function(_0x4210cc,_0xed6371,_0x1da905){_0x1da905(null,util[_0x7ed7('0x28')](_0x7ed7('0x29'),Date[_0x7ed7('0x30')](),_0xed6371[_0x7ed7('0x2a')]));}})});router[_0x7ed7('0x21')]('/:id/system_avatar',upload[_0x7ed7('0x2c')]('file'),controller[_0x7ed7('0x33')]);router[_0x7ed7('0x21')]('/:id/notify',controller[_0x7ed7('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x11b7ac,_0x3cc977,_0x18840f){const _0x52a76f=path[_0x7ed7('0x25')](config[_0x7ed7('0x26')],_0x7ed7('0x35'),_0x7ed7('0x36'),_0x7ed7('0x37'));fs_extra[_0x7ed7('0x38')](_0x52a76f,function(){_0x18840f(null,_0x52a76f);});},'filename':function(_0x181ec7,_0x5dd77b,_0x33f3ad){const _0x4e9726=_0x5dd77b[_0x7ed7('0x2a')][_0x7ed7('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x44a31d=path[_0x7ed7('0x3a')](_0x4e9726);const _0xf7d880=Date[_0x7ed7('0x30')]()+'-'+_0x4e9726[_0x7ed7('0x39')](_0x44a31d,'')+_0x44a31d;_0x33f3ad(null,_0xf7d880);}})});router[_0x7ed7('0x21')](_0x7ed7('0x3b'),offlineUploadMulter[_0x7ed7('0x3c')](),controller[_0x7ed7('0x3d')]);router[_0x7ed7('0x21')](_0x7ed7('0x3e'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x3f')]);router[_0x7ed7('0x21')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x7ed7('0x21')](_0x7ed7('0x19'),auth['isAuthenticated'](),controller[_0x7ed7('0x40')]);router[_0x7ed7('0x21')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x41')]);router['put'](_0x7ed7('0xc'),auth[_0x7ed7('0x7')](),controller['update']);router['delete'](_0x7ed7('0xc'),auth[_0x7ed7('0x7')](),controller['destroy']);router[_0x7ed7('0x42')](_0x7ed7('0xe'),auth[_0x7ed7('0x7')](),controller['removeDispositions']);router[_0x7ed7('0x42')](_0x7ed7('0x10'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x43')]);router[_0x7ed7('0x42')](_0x7ed7('0x1f'),auth[_0x7ed7('0x7')](),controller[_0x7ed7('0x44')]);module[_0x7ed7('0x45')]=router;
\ No newline at end of file
+var _0xb37b=['offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','/:id','update','delete','destroy','removeAnswers','removeAgents','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getAgents','post','create','addAnswer','diskStorage','root','server/files/images/logos/','format','%s-%s','single','file','addLogo','join','addAvatar','server/files/images/avatars/','now','originalname','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','attachments'];(function(_0x1dc00d,_0x456c64){var _0x1de5ce=function(_0x189848){while(--_0x189848){_0x1dc00d['push'](_0x1dc00d['shift']());}};_0x1de5ce(++_0x456c64);}(_0xb37b,0x184));var _0xbb37=function(_0x546bf7,_0x4f807f){_0x546bf7=_0x546bf7-0x0;var _0x918211=_0xb37b[_0x546bf7];return _0x918211;};'use strict';var multer=require(_0xbb37('0x0'));var util=require(_0xbb37('0x1'));var path=require(_0xbb37('0x2'));var timeout=require(_0xbb37('0x3'));var express=require('express');var router=express[_0xbb37('0x4')]();var fs_extra=require(_0xbb37('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbb37('0x6'));var controller=require('./chatWebsite.controller');router[_0xbb37('0x7')]('/',auth[_0xbb37('0x8')](),controller[_0xbb37('0x9')]);router[_0xbb37('0x7')](_0xbb37('0xa'),auth[_0xbb37('0x8')](),controller[_0xbb37('0xb')]);router[_0xbb37('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbb37('0xc')]);router[_0xbb37('0x7')](_0xbb37('0xd'),auth[_0xbb37('0x8')](),controller[_0xbb37('0xe')]);router[_0xbb37('0x7')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x10')]);router[_0xbb37('0x7')](_0xbb37('0x11'),controller[_0xbb37('0x12')]);router['get'](_0xbb37('0x13'),controller[_0xbb37('0x14')]);router[_0xbb37('0x7')](_0xbb37('0x15'),controller['getCustomerAvatar']);router['get'](_0xbb37('0x16'),controller[_0xbb37('0x17')]);router[_0xbb37('0x7')](_0xbb37('0x18'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x19')]);router[_0xbb37('0x7')](_0xbb37('0x1a'),controller[_0xbb37('0x1b')]);router['get'](_0xbb37('0x1c'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x1d')]);router[_0xbb37('0x7')](_0xbb37('0x1e'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x1f')]);router[_0xbb37('0x7')]('/:id/fields',controller[_0xbb37('0x20')]);router[_0xbb37('0x7')](_0xbb37('0x21'),auth[_0xbb37('0x8')](),controller['getOfflineMessages']);router['get']('/:id/users',auth[_0xbb37('0x8')](),controller[_0xbb37('0x22')]);router[_0xbb37('0x23')]('/',auth[_0xbb37('0x8')](),controller[_0xbb37('0x24')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xbb37('0x23')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x25')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x9fcb3a,_0x3730e1,_0x313245){_0x313245(null,path['join'](config[_0xbb37('0x27')],_0xbb37('0x28')));},'filename':function(_0x3ee6bf,_0x5d87f3,_0x31b963){_0x31b963(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date['now'](),_0x5d87f3['originalname']));}})});router[_0xbb37('0x23')](_0xbb37('0x11'),upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x2d')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x42e32b,_0xf60386,_0x19139f){_0x19139f(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],'server/files/images/avatars/'));},'filename':function(_0x436f49,_0x3fbae1,_0x2cc3c9){_0x2cc3c9(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date['now'](),_0x3fbae1['originalname']));}})});router[_0xbb37('0x23')](_0xbb37('0x13'),upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x2f')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x4d6e81,_0x1f0b69,_0x3dc565){_0x3dc565(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],_0xbb37('0x30')));},'filename':function(_0x34247a,_0x3c6251,_0x42e8a2){_0x42e8a2(null,util[_0xbb37('0x29')](_0xbb37('0x2a'),Date[_0xbb37('0x31')](),_0x3c6251[_0xbb37('0x32')]));}})});router[_0xbb37('0x23')](_0xbb37('0x15'),upload['single'](_0xbb37('0x2c')),controller[_0xbb37('0x33')]);var upload=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x5826f0,_0x41a587,_0x15ba78){_0x15ba78(null,path[_0xbb37('0x2e')](config[_0xbb37('0x27')],_0xbb37('0x30')));},'filename':function(_0x5b76ec,_0x4447ad,_0x4e39d4){_0x4e39d4(null,util['format']('%s-%s',Date[_0xbb37('0x31')](),_0x4447ad[_0xbb37('0x32')]));}})});router[_0xbb37('0x23')]('/:id/system_avatar',upload[_0xbb37('0x2b')](_0xbb37('0x2c')),controller[_0xbb37('0x34')]);router[_0xbb37('0x23')](_0xbb37('0x35'),controller[_0xbb37('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0xbb37('0x26')]({'destination':function(_0x1ea5f2,_0x2d9eaa,_0x52a945){const _0x933b01=path[_0xbb37('0x2e')](config[_0xbb37('0x27')],'server/files',_0xbb37('0x37'),_0xbb37('0x38'));fs_extra[_0xbb37('0x39')](_0x933b01,function(){_0x52a945(null,_0x933b01);});},'filename':function(_0x119c70,_0x57ee97,_0x84e8dd){const _0x553d9a=_0x57ee97[_0xbb37('0x32')][_0xbb37('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5133c8=path[_0xbb37('0x3b')](_0x553d9a);const _0x384408=Date['now']()+'-'+_0x553d9a['replace'](_0x5133c8,'')+_0x5133c8;_0x84e8dd(null,_0x384408);}})});router[_0xbb37('0x23')](_0xbb37('0x3c'),offlineUploadMulter[_0xbb37('0x3d')](),controller[_0xbb37('0x3e')]);router['post'](_0xbb37('0x18'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x3f')]);router[_0xbb37('0x23')](_0xbb37('0x1c'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x40')]);router[_0xbb37('0x23')](_0xbb37('0x1e'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x41')]);router[_0xbb37('0x23')](_0xbb37('0x42'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x43')]);router['put'](_0xbb37('0x44'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x45')]);router[_0xbb37('0x46')](_0xbb37('0x44'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x47')]);router[_0xbb37('0x46')](_0xbb37('0xd'),auth[_0xbb37('0x8')](),controller['removeDispositions']);router[_0xbb37('0x46')](_0xbb37('0xf'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x48')]);router[_0xbb37('0x46')](_0xbb37('0x42'),auth[_0xbb37('0x8')](),controller[_0xbb37('0x49')]);module['exports']=router;
\ No newline at end of file
index d4d14ca..b25fcda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5ae=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production'];(function(_0x4d930e,_0x434ebe){var _0xbda995=function(_0x5b4b5e){while(--_0x5b4b5e){_0x4d930e['push'](_0x4d930e['shift']());}};_0xbda995(++_0x434ebe);}(_0xe5ae,0x186));var _0xee5a=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0xe5ae[_0x149083];return _0x4dc74e;};var beaverLogger=require(_0xee5a('0x0'));var express=require('express');var auth=require(_0xee5a('0x1'));var config=require(_0xee5a('0x2'));var router=express[_0xee5a('0x3')]();var isProduction=config[_0xee5a('0x4')]===_0xee5a('0x5')||![];function clientSideLogs(_0x4bb2b1,_0x234fbd,_0x35e8d7){var _0x532089=_0x4bb2b1['app']['get'](_0xee5a('0x6'));if(!_0x532089){throw new Error(_0xee5a('0x7'));}return beaverLogger[_0xee5a('0x8')]({'uri':_0xee5a('0x9'),'logger':_0x532089,'enableCors':!isProduction})(_0x4bb2b1,_0x234fbd,_0x35e8d7);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0xee5a('0xa')]=router;
\ No newline at end of file
+var _0x2270=['env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','../components/auth/service'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x2270,0x180));var _0x0227=function(_0x59f62a,_0x28dfa2){_0x59f62a=_0x59f62a-0x0;var _0x402f07=_0x2270[_0x59f62a];return _0x402f07;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0x0227('0x0'));var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0x0227('0x1')]===_0x0227('0x2')||![];function clientSideLogs(_0x56e9c2,_0x13d928,_0x42bcf7){var _0x2fe042=_0x56e9c2[_0x0227('0x3')][_0x0227('0x4')](_0x0227('0x5'));if(!_0x2fe042){throw new Error(_0x0227('0x6'));}return beaverLogger[_0x0227('0x7')]({'uri':_0x0227('0x8'),'logger':_0x2fe042,'enableCors':!isProduction})(_0x56e9c2,_0x13d928,_0x42bcf7);}router[_0x0227('0x9')](auth[_0x0227('0xa')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
index 4d45e5a..bb02343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1152=['STRING','AmazonAWS','Google','MicrosoftAzure','ENUM','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports'];(function(_0x382541,_0x40226e){var _0x3d0287=function(_0x41caf7){while(--_0x41caf7){_0x382541['push'](_0x382541['shift']());}};_0x3d0287(++_0x40226e);}(_0x1152,0x167));var _0x2115=function(_0x5608df,_0xff2326){_0x5608df=_0x5608df-0x0;var _0x4c2e63=_0x1152[_0x5608df];return _0x4c2e63;};'use strict';var Sequelize=require('sequelize');module[_0x2115('0x0')]={'name':{'type':Sequelize[_0x2115('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2115('0x2'),_0x2115('0x3'),_0x2115('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x2115('0x5')]('Outlook365',_0x2115('0x6'))},'data1':{'type':Sequelize[_0x2115('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x7')},'data3':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x8')},'data4':{'type':Sequelize[_0x2115('0x1')],'comment':_0x2115('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x2115('0xa')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0x2115('0xb')}};
\ No newline at end of file
+var _0x242d=['exports','STRING','ENUM','AmazonAWS','Google','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x8cd627,_0x1bf5ca){var _0x7e454=function(_0x562038){while(--_0x562038){_0x8cd627['push'](_0x8cd627['shift']());}};_0x7e454(++_0x1bf5ca);}(_0x242d,0x18c));var _0xd242=function(_0x1587cd,_0x3e66c2){_0x1587cd=_0x1587cd-0x0;var _0x4ed6e5=_0x242d[_0x1587cd];return _0x4ed6e5;};'use strict';var Sequelize=require('sequelize');module[_0xd242('0x0')]={'name':{'type':Sequelize[_0xd242('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd242('0x2')](_0xd242('0x3'),_0xd242('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('Outlook365',_0xd242('0x5'))},'data1':{'type':Sequelize[_0xd242('0x1')],'comment':_0xd242('0x6')},'data2':{'type':Sequelize[_0xd242('0x1')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xd242('0x1')],'comment':_0xd242('0x7')},'data5':{'type':Sequelize[_0xd242('0x8')],'comment':_0xd242('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd242('0xa')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
index 33f8792..1f90f5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeccd=['update','then','sendStatus','error','stack','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','options','find','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','from','base64','toString','ascii','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','Content-Range'];(function(_0x2c1e14,_0x4680db){var _0x1a12b1=function(_0x3fdaec){while(--_0x3fdaec){_0x2c1e14['push'](_0x2c1e14['shift']());}};_0x1a12b1(++_0x4680db);}(_0xeccd,0x100));var _0xdecc=function(_0x351521,_0x2b9971){_0x351521=_0x351521-0x0;var _0x8bfb3a=_0xeccd[_0x351521];return _0x8bfb3a;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xdecc('0x0'));var encryptor=require('../../components/encryptor');var config=require(_0xdecc('0x1'));var logger=require(_0xdecc('0x2'))(_0xdecc('0x3'));var db=require(_0xdecc('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0xdecc('0x5')]=_[_0xdecc('0x6')](config[_0xdecc('0x5')],{'host':_0xdecc('0x7'),'port':0x18eb});var socket=require(_0xdecc('0x8'))(new Redis(config[_0xdecc('0x5')]));var redis=new Redis(config[_0xdecc('0x5')]);function respondWithStatusCode(_0xf26e93,_0x4c3c20){_0x4c3c20=_0x4c3c20||0xcc;return function(_0xe7e34b){if(_0xe7e34b){return _0xf26e93['sendStatus'](_0x4c3c20);}return _0xf26e93[_0xdecc('0x9')](_0x4c3c20)[_0xdecc('0xa')]();};}function respondWithResult(_0x42fcc0,_0x55637b){_0x55637b=_0x55637b||0xc8;return function(_0x230799){if(_0x230799){return _0x42fcc0[_0xdecc('0x9')](_0x55637b)[_0xdecc('0xb')](_0x230799);}};}function respondWithFilteredResult(_0xbda0ae,_0x407a5a){return function(_0xa37f1c){if(_0xa37f1c){var _0x2300f1=typeof _0x407a5a[_0xdecc('0xc')]==='undefined'&&typeof _0x407a5a[_0xdecc('0xd')]===_0xdecc('0xe');var _0xbf66aa=_0xa37f1c[_0xdecc('0xf')];var _0x800900=_0x2300f1?0x0:_0x407a5a[_0xdecc('0xc')];var _0x1fd48b=_0x2300f1?_0xa37f1c[_0xdecc('0xf')]:_0x407a5a['offset']+_0x407a5a[_0xdecc('0xd')];var _0x586ccd;if(_0x1fd48b>=_0xbf66aa){_0x1fd48b=_0xbf66aa;_0x586ccd=0xc8;}else{_0x586ccd=0xce;}_0xbda0ae[_0xdecc('0x9')](_0x586ccd);return _0xbda0ae['set'](_0xdecc('0x10'),_0x800900+'-'+_0x1fd48b+'/'+_0xbf66aa)[_0xdecc('0xb')](_0xa37f1c);}return null;};}function saveUpdates(_0x5aebc5){return function(_0x4edaa5){if(_0x4edaa5){return _0x4edaa5[_0xdecc('0x11')](_0x5aebc5)[_0xdecc('0x12')](function(_0x3febc8){return _0x3febc8;});}return null;};}function removeEntity(_0x1c962f){return function(_0x3349c5){if(_0x3349c5){return _0x3349c5['destroy']()[_0xdecc('0x12')](function(){_0x1c962f[_0xdecc('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce6e3){return function(_0x45bcc7){if(!_0x45bcc7){_0x1ce6e3[_0xdecc('0x13')](0x194);}return _0x45bcc7;};}function handleError(_0x557f2c,_0x45affc){_0x45affc=_0x45affc||0x1f4;return function(_0x5df811){logger[_0xdecc('0x14')](_0x5df811[_0xdecc('0x15')]);if(_0x5df811[_0xdecc('0x16')]){delete _0x5df811[_0xdecc('0x16')];}_0x557f2c[_0xdecc('0x9')](_0x45affc)['send'](_0x5df811);};}function maskClientSecret(_0x337b12){return _['padEnd'](_0x337b12[_0xdecc('0x17')](0x0,0x3),0x14,'*');}exports[_0xdecc('0x18')]=function(_0x100d9a,_0x29b03c){var _0x14c272={},_0x4c7772={},_0xea53c2={'count':0x0,'rows':[]};var _0x568552=_[_0xdecc('0x19')](db[_0xdecc('0x1a')][_0xdecc('0x1b')],function(_0x578a3d){return{'name':_0x578a3d[_0xdecc('0x1c')],'type':_0x578a3d[_0xdecc('0x1d')]['key']};});_0x4c7772[_0xdecc('0x1e')]=_[_0xdecc('0x19')](_0x568552,'name');_0x4c7772['query']=_[_0xdecc('0x1f')](_0x100d9a[_0xdecc('0x20')]);_0x4c7772[_0xdecc('0x21')]=_[_0xdecc('0x22')](_0x4c7772['model'],_0x4c7772[_0xdecc('0x20')]);_0x14c272[_0xdecc('0x23')]=_[_0xdecc('0x22')](_0x4c7772['model'],qs[_0xdecc('0x24')](_0x100d9a['query']['fields']));_0x14c272[_0xdecc('0x23')]=_0x14c272[_0xdecc('0x23')]['length']?_0x14c272[_0xdecc('0x23')]:_0x4c7772[_0xdecc('0x1e')];if(!_0x100d9a[_0xdecc('0x20')]['hasOwnProperty'](_0xdecc('0x25'))){_0x14c272[_0xdecc('0xd')]=qs[_0xdecc('0xd')](_0x100d9a[_0xdecc('0x20')][_0xdecc('0xd')]);_0x14c272[_0xdecc('0xc')]=qs[_0xdecc('0xc')](_0x100d9a[_0xdecc('0x20')][_0xdecc('0xc')]);}_0x14c272[_0xdecc('0x26')]=qs[_0xdecc('0x27')](_0x100d9a['query'][_0xdecc('0x27')]);_0x14c272[_0xdecc('0x28')]=qs['filters'](_['pick'](_0x100d9a['query'],_0x4c7772['filters']),_0x568552);if(_0x100d9a[_0xdecc('0x20')][_0xdecc('0x29')]){_0x14c272[_0xdecc('0x28')]=_[_0xdecc('0x2a')](_0x14c272[_0xdecc('0x28')],{'$or':_[_0xdecc('0x19')](_0x568552,function(_0x40923a){if(_0x40923a['type']!==_0xdecc('0x2b')){var _0x451ce3={};_0x451ce3[_0x40923a[_0xdecc('0x16')]]={'$like':'%'+_0x100d9a['query'][_0xdecc('0x29')]+'%'};return _0x451ce3;}})});}_0x14c272=_[_0xdecc('0x2a')]({},_0x14c272,_0x100d9a['options']);var _0x50f833={'where':_0x14c272[_0xdecc('0x28')]};return db['CloudProvider'][_0xdecc('0xf')](_0x50f833)[_0xdecc('0x12')](function(_0x902fa7){_0xea53c2[_0xdecc('0xf')]=_0x902fa7;if(_0x100d9a['query']['includeAll']){_0x14c272[_0xdecc('0x2c')]=[{'all':!![]}];}return db[_0xdecc('0x1a')][_0xdecc('0x2d')](_0x14c272);})[_0xdecc('0x12')](function(_0x18a3b6){_0xea53c2['rows']=_[_0xdecc('0x19')](_0x18a3b6,function(_0x3fabe3){if(_0x3fabe3[_0xdecc('0x2e')]===_0xdecc('0x2f')){var _0x3afb4b=encryptor[_0xdecc('0x30')](_0x3fabe3[_0xdecc('0x31')]);_0x3fabe3[_0xdecc('0x31')]=maskClientSecret(_0x3afb4b);}return _0x3fabe3;});return _0xea53c2;})[_0xdecc('0x12')](respondWithFilteredResult(_0x29b03c,_0x14c272))[_0xdecc('0x32')](handleError(_0x29b03c,null));};exports[_0xdecc('0x33')]=function(_0x3a0bf2,_0x117ef0){var _0x5c4c96={'raw':!![],'where':{'id':_0x3a0bf2[_0xdecc('0x34')]['id']}},_0x589e34={};_0x589e34[_0xdecc('0x1e')]=_[_0xdecc('0x1f')](db[_0xdecc('0x1a')][_0xdecc('0x1b')]);_0x589e34[_0xdecc('0x20')]=_[_0xdecc('0x1f')](_0x3a0bf2['query']);_0x589e34[_0xdecc('0x21')]=_[_0xdecc('0x22')](_0x589e34['model'],_0x589e34[_0xdecc('0x20')]);_0x5c4c96[_0xdecc('0x23')]=_[_0xdecc('0x22')](_0x589e34[_0xdecc('0x1e')],qs[_0xdecc('0x24')](_0x3a0bf2[_0xdecc('0x20')][_0xdecc('0x24')]));_0x5c4c96[_0xdecc('0x23')]=_0x5c4c96['attributes']['length']?_0x5c4c96[_0xdecc('0x23')]:_0x589e34[_0xdecc('0x1e')];if(_0x3a0bf2[_0xdecc('0x20')]['includeAll']){_0x5c4c96[_0xdecc('0x2c')]=[{'all':!![]}];}_0x5c4c96=_['merge']({},_0x5c4c96,_0x3a0bf2[_0xdecc('0x35')]);return db[_0xdecc('0x1a')][_0xdecc('0x36')](_0x5c4c96)[_0xdecc('0x12')](handleEntityNotFound(_0x117ef0,null))[_0xdecc('0x12')](function(_0x14eea1){if(_0x14eea1['service']===_0xdecc('0x2f')){var _0x1b41fa=encryptor[_0xdecc('0x30')](_0x14eea1[_0xdecc('0x31')]);_0x14eea1['data3']=maskClientSecret(_0x1b41fa);}return _0x14eea1;})['then'](respondWithResult(_0x117ef0,null))[_0xdecc('0x32')](handleError(_0x117ef0,null));};exports[_0xdecc('0x37')]=function(_0x4750a6,_0x57f2b3){if(!_0x4750a6[_0xdecc('0x38')][_0xdecc('0x16')])throw new Error(_0xdecc('0x39'));if(!_0x4750a6[_0xdecc('0x38')][_0xdecc('0x2e')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x4494a5=db[_0xdecc('0x1a')][_0xdecc('0x1b')][_0xdecc('0x2e')]['values'];if(!_0x4494a5[_0xdecc('0x3a')](_0x4750a6[_0xdecc('0x38')][_0xdecc('0x2e')]))throw new Error(_0xdecc('0x3b')+_0x4494a5[_0xdecc('0x3c')](',\x20'));if(_0x4750a6[_0xdecc('0x38')]['service']===_0xdecc('0x2f')&&_0x4750a6[_0xdecc('0x38')][_0xdecc('0x31')]){_0x4750a6['body']['data3']=encryptor[_0xdecc('0x3d')](_0x4750a6[_0xdecc('0x38')][_0xdecc('0x31')]);}return db[_0xdecc('0x1a')]['create'](_0x4750a6[_0xdecc('0x38')],{})[_0xdecc('0x12')](respondWithResult(_0x57f2b3,0xc9))[_0xdecc('0x32')](handleError(_0x57f2b3,null));};exports[_0xdecc('0x11')]=function(_0x24b566,_0x43a227){if(_0x24b566[_0xdecc('0x38')]['id']){delete _0x24b566[_0xdecc('0x38')]['id'];}return db[_0xdecc('0x1a')][_0xdecc('0x36')]({'where':{'id':_0x24b566[_0xdecc('0x34')]['id']}})['then'](handleEntityNotFound(_0x43a227,null))[_0xdecc('0x12')](function(_0x3498e0){if(_0x3498e0[_0xdecc('0x2e')]==='MicrosoftAzure'&&_0x24b566[_0xdecc('0x38')][_0xdecc('0x31')]){_0x24b566[_0xdecc('0x38')][_0xdecc('0x31')]=encryptor[_0xdecc('0x3d')](_0x24b566[_0xdecc('0x38')]['data3']);}return _0x3498e0;})[_0xdecc('0x12')](saveUpdates(_0x24b566[_0xdecc('0x38')],null))['then'](respondWithResult(_0x43a227,null))[_0xdecc('0x32')](handleError(_0x43a227,null));};exports[_0xdecc('0x3e')]=function(_0x46512a,_0x12195b){return db[_0xdecc('0x1a')][_0xdecc('0x36')]({'where':{'id':_0x46512a[_0xdecc('0x34')]['id']}})[_0xdecc('0x12')](handleEntityNotFound(_0x12195b,null))[_0xdecc('0x12')](removeEntity(_0x12195b,null))[_0xdecc('0x32')](handleError(_0x12195b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x554fa0,_0x43d6a2){return db[_0xdecc('0x1a')][_0xdecc('0x3f')]({'where':{'id':_0x554fa0['params']['id']},'raw':!![]})[_0xdecc('0x12')](function(_0x47db8d){if(!_0x47db8d)return _0x43d6a2[_0xdecc('0x13')](0x194);return{'url':oauth[_0xdecc('0x40')](_0x47db8d,_0x554fa0[_0xdecc('0x41')]['id'])};})[_0xdecc('0x12')](respondWithResult(_0x43d6a2,null))[_0xdecc('0x32')](handleError(_0x43d6a2,null));};exports[_0xdecc('0x42')]=function(_0x4405f3,_0x514e9e){var _0x5cc12d=_0x4405f3[_0xdecc('0x38')];var _0x3d6ec2;var _0x3598c7;if(_0x5cc12d['error'])throw _0x5cc12d;redis[_0xdecc('0x43')](_0x5cc12d[_0xdecc('0x44')])['then'](function(_0x38e123){if(!_0x38e123)throw new Error(_0xdecc('0x45'));_0x3d6ec2=JSON['parse'](_0x38e123);var _0x12dea9=Buffer[_0xdecc('0x46')](_0x5cc12d[_0xdecc('0x44')],_0xdecc('0x47'))[_0xdecc('0x48')](_0xdecc('0x49'));_0x3598c7=JSON[_0xdecc('0x4a')](_0x12dea9);if(!oauth[_0xdecc('0x4b')](_0x5cc12d[_0xdecc('0x4c')],_0x3d6ec2[_0xdecc('0x4d')]))throw new Error(_0xdecc('0x4e'));redis[_0xdecc('0x4f')](_0x5cc12d['state']);return oauth[_0xdecc('0x50')](_0x5cc12d[_0xdecc('0x51')],_0x3d6ec2);})[_0xdecc('0x12')](function(_0x19063d){_0x3d6ec2[_0xdecc('0x52')]=_0x19063d[_0xdecc('0x53')];_0x3d6ec2[_0xdecc('0x54')]=_0x19063d['refresh_token'];return db[_0xdecc('0x1a')][_0xdecc('0x11')]({'data5':_0x3d6ec2[_0xdecc('0x52')],'data6':_0x3d6ec2[_0xdecc('0x54')]},{'where':{'id':_0x3d6ec2['id']}});})[_0xdecc('0x12')](function(){oauth['startRefreshInterval'](_0x3d6ec2);socket['emit'](_0xdecc('0x55'),{'id':_0x3598c7['id']});return;})[_0xdecc('0x12')](respondWithStatusCode(_0x514e9e,null))['catch'](function(_0x53803f){if(_0x3598c7){socket['emit'](_0xdecc('0x56'),{'id':_0x3598c7['id']});}if(!_0x3d6ec2){logger['error'](_0xdecc('0x57'),_0x53803f);return _0x514e9e[_0xdecc('0x9')](0x1f4)[_0xdecc('0x58')](_0x53803f[_0xdecc('0x59')]);}logger[_0xdecc('0x14')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x3d6ec2['id'],JSON[_0xdecc('0x5a')](_0x53803f));});};
\ No newline at end of file
+var _0x4e6a=['get','state','parse','from','base64','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','data5','access_token','data6','refresh_token','microsoftAuthorization:success','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','defaults','redis','localhost','socket.io-emitter','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','name','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','rows','service','decryptString','data3','catch','show','params','includeAll','options','find','MicrosoftAzure','create','body','Name\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','sendStatus','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x4e6a,0xd4));var _0xa4e6=function(_0x1b2f05,_0x497bc8){_0x1b2f05=_0x1b2f05-0x0;var _0x2ef85b=_0x4e6a[_0x1b2f05];return _0x2ef85b;};'use strict';var _=require(_0xa4e6('0x0'));var Redis=require('ioredis');var qs=require(_0xa4e6('0x1'));var encryptor=require(_0xa4e6('0x2'));var config=require(_0xa4e6('0x3'));var logger=require(_0xa4e6('0x4'))(_0xa4e6('0x5'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0xa4e6('0x6')](config[_0xa4e6('0x7')],{'host':_0xa4e6('0x8'),'port':0x18eb});var socket=require(_0xa4e6('0x9'))(new Redis(config[_0xa4e6('0x7')]));var redis=new Redis(config[_0xa4e6('0x7')]);function respondWithStatusCode(_0x5560de,_0x2e81b3){_0x2e81b3=_0x2e81b3||0xcc;return function(_0x105f63){if(_0x105f63){return _0x5560de['sendStatus'](_0x2e81b3);}return _0x5560de[_0xa4e6('0xa')](_0x2e81b3)[_0xa4e6('0xb')]();};}function respondWithResult(_0x418b1b,_0xf8cf01){_0xf8cf01=_0xf8cf01||0xc8;return function(_0x43571d){if(_0x43571d){return _0x418b1b[_0xa4e6('0xa')](_0xf8cf01)[_0xa4e6('0xc')](_0x43571d);}};}function respondWithFilteredResult(_0x535184,_0xca4977){return function(_0x452eb6){if(_0x452eb6){var _0x2cd819=typeof _0xca4977['offset']==='undefined'&&typeof _0xca4977['limit']==='undefined';var _0x4f73b7=_0x452eb6[_0xa4e6('0xd')];var _0xb9b83d=_0x2cd819?0x0:_0xca4977[_0xa4e6('0xe')];var _0x12ed5a=_0x2cd819?_0x452eb6['count']:_0xca4977[_0xa4e6('0xe')]+_0xca4977[_0xa4e6('0xf')];var _0x2517ea;if(_0x12ed5a>=_0x4f73b7){_0x12ed5a=_0x4f73b7;_0x2517ea=0xc8;}else{_0x2517ea=0xce;}_0x535184[_0xa4e6('0xa')](_0x2517ea);return _0x535184[_0xa4e6('0x10')](_0xa4e6('0x11'),_0xb9b83d+'-'+_0x12ed5a+'/'+_0x4f73b7)[_0xa4e6('0xc')](_0x452eb6);}return null;};}function saveUpdates(_0x3961ba){return function(_0x4c8690){if(_0x4c8690){return _0x4c8690[_0xa4e6('0x12')](_0x3961ba)[_0xa4e6('0x13')](function(_0x394794){return _0x394794;});}return null;};}function removeEntity(_0x5e1448){return function(_0x3405f7){if(_0x3405f7){return _0x3405f7[_0xa4e6('0x14')]()[_0xa4e6('0x13')](function(){_0x5e1448[_0xa4e6('0xa')](0xcc)[_0xa4e6('0xb')]();});}};}function handleEntityNotFound(_0x2fc4fd){return function(_0x13be0a){if(!_0x13be0a){_0x2fc4fd['sendStatus'](0x194);}return _0x13be0a;};}function handleError(_0x339f92,_0x38db86){_0x38db86=_0x38db86||0x1f4;return function(_0x5f4cf4){logger['error'](_0x5f4cf4['stack']);if(_0x5f4cf4[_0xa4e6('0x15')]){delete _0x5f4cf4['name'];}_0x339f92[_0xa4e6('0xa')](_0x38db86)['send'](_0x5f4cf4);};}function maskClientSecret(_0x40901d){return _[_0xa4e6('0x16')](_0x40901d[_0xa4e6('0x17')](0x0,0x3),0x14,'*');}exports[_0xa4e6('0x18')]=function(_0x5cbad3,_0x3c5c89){var _0x293e42={},_0x3e08a2={},_0x11fa9c={'count':0x0,'rows':[]};var _0x167435=_[_0xa4e6('0x19')](db[_0xa4e6('0x1a')][_0xa4e6('0x1b')],function(_0xba4e98){return{'name':_0xba4e98[_0xa4e6('0x1c')],'type':_0xba4e98[_0xa4e6('0x1d')][_0xa4e6('0x1e')]};});_0x3e08a2[_0xa4e6('0x1f')]=_[_0xa4e6('0x19')](_0x167435,'name');_0x3e08a2['query']=_[_0xa4e6('0x20')](_0x5cbad3['query']);_0x3e08a2[_0xa4e6('0x21')]=_[_0xa4e6('0x22')](_0x3e08a2['model'],_0x3e08a2[_0xa4e6('0x23')]);_0x293e42['attributes']=_[_0xa4e6('0x22')](_0x3e08a2[_0xa4e6('0x1f')],qs[_0xa4e6('0x24')](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x24')]));_0x293e42[_0xa4e6('0x25')]=_0x293e42[_0xa4e6('0x25')][_0xa4e6('0x26')]?_0x293e42[_0xa4e6('0x25')]:_0x3e08a2[_0xa4e6('0x1f')];if(!_0x5cbad3['query'][_0xa4e6('0x27')](_0xa4e6('0x28'))){_0x293e42[_0xa4e6('0xf')]=qs[_0xa4e6('0xf')](_0x5cbad3[_0xa4e6('0x23')]['limit']);_0x293e42[_0xa4e6('0xe')]=qs[_0xa4e6('0xe')](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0xe')]);}_0x293e42[_0xa4e6('0x29')]=qs['sort'](_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x2a')]);_0x293e42[_0xa4e6('0x2b')]=qs['filters'](_[_0xa4e6('0x2c')](_0x5cbad3[_0xa4e6('0x23')],_0x3e08a2[_0xa4e6('0x21')]),_0x167435);if(_0x5cbad3['query']['filter']){_0x293e42[_0xa4e6('0x2b')]=_[_0xa4e6('0x2d')](_0x293e42['where'],{'$or':_[_0xa4e6('0x19')](_0x167435,function(_0x3a95ef){if(_0x3a95ef['type']!==_0xa4e6('0x2e')){var _0x584e82={};_0x584e82[_0x3a95ef[_0xa4e6('0x15')]]={'$like':'%'+_0x5cbad3[_0xa4e6('0x23')][_0xa4e6('0x2f')]+'%'};return _0x584e82;}})});}_0x293e42=_[_0xa4e6('0x2d')]({},_0x293e42,_0x5cbad3['options']);var _0x3aa101={'where':_0x293e42[_0xa4e6('0x2b')]};return db['CloudProvider'][_0xa4e6('0xd')](_0x3aa101)[_0xa4e6('0x13')](function(_0x14796e){_0x11fa9c['count']=_0x14796e;if(_0x5cbad3[_0xa4e6('0x23')]['includeAll']){_0x293e42[_0xa4e6('0x30')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x293e42);})[_0xa4e6('0x13')](function(_0x38f7c9){_0x11fa9c[_0xa4e6('0x31')]=_[_0xa4e6('0x19')](_0x38f7c9,function(_0x9e4f63){if(_0x9e4f63[_0xa4e6('0x32')]==='MicrosoftAzure'){var _0x3ce548=encryptor[_0xa4e6('0x33')](_0x9e4f63[_0xa4e6('0x34')]);_0x9e4f63[_0xa4e6('0x34')]=maskClientSecret(_0x3ce548);}return _0x9e4f63;});return _0x11fa9c;})[_0xa4e6('0x13')](respondWithFilteredResult(_0x3c5c89,_0x293e42))[_0xa4e6('0x35')](handleError(_0x3c5c89,null));};exports[_0xa4e6('0x36')]=function(_0x194b77,_0x58b9d3){var _0x1cb42f={'raw':!![],'where':{'id':_0x194b77[_0xa4e6('0x37')]['id']}},_0x3ace79={};_0x3ace79[_0xa4e6('0x1f')]=_[_0xa4e6('0x20')](db[_0xa4e6('0x1a')][_0xa4e6('0x1b')]);_0x3ace79['query']=_['keys'](_0x194b77[_0xa4e6('0x23')]);_0x3ace79[_0xa4e6('0x21')]=_[_0xa4e6('0x22')](_0x3ace79[_0xa4e6('0x1f')],_0x3ace79['query']);_0x1cb42f[_0xa4e6('0x25')]=_[_0xa4e6('0x22')](_0x3ace79['model'],qs[_0xa4e6('0x24')](_0x194b77[_0xa4e6('0x23')]['fields']));_0x1cb42f[_0xa4e6('0x25')]=_0x1cb42f[_0xa4e6('0x25')][_0xa4e6('0x26')]?_0x1cb42f[_0xa4e6('0x25')]:_0x3ace79[_0xa4e6('0x1f')];if(_0x194b77[_0xa4e6('0x23')][_0xa4e6('0x38')]){_0x1cb42f[_0xa4e6('0x30')]=[{'all':!![]}];}_0x1cb42f=_[_0xa4e6('0x2d')]({},_0x1cb42f,_0x194b77[_0xa4e6('0x39')]);return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')](_0x1cb42f)['then'](handleEntityNotFound(_0x58b9d3,null))[_0xa4e6('0x13')](function(_0x230d79){if(_0x230d79[_0xa4e6('0x32')]===_0xa4e6('0x3b')){var _0x32f282=encryptor[_0xa4e6('0x33')](_0x230d79[_0xa4e6('0x34')]);_0x230d79['data3']=maskClientSecret(_0x32f282);}return _0x230d79;})['then'](respondWithResult(_0x58b9d3,null))[_0xa4e6('0x35')](handleError(_0x58b9d3,null));};exports[_0xa4e6('0x3c')]=function(_0x42ebed,_0x51aa9d){if(!_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x15')])throw new Error(_0xa4e6('0x3e'));if(!_0x42ebed['body'][_0xa4e6('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x12dea5=db[_0xa4e6('0x1a')][_0xa4e6('0x1b')][_0xa4e6('0x32')]['values'];if(!_0x12dea5[_0xa4e6('0x3f')](_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x32')]))throw new Error(_0xa4e6('0x40')+_0x12dea5[_0xa4e6('0x41')](',\x20'));if(_0x42ebed['body']['service']===_0xa4e6('0x3b')&&_0x42ebed[_0xa4e6('0x3d')][_0xa4e6('0x34')]){_0x42ebed['body']['data3']=encryptor['encryptString'](_0x42ebed['body'][_0xa4e6('0x34')]);}return db[_0xa4e6('0x1a')][_0xa4e6('0x3c')](_0x42ebed[_0xa4e6('0x3d')],{})[_0xa4e6('0x13')](respondWithResult(_0x51aa9d,0xc9))[_0xa4e6('0x35')](handleError(_0x51aa9d,null));};exports[_0xa4e6('0x12')]=function(_0x4076f4,_0x50b423){if(_0x4076f4[_0xa4e6('0x3d')]['id']){delete _0x4076f4['body']['id'];}return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')]({'where':{'id':_0x4076f4[_0xa4e6('0x37')]['id']}})[_0xa4e6('0x13')](handleEntityNotFound(_0x50b423,null))[_0xa4e6('0x13')](function(_0x56c0f3){if(_0x56c0f3[_0xa4e6('0x32')]==='MicrosoftAzure'&&_0x4076f4[_0xa4e6('0x3d')][_0xa4e6('0x34')]){_0x4076f4[_0xa4e6('0x3d')]['data3']=encryptor[_0xa4e6('0x42')](_0x4076f4['body'][_0xa4e6('0x34')]);}return _0x56c0f3;})[_0xa4e6('0x13')](saveUpdates(_0x4076f4[_0xa4e6('0x3d')],null))['then'](respondWithResult(_0x50b423,null))[_0xa4e6('0x35')](handleError(_0x50b423,null));};exports[_0xa4e6('0x14')]=function(_0x503577,_0x32eb78){return db[_0xa4e6('0x1a')][_0xa4e6('0x3a')]({'where':{'id':_0x503577[_0xa4e6('0x37')]['id']}})[_0xa4e6('0x13')](handleEntityNotFound(_0x32eb78,null))[_0xa4e6('0x13')](removeEntity(_0x32eb78,null))[_0xa4e6('0x35')](handleError(_0x32eb78,null));};exports[_0xa4e6('0x43')]=function(_0x3e2603,_0x41994d){return db[_0xa4e6('0x1a')][_0xa4e6('0x44')]({'where':{'id':_0x3e2603[_0xa4e6('0x37')]['id']},'raw':!![]})[_0xa4e6('0x13')](function(_0x3aa3f7){if(!_0x3aa3f7)return _0x41994d[_0xa4e6('0x45')](0x194);return{'url':oauth[_0xa4e6('0x46')](_0x3aa3f7,_0x3e2603['user']['id'])};})[_0xa4e6('0x13')](respondWithResult(_0x41994d,null))[_0xa4e6('0x35')](handleError(_0x41994d,null));};exports[_0xa4e6('0x47')]=function(_0x5c414a,_0x23b43e){var _0x52a2ae=_0x5c414a[_0xa4e6('0x3d')];var _0x533ca9;var _0x16f4f7;if(_0x52a2ae[_0xa4e6('0x48')])throw _0x52a2ae;redis[_0xa4e6('0x49')](_0x52a2ae[_0xa4e6('0x4a')])[_0xa4e6('0x13')](function(_0x16a59a){if(!_0x16a59a)throw new Error('Invalid\x20state\x20parameter');_0x533ca9=JSON[_0xa4e6('0x4b')](_0x16a59a);var _0x5960b4=Buffer[_0xa4e6('0x4c')](_0x52a2ae['state'],_0xa4e6('0x4d'))[_0xa4e6('0x4e')]('ascii');_0x16f4f7=JSON['parse'](_0x5960b4);if(!oauth[_0xa4e6('0x4f')](_0x52a2ae[_0xa4e6('0x50')],_0x533ca9['oauth2Claims']))throw new Error(_0xa4e6('0x51'));redis[_0xa4e6('0x52')](_0x52a2ae[_0xa4e6('0x4a')]);return oauth['getOauth2MicrosoftAccessToken'](_0x52a2ae['code'],_0x533ca9);})[_0xa4e6('0x13')](function(_0xd8a061){_0x533ca9[_0xa4e6('0x53')]=_0xd8a061[_0xa4e6('0x54')];_0x533ca9[_0xa4e6('0x55')]=_0xd8a061[_0xa4e6('0x56')];return db[_0xa4e6('0x1a')][_0xa4e6('0x12')]({'data5':_0x533ca9['data5'],'data6':_0x533ca9[_0xa4e6('0x55')]},{'where':{'id':_0x533ca9['id']}});})[_0xa4e6('0x13')](function(){oauth['startRefreshInterval'](_0x533ca9);socket['emit'](_0xa4e6('0x57'),{'id':_0x16f4f7['id']});return;})[_0xa4e6('0x13')](respondWithStatusCode(_0x23b43e,null))[_0xa4e6('0x35')](function(_0x14a453){if(_0x16f4f7){socket[_0xa4e6('0x58')](_0xa4e6('0x59'),{'id':_0x16f4f7['id']});}if(!_0x533ca9){logger['error'](_0xa4e6('0x5a'),_0x14a453);return _0x23b43e[_0xa4e6('0xa')](0x1f4)[_0xa4e6('0x5b')](_0x14a453[_0xa4e6('0x5c')]);}logger['error'](_0xa4e6('0x5d'),_0x533ca9['id'],JSON[_0xa4e6('0x5e')](_0x14a453));});};
\ No newline at end of file
index 6d5302b..0c73291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc088=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','../../config/logger','api'];(function(_0xe6c803,_0x484b8c){var _0x588402=function(_0x552eaf){while(--_0x552eaf){_0xe6c803['push'](_0xe6c803['shift']());}};_0x588402(++_0x484b8c);}(_0xc088,0x1b6));var _0x8c08=function(_0x2df23d,_0x4b03b0){_0x2df23d=_0x2df23d-0x0;var _0x5d499a=_0xc088[_0x2df23d];return _0x5d499a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c08('0x0'))(_0x8c08('0x1'));var moment=require(_0x8c08('0x2'));var BPromise=require(_0x8c08('0x3'));var rp=require(_0x8c08('0x4'));var fs=require('fs');var path=require(_0x8c08('0x5'));var rimraf=require(_0x8c08('0x6'));var config=require(_0x8c08('0x7'));var attributes=require(_0x8c08('0x8'));module['exports']=function(_0x59add9,_0x5cfd7f){return _0x59add9[_0x8c08('0x9')]('CloudProvider',attributes,{'tableName':_0x8c08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x84a9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','CloudProvider','cloud_providers'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84a9,0x180));var _0x984a=function(_0x4905a0,_0x22dbe6){_0x4905a0=_0x4905a0-0x0;var _0x3e6f4d=_0x84a9[_0x4905a0];return _0x3e6f4d;};'use strict';var _=require(_0x984a('0x0'));var util=require(_0x984a('0x1'));var logger=require(_0x984a('0x2'))(_0x984a('0x3'));var moment=require(_0x984a('0x4'));var BPromise=require(_0x984a('0x5'));var rp=require(_0x984a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x984a('0x7'));var config=require(_0x984a('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x984a('0x9')]=function(_0x592fff,_0x4e18a6){return _0x592fff['define'](_0x984a('0xa'),attributes,{'tableName':_0x984a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d1fa9c6..7d4578b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351b=['openid','profile','email','offline_access','https://outlook.office.com/SMTP.Send','map','type','Dynamics365','data7','/.default','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','data2','id_token','from','stringify','randomBytes','toString','hex','client_id','data1','join','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','replace','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','POST','data5','access_token','CloudProvider','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','decryptString','intervals','bind','all','catch','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost'];(function(_0x49d522,_0x1292c3){var _0x5ca1d9=function(_0x274351){while(--_0x274351){_0x49d522['push'](_0x49d522['shift']());}};_0x5ca1d9(++_0x1292c3);}(_0x351b,0x91));var _0xb351=function(_0x3be6fb,_0x18fd31){_0x3be6fb=_0x3be6fb-0x0;var _0x4ba854=_0x351b[_0x3be6fb];return _0x4ba854;};'use strict';var _=require(_0xb351('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xb351('0x1'));var Redis=require(_0xb351('0x2'));var rp=require(_0xb351('0x3'));var util=require(_0xb351('0x4'));var encryptor=require(_0xb351('0x5'));var config=require(_0xb351('0x6'));var logger=require(_0xb351('0x7'))(_0xb351('0x8'));var schedule=require(_0xb351('0x9'));var db=require(_0xb351('0xa'))['db'];config[_0xb351('0xb')]=_['defaults'](config[_0xb351('0xb')],{'host':_0xb351('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xb351('0xd'),_0xb351('0xe'),_0xb351('0xf'),_0xb351('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0xb351('0x11')],'Dynamics365':[_0xb351('0xd'),_0xb351('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x10a203){var _0x30a1b6=_[_0xb351('0x12')](AZURE_AUTH_SCOPES[_0x10a203[_0xb351('0x13')]]);if(_0x10a203['type']===_0xb351('0x14'))_0x30a1b6['push'](_0x10a203[_0xb351('0x15')]+_0xb351('0x16'));return _0x30a1b6['join']('\x20');}function getAccessTokenScope(_0x27d9b0){if(_0x27d9b0[_0xb351('0x13')]===_0xb351('0x17'))return _0xb351('0x18');if(_0x27d9b0[_0xb351('0x13')]===_0xb351('0x14'))return _0x27d9b0[_0xb351('0x15')]+_0xb351('0x16');}function generateMicrosoftAuthorizationUrl(_0x3f2cec,_0x14450d){var _0x82029e=MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x3f2cec[_0xb351('0x1a')]);var _0x2e6ec7=['code',_0xb351('0x1b')];var _0x50cf72=Buffer[_0xb351('0x1c')](JSON[_0xb351('0x1d')]({'id':_0x14450d}))['toString']('base64');var _0x4ba651=crypto[_0xb351('0x1e')](0x10)[_0xb351('0x1f')](_0xb351('0x20'));var _0x408381=getAuthorizationScopes(_0x3f2cec);var _0x5c8394=[{'key':_0xb351('0x21'),'value':_0x3f2cec[_0xb351('0x22')]},{'key':'response_type','value':encodeURIComponent(_0x2e6ec7[_0xb351('0x23')]('\x20'))},{'key':_0xb351('0x24'),'value':_0x3f2cec['data4']},{'key':_0xb351('0x25'),'value':_0xb351('0x26')},{'key':_0xb351('0x27'),'value':encodeURIComponent(_0x408381)},{'key':_0xb351('0x28'),'value':_0x50cf72},{'key':_0xb351('0x29'),'value':_0x4ba651},{'key':_0xb351('0x2a'),'value':'login'}];var _0x5229b7=_0x82029e+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x5c8394,function(_0x4a1752){return _0x4a1752[_0xb351('0x2b')]+'='+_0x4a1752[_0xb351('0x2c')];})[_0xb351('0x23')]('&');_0x3f2cec[_0xb351('0x2d')]={'issuer':_0x82029e[_0xb351('0x2e')](_0xb351('0x2f'),''),'audience':_0x3f2cec['data1'],'state':_0x50cf72,'nonce':_0x4ba651};redis[_0xb351('0x30')](_0x50cf72,JSON[_0xb351('0x1d')](_0x3f2cec));return _0x5229b7;}function isValidIdToken(_0x3fda14,_0xdbad99){try{var _0x24093f=jwt[_0xb351('0x31')](_0x3fda14,{'complete':!![]});var _0x4240ca=_0x24093f[_0xb351('0x32')];if(_0x4240ca[_0xb351('0x33')]!==_0xdbad99[_0xb351('0x34')])return![];if(_0x4240ca[_0xb351('0x35')]!==_0xdbad99[_0xb351('0x36')])return![];if(_0x4240ca['nonce']!==_0xdbad99[_0xb351('0x29')])return![];if(moment()[_0xb351('0x37')](moment[_0xb351('0x38')](_0x4240ca[_0xb351('0x39')])))return![];return!![];}catch(_0x2c30d8){throw _0x2c30d8;}}function refreshOauth2MicrosoftAccessToken(_0x229eda){return Promise[_0xb351('0x3a')]()[_0xb351('0x3b')](function(){if(_0x229eda[_0xb351('0x3c')])return _0x229eda;return db['CloudProvider'][_0xb351('0x3d')]({'where':{'id':_0x229eda['id']},'raw':!![]});})['then'](function(_0x2ca782){var _0x3e71d4={'grant_type':_0xb351('0x3e'),'refresh_token':_0x2ca782[_0xb351('0x3f')],'scope':getAccessTokenScope(_0x2ca782),'redirect_uri':_0x2ca782['data4'],'client_id':_0x2ca782[_0xb351('0x22')],'client_secret':encryptor['decryptString'](_0x2ca782[_0xb351('0x3c')])};var _0x380fcd={'method':_0xb351('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x2ca782[_0xb351('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3e71d4,'json':!![]};return rp(_0x380fcd);})[_0xb351('0x3b')](function(_0x32bb37){_0x229eda[_0xb351('0x41')]=_0x32bb37[_0xb351('0x42')];_0x229eda[_0xb351('0x3f')]=_0x32bb37[_0xb351('0x3e')];return db[_0xb351('0x43')][_0xb351('0x44')]({'data5':_0x229eda[_0xb351('0x41')],'data6':_0x229eda[_0xb351('0x3f')]},{'where':{'id':_0x229eda['id']}});})[_0xb351('0x3b')](function(){return _0x229eda;})['catch'](function(_0x8636a9){logger['error'](_0xb351('0x45'),_0x229eda['id'],_0x8636a9);});}function getOauth2MicrosoftAccessToken(_0x54a597,_0x1e31cb){var _0x2352af={'grant_type':'authorization_code','code':_0x54a597,'scope':getAccessTokenScope(_0x1e31cb),'redirect_uri':_0x1e31cb[_0xb351('0x46')],'client_id':_0x1e31cb[_0xb351('0x22')],'client_secret':encryptor[_0xb351('0x47')](_0x1e31cb[_0xb351('0x3c')])};var _0x396932={'method':_0xb351('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0xb351('0x19'),_0x1e31cb[_0xb351('0x1a')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2352af,'json':!![]};return rp(_0x396932);}function startRefreshInterval(_0x3941ed){var _0x5ca9eb=schedule[_0xb351('0x48')];if(_0x5ca9eb[_0x3941ed['id']])clearInterval(_0x5ca9eb[_0x3941ed['id']]);_0x5ca9eb[_0x3941ed['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xb351('0x49')](this,{'id':_0x3941ed['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xb351('0x48')]=_0x5ca9eb;}function startAllRefreshIntervals(){return db[_0xb351('0x43')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xb351('0x3b')](function(_0xf4b05f){var _0xa36155=_0xf4b05f['map'](function(_0xbd75e4){return refreshOauth2MicrosoftAccessToken(_0xbd75e4)[_0xb351('0x3b')](function(_0x45ea6c){startRefreshInterval(_0x45ea6c);});});return Promise[_0xb351('0x4a')](_0xa36155);})[_0xb351('0x4b')](function(_0x5d5bf){var _0x38ce36=_0x5d5bf?util[_0xb351('0x4c')](_0x5d5bf,{'showHidden':![],'depth':null}):'';logger[_0xb351('0x4d')](_0xb351('0x4e'),_0x38ce36);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x15ba=['data2','then','data5','access_token','refresh_token','update','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','bind','all','inspect','error','exports','lodash','crypto','jsonwebtoken','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','localhost','redis','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','push','data7','/.default','Outlook365','Dynamics365','{TENANT_ID}','code','stringify','toString','base64','randomBytes','hex','data4','response_mode','form_post','scope','state','nonce','login','key','join','oauth2Claims','replace','oauth2/','set','payload','issuer','aud','audience','isAfter','unix','resolve','CloudProvider','findOne','data6','data1','decryptString'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x15ba,0x120));var _0xa15b=function(_0x1b26ac,_0x5ea577){_0x1b26ac=_0x1b26ac-0x0;var _0x2d88ec=_0x15ba[_0x1b26ac];return _0x2d88ec;};'use strict';var _=require(_0xa15b('0x0'));var crypto=require(_0xa15b('0x1'));var jwt=require(_0xa15b('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0xa15b('0x3'));var util=require(_0xa15b('0x4'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xa15b('0x5'))(_0xa15b('0x6'));var schedule=require(_0xa15b('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa15b('0x8'),'port':0x18eb});var redis=new Redis(config[_0xa15b('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0xa15b('0xa'),_0xa15b('0xb'),_0xa15b('0xc'),_0xa15b('0xd'),_0xa15b('0xe'),_0xa15b('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xa15b('0xa'),_0xa15b('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0xa15b('0x10');var MICROSOFT_TOKEN_ENDPOINT=_0xa15b('0x11');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x57fc68){var _0x4bf462=_[_0xa15b('0x12')](AZURE_AUTH_SCOPES[_0x57fc68[_0xa15b('0x13')]]);if(_0x57fc68['type']==='Dynamics365')_0x4bf462[_0xa15b('0x14')](_0x57fc68[_0xa15b('0x15')]+_0xa15b('0x16'));return _0x4bf462['join']('\x20');}function getAccessTokenScope(_0x454148){if(_0x454148['type']===_0xa15b('0x17'))return _0xa15b('0xe');if(_0x454148[_0xa15b('0x13')]===_0xa15b('0x18'))return _0x454148[_0xa15b('0x15')]+_0xa15b('0x16');}function generateMicrosoftAuthorizationUrl(_0x4a2fa3,_0x1fd991){var _0x5903c2=MICROSOFT_AUTH_URL['replace'](_0xa15b('0x19'),_0x4a2fa3['data2']);var _0x1f491b=[_0xa15b('0x1a'),'id_token'];var _0x382127=Buffer['from'](JSON[_0xa15b('0x1b')]({'id':_0x1fd991}))[_0xa15b('0x1c')](_0xa15b('0x1d'));var _0x559aca=crypto[_0xa15b('0x1e')](0x10)[_0xa15b('0x1c')](_0xa15b('0x1f'));var _0x53b09f=getAuthorizationScopes(_0x4a2fa3);var _0x568926=[{'key':'client_id','value':_0x4a2fa3['data1']},{'key':'response_type','value':encodeURIComponent(_0x1f491b['join']('\x20'))},{'key':'redirect_uri','value':_0x4a2fa3[_0xa15b('0x20')]},{'key':_0xa15b('0x21'),'value':_0xa15b('0x22')},{'key':_0xa15b('0x23'),'value':encodeURIComponent(_0x53b09f)},{'key':_0xa15b('0x24'),'value':_0x382127},{'key':_0xa15b('0x25'),'value':_0x559aca},{'key':'prompt','value':_0xa15b('0x26')}];var _0x3ad18a=_0x5903c2+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xa15b('0x12')](_0x568926,function(_0x7a9f62){return _0x7a9f62[_0xa15b('0x27')]+'='+_0x7a9f62['value'];})[_0xa15b('0x28')]('&');_0x4a2fa3[_0xa15b('0x29')]={'issuer':_0x5903c2[_0xa15b('0x2a')](_0xa15b('0x2b'),''),'audience':_0x4a2fa3['data1'],'state':_0x382127,'nonce':_0x559aca};redis[_0xa15b('0x2c')](_0x382127,JSON[_0xa15b('0x1b')](_0x4a2fa3));return _0x3ad18a;}function isValidIdToken(_0x2f993b,_0x4bb2c9){try{var _0x53f86f=jwt['decode'](_0x2f993b,{'complete':!![]});var _0x182a31=_0x53f86f[_0xa15b('0x2d')];if(_0x182a31['iss']!==_0x4bb2c9[_0xa15b('0x2e')])return![];if(_0x182a31[_0xa15b('0x2f')]!==_0x4bb2c9[_0xa15b('0x30')])return![];if(_0x182a31[_0xa15b('0x25')]!==_0x4bb2c9[_0xa15b('0x25')])return![];if(moment()[_0xa15b('0x31')](moment[_0xa15b('0x32')](_0x182a31['exp'])))return![];return!![];}catch(_0x17283c){throw _0x17283c;}}function refreshOauth2MicrosoftAccessToken(_0x179007){return Promise[_0xa15b('0x33')]()['then'](function(){if(_0x179007['data3'])return _0x179007;return db[_0xa15b('0x34')][_0xa15b('0x35')]({'where':{'id':_0x179007['id']},'raw':!![]});})['then'](function(_0x4d5082){var _0x531102={'grant_type':'refresh_token','refresh_token':_0x4d5082[_0xa15b('0x36')],'scope':getAccessTokenScope(_0x4d5082),'redirect_uri':_0x4d5082[_0xa15b('0x20')],'client_id':_0x4d5082[_0xa15b('0x37')],'client_secret':encryptor[_0xa15b('0x38')](_0x4d5082['data3'])};var _0x3234a5={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa15b('0x2a')](_0xa15b('0x19'),_0x4d5082[_0xa15b('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x531102,'json':!![]};return rp(_0x3234a5);})[_0xa15b('0x3a')](function(_0x5c4fcf){_0x179007[_0xa15b('0x3b')]=_0x5c4fcf[_0xa15b('0x3c')];_0x179007[_0xa15b('0x36')]=_0x5c4fcf[_0xa15b('0x3d')];return db[_0xa15b('0x34')][_0xa15b('0x3e')]({'data5':_0x179007[_0xa15b('0x3b')],'data6':_0x179007[_0xa15b('0x36')]},{'where':{'id':_0x179007['id']}});})[_0xa15b('0x3a')](function(){return _0x179007;})['catch'](function(_0x48c1db){logger['error'](_0xa15b('0x3f'),_0x179007['id'],_0x48c1db);});}function getOauth2MicrosoftAccessToken(_0x495ae2,_0x352328){var _0x3f47de={'grant_type':'authorization_code','code':_0x495ae2,'scope':getAccessTokenScope(_0x352328),'redirect_uri':_0x352328['data4'],'client_id':_0x352328[_0xa15b('0x37')],'client_secret':encryptor[_0xa15b('0x38')](_0x352328['data3'])};var _0x1b7b4a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xa15b('0x2a')](_0xa15b('0x19'),_0x352328[_0xa15b('0x39')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3f47de,'json':!![]};return rp(_0x1b7b4a);}function startRefreshInterval(_0x4a36b7){var _0x153ac6=schedule['intervals'];if(_0x153ac6[_0x4a36b7['id']])clearInterval(_0x153ac6[_0x4a36b7['id']]);_0x153ac6[_0x4a36b7['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa15b('0x40')](this,{'id':_0x4a36b7['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x153ac6;}function startAllRefreshIntervals(){return db[_0xa15b('0x34')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xa15b('0x3a')](function(_0x1681fe){var _0x11ad39=_0x1681fe[_0xa15b('0x12')](function(_0xf30aeb){return refreshOauth2MicrosoftAccessToken(_0xf30aeb)[_0xa15b('0x3a')](function(_0x99649c){startRefreshInterval(_0x99649c);});});return Promise[_0xa15b('0x41')](_0x11ad39);})['catch'](function(_0x7690f1){var _0x142e70=_0x7690f1?util[_0xa15b('0x42')](_0x7690f1,{'showHidden':![],'depth':null}):'';logger[_0xa15b('0x43')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x142e70);});}module[_0xa15b('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 357ba26..f2ee3f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe797=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe797,0x12a));var _0x7e79=function(_0x41ae18,_0x570d43){_0x41ae18=_0x41ae18-0x0;var _0x51c805=_0xe797[_0x41ae18];return _0x51c805;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var moment=require(_0x7e79('0x2'));var BPromise=require(_0x7e79('0x3'));var rs=require(_0x7e79('0x4'));var fs=require('fs');var Redis=require(_0x7e79('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e79('0x6'));var logger=require(_0x7e79('0x7'))('rpc');var config=require(_0x7e79('0x8'));var jayson=require(_0x7e79('0x9'));var client=jayson[_0x7e79('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fdfa1,_0x9dd35a,_0x358bd6){return new BPromise(function(_0x484e66,_0x54aab5){return client[_0x7e79('0xb')](_0x4fdfa1,_0x358bd6)[_0x7e79('0xc')](function(_0x134e89){logger['info'](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));logger[_0x7e79('0xf')](_0x7e79('0x10'),_0x9dd35a,_0x7e79('0xe'),JSON[_0x7e79('0x11')](_0x134e89));if(_0x134e89[_0x7e79('0x12')]){if(_0x134e89[_0x7e79('0x12')][_0x7e79('0x13')]===0x1f4){logger['error'](_0x7e79('0xd'),_0x9dd35a,_0x134e89['error'][_0x7e79('0x14')]);return _0x54aab5(_0x134e89['error'][_0x7e79('0x14')]);}logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x134e89[_0x7e79('0x12')]['message']);return _0x484e66(_0x134e89[_0x7e79('0x12')][_0x7e79('0x14')]);}else{logger[_0x7e79('0x15')](_0x7e79('0xd'),_0x9dd35a,_0x7e79('0xe'));_0x484e66(_0x134e89[_0x7e79('0x16')][_0x7e79('0x14')]);}})['catch'](function(_0x2ec0c7){logger[_0x7e79('0x12')](_0x7e79('0xd'),_0x9dd35a,_0x2ec0c7);_0x54aab5(_0x2ec0c7);});});}
\ No newline at end of file
+var _0x0570=['request','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xd02def,_0x144f25){var _0x2e8374=function(_0x5ceb35){while(--_0x5ceb35){_0xd02def['push'](_0xd02def['shift']());}};_0x2e8374(++_0x144f25);}(_0x0570,0x172));var _0x0057=function(_0x31011c,_0x3f6aa6){_0x31011c=_0x31011c-0x0;var _0x5078c4=_0x0570[_0x31011c];return _0x5078c4;};'use strict';var _=require('lodash');var util=require(_0x0057('0x0'));var moment=require(_0x0057('0x1'));var BPromise=require(_0x0057('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0057('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0057('0x4'));var logger=require('../../config/logger')(_0x0057('0x5'));var config=require(_0x0057('0x6'));var jayson=require(_0x0057('0x7'));var client=jayson[_0x0057('0x8')][_0x0057('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5096e2,_0xc86734,_0x529f55){return new BPromise(function(_0x15d424,_0x2f9d7f){return client[_0x0057('0xa')](_0x5096e2,_0x529f55)[_0x0057('0xb')](function(_0x29b7c6){logger['info'](_0x0057('0xc'),_0xc86734,_0x0057('0xd'));logger[_0x0057('0xe')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'),JSON[_0x0057('0xf')](_0x29b7c6));if(_0x29b7c6['error']){if(_0x29b7c6['error'][_0x0057('0x10')]===0x1f4){logger[_0x0057('0x11')](_0x0057('0xc'),_0xc86734,_0x29b7c6['error'][_0x0057('0x12')]);return _0x2f9d7f(_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);}logger[_0x0057('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x29b7c6[_0x0057('0x11')][_0x0057('0x12')]);return _0x15d424(_0x29b7c6['error'][_0x0057('0x12')]);}else{logger[_0x0057('0x13')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x0057('0xd'));_0x15d424(_0x29b7c6['result'][_0x0057('0x12')]);}})['catch'](function(_0x4be851){logger[_0x0057('0x11')]('CloudProvider,\x20%s,\x20%s',_0xc86734,_0x4be851);_0x2f9d7f(_0x4be851);});});}
\ No newline at end of file
index 2199671..b1f7097 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x233821,_0x230bfc){var _0xf3613e=function(_0x3594d9){while(--_0x3594d9){_0x233821['push'](_0x233821['shift']());}};_0xf3613e(++_0x230bfc);}(_0xadb5,0xad));var _0x5adb=function(_0x367e32,_0x9a8868){_0x367e32=_0x367e32-0x0;var _0x3d7295=_0xadb5[_0x367e32];return _0x3d7295;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
+var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x7a54,0x106));var _0x47a5=function(_0x10df32,_0x16e49e){_0x10df32=_0x10df32-0x0;var _0x4023a6=_0x7a54[_0x10df32];return _0x4023a6;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router;
\ No newline at end of file
index 366f310..dfb0344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9ca=['exports','STRING','sequelize'];(function(_0x419f08,_0x140060){var _0x47b5f8=function(_0x1906fa){while(--_0x1906fa){_0x419f08['push'](_0x419f08['shift']());}};_0x47b5f8(++_0x140060);}(_0xd9ca,0x1a0));var _0xad9c=function(_0x449b95,_0x3f0845){_0x449b95=_0x449b95-0x0;var _0x4e6519=_0xd9ca[_0x449b95];return _0x4e6519;};'use strict';var Sequelize=require(_0xad9c('0x0'));module[_0xad9c('0x1')]={'name':{'type':Sequelize[_0xad9c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xad9c('0x2')]},'companyId':{'type':Sequelize[_0xad9c('0x2')]},'website':{'type':Sequelize[_0xad9c('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xad9c('0x2')]},'type':{'type':Sequelize[_0xad9c('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xad9c('0x2')]},'city':{'type':Sequelize[_0xad9c('0x2')]},'country':{'type':Sequelize[_0xad9c('0x2')]},'email':{'type':Sequelize[_0xad9c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xad9c('0x2')]},'sCity':{'type':Sequelize[_0xad9c('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xad9c('0x2')]}};
\ No newline at end of file
+var _0xda9c=['exports','STRING','name','sequelize'];(function(_0x2e5afc,_0x352c85){var _0x32c519=function(_0x5f0313){while(--_0x5f0313){_0x2e5afc['push'](_0x2e5afc['shift']());}};_0x32c519(++_0x352c85);}(_0xda9c,0x7b));var _0xcda9=function(_0x523eaf,_0x487fc6){_0x523eaf=_0x523eaf-0x0;var _0x319ba0=_0xda9c[_0x523eaf];return _0x319ba0;};'use strict';var Sequelize=require(_0xcda9('0x0'));module[_0xcda9('0x1')]={'name':{'type':Sequelize[_0xcda9('0x2')],'unique':_0xcda9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xcda9('0x2')]},'companyId':{'type':Sequelize[_0xcda9('0x2')]},'website':{'type':Sequelize[_0xcda9('0x2')]},'phone':{'type':Sequelize[_0xcda9('0x2')]},'fax':{'type':Sequelize[_0xcda9('0x2')]},'type':{'type':Sequelize[_0xcda9('0x2')]},'street':{'type':Sequelize[_0xcda9('0x2')]},'postalCode':{'type':Sequelize[_0xcda9('0x2')]},'city':{'type':Sequelize[_0xcda9('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0xcda9('0x2')]},'sCity':{'type':Sequelize[_0xcda9('0x2')]},'sCountry':{'type':Sequelize[_0xcda9('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3ecd6b3..1ca3f84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26a0=['merge','map','options','include','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','destroy','get','Companies','UserProfileResource','then','end','error','stack','name','send','index','CmCompany','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x26a0,0xc3));var _0x026a=function(_0x28dcd3,_0x33e8d0){_0x28dcd3=_0x28dcd3-0x0;var _0x44e5db=_0x26a0[_0x28dcd3];return _0x44e5db;};'use strict';var emlformat=require(_0x026a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x026a('0x1'));var rp=require(_0x026a('0x2'));var moment=require('moment');var BPromise=require(_0x026a('0x3'));var Mustache=require(_0x026a('0x4'));var util=require(_0x026a('0x5'));var path=require(_0x026a('0x6'));var sox=require(_0x026a('0x7'));var csv=require(_0x026a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x026a('0x9'));var _=require('lodash');var squel=require(_0x026a('0xa'));var crypto=require(_0x026a('0xb'));var jsforce=require(_0x026a('0xc'));var deskjs=require(_0x026a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x026a('0xe'));var authService=require(_0x026a('0xf'));var qs=require(_0x026a('0x10'));var as=require(_0x026a('0x11'));var hardwareService=require(_0x026a('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x026a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x026a('0x14'))['db'];function respondWithStatusCode(_0x513565,_0x31b8fc){_0x31b8fc=_0x31b8fc||0xcc;return function(_0x4b8475){if(_0x4b8475){return _0x513565[_0x026a('0x15')](_0x31b8fc);}return _0x513565[_0x026a('0x16')](_0x31b8fc)['end']();};}function respondWithResult(_0x1eb5b6,_0x1e0a3e){_0x1e0a3e=_0x1e0a3e||0xc8;return function(_0x1a43e6){if(_0x1a43e6){return _0x1eb5b6[_0x026a('0x16')](_0x1e0a3e)[_0x026a('0x17')](_0x1a43e6);}};}function respondWithFilteredResult(_0x1497e5,_0x44c66f){return function(_0xb66623){if(_0xb66623){var _0x43fed2=typeof _0x44c66f['offset']===_0x026a('0x18')&&typeof _0x44c66f[_0x026a('0x19')]===_0x026a('0x18');var _0x331603=_0xb66623['count'];var _0x1d5ebf=_0x43fed2?0x0:_0x44c66f[_0x026a('0x1a')];var _0xbcb4ff=_0x43fed2?_0xb66623[_0x026a('0x1b')]:_0x44c66f[_0x026a('0x1a')]+_0x44c66f['limit'];var _0x11be86;if(_0xbcb4ff>=_0x331603){_0xbcb4ff=_0x331603;_0x11be86=0xc8;}else{_0x11be86=0xce;}_0x1497e5[_0x026a('0x16')](_0x11be86);return _0x1497e5['set'](_0x026a('0x1c'),_0x1d5ebf+'-'+_0xbcb4ff+'/'+_0x331603)[_0x026a('0x17')](_0xb66623);}return null;};}function patchUpdates(_0x2a4449){return function(_0x2cfdb8){try{jsonpatch[_0x026a('0x1d')](_0x2cfdb8,_0x2a4449,!![]);}catch(_0x277feb){return BPromise[_0x026a('0x1e')](_0x277feb);}return _0x2cfdb8[_0x026a('0x1f')]();};}function saveUpdates(_0x1f39cc,_0x3aa886){return function(_0x5560bb){if(_0x5560bb){return _0x5560bb[_0x026a('0x20')](_0x1f39cc)['then'](function(_0x58de78){return _0x58de78;});}return null;};}function removeEntity(_0x29bf50,_0x12c6be){return function(_0x50e113){if(_0x50e113){return _0x50e113[_0x026a('0x21')]()['then'](function(){var _0x532a32=_0x50e113[_0x026a('0x22')]({'plain':!![]});var _0x215956=_0x026a('0x23');return db[_0x026a('0x24')]['destroy']({'where':{'type':_0x215956,'resourceId':_0x532a32['id']}})[_0x026a('0x25')](function(){return _0x50e113;});})[_0x026a('0x25')](function(){_0x29bf50[_0x026a('0x16')](0xcc)[_0x026a('0x26')]();});}};}function handleEntityNotFound(_0x2c9c0f,_0x1dbbec){return function(_0x9ac4e6){if(!_0x9ac4e6){_0x2c9c0f[_0x026a('0x15')](0x194);}return _0x9ac4e6;};}function handleError(_0x287a31,_0x4eb141){_0x4eb141=_0x4eb141||0x1f4;return function(_0x1f96e8){logger[_0x026a('0x27')](_0x1f96e8[_0x026a('0x28')]);if(_0x1f96e8[_0x026a('0x29')]){delete _0x1f96e8[_0x026a('0x29')];}_0x287a31[_0x026a('0x16')](_0x4eb141)[_0x026a('0x2a')](_0x1f96e8);};}exports[_0x026a('0x2b')]=function(_0x4f7d29,_0x5e6ec4){var _0x468576={},_0x39bad2={},_0x1e4f06={'count':0x0,'rows':[]};return db[_0x026a('0x2c')]['describe']()[_0x026a('0x25')](function(_0x3a6530){_0x39bad2[_0x026a('0x2d')]=_['keys'](_0x3a6530);_0x39bad2[_0x026a('0x2e')]=_['keys'](_0x4f7d29[_0x026a('0x2e')]);_0x39bad2[_0x026a('0x2f')]=_[_0x026a('0x30')](_0x39bad2[_0x026a('0x2d')],_0x39bad2[_0x026a('0x2e')]);_0x468576['attributes']=_['intersection'](_0x39bad2[_0x026a('0x2d')],qs[_0x026a('0x31')](_0x4f7d29['query'][_0x026a('0x31')]));_0x468576[_0x026a('0x32')]=_0x468576[_0x026a('0x32')][_0x026a('0x33')]?_0x468576[_0x026a('0x32')]:_0x39bad2[_0x026a('0x2d')];if(!_0x4f7d29[_0x026a('0x2e')][_0x026a('0x34')]('nolimit')){_0x468576['limit']=qs[_0x026a('0x19')](_0x4f7d29[_0x026a('0x2e')]['limit']);_0x468576[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x4f7d29[_0x026a('0x2e')][_0x026a('0x1a')]);}_0x468576[_0x026a('0x35')]=qs[_0x026a('0x36')](_0x4f7d29[_0x026a('0x2e')]['sort']);_0x468576[_0x026a('0x37')]=qs[_0x026a('0x2f')](_['pick'](_0x4f7d29['query'],_0x39bad2['filters']),_0x3a6530);if(_0x4f7d29[_0x026a('0x2e')][_0x026a('0x38')]){_0x468576['where']=_[_0x026a('0x39')](_0x468576[_0x026a('0x37')],{'$or':_[_0x026a('0x3a')](_0x468576[_0x026a('0x32')],function(_0x2be8fb){var _0xea8032={};_0xea8032[_0x2be8fb]={'$like':'%'+_0x4f7d29[_0x026a('0x2e')][_0x026a('0x38')]+'%'};return _0xea8032;})});}_0x468576=_['merge']({},_0x468576,_0x4f7d29[_0x026a('0x3b')]);var _0x4352f5={'where':_0x468576[_0x026a('0x37')]};return db['CmCompany'][_0x026a('0x1b')](_0x4352f5)['then'](function(_0x307a55){_0x1e4f06[_0x026a('0x1b')]=_0x307a55;if(_0x4f7d29[_0x026a('0x2e')]['includeAll']){_0x468576[_0x026a('0x3c')]=[{'all':!![]}];}return db[_0x026a('0x2c')]['findAll'](_0x468576);})[_0x026a('0x25')](function(_0x4e1fdd){_0x1e4f06[_0x026a('0x3d')]=_0x4e1fdd;return _0x1e4f06;})['then'](respondWithFilteredResult(_0x5e6ec4,_0x468576))[_0x026a('0x3e')](handleError(_0x5e6ec4,null));})[_0x026a('0x3e')](handleError(_0x5e6ec4,null));};exports[_0x026a('0x3f')]=function(_0x4e434c,_0x75f796){var _0x35ebbd={'raw':![],'where':{'id':_0x4e434c[_0x026a('0x40')]['id']}},_0x2d5206={};_0x2d5206[_0x026a('0x2d')]=_[_0x026a('0x41')](db[_0x026a('0x2c')][_0x026a('0x42')]);_0x2d5206[_0x026a('0x2e')]=_[_0x026a('0x41')](_0x4e434c[_0x026a('0x2e')]);_0x2d5206[_0x026a('0x2f')]=_['intersection'](_0x2d5206['model'],_0x2d5206['query']);_0x35ebbd[_0x026a('0x32')]=_[_0x026a('0x30')](_0x2d5206[_0x026a('0x2d')],qs[_0x026a('0x31')](_0x4e434c[_0x026a('0x2e')]['fields']));_0x35ebbd[_0x026a('0x32')]=_0x35ebbd[_0x026a('0x32')][_0x026a('0x33')]?_0x35ebbd['attributes']:_0x2d5206['model'];if(_0x4e434c[_0x026a('0x2e')][_0x026a('0x43')]){_0x35ebbd[_0x026a('0x3c')]=[{'all':!![]}];}_0x35ebbd=_['merge']({},_0x35ebbd,_0x4e434c['options']);return db[_0x026a('0x2c')][_0x026a('0x44')](_0x35ebbd)[_0x026a('0x25')](handleEntityNotFound(_0x75f796,null))['then'](respondWithResult(_0x75f796,null))['catch'](handleError(_0x75f796,null));};exports[_0x026a('0x45')]=function(_0x1b8948,_0x196b6e){return db[_0x026a('0x2c')][_0x026a('0x45')](_0x1b8948[_0x026a('0x46')],{})['then'](function(_0x3202e4){var _0x5b0e77=_0x1b8948[_0x026a('0x47')]['get']({'plain':!![]});if(!_0x5b0e77)throw new Error(_0x026a('0x48'));if(_0x5b0e77['role']===_0x026a('0x47')){var _0x39f54b=_0x3202e4[_0x026a('0x22')]({'plain':!![]});var _0x2960d6=_0x026a('0x23');return db[_0x026a('0x49')][_0x026a('0x44')]({'where':{'name':_0x2960d6,'userProfileId':_0x5b0e77['userProfileId']},'raw':!![]})[_0x026a('0x25')](function(_0x61bef4){if(_0x61bef4&&_0x61bef4[_0x026a('0x4a')]===0x0){return db['UserProfileResource'][_0x026a('0x45')]({'name':_0x39f54b[_0x026a('0x29')],'resourceId':_0x39f54b['id'],'type':_0x61bef4['name'],'sectionId':_0x61bef4['id']},{})[_0x026a('0x25')](function(){return _0x3202e4;});}else{return _0x3202e4;}})['catch'](function(_0x51f5ea){logger[_0x026a('0x27')](_0x026a('0x4b'),_0x51f5ea);throw _0x51f5ea;});}return _0x3202e4;})['then'](respondWithResult(_0x196b6e,0xc9))[_0x026a('0x3e')](handleError(_0x196b6e,null));};exports[_0x026a('0x20')]=function(_0x1ddc7a,_0x54b4be){if(_0x1ddc7a['body']['id']){delete _0x1ddc7a[_0x026a('0x46')]['id'];}return db['CmCompany']['find']({'where':{'id':_0x1ddc7a['params']['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x54b4be,null))[_0x026a('0x25')](saveUpdates(_0x1ddc7a[_0x026a('0x46')],null))[_0x026a('0x25')](respondWithResult(_0x54b4be,null))[_0x026a('0x3e')](handleError(_0x54b4be,null));};exports['destroy']=function(_0x7d9d1d,_0x248bdd){return db[_0x026a('0x2c')][_0x026a('0x44')]({'where':{'id':_0x7d9d1d[_0x026a('0x40')]['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x248bdd,null))[_0x026a('0x25')](removeEntity(_0x248bdd,null))[_0x026a('0x3e')](handleError(_0x248bdd,null));};exports[_0x026a('0x4c')]=function(_0x5ba3d8,_0x179adc){return db[_0x026a('0x2c')]['describe']()[_0x026a('0x25')](respondWithResult(_0x179adc,null))['catch'](handleError(_0x179adc,null));};exports[_0x026a('0x4d')]=function(_0x1e0b91,_0xd69b52,_0x183e5d){return db[_0x026a('0x4e')][_0x026a('0x44')]({'where':{'id':_0x1e0b91['params']['id']}})['then'](handleEntityNotFound(_0xd69b52,null))['then'](function(_0x2951bb){if(_0x2951bb){return _0x2951bb[_0x026a('0x4d')](_0x1e0b91[_0x026a('0x46')][_0x026a('0x4f')],_[_0x026a('0x50')](_0x1e0b91['body'],[_0x026a('0x4f'),'id'])||{});}})[_0x026a('0x25')](respondWithResult(_0xd69b52,null))['catch'](handleError(_0xd69b52,null));};exports[_0x026a('0x51')]=function(_0x457ffa,_0x4c9db1,_0x1bf439){var _0x5d4eda={};var _0x333d00={};var _0x3955ee;var _0x1150c4;return db[_0x026a('0x2c')][_0x026a('0x52')]({'where':{'id':_0x457ffa['params']['id']}})[_0x026a('0x25')](handleEntityNotFound(_0x4c9db1,null))['then'](function(_0x40bc2c){if(_0x40bc2c){_0x3955ee=_0x40bc2c;_0x333d00[_0x026a('0x2d')]=_[_0x026a('0x41')](db['CmContact'][_0x026a('0x42')]);_0x333d00[_0x026a('0x2e')]=_['keys'](_0x457ffa['query']);_0x333d00[_0x026a('0x2f')]=_[_0x026a('0x30')](_0x333d00['model'],_0x333d00[_0x026a('0x2e')]);_0x5d4eda[_0x026a('0x32')]=_['intersection'](_0x333d00['model'],qs[_0x026a('0x31')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x31')]));_0x5d4eda[_0x026a('0x32')]=_0x5d4eda[_0x026a('0x32')][_0x026a('0x33')]?_0x5d4eda[_0x026a('0x32')]:_0x333d00[_0x026a('0x2d')];_0x5d4eda['order']=qs[_0x026a('0x36')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x36')]);_0x5d4eda['where']=qs[_0x026a('0x2f')](_[_0x026a('0x53')](_0x457ffa[_0x026a('0x2e')],_0x333d00[_0x026a('0x2f')]));if(_0x457ffa[_0x026a('0x2e')][_0x026a('0x38')]){_0x5d4eda[_0x026a('0x37')]=_['merge'](_0x5d4eda['where'],{'$or':_[_0x026a('0x3a')](_0x5d4eda['attributes'],function(_0x138589){var _0x2fb5ea={};_0x2fb5ea[_0x138589]={'$like':'%'+_0x457ffa[_0x026a('0x2e')][_0x026a('0x38')]+'%'};return _0x2fb5ea;})});}_0x5d4eda=_[_0x026a('0x39')]({},_0x5d4eda,_0x457ffa[_0x026a('0x3b')]);return _0x3955ee[_0x026a('0x51')](_0x5d4eda);}})['then'](function(_0xfa49b4){if(_0xfa49b4){_0x1150c4=_0xfa49b4[_0x026a('0x33')];if(!_0x457ffa[_0x026a('0x2e')][_0x026a('0x34')]('nolimit')){_0x5d4eda[_0x026a('0x19')]=qs[_0x026a('0x19')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x19')]);_0x5d4eda[_0x026a('0x1a')]=qs[_0x026a('0x1a')](_0x457ffa[_0x026a('0x2e')][_0x026a('0x1a')]);}return _0x3955ee[_0x026a('0x51')](_0x5d4eda);}})[_0x026a('0x25')](function(_0x4d2704){if(_0x4d2704){return _0x4d2704?{'count':_0x1150c4,'rows':_0x4d2704}:null;}})[_0x026a('0x25')](respondWithResult(_0x4c9db1,null))[_0x026a('0x3e')](handleError(_0x4c9db1,null));};
\ No newline at end of file
+var _0xb0a5=['path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','save','then','destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','order','sort','where','merge','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','omit','getContacts','pick','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x29c08e,_0x36cac6){var _0x24ee90=function(_0x5c966e){while(--_0x5c966e){_0x29c08e['push'](_0x29c08e['shift']());}};_0x24ee90(++_0x36cac6);}(_0xb0a5,0x13c));var _0x5b0a=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0xb0a5[_0x1e6db3];return _0x1de886;};'use strict';var emlformat=require(_0x5b0a('0x0'));var rimraf=require(_0x5b0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5b0a('0x2'));var rp=require(_0x5b0a('0x3'));var moment=require(_0x5b0a('0x4'));var BPromise=require(_0x5b0a('0x5'));var Mustache=require(_0x5b0a('0x6'));var util=require(_0x5b0a('0x7'));var path=require(_0x5b0a('0x8'));var sox=require('sox');var csv=require(_0x5b0a('0x9'));var ejs=require(_0x5b0a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b0a('0xb'));var crypto=require(_0x5b0a('0xc'));var jsforce=require(_0x5b0a('0xd'));var deskjs=require(_0x5b0a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5b0a('0xf'));var Papa=require(_0x5b0a('0x10'));var Redis=require('ioredis');var authService=require(_0x5b0a('0x11'));var qs=require(_0x5b0a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b0a('0x13'));var logger=require(_0x5b0a('0x14'))(_0x5b0a('0x15'));var utils=require('../../config/utils');var config=require(_0x5b0a('0x16'));var licenseUtil=require(_0x5b0a('0x17'));var db=require(_0x5b0a('0x18'))['db'];function respondWithStatusCode(_0x882c5,_0x2dc12c){_0x2dc12c=_0x2dc12c||0xcc;return function(_0x5c98dd){if(_0x5c98dd){return _0x882c5['sendStatus'](_0x2dc12c);}return _0x882c5[_0x5b0a('0x19')](_0x2dc12c)[_0x5b0a('0x1a')]();};}function respondWithResult(_0x46f2eb,_0x45a076){_0x45a076=_0x45a076||0xc8;return function(_0x32117c){if(_0x32117c){return _0x46f2eb[_0x5b0a('0x19')](_0x45a076)[_0x5b0a('0x1b')](_0x32117c);}};}function respondWithFilteredResult(_0x248143,_0x3e9ac1){return function(_0x2fda60){if(_0x2fda60){var _0x1daead=typeof _0x3e9ac1['offset']===_0x5b0a('0x1c')&&typeof _0x3e9ac1[_0x5b0a('0x1d')]===_0x5b0a('0x1c');var _0x29a8ef=_0x2fda60[_0x5b0a('0x1e')];var _0x3b95c3=_0x1daead?0x0:_0x3e9ac1[_0x5b0a('0x1f')];var _0x48654b=_0x1daead?_0x2fda60[_0x5b0a('0x1e')]:_0x3e9ac1[_0x5b0a('0x1f')]+_0x3e9ac1[_0x5b0a('0x1d')];var _0x47b153;if(_0x48654b>=_0x29a8ef){_0x48654b=_0x29a8ef;_0x47b153=0xc8;}else{_0x47b153=0xce;}_0x248143['status'](_0x47b153);return _0x248143['set']('Content-Range',_0x3b95c3+'-'+_0x48654b+'/'+_0x29a8ef)[_0x5b0a('0x1b')](_0x2fda60);}return null;};}function patchUpdates(_0x497c4b){return function(_0x3ab22e){try{jsonpatch[_0x5b0a('0x20')](_0x3ab22e,_0x497c4b,!![]);}catch(_0x499576){return BPromise['reject'](_0x499576);}return _0x3ab22e[_0x5b0a('0x21')]();};}function saveUpdates(_0x8386c4,_0x2b9b6a){return function(_0x3a93f7){if(_0x3a93f7){return _0x3a93f7['update'](_0x8386c4)[_0x5b0a('0x22')](function(_0x2863e7){return _0x2863e7;});}return null;};}function removeEntity(_0x16c564,_0xf5efa3){return function(_0x380b3f){if(_0x380b3f){return _0x380b3f[_0x5b0a('0x23')]()[_0x5b0a('0x22')](function(){var _0x53a196=_0x380b3f[_0x5b0a('0x24')]({'plain':!![]});var _0x385355=_0x5b0a('0x25');return db[_0x5b0a('0x26')][_0x5b0a('0x23')]({'where':{'type':_0x385355,'resourceId':_0x53a196['id']}})[_0x5b0a('0x22')](function(){return _0x380b3f;});})[_0x5b0a('0x22')](function(){_0x16c564[_0x5b0a('0x19')](0xcc)[_0x5b0a('0x1a')]();});}};}function handleEntityNotFound(_0x161316,_0x295c0d){return function(_0x26eb0e){if(!_0x26eb0e){_0x161316['sendStatus'](0x194);}return _0x26eb0e;};}function handleError(_0x2da3de,_0x212436){_0x212436=_0x212436||0x1f4;return function(_0x1aa9d4){logger[_0x5b0a('0x27')](_0x1aa9d4[_0x5b0a('0x28')]);if(_0x1aa9d4[_0x5b0a('0x29')]){delete _0x1aa9d4[_0x5b0a('0x29')];}_0x2da3de[_0x5b0a('0x19')](_0x212436)['send'](_0x1aa9d4);};}exports[_0x5b0a('0x2a')]=function(_0x123f11,_0x35a999){var _0x3caa32={},_0x2a8545={},_0x12c17={'count':0x0,'rows':[]};return db[_0x5b0a('0x2b')][_0x5b0a('0x2c')]()[_0x5b0a('0x22')](function(_0x26cf75){_0x2a8545['model']=_[_0x5b0a('0x2d')](_0x26cf75);_0x2a8545[_0x5b0a('0x2e')]=_['keys'](_0x123f11[_0x5b0a('0x2e')]);_0x2a8545[_0x5b0a('0x2f')]=_[_0x5b0a('0x30')](_0x2a8545[_0x5b0a('0x31')],_0x2a8545['query']);_0x3caa32['attributes']=_[_0x5b0a('0x30')](_0x2a8545['model'],qs[_0x5b0a('0x32')](_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x32')]));_0x3caa32[_0x5b0a('0x33')]=_0x3caa32[_0x5b0a('0x33')]['length']?_0x3caa32[_0x5b0a('0x33')]:_0x2a8545['model'];if(!_0x123f11['query']['hasOwnProperty']('nolimit')){_0x3caa32['limit']=qs[_0x5b0a('0x1d')](_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x1d')]);_0x3caa32[_0x5b0a('0x1f')]=qs['offset'](_0x123f11[_0x5b0a('0x2e')]['offset']);}_0x3caa32[_0x5b0a('0x34')]=qs[_0x5b0a('0x35')](_0x123f11['query'][_0x5b0a('0x35')]);_0x3caa32[_0x5b0a('0x36')]=qs[_0x5b0a('0x2f')](_['pick'](_0x123f11[_0x5b0a('0x2e')],_0x2a8545[_0x5b0a('0x2f')]),_0x26cf75);if(_0x123f11[_0x5b0a('0x2e')]['filter']){_0x3caa32[_0x5b0a('0x36')]=_[_0x5b0a('0x37')](_0x3caa32[_0x5b0a('0x36')],{'$or':_[_0x5b0a('0x38')](_0x3caa32[_0x5b0a('0x33')],function(_0x15783f){var _0x499689={};_0x499689[_0x15783f]={'$like':'%'+_0x123f11['query'][_0x5b0a('0x39')]+'%'};return _0x499689;})});}_0x3caa32=_[_0x5b0a('0x37')]({},_0x3caa32,_0x123f11['options']);var _0x6b08aa={'where':_0x3caa32['where']};return db['CmCompany'][_0x5b0a('0x1e')](_0x6b08aa)[_0x5b0a('0x22')](function(_0x5de7c5){_0x12c17[_0x5b0a('0x1e')]=_0x5de7c5;if(_0x123f11[_0x5b0a('0x2e')][_0x5b0a('0x3a')]){_0x3caa32[_0x5b0a('0x3b')]=[{'all':!![]}];}return db[_0x5b0a('0x2b')][_0x5b0a('0x3c')](_0x3caa32);})[_0x5b0a('0x22')](function(_0x264893){_0x12c17[_0x5b0a('0x3d')]=_0x264893;return _0x12c17;})[_0x5b0a('0x22')](respondWithFilteredResult(_0x35a999,_0x3caa32))[_0x5b0a('0x3e')](handleError(_0x35a999,null));})[_0x5b0a('0x3e')](handleError(_0x35a999,null));};exports[_0x5b0a('0x3f')]=function(_0x3caf9a,_0x3669af){var _0xfa809e={'raw':![],'where':{'id':_0x3caf9a[_0x5b0a('0x40')]['id']}},_0x2c5991={};_0x2c5991['model']=_[_0x5b0a('0x2d')](db['CmCompany'][_0x5b0a('0x41')]);_0x2c5991[_0x5b0a('0x2e')]=_[_0x5b0a('0x2d')](_0x3caf9a[_0x5b0a('0x2e')]);_0x2c5991[_0x5b0a('0x2f')]=_[_0x5b0a('0x30')](_0x2c5991[_0x5b0a('0x31')],_0x2c5991[_0x5b0a('0x2e')]);_0xfa809e[_0x5b0a('0x33')]=_[_0x5b0a('0x30')](_0x2c5991['model'],qs[_0x5b0a('0x32')](_0x3caf9a[_0x5b0a('0x2e')]['fields']));_0xfa809e[_0x5b0a('0x33')]=_0xfa809e[_0x5b0a('0x33')][_0x5b0a('0x42')]?_0xfa809e['attributes']:_0x2c5991[_0x5b0a('0x31')];if(_0x3caf9a[_0x5b0a('0x2e')][_0x5b0a('0x3a')]){_0xfa809e[_0x5b0a('0x3b')]=[{'all':!![]}];}_0xfa809e=_['merge']({},_0xfa809e,_0x3caf9a[_0x5b0a('0x43')]);return db[_0x5b0a('0x2b')]['find'](_0xfa809e)[_0x5b0a('0x22')](handleEntityNotFound(_0x3669af,null))[_0x5b0a('0x22')](respondWithResult(_0x3669af,null))[_0x5b0a('0x3e')](handleError(_0x3669af,null));};exports['create']=function(_0x58d027,_0x3d7bbc){return db[_0x5b0a('0x2b')][_0x5b0a('0x44')](_0x58d027[_0x5b0a('0x45')],{})[_0x5b0a('0x22')](function(_0x1aec14){var _0x2f5095=_0x58d027[_0x5b0a('0x46')][_0x5b0a('0x24')]({'plain':!![]});if(!_0x2f5095)throw new Error(_0x5b0a('0x47'));if(_0x2f5095['role']==='user'){var _0x430ecb=_0x1aec14[_0x5b0a('0x24')]({'plain':!![]});var _0x35bf50=_0x5b0a('0x25');return db['UserProfileSection'][_0x5b0a('0x48')]({'where':{'name':_0x35bf50,'userProfileId':_0x2f5095[_0x5b0a('0x49')]},'raw':!![]})[_0x5b0a('0x22')](function(_0x4d7beb){if(_0x4d7beb&&_0x4d7beb['autoAssociation']===0x0){return db[_0x5b0a('0x26')][_0x5b0a('0x44')]({'name':_0x430ecb[_0x5b0a('0x29')],'resourceId':_0x430ecb['id'],'type':_0x4d7beb['name'],'sectionId':_0x4d7beb['id']},{})[_0x5b0a('0x22')](function(){return _0x1aec14;});}else{return _0x1aec14;}})[_0x5b0a('0x3e')](function(_0x4d4b3f){logger['error'](_0x5b0a('0x4a'),_0x4d4b3f);throw _0x4d4b3f;});}return _0x1aec14;})['then'](respondWithResult(_0x3d7bbc,0xc9))[_0x5b0a('0x3e')](handleError(_0x3d7bbc,null));};exports[_0x5b0a('0x4b')]=function(_0x17b864,_0x36ebf4){if(_0x17b864[_0x5b0a('0x45')]['id']){delete _0x17b864[_0x5b0a('0x45')]['id'];}return db[_0x5b0a('0x2b')][_0x5b0a('0x48')]({'where':{'id':_0x17b864[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x36ebf4,null))[_0x5b0a('0x22')](saveUpdates(_0x17b864[_0x5b0a('0x45')],null))[_0x5b0a('0x22')](respondWithResult(_0x36ebf4,null))[_0x5b0a('0x3e')](handleError(_0x36ebf4,null));};exports[_0x5b0a('0x23')]=function(_0x6c6bc7,_0x387efe){return db['CmCompany'][_0x5b0a('0x48')]({'where':{'id':_0x6c6bc7['params']['id']}})['then'](handleEntityNotFound(_0x387efe,null))[_0x5b0a('0x22')](removeEntity(_0x387efe,null))[_0x5b0a('0x3e')](handleError(_0x387efe,null));};exports[_0x5b0a('0x2c')]=function(_0x2db606,_0xdb3d1e){return db[_0x5b0a('0x2b')]['describe']()['then'](respondWithResult(_0xdb3d1e,null))[_0x5b0a('0x3e')](handleError(_0xdb3d1e,null));};exports['addContacts']=function(_0x151d58,_0x3f3592,_0x22cd35){return db[_0x5b0a('0x4c')][_0x5b0a('0x48')]({'where':{'id':_0x151d58[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x3f3592,null))['then'](function(_0x540fe5){if(_0x540fe5){return _0x540fe5[_0x5b0a('0x4d')](_0x151d58[_0x5b0a('0x45')]['ids'],_[_0x5b0a('0x4e')](_0x151d58[_0x5b0a('0x45')],['ids','id'])||{});}})[_0x5b0a('0x22')](respondWithResult(_0x3f3592,null))[_0x5b0a('0x3e')](handleError(_0x3f3592,null));};exports[_0x5b0a('0x4f')]=function(_0xa71a88,_0x23edaa,_0x110ee0){var _0x5dbb90={};var _0x4c41d5={};var _0xe72d0;var _0x5918fb;return db['CmCompany']['findOne']({'where':{'id':_0xa71a88[_0x5b0a('0x40')]['id']}})[_0x5b0a('0x22')](handleEntityNotFound(_0x23edaa,null))[_0x5b0a('0x22')](function(_0xc0b9b1){if(_0xc0b9b1){_0xe72d0=_0xc0b9b1;_0x4c41d5[_0x5b0a('0x31')]=_[_0x5b0a('0x2d')](db[_0x5b0a('0x4c')][_0x5b0a('0x41')]);_0x4c41d5[_0x5b0a('0x2e')]=_['keys'](_0xa71a88['query']);_0x4c41d5['filters']=_['intersection'](_0x4c41d5[_0x5b0a('0x31')],_0x4c41d5[_0x5b0a('0x2e')]);_0x5dbb90[_0x5b0a('0x33')]=_[_0x5b0a('0x30')](_0x4c41d5['model'],qs['fields'](_0xa71a88[_0x5b0a('0x2e')][_0x5b0a('0x32')]));_0x5dbb90['attributes']=_0x5dbb90['attributes'][_0x5b0a('0x42')]?_0x5dbb90[_0x5b0a('0x33')]:_0x4c41d5[_0x5b0a('0x31')];_0x5dbb90['order']=qs[_0x5b0a('0x35')](_0xa71a88['query'][_0x5b0a('0x35')]);_0x5dbb90[_0x5b0a('0x36')]=qs[_0x5b0a('0x2f')](_[_0x5b0a('0x50')](_0xa71a88[_0x5b0a('0x2e')],_0x4c41d5[_0x5b0a('0x2f')]));if(_0xa71a88[_0x5b0a('0x2e')][_0x5b0a('0x39')]){_0x5dbb90[_0x5b0a('0x36')]=_['merge'](_0x5dbb90['where'],{'$or':_[_0x5b0a('0x38')](_0x5dbb90[_0x5b0a('0x33')],function(_0x29d1e3){var _0x70dd9b={};_0x70dd9b[_0x29d1e3]={'$like':'%'+_0xa71a88['query'][_0x5b0a('0x39')]+'%'};return _0x70dd9b;})});}_0x5dbb90=_[_0x5b0a('0x37')]({},_0x5dbb90,_0xa71a88['options']);return _0xe72d0[_0x5b0a('0x4f')](_0x5dbb90);}})[_0x5b0a('0x22')](function(_0x341ca8){if(_0x341ca8){_0x5918fb=_0x341ca8[_0x5b0a('0x42')];if(!_0xa71a88[_0x5b0a('0x2e')]['hasOwnProperty']('nolimit')){_0x5dbb90['limit']=qs['limit'](_0xa71a88[_0x5b0a('0x2e')]['limit']);_0x5dbb90[_0x5b0a('0x1f')]=qs['offset'](_0xa71a88['query'][_0x5b0a('0x1f')]);}return _0xe72d0[_0x5b0a('0x4f')](_0x5dbb90);}})[_0x5b0a('0x22')](function(_0x1133b0){if(_0x1133b0){return _0x1133b0?{'count':_0x5918fb,'rows':_0x1133b0}:null;}})['then'](respondWithResult(_0x23edaa,null))[_0x5b0a('0x3e')](handleError(_0x23edaa,null));};
\ No newline at end of file
index a82e72a..ede9555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x496f=['request-promise','path','rimraf','./cmCompany.attributes','exports','cm_companies','lodash','util','moment','bluebird'];(function(_0x41a234,_0x572403){var _0x1219db=function(_0x30facf){while(--_0x30facf){_0x41a234['push'](_0x41a234['shift']());}};_0x1219db(++_0x572403);}(_0x496f,0x1c8));var _0xf496=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x496f[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xf496('0x0'));var util=require(_0xf496('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf496('0x2'));var BPromise=require(_0xf496('0x3'));var rp=require(_0xf496('0x4'));var fs=require('fs');var path=require(_0xf496('0x5'));var rimraf=require(_0xf496('0x6'));var config=require('../../config/environment');var attributes=require(_0xf496('0x7'));module[_0xf496('0x8')]=function(_0x4503d3,_0x3f98b5){return _0x4503d3['define']('CmCompany',attributes,{'tableName':_0xf496('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b6a=['cm_companies','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany'];(function(_0x3e4a76,_0x27f26d){var _0x3ccebe=function(_0x435044){while(--_0x435044){_0x3e4a76['push'](_0x3e4a76['shift']());}};_0x3ccebe(++_0x27f26d);}(_0x7b6a,0x14b));var _0xa7b6=function(_0xe2c51a,_0x292d36){_0xe2c51a=_0xe2c51a-0x0;var _0x101e57=_0x7b6a[_0xe2c51a];return _0x101e57;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa7b6('0x0'))(_0xa7b6('0x1'));var moment=require('moment');var BPromise=require(_0xa7b6('0x2'));var rp=require(_0xa7b6('0x3'));var fs=require('fs');var path=require(_0xa7b6('0x4'));var rimraf=require(_0xa7b6('0x5'));var config=require(_0xa7b6('0x6'));var attributes=require(_0xa7b6('0x7'));module[_0xa7b6('0x8')]=function(_0xd659b0,_0x2d668e){return _0xd659b0['define'](_0xa7b6('0x9'),attributes,{'tableName':_0xa7b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfa85d3..1242317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x568b=['then','info','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x33d144,_0x4fc483){var _0x4ff4aa=function(_0x404bc9){while(--_0x404bc9){_0x33d144['push'](_0x33d144['shift']());}};_0x4ff4aa(++_0x4fc483);}(_0x568b,0x112));var _0xb568=function(_0x5107fc,_0x9c107d){_0x5107fc=_0x5107fc-0x0;var _0x4e6464=_0x568b[_0x5107fc];return _0x4e6464;};'use strict';var _=require(_0xb568('0x0'));var util=require(_0xb568('0x1'));var moment=require(_0xb568('0x2'));var BPromise=require(_0xb568('0x3'));var rs=require(_0xb568('0x4'));var fs=require('fs');var Redis=require(_0xb568('0x5'));var db=require(_0xb568('0x6'))['db'];var utils=require(_0xb568('0x7'));var logger=require(_0xb568('0x8'))('rpc');var config=require(_0xb568('0x9'));var jayson=require(_0xb568('0xa'));var client=jayson[_0xb568('0xb')][_0xb568('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x420913,_0x3a6da4,_0x51cd39){return new BPromise(function(_0x1f8227,_0x4c72ea){return client[_0xb568('0xd')](_0x420913,_0x51cd39)[_0xb568('0xe')](function(_0x3041c6){logger[_0xb568('0xf')](_0xb568('0x10'),_0x3a6da4,_0xb568('0x11'));logger['debug'](_0xb568('0x12'),_0x3a6da4,'request\x20sent',JSON[_0xb568('0x13')](_0x3041c6));if(_0x3041c6[_0xb568('0x14')]){if(_0x3041c6[_0xb568('0x14')]['code']===0x1f4){logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x3041c6[_0xb568('0x14')]['message']);return _0x4c72ea(_0x3041c6[_0xb568('0x14')][_0xb568('0x15')]);}logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x3041c6[_0xb568('0x14')]['message']);return _0x1f8227(_0x3041c6[_0xb568('0x14')]['message']);}else{logger[_0xb568('0xf')](_0xb568('0x10'),_0x3a6da4,'request\x20sent');_0x1f8227(_0x3041c6[_0xb568('0x16')][_0xb568('0x15')]);}})[_0xb568('0x17')](function(_0x1805ba){logger[_0xb568('0x14')](_0xb568('0x10'),_0x3a6da4,_0x1805ba);_0x4c72ea(_0x1805ba);});});}
\ No newline at end of file
+var _0xb0fa=['message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x103f46,_0x1cbbbb){var _0x58d92e=function(_0x3e2d14){while(--_0x3e2d14){_0x103f46['push'](_0x103f46['shift']());}};_0x58d92e(++_0x1cbbbb);}(_0xb0fa,0x14e));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab0f('0x0'));var util=require(_0xab0f('0x1'));var moment=require('moment');var BPromise=require(_0xab0f('0x2'));var rs=require(_0xab0f('0x3'));var fs=require('fs');var Redis=require(_0xab0f('0x4'));var db=require(_0xab0f('0x5'))['db'];var utils=require(_0xab0f('0x6'));var logger=require(_0xab0f('0x7'))(_0xab0f('0x8'));var config=require(_0xab0f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab0f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bf769,_0x367849,_0x41cd9e){return new BPromise(function(_0x3a45bf,_0x1f95ed){return client[_0xab0f('0xb')](_0x5bf769,_0x41cd9e)['then'](function(_0x2f36df){logger[_0xab0f('0xc')]('CmCompany,\x20%s,\x20%s',_0x367849,_0xab0f('0xd'));logger[_0xab0f('0xe')](_0xab0f('0xf'),_0x367849,_0xab0f('0xd'),JSON[_0xab0f('0x10')](_0x2f36df));if(_0x2f36df[_0xab0f('0x11')]){if(_0x2f36df['error']['code']===0x1f4){logger[_0xab0f('0x11')]('CmCompany,\x20%s,\x20%s',_0x367849,_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);return _0x1f95ed(_0x2f36df['error'][_0xab0f('0x12')]);}logger['error'](_0xab0f('0x13'),_0x367849,_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);return _0x3a45bf(_0x2f36df[_0xab0f('0x11')][_0xab0f('0x12')]);}else{logger[_0xab0f('0xc')](_0xab0f('0x13'),_0x367849,_0xab0f('0xd'));_0x3a45bf(_0x2f36df[_0xab0f('0x14')][_0xab0f('0x12')]);}})[_0xab0f('0x15')](function(_0x276587){logger['error']('CmCompany,\x20%s,\x20%s',_0x367849,_0x276587);_0x1f95ed(_0x276587);});});}
\ No newline at end of file
index 1af79d0..ef0c370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab50=['update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/contacts','getContacts','post','create','/:id'];(function(_0x1ed482,_0x308d08){var _0x488557=function(_0x4a5dc2){while(--_0x4a5dc2){_0x1ed482['push'](_0x1ed482['shift']());}};_0x488557(++_0x308d08);}(_0xab50,0x1e3));var _0x0ab5=function(_0x701bd8,_0x1a792f){_0x701bd8=_0x701bd8-0x0;var _0x2aa48b=_0xab50[_0x701bd8];return _0x2aa48b;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require('path');var timeout=require(_0x0ab5('0x2'));var express=require('express');var router=express[_0x0ab5('0x3')]();var fs_extra=require(_0x0ab5('0x4'));var auth=require(_0x0ab5('0x5'));var interaction=require(_0x0ab5('0x6'));var config=require(_0x0ab5('0x7'));var controller=require('./cmCompany.controller');router[_0x0ab5('0x8')]('/',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xa')]);router[_0x0ab5('0x8')]('/describe',auth[_0x0ab5('0x9')](),controller['describe']);router[_0x0ab5('0x8')]('/:id',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xb')]);router[_0x0ab5('0x8')](_0x0ab5('0xc'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xd')]);router[_0x0ab5('0xe')]('/',auth['isAuthenticated'](),controller[_0x0ab5('0xf')]);router[_0x0ab5('0xe')](_0x0ab5('0xc'),auth[_0x0ab5('0x9')](),controller['addContacts']);router['put'](_0x0ab5('0x10'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0x11')]);router[_0x0ab5('0x12')](_0x0ab5('0x10'),auth[_0x0ab5('0x9')](),controller['destroy']);module[_0x0ab5('0x13')]=router;
\ No newline at end of file
+var _0x914a=['post','addContacts','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x914a,0x6b));var _0xa914=function(_0x5ecb26,_0xdd72bd){_0x5ecb26=_0x5ecb26-0x0;var _0x5c374a=_0x914a[_0x5ecb26];return _0x5c374a;};'use strict';var multer=require(_0xa914('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa914('0x1'));var express=require(_0xa914('0x2'));var router=express[_0xa914('0x3')]();var fs_extra=require(_0xa914('0x4'));var auth=require(_0xa914('0x5'));var interaction=require(_0xa914('0x6'));var config=require(_0xa914('0x7'));var controller=require(_0xa914('0x8'));router[_0xa914('0x9')]('/',auth[_0xa914('0xa')](),controller['index']);router[_0xa914('0x9')](_0xa914('0xb'),auth[_0xa914('0xa')](),controller[_0xa914('0xc')]);router[_0xa914('0x9')](_0xa914('0xd'),auth[_0xa914('0xa')](),controller[_0xa914('0xe')]);router[_0xa914('0x9')](_0xa914('0xf'),auth[_0xa914('0xa')](),controller[_0xa914('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa914('0x11')]);router[_0xa914('0x12')](_0xa914('0xf'),auth[_0xa914('0xa')](),controller[_0xa914('0x13')]);router[_0xa914('0x14')](_0xa914('0xd'),auth[_0xa914('0xa')](),controller[_0xa914('0x15')]);router[_0xa914('0x16')]('/:id',auth[_0xa914('0xa')](),controller[_0xa914('0x17')]);module[_0xa914('0x18')]=router;
\ No newline at end of file
index 306e761..b501987 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc66=['UNSIGNED','NOW','sequelize','STRING','TEXT','INTEGER'];(function(_0x5316d4,_0x3e273a){var _0x590f57=function(_0x37718c){while(--_0x37718c){_0x5316d4['push'](_0x5316d4['shift']());}};_0x590f57(++_0x3e273a);}(_0xdc66,0x1e2));var _0x6dc6=function(_0x48845d,_0x4338c2){_0x48845d=_0x48845d-0x0;var _0x5bad7d=_0xdc66[_0x48845d];return _0x5bad7d;};'use strict';var _=require('lodash');var Sequelize=require(_0x6dc6('0x0'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6dc6('0x1')]},'postalCode':{'type':Sequelize[_0x6dc6('0x1')]},'city':{'type':Sequelize[_0x6dc6('0x1')]},'country':{'type':Sequelize[_0x6dc6('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6dc6('0x2')]},'phone':{'type':Sequelize[_0x6dc6('0x1')]},'mobile':{'type':Sequelize[_0x6dc6('0x1')]},'fax':{'type':Sequelize[_0x6dc6('0x1')]},'email':{'type':Sequelize[_0x6dc6('0x1')]},'url':{'type':Sequelize[_0x6dc6('0x1')]},'facebook':{'type':Sequelize[_0x6dc6('0x1')]},'fb_data':{'type':Sequelize[_0x6dc6('0x1')]},'twitter':{'type':Sequelize[_0x6dc6('0x1')]},'skype':{'type':Sequelize[_0x6dc6('0x1')]},'teams':{'type':Sequelize[_0x6dc6('0x1')]},'viber':{'type':Sequelize[_0x6dc6('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x6dc6('0x1')]},'telegram':{'type':Sequelize[_0x6dc6('0x1')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x6dc6('0x1')]},'priority':{'type':Sequelize[_0x6dc6('0x3')](0x2)[_0x6dc6('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x6dc6('0x5')]},'dialTimezone':{'type':Sequelize[_0x6dc6('0x1')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x2c2b=['lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5539ea,_0x4f0539){var _0x21fc7c=function(_0xcebc50){while(--_0xcebc50){_0x5539ea['push'](_0x5539ea['shift']());}};_0x21fc7c(++_0x4f0539);}(_0x2c2b,0x68));var _0xb2c2=function(_0x399fb4,_0x3b9673){_0x399fb4=_0x399fb4-0x0;var _0x599673=_0x2c2b[_0x399fb4];return _0x599673;};'use strict';var _=require(_0xb2c2('0x0'));var Sequelize=require(_0xb2c2('0x1'));module[_0xb2c2('0x2')]={'firstName':{'type':Sequelize[_0xb2c2('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xb2c2('0x3')]},'street':{'type':Sequelize[_0xb2c2('0x3')]},'postalCode':{'type':Sequelize[_0xb2c2('0x3')]},'city':{'type':Sequelize[_0xb2c2('0x3')]},'country':{'type':Sequelize[_0xb2c2('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb2c2('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb2c2('0x3')]},'fax':{'type':Sequelize[_0xb2c2('0x3')]},'email':{'type':Sequelize[_0xb2c2('0x3')]},'url':{'type':Sequelize[_0xb2c2('0x3')]},'facebook':{'type':Sequelize[_0xb2c2('0x3')]},'fb_data':{'type':Sequelize[_0xb2c2('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xb2c2('0x3')]},'line':{'type':Sequelize[_0xb2c2('0x3')]},'wechat':{'type':Sequelize[_0xb2c2('0x3')]},'telegram':{'type':Sequelize[_0xb2c2('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xb2c2('0x3')]},'priority':{'type':Sequelize[_0xb2c2('0x5')](0x2)[_0xb2c2('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xb2c2('0x7')]},'dialTimezone':{'type':Sequelize[_0xb2c2('0x3')]},'utcOffset':{'type':Sequelize[_0xb2c2('0x5')]}};
\ No newline at end of file
index f973b63..5f32afe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6<Object[_0x0a9e('0x25')](_0x140511)['length'];_0x11c3b6++){var _0x3652a7=Object[_0x0a9e('0x25')](_0x140511)[_0x11c3b6];if(!_[_0x0a9e('0x26')](_0x3652a7,_0x0a9e('0x27'))){_0x140511[_0x3652a7]['columnName']=_0x3652a7;_0x140511[_0x3652a7][_0x0a9e('0x28')]=_0x3652a7;}}return _0x140511;})[_0x0a9e('0x15')](function(_0x1843b2){var _0x824a4f={'where':Boolean(_0x5bfb33[_0x0a9e('0x1e')][_0x0a9e('0x29')])===!![]?undefined:{'$or':[{'ListId':_0x5bfb33[_0x0a9e('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x824a4f)['then'](function(_0x426950){for(var _0x5d1e0e=0x0;_0x5d1e0e<_0x426950[_0x0a9e('0x2b')];_0x5d1e0e++){var _0x3ae878=_0x0a9e('0x27')+_0x426950[_0x5d1e0e]['id'];_0x1843b2[_0x3ae878][_0x0a9e('0x2c')]=_0x3ae878;_0x1843b2[_0x3ae878][_0x0a9e('0x28')]=_0x426950[_0x5d1e0e]['alias'];_0x1843b2[_0x3ae878][_0x0a9e('0x2d')]={'type':_0x426950[_0x5d1e0e][_0x0a9e('0x2e')],'values':_0x426950[_0x5d1e0e][_0x0a9e('0x2f')]};}Object[_0x0a9e('0x25')](_0x1843b2)[_0x0a9e('0x30')](function(_0x409319){if(!_0x1843b2[_0x409319][_0x0a9e('0x31')](_0x0a9e('0x2c'))){delete _0x1843b2[_0x409319];}});return _0x1843b2;});})['then'](respondWithResult(_0x1dc186,null))[_0x0a9e('0x20')](handleError(_0x1dc186,null));};exports['merge']=function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f;var _0x3f3d41;var _0x567193;if(_0x2cc7a0[_0x0a9e('0x32')]['id']){delete _0x2cc7a0[_0x0a9e('0x32')]['id'];}return db[_0x0a9e('0x21')][_0x0a9e('0x1d')]({'where':{'id':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}})['then'](function(_0x24936a){if(_0x24936a){if(_0x24936a[_0x0a9e('0x2b')]!==0x2){return null;}_0x24936a[0x0]=_0x24936a[0x0][_0x0a9e('0x34')]({'plain':!![]});_0x24936a[0x1]=_0x24936a[0x1][_0x0a9e('0x34')]({'plain':!![]});delete _0x24936a[0x0]['id'];delete _0x24936a[0x1]['id'];return _['mergeWith'](_0x24936a[0x0],_0x24936a[0x1],function(_0x31916f,_0x3bfce8){if(Array[_0x0a9e('0x35')](_0x3bfce8)&&!_0x3bfce8['length']){return _0x31916f;}else if(!_0x3bfce8){return _0x31916f;}});}})[_0x0a9e('0x15')](handleEntityNotFound(_0x14b13f,null))[_0x0a9e('0x15')](function(_0x289467){if(_0x289467){if(_0x289467['tags']&&_['isArray'](_0x289467[_0x0a9e('0x24')])){_0x289467[_0x0a9e('0x24')]=_0x289467['tags'][_0x0a9e('0x36')]();}logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body']['from']);return db[_0x0a9e('0x39')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x5b4f5e){logger[_0x0a9e('0x37')](_0x0a9e('0x3a'),_0x5b4f5e);return db[_0x0a9e('0x3b')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x23b089){logger[_0x0a9e('0x37')](_0x0a9e('0x3c'),_0x23b089);return db[_0x0a9e('0x21')][_0x0a9e('0x3d')](_0x289467);});});}})[_0x0a9e('0x15')](function(_0x37f6cc){if(_0x37f6cc){_0x2b7e7f=_0x37f6cc;_0x3f3d41={'ContactId':_0x2b7e7f['id']};_0x567193={'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}};return db[_0x0a9e('0x3e')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x40')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x41')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x44')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x45')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x46')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x47')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x48')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x49')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4a')][_0x0a9e('0x3f')]({'CmContactId':_0x2b7e7f['id']},{'where':{'CmContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4b')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['CmHopperHistory']['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4c')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4d')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4e')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['FaxQueueReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4f')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x50')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x51')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db['JscriptySessionReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x52')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x53')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x54')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x21')]['destroy']({'where':{'id':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return _0x2b7e7f;}})['then'](respondWithResult(_0x14b13f,null))['catch'](handleError(_0x14b13f,null));};exports[_0x0a9e('0x3d')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x232830){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]&&_[_0x0a9e('0x35')](_0x47de4c['body'][_0x0a9e('0x24')])){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]=_0x47de4c['body'][_0x0a9e('0x24')][_0x0a9e('0x36')](';')+';';}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}if(!_['isNil'](_0x47de4c['body']['dialTimezone'])){var _0x273cb5=_0x47de4c['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x273cb5]))_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x273cb5]['utcOffset'];}return db[_0x0a9e('0x21')]['create'](_0x47de4c[_0x0a9e('0x32')],{'fields':_[_0x0a9e('0x25')](_0x232830),'raw':!![]});})[_0x0a9e('0x15')](function(_0x5adf8f){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]){return insertAdditionalPhones(_0x5adf8f,_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]);}else{return _0x5adf8f;}})['then'](respondWithResult(_0x2f7092,0xc9))[_0x0a9e('0x20')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x5a')]=function(_0x54327c,_0x797b45){var _0x17e88c=0x0;var _0x88dcbf=0x0;var _0x409b29=0x0;var _0x401837=[];return db['CmContact'][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x281c7d){return BPromise['each'](_0x54327c[_0x0a9e('0x32')],function(_0x4f1e60){var _0x5211e3={'where':{'$or':[]},'defaults':_0x4f1e60,'fields':_[_0x0a9e('0x25')](_0x281c7d),'raw':!![]};if(_0x4f1e60[_0x0a9e('0x5b')]){for(var _0x9375fb=0x0;_0x9375fb<_0x4f1e60[_0x0a9e('0x5b')][_0x0a9e('0x2b')];_0x9375fb++){var _0xc8c264={};_0xc8c264[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]]=_0x4f1e60[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]];_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5d')][_0x0a9e('0x5e')](_0xc8c264);}_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5f')]=_0x4f1e60[_0x0a9e('0x5f')];}return db[_0x0a9e('0x21')][_0x0a9e('0x60')](_0x5211e3)[_0x0a9e('0x61')](function(_0x4257c9,_0x5150a4){if(_0x5150a4){if(_0x4f1e60[_0x0a9e('0x31')](_0x0a9e('0x59'))){_0x401837[_0x0a9e('0x5e')]({'contact':_0x4257c9,'additionalPhones':_0x4f1e60['additionalPhones']});}_0x17e88c++;}else{_0x409b29++;}})[_0x0a9e('0x20')](function(){_0x88dcbf++;});});})[_0x0a9e('0x15')](function(_0x4b341d){if(_0x4b341d){if(_0x401837[_0x0a9e('0x2b')]>0x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));};
\ No newline at end of file
+var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6<Object[_0x0a9e('0x25')](_0x140511)['length'];_0x11c3b6++){var _0x3652a7=Object[_0x0a9e('0x25')](_0x140511)[_0x11c3b6];if(!_[_0x0a9e('0x26')](_0x3652a7,_0x0a9e('0x27'))){_0x140511[_0x3652a7]['columnName']=_0x3652a7;_0x140511[_0x3652a7][_0x0a9e('0x28')]=_0x3652a7;}}return _0x140511;})[_0x0a9e('0x15')](function(_0x1843b2){var _0x824a4f={'where':Boolean(_0x5bfb33[_0x0a9e('0x1e')][_0x0a9e('0x29')])===!![]?undefined:{'$or':[{'ListId':_0x5bfb33[_0x0a9e('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x824a4f)['then'](function(_0x426950){for(var _0x5d1e0e=0x0;_0x5d1e0e<_0x426950[_0x0a9e('0x2b')];_0x5d1e0e++){var _0x3ae878=_0x0a9e('0x27')+_0x426950[_0x5d1e0e]['id'];_0x1843b2[_0x3ae878][_0x0a9e('0x2c')]=_0x3ae878;_0x1843b2[_0x3ae878][_0x0a9e('0x28')]=_0x426950[_0x5d1e0e]['alias'];_0x1843b2[_0x3ae878][_0x0a9e('0x2d')]={'type':_0x426950[_0x5d1e0e][_0x0a9e('0x2e')],'values':_0x426950[_0x5d1e0e][_0x0a9e('0x2f')]};}Object[_0x0a9e('0x25')](_0x1843b2)[_0x0a9e('0x30')](function(_0x409319){if(!_0x1843b2[_0x409319][_0x0a9e('0x31')](_0x0a9e('0x2c'))){delete _0x1843b2[_0x409319];}});return _0x1843b2;});})['then'](respondWithResult(_0x1dc186,null))[_0x0a9e('0x20')](handleError(_0x1dc186,null));};exports['merge']=function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f;var _0x3f3d41;var _0x567193;if(_0x2cc7a0[_0x0a9e('0x32')]['id']){delete _0x2cc7a0[_0x0a9e('0x32')]['id'];}return db[_0x0a9e('0x21')][_0x0a9e('0x1d')]({'where':{'id':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}})['then'](function(_0x24936a){if(_0x24936a){if(_0x24936a[_0x0a9e('0x2b')]!==0x2){return null;}_0x24936a[0x0]=_0x24936a[0x0][_0x0a9e('0x34')]({'plain':!![]});_0x24936a[0x1]=_0x24936a[0x1][_0x0a9e('0x34')]({'plain':!![]});delete _0x24936a[0x0]['id'];delete _0x24936a[0x1]['id'];return _['mergeWith'](_0x24936a[0x0],_0x24936a[0x1],function(_0x31916f,_0x3bfce8){if(Array[_0x0a9e('0x35')](_0x3bfce8)&&!_0x3bfce8['length']){return _0x31916f;}else if(!_0x3bfce8){return _0x31916f;}});}})[_0x0a9e('0x15')](handleEntityNotFound(_0x14b13f,null))[_0x0a9e('0x15')](function(_0x289467){if(_0x289467){if(_0x289467['tags']&&_['isArray'](_0x289467[_0x0a9e('0x24')])){_0x289467[_0x0a9e('0x24')]=_0x289467['tags'][_0x0a9e('0x36')]();}logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body']['from']);return db[_0x0a9e('0x39')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x5b4f5e){logger[_0x0a9e('0x37')](_0x0a9e('0x3a'),_0x5b4f5e);return db[_0x0a9e('0x3b')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x23b089){logger[_0x0a9e('0x37')](_0x0a9e('0x3c'),_0x23b089);return db[_0x0a9e('0x21')][_0x0a9e('0x3d')](_0x289467);});});}})[_0x0a9e('0x15')](function(_0x37f6cc){if(_0x37f6cc){_0x2b7e7f=_0x37f6cc;_0x3f3d41={'ContactId':_0x2b7e7f['id']};_0x567193={'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}};return db[_0x0a9e('0x3e')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x40')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x41')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x44')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x45')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x46')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x47')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x48')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x49')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4a')][_0x0a9e('0x3f')]({'CmContactId':_0x2b7e7f['id']},{'where':{'CmContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4b')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['CmHopperHistory']['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4c')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4d')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4e')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['FaxQueueReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4f')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x50')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x51')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db['JscriptySessionReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x52')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x53')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x54')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x21')]['destroy']({'where':{'id':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return _0x2b7e7f;}})['then'](respondWithResult(_0x14b13f,null))['catch'](handleError(_0x14b13f,null));};exports[_0x0a9e('0x3d')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x232830){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]&&_[_0x0a9e('0x35')](_0x47de4c['body'][_0x0a9e('0x24')])){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]=_0x47de4c['body'][_0x0a9e('0x24')][_0x0a9e('0x36')](';')+';';}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}if(!_['isNil'](_0x47de4c['body']['dialTimezone'])){var _0x273cb5=_0x47de4c['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x273cb5]))_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x273cb5]['utcOffset'];}return db[_0x0a9e('0x21')]['create'](_0x47de4c[_0x0a9e('0x32')],{'fields':_[_0x0a9e('0x25')](_0x232830),'raw':!![]});})[_0x0a9e('0x15')](function(_0x5adf8f){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]){return insertAdditionalPhones(_0x5adf8f,_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]);}else{return _0x5adf8f;}})['then'](respondWithResult(_0x2f7092,0xc9))[_0x0a9e('0x20')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x5a')]=function(_0x54327c,_0x797b45){var _0x17e88c=0x0;var _0x88dcbf=0x0;var _0x409b29=0x0;var _0x401837=[];return db['CmContact'][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x281c7d){return BPromise['each'](_0x54327c[_0x0a9e('0x32')],function(_0x4f1e60){var _0x5211e3={'where':{'$or':[]},'defaults':_0x4f1e60,'fields':_[_0x0a9e('0x25')](_0x281c7d),'raw':!![]};if(_0x4f1e60[_0x0a9e('0x5b')]){for(var _0x9375fb=0x0;_0x9375fb<_0x4f1e60[_0x0a9e('0x5b')][_0x0a9e('0x2b')];_0x9375fb++){var _0xc8c264={};_0xc8c264[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]]=_0x4f1e60[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]];_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5d')][_0x0a9e('0x5e')](_0xc8c264);}_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5f')]=_0x4f1e60[_0x0a9e('0x5f')];}return db[_0x0a9e('0x21')][_0x0a9e('0x60')](_0x5211e3)[_0x0a9e('0x61')](function(_0x4257c9,_0x5150a4){if(_0x5150a4){if(_0x4f1e60[_0x0a9e('0x31')](_0x0a9e('0x59'))){_0x401837[_0x0a9e('0x5e')]({'contact':_0x4257c9,'additionalPhones':_0x4f1e60['additionalPhones']});}_0x17e88c++;}else{_0x409b29++;}})[_0x0a9e('0x20')](function(){_0x88dcbf++;});});})[_0x0a9e('0x15')](function(_0x4b341d){if(_0x4b341d){if(_0x401837[_0x0a9e('0x2b')]>0x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));};
\ No newline at end of file
index 454a9ff..e60ef95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5176=['../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xb1d65f,_0x5a87be){var _0x32de83=function(_0x32c256){while(--_0x32c256){_0xb1d65f['push'](_0xb1d65f['shift']());}};_0x32de83(++_0x5a87be);}(_0x5176,0x154));var _0x6517=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5176[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x6517('0x0'))['db'][_0x6517('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x6517('0x2')](0x0);var events={'afterCreate':_0x6517('0x3'),'afterUpdate':_0x6517('0x4'),'afterDestroy':_0x6517('0x5')};function emitEvent(_0x2013e0){return function(_0x58ed94,_0x353901,_0x5b1943){CmContactEvents[_0x6517('0x6')](_0x2013e0+':'+_0x58ed94['id'],_0x58ed94);CmContactEvents[_0x6517('0x6')](_0x2013e0,_0x58ed94);_0x5b1943(null);};}for(var e in events){if(events[_0x6517('0x7')](e)){var event=events[e];CmContact[_0x6517('0x8')](e,emitEvent(event));}}module[_0x6517('0x9')]=CmContactEvents;
\ No newline at end of file
+var _0xb413=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','CmContact'];(function(_0x233a9f,_0x413c85){var _0x34776e=function(_0x4fc7f8){while(--_0x4fc7f8){_0x233a9f['push'](_0x233a9f['shift']());}};_0x34776e(++_0x413c85);}(_0xb413,0x142));var _0x3b41=function(_0x550788,_0x1b8cc5){_0x550788=_0x550788-0x0;var _0x129c97=_0xb413[_0x550788];return _0x129c97;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x3b41('0x0'))['db'][_0x3b41('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x3b41('0x2')](0x0);var events={'afterCreate':_0x3b41('0x3'),'afterUpdate':'update','afterDestroy':_0x3b41('0x4')};function emitEvent(_0x56987e){return function(_0x396e75,_0x2cfd28,_0x29f50c){CmContactEvents['emit'](_0x56987e+':'+_0x396e75['id'],_0x396e75);CmContactEvents[_0x3b41('0x5')](_0x56987e,_0x396e75);_0x29f50c(null);};}for(var e in events){if(events[_0x3b41('0x6')](e)){var event=events[e];CmContact[_0x3b41('0x7')](e,emitEvent(event));}}module[_0x3b41('0x8')]=CmContactEvents;
\ No newline at end of file
index ff2c2a5..4aa4f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d17=['dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','VoiceQueue','BlackLists','cmContact,\x20%s,\x20%s','Campaign','CmHopperBlack','message','List\x20not\x20found','isEmpty','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../config/environment/shared','./cmContact.attributes','define','CmContact','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','models','get','error','afterCreate','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','findOne','then','isNil','timezones','utcOffset','add','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','priority','format','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','cmContact','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1d17,0xe9));var _0x71d1=function(_0x21f5e6,_0x543eb5){_0x21f5e6=_0x21f5e6-0x0;var _0x338850=_0x1d17[_0x21f5e6];return _0x338850;};'use strict';var _=require(_0x71d1('0x0'));var util=require(_0x71d1('0x1'));var logger=require(_0x71d1('0x2'))(_0x71d1('0x3'));var moment=require(_0x71d1('0x4'));var BPromise=require(_0x71d1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71d1('0x6'));var rimraf=require(_0x71d1('0x7'));var config=require(_0x71d1('0x8'));var shared=require(_0x71d1('0x9'));var attributes=require(_0x71d1('0xa'));module['exports']=function(_0x54f07c,_0x184034){return _0x54f07c[_0x71d1('0xb')](_0x71d1('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x71d1('0xd'),'fields':['phone']},{'name':'fti_cm_contacts','fields':[_0x71d1('0xe'),_0x71d1('0xf'),'phone',_0x71d1('0x10'),_0x71d1('0x11'),_0x71d1('0x12')],'type':_0x71d1('0x13')}],'timestamps':!![],'charset':_0x71d1('0x14'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x4c0361,_0x316dc4,_0x38773a){var _0x2c00b2=_0x54f07c[_0x71d1('0x15')];var _0x3d47c4=_0x4c0361[_0x71d1('0x16')]({'plain':!![]});function _0x26f39e(){return function(_0x4501c4){logger[_0x71d1('0x17')]('cmContact',_0x71d1('0x18'),util[_0x71d1('0x19')](_0x4501c4,{'showHidden':![],'depth':null}));};}function _0x46bccf(_0x2609c6,_0x2d6492){var _0x3096ab=_0x2d6492['scheduledat']?_0x2d6492[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b'));return new BPromise(function(_0x3e3ce9,_0x38cf7d){if(_['isNil'](_0x2d6492[_0x71d1('0x1c')])){_0x3e3ce9({'ret':_0x3096ab});}else{_0x2c00b2['VoiceQueue'][_0x71d1('0x1d')]({'where':{'id':_0x2609c6['id']}})[_0x71d1('0x1e')](function(_0x118f6f){if(!_[_0x71d1('0x1f')](_0x118f6f)){var _0x5f53c0=_0x118f6f['dialTimezone'];if(!_[_0x71d1('0x1f')](_0x5f53c0)){var _0x416100=shared[_0x71d1('0x20')];var _0x4e46ff=_0x416100[_0x5f53c0];var _0x3d6f6a=_0x416100[_0x2d6492['dialTimezone']];if(!_[_0x71d1('0x1f')](_0x4e46ff)&&!_[_0x71d1('0x1f')](_0x3d6f6a)){var _0x1e8aba=_0x4e46ff[_0x71d1('0x21')]-_0x3d6f6a['utcOffset'];_0x3096ab=_0x2d6492[_0x71d1('0x1a')]?_0x2d6492[_0x71d1('0x1a')]:moment();var _0x3fe3cb=moment(_0x3096ab)[_0x71d1('0x22')](_0x1e8aba,'minutes');_0x3e3ce9({'ret':_0x3fe3cb['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x3e3ce9({'ret':_0x3096ab});}else _0x3e3ce9({'ret':_0x3096ab});}else{_0x3e3ce9({'ret':_0x3096ab});}});}});return 0xa;}var _0x18a2b0=function(_0x1298de){return new BPromise(function(_0x2a11e0,_0x42fb0b){_0x46bccf(_0x1298de,_0x3d47c4)['then'](function(_0x4e7d3e){_0x3d47c4[_0x71d1('0x1a')]=_0x4e7d3e[_0x71d1('0x23')];_0x2c00b2['CmHopper'][_0x71d1('0x1d')]({'where':{'phone':_0x3d47c4['phone'],'VoiceQueueId':_0x1298de['id']}})[_0x71d1('0x1e')](function(_0x538c66){if(!_['isNil'](_0x538c66)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x25')+_0x1298de['id']);}return _0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4['ListId'],'priority':_0x3d47c4['priority']?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()[_0x71d1('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3d47c4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3d47c4[_0x71d1('0x2a')]?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')](_0x71d1('0x1b')):undefined,'VoiceQueueId':_0x1298de['id']});})[_0x71d1('0x2b')](function(_0x195d77){_0x42fb0b(_0x195d77);});});});};var _0x5161ad=function(_0x4010f8){return new BPromise(function(_0x167e16,_0x396b50){_0x46bccf(_0x4010f8,_0x3d47c4)['then'](function(_0x2f7e13){_0x3d47c4['scheduledat']=_0x2f7e13[_0x71d1('0x23')];_0x2c00b2[_0x71d1('0x26')]['findOne']({'where':{'phone':_0x3d47c4[_0x71d1('0xd')],'VoiceQueueId':_0x4010f8['id']}})[_0x71d1('0x1e')](function(_0xa0cbd3){if(!_[_0x71d1('0x1f')](_0xa0cbd3)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x2c')+_0x4010f8['id']);}return _0x2c00b2[_0x71d1('0x2d')][_0x71d1('0x1d')]({'where':{'calleridnum':_0x3d47c4['phone'],'VoiceQueueId':_0x4010f8['id']}});})[_0x71d1('0x1e')](function(_0x1a6441){if(!_[_0x71d1('0x1f')](_0x1a6441)){throw new Error(_0x71d1('0x2e')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x2f')+_0x4010f8['id']);}return _0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'priority':_0x3d47c4[_0x71d1('0x28')]?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4[_0x71d1('0x2a')]?_0x3d47c4['callbackUniqueid']:undefined,'callbackat':_0x3d47c4['callbackUniqueid']?moment()['format'](_0x71d1('0x1b')):undefined,'VoiceQueueId':_0x4010f8['id']});})['catch'](function(_0x1145f7){_0x396b50(_0x1145f7);});});});};function _0x1adb08(){return function(_0x399e3a){logger['error'](_0x71d1('0x31'),_0x71d1('0x18'),util[_0x71d1('0x19')](_0x399e3a,{'showHidden':![],'depth':null}));};}function _0x5f395c(_0x22e55c,_0x3c0210){var _0x28dd31=_0x3c0210['scheduledat']?_0x3c0210[_0x71d1('0x1a')]:moment()[_0x71d1('0x29')](_0x71d1('0x1b'));return new BPromise(function(_0x448689,_0x106ed1){if(_[_0x71d1('0x1f')](_0x3c0210[_0x71d1('0x1c')])){_0x448689({'ret':_0x28dd31});}else{_0x2c00b2['Campaign']['findOne']({'where':{'id':_0x22e55c['id']}})['then'](function(_0x2ffc6f){if(!_[_0x71d1('0x1f')](_0x2ffc6f)){var _0x2638b=_0x2ffc6f['dialTimezone'];if(!_[_0x71d1('0x1f')](_0x2638b)){var _0x4ed760=shared['timezones'];var _0x55fe39=_0x4ed760[_0x2638b];var _0xfeee91=_0x4ed760[_0x3c0210[_0x71d1('0x1c')]];if(!_[_0x71d1('0x1f')](_0x55fe39)&&!_[_0x71d1('0x1f')](_0xfeee91)){var _0x3baf31=_0x55fe39['utcOffset']-_0xfeee91[_0x71d1('0x21')];_0x28dd31=_0x3c0210[_0x71d1('0x1a')]?_0x3c0210[_0x71d1('0x1a')]:moment();var _0xe1ed47=moment(_0x28dd31)[_0x71d1('0x22')](_0x3baf31,_0x71d1('0x32'));_0x448689({'ret':_0xe1ed47['format']('YYYY-MM-DD\x20HH:mm:ss')});}else _0x448689({'ret':_0x28dd31});}else _0x448689({'ret':_0x28dd31});}else{_0x448689({'ret':_0x28dd31});}});}});return 0xa;}var _0x25b7e1=function(_0x351336){return new BPromise(function(_0x1265ae,_0x2a334b){_0x5f395c(_0x351336,_0x3d47c4)[_0x71d1('0x1e')](function(_0x4a6f0e){_0x3d47c4[_0x71d1('0x1a')]=_0x4a6f0e['ret'];_0x2c00b2[_0x71d1('0x26')][_0x71d1('0x1d')]({'where':{'phone':_0x3d47c4['phone'],'CampaignId':_0x351336['id']}})[_0x71d1('0x1e')](function(_0x5345a5){if(!_[_0x71d1('0x1f')](_0x5345a5)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x33')+_0x351336['id']);}return _0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'priority':_0x3d47c4[_0x71d1('0x28')]?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'callback':_0x3d47c4['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3d47c4['callbackUniqueid']?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')](_0x71d1('0x1b')):undefined,'CampaignId':_0x351336['id']});})[_0x71d1('0x2b')](function(_0x444fc8){_0x2a334b(_0x444fc8);});});});};var _0x5ea1c5=function(_0x340c8b){return new BPromise(function(_0x142d8e,_0xfccf26){_0x5f395c(_0x340c8b,_0x3d47c4)[_0x71d1('0x1e')](function(_0x5557b0){_0x3d47c4[_0x71d1('0x1a')]=_0x5557b0[_0x71d1('0x23')];_0x2c00b2[_0x71d1('0x26')]['findOne']({'where':{'phone':_0x3d47c4[_0x71d1('0xd')],'CampaignId':_0x340c8b['id']}})[_0x71d1('0x1e')](function(_0x58fca4){if(!_[_0x71d1('0x1f')](_0x58fca4)){throw new Error(_0x71d1('0x24')+_0x3d47c4[_0x71d1('0xd')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x340c8b['id']);}return _0x2c00b2[_0x71d1('0x2d')]['findOne']({'where':{'calleridnum':_0x3d47c4[_0x71d1('0xd')],'CampaignId':_0x340c8b['id']}});})[_0x71d1('0x1e')](function(_0x9a963e){if(!_[_0x71d1('0x1f')](_0x9a963e)){throw new Error(_0x71d1('0x2e')+_0x3d47c4[_0x71d1('0xd')]+_0x71d1('0x34')+_0x340c8b['id']);}return _0x2c00b2['CmHopper']['create']({'phone':_0x3d47c4['phone'],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'priority':_0x3d47c4['priority']?_0x3d47c4[_0x71d1('0x28')]:0x2,'scheduledat':_0x3d47c4['scheduledat']?_0x3d47c4['scheduledat']:moment()[_0x71d1('0x29')](_0x71d1('0x1b')),'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4[_0x71d1('0x2a')]?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x340c8b['id']});})[_0x71d1('0x2b')](function(_0xde10d1){_0xfccf26(_0xde10d1);});});});};if(_0x3d47c4[_0x71d1('0x30')]){_0x2c00b2['VoiceQueue'][_0x71d1('0x35')]({'where':{'type':_0x71d1('0x36')},'attributes':['id',_0x71d1('0x37'),_0x71d1('0x1c')],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x39'),'where':{'id':_0x3d47c4[_0x71d1('0x30')]}}]})['then'](function(_0x1199f4){if(_0x1199f4){var _0x407fcd=[];for(var _0x5643a0=0x0,_0x161c26;_0x5643a0<_0x1199f4[_0x71d1('0x3a')];_0x5643a0+=0x1){_0x161c26=_0x1199f4[_0x5643a0][_0x71d1('0x16')]({'plain':!![]});switch(_0x161c26[_0x71d1('0x37')]){case _0x71d1('0x3b'):_0x5161ad(_0x161c26)['catch'](_0x26f39e());break;case _0x71d1('0x3c'):_0x18a2b0(_0x161c26)[_0x71d1('0x2b')](_0x26f39e());break;default:_0x5f395c(_0x161c26,_0x3d47c4)['then'](function(_0x4e0179){_0x3d47c4['scheduledat']=_0x4e0179[_0x71d1('0x23')];_0x2c00b2[_0x71d1('0x26')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'scheduledat':_0x3d47c4['scheduledat']?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'priority':_0x3d47c4[_0x71d1('0x28')]?_0x3d47c4[_0x71d1('0x28')]:0x2,'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4['callbackUniqueid']?_0x3d47c4['callbackUniqueid']:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x161c26['id']})[_0x71d1('0x2b')](_0x26f39e());});}}}})[_0x71d1('0x1e')](function(){return _0x2c00b2[_0x71d1('0x3d')][_0x71d1('0x35')]({'where':{'type':_0x71d1('0x36')},'attributes':['id'],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x3e'),'where':{'id':_0x3d47c4['ListId']}}]})[_0x71d1('0x1e')](function(_0x33e9d6){if(_0x33e9d6){var _0x2454ac=[];for(var _0x19d0ae=0x0,_0x8420b0;_0x19d0ae<_0x33e9d6[_0x71d1('0x3a')];_0x19d0ae+=0x1){_0x8420b0=_0x33e9d6[_0x19d0ae]['get']({'plain':!![]});_0x2c00b2['CmHopperBlack'][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4['ListId'],'VoiceQueueId':_0x8420b0['id']})[_0x71d1('0x2b')](function(_0x574837){logger['error'](_0x71d1('0x3f'),_0x71d1('0x18'),_0x574837['message']);});}}});})[_0x71d1('0x1e')](function(){return _0x2c00b2[_0x71d1('0x40')]['findAll']({'attributes':['id',_0x71d1('0x37'),_0x71d1('0x1c')],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x39'),'where':{'id':_0x3d47c4[_0x71d1('0x30')]}}]})[_0x71d1('0x1e')](function(_0xd986c3){if(_0xd986c3){var _0x50757a=[];for(var _0x5bbe53=0x0,_0x26c6af;_0x5bbe53<_0xd986c3[_0x71d1('0x3a')];_0x5bbe53+=0x1){_0x26c6af=_0xd986c3[_0x5bbe53][_0x71d1('0x16')]({'plain':!![]});switch(_0x26c6af['dialCheckDuplicateType']){case _0x71d1('0x3b'):_0x5ea1c5(_0x26c6af)[_0x71d1('0x2b')](_0x1adb08());break;case _0x71d1('0x3c'):_0x25b7e1(_0x26c6af)[_0x71d1('0x2b')](_0x1adb08());break;default:_0x2c00b2[_0x71d1('0x26')]['create']({'phone':_0x3d47c4['phone'],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'scheduledat':_0x3d47c4[_0x71d1('0x1a')]?_0x3d47c4[_0x71d1('0x1a')]:moment()['format'](_0x71d1('0x1b')),'priority':_0x3d47c4['priority']?_0x3d47c4[_0x71d1('0x28')]:0x2,'callback':_0x3d47c4[_0x71d1('0x2a')]?!![]:![],'callbackuniqueid':_0x3d47c4['callbackUniqueid']?_0x3d47c4[_0x71d1('0x2a')]:undefined,'callbackat':_0x3d47c4[_0x71d1('0x2a')]?moment()[_0x71d1('0x29')](_0x71d1('0x1b')):undefined,'CampaignId':_0x26c6af['id']})[_0x71d1('0x2b')](_0x1adb08());}}}});})[_0x71d1('0x1e')](function(){return _0x2c00b2['Campaign'][_0x71d1('0x35')]({'attributes':['id'],'include':[{'model':_0x2c00b2[_0x71d1('0x38')],'as':_0x71d1('0x3e'),'where':{'id':_0x3d47c4[_0x71d1('0x30')]}}]})[_0x71d1('0x1e')](function(_0x178c5f){if(_0x178c5f){var _0x42977d=[];for(var _0x189ac9=0x0,_0x583895;_0x189ac9<_0x178c5f[_0x71d1('0x3a')];_0x189ac9+=0x1){_0x583895=_0x178c5f[_0x189ac9][_0x71d1('0x16')]({'plain':!![]});_0x2c00b2[_0x71d1('0x41')][_0x71d1('0x27')]({'phone':_0x3d47c4[_0x71d1('0xd')],'ContactId':_0x3d47c4['id'],'ListId':_0x3d47c4[_0x71d1('0x30')],'CampaignId':_0x583895['id']})[_0x71d1('0x2b')](function(_0x264b4e){logger[_0x71d1('0x17')](_0x71d1('0x3f'),'afterCreate',_0x264b4e[_0x71d1('0x42')]);});}}});})['then'](function(){_0x38773a();})[_0x71d1('0x2b')](function(_0xb7ba16){logger[_0x71d1('0x17')]('cmContact,\x20%s,\x20%s','afterCreate',_0xb7ba16['message']);_0x38773a(_0xb7ba16);});}else{_0x38773a(new Error(_0x71d1('0x43')));}},'afterDestroy':function(_0x2a99ce,_0x4ed5f6,_0x30bfb6){var _0x27bd8a=_0x54f07c[_0x71d1('0x15')];var _0x1e9d8e=_0x2a99ce[_0x71d1('0x16')]({'plain':!![]});return _0x27bd8a[_0x71d1('0x26')]['findAll']({'raw':!![],'where':{'ListId':_0x1e9d8e[_0x71d1('0x30')],'ContactId':_0x1e9d8e['id']}})['then'](function(_0x303d7b){if(!_[_0x71d1('0x44')](_0x303d7b)){var _0x50ec1c=[];for(var _0x5682c8=0x0;_0x5682c8<_0x303d7b[_0x71d1('0x3a')];_0x5682c8+=0x1){var _0x503660=_0x27bd8a[_0x71d1('0x26')]['destroy']({'where':{'ListId':_0x303d7b[_0x5682c8][_0x71d1('0x30')],'ContactId':_0x303d7b[_0x5682c8]['ContactId'],'VoiceQueueId':_0x303d7b[_0x5682c8]['VoiceQueueId'],'CampaignId':_0x303d7b[_0x5682c8]['CampaignId']}});_0x50ec1c['push'](_0x503660);}return BPromise[_0x71d1('0x45')](_0x50ec1c);}})[_0x71d1('0x1e')](function(_0x2a281f){logger[_0x71d1('0x46')]('[CmContact][afterDestroy][Succesfull]',util[_0x71d1('0x19')](_0x2a281f,{'showHidden':![],'depth':null}));_0x30bfb6();})[_0x71d1('0x2b')](function(_0xedc26){logger[_0x71d1('0x17')](_0x71d1('0x47'),util[_0x71d1('0x19')](_0xedc26,{'showHidden':![],'depth':null}));_0x30bfb6(_0xedc26);});}}});};
\ No newline at end of file
+var _0xa20b=['push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmContact.attributes','exports','cm_contacts','phone','firstName','lastName','mobile','fax','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','findOne','timezones','utcOffset','add','minutes','then','ret','CmHopper','cmContact,\x20afterCreate\x20','create','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','Campaign','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','length','always','onlyIfOpen','cmContact,\x20%s,\x20%s','message','BlackLists','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId'];(function(_0x29d5ce,_0x1503e9){var _0x266f7b=function(_0x40e12e){while(--_0x40e12e){_0x29d5ce['push'](_0x29d5ce['shift']());}};_0x266f7b(++_0x1503e9);}(_0xa20b,0x95));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba20('0x0'))(_0xba20('0x1'));var moment=require('moment');var BPromise=require(_0xba20('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba20('0x3'));var rimraf=require(_0xba20('0x4'));var config=require(_0xba20('0x5'));var shared=require('../../config/environment/shared');var attributes=require(_0xba20('0x6'));module[_0xba20('0x7')]=function(_0x4488f7,_0x3d4450){return _0x4488f7['define']('CmContact',attributes,{'tableName':_0xba20('0x8'),'paranoid':!![],'indexes':[{'name':_0xba20('0x9'),'fields':[_0xba20('0x9')]},{'name':'fti_cm_contacts','fields':[_0xba20('0xa'),_0xba20('0xb'),_0xba20('0x9'),_0xba20('0xc'),_0xba20('0xd'),'email'],'type':_0xba20('0xe')}],'timestamps':!![],'charset':_0xba20('0xf'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x440de6,_0x3573fc,_0x3bd71b){var _0x1e8f15=_0x4488f7[_0xba20('0x10')];var _0x17609f=_0x440de6[_0xba20('0x11')]({'plain':!![]});function _0x2649a2(){return function(_0x336a89){logger[_0xba20('0x12')](_0xba20('0x13'),_0xba20('0x14'),util[_0xba20('0x15')](_0x336a89,{'showHidden':![],'depth':null}));};}function _0x486496(_0x1f3527,_0x330607){var _0x4c0cee=_0x330607[_0xba20('0x16')]?_0x330607[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18'));return new BPromise(function(_0x5b7630,_0x5acb91){if(_[_0xba20('0x19')](_0x330607[_0xba20('0x1a')])){_0x5b7630({'ret':_0x4c0cee});}else{_0x1e8f15['VoiceQueue'][_0xba20('0x1b')]({'where':{'id':_0x1f3527['id']}})['then'](function(_0x29af1c){if(!_['isNil'](_0x29af1c)){var _0x431c54=_0x29af1c['dialTimezone'];if(!_['isNil'](_0x431c54)){var _0x3ec8c9=shared[_0xba20('0x1c')];var _0x1e3cc3=_0x3ec8c9[_0x431c54];var _0x178bd1=_0x3ec8c9[_0x330607[_0xba20('0x1a')]];if(!_[_0xba20('0x19')](_0x1e3cc3)&&!_[_0xba20('0x19')](_0x178bd1)){var _0x560433=_0x1e3cc3[_0xba20('0x1d')]-_0x178bd1[_0xba20('0x1d')];_0x4c0cee=_0x330607[_0xba20('0x16')]?_0x330607[_0xba20('0x16')]:moment();var _0x4a9889=moment(_0x4c0cee)[_0xba20('0x1e')](_0x560433,_0xba20('0x1f'));_0x5b7630({'ret':_0x4a9889[_0xba20('0x17')](_0xba20('0x18'))});}else _0x5b7630({'ret':_0x4c0cee});}else _0x5b7630({'ret':_0x4c0cee});}else{_0x5b7630({'ret':_0x4c0cee});}});}});return 0xa;}var _0x5d74b0=function(_0xdfaa66){return new BPromise(function(_0x319476,_0x54aa70){_0x486496(_0xdfaa66,_0x17609f)[_0xba20('0x20')](function(_0x34a081){_0x17609f[_0xba20('0x16')]=_0x34a081[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')][_0xba20('0x1b')]({'where':{'phone':_0x17609f['phone'],'VoiceQueueId':_0xdfaa66['id']}})['then'](function(_0x2ea99d){if(!_[_0xba20('0x19')](_0x2ea99d)){throw new Error(_0xba20('0x23')+_0x17609f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0xdfaa66['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f['ListId'],'priority':_0x17609f[_0xba20('0x25')]?_0x17609f[_0xba20('0x25')]:0x2,'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18')),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f['callbackUniqueid']?_0x17609f[_0xba20('0x26')]:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()['format'](_0xba20('0x18')):undefined,'VoiceQueueId':_0xdfaa66['id']});})[_0xba20('0x27')](function(_0x1497c1){_0x54aa70(_0x1497c1);});});});};var _0x911ba4=function(_0x13fa3a){return new BPromise(function(_0x44e77f,_0x185e6b){_0x486496(_0x13fa3a,_0x17609f)[_0xba20('0x20')](function(_0x295472){_0x17609f[_0xba20('0x16')]=_0x295472[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')]['findOne']({'where':{'phone':_0x17609f[_0xba20('0x9')],'VoiceQueueId':_0x13fa3a['id']}})[_0xba20('0x20')](function(_0x393926){if(!_[_0xba20('0x19')](_0x393926)){throw new Error(_0xba20('0x23')+_0x17609f[_0xba20('0x9')]+_0xba20('0x28')+_0x13fa3a['id']);}return _0x1e8f15['CmHopperFinal'][_0xba20('0x1b')]({'where':{'calleridnum':_0x17609f[_0xba20('0x9')],'VoiceQueueId':_0x13fa3a['id']}});})['then'](function(_0x3cdfef){if(!_[_0xba20('0x19')](_0x3cdfef)){throw new Error(_0xba20('0x29')+_0x17609f[_0xba20('0x9')]+_0xba20('0x2a')+_0x13fa3a['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f['phone'],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'priority':_0x17609f['priority']?_0x17609f['priority']:0x2,'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f[_0xba20('0x16')]:moment()['format'](_0xba20('0x18')),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f[_0xba20('0x26')]?_0x17609f['callbackUniqueid']:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()[_0xba20('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x13fa3a['id']});})[_0xba20('0x27')](function(_0x15793e){_0x185e6b(_0x15793e);});});});};function _0x3a8625(){return function(_0x3c4ab0){logger[_0xba20('0x12')](_0xba20('0x13'),'afterCreate',util[_0xba20('0x15')](_0x3c4ab0,{'showHidden':![],'depth':null}));};}function _0x5ccf2c(_0x48c20b,_0x31a343){var _0x418ae4=_0x31a343[_0xba20('0x16')]?_0x31a343[_0xba20('0x16')]:moment()['format'](_0xba20('0x18'));return new BPromise(function(_0x48b3a0,_0x390f62){if(_['isNil'](_0x31a343['dialTimezone'])){_0x48b3a0({'ret':_0x418ae4});}else{_0x1e8f15[_0xba20('0x2c')][_0xba20('0x1b')]({'where':{'id':_0x48c20b['id']}})['then'](function(_0xe41624){if(!_['isNil'](_0xe41624)){var _0x10015d=_0xe41624[_0xba20('0x1a')];if(!_[_0xba20('0x19')](_0x10015d)){var _0x5971dc=shared[_0xba20('0x1c')];var _0xcfd68b=_0x5971dc[_0x10015d];var _0x16d92b=_0x5971dc[_0x31a343['dialTimezone']];if(!_[_0xba20('0x19')](_0xcfd68b)&&!_[_0xba20('0x19')](_0x16d92b)){var _0x2317bf=_0xcfd68b['utcOffset']-_0x16d92b[_0xba20('0x1d')];_0x418ae4=_0x31a343['scheduledat']?_0x31a343[_0xba20('0x16')]:moment();var _0x199a84=moment(_0x418ae4)[_0xba20('0x1e')](_0x2317bf,_0xba20('0x1f'));_0x48b3a0({'ret':_0x199a84[_0xba20('0x17')](_0xba20('0x18'))});}else _0x48b3a0({'ret':_0x418ae4});}else _0x48b3a0({'ret':_0x418ae4});}else{_0x48b3a0({'ret':_0x418ae4});}});}});return 0xa;}var _0x56b546=function(_0x46ec1b){return new BPromise(function(_0x422f1a,_0x8da858){_0x5ccf2c(_0x46ec1b,_0x17609f)[_0xba20('0x20')](function(_0x376a5a){_0x17609f['scheduledat']=_0x376a5a[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')][_0xba20('0x1b')]({'where':{'phone':_0x17609f[_0xba20('0x9')],'CampaignId':_0x46ec1b['id']}})['then'](function(_0x4b89a0){if(!_[_0xba20('0x19')](_0x4b89a0)){throw new Error(_0xba20('0x23')+_0x17609f[_0xba20('0x9')]+_0xba20('0x2d')+_0x46ec1b['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'priority':_0x17609f[_0xba20('0x25')]?_0x17609f['priority']:0x2,'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18')),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f[_0xba20('0x26')]?_0x17609f[_0xba20('0x26')]:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x46ec1b['id']});})['catch'](function(_0xbebffc){_0x8da858(_0xbebffc);});});});};var _0x1ed8e4=function(_0x2a998d){return new BPromise(function(_0x5770ff,_0x31dc1f){_0x5ccf2c(_0x2a998d,_0x17609f)[_0xba20('0x20')](function(_0x2828bb){_0x17609f[_0xba20('0x16')]=_0x2828bb[_0xba20('0x21')];_0x1e8f15[_0xba20('0x22')][_0xba20('0x1b')]({'where':{'phone':_0x17609f['phone'],'CampaignId':_0x2a998d['id']}})[_0xba20('0x20')](function(_0x132884){if(!_[_0xba20('0x19')](_0x132884)){throw new Error(_0xba20('0x23')+_0x17609f[_0xba20('0x9')]+_0xba20('0x2e')+_0x2a998d['id']);}return _0x1e8f15[_0xba20('0x2f')][_0xba20('0x1b')]({'where':{'calleridnum':_0x17609f[_0xba20('0x9')],'CampaignId':_0x2a998d['id']}});})[_0xba20('0x20')](function(_0x2bdce3){if(!_[_0xba20('0x19')](_0x2bdce3)){throw new Error(_0xba20('0x29')+_0x17609f[_0xba20('0x9')]+_0xba20('0x30')+_0x2a998d['id']);}return _0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'priority':_0x17609f[_0xba20('0x25')]?_0x17609f[_0xba20('0x25')]:0x2,'scheduledat':_0x17609f['scheduledat']?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f[_0xba20('0x26')]?_0x17609f['callbackUniqueid']:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()[_0xba20('0x17')](_0xba20('0x18')):undefined,'CampaignId':_0x2a998d['id']});})[_0xba20('0x27')](function(_0x65c5){_0x31dc1f(_0x65c5);});});});};if(_0x17609f[_0xba20('0x2b')]){_0x1e8f15[_0xba20('0x31')][_0xba20('0x32')]({'where':{'type':'outbound'},'attributes':['id',_0xba20('0x33'),_0xba20('0x1a')],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':_0xba20('0x35'),'where':{'id':_0x17609f['ListId']}}]})['then'](function(_0x176f99){if(_0x176f99){var _0x4800c6=[];for(var _0x4279f2=0x0,_0x40cfbc;_0x4279f2<_0x176f99[_0xba20('0x36')];_0x4279f2+=0x1){_0x40cfbc=_0x176f99[_0x4279f2][_0xba20('0x11')]({'plain':!![]});switch(_0x40cfbc[_0xba20('0x33')]){case _0xba20('0x37'):_0x911ba4(_0x40cfbc)[_0xba20('0x27')](_0x2649a2());break;case _0xba20('0x38'):_0x5d74b0(_0x40cfbc)[_0xba20('0x27')](_0x2649a2());break;default:_0x5ccf2c(_0x40cfbc,_0x17609f)[_0xba20('0x20')](function(_0x2dfeb8){_0x17609f[_0xba20('0x16')]=_0x2dfeb8['ret'];_0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'scheduledat':_0x17609f[_0xba20('0x16')]?_0x17609f['scheduledat']:moment()[_0xba20('0x17')](_0xba20('0x18')),'priority':_0x17609f[_0xba20('0x25')]?_0x17609f['priority']:0x2,'callback':_0x17609f[_0xba20('0x26')]?!![]:![],'callbackuniqueid':_0x17609f['callbackUniqueid']?_0x17609f[_0xba20('0x26')]:undefined,'callbackat':_0x17609f['callbackUniqueid']?moment()[_0xba20('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x40cfbc['id']})[_0xba20('0x27')](_0x2649a2());});}}}})['then'](function(){return _0x1e8f15[_0xba20('0x31')][_0xba20('0x32')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':'BlackLists','where':{'id':_0x17609f[_0xba20('0x2b')]}}]})[_0xba20('0x20')](function(_0x331902){if(_0x331902){var _0x5775f9=[];for(var _0x16fdc7=0x0,_0x4ef55b;_0x16fdc7<_0x331902[_0xba20('0x36')];_0x16fdc7+=0x1){_0x4ef55b=_0x331902[_0x16fdc7][_0xba20('0x11')]({'plain':!![]});_0x1e8f15['CmHopperBlack'][_0xba20('0x24')]({'phone':_0x17609f['phone'],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'VoiceQueueId':_0x4ef55b['id']})[_0xba20('0x27')](function(_0x4922cc){logger[_0xba20('0x12')](_0xba20('0x39'),_0xba20('0x14'),_0x4922cc[_0xba20('0x3a')]);});}}});})['then'](function(){return _0x1e8f15[_0xba20('0x2c')]['findAll']({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':_0xba20('0x35'),'where':{'id':_0x17609f[_0xba20('0x2b')]}}]})[_0xba20('0x20')](function(_0x55999f){if(_0x55999f){var _0x6bf579=[];for(var _0x37c5bf=0x0,_0x24d840;_0x37c5bf<_0x55999f[_0xba20('0x36')];_0x37c5bf+=0x1){_0x24d840=_0x55999f[_0x37c5bf][_0xba20('0x11')]({'plain':!![]});switch(_0x24d840[_0xba20('0x33')]){case'always':_0x1ed8e4(_0x24d840)['catch'](_0x3a8625());break;case _0xba20('0x38'):_0x56b546(_0x24d840)[_0xba20('0x27')](_0x3a8625());break;default:_0x1e8f15[_0xba20('0x22')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'scheduledat':_0x17609f['scheduledat']?_0x17609f[_0xba20('0x16')]:moment()[_0xba20('0x17')](_0xba20('0x18')),'priority':_0x17609f[_0xba20('0x25')]?_0x17609f[_0xba20('0x25')]:0x2,'callback':_0x17609f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x17609f['callbackUniqueid']?_0x17609f['callbackUniqueid']:undefined,'callbackat':_0x17609f[_0xba20('0x26')]?moment()[_0xba20('0x17')](_0xba20('0x18')):undefined,'CampaignId':_0x24d840['id']})[_0xba20('0x27')](_0x3a8625());}}}});})[_0xba20('0x20')](function(){return _0x1e8f15[_0xba20('0x2c')][_0xba20('0x32')]({'attributes':['id'],'include':[{'model':_0x1e8f15[_0xba20('0x34')],'as':_0xba20('0x3b'),'where':{'id':_0x17609f[_0xba20('0x2b')]}}]})[_0xba20('0x20')](function(_0x4d34cf){if(_0x4d34cf){var _0xd1df3a=[];for(var _0x15ffca=0x0,_0x503dc4;_0x15ffca<_0x4d34cf[_0xba20('0x36')];_0x15ffca+=0x1){_0x503dc4=_0x4d34cf[_0x15ffca]['get']({'plain':!![]});_0x1e8f15[_0xba20('0x3c')][_0xba20('0x24')]({'phone':_0x17609f[_0xba20('0x9')],'ContactId':_0x17609f['id'],'ListId':_0x17609f[_0xba20('0x2b')],'CampaignId':_0x503dc4['id']})['catch'](function(_0x113b34){logger[_0xba20('0x12')](_0xba20('0x39'),_0xba20('0x14'),_0x113b34['message']);});}}});})[_0xba20('0x20')](function(){_0x3bd71b();})['catch'](function(_0x4a80cd){logger[_0xba20('0x12')](_0xba20('0x39'),_0xba20('0x14'),_0x4a80cd[_0xba20('0x3a')]);_0x3bd71b(_0x4a80cd);});}else{_0x3bd71b(new Error(_0xba20('0x3d')));}},'afterDestroy':function(_0x5e4091,_0x536716,_0x5caff9){var _0x50a33c=_0x4488f7['models'];var _0x5ecd43=_0x5e4091[_0xba20('0x11')]({'plain':!![]});return _0x50a33c['CmHopper'][_0xba20('0x32')]({'raw':!![],'where':{'ListId':_0x5ecd43[_0xba20('0x2b')],'ContactId':_0x5ecd43['id']}})[_0xba20('0x20')](function(_0x2e9e87){if(!_[_0xba20('0x3e')](_0x2e9e87)){var _0x3b7da9=[];for(var _0x4767d2=0x0;_0x4767d2<_0x2e9e87['length'];_0x4767d2+=0x1){var _0x1bb59c=_0x50a33c[_0xba20('0x22')][_0xba20('0x3f')]({'where':{'ListId':_0x2e9e87[_0x4767d2][_0xba20('0x2b')],'ContactId':_0x2e9e87[_0x4767d2][_0xba20('0x40')],'VoiceQueueId':_0x2e9e87[_0x4767d2][_0xba20('0x41')],'CampaignId':_0x2e9e87[_0x4767d2][_0xba20('0x42')]}});_0x3b7da9[_0xba20('0x43')](_0x1bb59c);}return BPromise[_0xba20('0x44')](_0x3b7da9);}})[_0xba20('0x20')](function(_0x276f6a){logger[_0xba20('0x45')](_0xba20('0x46'),util['inspect'](_0x276f6a,{'showHidden':![],'depth':null}));_0x5caff9();})[_0xba20('0x27')](function(_0x22393b){logger['error'](_0xba20('0x47'),util[_0xba20('0x15')](_0x22393b,{'showHidden':![],'depth':null}));_0x5caff9(_0x22393b);});}}});};
\ No newline at end of file
index 5f88aa2..27657c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a<Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x0a9e('0x2e')];_0x24936a++){var _0x4f41ae=Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x24936a];if(_0x4f41ae[_0x0a9e('0x2f')]('cf_')){_0x5640eb=squel[_0x0a9e('0x30')]()[_0x0a9e('0x31')](_0x0a9e('0x32'))['set'](_0x4f41ae,_0x2cc7a0['body'][_0x4f41ae])[_0x0a9e('0x1d')](_0x0a9e('0x33'),_0x1e8694['id'])['toString']();break;}}if(!_0x5640eb)return _0x1e8694;return db[_0x0a9e('0x34')][_0x0a9e('0x35')](_0x5640eb)[_0x0a9e('0x23')](function(){return _0x1e8694;});})[_0x0a9e('0x23')](function(_0x4b38d9){logger['info'](_0x0a9e('0x36'),_0x2cc7a0);logger[_0x0a9e('0x12')]('CreateCmContact',_0x2cc7a0,JSON[_0x0a9e('0x24')](_0x4b38d9));_0x2b7e7f(_0x4b38d9);})[_0x0a9e('0x18')](function(_0x1459bb){logger['error'](_0x0a9e('0x36'),_0x1459bb[_0x0a9e('0x16')],_0x2cc7a0);_0x3f3d41(_0x14b13f[_0x0a9e('0x14')](0x1f4,_0x1459bb[_0x0a9e('0x16')]));});});};
\ No newline at end of file
+var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x57906f,_0xe15414){var _0x3b4c29=function(_0xc5d427){while(--_0xc5d427){_0x57906f['push'](_0x57906f['shift']());}};_0x3b4c29(++_0xe15414);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
index b8c5542..a43fb35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index b11b82c..493fedc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x742a25,_0x28f592){var _0x15f39c=function(_0x8c7a13){while(--_0x8c7a13){_0x742a25['push'](_0x742a25['shift']());}};_0x15f39c(++_0x28f592);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
+var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x1f620f,_0x3872a2){var _0x51a714=function(_0x5e9df0){while(--_0x5e9df0){_0x1f620f['push'](_0x1f620f['shift']());}};_0x51a714(++_0x3872a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
index d871463..c430893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b83=['STRING','PHONE','sequelize','exports','INTEGER'];(function(_0x456af7,_0x3d36d3){var _0x3818f7=function(_0x2e7ca1){while(--_0x2e7ca1){_0x456af7['push'](_0x456af7['shift']());}};_0x3818f7(++_0x3d36d3);}(_0x9b83,0x84));var _0x39b8=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x9b83[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0x39b8('0x0'));module[_0x39b8('0x1')]={'CmContactId':{'type':Sequelize[_0x39b8('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x39b8('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x39b8('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x39b8('0x3')],'defaultValue':_0x39b8('0x4')},'OrderBy':{'type':Sequelize[_0x39b8('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x39b8('0x3')],'defaultValue':null}};
\ No newline at end of file
+var _0xbd50=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x360bd0,_0x2ad1d5){var _0x1baaed=function(_0x3e025f){while(--_0x3e025f){_0x360bd0['push'](_0x360bd0['shift']());}};_0x1baaed(++_0x2ad1d5);}(_0xbd50,0x196));var _0x0bd5=function(_0x3c7246,_0x391009){_0x3c7246=_0x3c7246-0x0;var _0x28c8c4=_0xbd50[_0x3c7246];return _0x28c8c4;};'use strict';var Sequelize=require(_0x0bd5('0x0'));module[_0x0bd5('0x1')]={'CmContactId':{'type':Sequelize[_0x0bd5('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x0bd5('0x3')],'defaultValue':_0x0bd5('0x4')},'OrderBy':{'type':Sequelize[_0x0bd5('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0bd5('0x3')],'defaultValue':null}};
\ No newline at end of file
index 131ca92..36abf1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf48=['type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','params','intersection','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','CmContactHasItems','UserProfileResource','destroy','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName'];(function(_0x1aeea6,_0x407d72){var _0x143992=function(_0x251888){while(--_0x251888){_0x1aeea6['push'](_0x1aeea6['shift']());}};_0x143992(++_0x407d72);}(_0xaf48,0x75));var _0x8af4=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xaf48[_0x4e7d25];return _0x526fe6;};'use strict';var emlformat=require(_0x8af4('0x0'));var rimraf=require(_0x8af4('0x1'));var zipdir=require(_0x8af4('0x2'));var jsonpatch=require(_0x8af4('0x3'));var rp=require(_0x8af4('0x4'));var moment=require(_0x8af4('0x5'));var BPromise=require(_0x8af4('0x6'));var Mustache=require(_0x8af4('0x7'));var util=require('util');var path=require(_0x8af4('0x8'));var sox=require(_0x8af4('0x9'));var csv=require(_0x8af4('0xa'));var ejs=require(_0x8af4('0xb'));var fs=require('fs');var fs_extra=require(_0x8af4('0xc'));var _=require(_0x8af4('0xd'));var squel=require(_0x8af4('0xe'));var crypto=require('crypto');var jsforce=require(_0x8af4('0xf'));var deskjs=require(_0x8af4('0x10'));var toCsv=require(_0x8af4('0xa'));var querystring=require(_0x8af4('0x11'));var Papa=require(_0x8af4('0x12'));var Redis=require(_0x8af4('0x13'));var authService=require(_0x8af4('0x14'));var qs=require(_0x8af4('0x15'));var as=require(_0x8af4('0x16'));var hardwareService=require(_0x8af4('0x17'));var logger=require(_0x8af4('0x18'))('api');var utils=require(_0x8af4('0x19'));var config=require(_0x8af4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3526bd,_0x46d588){_0x46d588=_0x46d588||0xcc;return function(_0x24e056){if(_0x24e056){return _0x3526bd[_0x8af4('0x1b')](_0x46d588);}return _0x3526bd[_0x8af4('0x1c')](_0x46d588)[_0x8af4('0x1d')]();};}function respondWithResult(_0x10bf5c,_0x2a5857){_0x2a5857=_0x2a5857||0xc8;return function(_0x50d05d){if(_0x50d05d){return _0x10bf5c[_0x8af4('0x1c')](_0x2a5857)[_0x8af4('0x1e')](_0x50d05d);}};}function respondWithFilteredResult(_0x5bde74,_0xc3b64a){return function(_0x30d8f9){if(_0x30d8f9){var _0x49908b=typeof _0xc3b64a[_0x8af4('0x1f')]===_0x8af4('0x20')&&typeof _0xc3b64a['limit']===_0x8af4('0x20');var _0x241efc=_0x30d8f9[_0x8af4('0x21')];var _0x29a142=_0x49908b?0x0:_0xc3b64a[_0x8af4('0x1f')];var _0x2f03ad=_0x49908b?_0x30d8f9[_0x8af4('0x21')]:_0xc3b64a[_0x8af4('0x1f')]+_0xc3b64a[_0x8af4('0x22')];var _0x10b944;if(_0x2f03ad>=_0x241efc){_0x2f03ad=_0x241efc;_0x10b944=0xc8;}else{_0x10b944=0xce;}_0x5bde74[_0x8af4('0x1c')](_0x10b944);return _0x5bde74[_0x8af4('0x23')]('Content-Range',_0x29a142+'-'+_0x2f03ad+'/'+_0x241efc)[_0x8af4('0x1e')](_0x30d8f9);}return null;};}function patchUpdates(_0x52be62){return function(_0x199c6b){try{jsonpatch[_0x8af4('0x24')](_0x199c6b,_0x52be62,!![]);}catch(_0x93a3dc){return BPromise['reject'](_0x93a3dc);}return _0x199c6b[_0x8af4('0x25')]();};}function saveUpdates(_0x265174,_0x3041d6){return function(_0x13230e){if(_0x13230e){return _0x13230e[_0x8af4('0x26')](_0x265174)[_0x8af4('0x27')](function(_0xa6f1e3){return _0xa6f1e3;});}return null;};}function removeEntity(_0x170a7a,_0x7c051b){return function(_0x39f879){if(_0x39f879){return _0x39f879['destroy']()['then'](function(){var _0x100dff=_0x39f879['get']({'plain':!![]});var _0x4a34ae=_0x8af4('0x28');return db[_0x8af4('0x29')][_0x8af4('0x2a')]({'where':{'type':_0x4a34ae,'resourceId':_0x100dff['id']}})[_0x8af4('0x27')](function(){return _0x39f879;});})[_0x8af4('0x27')](function(){_0x170a7a[_0x8af4('0x1c')](0xcc)[_0x8af4('0x1d')]();});}};}function handleEntityNotFound(_0x4e1cbb,_0x390012){return function(_0x5adbf3){if(!_0x5adbf3){_0x4e1cbb[_0x8af4('0x1b')](0x194);}return _0x5adbf3;};}function handleError(_0x2e284b,_0x26a9a8){_0x26a9a8=_0x26a9a8||0x1f4;return function(_0x19db12){logger['error'](_0x19db12[_0x8af4('0x2b')]);if(_0x19db12[_0x8af4('0x2c')]){delete _0x19db12[_0x8af4('0x2c')];}_0x2e284b['status'](_0x26a9a8)[_0x8af4('0x2d')](_0x19db12);};}exports[_0x8af4('0x2e')]=function(_0x2aeb7b,_0x69f13b){var _0x5f465b={},_0x2bcf22={},_0x4a99fa={'count':0x0,'rows':[]};var _0x847a6=_[_0x8af4('0x2f')](db[_0x8af4('0x30')][_0x8af4('0x31')],function(_0x5f0c19){return{'name':_0x5f0c19[_0x8af4('0x32')],'type':_0x5f0c19[_0x8af4('0x33')][_0x8af4('0x34')]};});_0x2bcf22[_0x8af4('0x35')]=_[_0x8af4('0x2f')](_0x847a6,_0x8af4('0x2c'));_0x2bcf22[_0x8af4('0x36')]=_[_0x8af4('0x37')](_0x2aeb7b['query']);_0x2bcf22[_0x8af4('0x38')]=_['intersection'](_0x2bcf22[_0x8af4('0x35')],_0x2bcf22[_0x8af4('0x36')]);_0x5f465b[_0x8af4('0x39')]=_['intersection'](_0x2bcf22[_0x8af4('0x35')],qs[_0x8af4('0x3a')](_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x3a')]));_0x5f465b['attributes']=_0x5f465b['attributes'][_0x8af4('0x3b')]?_0x5f465b[_0x8af4('0x39')]:_0x2bcf22[_0x8af4('0x35')];if(!_0x2aeb7b[_0x8af4('0x36')]['hasOwnProperty'](_0x8af4('0x3c'))){_0x5f465b[_0x8af4('0x22')]=qs[_0x8af4('0x22')](_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x22')]);_0x5f465b[_0x8af4('0x1f')]=qs[_0x8af4('0x1f')](_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x1f')]);}_0x5f465b[_0x8af4('0x3d')]=qs[_0x8af4('0x3e')](_0x2aeb7b['query']['sort']);_0x5f465b[_0x8af4('0x3f')]=qs[_0x8af4('0x38')](_[_0x8af4('0x40')](_0x2aeb7b[_0x8af4('0x36')],_0x2bcf22['filters']),_0x847a6);if(_0x2aeb7b['query']['filter']){_0x5f465b[_0x8af4('0x3f')]=_[_0x8af4('0x41')](_0x5f465b[_0x8af4('0x3f')],{'$or':_[_0x8af4('0x2f')](_0x847a6,function(_0x5d5871){if(_0x5d5871[_0x8af4('0x33')]!=='VIRTUAL'){var _0xb7ef86={};_0xb7ef86[_0x5d5871[_0x8af4('0x2c')]]={'$like':'%'+_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x42')]+'%'};return _0xb7ef86;}})});}_0x5f465b=_[_0x8af4('0x41')]({},_0x5f465b,_0x2aeb7b[_0x8af4('0x43')]);var _0x163d6c={'where':_0x5f465b[_0x8af4('0x3f')]};return db[_0x8af4('0x30')][_0x8af4('0x21')](_0x163d6c)['then'](function(_0x257cac){_0x4a99fa[_0x8af4('0x21')]=_0x257cac;if(_0x2aeb7b[_0x8af4('0x36')][_0x8af4('0x44')]){_0x5f465b[_0x8af4('0x45')]=[{'all':!![]}];}return db['CmContactHasItem']['findAll'](_0x5f465b);})[_0x8af4('0x27')](function(_0x5119c0){_0x4a99fa[_0x8af4('0x46')]=_0x5119c0;return _0x4a99fa;})['then'](respondWithFilteredResult(_0x69f13b,_0x5f465b))[_0x8af4('0x47')](handleError(_0x69f13b,null));};exports['show']=function(_0x1e3b62,_0x420535){var _0x4945a7={'raw':!![],'where':{'id':_0x1e3b62[_0x8af4('0x48')]['id']}},_0x19e9e5={};_0x19e9e5[_0x8af4('0x35')]=_[_0x8af4('0x37')](db[_0x8af4('0x30')][_0x8af4('0x31')]);_0x19e9e5[_0x8af4('0x36')]=_[_0x8af4('0x37')](_0x1e3b62[_0x8af4('0x36')]);_0x19e9e5[_0x8af4('0x38')]=_[_0x8af4('0x49')](_0x19e9e5[_0x8af4('0x35')],_0x19e9e5[_0x8af4('0x36')]);_0x4945a7[_0x8af4('0x39')]=_[_0x8af4('0x49')](_0x19e9e5[_0x8af4('0x35')],qs[_0x8af4('0x3a')](_0x1e3b62[_0x8af4('0x36')][_0x8af4('0x3a')]));_0x4945a7[_0x8af4('0x39')]=_0x4945a7[_0x8af4('0x39')][_0x8af4('0x3b')]?_0x4945a7[_0x8af4('0x39')]:_0x19e9e5[_0x8af4('0x35')];if(_0x1e3b62[_0x8af4('0x36')][_0x8af4('0x44')]){_0x4945a7[_0x8af4('0x45')]=[{'all':!![]}];}_0x4945a7=_[_0x8af4('0x41')]({},_0x4945a7,_0x1e3b62[_0x8af4('0x43')]);return db[_0x8af4('0x30')][_0x8af4('0x4a')](_0x4945a7)[_0x8af4('0x27')](handleEntityNotFound(_0x420535,null))[_0x8af4('0x27')](respondWithResult(_0x420535,null))['catch'](handleError(_0x420535,null));};exports[_0x8af4('0x4b')]=function(_0x569d43,_0x5acd0a){return db[_0x8af4('0x30')][_0x8af4('0x4b')](_0x569d43['body'],{})[_0x8af4('0x27')](function(_0x22966b){var _0x238616=_0x569d43['user'][_0x8af4('0x4c')]({'plain':!![]});if(!_0x238616)throw new Error(_0x8af4('0x4d'));if(_0x238616[_0x8af4('0x4e')]===_0x8af4('0x4f')){var _0x56c67e=_0x22966b[_0x8af4('0x4c')]({'plain':!![]});var _0x584fd5='CmContactHasItems';return db['UserProfileSection']['find']({'where':{'name':_0x584fd5,'userProfileId':_0x238616[_0x8af4('0x50')]},'raw':!![]})[_0x8af4('0x27')](function(_0x4167a1){if(_0x4167a1&&_0x4167a1['autoAssociation']===0x0){return db[_0x8af4('0x29')][_0x8af4('0x4b')]({'name':_0x56c67e[_0x8af4('0x2c')],'resourceId':_0x56c67e['id'],'type':_0x4167a1[_0x8af4('0x2c')],'sectionId':_0x4167a1['id']},{})[_0x8af4('0x27')](function(){return _0x22966b;});}else{return _0x22966b;}})[_0x8af4('0x47')](function(_0x12bf6d){logger[_0x8af4('0x51')](_0x8af4('0x52'),_0x12bf6d);throw _0x12bf6d;});}return _0x22966b;})[_0x8af4('0x27')](respondWithResult(_0x5acd0a,0xc9))[_0x8af4('0x47')](handleError(_0x5acd0a,null));};exports[_0x8af4('0x26')]=function(_0x4f2d3e,_0x521375){if(_0x4f2d3e[_0x8af4('0x53')]['id']){delete _0x4f2d3e[_0x8af4('0x53')]['id'];}return db[_0x8af4('0x30')][_0x8af4('0x4a')]({'where':{'id':_0x4f2d3e[_0x8af4('0x48')]['id']}})[_0x8af4('0x27')](handleEntityNotFound(_0x521375,null))['then'](saveUpdates(_0x4f2d3e[_0x8af4('0x53')],null))[_0x8af4('0x27')](respondWithResult(_0x521375,null))['catch'](handleError(_0x521375,null));};exports['destroy']=function(_0x4483b0,_0x380dfc){return db[_0x8af4('0x30')][_0x8af4('0x4a')]({'where':{'id':_0x4483b0['params']['id']}})[_0x8af4('0x27')](handleEntityNotFound(_0x380dfc,null))['then'](removeEntity(_0x380dfc,null))[_0x8af4('0x47')](handleError(_0x380dfc,null));};
\ No newline at end of file
+var _0x0da7=['json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','map','CmContactHasItem','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','catch','fields','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x0da7,0x128));var _0x70da=function(_0x3e1ccd,_0x3d3880){_0x3e1ccd=_0x3e1ccd-0x0;var _0x3e02ed=_0x0da7[_0x3e1ccd];return _0x3e02ed;};'use strict';var emlformat=require(_0x70da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70da('0x1'));var jsonpatch=require(_0x70da('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x70da('0x3'));var Mustache=require(_0x70da('0x4'));var util=require(_0x70da('0x5'));var path=require(_0x70da('0x6'));var sox=require(_0x70da('0x7'));var csv=require('to-csv');var ejs=require(_0x70da('0x8'));var fs=require('fs');var fs_extra=require(_0x70da('0x9'));var _=require(_0x70da('0xa'));var squel=require(_0x70da('0xb'));var crypto=require(_0x70da('0xc'));var jsforce=require(_0x70da('0xd'));var deskjs=require(_0x70da('0xe'));var toCsv=require(_0x70da('0xf'));var querystring=require(_0x70da('0x10'));var Papa=require(_0x70da('0x11'));var Redis=require(_0x70da('0x12'));var authService=require(_0x70da('0x13'));var qs=require(_0x70da('0x14'));var as=require(_0x70da('0x15'));var hardwareService=require(_0x70da('0x16'));var logger=require('../../config/logger')(_0x70da('0x17'));var utils=require(_0x70da('0x18'));var config=require(_0x70da('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a3bb,_0x4bf80f){_0x4bf80f=_0x4bf80f||0xcc;return function(_0x126e7c){if(_0x126e7c){return _0x21a3bb['sendStatus'](_0x4bf80f);}return _0x21a3bb[_0x70da('0x1a')](_0x4bf80f)[_0x70da('0x1b')]();};}function respondWithResult(_0x5d8114,_0x4aa464){_0x4aa464=_0x4aa464||0xc8;return function(_0x1472a5){if(_0x1472a5){return _0x5d8114['status'](_0x4aa464)[_0x70da('0x1c')](_0x1472a5);}};}function respondWithFilteredResult(_0x2acc59,_0x15892b){return function(_0x588c98){if(_0x588c98){var _0x42206a=typeof _0x15892b['offset']===_0x70da('0x1d')&&typeof _0x15892b[_0x70da('0x1e')]===_0x70da('0x1d');var _0x1f10c2=_0x588c98[_0x70da('0x1f')];var _0x3cb4bd=_0x42206a?0x0:_0x15892b[_0x70da('0x20')];var _0x3edd83=_0x42206a?_0x588c98[_0x70da('0x1f')]:_0x15892b[_0x70da('0x20')]+_0x15892b[_0x70da('0x1e')];var _0x1ea37c;if(_0x3edd83>=_0x1f10c2){_0x3edd83=_0x1f10c2;_0x1ea37c=0xc8;}else{_0x1ea37c=0xce;}_0x2acc59[_0x70da('0x1a')](_0x1ea37c);return _0x2acc59[_0x70da('0x21')](_0x70da('0x22'),_0x3cb4bd+'-'+_0x3edd83+'/'+_0x1f10c2)[_0x70da('0x1c')](_0x588c98);}return null;};}function patchUpdates(_0x34787e){return function(_0x334ba7){try{jsonpatch[_0x70da('0x23')](_0x334ba7,_0x34787e,!![]);}catch(_0x324f14){return BPromise['reject'](_0x324f14);}return _0x334ba7[_0x70da('0x24')]();};}function saveUpdates(_0x2249b9,_0x376ab9){return function(_0x15fbd3){if(_0x15fbd3){return _0x15fbd3[_0x70da('0x25')](_0x2249b9)[_0x70da('0x26')](function(_0xf9e1bc){return _0xf9e1bc;});}return null;};}function removeEntity(_0x22ca1b,_0x1fd2dd){return function(_0x31d32c){if(_0x31d32c){return _0x31d32c[_0x70da('0x27')]()[_0x70da('0x26')](function(){var _0x137269=_0x31d32c[_0x70da('0x28')]({'plain':!![]});var _0xf4d04b='CmContactHasItems';return db[_0x70da('0x29')][_0x70da('0x27')]({'where':{'type':_0xf4d04b,'resourceId':_0x137269['id']}})[_0x70da('0x26')](function(){return _0x31d32c;});})[_0x70da('0x26')](function(){_0x22ca1b['status'](0xcc)[_0x70da('0x1b')]();});}};}function handleEntityNotFound(_0x250e15,_0x5964a0){return function(_0x3242ac){if(!_0x3242ac){_0x250e15['sendStatus'](0x194);}return _0x3242ac;};}function handleError(_0x6d292c,_0x51adc0){_0x51adc0=_0x51adc0||0x1f4;return function(_0x13ecec){logger[_0x70da('0x2a')](_0x13ecec[_0x70da('0x2b')]);if(_0x13ecec[_0x70da('0x2c')]){delete _0x13ecec['name'];}_0x6d292c['status'](_0x51adc0)['send'](_0x13ecec);};}exports['index']=function(_0x3986dd,_0x544720){var _0x5edad3={},_0xb1953f={},_0x28572f={'count':0x0,'rows':[]};var _0x1484cd=_[_0x70da('0x2d')](db[_0x70da('0x2e')][_0x70da('0x2f')],function(_0x279a72){return{'name':_0x279a72['fieldName'],'type':_0x279a72[_0x70da('0x30')][_0x70da('0x31')]};});_0xb1953f[_0x70da('0x32')]=_[_0x70da('0x2d')](_0x1484cd,_0x70da('0x2c'));_0xb1953f[_0x70da('0x33')]=_[_0x70da('0x34')](_0x3986dd['query']);_0xb1953f['filters']=_[_0x70da('0x35')](_0xb1953f[_0x70da('0x32')],_0xb1953f[_0x70da('0x33')]);_0x5edad3[_0x70da('0x36')]=_['intersection'](_0xb1953f[_0x70da('0x32')],qs['fields'](_0x3986dd[_0x70da('0x33')]['fields']));_0x5edad3['attributes']=_0x5edad3['attributes'][_0x70da('0x37')]?_0x5edad3[_0x70da('0x36')]:_0xb1953f[_0x70da('0x32')];if(!_0x3986dd['query'][_0x70da('0x38')](_0x70da('0x39'))){_0x5edad3[_0x70da('0x1e')]=qs[_0x70da('0x1e')](_0x3986dd['query'][_0x70da('0x1e')]);_0x5edad3[_0x70da('0x20')]=qs[_0x70da('0x20')](_0x3986dd[_0x70da('0x33')][_0x70da('0x20')]);}_0x5edad3[_0x70da('0x3a')]=qs[_0x70da('0x3b')](_0x3986dd['query']['sort']);_0x5edad3[_0x70da('0x3c')]=qs[_0x70da('0x3d')](_[_0x70da('0x3e')](_0x3986dd['query'],_0xb1953f[_0x70da('0x3d')]),_0x1484cd);if(_0x3986dd[_0x70da('0x33')][_0x70da('0x3f')]){_0x5edad3[_0x70da('0x3c')]=_[_0x70da('0x40')](_0x5edad3['where'],{'$or':_[_0x70da('0x2d')](_0x1484cd,function(_0x2c18e9){if(_0x2c18e9[_0x70da('0x30')]!=='VIRTUAL'){var _0x23c5f6={};_0x23c5f6[_0x2c18e9[_0x70da('0x2c')]]={'$like':'%'+_0x3986dd[_0x70da('0x33')]['filter']+'%'};return _0x23c5f6;}})});}_0x5edad3=_['merge']({},_0x5edad3,_0x3986dd[_0x70da('0x41')]);var _0x27d52e={'where':_0x5edad3[_0x70da('0x3c')]};return db[_0x70da('0x2e')][_0x70da('0x1f')](_0x27d52e)[_0x70da('0x26')](function(_0x242eb0){_0x28572f['count']=_0x242eb0;if(_0x3986dd[_0x70da('0x33')][_0x70da('0x42')]){_0x5edad3[_0x70da('0x43')]=[{'all':!![]}];}return db[_0x70da('0x2e')][_0x70da('0x44')](_0x5edad3);})[_0x70da('0x26')](function(_0x20c0ac){_0x28572f['rows']=_0x20c0ac;return _0x28572f;})[_0x70da('0x26')](respondWithFilteredResult(_0x544720,_0x5edad3))[_0x70da('0x45')](handleError(_0x544720,null));};exports['show']=function(_0x3acc81,_0x3a551f){var _0x2c73d6={'raw':!![],'where':{'id':_0x3acc81['params']['id']}},_0x204983={};_0x204983[_0x70da('0x32')]=_[_0x70da('0x34')](db[_0x70da('0x2e')][_0x70da('0x2f')]);_0x204983['query']=_[_0x70da('0x34')](_0x3acc81[_0x70da('0x33')]);_0x204983['filters']=_['intersection'](_0x204983[_0x70da('0x32')],_0x204983[_0x70da('0x33')]);_0x2c73d6['attributes']=_[_0x70da('0x35')](_0x204983['model'],qs[_0x70da('0x46')](_0x3acc81[_0x70da('0x33')][_0x70da('0x46')]));_0x2c73d6['attributes']=_0x2c73d6[_0x70da('0x36')][_0x70da('0x37')]?_0x2c73d6[_0x70da('0x36')]:_0x204983[_0x70da('0x32')];if(_0x3acc81[_0x70da('0x33')]['includeAll']){_0x2c73d6[_0x70da('0x43')]=[{'all':!![]}];}_0x2c73d6=_[_0x70da('0x40')]({},_0x2c73d6,_0x3acc81['options']);return db[_0x70da('0x2e')]['find'](_0x2c73d6)['then'](handleEntityNotFound(_0x3a551f,null))[_0x70da('0x26')](respondWithResult(_0x3a551f,null))[_0x70da('0x45')](handleError(_0x3a551f,null));};exports[_0x70da('0x47')]=function(_0x34b54c,_0x37efe2){return db[_0x70da('0x2e')][_0x70da('0x47')](_0x34b54c[_0x70da('0x48')],{})[_0x70da('0x26')](function(_0x27aad6){var _0x6422a4=_0x34b54c[_0x70da('0x49')][_0x70da('0x28')]({'plain':!![]});if(!_0x6422a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6422a4[_0x70da('0x4a')]===_0x70da('0x49')){var _0x244669=_0x27aad6[_0x70da('0x28')]({'plain':!![]});var _0xcaace5='CmContactHasItems';return db[_0x70da('0x4b')][_0x70da('0x4c')]({'where':{'name':_0xcaace5,'userProfileId':_0x6422a4[_0x70da('0x4d')]},'raw':!![]})[_0x70da('0x26')](function(_0x2e9e26){if(_0x2e9e26&&_0x2e9e26[_0x70da('0x4e')]===0x0){return db['UserProfileResource'][_0x70da('0x47')]({'name':_0x244669['name'],'resourceId':_0x244669['id'],'type':_0x2e9e26['name'],'sectionId':_0x2e9e26['id']},{})[_0x70da('0x26')](function(){return _0x27aad6;});}else{return _0x27aad6;}})['catch'](function(_0x599b25){logger[_0x70da('0x2a')](_0x70da('0x4f'),_0x599b25);throw _0x599b25;});}return _0x27aad6;})[_0x70da('0x26')](respondWithResult(_0x37efe2,0xc9))[_0x70da('0x45')](handleError(_0x37efe2,null));};exports[_0x70da('0x25')]=function(_0x43b1da,_0x4533dd){if(_0x43b1da[_0x70da('0x48')]['id']){delete _0x43b1da['body']['id'];}return db[_0x70da('0x2e')][_0x70da('0x4c')]({'where':{'id':_0x43b1da['params']['id']}})['then'](handleEntityNotFound(_0x4533dd,null))[_0x70da('0x26')](saveUpdates(_0x43b1da['body'],null))['then'](respondWithResult(_0x4533dd,null))['catch'](handleError(_0x4533dd,null));};exports['destroy']=function(_0x5651ed,_0x2f30ec){return db['CmContactHasItem'][_0x70da('0x4c')]({'where':{'id':_0x5651ed[_0x70da('0x50')]['id']}})[_0x70da('0x26')](handleEntityNotFound(_0x2f30ec,null))[_0x70da('0x26')](removeEntity(_0x2f30ec,null))[_0x70da('0x45')](handleError(_0x2f30ec,null));};
\ No newline at end of file
index 555d2be..ab84d13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4cf=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x49b7e6,_0x536dd0){var _0x231ea5=function(_0x16865b){while(--_0x16865b){_0x49b7e6['push'](_0x49b7e6['shift']());}};_0x231ea5(++_0x536dd0);}(_0xe4cf,0x120));var _0xfe4c=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0xe4cf[_0x4bb1b3];return _0x6b3651;};'use strict';var _=require(_0xfe4c('0x0'));var util=require(_0xfe4c('0x1'));var logger=require(_0xfe4c('0x2'))(_0xfe4c('0x3'));var moment=require(_0xfe4c('0x4'));var BPromise=require(_0xfe4c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfe4c('0x6'));var config=require(_0xfe4c('0x7'));var attributes=require(_0xfe4c('0x8'));module['exports']=function(_0x24daa2,_0x31b355){return _0x24daa2['define']('CmContactHasItem',attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf725=['request-promise','rimraf','./cmContactHasItem.attributes','exports','CmContactHasItem','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x286855,_0x4f518a){var _0x4ddd85=function(_0x325db4){while(--_0x325db4){_0x286855['push'](_0x286855['shift']());}};_0x4ddd85(++_0x4f518a);}(_0xf725,0x14f));var _0x5f72=function(_0x495791,_0x42c570){_0x495791=_0x495791-0x0;var _0x2a5fe8=_0xf725[_0x495791];return _0x2a5fe8;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var logger=require(_0x5f72('0x2'))(_0x5f72('0x3'));var moment=require(_0x5f72('0x4'));var BPromise=require(_0x5f72('0x5'));var rp=require(_0x5f72('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f72('0x7'));var config=require('../../config/environment');var attributes=require(_0x5f72('0x8'));module[_0x5f72('0x9')]=function(_0x363d71,_0x344868){return _0x363d71['define'](_0x5f72('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce41208..f91ea27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb679=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','code','CmContactHasItem,\x20%s,\x20%s','error','message','catch','lodash','util'];(function(_0x4e6dc1,_0x4bda16){var _0x5f1b92=function(_0x136917){while(--_0x136917){_0x4e6dc1['push'](_0x4e6dc1['shift']());}};_0x5f1b92(++_0x4bda16);}(_0xb679,0x1b7));var _0x9b67=function(_0x34758e,_0x4f6593){_0x34758e=_0x34758e-0x0;var _0x410ef3=_0xb679[_0x34758e];return _0x410ef3;};'use strict';var _=require(_0x9b67('0x0'));var util=require(_0x9b67('0x1'));var moment=require(_0x9b67('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b67('0x3'));var fs=require('fs');var Redis=require(_0x9b67('0x4'));var db=require(_0x9b67('0x5'))['db'];var utils=require(_0x9b67('0x6'));var logger=require('../../config/logger')(_0x9b67('0x7'));var config=require(_0x9b67('0x8'));var jayson=require(_0x9b67('0x9'));var client=jayson[_0x9b67('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fd4f3,_0x466c44,_0x165524){return new BPromise(function(_0x557a72,_0x2add10){return client[_0x9b67('0xb')](_0x4fd4f3,_0x165524)[_0x9b67('0xc')](function(_0x5ba58b){logger[_0x9b67('0xd')]('CmContactHasItem,\x20%s,\x20%s',_0x466c44,_0x9b67('0xe'));logger[_0x9b67('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x466c44,_0x9b67('0xe'),JSON['stringify'](_0x5ba58b));if(_0x5ba58b['error']){if(_0x5ba58b['error'][_0x9b67('0x10')]===0x1f4){logger['error'](_0x9b67('0x11'),_0x466c44,_0x5ba58b[_0x9b67('0x12')][_0x9b67('0x13')]);return _0x2add10(_0x5ba58b['error'][_0x9b67('0x13')]);}logger[_0x9b67('0x12')](_0x9b67('0x11'),_0x466c44,_0x5ba58b[_0x9b67('0x12')][_0x9b67('0x13')]);return _0x557a72(_0x5ba58b[_0x9b67('0x12')]['message']);}else{logger[_0x9b67('0xd')](_0x9b67('0x11'),_0x466c44,_0x9b67('0xe'));_0x557a72(_0x5ba58b['result']['message']);}})[_0x9b67('0x14')](function(_0x2fc168){logger[_0x9b67('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x466c44,_0x2fc168);_0x2add10(_0x2fc168);});});}
\ No newline at end of file
+var _0x91fd=['message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmContactHasItem,\x20%s,\x20%s'];(function(_0x5b9d3a,_0x1f1842){var _0x383375=function(_0xd8fa11){while(--_0xd8fa11){_0x5b9d3a['push'](_0x5b9d3a['shift']());}};_0x383375(++_0x1f1842);}(_0x91fd,0x13e));var _0xd91f=function(_0x2904b5,_0x25d24a){_0x2904b5=_0x2904b5-0x0;var _0x237851=_0x91fd[_0x2904b5];return _0x237851;};'use strict';var _=require(_0xd91f('0x0'));var util=require('util');var moment=require(_0xd91f('0x1'));var BPromise=require(_0xd91f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd91f('0x3'));var db=require(_0xd91f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd91f('0x5'))(_0xd91f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd91f('0x7'));var client=jayson[_0xd91f('0x8')][_0xd91f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x438d43,_0x2a0444,_0x118910){return new BPromise(function(_0x263a77,_0x578dae){return client[_0xd91f('0xa')](_0x438d43,_0x118910)[_0xd91f('0xb')](function(_0x365506){logger[_0xd91f('0xc')]('CmContactHasItem,\x20%s,\x20%s',_0x2a0444,_0xd91f('0xd'));logger[_0xd91f('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2a0444,_0xd91f('0xd'),JSON[_0xd91f('0xf')](_0x365506));if(_0x365506[_0xd91f('0x10')]){if(_0x365506[_0xd91f('0x10')]['code']===0x1f4){logger[_0xd91f('0x10')](_0xd91f('0x11'),_0x2a0444,_0x365506[_0xd91f('0x10')][_0xd91f('0x12')]);return _0x578dae(_0x365506[_0xd91f('0x10')]['message']);}logger[_0xd91f('0x10')](_0xd91f('0x11'),_0x2a0444,_0x365506[_0xd91f('0x10')][_0xd91f('0x12')]);return _0x263a77(_0x365506[_0xd91f('0x10')][_0xd91f('0x12')]);}else{logger[_0xd91f('0xc')](_0xd91f('0x11'),_0x2a0444,_0xd91f('0xd'));_0x263a77(_0x365506[_0xd91f('0x13')][_0xd91f('0x12')]);}})[_0xd91f('0x14')](function(_0x2d626a){logger['error'](_0xd91f('0x11'),_0x2a0444,_0x2d626a);_0x578dae(_0x2d626a);});});}
\ No newline at end of file
index 6564b23..d77b8ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb6c=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','index','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xeb6c,0x1a7));var _0xceb6=function(_0x1614a6,_0x4a66cb){_0x1614a6=_0x1614a6-0x0;var _0x4bc4cf=_0xeb6c[_0x1614a6];return _0x4bc4cf;};'use strict';var multer=require(_0xceb6('0x0'));var util=require(_0xceb6('0x1'));var path=require(_0xceb6('0x2'));var timeout=require(_0xceb6('0x3'));var express=require(_0xceb6('0x4'));var router=express[_0xceb6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xceb6('0x6'));var interaction=require(_0xceb6('0x7'));var config=require('../../config/environment');var controller=require(_0xceb6('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xceb6('0x9')]);router[_0xceb6('0xa')](_0xceb6('0xb'),auth[_0xceb6('0xc')](),controller[_0xceb6('0xd')]);router[_0xceb6('0xe')]('/',auth['isAuthenticated'](),controller[_0xceb6('0xf')]);router[_0xceb6('0x10')](_0xceb6('0xb'),auth[_0xceb6('0xc')](),controller[_0xceb6('0x11')]);router[_0xceb6('0x12')](_0xceb6('0xb'),auth[_0xceb6('0xc')](),controller[_0xceb6('0x13')]);module[_0xceb6('0x14')]=router;
\ No newline at end of file
+var _0x0cc3=['destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','/:id','isAuthenticated','create','put','update','delete'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0cc3,0xa2));var _0x30cc=function(_0x1d59b6,_0x331646){_0x1d59b6=_0x1d59b6-0x0;var _0x42a4d4=_0x0cc3[_0x1d59b6];return _0x42a4d4;};'use strict';var multer=require('multer');var util=require(_0x30cc('0x0'));var path=require(_0x30cc('0x1'));var timeout=require('connect-timeout');var express=require(_0x30cc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30cc('0x3'));var interaction=require(_0x30cc('0x4'));var config=require(_0x30cc('0x5'));var controller=require(_0x30cc('0x6'));router[_0x30cc('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x30cc('0x7')](_0x30cc('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x30cc('0x9')](),controller[_0x30cc('0xa')]);router[_0x30cc('0xb')](_0x30cc('0x8'),auth[_0x30cc('0x9')](),controller[_0x30cc('0xc')]);router[_0x30cc('0xd')](_0x30cc('0x8'),auth['isAuthenticated'](),controller[_0x30cc('0xe')]);module[_0x30cc('0xf')]=router;
\ No newline at end of file
index 4824fa9..4553a0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x130d=['name','TEXT','long','type','select','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING'];(function(_0x1adaa9,_0x26efcc){var _0x1ed1f4=function(_0x54f9af){while(--_0x54f9af){_0x1adaa9['push'](_0x1adaa9['shift']());}};_0x1ed1f4(++_0x26efcc);}(_0x130d,0xdd));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd130('0x0'));var _=require(_0xd130('0x1'));module[_0xd130('0x2')]={'name':{'type':Sequelize[_0xd130('0x3')],'get':function(_0x58dc04){return this[_0xd130('0x4')](_0xd130('0x5'));}},'alias':{'type':Sequelize[_0xd130('0x6')],'allowNull':![],'set':function(_0x394571){this['setDataValue'](_0xd130('0x5'),_0x394571?_0x394571:this[_0xd130('0x4')](_0xd130('0x7')));}},'type':{'type':Sequelize[_0xd130('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xd130('0x8')](_0xd130('0x9')),'get':function(){if(this['getDataValue'](_0xd130('0xa'))===_0xd130('0xb')){return JSON['parse'](this[_0xd130('0x4')](_0xd130('0xc')));}else{return this[_0xd130('0x4')](_0xd130('0xc'));}},'set':function(_0x3e4186){if(Array[_0xd130('0xd')](_0x3e4186)){this[_0xd130('0xe')](_0xd130('0xc'),JSON[_0xd130('0xf')](_0x3e4186));}else{this[_0xd130('0xe')](_0xd130('0xc'),_0x3e4186);}}},'required':{'type':Sequelize[_0xd130('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xd130('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xd130('0x11')](_0xd130('0x12'))}};
\ No newline at end of file
+var _0xbde0=['ENUM','voice','sequelize','lodash','getDataValue','STRING','setDataValue','alias','name','TEXT','type','select','parse','values','BOOLEAN'];(function(_0x4c6f32,_0x535f85){var _0x3bcf45=function(_0x526119){while(--_0x526119){_0x4c6f32['push'](_0x4c6f32['shift']());}};_0x3bcf45(++_0x535f85);}(_0xbde0,0x12e));var _0x0bde=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xbde0[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x0bde('0x0'));var _=require(_0x0bde('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3ccf7a){return this[_0x0bde('0x2')]('alias');}},'alias':{'type':Sequelize[_0x0bde('0x3')],'allowNull':![],'set':function(_0x1d43f2){this[_0x0bde('0x4')](_0x0bde('0x5'),_0x1d43f2?_0x1d43f2:this[_0x0bde('0x2')](_0x0bde('0x6')));}},'type':{'type':Sequelize[_0x0bde('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0x0bde('0x7')]('long'),'get':function(){if(this['getDataValue'](_0x0bde('0x8'))===_0x0bde('0x9')){return JSON[_0x0bde('0xa')](this[_0x0bde('0x2')](_0x0bde('0xb')));}else{return this[_0x0bde('0x2')](_0x0bde('0xb'));}},'set':function(_0x2831c0){if(Array['isArray'](_0x2831c0)){this['setDataValue'](_0x0bde('0xb'),JSON['stringify'](_0x2831c0));}else{this[_0x0bde('0x4')](_0x0bde('0xb'),_0x2831c0);}}},'required':{'type':Sequelize[_0x0bde('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x0bde('0xc')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0bde('0xd')](_0x0bde('0xe'))}};
\ No newline at end of file
index 06075eb..f001c62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e91=['CmCustomField','then','include','rows','catch','keys','includeAll','update','body','params','find','create','text','Sequelize','TEXT','INTEGER','switch','BOOLEAN','sequelize','addColumn','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','reject','save','destroy','end','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x8e91,0x1aa));var _0x18e9=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x8e91[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0x18e9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18e9('0x1'));var jsonpatch=require(_0x18e9('0x2'));var rp=require('request-promise');var moment=require(_0x18e9('0x3'));var BPromise=require(_0x18e9('0x4'));var Mustache=require(_0x18e9('0x5'));var util=require(_0x18e9('0x6'));var path=require(_0x18e9('0x7'));var sox=require(_0x18e9('0x8'));var csv=require(_0x18e9('0x9'));var ejs=require(_0x18e9('0xa'));var fs=require('fs');var fs_extra=require(_0x18e9('0xb'));var _=require(_0x18e9('0xc'));var squel=require('squel');var crypto=require(_0x18e9('0xd'));var jsforce=require(_0x18e9('0xe'));var deskjs=require(_0x18e9('0xf'));var toCsv=require(_0x18e9('0x9'));var querystring=require(_0x18e9('0x10'));var Papa=require('papaparse');var Redis=require(_0x18e9('0x11'));var authService=require(_0x18e9('0x12'));var qs=require(_0x18e9('0x13'));var as=require(_0x18e9('0x14'));var hardwareService=require(_0x18e9('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x18e9('0x16'));var config=require(_0x18e9('0x17'));var licenseUtil=require(_0x18e9('0x18'));var db=require(_0x18e9('0x19'))['db'];function respondWithStatusCode(_0x32e30,_0x169bb9){_0x169bb9=_0x169bb9||0xcc;return function(_0x336389){if(_0x336389){return _0x32e30['sendStatus'](_0x169bb9);}return _0x32e30[_0x18e9('0x1a')](_0x169bb9)['end']();};}function respondWithResult(_0x2a64cf,_0x41ea4b){_0x41ea4b=_0x41ea4b||0xc8;return function(_0x328c1e){if(_0x328c1e){return _0x2a64cf[_0x18e9('0x1a')](_0x41ea4b)[_0x18e9('0x1b')](_0x328c1e);}};}function respondWithFilteredResult(_0x1c3ca9,_0x2cbdf7){return function(_0x2528d7){if(_0x2528d7){var _0x47a412=typeof _0x2cbdf7[_0x18e9('0x1c')]==='undefined'&&typeof _0x2cbdf7[_0x18e9('0x1d')]===_0x18e9('0x1e');var _0x12930c=_0x2528d7[_0x18e9('0x1f')];var _0x357f3f=_0x47a412?0x0:_0x2cbdf7[_0x18e9('0x1c')];var _0x5e1996=_0x47a412?_0x2528d7[_0x18e9('0x1f')]:_0x2cbdf7['offset']+_0x2cbdf7[_0x18e9('0x1d')];var _0x2d207e;if(_0x5e1996>=_0x12930c){_0x5e1996=_0x12930c;_0x2d207e=0xc8;}else{_0x2d207e=0xce;}_0x1c3ca9['status'](_0x2d207e);return _0x1c3ca9['set']('Content-Range',_0x357f3f+'-'+_0x5e1996+'/'+_0x12930c)[_0x18e9('0x1b')](_0x2528d7);}return null;};}function patchUpdates(_0x321dc5){return function(_0x329dfc){try{jsonpatch['apply'](_0x329dfc,_0x321dc5,!![]);}catch(_0x59c7df){return BPromise[_0x18e9('0x20')](_0x59c7df);}return _0x329dfc[_0x18e9('0x21')]();};}function saveUpdates(_0x2f3c1c,_0x561f9c){return function(_0xca0bbc){if(_0xca0bbc){return _0xca0bbc['update'](_0x2f3c1c)['then'](function(_0x1b3119){return _0x1b3119;});}return null;};}function removeEntity(_0x28ac5f,_0x8668f6){return function(_0x38e927){if(_0x38e927){return _0x38e927[_0x18e9('0x22')]()['then'](function(){_0x28ac5f[_0x18e9('0x1a')](0xcc)[_0x18e9('0x23')]();});}};}function handleEntityNotFound(_0xe86354,_0x54e479){return function(_0x338847){if(!_0x338847){_0xe86354[_0x18e9('0x24')](0x194);}return _0x338847;};}function handleError(_0x414b71,_0x5eef11){_0x5eef11=_0x5eef11||0x1f4;return function(_0x2dd73c){logger[_0x18e9('0x25')](_0x2dd73c['stack']);if(_0x2dd73c[_0x18e9('0x26')]){delete _0x2dd73c[_0x18e9('0x26')];}_0x414b71[_0x18e9('0x1a')](_0x5eef11)[_0x18e9('0x27')](_0x2dd73c);};}exports[_0x18e9('0x28')]=function(_0x1181d7,_0x109ba3){var _0x112b7d={},_0x43a2bc={},_0x1ebe5a={'count':0x0,'rows':[]};var _0x504ff1=_[_0x18e9('0x29')](db['CmCustomField'][_0x18e9('0x2a')],function(_0x288581){return{'name':_0x288581['fieldName'],'type':_0x288581[_0x18e9('0x2b')][_0x18e9('0x2c')]};});_0x43a2bc[_0x18e9('0x2d')]=_['differenceBy'](_['map'](_0x504ff1,_0x18e9('0x26')),[_0x18e9('0x26')]);_0x43a2bc['query']=_['keys'](_0x1181d7['query']);_0x43a2bc['filters']=_['intersection'](_0x43a2bc[_0x18e9('0x2d')],_0x43a2bc[_0x18e9('0x2e')]);_0x112b7d[_0x18e9('0x2f')]=_[_0x18e9('0x30')](_0x43a2bc['model'],qs[_0x18e9('0x31')](_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x31')]));_0x112b7d['attributes']=_0x112b7d[_0x18e9('0x2f')][_0x18e9('0x32')]?_0x112b7d['attributes']:_0x43a2bc[_0x18e9('0x2d')];if(!_0x1181d7['query'][_0x18e9('0x33')]('nolimit')){_0x112b7d[_0x18e9('0x1d')]=qs[_0x18e9('0x1d')](_0x1181d7[_0x18e9('0x2e')]['limit']);_0x112b7d[_0x18e9('0x1c')]=qs['offset'](_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x1c')]);}_0x112b7d[_0x18e9('0x34')]=qs[_0x18e9('0x35')](_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x35')]);_0x112b7d[_0x18e9('0x36')]=qs[_0x18e9('0x37')](_['pick'](_0x1181d7[_0x18e9('0x2e')],_0x43a2bc['filters']),_0x504ff1);if(_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x38')]){_0x112b7d[_0x18e9('0x36')]=_[_0x18e9('0x39')](_0x112b7d[_0x18e9('0x36')],{'$or':_[_0x18e9('0x29')](_0x504ff1,function(_0x33d214){if(_0x33d214['type']!==_0x18e9('0x3a')){var _0x150598={};_0x150598[_0x33d214['name']]={'$like':'%'+_0x1181d7[_0x18e9('0x2e')][_0x18e9('0x38')]+'%'};return _0x150598;}})});}_0x112b7d=_[_0x18e9('0x39')]({},_0x112b7d,_0x1181d7[_0x18e9('0x3b')]);var _0x203582={'where':_0x112b7d[_0x18e9('0x36')]};return db[_0x18e9('0x3c')]['count'](_0x203582)[_0x18e9('0x3d')](function(_0x132822){_0x1ebe5a['count']=_0x132822;if(_0x1181d7['query']['includeAll']){_0x112b7d[_0x18e9('0x3e')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x112b7d);})[_0x18e9('0x3d')](function(_0x3933b2){_0x1ebe5a[_0x18e9('0x3f')]=_0x3933b2;return _0x1ebe5a;})['then'](respondWithFilteredResult(_0x109ba3,_0x112b7d))[_0x18e9('0x40')](handleError(_0x109ba3,null));};exports['show']=function(_0x42a733,_0x2efc91){var _0x3aa976={'raw':!![],'where':{'id':_0x42a733['params']['id']}},_0xdfea63={};_0xdfea63[_0x18e9('0x2d')]=_[_0x18e9('0x41')](db['CmCustomField'][_0x18e9('0x2a')]);_0xdfea63[_0x18e9('0x2e')]=_['keys'](_0x42a733[_0x18e9('0x2e')]);_0xdfea63[_0x18e9('0x37')]=_['intersection'](_0xdfea63[_0x18e9('0x2d')],_0xdfea63[_0x18e9('0x2e')]);_0x3aa976[_0x18e9('0x2f')]=_['intersection'](_0xdfea63[_0x18e9('0x2d')],qs[_0x18e9('0x31')](_0x42a733[_0x18e9('0x2e')]['fields']));_0x3aa976[_0x18e9('0x2f')]=_0x3aa976[_0x18e9('0x2f')][_0x18e9('0x32')]?_0x3aa976[_0x18e9('0x2f')]:_0xdfea63['model'];if(_0x42a733[_0x18e9('0x2e')][_0x18e9('0x42')]){_0x3aa976[_0x18e9('0x3e')]=[{'all':!![]}];}_0x3aa976=_[_0x18e9('0x39')]({},_0x3aa976,_0x42a733[_0x18e9('0x3b')]);return db[_0x18e9('0x3c')]['find'](_0x3aa976)[_0x18e9('0x3d')](handleEntityNotFound(_0x2efc91,null))['then'](respondWithResult(_0x2efc91,null))[_0x18e9('0x40')](handleError(_0x2efc91,null));};exports[_0x18e9('0x43')]=function(_0x23029a,_0x241559){if(_0x23029a[_0x18e9('0x44')]['id']){delete _0x23029a['body']['id'];}return db[_0x18e9('0x3c')]['find']({'where':{'id':_0x23029a[_0x18e9('0x45')]['id']}})['then'](handleEntityNotFound(_0x241559,null))[_0x18e9('0x3d')](saveUpdates(_0x23029a[_0x18e9('0x44')],null))[_0x18e9('0x3d')](respondWithResult(_0x241559,null))[_0x18e9('0x40')](handleError(_0x241559,null));};exports[_0x18e9('0x22')]=function(_0x4bed9d,_0x4b4099){return db[_0x18e9('0x3c')][_0x18e9('0x46')]({'where':{'id':_0x4bed9d[_0x18e9('0x45')]['id']}})[_0x18e9('0x3d')](handleEntityNotFound(_0x4b4099,null))[_0x18e9('0x3d')](removeEntity(_0x4b4099,null))['catch'](handleError(_0x4b4099,null));};exports[_0x18e9('0x47')]=function(_0x9a71fb,_0x5789e8){var _0x35ad17;return db['sequelize']['transaction'](function(_0x20f885){return db[_0x18e9('0x3c')]['create'](_0x9a71fb['body'],{'transaction':_0x20f885})[_0x18e9('0x3d')](function(_0x660477){_0x35ad17=_0x660477;var _0x2861f6={'type':db['Sequelize']['TEXT'],'transaction':_0x20f885};switch(_0x9a71fb['body'][_0x18e9('0x2b')]){case _0x18e9('0x48'):_0x2861f6[_0x18e9('0x2b')]=db[_0x18e9('0x49')][_0x18e9('0x4a')];break;case'number':_0x2861f6[_0x18e9('0x2b')]=db[_0x18e9('0x49')][_0x18e9('0x4b')];break;case _0x18e9('0x4c'):_0x2861f6[_0x18e9('0x2b')]=db['Sequelize'][_0x18e9('0x4d')];_0x2861f6['defaultValue']=![];break;default:}return db[_0x18e9('0x4e')]['queryInterface'][_0x18e9('0x4f')]('cm_contacts',util['format'](_0x18e9('0x50'),_0x35ad17['id']),_0x2861f6);})[_0x18e9('0x3d')](function(){return _0x35ad17;});})[_0x18e9('0x3d')](respondWithResult(_0x5789e8,0xc9))['catch'](handleError(_0x5789e8,null));};
\ No newline at end of file
+var _0x73bd=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','CmCustomField','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','queryInterface','addColumn','cm_contacts','format','cf_%d'];(function(_0x425be3,_0x78240c){var _0x214d5e=function(_0x54f85e){while(--_0x54f85e){_0x425be3['push'](_0x425be3['shift']());}};_0x214d5e(++_0x78240c);}(_0x73bd,0xf9));var _0xd73b=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x73bd[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xd73b('0x0'));var rimraf=require(_0xd73b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd73b('0x2'));var moment=require(_0xd73b('0x3'));var BPromise=require(_0xd73b('0x4'));var Mustache=require(_0xd73b('0x5'));var util=require(_0xd73b('0x6'));var path=require(_0xd73b('0x7'));var sox=require(_0xd73b('0x8'));var csv=require(_0xd73b('0x9'));var ejs=require(_0xd73b('0xa'));var fs=require('fs');var fs_extra=require(_0xd73b('0xb'));var _=require('lodash');var squel=require(_0xd73b('0xc'));var crypto=require(_0xd73b('0xd'));var jsforce=require(_0xd73b('0xe'));var deskjs=require(_0xd73b('0xf'));var toCsv=require(_0xd73b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd73b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd73b('0x11'));var hardwareService=require(_0xd73b('0x12'));var logger=require(_0xd73b('0x13'))(_0xd73b('0x14'));var utils=require(_0xd73b('0x15'));var config=require(_0xd73b('0x16'));var licenseUtil=require(_0xd73b('0x17'));var db=require(_0xd73b('0x18'))['db'];function respondWithStatusCode(_0x20f26f,_0x55c9be){_0x55c9be=_0x55c9be||0xcc;return function(_0xa53f82){if(_0xa53f82){return _0x20f26f[_0xd73b('0x19')](_0x55c9be);}return _0x20f26f[_0xd73b('0x1a')](_0x55c9be)[_0xd73b('0x1b')]();};}function respondWithResult(_0x1e0f21,_0x5e15a8){_0x5e15a8=_0x5e15a8||0xc8;return function(_0x4207b6){if(_0x4207b6){return _0x1e0f21['status'](_0x5e15a8)[_0xd73b('0x1c')](_0x4207b6);}};}function respondWithFilteredResult(_0x3d2286,_0x3b62f1){return function(_0xb845c0){if(_0xb845c0){var _0x403d2d=typeof _0x3b62f1[_0xd73b('0x1d')]===_0xd73b('0x1e')&&typeof _0x3b62f1[_0xd73b('0x1f')]===_0xd73b('0x1e');var _0x261600=_0xb845c0['count'];var _0xed74a=_0x403d2d?0x0:_0x3b62f1[_0xd73b('0x1d')];var _0x21d4af=_0x403d2d?_0xb845c0[_0xd73b('0x20')]:_0x3b62f1[_0xd73b('0x1d')]+_0x3b62f1[_0xd73b('0x1f')];var _0x9519de;if(_0x21d4af>=_0x261600){_0x21d4af=_0x261600;_0x9519de=0xc8;}else{_0x9519de=0xce;}_0x3d2286[_0xd73b('0x1a')](_0x9519de);return _0x3d2286['set'](_0xd73b('0x21'),_0xed74a+'-'+_0x21d4af+'/'+_0x261600)[_0xd73b('0x1c')](_0xb845c0);}return null;};}function patchUpdates(_0x179859){return function(_0x37f803){try{jsonpatch[_0xd73b('0x22')](_0x37f803,_0x179859,!![]);}catch(_0x46ed81){return BPromise[_0xd73b('0x23')](_0x46ed81);}return _0x37f803[_0xd73b('0x24')]();};}function saveUpdates(_0x21a4a0,_0xc6b276){return function(_0x6f1346){if(_0x6f1346){return _0x6f1346[_0xd73b('0x25')](_0x21a4a0)[_0xd73b('0x26')](function(_0xfb640c){return _0xfb640c;});}return null;};}function removeEntity(_0x18644f,_0x359995){return function(_0x1b7263){if(_0x1b7263){return _0x1b7263['destroy']()[_0xd73b('0x26')](function(){_0x18644f[_0xd73b('0x1a')](0xcc)[_0xd73b('0x1b')]();});}};}function handleEntityNotFound(_0x27fdb5,_0x56f40f){return function(_0x25b519){if(!_0x25b519){_0x27fdb5[_0xd73b('0x19')](0x194);}return _0x25b519;};}function handleError(_0x2d440b,_0x35454c){_0x35454c=_0x35454c||0x1f4;return function(_0xe5eb87){logger[_0xd73b('0x27')](_0xe5eb87[_0xd73b('0x28')]);if(_0xe5eb87['name']){delete _0xe5eb87[_0xd73b('0x29')];}_0x2d440b[_0xd73b('0x1a')](_0x35454c)[_0xd73b('0x2a')](_0xe5eb87);};}exports['index']=function(_0x37d382,_0x503496){var _0xd055d3={},_0x3ebf96={},_0x3d20d5={'count':0x0,'rows':[]};var _0x37180e=_['map'](db[_0xd73b('0x2b')][_0xd73b('0x2c')],function(_0x2d1fcc){return{'name':_0x2d1fcc['fieldName'],'type':_0x2d1fcc[_0xd73b('0x2d')]['key']};});_0x3ebf96[_0xd73b('0x2e')]=_['differenceBy'](_['map'](_0x37180e,_0xd73b('0x29')),['name']);_0x3ebf96[_0xd73b('0x2f')]=_[_0xd73b('0x30')](_0x37d382[_0xd73b('0x2f')]);_0x3ebf96[_0xd73b('0x31')]=_[_0xd73b('0x32')](_0x3ebf96[_0xd73b('0x2e')],_0x3ebf96[_0xd73b('0x2f')]);_0xd055d3[_0xd73b('0x33')]=_[_0xd73b('0x32')](_0x3ebf96[_0xd73b('0x2e')],qs[_0xd73b('0x34')](_0x37d382[_0xd73b('0x2f')][_0xd73b('0x34')]));_0xd055d3[_0xd73b('0x33')]=_0xd055d3[_0xd73b('0x33')][_0xd73b('0x35')]?_0xd055d3[_0xd73b('0x33')]:_0x3ebf96[_0xd73b('0x2e')];if(!_0x37d382[_0xd73b('0x2f')]['hasOwnProperty']('nolimit')){_0xd055d3['limit']=qs[_0xd73b('0x1f')](_0x37d382['query']['limit']);_0xd055d3[_0xd73b('0x1d')]=qs[_0xd73b('0x1d')](_0x37d382[_0xd73b('0x2f')][_0xd73b('0x1d')]);}_0xd055d3[_0xd73b('0x36')]=qs[_0xd73b('0x37')](_0x37d382['query'][_0xd73b('0x37')]);_0xd055d3[_0xd73b('0x38')]=qs[_0xd73b('0x31')](_['pick'](_0x37d382[_0xd73b('0x2f')],_0x3ebf96[_0xd73b('0x31')]),_0x37180e);if(_0x37d382[_0xd73b('0x2f')][_0xd73b('0x39')]){_0xd055d3[_0xd73b('0x38')]=_[_0xd73b('0x3a')](_0xd055d3[_0xd73b('0x38')],{'$or':_['map'](_0x37180e,function(_0x2901b4){if(_0x2901b4[_0xd73b('0x2d')]!==_0xd73b('0x3b')){var _0xd3d015={};_0xd3d015[_0x2901b4[_0xd73b('0x29')]]={'$like':'%'+_0x37d382['query']['filter']+'%'};return _0xd3d015;}})});}_0xd055d3=_[_0xd73b('0x3a')]({},_0xd055d3,_0x37d382[_0xd73b('0x3c')]);var _0x33ad47={'where':_0xd055d3['where']};return db[_0xd73b('0x2b')]['count'](_0x33ad47)[_0xd73b('0x26')](function(_0x141119){_0x3d20d5[_0xd73b('0x20')]=_0x141119;if(_0x37d382['query'][_0xd73b('0x3d')]){_0xd055d3[_0xd73b('0x3e')]=[{'all':!![]}];}return db[_0xd73b('0x2b')][_0xd73b('0x3f')](_0xd055d3);})[_0xd73b('0x26')](function(_0x3cd5c7){_0x3d20d5[_0xd73b('0x40')]=_0x3cd5c7;return _0x3d20d5;})['then'](respondWithFilteredResult(_0x503496,_0xd055d3))[_0xd73b('0x41')](handleError(_0x503496,null));};exports[_0xd73b('0x42')]=function(_0x27beea,_0x9a67b4){var _0xdf3739={'raw':!![],'where':{'id':_0x27beea[_0xd73b('0x43')]['id']}},_0x5f579d={};_0x5f579d[_0xd73b('0x2e')]=_[_0xd73b('0x30')](db[_0xd73b('0x2b')][_0xd73b('0x2c')]);_0x5f579d['query']=_['keys'](_0x27beea['query']);_0x5f579d['filters']=_[_0xd73b('0x32')](_0x5f579d['model'],_0x5f579d[_0xd73b('0x2f')]);_0xdf3739[_0xd73b('0x33')]=_[_0xd73b('0x32')](_0x5f579d['model'],qs[_0xd73b('0x34')](_0x27beea[_0xd73b('0x2f')][_0xd73b('0x34')]));_0xdf3739[_0xd73b('0x33')]=_0xdf3739['attributes'][_0xd73b('0x35')]?_0xdf3739['attributes']:_0x5f579d[_0xd73b('0x2e')];if(_0x27beea[_0xd73b('0x2f')][_0xd73b('0x3d')]){_0xdf3739['include']=[{'all':!![]}];}_0xdf3739=_[_0xd73b('0x3a')]({},_0xdf3739,_0x27beea['options']);return db[_0xd73b('0x2b')][_0xd73b('0x44')](_0xdf3739)[_0xd73b('0x26')](handleEntityNotFound(_0x9a67b4,null))[_0xd73b('0x26')](respondWithResult(_0x9a67b4,null))[_0xd73b('0x41')](handleError(_0x9a67b4,null));};exports[_0xd73b('0x25')]=function(_0x4052c4,_0x44c3a8){if(_0x4052c4['body']['id']){delete _0x4052c4[_0xd73b('0x45')]['id'];}return db[_0xd73b('0x2b')][_0xd73b('0x44')]({'where':{'id':_0x4052c4['params']['id']}})['then'](handleEntityNotFound(_0x44c3a8,null))[_0xd73b('0x26')](saveUpdates(_0x4052c4[_0xd73b('0x45')],null))['then'](respondWithResult(_0x44c3a8,null))[_0xd73b('0x41')](handleError(_0x44c3a8,null));};exports['destroy']=function(_0x14f497,_0x40c7e5){return db['CmCustomField'][_0xd73b('0x44')]({'where':{'id':_0x14f497[_0xd73b('0x43')]['id']}})[_0xd73b('0x26')](handleEntityNotFound(_0x40c7e5,null))['then'](removeEntity(_0x40c7e5,null))[_0xd73b('0x41')](handleError(_0x40c7e5,null));};exports[_0xd73b('0x46')]=function(_0xdbc16e,_0x3ab949){var _0x7c699f;return db[_0xd73b('0x47')][_0xd73b('0x48')](function(_0x111ee3){return db[_0xd73b('0x2b')][_0xd73b('0x46')](_0xdbc16e[_0xd73b('0x45')],{'transaction':_0x111ee3})['then'](function(_0x20acb6){_0x7c699f=_0x20acb6;var _0x136e94={'type':db[_0xd73b('0x49')][_0xd73b('0x4a')],'transaction':_0x111ee3};switch(_0xdbc16e[_0xd73b('0x45')]['type']){case _0xd73b('0x4b'):_0x136e94[_0xd73b('0x2d')]=db[_0xd73b('0x49')][_0xd73b('0x4a')];break;case'number':_0x136e94[_0xd73b('0x2d')]=db[_0xd73b('0x49')][_0xd73b('0x4c')];break;case _0xd73b('0x4d'):_0x136e94[_0xd73b('0x2d')]=db[_0xd73b('0x49')]['BOOLEAN'];_0x136e94['defaultValue']=![];break;default:}return db[_0xd73b('0x47')][_0xd73b('0x4e')][_0xd73b('0x4f')](_0xd73b('0x50'),util[_0xd73b('0x51')](_0xd73b('0x52'),_0x7c699f['id']),_0x136e94);})[_0xd73b('0x26')](function(){return _0x7c699f;});})['then'](respondWithResult(_0x3ab949,0xc9))[_0xd73b('0x41')](handleError(_0x3ab949,null));};
\ No newline at end of file
index 150dbd0..2c45ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63b1=['rimraf','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x63b1,0x1a5));var _0x163b=function(_0x4892da,_0x5cb928){_0x4892da=_0x4892da-0x0;var _0x15c412=_0x63b1[_0x4892da];return _0x15c412;};'use strict';var _=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var logger=require(_0x163b('0x2'))(_0x163b('0x3'));var moment=require(_0x163b('0x4'));var BPromise=require(_0x163b('0x5'));var rp=require(_0x163b('0x6'));var fs=require('fs');var path=require(_0x163b('0x7'));var rimraf=require(_0x163b('0x8'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x522d34,_0x44df16){return _0x522d34['define'](_0x163b('0x9'),attributes,{'tableName':_0x163b('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x083f=['bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','define','cm_custom_fields','moment'];(function(_0x588011,_0x5e9d11){var _0x3b3773=function(_0x4cca54){while(--_0x4cca54){_0x588011['push'](_0x588011['shift']());}};_0x3b3773(++_0x5e9d11);}(_0x083f,0x15f));var _0xf083=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x083f[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf083('0x0'));var BPromise=require(_0xf083('0x1'));var rp=require(_0xf083('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf083('0x3'));var config=require(_0xf083('0x4'));var attributes=require(_0xf083('0x5'));module['exports']=function(_0x5172fe,_0x2bd8e2){return _0x5172fe[_0xf083('0x6')]('CmCustomField',attributes,{'tableName':_0xf083('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fd5a0c1..3790b56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cdb=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util'];(function(_0x4d67b8,_0x565134){var _0x55af3b=function(_0x145904){while(--_0x145904){_0x4d67b8['push'](_0x4d67b8['shift']());}};_0x55af3b(++_0x565134);}(_0x3cdb,0xa6));var _0xb3cd=function(_0x148c09,_0x4fd39f){_0x148c09=_0x148c09-0x0;var _0x18e613=_0x3cdb[_0x148c09];return _0x18e613;};'use strict';var _=require(_0xb3cd('0x0'));var util=require(_0xb3cd('0x1'));var moment=require(_0xb3cd('0x2'));var BPromise=require(_0xb3cd('0x3'));var rs=require(_0xb3cd('0x4'));var fs=require('fs');var Redis=require(_0xb3cd('0x5'));var db=require(_0xb3cd('0x6'))['db'];var utils=require(_0xb3cd('0x7'));var logger=require(_0xb3cd('0x8'))('rpc');var config=require(_0xb3cd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb3cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32185c,_0x2fabd3,_0x108b23){return new BPromise(function(_0x183908,_0x58229d){return client[_0xb3cd('0xb')](_0x32185c,_0x108b23)['then'](function(_0x16c47f){logger[_0xb3cd('0xc')](_0xb3cd('0xd'),_0x2fabd3,_0xb3cd('0xe'));logger[_0xb3cd('0xf')](_0xb3cd('0x10'),_0x2fabd3,_0xb3cd('0xe'),JSON[_0xb3cd('0x11')](_0x16c47f));if(_0x16c47f[_0xb3cd('0x12')]){if(_0x16c47f[_0xb3cd('0x12')][_0xb3cd('0x13')]===0x1f4){logger[_0xb3cd('0x12')](_0xb3cd('0xd'),_0x2fabd3,_0x16c47f[_0xb3cd('0x12')]['message']);return _0x58229d(_0x16c47f[_0xb3cd('0x12')][_0xb3cd('0x14')]);}logger[_0xb3cd('0x12')](_0xb3cd('0xd'),_0x2fabd3,_0x16c47f[_0xb3cd('0x12')]['message']);return _0x183908(_0x16c47f['error'][_0xb3cd('0x14')]);}else{logger[_0xb3cd('0xc')](_0xb3cd('0xd'),_0x2fabd3,_0xb3cd('0xe'));_0x183908(_0x16c47f['result'][_0xb3cd('0x14')]);}})['catch'](function(_0x5d3877){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2fabd3,_0x5d3877);_0x58229d(_0x5d3877);});});}
\ No newline at end of file
+var _0x186f=['jayson/promise','http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x24e40d,_0x379ad2){var _0x368bf3=function(_0x2d1ff4){while(--_0x2d1ff4){_0x24e40d['push'](_0x24e40d['shift']());}};_0x368bf3(++_0x379ad2);}(_0x186f,0x70));var _0xf186=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x186f[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xf186('0x0'));var util=require('util');var moment=require(_0xf186('0x1'));var BPromise=require(_0xf186('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf186('0x3'));var db=require(_0xf186('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf186('0x5'))(_0xf186('0x6'));var config=require(_0xf186('0x7'));var jayson=require(_0xf186('0x8'));var client=jayson['client'][_0xf186('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x306aea,_0x4b9ed0,_0x486e55){return new BPromise(function(_0x574546,_0x21bf6f){return client[_0xf186('0xa')](_0x306aea,_0x486e55)['then'](function(_0x58dec2){logger[_0xf186('0xb')]('CmCustomField,\x20%s,\x20%s',_0x4b9ed0,_0xf186('0xc'));logger[_0xf186('0xd')](_0xf186('0xe'),_0x4b9ed0,_0xf186('0xc'),JSON['stringify'](_0x58dec2));if(_0x58dec2['error']){if(_0x58dec2[_0xf186('0xf')]['code']===0x1f4){logger[_0xf186('0xf')](_0xf186('0x10'),_0x4b9ed0,_0x58dec2['error']['message']);return _0x21bf6f(_0x58dec2[_0xf186('0xf')][_0xf186('0x11')]);}logger[_0xf186('0xf')](_0xf186('0x10'),_0x4b9ed0,_0x58dec2['error']['message']);return _0x574546(_0x58dec2[_0xf186('0xf')][_0xf186('0x11')]);}else{logger[_0xf186('0xb')]('CmCustomField,\x20%s,\x20%s',_0x4b9ed0,_0xf186('0xc'));_0x574546(_0x58dec2[_0xf186('0x12')][_0xf186('0x11')]);}})[_0xf186('0x13')](function(_0x591430){logger[_0xf186('0xf')](_0xf186('0x10'),_0x4b9ed0,_0x591430);_0x21bf6f(_0x591430);});});}
\ No newline at end of file
index 7a38b41..32271f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f53=['index','/:id','show','post','create','update','delete','destroy','multer','util','path','Router','fs-extra','./cmCustomField.controller','get','isAuthenticated'];(function(_0xad6ff1,_0x3ffe70){var _0x28c697=function(_0x15732b){while(--_0x15732b){_0xad6ff1['push'](_0xad6ff1['shift']());}};_0x28c697(++_0x3ffe70);}(_0x8f53,0x128));var _0x38f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f53[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x38f5('0x0'));var util=require(_0x38f5('0x1'));var path=require(_0x38f5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x38f5('0x3')]();var fs_extra=require(_0x38f5('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x38f5('0x5'));router[_0x38f5('0x6')]('/',auth[_0x38f5('0x7')](),controller[_0x38f5('0x8')]);router[_0x38f5('0x6')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xa')]);router[_0x38f5('0xb')]('/',auth['isAuthenticated'](),controller[_0x38f5('0xc')]);router['put']('/:id',auth[_0x38f5('0x7')](),controller[_0x38f5('0xd')]);router[_0x38f5('0xe')](_0x38f5('0x9'),auth[_0x38f5('0x7')](),controller[_0x38f5('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf873=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','util','path'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0xf873,0xb2));var _0x3f87=function(_0x3066c0,_0x58b8ce){_0x3066c0=_0x3066c0-0x0;var _0x5612b7=_0xf873[_0x3066c0];return _0x5612b7;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var fs_extra=require(_0x3f87('0x5'));var auth=require(_0x3f87('0x6'));var interaction=require(_0x3f87('0x7'));var config=require(_0x3f87('0x8'));var controller=require('./cmCustomField.controller');router[_0x3f87('0x9')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xb')]);router['get'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0xd')]);router[_0x3f87('0xe')]('/',auth[_0x3f87('0xa')](),controller[_0x3f87('0xf')]);router['put'](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x10')]);router[_0x3f87('0x11')](_0x3f87('0xc'),auth[_0x3f87('0xa')](),controller[_0x3f87('0x12')]);module[_0x3f87('0x13')]=router;
\ No newline at end of file
index 47aff00..260838e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e3=['sequelize','STRING','BOOLEAN','DATE','format','INTEGER','UNSIGNED','contactListQueue'];(function(_0x3cf5c7,_0x1eb319){var _0xf3d981=function(_0x3521ef){while(--_0x3521ef){_0x3cf5c7['push'](_0x3cf5c7['shift']());}};_0xf3d981(++_0x1eb319);}(_0xc4e3,0x90));var _0x3c4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4e3[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x3c4e('0x0'));module['exports']={'phone':{'type':Sequelize[_0x3c4e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x3c4e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x3c4e('0x3')],'defaultValue':moment()[_0x3c4e('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3c4e('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3c4e('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x3c4e('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3c4e('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3c4e('0x5')],'unique':_0x3c4e('0x7')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x3c4e('0x5')],'unique':_0x3c4e('0x7')},'CampaignId':{'type':Sequelize[_0x3c4e('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3c4e('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3c4e('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3c4e('0x1')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3c4e('0x3')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x758b=['STRING','BOOLEAN','DATE','format','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x210d7f,_0x2abe4f){var _0x42d687=function(_0x46b2ae){while(--_0x46b2ae){_0x210d7f['push'](_0x210d7f['shift']());}};_0x42d687(++_0x2abe4f);}(_0x758b,0x96));var _0xb758=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x758b[_0x2a6809];return _0x11c371;};'use strict';var moment=require(_0xb758('0x0'));var Sequelize=require(_0xb758('0x1'));module[_0xb758('0x2')]={'phone':{'type':Sequelize[_0xb758('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xb758('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb758('0x5')],'defaultValue':moment()[_0xb758('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb758('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb758('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb758('0x5')]},'priority':{'type':Sequelize[_0xb758('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb758('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb758('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb758('0x7')],'unique':_0xb758('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb758('0x7')],'unique':_0xb758('0x8')},'CampaignId':{'type':Sequelize[_0xb758('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb758('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb758('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb758('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb758('0x5')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 83d11bd..1d2de9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6737=['$ne','$eq','$not','$between','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','CmHopper','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','omit','createdAt','updatedAt','state','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','CmContact','firstName','calleridname','isNil','lastName','finally','CmHopperFinal','end','getVoiceQueues','preview','dialPreviewAutoRecallMe','sequelize','transaction','value','direction','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','literal','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','ASC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','dialActive','recallme','CmCompany','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','limit','count','offset','set','Content-Range','json','update','then','sendStatus','error','stack','send','rawAttributes','type','key','model','map','name','query','filters','intersection','$and','$or','$gt','$gte','$lt'];(function(_0x3bc536,_0x2701fc){var _0x3b9ce0=function(_0x469e05){while(--_0x469e05){_0x3bc536['push'](_0x3bc536['shift']());}};_0x3b9ce0(++_0x2701fc);}(_0x6737,0xe2));var _0x7673=function(_0x2325da,_0x260753){_0x2325da=_0x2325da-0x0;var _0x2a64bd=_0x6737[_0x2325da];return _0x2a64bd;};'use strict';var moment=require('moment');var _=require(_0x7673('0x0'));var qs=require(_0x7673('0x1'));var logger=require('../../config/logger')(_0x7673('0x2'));var shared=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];function respondWithResult(_0x12efff,_0x54002e){_0x54002e=_0x54002e||0xc8;return function(_0x32e6f2){if(_0x32e6f2){return _0x12efff[_0x7673('0x5')](_0x54002e)['json'](_0x32e6f2);}};}function respondWithFilteredResult(_0x2f5edc,_0x15230f){return function(_0x5af802){if(_0x5af802){var _0x4e4b24=typeof _0x15230f['offset']==='undefined'&&typeof _0x15230f[_0x7673('0x6')]==='undefined';var _0x3b3184=_0x5af802[_0x7673('0x7')];var _0x5bfae2=_0x4e4b24?0x0:_0x15230f[_0x7673('0x8')];var _0x331f57=_0x4e4b24?_0x5af802[_0x7673('0x7')]:_0x15230f['offset']+_0x15230f['limit'];var _0x3ca258;if(_0x331f57>=_0x3b3184){_0x331f57=_0x3b3184;_0x3ca258=0xc8;}else{_0x3ca258=0xce;}_0x2f5edc['status'](_0x3ca258);return _0x2f5edc[_0x7673('0x9')](_0x7673('0xa'),_0x5bfae2+'-'+_0x331f57+'/'+_0x3b3184)[_0x7673('0xb')](_0x5af802);}return null;};}function saveUpdates(_0x451c87,_0x41d6bd){return function(_0x119e42){if(_0x119e42){return _0x119e42[_0x7673('0xc')](_0x451c87)[_0x7673('0xd')](function(_0x1da115){return _0x1da115;});}return null;};}function handleEntityNotFound(_0x20a649,_0x5c8626){return function(_0x26f0c4){if(!_0x26f0c4){_0x20a649[_0x7673('0xe')](0x194);}return _0x26f0c4;};}function handleError(_0x408470,_0x2c83d){_0x2c83d=_0x2c83d||0x1f4;return function(_0x224cea){logger[_0x7673('0xf')](_0x224cea[_0x7673('0x10')]);if(_0x224cea['name']){delete _0x224cea['name'];}_0x408470[_0x7673('0x5')](_0x2c83d)[_0x7673('0x11')](_0x224cea);};}exports['index']=function(_0x3afbb3,_0x17699a){var _0x58a821={},_0x33ff7d={},_0x44704d={'count':0x0,'rows':[]};var _0x1015ba=_['map'](db['CmHopper'][_0x7673('0x12')],function(_0x267fa3){return{'name':_0x267fa3['fieldName'],'type':_0x267fa3[_0x7673('0x13')][_0x7673('0x14')]};});_0x33ff7d[_0x7673('0x15')]=_[_0x7673('0x16')](_0x1015ba,_0x7673('0x17'));_0x33ff7d[_0x7673('0x18')]=_['keys'](_0x3afbb3['query']);_0x33ff7d[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],_0x33ff7d[_0x7673('0x18')]);_0x33ff7d[_0x7673('0x19')]=_['concat'](_0x33ff7d[_0x7673('0x19')],[_0x7673('0x1b'),_0x7673('0x1c'),_0x7673('0x1d'),_0x7673('0x1e'),_0x7673('0x1f'),'$lte',_0x7673('0x20'),_0x7673('0x21'),_0x7673('0x22'),_0x7673('0x23'),'$notBetween','$in',_0x7673('0x24'),_0x7673('0x25'),_0x7673('0x26'),_0x7673('0x27'),_0x7673('0x28'),_0x7673('0x25'),_0x7673('0x29'),'$contains','$contained',_0x7673('0x2a')]);_0x58a821[_0x7673('0x2b')]=_[_0x7673('0x1a')](_0x33ff7d[_0x7673('0x15')],qs[_0x7673('0x2c')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x2c')]));_0x58a821['attributes']=_0x58a821['attributes'][_0x7673('0x2d')]?_0x58a821[_0x7673('0x2b')]:_0x33ff7d[_0x7673('0x15')];if(!_0x3afbb3[_0x7673('0x18')]['hasOwnProperty'](_0x7673('0x2e'))){_0x58a821['limit']=qs[_0x7673('0x6')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x6')]);_0x58a821[_0x7673('0x8')]=qs[_0x7673('0x8')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x8')]);}_0x58a821[_0x7673('0x2f')]=qs[_0x7673('0x30')](_0x3afbb3[_0x7673('0x18')][_0x7673('0x30')]);_0x58a821[_0x7673('0x31')]=qs[_0x7673('0x19')](_['pick'](_0x3afbb3[_0x7673('0x18')],_0x33ff7d[_0x7673('0x19')]),_0x1015ba);if(_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]){_0x58a821[_0x7673('0x31')]=_[_0x7673('0x33')](_0x58a821[_0x7673('0x31')],{'$or':_['map'](_0x1015ba,function(_0x563e2d){if(_0x563e2d[_0x7673('0x13')]!==_0x7673('0x34')){var _0x2d34cb={};_0x2d34cb[_0x563e2d[_0x7673('0x17')]]={'$like':'%'+_0x3afbb3[_0x7673('0x18')][_0x7673('0x32')]+'%'};return _0x2d34cb;}})});}_0x58a821=_[_0x7673('0x33')]({},_0x58a821,_0x3afbb3['options']);var _0x2845f6={'where':_0x58a821[_0x7673('0x31')]};return db['CmHopper'][_0x7673('0x7')](_0x2845f6)[_0x7673('0xd')](function(_0x287eee){_0x44704d[_0x7673('0x7')]=_0x287eee;if(_0x3afbb3['query'][_0x7673('0x35')]){_0x58a821[_0x7673('0x36')]=[{'all':!![]}];}return db['CmHopper'][_0x7673('0x37')](_0x58a821);})[_0x7673('0xd')](function(_0x1be04a){_0x44704d['rows']=_0x1be04a;return _0x44704d;})[_0x7673('0xd')](respondWithFilteredResult(_0x17699a,_0x58a821))[_0x7673('0x38')](handleError(_0x17699a,null));};exports[_0x7673('0x39')]=function(_0x5dfb9a,_0x4c6106){var _0x13ce30={'raw':!![],'where':{'id':_0x5dfb9a['params']['id']}},_0x5efdf6={};_0x5efdf6[_0x7673('0x15')]=_[_0x7673('0x3a')](db['CmHopper'][_0x7673('0x12')]);_0x5efdf6[_0x7673('0x18')]=_[_0x7673('0x3a')](_0x5dfb9a[_0x7673('0x18')]);_0x5efdf6[_0x7673('0x19')]=_[_0x7673('0x1a')](_0x5efdf6['model'],_0x5efdf6[_0x7673('0x18')]);_0x13ce30['attributes']=_[_0x7673('0x1a')](_0x5efdf6['model'],qs[_0x7673('0x2c')](_0x5dfb9a[_0x7673('0x18')]['fields']));_0x13ce30['attributes']=_0x13ce30[_0x7673('0x2b')]['length']?_0x13ce30[_0x7673('0x2b')]:_0x5efdf6[_0x7673('0x15')];if(_0x5dfb9a[_0x7673('0x18')][_0x7673('0x35')]){_0x13ce30[_0x7673('0x36')]=[{'all':!![]}];}_0x13ce30=_['merge']({},_0x13ce30,_0x5dfb9a['options']);return db[_0x7673('0x3b')][_0x7673('0x3c')](_0x13ce30)['then'](handleEntityNotFound(_0x4c6106,null))[_0x7673('0xd')](respondWithResult(_0x4c6106,null))[_0x7673('0x38')](handleError(_0x4c6106,null));};exports[_0x7673('0x3d')]=function(_0x5991d7,_0x1a9017){return db[_0x7673('0x3b')][_0x7673('0x3d')](_0x5991d7[_0x7673('0x3e')],{})[_0x7673('0xd')](respondWithResult(_0x1a9017,0xc9))[_0x7673('0x38')](handleError(_0x1a9017,null));};exports[_0x7673('0xc')]=function(_0x232576,_0x58e17d){if(_0x232576['body']['id']){delete _0x232576[_0x7673('0x3e')]['id'];}return db[_0x7673('0x3b')][_0x7673('0x3c')]({'where':{'id':_0x232576[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x58e17d,null))[_0x7673('0xd')](saveUpdates(_0x232576[_0x7673('0x3e')],null))['then'](respondWithResult(_0x58e17d,null))[_0x7673('0x38')](handleError(_0x58e17d,null));};exports[_0x7673('0x40')]=function(_0x461ac3,_0x2de2e9){return db[_0x7673('0x3b')]['describe']()[_0x7673('0xd')](respondWithResult(_0x2de2e9,null))[_0x7673('0x38')](handleError(_0x2de2e9,null));};exports[_0x7673('0x41')]=function(_0x2397fb,_0x3f76a3){var _0x4c022d;var _0x56cd7a=_0x2397fb[_0x7673('0x3f')]['id'];return db[_0x7673('0x3b')]['find']({'where':{'id':_0x2397fb[_0x7673('0x3f')]['id']}})[_0x7673('0xd')](handleEntityNotFound(_0x3f76a3,null))[_0x7673('0xd')](function(_0x32a5e7){if(_0x32a5e7){return _0x32a5e7[_0x7673('0x41')]()['then'](function(_0x23789d){return _0x23789d;});}})[_0x7673('0xd')](function(_0x2a275b){_0x4c022d=_0x2a275b;if(_0x2a275b){if(_0x2a275b[_0x7673('0x42')]||_0x2a275b['CampaignId']){return db[_0x2a275b[_0x7673('0x42')]?_0x7673('0x43'):_0x7673('0x44')][_0x7673('0x3c')]({'where':{'id':_0x2a275b[_0x7673('0x42')]?_0x2a275b[_0x7673('0x42')]:_0x2a275b[_0x7673('0x45')]},'attributes':['id',_0x7673('0x17')],'raw':!![]});}}})[_0x7673('0xd')](function(_0x362409){var _0xcb9e0b={};if(_0x362409){_['merge'](_0xcb9e0b,_[_0x7673('0x46')](_0x4c022d['dataValues'],[_0x7673('0x47'),_0x7673('0x48'),'id']));_0xcb9e0b[_0x7673('0x49')]=0x15;_0xcb9e0b['statedesc']=_0x7673('0x4a');_0xcb9e0b[_0x7673('0x4b')]=_0x362409[_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4c')]=_0x2397fb[_0x7673('0x4d')][_0x7673('0x17')];_0xcb9e0b[_0x7673('0x4e')]=_0x2397fb[_0x7673('0x4d')]['id'];_0xcb9e0b[_0x7673('0x4a')]=!![];_0xcb9e0b[_0x7673('0x4f')]=moment()[_0x7673('0x50')](_0x7673('0x51'));_0xcb9e0b[_0x7673('0x52')]=_0x4c022d[_0x7673('0x53')];_0xcb9e0b['campaigntype']=_0x4c022d[_0x7673('0x42')]?'queue':_0x7673('0x54');return db[_0x7673('0x55')][_0x7673('0x3c')]({'where':{'id':_0xcb9e0b['ContactId']},'attributes':[_0x7673('0x56'),'lastName']})['then'](function(_0x1804a4){if(!_['isNil'](_0x3f76a3)&&!_['isNil'](_0x1804a4[_0x7673('0x56')])){_0xcb9e0b[_0x7673('0x57')]=_0x1804a4[_0x7673('0x56')];if(!_[_0x7673('0x58')](_0x1804a4[_0x7673('0x59')])){_0xcb9e0b[_0x7673('0x57')]+='\x20'+_0x1804a4[_0x7673('0x59')];}}})[_0x7673('0x5a')](function(){return db[_0x7673('0x5b')][_0x7673('0x3d')](_0xcb9e0b);});}})[_0x7673('0xd')](function(_0x5e1985){return db['CmHopperAdditionalPhone'][_0x7673('0x41')]({'where':{'CmHopperId':_0x56cd7a}});})[_0x7673('0xd')](function(){return _0x3f76a3[_0x7673('0x5')](0xcc)[_0x7673('0x5c')]();})[_0x7673('0x38')](handleError(_0x3f76a3,null));};exports['getPreview']=function(_0x5caca9,_0x44fa26){var _0x7ac2d=[];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x47b5b3){_0x7ac2d=_[_0x7673('0x3a')](_0x47b5b3);return _0x5caca9[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id','dialOrderByScheduledAt',_0x7673('0x5f')],'raw':!![]});})[_0x7673('0xd')](function(_0x31be3a){if(_0x31be3a&&_0x31be3a['length']){return db[_0x7673('0x60')][_0x7673('0x61')](function(_0x562a20){var _0x53c638={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x31be3a,'id')},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x40776d={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x31be3a)['filter']([_0x7673('0x5f'),0x0])['map']('id')[_0x7673('0x62')]()},'$or':[{'UserId':null},{'UserId':_0x5caca9[_0x7673('0x4d')]['id']}]};var _0x12cfe7={'$or':[_0x53c638,_0x40776d]};var _0x2a8feb=[];if(_0x5caca9['body'][_0x7673('0x63')]&&_0x5caca9[_0x7673('0x3e')][_0x7673('0x63')]==='prev'){if(!_['isEmpty'](_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')])){_0x12cfe7['id']={'$in':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'ASC'],[_0x7673('0x66'),_0x31be3a[0x0][_0x7673('0x67')]==='ASC'?'DESC':'ASC'],db[_0x7673('0x60')][_0x7673('0x68')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x7673('0x69')]];}else{if(!_['isEmpty'](_0x5caca9['body'][_0x7673('0x64')])){_0x12cfe7['id']={'$notIn':_0x5caca9[_0x7673('0x3e')][_0x7673('0x64')]};}_0x2a8feb=[[_0x7673('0x65'),'DESC'],[_0x7673('0x66'),_0x31be3a[0x0]['dialOrderByScheduledAt']],db[_0x7673('0x60')][_0x7673('0x68')](_0x7673('0x6a')),['id',_0x7673('0x6b')]];}return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),'phone','recallme'],'where':_0x12cfe7,'order':_0x2a8feb,'transaction':_0x562a20,'lock':_0x562a20[_0x7673('0x6e')][_0x7673('0x6f')],'include':[{'model':db[_0x7673('0x55')],'as':_0x7673('0x70'),'attributes':_0x7ac2d,'include':[{'model':db['CmCompany'],'as':_0x7673('0x71'),'attributes':['id',_0x7673('0x17')]}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id',_0x7673('0x17'),_0x7673('0x75')]}]})['then'](function(_0x376f42){if(_0x376f42){return _0x376f42[_0x7673('0xc')]({'UserId':_0x5caca9[_0x7673('0x4d')]['id']},{'transaction':_0x562a20});}});});}})[_0x7673('0xd')](handleEntityNotFound(_0x44fa26,null))[_0x7673('0xd')](respondWithResult(_0x44fa26,null))[_0x7673('0x38')](handleError(_0x44fa26,null));};exports['getPreviewRecall']=function(_0xc74a16,_0x36a751,_0xc6660d){var _0x413d2a=[];var _0x1a32e3=_0xc74a16[_0x7673('0x3f')]['id'];var _0x533e5b=_0xc74a16[_0x7673('0x4d')]['id'];return db[_0x7673('0x55')][_0x7673('0x40')]()[_0x7673('0xd')](function(_0x52de39){_0x413d2a=_[_0x7673('0x3a')](_0x52de39);return db[_0x7673('0x60')][_0x7673('0x61')](function(_0xc4e03e){const _0xfed5e5={'id':_0x1a32e3};return db[_0x7673('0x3b')][_0x7673('0x6c')]({'attributes':['id',_0x7673('0x6d'),_0x7673('0x76')],'where':_0xfed5e5,'transaction':_0xc4e03e,'lock':_0xc4e03e[_0x7673('0x6e')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x7673('0x70'),'attributes':_0x413d2a,'include':[{'model':db[_0x7673('0x77')],'as':_0x7673('0x71'),'attributes':['id','name']}]},{'model':db[_0x7673('0x72')],'as':_0x7673('0x73'),'attributes':['id',_0x7673('0x17')]},{'model':db['VoiceQueue'],'as':_0x7673('0x74'),'attributes':['id','name',_0x7673('0x75')]}]})[_0x7673('0xd')](function(_0x4c7b28){if(_0x4c7b28){return _0x4c7b28['update']({'UserId':_0x533e5b},{'transaction':_0xc4e03e});}});});})[_0x7673('0xd')](handleEntityNotFound(_0x36a751,null))[_0x7673('0xd')](respondWithResult(_0x36a751,null))['catch'](handleError(_0x36a751,null));};exports['getOpenContacts']=function(_0x384aac,_0x595493){return _0x384aac[_0x7673('0x4d')][_0x7673('0x5d')]({'where':{'type':_0x7673('0x78'),'dialActive':!![],'dialMethod':_0x7673('0x5e')},'attributes':['id'],'raw':!![]})[_0x7673('0xd')](function(_0x3c82d3){if(_0x3c82d3&&_0x3c82d3[_0x7673('0x2d')]){return db[_0x7673('0x3b')][_0x7673('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x7673('0x51'))},'VoiceQueueId':{'$in':_[_0x7673('0x16')](_0x3c82d3,'id')},'$or':[{'UserId':null},{'UserId':_0x384aac[_0x7673('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x1cc5c2){if(!_[_0x7673('0x58')](_0x1cc5c2)&&_[_0x7673('0x79')](_0x1cc5c2)){return _0x595493[_0x7673('0x5')](0xc8)[_0x7673('0xb')]({'contacts':_0x1cc5c2});}else{logger[_0x7673('0xf')](_0x7673('0x7a'),'getOpenContacts',0x194,_0x7673('0x7b'));_0x595493['sendStatus'](0x194);}})[_0x7673('0x38')](handleError(_0x595493,null));};exports[_0x7673('0x7c')]=function(_0x1c61f9,_0x3a7767){var _0x4ed050=shared[_0x7673('0x7d')];var _0x31e97c=[];_[_0x7673('0x16')](_0x4ed050,function(_0x541a8a){_0x31e97c[_0x7673('0x7e')]({'id':_0x541a8a[_0x7673('0x17')],'name':_0x541a8a[_0x7673('0x17')],'utcOffset':_0x541a8a[_0x7673('0x7f')]});});return _0x3a7767['status'](0xc8)[_0x7673('0xb')]({'tz':_0x31e97c});};exports[_0x7673('0x80')]=function(_0x493c4d,_0x2d3583){var _0x332c63=shared['timezones'];var _0x3ba1aa={};if(!_['isNil'](_0x332c63[_0x493c4d[_0x7673('0x3e')]['id']]))_0x3ba1aa=_0x332c63[_0x493c4d['body']['id']];return _0x2d3583[_0x7673('0x5')](0xc8)[_0x7673('0xb')](_0x3ba1aa);};
\ No newline at end of file
+var _0x0bde=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','CmHopper','rows','show','params','options','catch','create','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','deletedat','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','dialPreviewAutoRecallMe','transaction','value','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','scheduledat','getOpenContacts','outbound','preview','format','YYYY-MM-DD\x20HH:mm:ss','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','update','then','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','intersection','filters','$and','$or','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var _=require(_0xe0bd('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xe0bd('0x1'))(_0xe0bd('0x2'));var shared=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];function respondWithResult(_0x2da4bd,_0x5541b9){_0x5541b9=_0x5541b9||0xc8;return function(_0x34df88){if(_0x34df88){return _0x2da4bd[_0xe0bd('0x5')](_0x5541b9)[_0xe0bd('0x6')](_0x34df88);}};}function respondWithFilteredResult(_0x3b712a,_0x22bfd1){return function(_0x26393f){if(_0x26393f){var _0x217145=typeof _0x22bfd1['offset']===_0xe0bd('0x7')&&typeof _0x22bfd1[_0xe0bd('0x8')]===_0xe0bd('0x7');var _0x2d32c6=_0x26393f[_0xe0bd('0x9')];var _0x3c47c4=_0x217145?0x0:_0x22bfd1[_0xe0bd('0xa')];var _0x58d892=_0x217145?_0x26393f['count']:_0x22bfd1['offset']+_0x22bfd1['limit'];var _0x44ffa9;if(_0x58d892>=_0x2d32c6){_0x58d892=_0x2d32c6;_0x44ffa9=0xc8;}else{_0x44ffa9=0xce;}_0x3b712a['status'](_0x44ffa9);return _0x3b712a['set'](_0xe0bd('0xb'),_0x3c47c4+'-'+_0x58d892+'/'+_0x2d32c6)[_0xe0bd('0x6')](_0x26393f);}return null;};}function saveUpdates(_0x54d40e,_0xc492b4){return function(_0x5272ca){if(_0x5272ca){return _0x5272ca[_0xe0bd('0xc')](_0x54d40e)[_0xe0bd('0xd')](function(_0x3b2fb1){return _0x3b2fb1;});}return null;};}function handleEntityNotFound(_0x20ab47,_0x47664e){return function(_0x335f17){if(!_0x335f17){_0x20ab47[_0xe0bd('0xe')](0x194);}return _0x335f17;};}function handleError(_0x210f20,_0x4f63fa){_0x4f63fa=_0x4f63fa||0x1f4;return function(_0x50891d){logger['error'](_0x50891d[_0xe0bd('0xf')]);if(_0x50891d[_0xe0bd('0x10')]){delete _0x50891d[_0xe0bd('0x10')];}_0x210f20[_0xe0bd('0x5')](_0x4f63fa)[_0xe0bd('0x11')](_0x50891d);};}exports['index']=function(_0x4ebe7a,_0x1becc8){var _0x4ac920={},_0x4f36f7={},_0x418d64={'count':0x0,'rows':[]};var _0xec158d=_[_0xe0bd('0x12')](db['CmHopper'][_0xe0bd('0x13')],function(_0xe1d808){return{'name':_0xe1d808[_0xe0bd('0x14')],'type':_0xe1d808['type'][_0xe0bd('0x15')]};});_0x4f36f7[_0xe0bd('0x16')]=_[_0xe0bd('0x12')](_0xec158d,'name');_0x4f36f7[_0xe0bd('0x17')]=_[_0xe0bd('0x18')](_0x4ebe7a[_0xe0bd('0x17')]);_0x4f36f7['filters']=_[_0xe0bd('0x19')](_0x4f36f7['model'],_0x4f36f7[_0xe0bd('0x17')]);_0x4f36f7[_0xe0bd('0x1a')]=_['concat'](_0x4f36f7[_0xe0bd('0x1a')],[_0xe0bd('0x1b'),_0xe0bd('0x1c'),_0xe0bd('0x1d'),_0xe0bd('0x1e'),_0xe0bd('0x1f'),_0xe0bd('0x20'),_0xe0bd('0x21'),'$eq','$not',_0xe0bd('0x22'),_0xe0bd('0x23'),'$in','$notIn',_0xe0bd('0x24'),_0xe0bd('0x25'),_0xe0bd('0x26'),_0xe0bd('0x27'),'$like',_0xe0bd('0x28'),'$contains',_0xe0bd('0x29'),_0xe0bd('0x2a')]);_0x4ac920[_0xe0bd('0x2b')]=_[_0xe0bd('0x19')](_0x4f36f7[_0xe0bd('0x16')],qs[_0xe0bd('0x2c')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x2c')]));_0x4ac920[_0xe0bd('0x2b')]=_0x4ac920[_0xe0bd('0x2b')][_0xe0bd('0x2d')]?_0x4ac920[_0xe0bd('0x2b')]:_0x4f36f7[_0xe0bd('0x16')];if(!_0x4ebe7a['query'][_0xe0bd('0x2e')](_0xe0bd('0x2f'))){_0x4ac920[_0xe0bd('0x8')]=qs[_0xe0bd('0x8')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x8')]);_0x4ac920['offset']=qs['offset'](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0xa')]);}_0x4ac920[_0xe0bd('0x30')]=qs[_0xe0bd('0x31')](_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x31')]);_0x4ac920[_0xe0bd('0x32')]=qs['filters'](_[_0xe0bd('0x33')](_0x4ebe7a[_0xe0bd('0x17')],_0x4f36f7[_0xe0bd('0x1a')]),_0xec158d);if(_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x34')]){_0x4ac920[_0xe0bd('0x32')]=_['merge'](_0x4ac920[_0xe0bd('0x32')],{'$or':_[_0xe0bd('0x12')](_0xec158d,function(_0x24b857){if(_0x24b857[_0xe0bd('0x35')]!==_0xe0bd('0x36')){var _0x5881e5={};_0x5881e5[_0x24b857['name']]={'$like':'%'+_0x4ebe7a[_0xe0bd('0x17')][_0xe0bd('0x34')]+'%'};return _0x5881e5;}})});}_0x4ac920=_[_0xe0bd('0x37')]({},_0x4ac920,_0x4ebe7a['options']);var _0x8a331={'where':_0x4ac920['where']};return db['CmHopper'][_0xe0bd('0x9')](_0x8a331)[_0xe0bd('0xd')](function(_0x4d8695){_0x418d64['count']=_0x4d8695;if(_0x4ebe7a['query'][_0xe0bd('0x38')]){_0x4ac920[_0xe0bd('0x39')]=[{'all':!![]}];}return db[_0xe0bd('0x3a')]['findAll'](_0x4ac920);})[_0xe0bd('0xd')](function(_0x2b4814){_0x418d64[_0xe0bd('0x3b')]=_0x2b4814;return _0x418d64;})['then'](respondWithFilteredResult(_0x1becc8,_0x4ac920))['catch'](handleError(_0x1becc8,null));};exports[_0xe0bd('0x3c')]=function(_0x4e5247,_0x1eba8b){var _0x195f0f={'raw':!![],'where':{'id':_0x4e5247[_0xe0bd('0x3d')]['id']}},_0x5aee49={};_0x5aee49[_0xe0bd('0x16')]=_[_0xe0bd('0x18')](db[_0xe0bd('0x3a')][_0xe0bd('0x13')]);_0x5aee49[_0xe0bd('0x17')]=_[_0xe0bd('0x18')](_0x4e5247['query']);_0x5aee49[_0xe0bd('0x1a')]=_[_0xe0bd('0x19')](_0x5aee49[_0xe0bd('0x16')],_0x5aee49[_0xe0bd('0x17')]);_0x195f0f[_0xe0bd('0x2b')]=_['intersection'](_0x5aee49['model'],qs['fields'](_0x4e5247[_0xe0bd('0x17')][_0xe0bd('0x2c')]));_0x195f0f[_0xe0bd('0x2b')]=_0x195f0f[_0xe0bd('0x2b')]['length']?_0x195f0f['attributes']:_0x5aee49[_0xe0bd('0x16')];if(_0x4e5247[_0xe0bd('0x17')][_0xe0bd('0x38')]){_0x195f0f[_0xe0bd('0x39')]=[{'all':!![]}];}_0x195f0f=_[_0xe0bd('0x37')]({},_0x195f0f,_0x4e5247[_0xe0bd('0x3e')]);return db[_0xe0bd('0x3a')]['find'](_0x195f0f)[_0xe0bd('0xd')](handleEntityNotFound(_0x1eba8b,null))['then'](respondWithResult(_0x1eba8b,null))[_0xe0bd('0x3f')](handleError(_0x1eba8b,null));};exports[_0xe0bd('0x40')]=function(_0x507876,_0x4cfad0){return db[_0xe0bd('0x3a')][_0xe0bd('0x40')](_0x507876[_0xe0bd('0x41')],{})[_0xe0bd('0xd')](respondWithResult(_0x4cfad0,0xc9))[_0xe0bd('0x3f')](handleError(_0x4cfad0,null));};exports[_0xe0bd('0xc')]=function(_0x368549,_0x37f9ea){if(_0x368549[_0xe0bd('0x41')]['id']){delete _0x368549['body']['id'];}return db[_0xe0bd('0x3a')][_0xe0bd('0x42')]({'where':{'id':_0x368549[_0xe0bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x37f9ea,null))[_0xe0bd('0xd')](saveUpdates(_0x368549[_0xe0bd('0x41')],null))['then'](respondWithResult(_0x37f9ea,null))[_0xe0bd('0x3f')](handleError(_0x37f9ea,null));};exports[_0xe0bd('0x43')]=function(_0x578792,_0xd14c1d){return db[_0xe0bd('0x3a')][_0xe0bd('0x43')]()['then'](respondWithResult(_0xd14c1d,null))[_0xe0bd('0x3f')](handleError(_0xd14c1d,null));};exports[_0xe0bd('0x44')]=function(_0x147438,_0x21ae20){var _0x119d5c;var _0x2eff0d=_0x147438[_0xe0bd('0x3d')]['id'];return db[_0xe0bd('0x3a')][_0xe0bd('0x42')]({'where':{'id':_0x147438['params']['id']}})['then'](handleEntityNotFound(_0x21ae20,null))['then'](function(_0x43b646){if(_0x43b646){return _0x43b646[_0xe0bd('0x44')]()['then'](function(_0xacd120){return _0xacd120;});}})[_0xe0bd('0xd')](function(_0x1ab9b0){_0x119d5c=_0x1ab9b0;if(_0x1ab9b0){if(_0x1ab9b0[_0xe0bd('0x45')]||_0x1ab9b0[_0xe0bd('0x46')]){return db[_0x1ab9b0[_0xe0bd('0x45')]?_0xe0bd('0x47'):_0xe0bd('0x48')][_0xe0bd('0x42')]({'where':{'id':_0x1ab9b0[_0xe0bd('0x45')]?_0x1ab9b0['VoiceQueueId']:_0x1ab9b0[_0xe0bd('0x46')]},'attributes':['id',_0xe0bd('0x10')],'raw':!![]});}}})[_0xe0bd('0xd')](function(_0x52573c){var _0x16dda5={};if(_0x52573c){_[_0xe0bd('0x37')](_0x16dda5,_[_0xe0bd('0x49')](_0x119d5c[_0xe0bd('0x4a')],[_0xe0bd('0x4b'),_0xe0bd('0x4c'),'id']));_0x16dda5[_0xe0bd('0x4d')]=0x15;_0x16dda5[_0xe0bd('0x4e')]=_0xe0bd('0x4f');_0x16dda5['campaign']=_0x52573c[_0xe0bd('0x10')];_0x16dda5[_0xe0bd('0x50')]=_0x147438[_0xe0bd('0x51')][_0xe0bd('0x10')];_0x16dda5['UserId']=_0x147438[_0xe0bd('0x51')]['id'];_0x16dda5[_0xe0bd('0x4f')]=!![];_0x16dda5[_0xe0bd('0x52')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x16dda5[_0xe0bd('0x53')]=_0x119d5c[_0xe0bd('0x54')];_0x16dda5['campaigntype']=_0x119d5c[_0xe0bd('0x45')]?_0xe0bd('0x55'):_0xe0bd('0x56');return db[_0xe0bd('0x57')]['find']({'where':{'id':_0x16dda5[_0xe0bd('0x58')]},'attributes':[_0xe0bd('0x59'),_0xe0bd('0x5a')]})[_0xe0bd('0xd')](function(_0x373846){if(!_[_0xe0bd('0x5b')](_0x21ae20)&&!_[_0xe0bd('0x5b')](_0x373846['firstName'])){_0x16dda5[_0xe0bd('0x5c')]=_0x373846[_0xe0bd('0x59')];if(!_[_0xe0bd('0x5b')](_0x373846[_0xe0bd('0x5a')])){_0x16dda5[_0xe0bd('0x5c')]+='\x20'+_0x373846[_0xe0bd('0x5a')];}}})[_0xe0bd('0x5d')](function(){return db[_0xe0bd('0x5e')][_0xe0bd('0x40')](_0x16dda5);});}})[_0xe0bd('0xd')](function(_0x29b248){return db[_0xe0bd('0x5f')][_0xe0bd('0x44')]({'where':{'CmHopperId':_0x2eff0d}});})[_0xe0bd('0xd')](function(){return _0x21ae20[_0xe0bd('0x5')](0xcc)[_0xe0bd('0x60')]();})[_0xe0bd('0x3f')](handleError(_0x21ae20,null));};exports[_0xe0bd('0x61')]=function(_0x178398,_0x8e61d6){var _0x9d03de=[];return db[_0xe0bd('0x57')][_0xe0bd('0x43')]()['then'](function(_0x4b461a){_0x9d03de=_[_0xe0bd('0x18')](_0x4b461a);return _0x178398[_0xe0bd('0x51')][_0xe0bd('0x62')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt',_0xe0bd('0x63')],'raw':!![]});})[_0xe0bd('0xd')](function(_0x4dfd2a){if(_0x4dfd2a&&_0x4dfd2a[_0xe0bd('0x2d')]){return db['sequelize'][_0xe0bd('0x64')](function(_0x2ede67){var _0x14bbeb={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x4dfd2a,'id')},'$or':[{'UserId':null},{'UserId':_0x178398[_0xe0bd('0x51')]['id']}]};var _0x1c9407={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4dfd2a)[_0xe0bd('0x34')]([_0xe0bd('0x63'),0x0])[_0xe0bd('0x12')]('id')[_0xe0bd('0x65')]()},'$or':[{'UserId':null},{'UserId':_0x178398['user']['id']}]};var _0x338028={'$or':[_0x14bbeb,_0x1c9407]};var _0x40a584=[];if(_0x178398['body'][_0xe0bd('0x66')]&&_0x178398[_0xe0bd('0x41')][_0xe0bd('0x66')]===_0xe0bd('0x67')){if(!_[_0xe0bd('0x68')](_0x178398[_0xe0bd('0x41')][_0xe0bd('0x69')])){_0x338028['id']={'$in':_0x178398[_0xe0bd('0x41')]['hopperIds']};}_0x40a584=[[_0xe0bd('0x6a'),_0xe0bd('0x6b')],[_0xe0bd('0x6c'),_0x4dfd2a[0x0]['dialOrderByScheduledAt']===_0xe0bd('0x6b')?_0xe0bd('0x6d'):_0xe0bd('0x6b')],db[_0xe0bd('0x6e')]['literal'](_0xe0bd('0x6f')),['id',_0xe0bd('0x6d')]];}else{if(!_[_0xe0bd('0x68')](_0x178398['body'][_0xe0bd('0x69')])){_0x338028['id']={'$notIn':_0x178398[_0xe0bd('0x41')][_0xe0bd('0x69')]};}_0x40a584=[['priority',_0xe0bd('0x6d')],['scheduledAt',_0x4dfd2a[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe0bd('0x70')](_0xe0bd('0x71')),['id',_0xe0bd('0x6b')]];}return db[_0xe0bd('0x3a')]['findOne']({'attributes':['id','scheduledat',_0xe0bd('0x54'),_0xe0bd('0x72')],'where':_0x338028,'order':_0x40a584,'transaction':_0x2ede67,'lock':_0x2ede67[_0xe0bd('0x73')][_0xe0bd('0x74')],'include':[{'model':db[_0xe0bd('0x57')],'as':_0xe0bd('0x75'),'attributes':_0x9d03de,'include':[{'model':db[_0xe0bd('0x76')],'as':_0xe0bd('0x77'),'attributes':['id',_0xe0bd('0x10')]}]},{'model':db[_0xe0bd('0x78')],'as':'List','attributes':['id',_0xe0bd('0x10')]},{'model':db['VoiceQueue'],'as':_0xe0bd('0x79'),'attributes':['id',_0xe0bd('0x10'),_0xe0bd('0x7a')]}]})[_0xe0bd('0xd')](function(_0x191423){if(_0x191423){return _0x191423[_0xe0bd('0xc')]({'UserId':_0x178398[_0xe0bd('0x51')]['id']},{'transaction':_0x2ede67});}});});}})['then'](handleEntityNotFound(_0x8e61d6,null))[_0xe0bd('0xd')](respondWithResult(_0x8e61d6,null))[_0xe0bd('0x3f')](handleError(_0x8e61d6,null));};exports['getPreviewRecall']=function(_0x4303ec,_0x2acb14,_0x1f230d){var _0x4fb0cb=[];var _0x5991e5=_0x4303ec[_0xe0bd('0x3d')]['id'];var _0x1cc0dd=_0x4303ec['user']['id'];return db[_0xe0bd('0x57')][_0xe0bd('0x43')]()['then'](function(_0x485bde){_0x4fb0cb=_[_0xe0bd('0x18')](_0x485bde);return db[_0xe0bd('0x6e')][_0xe0bd('0x64')](function(_0x6e9712){const _0x4e3815={'id':_0x5991e5};return db[_0xe0bd('0x3a')]['findOne']({'attributes':['id',_0xe0bd('0x7b'),_0xe0bd('0x72')],'where':_0x4e3815,'transaction':_0x6e9712,'lock':_0x6e9712[_0xe0bd('0x73')][_0xe0bd('0x74')],'include':[{'model':db[_0xe0bd('0x57')],'as':_0xe0bd('0x75'),'attributes':_0x4fb0cb,'include':[{'model':db[_0xe0bd('0x76')],'as':_0xe0bd('0x77'),'attributes':['id',_0xe0bd('0x10')]}]},{'model':db[_0xe0bd('0x78')],'as':'List','attributes':['id',_0xe0bd('0x10')]},{'model':db[_0xe0bd('0x47')],'as':_0xe0bd('0x79'),'attributes':['id','name',_0xe0bd('0x7a')]}]})[_0xe0bd('0xd')](function(_0x6a6012){if(_0x6a6012){return _0x6a6012[_0xe0bd('0xc')]({'UserId':_0x1cc0dd},{'transaction':_0x6e9712});}});});})[_0xe0bd('0xd')](handleEntityNotFound(_0x2acb14,null))[_0xe0bd('0xd')](respondWithResult(_0x2acb14,null))['catch'](handleError(_0x2acb14,null));};exports[_0xe0bd('0x7c')]=function(_0x378034,_0x17435d){return _0x378034[_0xe0bd('0x51')]['getVoiceQueues']({'where':{'type':_0xe0bd('0x7d'),'dialActive':!![],'dialMethod':_0xe0bd('0x7e')},'attributes':['id'],'raw':!![]})[_0xe0bd('0xd')](function(_0x3fb7f9){if(_0x3fb7f9&&_0x3fb7f9[_0xe0bd('0x2d')]){return db['CmHopper'][_0xe0bd('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe0bd('0x7f')](_0xe0bd('0x80'))},'VoiceQueueId':{'$in':_[_0xe0bd('0x12')](_0x3fb7f9,'id')},'$or':[{'UserId':null},{'UserId':_0x378034[_0xe0bd('0x51')]['id']}]}});}return 0x0;})[_0xe0bd('0xd')](function(_0x3a82a5){if(!_[_0xe0bd('0x5b')](_0x3a82a5)&&_[_0xe0bd('0x81')](_0x3a82a5)){return _0x17435d[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')]({'contacts':_0x3a82a5});}else{logger[_0xe0bd('0x82')](_0xe0bd('0x83'),_0xe0bd('0x7c'),0x194,_0xe0bd('0x84'));_0x17435d[_0xe0bd('0xe')](0x194);}})[_0xe0bd('0x3f')](handleError(_0x17435d,null));};exports[_0xe0bd('0x85')]=function(_0x5a9a57,_0x9b312e){var _0x36ca72=shared[_0xe0bd('0x86')];var _0x52287d=[];_[_0xe0bd('0x12')](_0x36ca72,function(_0x1ae29c){_0x52287d[_0xe0bd('0x87')]({'id':_0x1ae29c[_0xe0bd('0x10')],'name':_0x1ae29c[_0xe0bd('0x10')],'utcOffset':_0x1ae29c[_0xe0bd('0x88')]});});return _0x9b312e[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')]({'tz':_0x52287d});};exports[_0xe0bd('0x89')]=function(_0x531f39,_0x52a859){var _0x4e9fe0=shared[_0xe0bd('0x86')];var _0x42b1b4={};if(!_[_0xe0bd('0x5b')](_0x4e9fe0[_0x531f39['body']['id']]))_0x42b1b4=_0x4e9fe0[_0x531f39[_0xe0bd('0x41')]['id']];return _0x52a859[_0xe0bd('0x5')](0xc8)[_0xe0bd('0x6')](_0x42b1b4);};
\ No newline at end of file
index a3df70c..26c770f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['priority','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone'];(function(_0x48381d,_0x4ee067){var _0x1431d3=function(_0x492d96){while(--_0x492d96){_0x48381d['push'](_0x48381d['shift']());}};_0x1431d3(++_0x4ee067);}(_0xba34,0x119));var _0x4ba3=function(_0x184077,_0x3fdb34){_0x184077=_0x184077-0x0;var _0x247c9e=_0xba34[_0x184077];return _0x247c9e;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('CmHopper',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[{'name':_0x4ba3('0xb'),'fields':[_0x4ba3('0xb')]},{'name':_0x4ba3('0xc'),'fields':[_0x4ba3('0xc')]},{'name':_0x4ba3('0xd'),'fields':[_0x4ba3('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x71ab=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','api','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x71ab,0x64));var _0xb71a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x71ab[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xc')]},{'name':_0xb71a('0xd'),'fields':[_0xb71a('0xd')]},{'name':_0xb71a('0xe'),'fields':[_0xb71a('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index e82baa2..36a1bc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1121=['destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','LOCK','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','UPDATE','GetCmHopperPreview','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','List','util','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','where','limit','include','attributes','map','model','then','debug','stringify','catch','error','message','ShowCmHopper','find','info','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active'];(function(_0xa6a23e,_0x8b657a){var _0x210e65=function(_0x58b4b8){while(--_0x58b4b8){_0xa6a23e['push'](_0xa6a23e['shift']());}};_0x210e65(++_0x8b657a);}(_0x1121,0xc9));var _0x1112=function(_0x1e299e,_0x14821c){_0x1e299e=_0x1e299e-0x0;var _0x481580=_0x1121[_0x1e299e];return _0x481580;};'use strict';var _=require('lodash');var util=require(_0x1112('0x0'));var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x1112('0x1'))['db'];var logger=require(_0x1112('0x2'))('rpc');exports[_0x1112('0x3')]=function(_0x15abea){var _0x3b9878=this;return new Promise(function(_0x1d23f6,_0x220e20){return db[_0x1112('0x4')][_0x1112('0x5')]({'raw':_0x15abea['options']?_0x15abea[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x15abea['options']?_0x15abea['options'][_0x1112('0x8')]||null:null,'attributes':_0x15abea[_0x1112('0x6')]?_0x15abea['options']['attributes']||null:null,'limit':_0x15abea[_0x1112('0x6')]?_0x15abea['options'][_0x1112('0x9')]||null:null,'include':_0x15abea['options']?_0x15abea['options'][_0x1112('0xa')]?_['map'](_0x15abea[_0x1112('0x6')][_0x1112('0xa')],function(_0x18a08f){return{'model':db[_0x18a08f['model']],'as':_0x18a08f['as'],'attributes':_0x18a08f[_0x1112('0xb')],'include':_0x18a08f[_0x1112('0xa')]?_[_0x1112('0xc')](_0x18a08f[_0x1112('0xa')],function(_0x586be4){return{'model':db[_0x586be4[_0x1112('0xd')]],'as':_0x586be4['as'],'attributes':_0x586be4[_0x1112('0xb')],'include':_0x586be4[_0x1112('0xa')]?_[_0x1112('0xc')](_0x586be4[_0x1112('0xa')],function(_0x43dd6c){return{'model':db[_0x43dd6c['model']],'as':_0x43dd6c['as'],'attributes':_0x43dd6c[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})[_0x1112('0xe')](function(_0xbfc2bd){logger['info'](_0x1112('0x3'),_0x15abea);logger[_0x1112('0xf')](_0x1112('0x3'),_0x15abea,JSON[_0x1112('0x10')](_0xbfc2bd));_0x1d23f6(_0xbfc2bd);})[_0x1112('0x11')](function(_0x565dc0){logger[_0x1112('0x12')](_0x1112('0x3'),_0x565dc0[_0x1112('0x13')],_0x15abea);_0x220e20(_0x3b9878[_0x1112('0x12')](0x1f4,_0x565dc0[_0x1112('0x13')]));});});};exports[_0x1112('0x14')]=function(_0x9ee5f9){var _0x453eb0=this;return new Promise(function(_0x27ca19,_0x509d41){return db[_0x1112('0x4')][_0x1112('0x15')]({'raw':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9['options'][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9['options'][_0x1112('0x8')]||null:null,'attributes':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9[_0x1112('0x6')]['attributes']||null:null,'include':_0x9ee5f9[_0x1112('0x6')]?_0x9ee5f9[_0x1112('0x6')][_0x1112('0xa')]?_[_0x1112('0xc')](_0x9ee5f9[_0x1112('0x6')][_0x1112('0xa')],function(_0x209ac6){return{'model':db[_0x209ac6['model']],'as':_0x209ac6['as'],'attributes':_0x209ac6['attributes'],'include':_0x209ac6['include']?_[_0x1112('0xc')](_0x209ac6[_0x1112('0xa')],function(_0x2ee05d){return{'model':db[_0x2ee05d[_0x1112('0xd')]],'as':_0x2ee05d['as'],'attributes':_0x2ee05d[_0x1112('0xb')],'include':_0x2ee05d[_0x1112('0xa')]?_[_0x1112('0xc')](_0x2ee05d[_0x1112('0xa')],function(_0x1e1e9e){return{'model':db[_0x1e1e9e[_0x1112('0xd')]],'as':_0x1e1e9e['as'],'attributes':_0x1e1e9e[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})[_0x1112('0xe')](function(_0x5ca322){logger[_0x1112('0x16')](_0x1112('0x14'),_0x9ee5f9);logger[_0x1112('0xf')](_0x1112('0x14'),_0x9ee5f9,JSON[_0x1112('0x10')](_0x5ca322));_0x27ca19(_0x5ca322);})[_0x1112('0x11')](function(_0x5968a1){logger[_0x1112('0x12')](_0x1112('0x14'),_0x5968a1[_0x1112('0x13')],_0x9ee5f9);_0x509d41(_0x453eb0[_0x1112('0x12')](0x1f4,_0x5968a1[_0x1112('0x13')]));});});};exports[_0x1112('0x17')]=function(_0x46a5a9){var _0x4094ee=this;return new Promise(function(_0x1940c0,_0x547f42){return db['CmHopper'][_0x1112('0x18')](_0x46a5a9[_0x1112('0x19')],{'raw':_0x46a5a9[_0x1112('0x6')]?_0x46a5a9[_0x1112('0x6')]['raw']===undefined?!![]:![]:!![]})[_0x1112('0xe')](function(_0x1a0b55){logger[_0x1112('0x16')]('CreateCmHopper',_0x46a5a9);logger[_0x1112('0xf')](_0x1112('0x17'),_0x46a5a9,JSON[_0x1112('0x10')](_0x1a0b55));_0x1940c0(_0x1a0b55);})['catch'](function(_0x37305d){logger[_0x1112('0x12')](_0x1112('0x17'),_0x37305d[_0x1112('0x13')],_0x46a5a9);_0x547f42(_0x4094ee[_0x1112('0x12')](0x1f4,_0x37305d[_0x1112('0x13')]));});});};exports[_0x1112('0x1a')]=function(_0x456abc){var _0x52cb31=this;return new Promise(function(_0x1f6e5e,_0x41849e){return db[_0x1112('0x4')][_0x1112('0x1b')](_0x456abc[_0x1112('0x19')],{'raw':_0x456abc[_0x1112('0x6')]?_0x456abc[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456abc[_0x1112('0x6')]?_0x456abc['options'][_0x1112('0x8')]||null:null,'attributes':_0x456abc[_0x1112('0x6')]?_0x456abc[_0x1112('0x6')][_0x1112('0xb')]||null:null,'limit':_0x456abc['options']?_0x456abc['options'][_0x1112('0x9')]||null:null})[_0x1112('0xe')](function(_0x2bb1ab){logger['info'](_0x1112('0x1a'),_0x456abc);logger['info'](_0x1112('0x1c'),JSON[_0x1112('0x10')](_0x456abc[_0x1112('0x6')]['where']),_0x456abc[_0x1112('0x19')][_0x1112('0x1d')]);logger[_0x1112('0xf')](_0x1112('0x1a'),_0x456abc,JSON['stringify'](_0x2bb1ab));_0x1f6e5e(_0x2bb1ab);})['catch'](function(_0x46701a){logger['error'](_0x1112('0x1a'),_0x46701a[_0x1112('0x13')],_0x456abc);_0x41849e(_0x52cb31[_0x1112('0x12')](0x1f4,_0x46701a['message']));});});};exports['DestroyCmHopper']=function(_0x39695a){var _0x374058=this;return new Promise(function(_0x4647c9,_0xef6d91){return db[_0x1112('0x4')][_0x1112('0x1e')]({'where':_0x39695a['options']?_0x39695a['options']['where']||null:null})['then'](function(_0x23cf3e){logger[_0x1112('0x16')](_0x1112('0x1f'),_0x39695a);logger[_0x1112('0xf')](_0x1112('0x1f'),_0x39695a,JSON['stringify'](_0x23cf3e));_0x4647c9(_0x23cf3e);})[_0x1112('0x11')](function(_0x179ff3){logger[_0x1112('0x12')]('DestroyCmHopper',_0x179ff3[_0x1112('0x13')],_0x39695a);_0xef6d91(_0x374058[_0x1112('0x12')](0x1f4,_0x179ff3['message']));});});};exports[_0x1112('0x20')]=function(_0x2f1ede){var _0x131785=this;return new Promise(function(_0x3d660e,_0x4a680d){return db[_0x1112('0x21')][_0x1112('0x22')]()['then'](function(_0x376107){return db['sequelize'][_0x1112('0x23')](function(_0x35db57){return db[_0x1112('0x4')]['findAll']({'where':_0x2f1ede[_0x1112('0x6')]?_0x2f1ede[_0x1112('0x6')][_0x1112('0x8')]||null:null,'attributes':_0x2f1ede['options']?_0x2f1ede[_0x1112('0x6')][_0x1112('0xb')]||null:null,'limit':_0x2f1ede[_0x1112('0x6')]?_0x2f1ede[_0x1112('0x6')][_0x1112('0x9')]||null:null,'order':_0x2f1ede[_0x1112('0x6')]?_0x2f1ede[_0x1112('0x6')]['order']||null:null,'transaction':_0x35db57,'lock':_0x35db57[_0x1112('0x24')]['UPDATE'],'include':[{'model':db[_0x1112('0x21')],'as':_0x1112('0x25'),'attributes':_[_0x1112('0x26')](_0x376107)},{'model':db[_0x1112('0x27')],'as':_0x1112('0x28'),'attributes':['id',_0x1112('0x29'),_0x1112('0x2a')]}]})[_0x1112('0xe')](function(_0x25b4c0){var _0x34c181=[];var _0x303daa=[];for(var _0x327523=0x0;_0x327523<_0x25b4c0[_0x1112('0x2b')];_0x327523+=0x1){var _0x1ff6b3=_0x25b4c0[_0x327523][_0x1112('0x2c')];if(_0x1ff6b3===null){_0x34c181[_0x1112('0x2d')](_0x25b4c0[_0x327523][_0x1112('0x1b')](_0x2f1ede[_0x1112('0x19')],{'transaction':_0x35db57}));}else if(!_0x303daa[_0x1112('0x2e')](_0x1ff6b3)){_0x303daa[_0x1112('0x2d')](_0x1ff6b3);_0x34c181[_0x1112('0x2d')](_0x25b4c0[_0x327523][_0x1112('0x1b')](_0x2f1ede[_0x1112('0x19')],{'transaction':_0x35db57}));}}return BPromise[_0x1112('0x2f')](_0x34c181);});})[_0x1112('0xe')](function(_0x133527){logger['info']('GetContactDialer',_0x2f1ede);if(_0x133527['length']>0x0){logger[_0x1112('0x16')](_0x1112('0x30'),_0x133527[0x0]['dataValues']['id'],_0x133527[0x0][_0x1112('0x31')][_0x1112('0x32')],_0x133527[0x0]['dataValues'][_0x1112('0x1d')]);}logger[_0x1112('0xf')]('GetContactDialer',_0x2f1ede,JSON[_0x1112('0x10')](_0x133527));_0x3d660e(_0x133527);})[_0x1112('0x11')](function(_0x466005){logger[_0x1112('0x12')]('GetContactDialer',_0x466005['message'],_0x2f1ede);_0x4a680d(_0x131785[_0x1112('0x12')](0x1f4,_0x466005[_0x1112('0x13')]));});});});};exports[_0x1112('0x33')]=function(_0x140665){var _0x140fee=this;return new Promise(function(_0x1fcf8f,_0x5dbe25){return db[_0x1112('0x34')][_0x1112('0x23')](function(_0x299a76){return db[_0x1112('0x35')][_0x1112('0x18')](_0x140665[_0x1112('0x19')],{'raw':_0x140665[_0x1112('0x6')]?_0x140665[_0x1112('0x6')]['raw']===undefined?!![]:![]:!![],'transaction':_0x299a76})[_0x1112('0xe')](function(){logger[_0x1112('0x16')](_0x1112('0x36'),JSON['stringify'](_0x140665[_0x1112('0x6')][_0x1112('0x8')]),_0x140665[_0x1112('0x6')][_0x1112('0x8')]['active']);return db[_0x1112('0x4')][_0x1112('0x1e')]({'where':_0x140665[_0x1112('0x6')]?_0x140665[_0x1112('0x6')][_0x1112('0x8')]||null:null,'transaction':_0x299a76});});})[_0x1112('0xe')](function(_0x15aaec){logger[_0x1112('0x16')](_0x1112('0x33'),_0x140665);logger[_0x1112('0xf')]('MoveContactManagedDialer',_0x140665,JSON[_0x1112('0x10')](_0x15aaec));_0x1fcf8f(_0x15aaec);})[_0x1112('0x11')](function(_0x16dc8d){logger[_0x1112('0x12')](_0x1112('0x33'),_0x16dc8d[_0x1112('0x13')],_0x140665);_0x5dbe25(_0x140fee[_0x1112('0x12')](0x1f4,_0x16dc8d['message']));});});};exports[_0x1112('0x37')]=function(_0x56b508){var _0x3e4562=this;return new Promise(function(_0x4465d0,_0x570604){return db[_0x1112('0x4')]['findAll']({'raw':_0x56b508[_0x1112('0x6')]?_0x56b508[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x56b508[_0x1112('0x6')]?_0x56b508[_0x1112('0x6')]['where']||null:null,'attributes':[[db[_0x1112('0x34')]['fn'](_0x1112('0x38'),db[_0x1112('0x34')]['fn']('IF',db['sequelize']['literal']('`scheduledat`\x20>=\x20'+util[_0x1112('0x39')]('\x22%s\x22',moment()[_0x1112('0x39')](_0x1112('0x3a')))+_0x1112('0x3b')))),_0x1112('0x3c')]]})['then'](function(_0x5e0f97){logger['info'](_0x1112('0x37'),_0x56b508);logger['debug'](_0x1112('0x37'),_0x56b508,JSON[_0x1112('0x10')](_0x5e0f97));_0x4465d0(_0x5e0f97);})[_0x1112('0x11')](function(_0x327b0a){logger[_0x1112('0x12')](_0x1112('0x37'),_0x327b0a[_0x1112('0x13')],_0x56b508);_0x570604(_0x3e4562[_0x1112('0x12')](0x1f4,_0x327b0a[_0x1112('0x13')]));});});};exports[_0x1112('0x3d')]=function(_0x297eb5){var _0x3bd6fa=this;return new Promise(function(_0x50df40,_0x51ad97){return db[_0x1112('0x21')][_0x1112('0x22')]()[_0x1112('0xe')](function(){return db[_0x1112('0x34')][_0x1112('0x23')](function(_0x53a7ff){return db[_0x1112('0x4')][_0x1112('0x5')]({'where':_0x297eb5['options']?_0x297eb5['options'][_0x1112('0x8')]||null:null,'attributes':_0x297eb5['options']?_0x297eb5['options'][_0x1112('0xb')]||null:null,'limit':0x1,'order':_0x297eb5[_0x1112('0x6')]?_0x297eb5[_0x1112('0x6')][_0x1112('0x3e')]||null:null,'group':db[_0x1112('0x4')]['UserId'],'transaction':_0x53a7ff,'lock':_0x53a7ff[_0x1112('0x24')][_0x1112('0x3f')],'include':_0x297eb5['options']?_0x297eb5[_0x1112('0x6')][_0x1112('0xa')]?_[_0x1112('0xc')](_0x297eb5[_0x1112('0x6')][_0x1112('0xa')],function(_0x489c5d){return{'model':db[_0x489c5d[_0x1112('0xd')]],'as':_0x489c5d['as'],'attributes':_0x489c5d['attributes'],'include':_0x489c5d[_0x1112('0xa')]?_[_0x1112('0xc')](_0x489c5d['include'],function(_0xffecac){return{'model':db[_0xffecac['model']],'as':_0xffecac['as'],'attributes':_0xffecac[_0x1112('0xb')],'include':_0xffecac['include']?_[_0x1112('0xc')](_0xffecac[_0x1112('0xa')],function(_0x55f0e5){return{'model':db[_0x55f0e5[_0x1112('0xd')]],'as':_0x55f0e5['as'],'attributes':_0x55f0e5[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x50a1e2){var _0x1315a2=[];for(var _0x1c4bec=0x0;_0x1c4bec<_0x50a1e2[_0x1112('0x2b')];_0x1c4bec+=0x1){_0x1315a2[_0x1112('0x2d')](_0x50a1e2[_0x1c4bec][_0x1112('0x1b')](_0x297eb5[_0x1112('0x19')],{'transaction':_0x53a7ff}));}return BPromise[_0x1112('0x2f')](_0x1315a2);});})[_0x1112('0xe')](function(_0x35c134){logger['info'](_0x1112('0x3d'),_0x297eb5);logger[_0x1112('0xf')]('GetContactRecallMe',_0x297eb5,JSON[_0x1112('0x10')](_0x35c134));_0x50df40(_0x35c134);})['catch'](function(_0x2f0df3){logger['error'](_0x1112('0x3d'),_0x2f0df3[_0x1112('0x13')],_0x297eb5);_0x51ad97(_0x3bd6fa[_0x1112('0x12')](0x1f4,_0x2f0df3[_0x1112('0x13')]));});});});};exports[_0x1112('0x40')]=function(_0x27a012){var _0x29e035=this;return new Promise(function(_0x5a1878,_0x11b29e){db[_0x1112('0x21')][_0x1112('0x22')]()[_0x1112('0xe')](function(_0x3512bd){return db['CmHopper'][_0x1112('0x5')]({'raw':_0x27a012[_0x1112('0x6')]?_0x27a012[_0x1112('0x6')][_0x1112('0x7')]===undefined?!![]:![]:!![],'where':_0x27a012[_0x1112('0x6')]?_0x27a012['options'][_0x1112('0x8')]||null:null,'attributes':_0x27a012[_0x1112('0x6')]?_0x27a012[_0x1112('0x6')]['attributes']||null:null,'limit':_0x27a012[_0x1112('0x6')]?_0x27a012['options'][_0x1112('0x9')]||null:null,'include':_0x27a012[_0x1112('0x6')]?_0x27a012[_0x1112('0x6')]['include']?_[_0x1112('0xc')](_0x27a012[_0x1112('0x6')][_0x1112('0xa')],function(_0x37a9e3){return{'model':db[_0x37a9e3['model']],'as':_0x37a9e3['as'],'attributes':_0x37a9e3['as']===_0x1112('0x25')?_['keys'](_0x3512bd):_0x37a9e3[_0x1112('0xb')],'include':_0x37a9e3['include']?_[_0x1112('0xc')](_0x37a9e3[_0x1112('0xa')],function(_0x142cfe){return{'model':db[_0x142cfe[_0x1112('0xd')]],'as':_0x142cfe['as'],'attributes':_0x142cfe[_0x1112('0xb')],'include':_0x142cfe[_0x1112('0xa')]?_[_0x1112('0xc')](_0x142cfe[_0x1112('0xa')],function(_0x46e9a9){return{'model':db[_0x46e9a9[_0x1112('0xd')]],'as':_0x46e9a9['as'],'attributes':_0x46e9a9[_0x1112('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2133bb){logger[_0x1112('0x16')]('GetCmHopper',_0x27a012);logger[_0x1112('0xf')](_0x1112('0x3'),_0x27a012,JSON[_0x1112('0x10')](_0x2133bb));_0x5a1878(_0x2133bb);})['catch'](function(_0xfdffb2){logger['error'](_0x1112('0x3'),_0xfdffb2[_0x1112('0x13')],_0x27a012);_0x11b29e(_0x29e035['error'](0x1f4,_0xfdffb2['message']));});});});};exports['GetContactByPhone']=function(_0x44b3af){var _0x330529=this;return new Promise(function(_0x394d21,_0x152ec9){return db['CmContact'][_0x1112('0x41')]({'raw':!![],'where':{'phone':_0x44b3af[_0x1112('0x6')][_0x1112('0x8')]['phone']},'attributes':['id',_0x1112('0x42')],'order':[['id',_0x1112('0x43')]]})[_0x1112('0xe')](function(_0x2609b8){logger[_0x1112('0x16')](_0x1112('0x44'),_0x44b3af);logger['debug'](_0x1112('0x44'),_0x44b3af,JSON['stringify'](_0x2609b8));_0x394d21(_0x2609b8);})[_0x1112('0x11')](function(_0x4eb8df){logger[_0x1112('0x12')](_0x1112('0x44'),_0x4eb8df[_0x1112('0x13')],_0x44b3af);_0x152ec9(_0x330529['error'](0x1f4,_0x4eb8df[_0x1112('0x13')]));});});};exports[_0x1112('0x45')]=function(_0x2e09e1){var _0x558c05=this;return new Promise(function(_0x849881,_0x4c0bba){return db['sequelize'][_0x1112('0x23')](function(_0x5c83b1){var _0x1e9887=_0x2e09e1[_0x1112('0x6')]&&_0x2e09e1[_0x1112('0x6')]['where']?_0x2e09e1[_0x1112('0x6')]['where']:{};return db[_0x1112('0x4')]['update'](_0x2e09e1[_0x1112('0x19')],{'where':_0x1e9887,'transaction':_0x5c83b1})[_0x1112('0xe')](function(_0x512f56){logger['info'](_0x1112('0x45'),_0x2e09e1);logger['debug'](_0x1112('0x45'),_0x2e09e1,JSON[_0x1112('0x10')](_0x512f56));_0x849881(_0x512f56);})[_0x1112('0x11')](function(_0x2f6f9a){logger['error'](_0x1112('0x45'),_0x2f6f9a[_0x1112('0x13')],_0x2e09e1);_0x4c0bba(_0x558c05[_0x1112('0x12')](0x1f4,_0x2f6f9a[_0x1112('0x13')]));});});});};exports[_0x1112('0x46')]=function(_0x2b8323){var _0x2e1862=this;var _0x34850b=_0x2b8323[_0x1112('0x19')]['where'][_0x1112('0x47')];var _0x5abdda=_0x2b8323[_0x1112('0x19')][_0x1112('0x8')]['interval'];var _0x490354=_0x2b8323['body'][_0x1112('0x8')][_0x1112('0x48')];return new Promise(function(_0x67b27e,_0x348b6f){return db[_0x1112('0x4')][_0x1112('0x5')]({'where':{'voiceQueueId':{'$in':_0x34850b},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0x1112('0x49')](_0x1112('0x4a')+_0x5abdda+_0x1112('0x4b')),'$gt':db[_0x1112('0x34')][_0x1112('0x49')]('NOW()')}},'UserId':{'$in':_0x490354}},'include':[{'model':db['CmContact'],'as':_0x1112('0x25')},{'model':db['User'],'as':_0x1112('0x28'),'attributes':['id',_0x1112('0x29'),_0x1112('0x2a')]},{'model':db['CmList'],'as':_0x1112('0x4c')}]})[_0x1112('0xe')](function(_0x2a0f55){if(_0x2a0f55[_0x1112('0x2b')]>0x0){return db['sequelize'][_0x1112('0x23')](function(_0x46def2){return db[_0x1112('0x4')][_0x1112('0x1b')]({'recallmeNotifiedDate':db[_0x1112('0x34')]['literal']('NOW()')},{'where':{'id':{'$in':_[_0x1112('0xc')](_0x2a0f55,'id')}},'transaction':_0x46def2})[_0x1112('0xe')](function(){_0x67b27e(_0x2a0f55);})['catch'](function(_0x5238db){logger[_0x1112('0x12')](_0x1112('0x46'),_0x5238db[_0x1112('0x13')],_0x2b8323);_0x348b6f(_0x2e1862[_0x1112('0x12')](0x1f4,_0x5238db['message']));});})[_0x1112('0x11')](function(_0x539ab5){logger[_0x1112('0x12')](_0x1112('0x46'),_0x539ab5[_0x1112('0x13')],_0x2b8323);_0x348b6f(_0x2e1862[_0x1112('0x12')](0x1f4,_0x539ab5[_0x1112('0x13')]));});}else{_0x67b27e(_0x2a0f55);}});});};
\ No newline at end of file
+var _0x4be5=['findOne','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','CmList','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','GetCmHopper','CmHopper','findAll','options','raw','limit','include','map','attributes','model','then','info','stringify','catch','error','ShowCmHopper','find','debug','message','CreateCmHopper','UpdateCmHopper','update','where','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','keys','User','Agent','name','voicePause','length','UserId','body','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','active','MoveContactManagedDialer','transaction','CmHopperFinal','create','destroy','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','LOCK','GetCmHopperPreview','Contact','GetContactByPhone'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x4be5,0x192));var _0x54be=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x4be5[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0x54be('0x0'));var util=require(_0x54be('0x1'));var moment=require(_0x54be('0x2'));var BPromise=require(_0x54be('0x3'));var db=require(_0x54be('0x4'))['db'];var logger=require(_0x54be('0x5'))('rpc');exports[_0x54be('0x6')]=function(_0x53d016){var _0x7ae831=this;return new Promise(function(_0x162644,_0x5d8d7b){return db[_0x54be('0x7')][_0x54be('0x8')]({'raw':_0x53d016[_0x54be('0x9')]?_0x53d016['options'][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x53d016['options']?_0x53d016['options']['where']||null:null,'attributes':_0x53d016[_0x54be('0x9')]?_0x53d016[_0x54be('0x9')]['attributes']||null:null,'limit':_0x53d016[_0x54be('0x9')]?_0x53d016[_0x54be('0x9')][_0x54be('0xb')]||null:null,'include':_0x53d016[_0x54be('0x9')]?_0x53d016['options'][_0x54be('0xc')]?_[_0x54be('0xd')](_0x53d016[_0x54be('0x9')][_0x54be('0xc')],function(_0x1aac0f){return{'model':db[_0x1aac0f['model']],'as':_0x1aac0f['as'],'attributes':_0x1aac0f[_0x54be('0xe')],'include':_0x1aac0f['include']?_[_0x54be('0xd')](_0x1aac0f[_0x54be('0xc')],function(_0x2852d4){return{'model':db[_0x2852d4['model']],'as':_0x2852d4['as'],'attributes':_0x2852d4['attributes'],'include':_0x2852d4[_0x54be('0xc')]?_[_0x54be('0xd')](_0x2852d4[_0x54be('0xc')],function(_0x370551){return{'model':db[_0x370551[_0x54be('0xf')]],'as':_0x370551['as'],'attributes':_0x370551[_0x54be('0xe')]};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x5b5be6){logger[_0x54be('0x11')](_0x54be('0x6'),_0x53d016);logger['debug'](_0x54be('0x6'),_0x53d016,JSON[_0x54be('0x12')](_0x5b5be6));_0x162644(_0x5b5be6);})[_0x54be('0x13')](function(_0x4c284b){logger[_0x54be('0x14')](_0x54be('0x6'),_0x4c284b['message'],_0x53d016);_0x5d8d7b(_0x7ae831[_0x54be('0x14')](0x1f4,_0x4c284b['message']));});});};exports[_0x54be('0x15')]=function(_0x295e53){var _0x1429a6=this;return new Promise(function(_0x4b707e,_0x52dd3d){return db[_0x54be('0x7')][_0x54be('0x16')]({'raw':_0x295e53[_0x54be('0x9')]?_0x295e53[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x295e53[_0x54be('0x9')]?_0x295e53['options']['where']||null:null,'attributes':_0x295e53[_0x54be('0x9')]?_0x295e53['options'][_0x54be('0xe')]||null:null,'include':_0x295e53['options']?_0x295e53['options'][_0x54be('0xc')]?_['map'](_0x295e53['options'][_0x54be('0xc')],function(_0x287683){return{'model':db[_0x287683['model']],'as':_0x287683['as'],'attributes':_0x287683['attributes'],'include':_0x287683[_0x54be('0xc')]?_[_0x54be('0xd')](_0x287683[_0x54be('0xc')],function(_0x4e7f4a){return{'model':db[_0x4e7f4a[_0x54be('0xf')]],'as':_0x4e7f4a['as'],'attributes':_0x4e7f4a['attributes'],'include':_0x4e7f4a[_0x54be('0xc')]?_[_0x54be('0xd')](_0x4e7f4a['include'],function(_0x514603){return{'model':db[_0x514603[_0x54be('0xf')]],'as':_0x514603['as'],'attributes':_0x514603[_0x54be('0xe')]};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x1cdc90){logger[_0x54be('0x11')]('ShowCmHopper',_0x295e53);logger[_0x54be('0x17')](_0x54be('0x15'),_0x295e53,JSON[_0x54be('0x12')](_0x1cdc90));_0x4b707e(_0x1cdc90);})['catch'](function(_0x15cc2d){logger['error'](_0x54be('0x15'),_0x15cc2d['message'],_0x295e53);_0x52dd3d(_0x1429a6['error'](0x1f4,_0x15cc2d[_0x54be('0x18')]));});});};exports[_0x54be('0x19')]=function(_0x5c55d0){var _0x2a29d2=this;return new Promise(function(_0xf345f8,_0x12525a){return db[_0x54be('0x7')]['create'](_0x5c55d0['body'],{'raw':_0x5c55d0['options']?_0x5c55d0[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![]})['then'](function(_0x535022){logger[_0x54be('0x11')](_0x54be('0x19'),_0x5c55d0);logger[_0x54be('0x17')](_0x54be('0x19'),_0x5c55d0,JSON['stringify'](_0x535022));_0xf345f8(_0x535022);})[_0x54be('0x13')](function(_0x3fceea){logger[_0x54be('0x14')](_0x54be('0x19'),_0x3fceea[_0x54be('0x18')],_0x5c55d0);_0x12525a(_0x2a29d2['error'](0x1f4,_0x3fceea['message']));});});};exports[_0x54be('0x1a')]=function(_0x35f123){var _0x4b56c4=this;return new Promise(function(_0xca0f8a,_0x5ccd70){return db[_0x54be('0x7')][_0x54be('0x1b')](_0x35f123['body'],{'raw':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')]['attributes']||null:null,'limit':_0x35f123[_0x54be('0x9')]?_0x35f123[_0x54be('0x9')][_0x54be('0xb')]||null:null})[_0x54be('0x10')](function(_0xdc1716){logger['info'](_0x54be('0x1a'),_0x35f123);logger[_0x54be('0x11')](_0x54be('0x1d'),JSON[_0x54be('0x12')](_0x35f123['options'][_0x54be('0x1c')]),_0x35f123['body']['active']);logger['debug'](_0x54be('0x1a'),_0x35f123,JSON[_0x54be('0x12')](_0xdc1716));_0xca0f8a(_0xdc1716);})['catch'](function(_0x5d16e7){logger[_0x54be('0x14')](_0x54be('0x1a'),_0x5d16e7[_0x54be('0x18')],_0x35f123);_0x5ccd70(_0x4b56c4[_0x54be('0x14')](0x1f4,_0x5d16e7[_0x54be('0x18')]));});});};exports[_0x54be('0x1e')]=function(_0x120e0e){var _0x35a6f3=this;return new Promise(function(_0x4378cb,_0x415d86){return db[_0x54be('0x7')]['destroy']({'where':_0x120e0e[_0x54be('0x9')]?_0x120e0e['options'][_0x54be('0x1c')]||null:null})[_0x54be('0x10')](function(_0x43dc57){logger[_0x54be('0x11')](_0x54be('0x1e'),_0x120e0e);logger[_0x54be('0x17')](_0x54be('0x1e'),_0x120e0e,JSON[_0x54be('0x12')](_0x43dc57));_0x4378cb(_0x43dc57);})[_0x54be('0x13')](function(_0x534aff){logger[_0x54be('0x14')](_0x54be('0x1e'),_0x534aff[_0x54be('0x18')],_0x120e0e);_0x415d86(_0x35a6f3['error'](0x1f4,_0x534aff[_0x54be('0x18')]));});});};exports[_0x54be('0x1f')]=function(_0x183741){var _0x55025d=this;return new Promise(function(_0x426a81,_0x257854){return db[_0x54be('0x20')][_0x54be('0x21')]()[_0x54be('0x10')](function(_0x1d3aff){return db[_0x54be('0x22')]['transaction'](function(_0x14a040){return db[_0x54be('0x7')][_0x54be('0x8')]({'where':_0x183741[_0x54be('0x9')]?_0x183741[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':_0x183741[_0x54be('0x9')]?_0x183741[_0x54be('0x9')][_0x54be('0xe')]||null:null,'limit':_0x183741[_0x54be('0x9')]?_0x183741[_0x54be('0x9')][_0x54be('0xb')]||null:null,'order':_0x183741[_0x54be('0x9')]?_0x183741['options'][_0x54be('0x23')]||null:null,'transaction':_0x14a040,'lock':_0x14a040['LOCK'][_0x54be('0x24')],'include':[{'model':db[_0x54be('0x20')],'as':'Contact','attributes':_[_0x54be('0x25')](_0x1d3aff)},{'model':db[_0x54be('0x26')],'as':_0x54be('0x27'),'attributes':['id',_0x54be('0x28'),_0x54be('0x29')]}]})[_0x54be('0x10')](function(_0x3b1cb4){var _0x2a9614=[];var _0x10677a=[];for(var _0x29eea3=0x0;_0x29eea3<_0x3b1cb4[_0x54be('0x2a')];_0x29eea3+=0x1){var _0x5ee4bc=_0x3b1cb4[_0x29eea3][_0x54be('0x2b')];if(_0x5ee4bc===null){_0x2a9614['push'](_0x3b1cb4[_0x29eea3][_0x54be('0x1b')](_0x183741[_0x54be('0x2c')],{'transaction':_0x14a040}));}else if(!_0x10677a['includes'](_0x5ee4bc)){_0x10677a[_0x54be('0x2d')](_0x5ee4bc);_0x2a9614['push'](_0x3b1cb4[_0x29eea3][_0x54be('0x1b')](_0x183741['body'],{'transaction':_0x14a040}));}}return BPromise[_0x54be('0x2e')](_0x2a9614);});})[_0x54be('0x10')](function(_0x2d8087){logger[_0x54be('0x11')](_0x54be('0x1f'),_0x183741);if(_0x2d8087[_0x54be('0x2a')]>0x0){logger[_0x54be('0x11')](_0x54be('0x2f'),_0x2d8087[0x0][_0x54be('0x30')]['id'],_0x2d8087[0x0][_0x54be('0x30')][_0x54be('0x31')],_0x2d8087[0x0]['dataValues'][_0x54be('0x32')]);}logger[_0x54be('0x17')](_0x54be('0x1f'),_0x183741,JSON[_0x54be('0x12')](_0x2d8087));_0x426a81(_0x2d8087);})['catch'](function(_0x43a02a){logger[_0x54be('0x14')](_0x54be('0x1f'),_0x43a02a['message'],_0x183741);_0x257854(_0x55025d[_0x54be('0x14')](0x1f4,_0x43a02a['message']));});});});};exports[_0x54be('0x33')]=function(_0x2a8f62){var _0x5874e7=this;return new Promise(function(_0x258fc4,_0x3a6624){return db[_0x54be('0x22')][_0x54be('0x34')](function(_0x34173b){return db[_0x54be('0x35')][_0x54be('0x36')](_0x2a8f62[_0x54be('0x2c')],{'raw':_0x2a8f62[_0x54be('0x9')]?_0x2a8f62[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'transaction':_0x34173b})[_0x54be('0x10')](function(){logger['info']('MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x2a8f62[_0x54be('0x9')][_0x54be('0x1c')]),_0x2a8f62[_0x54be('0x9')][_0x54be('0x1c')][_0x54be('0x32')]);return db[_0x54be('0x7')][_0x54be('0x37')]({'where':_0x2a8f62[_0x54be('0x9')]?_0x2a8f62[_0x54be('0x9')]['where']||null:null,'transaction':_0x34173b});});})[_0x54be('0x10')](function(_0x518998){logger[_0x54be('0x11')]('MoveContactManagedDialer',_0x2a8f62);logger['debug'](_0x54be('0x33'),_0x2a8f62,JSON[_0x54be('0x12')](_0x518998));_0x258fc4(_0x518998);})[_0x54be('0x13')](function(_0x48af41){logger[_0x54be('0x14')](_0x54be('0x33'),_0x48af41['message'],_0x2a8f62);_0x3a6624(_0x5874e7[_0x54be('0x14')](0x1f4,_0x48af41[_0x54be('0x18')]));});});};exports[_0x54be('0x38')]=function(_0x51f881){var _0x21943f=this;return new Promise(function(_0x4e53ca,_0x386349){return db[_0x54be('0x7')]['findAll']({'raw':_0x51f881[_0x54be('0x9')]?_0x51f881['options'][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x51f881[_0x54be('0x9')]?_0x51f881[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':[[db[_0x54be('0x22')]['fn'](_0x54be('0x39'),db[_0x54be('0x22')]['fn']('IF',db[_0x54be('0x22')]['literal'](_0x54be('0x3a')+util['format'](_0x54be('0x3b'),moment()['format'](_0x54be('0x3c')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})['then'](function(_0x595ac3){logger[_0x54be('0x11')](_0x54be('0x38'),_0x51f881);logger[_0x54be('0x17')](_0x54be('0x38'),_0x51f881,JSON[_0x54be('0x12')](_0x595ac3));_0x4e53ca(_0x595ac3);})['catch'](function(_0x5ccf5b){logger[_0x54be('0x14')](_0x54be('0x38'),_0x5ccf5b[_0x54be('0x18')],_0x51f881);_0x386349(_0x21943f[_0x54be('0x14')](0x1f4,_0x5ccf5b['message']));});});};exports[_0x54be('0x3d')]=function(_0x479e44){var _0x1c2320=this;return new Promise(function(_0x4e72a8,_0x4c4718){return db[_0x54be('0x20')][_0x54be('0x21')]()[_0x54be('0x10')](function(){return db[_0x54be('0x22')]['transaction'](function(_0x4a5ec3){return db[_0x54be('0x7')]['findAll']({'where':_0x479e44[_0x54be('0x9')]?_0x479e44[_0x54be('0x9')]['where']||null:null,'attributes':_0x479e44[_0x54be('0x9')]?_0x479e44[_0x54be('0x9')][_0x54be('0xe')]||null:null,'limit':0x1,'order':_0x479e44[_0x54be('0x9')]?_0x479e44['options'][_0x54be('0x23')]||null:null,'group':db['CmHopper'][_0x54be('0x2b')],'transaction':_0x4a5ec3,'lock':_0x4a5ec3[_0x54be('0x3e')][_0x54be('0x24')],'include':_0x479e44['options']?_0x479e44[_0x54be('0x9')][_0x54be('0xc')]?_[_0x54be('0xd')](_0x479e44[_0x54be('0x9')]['include'],function(_0x115604){return{'model':db[_0x115604['model']],'as':_0x115604['as'],'attributes':_0x115604[_0x54be('0xe')],'include':_0x115604[_0x54be('0xc')]?_[_0x54be('0xd')](_0x115604[_0x54be('0xc')],function(_0x31ce35){return{'model':db[_0x31ce35['model']],'as':_0x31ce35['as'],'attributes':_0x31ce35[_0x54be('0xe')],'include':_0x31ce35[_0x54be('0xc')]?_[_0x54be('0xd')](_0x31ce35[_0x54be('0xc')],function(_0x57d34e){return{'model':db[_0x57d34e[_0x54be('0xf')]],'as':_0x57d34e['as'],'attributes':_0x57d34e[_0x54be('0xe')]};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x3c5b7b){var _0x34b2be=[];for(var _0xdacf86=0x0;_0xdacf86<_0x3c5b7b['length'];_0xdacf86+=0x1){_0x34b2be[_0x54be('0x2d')](_0x3c5b7b[_0xdacf86][_0x54be('0x1b')](_0x479e44['body'],{'transaction':_0x4a5ec3}));}return BPromise[_0x54be('0x2e')](_0x34b2be);});})[_0x54be('0x10')](function(_0x59e40c){logger[_0x54be('0x11')](_0x54be('0x3d'),_0x479e44);logger[_0x54be('0x17')](_0x54be('0x3d'),_0x479e44,JSON[_0x54be('0x12')](_0x59e40c));_0x4e72a8(_0x59e40c);})[_0x54be('0x13')](function(_0x184906){logger[_0x54be('0x14')](_0x54be('0x3d'),_0x184906[_0x54be('0x18')],_0x479e44);_0x4c4718(_0x1c2320[_0x54be('0x14')](0x1f4,_0x184906[_0x54be('0x18')]));});});});};exports[_0x54be('0x3f')]=function(_0x274516){var _0x55567c=this;return new Promise(function(_0x130651,_0x1308d6){db[_0x54be('0x20')]['describe']()[_0x54be('0x10')](function(_0x419e7f){return db[_0x54be('0x7')][_0x54be('0x8')]({'raw':_0x274516['options']?_0x274516[_0x54be('0x9')][_0x54be('0xa')]===undefined?!![]:![]:!![],'where':_0x274516[_0x54be('0x9')]?_0x274516[_0x54be('0x9')][_0x54be('0x1c')]||null:null,'attributes':_0x274516[_0x54be('0x9')]?_0x274516[_0x54be('0x9')][_0x54be('0xe')]||null:null,'limit':_0x274516['options']?_0x274516[_0x54be('0x9')]['limit']||null:null,'include':_0x274516['options']?_0x274516[_0x54be('0x9')][_0x54be('0xc')]?_[_0x54be('0xd')](_0x274516[_0x54be('0x9')][_0x54be('0xc')],function(_0x1a0fd3){return{'model':db[_0x1a0fd3[_0x54be('0xf')]],'as':_0x1a0fd3['as'],'attributes':_0x1a0fd3['as']===_0x54be('0x40')?_[_0x54be('0x25')](_0x419e7f):_0x1a0fd3[_0x54be('0xe')],'include':_0x1a0fd3[_0x54be('0xc')]?_[_0x54be('0xd')](_0x1a0fd3['include'],function(_0xacf531){return{'model':db[_0xacf531[_0x54be('0xf')]],'as':_0xacf531['as'],'attributes':_0xacf531[_0x54be('0xe')],'include':_0xacf531[_0x54be('0xc')]?_[_0x54be('0xd')](_0xacf531[_0x54be('0xc')],function(_0x15136e){return{'model':db[_0x15136e[_0x54be('0xf')]],'as':_0x15136e['as'],'attributes':_0x15136e['attributes']};}):[]};}):[]};}):[]:[]})[_0x54be('0x10')](function(_0x574170){logger[_0x54be('0x11')](_0x54be('0x6'),_0x274516);logger[_0x54be('0x17')](_0x54be('0x6'),_0x274516,JSON[_0x54be('0x12')](_0x574170));_0x130651(_0x574170);})[_0x54be('0x13')](function(_0x9fcb27){logger[_0x54be('0x14')](_0x54be('0x6'),_0x9fcb27[_0x54be('0x18')],_0x274516);_0x1308d6(_0x55567c['error'](0x1f4,_0x9fcb27[_0x54be('0x18')]));});});});};exports[_0x54be('0x41')]=function(_0x35c500){var _0x3fe09f=this;return new Promise(function(_0x42ac0e,_0x343705){return db[_0x54be('0x20')][_0x54be('0x42')]({'raw':!![],'where':{'phone':_0x35c500[_0x54be('0x9')][_0x54be('0x1c')]['phone']},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x54be('0x10')](function(_0x4c21dd){logger[_0x54be('0x11')](_0x54be('0x43'),_0x35c500);logger[_0x54be('0x17')]('getContactByPhone',_0x35c500,JSON[_0x54be('0x12')](_0x4c21dd));_0x42ac0e(_0x4c21dd);})[_0x54be('0x13')](function(_0x27620b){logger['error'](_0x54be('0x43'),_0x27620b[_0x54be('0x18')],_0x35c500);_0x343705(_0x3fe09f[_0x54be('0x14')](0x1f4,_0x27620b['message']));});});};exports[_0x54be('0x44')]=function(_0x323d62){var _0x1dd0d0=this;return new Promise(function(_0x20bdff,_0x32208e){return db[_0x54be('0x22')][_0x54be('0x34')](function(_0xb4a09b){var _0x223730=_0x323d62[_0x54be('0x9')]&&_0x323d62[_0x54be('0x9')][_0x54be('0x1c')]?_0x323d62[_0x54be('0x9')]['where']:{};return db[_0x54be('0x7')]['update'](_0x323d62[_0x54be('0x2c')],{'where':_0x223730,'transaction':_0xb4a09b})[_0x54be('0x10')](function(_0xda9920){logger[_0x54be('0x11')](_0x54be('0x44'),_0x323d62);logger[_0x54be('0x17')](_0x54be('0x44'),_0x323d62,JSON[_0x54be('0x12')](_0xda9920));_0x20bdff(_0xda9920);})[_0x54be('0x13')](function(_0x4f2a75){logger[_0x54be('0x14')](_0x54be('0x44'),_0x4f2a75[_0x54be('0x18')],_0x323d62);_0x32208e(_0x1dd0d0[_0x54be('0x14')](0x1f4,_0x4f2a75[_0x54be('0x18')]));});});});};exports[_0x54be('0x45')]=function(_0xed3ac2){var _0xb4c9f3=this;var _0xd9af90=_0xed3ac2['body'][_0x54be('0x1c')][_0x54be('0x46')];var _0x3771c4=_0xed3ac2[_0x54be('0x2c')]['where']['interval'];var _0x13f9a2=_0xed3ac2[_0x54be('0x2c')][_0x54be('0x1c')][_0x54be('0x47')];return new Promise(function(_0x19effd,_0x496753){return db[_0x54be('0x7')][_0x54be('0x8')]({'where':{'voiceQueueId':{'$in':_0xd9af90},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x54be('0x22')][_0x54be('0x48')](_0x54be('0x49')+_0x3771c4+_0x54be('0x4a')),'$gt':db['sequelize'][_0x54be('0x48')]('NOW()')}},'UserId':{'$in':_0x13f9a2}},'include':[{'model':db[_0x54be('0x20')],'as':_0x54be('0x40')},{'model':db[_0x54be('0x26')],'as':_0x54be('0x27'),'attributes':['id',_0x54be('0x28'),'voicePause']},{'model':db[_0x54be('0x4b')],'as':_0x54be('0x4c')}]})[_0x54be('0x10')](function(_0x461816){if(_0x461816[_0x54be('0x2a')]>0x0){return db[_0x54be('0x22')][_0x54be('0x34')](function(_0x2661ca){return db[_0x54be('0x7')][_0x54be('0x1b')]({'recallmeNotifiedDate':db[_0x54be('0x22')][_0x54be('0x48')](_0x54be('0x4d'))},{'where':{'id':{'$in':_[_0x54be('0xd')](_0x461816,'id')}},'transaction':_0x2661ca})[_0x54be('0x10')](function(){_0x19effd(_0x461816);})[_0x54be('0x13')](function(_0x4ec2ba){logger['error'](_0x54be('0x45'),_0x4ec2ba[_0x54be('0x18')],_0xed3ac2);_0x496753(_0xb4c9f3[_0x54be('0x14')](0x1f4,_0x4ec2ba[_0x54be('0x18')]));});})['catch'](function(_0x51a1cd){logger['error'](_0x54be('0x45'),_0x51a1cd[_0x54be('0x18')],_0xed3ac2);_0x496753(_0xb4c9f3['error'](0x1f4,_0x51a1cd[_0x54be('0x18')]));});}else{_0x19effd(_0x461816);}});});};
\ No newline at end of file
index 9af0e6b..4ac4884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x506d=['getTimezone','put','update','delete','exports','express','Router','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone'];(function(_0x38bbec,_0x1b542e){var _0x27e9dc=function(_0x369c07){while(--_0x369c07){_0x38bbec['push'](_0x38bbec['shift']());}};_0x27e9dc(++_0x1b542e);}(_0x506d,0x1d9));var _0xd506=function(_0x5712ba,_0x4e8568){_0x5712ba=_0x5712ba-0x0;var _0x539d69=_0x506d[_0x5712ba];return _0x539d69;};'use strict';var express=require(_0xd506('0x0'));var router=express[_0xd506('0x1')]();var auth=require(_0xd506('0x2'));var controller=require(_0xd506('0x3'));router[_0xd506('0x4')]('/',auth[_0xd506('0x5')](),controller[_0xd506('0x6')]);router[_0xd506('0x4')](_0xd506('0x7'),auth['isAuthenticated'](),controller[_0xd506('0x8')]);router['get'](_0xd506('0x9'),auth[_0xd506('0x5')](),controller[_0xd506('0xa')]);router[_0xd506('0x4')](_0xd506('0xb'),auth[_0xd506('0x5')](),controller[_0xd506('0xc')]);router[_0xd506('0x4')](_0xd506('0xd'),auth[_0xd506('0x5')](),controller['show']);router['get'](_0xd506('0xe'),auth[_0xd506('0x5')](),controller[_0xd506('0xf')]);router[_0xd506('0x10')]('/',auth[_0xd506('0x5')](),controller[_0xd506('0x11')]);router['post'](_0xd506('0x12'),auth[_0xd506('0x5')](),controller[_0xd506('0x13')]);router[_0xd506('0x10')](_0xd506('0x14'),auth[_0xd506('0x5')](),controller[_0xd506('0x15')]);router[_0xd506('0x16')](_0xd506('0xd'),auth[_0xd506('0x5')](),controller[_0xd506('0x17')]);router[_0xd506('0x18')](_0xd506('0xd'),auth[_0xd506('0x5')](),controller['destroy']);module[_0xd506('0x19')]=router;
\ No newline at end of file
+var _0x9545=['delete','destroy','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','index','describe','/opencontacts','getOpenContacts','getTimezones','/:id','show','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','update'];(function(_0x385b0b,_0x2faffa){var _0x50c84b=function(_0x355800){while(--_0x355800){_0x385b0b['push'](_0x385b0b['shift']());}};_0x50c84b(++_0x2faffa);}(_0x9545,0xe8));var _0x5954=function(_0x5962b4,_0x84be73){_0x5962b4=_0x5962b4-0x0;var _0xe6443c=_0x9545[_0x5962b4];return _0xe6443c;};'use strict';var express=require(_0x5954('0x0'));var router=express['Router']();var auth=require(_0x5954('0x1'));var controller=require(_0x5954('0x2'));router[_0x5954('0x3')]('/',auth[_0x5954('0x4')](),controller[_0x5954('0x5')]);router[_0x5954('0x3')]('/describe',auth[_0x5954('0x4')](),controller[_0x5954('0x6')]);router['get'](_0x5954('0x7'),auth[_0x5954('0x4')](),controller[_0x5954('0x8')]);router[_0x5954('0x3')]('/timezones',auth[_0x5954('0x4')](),controller[_0x5954('0x9')]);router[_0x5954('0x3')](_0x5954('0xa'),auth[_0x5954('0x4')](),controller[_0x5954('0xb')]);router['get']('/:id/previewrecall',auth[_0x5954('0x4')](),controller[_0x5954('0xc')]);router[_0x5954('0xd')]('/',auth['isAuthenticated'](),controller[_0x5954('0xe')]);router['post'](_0x5954('0xf'),auth[_0x5954('0x4')](),controller[_0x5954('0x10')]);router[_0x5954('0xd')](_0x5954('0x11'),auth[_0x5954('0x4')](),controller[_0x5954('0x12')]);router[_0x5954('0x13')]('/:id',auth[_0x5954('0x4')](),controller[_0x5954('0x14')]);router[_0x5954('0x15')]('/:id',auth[_0x5954('0x4')](),controller[_0x5954('0x16')]);module['exports']=router;
\ No newline at end of file
index 47a9494..d25ebbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x339a=['INTEGER','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x296652,_0x46b259){var _0x43dbab=function(_0x46d86e){while(--_0x46d86e){_0x296652['push'](_0x296652['shift']());}};_0x43dbab(++_0x46b259);}(_0x339a,0x12d));var _0xa339=function(_0x4ce20f,_0xad2d46){_0x4ce20f=_0x4ce20f-0x0;var _0x20bda4=_0x339a[_0x4ce20f];return _0x20bda4;};'use strict';var moment=require(_0xa339('0x0'));var Sequelize=require(_0xa339('0x1'));module[_0xa339('0x2')]={'CmHopperId':{'type':Sequelize[_0xa339('0x3')]},'phone':{'type':Sequelize[_0xa339('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa339('0x5')],'defaultValue':moment()[_0xa339('0x6')](_0xa339('0x7'))},'countbusyretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa339('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4b3b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING'];(function(_0x33a253,_0x3bd729){var _0x166d51=function(_0x9cf8b1){while(--_0x9cf8b1){_0x33a253['push'](_0x33a253['shift']());}};_0x166d51(++_0x3bd729);}(_0x4b3b,0x19b));var _0xb4b3=function(_0x394a8f,_0x202459){_0x394a8f=_0x394a8f-0x0;var _0x11dcbf=_0x4b3b[_0x394a8f];return _0x11dcbf;};'use strict';var moment=require(_0xb4b3('0x0'));var Sequelize=require(_0xb4b3('0x1'));module[_0xb4b3('0x2')]={'CmHopperId':{'type':Sequelize[_0xb4b3('0x3')]},'phone':{'type':Sequelize[_0xb4b3('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xb4b3('0x5')],'defaultValue':moment()[_0xb4b3('0x6')](_0xb4b3('0x7'))},'countbusyretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb4b3('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 37d2a49..7cc440b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab22=['to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','fieldName','type','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','VIRTUAL','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0xab22,0x14b));var _0x2ab2=function(_0xe5ad59,_0x4354ae){_0xe5ad59=_0xe5ad59-0x0;var _0x15df32=_0xab22[_0xe5ad59];return _0x15df32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ab2('0x0'));var zipdir=require(_0x2ab2('0x1'));var jsonpatch=require(_0x2ab2('0x2'));var rp=require(_0x2ab2('0x3'));var moment=require('moment');var BPromise=require(_0x2ab2('0x4'));var Mustache=require(_0x2ab2('0x5'));var util=require(_0x2ab2('0x6'));var path=require(_0x2ab2('0x7'));var sox=require(_0x2ab2('0x8'));var csv=require(_0x2ab2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ab2('0xa'));var _=require(_0x2ab2('0xb'));var squel=require(_0x2ab2('0xc'));var crypto=require(_0x2ab2('0xd'));var jsforce=require(_0x2ab2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2ab2('0x9'));var querystring=require(_0x2ab2('0xf'));var Papa=require(_0x2ab2('0x10'));var Redis=require(_0x2ab2('0x11'));var authService=require(_0x2ab2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2ab2('0x13'));var hardwareService=require(_0x2ab2('0x14'));var logger=require(_0x2ab2('0x15'))(_0x2ab2('0x16'));var utils=require('../../config/utils');var config=require(_0x2ab2('0x17'));var licenseUtil=require(_0x2ab2('0x18'));var db=require(_0x2ab2('0x19'))['db'];function respondWithStatusCode(_0x27bdad,_0x2a1a0a){_0x2a1a0a=_0x2a1a0a||0xcc;return function(_0x4f9930){if(_0x4f9930){return _0x27bdad[_0x2ab2('0x1a')](_0x2a1a0a);}return _0x27bdad[_0x2ab2('0x1b')](_0x2a1a0a)[_0x2ab2('0x1c')]();};}function respondWithResult(_0x4dbd7a,_0x3decbb){_0x3decbb=_0x3decbb||0xc8;return function(_0x3c4a1e){if(_0x3c4a1e){return _0x4dbd7a[_0x2ab2('0x1b')](_0x3decbb)[_0x2ab2('0x1d')](_0x3c4a1e);}};}function respondWithFilteredResult(_0x222d3c,_0x1b1fa1){return function(_0xf54135){if(_0xf54135){var _0x2adb8a=typeof _0x1b1fa1[_0x2ab2('0x1e')]===_0x2ab2('0x1f')&&typeof _0x1b1fa1[_0x2ab2('0x20')]===_0x2ab2('0x1f');var _0x647e38=_0xf54135[_0x2ab2('0x21')];var _0x340f08=_0x2adb8a?0x0:_0x1b1fa1[_0x2ab2('0x1e')];var _0x4c6adc=_0x2adb8a?_0xf54135[_0x2ab2('0x21')]:_0x1b1fa1['offset']+_0x1b1fa1[_0x2ab2('0x20')];var _0x5af32f;if(_0x4c6adc>=_0x647e38){_0x4c6adc=_0x647e38;_0x5af32f=0xc8;}else{_0x5af32f=0xce;}_0x222d3c[_0x2ab2('0x1b')](_0x5af32f);return _0x222d3c[_0x2ab2('0x22')](_0x2ab2('0x23'),_0x340f08+'-'+_0x4c6adc+'/'+_0x647e38)['json'](_0xf54135);}return null;};}function patchUpdates(_0x18c544){return function(_0x1152d5){try{jsonpatch[_0x2ab2('0x24')](_0x1152d5,_0x18c544,!![]);}catch(_0xdb1c3a){return BPromise[_0x2ab2('0x25')](_0xdb1c3a);}return _0x1152d5[_0x2ab2('0x26')]();};}function saveUpdates(_0x4b6f81,_0x5819c1){return function(_0x47e50e){if(_0x47e50e){return _0x47e50e[_0x2ab2('0x27')](_0x4b6f81)[_0x2ab2('0x28')](function(_0x5ae580){return _0x5ae580;});}return null;};}function removeEntity(_0x2cf76f,_0x20a4aa){return function(_0x261a18){if(_0x261a18){return _0x261a18[_0x2ab2('0x29')]()['then'](function(){var _0x3e563d=_0x261a18[_0x2ab2('0x2a')]({'plain':!![]});var _0x348935='CmHopperAdditionalPhones';return db[_0x2ab2('0x2b')]['destroy']({'where':{'type':_0x348935,'resourceId':_0x3e563d['id']}})[_0x2ab2('0x28')](function(){return _0x261a18;});})[_0x2ab2('0x28')](function(){_0x2cf76f[_0x2ab2('0x1b')](0xcc)[_0x2ab2('0x1c')]();});}};}function handleEntityNotFound(_0x58c787,_0x3df6bc){return function(_0x4a414c){if(!_0x4a414c){_0x58c787[_0x2ab2('0x1a')](0x194);}return _0x4a414c;};}function handleError(_0x3d603f,_0x514646){_0x514646=_0x514646||0x1f4;return function(_0x3885d4){logger[_0x2ab2('0x2c')](_0x3885d4[_0x2ab2('0x2d')]);if(_0x3885d4[_0x2ab2('0x2e')]){delete _0x3885d4['name'];}_0x3d603f[_0x2ab2('0x1b')](_0x514646)[_0x2ab2('0x2f')](_0x3885d4);};}exports['index']=function(_0x1a8399,_0x25b555){var _0x31a896={},_0x467832={},_0x1807bf={'count':0x0,'rows':[]};var _0x120622=_[_0x2ab2('0x30')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x52461f){return{'name':_0x52461f[_0x2ab2('0x31')],'type':_0x52461f[_0x2ab2('0x32')]['key']};});_0x467832[_0x2ab2('0x33')]=_[_0x2ab2('0x30')](_0x120622,_0x2ab2('0x2e'));_0x467832[_0x2ab2('0x34')]=_['keys'](_0x1a8399[_0x2ab2('0x34')]);_0x467832[_0x2ab2('0x35')]=_[_0x2ab2('0x36')](_0x467832[_0x2ab2('0x33')],_0x467832[_0x2ab2('0x34')]);_0x31a896[_0x2ab2('0x37')]=_[_0x2ab2('0x36')](_0x467832['model'],qs[_0x2ab2('0x38')](_0x1a8399[_0x2ab2('0x34')]['fields']));_0x31a896[_0x2ab2('0x37')]=_0x31a896['attributes']['length']?_0x31a896[_0x2ab2('0x37')]:_0x467832[_0x2ab2('0x33')];if(!_0x1a8399['query']['hasOwnProperty']('nolimit')){_0x31a896[_0x2ab2('0x20')]=qs['limit'](_0x1a8399[_0x2ab2('0x34')][_0x2ab2('0x20')]);_0x31a896['offset']=qs['offset'](_0x1a8399[_0x2ab2('0x34')][_0x2ab2('0x1e')]);}_0x31a896[_0x2ab2('0x39')]=qs[_0x2ab2('0x3a')](_0x1a8399['query']['sort']);_0x31a896[_0x2ab2('0x3b')]=qs[_0x2ab2('0x35')](_[_0x2ab2('0x3c')](_0x1a8399[_0x2ab2('0x34')],_0x467832[_0x2ab2('0x35')]),_0x120622);if(_0x1a8399['query'][_0x2ab2('0x3d')]){_0x31a896['where']=_['merge'](_0x31a896[_0x2ab2('0x3b')],{'$or':_[_0x2ab2('0x30')](_0x120622,function(_0x21bb5c){if(_0x21bb5c['type']!==_0x2ab2('0x3e')){var _0x113e9f={};_0x113e9f[_0x21bb5c[_0x2ab2('0x2e')]]={'$like':'%'+_0x1a8399[_0x2ab2('0x34')]['filter']+'%'};return _0x113e9f;}})});}_0x31a896=_['merge']({},_0x31a896,_0x1a8399['options']);var _0x3a8d0f={'where':_0x31a896[_0x2ab2('0x3b')]};return db[_0x2ab2('0x3f')][_0x2ab2('0x21')](_0x3a8d0f)['then'](function(_0x49b350){_0x1807bf[_0x2ab2('0x21')]=_0x49b350;if(_0x1a8399[_0x2ab2('0x34')][_0x2ab2('0x40')]){_0x31a896[_0x2ab2('0x41')]=[{'all':!![]}];}return db[_0x2ab2('0x3f')][_0x2ab2('0x42')](_0x31a896);})[_0x2ab2('0x28')](function(_0x5970ff){_0x1807bf[_0x2ab2('0x43')]=_0x5970ff;return _0x1807bf;})[_0x2ab2('0x28')](respondWithFilteredResult(_0x25b555,_0x31a896))[_0x2ab2('0x44')](handleError(_0x25b555,null));};exports[_0x2ab2('0x45')]=function(_0x27e887,_0x142662){var _0x4bc02a={'raw':!![],'where':{'id':_0x27e887[_0x2ab2('0x46')]['id']}},_0x9daa4f={};_0x9daa4f[_0x2ab2('0x33')]=_['keys'](db['CmHopperAdditionalPhone'][_0x2ab2('0x47')]);_0x9daa4f[_0x2ab2('0x34')]=_[_0x2ab2('0x48')](_0x27e887['query']);_0x9daa4f['filters']=_[_0x2ab2('0x36')](_0x9daa4f[_0x2ab2('0x33')],_0x9daa4f[_0x2ab2('0x34')]);_0x4bc02a[_0x2ab2('0x37')]=_[_0x2ab2('0x36')](_0x9daa4f[_0x2ab2('0x33')],qs['fields'](_0x27e887['query'][_0x2ab2('0x38')]));_0x4bc02a[_0x2ab2('0x37')]=_0x4bc02a[_0x2ab2('0x37')]['length']?_0x4bc02a['attributes']:_0x9daa4f[_0x2ab2('0x33')];if(_0x27e887[_0x2ab2('0x34')][_0x2ab2('0x40')]){_0x4bc02a['include']=[{'all':!![]}];}_0x4bc02a=_[_0x2ab2('0x49')]({},_0x4bc02a,_0x27e887[_0x2ab2('0x4a')]);return db[_0x2ab2('0x3f')][_0x2ab2('0x4b')](_0x4bc02a)[_0x2ab2('0x28')](handleEntityNotFound(_0x142662,null))[_0x2ab2('0x28')](respondWithResult(_0x142662,null))[_0x2ab2('0x44')](handleError(_0x142662,null));};exports['create']=function(_0x286b66,_0x4eefc9){return db[_0x2ab2('0x3f')][_0x2ab2('0x4c')](_0x286b66[_0x2ab2('0x4d')],{})[_0x2ab2('0x28')](function(_0xad599f){var _0x4cf268=_0x286b66[_0x2ab2('0x4e')][_0x2ab2('0x2a')]({'plain':!![]});if(!_0x4cf268)throw new Error(_0x2ab2('0x4f'));if(_0x4cf268[_0x2ab2('0x50')]==='user'){var _0x142a72=_0xad599f[_0x2ab2('0x2a')]({'plain':!![]});var _0x194fb9=_0x2ab2('0x51');return db[_0x2ab2('0x52')][_0x2ab2('0x4b')]({'where':{'name':_0x194fb9,'userProfileId':_0x4cf268['userProfileId']},'raw':!![]})[_0x2ab2('0x28')](function(_0x5954a9){if(_0x5954a9&&_0x5954a9[_0x2ab2('0x53')]===0x0){return db['UserProfileResource'][_0x2ab2('0x4c')]({'name':_0x142a72['name'],'resourceId':_0x142a72['id'],'type':_0x5954a9[_0x2ab2('0x2e')],'sectionId':_0x5954a9['id']},{})[_0x2ab2('0x28')](function(){return _0xad599f;});}else{return _0xad599f;}})['catch'](function(_0xdc5379){logger[_0x2ab2('0x2c')](_0x2ab2('0x54'),_0xdc5379);throw _0xdc5379;});}return _0xad599f;})[_0x2ab2('0x28')](respondWithResult(_0x4eefc9,0xc9))[_0x2ab2('0x44')](handleError(_0x4eefc9,null));};exports[_0x2ab2('0x27')]=function(_0x3430b8,_0x3b11b1){if(_0x3430b8[_0x2ab2('0x4d')]['id']){delete _0x3430b8[_0x2ab2('0x4d')]['id'];}return db[_0x2ab2('0x3f')][_0x2ab2('0x4b')]({'where':{'id':_0x3430b8[_0x2ab2('0x46')]['id']}})[_0x2ab2('0x28')](handleEntityNotFound(_0x3b11b1,null))[_0x2ab2('0x28')](saveUpdates(_0x3430b8[_0x2ab2('0x4d')],null))[_0x2ab2('0x28')](respondWithResult(_0x3b11b1,null))[_0x2ab2('0x44')](handleError(_0x3b11b1,null));};exports['destroy']=function(_0x11e37f,_0x597c32){return db[_0x2ab2('0x3f')]['find']({'where':{'id':_0x11e37f['params']['id']}})[_0x2ab2('0x28')](handleEntityNotFound(_0x597c32,null))['then'](removeEntity(_0x597c32,null))[_0x2ab2('0x44')](handleError(_0x597c32,null));};
\ No newline at end of file
+var _0xbb4e=['intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','CmHopperAdditionalPhones','UserProfileResource','then','error','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','query','keys','filters'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0xbb4e,0x1be));var _0xebb4=function(_0x403115,_0x2d6d03){_0x403115=_0x403115-0x0;var _0x596ef3=_0xbb4e[_0x403115];return _0x596ef3;};'use strict';var emlformat=require(_0xebb4('0x0'));var rimraf=require(_0xebb4('0x1'));var zipdir=require(_0xebb4('0x2'));var jsonpatch=require(_0xebb4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xebb4('0x4'));var Mustache=require(_0xebb4('0x5'));var util=require(_0xebb4('0x6'));var path=require(_0xebb4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebb4('0x8'));var _=require(_0xebb4('0x9'));var squel=require('squel');var crypto=require(_0xebb4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xebb4('0xb'));var toCsv=require(_0xebb4('0xc'));var querystring=require(_0xebb4('0xd'));var Papa=require(_0xebb4('0xe'));var Redis=require(_0xebb4('0xf'));var authService=require(_0xebb4('0x10'));var qs=require(_0xebb4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xebb4('0x12'))(_0xebb4('0x13'));var utils=require(_0xebb4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xebb4('0x15'));var db=require(_0xebb4('0x16'))['db'];function respondWithStatusCode(_0xf4a161,_0x1efad2){_0x1efad2=_0x1efad2||0xcc;return function(_0x42e399){if(_0x42e399){return _0xf4a161[_0xebb4('0x17')](_0x1efad2);}return _0xf4a161[_0xebb4('0x18')](_0x1efad2)[_0xebb4('0x19')]();};}function respondWithResult(_0x5a6a2b,_0xd265cd){_0xd265cd=_0xd265cd||0xc8;return function(_0x150196){if(_0x150196){return _0x5a6a2b[_0xebb4('0x18')](_0xd265cd)[_0xebb4('0x1a')](_0x150196);}};}function respondWithFilteredResult(_0x409698,_0x23024e){return function(_0xb2f857){if(_0xb2f857){var _0x4fb60f=typeof _0x23024e[_0xebb4('0x1b')]===_0xebb4('0x1c')&&typeof _0x23024e[_0xebb4('0x1d')]===_0xebb4('0x1c');var _0x4ba0f4=_0xb2f857[_0xebb4('0x1e')];var _0x1900c2=_0x4fb60f?0x0:_0x23024e[_0xebb4('0x1b')];var _0x1d9e4e=_0x4fb60f?_0xb2f857[_0xebb4('0x1e')]:_0x23024e[_0xebb4('0x1b')]+_0x23024e[_0xebb4('0x1d')];var _0x12e5ec;if(_0x1d9e4e>=_0x4ba0f4){_0x1d9e4e=_0x4ba0f4;_0x12e5ec=0xc8;}else{_0x12e5ec=0xce;}_0x409698[_0xebb4('0x18')](_0x12e5ec);return _0x409698[_0xebb4('0x1f')](_0xebb4('0x20'),_0x1900c2+'-'+_0x1d9e4e+'/'+_0x4ba0f4)[_0xebb4('0x1a')](_0xb2f857);}return null;};}function patchUpdates(_0x556dd7){return function(_0x4fe4d7){try{jsonpatch[_0xebb4('0x21')](_0x4fe4d7,_0x556dd7,!![]);}catch(_0x2deef5){return BPromise[_0xebb4('0x22')](_0x2deef5);}return _0x4fe4d7['save']();};}function saveUpdates(_0x171486,_0x593e2b){return function(_0x5b7dc2){if(_0x5b7dc2){return _0x5b7dc2[_0xebb4('0x23')](_0x171486)['then'](function(_0x31f615){return _0x31f615;});}return null;};}function removeEntity(_0xc4d9e4,_0x2f7313){return function(_0x46828e){if(_0x46828e){return _0x46828e[_0xebb4('0x24')]()['then'](function(){var _0x16e1ab=_0x46828e['get']({'plain':!![]});var _0x54d6a1=_0xebb4('0x25');return db[_0xebb4('0x26')][_0xebb4('0x24')]({'where':{'type':_0x54d6a1,'resourceId':_0x16e1ab['id']}})[_0xebb4('0x27')](function(){return _0x46828e;});})['then'](function(){_0xc4d9e4[_0xebb4('0x18')](0xcc)[_0xebb4('0x19')]();});}};}function handleEntityNotFound(_0x41ac33,_0x28a0ba){return function(_0x409f0b){if(!_0x409f0b){_0x41ac33['sendStatus'](0x194);}return _0x409f0b;};}function handleError(_0x30f19c,_0x50ee2e){_0x50ee2e=_0x50ee2e||0x1f4;return function(_0x44dc82){logger[_0xebb4('0x28')](_0x44dc82['stack']);if(_0x44dc82[_0xebb4('0x29')]){delete _0x44dc82[_0xebb4('0x29')];}_0x30f19c[_0xebb4('0x18')](_0x50ee2e)[_0xebb4('0x2a')](_0x44dc82);};}exports[_0xebb4('0x2b')]=function(_0x40ec51,_0x50fd67){var _0xfec350={},_0x16875d={},_0x3ecf67={'count':0x0,'rows':[]};var _0x4e57c5=_[_0xebb4('0x2c')](db[_0xebb4('0x2d')][_0xebb4('0x2e')],function(_0x1c6add){return{'name':_0x1c6add[_0xebb4('0x2f')],'type':_0x1c6add[_0xebb4('0x30')]['key']};});_0x16875d['model']=_['map'](_0x4e57c5,_0xebb4('0x29'));_0x16875d[_0xebb4('0x31')]=_[_0xebb4('0x32')](_0x40ec51[_0xebb4('0x31')]);_0x16875d[_0xebb4('0x33')]=_[_0xebb4('0x34')](_0x16875d['model'],_0x16875d[_0xebb4('0x31')]);_0xfec350[_0xebb4('0x35')]=_[_0xebb4('0x34')](_0x16875d[_0xebb4('0x36')],qs[_0xebb4('0x37')](_0x40ec51[_0xebb4('0x31')][_0xebb4('0x37')]));_0xfec350[_0xebb4('0x35')]=_0xfec350['attributes'][_0xebb4('0x38')]?_0xfec350[_0xebb4('0x35')]:_0x16875d[_0xebb4('0x36')];if(!_0x40ec51[_0xebb4('0x31')][_0xebb4('0x39')]('nolimit')){_0xfec350['limit']=qs[_0xebb4('0x1d')](_0x40ec51[_0xebb4('0x31')][_0xebb4('0x1d')]);_0xfec350['offset']=qs[_0xebb4('0x1b')](_0x40ec51[_0xebb4('0x31')]['offset']);}_0xfec350[_0xebb4('0x3a')]=qs[_0xebb4('0x3b')](_0x40ec51['query'][_0xebb4('0x3b')]);_0xfec350['where']=qs[_0xebb4('0x33')](_[_0xebb4('0x3c')](_0x40ec51['query'],_0x16875d[_0xebb4('0x33')]),_0x4e57c5);if(_0x40ec51[_0xebb4('0x31')][_0xebb4('0x3d')]){_0xfec350[_0xebb4('0x3e')]=_[_0xebb4('0x3f')](_0xfec350[_0xebb4('0x3e')],{'$or':_[_0xebb4('0x2c')](_0x4e57c5,function(_0x1f3364){if(_0x1f3364['type']!==_0xebb4('0x40')){var _0x59f9fc={};_0x59f9fc[_0x1f3364[_0xebb4('0x29')]]={'$like':'%'+_0x40ec51[_0xebb4('0x31')][_0xebb4('0x3d')]+'%'};return _0x59f9fc;}})});}_0xfec350=_['merge']({},_0xfec350,_0x40ec51[_0xebb4('0x41')]);var _0x102de8={'where':_0xfec350[_0xebb4('0x3e')]};return db['CmHopperAdditionalPhone'][_0xebb4('0x1e')](_0x102de8)['then'](function(_0x326459){_0x3ecf67[_0xebb4('0x1e')]=_0x326459;if(_0x40ec51[_0xebb4('0x31')][_0xebb4('0x42')]){_0xfec350[_0xebb4('0x43')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xebb4('0x44')](_0xfec350);})[_0xebb4('0x27')](function(_0x2e5e33){_0x3ecf67[_0xebb4('0x45')]=_0x2e5e33;return _0x3ecf67;})['then'](respondWithFilteredResult(_0x50fd67,_0xfec350))['catch'](handleError(_0x50fd67,null));};exports[_0xebb4('0x46')]=function(_0x1b707c,_0x556164){var _0x340eed={'raw':!![],'where':{'id':_0x1b707c[_0xebb4('0x47')]['id']}},_0x29dbd0={};_0x29dbd0[_0xebb4('0x36')]=_[_0xebb4('0x32')](db[_0xebb4('0x2d')][_0xebb4('0x2e')]);_0x29dbd0[_0xebb4('0x31')]=_[_0xebb4('0x32')](_0x1b707c[_0xebb4('0x31')]);_0x29dbd0['filters']=_[_0xebb4('0x34')](_0x29dbd0[_0xebb4('0x36')],_0x29dbd0['query']);_0x340eed['attributes']=_[_0xebb4('0x34')](_0x29dbd0[_0xebb4('0x36')],qs[_0xebb4('0x37')](_0x1b707c[_0xebb4('0x31')][_0xebb4('0x37')]));_0x340eed['attributes']=_0x340eed[_0xebb4('0x35')]['length']?_0x340eed[_0xebb4('0x35')]:_0x29dbd0[_0xebb4('0x36')];if(_0x1b707c['query'][_0xebb4('0x42')]){_0x340eed[_0xebb4('0x43')]=[{'all':!![]}];}_0x340eed=_['merge']({},_0x340eed,_0x1b707c['options']);return db[_0xebb4('0x2d')][_0xebb4('0x48')](_0x340eed)[_0xebb4('0x27')](handleEntityNotFound(_0x556164,null))[_0xebb4('0x27')](respondWithResult(_0x556164,null))[_0xebb4('0x49')](handleError(_0x556164,null));};exports['create']=function(_0x51fcd5,_0x587860){return db['CmHopperAdditionalPhone'][_0xebb4('0x4a')](_0x51fcd5[_0xebb4('0x4b')],{})[_0xebb4('0x27')](function(_0x17b356){var _0x5d736b=_0x51fcd5[_0xebb4('0x4c')][_0xebb4('0x4d')]({'plain':!![]});if(!_0x5d736b)throw new Error(_0xebb4('0x4e'));if(_0x5d736b['role']===_0xebb4('0x4c')){var _0xa9dba9=_0x17b356[_0xebb4('0x4d')]({'plain':!![]});var _0x4e79e1='CmHopperAdditionalPhones';return db[_0xebb4('0x4f')][_0xebb4('0x48')]({'where':{'name':_0x4e79e1,'userProfileId':_0x5d736b[_0xebb4('0x50')]},'raw':!![]})[_0xebb4('0x27')](function(_0x57697a){if(_0x57697a&&_0x57697a[_0xebb4('0x51')]===0x0){return db['UserProfileResource'][_0xebb4('0x4a')]({'name':_0xa9dba9[_0xebb4('0x29')],'resourceId':_0xa9dba9['id'],'type':_0x57697a['name'],'sectionId':_0x57697a['id']},{})[_0xebb4('0x27')](function(){return _0x17b356;});}else{return _0x17b356;}})[_0xebb4('0x49')](function(_0x1d2f18){logger[_0xebb4('0x28')](_0xebb4('0x52'),_0x1d2f18);throw _0x1d2f18;});}return _0x17b356;})['then'](respondWithResult(_0x587860,0xc9))[_0xebb4('0x49')](handleError(_0x587860,null));};exports[_0xebb4('0x23')]=function(_0xed08a4,_0x28fdc5){if(_0xed08a4['body']['id']){delete _0xed08a4[_0xebb4('0x4b')]['id'];}return db[_0xebb4('0x2d')][_0xebb4('0x48')]({'where':{'id':_0xed08a4[_0xebb4('0x47')]['id']}})['then'](handleEntityNotFound(_0x28fdc5,null))[_0xebb4('0x27')](saveUpdates(_0xed08a4['body'],null))[_0xebb4('0x27')](respondWithResult(_0x28fdc5,null))['catch'](handleError(_0x28fdc5,null));};exports[_0xebb4('0x24')]=function(_0x35fdef,_0x1089b3){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x35fdef['params']['id']}})[_0xebb4('0x27')](handleEntityNotFound(_0x1089b3,null))['then'](removeEntity(_0x1089b3,null))[_0xebb4('0x49')](handleError(_0x1089b3,null));};
\ No newline at end of file
index cab1d47..1d76228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c8=['path','../../config/environment','exports','CmHopperAdditionalPhone','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x4a9ded,_0x5f8a6e){var _0x392b48=function(_0x496189){while(--_0x496189){_0x4a9ded['push'](_0x4a9ded['shift']());}};_0x392b48(++_0x5f8a6e);}(_0xc2c8,0x1e4));var _0x8c2c=function(_0x330251,_0x44d71d){_0x330251=_0x330251-0x0;var _0x5e734f=_0xc2c8[_0x330251];return _0x5e734f;};'use strict';var _=require(_0x8c2c('0x0'));var util=require(_0x8c2c('0x1'));var logger=require(_0x8c2c('0x2'))('api');var moment=require(_0x8c2c('0x3'));var BPromise=require(_0x8c2c('0x4'));var rp=require(_0x8c2c('0x5'));var fs=require('fs');var path=require(_0x8c2c('0x6'));var rimraf=require('rimraf');var config=require(_0x8c2c('0x7'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x8c2c('0x8')]=function(_0x403620,_0x1fbb60){return _0x403620['define'](_0x8c2c('0x9'),attributes,{'tableName':'cm_hopper_additional_phones','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf682=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones'];(function(_0x1225fc,_0x24a2e1){var _0x304002=function(_0x57f347){while(--_0x57f347){_0x1225fc['push'](_0x1225fc['shift']());}};_0x304002(++_0x24a2e1);}(_0xf682,0x1a4));var _0x2f68=function(_0x274078,_0x1b48ff){_0x274078=_0x274078-0x0;var _0x1a4a8e=_0xf682[_0x274078];return _0x1a4a8e;};'use strict';var _=require('lodash');var util=require(_0x2f68('0x0'));var logger=require(_0x2f68('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f68('0x2'));var fs=require('fs');var path=require(_0x2f68('0x3'));var rimraf=require(_0x2f68('0x4'));var config=require(_0x2f68('0x5'));var attributes=require(_0x2f68('0x6'));module[_0x2f68('0x7')]=function(_0x59b25e,_0x1d8b3c){return _0x59b25e[_0x2f68('0x8')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x2f68('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bf510a0..5ee86f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2c7=['countdropretry','countabandonedretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC','countbusyretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','CmHopperAdditionalPhone','countcongestionretry'];(function(_0x49b3d7,_0x3b60d8){var _0x3bb7ab=function(_0x88c64f){while(--_0x88c64f){_0x49b3d7['push'](_0x49b3d7['shift']());}};_0x3bb7ab(++_0x3b60d8);}(_0xc2c7,0x131));var _0x7c2c=function(_0x5670d4,_0x4a4703){_0x5670d4=_0x5670d4-0x0;var _0x5c8602=_0xc2c7[_0x5670d4];return _0x5c8602;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7c2c('0x1'));var fs=require('fs');var Redis=require(_0x7c2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c2c('0x3'));var logger=require('../../config/logger')(_0x7c2c('0x4'));var config=require(_0x7c2c('0x5'));var jayson=require(_0x7c2c('0x6'));var client=jayson[_0x7c2c('0x7')][_0x7c2c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x137c6f,_0x25085f,_0x4bf8f0){return new BPromise(function(_0x54e155,_0x132b06){return client[_0x7c2c('0x9')](_0x137c6f,_0x4bf8f0)[_0x7c2c('0xa')](function(_0x3a149b){logger[_0x7c2c('0xb')](_0x7c2c('0xc'),_0x25085f,_0x7c2c('0xd'));logger[_0x7c2c('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x25085f,_0x7c2c('0xd'),JSON['stringify'](_0x3a149b));if(_0x3a149b['error']){if(_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x10')]===0x1f4){logger['error'](_0x7c2c('0xc'),_0x25085f,_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);return _0x132b06(_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);}logger[_0x7c2c('0xf')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x25085f,_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);return _0x54e155(_0x3a149b[_0x7c2c('0xf')][_0x7c2c('0x11')]);}else{logger['info'](_0x7c2c('0xc'),_0x25085f,_0x7c2c('0xd'));_0x54e155(_0x3a149b[_0x7c2c('0x12')][_0x7c2c('0x11')]);}})[_0x7c2c('0x13')](function(_0x42ae8c){logger[_0x7c2c('0xf')](_0x7c2c('0xc'),_0x25085f,_0x42ae8c);_0x132b06(_0x42ae8c);});});}exports[_0x7c2c('0x14')]=function(_0x234097){var _0x10ccbc=this;return new Promise(function(_0x302e7f,_0x4fa30c){return db[_0x7c2c('0x15')]['findOne']({'raw':!![],'where':{'ContactId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x17')],'ListId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x18')],'VoiceQueueId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x19')]===undefined?null:_0x234097['body'][_0x7c2c('0x19')],'CampaignId':_0x234097[_0x7c2c('0x16')][_0x7c2c('0x1a')]===undefined?null:_0x234097[_0x7c2c('0x16')][_0x7c2c('0x1a')]}})[_0x7c2c('0xa')](function(_0xf6cc16){if(_0xf6cc16!=null){return db['CmHopperAdditionalPhone'][_0x7c2c('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xf6cc16['id'],'OrderBy':{'$gt':_0xf6cc16[_0x7c2c('0x1c')]}},'order':[['OrderBy',_0x7c2c('0x1d')]]})[_0x7c2c('0xa')](function(_0x322522){var _0x104cab=0x0;if(_0x322522){if(_0x322522[_0x7c2c('0x1e')]+_0x322522['countcongestionretry']+_0x322522[_0x7c2c('0x1f')]+_0x322522[_0x7c2c('0x20')]+_0x322522['countdropretry']+_0x322522['countabandonedretry']+_0x322522[_0x7c2c('0x21')]+_0x322522[_0x7c2c('0x22')]<_0x234097['entity']['dialGlobalMaxRetry'])_0x104cab=0x1;_0x302e7f({'additional':_0x104cab});}else{return db[_0x7c2c('0x23')][_0x7c2c('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xf6cc16['id']},'order':[[_0x7c2c('0x1c'),_0x7c2c('0x1d')]]})['then'](function(_0x1f9943){var _0x27bcbf=0x0;if(_0x1f9943){if(_0x1f9943['countbusyretry']+_0x1f9943[_0x7c2c('0x24')]+_0x1f9943[_0x7c2c('0x1f')]+_0x1f9943[_0x7c2c('0x20')]+_0x1f9943[_0x7c2c('0x25')]+_0x1f9943[_0x7c2c('0x26')]+_0x1f9943[_0x7c2c('0x21')]+_0x1f9943[_0x7c2c('0x22')]<_0x234097[_0x7c2c('0x27')][_0x7c2c('0x28')])_0x27bcbf=0x1;_0x302e7f({'additional':_0x27bcbf});}else{_0x302e7f({'additional':0x0});}})[_0x7c2c('0x13')](function(_0x2a4e7b){logger[_0x7c2c('0xf')](_0x7c2c('0x14'),_0x2a4e7b[_0x7c2c('0x11')]);_0x4fa30c(_0x10ccbc[_0x7c2c('0xf')](0x1f4,_0x2a4e7b[_0x7c2c('0x11')]));});}})[_0x7c2c('0x13')](function(_0x7dd5f){logger['error'](_0x7c2c('0x14'),_0x7dd5f[_0x7c2c('0x11')]);_0x4fa30c(_0x10ccbc[_0x7c2c('0xf')](0x1f4,_0x7dd5f[_0x7c2c('0x11')]));});}else _0x302e7f({'additional':0x0});});});};exports[_0x7c2c('0x29')]=function(_0x2dc032){var _0x106124=this;return new Promise(function(_0x51695f,_0x531fb4){return db[_0x7c2c('0x15')][_0x7c2c('0x1b')]({'raw':!![],'where':{'ContactId':_0x2dc032[_0x7c2c('0x16')][_0x7c2c('0x17')],'ListId':_0x2dc032[_0x7c2c('0x16')][_0x7c2c('0x18')],'VoiceQueueId':_0x2dc032[_0x7c2c('0x16')][_0x7c2c('0x19')]===undefined?null:_0x2dc032[_0x7c2c('0x16')]['VoiceQueueId'],'CampaignId':_0x2dc032['body'][_0x7c2c('0x1a')]===undefined?null:_0x2dc032['body'][_0x7c2c('0x1a')]}})['then'](function(_0xd6023c){if(_0xd6023c!=null){return db[_0x7c2c('0x23')][_0x7c2c('0x1b')]({'raw':!![],'where':{'CmHopperId':_0xd6023c['id'],'OrderBy':{'$gte':_0xd6023c[_0x7c2c('0x1c')]}},'order':[[_0x7c2c('0x1c'),_0x7c2c('0x1d')]]})['then'](function(_0x3d8ba0){if(_0x3d8ba0)return activateAdditionalPhone(_0xd6023c,_0x2dc032[_0x7c2c('0x16')],_0x3d8ba0,_0x2dc032[_0x7c2c('0x2a')],_0x2dc032[_0x7c2c('0x2b')])[_0x7c2c('0xa')](function(_0x3f5d8c){_0x51695f(_0x3f5d8c);});else{return db[_0x7c2c('0x23')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xd6023c['id']},'order':[[_0x7c2c('0x1c'),_0x7c2c('0x1d')]]})[_0x7c2c('0xa')](function(_0x127b8f){if(_0x127b8f)return activateAdditionalPhone(_0xd6023c,_0x2dc032[_0x7c2c('0x16')],_0x127b8f,_0x2dc032[_0x7c2c('0x2a')],_0x2dc032['waitTime'])[_0x7c2c('0xa')](function(_0x2474b0){_0x51695f(_0x2474b0);});else{_0x51695f({'id':_0xd6023c['id'],'phone':''});}})[_0x7c2c('0x13')](function(_0x127059){logger['error']('VerifyAdditionalPhones',_0x127059[_0x7c2c('0x11')]);_0x531fb4(_0x106124['error'](0x1f4,_0x127059[_0x7c2c('0x11')]));});}})['catch'](function(_0x48a440){logger['error'](_0x7c2c('0x14'),_0x48a440[_0x7c2c('0x11')]);_0x531fb4(_0x106124['error'](0x1f4,_0x48a440[_0x7c2c('0x11')]));});}else _0x51695f(0x1);});});};function activateAdditionalPhone(_0x3bca46,_0x3b5414,_0x3ed36c,_0x1fa38a,_0x3c45c1){return new Promise(function(_0x4f3438,_0x18a741){var _0xc346e0;if(_[_0x7c2c('0x2c')](_0x3ed36c[_0x7c2c('0x2d')])){_0x3ed36c[_0x7c2c('0x2d')]=moment();}if(moment()>moment(_0x3ed36c[_0x7c2c('0x2d')])){_0xc346e0=moment()[_0x7c2c('0x2e')](_0x3c45c1||0x3,_0x7c2c('0x2f'));}else{if(_0x3ed36c[_0x7c2c('0x1c')]==0x0){_0xc346e0=moment(_0x3ed36c[_0x7c2c('0x2d')]);}else{_0xc346e0=moment()['add'](_0x3c45c1||0x3,'minutes');}}if(_['isNil'](_0xc346e0)){_0xc346e0=moment()[_0x7c2c('0x2e')](_0x3c45c1||0x3,_0x7c2c('0x2f'));}var _0x4ea76c={'phone':_0x3bca46[_0x7c2c('0x30')],'active':0x0,'OrderBy':_[_0x7c2c('0x2c')](_0x3bca46[_0x7c2c('0x1c')])?0x0:_0x3bca46[_0x7c2c('0x1c')],'scheduledat':moment()[_0x7c2c('0x2e')](_0x1fa38a||0x1,_0x7c2c('0x2f')),'countbusyretry':_0x3b5414[_0x7c2c('0x1e')],'countcongestionretry':_0x3b5414['countcongestionretry'],'countnoanswerretry':_0x3b5414[_0x7c2c('0x1f')],'countnosuchnumberretry':_0x3b5414['countnosuchnumberretry'],'countdropretry':_0x3b5414[_0x7c2c('0x25')],'countabandonedretry':_0x3b5414[_0x7c2c('0x26')],'countmachineretry':_0x3b5414[_0x7c2c('0x21')],'countagentrejectretry':_0x3b5414[_0x7c2c('0x22')],'createdAt':_0x3b5414[_0x7c2c('0x31')],'updatedAt':_0x3b5414[_0x7c2c('0x32')]};var _0x47bc24={'CmHopperId':_0x3bca46['id'],'phone':_0x3ed36c['phone'],'active':0x0,'OrderBy':_[_0x7c2c('0x2c')](_0x3ed36c[_0x7c2c('0x1c')])?0x0:_0x3ed36c['OrderBy'],'scheduledat':_0xc346e0,'countbusyretry':_0x3ed36c['countbusyretry'],'countcongestionretry':_0x3ed36c['countcongestionretry'],'countnoanswerretry':_0x3ed36c[_0x7c2c('0x1f')],'countnosuchnumberretry':_0x3ed36c[_0x7c2c('0x20')],'countdropretry':_0x3ed36c[_0x7c2c('0x25')],'countabandonedretry':_0x3ed36c[_0x7c2c('0x26')],'countmachineretry':_0x3ed36c[_0x7c2c('0x21')],'countagentrejectretry':_0x3ed36c[_0x7c2c('0x22')],'createdAt':_0x3ed36c[_0x7c2c('0x31')],'updatedAt':_0x3ed36c[_0x7c2c('0x32')]};return db[_0x7c2c('0x33')][_0x7c2c('0x34')](function(_0x4d23d1){return db['CmHopperAdditionalPhone'][_0x7c2c('0x35')](_0x4ea76c,{'where':{'id':_0x3ed36c['id']}},{'transaction':_0x4d23d1})[_0x7c2c('0xa')](function(){return db[_0x7c2c('0x15')][_0x7c2c('0x35')](_0x47bc24,{'where':{'id':_0x3bca46['id']}},{'transaction':_0x4d23d1});});})[_0x7c2c('0xa')](function(_0x9004f2){_0x4f3438({'id':_0x3bca46['id'],'phone':_0x3ed36c['phone']});})[_0x7c2c('0x13')](function(_0x2288b1){logger[_0x7c2c('0xf')](_0x7c2c('0x36'),_0x2288b1[_0x7c2c('0x11')]);_0x18a741({'error':_0x2288b1['message']});});});}exports[_0x7c2c('0x37')]=function(_0x14e6da){var _0x30ee29=this;return new Promise(function(_0xa09fef,_0x2a0bf2){return db[_0x7c2c('0x15')][_0x7c2c('0x35')](_0x14e6da[_0x7c2c('0x16')][_0x7c2c('0x38')],{'where':{'id':_0x14e6da[_0x7c2c('0x16')]['id']}})[_0x7c2c('0xa')](function(_0x54a131){_0xa09fef(_0x54a131);})[_0x7c2c('0x13')](function(_0x367bda){logger[_0x7c2c('0xf')](_0x7c2c('0x37'),_0x367bda[_0x7c2c('0x11')]);_0x2a0bf2(_0x30ee29['error'](0x1f4,_0x367bda[_0x7c2c('0x11')]));});});};
\ No newline at end of file
+var _0x73d3=['then','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry','countagentrejectretry','catch','CmHopper','duration','waitTime','isNil','scheduledat','minutes','add','countnoanswerretry','createdAt','updatedAt','phone','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','VerifyAdditionalPhones','ContactId','body','ListId','VoiceQueueId','CampaignId','findOne','OrderBy','ASC'];(function(_0xb8dc44,_0x226016){var _0x1698ec=function(_0x403b37){while(--_0x403b37){_0xb8dc44['push'](_0xb8dc44['shift']());}};_0x1698ec(++_0x226016);}(_0x73d3,0x15f));var _0x373d=function(_0x430b42,_0x3b2121){_0x430b42=_0x430b42-0x0;var _0x6a065c=_0x73d3[_0x430b42];return _0x6a065c;};'use strict';var _=require(_0x373d('0x0'));var util=require('util');var moment=require(_0x373d('0x1'));var BPromise=require(_0x373d('0x2'));var rs=require(_0x373d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x373d('0x4'));var logger=require(_0x373d('0x5'))('rpc');var config=require(_0x373d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x373d('0x7')][_0x373d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x177194,_0x8b5244,_0x571a53){return new BPromise(function(_0x220514,_0x14296a){return client[_0x373d('0x9')](_0x177194,_0x571a53)['then'](function(_0x4ccada){logger[_0x373d('0xa')](_0x373d('0xb'),_0x8b5244,_0x373d('0xc'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x8b5244,'request\x20sent',JSON[_0x373d('0xd')](_0x4ccada));if(_0x4ccada['error']){if(_0x4ccada[_0x373d('0xe')][_0x373d('0xf')]===0x1f4){logger[_0x373d('0xe')](_0x373d('0xb'),_0x8b5244,_0x4ccada[_0x373d('0xe')][_0x373d('0x10')]);return _0x14296a(_0x4ccada[_0x373d('0xe')][_0x373d('0x10')]);}logger[_0x373d('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x8b5244,_0x4ccada[_0x373d('0xe')]['message']);return _0x220514(_0x4ccada[_0x373d('0xe')]['message']);}else{logger[_0x373d('0xa')](_0x373d('0xb'),_0x8b5244,_0x373d('0xc'));_0x220514(_0x4ccada[_0x373d('0x11')][_0x373d('0x10')]);}})['catch'](function(_0x42b071){logger[_0x373d('0xe')](_0x373d('0xb'),_0x8b5244,_0x42b071);_0x14296a(_0x42b071);});});}exports[_0x373d('0x12')]=function(_0x12d580){var _0x241bc3=this;return new Promise(function(_0x5a51ef,_0x441dae){return db['CmHopper']['findOne']({'raw':!![],'where':{'ContactId':_0x12d580['body'][_0x373d('0x13')],'ListId':_0x12d580[_0x373d('0x14')][_0x373d('0x15')],'VoiceQueueId':_0x12d580[_0x373d('0x14')][_0x373d('0x16')]===undefined?null:_0x12d580['body'][_0x373d('0x16')],'CampaignId':_0x12d580[_0x373d('0x14')]['CampaignId']===undefined?null:_0x12d580[_0x373d('0x14')][_0x373d('0x17')]}})['then'](function(_0xaa034a){if(_0xaa034a!=null){return db['CmHopperAdditionalPhone'][_0x373d('0x18')]({'raw':!![],'where':{'CmHopperId':_0xaa034a['id'],'OrderBy':{'$gt':_0xaa034a[_0x373d('0x19')]}},'order':[[_0x373d('0x19'),_0x373d('0x1a')]]})[_0x373d('0x1b')](function(_0x3597a0){var _0xe8d193=0x0;if(_0x3597a0){if(_0x3597a0[_0x373d('0x1c')]+_0x3597a0[_0x373d('0x1d')]+_0x3597a0['countnoanswerretry']+_0x3597a0['countnosuchnumberretry']+_0x3597a0[_0x373d('0x1e')]+_0x3597a0[_0x373d('0x1f')]+_0x3597a0[_0x373d('0x20')]+_0x3597a0['countagentrejectretry']<_0x12d580[_0x373d('0x21')][_0x373d('0x22')])_0xe8d193=0x1;_0x5a51ef({'additional':_0xe8d193});}else{return db[_0x373d('0x23')]['findOne']({'raw':!![],'where':{'CmHopperId':_0xaa034a['id']},'order':[['OrderBy',_0x373d('0x1a')]]})[_0x373d('0x1b')](function(_0x2efa5d){var _0x2db722=0x0;if(_0x2efa5d){if(_0x2efa5d[_0x373d('0x1c')]+_0x2efa5d[_0x373d('0x1d')]+_0x2efa5d['countnoanswerretry']+_0x2efa5d[_0x373d('0x24')]+_0x2efa5d[_0x373d('0x1e')]+_0x2efa5d[_0x373d('0x1f')]+_0x2efa5d['countmachineretry']+_0x2efa5d[_0x373d('0x25')]<_0x12d580[_0x373d('0x21')][_0x373d('0x22')])_0x2db722=0x1;_0x5a51ef({'additional':_0x2db722});}else{_0x5a51ef({'additional':0x0});}})[_0x373d('0x26')](function(_0x169734){logger['error']('VerifyAdditionalPhones',_0x169734[_0x373d('0x10')]);_0x441dae(_0x241bc3[_0x373d('0xe')](0x1f4,_0x169734[_0x373d('0x10')]));});}})[_0x373d('0x26')](function(_0x3d3f76){logger[_0x373d('0xe')](_0x373d('0x12'),_0x3d3f76[_0x373d('0x10')]);_0x441dae(_0x241bc3['error'](0x1f4,_0x3d3f76['message']));});}else _0x5a51ef({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x46d39d){var _0xebf452=this;return new Promise(function(_0x250053,_0x294420){return db[_0x373d('0x27')]['findOne']({'raw':!![],'where':{'ContactId':_0x46d39d[_0x373d('0x14')][_0x373d('0x13')],'ListId':_0x46d39d[_0x373d('0x14')][_0x373d('0x15')],'VoiceQueueId':_0x46d39d[_0x373d('0x14')][_0x373d('0x16')]===undefined?null:_0x46d39d['body'][_0x373d('0x16')],'CampaignId':_0x46d39d[_0x373d('0x14')][_0x373d('0x17')]===undefined?null:_0x46d39d['body']['CampaignId']}})[_0x373d('0x1b')](function(_0x46136f){if(_0x46136f!=null){return db[_0x373d('0x23')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x46136f['id'],'OrderBy':{'$gte':_0x46136f['OrderBy']}},'order':[[_0x373d('0x19'),_0x373d('0x1a')]]})['then'](function(_0xb83cc0){if(_0xb83cc0)return activateAdditionalPhone(_0x46136f,_0x46d39d[_0x373d('0x14')],_0xb83cc0,_0x46d39d[_0x373d('0x28')],_0x46d39d[_0x373d('0x29')])[_0x373d('0x1b')](function(_0x35c445){_0x250053(_0x35c445);});else{return db['CmHopperAdditionalPhone'][_0x373d('0x18')]({'raw':!![],'where':{'CmHopperId':_0x46136f['id']},'order':[[_0x373d('0x19'),'ASC']]})[_0x373d('0x1b')](function(_0x1c3c8e){if(_0x1c3c8e)return activateAdditionalPhone(_0x46136f,_0x46d39d['body'],_0x1c3c8e,_0x46d39d[_0x373d('0x28')],_0x46d39d[_0x373d('0x29')])[_0x373d('0x1b')](function(_0x5d1752){_0x250053(_0x5d1752);});else{_0x250053({'id':_0x46136f['id'],'phone':''});}})[_0x373d('0x26')](function(_0xfbb743){logger[_0x373d('0xe')]('VerifyAdditionalPhones',_0xfbb743['message']);_0x294420(_0xebf452[_0x373d('0xe')](0x1f4,_0xfbb743[_0x373d('0x10')]));});}})[_0x373d('0x26')](function(_0x2c7366){logger[_0x373d('0xe')](_0x373d('0x12'),_0x2c7366[_0x373d('0x10')]);_0x294420(_0xebf452[_0x373d('0xe')](0x1f4,_0x2c7366[_0x373d('0x10')]));});}else _0x250053(0x1);});});};function activateAdditionalPhone(_0x48956c,_0x27fd24,_0x1b3528,_0x304851,_0x355708){return new Promise(function(_0x424945,_0x1bc56d){var _0x52fd63;if(_[_0x373d('0x2a')](_0x1b3528[_0x373d('0x2b')])){_0x1b3528['scheduledat']=moment();}if(moment()>moment(_0x1b3528['scheduledat'])){_0x52fd63=moment()['add'](_0x355708||0x3,_0x373d('0x2c'));}else{if(_0x1b3528[_0x373d('0x19')]==0x0){_0x52fd63=moment(_0x1b3528[_0x373d('0x2b')]);}else{_0x52fd63=moment()[_0x373d('0x2d')](_0x355708||0x3,'minutes');}}if(_['isNil'](_0x52fd63)){_0x52fd63=moment()['add'](_0x355708||0x3,_0x373d('0x2c'));}var _0x1d0fd7={'phone':_0x48956c['phone'],'active':0x0,'OrderBy':_['isNil'](_0x48956c[_0x373d('0x19')])?0x0:_0x48956c[_0x373d('0x19')],'scheduledat':moment()[_0x373d('0x2d')](_0x304851||0x1,_0x373d('0x2c')),'countbusyretry':_0x27fd24[_0x373d('0x1c')],'countcongestionretry':_0x27fd24[_0x373d('0x1d')],'countnoanswerretry':_0x27fd24[_0x373d('0x2e')],'countnosuchnumberretry':_0x27fd24[_0x373d('0x24')],'countdropretry':_0x27fd24[_0x373d('0x1e')],'countabandonedretry':_0x27fd24['countabandonedretry'],'countmachineretry':_0x27fd24[_0x373d('0x20')],'countagentrejectretry':_0x27fd24['countagentrejectretry'],'createdAt':_0x27fd24[_0x373d('0x2f')],'updatedAt':_0x27fd24[_0x373d('0x30')]};var _0x52dee5={'CmHopperId':_0x48956c['id'],'phone':_0x1b3528[_0x373d('0x31')],'active':0x0,'OrderBy':_[_0x373d('0x2a')](_0x1b3528['OrderBy'])?0x0:_0x1b3528['OrderBy'],'scheduledat':_0x52fd63,'countbusyretry':_0x1b3528['countbusyretry'],'countcongestionretry':_0x1b3528['countcongestionretry'],'countnoanswerretry':_0x1b3528['countnoanswerretry'],'countnosuchnumberretry':_0x1b3528['countnosuchnumberretry'],'countdropretry':_0x1b3528[_0x373d('0x1e')],'countabandonedretry':_0x1b3528[_0x373d('0x1f')],'countmachineretry':_0x1b3528[_0x373d('0x20')],'countagentrejectretry':_0x1b3528[_0x373d('0x25')],'createdAt':_0x1b3528[_0x373d('0x2f')],'updatedAt':_0x1b3528['updatedAt']};return db['sequelize']['transaction'](function(_0x182ddc){return db[_0x373d('0x23')][_0x373d('0x32')](_0x1d0fd7,{'where':{'id':_0x1b3528['id']}},{'transaction':_0x182ddc})[_0x373d('0x1b')](function(){return db[_0x373d('0x27')][_0x373d('0x32')](_0x52dee5,{'where':{'id':_0x48956c['id']}},{'transaction':_0x182ddc});});})['then'](function(_0x3c11c9){_0x424945({'id':_0x48956c['id'],'phone':_0x1b3528[_0x373d('0x31')]});})[_0x373d('0x26')](function(_0x369887){logger[_0x373d('0xe')](_0x373d('0x33'),_0x369887[_0x373d('0x10')]);_0x1bc56d({'error':_0x369887[_0x373d('0x10')]});});});}exports[_0x373d('0x34')]=function(_0x34001d){var _0x463306=this;return new Promise(function(_0x2e3470,_0x4eeb13){return db['CmHopper'][_0x373d('0x32')](_0x34001d[_0x373d('0x14')][_0x373d('0x35')],{'where':{'id':_0x34001d[_0x373d('0x14')]['id']}})['then'](function(_0xaf1ccd){_0x2e3470(_0xaf1ccd);})['catch'](function(_0x321220){logger['error'](_0x373d('0x34'),_0x321220[_0x373d('0x10')]);_0x4eeb13(_0x463306[_0x373d('0xe')](0x1f4,_0x321220[_0x373d('0x10')]));});});};
\ No newline at end of file
index 51e9514..efd33c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd015=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x191378,_0x2b219f){var _0x2005c0=function(_0xa01e4a){while(--_0xa01e4a){_0x191378['push'](_0x191378['shift']());}};_0x2005c0(++_0x2b219f);}(_0xd015,0x18c));var _0x5d01=function(_0x126af7,_0x25fa06){_0x126af7=_0x126af7-0x0;var _0x25b500=_0xd015[_0x126af7];return _0x25b500;};'use strict';var multer=require(_0x5d01('0x0'));var util=require(_0x5d01('0x1'));var path=require(_0x5d01('0x2'));var timeout=require(_0x5d01('0x3'));var express=require(_0x5d01('0x4'));var router=express[_0x5d01('0x5')]();var fs_extra=require(_0x5d01('0x6'));var auth=require(_0x5d01('0x7'));var interaction=require(_0x5d01('0x8'));var config=require(_0x5d01('0x9'));var controller=require(_0x5d01('0xa'));router[_0x5d01('0xb')]('/',auth[_0x5d01('0xc')](),controller['index']);router[_0x5d01('0xb')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller['show']);router[_0x5d01('0xe')]('/',auth['isAuthenticated'](),controller[_0x5d01('0xf')]);router[_0x5d01('0x10')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller[_0x5d01('0x11')]);router[_0x5d01('0x12')](_0x5d01('0xd'),auth[_0x5d01('0xc')](),controller[_0x5d01('0x13')]);module[_0x5d01('0x14')]=router;
\ No newline at end of file
+var _0x51c3=['../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1e5068,_0x31e9c4){var _0x2230b6=function(_0xaa2ee){while(--_0xaa2ee){_0x1e5068['push'](_0x1e5068['shift']());}};_0x2230b6(++_0x31e9c4);}(_0x51c3,0x111));var _0x351c=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x51c3[_0x455c6c];return _0x488242;};'use strict';var multer=require(_0x351c('0x0'));var util=require(_0x351c('0x1'));var path=require(_0x351c('0x2'));var timeout=require(_0x351c('0x3'));var express=require(_0x351c('0x4'));var router=express[_0x351c('0x5')]();var fs_extra=require(_0x351c('0x6'));var auth=require(_0x351c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x351c('0x8'));var controller=require(_0x351c('0x9'));router[_0x351c('0xa')]('/',auth[_0x351c('0xb')](),controller['index']);router[_0x351c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x351c('0xc')]);router[_0x351c('0xd')]('/',auth['isAuthenticated'](),controller[_0x351c('0xe')]);router[_0x351c('0xf')](_0x351c('0x10'),auth[_0x351c('0xb')](),controller['update']);router[_0x351c('0x11')](_0x351c('0x10'),auth['isAuthenticated'](),controller[_0x351c('0x12')]);module[_0x351c('0x13')]=router;
\ No newline at end of file
index 5134a20..8d29c11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7596=['moment','sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x1e01a5,_0x1da351){var _0x14e15a=function(_0x2128aa){while(--_0x2128aa){_0x1e01a5['push'](_0x1e01a5['shift']());}};_0x14e15a(++_0x1da351);}(_0x7596,0xa2));var _0x6759=function(_0x3c8c63,_0x5530ea){_0x3c8c63=_0x3c8c63-0x0;var _0x872537=_0x7596[_0x3c8c63];return _0x872537;};'use strict';var moment=require(_0x6759('0x0'));var Sequelize=require(_0x6759('0x1'));module[_0x6759('0x2')]={'phone':{'type':Sequelize[_0x6759('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6759('0x4')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6759('0x5')},'VoiceQueueId':{'type':Sequelize[_0x6759('0x4')],'unique':_0x6759('0x5')}};
\ No newline at end of file
+var _0x1d3c=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x20be11,_0x5d8dbe){var _0x261243=function(_0x3c6b00){while(--_0x3c6b00){_0x20be11['push'](_0x20be11['shift']());}};_0x261243(++_0x5d8dbe);}(_0x1d3c,0x6f));var _0xc1d3=function(_0x434783,_0xff395d){_0x434783=_0x434783-0x0;var _0x13efcf=_0x1d3c[_0x434783];return _0x13efcf;};'use strict';var moment=require(_0xc1d3('0x0'));var Sequelize=require(_0xc1d3('0x1'));module[_0xc1d3('0x2')]={'phone':{'type':Sequelize[_0xc1d3('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc1d3('0x4')],'unique':_0xc1d3('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xc1d3('0x4')],'unique':_0xc1d3('0x5')}};
\ No newline at end of file
index 43c0808..2bd64d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c57=['index','map','CmHopperBlack','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','name','send'];(function(_0x4cde52,_0x10987a){var _0x5f3a14=function(_0x29b770){while(--_0x29b770){_0x4cde52['push'](_0x4cde52['shift']());}};_0x5f3a14(++_0x10987a);}(_0x1c57,0x144));var _0x71c5=function(_0x2dcb9c,_0x45fca9){_0x2dcb9c=_0x2dcb9c-0x0;var _0x152512=_0x1c57[_0x2dcb9c];return _0x152512;};'use strict';var emlformat=require(_0x71c5('0x0'));var rimraf=require(_0x71c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x71c5('0x2'));var moment=require(_0x71c5('0x3'));var BPromise=require(_0x71c5('0x4'));var Mustache=require(_0x71c5('0x5'));var util=require('util');var path=require(_0x71c5('0x6'));var sox=require(_0x71c5('0x7'));var csv=require('to-csv');var ejs=require(_0x71c5('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x71c5('0x9'));var jsforce=require(_0x71c5('0xa'));var deskjs=require(_0x71c5('0xb'));var toCsv=require(_0x71c5('0xc'));var querystring=require(_0x71c5('0xd'));var Papa=require(_0x71c5('0xe'));var Redis=require('ioredis');var authService=require(_0x71c5('0xf'));var qs=require(_0x71c5('0x10'));var as=require(_0x71c5('0x11'));var hardwareService=require(_0x71c5('0x12'));var logger=require(_0x71c5('0x13'))('api');var utils=require(_0x71c5('0x14'));var config=require(_0x71c5('0x15'));var licenseUtil=require(_0x71c5('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xab1102,_0x220c21){_0x220c21=_0x220c21||0xcc;return function(_0x34b704){if(_0x34b704){return _0xab1102[_0x71c5('0x17')](_0x220c21);}return _0xab1102[_0x71c5('0x18')](_0x220c21)[_0x71c5('0x19')]();};}function respondWithResult(_0x534fda,_0x3ea456){_0x3ea456=_0x3ea456||0xc8;return function(_0x5b29e0){if(_0x5b29e0){return _0x534fda['status'](_0x3ea456)[_0x71c5('0x1a')](_0x5b29e0);}};}function respondWithFilteredResult(_0x5256e4,_0x1b4efd){return function(_0x240896){if(_0x240896){var _0x3120d3=typeof _0x1b4efd[_0x71c5('0x1b')]===_0x71c5('0x1c')&&typeof _0x1b4efd[_0x71c5('0x1d')]==='undefined';var _0x1eee6e=_0x240896['count'];var _0x4d913d=_0x3120d3?0x0:_0x1b4efd[_0x71c5('0x1b')];var _0x78a874=_0x3120d3?_0x240896[_0x71c5('0x1e')]:_0x1b4efd[_0x71c5('0x1b')]+_0x1b4efd[_0x71c5('0x1d')];var _0x27e4cb;if(_0x78a874>=_0x1eee6e){_0x78a874=_0x1eee6e;_0x27e4cb=0xc8;}else{_0x27e4cb=0xce;}_0x5256e4[_0x71c5('0x18')](_0x27e4cb);return _0x5256e4[_0x71c5('0x1f')](_0x71c5('0x20'),_0x4d913d+'-'+_0x78a874+'/'+_0x1eee6e)[_0x71c5('0x1a')](_0x240896);}return null;};}function patchUpdates(_0x49ac54){return function(_0x18b8f4){try{jsonpatch[_0x71c5('0x21')](_0x18b8f4,_0x49ac54,!![]);}catch(_0x110194){return BPromise['reject'](_0x110194);}return _0x18b8f4[_0x71c5('0x22')]();};}function saveUpdates(_0x508d10,_0x43a165){return function(_0x1f47af){if(_0x1f47af){return _0x1f47af[_0x71c5('0x23')](_0x508d10)[_0x71c5('0x24')](function(_0x4a7c3b){return _0x4a7c3b;});}return null;};}function removeEntity(_0x2a13cf,_0x7bc09c){return function(_0x55eac2){if(_0x55eac2){return _0x55eac2[_0x71c5('0x25')]()[_0x71c5('0x24')](function(){_0x2a13cf[_0x71c5('0x18')](0xcc)[_0x71c5('0x19')]();});}};}function handleEntityNotFound(_0x420f18,_0x496e30){return function(_0x1c572c){if(!_0x1c572c){_0x420f18['sendStatus'](0x194);}return _0x1c572c;};}function handleError(_0x1815c4,_0x542d95){_0x542d95=_0x542d95||0x1f4;return function(_0x321be4){logger[_0x71c5('0x26')](_0x321be4['stack']);if(_0x321be4['name']){delete _0x321be4[_0x71c5('0x27')];}_0x1815c4['status'](_0x542d95)[_0x71c5('0x28')](_0x321be4);};}exports[_0x71c5('0x29')]=function(_0x23467c,_0x2d73f9){var _0x18f6cd={},_0x4965d9={},_0x57861a={'count':0x0,'rows':[]};var _0x2a8ec1=_[_0x71c5('0x2a')](db[_0x71c5('0x2b')]['rawAttributes'],function(_0x4fa1ad){return{'name':_0x4fa1ad[_0x71c5('0x2c')],'type':_0x4fa1ad[_0x71c5('0x2d')]['key']};});_0x4965d9[_0x71c5('0x2e')]=_[_0x71c5('0x2a')](_0x2a8ec1,'name');_0x4965d9[_0x71c5('0x2f')]=_[_0x71c5('0x30')](_0x23467c[_0x71c5('0x2f')]);_0x4965d9['filters']=_['intersection'](_0x4965d9[_0x71c5('0x2e')],_0x4965d9['query']);_0x18f6cd[_0x71c5('0x31')]=_[_0x71c5('0x32')](_0x4965d9[_0x71c5('0x2e')],qs['fields'](_0x23467c[_0x71c5('0x2f')][_0x71c5('0x33')]));_0x18f6cd[_0x71c5('0x31')]=_0x18f6cd[_0x71c5('0x31')][_0x71c5('0x34')]?_0x18f6cd[_0x71c5('0x31')]:_0x4965d9[_0x71c5('0x2e')];if(!_0x23467c[_0x71c5('0x2f')][_0x71c5('0x35')](_0x71c5('0x36'))){_0x18f6cd[_0x71c5('0x1d')]=qs['limit'](_0x23467c[_0x71c5('0x2f')]['limit']);_0x18f6cd[_0x71c5('0x1b')]=qs[_0x71c5('0x1b')](_0x23467c['query']['offset']);}_0x18f6cd['order']=qs[_0x71c5('0x37')](_0x23467c[_0x71c5('0x2f')][_0x71c5('0x37')]);_0x18f6cd[_0x71c5('0x38')]=qs[_0x71c5('0x39')](_[_0x71c5('0x3a')](_0x23467c[_0x71c5('0x2f')],_0x4965d9[_0x71c5('0x39')]),_0x2a8ec1);if(_0x23467c[_0x71c5('0x2f')][_0x71c5('0x3b')]){_0x18f6cd[_0x71c5('0x38')]=_[_0x71c5('0x3c')](_0x18f6cd[_0x71c5('0x38')],{'$or':_[_0x71c5('0x2a')](_0x2a8ec1,function(_0x2c8e5a){if(_0x2c8e5a[_0x71c5('0x2d')]!==_0x71c5('0x3d')){var _0x1edd29={};_0x1edd29[_0x2c8e5a['name']]={'$like':'%'+_0x23467c['query']['filter']+'%'};return _0x1edd29;}})});}_0x18f6cd=_[_0x71c5('0x3c')]({},_0x18f6cd,_0x23467c[_0x71c5('0x3e')]);var _0x3dcd8c={'where':_0x18f6cd[_0x71c5('0x38')]};return db[_0x71c5('0x2b')]['count'](_0x3dcd8c)[_0x71c5('0x24')](function(_0x9a7293){_0x57861a[_0x71c5('0x1e')]=_0x9a7293;if(_0x23467c[_0x71c5('0x2f')][_0x71c5('0x3f')]){_0x18f6cd[_0x71c5('0x40')]=[{'all':!![]}];}return db[_0x71c5('0x2b')][_0x71c5('0x41')](_0x18f6cd);})['then'](function(_0x316f7a){_0x57861a[_0x71c5('0x42')]=_0x316f7a;return _0x57861a;})[_0x71c5('0x24')](respondWithFilteredResult(_0x2d73f9,_0x18f6cd))['catch'](handleError(_0x2d73f9,null));};exports[_0x71c5('0x43')]=function(_0x5434f8,_0x351583){var _0x393902={'raw':!![],'where':{'id':_0x5434f8[_0x71c5('0x44')]['id']}},_0x54cbdd={};_0x54cbdd[_0x71c5('0x2e')]=_[_0x71c5('0x30')](db[_0x71c5('0x2b')][_0x71c5('0x45')]);_0x54cbdd[_0x71c5('0x2f')]=_[_0x71c5('0x30')](_0x5434f8['query']);_0x54cbdd['filters']=_[_0x71c5('0x32')](_0x54cbdd[_0x71c5('0x2e')],_0x54cbdd[_0x71c5('0x2f')]);_0x393902[_0x71c5('0x31')]=_[_0x71c5('0x32')](_0x54cbdd[_0x71c5('0x2e')],qs[_0x71c5('0x33')](_0x5434f8['query']['fields']));_0x393902[_0x71c5('0x31')]=_0x393902[_0x71c5('0x31')][_0x71c5('0x34')]?_0x393902['attributes']:_0x54cbdd[_0x71c5('0x2e')];if(_0x5434f8[_0x71c5('0x2f')][_0x71c5('0x3f')]){_0x393902['include']=[{'all':!![]}];}_0x393902=_['merge']({},_0x393902,_0x5434f8['options']);return db['CmHopperBlack'][_0x71c5('0x46')](_0x393902)[_0x71c5('0x24')](handleEntityNotFound(_0x351583,null))[_0x71c5('0x24')](respondWithResult(_0x351583,null))[_0x71c5('0x47')](handleError(_0x351583,null));};exports[_0x71c5('0x23')]=function(_0x55df9a,_0x8922b6){if(_0x55df9a[_0x71c5('0x48')]['id']){delete _0x55df9a[_0x71c5('0x48')]['id'];}return db[_0x71c5('0x2b')]['find']({'where':{'id':_0x55df9a[_0x71c5('0x44')]['id']}})[_0x71c5('0x24')](handleEntityNotFound(_0x8922b6,null))[_0x71c5('0x24')](saveUpdates(_0x55df9a[_0x71c5('0x48')],null))[_0x71c5('0x24')](respondWithResult(_0x8922b6,null))['catch'](handleError(_0x8922b6,null));};exports[_0x71c5('0x25')]=function(_0x931675,_0x5332cc){return db[_0x71c5('0x2b')][_0x71c5('0x46')]({'where':{'id':_0x931675[_0x71c5('0x44')]['id']}})[_0x71c5('0x24')](handleEntityNotFound(_0x5332cc,null))[_0x71c5('0x24')](removeEntity(_0x5332cc,null))['catch'](handleError(_0x5332cc,null));};exports['describe']=function(_0x4db46b,_0x1faa3b){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x1faa3b,null))['catch'](handleError(_0x1faa3b,null));};
\ No newline at end of file
+var _0xabd3=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','then','destroy','error','send','map','CmHopperBlack','rawAttributes','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','include','find','body','params','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x37d7d6,_0x2b540b){var _0x39ae77=function(_0x506cb5){while(--_0x506cb5){_0x37d7d6['push'](_0x37d7d6['shift']());}};_0x39ae77(++_0x2b540b);}(_0xabd3,0x1f3));var _0x3abd=function(_0x39caaa,_0x1f37bc){_0x39caaa=_0x39caaa-0x0;var _0x9b9c7d=_0xabd3[_0x39caaa];return _0x9b9c7d;};'use strict';var emlformat=require(_0x3abd('0x0'));var rimraf=require(_0x3abd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3abd('0x2'));var rp=require(_0x3abd('0x3'));var moment=require(_0x3abd('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3abd('0x5'));var path=require(_0x3abd('0x6'));var sox=require(_0x3abd('0x7'));var csv=require('to-csv');var ejs=require(_0x3abd('0x8'));var fs=require('fs');var fs_extra=require(_0x3abd('0x9'));var _=require('lodash');var squel=require(_0x3abd('0xa'));var crypto=require(_0x3abd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3abd('0xc'));var toCsv=require(_0x3abd('0xd'));var querystring=require(_0x3abd('0xe'));var Papa=require(_0x3abd('0xf'));var Redis=require(_0x3abd('0x10'));var authService=require(_0x3abd('0x11'));var qs=require(_0x3abd('0x12'));var as=require(_0x3abd('0x13'));var hardwareService=require(_0x3abd('0x14'));var logger=require(_0x3abd('0x15'))(_0x3abd('0x16'));var utils=require(_0x3abd('0x17'));var config=require(_0x3abd('0x18'));var licenseUtil=require(_0x3abd('0x19'));var db=require(_0x3abd('0x1a'))['db'];function respondWithStatusCode(_0x56b8b6,_0x2796e1){_0x2796e1=_0x2796e1||0xcc;return function(_0x24ea10){if(_0x24ea10){return _0x56b8b6[_0x3abd('0x1b')](_0x2796e1);}return _0x56b8b6[_0x3abd('0x1c')](_0x2796e1)[_0x3abd('0x1d')]();};}function respondWithResult(_0x43a2e8,_0x3b6ccf){_0x3b6ccf=_0x3b6ccf||0xc8;return function(_0x3ba5db){if(_0x3ba5db){return _0x43a2e8['status'](_0x3b6ccf)[_0x3abd('0x1e')](_0x3ba5db);}};}function respondWithFilteredResult(_0x2c9068,_0x353738){return function(_0x5c3658){if(_0x5c3658){var _0x3aec49=typeof _0x353738[_0x3abd('0x1f')]==='undefined'&&typeof _0x353738['limit']===_0x3abd('0x20');var _0x42963f=_0x5c3658[_0x3abd('0x21')];var _0x45f792=_0x3aec49?0x0:_0x353738[_0x3abd('0x1f')];var _0x29d882=_0x3aec49?_0x5c3658['count']:_0x353738[_0x3abd('0x1f')]+_0x353738['limit'];var _0x4ca84a;if(_0x29d882>=_0x42963f){_0x29d882=_0x42963f;_0x4ca84a=0xc8;}else{_0x4ca84a=0xce;}_0x2c9068[_0x3abd('0x1c')](_0x4ca84a);return _0x2c9068['set'](_0x3abd('0x22'),_0x45f792+'-'+_0x29d882+'/'+_0x42963f)['json'](_0x5c3658);}return null;};}function patchUpdates(_0x3cc1b8){return function(_0xfbbb11){try{jsonpatch['apply'](_0xfbbb11,_0x3cc1b8,!![]);}catch(_0x72168f){return BPromise[_0x3abd('0x23')](_0x72168f);}return _0xfbbb11[_0x3abd('0x24')]();};}function saveUpdates(_0x7b6412,_0x129412){return function(_0x6544b0){if(_0x6544b0){return _0x6544b0['update'](_0x7b6412)[_0x3abd('0x25')](function(_0x41982a){return _0x41982a;});}return null;};}function removeEntity(_0xbfd0b4,_0x48108e){return function(_0xec8b88){if(_0xec8b88){return _0xec8b88[_0x3abd('0x26')]()['then'](function(){_0xbfd0b4[_0x3abd('0x1c')](0xcc)[_0x3abd('0x1d')]();});}};}function handleEntityNotFound(_0x5aead7,_0x33be06){return function(_0x5bbfc3){if(!_0x5bbfc3){_0x5aead7['sendStatus'](0x194);}return _0x5bbfc3;};}function handleError(_0x139e8a,_0x4bab2d){_0x4bab2d=_0x4bab2d||0x1f4;return function(_0x2af4d6){logger[_0x3abd('0x27')](_0x2af4d6['stack']);if(_0x2af4d6['name']){delete _0x2af4d6['name'];}_0x139e8a[_0x3abd('0x1c')](_0x4bab2d)[_0x3abd('0x28')](_0x2af4d6);};}exports['index']=function(_0x4fe96e,_0x1faad9){var _0x593a37={},_0x18ac66={},_0x50cd29={'count':0x0,'rows':[]};var _0x250df0=_[_0x3abd('0x29')](db[_0x3abd('0x2a')][_0x3abd('0x2b')],function(_0x5b7d36){return{'name':_0x5b7d36['fieldName'],'type':_0x5b7d36['type']['key']};});_0x18ac66[_0x3abd('0x2c')]=_[_0x3abd('0x29')](_0x250df0,_0x3abd('0x2d'));_0x18ac66[_0x3abd('0x2e')]=_[_0x3abd('0x2f')](_0x4fe96e['query']);_0x18ac66[_0x3abd('0x30')]=_[_0x3abd('0x31')](_0x18ac66['model'],_0x18ac66['query']);_0x593a37[_0x3abd('0x32')]=_[_0x3abd('0x31')](_0x18ac66['model'],qs[_0x3abd('0x33')](_0x4fe96e['query'][_0x3abd('0x33')]));_0x593a37[_0x3abd('0x32')]=_0x593a37[_0x3abd('0x32')][_0x3abd('0x34')]?_0x593a37['attributes']:_0x18ac66[_0x3abd('0x2c')];if(!_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x35')](_0x3abd('0x36'))){_0x593a37[_0x3abd('0x37')]=qs[_0x3abd('0x37')](_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x37')]);_0x593a37['offset']=qs[_0x3abd('0x1f')](_0x4fe96e[_0x3abd('0x2e')]['offset']);}_0x593a37[_0x3abd('0x38')]=qs['sort'](_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x39')]);_0x593a37[_0x3abd('0x3a')]=qs[_0x3abd('0x30')](_[_0x3abd('0x3b')](_0x4fe96e[_0x3abd('0x2e')],_0x18ac66[_0x3abd('0x30')]),_0x250df0);if(_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x3c')]){_0x593a37['where']=_[_0x3abd('0x3d')](_0x593a37[_0x3abd('0x3a')],{'$or':_[_0x3abd('0x29')](_0x250df0,function(_0x18a087){if(_0x18a087[_0x3abd('0x3e')]!==_0x3abd('0x3f')){var _0x26a97c={};_0x26a97c[_0x18a087[_0x3abd('0x2d')]]={'$like':'%'+_0x4fe96e[_0x3abd('0x2e')][_0x3abd('0x3c')]+'%'};return _0x26a97c;}})});}_0x593a37=_['merge']({},_0x593a37,_0x4fe96e[_0x3abd('0x40')]);var _0x528ead={'where':_0x593a37[_0x3abd('0x3a')]};return db[_0x3abd('0x2a')][_0x3abd('0x21')](_0x528ead)['then'](function(_0x776d24){_0x50cd29[_0x3abd('0x21')]=_0x776d24;if(_0x4fe96e['query'][_0x3abd('0x41')]){_0x593a37['include']=[{'all':!![]}];}return db[_0x3abd('0x2a')][_0x3abd('0x42')](_0x593a37);})['then'](function(_0x330028){_0x50cd29[_0x3abd('0x43')]=_0x330028;return _0x50cd29;})['then'](respondWithFilteredResult(_0x1faad9,_0x593a37))['catch'](handleError(_0x1faad9,null));};exports[_0x3abd('0x44')]=function(_0x1ac404,_0x2bf964){var _0x203dbf={'raw':!![],'where':{'id':_0x1ac404['params']['id']}},_0x571d3e={};_0x571d3e['model']=_['keys'](db['CmHopperBlack'][_0x3abd('0x2b')]);_0x571d3e[_0x3abd('0x2e')]=_[_0x3abd('0x2f')](_0x1ac404[_0x3abd('0x2e')]);_0x571d3e[_0x3abd('0x30')]=_[_0x3abd('0x31')](_0x571d3e[_0x3abd('0x2c')],_0x571d3e['query']);_0x203dbf[_0x3abd('0x32')]=_[_0x3abd('0x31')](_0x571d3e[_0x3abd('0x2c')],qs[_0x3abd('0x33')](_0x1ac404[_0x3abd('0x2e')][_0x3abd('0x33')]));_0x203dbf['attributes']=_0x203dbf['attributes'][_0x3abd('0x34')]?_0x203dbf['attributes']:_0x571d3e['model'];if(_0x1ac404[_0x3abd('0x2e')][_0x3abd('0x41')]){_0x203dbf[_0x3abd('0x45')]=[{'all':!![]}];}_0x203dbf=_[_0x3abd('0x3d')]({},_0x203dbf,_0x1ac404[_0x3abd('0x40')]);return db[_0x3abd('0x2a')][_0x3abd('0x46')](_0x203dbf)['then'](handleEntityNotFound(_0x2bf964,null))[_0x3abd('0x25')](respondWithResult(_0x2bf964,null))['catch'](handleError(_0x2bf964,null));};exports['update']=function(_0x166cd1,_0x4699c6){if(_0x166cd1[_0x3abd('0x47')]['id']){delete _0x166cd1[_0x3abd('0x47')]['id'];}return db[_0x3abd('0x2a')][_0x3abd('0x46')]({'where':{'id':_0x166cd1[_0x3abd('0x48')]['id']}})['then'](handleEntityNotFound(_0x4699c6,null))[_0x3abd('0x25')](saveUpdates(_0x166cd1[_0x3abd('0x47')],null))[_0x3abd('0x25')](respondWithResult(_0x4699c6,null))[_0x3abd('0x49')](handleError(_0x4699c6,null));};exports['destroy']=function(_0x14d468,_0x25643a){return db[_0x3abd('0x2a')][_0x3abd('0x46')]({'where':{'id':_0x14d468['params']['id']}})['then'](handleEntityNotFound(_0x25643a,null))[_0x3abd('0x25')](removeEntity(_0x25643a,null))[_0x3abd('0x49')](handleError(_0x25643a,null));};exports[_0x3abd('0x4a')]=function(_0x57ac31,_0x529d6b){return db[_0x3abd('0x2a')][_0x3abd('0x4a')]()[_0x3abd('0x25')](respondWithResult(_0x529d6b,null))[_0x3abd('0x49')](handleError(_0x529d6b,null));};
\ No newline at end of file
index f419278..69b0c03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca48=['../../config/environment','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x533d66,_0x3cf5da){var _0x55ea0a=function(_0x4c151d){while(--_0x4c151d){_0x533d66['push'](_0x533d66['shift']());}};_0x55ea0a(++_0x3cf5da);}(_0xca48,0x155));var _0x8ca4=function(_0x185d2a,_0x308609){_0x185d2a=_0x185d2a-0x0;var _0x4dea27=_0xca48[_0x185d2a];return _0x4dea27;};'use strict';var _=require(_0x8ca4('0x0'));var util=require(_0x8ca4('0x1'));var logger=require(_0x8ca4('0x2'))(_0x8ca4('0x3'));var moment=require(_0x8ca4('0x4'));var BPromise=require(_0x8ca4('0x5'));var rp=require(_0x8ca4('0x6'));var fs=require('fs');var path=require(_0x8ca4('0x7'));var rimraf=require(_0x8ca4('0x8'));var config=require(_0x8ca4('0x9'));var attributes=require(_0x8ca4('0xa'));module['exports']=function(_0x394e65,_0x1e6de9){return _0x394e65[_0x8ca4('0xb')](_0x8ca4('0xc'),attributes,{'tableName':_0x8ca4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf520=['CmHopperBlack','cm_hopper_black','../../config/logger','api','request-promise','path','rimraf','define'];(function(_0xc2c347,_0x442863){var _0x2c07d2=function(_0x35e5d6){while(--_0x35e5d6){_0xc2c347['push'](_0xc2c347['shift']());}};_0x2c07d2(++_0x442863);}(_0xf520,0x10a));var _0x0f52=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xf520[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f52('0x0'))(_0x0f52('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0f52('0x2'));var fs=require('fs');var path=require(_0x0f52('0x3'));var rimraf=require(_0x0f52('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x26eae6,_0x268252){return _0x26eae6[_0x0f52('0x5')](_0x0f52('0x6'),attributes,{'tableName':_0x0f52('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 60233f4..09c132c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a8=['then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetCmHopperBlack','CmHopperBlack','findAll','options','where','limit','include','model','attributes','map','stringify','catch','update','body','raw','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x45d6e1,_0x377c83){var _0x41a978=function(_0x15afe8){while(--_0x15afe8){_0x45d6e1['push'](_0x45d6e1['shift']());}};_0x41a978(++_0x377c83);}(_0x63a8,0xe3));var _0x863a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x63a8[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x863a('0x0'));var util=require(_0x863a('0x1'));var moment=require(_0x863a('0x2'));var BPromise=require(_0x863a('0x3'));var rs=require(_0x863a('0x4'));var fs=require('fs');var Redis=require(_0x863a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x863a('0x6'));var logger=require(_0x863a('0x7'))(_0x863a('0x8'));var config=require('../../config/environment');var jayson=require(_0x863a('0x9'));var client=jayson[_0x863a('0xa')][_0x863a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fa31e,_0xba1874,_0x535847){return new BPromise(function(_0x4debc9,_0x2dbe13){return client[_0x863a('0xc')](_0x3fa31e,_0x535847)[_0x863a('0xd')](function(_0x111ca9){logger['info'](_0x863a('0xe'),_0xba1874,_0x863a('0xf'));logger[_0x863a('0x10')](_0x863a('0x11'),_0xba1874,_0x863a('0xf'),JSON['stringify'](_0x111ca9));if(_0x111ca9['error']){if(_0x111ca9[_0x863a('0x12')][_0x863a('0x13')]===0x1f4){logger['error'](_0x863a('0xe'),_0xba1874,_0x111ca9['error']['message']);return _0x2dbe13(_0x111ca9[_0x863a('0x12')][_0x863a('0x14')]);}logger[_0x863a('0x12')](_0x863a('0xe'),_0xba1874,_0x111ca9[_0x863a('0x12')][_0x863a('0x14')]);return _0x4debc9(_0x111ca9[_0x863a('0x12')][_0x863a('0x14')]);}else{logger[_0x863a('0x15')](_0x863a('0xe'),_0xba1874,_0x863a('0xf'));_0x4debc9(_0x111ca9[_0x863a('0x16')][_0x863a('0x14')]);}})['catch'](function(_0x21afd8){logger[_0x863a('0x12')](_0x863a('0xe'),_0xba1874,_0x21afd8);_0x2dbe13(_0x21afd8);});});}exports[_0x863a('0x17')]=function(_0xa8814e){var _0x462dcf=this;return new Promise(function(_0x826424,_0x1ac932){return db[_0x863a('0x18')][_0x863a('0x19')]({'raw':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')][_0x863a('0x1b')]||null:null,'attributes':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')]['attributes']||null:null,'limit':_0xa8814e[_0x863a('0x1a')]?_0xa8814e[_0x863a('0x1a')][_0x863a('0x1c')]||null:null,'include':_0xa8814e[_0x863a('0x1a')]?_0xa8814e['options'][_0x863a('0x1d')]?_['map'](_0xa8814e[_0x863a('0x1a')][_0x863a('0x1d')],function(_0x3bc9ab){return{'model':db[_0x3bc9ab[_0x863a('0x1e')]],'as':_0x3bc9ab['as'],'attributes':_0x3bc9ab[_0x863a('0x1f')],'include':_0x3bc9ab[_0x863a('0x1d')]?_[_0x863a('0x20')](_0x3bc9ab[_0x863a('0x1d')],function(_0x1c5e0f){return{'model':db[_0x1c5e0f[_0x863a('0x1e')]],'as':_0x1c5e0f['as'],'attributes':_0x1c5e0f[_0x863a('0x1f')],'include':_0x1c5e0f[_0x863a('0x1d')]?_[_0x863a('0x20')](_0x1c5e0f['include'],function(_0xe03286){return{'model':db[_0xe03286[_0x863a('0x1e')]],'as':_0xe03286['as'],'attributes':_0xe03286['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e6d9a){logger['info'](_0x863a('0x17'),_0xa8814e);logger[_0x863a('0x10')](_0x863a('0x17'),_0xa8814e,JSON[_0x863a('0x21')](_0x2e6d9a));_0x826424(_0x2e6d9a);})[_0x863a('0x22')](function(_0x2889f0){logger[_0x863a('0x12')](_0x863a('0x17'),_0x2889f0['message'],_0xa8814e);_0x1ac932(_0x462dcf[_0x863a('0x12')](0x1f4,_0x2889f0[_0x863a('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x199ff6){var _0x79a0d4=this;return new Promise(function(_0x28177d,_0x3d3b9d){return db[_0x863a('0x18')][_0x863a('0x23')](_0x199ff6[_0x863a('0x24')],{'raw':_0x199ff6[_0x863a('0x1a')]?_0x199ff6[_0x863a('0x1a')][_0x863a('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x199ff6['options']?_0x199ff6[_0x863a('0x1a')][_0x863a('0x1b')]||null:null,'attributes':_0x199ff6['options']?_0x199ff6[_0x863a('0x1a')]['attributes']||null:null,'limit':_0x199ff6[_0x863a('0x1a')]?_0x199ff6[_0x863a('0x1a')]['limit']||null:null})[_0x863a('0xd')](function(_0x32154f){logger[_0x863a('0x15')](_0x863a('0x26'),_0x199ff6);logger[_0x863a('0x10')](_0x863a('0x26'),_0x199ff6,JSON[_0x863a('0x21')](_0x32154f));_0x28177d(_0x32154f);})[_0x863a('0x22')](function(_0x4c31bd){logger[_0x863a('0x12')](_0x863a('0x26'),_0x4c31bd[_0x863a('0x14')],_0x199ff6);_0x3d3b9d(_0x79a0d4['error'](0x1f4,_0x4c31bd['message']));});});};exports[_0x863a('0x27')]=function(_0x82dea1){var _0x50ae3f=this;return new Promise(function(_0x16d366,_0x5d422f){return db[_0x863a('0x18')]['destroy']({'where':_0x82dea1[_0x863a('0x1a')]?_0x82dea1[_0x863a('0x1a')][_0x863a('0x1b')]||null:null})[_0x863a('0xd')](function(_0x2602a4){logger[_0x863a('0x15')]('DestroyCmHopperBlack',_0x82dea1);logger[_0x863a('0x10')]('DestroyCmHopperBlack',_0x82dea1,JSON[_0x863a('0x21')](_0x2602a4));_0x16d366(_0x2602a4);})[_0x863a('0x22')](function(_0x44ed05){logger[_0x863a('0x12')](_0x863a('0x27'),_0x44ed05[_0x863a('0x14')],_0x82dea1);_0x5d422f(_0x50ae3f[_0x863a('0x12')](0x1f4,_0x44ed05[_0x863a('0x14')]));});});};
\ No newline at end of file
+var _0xeea7=['code','message','info','result','catch','GetCmHopperBlack','findAll','options','where','attributes','limit','include','map','model','UpdateCmHopperBlack','CmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4e6c14,_0x4ee47d){var _0xe58422=function(_0x30ca53){while(--_0x30ca53){_0x4e6c14['push'](_0x4e6c14['shift']());}};_0xe58422(++_0x4ee47d);}(_0xeea7,0x161));var _0x7eea=function(_0x3feef9,_0x1df14e){_0x3feef9=_0x3feef9-0x0;var _0x3b7fee=_0xeea7[_0x3feef9];return _0x3b7fee;};'use strict';var _=require(_0x7eea('0x0'));var util=require('util');var moment=require(_0x7eea('0x1'));var BPromise=require('bluebird');var rs=require(_0x7eea('0x2'));var fs=require('fs');var Redis=require(_0x7eea('0x3'));var db=require(_0x7eea('0x4'))['db'];var utils=require(_0x7eea('0x5'));var logger=require(_0x7eea('0x6'))(_0x7eea('0x7'));var config=require(_0x7eea('0x8'));var jayson=require(_0x7eea('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ae7f8,_0x4db196,_0xe45c93){return new BPromise(function(_0x180435,_0x48cb16){return client[_0x7eea('0xa')](_0x3ae7f8,_0xe45c93)[_0x7eea('0xb')](function(_0x588752){logger['info'](_0x7eea('0xc'),_0x4db196,'request\x20sent');logger[_0x7eea('0xd')](_0x7eea('0xe'),_0x4db196,'request\x20sent',JSON[_0x7eea('0xf')](_0x588752));if(_0x588752['error']){if(_0x588752[_0x7eea('0x10')][_0x7eea('0x11')]===0x1f4){logger[_0x7eea('0x10')](_0x7eea('0xc'),_0x4db196,_0x588752[_0x7eea('0x10')][_0x7eea('0x12')]);return _0x48cb16(_0x588752[_0x7eea('0x10')][_0x7eea('0x12')]);}logger[_0x7eea('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4db196,_0x588752[_0x7eea('0x10')]['message']);return _0x180435(_0x588752[_0x7eea('0x10')][_0x7eea('0x12')]);}else{logger[_0x7eea('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4db196,'request\x20sent');_0x180435(_0x588752[_0x7eea('0x14')][_0x7eea('0x12')]);}})[_0x7eea('0x15')](function(_0x20e228){logger[_0x7eea('0x10')](_0x7eea('0xc'),_0x4db196,_0x20e228);_0x48cb16(_0x20e228);});});}exports[_0x7eea('0x16')]=function(_0x3c5980){var _0x122abb=this;return new Promise(function(_0x21c450,_0x54f604){return db['CmHopperBlack'][_0x7eea('0x17')]({'raw':_0x3c5980[_0x7eea('0x18')]?_0x3c5980[_0x7eea('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x3c5980[_0x7eea('0x18')]?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x19')]||null:null,'attributes':_0x3c5980['options']?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x1a')]||null:null,'limit':_0x3c5980['options']?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x1b')]||null:null,'include':_0x3c5980[_0x7eea('0x18')]?_0x3c5980[_0x7eea('0x18')][_0x7eea('0x1c')]?_[_0x7eea('0x1d')](_0x3c5980['options'][_0x7eea('0x1c')],function(_0x58773d){return{'model':db[_0x58773d[_0x7eea('0x1e')]],'as':_0x58773d['as'],'attributes':_0x58773d[_0x7eea('0x1a')],'include':_0x58773d[_0x7eea('0x1c')]?_['map'](_0x58773d[_0x7eea('0x1c')],function(_0x216947){return{'model':db[_0x216947['model']],'as':_0x216947['as'],'attributes':_0x216947[_0x7eea('0x1a')],'include':_0x216947[_0x7eea('0x1c')]?_[_0x7eea('0x1d')](_0x216947[_0x7eea('0x1c')],function(_0x2a158d){return{'model':db[_0x2a158d[_0x7eea('0x1e')]],'as':_0x2a158d['as'],'attributes':_0x2a158d[_0x7eea('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7eea('0xb')](function(_0x4f94df){logger[_0x7eea('0x13')](_0x7eea('0x16'),_0x3c5980);logger['debug'](_0x7eea('0x16'),_0x3c5980,JSON[_0x7eea('0xf')](_0x4f94df));_0x21c450(_0x4f94df);})[_0x7eea('0x15')](function(_0x7ff05f){logger['error'](_0x7eea('0x16'),_0x7ff05f[_0x7eea('0x12')],_0x3c5980);_0x54f604(_0x122abb[_0x7eea('0x10')](0x1f4,_0x7ff05f[_0x7eea('0x12')]));});});};exports[_0x7eea('0x1f')]=function(_0x3ac0c5){var _0x862a21=this;return new Promise(function(_0x11675d,_0x2fefd7){return db[_0x7eea('0x20')][_0x7eea('0x21')](_0x3ac0c5[_0x7eea('0x22')],{'raw':_0x3ac0c5['options']?_0x3ac0c5[_0x7eea('0x18')][_0x7eea('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac0c5[_0x7eea('0x18')]?_0x3ac0c5['options'][_0x7eea('0x19')]||null:null,'attributes':_0x3ac0c5[_0x7eea('0x18')]?_0x3ac0c5[_0x7eea('0x18')]['attributes']||null:null,'limit':_0x3ac0c5[_0x7eea('0x18')]?_0x3ac0c5[_0x7eea('0x18')][_0x7eea('0x1b')]||null:null})['then'](function(_0x3e5264){logger[_0x7eea('0x13')](_0x7eea('0x1f'),_0x3ac0c5);logger[_0x7eea('0xd')]('UpdateCmHopperBlack',_0x3ac0c5,JSON['stringify'](_0x3e5264));_0x11675d(_0x3e5264);})[_0x7eea('0x15')](function(_0x4686ca){logger['error'](_0x7eea('0x1f'),_0x4686ca['message'],_0x3ac0c5);_0x2fefd7(_0x862a21[_0x7eea('0x10')](0x1f4,_0x4686ca['message']));});});};exports['DestroyCmHopperBlack']=function(_0x25c505){var _0x5d02f5=this;return new Promise(function(_0x57d63d,_0x429c29){return db[_0x7eea('0x20')]['destroy']({'where':_0x25c505[_0x7eea('0x18')]?_0x25c505['options']['where']||null:null})[_0x7eea('0xb')](function(_0x5a0e4b){logger[_0x7eea('0x13')](_0x7eea('0x24'),_0x25c505);logger[_0x7eea('0xd')](_0x7eea('0x24'),_0x25c505,JSON[_0x7eea('0xf')](_0x5a0e4b));_0x57d63d(_0x5a0e4b);})[_0x7eea('0x15')](function(_0x67f1d4){logger[_0x7eea('0x10')](_0x7eea('0x24'),_0x67f1d4['message'],_0x25c505);_0x429c29(_0x5d02f5['error'](0x1f4,_0x67f1d4['message']));});});};
\ No newline at end of file
index 67cdc2c..8485f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x2a2718,_0x428041){var _0x5b6feb=function(_0x1f1277){while(--_0x1f1277){_0x2a2718['push'](_0x2a2718['shift']());}};_0x5b6feb(++_0x428041);}(_0x1db9,0x176));var _0x91db=function(_0x16e65a,_0x34b753){_0x16e65a=_0x16e65a-0x0;var _0x5241d1=_0x1db9[_0x16e65a];return _0x5241d1;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router;
\ No newline at end of file
+var _0xfb11=['show','put','delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xfb11[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x1fb1('0x0'));var util=require('util');var path=require(_0x1fb1('0x1'));var timeout=require(_0x1fb1('0x2'));var express=require('express');var router=express[_0x1fb1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1fb1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1fb1('0x5'));var controller=require(_0x1fb1('0x6'));router['get']('/',auth[_0x1fb1('0x7')](),controller[_0x1fb1('0x8')]);router['get'](_0x1fb1('0x9'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xa')]);router[_0x1fb1('0xb')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller[_0x1fb1('0xd')]);router[_0x1fb1('0xe')](_0x1fb1('0xc'),auth[_0x1fb1('0x7')](),controller['update']);router[_0x1fb1('0xf')]('/:id',auth[_0x1fb1('0x7')](),controller['destroy']);module[_0x1fb1('0x10')]=router;
\ No newline at end of file
index 60a11f8..0ff59a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98fd=['getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','INTEGER','STRING','DATE'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x98fd,0x67));var _0xd98f=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x98fd[_0xbc346f];return _0x9f9260;};'use strict';var Sequelize=require(_0xd98f('0x0'));var moment=require(_0xd98f('0x1'));module['exports']={'state':{'type':Sequelize[_0xd98f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd98f('0x3')]},'scheduledat':{'type':Sequelize[_0xd98f('0x4')]},'countbusyretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd98f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xd98f('0x3')]},'calleridnum':{'type':Sequelize[_0xd98f('0x3')]},'calleridname':{'type':Sequelize[_0xd98f('0x3')]},'starttime':{'type':Sequelize[_0xd98f('0x4')]},'responsetime':{'type':Sequelize[_0xd98f('0x4')]},'answertime':{'type':Sequelize[_0xd98f('0x4')]},'droptime':{'type':Sequelize[_0xd98f('0x4')]},'endtime':{'type':Sequelize[_0xd98f('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xd98f('0x3')]},'campaign':{'type':Sequelize[_0xd98f('0x3')]},'campaigntype':{'type':Sequelize[_0xd98f('0x3')]},'membername':{'type':Sequelize[_0xd98f('0x3')]},'reason':{'type':Sequelize[_0xd98f('0x3')]},'disposition':{'type':Sequelize[_0xd98f('0x3')]},'secondDisposition':{'type':Sequelize[_0xd98f('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd98f('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4213d3){var _0x728524=this[_0xd98f('0x5')](_0xd98f('0x6'));if(_0x728524&&_0x4213d3){this[_0xd98f('0x7')](_0xd98f('0x8'),moment(_0x4213d3)[_0xd98f('0x9')](moment(_0x728524),_0xd98f('0xa')));}}},'amd':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xd98f('0x4')]},'callback':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd98f('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd98f('0x4')]},'deleted':{'type':Sequelize[_0xd98f('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xd98f('0x4')]},'recallme':{'type':Sequelize[_0xd98f('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xd98f('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd98f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe16d=['followuptime','diff','seconds','BOOLEAN','moment','INTEGER','STRING','DATE','setDataValue'];(function(_0x239dba,_0x309e95){var _0x1ceb11=function(_0x14efe6){while(--_0x14efe6){_0x239dba['push'](_0x239dba['shift']());}};_0x1ceb11(++_0x309e95);}(_0xe16d,0x1c6));var _0xde16=function(_0x8b298b,_0x2c3ed5){_0x8b298b=_0x8b298b-0x0;var _0x10cc1f=_0xe16d[_0x8b298b];return _0x10cc1f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xde16('0x0'));module['exports']={'state':{'type':Sequelize[_0xde16('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xde16('0x2')]},'scheduledat':{'type':Sequelize[_0xde16('0x3')]},'countbusyretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xde16('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xde16('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xde16('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xde16('0x3')]},'answertime':{'type':Sequelize[_0xde16('0x3')]},'droptime':{'type':Sequelize[_0xde16('0x3')]},'endtime':{'type':Sequelize[_0xde16('0x3')]},'ringtime':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xde16('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xde16('0x2')]},'reason':{'type':Sequelize[_0xde16('0x2')]},'disposition':{'type':Sequelize[_0xde16('0x2')]},'secondDisposition':{'type':Sequelize[_0xde16('0x2')]},'thirdDisposition':{'type':Sequelize[_0xde16('0x2')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x907cc9){var _0x1a9dbd=this['getDataValue']('endtime');if(_0x1a9dbd&&_0x907cc9){this[_0xde16('0x4')](_0xde16('0x5'),moment(_0x907cc9)[_0xde16('0x6')](moment(_0x1a9dbd),_0xde16('0x7')));}}},'amd':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xde16('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xde16('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xde16('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xde16('0x3')]},'deleted':{'type':Sequelize[_0xde16('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xde16('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 971db45..343ab8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x37a051,_0x4551c1){var _0x224dfc=function(_0x39462f){while(--_0x39462f){_0x37a051['push'](_0x37a051['shift']());}};_0x224dfc(++_0x4551c1);}(_0x90b1,0x1bb));var _0x190b=function(_0x5e8d8b,_0x3defdb){_0x5e8d8b=_0x5e8d8b-0x0;var _0xc38051=_0x90b1[_0x5e8d8b];return _0xc38051;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));};
\ No newline at end of file
+var _0x781d=['length','nolimit','order','where','filters','filter','merge','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','body','uniqueid','find','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','fromQuery','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','then','error','name','send','index','map','CmHopperFinal','fieldName','type','key','query','keys','intersection','model','attributes','fields'];(function(_0x5534fe,_0x43c22e){var _0x3d1dc2=function(_0x9df12){while(--_0x9df12){_0x5534fe['push'](_0x5534fe['shift']());}};_0x3d1dc2(++_0x43c22e);}(_0x781d,0x14a));var _0xd781=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x781d[_0x160c73];return _0xd9302;};'use strict';var emlformat=require(_0xd781('0x0'));var rimraf=require(_0xd781('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd781('0x2'));var moment=require(_0xd781('0x3'));var BPromise=require(_0xd781('0x4'));var Mustache=require(_0xd781('0x5'));var util=require(_0xd781('0x6'));var path=require(_0xd781('0x7'));var sox=require(_0xd781('0x8'));var csv=require(_0xd781('0x9'));var ejs=require(_0xd781('0xa'));var fs=require('fs');var fs_extra=require(_0xd781('0xb'));var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var licenseUtil=require(_0xd781('0x17'));var db=require(_0xd781('0x18'))['db'];function respondWithStatusCode(_0xbea78b,_0x1f2f1e){_0x1f2f1e=_0x1f2f1e||0xcc;return function(_0xc7758f){if(_0xc7758f){return _0xbea78b[_0xd781('0x19')](_0x1f2f1e);}return _0xbea78b[_0xd781('0x1a')](_0x1f2f1e)[_0xd781('0x1b')]();};}function respondWithResult(_0xd454e7,_0x587953){_0x587953=_0x587953||0xc8;return function(_0x477bdc){if(_0x477bdc){return _0xd454e7[_0xd781('0x1a')](_0x587953)['json'](_0x477bdc);}};}function respondWithFilteredResult(_0x3a1f48,_0x48bffc){return function(_0x294e5a){if(_0x294e5a){var _0x22d787=typeof _0x48bffc[_0xd781('0x1c')]===_0xd781('0x1d')&&typeof _0x48bffc[_0xd781('0x1e')]===_0xd781('0x1d');var _0x501b0d=_0x294e5a['count'];var _0x1407fc=_0x22d787?0x0:_0x48bffc[_0xd781('0x1c')];var _0x395d9c=_0x22d787?_0x294e5a[_0xd781('0x1f')]:_0x48bffc[_0xd781('0x1c')]+_0x48bffc[_0xd781('0x1e')];var _0x260aa8;if(_0x395d9c>=_0x501b0d){_0x395d9c=_0x501b0d;_0x260aa8=0xc8;}else{_0x260aa8=0xce;}_0x3a1f48[_0xd781('0x1a')](_0x260aa8);return _0x3a1f48['set'](_0xd781('0x20'),_0x1407fc+'-'+_0x395d9c+'/'+_0x501b0d)[_0xd781('0x21')](_0x294e5a);}return null;};}function patchUpdates(_0x1036d3){return function(_0x103758){try{jsonpatch[_0xd781('0x22')](_0x103758,_0x1036d3,!![]);}catch(_0x274665){return BPromise[_0xd781('0x23')](_0x274665);}return _0x103758['save']();};}function saveUpdates(_0xe0c65f,_0x4e2c56){return function(_0x567fdf){if(_0x567fdf){return _0x567fdf[_0xd781('0x24')](_0xe0c65f)['then'](function(_0x175ba6){return _0x175ba6;});}return null;};}function removeEntity(_0x101480,_0x395087){return function(_0x31bf57){if(_0x31bf57){return _0x31bf57[_0xd781('0x25')]()[_0xd781('0x26')](function(){_0x101480[_0xd781('0x1a')](0xcc)[_0xd781('0x1b')]();});}};}function handleEntityNotFound(_0x10940b,_0x5662db){return function(_0x529ca1){if(!_0x529ca1){_0x10940b[_0xd781('0x19')](0x194);}return _0x529ca1;};}function handleError(_0x849587,_0xdad0b1){_0xdad0b1=_0xdad0b1||0x1f4;return function(_0x57b41e){logger[_0xd781('0x27')](_0x57b41e['stack']);if(_0x57b41e['name']){delete _0x57b41e[_0xd781('0x28')];}_0x849587['status'](_0xdad0b1)[_0xd781('0x29')](_0x57b41e);};}exports[_0xd781('0x2a')]=function(_0x5c3848,_0x5b6b9d){var _0x43cc74={},_0x5b0464={},_0x296a0b={'count':0x0,'rows':[]};var _0x4a3bd3=_[_0xd781('0x2b')](db[_0xd781('0x2c')]['rawAttributes'],function(_0x54521e){return{'name':_0x54521e[_0xd781('0x2d')],'type':_0x54521e[_0xd781('0x2e')][_0xd781('0x2f')]};});_0x5b0464['model']=_['map'](_0x4a3bd3,_0xd781('0x28'));_0x5b0464[_0xd781('0x30')]=_[_0xd781('0x31')](_0x5c3848['query']);_0x5b0464['filters']=_[_0xd781('0x32')](_0x5b0464[_0xd781('0x33')],_0x5b0464['query']);_0x43cc74[_0xd781('0x34')]=_[_0xd781('0x32')](_0x5b0464['model'],qs[_0xd781('0x35')](_0x5c3848[_0xd781('0x30')][_0xd781('0x35')]));_0x43cc74[_0xd781('0x34')]=_0x43cc74['attributes'][_0xd781('0x36')]?_0x43cc74[_0xd781('0x34')]:_0x5b0464[_0xd781('0x33')];if(!_0x5c3848[_0xd781('0x30')]['hasOwnProperty'](_0xd781('0x37'))){_0x43cc74[_0xd781('0x1e')]=qs['limit'](_0x5c3848[_0xd781('0x30')]['limit']);_0x43cc74[_0xd781('0x1c')]=qs[_0xd781('0x1c')](_0x5c3848['query'][_0xd781('0x1c')]);}_0x43cc74[_0xd781('0x38')]=qs['sort'](_0x5c3848[_0xd781('0x30')]['sort']);_0x43cc74[_0xd781('0x39')]=qs[_0xd781('0x3a')](_['pick'](_0x5c3848[_0xd781('0x30')],_0x5b0464[_0xd781('0x3a')]),_0x4a3bd3);if(_0x5c3848['query'][_0xd781('0x3b')]){_0x43cc74[_0xd781('0x39')]=_[_0xd781('0x3c')](_0x43cc74['where'],{'$or':_[_0xd781('0x2b')](_0x4a3bd3,function(_0x22b94e){if(_0x22b94e[_0xd781('0x2e')]!==_0xd781('0x3d')){var _0x2e8218={};_0x2e8218[_0x22b94e[_0xd781('0x28')]]={'$like':'%'+_0x5c3848[_0xd781('0x30')][_0xd781('0x3b')]+'%'};return _0x2e8218;}})});}_0x43cc74=_[_0xd781('0x3c')]({},_0x43cc74,_0x5c3848['options']);var _0x2a60d6={'where':_0x43cc74['where']};return db[_0xd781('0x2c')][_0xd781('0x1f')](_0x2a60d6)['then'](function(_0x1a5833){_0x296a0b[_0xd781('0x1f')]=_0x1a5833;if(_0x5c3848[_0xd781('0x30')][_0xd781('0x3e')]){_0x43cc74['include']=[{'all':!![]}];}return db[_0xd781('0x2c')]['findAll'](_0x43cc74);})[_0xd781('0x26')](function(_0xcdaacf){_0x296a0b['rows']=_0xcdaacf;return _0x296a0b;})['then'](respondWithFilteredResult(_0x5b6b9d,_0x43cc74))[_0xd781('0x3f')](handleError(_0x5b6b9d,null));};exports[_0xd781('0x40')]=function(_0x15b49d,_0x23bbab){var _0x53aba6={'raw':!![],'where':{'id':_0x15b49d[_0xd781('0x41')]['id']}},_0x46e7f6={};_0x46e7f6['model']=_['keys'](db[_0xd781('0x2c')][_0xd781('0x42')]);_0x46e7f6[_0xd781('0x30')]=_['keys'](_0x15b49d['query']);_0x46e7f6[_0xd781('0x3a')]=_[_0xd781('0x32')](_0x46e7f6[_0xd781('0x33')],_0x46e7f6[_0xd781('0x30')]);_0x53aba6[_0xd781('0x34')]=_[_0xd781('0x32')](_0x46e7f6['model'],qs['fields'](_0x15b49d[_0xd781('0x30')][_0xd781('0x35')]));_0x53aba6[_0xd781('0x34')]=_0x53aba6[_0xd781('0x34')][_0xd781('0x36')]?_0x53aba6['attributes']:_0x46e7f6[_0xd781('0x33')];if(_0x15b49d[_0xd781('0x30')][_0xd781('0x3e')]){_0x53aba6['include']=[{'all':!![]}];}_0x53aba6=_[_0xd781('0x3c')]({},_0x53aba6,_0x15b49d[_0xd781('0x43')]);return db[_0xd781('0x2c')]['find'](_0x53aba6)[_0xd781('0x26')](handleEntityNotFound(_0x23bbab,null))[_0xd781('0x26')](respondWithResult(_0x23bbab,null))['catch'](handleError(_0x23bbab,null));};exports['describe']=function(_0x13a907,_0x16d16e){return db[_0xd781('0x2c')]['describe']()[_0xd781('0x26')](respondWithResult(_0x16d16e,null))[_0xd781('0x3f')](handleError(_0x16d16e,null));};exports[_0xd781('0x24')]=function(_0x39ecdb,_0x336d30){if(_0x39ecdb[_0xd781('0x44')][_0xd781('0x45')]){delete _0x39ecdb['body'][_0xd781('0x45')];}return db[_0xd781('0x2c')][_0xd781('0x46')]({'where':{'uniqueid':_0x39ecdb['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x336d30,null))[_0xd781('0x26')](saveUpdates(_0x39ecdb['body'],null))[_0xd781('0x26')](respondWithResult(_0x336d30,null))[_0xd781('0x3f')](handleError(_0x336d30,null));};exports[_0xd781('0x47')]=function(_0x207546,_0x42a2f9,_0x599915){return db[_0xd781('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x207546[_0xd781('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xd781('0x4b')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xd781('0x4c')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd781('0x4f')))),_0xd781('0x50')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xd781('0x4a')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd781('0x53')],[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')]['literal'](_0xd781('0x54')))),_0xd781('0x55')]]})['then'](handleEntityNotFound(_0x42a2f9,null))[_0xd781('0x26')](respondWithResult(_0x42a2f9,null))[_0xd781('0x3f')](handleError(_0x42a2f9,null));};exports[_0xd781('0x56')]=function(_0x2c4874,_0x2e8bab,_0x38bd3e){return db[_0xd781('0x2c')][_0xd781('0x57')]({'raw':![],'where':{'CampaignId':_0x2c4874[_0xd781('0x41')]['id']},'attributes':[[db[_0xd781('0x49')]['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x58')))),_0xd781('0x59')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5a')))),_0xd781('0x4b')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4d')))),_0xd781('0x4e')],[db['sequelize']['fn'](_0xd781('0x48'),db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x4f')))),_0xd781('0x50')],[db['sequelize']['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db['sequelize'][_0xd781('0x4a')](_0xd781('0x51')))),_0xd781('0x52')],[db[_0xd781('0x49')]['fn']('COUNT',db[_0xd781('0x49')]['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')](_0xd781('0x5b')))),_0xd781('0x53')],[db['sequelize']['fn'](_0xd781('0x48'),db['sequelize']['fn']('IF',db[_0xd781('0x49')][_0xd781('0x4a')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0xd781('0x26')](handleEntityNotFound(_0x2e8bab,null))[_0xd781('0x26')](respondWithResult(_0x2e8bab,null))[_0xd781('0x3f')](handleError(_0x2e8bab,null));};exports[_0xd781('0x5c')]=function(_0x26a0a9,_0x172a05,_0x2e0401){return db[_0xd781('0x5d')][_0xd781('0x46')]({'where':{'id':_0x26a0a9['params']['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x172a05,null))[_0xd781('0x26')](function(_0x4c712f){var _0x24e3f5;if(_0x4c712f){_0x24e3f5=squel['insert']()[_0xd781('0x5e')](_0xd781('0x5f'))['fromQuery'](['phone',_0xd781('0x60'),_0xd781('0x61'),_0xd781('0x62'),_0xd781('0x63'),_0xd781('0x64'),_0xd781('0x65')],squel['select']()[_0xd781('0x66')](_0xd781('0x67'),_0xd781('0x68'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),'ListId')[_0xd781('0x66')]('ANY_VALUE(VoiceQueueId)',_0xd781('0x63'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x65'))[_0xd781('0x6c')](_0xd781('0x6d'))[_0xd781('0x39')]('VoiceQueueId\x20=\x20?',_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]())['where'](_0xd781('0x6f'),_0x26a0a9[_0xd781('0x44')][_0xd781('0x70')]['toString']())['where'](_0xd781('0x71'))['where'](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x68'))[_0xd781('0x6c')]('cm_hopper')[_0xd781('0x39')](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))[_0xd781('0x6c')](_0xd781('0x6d'))['where'](_0xd781('0x74'),_0x26a0a9[_0xd781('0x41')]['id']['toString']())[_0xd781('0x39')](_0xd781('0x76')))[_0xd781('0x77')]('ContactId'))[_0xd781('0x6e')]();return db[_0xd781('0x49')]['query'](_0x24e3f5);}return[];})[_0xd781('0x26')](respondWithResult(_0x172a05,null))['catch'](handleError(_0x172a05,null));};exports[_0xd781('0x78')]=function(_0x23dba5,_0x3e0749,_0x192c95){return db[_0xd781('0x79')]['find']({'where':{'id':_0x23dba5[_0xd781('0x41')]['id']}})[_0xd781('0x26')](handleEntityNotFound(_0x3e0749,null))[_0xd781('0x26')](function(_0x3897bf){var _0xaa945b;if(_0x3897bf){_0xaa945b=squel[_0xd781('0x7a')]()['into'](_0xd781('0x5f'))[_0xd781('0x7b')](['phone',_0xd781('0x60'),_0xd781('0x61'),'ListId',_0xd781('0x7c'),_0xd781('0x64'),_0xd781('0x65')],squel[_0xd781('0x73')]()[_0xd781('0x66')]('ANY_VALUE(calleridnum)','phone')['field'](_0xd781('0x69'),_0xd781('0x60'))[_0xd781('0x66')](_0xd781('0x6a'),_0xd781('0x61'))[_0xd781('0x66')](_0xd781('0x6b'),_0xd781('0x62'))[_0xd781('0x66')]('ANY_VALUE(CampaignId)',_0xd781('0x7c'))[_0xd781('0x66')](_0xd781('0x69'),_0xd781('0x64'))[_0xd781('0x66')]('NOW()','updatedAt')['from'](_0xd781('0x6d'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id']['toString']())['where'](_0xd781('0x6f'),_0x23dba5[_0xd781('0x44')][_0xd781('0x70')][_0xd781('0x6e')]())['where'](_0xd781('0x71'))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')]('phone')[_0xd781('0x6c')](_0xd781('0x5f'))['where'](_0xd781('0x7d'),_0x23dba5[_0xd781('0x41')]['id'][_0xd781('0x6e')]()))[_0xd781('0x39')](_0xd781('0x72'),squel[_0xd781('0x73')]()[_0xd781('0x66')](_0xd781('0x75'))['from']('cm_hopper_final')[_0xd781('0x39')](_0xd781('0x7d'),_0x23dba5['params']['id'][_0xd781('0x6e')]())[_0xd781('0x39')]('state\x20=\x204'))[_0xd781('0x77')](_0xd781('0x61')))['toString']();return db[_0xd781('0x49')]['query'](_0xaa945b);}return[];})[_0xd781('0x26')](respondWithResult(_0x3e0749,null))[_0xd781('0x3f')](handleError(_0x3e0749,null));};exports[_0xd781('0x7e')]=function(_0x52b9c6,_0x5a2252,_0x356c56){return db[_0xd781('0x7f')]['findOne']({'where':{'VoiceQueueId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x63')],'CampaignId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x7c')],'ContactId':_0x52b9c6[_0xd781('0x44')][_0xd781('0x61')]}})[_0xd781('0x26')](handleEntityNotFound(_0x5a2252,null))[_0xd781('0x26')](function(_0x532fd8){if(_0x532fd8){return _0x532fd8;}return null;})[_0xd781('0x26')](respondWithResult(_0x5a2252,null))[_0xd781('0x3f')](handleError(_0x5a2252,null));};
\ No newline at end of file
index 2b96580..a226aab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3c4=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes'];(function(_0x4aae41,_0x100d30){var _0x41456b=function(_0x889727){while(--_0x889727){_0x4aae41['push'](_0x4aae41['shift']());}};_0x41456b(++_0x100d30);}(_0xa3c4,0xf4));var _0x4a3c=function(_0x1e2ba0,_0x25f9a3){_0x1e2ba0=_0x1e2ba0-0x0;var _0x33757b=_0xa3c4[_0x1e2ba0];return _0x33757b;};'use strict';var _=require('lodash');var util=require(_0x4a3c('0x0'));var logger=require(_0x4a3c('0x1'))(_0x4a3c('0x2'));var moment=require(_0x4a3c('0x3'));var BPromise=require('bluebird');var rp=require(_0x4a3c('0x4'));var fs=require('fs');var path=require(_0x4a3c('0x5'));var rimraf=require('rimraf');var config=require(_0x4a3c('0x6'));var attributes=require(_0x4a3c('0x7'));module[_0x4a3c('0x8')]=function(_0x40929d,_0x1f9050){return _0x40929d[_0x4a3c('0x9')](_0x4a3c('0xa'),attributes,{'tableName':_0x4a3c('0xb'),'paranoid':![],'indexes':[{'name':_0x4a3c('0xc'),'fields':[_0x4a3c('0xc')]},{'name':'uniqueid','fields':[_0x4a3c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xebf9=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xebf9,0xed));var _0x9ebf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xebf9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9ebf('0x0'));var util=require(_0x9ebf('0x1'));var logger=require(_0x9ebf('0x2'))(_0x9ebf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ebf('0x4'));var fs=require('fs');var path=require(_0x9ebf('0x5'));var rimraf=require(_0x9ebf('0x6'));var config=require(_0x9ebf('0x7'));var attributes=require(_0x9ebf('0x8'));module['exports']=function(_0x20d186,_0x29b6d2){return _0x20d186[_0x9ebf('0x9')](_0x9ebf('0xa'),attributes,{'tableName':_0x9ebf('0xb'),'paranoid':![],'indexes':[{'name':_0x9ebf('0xc'),'fields':['calleridnum']},{'name':_0x9ebf('0xd'),'fields':[_0x9ebf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 3b2ad56..24b0ef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x4c2fa8,_0x5f4d41){var _0x3c74ce=function(_0x343ba3){while(--_0x343ba3){_0x4c2fa8['push'](_0x4c2fa8['shift']());}};_0x3c74ce(++_0x5f4d41);}(_0xb10b,0x12a));var _0xbb10=function(_0x2ae2cd,_0xb42c96){_0x2ae2cd=_0x2ae2cd-0x0;var _0xc52725=_0xb10b[_0x2ae2cd];return _0xc52725;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0xe026dd,_0x410aa3){var _0x9f88bf=function(_0x205dcf){while(--_0x205dcf){_0xe026dd['push'](_0xe026dd['shift']());}};_0x9f88bf(++_0x410aa3);}(_0xb10b,0x12a));var _0xbb10=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0xb10b[_0xd3e0b9];return _0x470133;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
index d174bf7..abc4fc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49a3=['/describe','describe','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x58e502,_0x7eff41){var _0x63e85c=function(_0x63f36e){while(--_0x63f36e){_0x58e502['push'](_0x58e502['shift']());}};_0x63e85c(++_0x7eff41);}(_0x49a3,0xe6));var _0x349a=function(_0x2512de,_0x268ad3){_0x2512de=_0x2512de-0x0;var _0x4f9774=_0x49a3[_0x2512de];return _0x4f9774;};'use strict';var multer=require('multer');var util=require(_0x349a('0x0'));var path=require(_0x349a('0x1'));var timeout=require(_0x349a('0x2'));var express=require(_0x349a('0x3'));var router=express[_0x349a('0x4')]();var fs_extra=require(_0x349a('0x5'));var auth=require(_0x349a('0x6'));var interaction=require(_0x349a('0x7'));var config=require(_0x349a('0x8'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x349a('0x9')](),controller['index']);router['get'](_0x349a('0xa'),auth[_0x349a('0x9')](),controller[_0x349a('0xb')]);router[_0x349a('0xc')]('/:id',auth[_0x349a('0x9')](),controller['show']);router[_0x349a('0xc')](_0x349a('0xd'),auth['isAuthenticated'](),controller[_0x349a('0xe')]);router['get'](_0x349a('0xf'),auth['isAuthenticated'](),controller[_0x349a('0x10')]);router[_0x349a('0x11')](_0x349a('0x12'),auth[_0x349a('0x9')](),controller[_0x349a('0x13')]);router['post']('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x349a('0x14')]);router['post']('/checkContactHopper',auth[_0x349a('0x9')](),controller[_0x349a('0x15')]);router['put']('/:id',auth[_0x349a('0x9')](),controller[_0x349a('0x16')]);module[_0x349a('0x17')]=router;
\ No newline at end of file
+var _0x05e8=['put','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','get','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x2da929,_0x482098){var _0x241aa3=function(_0x4471ac){while(--_0x4471ac){_0x2da929['push'](_0x2da929['shift']());}};_0x241aa3(++_0x482098);}(_0x05e8,0xc9));var _0x805e=function(_0x11c564,_0x55be84){_0x11c564=_0x11c564-0x0;var _0x492549=_0x05e8[_0x11c564];return _0x492549;};'use strict';var multer=require(_0x805e('0x0'));var util=require(_0x805e('0x1'));var path=require(_0x805e('0x2'));var timeout=require(_0x805e('0x3'));var express=require('express');var router=express[_0x805e('0x4')]();var fs_extra=require(_0x805e('0x5'));var auth=require(_0x805e('0x6'));var interaction=require(_0x805e('0x7'));var config=require('../../config/environment');var controller=require(_0x805e('0x8'));router['get']('/',auth[_0x805e('0x9')](),controller['index']);router[_0x805e('0xa')]('/describe',auth[_0x805e('0x9')](),controller['describe']);router['get'](_0x805e('0xb'),auth[_0x805e('0x9')](),controller[_0x805e('0xc')]);router[_0x805e('0xa')](_0x805e('0xd'),auth['isAuthenticated'](),controller[_0x805e('0xe')]);router[_0x805e('0xa')](_0x805e('0xf'),auth[_0x805e('0x9')](),controller[_0x805e('0x10')]);router[_0x805e('0x11')](_0x805e('0x12'),auth[_0x805e('0x9')](),controller[_0x805e('0x13')]);router['post'](_0x805e('0x14'),auth['isAuthenticated'](),controller[_0x805e('0x15')]);router[_0x805e('0x11')](_0x805e('0x16'),auth[_0x805e('0x9')](),controller[_0x805e('0x17')]);router[_0x805e('0x18')]('/:id',auth['isAuthenticated'](),controller['update']);module['exports']=router;
\ No newline at end of file
index 2acf92f..f20b338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa59a=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x4d1ee9,_0x394a78){var _0x9a5456=function(_0x224f3b){while(--_0x224f3b){_0x4d1ee9['push'](_0x4d1ee9['shift']());}};_0x9a5456(++_0x394a78);}(_0xa59a,0x1d2));var _0xaa59=function(_0x3fae7e,_0x3d7800){_0x3fae7e=_0x3fae7e-0x0;var _0x13aaf3=_0xa59a[_0x3fae7e];return _0x13aaf3;};'use strict';var Sequelize=require(_0xaa59('0x0'));module[_0xaa59('0x1')]={'state':{'type':Sequelize[_0xaa59('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xaa59('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xaa59('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xaa59('0x3')]},'calleridnum':{'type':Sequelize[_0xaa59('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xaa59('0x4')]},'answertime':{'type':Sequelize[_0xaa59('0x4')]},'droptime':{'type':Sequelize[_0xaa59('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xaa59('0x3')]},'campaign':{'type':Sequelize[_0xaa59('0x3')]},'campaigntype':{'type':Sequelize[_0xaa59('0x3')]},'membername':{'type':Sequelize[_0xaa59('0x3')]},'reason':{'type':Sequelize[_0xaa59('0x3')]},'amd':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xaa59('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xaa59('0x4')]},'recallme':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xaa59('0x4')]},'edited':{'type':Sequelize[_0xaa59('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xaa59('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xaa59('0x3')]}};
\ No newline at end of file
+var _0xd798=['BOOLEAN','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd798,0x97));var _0x8d79=function(_0x5287fb,_0x398e56){_0x5287fb=_0x5287fb-0x0;var _0x36ad71=_0xd798[_0x5287fb];return _0x36ad71;};'use strict';var Sequelize=require(_0x8d79('0x0'));module[_0x8d79('0x1')]={'state':{'type':Sequelize[_0x8d79('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x8d79('0x3')]},'scheduledat':{'type':Sequelize[_0x8d79('0x4')]},'countbusyretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8d79('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x8d79('0x3')]},'originatecalleridname':{'type':Sequelize[_0x8d79('0x3')]},'calleridnum':{'type':Sequelize[_0x8d79('0x3')]},'calleridname':{'type':Sequelize[_0x8d79('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x8d79('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x8d79('0x4')]},'endtime':{'type':Sequelize[_0x8d79('0x4')]},'ringtime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x8d79('0x3')]},'campaign':{'type':Sequelize[_0x8d79('0x3')]},'campaigntype':{'type':Sequelize[_0x8d79('0x3')]},'membername':{'type':Sequelize[_0x8d79('0x3')]},'reason':{'type':Sequelize[_0x8d79('0x3')]},'amd':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8d79('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x8d79('0x4')]},'edited':{'type':Sequelize[_0x8d79('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8d79('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x8d79('0x3')]}};
\ No newline at end of file
index 4c04cc4..b4b1fd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b78=['keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','model','query'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7b78,0x16a));var _0x87b7=function(_0x24a0b6,_0x43dd37){_0x24a0b6=_0x24a0b6-0x0;var _0x525767=_0x7b78[_0x24a0b6];return _0x525767;};'use strict';var emlformat=require(_0x87b7('0x0'));var rimraf=require(_0x87b7('0x1'));var zipdir=require(_0x87b7('0x2'));var jsonpatch=require(_0x87b7('0x3'));var rp=require(_0x87b7('0x4'));var moment=require(_0x87b7('0x5'));var BPromise=require(_0x87b7('0x6'));var Mustache=require(_0x87b7('0x7'));var util=require(_0x87b7('0x8'));var path=require(_0x87b7('0x9'));var sox=require(_0x87b7('0xa'));var csv=require(_0x87b7('0xb'));var ejs=require(_0x87b7('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x87b7('0xd'));var squel=require(_0x87b7('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x87b7('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x87b7('0x10'));var Redis=require(_0x87b7('0x11'));var authService=require(_0x87b7('0x12'));var qs=require(_0x87b7('0x13'));var as=require(_0x87b7('0x14'));var hardwareService=require(_0x87b7('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x87b7('0x16'));var config=require(_0x87b7('0x17'));var licenseUtil=require(_0x87b7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x532f7a,_0x5dd189){_0x5dd189=_0x5dd189||0xcc;return function(_0x1640c4){if(_0x1640c4){return _0x532f7a[_0x87b7('0x19')](_0x5dd189);}return _0x532f7a[_0x87b7('0x1a')](_0x5dd189)[_0x87b7('0x1b')]();};}function respondWithResult(_0x181ac5,_0x3bf1eb){_0x3bf1eb=_0x3bf1eb||0xc8;return function(_0x4753b2){if(_0x4753b2){return _0x181ac5[_0x87b7('0x1a')](_0x3bf1eb)['json'](_0x4753b2);}};}function respondWithFilteredResult(_0x108740,_0x3c4f2d){return function(_0x21f976){if(_0x21f976){var _0x37477a=typeof _0x3c4f2d[_0x87b7('0x1c')]===_0x87b7('0x1d')&&typeof _0x3c4f2d[_0x87b7('0x1e')]===_0x87b7('0x1d');var _0x467c63=_0x21f976['count'];var _0x903c33=_0x37477a?0x0:_0x3c4f2d['offset'];var _0x690699=_0x37477a?_0x21f976[_0x87b7('0x1f')]:_0x3c4f2d[_0x87b7('0x1c')]+_0x3c4f2d[_0x87b7('0x1e')];var _0x54d412;if(_0x690699>=_0x467c63){_0x690699=_0x467c63;_0x54d412=0xc8;}else{_0x54d412=0xce;}_0x108740['status'](_0x54d412);return _0x108740['set'](_0x87b7('0x20'),_0x903c33+'-'+_0x690699+'/'+_0x467c63)['json'](_0x21f976);}return null;};}function patchUpdates(_0x27424f){return function(_0x41363b){try{jsonpatch['apply'](_0x41363b,_0x27424f,!![]);}catch(_0x363b8a){return BPromise[_0x87b7('0x21')](_0x363b8a);}return _0x41363b['save']();};}function saveUpdates(_0x2269e2,_0x31d343){return function(_0x143a81){if(_0x143a81){return _0x143a81[_0x87b7('0x22')](_0x2269e2)[_0x87b7('0x23')](function(_0x3e6270){return _0x3e6270;});}return null;};}function removeEntity(_0x184e84,_0x9e65ea){return function(_0x132044){if(_0x132044){return _0x132044[_0x87b7('0x24')]()['then'](function(){_0x184e84[_0x87b7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17be48,_0xd238f3){return function(_0x43c552){if(!_0x43c552){_0x17be48[_0x87b7('0x19')](0x194);}return _0x43c552;};}function handleError(_0x5387d3,_0xcfe77a){_0xcfe77a=_0xcfe77a||0x1f4;return function(_0xb4f656){logger['error'](_0xb4f656[_0x87b7('0x25')]);if(_0xb4f656['name']){delete _0xb4f656[_0x87b7('0x26')];}_0x5387d3[_0x87b7('0x1a')](_0xcfe77a)['send'](_0xb4f656);};}exports[_0x87b7('0x27')]=function(_0x25bbc1,_0x152de0){var _0x5efb57={},_0x1f13ea={},_0x252eea={'count':0x0,'rows':[]};var _0x59b9e9=_[_0x87b7('0x28')](db[_0x87b7('0x29')][_0x87b7('0x2a')],function(_0x369767){return{'name':_0x369767[_0x87b7('0x2b')],'type':_0x369767['type']['key']};});_0x1f13ea[_0x87b7('0x2c')]=_[_0x87b7('0x28')](_0x59b9e9,_0x87b7('0x26'));_0x1f13ea[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x25bbc1['query']);_0x1f13ea[_0x87b7('0x2f')]=_[_0x87b7('0x30')](_0x1f13ea['model'],_0x1f13ea['query']);_0x5efb57[_0x87b7('0x31')]=_[_0x87b7('0x30')](_0x1f13ea['model'],qs[_0x87b7('0x32')](_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x32')]));_0x5efb57[_0x87b7('0x31')]=_0x5efb57[_0x87b7('0x31')]['length']?_0x5efb57[_0x87b7('0x31')]:_0x1f13ea[_0x87b7('0x2c')];if(!_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x33')]('nolimit')){_0x5efb57[_0x87b7('0x1e')]=qs['limit'](_0x25bbc1['query'][_0x87b7('0x1e')]);_0x5efb57[_0x87b7('0x1c')]=qs[_0x87b7('0x1c')](_0x25bbc1['query'][_0x87b7('0x1c')]);}_0x5efb57['order']=qs[_0x87b7('0x34')](_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x34')]);_0x5efb57[_0x87b7('0x35')]=qs['filters'](_[_0x87b7('0x36')](_0x25bbc1[_0x87b7('0x2d')],_0x1f13ea['filters']),_0x59b9e9);if(_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x37')]){_0x5efb57[_0x87b7('0x35')]=_[_0x87b7('0x38')](_0x5efb57[_0x87b7('0x35')],{'$or':_['map'](_0x59b9e9,function(_0x1d5bec){if(_0x1d5bec['type']!=='VIRTUAL'){var _0x295331={};_0x295331[_0x1d5bec[_0x87b7('0x26')]]={'$like':'%'+_0x25bbc1['query'][_0x87b7('0x37')]+'%'};return _0x295331;}})});}_0x5efb57=_[_0x87b7('0x38')]({},_0x5efb57,_0x25bbc1[_0x87b7('0x39')]);var _0x5ad1c9={'where':_0x5efb57[_0x87b7('0x35')]};return db[_0x87b7('0x29')]['count'](_0x5ad1c9)[_0x87b7('0x23')](function(_0x378715){_0x252eea[_0x87b7('0x1f')]=_0x378715;if(_0x25bbc1[_0x87b7('0x2d')][_0x87b7('0x3a')]){_0x5efb57[_0x87b7('0x3b')]=[{'all':!![]}];}return db[_0x87b7('0x29')][_0x87b7('0x3c')](_0x5efb57);})[_0x87b7('0x23')](function(_0x529bd0){_0x252eea['rows']=_0x529bd0;return _0x252eea;})[_0x87b7('0x23')](respondWithFilteredResult(_0x152de0,_0x5efb57))['catch'](handleError(_0x152de0,null));};exports['show']=function(_0x38ac78,_0x19cd58){var _0x3c1d74={'raw':!![],'where':{'id':_0x38ac78[_0x87b7('0x3d')]['id']}},_0x33a9b9={};_0x33a9b9[_0x87b7('0x2c')]=_[_0x87b7('0x2e')](db[_0x87b7('0x29')][_0x87b7('0x2a')]);_0x33a9b9[_0x87b7('0x2d')]=_[_0x87b7('0x2e')](_0x38ac78[_0x87b7('0x2d')]);_0x33a9b9['filters']=_[_0x87b7('0x30')](_0x33a9b9['model'],_0x33a9b9[_0x87b7('0x2d')]);_0x3c1d74[_0x87b7('0x31')]=_['intersection'](_0x33a9b9[_0x87b7('0x2c')],qs[_0x87b7('0x32')](_0x38ac78['query'][_0x87b7('0x32')]));_0x3c1d74[_0x87b7('0x31')]=_0x3c1d74['attributes']['length']?_0x3c1d74['attributes']:_0x33a9b9[_0x87b7('0x2c')];if(_0x38ac78['query'][_0x87b7('0x3a')]){_0x3c1d74[_0x87b7('0x3b')]=[{'all':!![]}];}_0x3c1d74=_['merge']({},_0x3c1d74,_0x38ac78[_0x87b7('0x39')]);return db[_0x87b7('0x29')][_0x87b7('0x3e')](_0x3c1d74)[_0x87b7('0x23')](handleEntityNotFound(_0x19cd58,null))[_0x87b7('0x23')](respondWithResult(_0x19cd58,null))[_0x87b7('0x3f')](handleError(_0x19cd58,null));};exports[_0x87b7('0x40')]=function(_0x3ad407,_0x471d95){return db['CmHopperHistory'][_0x87b7('0x40')](_0x3ad407[_0x87b7('0x41')],{})[_0x87b7('0x23')](respondWithResult(_0x471d95,0xc9))[_0x87b7('0x3f')](handleError(_0x471d95,null));};exports[_0x87b7('0x42')]=function(_0x1170f1,_0x51a4b9){return db['CmHopperHistory']['describe']()[_0x87b7('0x23')](respondWithResult(_0x51a4b9,null))[_0x87b7('0x3f')](handleError(_0x51a4b9,null));};exports[_0x87b7('0x22')]=function(_0x4f3bfe,_0x5179be){if(_0x4f3bfe[_0x87b7('0x41')][_0x87b7('0x43')]){delete _0x4f3bfe[_0x87b7('0x41')][_0x87b7('0x43')];}return db['CmHopperHistory'][_0x87b7('0x3e')]({'where':{'uniqueid':_0x4f3bfe[_0x87b7('0x3d')]['id']}})[_0x87b7('0x23')](handleEntityNotFound(_0x5179be,null))['then'](saveUpdates(_0x4f3bfe[_0x87b7('0x41')],null))[_0x87b7('0x23')](respondWithResult(_0x5179be,null))[_0x87b7('0x3f')](handleError(_0x5179be,null));};
\ No newline at end of file
+var _0x70d8=['body','describe','update','uniqueid','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','create'];(function(_0x58347e,_0x2c6409){var _0x493ca6=function(_0x8b3a4c){while(--_0x8b3a4c){_0x58347e['push'](_0x58347e['shift']());}};_0x493ca6(++_0x2c6409);}(_0x70d8,0x12c));var _0x870d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x70d8[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x870d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x870d('0x1'));var moment=require('moment');var BPromise=require(_0x870d('0x2'));var Mustache=require(_0x870d('0x3'));var util=require(_0x870d('0x4'));var path=require(_0x870d('0x5'));var sox=require('sox');var csv=require(_0x870d('0x6'));var ejs=require(_0x870d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x870d('0x8'));var squel=require(_0x870d('0x9'));var crypto=require(_0x870d('0xa'));var jsforce=require(_0x870d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x870d('0xc'));var Papa=require(_0x870d('0xd'));var Redis=require(_0x870d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x870d('0xf'));var as=require(_0x870d('0x10'));var hardwareService=require(_0x870d('0x11'));var logger=require(_0x870d('0x12'))(_0x870d('0x13'));var utils=require(_0x870d('0x14'));var config=require(_0x870d('0x15'));var licenseUtil=require(_0x870d('0x16'));var db=require(_0x870d('0x17'))['db'];function respondWithStatusCode(_0x29fec0,_0x1f3995){_0x1f3995=_0x1f3995||0xcc;return function(_0x1dde24){if(_0x1dde24){return _0x29fec0['sendStatus'](_0x1f3995);}return _0x29fec0[_0x870d('0x18')](_0x1f3995)[_0x870d('0x19')]();};}function respondWithResult(_0x44c12c,_0x5eb6b5){_0x5eb6b5=_0x5eb6b5||0xc8;return function(_0x2112b6){if(_0x2112b6){return _0x44c12c['status'](_0x5eb6b5)[_0x870d('0x1a')](_0x2112b6);}};}function respondWithFilteredResult(_0x2b4f1f,_0x42e379){return function(_0x11b089){if(_0x11b089){var _0x13d46e=typeof _0x42e379[_0x870d('0x1b')]===_0x870d('0x1c')&&typeof _0x42e379[_0x870d('0x1d')]==='undefined';var _0x16038b=_0x11b089[_0x870d('0x1e')];var _0x23dc76=_0x13d46e?0x0:_0x42e379[_0x870d('0x1b')];var _0x3d19ee=_0x13d46e?_0x11b089[_0x870d('0x1e')]:_0x42e379[_0x870d('0x1b')]+_0x42e379[_0x870d('0x1d')];var _0x31de01;if(_0x3d19ee>=_0x16038b){_0x3d19ee=_0x16038b;_0x31de01=0xc8;}else{_0x31de01=0xce;}_0x2b4f1f[_0x870d('0x18')](_0x31de01);return _0x2b4f1f['set'](_0x870d('0x1f'),_0x23dc76+'-'+_0x3d19ee+'/'+_0x16038b)[_0x870d('0x1a')](_0x11b089);}return null;};}function patchUpdates(_0x268ba7){return function(_0x654af8){try{jsonpatch[_0x870d('0x20')](_0x654af8,_0x268ba7,!![]);}catch(_0x2dd373){return BPromise[_0x870d('0x21')](_0x2dd373);}return _0x654af8[_0x870d('0x22')]();};}function saveUpdates(_0x22a21f,_0x265282){return function(_0x10240e){if(_0x10240e){return _0x10240e['update'](_0x22a21f)['then'](function(_0x496c82){return _0x496c82;});}return null;};}function removeEntity(_0x5a142f,_0x54c62d){return function(_0x1b7943){if(_0x1b7943){return _0x1b7943[_0x870d('0x23')]()[_0x870d('0x24')](function(){_0x5a142f[_0x870d('0x18')](0xcc)[_0x870d('0x19')]();});}};}function handleEntityNotFound(_0x1dcf57,_0x381fbe){return function(_0x17a37f){if(!_0x17a37f){_0x1dcf57['sendStatus'](0x194);}return _0x17a37f;};}function handleError(_0x42a96a,_0xdbe43e){_0xdbe43e=_0xdbe43e||0x1f4;return function(_0x495bc9){logger[_0x870d('0x25')](_0x495bc9[_0x870d('0x26')]);if(_0x495bc9[_0x870d('0x27')]){delete _0x495bc9[_0x870d('0x27')];}_0x42a96a[_0x870d('0x18')](_0xdbe43e)[_0x870d('0x28')](_0x495bc9);};}exports[_0x870d('0x29')]=function(_0x14168d,_0x5b462a){var _0x48cff2={},_0x483342={},_0x1048ec={'count':0x0,'rows':[]};var _0x4e4c6e=_[_0x870d('0x2a')](db[_0x870d('0x2b')][_0x870d('0x2c')],function(_0x1e925d){return{'name':_0x1e925d[_0x870d('0x2d')],'type':_0x1e925d[_0x870d('0x2e')]['key']};});_0x483342[_0x870d('0x2f')]=_[_0x870d('0x2a')](_0x4e4c6e,_0x870d('0x27'));_0x483342[_0x870d('0x30')]=_[_0x870d('0x31')](_0x14168d[_0x870d('0x30')]);_0x483342[_0x870d('0x32')]=_['intersection'](_0x483342['model'],_0x483342['query']);_0x48cff2[_0x870d('0x33')]=_[_0x870d('0x34')](_0x483342[_0x870d('0x2f')],qs[_0x870d('0x35')](_0x14168d[_0x870d('0x30')]['fields']));_0x48cff2['attributes']=_0x48cff2[_0x870d('0x33')][_0x870d('0x36')]?_0x48cff2[_0x870d('0x33')]:_0x483342[_0x870d('0x2f')];if(!_0x14168d['query']['hasOwnProperty'](_0x870d('0x37'))){_0x48cff2[_0x870d('0x1d')]=qs['limit'](_0x14168d[_0x870d('0x30')][_0x870d('0x1d')]);_0x48cff2[_0x870d('0x1b')]=qs[_0x870d('0x1b')](_0x14168d[_0x870d('0x30')][_0x870d('0x1b')]);}_0x48cff2[_0x870d('0x38')]=qs[_0x870d('0x39')](_0x14168d[_0x870d('0x30')]['sort']);_0x48cff2[_0x870d('0x3a')]=qs['filters'](_[_0x870d('0x3b')](_0x14168d['query'],_0x483342['filters']),_0x4e4c6e);if(_0x14168d[_0x870d('0x30')][_0x870d('0x3c')]){_0x48cff2[_0x870d('0x3a')]=_[_0x870d('0x3d')](_0x48cff2['where'],{'$or':_['map'](_0x4e4c6e,function(_0x18f15a){if(_0x18f15a[_0x870d('0x2e')]!==_0x870d('0x3e')){var _0x428103={};_0x428103[_0x18f15a[_0x870d('0x27')]]={'$like':'%'+_0x14168d[_0x870d('0x30')][_0x870d('0x3c')]+'%'};return _0x428103;}})});}_0x48cff2=_[_0x870d('0x3d')]({},_0x48cff2,_0x14168d[_0x870d('0x3f')]);var _0x26f2f1={'where':_0x48cff2[_0x870d('0x3a')]};return db[_0x870d('0x2b')][_0x870d('0x1e')](_0x26f2f1)[_0x870d('0x24')](function(_0x30f882){_0x1048ec[_0x870d('0x1e')]=_0x30f882;if(_0x14168d[_0x870d('0x30')][_0x870d('0x40')]){_0x48cff2['include']=[{'all':!![]}];}return db[_0x870d('0x2b')][_0x870d('0x41')](_0x48cff2);})[_0x870d('0x24')](function(_0x2fb098){_0x1048ec[_0x870d('0x42')]=_0x2fb098;return _0x1048ec;})['then'](respondWithFilteredResult(_0x5b462a,_0x48cff2))[_0x870d('0x43')](handleError(_0x5b462a,null));};exports['show']=function(_0x1324a3,_0x75fbbc){var _0x3d5944={'raw':!![],'where':{'id':_0x1324a3['params']['id']}},_0x2fe27b={};_0x2fe27b[_0x870d('0x2f')]=_[_0x870d('0x31')](db[_0x870d('0x2b')][_0x870d('0x2c')]);_0x2fe27b[_0x870d('0x30')]=_['keys'](_0x1324a3[_0x870d('0x30')]);_0x2fe27b[_0x870d('0x32')]=_['intersection'](_0x2fe27b['model'],_0x2fe27b[_0x870d('0x30')]);_0x3d5944[_0x870d('0x33')]=_[_0x870d('0x34')](_0x2fe27b[_0x870d('0x2f')],qs[_0x870d('0x35')](_0x1324a3[_0x870d('0x30')][_0x870d('0x35')]));_0x3d5944['attributes']=_0x3d5944[_0x870d('0x33')][_0x870d('0x36')]?_0x3d5944[_0x870d('0x33')]:_0x2fe27b[_0x870d('0x2f')];if(_0x1324a3[_0x870d('0x30')][_0x870d('0x40')]){_0x3d5944[_0x870d('0x44')]=[{'all':!![]}];}_0x3d5944=_['merge']({},_0x3d5944,_0x1324a3[_0x870d('0x3f')]);return db['CmHopperHistory']['find'](_0x3d5944)[_0x870d('0x24')](handleEntityNotFound(_0x75fbbc,null))[_0x870d('0x24')](respondWithResult(_0x75fbbc,null))[_0x870d('0x43')](handleError(_0x75fbbc,null));};exports[_0x870d('0x45')]=function(_0x3f0c07,_0x1afce6){return db['CmHopperHistory'][_0x870d('0x45')](_0x3f0c07[_0x870d('0x46')],{})['then'](respondWithResult(_0x1afce6,0xc9))[_0x870d('0x43')](handleError(_0x1afce6,null));};exports[_0x870d('0x47')]=function(_0x41e067,_0x15fd16){return db[_0x870d('0x2b')][_0x870d('0x47')]()[_0x870d('0x24')](respondWithResult(_0x15fd16,null))[_0x870d('0x43')](handleError(_0x15fd16,null));};exports[_0x870d('0x48')]=function(_0x36109a,_0x4ceb49){if(_0x36109a[_0x870d('0x46')][_0x870d('0x49')]){delete _0x36109a[_0x870d('0x46')]['uniqueid'];}return db[_0x870d('0x2b')]['find']({'where':{'uniqueid':_0x36109a['params']['id']}})[_0x870d('0x24')](handleEntityNotFound(_0x4ceb49,null))[_0x870d('0x24')](saveUpdates(_0x36109a['body'],null))[_0x870d('0x24')](respondWithResult(_0x4ceb49,null))[_0x870d('0x43')](handleError(_0x4ceb49,null));};
\ No newline at end of file
index bc89bdf..66b0402 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7d9=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf7d9,0x122));var _0x9f7d=function(_0x5db4c9,_0x821c99){_0x5db4c9=_0x5db4c9-0x0;var _0x176a85=_0xf7d9[_0x5db4c9];return _0x176a85;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var logger=require(_0x9f7d('0x2'))(_0x9f7d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f7d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f7d('0x5'));var config=require(_0x9f7d('0x6'));var attributes=require(_0x9f7d('0x7'));module[_0x9f7d('0x8')]=function(_0x3cb3b8,_0x513f73){return _0x3cb3b8['define'](_0x9f7d('0x9'),attributes,{'tableName':_0x9f7d('0xa'),'paranoid':![],'indexes':[{'name':_0x9f7d('0xb'),'fields':[_0x9f7d('0xb')]},{'name':_0x9f7d('0xc'),'fields':[_0x9f7d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf417=['../../config/logger','api','bluebird','rimraf','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0x162ac7,_0x2c3d07){var _0x1f2d14=function(_0x5b5a45){while(--_0x5b5a45){_0x162ac7['push'](_0x162ac7['shift']());}};_0x1f2d14(++_0x2c3d07);}(_0xf417,0x8f));var _0x7f41=function(_0x1a3eb1,_0x5188d5){_0x1a3eb1=_0x1a3eb1-0x0;var _0x29efec=_0xf417[_0x1a3eb1];return _0x29efec;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var logger=require(_0x7f41('0x1'))(_0x7f41('0x2'));var moment=require('moment');var BPromise=require(_0x7f41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f41('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x5ecdb2,_0x1775d8){return _0x5ecdb2['define'](_0x7f41('0x5'),attributes,{'tableName':_0x7f41('0x6'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x7f41('0x7')]},{'name':'uniqueid','fields':[_0x7f41('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index fe0962a..8140744 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe739=['options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','debug','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','stringify','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body'];(function(_0x413960,_0x1024cc){var _0x963609=function(_0xca404){while(--_0xca404){_0x413960['push'](_0x413960['shift']());}};_0x963609(++_0x1024cc);}(_0xe739,0x105));var _0x9e73=function(_0x4e57b9,_0x563b9b){_0x4e57b9=_0x4e57b9-0x0;var _0x3e8fb3=_0xe739[_0x4e57b9];return _0x3e8fb3;};'use strict';var _=require(_0x9e73('0x0'));var util=require('util');var moment=require(_0x9e73('0x1'));var BPromise=require(_0x9e73('0x2'));var rs=require(_0x9e73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e73('0x4'))(_0x9e73('0x5'));var config=require(_0x9e73('0x6'));var jayson=require(_0x9e73('0x7'));var client=jayson['client'][_0x9e73('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26cb5b,_0xb37872,_0x5e46e7){return new BPromise(function(_0xa49f86,_0x1ee042){return client[_0x9e73('0x9')](_0x26cb5b,_0x5e46e7)[_0x9e73('0xa')](function(_0x14de8a){logger[_0x9e73('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'));logger['debug']('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0xb37872,_0x9e73('0xc'),JSON['stringify'](_0x14de8a));if(_0x14de8a[_0x9e73('0xd')]){if(_0x14de8a[_0x9e73('0xd')][_0x9e73('0xe')]===0x1f4){logger['error'](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);return _0x1ee042(_0x14de8a[_0x9e73('0xd')]['message']);}logger[_0x9e73('0xd')](_0x9e73('0xf'),_0xb37872,_0x14de8a[_0x9e73('0xd')]['message']);return _0xa49f86(_0x14de8a[_0x9e73('0xd')][_0x9e73('0x10')]);}else{logger['info'](_0x9e73('0xf'),_0xb37872,_0x9e73('0xc'));_0xa49f86(_0x14de8a[_0x9e73('0x11')]['message']);}})[_0x9e73('0x12')](function(_0x51968a){logger[_0x9e73('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0xb37872,_0x51968a);_0x1ee042(_0x51968a);});});}exports[_0x9e73('0x13')]=function(_0x48b1db){var _0x4dabb2=this;return new Promise(function(_0x419c5b,_0x3944fc){return db[_0x9e73('0x14')][_0x9e73('0x15')](_0x48b1db[_0x9e73('0x16')],{'raw':_0x48b1db[_0x9e73('0x17')]?_0x48b1db[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![]})[_0x9e73('0xa')](function(_0x3f56bf){logger['info'](_0x9e73('0x13'),_0x48b1db);logger['debug'](_0x9e73('0x13'),_0x48b1db,JSON['stringify'](_0x3f56bf));_0x419c5b(_0x3f56bf);})[_0x9e73('0x12')](function(_0x589a5d){logger[_0x9e73('0xd')](_0x9e73('0x13'),_0x589a5d['message'],_0x48b1db);_0x3944fc(_0x4dabb2['error'](0x1f4,_0x589a5d[_0x9e73('0x10')]));});});};exports[_0x9e73('0x19')]=function(_0x256ea1){var _0x257dca=this;return new Promise(function(_0x1214b5,_0x5117af){return db[_0x9e73('0x14')][_0x9e73('0x1a')]({'raw':_0x256ea1['options']?_0x256ea1['options'][_0x9e73('0x18')]===undefined?!![]:![]:!![],'where':_0x256ea1['options']?_0x256ea1['options'][_0x9e73('0x1b')]||null:null,'attributes':[[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize'][_0x9e73('0x1e')]('id')),_0x9e73('0x1f')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x21')))),'predictiveIntervalAnsweredCalls'],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x22')))),_0x9e73('0x23')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x9e73('0x24')))),_0x9e73('0x25')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x26'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal'](_0x9e73('0x27')))),_0x9e73('0x28')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x26'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x29')))),_0x9e73('0x2a')]]})[_0x9e73('0xa')](function(_0x4cf402){logger[_0x9e73('0xb')](_0x9e73('0x19'),_0x256ea1);logger[_0x9e73('0x2b')](_0x9e73('0x19'),_0x256ea1,JSON['stringify'](_0x4cf402));_0x1214b5(_0x4cf402);})[_0x9e73('0x12')](function(_0x3186b0){logger['error']('AvgHandleTime',_0x3186b0[_0x9e73('0x10')],_0x256ea1);_0x5117af(_0x257dca[_0x9e73('0xd')](0x1f4,_0x3186b0[_0x9e73('0x10')]));});});};exports[_0x9e73('0x2c')]=function(_0x14fb70){var _0x430846=this;return new Promise(function(_0x5e6ffe,_0x574a8b){return db['CmHopperHistory'][_0x9e73('0x1a')]({'raw':_0x14fb70[_0x9e73('0x17')]?_0x14fb70[_0x9e73('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x14fb70['options']?_0x14fb70['options'][_0x9e73('0x1b')]||null:null,'attributes':[[_0x9e73('0x2d'),_0x9e73('0x2e')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x2f')))),_0x9e73('0x30')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal'](_0x9e73('0x21')))),_0x9e73('0x31')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x9e73('0x32')))),_0x9e73('0x33')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x34')))),_0x9e73('0x35')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9e73('0x37')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x38')))),_0x9e73('0x39')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x3a')))),_0x9e73('0x3b')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x9e73('0x3c')))),_0x9e73('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x3e')))),_0x9e73('0x3f')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x40')))),_0x9e73('0x41')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db['sequelize']['fn']('IF',db[_0x9e73('0x1c')][_0x9e73('0x20')](_0x9e73('0x42')))),_0x9e73('0x3f')],[db[_0x9e73('0x1c')]['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db[_0x9e73('0x1c')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x9e73('0x2d')]})['then'](function(_0x22f69a){logger['info'](_0x9e73('0x2c'),_0x14fb70);logger['debug'](_0x9e73('0x2c'),_0x14fb70,JSON[_0x9e73('0x43')](_0x22f69a));_0x5e6ffe(_0x22f69a);})[_0x9e73('0x12')](function(_0x43c524){logger[_0x9e73('0xd')](_0x9e73('0x2c'),_0x43c524[_0x9e73('0x10')],_0x14fb70);_0x574a8b(_0x430846['error'](0x1f4,_0x43c524[_0x9e73('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0xe3ee0d){var _0x39aa72=this;return new Promise(function(_0x29b3e1,_0x5d4c99){return db[_0x9e73('0x14')][_0x9e73('0x1a')]({'raw':_0xe3ee0d['options']?_0xe3ee0d[_0x9e73('0x17')][_0x9e73('0x18')]===undefined?!![]:![]:!![],'where':_0xe3ee0d[_0x9e73('0x17')]?_0xe3ee0d[_0x9e73('0x17')][_0x9e73('0x1b')]||null:null,'attributes':[['campaign',_0x9e73('0x2e')],[db[_0x9e73('0x1c')]['fn']('COUNT',db[_0x9e73('0x1c')][_0x9e73('0x1e')]('id')),_0x9e73('0x44')],[db['sequelize']['fn'](_0x9e73('0x1d'),db[_0x9e73('0x1c')]['fn']('IF',db['sequelize'][_0x9e73('0x20')](_0x9e73('0x21')))),_0x9e73('0x45')]],'group':[_0x9e73('0x2d')]})[_0x9e73('0xa')](function(_0x34465a){logger[_0x9e73('0xb')](_0x9e73('0x46'),_0xe3ee0d);logger[_0x9e73('0x2b')](_0x9e73('0x46'),_0xe3ee0d,JSON[_0x9e73('0x43')](_0x34465a));_0x29b3e1(_0x34465a);})[_0x9e73('0x12')](function(_0x4dacf2){logger[_0x9e73('0xd')](_0x9e73('0x46'),_0x4dacf2[_0x9e73('0x10')],_0xe3ee0d);_0x5d4c99(_0x39aa72['error'](0x1f4,_0x4dacf2['message']));});});};
\ No newline at end of file
+var _0xd909=['`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','findAll','ivrAnswerCallsDay','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','debug','stringify','where','sequelize','COUNT','col','literal','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null'];(function(_0x539c5c,_0x421f98){var _0x26fcdb=function(_0x146878){while(--_0x146878){_0x539c5c['push'](_0x539c5c['shift']());}};_0x26fcdb(++_0x421f98);}(_0xd909,0x1c1));var _0x9d90=function(_0xaf8043,_0x416e4b){_0xaf8043=_0xaf8043-0x0;var _0x340a1f=_0xd909[_0xaf8043];return _0x340a1f;};'use strict';var _=require('lodash');var util=require(_0x9d90('0x0'));var moment=require(_0x9d90('0x1'));var BPromise=require(_0x9d90('0x2'));var rs=require(_0x9d90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d90('0x4'))['db'];var utils=require(_0x9d90('0x5'));var logger=require(_0x9d90('0x6'))(_0x9d90('0x7'));var config=require(_0x9d90('0x8'));var jayson=require(_0x9d90('0x9'));var client=jayson[_0x9d90('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10930a,_0x1036d5,_0x36ff88){return new BPromise(function(_0x19d78a,_0x3a815b){return client[_0x9d90('0xb')](_0x10930a,_0x36ff88)[_0x9d90('0xc')](function(_0x115e66){logger[_0x9d90('0xd')](_0x9d90('0xe'),_0x1036d5,_0x9d90('0xf'));logger['debug'](_0x9d90('0x10'),_0x1036d5,_0x9d90('0xf'),JSON['stringify'](_0x115e66));if(_0x115e66[_0x9d90('0x11')]){if(_0x115e66['error']['code']===0x1f4){logger[_0x9d90('0x11')](_0x9d90('0xe'),_0x1036d5,_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);return _0x3a815b(_0x115e66[_0x9d90('0x11')]['message']);}logger['error'](_0x9d90('0xe'),_0x1036d5,_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);return _0x19d78a(_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);}else{logger['info'](_0x9d90('0xe'),_0x1036d5,_0x9d90('0xf'));_0x19d78a(_0x115e66[_0x9d90('0x13')][_0x9d90('0x12')]);}})[_0x9d90('0x14')](function(_0x4007d0){logger[_0x9d90('0x11')](_0x9d90('0xe'),_0x1036d5,_0x4007d0);_0x3a815b(_0x4007d0);});});}exports[_0x9d90('0x15')]=function(_0x6d042f){var _0x1070bf=this;return new Promise(function(_0x64a9d,_0x156430){return db[_0x9d90('0x16')][_0x9d90('0x17')](_0x6d042f[_0x9d90('0x18')],{'raw':_0x6d042f[_0x9d90('0x19')]?_0x6d042f[_0x9d90('0x19')][_0x9d90('0x1a')]===undefined?!![]:![]:!![]})[_0x9d90('0xc')](function(_0x5e5916){logger[_0x9d90('0xd')](_0x9d90('0x15'),_0x6d042f);logger[_0x9d90('0x1b')](_0x9d90('0x15'),_0x6d042f,JSON[_0x9d90('0x1c')](_0x5e5916));_0x64a9d(_0x5e5916);})[_0x9d90('0x14')](function(_0x3c9f49){logger[_0x9d90('0x11')](_0x9d90('0x15'),_0x3c9f49['message'],_0x6d042f);_0x156430(_0x1070bf[_0x9d90('0x11')](0x1f4,_0x3c9f49['message']));});});};exports['AvgHandleTime']=function(_0xea86c){var _0x4bde99=this;return new Promise(function(_0x947c0,_0x245327){return db[_0x9d90('0x16')]['findAll']({'raw':_0xea86c['options']?_0xea86c[_0x9d90('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xea86c[_0x9d90('0x19')]?_0xea86c['options'][_0x9d90('0x1d')]||null:null,'attributes':[[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')][_0x9d90('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0x9d90('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x9d90('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x9d90('0x22')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x9d90('0x23')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x24')))),_0x9d90('0x25')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x26'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize'][_0x9d90('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x9d90('0x27')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x26'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x28')))),_0x9d90('0x29')]]})[_0x9d90('0xc')](function(_0x2f4e5c){logger[_0x9d90('0xd')](_0x9d90('0x2a'),_0xea86c);logger[_0x9d90('0x1b')](_0x9d90('0x2a'),_0xea86c,JSON[_0x9d90('0x1c')](_0x2f4e5c));_0x947c0(_0x2f4e5c);})[_0x9d90('0x14')](function(_0x15a2c8){logger[_0x9d90('0x11')]('AvgHandleTime',_0x15a2c8['message'],_0xea86c);_0x245327(_0x4bde99[_0x9d90('0x11')](0x1f4,_0x15a2c8['message']));});});};exports[_0x9d90('0x2b')]=function(_0x101e4c){var _0x4f8f02=this;return new Promise(function(_0x11ea7c,_0x399bc9){return db[_0x9d90('0x16')]['findAll']({'raw':_0x101e4c[_0x9d90('0x19')]?_0x101e4c[_0x9d90('0x19')][_0x9d90('0x1a')]===undefined?!![]:![]:!![],'where':_0x101e4c[_0x9d90('0x19')]?_0x101e4c['options'][_0x9d90('0x1d')]||null:null,'attributes':[[_0x9d90('0x2c'),_0x9d90('0x2d')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x9d90('0x2e')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0x9d90('0x1e')]['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x30')))),_0x9d90('0x31')],[db[_0x9d90('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9d90('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x9d90('0x32')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x33')))),_0x9d90('0x34')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x9d90('0x35')))),_0x9d90('0x36')],[db[_0x9d90('0x1e')]['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x37')))),_0x9d90('0x38')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db['sequelize']['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x39')))),_0x9d90('0x3a')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x3b')))),_0x9d90('0x3c')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x3d')))),'outboundOriginateFailureCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db['sequelize'][_0x9d90('0x21')](_0x9d90('0x3e')))),'outboundRejectCallsDay'],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db['sequelize']['fn']('IF',db[_0x9d90('0x1e')]['literal'](_0x9d90('0x3f')))),_0x9d90('0x40')],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x9d90('0x41')],[db['sequelize']['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')]['fn']('IF',db['sequelize'][_0x9d90('0x21')](_0x9d90('0x42')))),_0x9d90('0x43')]],'group':[_0x9d90('0x2c')]})['then'](function(_0x38589d){logger[_0x9d90('0xd')](_0x9d90('0x2b'),_0x101e4c);logger['debug'](_0x9d90('0x2b'),_0x101e4c,JSON[_0x9d90('0x1c')](_0x38589d));_0x11ea7c(_0x38589d);})[_0x9d90('0x14')](function(_0x3dd6b1){logger[_0x9d90('0x11')](_0x9d90('0x2b'),_0x3dd6b1[_0x9d90('0x12')],_0x101e4c);_0x399bc9(_0x4f8f02[_0x9d90('0x11')](0x1f4,_0x3dd6b1[_0x9d90('0x12')]));});});};exports[_0x9d90('0x44')]=function(_0x24d759){var _0x3f060d=this;return new Promise(function(_0x2e5e07,_0x5a1779){return db[_0x9d90('0x16')][_0x9d90('0x45')]({'raw':_0x24d759[_0x9d90('0x19')]?_0x24d759[_0x9d90('0x19')][_0x9d90('0x1a')]===undefined?!![]:![]:!![],'where':_0x24d759[_0x9d90('0x19')]?_0x24d759[_0x9d90('0x19')]['where']||null:null,'attributes':[[_0x9d90('0x2c'),'name'],[db[_0x9d90('0x1e')]['fn'](_0x9d90('0x1f'),db[_0x9d90('0x1e')][_0x9d90('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x9d90('0x1e')]['fn']('COUNT',db[_0x9d90('0x1e')]['fn']('IF',db[_0x9d90('0x1e')][_0x9d90('0x21')](_0x9d90('0x30')))),_0x9d90('0x46')]],'group':[_0x9d90('0x2c')]})[_0x9d90('0xc')](function(_0x20171c){logger['info'](_0x9d90('0x44'),_0x24d759);logger['debug'](_0x9d90('0x44'),_0x24d759,JSON[_0x9d90('0x1c')](_0x20171c));_0x2e5e07(_0x20171c);})[_0x9d90('0x14')](function(_0x25c224){logger[_0x9d90('0x11')]('GetCampaignHopperHistory',_0x25c224[_0x9d90('0x12')],_0x24d759);_0x5a1779(_0x3f060d[_0x9d90('0x11')](0x1f4,_0x25c224[_0x9d90('0x12')]));});});};
\ No newline at end of file
index 3200e26..7f296c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x427d=['get','/describe','describe','/:id','show','create','exports','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x427d,0x1b9));var _0xd427=function(_0xa27e48,_0x620d9d){_0xa27e48=_0xa27e48-0x0;var _0x4a82fd=_0x427d[_0xa27e48];return _0x4a82fd;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd427('0x0'));var router=express[_0xd427('0x1')]();var fs_extra=require(_0xd427('0x2'));var auth=require(_0xd427('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd427('0x4'));var controller=require(_0xd427('0x5'));router['get']('/',auth[_0xd427('0x6')](),controller['index']);router[_0xd427('0x7')](_0xd427('0x8'),auth[_0xd427('0x6')](),controller[_0xd427('0x9')]);router[_0xd427('0x7')](_0xd427('0xa'),auth[_0xd427('0x6')](),controller[_0xd427('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd427('0xc')]);router['put'](_0xd427('0xa'),auth[_0xd427('0x6')](),controller['update']);module[_0xd427('0xd')]=router;
\ No newline at end of file
+var _0xa40d=['../../components/auth/service','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','path','connect-timeout','express','Router'];(function(_0x5b5781,_0x1f8aae){var _0x21f9be=function(_0x3fed7d){while(--_0x3fed7d){_0x5b5781['push'](_0x5b5781['shift']());}};_0x21f9be(++_0x1f8aae);}(_0xa40d,0x79));var _0xda40=function(_0x23a766,_0x2eab2c){_0x23a766=_0x23a766-0x0;var _0x439cd4=_0xa40d[_0x23a766];return _0x439cd4;};'use strict';var multer=require('multer');var util=require(_0xda40('0x0'));var path=require(_0xda40('0x1'));var timeout=require(_0xda40('0x2'));var express=require(_0xda40('0x3'));var router=express[_0xda40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda40('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xda40('0x6'));router[_0xda40('0x7')]('/',auth[_0xda40('0x8')](),controller[_0xda40('0x9')]);router[_0xda40('0x7')](_0xda40('0xa'),auth[_0xda40('0x8')](),controller['describe']);router[_0xda40('0x7')](_0xda40('0xb'),auth['isAuthenticated'](),controller[_0xda40('0xc')]);router[_0xda40('0xd')]('/',auth[_0xda40('0x8')](),controller[_0xda40('0xe')]);router[_0xda40('0xf')](_0xda40('0xb'),auth[_0xda40('0x8')](),controller[_0xda40('0x10')]);module[_0xda40('0x11')]=router;
\ No newline at end of file
index d661fda..b3e3399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['name','sequelize','STRING'];(function(_0x1d61b5,_0x5371d6){var _0x3147f5=function(_0xde866a){while(--_0xde866a){_0x1d61b5['push'](_0x1d61b5['shift']());}};_0x3147f5(++_0x5371d6);}(_0x6aa7,0x178));var _0x76aa=function(_0x4b4904,_0x243c5c){_0x4b4904=_0x4b4904-0x0;var _0x532f9c=_0x6aa7[_0x4b4904];return _0x532f9c;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'name':{'type':Sequelize[_0x76aa('0x1')],'unique':_0x76aa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x76aa('0x1')]},'dialPrefix':{'type':Sequelize[_0x76aa('0x1')]}};
\ No newline at end of file
+var _0xab3f=['sequelize','STRING','name'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xab3f,0x72));var _0xfab3=function(_0x5991d7,_0x3ca7f8){_0x5991d7=_0x5991d7-0x0;var _0x5b299d=_0xab3f[_0x5991d7];return _0x5b299d;};'use strict';var Sequelize=require(_0xfab3('0x0'));module['exports']={'name':{'type':Sequelize[_0xfab3('0x1')],'unique':_0xfab3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfab3('0x1')]},'dialPrefix':{'type':Sequelize[_0xfab3('0x1')]}};
\ No newline at end of file
index 19aa7ca..f8c008d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7424=['fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','create','body','user','get','role','Lists','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','CmContact','isArray','tags','join','push','each','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','cf_%d','getContactsCsv','ContactItemType','OrderBy','alias','from','distinct','field','c.cf_','customField_','select','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','format','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','switch','BOOLEAN','queryInterface','cm_contacts','cf_%s','getCustomFields','getGlobalCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','message','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','CmList','rawAttributes'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x7424,0x72));var _0x4742=function(_0x32d667,_0x409c3d){_0x32d667=_0x32d667-0x0;var _0x4776d2=_0x7424[_0x32d667];return _0x4776d2;};'use strict';var emlformat=require(_0x4742('0x0'));var rimraf=require(_0x4742('0x1'));var zipdir=require(_0x4742('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4742('0x3'));var moment=require(_0x4742('0x4'));var BPromise=require(_0x4742('0x5'));var Mustache=require(_0x4742('0x6'));var util=require('util');var path=require(_0x4742('0x7'));var sox=require('sox');var csv=require(_0x4742('0x8'));var ejs=require(_0x4742('0x9'));var fs=require('fs');var fs_extra=require(_0x4742('0xa'));var _=require(_0x4742('0xb'));var squel=require(_0x4742('0xc'));var crypto=require(_0x4742('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4742('0xe'));var toCsv=require(_0x4742('0x8'));var querystring=require(_0x4742('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4742('0x10'));var qs=require(_0x4742('0x11'));var as=require(_0x4742('0x12'));var hardwareService=require(_0x4742('0x13'));var logger=require(_0x4742('0x14'))(_0x4742('0x15'));var utils=require(_0x4742('0x16'));var config=require(_0x4742('0x17'));var licenseUtil=require(_0x4742('0x18'));var db=require(_0x4742('0x19'))['db'];var csv_results;config[_0x4742('0x1a')]=_['defaults'](config[_0x4742('0x1a')],{'host':_0x4742('0x1b'),'port':0x18eb});var socket=require(_0x4742('0x1c'))(new Redis(config[_0x4742('0x1a')]));require(_0x4742('0x1d'))[_0x4742('0x1e')](socket);function respondWithStatusCode(_0x5e744b,_0x47653b){_0x47653b=_0x47653b||0xcc;return function(_0x5000a6){if(_0x5000a6){return _0x5e744b['sendStatus'](_0x47653b);}return _0x5e744b[_0x4742('0x1f')](_0x47653b)[_0x4742('0x20')]();};}function respondWithResult(_0x3e939b,_0x4cd238){_0x4cd238=_0x4cd238||0xc8;return function(_0xbeaee5){if(_0xbeaee5){return _0x3e939b['status'](_0x4cd238)[_0x4742('0x21')](_0xbeaee5);}};}function respondWithFilteredResult(_0x51a915,_0x4ef2e8){return function(_0x4f44c8){if(_0x4f44c8){var _0x432f6b=typeof _0x4ef2e8[_0x4742('0x22')]===_0x4742('0x23')&&typeof _0x4ef2e8[_0x4742('0x24')]===_0x4742('0x23');var _0x58145d=_0x4f44c8[_0x4742('0x25')];var _0x2bd436=_0x432f6b?0x0:_0x4ef2e8[_0x4742('0x22')];var _0x3bc9ae=_0x432f6b?_0x4f44c8[_0x4742('0x25')]:_0x4ef2e8[_0x4742('0x22')]+_0x4ef2e8[_0x4742('0x24')];var _0x5c5717;if(_0x3bc9ae>=_0x58145d){_0x3bc9ae=_0x58145d;_0x5c5717=0xc8;}else{_0x5c5717=0xce;}_0x51a915[_0x4742('0x1f')](_0x5c5717);return _0x51a915[_0x4742('0x26')](_0x4742('0x27'),_0x2bd436+'-'+_0x3bc9ae+'/'+_0x58145d)[_0x4742('0x21')](_0x4f44c8);}return null;};}function patchUpdates(_0x5e6a55){return function(_0x40c29a){try{jsonpatch[_0x4742('0x28')](_0x40c29a,_0x5e6a55,!![]);}catch(_0x583cc2){return BPromise[_0x4742('0x29')](_0x583cc2);}return _0x40c29a[_0x4742('0x2a')]();};}function saveUpdates(_0x1c5290,_0x393e0b){return function(_0x37ad03){if(_0x37ad03){return _0x37ad03[_0x4742('0x2b')](_0x1c5290)['then'](function(_0x56b85d){return _0x56b85d;});}return null;};}function removeEntity(_0x3d5f7c,_0x2c0373){return function(_0x5e8811){if(_0x5e8811){return _0x5e8811['destroy']()[_0x4742('0x2c')](function(){var _0xb8aaae=_0x5e8811['get']({'plain':!![]});var _0x3742bd='Lists';return db['UserProfileResource'][_0x4742('0x2d')]({'where':{'type':_0x3742bd,'resourceId':_0xb8aaae['id']}})[_0x4742('0x2c')](function(){return _0x5e8811;});})[_0x4742('0x2c')](function(){_0x3d5f7c[_0x4742('0x1f')](0xcc)[_0x4742('0x20')]();});}};}function handleEntityNotFound(_0x1d841b,_0x183929){return function(_0x19f977){if(!_0x19f977){_0x1d841b['sendStatus'](0x194);}return _0x19f977;};}function handleError(_0x3dbba7,_0x30a9c0){_0x30a9c0=_0x30a9c0||0x1f4;return function(_0x534a61){logger[_0x4742('0x2e')](_0x534a61[_0x4742('0x2f')]);if(_0x534a61['name']){delete _0x534a61[_0x4742('0x30')];}_0x3dbba7['status'](_0x30a9c0)['send'](_0x534a61);};}exports['index']=function(_0x4c6715,_0x2a7a7b){var _0x560376={},_0x2150ec={},_0x515d12={'count':0x0,'rows':[]};var _0x403f80=_['map'](db[_0x4742('0x31')][_0x4742('0x32')],function(_0x2d91d4){return{'name':_0x2d91d4[_0x4742('0x33')],'type':_0x2d91d4[_0x4742('0x34')][_0x4742('0x35')]};});_0x2150ec[_0x4742('0x36')]=_[_0x4742('0x37')](_0x403f80,_0x4742('0x30'));_0x2150ec[_0x4742('0x38')]=_['keys'](_0x4c6715['query']);_0x2150ec[_0x4742('0x39')]=_['intersection'](_0x2150ec[_0x4742('0x36')],_0x2150ec[_0x4742('0x38')]);_0x560376[_0x4742('0x3a')]=_[_0x4742('0x3b')](_0x2150ec[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x4c6715[_0x4742('0x38')][_0x4742('0x3c')]));_0x560376[_0x4742('0x3a')]=_0x560376[_0x4742('0x3a')][_0x4742('0x3d')]?_0x560376['attributes']:_0x2150ec[_0x4742('0x36')];if(!_0x4c6715['query'][_0x4742('0x3e')]('nolimit')){_0x560376['limit']=qs[_0x4742('0x24')](_0x4c6715[_0x4742('0x38')][_0x4742('0x24')]);_0x560376[_0x4742('0x22')]=qs[_0x4742('0x22')](_0x4c6715[_0x4742('0x38')][_0x4742('0x22')]);}_0x560376[_0x4742('0x3f')]=qs[_0x4742('0x40')](_0x4c6715[_0x4742('0x38')][_0x4742('0x40')]);_0x560376[_0x4742('0x41')]=qs[_0x4742('0x39')](_[_0x4742('0x42')](_0x4c6715['query'],_0x2150ec[_0x4742('0x39')]),_0x403f80);if(_0x4c6715['query']['filter']){_0x560376[_0x4742('0x41')]=_[_0x4742('0x43')](_0x560376[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x403f80,function(_0x344843){if(_0x344843[_0x4742('0x34')]!==_0x4742('0x44')){var _0x5ebb89={};_0x5ebb89[_0x344843[_0x4742('0x30')]]={'$like':'%'+_0x4c6715[_0x4742('0x38')][_0x4742('0x45')]+'%'};return _0x5ebb89;}})});}_0x560376=_[_0x4742('0x43')]({},_0x560376,_0x4c6715[_0x4742('0x46')]);var _0x213e0f={'where':_0x560376[_0x4742('0x41')]};return db['CmList'][_0x4742('0x25')](_0x213e0f)[_0x4742('0x2c')](function(_0x421153){_0x515d12[_0x4742('0x25')]=_0x421153;if(_0x4c6715[_0x4742('0x38')][_0x4742('0x47')]){_0x560376[_0x4742('0x48')]=[{'all':!![]}];}return db[_0x4742('0x31')][_0x4742('0x49')](_0x560376);})[_0x4742('0x2c')](function(_0x61f779){_0x515d12[_0x4742('0x4a')]=_0x61f779;return _0x515d12;})[_0x4742('0x2c')](respondWithFilteredResult(_0x2a7a7b,_0x560376))[_0x4742('0x4b')](handleError(_0x2a7a7b,null));};exports['show']=function(_0x2e02d5,_0x165b35){var _0x344c67={'raw':![],'where':{'id':_0x2e02d5[_0x4742('0x4c')]['id']}},_0x2a06ef={};_0x2a06ef[_0x4742('0x36')]=_['keys'](db[_0x4742('0x31')][_0x4742('0x32')]);_0x2a06ef[_0x4742('0x38')]=_[_0x4742('0x4d')](_0x2e02d5[_0x4742('0x38')]);_0x2a06ef[_0x4742('0x39')]=_[_0x4742('0x3b')](_0x2a06ef[_0x4742('0x36')],_0x2a06ef[_0x4742('0x38')]);_0x344c67[_0x4742('0x3a')]=_[_0x4742('0x3b')](_0x2a06ef[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x2e02d5[_0x4742('0x38')][_0x4742('0x3c')]));_0x344c67[_0x4742('0x3a')]=_0x344c67['attributes'][_0x4742('0x3d')]?_0x344c67[_0x4742('0x3a')]:_0x2a06ef[_0x4742('0x36')];if(_0x2e02d5['query']['includeAll']){_0x344c67[_0x4742('0x48')]=[{'all':!![]}];}_0x344c67=_[_0x4742('0x43')]({},_0x344c67,_0x2e02d5['options']);return db['CmList']['find'](_0x344c67)['then'](handleEntityNotFound(_0x165b35,null))['then'](respondWithResult(_0x165b35,null))[_0x4742('0x4b')](handleError(_0x165b35,null));};exports['create']=function(_0x30a66c,_0x1adfa8){return db[_0x4742('0x31')][_0x4742('0x4e')](_0x30a66c[_0x4742('0x4f')],{})[_0x4742('0x2c')](function(_0x49a83d){var _0x293683=_0x30a66c[_0x4742('0x50')][_0x4742('0x51')]({'plain':!![]});if(!_0x293683)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293683[_0x4742('0x52')]===_0x4742('0x50')){var _0x492597=_0x49a83d[_0x4742('0x51')]({'plain':!![]});var _0x4ee10f=_0x4742('0x53');return db[_0x4742('0x54')][_0x4742('0x55')]({'where':{'name':_0x4ee10f,'userProfileId':_0x293683[_0x4742('0x56')]},'raw':!![]})['then'](function(_0x910960){if(_0x910960&&_0x910960[_0x4742('0x57')]===0x0){return db[_0x4742('0x58')][_0x4742('0x4e')]({'name':_0x492597[_0x4742('0x30')],'resourceId':_0x492597['id'],'type':_0x910960[_0x4742('0x30')],'sectionId':_0x910960['id']},{})[_0x4742('0x2c')](function(){return _0x49a83d;});}else{return _0x49a83d;}})['catch'](function(_0x1b2cfa){logger['error'](_0x4742('0x59'),_0x1b2cfa);throw _0x1b2cfa;});}return _0x49a83d;})['then'](respondWithResult(_0x1adfa8,0xc9))['catch'](handleError(_0x1adfa8,null));};exports[_0x4742('0x2b')]=function(_0x334599,_0x33f1f4){if(_0x334599[_0x4742('0x4f')]['id']){delete _0x334599[_0x4742('0x4f')]['id'];}return db[_0x4742('0x31')]['find']({'where':{'id':_0x334599[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x33f1f4,null))[_0x4742('0x2c')](saveUpdates(_0x334599[_0x4742('0x4f')],null))['then'](respondWithResult(_0x33f1f4,null))['catch'](handleError(_0x33f1f4,null));};exports[_0x4742('0x2d')]=function(_0x333275,_0x23c9aa){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x333275[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x23c9aa,null))[_0x4742('0x2c')](removeEntity(_0x23c9aa,null))[_0x4742('0x4b')](handleError(_0x23c9aa,null));};exports[_0x4742('0x5a')]=function(_0x2e0528,_0x3b0444){return db[_0x4742('0x31')]['describe']()[_0x4742('0x2c')](respondWithResult(_0x3b0444,null))[_0x4742('0x4b')](handleError(_0x3b0444,null));};exports['addDisposition']=function(_0x10986e,_0xf75056,_0x5aca6f){if(_0x10986e[_0x4742('0x4f')]['id']){delete _0x10986e['body']['id'];}return db['CmList'][_0x4742('0x55')]({'where':{'id':_0x10986e['params']['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0xf75056,null))[_0x4742('0x2c')](function(_0x26b267){if(_0x26b267){_0x10986e['body'][_0x4742('0x5b')]=_0x26b267['id'];return db[_0x4742('0x5c')][_0x4742('0x4e')](_0x10986e[_0x4742('0x4f')]);}})[_0x4742('0x2c')](respondWithResult(_0xf75056,null))[_0x4742('0x4b')](handleError(_0xf75056,null));};exports[_0x4742('0x5d')]=function(_0x3c3ca9,_0x269b37,_0x86467){var _0x17a3e9={'raw':![],'where':{}};var _0x3f79c0={};var _0x5105e9={'count':0x0,'rows':[]};return db[_0x4742('0x31')][_0x4742('0x5e')]({'where':{'id':_0x3c3ca9[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x269b37,null))[_0x4742('0x2c')](function(_0x52cb38){if(_0x52cb38){_0x3f79c0[_0x4742('0x36')]=_[_0x4742('0x4d')](db['Disposition'][_0x4742('0x32')]);_0x3f79c0[_0x4742('0x38')]=_['keys'](_0x3c3ca9['query']);_0x3f79c0[_0x4742('0x39')]=_[_0x4742('0x3b')](_0x3f79c0[_0x4742('0x36')],_0x3f79c0['query']);_0x17a3e9[_0x4742('0x3a')]=_['intersection'](_0x3f79c0[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x3c3ca9['query'][_0x4742('0x3c')]));_0x17a3e9[_0x4742('0x3a')]=_0x17a3e9['attributes']['length']?_0x17a3e9[_0x4742('0x3a')]:_0x3f79c0['model'];if(!_0x3c3ca9[_0x4742('0x38')][_0x4742('0x3e')](_0x4742('0x5f'))){_0x17a3e9[_0x4742('0x24')]=qs[_0x4742('0x24')](_0x3c3ca9[_0x4742('0x38')]['limit']);_0x17a3e9[_0x4742('0x22')]=qs[_0x4742('0x22')](_0x3c3ca9[_0x4742('0x38')][_0x4742('0x22')]);}_0x17a3e9[_0x4742('0x3f')]=qs[_0x4742('0x40')](_0x3c3ca9[_0x4742('0x38')][_0x4742('0x40')]);_0x17a3e9[_0x4742('0x41')]=qs[_0x4742('0x39')](_[_0x4742('0x42')](_0x3c3ca9['query'],_0x3f79c0[_0x4742('0x39')]));_0x17a3e9[_0x4742('0x41')][_0x4742('0x5b')]=_0x52cb38['id'];if(_0x3c3ca9[_0x4742('0x38')][_0x4742('0x45')]){_0x17a3e9[_0x4742('0x41')]=_[_0x4742('0x43')](_0x17a3e9[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x17a3e9[_0x4742('0x3a')],function(_0x244d29){var _0x200f2f={};_0x200f2f[_0x244d29]={'$like':'%'+_0x3c3ca9[_0x4742('0x38')][_0x4742('0x45')]+'%'};return _0x200f2f;})});}_0x17a3e9=_[_0x4742('0x43')]({},_0x17a3e9,_0x3c3ca9[_0x4742('0x46')]);return db[_0x4742('0x5c')][_0x4742('0x25')]({'where':_0x17a3e9[_0x4742('0x41')]})[_0x4742('0x2c')](function(_0x50317f){_0x5105e9['count']=_0x50317f;if(_0x3c3ca9[_0x4742('0x38')]['includeAll']){_0x17a3e9[_0x4742('0x48')]=[{'all':!![]}];}return db[_0x4742('0x5c')][_0x4742('0x49')](_0x17a3e9);})['then'](function(_0x2b205e){_0x5105e9[_0x4742('0x4a')]=_0x2b205e;return _0x5105e9;});}})[_0x4742('0x2c')](respondWithFilteredResult(_0x269b37,_0x17a3e9))['catch'](handleError(_0x269b37,null));};exports[_0x4742('0x60')]=function(_0x3fa6f2,_0x32ea7b,_0x4fbb6d){return db[_0x4742('0x31')]['find']({'where':{'id':_0x3fa6f2['params']['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x32ea7b,null))[_0x4742('0x2c')](function(_0x565979){if(_0x565979){return _0x565979[_0x4742('0x60')](_0x3fa6f2[_0x4742('0x38')][_0x4742('0x61')]);}})[_0x4742('0x2c')](respondWithStatusCode(_0x32ea7b,null))[_0x4742('0x4b')](handleError(_0x32ea7b,null));};exports['addContacts']=function(_0x4d9ec8,_0x1bf127,_0x3b5f21){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x4d9ec8[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x1bf127,null))[_0x4742('0x2c')](function(_0x43a33c){if(_0x43a33c){var _0x483eee=[];var _0x4a6a19={'success':[],'errors':[]};return db[_0x4742('0x62')][_0x4742('0x5a')]()['then'](function(_0x2a04d0){if(_0x4d9ec8[_0x4742('0x4f')]['tags']&&_[_0x4742('0x63')](_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')])){if(_0x4d9ec8['body'][_0x4742('0x64')]['length']){_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')]=_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')][_0x4742('0x65')](';')+';';}else{_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x64')]=null;}}else{_0x4d9ec8['body'][_0x4742('0x64')]=null;}if(_0x4d9ec8[_0x4742('0x4f')]&&_[_0x4742('0x63')](_0x4d9ec8['body'])){for(var _0x2bff11=0x0;_0x2bff11<_0x4d9ec8[_0x4742('0x4f')][_0x4742('0x3d')];_0x2bff11+=0x1){_0x4d9ec8[_0x4742('0x4f')][_0x2bff11][_0x4742('0x5b')]=_0x4d9ec8[_0x4742('0x4c')]['id'];_0x483eee[_0x4742('0x66')](_0x4d9ec8[_0x4742('0x4f')][_0x2bff11]);}return BPromise[_0x4742('0x67')](_0x483eee,function(_0x3267f3){return db[_0x4742('0x62')]['create'](_['omit'](_0x3267f3,[_0x4742('0x61'),'id'])||{},{'fields':_[_0x4742('0x4d')](_0x2a04d0),'raw':!![]})[_0x4742('0x2c')](function(_0xc923b2){_0x4a6a19[_0x4742('0x68')][_0x4742('0x66')](_0xc923b2[_0x4742('0x69')]);})[_0x4742('0x4b')](function(_0x2e96e7){_0x4a6a19[_0x4742('0x6a')][_0x4742('0x66')]({'data':_0x3267f3,'error':_0x2e96e7['message']});});})[_0x4742('0x2c')](function(_0x21390a){return _0x4a6a19;})[_0x4742('0x4b')](function(_0x2750a4){return _0x2750a4;});}else{_0x1bf127[_0x4742('0x1f')](0x190)['json']({'message':_0x4742('0x6b')});}});}})[_0x4742('0x2c')](respondWithResult(_0x1bf127,null))[_0x4742('0x4b')](handleError(_0x1bf127,null));};exports[_0x4742('0x6c')]=function(_0x5e6373,_0x31ba32,_0xdcd431){var _0x188f06;return db['CmList']['find']({'where':{'id':_0x5e6373[_0x4742('0x4c')]['id']},'include':[{'model':db[_0x4742('0x6d')],'as':'CustomFields'}]})[_0x4742('0x2c')](handleEntityNotFound(_0x31ba32,null))['then'](function(_0x2ac468){if(_0x2ac468){_0x188f06=_0x2ac468;return db[_0x4742('0x62')]['rawAttributes'];}})[_0x4742('0x2c')](function(_0x51629a){if(_0x51629a){var _0x2323d5={};var _0x579f0f={};_0x579f0f['model']=_[_0x4742('0x6e')](_[_0x4742('0x4d')](_0x51629a),_[_0x4742('0x37')](_0x188f06[_0x4742('0x6f')],function(_0x3aab8f){return util['format'](_0x4742('0x70'),_0x3aab8f['id']);}));_0x579f0f[_0x4742('0x38')]=_[_0x4742('0x4d')](_0x5e6373['query']);_0x579f0f['filters']=_[_0x4742('0x3b')](_0x579f0f[_0x4742('0x36')],_0x579f0f[_0x4742('0x38')]);_0x2323d5['attributes']=_['intersection'](_0x579f0f[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x5e6373[_0x4742('0x38')][_0x4742('0x3c')]));_0x2323d5[_0x4742('0x3a')]=_0x2323d5[_0x4742('0x3a')][_0x4742('0x3d')]?_0x2323d5['attributes']:_0x579f0f[_0x4742('0x36')];if(!_0x5e6373[_0x4742('0x38')][_0x4742('0x3e')](_0x4742('0x5f'))){_0x2323d5['limit']=qs[_0x4742('0x24')](_0x5e6373[_0x4742('0x38')]['limit']);_0x2323d5['offset']=qs[_0x4742('0x22')](_0x5e6373[_0x4742('0x38')]['offset']);}_0x2323d5[_0x4742('0x3f')]=qs['sort'](_0x5e6373[_0x4742('0x38')][_0x4742('0x40')]);_0x2323d5[_0x4742('0x41')]=qs[_0x4742('0x39')](_[_0x4742('0x42')](_0x5e6373[_0x4742('0x38')],_0x579f0f[_0x4742('0x39')]));_0x2323d5['raw']=!![];if(_0x5e6373['query'][_0x4742('0x45')]){_0x2323d5[_0x4742('0x41')]=_[_0x4742('0x43')](_0x2323d5[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x2323d5[_0x4742('0x3a')],function(_0x45a351){var _0x3e641e={};_0x3e641e[_0x45a351]={'$like':'%'+_0x5e6373['query']['filter']+'%'};return _0x3e641e;})});}_0x2323d5=_[_0x4742('0x43')]({},_0x2323d5,_0x5e6373[_0x4742('0x46')]);return _0x188f06['getContacts'](_0x2323d5);}})[_0x4742('0x2c')](respondWithResult(_0x31ba32,null))['catch'](handleError(_0x31ba32,null));};exports[_0x4742('0x71')]=function(_0x54e3f5,_0x7669a4,_0x81d480){var _0x4974ca;var _0x2f1657;var _0x5c6aa3;var _0x2f74d1=_0x54e3f5['params']['id'];csv_results=[];return db[_0x4742('0x72')][_0x4742('0x49')]({'attributes':['id',_0x4742('0x30')],'raw':!![],'order':[_0x4742('0x73')]})[_0x4742('0x2c')](function(_0x204e3a){_0x4974ca=_0x204e3a;var _0x155781=_[_0x4742('0x4d')](db[_0x4742('0x62')][_0x4742('0x32')]);return db[_0x4742('0x6d')][_0x4742('0x49')]({'raw':!![],'attributes':['id',_0x4742('0x74')]})['then'](function(_0x3d13d9){_0x2f1657=_0x3d13d9;var _0x2267e0=squel['select']()['fields'](_0x155781)[_0x4742('0x75')]('cm_contacts','c')[_0x4742('0x41')]('c.ListId\x20=\x20?',_0x2f74d1)['where']('c.deletedAt\x20is\x20null')[_0x4742('0x76')]();for(var _0x45dcbf=0x0;_0x45dcbf<_0x2f1657[_0x4742('0x3d')];_0x45dcbf++){_0x2267e0[_0x4742('0x77')](_0x4742('0x78')+_0x2f1657[_0x45dcbf]['id'],_0x4742('0x79')+_0x2f1657[_0x45dcbf][_0x4742('0x74')]);}for(var _0x45dcbf=0x0;_0x45dcbf<_0x4974ca[_0x4742('0x3d')];_0x45dcbf++){_0x2267e0[_0x4742('0x77')](squel[_0x4742('0x7a')]()[_0x4742('0x77')](_0x4742('0x7b'))['from'](_0x4742('0x7c'))[_0x4742('0x41')]('ItemTypeId\x20=\x20?',_0x4974ca[_0x45dcbf]['id'])[_0x4742('0x41')](_0x4742('0x7d')),_0x4742('0x7e')+_0x4974ca[_0x45dcbf][_0x4742('0x30')]);_0x2267e0['field'](squel[_0x4742('0x7a')]()[_0x4742('0x77')](_0x4742('0x7f'))[_0x4742('0x75')](_0x4742('0x7c'))[_0x4742('0x41')]('ItemTypeId\x20=\x20?',_0x4974ca[_0x45dcbf]['id'])['where'](_0x4742('0x7d')),_0x4742('0x80')+_0x4974ca[_0x45dcbf][_0x4742('0x30')]);}var _0x3bba48=[];_0x3bba48[_0x4742('0x66')](_0x2267e0['toString']());BPromise['each'](_0x3bba48,handleQuery)[_0x4742('0x2c')](function(_0x43b541){handleQuery(_0x2267e0[_0x4742('0x81')]());var _0x53de96=csv_results[0x0];if(!_['isEmpty'](_0x53de96)){var _0x19e9ab=toCsv(_0x53de96);var _0x597358=Date['now']();fs[_0x4742('0x82')](util['format'](_0x4742('0x83'),_0x2f74d1,_0x597358),_0x19e9ab);_0x7669a4[_0x4742('0x84')](_0x4742('0x85'),_0x4742('0x86')+util[_0x4742('0x87')](_0x4742('0x88'),_0x2f74d1,_0x597358));_0x7669a4[_0x4742('0x84')](_0x4742('0x89'),_0x4742('0x8a'));return _0x7669a4[_0x4742('0x8b')](util[_0x4742('0x87')](_0x4742('0x83'),_0x2f74d1,_0x597358));}else{return _0x7669a4[_0x4742('0x8c')](0xcc);}});});});};exports[_0x4742('0x8d')]=function(_0x5c7e78,_0x258abe,_0x61e9af){var _0x3fd978;delete _0x5c7e78[_0x4742('0x4f')]['id'];return db[_0x4742('0x31')][_0x4742('0x5e')]({'where':{'id':_0x5c7e78[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x258abe,null))[_0x4742('0x2c')](function(_0x45a1c4){if(_0x45a1c4){return db[_0x4742('0x8e')][_0x4742('0x8f')](function(_0x1a84ce){return db[_0x4742('0x6d')][_0x4742('0x4e')](_0x5c7e78['body'],{'transaction':_0x1a84ce})[_0x4742('0x2c')](function(_0x4e6f7f){_0x3fd978=_0x4e6f7f;return _0x45a1c4[_0x4742('0x90')](_0x4e6f7f,{'transaction':_0x1a84ce});})[_0x4742('0x2c')](function(){var _0x519130={'type':db[_0x4742('0x91')][_0x4742('0x92')],'transaction':_0x1a84ce};switch(_0x5c7e78['body'][_0x4742('0x34')]){case _0x4742('0x93'):_0x519130[_0x4742('0x34')]=db[_0x4742('0x91')][_0x4742('0x92')];break;case'number':_0x519130[_0x4742('0x34')]=db['Sequelize']['INTEGER'];break;case _0x4742('0x94'):_0x519130[_0x4742('0x34')]=db[_0x4742('0x91')][_0x4742('0x95')];_0x519130['defaultValue']=![];break;default:}return db[_0x4742('0x8e')][_0x4742('0x96')]['addColumn'](_0x4742('0x97'),util[_0x4742('0x87')](_0x4742('0x98'),_0x3fd978['id']),_0x519130);})[_0x4742('0x2c')](function(){return _0x3fd978;});});}})[_0x4742('0x2c')](respondWithResult(_0x258abe,null))[_0x4742('0x4b')](handleError(_0x258abe,null));};exports[_0x4742('0x99')]=function(_0x284d55,_0x51c808,_0x2fb7a8){var _0x3690d4={};var _0x1ec0fc={};var _0x2b4c82;var _0x5af5e8;return db[_0x4742('0x31')][_0x4742('0x5e')]({'where':{'id':_0x284d55[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x51c808,null))[_0x4742('0x2c')](function(_0x2364cf){if(_0x2364cf){_0x2b4c82=_0x2364cf;_0x1ec0fc[_0x4742('0x36')]=_[_0x4742('0x4d')](db[_0x4742('0x6d')][_0x4742('0x32')]);_0x1ec0fc[_0x4742('0x38')]=_['keys'](_0x284d55[_0x4742('0x38')]);_0x1ec0fc['filters']=_[_0x4742('0x3b')](_0x1ec0fc[_0x4742('0x36')],_0x1ec0fc[_0x4742('0x38')]);_0x3690d4['attributes']=_[_0x4742('0x3b')](_0x1ec0fc[_0x4742('0x36')],qs['fields'](_0x284d55[_0x4742('0x38')][_0x4742('0x3c')]));_0x3690d4[_0x4742('0x3a')]=_0x3690d4[_0x4742('0x3a')][_0x4742('0x3d')]?_0x3690d4[_0x4742('0x3a')]:_0x1ec0fc['model'];_0x3690d4[_0x4742('0x3f')]=qs['sort'](_0x284d55[_0x4742('0x38')]['sort']);_0x3690d4[_0x4742('0x41')]=qs['filters'](_['pick'](_0x284d55['query'],_0x1ec0fc[_0x4742('0x39')]));_0x3690d4[_0x4742('0x41')]=_['merge'](_0x3690d4[_0x4742('0x41')],{'$or':[{'ListId':_0x2364cf['id']},{'ListId':null}]});if(_0x284d55[_0x4742('0x38')][_0x4742('0x45')]){_0x3690d4[_0x4742('0x41')]=_[_0x4742('0x43')](_0x3690d4[_0x4742('0x41')],{'$or':_[_0x4742('0x37')](_0x3690d4[_0x4742('0x3a')],function(_0x4da9f5){var _0x3f531a={};_0x3f531a[_0x4da9f5]={'$like':'%'+_0x284d55[_0x4742('0x38')]['filter']+'%'};return _0x3f531a;})});}_0x3690d4=_[_0x4742('0x43')]({},_0x3690d4,_0x284d55[_0x4742('0x46')]);return db['CmCustomField']['findAndCountAll'](_0x3690d4);}})[_0x4742('0x2c')](respondWithResult(_0x51c808,null))[_0x4742('0x4b')](handleError(_0x51c808,null));};exports[_0x4742('0x9a')]=function(_0xf8c3ff,_0x5c25d7){return db[_0x4742('0x6d')][_0x4742('0x9b')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x5c25d7,null))['then'](function(_0x13d4a8){return _0x13d4a8;})['then'](respondWithResult(_0x5c25d7,null))[_0x4742('0x4b')](handleError(_0x5c25d7,null));};exports[_0x4742('0x9c')]=function(_0x39aa2c,_0x4722a5,_0x349369){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x39aa2c[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x4722a5,null))[_0x4742('0x2c')](function(_0x4ecf7c){if(_0x4ecf7c){return _0x4ecf7c[_0x4742('0x9c')](_0x39aa2c[_0x4742('0x4f')]['ids'],_[_0x4742('0x9d')](_0x39aa2c[_0x4742('0x4f')],['ids','id'])||{})[_0x4742('0x9e')](function(_0x4f3f3b){for(var _0x60cbd6=0x0;_0x60cbd6<_0x39aa2c[_0x4742('0x4f')]['ids'][_0x4742('0x3d')];_0x60cbd6+=0x1){socket[_0x4742('0x9f')](_0x4742('0xa0'),{'UserId':Number(_0x39aa2c['body'][_0x4742('0x61')][_0x60cbd6]),'CmListId':Number(_0x39aa2c[_0x4742('0x4c')]['id'])});}return _0x4f3f3b;});}})[_0x4742('0x2c')](respondWithResult(_0x4722a5,null))['catch'](handleError(_0x4722a5,null));};exports[_0x4742('0xa1')]=function(_0x3d241c,_0x32fde6,_0x2f8642){return db[_0x4742('0x31')][_0x4742('0x55')]({'where':{'id':_0x3d241c[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0x32fde6,null))['then'](function(_0x1fa76d){if(_0x1fa76d){return _0x1fa76d['removeAgents'](_0x3d241c['query'][_0x4742('0x61')])['then'](function(){if(_[_0x4742('0x63')](_0x3d241c[_0x4742('0x38')][_0x4742('0x61')])){for(var _0x5b9d4f=0x0;_0x5b9d4f<_0x3d241c[_0x4742('0x38')]['ids'][_0x4742('0x3d')];_0x5b9d4f+=0x1){socket[_0x4742('0x9f')](_0x4742('0xa2'),{'UserId':Number(_0x3d241c[_0x4742('0x38')][_0x4742('0x61')][_0x5b9d4f]),'CmListId':Number(_0x3d241c[_0x4742('0x4c')]['id'])});}}else{socket[_0x4742('0x9f')](_0x4742('0xa2'),{'UserId':Number(_0x3d241c[_0x4742('0x38')][_0x4742('0x61')]),'CmListId':Number(_0x3d241c[_0x4742('0x4c')]['id'])});}});}})[_0x4742('0x2c')](respondWithStatusCode(_0x32fde6,null))[_0x4742('0x4b')](handleError(_0x32fde6,null));};exports[_0x4742('0xa3')]=function(_0x97ba75,_0xf9d902,_0x32e70b){var _0x3811b8={};var _0x1b6049={};var _0x31865d;var _0x305528;return db['CmList'][_0x4742('0x5e')]({'where':{'id':_0x97ba75[_0x4742('0x4c')]['id']}})[_0x4742('0x2c')](handleEntityNotFound(_0xf9d902,null))['then'](function(_0x3a6f44){if(_0x3a6f44){_0x31865d=_0x3a6f44;_0x1b6049[_0x4742('0x36')]=_[_0x4742('0x4d')](db['User']['rawAttributes']);_0x1b6049[_0x4742('0x38')]=_[_0x4742('0x4d')](_0x97ba75[_0x4742('0x38')]);_0x1b6049[_0x4742('0x39')]=_[_0x4742('0x3b')](_0x1b6049[_0x4742('0x36')],_0x1b6049['query']);_0x3811b8[_0x4742('0x3a')]=_[_0x4742('0x3b')](_0x1b6049[_0x4742('0x36')],qs[_0x4742('0x3c')](_0x97ba75[_0x4742('0x38')][_0x4742('0x3c')]));_0x3811b8['attributes']=_0x3811b8[_0x4742('0x3a')][_0x4742('0x3d')]?_0x3811b8[_0x4742('0x3a')]:_0x1b6049[_0x4742('0x36')];_0x3811b8[_0x4742('0x3f')]=qs[_0x4742('0x40')](_0x97ba75['query'][_0x4742('0x40')]);_0x3811b8['where']=qs['filters'](_[_0x4742('0x42')](_0x97ba75[_0x4742('0x38')],_0x1b6049[_0x4742('0x39')]));if(_0x97ba75[_0x4742('0x38')][_0x4742('0x45')]){_0x3811b8['where']=_['merge'](_0x3811b8['where'],{'$or':_[_0x4742('0x37')](_0x3811b8[_0x4742('0x3a')],function(_0x216513){var _0x916aef={};_0x916aef[_0x216513]={'$like':'%'+_0x97ba75[_0x4742('0x38')][_0x4742('0x45')]+'%'};return _0x916aef;})});}_0x3811b8=_['merge']({},_0x3811b8,_0x97ba75[_0x4742('0x46')]);return _0x31865d[_0x4742('0xa3')](_0x3811b8);}})['then'](function(_0x492ff0){if(_0x492ff0){_0x305528=_0x492ff0[_0x4742('0x3d')];if(!_0x97ba75[_0x4742('0x38')]['hasOwnProperty'](_0x4742('0x5f'))){_0x3811b8[_0x4742('0x24')]=qs['limit'](_0x97ba75[_0x4742('0x38')][_0x4742('0x24')]);_0x3811b8[_0x4742('0x22')]=qs[_0x4742('0x22')](_0x97ba75[_0x4742('0x38')][_0x4742('0x22')]);}return _0x31865d[_0x4742('0xa3')](_0x3811b8);}})[_0x4742('0x2c')](function(_0x147321){if(_0x147321){return _0x147321?{'count':_0x305528,'rows':_0x147321}:null;}})[_0x4742('0x2c')](respondWithResult(_0xf9d902,null))[_0x4742('0x4b')](handleError(_0xf9d902,null));};function handleQuery(_0x16dc45){logger['info'](_0x16dc45);return db[_0x4742('0x8e')][_0x4742('0x38')](_0x16dc45)[_0x4742('0x9e')](function(_0x2ce741){csv_results[_0x4742('0x66')](_0x2ce741);})['catch'](function(_0x9c1b49){logger[_0x4742('0x2e')](_0x9c1b49[_0x4742('0xa4')]);});}
\ No newline at end of file
+var _0xbc1b=['moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','index','map','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','merge','type','CmList','count','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','describe','ListId','Disposition','findOne','hasOwnProperty','nolimit','includeAll','rows','ids','addContacts','CmContact','tags','isArray','join','each','success','dataValues','push','Malformed\x20request\x20syntax','getContacts','concat','format','cf_%d','raw','ContactItemType','OrderBy','CmCustomField','alias','select','from','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','omit','emit','removeAgents','userCmList:remove','User','getAgents','spread','message','eml-format','rimraf','zip-dir'];(function(_0x3c1953,_0x5670c6){var _0x51f45d=function(_0x3a1d41){while(--_0x3a1d41){_0x3c1953['push'](_0x3c1953['shift']());}};_0x51f45d(++_0x5670c6);}(_0xbc1b,0x13b));var _0xbbc1=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0xbc1b[_0x49d41c];return _0xb64c5f;};'use strict';var emlformat=require(_0xbbc1('0x0'));var rimraf=require(_0xbbc1('0x1'));var zipdir=require(_0xbbc1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbbc1('0x3'));var BPromise=require(_0xbbc1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbbc1('0x5'));var sox=require(_0xbbc1('0x6'));var csv=require(_0xbbc1('0x7'));var ejs=require(_0xbbc1('0x8'));var fs=require('fs');var fs_extra=require(_0xbbc1('0x9'));var _=require(_0xbbc1('0xa'));var squel=require('squel');var crypto=require(_0xbbc1('0xb'));var jsforce=require(_0xbbc1('0xc'));var deskjs=require(_0xbbc1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbbc1('0xe'));var Papa=require('papaparse');var Redis=require(_0xbbc1('0xf'));var authService=require(_0xbbc1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbbc1('0x11'));var hardwareService=require(_0xbbc1('0x12'));var logger=require(_0xbbc1('0x13'))(_0xbbc1('0x14'));var utils=require('../../config/utils');var config=require(_0xbbc1('0x15'));var licenseUtil=require(_0xbbc1('0x16'));var db=require('../../mysqldb')['db'];var csv_results;config[_0xbbc1('0x17')]=_[_0xbbc1('0x18')](config[_0xbbc1('0x17')],{'host':_0xbbc1('0x19'),'port':0x18eb});var socket=require(_0xbbc1('0x1a'))(new Redis(config['redis']));require(_0xbbc1('0x1b'))[_0xbbc1('0x1c')](socket);function respondWithStatusCode(_0x1f294d,_0xb3dc1d){_0xb3dc1d=_0xb3dc1d||0xcc;return function(_0x55fe82){if(_0x55fe82){return _0x1f294d[_0xbbc1('0x1d')](_0xb3dc1d);}return _0x1f294d['status'](_0xb3dc1d)[_0xbbc1('0x1e')]();};}function respondWithResult(_0x5aa68f,_0x46a91a){_0x46a91a=_0x46a91a||0xc8;return function(_0x2f1380){if(_0x2f1380){return _0x5aa68f[_0xbbc1('0x1f')](_0x46a91a)[_0xbbc1('0x20')](_0x2f1380);}};}function respondWithFilteredResult(_0x48db53,_0x5b3520){return function(_0x4e1ed0){if(_0x4e1ed0){var _0x19a665=typeof _0x5b3520[_0xbbc1('0x21')]===_0xbbc1('0x22')&&typeof _0x5b3520[_0xbbc1('0x23')]===_0xbbc1('0x22');var _0x4f3ab3=_0x4e1ed0['count'];var _0x5b7bd0=_0x19a665?0x0:_0x5b3520[_0xbbc1('0x21')];var _0x49072d=_0x19a665?_0x4e1ed0['count']:_0x5b3520[_0xbbc1('0x21')]+_0x5b3520['limit'];var _0x5ce865;if(_0x49072d>=_0x4f3ab3){_0x49072d=_0x4f3ab3;_0x5ce865=0xc8;}else{_0x5ce865=0xce;}_0x48db53[_0xbbc1('0x1f')](_0x5ce865);return _0x48db53[_0xbbc1('0x24')](_0xbbc1('0x25'),_0x5b7bd0+'-'+_0x49072d+'/'+_0x4f3ab3)['json'](_0x4e1ed0);}return null;};}function patchUpdates(_0x5c205c){return function(_0x144181){try{jsonpatch[_0xbbc1('0x26')](_0x144181,_0x5c205c,!![]);}catch(_0x565330){return BPromise['reject'](_0x565330);}return _0x144181['save']();};}function saveUpdates(_0x26ee3a,_0x2a01b2){return function(_0xa6aa97){if(_0xa6aa97){return _0xa6aa97[_0xbbc1('0x27')](_0x26ee3a)[_0xbbc1('0x28')](function(_0x16b71e){return _0x16b71e;});}return null;};}function removeEntity(_0x15f517,_0x152ab8){return function(_0x87541c){if(_0x87541c){return _0x87541c[_0xbbc1('0x29')]()['then'](function(){var _0x3ff561=_0x87541c[_0xbbc1('0x2a')]({'plain':!![]});var _0x39b8a6=_0xbbc1('0x2b');return db[_0xbbc1('0x2c')][_0xbbc1('0x29')]({'where':{'type':_0x39b8a6,'resourceId':_0x3ff561['id']}})[_0xbbc1('0x28')](function(){return _0x87541c;});})['then'](function(){_0x15f517['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x142866,_0x3174f0){return function(_0x12ef82){if(!_0x12ef82){_0x142866['sendStatus'](0x194);}return _0x12ef82;};}function handleError(_0x5c9609,_0x3db7de){_0x3db7de=_0x3db7de||0x1f4;return function(_0x46c7a2){logger[_0xbbc1('0x2d')](_0x46c7a2[_0xbbc1('0x2e')]);if(_0x46c7a2[_0xbbc1('0x2f')]){delete _0x46c7a2[_0xbbc1('0x2f')];}_0x5c9609[_0xbbc1('0x1f')](_0x3db7de)['send'](_0x46c7a2);};}exports[_0xbbc1('0x30')]=function(_0x52350d,_0x41b107){var _0x37d8ee={},_0x336e50={},_0x27589f={'count':0x0,'rows':[]};var _0xaa4f0c=_[_0xbbc1('0x31')](db['CmList'][_0xbbc1('0x32')],function(_0x24e9ac){return{'name':_0x24e9ac['fieldName'],'type':_0x24e9ac['type'][_0xbbc1('0x33')]};});_0x336e50['model']=_[_0xbbc1('0x31')](_0xaa4f0c,_0xbbc1('0x2f'));_0x336e50[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x52350d[_0xbbc1('0x34')]);_0x336e50[_0xbbc1('0x36')]=_[_0xbbc1('0x37')](_0x336e50['model'],_0x336e50[_0xbbc1('0x34')]);_0x37d8ee[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x336e50[_0xbbc1('0x39')],qs['fields'](_0x52350d['query'][_0xbbc1('0x3a')]));_0x37d8ee[_0xbbc1('0x38')]=_0x37d8ee['attributes'][_0xbbc1('0x3b')]?_0x37d8ee[_0xbbc1('0x38')]:_0x336e50['model'];if(!_0x52350d[_0xbbc1('0x34')]['hasOwnProperty']('nolimit')){_0x37d8ee['limit']=qs[_0xbbc1('0x23')](_0x52350d['query'][_0xbbc1('0x23')]);_0x37d8ee[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x52350d[_0xbbc1('0x34')][_0xbbc1('0x21')]);}_0x37d8ee[_0xbbc1('0x3c')]=qs[_0xbbc1('0x3d')](_0x52350d[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x37d8ee[_0xbbc1('0x3e')]=qs[_0xbbc1('0x36')](_[_0xbbc1('0x3f')](_0x52350d[_0xbbc1('0x34')],_0x336e50[_0xbbc1('0x36')]),_0xaa4f0c);if(_0x52350d[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x37d8ee['where']=_[_0xbbc1('0x41')](_0x37d8ee[_0xbbc1('0x3e')],{'$or':_[_0xbbc1('0x31')](_0xaa4f0c,function(_0x1b9a47){if(_0x1b9a47[_0xbbc1('0x42')]!=='VIRTUAL'){var _0x1e01c0={};_0x1e01c0[_0x1b9a47[_0xbbc1('0x2f')]]={'$like':'%'+_0x52350d['query'][_0xbbc1('0x40')]+'%'};return _0x1e01c0;}})});}_0x37d8ee=_[_0xbbc1('0x41')]({},_0x37d8ee,_0x52350d['options']);var _0x596c45={'where':_0x37d8ee[_0xbbc1('0x3e')]};return db[_0xbbc1('0x43')][_0xbbc1('0x44')](_0x596c45)[_0xbbc1('0x28')](function(_0x38f326){_0x27589f[_0xbbc1('0x44')]=_0x38f326;if(_0x52350d[_0xbbc1('0x34')]['includeAll']){_0x37d8ee[_0xbbc1('0x45')]=[{'all':!![]}];}return db[_0xbbc1('0x43')][_0xbbc1('0x46')](_0x37d8ee);})['then'](function(_0x56e6b1){_0x27589f['rows']=_0x56e6b1;return _0x27589f;})[_0xbbc1('0x28')](respondWithFilteredResult(_0x41b107,_0x37d8ee))[_0xbbc1('0x47')](handleError(_0x41b107,null));};exports[_0xbbc1('0x48')]=function(_0x1358a8,_0x3bccb6){var _0x39921a={'raw':![],'where':{'id':_0x1358a8[_0xbbc1('0x49')]['id']}},_0x4dd9b1={};_0x4dd9b1[_0xbbc1('0x39')]=_[_0xbbc1('0x35')](db[_0xbbc1('0x43')][_0xbbc1('0x32')]);_0x4dd9b1[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x1358a8[_0xbbc1('0x34')]);_0x4dd9b1[_0xbbc1('0x36')]=_['intersection'](_0x4dd9b1['model'],_0x4dd9b1[_0xbbc1('0x34')]);_0x39921a[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x4dd9b1['model'],qs[_0xbbc1('0x3a')](_0x1358a8['query'][_0xbbc1('0x3a')]));_0x39921a['attributes']=_0x39921a[_0xbbc1('0x38')][_0xbbc1('0x3b')]?_0x39921a[_0xbbc1('0x38')]:_0x4dd9b1['model'];if(_0x1358a8[_0xbbc1('0x34')]['includeAll']){_0x39921a['include']=[{'all':!![]}];}_0x39921a=_[_0xbbc1('0x41')]({},_0x39921a,_0x1358a8[_0xbbc1('0x4a')]);return db[_0xbbc1('0x43')][_0xbbc1('0x4b')](_0x39921a)[_0xbbc1('0x28')](handleEntityNotFound(_0x3bccb6,null))[_0xbbc1('0x28')](respondWithResult(_0x3bccb6,null))[_0xbbc1('0x47')](handleError(_0x3bccb6,null));};exports['create']=function(_0x36f84f,_0x8a828b){return db[_0xbbc1('0x43')][_0xbbc1('0x4c')](_0x36f84f[_0xbbc1('0x4d')],{})[_0xbbc1('0x28')](function(_0x51a51f){var _0x5d5ff4=_0x36f84f[_0xbbc1('0x4e')][_0xbbc1('0x2a')]({'plain':!![]});if(!_0x5d5ff4)throw new Error(_0xbbc1('0x4f'));if(_0x5d5ff4['role']===_0xbbc1('0x4e')){var _0x32069e=_0x51a51f[_0xbbc1('0x2a')]({'plain':!![]});var _0x354cab='Lists';return db[_0xbbc1('0x50')]['find']({'where':{'name':_0x354cab,'userProfileId':_0x5d5ff4[_0xbbc1('0x51')]},'raw':!![]})['then'](function(_0xaa78e0){if(_0xaa78e0&&_0xaa78e0['autoAssociation']===0x0){return db[_0xbbc1('0x2c')][_0xbbc1('0x4c')]({'name':_0x32069e[_0xbbc1('0x2f')],'resourceId':_0x32069e['id'],'type':_0xaa78e0[_0xbbc1('0x2f')],'sectionId':_0xaa78e0['id']},{})[_0xbbc1('0x28')](function(){return _0x51a51f;});}else{return _0x51a51f;}})[_0xbbc1('0x47')](function(_0x2d13a5){logger[_0xbbc1('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d13a5);throw _0x2d13a5;});}return _0x51a51f;})[_0xbbc1('0x28')](respondWithResult(_0x8a828b,0xc9))[_0xbbc1('0x47')](handleError(_0x8a828b,null));};exports[_0xbbc1('0x27')]=function(_0x3ee747,_0x10e745){if(_0x3ee747[_0xbbc1('0x4d')]['id']){delete _0x3ee747[_0xbbc1('0x4d')]['id'];}return db['CmList'][_0xbbc1('0x4b')]({'where':{'id':_0x3ee747[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x10e745,null))[_0xbbc1('0x28')](saveUpdates(_0x3ee747[_0xbbc1('0x4d')],null))[_0xbbc1('0x28')](respondWithResult(_0x10e745,null))[_0xbbc1('0x47')](handleError(_0x10e745,null));};exports[_0xbbc1('0x29')]=function(_0xc4d7ec,_0x94a2e5){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0xc4d7ec[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x94a2e5,null))[_0xbbc1('0x28')](removeEntity(_0x94a2e5,null))['catch'](handleError(_0x94a2e5,null));};exports[_0xbbc1('0x52')]=function(_0x274309,_0x31eeae){return db[_0xbbc1('0x43')]['describe']()[_0xbbc1('0x28')](respondWithResult(_0x31eeae,null))[_0xbbc1('0x47')](handleError(_0x31eeae,null));};exports['addDisposition']=function(_0x2b6f92,_0x49c05c,_0x500e5b){if(_0x2b6f92[_0xbbc1('0x4d')]['id']){delete _0x2b6f92['body']['id'];}return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x2b6f92[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x49c05c,null))[_0xbbc1('0x28')](function(_0x1195af){if(_0x1195af){_0x2b6f92['body'][_0xbbc1('0x53')]=_0x1195af['id'];return db[_0xbbc1('0x54')]['create'](_0x2b6f92['body']);}})[_0xbbc1('0x28')](respondWithResult(_0x49c05c,null))[_0xbbc1('0x47')](handleError(_0x49c05c,null));};exports['getDispositions']=function(_0x48f3d0,_0x48002f,_0x37ca6a){var _0x3cc936={'raw':![],'where':{}};var _0x23392e={};var _0x521a7c={'count':0x0,'rows':[]};return db[_0xbbc1('0x43')][_0xbbc1('0x55')]({'where':{'id':_0x48f3d0['params']['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x48002f,null))['then'](function(_0x29d830){if(_0x29d830){_0x23392e[_0xbbc1('0x39')]=_['keys'](db[_0xbbc1('0x54')][_0xbbc1('0x32')]);_0x23392e['query']=_[_0xbbc1('0x35')](_0x48f3d0[_0xbbc1('0x34')]);_0x23392e['filters']=_[_0xbbc1('0x37')](_0x23392e['model'],_0x23392e[_0xbbc1('0x34')]);_0x3cc936['attributes']=_[_0xbbc1('0x37')](_0x23392e[_0xbbc1('0x39')],qs[_0xbbc1('0x3a')](_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x3a')]));_0x3cc936['attributes']=_0x3cc936[_0xbbc1('0x38')]['length']?_0x3cc936[_0xbbc1('0x38')]:_0x23392e['model'];if(!_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x56')](_0xbbc1('0x57'))){_0x3cc936[_0xbbc1('0x23')]=qs[_0xbbc1('0x23')](_0x48f3d0[_0xbbc1('0x34')]['limit']);_0x3cc936[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x21')]);}_0x3cc936[_0xbbc1('0x3c')]=qs['sort'](_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x3cc936[_0xbbc1('0x3e')]=qs[_0xbbc1('0x36')](_['pick'](_0x48f3d0['query'],_0x23392e[_0xbbc1('0x36')]));_0x3cc936['where']['ListId']=_0x29d830['id'];if(_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x3cc936[_0xbbc1('0x3e')]=_[_0xbbc1('0x41')](_0x3cc936[_0xbbc1('0x3e')],{'$or':_['map'](_0x3cc936[_0xbbc1('0x38')],function(_0x43e2ab){var _0x39dd2e={};_0x39dd2e[_0x43e2ab]={'$like':'%'+_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0x39dd2e;})});}_0x3cc936=_[_0xbbc1('0x41')]({},_0x3cc936,_0x48f3d0['options']);return db['Disposition'][_0xbbc1('0x44')]({'where':_0x3cc936[_0xbbc1('0x3e')]})[_0xbbc1('0x28')](function(_0x4b45a2){_0x521a7c[_0xbbc1('0x44')]=_0x4b45a2;if(_0x48f3d0[_0xbbc1('0x34')][_0xbbc1('0x58')]){_0x3cc936[_0xbbc1('0x45')]=[{'all':!![]}];}return db[_0xbbc1('0x54')][_0xbbc1('0x46')](_0x3cc936);})['then'](function(_0x51b79f){_0x521a7c[_0xbbc1('0x59')]=_0x51b79f;return _0x521a7c;});}})[_0xbbc1('0x28')](respondWithFilteredResult(_0x48002f,_0x3cc936))['catch'](handleError(_0x48002f,null));};exports['removeDispositions']=function(_0x18fe71,_0x48e957,_0x30656a){return db[_0xbbc1('0x43')]['find']({'where':{'id':_0x18fe71[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x48e957,null))['then'](function(_0x17d552){if(_0x17d552){return _0x17d552['removeDispositions'](_0x18fe71[_0xbbc1('0x34')][_0xbbc1('0x5a')]);}})[_0xbbc1('0x28')](respondWithStatusCode(_0x48e957,null))[_0xbbc1('0x47')](handleError(_0x48e957,null));};exports[_0xbbc1('0x5b')]=function(_0x1dc6f2,_0x2a1582,_0x15d01b){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x1dc6f2['params']['id']}})['then'](handleEntityNotFound(_0x2a1582,null))[_0xbbc1('0x28')](function(_0x95409f){if(_0x95409f){var _0x33fdca=[];var _0x121111={'success':[],'errors':[]};return db[_0xbbc1('0x5c')][_0xbbc1('0x52')]()[_0xbbc1('0x28')](function(_0x2db566){if(_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x5d')]&&_[_0xbbc1('0x5e')](_0x1dc6f2[_0xbbc1('0x4d')]['tags'])){if(_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x5d')][_0xbbc1('0x3b')]){_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x5d')]=_0x1dc6f2['body'][_0xbbc1('0x5d')][_0xbbc1('0x5f')](';')+';';}else{_0x1dc6f2[_0xbbc1('0x4d')]['tags']=null;}}else{_0x1dc6f2[_0xbbc1('0x4d')]['tags']=null;}if(_0x1dc6f2[_0xbbc1('0x4d')]&&_['isArray'](_0x1dc6f2[_0xbbc1('0x4d')])){for(var _0x3d0baa=0x0;_0x3d0baa<_0x1dc6f2[_0xbbc1('0x4d')][_0xbbc1('0x3b')];_0x3d0baa+=0x1){_0x1dc6f2[_0xbbc1('0x4d')][_0x3d0baa]['ListId']=_0x1dc6f2[_0xbbc1('0x49')]['id'];_0x33fdca['push'](_0x1dc6f2[_0xbbc1('0x4d')][_0x3d0baa]);}return BPromise[_0xbbc1('0x60')](_0x33fdca,function(_0x524334){return db[_0xbbc1('0x5c')][_0xbbc1('0x4c')](_['omit'](_0x524334,[_0xbbc1('0x5a'),'id'])||{},{'fields':_[_0xbbc1('0x35')](_0x2db566),'raw':!![]})[_0xbbc1('0x28')](function(_0x371fb7){_0x121111[_0xbbc1('0x61')]['push'](_0x371fb7[_0xbbc1('0x62')]);})['catch'](function(_0x2f39c6){_0x121111['errors'][_0xbbc1('0x63')]({'data':_0x524334,'error':_0x2f39c6['message']});});})[_0xbbc1('0x28')](function(_0x397e61){return _0x121111;})[_0xbbc1('0x47')](function(_0x3f1d91){return _0x3f1d91;});}else{_0x2a1582[_0xbbc1('0x1f')](0x190)['json']({'message':_0xbbc1('0x64')});}});}})[_0xbbc1('0x28')](respondWithResult(_0x2a1582,null))[_0xbbc1('0x47')](handleError(_0x2a1582,null));};exports[_0xbbc1('0x65')]=function(_0x4ffd7f,_0x38c2b4,_0x43bf96){var _0x88bad6;return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x4ffd7f[_0xbbc1('0x49')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xbbc1('0x28')](handleEntityNotFound(_0x38c2b4,null))[_0xbbc1('0x28')](function(_0x519e7b){if(_0x519e7b){_0x88bad6=_0x519e7b;return db['CmContact'][_0xbbc1('0x32')];}})[_0xbbc1('0x28')](function(_0x25adf3){if(_0x25adf3){var _0x9047a2={};var _0x31e2c4={};_0x31e2c4['model']=_[_0xbbc1('0x66')](_[_0xbbc1('0x35')](_0x25adf3),_[_0xbbc1('0x31')](_0x88bad6['CustomFields'],function(_0x2f3afe){return util[_0xbbc1('0x67')](_0xbbc1('0x68'),_0x2f3afe['id']);}));_0x31e2c4[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x4ffd7f[_0xbbc1('0x34')]);_0x31e2c4['filters']=_[_0xbbc1('0x37')](_0x31e2c4[_0xbbc1('0x39')],_0x31e2c4[_0xbbc1('0x34')]);_0x9047a2[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x31e2c4[_0xbbc1('0x39')],qs[_0xbbc1('0x3a')](_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x3a')]));_0x9047a2[_0xbbc1('0x38')]=_0x9047a2[_0xbbc1('0x38')]['length']?_0x9047a2[_0xbbc1('0x38')]:_0x31e2c4[_0xbbc1('0x39')];if(!_0x4ffd7f['query'][_0xbbc1('0x56')](_0xbbc1('0x57'))){_0x9047a2[_0xbbc1('0x23')]=qs['limit'](_0x4ffd7f['query'][_0xbbc1('0x23')]);_0x9047a2[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x21')]);}_0x9047a2['order']=qs[_0xbbc1('0x3d')](_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x9047a2[_0xbbc1('0x3e')]=qs[_0xbbc1('0x36')](_[_0xbbc1('0x3f')](_0x4ffd7f['query'],_0x31e2c4[_0xbbc1('0x36')]));_0x9047a2[_0xbbc1('0x69')]=!![];if(_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x9047a2[_0xbbc1('0x3e')]=_[_0xbbc1('0x41')](_0x9047a2[_0xbbc1('0x3e')],{'$or':_[_0xbbc1('0x31')](_0x9047a2['attributes'],function(_0x48e924){var _0x11295a={};_0x11295a[_0x48e924]={'$like':'%'+_0x4ffd7f[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0x11295a;})});}_0x9047a2=_['merge']({},_0x9047a2,_0x4ffd7f['options']);return _0x88bad6['getContacts'](_0x9047a2);}})[_0xbbc1('0x28')](respondWithResult(_0x38c2b4,null))[_0xbbc1('0x47')](handleError(_0x38c2b4,null));};exports['getContactsCsv']=function(_0x262fec,_0x4cd22f,_0x2cd34b){var _0x506b90;var _0x1e5347;var _0x2fc6e7;var _0xeff8b3=_0x262fec[_0xbbc1('0x49')]['id'];csv_results=[];return db[_0xbbc1('0x6a')][_0xbbc1('0x46')]({'attributes':['id',_0xbbc1('0x2f')],'raw':!![],'order':[_0xbbc1('0x6b')]})[_0xbbc1('0x28')](function(_0x25391b){_0x506b90=_0x25391b;var _0x55835f=_[_0xbbc1('0x35')](db[_0xbbc1('0x5c')][_0xbbc1('0x32')]);return db[_0xbbc1('0x6c')]['findAll']({'raw':!![],'attributes':['id',_0xbbc1('0x6d')]})[_0xbbc1('0x28')](function(_0x4ba774){_0x1e5347=_0x4ba774;var _0x535aed=squel[_0xbbc1('0x6e')]()[_0xbbc1('0x3a')](_0x55835f)[_0xbbc1('0x6f')](_0xbbc1('0x70'),'c')[_0xbbc1('0x3e')](_0xbbc1('0x71'),_0xeff8b3)[_0xbbc1('0x3e')]('c.deletedAt\x20is\x20null')[_0xbbc1('0x72')]();for(var _0x157c5a=0x0;_0x157c5a<_0x1e5347[_0xbbc1('0x3b')];_0x157c5a++){_0x535aed[_0xbbc1('0x73')](_0xbbc1('0x74')+_0x1e5347[_0x157c5a]['id'],_0xbbc1('0x75')+_0x1e5347[_0x157c5a][_0xbbc1('0x6d')]);}for(var _0x157c5a=0x0;_0x157c5a<_0x506b90[_0xbbc1('0x3b')];_0x157c5a++){_0x535aed['field'](squel['select']()[_0xbbc1('0x73')](_0xbbc1('0x76'))[_0xbbc1('0x6f')](_0xbbc1('0x77'))[_0xbbc1('0x3e')](_0xbbc1('0x78'),_0x506b90[_0x157c5a]['id'])[_0xbbc1('0x3e')](_0xbbc1('0x79')),_0xbbc1('0x7a')+_0x506b90[_0x157c5a][_0xbbc1('0x2f')]);_0x535aed['field'](squel['select']()[_0xbbc1('0x73')](_0xbbc1('0x7b'))[_0xbbc1('0x6f')](_0xbbc1('0x77'))['where'](_0xbbc1('0x78'),_0x506b90[_0x157c5a]['id'])[_0xbbc1('0x3e')](_0xbbc1('0x79')),_0xbbc1('0x7c')+_0x506b90[_0x157c5a]['name']);}var _0x2d2596=[];_0x2d2596[_0xbbc1('0x63')](_0x535aed[_0xbbc1('0x7d')]());BPromise[_0xbbc1('0x60')](_0x2d2596,handleQuery)['then'](function(_0xc7f0b1){handleQuery(_0x535aed['toString']());var _0x3d98a6=csv_results[0x0];if(!_[_0xbbc1('0x7e')](_0x3d98a6)){var _0x102d92=toCsv(_0x3d98a6);var _0x172f46=Date[_0xbbc1('0x7f')]();fs['writeFileSync'](util[_0xbbc1('0x67')](_0xbbc1('0x80'),_0xeff8b3,_0x172f46),_0x102d92);_0x4cd22f[_0xbbc1('0x81')](_0xbbc1('0x82'),_0xbbc1('0x83')+util[_0xbbc1('0x67')]('list_%d_%s.csv',_0xeff8b3,_0x172f46));_0x4cd22f['setHeader'](_0xbbc1('0x84'),_0xbbc1('0x85'));return _0x4cd22f[_0xbbc1('0x86')](util[_0xbbc1('0x67')]('/tmp/list_%d_%s.csv',_0xeff8b3,_0x172f46));}else{return _0x4cd22f[_0xbbc1('0x1d')](0xcc);}});});});};exports[_0xbbc1('0x87')]=function(_0x387008,_0x1ada14,_0x214a0e){var _0x5c6aee;delete _0x387008['body']['id'];return db[_0xbbc1('0x43')]['findOne']({'where':{'id':_0x387008[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x1ada14,null))[_0xbbc1('0x28')](function(_0x5cb5f7){if(_0x5cb5f7){return db[_0xbbc1('0x88')][_0xbbc1('0x89')](function(_0x2c0cf2){return db['CmCustomField'][_0xbbc1('0x4c')](_0x387008[_0xbbc1('0x4d')],{'transaction':_0x2c0cf2})[_0xbbc1('0x28')](function(_0x9ed7c9){_0x5c6aee=_0x9ed7c9;return _0x5cb5f7['addCustomFields'](_0x9ed7c9,{'transaction':_0x2c0cf2});})[_0xbbc1('0x28')](function(){var _0x221ae3={'type':db[_0xbbc1('0x8a')][_0xbbc1('0x8b')],'transaction':_0x2c0cf2};switch(_0x387008[_0xbbc1('0x4d')][_0xbbc1('0x42')]){case _0xbbc1('0x8c'):_0x221ae3[_0xbbc1('0x42')]=db['Sequelize']['TEXT'];break;case _0xbbc1('0x8d'):_0x221ae3[_0xbbc1('0x42')]=db[_0xbbc1('0x8a')][_0xbbc1('0x8e')];break;case'switch':_0x221ae3[_0xbbc1('0x42')]=db[_0xbbc1('0x8a')][_0xbbc1('0x8f')];_0x221ae3['defaultValue']=![];break;default:}return db[_0xbbc1('0x88')][_0xbbc1('0x90')][_0xbbc1('0x91')](_0xbbc1('0x70'),util['format'](_0xbbc1('0x92'),_0x5c6aee['id']),_0x221ae3);})[_0xbbc1('0x28')](function(){return _0x5c6aee;});});}})[_0xbbc1('0x28')](respondWithResult(_0x1ada14,null))['catch'](handleError(_0x1ada14,null));};exports[_0xbbc1('0x93')]=function(_0x1d8848,_0x51efec,_0x57871f){var _0xf90de5={};var _0x599c4b={};var _0x5b50d5;var _0x522fbe;return db[_0xbbc1('0x43')][_0xbbc1('0x55')]({'where':{'id':_0x1d8848[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x51efec,null))[_0xbbc1('0x28')](function(_0x4353d4){if(_0x4353d4){_0x5b50d5=_0x4353d4;_0x599c4b[_0xbbc1('0x39')]=_[_0xbbc1('0x35')](db[_0xbbc1('0x6c')][_0xbbc1('0x32')]);_0x599c4b[_0xbbc1('0x34')]=_[_0xbbc1('0x35')](_0x1d8848[_0xbbc1('0x34')]);_0x599c4b[_0xbbc1('0x36')]=_[_0xbbc1('0x37')](_0x599c4b[_0xbbc1('0x39')],_0x599c4b[_0xbbc1('0x34')]);_0xf90de5[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x599c4b['model'],qs['fields'](_0x1d8848[_0xbbc1('0x34')][_0xbbc1('0x3a')]));_0xf90de5[_0xbbc1('0x38')]=_0xf90de5[_0xbbc1('0x38')]['length']?_0xf90de5[_0xbbc1('0x38')]:_0x599c4b[_0xbbc1('0x39')];_0xf90de5['order']=qs[_0xbbc1('0x3d')](_0x1d8848[_0xbbc1('0x34')]['sort']);_0xf90de5[_0xbbc1('0x3e')]=qs['filters'](_[_0xbbc1('0x3f')](_0x1d8848[_0xbbc1('0x34')],_0x599c4b[_0xbbc1('0x36')]));_0xf90de5['where']=_[_0xbbc1('0x41')](_0xf90de5[_0xbbc1('0x3e')],{'$or':[{'ListId':_0x4353d4['id']},{'ListId':null}]});if(_0x1d8848[_0xbbc1('0x34')]['filter']){_0xf90de5[_0xbbc1('0x3e')]=_[_0xbbc1('0x41')](_0xf90de5[_0xbbc1('0x3e')],{'$or':_[_0xbbc1('0x31')](_0xf90de5[_0xbbc1('0x38')],function(_0x1465f7){var _0xd7b6dc={};_0xd7b6dc[_0x1465f7]={'$like':'%'+_0x1d8848[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0xd7b6dc;})});}_0xf90de5=_[_0xbbc1('0x41')]({},_0xf90de5,_0x1d8848[_0xbbc1('0x4a')]);return db['CmCustomField'][_0xbbc1('0x94')](_0xf90de5);}})[_0xbbc1('0x28')](respondWithResult(_0x51efec,null))[_0xbbc1('0x47')](handleError(_0x51efec,null));};exports[_0xbbc1('0x95')]=function(_0x275b43,_0x3bcf75){return db['CmCustomField'][_0xbbc1('0x94')]({'where':{'ListId':null}})[_0xbbc1('0x28')](handleEntityNotFound(_0x3bcf75,null))[_0xbbc1('0x28')](function(_0x2104da){return _0x2104da;})[_0xbbc1('0x28')](respondWithResult(_0x3bcf75,null))[_0xbbc1('0x47')](handleError(_0x3bcf75,null));};exports[_0xbbc1('0x96')]=function(_0x828463,_0x417ca9,_0x1c05c0){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x828463[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x417ca9,null))['then'](function(_0x269313){if(_0x269313){return _0x269313[_0xbbc1('0x96')](_0x828463[_0xbbc1('0x4d')][_0xbbc1('0x5a')],_[_0xbbc1('0x97')](_0x828463[_0xbbc1('0x4d')],[_0xbbc1('0x5a'),'id'])||{})['spread'](function(_0x309cfe){for(var _0x2b9017=0x0;_0x2b9017<_0x828463[_0xbbc1('0x4d')][_0xbbc1('0x5a')][_0xbbc1('0x3b')];_0x2b9017+=0x1){socket[_0xbbc1('0x98')]('userCmList:save',{'UserId':Number(_0x828463[_0xbbc1('0x4d')][_0xbbc1('0x5a')][_0x2b9017]),'CmListId':Number(_0x828463[_0xbbc1('0x49')]['id'])});}return _0x309cfe;});}})[_0xbbc1('0x28')](respondWithResult(_0x417ca9,null))[_0xbbc1('0x47')](handleError(_0x417ca9,null));};exports[_0xbbc1('0x99')]=function(_0x23c6ab,_0x5f0eef,_0x3be5ce){return db[_0xbbc1('0x43')][_0xbbc1('0x4b')]({'where':{'id':_0x23c6ab['params']['id']}})['then'](handleEntityNotFound(_0x5f0eef,null))['then'](function(_0x204fe2){if(_0x204fe2){return _0x204fe2[_0xbbc1('0x99')](_0x23c6ab[_0xbbc1('0x34')][_0xbbc1('0x5a')])[_0xbbc1('0x28')](function(){if(_['isArray'](_0x23c6ab['query']['ids'])){for(var _0x3c8cda=0x0;_0x3c8cda<_0x23c6ab['query'][_0xbbc1('0x5a')][_0xbbc1('0x3b')];_0x3c8cda+=0x1){socket['emit'](_0xbbc1('0x9a'),{'UserId':Number(_0x23c6ab[_0xbbc1('0x34')][_0xbbc1('0x5a')][_0x3c8cda]),'CmListId':Number(_0x23c6ab[_0xbbc1('0x49')]['id'])});}}else{socket[_0xbbc1('0x98')](_0xbbc1('0x9a'),{'UserId':Number(_0x23c6ab[_0xbbc1('0x34')]['ids']),'CmListId':Number(_0x23c6ab[_0xbbc1('0x49')]['id'])});}});}})[_0xbbc1('0x28')](respondWithStatusCode(_0x5f0eef,null))[_0xbbc1('0x47')](handleError(_0x5f0eef,null));};exports['getAgents']=function(_0x5e2431,_0x1811da,_0x11b7aa){var _0x57ffa8={};var _0x2accc0={};var _0x15669f;var _0xa89f3d;return db['CmList']['findOne']({'where':{'id':_0x5e2431[_0xbbc1('0x49')]['id']}})[_0xbbc1('0x28')](handleEntityNotFound(_0x1811da,null))[_0xbbc1('0x28')](function(_0x429a24){if(_0x429a24){_0x15669f=_0x429a24;_0x2accc0[_0xbbc1('0x39')]=_['keys'](db[_0xbbc1('0x9b')][_0xbbc1('0x32')]);_0x2accc0['query']=_[_0xbbc1('0x35')](_0x5e2431['query']);_0x2accc0['filters']=_[_0xbbc1('0x37')](_0x2accc0[_0xbbc1('0x39')],_0x2accc0[_0xbbc1('0x34')]);_0x57ffa8[_0xbbc1('0x38')]=_[_0xbbc1('0x37')](_0x2accc0[_0xbbc1('0x39')],qs[_0xbbc1('0x3a')](_0x5e2431['query'][_0xbbc1('0x3a')]));_0x57ffa8[_0xbbc1('0x38')]=_0x57ffa8['attributes'][_0xbbc1('0x3b')]?_0x57ffa8[_0xbbc1('0x38')]:_0x2accc0['model'];_0x57ffa8[_0xbbc1('0x3c')]=qs[_0xbbc1('0x3d')](_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x3d')]);_0x57ffa8['where']=qs[_0xbbc1('0x36')](_[_0xbbc1('0x3f')](_0x5e2431['query'],_0x2accc0[_0xbbc1('0x36')]));if(_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x40')]){_0x57ffa8['where']=_['merge'](_0x57ffa8['where'],{'$or':_[_0xbbc1('0x31')](_0x57ffa8[_0xbbc1('0x38')],function(_0x2a7799){var _0x28b5e0={};_0x28b5e0[_0x2a7799]={'$like':'%'+_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x40')]+'%'};return _0x28b5e0;})});}_0x57ffa8=_['merge']({},_0x57ffa8,_0x5e2431[_0xbbc1('0x4a')]);return _0x15669f['getAgents'](_0x57ffa8);}})[_0xbbc1('0x28')](function(_0x590340){if(_0x590340){_0xa89f3d=_0x590340[_0xbbc1('0x3b')];if(!_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x56')](_0xbbc1('0x57'))){_0x57ffa8['limit']=qs[_0xbbc1('0x23')](_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x23')]);_0x57ffa8[_0xbbc1('0x21')]=qs[_0xbbc1('0x21')](_0x5e2431[_0xbbc1('0x34')][_0xbbc1('0x21')]);}return _0x15669f[_0xbbc1('0x9c')](_0x57ffa8);}})[_0xbbc1('0x28')](function(_0x15ee87){if(_0x15ee87){return _0x15ee87?{'count':_0xa89f3d,'rows':_0x15ee87}:null;}})[_0xbbc1('0x28')](respondWithResult(_0x1811da,null))[_0xbbc1('0x47')](handleError(_0x1811da,null));};function handleQuery(_0x434497){logger['info'](_0x434497);return db['sequelize']['query'](_0x434497)[_0xbbc1('0x9d')](function(_0x5e0912){csv_results[_0xbbc1('0x63')](_0x5e0912);})[_0xbbc1('0x47')](function(_0x2ec147){logger[_0xbbc1('0x2d')](_0x2ec147[_0xbbc1('0x9e')]);});}
\ No newline at end of file
index 6eba05b..1721f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x1c0928,_0x3a5f09){var _0x557de8=function(_0x22d8a4){while(--_0x22d8a4){_0x1c0928['push'](_0x1c0928['shift']());}};_0x557de8(++_0x3a5f09);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents;
\ No newline at end of file
+var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x5b7788,_0x309ae5){var _0x573871=function(_0x5c79fd){while(--_0x5c79fd){_0x5b7788['push'](_0x5b7788['shift']());}};_0x573871(++_0x309ae5);}(_0x55ca,0x126));var _0xa55c=function(_0x5fe5ca,_0x4e92d3){_0x5fe5ca=_0x5fe5ca-0x0;var _0x42f45f=_0x55ca[_0x5fe5ca];return _0x42f45f;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
index cc83088..1dae9b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x2bf5fc,_0x109374){var _0x447525=function(_0x2abc85){while(--_0x2abc85){_0x2bf5fc['push'](_0x2bf5fc['shift']());}};_0x447525(++_0x109374);}(_0x5ff3,0x17d));var _0x35ff=function(_0x322d61,_0x4cd1b6){_0x322d61=_0x322d61-0x0;var _0x1ed39d=_0x5ff3[_0x322d61];return _0x1ed39d;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','cm_lists','lodash'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe14d,0x1ee));var _0xde14=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe14d[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('CmList',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0149f0c..167d694 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cb5=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3d3d51,_0x53e609){var _0x32145c=function(_0x48e337){while(--_0x48e337){_0x3d3d51['push'](_0x3d3d51['shift']());}};_0x32145c(++_0x53e609);}(_0x5cb5,0x157));var _0x55cb=function(_0x184f60,_0x3464da){_0x184f60=_0x184f60-0x0;var _0x471c58=_0x5cb5[_0x184f60];return _0x471c58;};'use strict';var _=require(_0x55cb('0x0'));var util=require(_0x55cb('0x1'));var moment=require(_0x55cb('0x2'));var BPromise=require(_0x55cb('0x3'));var rs=require(_0x55cb('0x4'));var fs=require('fs');var Redis=require(_0x55cb('0x5'));var db=require(_0x55cb('0x6'))['db'];var utils=require(_0x55cb('0x7'));var logger=require(_0x55cb('0x8'))(_0x55cb('0x9'));var config=require(_0x55cb('0xa'));var jayson=require(_0x55cb('0xb'));var client=jayson[_0x55cb('0xc')]['http']({'port':0x232a});config[_0x55cb('0xd')]=_[_0x55cb('0xe')](config[_0x55cb('0xd')],{'host':_0x55cb('0xf'),'port':0x18eb});var socket=require(_0x55cb('0x10'))(new Redis(config[_0x55cb('0xd')]));require('./cmList.socket')[_0x55cb('0x11')](socket);function respondWithRpcPromise(_0x4f4a93,_0x438b18,_0x44676c){return new BPromise(function(_0xa9675b,_0x1b4494){return client['request'](_0x4f4a93,_0x44676c)[_0x55cb('0x12')](function(_0x520c04){logger['info']('CmList,\x20%s,\x20%s',_0x438b18,_0x55cb('0x13'));logger[_0x55cb('0x14')](_0x55cb('0x15'),_0x438b18,_0x55cb('0x13'),JSON[_0x55cb('0x16')](_0x520c04));if(_0x520c04[_0x55cb('0x17')]){if(_0x520c04[_0x55cb('0x17')][_0x55cb('0x18')]===0x1f4){logger[_0x55cb('0x17')]('CmList,\x20%s,\x20%s',_0x438b18,_0x520c04[_0x55cb('0x17')][_0x55cb('0x19')]);return _0x1b4494(_0x520c04[_0x55cb('0x17')][_0x55cb('0x19')]);}logger['error']('CmList,\x20%s,\x20%s',_0x438b18,_0x520c04[_0x55cb('0x17')]['message']);return _0xa9675b(_0x520c04[_0x55cb('0x17')][_0x55cb('0x19')]);}else{logger['info'](_0x55cb('0x1a'),_0x438b18,_0x55cb('0x13'));_0xa9675b(_0x520c04[_0x55cb('0x1b')][_0x55cb('0x19')]);}})[_0x55cb('0x1c')](function(_0x49d77f){logger[_0x55cb('0x17')](_0x55cb('0x1a'),_0x438b18,_0x49d77f);_0x1b4494(_0x49d77f);});});}
\ No newline at end of file
+var _0x4cf5=['localhost','socket.io-emitter','./cmList.socket','register','request','CmList,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults'];(function(_0x2378c0,_0x39eb52){var _0x28a3a6=function(_0xe94967){while(--_0xe94967){_0x2378c0['push'](_0x2378c0['shift']());}};_0x28a3a6(++_0x39eb52);}(_0x4cf5,0xaf));var _0x54cf=function(_0x39ad1e,_0x528c25){_0x39ad1e=_0x39ad1e-0x0;var _0x2c8b53=_0x4cf5[_0x39ad1e];return _0x2c8b53;};'use strict';var _=require(_0x54cf('0x0'));var util=require(_0x54cf('0x1'));var moment=require(_0x54cf('0x2'));var BPromise=require(_0x54cf('0x3'));var rs=require(_0x54cf('0x4'));var fs=require('fs');var Redis=require(_0x54cf('0x5'));var db=require(_0x54cf('0x6'))['db'];var utils=require(_0x54cf('0x7'));var logger=require('../../config/logger')(_0x54cf('0x8'));var config=require(_0x54cf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x54cf('0xa')][_0x54cf('0xb')]({'port':0x232a});config[_0x54cf('0xc')]=_[_0x54cf('0xd')](config[_0x54cf('0xc')],{'host':_0x54cf('0xe'),'port':0x18eb});var socket=require(_0x54cf('0xf'))(new Redis(config[_0x54cf('0xc')]));require(_0x54cf('0x10'))[_0x54cf('0x11')](socket);function respondWithRpcPromise(_0x5dca6e,_0x188ecf,_0x3b1eb1){return new BPromise(function(_0xf69102,_0x2a588f){return client[_0x54cf('0x12')](_0x5dca6e,_0x3b1eb1)['then'](function(_0x4bdf77){logger['info'](_0x54cf('0x13'),_0x188ecf,_0x54cf('0x14'));logger[_0x54cf('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x188ecf,_0x54cf('0x14'),JSON[_0x54cf('0x16')](_0x4bdf77));if(_0x4bdf77[_0x54cf('0x17')]){if(_0x4bdf77[_0x54cf('0x17')][_0x54cf('0x18')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0x188ecf,_0x4bdf77[_0x54cf('0x17')][_0x54cf('0x19')]);return _0x2a588f(_0x4bdf77['error'][_0x54cf('0x19')]);}logger[_0x54cf('0x17')]('CmList,\x20%s,\x20%s',_0x188ecf,_0x4bdf77[_0x54cf('0x17')][_0x54cf('0x19')]);return _0xf69102(_0x4bdf77['error'][_0x54cf('0x19')]);}else{logger[_0x54cf('0x1a')](_0x54cf('0x13'),_0x188ecf,_0x54cf('0x14'));_0xf69102(_0x4bdf77['result']['message']);}})['catch'](function(_0x3e7e5c){logger[_0x54cf('0x17')](_0x54cf('0x13'),_0x188ecf,_0x3e7e5c);_0x2a588f(_0x3e7e5c);});});}
\ No newline at end of file
index dfb9214..ceb0b09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb143=['./cmList.events','remove','update','removeListener','length','cmList:'];(function(_0x33e4c7,_0x4d8a1a){var _0x234be9=function(_0xef51f){while(--_0xef51f){_0x33e4c7['push'](_0x33e4c7['shift']());}};_0x234be9(++_0x4d8a1a);}(_0xb143,0x1e6));var _0x3b14=function(_0x4940d0,_0x1142ad){_0x4940d0=_0x4940d0-0x0;var _0x53354b=_0xb143[_0x4940d0];return _0x53354b;};'use strict';var CmListEvents=require(_0x3b14('0x0'));var events=['save',_0x3b14('0x1'),_0x3b14('0x2')];function createListener(_0x51edad,_0xc13743){return function(_0x291a25){_0xc13743['emit'](_0x51edad,_0x291a25);};}function removeListener(_0x46e873,_0x5ed25b){return function(){CmListEvents[_0x3b14('0x3')](_0x46e873,_0x5ed25b);};}exports['register']=function(_0x227129){for(var _0x5407d8=0x0,_0x355628=events[_0x3b14('0x4')];_0x5407d8<_0x355628;_0x5407d8++){var _0x3526db=events[_0x5407d8];var _0x38a61c=createListener(_0x3b14('0x5')+_0x3526db,_0x227129);CmListEvents['on'](_0x3526db,_0x38a61c);}};
\ No newline at end of file
+var _0x7bbf=['emit','removeListener','register','./cmList.events','save','remove','update'];(function(_0x13e1e1,_0x18c2eb){var _0x4298f9=function(_0x301e70){while(--_0x301e70){_0x13e1e1['push'](_0x13e1e1['shift']());}};_0x4298f9(++_0x18c2eb);}(_0x7bbf,0xce));var _0xf7bb=function(_0x48fd01,_0x35518f){_0x48fd01=_0x48fd01-0x0;var _0x1002f5=_0x7bbf[_0x48fd01];return _0x1002f5;};'use strict';var CmListEvents=require(_0xf7bb('0x0'));var events=[_0xf7bb('0x1'),_0xf7bb('0x2'),_0xf7bb('0x3')];function createListener(_0x57ebba,_0x2b05ef){return function(_0x5abac7){_0x2b05ef[_0xf7bb('0x4')](_0x57ebba,_0x5abac7);};}function removeListener(_0x1901a6,_0x3e20e8){return function(){CmListEvents[_0xf7bb('0x5')](_0x1901a6,_0x3e20e8);};}exports[_0xf7bb('0x6')]=function(_0x30d181){for(var _0x64f263=0x0,_0x565ef6=events['length'];_0x64f263<_0x565ef6;_0x64f263++){var _0x18a591=events[_0x64f263];var _0x24a9fc=createListener('cmList:'+_0x18a591,_0x30d181);CmListEvents['on'](_0x18a591,_0x24a9fc);}};
\ No newline at end of file
index a9c3572..7178911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6325=['/:id/fields','getCustomFields','/:id/users','create','post','addDisposition','addContacts','addCustomField','put','/:id','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/global_fields','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x6325,0xe8));var _0x5632=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6325[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5632('0x0'));var util=require(_0x5632('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5632('0x2'));var router=express[_0x5632('0x3')]();var fs_extra=require(_0x5632('0x4'));var auth=require(_0x5632('0x5'));var interaction=require(_0x5632('0x6'));var config=require(_0x5632('0x7'));var controller=require('./cmList.controller');router[_0x5632('0x8')]('/',auth[_0x5632('0x9')](),controller[_0x5632('0xa')]);router[_0x5632('0x8')]('/describe',auth[_0x5632('0x9')](),controller[_0x5632('0xb')]);router[_0x5632('0x8')](_0x5632('0xc'),auth[_0x5632('0x9')](),controller['getGlobalCustomFields']);router[_0x5632('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5632('0xd')]);router[_0x5632('0x8')](_0x5632('0xe'),auth[_0x5632('0x9')](),controller[_0x5632('0xf')]);router[_0x5632('0x8')](_0x5632('0x10'),auth['isAuthenticated'](),controller[_0x5632('0x11')]);router[_0x5632('0x8')](_0x5632('0x12'),auth[_0x5632('0x9')](),controller[_0x5632('0x13')]);router[_0x5632('0x8')](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x15')]);router[_0x5632('0x8')](_0x5632('0x16'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x5632('0x9')](),controller[_0x5632('0x17')]);router[_0x5632('0x18')](_0x5632('0xe'),auth[_0x5632('0x9')](),controller[_0x5632('0x19')]);router[_0x5632('0x18')](_0x5632('0x10'),auth[_0x5632('0x9')](),controller[_0x5632('0x1a')]);router['post'](_0x5632('0x14'),auth[_0x5632('0x9')](),controller[_0x5632('0x1b')]);router[_0x5632('0x18')](_0x5632('0x16'),auth[_0x5632('0x9')](),controller['addAgents']);router[_0x5632('0x1c')](_0x5632('0x1d'),auth[_0x5632('0x9')](),controller[_0x5632('0x1e')]);router[_0x5632('0x1f')](_0x5632('0x1d'),auth[_0x5632('0x9')](),controller[_0x5632('0x20')]);router[_0x5632('0x1f')](_0x5632('0xe'),auth['isAuthenticated'](),controller[_0x5632('0x21')]);router['delete'](_0x5632('0x16'),auth[_0x5632('0x9')](),controller[_0x5632('0x22')]);module[_0x5632('0x23')]=router;
\ No newline at end of file
+var _0xfb30=['/:id/users','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','getGlobalCustomFields','/:id','/:id/dispositions','getDispositions','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create'];(function(_0x48f99c,_0xad646d){var _0x2d5e7e=function(_0x28cc49){while(--_0x28cc49){_0x48f99c['push'](_0x48f99c['shift']());}};_0x2d5e7e(++_0xad646d);}(_0xfb30,0x88));var _0x0fb3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfb30[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x0fb3('0x0'));var util=require(_0x0fb3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0fb3('0x2'));var router=express['Router']();var fs_extra=require(_0x0fb3('0x3'));var auth=require(_0x0fb3('0x4'));var interaction=require(_0x0fb3('0x5'));var config=require(_0x0fb3('0x6'));var controller=require(_0x0fb3('0x7'));router[_0x0fb3('0x8')]('/',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xa')]);router[_0x0fb3('0x8')](_0x0fb3('0xb'),auth[_0x0fb3('0x9')](),controller['describe']);router[_0x0fb3('0x8')]('/global_fields',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xc')]);router[_0x0fb3('0x8')](_0x0fb3('0xd'),auth[_0x0fb3('0x9')](),controller['show']);router['get'](_0x0fb3('0xe'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0xf')]);router[_0x0fb3('0x8')]('/:id/contacts',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x10')]);router['get'](_0x0fb3('0x11'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x12')]);router[_0x0fb3('0x8')](_0x0fb3('0x13'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x14')]);router[_0x0fb3('0x8')]('/:id/users',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x15')]);router[_0x0fb3('0x16')]('/',auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x17')]);router[_0x0fb3('0x16')](_0x0fb3('0xe'),auth[_0x0fb3('0x9')](),controller['addDisposition']);router[_0x0fb3('0x16')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x0fb3('0x16')](_0x0fb3('0x13'),auth[_0x0fb3('0x9')](),controller['addCustomField']);router[_0x0fb3('0x16')](_0x0fb3('0x18'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x19')]);router[_0x0fb3('0x1a')](_0x0fb3('0xd'),auth[_0x0fb3('0x9')](),controller['update']);router[_0x0fb3('0x1b')](_0x0fb3('0xd'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x1c')]);router[_0x0fb3('0x1b')](_0x0fb3('0xe'),auth['isAuthenticated'](),controller[_0x0fb3('0x1d')]);router[_0x0fb3('0x1b')](_0x0fb3('0x18'),auth[_0x0fb3('0x9')](),controller[_0x0fb3('0x1e')]);module[_0x0fb3('0x1f')]=router;
\ No newline at end of file
index 8be010e..bf51147 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf645=['exports','VIRTUAL','STRING'];(function(_0x4e221c,_0x4e8f0d){var _0x37686d=function(_0x4e03c3){while(--_0x4e03c3){_0x4e221c['push'](_0x4e221c['shift']());}};_0x37686d(++_0x4e8f0d);}(_0xf645,0x1dd));var _0x5f64=function(_0x5b0bc8,_0x3f86b0){_0x5b0bc8=_0x5b0bc8-0x0;var _0x1626a5=_0xf645[_0x5b0bc8];return _0x1626a5;};'use strict';var Sequelize=require('sequelize');module[_0x5f64('0x0')]={'name':{'type':Sequelize[_0x5f64('0x1')],'get':function(_0xfe481d){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x5f64('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x5f64('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x5f64('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x7db8=['field','STRING','exports','VIRTUAL'];(function(_0x185d4c,_0x541480){var _0x413709=function(_0x828720){while(--_0x828720){_0x185d4c['push'](_0x185d4c['shift']());}};_0x413709(++_0x541480);}(_0x7db8,0x122));var _0x87db=function(_0x157e04,_0x56e521){_0x157e04=_0x157e04-0x0;var _0x499987=_0x7db8[_0x157e04];return _0x499987;};'use strict';var Sequelize=require('sequelize');module[_0x87db('0x0')]={'name':{'type':Sequelize[_0x87db('0x1')],'get':function(_0x38fc76){return this['getDataValue'](_0x87db('0x2'));}},'field':{'type':Sequelize[_0x87db('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x87db('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x87db('0x3')],'allowNull':![]}};
\ No newline at end of file
index 99087d0..5383150 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0xc9eb61,_0x443215){var _0x1eba68=function(_0x387d21){while(--_0x387d21){_0xc9eb61['push'](_0xc9eb61['shift']());}};_0x1eba68(++_0x443215);}(_0x7a54,0x106));var _0x47a5=function(_0xb49caf,_0x518f9f){_0xb49caf=_0xb49caf-0x0;var _0x4b270c=_0x7a54[_0xb49caf];return _0x4b270c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4ec9a5,_0x1ac9a2){var _0x513e8d=function(_0x35aded){while(--_0x35aded){_0x4ec9a5['push'](_0x4ec9a5['shift']());}};_0x513e8d(++_0x1ac9a2);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index e29055c..9a89721 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccf1=['request-promise','path','rimraf','define','Condition','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x1ae7b0,_0x2301a2){var _0x2d83dc=function(_0x32a63f){while(--_0x32a63f){_0x1ae7b0['push'](_0x1ae7b0['shift']());}};_0x2d83dc(++_0x2301a2);}(_0xccf1,0x1d4));var _0x1ccf=function(_0x45fa7d,_0x2c3049){_0x45fa7d=_0x45fa7d-0x0;var _0x1f9fe0=_0xccf1[_0x45fa7d];return _0x1f9fe0;};'use strict';var _=require(_0x1ccf('0x0'));var util=require(_0x1ccf('0x1'));var logger=require(_0x1ccf('0x2'))(_0x1ccf('0x3'));var moment=require(_0x1ccf('0x4'));var BPromise=require('bluebird');var rp=require(_0x1ccf('0x5'));var fs=require('fs');var path=require(_0x1ccf('0x6'));var rimraf=require(_0x1ccf('0x7'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module['exports']=function(_0x565d0f,_0x439d8e){return _0x565d0f[_0x1ccf('0x8')](_0x1ccf('0x9'),attributes,{'tableName':_0x1ccf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x975f=['rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash','util','api','moment','request-promise','path'];(function(_0x24d6e5,_0x8cb8af){var _0x5b85c1=function(_0x179381){while(--_0x179381){_0x24d6e5['push'](_0x24d6e5['shift']());}};_0x5b85c1(++_0x8cb8af);}(_0x975f,0x156));var _0xf975=function(_0x1428d9,_0xded63c){_0x1428d9=_0x1428d9-0x0;var _0x438019=_0x975f[_0x1428d9];return _0x438019;};'use strict';var _=require(_0xf975('0x0'));var util=require(_0xf975('0x1'));var logger=require('../../config/logger')(_0xf975('0x2'));var moment=require(_0xf975('0x3'));var BPromise=require('bluebird');var rp=require(_0xf975('0x4'));var fs=require('fs');var path=require(_0xf975('0x5'));var rimraf=require(_0xf975('0x6'));var config=require(_0xf975('0x7'));var attributes=require(_0xf975('0x8'));module[_0xf975('0x9')]=function(_0x574dfb,_0xd325d2){return _0x574dfb['define'](_0xf975('0xa'),attributes,{'tableName':_0xf975('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1998c93..4e2fcd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d42=['catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code','Condition,\x20%s,\x20%s','message'];(function(_0x555040,_0x4b586a){var _0x153e91=function(_0x11b49b){while(--_0x11b49b){_0x555040['push'](_0x555040['shift']());}};_0x153e91(++_0x4b586a);}(_0x2d42,0x6a));var _0x22d4=function(_0xec2112,_0x5281a6){_0xec2112=_0xec2112-0x0;var _0x2ba326=_0x2d42[_0xec2112];return _0x2ba326;};'use strict';var _=require(_0x22d4('0x0'));var util=require(_0x22d4('0x1'));var moment=require(_0x22d4('0x2'));var BPromise=require('bluebird');var rs=require(_0x22d4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x22d4('0x4'));var logger=require(_0x22d4('0x5'))(_0x22d4('0x6'));var config=require(_0x22d4('0x7'));var jayson=require(_0x22d4('0x8'));var client=jayson[_0x22d4('0x9')][_0x22d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x39581b,_0x429732,_0x3a685d){return new BPromise(function(_0x48492b,_0x18733f){return client[_0x22d4('0xb')](_0x39581b,_0x3a685d)[_0x22d4('0xc')](function(_0x128d0e){logger[_0x22d4('0xd')]('Condition,\x20%s,\x20%s',_0x429732,_0x22d4('0xe'));logger[_0x22d4('0xf')]('Condition,\x20%s,\x20%s,\x20%s',_0x429732,_0x22d4('0xe'),JSON['stringify'](_0x128d0e));if(_0x128d0e['error']){if(_0x128d0e[_0x22d4('0x10')][_0x22d4('0x11')]===0x1f4){logger['error'](_0x22d4('0x12'),_0x429732,_0x128d0e[_0x22d4('0x10')][_0x22d4('0x13')]);return _0x18733f(_0x128d0e[_0x22d4('0x10')]['message']);}logger[_0x22d4('0x10')](_0x22d4('0x12'),_0x429732,_0x128d0e[_0x22d4('0x10')][_0x22d4('0x13')]);return _0x48492b(_0x128d0e[_0x22d4('0x10')]['message']);}else{logger[_0x22d4('0xd')](_0x22d4('0x12'),_0x429732,_0x22d4('0xe'));_0x48492b(_0x128d0e['result'][_0x22d4('0x13')]);}})[_0x22d4('0x14')](function(_0x3821bf){logger[_0x22d4('0x10')](_0x22d4('0x12'),_0x429732,_0x3821bf);_0x18733f(_0x3821bf);});});}
\ No newline at end of file
+var _0x3807=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x97eb67,_0x183cbf){var _0x544ced=function(_0x20481a){while(--_0x20481a){_0x97eb67['push'](_0x97eb67['shift']());}};_0x544ced(++_0x183cbf);}(_0x3807,0xfd));var _0x7380=function(_0x123afa,_0x4e5c4e){_0x123afa=_0x123afa-0x0;var _0x58f934=_0x3807[_0x123afa];return _0x58f934;};'use strict';var _=require(_0x7380('0x0'));var util=require(_0x7380('0x1'));var moment=require(_0x7380('0x2'));var BPromise=require(_0x7380('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7380('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7380('0x5'));var logger=require('../../config/logger')(_0x7380('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7380('0x7')][_0x7380('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bfa0e,_0xe41b81,_0x835357){return new BPromise(function(_0x172e91,_0x2af221){return client[_0x7380('0x9')](_0x1bfa0e,_0x835357)[_0x7380('0xa')](function(_0x3c4a3f){logger[_0x7380('0xb')](_0x7380('0xc'),_0xe41b81,'request\x20sent');logger[_0x7380('0xd')](_0x7380('0xe'),_0xe41b81,_0x7380('0xf'),JSON['stringify'](_0x3c4a3f));if(_0x3c4a3f[_0x7380('0x10')]){if(_0x3c4a3f[_0x7380('0x10')][_0x7380('0x11')]===0x1f4){logger[_0x7380('0x10')](_0x7380('0xc'),_0xe41b81,_0x3c4a3f[_0x7380('0x10')][_0x7380('0x12')]);return _0x2af221(_0x3c4a3f['error'][_0x7380('0x12')]);}logger[_0x7380('0x10')](_0x7380('0xc'),_0xe41b81,_0x3c4a3f[_0x7380('0x10')][_0x7380('0x12')]);return _0x172e91(_0x3c4a3f['error'][_0x7380('0x12')]);}else{logger[_0x7380('0xb')](_0x7380('0xc'),_0xe41b81,_0x7380('0xf'));_0x172e91(_0x3c4a3f[_0x7380('0x13')][_0x7380('0x12')]);}})[_0x7380('0x14')](function(_0x33cb58){logger[_0x7380('0x10')](_0x7380('0xc'),_0xe41b81,_0x33cb58);_0x2af221(_0x33cb58);});});}
\ No newline at end of file
index 6d0134f..8e4e95a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a7a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x21f181,_0x27b9df){var _0x1e7320=function(_0x5e6c72){while(--_0x5e6c72){_0x21f181['push'](_0x21f181['shift']());}};_0x1e7320(++_0x27b9df);}(_0x9a7a,0x130));var _0xa9a7=function(_0x475aa9,_0x439aab){_0x475aa9=_0x475aa9-0x0;var _0x360bbc=_0x9a7a[_0x475aa9];return _0x360bbc;};'use strict';var multer=require(_0xa9a7('0x0'));var util=require(_0xa9a7('0x1'));var path=require(_0xa9a7('0x2'));var timeout=require(_0xa9a7('0x3'));var express=require(_0xa9a7('0x4'));var router=express[_0xa9a7('0x5')]();var fs_extra=require(_0xa9a7('0x6'));var auth=require(_0xa9a7('0x7'));var interaction=require(_0xa9a7('0x8'));var config=require('../../config/environment');var controller=require(_0xa9a7('0x9'));router[_0xa9a7('0xa')](_0xa9a7('0xb'),auth[_0xa9a7('0xc')](),controller[_0xa9a7('0xd')]);router[_0xa9a7('0xe')](_0xa9a7('0xb'),auth[_0xa9a7('0xc')](),controller[_0xa9a7('0xf')]);module[_0xa9a7('0x10')]=router;
\ No newline at end of file
+var _0xf3d8=['../../components/interaction/service','../../config/environment','/:id','update','delete','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x136a19,_0x2ee0cc){var _0x26c0f8=function(_0xdbf3){while(--_0xdbf3){_0x136a19['push'](_0x136a19['shift']());}};_0x26c0f8(++_0x2ee0cc);}(_0xf3d8,0xad));var _0x8f3d=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xf3d8[_0x543084];return _0x306a57;};'use strict';var multer=require(_0x8f3d('0x0'));var util=require(_0x8f3d('0x1'));var path=require(_0x8f3d('0x2'));var timeout=require(_0x8f3d('0x3'));var express=require(_0x8f3d('0x4'));var router=express[_0x8f3d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8f3d('0x6'));var interaction=require(_0x8f3d('0x7'));var config=require(_0x8f3d('0x8'));var controller=require('./condition.controller');router['put'](_0x8f3d('0x9'),auth['isAuthenticated'](),controller[_0x8f3d('0xa')]);router[_0x8f3d('0xb')](_0x8f3d('0x9'),auth[_0x8f3d('0xc')](),controller[_0x8f3d('0xd')]);module[_0x8f3d('0xe')]=router;
\ No newline at end of file
index 3381fbd..4264dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdaa=['STRING','name','INTEGER','sequelize','exports'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0xbdaa,0x99));var _0xabda=function(_0x31e442,_0x40e2b4){_0x31e442=_0x31e442-0x0;var _0x4cfde2=_0xbdaa[_0x31e442];return _0x4cfde2;};'use strict';var Sequelize=require(_0xabda('0x0'));module[_0xabda('0x1')]={'name':{'type':Sequelize[_0xabda('0x2')],'allowNull':![],'unique':_0xabda('0x3')},'OrderBy':{'type':Sequelize[_0xabda('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x50c3=['STRING','name','INTEGER','sequelize','exports'];(function(_0x34506b,_0x1d2c6f){var _0x3c77a4=function(_0xef19b1){while(--_0xef19b1){_0x34506b['push'](_0x34506b['shift']());}};_0x3c77a4(++_0x1d2c6f);}(_0x50c3,0x7b));var _0x350c=function(_0x52b54b,_0x47f996){_0x52b54b=_0x52b54b-0x0;var _0x1c9573=_0x50c3[_0x52b54b];return _0x1c9573;};'use strict';var Sequelize=require(_0x350c('0x0'));module[_0x350c('0x1')]={'name':{'type':Sequelize[_0x350c('0x2')],'allowNull':![],'unique':_0x350c('0x3')},'OrderBy':{'type':Sequelize[_0x350c('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 3babd57..e2d8a6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5464=['filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','get','ContactItemTypes','destroy','sendStatus','stack','name','map','ContactItemType','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x5555fa,_0x54dee1){var _0x4670ae=function(_0x1be6ff){while(--_0x1be6ff){_0x5555fa['push'](_0x5555fa['shift']());}};_0x4670ae(++_0x54dee1);}(_0x5464,0x15d));var _0x4546=function(_0x283641,_0x15ee30){_0x283641=_0x283641-0x0;var _0x498032=_0x5464[_0x283641];return _0x498032;};'use strict';var emlformat=require(_0x4546('0x0'));var rimraf=require(_0x4546('0x1'));var zipdir=require(_0x4546('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4546('0x3'));var moment=require('moment');var BPromise=require(_0x4546('0x4'));var Mustache=require('mustache');var util=require(_0x4546('0x5'));var path=require(_0x4546('0x6'));var sox=require(_0x4546('0x7'));var csv=require(_0x4546('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4546('0x9'));var crypto=require(_0x4546('0xa'));var jsforce=require(_0x4546('0xb'));var deskjs=require(_0x4546('0xc'));var toCsv=require(_0x4546('0x8'));var querystring=require(_0x4546('0xd'));var Papa=require(_0x4546('0xe'));var Redis=require(_0x4546('0xf'));var authService=require(_0x4546('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4546('0x11'));var hardwareService=require(_0x4546('0x12'));var logger=require(_0x4546('0x13'))('api');var utils=require(_0x4546('0x14'));var config=require(_0x4546('0x15'));var licenseUtil=require(_0x4546('0x16'));var db=require(_0x4546('0x17'))['db'];function respondWithStatusCode(_0x4d31a7,_0x4f2641){_0x4f2641=_0x4f2641||0xcc;return function(_0x3e6622){if(_0x3e6622){return _0x4d31a7['sendStatus'](_0x4f2641);}return _0x4d31a7['status'](_0x4f2641)['end']();};}function respondWithResult(_0x5b64b7,_0x598516){_0x598516=_0x598516||0xc8;return function(_0x4f5571){if(_0x4f5571){return _0x5b64b7[_0x4546('0x18')](_0x598516)['json'](_0x4f5571);}};}function respondWithFilteredResult(_0x363a17,_0x54581c){return function(_0x26fc0e){if(_0x26fc0e){var _0x564f3e=typeof _0x54581c[_0x4546('0x19')]===_0x4546('0x1a')&&typeof _0x54581c[_0x4546('0x1b')]===_0x4546('0x1a');var _0x2a294b=_0x26fc0e[_0x4546('0x1c')];var _0x57d8de=_0x564f3e?0x0:_0x54581c['offset'];var _0x5780a7=_0x564f3e?_0x26fc0e[_0x4546('0x1c')]:_0x54581c[_0x4546('0x19')]+_0x54581c[_0x4546('0x1b')];var _0x3d95c2;if(_0x5780a7>=_0x2a294b){_0x5780a7=_0x2a294b;_0x3d95c2=0xc8;}else{_0x3d95c2=0xce;}_0x363a17[_0x4546('0x18')](_0x3d95c2);return _0x363a17[_0x4546('0x1d')](_0x4546('0x1e'),_0x57d8de+'-'+_0x5780a7+'/'+_0x2a294b)[_0x4546('0x1f')](_0x26fc0e);}return null;};}function patchUpdates(_0x4034a5){return function(_0xceb1d6){try{jsonpatch['apply'](_0xceb1d6,_0x4034a5,!![]);}catch(_0x2d689f){return BPromise[_0x4546('0x20')](_0x2d689f);}return _0xceb1d6['save']();};}function saveUpdates(_0x3067ab,_0x437f55){return function(_0x1a1984){if(_0x1a1984){return _0x1a1984[_0x4546('0x21')](_0x3067ab)[_0x4546('0x22')](function(_0x15b013){return _0x15b013;});}return null;};}function removeEntity(_0x53e402,_0x3dab5c){return function(_0x2cca8b){if(_0x2cca8b){return _0x2cca8b['destroy']()[_0x4546('0x22')](function(){var _0x4618a6=_0x2cca8b[_0x4546('0x23')]({'plain':!![]});var _0x4467ee=_0x4546('0x24');return db['UserProfileResource'][_0x4546('0x25')]({'where':{'type':_0x4467ee,'resourceId':_0x4618a6['id']}})[_0x4546('0x22')](function(){return _0x2cca8b;});})[_0x4546('0x22')](function(){_0x53e402['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x43740e,_0x166d6f){return function(_0x15611c){if(!_0x15611c){_0x43740e[_0x4546('0x26')](0x194);}return _0x15611c;};}function handleError(_0x29a3f0,_0x225bc6){_0x225bc6=_0x225bc6||0x1f4;return function(_0xcea7da){logger['error'](_0xcea7da[_0x4546('0x27')]);if(_0xcea7da['name']){delete _0xcea7da[_0x4546('0x28')];}_0x29a3f0[_0x4546('0x18')](_0x225bc6)['send'](_0xcea7da);};}exports['index']=function(_0xf7a95b,_0x5af997){var _0x3c7c7d={},_0x58b69={},_0x480d8e={'count':0x0,'rows':[]};var _0x5f0226=_[_0x4546('0x29')](db[_0x4546('0x2a')][_0x4546('0x2b')],function(_0x5716dc){return{'name':_0x5716dc[_0x4546('0x2c')],'type':_0x5716dc[_0x4546('0x2d')]['key']};});_0x58b69[_0x4546('0x2e')]=_['map'](_0x5f0226,_0x4546('0x28'));_0x58b69[_0x4546('0x2f')]=_[_0x4546('0x30')](_0xf7a95b[_0x4546('0x2f')]);_0x58b69['filters']=_[_0x4546('0x31')](_0x58b69[_0x4546('0x2e')],_0x58b69[_0x4546('0x2f')]);_0x3c7c7d[_0x4546('0x32')]=_[_0x4546('0x31')](_0x58b69[_0x4546('0x2e')],qs['fields'](_0xf7a95b[_0x4546('0x2f')][_0x4546('0x33')]));_0x3c7c7d['attributes']=_0x3c7c7d['attributes'][_0x4546('0x34')]?_0x3c7c7d[_0x4546('0x32')]:_0x58b69['model'];if(!_0xf7a95b[_0x4546('0x2f')][_0x4546('0x35')]('nolimit')){_0x3c7c7d['limit']=qs[_0x4546('0x1b')](_0xf7a95b[_0x4546('0x2f')][_0x4546('0x1b')]);_0x3c7c7d[_0x4546('0x19')]=qs[_0x4546('0x19')](_0xf7a95b[_0x4546('0x2f')]['offset']);}_0x3c7c7d[_0x4546('0x36')]=qs[_0x4546('0x37')](_0xf7a95b['query'][_0x4546('0x37')]);_0x3c7c7d['where']=qs[_0x4546('0x38')](_[_0x4546('0x39')](_0xf7a95b['query'],_0x58b69['filters']),_0x5f0226);if(_0xf7a95b[_0x4546('0x2f')][_0x4546('0x3a')]){_0x3c7c7d[_0x4546('0x3b')]=_['merge'](_0x3c7c7d[_0x4546('0x3b')],{'$or':_[_0x4546('0x29')](_0x5f0226,function(_0x24eb6d){if(_0x24eb6d[_0x4546('0x2d')]!==_0x4546('0x3c')){var _0x320772={};_0x320772[_0x24eb6d[_0x4546('0x28')]]={'$like':'%'+_0xf7a95b[_0x4546('0x2f')]['filter']+'%'};return _0x320772;}})});}_0x3c7c7d=_[_0x4546('0x3d')]({},_0x3c7c7d,_0xf7a95b[_0x4546('0x3e')]);var _0x4a76a2={'where':_0x3c7c7d['where']};return db[_0x4546('0x2a')][_0x4546('0x1c')](_0x4a76a2)[_0x4546('0x22')](function(_0x1ea5c4){_0x480d8e[_0x4546('0x1c')]=_0x1ea5c4;if(_0xf7a95b['query'][_0x4546('0x3f')]){_0x3c7c7d[_0x4546('0x40')]=[{'all':!![]}];}return db[_0x4546('0x2a')][_0x4546('0x41')](_0x3c7c7d);})[_0x4546('0x22')](function(_0x3fabf0){_0x480d8e[_0x4546('0x42')]=_0x3fabf0;return _0x480d8e;})[_0x4546('0x22')](respondWithFilteredResult(_0x5af997,_0x3c7c7d))[_0x4546('0x43')](handleError(_0x5af997,null));};exports['show']=function(_0x270f59,_0x1dd5b0){var _0x3510e0={'raw':!![],'where':{'id':_0x270f59[_0x4546('0x44')]['id']}},_0x35b51e={};_0x35b51e[_0x4546('0x2e')]=_[_0x4546('0x30')](db[_0x4546('0x2a')][_0x4546('0x2b')]);_0x35b51e[_0x4546('0x2f')]=_[_0x4546('0x30')](_0x270f59['query']);_0x35b51e[_0x4546('0x38')]=_[_0x4546('0x31')](_0x35b51e['model'],_0x35b51e[_0x4546('0x2f')]);_0x3510e0[_0x4546('0x32')]=_[_0x4546('0x31')](_0x35b51e['model'],qs[_0x4546('0x33')](_0x270f59[_0x4546('0x2f')][_0x4546('0x33')]));_0x3510e0[_0x4546('0x32')]=_0x3510e0[_0x4546('0x32')][_0x4546('0x34')]?_0x3510e0[_0x4546('0x32')]:_0x35b51e[_0x4546('0x2e')];if(_0x270f59[_0x4546('0x2f')][_0x4546('0x3f')]){_0x3510e0['include']=[{'all':!![]}];}_0x3510e0=_[_0x4546('0x3d')]({},_0x3510e0,_0x270f59[_0x4546('0x3e')]);return db['ContactItemType'][_0x4546('0x45')](_0x3510e0)[_0x4546('0x22')](handleEntityNotFound(_0x1dd5b0,null))[_0x4546('0x22')](respondWithResult(_0x1dd5b0,null))[_0x4546('0x43')](handleError(_0x1dd5b0,null));};exports['create']=function(_0x329566,_0x57bb39){return db[_0x4546('0x2a')][_0x4546('0x46')](_0x329566[_0x4546('0x47')],{})['then'](function(_0x118a36){var _0x3dc9a9=_0x329566[_0x4546('0x48')][_0x4546('0x23')]({'plain':!![]});if(!_0x3dc9a9)throw new Error(_0x4546('0x49'));if(_0x3dc9a9[_0x4546('0x4a')]===_0x4546('0x48')){var _0x325181=_0x118a36[_0x4546('0x23')]({'plain':!![]});var _0x369dc3=_0x4546('0x24');return db['UserProfileSection'][_0x4546('0x45')]({'where':{'name':_0x369dc3,'userProfileId':_0x3dc9a9[_0x4546('0x4b')]},'raw':!![]})['then'](function(_0x50da6e){if(_0x50da6e&&_0x50da6e[_0x4546('0x4c')]===0x0){return db[_0x4546('0x4d')]['create']({'name':_0x325181[_0x4546('0x28')],'resourceId':_0x325181['id'],'type':_0x50da6e[_0x4546('0x28')],'sectionId':_0x50da6e['id']},{})[_0x4546('0x22')](function(){return _0x118a36;});}else{return _0x118a36;}})[_0x4546('0x43')](function(_0x10dfd6){logger[_0x4546('0x4e')](_0x4546('0x4f'),_0x10dfd6);throw _0x10dfd6;});}return _0x118a36;})[_0x4546('0x22')](respondWithResult(_0x57bb39,0xc9))[_0x4546('0x43')](handleError(_0x57bb39,null));};exports[_0x4546('0x21')]=function(_0x14f5a3,_0x198c5d){if(_0x14f5a3[_0x4546('0x47')]['id']){delete _0x14f5a3[_0x4546('0x47')]['id'];}return db[_0x4546('0x2a')][_0x4546('0x45')]({'where':{'id':_0x14f5a3['params']['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x198c5d,null))[_0x4546('0x22')](saveUpdates(_0x14f5a3['body'],null))[_0x4546('0x22')](respondWithResult(_0x198c5d,null))[_0x4546('0x43')](handleError(_0x198c5d,null));};exports[_0x4546('0x25')]=function(_0x30e748,_0x5e2094){return db[_0x4546('0x2a')][_0x4546('0x45')]({'where':{'id':_0x30e748[_0x4546('0x44')]['id']}})[_0x4546('0x22')](handleEntityNotFound(_0x5e2094,null))[_0x4546('0x22')](db[_0x4546('0x50')][_0x4546('0x21')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x30e748[_0x4546('0x44')]['id']}}))[_0x4546('0x22')](removeEntity(_0x5e2094,null))[_0x4546('0x43')](handleError(_0x5e2094,null));};
\ No newline at end of file
+var _0x2032=['limit','count','set','Content-Range','apply','save','then','destroy','get','ContactItemTypes','sendStatus','error','stack','name','send','index','map','ContactItemType','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x11d2a2,_0x15abec){var _0x7d6d26=function(_0x34975b){while(--_0x34975b){_0x11d2a2['push'](_0x11d2a2['shift']());}};_0x7d6d26(++_0x15abec);}(_0x2032,0xd9));var _0x2203=function(_0x328104,_0x1ab674){_0x328104=_0x328104-0x0;var _0x33a60c=_0x2032[_0x328104];return _0x33a60c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){var _0x1244f4=_0x2718f5[_0x2203('0x25')]({'plain':!![]});var _0x49c12=_0x2203('0x26');return db['UserProfileResource'][_0x2203('0x24')]({'where':{'type':_0x49c12,'resourceId':_0x1244f4['id']}})[_0x2203('0x23')](function(){return _0x2718f5;});})[_0x2203('0x23')](function(){_0x5c8da9['status'](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x1cec17,_0x5c5fd3){return function(_0xd6e109){if(!_0xd6e109){_0x1cec17[_0x2203('0x27')](0x194);}return _0xd6e109;};}function handleError(_0x1c6a77,_0x46b8b9){_0x46b8b9=_0x46b8b9||0x1f4;return function(_0x28ae02){logger[_0x2203('0x28')](_0x28ae02[_0x2203('0x29')]);if(_0x28ae02['name']){delete _0x28ae02[_0x2203('0x2a')];}_0x1c6a77[_0x2203('0x19')](_0x46b8b9)[_0x2203('0x2b')](_0x28ae02);};}exports[_0x2203('0x2c')]=function(_0x52a426,_0x3a8e23){var _0x21ff0d={},_0x287c95={},_0xf59954={'count':0x0,'rows':[]};var _0x520602=_[_0x2203('0x2d')](db[_0x2203('0x2e')]['rawAttributes'],function(_0x5c0157){return{'name':_0x5c0157[_0x2203('0x2f')],'type':_0x5c0157['type']['key']};});_0x287c95[_0x2203('0x30')]=_[_0x2203('0x2d')](_0x520602,_0x2203('0x2a'));_0x287c95[_0x2203('0x31')]=_[_0x2203('0x32')](_0x52a426['query']);_0x287c95[_0x2203('0x33')]=_[_0x2203('0x34')](_0x287c95['model'],_0x287c95[_0x2203('0x31')]);_0x21ff0d[_0x2203('0x35')]=_[_0x2203('0x34')](_0x287c95[_0x2203('0x30')],qs[_0x2203('0x36')](_0x52a426[_0x2203('0x31')][_0x2203('0x36')]));_0x21ff0d[_0x2203('0x35')]=_0x21ff0d[_0x2203('0x35')]['length']?_0x21ff0d[_0x2203('0x35')]:_0x287c95[_0x2203('0x30')];if(!_0x52a426['query']['hasOwnProperty'](_0x2203('0x37'))){_0x21ff0d['limit']=qs[_0x2203('0x1d')](_0x52a426[_0x2203('0x31')][_0x2203('0x1d')]);_0x21ff0d['offset']=qs['offset'](_0x52a426[_0x2203('0x31')]['offset']);}_0x21ff0d[_0x2203('0x38')]=qs['sort'](_0x52a426[_0x2203('0x31')]['sort']);_0x21ff0d[_0x2203('0x39')]=qs[_0x2203('0x33')](_[_0x2203('0x3a')](_0x52a426[_0x2203('0x31')],_0x287c95[_0x2203('0x33')]),_0x520602);if(_0x52a426['query']['filter']){_0x21ff0d['where']=_[_0x2203('0x3b')](_0x21ff0d[_0x2203('0x39')],{'$or':_[_0x2203('0x2d')](_0x520602,function(_0x3b0c7a){if(_0x3b0c7a[_0x2203('0x3c')]!==_0x2203('0x3d')){var _0x1c7e3d={};_0x1c7e3d[_0x3b0c7a['name']]={'$like':'%'+_0x52a426[_0x2203('0x31')][_0x2203('0x3e')]+'%'};return _0x1c7e3d;}})});}_0x21ff0d=_[_0x2203('0x3b')]({},_0x21ff0d,_0x52a426[_0x2203('0x3f')]);var _0x493d12={'where':_0x21ff0d['where']};return db[_0x2203('0x2e')]['count'](_0x493d12)[_0x2203('0x23')](function(_0x446209){_0xf59954[_0x2203('0x1e')]=_0x446209;if(_0x52a426['query']['includeAll']){_0x21ff0d[_0x2203('0x40')]=[{'all':!![]}];}return db[_0x2203('0x2e')][_0x2203('0x41')](_0x21ff0d);})[_0x2203('0x23')](function(_0x372709){_0xf59954[_0x2203('0x42')]=_0x372709;return _0xf59954;})['then'](respondWithFilteredResult(_0x3a8e23,_0x21ff0d))[_0x2203('0x43')](handleError(_0x3a8e23,null));};exports[_0x2203('0x44')]=function(_0x3a866c,_0x266076){var _0x16b452={'raw':!![],'where':{'id':_0x3a866c[_0x2203('0x45')]['id']}},_0x36b99f={};_0x36b99f[_0x2203('0x30')]=_[_0x2203('0x32')](db[_0x2203('0x2e')]['rawAttributes']);_0x36b99f[_0x2203('0x31')]=_[_0x2203('0x32')](_0x3a866c[_0x2203('0x31')]);_0x36b99f[_0x2203('0x33')]=_['intersection'](_0x36b99f['model'],_0x36b99f[_0x2203('0x31')]);_0x16b452['attributes']=_[_0x2203('0x34')](_0x36b99f[_0x2203('0x30')],qs[_0x2203('0x36')](_0x3a866c[_0x2203('0x31')]['fields']));_0x16b452[_0x2203('0x35')]=_0x16b452[_0x2203('0x35')]['length']?_0x16b452[_0x2203('0x35')]:_0x36b99f[_0x2203('0x30')];if(_0x3a866c[_0x2203('0x31')][_0x2203('0x46')]){_0x16b452['include']=[{'all':!![]}];}_0x16b452=_['merge']({},_0x16b452,_0x3a866c[_0x2203('0x3f')]);return db['ContactItemType']['find'](_0x16b452)[_0x2203('0x23')](handleEntityNotFound(_0x266076,null))[_0x2203('0x23')](respondWithResult(_0x266076,null))[_0x2203('0x43')](handleError(_0x266076,null));};exports['create']=function(_0x4c1496,_0x131aec){return db[_0x2203('0x2e')][_0x2203('0x47')](_0x4c1496[_0x2203('0x48')],{})[_0x2203('0x23')](function(_0x21fd78){var _0x4a7f4e=_0x4c1496[_0x2203('0x49')]['get']({'plain':!![]});if(!_0x4a7f4e)throw new Error(_0x2203('0x4a'));if(_0x4a7f4e[_0x2203('0x4b')]===_0x2203('0x49')){var _0x1e49dd=_0x21fd78['get']({'plain':!![]});var _0x506795=_0x2203('0x26');return db[_0x2203('0x4c')][_0x2203('0x4d')]({'where':{'name':_0x506795,'userProfileId':_0x4a7f4e[_0x2203('0x4e')]},'raw':!![]})['then'](function(_0x4de47a){if(_0x4de47a&&_0x4de47a['autoAssociation']===0x0){return db[_0x2203('0x4f')][_0x2203('0x47')]({'name':_0x1e49dd['name'],'resourceId':_0x1e49dd['id'],'type':_0x4de47a[_0x2203('0x2a')],'sectionId':_0x4de47a['id']},{})[_0x2203('0x23')](function(){return _0x21fd78;});}else{return _0x21fd78;}})['catch'](function(_0x32b1db){logger[_0x2203('0x28')](_0x2203('0x50'),_0x32b1db);throw _0x32b1db;});}return _0x21fd78;})[_0x2203('0x23')](respondWithResult(_0x131aec,0xc9))['catch'](handleError(_0x131aec,null));};exports[_0x2203('0x51')]=function(_0x5268d6,_0x3858f0){if(_0x5268d6[_0x2203('0x48')]['id']){delete _0x5268d6['body']['id'];}return db[_0x2203('0x2e')][_0x2203('0x4d')]({'where':{'id':_0x5268d6[_0x2203('0x45')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x3858f0,null))[_0x2203('0x23')](saveUpdates(_0x5268d6[_0x2203('0x48')],null))['then'](respondWithResult(_0x3858f0,null))['catch'](handleError(_0x3858f0,null));};exports[_0x2203('0x24')]=function(_0x524356,_0x56e881){return db[_0x2203('0x2e')][_0x2203('0x4d')]({'where':{'id':_0x524356[_0x2203('0x45')]['id']}})['then'](handleEntityNotFound(_0x56e881,null))[_0x2203('0x23')](db['CmContactHasItem']['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x524356[_0x2203('0x45')]['id']}}))['then'](removeEntity(_0x56e881,null))['catch'](handleError(_0x56e881,null));};
\ No newline at end of file
index 3893104..c5cd183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcef6=['ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./contactItemType.attributes','exports','define'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0xcef6,0x16e));var _0x6cef=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0xcef6[_0x2c9b79];return _0x265032;};'use strict';var _=require(_0x6cef('0x0'));var util=require(_0x6cef('0x1'));var logger=require(_0x6cef('0x2'))(_0x6cef('0x3'));var moment=require(_0x6cef('0x4'));var BPromise=require(_0x6cef('0x5'));var rp=require(_0x6cef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6cef('0x7'));var attributes=require(_0x6cef('0x8'));module[_0x6cef('0x9')]=function(_0x22227e,_0x26c08b){return _0x22227e[_0x6cef('0xa')](_0x6cef('0xb'),attributes,{'tableName':_0x6cef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9b83=['rimraf','../../config/environment','exports','define','ContactItemType','tools_contact_item_types','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x340e88,_0xefa352){var _0x1642f9=function(_0x397d8c){while(--_0x397d8c){_0x340e88['push'](_0x340e88['shift']());}};_0x1642f9(++_0xefa352);}(_0x9b83,0x84));var _0x39b8=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x9b83[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x39b8('0x0'));var util=require(_0x39b8('0x1'));var logger=require(_0x39b8('0x2'))(_0x39b8('0x3'));var moment=require(_0x39b8('0x4'));var BPromise=require(_0x39b8('0x5'));var rp=require(_0x39b8('0x6'));var fs=require('fs');var path=require(_0x39b8('0x7'));var rimraf=require(_0x39b8('0x8'));var config=require(_0x39b8('0x9'));var attributes=require('./contactItemType.attributes');module[_0x39b8('0xa')]=function(_0x4a8ff8,_0x563fe1){return _0x4a8ff8[_0x39b8('0xb')](_0x39b8('0xc'),attributes,{'tableName':_0x39b8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f1e383..4e62395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba1=['result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfba1,0x1e5));var _0x1fba=function(_0x5bf2b6,_0xd8b37a){_0x5bf2b6=_0x5bf2b6-0x0;var _0x102b1a=_0xfba1[_0x5bf2b6];return _0x102b1a;};'use strict';var _=require('lodash');var util=require(_0x1fba('0x0'));var moment=require('moment');var BPromise=require(_0x1fba('0x1'));var rs=require(_0x1fba('0x2'));var fs=require('fs');var Redis=require(_0x1fba('0x3'));var db=require(_0x1fba('0x4'))['db'];var utils=require(_0x1fba('0x5'));var logger=require(_0x1fba('0x6'))('rpc');var config=require(_0x1fba('0x7'));var jayson=require(_0x1fba('0x8'));var client=jayson['client'][_0x1fba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18811b,_0x1c710d,_0x5e38f5){return new BPromise(function(_0x15eb48,_0x4f5c0e){return client[_0x1fba('0xa')](_0x18811b,_0x5e38f5)[_0x1fba('0xb')](function(_0x31d989){logger['info']('ContactItemType,\x20%s,\x20%s',_0x1c710d,_0x1fba('0xc'));logger[_0x1fba('0xd')](_0x1fba('0xe'),_0x1c710d,'request\x20sent',JSON[_0x1fba('0xf')](_0x31d989));if(_0x31d989[_0x1fba('0x10')]){if(_0x31d989[_0x1fba('0x10')][_0x1fba('0x11')]===0x1f4){logger[_0x1fba('0x10')](_0x1fba('0x12'),_0x1c710d,_0x31d989[_0x1fba('0x10')][_0x1fba('0x13')]);return _0x4f5c0e(_0x31d989[_0x1fba('0x10')][_0x1fba('0x13')]);}logger[_0x1fba('0x10')]('ContactItemType,\x20%s,\x20%s',_0x1c710d,_0x31d989[_0x1fba('0x10')][_0x1fba('0x13')]);return _0x15eb48(_0x31d989[_0x1fba('0x10')]['message']);}else{logger[_0x1fba('0x14')](_0x1fba('0x12'),_0x1c710d,_0x1fba('0xc'));_0x15eb48(_0x31d989[_0x1fba('0x15')][_0x1fba('0x13')]);}})[_0x1fba('0x16')](function(_0x8fb2c0){logger[_0x1fba('0x10')]('ContactItemType,\x20%s,\x20%s',_0x1c710d,_0x8fb2c0);_0x4f5c0e(_0x8fb2c0);});});}
\ No newline at end of file
+var _0xea28=['rpc','../../config/environment','jayson/promise','http','request','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1f7e25,_0x3321e2){var _0x26c32f=function(_0x2086e4){while(--_0x2086e4){_0x1f7e25['push'](_0x1f7e25['shift']());}};_0x26c32f(++_0x3321e2);}(_0xea28,0x13a));var _0x8ea2=function(_0x418527,_0x432932){_0x418527=_0x418527-0x0;var _0x49bb68=_0xea28[_0x418527];return _0x49bb68;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('ContactItemType,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}
\ No newline at end of file
index 7a20e71..55f8985 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2629=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x283b3c,_0x3b4675){var _0x1dbb38=function(_0x40134f){while(--_0x40134f){_0x283b3c['push'](_0x283b3c['shift']());}};_0x1dbb38(++_0x3b4675);}(_0x2629,0x88));var _0x9262=function(_0x5460df,_0x33d87b){_0x5460df=_0x5460df-0x0;var _0x246990=_0x2629[_0x5460df];return _0x246990;};'use strict';var multer=require(_0x9262('0x0'));var util=require(_0x9262('0x1'));var path=require(_0x9262('0x2'));var timeout=require(_0x9262('0x3'));var express=require('express');var router=express[_0x9262('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9262('0x5'));var interaction=require(_0x9262('0x6'));var config=require(_0x9262('0x7'));var controller=require(_0x9262('0x8'));router[_0x9262('0x9')]('/',auth[_0x9262('0xa')](),controller[_0x9262('0xb')]);router[_0x9262('0x9')](_0x9262('0xc'),auth[_0x9262('0xa')](),controller[_0x9262('0xd')]);router[_0x9262('0xe')]('/',auth[_0x9262('0xa')](),controller[_0x9262('0xf')]);router[_0x9262('0x10')]('/:id',auth[_0x9262('0xa')](),controller[_0x9262('0x11')]);router[_0x9262('0x12')](_0x9262('0xc'),auth['isAuthenticated'](),controller[_0x9262('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x01a3=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./contactItemType.controller','get'];(function(_0x22b86b,_0x14f499){var _0x4d51b6=function(_0x23ffc8){while(--_0x23ffc8){_0x22b86b['push'](_0x22b86b['shift']());}};_0x4d51b6(++_0x14f499);}(_0x01a3,0x82));var _0x301a=function(_0xc84120,_0x46ad5b){_0xc84120=_0xc84120-0x0;var _0x4be770=_0x01a3[_0xc84120];return _0x4be770;};'use strict';var multer=require(_0x301a('0x0'));var util=require(_0x301a('0x1'));var path=require(_0x301a('0x2'));var timeout=require(_0x301a('0x3'));var express=require(_0x301a('0x4'));var router=express[_0x301a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x301a('0x6'));var config=require(_0x301a('0x7'));var controller=require(_0x301a('0x8'));router[_0x301a('0x9')]('/',auth[_0x301a('0xa')](),controller[_0x301a('0xb')]);router[_0x301a('0x9')](_0x301a('0xc'),auth[_0x301a('0xa')](),controller[_0x301a('0xd')]);router[_0x301a('0xe')]('/',auth[_0x301a('0xa')](),controller[_0x301a('0xf')]);router['put'](_0x301a('0xc'),auth[_0x301a('0xa')](),controller[_0x301a('0x10')]);router[_0x301a('0x11')](_0x301a('0xc'),auth[_0x301a('0xa')](),controller[_0x301a('0x12')]);module[_0x301a('0x13')]=router;
\ No newline at end of file
index bd644df..1bcd6cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['STRING','name'];(function(_0x541d02,_0x6c8fd9){var _0x5afb72=function(_0x1fa5f2){while(--_0x1fa5f2){_0x541d02['push'](_0x541d02['shift']());}};_0x5afb72(++_0x6c8fd9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
+var _0xb10b=['name','sequelize','STRING'];(function(_0x4d1a46,_0x120f45){var _0x4559cc=function(_0x3adc60){while(--_0x3adc60){_0x4d1a46['push'](_0x4d1a46['shift']());}};_0x4559cc(++_0x120f45);}(_0xb10b,0x12a));var _0xbb10=function(_0x6d0143,_0x3d7c30){_0x6d0143=_0x6d0143-0x0;var _0x29cb75=_0xb10b[_0x6d0143];return _0x29cb75;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index cff02bd..e426f01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ae9=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','getItems','findOne','DashboardItem','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Dashboard','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','attrUrl','attrs','https://','custom','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x39f56d,_0x1fdfc1){var _0x3f6f62=function(_0x3ec689){while(--_0x3ec689){_0x39f56d['push'](_0x39f56d['shift']());}};_0x3f6f62(++_0x1fdfc1);}(_0x4ae9,0x92));var _0x94ae=function(_0x2a9490,_0x43cb5f){_0x2a9490=_0x2a9490-0x0;var _0x5bf90e=_0x4ae9[_0x2a9490];return _0x5bf90e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x94ae('0x0'));var zipdir=require(_0x94ae('0x1'));var jsonpatch=require(_0x94ae('0x2'));var rp=require(_0x94ae('0x3'));var moment=require('moment');var BPromise=require(_0x94ae('0x4'));var Mustache=require(_0x94ae('0x5'));var util=require('util');var path=require(_0x94ae('0x6'));var sox=require(_0x94ae('0x7'));var csv=require(_0x94ae('0x8'));var ejs=require(_0x94ae('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x94ae('0xa'));var squel=require(_0x94ae('0xb'));var crypto=require('crypto');var jsforce=require(_0x94ae('0xc'));var deskjs=require(_0x94ae('0xd'));var toCsv=require(_0x94ae('0x8'));var querystring=require(_0x94ae('0xe'));var Papa=require(_0x94ae('0xf'));var Redis=require(_0x94ae('0x10'));var authService=require(_0x94ae('0x11'));var qs=require(_0x94ae('0x12'));var as=require(_0x94ae('0x13'));var hardwareService=require(_0x94ae('0x14'));var logger=require(_0x94ae('0x15'))('api');var utils=require(_0x94ae('0x16'));var config=require(_0x94ae('0x17'));var licenseUtil=require(_0x94ae('0x18'));var db=require('../../mysqldb')['db'];config[_0x94ae('0x19')]=_['defaults'](config[_0x94ae('0x19')],{'host':_0x94ae('0x1a'),'port':0x18eb});var socket=require(_0x94ae('0x1b'))(new Redis(config[_0x94ae('0x19')]));require(_0x94ae('0x1c'))[_0x94ae('0x1d')](socket);function respondWithStatusCode(_0x56dcf3,_0x4f82e4){_0x4f82e4=_0x4f82e4||0xcc;return function(_0x445ff0){if(_0x445ff0){return _0x56dcf3[_0x94ae('0x1e')](_0x4f82e4);}return _0x56dcf3[_0x94ae('0x1f')](_0x4f82e4)[_0x94ae('0x20')]();};}function respondWithResult(_0x5ca4c7,_0x4aff36){_0x4aff36=_0x4aff36||0xc8;return function(_0x3a3491){if(_0x3a3491){return _0x5ca4c7['status'](_0x4aff36)[_0x94ae('0x21')](_0x3a3491);}};}function respondWithFilteredResult(_0x8abb4c,_0x3c7bbd){return function(_0x35d666){if(_0x35d666){var _0x12b7e6=typeof _0x3c7bbd['offset']===_0x94ae('0x22')&&typeof _0x3c7bbd[_0x94ae('0x23')]===_0x94ae('0x22');var _0x2c862f=_0x35d666[_0x94ae('0x24')];var _0x2e38c9=_0x12b7e6?0x0:_0x3c7bbd[_0x94ae('0x25')];var _0x4ca268=_0x12b7e6?_0x35d666[_0x94ae('0x24')]:_0x3c7bbd[_0x94ae('0x25')]+_0x3c7bbd[_0x94ae('0x23')];var _0x1e076f;if(_0x4ca268>=_0x2c862f){_0x4ca268=_0x2c862f;_0x1e076f=0xc8;}else{_0x1e076f=0xce;}_0x8abb4c[_0x94ae('0x1f')](_0x1e076f);return _0x8abb4c['set'](_0x94ae('0x26'),_0x2e38c9+'-'+_0x4ca268+'/'+_0x2c862f)[_0x94ae('0x21')](_0x35d666);}return null;};}function patchUpdates(_0x44e17c){return function(_0x2384b6){try{jsonpatch[_0x94ae('0x27')](_0x2384b6,_0x44e17c,!![]);}catch(_0x1f1126){return BPromise[_0x94ae('0x28')](_0x1f1126);}return _0x2384b6['save']();};}function saveUpdates(_0x3b493c,_0x1d6b94){return function(_0x4ae81d){if(_0x4ae81d){return _0x4ae81d[_0x94ae('0x29')](_0x3b493c)[_0x94ae('0x2a')](function(_0x47c1a1){return _0x47c1a1;});}return null;};}function removeEntity(_0x1f301a,_0x54ce21){return function(_0x5403a8){if(_0x5403a8){return _0x5403a8[_0x94ae('0x2b')]()[_0x94ae('0x2a')](function(){var _0x346ae5=_0x5403a8[_0x94ae('0x2c')]({'plain':!![]});var _0x251c7e='CustomDashboards';return db[_0x94ae('0x2d')][_0x94ae('0x2b')]({'where':{'type':_0x251c7e,'resourceId':_0x346ae5['id']}})[_0x94ae('0x2a')](function(){return _0x5403a8;});})[_0x94ae('0x2a')](function(){_0x1f301a[_0x94ae('0x1f')](0xcc)[_0x94ae('0x20')]();});}};}function handleEntityNotFound(_0x1a0a4b,_0x232aea){return function(_0x4acc85){if(!_0x4acc85){_0x1a0a4b['sendStatus'](0x194);}return _0x4acc85;};}function handleError(_0x2b851d,_0x31ec8e){_0x31ec8e=_0x31ec8e||0x1f4;return function(_0x1b8e53){logger[_0x94ae('0x2e')](_0x1b8e53[_0x94ae('0x2f')]);if(_0x1b8e53[_0x94ae('0x30')]){delete _0x1b8e53[_0x94ae('0x30')];}_0x2b851d[_0x94ae('0x1f')](_0x31ec8e)[_0x94ae('0x31')](_0x1b8e53);};}exports['index']=function(_0x481d62,_0x1300f6){var _0x49dd52={},_0x2e4731={},_0xebb7ff={'count':0x0,'rows':[]};var _0x361eb9=_[_0x94ae('0x32')](db[_0x94ae('0x33')][_0x94ae('0x34')],function(_0x183723){return{'name':_0x183723['fieldName'],'type':_0x183723[_0x94ae('0x35')][_0x94ae('0x36')]};});_0x2e4731[_0x94ae('0x37')]=_[_0x94ae('0x32')](_0x361eb9,_0x94ae('0x30'));_0x2e4731['query']=_[_0x94ae('0x38')](_0x481d62[_0x94ae('0x39')]);_0x2e4731[_0x94ae('0x3a')]=_[_0x94ae('0x3b')](_0x2e4731['model'],_0x2e4731[_0x94ae('0x39')]);_0x49dd52[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x2e4731[_0x94ae('0x37')],qs[_0x94ae('0x3d')](_0x481d62['query'][_0x94ae('0x3d')]));_0x49dd52[_0x94ae('0x3c')]=_0x49dd52['attributes'][_0x94ae('0x3e')]?_0x49dd52[_0x94ae('0x3c')]:_0x2e4731['model'];if(!_0x481d62[_0x94ae('0x39')][_0x94ae('0x3f')](_0x94ae('0x40'))){_0x49dd52[_0x94ae('0x23')]=qs[_0x94ae('0x23')](_0x481d62['query']['limit']);_0x49dd52[_0x94ae('0x25')]=qs[_0x94ae('0x25')](_0x481d62[_0x94ae('0x39')]['offset']);}_0x49dd52[_0x94ae('0x41')]=qs['sort'](_0x481d62[_0x94ae('0x39')][_0x94ae('0x42')]);_0x49dd52[_0x94ae('0x43')]=qs[_0x94ae('0x3a')](_[_0x94ae('0x44')](_0x481d62['query'],_0x2e4731['filters']),_0x361eb9);if(_0x481d62[_0x94ae('0x39')][_0x94ae('0x45')]){_0x49dd52[_0x94ae('0x43')]=_['merge'](_0x49dd52[_0x94ae('0x43')],{'$or':_[_0x94ae('0x32')](_0x361eb9,function(_0x280b08){if(_0x280b08[_0x94ae('0x35')]!=='VIRTUAL'){var _0x38997a={};_0x38997a[_0x280b08[_0x94ae('0x30')]]={'$like':'%'+_0x481d62[_0x94ae('0x39')][_0x94ae('0x45')]+'%'};return _0x38997a;}})});}_0x49dd52=_[_0x94ae('0x46')]({},_0x49dd52,_0x481d62[_0x94ae('0x47')]);var _0x1bc83c={'where':_0x49dd52['where']};return db[_0x94ae('0x33')][_0x94ae('0x24')](_0x1bc83c)[_0x94ae('0x2a')](function(_0x40c1a6){_0xebb7ff[_0x94ae('0x24')]=_0x40c1a6;if(_0x481d62[_0x94ae('0x39')][_0x94ae('0x48')]){_0x49dd52['include']=[{'all':!![]}];}return db[_0x94ae('0x33')][_0x94ae('0x49')](_0x49dd52);})[_0x94ae('0x2a')](function(_0x463ea2){_0xebb7ff[_0x94ae('0x4a')]=_0x463ea2;return _0xebb7ff;})['then'](respondWithFilteredResult(_0x1300f6,_0x49dd52))[_0x94ae('0x4b')](handleError(_0x1300f6,null));};exports[_0x94ae('0x4c')]=function(_0x2aa1e5,_0x51361e){var _0x241928={'raw':![],'where':{'id':_0x2aa1e5[_0x94ae('0x4d')]['id']}},_0x1fdf79={};_0x1fdf79['model']=_[_0x94ae('0x38')](db[_0x94ae('0x33')][_0x94ae('0x34')]);_0x1fdf79[_0x94ae('0x39')]=_[_0x94ae('0x38')](_0x2aa1e5[_0x94ae('0x39')]);_0x1fdf79[_0x94ae('0x3a')]=_[_0x94ae('0x3b')](_0x1fdf79[_0x94ae('0x37')],_0x1fdf79[_0x94ae('0x39')]);_0x241928[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x1fdf79[_0x94ae('0x37')],qs['fields'](_0x2aa1e5[_0x94ae('0x39')]['fields']));_0x241928[_0x94ae('0x3c')]=_0x241928['attributes']['length']?_0x241928['attributes']:_0x1fdf79[_0x94ae('0x37')];if(_0x2aa1e5[_0x94ae('0x39')][_0x94ae('0x48')]){_0x241928[_0x94ae('0x4e')]=[{'all':!![]}];}_0x241928=_[_0x94ae('0x46')]({},_0x241928,_0x2aa1e5[_0x94ae('0x47')]);return db[_0x94ae('0x33')][_0x94ae('0x4f')](_0x241928)[_0x94ae('0x2a')](handleEntityNotFound(_0x51361e,null))[_0x94ae('0x2a')](respondWithResult(_0x51361e,null))['catch'](handleError(_0x51361e,null));};exports[_0x94ae('0x50')]=function(_0x3e5af2,_0x4d57c1){return db['Dashboard'][_0x94ae('0x50')](_0x3e5af2[_0x94ae('0x51')],{})[_0x94ae('0x2a')](function(_0x544a32){var _0x1e04cb=_0x3e5af2[_0x94ae('0x52')]['get']({'plain':!![]});if(!_0x1e04cb)throw new Error(_0x94ae('0x53'));if(_0x1e04cb[_0x94ae('0x54')]===_0x94ae('0x52')){var _0x193287=_0x544a32['get']({'plain':!![]});var _0x473798=_0x94ae('0x55');return db['UserProfileSection'][_0x94ae('0x4f')]({'where':{'name':_0x473798,'userProfileId':_0x1e04cb[_0x94ae('0x56')]},'raw':!![]})[_0x94ae('0x2a')](function(_0x2d6286){if(_0x2d6286&&_0x2d6286[_0x94ae('0x57')]===0x0){return db[_0x94ae('0x2d')][_0x94ae('0x50')]({'name':_0x193287['name'],'resourceId':_0x193287['id'],'type':_0x2d6286[_0x94ae('0x30')],'sectionId':_0x2d6286['id']},{})['then'](function(){return _0x544a32;});}else{return _0x544a32;}})['catch'](function(_0x268d50){logger['error'](_0x94ae('0x58'),_0x268d50);throw _0x268d50;});}return _0x544a32;})[_0x94ae('0x2a')](respondWithResult(_0x4d57c1,0xc9))[_0x94ae('0x4b')](handleError(_0x4d57c1,null));};exports[_0x94ae('0x59')]=function(_0xb14539,_0x24b17d){var _0x33ffe3={'where':{'id':_0xb14539['params']['id']}},_0x5322fb={};_0x5322fb[_0x94ae('0x37')]=_['keys'](db[_0x94ae('0x33')]['rawAttributes']);_0x33ffe3[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x5322fb[_0x94ae('0x37')],qs[_0x94ae('0x3d')](_0xb14539[_0x94ae('0x39')][_0x94ae('0x3d')]));_0x33ffe3[_0x94ae('0x3c')]=_0x33ffe3[_0x94ae('0x3c')][_0x94ae('0x3e')]?_0x33ffe3[_0x94ae('0x3c')]:_0x5322fb[_0x94ae('0x37')];if(_0xb14539[_0x94ae('0x39')][_0x94ae('0x48')]){_0x33ffe3['include']=[{'all':!![]}];}_0x33ffe3=_[_0x94ae('0x46')]({},_0x33ffe3,_0xb14539[_0x94ae('0x47')]);return db[_0x94ae('0x33')]['find'](_0x33ffe3)[_0x94ae('0x2a')](handleEntityNotFound(_0x24b17d,null))[_0x94ae('0x2a')](function(_0x506253){if(_0x506253){var _0x2910af=_0x506253['get']({'plain':!![]});_0x2910af=qs[_0x94ae('0x5a')](_0x2910af,['id',_0x94ae('0x5b'),_0x94ae('0x5c')]);_0xb14539['body']=_[_0x94ae('0x5a')](_0xb14539[_0x94ae('0x51')],['id',_0x94ae('0x5b'),_0x94ae('0x5c')]);return db[_0x94ae('0x33')]['create'](_[_0x94ae('0x46')](_0x2910af,_0xb14539[_0x94ae('0x51')]),{'include':_0xb14539[_0x94ae('0x39')][_0x94ae('0x48')]?[{'all':!![]}]:undefined})[_0x94ae('0x2a')](function(_0x5222e9){var _0x3edc2a=_0xb14539[_0x94ae('0x52')][_0x94ae('0x2c')]({'plain':!![]});if(!_0x3edc2a)throw new Error(_0x94ae('0x53'));if(_0x3edc2a[_0x94ae('0x54')]===_0x94ae('0x52')){var _0x4fbb4b=_0x5222e9[_0x94ae('0x2c')]({'plain':!![]});var _0x7ed1f7=_0x94ae('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x7ed1f7,'userProfileId':_0x3edc2a[_0x94ae('0x56')]},'raw':!![]})[_0x94ae('0x2a')](function(_0x3dc759){if(_0x3dc759&&_0x3dc759[_0x94ae('0x57')]===0x0){return db['UserProfileResource'][_0x94ae('0x50')]({'name':_0x4fbb4b[_0x94ae('0x30')],'resourceId':_0x4fbb4b['id'],'type':_0x3dc759['name'],'sectionId':_0x3dc759['id']},{})[_0x94ae('0x2a')](function(){return _0x5222e9;});}else{return _0x5222e9;}})[_0x94ae('0x4b')](function(_0x3be468){logger[_0x94ae('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3be468);throw _0x3be468;});}return _0x5222e9;});}})[_0x94ae('0x2a')](respondWithResult(_0x24b17d,0xc9))[_0x94ae('0x4b')](handleError(_0x24b17d,null));};exports[_0x94ae('0x29')]=function(_0x1ebc70,_0x5bb741){if(_0x1ebc70[_0x94ae('0x51')]['id']){delete _0x1ebc70[_0x94ae('0x51')]['id'];}return db[_0x94ae('0x33')][_0x94ae('0x4f')]({'where':{'id':_0x1ebc70[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x5bb741,null))['then'](saveUpdates(_0x1ebc70[_0x94ae('0x51')],null))[_0x94ae('0x2a')](respondWithResult(_0x5bb741,null))['catch'](handleError(_0x5bb741,null));};exports[_0x94ae('0x2b')]=function(_0x594db1,_0x4fd837){return db[_0x94ae('0x33')][_0x94ae('0x4f')]({'where':{'id':_0x594db1[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x4fd837,null))[_0x94ae('0x2a')](removeEntity(_0x4fd837,null))[_0x94ae('0x4b')](handleError(_0x4fd837,null));};function widgetAttributes(_0x58332e){try{switch(_0x58332e[_0x94ae('0x35')]){case'iframe':return[{'name':'attrUrl','value':_0x58332e[_0x94ae('0x5d')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0]['value']:undefined)||_0x94ae('0x5f')}];case _0x94ae('0x60'):return[{'name':_0x94ae('0x61'),'value':_0x58332e[_0x94ae('0x61')]||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0][_0x94ae('0x62')]:undefined)||''}];case _0x94ae('0x63'):return[{'name':'attrHourFormat','value':_0x58332e['attrHourFormat']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0][_0x94ae('0x62')]:undefined)||_0x94ae('0x64')},{'name':'attrTimezone','value':_0x58332e[_0x94ae('0x65')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e['attrs'][0x1]?_0x58332e[_0x94ae('0x5e')][0x1]['value']:undefined)||_0x94ae('0x66')},{'name':'attrFontSize','value':_0x58332e[_0x94ae('0x67')]||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x2]?_0x58332e['attrs'][0x2]['value']:undefined)||0xc}];case _0x94ae('0x68'):return[{'name':'attrMetric','value':_0x58332e[_0x94ae('0x69')]||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e['attrs'][0x0]['value']:undefined)||_0x94ae('0x6a')},{'name':'attrVoiceQueues','value':_0x58332e[_0x94ae('0x6b')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e['attrs'][0x1]?_0x58332e[_0x94ae('0x5e')][0x1]['value']:undefined)||[]},{'name':_0x94ae('0x67'),'value':_0x58332e['attrFontSize']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x2]?_0x58332e['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x94ae('0x6c'),'value':_0x58332e[_0x94ae('0x6c')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x3]?_0x58332e[_0x94ae('0x5e')][0x3][_0x94ae('0x62')]:undefined)||_0x94ae('0x6d')},{'name':_0x94ae('0x6e'),'value':_0x58332e['attrEmailAccounts']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x4]?_0x58332e[_0x94ae('0x5e')][0x4][_0x94ae('0x62')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x58332e[_0x94ae('0x6f')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x5]?_0x58332e['attrs'][0x5][_0x94ae('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x58332e[_0x94ae('0x70')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x6]?_0x58332e['attrs'][0x6][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x71'),'value':_0x58332e['attrOpenchannelAccounts']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x7]?_0x58332e[_0x94ae('0x5e')][0x7][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x72'),'value':_0x58332e['attrWhatsappAccounts']||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x8]?_0x58332e[_0x94ae('0x5e')][0x8][_0x94ae('0x62')]:undefined)||''},{'name':'attrChatWebsites','value':_0x58332e[_0x94ae('0x73')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x9]?_0x58332e[_0x94ae('0x5e')][0x9][_0x94ae('0x62')]:undefined)||''}];case _0x94ae('0x74'):case _0x94ae('0x75'):return[{'name':'attrSerie1','value':_0x58332e[_0x94ae('0x76')]||(_0x58332e['attrs']&&_0x58332e['attrs'][0x0]?_0x58332e['attrs'][0x0]['value']:undefined)||_0x94ae('0x6a')},{'name':_0x94ae('0x77'),'value':_0x58332e[_0x94ae('0x77')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x1]?_0x58332e[_0x94ae('0x5e')][0x1]['value']:undefined)||null},{'name':_0x94ae('0x78'),'value':_0x58332e[_0x94ae('0x78')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x2]?_0x58332e[_0x94ae('0x5e')][0x2][_0x94ae('0x62')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x58332e[_0x94ae('0x6b')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x3]?_0x58332e['attrs'][0x3]['value']:undefined)||[]},{'name':_0x94ae('0x6c'),'value':_0x58332e[_0x94ae('0x6c')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x4]?_0x58332e[_0x94ae('0x5e')][0x4][_0x94ae('0x62')]:undefined)||_0x94ae('0x6d')},{'name':_0x94ae('0x6e'),'value':_0x58332e[_0x94ae('0x6e')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x5]?_0x58332e['attrs'][0x5][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x6f'),'value':_0x58332e[_0x94ae('0x6f')]||(_0x58332e['attrs']&&_0x58332e['attrs'][0x6]?_0x58332e[_0x94ae('0x5e')][0x6][_0x94ae('0x62')]:undefined)||''},{'name':_0x94ae('0x70'),'value':_0x58332e[_0x94ae('0x70')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e['attrs'][0x7]?_0x58332e[_0x94ae('0x5e')][0x7][_0x94ae('0x62')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x58332e[_0x94ae('0x71')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x8]?_0x58332e[_0x94ae('0x5e')][0x8][_0x94ae('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x58332e[_0x94ae('0x72')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x9]?_0x58332e[_0x94ae('0x5e')][0x9]['value']:undefined)||''},{'name':_0x94ae('0x73'),'value':_0x58332e[_0x94ae('0x73')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0xa]?_0x58332e[_0x94ae('0x5e')][0xa][_0x94ae('0x62')]:undefined)||''}];case _0x94ae('0x79'):return[{'name':'attrReport','type':_0x58332e[_0x94ae('0x7a')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e[_0x94ae('0x5e')][0x0][_0x94ae('0x35')]:undefined)||null,'value':_0x58332e['attrReport']||(_0x58332e['attrs']&&_0x58332e[_0x94ae('0x5e')][0x0]?_0x58332e['attrs'][0x0]['value']:undefined)||null},{'name':_0x94ae('0x7b'),'value':_0x58332e[_0x94ae('0x7b')]||(_0x58332e[_0x94ae('0x5e')]&&_0x58332e[_0x94ae('0x5e')][0x1]?_0x58332e[_0x94ae('0x5e')][0x1][_0x94ae('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x120a01){logger[_0x94ae('0x2e')](_0x94ae('0x7c'),JSON['stringify'](_0x120a01));return[];}}exports[_0x94ae('0x7d')]=function(_0x51ec00,_0x220c80,_0x23174e){if(_0x51ec00[_0x94ae('0x51')]['id']){delete _0x51ec00[_0x94ae('0x51')]['id'];}return db['Dashboard'][_0x94ae('0x4f')]({'where':{'id':_0x51ec00[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x220c80,null))[_0x94ae('0x2a')](function(_0x98eed3){if(_0x98eed3){_0x51ec00[_0x94ae('0x51')][_0x94ae('0x7e')]=_0x98eed3['id'];_0x51ec00[_0x94ae('0x51')][_0x94ae('0x5e')]=widgetAttributes(_0x51ec00[_0x94ae('0x51')]);return db['DashboardItem'][_0x94ae('0x50')](_0x51ec00[_0x94ae('0x51')]);}})[_0x94ae('0x2a')](respondWithResult(_0x220c80,null))[_0x94ae('0x4b')](handleError(_0x220c80,null));};exports[_0x94ae('0x7f')]=function(_0x5f1fed,_0x55afbf,_0x2e6b56){var _0x3b0f38={};var _0x7b17f0={};var _0x458c2c;var _0x52044e;return db['Dashboard'][_0x94ae('0x80')]({'where':{'id':_0x5f1fed[_0x94ae('0x4d')]['id']}})[_0x94ae('0x2a')](handleEntityNotFound(_0x55afbf,null))[_0x94ae('0x2a')](function(_0x5a8637){if(_0x5a8637){_0x458c2c=_0x5a8637;_0x7b17f0[_0x94ae('0x37')]=_[_0x94ae('0x38')](db[_0x94ae('0x81')][_0x94ae('0x34')]);_0x7b17f0['query']=_['keys'](_0x5f1fed[_0x94ae('0x39')]);_0x7b17f0[_0x94ae('0x3a')]=_['intersection'](_0x7b17f0[_0x94ae('0x37')],_0x7b17f0[_0x94ae('0x39')]);_0x3b0f38[_0x94ae('0x3c')]=_[_0x94ae('0x3b')](_0x7b17f0['model'],qs['fields'](_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x3d')]));_0x3b0f38[_0x94ae('0x3c')]=_0x3b0f38[_0x94ae('0x3c')][_0x94ae('0x3e')]?_0x3b0f38['attributes']:_0x7b17f0[_0x94ae('0x37')];_0x3b0f38[_0x94ae('0x41')]=qs[_0x94ae('0x42')](_0x5f1fed['query'][_0x94ae('0x42')]);_0x3b0f38[_0x94ae('0x43')]=qs[_0x94ae('0x3a')](_['pick'](_0x5f1fed[_0x94ae('0x39')],_0x7b17f0[_0x94ae('0x3a')]));if(_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x45')]){_0x3b0f38[_0x94ae('0x43')]=_[_0x94ae('0x46')](_0x3b0f38[_0x94ae('0x43')],{'$or':_[_0x94ae('0x32')](_0x3b0f38[_0x94ae('0x3c')],function(_0x2cacbc){var _0x1294c6={};_0x1294c6[_0x2cacbc]={'$like':'%'+_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x45')]+'%'};return _0x1294c6;})});}_0x3b0f38=_[_0x94ae('0x46')]({},_0x3b0f38,_0x5f1fed[_0x94ae('0x47')]);return _0x458c2c[_0x94ae('0x7f')](_0x3b0f38);}})[_0x94ae('0x2a')](function(_0x380d64){if(_0x380d64){_0x52044e=_0x380d64[_0x94ae('0x3e')];if(!_0x5f1fed[_0x94ae('0x39')]['hasOwnProperty'](_0x94ae('0x40'))){_0x3b0f38[_0x94ae('0x23')]=qs['limit'](_0x5f1fed[_0x94ae('0x39')]['limit']);_0x3b0f38['offset']=qs[_0x94ae('0x25')](_0x5f1fed[_0x94ae('0x39')][_0x94ae('0x25')]);}return _0x458c2c['getItems'](_0x3b0f38);}})[_0x94ae('0x2a')](function(_0x3ac769){if(_0x3ac769){return _0x3ac769?{'count':_0x52044e,'rows':_0x3ac769}:null;}})['then'](respondWithResult(_0x55afbf,null))[_0x94ae('0x4b')](handleError(_0x55afbf,null));};
\ No newline at end of file
+var _0xc9d3=['path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','./dashboard.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','CustomDashboards','error','stack','send','map','Dashboard','rawAttributes','fieldName','type','model','name','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','UserProfileSection','UserProfileResource','iframe','attrUrl','attrs','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x40ded9,_0x4c9e4a){var _0x413b82=function(_0x50db8f){while(--_0x50db8f){_0x40ded9['push'](_0x40ded9['shift']());}};_0x413b82(++_0x4c9e4a);}(_0xc9d3,0xf3));var _0x3c9d=function(_0x5be24b,_0x5872e5){_0x5be24b=_0x5be24b-0x0;var _0x4fedc6=_0xc9d3[_0x5be24b];return _0x4fedc6;};'use strict';var emlformat=require(_0x3c9d('0x0'));var rimraf=require(_0x3c9d('0x1'));var zipdir=require(_0x3c9d('0x2'));var jsonpatch=require(_0x3c9d('0x3'));var rp=require(_0x3c9d('0x4'));var moment=require(_0x3c9d('0x5'));var BPromise=require(_0x3c9d('0x6'));var Mustache=require(_0x3c9d('0x7'));var util=require(_0x3c9d('0x8'));var path=require(_0x3c9d('0x9'));var sox=require('sox');var csv=require(_0x3c9d('0xa'));var ejs=require(_0x3c9d('0xb'));var fs=require('fs');var fs_extra=require(_0x3c9d('0xc'));var _=require('lodash');var squel=require(_0x3c9d('0xd'));var crypto=require(_0x3c9d('0xe'));var jsforce=require(_0x3c9d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3c9d('0xa'));var querystring=require(_0x3c9d('0x10'));var Papa=require(_0x3c9d('0x11'));var Redis=require(_0x3c9d('0x12'));var authService=require(_0x3c9d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9d('0x14'));var hardwareService=require(_0x3c9d('0x15'));var logger=require(_0x3c9d('0x16'))(_0x3c9d('0x17'));var utils=require('../../config/utils');var config=require(_0x3c9d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3c9d('0x19')]=_[_0x3c9d('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c9d('0x19')]));require(_0x3c9d('0x1b'))[_0x3c9d('0x1c')](socket);function respondWithStatusCode(_0x557405,_0x639d2c){_0x639d2c=_0x639d2c||0xcc;return function(_0x36766b){if(_0x36766b){return _0x557405[_0x3c9d('0x1d')](_0x639d2c);}return _0x557405[_0x3c9d('0x1e')](_0x639d2c)[_0x3c9d('0x1f')]();};}function respondWithResult(_0xfa39ed,_0x227abe){_0x227abe=_0x227abe||0xc8;return function(_0x326d73){if(_0x326d73){return _0xfa39ed[_0x3c9d('0x1e')](_0x227abe)[_0x3c9d('0x20')](_0x326d73);}};}function respondWithFilteredResult(_0x1ef323,_0x18b310){return function(_0x4ece8f){if(_0x4ece8f){var _0x330018=typeof _0x18b310['offset']===_0x3c9d('0x21')&&typeof _0x18b310[_0x3c9d('0x22')]==='undefined';var _0x26cea8=_0x4ece8f[_0x3c9d('0x23')];var _0x334155=_0x330018?0x0:_0x18b310[_0x3c9d('0x24')];var _0x3b0563=_0x330018?_0x4ece8f[_0x3c9d('0x23')]:_0x18b310[_0x3c9d('0x24')]+_0x18b310[_0x3c9d('0x22')];var _0x5b3e4f;if(_0x3b0563>=_0x26cea8){_0x3b0563=_0x26cea8;_0x5b3e4f=0xc8;}else{_0x5b3e4f=0xce;}_0x1ef323[_0x3c9d('0x1e')](_0x5b3e4f);return _0x1ef323['set']('Content-Range',_0x334155+'-'+_0x3b0563+'/'+_0x26cea8)['json'](_0x4ece8f);}return null;};}function patchUpdates(_0x5f2318){return function(_0x54e115){try{jsonpatch[_0x3c9d('0x25')](_0x54e115,_0x5f2318,!![]);}catch(_0x58d533){return BPromise[_0x3c9d('0x26')](_0x58d533);}return _0x54e115[_0x3c9d('0x27')]();};}function saveUpdates(_0x483d79,_0x40a2e2){return function(_0x323ed8){if(_0x323ed8){return _0x323ed8[_0x3c9d('0x28')](_0x483d79)[_0x3c9d('0x29')](function(_0x3d7fda){return _0x3d7fda;});}return null;};}function removeEntity(_0x5985f8,_0x9c2d90){return function(_0x512ac1){if(_0x512ac1){return _0x512ac1[_0x3c9d('0x2a')]()[_0x3c9d('0x29')](function(){var _0x334e0b=_0x512ac1['get']({'plain':!![]});var _0xe4cde5=_0x3c9d('0x2b');return db['UserProfileResource'][_0x3c9d('0x2a')]({'where':{'type':_0xe4cde5,'resourceId':_0x334e0b['id']}})['then'](function(){return _0x512ac1;});})['then'](function(){_0x5985f8['status'](0xcc)[_0x3c9d('0x1f')]();});}};}function handleEntityNotFound(_0x1a7c91,_0x12003c){return function(_0x2a56ac){if(!_0x2a56ac){_0x1a7c91['sendStatus'](0x194);}return _0x2a56ac;};}function handleError(_0x487ba8,_0x4f7025){_0x4f7025=_0x4f7025||0x1f4;return function(_0x3758de){logger[_0x3c9d('0x2c')](_0x3758de[_0x3c9d('0x2d')]);if(_0x3758de['name']){delete _0x3758de['name'];}_0x487ba8[_0x3c9d('0x1e')](_0x4f7025)[_0x3c9d('0x2e')](_0x3758de);};}exports['index']=function(_0x1def01,_0x115277){var _0x4a0ea2={},_0x4e1bcd={},_0x313bc2={'count':0x0,'rows':[]};var _0x5eb537=_[_0x3c9d('0x2f')](db[_0x3c9d('0x30')][_0x3c9d('0x31')],function(_0xb1b233){return{'name':_0xb1b233[_0x3c9d('0x32')],'type':_0xb1b233[_0x3c9d('0x33')]['key']};});_0x4e1bcd[_0x3c9d('0x34')]=_[_0x3c9d('0x2f')](_0x5eb537,_0x3c9d('0x35'));_0x4e1bcd[_0x3c9d('0x36')]=_[_0x3c9d('0x37')](_0x1def01[_0x3c9d('0x36')]);_0x4e1bcd['filters']=_['intersection'](_0x4e1bcd['model'],_0x4e1bcd[_0x3c9d('0x36')]);_0x4a0ea2[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x4e1bcd[_0x3c9d('0x34')],qs[_0x3c9d('0x3a')](_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x3a')]));_0x4a0ea2[_0x3c9d('0x38')]=_0x4a0ea2[_0x3c9d('0x38')][_0x3c9d('0x3b')]?_0x4a0ea2[_0x3c9d('0x38')]:_0x4e1bcd['model'];if(!_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x3c')](_0x3c9d('0x3d'))){_0x4a0ea2[_0x3c9d('0x22')]=qs[_0x3c9d('0x22')](_0x1def01['query'][_0x3c9d('0x22')]);_0x4a0ea2[_0x3c9d('0x24')]=qs['offset'](_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x24')]);}_0x4a0ea2[_0x3c9d('0x3e')]=qs[_0x3c9d('0x3f')](_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x3f')]);_0x4a0ea2['where']=qs[_0x3c9d('0x40')](_[_0x3c9d('0x41')](_0x1def01[_0x3c9d('0x36')],_0x4e1bcd[_0x3c9d('0x40')]),_0x5eb537);if(_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x42')]){_0x4a0ea2[_0x3c9d('0x43')]=_[_0x3c9d('0x44')](_0x4a0ea2[_0x3c9d('0x43')],{'$or':_['map'](_0x5eb537,function(_0x553a5c){if(_0x553a5c[_0x3c9d('0x33')]!==_0x3c9d('0x45')){var _0x494fae={};_0x494fae[_0x553a5c['name']]={'$like':'%'+_0x1def01[_0x3c9d('0x36')]['filter']+'%'};return _0x494fae;}})});}_0x4a0ea2=_[_0x3c9d('0x44')]({},_0x4a0ea2,_0x1def01[_0x3c9d('0x46')]);var _0x22a6db={'where':_0x4a0ea2['where']};return db[_0x3c9d('0x30')][_0x3c9d('0x23')](_0x22a6db)['then'](function(_0x4a8cdf){_0x313bc2[_0x3c9d('0x23')]=_0x4a8cdf;if(_0x1def01[_0x3c9d('0x36')][_0x3c9d('0x47')]){_0x4a0ea2[_0x3c9d('0x48')]=[{'all':!![]}];}return db[_0x3c9d('0x30')][_0x3c9d('0x49')](_0x4a0ea2);})[_0x3c9d('0x29')](function(_0x4aad03){_0x313bc2[_0x3c9d('0x4a')]=_0x4aad03;return _0x313bc2;})[_0x3c9d('0x29')](respondWithFilteredResult(_0x115277,_0x4a0ea2))[_0x3c9d('0x4b')](handleError(_0x115277,null));};exports['show']=function(_0x49c5f6,_0x4140f1){var _0x112cd5={'raw':![],'where':{'id':_0x49c5f6[_0x3c9d('0x4c')]['id']}},_0x1419bf={};_0x1419bf[_0x3c9d('0x34')]=_[_0x3c9d('0x37')](db[_0x3c9d('0x30')][_0x3c9d('0x31')]);_0x1419bf[_0x3c9d('0x36')]=_[_0x3c9d('0x37')](_0x49c5f6[_0x3c9d('0x36')]);_0x1419bf[_0x3c9d('0x40')]=_[_0x3c9d('0x39')](_0x1419bf[_0x3c9d('0x34')],_0x1419bf[_0x3c9d('0x36')]);_0x112cd5[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x1419bf[_0x3c9d('0x34')],qs[_0x3c9d('0x3a')](_0x49c5f6[_0x3c9d('0x36')][_0x3c9d('0x3a')]));_0x112cd5[_0x3c9d('0x38')]=_0x112cd5['attributes']['length']?_0x112cd5[_0x3c9d('0x38')]:_0x1419bf[_0x3c9d('0x34')];if(_0x49c5f6[_0x3c9d('0x36')]['includeAll']){_0x112cd5[_0x3c9d('0x48')]=[{'all':!![]}];}_0x112cd5=_[_0x3c9d('0x44')]({},_0x112cd5,_0x49c5f6[_0x3c9d('0x46')]);return db[_0x3c9d('0x30')][_0x3c9d('0x4d')](_0x112cd5)[_0x3c9d('0x29')](handleEntityNotFound(_0x4140f1,null))['then'](respondWithResult(_0x4140f1,null))[_0x3c9d('0x4b')](handleError(_0x4140f1,null));};exports[_0x3c9d('0x4e')]=function(_0x1fdd14,_0x5b7f69){return db['Dashboard'][_0x3c9d('0x4e')](_0x1fdd14[_0x3c9d('0x4f')],{})[_0x3c9d('0x29')](function(_0x3f3b91){var _0x591c08=_0x1fdd14[_0x3c9d('0x50')][_0x3c9d('0x51')]({'plain':!![]});if(!_0x591c08)throw new Error(_0x3c9d('0x52'));if(_0x591c08['role']===_0x3c9d('0x50')){var _0x28fede=_0x3f3b91[_0x3c9d('0x51')]({'plain':!![]});var _0x2c9edf=_0x3c9d('0x2b');return db['UserProfileSection'][_0x3c9d('0x4d')]({'where':{'name':_0x2c9edf,'userProfileId':_0x591c08[_0x3c9d('0x53')]},'raw':!![]})[_0x3c9d('0x29')](function(_0x73fa62){if(_0x73fa62&&_0x73fa62[_0x3c9d('0x54')]===0x0){return db['UserProfileResource'][_0x3c9d('0x4e')]({'name':_0x28fede[_0x3c9d('0x35')],'resourceId':_0x28fede['id'],'type':_0x73fa62[_0x3c9d('0x35')],'sectionId':_0x73fa62['id']},{})[_0x3c9d('0x29')](function(){return _0x3f3b91;});}else{return _0x3f3b91;}})[_0x3c9d('0x4b')](function(_0x2b6ab6){logger['error'](_0x3c9d('0x55'),_0x2b6ab6);throw _0x2b6ab6;});}return _0x3f3b91;})[_0x3c9d('0x29')](respondWithResult(_0x5b7f69,0xc9))['catch'](handleError(_0x5b7f69,null));};exports[_0x3c9d('0x56')]=function(_0x7e6161,_0x48dd53){var _0x10eccc={'where':{'id':_0x7e6161[_0x3c9d('0x4c')]['id']}},_0x24653f={};_0x24653f[_0x3c9d('0x34')]=_[_0x3c9d('0x37')](db[_0x3c9d('0x30')][_0x3c9d('0x31')]);_0x10eccc[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x24653f[_0x3c9d('0x34')],qs[_0x3c9d('0x3a')](_0x7e6161['query'][_0x3c9d('0x3a')]));_0x10eccc[_0x3c9d('0x38')]=_0x10eccc[_0x3c9d('0x38')]['length']?_0x10eccc[_0x3c9d('0x38')]:_0x24653f[_0x3c9d('0x34')];if(_0x7e6161['query'][_0x3c9d('0x47')]){_0x10eccc['include']=[{'all':!![]}];}_0x10eccc=_[_0x3c9d('0x44')]({},_0x10eccc,_0x7e6161[_0x3c9d('0x46')]);return db['Dashboard'][_0x3c9d('0x4d')](_0x10eccc)[_0x3c9d('0x29')](handleEntityNotFound(_0x48dd53,null))[_0x3c9d('0x29')](function(_0x4bcbce){if(_0x4bcbce){var _0x11b8db=_0x4bcbce['get']({'plain':!![]});_0x11b8db=qs['omit'](_0x11b8db,['id',_0x3c9d('0x57'),_0x3c9d('0x58')]);_0x7e6161['body']=_[_0x3c9d('0x59')](_0x7e6161[_0x3c9d('0x4f')],['id',_0x3c9d('0x57'),_0x3c9d('0x58')]);return db[_0x3c9d('0x30')][_0x3c9d('0x4e')](_['merge'](_0x11b8db,_0x7e6161['body']),{'include':_0x7e6161[_0x3c9d('0x36')][_0x3c9d('0x47')]?[{'all':!![]}]:undefined})[_0x3c9d('0x29')](function(_0x3e85c9){var _0x42b8ad=_0x7e6161['user'][_0x3c9d('0x51')]({'plain':!![]});if(!_0x42b8ad)throw new Error(_0x3c9d('0x52'));if(_0x42b8ad['role']===_0x3c9d('0x50')){var _0x34b8d3=_0x3e85c9[_0x3c9d('0x51')]({'plain':!![]});var _0x367a12='CustomDashboards';return db[_0x3c9d('0x5a')][_0x3c9d('0x4d')]({'where':{'name':_0x367a12,'userProfileId':_0x42b8ad[_0x3c9d('0x53')]},'raw':!![]})['then'](function(_0x29bcef){if(_0x29bcef&&_0x29bcef[_0x3c9d('0x54')]===0x0){return db[_0x3c9d('0x5b')]['create']({'name':_0x34b8d3[_0x3c9d('0x35')],'resourceId':_0x34b8d3['id'],'type':_0x29bcef['name'],'sectionId':_0x29bcef['id']},{})[_0x3c9d('0x29')](function(){return _0x3e85c9;});}else{return _0x3e85c9;}})['catch'](function(_0x5c1d57){logger['error'](_0x3c9d('0x55'),_0x5c1d57);throw _0x5c1d57;});}return _0x3e85c9;});}})[_0x3c9d('0x29')](respondWithResult(_0x48dd53,0xc9))[_0x3c9d('0x4b')](handleError(_0x48dd53,null));};exports[_0x3c9d('0x28')]=function(_0x247b8a,_0x3142a3){if(_0x247b8a[_0x3c9d('0x4f')]['id']){delete _0x247b8a[_0x3c9d('0x4f')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x247b8a['params']['id']}})['then'](handleEntityNotFound(_0x3142a3,null))[_0x3c9d('0x29')](saveUpdates(_0x247b8a['body'],null))['then'](respondWithResult(_0x3142a3,null))[_0x3c9d('0x4b')](handleError(_0x3142a3,null));};exports[_0x3c9d('0x2a')]=function(_0xedef6,_0x565c4e){return db[_0x3c9d('0x30')]['find']({'where':{'id':_0xedef6[_0x3c9d('0x4c')]['id']}})[_0x3c9d('0x29')](handleEntityNotFound(_0x565c4e,null))[_0x3c9d('0x29')](removeEntity(_0x565c4e,null))[_0x3c9d('0x4b')](handleError(_0x565c4e,null));};function widgetAttributes(_0x1c9f13){try{switch(_0x1c9f13[_0x3c9d('0x33')]){case _0x3c9d('0x5c'):return[{'name':_0x3c9d('0x5d'),'value':_0x1c9f13['attrUrl']||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13['attrs'][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0x3c9d('0x5f'),'value':_0x1c9f13[_0x3c9d('0x5f')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13[_0x3c9d('0x5e')][0x0]['value']:undefined)||''}];case _0x3c9d('0x60'):return[{'name':_0x3c9d('0x61'),'value':_0x1c9f13[_0x3c9d('0x61')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13[_0x3c9d('0x5e')][0x0][_0x3c9d('0x62')]:undefined)||_0x3c9d('0x63')},{'name':'attrTimezone','value':_0x1c9f13[_0x3c9d('0x64')]||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||'0.00'},{'name':_0x3c9d('0x65'),'value':_0x1c9f13[_0x3c9d('0x65')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x2]?_0x1c9f13['attrs'][0x2][_0x3c9d('0x62')]:undefined)||0xc}];case _0x3c9d('0x66'):return[{'name':'attrMetric','value':_0x1c9f13[_0x3c9d('0x67')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x0]?_0x1c9f13[_0x3c9d('0x5e')][0x0]['value']:undefined)||_0x3c9d('0x68')},{'name':_0x3c9d('0x69'),'value':_0x1c9f13['attrVoiceQueues']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||[]},{'name':_0x3c9d('0x65'),'value':_0x1c9f13['attrFontSize']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x2]?_0x1c9f13['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x3c9d('0x6a'),'value':_0x1c9f13[_0x3c9d('0x6a')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x3]?_0x1c9f13[_0x3c9d('0x5e')][0x3][_0x3c9d('0x62')]:undefined)||_0x3c9d('0x6b')},{'name':_0x3c9d('0x6c'),'value':_0x1c9f13[_0x3c9d('0x6c')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x4]?_0x1c9f13[_0x3c9d('0x5e')][0x4][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6d'),'value':_0x1c9f13[_0x3c9d('0x6d')]||(_0x1c9f13['attrs']&&_0x1c9f13['attrs'][0x5]?_0x1c9f13['attrs'][0x5][_0x3c9d('0x62')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x1c9f13[_0x3c9d('0x6e')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x6]?_0x1c9f13['attrs'][0x6][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6f'),'value':_0x1c9f13[_0x3c9d('0x6f')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x7]?_0x1c9f13['attrs'][0x7][_0x3c9d('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1c9f13[_0x3c9d('0x70')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x8]?_0x1c9f13['attrs'][0x8][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x71'),'value':_0x1c9f13[_0x3c9d('0x71')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x9]?_0x1c9f13[_0x3c9d('0x5e')][0x9][_0x3c9d('0x62')]:undefined)||''}];case _0x3c9d('0x72'):case _0x3c9d('0x73'):return[{'name':_0x3c9d('0x74'),'value':_0x1c9f13[_0x3c9d('0x74')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x0]?_0x1c9f13['attrs'][0x0]['value']:undefined)||_0x3c9d('0x68')},{'name':_0x3c9d('0x75'),'value':_0x1c9f13[_0x3c9d('0x75')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||null},{'name':_0x3c9d('0x76'),'value':_0x1c9f13[_0x3c9d('0x76')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x2]?_0x1c9f13[_0x3c9d('0x5e')][0x2][_0x3c9d('0x62')]:undefined)||null},{'name':_0x3c9d('0x69'),'value':_0x1c9f13[_0x3c9d('0x69')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13['attrs'][0x3]?_0x1c9f13[_0x3c9d('0x5e')][0x3]['value']:undefined)||[]},{'name':'attrChannel','value':_0x1c9f13[_0x3c9d('0x6a')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x4]?_0x1c9f13[_0x3c9d('0x5e')][0x4]['value']:undefined)||_0x3c9d('0x6b')},{'name':_0x3c9d('0x6c'),'value':_0x1c9f13[_0x3c9d('0x6c')]||(_0x1c9f13['attrs']&&_0x1c9f13['attrs'][0x5]?_0x1c9f13[_0x3c9d('0x5e')][0x5][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6d'),'value':_0x1c9f13[_0x3c9d('0x6d')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x6]?_0x1c9f13[_0x3c9d('0x5e')][0x6][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x6e'),'value':_0x1c9f13[_0x3c9d('0x6e')]||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0x7]?_0x1c9f13[_0x3c9d('0x5e')][0x7]['value']:undefined)||''},{'name':_0x3c9d('0x6f'),'value':_0x1c9f13['attrOpenchannelAccounts']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x8]?_0x1c9f13[_0x3c9d('0x5e')][0x8][_0x3c9d('0x62')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x1c9f13[_0x3c9d('0x70')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x9]?_0x1c9f13[_0x3c9d('0x5e')][0x9][_0x3c9d('0x62')]:undefined)||''},{'name':_0x3c9d('0x71'),'value':_0x1c9f13[_0x3c9d('0x71')]||(_0x1c9f13['attrs']&&_0x1c9f13[_0x3c9d('0x5e')][0xa]?_0x1c9f13[_0x3c9d('0x5e')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x3c9d('0x77'),'type':_0x1c9f13['reportType']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13['attrs'][0x0][_0x3c9d('0x33')]:undefined)||null,'value':_0x1c9f13[_0x3c9d('0x77')]||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x0]?_0x1c9f13['attrs'][0x0][_0x3c9d('0x62')]:undefined)||null},{'name':'attrRefresh','value':_0x1c9f13['attrRefresh']||(_0x1c9f13[_0x3c9d('0x5e')]&&_0x1c9f13[_0x3c9d('0x5e')][0x1]?_0x1c9f13[_0x3c9d('0x5e')][0x1][_0x3c9d('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x2df255){logger['error'](_0x3c9d('0x78'),JSON[_0x3c9d('0x79')](_0x2df255));return[];}}exports[_0x3c9d('0x7a')]=function(_0x31e421,_0x49fc10,_0x1dcc4b){if(_0x31e421[_0x3c9d('0x4f')]['id']){delete _0x31e421[_0x3c9d('0x4f')]['id'];}return db[_0x3c9d('0x30')][_0x3c9d('0x4d')]({'where':{'id':_0x31e421[_0x3c9d('0x4c')]['id']}})[_0x3c9d('0x29')](handleEntityNotFound(_0x49fc10,null))[_0x3c9d('0x29')](function(_0x3a3d3a){if(_0x3a3d3a){_0x31e421[_0x3c9d('0x4f')][_0x3c9d('0x7b')]=_0x3a3d3a['id'];_0x31e421['body'][_0x3c9d('0x5e')]=widgetAttributes(_0x31e421['body']);return db[_0x3c9d('0x7c')][_0x3c9d('0x4e')](_0x31e421['body']);}})[_0x3c9d('0x29')](respondWithResult(_0x49fc10,null))[_0x3c9d('0x4b')](handleError(_0x49fc10,null));};exports[_0x3c9d('0x7d')]=function(_0x1e9df7,_0x4339fa,_0x311833){var _0x54e82a={};var _0x52e76d={};var _0x1f320a;var _0x54696c;return db[_0x3c9d('0x30')]['findOne']({'where':{'id':_0x1e9df7[_0x3c9d('0x4c')]['id']}})[_0x3c9d('0x29')](handleEntityNotFound(_0x4339fa,null))[_0x3c9d('0x29')](function(_0x1e6173){if(_0x1e6173){_0x1f320a=_0x1e6173;_0x52e76d[_0x3c9d('0x34')]=_[_0x3c9d('0x37')](db['DashboardItem']['rawAttributes']);_0x52e76d[_0x3c9d('0x36')]=_[_0x3c9d('0x37')](_0x1e9df7[_0x3c9d('0x36')]);_0x52e76d[_0x3c9d('0x40')]=_['intersection'](_0x52e76d[_0x3c9d('0x34')],_0x52e76d['query']);_0x54e82a[_0x3c9d('0x38')]=_[_0x3c9d('0x39')](_0x52e76d[_0x3c9d('0x34')],qs['fields'](_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x3a')]));_0x54e82a[_0x3c9d('0x38')]=_0x54e82a[_0x3c9d('0x38')][_0x3c9d('0x3b')]?_0x54e82a[_0x3c9d('0x38')]:_0x52e76d[_0x3c9d('0x34')];_0x54e82a[_0x3c9d('0x3e')]=qs['sort'](_0x1e9df7['query'][_0x3c9d('0x3f')]);_0x54e82a[_0x3c9d('0x43')]=qs[_0x3c9d('0x40')](_['pick'](_0x1e9df7[_0x3c9d('0x36')],_0x52e76d['filters']));if(_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x42')]){_0x54e82a[_0x3c9d('0x43')]=_[_0x3c9d('0x44')](_0x54e82a['where'],{'$or':_['map'](_0x54e82a[_0x3c9d('0x38')],function(_0x3f7759){var _0x3fe799={};_0x3fe799[_0x3f7759]={'$like':'%'+_0x1e9df7['query']['filter']+'%'};return _0x3fe799;})});}_0x54e82a=_[_0x3c9d('0x44')]({},_0x54e82a,_0x1e9df7[_0x3c9d('0x46')]);return _0x1f320a[_0x3c9d('0x7d')](_0x54e82a);}})[_0x3c9d('0x29')](function(_0x35a253){if(_0x35a253){_0x54696c=_0x35a253[_0x3c9d('0x3b')];if(!_0x1e9df7['query']['hasOwnProperty'](_0x3c9d('0x3d'))){_0x54e82a[_0x3c9d('0x22')]=qs[_0x3c9d('0x22')](_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x22')]);_0x54e82a['offset']=qs['offset'](_0x1e9df7[_0x3c9d('0x36')][_0x3c9d('0x24')]);}return _0x1f320a[_0x3c9d('0x7d')](_0x54e82a);}})[_0x3c9d('0x29')](function(_0xbc105b){if(_0xbc105b){return _0xbc105b?{'count':_0x54696c,'rows':_0xbc105b}:null;}})[_0x3c9d('0x29')](respondWithResult(_0x4339fa,null))[_0x3c9d('0x4b')](handleError(_0x4339fa,null));};
\ No newline at end of file
index 4b49632..83a3bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d78=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x0d78,0x134));var _0x80d7=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0x0d78[_0x5b27da];return _0x3254f4;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x80d7('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0x80d7('0x1'),'afterDestroy':_0x80d7('0x2')};function emitEvent(_0xdce367){return function(_0x27b4b7,_0x5b96f3,_0x27dd1c){DashboardEvents['emit'](_0xdce367+':'+_0x27b4b7['id'],_0x27b4b7);DashboardEvents[_0x80d7('0x3')](_0xdce367,_0x27b4b7);_0x27dd1c(null);};}for(var e in events){if(events[_0x80d7('0x4')](e)){var event=events[e];Dashboard[_0x80d7('0x5')](e,emitEvent(event));}}module[_0x80d7('0x6')]=DashboardEvents;
\ No newline at end of file
+var _0xabac=['emit','hasOwnProperty','exports','events','../../mysqldb','Dashboard'];(function(_0x4fa438,_0x1f15a7){var _0x4e3958=function(_0x28f510){while(--_0x28f510){_0x4fa438['push'](_0x4fa438['shift']());}};_0x4e3958(++_0x1f15a7);}(_0xabac,0x1dd));var _0xcaba=function(_0x1a1de1,_0x6938a6){_0x1a1de1=_0x1a1de1-0x0;var _0x170706=_0xabac[_0x1a1de1];return _0x170706;};'use strict';var EventEmitter=require(_0xcaba('0x0'));var Dashboard=require(_0xcaba('0x1'))['db'][_0xcaba('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b0c48){return function(_0x4676f3,_0x1c169f,_0x4ee126){DashboardEvents[_0xcaba('0x3')](_0x2b0c48+':'+_0x4676f3['id'],_0x4676f3);DashboardEvents[_0xcaba('0x3')](_0x2b0c48,_0x4676f3);_0x4ee126(null);};}for(var e in events){if(events[_0xcaba('0x4')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xcaba('0x5')]=DashboardEvents;
\ No newline at end of file
index 662f71b..f0ff431 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf408=['define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf408,0x199));var _0x8f40=function(_0x18032f,_0x4f4e45){_0x18032f=_0x18032f-0x0;var _0xb0b2b8=_0xf408[_0x18032f];return _0xb0b2b8;};'use strict';var _=require(_0x8f40('0x0'));var util=require(_0x8f40('0x1'));var logger=require(_0x8f40('0x2'))('api');var moment=require(_0x8f40('0x3'));var BPromise=require(_0x8f40('0x4'));var rp=require(_0x8f40('0x5'));var fs=require('fs');var path=require(_0x8f40('0x6'));var rimraf=require(_0x8f40('0x7'));var config=require(_0x8f40('0x8'));var attributes=require(_0x8f40('0x9'));module[_0x8f40('0xa')]=function(_0x188ff8,_0x15def3){return _0x188ff8[_0x8f40('0xb')](_0x8f40('0xc'),attributes,{'tableName':_0x8f40('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e8f=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','util','api','bluebird'];(function(_0x48d45e,_0x568691){var _0x419141=function(_0x1d60b6){while(--_0x1d60b6){_0x48d45e['push'](_0x48d45e['shift']());}};_0x419141(++_0x568691);}(_0x0e8f,0x1c5));var _0xf0e8=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x0e8f[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0xf0e8('0x0'));var logger=require('../../config/logger')(_0xf0e8('0x1'));var moment=require('moment');var BPromise=require(_0xf0e8('0x2'));var rp=require(_0xf0e8('0x3'));var fs=require('fs');var path=require(_0xf0e8('0x4'));var rimraf=require(_0xf0e8('0x5'));var config=require(_0xf0e8('0x6'));var attributes=require(_0xf0e8('0x7'));module[_0xf0e8('0x8')]=function(_0x286af9,_0x28df36){return _0x286af9[_0xf0e8('0x9')](_0xf0e8('0xa'),attributes,{'tableName':_0xf0e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b02ef55..f86af06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6a7=['randomstring','../../config/logger','rpc','jayson/promise','client','defaults','localhost','redis','./dashboard.socket','register','request','then','info','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','util','bluebird'];(function(_0x1fb41c,_0xe78a53){var _0x1b88cf=function(_0x2cfbb8){while(--_0x2cfbb8){_0x1fb41c['push'](_0x1fb41c['shift']());}};_0x1b88cf(++_0xe78a53);}(_0xa6a7,0x1d9));var _0x7a6a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa6a7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x7a6a('0x0'));var moment=require('moment');var BPromise=require(_0x7a6a('0x1'));var rs=require(_0x7a6a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7a6a('0x3'))(_0x7a6a('0x4'));var config=require('../../config/environment');var jayson=require(_0x7a6a('0x5'));var client=jayson[_0x7a6a('0x6')]['http']({'port':0x232a});config['redis']=_[_0x7a6a('0x7')](config['redis'],{'host':_0x7a6a('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a6a('0x9')]));require(_0x7a6a('0xa'))[_0x7a6a('0xb')](socket);function respondWithRpcPromise(_0x44c85b,_0x1fdc89,_0x530e3f){return new BPromise(function(_0x19c99c,_0xfe679b){return client[_0x7a6a('0xc')](_0x44c85b,_0x530e3f)[_0x7a6a('0xd')](function(_0x367c52){logger[_0x7a6a('0xe')]('Dashboard,\x20%s,\x20%s',_0x1fdc89,'request\x20sent');logger[_0x7a6a('0xf')](_0x7a6a('0x10'),_0x1fdc89,_0x7a6a('0x11'),JSON[_0x7a6a('0x12')](_0x367c52));if(_0x367c52[_0x7a6a('0x13')]){if(_0x367c52[_0x7a6a('0x13')][_0x7a6a('0x14')]===0x1f4){logger[_0x7a6a('0x13')](_0x7a6a('0x15'),_0x1fdc89,_0x367c52[_0x7a6a('0x13')][_0x7a6a('0x16')]);return _0xfe679b(_0x367c52[_0x7a6a('0x13')]['message']);}logger[_0x7a6a('0x13')]('Dashboard,\x20%s,\x20%s',_0x1fdc89,_0x367c52[_0x7a6a('0x13')][_0x7a6a('0x16')]);return _0x19c99c(_0x367c52['error'][_0x7a6a('0x16')]);}else{logger[_0x7a6a('0xe')]('Dashboard,\x20%s,\x20%s',_0x1fdc89,_0x7a6a('0x11'));_0x19c99c(_0x367c52[_0x7a6a('0x17')][_0x7a6a('0x16')]);}})[_0x7a6a('0x18')](function(_0x3ee093){logger['error']('Dashboard,\x20%s,\x20%s',_0x1fdc89,_0x3ee093);_0xfe679b(_0x3ee093);});});}
\ No newline at end of file
+var _0x1260=['request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x2b3d8f,_0x545a31){var _0xc44f2e=function(_0x5b0d55){while(--_0x5b0d55){_0x2b3d8f['push'](_0x2b3d8f['shift']());}};_0xc44f2e(++_0x545a31);}(_0x1260,0x15d));var _0x0126=function(_0x4b2645,_0xabae49){_0x4b2645=_0x4b2645-0x0;var _0xdc5f2=_0x1260[_0x4b2645];return _0xdc5f2;};'use strict';var _=require(_0x0126('0x0'));var util=require(_0x0126('0x1'));var moment=require('moment');var BPromise=require(_0x0126('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0126('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0126('0x4'))(_0x0126('0x5'));var config=require(_0x0126('0x6'));var jayson=require(_0x0126('0x7'));var client=jayson['client'][_0x0126('0x8')]({'port':0x232a});config[_0x0126('0x9')]=_[_0x0126('0xa')](config[_0x0126('0x9')],{'host':_0x0126('0xb'),'port':0x18eb});var socket=require(_0x0126('0xc'))(new Redis(config[_0x0126('0x9')]));require(_0x0126('0xd'))[_0x0126('0xe')](socket);function respondWithRpcPromise(_0x39b789,_0x5f4746,_0x4e7693){return new BPromise(function(_0xabc44f,_0x2c87c4){return client[_0x0126('0xf')](_0x39b789,_0x4e7693)[_0x0126('0x10')](function(_0xf4eb12){logger[_0x0126('0x11')](_0x0126('0x12'),_0x5f4746,_0x0126('0x13'));logger[_0x0126('0x14')](_0x0126('0x15'),_0x5f4746,_0x0126('0x13'),JSON[_0x0126('0x16')](_0xf4eb12));if(_0xf4eb12['error']){if(_0xf4eb12[_0x0126('0x17')][_0x0126('0x18')]===0x1f4){logger['error'](_0x0126('0x12'),_0x5f4746,_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);return _0x2c87c4(_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);}logger[_0x0126('0x17')](_0x0126('0x12'),_0x5f4746,_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);return _0xabc44f(_0xf4eb12[_0x0126('0x17')][_0x0126('0x19')]);}else{logger[_0x0126('0x11')](_0x0126('0x12'),_0x5f4746,'request\x20sent');_0xabc44f(_0xf4eb12[_0x0126('0x1a')][_0x0126('0x19')]);}})[_0x0126('0x1b')](function(_0x1a0a5b){logger[_0x0126('0x17')](_0x0126('0x12'),_0x5f4746,_0x1a0a5b);_0x2c87c4(_0x1a0a5b);});});}
\ No newline at end of file
index 384d340..ce45fce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb00=['register','length','dashboard:','./dashboard.events','save','update','emit','removeListener'];(function(_0x334bb4,_0x38360e){var _0x4dfb4c=function(_0x3fb816){while(--_0x3fb816){_0x334bb4['push'](_0x334bb4['shift']());}};_0x4dfb4c(++_0x38360e);}(_0xeb00,0x16b));var _0x0eb0=function(_0xbeaaa3,_0x21b657){_0xbeaaa3=_0xbeaaa3-0x0;var _0x5e6590=_0xeb00[_0xbeaaa3];return _0x5e6590;};'use strict';var DashboardEvents=require(_0x0eb0('0x0'));var events=[_0x0eb0('0x1'),'remove',_0x0eb0('0x2')];function createListener(_0x82c237,_0xfb1823){return function(_0x4138eb){_0xfb1823[_0x0eb0('0x3')](_0x82c237,_0x4138eb);};}function removeListener(_0x54645f,_0x52b6a7){return function(){DashboardEvents[_0x0eb0('0x4')](_0x54645f,_0x52b6a7);};}exports[_0x0eb0('0x5')]=function(_0x56b152){for(var _0x31008a=0x0,_0x27b79a=events[_0x0eb0('0x6')];_0x31008a<_0x27b79a;_0x31008a++){var _0x5b55dc=events[_0x31008a];var _0x4a74e9=createListener(_0x0eb0('0x7')+_0x5b55dc,_0x56b152);DashboardEvents['on'](_0x5b55dc,_0x4a74e9);}};
\ No newline at end of file
+var _0x0732=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register','length'];(function(_0x303663,_0x53f318){var _0x3849bd=function(_0x34d0dc){while(--_0x34d0dc){_0x303663['push'](_0x303663['shift']());}};_0x3849bd(++_0x53f318);}(_0x0732,0x184));var _0x2073=function(_0x2fc2e4,_0xf15e31){_0x2fc2e4=_0x2fc2e4-0x0;var _0x21d7b3=_0x0732[_0x2fc2e4];return _0x21d7b3;};'use strict';var DashboardEvents=require(_0x2073('0x0'));var events=[_0x2073('0x1'),_0x2073('0x2'),_0x2073('0x3')];function createListener(_0x235b4e,_0x329e4a){return function(_0x5b4b25){_0x329e4a[_0x2073('0x4')](_0x235b4e,_0x5b4b25);};}function removeListener(_0x3aeaeb,_0x28266c){return function(){DashboardEvents[_0x2073('0x5')](_0x3aeaeb,_0x28266c);};}exports[_0x2073('0x6')]=function(_0x4525da){for(var _0x22eea5=0x0,_0x317b28=events[_0x2073('0x7')];_0x22eea5<_0x317b28;_0x22eea5++){var _0x283934=events[_0x22eea5];var _0x48504d=createListener(_0x2073('0x8')+_0x283934,_0x4525da);DashboardEvents['on'](_0x283934,_0x48504d);}};
\ No newline at end of file
index fb3f253..957dc81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a44=['show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','/:id'];(function(_0x2327fe,_0x204b47){var _0xfdeeca=function(_0x20c895){while(--_0x20c895){_0x2327fe['push'](_0x2327fe['shift']());}};_0xfdeeca(++_0x204b47);}(_0x6a44,0x183));var _0x46a4=function(_0x54404a,_0x4c3d3b){_0x54404a=_0x54404a-0x0;var _0x259732=_0x6a44[_0x54404a];return _0x259732;};'use strict';var multer=require(_0x46a4('0x0'));var util=require(_0x46a4('0x1'));var path=require(_0x46a4('0x2'));var timeout=require('connect-timeout');var express=require(_0x46a4('0x3'));var router=express[_0x46a4('0x4')]();var fs_extra=require(_0x46a4('0x5'));var auth=require(_0x46a4('0x6'));var interaction=require(_0x46a4('0x7'));var config=require(_0x46a4('0x8'));var controller=require(_0x46a4('0x9'));router['get']('/',auth[_0x46a4('0xa')](),controller[_0x46a4('0xb')]);router['get'](_0x46a4('0xc'),auth[_0x46a4('0xa')](),controller[_0x46a4('0xd')]);router['get'](_0x46a4('0xe'),auth['isAuthenticated'](),controller[_0x46a4('0xf')]);router[_0x46a4('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x46a4('0x11'),auth[_0x46a4('0xa')](),controller[_0x46a4('0x12')]);router[_0x46a4('0x10')](_0x46a4('0xe'),auth[_0x46a4('0xa')](),controller[_0x46a4('0x13')]);router[_0x46a4('0x14')](_0x46a4('0xc'),auth[_0x46a4('0xa')](),controller[_0x46a4('0x15')]);router[_0x46a4('0x16')](_0x46a4('0xc'),auth['isAuthenticated'](),controller[_0x46a4('0x17')]);module[_0x46a4('0x18')]=router;
\ No newline at end of file
+var _0x4940=['/:id/clone','clone','update','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','post','create'];(function(_0x528fb8,_0x14d80c){var _0x3a2a6d=function(_0x1634f2){while(--_0x1634f2){_0x528fb8['push'](_0x528fb8['shift']());}};_0x3a2a6d(++_0x14d80c);}(_0x4940,0x15a));var _0x0494=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4940[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var path=require('path');var timeout=require(_0x0494('0x2'));var express=require('express');var router=express[_0x0494('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0494('0x4'));var interaction=require(_0x0494('0x5'));var config=require(_0x0494('0x6'));var controller=require('./dashboard.controller');router[_0x0494('0x7')]('/',auth[_0x0494('0x8')](),controller[_0x0494('0x9')]);router['get'](_0x0494('0xa'),auth[_0x0494('0x8')](),controller[_0x0494('0xb')]);router['get'](_0x0494('0xc'),auth['isAuthenticated'](),controller['getItems']);router[_0x0494('0xd')]('/',auth[_0x0494('0x8')](),controller[_0x0494('0xe')]);router['post'](_0x0494('0xf'),auth[_0x0494('0x8')](),controller[_0x0494('0x10')]);router[_0x0494('0xd')]('/:id/items',auth[_0x0494('0x8')](),controller['addItem']);router['put'](_0x0494('0xa'),auth[_0x0494('0x8')](),controller[_0x0494('0x11')]);router['delete'](_0x0494('0xa'),auth[_0x0494('0x8')](),controller['destroy']);module[_0x0494('0x12')]=router;
\ No newline at end of file
index 3f245c3..82680dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5496,0x175));var _0x6549=function(_0x42a49f,_0x4901ea){_0x42a49f=_0x42a49f-0x0;var _0x4f2aee=_0x5496[_0x42a49f];return _0x4f2aee;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x71ab=['setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','TEXT','long','parse','getDataValue','attrs'];(function(_0xfd495c,_0x4a3c1a){var _0x561dd8=function(_0x83e915){while(--_0x83e915){_0xfd495c['push'](_0xfd495c['shift']());}};_0x561dd8(++_0x4a3c1a);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xb71a('0x0'));var _=require('lodash');module[_0xb71a('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb71a('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xb71a('0x3')](_0xb71a('0x4')),'get':function(){try{return JSON[_0xb71a('0x5')](this[_0xb71a('0x6')](_0xb71a('0x7')));}catch(_0x2192e8){return[];}},'set':function(_0x38d931){try{this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')](_0x38d931));}catch(_0x2a4c86){this[_0xb71a('0x8')](_0xb71a('0x7'),JSON[_0xb71a('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb71a('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb71a('0xa')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb71a('0x2')],'allowNull':![],'defaultValue':_0xb71a('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xb71a('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
index 674d440..2951227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba0d=['DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice','attrReport','reportType','attrRefresh','error','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','params','model'];(function(_0x38cb77,_0x2ae23e){var _0x2a628c=function(_0x500b78){while(--_0x500b78){_0x38cb77['push'](_0x38cb77['shift']());}};_0x2a628c(++_0x2ae23e);}(_0xba0d,0x8e));var _0xdba0=function(_0x34df72,_0x2bb5f5){_0x34df72=_0x34df72-0x0;var _0x1b0ac6=_0xba0d[_0x34df72];return _0x1b0ac6;};'use strict';var emlformat=require(_0xdba0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdba0('0x1'));var jsonpatch=require(_0xdba0('0x2'));var rp=require(_0xdba0('0x3'));var moment=require('moment');var BPromise=require(_0xdba0('0x4'));var Mustache=require('mustache');var util=require(_0xdba0('0x5'));var path=require(_0xdba0('0x6'));var sox=require(_0xdba0('0x7'));var csv=require(_0xdba0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdba0('0x9'));var squel=require(_0xdba0('0xa'));var crypto=require(_0xdba0('0xb'));var jsforce=require(_0xdba0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdba0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdba0('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xdba0('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdba0('0xf'));var logger=require(_0xdba0('0x10'))(_0xdba0('0x11'));var utils=require(_0xdba0('0x12'));var config=require(_0xdba0('0x13'));var licenseUtil=require(_0xdba0('0x14'));var db=require(_0xdba0('0x15'))['db'];config[_0xdba0('0x16')]=_['defaults'](config['redis'],{'host':_0xdba0('0x17'),'port':0x18eb});var socket=require(_0xdba0('0x18'))(new Redis(config[_0xdba0('0x16')]));require(_0xdba0('0x19'))[_0xdba0('0x1a')](socket);function respondWithStatusCode(_0x28da4c,_0x1077c2){_0x1077c2=_0x1077c2||0xcc;return function(_0x563983){if(_0x563983){return _0x28da4c[_0xdba0('0x1b')](_0x1077c2);}return _0x28da4c[_0xdba0('0x1c')](_0x1077c2)[_0xdba0('0x1d')]();};}function respondWithResult(_0xb0ffc4,_0xd66d92){_0xd66d92=_0xd66d92||0xc8;return function(_0x1aee2d){if(_0x1aee2d){return _0xb0ffc4[_0xdba0('0x1c')](_0xd66d92)[_0xdba0('0x1e')](_0x1aee2d);}};}function respondWithFilteredResult(_0x119c31,_0x167dbc){return function(_0x479a46){if(_0x479a46){var _0x2b75e7=typeof _0x167dbc['offset']===_0xdba0('0x1f')&&typeof _0x167dbc[_0xdba0('0x20')]===_0xdba0('0x1f');var _0x436fff=_0x479a46['count'];var _0x4c954f=_0x2b75e7?0x0:_0x167dbc[_0xdba0('0x21')];var _0x427dea=_0x2b75e7?_0x479a46['count']:_0x167dbc[_0xdba0('0x21')]+_0x167dbc[_0xdba0('0x20')];var _0x907a7a;if(_0x427dea>=_0x436fff){_0x427dea=_0x436fff;_0x907a7a=0xc8;}else{_0x907a7a=0xce;}_0x119c31['status'](_0x907a7a);return _0x119c31[_0xdba0('0x22')](_0xdba0('0x23'),_0x4c954f+'-'+_0x427dea+'/'+_0x436fff)[_0xdba0('0x1e')](_0x479a46);}return null;};}function patchUpdates(_0x11ded6){return function(_0x2fdeeb){try{jsonpatch[_0xdba0('0x24')](_0x2fdeeb,_0x11ded6,!![]);}catch(_0xe4ac33){return BPromise[_0xdba0('0x25')](_0xe4ac33);}return _0x2fdeeb[_0xdba0('0x26')]();};}function saveUpdates(_0x46525a,_0x151704){return function(_0x47eab6){if(_0x47eab6){return _0x47eab6[_0xdba0('0x27')](_0x46525a)[_0xdba0('0x28')](function(_0x4873de){return _0x4873de;});}return null;};}function removeEntity(_0x80ec5b,_0x4ac548){return function(_0x3600e6){if(_0x3600e6){return _0x3600e6[_0xdba0('0x29')]()['then'](function(){_0x80ec5b['status'](0xcc)[_0xdba0('0x1d')]();});}};}function handleEntityNotFound(_0x2541a6,_0x331a07){return function(_0x3c7f03){if(!_0x3c7f03){_0x2541a6[_0xdba0('0x1b')](0x194);}return _0x3c7f03;};}function handleError(_0x16b3a1,_0x2337df){_0x2337df=_0x2337df||0x1f4;return function(_0x59b3e7){logger['error'](_0x59b3e7[_0xdba0('0x2a')]);if(_0x59b3e7[_0xdba0('0x2b')]){delete _0x59b3e7[_0xdba0('0x2b')];}_0x16b3a1[_0xdba0('0x1c')](_0x2337df)['send'](_0x59b3e7);};}exports['show']=function(_0x189373,_0x5b199b){var _0x3cb358={'raw':![],'where':{'id':_0x189373[_0xdba0('0x2c')]['id']}},_0x5b89af={};_0x5b89af[_0xdba0('0x2d')]=_['keys'](db[_0xdba0('0x2e')][_0xdba0('0x2f')]);_0x5b89af[_0xdba0('0x30')]=_[_0xdba0('0x31')](_0x189373[_0xdba0('0x30')]);_0x5b89af[_0xdba0('0x32')]=_[_0xdba0('0x33')](_0x5b89af['model'],_0x5b89af['query']);_0x3cb358[_0xdba0('0x34')]=_[_0xdba0('0x33')](_0x5b89af[_0xdba0('0x2d')],qs[_0xdba0('0x35')](_0x189373[_0xdba0('0x30')]['fields']));_0x3cb358['attributes']=_0x3cb358[_0xdba0('0x34')][_0xdba0('0x36')]?_0x3cb358['attributes']:_0x5b89af[_0xdba0('0x2d')];if(_0x189373['query'][_0xdba0('0x37')]){_0x3cb358[_0xdba0('0x38')]=[{'all':!![]}];}_0x3cb358=_[_0xdba0('0x39')]({},_0x3cb358,_0x189373[_0xdba0('0x3a')]);return db[_0xdba0('0x2e')][_0xdba0('0x3b')](_0x3cb358)[_0xdba0('0x28')](handleEntityNotFound(_0x5b199b,null))['then'](respondWithResult(_0x5b199b,null))[_0xdba0('0x3c')](handleError(_0x5b199b,null));};exports['destroy']=function(_0x4eb994,_0x1bc343){return db[_0xdba0('0x2e')]['find']({'where':{'id':_0x4eb994[_0xdba0('0x2c')]['id']}})[_0xdba0('0x28')](handleEntityNotFound(_0x1bc343,null))['then'](removeEntity(_0x1bc343,null))['catch'](handleError(_0x1bc343,null));};function widgetAttributes(_0x4a61cc){try{switch(_0x4a61cc['type']){case _0xdba0('0x3d'):return[{'name':'attrUrl','value':_0x4a61cc['attrUrl']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x0]?_0x4a61cc[_0xdba0('0x3e')][0x0][_0xdba0('0x3f')]:undefined)||_0xdba0('0x40')}];case _0xdba0('0x41'):return[{'name':_0xdba0('0x42'),'value':_0x4a61cc[_0xdba0('0x42')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc[_0xdba0('0x3e')][0x0][_0xdba0('0x3f')]:undefined)||''}];case _0xdba0('0x43'):return[{'name':_0xdba0('0x44'),'value':_0x4a61cc['attrHourFormat']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc['attrs'][0x0][_0xdba0('0x3f')]:undefined)||_0xdba0('0x45')},{'name':_0xdba0('0x46'),'value':_0x4a61cc[_0xdba0('0x46')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x1]?_0x4a61cc[_0xdba0('0x3e')][0x1][_0xdba0('0x3f')]:undefined)||_0xdba0('0x47')},{'name':_0xdba0('0x48'),'value':_0x4a61cc[_0xdba0('0x48')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x2]?_0x4a61cc['attrs'][0x2][_0xdba0('0x3f')]:undefined)||0xc}];case'counter':return[{'name':_0xdba0('0x49'),'value':_0x4a61cc[_0xdba0('0x49')]||(_0x4a61cc['attrs']&&_0x4a61cc['attrs'][0x0]?_0x4a61cc['attrs'][0x0]['value']:undefined)||_0xdba0('0x4a')},{'name':_0xdba0('0x4b'),'value':_0x4a61cc['attrVoiceQueues']||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x1]?_0x4a61cc[_0xdba0('0x3e')][0x1][_0xdba0('0x3f')]:undefined)||[]},{'name':_0xdba0('0x48'),'value':_0x4a61cc[_0xdba0('0x48')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x2]?_0x4a61cc[_0xdba0('0x3e')][0x2][_0xdba0('0x3f')]:undefined)||0x14},{'name':_0xdba0('0x4c'),'value':_0x4a61cc[_0xdba0('0x4c')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x3]?_0x4a61cc[_0xdba0('0x3e')][0x3][_0xdba0('0x3f')]:undefined)||'voice'},{'name':_0xdba0('0x4d'),'value':_0x4a61cc[_0xdba0('0x4d')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x4]?_0x4a61cc[_0xdba0('0x3e')][0x4][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4e'),'value':_0x4a61cc[_0xdba0('0x4e')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x5]?_0x4a61cc[_0xdba0('0x3e')][0x5][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4f'),'value':_0x4a61cc[_0xdba0('0x4f')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x6]?_0x4a61cc[_0xdba0('0x3e')][0x6]['value']:undefined)||''},{'name':_0xdba0('0x50'),'value':_0x4a61cc[_0xdba0('0x50')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x7]?_0x4a61cc[_0xdba0('0x3e')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4a61cc[_0xdba0('0x51')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x8]?_0x4a61cc[_0xdba0('0x3e')][0x8][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x52'),'value':_0x4a61cc[_0xdba0('0x52')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x9]?_0x4a61cc[_0xdba0('0x3e')][0x9][_0xdba0('0x3f')]:undefined)||''}];case _0xdba0('0x53'):case'pie-chart':return[{'name':'attrSerie1','value':_0x4a61cc[_0xdba0('0x54')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc[_0xdba0('0x3e')][0x0]['value']:undefined)||'total'},{'name':_0xdba0('0x55'),'value':_0x4a61cc[_0xdba0('0x55')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x1]?_0x4a61cc['attrs'][0x1][_0xdba0('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x4a61cc[_0xdba0('0x56')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x2]?_0x4a61cc[_0xdba0('0x3e')][0x2][_0xdba0('0x3f')]:undefined)||null},{'name':_0xdba0('0x4b'),'value':_0x4a61cc['attrVoiceQueues']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc['attrs'][0x3]?_0x4a61cc['attrs'][0x3][_0xdba0('0x3f')]:undefined)||[]},{'name':'attrChannel','value':_0x4a61cc['attrChannel']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x4]?_0x4a61cc[_0xdba0('0x3e')][0x4][_0xdba0('0x3f')]:undefined)||_0xdba0('0x57')},{'name':'attrEmailAccounts','value':_0x4a61cc[_0xdba0('0x4d')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x5]?_0x4a61cc[_0xdba0('0x3e')][0x5][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4e'),'value':_0x4a61cc[_0xdba0('0x4e')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x6]?_0x4a61cc[_0xdba0('0x3e')][0x6][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x4f'),'value':_0x4a61cc[_0xdba0('0x4f')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x7]?_0x4a61cc[_0xdba0('0x3e')][0x7][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x50'),'value':_0x4a61cc[_0xdba0('0x50')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x8]?_0x4a61cc[_0xdba0('0x3e')][0x8][_0xdba0('0x3f')]:undefined)||''},{'name':_0xdba0('0x51'),'value':_0x4a61cc[_0xdba0('0x51')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x9]?_0x4a61cc['attrs'][0x9]['value']:undefined)||''},{'name':_0xdba0('0x52'),'value':_0x4a61cc['attrChatWebsites']||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0xa]?_0x4a61cc['attrs'][0xa][_0xdba0('0x3f')]:undefined)||''}];case'web-report':return[{'name':_0xdba0('0x58'),'type':_0x4a61cc[_0xdba0('0x59')]||(_0x4a61cc['attrs']&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc['attrs'][0x0]['type']:undefined)||null,'value':_0x4a61cc[_0xdba0('0x58')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x0]?_0x4a61cc['attrs'][0x0][_0xdba0('0x3f')]:undefined)||null},{'name':_0xdba0('0x5a'),'value':_0x4a61cc[_0xdba0('0x5a')]||(_0x4a61cc[_0xdba0('0x3e')]&&_0x4a61cc[_0xdba0('0x3e')][0x1]?_0x4a61cc[_0xdba0('0x3e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3ad3ca){logger[_0xdba0('0x5b')]('widgetAttributes:\x20%s',JSON['stringify'](_0x3ad3ca));return[];}}exports[_0xdba0('0x5c')]=function(_0x42b680,_0x4e005b){if(_0x42b680['body']){_0x42b680['body'][_0xdba0('0x3e')]=widgetAttributes(_0x42b680[_0xdba0('0x5d')]);}return db[_0xdba0('0x2e')][_0xdba0('0x5c')](_0x42b680[_0xdba0('0x5d')],{})[_0xdba0('0x28')](respondWithResult(_0x4e005b,0xc9))[_0xdba0('0x3c')](handleError(_0x4e005b,null));};exports['update']=function(_0x312222,_0x1415fb){if(_0x312222['body']['id']){delete _0x312222[_0xdba0('0x5d')]['id'];}_0x312222[_0xdba0('0x5d')][_0xdba0('0x3e')]=widgetAttributes(_0x312222[_0xdba0('0x5d')]);return db[_0xdba0('0x2e')]['find']({'where':{'id':_0x312222['params']['id']}})['then'](handleEntityNotFound(_0x1415fb,null))[_0xdba0('0x28')](saveUpdates(_0x312222['body'],null))[_0xdba0('0x28')](respondWithResult(_0x1415fb,null))[_0xdba0('0x3c')](handleError(_0x1415fb,null));};
\ No newline at end of file
+var _0x8375=['attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','create','update','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','show','params','DashboardItem','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','options','catch','type','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts'];(function(_0x58400d,_0x104621){var _0x28bfb6=function(_0x2732d7){while(--_0x2732d7){_0x58400d['push'](_0x58400d['shift']());}};_0x28bfb6(++_0x104621);}(_0x8375,0x132));var _0x5837=function(_0x4d8d91,_0xf1c804){_0x4d8d91=_0x4d8d91-0x0;var _0x574f26=_0x8375[_0x4d8d91];return _0x574f26;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5837('0x0'));var zipdir=require(_0x5837('0x1'));var jsonpatch=require(_0x5837('0x2'));var rp=require(_0x5837('0x3'));var moment=require(_0x5837('0x4'));var BPromise=require(_0x5837('0x5'));var Mustache=require('mustache');var util=require(_0x5837('0x6'));var path=require(_0x5837('0x7'));var sox=require('sox');var csv=require(_0x5837('0x8'));var ejs=require(_0x5837('0x9'));var fs=require('fs');var fs_extra=require(_0x5837('0xa'));var _=require(_0x5837('0xb'));var squel=require('squel');var crypto=require(_0x5837('0xc'));var jsforce=require(_0x5837('0xd'));var deskjs=require(_0x5837('0xe'));var toCsv=require(_0x5837('0x8'));var querystring=require(_0x5837('0xf'));var Papa=require(_0x5837('0x10'));var Redis=require(_0x5837('0x11'));var authService=require(_0x5837('0x12'));var qs=require(_0x5837('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5837('0x14'));var logger=require(_0x5837('0x15'))('api');var utils=require(_0x5837('0x16'));var config=require(_0x5837('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5837('0x18'))['db'];config['redis']=_[_0x5837('0x19')](config[_0x5837('0x1a')],{'host':_0x5837('0x1b'),'port':0x18eb});var socket=require(_0x5837('0x1c'))(new Redis(config['redis']));require(_0x5837('0x1d'))[_0x5837('0x1e')](socket);function respondWithStatusCode(_0x2bc6f6,_0x5bc01f){_0x5bc01f=_0x5bc01f||0xcc;return function(_0x292949){if(_0x292949){return _0x2bc6f6[_0x5837('0x1f')](_0x5bc01f);}return _0x2bc6f6[_0x5837('0x20')](_0x5bc01f)[_0x5837('0x21')]();};}function respondWithResult(_0x304fe7,_0x2eb338){_0x2eb338=_0x2eb338||0xc8;return function(_0x4adc98){if(_0x4adc98){return _0x304fe7['status'](_0x2eb338)['json'](_0x4adc98);}};}function respondWithFilteredResult(_0x37824b,_0x106824){return function(_0x1a5725){if(_0x1a5725){var _0x423a9f=typeof _0x106824[_0x5837('0x22')]===_0x5837('0x23')&&typeof _0x106824[_0x5837('0x24')]==='undefined';var _0x3c5ec9=_0x1a5725[_0x5837('0x25')];var _0x295ae3=_0x423a9f?0x0:_0x106824[_0x5837('0x22')];var _0x387809=_0x423a9f?_0x1a5725['count']:_0x106824['offset']+_0x106824[_0x5837('0x24')];var _0x21c0bf;if(_0x387809>=_0x3c5ec9){_0x387809=_0x3c5ec9;_0x21c0bf=0xc8;}else{_0x21c0bf=0xce;}_0x37824b[_0x5837('0x20')](_0x21c0bf);return _0x37824b['set'](_0x5837('0x26'),_0x295ae3+'-'+_0x387809+'/'+_0x3c5ec9)[_0x5837('0x27')](_0x1a5725);}return null;};}function patchUpdates(_0x4b59b1){return function(_0x3e055d){try{jsonpatch[_0x5837('0x28')](_0x3e055d,_0x4b59b1,!![]);}catch(_0x5e9c2e){return BPromise[_0x5837('0x29')](_0x5e9c2e);}return _0x3e055d[_0x5837('0x2a')]();};}function saveUpdates(_0x1366c1,_0x56d9b0){return function(_0x413ea9){if(_0x413ea9){return _0x413ea9['update'](_0x1366c1)[_0x5837('0x2b')](function(_0x8e5a48){return _0x8e5a48;});}return null;};}function removeEntity(_0x31d25b,_0x3f96b1){return function(_0x3c92eb){if(_0x3c92eb){return _0x3c92eb[_0x5837('0x2c')]()[_0x5837('0x2b')](function(){_0x31d25b[_0x5837('0x20')](0xcc)[_0x5837('0x21')]();});}};}function handleEntityNotFound(_0x192883,_0x24b941){return function(_0x27848d){if(!_0x27848d){_0x192883[_0x5837('0x1f')](0x194);}return _0x27848d;};}function handleError(_0x3a6cc8,_0x271e23){_0x271e23=_0x271e23||0x1f4;return function(_0x5c17dd){logger[_0x5837('0x2d')](_0x5c17dd[_0x5837('0x2e')]);if(_0x5c17dd[_0x5837('0x2f')]){delete _0x5c17dd[_0x5837('0x2f')];}_0x3a6cc8[_0x5837('0x20')](_0x271e23)[_0x5837('0x30')](_0x5c17dd);};}exports[_0x5837('0x31')]=function(_0x4e3259,_0x89e7e5){var _0x290e14={'raw':![],'where':{'id':_0x4e3259[_0x5837('0x32')]['id']}},_0x3a3a34={};_0x3a3a34['model']=_['keys'](db[_0x5837('0x33')][_0x5837('0x34')]);_0x3a3a34[_0x5837('0x35')]=_['keys'](_0x4e3259[_0x5837('0x35')]);_0x3a3a34[_0x5837('0x36')]=_[_0x5837('0x37')](_0x3a3a34[_0x5837('0x38')],_0x3a3a34[_0x5837('0x35')]);_0x290e14[_0x5837('0x39')]=_['intersection'](_0x3a3a34[_0x5837('0x38')],qs[_0x5837('0x3a')](_0x4e3259['query'][_0x5837('0x3a')]));_0x290e14[_0x5837('0x39')]=_0x290e14[_0x5837('0x39')]['length']?_0x290e14['attributes']:_0x3a3a34['model'];if(_0x4e3259['query'][_0x5837('0x3b')]){_0x290e14['include']=[{'all':!![]}];}_0x290e14=_['merge']({},_0x290e14,_0x4e3259[_0x5837('0x3c')]);return db[_0x5837('0x33')]['find'](_0x290e14)[_0x5837('0x2b')](handleEntityNotFound(_0x89e7e5,null))['then'](respondWithResult(_0x89e7e5,null))[_0x5837('0x3d')](handleError(_0x89e7e5,null));};exports[_0x5837('0x2c')]=function(_0x4c0c4a,_0x4109fa){return db[_0x5837('0x33')]['find']({'where':{'id':_0x4c0c4a[_0x5837('0x32')]['id']}})['then'](handleEntityNotFound(_0x4109fa,null))[_0x5837('0x2b')](removeEntity(_0x4109fa,null))['catch'](handleError(_0x4109fa,null));};function widgetAttributes(_0x495901){try{switch(_0x495901[_0x5837('0x3e')]){case _0x5837('0x3f'):return[{'name':_0x5837('0x40'),'value':_0x495901[_0x5837('0x40')]||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x0]?_0x495901[_0x5837('0x41')][0x0]['value']:undefined)||'https://'}];case _0x5837('0x42'):return[{'name':_0x5837('0x43'),'value':_0x495901['attrPath']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901[_0x5837('0x41')][0x0][_0x5837('0x44')]:undefined)||''}];case _0x5837('0x45'):return[{'name':_0x5837('0x46'),'value':_0x495901[_0x5837('0x46')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901['attrs'][0x0][_0x5837('0x44')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x495901[_0x5837('0x47')]||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x1]?_0x495901[_0x5837('0x41')][0x1][_0x5837('0x44')]:undefined)||_0x5837('0x48')},{'name':_0x5837('0x49'),'value':_0x495901['attrFontSize']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x2]?_0x495901[_0x5837('0x41')][0x2][_0x5837('0x44')]:undefined)||0xc}];case _0x5837('0x4a'):return[{'name':'attrMetric','value':_0x495901[_0x5837('0x4b')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901['attrs'][0x0][_0x5837('0x44')]:undefined)||_0x5837('0x4c')},{'name':_0x5837('0x4d'),'value':_0x495901[_0x5837('0x4d')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x1]?_0x495901[_0x5837('0x41')][0x1][_0x5837('0x44')]:undefined)||[]},{'name':_0x5837('0x49'),'value':_0x495901[_0x5837('0x49')]||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x2]?_0x495901[_0x5837('0x41')][0x2][_0x5837('0x44')]:undefined)||0x14},{'name':'attrChannel','value':_0x495901['attrChannel']||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x3]?_0x495901[_0x5837('0x41')][0x3][_0x5837('0x44')]:undefined)||_0x5837('0x4e')},{'name':_0x5837('0x4f'),'value':_0x495901['attrEmailAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x4]?_0x495901[_0x5837('0x41')][0x4][_0x5837('0x44')]:undefined)||''},{'name':_0x5837('0x50'),'value':_0x495901[_0x5837('0x50')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x5]?_0x495901[_0x5837('0x41')][0x5]['value']:undefined)||''},{'name':_0x5837('0x51'),'value':_0x495901[_0x5837('0x51')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x6]?_0x495901[_0x5837('0x41')][0x6][_0x5837('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x495901[_0x5837('0x52')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x7]?_0x495901[_0x5837('0x41')][0x7][_0x5837('0x44')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x495901[_0x5837('0x53')]||(_0x495901['attrs']&&_0x495901[_0x5837('0x41')][0x8]?_0x495901[_0x5837('0x41')][0x8][_0x5837('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x495901[_0x5837('0x54')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x9]?_0x495901[_0x5837('0x41')][0x9][_0x5837('0x44')]:undefined)||''}];case _0x5837('0x55'):case _0x5837('0x56'):return[{'name':_0x5837('0x57'),'value':_0x495901[_0x5837('0x57')]||(_0x495901['attrs']&&_0x495901['attrs'][0x0]?_0x495901[_0x5837('0x41')][0x0][_0x5837('0x44')]:undefined)||'total'},{'name':'attrSerie2','value':_0x495901[_0x5837('0x58')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x1]?_0x495901[_0x5837('0x41')][0x1][_0x5837('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0x495901[_0x5837('0x59')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x2]?_0x495901['attrs'][0x2]['value']:undefined)||null},{'name':_0x5837('0x4d'),'value':_0x495901[_0x5837('0x4d')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x3]?_0x495901['attrs'][0x3][_0x5837('0x44')]:undefined)||[]},{'name':'attrChannel','value':_0x495901['attrChannel']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x4]?_0x495901['attrs'][0x4][_0x5837('0x44')]:undefined)||_0x5837('0x4e')},{'name':_0x5837('0x4f'),'value':_0x495901['attrEmailAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x5]?_0x495901[_0x5837('0x41')][0x5][_0x5837('0x44')]:undefined)||''},{'name':_0x5837('0x50'),'value':_0x495901['attrFaxAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x6]?_0x495901['attrs'][0x6][_0x5837('0x44')]:undefined)||''},{'name':_0x5837('0x51'),'value':_0x495901['attrSmsAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901['attrs'][0x7]?_0x495901[_0x5837('0x41')][0x7][_0x5837('0x44')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x495901['attrOpenchannelAccounts']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x8]?_0x495901['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x495901[_0x5837('0x53')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x9]?_0x495901[_0x5837('0x41')][0x9][_0x5837('0x44')]:undefined)||''},{'name':'attrChatWebsites','value':_0x495901[_0x5837('0x54')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0xa]?_0x495901[_0x5837('0x41')][0xa][_0x5837('0x44')]:undefined)||''}];case'web-report':return[{'name':_0x5837('0x5a'),'type':_0x495901['reportType']||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901['attrs'][0x0][_0x5837('0x3e')]:undefined)||null,'value':_0x495901[_0x5837('0x5a')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x0]?_0x495901[_0x5837('0x41')][0x0]['value']:undefined)||null},{'name':_0x5837('0x5b'),'value':_0x495901[_0x5837('0x5b')]||(_0x495901[_0x5837('0x41')]&&_0x495901[_0x5837('0x41')][0x1]?_0x495901['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x515156){logger[_0x5837('0x2d')]('widgetAttributes:\x20%s',JSON[_0x5837('0x5c')](_0x515156));return[];}}exports[_0x5837('0x5d')]=function(_0x29c4e1,_0x154c9f){if(_0x29c4e1['body']){_0x29c4e1['body'][_0x5837('0x41')]=widgetAttributes(_0x29c4e1['body']);}return db[_0x5837('0x33')][_0x5837('0x5d')](_0x29c4e1['body'],{})[_0x5837('0x2b')](respondWithResult(_0x154c9f,0xc9))[_0x5837('0x3d')](handleError(_0x154c9f,null));};exports[_0x5837('0x5e')]=function(_0x307d73,_0x23c6f6){if(_0x307d73[_0x5837('0x5f')]['id']){delete _0x307d73[_0x5837('0x5f')]['id'];}_0x307d73['body'][_0x5837('0x41')]=widgetAttributes(_0x307d73[_0x5837('0x5f')]);return db[_0x5837('0x33')][_0x5837('0x60')]({'where':{'id':_0x307d73['params']['id']}})['then'](handleEntityNotFound(_0x23c6f6,null))[_0x5837('0x2b')](saveUpdates(_0x307d73['body'],null))[_0x5837('0x2b')](respondWithResult(_0x23c6f6,null))[_0x5837('0x3d')](handleError(_0x23c6f6,null));};
\ No newline at end of file
index 70dfef8..2776863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x992b=['DashboardItem','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x992b,0x127));var _0xb992=function(_0x4d4d72,_0x5a9e4c){_0x4d4d72=_0x4d4d72-0x0;var _0x1e70c1=_0x992b[_0x4d4d72];return _0x1e70c1;};'use strict';var EventEmitter=require(_0xb992('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xb992('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb992('0x2')](0x0);var events={'afterCreate':_0xb992('0x3'),'afterUpdate':_0xb992('0x4'),'afterDestroy':_0xb992('0x5')};function emitEvent(_0x5c20a2){return function(_0x33e8ca,_0x4f7579,_0x9fabba){DashboardItemEvents['emit'](_0x5c20a2+':'+_0x33e8ca['id'],_0x33e8ca);DashboardItemEvents[_0xb992('0x6')](_0x5c20a2,_0x33e8ca);_0x9fabba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xb992('0x7')]=DashboardItemEvents;
\ No newline at end of file
+var _0xd07e=['DashboardItem','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xbc863b,_0xc6a868){var _0xe0b916=function(_0x537795){while(--_0x537795){_0xbc863b['push'](_0xbc863b['shift']());}};_0xe0b916(++_0xc6a868);}(_0xd07e,0x8e));var _0xed07=function(_0x2a83e8,_0x5236fb){_0x2a83e8=_0x2a83e8-0x0;var _0x46860f=_0xd07e[_0x2a83e8];return _0x46860f;};'use strict';var EventEmitter=require(_0xed07('0x0'));var DashboardItem=require(_0xed07('0x1'))['db'][_0xed07('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xed07('0x3')](0x0);var events={'afterCreate':_0xed07('0x4'),'afterUpdate':'update','afterDestroy':_0xed07('0x5')};function emitEvent(_0x1d1e24){return function(_0x1546dd,_0x580878,_0x44e93e){DashboardItemEvents[_0xed07('0x6')](_0x1d1e24+':'+_0x1546dd['id'],_0x1546dd);DashboardItemEvents['emit'](_0x1d1e24,_0x1546dd);_0x44e93e(null);};}for(var e in events){if(events[_0xed07('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xed07('0x8')]=DashboardItemEvents;
\ No newline at end of file
index d9e766a..2782fc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21e3=['dashboard_items','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x337537,_0x4ea7b8){var _0x4fdd67=function(_0x59ad18){while(--_0x59ad18){_0x337537['push'](_0x337537['shift']());}};_0x4fdd67(++_0x4ea7b8);}(_0x21e3,0x1a1));var _0x321e=function(_0xb9ba11,_0x4233a3){_0xb9ba11=_0xb9ba11-0x0;var _0x4678c9=_0x21e3[_0xb9ba11];return _0x4678c9;};'use strict';var _=require(_0x321e('0x0'));var util=require('util');var logger=require(_0x321e('0x1'))('api');var moment=require(_0x321e('0x2'));var BPromise=require(_0x321e('0x3'));var rp=require(_0x321e('0x4'));var fs=require('fs');var path=require(_0x321e('0x5'));var rimraf=require(_0x321e('0x6'));var config=require(_0x321e('0x7'));var attributes=require(_0x321e('0x8'));module[_0x321e('0x9')]=function(_0x3dbb99,_0x600c75){return _0x3dbb99[_0x321e('0xa')](_0x321e('0xb'),attributes,{'tableName':_0x321e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x462f=['define','DashboardItem','dashboard_items','util','api','bluebird','path','rimraf','./dashboardItem.attributes','exports'];(function(_0x210b46,_0x52a05f){var _0x203df2=function(_0x3421ea){while(--_0x3421ea){_0x210b46['push'](_0x210b46['shift']());}};_0x203df2(++_0x52a05f);}(_0x462f,0x1c5));var _0xf462=function(_0xcd5a3d,_0x3c5b33){_0xcd5a3d=_0xcd5a3d-0x0;var _0xd43207=_0x462f[_0xcd5a3d];return _0xd43207;};'use strict';var _=require('lodash');var util=require(_0xf462('0x0'));var logger=require('../../config/logger')(_0xf462('0x1'));var moment=require('moment');var BPromise=require(_0xf462('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf462('0x3'));var rimraf=require(_0xf462('0x4'));var config=require('../../config/environment');var attributes=require(_0xf462('0x5'));module[_0xf462('0x6')]=function(_0x522b9f,_0x561fa1){return _0x522b9f[_0xf462('0x7')](_0xf462('0x8'),attributes,{'tableName':_0xf462('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 28d0750..6056f67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf36d=['request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','info','DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf36d,0xff));var _0xdf36=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0xf36d[_0x238671];return _0x474844;};'use strict';var _=require(_0xdf36('0x0'));var util=require(_0xdf36('0x1'));var moment=require(_0xdf36('0x2'));var BPromise=require(_0xdf36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdf36('0x4'));var db=require(_0xdf36('0x5'))['db'];var utils=require(_0xdf36('0x6'));var logger=require(_0xdf36('0x7'))(_0xdf36('0x8'));var config=require(_0xdf36('0x9'));var jayson=require(_0xdf36('0xa'));var client=jayson[_0xdf36('0xb')]['http']({'port':0x232a});config[_0xdf36('0xc')]=_[_0xdf36('0xd')](config[_0xdf36('0xc')],{'host':_0xdf36('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdf36('0xc')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x11f8d9,_0x2ca933,_0x346bac){return new BPromise(function(_0x6d9ea5,_0x43f6da){return client[_0xdf36('0xf')](_0x11f8d9,_0x346bac)[_0xdf36('0x10')](function(_0x562c5a){logger[_0xdf36('0x11')](_0xdf36('0x12'),_0x2ca933,'request\x20sent');logger['debug'](_0xdf36('0x13'),_0x2ca933,_0xdf36('0x14'),JSON[_0xdf36('0x15')](_0x562c5a));if(_0x562c5a[_0xdf36('0x16')]){if(_0x562c5a[_0xdf36('0x16')]['code']===0x1f4){logger[_0xdf36('0x16')](_0xdf36('0x12'),_0x2ca933,_0x562c5a[_0xdf36('0x16')][_0xdf36('0x17')]);return _0x43f6da(_0x562c5a[_0xdf36('0x16')][_0xdf36('0x17')]);}logger[_0xdf36('0x16')](_0xdf36('0x12'),_0x2ca933,_0x562c5a[_0xdf36('0x16')]['message']);return _0x6d9ea5(_0x562c5a[_0xdf36('0x16')]['message']);}else{logger[_0xdf36('0x11')](_0xdf36('0x12'),_0x2ca933,'request\x20sent');_0x6d9ea5(_0x562c5a[_0xdf36('0x18')]['message']);}})['catch'](function(_0x35c418){logger[_0xdf36('0x16')](_0xdf36('0x12'),_0x2ca933,_0x35c418);_0x43f6da(_0x35c418);});});}
\ No newline at end of file
+var _0x3c89=['defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x23dad9,_0x5dc8f2){var _0x527967=function(_0x2d9dc2){while(--_0x2d9dc2){_0x23dad9['push'](_0x23dad9['shift']());}};_0x527967(++_0x5dc8f2);}(_0x3c89,0x19f));var _0x93c8=function(_0x14c670,_0x494742){_0x14c670=_0x14c670-0x0;var _0x5e5f02=_0x3c89[_0x14c670];return _0x5e5f02;};'use strict';var _=require(_0x93c8('0x0'));var util=require(_0x93c8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x93c8('0x2'));var fs=require('fs');var Redis=require(_0x93c8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x93c8('0x4'))(_0x93c8('0x5'));var config=require(_0x93c8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x93c8('0x7')][_0x93c8('0x8')]({'port':0x232a});config[_0x93c8('0x9')]=_[_0x93c8('0xa')](config[_0x93c8('0x9')],{'host':_0x93c8('0xb'),'port':0x18eb});var socket=require(_0x93c8('0xc'))(new Redis(config[_0x93c8('0x9')]));require(_0x93c8('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ab741,_0xc09f30,_0x5841db){return new BPromise(function(_0x473d0a,_0x220f26){return client[_0x93c8('0xe')](_0x5ab741,_0x5841db)['then'](function(_0x35539e){logger[_0x93c8('0xf')](_0x93c8('0x10'),_0xc09f30,_0x93c8('0x11'));logger[_0x93c8('0x12')](_0x93c8('0x13'),_0xc09f30,'request\x20sent',JSON['stringify'](_0x35539e));if(_0x35539e[_0x93c8('0x14')]){if(_0x35539e['error'][_0x93c8('0x15')]===0x1f4){logger[_0x93c8('0x14')](_0x93c8('0x10'),_0xc09f30,_0x35539e[_0x93c8('0x14')]['message']);return _0x220f26(_0x35539e[_0x93c8('0x14')][_0x93c8('0x16')]);}logger[_0x93c8('0x14')](_0x93c8('0x10'),_0xc09f30,_0x35539e[_0x93c8('0x14')][_0x93c8('0x16')]);return _0x473d0a(_0x35539e['error'][_0x93c8('0x16')]);}else{logger[_0x93c8('0xf')](_0x93c8('0x10'),_0xc09f30,_0x93c8('0x11'));_0x473d0a(_0x35539e[_0x93c8('0x17')][_0x93c8('0x16')]);}})[_0x93c8('0x18')](function(_0x276316){logger['error'](_0x93c8('0x10'),_0xc09f30,_0x276316);_0x220f26(_0x276316);});});}
\ No newline at end of file
index ea8f420..9c9da67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc72e=['register','length','./dashboardItem.events','update','emit','removeListener'];(function(_0xf0f211,_0x478b32){var _0x212f05=function(_0x1f6a88){while(--_0x1f6a88){_0xf0f211['push'](_0xf0f211['shift']());}};_0x212f05(++_0x478b32);}(_0xc72e,0x7a));var _0xec72=function(_0x222d09,_0x2f2eef){_0x222d09=_0x222d09-0x0;var _0x128368=_0xc72e[_0x222d09];return _0x128368;};'use strict';var DashboardItemEvents=require(_0xec72('0x0'));var events=['save','remove',_0xec72('0x1')];function createListener(_0x419054,_0x1e7d17){return function(_0x1eee13){_0x1e7d17[_0xec72('0x2')](_0x419054,_0x1eee13);};}function removeListener(_0x3d2a4a,_0x1ba882){return function(){DashboardItemEvents[_0xec72('0x3')](_0x3d2a4a,_0x1ba882);};}exports[_0xec72('0x4')]=function(_0x1d96b9){for(var _0x1176fe=0x0,_0x2b898b=events[_0xec72('0x5')];_0x1176fe<_0x2b898b;_0x1176fe++){var _0x20ab81=events[_0x1176fe];var _0x1f20ca=createListener('dashboardItem:'+_0x20ab81,_0x1d96b9);DashboardItemEvents['on'](_0x20ab81,_0x1f20ca);}};
\ No newline at end of file
+var _0x2cea=['./dashboardItem.events','save','remove','emit','removeListener','register'];(function(_0x4b2069,_0x46d675){var _0x2a2ae5=function(_0x495703){while(--_0x495703){_0x4b2069['push'](_0x4b2069['shift']());}};_0x2a2ae5(++_0x46d675);}(_0x2cea,0x192));var _0xa2ce=function(_0x5dc9f5,_0x5362c7){_0x5dc9f5=_0x5dc9f5-0x0;var _0x4faea5=_0x2cea[_0x5dc9f5];return _0x4faea5;};'use strict';var DashboardItemEvents=require(_0xa2ce('0x0'));var events=[_0xa2ce('0x1'),_0xa2ce('0x2'),'update'];function createListener(_0x56e788,_0x372b04){return function(_0x17b301){_0x372b04[_0xa2ce('0x3')](_0x56e788,_0x17b301);};}function removeListener(_0x34bda1,_0x5ad363){return function(){DashboardItemEvents[_0xa2ce('0x4')](_0x34bda1,_0x5ad363);};}exports[_0xa2ce('0x5')]=function(_0x32fe42){for(var _0xbe09b0=0x0,_0x3a2bac=events['length'];_0xbe09b0<_0x3a2bac;_0xbe09b0++){var _0x16b5da=events[_0xbe09b0];var _0x44a62c=createListener('dashboardItem:'+_0x16b5da,_0x32fe42);DashboardItemEvents['on'](_0x16b5da,_0x44a62c);}};
\ No newline at end of file
index a8cccaa..92da5c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90de=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','create','update','/:id','destroy','multer','util','path','express'];(function(_0x3582de,_0x4cd6d1){var _0x202b18=function(_0x31e140){while(--_0x31e140){_0x3582de['push'](_0x3582de['shift']());}};_0x202b18(++_0x4cd6d1);}(_0x90de,0x73));var _0xe90d=function(_0x2d1840,_0x5dc27e){_0x2d1840=_0x2d1840-0x0;var _0xd06a88=_0x90de[_0x2d1840];return _0xd06a88;};'use strict';var multer=require(_0xe90d('0x0'));var util=require(_0xe90d('0x1'));var path=require(_0xe90d('0x2'));var timeout=require('connect-timeout');var express=require(_0xe90d('0x3'));var router=express[_0xe90d('0x4')]();var fs_extra=require(_0xe90d('0x5'));var auth=require(_0xe90d('0x6'));var interaction=require(_0xe90d('0x7'));var config=require(_0xe90d('0x8'));var controller=require(_0xe90d('0x9'));router[_0xe90d('0xa')]('/:id',auth[_0xe90d('0xb')](),controller[_0xe90d('0xc')]);router['post']('/',auth[_0xe90d('0xb')](),controller[_0xe90d('0xd')]);router['put']('/:id',auth[_0xe90d('0xb')](),controller[_0xe90d('0xe')]);router['delete'](_0xe90d('0xf'),auth[_0xe90d('0xb')](),controller[_0xe90d('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x196e=['delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','show','post','create','/:id'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x196e,0x16b));var _0xe196=function(_0x179c4a,_0x10eb06){_0x179c4a=_0x179c4a-0x0;var _0x5d1879=_0x196e[_0x179c4a];return _0x5d1879;};'use strict';var multer=require('multer');var util=require(_0xe196('0x0'));var path=require(_0xe196('0x1'));var timeout=require(_0xe196('0x2'));var express=require('express');var router=express[_0xe196('0x3')]();var fs_extra=require(_0xe196('0x4'));var auth=require(_0xe196('0x5'));var interaction=require(_0xe196('0x6'));var config=require(_0xe196('0x7'));var controller=require(_0xe196('0x8'));router[_0xe196('0x9')]('/:id',auth[_0xe196('0xa')](),controller[_0xe196('0xb')]);router[_0xe196('0xc')]('/',auth['isAuthenticated'](),controller[_0xe196('0xd')]);router['put'](_0xe196('0xe'),auth[_0xe196('0xa')](),controller['update']);router[_0xe196('0xf')](_0xe196('0xe'),auth[_0xe196('0xa')](),controller[_0xe196('0x10')]);module[_0xe196('0x11')]=router;
\ No newline at end of file
index f8a09df..31e57d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42aa=['second','exports','STRING','ENUM','first'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x42aa,0xbf));var _0xa42a=function(_0x289291,_0x3ead45){_0x289291=_0x289291-0x0;var _0x1d4970=_0x42aa[_0x289291];return _0x1d4970;};'use strict';var Sequelize=require('sequelize');module[_0xa42a('0x0')]={'name':{'type':Sequelize[_0xa42a('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xa42a('0x2')](_0xa42a('0x3'),_0xa42a('0x4'),'third'),'allowNull':![],'defaultValue':_0xa42a('0x3')},'description':{'type':Sequelize[_0xa42a('0x1')]}};
\ No newline at end of file
+var _0x8690=['second','third','exports','STRING','first'];(function(_0x2c1f47,_0x1b4117){var _0x5d6e5d=function(_0x11da19){while(--_0x11da19){_0x2c1f47['push'](_0x2c1f47['shift']());}};_0x5d6e5d(++_0x1b4117);}(_0x8690,0x1c9));var _0x0869=function(_0xf72786,_0x1a0ddd){_0xf72786=_0xf72786-0x0;var _0x113f3e=_0x8690[_0xf72786];return _0x113f3e;};'use strict';var Sequelize=require('sequelize');module[_0x0869('0x0')]={'name':{'type':Sequelize[_0x0869('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0x0869('0x2'),_0x0869('0x3'),_0x0869('0x4')),'allowNull':![],'defaultValue':_0x0869('0x2')},'description':{'type':Sequelize[_0x0869('0x1')]}};
\ No newline at end of file
index 40b88e5..18125f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','error','name','send','index','map','Disposition','fieldName','type','query','keys','filters','attributes','fields','model'];(function(_0x2cd989,_0x9225cb){var _0x2d0584=function(_0x10ac24){while(--_0x10ac24){_0x2cd989['push'](_0x2cd989['shift']());}};_0x2d0584(++_0x9225cb);}(_0xdace,0xc1));var _0xedac=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xdace[_0x2dd390];return _0x3afe47;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xedac('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xedac('0x1'));var Mustache=require(_0xedac('0x2'));var util=require(_0xedac('0x3'));var path=require('path');var sox=require(_0xedac('0x4'));var csv=require(_0xedac('0x5'));var ejs=require(_0xedac('0x6'));var fs=require('fs');var fs_extra=require(_0xedac('0x7'));var _=require(_0xedac('0x8'));var squel=require(_0xedac('0x9'));var crypto=require(_0xedac('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xedac('0xb'));var toCsv=require(_0xedac('0x5'));var querystring=require(_0xedac('0xc'));var Papa=require(_0xedac('0xd'));var Redis=require(_0xedac('0xe'));var authService=require(_0xedac('0xf'));var qs=require(_0xedac('0x10'));var as=require(_0xedac('0x11'));var hardwareService=require(_0xedac('0x12'));var logger=require(_0xedac('0x13'))(_0xedac('0x14'));var utils=require(_0xedac('0x15'));var config=require(_0xedac('0x16'));var licenseUtil=require(_0xedac('0x17'));var db=require(_0xedac('0x18'))['db'];function respondWithStatusCode(_0x3d7a30,_0x3777fb){_0x3777fb=_0x3777fb||0xcc;return function(_0x831b3){if(_0x831b3){return _0x3d7a30['sendStatus'](_0x3777fb);}return _0x3d7a30['status'](_0x3777fb)[_0xedac('0x19')]();};}function respondWithResult(_0x27a1b8,_0x3e08c0){_0x3e08c0=_0x3e08c0||0xc8;return function(_0x5a8668){if(_0x5a8668){return _0x27a1b8[_0xedac('0x1a')](_0x3e08c0)[_0xedac('0x1b')](_0x5a8668);}};}function respondWithFilteredResult(_0x4095e2,_0x3d0bf0){return function(_0x3df438){if(_0x3df438){var _0x5edd0e=typeof _0x3d0bf0[_0xedac('0x1c')]===_0xedac('0x1d')&&typeof _0x3d0bf0['limit']===_0xedac('0x1d');var _0x56b524=_0x3df438[_0xedac('0x1e')];var _0x14350e=_0x5edd0e?0x0:_0x3d0bf0[_0xedac('0x1c')];var _0x5a6d9b=_0x5edd0e?_0x3df438[_0xedac('0x1e')]:_0x3d0bf0[_0xedac('0x1c')]+_0x3d0bf0[_0xedac('0x1f')];var _0x40d64b;if(_0x5a6d9b>=_0x56b524){_0x5a6d9b=_0x56b524;_0x40d64b=0xc8;}else{_0x40d64b=0xce;}_0x4095e2[_0xedac('0x1a')](_0x40d64b);return _0x4095e2[_0xedac('0x20')]('Content-Range',_0x14350e+'-'+_0x5a6d9b+'/'+_0x56b524)[_0xedac('0x1b')](_0x3df438);}return null;};}function patchUpdates(_0x17b186){return function(_0x5f45be){try{jsonpatch[_0xedac('0x21')](_0x5f45be,_0x17b186,!![]);}catch(_0x314bd2){return BPromise['reject'](_0x314bd2);}return _0x5f45be[_0xedac('0x22')]();};}function saveUpdates(_0x238dc1,_0x1132ee){return function(_0x1132fd){if(_0x1132fd){return _0x1132fd[_0xedac('0x23')](_0x238dc1)[_0xedac('0x24')](function(_0x7477f2){return _0x7477f2;});}return null;};}function removeEntity(_0x492372,_0x1479a4){return function(_0x301a53){if(_0x301a53){return _0x301a53[_0xedac('0x25')]()[_0xedac('0x24')](function(){var _0x60a4d5=_0x301a53[_0xedac('0x26')]({'plain':!![]});var _0x5eb3e0=_0xedac('0x27');return db[_0xedac('0x28')][_0xedac('0x25')]({'where':{'type':_0x5eb3e0,'resourceId':_0x60a4d5['id']}})[_0xedac('0x24')](function(){return _0x301a53;});})['then'](function(){_0x492372[_0xedac('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2282c4,_0x238b58){return function(_0x3c6f7b){if(!_0x3c6f7b){_0x2282c4[_0xedac('0x29')](0x194);}return _0x3c6f7b;};}function handleError(_0x5ce399,_0x4dc737){_0x4dc737=_0x4dc737||0x1f4;return function(_0x482744){logger[_0xedac('0x2a')](_0x482744['stack']);if(_0x482744['name']){delete _0x482744[_0xedac('0x2b')];}_0x5ce399[_0xedac('0x1a')](_0x4dc737)[_0xedac('0x2c')](_0x482744);};}exports[_0xedac('0x2d')]=function(_0x3b61ac,_0x40918b){var _0x4f7985={},_0x181402={},_0xb6854a={'count':0x0,'rows':[]};var _0x13ee48=_[_0xedac('0x2e')](db[_0xedac('0x2f')]['rawAttributes'],function(_0xe1dc28){return{'name':_0xe1dc28[_0xedac('0x30')],'type':_0xe1dc28[_0xedac('0x31')]['key']};});_0x181402['model']=_[_0xedac('0x2e')](_0x13ee48,_0xedac('0x2b'));_0x181402[_0xedac('0x32')]=_[_0xedac('0x33')](_0x3b61ac[_0xedac('0x32')]);_0x181402[_0xedac('0x34')]=_['intersection'](_0x181402['model'],_0x181402['query']);_0x4f7985[_0xedac('0x35')]=_['intersection'](_0x181402['model'],qs[_0xedac('0x36')](_0x3b61ac['query']['fields']));_0x4f7985[_0xedac('0x35')]=_0x4f7985[_0xedac('0x35')]['length']?_0x4f7985[_0xedac('0x35')]:_0x181402[_0xedac('0x37')];if(!_0x3b61ac[_0xedac('0x32')][_0xedac('0x38')](_0xedac('0x39'))){_0x4f7985[_0xedac('0x1f')]=qs[_0xedac('0x1f')](_0x3b61ac[_0xedac('0x32')][_0xedac('0x1f')]);_0x4f7985[_0xedac('0x1c')]=qs[_0xedac('0x1c')](_0x3b61ac[_0xedac('0x32')][_0xedac('0x1c')]);}_0x4f7985['order']=qs['sort'](_0x3b61ac[_0xedac('0x32')][_0xedac('0x3a')]);_0x4f7985[_0xedac('0x3b')]=qs['filters'](_[_0xedac('0x3c')](_0x3b61ac[_0xedac('0x32')],_0x181402[_0xedac('0x34')]),_0x13ee48);if(_0x3b61ac[_0xedac('0x32')]['filter']){_0x4f7985[_0xedac('0x3b')]=_[_0xedac('0x3d')](_0x4f7985[_0xedac('0x3b')],{'$or':_['map'](_0x13ee48,function(_0x209bee){if(_0x209bee[_0xedac('0x31')]!==_0xedac('0x3e')){var _0x4e8015={};_0x4e8015[_0x209bee[_0xedac('0x2b')]]={'$like':'%'+_0x3b61ac[_0xedac('0x32')]['filter']+'%'};return _0x4e8015;}})});}_0x4f7985=_[_0xedac('0x3d')]({},_0x4f7985,_0x3b61ac[_0xedac('0x3f')]);var _0x2610b1={'where':_0x4f7985[_0xedac('0x3b')]};return db[_0xedac('0x2f')][_0xedac('0x1e')](_0x2610b1)[_0xedac('0x24')](function(_0x382bb2){_0xb6854a[_0xedac('0x1e')]=_0x382bb2;if(_0x3b61ac[_0xedac('0x32')][_0xedac('0x40')]){_0x4f7985[_0xedac('0x41')]=[{'all':!![]}];}return db[_0xedac('0x2f')][_0xedac('0x42')](_0x4f7985);})[_0xedac('0x24')](function(_0x499148){_0xb6854a[_0xedac('0x43')]=_0x499148;return _0xb6854a;})[_0xedac('0x24')](respondWithFilteredResult(_0x40918b,_0x4f7985))[_0xedac('0x44')](handleError(_0x40918b,null));};exports[_0xedac('0x45')]=function(_0x2c4772,_0x2b9f46){var _0x17520c={'raw':!![],'where':{'id':_0x2c4772[_0xedac('0x46')]['id']}},_0xca3c1c={};_0xca3c1c['model']=_[_0xedac('0x33')](db[_0xedac('0x2f')][_0xedac('0x47')]);_0xca3c1c[_0xedac('0x32')]=_[_0xedac('0x33')](_0x2c4772[_0xedac('0x32')]);_0xca3c1c[_0xedac('0x34')]=_['intersection'](_0xca3c1c[_0xedac('0x37')],_0xca3c1c[_0xedac('0x32')]);_0x17520c[_0xedac('0x35')]=_[_0xedac('0x48')](_0xca3c1c[_0xedac('0x37')],qs[_0xedac('0x36')](_0x2c4772[_0xedac('0x32')][_0xedac('0x36')]));_0x17520c['attributes']=_0x17520c[_0xedac('0x35')][_0xedac('0x49')]?_0x17520c[_0xedac('0x35')]:_0xca3c1c['model'];if(_0x2c4772[_0xedac('0x32')]['includeAll']){_0x17520c[_0xedac('0x41')]=[{'all':!![]}];}_0x17520c=_[_0xedac('0x3d')]({},_0x17520c,_0x2c4772['options']);return db[_0xedac('0x2f')][_0xedac('0x4a')](_0x17520c)[_0xedac('0x24')](handleEntityNotFound(_0x2b9f46,null))[_0xedac('0x24')](respondWithResult(_0x2b9f46,null))[_0xedac('0x44')](handleError(_0x2b9f46,null));};exports[_0xedac('0x4b')]=function(_0x2d9326,_0x10070f){return db[_0xedac('0x2f')][_0xedac('0x4b')](_0x2d9326[_0xedac('0x4c')],{})[_0xedac('0x24')](function(_0x3329ca){var _0x31b073=_0x2d9326[_0xedac('0x4d')]['get']({'plain':!![]});if(!_0x31b073)throw new Error(_0xedac('0x4e'));if(_0x31b073[_0xedac('0x4f')]===_0xedac('0x4d')){var _0x27ae66=_0x3329ca[_0xedac('0x26')]({'plain':!![]});var _0x4a47db=_0xedac('0x27');return db[_0xedac('0x50')]['find']({'where':{'name':_0x4a47db,'userProfileId':_0x31b073['userProfileId']},'raw':!![]})['then'](function(_0x1ac1b0){if(_0x1ac1b0&&_0x1ac1b0[_0xedac('0x51')]===0x0){return db[_0xedac('0x28')][_0xedac('0x4b')]({'name':_0x27ae66[_0xedac('0x2b')],'resourceId':_0x27ae66['id'],'type':_0x1ac1b0[_0xedac('0x2b')],'sectionId':_0x1ac1b0['id']},{})[_0xedac('0x24')](function(){return _0x3329ca;});}else{return _0x3329ca;}})['catch'](function(_0x5a51c7){logger[_0xedac('0x2a')](_0xedac('0x52'),_0x5a51c7);throw _0x5a51c7;});}return _0x3329ca;})[_0xedac('0x24')](respondWithResult(_0x10070f,0xc9))['catch'](handleError(_0x10070f,null));};exports[_0xedac('0x23')]=function(_0x32c581,_0xaf82a){if(_0x32c581[_0xedac('0x4c')]['id']){delete _0x32c581[_0xedac('0x4c')]['id'];}return db[_0xedac('0x2f')][_0xedac('0x4a')]({'where':{'id':_0x32c581[_0xedac('0x46')]['id']}})[_0xedac('0x24')](handleEntityNotFound(_0xaf82a,null))[_0xedac('0x24')](saveUpdates(_0x32c581['body'],null))['then'](respondWithResult(_0xaf82a,null))[_0xedac('0x44')](handleError(_0xaf82a,null));};exports[_0xedac('0x25')]=function(_0x176b69,_0x29fe75){return db['Disposition'][_0xedac('0x4a')]({'where':{'id':_0x176b69[_0xedac('0x46')]['id']}})[_0xedac('0x24')](handleEntityNotFound(_0x29fe75,null))[_0xedac('0x24')](removeEntity(_0x29fe75,null))[_0xedac('0x44')](handleError(_0x29fe75,null));};
\ No newline at end of file
+var _0x71ab=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','map','Disposition','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x71ab,0x64));var _0xb71a=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x71ab[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb71a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb71a('0x1'));var rp=require('request-promise');var moment=require(_0xb71a('0x2'));var BPromise=require(_0xb71a('0x3'));var Mustache=require(_0xb71a('0x4'));var util=require(_0xb71a('0x5'));var path=require(_0xb71a('0x6'));var sox=require(_0xb71a('0x7'));var csv=require(_0xb71a('0x8'));var ejs=require(_0xb71a('0x9'));var fs=require('fs');var fs_extra=require(_0xb71a('0xa'));var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x8'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb71a('0x18'))['db'];function respondWithStatusCode(_0x50030d,_0x50b43b){_0x50b43b=_0x50b43b||0xcc;return function(_0x3346a5){if(_0x3346a5){return _0x50030d[_0xb71a('0x19')](_0x50b43b);}return _0x50030d[_0xb71a('0x1a')](_0x50b43b)[_0xb71a('0x1b')]();};}function respondWithResult(_0x483d77,_0x47ee48){_0x47ee48=_0x47ee48||0xc8;return function(_0x5364e3){if(_0x5364e3){return _0x483d77[_0xb71a('0x1a')](_0x47ee48)[_0xb71a('0x1c')](_0x5364e3);}};}function respondWithFilteredResult(_0x15252a,_0x42fc55){return function(_0x3cd0f0){if(_0x3cd0f0){var _0x1e9363=typeof _0x42fc55[_0xb71a('0x1d')]===_0xb71a('0x1e')&&typeof _0x42fc55[_0xb71a('0x1f')]==='undefined';var _0x1ca65e=_0x3cd0f0[_0xb71a('0x20')];var _0x374c8c=_0x1e9363?0x0:_0x42fc55[_0xb71a('0x1d')];var _0x2bdb61=_0x1e9363?_0x3cd0f0[_0xb71a('0x20')]:_0x42fc55[_0xb71a('0x1d')]+_0x42fc55[_0xb71a('0x1f')];var _0x20bdfe;if(_0x2bdb61>=_0x1ca65e){_0x2bdb61=_0x1ca65e;_0x20bdfe=0xc8;}else{_0x20bdfe=0xce;}_0x15252a[_0xb71a('0x1a')](_0x20bdfe);return _0x15252a[_0xb71a('0x21')]('Content-Range',_0x374c8c+'-'+_0x2bdb61+'/'+_0x1ca65e)['json'](_0x3cd0f0);}return null;};}function patchUpdates(_0x1358f2){return function(_0x578fe4){try{jsonpatch['apply'](_0x578fe4,_0x1358f2,!![]);}catch(_0x4d8871){return BPromise[_0xb71a('0x22')](_0x4d8871);}return _0x578fe4['save']();};}function saveUpdates(_0x76d6dc,_0x4227c7){return function(_0x3ac77b){if(_0x3ac77b){return _0x3ac77b[_0xb71a('0x23')](_0x76d6dc)[_0xb71a('0x24')](function(_0x14b2a1){return _0x14b2a1;});}return null;};}function removeEntity(_0x2f4fac,_0x14aac7){return function(_0x5f3f19){if(_0x5f3f19){return _0x5f3f19[_0xb71a('0x25')]()[_0xb71a('0x24')](function(){var _0x353930=_0x5f3f19[_0xb71a('0x26')]({'plain':!![]});var _0x3401f7=_0xb71a('0x27');return db[_0xb71a('0x28')][_0xb71a('0x25')]({'where':{'type':_0x3401f7,'resourceId':_0x353930['id']}})[_0xb71a('0x24')](function(){return _0x5f3f19;});})[_0xb71a('0x24')](function(){_0x2f4fac[_0xb71a('0x1a')](0xcc)[_0xb71a('0x1b')]();});}};}function handleEntityNotFound(_0x160f0f,_0x5ae0ed){return function(_0x2e8ea6){if(!_0x2e8ea6){_0x160f0f[_0xb71a('0x19')](0x194);}return _0x2e8ea6;};}function handleError(_0x1689ce,_0x358954){_0x358954=_0x358954||0x1f4;return function(_0x2fbd73){logger[_0xb71a('0x29')](_0x2fbd73[_0xb71a('0x2a')]);if(_0x2fbd73[_0xb71a('0x2b')]){delete _0x2fbd73[_0xb71a('0x2b')];}_0x1689ce[_0xb71a('0x1a')](_0x358954)[_0xb71a('0x2c')](_0x2fbd73);};}exports['index']=function(_0x56f5a4,_0x3112d3){var _0x5c2a45={},_0x70299a={},_0x1b1aa8={'count':0x0,'rows':[]};var _0x4d9e1a=_[_0xb71a('0x2d')](db[_0xb71a('0x2e')][_0xb71a('0x2f')],function(_0x251d82){return{'name':_0x251d82[_0xb71a('0x30')],'type':_0x251d82[_0xb71a('0x31')]['key']};});_0x70299a[_0xb71a('0x32')]=_[_0xb71a('0x2d')](_0x4d9e1a,_0xb71a('0x2b'));_0x70299a[_0xb71a('0x33')]=_['keys'](_0x56f5a4[_0xb71a('0x33')]);_0x70299a[_0xb71a('0x34')]=_[_0xb71a('0x35')](_0x70299a[_0xb71a('0x32')],_0x70299a[_0xb71a('0x33')]);_0x5c2a45[_0xb71a('0x36')]=_[_0xb71a('0x35')](_0x70299a[_0xb71a('0x32')],qs[_0xb71a('0x37')](_0x56f5a4[_0xb71a('0x33')]['fields']));_0x5c2a45['attributes']=_0x5c2a45[_0xb71a('0x36')][_0xb71a('0x38')]?_0x5c2a45[_0xb71a('0x36')]:_0x70299a[_0xb71a('0x32')];if(!_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x39')](_0xb71a('0x3a'))){_0x5c2a45['limit']=qs[_0xb71a('0x1f')](_0x56f5a4['query'][_0xb71a('0x1f')]);_0x5c2a45[_0xb71a('0x1d')]=qs[_0xb71a('0x1d')](_0x56f5a4[_0xb71a('0x33')]['offset']);}_0x5c2a45[_0xb71a('0x3b')]=qs[_0xb71a('0x3c')](_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x3c')]);_0x5c2a45[_0xb71a('0x3d')]=qs[_0xb71a('0x34')](_[_0xb71a('0x3e')](_0x56f5a4[_0xb71a('0x33')],_0x70299a[_0xb71a('0x34')]),_0x4d9e1a);if(_0x56f5a4['query'][_0xb71a('0x3f')]){_0x5c2a45['where']=_[_0xb71a('0x40')](_0x5c2a45[_0xb71a('0x3d')],{'$or':_[_0xb71a('0x2d')](_0x4d9e1a,function(_0x3cca63){if(_0x3cca63[_0xb71a('0x31')]!==_0xb71a('0x41')){var _0x4aa607={};_0x4aa607[_0x3cca63['name']]={'$like':'%'+_0x56f5a4['query'][_0xb71a('0x3f')]+'%'};return _0x4aa607;}})});}_0x5c2a45=_['merge']({},_0x5c2a45,_0x56f5a4[_0xb71a('0x42')]);var _0x23f542={'where':_0x5c2a45[_0xb71a('0x3d')]};return db[_0xb71a('0x2e')][_0xb71a('0x20')](_0x23f542)[_0xb71a('0x24')](function(_0x59530a){_0x1b1aa8[_0xb71a('0x20')]=_0x59530a;if(_0x56f5a4[_0xb71a('0x33')][_0xb71a('0x43')]){_0x5c2a45[_0xb71a('0x44')]=[{'all':!![]}];}return db[_0xb71a('0x2e')][_0xb71a('0x45')](_0x5c2a45);})['then'](function(_0x2afff3){_0x1b1aa8[_0xb71a('0x46')]=_0x2afff3;return _0x1b1aa8;})[_0xb71a('0x24')](respondWithFilteredResult(_0x3112d3,_0x5c2a45))[_0xb71a('0x47')](handleError(_0x3112d3,null));};exports[_0xb71a('0x48')]=function(_0x8f97ff,_0x1d1c38){var _0x48baae={'raw':!![],'where':{'id':_0x8f97ff[_0xb71a('0x49')]['id']}},_0x48db05={};_0x48db05[_0xb71a('0x32')]=_[_0xb71a('0x4a')](db[_0xb71a('0x2e')]['rawAttributes']);_0x48db05[_0xb71a('0x33')]=_['keys'](_0x8f97ff[_0xb71a('0x33')]);_0x48db05[_0xb71a('0x34')]=_['intersection'](_0x48db05[_0xb71a('0x32')],_0x48db05[_0xb71a('0x33')]);_0x48baae[_0xb71a('0x36')]=_[_0xb71a('0x35')](_0x48db05['model'],qs[_0xb71a('0x37')](_0x8f97ff[_0xb71a('0x33')][_0xb71a('0x37')]));_0x48baae['attributes']=_0x48baae[_0xb71a('0x36')][_0xb71a('0x38')]?_0x48baae[_0xb71a('0x36')]:_0x48db05['model'];if(_0x8f97ff[_0xb71a('0x33')][_0xb71a('0x43')]){_0x48baae[_0xb71a('0x44')]=[{'all':!![]}];}_0x48baae=_[_0xb71a('0x40')]({},_0x48baae,_0x8f97ff[_0xb71a('0x42')]);return db['Disposition'][_0xb71a('0x4b')](_0x48baae)[_0xb71a('0x24')](handleEntityNotFound(_0x1d1c38,null))[_0xb71a('0x24')](respondWithResult(_0x1d1c38,null))[_0xb71a('0x47')](handleError(_0x1d1c38,null));};exports['create']=function(_0x48fbde,_0x23b4c0){return db[_0xb71a('0x2e')][_0xb71a('0x4c')](_0x48fbde[_0xb71a('0x4d')],{})[_0xb71a('0x24')](function(_0x2f2187){var _0x2a7804=_0x48fbde[_0xb71a('0x4e')][_0xb71a('0x26')]({'plain':!![]});if(!_0x2a7804)throw new Error(_0xb71a('0x4f'));if(_0x2a7804['role']===_0xb71a('0x4e')){var _0x2ce711=_0x2f2187['get']({'plain':!![]});var _0x1c0536='Dispositions';return db[_0xb71a('0x50')][_0xb71a('0x4b')]({'where':{'name':_0x1c0536,'userProfileId':_0x2a7804[_0xb71a('0x51')]},'raw':!![]})[_0xb71a('0x24')](function(_0x84c587){if(_0x84c587&&_0x84c587['autoAssociation']===0x0){return db[_0xb71a('0x28')]['create']({'name':_0x2ce711[_0xb71a('0x2b')],'resourceId':_0x2ce711['id'],'type':_0x84c587[_0xb71a('0x2b')],'sectionId':_0x84c587['id']},{})['then'](function(){return _0x2f2187;});}else{return _0x2f2187;}})['catch'](function(_0x1d534d){logger[_0xb71a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d534d);throw _0x1d534d;});}return _0x2f2187;})['then'](respondWithResult(_0x23b4c0,0xc9))['catch'](handleError(_0x23b4c0,null));};exports[_0xb71a('0x23')]=function(_0x57ef8f,_0x59d583){if(_0x57ef8f[_0xb71a('0x4d')]['id']){delete _0x57ef8f[_0xb71a('0x4d')]['id'];}return db[_0xb71a('0x2e')][_0xb71a('0x4b')]({'where':{'id':_0x57ef8f['params']['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x59d583,null))[_0xb71a('0x24')](saveUpdates(_0x57ef8f[_0xb71a('0x4d')],null))['then'](respondWithResult(_0x59d583,null))[_0xb71a('0x47')](handleError(_0x59d583,null));};exports[_0xb71a('0x25')]=function(_0x4dee60,_0x2d14f0){return db[_0xb71a('0x2e')][_0xb71a('0x4b')]({'where':{'id':_0x4dee60['params']['id']}})[_0xb71a('0x24')](handleEntityNotFound(_0x2d14f0,null))['then'](removeEntity(_0x2d14f0,null))[_0xb71a('0x47')](handleError(_0x2d14f0,null));};
\ No newline at end of file
index 00913b7..29c881e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae5=['request-promise','path','rimraf','../../config/environment','exports','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x8ef83d,_0x520c3d){var _0x4a4a19=function(_0x189336){while(--_0x189336){_0x8ef83d['push'](_0x8ef83d['shift']());}};_0x4a4a19(++_0x520c3d);}(_0x1ae5,0xb3));var _0x51ae=function(_0x34901f,_0x2e8786){_0x34901f=_0x34901f-0x0;var _0x3a9371=_0x1ae5[_0x34901f];return _0x3a9371;};'use strict';var _=require(_0x51ae('0x0'));var util=require('util');var logger=require(_0x51ae('0x1'))(_0x51ae('0x2'));var moment=require(_0x51ae('0x3'));var BPromise=require(_0x51ae('0x4'));var rp=require(_0x51ae('0x5'));var fs=require('fs');var path=require(_0x51ae('0x6'));var rimraf=require(_0x51ae('0x7'));var config=require(_0x51ae('0x8'));var attributes=require('./disposition.attributes');module[_0x51ae('0x9')]=function(_0x36a850,_0x20bc66){return _0x36a850['define'](_0x51ae('0xa'),attributes,{'tableName':_0x51ae('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x51ae('0xc')]},{'unique':!![],'name':_0x51ae('0xd'),'fields':[_0x51ae('0xe'),_0x51ae('0xf')]},{'unique':!![],'name':_0x51ae('0x10'),'fields':[_0x51ae('0xe'),_0x51ae('0x11')]},{'unique':!![],'name':_0x51ae('0x12'),'fields':[_0x51ae('0xe'),_0x51ae('0x13')]},{'unique':!![],'name':_0x51ae('0x14'),'fields':['name',_0x51ae('0x15')]},{'unique':!![],'name':'name_openchannel','fields':[_0x51ae('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x51ae('0xe'),_0x51ae('0x16')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd221=['name_voice','name','name_chat','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','util','api','moment','request-promise','./disposition.attributes','exports','define','Disposition','tools_dispositions'];(function(_0x5b1b8d,_0xf4575b){var _0xbd8358=function(_0x488832){while(--_0x488832){_0x5b1b8d['push'](_0x5b1b8d['shift']());}};_0xbd8358(++_0xf4575b);}(_0xd221,0x186));var _0x1d22=function(_0x52aa99,_0x193333){_0x52aa99=_0x52aa99-0x0;var _0x11f1ab=_0xd221[_0x52aa99];return _0x11f1ab;};'use strict';var _=require('lodash');var util=require(_0x1d22('0x0'));var logger=require('../../config/logger')(_0x1d22('0x1'));var moment=require(_0x1d22('0x2'));var BPromise=require('bluebird');var rp=require(_0x1d22('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1d22('0x4'));module[_0x1d22('0x5')]=function(_0x1a3d81,_0x14361f){return _0x1a3d81[_0x1d22('0x6')](_0x1d22('0x7'),attributes,{'tableName':_0x1d22('0x8'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1d22('0x9'),'fields':[_0x1d22('0xa'),'ListId']},{'unique':!![],'name':_0x1d22('0xb'),'fields':[_0x1d22('0xa'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x1d22('0xa'),_0x1d22('0xc')]},{'unique':!![],'name':_0x1d22('0xd'),'fields':['name',_0x1d22('0xe')]},{'unique':!![],'name':_0x1d22('0xf'),'fields':['name',_0x1d22('0x10')]},{'unique':!![],'name':_0x1d22('0x11'),'fields':['name',_0x1d22('0x12')]},{'unique':!![],'name':_0x1d22('0x13'),'fields':[_0x1d22('0xa'),_0x1d22('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
index f780748..b971d1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x201283,_0x37bc1c){var _0x11eada=function(_0xaa0970){while(--_0xaa0970){_0x201283['push'](_0x201283['shift']());}};_0x11eada(++_0x37bc1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3bc001,_0x417f03){var _0x5f25b7=function(_0x3d6beb){while(--_0x3d6beb){_0x3bc001['push'](_0x3bc001['shift']());}};_0x5f25b7(++_0x417f03);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 0cdf712..189cd93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263a=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','post','create','update','delete'];(function(_0x11f28f,_0x30ebf9){var _0x413f1a=function(_0x537f8b){while(--_0x537f8b){_0x11f28f['push'](_0x11f28f['shift']());}};_0x413f1a(++_0x30ebf9);}(_0x263a,0x112));var _0xa263=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x263a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa263('0x0'));var util=require(_0xa263('0x1'));var path=require(_0xa263('0x2'));var timeout=require(_0xa263('0x3'));var express=require('express');var router=express[_0xa263('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa263('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa263('0x6'));var controller=require('./disposition.controller');router[_0xa263('0x7')]('/',auth[_0xa263('0x8')](),controller[_0xa263('0x9')]);router['get']('/:id',auth[_0xa263('0x8')](),controller[_0xa263('0xa')]);router[_0xa263('0xb')]('/',auth[_0xa263('0x8')](),controller[_0xa263('0xc')]);router['put']('/:id',auth[_0xa263('0x8')](),controller[_0xa263('0xd')]);router[_0xa263('0xe')]('/:id',auth[_0xa263('0x8')](),controller[_0xa263('0xf')]);module[_0xa263('0x10')]=router;
\ No newline at end of file
+var _0xde0b=['./disposition.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xde0b,0xd9));var _0xbde0=function(_0xfa3937,_0x1ba5a1){_0xfa3937=_0xfa3937-0x0;var _0x145823=_0xde0b[_0xfa3937];return _0x145823;};'use strict';var multer=require(_0xbde0('0x0'));var util=require(_0xbde0('0x1'));var path=require(_0xbde0('0x2'));var timeout=require(_0xbde0('0x3'));var express=require('express');var router=express[_0xbde0('0x4')]();var fs_extra=require(_0xbde0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbde0('0x6'));var config=require('../../config/environment');var controller=require(_0xbde0('0x7'));router[_0xbde0('0x8')]('/',auth[_0xbde0('0x9')](),controller['index']);router[_0xbde0('0x8')](_0xbde0('0xa'),auth[_0xbde0('0x9')](),controller[_0xbde0('0xb')]);router[_0xbde0('0xc')]('/',auth[_0xbde0('0x9')](),controller[_0xbde0('0xd')]);router[_0xbde0('0xe')]('/:id',auth[_0xbde0('0x9')](),controller['update']);router[_0xbde0('0xf')](_0xbde0('0xa'),auth[_0xbde0('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 42db743..275759c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc5b=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xbc5b,0x1d1));var _0xbbc5=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbc5b[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xbbc5('0x0'));module['exports']={'name':{'type':Sequelize[_0xbbc5('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbbc5('0x1')]},'ecm':{'type':Sequelize[_0xbbc5('0x2')]('yes','no'),'defaultValue':_0xbbc5('0x3')},'headerinfo':{'type':Sequelize[_0xbbc5('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xbbc5('0x4')},'minrate':{'type':Sequelize[_0xbbc5('0x2')](_0xbbc5('0x5'),_0xbbc5('0x6'),_0xbbc5('0x7'),_0xbbc5('0x8'),_0xbbc5('0x9'),_0xbbc5('0xa')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xbbc5('0x2')]('2400',_0xbbc5('0x6'),_0xbbc5('0x7'),'9600',_0xbbc5('0x9'),'14400'),'defaultValue':_0xbbc5('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xbbc5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xbbc5('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xbbc5('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xbbc5('0x2')](_0xbbc5('0xc'),_0xbbc5('0xd'),_0xbbc5('0xe'),_0xbbc5('0xf')),'defaultValue':_0xbbc5('0xc')},'key':{'type':Sequelize[_0xbbc5('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbbc5('0x10');}},'notificationSound':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbbc5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xbbc5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbbc5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbbc5('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0xbbc5('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xbbc5('0x11')],'defaultValue':![],'comment':_0xbbc5('0x13'),'set':function(_0x543119){if(!_0x543119)this[_0xbbc5('0x14')]('mandatoryDispositionPauseId',null);this[_0xbbc5('0x14')]('mandatoryDisposition',_0x543119);}}};
\ No newline at end of file
+var _0xa495=['mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','14400','12000','v17,v27,v29','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue'];(function(_0x423c2d,_0x2e1541){var _0x2a9ae6=function(_0x33a0d8){while(--_0x33a0d8){_0x423c2d['push'](_0x423c2d['shift']());}};_0x2a9ae6(++_0x2e1541);}(_0xa495,0x79));var _0x5a49=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xa495[_0x1e354d];return _0x25445d;};'use strict';var Sequelize=require(_0x5a49('0x0'));module[_0x5a49('0x1')]={'name':{'type':Sequelize[_0x5a49('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5a49('0x2')]},'ecm':{'type':Sequelize[_0x5a49('0x3')](_0x5a49('0x4'),'no'),'defaultValue':_0x5a49('0x4')},'headerinfo':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':_0x5a49('0x5')},'localstationid':{'type':Sequelize[_0x5a49('0x2')],'unique':_0x5a49('0x6')},'minrate':{'type':Sequelize[_0x5a49('0x3')](_0x5a49('0x7'),_0x5a49('0x8'),_0x5a49('0x9'),_0x5a49('0xa'),'12000',_0x5a49('0xb')),'defaultValue':_0x5a49('0x8')},'maxrate':{'type':Sequelize[_0x5a49('0x3')]('2400',_0x5a49('0x8'),_0x5a49('0x9'),'9600',_0x5a49('0xc'),_0x5a49('0xb')),'defaultValue':_0x5a49('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5a49('0xd')},'gateway':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5a49('0x3')](_0x5a49('0xe'),_0x5a49('0xf'),_0x5a49('0x10'),_0x5a49('0x11')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5a49('0x12')],'defaultValue':function(){return _0x5a49('0x13');}},'notificationSound':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a49('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a49('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a49('0x15')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a49('0x15')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5a49('0x14')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x82640c){if(!_0x82640c)this[_0x5a49('0x16')](_0x5a49('0x17'),null);this[_0x5a49('0x16')]('mandatoryDisposition',_0x82640c);}}};
\ No newline at end of file
index 43c735a..52fe61c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed03=['count','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','show','Pause','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','params','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','CannedAnswer','getAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','hasOwnProperty','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','rows','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','getApplications','context','exten','localstationid','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0xed03,0x96));var _0x3ed0=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xed03[_0x5e36d1];return _0x950b9e;};'use strict';var emlformat=require(_0x3ed0('0x0'));var rimraf=require(_0x3ed0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3ed0('0x2'));var rp=require(_0x3ed0('0x3'));var moment=require(_0x3ed0('0x4'));var BPromise=require(_0x3ed0('0x5'));var Mustache=require(_0x3ed0('0x6'));var util=require(_0x3ed0('0x7'));var path=require(_0x3ed0('0x8'));var sox=require(_0x3ed0('0x9'));var csv=require(_0x3ed0('0xa'));var ejs=require(_0x3ed0('0xb'));var fs=require('fs');var fs_extra=require(_0x3ed0('0xc'));var _=require(_0x3ed0('0xd'));var squel=require(_0x3ed0('0xe'));var crypto=require(_0x3ed0('0xf'));var jsforce=require(_0x3ed0('0x10'));var deskjs=require(_0x3ed0('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3ed0('0x12'));var authService=require(_0x3ed0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3ed0('0x14'));var hardwareService=require(_0x3ed0('0x15'));var logger=require('../../config/logger')(_0x3ed0('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3ed0('0x17'));var db=require('../../mysqldb')['db'];config[_0x3ed0('0x18')]=_[_0x3ed0('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3ed0('0x1a'))(new Redis(config[_0x3ed0('0x18')]));require(_0x3ed0('0x1b'))[_0x3ed0('0x1c')](socket);var jayson=require(_0x3ed0('0x1d'));var client=jayson[_0x3ed0('0x1e')][_0x3ed0('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x3ed0('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x20e9a1,_0x4bc28e,_0x20cfb3,_0x599e95){return new BPromise(function(_0x49ec2e,_0x459f2b){var _0x53fd74=_0x599e95||client;return _0x53fd74[_0x3ed0('0x20')](_0x20e9a1,_0x20cfb3)[_0x3ed0('0x21')](function(_0x2740c4){logger[_0x3ed0('0x22')](_0x3ed0('0x23'),_0x4bc28e,_0x3ed0('0x24'));logger[_0x3ed0('0x25')](_0x3ed0('0x26'),_0x4bc28e,_0x3ed0('0x24'),JSON[_0x3ed0('0x27')](_0x2740c4));if(_0x2740c4[_0x3ed0('0x28')]){if(_0x2740c4[_0x3ed0('0x28')][_0x3ed0('0x29')]===0x1f4){logger[_0x3ed0('0x28')](_0x3ed0('0x23'),_0x4bc28e,_0x2740c4[_0x3ed0('0x28')]['message']);return _0x459f2b(_0x2740c4['error'][_0x3ed0('0x2a')]);}logger[_0x3ed0('0x28')](_0x3ed0('0x23'),_0x4bc28e,_0x2740c4[_0x3ed0('0x28')][_0x3ed0('0x2a')]);return _0x49ec2e(_0x2740c4['error'][_0x3ed0('0x2a')]);}else{logger[_0x3ed0('0x22')](_0x3ed0('0x23'),_0x4bc28e,_0x3ed0('0x24'));_0x49ec2e(_0x2740c4[_0x3ed0('0x2b')][_0x3ed0('0x2a')]);}})[_0x3ed0('0x2c')](function(_0x57b9d7){logger['error'](_0x3ed0('0x23'),_0x4bc28e,_0x57b9d7);_0x459f2b(_0x57b9d7);});});}function respondWithStatusCode(_0x59f426,_0x205f04){_0x205f04=_0x205f04||0xcc;return function(_0x3ebf09){if(_0x3ebf09){return _0x59f426['sendStatus'](_0x205f04);}return _0x59f426[_0x3ed0('0x2d')](_0x205f04)['end']();};}function respondWithResult(_0x43e4f5,_0x57a862){_0x57a862=_0x57a862||0xc8;return function(_0x1636bf){if(_0x1636bf){return _0x43e4f5[_0x3ed0('0x2d')](_0x57a862)[_0x3ed0('0x2e')](_0x1636bf);}};}function respondWithFilteredResult(_0x334932,_0x37b455){return function(_0x2605ed){if(_0x2605ed){var _0x100eda=typeof _0x37b455[_0x3ed0('0x2f')]===_0x3ed0('0x30')&&typeof _0x37b455['limit']===_0x3ed0('0x30');var _0x1dbdfb=_0x2605ed[_0x3ed0('0x31')];var _0x515adc=_0x100eda?0x0:_0x37b455['offset'];var _0x3e2c0e=_0x100eda?_0x2605ed[_0x3ed0('0x31')]:_0x37b455[_0x3ed0('0x2f')]+_0x37b455[_0x3ed0('0x32')];var _0x3397cf;if(_0x3e2c0e>=_0x1dbdfb){_0x3e2c0e=_0x1dbdfb;_0x3397cf=0xc8;}else{_0x3397cf=0xce;}_0x334932[_0x3ed0('0x2d')](_0x3397cf);return _0x334932[_0x3ed0('0x33')](_0x3ed0('0x34'),_0x515adc+'-'+_0x3e2c0e+'/'+_0x1dbdfb)[_0x3ed0('0x2e')](_0x2605ed);}return null;};}function patchUpdates(_0x8e7b5){return function(_0x5c08c7){try{jsonpatch[_0x3ed0('0x35')](_0x5c08c7,_0x8e7b5,!![]);}catch(_0x226333){return BPromise[_0x3ed0('0x36')](_0x226333);}return _0x5c08c7[_0x3ed0('0x37')]();};}function saveUpdates(_0x4ad241,_0x2b2cc6){return function(_0x1b7e66){if(_0x1b7e66){return _0x1b7e66[_0x3ed0('0x38')](_0x4ad241)[_0x3ed0('0x21')](function(_0x312e2c){return _0x312e2c;});}return null;};}function removeEntity(_0x5306f8,_0x757a16){return function(_0x37465d){if(_0x37465d){return _0x37465d[_0x3ed0('0x39')]()[_0x3ed0('0x21')](function(){var _0xdce45=_0x37465d[_0x3ed0('0x3a')]({'plain':!![]});var _0x25e565='FaxAccounts';return db[_0x3ed0('0x3b')][_0x3ed0('0x39')]({'where':{'type':_0x25e565,'resourceId':_0xdce45['id']}})['then'](function(){return _0x37465d;});})[_0x3ed0('0x21')](function(){_0x5306f8[_0x3ed0('0x2d')](0xcc)[_0x3ed0('0x3c')]();});}};}function handleEntityNotFound(_0x227098,_0x17a4fb){return function(_0x1eb356){if(!_0x1eb356){_0x227098[_0x3ed0('0x3d')](0x194);}return _0x1eb356;};}function handleError(_0x2b6794,_0x113568){_0x113568=_0x113568||0x1f4;return function(_0x2b232f){logger[_0x3ed0('0x28')](_0x2b232f[_0x3ed0('0x3e')]);if(_0x2b232f[_0x3ed0('0x3f')]){delete _0x2b232f[_0x3ed0('0x3f')];}_0x2b6794[_0x3ed0('0x2d')](_0x113568)[_0x3ed0('0x40')](_0x2b232f);};}exports[_0x3ed0('0x41')]=function(_0x6ba2cb,_0x4b0740){var _0x5d70a3={'include':[{'model':db['Pause'],'as':_0x3ed0('0x42')}]},_0x5e4509={},_0x186ee4={'count':0x0,'rows':[]};var _0x3ef3ee=_[_0x3ed0('0x43')](db[_0x3ed0('0x44')][_0x3ed0('0x45')],function(_0x37e877){return{'name':_0x37e877[_0x3ed0('0x46')],'type':_0x37e877['type'][_0x3ed0('0x47')]};});_0x5e4509['model']=_[_0x3ed0('0x43')](_0x3ef3ee,_0x3ed0('0x3f'));_0x5e4509[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x6ba2cb['query']);_0x5e4509[_0x3ed0('0x4a')]=_['intersection'](_0x5e4509[_0x3ed0('0x4b')],_0x5e4509[_0x3ed0('0x48')]);_0x5d70a3[_0x3ed0('0x4c')]=_['intersection'](_0x5e4509['model'],qs[_0x3ed0('0x4d')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x5d70a3['attributes']=_0x5d70a3[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x5d70a3[_0x3ed0('0x4c')]:_0x5e4509['model'];if(!_0x6ba2cb['query']['hasOwnProperty'](_0x3ed0('0x4f'))){_0x5d70a3[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x5d70a3[_0x3ed0('0x2f')]=qs[_0x3ed0('0x2f')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x5d70a3[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x5d70a3[_0x3ed0('0x52')]=qs['filters'](_[_0x3ed0('0x53')](_0x6ba2cb[_0x3ed0('0x48')],_0x5e4509['filters']),_0x3ef3ee);if(_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x54')]){_0x5d70a3[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x5d70a3[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x3ef3ee,function(_0x751022){if(_0x751022[_0x3ed0('0x56')]!=='VIRTUAL'){var _0x58742b={};_0x58742b[_0x751022['name']]={'$like':'%'+_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x58742b;}})});}_0x5d70a3=_[_0x3ed0('0x55')]({},_0x5d70a3,_0x6ba2cb[_0x3ed0('0x57')]);var _0x5bf125={'where':_0x5d70a3[_0x3ed0('0x52')]};return db[_0x3ed0('0x44')][_0x3ed0('0x31')](_0x5bf125)[_0x3ed0('0x21')](function(_0x354978){_0x186ee4[_0x3ed0('0x31')]=_0x354978;if(_0x6ba2cb[_0x3ed0('0x48')][_0x3ed0('0x58')]){_0x5d70a3[_0x3ed0('0x59')]=[{'all':!![]}];}return db[_0x3ed0('0x44')][_0x3ed0('0x5a')](_0x5d70a3);})['then'](function(_0x244046){_0x186ee4['rows']=_0x244046;return _0x186ee4;})[_0x3ed0('0x21')](respondWithFilteredResult(_0x4b0740,_0x5d70a3))[_0x3ed0('0x2c')](handleError(_0x4b0740,null));};exports[_0x3ed0('0x5b')]=function(_0x37f764,_0x563fc9){var _0x739be7={'raw':![],'where':{'id':_0x37f764['params']['id']},'include':[{'model':db[_0x3ed0('0x5c')],'as':_0x3ed0('0x42')}]},_0xefa8de={};_0xefa8de['model']=_[_0x3ed0('0x49')](db[_0x3ed0('0x44')][_0x3ed0('0x45')]);_0xefa8de[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x37f764['query']);_0xefa8de[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0xefa8de[_0x3ed0('0x4b')],_0xefa8de[_0x3ed0('0x48')]);_0x739be7[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0xefa8de[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x37f764[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x739be7[_0x3ed0('0x4c')]=_0x739be7[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x739be7[_0x3ed0('0x4c')]:_0xefa8de[_0x3ed0('0x4b')];if(_0x37f764[_0x3ed0('0x48')][_0x3ed0('0x58')]){_0x739be7['include']=[{'all':!![]}];}_0x739be7=_[_0x3ed0('0x55')]({},_0x739be7,_0x37f764[_0x3ed0('0x57')]);return db['FaxAccount'][_0x3ed0('0x5e')](_0x739be7)[_0x3ed0('0x21')](handleEntityNotFound(_0x563fc9,null))['then'](respondWithResult(_0x563fc9,null))[_0x3ed0('0x2c')](handleError(_0x563fc9,null));};exports['create']=function(_0x160d64,_0x30ca81){return db[_0x3ed0('0x44')][_0x3ed0('0x5f')](_0x160d64[_0x3ed0('0x60')],{})['then'](function(_0x5b498f){var _0x409935=_0x160d64[_0x3ed0('0x61')][_0x3ed0('0x3a')]({'plain':!![]});if(!_0x409935)throw new Error(_0x3ed0('0x62'));if(_0x409935['role']===_0x3ed0('0x61')){var _0x5b75e4=_0x5b498f[_0x3ed0('0x3a')]({'plain':!![]});var _0x244edc=_0x3ed0('0x63');return db[_0x3ed0('0x64')][_0x3ed0('0x5e')]({'where':{'name':_0x244edc,'userProfileId':_0x409935[_0x3ed0('0x65')]},'raw':!![]})[_0x3ed0('0x21')](function(_0x4aab91){if(_0x4aab91&&_0x4aab91[_0x3ed0('0x66')]===0x0){return db[_0x3ed0('0x3b')][_0x3ed0('0x5f')]({'name':_0x5b75e4[_0x3ed0('0x3f')],'resourceId':_0x5b75e4['id'],'type':_0x4aab91[_0x3ed0('0x3f')],'sectionId':_0x4aab91['id']},{})[_0x3ed0('0x21')](function(){return _0x5b498f;});}else{return _0x5b498f;}})[_0x3ed0('0x2c')](function(_0x15289e){logger[_0x3ed0('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15289e);throw _0x15289e;});}return _0x5b498f;})[_0x3ed0('0x21')](respondWithResult(_0x30ca81,0xc9))[_0x3ed0('0x2c')](handleError(_0x30ca81,null));};exports[_0x3ed0('0x38')]=function(_0x111f23,_0x3cd057){if(_0x111f23['body']['id']){delete _0x111f23[_0x3ed0('0x60')]['id'];}return db['FaxAccount'][_0x3ed0('0x5e')]({'where':{'id':_0x111f23['params']['id']},'include':[{'model':db[_0x3ed0('0x5c')],'as':_0x3ed0('0x42')}]})[_0x3ed0('0x21')](handleEntityNotFound(_0x3cd057,null))[_0x3ed0('0x21')](saveUpdates(_0x111f23['body'],null))[_0x3ed0('0x21')](respondWithResult(_0x3cd057,null))[_0x3ed0('0x2c')](handleError(_0x3cd057,null));};exports[_0x3ed0('0x39')]=function(_0x1ce0ae,_0x40a728){return db[_0x3ed0('0x44')]['find']({'where':{'id':_0x1ce0ae['params']['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x40a728,null))[_0x3ed0('0x21')](removeEntity(_0x40a728,null))['catch'](handleError(_0x40a728,null));};exports[_0x3ed0('0x67')]=function(_0x168ba6,_0x5771bf){return db[_0x3ed0('0x44')][_0x3ed0('0x67')]()['then'](respondWithResult(_0x5771bf,null))['catch'](handleError(_0x5771bf,null));};exports[_0x3ed0('0x68')]=function(_0x4cd4f4,_0x326f5a,_0x4c41e7){if(_0x4cd4f4[_0x3ed0('0x60')]['id']){delete _0x4cd4f4[_0x3ed0('0x60')]['id'];}return db[_0x3ed0('0x44')][_0x3ed0('0x5e')]({'where':{'id':_0x4cd4f4[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x326f5a,null))['then'](function(_0x150792){if(_0x150792){_0x4cd4f4[_0x3ed0('0x60')][_0x3ed0('0x6a')]=_0x150792['id'];return db['Disposition'][_0x3ed0('0x5f')](_0x4cd4f4[_0x3ed0('0x60')]);}})[_0x3ed0('0x21')](respondWithResult(_0x326f5a,null))[_0x3ed0('0x2c')](handleError(_0x326f5a,null));};exports[_0x3ed0('0x6b')]=function(_0x5a88c6,_0x46772c,_0x198315){var _0x191506={'raw':![],'where':{}};var _0x19b38a={};var _0x251a2d={'count':0x0,'rows':[]};return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x5a88c6[_0x3ed0('0x69')]['id']}})['then'](handleEntityNotFound(_0x46772c,null))['then'](function(_0x376adc){if(_0x376adc){_0x19b38a[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db[_0x3ed0('0x6d')][_0x3ed0('0x45')]);_0x19b38a[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x5a88c6[_0x3ed0('0x48')]);_0x19b38a[_0x3ed0('0x4a')]=_['intersection'](_0x19b38a[_0x3ed0('0x4b')],_0x19b38a[_0x3ed0('0x48')]);_0x191506['attributes']=_['intersection'](_0x19b38a['model'],qs['fields'](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x191506['attributes']=_0x191506[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x191506[_0x3ed0('0x4c')]:_0x19b38a[_0x3ed0('0x4b')];if(!_0x5a88c6[_0x3ed0('0x48')]['hasOwnProperty'](_0x3ed0('0x4f'))){_0x191506[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x191506[_0x3ed0('0x2f')]=qs[_0x3ed0('0x2f')](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x191506[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x191506[_0x3ed0('0x52')]=qs['filters'](_[_0x3ed0('0x53')](_0x5a88c6[_0x3ed0('0x48')],_0x19b38a[_0x3ed0('0x4a')]));_0x191506['where'][_0x3ed0('0x6a')]=_0x376adc['id'];if(_0x5a88c6['query'][_0x3ed0('0x54')]){_0x191506[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x191506[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x191506[_0x3ed0('0x4c')],function(_0x5009ef){var _0x1bf0be={};_0x1bf0be[_0x5009ef]={'$like':'%'+_0x5a88c6[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x1bf0be;})});}_0x191506=_[_0x3ed0('0x55')]({},_0x191506,_0x5a88c6[_0x3ed0('0x57')]);return db['Disposition'][_0x3ed0('0x31')]({'where':_0x191506[_0x3ed0('0x52')]})['then'](function(_0x558c6a){_0x251a2d[_0x3ed0('0x31')]=_0x558c6a;if(_0x5a88c6['query'][_0x3ed0('0x58')]){_0x191506[_0x3ed0('0x59')]=[{'all':!![]}];}return db[_0x3ed0('0x6d')]['findAll'](_0x191506);})[_0x3ed0('0x21')](function(_0x4f0127){_0x251a2d['rows']=_0x4f0127;return _0x251a2d;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0x46772c,_0x191506))['catch'](handleError(_0x46772c,null));};exports[_0x3ed0('0x6e')]=function(_0x48aa38,_0x476f62,_0x39ca2d){return db[_0x3ed0('0x44')][_0x3ed0('0x5e')]({'where':{'id':_0x48aa38[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x476f62,null))['then'](function(_0x1c0f4d){if(_0x1c0f4d){return _0x1c0f4d[_0x3ed0('0x6e')](_0x48aa38[_0x3ed0('0x48')]['ids']);}})[_0x3ed0('0x21')](respondWithStatusCode(_0x476f62,null))[_0x3ed0('0x2c')](handleError(_0x476f62,null));};exports['addAnswer']=function(_0xf70ff3,_0x1d4d5a,_0x4ea420){if(_0xf70ff3[_0x3ed0('0x60')]['id']){delete _0xf70ff3['body']['id'];}return db[_0x3ed0('0x44')]['find']({'where':{'id':_0xf70ff3['params']['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x1d4d5a,null))[_0x3ed0('0x21')](function(_0x3116be){if(_0x3116be){_0xf70ff3[_0x3ed0('0x60')][_0x3ed0('0x6a')]=_0x3116be['id'];return db[_0x3ed0('0x6f')][_0x3ed0('0x5f')](_0xf70ff3[_0x3ed0('0x60')]);}})[_0x3ed0('0x21')](respondWithResult(_0x1d4d5a,null))['catch'](handleError(_0x1d4d5a,null));};exports[_0x3ed0('0x70')]=function(_0x16ba19,_0xc2768c,_0x5c0791){var _0x7ea5cb={'raw':![],'where':{}};var _0x202ec2={};var _0x387505={'count':0x0,'rows':[]};return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x16ba19[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0xc2768c,null))['then'](function(_0xb992c6){if(_0xb992c6){_0x202ec2[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db[_0x3ed0('0x6f')][_0x3ed0('0x45')]);_0x202ec2[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x16ba19['query']);_0x202ec2[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x202ec2[_0x3ed0('0x4b')],_0x202ec2[_0x3ed0('0x48')]);_0x7ea5cb[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x202ec2[_0x3ed0('0x4b')],qs['fields'](_0x16ba19[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x7ea5cb[_0x3ed0('0x4c')]=_0x7ea5cb[_0x3ed0('0x4c')]['length']?_0x7ea5cb['attributes']:_0x202ec2[_0x3ed0('0x4b')];if(!_0x16ba19['query']['hasOwnProperty']('nolimit')){_0x7ea5cb[_0x3ed0('0x32')]=qs['limit'](_0x16ba19[_0x3ed0('0x48')]['limit']);_0x7ea5cb['offset']=qs['offset'](_0x16ba19[_0x3ed0('0x48')]['offset']);}_0x7ea5cb[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x16ba19[_0x3ed0('0x48')]['sort']);_0x7ea5cb[_0x3ed0('0x52')]=qs[_0x3ed0('0x4a')](_['pick'](_0x16ba19[_0x3ed0('0x48')],_0x202ec2[_0x3ed0('0x4a')]));_0x7ea5cb['where'][_0x3ed0('0x6a')]=_0xb992c6['id'];if(_0x16ba19['query']['filter']){_0x7ea5cb[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x7ea5cb['where'],{'$or':_[_0x3ed0('0x43')](_0x7ea5cb[_0x3ed0('0x4c')],function(_0x5d1243){var _0x25b07f={};_0x25b07f[_0x5d1243]={'$like':'%'+_0x16ba19[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x25b07f;})});}_0x7ea5cb=_['merge']({},_0x7ea5cb,_0x16ba19['options']);return db[_0x3ed0('0x6f')][_0x3ed0('0x31')]({'where':_0x7ea5cb[_0x3ed0('0x52')]})[_0x3ed0('0x21')](function(_0x314ca9){_0x387505['count']=_0x314ca9;if(_0x16ba19[_0x3ed0('0x48')]['includeAll']){_0x7ea5cb[_0x3ed0('0x59')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3ed0('0x5a')](_0x7ea5cb);})[_0x3ed0('0x21')](function(_0x18e1b1){_0x387505['rows']=_0x18e1b1;return _0x387505;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0xc2768c,_0x7ea5cb))[_0x3ed0('0x2c')](handleError(_0xc2768c,null));};exports['removeAnswers']=function(_0x75ebc,_0x4eb4d6,_0x3bdc90){return db['FaxAccount'][_0x3ed0('0x5e')]({'where':{'id':_0x75ebc[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x4eb4d6,null))['then'](function(_0x566a09){if(_0x566a09){return _0x566a09['removeAnswers'](_0x75ebc[_0x3ed0('0x48')][_0x3ed0('0x71')]);}})['then'](respondWithStatusCode(_0x4eb4d6,null))[_0x3ed0('0x2c')](handleError(_0x4eb4d6,null));};exports['addInteraction']=function(_0x2bbe73,_0x2d100b,_0x535f1b){return db['FaxInteraction'][_0x3ed0('0x5e')]({'where':{'id':_0x2bbe73[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x2d100b,null))['then'](function(_0xa27581){if(_0xa27581){return _0xa27581[_0x3ed0('0x72')](_0x2bbe73['body'][_0x3ed0('0x71')],_[_0x3ed0('0x73')](_0x2bbe73[_0x3ed0('0x60')],[_0x3ed0('0x71'),'id'])||{});}})[_0x3ed0('0x21')](respondWithResult(_0x2d100b,null))[_0x3ed0('0x2c')](handleError(_0x2d100b,null));};exports[_0x3ed0('0x74')]=function(_0xdd2c8b,_0x4c4459,_0x18712f){var _0x4b57a6={'raw':![],'where':{}};var _0x4f4a40={};var _0x5c9c85={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3ed0('0x6c')]({'where':{'id':_0xdd2c8b[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x4c4459,null))[_0x3ed0('0x21')](function(_0x1a34a6){if(_0x1a34a6){_0x4f4a40['model']=_[_0x3ed0('0x49')](db[_0x3ed0('0x75')][_0x3ed0('0x45')]);_0x4f4a40[_0x3ed0('0x48')]=_['keys'](_0xdd2c8b[_0x3ed0('0x48')]);_0x4f4a40['filters']=_[_0x3ed0('0x5d')](_0x4f4a40[_0x3ed0('0x4b')],_0x4f4a40[_0x3ed0('0x48')]);_0x4b57a6[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x4f4a40[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0xdd2c8b['query'][_0x3ed0('0x4d')]));_0x4b57a6['attributes']=_0x4b57a6[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x4b57a6[_0x3ed0('0x4c')]:_0x4f4a40[_0x3ed0('0x4b')];if(!_0xdd2c8b['query'][_0x3ed0('0x76')]('nolimit')){_0x4b57a6['limit']=qs[_0x3ed0('0x32')](_0xdd2c8b[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x4b57a6['offset']=qs[_0x3ed0('0x2f')](_0xdd2c8b[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x4b57a6[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0xdd2c8b['query'][_0x3ed0('0x51')]);_0x4b57a6[_0x3ed0('0x52')]=qs['filters'](_[_0x3ed0('0x53')](_0xdd2c8b['query'],_0x4f4a40['filters']));_0x4b57a6[_0x3ed0('0x52')][_0x3ed0('0x6a')]=_0x1a34a6['id'];if(_0xdd2c8b['query'][_0x3ed0('0x54')]){_0x4b57a6[_0x3ed0('0x52')]=_['merge'](_0x4b57a6[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x4b57a6['attributes'],function(_0x452176){var _0x3db052={};_0x3db052[_0x452176]={'$like':'%'+_0xdd2c8b[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x3db052;})});}_0x4b57a6=_[_0x3ed0('0x55')]({},_0x4b57a6,_0xdd2c8b['options']);return db[_0x3ed0('0x75')][_0x3ed0('0x31')]({'where':_0x4b57a6[_0x3ed0('0x52')]})['then'](function(_0x3554bb){_0x5c9c85[_0x3ed0('0x31')]=_0x3554bb;if(_0xdd2c8b['query']['includeAll']){_0x4b57a6['include']=[{'model':db[_0x3ed0('0x77')],'as':_0x3ed0('0x78'),'required':![]},{'model':db[_0x3ed0('0x79')],'as':_0x3ed0('0x7a'),'attributes':[_0x3ed0('0x3f'),_0x3ed0('0x7b'),'internal'],'required':![]},{'model':db[_0x3ed0('0x7c')],'as':_0x3ed0('0x7d'),'attributes':['id','name',_0x3ed0('0x7e')],'where':_0xdd2c8b[_0x3ed0('0x48')]['tag']?{'id':_0xdd2c8b['query']['tag']}:undefined,'required':_0xdd2c8b[_0x3ed0('0x48')]['tag']?!![]:![]}];}return db[_0x3ed0('0x75')][_0x3ed0('0x5a')](_0x4b57a6);})[_0x3ed0('0x21')](function(_0x1f9a59){_0x5c9c85[_0x3ed0('0x7f')]=_0x1f9a59;return _0x5c9c85;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0x4c4459,_0x4b57a6))['catch'](handleError(_0x4c4459,null));};exports['addApplications']=function(_0x3e3cf2,_0x230358){var _0x57cbab=_0x3e3cf2['params']['id'];var _0x4bf190=_0x3e3cf2['body'];var _0x4d138c=0xc8;var _0x190cd8=null;return db[_0x3ed0('0x80')][_0x3ed0('0x81')]({'isolationLevel':db[_0x3ed0('0x80')][_0x3ed0('0x82')]['ISOLATION_LEVELS'][_0x3ed0('0x83')]},function(_0x26f537){return db[_0x3ed0('0x44')]['findOne']({'where':{'id':_0x57cbab},'transaction':_0x26f537})[_0x3ed0('0x21')](function(_0x496c12){if(_0x496c12){return db['FaxApplication'][_0x3ed0('0x39')]({'where':{'FaxAccountId':_0x57cbab},'transaction':_0x26f537})[_0x3ed0('0x21')](function(){var _0x84243e=_[_0x3ed0('0x43')](_0x4bf190,function(_0x206817){_0x206817[_0x3ed0('0x6a')]=_0x57cbab;return _0x206817;});return db[_0x3ed0('0x84')][_0x3ed0('0x85')](_0x84243e,{'transaction':_0x26f537});});}else{_0x4d138c=0x194;_0x190cd8=[];}});})[_0x3ed0('0x21')](function(){if(_0x4d138c!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x57cbab},'order':_0x3ed0('0x86')})['then'](function(_0x596496){_0x190cd8=_0x596496;});}})[_0x3ed0('0x2c')](function(_0x436463){_0x4d138c=0x1f4;logger[_0x3ed0('0x28')](_0x436463['stack']);if(_0x436463['name']){delete _0x436463[_0x3ed0('0x3f')];}_0x190cd8=_0x436463;})[_0x3ed0('0x87')](function(){if(_0x190cd8===null){_0x230358['sendStatus'](_0x4d138c);}else{if(_0x4d138c===0x1f4){_0x230358[_0x3ed0('0x2d')](_0x4d138c)[_0x3ed0('0x40')](_0x190cd8);}else{_0x230358[_0x3ed0('0x2d')](_0x4d138c)['json'](_0x190cd8);}}});};exports[_0x3ed0('0x88')]=function(_0x26596f,_0x5cbff2,_0x248a6f){var _0x5bea37={};var _0x1b85b9={};var _0x6e883e;var _0x5276b3;return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x26596f[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x5cbff2,null))[_0x3ed0('0x21')](function(_0x5592d0){if(_0x5592d0){_0x6e883e=_0x5592d0;_0x1b85b9[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db['FaxApplication'][_0x3ed0('0x45')]);_0x1b85b9['query']=_['keys'](_0x26596f[_0x3ed0('0x48')]);_0x1b85b9[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x1b85b9['model'],_0x1b85b9[_0x3ed0('0x48')]);_0x5bea37[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x1b85b9[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x5bea37[_0x3ed0('0x4c')]=_0x5bea37[_0x3ed0('0x4c')]['length']?_0x5bea37[_0x3ed0('0x4c')]:_0x1b85b9[_0x3ed0('0x4b')];_0x5bea37[_0x3ed0('0x50')]=qs['sort'](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x5bea37[_0x3ed0('0x52')]=qs[_0x3ed0('0x4a')](_[_0x3ed0('0x53')](_0x26596f[_0x3ed0('0x48')],_0x1b85b9[_0x3ed0('0x4a')]));if(_0x26596f[_0x3ed0('0x48')]['filter']){_0x5bea37[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x5bea37[_0x3ed0('0x52')],{'$or':_[_0x3ed0('0x43')](_0x5bea37['attributes'],function(_0x2cf0ae){var _0x4ce7b4={};_0x4ce7b4[_0x2cf0ae]={'$like':'%'+_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x4ce7b4;})});}_0x5bea37=_[_0x3ed0('0x55')]({},_0x5bea37,_0x26596f[_0x3ed0('0x57')]);return _0x6e883e[_0x3ed0('0x88')](_0x5bea37);}})[_0x3ed0('0x21')](function(_0x30893d){if(_0x30893d){_0x5276b3=_0x30893d['length'];if(!_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x76')](_0x3ed0('0x4f'))){_0x5bea37[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x32')]);_0x5bea37[_0x3ed0('0x2f')]=qs['offset'](_0x26596f[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}return _0x6e883e[_0x3ed0('0x88')](_0x5bea37);}})['then'](function(_0x3f56db){if(_0x3f56db){return _0x3f56db?{'count':_0x5276b3,'rows':_0x3f56db}:null;}})[_0x3ed0('0x21')](respondWithResult(_0x5cbff2,null))[_0x3ed0('0x2c')](handleError(_0x5cbff2,null));};function Extension(_0x31bc20,_0x39e400,_0x36fe13,_0x400232){this[_0x3ed0('0x89')]='from-voip-provider';this[_0x3ed0('0x8a')]=_0x31bc20[_0x3ed0('0x8b')];this['app']=_0x400232;this['type']=_0x3ed0('0x8c');this[_0x3ed0('0x8d')]=_0x3ed0('0x8e');this['FaxAccountId']=_0x31bc20['id'];this[_0x3ed0('0x86')]=_0x39e400;this[_0x3ed0('0x8f')]=_0x36fe13;}function createExtensionsReciveFax(_0x2f3fe4){var _0x419d61=0x1;var _0x59d181=[];_0x59d181[_0x3ed0('0x90')](new Extension(_0x2f3fe4,_0x419d61,'',_0x3ed0('0x91')));_0x419d61+=0x1;_0x59d181[_0x3ed0('0x90')](new Extension(_0x2f3fe4,_0x419d61,_0x3ed0('0x92'),'Set'));_0x419d61+=0x1;for(var _0x44eaa8 in _0x2f3fe4){if(_0x2f3fe4[_0x3ed0('0x76')](_0x44eaa8)&&(_0x44eaa8==='ecm'||_0x44eaa8==='localstationid'||_0x44eaa8===_0x3ed0('0x93')||_0x44eaa8===_0x3ed0('0x94')||_0x44eaa8===_0x3ed0('0x95')||_0x44eaa8===_0x3ed0('0x96')||_0x44eaa8==='minrate'||_0x44eaa8===_0x3ed0('0x97')||_0x44eaa8===_0x3ed0('0x98'))){_0x59d181['push'](new Extension(_0x2f3fe4,_0x419d61,_0x3ed0('0x99')+_0x44eaa8+')='+_0x2f3fe4[_0x44eaa8],_0x3ed0('0x9a')));_0x419d61+=0x1;}}_0x59d181['push'](new Extension(_0x2f3fe4,_0x419d61,'6',_0x3ed0('0x9b')));_0x419d61+=0x1;_0x59d181[_0x3ed0('0x90')](new Extension(_0x2f3fe4,_0x419d61,_0x3ed0('0x9c'),_0x3ed0('0x9d')));_0x419d61=0x0;return _0x59d181;}exports['addAccountApplications']=function(_0x498573,_0x4ac133,_0x54f7d9){var _0x19d9eb;return db[_0x3ed0('0x80')][_0x3ed0('0x81')](function(_0x57c079){return db[_0x3ed0('0x44')][_0x3ed0('0x5f')](_0x498573['body'],{'transaction':_0x57c079})[_0x3ed0('0x21')](function(_0x48c738){_0x19d9eb=_0x48c738['get']({'plain':!![]});return db['VoiceExtension'][_0x3ed0('0x85')](createExtensionsReciveFax(_0x19d9eb),{'transaction':_0x57c079});});})['then'](function(){return _0x19d9eb;})[_0x3ed0('0x21')](respondWithResult(_0x4ac133,null))[_0x3ed0('0x2c')](handleError(_0x4ac133,null));};exports[_0x3ed0('0x9e')]=function(_0x1ede3e,_0x315891,_0x4950bd){var _0xe4c1c0;return db[_0x3ed0('0x80')]['transaction'](function(_0x135976){return db['FaxAccount'][_0x3ed0('0x38')](_0x1ede3e[_0x3ed0('0x60')],{'where':{'id':_0x1ede3e[_0x3ed0('0x60')]['id']},'transaction':_0x135976})[_0x3ed0('0x21')](function(_0x1eb977){return db[_0x3ed0('0x9f')][_0x3ed0('0x39')]({'where':{'FaxAccountId':_0x1ede3e[_0x3ed0('0x60')]['id']},'transaction':_0x135976})[_0x3ed0('0x21')](function(_0x1f3850){return db[_0x3ed0('0x9f')][_0x3ed0('0x85')](createExtensionsReciveFax(_[_0x3ed0('0x73')](_0x1ede3e[_0x3ed0('0x60')],[_0x3ed0('0xa0'),'key',_0x3ed0('0xa1'),_0x3ed0('0xa2'),_0x3ed0('0xa3'),_0x3ed0('0xa4')])),{'transaction':_0x135976});});});})[_0x3ed0('0x21')](function(){return db[_0x3ed0('0x44')]['findById'](_0x1ede3e[_0x3ed0('0x60')]['id']);})['then'](respondWithResult(_0x315891,null))[_0x3ed0('0x2c')](handleError(_0x315891,null));};exports[_0x3ed0('0xa5')]=function(_0x4ce65d,_0x518632,_0x12f1c1){var _0x31aa2e={'raw':!![],'where':{}};var _0x2dcf9f={};var _0x223a90={'count':0x0,'rows':[]};return db[_0x3ed0('0x44')][_0x3ed0('0x6c')]({'where':{'id':_0x4ce65d['params']['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x518632,null))[_0x3ed0('0x21')](function(_0x2ddb04){if(_0x2ddb04){_0x2dcf9f[_0x3ed0('0x4b')]=_[_0x3ed0('0x49')](db['FaxMessage'][_0x3ed0('0x45')]);_0x2dcf9f[_0x3ed0('0x48')]=_[_0x3ed0('0x49')](_0x4ce65d[_0x3ed0('0x48')]);_0x2dcf9f[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x2dcf9f[_0x3ed0('0x4b')],_0x2dcf9f[_0x3ed0('0x48')]);_0x31aa2e[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x2dcf9f[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x4d')]));_0x31aa2e[_0x3ed0('0x4c')]=_0x31aa2e[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x31aa2e['attributes']:_0x2dcf9f[_0x3ed0('0x4b')];if(!_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x76')](_0x3ed0('0x4f'))){_0x31aa2e[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x4ce65d['query'][_0x3ed0('0x32')]);_0x31aa2e['offset']=qs[_0x3ed0('0x2f')](_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x2f')]);}_0x31aa2e[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x4ce65d['query'][_0x3ed0('0x51')]);_0x31aa2e['where']=qs['filters'](_['pick'](_0x4ce65d[_0x3ed0('0x48')],_0x2dcf9f[_0x3ed0('0x4a')]));_0x31aa2e[_0x3ed0('0x52')][_0x3ed0('0x6a')]=_0x2ddb04['id'];if(_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0x54')]){_0x31aa2e[_0x3ed0('0x52')]=_[_0x3ed0('0x55')](_0x31aa2e[_0x3ed0('0x52')],{'$or':_['map'](_0x31aa2e[_0x3ed0('0x4c')],function(_0xe65080){var _0x59bd36={};_0x59bd36[_0xe65080]={'$like':'%'+_0x4ce65d['query'][_0x3ed0('0x54')]+'%'};return _0x59bd36;})});}if(_0x4ce65d['query'][_0x3ed0('0xa6')]){var _0x1b6a6a=_0x4ce65d[_0x3ed0('0x48')][_0x3ed0('0xa6')][_0x3ed0('0xa7')](',');var _0x406c70={};_0x406c70[_0x1b6a6a[0x0]]={'$gte':moment(_0x1b6a6a[0x1])['format'](_0x3ed0('0xa8'))};_0x31aa2e['where']=_['merge'](_0x31aa2e[_0x3ed0('0x52')],_0x406c70);}_0x31aa2e=_['merge']({},_0x31aa2e,_0x4ce65d[_0x3ed0('0x57')]);return db[_0x3ed0('0xa9')]['count']({'where':_0x31aa2e['where']})[_0x3ed0('0x21')](function(_0x4899f2){_0x223a90[_0x3ed0('0x31')]=_0x4899f2;if(_0x4ce65d['query'][_0x3ed0('0x58')]){_0x31aa2e['include']=[{'all':!![]}];}return db[_0x3ed0('0xa9')]['findAll'](_0x31aa2e);})[_0x3ed0('0x21')](function(_0x250a5){_0x223a90[_0x3ed0('0x7f')]=_0x250a5;return _0x223a90;});}})[_0x3ed0('0x21')](respondWithFilteredResult(_0x518632,_0x31aa2e))[_0x3ed0('0x2c')](handleError(_0x518632,null));};exports[_0x3ed0('0x40')]=function(_0xa7926d,_0x43c489,_0x28c4ea){var _0x4f6138,_0x3a2397={},_0x280cec;if(_0xa7926d[_0x3ed0('0x60')]['to']){_0x280cec=_0xa7926d['body']['to'][0x0];}return db[_0x3ed0('0x44')]['find']({'where':{'id':_0xa7926d[_0x3ed0('0x69')]['id']},'include':[{'model':db[_0x3ed0('0xaa')],'as':_0x3ed0('0xab'),'include':[{'model':db['CmContact'],'as':_0x3ed0('0xac'),'where':{'fax':_0x280cec},'limit':0x1,'order':[[_0x3ed0('0xa2'),_0x3ed0('0xad')]]}]}]})[_0x3ed0('0x21')](handleEntityNotFound(_0x43c489,null))[_0x3ed0('0x21')](function(_0x270208){_0x4f6138=_0x270208;if(_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')]&&_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')]['length']){for(var _0x318820=0x0;_0x318820<_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')]['length'];_0x318820+=0x1){_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][_0x318820]={'filename':_0xa7926d[_0x3ed0('0x60')]['attachments'][_0x318820]['name'],'id':_0xa7926d['body'][_0x3ed0('0xae')][_0x318820]['id'],'path':path[_0x3ed0('0xaf')](config[_0x3ed0('0xb0')],_0x3ed0('0xb1'),_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][_0x318820][_0x3ed0('0xb2')])};}}return respondWithRpcPromise('CheckAfterSend',_0x3ed0('0xb3'),{'FaxAccountId':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x69')]['id'])?undefined:_0xa7926d[_0x3ed0('0x69')]['id'],'path':_[_0x3ed0('0xb4')](_0xa7926d['body'][_0x3ed0('0xae')][0x0][_0x3ed0('0x8')])?undefined:_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0][_0x3ed0('0x8')],'fax':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x60')]['to'][0x0])?undefined:_0xa7926d[_0x3ed0('0x60')]['to'][0x0]},client9002);})[_0x3ed0('0x21')](function(){if(_0x4f6138){if(_[_0x3ed0('0xb4')](_0xa7926d['body'][_0x3ed0('0xb5')])){_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xb5')]=util[_0x3ed0('0xb6')]('\x22%s\x22\x20<%s>',_0x4f6138['name'],_0x4f6138['fax']);}if(_0x4f6138[_0x3ed0('0xab')]){if(_0x4f6138['List'][_0x3ed0('0xac')]['length']){return _0x4f6138[_0x3ed0('0xab')][_0x3ed0('0xac')][0x0];}else{return db['CmContact'][_0x3ed0('0x5f')](_[_0x3ed0('0x19')](_0xa7926d['body'],{'firstName':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'phone':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'fax':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'ListId':_0x4f6138['ListId']}));}}else{throw new Error(_0x3ed0('0xb7'));}}else{throw new Error(_0x3ed0('0xb8'));}})[_0x3ed0('0x21')](function(_0x4e2d21){if(_0x4e2d21){return db[_0x3ed0('0x75')][_0x3ed0('0x5e')]({'where':{'ContactId':_0x4e2d21['id'],'closed':![],'FaxAccountId':_0x4f6138['id']}})['then'](function(_0x329a41){if(_0x329a41){return[_0x329a41,![]];}return db['FaxInteraction'][_0x3ed0('0x5f')]({'UserId':_0xa7926d['user']['id'],'ContactId':_0x4e2d21['id'],'FaxAccountId':_0x4f6138['id'],'fax':_0xa7926d[_0x3ed0('0x60')]['to'][0x0],'firstMsgDirection':_0x3ed0('0xb9'),'Messages':[_[_0x3ed0('0x55')](_0xa7926d[_0x3ed0('0x60')],{'read':![],'body':_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0]['filename'],'FaxAccountId':_0x4f6138['id'],'UserId':_0xa7926d['user']['id'],'ContactId':_0x4e2d21['id'],'AttachmentId':_0xa7926d['body'][_0x3ed0('0xae')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x3ed0('0xba')}]})['then'](function(_0x352fba){return[_0x352fba,!![]];});});}else{throw new Error(_0x3ed0('0xbb'));}})['spread'](function(_0x51aa70,_0x2dc7b3){if(_0x2dc7b3){return _0x51aa70;}return db['FaxMessage'][_0x3ed0('0x5f')]({'direction':_0x3ed0('0xb9'),'read':![],'body':_0xa7926d['body'][_0x3ed0('0xae')][0x0][_0x3ed0('0xbc')],'FaxAccountId':_0x4f6138['id'],'FaxInteractionId':_0x51aa70['id'],'UserId':_0xa7926d[_0x3ed0('0x61')]['id'],'ContactId':_0x51aa70[_0x3ed0('0xbd')],'AttachmentId':_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0]['id']})[_0x3ed0('0x21')](function(_0x327055){_0x51aa70[_0x3ed0('0xbe')][_0x3ed0('0xba')]=[];_0x51aa70[_0x3ed0('0xbe')][_0x3ed0('0xba')][_0x3ed0('0x90')](_0x327055[_0x3ed0('0xbe')]);return _0x51aa70;});})[_0x3ed0('0x21')](function(_0x4a0cdd){respondWithRpcPromise(_0x3ed0('0xbf'),_0x3ed0('0xbf'),{'FaxAccountId':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x69')]['id'])?undefined:_0xa7926d['params']['id'],'path':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x60')]['attachments'][0x0][_0x3ed0('0x8')])?undefined:_0xa7926d[_0x3ed0('0x60')][_0x3ed0('0xae')][0x0][_0x3ed0('0x8')],'fax':_[_0x3ed0('0xb4')](_0xa7926d[_0x3ed0('0x60')]['to'][0x0])?undefined:_0xa7926d['body']['to'][0x0],'AttachmentId':_0xa7926d['body']['attachments'][0x0]['id']},client9002)[_0x3ed0('0x21')](function(_0x298a8f){logger[_0x3ed0('0x22')](_0x3ed0('0xc0'),_0x298a8f);})[_0x3ed0('0x2c')](function(_0x35619f){logger[_0x3ed0('0x22')]('SendFaxRpc,\x20%s',_0x35619f);});return _0x4a0cdd;})[_0x3ed0('0x21')](respondWithResult(_0x43c489,null))['catch'](handleError(_0x43c489,null));};exports['addAgents']=function(_0xa831d0,_0x12a4fe,_0x3f848e){return db['FaxAccount'][_0x3ed0('0x5e')]({'where':{'id':_0xa831d0[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x12a4fe,null))['then'](function(_0x15ba09){if(_0x15ba09){return _0x15ba09[_0x3ed0('0xc1')](_0xa831d0[_0x3ed0('0x60')][_0x3ed0('0x71')],_[_0x3ed0('0x73')](_0xa831d0[_0x3ed0('0x60')],['ids','id'])||{})[_0x3ed0('0xc2')](function(_0x162963){for(var _0x6e8e18=0x0;_0x6e8e18<_0xa831d0[_0x3ed0('0x60')]['ids']['length'];_0x6e8e18+=0x1){socket[_0x3ed0('0xc3')](_0x3ed0('0xc4'),{'UserId':Number(_0xa831d0[_0x3ed0('0x60')][_0x3ed0('0x71')][_0x6e8e18]),'FaxAccountId':Number(_0xa831d0[_0x3ed0('0x69')]['id'])});}return _0x162963;});}})[_0x3ed0('0x21')](respondWithResult(_0x12a4fe,null))[_0x3ed0('0x2c')](handleError(_0x12a4fe,null));};exports['removeAgents']=function(_0x60ae6a,_0x11580e,_0x3bc287){return db[_0x3ed0('0x44')][_0x3ed0('0x5e')]({'where':{'id':_0x60ae6a[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x11580e,null))[_0x3ed0('0x21')](function(_0x2a8a87){if(_0x2a8a87){return _0x2a8a87['removeAgents'](_0x60ae6a[_0x3ed0('0x48')]['ids'])[_0x3ed0('0x21')](function(){if(_['isArray'](_0x60ae6a[_0x3ed0('0x48')]['ids'])){for(var _0x51019b=0x0;_0x51019b<_0x60ae6a[_0x3ed0('0x48')][_0x3ed0('0x71')][_0x3ed0('0x4e')];_0x51019b+=0x1){socket[_0x3ed0('0xc3')](_0x3ed0('0xc5'),{'UserId':Number(_0x60ae6a[_0x3ed0('0x48')][_0x3ed0('0x71')][_0x51019b]),'FaxAccountId':Number(_0x60ae6a[_0x3ed0('0x69')]['id'])});}}else{socket['emit'](_0x3ed0('0xc5'),{'UserId':Number(_0x60ae6a[_0x3ed0('0x48')][_0x3ed0('0x71')]),'FaxAccountId':Number(_0x60ae6a[_0x3ed0('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0x11580e,null))[_0x3ed0('0x2c')](handleError(_0x11580e,null));};exports[_0x3ed0('0xc6')]=function(_0x1ea2ea,_0x6ab927,_0x260392){var _0x1363b8={};var _0x4a4d95={};var _0x422ba2;var _0x52fbed;return db[_0x3ed0('0x44')]['findOne']({'where':{'id':_0x1ea2ea[_0x3ed0('0x69')]['id']}})[_0x3ed0('0x21')](handleEntityNotFound(_0x6ab927,null))[_0x3ed0('0x21')](function(_0x1d4e2b){if(_0x1d4e2b){_0x422ba2=_0x1d4e2b;_0x4a4d95['model']=_[_0x3ed0('0x49')](db[_0x3ed0('0x79')][_0x3ed0('0x45')]);_0x4a4d95['query']=_[_0x3ed0('0x49')](_0x1ea2ea['query']);_0x4a4d95[_0x3ed0('0x4a')]=_[_0x3ed0('0x5d')](_0x4a4d95[_0x3ed0('0x4b')],_0x4a4d95['query']);_0x1363b8[_0x3ed0('0x4c')]=_[_0x3ed0('0x5d')](_0x4a4d95[_0x3ed0('0x4b')],qs[_0x3ed0('0x4d')](_0x1ea2ea['query'][_0x3ed0('0x4d')]));_0x1363b8[_0x3ed0('0x4c')]=_0x1363b8[_0x3ed0('0x4c')][_0x3ed0('0x4e')]?_0x1363b8[_0x3ed0('0x4c')]:_0x4a4d95[_0x3ed0('0x4b')];_0x1363b8[_0x3ed0('0x50')]=qs[_0x3ed0('0x51')](_0x1ea2ea[_0x3ed0('0x48')][_0x3ed0('0x51')]);_0x1363b8[_0x3ed0('0x52')]=qs[_0x3ed0('0x4a')](_['pick'](_0x1ea2ea['query'],_0x4a4d95['filters']));if(_0x1ea2ea['query'][_0x3ed0('0x54')]){_0x1363b8['where']=_[_0x3ed0('0x55')](_0x1363b8[_0x3ed0('0x52')],{'$or':_['map'](_0x1363b8[_0x3ed0('0x4c')],function(_0x26c3a5){var _0x204008={};_0x204008[_0x26c3a5]={'$like':'%'+_0x1ea2ea[_0x3ed0('0x48')][_0x3ed0('0x54')]+'%'};return _0x204008;})});}_0x1363b8=_[_0x3ed0('0x55')]({},_0x1363b8,_0x1ea2ea[_0x3ed0('0x57')]);return _0x422ba2['getAgents'](_0x1363b8);}})[_0x3ed0('0x21')](function(_0x399306){if(_0x399306){_0x52fbed=_0x399306[_0x3ed0('0x4e')];if(!_0x1ea2ea[_0x3ed0('0x48')]['hasOwnProperty']('nolimit')){_0x1363b8[_0x3ed0('0x32')]=qs[_0x3ed0('0x32')](_0x1ea2ea['query'][_0x3ed0('0x32')]);_0x1363b8['offset']=qs[_0x3ed0('0x2f')](_0x1ea2ea['query'][_0x3ed0('0x2f')]);}return _0x422ba2['getAgents'](_0x1363b8);}})[_0x3ed0('0x21')](function(_0x4a81b2){if(_0x4a81b2){return _0x4a81b2?{'count':_0x52fbed,'rows':_0x4a81b2}:null;}})[_0x3ed0('0x21')](respondWithResult(_0x6ab927,null))['catch'](handleError(_0x6ab927,null));};
\ No newline at end of file
+var _0xa8c2=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','describe','FaxAccountId','getDispositions','findOne','Disposition','nolimit','order','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','send','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','priority','appdata','push','Answer','Set','ecm','gateway','faxdetect','minrate','modem','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','transaction','tech','key','createdAt','updatedAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','CmList','List','Contacts','attachments','join','basename','CheckAfterSend','isNil','from','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','include','rows','show','params','includeAll','find'];(function(_0x4370c7,_0x5dbfb0){var _0xce78a9=function(_0x157b2c){while(--_0x157b2c){_0x4370c7['push'](_0x4370c7['shift']());}};_0xce78a9(++_0x5dbfb0);}(_0xa8c2,0x6c));var _0x2a8c=function(_0x4e68aa,_0x77632d){_0x4e68aa=_0x4e68aa-0x0;var _0xfe0a56=_0xa8c2[_0x4e68aa];return _0xfe0a56;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2a8c('0x0'));var jsonpatch=require(_0x2a8c('0x1'));var rp=require(_0x2a8c('0x2'));var moment=require(_0x2a8c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2a8c('0x4'));var util=require(_0x2a8c('0x5'));var path=require(_0x2a8c('0x6'));var sox=require(_0x2a8c('0x7'));var csv=require(_0x2a8c('0x8'));var ejs=require(_0x2a8c('0x9'));var fs=require('fs');var fs_extra=require(_0x2a8c('0xa'));var _=require('lodash');var squel=require(_0x2a8c('0xb'));var crypto=require(_0x2a8c('0xc'));var jsforce=require(_0x2a8c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a8c('0x8'));var querystring=require(_0x2a8c('0xe'));var Papa=require(_0x2a8c('0xf'));var Redis=require('ioredis');var authService=require(_0x2a8c('0x10'));var qs=require(_0x2a8c('0x11'));var as=require(_0x2a8c('0x12'));var hardwareService=require(_0x2a8c('0x13'));var logger=require(_0x2a8c('0x14'))(_0x2a8c('0x15'));var utils=require(_0x2a8c('0x16'));var config=require(_0x2a8c('0x17'));var licenseUtil=require(_0x2a8c('0x18'));var db=require(_0x2a8c('0x19'))['db'];config[_0x2a8c('0x1a')]=_[_0x2a8c('0x1b')](config[_0x2a8c('0x1a')],{'host':_0x2a8c('0x1c'),'port':0x18eb});var socket=require(_0x2a8c('0x1d'))(new Redis(config[_0x2a8c('0x1a')]));require('./faxAccount.socket')[_0x2a8c('0x1e')](socket);var jayson=require(_0x2a8c('0x1f'));var client=jayson[_0x2a8c('0x20')][_0x2a8c('0x21')]({'port':0x232c});var client9002=jayson[_0x2a8c('0x20')][_0x2a8c('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x3c9240,_0x50d0f7,_0x597ac9,_0x3303bf){return new BPromise(function(_0x291667,_0x45d2b0){var _0x2c7cd2=_0x3303bf||client;return _0x2c7cd2[_0x2a8c('0x22')](_0x3c9240,_0x597ac9)[_0x2a8c('0x23')](function(_0x455a9a){logger[_0x2a8c('0x24')](_0x2a8c('0x25'),_0x50d0f7,_0x2a8c('0x26'));logger[_0x2a8c('0x27')](_0x2a8c('0x28'),_0x50d0f7,'request\x20sent',JSON[_0x2a8c('0x29')](_0x455a9a));if(_0x455a9a[_0x2a8c('0x2a')]){if(_0x455a9a['error'][_0x2a8c('0x2b')]===0x1f4){logger[_0x2a8c('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x50d0f7,_0x455a9a['error'][_0x2a8c('0x2c')]);return _0x45d2b0(_0x455a9a[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x50d0f7,_0x455a9a[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);return _0x291667(_0x455a9a[_0x2a8c('0x2a')][_0x2a8c('0x2c')]);}else{logger['info'](_0x2a8c('0x25'),_0x50d0f7,'request\x20sent');_0x291667(_0x455a9a[_0x2a8c('0x2d')]['message']);}})[_0x2a8c('0x2e')](function(_0x5c51d3){logger['error'](_0x2a8c('0x25'),_0x50d0f7,_0x5c51d3);_0x45d2b0(_0x5c51d3);});});}function respondWithStatusCode(_0x5e8b1f,_0x37782f){_0x37782f=_0x37782f||0xcc;return function(_0x417e0d){if(_0x417e0d){return _0x5e8b1f[_0x2a8c('0x2f')](_0x37782f);}return _0x5e8b1f['status'](_0x37782f)['end']();};}function respondWithResult(_0x2e0188,_0x15b954){_0x15b954=_0x15b954||0xc8;return function(_0x27c551){if(_0x27c551){return _0x2e0188[_0x2a8c('0x30')](_0x15b954)[_0x2a8c('0x31')](_0x27c551);}};}function respondWithFilteredResult(_0x5a47a0,_0x29dab4){return function(_0x509cef){if(_0x509cef){var _0x176e48=typeof _0x29dab4[_0x2a8c('0x32')]===_0x2a8c('0x33')&&typeof _0x29dab4[_0x2a8c('0x34')]===_0x2a8c('0x33');var _0x2c3757=_0x509cef[_0x2a8c('0x35')];var _0x429c54=_0x176e48?0x0:_0x29dab4['offset'];var _0xc7df79=_0x176e48?_0x509cef[_0x2a8c('0x35')]:_0x29dab4[_0x2a8c('0x32')]+_0x29dab4[_0x2a8c('0x34')];var _0x593241;if(_0xc7df79>=_0x2c3757){_0xc7df79=_0x2c3757;_0x593241=0xc8;}else{_0x593241=0xce;}_0x5a47a0['status'](_0x593241);return _0x5a47a0['set'](_0x2a8c('0x36'),_0x429c54+'-'+_0xc7df79+'/'+_0x2c3757)[_0x2a8c('0x31')](_0x509cef);}return null;};}function patchUpdates(_0x14ebca){return function(_0x47eb46){try{jsonpatch[_0x2a8c('0x37')](_0x47eb46,_0x14ebca,!![]);}catch(_0x4feb37){return BPromise[_0x2a8c('0x38')](_0x4feb37);}return _0x47eb46[_0x2a8c('0x39')]();};}function saveUpdates(_0x2a5ea7,_0x456ef1){return function(_0x536cf7){if(_0x536cf7){return _0x536cf7[_0x2a8c('0x3a')](_0x2a5ea7)[_0x2a8c('0x23')](function(_0x1731de){return _0x1731de;});}return null;};}function removeEntity(_0x2d5082,_0x1f484c){return function(_0x24c933){if(_0x24c933){return _0x24c933[_0x2a8c('0x3b')]()[_0x2a8c('0x23')](function(){var _0x400a10=_0x24c933[_0x2a8c('0x3c')]({'plain':!![]});var _0x456948='FaxAccounts';return db[_0x2a8c('0x3d')][_0x2a8c('0x3b')]({'where':{'type':_0x456948,'resourceId':_0x400a10['id']}})[_0x2a8c('0x23')](function(){return _0x24c933;});})[_0x2a8c('0x23')](function(){_0x2d5082[_0x2a8c('0x30')](0xcc)[_0x2a8c('0x3e')]();});}};}function handleEntityNotFound(_0x7b8580,_0xa3f033){return function(_0x39fc6f){if(!_0x39fc6f){_0x7b8580[_0x2a8c('0x2f')](0x194);}return _0x39fc6f;};}function handleError(_0xd5a3c4,_0x474eae){_0x474eae=_0x474eae||0x1f4;return function(_0x318f33){logger[_0x2a8c('0x2a')](_0x318f33[_0x2a8c('0x3f')]);if(_0x318f33[_0x2a8c('0x40')]){delete _0x318f33[_0x2a8c('0x40')];}_0xd5a3c4[_0x2a8c('0x30')](_0x474eae)['send'](_0x318f33);};}exports[_0x2a8c('0x41')]=function(_0x2fa386,_0x520249){var _0x2f097a={'include':[{'model':db[_0x2a8c('0x42')],'as':_0x2a8c('0x43')}]},_0x1b4f3b={},_0x5281cd={'count':0x0,'rows':[]};var _0x502473=_[_0x2a8c('0x44')](db[_0x2a8c('0x45')][_0x2a8c('0x46')],function(_0x5db77c){return{'name':_0x5db77c[_0x2a8c('0x47')],'type':_0x5db77c['type']['key']};});_0x1b4f3b[_0x2a8c('0x48')]=_[_0x2a8c('0x44')](_0x502473,_0x2a8c('0x40'));_0x1b4f3b[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x2fa386[_0x2a8c('0x49')]);_0x1b4f3b[_0x2a8c('0x4b')]=_[_0x2a8c('0x4c')](_0x1b4f3b[_0x2a8c('0x48')],_0x1b4f3b[_0x2a8c('0x49')]);_0x2f097a['attributes']=_[_0x2a8c('0x4c')](_0x1b4f3b[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x2f097a[_0x2a8c('0x4e')]=_0x2f097a['attributes'][_0x2a8c('0x4f')]?_0x2f097a[_0x2a8c('0x4e')]:_0x1b4f3b[_0x2a8c('0x48')];if(!_0x2fa386['query'][_0x2a8c('0x50')]('nolimit')){_0x2f097a[_0x2a8c('0x34')]=qs['limit'](_0x2fa386[_0x2a8c('0x49')]['limit']);_0x2f097a['offset']=qs[_0x2a8c('0x32')](_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x32')]);}_0x2f097a['order']=qs[_0x2a8c('0x51')](_0x2fa386['query'][_0x2a8c('0x51')]);_0x2f097a[_0x2a8c('0x52')]=qs['filters'](_[_0x2a8c('0x53')](_0x2fa386[_0x2a8c('0x49')],_0x1b4f3b['filters']),_0x502473);if(_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0x2f097a['where']=_[_0x2a8c('0x55')](_0x2f097a[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x502473,function(_0x1885f8){if(_0x1885f8[_0x2a8c('0x56')]!=='VIRTUAL'){var _0x1d602c={};_0x1d602c[_0x1885f8[_0x2a8c('0x40')]]={'$like':'%'+_0x2fa386[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x1d602c;}})});}_0x2f097a=_['merge']({},_0x2f097a,_0x2fa386['options']);var _0x5f27fd={'where':_0x2f097a[_0x2a8c('0x52')]};return db['FaxAccount'][_0x2a8c('0x35')](_0x5f27fd)[_0x2a8c('0x23')](function(_0x525b96){_0x5281cd[_0x2a8c('0x35')]=_0x525b96;if(_0x2fa386[_0x2a8c('0x49')]['includeAll']){_0x2f097a[_0x2a8c('0x57')]=[{'all':!![]}];}return db['FaxAccount']['findAll'](_0x2f097a);})['then'](function(_0x12cd1d){_0x5281cd[_0x2a8c('0x58')]=_0x12cd1d;return _0x5281cd;})[_0x2a8c('0x23')](respondWithFilteredResult(_0x520249,_0x2f097a))[_0x2a8c('0x2e')](handleError(_0x520249,null));};exports[_0x2a8c('0x59')]=function(_0x240e7f,_0x2f33f8){var _0x3abec0={'raw':![],'where':{'id':_0x240e7f[_0x2a8c('0x5a')]['id']},'include':[{'model':db[_0x2a8c('0x42')],'as':_0x2a8c('0x43')}]},_0x479d36={};_0x479d36[_0x2a8c('0x48')]=_[_0x2a8c('0x4a')](db[_0x2a8c('0x45')][_0x2a8c('0x46')]);_0x479d36[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x240e7f[_0x2a8c('0x49')]);_0x479d36['filters']=_['intersection'](_0x479d36['model'],_0x479d36[_0x2a8c('0x49')]);_0x3abec0[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x479d36[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x240e7f['query']['fields']));_0x3abec0[_0x2a8c('0x4e')]=_0x3abec0[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x3abec0[_0x2a8c('0x4e')]:_0x479d36[_0x2a8c('0x48')];if(_0x240e7f[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x3abec0['include']=[{'all':!![]}];}_0x3abec0=_[_0x2a8c('0x55')]({},_0x3abec0,_0x240e7f['options']);return db[_0x2a8c('0x45')][_0x2a8c('0x5c')](_0x3abec0)[_0x2a8c('0x23')](handleEntityNotFound(_0x2f33f8,null))[_0x2a8c('0x23')](respondWithResult(_0x2f33f8,null))[_0x2a8c('0x2e')](handleError(_0x2f33f8,null));};exports[_0x2a8c('0x5d')]=function(_0x3e2da1,_0x43dab0){return db[_0x2a8c('0x45')][_0x2a8c('0x5d')](_0x3e2da1[_0x2a8c('0x5e')],{})[_0x2a8c('0x23')](function(_0x1273a5){var _0x813a10=_0x3e2da1['user']['get']({'plain':!![]});if(!_0x813a10)throw new Error(_0x2a8c('0x5f'));if(_0x813a10['role']===_0x2a8c('0x60')){var _0x56c280=_0x1273a5['get']({'plain':!![]});var _0x5d5acb='FaxAccounts';return db[_0x2a8c('0x61')][_0x2a8c('0x5c')]({'where':{'name':_0x5d5acb,'userProfileId':_0x813a10[_0x2a8c('0x62')]},'raw':!![]})['then'](function(_0x2632e2){if(_0x2632e2&&_0x2632e2[_0x2a8c('0x63')]===0x0){return db['UserProfileResource'][_0x2a8c('0x5d')]({'name':_0x56c280['name'],'resourceId':_0x56c280['id'],'type':_0x2632e2[_0x2a8c('0x40')],'sectionId':_0x2632e2['id']},{})[_0x2a8c('0x23')](function(){return _0x1273a5;});}else{return _0x1273a5;}})[_0x2a8c('0x2e')](function(_0x12bf5e){logger[_0x2a8c('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12bf5e);throw _0x12bf5e;});}return _0x1273a5;})[_0x2a8c('0x23')](respondWithResult(_0x43dab0,0xc9))[_0x2a8c('0x2e')](handleError(_0x43dab0,null));};exports[_0x2a8c('0x3a')]=function(_0x4c95b0,_0x1be6ca){if(_0x4c95b0[_0x2a8c('0x5e')]['id']){delete _0x4c95b0[_0x2a8c('0x5e')]['id'];}return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x4c95b0[_0x2a8c('0x5a')]['id']},'include':[{'model':db[_0x2a8c('0x42')],'as':_0x2a8c('0x43')}]})[_0x2a8c('0x23')](handleEntityNotFound(_0x1be6ca,null))[_0x2a8c('0x23')](saveUpdates(_0x4c95b0['body'],null))[_0x2a8c('0x23')](respondWithResult(_0x1be6ca,null))[_0x2a8c('0x2e')](handleError(_0x1be6ca,null));};exports['destroy']=function(_0x139d18,_0x35494a){return db[_0x2a8c('0x45')]['find']({'where':{'id':_0x139d18[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x35494a,null))[_0x2a8c('0x23')](removeEntity(_0x35494a,null))['catch'](handleError(_0x35494a,null));};exports[_0x2a8c('0x64')]=function(_0x1c3105,_0x3f682f){return db['FaxAccount'][_0x2a8c('0x64')]()[_0x2a8c('0x23')](respondWithResult(_0x3f682f,null))[_0x2a8c('0x2e')](handleError(_0x3f682f,null));};exports['addDisposition']=function(_0x4a8456,_0x4c792b,_0x51c45c){if(_0x4a8456[_0x2a8c('0x5e')]['id']){delete _0x4a8456['body']['id'];}return db[_0x2a8c('0x45')]['find']({'where':{'id':_0x4a8456[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x4c792b,null))['then'](function(_0x2f07b6){if(_0x2f07b6){_0x4a8456['body'][_0x2a8c('0x65')]=_0x2f07b6['id'];return db['Disposition'][_0x2a8c('0x5d')](_0x4a8456[_0x2a8c('0x5e')]);}})[_0x2a8c('0x23')](respondWithResult(_0x4c792b,null))[_0x2a8c('0x2e')](handleError(_0x4c792b,null));};exports[_0x2a8c('0x66')]=function(_0x5526f2,_0x35538c,_0x45a928){var _0x36f1b7={'raw':![],'where':{}};var _0x189598={};var _0x59fcdf={'count':0x0,'rows':[]};return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x5526f2[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x35538c,null))[_0x2a8c('0x23')](function(_0x1b9ad8){if(_0x1b9ad8){_0x189598[_0x2a8c('0x48')]=_[_0x2a8c('0x4a')](db[_0x2a8c('0x68')][_0x2a8c('0x46')]);_0x189598[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x5526f2[_0x2a8c('0x49')]);_0x189598['filters']=_[_0x2a8c('0x4c')](_0x189598['model'],_0x189598['query']);_0x36f1b7[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x189598['model'],qs[_0x2a8c('0x4d')](_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x36f1b7['attributes']=_0x36f1b7[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x36f1b7[_0x2a8c('0x4e')]:_0x189598['model'];if(!_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x36f1b7[_0x2a8c('0x34')]=qs['limit'](_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0x36f1b7[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x32')]);}_0x36f1b7[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x5526f2['query']['sort']);_0x36f1b7['where']=qs['filters'](_['pick'](_0x5526f2[_0x2a8c('0x49')],_0x189598['filters']));_0x36f1b7['where'][_0x2a8c('0x65')]=_0x1b9ad8['id'];if(_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0x36f1b7['where']=_[_0x2a8c('0x55')](_0x36f1b7['where'],{'$or':_[_0x2a8c('0x44')](_0x36f1b7[_0x2a8c('0x4e')],function(_0x9522f5){var _0x3c539b={};_0x3c539b[_0x9522f5]={'$like':'%'+_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x3c539b;})});}_0x36f1b7=_[_0x2a8c('0x55')]({},_0x36f1b7,_0x5526f2[_0x2a8c('0x6b')]);return db['Disposition'][_0x2a8c('0x35')]({'where':_0x36f1b7[_0x2a8c('0x52')]})[_0x2a8c('0x23')](function(_0xee4a84){_0x59fcdf[_0x2a8c('0x35')]=_0xee4a84;if(_0x5526f2[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x36f1b7[_0x2a8c('0x57')]=[{'all':!![]}];}return db[_0x2a8c('0x68')]['findAll'](_0x36f1b7);})[_0x2a8c('0x23')](function(_0x4aadcd){_0x59fcdf['rows']=_0x4aadcd;return _0x59fcdf;});}})['then'](respondWithFilteredResult(_0x35538c,_0x36f1b7))[_0x2a8c('0x2e')](handleError(_0x35538c,null));};exports[_0x2a8c('0x6c')]=function(_0x4900db,_0x465c4d,_0xe2deb2){return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x4900db['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x465c4d,null))[_0x2a8c('0x23')](function(_0x17d9f1){if(_0x17d9f1){return _0x17d9f1[_0x2a8c('0x6c')](_0x4900db[_0x2a8c('0x49')][_0x2a8c('0x6d')]);}})[_0x2a8c('0x23')](respondWithStatusCode(_0x465c4d,null))[_0x2a8c('0x2e')](handleError(_0x465c4d,null));};exports[_0x2a8c('0x6e')]=function(_0x54a14d,_0x837b03,_0x3d3d9e){if(_0x54a14d[_0x2a8c('0x5e')]['id']){delete _0x54a14d[_0x2a8c('0x5e')]['id'];}return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x54a14d[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x837b03,null))[_0x2a8c('0x23')](function(_0x12fbf7){if(_0x12fbf7){_0x54a14d['body']['FaxAccountId']=_0x12fbf7['id'];return db[_0x2a8c('0x6f')][_0x2a8c('0x5d')](_0x54a14d[_0x2a8c('0x5e')]);}})['then'](respondWithResult(_0x837b03,null))[_0x2a8c('0x2e')](handleError(_0x837b03,null));};exports[_0x2a8c('0x70')]=function(_0x463e8e,_0x497ef1,_0x28073e){var _0x23fdb8={'raw':![],'where':{}};var _0x158a7d={};var _0x6a973e={'count':0x0,'rows':[]};return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x463e8e[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x497ef1,null))['then'](function(_0xa5b87a){if(_0xa5b87a){_0x158a7d[_0x2a8c('0x48')]=_['keys'](db[_0x2a8c('0x6f')]['rawAttributes']);_0x158a7d[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x463e8e[_0x2a8c('0x49')]);_0x158a7d['filters']=_[_0x2a8c('0x4c')](_0x158a7d[_0x2a8c('0x48')],_0x158a7d[_0x2a8c('0x49')]);_0x23fdb8[_0x2a8c('0x4e')]=_['intersection'](_0x158a7d[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x463e8e[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x23fdb8[_0x2a8c('0x4e')]=_0x23fdb8[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x23fdb8[_0x2a8c('0x4e')]:_0x158a7d['model'];if(!_0x463e8e[_0x2a8c('0x49')]['hasOwnProperty'](_0x2a8c('0x69'))){_0x23fdb8[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x463e8e[_0x2a8c('0x49')]['limit']);_0x23fdb8[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x463e8e[_0x2a8c('0x49')]['offset']);}_0x23fdb8['order']=qs['sort'](_0x463e8e['query'][_0x2a8c('0x51')]);_0x23fdb8[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_[_0x2a8c('0x53')](_0x463e8e[_0x2a8c('0x49')],_0x158a7d[_0x2a8c('0x4b')]));_0x23fdb8[_0x2a8c('0x52')]['FaxAccountId']=_0xa5b87a['id'];if(_0x463e8e['query'][_0x2a8c('0x54')]){_0x23fdb8[_0x2a8c('0x52')]=_[_0x2a8c('0x55')](_0x23fdb8[_0x2a8c('0x52')],{'$or':_['map'](_0x23fdb8['attributes'],function(_0x3c55d2){var _0x1662a9={};_0x1662a9[_0x3c55d2]={'$like':'%'+_0x463e8e['query']['filter']+'%'};return _0x1662a9;})});}_0x23fdb8=_[_0x2a8c('0x55')]({},_0x23fdb8,_0x463e8e[_0x2a8c('0x6b')]);return db[_0x2a8c('0x6f')][_0x2a8c('0x35')]({'where':_0x23fdb8[_0x2a8c('0x52')]})[_0x2a8c('0x23')](function(_0x58ef1a){_0x6a973e[_0x2a8c('0x35')]=_0x58ef1a;if(_0x463e8e[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x23fdb8[_0x2a8c('0x57')]=[{'all':!![]}];}return db[_0x2a8c('0x6f')]['findAll'](_0x23fdb8);})[_0x2a8c('0x23')](function(_0x455b02){_0x6a973e['rows']=_0x455b02;return _0x6a973e;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x497ef1,_0x23fdb8))[_0x2a8c('0x2e')](handleError(_0x497ef1,null));};exports[_0x2a8c('0x71')]=function(_0x3461a0,_0x2c0910,_0x3a0cc0){return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x3461a0[_0x2a8c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c0910,null))[_0x2a8c('0x23')](function(_0x12ff12){if(_0x12ff12){return _0x12ff12['removeAnswers'](_0x3461a0[_0x2a8c('0x49')][_0x2a8c('0x6d')]);}})[_0x2a8c('0x23')](respondWithStatusCode(_0x2c0910,null))[_0x2a8c('0x2e')](handleError(_0x2c0910,null));};exports[_0x2a8c('0x72')]=function(_0xcd13f5,_0x4c5102,_0x108022){return db[_0x2a8c('0x73')]['find']({'where':{'id':_0xcd13f5[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x4c5102,null))[_0x2a8c('0x23')](function(_0x15532a){if(_0x15532a){return _0x15532a[_0x2a8c('0x72')](_0xcd13f5[_0x2a8c('0x5e')][_0x2a8c('0x6d')],_[_0x2a8c('0x74')](_0xcd13f5[_0x2a8c('0x5e')],[_0x2a8c('0x6d'),'id'])||{});}})[_0x2a8c('0x23')](respondWithResult(_0x4c5102,null))['catch'](handleError(_0x4c5102,null));};exports[_0x2a8c('0x75')]=function(_0x5e24d0,_0x4de65a,_0xb35f00){var _0x258e31={'raw':![],'where':{}};var _0x5a1d7c={};var _0x37d969={'count':0x0,'rows':[]};return db['FaxAccount'][_0x2a8c('0x67')]({'where':{'id':_0x5e24d0['params']['id']}})['then'](handleEntityNotFound(_0x4de65a,null))[_0x2a8c('0x23')](function(_0x3518b2){if(_0x3518b2){_0x5a1d7c['model']=_[_0x2a8c('0x4a')](db[_0x2a8c('0x73')][_0x2a8c('0x46')]);_0x5a1d7c[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x5e24d0['query']);_0x5a1d7c[_0x2a8c('0x4b')]=_[_0x2a8c('0x4c')](_0x5a1d7c['model'],_0x5a1d7c[_0x2a8c('0x49')]);_0x258e31[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x5a1d7c[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x5e24d0[_0x2a8c('0x49')]['fields']));_0x258e31['attributes']=_0x258e31[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x258e31[_0x2a8c('0x4e')]:_0x5a1d7c[_0x2a8c('0x48')];if(!_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x258e31[_0x2a8c('0x34')]=qs[_0x2a8c('0x34')](_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0x258e31[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x5e24d0[_0x2a8c('0x49')]['offset']);}_0x258e31[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x5e24d0['query'][_0x2a8c('0x51')]);_0x258e31[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_['pick'](_0x5e24d0['query'],_0x5a1d7c['filters']));_0x258e31[_0x2a8c('0x52')][_0x2a8c('0x65')]=_0x3518b2['id'];if(_0x5e24d0['query'][_0x2a8c('0x54')]){_0x258e31['where']=_[_0x2a8c('0x55')](_0x258e31[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x258e31[_0x2a8c('0x4e')],function(_0x502566){var _0x46b830={};_0x46b830[_0x502566]={'$like':'%'+_0x5e24d0[_0x2a8c('0x49')]['filter']+'%'};return _0x46b830;})});}_0x258e31=_[_0x2a8c('0x55')]({},_0x258e31,_0x5e24d0[_0x2a8c('0x6b')]);return db[_0x2a8c('0x73')][_0x2a8c('0x35')]({'where':_0x258e31['where']})[_0x2a8c('0x23')](function(_0x415f16){_0x37d969['count']=_0x415f16;if(_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x258e31['include']=[{'model':db[_0x2a8c('0x76')],'as':'Contact','required':![]},{'model':db[_0x2a8c('0x77')],'as':_0x2a8c('0x78'),'attributes':[_0x2a8c('0x40'),_0x2a8c('0x79'),'internal'],'required':![]},{'model':db[_0x2a8c('0x7a')],'as':_0x2a8c('0x7b'),'attributes':['id',_0x2a8c('0x40'),_0x2a8c('0x7c')],'where':_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x7d')]?{'id':_0x5e24d0[_0x2a8c('0x49')][_0x2a8c('0x7d')]}:undefined,'required':_0x5e24d0[_0x2a8c('0x49')]['tag']?!![]:![]}];}return db[_0x2a8c('0x73')]['findAll'](_0x258e31);})[_0x2a8c('0x23')](function(_0x2f3dd6){_0x37d969['rows']=_0x2f3dd6;return _0x37d969;});}})[_0x2a8c('0x23')](respondWithFilteredResult(_0x4de65a,_0x258e31))[_0x2a8c('0x2e')](handleError(_0x4de65a,null));};exports[_0x2a8c('0x7e')]=function(_0x131d2c,_0x978e3a){var _0x96164c=_0x131d2c['params']['id'];var _0x5308db=_0x131d2c[_0x2a8c('0x5e')];var _0x3c9091=0xc8;var _0xc33e98=null;return db[_0x2a8c('0x7f')]['transaction']({'isolationLevel':db[_0x2a8c('0x7f')][_0x2a8c('0x80')][_0x2a8c('0x81')][_0x2a8c('0x82')]},function(_0x2a596d){return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x96164c},'transaction':_0x2a596d})['then'](function(_0x45d8a0){if(_0x45d8a0){return db[_0x2a8c('0x83')][_0x2a8c('0x3b')]({'where':{'FaxAccountId':_0x96164c},'transaction':_0x2a596d})[_0x2a8c('0x23')](function(){var _0x1fec90=_[_0x2a8c('0x44')](_0x5308db,function(_0x418c4a){_0x418c4a['FaxAccountId']=_0x96164c;return _0x418c4a;});return db[_0x2a8c('0x83')][_0x2a8c('0x84')](_0x1fec90,{'transaction':_0x2a596d});});}else{_0x3c9091=0x194;_0xc33e98=[];}});})[_0x2a8c('0x23')](function(){if(_0x3c9091!==0x194){return db[_0x2a8c('0x83')][_0x2a8c('0x85')]({'where':{'FaxAccountId':_0x96164c},'order':'priority'})['then'](function(_0x499d37){_0xc33e98=_0x499d37;});}})[_0x2a8c('0x2e')](function(_0x26cd56){_0x3c9091=0x1f4;logger[_0x2a8c('0x2a')](_0x26cd56[_0x2a8c('0x3f')]);if(_0x26cd56['name']){delete _0x26cd56[_0x2a8c('0x40')];}_0xc33e98=_0x26cd56;})['finally'](function(){if(_0xc33e98===null){_0x978e3a[_0x2a8c('0x2f')](_0x3c9091);}else{if(_0x3c9091===0x1f4){_0x978e3a[_0x2a8c('0x30')](_0x3c9091)[_0x2a8c('0x86')](_0xc33e98);}else{_0x978e3a[_0x2a8c('0x30')](_0x3c9091)[_0x2a8c('0x31')](_0xc33e98);}}});};exports[_0x2a8c('0x87')]=function(_0x4feaf0,_0x40d7b3,_0x5edf20){var _0x15e472={};var _0x3927f6={};var _0x54b5c0;var _0x227008;return db['FaxAccount'][_0x2a8c('0x67')]({'where':{'id':_0x4feaf0[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x40d7b3,null))[_0x2a8c('0x23')](function(_0x7f7755){if(_0x7f7755){_0x54b5c0=_0x7f7755;_0x3927f6[_0x2a8c('0x48')]=_[_0x2a8c('0x4a')](db['FaxApplication'][_0x2a8c('0x46')]);_0x3927f6['query']=_[_0x2a8c('0x4a')](_0x4feaf0['query']);_0x3927f6[_0x2a8c('0x4b')]=_[_0x2a8c('0x4c')](_0x3927f6[_0x2a8c('0x48')],_0x3927f6[_0x2a8c('0x49')]);_0x15e472[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x3927f6[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x15e472['attributes']=_0x15e472[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x15e472[_0x2a8c('0x4e')]:_0x3927f6[_0x2a8c('0x48')];_0x15e472['order']=qs[_0x2a8c('0x51')](_0x4feaf0['query'][_0x2a8c('0x51')]);_0x15e472[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_[_0x2a8c('0x53')](_0x4feaf0[_0x2a8c('0x49')],_0x3927f6[_0x2a8c('0x4b')]));if(_0x4feaf0['query'][_0x2a8c('0x54')]){_0x15e472['where']=_[_0x2a8c('0x55')](_0x15e472[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x15e472['attributes'],function(_0x4396f9){var _0x1dd534={};_0x1dd534[_0x4396f9]={'$like':'%'+_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x1dd534;})});}_0x15e472=_['merge']({},_0x15e472,_0x4feaf0[_0x2a8c('0x6b')]);return _0x54b5c0[_0x2a8c('0x87')](_0x15e472);}})[_0x2a8c('0x23')](function(_0x3008b3){if(_0x3008b3){_0x227008=_0x3008b3[_0x2a8c('0x4f')];if(!_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x15e472[_0x2a8c('0x34')]=qs['limit'](_0x4feaf0[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0x15e472['offset']=qs[_0x2a8c('0x32')](_0x4feaf0[_0x2a8c('0x49')]['offset']);}return _0x54b5c0['getApplications'](_0x15e472);}})['then'](function(_0x4c0a59){if(_0x4c0a59){return _0x4c0a59?{'count':_0x227008,'rows':_0x4c0a59}:null;}})[_0x2a8c('0x23')](respondWithResult(_0x40d7b3,null))[_0x2a8c('0x2e')](handleError(_0x40d7b3,null));};function Extension(_0x6b62d0,_0x15dbbf,_0x54a894,_0x939f39){this[_0x2a8c('0x88')]=_0x2a8c('0x89');this['exten']=_0x6b62d0[_0x2a8c('0x8a')];this[_0x2a8c('0x8b')]=_0x939f39;this[_0x2a8c('0x56')]=_0x2a8c('0x8c');this[_0x2a8c('0x8d')]=_0x2a8c('0x8e');this[_0x2a8c('0x65')]=_0x6b62d0['id'];this[_0x2a8c('0x8f')]=_0x15dbbf;this[_0x2a8c('0x90')]=_0x54a894;}function createExtensionsReciveFax(_0x211cf2){var _0x3503d5=0x1;var _0x298149=[];_0x298149[_0x2a8c('0x91')](new Extension(_0x211cf2,_0x3503d5,'',_0x2a8c('0x92')));_0x3503d5+=0x1;_0x298149['push'](new Extension(_0x211cf2,_0x3503d5,'CDR(type)=inbound-fax',_0x2a8c('0x93')));_0x3503d5+=0x1;for(var _0x13ca6f in _0x211cf2){if(_0x211cf2[_0x2a8c('0x50')](_0x13ca6f)&&(_0x13ca6f===_0x2a8c('0x94')||_0x13ca6f===_0x2a8c('0x8a')||_0x13ca6f===_0x2a8c('0x95')||_0x13ca6f===_0x2a8c('0x96')||_0x13ca6f==='headerinfo'||_0x13ca6f==='maxrate'||_0x13ca6f===_0x2a8c('0x97')||_0x13ca6f===_0x2a8c('0x98')||_0x13ca6f==='t38timeout')){_0x298149[_0x2a8c('0x91')](new Extension(_0x211cf2,_0x3503d5,'FAXOPT('+_0x13ca6f+')='+_0x211cf2[_0x13ca6f],_0x2a8c('0x93')));_0x3503d5+=0x1;}}_0x298149['push'](new Extension(_0x211cf2,_0x3503d5,'6',_0x2a8c('0x99')));_0x3503d5+=0x1;_0x298149['push'](new Extension(_0x211cf2,_0x3503d5,_0x2a8c('0x9a'),_0x2a8c('0x9b')));_0x3503d5=0x0;return _0x298149;}exports[_0x2a8c('0x9c')]=function(_0x15d476,_0x2eea09,_0x53c118){var _0x40b675;return db[_0x2a8c('0x7f')]['transaction'](function(_0x9f11f1){return db[_0x2a8c('0x45')][_0x2a8c('0x5d')](_0x15d476['body'],{'transaction':_0x9f11f1})[_0x2a8c('0x23')](function(_0x23b1c4){_0x40b675=_0x23b1c4[_0x2a8c('0x3c')]({'plain':!![]});return db[_0x2a8c('0x9d')][_0x2a8c('0x84')](createExtensionsReciveFax(_0x40b675),{'transaction':_0x9f11f1});});})[_0x2a8c('0x23')](function(){return _0x40b675;})[_0x2a8c('0x23')](respondWithResult(_0x2eea09,null))[_0x2a8c('0x2e')](handleError(_0x2eea09,null));};exports[_0x2a8c('0x9e')]=function(_0x11bab0,_0x2135fd,_0x5f4234){var _0x2083d9;return db[_0x2a8c('0x7f')][_0x2a8c('0x9f')](function(_0x226709){return db[_0x2a8c('0x45')][_0x2a8c('0x3a')](_0x11bab0['body'],{'where':{'id':_0x11bab0['body']['id']},'transaction':_0x226709})[_0x2a8c('0x23')](function(_0x1d903f){return db[_0x2a8c('0x9d')]['destroy']({'where':{'FaxAccountId':_0x11bab0[_0x2a8c('0x5e')]['id']},'transaction':_0x226709})[_0x2a8c('0x23')](function(_0x55ad34){return db['VoiceExtension'][_0x2a8c('0x84')](createExtensionsReciveFax(_['omit'](_0x11bab0[_0x2a8c('0x5e')],[_0x2a8c('0xa0'),_0x2a8c('0xa1'),_0x2a8c('0xa2'),_0x2a8c('0xa3'),_0x2a8c('0xa4'),_0x2a8c('0xa5')])),{'transaction':_0x226709});});});})['then'](function(){return db['FaxAccount']['findById'](_0x11bab0[_0x2a8c('0x5e')]['id']);})[_0x2a8c('0x23')](respondWithResult(_0x2135fd,null))[_0x2a8c('0x2e')](handleError(_0x2135fd,null));};exports[_0x2a8c('0xa6')]=function(_0x12d546,_0x2d2ea8,_0x479b0c){var _0x389c84={'raw':!![],'where':{}};var _0x4abc33={};var _0x27c2aa={'count':0x0,'rows':[]};return db[_0x2a8c('0x45')][_0x2a8c('0x67')]({'where':{'id':_0x12d546[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x2d2ea8,null))[_0x2a8c('0x23')](function(_0x5abb66){if(_0x5abb66){_0x4abc33['model']=_[_0x2a8c('0x4a')](db[_0x2a8c('0xa7')][_0x2a8c('0x46')]);_0x4abc33['query']=_[_0x2a8c('0x4a')](_0x12d546[_0x2a8c('0x49')]);_0x4abc33['filters']=_[_0x2a8c('0x4c')](_0x4abc33['model'],_0x4abc33['query']);_0x389c84[_0x2a8c('0x4e')]=_[_0x2a8c('0x4c')](_0x4abc33[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x4d')]));_0x389c84['attributes']=_0x389c84[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0x389c84['attributes']:_0x4abc33[_0x2a8c('0x48')];if(!_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x50')](_0x2a8c('0x69'))){_0x389c84['limit']=qs[_0x2a8c('0x34')](_0x12d546['query']['limit']);_0x389c84[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x32')]);}_0x389c84[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x12d546['query']['sort']);_0x389c84[_0x2a8c('0x52')]=qs['filters'](_[_0x2a8c('0x53')](_0x12d546[_0x2a8c('0x49')],_0x4abc33['filters']));_0x389c84[_0x2a8c('0x52')][_0x2a8c('0x65')]=_0x5abb66['id'];if(_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0x389c84[_0x2a8c('0x52')]=_[_0x2a8c('0x55')](_0x389c84[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0x389c84[_0x2a8c('0x4e')],function(_0x3f8737){var _0x10e40a={};_0x10e40a[_0x3f8737]={'$like':'%'+_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x10e40a;})});}if(_0x12d546[_0x2a8c('0x49')][_0x2a8c('0xa8')]){var _0x57295b=_0x12d546['query'][_0x2a8c('0xa8')][_0x2a8c('0xa9')](',');var _0x3833b5={};_0x3833b5[_0x57295b[0x0]]={'$gte':moment(_0x57295b[0x1])[_0x2a8c('0xaa')](_0x2a8c('0xab'))};_0x389c84[_0x2a8c('0x52')]=_[_0x2a8c('0x55')](_0x389c84[_0x2a8c('0x52')],_0x3833b5);}_0x389c84=_['merge']({},_0x389c84,_0x12d546[_0x2a8c('0x6b')]);return db[_0x2a8c('0xa7')][_0x2a8c('0x35')]({'where':_0x389c84[_0x2a8c('0x52')]})[_0x2a8c('0x23')](function(_0x14920f){_0x27c2aa['count']=_0x14920f;if(_0x12d546[_0x2a8c('0x49')][_0x2a8c('0x5b')]){_0x389c84[_0x2a8c('0x57')]=[{'all':!![]}];}return db[_0x2a8c('0xa7')][_0x2a8c('0xac')](_0x389c84);})['then'](function(_0x2a297d){_0x27c2aa[_0x2a8c('0x58')]=_0x2a297d;return _0x27c2aa;});}})['then'](respondWithFilteredResult(_0x2d2ea8,_0x389c84))['catch'](handleError(_0x2d2ea8,null));};exports[_0x2a8c('0x86')]=function(_0x26d985,_0x596551,_0x5e650f){var _0x113aa4,_0x8f777a={},_0x605626;if(_0x26d985[_0x2a8c('0x5e')]['to']){_0x605626=_0x26d985['body']['to'][0x0];}return db['FaxAccount'][_0x2a8c('0x5c')]({'where':{'id':_0x26d985['params']['id']},'include':[{'model':db[_0x2a8c('0xad')],'as':_0x2a8c('0xae'),'include':[{'model':db[_0x2a8c('0x76')],'as':_0x2a8c('0xaf'),'where':{'fax':_0x605626},'limit':0x1,'order':[[_0x2a8c('0xa3'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x596551,null))[_0x2a8c('0x23')](function(_0x359808){_0x113aa4=_0x359808;if(_0x26d985[_0x2a8c('0x5e')]['attachments']&&_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x2a8c('0x4f')]){for(var _0x484147=0x0;_0x484147<_0x26d985['body'][_0x2a8c('0xb0')][_0x2a8c('0x4f')];_0x484147+=0x1){_0x26d985['body'][_0x2a8c('0xb0')][_0x484147]={'filename':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x484147][_0x2a8c('0x40')],'id':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x484147]['id'],'path':path[_0x2a8c('0xb1')](config['root'],'server/files/attachments',_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][_0x484147][_0x2a8c('0xb2')])};}}return respondWithRpcPromise(_0x2a8c('0xb3'),_0x2a8c('0xb3'),{'FaxAccountId':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5a')]['id'])?undefined:_0x26d985[_0x2a8c('0x5a')]['id'],'path':_['isNil'](_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')])?undefined:_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')],'fax':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5e')]['to'][0x0])?undefined:_0x26d985[_0x2a8c('0x5e')]['to'][0x0]},client9002);})['then'](function(){if(_0x113aa4){if(_[_0x2a8c('0xb4')](_0x26d985['body'][_0x2a8c('0xb5')])){_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb5')]=util[_0x2a8c('0xaa')]('\x22%s\x22\x20<%s>',_0x113aa4[_0x2a8c('0x40')],_0x113aa4[_0x2a8c('0xb6')]);}if(_0x113aa4[_0x2a8c('0xae')]){if(_0x113aa4['List'][_0x2a8c('0xaf')][_0x2a8c('0x4f')]){return _0x113aa4[_0x2a8c('0xae')]['Contacts'][0x0];}else{return db[_0x2a8c('0x76')][_0x2a8c('0x5d')](_[_0x2a8c('0x1b')](_0x26d985['body'],{'firstName':_0x26d985[_0x2a8c('0x5e')]['to'][0x0],'phone':_0x26d985['body']['to'][0x0],'fax':_0x26d985[_0x2a8c('0x5e')]['to'][0x0],'ListId':_0x113aa4[_0x2a8c('0xa5')]}));}}else{throw new Error(_0x2a8c('0xb7'));}}else{throw new Error(_0x2a8c('0xb8'));}})['then'](function(_0x2092f){if(_0x2092f){return db[_0x2a8c('0x73')][_0x2a8c('0x5c')]({'where':{'ContactId':_0x2092f['id'],'closed':![],'FaxAccountId':_0x113aa4['id']}})[_0x2a8c('0x23')](function(_0x2295f3){if(_0x2295f3){return[_0x2295f3,![]];}return db[_0x2a8c('0x73')]['create']({'UserId':_0x26d985[_0x2a8c('0x60')]['id'],'ContactId':_0x2092f['id'],'FaxAccountId':_0x113aa4['id'],'fax':_0x26d985['body']['to'][0x0],'firstMsgDirection':_0x2a8c('0xb9'),'Messages':[_[_0x2a8c('0x55')](_0x26d985[_0x2a8c('0x5e')],{'read':![],'body':_0x26d985[_0x2a8c('0x5e')]['attachments'][0x0][_0x2a8c('0xba')],'FaxAccountId':_0x113aa4['id'],'UserId':_0x26d985[_0x2a8c('0x60')]['id'],'ContactId':_0x2092f['id'],'AttachmentId':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0x2a8c('0xa7')],'as':_0x2a8c('0xbb')}]})['then'](function(_0xdebe84){return[_0xdebe84,!![]];});});}else{throw new Error(_0x2a8c('0xbc'));}})[_0x2a8c('0xbd')](function(_0x3e10ae,_0x1c4ff8){if(_0x1c4ff8){return _0x3e10ae;}return db[_0x2a8c('0xa7')]['create']({'direction':'out','read':![],'body':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0xba')],'FaxAccountId':_0x113aa4['id'],'FaxInteractionId':_0x3e10ae['id'],'UserId':_0x26d985[_0x2a8c('0x60')]['id'],'ContactId':_0x3e10ae[_0x2a8c('0xbe')],'AttachmentId':_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0]['id']})[_0x2a8c('0x23')](function(_0x2b5671){_0x3e10ae[_0x2a8c('0xbf')][_0x2a8c('0xbb')]=[];_0x3e10ae[_0x2a8c('0xbf')]['Messages'][_0x2a8c('0x91')](_0x2b5671['dataValues']);return _0x3e10ae;});})[_0x2a8c('0x23')](function(_0x3587df){respondWithRpcPromise(_0x2a8c('0xc0'),_0x2a8c('0xc0'),{'FaxAccountId':_['isNil'](_0x26d985[_0x2a8c('0x5a')]['id'])?undefined:_0x26d985[_0x2a8c('0x5a')]['id'],'path':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')])?undefined:_0x26d985[_0x2a8c('0x5e')][_0x2a8c('0xb0')][0x0][_0x2a8c('0x6')],'fax':_[_0x2a8c('0xb4')](_0x26d985[_0x2a8c('0x5e')]['to'][0x0])?undefined:_0x26d985['body']['to'][0x0],'AttachmentId':_0x26d985[_0x2a8c('0x5e')]['attachments'][0x0]['id']},client9002)['then'](function(_0x4ac2df){logger[_0x2a8c('0x24')](_0x2a8c('0xc1'),_0x4ac2df);})[_0x2a8c('0x2e')](function(_0x3facb4){logger[_0x2a8c('0x24')](_0x2a8c('0xc1'),_0x3facb4);});return _0x3587df;})['then'](respondWithResult(_0x596551,null))[_0x2a8c('0x2e')](handleError(_0x596551,null));};exports[_0x2a8c('0xc2')]=function(_0x11b004,_0xa59318,_0x4f327a){return db[_0x2a8c('0x45')]['find']({'where':{'id':_0x11b004[_0x2a8c('0x5a')]['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0xa59318,null))[_0x2a8c('0x23')](function(_0x9c57c3){if(_0x9c57c3){return _0x9c57c3[_0x2a8c('0xc2')](_0x11b004[_0x2a8c('0x5e')][_0x2a8c('0x6d')],_[_0x2a8c('0x74')](_0x11b004[_0x2a8c('0x5e')],[_0x2a8c('0x6d'),'id'])||{})['spread'](function(_0x5a4394){for(var _0x5c2059=0x0;_0x5c2059<_0x11b004['body']['ids'][_0x2a8c('0x4f')];_0x5c2059+=0x1){socket[_0x2a8c('0xc3')](_0x2a8c('0xc4'),{'UserId':Number(_0x11b004[_0x2a8c('0x5e')]['ids'][_0x5c2059]),'FaxAccountId':Number(_0x11b004[_0x2a8c('0x5a')]['id'])});}return _0x5a4394;});}})[_0x2a8c('0x23')](respondWithResult(_0xa59318,null))[_0x2a8c('0x2e')](handleError(_0xa59318,null));};exports[_0x2a8c('0xc5')]=function(_0x33ee08,_0x391c2b,_0x4fd9b4){return db[_0x2a8c('0x45')][_0x2a8c('0x5c')]({'where':{'id':_0x33ee08['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x391c2b,null))[_0x2a8c('0x23')](function(_0x176f77){if(_0x176f77){return _0x176f77[_0x2a8c('0xc5')](_0x33ee08[_0x2a8c('0x49')][_0x2a8c('0x6d')])[_0x2a8c('0x23')](function(){if(_[_0x2a8c('0xc6')](_0x33ee08['query']['ids'])){for(var _0xe65015=0x0;_0xe65015<_0x33ee08['query'][_0x2a8c('0x6d')][_0x2a8c('0x4f')];_0xe65015+=0x1){socket['emit'](_0x2a8c('0xc7'),{'UserId':Number(_0x33ee08[_0x2a8c('0x49')][_0x2a8c('0x6d')][_0xe65015]),'FaxAccountId':Number(_0x33ee08['params']['id'])});}}else{socket[_0x2a8c('0xc3')](_0x2a8c('0xc7'),{'UserId':Number(_0x33ee08[_0x2a8c('0x49')][_0x2a8c('0x6d')]),'FaxAccountId':Number(_0x33ee08[_0x2a8c('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x391c2b,null))['catch'](handleError(_0x391c2b,null));};exports[_0x2a8c('0xc8')]=function(_0x4921ef,_0x5893a6,_0x5a459c){var _0xcc7efd={};var _0x43b046={};var _0x56fc5c;var _0x3ea048;return db['FaxAccount'][_0x2a8c('0x67')]({'where':{'id':_0x4921ef['params']['id']}})[_0x2a8c('0x23')](handleEntityNotFound(_0x5893a6,null))['then'](function(_0x10bd30){if(_0x10bd30){_0x56fc5c=_0x10bd30;_0x43b046['model']=_[_0x2a8c('0x4a')](db[_0x2a8c('0x77')][_0x2a8c('0x46')]);_0x43b046[_0x2a8c('0x49')]=_[_0x2a8c('0x4a')](_0x4921ef['query']);_0x43b046['filters']=_[_0x2a8c('0x4c')](_0x43b046[_0x2a8c('0x48')],_0x43b046[_0x2a8c('0x49')]);_0xcc7efd[_0x2a8c('0x4e')]=_['intersection'](_0x43b046[_0x2a8c('0x48')],qs[_0x2a8c('0x4d')](_0x4921ef[_0x2a8c('0x49')]['fields']));_0xcc7efd['attributes']=_0xcc7efd[_0x2a8c('0x4e')][_0x2a8c('0x4f')]?_0xcc7efd['attributes']:_0x43b046['model'];_0xcc7efd[_0x2a8c('0x6a')]=qs[_0x2a8c('0x51')](_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x51')]);_0xcc7efd[_0x2a8c('0x52')]=qs[_0x2a8c('0x4b')](_[_0x2a8c('0x53')](_0x4921ef[_0x2a8c('0x49')],_0x43b046[_0x2a8c('0x4b')]));if(_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x54')]){_0xcc7efd['where']=_['merge'](_0xcc7efd[_0x2a8c('0x52')],{'$or':_[_0x2a8c('0x44')](_0xcc7efd[_0x2a8c('0x4e')],function(_0x11925e){var _0x41b81e={};_0x41b81e[_0x11925e]={'$like':'%'+_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x54')]+'%'};return _0x41b81e;})});}_0xcc7efd=_[_0x2a8c('0x55')]({},_0xcc7efd,_0x4921ef[_0x2a8c('0x6b')]);return _0x56fc5c['getAgents'](_0xcc7efd);}})['then'](function(_0x24f2fa){if(_0x24f2fa){_0x3ea048=_0x24f2fa['length'];if(!_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x50')]('nolimit')){_0xcc7efd['limit']=qs[_0x2a8c('0x34')](_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x34')]);_0xcc7efd[_0x2a8c('0x32')]=qs[_0x2a8c('0x32')](_0x4921ef[_0x2a8c('0x49')][_0x2a8c('0x32')]);}return _0x56fc5c[_0x2a8c('0xc8')](_0xcc7efd);}})['then'](function(_0x417f02){if(_0x417f02){return _0x417f02?{'count':_0x3ea048,'rows':_0x417f02}:null;}})[_0x2a8c('0x23')](respondWithResult(_0x5893a6,null))[_0x2a8c('0x2e')](handleError(_0x5893a6,null));};
\ No newline at end of file
index 05b356a..b1ecd05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20fb=['hook','exports','events','../../mysqldb','FaxAccount','update','remove','emit','hasOwnProperty'];(function(_0x1e48d3,_0x5d8c43){var _0x2852b1=function(_0x11d7b3){while(--_0x11d7b3){_0x1e48d3['push'](_0x1e48d3['shift']());}};_0x2852b1(++_0x5d8c43);}(_0x20fb,0x1b2));var _0xb20f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x20fb[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0xb20f('0x0'));var FaxAccount=require(_0xb20f('0x1'))['db'][_0xb20f('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xb20f('0x3'),'afterDestroy':_0xb20f('0x4')};function emitEvent(_0x18b212){return function(_0x49816f,_0x1f3da9,_0x1b1cd0){FaxAccountEvents[_0xb20f('0x5')](_0x18b212+':'+_0x49816f['id'],_0x49816f);FaxAccountEvents['emit'](_0x18b212,_0x49816f);_0x1b1cd0(null);};}for(var e in events){if(events[_0xb20f('0x6')](e)){var event=events[e];FaxAccount[_0xb20f('0x7')](e,emitEvent(event));}}module[_0xb20f('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0x326b=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0x326b,0x1dc));var _0xb326=function(_0x35fb56,_0x5dadff){_0x35fb56=_0x35fb56-0x0;var _0x2fd52c=_0x326b[_0x35fb56];return _0x2fd52c;};'use strict';var EventEmitter=require(_0xb326('0x0'));var FaxAccount=require(_0xb326('0x1'))['db'][_0xb326('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb326('0x3')](0x0);var events={'afterCreate':_0xb326('0x4'),'afterUpdate':_0xb326('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3fdbc2){return function(_0x50e112,_0x217543,_0x51ffb8){FaxAccountEvents[_0xb326('0x6')](_0x3fdbc2+':'+_0x50e112['id'],_0x50e112);FaxAccountEvents['emit'](_0x3fdbc2,_0x50e112);_0x51ffb8(null);};}for(var e in events){if(events[_0xb326('0x7')](e)){var event=events[e];FaxAccount[_0xb326('0x8')](e,emitEvent(event));}}module[_0xb326('0x9')]=FaxAccountEvents;
\ No newline at end of file
index 16fe4ba..7fc28a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82d5=['fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x5d87e7,_0x2af2a8){var _0x130e23=function(_0x4e7ad0){while(--_0x4e7ad0){_0x5d87e7['push'](_0x5d87e7['shift']());}};_0x130e23(++_0x2af2a8);}(_0x82d5,0x12d));var _0x582d=function(_0xce8bce,_0x5bc5e8){_0xce8bce=_0xce8bce-0x0;var _0x135d09=_0x82d5[_0xce8bce];return _0x135d09;};'use strict';var _=require(_0x582d('0x0'));var util=require(_0x582d('0x1'));var logger=require(_0x582d('0x2'))(_0x582d('0x3'));var moment=require(_0x582d('0x4'));var BPromise=require(_0x582d('0x5'));var rp=require(_0x582d('0x6'));var fs=require('fs');var path=require(_0x582d('0x7'));var rimraf=require(_0x582d('0x8'));var config=require(_0x582d('0x9'));var attributes=require(_0x582d('0xa'));module[_0x582d('0xb')]=function(_0x5931fa,_0xf04fa3){return _0x5931fa[_0x582d('0xc')](_0x582d('0xd'),attributes,{'tableName':_0x582d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae6a=['define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxAccount.attributes','exports'];(function(_0x357769,_0x370af5){var _0x15a333=function(_0x5bda5e){while(--_0x5bda5e){_0x357769['push'](_0x357769['shift']());}};_0x15a333(++_0x370af5);}(_0xae6a,0x153));var _0xaae6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xae6a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xaae6('0x0'));var util=require('util');var logger=require(_0xaae6('0x1'))('api');var moment=require(_0xaae6('0x2'));var BPromise=require(_0xaae6('0x3'));var rp=require(_0xaae6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaae6('0x5'));var config=require(_0xaae6('0x6'));var attributes=require(_0xaae6('0x7'));module[_0xaae6('0x8')]=function(_0x402f83,_0x198efb){return _0x402f83[_0xaae6('0x9')](_0xaae6('0xa'),attributes,{'tableName':_0xaae6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa72e9a..bb54c4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f8e=['error','code','message','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','map','include','model','catch','NotifyFaxAccount','body','fax','CmContact','ValidationError','difference','keys','updatedAt','createdAt','CompanyId','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','List','Contacts','DESC','FaxApplication','get','applications','list','orderBy','Applications','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x376f0e,_0x27f083){var _0x581b8c=function(_0x6bbabf){while(--_0x6bbabf){_0x376f0e['push'](_0x376f0e['shift']());}};_0x581b8c(++_0x27f083);}(_0x9f8e,0xf1));var _0xe9f8=function(_0x58edb4,_0x4e7626){_0x58edb4=_0x58edb4-0x0;var _0x26cd56=_0x9f8e[_0x58edb4];return _0x26cd56;};'use strict';var _=require(_0xe9f8('0x0'));var util=require(_0xe9f8('0x1'));var moment=require(_0xe9f8('0x2'));var BPromise=require(_0xe9f8('0x3'));var rs=require(_0xe9f8('0x4'));var fs=require('fs');var Redis=require(_0xe9f8('0x5'));var db=require(_0xe9f8('0x6'))['db'];var utils=require(_0xe9f8('0x7'));var logger=require(_0xe9f8('0x8'))(_0xe9f8('0x9'));var config=require(_0xe9f8('0xa'));var jayson=require(_0xe9f8('0xb'));var client=jayson[_0xe9f8('0xc')][_0xe9f8('0xd')]({'port':0x232c});config['redis']=_[_0xe9f8('0xe')](config[_0xe9f8('0xf')],{'host':_0xe9f8('0x10'),'port':0x18eb});var socket=require(_0xe9f8('0x11'))(new Redis(config[_0xe9f8('0xf')]));require(_0xe9f8('0x12'))['register'](socket);function respondWithRpcPromise(_0x16fae8,_0x5b6b83,_0x1fbca0){return new BPromise(function(_0x232742,_0x1b579f){return client[_0xe9f8('0x13')](_0x16fae8,_0x1fbca0)[_0xe9f8('0x14')](function(_0x55fa09){logger[_0xe9f8('0x15')](_0xe9f8('0x16'),_0x5b6b83,_0xe9f8('0x17'));logger[_0xe9f8('0x18')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5b6b83,_0xe9f8('0x17'),JSON[_0xe9f8('0x19')](_0x55fa09));if(_0x55fa09[_0xe9f8('0x1a')]){if(_0x55fa09['error'][_0xe9f8('0x1b')]===0x1f4){logger[_0xe9f8('0x1a')](_0xe9f8('0x16'),_0x5b6b83,_0x55fa09[_0xe9f8('0x1a')][_0xe9f8('0x1c')]);return _0x1b579f(_0x55fa09[_0xe9f8('0x1a')][_0xe9f8('0x1c')]);}logger[_0xe9f8('0x1a')]('FaxAccount,\x20%s,\x20%s',_0x5b6b83,_0x55fa09['error']['message']);return _0x232742(_0x55fa09['error']['message']);}else{logger[_0xe9f8('0x15')](_0xe9f8('0x16'),_0x5b6b83,_0xe9f8('0x17'));_0x232742(_0x55fa09['result'][_0xe9f8('0x1c')]);}})['catch'](function(_0x2cc50a){logger[_0xe9f8('0x1a')](_0xe9f8('0x16'),_0x5b6b83,_0x2cc50a);_0x1b579f(_0x2cc50a);});});}exports[_0xe9f8('0x1d')]=function(_0x5fec1){var _0x3e440d=this;return new Promise(function(_0x53646e,_0x13682f){return db[_0xe9f8('0x1e')][_0xe9f8('0x1f')]({'raw':_0x5fec1['options']?_0x5fec1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x21')]||null:null,'attributes':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x22')]||null:null,'limit':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x23')]||null:null,'include':_0x5fec1[_0xe9f8('0x20')]?_0x5fec1[_0xe9f8('0x20')]['include']?_[_0xe9f8('0x24')](_0x5fec1[_0xe9f8('0x20')][_0xe9f8('0x25')],function(_0x4c5f15){return{'model':db[_0x4c5f15[_0xe9f8('0x26')]],'as':_0x4c5f15['as'],'attributes':_0x4c5f15[_0xe9f8('0x22')],'include':_0x4c5f15[_0xe9f8('0x25')]?_['map'](_0x4c5f15[_0xe9f8('0x25')],function(_0x24bf0f){return{'model':db[_0x24bf0f['model']],'as':_0x24bf0f['as'],'attributes':_0x24bf0f[_0xe9f8('0x22')],'include':_0x24bf0f[_0xe9f8('0x25')]?_[_0xe9f8('0x24')](_0x24bf0f['include'],function(_0x1d011d){return{'model':db[_0x1d011d[_0xe9f8('0x26')]],'as':_0x1d011d['as'],'attributes':_0x1d011d['attributes']};}):[]};}):[]};}):[]:[]})[_0xe9f8('0x14')](function(_0x5050ff){logger[_0xe9f8('0x15')](_0xe9f8('0x1d'),_0x5fec1);logger[_0xe9f8('0x18')]('GetFaxAccount',_0x5fec1,JSON[_0xe9f8('0x19')](_0x5050ff));_0x53646e(_0x5050ff);})[_0xe9f8('0x27')](function(_0x591e4c){logger[_0xe9f8('0x1a')](_0xe9f8('0x1d'),_0x591e4c[_0xe9f8('0x1c')],_0x5fec1);_0x13682f(_0x3e440d[_0xe9f8('0x1a')](0x1f4,_0x591e4c[_0xe9f8('0x1c')]));});});};exports[_0xe9f8('0x28')]=function(_0x3446d9,_0x7007e1,_0x1b514f){var _0x34a23d=this;return new Promise(function(_0x62a404,_0x23d3c7){var _0x1a4f34={'body':_0x3446d9[_0xe9f8('0x29')],'channel':_0xe9f8('0x2a')};var _0x475cfb=[];var _0x439eb8=[];var _0x410e69={};return db[_0xe9f8('0x2b')]['describe']()['then'](function(_0x3d1b00){if(!_0x3d1b00){throw new db['Sequelize'][(_0xe9f8('0x2c'))]('no\x20available\x20attributes');}_0x475cfb=_[_0xe9f8('0x2d')](_[_0xe9f8('0x2e')](_0x3d1b00),['createdAt',_0xe9f8('0x2f')]);_0x439eb8=_[_0xe9f8('0x2d')](_[_0xe9f8('0x2e')](_0x3d1b00),[_0xe9f8('0x30'),'updatedAt',_0xe9f8('0x31'),'ListId']);if(_0x3446d9[_0xe9f8('0x29')]['id']){delete _0x3446d9['body']['id'];}if(_[_0xe9f8('0x32')](_0x3446d9[_0xe9f8('0x29')]['from'])){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))]('from\x20is\x20mandatory');}if(_[_0xe9f8('0x32')](_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x29')])||_0x3446d9['body'][_0xe9f8('0x29')]===''){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))](_0xe9f8('0x34'));}if(_[_0xe9f8('0x32')](_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x35')])){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x439eb8);}if(!_['includes'](_0x439eb8,_0x3446d9['body'][_0xe9f8('0x35')])){throw new db[(_0xe9f8('0x33'))][(_0xe9f8('0x2c'))](_0xe9f8('0x36')+_0x439eb8);}_0x410e69[_0x3446d9['body'][_0xe9f8('0x35')]]=_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x37')];})[_0xe9f8('0x14')](function(){return db['FaxAccount'][_0xe9f8('0x38')]({'where':{'id':_0x3446d9[_0xe9f8('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xe9f8('0x3a'),'include':[{'model':db[_0xe9f8('0x2b')],'as':_0xe9f8('0x3b'),'where':_0x410e69,'limit':0x1,'order':[[_0xe9f8('0x2f'),_0xe9f8('0x3c')]]}]},{'model':db[_0xe9f8('0x3d')],'as':'Applications'}]});})[_0xe9f8('0x14')](function(_0x476f16){if(_0x476f16&&_0x476f16[_0xe9f8('0x3a')]){var _0x5cb5d7=_0x476f16[_0xe9f8('0x3e')]({'plain':!![]});_0x1a4f34[_0xe9f8('0x39')]=_0x5cb5d7;_0x1a4f34[_0xe9f8('0x3f')]=_0x5cb5d7['Applications'];_0x1a4f34[_0xe9f8('0x40')]=_0x5cb5d7[_0xe9f8('0x3a')];_0x1a4f34['applications']=_[_0xe9f8('0x41')](_0x1a4f34[_0xe9f8('0x3f')],['priority'],['asc']);if(_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x42')]){delete _0x1a4f34['account'][_0xe9f8('0x42')];}if(_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x3a')]&&_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x3a')][_0xe9f8('0x3b')]['length']){return _0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x3a')][_0xe9f8('0x3b')][0x0];}var _0x1b7852=_[_0xe9f8('0xe')](_0x3446d9[_0xe9f8('0x29')],{'firstName':_0x3446d9[_0xe9f8('0x29')]['from'],'ListId':_0x5cb5d7['ListId']});_0x1b7852[_0x3446d9[_0xe9f8('0x29')]['mapKey']]=_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x37')];return db[_0xe9f8('0x2b')][_0xe9f8('0x43')](_0x1b7852,{'fields':_0x475cfb,'raw':!![]});}})[_0xe9f8('0x14')](function(_0x24b033){_0x1a4f34[_0xe9f8('0x44')]=_0x24b033;if(_0x24b033){var _0x7cac03={'ContactId':_0x24b033['id'],'FaxAccountId':_0x3446d9[_0xe9f8('0x39')]['id'],'fax':_0x24b033[_0xe9f8('0x2a')]};return db[_0xe9f8('0x45')][_0xe9f8('0x38')]({'where':{'ContactId':_0x24b033['id'],'closed':![],'FaxAccountId':_0x3446d9['account']['id']}})[_0xe9f8('0x14')](function(_0x553196){if(_0x553196){return[_0x553196,![]];}return db[_0xe9f8('0x45')][_0xe9f8('0x43')](_0x7cac03)[_0xe9f8('0x14')](function(_0xbf8854){return[_0xbf8854,!![]];});});}else{throw new Error(_0xe9f8('0x46'));}})['spread'](function(_0x31ca78,_0x279bc5){var _0x3fce99=_0x31ca78['get']({'plain':!![]});if(_0x279bc5){if(_0x1a4f34[_0xe9f8('0x39')][_0xe9f8('0x47')]){_0x1a4f34[_0xe9f8('0x3f')][_0xe9f8('0x48')]({'id':0x0,'priority':_0x1a4f34[_0xe9f8('0x3f')][_0xe9f8('0x49')]+0x1,'app':_0xe9f8('0x4a'),'appdata':_0xe9f8('0x4b'),'interval':_0xe9f8('0x4c')});}_0x3fce99[_0xe9f8('0x4d')]=!![];}else{_0x3fce99['created']=![];}_0x1a4f34[_0xe9f8('0x4e')]=_0x3fce99;return db['FaxMessage']['create']({'body':_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x29')],'FaxAccountId':_0x3446d9[_0xe9f8('0x39')]['id'],'FaxInteractionId':_0x31ca78['id'],'direction':'in','ContactId':_0x31ca78[_0xe9f8('0x4f')],'AttachmentId':_0x3446d9[_0xe9f8('0x29')][_0xe9f8('0x50')]});})[_0xe9f8('0x14')](function(_0xa326ef){_0x1a4f34['message']=_0xa326ef;if(_0x1a4f34[_0xe9f8('0x4e')][_0xe9f8('0x51')]){return db[_0xe9f8('0x52')]['find']({'attributes':['id',_0xe9f8('0x53')],'where':{'id':_0x1a4f34[_0xe9f8('0x4e')][_0xe9f8('0x51')]}})[_0xe9f8('0x14')](function(_0x143c77){if(_0x143c77){_0x1a4f34[_0xe9f8('0x3f')][_0xe9f8('0x54')]({'id':0x0,'priority':0x0,'app':_0xe9f8('0x55'),'appdata':_0x143c77['name']+','+(_0x1a4f34['account'][_0xe9f8('0x56')]||0xa),'interval':_0xe9f8('0x4c')});}return respondWithRpcPromise(_0xe9f8('0x57'),'startRouting',_0x1a4f34);});}return respondWithRpcPromise('Start',_0xe9f8('0x58'),_0x1a4f34);})[_0xe9f8('0x14')](function(_0x34ab93){_0x62a404(_0x34ab93);})[_0xe9f8('0x27')](function(_0x3fb71e){_0x23d3c7(_0x34a23d[_0xe9f8('0x1a')](0x1f4,_0x3fb71e[_0xe9f8('0x1c')]));});});};
\ No newline at end of file
+var _0x3703=['Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','account','applications','list','orderBy','length','create','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','name','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','catch','NotifyFaxAccount','body','fax','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from'];(function(_0x17edd1,_0xd37b1f){var _0x20d982=function(_0x5d4209){while(--_0x5d4209){_0x17edd1['push'](_0x17edd1['shift']());}};_0x20d982(++_0xd37b1f);}(_0x3703,0xd7));var _0x3370=function(_0x2bdeef,_0x21f965){_0x2bdeef=_0x2bdeef-0x0;var _0x59664b=_0x3703[_0x2bdeef];return _0x59664b;};'use strict';var _=require(_0x3370('0x0'));var util=require(_0x3370('0x1'));var moment=require(_0x3370('0x2'));var BPromise=require('bluebird');var rs=require(_0x3370('0x3'));var fs=require('fs');var Redis=require(_0x3370('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3370('0x5'));var logger=require('../../config/logger')(_0x3370('0x6'));var config=require('../../config/environment');var jayson=require(_0x3370('0x7'));var client=jayson['client']['http']({'port':0x232c});config[_0x3370('0x8')]=_[_0x3370('0x9')](config[_0x3370('0x8')],{'host':_0x3370('0xa'),'port':0x18eb});var socket=require(_0x3370('0xb'))(new Redis(config[_0x3370('0x8')]));require(_0x3370('0xc'))['register'](socket);function respondWithRpcPromise(_0x75cc4f,_0x1c2e8e,_0x10294e){return new BPromise(function(_0x4bb0d2,_0x26454b){return client[_0x3370('0xd')](_0x75cc4f,_0x10294e)[_0x3370('0xe')](function(_0x3030cd){logger['info'](_0x3370('0xf'),_0x1c2e8e,_0x3370('0x10'));logger[_0x3370('0x11')](_0x3370('0x12'),_0x1c2e8e,'request\x20sent',JSON[_0x3370('0x13')](_0x3030cd));if(_0x3030cd[_0x3370('0x14')]){if(_0x3030cd[_0x3370('0x14')][_0x3370('0x15')]===0x1f4){logger[_0x3370('0x14')](_0x3370('0xf'),_0x1c2e8e,_0x3030cd['error'][_0x3370('0x16')]);return _0x26454b(_0x3030cd['error'][_0x3370('0x16')]);}logger[_0x3370('0x14')]('FaxAccount,\x20%s,\x20%s',_0x1c2e8e,_0x3030cd[_0x3370('0x14')][_0x3370('0x16')]);return _0x4bb0d2(_0x3030cd['error'][_0x3370('0x16')]);}else{logger[_0x3370('0x17')](_0x3370('0xf'),_0x1c2e8e,_0x3370('0x10'));_0x4bb0d2(_0x3030cd['result'][_0x3370('0x16')]);}})['catch'](function(_0x1bcf59){logger[_0x3370('0x14')](_0x3370('0xf'),_0x1c2e8e,_0x1bcf59);_0x26454b(_0x1bcf59);});});}exports['GetFaxAccount']=function(_0x83787c){var _0x38c311=this;return new Promise(function(_0x131536,_0x15f42a){return db['FaxAccount'][_0x3370('0x18')]({'raw':_0x83787c[_0x3370('0x19')]?_0x83787c[_0x3370('0x19')][_0x3370('0x1a')]===undefined?!![]:![]:!![],'where':_0x83787c['options']?_0x83787c[_0x3370('0x19')][_0x3370('0x1b')]||null:null,'attributes':_0x83787c[_0x3370('0x19')]?_0x83787c[_0x3370('0x19')][_0x3370('0x1c')]||null:null,'limit':_0x83787c[_0x3370('0x19')]?_0x83787c['options'][_0x3370('0x1d')]||null:null,'include':_0x83787c[_0x3370('0x19')]?_0x83787c['options'][_0x3370('0x1e')]?_[_0x3370('0x1f')](_0x83787c['options']['include'],function(_0x426df7){return{'model':db[_0x426df7[_0x3370('0x20')]],'as':_0x426df7['as'],'attributes':_0x426df7[_0x3370('0x1c')],'include':_0x426df7['include']?_['map'](_0x426df7[_0x3370('0x1e')],function(_0x303868){return{'model':db[_0x303868['model']],'as':_0x303868['as'],'attributes':_0x303868[_0x3370('0x1c')],'include':_0x303868[_0x3370('0x1e')]?_[_0x3370('0x1f')](_0x303868[_0x3370('0x1e')],function(_0x3fe263){return{'model':db[_0x3fe263[_0x3370('0x20')]],'as':_0x3fe263['as'],'attributes':_0x3fe263[_0x3370('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x599ca6){logger['info'](_0x3370('0x21'),_0x83787c);logger['debug'](_0x3370('0x21'),_0x83787c,JSON[_0x3370('0x13')](_0x599ca6));_0x131536(_0x599ca6);})[_0x3370('0x22')](function(_0xc253b8){logger[_0x3370('0x14')](_0x3370('0x21'),_0xc253b8[_0x3370('0x16')],_0x83787c);_0x15f42a(_0x38c311[_0x3370('0x14')](0x1f4,_0xc253b8['message']));});});};exports[_0x3370('0x23')]=function(_0xdb3ca5,_0x350ec5,_0xe4564c){var _0x28a62e=this;return new Promise(function(_0x44f67b,_0x4dcc9a){var _0x1ce45a={'body':_0xdb3ca5[_0x3370('0x24')],'channel':_0x3370('0x25')};var _0x56120f=[];var _0x27e3d6=[];var _0x466660={};return db['CmContact'][_0x3370('0x26')]()[_0x3370('0xe')](function(_0x12073d){if(!_0x12073d){throw new db['Sequelize'][(_0x3370('0x27'))](_0x3370('0x28'));}_0x56120f=_[_0x3370('0x29')](_[_0x3370('0x2a')](_0x12073d),[_0x3370('0x2b'),_0x3370('0x2c')]);_0x27e3d6=_[_0x3370('0x29')](_[_0x3370('0x2a')](_0x12073d),[_0x3370('0x2b'),_0x3370('0x2c'),_0x3370('0x2d'),_0x3370('0x2e')]);if(_0xdb3ca5[_0x3370('0x24')]['id']){delete _0xdb3ca5['body']['id'];}if(_[_0x3370('0x2f')](_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')])){throw new db[(_0x3370('0x31'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0xdb3ca5[_0x3370('0x24')][_0x3370('0x24')])||_0xdb3ca5['body'][_0x3370('0x24')]===''){throw new db['Sequelize']['ValidationError'](_0x3370('0x32'));}if(_[_0x3370('0x2f')](_0xdb3ca5[_0x3370('0x24')][_0x3370('0x33')])){throw new db[(_0x3370('0x31'))][(_0x3370('0x27'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x27e3d6);}if(!_[_0x3370('0x34')](_0x27e3d6,_0xdb3ca5[_0x3370('0x24')][_0x3370('0x33')])){throw new db[(_0x3370('0x31'))][(_0x3370('0x27'))](_0x3370('0x35')+_0x27e3d6);}_0x466660[_0xdb3ca5['body'][_0x3370('0x33')]]=_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')];})['then'](function(){return db[_0x3370('0x36')][_0x3370('0x37')]({'where':{'id':_0xdb3ca5['account']['id']},'include':[{'model':db[_0x3370('0x38')],'as':_0x3370('0x39'),'include':[{'model':db[_0x3370('0x3a')],'as':_0x3370('0x3b'),'where':_0x466660,'limit':0x1,'order':[[_0x3370('0x2c'),_0x3370('0x3c')]]}]},{'model':db[_0x3370('0x3d')],'as':_0x3370('0x3e')}]});})[_0x3370('0xe')](function(_0x3e1bf1){if(_0x3e1bf1&&_0x3e1bf1[_0x3370('0x39')]){var _0x528623=_0x3e1bf1[_0x3370('0x3f')]({'plain':!![]});_0x1ce45a[_0x3370('0x40')]=_0x528623;_0x1ce45a[_0x3370('0x41')]=_0x528623['Applications'];_0x1ce45a[_0x3370('0x42')]=_0x528623[_0x3370('0x39')];_0x1ce45a[_0x3370('0x41')]=_[_0x3370('0x43')](_0x1ce45a[_0x3370('0x41')],['priority'],['asc']);if(_0x1ce45a['account']['Applications']){delete _0x1ce45a[_0x3370('0x40')]['Applications'];}if(_0x1ce45a[_0x3370('0x40')]['List']&&_0x1ce45a[_0x3370('0x40')]['List'][_0x3370('0x3b')][_0x3370('0x44')]){return _0x1ce45a['account'][_0x3370('0x39')][_0x3370('0x3b')][0x0];}var _0x3f8710=_[_0x3370('0x9')](_0xdb3ca5['body'],{'firstName':_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')],'ListId':_0x528623[_0x3370('0x2e')]});_0x3f8710[_0xdb3ca5[_0x3370('0x24')]['mapKey']]=_0xdb3ca5[_0x3370('0x24')][_0x3370('0x30')];return db[_0x3370('0x3a')][_0x3370('0x45')](_0x3f8710,{'fields':_0x56120f,'raw':!![]});}})['then'](function(_0x302a3f){_0x1ce45a['contact']=_0x302a3f;if(_0x302a3f){var _0xf5d4a4={'ContactId':_0x302a3f['id'],'FaxAccountId':_0xdb3ca5[_0x3370('0x40')]['id'],'fax':_0x302a3f[_0x3370('0x25')]};return db[_0x3370('0x46')][_0x3370('0x37')]({'where':{'ContactId':_0x302a3f['id'],'closed':![],'FaxAccountId':_0xdb3ca5[_0x3370('0x40')]['id']}})[_0x3370('0xe')](function(_0x57b060){if(_0x57b060){return[_0x57b060,![]];}return db[_0x3370('0x46')]['create'](_0xf5d4a4)[_0x3370('0xe')](function(_0x45d075){return[_0x45d075,!![]];});});}else{throw new Error(_0x3370('0x47'));}})['spread'](function(_0x8bb3e4,_0x10950a){var _0x28b754=_0x8bb3e4[_0x3370('0x3f')]({'plain':!![]});if(_0x10950a){if(_0x1ce45a['account'][_0x3370('0x48')]){_0x1ce45a[_0x3370('0x41')][_0x3370('0x49')]({'id':0x0,'priority':_0x1ce45a[_0x3370('0x41')][_0x3370('0x44')]+0x1,'app':_0x3370('0x4a'),'appdata':_0x3370('0x4b'),'interval':_0x3370('0x4c')});}_0x28b754[_0x3370('0x4d')]=!![];}else{_0x28b754[_0x3370('0x4d')]=![];}_0x1ce45a[_0x3370('0x4e')]=_0x28b754;return db[_0x3370('0x4f')][_0x3370('0x45')]({'body':_0xdb3ca5['body'][_0x3370('0x24')],'FaxAccountId':_0xdb3ca5[_0x3370('0x40')]['id'],'FaxInteractionId':_0x8bb3e4['id'],'direction':'in','ContactId':_0x8bb3e4[_0x3370('0x50')],'AttachmentId':_0xdb3ca5[_0x3370('0x24')][_0x3370('0x51')]});})[_0x3370('0xe')](function(_0x1ff7eb){_0x1ce45a['message']=_0x1ff7eb;if(_0x1ce45a[_0x3370('0x4e')][_0x3370('0x52')]){return db[_0x3370('0x53')][_0x3370('0x37')]({'attributes':['id','name'],'where':{'id':_0x1ce45a[_0x3370('0x4e')][_0x3370('0x52')]}})[_0x3370('0xe')](function(_0x324d9c){if(_0x324d9c){_0x1ce45a[_0x3370('0x41')][_0x3370('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x324d9c[_0x3370('0x55')]+','+(_0x1ce45a[_0x3370('0x40')]['waitForTheAssignedAgent']||0xa),'interval':_0x3370('0x4c')});}return respondWithRpcPromise(_0x3370('0x56'),_0x3370('0x57'),_0x1ce45a);});}return respondWithRpcPromise('Start',_0x3370('0x57'),_0x1ce45a);})[_0x3370('0xe')](function(_0x493a84){_0x44f67b(_0x493a84);})[_0x3370('0x22')](function(_0x3f60cf){_0x4dcc9a(_0x28a62e['error'](0x1f4,_0x3f60cf[_0x3370('0x16')]));});});};
\ No newline at end of file
index cd7f2e1..9024eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9cc=['emit','register','faxAccount:','./faxAccount.events','save','remove'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xc9cc,0x117));var _0xcc9c=function(_0x40baad,_0x5863ae){_0x40baad=_0x40baad-0x0;var _0x5244b7=_0xc9cc[_0x40baad];return _0x5244b7;};'use strict';var FaxAccountEvents=require(_0xcc9c('0x0'));var events=[_0xcc9c('0x1'),_0xcc9c('0x2'),'update'];function createListener(_0x3ab47d,_0x1bbce4){return function(_0x37f42a){_0x1bbce4[_0xcc9c('0x3')](_0x3ab47d,_0x37f42a);};}function removeListener(_0x316770,_0x23a4a8){return function(){FaxAccountEvents['removeListener'](_0x316770,_0x23a4a8);};}exports[_0xcc9c('0x4')]=function(_0x1f211d){for(var _0x570ed5=0x0,_0xbf1007=events['length'];_0x570ed5<_0xbf1007;_0x570ed5++){var _0x57e536=events[_0x570ed5];var _0x450127=createListener(_0xcc9c('0x5')+_0x57e536,_0x1f211d);FaxAccountEvents['on'](_0x57e536,_0x450127);}};
\ No newline at end of file
+var _0xb8d5=['length','faxAccount:','./faxAccount.events','remove','update','removeListener','register'];(function(_0x513978,_0x49dbf1){var _0x1ab35d=function(_0x44d8f8){while(--_0x44d8f8){_0x513978['push'](_0x513978['shift']());}};_0x1ab35d(++_0x49dbf1);}(_0xb8d5,0x1d7));var _0x5b8d=function(_0x1eb4ca,_0xe6035d){_0x1eb4ca=_0x1eb4ca-0x0;var _0x34309d=_0xb8d5[_0x1eb4ca];return _0x34309d;};'use strict';var FaxAccountEvents=require(_0x5b8d('0x0'));var events=['save',_0x5b8d('0x1'),_0x5b8d('0x2')];function createListener(_0x29dddb,_0x5371b6){return function(_0x45361c){_0x5371b6['emit'](_0x29dddb,_0x45361c);};}function removeListener(_0x3e6501,_0x327dbd){return function(){FaxAccountEvents[_0x5b8d('0x3')](_0x3e6501,_0x327dbd);};}exports[_0x5b8d('0x4')]=function(_0x29ef86){for(var _0x30ccda=0x0,_0x1c2c6=events[_0x5b8d('0x5')];_0x30ccda<_0x1c2c6;_0x30ccda++){var _0x54f369=events[_0x30ccda];var _0x1c50ce=createListener(_0x5b8d('0x6')+_0x54f369,_0x29ef86);FaxAccountEvents['on'](_0x54f369,_0x1c50ce);}};
\ No newline at end of file
index 5f5ecad..54f1467 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x6c0f5f,_0x1deead){var _0x23980f=function(_0x468967){while(--_0x468967){_0x6c0f5f['push'](_0x6c0f5f['shift']());}};_0x23980f(++_0x1deead);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x14edeb,_0x3f100c){var _0x57ec60=function(_0x4545b8){while(--_0x4545b8){_0x14edeb['push'](_0x14edeb['shift']());}};_0x57ec60(++_0x3f100c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
index 372d6a2..33261c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e8c=['sequelize','STRING','noop'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x7e8c,0x138));var _0xc7e8=function(_0x3c52e3,_0x432f56){_0x3c52e3=_0x3c52e3-0x0;var _0x2e88e5=_0x7e8c[_0x3c52e3];return _0x2e88e5;};'use strict';var Sequelize=require(_0xc7e8('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xc7e8('0x1')],'allowNull':![],'defaultValue':_0xc7e8('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc7e8('0x1')]},'interval':{'type':Sequelize[_0xc7e8('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xe287=['INTEGER','STRING','TEXT','*,*,*,*','sequelize','exports'];(function(_0xda21e8,_0x19d184){var _0x28904b=function(_0x10c833){while(--_0x10c833){_0xda21e8['push'](_0xda21e8['shift']());}};_0x28904b(++_0x19d184);}(_0xe287,0x82));var _0x7e28=function(_0x25ca4d,_0x188c79){_0x25ca4d=_0x25ca4d-0x0;var _0x227edf=_0xe287[_0x25ca4d];return _0x227edf;};'use strict';var Sequelize=require(_0x7e28('0x0'));module[_0x7e28('0x1')]={'priority':{'type':Sequelize[_0x7e28('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x7e28('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7e28('0x4')]()},'description':{'type':Sequelize[_0x7e28('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7e28('0x5')}};
\ No newline at end of file
index a810fb5..f1ffe9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4443=['query','keys','intersection','fields','attributes','length','nolimit','order','pick','filters','where','merge','VIRTUAL','filter','FaxApplication','include','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x18d1ed,_0x55655d){var _0x1a7ad8=function(_0x2d1f1d){while(--_0x2d1f1d){_0x18d1ed['push'](_0x18d1ed['shift']());}};_0x1a7ad8(++_0x55655d);}(_0x4443,0xb7));var _0x3444=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4443[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3444('0x0'));var zipdir=require(_0x3444('0x1'));var jsonpatch=require(_0x3444('0x2'));var rp=require(_0x3444('0x3'));var moment=require(_0x3444('0x4'));var BPromise=require(_0x3444('0x5'));var Mustache=require(_0x3444('0x6'));var util=require(_0x3444('0x7'));var path=require(_0x3444('0x8'));var sox=require(_0x3444('0x9'));var csv=require(_0x3444('0xa'));var ejs=require(_0x3444('0xb'));var fs=require('fs');var fs_extra=require(_0x3444('0xc'));var _=require(_0x3444('0xd'));var squel=require(_0x3444('0xe'));var crypto=require(_0x3444('0xf'));var jsforce=require(_0x3444('0x10'));var deskjs=require(_0x3444('0x11'));var toCsv=require(_0x3444('0xa'));var querystring=require('querystring');var Papa=require(_0x3444('0x12'));var Redis=require(_0x3444('0x13'));var authService=require(_0x3444('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3444('0x15'));var logger=require(_0x3444('0x16'))('api');var utils=require(_0x3444('0x17'));var config=require(_0x3444('0x18'));var licenseUtil=require(_0x3444('0x19'));var db=require(_0x3444('0x1a'))['db'];function respondWithStatusCode(_0x34642b,_0x2b1d7a){_0x2b1d7a=_0x2b1d7a||0xcc;return function(_0x54c6c9){if(_0x54c6c9){return _0x34642b[_0x3444('0x1b')](_0x2b1d7a);}return _0x34642b[_0x3444('0x1c')](_0x2b1d7a)[_0x3444('0x1d')]();};}function respondWithResult(_0x50940b,_0x5adc3f){_0x5adc3f=_0x5adc3f||0xc8;return function(_0x569b44){if(_0x569b44){return _0x50940b[_0x3444('0x1c')](_0x5adc3f)[_0x3444('0x1e')](_0x569b44);}};}function respondWithFilteredResult(_0x33b589,_0xfa1652){return function(_0x21bc21){if(_0x21bc21){var _0xd0d7d9=typeof _0xfa1652[_0x3444('0x1f')]===_0x3444('0x20')&&typeof _0xfa1652[_0x3444('0x21')]===_0x3444('0x20');var _0x5d97b6=_0x21bc21[_0x3444('0x22')];var _0x32500e=_0xd0d7d9?0x0:_0xfa1652[_0x3444('0x1f')];var _0x2b7547=_0xd0d7d9?_0x21bc21[_0x3444('0x22')]:_0xfa1652['offset']+_0xfa1652[_0x3444('0x21')];var _0x5d18ca;if(_0x2b7547>=_0x5d97b6){_0x2b7547=_0x5d97b6;_0x5d18ca=0xc8;}else{_0x5d18ca=0xce;}_0x33b589[_0x3444('0x1c')](_0x5d18ca);return _0x33b589['set'](_0x3444('0x23'),_0x32500e+'-'+_0x2b7547+'/'+_0x5d97b6)['json'](_0x21bc21);}return null;};}function patchUpdates(_0x5beddd){return function(_0x431fa3){try{jsonpatch[_0x3444('0x24')](_0x431fa3,_0x5beddd,!![]);}catch(_0x769146){return BPromise['reject'](_0x769146);}return _0x431fa3[_0x3444('0x25')]();};}function saveUpdates(_0x23d8c6,_0x40acd5){return function(_0x2c6e2f){if(_0x2c6e2f){return _0x2c6e2f['update'](_0x23d8c6)[_0x3444('0x26')](function(_0x561785){return _0x561785;});}return null;};}function removeEntity(_0x592297,_0x5079d0){return function(_0x5cc72b){if(_0x5cc72b){return _0x5cc72b[_0x3444('0x27')]()[_0x3444('0x26')](function(){_0x592297[_0x3444('0x1c')](0xcc)[_0x3444('0x1d')]();});}};}function handleEntityNotFound(_0x484b26,_0x386dff){return function(_0x4a4a98){if(!_0x4a4a98){_0x484b26[_0x3444('0x1b')](0x194);}return _0x4a4a98;};}function handleError(_0xe0a787,_0x2c4bbc){_0x2c4bbc=_0x2c4bbc||0x1f4;return function(_0x74508e){logger[_0x3444('0x28')](_0x74508e[_0x3444('0x29')]);if(_0x74508e[_0x3444('0x2a')]){delete _0x74508e['name'];}_0xe0a787[_0x3444('0x1c')](_0x2c4bbc)[_0x3444('0x2b')](_0x74508e);};}exports[_0x3444('0x2c')]=function(_0x34bb8b,_0x27e485){var _0x330bfb={},_0x3a02c8={},_0x269367={'count':0x0,'rows':[]};var _0x2abd0c=_[_0x3444('0x2d')](db['FaxApplication'][_0x3444('0x2e')],function(_0x5bf703){return{'name':_0x5bf703[_0x3444('0x2f')],'type':_0x5bf703[_0x3444('0x30')][_0x3444('0x31')]};});_0x3a02c8[_0x3444('0x32')]=_[_0x3444('0x2d')](_0x2abd0c,'name');_0x3a02c8[_0x3444('0x33')]=_[_0x3444('0x34')](_0x34bb8b['query']);_0x3a02c8['filters']=_['intersection'](_0x3a02c8['model'],_0x3a02c8[_0x3444('0x33')]);_0x330bfb['attributes']=_[_0x3444('0x35')](_0x3a02c8[_0x3444('0x32')],qs['fields'](_0x34bb8b[_0x3444('0x33')][_0x3444('0x36')]));_0x330bfb['attributes']=_0x330bfb[_0x3444('0x37')][_0x3444('0x38')]?_0x330bfb[_0x3444('0x37')]:_0x3a02c8['model'];if(!_0x34bb8b[_0x3444('0x33')]['hasOwnProperty'](_0x3444('0x39'))){_0x330bfb[_0x3444('0x21')]=qs[_0x3444('0x21')](_0x34bb8b[_0x3444('0x33')][_0x3444('0x21')]);_0x330bfb[_0x3444('0x1f')]=qs['offset'](_0x34bb8b[_0x3444('0x33')][_0x3444('0x1f')]);}_0x330bfb[_0x3444('0x3a')]=qs['sort'](_0x34bb8b['query']['sort']);_0x330bfb['where']=qs['filters'](_[_0x3444('0x3b')](_0x34bb8b['query'],_0x3a02c8[_0x3444('0x3c')]),_0x2abd0c);if(_0x34bb8b['query']['filter']){_0x330bfb[_0x3444('0x3d')]=_[_0x3444('0x3e')](_0x330bfb[_0x3444('0x3d')],{'$or':_[_0x3444('0x2d')](_0x2abd0c,function(_0x2eb2d3){if(_0x2eb2d3[_0x3444('0x30')]!==_0x3444('0x3f')){var _0x51074b={};_0x51074b[_0x2eb2d3[_0x3444('0x2a')]]={'$like':'%'+_0x34bb8b['query'][_0x3444('0x40')]+'%'};return _0x51074b;}})});}_0x330bfb=_[_0x3444('0x3e')]({},_0x330bfb,_0x34bb8b['options']);var _0x1c550e={'where':_0x330bfb[_0x3444('0x3d')]};return db[_0x3444('0x41')][_0x3444('0x22')](_0x1c550e)[_0x3444('0x26')](function(_0x181258){_0x269367[_0x3444('0x22')]=_0x181258;if(_0x34bb8b[_0x3444('0x33')]['includeAll']){_0x330bfb[_0x3444('0x42')]=[{'all':!![]}];}return db['FaxApplication'][_0x3444('0x43')](_0x330bfb);})[_0x3444('0x26')](function(_0x492130){_0x269367[_0x3444('0x44')]=_0x492130;return _0x269367;})[_0x3444('0x26')](respondWithFilteredResult(_0x27e485,_0x330bfb))[_0x3444('0x45')](handleError(_0x27e485,null));};exports[_0x3444('0x46')]=function(_0x49f99c,_0x121f8d){var _0x1a0ec5={'raw':!![],'where':{'id':_0x49f99c['params']['id']}},_0x52ecc7={};_0x52ecc7[_0x3444('0x32')]=_[_0x3444('0x34')](db[_0x3444('0x41')][_0x3444('0x2e')]);_0x52ecc7[_0x3444('0x33')]=_[_0x3444('0x34')](_0x49f99c[_0x3444('0x33')]);_0x52ecc7['filters']=_['intersection'](_0x52ecc7[_0x3444('0x32')],_0x52ecc7[_0x3444('0x33')]);_0x1a0ec5['attributes']=_[_0x3444('0x35')](_0x52ecc7['model'],qs[_0x3444('0x36')](_0x49f99c[_0x3444('0x33')][_0x3444('0x36')]));_0x1a0ec5['attributes']=_0x1a0ec5[_0x3444('0x37')][_0x3444('0x38')]?_0x1a0ec5['attributes']:_0x52ecc7[_0x3444('0x32')];if(_0x49f99c[_0x3444('0x33')][_0x3444('0x47')]){_0x1a0ec5['include']=[{'all':!![]}];}_0x1a0ec5=_[_0x3444('0x3e')]({},_0x1a0ec5,_0x49f99c[_0x3444('0x48')]);return db['FaxApplication'][_0x3444('0x49')](_0x1a0ec5)['then'](handleEntityNotFound(_0x121f8d,null))['then'](respondWithResult(_0x121f8d,null))[_0x3444('0x45')](handleError(_0x121f8d,null));};exports['create']=function(_0x376d24,_0x4824d5){return db[_0x3444('0x41')][_0x3444('0x4a')](_0x376d24[_0x3444('0x4b')],{})[_0x3444('0x26')](respondWithResult(_0x4824d5,0xc9))['catch'](handleError(_0x4824d5,null));};exports[_0x3444('0x4c')]=function(_0x2e3471,_0x4fb208){if(_0x2e3471[_0x3444('0x4b')]['id']){delete _0x2e3471[_0x3444('0x4b')]['id'];}return db[_0x3444('0x41')]['find']({'where':{'id':_0x2e3471[_0x3444('0x4d')]['id']}})[_0x3444('0x26')](handleEntityNotFound(_0x4fb208,null))[_0x3444('0x26')](saveUpdates(_0x2e3471['body'],null))[_0x3444('0x26')](respondWithResult(_0x4fb208,null))['catch'](handleError(_0x4fb208,null));};exports['destroy']=function(_0x38c946,_0x248d22){return db[_0x3444('0x41')][_0x3444('0x49')]({'where':{'id':_0x38c946['params']['id']}})[_0x3444('0x26')](handleEntityNotFound(_0x248d22,null))['then'](removeEntity(_0x248d22,null))['catch'](handleError(_0x248d22,null));};
\ No newline at end of file
+var _0xb28d=['sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','type','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','params','intersection','includeAll','find','create','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0xb28d,0x109));var _0xdb28=function(_0x1a2877,_0x4b2963){_0x1a2877=_0x1a2877-0x0;var _0xe5dbce=_0xb28d[_0x1a2877];return _0xe5dbce;};'use strict';var emlformat=require(_0xdb28('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb28('0x1'));var jsonpatch=require(_0xdb28('0x2'));var rp=require(_0xdb28('0x3'));var moment=require(_0xdb28('0x4'));var BPromise=require(_0xdb28('0x5'));var Mustache=require('mustache');var util=require(_0xdb28('0x6'));var path=require(_0xdb28('0x7'));var sox=require('sox');var csv=require(_0xdb28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb28('0x9'));var squel=require(_0xdb28('0xa'));var crypto=require('crypto');var jsforce=require(_0xdb28('0xb'));var deskjs=require(_0xdb28('0xc'));var toCsv=require(_0xdb28('0x8'));var querystring=require('querystring');var Papa=require(_0xdb28('0xd'));var Redis=require(_0xdb28('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdb28('0xf'));var as=require(_0xdb28('0x10'));var hardwareService=require(_0xdb28('0x11'));var logger=require(_0xdb28('0x12'))(_0xdb28('0x13'));var utils=require(_0xdb28('0x14'));var config=require(_0xdb28('0x15'));var licenseUtil=require(_0xdb28('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x119bec,_0x47db21){_0x47db21=_0x47db21||0xcc;return function(_0x100c18){if(_0x100c18){return _0x119bec[_0xdb28('0x17')](_0x47db21);}return _0x119bec[_0xdb28('0x18')](_0x47db21)[_0xdb28('0x19')]();};}function respondWithResult(_0x347359,_0xca5344){_0xca5344=_0xca5344||0xc8;return function(_0x398f8f){if(_0x398f8f){return _0x347359[_0xdb28('0x18')](_0xca5344)['json'](_0x398f8f);}};}function respondWithFilteredResult(_0x1417bf,_0x47f664){return function(_0x1e9aff){if(_0x1e9aff){var _0x19216c=typeof _0x47f664[_0xdb28('0x1a')]==='undefined'&&typeof _0x47f664[_0xdb28('0x1b')]==='undefined';var _0x4d048e=_0x1e9aff[_0xdb28('0x1c')];var _0x34e485=_0x19216c?0x0:_0x47f664[_0xdb28('0x1a')];var _0x386534=_0x19216c?_0x1e9aff[_0xdb28('0x1c')]:_0x47f664[_0xdb28('0x1a')]+_0x47f664[_0xdb28('0x1b')];var _0x5ce25d;if(_0x386534>=_0x4d048e){_0x386534=_0x4d048e;_0x5ce25d=0xc8;}else{_0x5ce25d=0xce;}_0x1417bf[_0xdb28('0x18')](_0x5ce25d);return _0x1417bf[_0xdb28('0x1d')](_0xdb28('0x1e'),_0x34e485+'-'+_0x386534+'/'+_0x4d048e)[_0xdb28('0x1f')](_0x1e9aff);}return null;};}function patchUpdates(_0x1d4507){return function(_0x1121f4){try{jsonpatch[_0xdb28('0x20')](_0x1121f4,_0x1d4507,!![]);}catch(_0x3a40de){return BPromise[_0xdb28('0x21')](_0x3a40de);}return _0x1121f4[_0xdb28('0x22')]();};}function saveUpdates(_0x5d804d,_0x8d8ccd){return function(_0x5aaaaf){if(_0x5aaaaf){return _0x5aaaaf['update'](_0x5d804d)[_0xdb28('0x23')](function(_0x4cb50b){return _0x4cb50b;});}return null;};}function removeEntity(_0x56bd69,_0x197b54){return function(_0x1f44dc){if(_0x1f44dc){return _0x1f44dc[_0xdb28('0x24')]()[_0xdb28('0x23')](function(){_0x56bd69[_0xdb28('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x295f15,_0x4a8e79){return function(_0x374621){if(!_0x374621){_0x295f15['sendStatus'](0x194);}return _0x374621;};}function handleError(_0x7c1f2a,_0x521321){_0x521321=_0x521321||0x1f4;return function(_0x4455b9){logger[_0xdb28('0x25')](_0x4455b9[_0xdb28('0x26')]);if(_0x4455b9[_0xdb28('0x27')]){delete _0x4455b9['name'];}_0x7c1f2a[_0xdb28('0x18')](_0x521321)[_0xdb28('0x28')](_0x4455b9);};}exports[_0xdb28('0x29')]=function(_0x3a6969,_0x584a71){var _0x39949f={},_0x48bc8d={},_0x180521={'count':0x0,'rows':[]};var _0x2d9696=_[_0xdb28('0x2a')](db[_0xdb28('0x2b')][_0xdb28('0x2c')],function(_0xaa7092){return{'name':_0xaa7092['fieldName'],'type':_0xaa7092[_0xdb28('0x2d')]['key']};});_0x48bc8d['model']=_['map'](_0x2d9696,'name');_0x48bc8d['query']=_[_0xdb28('0x2e')](_0x3a6969[_0xdb28('0x2f')]);_0x48bc8d[_0xdb28('0x30')]=_['intersection'](_0x48bc8d[_0xdb28('0x31')],_0x48bc8d[_0xdb28('0x2f')]);_0x39949f[_0xdb28('0x32')]=_['intersection'](_0x48bc8d[_0xdb28('0x31')],qs[_0xdb28('0x33')](_0x3a6969[_0xdb28('0x2f')]['fields']));_0x39949f[_0xdb28('0x32')]=_0x39949f[_0xdb28('0x32')][_0xdb28('0x34')]?_0x39949f[_0xdb28('0x32')]:_0x48bc8d[_0xdb28('0x31')];if(!_0x3a6969['query'][_0xdb28('0x35')](_0xdb28('0x36'))){_0x39949f['limit']=qs[_0xdb28('0x1b')](_0x3a6969['query']['limit']);_0x39949f[_0xdb28('0x1a')]=qs[_0xdb28('0x1a')](_0x3a6969['query'][_0xdb28('0x1a')]);}_0x39949f[_0xdb28('0x37')]=qs[_0xdb28('0x38')](_0x3a6969[_0xdb28('0x2f')][_0xdb28('0x38')]);_0x39949f[_0xdb28('0x39')]=qs[_0xdb28('0x30')](_[_0xdb28('0x3a')](_0x3a6969[_0xdb28('0x2f')],_0x48bc8d[_0xdb28('0x30')]),_0x2d9696);if(_0x3a6969[_0xdb28('0x2f')][_0xdb28('0x3b')]){_0x39949f[_0xdb28('0x39')]=_[_0xdb28('0x3c')](_0x39949f[_0xdb28('0x39')],{'$or':_[_0xdb28('0x2a')](_0x2d9696,function(_0xde9af1){if(_0xde9af1[_0xdb28('0x2d')]!=='VIRTUAL'){var _0x248795={};_0x248795[_0xde9af1['name']]={'$like':'%'+_0x3a6969['query'][_0xdb28('0x3b')]+'%'};return _0x248795;}})});}_0x39949f=_[_0xdb28('0x3c')]({},_0x39949f,_0x3a6969[_0xdb28('0x3d')]);var _0x4141b3={'where':_0x39949f['where']};return db[_0xdb28('0x2b')][_0xdb28('0x1c')](_0x4141b3)[_0xdb28('0x23')](function(_0xa32b59){_0x180521[_0xdb28('0x1c')]=_0xa32b59;if(_0x3a6969[_0xdb28('0x2f')]['includeAll']){_0x39949f[_0xdb28('0x3e')]=[{'all':!![]}];}return db['FaxApplication'][_0xdb28('0x3f')](_0x39949f);})[_0xdb28('0x23')](function(_0x3cc1c4){_0x180521['rows']=_0x3cc1c4;return _0x180521;})['then'](respondWithFilteredResult(_0x584a71,_0x39949f))[_0xdb28('0x40')](handleError(_0x584a71,null));};exports['show']=function(_0x98b4a2,_0x3c9eb2){var _0x3c438={'raw':!![],'where':{'id':_0x98b4a2[_0xdb28('0x41')]['id']}},_0x5412f3={};_0x5412f3[_0xdb28('0x31')]=_[_0xdb28('0x2e')](db[_0xdb28('0x2b')][_0xdb28('0x2c')]);_0x5412f3[_0xdb28('0x2f')]=_['keys'](_0x98b4a2[_0xdb28('0x2f')]);_0x5412f3[_0xdb28('0x30')]=_[_0xdb28('0x42')](_0x5412f3['model'],_0x5412f3[_0xdb28('0x2f')]);_0x3c438[_0xdb28('0x32')]=_[_0xdb28('0x42')](_0x5412f3['model'],qs[_0xdb28('0x33')](_0x98b4a2[_0xdb28('0x2f')]['fields']));_0x3c438[_0xdb28('0x32')]=_0x3c438['attributes'][_0xdb28('0x34')]?_0x3c438[_0xdb28('0x32')]:_0x5412f3[_0xdb28('0x31')];if(_0x98b4a2['query'][_0xdb28('0x43')]){_0x3c438[_0xdb28('0x3e')]=[{'all':!![]}];}_0x3c438=_['merge']({},_0x3c438,_0x98b4a2['options']);return db[_0xdb28('0x2b')][_0xdb28('0x44')](_0x3c438)[_0xdb28('0x23')](handleEntityNotFound(_0x3c9eb2,null))['then'](respondWithResult(_0x3c9eb2,null))[_0xdb28('0x40')](handleError(_0x3c9eb2,null));};exports[_0xdb28('0x45')]=function(_0x2e5d51,_0x12ae8e){return db['FaxApplication'][_0xdb28('0x45')](_0x2e5d51['body'],{})[_0xdb28('0x23')](respondWithResult(_0x12ae8e,0xc9))[_0xdb28('0x40')](handleError(_0x12ae8e,null));};exports[_0xdb28('0x46')]=function(_0x5e5ccf,_0x53464d){if(_0x5e5ccf[_0xdb28('0x47')]['id']){delete _0x5e5ccf[_0xdb28('0x47')]['id'];}return db[_0xdb28('0x2b')]['find']({'where':{'id':_0x5e5ccf[_0xdb28('0x41')]['id']}})[_0xdb28('0x23')](handleEntityNotFound(_0x53464d,null))[_0xdb28('0x23')](saveUpdates(_0x5e5ccf['body'],null))['then'](respondWithResult(_0x53464d,null))['catch'](handleError(_0x53464d,null));};exports[_0xdb28('0x24')]=function(_0x187f79,_0xc2d8d7){return db[_0xdb28('0x2b')][_0xdb28('0x44')]({'where':{'id':_0x187f79[_0xdb28('0x41')]['id']}})[_0xdb28('0x23')](handleEntityNotFound(_0xc2d8d7,null))[_0xdb28('0x23')](removeEntity(_0xc2d8d7,null))[_0xdb28('0x40')](handleError(_0xc2d8d7,null));};
\ No newline at end of file
index 921685c..2123fe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45aa=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications'];(function(_0x36aad0,_0x3d2e17){var _0x31e987=function(_0x2d0fe4){while(--_0x2d0fe4){_0x36aad0['push'](_0x36aad0['shift']());}};_0x31e987(++_0x3d2e17);}(_0x45aa,0x192));var _0xa45a=function(_0x2305f6,_0x2ba699){_0x2305f6=_0x2305f6-0x0;var _0x1f6e3a=_0x45aa[_0x2305f6];return _0x1f6e3a;};'use strict';var _=require(_0xa45a('0x0'));var util=require(_0xa45a('0x1'));var logger=require(_0xa45a('0x2'))(_0xa45a('0x3'));var moment=require(_0xa45a('0x4'));var BPromise=require(_0xa45a('0x5'));var rp=require(_0xa45a('0x6'));var fs=require('fs');var path=require(_0xa45a('0x7'));var rimraf=require(_0xa45a('0x8'));var config=require(_0xa45a('0x9'));var attributes=require(_0xa45a('0xa'));module[_0xa45a('0xb')]=function(_0x5a8ce2,_0x25d4b2){return _0x5a8ce2[_0xa45a('0xc')]('FaxApplication',attributes,{'tableName':_0xa45a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa45a('0xe'),'collate':_0xa45a('0xf')});};
\ No newline at end of file
+var _0x6dfa=['fax_applications','utf8mb4','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x6dfa,0x7a));var _0xa6df=function(_0x22bf04,_0x119eea){_0x22bf04=_0x22bf04-0x0;var _0x1e9c8a=_0x6dfa[_0x22bf04];return _0x1e9c8a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6df('0x0'))(_0xa6df('0x1'));var moment=require(_0xa6df('0x2'));var BPromise=require('bluebird');var rp=require(_0xa6df('0x3'));var fs=require('fs');var path=require(_0xa6df('0x4'));var rimraf=require('rimraf');var config=require(_0xa6df('0x5'));var attributes=require(_0xa6df('0x6'));module[_0xa6df('0x7')]=function(_0x4bf7ed,_0x3abc11){return _0x4bf7ed[_0xa6df('0x8')](_0xa6df('0x9'),attributes,{'tableName':_0xa6df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa6df('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index c487fb2..e3a2c27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0bf=['result','catch','UpdateFaxApplication','update','body','options','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1f1cd6,_0x179fad){var _0x2e9418=function(_0x546a56){while(--_0x546a56){_0x1f1cd6['push'](_0x1f1cd6['shift']());}};_0x2e9418(++_0x179fad);}(_0xe0bf,0x1e9));var _0xfe0b=function(_0x493719,_0x47bd36){_0x493719=_0x493719-0x0;var _0x5db50e=_0xe0bf[_0x493719];return _0x5db50e;};'use strict';var _=require(_0xfe0b('0x0'));var util=require(_0xfe0b('0x1'));var moment=require(_0xfe0b('0x2'));var BPromise=require(_0xfe0b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe0b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe0b('0x5'));var logger=require(_0xfe0b('0x6'))('rpc');var config=require(_0xfe0b('0x7'));var jayson=require(_0xfe0b('0x8'));var client=jayson[_0xfe0b('0x9')][_0xfe0b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11756e,_0xf7a72b,_0x1e176e){return new BPromise(function(_0xcac106,_0x1536a2){return client[_0xfe0b('0xb')](_0x11756e,_0x1e176e)[_0xfe0b('0xc')](function(_0x1ae0f4){logger[_0xfe0b('0xd')](_0xfe0b('0xe'),_0xf7a72b,_0xfe0b('0xf'));logger[_0xfe0b('0x10')](_0xfe0b('0x11'),_0xf7a72b,_0xfe0b('0xf'),JSON['stringify'](_0x1ae0f4));if(_0x1ae0f4[_0xfe0b('0x12')]){if(_0x1ae0f4[_0xfe0b('0x12')][_0xfe0b('0x13')]===0x1f4){logger[_0xfe0b('0x12')](_0xfe0b('0xe'),_0xf7a72b,_0x1ae0f4[_0xfe0b('0x12')][_0xfe0b('0x14')]);return _0x1536a2(_0x1ae0f4[_0xfe0b('0x12')]['message']);}logger[_0xfe0b('0x12')](_0xfe0b('0xe'),_0xf7a72b,_0x1ae0f4[_0xfe0b('0x12')][_0xfe0b('0x14')]);return _0xcac106(_0x1ae0f4['error']['message']);}else{logger[_0xfe0b('0xd')]('FaxApplication,\x20%s,\x20%s',_0xf7a72b,_0xfe0b('0xf'));_0xcac106(_0x1ae0f4[_0xfe0b('0x15')]['message']);}})[_0xfe0b('0x16')](function(_0x3ca137){logger[_0xfe0b('0x12')](_0xfe0b('0xe'),_0xf7a72b,_0x3ca137);_0x1536a2(_0x3ca137);});});}exports[_0xfe0b('0x17')]=function(_0x230b11){var _0xa1fd46=this;return new Promise(function(_0x21edda,_0x4804ff){return db['FaxApplication'][_0xfe0b('0x18')](_0x230b11[_0xfe0b('0x19')],{'raw':_0x230b11['options']?_0x230b11[_0xfe0b('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x230b11[_0xfe0b('0x1a')]?_0x230b11['options']['where']||null:null,'attributes':_0x230b11[_0xfe0b('0x1a')]?_0x230b11[_0xfe0b('0x1a')][_0xfe0b('0x1b')]||null:null,'limit':_0x230b11[_0xfe0b('0x1a')]?_0x230b11[_0xfe0b('0x1a')][_0xfe0b('0x1c')]||null:null})[_0xfe0b('0xc')](function(_0x3642cb){logger[_0xfe0b('0xd')](_0xfe0b('0x17'),_0x230b11);logger[_0xfe0b('0x10')](_0xfe0b('0x17'),_0x230b11,JSON[_0xfe0b('0x1d')](_0x3642cb));_0x21edda(_0x3642cb);})[_0xfe0b('0x16')](function(_0x4a4304){logger[_0xfe0b('0x12')](_0xfe0b('0x17'),_0x4a4304['message'],_0x230b11);_0x4804ff(_0xa1fd46[_0xfe0b('0x12')](0x1f4,_0x4a4304[_0xfe0b('0x14')]));});});};
\ No newline at end of file
+var _0x6d6b=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','FaxApplication,\x20%s,\x20%s','message','catch','UpdateFaxApplication','FaxApplication','update','options','raw','where','attributes','limit','debug','lodash','util','bluebird'];(function(_0x264861,_0x3f9f6b){var _0x58b323=function(_0x4edf15){while(--_0x4edf15){_0x264861['push'](_0x264861['shift']());}};_0x58b323(++_0x3f9f6b);}(_0x6d6b,0x165));var _0xb6d6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6d6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb6d6('0x0'));var util=require(_0xb6d6('0x1'));var moment=require('moment');var BPromise=require(_0xb6d6('0x2'));var rs=require(_0xb6d6('0x3'));var fs=require('fs');var Redis=require(_0xb6d6('0x4'));var db=require(_0xb6d6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6d6('0x6'))(_0xb6d6('0x7'));var config=require(_0xb6d6('0x8'));var jayson=require(_0xb6d6('0x9'));var client=jayson['client'][_0xb6d6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e0114,_0x5da93e,_0x50934b){return new BPromise(function(_0x373cff,_0x5dc05b){return client[_0xb6d6('0xb')](_0x1e0114,_0x50934b)[_0xb6d6('0xc')](function(_0x4f4d65){logger[_0xb6d6('0xd')]('FaxApplication,\x20%s,\x20%s',_0x5da93e,_0xb6d6('0xe'));logger['debug'](_0xb6d6('0xf'),_0x5da93e,_0xb6d6('0xe'),JSON[_0xb6d6('0x10')](_0x4f4d65));if(_0x4f4d65[_0xb6d6('0x11')]){if(_0x4f4d65[_0xb6d6('0x11')]['code']===0x1f4){logger['error'](_0xb6d6('0x12'),_0x5da93e,_0x4f4d65[_0xb6d6('0x11')][_0xb6d6('0x13')]);return _0x5dc05b(_0x4f4d65[_0xb6d6('0x11')]['message']);}logger['error'](_0xb6d6('0x12'),_0x5da93e,_0x4f4d65[_0xb6d6('0x11')][_0xb6d6('0x13')]);return _0x373cff(_0x4f4d65[_0xb6d6('0x11')][_0xb6d6('0x13')]);}else{logger[_0xb6d6('0xd')](_0xb6d6('0x12'),_0x5da93e,_0xb6d6('0xe'));_0x373cff(_0x4f4d65['result']['message']);}})[_0xb6d6('0x14')](function(_0x15f005){logger[_0xb6d6('0x11')](_0xb6d6('0x12'),_0x5da93e,_0x15f005);_0x5dc05b(_0x15f005);});});}exports[_0xb6d6('0x15')]=function(_0x48265e){var _0x45c18a=this;return new Promise(function(_0x11d6bb,_0x3c95b8){return db[_0xb6d6('0x16')][_0xb6d6('0x17')](_0x48265e['body'],{'raw':_0x48265e[_0xb6d6('0x18')]?_0x48265e[_0xb6d6('0x18')][_0xb6d6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48265e[_0xb6d6('0x18')]?_0x48265e['options'][_0xb6d6('0x1a')]||null:null,'attributes':_0x48265e[_0xb6d6('0x18')]?_0x48265e['options'][_0xb6d6('0x1b')]||null:null,'limit':_0x48265e['options']?_0x48265e[_0xb6d6('0x18')][_0xb6d6('0x1c')]||null:null})[_0xb6d6('0xc')](function(_0x2694b9){logger[_0xb6d6('0xd')]('UpdateFaxApplication',_0x48265e);logger[_0xb6d6('0x1d')](_0xb6d6('0x15'),_0x48265e,JSON['stringify'](_0x2694b9));_0x11d6bb(_0x2694b9);})[_0xb6d6('0x14')](function(_0x1761a6){logger['error'](_0xb6d6('0x15'),_0x1761a6[_0xb6d6('0x13')],_0x48265e);_0x3c95b8(_0x45c18a['error'](0x1f4,_0x1761a6[_0xb6d6('0x13')]));});});};
\ No newline at end of file
index c10d70e..41b5520 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6e6c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var path=require('path');var timeout=require(_0xc6e6('0x2'));var express=require(_0xc6e6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc6e6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6e6('0x5'));var controller=require('./faxApplication.controller');router[_0xc6e6('0x6')]('/',auth[_0xc6e6('0x7')](),controller['index']);router[_0xc6e6('0x6')](_0xc6e6('0x8'),auth['isAuthenticated'](),controller[_0xc6e6('0x9')]);router[_0xc6e6('0xa')]('/',auth['isAuthenticated'](),controller[_0xc6e6('0xb')]);router['put'](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xc')]);router[_0xc6e6('0xd')](_0xc6e6('0x8'),auth[_0xc6e6('0x7')](),controller[_0xc6e6('0xe')]);module[_0xc6e6('0xf')]=router;
\ No newline at end of file
+var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x24709b,_0x2e9d6d){_0x24709b=_0x24709b-0x0;var _0xb51589=_0x9ffd[_0x24709b];return _0xb51589;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router;
\ No newline at end of file
index 6882d2d..52140de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eb1=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x7eb1,0x84));var _0x17eb=function(_0x3c8c38,_0x277bc6){_0x3c8c38=_0x3c8c38-0x0;var _0x1edcab=_0x7eb1[_0x3c8c38];return _0x1edcab;};'use strict';var Sequelize=require(_0x17eb('0x0'));module[_0x17eb('0x1')]={'closed':{'type':Sequelize[_0x17eb('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x17eb('0x3')]},'disposition':{'type':Sequelize[_0x17eb('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x17eb('0x4')]},'note':{'type':Sequelize[_0x17eb('0x4')]},'read1stAt':{'type':Sequelize[_0x17eb('0x3')]},'fax':{'type':Sequelize[_0x17eb('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x17eb('0x5')]('in',_0x17eb('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x17eb('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x40d3=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x40d3,0x14f));var _0x340d=function(_0x3deaa8,_0x451abe){_0x3deaa8=_0x3deaa8-0x0;var _0x5227c2=_0x40d3[_0x3deaa8];return _0x5227c2;};'use strict';var Sequelize=require(_0x340d('0x0'));module[_0x340d('0x1')]={'closed':{'type':Sequelize[_0x340d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x340d('0x3')]},'disposition':{'type':Sequelize[_0x340d('0x4')]},'secondDisposition':{'type':Sequelize[_0x340d('0x4')]},'thirdDisposition':{'type':Sequelize[_0x340d('0x4')]},'note':{'type':Sequelize[_0x340d('0x4')]},'read1stAt':{'type':Sequelize[_0x340d('0x3')]},'fax':{'type':Sequelize[_0x340d('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x340d('0x5')]('in',_0x340d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x340d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x340d('0x5')]('in',_0x340d('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 117d7a0..1d62d81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb16f=['key','getOptions','query','user','catch','show','params','model','keys','FaxInteraction','filters','attributes','fields','length','includeAll','include','merge','find','create','body','describe','FaxMessage','addMessage','ids','omit','getMessages','findOne','intersection','hasOwnProperty','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','update','then','error','stack','name','send','map','rawAttributes','fieldName','type'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xb16f,0x118));var _0xfb16=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb16f[_0x278e3c];return _0x3e2d9b;};'use strict';var rimraf=require(_0xfb16('0x0'));var zipdir=require(_0xfb16('0x1'));var moment=require(_0xfb16('0x2'));var BPromise=require('bluebird');var util=require(_0xfb16('0x3'));var path=require(_0xfb16('0x4'));var fs=require('fs');var _=require(_0xfb16('0x5'));var Redis=require('ioredis');var interaction=require(_0xfb16('0x6'));var qs=require(_0xfb16('0x7'));var logger=require('../../config/logger')(_0xfb16('0x8'));var config=require(_0xfb16('0x9'));var db=require(_0xfb16('0xa'))['db'];config[_0xfb16('0xb')]=_['defaults'](config[_0xfb16('0xb')],{'host':_0xfb16('0xc'),'port':0x18eb});var socket=require(_0xfb16('0xd'))(new Redis(config[_0xfb16('0xb')]));require('./faxInteraction.socket')[_0xfb16('0xe')](socket);function respondWithStatusCode(_0x1a46e4,_0x318cb4){_0x318cb4=_0x318cb4||0xcc;return function(_0x1ed111){if(_0x1ed111){return _0x1a46e4[_0xfb16('0xf')](_0x318cb4);}return _0x1a46e4[_0xfb16('0x10')](_0x318cb4)[_0xfb16('0x11')]();};}function respondWithResult(_0x43213f,_0x43410e){_0x43410e=_0x43410e||0xc8;return function(_0x2594a4){if(_0x2594a4){return _0x43213f[_0xfb16('0x10')](_0x43410e)['json'](_0x2594a4);}};}function respondWithFilteredResult(_0x244481,_0x6c42aa){return function(_0x1645ca){if(_0x1645ca){var _0x2f44db=typeof _0x6c42aa['offset']===_0xfb16('0x12')&&typeof _0x6c42aa[_0xfb16('0x13')]==='undefined';var _0x4378e3=_0x1645ca['count'];var _0x17be64=_0x2f44db?0x0:_0x6c42aa[_0xfb16('0x14')];var _0x3c8ef0=_0x2f44db?_0x1645ca[_0xfb16('0x15')]:_0x6c42aa[_0xfb16('0x14')]+_0x6c42aa[_0xfb16('0x13')];var _0x1f2184;if(_0x3c8ef0>=_0x4378e3){_0x3c8ef0=_0x4378e3;_0x1f2184=0xc8;}else{_0x1f2184=0xce;}_0x244481[_0xfb16('0x10')](_0x1f2184);return _0x244481[_0xfb16('0x16')](_0xfb16('0x17'),_0x17be64+'-'+_0x3c8ef0+'/'+_0x4378e3)[_0xfb16('0x18')](_0x1645ca);}return null;};}function saveUpdates(_0x4a78f7){return function(_0x22b43c){if(_0x22b43c){return _0x22b43c[_0xfb16('0x19')](_0x4a78f7)[_0xfb16('0x1a')](function(_0x554ccc){return _0x554ccc;});}return null;};}function removeEntity(_0xa228a3){return function(_0x123e35){if(_0x123e35){return _0x123e35['destroy']()[_0xfb16('0x1a')](function(){_0xa228a3[_0xfb16('0x10')](0xcc)[_0xfb16('0x11')]();});}};}function handleEntityNotFound(_0x44957f){return function(_0x292f56){if(!_0x292f56){_0x44957f['sendStatus'](0x194);}return _0x292f56;};}function handleError(_0x25de08,_0xef2b0b){_0xef2b0b=_0xef2b0b||0x1f4;return function(_0x390b50){logger[_0xfb16('0x1b')](_0x390b50[_0xfb16('0x1c')]);if(_0x390b50[_0xfb16('0x1d')]){delete _0x390b50[_0xfb16('0x1d')];}_0x25de08[_0xfb16('0x10')](_0xef2b0b)[_0xfb16('0x1e')](_0x390b50);};}exports['index']=function(_0x2e9667,_0x45dd55){var _0x5709bd={};var _0x4a96b1=_[_0xfb16('0x1f')](db['FaxInteraction'][_0xfb16('0x20')],function(_0x254a43){return{'name':_0x254a43[_0xfb16('0x21')],'type':_0x254a43[_0xfb16('0x22')][_0xfb16('0x23')]};});_0x5709bd=qs[_0xfb16('0x24')](_0x4a96b1,_0x2e9667);return interaction['findAll']('fax',_0x2e9667[_0xfb16('0x25')],_0x2e9667[_0xfb16('0x26')],_0x5709bd,_0x4a96b1)['then'](respondWithFilteredResult(_0x45dd55,_0x5709bd))[_0xfb16('0x27')](handleError(_0x45dd55,null));};exports[_0xfb16('0x28')]=function(_0x2a3cc0,_0x17ec6b){var _0x137aab={'raw':![],'where':{'id':_0x2a3cc0[_0xfb16('0x29')]['id']}},_0x595851={};_0x595851[_0xfb16('0x2a')]=_[_0xfb16('0x2b')](db[_0xfb16('0x2c')][_0xfb16('0x20')]);_0x595851[_0xfb16('0x25')]=_[_0xfb16('0x2b')](_0x2a3cc0[_0xfb16('0x25')]);_0x595851[_0xfb16('0x2d')]=_['intersection'](_0x595851['model'],_0x595851[_0xfb16('0x25')]);_0x137aab[_0xfb16('0x2e')]=_['intersection'](_0x595851['model'],qs[_0xfb16('0x2f')](_0x2a3cc0[_0xfb16('0x25')][_0xfb16('0x2f')]));_0x137aab['attributes']=_0x137aab[_0xfb16('0x2e')][_0xfb16('0x30')]?_0x137aab[_0xfb16('0x2e')]:_0x595851[_0xfb16('0x2a')];if(_0x2a3cc0['query'][_0xfb16('0x31')]){_0x137aab[_0xfb16('0x32')]=[{'all':!![]}];}_0x137aab=_[_0xfb16('0x33')]({},_0x137aab,_0x2a3cc0['options']);return db['FaxInteraction'][_0xfb16('0x34')](_0x137aab)[_0xfb16('0x1a')](handleEntityNotFound(_0x17ec6b,null))[_0xfb16('0x1a')](respondWithResult(_0x17ec6b,null))[_0xfb16('0x27')](handleError(_0x17ec6b,null));};exports[_0xfb16('0x35')]=function(_0x5f5a53,_0x3375b8){return db[_0xfb16('0x2c')]['create'](_0x5f5a53['body'],{})['then'](respondWithResult(_0x3375b8,0xc9))[_0xfb16('0x27')](handleError(_0x3375b8,null));};exports[_0xfb16('0x19')]=function(_0x490efc,_0x2456dc){if(_0x490efc['body']['id']){delete _0x490efc[_0xfb16('0x36')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x490efc['params']['id']}})['then'](handleEntityNotFound(_0x2456dc,null))[_0xfb16('0x1a')](saveUpdates(_0x490efc[_0xfb16('0x36')],null))[_0xfb16('0x1a')](respondWithResult(_0x2456dc,null))[_0xfb16('0x27')](handleError(_0x2456dc,null));};exports['destroy']=function(_0x3164da,_0xe8cef){return db['FaxInteraction'][_0xfb16('0x34')]({'where':{'id':_0x3164da[_0xfb16('0x29')]['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0xe8cef,null))['then'](removeEntity(_0xe8cef,null))[_0xfb16('0x27')](handleError(_0xe8cef,null));};exports[_0xfb16('0x37')]=function(_0x856a5,_0x1f8af2){return db[_0xfb16('0x2c')][_0xfb16('0x37')]()[_0xfb16('0x1a')](respondWithResult(_0x1f8af2,null))[_0xfb16('0x27')](handleError(_0x1f8af2,null));};exports['addMessage']=function(_0x560a18,_0x2d10b9){return db[_0xfb16('0x38')][_0xfb16('0x34')]({'where':{'id':_0x560a18[_0xfb16('0x29')]['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0x2d10b9,null))[_0xfb16('0x1a')](function(_0x45286e){if(_0x45286e){return _0x45286e[_0xfb16('0x39')](_0x560a18[_0xfb16('0x36')][_0xfb16('0x3a')],_[_0xfb16('0x3b')](_0x560a18['body'],[_0xfb16('0x3a'),'id'])||{});}})[_0xfb16('0x1a')](respondWithResult(_0x2d10b9,null))[_0xfb16('0x27')](handleError(_0x2d10b9,null));};exports[_0xfb16('0x3c')]=function(_0x1c3ce4,_0x2d454c){var _0x3fe100={'raw':![],'where':{}};var _0x15afb7={};var _0x528b0a={'count':0x0,'rows':[]};return db[_0xfb16('0x2c')][_0xfb16('0x3d')]({'where':{'id':_0x1c3ce4[_0xfb16('0x29')]['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0x2d454c,null))[_0xfb16('0x1a')](function(_0x215c33){if(_0x215c33){_0x15afb7[_0xfb16('0x2a')]=_[_0xfb16('0x2b')](db[_0xfb16('0x38')][_0xfb16('0x20')]);_0x15afb7['query']=_[_0xfb16('0x2b')](_0x1c3ce4['query']);_0x15afb7['filters']=_[_0xfb16('0x3e')](_0x15afb7[_0xfb16('0x2a')],_0x15afb7['query']);_0x3fe100[_0xfb16('0x2e')]=_[_0xfb16('0x3e')](_0x15afb7[_0xfb16('0x2a')],qs[_0xfb16('0x2f')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x2f')]));_0x3fe100[_0xfb16('0x2e')]=_0x3fe100[_0xfb16('0x2e')][_0xfb16('0x30')]?_0x3fe100['attributes']:_0x15afb7[_0xfb16('0x2a')];if(!_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x3f')](_0xfb16('0x40'))){_0x3fe100[_0xfb16('0x13')]=qs[_0xfb16('0x13')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x13')]);_0x3fe100[_0xfb16('0x14')]=qs[_0xfb16('0x14')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x14')]);}_0x3fe100[_0xfb16('0x41')]=qs[_0xfb16('0x42')](_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x42')]);_0x3fe100[_0xfb16('0x43')]=qs[_0xfb16('0x2d')](_[_0xfb16('0x44')](_0x1c3ce4[_0xfb16('0x25')],_0x15afb7['filters']));_0x3fe100[_0xfb16('0x43')][_0xfb16('0x45')]=_0x215c33['id'];if(_0x1c3ce4[_0xfb16('0x25')]['filter']){_0x3fe100[_0xfb16('0x43')]=_[_0xfb16('0x33')](_0x3fe100['where'],{'$or':_['map'](_0x3fe100['attributes'],function(_0x5e1d2a){var _0x45698a={};_0x45698a[_0x5e1d2a]={'$like':'%'+_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x46')]+'%'};return _0x45698a;})});}if(_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x47')]){var _0x4c54c4=_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x47')][_0xfb16('0x48')](',');var _0x38a327={};_0x38a327[_0x4c54c4[0x0]]={'$gte':moment(_0x4c54c4[0x1])[_0xfb16('0x49')](_0xfb16('0x4a'))};_0x3fe100[_0xfb16('0x43')]=_['merge'](_0x3fe100[_0xfb16('0x43')],_0x38a327);}_0x3fe100=_[_0xfb16('0x33')]({},_0x3fe100,_0x1c3ce4[_0xfb16('0x4b')]);return db['FaxMessage'][_0xfb16('0x15')]({'where':_0x3fe100[_0xfb16('0x43')]})[_0xfb16('0x1a')](function(_0x1948ab){_0x528b0a[_0xfb16('0x15')]=_0x1948ab;if(_0x1c3ce4[_0xfb16('0x25')][_0xfb16('0x31')]){_0x3fe100[_0xfb16('0x32')]=[{'all':!![]}];}return db[_0xfb16('0x38')][_0xfb16('0x4c')](_0x3fe100);})[_0xfb16('0x1a')](function(_0x106ed3){_0x528b0a['rows']=_0x106ed3;return _0x528b0a;});}})[_0xfb16('0x1a')](respondWithFilteredResult(_0x2d454c,_0x3fe100))['catch'](handleError(_0x2d454c,null));};exports[_0xfb16('0x4d')]=function(_0x459817,_0x27ab93){return db[_0xfb16('0x2c')][_0xfb16('0x34')]({'where':{'id':_0x459817['params']['id']}})[_0xfb16('0x1a')](handleEntityNotFound(_0x27ab93,null))[_0xfb16('0x1a')](function(_0x110a94){if(_0x110a94){return _0x110a94[_0xfb16('0x4e')](_0x459817['body'][_0xfb16('0x3a')],_[_0xfb16('0x3b')](_0x459817['body'],[_0xfb16('0x3a'),'id'])||{})[_0xfb16('0x4f')](function(){return db['Tag'][_0xfb16('0x4c')]({'attributes':['id',_0xfb16('0x1d'),_0xfb16('0x50')],'where':{'id':_0x459817[_0xfb16('0x36')]['ids']}});})[_0xfb16('0x1a')](function(_0x2434f1){socket[_0xfb16('0x51')](_0xfb16('0x52'),{'id':Number(_0x459817[_0xfb16('0x29')]['id']),'tags':_0x2434f1||[]});return{'id':Number(_0x459817[_0xfb16('0x29')]['id']),'tags':_0x2434f1||[]};});}})['then'](respondWithResult(_0x27ab93,null))[_0xfb16('0x27')](handleError(_0x27ab93,null));};exports[_0xfb16('0x53')]=function(_0x2eee89,_0x46023b){return db[_0xfb16('0x2c')][_0xfb16('0x34')]({'where':{'id':_0x2eee89['params']['id']}})['then'](handleEntityNotFound(_0x46023b,null))[_0xfb16('0x1a')](function(_0x55a6a9){if(_0x55a6a9){return _0x55a6a9[_0xfb16('0x53')](_0x2eee89['query'][_0xfb16('0x3a')]);}})[_0xfb16('0x1a')](respondWithStatusCode(_0x46023b,null))[_0xfb16('0x27')](handleError(_0x46023b,null));};exports[_0xfb16('0x54')]=function(_0x37e309,_0x4d8c4b){var _0x276f23=moment()[_0xfb16('0x55')]()['toString']();var _0x43594b=path[_0xfb16('0x56')](config[_0xfb16('0x57')],'server',_0xfb16('0x58'),_0xfb16('0x59'));var _0xbc4275=path[_0xfb16('0x56')](config[_0xfb16('0x57')],_0xfb16('0x5a'),_0xfb16('0x58'),_0xfb16('0x5b'));var _0x47d6b0=path[_0xfb16('0x56')](_0x43594b,_0x276f23);var _0x581dfd=util[_0xfb16('0x49')](_0xfb16('0x5c'),_0x37e309[_0xfb16('0x29')]['id'],_0x276f23);var _0x576f83=path[_0xfb16('0x56')](_0x43594b,_0x581dfd);var _0xa050cf=[];_0xa050cf[_0xfb16('0x5d')]({'model':db[_0xfb16('0x5e')],'as':_0xfb16('0x5e'),'raw':!![]});var _0x402168=[{'model':db[_0xfb16('0x38')],'as':_0xfb16('0x5f'),'attributes':['id',_0xfb16('0x36'),'createdAt'],'include':_0xa050cf}];return db[_0xfb16('0x2c')]['find']({'where':{'id':_0x37e309[_0xfb16('0x29')]['id']},'include':_0x402168})['then'](handleEntityNotFound(_0x4d8c4b,null))['then'](function(_0x59dc32){if(_0x59dc32&&_0x59dc32['Messages']){var _0xdcb9a6=_0x59dc32[_0xfb16('0x60')]({'plain':!![]});fs[_0xfb16('0x61')](_0x47d6b0);for(var _0x1e9d7d=0x0;_0x1e9d7d<_0xdcb9a6[_0xfb16('0x5f')][_0xfb16('0x30')];_0x1e9d7d++){var _0x1374b8=_0xdcb9a6[_0xfb16('0x5f')][_0x1e9d7d][_0xfb16('0x5e')];if(_0x1374b8){var _0x27f09b=path['join'](_0xbc4275,_0x1374b8[_0xfb16('0x62')]);if(fs['existsSync'](_0x27f09b)){fs[_0xfb16('0x63')](_0x27f09b)[_0xfb16('0x64')](fs[_0xfb16('0x65')](path[_0xfb16('0x56')](_0x47d6b0,_0x1374b8[_0xfb16('0x62')])));}}}return BPromise[_0xfb16('0x66')]()[_0xfb16('0x1a')](function(){return new BPromise(function(_0xb04b,_0x3717d1){zipdir(_0x47d6b0,{'saveTo':_0x576f83},function(_0x452dc2,_0x127406){if(_0x452dc2)return _0x3717d1(_0x452dc2);return _0xb04b(_0x127406);});})[_0xfb16('0x1a')](function(){return new BPromise(function(_0x4f8b03,_0x3eaa55){rimraf(_0x47d6b0,function(_0x7a42bd){if(_0x7a42bd)_0x3eaa55(_0x7a42bd);return _0x4f8b03();});});})['then'](function(){return _0x4d8c4b[_0xfb16('0x54')](_0x576f83,_0x581dfd,function(_0x5c95c3){if(_0x5c95c3){console[_0xfb16('0x67')]('err',_0x5c95c3);}else{fs[_0xfb16('0x68')](_0x576f83);}});});});}else{return _0x4d8c4b[_0xfb16('0xf')](0xc8);}})[_0xfb16('0x27')](handleError(_0x4d8c4b,null));};
\ No newline at end of file
+var _0x865b=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','index','fieldName','key','getOptions','findAll','fax','query','catch','show','params','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','FaxInteraction','create','body','find','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','FaxInteractionId','filter','map','$gte','split','format','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','join','files','tmp','root','server','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','existsSync','createReadStream','pipe','createWriteStream','basename','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x441e17,_0x340ea9){var _0x3c9eb4=function(_0x3b941f){while(--_0x3b941f){_0x441e17['push'](_0x441e17['shift']());}};_0x3c9eb4(++_0x340ea9);}(_0x865b,0x18c));var _0xb865=function(_0x4b245d,_0x4f2abd){_0x4b245d=_0x4b245d-0x0;var _0x2d3a29=_0x865b[_0x4b245d];return _0x2d3a29;};'use strict';var rimraf=require(_0xb865('0x0'));var zipdir=require(_0xb865('0x1'));var moment=require(_0xb865('0x2'));var BPromise=require('bluebird');var util=require(_0xb865('0x3'));var path=require(_0xb865('0x4'));var fs=require('fs');var _=require(_0xb865('0x5'));var Redis=require(_0xb865('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0xb865('0x7'));var logger=require(_0xb865('0x8'))('api');var config=require(_0xb865('0x9'));var db=require(_0xb865('0xa'))['db'];config[_0xb865('0xb')]=_[_0xb865('0xc')](config[_0xb865('0xb')],{'host':_0xb865('0xd'),'port':0x18eb});var socket=require(_0xb865('0xe'))(new Redis(config[_0xb865('0xb')]));require(_0xb865('0xf'))['register'](socket);function respondWithStatusCode(_0x59c3d2,_0x49dcb9){_0x49dcb9=_0x49dcb9||0xcc;return function(_0xfd702){if(_0xfd702){return _0x59c3d2[_0xb865('0x10')](_0x49dcb9);}return _0x59c3d2[_0xb865('0x11')](_0x49dcb9)[_0xb865('0x12')]();};}function respondWithResult(_0x5854fc,_0x3131b0){_0x3131b0=_0x3131b0||0xc8;return function(_0x2a1f26){if(_0x2a1f26){return _0x5854fc[_0xb865('0x11')](_0x3131b0)[_0xb865('0x13')](_0x2a1f26);}};}function respondWithFilteredResult(_0x58fd6f,_0x54f00b){return function(_0x5f0f8a){if(_0x5f0f8a){var _0x25dad9=typeof _0x54f00b[_0xb865('0x14')]===_0xb865('0x15')&&typeof _0x54f00b[_0xb865('0x16')]==='undefined';var _0x546d97=_0x5f0f8a[_0xb865('0x17')];var _0x36d271=_0x25dad9?0x0:_0x54f00b['offset'];var _0x389d59=_0x25dad9?_0x5f0f8a['count']:_0x54f00b[_0xb865('0x14')]+_0x54f00b[_0xb865('0x16')];var _0x40a19b;if(_0x389d59>=_0x546d97){_0x389d59=_0x546d97;_0x40a19b=0xc8;}else{_0x40a19b=0xce;}_0x58fd6f[_0xb865('0x11')](_0x40a19b);return _0x58fd6f[_0xb865('0x18')](_0xb865('0x19'),_0x36d271+'-'+_0x389d59+'/'+_0x546d97)[_0xb865('0x13')](_0x5f0f8a);}return null;};}function saveUpdates(_0x8064cf){return function(_0x326f90){if(_0x326f90){return _0x326f90[_0xb865('0x1a')](_0x8064cf)['then'](function(_0x2cef7f){return _0x2cef7f;});}return null;};}function removeEntity(_0x3a30e8){return function(_0x1846d9){if(_0x1846d9){return _0x1846d9['destroy']()[_0xb865('0x1b')](function(){_0x3a30e8['status'](0xcc)[_0xb865('0x12')]();});}};}function handleEntityNotFound(_0x31e742){return function(_0x471faa){if(!_0x471faa){_0x31e742['sendStatus'](0x194);}return _0x471faa;};}function handleError(_0x3406d0,_0x3304e8){_0x3304e8=_0x3304e8||0x1f4;return function(_0x27d5c3){logger[_0xb865('0x1c')](_0x27d5c3[_0xb865('0x1d')]);if(_0x27d5c3[_0xb865('0x1e')]){delete _0x27d5c3[_0xb865('0x1e')];}_0x3406d0[_0xb865('0x11')](_0x3304e8)['send'](_0x27d5c3);};}exports[_0xb865('0x1f')]=function(_0x2e1e4c,_0x240dde){var _0x501d15={};var _0x3da187=_['map'](db['FaxInteraction']['rawAttributes'],function(_0x36a91d){return{'name':_0x36a91d[_0xb865('0x20')],'type':_0x36a91d['type'][_0xb865('0x21')]};});_0x501d15=qs[_0xb865('0x22')](_0x3da187,_0x2e1e4c);return interaction[_0xb865('0x23')](_0xb865('0x24'),_0x2e1e4c[_0xb865('0x25')],_0x2e1e4c['user'],_0x501d15,_0x3da187)[_0xb865('0x1b')](respondWithFilteredResult(_0x240dde,_0x501d15))[_0xb865('0x26')](handleError(_0x240dde,null));};exports[_0xb865('0x27')]=function(_0x48c1b9,_0x1223a6){var _0x597f00={'raw':![],'where':{'id':_0x48c1b9[_0xb865('0x28')]['id']}},_0x51b535={};_0x51b535[_0xb865('0x29')]=_[_0xb865('0x2a')](db['FaxInteraction'][_0xb865('0x2b')]);_0x51b535[_0xb865('0x25')]=_[_0xb865('0x2a')](_0x48c1b9[_0xb865('0x25')]);_0x51b535[_0xb865('0x2c')]=_[_0xb865('0x2d')](_0x51b535[_0xb865('0x29')],_0x51b535[_0xb865('0x25')]);_0x597f00[_0xb865('0x2e')]=_['intersection'](_0x51b535[_0xb865('0x29')],qs[_0xb865('0x2f')](_0x48c1b9['query'][_0xb865('0x2f')]));_0x597f00[_0xb865('0x2e')]=_0x597f00['attributes'][_0xb865('0x30')]?_0x597f00[_0xb865('0x2e')]:_0x51b535[_0xb865('0x29')];if(_0x48c1b9[_0xb865('0x25')][_0xb865('0x31')]){_0x597f00[_0xb865('0x32')]=[{'all':!![]}];}_0x597f00=_[_0xb865('0x33')]({},_0x597f00,_0x48c1b9[_0xb865('0x34')]);return db[_0xb865('0x35')]['find'](_0x597f00)[_0xb865('0x1b')](handleEntityNotFound(_0x1223a6,null))[_0xb865('0x1b')](respondWithResult(_0x1223a6,null))[_0xb865('0x26')](handleError(_0x1223a6,null));};exports['create']=function(_0x4d9ca3,_0x1ad173){return db[_0xb865('0x35')][_0xb865('0x36')](_0x4d9ca3[_0xb865('0x37')],{})[_0xb865('0x1b')](respondWithResult(_0x1ad173,0xc9))[_0xb865('0x26')](handleError(_0x1ad173,null));};exports[_0xb865('0x1a')]=function(_0x5adc8c,_0xb2ed41){if(_0x5adc8c[_0xb865('0x37')]['id']){delete _0x5adc8c[_0xb865('0x37')]['id'];}return db[_0xb865('0x35')][_0xb865('0x38')]({'where':{'id':_0x5adc8c[_0xb865('0x28')]['id']}})['then'](handleEntityNotFound(_0xb2ed41,null))[_0xb865('0x1b')](saveUpdates(_0x5adc8c[_0xb865('0x37')],null))[_0xb865('0x1b')](respondWithResult(_0xb2ed41,null))['catch'](handleError(_0xb2ed41,null));};exports[_0xb865('0x39')]=function(_0xc66dad,_0x3e3abc){return db['FaxInteraction'][_0xb865('0x38')]({'where':{'id':_0xc66dad[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0x3e3abc,null))[_0xb865('0x1b')](removeEntity(_0x3e3abc,null))[_0xb865('0x26')](handleError(_0x3e3abc,null));};exports[_0xb865('0x3a')]=function(_0x3bbdc2,_0xd906e7){return db[_0xb865('0x35')][_0xb865('0x3a')]()[_0xb865('0x1b')](respondWithResult(_0xd906e7,null))[_0xb865('0x26')](handleError(_0xd906e7,null));};exports[_0xb865('0x3b')]=function(_0x4d0d56,_0x3e367a){return db[_0xb865('0x3c')]['find']({'where':{'id':_0x4d0d56[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0x3e367a,null))[_0xb865('0x1b')](function(_0x573469){if(_0x573469){return _0x573469[_0xb865('0x3b')](_0x4d0d56[_0xb865('0x37')][_0xb865('0x3d')],_[_0xb865('0x3e')](_0x4d0d56['body'],[_0xb865('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x3e367a,null))[_0xb865('0x26')](handleError(_0x3e367a,null));};exports[_0xb865('0x3f')]=function(_0x49f282,_0x47f6d4){var _0x2555d6={'raw':![],'where':{}};var _0x31f079={};var _0x3a211e={'count':0x0,'rows':[]};return db[_0xb865('0x35')][_0xb865('0x40')]({'where':{'id':_0x49f282['params']['id']}})['then'](handleEntityNotFound(_0x47f6d4,null))[_0xb865('0x1b')](function(_0x4adb24){if(_0x4adb24){_0x31f079[_0xb865('0x29')]=_[_0xb865('0x2a')](db[_0xb865('0x3c')][_0xb865('0x2b')]);_0x31f079[_0xb865('0x25')]=_[_0xb865('0x2a')](_0x49f282[_0xb865('0x25')]);_0x31f079['filters']=_[_0xb865('0x2d')](_0x31f079[_0xb865('0x29')],_0x31f079['query']);_0x2555d6['attributes']=_[_0xb865('0x2d')](_0x31f079['model'],qs[_0xb865('0x2f')](_0x49f282[_0xb865('0x25')]['fields']));_0x2555d6[_0xb865('0x2e')]=_0x2555d6[_0xb865('0x2e')][_0xb865('0x30')]?_0x2555d6['attributes']:_0x31f079[_0xb865('0x29')];if(!_0x49f282['query']['hasOwnProperty'](_0xb865('0x41'))){_0x2555d6[_0xb865('0x16')]=qs[_0xb865('0x16')](_0x49f282[_0xb865('0x25')][_0xb865('0x16')]);_0x2555d6['offset']=qs[_0xb865('0x14')](_0x49f282[_0xb865('0x25')][_0xb865('0x14')]);}_0x2555d6[_0xb865('0x42')]=qs[_0xb865('0x43')](_0x49f282[_0xb865('0x25')][_0xb865('0x43')]);_0x2555d6[_0xb865('0x44')]=qs['filters'](_[_0xb865('0x45')](_0x49f282['query'],_0x31f079[_0xb865('0x2c')]));_0x2555d6['where'][_0xb865('0x46')]=_0x4adb24['id'];if(_0x49f282[_0xb865('0x25')][_0xb865('0x47')]){_0x2555d6[_0xb865('0x44')]=_['merge'](_0x2555d6[_0xb865('0x44')],{'$or':_[_0xb865('0x48')](_0x2555d6[_0xb865('0x2e')],function(_0x21c28f){var _0x4067c4={};_0x4067c4[_0x21c28f]={'$like':'%'+_0x49f282[_0xb865('0x25')]['filter']+'%'};return _0x4067c4;})});}if(_0x49f282['query'][_0xb865('0x49')]){var _0x38bff8=_0x49f282[_0xb865('0x25')][_0xb865('0x49')][_0xb865('0x4a')](',');var _0x243484={};_0x243484[_0x38bff8[0x0]]={'$gte':moment(_0x38bff8[0x1])[_0xb865('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2555d6[_0xb865('0x44')]=_[_0xb865('0x33')](_0x2555d6[_0xb865('0x44')],_0x243484);}_0x2555d6=_['merge']({},_0x2555d6,_0x49f282[_0xb865('0x34')]);return db[_0xb865('0x3c')]['count']({'where':_0x2555d6[_0xb865('0x44')]})[_0xb865('0x1b')](function(_0x2cfdf1){_0x3a211e[_0xb865('0x17')]=_0x2cfdf1;if(_0x49f282[_0xb865('0x25')]['includeAll']){_0x2555d6['include']=[{'all':!![]}];}return db[_0xb865('0x3c')][_0xb865('0x23')](_0x2555d6);})[_0xb865('0x1b')](function(_0x269b8e){_0x3a211e['rows']=_0x269b8e;return _0x3a211e;});}})[_0xb865('0x1b')](respondWithFilteredResult(_0x47f6d4,_0x2555d6))[_0xb865('0x26')](handleError(_0x47f6d4,null));};exports['addTags']=function(_0x414cca,_0xf856e0){return db[_0xb865('0x35')][_0xb865('0x38')]({'where':{'id':_0x414cca[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0xf856e0,null))[_0xb865('0x1b')](function(_0x555eff){if(_0x555eff){return _0x555eff[_0xb865('0x4c')](_0x414cca[_0xb865('0x37')]['ids'],_['omit'](_0x414cca[_0xb865('0x37')],['ids','id'])||{})[_0xb865('0x4d')](function(){return db[_0xb865('0x4e')]['findAll']({'attributes':['id',_0xb865('0x1e'),_0xb865('0x4f')],'where':{'id':_0x414cca['body'][_0xb865('0x3d')]}});})['then'](function(_0x3e7919){socket[_0xb865('0x50')](_0xb865('0x51'),{'id':Number(_0x414cca[_0xb865('0x28')]['id']),'tags':_0x3e7919||[]});return{'id':Number(_0x414cca[_0xb865('0x28')]['id']),'tags':_0x3e7919||[]};});}})[_0xb865('0x1b')](respondWithResult(_0xf856e0,null))['catch'](handleError(_0xf856e0,null));};exports['removeTags']=function(_0x47cf69,_0x1c76a9){return db[_0xb865('0x35')][_0xb865('0x38')]({'where':{'id':_0x47cf69[_0xb865('0x28')]['id']}})[_0xb865('0x1b')](handleEntityNotFound(_0x1c76a9,null))[_0xb865('0x1b')](function(_0x2543c4){if(_0x2543c4){return _0x2543c4[_0xb865('0x52')](_0x47cf69[_0xb865('0x25')][_0xb865('0x3d')]);}})[_0xb865('0x1b')](respondWithStatusCode(_0x1c76a9,null))[_0xb865('0x26')](handleError(_0x1c76a9,null));};exports[_0xb865('0x53')]=function(_0xccdf30,_0x2d7574){var _0x497006=moment()[_0xb865('0x54')]()[_0xb865('0x55')]();var _0x1b01cf=path[_0xb865('0x56')](config['root'],'server',_0xb865('0x57'),_0xb865('0x58'));var _0x5a21cf=path['join'](config[_0xb865('0x59')],_0xb865('0x5a'),'files',_0xb865('0x5b'));var _0x39c711=path[_0xb865('0x56')](_0x1b01cf,_0x497006);var _0x2abbd5=util[_0xb865('0x4b')](_0xb865('0x5c'),_0xccdf30[_0xb865('0x28')]['id'],_0x497006);var _0x1ae71d=path[_0xb865('0x56')](_0x1b01cf,_0x2abbd5);var _0x434bbb=[];_0x434bbb[_0xb865('0x5d')]({'model':db[_0xb865('0x5e')],'as':_0xb865('0x5e'),'raw':!![]});var _0x205125=[{'model':db['FaxMessage'],'as':_0xb865('0x5f'),'attributes':['id',_0xb865('0x37'),_0xb865('0x60')],'include':_0x434bbb}];return db['FaxInteraction'][_0xb865('0x38')]({'where':{'id':_0xccdf30[_0xb865('0x28')]['id']},'include':_0x205125})[_0xb865('0x1b')](handleEntityNotFound(_0x2d7574,null))[_0xb865('0x1b')](function(_0x4b2fa0){if(_0x4b2fa0&&_0x4b2fa0['Messages']){var _0x5974f4=_0x4b2fa0['get']({'plain':!![]});fs['mkdirSync'](_0x39c711);for(var _0x18fc05=0x0;_0x18fc05<_0x5974f4[_0xb865('0x5f')][_0xb865('0x30')];_0x18fc05++){var _0x4139dc=_0x5974f4[_0xb865('0x5f')][_0x18fc05][_0xb865('0x5e')];if(_0x4139dc){var _0x34c841=path['join'](_0x5a21cf,_0x4139dc['basename']);if(fs[_0xb865('0x61')](_0x34c841)){fs[_0xb865('0x62')](_0x34c841)[_0xb865('0x63')](fs[_0xb865('0x64')](path[_0xb865('0x56')](_0x39c711,_0x4139dc[_0xb865('0x65')])));}}}return BPromise['resolve']()[_0xb865('0x1b')](function(){return new BPromise(function(_0x1cc715,_0x7d6e94){zipdir(_0x39c711,{'saveTo':_0x1ae71d},function(_0x30e559,_0x3d9f6){if(_0x30e559)return _0x7d6e94(_0x30e559);return _0x1cc715(_0x3d9f6);});})[_0xb865('0x1b')](function(){return new BPromise(function(_0x582744,_0x3e426c){rimraf(_0x39c711,function(_0x655197){if(_0x655197)_0x3e426c(_0x655197);return _0x582744();});});})[_0xb865('0x1b')](function(){return _0x2d7574['download'](_0x1ae71d,_0x2abbd5,function(_0x985942){if(_0x985942){console['log']('err',_0x985942);}else{fs[_0xb865('0x66')](_0x1ae71d);}});});});}else{return _0x2d7574[_0xb865('0x10')](0xc8);}})[_0xb865('0x26')](handleError(_0x2d7574,null));};
\ No newline at end of file
index 350aefd..851f463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23d5=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','FaxInteraction','FaxMessage','setMaxListeners','save','update'];(function(_0x2bd013,_0x2fce90){var _0xeccd5=function(_0x125623){while(--_0x125623){_0x2bd013['push'](_0x2bd013['shift']());}};_0xeccd5(++_0x2fce90);}(_0x23d5,0x8a));var _0x523d=function(_0x544c80,_0x85260f){_0x544c80=_0x544c80-0x0;var _0x2e852b=_0x23d5[_0x544c80];return _0x2e852b;};'use strict';var EventEmitter=require(_0x523d('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x523d('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x523d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x523d('0x3')](0x0);var events={'afterCreate':_0x523d('0x4'),'afterUpdate':_0x523d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5e762a){return function(_0x100c56,_0x44ce4d,_0x2fe90e){_0x100c56[_0x523d('0x6')]({'attributes':['id'],'raw':!![]})[_0x523d('0x7')](function(_0x52a00b){_0x100c56[_0x523d('0x8')](_0x523d('0x9'),_0x52a00b[_0x523d('0xa')](function(_0x5a8e86){return{'id':_0x5a8e86['id']};}));return FaxMessage[_0x523d('0xb')]({'where':{'FaxInteractionId':_0x100c56['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d611e){_0x100c56[_0x523d('0x8')](_0x523d('0xc'),_0x4d611e[_0x523d('0xd')]);FaxInteractionEvents['emit'](_0x5e762a+':'+_0x100c56['id'],_0x100c56);FaxInteractionEvents[_0x523d('0xe')](_0x5e762a,_0x100c56);_0x2fe90e(null);})[_0x523d('0xf')](_0x2fe90e(null));};}for(var e in events){if(events[_0x523d('0x10')](e)){var event=events[e];FaxInteraction[_0x523d('0x11')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0x5927=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','setDataValue'];(function(_0xdfe01d,_0x4bcb05){var _0x48de04=function(_0x1bfdda){while(--_0x1bfdda){_0xdfe01d['push'](_0xdfe01d['shift']());}};_0x48de04(++_0x4bcb05);}(_0x5927,0x12a));var _0x7592=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x5927[_0x4456a2];return _0xf36b56;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7592('0x0'))['db'][_0x7592('0x1')];var FaxMessage=require(_0x7592('0x0'))['db'][_0x7592('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7592('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7592('0x4'),'afterDestroy':'remove'};function emitEvent(_0x53413c){return function(_0x47e5af,_0x35de31,_0x50b0ad){_0x47e5af['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a1f1c){_0x47e5af[_0x7592('0x5')](_0x7592('0x6'),_0x3a1f1c[_0x7592('0x7')](function(_0x38d4d3){return{'id':_0x38d4d3['id']};}));return FaxMessage[_0x7592('0x8')]({'where':{'FaxInteractionId':_0x47e5af['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25eae8){_0x47e5af[_0x7592('0x5')](_0x7592('0x9'),_0x25eae8[_0x7592('0xa')]);FaxInteractionEvents[_0x7592('0xb')](_0x53413c+':'+_0x47e5af['id'],_0x47e5af);FaxInteractionEvents[_0x7592('0xb')](_0x53413c,_0x47e5af);_0x50b0ad(null);})[_0x7592('0xc')](_0x50b0ad(null));};}for(var e in events){if(events[_0x7592('0xd')](e)){var event=events[e];FaxInteraction[_0x7592('0xe')](e,emitEvent(event));}}module[_0x7592('0xf')]=FaxInteractionEvents;
\ No newline at end of file
index f77891d..369c2e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3458=['path','rimraf','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','request-promise'];(function(_0x113a99,_0x8d0836){var _0x4d262b=function(_0x5d5cc8){while(--_0x5d5cc8){_0x113a99['push'](_0x113a99['shift']());}};_0x4d262b(++_0x8d0836);}(_0x3458,0x92));var _0x8345=function(_0x18777b,_0x596582){_0x18777b=_0x18777b-0x0;var _0xaa5585=_0x3458[_0x18777b];return _0xaa5585;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8345('0x0'))(_0x8345('0x1'));var moment=require(_0x8345('0x2'));var BPromise=require('bluebird');var rp=require(_0x8345('0x3'));var fs=require('fs');var path=require(_0x8345('0x4'));var rimraf=require(_0x8345('0x5'));var config=require('../../config/environment');var attributes=require(_0x8345('0x6'));module[_0x8345('0x7')]=function(_0x4f0b3f,_0x38a114){return _0x4f0b3f[_0x8345('0x8')]('FaxInteraction',attributes,{'tableName':_0x8345('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x21b309,_0x52a058,_0x2657e7){if(_0x21b309[_0x8345('0xa')](_0x8345('0xb'))){_0x21b309[_0x8345('0xc')]=moment()[_0x8345('0xd')](_0x8345('0xe'));}_0x2657e7(null,_0x21b309);}}});};
\ No newline at end of file
+var _0xedca=['../../config/logger','api','request-promise','path','rimraf','exports','FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xedca,0x15c));var _0xaedc=function(_0x4556c1,_0x507828){_0x4556c1=_0x4556c1-0x0;var _0x4ec556=_0xedca[_0x4556c1];return _0x4ec556;};'use strict';var _=require(_0xaedc('0x0'));var util=require(_0xaedc('0x1'));var logger=require(_0xaedc('0x2'))(_0xaedc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaedc('0x4'));var fs=require('fs');var path=require(_0xaedc('0x5'));var rimraf=require(_0xaedc('0x6'));var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xaedc('0x7')]=function(_0x25babe,_0x4414dc){return _0x25babe['define'](_0xaedc('0x8'),attributes,{'tableName':_0xaedc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5217e5,_0x238f5b,_0x14e71a){if(_0x5217e5[_0xaedc('0xa')](_0xaedc('0xb'))){_0x5217e5[_0xaedc('0xc')]=moment()[_0xaedc('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x14e71a(null,_0x5217e5);}}});};
\ No newline at end of file
index 87ba709..fa2a107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf900=['attributes','limit','then','UpdateFaxInteraction','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','request\x20sent','result','catch','update','body','options','raw'];(function(_0xa0944b,_0x45646e){var _0x1f7540=function(_0x37e60a){while(--_0x37e60a){_0xa0944b['push'](_0xa0944b['shift']());}};_0x1f7540(++_0x45646e);}(_0xf900,0x15b));var _0x0f90=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xf900[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x0f90('0x0'));var util=require(_0x0f90('0x1'));var moment=require(_0x0f90('0x2'));var BPromise=require(_0x0f90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0f90('0x4'));var logger=require('../../config/logger')(_0x0f90('0x5'));var config=require(_0x0f90('0x6'));var jayson=require(_0x0f90('0x7'));var client=jayson[_0x0f90('0x8')][_0x0f90('0x9')]({'port':0x232a});config[_0x0f90('0xa')]=_[_0x0f90('0xb')](config[_0x0f90('0xa')],{'host':_0x0f90('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f90('0xa')]));require(_0x0f90('0xd'))[_0x0f90('0xe')](socket);function respondWithRpcPromise(_0xe5bd0b,_0x12257e,_0x36bc50){return new BPromise(function(_0x496816,_0x200b0b){return client[_0x0f90('0xf')](_0xe5bd0b,_0x36bc50)['then'](function(_0x91f4b5){logger[_0x0f90('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x12257e,'request\x20sent');logger[_0x0f90('0x11')](_0x0f90('0x12'),_0x12257e,'request\x20sent',JSON[_0x0f90('0x13')](_0x91f4b5));if(_0x91f4b5['error']){if(_0x91f4b5[_0x0f90('0x14')][_0x0f90('0x15')]===0x1f4){logger[_0x0f90('0x14')](_0x0f90('0x16'),_0x12257e,_0x91f4b5[_0x0f90('0x14')][_0x0f90('0x17')]);return _0x200b0b(_0x91f4b5[_0x0f90('0x14')][_0x0f90('0x17')]);}logger[_0x0f90('0x14')](_0x0f90('0x16'),_0x12257e,_0x91f4b5['error']['message']);return _0x496816(_0x91f4b5[_0x0f90('0x14')]['message']);}else{logger['info'](_0x0f90('0x16'),_0x12257e,_0x0f90('0x18'));_0x496816(_0x91f4b5[_0x0f90('0x19')][_0x0f90('0x17')]);}})[_0x0f90('0x1a')](function(_0x26c197){logger[_0x0f90('0x14')](_0x0f90('0x16'),_0x12257e,_0x26c197);_0x200b0b(_0x26c197);});});}exports['UpdateFaxInteraction']=function(_0x533c3d){var _0x29aed2=this;return new Promise(function(_0x3c7bb7,_0xcb9372){return db['FaxInteraction'][_0x0f90('0x1b')](_0x533c3d[_0x0f90('0x1c')],{'raw':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d['options'][_0x0f90('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d['options']['where']||null:null,'attributes':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d['options'][_0x0f90('0x1f')]||null:null,'limit':_0x533c3d[_0x0f90('0x1d')]?_0x533c3d[_0x0f90('0x1d')][_0x0f90('0x20')]||null:null})[_0x0f90('0x21')](function(_0x415280){logger[_0x0f90('0x10')](_0x0f90('0x22'),_0x533c3d);logger['debug'](_0x0f90('0x22'),_0x533c3d,JSON['stringify'](_0x415280));_0x3c7bb7(_0x415280);})[_0x0f90('0x1a')](function(_0x191cc9){logger[_0x0f90('0x14')](_0x0f90('0x22'),_0x191cc9[_0x0f90('0x17')],_0x533c3d);_0xcb9372(_0x29aed2['error'](0x1f4,_0x191cc9['message']));});});};exports[_0x0f90('0x23')]=function(_0x4bdc05){return new Promise(function(_0x21725b,_0x4b9a07){return db[_0x0f90('0x24')][_0x0f90('0x25')]({'where':_0x4bdc05[_0x0f90('0x1d')]?_0x4bdc05[_0x0f90('0x1d')]['where']||null:null})[_0x0f90('0x21')](function(_0x57dac6){if(_0x57dac6){return _0x57dac6[_0x0f90('0x26')](_0x4bdc05[_0x0f90('0x1c')][_0x0f90('0x27')],_[_0x0f90('0x28')](_0x4bdc05['body'],[_0x0f90('0x27'),'id'])||{});}})['spread'](function(_0x280980){logger[_0x0f90('0x10')](_0x0f90('0x29'),_0x4bdc05);logger[_0x0f90('0x11')](_0x0f90('0x29'),_0x4bdc05,JSON[_0x0f90('0x13')](_0x280980));_0x21725b(_0x280980);})[_0x0f90('0x1a')](function(_0x175b1b){logger['error'](_0x0f90('0x29'),_0x175b1b[_0x0f90('0x17')],_0x4bdc05);_0x4b9a07(_this['error'](0x1f4,_0x175b1b[_0x0f90('0x17')]));});});};
\ No newline at end of file
+var _0x01c6=['../../config/logger','rpc','redis','defaults','localhost','./faxInteraction.socket','register','then','info','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','FaxInteraction,\x20%s,\x20%s','message','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x360619,_0x5075d2){var _0x59f98a=function(_0x47211d){while(--_0x47211d){_0x360619['push'](_0x360619['shift']());}};_0x59f98a(++_0x5075d2);}(_0x01c6,0xd7));var _0x601c=function(_0x40927b,_0xf9b0a0){_0x40927b=_0x40927b-0x0;var _0x2635e8=_0x01c6[_0x40927b];return _0x2635e8;};'use strict';var _=require(_0x601c('0x0'));var util=require(_0x601c('0x1'));var moment=require(_0x601c('0x2'));var BPromise=require(_0x601c('0x3'));var rs=require(_0x601c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x601c('0x5'))['db'];var utils=require(_0x601c('0x6'));var logger=require(_0x601c('0x7'))(_0x601c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x601c('0x9')]=_[_0x601c('0xa')](config[_0x601c('0x9')],{'host':_0x601c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x601c('0x9')]));require(_0x601c('0xc'))[_0x601c('0xd')](socket);function respondWithRpcPromise(_0x2a19ab,_0x1b8b73,_0x4ff6a6){return new BPromise(function(_0x10e50c,_0x4e7caa){return client['request'](_0x2a19ab,_0x4ff6a6)[_0x601c('0xe')](function(_0x1b1b54){logger[_0x601c('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x1b8b73,_0x601c('0x10'));logger[_0x601c('0x11')](_0x601c('0x12'),_0x1b8b73,'request\x20sent',JSON[_0x601c('0x13')](_0x1b1b54));if(_0x1b1b54['error']){if(_0x1b1b54[_0x601c('0x14')]['code']===0x1f4){logger[_0x601c('0x14')](_0x601c('0x15'),_0x1b8b73,_0x1b1b54[_0x601c('0x14')][_0x601c('0x16')]);return _0x4e7caa(_0x1b1b54['error'][_0x601c('0x16')]);}logger[_0x601c('0x14')](_0x601c('0x15'),_0x1b8b73,_0x1b1b54[_0x601c('0x14')][_0x601c('0x16')]);return _0x10e50c(_0x1b1b54[_0x601c('0x14')][_0x601c('0x16')]);}else{logger[_0x601c('0xf')](_0x601c('0x15'),_0x1b8b73,_0x601c('0x10'));_0x10e50c(_0x1b1b54['result'][_0x601c('0x16')]);}})['catch'](function(_0x15796d){logger[_0x601c('0x14')](_0x601c('0x15'),_0x1b8b73,_0x15796d);_0x4e7caa(_0x15796d);});});}exports[_0x601c('0x17')]=function(_0x17c5a6){var _0x4f2b50=this;return new Promise(function(_0x4d0025,_0x58b68b){return db[_0x601c('0x18')][_0x601c('0x19')](_0x17c5a6[_0x601c('0x1a')],{'raw':_0x17c5a6[_0x601c('0x1b')]?_0x17c5a6['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c5a6[_0x601c('0x1b')]?_0x17c5a6[_0x601c('0x1b')][_0x601c('0x1c')]||null:null,'attributes':_0x17c5a6[_0x601c('0x1b')]?_0x17c5a6['options'][_0x601c('0x1d')]||null:null,'limit':_0x17c5a6['options']?_0x17c5a6[_0x601c('0x1b')][_0x601c('0x1e')]||null:null})[_0x601c('0xe')](function(_0x3098ca){logger['info'](_0x601c('0x17'),_0x17c5a6);logger[_0x601c('0x11')]('UpdateFaxInteraction',_0x17c5a6,JSON[_0x601c('0x13')](_0x3098ca));_0x4d0025(_0x3098ca);})[_0x601c('0x1f')](function(_0x27e97e){logger['error'](_0x601c('0x17'),_0x27e97e[_0x601c('0x16')],_0x17c5a6);_0x58b68b(_0x4f2b50[_0x601c('0x14')](0x1f4,_0x27e97e[_0x601c('0x16')]));});});};exports['AddTagsToFaxInteraction']=function(_0xc7679e){return new Promise(function(_0x387e5f,_0x3c6456){return db[_0x601c('0x18')][_0x601c('0x20')]({'where':_0xc7679e[_0x601c('0x1b')]?_0xc7679e[_0x601c('0x1b')][_0x601c('0x1c')]||null:null})[_0x601c('0xe')](function(_0x345585){if(_0x345585){return _0x345585[_0x601c('0x21')](_0xc7679e['body'][_0x601c('0x22')],_['omit'](_0xc7679e['body'],[_0x601c('0x22'),'id'])||{});}})[_0x601c('0x23')](function(_0x40cd93){logger['info'](_0x601c('0x24'),_0xc7679e);logger[_0x601c('0x11')]('AddTags',_0xc7679e,JSON[_0x601c('0x13')](_0x40cd93));_0x387e5f(_0x40cd93);})[_0x601c('0x1f')](function(_0x48b2cc){logger[_0x601c('0x14')](_0x601c('0x24'),_0x48b2cc['message'],_0xc7679e);_0x3c6456(_this[_0x601c('0x14')](0x1f4,_0x48b2cc[_0x601c('0x16')]));});});};
\ No newline at end of file
index 6c81e74..768dec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ec=['./faxInteraction.events','save','update','emit','removeListener','register','length'];(function(_0x2dfbfa,_0x91cc9b){var _0x83c70e=function(_0x1acda2){while(--_0x1acda2){_0x2dfbfa['push'](_0x2dfbfa['shift']());}};_0x83c70e(++_0x91cc9b);}(_0xb7ec,0x8c));var _0xcb7e=function(_0x43134c,_0x429046){_0x43134c=_0x43134c-0x0;var _0x402213=_0xb7ec[_0x43134c];return _0x402213;};'use strict';var FaxInteractionEvents=require(_0xcb7e('0x0'));var events=[_0xcb7e('0x1'),'remove',_0xcb7e('0x2')];function createListener(_0x373c27,_0x4e8cb6){return function(_0x2aad7f){_0x4e8cb6[_0xcb7e('0x3')](_0x373c27,_0x2aad7f);};}function removeListener(_0x3df6ee,_0x86de8a){return function(){FaxInteractionEvents[_0xcb7e('0x4')](_0x3df6ee,_0x86de8a);};}exports[_0xcb7e('0x5')]=function(_0x3e24bc){for(var _0x54c669=0x0,_0x32ddb8=events[_0xcb7e('0x6')];_0x54c669<_0x32ddb8;_0x54c669++){var _0x5dd933=events[_0x54c669];var _0x508a70=createListener('faxInteraction:'+_0x5dd933,_0x3e24bc);FaxInteractionEvents['on'](_0x5dd933,_0x508a70);}};
\ No newline at end of file
+var _0xc6b1=['removeListener','./faxInteraction.events','remove','emit'];(function(_0x118af7,_0x183c90){var _0x54bbc6=function(_0x13bf1a){while(--_0x13bf1a){_0x118af7['push'](_0x118af7['shift']());}};_0x54bbc6(++_0x183c90);}(_0xc6b1,0xc1));var _0x1c6b=function(_0xb2c77b,_0x216e45){_0xb2c77b=_0xb2c77b-0x0;var _0x15b68c=_0xc6b1[_0xb2c77b];return _0x15b68c;};'use strict';var FaxInteractionEvents=require(_0x1c6b('0x0'));var events=['save',_0x1c6b('0x1'),'update'];function createListener(_0x3c1be9,_0x40c374){return function(_0x504ec9){_0x40c374[_0x1c6b('0x2')](_0x3c1be9,_0x504ec9);};}function removeListener(_0x349250,_0x2c6bff){return function(){FaxInteractionEvents[_0x1c6b('0x3')](_0x349250,_0x2c6bff);};}exports['register']=function(_0x254ba3){for(var _0x5215d1=0x0,_0x46842e=events['length'];_0x5215d1<_0x46842e;_0x5215d1++){var _0x212d96=events[_0x5215d1];var _0x492205=createListener('faxInteraction:'+_0x212d96,_0x254ba3);FaxInteractionEvents['on'](_0x212d96,_0x492205);}};
\ No newline at end of file
index 9f3c3bf..0ff34a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f3=['getMessages','/:id/download','download','post','create','/:id/messages','fax','put','faxinteraction:update','tracked','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x36671c,_0x540221){var _0x30829f=function(_0x4aa61a){while(--_0x4aa61a){_0x36671c['push'](_0x36671c['shift']());}};_0x30829f(++_0x540221);}(_0x26f3,0xe5));var _0x326f=function(_0x628eee,_0x3f3fba){_0x628eee=_0x628eee-0x0;var _0x447718=_0x26f3[_0x628eee];return _0x447718;};'use strict';var multer=require(_0x326f('0x0'));var util=require('util');var path=require(_0x326f('0x1'));var timeout=require(_0x326f('0x2'));var express=require(_0x326f('0x3'));var router=express['Router']();var fs_extra=require(_0x326f('0x4'));var auth=require(_0x326f('0x5'));var interaction=require(_0x326f('0x6'));var config=require(_0x326f('0x7'));var controller=require(_0x326f('0x8'));router[_0x326f('0x9')]('/',auth[_0x326f('0xa')](),controller['index']);router[_0x326f('0x9')](_0x326f('0xb'),auth[_0x326f('0xa')](),controller[_0x326f('0xc')]);router['get'](_0x326f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x326f('0x9')]('/:id/messages',auth[_0x326f('0xa')](),controller[_0x326f('0xe')]);router[_0x326f('0x9')](_0x326f('0xf'),auth['isAuthenticated'](),controller[_0x326f('0x10')]);router[_0x326f('0x11')]('/',auth['isAuthenticated'](),controller[_0x326f('0x12')]);router[_0x326f('0x11')](_0x326f('0x13'),auth[_0x326f('0xa')](),controller['addMessage']);router[_0x326f('0x11')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked'](_0x326f('0x14'),'faxinteraction:addtags'),controller['addTags']);router[_0x326f('0x15')](_0x326f('0xd'),auth[_0x326f('0xa')](),interaction['tracked'](_0x326f('0x14'),_0x326f('0x16')),controller['update']);router['delete']('/:id',auth[_0x326f('0xa')](),interaction[_0x326f('0x17')]('fax','faxinteraction:destroy'),controller['destroy']);router['delete'](_0x326f('0x18'),auth[_0x326f('0xa')](),controller[_0x326f('0x19')]);module[_0x326f('0x1a')]=router;
\ No newline at end of file
+var _0xa7af=['addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','create','post'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0xa7af,0x13e));var _0xfa7a=function(_0x742080,_0x2421ae){_0x742080=_0x742080-0x0;var _0x44fac6=_0xa7af[_0x742080];return _0x44fac6;};'use strict';var multer=require(_0xfa7a('0x0'));var util=require(_0xfa7a('0x1'));var path=require(_0xfa7a('0x2'));var timeout=require(_0xfa7a('0x3'));var express=require(_0xfa7a('0x4'));var router=express['Router']();var fs_extra=require(_0xfa7a('0x5'));var auth=require(_0xfa7a('0x6'));var interaction=require(_0xfa7a('0x7'));var config=require(_0xfa7a('0x8'));var controller=require(_0xfa7a('0x9'));router[_0xfa7a('0xa')]('/',auth['isAuthenticated'](),controller[_0xfa7a('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xfa7a('0xc')]);router[_0xfa7a('0xa')](_0xfa7a('0xd'),auth['isAuthenticated'](),controller[_0xfa7a('0xe')]);router['get'](_0xfa7a('0xf'),auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x11')]);router['get'](_0xfa7a('0x12'),auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x13')]);router['post']('/',auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x14')]);router[_0xfa7a('0x15')](_0xfa7a('0xf'),auth[_0xfa7a('0x10')](),controller[_0xfa7a('0x16')]);router[_0xfa7a('0x15')](_0xfa7a('0x17'),auth[_0xfa7a('0x10')](),interaction['tracked'](_0xfa7a('0x18'),_0xfa7a('0x19')),controller[_0xfa7a('0x1a')]);router[_0xfa7a('0x1b')](_0xfa7a('0xd'),auth['isAuthenticated'](),interaction[_0xfa7a('0x1c')]('fax','faxinteraction:update'),controller[_0xfa7a('0x1d')]);router[_0xfa7a('0x1e')](_0xfa7a('0xd'),auth[_0xfa7a('0x10')](),interaction['tracked']('fax',_0xfa7a('0x1f')),controller['destroy']);router['delete'](_0xfa7a('0x17'),auth['isAuthenticated'](),controller[_0xfa7a('0x20')]);module[_0xfa7a('0x21')]=router;
\ No newline at end of file
index 4b79c0d..839729a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a81=['DATE','sequelize','exports','TEXT','medium','out'];(function(_0x58124e,_0x5026e0){var _0x7f6deb=function(_0x27fec3){while(--_0x27fec3){_0x58124e['push'](_0x58124e['shift']());}};_0x7f6deb(++_0x5026e0);}(_0x4a81,0x1b7));var _0x14a8=function(_0x4a19ea,_0x311ef2){_0x4a19ea=_0x4a19ea-0x0;var _0x305de7=_0x4a81[_0x4a19ea];return _0x305de7;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'body':{'type':Sequelize[_0x14a8('0x2')](_0x14a8('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x14a8('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x14a8('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x14a8('0x5')]}};
\ No newline at end of file
+var _0x303a=['ENUM','out','DATE','sequelize','TEXT','medium','BOOLEAN'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x303a,0x1a0));var _0xa303=function(_0x4ecd76,_0x79f1f3){_0x4ecd76=_0x4ecd76-0x0;var _0x240f34=_0x303a[_0x4ecd76];return _0x240f34;};'use strict';var Sequelize=require(_0xa303('0x0'));module['exports']={'body':{'type':Sequelize[_0xa303('0x1')](_0xa303('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa303('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa303('0x4')]('in','out'),'defaultValue':_0xa303('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa303('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa303('0x6')]}};
\ No newline at end of file
index fdb8a14..f0c36bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x407d=['channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','create','CmContact','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','server','files','attachments','Attachment','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./faxMessage.socket','register','jayson/promise','http','client','request','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','include','findAll','show','params','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','isNil','read1stAt','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual'];(function(_0xf39b53,_0xae82a9){var _0x581950=function(_0xc27cb5){while(--_0xc27cb5){_0xf39b53['push'](_0xf39b53['shift']());}};_0x581950(++_0xae82a9);}(_0x407d,0x1d2));var _0xd407=function(_0x50c4d7,_0x485f9b){_0x50c4d7=_0x50c4d7-0x0;var _0x125ab1=_0x407d[_0x50c4d7];return _0x125ab1;};'use strict';var emlformat=require(_0xd407('0x0'));var rimraf=require(_0xd407('0x1'));var zipdir=require(_0xd407('0x2'));var jsonpatch=require(_0xd407('0x3'));var rp=require(_0xd407('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd407('0x5'));var sox=require(_0xd407('0x6'));var csv=require(_0xd407('0x7'));var ejs=require(_0xd407('0x8'));var fs=require('fs');var fs_extra=require(_0xd407('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd407('0xa'));var jsforce=require(_0xd407('0xb'));var deskjs=require(_0xd407('0xc'));var toCsv=require(_0xd407('0x7'));var querystring=require(_0xd407('0xd'));var Papa=require('papaparse');var Redis=require(_0xd407('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd407('0xf'));var as=require(_0xd407('0x10'));var hardwareService=require(_0xd407('0x11'));var logger=require(_0xd407('0x12'))(_0xd407('0x13'));var utils=require(_0xd407('0x14'));var config=require(_0xd407('0x15'));var licenseUtil=require(_0xd407('0x16'));var db=require(_0xd407('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xd407('0x18'),'port':0x18eb});var socket=require(_0xd407('0x19'))(new Redis(config[_0xd407('0x1a')]));require(_0xd407('0x1b'))[_0xd407('0x1c')](socket);var jayson=require(_0xd407('0x1d'));var client=jayson['client'][_0xd407('0x1e')]({'port':0x232c});var client9002=jayson[_0xd407('0x1f')][_0xd407('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4d3ac7,_0x1dfc57,_0x44e19f,_0x435831){return new BPromise(function(_0xfe3587,_0x362432){var _0x4b43d1=_0x435831||client;return _0x4b43d1[_0xd407('0x20')](_0x4d3ac7,_0x44e19f)['then'](function(_0x2660f3){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1dfc57,_0xd407('0x21'));logger[_0xd407('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x1dfc57,'request\x20sent',JSON[_0xd407('0x23')](_0x2660f3));if(_0x2660f3[_0xd407('0x24')]){if(_0x2660f3['error'][_0xd407('0x25')]===0x1f4){logger[_0xd407('0x24')](_0xd407('0x26'),_0x1dfc57,_0x2660f3[_0xd407('0x24')][_0xd407('0x27')]);return _0x362432(_0x2660f3[_0xd407('0x24')][_0xd407('0x27')]);}logger[_0xd407('0x24')](_0xd407('0x26'),_0x1dfc57,_0x2660f3['error']['message']);return _0xfe3587(_0x2660f3[_0xd407('0x24')][_0xd407('0x27')]);}else{logger[_0xd407('0x28')](_0xd407('0x26'),_0x1dfc57,'request\x20sent');_0xfe3587(_0x2660f3[_0xd407('0x29')][_0xd407('0x27')]);}})[_0xd407('0x2a')](function(_0x25a37c){logger[_0xd407('0x24')]('FaxMessage,\x20%s,\x20%s',_0x1dfc57,_0x25a37c);_0x362432(_0x25a37c);});});}function respondWithStatusCode(_0x44f9a1,_0xb96822){_0xb96822=_0xb96822||0xcc;return function(_0x1c2528){if(_0x1c2528){return _0x44f9a1[_0xd407('0x2b')](_0xb96822);}return _0x44f9a1[_0xd407('0x2c')](_0xb96822)[_0xd407('0x2d')]();};}function respondWithResult(_0x24cc7b,_0x2a1041){_0x2a1041=_0x2a1041||0xc8;return function(_0x5f215e){if(_0x5f215e){return _0x24cc7b[_0xd407('0x2c')](_0x2a1041)[_0xd407('0x2e')](_0x5f215e);}};}function respondWithFilteredResult(_0x49b82c,_0x2d938a){return function(_0x442c2f){if(_0x442c2f){var _0x919557=typeof _0x2d938a[_0xd407('0x2f')]===_0xd407('0x30')&&typeof _0x2d938a['limit']==='undefined';var _0x5ed04c=_0x442c2f[_0xd407('0x31')];var _0xebf3bf=_0x919557?0x0:_0x2d938a[_0xd407('0x2f')];var _0x5da0ee=_0x919557?_0x442c2f[_0xd407('0x31')]:_0x2d938a['offset']+_0x2d938a['limit'];var _0x3fd67f;if(_0x5da0ee>=_0x5ed04c){_0x5da0ee=_0x5ed04c;_0x3fd67f=0xc8;}else{_0x3fd67f=0xce;}_0x49b82c[_0xd407('0x2c')](_0x3fd67f);return _0x49b82c[_0xd407('0x32')](_0xd407('0x33'),_0xebf3bf+'-'+_0x5da0ee+'/'+_0x5ed04c)[_0xd407('0x2e')](_0x442c2f);}return null;};}function patchUpdates(_0xe926e4){return function(_0x3c9336){try{jsonpatch[_0xd407('0x34')](_0x3c9336,_0xe926e4,!![]);}catch(_0x434fa2){return BPromise[_0xd407('0x35')](_0x434fa2);}return _0x3c9336[_0xd407('0x36')]();};}function saveUpdates(_0x57e062,_0x331a83){return function(_0x54f6ef){if(_0x54f6ef){return _0x54f6ef[_0xd407('0x37')](_0x57e062)['then'](function(_0x6e43b4){return _0x6e43b4;});}return null;};}function removeEntity(_0xa85523,_0x3ee366){return function(_0x305dde){if(_0x305dde){return _0x305dde[_0xd407('0x38')]()['then'](function(){_0xa85523[_0xd407('0x2c')](0xcc)[_0xd407('0x2d')]();});}};}function handleEntityNotFound(_0xe6dbfe,_0x2d7e2a){return function(_0x313d00){if(!_0x313d00){_0xe6dbfe['sendStatus'](0x194);}return _0x313d00;};}function handleError(_0x24f47e,_0x1c35a1){_0x1c35a1=_0x1c35a1||0x1f4;return function(_0x2de778){logger[_0xd407('0x24')](_0x2de778[_0xd407('0x39')]);if(_0x2de778[_0xd407('0x3a')]){delete _0x2de778[_0xd407('0x3a')];}_0x24f47e['status'](_0x1c35a1)[_0xd407('0x3b')](_0x2de778);};}exports[_0xd407('0x3c')]=function(_0x49f9f4,_0x3da182){var _0xad514={},_0x284a94={},_0x634cf3={'count':0x0,'rows':[]};var _0x79c429=_[_0xd407('0x3d')](db[_0xd407('0x3e')][_0xd407('0x3f')],function(_0x15232b){return{'name':_0x15232b[_0xd407('0x40')],'type':_0x15232b['type'][_0xd407('0x41')]};});_0x284a94[_0xd407('0x42')]=_[_0xd407('0x3d')](_0x79c429,_0xd407('0x3a'));_0x284a94['query']=_[_0xd407('0x43')](_0x49f9f4[_0xd407('0x44')]);_0x284a94[_0xd407('0x45')]=_['intersection'](_0x284a94[_0xd407('0x42')],_0x284a94[_0xd407('0x44')]);_0xad514[_0xd407('0x46')]=_[_0xd407('0x47')](_0x284a94['model'],qs[_0xd407('0x48')](_0x49f9f4['query']['fields']));_0xad514[_0xd407('0x46')]=_0xad514[_0xd407('0x46')][_0xd407('0x49')]?_0xad514[_0xd407('0x46')]:_0x284a94[_0xd407('0x42')];if(!_0x49f9f4[_0xd407('0x44')]['hasOwnProperty'](_0xd407('0x4a'))){_0xad514[_0xd407('0x4b')]=qs['limit'](_0x49f9f4[_0xd407('0x44')]['limit']);_0xad514['offset']=qs[_0xd407('0x2f')](_0x49f9f4['query'][_0xd407('0x2f')]);}_0xad514[_0xd407('0x4c')]=qs['sort'](_0x49f9f4[_0xd407('0x44')][_0xd407('0x4d')]);_0xad514['where']=qs['filters'](_[_0xd407('0x4e')](_0x49f9f4[_0xd407('0x44')],_0x284a94[_0xd407('0x45')]),_0x79c429);if(_0x49f9f4[_0xd407('0x44')][_0xd407('0x4f')]){_0xad514[_0xd407('0x50')]=_[_0xd407('0x51')](_0xad514[_0xd407('0x50')],{'$or':_[_0xd407('0x3d')](_0x79c429,function(_0x7cc992){if(_0x7cc992[_0xd407('0x52')]!==_0xd407('0x53')){var _0xea8309={};_0xea8309[_0x7cc992['name']]={'$like':'%'+_0x49f9f4[_0xd407('0x44')]['filter']+'%'};return _0xea8309;}})});}_0xad514=_['merge']({},_0xad514,_0x49f9f4[_0xd407('0x54')]);var _0x397442={'where':_0xad514['where']};return db[_0xd407('0x3e')][_0xd407('0x31')](_0x397442)[_0xd407('0x55')](function(_0x54c14c){_0x634cf3[_0xd407('0x31')]=_0x54c14c;if(_0x49f9f4[_0xd407('0x44')][_0xd407('0x56')]){_0xad514[_0xd407('0x57')]=[{'all':!![]}];}return db[_0xd407('0x3e')][_0xd407('0x58')](_0xad514);})[_0xd407('0x55')](function(_0x270154){_0x634cf3['rows']=_0x270154;return _0x634cf3;})['then'](respondWithFilteredResult(_0x3da182,_0xad514))[_0xd407('0x2a')](handleError(_0x3da182,null));};exports[_0xd407('0x59')]=function(_0x390633,_0x34dc48){var _0x132173={'raw':!![],'where':{'id':_0x390633[_0xd407('0x5a')]['id']}},_0x277dba={};_0x277dba['model']=_['keys'](db[_0xd407('0x3e')][_0xd407('0x3f')]);_0x277dba[_0xd407('0x44')]=_['keys'](_0x390633[_0xd407('0x44')]);_0x277dba[_0xd407('0x45')]=_[_0xd407('0x47')](_0x277dba[_0xd407('0x42')],_0x277dba[_0xd407('0x44')]);_0x132173[_0xd407('0x46')]=_[_0xd407('0x47')](_0x277dba['model'],qs[_0xd407('0x48')](_0x390633[_0xd407('0x44')][_0xd407('0x48')]));_0x132173[_0xd407('0x46')]=_0x132173['attributes'][_0xd407('0x49')]?_0x132173[_0xd407('0x46')]:_0x277dba['model'];if(_0x390633[_0xd407('0x44')][_0xd407('0x56')]){_0x132173[_0xd407('0x57')]=[{'all':!![]}];}_0x132173=_[_0xd407('0x51')]({},_0x132173,_0x390633[_0xd407('0x54')]);return db[_0xd407('0x3e')][_0xd407('0x5b')](_0x132173)[_0xd407('0x55')](handleEntityNotFound(_0x34dc48,null))[_0xd407('0x55')](respondWithResult(_0x34dc48,null))[_0xd407('0x2a')](handleError(_0x34dc48,null));};exports['update']=function(_0x4e2bb5,_0x940784){if(_0x4e2bb5[_0xd407('0x5c')]['id']){delete _0x4e2bb5[_0xd407('0x5c')]['id'];}return db[_0xd407('0x3e')][_0xd407('0x5b')]({'where':{'id':_0x4e2bb5['params']['id']}})[_0xd407('0x55')](handleEntityNotFound(_0x940784,null))['then'](saveUpdates(_0x4e2bb5['body'],null))['then'](respondWithResult(_0x940784,null))[_0xd407('0x2a')](handleError(_0x940784,null));};exports[_0xd407('0x38')]=function(_0x219c4a,_0x4d1ce9){return db['FaxMessage'][_0xd407('0x5b')]({'where':{'id':_0x219c4a[_0xd407('0x5a')]['id']}})[_0xd407('0x55')](handleEntityNotFound(_0x4d1ce9,null))[_0xd407('0x55')](removeEntity(_0x4d1ce9,null))[_0xd407('0x2a')](handleError(_0x4d1ce9,null));};exports[_0xd407('0x5d')]=function(_0x3e55f7,_0x2f95a8){return db[_0xd407('0x3e')][_0xd407('0x5d')]()[_0xd407('0x55')](respondWithResult(_0x2f95a8,null))['catch'](handleError(_0x2f95a8,null));};var interaction_log=require('../../config/logger')(_0xd407('0x5e'));exports[_0xd407('0x5f')]=function(_0x36f643,_0x5b69fb,_0x4734fe){var _0x329c69={'agent':{},'channel':_0xd407('0x60')};if(_0x36f643[_0xd407('0x5c')]['id']){delete _0x36f643[_0xd407('0x5c')]['id'];}_0x36f643[_0xd407('0x5c')][_0xd407('0x61')]=!![];_0x36f643['body'][_0xd407('0x62')]=moment()[_0xd407('0x63')](_0xd407('0x64'));_0x36f643[_0xd407('0x5c')][_0xd407('0x65')]=_0x36f643[_0xd407('0x5c')][_0xd407('0x65')]||_0x36f643[_0xd407('0x66')]['id'];_0x329c69['agent']['id']=_0x36f643['body'][_0xd407('0x65')];return db[_0xd407('0x3e')][_0xd407('0x5b')]({'where':{'id':_0x36f643[_0xd407('0x5a')]['id'],'UserId':null}})[_0xd407('0x55')](handleEntityNotFound(_0x5b69fb,null))[_0xd407('0x55')](saveUpdates(_0x36f643[_0xd407('0x5c')],null))[_0xd407('0x55')](function(_0x5e4d8a){if(_0x5e4d8a){_0x329c69[_0xd407('0x27')]=_0x5e4d8a[_0xd407('0x67')]({'plain':!![]});return db['FaxInteraction'][_0xd407('0x5b')]({'where':{'id':_0x5e4d8a['FaxInteractionId']}});}return null;})[_0xd407('0x55')](handleEntityNotFound(_0x5b69fb,null))[_0xd407('0x55')](function(_0x33aafb){if(_0x33aafb){return _0x33aafb[_0xd407('0x37')]({'UserId':_0x36f643['body'][_0xd407('0x65')],'read1stAt':_[_0xd407('0x68')](_0x33aafb[_0xd407('0x69')])?moment()[_0xd407('0x63')](_0xd407('0x64')):undefined});}return null;})['then'](function(_0x3e6bf2){if(_0x3e6bf2){_0x329c69['interaction']=_0x3e6bf2[_0xd407('0x67')]({'plain':!![]});interaction_log[_0xd407('0x28')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x36f643[_0xd407('0x66')]['id'],_0x36f643[_0xd407('0x66')][_0xd407('0x3a')],_0x36f643[_0xd407('0x66')][_0xd407('0x6a')],_0x329c69[_0xd407('0x6b')]['id'],_0x36f643['body']?JSON['stringify'](_0x36f643['body']):_0xd407('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xd407('0x6d'),_0x329c69);}return null;})['then'](function(_0x47f8ee){var _0x3316d0=_0xd407('0x6e')+_0x47f8ee[_0xd407('0x27')][_0xd407('0x6f')];return db['sequelize'][_0xd407('0x44')](_0x3316d0,{'type':db[_0xd407('0x70')][_0xd407('0x71')][_0xd407('0x72')],'raw':!![]})['then'](function(_0x2af668){return _0x2af668;});})[_0xd407('0x55')](function(_0xddd62b){if(_0xddd62b){_0x329c69[_0xd407('0x27')][_0xd407('0x73')]=_0xddd62b[0x0];if(!_0x36f643[_0xd407('0x5c')]['UserId'])return;return db[_0xd407('0x74')][_0xd407('0x5b')]({'where':{'id':_0x36f643[_0xd407('0x5c')]['UserId'],'role':_0xd407('0x75')},'attributes':['id',_0xd407('0x3a'),_0xd407('0x76'),_0xd407('0x77'),_0xd407('0x78')],'raw':!![]});}return null;})['then'](function(_0x495ec7){if(!_0x495ec7)return null;_0x329c69[_0xd407('0x27')][_0xd407('0x75')]=_0x495ec7;return _0x329c69;})[_0xd407('0x55')](function(_0x51917e){if(_0x51917e){if(_0x36f643[_0xd407('0x5c')][_0xd407('0x79')]){_0x329c69[_0xd407('0x27')]['interface']=util[_0xd407('0x63')]('SIP/%s',_0x36f643[_0xd407('0x66')]['name']);_0x329c69[_0xd407('0x27')][_0xd407('0x7a')]=_0x329c69[_0xd407('0x7a')];_0x329c69[_0xd407('0x27')][_0xd407('0x7b')]=_0x329c69[_0xd407('0x7a')];_0x329c69[_0xd407('0x27')][_0xd407('0x7c')]=_0xd407('0x5f');return respondWithRpcPromise('EventManager',_0xd407('0x7d'),{'event':_0xd407('0x7e'),'message':_0x329c69[_0xd407('0x27')]},client9002)[_0xd407('0x55')](function(){return _0x329c69;});}return _0x329c69;}return null;})[_0xd407('0x55')](respondWithResult(_0x5b69fb,null))[_0xd407('0x2a')](handleError(_0x5b69fb,null));};var interaction_log=require(_0xd407('0x12'))(_0xd407('0x5e'));exports[_0xd407('0x35')]=function(_0x4fe423,_0x15504c,_0x5b3d88){var _0x207edc={'agent':{},'channel':_0xd407('0x60')};if(_0x4fe423[_0xd407('0x5c')]['id']){delete _0x4fe423['body']['id'];}_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')]=_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')]||_0x4fe423[_0xd407('0x66')]['id'];_0x207edc['agent']['id']=_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')];return db[_0xd407('0x3e')][_0xd407('0x5b')]({'where':{'id':_0x4fe423[_0xd407('0x5a')]['id'],'UserId':null}})[_0xd407('0x55')](handleEntityNotFound(_0x15504c,null))['then'](function(_0x90d283){if(_0x90d283){_0x207edc[_0xd407('0x27')]=_0x90d283['get']({'plain':!![]});return db[_0xd407('0x7f')]['find']({'where':{'id':_0x90d283['FaxInteractionId']}});}return null;})[_0xd407('0x55')](handleEntityNotFound(_0x15504c,null))['then'](function(_0x4b952d){if(_0x4b952d){_0x207edc[_0xd407('0x6b')]=_0x4b952d[_0xd407('0x67')]({'plain':!![]});interaction_log['info'](_0xd407('0x80'),_0x4fe423[_0xd407('0x66')]['id'],_0x4fe423[_0xd407('0x66')][_0xd407('0x3a')],_0x4fe423[_0xd407('0x66')][_0xd407('0x6a')],_0x207edc[_0xd407('0x6b')]['id'],_0x4fe423[_0xd407('0x5c')]?JSON['stringify'](_0x4fe423[_0xd407('0x5c')]):_0xd407('0x6c'));return respondWithRpcPromise(_0xd407('0x81'),_0xd407('0x82'),_0x207edc);}return null;})[_0xd407('0x55')](function(_0x1cbb84){var _0x54afca=_0xd407('0x6e')+_0x1cbb84[_0xd407('0x27')][_0xd407('0x6f')];return db['sequelize'][_0xd407('0x44')](_0x54afca,{'type':db[_0xd407('0x70')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x3f77b5){return _0x3f77b5;});})[_0xd407('0x55')](function(_0x13fd0f){if(_0x13fd0f){_0x207edc['message']['contact']=_0x13fd0f[0x0];if(!_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')])return;return db[_0xd407('0x74')][_0xd407('0x5b')]({'where':{'id':_0x4fe423[_0xd407('0x5c')][_0xd407('0x65')],'role':_0xd407('0x75')},'attributes':['id','name',_0xd407('0x76'),_0xd407('0x77'),'internal'],'raw':!![]});}return null;})[_0xd407('0x55')](function(_0x434351){if(!_0x434351)return null;_0x207edc[_0xd407('0x27')][_0xd407('0x75')]=_0x434351;return _0x207edc;})[_0xd407('0x55')](function(_0x545ba3){if(_0x545ba3){_0x545ba3[_0xd407('0x27')]['interface']=util[_0xd407('0x63')]('SIP/%s',_0x4fe423[_0xd407('0x66')]['name']);_0x545ba3[_0xd407('0x27')][_0xd407('0x7a')]=_0x207edc[_0xd407('0x7a')];_0x545ba3['message'][_0xd407('0x7b')]=_0x207edc['channel'];_0x545ba3[_0xd407('0x27')][_0xd407('0x7c')]=_0xd407('0x35');respondWithRpcPromise(_0xd407('0x7d'),_0xd407('0x7d'),{'event':_0xd407('0x83'),'message':_0x545ba3['message']},client9002);return _0x207edc;}return null;})[_0xd407('0x55')](respondWithResult(_0x15504c,null))['catch'](handleError(_0x15504c,null));};exports[_0xd407('0x84')]=function(_0x1eec68,_0x5afef8){var _0x3fc0eb;return db['FaxMessage'][_0xd407('0x84')](_0x1eec68[_0xd407('0x5c')],{})[_0xd407('0x55')](function(_0x213da4){_0x3fc0eb=_0x213da4;return db[_0xd407('0x85')][_0xd407('0x86')]({'where':{'id':_0x3fc0eb[_0xd407('0x6f')]}});})[_0xd407('0x55')](function(_0x324109){if(_[_0xd407('0x68')](_0x324109)){return;}else{_0x3fc0eb['fax']=_0x324109[_0xd407('0x60')];return db['Attachment'][_0xd407('0x86')]({'where':{'id':_0x3fc0eb[_0xd407('0x87')]}});}})['then'](function(_0x48ba4a){return respondWithRpcPromise(_0xd407('0x88'),_0xd407('0x88'),{'FaxAccountId':_[_0xd407('0x68')](_0x1eec68[_0xd407('0x5c')])?undefined:_0x1eec68[_0xd407('0x5c')][_0xd407('0x89')],'path':_[_0xd407('0x68')](_0x48ba4a)?undefined:util['format'](_0xd407('0x8a'),_0x48ba4a['basename']),'fax':_[_0xd407('0x68')](_0x3fc0eb[_0xd407('0x60')])?undefined:_0x3fc0eb[_0xd407('0x60')],'AttachmentId':_0x3fc0eb[_0xd407('0x87')]},client9002);})[_0xd407('0x55')](respondWithResult(_0x5afef8,0xc9))[_0xd407('0x2a')](handleError(_0x5afef8,null));};exports[_0xd407('0x8b')]=function(_0x3fe118,_0xb9de1c){var _0x1161a4=path['join'](config[_0xd407('0x8c')],_0xd407('0x8d'),_0xd407('0x8e'),_0xd407('0x8f'));return db['FaxMessage'][_0xd407('0x5b')]({'where':{'id':_0x3fe118[_0xd407('0x5a')]['id']},'include':[{'model':db[_0xd407('0x90')],'as':_0xd407('0x90')}]})[_0xd407('0x55')](handleEntityNotFound(_0xb9de1c,null))[_0xd407('0x55')](function(_0x5ed7b4){if(_0x5ed7b4){return _0xb9de1c['download'](path[_0xd407('0x91')](_0x1161a4,_0x5ed7b4[_0xd407('0x90')][_0xd407('0x92')]));}})[_0xd407('0x2a')](handleError(_0xb9de1c,null));};
\ No newline at end of file
+var _0x940c=['../../config/logger','../../config/utils','../../config/environment','../../config/license/util','localhost','socket.io-emitter','./faxMessage.socket','register','client','http','request','then','info','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','update','stack','name','index','map','FaxMessage','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','count','includeAll','include','findAll','show','params','length','options','find','body','destroy','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','create','CmContact','isNil','AttachmentId','SendFax','FaxAccountId','basename','join','files','attachments','Attachment','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs'];(function(_0xe6c244,_0x1e6199){var _0x2d3f91=function(_0x34c5d1){while(--_0x34c5d1){_0xe6c244['push'](_0xe6c244['shift']());}};_0x2d3f91(++_0x1e6199);}(_0x940c,0x10a));var _0xc940=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x940c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc940('0x0'));var zipdir=require(_0xc940('0x1'));var jsonpatch=require(_0xc940('0x2'));var rp=require('request-promise');var moment=require(_0xc940('0x3'));var BPromise=require(_0xc940('0x4'));var Mustache=require(_0xc940('0x5'));var util=require(_0xc940('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc940('0x7'));var ejs=require(_0xc940('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc940('0x9'));var crypto=require(_0xc940('0xa'));var jsforce=require(_0xc940('0xb'));var deskjs=require(_0xc940('0xc'));var toCsv=require(_0xc940('0x7'));var querystring=require(_0xc940('0xd'));var Papa=require(_0xc940('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc940('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc940('0x10'))('api');var utils=require(_0xc940('0x11'));var config=require(_0xc940('0x12'));var licenseUtil=require(_0xc940('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xc940('0x14'),'port':0x18eb});var socket=require(_0xc940('0x15'))(new Redis(config['redis']));require(_0xc940('0x16'))[_0xc940('0x17')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc940('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0xc940('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x1b6389,_0x1d8e89,_0xa51172,_0x27d65c){return new BPromise(function(_0x5abe99,_0x3c95c6){var _0xf24f80=_0x27d65c||client;return _0xf24f80[_0xc940('0x1a')](_0x1b6389,_0xa51172)[_0xc940('0x1b')](function(_0x27ec3d){logger[_0xc940('0x1c')]('FaxMessage,\x20%s,\x20%s',_0x1d8e89,'request\x20sent');logger[_0xc940('0x1d')](_0xc940('0x1e'),_0x1d8e89,_0xc940('0x1f'),JSON[_0xc940('0x20')](_0x27ec3d));if(_0x27ec3d[_0xc940('0x21')]){if(_0x27ec3d[_0xc940('0x21')][_0xc940('0x22')]===0x1f4){logger[_0xc940('0x21')](_0xc940('0x23'),_0x1d8e89,_0x27ec3d[_0xc940('0x21')][_0xc940('0x24')]);return _0x3c95c6(_0x27ec3d[_0xc940('0x21')][_0xc940('0x24')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x1d8e89,_0x27ec3d[_0xc940('0x21')][_0xc940('0x24')]);return _0x5abe99(_0x27ec3d['error']['message']);}else{logger[_0xc940('0x1c')](_0xc940('0x23'),_0x1d8e89,_0xc940('0x1f'));_0x5abe99(_0x27ec3d[_0xc940('0x25')]['message']);}})[_0xc940('0x26')](function(_0x5638a5){logger[_0xc940('0x21')]('FaxMessage,\x20%s,\x20%s',_0x1d8e89,_0x5638a5);_0x3c95c6(_0x5638a5);});});}function respondWithStatusCode(_0x57e902,_0x46e3c4){_0x46e3c4=_0x46e3c4||0xcc;return function(_0x379da7){if(_0x379da7){return _0x57e902[_0xc940('0x27')](_0x46e3c4);}return _0x57e902[_0xc940('0x28')](_0x46e3c4)[_0xc940('0x29')]();};}function respondWithResult(_0x157304,_0x317fbc){_0x317fbc=_0x317fbc||0xc8;return function(_0x20c638){if(_0x20c638){return _0x157304[_0xc940('0x28')](_0x317fbc)[_0xc940('0x2a')](_0x20c638);}};}function respondWithFilteredResult(_0x14419a,_0x32bb63){return function(_0x4c9359){if(_0x4c9359){var _0x468bc6=typeof _0x32bb63['offset']===_0xc940('0x2b')&&typeof _0x32bb63[_0xc940('0x2c')]===_0xc940('0x2b');var _0x528543=_0x4c9359['count'];var _0x56f435=_0x468bc6?0x0:_0x32bb63[_0xc940('0x2d')];var _0x5558f6=_0x468bc6?_0x4c9359['count']:_0x32bb63[_0xc940('0x2d')]+_0x32bb63[_0xc940('0x2c')];var _0x57a414;if(_0x5558f6>=_0x528543){_0x5558f6=_0x528543;_0x57a414=0xc8;}else{_0x57a414=0xce;}_0x14419a[_0xc940('0x28')](_0x57a414);return _0x14419a[_0xc940('0x2e')](_0xc940('0x2f'),_0x56f435+'-'+_0x5558f6+'/'+_0x528543)['json'](_0x4c9359);}return null;};}function patchUpdates(_0x980d13){return function(_0x524118){try{jsonpatch[_0xc940('0x30')](_0x524118,_0x980d13,!![]);}catch(_0x208a47){return BPromise[_0xc940('0x31')](_0x208a47);}return _0x524118[_0xc940('0x32')]();};}function saveUpdates(_0x411bf3,_0x503d53){return function(_0xee974f){if(_0xee974f){return _0xee974f[_0xc940('0x33')](_0x411bf3)[_0xc940('0x1b')](function(_0x323e3a){return _0x323e3a;});}return null;};}function removeEntity(_0x459c20,_0x3c08df){return function(_0x56094f){if(_0x56094f){return _0x56094f['destroy']()['then'](function(){_0x459c20[_0xc940('0x28')](0xcc)[_0xc940('0x29')]();});}};}function handleEntityNotFound(_0xfb0d4e,_0x22289b){return function(_0x378586){if(!_0x378586){_0xfb0d4e[_0xc940('0x27')](0x194);}return _0x378586;};}function handleError(_0x46f4b5,_0x4bde34){_0x4bde34=_0x4bde34||0x1f4;return function(_0x23d7d9){logger[_0xc940('0x21')](_0x23d7d9[_0xc940('0x34')]);if(_0x23d7d9[_0xc940('0x35')]){delete _0x23d7d9[_0xc940('0x35')];}_0x46f4b5[_0xc940('0x28')](_0x4bde34)['send'](_0x23d7d9);};}exports[_0xc940('0x36')]=function(_0x12d30c,_0x88d30d){var _0x1d5652={},_0x531905={},_0x51badb={'count':0x0,'rows':[]};var _0x3e3a23=_[_0xc940('0x37')](db[_0xc940('0x38')][_0xc940('0x39')],function(_0x37e4d2){return{'name':_0x37e4d2['fieldName'],'type':_0x37e4d2['type'][_0xc940('0x3a')]};});_0x531905['model']=_['map'](_0x3e3a23,_0xc940('0x35'));_0x531905[_0xc940('0x3b')]=_[_0xc940('0x3c')](_0x12d30c['query']);_0x531905[_0xc940('0x3d')]=_[_0xc940('0x3e')](_0x531905[_0xc940('0x3f')],_0x531905[_0xc940('0x3b')]);_0x1d5652['attributes']=_['intersection'](_0x531905[_0xc940('0x3f')],qs[_0xc940('0x40')](_0x12d30c['query']['fields']));_0x1d5652['attributes']=_0x1d5652['attributes']['length']?_0x1d5652[_0xc940('0x41')]:_0x531905[_0xc940('0x3f')];if(!_0x12d30c[_0xc940('0x3b')][_0xc940('0x42')](_0xc940('0x43'))){_0x1d5652[_0xc940('0x2c')]=qs[_0xc940('0x2c')](_0x12d30c[_0xc940('0x3b')]['limit']);_0x1d5652[_0xc940('0x2d')]=qs['offset'](_0x12d30c[_0xc940('0x3b')]['offset']);}_0x1d5652[_0xc940('0x44')]=qs[_0xc940('0x45')](_0x12d30c[_0xc940('0x3b')][_0xc940('0x45')]);_0x1d5652[_0xc940('0x46')]=qs['filters'](_[_0xc940('0x47')](_0x12d30c[_0xc940('0x3b')],_0x531905[_0xc940('0x3d')]),_0x3e3a23);if(_0x12d30c[_0xc940('0x3b')][_0xc940('0x48')]){_0x1d5652[_0xc940('0x46')]=_['merge'](_0x1d5652['where'],{'$or':_['map'](_0x3e3a23,function(_0x25ff51){if(_0x25ff51[_0xc940('0x49')]!==_0xc940('0x4a')){var _0x2a6c6d={};_0x2a6c6d[_0x25ff51[_0xc940('0x35')]]={'$like':'%'+_0x12d30c[_0xc940('0x3b')][_0xc940('0x48')]+'%'};return _0x2a6c6d;}})});}_0x1d5652=_[_0xc940('0x4b')]({},_0x1d5652,_0x12d30c['options']);var _0x497974={'where':_0x1d5652[_0xc940('0x46')]};return db[_0xc940('0x38')][_0xc940('0x4c')](_0x497974)[_0xc940('0x1b')](function(_0x170056){_0x51badb['count']=_0x170056;if(_0x12d30c['query'][_0xc940('0x4d')]){_0x1d5652[_0xc940('0x4e')]=[{'all':!![]}];}return db[_0xc940('0x38')][_0xc940('0x4f')](_0x1d5652);})[_0xc940('0x1b')](function(_0x1cf98b){_0x51badb['rows']=_0x1cf98b;return _0x51badb;})[_0xc940('0x1b')](respondWithFilteredResult(_0x88d30d,_0x1d5652))[_0xc940('0x26')](handleError(_0x88d30d,null));};exports[_0xc940('0x50')]=function(_0x215c8b,_0x4cf223){var _0x39056e={'raw':!![],'where':{'id':_0x215c8b[_0xc940('0x51')]['id']}},_0x4a03a8={};_0x4a03a8[_0xc940('0x3f')]=_[_0xc940('0x3c')](db['FaxMessage'][_0xc940('0x39')]);_0x4a03a8[_0xc940('0x3b')]=_[_0xc940('0x3c')](_0x215c8b[_0xc940('0x3b')]);_0x4a03a8[_0xc940('0x3d')]=_[_0xc940('0x3e')](_0x4a03a8[_0xc940('0x3f')],_0x4a03a8[_0xc940('0x3b')]);_0x39056e[_0xc940('0x41')]=_[_0xc940('0x3e')](_0x4a03a8['model'],qs['fields'](_0x215c8b[_0xc940('0x3b')][_0xc940('0x40')]));_0x39056e[_0xc940('0x41')]=_0x39056e[_0xc940('0x41')][_0xc940('0x52')]?_0x39056e[_0xc940('0x41')]:_0x4a03a8[_0xc940('0x3f')];if(_0x215c8b[_0xc940('0x3b')]['includeAll']){_0x39056e['include']=[{'all':!![]}];}_0x39056e=_[_0xc940('0x4b')]({},_0x39056e,_0x215c8b[_0xc940('0x53')]);return db[_0xc940('0x38')][_0xc940('0x54')](_0x39056e)[_0xc940('0x1b')](handleEntityNotFound(_0x4cf223,null))[_0xc940('0x1b')](respondWithResult(_0x4cf223,null))['catch'](handleError(_0x4cf223,null));};exports[_0xc940('0x33')]=function(_0x435b5d,_0x503a16){if(_0x435b5d['body']['id']){delete _0x435b5d['body']['id'];}return db[_0xc940('0x38')]['find']({'where':{'id':_0x435b5d['params']['id']}})[_0xc940('0x1b')](handleEntityNotFound(_0x503a16,null))[_0xc940('0x1b')](saveUpdates(_0x435b5d[_0xc940('0x55')],null))['then'](respondWithResult(_0x503a16,null))['catch'](handleError(_0x503a16,null));};exports[_0xc940('0x56')]=function(_0x3613e2,_0x32bbb5){return db[_0xc940('0x38')][_0xc940('0x54')]({'where':{'id':_0x3613e2[_0xc940('0x51')]['id']}})[_0xc940('0x1b')](handleEntityNotFound(_0x32bbb5,null))[_0xc940('0x1b')](removeEntity(_0x32bbb5,null))[_0xc940('0x26')](handleError(_0x32bbb5,null));};exports[_0xc940('0x57')]=function(_0x3c546f,_0x4bed8f){return db['FaxMessage'][_0xc940('0x57')]()[_0xc940('0x1b')](respondWithResult(_0x4bed8f,null))['catch'](handleError(_0x4bed8f,null));};var interaction_log=require(_0xc940('0x10'))(_0xc940('0x58'));exports[_0xc940('0x59')]=function(_0x457840,_0x217cb2,_0x3ca6f4){var _0x5544d0={'agent':{},'channel':_0xc940('0x5a')};if(_0x457840['body']['id']){delete _0x457840['body']['id'];}_0x457840[_0xc940('0x55')][_0xc940('0x5b')]=!![];_0x457840[_0xc940('0x55')][_0xc940('0x5c')]=moment()[_0xc940('0x5d')](_0xc940('0x5e'));_0x457840[_0xc940('0x55')][_0xc940('0x5f')]=_0x457840[_0xc940('0x55')][_0xc940('0x5f')]||_0x457840[_0xc940('0x60')]['id'];_0x5544d0[_0xc940('0x61')]['id']=_0x457840[_0xc940('0x55')][_0xc940('0x5f')];return db[_0xc940('0x38')][_0xc940('0x54')]({'where':{'id':_0x457840[_0xc940('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x217cb2,null))['then'](saveUpdates(_0x457840[_0xc940('0x55')],null))[_0xc940('0x1b')](function(_0x5b187e){if(_0x5b187e){_0x5544d0[_0xc940('0x24')]=_0x5b187e[_0xc940('0x62')]({'plain':!![]});return db['FaxInteraction'][_0xc940('0x54')]({'where':{'id':_0x5b187e[_0xc940('0x63')]}});}return null;})[_0xc940('0x1b')](handleEntityNotFound(_0x217cb2,null))[_0xc940('0x1b')](function(_0x7faa41){if(_0x7faa41){return _0x7faa41['update']({'UserId':_0x457840[_0xc940('0x55')][_0xc940('0x5f')],'read1stAt':_['isNil'](_0x7faa41[_0xc940('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc940('0x1b')](function(_0x1dd6ca){if(_0x1dd6ca){_0x5544d0['interaction']=_0x1dd6ca['get']({'plain':!![]});interaction_log['info'](_0xc940('0x65'),_0x457840['user']['id'],_0x457840[_0xc940('0x60')]['name'],_0x457840[_0xc940('0x60')][_0xc940('0x66')],_0x5544d0[_0xc940('0x67')]['id'],_0x457840['body']?JSON['stringify'](_0x457840[_0xc940('0x55')]):_0xc940('0x68'));return respondWithRpcPromise(_0xc940('0x69'),_0xc940('0x6a'),_0x5544d0);}return null;})['then'](function(_0x244f0e){var _0x5b713d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x244f0e[_0xc940('0x24')][_0xc940('0x6b')];return db[_0xc940('0x6c')]['query'](_0x5b713d,{'type':db[_0xc940('0x6d')][_0xc940('0x6e')][_0xc940('0x6f')],'raw':!![]})[_0xc940('0x1b')](function(_0x4c5870){return _0x4c5870;});})[_0xc940('0x1b')](function(_0x12d3d7){if(_0x12d3d7){_0x5544d0['message'][_0xc940('0x70')]=_0x12d3d7[0x0];if(!_0x457840[_0xc940('0x55')][_0xc940('0x5f')])return;return db[_0xc940('0x71')][_0xc940('0x54')]({'where':{'id':_0x457840[_0xc940('0x55')][_0xc940('0x5f')],'role':_0xc940('0x61')},'attributes':['id',_0xc940('0x35'),_0xc940('0x72'),_0xc940('0x73'),_0xc940('0x74')],'raw':!![]});}return null;})['then'](function(_0x7b8a23){if(!_0x7b8a23)return null;_0x5544d0[_0xc940('0x24')]['agent']=_0x7b8a23;return _0x5544d0;})[_0xc940('0x1b')](function(_0x245523){if(_0x245523){if(_0x457840[_0xc940('0x55')][_0xc940('0x75')]){_0x5544d0[_0xc940('0x24')][_0xc940('0x76')]=util[_0xc940('0x5d')](_0xc940('0x77'),_0x457840[_0xc940('0x60')][_0xc940('0x35')]);_0x5544d0['message'][_0xc940('0x78')]=_0x5544d0[_0xc940('0x78')];_0x5544d0['message'][_0xc940('0x79')]=_0x5544d0[_0xc940('0x78')];_0x5544d0[_0xc940('0x24')][_0xc940('0x7a')]=_0xc940('0x59');return respondWithRpcPromise('EventManager',_0xc940('0x7b'),{'event':_0xc940('0x7c'),'message':_0x5544d0[_0xc940('0x24')]},client9002)[_0xc940('0x1b')](function(){return _0x5544d0;});}return _0x5544d0;}return null;})[_0xc940('0x1b')](respondWithResult(_0x217cb2,null))['catch'](handleError(_0x217cb2,null));};var interaction_log=require(_0xc940('0x10'))(_0xc940('0x58'));exports[_0xc940('0x31')]=function(_0x447dcc,_0x352086,_0x438703){var _0x5cc54d={'agent':{},'channel':_0xc940('0x5a')};if(_0x447dcc[_0xc940('0x55')]['id']){delete _0x447dcc[_0xc940('0x55')]['id'];}_0x447dcc['body']['UserId']=_0x447dcc[_0xc940('0x55')]['UserId']||_0x447dcc[_0xc940('0x60')]['id'];_0x5cc54d[_0xc940('0x61')]['id']=_0x447dcc[_0xc940('0x55')][_0xc940('0x5f')];return db['FaxMessage'][_0xc940('0x54')]({'where':{'id':_0x447dcc[_0xc940('0x51')]['id'],'UserId':null}})[_0xc940('0x1b')](handleEntityNotFound(_0x352086,null))[_0xc940('0x1b')](function(_0x285d2c){if(_0x285d2c){_0x5cc54d[_0xc940('0x24')]=_0x285d2c['get']({'plain':!![]});return db[_0xc940('0x7d')][_0xc940('0x54')]({'where':{'id':_0x285d2c['FaxInteractionId']}});}return null;})[_0xc940('0x1b')](handleEntityNotFound(_0x352086,null))[_0xc940('0x1b')](function(_0x4e7bdf){if(_0x4e7bdf){_0x5cc54d[_0xc940('0x67')]=_0x4e7bdf[_0xc940('0x62')]({'plain':!![]});interaction_log[_0xc940('0x1c')](_0xc940('0x7e'),_0x447dcc[_0xc940('0x60')]['id'],_0x447dcc[_0xc940('0x60')]['name'],_0x447dcc[_0xc940('0x60')][_0xc940('0x66')],_0x5cc54d['interaction']['id'],_0x447dcc[_0xc940('0x55')]?JSON['stringify'](_0x447dcc[_0xc940('0x55')]):_0xc940('0x68'));return respondWithRpcPromise(_0xc940('0x7f'),_0xc940('0x80'),_0x5cc54d);}return null;})[_0xc940('0x1b')](function(_0x4334c5){var _0x34a296=_0xc940('0x81')+_0x4334c5['message']['ContactId'];return db[_0xc940('0x6c')][_0xc940('0x3b')](_0x34a296,{'type':db[_0xc940('0x6d')][_0xc940('0x6e')][_0xc940('0x6f')],'raw':!![]})['then'](function(_0x3fc6ee){return _0x3fc6ee;});})[_0xc940('0x1b')](function(_0x5d0963){if(_0x5d0963){_0x5cc54d[_0xc940('0x24')]['contact']=_0x5d0963[0x0];if(!_0x447dcc[_0xc940('0x55')][_0xc940('0x5f')])return;return db[_0xc940('0x71')][_0xc940('0x54')]({'where':{'id':_0x447dcc[_0xc940('0x55')][_0xc940('0x5f')],'role':_0xc940('0x61')},'attributes':['id','name',_0xc940('0x72'),_0xc940('0x73'),_0xc940('0x74')],'raw':!![]});}return null;})[_0xc940('0x1b')](function(_0x13ebc7){if(!_0x13ebc7)return null;_0x5cc54d['message'][_0xc940('0x61')]=_0x13ebc7;return _0x5cc54d;})['then'](function(_0x1d7f26){if(_0x1d7f26){_0x1d7f26[_0xc940('0x24')][_0xc940('0x76')]=util['format'](_0xc940('0x77'),_0x447dcc[_0xc940('0x60')]['name']);_0x1d7f26[_0xc940('0x24')][_0xc940('0x78')]=_0x5cc54d['channel'];_0x1d7f26[_0xc940('0x24')][_0xc940('0x79')]=_0x5cc54d['channel'];_0x1d7f26[_0xc940('0x24')]['event']=_0xc940('0x31');respondWithRpcPromise(_0xc940('0x7b'),_0xc940('0x7b'),{'event':'rejectmessage','message':_0x1d7f26[_0xc940('0x24')]},client9002);return _0x5cc54d;}return null;})['then'](respondWithResult(_0x352086,null))[_0xc940('0x26')](handleError(_0x352086,null));};exports[_0xc940('0x82')]=function(_0x487ec3,_0x22fe83){var _0x4c2a4c;return db[_0xc940('0x38')]['create'](_0x487ec3['body'],{})['then'](function(_0x438769){_0x4c2a4c=_0x438769;return db[_0xc940('0x83')]['findOne']({'where':{'id':_0x4c2a4c[_0xc940('0x6b')]}});})[_0xc940('0x1b')](function(_0x29b03c){if(_[_0xc940('0x84')](_0x29b03c)){return;}else{_0x4c2a4c[_0xc940('0x5a')]=_0x29b03c[_0xc940('0x5a')];return db['Attachment']['findOne']({'where':{'id':_0x4c2a4c[_0xc940('0x85')]}});}})[_0xc940('0x1b')](function(_0x3de55d){return respondWithRpcPromise('SendFax',_0xc940('0x86'),{'FaxAccountId':_['isNil'](_0x487ec3[_0xc940('0x55')])?undefined:_0x487ec3[_0xc940('0x55')][_0xc940('0x87')],'path':_[_0xc940('0x84')](_0x3de55d)?undefined:util[_0xc940('0x5d')]('/var/opt/motion2/server/files/attachments/%s',_0x3de55d[_0xc940('0x88')]),'fax':_[_0xc940('0x84')](_0x4c2a4c[_0xc940('0x5a')])?undefined:_0x4c2a4c[_0xc940('0x5a')],'AttachmentId':_0x4c2a4c[_0xc940('0x85')]},client9002);})[_0xc940('0x1b')](respondWithResult(_0x22fe83,0xc9))[_0xc940('0x26')](handleError(_0x22fe83,null));};exports['download']=function(_0x387e16,_0x197ef3){var _0x146145=path[_0xc940('0x89')](config['root'],'server',_0xc940('0x8a'),_0xc940('0x8b'));return db[_0xc940('0x38')][_0xc940('0x54')]({'where':{'id':_0x387e16['params']['id']},'include':[{'model':db[_0xc940('0x8c')],'as':_0xc940('0x8c')}]})[_0xc940('0x1b')](handleEntityNotFound(_0x197ef3,null))[_0xc940('0x1b')](function(_0x189a29){if(_0x189a29){return _0x197ef3['download'](path[_0xc940('0x89')](_0x146145,_0x189a29['Attachment']['basename']));}})[_0xc940('0x26')](handleError(_0x197ef3,null));};
\ No newline at end of file
index 9545ac2..9aff860 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b64=['setMaxListeners','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x3a24b8,_0x1b7651){var _0x502dd8=function(_0x227756){while(--_0x227756){_0x3a24b8['push'](_0x3a24b8['shift']());}};_0x502dd8(++_0x1b7651);}(_0x1b64,0x76));var _0x41b6=function(_0xd7eae5,_0x4b0c0b){_0xd7eae5=_0xd7eae5-0x0;var _0x2c24d3=_0x1b64[_0xd7eae5];return _0x2c24d3;};'use strict';var EventEmitter=require(_0x41b6('0x0'));var FaxMessage=require(_0x41b6('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x41b6('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3204fe){return function(_0x1f979b,_0xd38c24,_0x19f577){FaxMessageEvents['emit'](_0x3204fe+':'+_0x1f979b['id'],_0x1f979b);FaxMessageEvents[_0x41b6('0x3')](_0x3204fe,_0x1f979b);_0x19f577(null);};}for(var e in events){if(events[_0x41b6('0x4')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0xb7f0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x184f59,_0x5815cc){var _0x2b01bc=function(_0x33f8ec){while(--_0x33f8ec){_0x184f59['push'](_0x184f59['shift']());}};_0x2b01bc(++_0x5815cc);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x5d4db8,_0x4ad01b){_0x5d4db8=_0x5d4db8-0x0;var _0x415548=_0xb7f0[_0x5d4db8];return _0x415548;};'use strict';var EventEmitter=require(_0x0b7f('0x0'));var FaxMessage=require(_0x0b7f('0x1'))['db'][_0x0b7f('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x0b7f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0b7f('0x4')};function emitEvent(_0xa1285e){return function(_0x228377,_0x188ea8,_0x34e188){FaxMessageEvents[_0x0b7f('0x5')](_0xa1285e+':'+_0x228377['id'],_0x228377);FaxMessageEvents[_0x0b7f('0x5')](_0xa1285e,_0x228377);_0x34e188(null);};}for(var e in events){if(events[_0x0b7f('0x6')](e)){var event=events[e];FaxMessage[_0x0b7f('0x7')](e,emitEvent(event));}}module[_0x0b7f('0x8')]=FaxMessageEvents;
\ No newline at end of file
index fb038ff..aaf630d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e8b=['then','update','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','models','direction','toLowerCase','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x170bba,_0x2be92f){var _0xa7c249=function(_0x2b6505){while(--_0x2b6505){_0x170bba['push'](_0x170bba['shift']());}};_0xa7c249(++_0x2be92f);}(_0x8e8b,0xad));var _0xb8e8=function(_0x38b7d2,_0x583aab){_0x38b7d2=_0x38b7d2-0x0;var _0x80e337=_0x8e8b[_0x38b7d2];return _0x80e337;};'use strict';var _=require(_0xb8e8('0x0'));var util=require(_0xb8e8('0x1'));var logger=require(_0xb8e8('0x2'))(_0xb8e8('0x3'));var moment=require('moment');var BPromise=require(_0xb8e8('0x4'));var rp=require(_0xb8e8('0x5'));var fs=require('fs');var path=require(_0xb8e8('0x6'));var rimraf=require(_0xb8e8('0x7'));var config=require(_0xb8e8('0x8'));var attributes=require(_0xb8e8('0x9'));module[_0xb8e8('0xa')]=function(_0x2f1449,_0x56a121){return _0x2f1449['define'](_0xb8e8('0xb'),attributes,{'tableName':_0xb8e8('0xc'),'paranoid':![],'indexes':[{'name':_0xb8e8('0xd'),'fields':[_0xb8e8('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x299d68,_0x5cdb0f,_0xab3440){var _0x1e09cf=_0x2f1449[_0xb8e8('0xf')];var _0x292928=_0x299d68['get']({'plain':!![]});if(_0x292928[_0xb8e8('0x10')]['toLowerCase']()==='in'||_0x292928[_0xb8e8('0x10')][_0xb8e8('0x11')]()==='out'&&!_0x292928['secret']&&!_[_0xb8e8('0x12')](_0x292928[_0xb8e8('0x13')])){_0x1e09cf[_0xb8e8('0x14')][_0xb8e8('0x15')]({'where':{'id':_0x292928[_0xb8e8('0x16')]}})[_0xb8e8('0x17')](function(_0x3fed32){if(_0x3fed32){_0x3fed32[_0xb8e8('0x18')]({'lastMsgAt':_0x292928[_0xb8e8('0x19')],'lastMsgDirection':_0x292928['direction']['toLowerCase']()});}})[_0xb8e8('0x1a')](function(_0x3e12de){console['error'](_0x3e12de);});}_0xab3440();}},'charset':_0xb8e8('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0660=['bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','FaxInteraction','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment'];(function(_0x229c57,_0x5eecbe){var _0x7bf8de=function(_0x33ca4e){while(--_0x33ca4e){_0x229c57['push'](_0x229c57['shift']());}};_0x7bf8de(++_0x5eecbe);}(_0x0660,0xf0));var _0x0066=function(_0x5540be,_0x55841d){_0x5540be=_0x5540be-0x0;var _0x15c0dc=_0x0660[_0x5540be];return _0x15c0dc;};'use strict';var _=require('lodash');var util=require(_0x0066('0x0'));var logger=require(_0x0066('0x1'))('api');var moment=require(_0x0066('0x2'));var BPromise=require(_0x0066('0x3'));var rp=require(_0x0066('0x4'));var fs=require('fs');var path=require(_0x0066('0x5'));var rimraf=require(_0x0066('0x6'));var config=require(_0x0066('0x7'));var attributes=require(_0x0066('0x8'));module[_0x0066('0x9')]=function(_0xab713,_0x5025ae){return _0xab713[_0x0066('0xa')]('FaxMessage',attributes,{'tableName':_0x0066('0xb'),'paranoid':![],'indexes':[{'name':_0x0066('0xc'),'fields':[_0x0066('0xd')],'type':_0x0066('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4375a3,_0x18d7b2,_0x528c1c){var _0x577976=_0xab713['models'];var _0x3796f2=_0x4375a3[_0x0066('0xf')]({'plain':!![]});if(_0x3796f2[_0x0066('0x10')][_0x0066('0x11')]()==='in'||_0x3796f2[_0x0066('0x10')][_0x0066('0x11')]()===_0x0066('0x12')&&!_0x3796f2['secret']&&!_[_0x0066('0x13')](_0x3796f2['UserId'])){_0x577976[_0x0066('0x14')]['findOne']({'where':{'id':_0x3796f2['FaxInteractionId']}})[_0x0066('0x15')](function(_0x59d0e5){if(_0x59d0e5){_0x59d0e5[_0x0066('0x16')]({'lastMsgAt':_0x3796f2[_0x0066('0x17')],'lastMsgDirection':_0x3796f2[_0x0066('0x10')][_0x0066('0x11')]()});}})[_0x0066('0x18')](function(_0xdce864){console['error'](_0xdce864);});}_0x528c1c();}},'charset':_0x0066('0x19'),'collate':_0x0066('0x1a')});};
\ No newline at end of file
index 81953b6..da6c41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bae=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxMessage,\x20%s,\x20%s','create','body','options','raw','CreateFaxMessage','debug','FaxMessage','update','where','limit','UpdateFaxMessage','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','request','then','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bae,0x13b));var _0xe7ba=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x7bae[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7ba('0x0'));var BPromise=require(_0xe7ba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ba('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe7ba('0x3'));var logger=require(_0xe7ba('0x4'))(_0xe7ba('0x5'));var config=require(_0xe7ba('0x6'));var jayson=require(_0xe7ba('0x7'));var client=jayson[_0xe7ba('0x8')][_0xe7ba('0x9')]({'port':0x232a});config[_0xe7ba('0xa')]=_[_0xe7ba('0xb')](config[_0xe7ba('0xa')],{'host':_0xe7ba('0xc'),'port':0x18eb});var socket=require(_0xe7ba('0xd'))(new Redis(config[_0xe7ba('0xa')]));require(_0xe7ba('0xe'))['register'](socket);function respondWithRpcPromise(_0x3df8bf,_0xe57e33,_0x375ebb){return new BPromise(function(_0x276bc3,_0x15083a){return client[_0xe7ba('0xf')](_0x3df8bf,_0x375ebb)[_0xe7ba('0x10')](function(_0x448bcc){logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0xe7ba('0x12'));logger['debug'](_0xe7ba('0x13'),_0xe57e33,_0xe7ba('0x12'),JSON[_0xe7ba('0x14')](_0x448bcc));if(_0x448bcc[_0xe7ba('0x15')]){if(_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc[_0xe7ba('0x15')][_0xe7ba('0x17')]);return _0x15083a(_0x448bcc[_0xe7ba('0x15')]['message']);}logger[_0xe7ba('0x15')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,_0x448bcc['error']['message']);return _0x276bc3(_0x448bcc[_0xe7ba('0x15')]['message']);}else{logger[_0xe7ba('0x11')]('FaxMessage,\x20%s,\x20%s',_0xe57e33,'request\x20sent');_0x276bc3(_0x448bcc['result'][_0xe7ba('0x17')]);}})[_0xe7ba('0x18')](function(_0x39ca38){logger[_0xe7ba('0x15')](_0xe7ba('0x19'),_0xe57e33,_0x39ca38);_0x15083a(_0x39ca38);});});}exports['CreateFaxMessage']=function(_0x149c62){var _0x20c653=this;return new Promise(function(_0x3b40fb,_0x136ec6){return db['FaxMessage'][_0xe7ba('0x1a')](_0x149c62[_0xe7ba('0x1b')],{'raw':_0x149c62['options']?_0x149c62[_0xe7ba('0x1c')][_0xe7ba('0x1d')]===undefined?!![]:![]:!![]})[_0xe7ba('0x10')](function(_0x7ab9e4){logger[_0xe7ba('0x11')](_0xe7ba('0x1e'),_0x149c62);logger[_0xe7ba('0x1f')](_0xe7ba('0x1e'),_0x149c62,JSON[_0xe7ba('0x14')](_0x7ab9e4));_0x3b40fb(_0x7ab9e4);})[_0xe7ba('0x18')](function(_0x58cf43){logger['error']('CreateFaxMessage',_0x58cf43['message'],_0x149c62);_0x136ec6(_0x20c653[_0xe7ba('0x15')](0x1f4,_0x58cf43['message']));});});};exports['UpdateFaxMessage']=function(_0x5ece11){var _0x255def=this;return new Promise(function(_0x32cc00,_0xe32862){return db[_0xe7ba('0x20')][_0xe7ba('0x21')](_0x5ece11[_0xe7ba('0x1b')],{'raw':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11['options'][_0xe7ba('0x22')]||null:null,'attributes':_0x5ece11[_0xe7ba('0x1c')]?_0x5ece11[_0xe7ba('0x1c')]['attributes']||null:null,'limit':_0x5ece11['options']?_0x5ece11[_0xe7ba('0x1c')][_0xe7ba('0x23')]||null:null})[_0xe7ba('0x10')](function(_0x20b6cd){logger[_0xe7ba('0x11')]('UpdateFaxMessage',_0x5ece11);logger[_0xe7ba('0x1f')](_0xe7ba('0x24'),_0x5ece11,JSON['stringify'](_0x20b6cd));_0x32cc00(_0x20b6cd);})[_0xe7ba('0x18')](function(_0x530227){logger['error'](_0xe7ba('0x24'),_0x530227[_0xe7ba('0x17')],_0x5ece11);_0xe32862(_0x255def[_0xe7ba('0x15')](0x1f4,_0x530227['message']));});});};
\ No newline at end of file
+var _0x5fd1=['debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxMessage','FaxMessage','create','body','raw','catch','UpdateFaxMessage','options','where','attributes','limit','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5fd1,0x155));var _0x15fd=function(_0x39cbd,_0x3fc63c){_0x39cbd=_0x39cbd-0x0;var _0x8d8414=_0x5fd1[_0x39cbd];return _0x8d8414;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});config[_0x15fd('0xa')]=_[_0x15fd('0xb')](config['redis'],{'host':_0x15fd('0xc'),'port':0x18eb});var socket=require(_0x15fd('0xd'))(new Redis(config[_0x15fd('0xa')]));require('./faxMessage.socket')[_0x15fd('0xe')](socket);function respondWithRpcPromise(_0x5c9c63,_0x3dfdbb,_0x250457){return new BPromise(function(_0x4c226a,_0x4883fd){return client['request'](_0x5c9c63,_0x250457)[_0x15fd('0xf')](function(_0x2a4d55){logger[_0x15fd('0x10')](_0x15fd('0x11'),_0x3dfdbb,_0x15fd('0x12'));logger[_0x15fd('0x13')](_0x15fd('0x14'),_0x3dfdbb,_0x15fd('0x12'),JSON[_0x15fd('0x15')](_0x2a4d55));if(_0x2a4d55['error']){if(_0x2a4d55['error']['code']===0x1f4){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);return _0x4883fd(_0x2a4d55[_0x15fd('0x16')][_0x15fd('0x17')]);}logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x2a4d55['error']['message']);return _0x4c226a(_0x2a4d55[_0x15fd('0x16')]['message']);}else{logger[_0x15fd('0x10')]('FaxMessage,\x20%s,\x20%s',_0x3dfdbb,_0x15fd('0x12'));_0x4c226a(_0x2a4d55[_0x15fd('0x18')][_0x15fd('0x17')]);}})['catch'](function(_0x367c36){logger[_0x15fd('0x16')](_0x15fd('0x11'),_0x3dfdbb,_0x367c36);_0x4883fd(_0x367c36);});});}exports[_0x15fd('0x19')]=function(_0x2fb919){var _0x36a90e=this;return new Promise(function(_0x3761db,_0x2f46f1){return db[_0x15fd('0x1a')][_0x15fd('0x1b')](_0x2fb919[_0x15fd('0x1c')],{'raw':_0x2fb919['options']?_0x2fb919['options'][_0x15fd('0x1d')]===undefined?!![]:![]:!![]})[_0x15fd('0xf')](function(_0x252a1c){logger[_0x15fd('0x10')](_0x15fd('0x19'),_0x2fb919);logger[_0x15fd('0x13')](_0x15fd('0x19'),_0x2fb919,JSON['stringify'](_0x252a1c));_0x3761db(_0x252a1c);})[_0x15fd('0x1e')](function(_0x2d19ac){logger[_0x15fd('0x16')]('CreateFaxMessage',_0x2d19ac[_0x15fd('0x17')],_0x2fb919);_0x2f46f1(_0x36a90e['error'](0x1f4,_0x2d19ac[_0x15fd('0x17')]));});});};exports[_0x15fd('0x1f')]=function(_0x21601d){var _0x4c9708=this;return new Promise(function(_0x16b87c,_0x1cbf2c){return db[_0x15fd('0x1a')]['update'](_0x21601d[_0x15fd('0x1c')],{'raw':_0x21601d['options']?_0x21601d[_0x15fd('0x20')][_0x15fd('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x21')]||null:null,'attributes':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x22')]||null:null,'limit':_0x21601d[_0x15fd('0x20')]?_0x21601d[_0x15fd('0x20')][_0x15fd('0x23')]||null:null})['then'](function(_0x47c22c){logger[_0x15fd('0x10')]('UpdateFaxMessage',_0x21601d);logger[_0x15fd('0x13')](_0x15fd('0x1f'),_0x21601d,JSON['stringify'](_0x47c22c));_0x16b87c(_0x47c22c);})[_0x15fd('0x1e')](function(_0x197d15){logger['error'](_0x15fd('0x1f'),_0x197d15[_0x15fd('0x17')],_0x21601d);_0x1cbf2c(_0x4c9708[_0x15fd('0x16')](0x1f4,_0x197d15[_0x15fd('0x17')]));});});};
\ No newline at end of file
index 9ad4029..8f35a36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb944=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','update','emit'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xb944,0xca));var _0x4b94=function(_0xf4fee8,_0x5951ce){_0xf4fee8=_0xf4fee8-0x0;var _0x1303d7=_0xb944[_0xf4fee8];return _0x1303d7;};'use strict';var FaxMessageEvents=require(_0x4b94('0x0'));var events=[_0x4b94('0x1'),_0x4b94('0x2'),_0x4b94('0x3')];function createListener(_0x54470f,_0x215149){return function(_0x32047d){_0x215149[_0x4b94('0x4')](_0x54470f,_0x32047d);};}function removeListener(_0x45d3d6,_0x43aaa1){return function(){FaxMessageEvents[_0x4b94('0x5')](_0x45d3d6,_0x43aaa1);};}exports[_0x4b94('0x6')]=function(_0x44661d){for(var _0x4ba9ea=0x0,_0x2c9459=events[_0x4b94('0x7')];_0x4ba9ea<_0x2c9459;_0x4ba9ea++){var _0x301db0=events[_0x4ba9ea];var _0x3d851d=createListener(_0x4b94('0x8')+_0x301db0,_0x44661d);FaxMessageEvents['on'](_0x301db0,_0x3d851d);}};
\ No newline at end of file
+var _0x12e2=['./faxMessage.events','save','remove','update','emit','length'];(function(_0x59098e,_0x4f5ada){var _0x28833a=function(_0x4e059e){while(--_0x4e059e){_0x59098e['push'](_0x59098e['shift']());}};_0x28833a(++_0x4f5ada);}(_0x12e2,0xcc));var _0x212e=function(_0x3342ef,_0x13fda4){_0x3342ef=_0x3342ef-0x0;var _0x386571=_0x12e2[_0x3342ef];return _0x386571;};'use strict';var FaxMessageEvents=require(_0x212e('0x0'));var events=[_0x212e('0x1'),_0x212e('0x2'),_0x212e('0x3')];function createListener(_0x180cf0,_0x73e556){return function(_0x28f70a){_0x73e556[_0x212e('0x4')](_0x180cf0,_0x28f70a);};}function removeListener(_0x1fd36a,_0xbeb464){return function(){FaxMessageEvents['removeListener'](_0x1fd36a,_0xbeb464);};}exports['register']=function(_0x2eb045){for(var _0x4cb999=0x0,_0x2650e9=events[_0x212e('0x5')];_0x4cb999<_0x2650e9;_0x4cb999++){var _0x2e067f=events[_0x4cb999];var _0x2286be=createListener('faxMessage:'+_0x2e067f,_0x2eb045);FaxMessageEvents['on'](_0x2e067f,_0x2286be);}};
\ No newline at end of file
index e555971..425a717 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f8=['../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','/:id','/:id/download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','/:id/reject','reject','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x57f8,0x198));var _0x857f=function(_0x555ef8,_0x43e041){_0x555ef8=_0x555ef8-0x0;var _0x38cc30=_0x57f8[_0x555ef8];return _0x38cc30;};'use strict';var multer=require('multer');var util=require(_0x857f('0x0'));var path=require(_0x857f('0x1'));var timeout=require(_0x857f('0x2'));var express=require(_0x857f('0x3'));var router=express[_0x857f('0x4')]();var fs_extra=require(_0x857f('0x5'));var auth=require(_0x857f('0x6'));var interaction=require(_0x857f('0x7'));var config=require(_0x857f('0x8'));var controller=require(_0x857f('0x9'));router[_0x857f('0xa')]('/',auth[_0x857f('0xb')](),controller['index']);router[_0x857f('0xa')](_0x857f('0xc'),auth[_0x857f('0xb')](),controller['describe']);router[_0x857f('0xa')](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['show']);router[_0x857f('0xa')](_0x857f('0xe'),auth[_0x857f('0xb')](),controller['download']);router[_0x857f('0xf')]('/',auth[_0x857f('0xb')](),interaction[_0x857f('0x10')](_0x857f('0x11'),_0x857f('0x12')),controller[_0x857f('0x13')]);router[_0x857f('0x14')]('/:id',auth[_0x857f('0xb')](),controller[_0x857f('0x15')]);router[_0x857f('0x14')](_0x857f('0x16'),auth[_0x857f('0xb')](),controller['accept']);router['put'](_0x857f('0x17'),auth['isAuthenticated'](),controller[_0x857f('0x18')]);router['delete'](_0x857f('0xd'),auth[_0x857f('0xb')](),controller['destroy']);module[_0x857f('0x19')]=router;
\ No newline at end of file
+var _0xca66=['faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','tracked','fax'];(function(_0x220b13,_0x949610){var _0x5283e5=function(_0x2e0b40){while(--_0x2e0b40){_0x220b13['push'](_0x220b13['shift']());}};_0x5283e5(++_0x949610);}(_0xca66,0x8b));var _0x6ca6=function(_0x2c13c7,_0x11f488){_0x2c13c7=_0x2c13c7-0x0;var _0x4a6a45=_0xca66[_0x2c13c7];return _0x4a6a45;};'use strict';var multer=require(_0x6ca6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ca6('0x1'));var express=require(_0x6ca6('0x2'));var router=express[_0x6ca6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6ca6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6ca6('0x5'));var controller=require('./faxMessage.controller');router[_0x6ca6('0x6')]('/',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x8')]);router[_0x6ca6('0x6')](_0x6ca6('0x9'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xa')]);router['get'](_0x6ca6('0xb'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xc')]);router[_0x6ca6('0x6')](_0x6ca6('0xd'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0xe')]);router['post']('/',auth[_0x6ca6('0x7')](),interaction[_0x6ca6('0xf')](_0x6ca6('0x10'),_0x6ca6('0x11')),controller[_0x6ca6('0x12')]);router[_0x6ca6('0x13')]('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x14')]);router['put'](_0x6ca6('0x15'),auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x16')]);router[_0x6ca6('0x13')](_0x6ca6('0x17'),auth[_0x6ca6('0x7')](),controller['reject']);router['delete']('/:id',auth[_0x6ca6('0x7')](),controller[_0x6ca6('0x18')]);module[_0x6ca6('0x19')]=router;
\ No newline at end of file
index e4e4ab7..bd50669 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ecc=['roundrobin','exports','STRING','INTEGER','beepall'];(function(_0x2b6c1f,_0x397f69){var _0xac16cc=function(_0x43d13c){while(--_0x43d13c){_0x2b6c1f['push'](_0x2b6c1f['shift']());}};_0xac16cc(++_0x397f69);}(_0x0ecc,0x146));var _0xc0ec=function(_0x556117,_0x21bfa3){_0x556117=_0x556117-0x0;var _0x4a68c3=_0x0ecc[_0x556117];return _0x4a68c3;};'use strict';var Sequelize=require('sequelize');module[_0xc0ec('0x0')]={'name':{'type':Sequelize[_0xc0ec('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc0ec('0x2')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xc0ec('0x3'),_0xc0ec('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc0ec('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5c21=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x15c2('0x0')]={'name':{'type':Sequelize[_0x15c2('0x1')],'unique':_0x15c2('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x15c2('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x15c2('0x3')](_0x15c2('0x4'),_0x15c2('0x5'),_0x15c2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x15c2('0x7')],'defaultValue':0x0}};
\ No newline at end of file
index ae462b8..2726c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x111f=['findOne','UserFaxQueue','FaxQueueId','findAndCountAll','agent','faxPause','updatedAt','format','SIP','getTeams','Team','pick','addTeams','ids','User','Agents','voicePause','interface','transaction','findOrCreate','forEach','userFaxQueue:save','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./faxQueue.socket','register','sendStatus','end','status','json','offset','undefined','count','Content-Range','apply','update','destroy','then','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','where','VIRTUAL','filter','merge','options','include','findAll','rows','catch','show','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0x111f,0x13d));var _0xf111=function(_0xcc29d8,_0xc7363f){_0xcc29d8=_0xcc29d8-0x0;var _0x59667c=_0x111f[_0xcc29d8];return _0x59667c;};'use strict';var emlformat=require(_0xf111('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf111('0x1'));var jsonpatch=require(_0xf111('0x2'));var rp=require('request-promise');var moment=require(_0xf111('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf111('0x4'));var util=require(_0xf111('0x5'));var path=require('path');var sox=require(_0xf111('0x6'));var csv=require(_0xf111('0x7'));var ejs=require(_0xf111('0x8'));var fs=require('fs');var fs_extra=require(_0xf111('0x9'));var _=require(_0xf111('0xa'));var squel=require(_0xf111('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf111('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf111('0xd'));var Papa=require('papaparse');var Redis=require(_0xf111('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf111('0xf'));var as=require(_0xf111('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf111('0x11'));var db=require(_0xf111('0x12'))['db'];config['redis']=_[_0xf111('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf111('0x14'))(new Redis(config[_0xf111('0x15')]));require(_0xf111('0x16'))[_0xf111('0x17')](socket);function respondWithStatusCode(_0x4e6a3f,_0x20e942){_0x20e942=_0x20e942||0xcc;return function(_0x5ddc2e){if(_0x5ddc2e){return _0x4e6a3f[_0xf111('0x18')](_0x20e942);}return _0x4e6a3f['status'](_0x20e942)[_0xf111('0x19')]();};}function respondWithResult(_0x4b56b,_0x29f97b){_0x29f97b=_0x29f97b||0xc8;return function(_0x1f534a){if(_0x1f534a){return _0x4b56b[_0xf111('0x1a')](_0x29f97b)[_0xf111('0x1b')](_0x1f534a);}};}function respondWithFilteredResult(_0x4dba81,_0x3ac532){return function(_0x269b48){if(_0x269b48){var _0x4bb463=typeof _0x3ac532[_0xf111('0x1c')]===_0xf111('0x1d')&&typeof _0x3ac532['limit']===_0xf111('0x1d');var _0x3896f7=_0x269b48['count'];var _0x33fe82=_0x4bb463?0x0:_0x3ac532[_0xf111('0x1c')];var _0x28eec0=_0x4bb463?_0x269b48[_0xf111('0x1e')]:_0x3ac532[_0xf111('0x1c')]+_0x3ac532['limit'];var _0x4f98b7;if(_0x28eec0>=_0x3896f7){_0x28eec0=_0x3896f7;_0x4f98b7=0xc8;}else{_0x4f98b7=0xce;}_0x4dba81[_0xf111('0x1a')](_0x4f98b7);return _0x4dba81['set'](_0xf111('0x1f'),_0x33fe82+'-'+_0x28eec0+'/'+_0x3896f7)['json'](_0x269b48);}return null;};}function patchUpdates(_0x13a46a){return function(_0x3229d1){try{jsonpatch[_0xf111('0x20')](_0x3229d1,_0x13a46a,!![]);}catch(_0x553659){return BPromise['reject'](_0x553659);}return _0x3229d1['save']();};}function saveUpdates(_0x3102cf,_0x53d5e9){return function(_0x49315b){if(_0x49315b){return _0x49315b[_0xf111('0x21')](_0x3102cf)['then'](function(_0x44ee47){return _0x44ee47;});}return null;};}function removeEntity(_0x47543a,_0x24ea52){return function(_0x4c965c){if(_0x4c965c){return _0x4c965c[_0xf111('0x22')]()[_0xf111('0x23')](function(){var _0x348e9f=_0x4c965c[_0xf111('0x24')]({'plain':!![]});var _0x3f9a0a=_0xf111('0x25');return db[_0xf111('0x26')][_0xf111('0x22')]({'where':{'type':_0x3f9a0a,'resourceId':_0x348e9f['id']}})[_0xf111('0x23')](function(){return _0x4c965c;});})['then'](function(){_0x47543a[_0xf111('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x102c07,_0x404123){return function(_0x5a24ae){if(!_0x5a24ae){_0x102c07['sendStatus'](0x194);}return _0x5a24ae;};}function handleError(_0x461553,_0x43ba7e){_0x43ba7e=_0x43ba7e||0x1f4;return function(_0x4f4f6a){logger[_0xf111('0x27')](_0x4f4f6a[_0xf111('0x28')]);if(_0x4f4f6a[_0xf111('0x29')]){delete _0x4f4f6a[_0xf111('0x29')];}_0x461553[_0xf111('0x1a')](_0x43ba7e)['send'](_0x4f4f6a);};}exports[_0xf111('0x2a')]=function(_0x565cd5,_0x4c1a3f){var _0x354b25={},_0x4e3f87={},_0x44773a={'count':0x0,'rows':[]};var _0x279ca4=_[_0xf111('0x2b')](db[_0xf111('0x2c')][_0xf111('0x2d')],function(_0x59ea8c){return{'name':_0x59ea8c['fieldName'],'type':_0x59ea8c[_0xf111('0x2e')][_0xf111('0x2f')]};});_0x4e3f87['model']=_[_0xf111('0x2b')](_0x279ca4,'name');_0x4e3f87[_0xf111('0x30')]=_[_0xf111('0x31')](_0x565cd5[_0xf111('0x30')]);_0x4e3f87['filters']=_[_0xf111('0x32')](_0x4e3f87[_0xf111('0x33')],_0x4e3f87[_0xf111('0x30')]);_0x354b25['attributes']=_['intersection'](_0x4e3f87['model'],qs[_0xf111('0x34')](_0x565cd5['query'][_0xf111('0x34')]));_0x354b25[_0xf111('0x35')]=_0x354b25[_0xf111('0x35')][_0xf111('0x36')]?_0x354b25[_0xf111('0x35')]:_0x4e3f87[_0xf111('0x33')];if(!_0x565cd5[_0xf111('0x30')][_0xf111('0x37')](_0xf111('0x38'))){_0x354b25['limit']=qs[_0xf111('0x39')](_0x565cd5[_0xf111('0x30')][_0xf111('0x39')]);_0x354b25[_0xf111('0x1c')]=qs[_0xf111('0x1c')](_0x565cd5['query'][_0xf111('0x1c')]);}_0x354b25[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x565cd5[_0xf111('0x30')][_0xf111('0x3b')]);_0x354b25['where']=qs[_0xf111('0x3c')](_['pick'](_0x565cd5[_0xf111('0x30')],_0x4e3f87[_0xf111('0x3c')]),_0x279ca4);if(_0x565cd5[_0xf111('0x30')]['filter']){_0x354b25[_0xf111('0x3d')]=_['merge'](_0x354b25['where'],{'$or':_[_0xf111('0x2b')](_0x279ca4,function(_0x2e63c7){if(_0x2e63c7[_0xf111('0x2e')]!==_0xf111('0x3e')){var _0x41d494={};_0x41d494[_0x2e63c7[_0xf111('0x29')]]={'$like':'%'+_0x565cd5[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x41d494;}})});}_0x354b25=_[_0xf111('0x40')]({},_0x354b25,_0x565cd5[_0xf111('0x41')]);var _0x14167c={'where':_0x354b25[_0xf111('0x3d')]};return db[_0xf111('0x2c')][_0xf111('0x1e')](_0x14167c)[_0xf111('0x23')](function(_0x3b180d){_0x44773a[_0xf111('0x1e')]=_0x3b180d;if(_0x565cd5['query']['includeAll']){_0x354b25[_0xf111('0x42')]=[{'all':!![]}];}return db[_0xf111('0x2c')][_0xf111('0x43')](_0x354b25);})[_0xf111('0x23')](function(_0x3f0910){_0x44773a[_0xf111('0x44')]=_0x3f0910;return _0x44773a;})[_0xf111('0x23')](respondWithFilteredResult(_0x4c1a3f,_0x354b25))[_0xf111('0x45')](handleError(_0x4c1a3f,null));};exports[_0xf111('0x46')]=function(_0x3da544,_0x47d0a8){var _0x26fbd4={'raw':!![],'where':{'id':_0x3da544['params']['id']}},_0x507216={};_0x507216[_0xf111('0x33')]=_['keys'](db[_0xf111('0x2c')][_0xf111('0x2d')]);_0x507216[_0xf111('0x30')]=_['keys'](_0x3da544[_0xf111('0x30')]);_0x507216[_0xf111('0x3c')]=_[_0xf111('0x32')](_0x507216[_0xf111('0x33')],_0x507216[_0xf111('0x30')]);_0x26fbd4['attributes']=_[_0xf111('0x32')](_0x507216['model'],qs[_0xf111('0x34')](_0x3da544[_0xf111('0x30')][_0xf111('0x34')]));_0x26fbd4[_0xf111('0x35')]=_0x26fbd4['attributes']['length']?_0x26fbd4[_0xf111('0x35')]:_0x507216[_0xf111('0x33')];if(_0x3da544[_0xf111('0x30')]['includeAll']){_0x26fbd4[_0xf111('0x42')]=[{'all':!![]}];}_0x26fbd4=_[_0xf111('0x40')]({},_0x26fbd4,_0x3da544[_0xf111('0x41')]);return db['FaxQueue']['find'](_0x26fbd4)[_0xf111('0x23')](handleEntityNotFound(_0x47d0a8,null))[_0xf111('0x23')](respondWithResult(_0x47d0a8,null))[_0xf111('0x45')](handleError(_0x47d0a8,null));};exports['create']=function(_0xe549b5,_0x386a29){return db[_0xf111('0x2c')][_0xf111('0x47')](_0xe549b5['body'],{})['then'](function(_0x2c6a98){var _0x39d935=_0xe549b5[_0xf111('0x48')][_0xf111('0x24')]({'plain':!![]});if(!_0x39d935)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39d935[_0xf111('0x49')]===_0xf111('0x48')){var _0x5416ae=_0x2c6a98[_0xf111('0x24')]({'plain':!![]});var _0x55eb27=_0xf111('0x25');return db[_0xf111('0x4a')][_0xf111('0x4b')]({'where':{'name':_0x55eb27,'userProfileId':_0x39d935[_0xf111('0x4c')]},'raw':!![]})[_0xf111('0x23')](function(_0x9ee15a){if(_0x9ee15a&&_0x9ee15a[_0xf111('0x4d')]===0x0){return db['UserProfileResource'][_0xf111('0x47')]({'name':_0x5416ae[_0xf111('0x29')],'resourceId':_0x5416ae['id'],'type':_0x9ee15a['name'],'sectionId':_0x9ee15a['id']},{})[_0xf111('0x23')](function(){return _0x2c6a98;});}else{return _0x2c6a98;}})[_0xf111('0x45')](function(_0x112109){logger['error'](_0xf111('0x4e'),_0x112109);throw _0x112109;});}return _0x2c6a98;})[_0xf111('0x23')](respondWithResult(_0x386a29,0xc9))[_0xf111('0x45')](handleError(_0x386a29,null));};exports[_0xf111('0x21')]=function(_0x1dfbdc,_0x875f1e){if(_0x1dfbdc[_0xf111('0x4f')]['id']){delete _0x1dfbdc[_0xf111('0x4f')]['id'];}return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x1dfbdc[_0xf111('0x50')]['id']}})['then'](handleEntityNotFound(_0x875f1e,null))['then'](saveUpdates(_0x1dfbdc['body'],null))['then'](respondWithResult(_0x875f1e,null))[_0xf111('0x45')](handleError(_0x875f1e,null));};exports[_0xf111('0x22')]=function(_0x560723,_0x4a87a5){return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x560723['params']['id']}})['then'](handleEntityNotFound(_0x4a87a5,null))[_0xf111('0x23')](removeEntity(_0x4a87a5,null))[_0xf111('0x45')](handleError(_0x4a87a5,null));};exports['describe']=function(_0xd266d5,_0x6477e8){return db[_0xf111('0x2c')][_0xf111('0x51')]()[_0xf111('0x23')](respondWithResult(_0x6477e8,null))['catch'](handleError(_0x6477e8,null));};exports['getMembers']=function(_0x1db807,_0x316a33,_0x55efbf){var _0x2cef85={'raw':!![],'where':{}},_0x3eb812={},_0x10cc7b;return db[_0xf111('0x2c')][_0xf111('0x52')]({'where':{'id':_0x1db807[_0xf111('0x50')]['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x316a33,null))['then'](function(_0x1e107d){if(_0x1e107d){_0x10cc7b=_0x1e107d['get']({'plain':!![]});_0x3eb812[_0xf111('0x33')]=_[_0xf111('0x31')](db[_0xf111('0x53')]['rawAttributes']);_0x3eb812[_0xf111('0x30')]=_['keys'](_0x1db807[_0xf111('0x30')]);_0x3eb812[_0xf111('0x3c')]=_['intersection'](_0x3eb812[_0xf111('0x33')],_0x3eb812['query']);_0x2cef85['attributes']=_['intersection'](_0x3eb812['model'],qs[_0xf111('0x34')](_0x1db807[_0xf111('0x30')][_0xf111('0x34')]));_0x2cef85['attributes']=_0x2cef85[_0xf111('0x35')][_0xf111('0x36')]?_0x2cef85[_0xf111('0x35')]:_0x3eb812['model'];if(!_0x1db807['query'][_0xf111('0x37')](_0xf111('0x38'))){_0x2cef85[_0xf111('0x39')]=qs['limit'](_0x1db807[_0xf111('0x30')][_0xf111('0x39')]);_0x2cef85[_0xf111('0x1c')]=qs[_0xf111('0x1c')](_0x1db807[_0xf111('0x30')][_0xf111('0x1c')]);}_0x2cef85[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x1db807[_0xf111('0x30')][_0xf111('0x3b')]);_0x2cef85['where']=qs[_0xf111('0x3c')](_['pick'](_0x1db807[_0xf111('0x30')],_0x3eb812[_0xf111('0x3c')]));_0x2cef85['where'][_0xf111('0x54')]=_0x1e107d['id'];if(_0x1db807[_0xf111('0x30')][_0xf111('0x3f')]){_0x2cef85['where']=_[_0xf111('0x40')](_0x2cef85[_0xf111('0x3d')],{'$or':_[_0xf111('0x2b')](_0x2cef85[_0xf111('0x35')],function(_0x50e9b7){var _0x44fd2a={};_0x44fd2a[_0x50e9b7]={'$like':'%'+_0x1db807[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x44fd2a;})});}_0x2cef85=_[_0xf111('0x40')]({},_0x2cef85,_0x1db807[_0xf111('0x41')]);return db['UserFaxQueue'][_0xf111('0x43')](_0x2cef85);}})[_0xf111('0x23')](function(_0x2e0881){if(_0x2e0881){return db['User'][_0xf111('0x55')]({'where':{'id':_[_0xf111('0x2b')](_0x2e0881,'UserId'),'role':_0xf111('0x56')},'attributes':['id',_0xf111('0x29'),_0xf111('0x57'),_0xf111('0x58'),'createdAt']});}})[_0xf111('0x23')](function(_0x11f145){if(_0x11f145){return{'count':_0x11f145[_0xf111('0x1e')],'rows':_[_0xf111('0x2b')](_0x11f145['rows'],function(_0x115c13){return{'membername':_0x115c13[_0xf111('0x29')],'UserId':_0x115c13['id'],'queue_name':_0x10cc7b[_0xf111('0x29')],'FaxQueueId':_0x10cc7b['id'],'interface':util[_0xf111('0x59')]('%s/%s',_0xf111('0x5a'),_0x115c13[_0xf111('0x29')]),'penalty':0x0,'paused':_0x115c13[_0xf111('0x57')],'createdAt':_0x115c13['createdAt'],'updatedAt':_0x115c13[_0xf111('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x316a33,_0x2cef85))['catch'](handleError(_0x316a33,null));};exports[_0xf111('0x5b')]=function(_0x263b17,_0x2ab4cc,_0x554a61){var _0x4f8bfc={};var _0x18d8e9={};var _0x19e899;var _0x1f37f1;return db[_0xf111('0x2c')]['findOne']({'where':{'id':_0x263b17['params']['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x2ab4cc,null))['then'](function(_0x1c71c6){if(_0x1c71c6){_0x19e899=_0x1c71c6;_0x18d8e9[_0xf111('0x33')]=_[_0xf111('0x31')](db[_0xf111('0x5c')][_0xf111('0x2d')]);_0x18d8e9[_0xf111('0x30')]=_['keys'](_0x263b17[_0xf111('0x30')]);_0x18d8e9[_0xf111('0x3c')]=_[_0xf111('0x32')](_0x18d8e9['model'],_0x18d8e9[_0xf111('0x30')]);_0x4f8bfc[_0xf111('0x35')]=_[_0xf111('0x32')](_0x18d8e9[_0xf111('0x33')],qs[_0xf111('0x34')](_0x263b17[_0xf111('0x30')][_0xf111('0x34')]));_0x4f8bfc[_0xf111('0x35')]=_0x4f8bfc['attributes']['length']?_0x4f8bfc[_0xf111('0x35')]:_0x18d8e9[_0xf111('0x33')];_0x4f8bfc[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x263b17['query'][_0xf111('0x3b')]);_0x4f8bfc[_0xf111('0x3d')]=qs['filters'](_[_0xf111('0x5d')](_0x263b17[_0xf111('0x30')],_0x18d8e9['filters']));if(_0x263b17[_0xf111('0x30')]['filter']){_0x4f8bfc[_0xf111('0x3d')]=_[_0xf111('0x40')](_0x4f8bfc[_0xf111('0x3d')],{'$or':_[_0xf111('0x2b')](_0x4f8bfc[_0xf111('0x35')],function(_0x20ea34){var _0x30d1b3={};_0x30d1b3[_0x20ea34]={'$like':'%'+_0x263b17[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x30d1b3;})});}_0x4f8bfc=_['merge']({},_0x4f8bfc,_0x263b17[_0xf111('0x41')]);return _0x19e899[_0xf111('0x5b')](_0x4f8bfc);}})['then'](function(_0x207561){if(_0x207561){_0x1f37f1=_0x207561[_0xf111('0x36')];if(!_0x263b17[_0xf111('0x30')][_0xf111('0x37')](_0xf111('0x38'))){_0x4f8bfc['limit']=qs[_0xf111('0x39')](_0x263b17[_0xf111('0x30')][_0xf111('0x39')]);_0x4f8bfc['offset']=qs[_0xf111('0x1c')](_0x263b17[_0xf111('0x30')][_0xf111('0x1c')]);}return _0x19e899[_0xf111('0x5b')](_0x4f8bfc);}})['then'](function(_0x2bbc79){if(_0x2bbc79){return _0x2bbc79?{'count':_0x1f37f1,'rows':_0x2bbc79}:null;}})[_0xf111('0x23')](respondWithResult(_0x2ab4cc,null))[_0xf111('0x45')](handleError(_0x2ab4cc,null));};exports[_0xf111('0x5e')]=function(_0x6e7821,_0x438354,_0x54e173){var _0x2822a1=_0x6e7821[_0xf111('0x4f')][_0xf111('0x5f')];return db['Team']['findAll']({'where':{'id':_0x2822a1},'attributes':['id'],'include':[{'model':db[_0xf111('0x60')],'as':_0xf111('0x61'),'attributes':['id',_0xf111('0x29'),'online',_0xf111('0x62'),_0xf111('0x63')],'raw':!![]}]})['then'](function(_0x31e6f6){if(_0x31e6f6){var _0xfa5118=_['flatMap'](_0x31e6f6,function(_0x1edab0){var _0x57fa12=_0x1edab0[_0xf111('0x24')]({'plain':!![]});return _0x57fa12[_0xf111('0x61')];});return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x6e7821[_0xf111('0x50')]['id']}})[_0xf111('0x23')](function(_0x2e923a){return db['sequelize'][_0xf111('0x64')](function(_0x5b4200){return _0x2e923a['addTeams'](_0x2822a1,{'transaction':_0x5b4200})['then'](function(){return BPromise['each'](_0xfa5118,function(_0x20778f){return db['UserFaxQueue'][_0xf111('0x65')]({'where':{'UserId':_0x20778f['id'],'FaxQueueId':_0x6e7821[_0xf111('0x50')]['id']},'transaction':_0x5b4200});});})['then'](function(){_0xfa5118[_0xf111('0x66')](function(_0x574a60){socket['emit'](_0xf111('0x67'),{'UserId':_0x574a60['id'],'FaxQueueId':_0x2e923a['id']});});});});});}})[_0xf111('0x23')](respondWithStatusCode(_0x438354,null))['catch'](handleError(_0x438354,null));};exports['removeTeams']=function(_0x3f8790,_0x1feb5a,_0x3f80ca){return db['Team'][_0xf111('0x43')]({'where':{'id':_0x3f8790[_0xf111('0x30')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf111('0x60')],'as':_0xf111('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1feb5a,null))[_0xf111('0x23')](function(_0x239153){var _0x3b8a0e=_[_0xf111('0x2b')](_0x239153,'id');var _0x4d5b52=[];var _0x5b35a6=[];var _0x38a522=squel[_0xf111('0x68')]();_0x38a522[_0xf111('0x69')](_0xf111('0x6a'))[_0xf111('0x6b')](_0xf111('0x6c'),'tq')[_0xf111('0x6d')]('user_has_teams','ut',_0xf111('0x6e'))[_0xf111('0x3d')](_0xf111('0x6f'),_0x3f8790[_0xf111('0x50')]['id']);for(var _0x86c75e=0x0;_0x86c75e<_0x239153[_0xf111('0x36')];_0x86c75e+=0x1){let _0x3c11e7=_0x239153[_0x86c75e];for(var _0x2642fc=0x0;_0x2642fc<_0x3c11e7[_0xf111('0x61')][_0xf111('0x36')];_0x2642fc+=0x1){let _0x314b48=_0x3c11e7[_0xf111('0x61')][_0x2642fc];var _0x23a1fc=_0x38a522[_0xf111('0x70')]();_0x23a1fc[_0xf111('0x3d')](_0xf111('0x71'),_0x314b48['id']);_0x5b35a6[_0xf111('0x72')](db[_0xf111('0x73')][_0xf111('0x30')](_0x23a1fc[_0xf111('0x74')](),{'type':db['sequelize']['QueryTypes'][_0xf111('0x75')]})[_0xf111('0x23')](function(_0x5d1070){if(_0x5d1070[_0xf111('0x36')]===0x1){return _0x314b48['id'];}else{var _0x32700a=_[_0xf111('0x76')](_[_0xf111('0x2b')](_0x5d1070,_0xf111('0x77')),function(_0x130afc){return _['includes'](_0x3b8a0e,_0x130afc);});if(_0x32700a){return _0x314b48['id'];}}}));}}return BPromise[_0xf111('0x78')](_0x5b35a6)[_0xf111('0x23')](function(_0x2be181){_0x4d5b52=_(_0x4d5b52)[_0xf111('0x79')](_0x2be181)[_0xf111('0x7a')]()[_0xf111('0x7b')]();return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x3f8790[_0xf111('0x50')]['id']}})[_0xf111('0x23')](function(_0x33e793){return db[_0xf111('0x73')]['transaction'](function(_0x645af6){return _0x33e793['removeTeams'](_0x3f8790['query'][_0xf111('0x5f')],{'transaction':_0x645af6})['then'](function(){if(!_[_0xf111('0x7c')](_0x4d5b52)){return _0x33e793[_0xf111('0x7d')](_0x4d5b52,{'transaction':_0x645af6});}})[_0xf111('0x23')](function(){_0x4d5b52[_0xf111('0x66')](function(_0x49cb85){socket[_0xf111('0x7e')]('userFaxQueue:remove',{'UserId':_0x49cb85,'FaxQueueId':_0x33e793['id']});});});});});});})['then'](respondWithStatusCode(_0x1feb5a,null))[_0xf111('0x45')](handleError(_0x1feb5a,null));};exports['addAgents']=function(_0x28300e,_0x6edb05,_0x4a56d7){return db[_0xf111('0x2c')][_0xf111('0x4b')]({'where':{'id':_0x28300e[_0xf111('0x50')]['id']}})['then'](handleEntityNotFound(_0x6edb05,null))[_0xf111('0x23')](function(_0x11b892){if(_0x11b892){return _0x11b892[_0xf111('0x7f')](_0x28300e[_0xf111('0x4f')][_0xf111('0x5f')],_[_0xf111('0x80')](_0x28300e[_0xf111('0x4f')],[_0xf111('0x5f'),'id'])||{})[_0xf111('0x81')](function(_0x25be31){for(var _0x5d832a=0x0;_0x5d832a<_0x28300e['body'][_0xf111('0x5f')]['length'];_0x5d832a+=0x1){socket[_0xf111('0x7e')](_0xf111('0x67'),{'UserId':Number(_0x28300e[_0xf111('0x4f')]['ids'][_0x5d832a]),'FaxQueueId':Number(_0x28300e[_0xf111('0x50')]['id'])});}return _0x25be31;});}})[_0xf111('0x23')](respondWithResult(_0x6edb05,null))[_0xf111('0x45')](handleError(_0x6edb05,null));};exports[_0xf111('0x7d')]=function(_0x4606a5,_0x4aadb5,_0x21ee9c){return db['FaxQueue']['find']({'where':{'id':_0x4606a5[_0xf111('0x50')]['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x4aadb5,null))[_0xf111('0x23')](function(_0xc5d4eb){if(_0xc5d4eb){return _0xc5d4eb[_0xf111('0x7d')](_0x4606a5[_0xf111('0x30')][_0xf111('0x5f')])[_0xf111('0x23')](function(){if(_[_0xf111('0x82')](_0x4606a5['query'][_0xf111('0x5f')])){for(var _0x17ceca=0x0;_0x17ceca<_0x4606a5[_0xf111('0x30')]['ids'][_0xf111('0x36')];_0x17ceca+=0x1){socket[_0xf111('0x7e')](_0xf111('0x83'),{'UserId':Number(_0x4606a5[_0xf111('0x30')][_0xf111('0x5f')][_0x17ceca]),'FaxQueueId':Number(_0x4606a5[_0xf111('0x50')]['id'])});}}else{socket[_0xf111('0x7e')](_0xf111('0x83'),{'UserId':Number(_0x4606a5[_0xf111('0x30')][_0xf111('0x5f')]),'FaxQueueId':Number(_0x4606a5[_0xf111('0x50')]['id'])});}});}})[_0xf111('0x23')](respondWithStatusCode(_0x4aadb5,null))[_0xf111('0x45')](handleError(_0x4aadb5,null));};exports['getAgents']=function(_0x599aab,_0x2d7449,_0x1fdfb1){var _0x5746b2={};var _0x3beb13={};var _0x143c98;var _0xcba5b7;return db['FaxQueue'][_0xf111('0x52')]({'where':{'id':_0x599aab[_0xf111('0x50')]['id']}})[_0xf111('0x23')](handleEntityNotFound(_0x2d7449,null))['then'](function(_0x5346c2){if(_0x5346c2){_0x143c98=_0x5346c2;_0x3beb13[_0xf111('0x33')]=_['keys'](db[_0xf111('0x60')]['rawAttributes']);_0x3beb13[_0xf111('0x30')]=_[_0xf111('0x31')](_0x599aab[_0xf111('0x30')]);_0x3beb13[_0xf111('0x3c')]=_[_0xf111('0x32')](_0x3beb13[_0xf111('0x33')],_0x3beb13[_0xf111('0x30')]);_0x5746b2[_0xf111('0x35')]=_[_0xf111('0x32')](_0x3beb13[_0xf111('0x33')],qs['fields'](_0x599aab[_0xf111('0x30')][_0xf111('0x34')]));_0x5746b2['attributes']=_0x5746b2['attributes'][_0xf111('0x36')]?_0x5746b2['attributes']:_0x3beb13[_0xf111('0x33')];_0x5746b2[_0xf111('0x3a')]=qs[_0xf111('0x3b')](_0x599aab[_0xf111('0x30')][_0xf111('0x3b')]);_0x5746b2[_0xf111('0x3d')]=qs['filters'](_['pick'](_0x599aab[_0xf111('0x30')],_0x3beb13[_0xf111('0x3c')]));if(_0x599aab[_0xf111('0x30')][_0xf111('0x3f')]){_0x5746b2[_0xf111('0x3d')]=_[_0xf111('0x40')](_0x5746b2['where'],{'$or':_[_0xf111('0x2b')](_0x5746b2[_0xf111('0x35')],function(_0x29adbb){var _0x64bf12={};_0x64bf12[_0x29adbb]={'$like':'%'+_0x599aab[_0xf111('0x30')][_0xf111('0x3f')]+'%'};return _0x64bf12;})});}_0x5746b2=_[_0xf111('0x40')]({},_0x5746b2,_0x599aab[_0xf111('0x41')]);return _0x143c98[_0xf111('0x84')](_0x5746b2);}})['then'](function(_0x59f0bd){if(_0x59f0bd){_0xcba5b7=_0x59f0bd[_0xf111('0x36')];if(!_0x599aab[_0xf111('0x30')][_0xf111('0x37')](_0xf111('0x38'))){_0x5746b2[_0xf111('0x39')]=qs[_0xf111('0x39')](_0x599aab['query'][_0xf111('0x39')]);_0x5746b2[_0xf111('0x1c')]=qs[_0xf111('0x1c')](_0x599aab[_0xf111('0x30')]['offset']);}return _0x143c98['getAgents'](_0x5746b2);}})[_0xf111('0x23')](function(_0x6ba73f){if(_0x6ba73f){return _0x6ba73f?{'count':_0xcba5b7,'rows':_0x6ba73f}:null;}})['then'](respondWithResult(_0x2d7449,null))[_0xf111('0x45')](handleError(_0x2d7449,null));};
\ No newline at end of file
+var _0xa831=['findAll','online','interface','flatMap','sequelize','transaction','each','emit','userFaxQueue:save','removeTeams','Team','ids','field','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','every','TeamId','includes','all','union','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FaxQueue','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','params','describe','getMembers','findOne','UserFaxQueue','nolimit','User','findAndCountAll','UserId','faxPause','updatedAt','format','%s/%s','SIP','getTeams','addTeams'];(function(_0x37cbfc,_0x315a49){var _0x123ea8=function(_0x5a94f0){while(--_0x5a94f0){_0x37cbfc['push'](_0x37cbfc['shift']());}};_0x123ea8(++_0x315a49);}(_0xa831,0x138));var _0x1a83=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0xa831[_0x2b737c];return _0x466ed5;};'use strict';var emlformat=require(_0x1a83('0x0'));var rimraf=require(_0x1a83('0x1'));var zipdir=require(_0x1a83('0x2'));var jsonpatch=require(_0x1a83('0x3'));var rp=require(_0x1a83('0x4'));var moment=require('moment');var BPromise=require(_0x1a83('0x5'));var Mustache=require(_0x1a83('0x6'));var util=require(_0x1a83('0x7'));var path=require(_0x1a83('0x8'));var sox=require(_0x1a83('0x9'));var csv=require(_0x1a83('0xa'));var ejs=require(_0x1a83('0xb'));var fs=require('fs');var fs_extra=require(_0x1a83('0xc'));var _=require('lodash');var squel=require(_0x1a83('0xd'));var crypto=require(_0x1a83('0xe'));var jsforce=require(_0x1a83('0xf'));var deskjs=require(_0x1a83('0x10'));var toCsv=require(_0x1a83('0xa'));var querystring=require(_0x1a83('0x11'));var Papa=require(_0x1a83('0x12'));var Redis=require(_0x1a83('0x13'));var authService=require(_0x1a83('0x14'));var qs=require(_0x1a83('0x15'));var as=require(_0x1a83('0x16'));var hardwareService=require(_0x1a83('0x17'));var logger=require(_0x1a83('0x18'))('api');var utils=require(_0x1a83('0x19'));var config=require(_0x1a83('0x1a'));var licenseUtil=require(_0x1a83('0x1b'));var db=require(_0x1a83('0x1c'))['db'];config['redis']=_[_0x1a83('0x1d')](config[_0x1a83('0x1e')],{'host':_0x1a83('0x1f'),'port':0x18eb});var socket=require(_0x1a83('0x20'))(new Redis(config[_0x1a83('0x1e')]));require(_0x1a83('0x21'))[_0x1a83('0x22')](socket);function respondWithStatusCode(_0x3c8699,_0x2b4b55){_0x2b4b55=_0x2b4b55||0xcc;return function(_0x265c74){if(_0x265c74){return _0x3c8699[_0x1a83('0x23')](_0x2b4b55);}return _0x3c8699[_0x1a83('0x24')](_0x2b4b55)[_0x1a83('0x25')]();};}function respondWithResult(_0x20d439,_0x27db53){_0x27db53=_0x27db53||0xc8;return function(_0x34621c){if(_0x34621c){return _0x20d439[_0x1a83('0x24')](_0x27db53)[_0x1a83('0x26')](_0x34621c);}};}function respondWithFilteredResult(_0x1bc815,_0x5cee42){return function(_0x4548b5){if(_0x4548b5){var _0x250add=typeof _0x5cee42[_0x1a83('0x27')]==='undefined'&&typeof _0x5cee42[_0x1a83('0x28')]==='undefined';var _0x55ed28=_0x4548b5['count'];var _0x3dc477=_0x250add?0x0:_0x5cee42[_0x1a83('0x27')];var _0x53a245=_0x250add?_0x4548b5[_0x1a83('0x29')]:_0x5cee42['offset']+_0x5cee42['limit'];var _0x104370;if(_0x53a245>=_0x55ed28){_0x53a245=_0x55ed28;_0x104370=0xc8;}else{_0x104370=0xce;}_0x1bc815[_0x1a83('0x24')](_0x104370);return _0x1bc815[_0x1a83('0x2a')](_0x1a83('0x2b'),_0x3dc477+'-'+_0x53a245+'/'+_0x55ed28)[_0x1a83('0x26')](_0x4548b5);}return null;};}function patchUpdates(_0x54769d){return function(_0x1c6b40){try{jsonpatch[_0x1a83('0x2c')](_0x1c6b40,_0x54769d,!![]);}catch(_0x4594ca){return BPromise[_0x1a83('0x2d')](_0x4594ca);}return _0x1c6b40[_0x1a83('0x2e')]();};}function saveUpdates(_0x3d99d5,_0x473fcb){return function(_0x18b058){if(_0x18b058){return _0x18b058[_0x1a83('0x2f')](_0x3d99d5)[_0x1a83('0x30')](function(_0x4b2ba6){return _0x4b2ba6;});}return null;};}function removeEntity(_0x2f6013,_0x9a4b69){return function(_0x5a5f20){if(_0x5a5f20){return _0x5a5f20[_0x1a83('0x31')]()[_0x1a83('0x30')](function(){var _0x52c5c9=_0x5a5f20[_0x1a83('0x32')]({'plain':!![]});var _0x4dbe6b=_0x1a83('0x33');return db['UserProfileResource'][_0x1a83('0x31')]({'where':{'type':_0x4dbe6b,'resourceId':_0x52c5c9['id']}})[_0x1a83('0x30')](function(){return _0x5a5f20;});})[_0x1a83('0x30')](function(){_0x2f6013[_0x1a83('0x24')](0xcc)[_0x1a83('0x25')]();});}};}function handleEntityNotFound(_0x5baa20,_0x39de8a){return function(_0x21dade){if(!_0x21dade){_0x5baa20['sendStatus'](0x194);}return _0x21dade;};}function handleError(_0xfb689d,_0x3e87b1){_0x3e87b1=_0x3e87b1||0x1f4;return function(_0x3e92a4){logger['error'](_0x3e92a4['stack']);if(_0x3e92a4[_0x1a83('0x34')]){delete _0x3e92a4['name'];}_0xfb689d['status'](_0x3e87b1)[_0x1a83('0x35')](_0x3e92a4);};}exports[_0x1a83('0x36')]=function(_0x23fcbd,_0x4c2549){var _0x1c7dd8={},_0x3b6351={},_0x62c5a1={'count':0x0,'rows':[]};var _0x2fb5d2=_[_0x1a83('0x37')](db['FaxQueue'][_0x1a83('0x38')],function(_0x20cae1){return{'name':_0x20cae1[_0x1a83('0x39')],'type':_0x20cae1[_0x1a83('0x3a')][_0x1a83('0x3b')]};});_0x3b6351[_0x1a83('0x3c')]=_[_0x1a83('0x37')](_0x2fb5d2,_0x1a83('0x34'));_0x3b6351['query']=_[_0x1a83('0x3d')](_0x23fcbd[_0x1a83('0x3e')]);_0x3b6351[_0x1a83('0x3f')]=_['intersection'](_0x3b6351[_0x1a83('0x3c')],_0x3b6351[_0x1a83('0x3e')]);_0x1c7dd8[_0x1a83('0x40')]=_[_0x1a83('0x41')](_0x3b6351[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0x23fcbd['query']['fields']));_0x1c7dd8[_0x1a83('0x40')]=_0x1c7dd8[_0x1a83('0x40')][_0x1a83('0x43')]?_0x1c7dd8['attributes']:_0x3b6351[_0x1a83('0x3c')];if(!_0x23fcbd[_0x1a83('0x3e')]['hasOwnProperty']('nolimit')){_0x1c7dd8[_0x1a83('0x28')]=qs[_0x1a83('0x28')](_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x28')]);_0x1c7dd8[_0x1a83('0x27')]=qs[_0x1a83('0x27')](_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x27')]);}_0x1c7dd8[_0x1a83('0x44')]=qs['sort'](_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x45')]);_0x1c7dd8[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0x23fcbd[_0x1a83('0x3e')],_0x3b6351['filters']),_0x2fb5d2);if(_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x48')]){_0x1c7dd8[_0x1a83('0x46')]=_[_0x1a83('0x49')](_0x1c7dd8[_0x1a83('0x46')],{'$or':_[_0x1a83('0x37')](_0x2fb5d2,function(_0x3f63e0){if(_0x3f63e0['type']!==_0x1a83('0x4a')){var _0x81c537={};_0x81c537[_0x3f63e0['name']]={'$like':'%'+_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x48')]+'%'};return _0x81c537;}})});}_0x1c7dd8=_[_0x1a83('0x49')]({},_0x1c7dd8,_0x23fcbd[_0x1a83('0x4b')]);var _0x3c5b25={'where':_0x1c7dd8[_0x1a83('0x46')]};return db['FaxQueue'][_0x1a83('0x29')](_0x3c5b25)[_0x1a83('0x30')](function(_0xcaca5f){_0x62c5a1[_0x1a83('0x29')]=_0xcaca5f;if(_0x23fcbd[_0x1a83('0x3e')][_0x1a83('0x4c')]){_0x1c7dd8[_0x1a83('0x4d')]=[{'all':!![]}];}return db[_0x1a83('0x4e')]['findAll'](_0x1c7dd8);})['then'](function(_0x5994ab){_0x62c5a1[_0x1a83('0x4f')]=_0x5994ab;return _0x62c5a1;})[_0x1a83('0x30')](respondWithFilteredResult(_0x4c2549,_0x1c7dd8))[_0x1a83('0x50')](handleError(_0x4c2549,null));};exports[_0x1a83('0x51')]=function(_0x41bfe5,_0x3a67c1){var _0xc60362={'raw':!![],'where':{'id':_0x41bfe5['params']['id']}},_0x5c0bd5={};_0x5c0bd5[_0x1a83('0x3c')]=_[_0x1a83('0x3d')](db['FaxQueue'][_0x1a83('0x38')]);_0x5c0bd5[_0x1a83('0x3e')]=_[_0x1a83('0x3d')](_0x41bfe5['query']);_0x5c0bd5[_0x1a83('0x3f')]=_[_0x1a83('0x41')](_0x5c0bd5[_0x1a83('0x3c')],_0x5c0bd5[_0x1a83('0x3e')]);_0xc60362[_0x1a83('0x40')]=_[_0x1a83('0x41')](_0x5c0bd5[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0x41bfe5[_0x1a83('0x3e')][_0x1a83('0x42')]));_0xc60362[_0x1a83('0x40')]=_0xc60362[_0x1a83('0x40')][_0x1a83('0x43')]?_0xc60362['attributes']:_0x5c0bd5[_0x1a83('0x3c')];if(_0x41bfe5['query'][_0x1a83('0x4c')]){_0xc60362[_0x1a83('0x4d')]=[{'all':!![]}];}_0xc60362=_[_0x1a83('0x49')]({},_0xc60362,_0x41bfe5[_0x1a83('0x4b')]);return db[_0x1a83('0x4e')][_0x1a83('0x52')](_0xc60362)[_0x1a83('0x30')](handleEntityNotFound(_0x3a67c1,null))[_0x1a83('0x30')](respondWithResult(_0x3a67c1,null))[_0x1a83('0x50')](handleError(_0x3a67c1,null));};exports[_0x1a83('0x53')]=function(_0x2741cb,_0x40f218){return db[_0x1a83('0x4e')][_0x1a83('0x53')](_0x2741cb[_0x1a83('0x54')],{})[_0x1a83('0x30')](function(_0x42e933){var _0x35f930=_0x2741cb[_0x1a83('0x55')][_0x1a83('0x32')]({'plain':!![]});if(!_0x35f930)throw new Error(_0x1a83('0x56'));if(_0x35f930[_0x1a83('0x57')]==='user'){var _0x4332fe=_0x42e933['get']({'plain':!![]});var _0x3a5929=_0x1a83('0x33');return db[_0x1a83('0x58')][_0x1a83('0x52')]({'where':{'name':_0x3a5929,'userProfileId':_0x35f930[_0x1a83('0x59')]},'raw':!![]})[_0x1a83('0x30')](function(_0x551485){if(_0x551485&&_0x551485['autoAssociation']===0x0){return db[_0x1a83('0x5a')][_0x1a83('0x53')]({'name':_0x4332fe[_0x1a83('0x34')],'resourceId':_0x4332fe['id'],'type':_0x551485[_0x1a83('0x34')],'sectionId':_0x551485['id']},{})[_0x1a83('0x30')](function(){return _0x42e933;});}else{return _0x42e933;}})[_0x1a83('0x50')](function(_0x33501d){logger[_0x1a83('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33501d);throw _0x33501d;});}return _0x42e933;})[_0x1a83('0x30')](respondWithResult(_0x40f218,0xc9))[_0x1a83('0x50')](handleError(_0x40f218,null));};exports[_0x1a83('0x2f')]=function(_0x1f6dcf,_0x318558){if(_0x1f6dcf[_0x1a83('0x54')]['id']){delete _0x1f6dcf[_0x1a83('0x54')]['id'];}return db['FaxQueue'][_0x1a83('0x52')]({'where':{'id':_0x1f6dcf[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x318558,null))[_0x1a83('0x30')](saveUpdates(_0x1f6dcf[_0x1a83('0x54')],null))[_0x1a83('0x30')](respondWithResult(_0x318558,null))[_0x1a83('0x50')](handleError(_0x318558,null));};exports[_0x1a83('0x31')]=function(_0x53daf2,_0x1466ca){return db['FaxQueue'][_0x1a83('0x52')]({'where':{'id':_0x53daf2['params']['id']}})['then'](handleEntityNotFound(_0x1466ca,null))[_0x1a83('0x30')](removeEntity(_0x1466ca,null))[_0x1a83('0x50')](handleError(_0x1466ca,null));};exports[_0x1a83('0x5d')]=function(_0x37c8b4,_0x78f85a){return db[_0x1a83('0x4e')][_0x1a83('0x5d')]()[_0x1a83('0x30')](respondWithResult(_0x78f85a,null))[_0x1a83('0x50')](handleError(_0x78f85a,null));};exports[_0x1a83('0x5e')]=function(_0x25639e,_0x4b9c35,_0x9c866c){var _0x3fa0f3={'raw':!![],'where':{}},_0x14a4eb={},_0x1a49eb;return db['FaxQueue'][_0x1a83('0x5f')]({'where':{'id':_0x25639e['params']['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x4b9c35,null))[_0x1a83('0x30')](function(_0xdfc09b){if(_0xdfc09b){_0x1a49eb=_0xdfc09b['get']({'plain':!![]});_0x14a4eb[_0x1a83('0x3c')]=_[_0x1a83('0x3d')](db[_0x1a83('0x60')][_0x1a83('0x38')]);_0x14a4eb['query']=_['keys'](_0x25639e[_0x1a83('0x3e')]);_0x14a4eb[_0x1a83('0x3f')]=_['intersection'](_0x14a4eb[_0x1a83('0x3c')],_0x14a4eb['query']);_0x3fa0f3[_0x1a83('0x40')]=_['intersection'](_0x14a4eb[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0x25639e[_0x1a83('0x3e')][_0x1a83('0x42')]));_0x3fa0f3[_0x1a83('0x40')]=_0x3fa0f3['attributes'][_0x1a83('0x43')]?_0x3fa0f3[_0x1a83('0x40')]:_0x14a4eb[_0x1a83('0x3c')];if(!_0x25639e['query']['hasOwnProperty'](_0x1a83('0x61'))){_0x3fa0f3[_0x1a83('0x28')]=qs[_0x1a83('0x28')](_0x25639e[_0x1a83('0x3e')]['limit']);_0x3fa0f3['offset']=qs[_0x1a83('0x27')](_0x25639e[_0x1a83('0x3e')][_0x1a83('0x27')]);}_0x3fa0f3[_0x1a83('0x44')]=qs[_0x1a83('0x45')](_0x25639e['query']['sort']);_0x3fa0f3[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0x25639e[_0x1a83('0x3e')],_0x14a4eb['filters']));_0x3fa0f3[_0x1a83('0x46')]['FaxQueueId']=_0xdfc09b['id'];if(_0x25639e['query'][_0x1a83('0x48')]){_0x3fa0f3[_0x1a83('0x46')]=_['merge'](_0x3fa0f3[_0x1a83('0x46')],{'$or':_['map'](_0x3fa0f3[_0x1a83('0x40')],function(_0x9dd8f3){var _0x4de935={};_0x4de935[_0x9dd8f3]={'$like':'%'+_0x25639e[_0x1a83('0x3e')][_0x1a83('0x48')]+'%'};return _0x4de935;})});}_0x3fa0f3=_[_0x1a83('0x49')]({},_0x3fa0f3,_0x25639e['options']);return db[_0x1a83('0x60')]['findAll'](_0x3fa0f3);}})[_0x1a83('0x30')](function(_0x5811ff){if(_0x5811ff){return db[_0x1a83('0x62')][_0x1a83('0x63')]({'where':{'id':_['map'](_0x5811ff,_0x1a83('0x64')),'role':'agent'},'attributes':['id',_0x1a83('0x34'),_0x1a83('0x65'),_0x1a83('0x66'),'createdAt']});}})[_0x1a83('0x30')](function(_0x54f14b){if(_0x54f14b){return{'count':_0x54f14b['count'],'rows':_['map'](_0x54f14b[_0x1a83('0x4f')],function(_0x17bf91){return{'membername':_0x17bf91[_0x1a83('0x34')],'UserId':_0x17bf91['id'],'queue_name':_0x1a49eb[_0x1a83('0x34')],'FaxQueueId':_0x1a49eb['id'],'interface':util[_0x1a83('0x67')](_0x1a83('0x68'),_0x1a83('0x69'),_0x17bf91[_0x1a83('0x34')]),'penalty':0x0,'paused':_0x17bf91['faxPause'],'createdAt':_0x17bf91['createdAt'],'updatedAt':_0x17bf91[_0x1a83('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1a83('0x30')](respondWithFilteredResult(_0x4b9c35,_0x3fa0f3))[_0x1a83('0x50')](handleError(_0x4b9c35,null));};exports[_0x1a83('0x6a')]=function(_0x2a817a,_0x1a88d0,_0x4daf54){var _0x51df1c={};var _0x5a4a43={};var _0x2a4855;var _0x19d99f;return db[_0x1a83('0x4e')][_0x1a83('0x5f')]({'where':{'id':_0x2a817a['params']['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x1a88d0,null))['then'](function(_0x3ad222){if(_0x3ad222){_0x2a4855=_0x3ad222;_0x5a4a43['model']=_[_0x1a83('0x3d')](db['Team'][_0x1a83('0x38')]);_0x5a4a43[_0x1a83('0x3e')]=_[_0x1a83('0x3d')](_0x2a817a[_0x1a83('0x3e')]);_0x5a4a43[_0x1a83('0x3f')]=_[_0x1a83('0x41')](_0x5a4a43[_0x1a83('0x3c')],_0x5a4a43[_0x1a83('0x3e')]);_0x51df1c[_0x1a83('0x40')]=_['intersection'](_0x5a4a43[_0x1a83('0x3c')],qs['fields'](_0x2a817a[_0x1a83('0x3e')]['fields']));_0x51df1c[_0x1a83('0x40')]=_0x51df1c[_0x1a83('0x40')][_0x1a83('0x43')]?_0x51df1c[_0x1a83('0x40')]:_0x5a4a43['model'];_0x51df1c[_0x1a83('0x44')]=qs[_0x1a83('0x45')](_0x2a817a[_0x1a83('0x3e')][_0x1a83('0x45')]);_0x51df1c[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0x2a817a[_0x1a83('0x3e')],_0x5a4a43[_0x1a83('0x3f')]));if(_0x2a817a[_0x1a83('0x3e')]['filter']){_0x51df1c[_0x1a83('0x46')]=_['merge'](_0x51df1c[_0x1a83('0x46')],{'$or':_[_0x1a83('0x37')](_0x51df1c[_0x1a83('0x40')],function(_0xe8c340){var _0x343e91={};_0x343e91[_0xe8c340]={'$like':'%'+_0x2a817a[_0x1a83('0x3e')][_0x1a83('0x48')]+'%'};return _0x343e91;})});}_0x51df1c=_[_0x1a83('0x49')]({},_0x51df1c,_0x2a817a[_0x1a83('0x4b')]);return _0x2a4855[_0x1a83('0x6a')](_0x51df1c);}})['then'](function(_0x11ec5e){if(_0x11ec5e){_0x19d99f=_0x11ec5e['length'];if(!_0x2a817a['query']['hasOwnProperty'](_0x1a83('0x61'))){_0x51df1c[_0x1a83('0x28')]=qs[_0x1a83('0x28')](_0x2a817a[_0x1a83('0x3e')]['limit']);_0x51df1c['offset']=qs['offset'](_0x2a817a[_0x1a83('0x3e')]['offset']);}return _0x2a4855[_0x1a83('0x6a')](_0x51df1c);}})[_0x1a83('0x30')](function(_0x3e3279){if(_0x3e3279){return _0x3e3279?{'count':_0x19d99f,'rows':_0x3e3279}:null;}})[_0x1a83('0x30')](respondWithResult(_0x1a88d0,null))[_0x1a83('0x50')](handleError(_0x1a88d0,null));};exports[_0x1a83('0x6b')]=function(_0x26db67,_0x346c7b,_0x4818b2){var _0x199937=_0x26db67[_0x1a83('0x54')]['ids'];return db['Team'][_0x1a83('0x6c')]({'where':{'id':_0x199937},'attributes':['id'],'include':[{'model':db[_0x1a83('0x62')],'as':'Agents','attributes':['id',_0x1a83('0x34'),_0x1a83('0x6d'),'voicePause',_0x1a83('0x6e')],'raw':!![]}]})[_0x1a83('0x30')](function(_0x2a8bc2){if(_0x2a8bc2){var _0x487483=_[_0x1a83('0x6f')](_0x2a8bc2,function(_0x2546a9){var _0x5b783d=_0x2546a9['get']({'plain':!![]});return _0x5b783d['Agents'];});return db[_0x1a83('0x4e')][_0x1a83('0x52')]({'where':{'id':_0x26db67[_0x1a83('0x5c')]['id']}})['then'](function(_0x2dbdbf){return db[_0x1a83('0x70')][_0x1a83('0x71')](function(_0x31dab8){return _0x2dbdbf[_0x1a83('0x6b')](_0x199937,{'transaction':_0x31dab8})[_0x1a83('0x30')](function(){return BPromise[_0x1a83('0x72')](_0x487483,function(_0x2a6ca9){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x2a6ca9['id'],'FaxQueueId':_0x26db67['params']['id']},'transaction':_0x31dab8});});})[_0x1a83('0x30')](function(){_0x487483['forEach'](function(_0x177097){socket[_0x1a83('0x73')](_0x1a83('0x74'),{'UserId':_0x177097['id'],'FaxQueueId':_0x2dbdbf['id']});});});});});}})['then'](respondWithStatusCode(_0x346c7b,null))[_0x1a83('0x50')](handleError(_0x346c7b,null));};exports[_0x1a83('0x75')]=function(_0x16f796,_0x235ec4,_0x498175){return db[_0x1a83('0x76')]['findAll']({'where':{'id':_0x16f796[_0x1a83('0x3e')][_0x1a83('0x77')]},'attributes':['id'],'include':[{'model':db[_0x1a83('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x235ec4,null))[_0x1a83('0x30')](function(_0x42c0df){var _0x49b861=_[_0x1a83('0x37')](_0x42c0df,'id');var _0x4c5a3a=[];var _0x1e6786=[];var _0x1da784=squel['select']();_0x1da784[_0x1a83('0x78')]('tq.TeamId')[_0x1a83('0x79')]('team_has_fax_queues','tq')['join'](_0x1a83('0x7a'),'ut',_0x1a83('0x7b'))['where']('FaxQueueId\x20=\x20?',_0x16f796['params']['id']);for(var _0x245cea=0x0;_0x245cea<_0x42c0df['length'];_0x245cea+=0x1){let _0x4ea058=_0x42c0df[_0x245cea];for(var _0x49227f=0x0;_0x49227f<_0x4ea058['Agents'][_0x1a83('0x43')];_0x49227f+=0x1){let _0x2e6e34=_0x4ea058['Agents'][_0x49227f];var _0x50053c=_0x1da784[_0x1a83('0x7c')]();_0x50053c['where'](_0x1a83('0x7d'),_0x2e6e34['id']);_0x1e6786['push'](db['sequelize'][_0x1a83('0x3e')](_0x50053c['toString'](),{'type':db[_0x1a83('0x70')]['QueryTypes']['SELECT']})[_0x1a83('0x30')](function(_0x2d220a){if(_0x2d220a[_0x1a83('0x43')]===0x1){return _0x2e6e34['id'];}else{var _0x36e565=_[_0x1a83('0x7e')](_['map'](_0x2d220a,_0x1a83('0x7f')),function(_0x40bf0e){return _[_0x1a83('0x80')](_0x49b861,_0x40bf0e);});if(_0x36e565){return _0x2e6e34['id'];}}}));}}return BPromise[_0x1a83('0x81')](_0x1e6786)[_0x1a83('0x30')](function(_0x50919a){_0x4c5a3a=_(_0x4c5a3a)[_0x1a83('0x82')](_0x50919a)['compact']()['value']();return db['FaxQueue'][_0x1a83('0x52')]({'where':{'id':_0x16f796[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](function(_0x2b92d7){return db[_0x1a83('0x70')][_0x1a83('0x71')](function(_0x256138){return _0x2b92d7[_0x1a83('0x75')](_0x16f796['query'][_0x1a83('0x77')],{'transaction':_0x256138})['then'](function(){if(!_[_0x1a83('0x83')](_0x4c5a3a)){return _0x2b92d7[_0x1a83('0x84')](_0x4c5a3a,{'transaction':_0x256138});}})[_0x1a83('0x30')](function(){_0x4c5a3a[_0x1a83('0x85')](function(_0x4ce209){socket[_0x1a83('0x73')](_0x1a83('0x86'),{'UserId':_0x4ce209,'FaxQueueId':_0x2b92d7['id']});});});});});});})[_0x1a83('0x30')](respondWithStatusCode(_0x235ec4,null))[_0x1a83('0x50')](handleError(_0x235ec4,null));};exports[_0x1a83('0x87')]=function(_0x3b3499,_0x360f23,_0x3c0f56){return db[_0x1a83('0x4e')][_0x1a83('0x52')]({'where':{'id':_0x3b3499[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x360f23,null))[_0x1a83('0x30')](function(_0x2d5140){if(_0x2d5140){return _0x2d5140['addAgents'](_0x3b3499[_0x1a83('0x54')]['ids'],_[_0x1a83('0x88')](_0x3b3499[_0x1a83('0x54')],['ids','id'])||{})[_0x1a83('0x89')](function(_0x181992){for(var _0x598564=0x0;_0x598564<_0x3b3499[_0x1a83('0x54')][_0x1a83('0x77')][_0x1a83('0x43')];_0x598564+=0x1){socket[_0x1a83('0x73')](_0x1a83('0x74'),{'UserId':Number(_0x3b3499[_0x1a83('0x54')][_0x1a83('0x77')][_0x598564]),'FaxQueueId':Number(_0x3b3499[_0x1a83('0x5c')]['id'])});}return _0x181992;});}})[_0x1a83('0x30')](respondWithResult(_0x360f23,null))[_0x1a83('0x50')](handleError(_0x360f23,null));};exports[_0x1a83('0x84')]=function(_0x20e013,_0x2e0370,_0xd035c6){return db[_0x1a83('0x4e')][_0x1a83('0x52')]({'where':{'id':_0x20e013[_0x1a83('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2e0370,null))[_0x1a83('0x30')](function(_0x2d64e4){if(_0x2d64e4){return _0x2d64e4[_0x1a83('0x84')](_0x20e013[_0x1a83('0x3e')][_0x1a83('0x77')])[_0x1a83('0x30')](function(){if(_['isArray'](_0x20e013[_0x1a83('0x3e')][_0x1a83('0x77')])){for(var _0x467a37=0x0;_0x467a37<_0x20e013['query'][_0x1a83('0x77')]['length'];_0x467a37+=0x1){socket[_0x1a83('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x20e013['query']['ids'][_0x467a37]),'FaxQueueId':Number(_0x20e013[_0x1a83('0x5c')]['id'])});}}else{socket[_0x1a83('0x73')]('userFaxQueue:remove',{'UserId':Number(_0x20e013[_0x1a83('0x3e')]['ids']),'FaxQueueId':Number(_0x20e013[_0x1a83('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e0370,null))[_0x1a83('0x50')](handleError(_0x2e0370,null));};exports['getAgents']=function(_0xee6689,_0x153c70,_0x1a466d){var _0x10d21a={};var _0x44444={};var _0x1cee56;var _0x84c0dc;return db['FaxQueue'][_0x1a83('0x5f')]({'where':{'id':_0xee6689[_0x1a83('0x5c')]['id']}})[_0x1a83('0x30')](handleEntityNotFound(_0x153c70,null))[_0x1a83('0x30')](function(_0x454311){if(_0x454311){_0x1cee56=_0x454311;_0x44444[_0x1a83('0x3c')]=_['keys'](db[_0x1a83('0x62')][_0x1a83('0x38')]);_0x44444[_0x1a83('0x3e')]=_[_0x1a83('0x3d')](_0xee6689[_0x1a83('0x3e')]);_0x44444['filters']=_[_0x1a83('0x41')](_0x44444[_0x1a83('0x3c')],_0x44444[_0x1a83('0x3e')]);_0x10d21a[_0x1a83('0x40')]=_[_0x1a83('0x41')](_0x44444[_0x1a83('0x3c')],qs[_0x1a83('0x42')](_0xee6689[_0x1a83('0x3e')][_0x1a83('0x42')]));_0x10d21a['attributes']=_0x10d21a['attributes']['length']?_0x10d21a[_0x1a83('0x40')]:_0x44444[_0x1a83('0x3c')];_0x10d21a[_0x1a83('0x44')]=qs[_0x1a83('0x45')](_0xee6689['query']['sort']);_0x10d21a[_0x1a83('0x46')]=qs[_0x1a83('0x3f')](_[_0x1a83('0x47')](_0xee6689[_0x1a83('0x3e')],_0x44444[_0x1a83('0x3f')]));if(_0xee6689['query']['filter']){_0x10d21a[_0x1a83('0x46')]=_[_0x1a83('0x49')](_0x10d21a[_0x1a83('0x46')],{'$or':_['map'](_0x10d21a[_0x1a83('0x40')],function(_0xf3a4c9){var _0x3b6af4={};_0x3b6af4[_0xf3a4c9]={'$like':'%'+_0xee6689[_0x1a83('0x3e')]['filter']+'%'};return _0x3b6af4;})});}_0x10d21a=_[_0x1a83('0x49')]({},_0x10d21a,_0xee6689[_0x1a83('0x4b')]);return _0x1cee56[_0x1a83('0x8a')](_0x10d21a);}})[_0x1a83('0x30')](function(_0xbb6d62){if(_0xbb6d62){_0x84c0dc=_0xbb6d62[_0x1a83('0x43')];if(!_0xee6689['query'][_0x1a83('0x8b')](_0x1a83('0x61'))){_0x10d21a['limit']=qs[_0x1a83('0x28')](_0xee6689[_0x1a83('0x3e')][_0x1a83('0x28')]);_0x10d21a[_0x1a83('0x27')]=qs[_0x1a83('0x27')](_0xee6689['query'][_0x1a83('0x27')]);}return _0x1cee56[_0x1a83('0x8a')](_0x10d21a);}})[_0x1a83('0x30')](function(_0x9391ae){if(_0x9391ae){return _0x9391ae?{'count':_0x84c0dc,'rows':_0x9391ae}:null;}})[_0x1a83('0x30')](respondWithResult(_0x153c70,null))[_0x1a83('0x50')](handleError(_0x153c70,null));};
\ No newline at end of file
index 74e0f23..9ce8590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295b=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x5cae1e,_0x317e85){var _0x29a792=function(_0x30b439){while(--_0x30b439){_0x5cae1e['push'](_0x5cae1e['shift']());}};_0x29a792(++_0x317e85);}(_0x295b,0x12a));var _0xb295=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x295b[_0x346737];return _0x1ade2e;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xb295('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb295('0x1')](0x0);var events={'afterCreate':_0xb295('0x2'),'afterUpdate':_0xb295('0x3'),'afterDestroy':_0xb295('0x4')};function emitEvent(_0x2b41c2){return function(_0xcf08c2,_0x3a2562,_0x14f16b){FaxQueueEvents[_0xb295('0x5')](_0x2b41c2+':'+_0xcf08c2['id'],_0xcf08c2);FaxQueueEvents['emit'](_0x2b41c2,_0xcf08c2);_0x14f16b(null);};}for(var e in events){if(events[_0xb295('0x6')](e)){var event=events[e];FaxQueue[_0xb295('0x7')](e,emitEvent(event));}}module[_0xb295('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x6f8f=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x31ad1e,_0x5fdfb8){var _0x21215c=function(_0x1ad9d4){while(--_0x1ad9d4){_0x31ad1e['push'](_0x31ad1e['shift']());}};_0x21215c(++_0x5fdfb8);}(_0x6f8f,0x172));var _0xf6f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f8f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xf6f8('0x0'));var FaxQueue=require(_0xf6f8('0x1'))['db'][_0xf6f8('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xf6f8('0x3')](0x0);var events={'afterCreate':_0xf6f8('0x4'),'afterUpdate':_0xf6f8('0x5'),'afterDestroy':_0xf6f8('0x6')};function emitEvent(_0x540be7){return function(_0x1acb2a,_0x840c40,_0x42a672){FaxQueueEvents[_0xf6f8('0x7')](_0x540be7+':'+_0x1acb2a['id'],_0x1acb2a);FaxQueueEvents[_0xf6f8('0x7')](_0x540be7,_0x1acb2a);_0x42a672(null);};}for(var e in events){if(events[_0xf6f8('0x8')](e)){var event=events[e];FaxQueue[_0xf6f8('0x9')](e,emitEvent(event));}}module[_0xf6f8('0xa')]=FaxQueueEvents;
\ No newline at end of file
index 49ebb86..cec7bc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c12=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxQueue.attributes','exports','define'];(function(_0x4193f3,_0x4686c8){var _0x123c74=function(_0x256a23){while(--_0x256a23){_0x4193f3['push'](_0x4193f3['shift']());}};_0x123c74(++_0x4686c8);}(_0x1c12,0x16e));var _0x21c1=function(_0x44c39c,_0x5521b1){_0x44c39c=_0x44c39c-0x0;var _0x26dffa=_0x1c12[_0x44c39c];return _0x26dffa;};'use strict';var _=require(_0x21c1('0x0'));var util=require(_0x21c1('0x1'));var logger=require(_0x21c1('0x2'))(_0x21c1('0x3'));var moment=require(_0x21c1('0x4'));var BPromise=require(_0x21c1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x21c1('0x6'));var rimraf=require(_0x21c1('0x7'));var config=require('../../config/environment');var attributes=require(_0x21c1('0x8'));module[_0x21c1('0x9')]=function(_0x423dcb,_0x124b3e){return _0x423dcb[_0x21c1('0xa')](_0x21c1('0xb'),attributes,{'tableName':_0x21c1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0031=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','fax_queues','lodash'];(function(_0x59417a,_0x4f376c){var _0x2d3362=function(_0xac08b4){while(--_0xac08b4){_0x59417a['push'](_0x59417a['shift']());}};_0x2d3362(++_0x4f376c);}(_0x0031,0x74));var _0x1003=function(_0x1c8fb1,_0xb39e81){_0x1c8fb1=_0x1c8fb1-0x0;var _0x57f8e8=_0x0031[_0x1c8fb1];return _0x57f8e8;};'use strict';var _=require(_0x1003('0x0'));var util=require(_0x1003('0x1'));var logger=require(_0x1003('0x2'))(_0x1003('0x3'));var moment=require(_0x1003('0x4'));var BPromise=require(_0x1003('0x5'));var rp=require(_0x1003('0x6'));var fs=require('fs');var path=require(_0x1003('0x7'));var rimraf=require(_0x1003('0x8'));var config=require(_0x1003('0x9'));var attributes=require(_0x1003('0xa'));module['exports']=function(_0x1d2db5,_0x3de7fb){return _0x1d2db5[_0x1003('0xb')]('FaxQueue',attributes,{'tableName':_0x1003('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 63e6941..9aa4845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe08b=['model','find','ShowFaxQueue','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','request','then','info','request\x20sent','debug','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','limit','include','map','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe08b,0x1e4));var _0xbe08=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xe08b[_0x46aff0];return _0x9d78cf;};'use strict';var _=require('lodash');var util=require(_0xbe08('0x0'));var moment=require('moment');var BPromise=require(_0xbe08('0x1'));var rs=require(_0xbe08('0x2'));var fs=require('fs');var Redis=require(_0xbe08('0x3'));var db=require(_0xbe08('0x4'))['db'];var utils=require(_0xbe08('0x5'));var logger=require(_0xbe08('0x6'))(_0xbe08('0x7'));var config=require('../../config/environment');var jayson=require(_0xbe08('0x8'));var client=jayson[_0xbe08('0x9')]['http']({'port':0x232a});config['redis']=_[_0xbe08('0xa')](config[_0xbe08('0xb')],{'host':_0xbe08('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe08('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4c9c8c,_0x37463c,_0x41eb1d){return new BPromise(function(_0x123525,_0x479ef1){return client[_0xbe08('0xd')](_0x4c9c8c,_0x41eb1d)[_0xbe08('0xe')](function(_0x545d72){logger[_0xbe08('0xf')]('FaxQueue,\x20%s,\x20%s',_0x37463c,_0xbe08('0x10'));logger[_0xbe08('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x37463c,_0xbe08('0x10'),JSON[_0xbe08('0x12')](_0x545d72));if(_0x545d72[_0xbe08('0x13')]){if(_0x545d72[_0xbe08('0x13')][_0xbe08('0x14')]===0x1f4){logger[_0xbe08('0x13')](_0xbe08('0x15'),_0x37463c,_0x545d72[_0xbe08('0x13')]['message']);return _0x479ef1(_0x545d72[_0xbe08('0x13')][_0xbe08('0x16')]);}logger['error'](_0xbe08('0x15'),_0x37463c,_0x545d72['error'][_0xbe08('0x16')]);return _0x123525(_0x545d72[_0xbe08('0x13')][_0xbe08('0x16')]);}else{logger[_0xbe08('0xf')](_0xbe08('0x15'),_0x37463c,_0xbe08('0x10'));_0x123525(_0x545d72[_0xbe08('0x17')][_0xbe08('0x16')]);}})[_0xbe08('0x18')](function(_0x2c62ee){logger['error'](_0xbe08('0x15'),_0x37463c,_0x2c62ee);_0x479ef1(_0x2c62ee);});});}exports[_0xbe08('0x19')]=function(_0x12996c){var _0x3fe813=this;return new Promise(function(_0x22ee3d,_0x54cc92){return db[_0xbe08('0x1a')][_0xbe08('0x1b')]({'raw':_0x12996c['options']?_0x12996c['options']['raw']===undefined?!![]:![]:!![],'where':_0x12996c[_0xbe08('0x1c')]?_0x12996c[_0xbe08('0x1c')][_0xbe08('0x1d')]||null:null,'attributes':_0x12996c[_0xbe08('0x1c')]?_0x12996c['options']['attributes']||null:null,'limit':_0x12996c['options']?_0x12996c[_0xbe08('0x1c')][_0xbe08('0x1e')]||null:null,'include':_0x12996c[_0xbe08('0x1c')]?_0x12996c[_0xbe08('0x1c')][_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x12996c['options']['include'],function(_0x1aca83){return{'model':db[_0x1aca83['model']],'as':_0x1aca83['as'],'attributes':_0x1aca83[_0xbe08('0x21')],'include':_0x1aca83[_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x1aca83[_0xbe08('0x1f')],function(_0x3c664d){return{'model':db[_0x3c664d[_0xbe08('0x22')]],'as':_0x3c664d['as'],'attributes':_0x3c664d[_0xbe08('0x21')],'include':_0x3c664d[_0xbe08('0x1f')]?_['map'](_0x3c664d[_0xbe08('0x1f')],function(_0x52cf1d){return{'model':db[_0x52cf1d[_0xbe08('0x22')]],'as':_0x52cf1d['as'],'attributes':_0x52cf1d[_0xbe08('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbe08('0xe')](function(_0x35e443){logger[_0xbe08('0xf')](_0xbe08('0x19'),_0x12996c);logger[_0xbe08('0x11')](_0xbe08('0x19'),_0x12996c,JSON[_0xbe08('0x12')](_0x35e443));_0x22ee3d(_0x35e443);})[_0xbe08('0x18')](function(_0x1444f2){logger[_0xbe08('0x13')](_0xbe08('0x19'),_0x1444f2[_0xbe08('0x16')],_0x12996c);_0x54cc92(_0x3fe813['error'](0x1f4,_0x1444f2[_0xbe08('0x16')]));});});};exports['ShowFaxQueue']=function(_0x11794b){var _0x227b92=this;return new Promise(function(_0x1ff9eb,_0x51e38b){return db[_0xbe08('0x1a')][_0xbe08('0x23')]({'raw':_0x11794b[_0xbe08('0x1c')]?_0x11794b[_0xbe08('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x11794b[_0xbe08('0x1c')]?_0x11794b['options'][_0xbe08('0x1d')]||null:null,'attributes':_0x11794b['options']?_0x11794b[_0xbe08('0x1c')][_0xbe08('0x21')]||null:null,'include':_0x11794b[_0xbe08('0x1c')]?_0x11794b[_0xbe08('0x1c')][_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x11794b['options'][_0xbe08('0x1f')],function(_0x3bd86e){return{'model':db[_0x3bd86e[_0xbe08('0x22')]],'as':_0x3bd86e['as'],'attributes':_0x3bd86e['attributes'],'include':_0x3bd86e[_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x3bd86e[_0xbe08('0x1f')],function(_0x4bb75e){return{'model':db[_0x4bb75e[_0xbe08('0x22')]],'as':_0x4bb75e['as'],'attributes':_0x4bb75e[_0xbe08('0x21')],'include':_0x4bb75e[_0xbe08('0x1f')]?_[_0xbe08('0x20')](_0x4bb75e[_0xbe08('0x1f')],function(_0x8a0d07){return{'model':db[_0x8a0d07[_0xbe08('0x22')]],'as':_0x8a0d07['as'],'attributes':_0x8a0d07['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe08('0xe')](function(_0x260abf){logger['info'](_0xbe08('0x24'),_0x11794b);logger['debug'](_0xbe08('0x24'),_0x11794b,JSON[_0xbe08('0x12')](_0x260abf));_0x1ff9eb(_0x260abf);})[_0xbe08('0x18')](function(_0x163723){logger[_0xbe08('0x13')](_0xbe08('0x24'),_0x163723['message'],_0x11794b);_0x51e38b(_0x227b92[_0xbe08('0x13')](0x1f4,_0x163723['message']));});});};
\ No newline at end of file
+var _0xee18=['result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowFaxQueue','FaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x4601f3,_0x4d2401){var _0x2afb49=function(_0x297f98){while(--_0x297f98){_0x4601f3['push'](_0x4601f3['shift']());}};_0x2afb49(++_0x4d2401);}(_0xee18,0xe6));var _0x8ee1=function(_0x1d5677,_0x342d27){_0x1d5677=_0x1d5677-0x0;var _0x274227=_0xee18[_0x1d5677];return _0x274227;};'use strict';var _=require(_0x8ee1('0x0'));var util=require(_0x8ee1('0x1'));var moment=require(_0x8ee1('0x2'));var BPromise=require(_0x8ee1('0x3'));var rs=require(_0x8ee1('0x4'));var fs=require('fs');var Redis=require(_0x8ee1('0x5'));var db=require(_0x8ee1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ee1('0x7'))(_0x8ee1('0x8'));var config=require('../../config/environment');var jayson=require(_0x8ee1('0x9'));var client=jayson[_0x8ee1('0xa')][_0x8ee1('0xb')]({'port':0x232a});config[_0x8ee1('0xc')]=_[_0x8ee1('0xd')](config[_0x8ee1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ee1('0xe'))(new Redis(config[_0x8ee1('0xc')]));require(_0x8ee1('0xf'))[_0x8ee1('0x10')](socket);function respondWithRpcPromise(_0x1d5252,_0x2e12b5,_0x2f1784){return new BPromise(function(_0x4466f2,_0x4c17f4){return client[_0x8ee1('0x11')](_0x1d5252,_0x2f1784)[_0x8ee1('0x12')](function(_0x33366c){logger[_0x8ee1('0x13')](_0x8ee1('0x14'),_0x2e12b5,_0x8ee1('0x15'));logger[_0x8ee1('0x16')](_0x8ee1('0x17'),_0x2e12b5,_0x8ee1('0x15'),JSON[_0x8ee1('0x18')](_0x33366c));if(_0x33366c['error']){if(_0x33366c['error'][_0x8ee1('0x19')]===0x1f4){logger['error'](_0x8ee1('0x14'),_0x2e12b5,_0x33366c['error']['message']);return _0x4c17f4(_0x33366c[_0x8ee1('0x1a')]['message']);}logger[_0x8ee1('0x1a')](_0x8ee1('0x14'),_0x2e12b5,_0x33366c[_0x8ee1('0x1a')]['message']);return _0x4466f2(_0x33366c['error'][_0x8ee1('0x1b')]);}else{logger[_0x8ee1('0x13')]('FaxQueue,\x20%s,\x20%s',_0x2e12b5,_0x8ee1('0x15'));_0x4466f2(_0x33366c[_0x8ee1('0x1c')][_0x8ee1('0x1b')]);}})[_0x8ee1('0x1d')](function(_0x4b2a35){logger[_0x8ee1('0x1a')](_0x8ee1('0x14'),_0x2e12b5,_0x4b2a35);_0x4c17f4(_0x4b2a35);});});}exports[_0x8ee1('0x1e')]=function(_0x38b07d){var _0x2abee1=this;return new Promise(function(_0x5979f9,_0x2fdc58){return db['FaxQueue'][_0x8ee1('0x1f')]({'raw':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d[_0x8ee1('0x20')][_0x8ee1('0x21')]===undefined?!![]:![]:!![],'where':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d['options'][_0x8ee1('0x22')]||null:null,'attributes':_0x38b07d['options']?_0x38b07d[_0x8ee1('0x20')][_0x8ee1('0x23')]||null:null,'limit':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d[_0x8ee1('0x20')][_0x8ee1('0x24')]||null:null,'include':_0x38b07d[_0x8ee1('0x20')]?_0x38b07d['options']['include']?_[_0x8ee1('0x25')](_0x38b07d['options'][_0x8ee1('0x26')],function(_0x265ebf){return{'model':db[_0x265ebf['model']],'as':_0x265ebf['as'],'attributes':_0x265ebf[_0x8ee1('0x23')],'include':_0x265ebf['include']?_[_0x8ee1('0x25')](_0x265ebf[_0x8ee1('0x26')],function(_0x282e86){return{'model':db[_0x282e86[_0x8ee1('0x27')]],'as':_0x282e86['as'],'attributes':_0x282e86[_0x8ee1('0x23')],'include':_0x282e86[_0x8ee1('0x26')]?_[_0x8ee1('0x25')](_0x282e86['include'],function(_0x14bf94){return{'model':db[_0x14bf94[_0x8ee1('0x27')]],'as':_0x14bf94['as'],'attributes':_0x14bf94[_0x8ee1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8ee1('0x12')](function(_0x32dddf){logger[_0x8ee1('0x13')](_0x8ee1('0x1e'),_0x38b07d);logger[_0x8ee1('0x16')](_0x8ee1('0x1e'),_0x38b07d,JSON[_0x8ee1('0x18')](_0x32dddf));_0x5979f9(_0x32dddf);})[_0x8ee1('0x1d')](function(_0x2c1c56){logger[_0x8ee1('0x1a')]('GetFaxQueue',_0x2c1c56[_0x8ee1('0x1b')],_0x38b07d);_0x2fdc58(_0x2abee1['error'](0x1f4,_0x2c1c56[_0x8ee1('0x1b')]));});});};exports[_0x8ee1('0x28')]=function(_0x40c518){var _0x27a169=this;return new Promise(function(_0x2b4dc9,_0x4fc7ae){return db[_0x8ee1('0x29')][_0x8ee1('0x2a')]({'raw':_0x40c518[_0x8ee1('0x20')]?_0x40c518[_0x8ee1('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x40c518[_0x8ee1('0x20')]?_0x40c518[_0x8ee1('0x20')]['where']||null:null,'attributes':_0x40c518[_0x8ee1('0x20')]?_0x40c518[_0x8ee1('0x20')][_0x8ee1('0x23')]||null:null,'include':_0x40c518['options']?_0x40c518['options'][_0x8ee1('0x26')]?_[_0x8ee1('0x25')](_0x40c518[_0x8ee1('0x20')][_0x8ee1('0x26')],function(_0x43966e){return{'model':db[_0x43966e[_0x8ee1('0x27')]],'as':_0x43966e['as'],'attributes':_0x43966e[_0x8ee1('0x23')],'include':_0x43966e[_0x8ee1('0x26')]?_[_0x8ee1('0x25')](_0x43966e['include'],function(_0x49d5fa){return{'model':db[_0x49d5fa[_0x8ee1('0x27')]],'as':_0x49d5fa['as'],'attributes':_0x49d5fa['attributes'],'include':_0x49d5fa['include']?_[_0x8ee1('0x25')](_0x49d5fa[_0x8ee1('0x26')],function(_0x2f1358){return{'model':db[_0x2f1358['model']],'as':_0x2f1358['as'],'attributes':_0x2f1358[_0x8ee1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x8ee1('0x12')](function(_0x23646e){logger[_0x8ee1('0x13')]('ShowFaxQueue',_0x40c518);logger[_0x8ee1('0x16')](_0x8ee1('0x28'),_0x40c518,JSON[_0x8ee1('0x18')](_0x23646e));_0x2b4dc9(_0x23646e);})[_0x8ee1('0x1d')](function(_0x1e9791){logger[_0x8ee1('0x1a')]('ShowFaxQueue',_0x1e9791[_0x8ee1('0x1b')],_0x40c518);_0x4fc7ae(_0x27a169[_0x8ee1('0x1a')](0x1f4,_0x1e9791['message']));});});};
\ No newline at end of file
index 28dc73d..e4e1fa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x906c=['update','emit','removeListener','register','faxQueue:','./faxQueue.events','save','remove'];(function(_0x135037,_0x4b1e21){var _0x45cb37=function(_0x277311){while(--_0x277311){_0x135037['push'](_0x135037['shift']());}};_0x45cb37(++_0x4b1e21);}(_0x906c,0x17d));var _0xc906=function(_0x3ede7b,_0x4b3aa1){_0x3ede7b=_0x3ede7b-0x0;var _0xe00dc5=_0x906c[_0x3ede7b];return _0xe00dc5;};'use strict';var FaxQueueEvents=require(_0xc906('0x0'));var events=[_0xc906('0x1'),_0xc906('0x2'),_0xc906('0x3')];function createListener(_0x2fcd5b,_0x4393ce){return function(_0x25480d){_0x4393ce[_0xc906('0x4')](_0x2fcd5b,_0x25480d);};}function removeListener(_0xf58a83,_0x1d9c1e){return function(){FaxQueueEvents[_0xc906('0x5')](_0xf58a83,_0x1d9c1e);};}exports[_0xc906('0x6')]=function(_0x1be903){for(var _0x2c4fe7=0x0,_0x3b9c12=events['length'];_0x2c4fe7<_0x3b9c12;_0x2c4fe7++){var _0x5ab52a=events[_0x2c4fe7];var _0x431dba=createListener(_0xc906('0x7')+_0x5ab52a,_0x1be903);FaxQueueEvents['on'](_0x5ab52a,_0x431dba);}};
\ No newline at end of file
+var _0x4f96=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x280ae7,_0x456fb1){var _0x418b9e=function(_0x4d730d){while(--_0x4d730d){_0x280ae7['push'](_0x280ae7['shift']());}};_0x418b9e(++_0x456fb1);}(_0x4f96,0xb9));var _0x64f9=function(_0x25b242,_0x161fd7){_0x25b242=_0x25b242-0x0;var _0x4a18ad=_0x4f96[_0x25b242];return _0x4a18ad;};'use strict';var FaxQueueEvents=require(_0x64f9('0x0'));var events=[_0x64f9('0x1'),_0x64f9('0x2'),_0x64f9('0x3')];function createListener(_0x241264,_0x31e759){return function(_0x4a87d5){_0x31e759[_0x64f9('0x4')](_0x241264,_0x4a87d5);};}function removeListener(_0x4c95fa,_0x5c4300){return function(){FaxQueueEvents[_0x64f9('0x5')](_0x4c95fa,_0x5c4300);};}exports['register']=function(_0x727113){for(var _0x307cb5=0x0,_0x3569eb=events[_0x64f9('0x6')];_0x307cb5<_0x3569eb;_0x307cb5++){var _0x1bc33d=events[_0x307cb5];var _0x512be8=createListener(_0x64f9('0x7')+_0x1bc33d,_0x727113);FaxQueueEvents['on'](_0x1bc33d,_0x512be8);}};
\ No newline at end of file
index 954a2d5..c72fe6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5a=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','delete','removeTeams','exports','multer','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9a5a,0x194));var _0xa9a5=function(_0x40e564,_0x4d2e8b){_0x40e564=_0x40e564-0x0;var _0x4131b3=_0x9a5a[_0x40e564];return _0x4131b3;};'use strict';var multer=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var path=require(_0xa9a5('0x2'));var timeout=require(_0xa9a5('0x3'));var express=require(_0xa9a5('0x4'));var router=express['Router']();var fs_extra=require(_0xa9a5('0x5'));var auth=require(_0xa9a5('0x6'));var interaction=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var controller=require(_0xa9a5('0x9'));router[_0xa9a5('0xa')]('/',auth['isAuthenticated'](),controller[_0xa9a5('0xb')]);router[_0xa9a5('0xa')](_0xa9a5('0xc'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa9a5('0xf')]);router[_0xa9a5('0xa')](_0xa9a5('0x10'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x11')]);router[_0xa9a5('0xa')](_0xa9a5('0x12'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xa9a5('0x13'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x14')]);router[_0xa9a5('0x15')]('/',auth[_0xa9a5('0xd')](),controller['create']);router[_0xa9a5('0x15')](_0xa9a5('0x12'),auth[_0xa9a5('0xd')](),controller[_0xa9a5('0x16')]);router[_0xa9a5('0x15')](_0xa9a5('0x13'),auth['isAuthenticated'](),controller[_0xa9a5('0x17')]);router[_0xa9a5('0x18')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['update']);router[_0xa9a5('0x1a')](_0xa9a5('0x19'),auth[_0xa9a5('0xd')](),controller['destroy']);router[_0xa9a5('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa9a5('0x1b')]);router[_0xa9a5('0x1a')]('/:id/users',auth[_0xa9a5('0xd')](),controller['removeAgents']);module[_0xa9a5('0x1c')]=router;
\ No newline at end of file
+var _0xdeb3=['exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','put','update','delete','removeTeams','removeAgents'];(function(_0x282612,_0x45e458){var _0x36b461=function(_0x5b07e0){while(--_0x5b07e0){_0x282612['push'](_0x282612['shift']());}};_0x36b461(++_0x45e458);}(_0xdeb3,0xb7));var _0x3deb=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdeb3[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0x3deb('0x0'));var path=require(_0x3deb('0x1'));var timeout=require(_0x3deb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3deb('0x3'));var auth=require(_0x3deb('0x4'));var interaction=require(_0x3deb('0x5'));var config=require(_0x3deb('0x6'));var controller=require(_0x3deb('0x7'));router['get']('/',auth[_0x3deb('0x8')](),controller['index']);router[_0x3deb('0x9')]('/describe',auth[_0x3deb('0x8')](),controller[_0x3deb('0xa')]);router[_0x3deb('0x9')](_0x3deb('0xb'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xc')]);router[_0x3deb('0x9')](_0x3deb('0xd'),auth[_0x3deb('0x8')](),controller['getMembers']);router['get'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0xf')]);router['get'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x11')]);router[_0x3deb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x13')]);router['post'](_0x3deb('0x10'),auth[_0x3deb('0x8')](),controller['addAgents']);router[_0x3deb('0x14')](_0x3deb('0xb'),auth['isAuthenticated'](),controller[_0x3deb('0x15')]);router['delete'](_0x3deb('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x3deb('0x16')](_0x3deb('0xe'),auth[_0x3deb('0x8')](),controller[_0x3deb('0x17')]);router[_0x3deb('0x16')](_0x3deb('0x10'),auth['isAuthenticated'](),controller[_0x3deb('0x18')]);module[_0x3deb('0x19')]=router;
\ No newline at end of file
index bc4e6fa..5abef7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf49a=['sequelize','exports','STRING','DATE','moment'];(function(_0x18dc83,_0x462295){var _0x8236a2=function(_0x448df4){while(--_0x448df4){_0x18dc83['push'](_0x18dc83['shift']());}};_0x8236a2(++_0x462295);}(_0xf49a,0x199));var _0xaf49=function(_0x2c74e2,_0x78daf1){_0x2c74e2=_0x2c74e2-0x0;var _0x14e004=_0xf49a[_0x2c74e2];return _0x14e004;};'use strict';var moment=require(_0xaf49('0x0'));var Sequelize=require(_0xaf49('0x1'));module[_0xaf49('0x2')]={'uniqueid':{'type':Sequelize[_0xaf49('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaf49('0x3')]},'joinAt':{'type':Sequelize[_0xaf49('0x4')]},'leaveAt':{'type':Sequelize[_0xaf49('0x4')]},'acceptAt':{'type':Sequelize[_0xaf49('0x4')]},'exitAt':{'type':Sequelize[_0xaf49('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdab2=['DATE','moment','sequelize','exports','STRING'];(function(_0x5e51eb,_0x1fe638){var _0x1be186=function(_0x3a30ce){while(--_0x3a30ce){_0x5e51eb['push'](_0x5e51eb['shift']());}};_0x1be186(++_0x1fe638);}(_0xdab2,0x17d));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x2dab('0x0'));var Sequelize=require(_0x2dab('0x1'));module[_0x2dab('0x2')]={'uniqueid':{'type':Sequelize[_0x2dab('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2dab('0x3')]},'joinAt':{'type':Sequelize[_0x2dab('0x4')]},'leaveAt':{'type':Sequelize[_0x2dab('0x4')]},'acceptAt':{'type':Sequelize[_0x2dab('0x4')]},'exitAt':{'type':Sequelize[_0x2dab('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 2b4ea7a..02fcdf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae7b=['save','update','then','sendStatus','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject'];(function(_0x328e86,_0xd152a9){var _0x943d38=function(_0x33f4da){while(--_0x33f4da){_0x328e86['push'](_0x328e86['shift']());}};_0x943d38(++_0xd152a9);}(_0xae7b,0xbe));var _0xbae7=function(_0x2e9be4,_0x463bf6){_0x2e9be4=_0x2e9be4-0x0;var _0x22cb76=_0xae7b[_0x2e9be4];return _0x22cb76;};'use strict';var emlformat=require(_0xbae7('0x0'));var rimraf=require(_0xbae7('0x1'));var zipdir=require(_0xbae7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbae7('0x3'));var BPromise=require(_0xbae7('0x4'));var Mustache=require(_0xbae7('0x5'));var util=require(_0xbae7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbae7('0x7'));var ejs=require(_0xbae7('0x8'));var fs=require('fs');var fs_extra=require(_0xbae7('0x9'));var _=require('lodash');var squel=require(_0xbae7('0xa'));var crypto=require('crypto');var jsforce=require(_0xbae7('0xb'));var deskjs=require(_0xbae7('0xc'));var toCsv=require(_0xbae7('0x7'));var querystring=require('querystring');var Papa=require(_0xbae7('0xd'));var Redis=require('ioredis');var authService=require(_0xbae7('0xe'));var qs=require(_0xbae7('0xf'));var as=require(_0xbae7('0x10'));var hardwareService=require(_0xbae7('0x11'));var logger=require('../../config/logger')(_0xbae7('0x12'));var utils=require(_0xbae7('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbae7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d17ae,_0x4090a1){_0x4090a1=_0x4090a1||0xcc;return function(_0x5b1abe){if(_0x5b1abe){return _0x3d17ae['sendStatus'](_0x4090a1);}return _0x3d17ae[_0xbae7('0x15')](_0x4090a1)[_0xbae7('0x16')]();};}function respondWithResult(_0x43e4ca,_0x25d1a){_0x25d1a=_0x25d1a||0xc8;return function(_0x4cc0a9){if(_0x4cc0a9){return _0x43e4ca[_0xbae7('0x15')](_0x25d1a)['json'](_0x4cc0a9);}};}function respondWithFilteredResult(_0x5aae99,_0x249669){return function(_0xb272c4){if(_0xb272c4){var _0x1b9ee1=typeof _0x249669[_0xbae7('0x17')]===_0xbae7('0x18')&&typeof _0x249669[_0xbae7('0x19')]==='undefined';var _0x1b2949=_0xb272c4[_0xbae7('0x1a')];var _0x99d88=_0x1b9ee1?0x0:_0x249669[_0xbae7('0x17')];var _0x1fc9fb=_0x1b9ee1?_0xb272c4['count']:_0x249669['offset']+_0x249669['limit'];var _0xa9ed79;if(_0x1fc9fb>=_0x1b2949){_0x1fc9fb=_0x1b2949;_0xa9ed79=0xc8;}else{_0xa9ed79=0xce;}_0x5aae99[_0xbae7('0x15')](_0xa9ed79);return _0x5aae99[_0xbae7('0x1b')](_0xbae7('0x1c'),_0x99d88+'-'+_0x1fc9fb+'/'+_0x1b2949)[_0xbae7('0x1d')](_0xb272c4);}return null;};}function patchUpdates(_0x519980){return function(_0xd87dc2){try{jsonpatch[_0xbae7('0x1e')](_0xd87dc2,_0x519980,!![]);}catch(_0x34a82b){return BPromise[_0xbae7('0x1f')](_0x34a82b);}return _0xd87dc2[_0xbae7('0x20')]();};}function saveUpdates(_0x502f06,_0x32d772){return function(_0x3e4569){if(_0x3e4569){return _0x3e4569[_0xbae7('0x21')](_0x502f06)[_0xbae7('0x22')](function(_0xb5d7f3){return _0xb5d7f3;});}return null;};}function removeEntity(_0x384ea6,_0x32f8eb){return function(_0x5c0245){if(_0x5c0245){return _0x5c0245['destroy']()[_0xbae7('0x22')](function(){_0x384ea6[_0xbae7('0x15')](0xcc)[_0xbae7('0x16')]();});}};}function handleEntityNotFound(_0x375df5,_0x61170a){return function(_0x3e003d){if(!_0x3e003d){_0x375df5[_0xbae7('0x23')](0x194);}return _0x3e003d;};}function handleError(_0x1b5caa,_0x1399bc){_0x1399bc=_0x1399bc||0x1f4;return function(_0x3e104e){logger[_0xbae7('0x24')](_0x3e104e[_0xbae7('0x25')]);if(_0x3e104e['name']){delete _0x3e104e['name'];}_0x1b5caa['status'](_0x1399bc)[_0xbae7('0x26')](_0x3e104e);};}exports[_0xbae7('0x27')]=function(_0x203848,_0x12dd23){var _0x12797a={},_0x2d8202={},_0x47e12b={'count':0x0,'rows':[]};var _0x5d702f=_[_0xbae7('0x28')](db[_0xbae7('0x29')][_0xbae7('0x2a')],function(_0x258c08){return{'name':_0x258c08[_0xbae7('0x2b')],'type':_0x258c08[_0xbae7('0x2c')]['key']};});_0x2d8202[_0xbae7('0x2d')]=_[_0xbae7('0x28')](_0x5d702f,_0xbae7('0x2e'));_0x2d8202[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x203848[_0xbae7('0x2f')]);_0x2d8202[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x2d8202[_0xbae7('0x2d')],_0x2d8202[_0xbae7('0x2f')]);_0x12797a[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x2d8202['model'],qs[_0xbae7('0x34')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x12797a['attributes']=_0x12797a[_0xbae7('0x33')][_0xbae7('0x35')]?_0x12797a['attributes']:_0x2d8202[_0xbae7('0x2d')];if(!_0x203848[_0xbae7('0x2f')][_0xbae7('0x36')](_0xbae7('0x37'))){_0x12797a[_0xbae7('0x19')]=qs[_0xbae7('0x19')](_0x203848[_0xbae7('0x2f')][_0xbae7('0x19')]);_0x12797a[_0xbae7('0x17')]=qs['offset'](_0x203848['query'][_0xbae7('0x17')]);}_0x12797a[_0xbae7('0x38')]=qs['sort'](_0x203848[_0xbae7('0x2f')][_0xbae7('0x39')]);_0x12797a[_0xbae7('0x3a')]=qs[_0xbae7('0x31')](_[_0xbae7('0x3b')](_0x203848[_0xbae7('0x2f')],_0x2d8202[_0xbae7('0x31')]),_0x5d702f);if(_0x203848[_0xbae7('0x2f')]['filter']){_0x12797a['where']=_[_0xbae7('0x3c')](_0x12797a['where'],{'$or':_[_0xbae7('0x28')](_0x5d702f,function(_0x59e90b){if(_0x59e90b[_0xbae7('0x2c')]!==_0xbae7('0x3d')){var _0x1fdb4f={};_0x1fdb4f[_0x59e90b[_0xbae7('0x2e')]]={'$like':'%'+_0x203848[_0xbae7('0x2f')][_0xbae7('0x3e')]+'%'};return _0x1fdb4f;}})});}_0x12797a=_['merge']({},_0x12797a,_0x203848[_0xbae7('0x3f')]);var _0x4fa0ba={'where':_0x12797a['where']};return db[_0xbae7('0x29')][_0xbae7('0x1a')](_0x4fa0ba)[_0xbae7('0x22')](function(_0xc1c69e){_0x47e12b[_0xbae7('0x1a')]=_0xc1c69e;if(_0x203848['query'][_0xbae7('0x40')]){_0x12797a[_0xbae7('0x41')]=[{'all':!![]}];}return db[_0xbae7('0x29')][_0xbae7('0x42')](_0x12797a);})[_0xbae7('0x22')](function(_0x5047b0){_0x47e12b[_0xbae7('0x43')]=_0x5047b0;return _0x47e12b;})['then'](respondWithFilteredResult(_0x12dd23,_0x12797a))[_0xbae7('0x44')](handleError(_0x12dd23,null));};exports[_0xbae7('0x45')]=function(_0x3647a8,_0x472686){var _0x1895ef={'raw':!![],'where':{'id':_0x3647a8[_0xbae7('0x46')]['id']}},_0x57f345={};_0x57f345[_0xbae7('0x2d')]=_[_0xbae7('0x30')](db[_0xbae7('0x29')][_0xbae7('0x2a')]);_0x57f345[_0xbae7('0x2f')]=_[_0xbae7('0x30')](_0x3647a8['query']);_0x57f345[_0xbae7('0x31')]=_[_0xbae7('0x32')](_0x57f345[_0xbae7('0x2d')],_0x57f345[_0xbae7('0x2f')]);_0x1895ef[_0xbae7('0x33')]=_[_0xbae7('0x32')](_0x57f345['model'],qs['fields'](_0x3647a8[_0xbae7('0x2f')][_0xbae7('0x34')]));_0x1895ef['attributes']=_0x1895ef[_0xbae7('0x33')][_0xbae7('0x35')]?_0x1895ef[_0xbae7('0x33')]:_0x57f345[_0xbae7('0x2d')];if(_0x3647a8[_0xbae7('0x2f')]['includeAll']){_0x1895ef[_0xbae7('0x41')]=[{'all':!![]}];}_0x1895ef=_[_0xbae7('0x3c')]({},_0x1895ef,_0x3647a8[_0xbae7('0x3f')]);return db[_0xbae7('0x29')]['find'](_0x1895ef)[_0xbae7('0x22')](handleEntityNotFound(_0x472686,null))[_0xbae7('0x22')](respondWithResult(_0x472686,null))[_0xbae7('0x44')](handleError(_0x472686,null));};exports[_0xbae7('0x47')]=function(_0x50b52b,_0x11722e){return db[_0xbae7('0x29')][_0xbae7('0x47')](_0x50b52b[_0xbae7('0x48')],{})['then'](respondWithResult(_0x11722e,0xc9))[_0xbae7('0x44')](handleError(_0x11722e,null));};exports[_0xbae7('0x21')]=function(_0xb6df1f,_0x363b7b){if(_0xb6df1f[_0xbae7('0x48')]['id']){delete _0xb6df1f['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0xb6df1f[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x363b7b,null))[_0xbae7('0x22')](saveUpdates(_0xb6df1f[_0xbae7('0x48')],null))[_0xbae7('0x22')](respondWithResult(_0x363b7b,null))['catch'](handleError(_0x363b7b,null));};exports['destroy']=function(_0x1bb00a,_0x46f0a9){return db[_0xbae7('0x29')]['find']({'where':{'id':_0x1bb00a[_0xbae7('0x46')]['id']}})[_0xbae7('0x22')](handleEntityNotFound(_0x46f0a9,null))[_0xbae7('0x22')](removeEntity(_0x46f0a9,null))[_0xbae7('0x44')](handleError(_0x46f0a9,null));};exports[_0xbae7('0x49')]=function(_0x4cf377,_0x2ccd2c){return db['FaxQueueReport'][_0xbae7('0x49')]()[_0xbae7('0x22')](respondWithResult(_0x2ccd2c,null))[_0xbae7('0x44')](handleError(_0x2ccd2c,null));};
\ No newline at end of file
+var _0x4b8a=['set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset'];(function(_0x1e7e12,_0x586d42){var _0x32781c=function(_0x39ee5b){while(--_0x39ee5b){_0x1e7e12['push'](_0x1e7e12['shift']());}};_0x32781c(++_0x586d42);}(_0x4b8a,0xd3));var _0xa4b8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4b8a[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4b8('0x1'));var rp=require(_0xa4b8('0x2'));var moment=require(_0xa4b8('0x3'));var BPromise=require(_0xa4b8('0x4'));var Mustache=require(_0xa4b8('0x5'));var util=require(_0xa4b8('0x6'));var path=require(_0xa4b8('0x7'));var sox=require(_0xa4b8('0x8'));var csv=require(_0xa4b8('0x9'));var ejs=require(_0xa4b8('0xa'));var fs=require('fs');var fs_extra=require(_0xa4b8('0xb'));var _=require(_0xa4b8('0xc'));var squel=require(_0xa4b8('0xd'));var crypto=require(_0xa4b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa4b8('0xf'));var toCsv=require(_0xa4b8('0x9'));var querystring=require(_0xa4b8('0x10'));var Papa=require(_0xa4b8('0x11'));var Redis=require(_0xa4b8('0x12'));var authService=require(_0xa4b8('0x13'));var qs=require(_0xa4b8('0x14'));var as=require(_0xa4b8('0x15'));var hardwareService=require(_0xa4b8('0x16'));var logger=require(_0xa4b8('0x17'))(_0xa4b8('0x18'));var utils=require(_0xa4b8('0x19'));var config=require(_0xa4b8('0x1a'));var licenseUtil=require(_0xa4b8('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c2d6b,_0x83aa39){_0x83aa39=_0x83aa39||0xcc;return function(_0x488b99){if(_0x488b99){return _0x4c2d6b[_0xa4b8('0x1c')](_0x83aa39);}return _0x4c2d6b[_0xa4b8('0x1d')](_0x83aa39)['end']();};}function respondWithResult(_0x2f3199,_0x157d7f){_0x157d7f=_0x157d7f||0xc8;return function(_0x1c8369){if(_0x1c8369){return _0x2f3199[_0xa4b8('0x1d')](_0x157d7f)[_0xa4b8('0x1e')](_0x1c8369);}};}function respondWithFilteredResult(_0x3bba1b,_0x238cac){return function(_0x443d7f){if(_0x443d7f){var _0x2fd884=typeof _0x238cac['offset']===_0xa4b8('0x1f')&&typeof _0x238cac[_0xa4b8('0x20')]==='undefined';var _0x315df1=_0x443d7f[_0xa4b8('0x21')];var _0x215cdf=_0x2fd884?0x0:_0x238cac[_0xa4b8('0x22')];var _0x20cf62=_0x2fd884?_0x443d7f['count']:_0x238cac['offset']+_0x238cac['limit'];var _0x518134;if(_0x20cf62>=_0x315df1){_0x20cf62=_0x315df1;_0x518134=0xc8;}else{_0x518134=0xce;}_0x3bba1b[_0xa4b8('0x1d')](_0x518134);return _0x3bba1b[_0xa4b8('0x23')](_0xa4b8('0x24'),_0x215cdf+'-'+_0x20cf62+'/'+_0x315df1)[_0xa4b8('0x1e')](_0x443d7f);}return null;};}function patchUpdates(_0x39676c){return function(_0x113812){try{jsonpatch[_0xa4b8('0x25')](_0x113812,_0x39676c,!![]);}catch(_0x10534b){return BPromise[_0xa4b8('0x26')](_0x10534b);}return _0x113812[_0xa4b8('0x27')]();};}function saveUpdates(_0xbdc088,_0x46c994){return function(_0x144e62){if(_0x144e62){return _0x144e62[_0xa4b8('0x28')](_0xbdc088)[_0xa4b8('0x29')](function(_0xeb5ae1){return _0xeb5ae1;});}return null;};}function removeEntity(_0x34f5d2,_0x4b28ae){return function(_0x27530c){if(_0x27530c){return _0x27530c[_0xa4b8('0x2a')]()['then'](function(){_0x34f5d2[_0xa4b8('0x1d')](0xcc)[_0xa4b8('0x2b')]();});}};}function handleEntityNotFound(_0x5b0257,_0x58b94d){return function(_0x4cd363){if(!_0x4cd363){_0x5b0257[_0xa4b8('0x1c')](0x194);}return _0x4cd363;};}function handleError(_0x2adaa0,_0x239b62){_0x239b62=_0x239b62||0x1f4;return function(_0xa11b76){logger['error'](_0xa11b76[_0xa4b8('0x2c')]);if(_0xa11b76[_0xa4b8('0x2d')]){delete _0xa11b76[_0xa4b8('0x2d')];}_0x2adaa0[_0xa4b8('0x1d')](_0x239b62)['send'](_0xa11b76);};}exports[_0xa4b8('0x2e')]=function(_0x4475eb,_0x3d5ed1){var _0x39b754={},_0x33fa28={},_0x3a6652={'count':0x0,'rows':[]};var _0x3d60ff=_[_0xa4b8('0x2f')](db[_0xa4b8('0x30')][_0xa4b8('0x31')],function(_0x41f627){return{'name':_0x41f627[_0xa4b8('0x32')],'type':_0x41f627['type'][_0xa4b8('0x33')]};});_0x33fa28[_0xa4b8('0x34')]=_[_0xa4b8('0x2f')](_0x3d60ff,'name');_0x33fa28[_0xa4b8('0x35')]=_[_0xa4b8('0x36')](_0x4475eb['query']);_0x33fa28['filters']=_['intersection'](_0x33fa28['model'],_0x33fa28[_0xa4b8('0x35')]);_0x39b754['attributes']=_[_0xa4b8('0x37')](_0x33fa28[_0xa4b8('0x34')],qs[_0xa4b8('0x38')](_0x4475eb['query'][_0xa4b8('0x38')]));_0x39b754[_0xa4b8('0x39')]=_0x39b754[_0xa4b8('0x39')][_0xa4b8('0x3a')]?_0x39b754[_0xa4b8('0x39')]:_0x33fa28['model'];if(!_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x3b')](_0xa4b8('0x3c'))){_0x39b754[_0xa4b8('0x20')]=qs[_0xa4b8('0x20')](_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x20')]);_0x39b754['offset']=qs[_0xa4b8('0x22')](_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x22')]);}_0x39b754[_0xa4b8('0x3d')]=qs[_0xa4b8('0x3e')](_0x4475eb['query'][_0xa4b8('0x3e')]);_0x39b754[_0xa4b8('0x3f')]=qs[_0xa4b8('0x40')](_[_0xa4b8('0x41')](_0x4475eb['query'],_0x33fa28['filters']),_0x3d60ff);if(_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x42')]){_0x39b754[_0xa4b8('0x3f')]=_[_0xa4b8('0x43')](_0x39b754[_0xa4b8('0x3f')],{'$or':_[_0xa4b8('0x2f')](_0x3d60ff,function(_0x22555b){if(_0x22555b[_0xa4b8('0x44')]!==_0xa4b8('0x45')){var _0xed5f77={};_0xed5f77[_0x22555b[_0xa4b8('0x2d')]]={'$like':'%'+_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x42')]+'%'};return _0xed5f77;}})});}_0x39b754=_[_0xa4b8('0x43')]({},_0x39b754,_0x4475eb['options']);var _0x35d62c={'where':_0x39b754['where']};return db[_0xa4b8('0x30')][_0xa4b8('0x21')](_0x35d62c)['then'](function(_0x5b9529){_0x3a6652[_0xa4b8('0x21')]=_0x5b9529;if(_0x4475eb[_0xa4b8('0x35')][_0xa4b8('0x46')]){_0x39b754[_0xa4b8('0x47')]=[{'all':!![]}];}return db[_0xa4b8('0x30')][_0xa4b8('0x48')](_0x39b754);})['then'](function(_0x9ac740){_0x3a6652[_0xa4b8('0x49')]=_0x9ac740;return _0x3a6652;})[_0xa4b8('0x29')](respondWithFilteredResult(_0x3d5ed1,_0x39b754))['catch'](handleError(_0x3d5ed1,null));};exports[_0xa4b8('0x4a')]=function(_0x2710de,_0xff9fc0){var _0x13a27c={'raw':!![],'where':{'id':_0x2710de[_0xa4b8('0x4b')]['id']}},_0x6c6438={};_0x6c6438[_0xa4b8('0x34')]=_[_0xa4b8('0x36')](db[_0xa4b8('0x30')]['rawAttributes']);_0x6c6438[_0xa4b8('0x35')]=_[_0xa4b8('0x36')](_0x2710de[_0xa4b8('0x35')]);_0x6c6438[_0xa4b8('0x40')]=_[_0xa4b8('0x37')](_0x6c6438[_0xa4b8('0x34')],_0x6c6438[_0xa4b8('0x35')]);_0x13a27c['attributes']=_[_0xa4b8('0x37')](_0x6c6438['model'],qs[_0xa4b8('0x38')](_0x2710de[_0xa4b8('0x35')]['fields']));_0x13a27c[_0xa4b8('0x39')]=_0x13a27c['attributes'][_0xa4b8('0x3a')]?_0x13a27c[_0xa4b8('0x39')]:_0x6c6438[_0xa4b8('0x34')];if(_0x2710de[_0xa4b8('0x35')][_0xa4b8('0x46')]){_0x13a27c[_0xa4b8('0x47')]=[{'all':!![]}];}_0x13a27c=_[_0xa4b8('0x43')]({},_0x13a27c,_0x2710de[_0xa4b8('0x4c')]);return db[_0xa4b8('0x30')]['find'](_0x13a27c)[_0xa4b8('0x29')](handleEntityNotFound(_0xff9fc0,null))['then'](respondWithResult(_0xff9fc0,null))[_0xa4b8('0x4d')](handleError(_0xff9fc0,null));};exports[_0xa4b8('0x4e')]=function(_0x375dd7,_0x551638){return db['FaxQueueReport'][_0xa4b8('0x4e')](_0x375dd7[_0xa4b8('0x4f')],{})['then'](respondWithResult(_0x551638,0xc9))[_0xa4b8('0x4d')](handleError(_0x551638,null));};exports['update']=function(_0x1b8a91,_0x6b9b99){if(_0x1b8a91[_0xa4b8('0x4f')]['id']){delete _0x1b8a91['body']['id'];}return db[_0xa4b8('0x30')][_0xa4b8('0x50')]({'where':{'id':_0x1b8a91[_0xa4b8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6b9b99,null))['then'](saveUpdates(_0x1b8a91[_0xa4b8('0x4f')],null))[_0xa4b8('0x29')](respondWithResult(_0x6b9b99,null))[_0xa4b8('0x4d')](handleError(_0x6b9b99,null));};exports[_0xa4b8('0x2a')]=function(_0x3ca6fb,_0x510175){return db[_0xa4b8('0x30')]['find']({'where':{'id':_0x3ca6fb[_0xa4b8('0x4b')]['id']}})[_0xa4b8('0x29')](handleEntityNotFound(_0x510175,null))[_0xa4b8('0x29')](removeEntity(_0x510175,null))['catch'](handleError(_0x510175,null));};exports[_0xa4b8('0x51')]=function(_0x3cca98,_0x3edebc){return db[_0xa4b8('0x30')][_0xa4b8('0x51')]()[_0xa4b8('0x29')](respondWithResult(_0x3edebc,null))[_0xa4b8('0x4d')](handleError(_0x3edebc,null));};
\ No newline at end of file
index d0e8767..8668c8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x8a7c73,_0x832676){var _0x184337=function(_0x346cb9){while(--_0x346cb9){_0x8a7c73['push'](_0x8a7c73['shift']());}};_0x184337(++_0x832676);}(_0xe14b,0x93));var _0xbe14=function(_0x4b8cd8,_0x339d1e){_0x4b8cd8=_0x4b8cd8-0x0;var _0x231f12=_0xe14b[_0x4b8cd8];return _0x231f12;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./faxQueueReport.attributes','exports','define','report_fax_queue','uniqueid','lodash'];(function(_0x16013b,_0x221ddc){var _0x9827cc=function(_0x28b468){while(--_0x28b468){_0x16013b['push'](_0x16013b['shift']());}};_0x9827cc(++_0x221ddc);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x5fc3[_0x5ecadc];return _0x565037;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('FaxQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index c8481cc..0079a50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x000a=['debug','stringify','error','code','message','result','catch','FaxQueueReport,\x20%s,\x20%s','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','update','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x000a,0x170));var _0xa000=function(_0x5d7dbf,_0x3206e7){_0x5d7dbf=_0x5d7dbf-0x0;var _0x355630=_0x000a[_0x5d7dbf];return _0x355630;};'use strict';var _=require(_0xa000('0x0'));var util=require(_0xa000('0x1'));var moment=require(_0xa000('0x2'));var BPromise=require(_0xa000('0x3'));var rs=require(_0xa000('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa000('0x5'))['db'];var utils=require(_0xa000('0x6'));var logger=require(_0xa000('0x7'))(_0xa000('0x8'));var config=require(_0xa000('0x9'));var jayson=require(_0xa000('0xa'));var client=jayson[_0xa000('0xb')][_0xa000('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ecb51,_0x28f725,_0x4af5e2){return new BPromise(function(_0x11b214,_0x1220d0){return client[_0xa000('0xd')](_0x1ecb51,_0x4af5e2)[_0xa000('0xe')](function(_0x1a2f02){logger[_0xa000('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0xa000('0x10'));logger[_0xa000('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x28f725,_0xa000('0x10'),JSON[_0xa000('0x12')](_0x1a2f02));if(_0x1a2f02[_0xa000('0x13')]){if(_0x1a2f02[_0xa000('0x13')][_0xa000('0x14')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0x1a2f02['error'][_0xa000('0x15')]);return _0x1220d0(_0x1a2f02[_0xa000('0x13')][_0xa000('0x15')]);}logger[_0xa000('0x13')]('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0x1a2f02[_0xa000('0x13')]['message']);return _0x11b214(_0x1a2f02[_0xa000('0x13')][_0xa000('0x15')]);}else{logger[_0xa000('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x28f725,_0xa000('0x10'));_0x11b214(_0x1a2f02[_0xa000('0x16')][_0xa000('0x15')]);}})[_0xa000('0x17')](function(_0x183a60){logger[_0xa000('0x13')](_0xa000('0x18'),_0x28f725,_0x183a60);_0x1220d0(_0x183a60);});});}exports[_0xa000('0x19')]=function(_0x5c8e24){var _0xca4455=this;return new Promise(function(_0x2699d4,_0x5e102a){return db[_0xa000('0x1a')][_0xa000('0x1b')](_0x5c8e24[_0xa000('0x1c')],{'raw':_0x5c8e24['options']?_0x5c8e24[_0xa000('0x1d')][_0xa000('0x1e')]===undefined?!![]:![]:!![]})[_0xa000('0xe')](function(_0x343a4e){logger['info'](_0xa000('0x19'),_0x5c8e24);logger[_0xa000('0x11')](_0xa000('0x19'),_0x5c8e24,JSON[_0xa000('0x12')](_0x343a4e));_0x2699d4(_0x343a4e);})[_0xa000('0x17')](function(_0x493088){logger[_0xa000('0x13')]('CreateFaxQueueReport',_0x493088[_0xa000('0x15')],_0x5c8e24);_0x5e102a(_0xca4455[_0xa000('0x13')](0x1f4,_0x493088['message']));});});};exports['UpdateFaxQueueReport']=function(_0x4fec77){var _0x5d6272=this;return new Promise(function(_0x397151,_0x1ef7b8){return db[_0xa000('0x1a')][_0xa000('0x1f')](_0x4fec77[_0xa000('0x1c')],{'raw':_0x4fec77[_0xa000('0x1d')]?_0x4fec77['options'][_0xa000('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fec77[_0xa000('0x1d')]?_0x4fec77[_0xa000('0x1d')]['where']||null:null,'attributes':_0x4fec77['options']?_0x4fec77['options'][_0xa000('0x20')]||null:null,'limit':_0x4fec77['options']?_0x4fec77[_0xa000('0x1d')][_0xa000('0x21')]||null:null})[_0xa000('0xe')](function(_0x3575c5){logger['info'](_0xa000('0x22'),_0x4fec77);logger['debug'](_0xa000('0x22'),_0x4fec77,JSON[_0xa000('0x12')](_0x3575c5));_0x397151(_0x3575c5);})[_0xa000('0x17')](function(_0x25a70a){logger[_0xa000('0x13')]('UpdateFaxQueueReport',_0x25a70a[_0xa000('0x15')],_0x4fec77);_0x1ef7b8(_0x5d6272[_0xa000('0x13')](0x1f4,_0x25a70a[_0xa000('0x15')]));});});};
\ No newline at end of file
+var _0xd063=['jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','update','raw','where','attributes','UpdateFaxQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x456068,_0x2d7a87){var _0x142a0d=function(_0x24d55a){while(--_0x24d55a){_0x456068['push'](_0x456068['shift']());}};_0x142a0d(++_0x2d7a87);}(_0xd063,0x121));var _0x3d06=function(_0xc55368,_0x1ba192){_0xc55368=_0xc55368-0x0;var _0xf78a58=_0xd063[_0xc55368];return _0xf78a58;};'use strict';var _=require(_0x3d06('0x0'));var util=require(_0x3d06('0x1'));var moment=require(_0x3d06('0x2'));var BPromise=require(_0x3d06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d06('0x4'));var db=require(_0x3d06('0x5'))['db'];var utils=require(_0x3d06('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3d06('0x7'));var jayson=require(_0x3d06('0x8'));var client=jayson[_0x3d06('0x9')][_0x3d06('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x177840,_0xe8e866,_0x569f30){return new BPromise(function(_0x4d1386,_0xd73130){return client['request'](_0x177840,_0x569f30)[_0x3d06('0xb')](function(_0x4d66b6){logger[_0x3d06('0xc')](_0x3d06('0xd'),_0xe8e866,'request\x20sent');logger[_0x3d06('0xe')](_0x3d06('0xf'),_0xe8e866,_0x3d06('0x10'),JSON[_0x3d06('0x11')](_0x4d66b6));if(_0x4d66b6['error']){if(_0x4d66b6[_0x3d06('0x12')][_0x3d06('0x13')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x4d66b6[_0x3d06('0x12')]['message']);return _0xd73130(_0x4d66b6[_0x3d06('0x12')][_0x3d06('0x14')]);}logger[_0x3d06('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x4d66b6[_0x3d06('0x12')]['message']);return _0x4d1386(_0x4d66b6[_0x3d06('0x12')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x3d06('0x10'));_0x4d1386(_0x4d66b6[_0x3d06('0x15')][_0x3d06('0x14')]);}})[_0x3d06('0x16')](function(_0x859dbc){logger[_0x3d06('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0xe8e866,_0x859dbc);_0xd73130(_0x859dbc);});});}exports[_0x3d06('0x17')]=function(_0x251d9e){var _0x4dda62=this;return new Promise(function(_0x28a6c0,_0x56212a){return db[_0x3d06('0x18')][_0x3d06('0x19')](_0x251d9e[_0x3d06('0x1a')],{'raw':_0x251d9e[_0x3d06('0x1b')]?_0x251d9e[_0x3d06('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e56e4){logger[_0x3d06('0xc')]('CreateFaxQueueReport',_0x251d9e);logger[_0x3d06('0xe')]('CreateFaxQueueReport',_0x251d9e,JSON[_0x3d06('0x11')](_0x2e56e4));_0x28a6c0(_0x2e56e4);})[_0x3d06('0x16')](function(_0x19eea8){logger['error']('CreateFaxQueueReport',_0x19eea8['message'],_0x251d9e);_0x56212a(_0x4dda62[_0x3d06('0x12')](0x1f4,_0x19eea8[_0x3d06('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x471eff){var _0x24bf73=this;return new Promise(function(_0x3847c6,_0x2db6a6){return db[_0x3d06('0x18')][_0x3d06('0x1c')](_0x471eff[_0x3d06('0x1a')],{'raw':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')][_0x3d06('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')][_0x3d06('0x1e')]||null:null,'attributes':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')][_0x3d06('0x1f')]||null:null,'limit':_0x471eff[_0x3d06('0x1b')]?_0x471eff[_0x3d06('0x1b')]['limit']||null:null})['then'](function(_0x1f1408){logger[_0x3d06('0xc')](_0x3d06('0x20'),_0x471eff);logger[_0x3d06('0xe')](_0x3d06('0x20'),_0x471eff,JSON[_0x3d06('0x11')](_0x1f1408));_0x3847c6(_0x1f1408);})[_0x3d06('0x16')](function(_0x5c6dbe){logger[_0x3d06('0x12')]('UpdateFaxQueueReport',_0x5c6dbe['message'],_0x471eff);_0x2db6a6(_0x24bf73[_0x3d06('0x12')](0x1f4,_0x5c6dbe[_0x3d06('0x14')]));});});};
\ No newline at end of file
index bb336a6..0062ea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb06=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4f8f55,_0x255f66){var _0x27ae68=function(_0xb2cf50){while(--_0xb2cf50){_0x4f8f55['push'](_0x4f8f55['shift']());}};_0x27ae68(++_0x255f66);}(_0xdb06,0x126));var _0x6db0=function(_0x3cb481,_0x14507d){_0x3cb481=_0x3cb481-0x0;var _0x2896e3=_0xdb06[_0x3cb481];return _0x2896e3;};'use strict';var multer=require(_0x6db0('0x0'));var util=require(_0x6db0('0x1'));var path=require('path');var timeout=require(_0x6db0('0x2'));var express=require('express');var router=express[_0x6db0('0x3')]();var fs_extra=require(_0x6db0('0x4'));var auth=require(_0x6db0('0x5'));var interaction=require(_0x6db0('0x6'));var config=require(_0x6db0('0x7'));var controller=require(_0x6db0('0x8'));router[_0x6db0('0x9')]('/',auth[_0x6db0('0xa')](),controller[_0x6db0('0xb')]);router[_0x6db0('0x9')]('/describe',auth[_0x6db0('0xa')](),controller[_0x6db0('0xc')]);router[_0x6db0('0x9')](_0x6db0('0xd'),auth[_0x6db0('0xa')](),controller[_0x6db0('0xe')]);router['post']('/',auth[_0x6db0('0xa')](),controller[_0x6db0('0xf')]);router[_0x6db0('0x10')](_0x6db0('0xd'),auth[_0x6db0('0xa')](),controller[_0x6db0('0x11')]);router[_0x6db0('0x12')](_0x6db0('0xd'),auth[_0x6db0('0xa')](),controller['destroy']);module[_0x6db0('0x13')]=router;
\ No newline at end of file
+var _0x0243=['isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x57cbbc,_0x5dcaa0){var _0x270483=function(_0x303157){while(--_0x303157){_0x57cbbc['push'](_0x57cbbc['shift']());}};_0x270483(++_0x5dcaa0);}(_0x0243,0x14b));var _0x3024=function(_0x91fd3a,_0x35ea08){_0x91fd3a=_0x91fd3a-0x0;var _0x2180e0=_0x0243[_0x91fd3a];return _0x2180e0;};'use strict';var multer=require(_0x3024('0x0'));var util=require('util');var path=require(_0x3024('0x1'));var timeout=require(_0x3024('0x2'));var express=require('express');var router=express[_0x3024('0x3')]();var fs_extra=require(_0x3024('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3024('0x5'));var config=require(_0x3024('0x6'));var controller=require(_0x3024('0x7'));router[_0x3024('0x8')]('/',auth[_0x3024('0x9')](),controller['index']);router[_0x3024('0x8')](_0x3024('0xa'),auth['isAuthenticated'](),controller[_0x3024('0xb')]);router[_0x3024('0x8')](_0x3024('0xc'),auth[_0x3024('0x9')](),controller[_0x3024('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3024('0xe')]);router[_0x3024('0xf')]('/:id',auth[_0x3024('0x9')](),controller[_0x3024('0x10')]);router[_0x3024('0x11')](_0x3024('0xc'),auth[_0x3024('0x9')](),controller[_0x3024('0x12')]);module[_0x3024('0x13')]=router;
\ No newline at end of file
index e6f0bc4..25eb339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x38f86b,_0x45b662){var _0x10832f=function(_0x35f66a){while(--_0x35f66a){_0x38f86b['push'](_0x38f86b['shift']());}};_0x10832f(++_0x45b662);}(_0x008c,0x188));var _0xc008=function(_0x5d4818,_0x3ccae2){_0x5d4818=_0x5d4818-0x0;var _0x578a9c=_0x008c[_0x5d4818];return _0x578a9c;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x54c747,_0x22e625){var _0x50b206=function(_0x3aaf14){while(--_0x3aaf14){_0x54c747['push'](_0x54c747['shift']());}};_0x50b206(++_0x22e625);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4171c9,_0x473f12){_0x4171c9=_0x4171c9-0x0;var _0x2f6908=_0xf4eb[_0x4171c9];return _0x2f6908;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
index 24ed3cb..faafd02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5113=['catch','show','params','length','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x45dbf2,_0x1e115d){var _0x32f54d=function(_0x4dcb7e){while(--_0x4dcb7e){_0x45dbf2['push'](_0x45dbf2['shift']());}};_0x32f54d(++_0x1e115d);}(_0x5113,0x1be));var _0x3511=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0x5113[_0x29771f];return _0x279baf;};'use strict';var emlformat=require(_0x3511('0x0'));var rimraf=require(_0x3511('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3511('0x2'));var moment=require(_0x3511('0x3'));var BPromise=require(_0x3511('0x4'));var Mustache=require(_0x3511('0x5'));var util=require(_0x3511('0x6'));var path=require(_0x3511('0x7'));var sox=require(_0x3511('0x8'));var csv=require(_0x3511('0x9'));var ejs=require(_0x3511('0xa'));var fs=require('fs');var fs_extra=require(_0x3511('0xb'));var _=require(_0x3511('0xc'));var squel=require(_0x3511('0xd'));var crypto=require('crypto');var jsforce=require(_0x3511('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3511('0x9'));var querystring=require(_0x3511('0xf'));var Papa=require(_0x3511('0x10'));var Redis=require(_0x3511('0x11'));var authService=require(_0x3511('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3511('0x13'));var logger=require('../../config/logger')(_0x3511('0x14'));var utils=require(_0x3511('0x15'));var config=require(_0x3511('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3511('0x17'))['db'];function respondWithStatusCode(_0xee0fc4,_0x5cc459){_0x5cc459=_0x5cc459||0xcc;return function(_0x20ddb9){if(_0x20ddb9){return _0xee0fc4[_0x3511('0x18')](_0x5cc459);}return _0xee0fc4['status'](_0x5cc459)[_0x3511('0x19')]();};}function respondWithResult(_0x3476d4,_0x4a89b8){_0x4a89b8=_0x4a89b8||0xc8;return function(_0x28b2e7){if(_0x28b2e7){return _0x3476d4[_0x3511('0x1a')](_0x4a89b8)['json'](_0x28b2e7);}};}function respondWithFilteredResult(_0x381a85,_0x1b0290){return function(_0x4dcedf){if(_0x4dcedf){var _0x29c27d=typeof _0x1b0290[_0x3511('0x1b')]===_0x3511('0x1c')&&typeof _0x1b0290['limit']===_0x3511('0x1c');var _0x59214f=_0x4dcedf['count'];var _0x1cc191=_0x29c27d?0x0:_0x1b0290['offset'];var _0x3ecdd0=_0x29c27d?_0x4dcedf[_0x3511('0x1d')]:_0x1b0290[_0x3511('0x1b')]+_0x1b0290[_0x3511('0x1e')];var _0x13f818;if(_0x3ecdd0>=_0x59214f){_0x3ecdd0=_0x59214f;_0x13f818=0xc8;}else{_0x13f818=0xce;}_0x381a85[_0x3511('0x1a')](_0x13f818);return _0x381a85[_0x3511('0x1f')](_0x3511('0x20'),_0x1cc191+'-'+_0x3ecdd0+'/'+_0x59214f)[_0x3511('0x21')](_0x4dcedf);}return null;};}function patchUpdates(_0x2a2d25){return function(_0x258f25){try{jsonpatch[_0x3511('0x22')](_0x258f25,_0x2a2d25,!![]);}catch(_0x27d128){return BPromise['reject'](_0x27d128);}return _0x258f25[_0x3511('0x23')]();};}function saveUpdates(_0x7f9d07,_0x48811f){return function(_0x339220){if(_0x339220){return _0x339220[_0x3511('0x24')](_0x7f9d07)['then'](function(_0x6979e9){return _0x6979e9;});}return null;};}function removeEntity(_0x4884e8,_0x2de2cf){return function(_0x9152de){if(_0x9152de){return _0x9152de[_0x3511('0x25')]()[_0x3511('0x26')](function(){_0x4884e8[_0x3511('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaeed01,_0x339b18){return function(_0xbfb824){if(!_0xbfb824){_0xaeed01[_0x3511('0x18')](0x194);}return _0xbfb824;};}function handleError(_0x53ceb8,_0x1e7f07){_0x1e7f07=_0x1e7f07||0x1f4;return function(_0x59b41b){logger['error'](_0x59b41b['stack']);if(_0x59b41b[_0x3511('0x27')]){delete _0x59b41b[_0x3511('0x27')];}_0x53ceb8['status'](_0x1e7f07)[_0x3511('0x28')](_0x59b41b);};}exports[_0x3511('0x29')]=function(_0x1766c0,_0x17ad2d){var _0x10ca8d={},_0x4e99ec={},_0x3c56e7={'count':0x0,'rows':[]};var _0x1748b0=_[_0x3511('0x2a')](db[_0x3511('0x2b')][_0x3511('0x2c')],function(_0x5000ee){return{'name':_0x5000ee[_0x3511('0x2d')],'type':_0x5000ee[_0x3511('0x2e')][_0x3511('0x2f')]};});_0x4e99ec[_0x3511('0x30')]=_[_0x3511('0x2a')](_0x1748b0,_0x3511('0x27'));_0x4e99ec['query']=_[_0x3511('0x31')](_0x1766c0['query']);_0x4e99ec['filters']=_[_0x3511('0x32')](_0x4e99ec[_0x3511('0x30')],_0x4e99ec[_0x3511('0x33')]);_0x10ca8d[_0x3511('0x34')]=_['intersection'](_0x4e99ec[_0x3511('0x30')],qs[_0x3511('0x35')](_0x1766c0[_0x3511('0x33')][_0x3511('0x35')]));_0x10ca8d['attributes']=_0x10ca8d['attributes']['length']?_0x10ca8d[_0x3511('0x34')]:_0x4e99ec[_0x3511('0x30')];if(!_0x1766c0['query'][_0x3511('0x36')]('nolimit')){_0x10ca8d['limit']=qs[_0x3511('0x1e')](_0x1766c0[_0x3511('0x33')]['limit']);_0x10ca8d['offset']=qs[_0x3511('0x1b')](_0x1766c0[_0x3511('0x33')][_0x3511('0x1b')]);}_0x10ca8d[_0x3511('0x37')]=qs[_0x3511('0x38')](_0x1766c0[_0x3511('0x33')][_0x3511('0x38')]);_0x10ca8d[_0x3511('0x39')]=qs[_0x3511('0x3a')](_[_0x3511('0x3b')](_0x1766c0[_0x3511('0x33')],_0x4e99ec[_0x3511('0x3a')]),_0x1748b0);if(_0x1766c0['query'][_0x3511('0x3c')]){_0x10ca8d[_0x3511('0x39')]=_[_0x3511('0x3d')](_0x10ca8d['where'],{'$or':_[_0x3511('0x2a')](_0x1748b0,function(_0x113ae9){if(_0x113ae9[_0x3511('0x2e')]!==_0x3511('0x3e')){var _0x41803d={};_0x41803d[_0x113ae9[_0x3511('0x27')]]={'$like':'%'+_0x1766c0[_0x3511('0x33')][_0x3511('0x3c')]+'%'};return _0x41803d;}})});}_0x10ca8d=_['merge']({},_0x10ca8d,_0x1766c0[_0x3511('0x3f')]);var _0x4f07ab={'where':_0x10ca8d[_0x3511('0x39')]};return db[_0x3511('0x2b')]['count'](_0x4f07ab)[_0x3511('0x26')](function(_0x4df86e){_0x3c56e7[_0x3511('0x1d')]=_0x4df86e;if(_0x1766c0[_0x3511('0x33')][_0x3511('0x40')]){_0x10ca8d['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x10ca8d);})[_0x3511('0x26')](function(_0x102e78){_0x3c56e7['rows']=_0x102e78;return _0x3c56e7;})[_0x3511('0x26')](respondWithFilteredResult(_0x17ad2d,_0x10ca8d))[_0x3511('0x41')](handleError(_0x17ad2d,null));};exports[_0x3511('0x42')]=function(_0x66844c,_0x3347d6){var _0x22eb7e={'raw':!![],'where':{'id':_0x66844c[_0x3511('0x43')]['id']}},_0x11bf82={};_0x11bf82[_0x3511('0x30')]=_[_0x3511('0x31')](db[_0x3511('0x2b')][_0x3511('0x2c')]);_0x11bf82[_0x3511('0x33')]=_['keys'](_0x66844c[_0x3511('0x33')]);_0x11bf82['filters']=_[_0x3511('0x32')](_0x11bf82[_0x3511('0x30')],_0x11bf82[_0x3511('0x33')]);_0x22eb7e[_0x3511('0x34')]=_[_0x3511('0x32')](_0x11bf82[_0x3511('0x30')],qs[_0x3511('0x35')](_0x66844c[_0x3511('0x33')][_0x3511('0x35')]));_0x22eb7e[_0x3511('0x34')]=_0x22eb7e['attributes'][_0x3511('0x44')]?_0x22eb7e[_0x3511('0x34')]:_0x11bf82[_0x3511('0x30')];if(_0x66844c[_0x3511('0x33')][_0x3511('0x40')]){_0x22eb7e['include']=[{'all':!![]}];}_0x22eb7e=_[_0x3511('0x3d')]({},_0x22eb7e,_0x66844c[_0x3511('0x3f')]);return db[_0x3511('0x2b')][_0x3511('0x45')](_0x22eb7e)[_0x3511('0x26')](handleEntityNotFound(_0x3347d6,null))[_0x3511('0x26')](respondWithResult(_0x3347d6,null))[_0x3511('0x41')](handleError(_0x3347d6,null));};exports[_0x3511('0x46')]=function(_0x10518a,_0x41a401){return db[_0x3511('0x2b')][_0x3511('0x46')](_0x10518a['body'],{})[_0x3511('0x26')](respondWithResult(_0x41a401,0xc9))[_0x3511('0x41')](handleError(_0x41a401,null));};exports[_0x3511('0x24')]=function(_0x137b0d,_0x248ae0){if(_0x137b0d[_0x3511('0x47')]['id']){delete _0x137b0d[_0x3511('0x47')]['id'];}return db[_0x3511('0x2b')]['find']({'where':{'id':_0x137b0d[_0x3511('0x43')]['id']}})['then'](handleEntityNotFound(_0x248ae0,null))[_0x3511('0x26')](saveUpdates(_0x137b0d[_0x3511('0x47')],null))[_0x3511('0x26')](respondWithResult(_0x248ae0,null))[_0x3511('0x41')](handleError(_0x248ae0,null));};exports[_0x3511('0x25')]=function(_0x568141,_0x533806){return db[_0x3511('0x2b')][_0x3511('0x45')]({'where':{'id':_0x568141[_0x3511('0x43')]['id']}})[_0x3511('0x26')](handleEntityNotFound(_0x533806,null))[_0x3511('0x26')](removeEntity(_0x533806,null))[_0x3511('0x41')](handleError(_0x533806,null));};exports[_0x3511('0x48')]=function(_0x1a09cf,_0x58f7aa){return db[_0x3511('0x2b')][_0x3511('0x48')]()['then'](respondWithResult(_0x58f7aa,null))['catch'](handleError(_0x58f7aa,null));};
\ No newline at end of file
+var _0x3983=['FaxTransferReport','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','options','includeAll','include','findAll','catch','show','params','length','body','update','find','describe','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','status','error','name','send','index','map'];(function(_0x1982eb,_0x43a2ec){var _0x3a7933=function(_0x19c8b9){while(--_0x19c8b9){_0x1982eb['push'](_0x1982eb['shift']());}};_0x3a7933(++_0x43a2ec);}(_0x3983,0x1e7));var _0x3398=function(_0x5e33f6,_0x21ce06){_0x5e33f6=_0x5e33f6-0x0;var _0x38bab6=_0x3983[_0x5e33f6];return _0x38bab6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3398('0x0'));var zipdir=require(_0x3398('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3398('0x2'));var moment=require(_0x3398('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3398('0x4'));var util=require('util');var path=require(_0x3398('0x5'));var sox=require(_0x3398('0x6'));var csv=require(_0x3398('0x7'));var ejs=require(_0x3398('0x8'));var fs=require('fs');var fs_extra=require(_0x3398('0x9'));var _=require(_0x3398('0xa'));var squel=require(_0x3398('0xb'));var crypto=require(_0x3398('0xc'));var jsforce=require(_0x3398('0xd'));var deskjs=require(_0x3398('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3398('0xf'));var Papa=require(_0x3398('0x10'));var Redis=require(_0x3398('0x11'));var authService=require(_0x3398('0x12'));var qs=require(_0x3398('0x13'));var as=require(_0x3398('0x14'));var hardwareService=require(_0x3398('0x15'));var logger=require(_0x3398('0x16'))('api');var utils=require(_0x3398('0x17'));var config=require(_0x3398('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3398('0x19'))['db'];function respondWithStatusCode(_0x3c0806,_0x113ad3){_0x113ad3=_0x113ad3||0xcc;return function(_0x1ab78b){if(_0x1ab78b){return _0x3c0806[_0x3398('0x1a')](_0x113ad3);}return _0x3c0806['status'](_0x113ad3)[_0x3398('0x1b')]();};}function respondWithResult(_0x2cac49,_0x126d81){_0x126d81=_0x126d81||0xc8;return function(_0x50ad08){if(_0x50ad08){return _0x2cac49['status'](_0x126d81)[_0x3398('0x1c')](_0x50ad08);}};}function respondWithFilteredResult(_0x187ee5,_0x59d6bd){return function(_0x63c564){if(_0x63c564){var _0x57935f=typeof _0x59d6bd[_0x3398('0x1d')]===_0x3398('0x1e')&&typeof _0x59d6bd[_0x3398('0x1f')]===_0x3398('0x1e');var _0x54b595=_0x63c564[_0x3398('0x20')];var _0x54bc9b=_0x57935f?0x0:_0x59d6bd[_0x3398('0x1d')];var _0x26351e=_0x57935f?_0x63c564[_0x3398('0x20')]:_0x59d6bd[_0x3398('0x1d')]+_0x59d6bd[_0x3398('0x1f')];var _0x35a845;if(_0x26351e>=_0x54b595){_0x26351e=_0x54b595;_0x35a845=0xc8;}else{_0x35a845=0xce;}_0x187ee5['status'](_0x35a845);return _0x187ee5[_0x3398('0x21')](_0x3398('0x22'),_0x54bc9b+'-'+_0x26351e+'/'+_0x54b595)[_0x3398('0x1c')](_0x63c564);}return null;};}function patchUpdates(_0x4bd722){return function(_0x32ed73){try{jsonpatch[_0x3398('0x23')](_0x32ed73,_0x4bd722,!![]);}catch(_0xee91f0){return BPromise['reject'](_0xee91f0);}return _0x32ed73[_0x3398('0x24')]();};}function saveUpdates(_0x21d64f,_0x55ed60){return function(_0x47750d){if(_0x47750d){return _0x47750d['update'](_0x21d64f)[_0x3398('0x25')](function(_0x305a72){return _0x305a72;});}return null;};}function removeEntity(_0x3d6260,_0x17980b){return function(_0x201006){if(_0x201006){return _0x201006[_0x3398('0x26')]()['then'](function(){_0x3d6260[_0x3398('0x27')](0xcc)[_0x3398('0x1b')]();});}};}function handleEntityNotFound(_0x485557,_0x45e13c){return function(_0x865dfe){if(!_0x865dfe){_0x485557['sendStatus'](0x194);}return _0x865dfe;};}function handleError(_0x5dc3bc,_0x1ec177){_0x1ec177=_0x1ec177||0x1f4;return function(_0x591cbf){logger[_0x3398('0x28')](_0x591cbf['stack']);if(_0x591cbf['name']){delete _0x591cbf[_0x3398('0x29')];}_0x5dc3bc[_0x3398('0x27')](_0x1ec177)[_0x3398('0x2a')](_0x591cbf);};}exports[_0x3398('0x2b')]=function(_0x4ebf95,_0xd95a59){var _0x51355d={},_0x142a44={},_0x59273a={'count':0x0,'rows':[]};var _0x17580f=_[_0x3398('0x2c')](db[_0x3398('0x2d')][_0x3398('0x2e')],function(_0x292ab1){return{'name':_0x292ab1[_0x3398('0x2f')],'type':_0x292ab1['type'][_0x3398('0x30')]};});_0x142a44['model']=_['map'](_0x17580f,_0x3398('0x29'));_0x142a44[_0x3398('0x31')]=_[_0x3398('0x32')](_0x4ebf95['query']);_0x142a44['filters']=_[_0x3398('0x33')](_0x142a44[_0x3398('0x34')],_0x142a44[_0x3398('0x31')]);_0x51355d['attributes']=_[_0x3398('0x33')](_0x142a44[_0x3398('0x34')],qs[_0x3398('0x35')](_0x4ebf95['query']['fields']));_0x51355d[_0x3398('0x36')]=_0x51355d[_0x3398('0x36')]['length']?_0x51355d[_0x3398('0x36')]:_0x142a44[_0x3398('0x34')];if(!_0x4ebf95[_0x3398('0x31')][_0x3398('0x37')](_0x3398('0x38'))){_0x51355d[_0x3398('0x1f')]=qs['limit'](_0x4ebf95[_0x3398('0x31')][_0x3398('0x1f')]);_0x51355d[_0x3398('0x1d')]=qs[_0x3398('0x1d')](_0x4ebf95['query'][_0x3398('0x1d')]);}_0x51355d[_0x3398('0x39')]=qs[_0x3398('0x3a')](_0x4ebf95[_0x3398('0x31')][_0x3398('0x3a')]);_0x51355d[_0x3398('0x3b')]=qs[_0x3398('0x3c')](_['pick'](_0x4ebf95[_0x3398('0x31')],_0x142a44[_0x3398('0x3c')]),_0x17580f);if(_0x4ebf95[_0x3398('0x31')][_0x3398('0x3d')]){_0x51355d['where']=_[_0x3398('0x3e')](_0x51355d[_0x3398('0x3b')],{'$or':_[_0x3398('0x2c')](_0x17580f,function(_0x2fa7e9){if(_0x2fa7e9[_0x3398('0x3f')]!=='VIRTUAL'){var _0x1ff7a0={};_0x1ff7a0[_0x2fa7e9[_0x3398('0x29')]]={'$like':'%'+_0x4ebf95[_0x3398('0x31')][_0x3398('0x3d')]+'%'};return _0x1ff7a0;}})});}_0x51355d=_[_0x3398('0x3e')]({},_0x51355d,_0x4ebf95[_0x3398('0x40')]);var _0x5839a4={'where':_0x51355d[_0x3398('0x3b')]};return db['FaxTransferReport'][_0x3398('0x20')](_0x5839a4)[_0x3398('0x25')](function(_0xf1ec7a){_0x59273a['count']=_0xf1ec7a;if(_0x4ebf95[_0x3398('0x31')][_0x3398('0x41')]){_0x51355d[_0x3398('0x42')]=[{'all':!![]}];}return db[_0x3398('0x2d')][_0x3398('0x43')](_0x51355d);})[_0x3398('0x25')](function(_0x574fe0){_0x59273a['rows']=_0x574fe0;return _0x59273a;})[_0x3398('0x25')](respondWithFilteredResult(_0xd95a59,_0x51355d))[_0x3398('0x44')](handleError(_0xd95a59,null));};exports[_0x3398('0x45')]=function(_0xc2020e,_0x48c599){var _0xb2cf63={'raw':!![],'where':{'id':_0xc2020e[_0x3398('0x46')]['id']}},_0x1dd436={};_0x1dd436[_0x3398('0x34')]=_['keys'](db[_0x3398('0x2d')][_0x3398('0x2e')]);_0x1dd436[_0x3398('0x31')]=_['keys'](_0xc2020e['query']);_0x1dd436['filters']=_[_0x3398('0x33')](_0x1dd436[_0x3398('0x34')],_0x1dd436['query']);_0xb2cf63[_0x3398('0x36')]=_[_0x3398('0x33')](_0x1dd436[_0x3398('0x34')],qs[_0x3398('0x35')](_0xc2020e[_0x3398('0x31')][_0x3398('0x35')]));_0xb2cf63[_0x3398('0x36')]=_0xb2cf63[_0x3398('0x36')][_0x3398('0x47')]?_0xb2cf63[_0x3398('0x36')]:_0x1dd436['model'];if(_0xc2020e['query'][_0x3398('0x41')]){_0xb2cf63[_0x3398('0x42')]=[{'all':!![]}];}_0xb2cf63=_[_0x3398('0x3e')]({},_0xb2cf63,_0xc2020e['options']);return db[_0x3398('0x2d')]['find'](_0xb2cf63)[_0x3398('0x25')](handleEntityNotFound(_0x48c599,null))['then'](respondWithResult(_0x48c599,null))[_0x3398('0x44')](handleError(_0x48c599,null));};exports['create']=function(_0x3bc6c2,_0x55524b){return db[_0x3398('0x2d')]['create'](_0x3bc6c2[_0x3398('0x48')],{})['then'](respondWithResult(_0x55524b,0xc9))[_0x3398('0x44')](handleError(_0x55524b,null));};exports[_0x3398('0x49')]=function(_0x54da44,_0x18f4ec){if(_0x54da44[_0x3398('0x48')]['id']){delete _0x54da44['body']['id'];}return db['FaxTransferReport'][_0x3398('0x4a')]({'where':{'id':_0x54da44[_0x3398('0x46')]['id']}})[_0x3398('0x25')](handleEntityNotFound(_0x18f4ec,null))[_0x3398('0x25')](saveUpdates(_0x54da44['body'],null))[_0x3398('0x25')](respondWithResult(_0x18f4ec,null))[_0x3398('0x44')](handleError(_0x18f4ec,null));};exports[_0x3398('0x26')]=function(_0xaa76bb,_0x10e359){return db[_0x3398('0x2d')][_0x3398('0x4a')]({'where':{'id':_0xaa76bb['params']['id']}})[_0x3398('0x25')](handleEntityNotFound(_0x10e359,null))[_0x3398('0x25')](removeEntity(_0x10e359,null))[_0x3398('0x44')](handleError(_0x10e359,null));};exports['describe']=function(_0x162f2f,_0x98f0a2){return db[_0x3398('0x2d')][_0x3398('0x4b')]()[_0x3398('0x25')](respondWithResult(_0x98f0a2,null))[_0x3398('0x44')](handleError(_0x98f0a2,null));};
\ No newline at end of file
index ee89c1b..ebc1523 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27eb=['request-promise','path','rimraf','./faxTransferReport.attributes','define','report_fax_transfer','uniqueid','lodash','util','api','moment'];(function(_0x49a2a8,_0x5122a6){var _0x106342=function(_0x9f80d){while(--_0x9f80d){_0x49a2a8['push'](_0x49a2a8['shift']());}};_0x106342(++_0x5122a6);}(_0x27eb,0x96));var _0xb27e=function(_0xbd5a3f,_0x502afe){_0xbd5a3f=_0xbd5a3f-0x0;var _0x23db9c=_0x27eb[_0xbd5a3f];return _0x23db9c;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var logger=require('../../config/logger')(_0xb27e('0x2'));var moment=require(_0xb27e('0x3'));var BPromise=require('bluebird');var rp=require(_0xb27e('0x4'));var fs=require('fs');var path=require(_0xb27e('0x5'));var rimraf=require(_0xb27e('0x6'));var config=require('../../config/environment');var attributes=require(_0xb27e('0x7'));module['exports']=function(_0x242724,_0xb66404){return _0x242724[_0xb27e('0x8')]('FaxTransferReport',attributes,{'tableName':_0xb27e('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb27e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9106=['lodash','util','../../config/logger','api','bluebird','request-promise','path','define','report_fax_transfer','uniqueid'];(function(_0x486f21,_0x4d5dad){var _0x266da6=function(_0x1fc651){while(--_0x1fc651){_0x486f21['push'](_0x486f21['shift']());}};_0x266da6(++_0x4d5dad);}(_0x9106,0x6e));var _0x6910=function(_0x515da8,_0x3b69d2){_0x515da8=_0x515da8-0x0;var _0x10da36=_0x9106[_0x515da8];return _0x10da36;};'use strict';var _=require(_0x6910('0x0'));var util=require(_0x6910('0x1'));var logger=require(_0x6910('0x2'))(_0x6910('0x3'));var moment=require('moment');var BPromise=require(_0x6910('0x4'));var rp=require(_0x6910('0x5'));var fs=require('fs');var path=require(_0x6910('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x28b7a9,_0x582073){return _0x28b7a9[_0x6910('0x7')]('FaxTransferReport',attributes,{'tableName':_0x6910('0x8'),'paranoid':![],'indexes':[{'name':_0x6910('0x9'),'fields':[_0x6910('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 64f9661..c2ae64e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b97=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2bc6b8,_0x24f5b0){var _0x1b5ce6=function(_0x3dcab1){while(--_0x3dcab1){_0x2bc6b8['push'](_0x2bc6b8['shift']());}};_0x1b5ce6(++_0x24f5b0);}(_0x2b97,0xec));var _0x72b9=function(_0x739d40,_0x4509e8){_0x739d40=_0x739d40-0x0;var _0xc24f0=_0x2b97[_0x739d40];return _0xc24f0;};'use strict';var _=require(_0x72b9('0x0'));var util=require(_0x72b9('0x1'));var moment=require(_0x72b9('0x2'));var BPromise=require(_0x72b9('0x3'));var rs=require(_0x72b9('0x4'));var fs=require('fs');var Redis=require(_0x72b9('0x5'));var db=require(_0x72b9('0x6'))['db'];var utils=require(_0x72b9('0x7'));var logger=require(_0x72b9('0x8'))(_0x72b9('0x9'));var config=require(_0x72b9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x72b9('0xb')][_0x72b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ca24a,_0x11c1f5,_0x3201a9){return new BPromise(function(_0x14fa03,_0x4d53eb){return client[_0x72b9('0xd')](_0x1ca24a,_0x3201a9)['then'](function(_0x22b5ef){logger[_0x72b9('0xe')](_0x72b9('0xf'),_0x11c1f5,_0x72b9('0x10'));logger[_0x72b9('0x11')](_0x72b9('0x12'),_0x11c1f5,_0x72b9('0x10'),JSON['stringify'](_0x22b5ef));if(_0x22b5ef[_0x72b9('0x13')]){if(_0x22b5ef[_0x72b9('0x13')]['code']===0x1f4){logger[_0x72b9('0x13')](_0x72b9('0xf'),_0x11c1f5,_0x22b5ef[_0x72b9('0x13')][_0x72b9('0x14')]);return _0x4d53eb(_0x22b5ef[_0x72b9('0x13')][_0x72b9('0x14')]);}logger[_0x72b9('0x13')](_0x72b9('0xf'),_0x11c1f5,_0x22b5ef['error'][_0x72b9('0x14')]);return _0x14fa03(_0x22b5ef[_0x72b9('0x13')]['message']);}else{logger[_0x72b9('0xe')](_0x72b9('0xf'),_0x11c1f5,'request\x20sent');_0x14fa03(_0x22b5ef[_0x72b9('0x15')]['message']);}})[_0x72b9('0x16')](function(_0x3be85a){logger[_0x72b9('0x13')](_0x72b9('0xf'),_0x11c1f5,_0x3be85a);_0x4d53eb(_0x3be85a);});});}
\ No newline at end of file
+var _0xce76=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x101a71,_0x5bd9ba){var _0x35f4cb=function(_0x416359){while(--_0x416359){_0x101a71['push'](_0x101a71['shift']());}};_0x35f4cb(++_0x5bd9ba);}(_0xce76,0x128));var _0x6ce7=function(_0x507abd,_0x45c48c){_0x507abd=_0x507abd-0x0;var _0x31663a=_0xce76[_0x507abd];return _0x31663a;};'use strict';var _=require(_0x6ce7('0x0'));var util=require('util');var moment=require(_0x6ce7('0x1'));var BPromise=require(_0x6ce7('0x2'));var rs=require(_0x6ce7('0x3'));var fs=require('fs');var Redis=require(_0x6ce7('0x4'));var db=require(_0x6ce7('0x5'))['db'];var utils=require(_0x6ce7('0x6'));var logger=require(_0x6ce7('0x7'))(_0x6ce7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6ce7('0x9')][_0x6ce7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b633f,_0x39c3b3,_0x2d9a33){return new BPromise(function(_0x57f9f7,_0x4fe1a8){return client['request'](_0x3b633f,_0x2d9a33)[_0x6ce7('0xb')](function(_0x5736c7){logger[_0x6ce7('0xc')](_0x6ce7('0xd'),_0x39c3b3,_0x6ce7('0xe'));logger['debug'](_0x6ce7('0xf'),_0x39c3b3,_0x6ce7('0xe'),JSON['stringify'](_0x5736c7));if(_0x5736c7[_0x6ce7('0x10')]){if(_0x5736c7[_0x6ce7('0x10')]['code']===0x1f4){logger[_0x6ce7('0x10')](_0x6ce7('0xd'),_0x39c3b3,_0x5736c7[_0x6ce7('0x10')][_0x6ce7('0x11')]);return _0x4fe1a8(_0x5736c7[_0x6ce7('0x10')][_0x6ce7('0x11')]);}logger[_0x6ce7('0x10')](_0x6ce7('0xd'),_0x39c3b3,_0x5736c7['error'][_0x6ce7('0x11')]);return _0x57f9f7(_0x5736c7[_0x6ce7('0x10')]['message']);}else{logger[_0x6ce7('0xc')](_0x6ce7('0xd'),_0x39c3b3,_0x6ce7('0xe'));_0x57f9f7(_0x5736c7[_0x6ce7('0x12')][_0x6ce7('0x11')]);}})[_0x6ce7('0x13')](function(_0x27b725){logger['error'](_0x6ce7('0xd'),_0x39c3b3,_0x27b725);_0x4fe1a8(_0x27b725);});});}
\ No newline at end of file
index 96252b4..c789094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9e6=['connect-timeout','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0xc9e6,0x84));var _0x6c9e=function(_0x233d69,_0x58c7a9){_0x233d69=_0x233d69-0x0;var _0x482fef=_0xc9e6[_0x233d69];return _0x482fef;};'use strict';var multer=require('multer');var util=require(_0x6c9e('0x0'));var path=require('path');var timeout=require(_0x6c9e('0x1'));var express=require('express');var router=express[_0x6c9e('0x2')]();var fs_extra=require(_0x6c9e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6c9e('0x4'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x6c9e('0x5')](),controller[_0x6c9e('0x6')]);router['get'](_0x6c9e('0x7'),auth[_0x6c9e('0x5')](),controller[_0x6c9e('0x8')]);router[_0x6c9e('0x9')](_0x6c9e('0xa'),auth[_0x6c9e('0x5')](),controller[_0x6c9e('0xb')]);router[_0x6c9e('0xc')]('/',auth[_0x6c9e('0x5')](),controller[_0x6c9e('0xd')]);router[_0x6c9e('0xe')]('/:id',auth[_0x6c9e('0x5')](),controller[_0x6c9e('0xf')]);router[_0x6c9e('0x10')](_0x6c9e('0xa'),auth[_0x6c9e('0x5')](),controller[_0x6c9e('0x11')]);module[_0x6c9e('0x12')]=router;
\ No newline at end of file
+var _0x5545=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x560953,_0x59e548){var _0x52c747=function(_0x574373){while(--_0x574373){_0x560953['push'](_0x560953['shift']());}};_0x52c747(++_0x59e548);}(_0x5545,0x151));var _0x5554=function(_0x1b2d88,_0x4712c5){_0x1b2d88=_0x1b2d88-0x0;var _0x4f1754=_0x5545[_0x1b2d88];return _0x4f1754;};'use strict';var multer=require(_0x5554('0x0'));var util=require(_0x5554('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5554('0x2')]();var fs_extra=require(_0x5554('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5554('0x4'));var config=require(_0x5554('0x5'));var controller=require(_0x5554('0x6'));router[_0x5554('0x7')]('/',auth[_0x5554('0x8')](),controller[_0x5554('0x9')]);router[_0x5554('0x7')](_0x5554('0xa'),auth[_0x5554('0x8')](),controller[_0x5554('0xb')]);router[_0x5554('0x7')](_0x5554('0xc'),auth[_0x5554('0x8')](),controller[_0x5554('0xd')]);router['post']('/',auth[_0x5554('0x8')](),controller[_0x5554('0xe')]);router['put'](_0x5554('0xc'),auth[_0x5554('0x8')](),controller[_0x5554('0xf')]);router[_0x5554('0x10')](_0x5554('0xc'),auth[_0x5554('0x8')](),controller[_0x5554('0x11')]);module[_0x5554('0x12')]=router;
\ No newline at end of file
index ff4337d..5a0adc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64ac=['./intDeskAccount.controller','isAuthenticated','/:id','get','/:id/configurations','/:id/fields','create','addConfiguration','put','delete','exports','util','path','Router','fs-extra','../../components/interaction/service'];(function(_0x43313b,_0x143343){var _0x21f529=function(_0x2d191e){while(--_0x2d191e){_0x43313b['push'](_0x43313b['shift']());}};_0x21f529(++_0x143343);}(_0x64ac,0x9b));var _0xc64a=function(_0x2df4fd,_0x710692){_0x2df4fd=_0x2df4fd-0x0;var _0x1f6edb=_0x64ac[_0x2df4fd];return _0x1f6edb;};'use strict';var multer=require('multer');var util=require(_0xc64a('0x0'));var path=require(_0xc64a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc64a('0x2')]();var fs_extra=require(_0xc64a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc64a('0x4'));var config=require('../../config/environment');var controller=require(_0xc64a('0x5'));router['get']('/',auth[_0xc64a('0x6')](),controller['index']);router['get'](_0xc64a('0x7'),auth[_0xc64a('0x6')](),controller['show']);router[_0xc64a('0x8')](_0xc64a('0x9'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xc64a('0x8')](_0xc64a('0xa'),auth[_0xc64a('0x6')](),controller['getFields']);router['post']('/',auth[_0xc64a('0x6')](),controller[_0xc64a('0xb')]);router['post'](_0xc64a('0x9'),auth[_0xc64a('0x6')](),controller[_0xc64a('0xc')]);router[_0xc64a('0xd')](_0xc64a('0x7'),auth['isAuthenticated'](),controller['update']);router[_0xc64a('0xe')](_0xc64a('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xc64a('0xf')]=router;
\ No newline at end of file
+var _0xe367=['create','post','addConfiguration','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x27d7e0,_0x420e5d){var _0x57939b=function(_0x12658d){while(--_0x12658d){_0x27d7e0['push'](_0x27d7e0['shift']());}};_0x57939b(++_0x420e5d);}(_0xe367,0x10f));var _0x7e36=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xe367[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x7e36('0x0'));var util=require(_0x7e36('0x1'));var path=require(_0x7e36('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7e36('0x3')]();var fs_extra=require(_0x7e36('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7e36('0x5'));var config=require(_0x7e36('0x6'));var controller=require(_0x7e36('0x7'));router['get']('/',auth[_0x7e36('0x8')](),controller[_0x7e36('0x9')]);router[_0x7e36('0xa')](_0x7e36('0xb'),auth[_0x7e36('0x8')](),controller[_0x7e36('0xc')]);router[_0x7e36('0xa')](_0x7e36('0xd'),auth[_0x7e36('0x8')](),controller[_0x7e36('0xe')]);router[_0x7e36('0xa')](_0x7e36('0xf'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x10')]);router['post']('/',auth[_0x7e36('0x8')](),controller[_0x7e36('0x11')]);router[_0x7e36('0x12')](_0x7e36('0xd'),auth['isAuthenticated'](),controller[_0x7e36('0x13')]);router['put'](_0x7e36('0xb'),auth[_0x7e36('0x8')](),controller[_0x7e36('0x14')]);router[_0x7e36('0x15')]('/:id',auth[_0x7e36('0x8')](),controller[_0x7e36('0x16')]);module[_0x7e36('0x17')]=router;
\ No newline at end of file
index 22762c2..a7837c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe618=['newTab','sequelize','exports','STRING','basic','integrationTab'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xe618,0x1d5));var _0x8e61=function(_0x4f0837,_0x2ef53b){_0x4f0837=_0x4f0837-0x0;var _0x30abc4=_0xe618[_0x4f0837];return _0x30abc4;};'use strict';var Sequelize=require(_0x8e61('0x0'));module[_0x8e61('0x1')]={'name':{'type':Sequelize[_0x8e61('0x2')]},'description':{'type':Sequelize[_0x8e61('0x2')]},'username':{'type':Sequelize[_0x8e61('0x2')]},'remoteUri':{'type':Sequelize[_0x8e61('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x8e61('0x3')),'defaultValue':_0x8e61('0x3')},'password':{'type':Sequelize[_0x8e61('0x2')]},'consumerKey':{'type':Sequelize[_0x8e61('0x2')]},'consumerSecret':{'type':Sequelize[_0x8e61('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8e61('0x4'),_0x8e61('0x5')),'defaultValue':_0x8e61('0x4')}};
\ No newline at end of file
+var _0x6e69=['STRING','ENUM','basic','newTab','integrationTab','sequelize','exports'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6e69,0x6e));var _0x96e6=function(_0x471c71,_0x403c2f){_0x471c71=_0x471c71-0x0;var _0xdc3230=_0x6e69[_0x471c71];return _0xdc3230;};'use strict';var Sequelize=require(_0x96e6('0x0'));module[_0x96e6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x96e6('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x96e6('0x2')]},'authType':{'type':Sequelize[_0x96e6('0x3')](_0x96e6('0x4')),'defaultValue':_0x96e6('0x4')},'password':{'type':Sequelize[_0x96e6('0x2')]},'consumerKey':{'type':Sequelize[_0x96e6('0x2')]},'consumerSecret':{'type':Sequelize[_0x96e6('0x2')]},'token':{'type':Sequelize[_0x96e6('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x96e6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x96e6('0x3')]('integrationTab',_0x96e6('0x5')),'defaultValue':_0x96e6('0x6')}};
\ No newline at end of file
index 33ea88b..1293a40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e39=['crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','set','json','apply','reject','update','then','destroy','error','stack','name','send','index','DeskAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','DeskField','Descriptions','getFields','priority','authType','username','consumerKey','token','tokenSecret','slice','substring','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','base64','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x330418,_0x5f1c89){var _0x3a5a7c=function(_0x1ee306){while(--_0x1ee306){_0x330418['push'](_0x330418['shift']());}};_0x3a5a7c(++_0x5f1c89);}(_0x5e39,0x1a9));var _0x95e3=function(_0x504d2b,_0x3c34ae){_0x504d2b=_0x504d2b-0x0;var _0x18ef75=_0x5e39[_0x504d2b];return _0x18ef75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x95e3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95e3('0x1'));var moment=require(_0x95e3('0x2'));var BPromise=require(_0x95e3('0x3'));var Mustache=require(_0x95e3('0x4'));var util=require(_0x95e3('0x5'));var path=require('path');var sox=require(_0x95e3('0x6'));var csv=require(_0x95e3('0x7'));var ejs=require(_0x95e3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95e3('0x9'));var squel=require(_0x95e3('0xa'));var crypto=require(_0x95e3('0xb'));var jsforce=require(_0x95e3('0xc'));var deskjs=require(_0x95e3('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x95e3('0xe'));var Redis=require(_0x95e3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95e3('0x10'));var logger=require(_0x95e3('0x11'))(_0x95e3('0x12'));var utils=require(_0x95e3('0x13'));var config=require(_0x95e3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x95e3('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x250b13,_0x15517a){_0x15517a=_0x15517a||0xcc;return function(_0x5bb507){if(_0x5bb507){return _0x250b13[_0x95e3('0x16')](_0x15517a);}return _0x250b13[_0x95e3('0x17')](_0x15517a)[_0x95e3('0x18')]();};}function respondWithResult(_0x1c46c2,_0x302f67){_0x302f67=_0x302f67||0xc8;return function(_0x179490){if(_0x179490){return _0x1c46c2[_0x95e3('0x17')](_0x302f67)['json'](_0x179490);}};}function respondWithFilteredResult(_0x2822d8,_0x5a06d8){return function(_0x40e0af){if(_0x40e0af){var _0x4f9366=typeof _0x5a06d8[_0x95e3('0x19')]==='undefined'&&typeof _0x5a06d8[_0x95e3('0x1a')]==='undefined';var _0x123157=_0x40e0af[_0x95e3('0x1b')];var _0x19eb4e=_0x4f9366?0x0:_0x5a06d8['offset'];var _0xa60957=_0x4f9366?_0x40e0af[_0x95e3('0x1b')]:_0x5a06d8[_0x95e3('0x19')]+_0x5a06d8[_0x95e3('0x1a')];var _0x1128b8;if(_0xa60957>=_0x123157){_0xa60957=_0x123157;_0x1128b8=0xc8;}else{_0x1128b8=0xce;}_0x2822d8[_0x95e3('0x17')](_0x1128b8);return _0x2822d8[_0x95e3('0x1c')]('Content-Range',_0x19eb4e+'-'+_0xa60957+'/'+_0x123157)[_0x95e3('0x1d')](_0x40e0af);}return null;};}function patchUpdates(_0x33ea7){return function(_0x2d82f5){try{jsonpatch[_0x95e3('0x1e')](_0x2d82f5,_0x33ea7,!![]);}catch(_0x5aeb28){return BPromise[_0x95e3('0x1f')](_0x5aeb28);}return _0x2d82f5['save']();};}function saveUpdates(_0x34cd89,_0x1645b2){return function(_0x32970e){if(_0x32970e){return _0x32970e[_0x95e3('0x20')](_0x34cd89)[_0x95e3('0x21')](function(_0x44d65e){return _0x44d65e;});}return null;};}function removeEntity(_0x377241,_0x40f912){return function(_0x2a7e6f){if(_0x2a7e6f){return _0x2a7e6f[_0x95e3('0x22')]()[_0x95e3('0x21')](function(){_0x377241[_0x95e3('0x17')](0xcc)[_0x95e3('0x18')]();});}};}function handleEntityNotFound(_0x19b857,_0x3e1b1b){return function(_0xb6faf2){if(!_0xb6faf2){_0x19b857[_0x95e3('0x16')](0x194);}return _0xb6faf2;};}function handleError(_0x1cf608,_0x5c2df1){_0x5c2df1=_0x5c2df1||0x1f4;return function(_0x104e6f){logger[_0x95e3('0x23')](_0x104e6f[_0x95e3('0x24')]);if(_0x104e6f['name']){delete _0x104e6f[_0x95e3('0x25')];}_0x1cf608[_0x95e3('0x17')](_0x5c2df1)[_0x95e3('0x26')](_0x104e6f);};}exports[_0x95e3('0x27')]=function(_0x1032ec,_0x19f14c){var _0x390b44={},_0x2f0808={},_0x3f1653={'count':0x0,'rows':[]};var _0x1d713c=_['map'](db[_0x95e3('0x28')][_0x95e3('0x29')],function(_0x384207){return{'name':_0x384207[_0x95e3('0x2a')],'type':_0x384207['type'][_0x95e3('0x2b')]};});_0x2f0808[_0x95e3('0x2c')]=_[_0x95e3('0x2d')](_0x1d713c,_0x95e3('0x25'));_0x2f0808[_0x95e3('0x2e')]=_[_0x95e3('0x2f')](_0x1032ec['query']);_0x2f0808[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0x2f0808[_0x95e3('0x2c')],_0x2f0808[_0x95e3('0x2e')]);_0x390b44[_0x95e3('0x32')]=_[_0x95e3('0x31')](_0x2f0808[_0x95e3('0x2c')],qs[_0x95e3('0x33')](_0x1032ec[_0x95e3('0x2e')][_0x95e3('0x33')]));_0x390b44['attributes']=_0x390b44[_0x95e3('0x32')][_0x95e3('0x34')]?_0x390b44['attributes']:_0x2f0808[_0x95e3('0x2c')];if(!_0x1032ec[_0x95e3('0x2e')]['hasOwnProperty']('nolimit')){_0x390b44['limit']=qs[_0x95e3('0x1a')](_0x1032ec[_0x95e3('0x2e')]['limit']);_0x390b44[_0x95e3('0x19')]=qs['offset'](_0x1032ec['query'][_0x95e3('0x19')]);}_0x390b44[_0x95e3('0x35')]=qs[_0x95e3('0x36')](_0x1032ec['query']['sort']);_0x390b44['where']=qs['filters'](_['pick'](_0x1032ec['query'],_0x2f0808[_0x95e3('0x30')]),_0x1d713c);if(_0x1032ec[_0x95e3('0x2e')][_0x95e3('0x37')]){_0x390b44[_0x95e3('0x38')]=_[_0x95e3('0x39')](_0x390b44['where'],{'$or':_[_0x95e3('0x2d')](_0x1d713c,function(_0x402ebd){if(_0x402ebd[_0x95e3('0x3a')]!==_0x95e3('0x3b')){var _0x4629af={};_0x4629af[_0x402ebd[_0x95e3('0x25')]]={'$like':'%'+_0x1032ec['query'][_0x95e3('0x37')]+'%'};return _0x4629af;}})});}_0x390b44=_[_0x95e3('0x39')]({},_0x390b44,_0x1032ec[_0x95e3('0x3c')]);var _0x50b1ab={'where':_0x390b44[_0x95e3('0x38')]};return db[_0x95e3('0x28')][_0x95e3('0x1b')](_0x50b1ab)[_0x95e3('0x21')](function(_0x13cf37){_0x3f1653[_0x95e3('0x1b')]=_0x13cf37;if(_0x1032ec[_0x95e3('0x2e')][_0x95e3('0x3d')]){_0x390b44[_0x95e3('0x3e')]=[{'all':!![]}];}return db['DeskAccount'][_0x95e3('0x3f')](_0x390b44);})['then'](function(_0xd5155b){_0x3f1653[_0x95e3('0x40')]=_0xd5155b;return _0x3f1653;})[_0x95e3('0x21')](respondWithFilteredResult(_0x19f14c,_0x390b44))[_0x95e3('0x41')](handleError(_0x19f14c,null));};exports['show']=function(_0x3cdc4f,_0x77e80d){var _0x15394e={'raw':![],'where':{'id':_0x3cdc4f[_0x95e3('0x42')]['id']}},_0xd9599f={};_0xd9599f['model']=_[_0x95e3('0x2f')](db[_0x95e3('0x28')][_0x95e3('0x29')]);_0xd9599f['query']=_['keys'](_0x3cdc4f[_0x95e3('0x2e')]);_0xd9599f[_0x95e3('0x30')]=_[_0x95e3('0x31')](_0xd9599f[_0x95e3('0x2c')],_0xd9599f[_0x95e3('0x2e')]);_0x15394e[_0x95e3('0x32')]=_[_0x95e3('0x31')](_0xd9599f[_0x95e3('0x2c')],qs[_0x95e3('0x33')](_0x3cdc4f[_0x95e3('0x2e')]['fields']));_0x15394e[_0x95e3('0x32')]=_0x15394e[_0x95e3('0x32')][_0x95e3('0x34')]?_0x15394e['attributes']:_0xd9599f[_0x95e3('0x2c')];if(_0x3cdc4f[_0x95e3('0x2e')]['includeAll']){_0x15394e[_0x95e3('0x3e')]=[{'all':!![]}];}_0x15394e=_[_0x95e3('0x39')]({},_0x15394e,_0x3cdc4f[_0x95e3('0x3c')]);return db['DeskAccount']['find'](_0x15394e)['then'](handleEntityNotFound(_0x77e80d,null))[_0x95e3('0x21')](respondWithResult(_0x77e80d,null))[_0x95e3('0x41')](handleError(_0x77e80d,null));};exports['create']=function(_0x5379bb,_0x2f2fc0){return db[_0x95e3('0x28')][_0x95e3('0x43')](_0x5379bb[_0x95e3('0x44')],{})['then'](respondWithResult(_0x2f2fc0,0xc9))['catch'](handleError(_0x2f2fc0,null));};exports[_0x95e3('0x20')]=function(_0x2942a1,_0x4523fa){if(_0x2942a1[_0x95e3('0x44')]['id']){delete _0x2942a1[_0x95e3('0x44')]['id'];}return db[_0x95e3('0x28')][_0x95e3('0x45')]({'where':{'id':_0x2942a1['params']['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x4523fa,null))[_0x95e3('0x21')](saveUpdates(_0x2942a1['body'],null))[_0x95e3('0x21')](respondWithResult(_0x4523fa,null))[_0x95e3('0x41')](handleError(_0x4523fa,null));};exports[_0x95e3('0x22')]=function(_0x5a160d,_0x249588){return db['DeskAccount'][_0x95e3('0x45')]({'where':{'id':_0x5a160d[_0x95e3('0x42')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x249588,null))['then'](removeEntity(_0x249588,null))[_0x95e3('0x41')](handleError(_0x249588,null));};exports[_0x95e3('0x46')]=function(_0x1822ae,_0x39428c,_0x23e667){var _0x3513c5={};var _0x2be2fa={};var _0x4a724e;var _0x11c15f;return db['DeskAccount'][_0x95e3('0x47')]({'where':{'id':_0x1822ae[_0x95e3('0x42')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x39428c,null))['then'](function(_0x54ed72){if(_0x54ed72){_0x4a724e=_0x54ed72;_0x2be2fa[_0x95e3('0x2c')]=_[_0x95e3('0x2f')](db[_0x95e3('0x48')][_0x95e3('0x29')]);_0x2be2fa['query']=_[_0x95e3('0x2f')](_0x1822ae['query']);_0x2be2fa[_0x95e3('0x30')]=_['intersection'](_0x2be2fa[_0x95e3('0x2c')],_0x2be2fa['query']);_0x3513c5[_0x95e3('0x32')]=_[_0x95e3('0x31')](_0x2be2fa[_0x95e3('0x2c')],qs[_0x95e3('0x33')](_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x33')]));_0x3513c5[_0x95e3('0x32')]=_0x3513c5[_0x95e3('0x32')][_0x95e3('0x34')]?_0x3513c5['attributes']:_0x2be2fa[_0x95e3('0x2c')];_0x3513c5['order']=qs[_0x95e3('0x36')](_0x1822ae[_0x95e3('0x2e')]['sort']);_0x3513c5[_0x95e3('0x38')]=qs[_0x95e3('0x30')](_['pick'](_0x1822ae[_0x95e3('0x2e')],_0x2be2fa[_0x95e3('0x30')]));if(_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x37')]){_0x3513c5[_0x95e3('0x38')]=_[_0x95e3('0x39')](_0x3513c5[_0x95e3('0x38')],{'$or':_[_0x95e3('0x2d')](_0x3513c5[_0x95e3('0x32')],function(_0x4dd19e){var _0x1bea89={};_0x1bea89[_0x4dd19e]={'$like':'%'+_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x37')]+'%'};return _0x1bea89;})});}_0x3513c5=_[_0x95e3('0x39')]({},_0x3513c5,_0x1822ae[_0x95e3('0x3c')]);return _0x4a724e['getConfigurations'](_0x3513c5);}})[_0x95e3('0x21')](function(_0x48b41c){if(_0x48b41c){_0x11c15f=_0x48b41c[_0x95e3('0x34')];if(!_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x49')](_0x95e3('0x4a'))){_0x3513c5['limit']=qs['limit'](_0x1822ae[_0x95e3('0x2e')]['limit']);_0x3513c5[_0x95e3('0x19')]=qs[_0x95e3('0x19')](_0x1822ae[_0x95e3('0x2e')][_0x95e3('0x19')]);}return _0x4a724e['getConfigurations'](_0x3513c5);}})[_0x95e3('0x21')](function(_0x2fe732){if(_0x2fe732){return _0x2fe732?{'count':_0x11c15f,'rows':_0x2fe732}:null;}})[_0x95e3('0x21')](respondWithResult(_0x39428c,null))[_0x95e3('0x41')](handleError(_0x39428c,null));};exports[_0x95e3('0x4b')]=function(_0x49f749,_0x569df3,_0x23aa89){if(_0x49f749[_0x95e3('0x44')]['id']){delete _0x49f749[_0x95e3('0x44')]['id'];}return db[_0x95e3('0x28')][_0x95e3('0x47')]({'where':{'id':_0x49f749[_0x95e3('0x42')]['id']}})[_0x95e3('0x21')](handleEntityNotFound(_0x569df3,null))[_0x95e3('0x21')](function(_0x5d4ae8){if(_0x5d4ae8){_0x49f749[_0x95e3('0x44')][_0x95e3('0x4c')]=_0x5d4ae8['id'];_0x49f749[_0x95e3('0x44')][_0x95e3('0x4d')]=integrations[_0x95e3('0x4e')](_0x49f749[_0x95e3('0x44')]['channel'],_0x49f749['body'][_0x95e3('0x3a')]);_0x49f749['body']['Descriptions']=integrations['getDescriptions'](_0x49f749['body'][_0x95e3('0x4f')],_0x49f749[_0x95e3('0x44')][_0x95e3('0x3a')]);return db[_0x95e3('0x48')]['create'](_0x49f749[_0x95e3('0x44')],{'include':[{'model':db[_0x95e3('0x50')],'as':_0x95e3('0x4d')},{'model':db[_0x95e3('0x50')],'as':_0x95e3('0x51')}]});}return null;})[_0x95e3('0x21')](respondWithResult(_0x569df3,null))['catch'](handleError(_0x569df3,null));};exports[_0x95e3('0x52')]=function(_0xb6ec1e,_0x2e7b70,_0x31a161){var _0x12d55a=[{'name':'priority','label':_0x95e3('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x29d693='';return db[_0x95e3('0x28')][_0x95e3('0x47')]({'where':{'id':_0xb6ec1e['params']['id']},'attributes':['id','remoteUri',_0x95e3('0x54'),_0x95e3('0x55'),'password',_0x95e3('0x56'),'consumerSecret',_0x95e3('0x57'),_0x95e3('0x58')]})['then'](handleEntityNotFound(_0x2e7b70,null))[_0x95e3('0x21')](function(_0x4640a8){if(_0x4640a8){_0x29d693=_0x4640a8['remoteUri'];var _0x1dc0c3=_0x29d693[_0x95e3('0x59')](-0x1);if(_0x1dc0c3==='/'){_0x29d693=_0x29d693[_0x95e3('0x5a')](0x0,_0x29d693['lastIndexOf'](_0x1dc0c3));}var _0x3a1e5d={'method':'GET','uri':util[_0x95e3('0x5b')]('%s/custom_fields',_0x29d693),'headers':{'Content-Type':_0x95e3('0x5c'),'Accept':'application/json'},'json':!![]};if(_0x4640a8['authType']===_0x95e3('0x5d')){_0x3a1e5d[_0x95e3('0x5e')][_0x95e3('0x5f')]=util['format'](_0x95e3('0x60'),new Buffer(util[_0x95e3('0x5b')](_0x95e3('0x61'),_0x4640a8[_0x95e3('0x55')],_0x4640a8[_0x95e3('0x62')]))[_0x95e3('0x63')](_0x95e3('0x64')));}return rp(_0x3a1e5d)['then'](function(_0x2b7e83){return _0x12d55a['concat'](_[_0x95e3('0x2d')](_0x2b7e83['_embedded'][_0x95e3('0x65')],function(_0x1bce67){return{'id':_0x1bce67['name'],'name':_0x1bce67[_0x95e3('0x25')],'type':_0x1bce67[_0x95e3('0x3a')],'active':_0x1bce67[_0x95e3('0x66')],'label':_0x1bce67[_0x95e3('0x67')],'custom':!![]};}));});}})[_0x95e3('0x21')](function(_0x46f7aa){return{'count':_0x46f7aa[_0x95e3('0x34')],'rows':_0x46f7aa};})[_0x95e3('0x21')](respondWithResult(_0x2e7b70,null))[_0x95e3('0x41')](function(_0x3d4fc0){var _0x236bde=_0xb6ec1e[_0x95e3('0x2e')]['test']?0x1f4:_0x3d4fc0[_0x95e3('0x68')]||0x1f4;logger[_0x95e3('0x23')](_0x95e3('0x69'),_0x95e3('0x52'),_0x236bde,JSON[_0x95e3('0x6a')](_0x3d4fc0));delete _0x3d4fc0[_0x95e3('0x25')];if(_0x236bde===0x191){_0x236bde=0x190;}_0x2e7b70[_0x95e3('0x17')](_0x236bde)['send'](_0xb6ec1e['query'][_0x95e3('0x6b')]?{'message':_0x95e3('0x6c'),'statusCode':_0x3d4fc0[_0x95e3('0x68')]}:_0x3d4fc0);});};
\ No newline at end of file
+var _0x4905=['destroy','sendStatus','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','options','DeskAccount','includeAll','include','rows','catch','show','params','create','body','find','getConfigurations','rawAttributes','filter','hasOwnProperty','findOne','AccountId','Subjects','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then'];(function(_0x84293f,_0x1b4173){var _0x15a611=function(_0x32f46b){while(--_0x32f46b){_0x84293f['push'](_0x84293f['shift']());}};_0x15a611(++_0x1b4173);}(_0x4905,0x135));var _0x5490=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x4905[_0x53bcc3];return _0x47c959;};'use strict';var emlformat=require(_0x5490('0x0'));var rimraf=require(_0x5490('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5490('0x2'));var moment=require(_0x5490('0x3'));var BPromise=require(_0x5490('0x4'));var Mustache=require(_0x5490('0x5'));var util=require(_0x5490('0x6'));var path=require(_0x5490('0x7'));var sox=require(_0x5490('0x8'));var csv=require('to-csv');var ejs=require(_0x5490('0x9'));var fs=require('fs');var fs_extra=require(_0x5490('0xa'));var _=require(_0x5490('0xb'));var squel=require(_0x5490('0xc'));var crypto=require(_0x5490('0xd'));var jsforce=require(_0x5490('0xe'));var deskjs=require(_0x5490('0xf'));var toCsv=require(_0x5490('0x10'));var querystring=require(_0x5490('0x11'));var Papa=require(_0x5490('0x12'));var Redis=require(_0x5490('0x13'));var authService=require(_0x5490('0x14'));var qs=require(_0x5490('0x15'));var as=require(_0x5490('0x16'));var hardwareService=require(_0x5490('0x17'));var logger=require(_0x5490('0x18'))(_0x5490('0x19'));var utils=require(_0x5490('0x1a'));var config=require(_0x5490('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x5490('0x1c'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3a6aa2,_0x7320d7){_0x7320d7=_0x7320d7||0xcc;return function(_0x5218d8){if(_0x5218d8){return _0x3a6aa2['sendStatus'](_0x7320d7);}return _0x3a6aa2['status'](_0x7320d7)[_0x5490('0x1d')]();};}function respondWithResult(_0x17d105,_0x3bf4f6){_0x3bf4f6=_0x3bf4f6||0xc8;return function(_0x3d2c98){if(_0x3d2c98){return _0x17d105[_0x5490('0x1e')](_0x3bf4f6)[_0x5490('0x1f')](_0x3d2c98);}};}function respondWithFilteredResult(_0x3231d9,_0x4d8de5){return function(_0x2b45a7){if(_0x2b45a7){var _0x2d68e0=typeof _0x4d8de5[_0x5490('0x20')]===_0x5490('0x21')&&typeof _0x4d8de5['limit']===_0x5490('0x21');var _0x197cb6=_0x2b45a7[_0x5490('0x22')];var _0x38ea4b=_0x2d68e0?0x0:_0x4d8de5[_0x5490('0x20')];var _0x14475e=_0x2d68e0?_0x2b45a7[_0x5490('0x22')]:_0x4d8de5[_0x5490('0x20')]+_0x4d8de5[_0x5490('0x23')];var _0x4cd467;if(_0x14475e>=_0x197cb6){_0x14475e=_0x197cb6;_0x4cd467=0xc8;}else{_0x4cd467=0xce;}_0x3231d9[_0x5490('0x1e')](_0x4cd467);return _0x3231d9['set'](_0x5490('0x24'),_0x38ea4b+'-'+_0x14475e+'/'+_0x197cb6)[_0x5490('0x1f')](_0x2b45a7);}return null;};}function patchUpdates(_0x597769){return function(_0x425aa3){try{jsonpatch[_0x5490('0x25')](_0x425aa3,_0x597769,!![]);}catch(_0x49ba84){return BPromise[_0x5490('0x26')](_0x49ba84);}return _0x425aa3[_0x5490('0x27')]();};}function saveUpdates(_0xa57330,_0x522519){return function(_0x12e7df){if(_0x12e7df){return _0x12e7df[_0x5490('0x28')](_0xa57330)[_0x5490('0x29')](function(_0x138096){return _0x138096;});}return null;};}function removeEntity(_0x2f5401,_0x476131){return function(_0x85b958){if(_0x85b958){return _0x85b958[_0x5490('0x2a')]()[_0x5490('0x29')](function(){_0x2f5401[_0x5490('0x1e')](0xcc)[_0x5490('0x1d')]();});}};}function handleEntityNotFound(_0x54fa30,_0x111698){return function(_0x354323){if(!_0x354323){_0x54fa30[_0x5490('0x2b')](0x194);}return _0x354323;};}function handleError(_0x51115d,_0x13de9b){_0x13de9b=_0x13de9b||0x1f4;return function(_0x58ee85){logger[_0x5490('0x2c')](_0x58ee85[_0x5490('0x2d')]);if(_0x58ee85['name']){delete _0x58ee85[_0x5490('0x2e')];}_0x51115d['status'](_0x13de9b)[_0x5490('0x2f')](_0x58ee85);};}exports['index']=function(_0x25d486,_0x3e7325){var _0x814cfc={},_0x404760={},_0x3bdb36={'count':0x0,'rows':[]};var _0xc7104f=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3f1459){return{'name':_0x3f1459[_0x5490('0x30')],'type':_0x3f1459[_0x5490('0x31')][_0x5490('0x32')]};});_0x404760[_0x5490('0x33')]=_[_0x5490('0x34')](_0xc7104f,_0x5490('0x2e'));_0x404760[_0x5490('0x35')]=_[_0x5490('0x36')](_0x25d486[_0x5490('0x35')]);_0x404760[_0x5490('0x37')]=_['intersection'](_0x404760[_0x5490('0x33')],_0x404760[_0x5490('0x35')]);_0x814cfc[_0x5490('0x38')]=_[_0x5490('0x39')](_0x404760[_0x5490('0x33')],qs[_0x5490('0x3a')](_0x25d486[_0x5490('0x35')][_0x5490('0x3a')]));_0x814cfc[_0x5490('0x38')]=_0x814cfc[_0x5490('0x38')][_0x5490('0x3b')]?_0x814cfc[_0x5490('0x38')]:_0x404760[_0x5490('0x33')];if(!_0x25d486[_0x5490('0x35')]['hasOwnProperty'](_0x5490('0x3c'))){_0x814cfc[_0x5490('0x23')]=qs['limit'](_0x25d486['query'][_0x5490('0x23')]);_0x814cfc['offset']=qs[_0x5490('0x20')](_0x25d486['query']['offset']);}_0x814cfc[_0x5490('0x3d')]=qs['sort'](_0x25d486[_0x5490('0x35')][_0x5490('0x3e')]);_0x814cfc['where']=qs[_0x5490('0x37')](_[_0x5490('0x3f')](_0x25d486['query'],_0x404760[_0x5490('0x37')]),_0xc7104f);if(_0x25d486[_0x5490('0x35')]['filter']){_0x814cfc[_0x5490('0x40')]=_[_0x5490('0x41')](_0x814cfc[_0x5490('0x40')],{'$or':_[_0x5490('0x34')](_0xc7104f,function(_0x4df6ee){if(_0x4df6ee[_0x5490('0x31')]!==_0x5490('0x42')){var _0x58176d={};_0x58176d[_0x4df6ee[_0x5490('0x2e')]]={'$like':'%'+_0x25d486[_0x5490('0x35')]['filter']+'%'};return _0x58176d;}})});}_0x814cfc=_[_0x5490('0x41')]({},_0x814cfc,_0x25d486[_0x5490('0x43')]);var _0x101ca5={'where':_0x814cfc[_0x5490('0x40')]};return db[_0x5490('0x44')]['count'](_0x101ca5)[_0x5490('0x29')](function(_0x1eade5){_0x3bdb36[_0x5490('0x22')]=_0x1eade5;if(_0x25d486[_0x5490('0x35')][_0x5490('0x45')]){_0x814cfc[_0x5490('0x46')]=[{'all':!![]}];}return db[_0x5490('0x44')]['findAll'](_0x814cfc);})[_0x5490('0x29')](function(_0x4c7efd){_0x3bdb36[_0x5490('0x47')]=_0x4c7efd;return _0x3bdb36;})[_0x5490('0x29')](respondWithFilteredResult(_0x3e7325,_0x814cfc))[_0x5490('0x48')](handleError(_0x3e7325,null));};exports[_0x5490('0x49')]=function(_0x4b710b,_0x479ee1){var _0x4e0b1b={'raw':![],'where':{'id':_0x4b710b[_0x5490('0x4a')]['id']}},_0x5c55a6={};_0x5c55a6[_0x5490('0x33')]=_[_0x5490('0x36')](db[_0x5490('0x44')]['rawAttributes']);_0x5c55a6[_0x5490('0x35')]=_['keys'](_0x4b710b['query']);_0x5c55a6[_0x5490('0x37')]=_[_0x5490('0x39')](_0x5c55a6[_0x5490('0x33')],_0x5c55a6[_0x5490('0x35')]);_0x4e0b1b[_0x5490('0x38')]=_[_0x5490('0x39')](_0x5c55a6['model'],qs['fields'](_0x4b710b[_0x5490('0x35')][_0x5490('0x3a')]));_0x4e0b1b['attributes']=_0x4e0b1b[_0x5490('0x38')]['length']?_0x4e0b1b[_0x5490('0x38')]:_0x5c55a6['model'];if(_0x4b710b[_0x5490('0x35')]['includeAll']){_0x4e0b1b['include']=[{'all':!![]}];}_0x4e0b1b=_[_0x5490('0x41')]({},_0x4e0b1b,_0x4b710b[_0x5490('0x43')]);return db['DeskAccount']['find'](_0x4e0b1b)[_0x5490('0x29')](handleEntityNotFound(_0x479ee1,null))[_0x5490('0x29')](respondWithResult(_0x479ee1,null))['catch'](handleError(_0x479ee1,null));};exports['create']=function(_0x2105a1,_0x5415fb){return db[_0x5490('0x44')][_0x5490('0x4b')](_0x2105a1[_0x5490('0x4c')],{})[_0x5490('0x29')](respondWithResult(_0x5415fb,0xc9))[_0x5490('0x48')](handleError(_0x5415fb,null));};exports['update']=function(_0x34129f,_0x402f9d){if(_0x34129f[_0x5490('0x4c')]['id']){delete _0x34129f['body']['id'];}return db[_0x5490('0x44')][_0x5490('0x4d')]({'where':{'id':_0x34129f['params']['id']}})['then'](handleEntityNotFound(_0x402f9d,null))['then'](saveUpdates(_0x34129f['body'],null))[_0x5490('0x29')](respondWithResult(_0x402f9d,null))[_0x5490('0x48')](handleError(_0x402f9d,null));};exports[_0x5490('0x2a')]=function(_0x58e9f9,_0x393fc0){return db[_0x5490('0x44')][_0x5490('0x4d')]({'where':{'id':_0x58e9f9[_0x5490('0x4a')]['id']}})['then'](handleEntityNotFound(_0x393fc0,null))[_0x5490('0x29')](removeEntity(_0x393fc0,null))[_0x5490('0x48')](handleError(_0x393fc0,null));};exports[_0x5490('0x4e')]=function(_0x57313a,_0x2144b7,_0x4f28cb){var _0x160191={};var _0x218444={};var _0x4cf224;var _0x326b11;return db['DeskAccount']['findOne']({'where':{'id':_0x57313a[_0x5490('0x4a')]['id']}})[_0x5490('0x29')](handleEntityNotFound(_0x2144b7,null))[_0x5490('0x29')](function(_0x6d3eb8){if(_0x6d3eb8){_0x4cf224=_0x6d3eb8;_0x218444[_0x5490('0x33')]=_[_0x5490('0x36')](db['DeskConfiguration'][_0x5490('0x4f')]);_0x218444['query']=_[_0x5490('0x36')](_0x57313a[_0x5490('0x35')]);_0x218444['filters']=_['intersection'](_0x218444[_0x5490('0x33')],_0x218444['query']);_0x160191['attributes']=_[_0x5490('0x39')](_0x218444['model'],qs[_0x5490('0x3a')](_0x57313a['query'][_0x5490('0x3a')]));_0x160191[_0x5490('0x38')]=_0x160191['attributes'][_0x5490('0x3b')]?_0x160191['attributes']:_0x218444['model'];_0x160191['order']=qs[_0x5490('0x3e')](_0x57313a[_0x5490('0x35')][_0x5490('0x3e')]);_0x160191[_0x5490('0x40')]=qs[_0x5490('0x37')](_[_0x5490('0x3f')](_0x57313a[_0x5490('0x35')],_0x218444['filters']));if(_0x57313a[_0x5490('0x35')]['filter']){_0x160191[_0x5490('0x40')]=_[_0x5490('0x41')](_0x160191[_0x5490('0x40')],{'$or':_[_0x5490('0x34')](_0x160191[_0x5490('0x38')],function(_0x662555){var _0x11e1c1={};_0x11e1c1[_0x662555]={'$like':'%'+_0x57313a[_0x5490('0x35')][_0x5490('0x50')]+'%'};return _0x11e1c1;})});}_0x160191=_['merge']({},_0x160191,_0x57313a[_0x5490('0x43')]);return _0x4cf224['getConfigurations'](_0x160191);}})[_0x5490('0x29')](function(_0x2dcc79){if(_0x2dcc79){_0x326b11=_0x2dcc79[_0x5490('0x3b')];if(!_0x57313a[_0x5490('0x35')][_0x5490('0x51')](_0x5490('0x3c'))){_0x160191['limit']=qs[_0x5490('0x23')](_0x57313a[_0x5490('0x35')]['limit']);_0x160191[_0x5490('0x20')]=qs[_0x5490('0x20')](_0x57313a['query']['offset']);}return _0x4cf224['getConfigurations'](_0x160191);}})[_0x5490('0x29')](function(_0x53140b){if(_0x53140b){return _0x53140b?{'count':_0x326b11,'rows':_0x53140b}:null;}})[_0x5490('0x29')](respondWithResult(_0x2144b7,null))[_0x5490('0x48')](handleError(_0x2144b7,null));};exports['addConfiguration']=function(_0x5246fc,_0x390b31,_0x54caa2){if(_0x5246fc[_0x5490('0x4c')]['id']){delete _0x5246fc[_0x5490('0x4c')]['id'];}return db[_0x5490('0x44')][_0x5490('0x52')]({'where':{'id':_0x5246fc[_0x5490('0x4a')]['id']}})[_0x5490('0x29')](handleEntityNotFound(_0x390b31,null))[_0x5490('0x29')](function(_0x26089b){if(_0x26089b){_0x5246fc[_0x5490('0x4c')][_0x5490('0x53')]=_0x26089b['id'];_0x5246fc[_0x5490('0x4c')][_0x5490('0x54')]=integrations['getSubjects'](_0x5246fc[_0x5490('0x4c')]['channel'],_0x5246fc[_0x5490('0x4c')][_0x5490('0x31')]);_0x5246fc[_0x5490('0x4c')][_0x5490('0x55')]=integrations[_0x5490('0x56')](_0x5246fc[_0x5490('0x4c')]['channel'],_0x5246fc[_0x5490('0x4c')][_0x5490('0x31')]);return db[_0x5490('0x57')][_0x5490('0x4b')](_0x5246fc[_0x5490('0x4c')],{'include':[{'model':db[_0x5490('0x58')],'as':_0x5490('0x54')},{'model':db[_0x5490('0x58')],'as':_0x5490('0x55')}]});}return null;})[_0x5490('0x29')](respondWithResult(_0x390b31,null))[_0x5490('0x48')](handleError(_0x390b31,null));};exports[_0x5490('0x59')]=function(_0x9d38dd,_0x517c59,_0x5569ce){var _0xe2898e=[{'name':_0x5490('0x5a'),'label':_0x5490('0x5a'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x505e9b='';return db[_0x5490('0x44')][_0x5490('0x52')]({'where':{'id':_0x9d38dd[_0x5490('0x4a')]['id']},'attributes':['id',_0x5490('0x5b'),'authType',_0x5490('0x5c'),_0x5490('0x5d'),_0x5490('0x5e'),_0x5490('0x5f'),_0x5490('0x60'),'tokenSecret']})['then'](handleEntityNotFound(_0x517c59,null))[_0x5490('0x29')](function(_0x56a2f5){if(_0x56a2f5){_0x505e9b=_0x56a2f5[_0x5490('0x5b')];var _0x18728f=_0x505e9b[_0x5490('0x61')](-0x1);if(_0x18728f==='/'){_0x505e9b=_0x505e9b['substring'](0x0,_0x505e9b[_0x5490('0x62')](_0x18728f));}var _0x19cff5={'method':_0x5490('0x63'),'uri':util[_0x5490('0x64')](_0x5490('0x65'),_0x505e9b),'headers':{'Content-Type':_0x5490('0x66'),'Accept':_0x5490('0x66')},'json':!![]};if(_0x56a2f5[_0x5490('0x67')]===_0x5490('0x68')){_0x19cff5[_0x5490('0x69')]['Authorization']=util[_0x5490('0x64')](_0x5490('0x6a'),new Buffer(util[_0x5490('0x64')](_0x5490('0x6b'),_0x56a2f5[_0x5490('0x5c')],_0x56a2f5[_0x5490('0x5d')]))[_0x5490('0x6c')]('base64'));}return rp(_0x19cff5)[_0x5490('0x29')](function(_0x13378b){return _0xe2898e[_0x5490('0x6d')](_['map'](_0x13378b[_0x5490('0x6e')][_0x5490('0x6f')],function(_0x14c0b6){return{'id':_0x14c0b6[_0x5490('0x2e')],'name':_0x14c0b6['name'],'type':_0x14c0b6[_0x5490('0x31')],'active':_0x14c0b6[_0x5490('0x70')],'label':_0x14c0b6['label'],'custom':!![]};}));});}})['then'](function(_0x44217e){return{'count':_0x44217e[_0x5490('0x3b')],'rows':_0x44217e};})[_0x5490('0x29')](respondWithResult(_0x517c59,null))[_0x5490('0x48')](function(_0x365286){var _0x46f303=_0x9d38dd[_0x5490('0x35')][_0x5490('0x71')]?0x1f4:_0x365286[_0x5490('0x72')]||0x1f4;logger[_0x5490('0x2c')](_0x5490('0x73'),'getFields',_0x46f303,JSON['stringify'](_0x365286));delete _0x365286[_0x5490('0x2e')];if(_0x46f303===0x191){_0x46f303=0x190;}_0x517c59[_0x5490('0x1e')](_0x46f303)['send'](_0x9d38dd[_0x5490('0x35')]['test']?{'message':_0x5490('0x74'),'statusCode':_0x365286[_0x5490('0x72')]}:_0x365286);});};
\ No newline at end of file
index d394ebe..44cda1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dd0=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes'];(function(_0x31bca3,_0x209a1e){var _0x2f10ea=function(_0x248a36){while(--_0x248a36){_0x31bca3['push'](_0x31bca3['shift']());}};_0x2f10ea(++_0x209a1e);}(_0x3dd0,0xba));var _0x03dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3dd0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x03dd('0x0'));var logger=require(_0x03dd('0x1'))(_0x03dd('0x2'));var moment=require(_0x03dd('0x3'));var BPromise=require(_0x03dd('0x4'));var rp=require(_0x03dd('0x5'));var fs=require('fs');var path=require(_0x03dd('0x6'));var rimraf=require(_0x03dd('0x7'));var config=require('../../config/environment');var attributes=require(_0x03dd('0x8'));var integrations=require(_0x03dd('0x9'));module['exports']=function(_0x327a05,_0x5b4436){return _0x327a05[_0x03dd('0xa')](_0x03dd('0xb'),attributes,{'tableName':_0x03dd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x311d=['moment','bluebird','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','util','../../config/logger','api'];(function(_0x50f5ae,_0x1f4029){var _0x85b7b0=function(_0x754981){while(--_0x754981){_0x50f5ae['push'](_0x50f5ae['shift']());}};_0x85b7b0(++_0x1f4029);}(_0x311d,0x14d));var _0xd311=function(_0x47e384,_0x574f23){_0x47e384=_0x47e384-0x0;var _0x43fe06=_0x311d[_0x47e384];return _0x43fe06;};'use strict';var _=require('lodash');var util=require(_0xd311('0x0'));var logger=require(_0xd311('0x1'))(_0xd311('0x2'));var moment=require(_0xd311('0x3'));var BPromise=require(_0xd311('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd311('0x5'));var config=require(_0xd311('0x6'));var attributes=require(_0xd311('0x7'));var integrations=require(_0xd311('0x8'));module[_0xd311('0x9')]=function(_0x43bb7a,_0x3489a7){return _0x43bb7a[_0xd311('0xa')]('DeskAccount',attributes,{'tableName':_0xd311('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9d75d91..4c00efd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ddf=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','options','raw','attributes','include','map','model','GetDeskAccount','debug','stringify','ShowDeskAccount','DeskAccount','find'];(function(_0x4faa8d,_0x17a00a){var _0xcee355=function(_0x4c56b9){while(--_0x4c56b9){_0x4faa8d['push'](_0x4faa8d['shift']());}};_0xcee355(++_0x17a00a);}(_0x9ddf,0x88));var _0xf9dd=function(_0x4c7c25,_0x1e16a8){_0x4c7c25=_0x4c7c25-0x0;var _0x297619=_0x9ddf[_0x4c7c25];return _0x297619;};'use strict';var _=require(_0xf9dd('0x0'));var util=require(_0xf9dd('0x1'));var moment=require(_0xf9dd('0x2'));var BPromise=require(_0xf9dd('0x3'));var rs=require(_0xf9dd('0x4'));var fs=require('fs');var Redis=require(_0xf9dd('0x5'));var db=require(_0xf9dd('0x6'))['db'];var utils=require(_0xf9dd('0x7'));var logger=require('../../config/logger')(_0xf9dd('0x8'));var config=require(_0xf9dd('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf9dd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24eda4,_0x4187b6,_0x1407d5){return new BPromise(function(_0x39d52e,_0x4a7e11){return client[_0xf9dd('0xb')](_0x24eda4,_0x1407d5)[_0xf9dd('0xc')](function(_0x2bbd23){logger[_0xf9dd('0xd')](_0xf9dd('0xe'),_0x4187b6,_0xf9dd('0xf'));logger['debug'](_0xf9dd('0x10'),_0x4187b6,_0xf9dd('0xf'),JSON['stringify'](_0x2bbd23));if(_0x2bbd23[_0xf9dd('0x11')]){if(_0x2bbd23['error'][_0xf9dd('0x12')]===0x1f4){logger[_0xf9dd('0x11')](_0xf9dd('0xe'),_0x4187b6,_0x2bbd23[_0xf9dd('0x11')]['message']);return _0x4a7e11(_0x2bbd23['error'][_0xf9dd('0x13')]);}logger['error'](_0xf9dd('0xe'),_0x4187b6,_0x2bbd23['error'][_0xf9dd('0x13')]);return _0x39d52e(_0x2bbd23[_0xf9dd('0x11')][_0xf9dd('0x13')]);}else{logger[_0xf9dd('0xd')](_0xf9dd('0xe'),_0x4187b6,_0xf9dd('0xf'));_0x39d52e(_0x2bbd23[_0xf9dd('0x14')]['message']);}})[_0xf9dd('0x15')](function(_0x500586){logger[_0xf9dd('0x11')](_0xf9dd('0xe'),_0x4187b6,_0x500586);_0x4a7e11(_0x500586);});});}exports['GetDeskAccount']=function(_0x3d6de9){var _0x4ec988=this;return new Promise(function(_0xa3f838,_0x23404a){return db['DeskAccount']['findAll']({'raw':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')][_0xf9dd('0x17')]===undefined?!![]:![]:!![],'where':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')]['where']||null:null,'attributes':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9['options'][_0xf9dd('0x18')]||null:null,'limit':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')]['limit']||null:null,'include':_0x3d6de9[_0xf9dd('0x16')]?_0x3d6de9[_0xf9dd('0x16')][_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x3d6de9[_0xf9dd('0x16')][_0xf9dd('0x19')],function(_0x251655){return{'model':db[_0x251655['model']],'as':_0x251655['as'],'attributes':_0x251655[_0xf9dd('0x18')],'include':_0x251655[_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x251655['include'],function(_0x31ad04){return{'model':db[_0x31ad04[_0xf9dd('0x1b')]],'as':_0x31ad04['as'],'attributes':_0x31ad04['attributes'],'include':_0x31ad04[_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x31ad04[_0xf9dd('0x19')],function(_0x1159fd){return{'model':db[_0x1159fd[_0xf9dd('0x1b')]],'as':_0x1159fd['as'],'attributes':_0x1159fd[_0xf9dd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf9dd('0xc')](function(_0x39d576){logger[_0xf9dd('0xd')](_0xf9dd('0x1c'),_0x3d6de9);logger[_0xf9dd('0x1d')]('GetDeskAccount',_0x3d6de9,JSON[_0xf9dd('0x1e')](_0x39d576));_0xa3f838(_0x39d576);})[_0xf9dd('0x15')](function(_0x1a8d85){logger['error']('GetDeskAccount',_0x1a8d85[_0xf9dd('0x13')],_0x3d6de9);_0x23404a(_0x4ec988['error'](0x1f4,_0x1a8d85[_0xf9dd('0x13')]));});});};exports[_0xf9dd('0x1f')]=function(_0xcb2ad9){var _0x3cf581=this;return new Promise(function(_0x11c9af,_0x369779){return db[_0xf9dd('0x20')][_0xf9dd('0x21')]({'raw':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9[_0xf9dd('0x16')][_0xf9dd('0x17')]===undefined?!![]:![]:!![],'where':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9[_0xf9dd('0x16')]['where']||null:null,'attributes':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9['options'][_0xf9dd('0x18')]||null:null,'include':_0xcb2ad9[_0xf9dd('0x16')]?_0xcb2ad9['options'][_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0xcb2ad9[_0xf9dd('0x16')][_0xf9dd('0x19')],function(_0x10a7b8){return{'model':db[_0x10a7b8[_0xf9dd('0x1b')]],'as':_0x10a7b8['as'],'attributes':_0x10a7b8[_0xf9dd('0x18')],'include':_0x10a7b8[_0xf9dd('0x19')]?_[_0xf9dd('0x1a')](_0x10a7b8[_0xf9dd('0x19')],function(_0x4702ad){return{'model':db[_0x4702ad[_0xf9dd('0x1b')]],'as':_0x4702ad['as'],'attributes':_0x4702ad['attributes'],'include':_0x4702ad[_0xf9dd('0x19')]?_['map'](_0x4702ad[_0xf9dd('0x19')],function(_0x5f5697){return{'model':db[_0x5f5697[_0xf9dd('0x1b')]],'as':_0x5f5697['as'],'attributes':_0x5f5697[_0xf9dd('0x18')]};}):[]};}):[]};}):[]:[]})[_0xf9dd('0xc')](function(_0x40597f){logger[_0xf9dd('0xd')](_0xf9dd('0x1f'),_0xcb2ad9);logger[_0xf9dd('0x1d')](_0xf9dd('0x1f'),_0xcb2ad9,JSON[_0xf9dd('0x1e')](_0x40597f));_0x11c9af(_0x40597f);})[_0xf9dd('0x15')](function(_0x5b2f68){logger[_0xf9dd('0x11')]('ShowDeskAccount',_0x5b2f68[_0xf9dd('0x13')],_0xcb2ad9);_0x369779(_0x3cf581[_0xf9dd('0x11')](0x1f4,_0x5b2f68[_0xf9dd('0x13')]));});});};
\ No newline at end of file
+var _0xa48c=['map','model','ShowDeskAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x5e8159,_0x2e7e21){var _0x1cbb9b=function(_0x262752){while(--_0x262752){_0x5e8159['push'](_0x5e8159['shift']());}};_0x1cbb9b(++_0x2e7e21);}(_0xa48c,0x151));var _0xca48=function(_0x5b3950,_0x4e5556){_0x5b3950=_0x5b3950-0x0;var _0x41e436=_0xa48c[_0x5b3950];return _0x41e436;};'use strict';var _=require(_0xca48('0x0'));var util=require('util');var moment=require(_0xca48('0x1'));var BPromise=require('bluebird');var rs=require(_0xca48('0x2'));var fs=require('fs');var Redis=require(_0xca48('0x3'));var db=require(_0xca48('0x4'))['db'];var utils=require(_0xca48('0x5'));var logger=require(_0xca48('0x6'))('rpc');var config=require(_0xca48('0x7'));var jayson=require(_0xca48('0x8'));var client=jayson[_0xca48('0x9')][_0xca48('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52e6d7,_0x513978,_0x4474a5){return new BPromise(function(_0x47895c,_0x472f55){return client[_0xca48('0xb')](_0x52e6d7,_0x4474a5)[_0xca48('0xc')](function(_0x3583d2){logger[_0xca48('0xd')]('DeskAccount,\x20%s,\x20%s',_0x513978,'request\x20sent');logger[_0xca48('0xe')](_0xca48('0xf'),_0x513978,_0xca48('0x10'),JSON[_0xca48('0x11')](_0x3583d2));if(_0x3583d2['error']){if(_0x3583d2[_0xca48('0x12')][_0xca48('0x13')]===0x1f4){logger[_0xca48('0x12')](_0xca48('0x14'),_0x513978,_0x3583d2[_0xca48('0x12')][_0xca48('0x15')]);return _0x472f55(_0x3583d2['error'][_0xca48('0x15')]);}logger[_0xca48('0x12')](_0xca48('0x14'),_0x513978,_0x3583d2[_0xca48('0x12')][_0xca48('0x15')]);return _0x47895c(_0x3583d2['error'][_0xca48('0x15')]);}else{logger['info'](_0xca48('0x14'),_0x513978,'request\x20sent');_0x47895c(_0x3583d2[_0xca48('0x16')][_0xca48('0x15')]);}})[_0xca48('0x17')](function(_0x2d5e82){logger[_0xca48('0x12')](_0xca48('0x14'),_0x513978,_0x2d5e82);_0x472f55(_0x2d5e82);});});}exports[_0xca48('0x18')]=function(_0x2e7e20){var _0x369427=this;return new Promise(function(_0x23cc72,_0xdb9619){return db[_0xca48('0x19')][_0xca48('0x1a')]({'raw':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x1d')]||null:null,'attributes':_0x2e7e20['options']?_0x2e7e20['options'][_0xca48('0x1e')]||null:null,'limit':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x1f')]||null:null,'include':_0x2e7e20[_0xca48('0x1b')]?_0x2e7e20[_0xca48('0x1b')][_0xca48('0x20')]?_[_0xca48('0x21')](_0x2e7e20['options']['include'],function(_0x5c2381){return{'model':db[_0x5c2381['model']],'as':_0x5c2381['as'],'attributes':_0x5c2381[_0xca48('0x1e')],'include':_0x5c2381['include']?_[_0xca48('0x21')](_0x5c2381[_0xca48('0x20')],function(_0x497799){return{'model':db[_0x497799['model']],'as':_0x497799['as'],'attributes':_0x497799[_0xca48('0x1e')],'include':_0x497799['include']?_[_0xca48('0x21')](_0x497799[_0xca48('0x20')],function(_0x3c3ee4){return{'model':db[_0x3c3ee4[_0xca48('0x22')]],'as':_0x3c3ee4['as'],'attributes':_0x3c3ee4['attributes']};}):[]};}):[]};}):[]:[]})[_0xca48('0xc')](function(_0x81a5fd){logger[_0xca48('0xd')](_0xca48('0x18'),_0x2e7e20);logger[_0xca48('0xe')](_0xca48('0x18'),_0x2e7e20,JSON[_0xca48('0x11')](_0x81a5fd));_0x23cc72(_0x81a5fd);})[_0xca48('0x17')](function(_0x2c40a5){logger[_0xca48('0x12')]('GetDeskAccount',_0x2c40a5['message'],_0x2e7e20);_0xdb9619(_0x369427['error'](0x1f4,_0x2c40a5[_0xca48('0x15')]));});});};exports[_0xca48('0x23')]=function(_0x1b7161){var _0x195ebc=this;return new Promise(function(_0x4b4779,_0x505f66){return db[_0xca48('0x19')][_0xca48('0x24')]({'raw':_0x1b7161['options']?_0x1b7161[_0xca48('0x1b')][_0xca48('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b7161[_0xca48('0x1b')]?_0x1b7161[_0xca48('0x1b')]['where']||null:null,'attributes':_0x1b7161[_0xca48('0x1b')]?_0x1b7161[_0xca48('0x1b')][_0xca48('0x1e')]||null:null,'include':_0x1b7161['options']?_0x1b7161[_0xca48('0x1b')][_0xca48('0x20')]?_[_0xca48('0x21')](_0x1b7161['options']['include'],function(_0x540e25){return{'model':db[_0x540e25['model']],'as':_0x540e25['as'],'attributes':_0x540e25[_0xca48('0x1e')],'include':_0x540e25[_0xca48('0x20')]?_[_0xca48('0x21')](_0x540e25['include'],function(_0x1f2e39){return{'model':db[_0x1f2e39[_0xca48('0x22')]],'as':_0x1f2e39['as'],'attributes':_0x1f2e39[_0xca48('0x1e')],'include':_0x1f2e39['include']?_['map'](_0x1f2e39[_0xca48('0x20')],function(_0x87e7c1){return{'model':db[_0x87e7c1[_0xca48('0x22')]],'as':_0x87e7c1['as'],'attributes':_0x87e7c1[_0xca48('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5355af){logger[_0xca48('0xd')](_0xca48('0x23'),_0x1b7161);logger[_0xca48('0xe')](_0xca48('0x23'),_0x1b7161,JSON[_0xca48('0x11')](_0x5355af));_0x4b4779(_0x5355af);})['catch'](function(_0x27aecc){logger[_0xca48('0x12')]('ShowDeskAccount',_0x27aecc['message'],_0x1b7161);_0x505f66(_0x195ebc[_0xca48('0x12')](0x1f4,_0x27aecc['message']));});});};
\ No newline at end of file
index 84a74f7..9d8b69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x1506a3,_0x158ba3){var _0x14383f=function(_0x371b9f){while(--_0x371b9f){_0x1506a3['push'](_0x1506a3['shift']());}};_0x14383f(++_0x158ba3);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
+var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x2bd177,_0x2c645c){var _0x392860=function(_0x3ebc39){while(--_0x3ebc39){_0x2bd177['push'](_0x2bd177['shift']());}};_0x392860(++_0x2c645c);}(_0xedd9,0xfc));var _0x9edd=function(_0x22962a,_0xcfcaf4){_0x22962a=_0x22962a-0x0;var _0x241ada=_0xedd9[_0x22962a];return _0x241ada;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router;
\ No newline at end of file
index 8e7c08d..22276f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca1=['sequelize','exports','STRING'];(function(_0x35fe37,_0x58895d){var _0x547bb1=function(_0x539676){while(--_0x539676){_0x35fe37['push'](_0x35fe37['shift']());}};_0x547bb1(++_0x58895d);}(_0x8ca1,0x195));var _0x18ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8ca1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x18ca('0x0'));module[_0x18ca('0x1')]={'name':{'type':Sequelize[_0x18ca('0x2')]},'description':{'type':Sequelize[_0x18ca('0x2')]}};
\ No newline at end of file
+var _0x6e9d=['STRING','sequelize','exports'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x6e9d,0x133));var _0xd6e9=function(_0x19ea5b,_0x4b201c){_0x19ea5b=_0x19ea5b-0x0;var _0x38a464=_0x6e9d[_0x19ea5b];return _0x38a464;};'use strict';var Sequelize=require(_0xd6e9('0x0'));module[_0xd6e9('0x1')]={'name':{'type':Sequelize[_0xd6e9('0x2')]},'description':{'type':Sequelize[_0xd6e9('0x2')]}};
\ No newline at end of file
index deebc61..f9964aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d3=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','create','body','update','find','getFields','findOne','pick','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','DeskConfiguration','fieldName','model','query','keys','filters'];(function(_0x4e2a34,_0x4eb859){var _0x3166db=function(_0x3db497){while(--_0x3db497){_0x4e2a34['push'](_0x4e2a34['shift']());}};_0x3166db(++_0x4eb859);}(_0xd1d3,0x1c8));var _0x3d1d=function(_0x486445,_0x1bfe54){_0x486445=_0x486445-0x0;var _0x5313a6=_0xd1d3[_0x486445];return _0x5313a6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3d1d('0x0'));var zipdir=require(_0x3d1d('0x1'));var jsonpatch=require(_0x3d1d('0x2'));var rp=require(_0x3d1d('0x3'));var moment=require('moment');var BPromise=require(_0x3d1d('0x4'));var Mustache=require(_0x3d1d('0x5'));var util=require(_0x3d1d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3d1d('0x7'));var ejs=require(_0x3d1d('0x8'));var fs=require('fs');var fs_extra=require(_0x3d1d('0x9'));var _=require(_0x3d1d('0xa'));var squel=require(_0x3d1d('0xb'));var crypto=require(_0x3d1d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3d1d('0x7'));var querystring=require(_0x3d1d('0xd'));var Papa=require(_0x3d1d('0xe'));var Redis=require(_0x3d1d('0xf'));var authService=require(_0x3d1d('0x10'));var qs=require(_0x3d1d('0x11'));var as=require(_0x3d1d('0x12'));var hardwareService=require(_0x3d1d('0x13'));var logger=require('../../config/logger')(_0x3d1d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3d1d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fd6fc,_0x3f0be8){_0x3f0be8=_0x3f0be8||0xcc;return function(_0x5aed83){if(_0x5aed83){return _0x4fd6fc[_0x3d1d('0x16')](_0x3f0be8);}return _0x4fd6fc[_0x3d1d('0x17')](_0x3f0be8)[_0x3d1d('0x18')]();};}function respondWithResult(_0x369657,_0x22c87e){_0x22c87e=_0x22c87e||0xc8;return function(_0x9db1ac){if(_0x9db1ac){return _0x369657[_0x3d1d('0x17')](_0x22c87e)[_0x3d1d('0x19')](_0x9db1ac);}};}function respondWithFilteredResult(_0x401fe4,_0x5b9d49){return function(_0x501b8f){if(_0x501b8f){var _0x185b68=typeof _0x5b9d49[_0x3d1d('0x1a')]==='undefined'&&typeof _0x5b9d49[_0x3d1d('0x1b')]===_0x3d1d('0x1c');var _0x4c232b=_0x501b8f[_0x3d1d('0x1d')];var _0x4d9a4b=_0x185b68?0x0:_0x5b9d49['offset'];var _0x36ab6b=_0x185b68?_0x501b8f[_0x3d1d('0x1d')]:_0x5b9d49[_0x3d1d('0x1a')]+_0x5b9d49[_0x3d1d('0x1b')];var _0x2c44be;if(_0x36ab6b>=_0x4c232b){_0x36ab6b=_0x4c232b;_0x2c44be=0xc8;}else{_0x2c44be=0xce;}_0x401fe4[_0x3d1d('0x17')](_0x2c44be);return _0x401fe4[_0x3d1d('0x1e')](_0x3d1d('0x1f'),_0x4d9a4b+'-'+_0x36ab6b+'/'+_0x4c232b)[_0x3d1d('0x19')](_0x501b8f);}return null;};}function patchUpdates(_0x43cc32){return function(_0x446703){try{jsonpatch[_0x3d1d('0x20')](_0x446703,_0x43cc32,!![]);}catch(_0x45ea96){return BPromise[_0x3d1d('0x21')](_0x45ea96);}return _0x446703[_0x3d1d('0x22')]();};}function saveUpdates(_0x1be369,_0x2d00dd){return function(_0x150272){if(_0x150272){return _0x150272['update'](_0x1be369)[_0x3d1d('0x23')](function(_0x1c27e5){return _0x1c27e5;});}return null;};}function removeEntity(_0x51995c,_0x552748){return function(_0x1bc5eb){if(_0x1bc5eb){return _0x1bc5eb[_0x3d1d('0x24')]()[_0x3d1d('0x23')](function(){_0x51995c[_0x3d1d('0x17')](0xcc)[_0x3d1d('0x18')]();});}};}function handleEntityNotFound(_0x50abb4,_0x34d2a9){return function(_0x2dfff6){if(!_0x2dfff6){_0x50abb4['sendStatus'](0x194);}return _0x2dfff6;};}function handleError(_0x24e98d,_0x28a608){_0x28a608=_0x28a608||0x1f4;return function(_0xace16e){logger[_0x3d1d('0x25')](_0xace16e['stack']);if(_0xace16e[_0x3d1d('0x26')]){delete _0xace16e[_0x3d1d('0x26')];}_0x24e98d[_0x3d1d('0x17')](_0x28a608)[_0x3d1d('0x27')](_0xace16e);};}exports[_0x3d1d('0x28')]=function(_0x5590e2,_0x73ad51){var _0x4f9338={},_0x20c76f={},_0x3d2784={'count':0x0,'rows':[]};var _0x2fce65=_[_0x3d1d('0x29')](db[_0x3d1d('0x2a')]['rawAttributes'],function(_0x47c628){return{'name':_0x47c628[_0x3d1d('0x2b')],'type':_0x47c628['type']['key']};});_0x20c76f[_0x3d1d('0x2c')]=_['map'](_0x2fce65,_0x3d1d('0x26'));_0x20c76f[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x5590e2[_0x3d1d('0x2d')]);_0x20c76f[_0x3d1d('0x2f')]=_[_0x3d1d('0x30')](_0x20c76f['model'],_0x20c76f[_0x3d1d('0x2d')]);_0x4f9338['attributes']=_[_0x3d1d('0x30')](_0x20c76f['model'],qs[_0x3d1d('0x31')](_0x5590e2[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x4f9338[_0x3d1d('0x32')]=_0x4f9338[_0x3d1d('0x32')][_0x3d1d('0x33')]?_0x4f9338[_0x3d1d('0x32')]:_0x20c76f['model'];if(!_0x5590e2[_0x3d1d('0x2d')][_0x3d1d('0x34')](_0x3d1d('0x35'))){_0x4f9338['limit']=qs[_0x3d1d('0x1b')](_0x5590e2['query'][_0x3d1d('0x1b')]);_0x4f9338[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0x5590e2['query']['offset']);}_0x4f9338[_0x3d1d('0x36')]=qs['sort'](_0x5590e2[_0x3d1d('0x2d')][_0x3d1d('0x37')]);_0x4f9338[_0x3d1d('0x38')]=qs[_0x3d1d('0x2f')](_['pick'](_0x5590e2[_0x3d1d('0x2d')],_0x20c76f[_0x3d1d('0x2f')]),_0x2fce65);if(_0x5590e2['query'][_0x3d1d('0x39')]){_0x4f9338[_0x3d1d('0x38')]=_[_0x3d1d('0x3a')](_0x4f9338[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x2fce65,function(_0x427fcd){if(_0x427fcd[_0x3d1d('0x3b')]!==_0x3d1d('0x3c')){var _0x3c92b9={};_0x3c92b9[_0x427fcd['name']]={'$like':'%'+_0x5590e2['query'][_0x3d1d('0x39')]+'%'};return _0x3c92b9;}})});}_0x4f9338=_['merge']({},_0x4f9338,_0x5590e2[_0x3d1d('0x3d')]);var _0x21b7b6={'where':_0x4f9338['where']};return db[_0x3d1d('0x2a')][_0x3d1d('0x1d')](_0x21b7b6)['then'](function(_0x503ea4){_0x3d2784[_0x3d1d('0x1d')]=_0x503ea4;if(_0x5590e2[_0x3d1d('0x2d')]['includeAll']){_0x4f9338['include']=[{'all':!![]}];}return db[_0x3d1d('0x2a')][_0x3d1d('0x3e')](_0x4f9338);})[_0x3d1d('0x23')](function(_0x32098d){_0x3d2784[_0x3d1d('0x3f')]=_0x32098d;return _0x3d2784;})[_0x3d1d('0x23')](respondWithFilteredResult(_0x73ad51,_0x4f9338))[_0x3d1d('0x40')](handleError(_0x73ad51,null));};exports[_0x3d1d('0x41')]=function(_0x1ac1b2,_0x31d865){var _0x35bc68={'raw':![],'where':{'id':_0x1ac1b2[_0x3d1d('0x42')]['id']}},_0x2ab93f={};_0x2ab93f[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x2a')][_0x3d1d('0x43')]);_0x2ab93f[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x1ac1b2[_0x3d1d('0x2d')]);_0x2ab93f[_0x3d1d('0x2f')]=_['intersection'](_0x2ab93f['model'],_0x2ab93f[_0x3d1d('0x2d')]);_0x35bc68[_0x3d1d('0x32')]=_['intersection'](_0x2ab93f[_0x3d1d('0x2c')],qs[_0x3d1d('0x31')](_0x1ac1b2[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x35bc68[_0x3d1d('0x32')]=_0x35bc68[_0x3d1d('0x32')][_0x3d1d('0x33')]?_0x35bc68[_0x3d1d('0x32')]:_0x2ab93f[_0x3d1d('0x2c')];if(_0x1ac1b2[_0x3d1d('0x2d')][_0x3d1d('0x44')]){_0x35bc68[_0x3d1d('0x45')]=[{'all':!![]}];}_0x35bc68=_[_0x3d1d('0x3a')]({},_0x35bc68,_0x1ac1b2[_0x3d1d('0x3d')]);return db[_0x3d1d('0x2a')]['find'](_0x35bc68)[_0x3d1d('0x23')](handleEntityNotFound(_0x31d865,null))['then'](respondWithResult(_0x31d865,null))[_0x3d1d('0x40')](handleError(_0x31d865,null));};exports[_0x3d1d('0x46')]=function(_0x1378a8,_0x196d1d){return db['DeskConfiguration'][_0x3d1d('0x46')](_0x1378a8[_0x3d1d('0x47')],{})[_0x3d1d('0x23')](respondWithResult(_0x196d1d,0xc9))[_0x3d1d('0x40')](handleError(_0x196d1d,null));};exports[_0x3d1d('0x48')]=function(_0x374c7a,_0x3ddc90){if(_0x374c7a[_0x3d1d('0x47')]['id']){delete _0x374c7a[_0x3d1d('0x47')]['id'];}return db[_0x3d1d('0x2a')][_0x3d1d('0x49')]({'where':{'id':_0x374c7a[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x3ddc90,null))[_0x3d1d('0x23')](saveUpdates(_0x374c7a[_0x3d1d('0x47')],null))[_0x3d1d('0x23')](respondWithResult(_0x3ddc90,null))[_0x3d1d('0x40')](handleError(_0x3ddc90,null));};exports['destroy']=function(_0x2f557c,_0xc3ae1b){return db[_0x3d1d('0x2a')][_0x3d1d('0x49')]({'where':{'id':_0x2f557c[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0xc3ae1b,null))['then'](removeEntity(_0xc3ae1b,null))[_0x3d1d('0x40')](handleError(_0xc3ae1b,null));};exports[_0x3d1d('0x4a')]=function(_0x35fbe8,_0x4123b7,_0x405cc0){var _0x263cee={};var _0x15ea22={};var _0x35770e;var _0x169567;return db['DeskConfiguration'][_0x3d1d('0x4b')]({'where':{'id':_0x35fbe8[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x4123b7,null))[_0x3d1d('0x23')](function(_0x5c1820){if(_0x5c1820){_0x35770e=_0x5c1820;_0x15ea22[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db['DeskField'][_0x3d1d('0x43')]);_0x15ea22[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0x35fbe8[_0x3d1d('0x2d')]);_0x15ea22[_0x3d1d('0x2f')]=_[_0x3d1d('0x30')](_0x15ea22[_0x3d1d('0x2c')],_0x15ea22[_0x3d1d('0x2d')]);_0x263cee['attributes']=_[_0x3d1d('0x30')](_0x15ea22[_0x3d1d('0x2c')],qs[_0x3d1d('0x31')](_0x35fbe8[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x263cee[_0x3d1d('0x32')]=_0x263cee['attributes'][_0x3d1d('0x33')]?_0x263cee['attributes']:_0x15ea22[_0x3d1d('0x2c')];_0x263cee[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_0x35fbe8[_0x3d1d('0x2d')][_0x3d1d('0x37')]);_0x263cee[_0x3d1d('0x38')]=qs[_0x3d1d('0x2f')](_[_0x3d1d('0x4c')](_0x35fbe8[_0x3d1d('0x2d')],_0x15ea22['filters']));if(_0x35fbe8['query'][_0x3d1d('0x39')]){_0x263cee[_0x3d1d('0x38')]=_[_0x3d1d('0x3a')](_0x263cee[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x263cee['attributes'],function(_0x58e7bc){var _0x14bafe={};_0x14bafe[_0x58e7bc]={'$like':'%'+_0x35fbe8[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x14bafe;})});}_0x263cee=_['merge']({},_0x263cee,_0x35fbe8[_0x3d1d('0x3d')]);return _0x35770e['getFields'](_0x263cee);}})[_0x3d1d('0x23')](function(_0x35dada){if(_0x35dada){_0x169567=_0x35dada[_0x3d1d('0x33')];if(!_0x35fbe8['query'][_0x3d1d('0x34')]('nolimit')){_0x263cee['limit']=qs['limit'](_0x35fbe8[_0x3d1d('0x2d')]['limit']);_0x263cee[_0x3d1d('0x1a')]=qs['offset'](_0x35fbe8[_0x3d1d('0x2d')]['offset']);}return _0x35770e['getFields'](_0x263cee);}})[_0x3d1d('0x23')](function(_0x3d4a20){if(_0x3d4a20){return _0x3d4a20?{'count':_0x169567,'rows':_0x3d4a20}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x4123b7,null))[_0x3d1d('0x40')](handleError(_0x4123b7,null));};exports[_0x3d1d('0x4d')]=function(_0x3aea91,_0x4e726d,_0x222690){var _0x4726d8={};var _0x185a73={};var _0x5609c1;var _0x53f256;return db['DeskConfiguration']['findOne']({'where':{'id':_0x3aea91[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x4e726d,null))[_0x3d1d('0x23')](function(_0x5e131d){if(_0x5e131d){_0x5609c1=_0x5e131d;_0x185a73[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x4e')][_0x3d1d('0x43')]);_0x185a73['query']=_['keys'](_0x3aea91[_0x3d1d('0x2d')]);_0x185a73['filters']=_[_0x3d1d('0x30')](_0x185a73[_0x3d1d('0x2c')],_0x185a73['query']);_0x4726d8['attributes']=_[_0x3d1d('0x30')](_0x185a73[_0x3d1d('0x2c')],qs[_0x3d1d('0x31')](_0x3aea91['query'][_0x3d1d('0x31')]));_0x4726d8[_0x3d1d('0x32')]=_0x4726d8['attributes'][_0x3d1d('0x33')]?_0x4726d8[_0x3d1d('0x32')]:_0x185a73[_0x3d1d('0x2c')];_0x4726d8['order']=qs[_0x3d1d('0x37')](_0x3aea91[_0x3d1d('0x2d')]['sort']);_0x4726d8[_0x3d1d('0x38')]=qs[_0x3d1d('0x2f')](_[_0x3d1d('0x4c')](_0x3aea91[_0x3d1d('0x2d')],_0x185a73[_0x3d1d('0x2f')]));if(_0x3aea91[_0x3d1d('0x2d')]['filter']){_0x4726d8[_0x3d1d('0x38')]=_[_0x3d1d('0x3a')](_0x4726d8['where'],{'$or':_[_0x3d1d('0x29')](_0x4726d8[_0x3d1d('0x32')],function(_0x15311b){var _0x597213={};_0x597213[_0x15311b]={'$like':'%'+_0x3aea91['query'][_0x3d1d('0x39')]+'%'};return _0x597213;})});}_0x4726d8=_[_0x3d1d('0x3a')]({},_0x4726d8,_0x3aea91[_0x3d1d('0x3d')]);return _0x5609c1['getSubjects'](_0x4726d8);}})[_0x3d1d('0x23')](function(_0x1f7ed3){if(_0x1f7ed3){_0x53f256=_0x1f7ed3['length'];if(!_0x3aea91[_0x3d1d('0x2d')][_0x3d1d('0x34')](_0x3d1d('0x35'))){_0x4726d8['limit']=qs['limit'](_0x3aea91['query'][_0x3d1d('0x1b')]);_0x4726d8[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0x3aea91[_0x3d1d('0x2d')][_0x3d1d('0x1a')]);}return _0x5609c1[_0x3d1d('0x4d')](_0x4726d8);}})['then'](function(_0x218c6b){if(_0x218c6b){return _0x218c6b?{'count':_0x53f256,'rows':_0x218c6b}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x4e726d,null))[_0x3d1d('0x40')](handleError(_0x4e726d,null));};exports[_0x3d1d('0x4f')]=function(_0xc7219a,_0x2cbbc0,_0x155b20){var _0x3461cc={};var _0x279e07={};var _0x1c584f;var _0x399063;return db[_0x3d1d('0x2a')][_0x3d1d('0x4b')]({'where':{'id':_0xc7219a[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cbbc0,null))['then'](function(_0x4e7b45){if(_0x4e7b45){_0x1c584f=_0x4e7b45;_0x279e07['model']=_[_0x3d1d('0x2e')](db[_0x3d1d('0x4e')][_0x3d1d('0x43')]);_0x279e07[_0x3d1d('0x2d')]=_[_0x3d1d('0x2e')](_0xc7219a[_0x3d1d('0x2d')]);_0x279e07['filters']=_[_0x3d1d('0x30')](_0x279e07[_0x3d1d('0x2c')],_0x279e07['query']);_0x3461cc[_0x3d1d('0x32')]=_[_0x3d1d('0x30')](_0x279e07['model'],qs['fields'](_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x31')]));_0x3461cc[_0x3d1d('0x32')]=_0x3461cc[_0x3d1d('0x32')]['length']?_0x3461cc[_0x3d1d('0x32')]:_0x279e07[_0x3d1d('0x2c')];_0x3461cc[_0x3d1d('0x36')]=qs[_0x3d1d('0x37')](_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x37')]);_0x3461cc[_0x3d1d('0x38')]=qs['filters'](_[_0x3d1d('0x4c')](_0xc7219a[_0x3d1d('0x2d')],_0x279e07[_0x3d1d('0x2f')]));if(_0xc7219a['query'][_0x3d1d('0x39')]){_0x3461cc['where']=_[_0x3d1d('0x3a')](_0x3461cc[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x3461cc[_0x3d1d('0x32')],function(_0x5aae47){var _0x2b96d1={};_0x2b96d1[_0x5aae47]={'$like':'%'+_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x2b96d1;})});}_0x3461cc=_[_0x3d1d('0x3a')]({},_0x3461cc,_0xc7219a[_0x3d1d('0x3d')]);return _0x1c584f[_0x3d1d('0x4f')](_0x3461cc);}})[_0x3d1d('0x23')](function(_0x29fa52){if(_0x29fa52){_0x399063=_0x29fa52[_0x3d1d('0x33')];if(!_0xc7219a[_0x3d1d('0x2d')]['hasOwnProperty']('nolimit')){_0x3461cc[_0x3d1d('0x1b')]=qs[_0x3d1d('0x1b')](_0xc7219a[_0x3d1d('0x2d')][_0x3d1d('0x1b')]);_0x3461cc[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0xc7219a[_0x3d1d('0x2d')]['offset']);}return _0x1c584f[_0x3d1d('0x4f')](_0x3461cc);}})[_0x3d1d('0x23')](function(_0x422fe9){if(_0x422fe9){return _0x422fe9?{'count':_0x399063,'rows':_0x422fe9}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x2cbbc0,null))[_0x3d1d('0x40')](handleError(_0x2cbbc0,null));};exports[_0x3d1d('0x50')]=function(_0x1a1b8f,_0x11a329,_0x367844){var _0x27f890={};var _0x52db7c={};var _0x30d3b4;var _0x2f6144;return db[_0x3d1d('0x2a')][_0x3d1d('0x4b')]({'where':{'id':_0x1a1b8f[_0x3d1d('0x42')]['id']}})[_0x3d1d('0x23')](handleEntityNotFound(_0x11a329,null))[_0x3d1d('0x23')](function(_0xde2c3d){if(_0xde2c3d){_0x30d3b4=_0xde2c3d;_0x52db7c[_0x3d1d('0x2c')]=_[_0x3d1d('0x2e')](db[_0x3d1d('0x51')][_0x3d1d('0x43')]);_0x52db7c['query']=_['keys'](_0x1a1b8f[_0x3d1d('0x2d')]);_0x52db7c['filters']=_[_0x3d1d('0x30')](_0x52db7c[_0x3d1d('0x2c')],_0x52db7c[_0x3d1d('0x2d')]);_0x27f890[_0x3d1d('0x32')]=_[_0x3d1d('0x30')](_0x52db7c[_0x3d1d('0x2c')],qs['fields'](_0x1a1b8f['query']['fields']));_0x27f890[_0x3d1d('0x32')]=_0x27f890[_0x3d1d('0x32')][_0x3d1d('0x33')]?_0x27f890[_0x3d1d('0x32')]:_0x52db7c['model'];_0x27f890['order']=qs[_0x3d1d('0x37')](_0x1a1b8f[_0x3d1d('0x2d')]['sort']);_0x27f890['where']=qs[_0x3d1d('0x2f')](_[_0x3d1d('0x4c')](_0x1a1b8f['query'],_0x52db7c[_0x3d1d('0x2f')]));if(_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x39')]){_0x27f890['where']=_['merge'](_0x27f890[_0x3d1d('0x38')],{'$or':_[_0x3d1d('0x29')](_0x27f890['attributes'],function(_0x2f0ebc){var _0x5bda97={};_0x5bda97[_0x2f0ebc]={'$like':'%'+_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x39')]+'%'};return _0x5bda97;})});}_0x27f890=_[_0x3d1d('0x3a')]({},_0x27f890,_0x1a1b8f[_0x3d1d('0x3d')]);return _0x30d3b4['getTags'](_0x27f890);}})[_0x3d1d('0x23')](function(_0x5bf965){if(_0x5bf965){_0x2f6144=_0x5bf965[_0x3d1d('0x33')];if(!_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x34')](_0x3d1d('0x35'))){_0x27f890[_0x3d1d('0x1b')]=qs['limit'](_0x1a1b8f[_0x3d1d('0x2d')][_0x3d1d('0x1b')]);_0x27f890[_0x3d1d('0x1a')]=qs[_0x3d1d('0x1a')](_0x1a1b8f[_0x3d1d('0x2d')]['offset']);}return _0x30d3b4[_0x3d1d('0x50')](_0x27f890);}})[_0x3d1d('0x23')](function(_0x402d54){if(_0x402d54){return _0x402d54?{'count':_0x2f6144,'rows':_0x402d54}:null;}})[_0x3d1d('0x23')](respondWithResult(_0x11a329,null))[_0x3d1d('0x40')](handleError(_0x11a329,null));};exports[_0x3d1d('0x52')]=function(_0x4f1866,_0x3c82ca,_0x1533d3){if(_0x4f1866[_0x3d1d('0x47')]['id']){delete _0x4f1866[_0x3d1d('0x47')]['id'];}return db[_0x3d1d('0x2a')]['findOne']({'where':{'id':_0x4f1866[_0x3d1d('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c82ca,null))['then'](function(_0x31e644){if(_0x31e644){return _0x31e644[_0x3d1d('0x52')](_0x4f1866['body'][_0x3d1d('0x53')]||[]);}return null;})['then'](respondWithResult(_0x3c82ca,null))['catch'](handleError(_0x3c82ca,null));};
\ No newline at end of file
+var _0x90dc=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','status','set','Content-Range','reject','update','then','destroy','end','error','name','map','DeskConfiguration','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','getFields','findOne','DeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids'];(function(_0x381d3c,_0x4bc7d0){var _0x12542e=function(_0xc3e0c7){while(--_0xc3e0c7){_0x381d3c['push'](_0x381d3c['shift']());}};_0x12542e(++_0x4bc7d0);}(_0x90dc,0x150));var _0xc90d=function(_0x59a22e,_0x304d0e){_0x59a22e=_0x59a22e-0x0;var _0x49b1cf=_0x90dc[_0x59a22e];return _0x49b1cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc90d('0x0'));var zipdir=require(_0xc90d('0x1'));var jsonpatch=require(_0xc90d('0x2'));var rp=require(_0xc90d('0x3'));var moment=require('moment');var BPromise=require(_0xc90d('0x4'));var Mustache=require(_0xc90d('0x5'));var util=require(_0xc90d('0x6'));var path=require(_0xc90d('0x7'));var sox=require(_0xc90d('0x8'));var csv=require(_0xc90d('0x9'));var ejs=require(_0xc90d('0xa'));var fs=require('fs');var fs_extra=require(_0xc90d('0xb'));var _=require(_0xc90d('0xc'));var squel=require(_0xc90d('0xd'));var crypto=require(_0xc90d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc90d('0xf'));var toCsv=require(_0xc90d('0x9'));var querystring=require(_0xc90d('0x10'));var Papa=require(_0xc90d('0x11'));var Redis=require(_0xc90d('0x12'));var authService=require(_0xc90d('0x13'));var qs=require(_0xc90d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc90d('0x15'));var logger=require(_0xc90d('0x16'))(_0xc90d('0x17'));var utils=require(_0xc90d('0x18'));var config=require(_0xc90d('0x19'));var licenseUtil=require(_0xc90d('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ed287,_0x552599){_0x552599=_0x552599||0xcc;return function(_0x41705e){if(_0x41705e){return _0x2ed287[_0xc90d('0x1b')](_0x552599);}return _0x2ed287['status'](_0x552599)['end']();};}function respondWithResult(_0x564667,_0x39a8a2){_0x39a8a2=_0x39a8a2||0xc8;return function(_0x298a36){if(_0x298a36){return _0x564667['status'](_0x39a8a2)[_0xc90d('0x1c')](_0x298a36);}};}function respondWithFilteredResult(_0x2fbe51,_0x51e647){return function(_0x516835){if(_0x516835){var _0x1c976c=typeof _0x51e647[_0xc90d('0x1d')]===_0xc90d('0x1e')&&typeof _0x51e647[_0xc90d('0x1f')]===_0xc90d('0x1e');var _0x4e4b68=_0x516835['count'];var _0x2c173f=_0x1c976c?0x0:_0x51e647[_0xc90d('0x1d')];var _0x1f9ca9=_0x1c976c?_0x516835['count']:_0x51e647[_0xc90d('0x1d')]+_0x51e647[_0xc90d('0x1f')];var _0x28afaf;if(_0x1f9ca9>=_0x4e4b68){_0x1f9ca9=_0x4e4b68;_0x28afaf=0xc8;}else{_0x28afaf=0xce;}_0x2fbe51[_0xc90d('0x20')](_0x28afaf);return _0x2fbe51[_0xc90d('0x21')](_0xc90d('0x22'),_0x2c173f+'-'+_0x1f9ca9+'/'+_0x4e4b68)[_0xc90d('0x1c')](_0x516835);}return null;};}function patchUpdates(_0x3abf0f){return function(_0x16281c){try{jsonpatch['apply'](_0x16281c,_0x3abf0f,!![]);}catch(_0x370138){return BPromise[_0xc90d('0x23')](_0x370138);}return _0x16281c['save']();};}function saveUpdates(_0x23666c,_0xd1d679){return function(_0x1c3bfd){if(_0x1c3bfd){return _0x1c3bfd[_0xc90d('0x24')](_0x23666c)[_0xc90d('0x25')](function(_0x23083e){return _0x23083e;});}return null;};}function removeEntity(_0x1ff42b,_0x5c1f2f){return function(_0x5eb1b7){if(_0x5eb1b7){return _0x5eb1b7[_0xc90d('0x26')]()[_0xc90d('0x25')](function(){_0x1ff42b[_0xc90d('0x20')](0xcc)[_0xc90d('0x27')]();});}};}function handleEntityNotFound(_0xb8c32b,_0x11e793){return function(_0x393078){if(!_0x393078){_0xb8c32b[_0xc90d('0x1b')](0x194);}return _0x393078;};}function handleError(_0xde8c5e,_0x5ef4d2){_0x5ef4d2=_0x5ef4d2||0x1f4;return function(_0x379e74){logger[_0xc90d('0x28')](_0x379e74['stack']);if(_0x379e74['name']){delete _0x379e74[_0xc90d('0x29')];}_0xde8c5e['status'](_0x5ef4d2)['send'](_0x379e74);};}exports['index']=function(_0x48e0fa,_0x350d85){var _0x16ac5a={},_0x219be2={},_0x280313={'count':0x0,'rows':[]};var _0x538644=_[_0xc90d('0x2a')](db[_0xc90d('0x2b')][_0xc90d('0x2c')],function(_0x322b73){return{'name':_0x322b73['fieldName'],'type':_0x322b73[_0xc90d('0x2d')][_0xc90d('0x2e')]};});_0x219be2[_0xc90d('0x2f')]=_[_0xc90d('0x2a')](_0x538644,_0xc90d('0x29'));_0x219be2[_0xc90d('0x30')]=_['keys'](_0x48e0fa[_0xc90d('0x30')]);_0x219be2[_0xc90d('0x31')]=_['intersection'](_0x219be2[_0xc90d('0x2f')],_0x219be2[_0xc90d('0x30')]);_0x16ac5a[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x219be2['model'],qs[_0xc90d('0x34')](_0x48e0fa[_0xc90d('0x30')]['fields']));_0x16ac5a[_0xc90d('0x32')]=_0x16ac5a[_0xc90d('0x32')]['length']?_0x16ac5a[_0xc90d('0x32')]:_0x219be2[_0xc90d('0x2f')];if(!_0x48e0fa['query']['hasOwnProperty'](_0xc90d('0x35'))){_0x16ac5a[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x16ac5a['offset']=qs[_0xc90d('0x1d')](_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x1d')]);}_0x16ac5a[_0xc90d('0x36')]=qs[_0xc90d('0x37')](_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x37')]);_0x16ac5a[_0xc90d('0x38')]=qs[_0xc90d('0x31')](_['pick'](_0x48e0fa[_0xc90d('0x30')],_0x219be2[_0xc90d('0x31')]),_0x538644);if(_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x39')]){_0x16ac5a[_0xc90d('0x38')]=_['merge'](_0x16ac5a[_0xc90d('0x38')],{'$or':_[_0xc90d('0x2a')](_0x538644,function(_0x162c41){if(_0x162c41[_0xc90d('0x2d')]!==_0xc90d('0x3a')){var _0x5672a7={};_0x5672a7[_0x162c41['name']]={'$like':'%'+_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x5672a7;}})});}_0x16ac5a=_[_0xc90d('0x3b')]({},_0x16ac5a,_0x48e0fa[_0xc90d('0x3c')]);var _0x5f58d7={'where':_0x16ac5a[_0xc90d('0x38')]};return db[_0xc90d('0x2b')]['count'](_0x5f58d7)[_0xc90d('0x25')](function(_0x22a7d3){_0x280313['count']=_0x22a7d3;if(_0x48e0fa[_0xc90d('0x30')][_0xc90d('0x3d')]){_0x16ac5a[_0xc90d('0x3e')]=[{'all':!![]}];}return db[_0xc90d('0x2b')][_0xc90d('0x3f')](_0x16ac5a);})['then'](function(_0xd6a0a5){_0x280313[_0xc90d('0x40')]=_0xd6a0a5;return _0x280313;})[_0xc90d('0x25')](respondWithFilteredResult(_0x350d85,_0x16ac5a))[_0xc90d('0x41')](handleError(_0x350d85,null));};exports[_0xc90d('0x42')]=function(_0xb11488,_0x3dd32d){var _0x47593c={'raw':![],'where':{'id':_0xb11488[_0xc90d('0x43')]['id']}},_0x19e911={};_0x19e911[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x2b')][_0xc90d('0x2c')]);_0x19e911[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0xb11488[_0xc90d('0x30')]);_0x19e911[_0xc90d('0x31')]=_['intersection'](_0x19e911[_0xc90d('0x2f')],_0x19e911[_0xc90d('0x30')]);_0x47593c['attributes']=_['intersection'](_0x19e911[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0xb11488[_0xc90d('0x30')][_0xc90d('0x34')]));_0x47593c[_0xc90d('0x32')]=_0x47593c[_0xc90d('0x32')][_0xc90d('0x45')]?_0x47593c[_0xc90d('0x32')]:_0x19e911[_0xc90d('0x2f')];if(_0xb11488[_0xc90d('0x30')][_0xc90d('0x3d')]){_0x47593c[_0xc90d('0x3e')]=[{'all':!![]}];}_0x47593c=_[_0xc90d('0x3b')]({},_0x47593c,_0xb11488[_0xc90d('0x3c')]);return db[_0xc90d('0x2b')][_0xc90d('0x46')](_0x47593c)[_0xc90d('0x25')](handleEntityNotFound(_0x3dd32d,null))[_0xc90d('0x25')](respondWithResult(_0x3dd32d,null))['catch'](handleError(_0x3dd32d,null));};exports[_0xc90d('0x47')]=function(_0x414d53,_0x38c1bd){return db[_0xc90d('0x2b')][_0xc90d('0x47')](_0x414d53[_0xc90d('0x48')],{})[_0xc90d('0x25')](respondWithResult(_0x38c1bd,0xc9))[_0xc90d('0x41')](handleError(_0x38c1bd,null));};exports[_0xc90d('0x24')]=function(_0x2136ff,_0x5e13de){if(_0x2136ff[_0xc90d('0x48')]['id']){delete _0x2136ff[_0xc90d('0x48')]['id'];}return db[_0xc90d('0x2b')]['find']({'where':{'id':_0x2136ff['params']['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x5e13de,null))['then'](saveUpdates(_0x2136ff[_0xc90d('0x48')],null))['then'](respondWithResult(_0x5e13de,null))[_0xc90d('0x41')](handleError(_0x5e13de,null));};exports[_0xc90d('0x26')]=function(_0x2031d8,_0x6072f2){return db[_0xc90d('0x2b')][_0xc90d('0x46')]({'where':{'id':_0x2031d8[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x6072f2,null))['then'](removeEntity(_0x6072f2,null))[_0xc90d('0x41')](handleError(_0x6072f2,null));};exports[_0xc90d('0x49')]=function(_0x1c5d87,_0x270e59,_0x5a20a4){var _0x1a7e0b={};var _0x43d1b8={};var _0x31f9e8;var _0x2a5931;return db[_0xc90d('0x2b')][_0xc90d('0x4a')]({'where':{'id':_0x1c5d87['params']['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x270e59,null))['then'](function(_0x241a63){if(_0x241a63){_0x31f9e8=_0x241a63;_0x43d1b8[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x4b')][_0xc90d('0x2c')]);_0x43d1b8['query']=_[_0xc90d('0x44')](_0x1c5d87['query']);_0x43d1b8[_0xc90d('0x31')]=_['intersection'](_0x43d1b8['model'],_0x43d1b8[_0xc90d('0x30')]);_0x1a7e0b[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x43d1b8[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x34')]));_0x1a7e0b[_0xc90d('0x32')]=_0x1a7e0b[_0xc90d('0x32')][_0xc90d('0x45')]?_0x1a7e0b[_0xc90d('0x32')]:_0x43d1b8[_0xc90d('0x2f')];_0x1a7e0b[_0xc90d('0x36')]=qs[_0xc90d('0x37')](_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x37')]);_0x1a7e0b[_0xc90d('0x38')]=qs['filters'](_[_0xc90d('0x4c')](_0x1c5d87[_0xc90d('0x30')],_0x43d1b8[_0xc90d('0x31')]));if(_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x39')]){_0x1a7e0b[_0xc90d('0x38')]=_[_0xc90d('0x3b')](_0x1a7e0b['where'],{'$or':_[_0xc90d('0x2a')](_0x1a7e0b['attributes'],function(_0x50a8f9){var _0x31f9c9={};_0x31f9c9[_0x50a8f9]={'$like':'%'+_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x31f9c9;})});}_0x1a7e0b=_['merge']({},_0x1a7e0b,_0x1c5d87[_0xc90d('0x3c')]);return _0x31f9e8[_0xc90d('0x49')](_0x1a7e0b);}})[_0xc90d('0x25')](function(_0xe52d43){if(_0xe52d43){_0x2a5931=_0xe52d43[_0xc90d('0x45')];if(!_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x4d')]('nolimit')){_0x1a7e0b[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x1c5d87[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x1a7e0b[_0xc90d('0x1d')]=qs['offset'](_0x1c5d87['query'][_0xc90d('0x1d')]);}return _0x31f9e8[_0xc90d('0x49')](_0x1a7e0b);}})['then'](function(_0x51e136){if(_0x51e136){return _0x51e136?{'count':_0x2a5931,'rows':_0x51e136}:null;}})[_0xc90d('0x25')](respondWithResult(_0x270e59,null))[_0xc90d('0x41')](handleError(_0x270e59,null));};exports[_0xc90d('0x4e')]=function(_0xf543c2,_0x1aca7f,_0x184b9e){var _0x3c02b7={};var _0x1c5b99={};var _0x755fa1;var _0xd89faa;return db[_0xc90d('0x2b')][_0xc90d('0x4a')]({'where':{'id':_0xf543c2[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x1aca7f,null))[_0xc90d('0x25')](function(_0x425548){if(_0x425548){_0x755fa1=_0x425548;_0x1c5b99[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x4b')]['rawAttributes']);_0x1c5b99[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0xf543c2['query']);_0x1c5b99['filters']=_[_0xc90d('0x33')](_0x1c5b99['model'],_0x1c5b99[_0xc90d('0x30')]);_0x3c02b7['attributes']=_['intersection'](_0x1c5b99[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0xf543c2['query'][_0xc90d('0x34')]));_0x3c02b7[_0xc90d('0x32')]=_0x3c02b7[_0xc90d('0x32')][_0xc90d('0x45')]?_0x3c02b7[_0xc90d('0x32')]:_0x1c5b99['model'];_0x3c02b7['order']=qs['sort'](_0xf543c2[_0xc90d('0x30')][_0xc90d('0x37')]);_0x3c02b7[_0xc90d('0x38')]=qs['filters'](_[_0xc90d('0x4c')](_0xf543c2[_0xc90d('0x30')],_0x1c5b99['filters']));if(_0xf543c2[_0xc90d('0x30')][_0xc90d('0x39')]){_0x3c02b7['where']=_[_0xc90d('0x3b')](_0x3c02b7['where'],{'$or':_[_0xc90d('0x2a')](_0x3c02b7['attributes'],function(_0x7e6bdd){var _0x339bba={};_0x339bba[_0x7e6bdd]={'$like':'%'+_0xf543c2[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x339bba;})});}_0x3c02b7=_[_0xc90d('0x3b')]({},_0x3c02b7,_0xf543c2['options']);return _0x755fa1[_0xc90d('0x4e')](_0x3c02b7);}})['then'](function(_0x197b9c){if(_0x197b9c){_0xd89faa=_0x197b9c[_0xc90d('0x45')];if(!_0xf543c2[_0xc90d('0x30')][_0xc90d('0x4d')](_0xc90d('0x35'))){_0x3c02b7[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0xf543c2[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x3c02b7[_0xc90d('0x1d')]=qs[_0xc90d('0x1d')](_0xf543c2[_0xc90d('0x30')][_0xc90d('0x1d')]);}return _0x755fa1['getSubjects'](_0x3c02b7);}})[_0xc90d('0x25')](function(_0x402387){if(_0x402387){return _0x402387?{'count':_0xd89faa,'rows':_0x402387}:null;}})[_0xc90d('0x25')](respondWithResult(_0x1aca7f,null))[_0xc90d('0x41')](handleError(_0x1aca7f,null));};exports[_0xc90d('0x4f')]=function(_0x1ac1fa,_0x154876,_0x2f3a33){var _0x2e3809={};var _0x4c5e02={};var _0x536ec8;var _0x551220;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1ac1fa[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x154876,null))[_0xc90d('0x25')](function(_0x500bd0){if(_0x500bd0){_0x536ec8=_0x500bd0;_0x4c5e02['model']=_[_0xc90d('0x44')](db[_0xc90d('0x4b')][_0xc90d('0x2c')]);_0x4c5e02[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0x1ac1fa['query']);_0x4c5e02['filters']=_[_0xc90d('0x33')](_0x4c5e02[_0xc90d('0x2f')],_0x4c5e02[_0xc90d('0x30')]);_0x2e3809[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x4c5e02[_0xc90d('0x2f')],qs[_0xc90d('0x34')](_0x1ac1fa[_0xc90d('0x30')][_0xc90d('0x34')]));_0x2e3809[_0xc90d('0x32')]=_0x2e3809['attributes'][_0xc90d('0x45')]?_0x2e3809[_0xc90d('0x32')]:_0x4c5e02[_0xc90d('0x2f')];_0x2e3809[_0xc90d('0x36')]=qs[_0xc90d('0x37')](_0x1ac1fa['query'][_0xc90d('0x37')]);_0x2e3809[_0xc90d('0x38')]=qs[_0xc90d('0x31')](_[_0xc90d('0x4c')](_0x1ac1fa[_0xc90d('0x30')],_0x4c5e02[_0xc90d('0x31')]));if(_0x1ac1fa['query'][_0xc90d('0x39')]){_0x2e3809[_0xc90d('0x38')]=_['merge'](_0x2e3809['where'],{'$or':_[_0xc90d('0x2a')](_0x2e3809[_0xc90d('0x32')],function(_0x18c30e){var _0x14dd02={};_0x14dd02[_0x18c30e]={'$like':'%'+_0x1ac1fa['query'][_0xc90d('0x39')]+'%'};return _0x14dd02;})});}_0x2e3809=_[_0xc90d('0x3b')]({},_0x2e3809,_0x1ac1fa[_0xc90d('0x3c')]);return _0x536ec8[_0xc90d('0x4f')](_0x2e3809);}})[_0xc90d('0x25')](function(_0x4de89b){if(_0x4de89b){_0x551220=_0x4de89b[_0xc90d('0x45')];if(!_0x1ac1fa['query'][_0xc90d('0x4d')](_0xc90d('0x35'))){_0x2e3809[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x1ac1fa[_0xc90d('0x30')][_0xc90d('0x1f')]);_0x2e3809[_0xc90d('0x1d')]=qs['offset'](_0x1ac1fa['query'][_0xc90d('0x1d')]);}return _0x536ec8['getDescriptions'](_0x2e3809);}})[_0xc90d('0x25')](function(_0x39a924){if(_0x39a924){return _0x39a924?{'count':_0x551220,'rows':_0x39a924}:null;}})[_0xc90d('0x25')](respondWithResult(_0x154876,null))[_0xc90d('0x41')](handleError(_0x154876,null));};exports[_0xc90d('0x50')]=function(_0x60fda,_0x218264,_0x500677){var _0x757da3={};var _0x7f1610={};var _0x56de42;var _0x2bb97c;return db[_0xc90d('0x2b')][_0xc90d('0x4a')]({'where':{'id':_0x60fda[_0xc90d('0x43')]['id']}})[_0xc90d('0x25')](handleEntityNotFound(_0x218264,null))[_0xc90d('0x25')](function(_0x4402df){if(_0x4402df){_0x56de42=_0x4402df;_0x7f1610[_0xc90d('0x2f')]=_[_0xc90d('0x44')](db[_0xc90d('0x51')][_0xc90d('0x2c')]);_0x7f1610[_0xc90d('0x30')]=_[_0xc90d('0x44')](_0x60fda[_0xc90d('0x30')]);_0x7f1610['filters']=_[_0xc90d('0x33')](_0x7f1610[_0xc90d('0x2f')],_0x7f1610[_0xc90d('0x30')]);_0x757da3[_0xc90d('0x32')]=_[_0xc90d('0x33')](_0x7f1610['model'],qs[_0xc90d('0x34')](_0x60fda[_0xc90d('0x30')][_0xc90d('0x34')]));_0x757da3['attributes']=_0x757da3[_0xc90d('0x32')][_0xc90d('0x45')]?_0x757da3['attributes']:_0x7f1610[_0xc90d('0x2f')];_0x757da3['order']=qs[_0xc90d('0x37')](_0x60fda[_0xc90d('0x30')][_0xc90d('0x37')]);_0x757da3[_0xc90d('0x38')]=qs[_0xc90d('0x31')](_[_0xc90d('0x4c')](_0x60fda[_0xc90d('0x30')],_0x7f1610[_0xc90d('0x31')]));if(_0x60fda[_0xc90d('0x30')][_0xc90d('0x39')]){_0x757da3[_0xc90d('0x38')]=_[_0xc90d('0x3b')](_0x757da3[_0xc90d('0x38')],{'$or':_['map'](_0x757da3[_0xc90d('0x32')],function(_0x41a9bd){var _0x1a032a={};_0x1a032a[_0x41a9bd]={'$like':'%'+_0x60fda[_0xc90d('0x30')][_0xc90d('0x39')]+'%'};return _0x1a032a;})});}_0x757da3=_[_0xc90d('0x3b')]({},_0x757da3,_0x60fda[_0xc90d('0x3c')]);return _0x56de42[_0xc90d('0x50')](_0x757da3);}})[_0xc90d('0x25')](function(_0xbc2e4f){if(_0xbc2e4f){_0x2bb97c=_0xbc2e4f['length'];if(!_0x60fda[_0xc90d('0x30')][_0xc90d('0x4d')](_0xc90d('0x35'))){_0x757da3[_0xc90d('0x1f')]=qs[_0xc90d('0x1f')](_0x60fda['query'][_0xc90d('0x1f')]);_0x757da3[_0xc90d('0x1d')]=qs[_0xc90d('0x1d')](_0x60fda[_0xc90d('0x30')][_0xc90d('0x1d')]);}return _0x56de42[_0xc90d('0x50')](_0x757da3);}})['then'](function(_0x12df7d){if(_0x12df7d){return _0x12df7d?{'count':_0x2bb97c,'rows':_0x12df7d}:null;}})[_0xc90d('0x25')](respondWithResult(_0x218264,null))[_0xc90d('0x41')](handleError(_0x218264,null));};exports[_0xc90d('0x52')]=function(_0x1978a6,_0x4d3503,_0x43b11d){if(_0x1978a6['body']['id']){delete _0x1978a6['body']['id'];}return db[_0xc90d('0x2b')]['findOne']({'where':{'id':_0x1978a6['params']['id']}})['then'](handleEntityNotFound(_0x4d3503,null))[_0xc90d('0x25')](function(_0x18c094){if(_0x18c094){return _0x18c094['setTags'](_0x1978a6[_0xc90d('0x48')][_0xc90d('0x53')]||[]);}return null;})[_0xc90d('0x25')](respondWithResult(_0x4d3503,null))['catch'](handleError(_0x4d3503,null));};
\ No newline at end of file
index 78cd1ae..2b3eff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7df=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','DeskConfiguration'];(function(_0x596571,_0x41bc10){var _0x2fd369=function(_0x19cf30){while(--_0x19cf30){_0x596571['push'](_0x596571['shift']());}};_0x2fd369(++_0x41bc10);}(_0xd7df,0xe8));var _0xfd7d=function(_0x19845c,_0x67ffaa){_0x19845c=_0x19845c-0x0;var _0x460971=_0xd7df[_0x19845c];return _0x460971;};'use strict';var _=require(_0xfd7d('0x0'));var util=require(_0xfd7d('0x1'));var logger=require(_0xfd7d('0x2'))(_0xfd7d('0x3'));var moment=require(_0xfd7d('0x4'));var BPromise=require(_0xfd7d('0x5'));var rp=require(_0xfd7d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfd7d('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0xfd7d('0x8')]=function(_0x409b3f,_0x286688){return _0x409b3f['define'](_0xfd7d('0x9'),attributes,{'tableName':_0xfd7d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe422=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','DeskConfiguration','lodash','util'];(function(_0x39e914,_0xb02b2a){var _0x4c66b1=function(_0x3f16c9){while(--_0x3f16c9){_0x39e914['push'](_0x39e914['shift']());}};_0x4c66b1(++_0xb02b2a);}(_0xe422,0x1ab));var _0x2e42=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xe422[_0x2f45ea];return _0x485a84;};'use strict';var _=require(_0x2e42('0x0'));var util=require(_0x2e42('0x1'));var logger=require(_0x2e42('0x2'))(_0x2e42('0x3'));var moment=require(_0x2e42('0x4'));var BPromise=require(_0x2e42('0x5'));var rp=require(_0x2e42('0x6'));var fs=require('fs');var path=require(_0x2e42('0x7'));var rimraf=require(_0x2e42('0x8'));var config=require(_0x2e42('0x9'));var attributes=require('./intDeskConfiguration.attributes');module[_0x2e42('0xa')]=function(_0x33f09d,_0x1dbb68){return _0x33f09d[_0x2e42('0xb')](_0x2e42('0xc'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 25361b1..6006912 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcbb=['code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x6f49fd,_0x451553){var _0x2afd78=function(_0x5821a7){while(--_0x5821a7){_0x6f49fd['push'](_0x6f49fd['shift']());}};_0x2afd78(++_0x451553);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x22d6c9,_0x3ea6a0){_0x22d6c9=_0x22d6c9-0x0;var _0x32d857=_0xfcbb[_0x22d6c9];return _0x32d857;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}
\ No newline at end of file
+var _0x19cb=['message','result','catch','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x36bb8c,_0x2d9109){var _0x506570=function(_0x24848f){while(--_0x24848f){_0x36bb8c['push'](_0x36bb8c['shift']());}};_0x506570(++_0x2d9109);}(_0x19cb,0x146));var _0xb19c=function(_0x43e878,_0x4e5fda){_0x43e878=_0x43e878-0x0;var _0x2b45d3=_0x19cb[_0x43e878];return _0x2b45d3;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var moment=require(_0xb19c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb19c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb19c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb19c('0x4'));var jayson=require(_0xb19c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6a30,_0x477ac1,_0x35c200){return new BPromise(function(_0x262354,_0x5d50d4){return client['request'](_0x2d6a30,_0x35c200)[_0xb19c('0x6')](function(_0x3ffb45){logger[_0xb19c('0x7')](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));logger['debug'](_0xb19c('0xa'),_0x477ac1,_0xb19c('0x9'),JSON[_0xb19c('0xb')](_0x3ffb45));if(_0x3ffb45[_0xb19c('0xc')]){if(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xd')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x477ac1,_0x3ffb45['error'][_0xb19c('0xe')]);return _0x5d50d4(_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);}logger['error'](_0xb19c('0x8'),_0x477ac1,_0x3ffb45[_0xb19c('0xc')][_0xb19c('0xe')]);return _0x262354(_0x3ffb45['error'][_0xb19c('0xe')]);}else{logger['info'](_0xb19c('0x8'),_0x477ac1,_0xb19c('0x9'));_0x262354(_0x3ffb45[_0xb19c('0xf')][_0xb19c('0xe')]);}})[_0xb19c('0x10')](function(_0x5bae0a){logger[_0xb19c('0xc')](_0xb19c('0x8'),_0x477ac1,_0x5bae0a);_0x5d50d4(_0x5bae0a);});});}
\ No newline at end of file
index 2959e10..62ef764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6380=['update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x6380,0x159));var _0x0638=function(_0x3be926,_0xbb3c4e){_0x3be926=_0x3be926-0x0;var _0x59c6b2=_0x6380[_0x3be926];return _0x59c6b2;};'use strict';var multer=require('multer');var util=require(_0x0638('0x0'));var path=require(_0x0638('0x1'));var timeout=require(_0x0638('0x2'));var express=require(_0x0638('0x3'));var router=express[_0x0638('0x4')]();var fs_extra=require(_0x0638('0x5'));var auth=require(_0x0638('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0638('0x7'));var controller=require(_0x0638('0x8'));router[_0x0638('0x9')]('/',auth[_0x0638('0xa')](),controller[_0x0638('0xb')]);router[_0x0638('0x9')](_0x0638('0xc'),auth[_0x0638('0xa')](),controller[_0x0638('0xd')]);router[_0x0638('0xe')]('/',auth['isAuthenticated'](),controller[_0x0638('0xf')]);router['put'](_0x0638('0xc'),auth[_0x0638('0xa')](),controller[_0x0638('0x10')]);router['delete']('/:id',auth[_0x0638('0xa')](),controller[_0x0638('0x11')]);module[_0x0638('0x12')]=router;
\ No newline at end of file
+var _0x767b=['show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x767b,0xd0));var _0xb767=function(_0x3cb21e,_0x11849a){_0x3cb21e=_0x3cb21e-0x0;var _0xeacd6a=_0x767b[_0x3cb21e];return _0xeacd6a;};'use strict';var multer=require(_0xb767('0x0'));var util=require(_0xb767('0x1'));var path=require(_0xb767('0x2'));var timeout=require(_0xb767('0x3'));var express=require(_0xb767('0x4'));var router=express[_0xb767('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb767('0x6'));var config=require('../../config/environment');var controller=require(_0xb767('0x7'));router[_0xb767('0x8')]('/',auth[_0xb767('0x9')](),controller[_0xb767('0xa')]);router[_0xb767('0x8')](_0xb767('0xb'),auth[_0xb767('0x9')](),controller[_0xb767('0xc')]);router[_0xb767('0xd')]('/',auth[_0xb767('0x9')](),controller[_0xb767('0xe')]);router[_0xb767('0xf')](_0xb767('0xb'),auth['isAuthenticated'](),controller[_0xb767('0x10')]);router[_0xb767('0x11')](_0xb767('0xb'),auth[_0xb767('0x9')](),controller[_0xb767('0x12')]);module[_0xb767('0x13')]=router;
\ No newline at end of file
index 27c8493..bd225f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf663=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x2d23c9,_0x808606){var _0x494f10=function(_0x160e35){while(--_0x160e35){_0x2d23c9['push'](_0x2d23c9['shift']());}};_0x494f10(++_0x808606);}(_0xf663,0x162));var _0x3f66=function(_0x3e1e4c,_0x4d16e4){_0x3e1e4c=_0x3e1e4c-0x0;var _0x1b5dd3=_0xf663[_0x3e1e4c];return _0x1b5dd3;};'use strict';var Sequelize=require(_0x3f66('0x0'));module[_0x3f66('0x1')]={'type':{'type':Sequelize[_0x3f66('0x2')](_0x3f66('0x3'),_0x3f66('0x4'),_0x3f66('0x5'),'keyValue',_0x3f66('0x6')),'defaultValue':_0x3f66('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3f66('0x7')]},'keyType':{'type':Sequelize[_0x3f66('0x2')]('string',_0x3f66('0x4'),_0x3f66('0x5'))},'keyContent':{'type':Sequelize[_0x3f66('0x7')]},'idField':{'type':Sequelize[_0x3f66('0x7')]},'nameField':{'type':Sequelize[_0x3f66('0x7')]},'customField':{'type':Sequelize[_0x3f66('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3f66('0x7')]}};
\ No newline at end of file
+var _0x5c4f=['customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x5c4f,0x1dd));var _0xf5c4=function(_0x398eeb,_0x4908d8){_0x398eeb=_0x398eeb-0x0;var _0x500dc9=_0x5c4f[_0x398eeb];return _0x500dc9;};'use strict';var Sequelize=require(_0xf5c4('0x0'));module[_0xf5c4('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xf5c4('0x2'),_0xf5c4('0x3'),_0xf5c4('0x4'),_0xf5c4('0x5')),'defaultValue':_0xf5c4('0x6')},'content':{'type':Sequelize[_0xf5c4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf5c4('0x8')](_0xf5c4('0x6'),_0xf5c4('0x2'),_0xf5c4('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf5c4('0x7')]},'nameField':{'type':Sequelize[_0xf5c4('0x7')]},'customField':{'type':Sequelize[_0xf5c4('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf5c4('0x7')]}};
\ No newline at end of file
index 2642898..13341cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9c3=['options','includeAll','include','rows','catch','show','params','find','create','body','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','count','set','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','pick','filter','where','merge'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xc9c3,0x96));var _0x3c9c=function(_0x10790f,_0x250349){_0x10790f=_0x10790f-0x0;var _0xf18563=_0xc9c3[_0x10790f];return _0xf18563;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3c9c('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c9c('0x1'));var moment=require(_0x3c9c('0x2'));var BPromise=require(_0x3c9c('0x3'));var Mustache=require(_0x3c9c('0x4'));var util=require(_0x3c9c('0x5'));var path=require(_0x3c9c('0x6'));var sox=require(_0x3c9c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c9c('0x8'));var squel=require(_0x3c9c('0x9'));var crypto=require(_0x3c9c('0xa'));var jsforce=require(_0x3c9c('0xb'));var deskjs=require(_0x3c9c('0xc'));var toCsv=require(_0x3c9c('0xd'));var querystring=require(_0x3c9c('0xe'));var Papa=require(_0x3c9c('0xf'));var Redis=require(_0x3c9c('0x10'));var authService=require(_0x3c9c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3c9c('0x12'));var hardwareService=require(_0x3c9c('0x13'));var logger=require('../../config/logger')(_0x3c9c('0x14'));var utils=require('../../config/utils');var config=require(_0x3c9c('0x15'));var licenseUtil=require(_0x3c9c('0x16'));var db=require(_0x3c9c('0x17'))['db'];function respondWithStatusCode(_0x3f464d,_0x4a17ed){_0x4a17ed=_0x4a17ed||0xcc;return function(_0x50cf96){if(_0x50cf96){return _0x3f464d['sendStatus'](_0x4a17ed);}return _0x3f464d[_0x3c9c('0x18')](_0x4a17ed)['end']();};}function respondWithResult(_0x5e8c0e,_0x53b3ca){_0x53b3ca=_0x53b3ca||0xc8;return function(_0x22c495){if(_0x22c495){return _0x5e8c0e['status'](_0x53b3ca)[_0x3c9c('0x19')](_0x22c495);}};}function respondWithFilteredResult(_0xf16337,_0x1f725b){return function(_0x824e63){if(_0x824e63){var _0x4a43d2=typeof _0x1f725b[_0x3c9c('0x1a')]==='undefined'&&typeof _0x1f725b['limit']==='undefined';var _0x3200a3=_0x824e63[_0x3c9c('0x1b')];var _0x216fd8=_0x4a43d2?0x0:_0x1f725b[_0x3c9c('0x1a')];var _0x3e63e0=_0x4a43d2?_0x824e63[_0x3c9c('0x1b')]:_0x1f725b[_0x3c9c('0x1a')]+_0x1f725b['limit'];var _0x15a90a;if(_0x3e63e0>=_0x3200a3){_0x3e63e0=_0x3200a3;_0x15a90a=0xc8;}else{_0x15a90a=0xce;}_0xf16337['status'](_0x15a90a);return _0xf16337[_0x3c9c('0x1c')]('Content-Range',_0x216fd8+'-'+_0x3e63e0+'/'+_0x3200a3)[_0x3c9c('0x19')](_0x824e63);}return null;};}function patchUpdates(_0x1152d5){return function(_0x5f51fb){try{jsonpatch[_0x3c9c('0x1d')](_0x5f51fb,_0x1152d5,!![]);}catch(_0x29e4ac){return BPromise[_0x3c9c('0x1e')](_0x29e4ac);}return _0x5f51fb['save']();};}function saveUpdates(_0x3faad1,_0x249747){return function(_0x2d5ffc){if(_0x2d5ffc){return _0x2d5ffc[_0x3c9c('0x1f')](_0x3faad1)[_0x3c9c('0x20')](function(_0x3bc5c4){return _0x3bc5c4;});}return null;};}function removeEntity(_0x338c2d,_0x32e4c2){return function(_0x509bf7){if(_0x509bf7){return _0x509bf7[_0x3c9c('0x21')]()['then'](function(){_0x338c2d[_0x3c9c('0x18')](0xcc)[_0x3c9c('0x22')]();});}};}function handleEntityNotFound(_0x4ca078,_0x527bb9){return function(_0x379880){if(!_0x379880){_0x4ca078[_0x3c9c('0x23')](0x194);}return _0x379880;};}function handleError(_0x1b57ec,_0x43d1f0){_0x43d1f0=_0x43d1f0||0x1f4;return function(_0x4c283d){logger[_0x3c9c('0x24')](_0x4c283d[_0x3c9c('0x25')]);if(_0x4c283d['name']){delete _0x4c283d[_0x3c9c('0x26')];}_0x1b57ec['status'](_0x43d1f0)['send'](_0x4c283d);};}exports[_0x3c9c('0x27')]=function(_0x39ea8d,_0x333f2b){var _0x248de1={},_0x7bdf33={},_0x5da4e9={'count':0x0,'rows':[]};var _0x18eebd=_['map'](db[_0x3c9c('0x28')][_0x3c9c('0x29')],function(_0x4a0644){return{'name':_0x4a0644[_0x3c9c('0x2a')],'type':_0x4a0644['type'][_0x3c9c('0x2b')]};});_0x7bdf33[_0x3c9c('0x2c')]=_[_0x3c9c('0x2d')](_0x18eebd,_0x3c9c('0x26'));_0x7bdf33[_0x3c9c('0x2e')]=_[_0x3c9c('0x2f')](_0x39ea8d[_0x3c9c('0x2e')]);_0x7bdf33[_0x3c9c('0x30')]=_['intersection'](_0x7bdf33[_0x3c9c('0x2c')],_0x7bdf33[_0x3c9c('0x2e')]);_0x248de1[_0x3c9c('0x31')]=_[_0x3c9c('0x32')](_0x7bdf33[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x248de1[_0x3c9c('0x31')]=_0x248de1[_0x3c9c('0x31')][_0x3c9c('0x34')]?_0x248de1[_0x3c9c('0x31')]:_0x7bdf33[_0x3c9c('0x2c')];if(!_0x39ea8d[_0x3c9c('0x2e')]['hasOwnProperty'](_0x3c9c('0x35'))){_0x248de1[_0x3c9c('0x36')]=qs[_0x3c9c('0x36')](_0x39ea8d['query'][_0x3c9c('0x36')]);_0x248de1[_0x3c9c('0x1a')]=qs[_0x3c9c('0x1a')](_0x39ea8d[_0x3c9c('0x2e')]['offset']);}_0x248de1['order']=qs[_0x3c9c('0x37')](_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x37')]);_0x248de1['where']=qs['filters'](_[_0x3c9c('0x38')](_0x39ea8d['query'],_0x7bdf33['filters']),_0x18eebd);if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]){_0x248de1[_0x3c9c('0x3a')]=_['merge'](_0x248de1[_0x3c9c('0x3a')],{'$or':_[_0x3c9c('0x2d')](_0x18eebd,function(_0x4024aa){if(_0x4024aa['type']!=='VIRTUAL'){var _0x4826d3={};_0x4826d3[_0x4024aa[_0x3c9c('0x26')]]={'$like':'%'+_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x39')]+'%'};return _0x4826d3;}})});}_0x248de1=_[_0x3c9c('0x3b')]({},_0x248de1,_0x39ea8d[_0x3c9c('0x3c')]);var _0x1125ff={'where':_0x248de1['where']};return db['DeskField'][_0x3c9c('0x1b')](_0x1125ff)[_0x3c9c('0x20')](function(_0xe23844){_0x5da4e9['count']=_0xe23844;if(_0x39ea8d[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x248de1[_0x3c9c('0x3e')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x248de1);})[_0x3c9c('0x20')](function(_0xdbac2a){_0x5da4e9[_0x3c9c('0x3f')]=_0xdbac2a;return _0x5da4e9;})['then'](respondWithFilteredResult(_0x333f2b,_0x248de1))[_0x3c9c('0x40')](handleError(_0x333f2b,null));};exports[_0x3c9c('0x41')]=function(_0xd81ea4,_0x3dbfc7){var _0x5be9a3={'raw':!![],'where':{'id':_0xd81ea4[_0x3c9c('0x42')]['id']}},_0x412a21={};_0x412a21['model']=_['keys'](db[_0x3c9c('0x28')][_0x3c9c('0x29')]);_0x412a21['query']=_[_0x3c9c('0x2f')](_0xd81ea4[_0x3c9c('0x2e')]);_0x412a21[_0x3c9c('0x30')]=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],_0x412a21[_0x3c9c('0x2e')]);_0x5be9a3['attributes']=_[_0x3c9c('0x32')](_0x412a21[_0x3c9c('0x2c')],qs[_0x3c9c('0x33')](_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x33')]));_0x5be9a3['attributes']=_0x5be9a3['attributes'][_0x3c9c('0x34')]?_0x5be9a3[_0x3c9c('0x31')]:_0x412a21[_0x3c9c('0x2c')];if(_0xd81ea4[_0x3c9c('0x2e')][_0x3c9c('0x3d')]){_0x5be9a3['include']=[{'all':!![]}];}_0x5be9a3=_[_0x3c9c('0x3b')]({},_0x5be9a3,_0xd81ea4[_0x3c9c('0x3c')]);return db[_0x3c9c('0x28')][_0x3c9c('0x43')](_0x5be9a3)[_0x3c9c('0x20')](handleEntityNotFound(_0x3dbfc7,null))['then'](respondWithResult(_0x3dbfc7,null))[_0x3c9c('0x40')](handleError(_0x3dbfc7,null));};exports[_0x3c9c('0x44')]=function(_0x1804e3,_0x24b1f0){return db[_0x3c9c('0x28')][_0x3c9c('0x44')](_0x1804e3[_0x3c9c('0x45')],{})['then'](respondWithResult(_0x24b1f0,0xc9))[_0x3c9c('0x40')](handleError(_0x24b1f0,null));};exports[_0x3c9c('0x1f')]=function(_0xbcf5fb,_0x278f77){if(_0xbcf5fb[_0x3c9c('0x45')]['id']){delete _0xbcf5fb[_0x3c9c('0x45')]['id'];}return db['DeskField'][_0x3c9c('0x43')]({'where':{'id':_0xbcf5fb[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x278f77,null))[_0x3c9c('0x20')](saveUpdates(_0xbcf5fb[_0x3c9c('0x45')],null))[_0x3c9c('0x20')](respondWithResult(_0x278f77,null))[_0x3c9c('0x40')](handleError(_0x278f77,null));};exports[_0x3c9c('0x21')]=function(_0xb62338,_0x31e63d){return db[_0x3c9c('0x28')][_0x3c9c('0x43')]({'where':{'id':_0xb62338[_0x3c9c('0x42')]['id']}})[_0x3c9c('0x20')](handleEntityNotFound(_0x31e63d,null))[_0x3c9c('0x20')](removeEntity(_0x31e63d,null))[_0x3c9c('0x40')](handleError(_0x31e63d,null));};
\ No newline at end of file
+var _0xa68e=['querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','error','stack','name','send','index','DeskField','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x4fbbe3,_0x121d85){var _0x93068f=function(_0x56c9c9){while(--_0x56c9c9){_0x4fbbe3['push'](_0x4fbbe3['shift']());}};_0x93068f(++_0x121d85);}(_0xa68e,0xd3));var _0xea68=function(_0x2383f7,_0x53e3ca){_0x2383f7=_0x2383f7-0x0;var _0x1432c6=_0xa68e[_0x2383f7];return _0x1432c6;};'use strict';var emlformat=require(_0xea68('0x0'));var rimraf=require(_0xea68('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea68('0x2'));var rp=require(_0xea68('0x3'));var moment=require(_0xea68('0x4'));var BPromise=require(_0xea68('0x5'));var Mustache=require(_0xea68('0x6'));var util=require(_0xea68('0x7'));var path=require(_0xea68('0x8'));var sox=require(_0xea68('0x9'));var csv=require(_0xea68('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea68('0xb'));var _=require(_0xea68('0xc'));var squel=require(_0xea68('0xd'));var crypto=require(_0xea68('0xe'));var jsforce=require(_0xea68('0xf'));var deskjs=require(_0xea68('0x10'));var toCsv=require(_0xea68('0xa'));var querystring=require(_0xea68('0x11'));var Papa=require(_0xea68('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xea68('0x13'));var hardwareService=require(_0xea68('0x14'));var logger=require('../../config/logger')(_0xea68('0x15'));var utils=require(_0xea68('0x16'));var config=require(_0xea68('0x17'));var licenseUtil=require(_0xea68('0x18'));var db=require(_0xea68('0x19'))['db'];function respondWithStatusCode(_0x82f070,_0x36c239){_0x36c239=_0x36c239||0xcc;return function(_0x1e73d3){if(_0x1e73d3){return _0x82f070[_0xea68('0x1a')](_0x36c239);}return _0x82f070[_0xea68('0x1b')](_0x36c239)[_0xea68('0x1c')]();};}function respondWithResult(_0x540a23,_0x17bd4a){_0x17bd4a=_0x17bd4a||0xc8;return function(_0x5d460c){if(_0x5d460c){return _0x540a23[_0xea68('0x1b')](_0x17bd4a)[_0xea68('0x1d')](_0x5d460c);}};}function respondWithFilteredResult(_0x4f0b72,_0x4b520a){return function(_0x3f591d){if(_0x3f591d){var _0x1d1ae5=typeof _0x4b520a[_0xea68('0x1e')]===_0xea68('0x1f')&&typeof _0x4b520a[_0xea68('0x20')]===_0xea68('0x1f');var _0x255cfb=_0x3f591d[_0xea68('0x21')];var _0x38cb81=_0x1d1ae5?0x0:_0x4b520a[_0xea68('0x1e')];var _0x4cc7e6=_0x1d1ae5?_0x3f591d['count']:_0x4b520a['offset']+_0x4b520a[_0xea68('0x20')];var _0x43cbbe;if(_0x4cc7e6>=_0x255cfb){_0x4cc7e6=_0x255cfb;_0x43cbbe=0xc8;}else{_0x43cbbe=0xce;}_0x4f0b72[_0xea68('0x1b')](_0x43cbbe);return _0x4f0b72['set']('Content-Range',_0x38cb81+'-'+_0x4cc7e6+'/'+_0x255cfb)[_0xea68('0x1d')](_0x3f591d);}return null;};}function patchUpdates(_0x48f636){return function(_0x28e643){try{jsonpatch[_0xea68('0x22')](_0x28e643,_0x48f636,!![]);}catch(_0x1d2eb5){return BPromise[_0xea68('0x23')](_0x1d2eb5);}return _0x28e643['save']();};}function saveUpdates(_0x5033bf,_0x39bcfa){return function(_0x5e7cf1){if(_0x5e7cf1){return _0x5e7cf1[_0xea68('0x24')](_0x5033bf)[_0xea68('0x25')](function(_0x1744f3){return _0x1744f3;});}return null;};}function removeEntity(_0x577d0a,_0x151a69){return function(_0x42aa24){if(_0x42aa24){return _0x42aa24[_0xea68('0x26')]()[_0xea68('0x25')](function(){_0x577d0a[_0xea68('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1d0e,_0x2d0029){return function(_0x19e327){if(!_0x19e327){_0x2f1d0e[_0xea68('0x1a')](0x194);}return _0x19e327;};}function handleError(_0x24fdf5,_0x2a0ff5){_0x2a0ff5=_0x2a0ff5||0x1f4;return function(_0x277948){logger[_0xea68('0x27')](_0x277948[_0xea68('0x28')]);if(_0x277948[_0xea68('0x29')]){delete _0x277948[_0xea68('0x29')];}_0x24fdf5['status'](_0x2a0ff5)[_0xea68('0x2a')](_0x277948);};}exports[_0xea68('0x2b')]=function(_0x36384e,_0xe0879e){var _0x481eb3={},_0x8c72ed={},_0x54ce75={'count':0x0,'rows':[]};var _0x17ef94=_['map'](db[_0xea68('0x2c')][_0xea68('0x2d')],function(_0x33c3c3){return{'name':_0x33c3c3[_0xea68('0x2e')],'type':_0x33c3c3['type'][_0xea68('0x2f')]};});_0x8c72ed[_0xea68('0x30')]=_[_0xea68('0x31')](_0x17ef94,_0xea68('0x29'));_0x8c72ed[_0xea68('0x32')]=_[_0xea68('0x33')](_0x36384e[_0xea68('0x32')]);_0x8c72ed[_0xea68('0x34')]=_[_0xea68('0x35')](_0x8c72ed['model'],_0x8c72ed[_0xea68('0x32')]);_0x481eb3['attributes']=_[_0xea68('0x35')](_0x8c72ed[_0xea68('0x30')],qs[_0xea68('0x36')](_0x36384e[_0xea68('0x32')][_0xea68('0x36')]));_0x481eb3['attributes']=_0x481eb3[_0xea68('0x37')][_0xea68('0x38')]?_0x481eb3['attributes']:_0x8c72ed[_0xea68('0x30')];if(!_0x36384e[_0xea68('0x32')][_0xea68('0x39')](_0xea68('0x3a'))){_0x481eb3['limit']=qs['limit'](_0x36384e[_0xea68('0x32')]['limit']);_0x481eb3[_0xea68('0x1e')]=qs['offset'](_0x36384e[_0xea68('0x32')][_0xea68('0x1e')]);}_0x481eb3[_0xea68('0x3b')]=qs['sort'](_0x36384e['query'][_0xea68('0x3c')]);_0x481eb3['where']=qs[_0xea68('0x34')](_[_0xea68('0x3d')](_0x36384e['query'],_0x8c72ed[_0xea68('0x34')]),_0x17ef94);if(_0x36384e['query'][_0xea68('0x3e')]){_0x481eb3[_0xea68('0x3f')]=_[_0xea68('0x40')](_0x481eb3[_0xea68('0x3f')],{'$or':_['map'](_0x17ef94,function(_0x3f92a3){if(_0x3f92a3['type']!==_0xea68('0x41')){var _0x5314c2={};_0x5314c2[_0x3f92a3[_0xea68('0x29')]]={'$like':'%'+_0x36384e[_0xea68('0x32')][_0xea68('0x3e')]+'%'};return _0x5314c2;}})});}_0x481eb3=_['merge']({},_0x481eb3,_0x36384e['options']);var _0x41852e={'where':_0x481eb3[_0xea68('0x3f')]};return db[_0xea68('0x2c')][_0xea68('0x21')](_0x41852e)[_0xea68('0x25')](function(_0x264f0f){_0x54ce75['count']=_0x264f0f;if(_0x36384e['query'][_0xea68('0x42')]){_0x481eb3['include']=[{'all':!![]}];}return db[_0xea68('0x2c')][_0xea68('0x43')](_0x481eb3);})[_0xea68('0x25')](function(_0x3f04c4){_0x54ce75[_0xea68('0x44')]=_0x3f04c4;return _0x54ce75;})['then'](respondWithFilteredResult(_0xe0879e,_0x481eb3))[_0xea68('0x45')](handleError(_0xe0879e,null));};exports[_0xea68('0x46')]=function(_0x4c1db7,_0x35634a){var _0x461b8b={'raw':!![],'where':{'id':_0x4c1db7[_0xea68('0x47')]['id']}},_0xb99c04={};_0xb99c04[_0xea68('0x30')]=_[_0xea68('0x33')](db[_0xea68('0x2c')][_0xea68('0x2d')]);_0xb99c04[_0xea68('0x32')]=_['keys'](_0x4c1db7[_0xea68('0x32')]);_0xb99c04['filters']=_[_0xea68('0x35')](_0xb99c04[_0xea68('0x30')],_0xb99c04['query']);_0x461b8b[_0xea68('0x37')]=_['intersection'](_0xb99c04[_0xea68('0x30')],qs[_0xea68('0x36')](_0x4c1db7[_0xea68('0x32')]['fields']));_0x461b8b['attributes']=_0x461b8b['attributes']['length']?_0x461b8b['attributes']:_0xb99c04[_0xea68('0x30')];if(_0x4c1db7[_0xea68('0x32')]['includeAll']){_0x461b8b['include']=[{'all':!![]}];}_0x461b8b=_[_0xea68('0x40')]({},_0x461b8b,_0x4c1db7[_0xea68('0x48')]);return db[_0xea68('0x2c')][_0xea68('0x49')](_0x461b8b)[_0xea68('0x25')](handleEntityNotFound(_0x35634a,null))[_0xea68('0x25')](respondWithResult(_0x35634a,null))[_0xea68('0x45')](handleError(_0x35634a,null));};exports[_0xea68('0x4a')]=function(_0x3ee5ea,_0x1b0249){return db['DeskField'][_0xea68('0x4a')](_0x3ee5ea['body'],{})[_0xea68('0x25')](respondWithResult(_0x1b0249,0xc9))[_0xea68('0x45')](handleError(_0x1b0249,null));};exports[_0xea68('0x24')]=function(_0x1f9c45,_0x1b17f1){if(_0x1f9c45[_0xea68('0x4b')]['id']){delete _0x1f9c45[_0xea68('0x4b')]['id'];}return db[_0xea68('0x2c')][_0xea68('0x49')]({'where':{'id':_0x1f9c45['params']['id']}})[_0xea68('0x25')](handleEntityNotFound(_0x1b17f1,null))['then'](saveUpdates(_0x1f9c45['body'],null))[_0xea68('0x25')](respondWithResult(_0x1b17f1,null))['catch'](handleError(_0x1b17f1,null));};exports[_0xea68('0x26')]=function(_0x4dd956,_0x605ba0){return db['DeskField'][_0xea68('0x49')]({'where':{'id':_0x4dd956[_0xea68('0x47')]['id']}})[_0xea68('0x25')](handleEntityNotFound(_0x605ba0,null))[_0xea68('0x25')](removeEntity(_0x605ba0,null))['catch'](handleError(_0x605ba0,null));};
\ No newline at end of file
index b207d32..ced3083 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa71=['rimraf','../../config/environment','define','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x15a877,_0x4a0e56){var _0x551174=function(_0x3a1cd0){while(--_0x3a1cd0){_0x15a877['push'](_0x15a877['shift']());}};_0x551174(++_0x4a0e56);}(_0xaa71,0x118));var _0x1aa7=function(_0x5903b0,_0x554c48){_0x5903b0=_0x5903b0-0x0;var _0x1dd78f=_0xaa71[_0x5903b0];return _0x1dd78f;};'use strict';var _=require(_0x1aa7('0x0'));var util=require('util');var logger=require(_0x1aa7('0x1'))(_0x1aa7('0x2'));var moment=require(_0x1aa7('0x3'));var BPromise=require('bluebird');var rp=require(_0x1aa7('0x4'));var fs=require('fs');var path=require(_0x1aa7('0x5'));var rimraf=require(_0x1aa7('0x6'));var config=require(_0x1aa7('0x7'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x1a1037,_0x425b65){return _0x1a1037[_0x1aa7('0x8')](_0x1aa7('0x9'),attributes,{'tableName':_0x1aa7('0xa'),'paranoid':![],'indexes':[{'name':_0x1aa7('0xb'),'fields':['idField',_0x1aa7('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x361a=['DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','exports'];(function(_0x4849f6,_0x104836){var _0x1a3dcd=function(_0x494d3c){while(--_0x494d3c){_0x4849f6['push'](_0x4849f6['shift']());}};_0x1a3dcd(++_0x104836);}(_0x361a,0xfc));var _0xa361=function(_0x56cc7d,_0x462750){_0x56cc7d=_0x56cc7d-0x0;var _0x49f3d6=_0x361a[_0x56cc7d];return _0x49f3d6;};'use strict';var _=require(_0xa361('0x0'));var util=require(_0xa361('0x1'));var logger=require(_0xa361('0x2'))(_0xa361('0x3'));var moment=require('moment');var BPromise=require(_0xa361('0x4'));var rp=require(_0xa361('0x5'));var fs=require('fs');var path=require(_0xa361('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0xa361('0x7')]=function(_0x528066,_0x4d29ec){return _0x528066['define'](_0xa361('0x8'),attributes,{'tableName':_0xa361('0x9'),'paranoid':![],'indexes':[{'name':_0xa361('0xa'),'fields':[_0xa361('0xb'),_0xa361('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 36f591e..3f5bf98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45db=['rpc','../../config/environment','jayson/promise','client','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x284551,_0x4ee3b1){var _0x1be363=function(_0x4919bf){while(--_0x4919bf){_0x284551['push'](_0x284551['shift']());}};_0x1be363(++_0x4ee3b1);}(_0x45db,0x16f));var _0xb45d=function(_0x1dd6ba,_0x4f8eea){_0x1dd6ba=_0x1dd6ba-0x0;var _0xbdfc7a=_0x45db[_0x1dd6ba];return _0xbdfc7a;};'use strict';var _=require(_0xb45d('0x0'));var util=require(_0xb45d('0x1'));var moment=require(_0xb45d('0x2'));var BPromise=require(_0xb45d('0x3'));var rs=require(_0xb45d('0x4'));var fs=require('fs');var Redis=require(_0xb45d('0x5'));var db=require(_0xb45d('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb45d('0x7'));var config=require(_0xb45d('0x8'));var jayson=require(_0xb45d('0x9'));var client=jayson[_0xb45d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2152,_0x275a32,_0x14a636){return new BPromise(function(_0x27d74f,_0x519f0d){return client[_0xb45d('0xb')](_0x2a2152,_0x14a636)['then'](function(_0x574941){logger[_0xb45d('0xc')](_0xb45d('0xd'),_0x275a32,_0xb45d('0xe'));logger[_0xb45d('0xf')](_0xb45d('0x10'),_0x275a32,_0xb45d('0xe'),JSON[_0xb45d('0x11')](_0x574941));if(_0x574941['error']){if(_0x574941[_0xb45d('0x12')][_0xb45d('0x13')]===0x1f4){logger[_0xb45d('0x12')](_0xb45d('0xd'),_0x275a32,_0x574941[_0xb45d('0x12')]['message']);return _0x519f0d(_0x574941[_0xb45d('0x12')][_0xb45d('0x14')]);}logger['error'](_0xb45d('0xd'),_0x275a32,_0x574941[_0xb45d('0x12')][_0xb45d('0x14')]);return _0x27d74f(_0x574941[_0xb45d('0x12')][_0xb45d('0x14')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x275a32,_0xb45d('0xe'));_0x27d74f(_0x574941[_0xb45d('0x15')][_0xb45d('0x14')]);}})['catch'](function(_0xad1334){logger[_0xb45d('0x12')]('DeskField,\x20%s,\x20%s',_0x275a32,_0xad1334);_0x519f0d(_0xad1334);});});}
\ No newline at end of file
+var _0x1707=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','DeskField,\x20%s,\x20%s','result','catch','lodash'];(function(_0x47964e,_0x452685){var _0x2af854=function(_0x1d0c0d){while(--_0x1d0c0d){_0x47964e['push'](_0x47964e['shift']());}};_0x2af854(++_0x452685);}(_0x1707,0x77));var _0x7170=function(_0x225ce1,_0x463907){_0x225ce1=_0x225ce1-0x0;var _0x50aca1=_0x1707[_0x225ce1];return _0x50aca1;};'use strict';var _=require(_0x7170('0x0'));var util=require('util');var moment=require(_0x7170('0x1'));var BPromise=require('bluebird');var rs=require(_0x7170('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7170('0x3'))['db'];var utils=require(_0x7170('0x4'));var logger=require(_0x7170('0x5'))(_0x7170('0x6'));var config=require(_0x7170('0x7'));var jayson=require(_0x7170('0x8'));var client=jayson[_0x7170('0x9')][_0x7170('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36feb8,_0x30f689,_0x4761a9){return new BPromise(function(_0x35c186,_0x13dc30){return client[_0x7170('0xb')](_0x36feb8,_0x4761a9)[_0x7170('0xc')](function(_0x44e074){logger['info']('DeskField,\x20%s,\x20%s',_0x30f689,_0x7170('0xd'));logger[_0x7170('0xe')](_0x7170('0xf'),_0x30f689,'request\x20sent',JSON[_0x7170('0x10')](_0x44e074));if(_0x44e074[_0x7170('0x11')]){if(_0x44e074['error'][_0x7170('0x12')]===0x1f4){logger[_0x7170('0x11')]('DeskField,\x20%s,\x20%s',_0x30f689,_0x44e074[_0x7170('0x11')][_0x7170('0x13')]);return _0x13dc30(_0x44e074[_0x7170('0x11')][_0x7170('0x13')]);}logger[_0x7170('0x11')]('DeskField,\x20%s,\x20%s',_0x30f689,_0x44e074[_0x7170('0x11')]['message']);return _0x35c186(_0x44e074[_0x7170('0x11')][_0x7170('0x13')]);}else{logger[_0x7170('0x14')](_0x7170('0x15'),_0x30f689,_0x7170('0xd'));_0x35c186(_0x44e074[_0x7170('0x16')][_0x7170('0x13')]);}})[_0x7170('0x17')](function(_0x1f1f6a){logger[_0x7170('0x11')](_0x7170('0x15'),_0x30f689,_0x1f1f6a);_0x13dc30(_0x1f1f6a);});});}
\ No newline at end of file
index 2f14b80..2e8da8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbfe=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','create','/:id/configurations','addConfiguration','put','delete','exports','path','connect-timeout'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xfbfe,0x124));var _0xefbf=function(_0x4cb2d8,_0x4dec1a){_0x4cb2d8=_0x4cb2d8-0x0;var _0x5f57e5=_0xfbfe[_0x4cb2d8];return _0x5f57e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xefbf('0x0'));var timeout=require(_0xefbf('0x1'));var express=require(_0xefbf('0x2'));var router=express['Router']();var fs_extra=require(_0xefbf('0x3'));var auth=require(_0xefbf('0x4'));var interaction=require(_0xefbf('0x5'));var config=require(_0xefbf('0x6'));var controller=require(_0xefbf('0x7'));router[_0xefbf('0x8')]('/',auth[_0xefbf('0x9')](),controller[_0xefbf('0xa')]);router[_0xefbf('0x8')](_0xefbf('0xb'),auth[_0xefbf('0x9')](),controller['show']);router[_0xefbf('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xefbf('0xc')]);router['get'](_0xefbf('0xd'),auth[_0xefbf('0x9')](),controller[_0xefbf('0xe')]);router['post']('/',auth[_0xefbf('0x9')](),controller[_0xefbf('0xf')]);router['post'](_0xefbf('0x10'),auth['isAuthenticated'](),controller[_0xefbf('0x11')]);router[_0xefbf('0x12')](_0xefbf('0xb'),auth[_0xefbf('0x9')](),controller['update']);router[_0xefbf('0x13')](_0xefbf('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xefbf('0x14')]=router;
\ No newline at end of file
+var _0x17f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xf544dd,_0x33c7c8){var _0x1e130a=function(_0x3b38f8){while(--_0x3b38f8){_0xf544dd['push'](_0xf544dd['shift']());}};_0x1e130a(++_0x33c7c8);}(_0x17f2,0x173));var _0x217f=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x17f2[_0xa79977];return _0x109f10;};'use strict';var multer=require(_0x217f('0x0'));var util=require(_0x217f('0x1'));var path=require(_0x217f('0x2'));var timeout=require(_0x217f('0x3'));var express=require(_0x217f('0x4'));var router=express[_0x217f('0x5')]();var fs_extra=require(_0x217f('0x6'));var auth=require(_0x217f('0x7'));var interaction=require(_0x217f('0x8'));var config=require(_0x217f('0x9'));var controller=require(_0x217f('0xa'));router[_0x217f('0xb')]('/',auth[_0x217f('0xc')](),controller['index']);router[_0x217f('0xb')](_0x217f('0xd'),auth[_0x217f('0xc')](),controller[_0x217f('0xe')]);router['get']('/:id/configurations',auth[_0x217f('0xc')](),controller[_0x217f('0xf')]);router[_0x217f('0xb')](_0x217f('0x10'),auth[_0x217f('0xc')](),controller[_0x217f('0x11')]);router[_0x217f('0x12')]('/',auth[_0x217f('0xc')](),controller[_0x217f('0x13')]);router['post'](_0x217f('0x14'),auth[_0x217f('0xc')](),controller[_0x217f('0x15')]);router[_0x217f('0x16')](_0x217f('0xd'),auth[_0x217f('0xc')](),controller[_0x217f('0x17')]);router[_0x217f('0x18')](_0x217f('0xd'),auth['isAuthenticated'](),controller[_0x217f('0x19')]);module[_0x217f('0x1a')]=router;
\ No newline at end of file
index fe4003e..e2d2b8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dfd=['STRING','BOOLEAN','sequelize','exports'];(function(_0x5ca342,_0x5e4bdc){var _0x4b0d48=function(_0xc87360){while(--_0xc87360){_0x5ca342['push'](_0x5ca342['shift']());}};_0x4b0d48(++_0x5e4bdc);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')]},'username':{'type':Sequelize[_0xd7df('0x2')]},'password':{'type':Sequelize[_0xd7df('0x2')]},'remoteUri':{'type':Sequelize[_0xd7df('0x2')]},'tenantId':{'type':Sequelize[_0xd7df('0x2')]},'clientId':{'type':Sequelize[_0xd7df('0x2')]},'clientSecret':{'type':Sequelize[_0xd7df('0x2')]},'serverUrl':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'modernAuthentication':{'type':Sequelize[_0xd7df('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x03db=['STRING','BOOLEAN','sequelize','exports'];(function(_0x110248,_0x3d39fe){var _0x464879=function(_0x1f084e){while(--_0x1f084e){_0x110248['push'](_0x110248['shift']());}};_0x464879(++_0x3d39fe);}(_0x03db,0x156));var _0xb03d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x03db[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb03d('0x0'));module[_0xb03d('0x1')]={'name':{'type':Sequelize[_0xb03d('0x2')]},'username':{'type':Sequelize[_0xb03d('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb03d('0x2')]},'tenantId':{'type':Sequelize[_0xb03d('0x2')]},'clientId':{'type':Sequelize[_0xb03d('0x2')]},'clientSecret':{'type':Sequelize[_0xb03d('0x2')]},'serverUrl':{'type':Sequelize[_0xb03d('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xb03d('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index ed042d4..54d25d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f2a=['description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientSecret','CloudProvider','data5','access_token','data7','POST','https://login.microsoftonline.com/','clientId','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','?$select=DisplayName,LogicalName','DisplayName','request-promise','lodash','../../components/parsers/qs','../../config/logger','../../mysqldb','../../components/integrations/configuration','status','json','offset','limit','undefined','count','set','update','then','destroy','end','sendStatus','error','stack','name','send','index','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','getConfigurations','findOne','Dynamics365Configuration','order','map','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','lastIndexOf','%s/api/data/v9.0/','incident','Incident'];(function(_0x16dbcd,_0x274516){var _0x34706e=function(_0x43433d){while(--_0x43433d){_0x16dbcd['push'](_0x16dbcd['shift']());}};_0x34706e(++_0x274516);}(_0x0f2a,0x12d));var _0xa0f2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0f2a[_0x122ef9];return _0x42fba0;};'use strict';var rp=require(_0xa0f2('0x0'));var util=require('util');var _=require(_0xa0f2('0x1'));var qs=require(_0xa0f2('0x2'));var logger=require(_0xa0f2('0x3'))('api');var db=require(_0xa0f2('0x4'))['db'];var integrations=require(_0xa0f2('0x5'));function respondWithResult(_0x1604dc,_0x3fed5e){_0x3fed5e=_0x3fed5e||0xc8;return function(_0x50cbb8){if(_0x50cbb8){return _0x1604dc[_0xa0f2('0x6')](_0x3fed5e)[_0xa0f2('0x7')](_0x50cbb8);}};}function respondWithFilteredResult(_0x56be5b,_0x2f0d1e){return function(_0x28cb){if(_0x28cb){var _0x53de2c=typeof _0x2f0d1e[_0xa0f2('0x8')]==='undefined'&&typeof _0x2f0d1e[_0xa0f2('0x9')]===_0xa0f2('0xa');var _0x429c7e=_0x28cb[_0xa0f2('0xb')];var _0x479814=_0x53de2c?0x0:_0x2f0d1e[_0xa0f2('0x8')];var _0x5763b3=_0x53de2c?_0x28cb['count']:_0x2f0d1e[_0xa0f2('0x8')]+_0x2f0d1e[_0xa0f2('0x9')];var _0x529a69;if(_0x5763b3>=_0x429c7e){_0x5763b3=_0x429c7e;_0x529a69=0xc8;}else{_0x529a69=0xce;}_0x56be5b[_0xa0f2('0x6')](_0x529a69);return _0x56be5b[_0xa0f2('0xc')]('Content-Range',_0x479814+'-'+_0x5763b3+'/'+_0x429c7e)['json'](_0x28cb);}return null;};}function saveUpdates(_0x103214){return function(_0x805a89){if(_0x805a89){return _0x805a89[_0xa0f2('0xd')](_0x103214)[_0xa0f2('0xe')](function(_0x125d55){return _0x125d55;});}return null;};}function removeEntity(_0x4b001b){return function(_0x45a229){if(_0x45a229){return _0x45a229[_0xa0f2('0xf')]()[_0xa0f2('0xe')](function(){_0x4b001b[_0xa0f2('0x6')](0xcc)[_0xa0f2('0x10')]();});}};}function handleEntityNotFound(_0x586c61){return function(_0x34645a){if(!_0x34645a){_0x586c61[_0xa0f2('0x11')](0x194);}return _0x34645a;};}function handleError(_0x36d94b,_0x453d56){_0x453d56=_0x453d56||0x1f4;return function(_0x5867d2){logger[_0xa0f2('0x12')](_0x5867d2[_0xa0f2('0x13')]);if(_0x5867d2[_0xa0f2('0x14')]){delete _0x5867d2['name'];}_0x36d94b[_0xa0f2('0x6')](_0x453d56)[_0xa0f2('0x15')](_0x5867d2);};}exports[_0xa0f2('0x16')]=function(_0x14dca2,_0x5c4955){var _0x87dc3={},_0x1975d2={},_0x25dff3={'count':0x0,'rows':[]};var _0x5b42d9=_['map'](db[_0xa0f2('0x17')][_0xa0f2('0x18')],function(_0x412594){return{'name':_0x412594[_0xa0f2('0x19')],'type':_0x412594[_0xa0f2('0x1a')][_0xa0f2('0x1b')]};});_0x1975d2[_0xa0f2('0x1c')]=_['map'](_0x5b42d9,_0xa0f2('0x14'));_0x1975d2[_0xa0f2('0x1d')]=_[_0xa0f2('0x1e')](_0x14dca2[_0xa0f2('0x1d')]);_0x1975d2[_0xa0f2('0x1f')]=_[_0xa0f2('0x20')](_0x1975d2[_0xa0f2('0x1c')],_0x1975d2[_0xa0f2('0x1d')]);_0x87dc3[_0xa0f2('0x21')]=_[_0xa0f2('0x20')](_0x1975d2[_0xa0f2('0x1c')],qs[_0xa0f2('0x22')](_0x14dca2[_0xa0f2('0x1d')]['fields']));_0x87dc3['attributes']=_0x87dc3[_0xa0f2('0x21')]['length']?_0x87dc3[_0xa0f2('0x21')]:_0x1975d2[_0xa0f2('0x1c')];if(!_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x23')]('nolimit')){_0x87dc3[_0xa0f2('0x9')]=qs[_0xa0f2('0x9')](_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x9')]);_0x87dc3['offset']=qs[_0xa0f2('0x8')](_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x8')]);}_0x87dc3['order']=qs[_0xa0f2('0x24')](_0x14dca2[_0xa0f2('0x1d')]['sort']);_0x87dc3[_0xa0f2('0x25')]=qs[_0xa0f2('0x1f')](_[_0xa0f2('0x26')](_0x14dca2['query'],_0x1975d2[_0xa0f2('0x1f')]),_0x5b42d9);if(_0x14dca2['query'][_0xa0f2('0x27')]){_0x87dc3['where']=_[_0xa0f2('0x28')](_0x87dc3[_0xa0f2('0x25')],{'$or':_['map'](_0x5b42d9,function(_0xf31f3a){if(_0xf31f3a['type']!=='VIRTUAL'){var _0x474438={};_0x474438[_0xf31f3a[_0xa0f2('0x14')]]={'$like':'%'+_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x27')]+'%'};return _0x474438;}})});}_0x87dc3=_[_0xa0f2('0x28')]({},_0x87dc3,_0x14dca2[_0xa0f2('0x29')]);var _0x4fd1c3={'where':_0x87dc3[_0xa0f2('0x25')]};return db[_0xa0f2('0x17')][_0xa0f2('0xb')](_0x4fd1c3)[_0xa0f2('0xe')](function(_0x41c8ee){_0x25dff3[_0xa0f2('0xb')]=_0x41c8ee;if(_0x14dca2[_0xa0f2('0x1d')][_0xa0f2('0x2a')]){_0x87dc3[_0xa0f2('0x2b')]=[{'all':!![]}];}return db[_0xa0f2('0x17')][_0xa0f2('0x2c')](_0x87dc3);})['then'](function(_0x409110){_0x25dff3[_0xa0f2('0x2d')]=_0x409110;return _0x25dff3;})[_0xa0f2('0xe')](respondWithFilteredResult(_0x5c4955,_0x87dc3))[_0xa0f2('0x2e')](handleError(_0x5c4955,null));};exports[_0xa0f2('0x2f')]=function(_0x27aa08,_0x17dd50){var _0x2a1303={'raw':![],'where':{'id':_0x27aa08['params']['id']}},_0x150714={};_0x150714[_0xa0f2('0x1c')]=_[_0xa0f2('0x1e')](db[_0xa0f2('0x17')][_0xa0f2('0x18')]);_0x150714['query']=_[_0xa0f2('0x1e')](_0x27aa08[_0xa0f2('0x1d')]);_0x150714['filters']=_[_0xa0f2('0x20')](_0x150714[_0xa0f2('0x1c')],_0x150714[_0xa0f2('0x1d')]);_0x2a1303[_0xa0f2('0x21')]=_[_0xa0f2('0x20')](_0x150714[_0xa0f2('0x1c')],qs['fields'](_0x27aa08[_0xa0f2('0x1d')][_0xa0f2('0x22')]));_0x2a1303[_0xa0f2('0x21')]=_0x2a1303[_0xa0f2('0x21')][_0xa0f2('0x30')]?_0x2a1303[_0xa0f2('0x21')]:_0x150714[_0xa0f2('0x1c')];if(_0x27aa08[_0xa0f2('0x1d')][_0xa0f2('0x2a')]){_0x2a1303[_0xa0f2('0x2b')]=[{'all':!![]}];}_0x2a1303=_[_0xa0f2('0x28')]({},_0x2a1303,_0x27aa08[_0xa0f2('0x29')]);return db[_0xa0f2('0x17')][_0xa0f2('0x31')](_0x2a1303)['then'](handleEntityNotFound(_0x17dd50,null))['then'](respondWithResult(_0x17dd50,null))[_0xa0f2('0x2e')](handleError(_0x17dd50,null));};exports[_0xa0f2('0x32')]=function(_0x414565,_0x1af84f){return db[_0xa0f2('0x17')][_0xa0f2('0x32')](_0x414565[_0xa0f2('0x33')],{})[_0xa0f2('0xe')](respondWithResult(_0x1af84f,0xc9))['catch'](handleError(_0x1af84f,null));};exports[_0xa0f2('0xd')]=function(_0x1a2c47,_0x226d01){if(_0x1a2c47[_0xa0f2('0x33')]['id']){delete _0x1a2c47['body']['id'];}return db[_0xa0f2('0x17')][_0xa0f2('0x31')]({'where':{'id':_0x1a2c47['params']['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0x226d01,null))[_0xa0f2('0xe')](saveUpdates(_0x1a2c47[_0xa0f2('0x33')],null))[_0xa0f2('0xe')](respondWithResult(_0x226d01,null))['catch'](handleError(_0x226d01,null));};exports['destroy']=function(_0x316658,_0x6990c6){return db[_0xa0f2('0x17')][_0xa0f2('0x31')]({'where':{'id':_0x316658[_0xa0f2('0x34')]['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0x6990c6,null))['then'](removeEntity(_0x6990c6,null))[_0xa0f2('0x2e')](handleError(_0x6990c6,null));};exports[_0xa0f2('0x35')]=function(_0x288a41,_0x199225){var _0x536201={};var _0x584cd5={};var _0x18b256;var _0x2ec6c1;return db[_0xa0f2('0x17')][_0xa0f2('0x36')]({'where':{'id':_0x288a41[_0xa0f2('0x34')]['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0x199225,null))[_0xa0f2('0xe')](function(_0x4d1495){if(_0x4d1495){_0x18b256=_0x4d1495;_0x584cd5[_0xa0f2('0x1c')]=_['keys'](db[_0xa0f2('0x37')][_0xa0f2('0x18')]);_0x584cd5[_0xa0f2('0x1d')]=_['keys'](_0x288a41[_0xa0f2('0x1d')]);_0x584cd5['filters']=_[_0xa0f2('0x20')](_0x584cd5[_0xa0f2('0x1c')],_0x584cd5[_0xa0f2('0x1d')]);_0x536201[_0xa0f2('0x21')]=_[_0xa0f2('0x20')](_0x584cd5[_0xa0f2('0x1c')],qs[_0xa0f2('0x22')](_0x288a41['query'][_0xa0f2('0x22')]));_0x536201[_0xa0f2('0x21')]=_0x536201[_0xa0f2('0x21')][_0xa0f2('0x30')]?_0x536201[_0xa0f2('0x21')]:_0x584cd5[_0xa0f2('0x1c')];_0x536201[_0xa0f2('0x38')]=qs['sort'](_0x288a41['query'][_0xa0f2('0x24')]);_0x536201['where']=qs[_0xa0f2('0x1f')](_['pick'](_0x288a41[_0xa0f2('0x1d')],_0x584cd5[_0xa0f2('0x1f')]));if(_0x288a41['query'][_0xa0f2('0x27')]){_0x536201[_0xa0f2('0x25')]=_[_0xa0f2('0x28')](_0x536201[_0xa0f2('0x25')],{'$or':_[_0xa0f2('0x39')](_0x536201[_0xa0f2('0x21')],function(_0x480710){var _0x3dc141={};_0x3dc141[_0x480710]={'$like':'%'+_0x288a41['query'][_0xa0f2('0x27')]+'%'};return _0x3dc141;})});}_0x536201=_[_0xa0f2('0x28')]({},_0x536201,_0x288a41[_0xa0f2('0x29')]);return _0x18b256[_0xa0f2('0x35')](_0x536201);}})[_0xa0f2('0xe')](function(_0x24655a){if(_0x24655a){_0x2ec6c1=_0x24655a[_0xa0f2('0x30')];if(!_0x288a41[_0xa0f2('0x1d')]['hasOwnProperty']('nolimit')){_0x536201[_0xa0f2('0x9')]=qs[_0xa0f2('0x9')](_0x288a41['query'][_0xa0f2('0x9')]);_0x536201[_0xa0f2('0x8')]=qs['offset'](_0x288a41[_0xa0f2('0x1d')][_0xa0f2('0x8')]);}return _0x18b256['getConfigurations'](_0x536201);}})[_0xa0f2('0xe')](function(_0x4837bf){if(_0x4837bf){return _0x4837bf?{'count':_0x2ec6c1,'rows':_0x4837bf}:null;}})[_0xa0f2('0xe')](respondWithResult(_0x199225,null))[_0xa0f2('0x2e')](handleError(_0x199225,null));};exports[_0xa0f2('0x3a')]=function(_0x418ae6,_0xdfa027){if(_0x418ae6['body']['id']){delete _0x418ae6['body']['id'];}return db[_0xa0f2('0x17')]['findOne']({'where':{'id':_0x418ae6[_0xa0f2('0x34')]['id']}})[_0xa0f2('0xe')](handleEntityNotFound(_0xdfa027,null))[_0xa0f2('0xe')](function(_0x3e6ea0){if(_0x3e6ea0){_0x418ae6[_0xa0f2('0x33')][_0xa0f2('0x3b')]=_0x3e6ea0['id'];_0x418ae6['body'][_0xa0f2('0x3c')]=integrations[_0xa0f2('0x3d')](_0x418ae6['body'][_0xa0f2('0x3e')],_0x418ae6[_0xa0f2('0x33')]['type']);_0x418ae6[_0xa0f2('0x33')]['Descriptions']=integrations[_0xa0f2('0x3f')](_0x418ae6[_0xa0f2('0x33')]['channel'],_0x418ae6[_0xa0f2('0x33')][_0xa0f2('0x1a')]);return db['Dynamics365Configuration']['create'](_0x418ae6[_0xa0f2('0x33')],{'include':[{'model':db[_0xa0f2('0x40')],'as':'Subjects'},{'model':db['Dynamics365Field'],'as':_0xa0f2('0x41')}]});}return null;})[_0xa0f2('0xe')](respondWithResult(_0xdfa027,null))['catch'](handleError(_0xdfa027,null));};function sanitizeRemoteUri(_0x34d634){var _0x56c2e6=_0x34d634[_0xa0f2('0x42')](-0x1);if(_0x56c2e6==='/')return _0x34d634['substring'](0x0,_0x34d634[_0xa0f2('0x43')](_0x56c2e6));return _0x34d634;}function getWebApiUrl(_0xcc957c){return util['format'](_0xa0f2('0x44'),_0xcc957c);}exports['getFields']=function(_0x1e20c1,_0x533f41){var _0x27aea3=_0x1e20c1[_0xa0f2('0x1d')]['ticketType'];var _0x592c33=_0x27aea3===_0xa0f2('0x45')?_0xa0f2('0x46'):'PhoneCall';var _0x1a9f86='';var _0x21b1d5='';var _0x443924='';var _0x4a76e7='';var _0x588188='';var _0x24eedb='';var _0x329586='';var _0x1a3b74='';var _0x2eda05=['title',_0xa0f2('0x47'),_0xa0f2('0x48'),'ownerid',_0xa0f2('0x49'),_0xa0f2('0x4a'),_0xa0f2('0x4b'),_0xa0f2('0x4c'),'directioncode',_0xa0f2('0x4d')];var _0x6581ae=[_0xa0f2('0x4e'),_0xa0f2('0x4f'),_0xa0f2('0x50'),'billedserviceunits',_0xa0f2('0x51'),_0xa0f2('0x52'),'contractdetailidname',_0xa0f2('0x53'),_0xa0f2('0x54'),_0xa0f2('0x55'),_0xa0f2('0x56'),'createdbyyominame',_0xa0f2('0x57'),_0xa0f2('0x58'),'createdonbehalfbyyominame',_0xa0f2('0x59'),_0xa0f2('0x5a'),_0xa0f2('0x5b'),'emailaddress',_0xa0f2('0x5c'),_0xa0f2('0x5d'),_0xa0f2('0x5e'),'escalatedon','exchangerate','firstresponsebykpiidname',_0xa0f2('0x5f'),_0xa0f2('0x60'),'influencescore',_0xa0f2('0x61'),_0xa0f2('0x62'),_0xa0f2('0x63'),_0xa0f2('0x64'),_0xa0f2('0x65'),_0xa0f2('0x66'),_0xa0f2('0x67'),'modifiedon',_0xa0f2('0x68'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xa0f2('0x69'),_0xa0f2('0x6a'),'onholdtime',_0xa0f2('0x6b'),_0xa0f2('0x6c'),_0xa0f2('0x6d'),_0xa0f2('0x6e'),'parentcaseidname','primarycontactidname',_0xa0f2('0x6f'),_0xa0f2('0x70'),_0xa0f2('0x71'),'productserialnumber',_0xa0f2('0x72'),_0xa0f2('0x73'),_0xa0f2('0x74'),'responsiblecontactidname',_0xa0f2('0x75'),_0xa0f2('0x76'),_0xa0f2('0x77'),_0xa0f2('0x78'),_0xa0f2('0x79'),_0xa0f2('0x7a'),_0xa0f2('0x7b'),_0xa0f2('0x7c'),_0xa0f2('0x7d'),_0xa0f2('0x7e'),_0xa0f2('0x7f'),'traversedpath',_0xa0f2('0x80'),_0xa0f2('0x81')];var _0x1a0811=_0x2eda05[_0xa0f2('0x82')](_0x6581ae);return db['Dynamics365Account'][_0xa0f2('0x36')]({'where':{'id':_0x1e20c1['params']['id']},'attributes':['id',_0xa0f2('0x83'),_0xa0f2('0x84'),_0xa0f2('0x85'),_0xa0f2('0x86'),'clientId',_0xa0f2('0x87'),'modernAuthentication'],'include':[{'model':db[_0xa0f2('0x88')],'as':_0xa0f2('0x88'),'attributes':['id',_0xa0f2('0x89'),'data7']}]})['then'](handleEntityNotFound(_0x533f41,null))[_0xa0f2('0xe')](function(_0x28b877){if(_0x28b877){if(_0x28b877['modernAuthentication']){_0x28b877[_0xa0f2('0x8a')]=_0x28b877[_0xa0f2('0x88')][_0xa0f2('0x89')];_0x1a3b74=sanitizeRemoteUri(_0x28b877[_0xa0f2('0x88')][_0xa0f2('0x8b')]);_0x329586=getWebApiUrl(_0x1a3b74);return _0x28b877;}_0x1a3b74=sanitizeRemoteUri(_0x28b877[_0xa0f2('0x85')]);_0x329586=getWebApiUrl(_0x1a3b74);var _0x54aebe={'method':_0xa0f2('0x8c'),'uri':_0xa0f2('0x8d')+_0x28b877[_0xa0f2('0x86')]+'/oauth2/token','form':{'client_id':_0x28b877[_0xa0f2('0x8e')],'resource':_0x1a3b74,'username':_0x28b877[_0xa0f2('0x83')],'password':_0x28b877['password'],'grant_type':'password','client_secret':_0x28b877[_0xa0f2('0x87')]},'json':!![]};return rp(_0x54aebe);}})['then'](function(_0x19a2c0){_0x24eedb=_0x19a2c0['access_token'];var _0x35cb15={'method':_0xa0f2('0x8f'),'uri':encodeURI(_0x329586+_0xa0f2('0x90')+_0x592c33+'\x27'),'headers':{'Authorization':_0xa0f2('0x91')+_0x24eedb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x35cb15);})[_0xa0f2('0xe')](function(_0x2b1576){var _0x1f4cf0=_0x2b1576[_0xa0f2('0x92')][0x0];var _0x443477=_0x1f4cf0['MetadataId'];var _0x42a900={'method':_0xa0f2('0x8f'),'uri':_0x329586+_0xa0f2('0x93')+_0x443477+_0xa0f2('0x94'),'headers':{'Authorization':_0xa0f2('0x91')+_0x24eedb,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x42a900);})[_0xa0f2('0xe')](function(_0x33fab1){_0x1a9f86=_0x33fab1;_0x21b1d5=_0x1a9f86[_0xa0f2('0x96')];_0x21b1d5=_[_0xa0f2('0x97')](_0x21b1d5,function(_0x4e8648){return!_0x1a0811[_0xa0f2('0x98')](_0x4e8648[_0xa0f2('0x99')]);});var _0x53cf2e=[];var _0x45c589=[];_0x21b1d5[_0xa0f2('0x9a')](function(_0x444a69){if(_0x444a69['@odata.type']){var _0x206f03=_0x444a69[_0xa0f2('0x9b')][_0xa0f2('0x9c')](_0x444a69[_0xa0f2('0x9b')][_0xa0f2('0x43')]('.')+0x1);if(_0x206f03===_0xa0f2('0x9d')){_0x53cf2e[_0xa0f2('0x9e')](getSelectList(_0x329586,_0x27aea3,_0x45c589,_0x1a9f86['MetadataId'],_0x444a69[_0xa0f2('0x9f')],_0x24eedb));}}});return Promise[_0xa0f2('0xa0')](_0x53cf2e);})[_0xa0f2('0xe')](function(_0x40bb73){_0x443924=_0x40bb73[0x0];var _0x6baae7=[];var _0x425006=[];_0x21b1d5['forEach'](function(_0x6a16b5){if(!_[_0xa0f2('0xa1')](_0x6a16b5[_0xa0f2('0x9b')])){var _0x592dec=_0x6a16b5['@odata.type'][_0xa0f2('0x9c')](_0x6a16b5[_0xa0f2('0x9b')]['lastIndexOf']('.')+0x1);if(_0x592dec===_0xa0f2('0xa2')){_0x6baae7[_0xa0f2('0x9e')](getBooleanList(_0x329586,_0x27aea3,_0x425006,_0x1a9f86[_0xa0f2('0x9f')],_0x6a16b5[_0xa0f2('0x9f')],_0x24eedb));}}});return Promise[_0xa0f2('0xa0')](_0x6baae7);})[_0xa0f2('0xe')](function(_0x295415){_0x4a76e7=_0x295415[0x0];var _0x2cd566=[];var _0xac98b4=[];_0x21b1d5[_0xa0f2('0x9a')](function(_0x4f44c7){if(_0x4f44c7['@odata.type']){var _0x404f42=_0x4f44c7[_0xa0f2('0x9b')][_0xa0f2('0x9c')](_0x4f44c7[_0xa0f2('0x9b')][_0xa0f2('0x43')]('.')+0x1);if(_0x404f42===_0xa0f2('0xa3')||_0x404f42==='DoubleAttributeMetadata'||_0x404f42===_0xa0f2('0xa4')||_0x404f42===_0xa0f2('0xa5')||_0x404f42===_0xa0f2('0xa6')||_0x404f42===_0xa0f2('0xa7')||_0x404f42===_0xa0f2('0xa8')||_0x404f42==='EntityNameAttributeMetadata'||_0x404f42===_0xa0f2('0xa9')||_0x404f42===_0xa0f2('0xaa')){_0x2cd566['push'](getInputList(_0x329586,_0x27aea3,_0x404f42,_0xac98b4,_0x1a9f86['MetadataId'],_0x4f44c7[_0xa0f2('0x9f')],_0x24eedb));}}});return Promise[_0xa0f2('0xa0')](_0x2cd566);})['then'](function(_0x4f4091){_0x588188=_0x4f4091[0x0];var _0x47cd78=_0x443924[_0xa0f2('0x82')](_0x4a76e7)[_0xa0f2('0x82')](_0x588188);var _0x1b7cd1={'count':_0x47cd78['length'],'rows':_0x47cd78};return _0x1b7cd1;})['then'](respondWithResult(_0x533f41,null))[_0xa0f2('0x2e')](function(_0x84e03f){var _0x34435c=_0x1e20c1[_0xa0f2('0x1d')][_0xa0f2('0xab')]?0x1f4:_0x84e03f[_0xa0f2('0xac')]||0x1f4;logger[_0xa0f2('0x12')](_0x84e03f[_0xa0f2('0x13')]);delete _0x84e03f[_0xa0f2('0x14')];if(_0x34435c===0x191){_0x34435c=0x190;}_0x533f41[_0xa0f2('0x6')](_0x34435c)[_0xa0f2('0x15')](_0x1e20c1[_0xa0f2('0x1d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x84e03f['statusCode']}:_0x84e03f);});};function getSelectList(_0x22492d,_0x572faa,_0x329255,_0x53c439,_0x41747b,_0x4fe825){var _0x11392f={'method':_0xa0f2('0x8f'),'uri':_0x22492d+_0xa0f2('0x93')+_0x53c439+_0xa0f2('0xad')+_0x41747b+_0xa0f2('0xae')+_0xa0f2('0xaf'),'headers':{'Authorization':_0xa0f2('0x91')+_0x4fe825,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x11392f)['then'](function(_0x16e082){var _0x12a062=[];var _0x78e63c=_0x16e082[_0xa0f2('0xb0')][_0xa0f2('0xb1')];_0x78e63c[_0xa0f2('0x9a')](function(_0x3b4e7e){_0x12a062[_0xa0f2('0x9e')]({'name':_0x3b4e7e['Label'][_0xa0f2('0xb2')][_0xa0f2('0xb3')],'value':String(_0x3b4e7e['Value'])});});var _0x33799e={'id':_0x572faa+'_'+_0x16e082['LogicalName'],'name':_0x16e082['DisplayName'][_0xa0f2('0xb2')][_0xa0f2('0xb3')],'custom':![],'options':_0x12a062};_0x329255[_0xa0f2('0x9e')](_0x33799e);return _0x329255;});}function getBooleanList(_0x45d817,_0x3b3847,_0x20bccd,_0x19fd25,_0x168a8f,_0x23e381){var _0x261aef={'method':_0xa0f2('0x8f'),'uri':_0x45d817+_0xa0f2('0x93')+_0x19fd25+_0xa0f2('0xad')+_0x168a8f+_0xa0f2('0xb4'),'headers':{'Authorization':'Bearer\x20'+_0x23e381,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x261aef)['then'](function(_0x27554e){var _0x264efc=[];_0x264efc[_0xa0f2('0x9e')]({'name':_0x27554e['OptionSet'][_0xa0f2('0xb5')][_0xa0f2('0xb3')][_0xa0f2('0xb2')]['Label'],'value':_0xa0f2('0xb6')},{'name':_0x27554e[_0xa0f2('0xb0')][_0xa0f2('0xb7')][_0xa0f2('0xb3')][_0xa0f2('0xb2')]['Label'],'value':'false'});var _0x58c981={'id':_0x3b3847+'_'+_0x27554e[_0xa0f2('0x99')],'name':_0x27554e['DisplayName'][_0xa0f2('0xb2')][_0xa0f2('0xb3')],'custom':![],'options':_0x264efc};_0x20bccd[_0xa0f2('0x9e')](_0x58c981);return _0x20bccd;});}function getInputList(_0x176361,_0x17225c,_0x58d606,_0x37aa6f,_0x163a2e,_0x32c6ff,_0xedaa13){var _0x54da47={'method':_0xa0f2('0x8f'),'uri':_0x176361+'EntityDefinitions('+_0x163a2e+_0xa0f2('0xad')+_0x32c6ff+')/Microsoft.Dynamics.CRM.'+_0x58d606+_0xa0f2('0xb8'),'headers':{'Authorization':_0xa0f2('0x91')+_0xedaa13,'If-None-Match':null,'OData-Version':_0xa0f2('0x95')},'json':!![]};return rp(_0x54da47)[_0xa0f2('0xe')](function(_0x2c10ee){var _0x4af5d5={'id':_0x17225c+'_'+_0x2c10ee[_0xa0f2('0x99')],'name':_0x2c10ee['DisplayName']['UserLocalizedLabel']?_0x2c10ee[_0xa0f2('0xb9')][_0xa0f2('0xb2')][_0xa0f2('0xb3')]:_0x2c10ee['LogicalName'],'custom':![],'options':[]};_0x37aa6f[_0xa0f2('0x9e')](_0x4af5d5);return _0x37aa6f;});}
\ No newline at end of file
+var _0xb939=['BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','status','send','index','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getConfigurations','Dynamics365Configuration','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Dynamics365Field','Descriptions','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidyominame','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','clientId','clientSecret','modernAuthentication','CloudProvider','access_token','data5','data7','POST','/oauth2/token','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','StringAttributeMetadata'];(function(_0x42c806,_0x5447ac){var _0x4152ba=function(_0x5733ce){while(--_0x5733ce){_0x42c806['push'](_0x42c806['shift']());}};_0x4152ba(++_0x5447ac);}(_0xb939,0xd2));var _0x9b93=function(_0x5d8941,_0x7f85f){_0x5d8941=_0x5d8941-0x0;var _0x7e8d7=_0xb939[_0x5d8941];return _0x7e8d7;};'use strict';var rp=require('request-promise');var util=require(_0x9b93('0x0'));var _=require('lodash');var qs=require(_0x9b93('0x1'));var logger=require(_0x9b93('0x2'))(_0x9b93('0x3'));var db=require(_0x9b93('0x4'))['db'];var integrations=require(_0x9b93('0x5'));function respondWithResult(_0x22865c,_0x5c8829){_0x5c8829=_0x5c8829||0xc8;return function(_0x4bf7eb){if(_0x4bf7eb){return _0x22865c['status'](_0x5c8829)[_0x9b93('0x6')](_0x4bf7eb);}};}function respondWithFilteredResult(_0x2df05a,_0x59c94d){return function(_0x1a447d){if(_0x1a447d){var _0x3d6df5=typeof _0x59c94d[_0x9b93('0x7')]===_0x9b93('0x8')&&typeof _0x59c94d[_0x9b93('0x9')]==='undefined';var _0x1462c9=_0x1a447d[_0x9b93('0xa')];var _0x178f3d=_0x3d6df5?0x0:_0x59c94d[_0x9b93('0x7')];var _0x276c7d=_0x3d6df5?_0x1a447d[_0x9b93('0xa')]:_0x59c94d[_0x9b93('0x7')]+_0x59c94d[_0x9b93('0x9')];var _0x538bd0;if(_0x276c7d>=_0x1462c9){_0x276c7d=_0x1462c9;_0x538bd0=0xc8;}else{_0x538bd0=0xce;}_0x2df05a['status'](_0x538bd0);return _0x2df05a[_0x9b93('0xb')](_0x9b93('0xc'),_0x178f3d+'-'+_0x276c7d+'/'+_0x1462c9)[_0x9b93('0x6')](_0x1a447d);}return null;};}function saveUpdates(_0x309c1d){return function(_0x220c33){if(_0x220c33){return _0x220c33[_0x9b93('0xd')](_0x309c1d)['then'](function(_0x535bdd){return _0x535bdd;});}return null;};}function removeEntity(_0x5efe47){return function(_0x599858){if(_0x599858){return _0x599858['destroy']()[_0x9b93('0xe')](function(){_0x5efe47['status'](0xcc)[_0x9b93('0xf')]();});}};}function handleEntityNotFound(_0x4667f9){return function(_0x4d4df2){if(!_0x4d4df2){_0x4667f9[_0x9b93('0x10')](0x194);}return _0x4d4df2;};}function handleError(_0xd1fbb9,_0x10e6e0){_0x10e6e0=_0x10e6e0||0x1f4;return function(_0x13e2d2){logger[_0x9b93('0x11')](_0x13e2d2[_0x9b93('0x12')]);if(_0x13e2d2[_0x9b93('0x13')]){delete _0x13e2d2[_0x9b93('0x13')];}_0xd1fbb9[_0x9b93('0x14')](_0x10e6e0)[_0x9b93('0x15')](_0x13e2d2);};}exports[_0x9b93('0x16')]=function(_0x92f59c,_0x5498bd){var _0xa19ee5={},_0x254b9d={},_0xfe47b7={'count':0x0,'rows':[]};var _0x47496c=_['map'](db[_0x9b93('0x17')][_0x9b93('0x18')],function(_0x1e9d73){return{'name':_0x1e9d73[_0x9b93('0x19')],'type':_0x1e9d73[_0x9b93('0x1a')]['key']};});_0x254b9d[_0x9b93('0x1b')]=_['map'](_0x47496c,_0x9b93('0x13'));_0x254b9d[_0x9b93('0x1c')]=_[_0x9b93('0x1d')](_0x92f59c[_0x9b93('0x1c')]);_0x254b9d[_0x9b93('0x1e')]=_[_0x9b93('0x1f')](_0x254b9d['model'],_0x254b9d[_0x9b93('0x1c')]);_0xa19ee5['attributes']=_['intersection'](_0x254b9d[_0x9b93('0x1b')],qs[_0x9b93('0x20')](_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x20')]));_0xa19ee5[_0x9b93('0x21')]=_0xa19ee5[_0x9b93('0x21')]['length']?_0xa19ee5[_0x9b93('0x21')]:_0x254b9d[_0x9b93('0x1b')];if(!_0x92f59c['query'][_0x9b93('0x22')]('nolimit')){_0xa19ee5[_0x9b93('0x9')]=qs['limit'](_0x92f59c[_0x9b93('0x1c')]['limit']);_0xa19ee5[_0x9b93('0x7')]=qs[_0x9b93('0x7')](_0x92f59c[_0x9b93('0x1c')]['offset']);}_0xa19ee5[_0x9b93('0x23')]=qs[_0x9b93('0x24')](_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x24')]);_0xa19ee5[_0x9b93('0x25')]=qs[_0x9b93('0x1e')](_[_0x9b93('0x26')](_0x92f59c[_0x9b93('0x1c')],_0x254b9d['filters']),_0x47496c);if(_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x27')]){_0xa19ee5[_0x9b93('0x25')]=_[_0x9b93('0x28')](_0xa19ee5[_0x9b93('0x25')],{'$or':_[_0x9b93('0x29')](_0x47496c,function(_0x43a6a5){if(_0x43a6a5[_0x9b93('0x1a')]!=='VIRTUAL'){var _0x3d5f33={};_0x3d5f33[_0x43a6a5[_0x9b93('0x13')]]={'$like':'%'+_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x27')]+'%'};return _0x3d5f33;}})});}_0xa19ee5=_[_0x9b93('0x28')]({},_0xa19ee5,_0x92f59c[_0x9b93('0x2a')]);var _0x12619e={'where':_0xa19ee5[_0x9b93('0x25')]};return db[_0x9b93('0x17')]['count'](_0x12619e)[_0x9b93('0xe')](function(_0x3d5a5e){_0xfe47b7[_0x9b93('0xa')]=_0x3d5a5e;if(_0x92f59c[_0x9b93('0x1c')][_0x9b93('0x2b')]){_0xa19ee5[_0x9b93('0x2c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x9b93('0x2d')](_0xa19ee5);})[_0x9b93('0xe')](function(_0x302118){_0xfe47b7[_0x9b93('0x2e')]=_0x302118;return _0xfe47b7;})[_0x9b93('0xe')](respondWithFilteredResult(_0x5498bd,_0xa19ee5))[_0x9b93('0x2f')](handleError(_0x5498bd,null));};exports[_0x9b93('0x30')]=function(_0x25af44,_0x20e252){var _0x1d1376={'raw':![],'where':{'id':_0x25af44[_0x9b93('0x31')]['id']}},_0x3c3d2a={};_0x3c3d2a[_0x9b93('0x1b')]=_[_0x9b93('0x1d')](db[_0x9b93('0x17')][_0x9b93('0x18')]);_0x3c3d2a[_0x9b93('0x1c')]=_[_0x9b93('0x1d')](_0x25af44['query']);_0x3c3d2a[_0x9b93('0x1e')]=_[_0x9b93('0x1f')](_0x3c3d2a[_0x9b93('0x1b')],_0x3c3d2a[_0x9b93('0x1c')]);_0x1d1376[_0x9b93('0x21')]=_[_0x9b93('0x1f')](_0x3c3d2a['model'],qs[_0x9b93('0x20')](_0x25af44['query'][_0x9b93('0x20')]));_0x1d1376[_0x9b93('0x21')]=_0x1d1376[_0x9b93('0x21')][_0x9b93('0x32')]?_0x1d1376[_0x9b93('0x21')]:_0x3c3d2a[_0x9b93('0x1b')];if(_0x25af44[_0x9b93('0x1c')][_0x9b93('0x2b')]){_0x1d1376[_0x9b93('0x2c')]=[{'all':!![]}];}_0x1d1376=_[_0x9b93('0x28')]({},_0x1d1376,_0x25af44['options']);return db[_0x9b93('0x17')][_0x9b93('0x33')](_0x1d1376)[_0x9b93('0xe')](handleEntityNotFound(_0x20e252,null))[_0x9b93('0xe')](respondWithResult(_0x20e252,null))[_0x9b93('0x2f')](handleError(_0x20e252,null));};exports[_0x9b93('0x34')]=function(_0x859d85,_0x2b00ec){return db[_0x9b93('0x17')][_0x9b93('0x34')](_0x859d85['body'],{})[_0x9b93('0xe')](respondWithResult(_0x2b00ec,0xc9))['catch'](handleError(_0x2b00ec,null));};exports[_0x9b93('0xd')]=function(_0x1c4422,_0x4fd249){if(_0x1c4422[_0x9b93('0x35')]['id']){delete _0x1c4422['body']['id'];}return db[_0x9b93('0x17')]['find']({'where':{'id':_0x1c4422[_0x9b93('0x31')]['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x4fd249,null))[_0x9b93('0xe')](saveUpdates(_0x1c4422[_0x9b93('0x35')],null))['then'](respondWithResult(_0x4fd249,null))[_0x9b93('0x2f')](handleError(_0x4fd249,null));};exports[_0x9b93('0x36')]=function(_0x436081,_0x58ae72){return db[_0x9b93('0x17')]['find']({'where':{'id':_0x436081['params']['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x58ae72,null))[_0x9b93('0xe')](removeEntity(_0x58ae72,null))['catch'](handleError(_0x58ae72,null));};exports[_0x9b93('0x37')]=function(_0x17a74d,_0x41fbc6){var _0x2c941a={};var _0x39a494={};var _0x409b72;var _0xa476d4;return db['Dynamics365Account']['findOne']({'where':{'id':_0x17a74d[_0x9b93('0x31')]['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x41fbc6,null))[_0x9b93('0xe')](function(_0x30f2e5){if(_0x30f2e5){_0x409b72=_0x30f2e5;_0x39a494[_0x9b93('0x1b')]=_['keys'](db[_0x9b93('0x38')][_0x9b93('0x18')]);_0x39a494['query']=_[_0x9b93('0x1d')](_0x17a74d[_0x9b93('0x1c')]);_0x39a494[_0x9b93('0x1e')]=_['intersection'](_0x39a494[_0x9b93('0x1b')],_0x39a494['query']);_0x2c941a['attributes']=_[_0x9b93('0x1f')](_0x39a494[_0x9b93('0x1b')],qs['fields'](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x20')]));_0x2c941a[_0x9b93('0x21')]=_0x2c941a['attributes'][_0x9b93('0x32')]?_0x2c941a[_0x9b93('0x21')]:_0x39a494['model'];_0x2c941a[_0x9b93('0x23')]=qs[_0x9b93('0x24')](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x24')]);_0x2c941a[_0x9b93('0x25')]=qs[_0x9b93('0x1e')](_[_0x9b93('0x26')](_0x17a74d[_0x9b93('0x1c')],_0x39a494[_0x9b93('0x1e')]));if(_0x17a74d['query'][_0x9b93('0x27')]){_0x2c941a[_0x9b93('0x25')]=_['merge'](_0x2c941a['where'],{'$or':_[_0x9b93('0x29')](_0x2c941a['attributes'],function(_0x2649c8){var _0x491eec={};_0x491eec[_0x2649c8]={'$like':'%'+_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x27')]+'%'};return _0x491eec;})});}_0x2c941a=_[_0x9b93('0x28')]({},_0x2c941a,_0x17a74d[_0x9b93('0x2a')]);return _0x409b72[_0x9b93('0x37')](_0x2c941a);}})[_0x9b93('0xe')](function(_0x16ba07){if(_0x16ba07){_0xa476d4=_0x16ba07[_0x9b93('0x32')];if(!_0x17a74d[_0x9b93('0x1c')]['hasOwnProperty'](_0x9b93('0x39'))){_0x2c941a[_0x9b93('0x9')]=qs[_0x9b93('0x9')](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x9')]);_0x2c941a[_0x9b93('0x7')]=qs[_0x9b93('0x7')](_0x17a74d[_0x9b93('0x1c')][_0x9b93('0x7')]);}return _0x409b72[_0x9b93('0x37')](_0x2c941a);}})['then'](function(_0x3595bd){if(_0x3595bd){return _0x3595bd?{'count':_0xa476d4,'rows':_0x3595bd}:null;}})['then'](respondWithResult(_0x41fbc6,null))[_0x9b93('0x2f')](handleError(_0x41fbc6,null));};exports[_0x9b93('0x3a')]=function(_0x11f8a7,_0x312d21){if(_0x11f8a7[_0x9b93('0x35')]['id']){delete _0x11f8a7[_0x9b93('0x35')]['id'];}return db[_0x9b93('0x17')][_0x9b93('0x3b')]({'where':{'id':_0x11f8a7['params']['id']}})[_0x9b93('0xe')](handleEntityNotFound(_0x312d21,null))[_0x9b93('0xe')](function(_0x57737e){if(_0x57737e){_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x3c')]=_0x57737e['id'];_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x3d')]=integrations[_0x9b93('0x3e')](_0x11f8a7[_0x9b93('0x35')]['channel'],_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x1a')]);_0x11f8a7[_0x9b93('0x35')]['Descriptions']=integrations['getDescriptions'](_0x11f8a7[_0x9b93('0x35')]['channel'],_0x11f8a7[_0x9b93('0x35')][_0x9b93('0x1a')]);return db[_0x9b93('0x38')][_0x9b93('0x34')](_0x11f8a7['body'],{'include':[{'model':db[_0x9b93('0x3f')],'as':_0x9b93('0x3d')},{'model':db[_0x9b93('0x3f')],'as':_0x9b93('0x40')}]});}return null;})['then'](respondWithResult(_0x312d21,null))[_0x9b93('0x2f')](handleError(_0x312d21,null));};function sanitizeRemoteUri(_0x3d173b){var _0x5646d8=_0x3d173b[_0x9b93('0x41')](-0x1);if(_0x5646d8==='/')return _0x3d173b[_0x9b93('0x42')](0x0,_0x3d173b[_0x9b93('0x43')](_0x5646d8));return _0x3d173b;}function getWebApiUrl(_0x50ec3f){return util[_0x9b93('0x44')](_0x9b93('0x45'),_0x50ec3f);}exports[_0x9b93('0x46')]=function(_0x54251b,_0x5e0f4e){var _0x3e550b=_0x54251b[_0x9b93('0x1c')][_0x9b93('0x47')];var _0x2eb55d=_0x3e550b===_0x9b93('0x48')?_0x9b93('0x49'):_0x9b93('0x4a');var _0x4a9044='';var _0x587445='';var _0x4388b6='';var _0x4f9a65='';var _0x14665f='';var _0x313cf8='';var _0x14a864='';var _0x136152='';var _0x124339=['title',_0x9b93('0x4b'),_0x9b93('0x4c'),'ownerid',_0x9b93('0x4d'),_0x9b93('0x4e'),'phonenumber',_0x9b93('0x4f'),_0x9b93('0x50'),'phonecall_activity_parties'];var _0x3d8804=['accountidname','accountidyominame',_0x9b93('0x51'),_0x9b93('0x52'),'contactidname',_0x9b93('0x53'),_0x9b93('0x54'),_0x9b93('0x55'),_0x9b93('0x56'),_0x9b93('0x57'),'createdbyname','createdbyyominame',_0x9b93('0x58'),'createdonbehalfbyname',_0x9b93('0x59'),_0x9b93('0x5a'),'customeridtype',_0x9b93('0x5b'),_0x9b93('0x5c'),'entitlementidname',_0x9b93('0x5d'),_0x9b93('0x5e'),_0x9b93('0x5f'),_0x9b93('0x60'),_0x9b93('0x61'),_0x9b93('0x62'),_0x9b93('0x63'),_0x9b93('0x64'),_0x9b93('0x65'),'lastonholdtime',_0x9b93('0x66'),_0x9b93('0x67'),_0x9b93('0x68'),_0x9b93('0x69'),_0x9b93('0x6a'),_0x9b93('0x6b'),_0x9b93('0x6c'),_0x9b93('0x6d'),_0x9b93('0x6e'),_0x9b93('0x6f'),'numberofchildincidents','onholdtime',_0x9b93('0x70'),_0x9b93('0x71'),_0x9b93('0x72'),_0x9b93('0x73'),'parentcaseidname','primarycontactidname',_0x9b93('0x74'),'prioritycodename',_0x9b93('0x75'),_0x9b93('0x76'),_0x9b93('0x77'),_0x9b93('0x78'),'responseby',_0x9b93('0x79'),_0x9b93('0x7a'),'sentimentvalue','slainvokedidname',_0x9b93('0x7b'),_0x9b93('0x7c'),_0x9b93('0x7d'),'statuscode','subjectidname',_0x9b93('0x7e'),_0x9b93('0x7f'),_0x9b93('0x80'),'traversedpath',_0x9b93('0x81'),_0x9b93('0x82')];var _0x328b10=_0x124339[_0x9b93('0x83')](_0x3d8804);return db[_0x9b93('0x17')][_0x9b93('0x3b')]({'where':{'id':_0x54251b[_0x9b93('0x31')]['id']},'attributes':['id',_0x9b93('0x84'),_0x9b93('0x85'),'remoteUri','tenantId',_0x9b93('0x86'),_0x9b93('0x87'),_0x9b93('0x88')],'include':[{'model':db[_0x9b93('0x89')],'as':_0x9b93('0x89'),'attributes':['id','data5','data7']}]})['then'](handleEntityNotFound(_0x5e0f4e,null))[_0x9b93('0xe')](function(_0x2a00f5){if(_0x2a00f5){if(_0x2a00f5[_0x9b93('0x88')]){_0x2a00f5[_0x9b93('0x8a')]=_0x2a00f5[_0x9b93('0x89')][_0x9b93('0x8b')];_0x136152=sanitizeRemoteUri(_0x2a00f5[_0x9b93('0x89')][_0x9b93('0x8c')]);_0x14a864=getWebApiUrl(_0x136152);return _0x2a00f5;}_0x136152=sanitizeRemoteUri(_0x2a00f5['remoteUri']);_0x14a864=getWebApiUrl(_0x136152);var _0x137ab6={'method':_0x9b93('0x8d'),'uri':'https://login.microsoftonline.com/'+_0x2a00f5['tenantId']+_0x9b93('0x8e'),'form':{'client_id':_0x2a00f5[_0x9b93('0x86')],'resource':_0x136152,'username':_0x2a00f5[_0x9b93('0x84')],'password':_0x2a00f5[_0x9b93('0x85')],'grant_type':_0x9b93('0x85'),'client_secret':_0x2a00f5[_0x9b93('0x87')]},'json':!![]};return rp(_0x137ab6);}})[_0x9b93('0xe')](function(_0x4e88d2){_0x313cf8=_0x4e88d2[_0x9b93('0x8a')];var _0x392f43={'method':'GET','uri':encodeURI(_0x14a864+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x2eb55d+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x313cf8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x392f43);})['then'](function(_0x383977){var _0x2db92b=_0x383977[_0x9b93('0x8f')][0x0];var _0x51d974=_0x2db92b[_0x9b93('0x90')];var _0xfe09e6={'method':_0x9b93('0x91'),'uri':_0x14a864+_0x9b93('0x92')+_0x51d974+_0x9b93('0x93'),'headers':{'Authorization':_0x9b93('0x94')+_0x313cf8,'If-None-Match':null,'OData-Version':_0x9b93('0x95')},'json':!![]};return rp(_0xfe09e6);})[_0x9b93('0xe')](function(_0x3721ed){_0x4a9044=_0x3721ed;_0x587445=_0x4a9044[_0x9b93('0x96')];_0x587445=_[_0x9b93('0x97')](_0x587445,function(_0x4d6153){return!_0x328b10[_0x9b93('0x98')](_0x4d6153[_0x9b93('0x99')]);});var _0x324976=[];var _0x23d396=[];_0x587445[_0x9b93('0x9a')](function(_0x20b816){if(_0x20b816['@odata.type']){var _0x4f2d59=_0x20b816[_0x9b93('0x9b')][_0x9b93('0x42')](_0x20b816[_0x9b93('0x9b')][_0x9b93('0x43')]('.')+0x1);if(_0x4f2d59===_0x9b93('0x9c')){_0x324976[_0x9b93('0x9d')](getSelectList(_0x14a864,_0x3e550b,_0x23d396,_0x4a9044[_0x9b93('0x90')],_0x20b816[_0x9b93('0x90')],_0x313cf8));}}});return Promise[_0x9b93('0x9e')](_0x324976);})[_0x9b93('0xe')](function(_0x200e44){_0x4388b6=_0x200e44[0x0];var _0x28bfb1=[];var _0x339d1e=[];_0x587445[_0x9b93('0x9a')](function(_0x4cec10){if(!_['isNil'](_0x4cec10[_0x9b93('0x9b')])){var _0x50fcf0=_0x4cec10[_0x9b93('0x9b')][_0x9b93('0x42')](_0x4cec10[_0x9b93('0x9b')][_0x9b93('0x43')]('.')+0x1);if(_0x50fcf0==='BooleanAttributeMetadata'){_0x28bfb1[_0x9b93('0x9d')](getBooleanList(_0x14a864,_0x3e550b,_0x339d1e,_0x4a9044[_0x9b93('0x90')],_0x4cec10[_0x9b93('0x90')],_0x313cf8));}}});return Promise[_0x9b93('0x9e')](_0x28bfb1);})[_0x9b93('0xe')](function(_0x22897b){_0x4f9a65=_0x22897b[0x0];var _0x382258=[];var _0x162ba3=[];_0x587445[_0x9b93('0x9a')](function(_0x208312){if(_0x208312[_0x9b93('0x9b')]){var _0xd9c6d2=_0x208312['@odata.type']['substring'](_0x208312['@odata.type'][_0x9b93('0x43')]('.')+0x1);if(_0xd9c6d2===_0x9b93('0x9f')||_0xd9c6d2==='DoubleAttributeMetadata'||_0xd9c6d2===_0x9b93('0xa0')||_0xd9c6d2===_0x9b93('0xa1')||_0xd9c6d2===_0x9b93('0xa2')||_0xd9c6d2===_0x9b93('0xa3')||_0xd9c6d2===_0x9b93('0xa4')||_0xd9c6d2==='EntityNameAttributeMetadata'||_0xd9c6d2===_0x9b93('0xa5')||_0xd9c6d2===_0x9b93('0xa6')){_0x382258[_0x9b93('0x9d')](getInputList(_0x14a864,_0x3e550b,_0xd9c6d2,_0x162ba3,_0x4a9044[_0x9b93('0x90')],_0x208312[_0x9b93('0x90')],_0x313cf8));}}});return Promise[_0x9b93('0x9e')](_0x382258);})[_0x9b93('0xe')](function(_0x3757db){_0x14665f=_0x3757db[0x0];var _0x3c9199=_0x4388b6[_0x9b93('0x83')](_0x4f9a65)[_0x9b93('0x83')](_0x14665f);var _0x2efb95={'count':_0x3c9199[_0x9b93('0x32')],'rows':_0x3c9199};return _0x2efb95;})[_0x9b93('0xe')](respondWithResult(_0x5e0f4e,null))['catch'](function(_0x547844){var _0x4dabc0=_0x54251b[_0x9b93('0x1c')][_0x9b93('0xa7')]?0x1f4:_0x547844[_0x9b93('0xa8')]||0x1f4;logger[_0x9b93('0x11')](_0x547844[_0x9b93('0x12')]);delete _0x547844[_0x9b93('0x13')];if(_0x4dabc0===0x191){_0x4dabc0=0x190;}_0x5e0f4e[_0x9b93('0x14')](_0x4dabc0)[_0x9b93('0x15')](_0x54251b[_0x9b93('0x1c')][_0x9b93('0xa7')]?{'message':_0x9b93('0xa9'),'statusCode':_0x547844[_0x9b93('0xa8')]}:_0x547844);});};function getSelectList(_0x541dd5,_0x23a0c2,_0x1f263a,_0x1073d4,_0x1574fc,_0x4d13f8){var _0x10d84d={'method':_0x9b93('0x91'),'uri':_0x541dd5+_0x9b93('0x92')+_0x1073d4+_0x9b93('0xaa')+_0x1574fc+_0x9b93('0xab')+_0x9b93('0xac'),'headers':{'Authorization':_0x9b93('0x94')+_0x4d13f8,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x10d84d)[_0x9b93('0xe')](function(_0x1d1da6){var _0x423ca1=[];var _0x22fed8=_0x1d1da6[_0x9b93('0xad')]['Options'];_0x22fed8['forEach'](function(_0x2fb4e7){_0x423ca1[_0x9b93('0x9d')]({'name':_0x2fb4e7['Label'][_0x9b93('0xae')][_0x9b93('0xaf')],'value':String(_0x2fb4e7[_0x9b93('0xb0')])});});var _0x5d50aa={'id':_0x23a0c2+'_'+_0x1d1da6[_0x9b93('0x99')],'name':_0x1d1da6['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x423ca1};_0x1f263a[_0x9b93('0x9d')](_0x5d50aa);return _0x1f263a;});}function getBooleanList(_0x139d11,_0x5e50f1,_0x58e28d,_0x4e702c,_0x58362a,_0x1f9bdc){var _0x4ad9af={'method':'GET','uri':_0x139d11+_0x9b93('0x92')+_0x4e702c+')/Attributes('+_0x58362a+_0x9b93('0xb1'),'headers':{'Authorization':_0x9b93('0x94')+_0x1f9bdc,'If-None-Match':null,'OData-Version':_0x9b93('0x95')},'json':!![]};return rp(_0x4ad9af)[_0x9b93('0xe')](function(_0x2c5717){var _0x36e961=[];_0x36e961[_0x9b93('0x9d')]({'name':_0x2c5717[_0x9b93('0xad')][_0x9b93('0xb2')][_0x9b93('0xaf')][_0x9b93('0xae')][_0x9b93('0xaf')],'value':_0x9b93('0xb3')},{'name':_0x2c5717[_0x9b93('0xad')][_0x9b93('0xb4')][_0x9b93('0xaf')][_0x9b93('0xae')]['Label'],'value':_0x9b93('0xb5')});var _0x343802={'id':_0x5e50f1+'_'+_0x2c5717[_0x9b93('0x99')],'name':_0x2c5717[_0x9b93('0xb6')][_0x9b93('0xae')][_0x9b93('0xaf')],'custom':![],'options':_0x36e961};_0x58e28d[_0x9b93('0x9d')](_0x343802);return _0x58e28d;});}function getInputList(_0x25700b,_0x3396ff,_0x2e7dd5,_0x33945e,_0x16a0a3,_0x2a09e8,_0x1680a1){var _0x16d65d={'method':_0x9b93('0x91'),'uri':_0x25700b+'EntityDefinitions('+_0x16a0a3+_0x9b93('0xaa')+_0x2a09e8+_0x9b93('0xb7')+_0x2e7dd5+_0x9b93('0xb8'),'headers':{'Authorization':_0x9b93('0x94')+_0x1680a1,'If-None-Match':null,'OData-Version':_0x9b93('0x95')},'json':!![]};return rp(_0x16d65d)[_0x9b93('0xe')](function(_0x6ad39a){var _0x584a84={'id':_0x3396ff+'_'+_0x6ad39a[_0x9b93('0x99')],'name':_0x6ad39a[_0x9b93('0xb6')][_0x9b93('0xae')]?_0x6ad39a['DisplayName']['UserLocalizedLabel']['Label']:_0x6ad39a[_0x9b93('0x99')],'custom':![],'options':[]};_0x33945e['push'](_0x584a84);return _0x33945e;});}
\ No newline at end of file
index 539429b..7ebf869 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x32b45c,_0x149a18){var _0x1db19a=function(_0x16ea8a){while(--_0x16ea8a){_0x32b45c['push'](_0x32b45c['shift']());}};_0x1db19a(++_0x149a18);}(_0xb7e7,0x121));var _0x7b7e=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xb7e7[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1d24ff,_0x22a8fb){var _0x37d564=function(_0x1e416d){while(--_0x1e416d){_0x1d24ff['push'](_0x1d24ff['shift']());}};_0x37d564(++_0x22a8fb);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e58804..8dff26e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f36=['findAll','options','where','limit','map','include','model','attributes','stringify','catch','ShowDynamics365Account','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','GetDynamics365Account','Dynamics365Account'];(function(_0xdd1ea0,_0x402a68){var _0x59c493=function(_0x514ec0){while(--_0x514ec0){_0xdd1ea0['push'](_0xdd1ea0['shift']());}};_0x59c493(++_0x402a68);}(_0x3f36,0x90));var _0x63f3=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x3f36[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x63f3('0x0'));var util=require(_0x63f3('0x1'));var moment=require('moment');var BPromise=require(_0x63f3('0x2'));var rs=require(_0x63f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x63f3('0x5'))('rpc');var config=require(_0x63f3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x63f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ff6a6,_0x4b74f8,_0x5ed7f9){return new BPromise(function(_0x8ec921,_0x13775a){return client[_0x63f3('0x8')](_0x4ff6a6,_0x5ed7f9)[_0x63f3('0x9')](function(_0x55f383){logger[_0x63f3('0xa')](_0x63f3('0xb'),_0x4b74f8,_0x63f3('0xc'));logger[_0x63f3('0xd')](_0x63f3('0xe'),_0x4b74f8,'request\x20sent',JSON['stringify'](_0x55f383));if(_0x55f383[_0x63f3('0xf')]){if(_0x55f383['error'][_0x63f3('0x10')]===0x1f4){logger[_0x63f3('0xf')](_0x63f3('0xb'),_0x4b74f8,_0x55f383[_0x63f3('0xf')][_0x63f3('0x11')]);return _0x13775a(_0x55f383[_0x63f3('0xf')][_0x63f3('0x11')]);}logger[_0x63f3('0xf')](_0x63f3('0xb'),_0x4b74f8,_0x55f383[_0x63f3('0xf')]['message']);return _0x8ec921(_0x55f383[_0x63f3('0xf')][_0x63f3('0x11')]);}else{logger[_0x63f3('0xa')](_0x63f3('0xb'),_0x4b74f8,_0x63f3('0xc'));_0x8ec921(_0x55f383[_0x63f3('0x12')][_0x63f3('0x11')]);}})['catch'](function(_0x25cb36){logger[_0x63f3('0xf')](_0x63f3('0xb'),_0x4b74f8,_0x25cb36);_0x13775a(_0x25cb36);});});}exports[_0x63f3('0x13')]=function(_0x49df22){var _0x2a70f4=this;return new Promise(function(_0x3a35fe,_0x409f94){return db[_0x63f3('0x14')][_0x63f3('0x15')]({'raw':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')][_0x63f3('0x17')]||null:null,'attributes':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')]['attributes']||null:null,'limit':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')][_0x63f3('0x18')]||null:null,'include':_0x49df22[_0x63f3('0x16')]?_0x49df22[_0x63f3('0x16')]['include']?_[_0x63f3('0x19')](_0x49df22[_0x63f3('0x16')][_0x63f3('0x1a')],function(_0x58d7dd){return{'model':db[_0x58d7dd[_0x63f3('0x1b')]],'as':_0x58d7dd['as'],'attributes':_0x58d7dd[_0x63f3('0x1c')],'include':_0x58d7dd[_0x63f3('0x1a')]?_['map'](_0x58d7dd['include'],function(_0x32b7d6){return{'model':db[_0x32b7d6[_0x63f3('0x1b')]],'as':_0x32b7d6['as'],'attributes':_0x32b7d6[_0x63f3('0x1c')],'include':_0x32b7d6['include']?_[_0x63f3('0x19')](_0x32b7d6[_0x63f3('0x1a')],function(_0x30a880){return{'model':db[_0x30a880[_0x63f3('0x1b')]],'as':_0x30a880['as'],'attributes':_0x30a880[_0x63f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x63f3('0x9')](function(_0x30cc43){logger['info']('GetDynamics365Account',_0x49df22);logger[_0x63f3('0xd')](_0x63f3('0x13'),_0x49df22,JSON[_0x63f3('0x1d')](_0x30cc43));_0x3a35fe(_0x30cc43);})[_0x63f3('0x1e')](function(_0xb55ae8){logger[_0x63f3('0xf')](_0x63f3('0x13'),_0xb55ae8[_0x63f3('0x11')],_0x49df22);_0x409f94(_0x2a70f4['error'](0x1f4,_0xb55ae8['message']));});});};exports[_0x63f3('0x1f')]=function(_0x5c633b){var _0x509bd6=this;return new Promise(function(_0x5c2716,_0x3bcbb4){return db['Dynamics365Account'][_0x63f3('0x20')]({'raw':_0x5c633b[_0x63f3('0x16')]?_0x5c633b[_0x63f3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5c633b[_0x63f3('0x16')]?_0x5c633b[_0x63f3('0x16')][_0x63f3('0x17')]||null:null,'attributes':_0x5c633b[_0x63f3('0x16')]?_0x5c633b[_0x63f3('0x16')][_0x63f3('0x1c')]||null:null,'include':_0x5c633b['options']?_0x5c633b[_0x63f3('0x16')][_0x63f3('0x1a')]?_['map'](_0x5c633b[_0x63f3('0x16')][_0x63f3('0x1a')],function(_0x4c7a85){return{'model':db[_0x4c7a85[_0x63f3('0x1b')]],'as':_0x4c7a85['as'],'attributes':_0x4c7a85[_0x63f3('0x1c')],'include':_0x4c7a85[_0x63f3('0x1a')]?_[_0x63f3('0x19')](_0x4c7a85[_0x63f3('0x1a')],function(_0x3b5cb3){return{'model':db[_0x3b5cb3[_0x63f3('0x1b')]],'as':_0x3b5cb3['as'],'attributes':_0x3b5cb3[_0x63f3('0x1c')],'include':_0x3b5cb3['include']?_[_0x63f3('0x19')](_0x3b5cb3[_0x63f3('0x1a')],function(_0x3f6201){return{'model':db[_0x3f6201['model']],'as':_0x3f6201['as'],'attributes':_0x3f6201['attributes']};}):[]};}):[]};}):[]:[]})[_0x63f3('0x9')](function(_0x28a99f){logger['info'](_0x63f3('0x1f'),_0x5c633b);logger[_0x63f3('0xd')](_0x63f3('0x1f'),_0x5c633b,JSON[_0x63f3('0x1d')](_0x28a99f));_0x5c2716(_0x28a99f);})['catch'](function(_0x447935){logger[_0x63f3('0xf')]('ShowDynamics365Account',_0x447935[_0x63f3('0x11')],_0x5c633b);_0x3bcbb4(_0x509bd6['error'](0x1f4,_0x447935['message']));});});};
\ No newline at end of file
+var _0xdeb4=['stringify','error','code','message','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','ShowDynamics365Account','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x2931e6,_0x4b79a2){var _0x1b1208=function(_0x3012b0){while(--_0x3012b0){_0x2931e6['push'](_0x2931e6['shift']());}};_0x1b1208(++_0x4b79a2);}(_0xdeb4,0xa2));var _0x4deb=function(_0x58cab5,_0x227d14){_0x58cab5=_0x58cab5-0x0;var _0x421e81=_0xdeb4[_0x58cab5];return _0x421e81;};'use strict';var _=require(_0x4deb('0x0'));var util=require(_0x4deb('0x1'));var moment=require(_0x4deb('0x2'));var BPromise=require(_0x4deb('0x3'));var rs=require(_0x4deb('0x4'));var fs=require('fs');var Redis=require(_0x4deb('0x5'));var db=require(_0x4deb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4deb('0x7'))(_0x4deb('0x8'));var config=require('../../config/environment');var jayson=require(_0x4deb('0x9'));var client=jayson[_0x4deb('0xa')][_0x4deb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ce4e9,_0x125c7d,_0xb12386){return new BPromise(function(_0x22e0d0,_0x2c20b6){return client['request'](_0x2ce4e9,_0xb12386)[_0x4deb('0xc')](function(_0x50ec09){logger[_0x4deb('0xd')](_0x4deb('0xe'),_0x125c7d,_0x4deb('0xf'));logger[_0x4deb('0x10')](_0x4deb('0x11'),_0x125c7d,_0x4deb('0xf'),JSON[_0x4deb('0x12')](_0x50ec09));if(_0x50ec09['error']){if(_0x50ec09[_0x4deb('0x13')][_0x4deb('0x14')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x125c7d,_0x50ec09['error']['message']);return _0x2c20b6(_0x50ec09[_0x4deb('0x13')]['message']);}logger[_0x4deb('0x13')](_0x4deb('0xe'),_0x125c7d,_0x50ec09[_0x4deb('0x13')][_0x4deb('0x15')]);return _0x22e0d0(_0x50ec09['error'][_0x4deb('0x15')]);}else{logger['info'](_0x4deb('0xe'),_0x125c7d,_0x4deb('0xf'));_0x22e0d0(_0x50ec09['result'][_0x4deb('0x15')]);}})['catch'](function(_0x147310){logger[_0x4deb('0x13')]('Dynamics365Account,\x20%s,\x20%s',_0x125c7d,_0x147310);_0x2c20b6(_0x147310);});});}exports[_0x4deb('0x16')]=function(_0x5944a1){var _0x62a51b=this;return new Promise(function(_0x322f9f,_0x3e3d0e){return db[_0x4deb('0x17')][_0x4deb('0x18')]({'raw':_0x5944a1[_0x4deb('0x19')]?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1a')]===undefined?!![]:![]:!![],'where':_0x5944a1[_0x4deb('0x19')]?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1b')]||null:null,'attributes':_0x5944a1['options']?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1c')]||null:null,'limit':_0x5944a1[_0x4deb('0x19')]?_0x5944a1['options'][_0x4deb('0x1d')]||null:null,'include':_0x5944a1[_0x4deb('0x19')]?_0x5944a1[_0x4deb('0x19')][_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x5944a1['options']['include'],function(_0x186c7d){return{'model':db[_0x186c7d[_0x4deb('0x20')]],'as':_0x186c7d['as'],'attributes':_0x186c7d[_0x4deb('0x1c')],'include':_0x186c7d[_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x186c7d[_0x4deb('0x1e')],function(_0x4ce52c){return{'model':db[_0x4ce52c[_0x4deb('0x20')]],'as':_0x4ce52c['as'],'attributes':_0x4ce52c[_0x4deb('0x1c')],'include':_0x4ce52c['include']?_[_0x4deb('0x1f')](_0x4ce52c[_0x4deb('0x1e')],function(_0x58b969){return{'model':db[_0x58b969[_0x4deb('0x20')]],'as':_0x58b969['as'],'attributes':_0x58b969[_0x4deb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4deb('0xc')](function(_0x5adb14){logger['info'](_0x4deb('0x16'),_0x5944a1);logger[_0x4deb('0x10')]('GetDynamics365Account',_0x5944a1,JSON[_0x4deb('0x12')](_0x5adb14));_0x322f9f(_0x5adb14);})['catch'](function(_0x2ef9eb){logger[_0x4deb('0x13')](_0x4deb('0x16'),_0x2ef9eb[_0x4deb('0x15')],_0x5944a1);_0x3e3d0e(_0x62a51b['error'](0x1f4,_0x2ef9eb[_0x4deb('0x15')]));});});};exports[_0x4deb('0x21')]=function(_0x4e0bba){var _0x9c3f87=this;return new Promise(function(_0x25b922,_0x2e245d){return db[_0x4deb('0x17')][_0x4deb('0x22')]({'raw':_0x4e0bba[_0x4deb('0x19')]?_0x4e0bba[_0x4deb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4e0bba[_0x4deb('0x19')]?_0x4e0bba[_0x4deb('0x19')][_0x4deb('0x1b')]||null:null,'attributes':_0x4e0bba[_0x4deb('0x19')]?_0x4e0bba[_0x4deb('0x19')][_0x4deb('0x1c')]||null:null,'include':_0x4e0bba['options']?_0x4e0bba[_0x4deb('0x19')][_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x4e0bba['options'][_0x4deb('0x1e')],function(_0x4dd76c){return{'model':db[_0x4dd76c[_0x4deb('0x20')]],'as':_0x4dd76c['as'],'attributes':_0x4dd76c[_0x4deb('0x1c')],'include':_0x4dd76c[_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x4dd76c[_0x4deb('0x1e')],function(_0x3636c2){return{'model':db[_0x3636c2[_0x4deb('0x20')]],'as':_0x3636c2['as'],'attributes':_0x3636c2[_0x4deb('0x1c')],'include':_0x3636c2[_0x4deb('0x1e')]?_[_0x4deb('0x1f')](_0x3636c2[_0x4deb('0x1e')],function(_0x58b661){return{'model':db[_0x58b661[_0x4deb('0x20')]],'as':_0x58b661['as'],'attributes':_0x58b661[_0x4deb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4deb('0xc')](function(_0x21339a){logger[_0x4deb('0xd')]('ShowDynamics365Account',_0x4e0bba);logger['debug'](_0x4deb('0x21'),_0x4e0bba,JSON[_0x4deb('0x12')](_0x21339a));_0x25b922(_0x21339a);})[_0x4deb('0x23')](function(_0x19e967){logger[_0x4deb('0x13')](_0x4deb('0x21'),_0x19e967[_0x4deb('0x15')],_0x4e0bba);_0x2e245d(_0x9c3f87[_0x4deb('0x13')](0x1f4,_0x19e967[_0x4deb('0x15')]));});});};
\ No newline at end of file
index b683521..b85564e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5323=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','/:id'];(function(_0x2d582c,_0x424a15){var _0x37e92a=function(_0x142fb1){while(--_0x142fb1){_0x2d582c['push'](_0x2d582c['shift']());}};_0x37e92a(++_0x424a15);}(_0x5323,0x88));var _0x3532=function(_0x393826,_0x5d573c){_0x393826=_0x393826-0x0;var _0x585b2d=_0x5323[_0x393826];return _0x585b2d;};'use strict';var multer=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var path=require(_0x3532('0x2'));var timeout=require(_0x3532('0x3'));var express=require(_0x3532('0x4'));var router=express['Router']();var fs_extra=require(_0x3532('0x5'));var auth=require(_0x3532('0x6'));var interaction=require(_0x3532('0x7'));var config=require('../../config/environment');var controller=require(_0x3532('0x8'));router[_0x3532('0x9')]('/',auth[_0x3532('0xa')](),controller['index']);router[_0x3532('0x9')]('/:id',auth[_0x3532('0xa')](),controller['show']);router[_0x3532('0x9')](_0x3532('0xb'),auth['isAuthenticated'](),controller[_0x3532('0xc')]);router[_0x3532('0x9')](_0x3532('0xd'),auth[_0x3532('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3532('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3532('0xf')]);router[_0x3532('0x10')](_0x3532('0x11'),auth['isAuthenticated'](),controller[_0x3532('0x12')]);router[_0x3532('0x13')]('/:id',auth[_0x3532('0xa')](),controller[_0x3532('0x14')]);module[_0x3532('0x15')]=router;
\ No newline at end of file
+var _0x27f4=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../config/environment','./intDynamics365Configuration.controller','get','index','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x27f4,0x14e));var _0x427f=function(_0x1e6bdf,_0x377d56){_0x1e6bdf=_0x1e6bdf-0x0;var _0xf1d42f=_0x27f4[_0x1e6bdf];return _0xf1d42f;};'use strict';var multer=require('multer');var util=require(_0x427f('0x0'));var path=require(_0x427f('0x1'));var timeout=require(_0x427f('0x2'));var express=require(_0x427f('0x3'));var router=express[_0x427f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x427f('0x5'));var controller=require(_0x427f('0x6'));router[_0x427f('0x7')]('/',auth['isAuthenticated'](),controller[_0x427f('0x8')]);router[_0x427f('0x7')]('/:id',auth[_0x427f('0x9')](),controller['show']);router[_0x427f('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x427f('0xa')]);router[_0x427f('0x7')](_0x427f('0xb'),auth[_0x427f('0x9')](),controller[_0x427f('0xc')]);router[_0x427f('0x7')](_0x427f('0xd'),auth[_0x427f('0x9')](),controller[_0x427f('0xe')]);router[_0x427f('0xf')]('/',auth[_0x427f('0x9')](),controller[_0x427f('0x10')]);router[_0x427f('0x11')](_0x427f('0x12'),auth[_0x427f('0x9')](),controller[_0x427f('0x13')]);router[_0x427f('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x427f('0x15')]=router;
\ No newline at end of file
index c1c773c..7b6cf77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84f3=['exports','STRING','ENUM','incident','phonecall','contact','sequelize'];(function(_0x55fa03,_0xcb96c2){var _0x2cd7cd=function(_0x56611f){while(--_0x56611f){_0x55fa03['push'](_0x55fa03['shift']());}};_0x2cd7cd(++_0xcb96c2);}(_0x84f3,0xe6));var _0x384f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x84f3[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x384f('0x0'));module[_0x384f('0x1')]={'name':{'type':Sequelize[_0x384f('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x384f('0x3')](_0x384f('0x4'),_0x384f('0x5')),'defaultValue':_0x384f('0x4')},'moduleCreate':{'type':Sequelize[_0x384f('0x3')](_0x384f('0x6'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x384f('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb10b=['incident','nothing','contact','BOOLEAN','exports','STRING','ENUM'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xb10b,0xc8));var _0xbb10=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xb10b[_0xf79bae];return _0x5d2cb7;};'use strict';var Sequelize=require('sequelize');module[_0xbb10('0x0')]={'name':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'ticketType':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'phonecall'),'defaultValue':_0xbb10('0x3')},'moduleCreate':{'type':Sequelize[_0xbb10('0x2')]('contact',_0xbb10('0x4')),'defaultValue':_0xbb10('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xbb10('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xbb10('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index 132c873..2429cd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7468=['desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Configuration','fieldName','key','model','query','keys','attributes','intersection','fields','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','getFields','findOne','Dynamics365Field','hasOwnProperty','nolimit','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce'];(function(_0xbe7320,_0x106a76){var _0x43f0a9=function(_0x1ecd82){while(--_0x1ecd82){_0xbe7320['push'](_0xbe7320['shift']());}};_0x43f0a9(++_0x106a76);}(_0x7468,0x94));var _0x8746=function(_0x216cd8,_0x1e1661){_0x216cd8=_0x216cd8-0x0;var _0x4ee5d4=_0x7468[_0x216cd8];return _0x4ee5d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8746('0x0'));var zipdir=require(_0x8746('0x1'));var jsonpatch=require(_0x8746('0x2'));var rp=require('request-promise');var moment=require(_0x8746('0x3'));var BPromise=require(_0x8746('0x4'));var Mustache=require(_0x8746('0x5'));var util=require(_0x8746('0x6'));var path=require(_0x8746('0x7'));var sox=require('sox');var csv=require(_0x8746('0x8'));var ejs=require(_0x8746('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8746('0xa'));var jsforce=require(_0x8746('0xb'));var deskjs=require(_0x8746('0xc'));var toCsv=require(_0x8746('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8746('0xd'));var qs=require(_0x8746('0xe'));var as=require(_0x8746('0xf'));var hardwareService=require(_0x8746('0x10'));var logger=require(_0x8746('0x11'))(_0x8746('0x12'));var utils=require(_0x8746('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8746('0x14'));var db=require(_0x8746('0x15'))['db'];function respondWithStatusCode(_0x42e91d,_0x5bf23d){_0x5bf23d=_0x5bf23d||0xcc;return function(_0x579edc){if(_0x579edc){return _0x42e91d[_0x8746('0x16')](_0x5bf23d);}return _0x42e91d[_0x8746('0x17')](_0x5bf23d)[_0x8746('0x18')]();};}function respondWithResult(_0x2cf297,_0x10eee6){_0x10eee6=_0x10eee6||0xc8;return function(_0x5f10b0){if(_0x5f10b0){return _0x2cf297[_0x8746('0x17')](_0x10eee6)[_0x8746('0x19')](_0x5f10b0);}};}function respondWithFilteredResult(_0x2dc6eb,_0x5f212c){return function(_0x559622){if(_0x559622){var _0xa17745=typeof _0x5f212c['offset']===_0x8746('0x1a')&&typeof _0x5f212c[_0x8746('0x1b')]==='undefined';var _0x559bfb=_0x559622[_0x8746('0x1c')];var _0x5604c9=_0xa17745?0x0:_0x5f212c[_0x8746('0x1d')];var _0x37dd61=_0xa17745?_0x559622[_0x8746('0x1c')]:_0x5f212c['offset']+_0x5f212c[_0x8746('0x1b')];var _0x376461;if(_0x37dd61>=_0x559bfb){_0x37dd61=_0x559bfb;_0x376461=0xc8;}else{_0x376461=0xce;}_0x2dc6eb['status'](_0x376461);return _0x2dc6eb['set'](_0x8746('0x1e'),_0x5604c9+'-'+_0x37dd61+'/'+_0x559bfb)[_0x8746('0x19')](_0x559622);}return null;};}function patchUpdates(_0x417643){return function(_0x2fba71){try{jsonpatch[_0x8746('0x1f')](_0x2fba71,_0x417643,!![]);}catch(_0x5e00e8){return BPromise[_0x8746('0x20')](_0x5e00e8);}return _0x2fba71[_0x8746('0x21')]();};}function saveUpdates(_0x1a5604,_0x2bd81a){return function(_0x578f08){if(_0x578f08){return _0x578f08[_0x8746('0x22')](_0x1a5604)[_0x8746('0x23')](function(_0x4c71bd){return _0x4c71bd;});}return null;};}function removeEntity(_0x1bc80b,_0x1f6b32){return function(_0x51946e){if(_0x51946e){return _0x51946e[_0x8746('0x24')]()['then'](function(){_0x1bc80b[_0x8746('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5138f7,_0x293f56){return function(_0x428b6b){if(!_0x428b6b){_0x5138f7[_0x8746('0x16')](0x194);}return _0x428b6b;};}function handleError(_0x196140,_0x55e9e5){_0x55e9e5=_0x55e9e5||0x1f4;return function(_0x103a4b){logger[_0x8746('0x25')](_0x103a4b['stack']);if(_0x103a4b[_0x8746('0x26')]){delete _0x103a4b[_0x8746('0x26')];}_0x196140[_0x8746('0x17')](_0x55e9e5)[_0x8746('0x27')](_0x103a4b);};}exports[_0x8746('0x28')]=function(_0x304d32,_0x24d9e5){var _0x3e8ac9={},_0x3f26ee={},_0x114080={'count':0x0,'rows':[]};var _0x117804=_[_0x8746('0x29')](db[_0x8746('0x2a')]['rawAttributes'],function(_0x2d0fd5){return{'name':_0x2d0fd5[_0x8746('0x2b')],'type':_0x2d0fd5['type'][_0x8746('0x2c')]};});_0x3f26ee[_0x8746('0x2d')]=_[_0x8746('0x29')](_0x117804,_0x8746('0x26'));_0x3f26ee[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x304d32[_0x8746('0x2e')]);_0x3f26ee['filters']=_['intersection'](_0x3f26ee[_0x8746('0x2d')],_0x3f26ee[_0x8746('0x2e')]);_0x3e8ac9[_0x8746('0x30')]=_[_0x8746('0x31')](_0x3f26ee[_0x8746('0x2d')],qs[_0x8746('0x32')](_0x304d32['query'][_0x8746('0x32')]));_0x3e8ac9['attributes']=_0x3e8ac9[_0x8746('0x30')]['length']?_0x3e8ac9[_0x8746('0x30')]:_0x3f26ee[_0x8746('0x2d')];if(!_0x304d32[_0x8746('0x2e')]['hasOwnProperty']('nolimit')){_0x3e8ac9[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x304d32['query'][_0x8746('0x1b')]);_0x3e8ac9['offset']=qs[_0x8746('0x1d')](_0x304d32[_0x8746('0x2e')][_0x8746('0x1d')]);}_0x3e8ac9[_0x8746('0x33')]=qs[_0x8746('0x34')](_0x304d32[_0x8746('0x2e')]['sort']);_0x3e8ac9[_0x8746('0x35')]=qs[_0x8746('0x36')](_[_0x8746('0x37')](_0x304d32[_0x8746('0x2e')],_0x3f26ee[_0x8746('0x36')]),_0x117804);if(_0x304d32['query'][_0x8746('0x38')]){_0x3e8ac9[_0x8746('0x35')]=_[_0x8746('0x39')](_0x3e8ac9['where'],{'$or':_[_0x8746('0x29')](_0x117804,function(_0x1d6f84){if(_0x1d6f84[_0x8746('0x3a')]!==_0x8746('0x3b')){var _0x394490={};_0x394490[_0x1d6f84[_0x8746('0x26')]]={'$like':'%'+_0x304d32['query'][_0x8746('0x38')]+'%'};return _0x394490;}})});}_0x3e8ac9=_[_0x8746('0x39')]({},_0x3e8ac9,_0x304d32[_0x8746('0x3c')]);var _0x569875={'where':_0x3e8ac9[_0x8746('0x35')]};return db[_0x8746('0x2a')][_0x8746('0x1c')](_0x569875)[_0x8746('0x23')](function(_0x2d4b23){_0x114080[_0x8746('0x1c')]=_0x2d4b23;if(_0x304d32['query'][_0x8746('0x3d')]){_0x3e8ac9[_0x8746('0x3e')]=[{'all':!![]}];}return db[_0x8746('0x2a')][_0x8746('0x3f')](_0x3e8ac9);})[_0x8746('0x23')](function(_0x1e4dfa){_0x114080[_0x8746('0x40')]=_0x1e4dfa;return _0x114080;})[_0x8746('0x23')](respondWithFilteredResult(_0x24d9e5,_0x3e8ac9))[_0x8746('0x41')](handleError(_0x24d9e5,null));};exports[_0x8746('0x42')]=function(_0x4e5b3a,_0x59fced){var _0x2ebf82={'raw':![],'where':{'id':_0x4e5b3a[_0x8746('0x43')]['id']}},_0x3514d2={};_0x3514d2[_0x8746('0x2d')]=_[_0x8746('0x2f')](db[_0x8746('0x2a')][_0x8746('0x44')]);_0x3514d2[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x4e5b3a[_0x8746('0x2e')]);_0x3514d2['filters']=_[_0x8746('0x31')](_0x3514d2['model'],_0x3514d2[_0x8746('0x2e')]);_0x2ebf82['attributes']=_[_0x8746('0x31')](_0x3514d2[_0x8746('0x2d')],qs[_0x8746('0x32')](_0x4e5b3a[_0x8746('0x2e')]['fields']));_0x2ebf82[_0x8746('0x30')]=_0x2ebf82['attributes'][_0x8746('0x45')]?_0x2ebf82[_0x8746('0x30')]:_0x3514d2[_0x8746('0x2d')];if(_0x4e5b3a['query'][_0x8746('0x3d')]){_0x2ebf82['include']=[{'all':!![]}];}_0x2ebf82=_[_0x8746('0x39')]({},_0x2ebf82,_0x4e5b3a[_0x8746('0x3c')]);return db['Dynamics365Configuration'][_0x8746('0x46')](_0x2ebf82)[_0x8746('0x23')](handleEntityNotFound(_0x59fced,null))[_0x8746('0x23')](respondWithResult(_0x59fced,null))[_0x8746('0x41')](handleError(_0x59fced,null));};exports[_0x8746('0x47')]=function(_0x259226,_0x387a63){return db[_0x8746('0x2a')][_0x8746('0x47')](_0x259226[_0x8746('0x48')],{})[_0x8746('0x23')](respondWithResult(_0x387a63,0xc9))[_0x8746('0x41')](handleError(_0x387a63,null));};exports[_0x8746('0x22')]=function(_0x9672f1,_0x30ae2a){if(_0x9672f1[_0x8746('0x48')]['id']){delete _0x9672f1[_0x8746('0x48')]['id'];}return db[_0x8746('0x2a')]['find']({'where':{'id':_0x9672f1[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x30ae2a,null))['then'](saveUpdates(_0x9672f1[_0x8746('0x48')],null))[_0x8746('0x23')](respondWithResult(_0x30ae2a,null))[_0x8746('0x41')](handleError(_0x30ae2a,null));};exports[_0x8746('0x24')]=function(_0x2b88bd,_0x11392d){return db[_0x8746('0x2a')][_0x8746('0x46')]({'where':{'id':_0x2b88bd[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x11392d,null))['then'](removeEntity(_0x11392d,null))[_0x8746('0x41')](handleError(_0x11392d,null));};exports[_0x8746('0x49')]=function(_0x2014e5,_0x47ad84,_0x59aff5){var _0x1f3b8d={};var _0x3334ec={};var _0x1f1a2a;var _0x1393d4;return db['Dynamics365Configuration'][_0x8746('0x4a')]({'where':{'id':_0x2014e5[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x47ad84,null))[_0x8746('0x23')](function(_0x2724be){if(_0x2724be){_0x1f1a2a=_0x2724be;_0x3334ec['model']=_['keys'](db[_0x8746('0x4b')][_0x8746('0x44')]);_0x3334ec[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x2014e5[_0x8746('0x2e')]);_0x3334ec[_0x8746('0x36')]=_['intersection'](_0x3334ec[_0x8746('0x2d')],_0x3334ec[_0x8746('0x2e')]);_0x1f3b8d['attributes']=_['intersection'](_0x3334ec[_0x8746('0x2d')],qs['fields'](_0x2014e5['query'][_0x8746('0x32')]));_0x1f3b8d[_0x8746('0x30')]=_0x1f3b8d[_0x8746('0x30')]['length']?_0x1f3b8d['attributes']:_0x3334ec['model'];_0x1f3b8d[_0x8746('0x33')]=qs[_0x8746('0x34')](_0x2014e5['query'][_0x8746('0x34')]);_0x1f3b8d[_0x8746('0x35')]=qs[_0x8746('0x36')](_[_0x8746('0x37')](_0x2014e5[_0x8746('0x2e')],_0x3334ec[_0x8746('0x36')]));if(_0x2014e5[_0x8746('0x2e')][_0x8746('0x38')]){_0x1f3b8d[_0x8746('0x35')]=_[_0x8746('0x39')](_0x1f3b8d['where'],{'$or':_[_0x8746('0x29')](_0x1f3b8d[_0x8746('0x30')],function(_0x3b0af2){var _0x5ce9c2={};_0x5ce9c2[_0x3b0af2]={'$like':'%'+_0x2014e5[_0x8746('0x2e')][_0x8746('0x38')]+'%'};return _0x5ce9c2;})});}_0x1f3b8d=_[_0x8746('0x39')]({},_0x1f3b8d,_0x2014e5[_0x8746('0x3c')]);return _0x1f1a2a[_0x8746('0x49')](_0x1f3b8d);}})[_0x8746('0x23')](function(_0x3fde59){if(_0x3fde59){_0x1393d4=_0x3fde59['length'];if(!_0x2014e5[_0x8746('0x2e')][_0x8746('0x4c')](_0x8746('0x4d'))){_0x1f3b8d[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x2014e5[_0x8746('0x2e')][_0x8746('0x1b')]);_0x1f3b8d[_0x8746('0x1d')]=qs[_0x8746('0x1d')](_0x2014e5[_0x8746('0x2e')]['offset']);}return _0x1f1a2a[_0x8746('0x49')](_0x1f3b8d);}})['then'](function(_0x3385b3){if(_0x3385b3){return _0x3385b3?{'count':_0x1393d4,'rows':_0x3385b3}:null;}})['then'](respondWithResult(_0x47ad84,null))[_0x8746('0x41')](handleError(_0x47ad84,null));};exports[_0x8746('0x4e')]=function(_0x24d1c9,_0x445dce,_0x9e313){var _0x4d86e3={};var _0x30942b={};var _0x37faea;var _0x550674;return db[_0x8746('0x2a')]['findOne']({'where':{'id':_0x24d1c9[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x445dce,null))[_0x8746('0x23')](function(_0xc4048c){if(_0xc4048c){_0x37faea=_0xc4048c;_0x30942b['model']=_[_0x8746('0x2f')](db[_0x8746('0x4b')][_0x8746('0x44')]);_0x30942b[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x24d1c9[_0x8746('0x2e')]);_0x30942b[_0x8746('0x36')]=_[_0x8746('0x31')](_0x30942b[_0x8746('0x2d')],_0x30942b['query']);_0x4d86e3[_0x8746('0x30')]=_[_0x8746('0x31')](_0x30942b[_0x8746('0x2d')],qs[_0x8746('0x32')](_0x24d1c9['query'][_0x8746('0x32')]));_0x4d86e3[_0x8746('0x30')]=_0x4d86e3['attributes'][_0x8746('0x45')]?_0x4d86e3['attributes']:_0x30942b[_0x8746('0x2d')];_0x4d86e3['order']=qs[_0x8746('0x34')](_0x24d1c9['query']['sort']);_0x4d86e3[_0x8746('0x35')]=qs[_0x8746('0x36')](_['pick'](_0x24d1c9['query'],_0x30942b[_0x8746('0x36')]));if(_0x24d1c9['query'][_0x8746('0x38')]){_0x4d86e3[_0x8746('0x35')]=_[_0x8746('0x39')](_0x4d86e3[_0x8746('0x35')],{'$or':_[_0x8746('0x29')](_0x4d86e3[_0x8746('0x30')],function(_0x2aec29){var _0x371888={};_0x371888[_0x2aec29]={'$like':'%'+_0x24d1c9[_0x8746('0x2e')][_0x8746('0x38')]+'%'};return _0x371888;})});}_0x4d86e3=_[_0x8746('0x39')]({},_0x4d86e3,_0x24d1c9[_0x8746('0x3c')]);return _0x37faea['getSubjects'](_0x4d86e3);}})[_0x8746('0x23')](function(_0x4980b3){if(_0x4980b3){_0x550674=_0x4980b3[_0x8746('0x45')];if(!_0x24d1c9[_0x8746('0x2e')][_0x8746('0x4c')](_0x8746('0x4d'))){_0x4d86e3[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x24d1c9['query'][_0x8746('0x1b')]);_0x4d86e3['offset']=qs[_0x8746('0x1d')](_0x24d1c9[_0x8746('0x2e')][_0x8746('0x1d')]);}return _0x37faea['getSubjects'](_0x4d86e3);}})[_0x8746('0x23')](function(_0x17f911){if(_0x17f911){return _0x17f911?{'count':_0x550674,'rows':_0x17f911}:null;}})[_0x8746('0x23')](respondWithResult(_0x445dce,null))[_0x8746('0x41')](handleError(_0x445dce,null));};exports[_0x8746('0x4f')]=function(_0x11c860,_0x3291a4,_0x5779e3){var _0x125851={};var _0x37565d={};var _0x48d0d8;var _0x110f6d;return db['Dynamics365Configuration'][_0x8746('0x4a')]({'where':{'id':_0x11c860[_0x8746('0x43')]['id']}})[_0x8746('0x23')](handleEntityNotFound(_0x3291a4,null))['then'](function(_0x2dd91b){if(_0x2dd91b){_0x48d0d8=_0x2dd91b;_0x37565d[_0x8746('0x2d')]=_[_0x8746('0x2f')](db[_0x8746('0x4b')][_0x8746('0x44')]);_0x37565d[_0x8746('0x2e')]=_[_0x8746('0x2f')](_0x11c860[_0x8746('0x2e')]);_0x37565d[_0x8746('0x36')]=_['intersection'](_0x37565d[_0x8746('0x2d')],_0x37565d['query']);_0x125851[_0x8746('0x30')]=_[_0x8746('0x31')](_0x37565d['model'],qs[_0x8746('0x32')](_0x11c860[_0x8746('0x2e')][_0x8746('0x32')]));_0x125851[_0x8746('0x30')]=_0x125851[_0x8746('0x30')][_0x8746('0x45')]?_0x125851['attributes']:_0x37565d[_0x8746('0x2d')];_0x125851['order']=qs[_0x8746('0x34')](_0x11c860[_0x8746('0x2e')][_0x8746('0x34')]);_0x125851['where']=qs[_0x8746('0x36')](_[_0x8746('0x37')](_0x11c860['query'],_0x37565d[_0x8746('0x36')]));if(_0x11c860[_0x8746('0x2e')][_0x8746('0x38')]){_0x125851['where']=_[_0x8746('0x39')](_0x125851[_0x8746('0x35')],{'$or':_[_0x8746('0x29')](_0x125851['attributes'],function(_0x2b8007){var _0x4ed62b={};_0x4ed62b[_0x2b8007]={'$like':'%'+_0x11c860[_0x8746('0x2e')]['filter']+'%'};return _0x4ed62b;})});}_0x125851=_[_0x8746('0x39')]({},_0x125851,_0x11c860[_0x8746('0x3c')]);return _0x48d0d8[_0x8746('0x4f')](_0x125851);}})['then'](function(_0x2303b1){if(_0x2303b1){_0x110f6d=_0x2303b1[_0x8746('0x45')];if(!_0x11c860[_0x8746('0x2e')]['hasOwnProperty']('nolimit')){_0x125851[_0x8746('0x1b')]=qs[_0x8746('0x1b')](_0x11c860[_0x8746('0x2e')][_0x8746('0x1b')]);_0x125851[_0x8746('0x1d')]=qs[_0x8746('0x1d')](_0x11c860['query']['offset']);}return _0x48d0d8['getDescriptions'](_0x125851);}})[_0x8746('0x23')](function(_0x58d2c0){if(_0x58d2c0){return _0x58d2c0?{'count':_0x110f6d,'rows':_0x58d2c0}:null;}})[_0x8746('0x23')](respondWithResult(_0x3291a4,null))[_0x8746('0x41')](handleError(_0x3291a4,null));};
\ No newline at end of file
+var _0x6357=['eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','error','stack','name','send','index','map','Dynamics365Configuration','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','getFields','findOne','getSubjects','getDescriptions'];(function(_0x7267da,_0x118a05){var _0x5d2773=function(_0x2e3d68){while(--_0x2e3d68){_0x7267da['push'](_0x7267da['shift']());}};_0x5d2773(++_0x118a05);}(_0x6357,0xe7));var _0x7635=function(_0x40cff7,_0x5c3eb5){_0x40cff7=_0x40cff7-0x0;var _0x38006f=_0x6357[_0x40cff7];return _0x38006f;};'use strict';var emlformat=require(_0x7635('0x0'));var rimraf=require(_0x7635('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7635('0x2'));var moment=require(_0x7635('0x3'));var BPromise=require(_0x7635('0x4'));var Mustache=require(_0x7635('0x5'));var util=require(_0x7635('0x6'));var path=require(_0x7635('0x7'));var sox=require('sox');var csv=require(_0x7635('0x8'));var ejs=require(_0x7635('0x9'));var fs=require('fs');var fs_extra=require(_0x7635('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7635('0xb'));var jsforce=require(_0x7635('0xc'));var deskjs=require(_0x7635('0xd'));var toCsv=require(_0x7635('0x8'));var querystring=require('querystring');var Papa=require(_0x7635('0xe'));var Redis=require(_0x7635('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7635('0x10'));var hardwareService=require(_0x7635('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7635('0x12'));var config=require(_0x7635('0x13'));var licenseUtil=require(_0x7635('0x14'));var db=require(_0x7635('0x15'))['db'];function respondWithStatusCode(_0x2f3c85,_0x4ec553){_0x4ec553=_0x4ec553||0xcc;return function(_0xd9ca39){if(_0xd9ca39){return _0x2f3c85[_0x7635('0x16')](_0x4ec553);}return _0x2f3c85[_0x7635('0x17')](_0x4ec553)['end']();};}function respondWithResult(_0x573d0f,_0x56264a){_0x56264a=_0x56264a||0xc8;return function(_0xa64f1b){if(_0xa64f1b){return _0x573d0f['status'](_0x56264a)['json'](_0xa64f1b);}};}function respondWithFilteredResult(_0x1e2d22,_0x2a293b){return function(_0x2653f7){if(_0x2653f7){var _0x521718=typeof _0x2a293b[_0x7635('0x18')]==='undefined'&&typeof _0x2a293b['limit']===_0x7635('0x19');var _0x21f94c=_0x2653f7[_0x7635('0x1a')];var _0xc51eb0=_0x521718?0x0:_0x2a293b[_0x7635('0x18')];var _0x352a10=_0x521718?_0x2653f7[_0x7635('0x1a')]:_0x2a293b[_0x7635('0x18')]+_0x2a293b[_0x7635('0x1b')];var _0x190bbf;if(_0x352a10>=_0x21f94c){_0x352a10=_0x21f94c;_0x190bbf=0xc8;}else{_0x190bbf=0xce;}_0x1e2d22[_0x7635('0x17')](_0x190bbf);return _0x1e2d22['set'](_0x7635('0x1c'),_0xc51eb0+'-'+_0x352a10+'/'+_0x21f94c)[_0x7635('0x1d')](_0x2653f7);}return null;};}function patchUpdates(_0x492a83){return function(_0x1a98b2){try{jsonpatch[_0x7635('0x1e')](_0x1a98b2,_0x492a83,!![]);}catch(_0x245f71){return BPromise['reject'](_0x245f71);}return _0x1a98b2[_0x7635('0x1f')]();};}function saveUpdates(_0x56c077,_0x4427ac){return function(_0x15f85f){if(_0x15f85f){return _0x15f85f[_0x7635('0x20')](_0x56c077)['then'](function(_0x62b789){return _0x62b789;});}return null;};}function removeEntity(_0x5a2ba3,_0x57ac07){return function(_0x31ffe6){if(_0x31ffe6){return _0x31ffe6[_0x7635('0x21')]()['then'](function(){_0x5a2ba3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x31a14,_0x5cccef){return function(_0xffaa0b){if(!_0xffaa0b){_0x31a14['sendStatus'](0x194);}return _0xffaa0b;};}function handleError(_0x510c3a,_0x6ecf70){_0x6ecf70=_0x6ecf70||0x1f4;return function(_0xcc9c5d){logger[_0x7635('0x22')](_0xcc9c5d[_0x7635('0x23')]);if(_0xcc9c5d[_0x7635('0x24')]){delete _0xcc9c5d['name'];}_0x510c3a['status'](_0x6ecf70)[_0x7635('0x25')](_0xcc9c5d);};}exports[_0x7635('0x26')]=function(_0x30a673,_0x3fa3cb){var _0x237f3d={},_0x510ff8={},_0x1a59e4={'count':0x0,'rows':[]};var _0x112484=_[_0x7635('0x27')](db[_0x7635('0x28')]['rawAttributes'],function(_0x26130f){return{'name':_0x26130f[_0x7635('0x29')],'type':_0x26130f['type'][_0x7635('0x2a')]};});_0x510ff8['model']=_[_0x7635('0x27')](_0x112484,_0x7635('0x24'));_0x510ff8[_0x7635('0x2b')]=_[_0x7635('0x2c')](_0x30a673['query']);_0x510ff8[_0x7635('0x2d')]=_[_0x7635('0x2e')](_0x510ff8[_0x7635('0x2f')],_0x510ff8[_0x7635('0x2b')]);_0x237f3d[_0x7635('0x30')]=_['intersection'](_0x510ff8[_0x7635('0x2f')],qs[_0x7635('0x31')](_0x30a673[_0x7635('0x2b')]['fields']));_0x237f3d[_0x7635('0x30')]=_0x237f3d[_0x7635('0x30')][_0x7635('0x32')]?_0x237f3d[_0x7635('0x30')]:_0x510ff8[_0x7635('0x2f')];if(!_0x30a673[_0x7635('0x2b')][_0x7635('0x33')](_0x7635('0x34'))){_0x237f3d[_0x7635('0x1b')]=qs[_0x7635('0x1b')](_0x30a673['query'][_0x7635('0x1b')]);_0x237f3d[_0x7635('0x18')]=qs[_0x7635('0x18')](_0x30a673[_0x7635('0x2b')]['offset']);}_0x237f3d[_0x7635('0x35')]=qs[_0x7635('0x36')](_0x30a673[_0x7635('0x2b')][_0x7635('0x36')]);_0x237f3d[_0x7635('0x37')]=qs[_0x7635('0x2d')](_[_0x7635('0x38')](_0x30a673[_0x7635('0x2b')],_0x510ff8[_0x7635('0x2d')]),_0x112484);if(_0x30a673[_0x7635('0x2b')][_0x7635('0x39')]){_0x237f3d['where']=_[_0x7635('0x3a')](_0x237f3d[_0x7635('0x37')],{'$or':_[_0x7635('0x27')](_0x112484,function(_0x21d37f){if(_0x21d37f[_0x7635('0x3b')]!=='VIRTUAL'){var _0x3443e2={};_0x3443e2[_0x21d37f['name']]={'$like':'%'+_0x30a673[_0x7635('0x2b')]['filter']+'%'};return _0x3443e2;}})});}_0x237f3d=_[_0x7635('0x3a')]({},_0x237f3d,_0x30a673[_0x7635('0x3c')]);var _0x37444d={'where':_0x237f3d['where']};return db[_0x7635('0x28')][_0x7635('0x1a')](_0x37444d)[_0x7635('0x3d')](function(_0x120789){_0x1a59e4[_0x7635('0x1a')]=_0x120789;if(_0x30a673[_0x7635('0x2b')][_0x7635('0x3e')]){_0x237f3d[_0x7635('0x3f')]=[{'all':!![]}];}return db[_0x7635('0x28')][_0x7635('0x40')](_0x237f3d);})[_0x7635('0x3d')](function(_0x3d24e1){_0x1a59e4[_0x7635('0x41')]=_0x3d24e1;return _0x1a59e4;})[_0x7635('0x3d')](respondWithFilteredResult(_0x3fa3cb,_0x237f3d))[_0x7635('0x42')](handleError(_0x3fa3cb,null));};exports[_0x7635('0x43')]=function(_0xe0e7c5,_0x775cae){var _0x2655f4={'raw':![],'where':{'id':_0xe0e7c5[_0x7635('0x44')]['id']}},_0x1e40d3={};_0x1e40d3[_0x7635('0x2f')]=_['keys'](db[_0x7635('0x28')][_0x7635('0x45')]);_0x1e40d3[_0x7635('0x2b')]=_[_0x7635('0x2c')](_0xe0e7c5[_0x7635('0x2b')]);_0x1e40d3[_0x7635('0x2d')]=_[_0x7635('0x2e')](_0x1e40d3[_0x7635('0x2f')],_0x1e40d3[_0x7635('0x2b')]);_0x2655f4['attributes']=_[_0x7635('0x2e')](_0x1e40d3['model'],qs['fields'](_0xe0e7c5[_0x7635('0x2b')][_0x7635('0x31')]));_0x2655f4[_0x7635('0x30')]=_0x2655f4[_0x7635('0x30')][_0x7635('0x32')]?_0x2655f4['attributes']:_0x1e40d3[_0x7635('0x2f')];if(_0xe0e7c5[_0x7635('0x2b')][_0x7635('0x3e')]){_0x2655f4[_0x7635('0x3f')]=[{'all':!![]}];}_0x2655f4=_['merge']({},_0x2655f4,_0xe0e7c5['options']);return db['Dynamics365Configuration']['find'](_0x2655f4)[_0x7635('0x3d')](handleEntityNotFound(_0x775cae,null))[_0x7635('0x3d')](respondWithResult(_0x775cae,null))[_0x7635('0x42')](handleError(_0x775cae,null));};exports[_0x7635('0x46')]=function(_0x13cc0,_0x11118a){return db['Dynamics365Configuration'][_0x7635('0x46')](_0x13cc0[_0x7635('0x47')],{})['then'](respondWithResult(_0x11118a,0xc9))[_0x7635('0x42')](handleError(_0x11118a,null));};exports[_0x7635('0x20')]=function(_0x34fa38,_0x5beccf){if(_0x34fa38[_0x7635('0x47')]['id']){delete _0x34fa38['body']['id'];}return db[_0x7635('0x28')]['find']({'where':{'id':_0x34fa38[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0x5beccf,null))['then'](saveUpdates(_0x34fa38['body'],null))['then'](respondWithResult(_0x5beccf,null))[_0x7635('0x42')](handleError(_0x5beccf,null));};exports['destroy']=function(_0x1ebd94,_0x269081){return db[_0x7635('0x28')][_0x7635('0x48')]({'where':{'id':_0x1ebd94[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0x269081,null))[_0x7635('0x3d')](removeEntity(_0x269081,null))[_0x7635('0x42')](handleError(_0x269081,null));};exports[_0x7635('0x49')]=function(_0x510e0e,_0xba8e9e,_0x18af56){var _0x2b9cc1={};var _0x126a84={};var _0x29fbc7;var _0x2b874a;return db[_0x7635('0x28')][_0x7635('0x4a')]({'where':{'id':_0x510e0e['params']['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0xba8e9e,null))[_0x7635('0x3d')](function(_0xd883c3){if(_0xd883c3){_0x29fbc7=_0xd883c3;_0x126a84[_0x7635('0x2f')]=_[_0x7635('0x2c')](db['Dynamics365Field'][_0x7635('0x45')]);_0x126a84[_0x7635('0x2b')]=_[_0x7635('0x2c')](_0x510e0e[_0x7635('0x2b')]);_0x126a84[_0x7635('0x2d')]=_['intersection'](_0x126a84[_0x7635('0x2f')],_0x126a84[_0x7635('0x2b')]);_0x2b9cc1[_0x7635('0x30')]=_[_0x7635('0x2e')](_0x126a84[_0x7635('0x2f')],qs[_0x7635('0x31')](_0x510e0e['query'][_0x7635('0x31')]));_0x2b9cc1[_0x7635('0x30')]=_0x2b9cc1[_0x7635('0x30')]['length']?_0x2b9cc1[_0x7635('0x30')]:_0x126a84['model'];_0x2b9cc1['order']=qs[_0x7635('0x36')](_0x510e0e[_0x7635('0x2b')][_0x7635('0x36')]);_0x2b9cc1[_0x7635('0x37')]=qs[_0x7635('0x2d')](_[_0x7635('0x38')](_0x510e0e[_0x7635('0x2b')],_0x126a84[_0x7635('0x2d')]));if(_0x510e0e[_0x7635('0x2b')][_0x7635('0x39')]){_0x2b9cc1[_0x7635('0x37')]=_[_0x7635('0x3a')](_0x2b9cc1[_0x7635('0x37')],{'$or':_['map'](_0x2b9cc1['attributes'],function(_0xf0c89f){var _0x2c13eb={};_0x2c13eb[_0xf0c89f]={'$like':'%'+_0x510e0e['query'][_0x7635('0x39')]+'%'};return _0x2c13eb;})});}_0x2b9cc1=_[_0x7635('0x3a')]({},_0x2b9cc1,_0x510e0e[_0x7635('0x3c')]);return _0x29fbc7[_0x7635('0x49')](_0x2b9cc1);}})[_0x7635('0x3d')](function(_0x11f1e1){if(_0x11f1e1){_0x2b874a=_0x11f1e1[_0x7635('0x32')];if(!_0x510e0e[_0x7635('0x2b')][_0x7635('0x33')]('nolimit')){_0x2b9cc1['limit']=qs[_0x7635('0x1b')](_0x510e0e[_0x7635('0x2b')][_0x7635('0x1b')]);_0x2b9cc1[_0x7635('0x18')]=qs['offset'](_0x510e0e[_0x7635('0x2b')]['offset']);}return _0x29fbc7['getFields'](_0x2b9cc1);}})['then'](function(_0x4c9f02){if(_0x4c9f02){return _0x4c9f02?{'count':_0x2b874a,'rows':_0x4c9f02}:null;}})[_0x7635('0x3d')](respondWithResult(_0xba8e9e,null))[_0x7635('0x42')](handleError(_0xba8e9e,null));};exports[_0x7635('0x4b')]=function(_0x3a5c7e,_0xbb19ba,_0x59acc5){var _0x4e081a={};var _0x36cfe6={};var _0x12d183;var _0x3bd8cc;return db['Dynamics365Configuration'][_0x7635('0x4a')]({'where':{'id':_0x3a5c7e[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0xbb19ba,null))[_0x7635('0x3d')](function(_0x1a3080){if(_0x1a3080){_0x12d183=_0x1a3080;_0x36cfe6[_0x7635('0x2f')]=_[_0x7635('0x2c')](db['Dynamics365Field'][_0x7635('0x45')]);_0x36cfe6['query']=_['keys'](_0x3a5c7e[_0x7635('0x2b')]);_0x36cfe6[_0x7635('0x2d')]=_[_0x7635('0x2e')](_0x36cfe6[_0x7635('0x2f')],_0x36cfe6[_0x7635('0x2b')]);_0x4e081a['attributes']=_['intersection'](_0x36cfe6[_0x7635('0x2f')],qs[_0x7635('0x31')](_0x3a5c7e[_0x7635('0x2b')]['fields']));_0x4e081a[_0x7635('0x30')]=_0x4e081a[_0x7635('0x30')][_0x7635('0x32')]?_0x4e081a['attributes']:_0x36cfe6[_0x7635('0x2f')];_0x4e081a[_0x7635('0x35')]=qs['sort'](_0x3a5c7e['query'][_0x7635('0x36')]);_0x4e081a[_0x7635('0x37')]=qs[_0x7635('0x2d')](_[_0x7635('0x38')](_0x3a5c7e['query'],_0x36cfe6['filters']));if(_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x39')]){_0x4e081a[_0x7635('0x37')]=_[_0x7635('0x3a')](_0x4e081a['where'],{'$or':_[_0x7635('0x27')](_0x4e081a['attributes'],function(_0x45d320){var _0x3650c5={};_0x3650c5[_0x45d320]={'$like':'%'+_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x39')]+'%'};return _0x3650c5;})});}_0x4e081a=_['merge']({},_0x4e081a,_0x3a5c7e[_0x7635('0x3c')]);return _0x12d183[_0x7635('0x4b')](_0x4e081a);}})[_0x7635('0x3d')](function(_0x5e7a37){if(_0x5e7a37){_0x3bd8cc=_0x5e7a37['length'];if(!_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x33')]('nolimit')){_0x4e081a[_0x7635('0x1b')]=qs[_0x7635('0x1b')](_0x3a5c7e['query'][_0x7635('0x1b')]);_0x4e081a[_0x7635('0x18')]=qs[_0x7635('0x18')](_0x3a5c7e[_0x7635('0x2b')][_0x7635('0x18')]);}return _0x12d183[_0x7635('0x4b')](_0x4e081a);}})[_0x7635('0x3d')](function(_0x7c1f3b){if(_0x7c1f3b){return _0x7c1f3b?{'count':_0x3bd8cc,'rows':_0x7c1f3b}:null;}})[_0x7635('0x3d')](respondWithResult(_0xbb19ba,null))[_0x7635('0x42')](handleError(_0xbb19ba,null));};exports[_0x7635('0x4c')]=function(_0x52c1e6,_0x25ca4a,_0x1893a4){var _0x2458e6={};var _0x24e2cd={};var _0x53e5c6;var _0x445a5b;return db[_0x7635('0x28')][_0x7635('0x4a')]({'where':{'id':_0x52c1e6[_0x7635('0x44')]['id']}})[_0x7635('0x3d')](handleEntityNotFound(_0x25ca4a,null))[_0x7635('0x3d')](function(_0x39e6b6){if(_0x39e6b6){_0x53e5c6=_0x39e6b6;_0x24e2cd[_0x7635('0x2f')]=_[_0x7635('0x2c')](db['Dynamics365Field'][_0x7635('0x45')]);_0x24e2cd['query']=_['keys'](_0x52c1e6[_0x7635('0x2b')]);_0x24e2cd[_0x7635('0x2d')]=_['intersection'](_0x24e2cd['model'],_0x24e2cd['query']);_0x2458e6['attributes']=_['intersection'](_0x24e2cd[_0x7635('0x2f')],qs['fields'](_0x52c1e6[_0x7635('0x2b')][_0x7635('0x31')]));_0x2458e6[_0x7635('0x30')]=_0x2458e6['attributes'][_0x7635('0x32')]?_0x2458e6[_0x7635('0x30')]:_0x24e2cd[_0x7635('0x2f')];_0x2458e6[_0x7635('0x35')]=qs[_0x7635('0x36')](_0x52c1e6[_0x7635('0x2b')][_0x7635('0x36')]);_0x2458e6[_0x7635('0x37')]=qs[_0x7635('0x2d')](_['pick'](_0x52c1e6[_0x7635('0x2b')],_0x24e2cd[_0x7635('0x2d')]));if(_0x52c1e6[_0x7635('0x2b')]['filter']){_0x2458e6[_0x7635('0x37')]=_[_0x7635('0x3a')](_0x2458e6[_0x7635('0x37')],{'$or':_['map'](_0x2458e6[_0x7635('0x30')],function(_0x4d1d41){var _0x26e41c={};_0x26e41c[_0x4d1d41]={'$like':'%'+_0x52c1e6[_0x7635('0x2b')][_0x7635('0x39')]+'%'};return _0x26e41c;})});}_0x2458e6=_[_0x7635('0x3a')]({},_0x2458e6,_0x52c1e6['options']);return _0x53e5c6[_0x7635('0x4c')](_0x2458e6);}})[_0x7635('0x3d')](function(_0x484537){if(_0x484537){_0x445a5b=_0x484537[_0x7635('0x32')];if(!_0x52c1e6[_0x7635('0x2b')][_0x7635('0x33')](_0x7635('0x34'))){_0x2458e6[_0x7635('0x1b')]=qs[_0x7635('0x1b')](_0x52c1e6[_0x7635('0x2b')]['limit']);_0x2458e6[_0x7635('0x18')]=qs[_0x7635('0x18')](_0x52c1e6['query']['offset']);}return _0x53e5c6[_0x7635('0x4c')](_0x2458e6);}})['then'](function(_0xe7b480){if(_0xe7b480){return _0xe7b480?{'count':_0x445a5b,'rows':_0xe7b480}:null;}})['then'](respondWithResult(_0x25ca4a,null))['catch'](handleError(_0x25ca4a,null));};
\ No newline at end of file
index c8bbaac..1370d25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','int_dynamics365_configurations','lodash'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xe14d,0x1ee));var _0xde14=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xe14d[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('Dynamics365Configuration',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4b84=['moment','path','rimraf','../../config/environment','Dynamics365Configuration','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x4b84[_0x6a0266];return _0x309e00;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x44b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44b8('0x3'));var rimraf=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var attributes=require('./intDynamics365Configuration.attributes');module['exports']=function(_0x55f25d,_0x996a8b){return _0x55f25d['define'](_0x44b8('0x6'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 95387b1..ac3c440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c3b=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x309d68,_0x1036c9){var _0xcee19a=function(_0x3d1350){while(--_0x3d1350){_0x309d68['push'](_0x309d68['shift']());}};_0xcee19a(++_0x1036c9);}(_0x4c3b,0xc9));var _0xb4c3=function(_0xc540c5,_0x265dc8){_0xc540c5=_0xc540c5-0x0;var _0x2cc2ab=_0x4c3b[_0xc540c5];return _0x2cc2ab;};'use strict';var _=require(_0xb4c3('0x0'));var util=require(_0xb4c3('0x1'));var moment=require(_0xb4c3('0x2'));var BPromise=require(_0xb4c3('0x3'));var rs=require(_0xb4c3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4c3('0x5'))['db'];var utils=require(_0xb4c3('0x6'));var logger=require(_0xb4c3('0x7'))(_0xb4c3('0x8'));var config=require(_0xb4c3('0x9'));var jayson=require(_0xb4c3('0xa'));var client=jayson[_0xb4c3('0xb')][_0xb4c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53db3b,_0x4f2df9,_0x4217b8){return new BPromise(function(_0x1ede7f,_0x3d016d){return client[_0xb4c3('0xd')](_0x53db3b,_0x4217b8)[_0xb4c3('0xe')](function(_0x479759){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4f2df9,_0xb4c3('0xf'));logger[_0xb4c3('0x10')](_0xb4c3('0x11'),_0x4f2df9,_0xb4c3('0xf'),JSON['stringify'](_0x479759));if(_0x479759['error']){if(_0x479759[_0xb4c3('0x12')]['code']===0x1f4){logger[_0xb4c3('0x12')](_0xb4c3('0x13'),_0x4f2df9,_0x479759['error']['message']);return _0x3d016d(_0x479759[_0xb4c3('0x12')][_0xb4c3('0x14')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4f2df9,_0x479759[_0xb4c3('0x12')]['message']);return _0x1ede7f(_0x479759[_0xb4c3('0x12')]['message']);}else{logger[_0xb4c3('0x15')](_0xb4c3('0x13'),_0x4f2df9,_0xb4c3('0xf'));_0x1ede7f(_0x479759[_0xb4c3('0x16')][_0xb4c3('0x14')]);}})[_0xb4c3('0x17')](function(_0x302074){logger[_0xb4c3('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4f2df9,_0x302074);_0x3d016d(_0x302074);});});}
\ No newline at end of file
+var _0x326d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x326d,0x1bd));var _0xd326=function(_0x5ef516,_0x23266d){_0x5ef516=_0x5ef516-0x0;var _0x2a65b7=_0x326d[_0x5ef516];return _0x2a65b7;};'use strict';var _=require(_0xd326('0x0'));var util=require(_0xd326('0x1'));var moment=require(_0xd326('0x2'));var BPromise=require(_0xd326('0x3'));var rs=require(_0xd326('0x4'));var fs=require('fs');var Redis=require(_0xd326('0x5'));var db=require(_0xd326('0x6'))['db'];var utils=require(_0xd326('0x7'));var logger=require(_0xd326('0x8'))(_0xd326('0x9'));var config=require(_0xd326('0xa'));var jayson=require(_0xd326('0xb'));var client=jayson[_0xd326('0xc')][_0xd326('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4a859b,_0x4f54d4,_0x5c7c22){return new BPromise(function(_0x30e2d1,_0x50b24a){return client['request'](_0x4a859b,_0x5c7c22)[_0xd326('0xe')](function(_0x25833f){logger[_0xd326('0xf')](_0xd326('0x10'),_0x4f54d4,_0xd326('0x11'));logger[_0xd326('0x12')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x4f54d4,'request\x20sent',JSON[_0xd326('0x13')](_0x25833f));if(_0x25833f[_0xd326('0x14')]){if(_0x25833f[_0xd326('0x14')][_0xd326('0x15')]===0x1f4){logger[_0xd326('0x14')](_0xd326('0x10'),_0x4f54d4,_0x25833f['error'][_0xd326('0x16')]);return _0x50b24a(_0x25833f[_0xd326('0x14')][_0xd326('0x16')]);}logger['error'](_0xd326('0x10'),_0x4f54d4,_0x25833f[_0xd326('0x14')][_0xd326('0x16')]);return _0x30e2d1(_0x25833f[_0xd326('0x14')]['message']);}else{logger['info'](_0xd326('0x10'),_0x4f54d4,_0xd326('0x11'));_0x30e2d1(_0x25833f[_0xd326('0x17')][_0xd326('0x16')]);}})[_0xd326('0x18')](function(_0x4c21f8){logger[_0xd326('0x14')](_0xd326('0x10'),_0x4f54d4,_0x4c21f8);_0x50b24a(_0x4c21f8);});});}
\ No newline at end of file
index a1492f2..5e2a50e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f35=['exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy'];(function(_0xb7cb72,_0x19d391){var _0x4b7570=function(_0x5a4a93){while(--_0x5a4a93){_0xb7cb72['push'](_0xb7cb72['shift']());}};_0x4b7570(++_0x19d391);}(_0x9f35,0x89));var _0x59f3=function(_0x35242a,_0xbfe266){_0x35242a=_0x35242a-0x0;var _0x39a7f6=_0x9f35[_0x35242a];return _0x39a7f6;};'use strict';var multer=require(_0x59f3('0x0'));var util=require(_0x59f3('0x1'));var path=require('path');var timeout=require(_0x59f3('0x2'));var express=require(_0x59f3('0x3'));var router=express['Router']();var fs_extra=require(_0x59f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x59f3('0x5'));var config=require('../../config/environment');var controller=require(_0x59f3('0x6'));router[_0x59f3('0x7')]('/',auth[_0x59f3('0x8')](),controller[_0x59f3('0x9')]);router['get'](_0x59f3('0xa'),auth[_0x59f3('0x8')](),controller['show']);router[_0x59f3('0xb')]('/',auth['isAuthenticated'](),controller[_0x59f3('0xc')]);router[_0x59f3('0xd')](_0x59f3('0xa'),auth[_0x59f3('0x8')](),controller[_0x59f3('0xe')]);router['delete'](_0x59f3('0xa'),auth[_0x59f3('0x8')](),controller[_0x59f3('0xf')]);module[_0x59f3('0x10')]=router;
\ No newline at end of file
+var _0x14f2=['connect-timeout','express','Router','../../components/auth/service','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x44abbc,_0x3258e1){var _0x1d3158=function(_0x1ccd64){while(--_0x1ccd64){_0x44abbc['push'](_0x44abbc['shift']());}};_0x1d3158(++_0x3258e1);}(_0x14f2,0xca));var _0x214f=function(_0x597a8e,_0x5bb918){_0x597a8e=_0x597a8e-0x0;var _0x163624=_0x14f2[_0x597a8e];return _0x163624;};'use strict';var multer=require(_0x214f('0x0'));var util=require('util');var path=require(_0x214f('0x1'));var timeout=require(_0x214f('0x2'));var express=require(_0x214f('0x3'));var router=express[_0x214f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x214f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x214f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x214f('0x6')](_0x214f('0x7'),auth[_0x214f('0x8')](),controller[_0x214f('0x9')]);router[_0x214f('0xa')]('/',auth['isAuthenticated'](),controller[_0x214f('0xb')]);router[_0x214f('0xc')](_0x214f('0x7'),auth[_0x214f('0x8')](),controller[_0x214f('0xd')]);router[_0x214f('0xe')](_0x214f('0x7'),auth[_0x214f('0x8')](),controller[_0x214f('0xf')]);module[_0x214f('0x10')]=router;
\ No newline at end of file
index 72067b8..47f5589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17c3=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue'];(function(_0x204e9f,_0x5cb184){var _0x1da35d=function(_0x5ea2fe){while(--_0x5ea2fe){_0x204e9f['push'](_0x204e9f['shift']());}};_0x1da35d(++_0x5cb184);}(_0x17c3,0x90));var _0x317c=function(_0x5abe61,_0xdb5b36){_0x5abe61=_0x5abe61-0x0;var _0x21d79f=_0x17c3[_0x5abe61];return _0x21d79f;};'use strict';var Sequelize=require(_0x317c('0x0'));module[_0x317c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x317c('0x2'),_0x317c('0x3'),_0x317c('0x4'),_0x317c('0x5'),_0x317c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x317c('0x7')]},'key':{'type':Sequelize[_0x317c('0x7')]},'keyType':{'type':Sequelize[_0x317c('0x8')](_0x317c('0x2'),_0x317c('0x3'),_0x317c('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x317c('0x7')]},'nameField':{'type':Sequelize[_0x317c('0x7')]},'customField':{'type':Sequelize[_0x317c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x317c('0x7')]}};
\ No newline at end of file
+var _0xf6e6=['BOOLEAN','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x15c068,_0x441624){var _0x369daf=function(_0x3868f0){while(--_0x3868f0){_0x15c068['push'](_0x15c068['shift']());}};_0x369daf(++_0x441624);}(_0xf6e6,0x181));var _0x6f6e=function(_0x2d360e,_0x250ab){_0x2d360e=_0x2d360e-0x0;var _0x244edd=_0xf6e6[_0x2d360e];return _0x244edd;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x6f6e('0x0')](_0x6f6e('0x1'),_0x6f6e('0x2'),_0x6f6e('0x3'),_0x6f6e('0x4'),_0x6f6e('0x5')),'defaultValue':_0x6f6e('0x1')},'content':{'type':Sequelize[_0x6f6e('0x6')]},'key':{'type':Sequelize[_0x6f6e('0x6')]},'keyType':{'type':Sequelize[_0x6f6e('0x0')]('string',_0x6f6e('0x2'),_0x6f6e('0x3'))},'keyContent':{'type':Sequelize[_0x6f6e('0x6')]},'idField':{'type':Sequelize[_0x6f6e('0x6')]},'nameField':{'type':Sequelize[_0x6f6e('0x6')]},'customField':{'type':Sequelize[_0x6f6e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6f6e('0x6')]}};
\ No newline at end of file
index 5ac6beb..51ed286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9deb=['find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','includeAll','include','rows','catch','params','create','body'];(function(_0x229c5b,_0x48ae8d){var _0x1e3351=function(_0x4b29a9){while(--_0x4b29a9){_0x229c5b['push'](_0x229c5b['shift']());}};_0x1e3351(++_0x48ae8d);}(_0x9deb,0x11d));var _0xb9de=function(_0x36c5f9,_0x12724d){_0x36c5f9=_0x36c5f9-0x0;var _0x1962d6=_0x9deb[_0x36c5f9];return _0x1962d6;};'use strict';var emlformat=require(_0xb9de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9de('0x1'));var jsonpatch=require(_0xb9de('0x2'));var rp=require(_0xb9de('0x3'));var moment=require('moment');var BPromise=require(_0xb9de('0x4'));var Mustache=require(_0xb9de('0x5'));var util=require(_0xb9de('0x6'));var path=require(_0xb9de('0x7'));var sox=require(_0xb9de('0x8'));var csv=require(_0xb9de('0x9'));var ejs=require(_0xb9de('0xa'));var fs=require('fs');var fs_extra=require(_0xb9de('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb9de('0xc'));var jsforce=require(_0xb9de('0xd'));var deskjs=require(_0xb9de('0xe'));var toCsv=require(_0xb9de('0x9'));var querystring=require(_0xb9de('0xf'));var Papa=require('papaparse');var Redis=require(_0xb9de('0x10'));var authService=require(_0xb9de('0x11'));var qs=require(_0xb9de('0x12'));var as=require(_0xb9de('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb9de('0x14'));var utils=require(_0xb9de('0x15'));var config=require(_0xb9de('0x16'));var licenseUtil=require(_0xb9de('0x17'));var db=require(_0xb9de('0x18'))['db'];function respondWithStatusCode(_0xaf4002,_0x4d4cb5){_0x4d4cb5=_0x4d4cb5||0xcc;return function(_0x37ac38){if(_0x37ac38){return _0xaf4002[_0xb9de('0x19')](_0x4d4cb5);}return _0xaf4002['status'](_0x4d4cb5)[_0xb9de('0x1a')]();};}function respondWithResult(_0x2cb33d,_0x56d1ed){_0x56d1ed=_0x56d1ed||0xc8;return function(_0x3f2d5b){if(_0x3f2d5b){return _0x2cb33d[_0xb9de('0x1b')](_0x56d1ed)[_0xb9de('0x1c')](_0x3f2d5b);}};}function respondWithFilteredResult(_0x276cb3,_0x39efcd){return function(_0x479edf){if(_0x479edf){var _0x21b36d=typeof _0x39efcd[_0xb9de('0x1d')]===_0xb9de('0x1e')&&typeof _0x39efcd['limit']===_0xb9de('0x1e');var _0x2ea899=_0x479edf[_0xb9de('0x1f')];var _0x17cac3=_0x21b36d?0x0:_0x39efcd[_0xb9de('0x1d')];var _0x413f4b=_0x21b36d?_0x479edf[_0xb9de('0x1f')]:_0x39efcd[_0xb9de('0x1d')]+_0x39efcd[_0xb9de('0x20')];var _0x254a3d;if(_0x413f4b>=_0x2ea899){_0x413f4b=_0x2ea899;_0x254a3d=0xc8;}else{_0x254a3d=0xce;}_0x276cb3[_0xb9de('0x1b')](_0x254a3d);return _0x276cb3[_0xb9de('0x21')]('Content-Range',_0x17cac3+'-'+_0x413f4b+'/'+_0x2ea899)['json'](_0x479edf);}return null;};}function patchUpdates(_0x54d0e1){return function(_0xc4ee3c){try{jsonpatch['apply'](_0xc4ee3c,_0x54d0e1,!![]);}catch(_0x1f96ae){return BPromise[_0xb9de('0x22')](_0x1f96ae);}return _0xc4ee3c[_0xb9de('0x23')]();};}function saveUpdates(_0x584f67,_0x10519f){return function(_0x152faf){if(_0x152faf){return _0x152faf[_0xb9de('0x24')](_0x584f67)[_0xb9de('0x25')](function(_0x58eeb2){return _0x58eeb2;});}return null;};}function removeEntity(_0x4f447f,_0x273603){return function(_0x4a79b6){if(_0x4a79b6){return _0x4a79b6[_0xb9de('0x26')]()['then'](function(){_0x4f447f[_0xb9de('0x1b')](0xcc)[_0xb9de('0x1a')]();});}};}function handleEntityNotFound(_0x2bf5ec,_0x56f216){return function(_0x159377){if(!_0x159377){_0x2bf5ec[_0xb9de('0x19')](0x194);}return _0x159377;};}function handleError(_0x3c38b6,_0x1dffec){_0x1dffec=_0x1dffec||0x1f4;return function(_0x549a38){logger[_0xb9de('0x27')](_0x549a38[_0xb9de('0x28')]);if(_0x549a38['name']){delete _0x549a38[_0xb9de('0x29')];}_0x3c38b6[_0xb9de('0x1b')](_0x1dffec)[_0xb9de('0x2a')](_0x549a38);};}exports[_0xb9de('0x2b')]=function(_0xe96855,_0x35f2f5){var _0x52caf6={},_0x58792f={},_0x2f1465={'count':0x0,'rows':[]};var _0x541da5=_['map'](db[_0xb9de('0x2c')][_0xb9de('0x2d')],function(_0x1cbeb5){return{'name':_0x1cbeb5[_0xb9de('0x2e')],'type':_0x1cbeb5['type'][_0xb9de('0x2f')]};});_0x58792f[_0xb9de('0x30')]=_['map'](_0x541da5,_0xb9de('0x29'));_0x58792f[_0xb9de('0x31')]=_[_0xb9de('0x32')](_0xe96855[_0xb9de('0x31')]);_0x58792f['filters']=_['intersection'](_0x58792f[_0xb9de('0x30')],_0x58792f[_0xb9de('0x31')]);_0x52caf6[_0xb9de('0x33')]=_[_0xb9de('0x34')](_0x58792f[_0xb9de('0x30')],qs[_0xb9de('0x35')](_0xe96855[_0xb9de('0x31')]['fields']));_0x52caf6[_0xb9de('0x33')]=_0x52caf6[_0xb9de('0x33')][_0xb9de('0x36')]?_0x52caf6['attributes']:_0x58792f[_0xb9de('0x30')];if(!_0xe96855[_0xb9de('0x31')][_0xb9de('0x37')](_0xb9de('0x38'))){_0x52caf6[_0xb9de('0x20')]=qs[_0xb9de('0x20')](_0xe96855[_0xb9de('0x31')][_0xb9de('0x20')]);_0x52caf6[_0xb9de('0x1d')]=qs[_0xb9de('0x1d')](_0xe96855[_0xb9de('0x31')][_0xb9de('0x1d')]);}_0x52caf6['order']=qs[_0xb9de('0x39')](_0xe96855[_0xb9de('0x31')][_0xb9de('0x39')]);_0x52caf6[_0xb9de('0x3a')]=qs['filters'](_[_0xb9de('0x3b')](_0xe96855[_0xb9de('0x31')],_0x58792f[_0xb9de('0x3c')]),_0x541da5);if(_0xe96855[_0xb9de('0x31')][_0xb9de('0x3d')]){_0x52caf6[_0xb9de('0x3a')]=_[_0xb9de('0x3e')](_0x52caf6[_0xb9de('0x3a')],{'$or':_['map'](_0x541da5,function(_0x2b9e65){if(_0x2b9e65['type']!=='VIRTUAL'){var _0x576f41={};_0x576f41[_0x2b9e65['name']]={'$like':'%'+_0xe96855[_0xb9de('0x31')][_0xb9de('0x3d')]+'%'};return _0x576f41;}})});}_0x52caf6=_[_0xb9de('0x3e')]({},_0x52caf6,_0xe96855['options']);var _0x4b94e7={'where':_0x52caf6[_0xb9de('0x3a')]};return db[_0xb9de('0x2c')][_0xb9de('0x1f')](_0x4b94e7)[_0xb9de('0x25')](function(_0x1def37){_0x2f1465[_0xb9de('0x1f')]=_0x1def37;if(_0xe96855[_0xb9de('0x31')][_0xb9de('0x3f')]){_0x52caf6[_0xb9de('0x40')]=[{'all':!![]}];}return db[_0xb9de('0x2c')]['findAll'](_0x52caf6);})[_0xb9de('0x25')](function(_0x262e43){_0x2f1465[_0xb9de('0x41')]=_0x262e43;return _0x2f1465;})[_0xb9de('0x25')](respondWithFilteredResult(_0x35f2f5,_0x52caf6))[_0xb9de('0x42')](handleError(_0x35f2f5,null));};exports['show']=function(_0x50e551,_0x2767fc){var _0x3e3420={'raw':!![],'where':{'id':_0x50e551[_0xb9de('0x43')]['id']}},_0x45b473={};_0x45b473[_0xb9de('0x30')]=_[_0xb9de('0x32')](db[_0xb9de('0x2c')]['rawAttributes']);_0x45b473[_0xb9de('0x31')]=_[_0xb9de('0x32')](_0x50e551[_0xb9de('0x31')]);_0x45b473[_0xb9de('0x3c')]=_[_0xb9de('0x34')](_0x45b473[_0xb9de('0x30')],_0x45b473[_0xb9de('0x31')]);_0x3e3420[_0xb9de('0x33')]=_[_0xb9de('0x34')](_0x45b473['model'],qs['fields'](_0x50e551[_0xb9de('0x31')]['fields']));_0x3e3420[_0xb9de('0x33')]=_0x3e3420[_0xb9de('0x33')][_0xb9de('0x36')]?_0x3e3420[_0xb9de('0x33')]:_0x45b473['model'];if(_0x50e551['query']['includeAll']){_0x3e3420[_0xb9de('0x40')]=[{'all':!![]}];}_0x3e3420=_[_0xb9de('0x3e')]({},_0x3e3420,_0x50e551['options']);return db['Dynamics365Field']['find'](_0x3e3420)[_0xb9de('0x25')](handleEntityNotFound(_0x2767fc,null))[_0xb9de('0x25')](respondWithResult(_0x2767fc,null))['catch'](handleError(_0x2767fc,null));};exports['create']=function(_0x27fae3,_0xbe5273){return db['Dynamics365Field'][_0xb9de('0x44')](_0x27fae3[_0xb9de('0x45')],{})[_0xb9de('0x25')](respondWithResult(_0xbe5273,0xc9))[_0xb9de('0x42')](handleError(_0xbe5273,null));};exports['update']=function(_0x1ea1e5,_0x161a83){if(_0x1ea1e5['body']['id']){delete _0x1ea1e5['body']['id'];}return db[_0xb9de('0x2c')][_0xb9de('0x46')]({'where':{'id':_0x1ea1e5[_0xb9de('0x43')]['id']}})[_0xb9de('0x25')](handleEntityNotFound(_0x161a83,null))[_0xb9de('0x25')](saveUpdates(_0x1ea1e5[_0xb9de('0x45')],null))['then'](respondWithResult(_0x161a83,null))[_0xb9de('0x42')](handleError(_0x161a83,null));};exports[_0xb9de('0x26')]=function(_0x21d46f,_0x8e20a9){return db[_0xb9de('0x2c')][_0xb9de('0x46')]({'where':{'id':_0x21d46f[_0xb9de('0x43')]['id']}})['then'](handleEntityNotFound(_0x8e20a9,null))[_0xb9de('0x25')](removeEntity(_0x8e20a9,null))[_0xb9de('0x42')](handleError(_0x8e20a9,null));};
\ No newline at end of file
+var _0x7282=['limit','Content-Range','reject','destroy','then','stack','name','send','index','map','Dynamics365Field','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','merge','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7282,0x1bf));var _0x2728=function(_0x2bb452,_0x2dbbc0){_0x2bb452=_0x2bb452-0x0;var _0x5f50a6=_0x7282[_0x2bb452];return _0x5f50a6;};'use strict';var emlformat=require(_0x2728('0x0'));var rimraf=require(_0x2728('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2728('0x2'));var rp=require('request-promise');var moment=require(_0x2728('0x3'));var BPromise=require(_0x2728('0x4'));var Mustache=require(_0x2728('0x5'));var util=require(_0x2728('0x6'));var path=require(_0x2728('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2728('0x8'));var _=require('lodash');var squel=require(_0x2728('0x9'));var crypto=require(_0x2728('0xa'));var jsforce=require(_0x2728('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2728('0xc'));var querystring=require(_0x2728('0xd'));var Papa=require('papaparse');var Redis=require(_0x2728('0xe'));var authService=require(_0x2728('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2728('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2728('0x11'))(_0x2728('0x12'));var utils=require(_0x2728('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2728('0x14'));var db=require(_0x2728('0x15'))['db'];function respondWithStatusCode(_0x2c64fb,_0x3e0132){_0x3e0132=_0x3e0132||0xcc;return function(_0x38a0b7){if(_0x38a0b7){return _0x2c64fb[_0x2728('0x16')](_0x3e0132);}return _0x2c64fb[_0x2728('0x17')](_0x3e0132)[_0x2728('0x18')]();};}function respondWithResult(_0x640219,_0x4c75ca){_0x4c75ca=_0x4c75ca||0xc8;return function(_0x46a75d){if(_0x46a75d){return _0x640219[_0x2728('0x17')](_0x4c75ca)[_0x2728('0x19')](_0x46a75d);}};}function respondWithFilteredResult(_0x1dfb20,_0x531bb1){return function(_0x614beb){if(_0x614beb){var _0x3e31c6=typeof _0x531bb1['offset']==='undefined'&&typeof _0x531bb1['limit']===_0x2728('0x1a');var _0x15dc70=_0x614beb[_0x2728('0x1b')];var _0x3039cf=_0x3e31c6?0x0:_0x531bb1[_0x2728('0x1c')];var _0x36f725=_0x3e31c6?_0x614beb[_0x2728('0x1b')]:_0x531bb1[_0x2728('0x1c')]+_0x531bb1[_0x2728('0x1d')];var _0x374309;if(_0x36f725>=_0x15dc70){_0x36f725=_0x15dc70;_0x374309=0xc8;}else{_0x374309=0xce;}_0x1dfb20[_0x2728('0x17')](_0x374309);return _0x1dfb20['set'](_0x2728('0x1e'),_0x3039cf+'-'+_0x36f725+'/'+_0x15dc70)[_0x2728('0x19')](_0x614beb);}return null;};}function patchUpdates(_0x3a2c4b){return function(_0x3ecdc8){try{jsonpatch['apply'](_0x3ecdc8,_0x3a2c4b,!![]);}catch(_0x383719){return BPromise[_0x2728('0x1f')](_0x383719);}return _0x3ecdc8['save']();};}function saveUpdates(_0x17f0b6,_0x26c870){return function(_0x5dd5f1){if(_0x5dd5f1){return _0x5dd5f1['update'](_0x17f0b6)['then'](function(_0x335594){return _0x335594;});}return null;};}function removeEntity(_0x325ca0,_0x24c550){return function(_0x33218e){if(_0x33218e){return _0x33218e[_0x2728('0x20')]()[_0x2728('0x21')](function(){_0x325ca0[_0x2728('0x17')](0xcc)[_0x2728('0x18')]();});}};}function handleEntityNotFound(_0x45484f,_0x1ca5d5){return function(_0x57a620){if(!_0x57a620){_0x45484f[_0x2728('0x16')](0x194);}return _0x57a620;};}function handleError(_0x2aa24c,_0x495710){_0x495710=_0x495710||0x1f4;return function(_0x4f223c){logger['error'](_0x4f223c[_0x2728('0x22')]);if(_0x4f223c[_0x2728('0x23')]){delete _0x4f223c[_0x2728('0x23')];}_0x2aa24c[_0x2728('0x17')](_0x495710)[_0x2728('0x24')](_0x4f223c);};}exports[_0x2728('0x25')]=function(_0x1378e7,_0x126fb7){var _0x32bc96={},_0x1752b9={},_0x2c8ae9={'count':0x0,'rows':[]};var _0x5286e2=_[_0x2728('0x26')](db[_0x2728('0x27')]['rawAttributes'],function(_0x1405f1){return{'name':_0x1405f1['fieldName'],'type':_0x1405f1[_0x2728('0x28')][_0x2728('0x29')]};});_0x1752b9[_0x2728('0x2a')]=_[_0x2728('0x26')](_0x5286e2,_0x2728('0x23'));_0x1752b9[_0x2728('0x2b')]=_[_0x2728('0x2c')](_0x1378e7[_0x2728('0x2b')]);_0x1752b9[_0x2728('0x2d')]=_[_0x2728('0x2e')](_0x1752b9[_0x2728('0x2a')],_0x1752b9[_0x2728('0x2b')]);_0x32bc96[_0x2728('0x2f')]=_[_0x2728('0x2e')](_0x1752b9[_0x2728('0x2a')],qs[_0x2728('0x30')](_0x1378e7['query'][_0x2728('0x30')]));_0x32bc96[_0x2728('0x2f')]=_0x32bc96[_0x2728('0x2f')][_0x2728('0x31')]?_0x32bc96['attributes']:_0x1752b9['model'];if(!_0x1378e7['query'][_0x2728('0x32')](_0x2728('0x33'))){_0x32bc96[_0x2728('0x1d')]=qs[_0x2728('0x1d')](_0x1378e7['query'][_0x2728('0x1d')]);_0x32bc96[_0x2728('0x1c')]=qs[_0x2728('0x1c')](_0x1378e7[_0x2728('0x2b')][_0x2728('0x1c')]);}_0x32bc96['order']=qs[_0x2728('0x34')](_0x1378e7[_0x2728('0x2b')][_0x2728('0x34')]);_0x32bc96['where']=qs[_0x2728('0x2d')](_['pick'](_0x1378e7[_0x2728('0x2b')],_0x1752b9['filters']),_0x5286e2);if(_0x1378e7['query']['filter']){_0x32bc96['where']=_[_0x2728('0x35')](_0x32bc96[_0x2728('0x36')],{'$or':_[_0x2728('0x26')](_0x5286e2,function(_0x5bf2a3){if(_0x5bf2a3[_0x2728('0x28')]!==_0x2728('0x37')){var _0x205ccf={};_0x205ccf[_0x5bf2a3[_0x2728('0x23')]]={'$like':'%'+_0x1378e7['query'][_0x2728('0x38')]+'%'};return _0x205ccf;}})});}_0x32bc96=_[_0x2728('0x35')]({},_0x32bc96,_0x1378e7['options']);var _0x5f3ded={'where':_0x32bc96[_0x2728('0x36')]};return db[_0x2728('0x27')][_0x2728('0x1b')](_0x5f3ded)[_0x2728('0x21')](function(_0xd745e5){_0x2c8ae9[_0x2728('0x1b')]=_0xd745e5;if(_0x1378e7[_0x2728('0x2b')][_0x2728('0x39')]){_0x32bc96[_0x2728('0x3a')]=[{'all':!![]}];}return db[_0x2728('0x27')][_0x2728('0x3b')](_0x32bc96);})[_0x2728('0x21')](function(_0x5e9a86){_0x2c8ae9[_0x2728('0x3c')]=_0x5e9a86;return _0x2c8ae9;})['then'](respondWithFilteredResult(_0x126fb7,_0x32bc96))[_0x2728('0x3d')](handleError(_0x126fb7,null));};exports[_0x2728('0x3e')]=function(_0x42921c,_0x59ac93){var _0xe2eaf6={'raw':!![],'where':{'id':_0x42921c[_0x2728('0x3f')]['id']}},_0x20576f={};_0x20576f[_0x2728('0x2a')]=_[_0x2728('0x2c')](db['Dynamics365Field'][_0x2728('0x40')]);_0x20576f['query']=_[_0x2728('0x2c')](_0x42921c['query']);_0x20576f['filters']=_[_0x2728('0x2e')](_0x20576f[_0x2728('0x2a')],_0x20576f[_0x2728('0x2b')]);_0xe2eaf6[_0x2728('0x2f')]=_[_0x2728('0x2e')](_0x20576f[_0x2728('0x2a')],qs[_0x2728('0x30')](_0x42921c[_0x2728('0x2b')]['fields']));_0xe2eaf6[_0x2728('0x2f')]=_0xe2eaf6[_0x2728('0x2f')][_0x2728('0x31')]?_0xe2eaf6['attributes']:_0x20576f[_0x2728('0x2a')];if(_0x42921c[_0x2728('0x2b')]['includeAll']){_0xe2eaf6[_0x2728('0x3a')]=[{'all':!![]}];}_0xe2eaf6=_[_0x2728('0x35')]({},_0xe2eaf6,_0x42921c['options']);return db[_0x2728('0x27')]['find'](_0xe2eaf6)[_0x2728('0x21')](handleEntityNotFound(_0x59ac93,null))['then'](respondWithResult(_0x59ac93,null))[_0x2728('0x3d')](handleError(_0x59ac93,null));};exports[_0x2728('0x41')]=function(_0x23a840,_0x42d37c){return db['Dynamics365Field'][_0x2728('0x41')](_0x23a840[_0x2728('0x42')],{})['then'](respondWithResult(_0x42d37c,0xc9))[_0x2728('0x3d')](handleError(_0x42d37c,null));};exports['update']=function(_0x37dc84,_0x1aa6e4){if(_0x37dc84[_0x2728('0x42')]['id']){delete _0x37dc84[_0x2728('0x42')]['id'];}return db[_0x2728('0x27')][_0x2728('0x43')]({'where':{'id':_0x37dc84['params']['id']}})[_0x2728('0x21')](handleEntityNotFound(_0x1aa6e4,null))[_0x2728('0x21')](saveUpdates(_0x37dc84[_0x2728('0x42')],null))[_0x2728('0x21')](respondWithResult(_0x1aa6e4,null))[_0x2728('0x3d')](handleError(_0x1aa6e4,null));};exports[_0x2728('0x20')]=function(_0x30eda9,_0x5af788){return db['Dynamics365Field'][_0x2728('0x43')]({'where':{'id':_0x30eda9[_0x2728('0x3f')]['id']}})[_0x2728('0x21')](handleEntityNotFound(_0x5af788,null))['then'](removeEntity(_0x5af788,null))[_0x2728('0x3d')](handleError(_0x5af788,null));};
\ No newline at end of file
index 1ac9e4e..f423158 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1596=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','dynamics365_unique_index','idField','FieldId'];(function(_0x13a9d1,_0x35d032){var _0xbc602d=function(_0x2bde7a){while(--_0x2bde7a){_0x13a9d1['push'](_0x13a9d1['shift']());}};_0xbc602d(++_0x35d032);}(_0x1596,0xa8));var _0x6159=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1596[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var logger=require(_0x6159('0x2'))('api');var moment=require(_0x6159('0x3'));var BPromise=require(_0x6159('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6159('0x5'));var rimraf=require(_0x6159('0x6'));var config=require(_0x6159('0x7'));var attributes=require(_0x6159('0x8'));module[_0x6159('0x9')]=function(_0x17ca88,_0x824a04){return _0x17ca88['define'](_0x6159('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x6159('0xb'),'fields':[_0x6159('0xc'),_0x6159('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3931=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0x3931,0x16d));var _0x1393=function(_0x33de0a,_0x30e3bd){_0x33de0a=_0x33de0a-0x0;var _0x266c2e=_0x3931[_0x33de0a];return _0x266c2e;};'use strict';var _=require(_0x1393('0x0'));var util=require(_0x1393('0x1'));var logger=require(_0x1393('0x2'))(_0x1393('0x3'));var moment=require(_0x1393('0x4'));var BPromise=require(_0x1393('0x5'));var rp=require(_0x1393('0x6'));var fs=require('fs');var path=require(_0x1393('0x7'));var rimraf=require(_0x1393('0x8'));var config=require(_0x1393('0x9'));var attributes=require(_0x1393('0xa'));module['exports']=function(_0x5f3041,_0x46b354){return _0x5f3041[_0x1393('0xb')](_0x1393('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x1393('0xd'),'fields':[_0x1393('0xe'),_0x1393('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d652227..d9566f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6857=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x3a3569,_0x1fdbf4){var _0x3ca86c=function(_0x4cf534){while(--_0x4cf534){_0x3a3569['push'](_0x3a3569['shift']());}};_0x3ca86c(++_0x1fdbf4);}(_0x6857,0x175));var _0x7685=function(_0x418c51,_0x40e1fd){_0x418c51=_0x418c51-0x0;var _0x3ab926=_0x6857[_0x418c51];return _0x3ab926;};'use strict';var _=require(_0x7685('0x0'));var util=require('util');var moment=require(_0x7685('0x1'));var BPromise=require(_0x7685('0x2'));var rs=require(_0x7685('0x3'));var fs=require('fs');var Redis=require(_0x7685('0x4'));var db=require(_0x7685('0x5'))['db'];var utils=require(_0x7685('0x6'));var logger=require('../../config/logger')(_0x7685('0x7'));var config=require(_0x7685('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7685('0x9')][_0x7685('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x360e4d,_0x5225dd,_0x930444){return new BPromise(function(_0x150068,_0x638d9c){return client[_0x7685('0xb')](_0x360e4d,_0x930444)['then'](function(_0x38006c){logger[_0x7685('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x5225dd,'request\x20sent');logger['debug'](_0x7685('0xd'),_0x5225dd,_0x7685('0xe'),JSON[_0x7685('0xf')](_0x38006c));if(_0x38006c['error']){if(_0x38006c[_0x7685('0x10')][_0x7685('0x11')]===0x1f4){logger[_0x7685('0x10')](_0x7685('0x12'),_0x5225dd,_0x38006c[_0x7685('0x10')]['message']);return _0x638d9c(_0x38006c['error'][_0x7685('0x13')]);}logger[_0x7685('0x10')](_0x7685('0x12'),_0x5225dd,_0x38006c[_0x7685('0x10')]['message']);return _0x150068(_0x38006c[_0x7685('0x10')][_0x7685('0x13')]);}else{logger['info'](_0x7685('0x12'),_0x5225dd,_0x7685('0xe'));_0x150068(_0x38006c[_0x7685('0x14')][_0x7685('0x13')]);}})[_0x7685('0x15')](function(_0x4b843b){logger['error'](_0x7685('0x12'),_0x5225dd,_0x4b843b);_0x638d9c(_0x4b843b);});});}
\ No newline at end of file
+var _0x94cb=['Dynamics365Field,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x44d97a,_0x3b7e19){var _0x2be6a9=function(_0x777cec){while(--_0x777cec){_0x44d97a['push'](_0x44d97a['shift']());}};_0x2be6a9(++_0x3b7e19);}(_0x94cb,0x1a2));var _0xb94c=function(_0x2bf906,_0xac4094){_0x2bf906=_0x2bf906-0x0;var _0x22a00f=_0x94cb[_0x2bf906];return _0x22a00f;};'use strict';var _=require(_0xb94c('0x0'));var util=require(_0xb94c('0x1'));var moment=require(_0xb94c('0x2'));var BPromise=require(_0xb94c('0x3'));var rs=require(_0xb94c('0x4'));var fs=require('fs');var Redis=require(_0xb94c('0x5'));var db=require(_0xb94c('0x6'))['db'];var utils=require(_0xb94c('0x7'));var logger=require('../../config/logger')(_0xb94c('0x8'));var config=require(_0xb94c('0x9'));var jayson=require(_0xb94c('0xa'));var client=jayson[_0xb94c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f519,_0x4e73e7,_0x33cc7e){return new BPromise(function(_0xe32aa2,_0xa94353){return client['request'](_0x54f519,_0x33cc7e)[_0xb94c('0xc')](function(_0x3cf1b7){logger[_0xb94c('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x4e73e7,_0xb94c('0xe'));logger[_0xb94c('0xf')](_0xb94c('0x10'),_0x4e73e7,_0xb94c('0xe'),JSON['stringify'](_0x3cf1b7));if(_0x3cf1b7['error']){if(_0x3cf1b7[_0xb94c('0x11')][_0xb94c('0x12')]===0x1f4){logger['error'](_0xb94c('0x13'),_0x4e73e7,_0x3cf1b7[_0xb94c('0x11')]['message']);return _0xa94353(_0x3cf1b7[_0xb94c('0x11')][_0xb94c('0x14')]);}logger[_0xb94c('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x4e73e7,_0x3cf1b7[_0xb94c('0x11')][_0xb94c('0x14')]);return _0xe32aa2(_0x3cf1b7['error'][_0xb94c('0x14')]);}else{logger[_0xb94c('0xd')](_0xb94c('0x13'),_0x4e73e7,_0xb94c('0xe'));_0xe32aa2(_0x3cf1b7[_0xb94c('0x15')][_0xb94c('0x14')]);}})[_0xb94c('0x16')](function(_0x872d5c){logger[_0xb94c('0x11')](_0xb94c('0x13'),_0x4e73e7,_0x872d5c);_0xa94353(_0x872d5c);});});}
\ No newline at end of file
index baaa646..bd14d9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6fb=['/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x452b17,_0x36366f){var _0x4172f9=function(_0x105c32){while(--_0x105c32){_0x452b17['push'](_0x452b17['shift']());}};_0x4172f9(++_0x36366f);}(_0xa6fb,0xd5));var _0xba6f=function(_0x197afe,_0x5b4f36){_0x197afe=_0x197afe-0x0;var _0x227d26=_0xa6fb[_0x197afe];return _0x227d26;};'use strict';var multer=require(_0xba6f('0x0'));var util=require(_0xba6f('0x1'));var path=require(_0xba6f('0x2'));var timeout=require(_0xba6f('0x3'));var express=require(_0xba6f('0x4'));var router=express[_0xba6f('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xba6f('0x6'));var interaction=require(_0xba6f('0x7'));var config=require(_0xba6f('0x8'));var controller=require(_0xba6f('0x9'));router[_0xba6f('0xa')]('/',auth[_0xba6f('0xb')](),controller['index']);router[_0xba6f('0xa')]('/:id',auth[_0xba6f('0xb')](),controller['show']);router[_0xba6f('0xa')](_0xba6f('0xc'),auth[_0xba6f('0xb')](),controller['getConfigurations']);router[_0xba6f('0xa')](_0xba6f('0xd'),auth[_0xba6f('0xb')](),controller[_0xba6f('0xe')]);router[_0xba6f('0xf')]('/',auth[_0xba6f('0xb')](),controller[_0xba6f('0x10')]);router[_0xba6f('0xf')](_0xba6f('0xc'),auth[_0xba6f('0xb')](),controller[_0xba6f('0x11')]);router['put'](_0xba6f('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xba6f('0x13')](_0xba6f('0x12'),auth[_0xba6f('0xb')](),controller[_0xba6f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xb7b6=['getConfigurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations'];(function(_0x155a6c,_0x48b201){var _0x6497d=function(_0x11a6c9){while(--_0x11a6c9){_0x155a6c['push'](_0x155a6c['shift']());}};_0x6497d(++_0x48b201);}(_0xb7b6,0x1be));var _0x6b7b=function(_0x1002de,_0x4718ad){_0x1002de=_0x1002de-0x0;var _0x1a420d=_0xb7b6[_0x1002de];return _0x1a420d;};'use strict';var multer=require(_0x6b7b('0x0'));var util=require(_0x6b7b('0x1'));var path=require('path');var timeout=require(_0x6b7b('0x2'));var express=require(_0x6b7b('0x3'));var router=express[_0x6b7b('0x4')]();var fs_extra=require(_0x6b7b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6b7b('0x6'));var config=require('../../config/environment');var controller=require(_0x6b7b('0x7'));router[_0x6b7b('0x8')]('/',auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xa')]);router[_0x6b7b('0x8')](_0x6b7b('0xb'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xc')]);router[_0x6b7b('0x8')](_0x6b7b('0xd'),auth['isAuthenticated'](),controller[_0x6b7b('0xe')]);router[_0x6b7b('0x8')](_0x6b7b('0xf'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x10')]);router['post']('/',auth[_0x6b7b('0x9')](),controller['create']);router[_0x6b7b('0x11')](_0x6b7b('0xd'),auth['isAuthenticated'](),controller[_0x6b7b('0x12')]);router[_0x6b7b('0x13')]('/:id',auth[_0x6b7b('0x9')](),controller['update']);router[_0x6b7b('0x14')](_0x6b7b('0xb'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x15')]);module[_0x6b7b('0x16')]=router;
\ No newline at end of file
index 5d2210b..1862744 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b84=['sequelize','exports','STRING','username','remoteUri'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x7b84,0x17c));var _0x47b8=function(_0x1a43e1,_0x40654b){_0x1a43e1=_0x1a43e1-0x0;var _0x5b41ce=_0x7b84[_0x1a43e1];return _0x5b41ce;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'name':{'type':Sequelize[_0x47b8('0x2')]},'description':{'type':Sequelize[_0x47b8('0x2')]},'username':{'type':Sequelize[_0x47b8('0x2')],'unique':_0x47b8('0x3')},'apiKey':{'type':Sequelize[_0x47b8('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x47b8('0x4')},'serverUrl':{'type':Sequelize[_0x47b8('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa456=['STRING','username','sequelize','exports'];(function(_0x37c8a3,_0x98a584){var _0x2f2f70=function(_0x25517a){while(--_0x25517a){_0x37c8a3['push'](_0x37c8a3['shift']());}};_0x2f2f70(++_0x98a584);}(_0xa456,0x142));var _0x6a45=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa456[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x6a45('0x0'));module[_0x6a45('0x1')]={'name':{'type':Sequelize[_0x6a45('0x2')]},'description':{'type':Sequelize[_0x6a45('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x6a45('0x3')},'apiKey':{'type':Sequelize[_0x6a45('0x2')]},'remoteUri':{'type':Sequelize[_0x6a45('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6a45('0x2')],'allowNull':![]}};
\ No newline at end of file
index 95bcbac..1418e48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39c4=['destroy','findOne','FreshdeskConfiguration','Subjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','GET','%s/%s','format','toString','base64','requester','subject','agent','priority','group','source','ticket_type','remove','includes','default','custom_text','custom_dropdown','label','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','update','error','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','then','rows','catch','show','params','keys','includeAll','find','create','body'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0x39c4,0x174));var _0x439c=function(_0x1905ff,_0x31b31d){_0x1905ff=_0x1905ff-0x0;var _0x10ad5d=_0x39c4[_0x1905ff];return _0x10ad5d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x439c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x439c('0x1'));var moment=require(_0x439c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x439c('0x3'));var path=require(_0x439c('0x4'));var sox=require(_0x439c('0x5'));var csv=require(_0x439c('0x6'));var ejs=require(_0x439c('0x7'));var fs=require('fs');var fs_extra=require(_0x439c('0x8'));var _=require(_0x439c('0x9'));var squel=require(_0x439c('0xa'));var crypto=require(_0x439c('0xb'));var jsforce=require(_0x439c('0xc'));var deskjs=require(_0x439c('0xd'));var toCsv=require(_0x439c('0x6'));var querystring=require(_0x439c('0xe'));var Papa=require(_0x439c('0xf'));var Redis=require(_0x439c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x439c('0x11'));var as=require(_0x439c('0x12'));var hardwareService=require(_0x439c('0x13'));var logger=require(_0x439c('0x14'))(_0x439c('0x15'));var utils=require(_0x439c('0x16'));var config=require(_0x439c('0x17'));var licenseUtil=require(_0x439c('0x18'));var db=require(_0x439c('0x19'))['db'];var integrations=require(_0x439c('0x1a'));function respondWithStatusCode(_0x305154,_0x2bd89){_0x2bd89=_0x2bd89||0xcc;return function(_0x518179){if(_0x518179){return _0x305154[_0x439c('0x1b')](_0x2bd89);}return _0x305154['status'](_0x2bd89)['end']();};}function respondWithResult(_0x1e367a,_0x47182e){_0x47182e=_0x47182e||0xc8;return function(_0x486451){if(_0x486451){return _0x1e367a[_0x439c('0x1c')](_0x47182e)[_0x439c('0x1d')](_0x486451);}};}function respondWithFilteredResult(_0x5b8898,_0x4f5b71){return function(_0x38d60d){if(_0x38d60d){var _0x5478b4=typeof _0x4f5b71[_0x439c('0x1e')]===_0x439c('0x1f')&&typeof _0x4f5b71[_0x439c('0x20')]==='undefined';var _0x33aeb1=_0x38d60d[_0x439c('0x21')];var _0x4635e7=_0x5478b4?0x0:_0x4f5b71[_0x439c('0x1e')];var _0x569a31=_0x5478b4?_0x38d60d[_0x439c('0x21')]:_0x4f5b71[_0x439c('0x1e')]+_0x4f5b71[_0x439c('0x20')];var _0x52fe98;if(_0x569a31>=_0x33aeb1){_0x569a31=_0x33aeb1;_0x52fe98=0xc8;}else{_0x52fe98=0xce;}_0x5b8898[_0x439c('0x1c')](_0x52fe98);return _0x5b8898['set']('Content-Range',_0x4635e7+'-'+_0x569a31+'/'+_0x33aeb1)[_0x439c('0x1d')](_0x38d60d);}return null;};}function patchUpdates(_0x5c6214){return function(_0x22d8e0){try{jsonpatch[_0x439c('0x22')](_0x22d8e0,_0x5c6214,!![]);}catch(_0x29958c){return BPromise[_0x439c('0x23')](_0x29958c);}return _0x22d8e0[_0x439c('0x24')]();};}function saveUpdates(_0x7cdb81,_0x193883){return function(_0x373f19){if(_0x373f19){return _0x373f19[_0x439c('0x25')](_0x7cdb81)['then'](function(_0x1b83b2){return _0x1b83b2;});}return null;};}function removeEntity(_0x1f8ef6,_0x49c1e3){return function(_0x222ccd){if(_0x222ccd){return _0x222ccd['destroy']()['then'](function(){_0x1f8ef6[_0x439c('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3109,_0x467338){return function(_0x349d75){if(!_0x349d75){_0x2b3109[_0x439c('0x1b')](0x194);}return _0x349d75;};}function handleError(_0x390e59,_0x48cbf3){_0x48cbf3=_0x48cbf3||0x1f4;return function(_0x557dae){logger[_0x439c('0x26')](_0x557dae['stack']);if(_0x557dae[_0x439c('0x27')]){delete _0x557dae['name'];}_0x390e59[_0x439c('0x1c')](_0x48cbf3)[_0x439c('0x28')](_0x557dae);};}exports[_0x439c('0x29')]=function(_0x2f670b,_0x518b94){var _0x17ecfa={},_0x1fa033={},_0x291ab0={'count':0x0,'rows':[]};var _0x1ae717=_[_0x439c('0x2a')](db[_0x439c('0x2b')][_0x439c('0x2c')],function(_0x387833){return{'name':_0x387833[_0x439c('0x2d')],'type':_0x387833[_0x439c('0x2e')][_0x439c('0x2f')]};});_0x1fa033[_0x439c('0x30')]=_[_0x439c('0x2a')](_0x1ae717,_0x439c('0x27'));_0x1fa033['query']=_['keys'](_0x2f670b[_0x439c('0x31')]);_0x1fa033[_0x439c('0x32')]=_['intersection'](_0x1fa033[_0x439c('0x30')],_0x1fa033[_0x439c('0x31')]);_0x17ecfa[_0x439c('0x33')]=_[_0x439c('0x34')](_0x1fa033[_0x439c('0x30')],qs['fields'](_0x2f670b[_0x439c('0x31')][_0x439c('0x35')]));_0x17ecfa['attributes']=_0x17ecfa[_0x439c('0x33')][_0x439c('0x36')]?_0x17ecfa[_0x439c('0x33')]:_0x1fa033[_0x439c('0x30')];if(!_0x2f670b[_0x439c('0x31')][_0x439c('0x37')](_0x439c('0x38'))){_0x17ecfa[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x2f670b[_0x439c('0x31')][_0x439c('0x20')]);_0x17ecfa['offset']=qs[_0x439c('0x1e')](_0x2f670b['query'][_0x439c('0x1e')]);}_0x17ecfa[_0x439c('0x39')]=qs['sort'](_0x2f670b[_0x439c('0x31')][_0x439c('0x3a')]);_0x17ecfa['where']=qs['filters'](_[_0x439c('0x3b')](_0x2f670b['query'],_0x1fa033[_0x439c('0x32')]),_0x1ae717);if(_0x2f670b['query'][_0x439c('0x3c')]){_0x17ecfa[_0x439c('0x3d')]=_[_0x439c('0x3e')](_0x17ecfa[_0x439c('0x3d')],{'$or':_[_0x439c('0x2a')](_0x1ae717,function(_0x31ef6d){if(_0x31ef6d['type']!==_0x439c('0x3f')){var _0x47ac85={};_0x47ac85[_0x31ef6d[_0x439c('0x27')]]={'$like':'%'+_0x2f670b['query'][_0x439c('0x3c')]+'%'};return _0x47ac85;}})});}_0x17ecfa=_[_0x439c('0x3e')]({},_0x17ecfa,_0x2f670b[_0x439c('0x40')]);var _0x1a8d93={'where':_0x17ecfa[_0x439c('0x3d')]};return db[_0x439c('0x2b')][_0x439c('0x21')](_0x1a8d93)['then'](function(_0x5d3e22){_0x291ab0[_0x439c('0x21')]=_0x5d3e22;if(_0x2f670b[_0x439c('0x31')]['includeAll']){_0x17ecfa[_0x439c('0x41')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x17ecfa);})[_0x439c('0x42')](function(_0xa44162){_0x291ab0[_0x439c('0x43')]=_0xa44162;return _0x291ab0;})[_0x439c('0x42')](respondWithFilteredResult(_0x518b94,_0x17ecfa))[_0x439c('0x44')](handleError(_0x518b94,null));};exports[_0x439c('0x45')]=function(_0x3873bb,_0x5b31d8){var _0x340e07={'raw':![],'where':{'id':_0x3873bb[_0x439c('0x46')]['id']}},_0x45b24f={};_0x45b24f[_0x439c('0x30')]=_[_0x439c('0x47')](db['FreshdeskAccount'][_0x439c('0x2c')]);_0x45b24f[_0x439c('0x31')]=_[_0x439c('0x47')](_0x3873bb[_0x439c('0x31')]);_0x45b24f['filters']=_[_0x439c('0x34')](_0x45b24f[_0x439c('0x30')],_0x45b24f['query']);_0x340e07['attributes']=_['intersection'](_0x45b24f['model'],qs[_0x439c('0x35')](_0x3873bb['query']['fields']));_0x340e07[_0x439c('0x33')]=_0x340e07[_0x439c('0x33')]['length']?_0x340e07[_0x439c('0x33')]:_0x45b24f[_0x439c('0x30')];if(_0x3873bb[_0x439c('0x31')][_0x439c('0x48')]){_0x340e07[_0x439c('0x41')]=[{'all':!![]}];}_0x340e07=_['merge']({},_0x340e07,_0x3873bb[_0x439c('0x40')]);return db[_0x439c('0x2b')][_0x439c('0x49')](_0x340e07)[_0x439c('0x42')](handleEntityNotFound(_0x5b31d8,null))[_0x439c('0x42')](respondWithResult(_0x5b31d8,null))[_0x439c('0x44')](handleError(_0x5b31d8,null));};exports[_0x439c('0x4a')]=function(_0x2a090b,_0x12e102){return db[_0x439c('0x2b')][_0x439c('0x4a')](_0x2a090b[_0x439c('0x4b')],{})['then'](respondWithResult(_0x12e102,0xc9))[_0x439c('0x44')](handleError(_0x12e102,null));};exports[_0x439c('0x25')]=function(_0x180d0c,_0x4a5c56){if(_0x180d0c[_0x439c('0x4b')]['id']){delete _0x180d0c[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x180d0c[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a5c56,null))[_0x439c('0x42')](saveUpdates(_0x180d0c[_0x439c('0x4b')],null))[_0x439c('0x42')](respondWithResult(_0x4a5c56,null))[_0x439c('0x44')](handleError(_0x4a5c56,null));};exports[_0x439c('0x4c')]=function(_0x198648,_0x5dfebc){return db[_0x439c('0x2b')][_0x439c('0x49')]({'where':{'id':_0x198648[_0x439c('0x46')]['id']}})['then'](handleEntityNotFound(_0x5dfebc,null))[_0x439c('0x42')](removeEntity(_0x5dfebc,null))[_0x439c('0x44')](handleError(_0x5dfebc,null));};exports['getConfigurations']=function(_0x44919e,_0x5f1844,_0x565d5f){var _0x204cbf={};var _0x348847={};var _0x43ebf5;var _0x57e81e;return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x44919e[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5f1844,null))['then'](function(_0x4d3f8c){if(_0x4d3f8c){_0x43ebf5=_0x4d3f8c;_0x348847['model']=_[_0x439c('0x47')](db[_0x439c('0x4e')]['rawAttributes']);_0x348847[_0x439c('0x31')]=_[_0x439c('0x47')](_0x44919e[_0x439c('0x31')]);_0x348847[_0x439c('0x32')]=_['intersection'](_0x348847[_0x439c('0x30')],_0x348847[_0x439c('0x31')]);_0x204cbf[_0x439c('0x33')]=_[_0x439c('0x34')](_0x348847['model'],qs[_0x439c('0x35')](_0x44919e[_0x439c('0x31')][_0x439c('0x35')]));_0x204cbf[_0x439c('0x33')]=_0x204cbf[_0x439c('0x33')][_0x439c('0x36')]?_0x204cbf['attributes']:_0x348847[_0x439c('0x30')];_0x204cbf[_0x439c('0x39')]=qs[_0x439c('0x3a')](_0x44919e[_0x439c('0x31')][_0x439c('0x3a')]);_0x204cbf[_0x439c('0x3d')]=qs[_0x439c('0x32')](_['pick'](_0x44919e[_0x439c('0x31')],_0x348847['filters']));if(_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]){_0x204cbf[_0x439c('0x3d')]=_['merge'](_0x204cbf['where'],{'$or':_[_0x439c('0x2a')](_0x204cbf['attributes'],function(_0x16723e){var _0x37ddd4={};_0x37ddd4[_0x16723e]={'$like':'%'+_0x44919e[_0x439c('0x31')][_0x439c('0x3c')]+'%'};return _0x37ddd4;})});}_0x204cbf=_[_0x439c('0x3e')]({},_0x204cbf,_0x44919e[_0x439c('0x40')]);return _0x43ebf5['getConfigurations'](_0x204cbf);}})['then'](function(_0xbeacc1){if(_0xbeacc1){_0x57e81e=_0xbeacc1[_0x439c('0x36')];if(!_0x44919e[_0x439c('0x31')]['hasOwnProperty'](_0x439c('0x38'))){_0x204cbf[_0x439c('0x20')]=qs[_0x439c('0x20')](_0x44919e['query'][_0x439c('0x20')]);_0x204cbf[_0x439c('0x1e')]=qs[_0x439c('0x1e')](_0x44919e[_0x439c('0x31')][_0x439c('0x1e')]);}return _0x43ebf5['getConfigurations'](_0x204cbf);}})[_0x439c('0x42')](function(_0x481481){if(_0x481481){return _0x481481?{'count':_0x57e81e,'rows':_0x481481}:null;}})[_0x439c('0x42')](respondWithResult(_0x5f1844,null))[_0x439c('0x44')](handleError(_0x5f1844,null));};exports['addConfiguration']=function(_0x2aa589,_0x5bb5c4,_0x950a8e){if(_0x2aa589[_0x439c('0x4b')]['id']){delete _0x2aa589[_0x439c('0x4b')]['id'];}return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x2aa589[_0x439c('0x46')]['id']}})[_0x439c('0x42')](handleEntityNotFound(_0x5bb5c4,null))[_0x439c('0x42')](function(_0x59bd8d){if(_0x59bd8d){_0x2aa589['body']['AccountId']=_0x59bd8d['id'];_0x2aa589[_0x439c('0x4b')][_0x439c('0x4f')]=integrations['getSubjects'](_0x2aa589['body']['channel'],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);_0x2aa589['body']['Descriptions']=integrations[_0x439c('0x50')](_0x2aa589[_0x439c('0x4b')][_0x439c('0x51')],_0x2aa589[_0x439c('0x4b')][_0x439c('0x2e')]);return db[_0x439c('0x4e')]['create'](_0x2aa589[_0x439c('0x4b')],{'include':[{'model':db['FreshdeskField'],'as':_0x439c('0x4f')},{'model':db[_0x439c('0x52')],'as':_0x439c('0x53')}]});}return null;})[_0x439c('0x42')](respondWithResult(_0x5bb5c4,null))[_0x439c('0x44')](handleError(_0x5bb5c4,null));};exports[_0x439c('0x54')]=function(_0x338905,_0x1ddd58,_0x4543f8){var _0x3406ab='';return db[_0x439c('0x2b')][_0x439c('0x4d')]({'where':{'id':_0x338905[_0x439c('0x46')]['id']},'attributes':['id',_0x439c('0x55'),_0x439c('0x56')]})[_0x439c('0x42')](handleEntityNotFound(_0x1ddd58,null))[_0x439c('0x42')](function(_0xd3fdb0){if(_0xd3fdb0){_0x3406ab=_0xd3fdb0['remoteUri'];var _0x2c3a7f=_0x3406ab[_0x439c('0x57')](-0x1);if(_0x2c3a7f==='/'){_0x3406ab=_0x3406ab[_0x439c('0x58')](0x0,_0x3406ab['lastIndexOf'](_0x2c3a7f));}return rp({'method':_0x439c('0x59'),'uri':util['format'](_0x439c('0x5a'),_0x3406ab,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x439c('0x5b')]('Basic\x20%s',new Buffer(util[_0x439c('0x5b')]('%s:X',_0xd3fdb0['apiKey']))[_0x439c('0x5c')](_0x439c('0x5d')))},'json':!![]});}})[_0x439c('0x42')](function(_0x89692a){if(_0x89692a){var _0x357c9a=[_0x439c('0x5e'),_0x439c('0x5f'),_0x439c('0x60'),'description',_0x439c('0x1c'),_0x439c('0x61'),_0x439c('0x62'),_0x439c('0x63'),_0x439c('0x64'),_0x439c('0x62'),'company'];_[_0x439c('0x65')](_0x89692a,function(_0x593615){return _0x357c9a[_0x439c('0x66')](_0x593615['name'])||!_0x593615[_0x439c('0x67')]&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x68')&&_0x593615[_0x439c('0x2e')]!==_0x439c('0x69');});return{'count':_0x89692a[_0x439c('0x36')],'rows':_[_0x439c('0x2a')](_0x89692a,function(_0x34e57f){return{'id':_0x34e57f[_0x439c('0x27')],'name':_0x34e57f[_0x439c('0x6a')],'custom':!_0x34e57f[_0x439c('0x67')],'options':_0x34e57f[_0x439c('0x6b')]?_['map'](_0x34e57f['choices'],function(_0x3fbf0b){return{'name':_['capitalize'](_0x3fbf0b),'value':_0x3fbf0b};}):[]};})};}})['then'](respondWithResult(_0x1ddd58,null))['catch'](function(_0x3c14be){var _0x11fdae=_0x338905[_0x439c('0x31')][_0x439c('0x6c')]?0x1f4:_0x3c14be['statusCode']||0x1f4;logger['error'](_0x439c('0x6d'),_0x439c('0x54'),_0x11fdae,JSON[_0x439c('0x6e')](_0x3c14be));delete _0x3c14be[_0x439c('0x27')];if(_0x11fdae===0x191){_0x11fdae=0x190;}_0x1ddd58[_0x439c('0x1c')](_0x11fdae)[_0x439c('0x28')](_0x338905['query'][_0x439c('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x3c14be[_0x439c('0x6f')]}:_0x3c14be);});};
\ No newline at end of file
+var _0xd52a=['offset','undefined','count','set','apply','reject','save','then','stack','name','send','index','map','FreshdeskAccount','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','body','update','find','destroy','getConfigurations','FreshdeskConfiguration','addConfiguration','findOne','AccountId','Subjects','Descriptions','getDescriptions','channel','type','FreshdeskField','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json'];(function(_0x17b207,_0x36a21d){var _0x2630b9=function(_0x5cd15e){while(--_0x5cd15e){_0x17b207['push'](_0x17b207['shift']());}};_0x2630b9(++_0x36a21d);}(_0xd52a,0xca));var _0xad52=function(_0x30ecfc,_0x3f28c3){_0x30ecfc=_0x30ecfc-0x0;var _0x3c3605=_0xd52a[_0x30ecfc];return _0x3c3605;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xad52('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad52('0x1'));var rp=require(_0xad52('0x2'));var moment=require(_0xad52('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xad52('0x4'));var util=require(_0xad52('0x5'));var path=require(_0xad52('0x6'));var sox=require(_0xad52('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad52('0x8'));var squel=require('squel');var crypto=require(_0xad52('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xad52('0xa'));var toCsv=require(_0xad52('0xb'));var querystring=require('querystring');var Papa=require(_0xad52('0xc'));var Redis=require('ioredis');var authService=require(_0xad52('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xad52('0xe'));var hardwareService=require(_0xad52('0xf'));var logger=require(_0xad52('0x10'))(_0xad52('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad52('0x12'))['db'];var integrations=require(_0xad52('0x13'));function respondWithStatusCode(_0x378b0c,_0x41331e){_0x41331e=_0x41331e||0xcc;return function(_0x11127c){if(_0x11127c){return _0x378b0c[_0xad52('0x14')](_0x41331e);}return _0x378b0c[_0xad52('0x15')](_0x41331e)[_0xad52('0x16')]();};}function respondWithResult(_0x3d2df6,_0x5727a2){_0x5727a2=_0x5727a2||0xc8;return function(_0x330794){if(_0x330794){return _0x3d2df6[_0xad52('0x15')](_0x5727a2)[_0xad52('0x17')](_0x330794);}};}function respondWithFilteredResult(_0x42eb20,_0x38be7e){return function(_0xcb6cd5){if(_0xcb6cd5){var _0x2bbaad=typeof _0x38be7e[_0xad52('0x18')]===_0xad52('0x19')&&typeof _0x38be7e['limit']==='undefined';var _0x2f8ac5=_0xcb6cd5[_0xad52('0x1a')];var _0x351440=_0x2bbaad?0x0:_0x38be7e[_0xad52('0x18')];var _0x33da89=_0x2bbaad?_0xcb6cd5['count']:_0x38be7e[_0xad52('0x18')]+_0x38be7e['limit'];var _0x164ffd;if(_0x33da89>=_0x2f8ac5){_0x33da89=_0x2f8ac5;_0x164ffd=0xc8;}else{_0x164ffd=0xce;}_0x42eb20[_0xad52('0x15')](_0x164ffd);return _0x42eb20[_0xad52('0x1b')]('Content-Range',_0x351440+'-'+_0x33da89+'/'+_0x2f8ac5)[_0xad52('0x17')](_0xcb6cd5);}return null;};}function patchUpdates(_0x593dfd){return function(_0x1bc745){try{jsonpatch[_0xad52('0x1c')](_0x1bc745,_0x593dfd,!![]);}catch(_0x3262e4){return BPromise[_0xad52('0x1d')](_0x3262e4);}return _0x1bc745[_0xad52('0x1e')]();};}function saveUpdates(_0x2f1526,_0x4b5f2f){return function(_0x7de59d){if(_0x7de59d){return _0x7de59d['update'](_0x2f1526)[_0xad52('0x1f')](function(_0x2acbb4){return _0x2acbb4;});}return null;};}function removeEntity(_0x2fa90c,_0x5bce67){return function(_0x379f53){if(_0x379f53){return _0x379f53['destroy']()['then'](function(){_0x2fa90c[_0xad52('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477b47,_0x3a54a1){return function(_0x537df0){if(!_0x537df0){_0x477b47['sendStatus'](0x194);}return _0x537df0;};}function handleError(_0xb526bf,_0x31b5e0){_0x31b5e0=_0x31b5e0||0x1f4;return function(_0x42db69){logger['error'](_0x42db69[_0xad52('0x20')]);if(_0x42db69['name']){delete _0x42db69[_0xad52('0x21')];}_0xb526bf[_0xad52('0x15')](_0x31b5e0)[_0xad52('0x22')](_0x42db69);};}exports[_0xad52('0x23')]=function(_0x503bd0,_0x426106){var _0x2a604c={},_0x534cc5={},_0x3f5757={'count':0x0,'rows':[]};var _0x3a0fd6=_[_0xad52('0x24')](db[_0xad52('0x25')][_0xad52('0x26')],function(_0x558f90){return{'name':_0x558f90['fieldName'],'type':_0x558f90['type'][_0xad52('0x27')]};});_0x534cc5[_0xad52('0x28')]=_[_0xad52('0x24')](_0x3a0fd6,'name');_0x534cc5['query']=_[_0xad52('0x29')](_0x503bd0[_0xad52('0x2a')]);_0x534cc5[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x534cc5[_0xad52('0x28')],_0x534cc5[_0xad52('0x2a')]);_0x2a604c['attributes']=_[_0xad52('0x2c')](_0x534cc5[_0xad52('0x28')],qs[_0xad52('0x2d')](_0x503bd0[_0xad52('0x2a')][_0xad52('0x2d')]));_0x2a604c[_0xad52('0x2e')]=_0x2a604c[_0xad52('0x2e')][_0xad52('0x2f')]?_0x2a604c[_0xad52('0x2e')]:_0x534cc5[_0xad52('0x28')];if(!_0x503bd0[_0xad52('0x2a')]['hasOwnProperty'](_0xad52('0x30'))){_0x2a604c[_0xad52('0x31')]=qs[_0xad52('0x31')](_0x503bd0[_0xad52('0x2a')][_0xad52('0x31')]);_0x2a604c[_0xad52('0x18')]=qs['offset'](_0x503bd0[_0xad52('0x2a')][_0xad52('0x18')]);}_0x2a604c[_0xad52('0x32')]=qs['sort'](_0x503bd0[_0xad52('0x2a')][_0xad52('0x33')]);_0x2a604c[_0xad52('0x34')]=qs['filters'](_[_0xad52('0x35')](_0x503bd0[_0xad52('0x2a')],_0x534cc5[_0xad52('0x2b')]),_0x3a0fd6);if(_0x503bd0['query'][_0xad52('0x36')]){_0x2a604c[_0xad52('0x34')]=_[_0xad52('0x37')](_0x2a604c[_0xad52('0x34')],{'$or':_[_0xad52('0x24')](_0x3a0fd6,function(_0x2dc1f2){if(_0x2dc1f2['type']!==_0xad52('0x38')){var _0x5775b4={};_0x5775b4[_0x2dc1f2[_0xad52('0x21')]]={'$like':'%'+_0x503bd0[_0xad52('0x2a')][_0xad52('0x36')]+'%'};return _0x5775b4;}})});}_0x2a604c=_[_0xad52('0x37')]({},_0x2a604c,_0x503bd0[_0xad52('0x39')]);var _0x4aa1d1={'where':_0x2a604c[_0xad52('0x34')]};return db[_0xad52('0x25')][_0xad52('0x1a')](_0x4aa1d1)['then'](function(_0x23faff){_0x3f5757[_0xad52('0x1a')]=_0x23faff;if(_0x503bd0[_0xad52('0x2a')]['includeAll']){_0x2a604c[_0xad52('0x3a')]=[{'all':!![]}];}return db['FreshdeskAccount'][_0xad52('0x3b')](_0x2a604c);})[_0xad52('0x1f')](function(_0x272907){_0x3f5757[_0xad52('0x3c')]=_0x272907;return _0x3f5757;})['then'](respondWithFilteredResult(_0x426106,_0x2a604c))[_0xad52('0x3d')](handleError(_0x426106,null));};exports[_0xad52('0x3e')]=function(_0x249724,_0x2bd94a){var _0x3886ec={'raw':![],'where':{'id':_0x249724[_0xad52('0x3f')]['id']}},_0x44a56b={};_0x44a56b[_0xad52('0x28')]=_['keys'](db[_0xad52('0x25')]['rawAttributes']);_0x44a56b[_0xad52('0x2a')]=_[_0xad52('0x29')](_0x249724[_0xad52('0x2a')]);_0x44a56b[_0xad52('0x2b')]=_[_0xad52('0x2c')](_0x44a56b[_0xad52('0x28')],_0x44a56b[_0xad52('0x2a')]);_0x3886ec[_0xad52('0x2e')]=_[_0xad52('0x2c')](_0x44a56b[_0xad52('0x28')],qs[_0xad52('0x2d')](_0x249724[_0xad52('0x2a')][_0xad52('0x2d')]));_0x3886ec[_0xad52('0x2e')]=_0x3886ec[_0xad52('0x2e')][_0xad52('0x2f')]?_0x3886ec[_0xad52('0x2e')]:_0x44a56b[_0xad52('0x28')];if(_0x249724[_0xad52('0x2a')][_0xad52('0x40')]){_0x3886ec['include']=[{'all':!![]}];}_0x3886ec=_[_0xad52('0x37')]({},_0x3886ec,_0x249724[_0xad52('0x39')]);return db[_0xad52('0x25')]['find'](_0x3886ec)[_0xad52('0x1f')](handleEntityNotFound(_0x2bd94a,null))['then'](respondWithResult(_0x2bd94a,null))[_0xad52('0x3d')](handleError(_0x2bd94a,null));};exports['create']=function(_0x4cf477,_0x35eaac){return db[_0xad52('0x25')][_0xad52('0x41')](_0x4cf477[_0xad52('0x42')],{})['then'](respondWithResult(_0x35eaac,0xc9))['catch'](handleError(_0x35eaac,null));};exports[_0xad52('0x43')]=function(_0x5dede4,_0x207096){if(_0x5dede4['body']['id']){delete _0x5dede4[_0xad52('0x42')]['id'];}return db[_0xad52('0x25')][_0xad52('0x44')]({'where':{'id':_0x5dede4[_0xad52('0x3f')]['id']}})[_0xad52('0x1f')](handleEntityNotFound(_0x207096,null))[_0xad52('0x1f')](saveUpdates(_0x5dede4['body'],null))[_0xad52('0x1f')](respondWithResult(_0x207096,null))[_0xad52('0x3d')](handleError(_0x207096,null));};exports[_0xad52('0x45')]=function(_0xb3a238,_0x4ab950){return db[_0xad52('0x25')][_0xad52('0x44')]({'where':{'id':_0xb3a238[_0xad52('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4ab950,null))[_0xad52('0x1f')](removeEntity(_0x4ab950,null))[_0xad52('0x3d')](handleError(_0x4ab950,null));};exports[_0xad52('0x46')]=function(_0xe9baec,_0x4a35ef,_0x32a6c3){var _0x36d038={};var _0x15533a={};var _0x35d509;var _0x197fac;return db['FreshdeskAccount']['findOne']({'where':{'id':_0xe9baec[_0xad52('0x3f')]['id']}})[_0xad52('0x1f')](handleEntityNotFound(_0x4a35ef,null))[_0xad52('0x1f')](function(_0x93114f){if(_0x93114f){_0x35d509=_0x93114f;_0x15533a[_0xad52('0x28')]=_['keys'](db[_0xad52('0x47')]['rawAttributes']);_0x15533a[_0xad52('0x2a')]=_[_0xad52('0x29')](_0xe9baec[_0xad52('0x2a')]);_0x15533a['filters']=_[_0xad52('0x2c')](_0x15533a['model'],_0x15533a[_0xad52('0x2a')]);_0x36d038[_0xad52('0x2e')]=_[_0xad52('0x2c')](_0x15533a['model'],qs['fields'](_0xe9baec[_0xad52('0x2a')]['fields']));_0x36d038[_0xad52('0x2e')]=_0x36d038[_0xad52('0x2e')]['length']?_0x36d038[_0xad52('0x2e')]:_0x15533a['model'];_0x36d038[_0xad52('0x32')]=qs[_0xad52('0x33')](_0xe9baec[_0xad52('0x2a')][_0xad52('0x33')]);_0x36d038['where']=qs['filters'](_[_0xad52('0x35')](_0xe9baec[_0xad52('0x2a')],_0x15533a['filters']));if(_0xe9baec[_0xad52('0x2a')][_0xad52('0x36')]){_0x36d038[_0xad52('0x34')]=_[_0xad52('0x37')](_0x36d038['where'],{'$or':_[_0xad52('0x24')](_0x36d038[_0xad52('0x2e')],function(_0x40b3e9){var _0x4082d7={};_0x4082d7[_0x40b3e9]={'$like':'%'+_0xe9baec[_0xad52('0x2a')][_0xad52('0x36')]+'%'};return _0x4082d7;})});}_0x36d038=_[_0xad52('0x37')]({},_0x36d038,_0xe9baec[_0xad52('0x39')]);return _0x35d509['getConfigurations'](_0x36d038);}})['then'](function(_0x1778fa){if(_0x1778fa){_0x197fac=_0x1778fa[_0xad52('0x2f')];if(!_0xe9baec[_0xad52('0x2a')]['hasOwnProperty'](_0xad52('0x30'))){_0x36d038[_0xad52('0x31')]=qs[_0xad52('0x31')](_0xe9baec['query'][_0xad52('0x31')]);_0x36d038['offset']=qs[_0xad52('0x18')](_0xe9baec['query']['offset']);}return _0x35d509[_0xad52('0x46')](_0x36d038);}})[_0xad52('0x1f')](function(_0x4fbc36){if(_0x4fbc36){return _0x4fbc36?{'count':_0x197fac,'rows':_0x4fbc36}:null;}})['then'](respondWithResult(_0x4a35ef,null))['catch'](handleError(_0x4a35ef,null));};exports[_0xad52('0x48')]=function(_0x46039d,_0x482f93,_0x42d855){if(_0x46039d[_0xad52('0x42')]['id']){delete _0x46039d[_0xad52('0x42')]['id'];}return db['FreshdeskAccount'][_0xad52('0x49')]({'where':{'id':_0x46039d[_0xad52('0x3f')]['id']}})[_0xad52('0x1f')](handleEntityNotFound(_0x482f93,null))['then'](function(_0x551aa6){if(_0x551aa6){_0x46039d[_0xad52('0x42')][_0xad52('0x4a')]=_0x551aa6['id'];_0x46039d[_0xad52('0x42')][_0xad52('0x4b')]=integrations['getSubjects'](_0x46039d[_0xad52('0x42')]['channel'],_0x46039d[_0xad52('0x42')]['type']);_0x46039d[_0xad52('0x42')][_0xad52('0x4c')]=integrations[_0xad52('0x4d')](_0x46039d[_0xad52('0x42')][_0xad52('0x4e')],_0x46039d[_0xad52('0x42')][_0xad52('0x4f')]);return db[_0xad52('0x47')][_0xad52('0x41')](_0x46039d[_0xad52('0x42')],{'include':[{'model':db[_0xad52('0x50')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0xad52('0x4c')}]});}return null;})['then'](respondWithResult(_0x482f93,null))[_0xad52('0x3d')](handleError(_0x482f93,null));};exports[_0xad52('0x51')]=function(_0x2b4d14,_0x500058,_0x3b865f){var _0x55b17b='';return db['FreshdeskAccount'][_0xad52('0x49')]({'where':{'id':_0x2b4d14[_0xad52('0x3f')]['id']},'attributes':['id',_0xad52('0x52'),_0xad52('0x53')]})[_0xad52('0x1f')](handleEntityNotFound(_0x500058,null))['then'](function(_0x290f9a){if(_0x290f9a){_0x55b17b=_0x290f9a['remoteUri'];var _0x2d160e=_0x55b17b[_0xad52('0x54')](-0x1);if(_0x2d160e==='/'){_0x55b17b=_0x55b17b['substring'](0x0,_0x55b17b[_0xad52('0x55')](_0x2d160e));}return rp({'method':_0xad52('0x56'),'uri':util[_0xad52('0x57')](_0xad52('0x58'),_0x55b17b,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xad52('0x57')](_0xad52('0x59'),new Buffer(util[_0xad52('0x57')](_0xad52('0x5a'),_0x290f9a[_0xad52('0x53')]))[_0xad52('0x5b')](_0xad52('0x5c')))},'json':!![]});}})[_0xad52('0x1f')](function(_0x3bc927){if(_0x3bc927){var _0x31422e=['requester',_0xad52('0x5d'),_0xad52('0x5e'),_0xad52('0x5f'),'status',_0xad52('0x60'),_0xad52('0x61'),_0xad52('0x62'),_0xad52('0x63'),_0xad52('0x61'),_0xad52('0x64')];_[_0xad52('0x65')](_0x3bc927,function(_0x233404){return _0x31422e[_0xad52('0x66')](_0x233404[_0xad52('0x21')])||!_0x233404[_0xad52('0x67')]&&_0x233404[_0xad52('0x4f')]!==_0xad52('0x68')&&_0x233404[_0xad52('0x4f')]!==_0xad52('0x69');});return{'count':_0x3bc927[_0xad52('0x2f')],'rows':_['map'](_0x3bc927,function(_0x13c1e0){return{'id':_0x13c1e0[_0xad52('0x21')],'name':_0x13c1e0[_0xad52('0x6a')],'custom':!_0x13c1e0[_0xad52('0x67')],'options':_0x13c1e0[_0xad52('0x6b')]?_[_0xad52('0x24')](_0x13c1e0[_0xad52('0x6b')],function(_0x236261){return{'name':_[_0xad52('0x6c')](_0x236261),'value':_0x236261};}):[]};})};}})[_0xad52('0x1f')](respondWithResult(_0x500058,null))['catch'](function(_0x461e3a){var _0x14e0de=_0x2b4d14[_0xad52('0x2a')][_0xad52('0x6d')]?0x1f4:_0x461e3a[_0xad52('0x6e')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x14e0de,JSON[_0xad52('0x6f')](_0x461e3a));delete _0x461e3a['name'];if(_0x14e0de===0x191){_0x14e0de=0x190;}_0x500058[_0xad52('0x15')](_0x14e0de)['send'](_0x2b4d14['query'][_0xad52('0x6d')]?{'message':_0xad52('0x70'),'statusCode':_0x461e3a[_0xad52('0x6e')]}:_0x461e3a);});};
\ No newline at end of file
index dafd41a..552b4f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4148=['int_freshdesk_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define'];(function(_0x3e79ca,_0x4b37c1){var _0xe18cd5=function(_0x1e2ae5){while(--_0x1e2ae5){_0x3e79ca['push'](_0x3e79ca['shift']());}};_0xe18cd5(++_0x4b37c1);}(_0x4148,0x1da));var _0x8414=function(_0xd6db21,_0x1d08f3){_0xd6db21=_0xd6db21-0x0;var _0x3b96a0=_0x4148[_0xd6db21];return _0x3b96a0;};'use strict';var _=require('lodash');var util=require(_0x8414('0x0'));var logger=require(_0x8414('0x1'))(_0x8414('0x2'));var moment=require('moment');var BPromise=require(_0x8414('0x3'));var rp=require(_0x8414('0x4'));var fs=require('fs');var path=require(_0x8414('0x5'));var rimraf=require('rimraf');var config=require(_0x8414('0x6'));var attributes=require(_0x8414('0x7'));var integrations=require(_0x8414('0x8'));module['exports']=function(_0x54c369,_0x25e81c){return _0x54c369[_0x8414('0x9')]('FreshdeskAccount',attributes,{'tableName':_0x8414('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e60=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','moment','path'];(function(_0x41ffe4,_0x3a04ae){var _0x1ba9f3=function(_0x53a6b5){while(--_0x53a6b5){_0x41ffe4['push'](_0x41ffe4['shift']());}};_0x1ba9f3(++_0x3a04ae);}(_0x8e60,0x74));var _0x08e6=function(_0x1ad0d0,_0x3e4614){_0x1ad0d0=_0x1ad0d0-0x0;var _0xa5e9ae=_0x8e60[_0x1ad0d0];return _0xa5e9ae;};'use strict';var _=require('lodash');var util=require(_0x08e6('0x0'));var logger=require(_0x08e6('0x1'))('api');var moment=require(_0x08e6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08e6('0x3'));var rimraf=require(_0x08e6('0x4'));var config=require(_0x08e6('0x5'));var attributes=require(_0x08e6('0x6'));var integrations=require(_0x08e6('0x7'));module[_0x08e6('0x8')]=function(_0xd87670,_0x189442){return _0xd87670[_0x08e6('0x9')](_0x08e6('0xa'),attributes,{'tableName':_0x08e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1480b68..03d74fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa884=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFreshdeskAccount','findAll','options','attributes','limit','map','include','model','then','ShowFreshdeskAccount','raw','where','stringify','lodash','util','moment','randomstring'];(function(_0x680821,_0x23e67f){var _0x3f132c=function(_0x1bbcea){while(--_0x1bbcea){_0x680821['push'](_0x680821['shift']());}};_0x3f132c(++_0x23e67f);}(_0xa884,0x15a));var _0x4a88=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa884[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x4a88('0x0'));var util=require(_0x4a88('0x1'));var moment=require(_0x4a88('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a88('0x3'));var fs=require('fs');var Redis=require(_0x4a88('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a88('0x5'));var logger=require(_0x4a88('0x6'))(_0x4a88('0x7'));var config=require(_0x4a88('0x8'));var jayson=require(_0x4a88('0x9'));var client=jayson['client'][_0x4a88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x574a8f,_0x3c7f27,_0xc8812c){return new BPromise(function(_0x3be228,_0x436bcb){return client[_0x4a88('0xb')](_0x574a8f,_0xc8812c)['then'](function(_0x2b6fb0){logger['info'](_0x4a88('0xc'),_0x3c7f27,_0x4a88('0xd'));logger[_0x4a88('0xe')](_0x4a88('0xf'),_0x3c7f27,_0x4a88('0xd'),JSON['stringify'](_0x2b6fb0));if(_0x2b6fb0[_0x4a88('0x10')]){if(_0x2b6fb0[_0x4a88('0x10')][_0x4a88('0x11')]===0x1f4){logger[_0x4a88('0x10')](_0x4a88('0xc'),_0x3c7f27,_0x2b6fb0[_0x4a88('0x10')]['message']);return _0x436bcb(_0x2b6fb0[_0x4a88('0x10')][_0x4a88('0x12')]);}logger[_0x4a88('0x10')](_0x4a88('0xc'),_0x3c7f27,_0x2b6fb0[_0x4a88('0x10')][_0x4a88('0x12')]);return _0x3be228(_0x2b6fb0['error'][_0x4a88('0x12')]);}else{logger[_0x4a88('0x13')](_0x4a88('0xc'),_0x3c7f27,'request\x20sent');_0x3be228(_0x2b6fb0[_0x4a88('0x14')][_0x4a88('0x12')]);}})[_0x4a88('0x15')](function(_0x55ffd4){logger['error'](_0x4a88('0xc'),_0x3c7f27,_0x55ffd4);_0x436bcb(_0x55ffd4);});});}exports[_0x4a88('0x16')]=function(_0x56b912){var _0x235ae4=this;return new Promise(function(_0x2a85f7,_0x45167d){return db['FreshdeskAccount'][_0x4a88('0x17')]({'raw':_0x56b912[_0x4a88('0x18')]?_0x56b912['options']['raw']===undefined?!![]:![]:!![],'where':_0x56b912[_0x4a88('0x18')]?_0x56b912['options']['where']||null:null,'attributes':_0x56b912[_0x4a88('0x18')]?_0x56b912[_0x4a88('0x18')][_0x4a88('0x19')]||null:null,'limit':_0x56b912[_0x4a88('0x18')]?_0x56b912[_0x4a88('0x18')][_0x4a88('0x1a')]||null:null,'include':_0x56b912['options']?_0x56b912[_0x4a88('0x18')]['include']?_[_0x4a88('0x1b')](_0x56b912[_0x4a88('0x18')][_0x4a88('0x1c')],function(_0x2b503a){return{'model':db[_0x2b503a[_0x4a88('0x1d')]],'as':_0x2b503a['as'],'attributes':_0x2b503a['attributes'],'include':_0x2b503a[_0x4a88('0x1c')]?_[_0x4a88('0x1b')](_0x2b503a['include'],function(_0x1200be){return{'model':db[_0x1200be['model']],'as':_0x1200be['as'],'attributes':_0x1200be['attributes'],'include':_0x1200be[_0x4a88('0x1c')]?_['map'](_0x1200be[_0x4a88('0x1c')],function(_0x40bb76){return{'model':db[_0x40bb76[_0x4a88('0x1d')]],'as':_0x40bb76['as'],'attributes':_0x40bb76['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a88('0x1e')](function(_0x4b8bfa){logger[_0x4a88('0x13')](_0x4a88('0x16'),_0x56b912);logger['debug'](_0x4a88('0x16'),_0x56b912,JSON['stringify'](_0x4b8bfa));_0x2a85f7(_0x4b8bfa);})[_0x4a88('0x15')](function(_0x30a562){logger[_0x4a88('0x10')]('GetFreshdeskAccount',_0x30a562['message'],_0x56b912);_0x45167d(_0x235ae4[_0x4a88('0x10')](0x1f4,_0x30a562[_0x4a88('0x12')]));});});};exports[_0x4a88('0x1f')]=function(_0x15546c){var _0x1aa947=this;return new Promise(function(_0x28f213,_0x2999bc){return db['FreshdeskAccount']['find']({'raw':_0x15546c['options']?_0x15546c[_0x4a88('0x18')][_0x4a88('0x20')]===undefined?!![]:![]:!![],'where':_0x15546c[_0x4a88('0x18')]?_0x15546c[_0x4a88('0x18')][_0x4a88('0x21')]||null:null,'attributes':_0x15546c[_0x4a88('0x18')]?_0x15546c['options'][_0x4a88('0x19')]||null:null,'include':_0x15546c['options']?_0x15546c[_0x4a88('0x18')][_0x4a88('0x1c')]?_['map'](_0x15546c[_0x4a88('0x18')][_0x4a88('0x1c')],function(_0x8d524a){return{'model':db[_0x8d524a[_0x4a88('0x1d')]],'as':_0x8d524a['as'],'attributes':_0x8d524a[_0x4a88('0x19')],'include':_0x8d524a['include']?_[_0x4a88('0x1b')](_0x8d524a[_0x4a88('0x1c')],function(_0x68735e){return{'model':db[_0x68735e[_0x4a88('0x1d')]],'as':_0x68735e['as'],'attributes':_0x68735e['attributes'],'include':_0x68735e[_0x4a88('0x1c')]?_[_0x4a88('0x1b')](_0x68735e[_0x4a88('0x1c')],function(_0x207199){return{'model':db[_0x207199[_0x4a88('0x1d')]],'as':_0x207199['as'],'attributes':_0x207199['attributes']};}):[]};}):[]};}):[]:[]})[_0x4a88('0x1e')](function(_0x11058a){logger[_0x4a88('0x13')](_0x4a88('0x1f'),_0x15546c);logger[_0x4a88('0xe')](_0x4a88('0x1f'),_0x15546c,JSON[_0x4a88('0x22')](_0x11058a));_0x28f213(_0x11058a);})[_0x4a88('0x15')](function(_0x249b7d){logger[_0x4a88('0x10')](_0x4a88('0x1f'),_0x249b7d[_0x4a88('0x12')],_0x15546c);_0x2999bc(_0x1aa947[_0x4a88('0x10')](0x1f4,_0x249b7d[_0x4a88('0x12')]));});});};
\ No newline at end of file
+var _0x95db=['options','raw','where','attributes','include','map','model','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FreshdeskAccount','findAll'];(function(_0x30faee,_0x1c3794){var _0x3a90ab=function(_0x11129b){while(--_0x11129b){_0x30faee['push'](_0x30faee['shift']());}};_0x3a90ab(++_0x1c3794);}(_0x95db,0x1a2));var _0xb95d=function(_0x599315,_0x433c25){_0x599315=_0x599315-0x0;var _0x730a79=_0x95db[_0x599315];return _0x730a79;};'use strict';var _=require(_0xb95d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb95d('0x1'));var fs=require('fs');var Redis=require(_0xb95d('0x2'));var db=require(_0xb95d('0x3'))['db'];var utils=require(_0xb95d('0x4'));var logger=require(_0xb95d('0x5'))(_0xb95d('0x6'));var config=require('../../config/environment');var jayson=require(_0xb95d('0x7'));var client=jayson['client'][_0xb95d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38cdb3,_0x2060e5,_0x493be2){return new BPromise(function(_0x5bdb83,_0x37df4a){return client[_0xb95d('0x9')](_0x38cdb3,_0x493be2)[_0xb95d('0xa')](function(_0x808f8f){logger['info'](_0xb95d('0xb'),_0x2060e5,_0xb95d('0xc'));logger[_0xb95d('0xd')](_0xb95d('0xe'),_0x2060e5,'request\x20sent',JSON[_0xb95d('0xf')](_0x808f8f));if(_0x808f8f['error']){if(_0x808f8f[_0xb95d('0x10')][_0xb95d('0x11')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x2060e5,_0x808f8f['error'][_0xb95d('0x12')]);return _0x37df4a(_0x808f8f[_0xb95d('0x10')][_0xb95d('0x12')]);}logger[_0xb95d('0x10')](_0xb95d('0xb'),_0x2060e5,_0x808f8f[_0xb95d('0x10')][_0xb95d('0x12')]);return _0x5bdb83(_0x808f8f[_0xb95d('0x10')]['message']);}else{logger[_0xb95d('0x13')](_0xb95d('0xb'),_0x2060e5,'request\x20sent');_0x5bdb83(_0x808f8f[_0xb95d('0x14')][_0xb95d('0x12')]);}})[_0xb95d('0x15')](function(_0x19fd54){logger['error'](_0xb95d('0xb'),_0x2060e5,_0x19fd54);_0x37df4a(_0x19fd54);});});}exports['GetFreshdeskAccount']=function(_0x37e512){var _0xaec168=this;return new Promise(function(_0x40737f,_0x2e0735){return db[_0xb95d('0x16')][_0xb95d('0x17')]({'raw':_0x37e512['options']?_0x37e512[_0xb95d('0x18')][_0xb95d('0x19')]===undefined?!![]:![]:!![],'where':_0x37e512['options']?_0x37e512[_0xb95d('0x18')][_0xb95d('0x1a')]||null:null,'attributes':_0x37e512[_0xb95d('0x18')]?_0x37e512[_0xb95d('0x18')][_0xb95d('0x1b')]||null:null,'limit':_0x37e512[_0xb95d('0x18')]?_0x37e512['options']['limit']||null:null,'include':_0x37e512[_0xb95d('0x18')]?_0x37e512[_0xb95d('0x18')][_0xb95d('0x1c')]?_[_0xb95d('0x1d')](_0x37e512[_0xb95d('0x18')][_0xb95d('0x1c')],function(_0x579911){return{'model':db[_0x579911['model']],'as':_0x579911['as'],'attributes':_0x579911[_0xb95d('0x1b')],'include':_0x579911[_0xb95d('0x1c')]?_[_0xb95d('0x1d')](_0x579911[_0xb95d('0x1c')],function(_0x1e0fd8){return{'model':db[_0x1e0fd8[_0xb95d('0x1e')]],'as':_0x1e0fd8['as'],'attributes':_0x1e0fd8['attributes'],'include':_0x1e0fd8[_0xb95d('0x1c')]?_['map'](_0x1e0fd8[_0xb95d('0x1c')],function(_0x1a98c1){return{'model':db[_0x1a98c1[_0xb95d('0x1e')]],'as':_0x1a98c1['as'],'attributes':_0x1a98c1['attributes']};}):[]};}):[]};}):[]:[]})[_0xb95d('0xa')](function(_0x3a7239){logger['info'](_0xb95d('0x1f'),_0x37e512);logger['debug'](_0xb95d('0x1f'),_0x37e512,JSON['stringify'](_0x3a7239));_0x40737f(_0x3a7239);})[_0xb95d('0x15')](function(_0x4633e2){logger[_0xb95d('0x10')](_0xb95d('0x1f'),_0x4633e2['message'],_0x37e512);_0x2e0735(_0xaec168[_0xb95d('0x10')](0x1f4,_0x4633e2[_0xb95d('0x12')]));});});};exports[_0xb95d('0x20')]=function(_0x4404e6){var _0x15b621=this;return new Promise(function(_0x193a3f,_0x17578e){return db[_0xb95d('0x16')][_0xb95d('0x21')]({'raw':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x19')]===undefined?!![]:![]:!![],'where':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1a')]||null:null,'attributes':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1b')]||null:null,'include':_0x4404e6[_0xb95d('0x18')]?_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1c')]?_[_0xb95d('0x1d')](_0x4404e6[_0xb95d('0x18')][_0xb95d('0x1c')],function(_0xd75ae0){return{'model':db[_0xd75ae0[_0xb95d('0x1e')]],'as':_0xd75ae0['as'],'attributes':_0xd75ae0['attributes'],'include':_0xd75ae0['include']?_['map'](_0xd75ae0['include'],function(_0x57885e){return{'model':db[_0x57885e['model']],'as':_0x57885e['as'],'attributes':_0x57885e[_0xb95d('0x1b')],'include':_0x57885e[_0xb95d('0x1c')]?_['map'](_0x57885e[_0xb95d('0x1c')],function(_0x43cea8){return{'model':db[_0x43cea8[_0xb95d('0x1e')]],'as':_0x43cea8['as'],'attributes':_0x43cea8['attributes']};}):[]};}):[]};}):[]:[]})[_0xb95d('0xa')](function(_0x15eaf6){logger[_0xb95d('0x13')](_0xb95d('0x20'),_0x4404e6);logger[_0xb95d('0xd')](_0xb95d('0x20'),_0x4404e6,JSON['stringify'](_0x15eaf6));_0x193a3f(_0x15eaf6);})['catch'](function(_0x3b2fff){logger[_0xb95d('0x10')](_0xb95d('0x20'),_0x3b2fff[_0xb95d('0x12')],_0x4404e6);_0x17578e(_0x15b621[_0xb95d('0x10')](0x1f4,_0x3b2fff[_0xb95d('0x12')]));});});};
\ No newline at end of file
index 2e1a4e1..9082ca6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3846=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','create','/:id/tags','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x39f6d2,_0x11abcf){var _0x20e52e=function(_0x176027){while(--_0x176027){_0x39f6d2['push'](_0x39f6d2['shift']());}};_0x20e52e(++_0x11abcf);}(_0x3846,0x123));var _0x6384=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x3846[_0x122096];return _0x3d1966;};'use strict';var multer=require(_0x6384('0x0'));var util=require(_0x6384('0x1'));var path=require(_0x6384('0x2'));var timeout=require(_0x6384('0x3'));var express=require(_0x6384('0x4'));var router=express[_0x6384('0x5')]();var fs_extra=require(_0x6384('0x6'));var auth=require(_0x6384('0x7'));var interaction=require(_0x6384('0x8'));var config=require(_0x6384('0x9'));var controller=require(_0x6384('0xa'));router[_0x6384('0xb')]('/',auth['isAuthenticated'](),controller[_0x6384('0xc')]);router[_0x6384('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6384('0xb')](_0x6384('0xd'),auth[_0x6384('0xe')](),controller[_0x6384('0xf')]);router[_0x6384('0xb')](_0x6384('0x10'),auth[_0x6384('0xe')](),controller[_0x6384('0x11')]);router[_0x6384('0xb')]('/:id/descriptions',auth[_0x6384('0xe')](),controller[_0x6384('0x12')]);router[_0x6384('0xb')]('/:id/tags',auth[_0x6384('0xe')](),controller[_0x6384('0x13')]);router['post']('/',auth[_0x6384('0xe')](),controller[_0x6384('0x14')]);router['post'](_0x6384('0x15'),auth[_0x6384('0xe')](),controller['setTags']);router['put'](_0x6384('0x16'),auth[_0x6384('0xe')](),controller[_0x6384('0x17')]);router[_0x6384('0x18')](_0x6384('0x16'),auth['isAuthenticated'](),controller[_0x6384('0x19')]);module[_0x6384('0x1a')]=router;
\ No newline at end of file
+var _0xa123=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','create','setTags','put'];(function(_0x3fbd8e,_0x3f056a){var _0x408741=function(_0xe4091f){while(--_0xe4091f){_0x3fbd8e['push'](_0x3fbd8e['shift']());}};_0x408741(++_0x3f056a);}(_0xa123,0x1f2));var _0x3a12=function(_0x192876,_0x1dcf2e){_0x192876=_0x192876-0x0;var _0xa2915d=_0xa123[_0x192876];return _0xa2915d;};'use strict';var multer=require(_0x3a12('0x0'));var util=require(_0x3a12('0x1'));var path=require(_0x3a12('0x2'));var timeout=require('connect-timeout');var express=require(_0x3a12('0x3'));var router=express[_0x3a12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3a12('0x5'));var interaction=require(_0x3a12('0x6'));var config=require('../../config/environment');var controller=require(_0x3a12('0x7'));router['get']('/',auth[_0x3a12('0x8')](),controller[_0x3a12('0x9')]);router[_0x3a12('0xa')](_0x3a12('0xb'),auth[_0x3a12('0x8')](),controller[_0x3a12('0xc')]);router[_0x3a12('0xa')]('/:id/fields',auth[_0x3a12('0x8')](),controller['getFields']);router[_0x3a12('0xa')](_0x3a12('0xd'),auth['isAuthenticated'](),controller[_0x3a12('0xe')]);router['get'](_0x3a12('0xf'),auth[_0x3a12('0x8')](),controller['getDescriptions']);router[_0x3a12('0xa')](_0x3a12('0x10'),auth[_0x3a12('0x8')](),controller[_0x3a12('0x11')]);router[_0x3a12('0x12')]('/',auth[_0x3a12('0x8')](),controller[_0x3a12('0x13')]);router['post'](_0x3a12('0x10'),auth['isAuthenticated'](),controller[_0x3a12('0x14')]);router[_0x3a12('0x15')](_0x3a12('0xb'),auth[_0x3a12('0x8')](),controller[_0x3a12('0x16')]);router[_0x3a12('0x17')](_0x3a12('0xb'),auth[_0x3a12('0x8')](),controller[_0x3a12('0x18')]);module[_0x3a12('0x19')]=router;
\ No newline at end of file
index dfbfe96..6214da5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa010=['STRING','exports'];(function(_0x14417f,_0x5f0beb){var _0x10c26d=function(_0x271570){while(--_0x271570){_0x14417f['push'](_0x14417f['shift']());}};_0x10c26d(++_0x5f0beb);}(_0xa010,0xf5));var _0x0a01=function(_0x45023b,_0x59c42b){_0x45023b=_0x45023b-0x0;var _0xc4fb60=_0xa010[_0x45023b];return _0xc4fb60;};'use strict';var Sequelize=require('sequelize');module[_0x0a01('0x0')]={'name':{'type':Sequelize[_0x0a01('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa29d=['sequelize','exports','STRING'];(function(_0x41c5b1,_0x504209){var _0x4ace18=function(_0x6fdf9b){while(--_0x6fdf9b){_0x41c5b1['push'](_0x41c5b1['shift']());}};_0x4ace18(++_0x504209);}(_0xa29d,0xb4));var _0xda29=function(_0x95fdb8,_0x389264){_0x95fdb8=_0x95fdb8-0x0;var _0x2f12b1=_0xa29d[_0x95fdb8];return _0x2f12b1;};'use strict';var Sequelize=require(_0xda29('0x0'));module[_0xda29('0x1')]={'name':{'type':Sequelize[_0xda29('0x2')]},'description':{'type':Sequelize[_0xda29('0x2')]}};
\ No newline at end of file
index 23c34e4..324925a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8845=['bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','find','create','body','update','params','getFields','findOne','FreshdeskField','pick','nolimit','getSubjects','getDescriptions','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2e43e9,_0x1be677){var _0x304176=function(_0x5a436c){while(--_0x5a436c){_0x2e43e9['push'](_0x2e43e9['shift']());}};_0x304176(++_0x1be677);}(_0x8845,0x153));var _0x5884=function(_0x5d808e,_0x5b6758){_0x5d808e=_0x5d808e-0x0;var _0x2421fe=_0x8845[_0x5d808e];return _0x2421fe;};'use strict';var emlformat=require(_0x5884('0x0'));var rimraf=require(_0x5884('0x1'));var zipdir=require(_0x5884('0x2'));var jsonpatch=require(_0x5884('0x3'));var rp=require(_0x5884('0x4'));var moment=require('moment');var BPromise=require(_0x5884('0x5'));var Mustache=require(_0x5884('0x6'));var util=require('util');var path=require(_0x5884('0x7'));var sox=require('sox');var csv=require(_0x5884('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5884('0x9'));var _=require(_0x5884('0xa'));var squel=require(_0x5884('0xb'));var crypto=require(_0x5884('0xc'));var jsforce=require(_0x5884('0xd'));var deskjs=require(_0x5884('0xe'));var toCsv=require(_0x5884('0x8'));var querystring=require(_0x5884('0xf'));var Papa=require(_0x5884('0x10'));var Redis=require('ioredis');var authService=require(_0x5884('0x11'));var qs=require(_0x5884('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5884('0x13'));var logger=require(_0x5884('0x14'))(_0x5884('0x15'));var utils=require(_0x5884('0x16'));var config=require(_0x5884('0x17'));var licenseUtil=require(_0x5884('0x18'));var db=require(_0x5884('0x19'))['db'];function respondWithStatusCode(_0x9680ed,_0x504df9){_0x504df9=_0x504df9||0xcc;return function(_0x1f814a){if(_0x1f814a){return _0x9680ed[_0x5884('0x1a')](_0x504df9);}return _0x9680ed['status'](_0x504df9)[_0x5884('0x1b')]();};}function respondWithResult(_0x50ad31,_0x5da708){_0x5da708=_0x5da708||0xc8;return function(_0x507e09){if(_0x507e09){return _0x50ad31[_0x5884('0x1c')](_0x5da708)['json'](_0x507e09);}};}function respondWithFilteredResult(_0x544542,_0x90f19b){return function(_0x5e3891){if(_0x5e3891){var _0x204c09=typeof _0x90f19b[_0x5884('0x1d')]===_0x5884('0x1e')&&typeof _0x90f19b[_0x5884('0x1f')]==='undefined';var _0x48a079=_0x5e3891[_0x5884('0x20')];var _0x5ddc40=_0x204c09?0x0:_0x90f19b[_0x5884('0x1d')];var _0x176f37=_0x204c09?_0x5e3891[_0x5884('0x20')]:_0x90f19b[_0x5884('0x1d')]+_0x90f19b[_0x5884('0x1f')];var _0x36466e;if(_0x176f37>=_0x48a079){_0x176f37=_0x48a079;_0x36466e=0xc8;}else{_0x36466e=0xce;}_0x544542[_0x5884('0x1c')](_0x36466e);return _0x544542[_0x5884('0x21')](_0x5884('0x22'),_0x5ddc40+'-'+_0x176f37+'/'+_0x48a079)[_0x5884('0x23')](_0x5e3891);}return null;};}function patchUpdates(_0x13efd9){return function(_0x740874){try{jsonpatch[_0x5884('0x24')](_0x740874,_0x13efd9,!![]);}catch(_0x34fe93){return BPromise[_0x5884('0x25')](_0x34fe93);}return _0x740874[_0x5884('0x26')]();};}function saveUpdates(_0x5f2f7c,_0x4412e7){return function(_0x1fd4aa){if(_0x1fd4aa){return _0x1fd4aa['update'](_0x5f2f7c)[_0x5884('0x27')](function(_0x2e1de3){return _0x2e1de3;});}return null;};}function removeEntity(_0x205914,_0x48908a){return function(_0x520c3a){if(_0x520c3a){return _0x520c3a[_0x5884('0x28')]()[_0x5884('0x27')](function(){_0x205914[_0x5884('0x1c')](0xcc)[_0x5884('0x1b')]();});}};}function handleEntityNotFound(_0x24dbce,_0xfabaad){return function(_0x3ad777){if(!_0x3ad777){_0x24dbce[_0x5884('0x1a')](0x194);}return _0x3ad777;};}function handleError(_0x25c958,_0x316739){_0x316739=_0x316739||0x1f4;return function(_0x3a3bc3){logger[_0x5884('0x29')](_0x3a3bc3[_0x5884('0x2a')]);if(_0x3a3bc3[_0x5884('0x2b')]){delete _0x3a3bc3[_0x5884('0x2b')];}_0x25c958[_0x5884('0x1c')](_0x316739)[_0x5884('0x2c')](_0x3a3bc3);};}exports[_0x5884('0x2d')]=function(_0x9cebdf,_0x1626b4){var _0x4b4bca={},_0x4796f5={},_0x268862={'count':0x0,'rows':[]};var _0x2ef245=_['map'](db[_0x5884('0x2e')][_0x5884('0x2f')],function(_0x328788){return{'name':_0x328788[_0x5884('0x30')],'type':_0x328788[_0x5884('0x31')][_0x5884('0x32')]};});_0x4796f5[_0x5884('0x33')]=_[_0x5884('0x34')](_0x2ef245,_0x5884('0x2b'));_0x4796f5['query']=_[_0x5884('0x35')](_0x9cebdf[_0x5884('0x36')]);_0x4796f5['filters']=_[_0x5884('0x37')](_0x4796f5[_0x5884('0x33')],_0x4796f5[_0x5884('0x36')]);_0x4b4bca['attributes']=_[_0x5884('0x37')](_0x4796f5[_0x5884('0x33')],qs[_0x5884('0x38')](_0x9cebdf['query'][_0x5884('0x38')]));_0x4b4bca['attributes']=_0x4b4bca[_0x5884('0x39')][_0x5884('0x3a')]?_0x4b4bca['attributes']:_0x4796f5[_0x5884('0x33')];if(!_0x9cebdf[_0x5884('0x36')][_0x5884('0x3b')]('nolimit')){_0x4b4bca[_0x5884('0x1f')]=qs[_0x5884('0x1f')](_0x9cebdf[_0x5884('0x36')][_0x5884('0x1f')]);_0x4b4bca[_0x5884('0x1d')]=qs['offset'](_0x9cebdf[_0x5884('0x36')][_0x5884('0x1d')]);}_0x4b4bca[_0x5884('0x3c')]=qs['sort'](_0x9cebdf[_0x5884('0x36')][_0x5884('0x3d')]);_0x4b4bca[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_['pick'](_0x9cebdf['query'],_0x4796f5[_0x5884('0x3f')]),_0x2ef245);if(_0x9cebdf[_0x5884('0x36')][_0x5884('0x40')]){_0x4b4bca[_0x5884('0x3e')]=_[_0x5884('0x41')](_0x4b4bca[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x2ef245,function(_0x19db29){if(_0x19db29[_0x5884('0x31')]!==_0x5884('0x42')){var _0x4d7982={};_0x4d7982[_0x19db29['name']]={'$like':'%'+_0x9cebdf[_0x5884('0x36')]['filter']+'%'};return _0x4d7982;}})});}_0x4b4bca=_['merge']({},_0x4b4bca,_0x9cebdf[_0x5884('0x43')]);var _0x174fdb={'where':_0x4b4bca['where']};return db[_0x5884('0x2e')]['count'](_0x174fdb)[_0x5884('0x27')](function(_0x4dc0f9){_0x268862[_0x5884('0x20')]=_0x4dc0f9;if(_0x9cebdf[_0x5884('0x36')][_0x5884('0x44')]){_0x4b4bca['include']=[{'all':!![]}];}return db[_0x5884('0x2e')]['findAll'](_0x4b4bca);})[_0x5884('0x27')](function(_0x2b689f){_0x268862[_0x5884('0x45')]=_0x2b689f;return _0x268862;})[_0x5884('0x27')](respondWithFilteredResult(_0x1626b4,_0x4b4bca))[_0x5884('0x46')](handleError(_0x1626b4,null));};exports[_0x5884('0x47')]=function(_0x17ac7d,_0xd2e100){var _0x4808f2={'raw':![],'where':{'id':_0x17ac7d['params']['id']}},_0x2bd809={};_0x2bd809[_0x5884('0x33')]=_[_0x5884('0x35')](db[_0x5884('0x2e')][_0x5884('0x2f')]);_0x2bd809[_0x5884('0x36')]=_[_0x5884('0x35')](_0x17ac7d[_0x5884('0x36')]);_0x2bd809[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x2bd809[_0x5884('0x33')],_0x2bd809[_0x5884('0x36')]);_0x4808f2[_0x5884('0x39')]=_['intersection'](_0x2bd809['model'],qs['fields'](_0x17ac7d['query'][_0x5884('0x38')]));_0x4808f2['attributes']=_0x4808f2['attributes']['length']?_0x4808f2[_0x5884('0x39')]:_0x2bd809[_0x5884('0x33')];if(_0x17ac7d[_0x5884('0x36')][_0x5884('0x44')]){_0x4808f2['include']=[{'all':!![]}];}_0x4808f2=_[_0x5884('0x41')]({},_0x4808f2,_0x17ac7d[_0x5884('0x43')]);return db[_0x5884('0x2e')][_0x5884('0x48')](_0x4808f2)[_0x5884('0x27')](handleEntityNotFound(_0xd2e100,null))[_0x5884('0x27')](respondWithResult(_0xd2e100,null))[_0x5884('0x46')](handleError(_0xd2e100,null));};exports[_0x5884('0x49')]=function(_0x10fd0b,_0x2f4d16){return db[_0x5884('0x2e')][_0x5884('0x49')](_0x10fd0b[_0x5884('0x4a')],{})['then'](respondWithResult(_0x2f4d16,0xc9))[_0x5884('0x46')](handleError(_0x2f4d16,null));};exports[_0x5884('0x4b')]=function(_0x39334c,_0x59639d){if(_0x39334c[_0x5884('0x4a')]['id']){delete _0x39334c[_0x5884('0x4a')]['id'];}return db[_0x5884('0x2e')]['find']({'where':{'id':_0x39334c[_0x5884('0x4c')]['id']}})[_0x5884('0x27')](handleEntityNotFound(_0x59639d,null))[_0x5884('0x27')](saveUpdates(_0x39334c[_0x5884('0x4a')],null))[_0x5884('0x27')](respondWithResult(_0x59639d,null))[_0x5884('0x46')](handleError(_0x59639d,null));};exports[_0x5884('0x28')]=function(_0x144804,_0x91615e){return db[_0x5884('0x2e')][_0x5884('0x48')]({'where':{'id':_0x144804[_0x5884('0x4c')]['id']}})[_0x5884('0x27')](handleEntityNotFound(_0x91615e,null))[_0x5884('0x27')](removeEntity(_0x91615e,null))[_0x5884('0x46')](handleError(_0x91615e,null));};exports[_0x5884('0x4d')]=function(_0x4444b4,_0x340ed4,_0x5d1861){var _0x5b1d7e={};var _0x9d7a9c={};var _0x598a7c;var _0x1dc00f;return db['FreshdeskConfiguration'][_0x5884('0x4e')]({'where':{'id':_0x4444b4[_0x5884('0x4c')]['id']}})[_0x5884('0x27')](handleEntityNotFound(_0x340ed4,null))[_0x5884('0x27')](function(_0x3e24c2){if(_0x3e24c2){_0x598a7c=_0x3e24c2;_0x9d7a9c[_0x5884('0x33')]=_[_0x5884('0x35')](db[_0x5884('0x4f')][_0x5884('0x2f')]);_0x9d7a9c[_0x5884('0x36')]=_[_0x5884('0x35')](_0x4444b4[_0x5884('0x36')]);_0x9d7a9c[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x9d7a9c[_0x5884('0x33')],_0x9d7a9c['query']);_0x5b1d7e['attributes']=_[_0x5884('0x37')](_0x9d7a9c[_0x5884('0x33')],qs[_0x5884('0x38')](_0x4444b4[_0x5884('0x36')][_0x5884('0x38')]));_0x5b1d7e[_0x5884('0x39')]=_0x5b1d7e[_0x5884('0x39')][_0x5884('0x3a')]?_0x5b1d7e[_0x5884('0x39')]:_0x9d7a9c['model'];_0x5b1d7e['order']=qs['sort'](_0x4444b4[_0x5884('0x36')][_0x5884('0x3d')]);_0x5b1d7e['where']=qs[_0x5884('0x3f')](_[_0x5884('0x50')](_0x4444b4[_0x5884('0x36')],_0x9d7a9c[_0x5884('0x3f')]));if(_0x4444b4[_0x5884('0x36')][_0x5884('0x40')]){_0x5b1d7e[_0x5884('0x3e')]=_['merge'](_0x5b1d7e[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x5b1d7e['attributes'],function(_0x6a4fec){var _0x137562={};_0x137562[_0x6a4fec]={'$like':'%'+_0x4444b4[_0x5884('0x36')][_0x5884('0x40')]+'%'};return _0x137562;})});}_0x5b1d7e=_[_0x5884('0x41')]({},_0x5b1d7e,_0x4444b4['options']);return _0x598a7c[_0x5884('0x4d')](_0x5b1d7e);}})[_0x5884('0x27')](function(_0x21c4e3){if(_0x21c4e3){_0x1dc00f=_0x21c4e3[_0x5884('0x3a')];if(!_0x4444b4[_0x5884('0x36')][_0x5884('0x3b')](_0x5884('0x51'))){_0x5b1d7e[_0x5884('0x1f')]=qs[_0x5884('0x1f')](_0x4444b4['query']['limit']);_0x5b1d7e[_0x5884('0x1d')]=qs[_0x5884('0x1d')](_0x4444b4[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x598a7c['getFields'](_0x5b1d7e);}})[_0x5884('0x27')](function(_0x2b53ba){if(_0x2b53ba){return _0x2b53ba?{'count':_0x1dc00f,'rows':_0x2b53ba}:null;}})['then'](respondWithResult(_0x340ed4,null))[_0x5884('0x46')](handleError(_0x340ed4,null));};exports[_0x5884('0x52')]=function(_0x6a7729,_0xdf8133,_0x6b46a1){var _0x32d806={};var _0x564d30={};var _0x6df8e3;var _0x44e14d;return db['FreshdeskConfiguration'][_0x5884('0x4e')]({'where':{'id':_0x6a7729[_0x5884('0x4c')]['id']}})['then'](handleEntityNotFound(_0xdf8133,null))[_0x5884('0x27')](function(_0x5863fb){if(_0x5863fb){_0x6df8e3=_0x5863fb;_0x564d30[_0x5884('0x33')]=_[_0x5884('0x35')](db[_0x5884('0x4f')][_0x5884('0x2f')]);_0x564d30[_0x5884('0x36')]=_[_0x5884('0x35')](_0x6a7729[_0x5884('0x36')]);_0x564d30[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x564d30[_0x5884('0x33')],_0x564d30[_0x5884('0x36')]);_0x32d806[_0x5884('0x39')]=_[_0x5884('0x37')](_0x564d30[_0x5884('0x33')],qs[_0x5884('0x38')](_0x6a7729[_0x5884('0x36')][_0x5884('0x38')]));_0x32d806[_0x5884('0x39')]=_0x32d806[_0x5884('0x39')][_0x5884('0x3a')]?_0x32d806[_0x5884('0x39')]:_0x564d30[_0x5884('0x33')];_0x32d806[_0x5884('0x3c')]=qs['sort'](_0x6a7729[_0x5884('0x36')][_0x5884('0x3d')]);_0x32d806[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_[_0x5884('0x50')](_0x6a7729[_0x5884('0x36')],_0x564d30[_0x5884('0x3f')]));if(_0x6a7729[_0x5884('0x36')][_0x5884('0x40')]){_0x32d806[_0x5884('0x3e')]=_[_0x5884('0x41')](_0x32d806['where'],{'$or':_['map'](_0x32d806['attributes'],function(_0x2123ad){var _0x2203a1={};_0x2203a1[_0x2123ad]={'$like':'%'+_0x6a7729['query'][_0x5884('0x40')]+'%'};return _0x2203a1;})});}_0x32d806=_['merge']({},_0x32d806,_0x6a7729[_0x5884('0x43')]);return _0x6df8e3[_0x5884('0x52')](_0x32d806);}})[_0x5884('0x27')](function(_0x1a1f6b){if(_0x1a1f6b){_0x44e14d=_0x1a1f6b[_0x5884('0x3a')];if(!_0x6a7729[_0x5884('0x36')][_0x5884('0x3b')](_0x5884('0x51'))){_0x32d806[_0x5884('0x1f')]=qs['limit'](_0x6a7729[_0x5884('0x36')]['limit']);_0x32d806[_0x5884('0x1d')]=qs[_0x5884('0x1d')](_0x6a7729[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x6df8e3[_0x5884('0x52')](_0x32d806);}})['then'](function(_0x1afacb){if(_0x1afacb){return _0x1afacb?{'count':_0x44e14d,'rows':_0x1afacb}:null;}})[_0x5884('0x27')](respondWithResult(_0xdf8133,null))[_0x5884('0x46')](handleError(_0xdf8133,null));};exports[_0x5884('0x53')]=function(_0x2fe971,_0x2579f6,_0xdd5f67){var _0x4ad3d6={};var _0x560aca={};var _0x33e1f2;var _0x557f02;return db[_0x5884('0x2e')][_0x5884('0x4e')]({'where':{'id':_0x2fe971[_0x5884('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2579f6,null))[_0x5884('0x27')](function(_0x56251e){if(_0x56251e){_0x33e1f2=_0x56251e;_0x560aca[_0x5884('0x33')]=_['keys'](db[_0x5884('0x4f')][_0x5884('0x2f')]);_0x560aca[_0x5884('0x36')]=_[_0x5884('0x35')](_0x2fe971[_0x5884('0x36')]);_0x560aca[_0x5884('0x3f')]=_['intersection'](_0x560aca[_0x5884('0x33')],_0x560aca['query']);_0x4ad3d6[_0x5884('0x39')]=_[_0x5884('0x37')](_0x560aca[_0x5884('0x33')],qs['fields'](_0x2fe971[_0x5884('0x36')][_0x5884('0x38')]));_0x4ad3d6[_0x5884('0x39')]=_0x4ad3d6[_0x5884('0x39')]['length']?_0x4ad3d6['attributes']:_0x560aca[_0x5884('0x33')];_0x4ad3d6[_0x5884('0x3c')]=qs['sort'](_0x2fe971[_0x5884('0x36')]['sort']);_0x4ad3d6[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_['pick'](_0x2fe971[_0x5884('0x36')],_0x560aca['filters']));if(_0x2fe971[_0x5884('0x36')][_0x5884('0x40')]){_0x4ad3d6[_0x5884('0x3e')]=_['merge'](_0x4ad3d6[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x4ad3d6[_0x5884('0x39')],function(_0x17b87b){var _0x2f7b56={};_0x2f7b56[_0x17b87b]={'$like':'%'+_0x2fe971[_0x5884('0x36')][_0x5884('0x40')]+'%'};return _0x2f7b56;})});}_0x4ad3d6=_[_0x5884('0x41')]({},_0x4ad3d6,_0x2fe971['options']);return _0x33e1f2['getDescriptions'](_0x4ad3d6);}})[_0x5884('0x27')](function(_0x2daa53){if(_0x2daa53){_0x557f02=_0x2daa53[_0x5884('0x3a')];if(!_0x2fe971['query'][_0x5884('0x3b')]('nolimit')){_0x4ad3d6['limit']=qs['limit'](_0x2fe971[_0x5884('0x36')][_0x5884('0x1f')]);_0x4ad3d6['offset']=qs[_0x5884('0x1d')](_0x2fe971[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x33e1f2[_0x5884('0x53')](_0x4ad3d6);}})[_0x5884('0x27')](function(_0x16d377){if(_0x16d377){return _0x16d377?{'count':_0x557f02,'rows':_0x16d377}:null;}})[_0x5884('0x27')](respondWithResult(_0x2579f6,null))[_0x5884('0x46')](handleError(_0x2579f6,null));};exports[_0x5884('0x54')]=function(_0x23eafe,_0x4706b5,_0x575584){var _0x5e0f3a={};var _0x88eeb4={};var _0x18389a;var _0x11fb3f;return db[_0x5884('0x2e')][_0x5884('0x4e')]({'where':{'id':_0x23eafe['params']['id']}})['then'](handleEntityNotFound(_0x4706b5,null))['then'](function(_0x3980ac){if(_0x3980ac){_0x18389a=_0x3980ac;_0x88eeb4['model']=_[_0x5884('0x35')](db['Tag'][_0x5884('0x2f')]);_0x88eeb4[_0x5884('0x36')]=_[_0x5884('0x35')](_0x23eafe[_0x5884('0x36')]);_0x88eeb4[_0x5884('0x3f')]=_[_0x5884('0x37')](_0x88eeb4[_0x5884('0x33')],_0x88eeb4[_0x5884('0x36')]);_0x5e0f3a[_0x5884('0x39')]=_[_0x5884('0x37')](_0x88eeb4[_0x5884('0x33')],qs[_0x5884('0x38')](_0x23eafe[_0x5884('0x36')]['fields']));_0x5e0f3a[_0x5884('0x39')]=_0x5e0f3a[_0x5884('0x39')][_0x5884('0x3a')]?_0x5e0f3a['attributes']:_0x88eeb4['model'];_0x5e0f3a[_0x5884('0x3c')]=qs['sort'](_0x23eafe['query'][_0x5884('0x3d')]);_0x5e0f3a[_0x5884('0x3e')]=qs[_0x5884('0x3f')](_['pick'](_0x23eafe['query'],_0x88eeb4[_0x5884('0x3f')]));if(_0x23eafe[_0x5884('0x36')][_0x5884('0x40')]){_0x5e0f3a[_0x5884('0x3e')]=_[_0x5884('0x41')](_0x5e0f3a[_0x5884('0x3e')],{'$or':_[_0x5884('0x34')](_0x5e0f3a[_0x5884('0x39')],function(_0x2786b7){var _0x258ddd={};_0x258ddd[_0x2786b7]={'$like':'%'+_0x23eafe[_0x5884('0x36')]['filter']+'%'};return _0x258ddd;})});}_0x5e0f3a=_['merge']({},_0x5e0f3a,_0x23eafe['options']);return _0x18389a[_0x5884('0x54')](_0x5e0f3a);}})[_0x5884('0x27')](function(_0x2f07bc){if(_0x2f07bc){_0x11fb3f=_0x2f07bc[_0x5884('0x3a')];if(!_0x23eafe[_0x5884('0x36')][_0x5884('0x3b')]('nolimit')){_0x5e0f3a[_0x5884('0x1f')]=qs[_0x5884('0x1f')](_0x23eafe[_0x5884('0x36')]['limit']);_0x5e0f3a[_0x5884('0x1d')]=qs[_0x5884('0x1d')](_0x23eafe[_0x5884('0x36')][_0x5884('0x1d')]);}return _0x18389a['getTags'](_0x5e0f3a);}})[_0x5884('0x27')](function(_0x183570){if(_0x183570){return _0x183570?{'count':_0x11fb3f,'rows':_0x183570}:null;}})[_0x5884('0x27')](respondWithResult(_0x4706b5,null))[_0x5884('0x46')](handleError(_0x4706b5,null));};exports[_0x5884('0x55')]=function(_0x3b7816,_0x213296,_0x556012){if(_0x3b7816[_0x5884('0x4a')]['id']){delete _0x3b7816[_0x5884('0x4a')]['id'];}return db[_0x5884('0x2e')][_0x5884('0x4e')]({'where':{'id':_0x3b7816[_0x5884('0x4c')]['id']}})['then'](handleEntityNotFound(_0x213296,null))[_0x5884('0x27')](function(_0x3f75e7){if(_0x3f75e7){return _0x3f75e7[_0x5884('0x55')](_0x3b7816[_0x5884('0x4a')]['ids']||[]);}return null;})['then'](respondWithResult(_0x213296,null))[_0x5884('0x46')](handleError(_0x213296,null));};
\ No newline at end of file
+var _0x00e3=['getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','includeAll','include','FreshdeskConfiguration','findAll','rows','params','keys','merge','options','find','catch','create','body','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x00e3,0xf1));var _0x300e=function(_0x25656f,_0x4cf8be){_0x25656f=_0x25656f-0x0;var _0x6e703f=_0x00e3[_0x25656f];return _0x6e703f;};'use strict';var emlformat=require(_0x300e('0x0'));var rimraf=require(_0x300e('0x1'));var zipdir=require(_0x300e('0x2'));var jsonpatch=require(_0x300e('0x3'));var rp=require(_0x300e('0x4'));var moment=require(_0x300e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x300e('0x6'));var path=require(_0x300e('0x7'));var sox=require(_0x300e('0x8'));var csv=require(_0x300e('0x9'));var ejs=require(_0x300e('0xa'));var fs=require('fs');var fs_extra=require(_0x300e('0xb'));var _=require(_0x300e('0xc'));var squel=require(_0x300e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x300e('0xe'));var toCsv=require(_0x300e('0x9'));var querystring=require(_0x300e('0xf'));var Papa=require('papaparse');var Redis=require(_0x300e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x300e('0x11'));var hardwareService=require(_0x300e('0x12'));var logger=require('../../config/logger')(_0x300e('0x13'));var utils=require(_0x300e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x300e('0x15'))['db'];function respondWithStatusCode(_0x5edbb4,_0x43d6eb){_0x43d6eb=_0x43d6eb||0xcc;return function(_0x278b9e){if(_0x278b9e){return _0x5edbb4[_0x300e('0x16')](_0x43d6eb);}return _0x5edbb4[_0x300e('0x17')](_0x43d6eb)['end']();};}function respondWithResult(_0x2b21d1,_0x27e182){_0x27e182=_0x27e182||0xc8;return function(_0xc33be9){if(_0xc33be9){return _0x2b21d1['status'](_0x27e182)[_0x300e('0x18')](_0xc33be9);}};}function respondWithFilteredResult(_0x558071,_0x3604d3){return function(_0x14d033){if(_0x14d033){var _0x81fa06=typeof _0x3604d3[_0x300e('0x19')]===_0x300e('0x1a')&&typeof _0x3604d3[_0x300e('0x1b')]==='undefined';var _0x3a93ea=_0x14d033[_0x300e('0x1c')];var _0x4f27fe=_0x81fa06?0x0:_0x3604d3['offset'];var _0x3861b1=_0x81fa06?_0x14d033[_0x300e('0x1c')]:_0x3604d3[_0x300e('0x19')]+_0x3604d3[_0x300e('0x1b')];var _0x415b50;if(_0x3861b1>=_0x3a93ea){_0x3861b1=_0x3a93ea;_0x415b50=0xc8;}else{_0x415b50=0xce;}_0x558071[_0x300e('0x17')](_0x415b50);return _0x558071['set'](_0x300e('0x1d'),_0x4f27fe+'-'+_0x3861b1+'/'+_0x3a93ea)[_0x300e('0x18')](_0x14d033);}return null;};}function patchUpdates(_0x5bb4e1){return function(_0x951b15){try{jsonpatch['apply'](_0x951b15,_0x5bb4e1,!![]);}catch(_0x2c328a){return BPromise[_0x300e('0x1e')](_0x2c328a);}return _0x951b15['save']();};}function saveUpdates(_0x14df99,_0x5d6bd7){return function(_0x20b934){if(_0x20b934){return _0x20b934[_0x300e('0x1f')](_0x14df99)[_0x300e('0x20')](function(_0x46e93b){return _0x46e93b;});}return null;};}function removeEntity(_0x4ac6aa,_0x35f9e1){return function(_0x5e94df){if(_0x5e94df){return _0x5e94df[_0x300e('0x21')]()[_0x300e('0x20')](function(){_0x4ac6aa[_0x300e('0x17')](0xcc)[_0x300e('0x22')]();});}};}function handleEntityNotFound(_0x3c05ac,_0x198b82){return function(_0x5209a9){if(!_0x5209a9){_0x3c05ac['sendStatus'](0x194);}return _0x5209a9;};}function handleError(_0x46fd6b,_0x47257d){_0x47257d=_0x47257d||0x1f4;return function(_0x27562c){logger[_0x300e('0x23')](_0x27562c[_0x300e('0x24')]);if(_0x27562c[_0x300e('0x25')]){delete _0x27562c['name'];}_0x46fd6b[_0x300e('0x17')](_0x47257d)['send'](_0x27562c);};}exports[_0x300e('0x26')]=function(_0x2059a1,_0x572c83){var _0x5600d0={},_0x451c4f={},_0x2fa360={'count':0x0,'rows':[]};var _0x2db657=_[_0x300e('0x27')](db['FreshdeskConfiguration'][_0x300e('0x28')],function(_0x4ff294){return{'name':_0x4ff294[_0x300e('0x29')],'type':_0x4ff294[_0x300e('0x2a')]['key']};});_0x451c4f[_0x300e('0x2b')]=_[_0x300e('0x27')](_0x2db657,_0x300e('0x25'));_0x451c4f[_0x300e('0x2c')]=_['keys'](_0x2059a1[_0x300e('0x2c')]);_0x451c4f[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x451c4f[_0x300e('0x2b')],_0x451c4f['query']);_0x5600d0['attributes']=_[_0x300e('0x2e')](_0x451c4f[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x2059a1[_0x300e('0x2c')]['fields']));_0x5600d0[_0x300e('0x30')]=_0x5600d0[_0x300e('0x30')][_0x300e('0x31')]?_0x5600d0[_0x300e('0x30')]:_0x451c4f['model'];if(!_0x2059a1[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x5600d0[_0x300e('0x1b')]=qs[_0x300e('0x1b')](_0x2059a1[_0x300e('0x2c')][_0x300e('0x1b')]);_0x5600d0[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x2059a1[_0x300e('0x2c')][_0x300e('0x19')]);}_0x5600d0['order']=qs[_0x300e('0x34')](_0x2059a1['query'][_0x300e('0x34')]);_0x5600d0['where']=qs[_0x300e('0x2d')](_[_0x300e('0x35')](_0x2059a1[_0x300e('0x2c')],_0x451c4f[_0x300e('0x2d')]),_0x2db657);if(_0x2059a1['query'][_0x300e('0x36')]){_0x5600d0[_0x300e('0x37')]=_['merge'](_0x5600d0[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x2db657,function(_0x49829f){if(_0x49829f['type']!=='VIRTUAL'){var _0x65be4c={};_0x65be4c[_0x49829f['name']]={'$like':'%'+_0x2059a1[_0x300e('0x2c')][_0x300e('0x36')]+'%'};return _0x65be4c;}})});}_0x5600d0=_['merge']({},_0x5600d0,_0x2059a1['options']);var _0x4a77dc={'where':_0x5600d0[_0x300e('0x37')]};return db['FreshdeskConfiguration']['count'](_0x4a77dc)[_0x300e('0x20')](function(_0xc037e8){_0x2fa360['count']=_0xc037e8;if(_0x2059a1[_0x300e('0x2c')][_0x300e('0x38')]){_0x5600d0[_0x300e('0x39')]=[{'all':!![]}];}return db[_0x300e('0x3a')][_0x300e('0x3b')](_0x5600d0);})[_0x300e('0x20')](function(_0x25062d){_0x2fa360[_0x300e('0x3c')]=_0x25062d;return _0x2fa360;})['then'](respondWithFilteredResult(_0x572c83,_0x5600d0))['catch'](handleError(_0x572c83,null));};exports['show']=function(_0x5d1049,_0x5ec620){var _0x11d5c8={'raw':![],'where':{'id':_0x5d1049[_0x300e('0x3d')]['id']}},_0x4dbdd1={};_0x4dbdd1[_0x300e('0x2b')]=_[_0x300e('0x3e')](db[_0x300e('0x3a')][_0x300e('0x28')]);_0x4dbdd1[_0x300e('0x2c')]=_['keys'](_0x5d1049[_0x300e('0x2c')]);_0x4dbdd1[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x4dbdd1[_0x300e('0x2b')],_0x4dbdd1[_0x300e('0x2c')]);_0x11d5c8['attributes']=_[_0x300e('0x2e')](_0x4dbdd1[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x5d1049[_0x300e('0x2c')]['fields']));_0x11d5c8['attributes']=_0x11d5c8[_0x300e('0x30')][_0x300e('0x31')]?_0x11d5c8[_0x300e('0x30')]:_0x4dbdd1[_0x300e('0x2b')];if(_0x5d1049[_0x300e('0x2c')][_0x300e('0x38')]){_0x11d5c8[_0x300e('0x39')]=[{'all':!![]}];}_0x11d5c8=_[_0x300e('0x3f')]({},_0x11d5c8,_0x5d1049[_0x300e('0x40')]);return db['FreshdeskConfiguration'][_0x300e('0x41')](_0x11d5c8)[_0x300e('0x20')](handleEntityNotFound(_0x5ec620,null))[_0x300e('0x20')](respondWithResult(_0x5ec620,null))[_0x300e('0x42')](handleError(_0x5ec620,null));};exports[_0x300e('0x43')]=function(_0xab5e36,_0x1aae6f){return db[_0x300e('0x3a')][_0x300e('0x43')](_0xab5e36[_0x300e('0x44')],{})[_0x300e('0x20')](respondWithResult(_0x1aae6f,0xc9))[_0x300e('0x42')](handleError(_0x1aae6f,null));};exports[_0x300e('0x1f')]=function(_0x44ce7b,_0x35b377){if(_0x44ce7b[_0x300e('0x44')]['id']){delete _0x44ce7b[_0x300e('0x44')]['id'];}return db[_0x300e('0x3a')][_0x300e('0x41')]({'where':{'id':_0x44ce7b[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x35b377,null))[_0x300e('0x20')](saveUpdates(_0x44ce7b[_0x300e('0x44')],null))[_0x300e('0x20')](respondWithResult(_0x35b377,null))['catch'](handleError(_0x35b377,null));};exports[_0x300e('0x21')]=function(_0x2d27e4,_0x11d654){return db[_0x300e('0x3a')][_0x300e('0x41')]({'where':{'id':_0x2d27e4[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x11d654,null))['then'](removeEntity(_0x11d654,null))[_0x300e('0x42')](handleError(_0x11d654,null));};exports[_0x300e('0x45')]=function(_0x472eab,_0x48f536,_0x117731){var _0x511bd0={};var _0xef9ebf={};var _0x3a68f5;var _0x5cacda;return db[_0x300e('0x3a')][_0x300e('0x46')]({'where':{'id':_0x472eab[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x48f536,null))['then'](function(_0x2d1177){if(_0x2d1177){_0x3a68f5=_0x2d1177;_0xef9ebf[_0x300e('0x2b')]=_['keys'](db[_0x300e('0x47')]['rawAttributes']);_0xef9ebf[_0x300e('0x2c')]=_[_0x300e('0x3e')](_0x472eab[_0x300e('0x2c')]);_0xef9ebf[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0xef9ebf[_0x300e('0x2b')],_0xef9ebf['query']);_0x511bd0[_0x300e('0x30')]=_[_0x300e('0x2e')](_0xef9ebf[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x472eab['query']['fields']));_0x511bd0[_0x300e('0x30')]=_0x511bd0['attributes'][_0x300e('0x31')]?_0x511bd0['attributes']:_0xef9ebf['model'];_0x511bd0[_0x300e('0x48')]=qs['sort'](_0x472eab[_0x300e('0x2c')][_0x300e('0x34')]);_0x511bd0[_0x300e('0x37')]=qs[_0x300e('0x2d')](_[_0x300e('0x35')](_0x472eab[_0x300e('0x2c')],_0xef9ebf[_0x300e('0x2d')]));if(_0x472eab['query'][_0x300e('0x36')]){_0x511bd0[_0x300e('0x37')]=_[_0x300e('0x3f')](_0x511bd0[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x511bd0[_0x300e('0x30')],function(_0x3f1d44){var _0x93d144={};_0x93d144[_0x3f1d44]={'$like':'%'+_0x472eab[_0x300e('0x2c')][_0x300e('0x36')]+'%'};return _0x93d144;})});}_0x511bd0=_[_0x300e('0x3f')]({},_0x511bd0,_0x472eab[_0x300e('0x40')]);return _0x3a68f5[_0x300e('0x45')](_0x511bd0);}})['then'](function(_0x1d30d9){if(_0x1d30d9){_0x5cacda=_0x1d30d9['length'];if(!_0x472eab[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x511bd0['limit']=qs['limit'](_0x472eab[_0x300e('0x2c')][_0x300e('0x1b')]);_0x511bd0[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x472eab[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x3a68f5['getFields'](_0x511bd0);}})[_0x300e('0x20')](function(_0x4be4b8){if(_0x4be4b8){return _0x4be4b8?{'count':_0x5cacda,'rows':_0x4be4b8}:null;}})[_0x300e('0x20')](respondWithResult(_0x48f536,null))[_0x300e('0x42')](handleError(_0x48f536,null));};exports[_0x300e('0x49')]=function(_0x989089,_0x40ce77,_0x1dd791){var _0x10aa42={};var _0x4ac080={};var _0x4c5b90;var _0x1eb288;return db[_0x300e('0x3a')]['findOne']({'where':{'id':_0x989089[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x40ce77,null))['then'](function(_0x5d02b5){if(_0x5d02b5){_0x4c5b90=_0x5d02b5;_0x4ac080[_0x300e('0x2b')]=_[_0x300e('0x3e')](db[_0x300e('0x47')][_0x300e('0x28')]);_0x4ac080['query']=_[_0x300e('0x3e')](_0x989089[_0x300e('0x2c')]);_0x4ac080[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x4ac080[_0x300e('0x2b')],_0x4ac080[_0x300e('0x2c')]);_0x10aa42[_0x300e('0x30')]=_[_0x300e('0x2e')](_0x4ac080[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x989089[_0x300e('0x2c')][_0x300e('0x2f')]));_0x10aa42[_0x300e('0x30')]=_0x10aa42[_0x300e('0x30')][_0x300e('0x31')]?_0x10aa42[_0x300e('0x30')]:_0x4ac080['model'];_0x10aa42[_0x300e('0x48')]=qs[_0x300e('0x34')](_0x989089[_0x300e('0x2c')][_0x300e('0x34')]);_0x10aa42[_0x300e('0x37')]=qs['filters'](_['pick'](_0x989089[_0x300e('0x2c')],_0x4ac080[_0x300e('0x2d')]));if(_0x989089['query'][_0x300e('0x36')]){_0x10aa42['where']=_[_0x300e('0x3f')](_0x10aa42[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x10aa42[_0x300e('0x30')],function(_0x5c2163){var _0x5176bb={};_0x5176bb[_0x5c2163]={'$like':'%'+_0x989089[_0x300e('0x2c')]['filter']+'%'};return _0x5176bb;})});}_0x10aa42=_[_0x300e('0x3f')]({},_0x10aa42,_0x989089['options']);return _0x4c5b90[_0x300e('0x49')](_0x10aa42);}})[_0x300e('0x20')](function(_0x4b3cf1){if(_0x4b3cf1){_0x1eb288=_0x4b3cf1[_0x300e('0x31')];if(!_0x989089[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x10aa42[_0x300e('0x1b')]=qs[_0x300e('0x1b')](_0x989089['query']['limit']);_0x10aa42[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x989089[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x4c5b90[_0x300e('0x49')](_0x10aa42);}})[_0x300e('0x20')](function(_0x5074e5){if(_0x5074e5){return _0x5074e5?{'count':_0x1eb288,'rows':_0x5074e5}:null;}})[_0x300e('0x20')](respondWithResult(_0x40ce77,null))[_0x300e('0x42')](handleError(_0x40ce77,null));};exports[_0x300e('0x4a')]=function(_0x57189a,_0x7298ed,_0x54de11){var _0x18389d={};var _0x3ba475={};var _0x279174;var _0x6d720c;return db[_0x300e('0x3a')][_0x300e('0x46')]({'where':{'id':_0x57189a[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x7298ed,null))[_0x300e('0x20')](function(_0x31d7e4){if(_0x31d7e4){_0x279174=_0x31d7e4;_0x3ba475['model']=_[_0x300e('0x3e')](db[_0x300e('0x47')]['rawAttributes']);_0x3ba475[_0x300e('0x2c')]=_['keys'](_0x57189a['query']);_0x3ba475[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x3ba475[_0x300e('0x2b')],_0x3ba475['query']);_0x18389d['attributes']=_[_0x300e('0x2e')](_0x3ba475[_0x300e('0x2b')],qs[_0x300e('0x2f')](_0x57189a['query'][_0x300e('0x2f')]));_0x18389d[_0x300e('0x30')]=_0x18389d[_0x300e('0x30')][_0x300e('0x31')]?_0x18389d[_0x300e('0x30')]:_0x3ba475['model'];_0x18389d[_0x300e('0x48')]=qs[_0x300e('0x34')](_0x57189a['query'][_0x300e('0x34')]);_0x18389d['where']=qs['filters'](_[_0x300e('0x35')](_0x57189a[_0x300e('0x2c')],_0x3ba475[_0x300e('0x2d')]));if(_0x57189a[_0x300e('0x2c')][_0x300e('0x36')]){_0x18389d['where']=_[_0x300e('0x3f')](_0x18389d['where'],{'$or':_[_0x300e('0x27')](_0x18389d[_0x300e('0x30')],function(_0x56392f){var _0x4271ec={};_0x4271ec[_0x56392f]={'$like':'%'+_0x57189a[_0x300e('0x2c')]['filter']+'%'};return _0x4271ec;})});}_0x18389d=_[_0x300e('0x3f')]({},_0x18389d,_0x57189a[_0x300e('0x40')]);return _0x279174['getDescriptions'](_0x18389d);}})[_0x300e('0x20')](function(_0x23d51f){if(_0x23d51f){_0x6d720c=_0x23d51f['length'];if(!_0x57189a[_0x300e('0x2c')][_0x300e('0x32')]('nolimit')){_0x18389d[_0x300e('0x1b')]=qs[_0x300e('0x1b')](_0x57189a['query'][_0x300e('0x1b')]);_0x18389d['offset']=qs['offset'](_0x57189a[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x279174['getDescriptions'](_0x18389d);}})[_0x300e('0x20')](function(_0x5f59d6){if(_0x5f59d6){return _0x5f59d6?{'count':_0x6d720c,'rows':_0x5f59d6}:null;}})[_0x300e('0x20')](respondWithResult(_0x7298ed,null))[_0x300e('0x42')](handleError(_0x7298ed,null));};exports[_0x300e('0x4b')]=function(_0x580545,_0x1ead08,_0x197027){var _0x3fbe47={};var _0x16b1f9={};var _0x4f01c1;var _0x344541;return db[_0x300e('0x3a')][_0x300e('0x46')]({'where':{'id':_0x580545['params']['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x1ead08,null))[_0x300e('0x20')](function(_0x483d95){if(_0x483d95){_0x4f01c1=_0x483d95;_0x16b1f9[_0x300e('0x2b')]=_[_0x300e('0x3e')](db[_0x300e('0x4c')]['rawAttributes']);_0x16b1f9[_0x300e('0x2c')]=_[_0x300e('0x3e')](_0x580545[_0x300e('0x2c')]);_0x16b1f9[_0x300e('0x2d')]=_[_0x300e('0x2e')](_0x16b1f9[_0x300e('0x2b')],_0x16b1f9[_0x300e('0x2c')]);_0x3fbe47[_0x300e('0x30')]=_[_0x300e('0x2e')](_0x16b1f9[_0x300e('0x2b')],qs['fields'](_0x580545['query'][_0x300e('0x2f')]));_0x3fbe47[_0x300e('0x30')]=_0x3fbe47['attributes'][_0x300e('0x31')]?_0x3fbe47[_0x300e('0x30')]:_0x16b1f9[_0x300e('0x2b')];_0x3fbe47[_0x300e('0x48')]=qs[_0x300e('0x34')](_0x580545[_0x300e('0x2c')][_0x300e('0x34')]);_0x3fbe47[_0x300e('0x37')]=qs[_0x300e('0x2d')](_[_0x300e('0x35')](_0x580545['query'],_0x16b1f9[_0x300e('0x2d')]));if(_0x580545[_0x300e('0x2c')][_0x300e('0x36')]){_0x3fbe47['where']=_[_0x300e('0x3f')](_0x3fbe47[_0x300e('0x37')],{'$or':_[_0x300e('0x27')](_0x3fbe47[_0x300e('0x30')],function(_0xdb53c9){var _0x1d9bc1={};_0x1d9bc1[_0xdb53c9]={'$like':'%'+_0x580545[_0x300e('0x2c')][_0x300e('0x36')]+'%'};return _0x1d9bc1;})});}_0x3fbe47=_[_0x300e('0x3f')]({},_0x3fbe47,_0x580545[_0x300e('0x40')]);return _0x4f01c1['getTags'](_0x3fbe47);}})['then'](function(_0x3d9334){if(_0x3d9334){_0x344541=_0x3d9334[_0x300e('0x31')];if(!_0x580545[_0x300e('0x2c')][_0x300e('0x32')](_0x300e('0x33'))){_0x3fbe47['limit']=qs[_0x300e('0x1b')](_0x580545[_0x300e('0x2c')][_0x300e('0x1b')]);_0x3fbe47[_0x300e('0x19')]=qs[_0x300e('0x19')](_0x580545[_0x300e('0x2c')][_0x300e('0x19')]);}return _0x4f01c1['getTags'](_0x3fbe47);}})['then'](function(_0x47d272){if(_0x47d272){return _0x47d272?{'count':_0x344541,'rows':_0x47d272}:null;}})[_0x300e('0x20')](respondWithResult(_0x1ead08,null))['catch'](handleError(_0x1ead08,null));};exports['setTags']=function(_0x1bfea8,_0x13551a,_0x8f1bf6){if(_0x1bfea8[_0x300e('0x44')]['id']){delete _0x1bfea8[_0x300e('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x300e('0x46')]({'where':{'id':_0x1bfea8[_0x300e('0x3d')]['id']}})[_0x300e('0x20')](handleEntityNotFound(_0x13551a,null))[_0x300e('0x20')](function(_0x28be21){if(_0x28be21){return _0x28be21[_0x300e('0x4d')](_0x1bfea8[_0x300e('0x44')][_0x300e('0x4e')]||[]);}return null;})[_0x300e('0x20')](respondWithResult(_0x13551a,null))[_0x300e('0x42')](handleError(_0x13551a,null));};
\ No newline at end of file
index ba18135..9cc6d2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b5d=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','int_freshdesk_configurations','lodash','util','api','moment'];(function(_0x3687ea,_0x3689c3){var _0x224535=function(_0x36f9b1){while(--_0x36f9b1){_0x3687ea['push'](_0x3687ea['shift']());}};_0x224535(++_0x3689c3);}(_0x5b5d,0x1e8));var _0xd5b5=function(_0x5f21ad,_0x140e8){_0x5f21ad=_0x5f21ad-0x0;var _0x1722e4=_0x5b5d[_0x5f21ad];return _0x1722e4;};'use strict';var _=require(_0xd5b5('0x0'));var util=require(_0xd5b5('0x1'));var logger=require('../../config/logger')(_0xd5b5('0x2'));var moment=require(_0xd5b5('0x3'));var BPromise=require(_0xd5b5('0x4'));var rp=require(_0xd5b5('0x5'));var fs=require('fs');var path=require(_0xd5b5('0x6'));var rimraf=require(_0xd5b5('0x7'));var config=require(_0xd5b5('0x8'));var attributes=require(_0xd5b5('0x9'));module['exports']=function(_0x1eb4b9,_0x493eea){return _0x1eb4b9[_0xd5b5('0xa')]('FreshdeskConfiguration',attributes,{'tableName':_0xd5b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c86=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x4f7964,_0x554439){var _0x2b2d33=function(_0x3191e4){while(--_0x3191e4){_0x4f7964['push'](_0x4f7964['shift']());}};_0x2b2d33(++_0x554439);}(_0x8c86,0xc5));var _0x68c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c86[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x68c8('0x0'));var util=require(_0x68c8('0x1'));var logger=require('../../config/logger')(_0x68c8('0x2'));var moment=require(_0x68c8('0x3'));var BPromise=require(_0x68c8('0x4'));var rp=require(_0x68c8('0x5'));var fs=require('fs');var path=require(_0x68c8('0x6'));var rimraf=require(_0x68c8('0x7'));var config=require(_0x68c8('0x8'));var attributes=require(_0x68c8('0x9'));module[_0x68c8('0xa')]=function(_0x35b387,_0x3922fe){return _0x35b387['define'](_0x68c8('0xb'),attributes,{'tableName':_0x68c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e8fc000..9685478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad36=['FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b0492,_0x5dcab7){var _0x328739=function(_0x17b34b){while(--_0x17b34b){_0x3b0492['push'](_0x3b0492['shift']());}};_0x328739(++_0x5dcab7);}(_0xad36,0x125));var _0x6ad3=function(_0x319020,_0x34dc4e){_0x319020=_0x319020-0x0;var _0x23d5a7=_0xad36[_0x319020];return _0x23d5a7;};'use strict';var _=require(_0x6ad3('0x0'));var util=require(_0x6ad3('0x1'));var moment=require(_0x6ad3('0x2'));var BPromise=require(_0x6ad3('0x3'));var rs=require(_0x6ad3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ad3('0x5'))['db'];var utils=require(_0x6ad3('0x6'));var logger=require(_0x6ad3('0x7'))(_0x6ad3('0x8'));var config=require(_0x6ad3('0x9'));var jayson=require(_0x6ad3('0xa'));var client=jayson[_0x6ad3('0xb')][_0x6ad3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x511c0c,_0xe9f2e5,_0x9fc2cf){return new BPromise(function(_0x27d54d,_0x2eb835){return client[_0x6ad3('0xd')](_0x511c0c,_0x9fc2cf)[_0x6ad3('0xe')](function(_0x26f142){logger[_0x6ad3('0xf')](_0x6ad3('0x10'),_0xe9f2e5,_0x6ad3('0x11'));logger[_0x6ad3('0x12')](_0x6ad3('0x13'),_0xe9f2e5,_0x6ad3('0x11'),JSON[_0x6ad3('0x14')](_0x26f142));if(_0x26f142['error']){if(_0x26f142[_0x6ad3('0x15')]['code']===0x1f4){logger[_0x6ad3('0x15')](_0x6ad3('0x10'),_0xe9f2e5,_0x26f142['error'][_0x6ad3('0x16')]);return _0x2eb835(_0x26f142['error'][_0x6ad3('0x16')]);}logger['error'](_0x6ad3('0x10'),_0xe9f2e5,_0x26f142[_0x6ad3('0x15')][_0x6ad3('0x16')]);return _0x27d54d(_0x26f142['error']['message']);}else{logger[_0x6ad3('0xf')](_0x6ad3('0x10'),_0xe9f2e5,_0x6ad3('0x11'));_0x27d54d(_0x26f142[_0x6ad3('0x17')][_0x6ad3('0x16')]);}})['catch'](function(_0x5691f0){logger[_0x6ad3('0x15')](_0x6ad3('0x10'),_0xe9f2e5,_0x5691f0);_0x2eb835(_0x5691f0);});});}
\ No newline at end of file
+var _0x2e18=['then','debug','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x2ed0fc,_0x236151){var _0x5f353b=function(_0x38a440){while(--_0x38a440){_0x2ed0fc['push'](_0x2ed0fc['shift']());}};_0x5f353b(++_0x236151);}(_0x2e18,0xf0));var _0x82e1=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x2e18[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x82e1('0x0'));var util=require(_0x82e1('0x1'));var moment=require(_0x82e1('0x2'));var BPromise=require(_0x82e1('0x3'));var rs=require(_0x82e1('0x4'));var fs=require('fs');var Redis=require(_0x82e1('0x5'));var db=require(_0x82e1('0x6'))['db'];var utils=require(_0x82e1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x82e1('0x8'));var jayson=require(_0x82e1('0x9'));var client=jayson[_0x82e1('0xa')][_0x82e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5df070,_0x55043c,_0x55a5d6){return new BPromise(function(_0x106b7a,_0xce4cc9){return client['request'](_0x5df070,_0x55a5d6)[_0x82e1('0xc')](function(_0x4176ed){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x55043c,'request\x20sent');logger[_0x82e1('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x55043c,'request\x20sent',JSON['stringify'](_0x4176ed));if(_0x4176ed[_0x82e1('0xe')]){if(_0x4176ed[_0x82e1('0xe')][_0x82e1('0xf')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x55043c,_0x4176ed[_0x82e1('0xe')][_0x82e1('0x10')]);return _0xce4cc9(_0x4176ed[_0x82e1('0xe')][_0x82e1('0x10')]);}logger[_0x82e1('0xe')](_0x82e1('0x11'),_0x55043c,_0x4176ed[_0x82e1('0xe')][_0x82e1('0x10')]);return _0x106b7a(_0x4176ed[_0x82e1('0xe')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x55043c,_0x82e1('0x12'));_0x106b7a(_0x4176ed[_0x82e1('0x13')][_0x82e1('0x10')]);}})[_0x82e1('0x14')](function(_0x50f7b5){logger[_0x82e1('0xe')](_0x82e1('0x11'),_0x55043c,_0x50f7b5);_0xce4cc9(_0x50f7b5);});});}
\ No newline at end of file
index 1c17236..5b354d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd914=['get','isAuthenticated','show','post','/:id','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0x433ea1,_0x30559c){var _0x4e0fae=function(_0x567112){while(--_0x567112){_0x433ea1['push'](_0x433ea1['shift']());}};_0x4e0fae(++_0x30559c);}(_0xd914,0x14b));var _0x4d91=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0xd914[_0x35a274];return _0x40d905;};'use strict';var multer=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var path=require('path');var timeout=require(_0x4d91('0x2'));var express=require(_0x4d91('0x3'));var router=express['Router']();var fs_extra=require(_0x4d91('0x4'));var auth=require(_0x4d91('0x5'));var interaction=require(_0x4d91('0x6'));var config=require(_0x4d91('0x7'));var controller=require(_0x4d91('0x8'));router[_0x4d91('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4d91('0x9')]('/:id',auth[_0x4d91('0xa')](),controller[_0x4d91('0xb')]);router[_0x4d91('0xc')]('/',auth[_0x4d91('0xa')](),controller['create']);router['put'](_0x4d91('0xd'),auth[_0x4d91('0xa')](),controller[_0x4d91('0xe')]);router[_0x4d91('0xf')](_0x4d91('0xd'),auth[_0x4d91('0xa')](),controller[_0x4d91('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x55cc=['create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x3d7fd0,_0x377f94){var _0x5bb6d1=function(_0x112a35){while(--_0x112a35){_0x3d7fd0['push'](_0x3d7fd0['shift']());}};_0x5bb6d1(++_0x377f94);}(_0x55cc,0x1a7));var _0xc55c=function(_0x4bf7ff,_0x53004b){_0x4bf7ff=_0x4bf7ff-0x0;var _0x35ffb3=_0x55cc[_0x4bf7ff];return _0x35ffb3;};'use strict';var multer=require(_0xc55c('0x0'));var util=require(_0xc55c('0x1'));var path=require('path');var timeout=require(_0xc55c('0x2'));var express=require(_0xc55c('0x3'));var router=express[_0xc55c('0x4')]();var fs_extra=require(_0xc55c('0x5'));var auth=require(_0xc55c('0x6'));var interaction=require(_0xc55c('0x7'));var config=require('../../config/environment');var controller=require(_0xc55c('0x8'));router[_0xc55c('0x9')]('/',auth[_0xc55c('0xa')](),controller[_0xc55c('0xb')]);router[_0xc55c('0x9')](_0xc55c('0xc'),auth[_0xc55c('0xa')](),controller['show']);router[_0xc55c('0xd')]('/',auth[_0xc55c('0xa')](),controller[_0xc55c('0xe')]);router[_0xc55c('0xf')](_0xc55c('0xc'),auth[_0xc55c('0xa')](),controller['update']);router[_0xc55c('0x10')](_0xc55c('0xc'),auth[_0xc55c('0xa')](),controller[_0xc55c('0x11')]);module[_0xc55c('0x12')]=router;
\ No newline at end of file
index 4c79f5e..3265cfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ed=['string','sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x599e60,_0x5b6519){var _0x468e19=function(_0xcdfd97){while(--_0xcdfd97){_0x599e60['push'](_0x599e60['shift']());}};_0x468e19(++_0x5b6519);}(_0x08ed,0x69));var _0xd08e=function(_0x36a560,_0x57378b){_0x36a560=_0x36a560-0x0;var _0x10923a=_0x08ed[_0x36a560];return _0x10923a;};'use strict';var Sequelize=require(_0xd08e('0x0'));module['exports']={'type':{'type':Sequelize[_0xd08e('0x1')]('string',_0xd08e('0x2'),_0xd08e('0x3'),_0xd08e('0x4'),_0xd08e('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd08e('0x6')]},'key':{'type':Sequelize[_0xd08e('0x6')]},'keyType':{'type':Sequelize[_0xd08e('0x1')](_0xd08e('0x7'),_0xd08e('0x2'),_0xd08e('0x3'))},'keyContent':{'type':Sequelize[_0xd08e('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd08e('0x6')]}};
\ No newline at end of file
+var _0x24ad=['STRING','BOOLEAN','sequelize','exports','string','customVariable','keyValue'];(function(_0x244a2c,_0x5eb691){var _0x1bb2db=function(_0x4c1cd7){while(--_0x4c1cd7){_0x244a2c['push'](_0x244a2c['shift']());}};_0x1bb2db(++_0x5eb691);}(_0x24ad,0x1bb));var _0xd24a=function(_0x4f0d9d,_0x70691){_0x4f0d9d=_0x4f0d9d-0x0;var _0x2fc505=_0x24ad[_0x4f0d9d];return _0x2fc505;};'use strict';var Sequelize=require(_0xd24a('0x0'));module[_0xd24a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd24a('0x2'),'variable',_0xd24a('0x3'),_0xd24a('0x4'),'picklist'),'defaultValue':_0xd24a('0x2')},'content':{'type':Sequelize[_0xd24a('0x5')]},'key':{'type':Sequelize[_0xd24a('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xd24a('0x3'))},'keyContent':{'type':Sequelize[_0xd24a('0x5')]},'idField':{'type':Sequelize[_0xd24a('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd24a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 50fccfd..13eacd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e81=['../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x50b407,_0x44dbd1){var _0x50a01d=function(_0x57be1a){while(--_0x57be1a){_0x50b407['push'](_0x50b407['shift']());}};_0x50a01d(++_0x44dbd1);}(_0x4e81,0x1bc));var _0x14e8=function(_0x4450b1,_0x214ace){_0x4450b1=_0x4450b1-0x0;var _0x399b0b=_0x4e81[_0x4450b1];return _0x399b0b;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['FreshdeskField'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));};
\ No newline at end of file
+var _0x91a7=['filter','merge','where','VIRTUAL','options','findAll','rows','catch','rawAttributes','includeAll','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','moment','mustache','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort'];(function(_0x4ff5a2,_0xb33150){var _0xe162f6=function(_0x321cbd){while(--_0x321cbd){_0x4ff5a2['push'](_0x4ff5a2['shift']());}};_0xe162f6(++_0xb33150);}(_0x91a7,0xe7));var _0x791a=function(_0x4a36c9,_0x16a7e9){_0x4a36c9=_0x4a36c9-0x0;var _0x53c122=_0x91a7[_0x4a36c9];return _0x53c122;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x791a('0x0'));var zipdir=require(_0x791a('0x1'));var jsonpatch=require(_0x791a('0x2'));var rp=require('request-promise');var moment=require(_0x791a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x791a('0x4'));var util=require('util');var path=require('path');var sox=require(_0x791a('0x5'));var csv=require(_0x791a('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x791a('0x7'));var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0x6'));var querystring=require(_0x791a('0xb'));var Papa=require(_0x791a('0xc'));var Redis=require(_0x791a('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xe'));var as=require(_0x791a('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x791a('0x10'))(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var licenseUtil=require(_0x791a('0x14'));var db=require(_0x791a('0x15'))['db'];function respondWithStatusCode(_0x53dc41,_0x5daecd){_0x5daecd=_0x5daecd||0xcc;return function(_0xc92016){if(_0xc92016){return _0x53dc41[_0x791a('0x16')](_0x5daecd);}return _0x53dc41['status'](_0x5daecd)[_0x791a('0x17')]();};}function respondWithResult(_0x3a2ec6,_0x5d5b11){_0x5d5b11=_0x5d5b11||0xc8;return function(_0x2887f0){if(_0x2887f0){return _0x3a2ec6[_0x791a('0x18')](_0x5d5b11)[_0x791a('0x19')](_0x2887f0);}};}function respondWithFilteredResult(_0x5cdf2,_0x55e845){return function(_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=typeof _0x55e845[_0x791a('0x1a')]===_0x791a('0x1b')&&typeof _0x55e845['limit']===_0x791a('0x1b');var _0x5bea2e=_0x2ce2e0[_0x791a('0x1c')];var _0x52941d=_0x575d11?0x0:_0x55e845['offset'];var _0x588d00=_0x575d11?_0x2ce2e0[_0x791a('0x1c')]:_0x55e845['offset']+_0x55e845['limit'];var _0x39c60b;if(_0x588d00>=_0x5bea2e){_0x588d00=_0x5bea2e;_0x39c60b=0xc8;}else{_0x39c60b=0xce;}_0x5cdf2[_0x791a('0x18')](_0x39c60b);return _0x5cdf2[_0x791a('0x1d')](_0x791a('0x1e'),_0x52941d+'-'+_0x588d00+'/'+_0x5bea2e)['json'](_0x2ce2e0);}return null;};}function patchUpdates(_0x189c0d){return function(_0xcb5e66){try{jsonpatch[_0x791a('0x1f')](_0xcb5e66,_0x189c0d,!![]);}catch(_0x280f1e){return BPromise['reject'](_0x280f1e);}return _0xcb5e66[_0x791a('0x20')]();};}function saveUpdates(_0x2054c6,_0x25bae5){return function(_0x9e17b5){if(_0x9e17b5){return _0x9e17b5[_0x791a('0x21')](_0x2054c6)[_0x791a('0x22')](function(_0x2241a0){return _0x2241a0;});}return null;};}function removeEntity(_0x45a67d,_0x323c6a){return function(_0xe8e452){if(_0xe8e452){return _0xe8e452[_0x791a('0x23')]()['then'](function(){_0x45a67d[_0x791a('0x18')](0xcc)[_0x791a('0x17')]();});}};}function handleEntityNotFound(_0x380329,_0x2966b8){return function(_0x4d748a){if(!_0x4d748a){_0x380329[_0x791a('0x16')](0x194);}return _0x4d748a;};}function handleError(_0x2db3f7,_0x51dcca){_0x51dcca=_0x51dcca||0x1f4;return function(_0xdfa84f){logger[_0x791a('0x24')](_0xdfa84f[_0x791a('0x25')]);if(_0xdfa84f['name']){delete _0xdfa84f[_0x791a('0x26')];}_0x2db3f7[_0x791a('0x18')](_0x51dcca)[_0x791a('0x27')](_0xdfa84f);};}exports[_0x791a('0x28')]=function(_0x4f423,_0x1a9c6b){var _0x628816={},_0x889534={},_0x58bbc0={'count':0x0,'rows':[]};var _0xbc3436=_[_0x791a('0x29')](db[_0x791a('0x2a')]['rawAttributes'],function(_0x1cdda9){return{'name':_0x1cdda9['fieldName'],'type':_0x1cdda9[_0x791a('0x2b')][_0x791a('0x2c')]};});_0x889534[_0x791a('0x2d')]=_[_0x791a('0x29')](_0xbc3436,_0x791a('0x26'));_0x889534[_0x791a('0x2e')]=_[_0x791a('0x2f')](_0x4f423['query']);_0x889534[_0x791a('0x30')]=_[_0x791a('0x31')](_0x889534[_0x791a('0x2d')],_0x889534[_0x791a('0x2e')]);_0x628816[_0x791a('0x32')]=_['intersection'](_0x889534[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x4f423[_0x791a('0x2e')][_0x791a('0x33')]));_0x628816[_0x791a('0x32')]=_0x628816['attributes'][_0x791a('0x34')]?_0x628816[_0x791a('0x32')]:_0x889534[_0x791a('0x2d')];if(!_0x4f423[_0x791a('0x2e')][_0x791a('0x35')]('nolimit')){_0x628816[_0x791a('0x36')]=qs['limit'](_0x4f423[_0x791a('0x2e')]['limit']);_0x628816['offset']=qs[_0x791a('0x1a')](_0x4f423[_0x791a('0x2e')][_0x791a('0x1a')]);}_0x628816[_0x791a('0x37')]=qs[_0x791a('0x38')](_0x4f423[_0x791a('0x2e')][_0x791a('0x38')]);_0x628816['where']=qs[_0x791a('0x30')](_['pick'](_0x4f423[_0x791a('0x2e')],_0x889534['filters']),_0xbc3436);if(_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]){_0x628816['where']=_[_0x791a('0x3a')](_0x628816[_0x791a('0x3b')],{'$or':_['map'](_0xbc3436,function(_0x45fbfa){if(_0x45fbfa[_0x791a('0x2b')]!==_0x791a('0x3c')){var _0x23db7d={};_0x23db7d[_0x45fbfa[_0x791a('0x26')]]={'$like':'%'+_0x4f423[_0x791a('0x2e')][_0x791a('0x39')]+'%'};return _0x23db7d;}})});}_0x628816=_[_0x791a('0x3a')]({},_0x628816,_0x4f423[_0x791a('0x3d')]);var _0xeafbb5={'where':_0x628816['where']};return db[_0x791a('0x2a')][_0x791a('0x1c')](_0xeafbb5)[_0x791a('0x22')](function(_0x4efbf6){_0x58bbc0[_0x791a('0x1c')]=_0x4efbf6;if(_0x4f423['query']['includeAll']){_0x628816['include']=[{'all':!![]}];}return db[_0x791a('0x2a')][_0x791a('0x3e')](_0x628816);})['then'](function(_0x415c44){_0x58bbc0[_0x791a('0x3f')]=_0x415c44;return _0x58bbc0;})[_0x791a('0x22')](respondWithFilteredResult(_0x1a9c6b,_0x628816))[_0x791a('0x40')](handleError(_0x1a9c6b,null));};exports['show']=function(_0x483336,_0x57b9ba){var _0x2f0395={'raw':!![],'where':{'id':_0x483336['params']['id']}},_0x216dd3={};_0x216dd3[_0x791a('0x2d')]=_[_0x791a('0x2f')](db[_0x791a('0x2a')][_0x791a('0x41')]);_0x216dd3['query']=_[_0x791a('0x2f')](_0x483336['query']);_0x216dd3[_0x791a('0x30')]=_[_0x791a('0x31')](_0x216dd3[_0x791a('0x2d')],_0x216dd3[_0x791a('0x2e')]);_0x2f0395[_0x791a('0x32')]=_['intersection'](_0x216dd3[_0x791a('0x2d')],qs[_0x791a('0x33')](_0x483336[_0x791a('0x2e')][_0x791a('0x33')]));_0x2f0395[_0x791a('0x32')]=_0x2f0395['attributes'][_0x791a('0x34')]?_0x2f0395[_0x791a('0x32')]:_0x216dd3['model'];if(_0x483336['query'][_0x791a('0x42')]){_0x2f0395[_0x791a('0x43')]=[{'all':!![]}];}_0x2f0395=_[_0x791a('0x3a')]({},_0x2f0395,_0x483336['options']);return db['FreshdeskField'][_0x791a('0x44')](_0x2f0395)[_0x791a('0x22')](handleEntityNotFound(_0x57b9ba,null))['then'](respondWithResult(_0x57b9ba,null))[_0x791a('0x40')](handleError(_0x57b9ba,null));};exports[_0x791a('0x45')]=function(_0x3eac77,_0x549980){return db['FreshdeskField'][_0x791a('0x45')](_0x3eac77[_0x791a('0x46')],{})[_0x791a('0x22')](respondWithResult(_0x549980,0xc9))[_0x791a('0x40')](handleError(_0x549980,null));};exports['update']=function(_0x2d7c7d,_0x9f768a){if(_0x2d7c7d[_0x791a('0x46')]['id']){delete _0x2d7c7d[_0x791a('0x46')]['id'];}return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0x2d7c7d[_0x791a('0x47')]['id']}})[_0x791a('0x22')](handleEntityNotFound(_0x9f768a,null))[_0x791a('0x22')](saveUpdates(_0x2d7c7d[_0x791a('0x46')],null))[_0x791a('0x22')](respondWithResult(_0x9f768a,null))[_0x791a('0x40')](handleError(_0x9f768a,null));};exports['destroy']=function(_0xdcb1b,_0x1fd826){return db['FreshdeskField'][_0x791a('0x44')]({'where':{'id':_0xdcb1b[_0x791a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1fd826,null))[_0x791a('0x22')](removeEntity(_0x1fd826,null))[_0x791a('0x40')](handleError(_0x1fd826,null));};
\ No newline at end of file
index 64819a2..1b26e08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1966=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intFreshdeskField.attributes','exports'];(function(_0x454589,_0x3e852e){var _0x468c5c=function(_0xa5b1f5){while(--_0xa5b1f5){_0x454589['push'](_0x454589['shift']());}};_0x468c5c(++_0x3e852e);}(_0x1966,0x9f));var _0x6196=function(_0x49311c,_0x379c09){_0x49311c=_0x49311c-0x0;var _0x1dc6ed=_0x1966[_0x49311c];return _0x1dc6ed;};'use strict';var _=require(_0x6196('0x0'));var util=require(_0x6196('0x1'));var logger=require(_0x6196('0x2'))(_0x6196('0x3'));var moment=require('moment');var BPromise=require(_0x6196('0x4'));var rp=require(_0x6196('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6196('0x6'));var attributes=require(_0x6196('0x7'));module[_0x6196('0x8')]=function(_0x57abf1,_0x5de05b){return _0x57abf1[_0x6196('0x9')](_0x6196('0xa'),attributes,{'tableName':_0x6196('0xb'),'paranoid':![],'indexes':[{'name':_0x6196('0xc'),'fields':['idField',_0x6196('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xab04=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash'];(function(_0x6b9bb6,_0x504b76){var _0x1992ff=function(_0x5d7e69){while(--_0x5d7e69){_0x6b9bb6['push'](_0x6b9bb6['shift']());}};_0x1992ff(++_0x504b76);}(_0xab04,0x194));var _0x4ab0=function(_0x181728,_0x471cc4){_0x181728=_0x181728-0x0;var _0x3525db=_0xab04[_0x181728];return _0x3525db;};'use strict';var _=require(_0x4ab0('0x0'));var util=require(_0x4ab0('0x1'));var logger=require(_0x4ab0('0x2'))(_0x4ab0('0x3'));var moment=require(_0x4ab0('0x4'));var BPromise=require(_0x4ab0('0x5'));var rp=require(_0x4ab0('0x6'));var fs=require('fs');var path=require(_0x4ab0('0x7'));var rimraf=require('rimraf');var config=require(_0x4ab0('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0x4ab0('0x9')]=function(_0x506aa6,_0x4058e7){return _0x506aa6[_0x4ab0('0xa')](_0x4ab0('0xb'),attributes,{'tableName':_0x4ab0('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x4ab0('0xd'),_0x4ab0('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 1e28a99..ef4a6a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d13=['../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2896b0,_0x59c683){var _0x2a6d78=function(_0x6728fa){while(--_0x6728fa){_0x2896b0['push'](_0x2896b0['shift']());}};_0x2a6d78(++_0x59c683);}(_0x9d13,0x81));var _0x39d1=function(_0x134664,_0x34e58a){_0x134664=_0x134664-0x0;var _0x157ac=_0x9d13[_0x134664];return _0x157ac;};'use strict';var _=require(_0x39d1('0x0'));var util=require(_0x39d1('0x1'));var moment=require(_0x39d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x39d1('0x3'));var fs=require('fs');var Redis=require(_0x39d1('0x4'));var db=require(_0x39d1('0x5'))['db'];var utils=require(_0x39d1('0x6'));var logger=require(_0x39d1('0x7'))(_0x39d1('0x8'));var config=require(_0x39d1('0x9'));var jayson=require(_0x39d1('0xa'));var client=jayson[_0x39d1('0xb')][_0x39d1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21c649,_0x2dfeb7,_0x4dacdd){return new BPromise(function(_0x3c02f3,_0x1cb416){return client[_0x39d1('0xd')](_0x21c649,_0x4dacdd)['then'](function(_0x618c28){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x2dfeb7,_0x39d1('0xe'));logger[_0x39d1('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2dfeb7,'request\x20sent',JSON[_0x39d1('0x10')](_0x618c28));if(_0x618c28[_0x39d1('0x11')]){if(_0x618c28['error'][_0x39d1('0x12')]===0x1f4){logger[_0x39d1('0x11')](_0x39d1('0x13'),_0x2dfeb7,_0x618c28[_0x39d1('0x11')]['message']);return _0x1cb416(_0x618c28['error'][_0x39d1('0x14')]);}logger['error'](_0x39d1('0x13'),_0x2dfeb7,_0x618c28[_0x39d1('0x11')]['message']);return _0x3c02f3(_0x618c28['error'][_0x39d1('0x14')]);}else{logger[_0x39d1('0x15')](_0x39d1('0x13'),_0x2dfeb7,_0x39d1('0xe'));_0x3c02f3(_0x618c28['result'][_0x39d1('0x14')]);}})[_0x39d1('0x16')](function(_0x3482e6){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x2dfeb7,_0x3482e6);_0x1cb416(_0x3482e6);});});}
\ No newline at end of file
+var _0x7a02=['then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2975f1,_0x453f49){var _0x2c08d5=function(_0x2cf9c5){while(--_0x2cf9c5){_0x2975f1['push'](_0x2975f1['shift']());}};_0x2c08d5(++_0x453f49);}(_0x7a02,0x14d));var _0x27a0=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x7a02[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x27a0('0x0'));var util=require(_0x27a0('0x1'));var moment=require('moment');var BPromise=require(_0x27a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27a0('0x3'));var db=require(_0x27a0('0x4'))['db'];var utils=require(_0x27a0('0x5'));var logger=require(_0x27a0('0x6'))(_0x27a0('0x7'));var config=require(_0x27a0('0x8'));var jayson=require(_0x27a0('0x9'));var client=jayson['client'][_0x27a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28fe44,_0x2ecab6,_0x12294c){return new BPromise(function(_0x2efab3,_0x358ca7){return client[_0x27a0('0xb')](_0x28fe44,_0x12294c)[_0x27a0('0xc')](function(_0x1b3f65){logger[_0x27a0('0xd')](_0x27a0('0xe'),_0x2ecab6,_0x27a0('0xf'));logger['debug'](_0x27a0('0x10'),_0x2ecab6,_0x27a0('0xf'),JSON[_0x27a0('0x11')](_0x1b3f65));if(_0x1b3f65['error']){if(_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x13')]===0x1f4){logger[_0x27a0('0x12')](_0x27a0('0xe'),_0x2ecab6,_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x14')]);return _0x358ca7(_0x1b3f65[_0x27a0('0x12')]['message']);}logger[_0x27a0('0x12')](_0x27a0('0xe'),_0x2ecab6,_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x14')]);return _0x2efab3(_0x1b3f65[_0x27a0('0x12')][_0x27a0('0x14')]);}else{logger[_0x27a0('0xd')](_0x27a0('0xe'),_0x2ecab6,_0x27a0('0xf'));_0x2efab3(_0x1b3f65[_0x27a0('0x15')]['message']);}})[_0x27a0('0x16')](function(_0x41a21f){logger[_0x27a0('0x12')](_0x27a0('0xe'),_0x2ecab6,_0x41a21f);_0x358ca7(_0x41a21f);});});}
\ No newline at end of file
index 48fc32b..579bbb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b20=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','update','delete'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x6b20,0xd1));var _0x06b2=function(_0x4dbefb,_0x5693c2){_0x4dbefb=_0x4dbefb-0x0;var _0x5501f9=_0x6b20[_0x4dbefb];return _0x5501f9;};'use strict';var multer=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var path=require('path');var timeout=require(_0x06b2('0x2'));var express=require('express');var router=express[_0x06b2('0x3')]();var fs_extra=require(_0x06b2('0x4'));var auth=require(_0x06b2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x06b2('0x6'));var controller=require(_0x06b2('0x7'));router[_0x06b2('0x8')]('/',auth[_0x06b2('0x9')](),controller[_0x06b2('0xa')]);router[_0x06b2('0x8')](_0x06b2('0xb'),auth['isAuthenticated'](),controller[_0x06b2('0xc')]);router[_0x06b2('0x8')](_0x06b2('0xd'),auth['isAuthenticated'](),controller[_0x06b2('0xe')]);router['get'](_0x06b2('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x06b2('0x10')]('/',auth[_0x06b2('0x9')](),controller['create']);router[_0x06b2('0x10')](_0x06b2('0xd'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x11')]);router[_0x06b2('0x12')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x13')]);router[_0x06b2('0x14')](_0x06b2('0xb'),auth[_0x06b2('0x9')](),controller[_0x06b2('0x15')]);module[_0x06b2('0x16')]=router;
\ No newline at end of file
+var _0x4483=['../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x49d634,_0x1f4395){var _0xae60fa=function(_0x54c458){while(--_0x54c458){_0x49d634['push'](_0x49d634['shift']());}};_0xae60fa(++_0x1f4395);}(_0x4483,0x1a3));var _0x3448=function(_0x31130b,_0x4b0766){_0x31130b=_0x31130b-0x0;var _0x55c4c5=_0x4483[_0x31130b];return _0x55c4c5;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/configurations',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x11')](_0x3448('0x13'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3448('0x14')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x16')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);module[_0x3448('0x18')]=router;
\ No newline at end of file
index 20860a4..f466378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['STRING','username','remoteUri','sequelize'];(function(_0x495737,_0x22e541){var _0x4fa502=function(_0x1cc904){while(--_0x1cc904){_0x495737['push'](_0x495737['shift']());}};_0x4fa502(++_0x22e541);}(_0x4991,0xf7));var _0x1499=function(_0x716fea,_0xd6de79){_0x716fea=_0x716fea-0x0;var _0x26cc29=_0x4991[_0x716fea];return _0x26cc29;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'name':{'type':Sequelize[_0x1499('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x2')},'apiKey':{'type':Sequelize[_0x1499('0x1')]},'remoteUri':{'type':Sequelize[_0x1499('0x1')],'unique':_0x1499('0x3')},'serverUrl':{'type':Sequelize[_0x1499('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xffd6=['exports','STRING','username','sequelize'];(function(_0x51fc6b,_0x258d4f){var _0x31954d=function(_0x33d3a5){while(--_0x33d3a5){_0x51fc6b['push'](_0x51fc6b['shift']());}};_0x31954d(++_0x258d4f);}(_0xffd6,0x97));var _0x6ffd=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xffd6[_0x55abd9];return _0x3e5669;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('0x2')],'allowNull':![]}};
\ No newline at end of file
index fddd5b7..48a9222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x030e=['end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','type','VIRTUAL','filter','options','where','FreshsalesAccount','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','findOne','order','AccountId','Subjects','getSubjects','Descriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','users','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x030e,0xac));var _0xe030=function(_0x3e3cfd,_0x410fbe){_0x3e3cfd=_0x3e3cfd-0x0;var _0x318176=_0x030e[_0x3e3cfd];return _0x318176;};'use strict';var emlformat=require(_0xe030('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe030('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe030('0x2'));var moment=require(_0xe030('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe030('0x4'));var path=require(_0xe030('0x5'));var sox=require(_0xe030('0x6'));var csv=require(_0xe030('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe030('0x8'));var squel=require(_0xe030('0x9'));var crypto=require(_0xe030('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe030('0x7'));var querystring=require(_0xe030('0xb'));var Papa=require(_0xe030('0xc'));var Redis=require('ioredis');var authService=require(_0xe030('0xd'));var qs=require(_0xe030('0xe'));var as=require(_0xe030('0xf'));var hardwareService=require(_0xe030('0x10'));var logger=require('../../config/logger')(_0xe030('0x11'));var utils=require(_0xe030('0x12'));var config=require(_0xe030('0x13'));var licenseUtil=require(_0xe030('0x14'));var db=require(_0xe030('0x15'))['db'];var integrations=require(_0xe030('0x16'));function respondWithStatusCode(_0x1f920f,_0x410e5c){_0x410e5c=_0x410e5c||0xcc;return function(_0x5074be){if(_0x5074be){return _0x1f920f[_0xe030('0x17')](_0x410e5c);}return _0x1f920f['status'](_0x410e5c)[_0xe030('0x18')]();};}function respondWithResult(_0x2d0ee7,_0x3c0020){_0x3c0020=_0x3c0020||0xc8;return function(_0x5533a4){if(_0x5533a4){return _0x2d0ee7[_0xe030('0x19')](_0x3c0020)['json'](_0x5533a4);}};}function respondWithFilteredResult(_0x119eae,_0x1022e8){return function(_0x3eab01){if(_0x3eab01){var _0x89b8d1=typeof _0x1022e8[_0xe030('0x1a')]===_0xe030('0x1b')&&typeof _0x1022e8[_0xe030('0x1c')]==='undefined';var _0x528c57=_0x3eab01[_0xe030('0x1d')];var _0x7e0c19=_0x89b8d1?0x0:_0x1022e8[_0xe030('0x1a')];var _0x12637c=_0x89b8d1?_0x3eab01[_0xe030('0x1d')]:_0x1022e8['offset']+_0x1022e8['limit'];var _0x44faa5;if(_0x12637c>=_0x528c57){_0x12637c=_0x528c57;_0x44faa5=0xc8;}else{_0x44faa5=0xce;}_0x119eae[_0xe030('0x19')](_0x44faa5);return _0x119eae[_0xe030('0x1e')](_0xe030('0x1f'),_0x7e0c19+'-'+_0x12637c+'/'+_0x528c57)[_0xe030('0x20')](_0x3eab01);}return null;};}function patchUpdates(_0x5e39e8){return function(_0x36a426){try{jsonpatch[_0xe030('0x21')](_0x36a426,_0x5e39e8,!![]);}catch(_0x5b3752){return BPromise[_0xe030('0x22')](_0x5b3752);}return _0x36a426[_0xe030('0x23')]();};}function saveUpdates(_0x524d52,_0x1cbf29){return function(_0x57a745){if(_0x57a745){return _0x57a745[_0xe030('0x24')](_0x524d52)[_0xe030('0x25')](function(_0x501561){return _0x501561;});}return null;};}function removeEntity(_0x151e9b,_0x5321d8){return function(_0x4f37d0){if(_0x4f37d0){return _0x4f37d0['destroy']()[_0xe030('0x25')](function(){_0x151e9b[_0xe030('0x19')](0xcc)[_0xe030('0x18')]();});}};}function handleEntityNotFound(_0x53ad5d,_0x4fe389){return function(_0x95608){if(!_0x95608){_0x53ad5d[_0xe030('0x17')](0x194);}return _0x95608;};}function handleError(_0x475633,_0x5e29a7){_0x5e29a7=_0x5e29a7||0x1f4;return function(_0x2c0098){logger[_0xe030('0x26')](_0x2c0098['stack']);if(_0x2c0098[_0xe030('0x27')]){delete _0x2c0098[_0xe030('0x27')];}_0x475633[_0xe030('0x19')](_0x5e29a7)[_0xe030('0x28')](_0x2c0098);};}exports['index']=function(_0x16b8e4,_0x1b992d){var _0x5c4f66={},_0x42f2af={},_0x4eb670={'count':0x0,'rows':[]};var _0xab0bfc=_[_0xe030('0x29')](db['FreshsalesAccount'][_0xe030('0x2a')],function(_0x24fdce){return{'name':_0x24fdce[_0xe030('0x2b')],'type':_0x24fdce['type'][_0xe030('0x2c')]};});_0x42f2af[_0xe030('0x2d')]=_['map'](_0xab0bfc,_0xe030('0x27'));_0x42f2af['query']=_[_0xe030('0x2e')](_0x16b8e4[_0xe030('0x2f')]);_0x42f2af[_0xe030('0x30')]=_[_0xe030('0x31')](_0x42f2af[_0xe030('0x2d')],_0x42f2af[_0xe030('0x2f')]);_0x5c4f66[_0xe030('0x32')]=_[_0xe030('0x31')](_0x42f2af[_0xe030('0x2d')],qs[_0xe030('0x33')](_0x16b8e4[_0xe030('0x2f')][_0xe030('0x33')]));_0x5c4f66[_0xe030('0x32')]=_0x5c4f66[_0xe030('0x32')][_0xe030('0x34')]?_0x5c4f66[_0xe030('0x32')]:_0x42f2af['model'];if(!_0x16b8e4[_0xe030('0x2f')][_0xe030('0x35')](_0xe030('0x36'))){_0x5c4f66['limit']=qs[_0xe030('0x1c')](_0x16b8e4['query'][_0xe030('0x1c')]);_0x5c4f66[_0xe030('0x1a')]=qs[_0xe030('0x1a')](_0x16b8e4[_0xe030('0x2f')]['offset']);}_0x5c4f66['order']=qs['sort'](_0x16b8e4[_0xe030('0x2f')][_0xe030('0x37')]);_0x5c4f66['where']=qs[_0xe030('0x30')](_[_0xe030('0x38')](_0x16b8e4[_0xe030('0x2f')],_0x42f2af[_0xe030('0x30')]),_0xab0bfc);if(_0x16b8e4[_0xe030('0x2f')]['filter']){_0x5c4f66['where']=_[_0xe030('0x39')](_0x5c4f66['where'],{'$or':_[_0xe030('0x29')](_0xab0bfc,function(_0x27ae5d){if(_0x27ae5d[_0xe030('0x3a')]!==_0xe030('0x3b')){var _0x130c65={};_0x130c65[_0x27ae5d['name']]={'$like':'%'+_0x16b8e4[_0xe030('0x2f')][_0xe030('0x3c')]+'%'};return _0x130c65;}})});}_0x5c4f66=_['merge']({},_0x5c4f66,_0x16b8e4[_0xe030('0x3d')]);var _0x24ffd7={'where':_0x5c4f66[_0xe030('0x3e')]};return db[_0xe030('0x3f')][_0xe030('0x1d')](_0x24ffd7)[_0xe030('0x25')](function(_0x39a991){_0x4eb670[_0xe030('0x1d')]=_0x39a991;if(_0x16b8e4[_0xe030('0x2f')]['includeAll']){_0x5c4f66[_0xe030('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0xe030('0x41')](_0x5c4f66);})[_0xe030('0x25')](function(_0xb0f220){_0x4eb670[_0xe030('0x42')]=_0xb0f220;return _0x4eb670;})[_0xe030('0x25')](respondWithFilteredResult(_0x1b992d,_0x5c4f66))[_0xe030('0x43')](handleError(_0x1b992d,null));};exports['show']=function(_0x460be8,_0x935552){var _0x4d8d62={'raw':![],'where':{'id':_0x460be8[_0xe030('0x44')]['id']}},_0xd8471a={};_0xd8471a['model']=_[_0xe030('0x2e')](db['FreshsalesAccount']['rawAttributes']);_0xd8471a[_0xe030('0x2f')]=_[_0xe030('0x2e')](_0x460be8['query']);_0xd8471a['filters']=_[_0xe030('0x31')](_0xd8471a[_0xe030('0x2d')],_0xd8471a['query']);_0x4d8d62[_0xe030('0x32')]=_['intersection'](_0xd8471a[_0xe030('0x2d')],qs[_0xe030('0x33')](_0x460be8['query'][_0xe030('0x33')]));_0x4d8d62[_0xe030('0x32')]=_0x4d8d62[_0xe030('0x32')][_0xe030('0x34')]?_0x4d8d62['attributes']:_0xd8471a[_0xe030('0x2d')];if(_0x460be8[_0xe030('0x2f')]['includeAll']){_0x4d8d62[_0xe030('0x40')]=[{'all':!![]}];}_0x4d8d62=_[_0xe030('0x39')]({},_0x4d8d62,_0x460be8[_0xe030('0x3d')]);return db[_0xe030('0x3f')][_0xe030('0x45')](_0x4d8d62)[_0xe030('0x25')](handleEntityNotFound(_0x935552,null))['then'](respondWithResult(_0x935552,null))[_0xe030('0x43')](handleError(_0x935552,null));};exports[_0xe030('0x46')]=function(_0x3dd74b,_0x85e64f){return db[_0xe030('0x3f')]['create'](_0x3dd74b['body'],{})[_0xe030('0x25')](respondWithResult(_0x85e64f,0xc9))[_0xe030('0x43')](handleError(_0x85e64f,null));};exports[_0xe030('0x24')]=function(_0x597b63,_0x14b493){if(_0x597b63['body']['id']){delete _0x597b63[_0xe030('0x47')]['id'];}return db[_0xe030('0x3f')][_0xe030('0x45')]({'where':{'id':_0x597b63[_0xe030('0x44')]['id']}})['then'](handleEntityNotFound(_0x14b493,null))[_0xe030('0x25')](saveUpdates(_0x597b63[_0xe030('0x47')],null))[_0xe030('0x25')](respondWithResult(_0x14b493,null))[_0xe030('0x43')](handleError(_0x14b493,null));};exports[_0xe030('0x48')]=function(_0x41e12a,_0x53cf2c){return db['FreshsalesAccount'][_0xe030('0x45')]({'where':{'id':_0x41e12a['params']['id']}})[_0xe030('0x25')](handleEntityNotFound(_0x53cf2c,null))[_0xe030('0x25')](removeEntity(_0x53cf2c,null))[_0xe030('0x43')](handleError(_0x53cf2c,null));};exports[_0xe030('0x49')]=function(_0x3a3a76,_0x1aa458,_0x21eeb7){var _0x12d0a1={};var _0x218524={};var _0x5b4c9f;var _0x7645e2;return db[_0xe030('0x3f')][_0xe030('0x4a')]({'where':{'id':_0x3a3a76['params']['id']}})[_0xe030('0x25')](handleEntityNotFound(_0x1aa458,null))[_0xe030('0x25')](function(_0x3e1ad8){if(_0x3e1ad8){_0x5b4c9f=_0x3e1ad8;_0x218524[_0xe030('0x2d')]=_[_0xe030('0x2e')](db['FreshsalesConfiguration']['rawAttributes']);_0x218524[_0xe030('0x2f')]=_[_0xe030('0x2e')](_0x3a3a76[_0xe030('0x2f')]);_0x218524[_0xe030('0x30')]=_[_0xe030('0x31')](_0x218524[_0xe030('0x2d')],_0x218524['query']);_0x12d0a1[_0xe030('0x32')]=_['intersection'](_0x218524[_0xe030('0x2d')],qs['fields'](_0x3a3a76[_0xe030('0x2f')]['fields']));_0x12d0a1[_0xe030('0x32')]=_0x12d0a1['attributes'][_0xe030('0x34')]?_0x12d0a1[_0xe030('0x32')]:_0x218524[_0xe030('0x2d')];_0x12d0a1[_0xe030('0x4b')]=qs['sort'](_0x3a3a76[_0xe030('0x2f')][_0xe030('0x37')]);_0x12d0a1[_0xe030('0x3e')]=qs[_0xe030('0x30')](_[_0xe030('0x38')](_0x3a3a76['query'],_0x218524[_0xe030('0x30')]));if(_0x3a3a76[_0xe030('0x2f')][_0xe030('0x3c')]){_0x12d0a1[_0xe030('0x3e')]=_[_0xe030('0x39')](_0x12d0a1[_0xe030('0x3e')],{'$or':_[_0xe030('0x29')](_0x12d0a1['attributes'],function(_0x292bf6){var _0x465b2c={};_0x465b2c[_0x292bf6]={'$like':'%'+_0x3a3a76[_0xe030('0x2f')]['filter']+'%'};return _0x465b2c;})});}_0x12d0a1=_['merge']({},_0x12d0a1,_0x3a3a76[_0xe030('0x3d')]);return _0x5b4c9f['getConfigurations'](_0x12d0a1);}})['then'](function(_0x5ce385){if(_0x5ce385){_0x7645e2=_0x5ce385[_0xe030('0x34')];if(!_0x3a3a76[_0xe030('0x2f')][_0xe030('0x35')](_0xe030('0x36'))){_0x12d0a1[_0xe030('0x1c')]=qs[_0xe030('0x1c')](_0x3a3a76['query'][_0xe030('0x1c')]);_0x12d0a1['offset']=qs[_0xe030('0x1a')](_0x3a3a76[_0xe030('0x2f')][_0xe030('0x1a')]);}return _0x5b4c9f[_0xe030('0x49')](_0x12d0a1);}})[_0xe030('0x25')](function(_0x4c7d66){if(_0x4c7d66){return _0x4c7d66?{'count':_0x7645e2,'rows':_0x4c7d66}:null;}})['then'](respondWithResult(_0x1aa458,null))['catch'](handleError(_0x1aa458,null));};exports['addConfiguration']=function(_0x2273b8,_0x529048,_0x52e0d4){if(_0x2273b8[_0xe030('0x47')]['id']){delete _0x2273b8[_0xe030('0x47')]['id'];}return db[_0xe030('0x3f')][_0xe030('0x4a')]({'where':{'id':_0x2273b8['params']['id']}})[_0xe030('0x25')](handleEntityNotFound(_0x529048,null))['then'](function(_0x3c77af){if(_0x3c77af){_0x2273b8[_0xe030('0x47')][_0xe030('0x4c')]=_0x3c77af['id'];_0x2273b8[_0xe030('0x47')][_0xe030('0x4d')]=integrations[_0xe030('0x4e')](_0x2273b8['body']['channel'],_0x2273b8[_0xe030('0x47')][_0xe030('0x3a')]);_0x2273b8[_0xe030('0x47')][_0xe030('0x4f')]=integrations['getDescriptions'](_0x2273b8[_0xe030('0x47')][_0xe030('0x50')],_0x2273b8[_0xe030('0x47')][_0xe030('0x3a')]);return db['FreshsalesConfiguration'][_0xe030('0x46')](_0x2273b8[_0xe030('0x47')],{'include':[{'model':db[_0xe030('0x51')],'as':'Subjects'},{'model':db[_0xe030('0x51')],'as':_0xe030('0x4f')}]});}return null;})['then'](respondWithResult(_0x529048,null))['catch'](handleError(_0x529048,null));};exports[_0xe030('0x52')]=function(_0x584be9,_0x4b9641,_0x5254cd){var _0xf31be2='';var _0x4a191d='';return db[_0xe030('0x3f')][_0xe030('0x4a')]({'where':{'id':_0x584be9['params']['id']},'attributes':['id',_0xe030('0x53'),_0xe030('0x54'),_0xe030('0x55')]})['then'](handleEntityNotFound(_0x4b9641,null))[_0xe030('0x25')](function(_0x1918a8){if(_0x1918a8){_0x4a191d=_0x1918a8[_0xe030('0x53')];_0xf31be2=_0x1918a8[_0xe030('0x54')];var _0x33218a=_0x1918a8[_0xe030('0x54')][_0xe030('0x56')](-0x1);if(_0x33218a==='/'){_0xf31be2=_0xf31be2[_0xe030('0x57')](0x0,_0xf31be2[_0xe030('0x58')](_0x33218a));}return rp({'method':'GET','uri':util[_0xe030('0x59')](_0xe030('0x5a'),_0xf31be2,_0xe030('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x1918a8[_0xe030('0x55')]},'json':!![]});}})[_0xe030('0x25')](function(_0x47fc74){if(_0x47fc74){var _0x52377e=_0x47fc74[_0xe030('0x5c')];var _0x5d622d=![];var _0x145923=null;for(_0x145923=0x0;_0x145923<_0x52377e[_0xe030('0x34')];_0x145923++){if(_0x52377e[_0x145923]['email']===_0x4a191d){_0x5d622d=!![];}}if(_0x5d622d){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xe030('0x25')](respondWithResult(_0x4b9641,null))[_0xe030('0x43')](function(_0x3bb8ed){var _0x25a087=_0x584be9[_0xe030('0x2f')][_0xe030('0x5d')]?0x1f4:_0x3bb8ed[_0xe030('0x5e')]||0x1f4;logger[_0xe030('0x26')](_0xe030('0x5f'),_0xe030('0x52'),_0x25a087,JSON[_0xe030('0x60')](_0x3bb8ed));delete _0x3bb8ed[_0xe030('0x27')];if(_0x25a087===0x191){_0x25a087=0x190;}_0x4b9641['status'](_0x25a087)['send'](_0x584be9[_0xe030('0x2f')][_0xe030('0x5d')]?{'message':_0xe030('0x61'),'statusCode':_0x3bb8ed['statusCode']}:_0x3bb8ed);});};
\ No newline at end of file
+var _0x47c3=['FreshsalesConfiguration','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','substring','lastIndexOf','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','channel','Descriptions'];(function(_0x2ac980,_0x33829d){var _0x53974d=function(_0x4cd40c){while(--_0x4cd40c){_0x2ac980['push'](_0x2ac980['shift']());}};_0x53974d(++_0x33829d);}(_0x47c3,0xd4));var _0x347c=function(_0x5a145f,_0x7b8699){_0x5a145f=_0x5a145f-0x0;var _0x1d7c61=_0x47c3[_0x5a145f];return _0x1d7c61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x347c('0x0'));var jsonpatch=require(_0x347c('0x1'));var rp=require(_0x347c('0x2'));var moment=require(_0x347c('0x3'));var BPromise=require(_0x347c('0x4'));var Mustache=require(_0x347c('0x5'));var util=require(_0x347c('0x6'));var path=require(_0x347c('0x7'));var sox=require(_0x347c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x347c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x347c('0xa'));var jsforce=require(_0x347c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x347c('0xc'));var querystring=require('querystring');var Papa=require(_0x347c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x347c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x347c('0xf'));var logger=require(_0x347c('0x10'))(_0x347c('0x11'));var utils=require('../../config/utils');var config=require(_0x347c('0x12'));var licenseUtil=require(_0x347c('0x13'));var db=require(_0x347c('0x14'))['db'];var integrations=require(_0x347c('0x15'));function respondWithStatusCode(_0x49f195,_0x1a84bf){_0x1a84bf=_0x1a84bf||0xcc;return function(_0x5756ba){if(_0x5756ba){return _0x49f195['sendStatus'](_0x1a84bf);}return _0x49f195['status'](_0x1a84bf)[_0x347c('0x16')]();};}function respondWithResult(_0x1b8e15,_0x4931fb){_0x4931fb=_0x4931fb||0xc8;return function(_0x501016){if(_0x501016){return _0x1b8e15[_0x347c('0x17')](_0x4931fb)[_0x347c('0x18')](_0x501016);}};}function respondWithFilteredResult(_0x148ceb,_0x26f08d){return function(_0x4b7e73){if(_0x4b7e73){var _0x4ef578=typeof _0x26f08d[_0x347c('0x19')]==='undefined'&&typeof _0x26f08d[_0x347c('0x1a')]===_0x347c('0x1b');var _0x3498c0=_0x4b7e73[_0x347c('0x1c')];var _0x17f4fb=_0x4ef578?0x0:_0x26f08d[_0x347c('0x19')];var _0x4d76dd=_0x4ef578?_0x4b7e73[_0x347c('0x1c')]:_0x26f08d[_0x347c('0x19')]+_0x26f08d['limit'];var _0x5462a5;if(_0x4d76dd>=_0x3498c0){_0x4d76dd=_0x3498c0;_0x5462a5=0xc8;}else{_0x5462a5=0xce;}_0x148ceb['status'](_0x5462a5);return _0x148ceb[_0x347c('0x1d')](_0x347c('0x1e'),_0x17f4fb+'-'+_0x4d76dd+'/'+_0x3498c0)[_0x347c('0x18')](_0x4b7e73);}return null;};}function patchUpdates(_0x347a42){return function(_0x30f1fb){try{jsonpatch['apply'](_0x30f1fb,_0x347a42,!![]);}catch(_0xfa3a6){return BPromise[_0x347c('0x1f')](_0xfa3a6);}return _0x30f1fb[_0x347c('0x20')]();};}function saveUpdates(_0x29a929,_0xf28180){return function(_0x1d2b50){if(_0x1d2b50){return _0x1d2b50[_0x347c('0x21')](_0x29a929)[_0x347c('0x22')](function(_0x16b0a6){return _0x16b0a6;});}return null;};}function removeEntity(_0x5346b1,_0x198cfe){return function(_0x4a2223){if(_0x4a2223){return _0x4a2223[_0x347c('0x23')]()[_0x347c('0x22')](function(){_0x5346b1[_0x347c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51f503,_0x441d05){return function(_0x36e2a5){if(!_0x36e2a5){_0x51f503[_0x347c('0x24')](0x194);}return _0x36e2a5;};}function handleError(_0x22d1fc,_0x33acd8){_0x33acd8=_0x33acd8||0x1f4;return function(_0x4fa133){logger[_0x347c('0x25')](_0x4fa133[_0x347c('0x26')]);if(_0x4fa133[_0x347c('0x27')]){delete _0x4fa133['name'];}_0x22d1fc[_0x347c('0x17')](_0x33acd8)['send'](_0x4fa133);};}exports[_0x347c('0x28')]=function(_0x119d87,_0x181094){var _0x52b2f5={},_0xd90a4a={},_0x42e2ba={'count':0x0,'rows':[]};var _0x9e6f0b=_[_0x347c('0x29')](db[_0x347c('0x2a')][_0x347c('0x2b')],function(_0x5bbc4d){return{'name':_0x5bbc4d[_0x347c('0x2c')],'type':_0x5bbc4d['type']['key']};});_0xd90a4a['model']=_[_0x347c('0x29')](_0x9e6f0b,_0x347c('0x27'));_0xd90a4a[_0x347c('0x2d')]=_[_0x347c('0x2e')](_0x119d87[_0x347c('0x2d')]);_0xd90a4a[_0x347c('0x2f')]=_[_0x347c('0x30')](_0xd90a4a[_0x347c('0x31')],_0xd90a4a[_0x347c('0x2d')]);_0x52b2f5[_0x347c('0x32')]=_[_0x347c('0x30')](_0xd90a4a[_0x347c('0x31')],qs['fields'](_0x119d87[_0x347c('0x2d')][_0x347c('0x33')]));_0x52b2f5['attributes']=_0x52b2f5[_0x347c('0x32')][_0x347c('0x34')]?_0x52b2f5[_0x347c('0x32')]:_0xd90a4a[_0x347c('0x31')];if(!_0x119d87[_0x347c('0x2d')]['hasOwnProperty'](_0x347c('0x35'))){_0x52b2f5['limit']=qs[_0x347c('0x1a')](_0x119d87[_0x347c('0x2d')][_0x347c('0x1a')]);_0x52b2f5[_0x347c('0x19')]=qs[_0x347c('0x19')](_0x119d87['query'][_0x347c('0x19')]);}_0x52b2f5[_0x347c('0x36')]=qs['sort'](_0x119d87[_0x347c('0x2d')][_0x347c('0x37')]);_0x52b2f5['where']=qs[_0x347c('0x2f')](_[_0x347c('0x38')](_0x119d87[_0x347c('0x2d')],_0xd90a4a[_0x347c('0x2f')]),_0x9e6f0b);if(_0x119d87[_0x347c('0x2d')][_0x347c('0x39')]){_0x52b2f5['where']=_['merge'](_0x52b2f5[_0x347c('0x3a')],{'$or':_[_0x347c('0x29')](_0x9e6f0b,function(_0x1e53dd){if(_0x1e53dd[_0x347c('0x3b')]!==_0x347c('0x3c')){var _0x169dff={};_0x169dff[_0x1e53dd[_0x347c('0x27')]]={'$like':'%'+_0x119d87[_0x347c('0x2d')][_0x347c('0x39')]+'%'};return _0x169dff;}})});}_0x52b2f5=_[_0x347c('0x3d')]({},_0x52b2f5,_0x119d87[_0x347c('0x3e')]);var _0x3d51ba={'where':_0x52b2f5['where']};return db[_0x347c('0x2a')][_0x347c('0x1c')](_0x3d51ba)[_0x347c('0x22')](function(_0x58a4c7){_0x42e2ba['count']=_0x58a4c7;if(_0x119d87[_0x347c('0x2d')][_0x347c('0x3f')]){_0x52b2f5['include']=[{'all':!![]}];}return db[_0x347c('0x2a')][_0x347c('0x40')](_0x52b2f5);})[_0x347c('0x22')](function(_0x387152){_0x42e2ba[_0x347c('0x41')]=_0x387152;return _0x42e2ba;})[_0x347c('0x22')](respondWithFilteredResult(_0x181094,_0x52b2f5))[_0x347c('0x42')](handleError(_0x181094,null));};exports[_0x347c('0x43')]=function(_0x1e157e,_0x5a8c11){var _0x2b8a42={'raw':![],'where':{'id':_0x1e157e[_0x347c('0x44')]['id']}},_0x4c122={};_0x4c122['model']=_[_0x347c('0x2e')](db[_0x347c('0x2a')][_0x347c('0x2b')]);_0x4c122[_0x347c('0x2d')]=_[_0x347c('0x2e')](_0x1e157e[_0x347c('0x2d')]);_0x4c122[_0x347c('0x2f')]=_['intersection'](_0x4c122[_0x347c('0x31')],_0x4c122[_0x347c('0x2d')]);_0x2b8a42['attributes']=_[_0x347c('0x30')](_0x4c122['model'],qs[_0x347c('0x33')](_0x1e157e['query'][_0x347c('0x33')]));_0x2b8a42['attributes']=_0x2b8a42[_0x347c('0x32')][_0x347c('0x34')]?_0x2b8a42[_0x347c('0x32')]:_0x4c122['model'];if(_0x1e157e['query']['includeAll']){_0x2b8a42[_0x347c('0x45')]=[{'all':!![]}];}_0x2b8a42=_[_0x347c('0x3d')]({},_0x2b8a42,_0x1e157e[_0x347c('0x3e')]);return db[_0x347c('0x2a')][_0x347c('0x46')](_0x2b8a42)[_0x347c('0x22')](handleEntityNotFound(_0x5a8c11,null))[_0x347c('0x22')](respondWithResult(_0x5a8c11,null))['catch'](handleError(_0x5a8c11,null));};exports[_0x347c('0x47')]=function(_0x87f952,_0x5bc4cb){return db[_0x347c('0x2a')]['create'](_0x87f952[_0x347c('0x48')],{})[_0x347c('0x22')](respondWithResult(_0x5bc4cb,0xc9))['catch'](handleError(_0x5bc4cb,null));};exports['update']=function(_0x378347,_0x261426){if(_0x378347[_0x347c('0x48')]['id']){delete _0x378347['body']['id'];}return db['FreshsalesAccount'][_0x347c('0x46')]({'where':{'id':_0x378347[_0x347c('0x44')]['id']}})[_0x347c('0x22')](handleEntityNotFound(_0x261426,null))[_0x347c('0x22')](saveUpdates(_0x378347[_0x347c('0x48')],null))[_0x347c('0x22')](respondWithResult(_0x261426,null))['catch'](handleError(_0x261426,null));};exports[_0x347c('0x23')]=function(_0x8d8523,_0x332196){return db['FreshsalesAccount'][_0x347c('0x46')]({'where':{'id':_0x8d8523['params']['id']}})[_0x347c('0x22')](handleEntityNotFound(_0x332196,null))[_0x347c('0x22')](removeEntity(_0x332196,null))[_0x347c('0x42')](handleError(_0x332196,null));};exports[_0x347c('0x49')]=function(_0x379a2a,_0x451793,_0x5b08eb){var _0x268ad7={};var _0x3ce8c0={};var _0x35c949;var _0x36c007;return db['FreshsalesAccount'][_0x347c('0x4a')]({'where':{'id':_0x379a2a[_0x347c('0x44')]['id']}})[_0x347c('0x22')](handleEntityNotFound(_0x451793,null))[_0x347c('0x22')](function(_0x25258c){if(_0x25258c){_0x35c949=_0x25258c;_0x3ce8c0['model']=_['keys'](db['FreshsalesConfiguration'][_0x347c('0x2b')]);_0x3ce8c0[_0x347c('0x2d')]=_['keys'](_0x379a2a['query']);_0x3ce8c0[_0x347c('0x2f')]=_[_0x347c('0x30')](_0x3ce8c0[_0x347c('0x31')],_0x3ce8c0[_0x347c('0x2d')]);_0x268ad7[_0x347c('0x32')]=_['intersection'](_0x3ce8c0[_0x347c('0x31')],qs[_0x347c('0x33')](_0x379a2a[_0x347c('0x2d')][_0x347c('0x33')]));_0x268ad7[_0x347c('0x32')]=_0x268ad7['attributes']['length']?_0x268ad7['attributes']:_0x3ce8c0[_0x347c('0x31')];_0x268ad7[_0x347c('0x36')]=qs['sort'](_0x379a2a[_0x347c('0x2d')][_0x347c('0x37')]);_0x268ad7[_0x347c('0x3a')]=qs['filters'](_[_0x347c('0x38')](_0x379a2a[_0x347c('0x2d')],_0x3ce8c0[_0x347c('0x2f')]));if(_0x379a2a['query'][_0x347c('0x39')]){_0x268ad7[_0x347c('0x3a')]=_[_0x347c('0x3d')](_0x268ad7[_0x347c('0x3a')],{'$or':_['map'](_0x268ad7[_0x347c('0x32')],function(_0x38ba19){var _0x4fece5={};_0x4fece5[_0x38ba19]={'$like':'%'+_0x379a2a['query'][_0x347c('0x39')]+'%'};return _0x4fece5;})});}_0x268ad7=_[_0x347c('0x3d')]({},_0x268ad7,_0x379a2a[_0x347c('0x3e')]);return _0x35c949[_0x347c('0x49')](_0x268ad7);}})[_0x347c('0x22')](function(_0x2fd468){if(_0x2fd468){_0x36c007=_0x2fd468[_0x347c('0x34')];if(!_0x379a2a['query'][_0x347c('0x4b')](_0x347c('0x35'))){_0x268ad7[_0x347c('0x1a')]=qs[_0x347c('0x1a')](_0x379a2a[_0x347c('0x2d')][_0x347c('0x1a')]);_0x268ad7[_0x347c('0x19')]=qs[_0x347c('0x19')](_0x379a2a[_0x347c('0x2d')][_0x347c('0x19')]);}return _0x35c949[_0x347c('0x49')](_0x268ad7);}})[_0x347c('0x22')](function(_0x1b68ff){if(_0x1b68ff){return _0x1b68ff?{'count':_0x36c007,'rows':_0x1b68ff}:null;}})[_0x347c('0x22')](respondWithResult(_0x451793,null))[_0x347c('0x42')](handleError(_0x451793,null));};exports[_0x347c('0x4c')]=function(_0x22e867,_0xba780e,_0x6950d0){if(_0x22e867['body']['id']){delete _0x22e867[_0x347c('0x48')]['id'];}return db['FreshsalesAccount'][_0x347c('0x4a')]({'where':{'id':_0x22e867[_0x347c('0x44')]['id']}})[_0x347c('0x22')](handleEntityNotFound(_0xba780e,null))[_0x347c('0x22')](function(_0x50d62a){if(_0x50d62a){_0x22e867[_0x347c('0x48')]['AccountId']=_0x50d62a['id'];_0x22e867[_0x347c('0x48')]['Subjects']=integrations['getSubjects'](_0x22e867[_0x347c('0x48')][_0x347c('0x4d')],_0x22e867[_0x347c('0x48')][_0x347c('0x3b')]);_0x22e867[_0x347c('0x48')][_0x347c('0x4e')]=integrations['getDescriptions'](_0x22e867['body'][_0x347c('0x4d')],_0x22e867[_0x347c('0x48')][_0x347c('0x3b')]);return db[_0x347c('0x4f')][_0x347c('0x47')](_0x22e867['body'],{'include':[{'model':db[_0x347c('0x50')],'as':_0x347c('0x51')},{'model':db[_0x347c('0x50')],'as':'Descriptions'}]});}return null;})[_0x347c('0x22')](respondWithResult(_0xba780e,null))[_0x347c('0x42')](handleError(_0xba780e,null));};exports[_0x347c('0x52')]=function(_0x854ec9,_0x33fc1d,_0x46e31f){var _0x9dd646='';var _0x452d58='';return db[_0x347c('0x2a')][_0x347c('0x4a')]({'where':{'id':_0x854ec9[_0x347c('0x44')]['id']},'attributes':['id',_0x347c('0x53'),'remoteUri',_0x347c('0x54')]})[_0x347c('0x22')](handleEntityNotFound(_0x33fc1d,null))[_0x347c('0x22')](function(_0x9faf51){if(_0x9faf51){_0x452d58=_0x9faf51['username'];_0x9dd646=_0x9faf51['remoteUri'];var _0x35d8e2=_0x9faf51[_0x347c('0x55')]['slice'](-0x1);if(_0x35d8e2==='/'){_0x9dd646=_0x9dd646[_0x347c('0x56')](0x0,_0x9dd646[_0x347c('0x57')](_0x35d8e2));}return rp({'method':'GET','uri':util['format']('%s%s',_0x9dd646,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x9faf51['apiKey']},'json':!![]});}})[_0x347c('0x22')](function(_0x5c72fe){if(_0x5c72fe){var _0x14a712=_0x5c72fe[_0x347c('0x58')];var _0x6a23c4=![];var _0x59c8b4=null;for(_0x59c8b4=0x0;_0x59c8b4<_0x14a712[_0x347c('0x34')];_0x59c8b4++){if(_0x14a712[_0x59c8b4][_0x347c('0x59')]===_0x452d58){_0x6a23c4=!![];}}if(_0x6a23c4){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x347c('0x5a')});}}})['then'](respondWithResult(_0x33fc1d,null))[_0x347c('0x42')](function(_0x21a1b2){var _0x4a5906=_0x854ec9['query'][_0x347c('0x5b')]?0x1f4:_0x21a1b2[_0x347c('0x5c')]||0x1f4;logger['error'](_0x347c('0x5d'),_0x347c('0x52'),_0x4a5906,JSON[_0x347c('0x5e')](_0x21a1b2));delete _0x21a1b2['name'];if(_0x4a5906===0x191){_0x4a5906=0x190;}_0x33fc1d[_0x347c('0x17')](_0x4a5906)[_0x347c('0x5f')](_0x854ec9['query'][_0x347c('0x5b')]?{'message':_0x347c('0x60'),'statusCode':_0x21a1b2[_0x347c('0x5c')]}:_0x21a1b2);});};
\ No newline at end of file
index 2d59e5a..fc9ff0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','bluebird'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x5d58,0x187));var _0x85d5=function(_0x16f433,_0x3bd258){_0x16f433=_0x16f433-0x0;var _0x42f448=_0x5d58[_0x16f433];return _0x42f448;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x85d5('0x4'));module[_0x85d5('0x5')]=function(_0x578fad,_0x46e7b4){return _0x578fad['define'](_0x85d5('0x6'),attributes,{'tableName':_0x85d5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xed1c=['path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','request-promise'];(function(_0x1cb30c,_0x1bd163){var _0x339065=function(_0x3804f3){while(--_0x3804f3){_0x1cb30c['push'](_0x1cb30c['shift']());}};_0x339065(++_0x1bd163);}(_0xed1c,0xe4));var _0xced1=function(_0x22b5e2,_0x2b567f){_0x22b5e2=_0x22b5e2-0x0;var _0x31d942=_0xed1c[_0x22b5e2];return _0x31d942;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));var integrations=require(_0xced1('0x6'));module[_0xced1('0x7')]=function(_0x37b22b,_0x59399e){return _0x37b22b[_0xced1('0x8')](_0xced1('0x9'),attributes,{'tableName':_0xced1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3596dcc..cc52579 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2272=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','raw','ShowFreshsalesAccount'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var moment=require(_0x2227('0x2'));var BPromise=require(_0x2227('0x3'));var rs=require(_0x2227('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2227('0x5'))['db'];var utils=require(_0x2227('0x6'));var logger=require(_0x2227('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2227('0x8'));var client=jayson[_0x2227('0x9')][_0x2227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2591db,_0xaec623,_0x1413d2){return new BPromise(function(_0x41fc3f,_0x34bdd0){return client[_0x2227('0xb')](_0x2591db,_0x1413d2)[_0x2227('0xc')](function(_0x496bbd){logger[_0x2227('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0xaec623,_0x2227('0xe'));logger[_0x2227('0xf')](_0x2227('0x10'),_0xaec623,_0x2227('0xe'),JSON[_0x2227('0x11')](_0x496bbd));if(_0x496bbd['error']){if(_0x496bbd[_0x2227('0x12')][_0x2227('0x13')]===0x1f4){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x496bbd[_0x2227('0x12')][_0x2227('0x15')]);return _0x34bdd0(_0x496bbd['error']['message']);}logger['error'](_0x2227('0x14'),_0xaec623,_0x496bbd['error'][_0x2227('0x15')]);return _0x41fc3f(_0x496bbd[_0x2227('0x12')]['message']);}else{logger[_0x2227('0xd')](_0x2227('0x14'),_0xaec623,_0x2227('0xe'));_0x41fc3f(_0x496bbd[_0x2227('0x16')][_0x2227('0x15')]);}})[_0x2227('0x17')](function(_0x508e92){logger[_0x2227('0x12')](_0x2227('0x14'),_0xaec623,_0x508e92);_0x34bdd0(_0x508e92);});});}exports[_0x2227('0x18')]=function(_0x531f75){var _0x11bf80=this;return new Promise(function(_0x620012,_0x65e3b6){return db[_0x2227('0x19')][_0x2227('0x1a')]({'raw':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x531f75[_0x2227('0x1b')]?_0x531f75['options'][_0x2227('0x1c')]||null:null,'attributes':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'limit':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1e')]||null:null,'include':_0x531f75[_0x2227('0x1b')]?_0x531f75[_0x2227('0x1b')][_0x2227('0x1f')]?_[_0x2227('0x20')](_0x531f75['options'][_0x2227('0x1f')],function(_0x42d500){return{'model':db[_0x42d500['model']],'as':_0x42d500['as'],'attributes':_0x42d500[_0x2227('0x1d')],'include':_0x42d500[_0x2227('0x1f')]?_['map'](_0x42d500['include'],function(_0x17c7a4){return{'model':db[_0x17c7a4[_0x2227('0x21')]],'as':_0x17c7a4['as'],'attributes':_0x17c7a4[_0x2227('0x1d')],'include':_0x17c7a4[_0x2227('0x1f')]?_['map'](_0x17c7a4[_0x2227('0x1f')],function(_0x301304){return{'model':db[_0x301304[_0x2227('0x21')]],'as':_0x301304['as'],'attributes':_0x301304[_0x2227('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x204def){logger[_0x2227('0xd')](_0x2227('0x18'),_0x531f75);logger[_0x2227('0xf')](_0x2227('0x18'),_0x531f75,JSON['stringify'](_0x204def));_0x620012(_0x204def);})['catch'](function(_0x5d1d56){logger[_0x2227('0x12')]('GetFreshsalesAccount',_0x5d1d56[_0x2227('0x15')],_0x531f75);_0x65e3b6(_0x11bf80[_0x2227('0x12')](0x1f4,_0x5d1d56['message']));});});};exports['ShowFreshsalesAccount']=function(_0x1f1ba7){var _0x1818ba=this;return new Promise(function(_0x21838a,_0x4cc1e1){return db[_0x2227('0x19')]['find']({'raw':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x22')]===undefined?!![]:![]:!![],'where':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1c')]||null:null,'attributes':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1d')]||null:null,'include':_0x1f1ba7[_0x2227('0x1b')]?_0x1f1ba7[_0x2227('0x1b')]['include']?_[_0x2227('0x20')](_0x1f1ba7[_0x2227('0x1b')][_0x2227('0x1f')],function(_0x6cd5d7){return{'model':db[_0x6cd5d7['model']],'as':_0x6cd5d7['as'],'attributes':_0x6cd5d7[_0x2227('0x1d')],'include':_0x6cd5d7[_0x2227('0x1f')]?_[_0x2227('0x20')](_0x6cd5d7[_0x2227('0x1f')],function(_0x5186a6){return{'model':db[_0x5186a6[_0x2227('0x21')]],'as':_0x5186a6['as'],'attributes':_0x5186a6[_0x2227('0x1d')],'include':_0x5186a6[_0x2227('0x1f')]?_['map'](_0x5186a6['include'],function(_0x35d9f1){return{'model':db[_0x35d9f1[_0x2227('0x21')]],'as':_0x35d9f1['as'],'attributes':_0x35d9f1['attributes']};}):[]};}):[]};}):[]:[]})[_0x2227('0xc')](function(_0x9a8cc3){logger['info'](_0x2227('0x23'),_0x1f1ba7);logger['debug'](_0x2227('0x23'),_0x1f1ba7,JSON[_0x2227('0x11')](_0x9a8cc3));_0x21838a(_0x9a8cc3);})[_0x2227('0x17')](function(_0x36db00){logger['error'](_0x2227('0x23'),_0x36db00['message'],_0x1f1ba7);_0x4cc1e1(_0x1818ba[_0x2227('0x12')](0x1f4,_0x36db00[_0x2227('0x15')]));});});};
\ No newline at end of file
+var _0x5fdc=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','include','map','model','ShowFreshsalesAccount','find','where','catch','lodash'];(function(_0x27f39d,_0x5efee5){var _0x355e1e=function(_0x55afce){while(--_0x55afce){_0x27f39d['push'](_0x27f39d['shift']());}};_0x355e1e(++_0x5efee5);}(_0x5fdc,0x127));var _0xc5fd=function(_0x4386e0,_0x15c5f1){_0x4386e0=_0x4386e0-0x0;var _0x40338b=_0x5fdc[_0x4386e0];return _0x40338b;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}exports[_0xc5fd('0x19')]=function(_0x27f611){var _0xd0a9f1=this;return new Promise(function(_0x2ee392,_0x3f981f){return db[_0xc5fd('0x1a')]['findAll']({'raw':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')]['where']||null:null,'attributes':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1d')]||null:null,'limit':_0x27f611[_0xc5fd('0x1b')]?_0x27f611['options']['limit']||null:null,'include':_0x27f611[_0xc5fd('0x1b')]?_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x27f611[_0xc5fd('0x1b')][_0xc5fd('0x1e')],function(_0x56d473){return{'model':db[_0x56d473[_0xc5fd('0x20')]],'as':_0x56d473['as'],'attributes':_0x56d473[_0xc5fd('0x1d')],'include':_0x56d473[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x56d473[_0xc5fd('0x1e')],function(_0x4020af){return{'model':db[_0x4020af[_0xc5fd('0x20')]],'as':_0x4020af['as'],'attributes':_0x4020af['attributes'],'include':_0x4020af[_0xc5fd('0x1e')]?_['map'](_0x4020af[_0xc5fd('0x1e')],function(_0x231368){return{'model':db[_0x231368[_0xc5fd('0x20')]],'as':_0x231368['as'],'attributes':_0x231368[_0xc5fd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x176313){logger[_0xc5fd('0x18')](_0xc5fd('0x19'),_0x27f611);logger[_0xc5fd('0x11')](_0xc5fd('0x19'),_0x27f611,JSON[_0xc5fd('0x13')](_0x176313));_0x2ee392(_0x176313);})['catch'](function(_0x412ef7){logger['error']('GetFreshsalesAccount',_0x412ef7[_0xc5fd('0x16')],_0x27f611);_0x3f981f(_0xd0a9f1[_0xc5fd('0x14')](0x1f4,_0x412ef7[_0xc5fd('0x16')]));});});};exports[_0xc5fd('0x21')]=function(_0x7693c4){var _0x85fa81=this;return new Promise(function(_0x2a891d,_0x321eea){return db['FreshsalesAccount'][_0xc5fd('0x22')]({'raw':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1c')]===undefined?!![]:![]:!![],'where':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x23')]||null:null,'attributes':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1d')]||null:null,'include':_0x7693c4[_0xc5fd('0x1b')]?_0x7693c4[_0xc5fd('0x1b')]['include']?_[_0xc5fd('0x1f')](_0x7693c4[_0xc5fd('0x1b')][_0xc5fd('0x1e')],function(_0x1fa329){return{'model':db[_0x1fa329[_0xc5fd('0x20')]],'as':_0x1fa329['as'],'attributes':_0x1fa329[_0xc5fd('0x1d')],'include':_0x1fa329[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x1fa329[_0xc5fd('0x1e')],function(_0x545bfc){return{'model':db[_0x545bfc[_0xc5fd('0x20')]],'as':_0x545bfc['as'],'attributes':_0x545bfc[_0xc5fd('0x1d')],'include':_0x545bfc[_0xc5fd('0x1e')]?_[_0xc5fd('0x1f')](_0x545bfc[_0xc5fd('0x1e')],function(_0x52267e){return{'model':db[_0x52267e[_0xc5fd('0x20')]],'as':_0x52267e['as'],'attributes':_0x52267e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5fd('0xf')](function(_0xac7c40){logger['info'](_0xc5fd('0x21'),_0x7693c4);logger['debug'](_0xc5fd('0x21'),_0x7693c4,JSON[_0xc5fd('0x13')](_0xac7c40));_0x2a891d(_0xac7c40);})[_0xc5fd('0x24')](function(_0x4cafb1){logger[_0xc5fd('0x14')](_0xc5fd('0x21'),_0x4cafb1['message'],_0x7693c4);_0x321eea(_0x85fa81[_0xc5fd('0x14')](0x1f4,_0x4cafb1[_0xc5fd('0x16')]));});});};
\ No newline at end of file
index 0b0ef83..117c6c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11d1=['../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','show','get','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','/:id','update','destroy','multer','util','path','Router','../../components/auth/service'];(function(_0xc5ea2d,_0x33b6d4){var _0x3e90a1=function(_0x5cca30){while(--_0x5cca30){_0xc5ea2d['push'](_0xc5ea2d['shift']());}};_0x3e90a1(++_0x33b6d4);}(_0x11d1,0x160));var _0x111d=function(_0x240c77,_0x2dcc04){_0x240c77=_0x240c77-0x0;var _0x37afd1=_0x11d1[_0x240c77];return _0x37afd1;};'use strict';var multer=require(_0x111d('0x0'));var util=require(_0x111d('0x1'));var path=require(_0x111d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x111d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x111d('0x4'));var interaction=require(_0x111d('0x5'));var config=require(_0x111d('0x6'));var controller=require(_0x111d('0x7'));router['get']('/',auth[_0x111d('0x8')](),controller['index']);router['get']('/:id',auth[_0x111d('0x8')](),controller[_0x111d('0x9')]);router[_0x111d('0xa')](_0x111d('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x111d('0xa')](_0x111d('0xc'),auth['isAuthenticated'](),controller[_0x111d('0xd')]);router['get'](_0x111d('0xe'),auth[_0x111d('0x8')](),controller[_0x111d('0xf')]);router['post']('/',auth[_0x111d('0x8')](),controller[_0x111d('0x10')]);router[_0x111d('0x11')](_0x111d('0x12'),auth[_0x111d('0x8')](),controller[_0x111d('0x13')]);router['delete'](_0x111d('0x12'),auth[_0x111d('0x8')](),controller[_0x111d('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x2775=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesConfiguration.controller','/:id','isAuthenticated','show','get','/:id/subjects','/:id/descriptions','getDescriptions','getFields','post','create','put'];(function(_0xaec248,_0x48317a){var _0x50b7d2=function(_0x4bdeea){while(--_0x4bdeea){_0xaec248['push'](_0xaec248['shift']());}};_0x50b7d2(++_0x48317a);}(_0x2775,0xab));var _0x5277=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0x2775[_0x2a56ad];return _0x425175;};'use strict';var multer=require(_0x5277('0x0'));var util=require(_0x5277('0x1'));var path=require(_0x5277('0x2'));var timeout=require(_0x5277('0x3'));var express=require(_0x5277('0x4'));var router=express[_0x5277('0x5')]();var fs_extra=require(_0x5277('0x6'));var auth=require(_0x5277('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5277('0x8'));var controller=require(_0x5277('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5277('0xa'),auth[_0x5277('0xb')](),controller[_0x5277('0xc')]);router[_0x5277('0xd')](_0x5277('0xe'),auth[_0x5277('0xb')](),controller['getSubjects']);router[_0x5277('0xd')](_0x5277('0xf'),auth[_0x5277('0xb')](),controller[_0x5277('0x10')]);router[_0x5277('0xd')]('/:id/fields',auth[_0x5277('0xb')](),controller[_0x5277('0x11')]);router[_0x5277('0x12')]('/',auth[_0x5277('0xb')](),controller[_0x5277('0x13')]);router[_0x5277('0x14')](_0x5277('0xa'),auth['isAuthenticated'](),controller[_0x5277('0x15')]);router['delete'](_0x5277('0xa'),auth[_0x5277('0xb')](),controller[_0x5277('0x16')]);module[_0x5277('0x17')]=router;
\ No newline at end of file
index 5bcaa69..910acd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6753=['exports','STRING','sequelize'];(function(_0x3c9384,_0x3b4334){var _0x331d8b=function(_0x3d57af){while(--_0x3d57af){_0x3c9384['push'](_0x3c9384['shift']());}};_0x331d8b(++_0x3b4334);}(_0x6753,0x182));var _0x3675=function(_0x3d549a,_0x49ea8d){_0x3d549a=_0x3d549a-0x0;var _0x1dc73e=_0x6753[_0x3d549a];return _0x1dc73e;};'use strict';var Sequelize=require(_0x3675('0x0'));module[_0x3675('0x1')]={'name':{'type':Sequelize[_0x3675('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2773=['sequelize','exports','STRING'];(function(_0x1c384f,_0x5c4bbe){var _0x4976f1=function(_0x319310){while(--_0x319310){_0x1c384f['push'](_0x1c384f['shift']());}};_0x4976f1(++_0x5c4bbe);}(_0x2773,0x171));var _0x3277=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2773[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x3277('0x0'));module[_0x3277('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3277('0x2')]}};
\ No newline at end of file
index f47695e..59e4de0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x494d=['findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','FreshsalesConfiguration','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','getSubjects'];(function(_0x1714d5,_0xf2ad9a){var _0xbcfd82=function(_0x3f03c4){while(--_0x3f03c4){_0x1714d5['push'](_0x1714d5['shift']());}};_0xbcfd82(++_0xf2ad9a);}(_0x494d,0x1a8));var _0xd494=function(_0x41622c,_0x5f5350){_0x41622c=_0x41622c-0x0;var _0x374a3e=_0x494d[_0x41622c];return _0x374a3e;};'use strict';var emlformat=require(_0xd494('0x0'));var rimraf=require(_0xd494('0x1'));var zipdir=require(_0xd494('0x2'));var jsonpatch=require(_0xd494('0x3'));var rp=require(_0xd494('0x4'));var moment=require(_0xd494('0x5'));var BPromise=require(_0xd494('0x6'));var Mustache=require(_0xd494('0x7'));var util=require(_0xd494('0x8'));var path=require(_0xd494('0x9'));var sox=require(_0xd494('0xa'));var csv=require('to-csv');var ejs=require(_0xd494('0xb'));var fs=require('fs');var fs_extra=require(_0xd494('0xc'));var _=require('lodash');var squel=require(_0xd494('0xd'));var crypto=require(_0xd494('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd494('0xf'));var toCsv=require(_0xd494('0x10'));var querystring=require(_0xd494('0x11'));var Papa=require(_0xd494('0x12'));var Redis=require(_0xd494('0x13'));var authService=require(_0xd494('0x14'));var qs=require(_0xd494('0x15'));var as=require(_0xd494('0x16'));var hardwareService=require(_0xd494('0x17'));var logger=require('../../config/logger')(_0xd494('0x18'));var utils=require(_0xd494('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd494('0x1a'));var db=require(_0xd494('0x1b'))['db'];function respondWithStatusCode(_0x32a34e,_0x551735){_0x551735=_0x551735||0xcc;return function(_0x89c04a){if(_0x89c04a){return _0x32a34e[_0xd494('0x1c')](_0x551735);}return _0x32a34e[_0xd494('0x1d')](_0x551735)[_0xd494('0x1e')]();};}function respondWithResult(_0x5bc852,_0x5913c6){_0x5913c6=_0x5913c6||0xc8;return function(_0x85c638){if(_0x85c638){return _0x5bc852[_0xd494('0x1d')](_0x5913c6)[_0xd494('0x1f')](_0x85c638);}};}function respondWithFilteredResult(_0xb36829,_0x2ac19a){return function(_0x7a82c1){if(_0x7a82c1){var _0x481386=typeof _0x2ac19a[_0xd494('0x20')]===_0xd494('0x21')&&typeof _0x2ac19a[_0xd494('0x22')]==='undefined';var _0x5be335=_0x7a82c1[_0xd494('0x23')];var _0x5c0798=_0x481386?0x0:_0x2ac19a[_0xd494('0x20')];var _0x334ca5=_0x481386?_0x7a82c1[_0xd494('0x23')]:_0x2ac19a['offset']+_0x2ac19a['limit'];var _0x244d08;if(_0x334ca5>=_0x5be335){_0x334ca5=_0x5be335;_0x244d08=0xc8;}else{_0x244d08=0xce;}_0xb36829[_0xd494('0x1d')](_0x244d08);return _0xb36829['set'](_0xd494('0x24'),_0x5c0798+'-'+_0x334ca5+'/'+_0x5be335)['json'](_0x7a82c1);}return null;};}function patchUpdates(_0x576bbd){return function(_0x3e3269){try{jsonpatch[_0xd494('0x25')](_0x3e3269,_0x576bbd,!![]);}catch(_0x18beaf){return BPromise['reject'](_0x18beaf);}return _0x3e3269[_0xd494('0x26')]();};}function saveUpdates(_0x213e82,_0x5b3d8c){return function(_0x547d5c){if(_0x547d5c){return _0x547d5c[_0xd494('0x27')](_0x213e82)[_0xd494('0x28')](function(_0x3b42d6){return _0x3b42d6;});}return null;};}function removeEntity(_0x5dbbcf,_0x4f52ff){return function(_0x4d41f6){if(_0x4d41f6){return _0x4d41f6[_0xd494('0x29')]()[_0xd494('0x28')](function(){_0x5dbbcf[_0xd494('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3542c4,_0x2884a9){return function(_0x1de8bc){if(!_0x1de8bc){_0x3542c4['sendStatus'](0x194);}return _0x1de8bc;};}function handleError(_0x66060e,_0x57a294){_0x57a294=_0x57a294||0x1f4;return function(_0x4ed034){logger[_0xd494('0x2a')](_0x4ed034['stack']);if(_0x4ed034[_0xd494('0x2b')]){delete _0x4ed034[_0xd494('0x2b')];}_0x66060e['status'](_0x57a294)[_0xd494('0x2c')](_0x4ed034);};}exports[_0xd494('0x2d')]=function(_0x404366,_0x16017d){var _0x334d6b={},_0x72d394={},_0x2e6302={'count':0x0,'rows':[]};var _0x21651d=_[_0xd494('0x2e')](db[_0xd494('0x2f')][_0xd494('0x30')],function(_0x3f37bd){return{'name':_0x3f37bd['fieldName'],'type':_0x3f37bd['type'][_0xd494('0x31')]};});_0x72d394['model']=_[_0xd494('0x2e')](_0x21651d,'name');_0x72d394['query']=_[_0xd494('0x32')](_0x404366[_0xd494('0x33')]);_0x72d394[_0xd494('0x34')]=_[_0xd494('0x35')](_0x72d394[_0xd494('0x36')],_0x72d394['query']);_0x334d6b[_0xd494('0x37')]=_[_0xd494('0x35')](_0x72d394[_0xd494('0x36')],qs[_0xd494('0x38')](_0x404366[_0xd494('0x33')][_0xd494('0x38')]));_0x334d6b[_0xd494('0x37')]=_0x334d6b[_0xd494('0x37')][_0xd494('0x39')]?_0x334d6b[_0xd494('0x37')]:_0x72d394[_0xd494('0x36')];if(!_0x404366[_0xd494('0x33')][_0xd494('0x3a')](_0xd494('0x3b'))){_0x334d6b['limit']=qs[_0xd494('0x22')](_0x404366['query'][_0xd494('0x22')]);_0x334d6b['offset']=qs[_0xd494('0x20')](_0x404366[_0xd494('0x33')][_0xd494('0x20')]);}_0x334d6b[_0xd494('0x3c')]=qs[_0xd494('0x3d')](_0x404366[_0xd494('0x33')][_0xd494('0x3d')]);_0x334d6b[_0xd494('0x3e')]=qs[_0xd494('0x34')](_[_0xd494('0x3f')](_0x404366[_0xd494('0x33')],_0x72d394[_0xd494('0x34')]),_0x21651d);if(_0x404366[_0xd494('0x33')][_0xd494('0x40')]){_0x334d6b[_0xd494('0x3e')]=_[_0xd494('0x41')](_0x334d6b[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0x21651d,function(_0x636839){if(_0x636839[_0xd494('0x42')]!==_0xd494('0x43')){var _0x1d1339={};_0x1d1339[_0x636839[_0xd494('0x2b')]]={'$like':'%'+_0x404366[_0xd494('0x33')][_0xd494('0x40')]+'%'};return _0x1d1339;}})});}_0x334d6b=_['merge']({},_0x334d6b,_0x404366[_0xd494('0x44')]);var _0x5c1767={'where':_0x334d6b[_0xd494('0x3e')]};return db[_0xd494('0x2f')]['count'](_0x5c1767)[_0xd494('0x28')](function(_0x5937aa){_0x2e6302[_0xd494('0x23')]=_0x5937aa;if(_0x404366[_0xd494('0x33')]['includeAll']){_0x334d6b[_0xd494('0x45')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xd494('0x46')](_0x334d6b);})[_0xd494('0x28')](function(_0x233a7a){_0x2e6302[_0xd494('0x47')]=_0x233a7a;return _0x2e6302;})[_0xd494('0x28')](respondWithFilteredResult(_0x16017d,_0x334d6b))['catch'](handleError(_0x16017d,null));};exports[_0xd494('0x48')]=function(_0x53bec9,_0x3301b6){var _0x247bb5={'raw':![],'where':{'id':_0x53bec9[_0xd494('0x49')]['id']}},_0x25ca77={};_0x25ca77['model']=_[_0xd494('0x32')](db[_0xd494('0x2f')]['rawAttributes']);_0x25ca77[_0xd494('0x33')]=_['keys'](_0x53bec9[_0xd494('0x33')]);_0x25ca77[_0xd494('0x34')]=_['intersection'](_0x25ca77[_0xd494('0x36')],_0x25ca77['query']);_0x247bb5[_0xd494('0x37')]=_['intersection'](_0x25ca77['model'],qs[_0xd494('0x38')](_0x53bec9[_0xd494('0x33')][_0xd494('0x38')]));_0x247bb5['attributes']=_0x247bb5['attributes'][_0xd494('0x39')]?_0x247bb5['attributes']:_0x25ca77[_0xd494('0x36')];if(_0x53bec9[_0xd494('0x33')][_0xd494('0x4a')]){_0x247bb5[_0xd494('0x45')]=[{'all':!![]}];}_0x247bb5=_[_0xd494('0x41')]({},_0x247bb5,_0x53bec9['options']);return db[_0xd494('0x2f')][_0xd494('0x4b')](_0x247bb5)[_0xd494('0x28')](handleEntityNotFound(_0x3301b6,null))[_0xd494('0x28')](respondWithResult(_0x3301b6,null))[_0xd494('0x4c')](handleError(_0x3301b6,null));};exports[_0xd494('0x4d')]=function(_0x50a688,_0x87d4eb){return db['FreshsalesConfiguration'][_0xd494('0x4d')](_0x50a688[_0xd494('0x4e')],{})['then'](respondWithResult(_0x87d4eb,0xc9))[_0xd494('0x4c')](handleError(_0x87d4eb,null));};exports[_0xd494('0x27')]=function(_0x52a7cd,_0x2108a9){if(_0x52a7cd[_0xd494('0x4e')]['id']){delete _0x52a7cd[_0xd494('0x4e')]['id'];}return db[_0xd494('0x2f')][_0xd494('0x4b')]({'where':{'id':_0x52a7cd[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x2108a9,null))[_0xd494('0x28')](saveUpdates(_0x52a7cd['body'],null))['then'](respondWithResult(_0x2108a9,null))[_0xd494('0x4c')](handleError(_0x2108a9,null));};exports[_0xd494('0x29')]=function(_0x3a1cfc,_0x549631){return db[_0xd494('0x2f')]['find']({'where':{'id':_0x3a1cfc[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x549631,null))[_0xd494('0x28')](removeEntity(_0x549631,null))[_0xd494('0x4c')](handleError(_0x549631,null));};exports[_0xd494('0x4f')]=function(_0x2b85c3,_0x594c4d,_0x28fcb2){var _0x39acef={};var _0x4ec4d1={};var _0x48b130;var _0x469e0b;return db[_0xd494('0x2f')][_0xd494('0x50')]({'where':{'id':_0x2b85c3[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x594c4d,null))[_0xd494('0x28')](function(_0x233acc){if(_0x233acc){_0x48b130=_0x233acc;_0x4ec4d1['model']=_[_0xd494('0x32')](db[_0xd494('0x51')][_0xd494('0x30')]);_0x4ec4d1[_0xd494('0x33')]=_['keys'](_0x2b85c3[_0xd494('0x33')]);_0x4ec4d1['filters']=_['intersection'](_0x4ec4d1[_0xd494('0x36')],_0x4ec4d1['query']);_0x39acef[_0xd494('0x37')]=_[_0xd494('0x35')](_0x4ec4d1['model'],qs[_0xd494('0x38')](_0x2b85c3[_0xd494('0x33')]['fields']));_0x39acef[_0xd494('0x37')]=_0x39acef['attributes'][_0xd494('0x39')]?_0x39acef[_0xd494('0x37')]:_0x4ec4d1[_0xd494('0x36')];_0x39acef[_0xd494('0x3c')]=qs[_0xd494('0x3d')](_0x2b85c3[_0xd494('0x33')][_0xd494('0x3d')]);_0x39acef[_0xd494('0x3e')]=qs[_0xd494('0x34')](_[_0xd494('0x3f')](_0x2b85c3[_0xd494('0x33')],_0x4ec4d1[_0xd494('0x34')]));if(_0x2b85c3[_0xd494('0x33')]['filter']){_0x39acef[_0xd494('0x3e')]=_[_0xd494('0x41')](_0x39acef[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0x39acef[_0xd494('0x37')],function(_0x55e8e9){var _0x4c0339={};_0x4c0339[_0x55e8e9]={'$like':'%'+_0x2b85c3[_0xd494('0x33')][_0xd494('0x40')]+'%'};return _0x4c0339;})});}_0x39acef=_['merge']({},_0x39acef,_0x2b85c3[_0xd494('0x44')]);return _0x48b130['getSubjects'](_0x39acef);}})[_0xd494('0x28')](function(_0x190718){if(_0x190718){_0x469e0b=_0x190718[_0xd494('0x39')];if(!_0x2b85c3['query']['hasOwnProperty'](_0xd494('0x3b'))){_0x39acef['limit']=qs['limit'](_0x2b85c3[_0xd494('0x33')][_0xd494('0x22')]);_0x39acef[_0xd494('0x20')]=qs[_0xd494('0x20')](_0x2b85c3[_0xd494('0x33')][_0xd494('0x20')]);}return _0x48b130[_0xd494('0x4f')](_0x39acef);}})[_0xd494('0x28')](function(_0x1d19c5){if(_0x1d19c5){return _0x1d19c5?{'count':_0x469e0b,'rows':_0x1d19c5}:null;}})['then'](respondWithResult(_0x594c4d,null))[_0xd494('0x4c')](handleError(_0x594c4d,null));};exports[_0xd494('0x52')]=function(_0x3f42ad,_0x54bdd9,_0x1ac614){var _0x48fe7a={};var _0x23d8cf={};var _0x5d81c9;var _0x24ff56;return db[_0xd494('0x2f')][_0xd494('0x50')]({'where':{'id':_0x3f42ad[_0xd494('0x49')]['id']}})[_0xd494('0x28')](handleEntityNotFound(_0x54bdd9,null))[_0xd494('0x28')](function(_0x2fa5e1){if(_0x2fa5e1){_0x5d81c9=_0x2fa5e1;_0x23d8cf[_0xd494('0x36')]=_['keys'](db[_0xd494('0x51')][_0xd494('0x30')]);_0x23d8cf['query']=_['keys'](_0x3f42ad[_0xd494('0x33')]);_0x23d8cf[_0xd494('0x34')]=_[_0xd494('0x35')](_0x23d8cf['model'],_0x23d8cf[_0xd494('0x33')]);_0x48fe7a[_0xd494('0x37')]=_[_0xd494('0x35')](_0x23d8cf[_0xd494('0x36')],qs[_0xd494('0x38')](_0x3f42ad[_0xd494('0x33')][_0xd494('0x38')]));_0x48fe7a[_0xd494('0x37')]=_0x48fe7a['attributes'][_0xd494('0x39')]?_0x48fe7a[_0xd494('0x37')]:_0x23d8cf['model'];_0x48fe7a['order']=qs[_0xd494('0x3d')](_0x3f42ad[_0xd494('0x33')][_0xd494('0x3d')]);_0x48fe7a[_0xd494('0x3e')]=qs[_0xd494('0x34')](_['pick'](_0x3f42ad[_0xd494('0x33')],_0x23d8cf['filters']));if(_0x3f42ad['query']['filter']){_0x48fe7a[_0xd494('0x3e')]=_['merge'](_0x48fe7a[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0x48fe7a[_0xd494('0x37')],function(_0x3da28a){var _0x18048e={};_0x18048e[_0x3da28a]={'$like':'%'+_0x3f42ad['query'][_0xd494('0x40')]+'%'};return _0x18048e;})});}_0x48fe7a=_['merge']({},_0x48fe7a,_0x3f42ad[_0xd494('0x44')]);return _0x5d81c9[_0xd494('0x52')](_0x48fe7a);}})[_0xd494('0x28')](function(_0xe808e){if(_0xe808e){_0x24ff56=_0xe808e[_0xd494('0x39')];if(!_0x3f42ad[_0xd494('0x33')][_0xd494('0x3a')]('nolimit')){_0x48fe7a[_0xd494('0x22')]=qs[_0xd494('0x22')](_0x3f42ad['query'][_0xd494('0x22')]);_0x48fe7a[_0xd494('0x20')]=qs[_0xd494('0x20')](_0x3f42ad[_0xd494('0x33')]['offset']);}return _0x5d81c9[_0xd494('0x52')](_0x48fe7a);}})[_0xd494('0x28')](function(_0x2feca5){if(_0x2feca5){return _0x2feca5?{'count':_0x24ff56,'rows':_0x2feca5}:null;}})[_0xd494('0x28')](respondWithResult(_0x54bdd9,null))['catch'](handleError(_0x54bdd9,null));};exports['getFields']=function(_0x1d2393,_0x13d6bf,_0x3bd0f9){var _0xc70589={};var _0x2dea10={};var _0x34ed16;var _0x33f3e7;return db[_0xd494('0x2f')][_0xd494('0x50')]({'where':{'id':_0x1d2393[_0xd494('0x49')]['id']}})['then'](handleEntityNotFound(_0x13d6bf,null))[_0xd494('0x28')](function(_0x3b9038){if(_0x3b9038){_0x34ed16=_0x3b9038;_0x2dea10['model']=_['keys'](db['FreshsalesField']['rawAttributes']);_0x2dea10[_0xd494('0x33')]=_[_0xd494('0x32')](_0x1d2393[_0xd494('0x33')]);_0x2dea10[_0xd494('0x34')]=_['intersection'](_0x2dea10[_0xd494('0x36')],_0x2dea10[_0xd494('0x33')]);_0xc70589[_0xd494('0x37')]=_['intersection'](_0x2dea10[_0xd494('0x36')],qs['fields'](_0x1d2393['query']['fields']));_0xc70589['attributes']=_0xc70589[_0xd494('0x37')][_0xd494('0x39')]?_0xc70589[_0xd494('0x37')]:_0x2dea10[_0xd494('0x36')];_0xc70589[_0xd494('0x3c')]=qs['sort'](_0x1d2393[_0xd494('0x33')][_0xd494('0x3d')]);_0xc70589[_0xd494('0x3e')]=qs[_0xd494('0x34')](_[_0xd494('0x3f')](_0x1d2393[_0xd494('0x33')],_0x2dea10['filters']));if(_0x1d2393['query'][_0xd494('0x40')]){_0xc70589[_0xd494('0x3e')]=_[_0xd494('0x41')](_0xc70589[_0xd494('0x3e')],{'$or':_[_0xd494('0x2e')](_0xc70589[_0xd494('0x37')],function(_0x3eb247){var _0x16aaf9={};_0x16aaf9[_0x3eb247]={'$like':'%'+_0x1d2393[_0xd494('0x33')][_0xd494('0x40')]+'%'};return _0x16aaf9;})});}_0xc70589=_[_0xd494('0x41')]({},_0xc70589,_0x1d2393[_0xd494('0x44')]);return _0x34ed16[_0xd494('0x53')](_0xc70589);}})[_0xd494('0x28')](function(_0x7c40e4){if(_0x7c40e4){_0x33f3e7=_0x7c40e4[_0xd494('0x39')];if(!_0x1d2393[_0xd494('0x33')]['hasOwnProperty']('nolimit')){_0xc70589[_0xd494('0x22')]=qs[_0xd494('0x22')](_0x1d2393['query'][_0xd494('0x22')]);_0xc70589['offset']=qs[_0xd494('0x20')](_0x1d2393[_0xd494('0x33')][_0xd494('0x20')]);}return _0x34ed16[_0xd494('0x53')](_0xc70589);}})[_0xd494('0x28')](function(_0x4721d0){if(_0x4721d0){return _0x4721d0?{'count':_0x33f3e7,'rows':_0x4721d0}:null;}})[_0xd494('0x28')](respondWithResult(_0x13d6bf,null))[_0xd494('0x4c')](handleError(_0x13d6bf,null));};
\ No newline at end of file
+var _0xcdac=['nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','find','getSubjects','findOne','FreshsalesField','rawAttributes','sort','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','map','FreshsalesConfiguration','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x16e0c8,_0x4861eb){var _0xe4b5af=function(_0x5248bc){while(--_0x5248bc){_0x16e0c8['push'](_0x16e0c8['shift']());}};_0xe4b5af(++_0x4861eb);}(_0xcdac,0x6c));var _0xccda=function(_0x34ce7f,_0x562d37){_0x34ce7f=_0x34ce7f-0x0;var _0x58c02e=_0xcdac[_0x34ce7f];return _0x58c02e;};'use strict';var emlformat=require(_0xccda('0x0'));var rimraf=require(_0xccda('0x1'));var zipdir=require(_0xccda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xccda('0x3'));var moment=require('moment');var BPromise=require(_0xccda('0x4'));var Mustache=require(_0xccda('0x5'));var util=require(_0xccda('0x6'));var path=require(_0xccda('0x7'));var sox=require(_0xccda('0x8'));var csv=require(_0xccda('0x9'));var ejs=require(_0xccda('0xa'));var fs=require('fs');var fs_extra=require(_0xccda('0xb'));var _=require('lodash');var squel=require(_0xccda('0xc'));var crypto=require(_0xccda('0xd'));var jsforce=require(_0xccda('0xe'));var deskjs=require(_0xccda('0xf'));var toCsv=require(_0xccda('0x9'));var querystring=require(_0xccda('0x10'));var Papa=require(_0xccda('0x11'));var Redis=require('ioredis');var authService=require(_0xccda('0x12'));var qs=require(_0xccda('0x13'));var as=require(_0xccda('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xccda('0x15'));var utils=require(_0xccda('0x16'));var config=require(_0xccda('0x17'));var licenseUtil=require(_0xccda('0x18'));var db=require(_0xccda('0x19'))['db'];function respondWithStatusCode(_0x139bc8,_0x5bb35d){_0x5bb35d=_0x5bb35d||0xcc;return function(_0x42404d){if(_0x42404d){return _0x139bc8['sendStatus'](_0x5bb35d);}return _0x139bc8['status'](_0x5bb35d)[_0xccda('0x1a')]();};}function respondWithResult(_0x1b89a1,_0xa2b88b){_0xa2b88b=_0xa2b88b||0xc8;return function(_0x1e14ce){if(_0x1e14ce){return _0x1b89a1[_0xccda('0x1b')](_0xa2b88b)[_0xccda('0x1c')](_0x1e14ce);}};}function respondWithFilteredResult(_0x1e2162,_0x38db37){return function(_0xaef5a6){if(_0xaef5a6){var _0x4416d6=typeof _0x38db37[_0xccda('0x1d')]===_0xccda('0x1e')&&typeof _0x38db37[_0xccda('0x1f')]===_0xccda('0x1e');var _0x3959a2=_0xaef5a6[_0xccda('0x20')];var _0x21d98a=_0x4416d6?0x0:_0x38db37[_0xccda('0x1d')];var _0x4a1def=_0x4416d6?_0xaef5a6[_0xccda('0x20')]:_0x38db37[_0xccda('0x1d')]+_0x38db37['limit'];var _0x3b1b2e;if(_0x4a1def>=_0x3959a2){_0x4a1def=_0x3959a2;_0x3b1b2e=0xc8;}else{_0x3b1b2e=0xce;}_0x1e2162[_0xccda('0x1b')](_0x3b1b2e);return _0x1e2162['set'](_0xccda('0x21'),_0x21d98a+'-'+_0x4a1def+'/'+_0x3959a2)[_0xccda('0x1c')](_0xaef5a6);}return null;};}function patchUpdates(_0x32c003){return function(_0x464d82){try{jsonpatch[_0xccda('0x22')](_0x464d82,_0x32c003,!![]);}catch(_0x9cde84){return BPromise[_0xccda('0x23')](_0x9cde84);}return _0x464d82['save']();};}function saveUpdates(_0x3be681,_0x49c5b7){return function(_0x3d2400){if(_0x3d2400){return _0x3d2400[_0xccda('0x24')](_0x3be681)[_0xccda('0x25')](function(_0x1f0466){return _0x1f0466;});}return null;};}function removeEntity(_0x3606be,_0xd9b326){return function(_0x542360){if(_0x542360){return _0x542360[_0xccda('0x26')]()[_0xccda('0x25')](function(){_0x3606be['status'](0xcc)[_0xccda('0x1a')]();});}};}function handleEntityNotFound(_0x1442ed,_0x4cae3a){return function(_0x1285a3){if(!_0x1285a3){_0x1442ed[_0xccda('0x27')](0x194);}return _0x1285a3;};}function handleError(_0x9eab1a,_0x39e93a){_0x39e93a=_0x39e93a||0x1f4;return function(_0x90b9fd){logger[_0xccda('0x28')](_0x90b9fd[_0xccda('0x29')]);if(_0x90b9fd[_0xccda('0x2a')]){delete _0x90b9fd[_0xccda('0x2a')];}_0x9eab1a[_0xccda('0x1b')](_0x39e93a)['send'](_0x90b9fd);};}exports[_0xccda('0x2b')]=function(_0x3df554,_0x14e352){var _0x6b9362={},_0x334b50={},_0x7ce8a2={'count':0x0,'rows':[]};var _0x2f6853=_[_0xccda('0x2c')](db[_0xccda('0x2d')]['rawAttributes'],function(_0x5cbc4d){return{'name':_0x5cbc4d[_0xccda('0x2e')],'type':_0x5cbc4d['type'][_0xccda('0x2f')]};});_0x334b50[_0xccda('0x30')]=_[_0xccda('0x2c')](_0x2f6853,_0xccda('0x2a'));_0x334b50[_0xccda('0x31')]=_[_0xccda('0x32')](_0x3df554[_0xccda('0x31')]);_0x334b50['filters']=_[_0xccda('0x33')](_0x334b50[_0xccda('0x30')],_0x334b50[_0xccda('0x31')]);_0x6b9362[_0xccda('0x34')]=_[_0xccda('0x33')](_0x334b50['model'],qs[_0xccda('0x35')](_0x3df554['query'][_0xccda('0x35')]));_0x6b9362[_0xccda('0x34')]=_0x6b9362[_0xccda('0x34')][_0xccda('0x36')]?_0x6b9362[_0xccda('0x34')]:_0x334b50[_0xccda('0x30')];if(!_0x3df554[_0xccda('0x31')][_0xccda('0x37')](_0xccda('0x38'))){_0x6b9362[_0xccda('0x1f')]=qs['limit'](_0x3df554[_0xccda('0x31')]['limit']);_0x6b9362[_0xccda('0x1d')]=qs[_0xccda('0x1d')](_0x3df554['query'][_0xccda('0x1d')]);}_0x6b9362[_0xccda('0x39')]=qs['sort'](_0x3df554[_0xccda('0x31')]['sort']);_0x6b9362[_0xccda('0x3a')]=qs[_0xccda('0x3b')](_[_0xccda('0x3c')](_0x3df554[_0xccda('0x31')],_0x334b50[_0xccda('0x3b')]),_0x2f6853);if(_0x3df554[_0xccda('0x31')][_0xccda('0x3d')]){_0x6b9362[_0xccda('0x3a')]=_[_0xccda('0x3e')](_0x6b9362[_0xccda('0x3a')],{'$or':_[_0xccda('0x2c')](_0x2f6853,function(_0x5ce4dc){if(_0x5ce4dc['type']!==_0xccda('0x3f')){var _0x582186={};_0x582186[_0x5ce4dc[_0xccda('0x2a')]]={'$like':'%'+_0x3df554['query'][_0xccda('0x3d')]+'%'};return _0x582186;}})});}_0x6b9362=_[_0xccda('0x3e')]({},_0x6b9362,_0x3df554[_0xccda('0x40')]);var _0x159c6e={'where':_0x6b9362[_0xccda('0x3a')]};return db[_0xccda('0x2d')]['count'](_0x159c6e)[_0xccda('0x25')](function(_0x2bd76c){_0x7ce8a2[_0xccda('0x20')]=_0x2bd76c;if(_0x3df554['query'][_0xccda('0x41')]){_0x6b9362['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xccda('0x42')](_0x6b9362);})[_0xccda('0x25')](function(_0x1dec78){_0x7ce8a2[_0xccda('0x43')]=_0x1dec78;return _0x7ce8a2;})['then'](respondWithFilteredResult(_0x14e352,_0x6b9362))[_0xccda('0x44')](handleError(_0x14e352,null));};exports[_0xccda('0x45')]=function(_0x40cb91,_0x48df31){var _0x45b033={'raw':![],'where':{'id':_0x40cb91[_0xccda('0x46')]['id']}},_0x152f3f={};_0x152f3f[_0xccda('0x30')]=_['keys'](db[_0xccda('0x2d')]['rawAttributes']);_0x152f3f[_0xccda('0x31')]=_[_0xccda('0x32')](_0x40cb91[_0xccda('0x31')]);_0x152f3f[_0xccda('0x3b')]=_['intersection'](_0x152f3f[_0xccda('0x30')],_0x152f3f['query']);_0x45b033['attributes']=_['intersection'](_0x152f3f['model'],qs['fields'](_0x40cb91[_0xccda('0x31')][_0xccda('0x35')]));_0x45b033['attributes']=_0x45b033['attributes'][_0xccda('0x36')]?_0x45b033['attributes']:_0x152f3f['model'];if(_0x40cb91['query']['includeAll']){_0x45b033[_0xccda('0x47')]=[{'all':!![]}];}_0x45b033=_['merge']({},_0x45b033,_0x40cb91[_0xccda('0x40')]);return db[_0xccda('0x2d')]['find'](_0x45b033)[_0xccda('0x25')](handleEntityNotFound(_0x48df31,null))[_0xccda('0x25')](respondWithResult(_0x48df31,null))[_0xccda('0x44')](handleError(_0x48df31,null));};exports[_0xccda('0x48')]=function(_0x37efb0,_0x3c1578){return db[_0xccda('0x2d')][_0xccda('0x48')](_0x37efb0[_0xccda('0x49')],{})[_0xccda('0x25')](respondWithResult(_0x3c1578,0xc9))[_0xccda('0x44')](handleError(_0x3c1578,null));};exports[_0xccda('0x24')]=function(_0x151188,_0x373a50){if(_0x151188[_0xccda('0x49')]['id']){delete _0x151188[_0xccda('0x49')]['id'];}return db['FreshsalesConfiguration'][_0xccda('0x4a')]({'where':{'id':_0x151188[_0xccda('0x46')]['id']}})['then'](handleEntityNotFound(_0x373a50,null))['then'](saveUpdates(_0x151188[_0xccda('0x49')],null))[_0xccda('0x25')](respondWithResult(_0x373a50,null))[_0xccda('0x44')](handleError(_0x373a50,null));};exports['destroy']=function(_0x4cdd51,_0x200bbf){return db[_0xccda('0x2d')][_0xccda('0x4a')]({'where':{'id':_0x4cdd51['params']['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x200bbf,null))[_0xccda('0x25')](removeEntity(_0x200bbf,null))[_0xccda('0x44')](handleError(_0x200bbf,null));};exports[_0xccda('0x4b')]=function(_0x479d19,_0x358040,_0x22fb02){var _0x535c56={};var _0x10453b={};var _0x5c488c;var _0x3da0b7;return db[_0xccda('0x2d')][_0xccda('0x4c')]({'where':{'id':_0x479d19['params']['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x358040,null))[_0xccda('0x25')](function(_0x1101b8){if(_0x1101b8){_0x5c488c=_0x1101b8;_0x10453b[_0xccda('0x30')]=_[_0xccda('0x32')](db[_0xccda('0x4d')][_0xccda('0x4e')]);_0x10453b['query']=_[_0xccda('0x32')](_0x479d19[_0xccda('0x31')]);_0x10453b[_0xccda('0x3b')]=_[_0xccda('0x33')](_0x10453b[_0xccda('0x30')],_0x10453b[_0xccda('0x31')]);_0x535c56[_0xccda('0x34')]=_[_0xccda('0x33')](_0x10453b[_0xccda('0x30')],qs[_0xccda('0x35')](_0x479d19['query'][_0xccda('0x35')]));_0x535c56[_0xccda('0x34')]=_0x535c56[_0xccda('0x34')][_0xccda('0x36')]?_0x535c56[_0xccda('0x34')]:_0x10453b[_0xccda('0x30')];_0x535c56[_0xccda('0x39')]=qs[_0xccda('0x4f')](_0x479d19[_0xccda('0x31')][_0xccda('0x4f')]);_0x535c56[_0xccda('0x3a')]=qs['filters'](_[_0xccda('0x3c')](_0x479d19[_0xccda('0x31')],_0x10453b[_0xccda('0x3b')]));if(_0x479d19[_0xccda('0x31')]['filter']){_0x535c56[_0xccda('0x3a')]=_[_0xccda('0x3e')](_0x535c56[_0xccda('0x3a')],{'$or':_[_0xccda('0x2c')](_0x535c56[_0xccda('0x34')],function(_0x40fd81){var _0x5bb389={};_0x5bb389[_0x40fd81]={'$like':'%'+_0x479d19[_0xccda('0x31')]['filter']+'%'};return _0x5bb389;})});}_0x535c56=_[_0xccda('0x3e')]({},_0x535c56,_0x479d19[_0xccda('0x40')]);return _0x5c488c[_0xccda('0x4b')](_0x535c56);}})[_0xccda('0x25')](function(_0x223fae){if(_0x223fae){_0x3da0b7=_0x223fae['length'];if(!_0x479d19['query']['hasOwnProperty']('nolimit')){_0x535c56[_0xccda('0x1f')]=qs[_0xccda('0x1f')](_0x479d19['query'][_0xccda('0x1f')]);_0x535c56[_0xccda('0x1d')]=qs[_0xccda('0x1d')](_0x479d19[_0xccda('0x31')][_0xccda('0x1d')]);}return _0x5c488c[_0xccda('0x4b')](_0x535c56);}})[_0xccda('0x25')](function(_0x107a6e){if(_0x107a6e){return _0x107a6e?{'count':_0x3da0b7,'rows':_0x107a6e}:null;}})[_0xccda('0x25')](respondWithResult(_0x358040,null))['catch'](handleError(_0x358040,null));};exports['getDescriptions']=function(_0x10fcfa,_0x56bdf4,_0x1087b0){var _0x1fd569={};var _0x12ff35={};var _0x5549f3;var _0x40c54b;return db[_0xccda('0x2d')][_0xccda('0x4c')]({'where':{'id':_0x10fcfa[_0xccda('0x46')]['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x56bdf4,null))[_0xccda('0x25')](function(_0x269862){if(_0x269862){_0x5549f3=_0x269862;_0x12ff35[_0xccda('0x30')]=_[_0xccda('0x32')](db[_0xccda('0x4d')][_0xccda('0x4e')]);_0x12ff35[_0xccda('0x31')]=_[_0xccda('0x32')](_0x10fcfa[_0xccda('0x31')]);_0x12ff35[_0xccda('0x3b')]=_[_0xccda('0x33')](_0x12ff35['model'],_0x12ff35[_0xccda('0x31')]);_0x1fd569[_0xccda('0x34')]=_[_0xccda('0x33')](_0x12ff35[_0xccda('0x30')],qs['fields'](_0x10fcfa[_0xccda('0x31')]['fields']));_0x1fd569[_0xccda('0x34')]=_0x1fd569[_0xccda('0x34')]['length']?_0x1fd569[_0xccda('0x34')]:_0x12ff35['model'];_0x1fd569[_0xccda('0x39')]=qs[_0xccda('0x4f')](_0x10fcfa['query']['sort']);_0x1fd569[_0xccda('0x3a')]=qs[_0xccda('0x3b')](_[_0xccda('0x3c')](_0x10fcfa[_0xccda('0x31')],_0x12ff35[_0xccda('0x3b')]));if(_0x10fcfa[_0xccda('0x31')]['filter']){_0x1fd569[_0xccda('0x3a')]=_[_0xccda('0x3e')](_0x1fd569[_0xccda('0x3a')],{'$or':_[_0xccda('0x2c')](_0x1fd569[_0xccda('0x34')],function(_0x4b0d87){var _0x9cba61={};_0x9cba61[_0x4b0d87]={'$like':'%'+_0x10fcfa['query'][_0xccda('0x3d')]+'%'};return _0x9cba61;})});}_0x1fd569=_['merge']({},_0x1fd569,_0x10fcfa[_0xccda('0x40')]);return _0x5549f3[_0xccda('0x50')](_0x1fd569);}})[_0xccda('0x25')](function(_0x210b30){if(_0x210b30){_0x40c54b=_0x210b30['length'];if(!_0x10fcfa[_0xccda('0x31')]['hasOwnProperty']('nolimit')){_0x1fd569[_0xccda('0x1f')]=qs[_0xccda('0x1f')](_0x10fcfa['query'][_0xccda('0x1f')]);_0x1fd569[_0xccda('0x1d')]=qs[_0xccda('0x1d')](_0x10fcfa[_0xccda('0x31')]['offset']);}return _0x5549f3['getDescriptions'](_0x1fd569);}})[_0xccda('0x25')](function(_0x5cbb7d){if(_0x5cbb7d){return _0x5cbb7d?{'count':_0x40c54b,'rows':_0x5cbb7d}:null;}})['then'](respondWithResult(_0x56bdf4,null))['catch'](handleError(_0x56bdf4,null));};exports[_0xccda('0x51')]=function(_0x120c21,_0x2d38df,_0x4bfa41){var _0x2b26f3={};var _0x3eb5f8={};var _0x38dd04;var _0x54f46a;return db[_0xccda('0x2d')][_0xccda('0x4c')]({'where':{'id':_0x120c21[_0xccda('0x46')]['id']}})[_0xccda('0x25')](handleEntityNotFound(_0x2d38df,null))[_0xccda('0x25')](function(_0x334e8e){if(_0x334e8e){_0x38dd04=_0x334e8e;_0x3eb5f8['model']=_['keys'](db['FreshsalesField'][_0xccda('0x4e')]);_0x3eb5f8[_0xccda('0x31')]=_[_0xccda('0x32')](_0x120c21[_0xccda('0x31')]);_0x3eb5f8[_0xccda('0x3b')]=_[_0xccda('0x33')](_0x3eb5f8[_0xccda('0x30')],_0x3eb5f8[_0xccda('0x31')]);_0x2b26f3[_0xccda('0x34')]=_[_0xccda('0x33')](_0x3eb5f8[_0xccda('0x30')],qs[_0xccda('0x35')](_0x120c21[_0xccda('0x31')][_0xccda('0x35')]));_0x2b26f3[_0xccda('0x34')]=_0x2b26f3[_0xccda('0x34')]['length']?_0x2b26f3['attributes']:_0x3eb5f8[_0xccda('0x30')];_0x2b26f3[_0xccda('0x39')]=qs[_0xccda('0x4f')](_0x120c21[_0xccda('0x31')][_0xccda('0x4f')]);_0x2b26f3[_0xccda('0x3a')]=qs[_0xccda('0x3b')](_['pick'](_0x120c21[_0xccda('0x31')],_0x3eb5f8[_0xccda('0x3b')]));if(_0x120c21['query'][_0xccda('0x3d')]){_0x2b26f3[_0xccda('0x3a')]=_['merge'](_0x2b26f3[_0xccda('0x3a')],{'$or':_['map'](_0x2b26f3[_0xccda('0x34')],function(_0x3f93c8){var _0x56a0d0={};_0x56a0d0[_0x3f93c8]={'$like':'%'+_0x120c21[_0xccda('0x31')][_0xccda('0x3d')]+'%'};return _0x56a0d0;})});}_0x2b26f3=_[_0xccda('0x3e')]({},_0x2b26f3,_0x120c21[_0xccda('0x40')]);return _0x38dd04[_0xccda('0x51')](_0x2b26f3);}})[_0xccda('0x25')](function(_0x24a329){if(_0x24a329){_0x54f46a=_0x24a329[_0xccda('0x36')];if(!_0x120c21[_0xccda('0x31')][_0xccda('0x37')](_0xccda('0x38'))){_0x2b26f3[_0xccda('0x1f')]=qs['limit'](_0x120c21[_0xccda('0x31')][_0xccda('0x1f')]);_0x2b26f3[_0xccda('0x1d')]=qs['offset'](_0x120c21['query'][_0xccda('0x1d')]);}return _0x38dd04['getFields'](_0x2b26f3);}})['then'](function(_0x1ef5f0){if(_0x1ef5f0){return _0x1ef5f0?{'count':_0x54f46a,'rows':_0x1ef5f0}:null;}})[_0xccda('0x25')](respondWithResult(_0x2d38df,null))[_0xccda('0x44')](handleError(_0x2d38df,null));};
\ No newline at end of file
index 9d26533..2d1979c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd042=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration'];(function(_0x1e1965,_0x55785c){var _0x1a2e96=function(_0x27d366){while(--_0x27d366){_0x1e1965['push'](_0x1e1965['shift']());}};_0x1a2e96(++_0x55785c);}(_0xd042,0x64));var _0x2d04=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd042[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x2d04('0x0'));var util=require(_0x2d04('0x1'));var logger=require(_0x2d04('0x2'))(_0x2d04('0x3'));var moment=require(_0x2d04('0x4'));var BPromise=require(_0x2d04('0x5'));var rp=require(_0x2d04('0x6'));var fs=require('fs');var path=require(_0x2d04('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2d04('0x8'));module['exports']=function(_0x6b6668,_0x24b84d){return _0x6b6668['define'](_0x2d04('0x9'),attributes,{'tableName':_0x2d04('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea1c=['./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash','util','api','moment','request-promise','rimraf'];(function(_0x1a3d7c,_0x4741e2){var _0x146026=function(_0x3c07cb){while(--_0x3c07cb){_0x1a3d7c['push'](_0x1a3d7c['shift']());}};_0x146026(++_0x4741e2);}(_0xea1c,0x150));var _0xcea1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea1c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcea1('0x0'));var util=require(_0xcea1('0x1'));var logger=require('../../config/logger')(_0xcea1('0x2'));var moment=require(_0xcea1('0x3'));var BPromise=require('bluebird');var rp=require(_0xcea1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcea1('0x5'));var config=require('../../config/environment');var attributes=require(_0xcea1('0x6'));module[_0xcea1('0x7')]=function(_0x43a197,_0x52cebc){return _0x43a197['define'](_0xcea1('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7bf4952..7e355e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf81c=['info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xf3ee24,_0x39f8f2){var _0x19a59f=function(_0xed2a80){while(--_0xed2a80){_0xf3ee24['push'](_0xf3ee24['shift']());}};_0x19a59f(++_0x39f8f2);}(_0xf81c,0x1d0));var _0xcf81=function(_0x478689,_0x257f1a){_0x478689=_0x478689-0x0;var _0x9e4bf1=_0xf81c[_0x478689];return _0x9e4bf1;};'use strict';var _=require(_0xcf81('0x0'));var util=require('util');var moment=require(_0xcf81('0x1'));var BPromise=require(_0xcf81('0x2'));var rs=require(_0xcf81('0x3'));var fs=require('fs');var Redis=require(_0xcf81('0x4'));var db=require(_0xcf81('0x5'))['db'];var utils=require(_0xcf81('0x6'));var logger=require(_0xcf81('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcf81('0x8')][_0xcf81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40c547,_0x54513a,_0x4eba38){return new BPromise(function(_0x24dffc,_0x1a09ce){return client[_0xcf81('0xa')](_0x40c547,_0x4eba38)[_0xcf81('0xb')](function(_0x5c90be){logger['info'](_0xcf81('0xc'),_0x54513a,'request\x20sent');logger[_0xcf81('0xd')](_0xcf81('0xe'),_0x54513a,_0xcf81('0xf'),JSON[_0xcf81('0x10')](_0x5c90be));if(_0x5c90be[_0xcf81('0x11')]){if(_0x5c90be[_0xcf81('0x11')][_0xcf81('0x12')]===0x1f4){logger[_0xcf81('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54513a,_0x5c90be['error']['message']);return _0x1a09ce(_0x5c90be[_0xcf81('0x11')][_0xcf81('0x13')]);}logger[_0xcf81('0x11')](_0xcf81('0xc'),_0x54513a,_0x5c90be['error'][_0xcf81('0x13')]);return _0x24dffc(_0x5c90be[_0xcf81('0x11')][_0xcf81('0x13')]);}else{logger[_0xcf81('0x14')](_0xcf81('0xc'),_0x54513a,'request\x20sent');_0x24dffc(_0x5c90be[_0xcf81('0x15')][_0xcf81('0x13')]);}})['catch'](function(_0x45c8e4){logger[_0xcf81('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x54513a,_0x45c8e4);_0x1a09ce(_0x45c8e4);});});}
\ No newline at end of file
+var _0x3afd=['../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x3b5c60,_0x36555d){var _0x5cf06e=function(_0x40a550){while(--_0x40a550){_0x3b5c60['push'](_0x3b5c60['shift']());}};_0x5cf06e(++_0x36555d);}(_0x3afd,0x19c));var _0xd3af=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x3afd[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0xd3af('0x0'));var util=require(_0xd3af('0x1'));var moment=require(_0xd3af('0x2'));var BPromise=require(_0xd3af('0x3'));var rs=require(_0xd3af('0x4'));var fs=require('fs');var Redis=require(_0xd3af('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd3af('0x6'))(_0xd3af('0x7'));var config=require(_0xd3af('0x8'));var jayson=require(_0xd3af('0x9'));var client=jayson[_0xd3af('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58e45d,_0x3dc259,_0x2fb1d5){return new BPromise(function(_0x500ba5,_0x3da5ed){return client[_0xd3af('0xb')](_0x58e45d,_0x2fb1d5)[_0xd3af('0xc')](function(_0x450775){logger[_0xd3af('0xd')](_0xd3af('0xe'),_0x3dc259,_0xd3af('0xf'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3dc259,'request\x20sent',JSON[_0xd3af('0x10')](_0x450775));if(_0x450775['error']){if(_0x450775[_0xd3af('0x11')]['code']===0x1f4){logger[_0xd3af('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0x450775['error'][_0xd3af('0x12')]);return _0x3da5ed(_0x450775[_0xd3af('0x11')][_0xd3af('0x12')]);}logger[_0xd3af('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0x450775['error'][_0xd3af('0x12')]);return _0x500ba5(_0x450775[_0xd3af('0x11')][_0xd3af('0x12')]);}else{logger[_0xd3af('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0xd3af('0xf'));_0x500ba5(_0x450775['result']['message']);}})[_0xd3af('0x13')](function(_0x1ca5f5){logger[_0xd3af('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3dc259,_0x1ca5f5);_0x3da5ed(_0x1ca5f5);});});}
\ No newline at end of file
index d139d08..6709c75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x057a=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x057a,0x1a6));var _0xa057=function(_0x44647c,_0x5c4d1e){_0x44647c=_0x44647c-0x0;var _0x392256=_0x057a[_0x44647c];return _0x392256;};'use strict';var multer=require(_0xa057('0x0'));var util=require(_0xa057('0x1'));var path=require(_0xa057('0x2'));var timeout=require('connect-timeout');var express=require(_0xa057('0x3'));var router=express['Router']();var fs_extra=require(_0xa057('0x4'));var auth=require(_0xa057('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa057('0x6'));var controller=require(_0xa057('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xa057('0x8')]);router[_0xa057('0x9')](_0xa057('0xa'),auth[_0xa057('0xb')](),controller[_0xa057('0xc')]);router[_0xa057('0xd')]('/',auth[_0xa057('0xb')](),controller[_0xa057('0xe')]);router[_0xa057('0xf')](_0xa057('0xa'),auth[_0xa057('0xb')](),controller[_0xa057('0x10')]);router[_0xa057('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa057('0x12')]);module[_0xa057('0x13')]=router;
\ No newline at end of file
+var _0x33a4=['delete','util','connect-timeout','express','Router','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x38fbc2,_0x641aa1){var _0x43c7d4=function(_0x45d3b9){while(--_0x45d3b9){_0x38fbc2['push'](_0x38fbc2['shift']());}};_0x43c7d4(++_0x641aa1);}(_0x33a4,0x88));var _0x433a=function(_0x283719,_0x47b8cb){_0x283719=_0x283719-0x0;var _0x3558d2=_0x33a4[_0x283719];return _0x3558d2;};'use strict';var multer=require('multer');var util=require(_0x433a('0x0'));var path=require('path');var timeout=require(_0x433a('0x1'));var express=require(_0x433a('0x2'));var router=express[_0x433a('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x433a('0x4'));var controller=require(_0x433a('0x5'));router[_0x433a('0x6')]('/',auth[_0x433a('0x7')](),controller[_0x433a('0x8')]);router['get'](_0x433a('0x9'),auth['isAuthenticated'](),controller[_0x433a('0xa')]);router[_0x433a('0xb')]('/',auth[_0x433a('0x7')](),controller[_0x433a('0xc')]);router['put']('/:id',auth[_0x433a('0x7')](),controller[_0x433a('0xd')]);router[_0x433a('0xe')](_0x433a('0x9'),auth[_0x433a('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index d57ec05..91687d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc5=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x8bc5,0x6d));var _0x58bc=function(_0x207f5c,_0x1648c0){_0x207f5c=_0x207f5c-0x0;var _0x5ec16f=_0x8bc5[_0x207f5c];return _0x5ec16f;};'use strict';var Sequelize=require(_0x58bc('0x0'));module[_0x58bc('0x1')]={'type':{'type':Sequelize[_0x58bc('0x2')](_0x58bc('0x3'),_0x58bc('0x4'),_0x58bc('0x5'),'keyValue','picklist'),'defaultValue':_0x58bc('0x3')},'content':{'type':Sequelize[_0x58bc('0x6')]},'key':{'type':Sequelize[_0x58bc('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x58bc('0x3'),_0x58bc('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x58bc('0x6')]},'idField':{'type':Sequelize[_0x58bc('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x58bc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x58bc('0x6')]}};
\ No newline at end of file
+var _0xcf7a=['customVariable','sequelize','exports','ENUM','variable','keyValue','string','STRING'];(function(_0x50ef7a,_0x3db97f){var _0x1ffba2=function(_0x235eb0){while(--_0x235eb0){_0x50ef7a['push'](_0x50ef7a['shift']());}};_0x1ffba2(++_0x3db97f);}(_0xcf7a,0x91));var _0xacf7=function(_0x581d11,_0x30fce6){_0x581d11=_0x581d11-0x0;var _0x4074b7=_0xcf7a[_0x581d11];return _0x4074b7;};'use strict';var Sequelize=require(_0xacf7('0x0'));module[_0xacf7('0x1')]={'type':{'type':Sequelize[_0xacf7('0x2')]('string',_0xacf7('0x3'),'customVariable',_0xacf7('0x4'),'picklist'),'defaultValue':_0xacf7('0x5')},'content':{'type':Sequelize[_0xacf7('0x6')]},'key':{'type':Sequelize[_0xacf7('0x6')]},'keyType':{'type':Sequelize[_0xacf7('0x2')](_0xacf7('0x5'),_0xacf7('0x3'),_0xacf7('0x7'))},'keyContent':{'type':Sequelize[_0xacf7('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xacf7('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xacf7('0x6')]}};
\ No newline at end of file
index 1ede1b7..89c1370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb91a=['undefined','limit','count','set','json','apply','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','FreshsalesField','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x67be45,_0xc7ed38){var _0x5a74a9=function(_0x3e53ba){while(--_0x3e53ba){_0x67be45['push'](_0x67be45['shift']());}};_0x5a74a9(++_0xc7ed38);}(_0xb91a,0x1ef));var _0xab91=function(_0x4c6383,_0x43a72e){_0x4c6383=_0x4c6383-0x0;var _0x34c769=_0xb91a[_0x4c6383];return _0x34c769;};'use strict';var emlformat=require(_0xab91('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab91('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab91('0x2'));var moment=require(_0xab91('0x3'));var BPromise=require(_0xab91('0x4'));var Mustache=require(_0xab91('0x5'));var util=require(_0xab91('0x6'));var path=require(_0xab91('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab91('0x8'));var fs=require('fs');var fs_extra=require(_0xab91('0x9'));var _=require(_0xab91('0xa'));var squel=require(_0xab91('0xb'));var crypto=require(_0xab91('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xab91('0xd'));var toCsv=require(_0xab91('0xe'));var querystring=require(_0xab91('0xf'));var Papa=require(_0xab91('0x10'));var Redis=require(_0xab91('0x11'));var authService=require(_0xab91('0x12'));var qs=require(_0xab91('0x13'));var as=require(_0xab91('0x14'));var hardwareService=require(_0xab91('0x15'));var logger=require(_0xab91('0x16'))(_0xab91('0x17'));var utils=require(_0xab91('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xab91('0x19'));var db=require(_0xab91('0x1a'))['db'];function respondWithStatusCode(_0x36a7b3,_0x250548){_0x250548=_0x250548||0xcc;return function(_0x369c99){if(_0x369c99){return _0x36a7b3[_0xab91('0x1b')](_0x250548);}return _0x36a7b3[_0xab91('0x1c')](_0x250548)['end']();};}function respondWithResult(_0x114da5,_0x5b8b2f){_0x5b8b2f=_0x5b8b2f||0xc8;return function(_0x37f2f2){if(_0x37f2f2){return _0x114da5[_0xab91('0x1c')](_0x5b8b2f)['json'](_0x37f2f2);}};}function respondWithFilteredResult(_0x3aebed,_0x348610){return function(_0x550776){if(_0x550776){var _0x189685=typeof _0x348610[_0xab91('0x1d')]===_0xab91('0x1e')&&typeof _0x348610[_0xab91('0x1f')]===_0xab91('0x1e');var _0x55976a=_0x550776[_0xab91('0x20')];var _0x5e180b=_0x189685?0x0:_0x348610[_0xab91('0x1d')];var _0x44fae7=_0x189685?_0x550776['count']:_0x348610[_0xab91('0x1d')]+_0x348610[_0xab91('0x1f')];var _0x67738a;if(_0x44fae7>=_0x55976a){_0x44fae7=_0x55976a;_0x67738a=0xc8;}else{_0x67738a=0xce;}_0x3aebed[_0xab91('0x1c')](_0x67738a);return _0x3aebed[_0xab91('0x21')]('Content-Range',_0x5e180b+'-'+_0x44fae7+'/'+_0x55976a)[_0xab91('0x22')](_0x550776);}return null;};}function patchUpdates(_0x2b4176){return function(_0x5d5c40){try{jsonpatch[_0xab91('0x23')](_0x5d5c40,_0x2b4176,!![]);}catch(_0x13025f){return BPromise['reject'](_0x13025f);}return _0x5d5c40['save']();};}function saveUpdates(_0xb1bd94,_0x252bdd){return function(_0x497e9f){if(_0x497e9f){return _0x497e9f[_0xab91('0x24')](_0xb1bd94)[_0xab91('0x25')](function(_0x45ab99){return _0x45ab99;});}return null;};}function removeEntity(_0x554289,_0x48fce8){return function(_0x1548c1){if(_0x1548c1){return _0x1548c1[_0xab91('0x26')]()[_0xab91('0x25')](function(){_0x554289['status'](0xcc)[_0xab91('0x27')]();});}};}function handleEntityNotFound(_0x5d825a,_0x401e45){return function(_0x40be5d){if(!_0x40be5d){_0x5d825a['sendStatus'](0x194);}return _0x40be5d;};}function handleError(_0x5f0e93,_0x14db9a){_0x14db9a=_0x14db9a||0x1f4;return function(_0x343587){logger['error'](_0x343587[_0xab91('0x28')]);if(_0x343587[_0xab91('0x29')]){delete _0x343587['name'];}_0x5f0e93['status'](_0x14db9a)[_0xab91('0x2a')](_0x343587);};}exports[_0xab91('0x2b')]=function(_0x33110e,_0x56cf3c){var _0x47a96c={},_0x2f0145={},_0x4f3200={'count':0x0,'rows':[]};var _0x4923d9=_[_0xab91('0x2c')](db['FreshsalesField'][_0xab91('0x2d')],function(_0x4fdc6b){return{'name':_0x4fdc6b[_0xab91('0x2e')],'type':_0x4fdc6b[_0xab91('0x2f')]['key']};});_0x2f0145[_0xab91('0x30')]=_[_0xab91('0x2c')](_0x4923d9,'name');_0x2f0145[_0xab91('0x31')]=_['keys'](_0x33110e['query']);_0x2f0145['filters']=_['intersection'](_0x2f0145[_0xab91('0x30')],_0x2f0145[_0xab91('0x31')]);_0x47a96c['attributes']=_[_0xab91('0x32')](_0x2f0145['model'],qs[_0xab91('0x33')](_0x33110e[_0xab91('0x31')][_0xab91('0x33')]));_0x47a96c[_0xab91('0x34')]=_0x47a96c[_0xab91('0x34')][_0xab91('0x35')]?_0x47a96c[_0xab91('0x34')]:_0x2f0145['model'];if(!_0x33110e[_0xab91('0x31')][_0xab91('0x36')](_0xab91('0x37'))){_0x47a96c[_0xab91('0x1f')]=qs[_0xab91('0x1f')](_0x33110e[_0xab91('0x31')][_0xab91('0x1f')]);_0x47a96c[_0xab91('0x1d')]=qs[_0xab91('0x1d')](_0x33110e['query'][_0xab91('0x1d')]);}_0x47a96c[_0xab91('0x38')]=qs[_0xab91('0x39')](_0x33110e[_0xab91('0x31')][_0xab91('0x39')]);_0x47a96c[_0xab91('0x3a')]=qs[_0xab91('0x3b')](_['pick'](_0x33110e[_0xab91('0x31')],_0x2f0145['filters']),_0x4923d9);if(_0x33110e['query'][_0xab91('0x3c')]){_0x47a96c[_0xab91('0x3a')]=_[_0xab91('0x3d')](_0x47a96c['where'],{'$or':_[_0xab91('0x2c')](_0x4923d9,function(_0x34ccfb){if(_0x34ccfb[_0xab91('0x2f')]!=='VIRTUAL'){var _0xaf30ee={};_0xaf30ee[_0x34ccfb[_0xab91('0x29')]]={'$like':'%'+_0x33110e['query'][_0xab91('0x3c')]+'%'};return _0xaf30ee;}})});}_0x47a96c=_[_0xab91('0x3d')]({},_0x47a96c,_0x33110e[_0xab91('0x3e')]);var _0x2f3138={'where':_0x47a96c[_0xab91('0x3a')]};return db[_0xab91('0x3f')][_0xab91('0x20')](_0x2f3138)['then'](function(_0x1303f8){_0x4f3200[_0xab91('0x20')]=_0x1303f8;if(_0x33110e['query'][_0xab91('0x40')]){_0x47a96c[_0xab91('0x41')]=[{'all':!![]}];}return db[_0xab91('0x3f')][_0xab91('0x42')](_0x47a96c);})[_0xab91('0x25')](function(_0x132735){_0x4f3200[_0xab91('0x43')]=_0x132735;return _0x4f3200;})['then'](respondWithFilteredResult(_0x56cf3c,_0x47a96c))[_0xab91('0x44')](handleError(_0x56cf3c,null));};exports[_0xab91('0x45')]=function(_0x34a1ce,_0x342093){var _0x32cc40={'raw':!![],'where':{'id':_0x34a1ce[_0xab91('0x46')]['id']}},_0x2d0ab0={};_0x2d0ab0[_0xab91('0x30')]=_[_0xab91('0x47')](db['FreshsalesField'][_0xab91('0x2d')]);_0x2d0ab0[_0xab91('0x31')]=_[_0xab91('0x47')](_0x34a1ce[_0xab91('0x31')]);_0x2d0ab0['filters']=_[_0xab91('0x32')](_0x2d0ab0['model'],_0x2d0ab0['query']);_0x32cc40[_0xab91('0x34')]=_[_0xab91('0x32')](_0x2d0ab0[_0xab91('0x30')],qs['fields'](_0x34a1ce[_0xab91('0x31')]['fields']));_0x32cc40['attributes']=_0x32cc40[_0xab91('0x34')][_0xab91('0x35')]?_0x32cc40[_0xab91('0x34')]:_0x2d0ab0['model'];if(_0x34a1ce[_0xab91('0x31')][_0xab91('0x40')]){_0x32cc40[_0xab91('0x41')]=[{'all':!![]}];}_0x32cc40=_['merge']({},_0x32cc40,_0x34a1ce[_0xab91('0x3e')]);return db[_0xab91('0x3f')]['find'](_0x32cc40)[_0xab91('0x25')](handleEntityNotFound(_0x342093,null))[_0xab91('0x25')](respondWithResult(_0x342093,null))['catch'](handleError(_0x342093,null));};exports[_0xab91('0x48')]=function(_0x1a8aeb,_0x4ca74e){return db['FreshsalesField'][_0xab91('0x48')](_0x1a8aeb[_0xab91('0x49')],{})['then'](respondWithResult(_0x4ca74e,0xc9))['catch'](handleError(_0x4ca74e,null));};exports['update']=function(_0x430374,_0x5aebdc){if(_0x430374['body']['id']){delete _0x430374[_0xab91('0x49')]['id'];}return db[_0xab91('0x3f')][_0xab91('0x4a')]({'where':{'id':_0x430374[_0xab91('0x46')]['id']}})[_0xab91('0x25')](handleEntityNotFound(_0x5aebdc,null))[_0xab91('0x25')](saveUpdates(_0x430374[_0xab91('0x49')],null))[_0xab91('0x25')](respondWithResult(_0x5aebdc,null))['catch'](handleError(_0x5aebdc,null));};exports[_0xab91('0x26')]=function(_0x53fb6e,_0x40aacf){return db['FreshsalesField'][_0xab91('0x4a')]({'where':{'id':_0x53fb6e[_0xab91('0x46')]['id']}})['then'](handleEntityNotFound(_0x40aacf,null))[_0xab91('0x25')](removeEntity(_0x40aacf,null))[_0xab91('0x44')](handleError(_0x40aacf,null));};
\ No newline at end of file
+var _0x724b=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesField','rows','then','catch','show','fields','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv'];(function(_0x2f4ad7,_0x3c86a7){var _0x239fbb=function(_0x2cca5e){while(--_0x2cca5e){_0x2f4ad7['push'](_0x2f4ad7['shift']());}};_0x239fbb(++_0x3c86a7);}(_0x724b,0x7f));var _0xb724=function(_0x3f94f6,_0x470973){_0x3f94f6=_0x3f94f6-0x0;var _0x1c85c8=_0x724b[_0x3f94f6];return _0x1c85c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb724('0x0'));var zipdir=require(_0xb724('0x1'));var jsonpatch=require(_0xb724('0x2'));var rp=require(_0xb724('0x3'));var moment=require(_0xb724('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb724('0x5'));var util=require(_0xb724('0x6'));var path=require('path');var sox=require(_0xb724('0x7'));var csv=require('to-csv');var ejs=require(_0xb724('0x8'));var fs=require('fs');var fs_extra=require(_0xb724('0x9'));var _=require(_0xb724('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb724('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb724('0xc'));var querystring=require('querystring');var Papa=require(_0xb724('0xd'));var Redis=require(_0xb724('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb724('0xf'));var as=require(_0xb724('0x10'));var hardwareService=require(_0xb724('0x11'));var logger=require(_0xb724('0x12'))('api');var utils=require(_0xb724('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb724('0x14'))['db'];function respondWithStatusCode(_0x7be2ee,_0x579223){_0x579223=_0x579223||0xcc;return function(_0x82c74c){if(_0x82c74c){return _0x7be2ee[_0xb724('0x15')](_0x579223);}return _0x7be2ee[_0xb724('0x16')](_0x579223)[_0xb724('0x17')]();};}function respondWithResult(_0x176995,_0x54b929){_0x54b929=_0x54b929||0xc8;return function(_0x4d3bba){if(_0x4d3bba){return _0x176995[_0xb724('0x16')](_0x54b929)['json'](_0x4d3bba);}};}function respondWithFilteredResult(_0x5bb632,_0x4d1505){return function(_0x1f5614){if(_0x1f5614){var _0x276039=typeof _0x4d1505[_0xb724('0x18')]===_0xb724('0x19')&&typeof _0x4d1505[_0xb724('0x1a')]==='undefined';var _0x3e3d0c=_0x1f5614[_0xb724('0x1b')];var _0x1588e9=_0x276039?0x0:_0x4d1505['offset'];var _0x318758=_0x276039?_0x1f5614[_0xb724('0x1b')]:_0x4d1505[_0xb724('0x18')]+_0x4d1505[_0xb724('0x1a')];var _0x19d02d;if(_0x318758>=_0x3e3d0c){_0x318758=_0x3e3d0c;_0x19d02d=0xc8;}else{_0x19d02d=0xce;}_0x5bb632[_0xb724('0x16')](_0x19d02d);return _0x5bb632['set']('Content-Range',_0x1588e9+'-'+_0x318758+'/'+_0x3e3d0c)[_0xb724('0x1c')](_0x1f5614);}return null;};}function patchUpdates(_0x1347a4){return function(_0x4ede85){try{jsonpatch[_0xb724('0x1d')](_0x4ede85,_0x1347a4,!![]);}catch(_0x57650e){return BPromise[_0xb724('0x1e')](_0x57650e);}return _0x4ede85[_0xb724('0x1f')]();};}function saveUpdates(_0xcb7f16,_0x1c81d5){return function(_0x2b0952){if(_0x2b0952){return _0x2b0952[_0xb724('0x20')](_0xcb7f16)['then'](function(_0x2ed041){return _0x2ed041;});}return null;};}function removeEntity(_0x2e0c74,_0x586724){return function(_0x1af3ba){if(_0x1af3ba){return _0x1af3ba[_0xb724('0x21')]()['then'](function(){_0x2e0c74['status'](0xcc)[_0xb724('0x17')]();});}};}function handleEntityNotFound(_0x8aac69,_0x8f97a5){return function(_0x3c7819){if(!_0x3c7819){_0x8aac69[_0xb724('0x15')](0x194);}return _0x3c7819;};}function handleError(_0x184c14,_0x17fb1c){_0x17fb1c=_0x17fb1c||0x1f4;return function(_0x268aed){logger[_0xb724('0x22')](_0x268aed[_0xb724('0x23')]);if(_0x268aed[_0xb724('0x24')]){delete _0x268aed['name'];}_0x184c14['status'](_0x17fb1c)[_0xb724('0x25')](_0x268aed);};}exports['index']=function(_0x17f513,_0x4a772b){var _0x215af9={},_0x1f9197={},_0xdebfdd={'count':0x0,'rows':[]};var _0x2d8eb0=_[_0xb724('0x26')](db['FreshsalesField'][_0xb724('0x27')],function(_0x573637){return{'name':_0x573637[_0xb724('0x28')],'type':_0x573637[_0xb724('0x29')]['key']};});_0x1f9197['model']=_['map'](_0x2d8eb0,_0xb724('0x24'));_0x1f9197[_0xb724('0x2a')]=_[_0xb724('0x2b')](_0x17f513[_0xb724('0x2a')]);_0x1f9197[_0xb724('0x2c')]=_['intersection'](_0x1f9197[_0xb724('0x2d')],_0x1f9197['query']);_0x215af9['attributes']=_[_0xb724('0x2e')](_0x1f9197[_0xb724('0x2d')],qs['fields'](_0x17f513[_0xb724('0x2a')]['fields']));_0x215af9[_0xb724('0x2f')]=_0x215af9[_0xb724('0x2f')][_0xb724('0x30')]?_0x215af9[_0xb724('0x2f')]:_0x1f9197[_0xb724('0x2d')];if(!_0x17f513[_0xb724('0x2a')]['hasOwnProperty'](_0xb724('0x31'))){_0x215af9[_0xb724('0x1a')]=qs['limit'](_0x17f513[_0xb724('0x2a')]['limit']);_0x215af9[_0xb724('0x18')]=qs['offset'](_0x17f513[_0xb724('0x2a')]['offset']);}_0x215af9[_0xb724('0x32')]=qs[_0xb724('0x33')](_0x17f513[_0xb724('0x2a')]['sort']);_0x215af9[_0xb724('0x34')]=qs[_0xb724('0x2c')](_[_0xb724('0x35')](_0x17f513['query'],_0x1f9197['filters']),_0x2d8eb0);if(_0x17f513[_0xb724('0x2a')][_0xb724('0x36')]){_0x215af9[_0xb724('0x34')]=_[_0xb724('0x37')](_0x215af9[_0xb724('0x34')],{'$or':_[_0xb724('0x26')](_0x2d8eb0,function(_0x54d00c){if(_0x54d00c[_0xb724('0x29')]!==_0xb724('0x38')){var _0x369812={};_0x369812[_0x54d00c[_0xb724('0x24')]]={'$like':'%'+_0x17f513[_0xb724('0x2a')]['filter']+'%'};return _0x369812;}})});}_0x215af9=_['merge']({},_0x215af9,_0x17f513[_0xb724('0x39')]);var _0xfcd0ff={'where':_0x215af9[_0xb724('0x34')]};return db['FreshsalesField'][_0xb724('0x1b')](_0xfcd0ff)['then'](function(_0x11395e){_0xdebfdd['count']=_0x11395e;if(_0x17f513['query'][_0xb724('0x3a')]){_0x215af9[_0xb724('0x3b')]=[{'all':!![]}];}return db[_0xb724('0x3c')]['findAll'](_0x215af9);})['then'](function(_0x17faf1){_0xdebfdd[_0xb724('0x3d')]=_0x17faf1;return _0xdebfdd;})[_0xb724('0x3e')](respondWithFilteredResult(_0x4a772b,_0x215af9))[_0xb724('0x3f')](handleError(_0x4a772b,null));};exports[_0xb724('0x40')]=function(_0x57eef8,_0x5444d6){var _0x4c9d75={'raw':!![],'where':{'id':_0x57eef8['params']['id']}},_0x4475e1={};_0x4475e1[_0xb724('0x2d')]=_[_0xb724('0x2b')](db[_0xb724('0x3c')][_0xb724('0x27')]);_0x4475e1['query']=_[_0xb724('0x2b')](_0x57eef8[_0xb724('0x2a')]);_0x4475e1['filters']=_[_0xb724('0x2e')](_0x4475e1['model'],_0x4475e1[_0xb724('0x2a')]);_0x4c9d75[_0xb724('0x2f')]=_['intersection'](_0x4475e1[_0xb724('0x2d')],qs['fields'](_0x57eef8[_0xb724('0x2a')][_0xb724('0x41')]));_0x4c9d75['attributes']=_0x4c9d75[_0xb724('0x2f')][_0xb724('0x30')]?_0x4c9d75['attributes']:_0x4475e1[_0xb724('0x2d')];if(_0x57eef8['query'][_0xb724('0x3a')]){_0x4c9d75[_0xb724('0x3b')]=[{'all':!![]}];}_0x4c9d75=_[_0xb724('0x37')]({},_0x4c9d75,_0x57eef8[_0xb724('0x39')]);return db[_0xb724('0x3c')][_0xb724('0x42')](_0x4c9d75)[_0xb724('0x3e')](handleEntityNotFound(_0x5444d6,null))[_0xb724('0x3e')](respondWithResult(_0x5444d6,null))[_0xb724('0x3f')](handleError(_0x5444d6,null));};exports[_0xb724('0x43')]=function(_0x21ce9b,_0x150f7f){return db[_0xb724('0x3c')][_0xb724('0x43')](_0x21ce9b[_0xb724('0x44')],{})[_0xb724('0x3e')](respondWithResult(_0x150f7f,0xc9))[_0xb724('0x3f')](handleError(_0x150f7f,null));};exports[_0xb724('0x20')]=function(_0x191b0a,_0x2d46b9){if(_0x191b0a[_0xb724('0x44')]['id']){delete _0x191b0a[_0xb724('0x44')]['id'];}return db[_0xb724('0x3c')][_0xb724('0x42')]({'where':{'id':_0x191b0a[_0xb724('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d46b9,null))[_0xb724('0x3e')](saveUpdates(_0x191b0a['body'],null))['then'](respondWithResult(_0x2d46b9,null))[_0xb724('0x3f')](handleError(_0x2d46b9,null));};exports[_0xb724('0x21')]=function(_0x566fa1,_0x1ce079){return db[_0xb724('0x3c')][_0xb724('0x42')]({'where':{'id':_0x566fa1[_0xb724('0x45')]['id']}})['then'](handleEntityNotFound(_0x1ce079,null))[_0xb724('0x3e')](removeEntity(_0x1ce079,null))[_0xb724('0x3f')](handleError(_0x1ce079,null));};
\ No newline at end of file
index c1a95b8..29a9d6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde9f=['FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','api','moment','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xde9f,0x118));var _0xfde9=function(_0x263b0e,_0xc6479f){_0x263b0e=_0x263b0e-0x0;var _0x113fee=_0xde9f[_0x263b0e];return _0x113fee;};'use strict';var _=require(_0xfde9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfde9('0x1'));var moment=require(_0xfde9('0x2'));var BPromise=require('bluebird');var rp=require(_0xfde9('0x3'));var fs=require('fs');var path=require(_0xfde9('0x4'));var rimraf=require('rimraf');var config=require(_0xfde9('0x5'));var attributes=require(_0xfde9('0x6'));module[_0xfde9('0x7')]=function(_0xe30eaf,_0x5e69c0){return _0xe30eaf['define'](_0xfde9('0x8'),attributes,{'tableName':_0xfde9('0x9'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xfde9('0xa'),_0xfde9('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1280=['FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports'];(function(_0x1cd9a9,_0x226b55){var _0x15795d=function(_0x238793){while(--_0x238793){_0x1cd9a9['push'](_0x1cd9a9['shift']());}};_0x15795d(++_0x226b55);}(_0x1280,0xac));var _0x0128=function(_0x502036,_0x502686){_0x502036=_0x502036-0x0;var _0x485247=_0x1280[_0x502036];return _0x485247;};'use strict';var _=require(_0x0128('0x0'));var util=require('util');var logger=require(_0x0128('0x1'))(_0x0128('0x2'));var moment=require(_0x0128('0x3'));var BPromise=require(_0x0128('0x4'));var rp=require(_0x0128('0x5'));var fs=require('fs');var path=require(_0x0128('0x6'));var rimraf=require('rimraf');var config=require(_0x0128('0x7'));var attributes=require(_0x0128('0x8'));module[_0x0128('0x9')]=function(_0x2631a2,_0x4aa391){return _0x2631a2['define'](_0x0128('0xa'),attributes,{'tableName':_0x0128('0xb'),'paranoid':![],'indexes':[{'name':_0x0128('0xc'),'fields':[_0x0128('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7a18208..336290a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb2=['request','then','info','request\x20sent','error','FreshsalesField,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x4fe4f6,_0x57efde){var _0x5e71fb=function(_0x3404d8){while(--_0x3404d8){_0x4fe4f6['push'](_0x4fe4f6['shift']());}};_0x5e71fb(++_0x57efde);}(_0x2eb2,0x19f));var _0x22eb=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x2eb2[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});}
\ No newline at end of file
+var _0xf61e=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x587a4d,_0x181931){var _0x10d22b=function(_0xcbaf5e){while(--_0xcbaf5e){_0x587a4d['push'](_0x587a4d['shift']());}};_0x10d22b(++_0x181931);}(_0xf61e,0x191));var _0xef61=function(_0x4f7ae1,_0x19c166){_0x4f7ae1=_0x4f7ae1-0x0;var _0x973cc5=_0xf61e[_0x4f7ae1];return _0x973cc5;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}
\ No newline at end of file
index d07403c..22a074d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x5cf338,_0x3dcccc){var _0x7a16c7=function(_0x5bb2d2){while(--_0x5bb2d2){_0x5cf338['push'](_0x5cf338['shift']());}};_0x7a16c7(++_0x3dcccc);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x37f61a,_0x36a617){var _0x4cee77=function(_0x4bfcdb){while(--_0x4bfcdb){_0x37f61a['push'](_0x37f61a['shift']());}};_0x4cee77(++_0x36a617);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 05f350e..26fd72a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa32b=['STRING','username','ENUM','integrationTab','sequelize'];(function(_0x4a2b33,_0x208982){var _0x2e966f=function(_0x30e429){while(--_0x30e429){_0x4a2b33['push'](_0x4a2b33['shift']());}};_0x2e966f(++_0x208982);}(_0xa32b,0x68));var _0xba32=function(_0x151d64,_0x360f73){_0x151d64=_0x151d64-0x0;var _0x409cfd=_0xa32b[_0x151d64];return _0x409cfd;};'use strict';var Sequelize=require(_0xba32('0x0'));module['exports']={'name':{'type':Sequelize[_0xba32('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xba32('0x2')},'remoteUri':{'type':Sequelize[_0xba32('0x1')]},'password':{'type':Sequelize[_0xba32('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xba32('0x1')]},'securityToken':{'type':Sequelize[_0xba32('0x1')]},'serverUrl':{'type':Sequelize[_0xba32('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xba32('0x3')](_0xba32('0x4'),'newTab'),'defaultValue':_0xba32('0x4')}};
\ No newline at end of file
+var _0x46cb=['sequelize','exports','STRING','username','ENUM','newTab'];(function(_0x3c5334,_0x9ae4f5){var _0x2dcad7=function(_0x25f67d){while(--_0x25f67d){_0x3c5334['push'](_0x3c5334['shift']());}};_0x2dcad7(++_0x9ae4f5);}(_0x46cb,0x84));var _0xb46c=function(_0x1be994,_0x267018){_0x1be994=_0x1be994-0x0;var _0x365952=_0x46cb[_0x1be994];return _0x365952;};'use strict';var Sequelize=require(_0xb46c('0x0'));module[_0xb46c('0x1')]={'name':{'type':Sequelize[_0xb46c('0x2')]},'description':{'type':Sequelize[_0xb46c('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb46c('0x3')},'remoteUri':{'type':Sequelize[_0xb46c('0x2')]},'password':{'type':Sequelize[_0xb46c('0x2')]},'clientId':{'type':Sequelize[_0xb46c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xb46c('0x2')]},'serverUrl':{'type':Sequelize[_0xb46c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb46c('0x4')]('integrationTab',_0xb46c('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 8008617..9005494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d26=['phone','remove','includes','picklistValues','label','boolean','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send','map','SalesforceAccount','rawAttributes','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','create','body','find','getConfigurations','findOne','SalesforceConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','Connection','login','password','concat','isNil','sobject','describe','ActivityDate','Subject','Description','string','int','picklist','email'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x9d26,0xf7));var _0x69d2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9d26[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x69d2('0x0'));var rimraf=require(_0x69d2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69d2('0x2'));var rp=require(_0x69d2('0x3'));var moment=require(_0x69d2('0x4'));var BPromise=require(_0x69d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x69d2('0x6'));var sox=require(_0x69d2('0x7'));var csv=require(_0x69d2('0x8'));var ejs=require(_0x69d2('0x9'));var fs=require('fs');var fs_extra=require(_0x69d2('0xa'));var _=require(_0x69d2('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x69d2('0xc'));var toCsv=require(_0x69d2('0x8'));var querystring=require(_0x69d2('0xd'));var Papa=require(_0x69d2('0xe'));var Redis=require('ioredis');var authService=require(_0x69d2('0xf'));var qs=require(_0x69d2('0x10'));var as=require(_0x69d2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69d2('0x12'))(_0x69d2('0x13'));var utils=require(_0x69d2('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x69d2('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x69d2('0x16'));function respondWithStatusCode(_0x272035,_0x238676){_0x238676=_0x238676||0xcc;return function(_0x2f9350){if(_0x2f9350){return _0x272035[_0x69d2('0x17')](_0x238676);}return _0x272035[_0x69d2('0x18')](_0x238676)[_0x69d2('0x19')]();};}function respondWithResult(_0xcc5dbd,_0x1cff97){_0x1cff97=_0x1cff97||0xc8;return function(_0x1ce94e){if(_0x1ce94e){return _0xcc5dbd['status'](_0x1cff97)[_0x69d2('0x1a')](_0x1ce94e);}};}function respondWithFilteredResult(_0x10f130,_0x2f8657){return function(_0x2913c){if(_0x2913c){var _0x5e88ab=typeof _0x2f8657[_0x69d2('0x1b')]===_0x69d2('0x1c')&&typeof _0x2f8657[_0x69d2('0x1d')]==='undefined';var _0x18db87=_0x2913c['count'];var _0x2f2339=_0x5e88ab?0x0:_0x2f8657[_0x69d2('0x1b')];var _0x4260a4=_0x5e88ab?_0x2913c[_0x69d2('0x1e')]:_0x2f8657['offset']+_0x2f8657[_0x69d2('0x1d')];var _0x273c34;if(_0x4260a4>=_0x18db87){_0x4260a4=_0x18db87;_0x273c34=0xc8;}else{_0x273c34=0xce;}_0x10f130[_0x69d2('0x18')](_0x273c34);return _0x10f130[_0x69d2('0x1f')](_0x69d2('0x20'),_0x2f2339+'-'+_0x4260a4+'/'+_0x18db87)['json'](_0x2913c);}return null;};}function patchUpdates(_0x25727a){return function(_0x154140){try{jsonpatch[_0x69d2('0x21')](_0x154140,_0x25727a,!![]);}catch(_0x57ce2a){return BPromise[_0x69d2('0x22')](_0x57ce2a);}return _0x154140['save']();};}function saveUpdates(_0x6bd29a,_0x2c2aee){return function(_0x2038fa){if(_0x2038fa){return _0x2038fa[_0x69d2('0x23')](_0x6bd29a)[_0x69d2('0x24')](function(_0x3a51b0){return _0x3a51b0;});}return null;};}function removeEntity(_0x4ee32f,_0x52ddd8){return function(_0x3595dc){if(_0x3595dc){return _0x3595dc[_0x69d2('0x25')]()[_0x69d2('0x24')](function(){_0x4ee32f[_0x69d2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11b6f4,_0x27fab7){return function(_0x9c0b0f){if(!_0x9c0b0f){_0x11b6f4[_0x69d2('0x17')](0x194);}return _0x9c0b0f;};}function handleError(_0x4e95c1,_0x3c121c){_0x3c121c=_0x3c121c||0x1f4;return function(_0x2f4781){logger['error'](_0x2f4781['stack']);if(_0x2f4781[_0x69d2('0x26')]){delete _0x2f4781[_0x69d2('0x26')];}_0x4e95c1['status'](_0x3c121c)[_0x69d2('0x27')](_0x2f4781);};}exports['index']=function(_0x1b9b7d,_0x2b4de7){var _0x2d3a56={},_0x5566c9={},_0x5b5ef0={'count':0x0,'rows':[]};var _0x338b15=_[_0x69d2('0x28')](db[_0x69d2('0x29')][_0x69d2('0x2a')],function(_0x503f30){return{'name':_0x503f30['fieldName'],'type':_0x503f30[_0x69d2('0x2b')]['key']};});_0x5566c9['model']=_[_0x69d2('0x28')](_0x338b15,_0x69d2('0x26'));_0x5566c9[_0x69d2('0x2c')]=_[_0x69d2('0x2d')](_0x1b9b7d['query']);_0x5566c9['filters']=_[_0x69d2('0x2e')](_0x5566c9[_0x69d2('0x2f')],_0x5566c9[_0x69d2('0x2c')]);_0x2d3a56[_0x69d2('0x30')]=_[_0x69d2('0x2e')](_0x5566c9[_0x69d2('0x2f')],qs[_0x69d2('0x31')](_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x31')]));_0x2d3a56[_0x69d2('0x30')]=_0x2d3a56[_0x69d2('0x30')][_0x69d2('0x32')]?_0x2d3a56[_0x69d2('0x30')]:_0x5566c9['model'];if(!_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x33')](_0x69d2('0x34'))){_0x2d3a56[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x1d')]);_0x2d3a56[_0x69d2('0x1b')]=qs[_0x69d2('0x1b')](_0x1b9b7d[_0x69d2('0x2c')]['offset']);}_0x2d3a56[_0x69d2('0x35')]=qs[_0x69d2('0x36')](_0x1b9b7d[_0x69d2('0x2c')]['sort']);_0x2d3a56[_0x69d2('0x37')]=qs[_0x69d2('0x38')](_[_0x69d2('0x39')](_0x1b9b7d['query'],_0x5566c9['filters']),_0x338b15);if(_0x1b9b7d['query'][_0x69d2('0x3a')]){_0x2d3a56[_0x69d2('0x37')]=_['merge'](_0x2d3a56[_0x69d2('0x37')],{'$or':_[_0x69d2('0x28')](_0x338b15,function(_0x529c1a){if(_0x529c1a[_0x69d2('0x2b')]!==_0x69d2('0x3b')){var _0x114d0f={};_0x114d0f[_0x529c1a[_0x69d2('0x26')]]={'$like':'%'+_0x1b9b7d[_0x69d2('0x2c')][_0x69d2('0x3a')]+'%'};return _0x114d0f;}})});}_0x2d3a56=_[_0x69d2('0x3c')]({},_0x2d3a56,_0x1b9b7d['options']);var _0x3472b8={'where':_0x2d3a56[_0x69d2('0x37')]};return db[_0x69d2('0x29')]['count'](_0x3472b8)[_0x69d2('0x24')](function(_0x30b80d){_0x5b5ef0[_0x69d2('0x1e')]=_0x30b80d;if(_0x1b9b7d['query'][_0x69d2('0x3d')]){_0x2d3a56[_0x69d2('0x3e')]=[{'all':!![]}];}return db[_0x69d2('0x29')][_0x69d2('0x3f')](_0x2d3a56);})[_0x69d2('0x24')](function(_0x4f6c61){_0x5b5ef0[_0x69d2('0x40')]=_0x4f6c61;return _0x5b5ef0;})[_0x69d2('0x24')](respondWithFilteredResult(_0x2b4de7,_0x2d3a56))[_0x69d2('0x41')](handleError(_0x2b4de7,null));};exports[_0x69d2('0x42')]=function(_0xdfba33,_0x2f624c){var _0x58b634={'raw':![],'where':{'id':_0xdfba33[_0x69d2('0x43')]['id']}},_0x1d23df={};_0x1d23df[_0x69d2('0x2f')]=_['keys'](db['SalesforceAccount']['rawAttributes']);_0x1d23df[_0x69d2('0x2c')]=_[_0x69d2('0x2d')](_0xdfba33[_0x69d2('0x2c')]);_0x1d23df[_0x69d2('0x38')]=_[_0x69d2('0x2e')](_0x1d23df[_0x69d2('0x2f')],_0x1d23df[_0x69d2('0x2c')]);_0x58b634[_0x69d2('0x30')]=_[_0x69d2('0x2e')](_0x1d23df[_0x69d2('0x2f')],qs[_0x69d2('0x31')](_0xdfba33['query']['fields']));_0x58b634[_0x69d2('0x30')]=_0x58b634['attributes'][_0x69d2('0x32')]?_0x58b634[_0x69d2('0x30')]:_0x1d23df[_0x69d2('0x2f')];if(_0xdfba33[_0x69d2('0x2c')]['includeAll']){_0x58b634[_0x69d2('0x3e')]=[{'all':!![]}];}_0x58b634=_[_0x69d2('0x3c')]({},_0x58b634,_0xdfba33['options']);return db['SalesforceAccount']['find'](_0x58b634)[_0x69d2('0x24')](handleEntityNotFound(_0x2f624c,null))[_0x69d2('0x24')](respondWithResult(_0x2f624c,null))[_0x69d2('0x41')](handleError(_0x2f624c,null));};exports[_0x69d2('0x44')]=function(_0x1bfd43,_0xad8d6e){return db['SalesforceAccount'][_0x69d2('0x44')](_0x1bfd43[_0x69d2('0x45')],{})['then'](respondWithResult(_0xad8d6e,0xc9))[_0x69d2('0x41')](handleError(_0xad8d6e,null));};exports[_0x69d2('0x23')]=function(_0x353c44,_0x3dcc68){if(_0x353c44['body']['id']){delete _0x353c44[_0x69d2('0x45')]['id'];}return db[_0x69d2('0x29')][_0x69d2('0x46')]({'where':{'id':_0x353c44['params']['id']}})[_0x69d2('0x24')](handleEntityNotFound(_0x3dcc68,null))[_0x69d2('0x24')](saveUpdates(_0x353c44[_0x69d2('0x45')],null))['then'](respondWithResult(_0x3dcc68,null))[_0x69d2('0x41')](handleError(_0x3dcc68,null));};exports[_0x69d2('0x25')]=function(_0x112041,_0x57109c){return db[_0x69d2('0x29')][_0x69d2('0x46')]({'where':{'id':_0x112041[_0x69d2('0x43')]['id']}})[_0x69d2('0x24')](handleEntityNotFound(_0x57109c,null))['then'](removeEntity(_0x57109c,null))['catch'](handleError(_0x57109c,null));};exports[_0x69d2('0x47')]=function(_0x26e558,_0xb62631,_0x279d3d){var _0x3c72db={};var _0x79a1a5={};var _0x2ec137;var _0x4883a1;return db[_0x69d2('0x29')][_0x69d2('0x48')]({'where':{'id':_0x26e558[_0x69d2('0x43')]['id']}})['then'](handleEntityNotFound(_0xb62631,null))[_0x69d2('0x24')](function(_0x9ec3ea){if(_0x9ec3ea){_0x2ec137=_0x9ec3ea;_0x79a1a5['model']=_[_0x69d2('0x2d')](db[_0x69d2('0x49')][_0x69d2('0x2a')]);_0x79a1a5[_0x69d2('0x2c')]=_[_0x69d2('0x2d')](_0x26e558[_0x69d2('0x2c')]);_0x79a1a5[_0x69d2('0x38')]=_['intersection'](_0x79a1a5[_0x69d2('0x2f')],_0x79a1a5[_0x69d2('0x2c')]);_0x3c72db[_0x69d2('0x30')]=_['intersection'](_0x79a1a5[_0x69d2('0x2f')],qs[_0x69d2('0x31')](_0x26e558[_0x69d2('0x2c')][_0x69d2('0x31')]));_0x3c72db['attributes']=_0x3c72db[_0x69d2('0x30')]['length']?_0x3c72db[_0x69d2('0x30')]:_0x79a1a5['model'];_0x3c72db[_0x69d2('0x35')]=qs[_0x69d2('0x36')](_0x26e558[_0x69d2('0x2c')][_0x69d2('0x36')]);_0x3c72db[_0x69d2('0x37')]=qs[_0x69d2('0x38')](_[_0x69d2('0x39')](_0x26e558[_0x69d2('0x2c')],_0x79a1a5[_0x69d2('0x38')]));if(_0x26e558[_0x69d2('0x2c')][_0x69d2('0x3a')]){_0x3c72db[_0x69d2('0x37')]=_[_0x69d2('0x3c')](_0x3c72db['where'],{'$or':_[_0x69d2('0x28')](_0x3c72db[_0x69d2('0x30')],function(_0x5d0698){var _0x5477be={};_0x5477be[_0x5d0698]={'$like':'%'+_0x26e558[_0x69d2('0x2c')][_0x69d2('0x3a')]+'%'};return _0x5477be;})});}_0x3c72db=_[_0x69d2('0x3c')]({},_0x3c72db,_0x26e558['options']);return _0x2ec137[_0x69d2('0x47')](_0x3c72db);}})['then'](function(_0x41da15){if(_0x41da15){_0x4883a1=_0x41da15[_0x69d2('0x32')];if(!_0x26e558[_0x69d2('0x2c')][_0x69d2('0x33')](_0x69d2('0x34'))){_0x3c72db[_0x69d2('0x1d')]=qs[_0x69d2('0x1d')](_0x26e558['query'][_0x69d2('0x1d')]);_0x3c72db[_0x69d2('0x1b')]=qs['offset'](_0x26e558[_0x69d2('0x2c')][_0x69d2('0x1b')]);}return _0x2ec137[_0x69d2('0x47')](_0x3c72db);}})[_0x69d2('0x24')](function(_0x350376){if(_0x350376){return _0x350376?{'count':_0x4883a1,'rows':_0x350376}:null;}})[_0x69d2('0x24')](respondWithResult(_0xb62631,null))[_0x69d2('0x41')](handleError(_0xb62631,null));};exports['addConfiguration']=function(_0x293240,_0x6391a7,_0x5b3940){if(_0x293240[_0x69d2('0x45')]['id']){delete _0x293240[_0x69d2('0x45')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x293240['params']['id']}})[_0x69d2('0x24')](handleEntityNotFound(_0x6391a7,null))[_0x69d2('0x24')](function(_0x596f5c){if(_0x596f5c){_0x293240[_0x69d2('0x45')][_0x69d2('0x4a')]=_0x596f5c['id'];_0x293240[_0x69d2('0x45')]['Subjects']=integrations[_0x69d2('0x4b')](_0x293240[_0x69d2('0x45')][_0x69d2('0x4c')],_0x293240[_0x69d2('0x45')][_0x69d2('0x2b')]);_0x293240['body'][_0x69d2('0x4d')]=integrations[_0x69d2('0x4e')](_0x293240[_0x69d2('0x45')][_0x69d2('0x4c')],_0x293240[_0x69d2('0x45')][_0x69d2('0x2b')]);return db[_0x69d2('0x49')][_0x69d2('0x44')](_0x293240['body'],{'include':[{'model':db[_0x69d2('0x4f')],'as':_0x69d2('0x50')},{'model':db['SalesforceField'],'as':_0x69d2('0x4d')}]});}return null;})[_0x69d2('0x24')](respondWithResult(_0x6391a7,null))[_0x69d2('0x41')](handleError(_0x6391a7,null));};exports[_0x69d2('0x51')]=function(_0x142287,_0x3d183d,_0x54993c){var _0x50acba;var _0x5d923e='';var _0x1535ed='Task';return db[_0x69d2('0x29')][_0x69d2('0x48')]({'where':{'id':_0x142287[_0x69d2('0x43')]['id']},'attributes':['id',_0x69d2('0x52'),_0x69d2('0x53'),_0x69d2('0x54'),_0x69d2('0x55'),'password',_0x69d2('0x56')]})['then'](handleEntityNotFound(_0x3d183d,null))[_0x69d2('0x24')](function(_0xa82737){if(_0xa82737){_0x5d923e=_0xa82737['remoteUri'];var _0x39c592=_0x5d923e[_0x69d2('0x57')](-0x1);if(_0x39c592==='/'){_0x5d923e=_0x5d923e[_0x69d2('0x58')](0x0,_0x5d923e[_0x69d2('0x59')](_0x39c592));}_0x50acba=new jsforce[(_0x69d2('0x5a'))]({'oauth2':{'loginUrl':_0x5d923e,'clientId':_0xa82737[_0x69d2('0x53')],'clientSecret':_0xa82737['clientSecret']}});return _0x50acba[_0x69d2('0x5b')](_0xa82737[_0x69d2('0x55')],_0xa82737[_0x69d2('0x5c')][_0x69d2('0x5d')](_0xa82737[_0x69d2('0x56')]));}})[_0x69d2('0x24')](function(_0x2d9e9d){if(_0x2d9e9d){if(!_[_0x69d2('0x5e')](_0x142287[_0x69d2('0x2c')]['ticketType'])){_0x1535ed=_0x142287['query']['ticketType'];}return _0x50acba[_0x69d2('0x5f')](_0x1535ed)[_0x69d2('0x60')]();}})[_0x69d2('0x24')](function(_0x33d2b5){var _0x3b9c03=['OwnerId',_0x69d2('0x61'),'IsReminderSet','IsRecurrence',_0x69d2('0x62'),_0x69d2('0x63')];var _0x2916c5=[_0x69d2('0x64'),_0x69d2('0x65'),_0x69d2('0x66'),'boolean',_0x69d2('0x67'),'textarea',_0x69d2('0x68')];if(_0x33d2b5){_[_0x69d2('0x69')](_0x33d2b5[_0x69d2('0x31')],function(_0x54c0df){return _0x3b9c03[_0x69d2('0x6a')](_0x54c0df['name'])||!_0x2916c5[_0x69d2('0x6a')](_0x54c0df['type']);});return{'count':_0x33d2b5[_0x69d2('0x31')][_0x69d2('0x32')],'rows':_['map'](_0x33d2b5[_0x69d2('0x31')],function(_0x4d0153){return{'id':_0x4d0153[_0x69d2('0x26')],'name':_0x4d0153['label'],'custom':_0x4d0153['custom'],'options':_0x4d0153[_0x69d2('0x6b')][_0x69d2('0x32')]>0x0?_['map'](_0x4d0153[_0x69d2('0x6b')],function(_0x44e291){return{'name':_0x44e291[_0x69d2('0x6c')],'value':_0x44e291['value']};}):_0x4d0153[_0x69d2('0x2b')]==_0x69d2('0x6d')?[{'name':_0x69d2('0x6e'),'value':_0x69d2('0x6f')},{'name':'False','value':_0x69d2('0x70')}]:[]};})};}})[_0x69d2('0x24')](respondWithResult(_0x3d183d,null))[_0x69d2('0x41')](function(_0x36bd11){var _0x33a33e=_0x142287['query'][_0x69d2('0x71')]?0x1f4:_0x36bd11[_0x69d2('0x72')]||0x1f4;logger['error'](_0x69d2('0x73'),_0x69d2('0x51'),_0x33a33e,JSON['stringify'](_0x36bd11));delete _0x36bd11[_0x69d2('0x26')];if(_0x33a33e===0x191){_0x33a33e=0x190;}_0x3d183d[_0x69d2('0x18')](_0x33a33e)[_0x69d2('0x27')](_0x142287[_0x69d2('0x2c')]['test']?{'message':_0x69d2('0x74'),'statusCode':_0x36bd11['statusCode']}:_0x36bd11);});};
\ No newline at end of file
+var _0x5204=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','then','stack','name','send','index','map','rawAttributes','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','SalesforceAccount','includeAll','include','findAll','rows','params','find','create','body','catch','destroy','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','IsRecurrence','Subject','Description','int','picklist','email','textarea','remove','includes','label','value','true','false','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4710ae,_0x67ab63){var _0x10c5f8=function(_0x3c04bc){while(--_0x3c04bc){_0x4710ae['push'](_0x4710ae['shift']());}};_0x10c5f8(++_0x67ab63);}(_0x5204,0xd8));var _0x4520=function(_0x1795df,_0xcb261e){_0x1795df=_0x1795df-0x0;var _0x3f13c0=_0x5204[_0x1795df];return _0x3f13c0;};'use strict';var emlformat=require(_0x4520('0x0'));var rimraf=require(_0x4520('0x1'));var zipdir=require(_0x4520('0x2'));var jsonpatch=require(_0x4520('0x3'));var rp=require(_0x4520('0x4'));var moment=require(_0x4520('0x5'));var BPromise=require(_0x4520('0x6'));var Mustache=require(_0x4520('0x7'));var util=require(_0x4520('0x8'));var path=require(_0x4520('0x9'));var sox=require(_0x4520('0xa'));var csv=require(_0x4520('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4520('0xc'));var squel=require(_0x4520('0xd'));var crypto=require(_0x4520('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4520('0xf'));var toCsv=require(_0x4520('0xb'));var querystring=require(_0x4520('0x10'));var Papa=require(_0x4520('0x11'));var Redis=require(_0x4520('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4520('0x13'));var as=require(_0x4520('0x14'));var hardwareService=require(_0x4520('0x15'));var logger=require(_0x4520('0x16'))(_0x4520('0x17'));var utils=require('../../config/utils');var config=require(_0x4520('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4520('0x19'))['db'];var integrations=require(_0x4520('0x1a'));function respondWithStatusCode(_0x249b6f,_0x577c6e){_0x577c6e=_0x577c6e||0xcc;return function(_0x5e34ff){if(_0x5e34ff){return _0x249b6f[_0x4520('0x1b')](_0x577c6e);}return _0x249b6f[_0x4520('0x1c')](_0x577c6e)['end']();};}function respondWithResult(_0x298402,_0x4ac599){_0x4ac599=_0x4ac599||0xc8;return function(_0x5b665d){if(_0x5b665d){return _0x298402[_0x4520('0x1c')](_0x4ac599)['json'](_0x5b665d);}};}function respondWithFilteredResult(_0xe6758c,_0x399c09){return function(_0xb52dee){if(_0xb52dee){var _0x4e0a1b=typeof _0x399c09[_0x4520('0x1d')]===_0x4520('0x1e')&&typeof _0x399c09['limit']===_0x4520('0x1e');var _0x3c53ec=_0xb52dee[_0x4520('0x1f')];var _0x430d4b=_0x4e0a1b?0x0:_0x399c09['offset'];var _0x1d806f=_0x4e0a1b?_0xb52dee[_0x4520('0x1f')]:_0x399c09['offset']+_0x399c09[_0x4520('0x20')];var _0x112c0f;if(_0x1d806f>=_0x3c53ec){_0x1d806f=_0x3c53ec;_0x112c0f=0xc8;}else{_0x112c0f=0xce;}_0xe6758c[_0x4520('0x1c')](_0x112c0f);return _0xe6758c[_0x4520('0x21')]('Content-Range',_0x430d4b+'-'+_0x1d806f+'/'+_0x3c53ec)[_0x4520('0x22')](_0xb52dee);}return null;};}function patchUpdates(_0x1c673d){return function(_0x1cd4a5){try{jsonpatch[_0x4520('0x23')](_0x1cd4a5,_0x1c673d,!![]);}catch(_0x548c7d){return BPromise[_0x4520('0x24')](_0x548c7d);}return _0x1cd4a5['save']();};}function saveUpdates(_0x13c753,_0xba21b5){return function(_0x5e69e8){if(_0x5e69e8){return _0x5e69e8[_0x4520('0x25')](_0x13c753)[_0x4520('0x26')](function(_0x3379b5){return _0x3379b5;});}return null;};}function removeEntity(_0x57a2f7,_0xb146d4){return function(_0x1e56cc){if(_0x1e56cc){return _0x1e56cc['destroy']()['then'](function(){_0x57a2f7[_0x4520('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1875a0,_0x438cd6){return function(_0x8c4e1f){if(!_0x8c4e1f){_0x1875a0[_0x4520('0x1b')](0x194);}return _0x8c4e1f;};}function handleError(_0x42ce4b,_0xeb54fd){_0xeb54fd=_0xeb54fd||0x1f4;return function(_0x46e18b){logger['error'](_0x46e18b[_0x4520('0x27')]);if(_0x46e18b[_0x4520('0x28')]){delete _0x46e18b[_0x4520('0x28')];}_0x42ce4b['status'](_0xeb54fd)[_0x4520('0x29')](_0x46e18b);};}exports[_0x4520('0x2a')]=function(_0x1c5927,_0x504a36){var _0x52f2fc={},_0x5d6974={},_0x3280ac={'count':0x0,'rows':[]};var _0x22e9d5=_[_0x4520('0x2b')](db['SalesforceAccount'][_0x4520('0x2c')],function(_0x5242bb){return{'name':_0x5242bb['fieldName'],'type':_0x5242bb['type']['key']};});_0x5d6974[_0x4520('0x2d')]=_[_0x4520('0x2b')](_0x22e9d5,_0x4520('0x28'));_0x5d6974[_0x4520('0x2e')]=_[_0x4520('0x2f')](_0x1c5927['query']);_0x5d6974['filters']=_['intersection'](_0x5d6974[_0x4520('0x2d')],_0x5d6974[_0x4520('0x2e')]);_0x52f2fc[_0x4520('0x30')]=_[_0x4520('0x31')](_0x5d6974[_0x4520('0x2d')],qs[_0x4520('0x32')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x32')]));_0x52f2fc['attributes']=_0x52f2fc[_0x4520('0x30')][_0x4520('0x33')]?_0x52f2fc[_0x4520('0x30')]:_0x5d6974['model'];if(!_0x1c5927[_0x4520('0x2e')][_0x4520('0x34')](_0x4520('0x35'))){_0x52f2fc[_0x4520('0x20')]=qs[_0x4520('0x20')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x20')]);_0x52f2fc['offset']=qs[_0x4520('0x1d')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x1d')]);}_0x52f2fc[_0x4520('0x36')]=qs[_0x4520('0x37')](_0x1c5927[_0x4520('0x2e')][_0x4520('0x37')]);_0x52f2fc[_0x4520('0x38')]=qs[_0x4520('0x39')](_[_0x4520('0x3a')](_0x1c5927['query'],_0x5d6974['filters']),_0x22e9d5);if(_0x1c5927['query'][_0x4520('0x3b')]){_0x52f2fc[_0x4520('0x38')]=_[_0x4520('0x3c')](_0x52f2fc[_0x4520('0x38')],{'$or':_[_0x4520('0x2b')](_0x22e9d5,function(_0x131fe7){if(_0x131fe7['type']!=='VIRTUAL'){var _0x5a7832={};_0x5a7832[_0x131fe7[_0x4520('0x28')]]={'$like':'%'+_0x1c5927[_0x4520('0x2e')]['filter']+'%'};return _0x5a7832;}})});}_0x52f2fc=_[_0x4520('0x3c')]({},_0x52f2fc,_0x1c5927[_0x4520('0x3d')]);var _0x2b6939={'where':_0x52f2fc['where']};return db[_0x4520('0x3e')][_0x4520('0x1f')](_0x2b6939)['then'](function(_0x2e414d){_0x3280ac['count']=_0x2e414d;if(_0x1c5927[_0x4520('0x2e')][_0x4520('0x3f')]){_0x52f2fc[_0x4520('0x40')]=[{'all':!![]}];}return db[_0x4520('0x3e')][_0x4520('0x41')](_0x52f2fc);})[_0x4520('0x26')](function(_0x499849){_0x3280ac[_0x4520('0x42')]=_0x499849;return _0x3280ac;})[_0x4520('0x26')](respondWithFilteredResult(_0x504a36,_0x52f2fc))['catch'](handleError(_0x504a36,null));};exports['show']=function(_0x38247b,_0x1bdb25){var _0x564462={'raw':![],'where':{'id':_0x38247b[_0x4520('0x43')]['id']}},_0x277da6={};_0x277da6['model']=_['keys'](db[_0x4520('0x3e')][_0x4520('0x2c')]);_0x277da6[_0x4520('0x2e')]=_['keys'](_0x38247b[_0x4520('0x2e')]);_0x277da6[_0x4520('0x39')]=_[_0x4520('0x31')](_0x277da6[_0x4520('0x2d')],_0x277da6[_0x4520('0x2e')]);_0x564462['attributes']=_[_0x4520('0x31')](_0x277da6[_0x4520('0x2d')],qs[_0x4520('0x32')](_0x38247b[_0x4520('0x2e')][_0x4520('0x32')]));_0x564462[_0x4520('0x30')]=_0x564462['attributes'][_0x4520('0x33')]?_0x564462[_0x4520('0x30')]:_0x277da6[_0x4520('0x2d')];if(_0x38247b['query'][_0x4520('0x3f')]){_0x564462[_0x4520('0x40')]=[{'all':!![]}];}_0x564462=_[_0x4520('0x3c')]({},_0x564462,_0x38247b[_0x4520('0x3d')]);return db[_0x4520('0x3e')][_0x4520('0x44')](_0x564462)[_0x4520('0x26')](handleEntityNotFound(_0x1bdb25,null))[_0x4520('0x26')](respondWithResult(_0x1bdb25,null))['catch'](handleError(_0x1bdb25,null));};exports['create']=function(_0x4444c8,_0x2e35aa){return db['SalesforceAccount'][_0x4520('0x45')](_0x4444c8[_0x4520('0x46')],{})['then'](respondWithResult(_0x2e35aa,0xc9))[_0x4520('0x47')](handleError(_0x2e35aa,null));};exports['update']=function(_0x1bded3,_0x577aa9){if(_0x1bded3[_0x4520('0x46')]['id']){delete _0x1bded3[_0x4520('0x46')]['id'];}return db[_0x4520('0x3e')][_0x4520('0x44')]({'where':{'id':_0x1bded3[_0x4520('0x43')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x577aa9,null))[_0x4520('0x26')](saveUpdates(_0x1bded3[_0x4520('0x46')],null))[_0x4520('0x26')](respondWithResult(_0x577aa9,null))[_0x4520('0x47')](handleError(_0x577aa9,null));};exports[_0x4520('0x48')]=function(_0x3dbc04,_0x163fa9){return db[_0x4520('0x3e')][_0x4520('0x44')]({'where':{'id':_0x3dbc04['params']['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x163fa9,null))[_0x4520('0x26')](removeEntity(_0x163fa9,null))[_0x4520('0x47')](handleError(_0x163fa9,null));};exports[_0x4520('0x49')]=function(_0x123423,_0x1afee4,_0x1e9f00){var _0x4e27a1={};var _0x1b5303={};var _0x21c4d5;var _0x5e3f67;return db['SalesforceAccount'][_0x4520('0x4a')]({'where':{'id':_0x123423[_0x4520('0x43')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x1afee4,null))[_0x4520('0x26')](function(_0x3c48b8){if(_0x3c48b8){_0x21c4d5=_0x3c48b8;_0x1b5303[_0x4520('0x2d')]=_[_0x4520('0x2f')](db[_0x4520('0x4b')][_0x4520('0x2c')]);_0x1b5303['query']=_[_0x4520('0x2f')](_0x123423['query']);_0x1b5303[_0x4520('0x39')]=_[_0x4520('0x31')](_0x1b5303[_0x4520('0x2d')],_0x1b5303[_0x4520('0x2e')]);_0x4e27a1['attributes']=_['intersection'](_0x1b5303[_0x4520('0x2d')],qs[_0x4520('0x32')](_0x123423[_0x4520('0x2e')][_0x4520('0x32')]));_0x4e27a1['attributes']=_0x4e27a1[_0x4520('0x30')][_0x4520('0x33')]?_0x4e27a1[_0x4520('0x30')]:_0x1b5303[_0x4520('0x2d')];_0x4e27a1[_0x4520('0x36')]=qs[_0x4520('0x37')](_0x123423[_0x4520('0x2e')]['sort']);_0x4e27a1[_0x4520('0x38')]=qs['filters'](_['pick'](_0x123423[_0x4520('0x2e')],_0x1b5303[_0x4520('0x39')]));if(_0x123423['query']['filter']){_0x4e27a1[_0x4520('0x38')]=_[_0x4520('0x3c')](_0x4e27a1[_0x4520('0x38')],{'$or':_[_0x4520('0x2b')](_0x4e27a1[_0x4520('0x30')],function(_0x1dd6d9){var _0x49354a={};_0x49354a[_0x1dd6d9]={'$like':'%'+_0x123423[_0x4520('0x2e')][_0x4520('0x3b')]+'%'};return _0x49354a;})});}_0x4e27a1=_[_0x4520('0x3c')]({},_0x4e27a1,_0x123423['options']);return _0x21c4d5[_0x4520('0x49')](_0x4e27a1);}})[_0x4520('0x26')](function(_0x328bb4){if(_0x328bb4){_0x5e3f67=_0x328bb4[_0x4520('0x33')];if(!_0x123423[_0x4520('0x2e')][_0x4520('0x34')](_0x4520('0x35'))){_0x4e27a1[_0x4520('0x20')]=qs[_0x4520('0x20')](_0x123423[_0x4520('0x2e')][_0x4520('0x20')]);_0x4e27a1['offset']=qs[_0x4520('0x1d')](_0x123423[_0x4520('0x2e')][_0x4520('0x1d')]);}return _0x21c4d5[_0x4520('0x49')](_0x4e27a1);}})['then'](function(_0x4a7c5a){if(_0x4a7c5a){return _0x4a7c5a?{'count':_0x5e3f67,'rows':_0x4a7c5a}:null;}})[_0x4520('0x26')](respondWithResult(_0x1afee4,null))[_0x4520('0x47')](handleError(_0x1afee4,null));};exports[_0x4520('0x4c')]=function(_0x22eaf2,_0x511e42,_0x4d80b3){if(_0x22eaf2['body']['id']){delete _0x22eaf2[_0x4520('0x46')]['id'];}return db[_0x4520('0x3e')][_0x4520('0x4a')]({'where':{'id':_0x22eaf2[_0x4520('0x43')]['id']}})[_0x4520('0x26')](handleEntityNotFound(_0x511e42,null))[_0x4520('0x26')](function(_0x244182){if(_0x244182){_0x22eaf2['body'][_0x4520('0x4d')]=_0x244182['id'];_0x22eaf2[_0x4520('0x46')][_0x4520('0x4e')]=integrations[_0x4520('0x4f')](_0x22eaf2['body'][_0x4520('0x50')],_0x22eaf2[_0x4520('0x46')][_0x4520('0x51')]);_0x22eaf2[_0x4520('0x46')][_0x4520('0x52')]=integrations['getDescriptions'](_0x22eaf2[_0x4520('0x46')][_0x4520('0x50')],_0x22eaf2[_0x4520('0x46')][_0x4520('0x51')]);return db[_0x4520('0x4b')]['create'](_0x22eaf2[_0x4520('0x46')],{'include':[{'model':db[_0x4520('0x53')],'as':_0x4520('0x4e')},{'model':db['SalesforceField'],'as':_0x4520('0x52')}]});}return null;})[_0x4520('0x26')](respondWithResult(_0x511e42,null))[_0x4520('0x47')](handleError(_0x511e42,null));};exports[_0x4520('0x54')]=function(_0x11fdc2,_0x1e120e,_0x4794a3){var _0x337bff;var _0x1d3027='';var _0x3128cc=_0x4520('0x55');return db['SalesforceAccount'][_0x4520('0x4a')]({'where':{'id':_0x11fdc2[_0x4520('0x43')]['id']},'attributes':['id',_0x4520('0x56'),'clientId',_0x4520('0x57'),_0x4520('0x58'),_0x4520('0x59'),_0x4520('0x5a')]})[_0x4520('0x26')](handleEntityNotFound(_0x1e120e,null))[_0x4520('0x26')](function(_0x559757){if(_0x559757){_0x1d3027=_0x559757[_0x4520('0x56')];var _0x2aa95f=_0x1d3027[_0x4520('0x5b')](-0x1);if(_0x2aa95f==='/'){_0x1d3027=_0x1d3027[_0x4520('0x5c')](0x0,_0x1d3027[_0x4520('0x5d')](_0x2aa95f));}_0x337bff=new jsforce[(_0x4520('0x5e'))]({'oauth2':{'loginUrl':_0x1d3027,'clientId':_0x559757['clientId'],'clientSecret':_0x559757[_0x4520('0x57')]}});return _0x337bff['login'](_0x559757['username'],_0x559757[_0x4520('0x59')][_0x4520('0x5f')](_0x559757[_0x4520('0x5a')]));}})[_0x4520('0x26')](function(_0x159b7c){if(_0x159b7c){if(!_[_0x4520('0x60')](_0x11fdc2[_0x4520('0x2e')][_0x4520('0x61')])){_0x3128cc=_0x11fdc2[_0x4520('0x2e')][_0x4520('0x61')];}return _0x337bff[_0x4520('0x62')](_0x3128cc)[_0x4520('0x63')]();}})[_0x4520('0x26')](function(_0x467a70){var _0x412fe1=['OwnerId','ActivityDate','IsReminderSet',_0x4520('0x64'),_0x4520('0x65'),_0x4520('0x66')];var _0x2638ad=['string',_0x4520('0x67'),_0x4520('0x68'),'boolean',_0x4520('0x69'),_0x4520('0x6a'),'phone'];if(_0x467a70){_[_0x4520('0x6b')](_0x467a70[_0x4520('0x32')],function(_0x124fae){return _0x412fe1[_0x4520('0x6c')](_0x124fae[_0x4520('0x28')])||!_0x2638ad[_0x4520('0x6c')](_0x124fae[_0x4520('0x51')]);});return{'count':_0x467a70[_0x4520('0x32')][_0x4520('0x33')],'rows':_[_0x4520('0x2b')](_0x467a70[_0x4520('0x32')],function(_0x164241){return{'id':_0x164241[_0x4520('0x28')],'name':_0x164241[_0x4520('0x6d')],'custom':_0x164241['custom'],'options':_0x164241['picklistValues'][_0x4520('0x33')]>0x0?_[_0x4520('0x2b')](_0x164241['picklistValues'],function(_0x564459){return{'name':_0x564459['label'],'value':_0x564459[_0x4520('0x6e')]};}):_0x164241[_0x4520('0x51')]=='boolean'?[{'name':'True','value':_0x4520('0x6f')},{'name':'False','value':_0x4520('0x70')}]:[]};})};}})['then'](respondWithResult(_0x1e120e,null))[_0x4520('0x47')](function(_0x379b8f){var _0x4849d7=_0x11fdc2[_0x4520('0x2e')]['test']?0x1f4:_0x379b8f[_0x4520('0x71')]||0x1f4;logger[_0x4520('0x72')](_0x4520('0x73'),_0x4520('0x54'),_0x4849d7,JSON[_0x4520('0x74')](_0x379b8f));delete _0x379b8f[_0x4520('0x28')];if(_0x4849d7===0x191){_0x4849d7=0x190;}_0x1e120e[_0x4520('0x1c')](_0x4849d7)[_0x4520('0x29')](_0x11fdc2[_0x4520('0x2e')][_0x4520('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x379b8f['statusCode']}:_0x379b8f);});};
\ No newline at end of file
index fc6464e..2c73cd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb29=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','moment','request-promise','rimraf'];(function(_0x15bc05,_0x5e1bd8){var _0x251683=function(_0x2fda6e){while(--_0x2fda6e){_0x15bc05['push'](_0x15bc05['shift']());}};_0x251683(++_0x5e1bd8);}(_0xfb29,0x119));var _0x9fb2=function(_0x27cded,_0xb38344){_0x27cded=_0x27cded-0x0;var _0x183a0a=_0xfb29[_0x27cded];return _0x183a0a;};'use strict';var _=require(_0x9fb2('0x0'));var util=require('util');var logger=require(_0x9fb2('0x1'))('api');var moment=require(_0x9fb2('0x2'));var BPromise=require('bluebird');var rp=require(_0x9fb2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fb2('0x4'));var config=require('../../config/environment');var attributes=require(_0x9fb2('0x5'));var integrations=require(_0x9fb2('0x6'));module[_0x9fb2('0x7')]=function(_0x2f9a3a,_0xc26c95){return _0x2f9a3a[_0x9fb2('0x8')](_0x9fb2('0x9'),attributes,{'tableName':_0x9fb2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x867f=['api','moment','bluebird','request-promise','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x867f,0x7f));var _0xf867=function(_0x5c8a11,_0x10805f){_0x5c8a11=_0x5c8a11-0x0;var _0x116b22=_0x867f[_0x5c8a11];return _0x116b22;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var logger=require(_0xf867('0x2'))(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var rp=require(_0xf867('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf867('0x7'));var integrations=require(_0xf867('0x8'));module[_0xf867('0x9')]=function(_0x254e82,_0x5a1a44){return _0x254e82[_0xf867('0xa')](_0xf867('0xb'),attributes,{'tableName':_0xf867('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c684bba..724315f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9228=['catch','ShowSalesforceAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','SalesforceAccount','findAll','options','where','attributes','limit','map','model','include','GetSalesforceAccount'];(function(_0x213ac4,_0x576b0a){var _0xd29598=function(_0x48bfcc){while(--_0x48bfcc){_0x213ac4['push'](_0x213ac4['shift']());}};_0xd29598(++_0x576b0a);}(_0x9228,0xf9));var _0x8922=function(_0x5b80ff,_0x38517e){_0x5b80ff=_0x5b80ff-0x0;var _0x3cb5f5=_0x9228[_0x5b80ff];return _0x3cb5f5;};'use strict';var _=require(_0x8922('0x0'));var util=require('util');var moment=require(_0x8922('0x1'));var BPromise=require('bluebird');var rs=require(_0x8922('0x2'));var fs=require('fs');var Redis=require(_0x8922('0x3'));var db=require(_0x8922('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8922('0x5'))(_0x8922('0x6'));var config=require(_0x8922('0x7'));var jayson=require(_0x8922('0x8'));var client=jayson[_0x8922('0x9')][_0x8922('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x391baf,_0x2e8ac1,_0x2c1032){return new BPromise(function(_0x506c2f,_0x20c658){return client['request'](_0x391baf,_0x2c1032)[_0x8922('0xb')](function(_0x1175ac){logger[_0x8922('0xc')](_0x8922('0xd'),_0x2e8ac1,_0x8922('0xe'));logger[_0x8922('0xf')](_0x8922('0x10'),_0x2e8ac1,'request\x20sent',JSON['stringify'](_0x1175ac));if(_0x1175ac[_0x8922('0x11')]){if(_0x1175ac[_0x8922('0x11')][_0x8922('0x12')]===0x1f4){logger[_0x8922('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2e8ac1,_0x1175ac[_0x8922('0x11')]['message']);return _0x20c658(_0x1175ac['error']['message']);}logger['error'](_0x8922('0xd'),_0x2e8ac1,_0x1175ac[_0x8922('0x11')][_0x8922('0x13')]);return _0x506c2f(_0x1175ac['error'][_0x8922('0x13')]);}else{logger[_0x8922('0xc')](_0x8922('0xd'),_0x2e8ac1,_0x8922('0xe'));_0x506c2f(_0x1175ac[_0x8922('0x14')][_0x8922('0x13')]);}})['catch'](function(_0xde78eb){logger[_0x8922('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2e8ac1,_0xde78eb);_0x20c658(_0xde78eb);});});}exports['GetSalesforceAccount']=function(_0x42afdf){var _0x3624ab=this;return new Promise(function(_0x1242dd,_0x456a79){return db[_0x8922('0x15')][_0x8922('0x16')]({'raw':_0x42afdf[_0x8922('0x17')]?_0x42afdf[_0x8922('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x42afdf[_0x8922('0x17')]?_0x42afdf[_0x8922('0x17')][_0x8922('0x18')]||null:null,'attributes':_0x42afdf[_0x8922('0x17')]?_0x42afdf['options'][_0x8922('0x19')]||null:null,'limit':_0x42afdf[_0x8922('0x17')]?_0x42afdf['options'][_0x8922('0x1a')]||null:null,'include':_0x42afdf[_0x8922('0x17')]?_0x42afdf[_0x8922('0x17')]['include']?_[_0x8922('0x1b')](_0x42afdf[_0x8922('0x17')]['include'],function(_0x29c13e){return{'model':db[_0x29c13e[_0x8922('0x1c')]],'as':_0x29c13e['as'],'attributes':_0x29c13e['attributes'],'include':_0x29c13e['include']?_['map'](_0x29c13e[_0x8922('0x1d')],function(_0x101793){return{'model':db[_0x101793['model']],'as':_0x101793['as'],'attributes':_0x101793[_0x8922('0x19')],'include':_0x101793[_0x8922('0x1d')]?_[_0x8922('0x1b')](_0x101793[_0x8922('0x1d')],function(_0x5f09f8){return{'model':db[_0x5f09f8[_0x8922('0x1c')]],'as':_0x5f09f8['as'],'attributes':_0x5f09f8[_0x8922('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x459bd9){logger[_0x8922('0xc')](_0x8922('0x1e'),_0x42afdf);logger[_0x8922('0xf')](_0x8922('0x1e'),_0x42afdf,JSON['stringify'](_0x459bd9));_0x1242dd(_0x459bd9);})[_0x8922('0x1f')](function(_0x5f4055){logger[_0x8922('0x11')](_0x8922('0x1e'),_0x5f4055[_0x8922('0x13')],_0x42afdf);_0x456a79(_0x3624ab[_0x8922('0x11')](0x1f4,_0x5f4055['message']));});});};exports[_0x8922('0x20')]=function(_0x1d37eb){var _0x35ba90=this;return new Promise(function(_0x56ead7,_0x28857d){return db[_0x8922('0x15')][_0x8922('0x21')]({'raw':_0x1d37eb[_0x8922('0x17')]?_0x1d37eb[_0x8922('0x17')][_0x8922('0x22')]===undefined?!![]:![]:!![],'where':_0x1d37eb[_0x8922('0x17')]?_0x1d37eb[_0x8922('0x17')]['where']||null:null,'attributes':_0x1d37eb[_0x8922('0x17')]?_0x1d37eb[_0x8922('0x17')][_0x8922('0x19')]||null:null,'include':_0x1d37eb['options']?_0x1d37eb[_0x8922('0x17')]['include']?_[_0x8922('0x1b')](_0x1d37eb['options'][_0x8922('0x1d')],function(_0x160d25){return{'model':db[_0x160d25['model']],'as':_0x160d25['as'],'attributes':_0x160d25[_0x8922('0x19')],'include':_0x160d25[_0x8922('0x1d')]?_[_0x8922('0x1b')](_0x160d25['include'],function(_0x219815){return{'model':db[_0x219815[_0x8922('0x1c')]],'as':_0x219815['as'],'attributes':_0x219815[_0x8922('0x19')],'include':_0x219815[_0x8922('0x1d')]?_['map'](_0x219815[_0x8922('0x1d')],function(_0x1d59e8){return{'model':db[_0x1d59e8['model']],'as':_0x1d59e8['as'],'attributes':_0x1d59e8[_0x8922('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8922('0xb')](function(_0x5c5ef9){logger['info']('ShowSalesforceAccount',_0x1d37eb);logger[_0x8922('0xf')](_0x8922('0x20'),_0x1d37eb,JSON['stringify'](_0x5c5ef9));_0x56ead7(_0x5c5ef9);})[_0x8922('0x1f')](function(_0x4b0f53){logger['error'](_0x8922('0x20'),_0x4b0f53['message'],_0x1d37eb);_0x28857d(_0x35ba90[_0x8922('0x11')](0x1f4,_0x4b0f53[_0x8922('0x13')]));});});};
\ No newline at end of file
+var _0x6aaa=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','raw','options','where','include','map','model','attributes','debug','find','ShowSalesforceAccount'];(function(_0x489812,_0x16bc1b){var _0x21468f=function(_0x115431){while(--_0x115431){_0x489812['push'](_0x489812['shift']());}};_0x21468f(++_0x16bc1b);}(_0x6aaa,0xd8));var _0xa6aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6aaa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa6aa('0x0'));var util=require(_0xa6aa('0x1'));var moment=require(_0xa6aa('0x2'));var BPromise=require(_0xa6aa('0x3'));var rs=require(_0xa6aa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6aa('0x5'))['db'];var utils=require(_0xa6aa('0x6'));var logger=require(_0xa6aa('0x7'))(_0xa6aa('0x8'));var config=require('../../config/environment');var jayson=require(_0xa6aa('0x9'));var client=jayson[_0xa6aa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1267d8,_0x4b691a,_0x1700f8){return new BPromise(function(_0xddfe17,_0x1972ef){return client[_0xa6aa('0xb')](_0x1267d8,_0x1700f8)[_0xa6aa('0xc')](function(_0x17d2b5){logger['info'](_0xa6aa('0xd'),_0x4b691a,_0xa6aa('0xe'));logger['debug'](_0xa6aa('0xf'),_0x4b691a,_0xa6aa('0xe'),JSON[_0xa6aa('0x10')](_0x17d2b5));if(_0x17d2b5[_0xa6aa('0x11')]){if(_0x17d2b5[_0xa6aa('0x11')][_0xa6aa('0x12')]===0x1f4){logger['error'](_0xa6aa('0xd'),_0x4b691a,_0x17d2b5[_0xa6aa('0x11')]['message']);return _0x1972ef(_0x17d2b5[_0xa6aa('0x11')]['message']);}logger[_0xa6aa('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x4b691a,_0x17d2b5[_0xa6aa('0x11')][_0xa6aa('0x13')]);return _0xddfe17(_0x17d2b5[_0xa6aa('0x11')]['message']);}else{logger[_0xa6aa('0x14')](_0xa6aa('0xd'),_0x4b691a,_0xa6aa('0xe'));_0xddfe17(_0x17d2b5[_0xa6aa('0x15')][_0xa6aa('0x13')]);}})[_0xa6aa('0x16')](function(_0x40db7e){logger[_0xa6aa('0x11')](_0xa6aa('0xd'),_0x4b691a,_0x40db7e);_0x1972ef(_0x40db7e);});});}exports[_0xa6aa('0x17')]=function(_0x3d99a3){var _0x12eba3=this;return new Promise(function(_0x56f64a,_0x533129){return db[_0xa6aa('0x18')][_0xa6aa('0x19')]({'raw':_0x3d99a3['options']?_0x3d99a3['options'][_0xa6aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')][_0xa6aa('0x1c')]||null:null,'attributes':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')]['attributes']||null:null,'limit':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')]['limit']||null:null,'include':_0x3d99a3[_0xa6aa('0x1b')]?_0x3d99a3[_0xa6aa('0x1b')][_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x3d99a3[_0xa6aa('0x1b')][_0xa6aa('0x1d')],function(_0x38aaa9){return{'model':db[_0x38aaa9[_0xa6aa('0x1f')]],'as':_0x38aaa9['as'],'attributes':_0x38aaa9[_0xa6aa('0x20')],'include':_0x38aaa9[_0xa6aa('0x1d')]?_['map'](_0x38aaa9[_0xa6aa('0x1d')],function(_0x2f4c9b){return{'model':db[_0x2f4c9b['model']],'as':_0x2f4c9b['as'],'attributes':_0x2f4c9b[_0xa6aa('0x20')],'include':_0x2f4c9b[_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x2f4c9b['include'],function(_0x1914c5){return{'model':db[_0x1914c5['model']],'as':_0x1914c5['as'],'attributes':_0x1914c5['attributes']};}):[]};}):[]};}):[]:[]})[_0xa6aa('0xc')](function(_0x494426){logger[_0xa6aa('0x14')](_0xa6aa('0x17'),_0x3d99a3);logger[_0xa6aa('0x21')](_0xa6aa('0x17'),_0x3d99a3,JSON[_0xa6aa('0x10')](_0x494426));_0x56f64a(_0x494426);})[_0xa6aa('0x16')](function(_0x102986){logger[_0xa6aa('0x11')](_0xa6aa('0x17'),_0x102986[_0xa6aa('0x13')],_0x3d99a3);_0x533129(_0x12eba3[_0xa6aa('0x11')](0x1f4,_0x102986[_0xa6aa('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x430fe3){var _0x1d1a12=this;return new Promise(function(_0x49ab2b,_0x43e5c6){return db[_0xa6aa('0x18')][_0xa6aa('0x22')]({'raw':_0x430fe3['options']?_0x430fe3[_0xa6aa('0x1b')][_0xa6aa('0x1a')]===undefined?!![]:![]:!![],'where':_0x430fe3['options']?_0x430fe3[_0xa6aa('0x1b')][_0xa6aa('0x1c')]||null:null,'attributes':_0x430fe3[_0xa6aa('0x1b')]?_0x430fe3[_0xa6aa('0x1b')]['attributes']||null:null,'include':_0x430fe3[_0xa6aa('0x1b')]?_0x430fe3['options'][_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x430fe3[_0xa6aa('0x1b')][_0xa6aa('0x1d')],function(_0x522fbe){return{'model':db[_0x522fbe[_0xa6aa('0x1f')]],'as':_0x522fbe['as'],'attributes':_0x522fbe[_0xa6aa('0x20')],'include':_0x522fbe['include']?_[_0xa6aa('0x1e')](_0x522fbe[_0xa6aa('0x1d')],function(_0x489727){return{'model':db[_0x489727[_0xa6aa('0x1f')]],'as':_0x489727['as'],'attributes':_0x489727['attributes'],'include':_0x489727[_0xa6aa('0x1d')]?_[_0xa6aa('0x1e')](_0x489727[_0xa6aa('0x1d')],function(_0x3f3138){return{'model':db[_0x3f3138[_0xa6aa('0x1f')]],'as':_0x3f3138['as'],'attributes':_0x3f3138[_0xa6aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xa6aa('0xc')](function(_0x26c24e){logger[_0xa6aa('0x14')](_0xa6aa('0x23'),_0x430fe3);logger[_0xa6aa('0x21')](_0xa6aa('0x23'),_0x430fe3,JSON[_0xa6aa('0x10')](_0x26c24e));_0x49ab2b(_0x26c24e);})[_0xa6aa('0x16')](function(_0x1f0f06){logger['error'](_0xa6aa('0x23'),_0x1f0f06[_0xa6aa('0x13')],_0x430fe3);_0x43e5c6(_0x1d1a12[_0xa6aa('0x11')](0x1f4,_0x1f0f06[_0xa6aa('0x13')]));});});};
\ No newline at end of file
index d87aaae..0ff05e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x53e403,_0x43ed62){var _0x2d58db=function(_0x406acf){while(--_0x406acf){_0x53e403['push'](_0x53e403['shift']());}};_0x2d58db(++_0x43ed62);}(_0x2ef3,0xba));var _0x32ef=function(_0x17952d,_0x2ed477){_0x17952d=_0x17952d-0x0;var _0x1cada9=_0x2ef3[_0x17952d];return _0x1cada9;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router;
\ No newline at end of file
+var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x82010,_0x12d992){var _0x51942d=function(_0x965b50){while(--_0x965b50){_0x82010['push'](_0x82010['shift']());}};_0x51942d(++_0x12d992);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5f66[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
index 4c67698..a653303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x678e=['sequelize','STRING','ENUM','contact','contact_lead','nothing','lead'];(function(_0x266e57,_0x41125b){var _0x4cdc1d=function(_0x3d3734){while(--_0x3d3734){_0x266e57['push'](_0x266e57['shift']());}};_0x4cdc1d(++_0x41125b);}(_0x678e,0xe0));var _0xe678=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x678e[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0xe678('0x0'));module['exports']={'name':{'type':Sequelize[_0xe678('0x1')]},'description':{'type':Sequelize[_0xe678('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xe678('0x2')]('contact_lead',_0xe678('0x3'),'lead','account_contact_lead','account'),'defaultValue':_0xe678('0x4')},'moduleCreate':{'type':Sequelize[_0xe678('0x2')](_0xe678('0x5'),_0xe678('0x3'),_0xe678('0x6'),'account'),'defaultValue':_0xe678('0x6')},'leadId':{'type':Sequelize[_0xe678('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xe678('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xe678('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xe678('0x1')]}};
\ No newline at end of file
+var _0x3a79=['account_contact_lead','nothing','lead','account','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1dc24d,_0x541fa4){var _0x5d7fb2=function(_0x7ccd26){while(--_0x7ccd26){_0x1dc24d['push'](_0x1dc24d['shift']());}};_0x5d7fb2(++_0x541fa4);}(_0x3a79,0xca));var _0x93a7=function(_0x175893,_0x1c0d91){_0x175893=_0x175893-0x0;var _0x53c92f=_0x3a79[_0x175893];return _0x53c92f;};'use strict';var Sequelize=require('sequelize');module[_0x93a7('0x0')]={'name':{'type':Sequelize[_0x93a7('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x93a7('0x2')](_0x93a7('0x3'),_0x93a7('0x4')),'defaultValue':_0x93a7('0x3')},'moduleSearch':{'type':Sequelize[_0x93a7('0x2')](_0x93a7('0x5'),_0x93a7('0x6'),'lead',_0x93a7('0x7'),'account'),'defaultValue':_0x93a7('0x5')},'moduleCreate':{'type':Sequelize[_0x93a7('0x2')](_0x93a7('0x8'),_0x93a7('0x6'),_0x93a7('0x9'),_0x93a7('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x93a7('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x93a7('0x1')]}};
\ No newline at end of file
index 2c10afc..149ec62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc00c=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','includeAll','options','find','body','getFields','findOne','SalesforceField','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x536699,_0x41b335){var _0x475a6a=function(_0x2da2f6){while(--_0x2da2f6){_0x536699['push'](_0x536699['shift']());}};_0x475a6a(++_0x41b335);}(_0xc00c,0x92));var _0xcc00=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xc00c[_0x1beef3];return _0x5af964;};'use strict';var emlformat=require(_0xcc00('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc00('0x1'));var jsonpatch=require(_0xcc00('0x2'));var rp=require(_0xcc00('0x3'));var moment=require(_0xcc00('0x4'));var BPromise=require(_0xcc00('0x5'));var Mustache=require(_0xcc00('0x6'));var util=require(_0xcc00('0x7'));var path=require('path');var sox=require(_0xcc00('0x8'));var csv=require(_0xcc00('0x9'));var ejs=require(_0xcc00('0xa'));var fs=require('fs');var fs_extra=require(_0xcc00('0xb'));var _=require('lodash');var squel=require(_0xcc00('0xc'));var crypto=require(_0xcc00('0xd'));var jsforce=require(_0xcc00('0xe'));var deskjs=require(_0xcc00('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcc00('0x10'));var Papa=require(_0xcc00('0x11'));var Redis=require(_0xcc00('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcc00('0x13'));var as=require(_0xcc00('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc00('0x15'))('api');var utils=require(_0xcc00('0x16'));var config=require(_0xcc00('0x17'));var licenseUtil=require(_0xcc00('0x18'));var db=require(_0xcc00('0x19'))['db'];function respondWithStatusCode(_0x42b5c2,_0x438cec){_0x438cec=_0x438cec||0xcc;return function(_0x4b2663){if(_0x4b2663){return _0x42b5c2[_0xcc00('0x1a')](_0x438cec);}return _0x42b5c2['status'](_0x438cec)[_0xcc00('0x1b')]();};}function respondWithResult(_0xafaf86,_0x438fa3){_0x438fa3=_0x438fa3||0xc8;return function(_0x108a40){if(_0x108a40){return _0xafaf86[_0xcc00('0x1c')](_0x438fa3)[_0xcc00('0x1d')](_0x108a40);}};}function respondWithFilteredResult(_0x150d7a,_0x47aa2d){return function(_0x26dd58){if(_0x26dd58){var _0x8f3cab=typeof _0x47aa2d['offset']===_0xcc00('0x1e')&&typeof _0x47aa2d[_0xcc00('0x1f')]===_0xcc00('0x1e');var _0x2e5475=_0x26dd58[_0xcc00('0x20')];var _0x3eadf7=_0x8f3cab?0x0:_0x47aa2d[_0xcc00('0x21')];var _0xf4f20d=_0x8f3cab?_0x26dd58[_0xcc00('0x20')]:_0x47aa2d[_0xcc00('0x21')]+_0x47aa2d['limit'];var _0x47c876;if(_0xf4f20d>=_0x2e5475){_0xf4f20d=_0x2e5475;_0x47c876=0xc8;}else{_0x47c876=0xce;}_0x150d7a[_0xcc00('0x1c')](_0x47c876);return _0x150d7a[_0xcc00('0x22')](_0xcc00('0x23'),_0x3eadf7+'-'+_0xf4f20d+'/'+_0x2e5475)[_0xcc00('0x1d')](_0x26dd58);}return null;};}function patchUpdates(_0x448a80){return function(_0x434079){try{jsonpatch['apply'](_0x434079,_0x448a80,!![]);}catch(_0x155a47){return BPromise[_0xcc00('0x24')](_0x155a47);}return _0x434079[_0xcc00('0x25')]();};}function saveUpdates(_0x3465a3,_0x369016){return function(_0x111a34){if(_0x111a34){return _0x111a34[_0xcc00('0x26')](_0x3465a3)[_0xcc00('0x27')](function(_0x564f45){return _0x564f45;});}return null;};}function removeEntity(_0x40535e,_0x2af6dd){return function(_0x81b7f1){if(_0x81b7f1){return _0x81b7f1[_0xcc00('0x28')]()[_0xcc00('0x27')](function(){_0x40535e[_0xcc00('0x1c')](0xcc)[_0xcc00('0x1b')]();});}};}function handleEntityNotFound(_0x2fbbbf,_0x42f975){return function(_0x2f8a56){if(!_0x2f8a56){_0x2fbbbf[_0xcc00('0x1a')](0x194);}return _0x2f8a56;};}function handleError(_0x24edb8,_0x4d824f){_0x4d824f=_0x4d824f||0x1f4;return function(_0xca140b){logger[_0xcc00('0x29')](_0xca140b[_0xcc00('0x2a')]);if(_0xca140b[_0xcc00('0x2b')]){delete _0xca140b['name'];}_0x24edb8[_0xcc00('0x1c')](_0x4d824f)[_0xcc00('0x2c')](_0xca140b);};}exports[_0xcc00('0x2d')]=function(_0x1ba470,_0x3b7be4){var _0x2e0026={},_0x4f2ca4={},_0x14c0f6={'count':0x0,'rows':[]};var _0x396d32=_[_0xcc00('0x2e')](db[_0xcc00('0x2f')][_0xcc00('0x30')],function(_0xb1d77b){return{'name':_0xb1d77b[_0xcc00('0x31')],'type':_0xb1d77b[_0xcc00('0x32')][_0xcc00('0x33')]};});_0x4f2ca4[_0xcc00('0x34')]=_[_0xcc00('0x2e')](_0x396d32,_0xcc00('0x2b'));_0x4f2ca4[_0xcc00('0x35')]=_['keys'](_0x1ba470['query']);_0x4f2ca4[_0xcc00('0x36')]=_['intersection'](_0x4f2ca4[_0xcc00('0x34')],_0x4f2ca4['query']);_0x2e0026[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x4f2ca4[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x39')]));_0x2e0026[_0xcc00('0x37')]=_0x2e0026[_0xcc00('0x37')][_0xcc00('0x3a')]?_0x2e0026[_0xcc00('0x37')]:_0x4f2ca4[_0xcc00('0x34')];if(!_0x1ba470[_0xcc00('0x35')]['hasOwnProperty'](_0xcc00('0x3b'))){_0x2e0026[_0xcc00('0x1f')]=qs[_0xcc00('0x1f')](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x1f')]);_0x2e0026['offset']=qs['offset'](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x21')]);}_0x2e0026[_0xcc00('0x3c')]=qs[_0xcc00('0x3d')](_0x1ba470[_0xcc00('0x35')][_0xcc00('0x3d')]);_0x2e0026[_0xcc00('0x3e')]=qs[_0xcc00('0x36')](_[_0xcc00('0x3f')](_0x1ba470[_0xcc00('0x35')],_0x4f2ca4[_0xcc00('0x36')]),_0x396d32);if(_0x1ba470['query']['filter']){_0x2e0026[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0x2e0026[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x2e')](_0x396d32,function(_0x3f8d0a){if(_0x3f8d0a[_0xcc00('0x32')]!==_0xcc00('0x41')){var _0x17906f={};_0x17906f[_0x3f8d0a[_0xcc00('0x2b')]]={'$like':'%'+_0x1ba470[_0xcc00('0x35')][_0xcc00('0x42')]+'%'};return _0x17906f;}})});}_0x2e0026=_[_0xcc00('0x40')]({},_0x2e0026,_0x1ba470['options']);var _0x37f5dd={'where':_0x2e0026[_0xcc00('0x3e')]};return db['SalesforceConfiguration'][_0xcc00('0x20')](_0x37f5dd)[_0xcc00('0x27')](function(_0x4bab54){_0x14c0f6[_0xcc00('0x20')]=_0x4bab54;if(_0x1ba470[_0xcc00('0x35')]['includeAll']){_0x2e0026[_0xcc00('0x43')]=[{'all':!![]}];}return db[_0xcc00('0x2f')][_0xcc00('0x44')](_0x2e0026);})[_0xcc00('0x27')](function(_0xbc88ee){_0x14c0f6[_0xcc00('0x45')]=_0xbc88ee;return _0x14c0f6;})[_0xcc00('0x27')](respondWithFilteredResult(_0x3b7be4,_0x2e0026))[_0xcc00('0x46')](handleError(_0x3b7be4,null));};exports[_0xcc00('0x47')]=function(_0x203063,_0x59e679){var _0x2bdc32={'raw':![],'where':{'id':_0x203063[_0xcc00('0x48')]['id']}},_0x28d7da={};_0x28d7da[_0xcc00('0x34')]=_[_0xcc00('0x49')](db[_0xcc00('0x2f')][_0xcc00('0x30')]);_0x28d7da[_0xcc00('0x35')]=_[_0xcc00('0x49')](_0x203063[_0xcc00('0x35')]);_0x28d7da['filters']=_[_0xcc00('0x38')](_0x28d7da[_0xcc00('0x34')],_0x28d7da[_0xcc00('0x35')]);_0x2bdc32[_0xcc00('0x37')]=_[_0xcc00('0x38')](_0x28d7da[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x203063['query']['fields']));_0x2bdc32[_0xcc00('0x37')]=_0x2bdc32[_0xcc00('0x37')]['length']?_0x2bdc32[_0xcc00('0x37')]:_0x28d7da[_0xcc00('0x34')];if(_0x203063[_0xcc00('0x35')][_0xcc00('0x4a')]){_0x2bdc32[_0xcc00('0x43')]=[{'all':!![]}];}_0x2bdc32=_[_0xcc00('0x40')]({},_0x2bdc32,_0x203063[_0xcc00('0x4b')]);return db[_0xcc00('0x2f')][_0xcc00('0x4c')](_0x2bdc32)[_0xcc00('0x27')](handleEntityNotFound(_0x59e679,null))[_0xcc00('0x27')](respondWithResult(_0x59e679,null))[_0xcc00('0x46')](handleError(_0x59e679,null));};exports['create']=function(_0x414701,_0x402900){return db[_0xcc00('0x2f')]['create'](_0x414701[_0xcc00('0x4d')],{})[_0xcc00('0x27')](respondWithResult(_0x402900,0xc9))[_0xcc00('0x46')](handleError(_0x402900,null));};exports['update']=function(_0x5008ac,_0x5bb0fe){if(_0x5008ac['body']['id']){delete _0x5008ac[_0xcc00('0x4d')]['id'];}return db[_0xcc00('0x2f')][_0xcc00('0x4c')]({'where':{'id':_0x5008ac['params']['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x5bb0fe,null))[_0xcc00('0x27')](saveUpdates(_0x5008ac[_0xcc00('0x4d')],null))[_0xcc00('0x27')](respondWithResult(_0x5bb0fe,null))[_0xcc00('0x46')](handleError(_0x5bb0fe,null));};exports[_0xcc00('0x28')]=function(_0x289616,_0x58afee){return db[_0xcc00('0x2f')][_0xcc00('0x4c')]({'where':{'id':_0x289616[_0xcc00('0x48')]['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x58afee,null))['then'](removeEntity(_0x58afee,null))[_0xcc00('0x46')](handleError(_0x58afee,null));};exports[_0xcc00('0x4e')]=function(_0x1ad5ae,_0x2415c8,_0xa4f1c8){var _0x205f7e={};var _0x3b101e={};var _0x4b4842;var _0x256b38;return db['SalesforceConfiguration'][_0xcc00('0x4f')]({'where':{'id':_0x1ad5ae[_0xcc00('0x48')]['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x2415c8,null))['then'](function(_0x13b440){if(_0x13b440){_0x4b4842=_0x13b440;_0x3b101e[_0xcc00('0x34')]=_['keys'](db[_0xcc00('0x50')]['rawAttributes']);_0x3b101e[_0xcc00('0x35')]=_[_0xcc00('0x49')](_0x1ad5ae['query']);_0x3b101e['filters']=_[_0xcc00('0x38')](_0x3b101e['model'],_0x3b101e[_0xcc00('0x35')]);_0x205f7e[_0xcc00('0x37')]=_['intersection'](_0x3b101e[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x1ad5ae['query']['fields']));_0x205f7e[_0xcc00('0x37')]=_0x205f7e[_0xcc00('0x37')][_0xcc00('0x3a')]?_0x205f7e[_0xcc00('0x37')]:_0x3b101e['model'];_0x205f7e[_0xcc00('0x3c')]=qs[_0xcc00('0x3d')](_0x1ad5ae[_0xcc00('0x35')]['sort']);_0x205f7e[_0xcc00('0x3e')]=qs[_0xcc00('0x36')](_['pick'](_0x1ad5ae[_0xcc00('0x35')],_0x3b101e['filters']));if(_0x1ad5ae[_0xcc00('0x35')]['filter']){_0x205f7e['where']=_[_0xcc00('0x40')](_0x205f7e[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x2e')](_0x205f7e[_0xcc00('0x37')],function(_0x2acd19){var _0x5770a8={};_0x5770a8[_0x2acd19]={'$like':'%'+_0x1ad5ae['query']['filter']+'%'};return _0x5770a8;})});}_0x205f7e=_[_0xcc00('0x40')]({},_0x205f7e,_0x1ad5ae[_0xcc00('0x4b')]);return _0x4b4842['getFields'](_0x205f7e);}})['then'](function(_0x11d68b){if(_0x11d68b){_0x256b38=_0x11d68b[_0xcc00('0x3a')];if(!_0x1ad5ae[_0xcc00('0x35')][_0xcc00('0x51')](_0xcc00('0x3b'))){_0x205f7e[_0xcc00('0x1f')]=qs[_0xcc00('0x1f')](_0x1ad5ae[_0xcc00('0x35')][_0xcc00('0x1f')]);_0x205f7e['offset']=qs['offset'](_0x1ad5ae['query'][_0xcc00('0x21')]);}return _0x4b4842['getFields'](_0x205f7e);}})[_0xcc00('0x27')](function(_0x547cc6){if(_0x547cc6){return _0x547cc6?{'count':_0x256b38,'rows':_0x547cc6}:null;}})[_0xcc00('0x27')](respondWithResult(_0x2415c8,null))['catch'](handleError(_0x2415c8,null));};exports[_0xcc00('0x52')]=function(_0x272c90,_0x4d3cb3,_0x150839){var _0x317e87={};var _0x319dac={};var _0x42f1af;var _0x3acba6;return db[_0xcc00('0x2f')][_0xcc00('0x4f')]({'where':{'id':_0x272c90[_0xcc00('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d3cb3,null))['then'](function(_0x11c096){if(_0x11c096){_0x42f1af=_0x11c096;_0x319dac[_0xcc00('0x34')]=_[_0xcc00('0x49')](db[_0xcc00('0x50')][_0xcc00('0x30')]);_0x319dac['query']=_[_0xcc00('0x49')](_0x272c90['query']);_0x319dac['filters']=_['intersection'](_0x319dac[_0xcc00('0x34')],_0x319dac[_0xcc00('0x35')]);_0x317e87['attributes']=_['intersection'](_0x319dac[_0xcc00('0x34')],qs['fields'](_0x272c90['query'][_0xcc00('0x39')]));_0x317e87['attributes']=_0x317e87[_0xcc00('0x37')]['length']?_0x317e87['attributes']:_0x319dac[_0xcc00('0x34')];_0x317e87[_0xcc00('0x3c')]=qs['sort'](_0x272c90[_0xcc00('0x35')][_0xcc00('0x3d')]);_0x317e87[_0xcc00('0x3e')]=qs[_0xcc00('0x36')](_[_0xcc00('0x3f')](_0x272c90[_0xcc00('0x35')],_0x319dac[_0xcc00('0x36')]));if(_0x272c90['query']['filter']){_0x317e87[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0x317e87['where'],{'$or':_[_0xcc00('0x2e')](_0x317e87[_0xcc00('0x37')],function(_0x1d4530){var _0x2d5eff={};_0x2d5eff[_0x1d4530]={'$like':'%'+_0x272c90[_0xcc00('0x35')]['filter']+'%'};return _0x2d5eff;})});}_0x317e87=_[_0xcc00('0x40')]({},_0x317e87,_0x272c90[_0xcc00('0x4b')]);return _0x42f1af['getSubjects'](_0x317e87);}})[_0xcc00('0x27')](function(_0x11a23d){if(_0x11a23d){_0x3acba6=_0x11a23d['length'];if(!_0x272c90[_0xcc00('0x35')][_0xcc00('0x51')](_0xcc00('0x3b'))){_0x317e87[_0xcc00('0x1f')]=qs['limit'](_0x272c90[_0xcc00('0x35')][_0xcc00('0x1f')]);_0x317e87['offset']=qs[_0xcc00('0x21')](_0x272c90[_0xcc00('0x35')]['offset']);}return _0x42f1af[_0xcc00('0x52')](_0x317e87);}})[_0xcc00('0x27')](function(_0x4d41c7){if(_0x4d41c7){return _0x4d41c7?{'count':_0x3acba6,'rows':_0x4d41c7}:null;}})['then'](respondWithResult(_0x4d3cb3,null))[_0xcc00('0x46')](handleError(_0x4d3cb3,null));};exports['getDescriptions']=function(_0x2f7b78,_0x4b4531,_0x487dff){var _0xbb5db4={};var _0x550228={};var _0x161285;var _0x29dca1;return db['SalesforceConfiguration'][_0xcc00('0x4f')]({'where':{'id':_0x2f7b78[_0xcc00('0x48')]['id']}})[_0xcc00('0x27')](handleEntityNotFound(_0x4b4531,null))['then'](function(_0x34d5d1){if(_0x34d5d1){_0x161285=_0x34d5d1;_0x550228[_0xcc00('0x34')]=_['keys'](db['SalesforceField'][_0xcc00('0x30')]);_0x550228[_0xcc00('0x35')]=_[_0xcc00('0x49')](_0x2f7b78[_0xcc00('0x35')]);_0x550228[_0xcc00('0x36')]=_[_0xcc00('0x38')](_0x550228[_0xcc00('0x34')],_0x550228['query']);_0xbb5db4['attributes']=_[_0xcc00('0x38')](_0x550228[_0xcc00('0x34')],qs[_0xcc00('0x39')](_0x2f7b78['query'][_0xcc00('0x39')]));_0xbb5db4[_0xcc00('0x37')]=_0xbb5db4[_0xcc00('0x37')][_0xcc00('0x3a')]?_0xbb5db4['attributes']:_0x550228[_0xcc00('0x34')];_0xbb5db4['order']=qs[_0xcc00('0x3d')](_0x2f7b78[_0xcc00('0x35')][_0xcc00('0x3d')]);_0xbb5db4['where']=qs['filters'](_[_0xcc00('0x3f')](_0x2f7b78[_0xcc00('0x35')],_0x550228['filters']));if(_0x2f7b78['query'][_0xcc00('0x42')]){_0xbb5db4[_0xcc00('0x3e')]=_[_0xcc00('0x40')](_0xbb5db4[_0xcc00('0x3e')],{'$or':_[_0xcc00('0x2e')](_0xbb5db4[_0xcc00('0x37')],function(_0x153961){var _0x40eb75={};_0x40eb75[_0x153961]={'$like':'%'+_0x2f7b78[_0xcc00('0x35')]['filter']+'%'};return _0x40eb75;})});}_0xbb5db4=_[_0xcc00('0x40')]({},_0xbb5db4,_0x2f7b78['options']);return _0x161285[_0xcc00('0x53')](_0xbb5db4);}})[_0xcc00('0x27')](function(_0x3af2ef){if(_0x3af2ef){_0x29dca1=_0x3af2ef[_0xcc00('0x3a')];if(!_0x2f7b78['query'][_0xcc00('0x51')](_0xcc00('0x3b'))){_0xbb5db4['limit']=qs[_0xcc00('0x1f')](_0x2f7b78[_0xcc00('0x35')][_0xcc00('0x1f')]);_0xbb5db4[_0xcc00('0x21')]=qs[_0xcc00('0x21')](_0x2f7b78[_0xcc00('0x35')][_0xcc00('0x21')]);}return _0x161285[_0xcc00('0x53')](_0xbb5db4);}})[_0xcc00('0x27')](function(_0x6e684c){if(_0x6e684c){return _0x6e684c?{'count':_0x29dca1,'rows':_0x6e684c}:null;}})[_0xcc00('0x27')](respondWithResult(_0x4b4531,null))['catch'](handleError(_0x4b4531,null));};
\ No newline at end of file
+var _0xff16=['apply','reject','save','then','destroy','stack','name','send','map','SalesforceConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','update','getFields','SalesforceField','order','filter','getSubjects','findOne','pick','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set'];(function(_0x52193c,_0x16ab99){var _0x293ef1=function(_0x37af70){while(--_0x37af70){_0x52193c['push'](_0x52193c['shift']());}};_0x293ef1(++_0x16ab99);}(_0xff16,0x7f));var _0x6ff1=function(_0x1c61c3,_0x140c4c){_0x1c61c3=_0x1c61c3-0x0;var _0x5c2db2=_0xff16[_0x1c61c3];return _0x5c2db2;};'use strict';var emlformat=require(_0x6ff1('0x0'));var rimraf=require(_0x6ff1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ff1('0x2'));var rp=require(_0x6ff1('0x3'));var moment=require(_0x6ff1('0x4'));var BPromise=require(_0x6ff1('0x5'));var Mustache=require(_0x6ff1('0x6'));var util=require(_0x6ff1('0x7'));var path=require(_0x6ff1('0x8'));var sox=require(_0x6ff1('0x9'));var csv=require('to-csv');var ejs=require(_0x6ff1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6ff1('0xb'));var squel=require(_0x6ff1('0xc'));var crypto=require(_0x6ff1('0xd'));var jsforce=require(_0x6ff1('0xe'));var deskjs=require(_0x6ff1('0xf'));var toCsv=require(_0x6ff1('0x10'));var querystring=require(_0x6ff1('0x11'));var Papa=require(_0x6ff1('0x12'));var Redis=require('ioredis');var authService=require(_0x6ff1('0x13'));var qs=require(_0x6ff1('0x14'));var as=require(_0x6ff1('0x15'));var hardwareService=require(_0x6ff1('0x16'));var logger=require(_0x6ff1('0x17'))(_0x6ff1('0x18'));var utils=require(_0x6ff1('0x19'));var config=require(_0x6ff1('0x1a'));var licenseUtil=require(_0x6ff1('0x1b'));var db=require(_0x6ff1('0x1c'))['db'];function respondWithStatusCode(_0x4e8484,_0x5cf649){_0x5cf649=_0x5cf649||0xcc;return function(_0x5dacd6){if(_0x5dacd6){return _0x4e8484['sendStatus'](_0x5cf649);}return _0x4e8484[_0x6ff1('0x1d')](_0x5cf649)[_0x6ff1('0x1e')]();};}function respondWithResult(_0x1451af,_0x543e07){_0x543e07=_0x543e07||0xc8;return function(_0x58952d){if(_0x58952d){return _0x1451af['status'](_0x543e07)[_0x6ff1('0x1f')](_0x58952d);}};}function respondWithFilteredResult(_0x1ec8e9,_0x23112d){return function(_0x29e6c7){if(_0x29e6c7){var _0x36fa15=typeof _0x23112d[_0x6ff1('0x20')]==='undefined'&&typeof _0x23112d[_0x6ff1('0x21')]===_0x6ff1('0x22');var _0x4751b9=_0x29e6c7[_0x6ff1('0x23')];var _0xe5d26e=_0x36fa15?0x0:_0x23112d[_0x6ff1('0x20')];var _0x5041d7=_0x36fa15?_0x29e6c7[_0x6ff1('0x23')]:_0x23112d[_0x6ff1('0x20')]+_0x23112d[_0x6ff1('0x21')];var _0x256457;if(_0x5041d7>=_0x4751b9){_0x5041d7=_0x4751b9;_0x256457=0xc8;}else{_0x256457=0xce;}_0x1ec8e9[_0x6ff1('0x1d')](_0x256457);return _0x1ec8e9[_0x6ff1('0x24')]('Content-Range',_0xe5d26e+'-'+_0x5041d7+'/'+_0x4751b9)[_0x6ff1('0x1f')](_0x29e6c7);}return null;};}function patchUpdates(_0x54c961){return function(_0x328325){try{jsonpatch[_0x6ff1('0x25')](_0x328325,_0x54c961,!![]);}catch(_0x2d3131){return BPromise[_0x6ff1('0x26')](_0x2d3131);}return _0x328325[_0x6ff1('0x27')]();};}function saveUpdates(_0x47fd1f,_0x56027f){return function(_0x561bcd){if(_0x561bcd){return _0x561bcd['update'](_0x47fd1f)[_0x6ff1('0x28')](function(_0xbdd73e){return _0xbdd73e;});}return null;};}function removeEntity(_0x4b3d22,_0x41b160){return function(_0x1ec4f1){if(_0x1ec4f1){return _0x1ec4f1[_0x6ff1('0x29')]()[_0x6ff1('0x28')](function(){_0x4b3d22[_0x6ff1('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13acb3,_0x324645){return function(_0x13ff47){if(!_0x13ff47){_0x13acb3['sendStatus'](0x194);}return _0x13ff47;};}function handleError(_0x512759,_0x17036d){_0x17036d=_0x17036d||0x1f4;return function(_0x2705d4){logger['error'](_0x2705d4[_0x6ff1('0x2a')]);if(_0x2705d4[_0x6ff1('0x2b')]){delete _0x2705d4['name'];}_0x512759[_0x6ff1('0x1d')](_0x17036d)[_0x6ff1('0x2c')](_0x2705d4);};}exports['index']=function(_0x3cc69e,_0x3597c6){var _0x2f7006={},_0x193c09={},_0x4bf689={'count':0x0,'rows':[]};var _0x23df55=_[_0x6ff1('0x2d')](db[_0x6ff1('0x2e')][_0x6ff1('0x2f')],function(_0x224967){return{'name':_0x224967['fieldName'],'type':_0x224967[_0x6ff1('0x30')][_0x6ff1('0x31')]};});_0x193c09[_0x6ff1('0x32')]=_['map'](_0x23df55,_0x6ff1('0x2b'));_0x193c09['query']=_[_0x6ff1('0x33')](_0x3cc69e[_0x6ff1('0x34')]);_0x193c09[_0x6ff1('0x35')]=_[_0x6ff1('0x36')](_0x193c09[_0x6ff1('0x32')],_0x193c09[_0x6ff1('0x34')]);_0x2f7006[_0x6ff1('0x37')]=_['intersection'](_0x193c09['model'],qs[_0x6ff1('0x38')](_0x3cc69e[_0x6ff1('0x34')][_0x6ff1('0x38')]));_0x2f7006[_0x6ff1('0x37')]=_0x2f7006[_0x6ff1('0x37')][_0x6ff1('0x39')]?_0x2f7006['attributes']:_0x193c09[_0x6ff1('0x32')];if(!_0x3cc69e[_0x6ff1('0x34')][_0x6ff1('0x3a')]('nolimit')){_0x2f7006[_0x6ff1('0x21')]=qs['limit'](_0x3cc69e[_0x6ff1('0x34')]['limit']);_0x2f7006[_0x6ff1('0x20')]=qs[_0x6ff1('0x20')](_0x3cc69e['query']['offset']);}_0x2f7006['order']=qs[_0x6ff1('0x3b')](_0x3cc69e[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x2f7006[_0x6ff1('0x3c')]=qs[_0x6ff1('0x35')](_['pick'](_0x3cc69e[_0x6ff1('0x34')],_0x193c09['filters']),_0x23df55);if(_0x3cc69e[_0x6ff1('0x34')]['filter']){_0x2f7006['where']=_[_0x6ff1('0x3d')](_0x2f7006[_0x6ff1('0x3c')],{'$or':_[_0x6ff1('0x2d')](_0x23df55,function(_0x91ddc7){if(_0x91ddc7[_0x6ff1('0x30')]!==_0x6ff1('0x3e')){var _0x4a18cf={};_0x4a18cf[_0x91ddc7[_0x6ff1('0x2b')]]={'$like':'%'+_0x3cc69e[_0x6ff1('0x34')]['filter']+'%'};return _0x4a18cf;}})});}_0x2f7006=_['merge']({},_0x2f7006,_0x3cc69e[_0x6ff1('0x3f')]);var _0x4c41b9={'where':_0x2f7006[_0x6ff1('0x3c')]};return db[_0x6ff1('0x2e')][_0x6ff1('0x23')](_0x4c41b9)[_0x6ff1('0x28')](function(_0x3baaba){_0x4bf689[_0x6ff1('0x23')]=_0x3baaba;if(_0x3cc69e['query'][_0x6ff1('0x40')]){_0x2f7006[_0x6ff1('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2f7006);})['then'](function(_0xc8ae37){_0x4bf689[_0x6ff1('0x42')]=_0xc8ae37;return _0x4bf689;})[_0x6ff1('0x28')](respondWithFilteredResult(_0x3597c6,_0x2f7006))[_0x6ff1('0x43')](handleError(_0x3597c6,null));};exports[_0x6ff1('0x44')]=function(_0x36f9a9,_0x259fbb){var _0x5afce5={'raw':![],'where':{'id':_0x36f9a9[_0x6ff1('0x45')]['id']}},_0x3f76c6={};_0x3f76c6[_0x6ff1('0x32')]=_[_0x6ff1('0x33')](db[_0x6ff1('0x2e')]['rawAttributes']);_0x3f76c6[_0x6ff1('0x34')]=_[_0x6ff1('0x33')](_0x36f9a9[_0x6ff1('0x34')]);_0x3f76c6[_0x6ff1('0x35')]=_[_0x6ff1('0x36')](_0x3f76c6[_0x6ff1('0x32')],_0x3f76c6['query']);_0x5afce5[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0x3f76c6['model'],qs[_0x6ff1('0x38')](_0x36f9a9['query'][_0x6ff1('0x38')]));_0x5afce5[_0x6ff1('0x37')]=_0x5afce5[_0x6ff1('0x37')][_0x6ff1('0x39')]?_0x5afce5['attributes']:_0x3f76c6['model'];if(_0x36f9a9[_0x6ff1('0x34')]['includeAll']){_0x5afce5[_0x6ff1('0x41')]=[{'all':!![]}];}_0x5afce5=_['merge']({},_0x5afce5,_0x36f9a9['options']);return db[_0x6ff1('0x2e')][_0x6ff1('0x46')](_0x5afce5)[_0x6ff1('0x28')](handleEntityNotFound(_0x259fbb,null))[_0x6ff1('0x28')](respondWithResult(_0x259fbb,null))['catch'](handleError(_0x259fbb,null));};exports[_0x6ff1('0x47')]=function(_0x59a001,_0x5d500b){return db[_0x6ff1('0x2e')][_0x6ff1('0x47')](_0x59a001[_0x6ff1('0x48')],{})[_0x6ff1('0x28')](respondWithResult(_0x5d500b,0xc9))[_0x6ff1('0x43')](handleError(_0x5d500b,null));};exports[_0x6ff1('0x49')]=function(_0x5b0e81,_0x143492){if(_0x5b0e81['body']['id']){delete _0x5b0e81[_0x6ff1('0x48')]['id'];}return db[_0x6ff1('0x2e')][_0x6ff1('0x46')]({'where':{'id':_0x5b0e81[_0x6ff1('0x45')]['id']}})['then'](handleEntityNotFound(_0x143492,null))['then'](saveUpdates(_0x5b0e81['body'],null))[_0x6ff1('0x28')](respondWithResult(_0x143492,null))[_0x6ff1('0x43')](handleError(_0x143492,null));};exports[_0x6ff1('0x29')]=function(_0x44271d,_0x1521c8){return db[_0x6ff1('0x2e')]['find']({'where':{'id':_0x44271d['params']['id']}})['then'](handleEntityNotFound(_0x1521c8,null))[_0x6ff1('0x28')](removeEntity(_0x1521c8,null))[_0x6ff1('0x43')](handleError(_0x1521c8,null));};exports[_0x6ff1('0x4a')]=function(_0x880490,_0x5947a7,_0x2275ff){var _0x40a53a={};var _0x33a32f={};var _0x5cec60;var _0x2b62d6;return db[_0x6ff1('0x2e')]['findOne']({'where':{'id':_0x880490[_0x6ff1('0x45')]['id']}})[_0x6ff1('0x28')](handleEntityNotFound(_0x5947a7,null))['then'](function(_0x124653){if(_0x124653){_0x5cec60=_0x124653;_0x33a32f['model']=_[_0x6ff1('0x33')](db[_0x6ff1('0x4b')]['rawAttributes']);_0x33a32f['query']=_[_0x6ff1('0x33')](_0x880490[_0x6ff1('0x34')]);_0x33a32f['filters']=_[_0x6ff1('0x36')](_0x33a32f['model'],_0x33a32f[_0x6ff1('0x34')]);_0x40a53a[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0x33a32f['model'],qs[_0x6ff1('0x38')](_0x880490[_0x6ff1('0x34')][_0x6ff1('0x38')]));_0x40a53a[_0x6ff1('0x37')]=_0x40a53a[_0x6ff1('0x37')]['length']?_0x40a53a[_0x6ff1('0x37')]:_0x33a32f[_0x6ff1('0x32')];_0x40a53a[_0x6ff1('0x4c')]=qs[_0x6ff1('0x3b')](_0x880490[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x40a53a['where']=qs['filters'](_['pick'](_0x880490['query'],_0x33a32f[_0x6ff1('0x35')]));if(_0x880490[_0x6ff1('0x34')][_0x6ff1('0x4d')]){_0x40a53a[_0x6ff1('0x3c')]=_['merge'](_0x40a53a['where'],{'$or':_[_0x6ff1('0x2d')](_0x40a53a[_0x6ff1('0x37')],function(_0x5fb5d5){var _0x3bc400={};_0x3bc400[_0x5fb5d5]={'$like':'%'+_0x880490[_0x6ff1('0x34')][_0x6ff1('0x4d')]+'%'};return _0x3bc400;})});}_0x40a53a=_[_0x6ff1('0x3d')]({},_0x40a53a,_0x880490['options']);return _0x5cec60[_0x6ff1('0x4a')](_0x40a53a);}})['then'](function(_0x21e621){if(_0x21e621){_0x2b62d6=_0x21e621[_0x6ff1('0x39')];if(!_0x880490['query'][_0x6ff1('0x3a')]('nolimit')){_0x40a53a[_0x6ff1('0x21')]=qs[_0x6ff1('0x21')](_0x880490[_0x6ff1('0x34')]['limit']);_0x40a53a[_0x6ff1('0x20')]=qs[_0x6ff1('0x20')](_0x880490[_0x6ff1('0x34')][_0x6ff1('0x20')]);}return _0x5cec60[_0x6ff1('0x4a')](_0x40a53a);}})[_0x6ff1('0x28')](function(_0x2d2d41){if(_0x2d2d41){return _0x2d2d41?{'count':_0x2b62d6,'rows':_0x2d2d41}:null;}})[_0x6ff1('0x28')](respondWithResult(_0x5947a7,null))['catch'](handleError(_0x5947a7,null));};exports[_0x6ff1('0x4e')]=function(_0x2cd1f9,_0x40b24e,_0xa4fe61){var _0x3b2ac1={};var _0xcdbb07={};var _0x38d32e;var _0x1b78ee;return db[_0x6ff1('0x2e')][_0x6ff1('0x4f')]({'where':{'id':_0x2cd1f9['params']['id']}})[_0x6ff1('0x28')](handleEntityNotFound(_0x40b24e,null))['then'](function(_0x12252a){if(_0x12252a){_0x38d32e=_0x12252a;_0xcdbb07[_0x6ff1('0x32')]=_['keys'](db['SalesforceField'][_0x6ff1('0x2f')]);_0xcdbb07[_0x6ff1('0x34')]=_[_0x6ff1('0x33')](_0x2cd1f9[_0x6ff1('0x34')]);_0xcdbb07[_0x6ff1('0x35')]=_[_0x6ff1('0x36')](_0xcdbb07[_0x6ff1('0x32')],_0xcdbb07[_0x6ff1('0x34')]);_0x3b2ac1[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0xcdbb07[_0x6ff1('0x32')],qs[_0x6ff1('0x38')](_0x2cd1f9['query'][_0x6ff1('0x38')]));_0x3b2ac1[_0x6ff1('0x37')]=_0x3b2ac1['attributes']['length']?_0x3b2ac1[_0x6ff1('0x37')]:_0xcdbb07['model'];_0x3b2ac1[_0x6ff1('0x4c')]=qs[_0x6ff1('0x3b')](_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x3b2ac1[_0x6ff1('0x3c')]=qs['filters'](_[_0x6ff1('0x50')](_0x2cd1f9[_0x6ff1('0x34')],_0xcdbb07[_0x6ff1('0x35')]));if(_0x2cd1f9['query'][_0x6ff1('0x4d')]){_0x3b2ac1['where']=_[_0x6ff1('0x3d')](_0x3b2ac1[_0x6ff1('0x3c')],{'$or':_['map'](_0x3b2ac1[_0x6ff1('0x37')],function(_0x1a9ff5){var _0x225aa0={};_0x225aa0[_0x1a9ff5]={'$like':'%'+_0x2cd1f9['query'][_0x6ff1('0x4d')]+'%'};return _0x225aa0;})});}_0x3b2ac1=_[_0x6ff1('0x3d')]({},_0x3b2ac1,_0x2cd1f9[_0x6ff1('0x3f')]);return _0x38d32e[_0x6ff1('0x4e')](_0x3b2ac1);}})[_0x6ff1('0x28')](function(_0x53c625){if(_0x53c625){_0x1b78ee=_0x53c625[_0x6ff1('0x39')];if(!_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x3a')]('nolimit')){_0x3b2ac1[_0x6ff1('0x21')]=qs[_0x6ff1('0x21')](_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x21')]);_0x3b2ac1[_0x6ff1('0x20')]=qs['offset'](_0x2cd1f9[_0x6ff1('0x34')][_0x6ff1('0x20')]);}return _0x38d32e[_0x6ff1('0x4e')](_0x3b2ac1);}})[_0x6ff1('0x28')](function(_0x4b2473){if(_0x4b2473){return _0x4b2473?{'count':_0x1b78ee,'rows':_0x4b2473}:null;}})[_0x6ff1('0x28')](respondWithResult(_0x40b24e,null))['catch'](handleError(_0x40b24e,null));};exports[_0x6ff1('0x51')]=function(_0x5103e3,_0x3ab05b,_0x2661ed){var _0x157db7={};var _0x4d6f81={};var _0x7ded5c;var _0x473db3;return db[_0x6ff1('0x2e')][_0x6ff1('0x4f')]({'where':{'id':_0x5103e3[_0x6ff1('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ab05b,null))[_0x6ff1('0x28')](function(_0x518d65){if(_0x518d65){_0x7ded5c=_0x518d65;_0x4d6f81[_0x6ff1('0x32')]=_[_0x6ff1('0x33')](db['SalesforceField'][_0x6ff1('0x2f')]);_0x4d6f81[_0x6ff1('0x34')]=_[_0x6ff1('0x33')](_0x5103e3[_0x6ff1('0x34')]);_0x4d6f81['filters']=_[_0x6ff1('0x36')](_0x4d6f81[_0x6ff1('0x32')],_0x4d6f81['query']);_0x157db7[_0x6ff1('0x37')]=_[_0x6ff1('0x36')](_0x4d6f81[_0x6ff1('0x32')],qs[_0x6ff1('0x38')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x38')]));_0x157db7[_0x6ff1('0x37')]=_0x157db7[_0x6ff1('0x37')][_0x6ff1('0x39')]?_0x157db7[_0x6ff1('0x37')]:_0x4d6f81[_0x6ff1('0x32')];_0x157db7[_0x6ff1('0x4c')]=qs[_0x6ff1('0x3b')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x3b')]);_0x157db7[_0x6ff1('0x3c')]=qs[_0x6ff1('0x35')](_[_0x6ff1('0x50')](_0x5103e3[_0x6ff1('0x34')],_0x4d6f81['filters']));if(_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x4d')]){_0x157db7[_0x6ff1('0x3c')]=_[_0x6ff1('0x3d')](_0x157db7[_0x6ff1('0x3c')],{'$or':_[_0x6ff1('0x2d')](_0x157db7[_0x6ff1('0x37')],function(_0x1c47a5){var _0x6c22d={};_0x6c22d[_0x1c47a5]={'$like':'%'+_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x4d')]+'%'};return _0x6c22d;})});}_0x157db7=_[_0x6ff1('0x3d')]({},_0x157db7,_0x5103e3[_0x6ff1('0x3f')]);return _0x7ded5c['getDescriptions'](_0x157db7);}})[_0x6ff1('0x28')](function(_0x3c8e1e){if(_0x3c8e1e){_0x473db3=_0x3c8e1e[_0x6ff1('0x39')];if(!_0x5103e3['query'][_0x6ff1('0x3a')]('nolimit')){_0x157db7[_0x6ff1('0x21')]=qs[_0x6ff1('0x21')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x21')]);_0x157db7[_0x6ff1('0x20')]=qs[_0x6ff1('0x20')](_0x5103e3[_0x6ff1('0x34')][_0x6ff1('0x20')]);}return _0x7ded5c['getDescriptions'](_0x157db7);}})['then'](function(_0x533312){if(_0x533312){return _0x533312?{'count':_0x473db3,'rows':_0x533312}:null;}})[_0x6ff1('0x28')](respondWithResult(_0x3ab05b,null))[_0x6ff1('0x43')](handleError(_0x3ab05b,null));};
\ No newline at end of file
index 7694ee2..3910033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x528c=['rimraf','../../config/environment','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1df0a6,_0x1d1a95){var _0x139016=function(_0x574201){while(--_0x574201){_0x1df0a6['push'](_0x1df0a6['shift']());}};_0x139016(++_0x1d1a95);}(_0x528c,0x195));var _0xc528=function(_0x40b90d,_0x6d00df){_0x40b90d=_0x40b90d-0x0;var _0x1f9418=_0x528c[_0x40b90d];return _0x1f9418;};'use strict';var _=require('lodash');var util=require(_0xc528('0x0'));var logger=require(_0xc528('0x1'))(_0xc528('0x2'));var moment=require('moment');var BPromise=require(_0xc528('0x3'));var rp=require(_0xc528('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc528('0x5'));var config=require(_0xc528('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module['exports']=function(_0x456a87,_0x438577){return _0x456a87[_0xc528('0x7')](_0xc528('0x8'),attributes,{'tableName':_0xc528('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7722=['../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c0db0,_0x46ed38){var _0x5690fa=function(_0x4783db){while(--_0x4783db){_0x4c0db0['push'](_0x4c0db0['shift']());}};_0x5690fa(++_0x46ed38);}(_0x7722,0x125));var _0x2772=function(_0x23e8d1,_0x1dd2ed){_0x23e8d1=_0x23e8d1-0x0;var _0x5a5384=_0x7722[_0x23e8d1];return _0x5a5384;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2772('0x0'))(_0x2772('0x1'));var moment=require(_0x2772('0x2'));var BPromise=require(_0x2772('0x3'));var rp=require(_0x2772('0x4'));var fs=require('fs');var path=require(_0x2772('0x5'));var rimraf=require(_0x2772('0x6'));var config=require(_0x2772('0x7'));var attributes=require(_0x2772('0x8'));module['exports']=function(_0x1b1f71,_0x25c906){return _0x1b1f71['define'](_0x2772('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f1c99f..a1c3f63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ff=['message','result','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1788f8,_0x23c27b){var _0x409e03=function(_0x25f4d2){while(--_0x25f4d2){_0x1788f8['push'](_0x1788f8['shift']());}};_0x409e03(++_0x23c27b);}(_0x69ff,0x16a));var _0xf69f=function(_0x2c2d7d,_0x1c7dac){_0x2c2d7d=_0x2c2d7d-0x0;var _0x26f421=_0x69ff[_0x2c2d7d];return _0x26f421;};'use strict';var _=require('lodash');var util=require(_0xf69f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf69f('0x1'));var fs=require('fs');var Redis=require(_0xf69f('0x2'));var db=require(_0xf69f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69f('0x4'))(_0xf69f('0x5'));var config=require(_0xf69f('0x6'));var jayson=require(_0xf69f('0x7'));var client=jayson[_0xf69f('0x8')][_0xf69f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb062b,_0x37f37b,_0x45ebb2){return new BPromise(function(_0x489504,_0x5aae8c){return client['request'](_0xb062b,_0x45ebb2)[_0xf69f('0xa')](function(_0xca32d1){logger[_0xf69f('0xb')](_0xf69f('0xc'),_0x37f37b,_0xf69f('0xd'));logger[_0xf69f('0xe')](_0xf69f('0xf'),_0x37f37b,_0xf69f('0xd'),JSON[_0xf69f('0x10')](_0xca32d1));if(_0xca32d1[_0xf69f('0x11')]){if(_0xca32d1[_0xf69f('0x11')]['code']===0x1f4){logger[_0xf69f('0x11')](_0xf69f('0xc'),_0x37f37b,_0xca32d1[_0xf69f('0x11')][_0xf69f('0x12')]);return _0x5aae8c(_0xca32d1[_0xf69f('0x11')][_0xf69f('0x12')]);}logger[_0xf69f('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x37f37b,_0xca32d1[_0xf69f('0x11')][_0xf69f('0x12')]);return _0x489504(_0xca32d1['error'][_0xf69f('0x12')]);}else{logger[_0xf69f('0xb')](_0xf69f('0xc'),_0x37f37b,'request\x20sent');_0x489504(_0xca32d1[_0xf69f('0x13')][_0xf69f('0x12')]);}})['catch'](function(_0x7f93ab){logger[_0xf69f('0x11')](_0xf69f('0xc'),_0x37f37b,_0x7f93ab);_0x5aae8c(_0x7f93ab);});});}
\ No newline at end of file
+var _0xe6a1=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x35237e,_0x5bc6fc){var _0x509a04=function(_0x5d34fd){while(--_0x5d34fd){_0x35237e['push'](_0x35237e['shift']());}};_0x509a04(++_0x5bc6fc);}(_0xe6a1,0x1b8));var _0x1e6a=function(_0x2093d9,_0x5c8113){_0x2093d9=_0x2093d9-0x0;var _0x3404e8=_0xe6a1[_0x2093d9];return _0x3404e8;};'use strict';var _=require('lodash');var util=require(_0x1e6a('0x0'));var moment=require(_0x1e6a('0x1'));var BPromise=require(_0x1e6a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e6a('0x3'))['db'];var utils=require(_0x1e6a('0x4'));var logger=require(_0x1e6a('0x5'))(_0x1e6a('0x6'));var config=require(_0x1e6a('0x7'));var jayson=require(_0x1e6a('0x8'));var client=jayson['client'][_0x1e6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c96a,_0x438702,_0x34bd01){return new BPromise(function(_0xf01210,_0x50985c){return client[_0x1e6a('0xa')](_0x19c96a,_0x34bd01)[_0x1e6a('0xb')](function(_0x2d20ca){logger[_0x1e6a('0xc')](_0x1e6a('0xd'),_0x438702,_0x1e6a('0xe'));logger[_0x1e6a('0xf')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x438702,'request\x20sent',JSON[_0x1e6a('0x10')](_0x2d20ca));if(_0x2d20ca[_0x1e6a('0x11')]){if(_0x2d20ca[_0x1e6a('0x11')][_0x1e6a('0x12')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x438702,_0x2d20ca['error'][_0x1e6a('0x13')]);return _0x50985c(_0x2d20ca[_0x1e6a('0x11')][_0x1e6a('0x13')]);}logger[_0x1e6a('0x11')](_0x1e6a('0xd'),_0x438702,_0x2d20ca[_0x1e6a('0x11')][_0x1e6a('0x13')]);return _0xf01210(_0x2d20ca[_0x1e6a('0x11')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x438702,'request\x20sent');_0xf01210(_0x2d20ca[_0x1e6a('0x14')][_0x1e6a('0x13')]);}})[_0x1e6a('0x15')](function(_0x24908c){logger[_0x1e6a('0x11')](_0x1e6a('0xd'),_0x438702,_0x24908c);_0x50985c(_0x24908c);});});}
\ No newline at end of file
index f877ac6..d945f78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41fb=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x408849,_0x11e717){var _0x1affdb=function(_0x15472e){while(--_0x15472e){_0x408849['push'](_0x408849['shift']());}};_0x1affdb(++_0x11e717);}(_0x41fb,0x1c8));var _0xb41f=function(_0x156081,_0x2f44ce){_0x156081=_0x156081-0x0;var _0x1c35b3=_0x41fb[_0x156081];return _0x1c35b3;};'use strict';var multer=require(_0xb41f('0x0'));var util=require(_0xb41f('0x1'));var path=require(_0xb41f('0x2'));var timeout=require(_0xb41f('0x3'));var express=require(_0xb41f('0x4'));var router=express[_0xb41f('0x5')]();var fs_extra=require(_0xb41f('0x6'));var auth=require(_0xb41f('0x7'));var interaction=require(_0xb41f('0x8'));var config=require(_0xb41f('0x9'));var controller=require('./intSalesforceField.controller');router[_0xb41f('0xa')]('/',auth['isAuthenticated'](),controller[_0xb41f('0xb')]);router[_0xb41f('0xa')](_0xb41f('0xc'),auth[_0xb41f('0xd')](),controller[_0xb41f('0xe')]);router[_0xb41f('0xf')]('/',auth[_0xb41f('0xd')](),controller[_0xb41f('0x10')]);router[_0xb41f('0x11')](_0xb41f('0xc'),auth[_0xb41f('0xd')](),controller['update']);router[_0xb41f('0x12')](_0xb41f('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb41f('0x13')]=router;
\ No newline at end of file
+var _0x6407=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x34fe6d,_0x1e08ba){var _0x3e0568=function(_0x1de6a3){while(--_0x1de6a3){_0x34fe6d['push'](_0x34fe6d['shift']());}};_0x3e0568(++_0x1e08ba);}(_0x6407,0x1a5));var _0x7640=function(_0x13f5d1,_0x12e3f7){_0x13f5d1=_0x13f5d1-0x0;var _0x5621f3=_0x6407[_0x13f5d1];return _0x5621f3;};'use strict';var multer=require(_0x7640('0x0'));var util=require('util');var path=require(_0x7640('0x1'));var timeout=require(_0x7640('0x2'));var express=require(_0x7640('0x3'));var router=express['Router']();var fs_extra=require(_0x7640('0x4'));var auth=require(_0x7640('0x5'));var interaction=require(_0x7640('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x7640('0x7')]('/',auth[_0x7640('0x8')](),controller[_0x7640('0x9')]);router[_0x7640('0x7')](_0x7640('0xa'),auth[_0x7640('0x8')](),controller[_0x7640('0xb')]);router[_0x7640('0xc')]('/',auth['isAuthenticated'](),controller[_0x7640('0xd')]);router[_0x7640('0xe')](_0x7640('0xa'),auth[_0x7640('0x8')](),controller['update']);router[_0x7640('0xf')](_0x7640('0xa'),auth[_0x7640('0x8')](),controller[_0x7640('0x10')]);module[_0x7640('0x11')]=router;
\ No newline at end of file
index e237713..ab41f76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8113=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x487e21,_0x4bc6ed){var _0x8906b7=function(_0x53375e){while(--_0x53375e){_0x487e21['push'](_0x487e21['shift']());}};_0x8906b7(++_0x4bc6ed);}(_0x8113,0x159));var _0x3811=function(_0x115997,_0x5f4b2){_0x115997=_0x115997-0x0;var _0x120e18=_0x8113[_0x115997];return _0x120e18;};'use strict';var Sequelize=require(_0x3811('0x0'));module['exports']={'type':{'type':Sequelize[_0x3811('0x1')](_0x3811('0x2'),_0x3811('0x3'),_0x3811('0x4'),_0x3811('0x5'),_0x3811('0x6')),'defaultValue':_0x3811('0x2')},'content':{'type':Sequelize[_0x3811('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x3811('0x3'),_0x3811('0x4'))},'keyContent':{'type':Sequelize[_0x3811('0x7')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x3811('0x7')]}};
\ No newline at end of file
+var _0x41f7=['STRING','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x2ea2d9,_0x4b76cb){var _0x3e5448=function(_0x16433c){while(--_0x16433c){_0x2ea2d9['push'](_0x2ea2d9['shift']());}};_0x3e5448(++_0x4b76cb);}(_0x41f7,0x14b));var _0x741f=function(_0x3c10d6,_0x2c26d2){_0x3c10d6=_0x3c10d6-0x0;var _0x395015=_0x41f7[_0x3c10d6];return _0x395015;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x741f('0x0'),_0x741f('0x1'),_0x741f('0x2'),_0x741f('0x3'),_0x741f('0x4')),'defaultValue':_0x741f('0x0')},'content':{'type':Sequelize[_0x741f('0x5')]},'key':{'type':Sequelize[_0x741f('0x5')]},'keyType':{'type':Sequelize[_0x741f('0x6')](_0x741f('0x0'),_0x741f('0x1'),_0x741f('0x2'))},'keyContent':{'type':Sequelize[_0x741f('0x5')]},'idField':{'type':Sequelize[_0x741f('0x5')]},'variableName':{'type':Sequelize[_0x741f('0x5')]}};
\ No newline at end of file
index 8bc04fc..f956e71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a90=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','SalesforceField','includeAll','include','findAll','rows','catch','show','params'];(function(_0x5676bc,_0x19c7b0){var _0x3ad6ac=function(_0x69aed8){while(--_0x69aed8){_0x5676bc['push'](_0x5676bc['shift']());}};_0x3ad6ac(++_0x19c7b0);}(_0x7a90,0x143));var _0x07a9=function(_0x4b2b88,_0x51f6c0){_0x4b2b88=_0x4b2b88-0x0;var _0x1558bb=_0x7a90[_0x4b2b88];return _0x1558bb;};'use strict';var emlformat=require(_0x07a9('0x0'));var rimraf=require(_0x07a9('0x1'));var zipdir=require(_0x07a9('0x2'));var jsonpatch=require(_0x07a9('0x3'));var rp=require(_0x07a9('0x4'));var moment=require(_0x07a9('0x5'));var BPromise=require(_0x07a9('0x6'));var Mustache=require('mustache');var util=require(_0x07a9('0x7'));var path=require(_0x07a9('0x8'));var sox=require(_0x07a9('0x9'));var csv=require('to-csv');var ejs=require(_0x07a9('0xa'));var fs=require('fs');var fs_extra=require(_0x07a9('0xb'));var _=require(_0x07a9('0xc'));var squel=require(_0x07a9('0xd'));var crypto=require(_0x07a9('0xe'));var jsforce=require(_0x07a9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07a9('0x10'));var querystring=require(_0x07a9('0x11'));var Papa=require(_0x07a9('0x12'));var Redis=require(_0x07a9('0x13'));var authService=require(_0x07a9('0x14'));var qs=require(_0x07a9('0x15'));var as=require(_0x07a9('0x16'));var hardwareService=require(_0x07a9('0x17'));var logger=require(_0x07a9('0x18'))(_0x07a9('0x19'));var utils=require(_0x07a9('0x1a'));var config=require(_0x07a9('0x1b'));var licenseUtil=require(_0x07a9('0x1c'));var db=require(_0x07a9('0x1d'))['db'];function respondWithStatusCode(_0x2d5c69,_0x6f48b8){_0x6f48b8=_0x6f48b8||0xcc;return function(_0x1daaf1){if(_0x1daaf1){return _0x2d5c69[_0x07a9('0x1e')](_0x6f48b8);}return _0x2d5c69[_0x07a9('0x1f')](_0x6f48b8)[_0x07a9('0x20')]();};}function respondWithResult(_0x3074ad,_0x41b00f){_0x41b00f=_0x41b00f||0xc8;return function(_0xf77a4){if(_0xf77a4){return _0x3074ad[_0x07a9('0x1f')](_0x41b00f)[_0x07a9('0x21')](_0xf77a4);}};}function respondWithFilteredResult(_0x78c2dc,_0x198756){return function(_0x1c43fd){if(_0x1c43fd){var _0x1e0b8c=typeof _0x198756['offset']===_0x07a9('0x22')&&typeof _0x198756[_0x07a9('0x23')]===_0x07a9('0x22');var _0x5ddabe=_0x1c43fd[_0x07a9('0x24')];var _0x3ecb85=_0x1e0b8c?0x0:_0x198756[_0x07a9('0x25')];var _0x2cf210=_0x1e0b8c?_0x1c43fd[_0x07a9('0x24')]:_0x198756[_0x07a9('0x25')]+_0x198756[_0x07a9('0x23')];var _0xb0beaa;if(_0x2cf210>=_0x5ddabe){_0x2cf210=_0x5ddabe;_0xb0beaa=0xc8;}else{_0xb0beaa=0xce;}_0x78c2dc[_0x07a9('0x1f')](_0xb0beaa);return _0x78c2dc[_0x07a9('0x26')](_0x07a9('0x27'),_0x3ecb85+'-'+_0x2cf210+'/'+_0x5ddabe)[_0x07a9('0x21')](_0x1c43fd);}return null;};}function patchUpdates(_0x12ee3a){return function(_0x3365d2){try{jsonpatch[_0x07a9('0x28')](_0x3365d2,_0x12ee3a,!![]);}catch(_0x1f11f0){return BPromise['reject'](_0x1f11f0);}return _0x3365d2['save']();};}function saveUpdates(_0x1eabef,_0x220728){return function(_0x55bad2){if(_0x55bad2){return _0x55bad2[_0x07a9('0x29')](_0x1eabef)[_0x07a9('0x2a')](function(_0x338407){return _0x338407;});}return null;};}function removeEntity(_0x51f4f8,_0x1920b9){return function(_0x2369ac){if(_0x2369ac){return _0x2369ac[_0x07a9('0x2b')]()[_0x07a9('0x2a')](function(){_0x51f4f8[_0x07a9('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50614c,_0x355006){return function(_0x3fddc0){if(!_0x3fddc0){_0x50614c[_0x07a9('0x1e')](0x194);}return _0x3fddc0;};}function handleError(_0x427380,_0x584f07){_0x584f07=_0x584f07||0x1f4;return function(_0x332585){logger[_0x07a9('0x2c')](_0x332585[_0x07a9('0x2d')]);if(_0x332585[_0x07a9('0x2e')]){delete _0x332585[_0x07a9('0x2e')];}_0x427380['status'](_0x584f07)['send'](_0x332585);};}exports[_0x07a9('0x2f')]=function(_0x460051,_0x465931){var _0x53af7a={},_0x5edd69={},_0x529670={'count':0x0,'rows':[]};var _0x3b24a3=_[_0x07a9('0x30')](db['SalesforceField'][_0x07a9('0x31')],function(_0x417432){return{'name':_0x417432[_0x07a9('0x32')],'type':_0x417432[_0x07a9('0x33')][_0x07a9('0x34')]};});_0x5edd69[_0x07a9('0x35')]=_[_0x07a9('0x30')](_0x3b24a3,_0x07a9('0x2e'));_0x5edd69[_0x07a9('0x36')]=_[_0x07a9('0x37')](_0x460051[_0x07a9('0x36')]);_0x5edd69[_0x07a9('0x38')]=_[_0x07a9('0x39')](_0x5edd69['model'],_0x5edd69['query']);_0x53af7a[_0x07a9('0x3a')]=_[_0x07a9('0x39')](_0x5edd69['model'],qs[_0x07a9('0x3b')](_0x460051[_0x07a9('0x36')][_0x07a9('0x3b')]));_0x53af7a[_0x07a9('0x3a')]=_0x53af7a[_0x07a9('0x3a')][_0x07a9('0x3c')]?_0x53af7a[_0x07a9('0x3a')]:_0x5edd69['model'];if(!_0x460051[_0x07a9('0x36')][_0x07a9('0x3d')](_0x07a9('0x3e'))){_0x53af7a[_0x07a9('0x23')]=qs[_0x07a9('0x23')](_0x460051[_0x07a9('0x36')]['limit']);_0x53af7a['offset']=qs['offset'](_0x460051['query'][_0x07a9('0x25')]);}_0x53af7a['order']=qs[_0x07a9('0x3f')](_0x460051[_0x07a9('0x36')][_0x07a9('0x3f')]);_0x53af7a[_0x07a9('0x40')]=qs[_0x07a9('0x38')](_[_0x07a9('0x41')](_0x460051['query'],_0x5edd69['filters']),_0x3b24a3);if(_0x460051[_0x07a9('0x36')][_0x07a9('0x42')]){_0x53af7a['where']=_[_0x07a9('0x43')](_0x53af7a[_0x07a9('0x40')],{'$or':_[_0x07a9('0x30')](_0x3b24a3,function(_0x13fda2){if(_0x13fda2[_0x07a9('0x33')]!=='VIRTUAL'){var _0x34d474={};_0x34d474[_0x13fda2[_0x07a9('0x2e')]]={'$like':'%'+_0x460051[_0x07a9('0x36')][_0x07a9('0x42')]+'%'};return _0x34d474;}})});}_0x53af7a=_[_0x07a9('0x43')]({},_0x53af7a,_0x460051[_0x07a9('0x44')]);var _0x2f433c={'where':_0x53af7a['where']};return db[_0x07a9('0x45')][_0x07a9('0x24')](_0x2f433c)[_0x07a9('0x2a')](function(_0x3cc1a2){_0x529670[_0x07a9('0x24')]=_0x3cc1a2;if(_0x460051['query'][_0x07a9('0x46')]){_0x53af7a[_0x07a9('0x47')]=[{'all':!![]}];}return db['SalesforceField'][_0x07a9('0x48')](_0x53af7a);})[_0x07a9('0x2a')](function(_0x72bda){_0x529670[_0x07a9('0x49')]=_0x72bda;return _0x529670;})[_0x07a9('0x2a')](respondWithFilteredResult(_0x465931,_0x53af7a))[_0x07a9('0x4a')](handleError(_0x465931,null));};exports[_0x07a9('0x4b')]=function(_0x2800b0,_0x2d025c){var _0x39ea44={'raw':!![],'where':{'id':_0x2800b0[_0x07a9('0x4c')]['id']}},_0x46ad31={};_0x46ad31['model']=_[_0x07a9('0x37')](db['SalesforceField'][_0x07a9('0x31')]);_0x46ad31['query']=_[_0x07a9('0x37')](_0x2800b0['query']);_0x46ad31[_0x07a9('0x38')]=_[_0x07a9('0x39')](_0x46ad31[_0x07a9('0x35')],_0x46ad31[_0x07a9('0x36')]);_0x39ea44[_0x07a9('0x3a')]=_['intersection'](_0x46ad31[_0x07a9('0x35')],qs[_0x07a9('0x3b')](_0x2800b0[_0x07a9('0x36')][_0x07a9('0x3b')]));_0x39ea44[_0x07a9('0x3a')]=_0x39ea44[_0x07a9('0x3a')][_0x07a9('0x3c')]?_0x39ea44[_0x07a9('0x3a')]:_0x46ad31[_0x07a9('0x35')];if(_0x2800b0[_0x07a9('0x36')][_0x07a9('0x46')]){_0x39ea44[_0x07a9('0x47')]=[{'all':!![]}];}_0x39ea44=_['merge']({},_0x39ea44,_0x2800b0[_0x07a9('0x44')]);return db[_0x07a9('0x45')][_0x07a9('0x4d')](_0x39ea44)[_0x07a9('0x2a')](handleEntityNotFound(_0x2d025c,null))[_0x07a9('0x2a')](respondWithResult(_0x2d025c,null))[_0x07a9('0x4a')](handleError(_0x2d025c,null));};exports['create']=function(_0x4982f5,_0x1af80c){return db['SalesforceField'][_0x07a9('0x4e')](_0x4982f5[_0x07a9('0x4f')],{})[_0x07a9('0x2a')](respondWithResult(_0x1af80c,0xc9))[_0x07a9('0x4a')](handleError(_0x1af80c,null));};exports[_0x07a9('0x29')]=function(_0x434faf,_0x269857){if(_0x434faf[_0x07a9('0x4f')]['id']){delete _0x434faf[_0x07a9('0x4f')]['id'];}return db[_0x07a9('0x45')]['find']({'where':{'id':_0x434faf[_0x07a9('0x4c')]['id']}})[_0x07a9('0x2a')](handleEntityNotFound(_0x269857,null))[_0x07a9('0x2a')](saveUpdates(_0x434faf[_0x07a9('0x4f')],null))[_0x07a9('0x2a')](respondWithResult(_0x269857,null))['catch'](handleError(_0x269857,null));};exports[_0x07a9('0x2b')]=function(_0x4b9c01,_0x590e95){return db[_0x07a9('0x45')]['find']({'where':{'id':_0x4b9c01['params']['id']}})[_0x07a9('0x2a')](handleEntityNotFound(_0x590e95,null))[_0x07a9('0x2a')](removeEntity(_0x590e95,null))['catch'](handleError(_0x590e95,null));};
\ No newline at end of file
+var _0x18b8=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','status','error','stack','name','send','map','SalesforceField','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','findAll','catch','show','rawAttributes','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count'];(function(_0x5b2263,_0x2df183){var _0x487cbe=function(_0x5240ff){while(--_0x5240ff){_0x5b2263['push'](_0x5b2263['shift']());}};_0x487cbe(++_0x2df183);}(_0x18b8,0x189));var _0x818b=function(_0x26f0c7,_0x18bbe3){_0x26f0c7=_0x26f0c7-0x0;var _0xd33206=_0x18b8[_0x26f0c7];return _0xd33206;};'use strict';var emlformat=require(_0x818b('0x0'));var rimraf=require(_0x818b('0x1'));var zipdir=require(_0x818b('0x2'));var jsonpatch=require(_0x818b('0x3'));var rp=require(_0x818b('0x4'));var moment=require(_0x818b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x818b('0x6'));var util=require(_0x818b('0x7'));var path=require('path');var sox=require(_0x818b('0x8'));var csv=require(_0x818b('0x9'));var ejs=require(_0x818b('0xa'));var fs=require('fs');var fs_extra=require(_0x818b('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x818b('0xc'));var jsforce=require(_0x818b('0xd'));var deskjs=require(_0x818b('0xe'));var toCsv=require(_0x818b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x818b('0xf'));var authService=require(_0x818b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x818b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x818b('0x12'))(_0x818b('0x13'));var utils=require(_0x818b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x818b('0x15'));var db=require(_0x818b('0x16'))['db'];function respondWithStatusCode(_0x4c02c9,_0x1bed92){_0x1bed92=_0x1bed92||0xcc;return function(_0x52470f){if(_0x52470f){return _0x4c02c9[_0x818b('0x17')](_0x1bed92);}return _0x4c02c9['status'](_0x1bed92)[_0x818b('0x18')]();};}function respondWithResult(_0xf5de4b,_0x11d5dd){_0x11d5dd=_0x11d5dd||0xc8;return function(_0x391ae2){if(_0x391ae2){return _0xf5de4b['status'](_0x11d5dd)['json'](_0x391ae2);}};}function respondWithFilteredResult(_0x4ff0ff,_0x4cdfd0){return function(_0x3a6eb8){if(_0x3a6eb8){var _0x2b6af7=typeof _0x4cdfd0['offset']===_0x818b('0x19')&&typeof _0x4cdfd0['limit']===_0x818b('0x19');var _0x48498c=_0x3a6eb8[_0x818b('0x1a')];var _0x575057=_0x2b6af7?0x0:_0x4cdfd0['offset'];var _0x173d6e=_0x2b6af7?_0x3a6eb8[_0x818b('0x1a')]:_0x4cdfd0[_0x818b('0x1b')]+_0x4cdfd0[_0x818b('0x1c')];var _0x196438;if(_0x173d6e>=_0x48498c){_0x173d6e=_0x48498c;_0x196438=0xc8;}else{_0x196438=0xce;}_0x4ff0ff['status'](_0x196438);return _0x4ff0ff[_0x818b('0x1d')](_0x818b('0x1e'),_0x575057+'-'+_0x173d6e+'/'+_0x48498c)['json'](_0x3a6eb8);}return null;};}function patchUpdates(_0x203fd8){return function(_0x1e85a7){try{jsonpatch[_0x818b('0x1f')](_0x1e85a7,_0x203fd8,!![]);}catch(_0x1ff555){return BPromise[_0x818b('0x20')](_0x1ff555);}return _0x1e85a7[_0x818b('0x21')]();};}function saveUpdates(_0x34bef4,_0x25fc59){return function(_0x36a0e7){if(_0x36a0e7){return _0x36a0e7[_0x818b('0x22')](_0x34bef4)[_0x818b('0x23')](function(_0x404d55){return _0x404d55;});}return null;};}function removeEntity(_0x337127,_0x15ac90){return function(_0x304567){if(_0x304567){return _0x304567[_0x818b('0x24')]()['then'](function(){_0x337127[_0x818b('0x25')](0xcc)[_0x818b('0x18')]();});}};}function handleEntityNotFound(_0x4aac7e,_0x1fc8a5){return function(_0x2820b2){if(!_0x2820b2){_0x4aac7e[_0x818b('0x17')](0x194);}return _0x2820b2;};}function handleError(_0x2531b2,_0xf10e58){_0xf10e58=_0xf10e58||0x1f4;return function(_0x1074a0){logger[_0x818b('0x26')](_0x1074a0[_0x818b('0x27')]);if(_0x1074a0[_0x818b('0x28')]){delete _0x1074a0[_0x818b('0x28')];}_0x2531b2[_0x818b('0x25')](_0xf10e58)[_0x818b('0x29')](_0x1074a0);};}exports['index']=function(_0x49a7ac,_0x412c3f){var _0x23700b={},_0x1c4897={},_0x3bcd58={'count':0x0,'rows':[]};var _0x463e8d=_[_0x818b('0x2a')](db[_0x818b('0x2b')]['rawAttributes'],function(_0x483e90){return{'name':_0x483e90[_0x818b('0x2c')],'type':_0x483e90[_0x818b('0x2d')]['key']};});_0x1c4897['model']=_[_0x818b('0x2a')](_0x463e8d,_0x818b('0x28'));_0x1c4897[_0x818b('0x2e')]=_[_0x818b('0x2f')](_0x49a7ac[_0x818b('0x2e')]);_0x1c4897['filters']=_[_0x818b('0x30')](_0x1c4897[_0x818b('0x31')],_0x1c4897[_0x818b('0x2e')]);_0x23700b[_0x818b('0x32')]=_[_0x818b('0x30')](_0x1c4897['model'],qs[_0x818b('0x33')](_0x49a7ac[_0x818b('0x2e')][_0x818b('0x33')]));_0x23700b[_0x818b('0x32')]=_0x23700b['attributes'][_0x818b('0x34')]?_0x23700b[_0x818b('0x32')]:_0x1c4897[_0x818b('0x31')];if(!_0x49a7ac[_0x818b('0x2e')][_0x818b('0x35')]('nolimit')){_0x23700b[_0x818b('0x1c')]=qs[_0x818b('0x1c')](_0x49a7ac[_0x818b('0x2e')][_0x818b('0x1c')]);_0x23700b[_0x818b('0x1b')]=qs[_0x818b('0x1b')](_0x49a7ac[_0x818b('0x2e')]['offset']);}_0x23700b['order']=qs['sort'](_0x49a7ac['query'][_0x818b('0x36')]);_0x23700b[_0x818b('0x37')]=qs[_0x818b('0x38')](_[_0x818b('0x39')](_0x49a7ac[_0x818b('0x2e')],_0x1c4897[_0x818b('0x38')]),_0x463e8d);if(_0x49a7ac[_0x818b('0x2e')][_0x818b('0x3a')]){_0x23700b[_0x818b('0x37')]=_[_0x818b('0x3b')](_0x23700b[_0x818b('0x37')],{'$or':_['map'](_0x463e8d,function(_0x24565e){if(_0x24565e['type']!=='VIRTUAL'){var _0x3dc4fe={};_0x3dc4fe[_0x24565e[_0x818b('0x28')]]={'$like':'%'+_0x49a7ac[_0x818b('0x2e')][_0x818b('0x3a')]+'%'};return _0x3dc4fe;}})});}_0x23700b=_[_0x818b('0x3b')]({},_0x23700b,_0x49a7ac[_0x818b('0x3c')]);var _0x45452b={'where':_0x23700b['where']};return db[_0x818b('0x2b')][_0x818b('0x1a')](_0x45452b)[_0x818b('0x23')](function(_0x379d32){_0x3bcd58[_0x818b('0x1a')]=_0x379d32;if(_0x49a7ac[_0x818b('0x2e')][_0x818b('0x3d')]){_0x23700b['include']=[{'all':!![]}];}return db[_0x818b('0x2b')][_0x818b('0x3e')](_0x23700b);})[_0x818b('0x23')](function(_0x272e04){_0x3bcd58['rows']=_0x272e04;return _0x3bcd58;})[_0x818b('0x23')](respondWithFilteredResult(_0x412c3f,_0x23700b))[_0x818b('0x3f')](handleError(_0x412c3f,null));};exports[_0x818b('0x40')]=function(_0xa6dac0,_0x3ddc79){var _0x4cb2eb={'raw':!![],'where':{'id':_0xa6dac0['params']['id']}},_0x333950={};_0x333950['model']=_[_0x818b('0x2f')](db['SalesforceField'][_0x818b('0x41')]);_0x333950[_0x818b('0x2e')]=_[_0x818b('0x2f')](_0xa6dac0[_0x818b('0x2e')]);_0x333950[_0x818b('0x38')]=_[_0x818b('0x30')](_0x333950['model'],_0x333950[_0x818b('0x2e')]);_0x4cb2eb[_0x818b('0x32')]=_[_0x818b('0x30')](_0x333950[_0x818b('0x31')],qs['fields'](_0xa6dac0[_0x818b('0x2e')][_0x818b('0x33')]));_0x4cb2eb[_0x818b('0x32')]=_0x4cb2eb[_0x818b('0x32')][_0x818b('0x34')]?_0x4cb2eb[_0x818b('0x32')]:_0x333950[_0x818b('0x31')];if(_0xa6dac0[_0x818b('0x2e')][_0x818b('0x3d')]){_0x4cb2eb[_0x818b('0x42')]=[{'all':!![]}];}_0x4cb2eb=_[_0x818b('0x3b')]({},_0x4cb2eb,_0xa6dac0['options']);return db['SalesforceField']['find'](_0x4cb2eb)[_0x818b('0x23')](handleEntityNotFound(_0x3ddc79,null))[_0x818b('0x23')](respondWithResult(_0x3ddc79,null))['catch'](handleError(_0x3ddc79,null));};exports[_0x818b('0x43')]=function(_0x5eee8a,_0x8f2e8d){return db[_0x818b('0x2b')]['create'](_0x5eee8a[_0x818b('0x44')],{})['then'](respondWithResult(_0x8f2e8d,0xc9))[_0x818b('0x3f')](handleError(_0x8f2e8d,null));};exports[_0x818b('0x22')]=function(_0x6c7531,_0x3745aa){if(_0x6c7531[_0x818b('0x44')]['id']){delete _0x6c7531[_0x818b('0x44')]['id'];}return db['SalesforceField'][_0x818b('0x45')]({'where':{'id':_0x6c7531['params']['id']}})[_0x818b('0x23')](handleEntityNotFound(_0x3745aa,null))['then'](saveUpdates(_0x6c7531[_0x818b('0x44')],null))[_0x818b('0x23')](respondWithResult(_0x3745aa,null))['catch'](handleError(_0x3745aa,null));};exports[_0x818b('0x24')]=function(_0x2301fc,_0x535434){return db[_0x818b('0x2b')]['find']({'where':{'id':_0x2301fc['params']['id']}})[_0x818b('0x23')](handleEntityNotFound(_0x535434,null))[_0x818b('0x23')](removeEntity(_0x535434,null))[_0x818b('0x3f')](handleError(_0x535434,null));};
\ No newline at end of file
index 0885cd6..5d62c8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ac1=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','FieldId','lodash','util','api','moment','request-promise','path'];(function(_0x81e07c,_0x13d9aa){var _0x55a038=function(_0x27e3a4){while(--_0x27e3a4){_0x81e07c['push'](_0x81e07c['shift']());}};_0x55a038(++_0x13d9aa);}(_0x5ac1,0x19e));var _0x15ac=function(_0x53228f,_0x4abb42){_0x53228f=_0x53228f-0x0;var _0x461513=_0x5ac1[_0x53228f];return _0x461513;};'use strict';var _=require(_0x15ac('0x0'));var util=require(_0x15ac('0x1'));var logger=require('../../config/logger')(_0x15ac('0x2'));var moment=require(_0x15ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x15ac('0x4'));var fs=require('fs');var path=require(_0x15ac('0x5'));var rimraf=require(_0x15ac('0x6'));var config=require(_0x15ac('0x7'));var attributes=require(_0x15ac('0x8'));module[_0x15ac('0x9')]=function(_0x47c011,_0x2352d7){return _0x47c011[_0x15ac('0xa')](_0x15ac('0xb'),attributes,{'tableName':_0x15ac('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0x15ac('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc34=['moment','request-promise','rimraf','../../config/environment','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api'];(function(_0x467c9c,_0x2c4181){var _0x1c3ecc=function(_0xf908d1){while(--_0xf908d1){_0x467c9c['push'](_0x467c9c['shift']());}};_0x1c3ecc(++_0x2c4181);}(_0xdc34,0x6c));var _0x4dc3=function(_0x25a46f,_0x1f5006){_0x25a46f=_0x25a46f-0x0;var _0x64f318=_0xdc34[_0x25a46f];return _0x64f318;};'use strict';var _=require(_0x4dc3('0x0'));var util=require(_0x4dc3('0x1'));var logger=require(_0x4dc3('0x2'))(_0x4dc3('0x3'));var moment=require(_0x4dc3('0x4'));var BPromise=require('bluebird');var rp=require(_0x4dc3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4dc3('0x6'));var config=require(_0x4dc3('0x7'));var attributes=require('./intSalesforceField.attributes');module[_0x4dc3('0x8')]=function(_0x1ac987,_0x44e366){return _0x1ac987['define'](_0x4dc3('0x9'),attributes,{'tableName':_0x4dc3('0xa'),'paranoid':![],'indexes':[{'name':_0x4dc3('0xb'),'fields':[_0x4dc3('0xc'),_0x4dc3('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 31be117..75ea3b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca01=['http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x52d77c,_0x444105){var _0x526c14=function(_0x4eea0f){while(--_0x4eea0f){_0x52d77c['push'](_0x52d77c['shift']());}};_0x526c14(++_0x444105);}(_0xca01,0xad));var _0x1ca0=function(_0x565a32,_0x2f8937){_0x565a32=_0x565a32-0x0;var _0xf9ed48=_0xca01[_0x565a32];return _0xf9ed48;};'use strict';var _=require(_0x1ca0('0x0'));var util=require(_0x1ca0('0x1'));var moment=require(_0x1ca0('0x2'));var BPromise=require(_0x1ca0('0x3'));var rs=require(_0x1ca0('0x4'));var fs=require('fs');var Redis=require(_0x1ca0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ca0('0x6'));var logger=require(_0x1ca0('0x7'))(_0x1ca0('0x8'));var config=require(_0x1ca0('0x9'));var jayson=require(_0x1ca0('0xa'));var client=jayson['client'][_0x1ca0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ac9f7,_0x8e2d6a,_0x1c9a48){return new BPromise(function(_0x3ee7f4,_0x3b80b1){return client[_0x1ca0('0xc')](_0x1ac9f7,_0x1c9a48)[_0x1ca0('0xd')](function(_0x3b5862){logger[_0x1ca0('0xe')](_0x1ca0('0xf'),_0x8e2d6a,_0x1ca0('0x10'));logger['debug'](_0x1ca0('0x11'),_0x8e2d6a,_0x1ca0('0x10'),JSON[_0x1ca0('0x12')](_0x3b5862));if(_0x3b5862[_0x1ca0('0x13')]){if(_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x14')]===0x1f4){logger[_0x1ca0('0x13')](_0x1ca0('0xf'),_0x8e2d6a,_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x15')]);return _0x3b80b1(_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x15')]);}logger[_0x1ca0('0x13')](_0x1ca0('0xf'),_0x8e2d6a,_0x3b5862[_0x1ca0('0x13')]['message']);return _0x3ee7f4(_0x3b5862[_0x1ca0('0x13')][_0x1ca0('0x15')]);}else{logger['info'](_0x1ca0('0xf'),_0x8e2d6a,'request\x20sent');_0x3ee7f4(_0x3b5862[_0x1ca0('0x16')][_0x1ca0('0x15')]);}})['catch'](function(_0xfff638){logger[_0x1ca0('0x13')](_0x1ca0('0xf'),_0x8e2d6a,_0xfff638);_0x3b80b1(_0xfff638);});});}
\ No newline at end of file
+var _0xccf9=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','bluebird'];(function(_0x269aac,_0x426352){var _0x52f530=function(_0xc9a6e0){while(--_0xc9a6e0){_0x269aac['push'](_0x269aac['shift']());}};_0x52f530(++_0x426352);}(_0xccf9,0x1d9));var _0x9ccf=function(_0x3ef521,_0x43a044){_0x3ef521=_0x3ef521-0x0;var _0x3cc8b0=_0xccf9[_0x3ef521];return _0x3cc8b0;};'use strict';var _=require(_0x9ccf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9ccf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ccf('0x2'));var db=require(_0x9ccf('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ccf('0x4'));var config=require(_0x9ccf('0x5'));var jayson=require(_0x9ccf('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x428c7b,_0x3a706d,_0x2d243a){return new BPromise(function(_0x11b886,_0x58108f){return client[_0x9ccf('0x7')](_0x428c7b,_0x2d243a)[_0x9ccf('0x8')](function(_0x4e2033){logger[_0x9ccf('0x9')]('SalesforceField,\x20%s,\x20%s',_0x3a706d,'request\x20sent');logger[_0x9ccf('0xa')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3a706d,_0x9ccf('0xb'),JSON[_0x9ccf('0xc')](_0x4e2033));if(_0x4e2033[_0x9ccf('0xd')]){if(_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0xe')]===0x1f4){logger[_0x9ccf('0xd')](_0x9ccf('0xf'),_0x3a706d,_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);return _0x58108f(_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);}logger[_0x9ccf('0xd')](_0x9ccf('0xf'),_0x3a706d,_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);return _0x11b886(_0x4e2033[_0x9ccf('0xd')][_0x9ccf('0x10')]);}else{logger[_0x9ccf('0x9')](_0x9ccf('0xf'),_0x3a706d,_0x9ccf('0xb'));_0x11b886(_0x4e2033[_0x9ccf('0x11')][_0x9ccf('0x10')]);}})[_0x9ccf('0x12')](function(_0x12d5fa){logger[_0x9ccf('0xd')](_0x9ccf('0xf'),_0x3a706d,_0x12d5fa);_0x58108f(_0x12d5fa);});});}
\ No newline at end of file
index f8d1abd..c2d2e40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c7=['getFields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','index','get','show','/:id/fields'];(function(_0xbf8c62,_0x84b913){var _0x2fa1be=function(_0x12bcd4){while(--_0x12bcd4){_0xbf8c62['push'](_0xbf8c62['shift']());}};_0x2fa1be(++_0x84b913);}(_0x55c7,0x127));var _0x755c=function(_0x200400,_0x1f0e9f){_0x200400=_0x200400-0x0;var _0x3f92f8=_0x55c7[_0x200400];return _0x3f92f8;};'use strict';var multer=require('multer');var util=require(_0x755c('0x0'));var path=require(_0x755c('0x1'));var timeout=require(_0x755c('0x2'));var express=require(_0x755c('0x3'));var router=express[_0x755c('0x4')]();var fs_extra=require(_0x755c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x755c('0x6'));var config=require('../../config/environment');var controller=require(_0x755c('0x7'));router['get']('/',auth[_0x755c('0x8')](),controller[_0x755c('0x9')]);router[_0x755c('0xa')]('/:id',auth[_0x755c('0x8')](),controller[_0x755c('0xb')]);router['get']('/:id/configurations',auth[_0x755c('0x8')](),controller['getConfigurations']);router[_0x755c('0xa')](_0x755c('0xc'),auth['isAuthenticated'](),controller[_0x755c('0xd')]);router[_0x755c('0xe')]('/',auth[_0x755c('0x8')](),controller['create']);router[_0x755c('0xe')](_0x755c('0xf'),auth[_0x755c('0x8')](),controller[_0x755c('0x10')]);router[_0x755c('0x11')]('/:id',auth[_0x755c('0x8')](),controller[_0x755c('0x12')]);router[_0x755c('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x755c('0x14')]);module[_0x755c('0x15')]=router;
\ No newline at end of file
+var _0x5ab4=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations'];(function(_0x3da860,_0x2eef2d){var _0x4d0bf3=function(_0x15e77b){while(--_0x15e77b){_0x3da860['push'](_0x3da860['shift']());}};_0x4d0bf3(++_0x2eef2d);}(_0x5ab4,0x9f));var _0x45ab=function(_0x8a4bbc,_0x603716){_0x8a4bbc=_0x8a4bbc-0x0;var _0x464349=_0x5ab4[_0x8a4bbc];return _0x464349;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var fs_extra=require(_0x45ab('0x5'));var auth=require(_0x45ab('0x6'));var interaction=require(_0x45ab('0x7'));var config=require(_0x45ab('0x8'));var controller=require(_0x45ab('0x9'));router[_0x45ab('0xa')]('/',auth['isAuthenticated'](),controller[_0x45ab('0xb')]);router[_0x45ab('0xa')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0xe')]);router[_0x45ab('0xa')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x10')]);router[_0x45ab('0xa')](_0x45ab('0x11'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x12')]);router['post']('/',auth[_0x45ab('0xd')](),controller[_0x45ab('0x13')]);router[_0x45ab('0x14')](_0x45ab('0xf'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x15')]);router[_0x45ab('0x16')](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller['update']);router['delete'](_0x45ab('0xc'),auth[_0x45ab('0xd')](),controller[_0x45ab('0x17')]);module[_0x45ab('0x18')]=router;
\ No newline at end of file
index 9bc0bb5..3543d84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb25=['remoteUri','sequelize','STRING','username'];(function(_0x322257,_0xd267a7){var _0x40aa7e=function(_0x482f39){while(--_0x482f39){_0x322257['push'](_0x322257['shift']());}};_0x40aa7e(++_0xd267a7);}(_0xcb25,0xb5));var _0x5cb2=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0xcb25[_0x3acee8];return _0x5046cc;};'use strict';var Sequelize=require(_0x5cb2('0x0'));module['exports']={'name':{'type':Sequelize[_0x5cb2('0x1')]},'description':{'type':Sequelize[_0x5cb2('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x5cb2('0x2')},'password':{'type':Sequelize[_0x5cb2('0x1')]},'email':{'type':Sequelize[_0x5cb2('0x1')]},'remoteUri':{'type':Sequelize[_0x5cb2('0x1')],'unique':_0x5cb2('0x3')},'serverUrl':{'type':Sequelize[_0x5cb2('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x9ac6=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4c11e4,_0x5cf3ba){var _0x5b43dd=function(_0x53eece){while(--_0x53eece){_0x4c11e4['push'](_0x4c11e4['shift']());}};_0x5b43dd(++_0x5cf3ba);}(_0x9ac6,0x10d));var _0x69ac=function(_0x30d859,_0x2c9398){_0x30d859=_0x30d859-0x0;var _0x51d750=_0x9ac6[_0x30d859];return _0x51d750;};'use strict';var Sequelize=require(_0x69ac('0x0'));module[_0x69ac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x69ac('0x2')]},'username':{'type':Sequelize[_0x69ac('0x2')],'unique':_0x69ac('0x3')},'password':{'type':Sequelize[_0x69ac('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x69ac('0x2')],'unique':_0x69ac('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index ba3bfe7..0373b0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fe3=['sys_domain_path','time_worked','expected_start','group_list','reopened_time','resolved_at','approval_set','work_notes','correlation_display','assignment_group','business_stc','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','location','category','username','password','email','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','internalType','all','concat','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','ServicenowConfiguration','pick','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','ServicenowField','Descriptions','made_sla','knowledge','subcategory','close_code','notify','incident_state','parent','caused_by','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service'];(function(_0x25c846,_0x1582a4){var _0x358256=function(_0x5a9d29){while(--_0x5a9d29){_0x25c846['push'](_0x25c846['shift']());}};_0x358256(++_0x1582a4);}(_0x0fe3,0x102));var _0x30fe=function(_0x3305e0,_0x4d1e3f){_0x3305e0=_0x3305e0-0x0;var _0x27ce0f=_0x0fe3[_0x3305e0];return _0x27ce0f;};'use strict';var emlformat=require(_0x30fe('0x0'));var rimraf=require(_0x30fe('0x1'));var zipdir=require(_0x30fe('0x2'));var jsonpatch=require(_0x30fe('0x3'));var rp=require(_0x30fe('0x4'));var moment=require(_0x30fe('0x5'));var BPromise=require(_0x30fe('0x6'));var Mustache=require(_0x30fe('0x7'));var util=require('util');var path=require(_0x30fe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x30fe('0x9'));var fs=require('fs');var fs_extra=require(_0x30fe('0xa'));var _=require(_0x30fe('0xb'));var squel=require(_0x30fe('0xc'));var crypto=require(_0x30fe('0xd'));var jsforce=require(_0x30fe('0xe'));var deskjs=require(_0x30fe('0xf'));var toCsv=require(_0x30fe('0x10'));var querystring=require(_0x30fe('0x11'));var Papa=require(_0x30fe('0x12'));var Redis=require(_0x30fe('0x13'));var authService=require(_0x30fe('0x14'));var qs=require(_0x30fe('0x15'));var as=require(_0x30fe('0x16'));var hardwareService=require(_0x30fe('0x17'));var logger=require(_0x30fe('0x18'))(_0x30fe('0x19'));var utils=require(_0x30fe('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x30fe('0x1b'));var db=require(_0x30fe('0x1c'))['db'];var integrations=require(_0x30fe('0x1d'));function respondWithStatusCode(_0x4ed6d4,_0x51e43d){_0x51e43d=_0x51e43d||0xcc;return function(_0xd300e9){if(_0xd300e9){return _0x4ed6d4['sendStatus'](_0x51e43d);}return _0x4ed6d4[_0x30fe('0x1e')](_0x51e43d)[_0x30fe('0x1f')]();};}function respondWithResult(_0x2962dc,_0x309fa0){_0x309fa0=_0x309fa0||0xc8;return function(_0x1b0b55){if(_0x1b0b55){return _0x2962dc[_0x30fe('0x1e')](_0x309fa0)[_0x30fe('0x20')](_0x1b0b55);}};}function respondWithFilteredResult(_0x4363a7,_0x41621e){return function(_0x2430be){if(_0x2430be){var _0xae0a78=typeof _0x41621e[_0x30fe('0x21')]==='undefined'&&typeof _0x41621e[_0x30fe('0x22')]===_0x30fe('0x23');var _0x3551ac=_0x2430be[_0x30fe('0x24')];var _0x5f5b94=_0xae0a78?0x0:_0x41621e[_0x30fe('0x21')];var _0x3d6896=_0xae0a78?_0x2430be['count']:_0x41621e[_0x30fe('0x21')]+_0x41621e[_0x30fe('0x22')];var _0x1acd86;if(_0x3d6896>=_0x3551ac){_0x3d6896=_0x3551ac;_0x1acd86=0xc8;}else{_0x1acd86=0xce;}_0x4363a7[_0x30fe('0x1e')](_0x1acd86);return _0x4363a7[_0x30fe('0x25')](_0x30fe('0x26'),_0x5f5b94+'-'+_0x3d6896+'/'+_0x3551ac)[_0x30fe('0x20')](_0x2430be);}return null;};}function patchUpdates(_0x1ee165){return function(_0x4c8dcc){try{jsonpatch['apply'](_0x4c8dcc,_0x1ee165,!![]);}catch(_0x5e6d59){return BPromise[_0x30fe('0x27')](_0x5e6d59);}return _0x4c8dcc['save']();};}function saveUpdates(_0xb00d14,_0x46e0ad){return function(_0x29e0c0){if(_0x29e0c0){return _0x29e0c0[_0x30fe('0x28')](_0xb00d14)[_0x30fe('0x29')](function(_0x31e89c){return _0x31e89c;});}return null;};}function removeEntity(_0x299be6,_0x1694db){return function(_0x5eac46){if(_0x5eac46){return _0x5eac46[_0x30fe('0x2a')]()['then'](function(){_0x299be6[_0x30fe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x405ad1,_0x491465){return function(_0x4bfac8){if(!_0x4bfac8){_0x405ad1[_0x30fe('0x2b')](0x194);}return _0x4bfac8;};}function handleError(_0x126560,_0x2326c8){_0x2326c8=_0x2326c8||0x1f4;return function(_0x3aa881){logger[_0x30fe('0x2c')](_0x3aa881[_0x30fe('0x2d')]);if(_0x3aa881[_0x30fe('0x2e')]){delete _0x3aa881[_0x30fe('0x2e')];}_0x126560[_0x30fe('0x1e')](_0x2326c8)[_0x30fe('0x2f')](_0x3aa881);};}exports['index']=function(_0x495ada,_0x5cd34d){var _0x4a5d10={},_0x33aff3={},_0x532e10={'count':0x0,'rows':[]};var _0x14fc58=_[_0x30fe('0x30')](db[_0x30fe('0x31')][_0x30fe('0x32')],function(_0x2c51f7){return{'name':_0x2c51f7[_0x30fe('0x33')],'type':_0x2c51f7['type']['key']};});_0x33aff3[_0x30fe('0x34')]=_['map'](_0x14fc58,'name');_0x33aff3[_0x30fe('0x35')]=_[_0x30fe('0x36')](_0x495ada[_0x30fe('0x35')]);_0x33aff3[_0x30fe('0x37')]=_[_0x30fe('0x38')](_0x33aff3[_0x30fe('0x34')],_0x33aff3[_0x30fe('0x35')]);_0x4a5d10[_0x30fe('0x39')]=_[_0x30fe('0x38')](_0x33aff3[_0x30fe('0x34')],qs['fields'](_0x495ada[_0x30fe('0x35')][_0x30fe('0x3a')]));_0x4a5d10[_0x30fe('0x39')]=_0x4a5d10[_0x30fe('0x39')][_0x30fe('0x3b')]?_0x4a5d10['attributes']:_0x33aff3[_0x30fe('0x34')];if(!_0x495ada[_0x30fe('0x35')][_0x30fe('0x3c')](_0x30fe('0x3d'))){_0x4a5d10[_0x30fe('0x22')]=qs[_0x30fe('0x22')](_0x495ada[_0x30fe('0x35')][_0x30fe('0x22')]);_0x4a5d10['offset']=qs[_0x30fe('0x21')](_0x495ada[_0x30fe('0x35')][_0x30fe('0x21')]);}_0x4a5d10[_0x30fe('0x3e')]=qs['sort'](_0x495ada[_0x30fe('0x35')][_0x30fe('0x3f')]);_0x4a5d10['where']=qs[_0x30fe('0x37')](_['pick'](_0x495ada[_0x30fe('0x35')],_0x33aff3[_0x30fe('0x37')]),_0x14fc58);if(_0x495ada['query'][_0x30fe('0x40')]){_0x4a5d10['where']=_[_0x30fe('0x41')](_0x4a5d10[_0x30fe('0x42')],{'$or':_[_0x30fe('0x30')](_0x14fc58,function(_0x172c2b){if(_0x172c2b[_0x30fe('0x43')]!==_0x30fe('0x44')){var _0xebf61c={};_0xebf61c[_0x172c2b[_0x30fe('0x2e')]]={'$like':'%'+_0x495ada['query'][_0x30fe('0x40')]+'%'};return _0xebf61c;}})});}_0x4a5d10=_[_0x30fe('0x41')]({},_0x4a5d10,_0x495ada[_0x30fe('0x45')]);var _0x3f9407={'where':_0x4a5d10[_0x30fe('0x42')]};return db['ServicenowAccount'][_0x30fe('0x24')](_0x3f9407)[_0x30fe('0x29')](function(_0x345ce4){_0x532e10[_0x30fe('0x24')]=_0x345ce4;if(_0x495ada[_0x30fe('0x35')][_0x30fe('0x46')]){_0x4a5d10[_0x30fe('0x47')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x30fe('0x48')](_0x4a5d10);})[_0x30fe('0x29')](function(_0x626254){_0x532e10[_0x30fe('0x49')]=_0x626254;return _0x532e10;})[_0x30fe('0x29')](respondWithFilteredResult(_0x5cd34d,_0x4a5d10))[_0x30fe('0x4a')](handleError(_0x5cd34d,null));};exports[_0x30fe('0x4b')]=function(_0x5f25ac,_0x308bc6){var _0x2fe2ef={'raw':![],'where':{'id':_0x5f25ac[_0x30fe('0x4c')]['id']}},_0x2fd820={};_0x2fd820[_0x30fe('0x34')]=_[_0x30fe('0x36')](db['ServicenowAccount'][_0x30fe('0x32')]);_0x2fd820[_0x30fe('0x35')]=_[_0x30fe('0x36')](_0x5f25ac[_0x30fe('0x35')]);_0x2fd820[_0x30fe('0x37')]=_['intersection'](_0x2fd820['model'],_0x2fd820['query']);_0x2fe2ef[_0x30fe('0x39')]=_['intersection'](_0x2fd820[_0x30fe('0x34')],qs[_0x30fe('0x3a')](_0x5f25ac[_0x30fe('0x35')][_0x30fe('0x3a')]));_0x2fe2ef['attributes']=_0x2fe2ef[_0x30fe('0x39')]['length']?_0x2fe2ef[_0x30fe('0x39')]:_0x2fd820[_0x30fe('0x34')];if(_0x5f25ac[_0x30fe('0x35')][_0x30fe('0x46')]){_0x2fe2ef[_0x30fe('0x47')]=[{'all':!![]}];}_0x2fe2ef=_[_0x30fe('0x41')]({},_0x2fe2ef,_0x5f25ac[_0x30fe('0x45')]);return db[_0x30fe('0x31')][_0x30fe('0x4d')](_0x2fe2ef)[_0x30fe('0x29')](handleEntityNotFound(_0x308bc6,null))[_0x30fe('0x29')](respondWithResult(_0x308bc6,null))['catch'](handleError(_0x308bc6,null));};exports[_0x30fe('0x4e')]=function(_0x5c7d8d,_0x2cba7e){return db[_0x30fe('0x31')]['create'](_0x5c7d8d[_0x30fe('0x4f')],{})[_0x30fe('0x29')](respondWithResult(_0x2cba7e,0xc9))[_0x30fe('0x4a')](handleError(_0x2cba7e,null));};exports[_0x30fe('0x28')]=function(_0x53c807,_0x281661){if(_0x53c807[_0x30fe('0x4f')]['id']){delete _0x53c807['body']['id'];}return db[_0x30fe('0x31')]['find']({'where':{'id':_0x53c807[_0x30fe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x281661,null))['then'](saveUpdates(_0x53c807[_0x30fe('0x4f')],null))[_0x30fe('0x29')](respondWithResult(_0x281661,null))[_0x30fe('0x4a')](handleError(_0x281661,null));};exports['destroy']=function(_0x2f3943,_0x3db245){return db['ServicenowAccount']['find']({'where':{'id':_0x2f3943[_0x30fe('0x4c')]['id']}})[_0x30fe('0x29')](handleEntityNotFound(_0x3db245,null))[_0x30fe('0x29')](removeEntity(_0x3db245,null))['catch'](handleError(_0x3db245,null));};exports['getConfigurations']=function(_0x377f5c,_0x57d570,_0x1db603){var _0x2c53dc={};var _0x5142ca={};var _0x5138f7;var _0x4a313d;return db['ServicenowAccount']['findOne']({'where':{'id':_0x377f5c[_0x30fe('0x4c')]['id']}})[_0x30fe('0x29')](handleEntityNotFound(_0x57d570,null))['then'](function(_0x166238){if(_0x166238){_0x5138f7=_0x166238;_0x5142ca[_0x30fe('0x34')]=_[_0x30fe('0x36')](db[_0x30fe('0x50')]['rawAttributes']);_0x5142ca[_0x30fe('0x35')]=_[_0x30fe('0x36')](_0x377f5c[_0x30fe('0x35')]);_0x5142ca[_0x30fe('0x37')]=_[_0x30fe('0x38')](_0x5142ca[_0x30fe('0x34')],_0x5142ca[_0x30fe('0x35')]);_0x2c53dc[_0x30fe('0x39')]=_['intersection'](_0x5142ca[_0x30fe('0x34')],qs[_0x30fe('0x3a')](_0x377f5c['query']['fields']));_0x2c53dc[_0x30fe('0x39')]=_0x2c53dc[_0x30fe('0x39')][_0x30fe('0x3b')]?_0x2c53dc[_0x30fe('0x39')]:_0x5142ca[_0x30fe('0x34')];_0x2c53dc[_0x30fe('0x3e')]=qs[_0x30fe('0x3f')](_0x377f5c[_0x30fe('0x35')][_0x30fe('0x3f')]);_0x2c53dc['where']=qs[_0x30fe('0x37')](_[_0x30fe('0x51')](_0x377f5c[_0x30fe('0x35')],_0x5142ca['filters']));if(_0x377f5c[_0x30fe('0x35')]['filter']){_0x2c53dc[_0x30fe('0x42')]=_[_0x30fe('0x41')](_0x2c53dc['where'],{'$or':_[_0x30fe('0x30')](_0x2c53dc[_0x30fe('0x39')],function(_0x3ff4a0){var _0x97fb94={};_0x97fb94[_0x3ff4a0]={'$like':'%'+_0x377f5c[_0x30fe('0x35')]['filter']+'%'};return _0x97fb94;})});}_0x2c53dc=_[_0x30fe('0x41')]({},_0x2c53dc,_0x377f5c[_0x30fe('0x45')]);return _0x5138f7[_0x30fe('0x52')](_0x2c53dc);}})[_0x30fe('0x29')](function(_0xecfb18){if(_0xecfb18){_0x4a313d=_0xecfb18['length'];if(!_0x377f5c[_0x30fe('0x35')][_0x30fe('0x3c')](_0x30fe('0x3d'))){_0x2c53dc['limit']=qs['limit'](_0x377f5c[_0x30fe('0x35')][_0x30fe('0x22')]);_0x2c53dc[_0x30fe('0x21')]=qs[_0x30fe('0x21')](_0x377f5c[_0x30fe('0x35')][_0x30fe('0x21')]);}return _0x5138f7[_0x30fe('0x52')](_0x2c53dc);}})['then'](function(_0xe2d1fb){if(_0xe2d1fb){return _0xe2d1fb?{'count':_0x4a313d,'rows':_0xe2d1fb}:null;}})[_0x30fe('0x29')](respondWithResult(_0x57d570,null))['catch'](handleError(_0x57d570,null));};exports[_0x30fe('0x53')]=function(_0x116091,_0x5ad4db,_0x3c554e){if(_0x116091[_0x30fe('0x4f')]['id']){delete _0x116091[_0x30fe('0x4f')]['id'];}return db[_0x30fe('0x31')][_0x30fe('0x54')]({'where':{'id':_0x116091[_0x30fe('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5ad4db,null))[_0x30fe('0x29')](function(_0x3e5777){if(_0x3e5777){_0x116091[_0x30fe('0x4f')][_0x30fe('0x55')]=_0x3e5777['id'];_0x116091[_0x30fe('0x4f')][_0x30fe('0x56')]=integrations[_0x30fe('0x57')](_0x116091[_0x30fe('0x4f')][_0x30fe('0x58')],_0x116091[_0x30fe('0x4f')]['type']);_0x116091['body']['Descriptions']=integrations[_0x30fe('0x59')](_0x116091[_0x30fe('0x4f')][_0x30fe('0x58')],_0x116091[_0x30fe('0x4f')][_0x30fe('0x43')]);return db[_0x30fe('0x50')]['create'](_0x116091['body'],{'include':[{'model':db[_0x30fe('0x5a')],'as':'Subjects'},{'model':db[_0x30fe('0x5a')],'as':_0x30fe('0x5b')}]});}return null;})[_0x30fe('0x29')](respondWithResult(_0x5ad4db,null))['catch'](handleError(_0x5ad4db,null));};exports['getFields']=function(_0x2c8382,_0x57a64b,_0x4bb2f2){var _0x3d1114=[_0x30fe('0x5c'),'hold_reason',_0x30fe('0x5d'),_0x30fe('0x5e'),_0x30fe('0x5f'),_0x30fe('0x60'),_0x30fe('0x61'),'severity','category'];var _0xe5bee8=[_0x30fe('0x62'),_0x30fe('0x5c'),_0x30fe('0x63'),'watch_list',_0x30fe('0x64'),_0x30fe('0x65'),_0x30fe('0x66'),_0x30fe('0x67'),_0x30fe('0x68'),_0x30fe('0x69'),'resolved_by','sys_updated_by',_0x30fe('0x6a'),_0x30fe('0x6b'),'sys_created_on',_0x30fe('0x6c'),_0x30fe('0x6d'),_0x30fe('0x6e'),_0x30fe('0x5d'),'order',_0x30fe('0x6f'),'closed_at',_0x30fe('0x70'),_0x30fe('0x71'),_0x30fe('0x72'),_0x30fe('0x73'),_0x30fe('0x74'),_0x30fe('0x75'),'priority',_0x30fe('0x76'),'rfc',_0x30fe('0x77'),_0x30fe('0x78'),'opened_at','business_duration',_0x30fe('0x79'),'work_end',_0x30fe('0x7a'),_0x30fe('0x7b'),'caller_id',_0x30fe('0x7c'),_0x30fe('0x5e'),_0x30fe('0x7d'),'short_description','close_code',_0x30fe('0x7e'),'delivery_task','work_start',_0x30fe('0x7f'),_0x30fe('0x80'),'additional_assignee_list','description',_0x30fe('0x81'),'notify',_0x30fe('0x82'),_0x30fe('0x83'),'closed_by',_0x30fe('0x84'),_0x30fe('0x85'),_0x30fe('0x86'),_0x30fe('0x87'),_0x30fe('0x88'),'incident_state',_0x30fe('0x89'),'problem_id',_0x30fe('0x8a'),_0x30fe('0x8b'),_0x30fe('0x8c'),_0x30fe('0x8d'),'severity',_0x30fe('0x8e'),_0x30fe('0x8f'),_0x30fe('0x90'),_0x30fe('0x91'),_0x30fe('0x92'),_0x30fe('0x93'),'reopen_count',_0x30fe('0x94'),'escalation','upon_approval','correlation_id',_0x30fe('0x95'),_0x30fe('0x96')];var _0x11f6fc='';var _0x3fc13e='';var _0x3f29e0=[];var _0x330ca1='';var _0x4beaa4='';var _0x3d2f06=[];var _0x305307='';var _0x4ea8ba='';var _0x1a98b2={};var _0x17912e='';return db[_0x30fe('0x31')][_0x30fe('0x54')]({'where':{'id':_0x2c8382[_0x30fe('0x4c')]['id']},'attributes':['id',_0x30fe('0x97'),_0x30fe('0x98'),_0x30fe('0x99'),'remoteUri',_0x30fe('0x9a')]})[_0x30fe('0x29')](handleEntityNotFound(_0x57a64b,null))[_0x30fe('0x29')](function(_0x4e236d){if(_0x4e236d){_0x17912e=_0x4e236d['remoteUri'];var _0x5c85fc=_0x17912e[_0x30fe('0x9b')](-0x1);if(_0x5c85fc==='/'){_0x17912e=_0x17912e[_0x30fe('0x9c')](0x0,_0x17912e[_0x30fe('0x9d')](_0x5c85fc));}_0x4ea8ba=util[_0x30fe('0x9e')](_0x30fe('0x9f'),_0x17912e);_0x305307=util[_0x30fe('0x9e')](_0x30fe('0xa0'),_0x17912e);_0x1a98b2={'user':_0x4e236d[_0x30fe('0x97')],'pass':_0x4e236d['password']};var _0x3c8c19={'method':'GET','uri':_0x4ea8ba+_0x30fe('0xa1'),'auth':_0x1a98b2,'json':!![]};return rp(_0x3c8c19);}})[_0x30fe('0x29')](function(_0x417d92){if(_0x417d92[_0x30fe('0xa2')][_0x30fe('0x3b')]>0x0){_0x11f6fc=_0x417d92[_0x30fe('0xa2')];}console[_0x30fe('0xa3')](_0x30fe('0xa4'),_0x11f6fc);_0x3d2f06=[];_0x3fc13e=Object[_0x30fe('0xa5')]([],_0x11f6fc);_[_0x30fe('0xa6')](_0x3fc13e,function(_0x4489e9){return!_0x3d1114[_0x30fe('0xa7')](_0x4489e9[_0x30fe('0x2e')]);});_0x3fc13e[_0x30fe('0xa8')](function(_0x3e5659){var _0x55ff9d=createFieldObject(_0x305307,_0x1a98b2,_0x3e5659['internalType'],_0x3e5659[_0x30fe('0x2e')],_0x3e5659[_0x30fe('0xa9')],![]);_0x3d2f06[_0x30fe('0xaa')](_0x55ff9d);});return Promise['all'](_0x3d2f06);})[_0x30fe('0x29')](function(_0x27b5bd){_0x3f29e0=_0x27b5bd;_0x330ca1=Object[_0x30fe('0xa5')]([],_0x11f6fc);console[_0x30fe('0xa3')](_0x30fe('0xab'),_0x11f6fc);_[_0x30fe('0xa6')](_0x330ca1,function(_0x3ad2d2){return _0xe5bee8['includes'](_0x3ad2d2[_0x30fe('0x2e')]);});console[_0x30fe('0xa3')](_0x30fe('0xac'),_0x330ca1);_0x3d2f06=[];_0x330ca1[_0x30fe('0xa8')](function(_0x5a3999){var _0xc955d7=createFieldObject(_0x305307,_0x1a98b2,_0x5a3999[_0x30fe('0xad')],_0x5a3999['name'],_0x5a3999['label'],!![]);_0x3d2f06[_0x30fe('0xaa')](_0xc955d7);});return Promise[_0x30fe('0xae')](_0x3d2f06);})['then'](function(_0x3e138a){_0x4beaa4=_0x3e138a;var _0x522538=_0x3f29e0[_0x30fe('0xaf')](_0x4beaa4);return{'count':_0x522538[_0x30fe('0x3b')],'rows':_0x522538};})['then'](respondWithResult(_0x57a64b,null))[_0x30fe('0x4a')](function(_0xd4fc5b){console[_0x30fe('0xa3')]('ServiceNow\x20error:\x20'+_0xd4fc5b);var _0x476571=_0x2c8382[_0x30fe('0x35')][_0x30fe('0xb0')]?0x1f4:_0xd4fc5b[_0x30fe('0xb1')]||0x1f4;logger[_0x30fe('0x2c')](_0xd4fc5b['stack']);delete _0xd4fc5b['name'];if(_0x476571===0x191){_0x476571=0x190;}_0x57a64b['status'](_0x476571)[_0x30fe('0x2f')](_0x2c8382[_0x30fe('0x35')][_0x30fe('0xb0')]?{'message':_0x30fe('0xb2'),'statusCode':_0xd4fc5b[_0x30fe('0xb1')]}:_0xd4fc5b);});};function createFieldObject(_0x1896cf,_0x5a9b16,_0x398865,_0x3aa19a,_0x4c6a37,_0x2ac5d2){return new Promise(function(_0x5ca9eb,_0x39e7d7){var _0x5b51c4={'id':_0x3aa19a,'name':_0x4c6a37,'custom':_0x2ac5d2};if(_0x398865===_0x30fe('0xb3')){_0x5b51c4['options']=[{'name':_0x30fe('0xb4'),'value':_0x30fe('0xb5')},{'name':_0x30fe('0xb6'),'value':_0x30fe('0xb7')}];_0x5ca9eb(_0x5b51c4);}else{var _0x226c7a={'method':_0x30fe('0xb8'),'uri':_0x1896cf+_0x30fe('0xb9')+_0x3aa19a,'auth':_0x5a9b16,'json':!![]};return rp(_0x226c7a)['then'](function(_0x289284){var _0x521ee3=[];if(_0x289284[_0x30fe('0xa2')][_0x30fe('0x3b')]>0x0){_0x289284['result'][_0x30fe('0xa8')](function(_0x4e7a01){if(_0x4e7a01[_0x30fe('0xba')]===_0x30fe('0xb7')){var _0x37a786={'name':_0x4e7a01['label'],'value':_0x4e7a01[_0x30fe('0xbb')]};_0x521ee3['push'](_0x37a786);}});}_0x5b51c4[_0x30fe('0x45')]=_0x521ee3;if(_0x5b51c4[_0x30fe('0x45')][_0x30fe('0x3b')]>0x0){_0x5ca9eb(_0x5b51c4);}else{if(_0x2ac5d2==![]){_0x5ca9eb();}else{_0x5ca9eb(_0x5b51c4);}}});}});}
\ No newline at end of file
+var _0x786d=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','ServicenowAccount','includeAll','include','rows','keys','find','create','catch','body','params','findOne','ServicenowConfiguration','order','getConfigurations','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','parent','caused_by','sys_updated_on','approval_history','number','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','work_notes_list','business_service','sys_domain_path','time_worked','expected_start','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','internalType','push','all','TCL:\x20_object','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','label','concat','test','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields'];(function(_0x36d25e,_0x1a047d){var _0x4b95b8=function(_0x74da3){while(--_0x74da3){_0x36d25e['push'](_0x36d25e['shift']());}};_0x4b95b8(++_0x1a047d);}(_0x786d,0x84));var _0xd786=function(_0xe0829c,_0x263827){_0xe0829c=_0xe0829c-0x0;var _0x246b53=_0x786d[_0xe0829c];return _0x246b53;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd786('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd786('0x1'));var moment=require('moment');var BPromise=require(_0xd786('0x2'));var Mustache=require(_0xd786('0x3'));var util=require(_0xd786('0x4'));var path=require(_0xd786('0x5'));var sox=require(_0xd786('0x6'));var csv=require(_0xd786('0x7'));var ejs=require(_0xd786('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd786('0x9'));var squel=require('squel');var crypto=require(_0xd786('0xa'));var jsforce=require(_0xd786('0xb'));var deskjs=require(_0xd786('0xc'));var toCsv=require(_0xd786('0x7'));var querystring=require('querystring');var Papa=require(_0xd786('0xd'));var Redis=require(_0xd786('0xe'));var authService=require(_0xd786('0xf'));var qs=require(_0xd786('0x10'));var as=require(_0xd786('0x11'));var hardwareService=require(_0xd786('0x12'));var logger=require(_0xd786('0x13'))('api');var utils=require(_0xd786('0x14'));var config=require(_0xd786('0x15'));var licenseUtil=require(_0xd786('0x16'));var db=require(_0xd786('0x17'))['db'];var integrations=require(_0xd786('0x18'));function respondWithStatusCode(_0x27516b,_0x5df632){_0x5df632=_0x5df632||0xcc;return function(_0x3fbeaf){if(_0x3fbeaf){return _0x27516b[_0xd786('0x19')](_0x5df632);}return _0x27516b[_0xd786('0x1a')](_0x5df632)[_0xd786('0x1b')]();};}function respondWithResult(_0x59fae7,_0x553f28){_0x553f28=_0x553f28||0xc8;return function(_0xd763e7){if(_0xd763e7){return _0x59fae7[_0xd786('0x1a')](_0x553f28)['json'](_0xd763e7);}};}function respondWithFilteredResult(_0x1652b9,_0x850d99){return function(_0x3c05b8){if(_0x3c05b8){var _0x12fe1e=typeof _0x850d99[_0xd786('0x1c')]===_0xd786('0x1d')&&typeof _0x850d99[_0xd786('0x1e')]===_0xd786('0x1d');var _0x2e0812=_0x3c05b8[_0xd786('0x1f')];var _0x392102=_0x12fe1e?0x0:_0x850d99['offset'];var _0x2a2cbc=_0x12fe1e?_0x3c05b8[_0xd786('0x1f')]:_0x850d99[_0xd786('0x1c')]+_0x850d99[_0xd786('0x1e')];var _0x299412;if(_0x2a2cbc>=_0x2e0812){_0x2a2cbc=_0x2e0812;_0x299412=0xc8;}else{_0x299412=0xce;}_0x1652b9[_0xd786('0x1a')](_0x299412);return _0x1652b9['set']('Content-Range',_0x392102+'-'+_0x2a2cbc+'/'+_0x2e0812)[_0xd786('0x20')](_0x3c05b8);}return null;};}function patchUpdates(_0x43fa38){return function(_0x1e1da5){try{jsonpatch[_0xd786('0x21')](_0x1e1da5,_0x43fa38,!![]);}catch(_0x4ea05c){return BPromise[_0xd786('0x22')](_0x4ea05c);}return _0x1e1da5[_0xd786('0x23')]();};}function saveUpdates(_0x1a2bf8,_0x228e68){return function(_0x4db897){if(_0x4db897){return _0x4db897[_0xd786('0x24')](_0x1a2bf8)[_0xd786('0x25')](function(_0x125514){return _0x125514;});}return null;};}function removeEntity(_0x2efc39,_0x1f11e7){return function(_0x5dee53){if(_0x5dee53){return _0x5dee53[_0xd786('0x26')]()[_0xd786('0x25')](function(){_0x2efc39[_0xd786('0x1a')](0xcc)[_0xd786('0x1b')]();});}};}function handleEntityNotFound(_0x384e03,_0x1b1ff2){return function(_0x28edc8){if(!_0x28edc8){_0x384e03[_0xd786('0x19')](0x194);}return _0x28edc8;};}function handleError(_0x4dbd82,_0x4c6e44){_0x4c6e44=_0x4c6e44||0x1f4;return function(_0x1aaaef){logger[_0xd786('0x27')](_0x1aaaef[_0xd786('0x28')]);if(_0x1aaaef[_0xd786('0x29')]){delete _0x1aaaef[_0xd786('0x29')];}_0x4dbd82[_0xd786('0x1a')](_0x4c6e44)[_0xd786('0x2a')](_0x1aaaef);};}exports[_0xd786('0x2b')]=function(_0x408aaa,_0x1a75c2){var _0x72030a={},_0x39e531={},_0x2227cb={'count':0x0,'rows':[]};var _0x6a1a73=_[_0xd786('0x2c')](db['ServicenowAccount'][_0xd786('0x2d')],function(_0x1f23b1){return{'name':_0x1f23b1[_0xd786('0x2e')],'type':_0x1f23b1[_0xd786('0x2f')][_0xd786('0x30')]};});_0x39e531[_0xd786('0x31')]=_['map'](_0x6a1a73,_0xd786('0x29'));_0x39e531[_0xd786('0x32')]=_['keys'](_0x408aaa[_0xd786('0x32')]);_0x39e531[_0xd786('0x33')]=_[_0xd786('0x34')](_0x39e531[_0xd786('0x31')],_0x39e531[_0xd786('0x32')]);_0x72030a['attributes']=_[_0xd786('0x34')](_0x39e531['model'],qs[_0xd786('0x35')](_0x408aaa[_0xd786('0x32')][_0xd786('0x35')]));_0x72030a[_0xd786('0x36')]=_0x72030a['attributes'][_0xd786('0x37')]?_0x72030a[_0xd786('0x36')]:_0x39e531[_0xd786('0x31')];if(!_0x408aaa['query'][_0xd786('0x38')](_0xd786('0x39'))){_0x72030a[_0xd786('0x1e')]=qs[_0xd786('0x1e')](_0x408aaa[_0xd786('0x32')][_0xd786('0x1e')]);_0x72030a[_0xd786('0x1c')]=qs[_0xd786('0x1c')](_0x408aaa[_0xd786('0x32')][_0xd786('0x1c')]);}_0x72030a['order']=qs[_0xd786('0x3a')](_0x408aaa[_0xd786('0x32')]['sort']);_0x72030a[_0xd786('0x3b')]=qs[_0xd786('0x33')](_[_0xd786('0x3c')](_0x408aaa[_0xd786('0x32')],_0x39e531['filters']),_0x6a1a73);if(_0x408aaa['query'][_0xd786('0x3d')]){_0x72030a[_0xd786('0x3b')]=_[_0xd786('0x3e')](_0x72030a[_0xd786('0x3b')],{'$or':_[_0xd786('0x2c')](_0x6a1a73,function(_0x32f3d2){if(_0x32f3d2[_0xd786('0x2f')]!=='VIRTUAL'){var _0x4278e4={};_0x4278e4[_0x32f3d2['name']]={'$like':'%'+_0x408aaa[_0xd786('0x32')][_0xd786('0x3d')]+'%'};return _0x4278e4;}})});}_0x72030a=_[_0xd786('0x3e')]({},_0x72030a,_0x408aaa[_0xd786('0x3f')]);var _0x411575={'where':_0x72030a['where']};return db[_0xd786('0x40')][_0xd786('0x1f')](_0x411575)[_0xd786('0x25')](function(_0x1d963a){_0x2227cb[_0xd786('0x1f')]=_0x1d963a;if(_0x408aaa[_0xd786('0x32')][_0xd786('0x41')]){_0x72030a[_0xd786('0x42')]=[{'all':!![]}];}return db[_0xd786('0x40')]['findAll'](_0x72030a);})[_0xd786('0x25')](function(_0x4cba3b){_0x2227cb[_0xd786('0x43')]=_0x4cba3b;return _0x2227cb;})[_0xd786('0x25')](respondWithFilteredResult(_0x1a75c2,_0x72030a))['catch'](handleError(_0x1a75c2,null));};exports['show']=function(_0x20b13c,_0x1c1c47){var _0x1cb197={'raw':![],'where':{'id':_0x20b13c['params']['id']}},_0x59929c={};_0x59929c[_0xd786('0x31')]=_['keys'](db[_0xd786('0x40')][_0xd786('0x2d')]);_0x59929c['query']=_[_0xd786('0x44')](_0x20b13c['query']);_0x59929c[_0xd786('0x33')]=_[_0xd786('0x34')](_0x59929c[_0xd786('0x31')],_0x59929c[_0xd786('0x32')]);_0x1cb197[_0xd786('0x36')]=_[_0xd786('0x34')](_0x59929c[_0xd786('0x31')],qs[_0xd786('0x35')](_0x20b13c[_0xd786('0x32')]['fields']));_0x1cb197[_0xd786('0x36')]=_0x1cb197[_0xd786('0x36')][_0xd786('0x37')]?_0x1cb197['attributes']:_0x59929c['model'];if(_0x20b13c[_0xd786('0x32')][_0xd786('0x41')]){_0x1cb197['include']=[{'all':!![]}];}_0x1cb197=_[_0xd786('0x3e')]({},_0x1cb197,_0x20b13c['options']);return db[_0xd786('0x40')][_0xd786('0x45')](_0x1cb197)[_0xd786('0x25')](handleEntityNotFound(_0x1c1c47,null))['then'](respondWithResult(_0x1c1c47,null))['catch'](handleError(_0x1c1c47,null));};exports[_0xd786('0x46')]=function(_0x3a5434,_0x2ed98d){return db[_0xd786('0x40')][_0xd786('0x46')](_0x3a5434['body'],{})[_0xd786('0x25')](respondWithResult(_0x2ed98d,0xc9))[_0xd786('0x47')](handleError(_0x2ed98d,null));};exports['update']=function(_0x3512b6,_0x21087e){if(_0x3512b6[_0xd786('0x48')]['id']){delete _0x3512b6['body']['id'];}return db['ServicenowAccount'][_0xd786('0x45')]({'where':{'id':_0x3512b6[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x21087e,null))['then'](saveUpdates(_0x3512b6[_0xd786('0x48')],null))[_0xd786('0x25')](respondWithResult(_0x21087e,null))[_0xd786('0x47')](handleError(_0x21087e,null));};exports[_0xd786('0x26')]=function(_0x56a56d,_0x5ea8af){return db['ServicenowAccount'][_0xd786('0x45')]({'where':{'id':_0x56a56d[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x5ea8af,null))[_0xd786('0x25')](removeEntity(_0x5ea8af,null))[_0xd786('0x47')](handleError(_0x5ea8af,null));};exports['getConfigurations']=function(_0x1cf09f,_0x16dd84,_0xa9d82){var _0x4125b8={};var _0x457d86={};var _0x4ef044;var _0x3ed4e5;return db['ServicenowAccount'][_0xd786('0x4a')]({'where':{'id':_0x1cf09f[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x16dd84,null))[_0xd786('0x25')](function(_0xa64751){if(_0xa64751){_0x4ef044=_0xa64751;_0x457d86[_0xd786('0x31')]=_[_0xd786('0x44')](db[_0xd786('0x4b')]['rawAttributes']);_0x457d86[_0xd786('0x32')]=_[_0xd786('0x44')](_0x1cf09f[_0xd786('0x32')]);_0x457d86[_0xd786('0x33')]=_[_0xd786('0x34')](_0x457d86[_0xd786('0x31')],_0x457d86[_0xd786('0x32')]);_0x4125b8['attributes']=_[_0xd786('0x34')](_0x457d86[_0xd786('0x31')],qs['fields'](_0x1cf09f[_0xd786('0x32')][_0xd786('0x35')]));_0x4125b8[_0xd786('0x36')]=_0x4125b8[_0xd786('0x36')][_0xd786('0x37')]?_0x4125b8[_0xd786('0x36')]:_0x457d86[_0xd786('0x31')];_0x4125b8[_0xd786('0x4c')]=qs[_0xd786('0x3a')](_0x1cf09f['query'][_0xd786('0x3a')]);_0x4125b8[_0xd786('0x3b')]=qs[_0xd786('0x33')](_[_0xd786('0x3c')](_0x1cf09f['query'],_0x457d86[_0xd786('0x33')]));if(_0x1cf09f[_0xd786('0x32')][_0xd786('0x3d')]){_0x4125b8['where']=_[_0xd786('0x3e')](_0x4125b8[_0xd786('0x3b')],{'$or':_[_0xd786('0x2c')](_0x4125b8[_0xd786('0x36')],function(_0x370ee1){var _0x3c011a={};_0x3c011a[_0x370ee1]={'$like':'%'+_0x1cf09f[_0xd786('0x32')][_0xd786('0x3d')]+'%'};return _0x3c011a;})});}_0x4125b8=_[_0xd786('0x3e')]({},_0x4125b8,_0x1cf09f[_0xd786('0x3f')]);return _0x4ef044[_0xd786('0x4d')](_0x4125b8);}})[_0xd786('0x25')](function(_0xad952){if(_0xad952){_0x3ed4e5=_0xad952[_0xd786('0x37')];if(!_0x1cf09f[_0xd786('0x32')][_0xd786('0x38')](_0xd786('0x39'))){_0x4125b8[_0xd786('0x1e')]=qs[_0xd786('0x1e')](_0x1cf09f[_0xd786('0x32')][_0xd786('0x1e')]);_0x4125b8[_0xd786('0x1c')]=qs[_0xd786('0x1c')](_0x1cf09f[_0xd786('0x32')]['offset']);}return _0x4ef044[_0xd786('0x4d')](_0x4125b8);}})[_0xd786('0x25')](function(_0x3604ee){if(_0x3604ee){return _0x3604ee?{'count':_0x3ed4e5,'rows':_0x3604ee}:null;}})[_0xd786('0x25')](respondWithResult(_0x16dd84,null))['catch'](handleError(_0x16dd84,null));};exports['addConfiguration']=function(_0x1c3eea,_0x2a9f98,_0xc78c7f){if(_0x1c3eea[_0xd786('0x48')]['id']){delete _0x1c3eea['body']['id'];}return db[_0xd786('0x40')][_0xd786('0x4a')]({'where':{'id':_0x1c3eea[_0xd786('0x49')]['id']}})[_0xd786('0x25')](handleEntityNotFound(_0x2a9f98,null))['then'](function(_0x193a59){if(_0x193a59){_0x1c3eea[_0xd786('0x48')]['AccountId']=_0x193a59['id'];_0x1c3eea['body'][_0xd786('0x4e')]=integrations[_0xd786('0x4f')](_0x1c3eea[_0xd786('0x48')][_0xd786('0x50')],_0x1c3eea[_0xd786('0x48')]['type']);_0x1c3eea[_0xd786('0x48')][_0xd786('0x51')]=integrations[_0xd786('0x52')](_0x1c3eea[_0xd786('0x48')][_0xd786('0x50')],_0x1c3eea['body']['type']);return db[_0xd786('0x4b')][_0xd786('0x46')](_0x1c3eea[_0xd786('0x48')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0xd786('0x53')],'as':'Descriptions'}]});}return null;})[_0xd786('0x25')](respondWithResult(_0x2a9f98,null))['catch'](handleError(_0x2a9f98,null));};exports[_0xd786('0x54')]=function(_0x16388d,_0x48dd1b,_0x75f7c){var _0x47b406=[_0xd786('0x55'),_0xd786('0x56'),_0xd786('0x57'),_0xd786('0x58'),_0xd786('0x59'),_0xd786('0x5a'),'incident_state','severity','category'];var _0x480ff2=[_0xd786('0x5b'),_0xd786('0x55'),_0xd786('0x5c'),'watch_list','upon_reject',_0xd786('0x5d'),'child_incidents',_0xd786('0x56'),_0xd786('0x5e'),_0xd786('0x5f'),'resolved_by',_0xd786('0x60'),_0xd786('0x61'),'user_input',_0xd786('0x62'),'sys_domain',_0xd786('0x63'),_0xd786('0x64'),_0xd786('0x57'),_0xd786('0x4c'),_0xd786('0x65'),_0xd786('0x66'),'cmdb_ci',_0xd786('0x67'),_0xd786('0x68'),'active',_0xd786('0x69'),_0xd786('0x6a'),'priority',_0xd786('0x6b'),'rfc',_0xd786('0x6c'),_0xd786('0x6d'),'opened_at','business_duration',_0xd786('0x6e'),_0xd786('0x6f'),'reopened_time',_0xd786('0x70'),_0xd786('0x71'),_0xd786('0x72'),'subcategory',_0xd786('0x73'),_0xd786('0x74'),_0xd786('0x59'),'correlation_display',_0xd786('0x75'),'work_start',_0xd786('0x76'),_0xd786('0x77'),_0xd786('0x78'),_0xd786('0x79'),_0xd786('0x7a'),'notify','sys_class_name',_0xd786('0x7b'),_0xd786('0x7c'),_0xd786('0x7d'),_0xd786('0x7e'),_0xd786('0x7f'),'contact_type',_0xd786('0x80'),_0xd786('0x81'),_0xd786('0x82'),_0xd786('0x83'),_0xd786('0x84'),_0xd786('0x85'),_0xd786('0x86'),_0xd786('0x87'),_0xd786('0x88'),_0xd786('0x89'),_0xd786('0x8a'),_0xd786('0x8b'),_0xd786('0x8c'),_0xd786('0x8d'),_0xd786('0x8e'),_0xd786('0x8f'),_0xd786('0x90'),_0xd786('0x91'),_0xd786('0x92'),_0xd786('0x93'),_0xd786('0x94'),_0xd786('0x95')];var _0x442780='';var _0x2de059='';var _0x125496=[];var _0x28aee8='';var _0x1c904a='';var _0x110e12=[];var _0x5a6f27='';var _0x309b03='';var _0x57bf31={};var _0x575027='';return db[_0xd786('0x40')]['findOne']({'where':{'id':_0x16388d[_0xd786('0x49')]['id']},'attributes':['id','username',_0xd786('0x96'),_0xd786('0x97'),_0xd786('0x98'),_0xd786('0x99')]})[_0xd786('0x25')](handleEntityNotFound(_0x48dd1b,null))[_0xd786('0x25')](function(_0x2053e7){if(_0x2053e7){_0x575027=_0x2053e7[_0xd786('0x98')];var _0x2f7960=_0x575027[_0xd786('0x9a')](-0x1);if(_0x2f7960==='/'){_0x575027=_0x575027[_0xd786('0x9b')](0x0,_0x575027[_0xd786('0x9c')](_0x2f7960));}_0x309b03=util[_0xd786('0x9d')]('%s/api/now/doc/table/schema/',_0x575027);_0x5a6f27=util[_0xd786('0x9d')](_0xd786('0x9e'),_0x575027);_0x57bf31={'user':_0x2053e7[_0xd786('0x9f')],'pass':_0x2053e7['password']};var _0xed713e={'method':_0xd786('0xa0'),'uri':_0x309b03+_0xd786('0xa1'),'auth':_0x57bf31,'json':!![]};return rp(_0xed713e);}})[_0xd786('0x25')](function(_0x5ece31){if(_0x5ece31[_0xd786('0xa2')]['length']>0x0){_0x442780=_0x5ece31[_0xd786('0xa2')];}console[_0xd786('0xa3')](_0xd786('0xa4'),_0x442780);_0x110e12=[];_0x2de059=Object[_0xd786('0xa5')]([],_0x442780);_['remove'](_0x2de059,function(_0x4708e1){return!_0x47b406['includes'](_0x4708e1['name']);});_0x2de059['forEach'](function(_0xd4ea04){var _0x12934e=createFieldObject(_0x5a6f27,_0x57bf31,_0xd4ea04[_0xd786('0xa6')],_0xd4ea04[_0xd786('0x29')],_0xd4ea04['label'],![]);_0x110e12[_0xd786('0xa7')](_0x12934e);});return Promise[_0xd786('0xa8')](_0x110e12);})[_0xd786('0x25')](function(_0x3fe0a3){_0x125496=_0x3fe0a3;_0x28aee8=Object[_0xd786('0xa5')]([],_0x442780);console[_0xd786('0xa3')](_0xd786('0xa9'),_0x442780);_[_0xd786('0xaa')](_0x28aee8,function(_0x22417f){return _0x480ff2[_0xd786('0xab')](_0x22417f[_0xd786('0x29')]);});console['log'](_0xd786('0xac'),_0x28aee8);_0x110e12=[];_0x28aee8[_0xd786('0xad')](function(_0xd45632){var _0x13106d=createFieldObject(_0x5a6f27,_0x57bf31,_0xd45632[_0xd786('0xa6')],_0xd45632[_0xd786('0x29')],_0xd45632[_0xd786('0xae')],!![]);_0x110e12[_0xd786('0xa7')](_0x13106d);});return Promise[_0xd786('0xa8')](_0x110e12);})[_0xd786('0x25')](function(_0x4508be){_0x1c904a=_0x4508be;var _0x5cfe39=_0x125496[_0xd786('0xaf')](_0x1c904a);return{'count':_0x5cfe39['length'],'rows':_0x5cfe39};})[_0xd786('0x25')](respondWithResult(_0x48dd1b,null))[_0xd786('0x47')](function(_0x30a98c){console[_0xd786('0xa3')]('ServiceNow\x20error:\x20'+_0x30a98c);var _0x1aa3d8=_0x16388d[_0xd786('0x32')][_0xd786('0xb0')]?0x1f4:_0x30a98c[_0xd786('0xb1')]||0x1f4;logger[_0xd786('0x27')](_0x30a98c[_0xd786('0x28')]);delete _0x30a98c[_0xd786('0x29')];if(_0x1aa3d8===0x191){_0x1aa3d8=0x190;}_0x48dd1b[_0xd786('0x1a')](_0x1aa3d8)['send'](_0x16388d[_0xd786('0x32')]['test']?{'message':_0xd786('0xb2'),'statusCode':_0x30a98c[_0xd786('0xb1')]}:_0x30a98c);});};function createFieldObject(_0x29d5d9,_0x13c2c4,_0x4e0cd1,_0x38327a,_0x43ae45,_0x332d85){return new Promise(function(_0x581619,_0x4e51d3){var _0x3276c2={'id':_0x38327a,'name':_0x43ae45,'custom':_0x332d85};if(_0x4e0cd1==='boolean'){_0x3276c2['options']=[{'name':_0xd786('0xb3'),'value':_0xd786('0xb4')},{'name':_0xd786('0xb5'),'value':_0xd786('0xb6')}];_0x581619(_0x3276c2);}else{var _0x3c4dfa={'method':_0xd786('0xa0'),'uri':_0x29d5d9+_0xd786('0xb7')+_0x38327a,'auth':_0x13c2c4,'json':!![]};return rp(_0x3c4dfa)[_0xd786('0x25')](function(_0x26df1f){var _0x1aa25d=[];if(_0x26df1f['result'][_0xd786('0x37')]>0x0){_0x26df1f['result'][_0xd786('0xad')](function(_0x2b50f5){if(_0x2b50f5[_0xd786('0xb8')]===_0xd786('0xb6')){var _0x515764={'name':_0x2b50f5[_0xd786('0xae')],'value':_0x2b50f5[_0xd786('0xb9')]};_0x1aa25d['push'](_0x515764);}});}_0x3276c2[_0xd786('0x3f')]=_0x1aa25d;if(_0x3276c2['options'][_0xd786('0x37')]>0x0){_0x581619(_0x3276c2);}else{if(_0x332d85==![]){_0x581619();}else{_0x581619(_0x3276c2);}}});}});}
\ No newline at end of file
index 0350cf1..79e3d4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x1f00f7,_0x469d49){var _0x24d9f3=function(_0x4795ed){while(--_0x4795ed){_0x1f00f7['push'](_0x1f00f7['shift']());}};_0x24d9f3(++_0x469d49);}(_0x5fab,0x177));var _0xb5fa=function(_0x35bdcf,_0x21421c){_0x35bdcf=_0x35bdcf-0x0;var _0x5a4fc7=_0x5fab[_0x35bdcf];return _0x5a4fc7;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0xbb0aea,_0x5a38cb){var _0x47a163=function(_0x10b151){while(--_0x10b151){_0xbb0aea['push'](_0xbb0aea['shift']());}};_0x47a163(++_0x5a38cb);}(_0x687b,0x14a));var _0xb687=function(_0x1bfe44,_0x4e410e){_0x1bfe44=_0x1bfe44-0x0;var _0x1103cb=_0x687b[_0x1bfe44];return _0x1103cb;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a0d68a3..612d46b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdaf=['ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','ServicenowAccount','findAll','options','where','attributes','limit','include','map','model','GetServicenowAccount','catch'];(function(_0x4c5ffb,_0xbf67f0){var _0x52e05a=function(_0x2b1181){while(--_0x2b1181){_0x4c5ffb['push'](_0x4c5ffb['shift']());}};_0x52e05a(++_0xbf67f0);}(_0xfdaf,0xdb));var _0xffda=function(_0xb17f95,_0x3fc12d){_0xb17f95=_0xb17f95-0x0;var _0x5aaf5f=_0xfdaf[_0xb17f95];return _0x5aaf5f;};'use strict';var _=require(_0xffda('0x0'));var util=require(_0xffda('0x1'));var moment=require('moment');var BPromise=require(_0xffda('0x2'));var rs=require(_0xffda('0x3'));var fs=require('fs');var Redis=require(_0xffda('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xffda('0x5'));var logger=require('../../config/logger')(_0xffda('0x6'));var config=require(_0xffda('0x7'));var jayson=require(_0xffda('0x8'));var client=jayson['client'][_0xffda('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x419a17,_0x49f88a,_0x1d2972){return new BPromise(function(_0x5463bb,_0x43c17b){return client[_0xffda('0xa')](_0x419a17,_0x1d2972)[_0xffda('0xb')](function(_0x14bd66){logger['info'](_0xffda('0xc'),_0x49f88a,_0xffda('0xd'));logger[_0xffda('0xe')](_0xffda('0xf'),_0x49f88a,_0xffda('0xd'),JSON[_0xffda('0x10')](_0x14bd66));if(_0x14bd66[_0xffda('0x11')]){if(_0x14bd66[_0xffda('0x11')][_0xffda('0x12')]===0x1f4){logger[_0xffda('0x11')](_0xffda('0xc'),_0x49f88a,_0x14bd66[_0xffda('0x11')][_0xffda('0x13')]);return _0x43c17b(_0x14bd66['error'][_0xffda('0x13')]);}logger[_0xffda('0x11')](_0xffda('0xc'),_0x49f88a,_0x14bd66['error'][_0xffda('0x13')]);return _0x5463bb(_0x14bd66[_0xffda('0x11')][_0xffda('0x13')]);}else{logger[_0xffda('0x14')](_0xffda('0xc'),_0x49f88a,_0xffda('0xd'));_0x5463bb(_0x14bd66[_0xffda('0x15')][_0xffda('0x13')]);}})['catch'](function(_0x1f368d){logger[_0xffda('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x49f88a,_0x1f368d);_0x43c17b(_0x1f368d);});});}exports['GetServicenowAccount']=function(_0x663368){var _0x1ad6ff=this;return new Promise(function(_0x3b2d69,_0x488670){return db[_0xffda('0x16')][_0xffda('0x17')]({'raw':_0x663368['options']?_0x663368['options']['raw']===undefined?!![]:![]:!![],'where':_0x663368[_0xffda('0x18')]?_0x663368[_0xffda('0x18')][_0xffda('0x19')]||null:null,'attributes':_0x663368['options']?_0x663368[_0xffda('0x18')][_0xffda('0x1a')]||null:null,'limit':_0x663368['options']?_0x663368[_0xffda('0x18')][_0xffda('0x1b')]||null:null,'include':_0x663368[_0xffda('0x18')]?_0x663368[_0xffda('0x18')][_0xffda('0x1c')]?_[_0xffda('0x1d')](_0x663368[_0xffda('0x18')][_0xffda('0x1c')],function(_0x44f42c){return{'model':db[_0x44f42c[_0xffda('0x1e')]],'as':_0x44f42c['as'],'attributes':_0x44f42c[_0xffda('0x1a')],'include':_0x44f42c['include']?_[_0xffda('0x1d')](_0x44f42c[_0xffda('0x1c')],function(_0x45b4d6){return{'model':db[_0x45b4d6[_0xffda('0x1e')]],'as':_0x45b4d6['as'],'attributes':_0x45b4d6[_0xffda('0x1a')],'include':_0x45b4d6['include']?_[_0xffda('0x1d')](_0x45b4d6[_0xffda('0x1c')],function(_0x40d150){return{'model':db[_0x40d150[_0xffda('0x1e')]],'as':_0x40d150['as'],'attributes':_0x40d150[_0xffda('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xffda('0xb')](function(_0x1ca564){logger[_0xffda('0x14')]('GetServicenowAccount',_0x663368);logger[_0xffda('0xe')](_0xffda('0x1f'),_0x663368,JSON[_0xffda('0x10')](_0x1ca564));_0x3b2d69(_0x1ca564);})[_0xffda('0x20')](function(_0x43434b){logger['error']('GetServicenowAccount',_0x43434b[_0xffda('0x13')],_0x663368);_0x488670(_0x1ad6ff[_0xffda('0x11')](0x1f4,_0x43434b[_0xffda('0x13')]));});});};exports[_0xffda('0x21')]=function(_0x816956){var _0x20c753=this;return new Promise(function(_0x406eff,_0x1c7723){return db[_0xffda('0x16')][_0xffda('0x22')]({'raw':_0x816956[_0xffda('0x18')]?_0x816956['options'][_0xffda('0x23')]===undefined?!![]:![]:!![],'where':_0x816956[_0xffda('0x18')]?_0x816956[_0xffda('0x18')][_0xffda('0x19')]||null:null,'attributes':_0x816956['options']?_0x816956[_0xffda('0x18')][_0xffda('0x1a')]||null:null,'include':_0x816956['options']?_0x816956[_0xffda('0x18')][_0xffda('0x1c')]?_[_0xffda('0x1d')](_0x816956['options']['include'],function(_0x570df5){return{'model':db[_0x570df5['model']],'as':_0x570df5['as'],'attributes':_0x570df5[_0xffda('0x1a')],'include':_0x570df5[_0xffda('0x1c')]?_[_0xffda('0x1d')](_0x570df5[_0xffda('0x1c')],function(_0x781e7e){return{'model':db[_0x781e7e[_0xffda('0x1e')]],'as':_0x781e7e['as'],'attributes':_0x781e7e['attributes'],'include':_0x781e7e['include']?_[_0xffda('0x1d')](_0x781e7e[_0xffda('0x1c')],function(_0x46874b){return{'model':db[_0x46874b[_0xffda('0x1e')]],'as':_0x46874b['as'],'attributes':_0x46874b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x54c67c){logger[_0xffda('0x14')](_0xffda('0x21'),_0x816956);logger['debug'](_0xffda('0x21'),_0x816956,JSON[_0xffda('0x10')](_0x54c67c));_0x406eff(_0x54c67c);})[_0xffda('0x20')](function(_0x4f7f84){logger[_0xffda('0x11')](_0xffda('0x21'),_0x4f7f84[_0xffda('0x13')],_0x816956);_0x1c7723(_0x20c753[_0xffda('0x11')](0x1f4,_0x4f7f84['message']));});});};
\ No newline at end of file
+var _0xab70=['raw','where','attributes','include','map','model','then','find','ShowServicenowAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','message','ServicenowAccount,\x20%s,\x20%s','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options'];(function(_0x192e1a,_0x55c355){var _0x534ea1=function(_0x3cc6ea){while(--_0x3cc6ea){_0x192e1a['push'](_0x192e1a['shift']());}};_0x534ea1(++_0x55c355);}(_0xab70,0xfe));var _0x0ab7=function(_0x49000b,_0x46c351){_0x49000b=_0x49000b-0x0;var _0x2145ef=_0xab70[_0x49000b];return _0x2145ef;};'use strict';var _=require(_0x0ab7('0x0'));var util=require(_0x0ab7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0ab7('0x2'));var fs=require('fs');var Redis=require(_0x0ab7('0x3'));var db=require(_0x0ab7('0x4'))['db'];var utils=require(_0x0ab7('0x5'));var logger=require(_0x0ab7('0x6'))(_0x0ab7('0x7'));var config=require(_0x0ab7('0x8'));var jayson=require(_0x0ab7('0x9'));var client=jayson[_0x0ab7('0xa')][_0x0ab7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29e5d9,_0x1ea9d8,_0x249254){return new BPromise(function(_0xe19ae3,_0x468fa9){return client[_0x0ab7('0xc')](_0x29e5d9,_0x249254)['then'](function(_0x1db9f8){logger[_0x0ab7('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1ea9d8,_0x0ab7('0xe'));logger[_0x0ab7('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1ea9d8,_0x0ab7('0xe'),JSON[_0x0ab7('0x10')](_0x1db9f8));if(_0x1db9f8[_0x0ab7('0x11')]){if(_0x1db9f8[_0x0ab7('0x11')]['code']===0x1f4){logger[_0x0ab7('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1ea9d8,_0x1db9f8[_0x0ab7('0x11')][_0x0ab7('0x12')]);return _0x468fa9(_0x1db9f8[_0x0ab7('0x11')][_0x0ab7('0x12')]);}logger['error'](_0x0ab7('0x13'),_0x1ea9d8,_0x1db9f8[_0x0ab7('0x11')][_0x0ab7('0x12')]);return _0xe19ae3(_0x1db9f8['error'][_0x0ab7('0x12')]);}else{logger[_0x0ab7('0xd')](_0x0ab7('0x13'),_0x1ea9d8,'request\x20sent');_0xe19ae3(_0x1db9f8[_0x0ab7('0x14')][_0x0ab7('0x12')]);}})[_0x0ab7('0x15')](function(_0x2469c9){logger['error'](_0x0ab7('0x13'),_0x1ea9d8,_0x2469c9);_0x468fa9(_0x2469c9);});});}exports[_0x0ab7('0x16')]=function(_0x45d79e){var _0x5df28e=this;return new Promise(function(_0xbb1cc6,_0x56dec7){return db[_0x0ab7('0x17')][_0x0ab7('0x18')]({'raw':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1a')]===undefined?!![]:![]:!![],'where':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1b')]||null:null,'attributes':_0x45d79e['options']?_0x45d79e['options'][_0x0ab7('0x1c')]||null:null,'limit':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e['options']['limit']||null:null,'include':_0x45d79e[_0x0ab7('0x19')]?_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1d')]?_[_0x0ab7('0x1e')](_0x45d79e[_0x0ab7('0x19')][_0x0ab7('0x1d')],function(_0x838be6){return{'model':db[_0x838be6[_0x0ab7('0x1f')]],'as':_0x838be6['as'],'attributes':_0x838be6['attributes'],'include':_0x838be6[_0x0ab7('0x1d')]?_[_0x0ab7('0x1e')](_0x838be6[_0x0ab7('0x1d')],function(_0x3835b0){return{'model':db[_0x3835b0['model']],'as':_0x3835b0['as'],'attributes':_0x3835b0[_0x0ab7('0x1c')],'include':_0x3835b0[_0x0ab7('0x1d')]?_['map'](_0x3835b0[_0x0ab7('0x1d')],function(_0x8b1234){return{'model':db[_0x8b1234[_0x0ab7('0x1f')]],'as':_0x8b1234['as'],'attributes':_0x8b1234['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ab7('0x20')](function(_0x139e73){logger[_0x0ab7('0xd')]('GetServicenowAccount',_0x45d79e);logger[_0x0ab7('0xf')](_0x0ab7('0x16'),_0x45d79e,JSON[_0x0ab7('0x10')](_0x139e73));_0xbb1cc6(_0x139e73);})[_0x0ab7('0x15')](function(_0x22b7c1){logger[_0x0ab7('0x11')](_0x0ab7('0x16'),_0x22b7c1[_0x0ab7('0x12')],_0x45d79e);_0x56dec7(_0x5df28e[_0x0ab7('0x11')](0x1f4,_0x22b7c1[_0x0ab7('0x12')]));});});};exports['ShowServicenowAccount']=function(_0x2c2b71){var _0x120fd9=this;return new Promise(function(_0x4a9a23,_0x26fdf2){return db['ServicenowAccount'][_0x0ab7('0x21')]({'raw':_0x2c2b71['options']?_0x2c2b71[_0x0ab7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2c2b71[_0x0ab7('0x19')]?_0x2c2b71[_0x0ab7('0x19')][_0x0ab7('0x1b')]||null:null,'attributes':_0x2c2b71[_0x0ab7('0x19')]?_0x2c2b71['options'][_0x0ab7('0x1c')]||null:null,'include':_0x2c2b71[_0x0ab7('0x19')]?_0x2c2b71['options'][_0x0ab7('0x1d')]?_['map'](_0x2c2b71['options'][_0x0ab7('0x1d')],function(_0x1702ec){return{'model':db[_0x1702ec[_0x0ab7('0x1f')]],'as':_0x1702ec['as'],'attributes':_0x1702ec[_0x0ab7('0x1c')],'include':_0x1702ec[_0x0ab7('0x1d')]?_[_0x0ab7('0x1e')](_0x1702ec[_0x0ab7('0x1d')],function(_0xf93d5){return{'model':db[_0xf93d5[_0x0ab7('0x1f')]],'as':_0xf93d5['as'],'attributes':_0xf93d5['attributes'],'include':_0xf93d5[_0x0ab7('0x1d')]?_['map'](_0xf93d5['include'],function(_0x15792f){return{'model':db[_0x15792f[_0x0ab7('0x1f')]],'as':_0x15792f['as'],'attributes':_0x15792f[_0x0ab7('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb33b2d){logger['info'](_0x0ab7('0x22'),_0x2c2b71);logger[_0x0ab7('0xf')]('ShowServicenowAccount',_0x2c2b71,JSON[_0x0ab7('0x10')](_0xb33b2d));_0x4a9a23(_0xb33b2d);})[_0x0ab7('0x15')](function(_0x30b156){logger[_0x0ab7('0x11')]('ShowServicenowAccount',_0x30b156['message'],_0x2c2b71);_0x26fdf2(_0x120fd9[_0x0ab7('0x11')](0x1f4,_0x30b156['message']));});});};
\ No newline at end of file
index 5111aae..e4db0c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa61=['getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x41582d,_0x291b1c){var _0x59c504=function(_0x4d967e){while(--_0x4d967e){_0x41582d['push'](_0x41582d['shift']());}};_0x59c504(++_0x291b1c);}(_0xfa61,0x1d6));var _0x1fa6=function(_0x32dc94,_0x28b830){_0x32dc94=_0x32dc94-0x0;var _0x25615d=_0xfa61[_0x32dc94];return _0x25615d;};'use strict';var multer=require(_0x1fa6('0x0'));var util=require(_0x1fa6('0x1'));var path=require(_0x1fa6('0x2'));var timeout=require(_0x1fa6('0x3'));var express=require(_0x1fa6('0x4'));var router=express[_0x1fa6('0x5')]();var fs_extra=require(_0x1fa6('0x6'));var auth=require(_0x1fa6('0x7'));var interaction=require(_0x1fa6('0x8'));var config=require('../../config/environment');var controller=require(_0x1fa6('0x9'));router[_0x1fa6('0xa')]('/',auth[_0x1fa6('0xb')](),controller[_0x1fa6('0xc')]);router[_0x1fa6('0xa')](_0x1fa6('0xd'),auth[_0x1fa6('0xb')](),controller[_0x1fa6('0xe')]);router[_0x1fa6('0xa')](_0x1fa6('0xf'),auth[_0x1fa6('0xb')](),controller[_0x1fa6('0x10')]);router[_0x1fa6('0xa')](_0x1fa6('0x11'),auth['isAuthenticated'](),controller[_0x1fa6('0x12')]);router[_0x1fa6('0xa')](_0x1fa6('0x13'),auth[_0x1fa6('0xb')](),controller['getDescriptions']);router[_0x1fa6('0x14')]('/',auth[_0x1fa6('0xb')](),controller[_0x1fa6('0x15')]);router[_0x1fa6('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x1fa6('0x17')]);router[_0x1fa6('0x18')](_0x1fa6('0xd'),auth[_0x1fa6('0xb')](),controller[_0x1fa6('0x19')]);module[_0x1fa6('0x1a')]=router;
\ No newline at end of file
+var _0x90d8=['exports','util','path','connect-timeout','fs-extra','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy'];(function(_0x4313cf,_0x3a750b){var _0x47c49a=function(_0x23eb38){while(--_0x23eb38){_0x4313cf['push'](_0x4313cf['shift']());}};_0x47c49a(++_0x3a750b);}(_0x90d8,0x112));var _0x890d=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x90d8[_0x473738];return _0x1df4ae;};'use strict';var multer=require('multer');var util=require(_0x890d('0x0'));var path=require(_0x890d('0x1'));var timeout=require(_0x890d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x890d('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x890d('0x4'));var controller=require(_0x890d('0x5'));router[_0x890d('0x6')]('/',auth[_0x890d('0x7')](),controller['index']);router['get'](_0x890d('0x8'),auth['isAuthenticated'](),controller[_0x890d('0x9')]);router[_0x890d('0x6')](_0x890d('0xa'),auth[_0x890d('0x7')](),controller['getFields']);router[_0x890d('0x6')]('/:id/subjects',auth[_0x890d('0x7')](),controller[_0x890d('0xb')]);router[_0x890d('0x6')](_0x890d('0xc'),auth[_0x890d('0x7')](),controller[_0x890d('0xd')]);router[_0x890d('0xe')]('/',auth[_0x890d('0x7')](),controller[_0x890d('0xf')]);router[_0x890d('0x10')](_0x890d('0x8'),auth[_0x890d('0x7')](),controller[_0x890d('0x11')]);router[_0x890d('0x12')](_0x890d('0x8'),auth[_0x890d('0x7')](),controller[_0x890d('0x13')]);module[_0x890d('0x14')]=router;
\ No newline at end of file
index f117dda..6d941c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7b1=['sequelize','STRING'];(function(_0x1f0533,_0x12f344){var _0x498dd3=function(_0x4f3193){while(--_0x4f3193){_0x1f0533['push'](_0x1f0533['shift']());}};_0x498dd3(++_0x12f344);}(_0xc7b1,0x12c));var _0x1c7b=function(_0x4c2bdc,_0x5915d7){_0x4c2bdc=_0x4c2bdc-0x0;var _0x5a3222=_0xc7b1[_0x4c2bdc];return _0x5a3222;};'use strict';var Sequelize=require(_0x1c7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x1c7b('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xfebd=['sequelize','exports','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xfebd,0x12c));var _0xdfeb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfebd[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xdfeb('0x0'));module[_0xdfeb('0x1')]={'name':{'type':Sequelize[_0xdfeb('0x2')]},'description':{'type':Sequelize[_0xdfeb('0x2')]}};
\ No newline at end of file
index 6891b74..b8bc444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7954=['getFields','ServicenowField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','ServicenowConfiguration','includeAll','include','rows','catch','show','params','length','options','find','create','body'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7954,0xa7));var _0x4795=function(_0x440800,_0x391868){_0x440800=_0x440800-0x0;var _0x1b3ff9=_0x7954[_0x440800];return _0x1b3ff9;};'use strict';var emlformat=require(_0x4795('0x0'));var rimraf=require(_0x4795('0x1'));var zipdir=require(_0x4795('0x2'));var jsonpatch=require(_0x4795('0x3'));var rp=require(_0x4795('0x4'));var moment=require(_0x4795('0x5'));var BPromise=require(_0x4795('0x6'));var Mustache=require(_0x4795('0x7'));var util=require('util');var path=require(_0x4795('0x8'));var sox=require(_0x4795('0x9'));var csv=require(_0x4795('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4795('0xb'));var _=require(_0x4795('0xc'));var squel=require('squel');var crypto=require(_0x4795('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4795('0xe'));var toCsv=require(_0x4795('0xa'));var querystring=require(_0x4795('0xf'));var Papa=require(_0x4795('0x10'));var Redis=require(_0x4795('0x11'));var authService=require(_0x4795('0x12'));var qs=require(_0x4795('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4795('0x14'))(_0x4795('0x15'));var utils=require(_0x4795('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4795('0x17'));var db=require(_0x4795('0x18'))['db'];function respondWithStatusCode(_0x11aa2e,_0x54c0a6){_0x54c0a6=_0x54c0a6||0xcc;return function(_0x354074){if(_0x354074){return _0x11aa2e[_0x4795('0x19')](_0x54c0a6);}return _0x11aa2e['status'](_0x54c0a6)['end']();};}function respondWithResult(_0x3fc6fa,_0xbcc05f){_0xbcc05f=_0xbcc05f||0xc8;return function(_0x17f455){if(_0x17f455){return _0x3fc6fa[_0x4795('0x1a')](_0xbcc05f)[_0x4795('0x1b')](_0x17f455);}};}function respondWithFilteredResult(_0x10e6b1,_0x3c46b9){return function(_0xdb3fdd){if(_0xdb3fdd){var _0x56e05c=typeof _0x3c46b9[_0x4795('0x1c')]===_0x4795('0x1d')&&typeof _0x3c46b9['limit']==='undefined';var _0x42d77e=_0xdb3fdd[_0x4795('0x1e')];var _0x1497a2=_0x56e05c?0x0:_0x3c46b9[_0x4795('0x1c')];var _0x32f3ab=_0x56e05c?_0xdb3fdd[_0x4795('0x1e')]:_0x3c46b9['offset']+_0x3c46b9['limit'];var _0x5d0f70;if(_0x32f3ab>=_0x42d77e){_0x32f3ab=_0x42d77e;_0x5d0f70=0xc8;}else{_0x5d0f70=0xce;}_0x10e6b1[_0x4795('0x1a')](_0x5d0f70);return _0x10e6b1[_0x4795('0x1f')](_0x4795('0x20'),_0x1497a2+'-'+_0x32f3ab+'/'+_0x42d77e)[_0x4795('0x1b')](_0xdb3fdd);}return null;};}function patchUpdates(_0x3753e9){return function(_0x2df043){try{jsonpatch[_0x4795('0x21')](_0x2df043,_0x3753e9,!![]);}catch(_0x4ca714){return BPromise[_0x4795('0x22')](_0x4ca714);}return _0x2df043[_0x4795('0x23')]();};}function saveUpdates(_0x141975,_0x3abe2c){return function(_0x55af44){if(_0x55af44){return _0x55af44[_0x4795('0x24')](_0x141975)[_0x4795('0x25')](function(_0x37cc74){return _0x37cc74;});}return null;};}function removeEntity(_0xa69e1b,_0xac85d2){return function(_0x248f77){if(_0x248f77){return _0x248f77[_0x4795('0x26')]()[_0x4795('0x25')](function(){_0xa69e1b['status'](0xcc)[_0x4795('0x27')]();});}};}function handleEntityNotFound(_0x12f0bb,_0x209f8c){return function(_0x2ef7f7){if(!_0x2ef7f7){_0x12f0bb[_0x4795('0x19')](0x194);}return _0x2ef7f7;};}function handleError(_0x528b2d,_0x1a07c7){_0x1a07c7=_0x1a07c7||0x1f4;return function(_0x5dbc21){logger[_0x4795('0x28')](_0x5dbc21[_0x4795('0x29')]);if(_0x5dbc21[_0x4795('0x2a')]){delete _0x5dbc21[_0x4795('0x2a')];}_0x528b2d['status'](_0x1a07c7)['send'](_0x5dbc21);};}exports[_0x4795('0x2b')]=function(_0x132574,_0x80cc1e){var _0x46699e={},_0x4dd90e={},_0x365a79={'count':0x0,'rows':[]};var _0x36c08c=_[_0x4795('0x2c')](db['ServicenowConfiguration'][_0x4795('0x2d')],function(_0xf18dd1){return{'name':_0xf18dd1['fieldName'],'type':_0xf18dd1[_0x4795('0x2e')][_0x4795('0x2f')]};});_0x4dd90e[_0x4795('0x30')]=_[_0x4795('0x2c')](_0x36c08c,'name');_0x4dd90e[_0x4795('0x31')]=_[_0x4795('0x32')](_0x132574['query']);_0x4dd90e['filters']=_[_0x4795('0x33')](_0x4dd90e['model'],_0x4dd90e[_0x4795('0x31')]);_0x46699e[_0x4795('0x34')]=_['intersection'](_0x4dd90e[_0x4795('0x30')],qs['fields'](_0x132574[_0x4795('0x31')][_0x4795('0x35')]));_0x46699e[_0x4795('0x34')]=_0x46699e[_0x4795('0x34')]['length']?_0x46699e[_0x4795('0x34')]:_0x4dd90e['model'];if(!_0x132574[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x46699e['limit']=qs[_0x4795('0x38')](_0x132574[_0x4795('0x31')][_0x4795('0x38')]);_0x46699e[_0x4795('0x1c')]=qs['offset'](_0x132574['query'][_0x4795('0x1c')]);}_0x46699e[_0x4795('0x39')]=qs[_0x4795('0x3a')](_0x132574[_0x4795('0x31')][_0x4795('0x3a')]);_0x46699e[_0x4795('0x3b')]=qs['filters'](_[_0x4795('0x3c')](_0x132574['query'],_0x4dd90e[_0x4795('0x3d')]),_0x36c08c);if(_0x132574[_0x4795('0x31')][_0x4795('0x3e')]){_0x46699e[_0x4795('0x3b')]=_[_0x4795('0x3f')](_0x46699e[_0x4795('0x3b')],{'$or':_[_0x4795('0x2c')](_0x36c08c,function(_0x54e1e5){if(_0x54e1e5[_0x4795('0x2e')]!=='VIRTUAL'){var _0x16f6c0={};_0x16f6c0[_0x54e1e5[_0x4795('0x2a')]]={'$like':'%'+_0x132574[_0x4795('0x31')][_0x4795('0x3e')]+'%'};return _0x16f6c0;}})});}_0x46699e=_[_0x4795('0x3f')]({},_0x46699e,_0x132574['options']);var _0x2ec3d2={'where':_0x46699e[_0x4795('0x3b')]};return db[_0x4795('0x40')]['count'](_0x2ec3d2)[_0x4795('0x25')](function(_0x337145){_0x365a79[_0x4795('0x1e')]=_0x337145;if(_0x132574['query'][_0x4795('0x41')]){_0x46699e[_0x4795('0x42')]=[{'all':!![]}];}return db[_0x4795('0x40')]['findAll'](_0x46699e);})[_0x4795('0x25')](function(_0x195e3b){_0x365a79[_0x4795('0x43')]=_0x195e3b;return _0x365a79;})[_0x4795('0x25')](respondWithFilteredResult(_0x80cc1e,_0x46699e))[_0x4795('0x44')](handleError(_0x80cc1e,null));};exports[_0x4795('0x45')]=function(_0x57d68b,_0xb33955){var _0x1a4f9b={'raw':![],'where':{'id':_0x57d68b[_0x4795('0x46')]['id']}},_0x301e42={};_0x301e42[_0x4795('0x30')]=_[_0x4795('0x32')](db[_0x4795('0x40')]['rawAttributes']);_0x301e42[_0x4795('0x31')]=_[_0x4795('0x32')](_0x57d68b[_0x4795('0x31')]);_0x301e42['filters']=_[_0x4795('0x33')](_0x301e42[_0x4795('0x30')],_0x301e42['query']);_0x1a4f9b[_0x4795('0x34')]=_[_0x4795('0x33')](_0x301e42[_0x4795('0x30')],qs[_0x4795('0x35')](_0x57d68b['query'][_0x4795('0x35')]));_0x1a4f9b['attributes']=_0x1a4f9b['attributes'][_0x4795('0x47')]?_0x1a4f9b[_0x4795('0x34')]:_0x301e42[_0x4795('0x30')];if(_0x57d68b[_0x4795('0x31')][_0x4795('0x41')]){_0x1a4f9b[_0x4795('0x42')]=[{'all':!![]}];}_0x1a4f9b=_[_0x4795('0x3f')]({},_0x1a4f9b,_0x57d68b[_0x4795('0x48')]);return db['ServicenowConfiguration'][_0x4795('0x49')](_0x1a4f9b)[_0x4795('0x25')](handleEntityNotFound(_0xb33955,null))[_0x4795('0x25')](respondWithResult(_0xb33955,null))[_0x4795('0x44')](handleError(_0xb33955,null));};exports[_0x4795('0x4a')]=function(_0x29f875,_0x1668c9){return db[_0x4795('0x40')][_0x4795('0x4a')](_0x29f875['body'],{})[_0x4795('0x25')](respondWithResult(_0x1668c9,0xc9))['catch'](handleError(_0x1668c9,null));};exports[_0x4795('0x24')]=function(_0x1de816,_0x4de3d){if(_0x1de816[_0x4795('0x4b')]['id']){delete _0x1de816[_0x4795('0x4b')]['id'];}return db[_0x4795('0x40')][_0x4795('0x49')]({'where':{'id':_0x1de816[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x4de3d,null))[_0x4795('0x25')](saveUpdates(_0x1de816[_0x4795('0x4b')],null))['then'](respondWithResult(_0x4de3d,null))['catch'](handleError(_0x4de3d,null));};exports[_0x4795('0x26')]=function(_0x310a53,_0x1b96bf){return db[_0x4795('0x40')][_0x4795('0x49')]({'where':{'id':_0x310a53[_0x4795('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b96bf,null))[_0x4795('0x25')](removeEntity(_0x1b96bf,null))[_0x4795('0x44')](handleError(_0x1b96bf,null));};exports[_0x4795('0x4c')]=function(_0xf1971b,_0x4c7f51,_0x4d86e5){var _0x2f31a7={};var _0x2e24be={};var _0x353815;var _0x33c279;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0xf1971b[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x4c7f51,null))['then'](function(_0x517ff5){if(_0x517ff5){_0x353815=_0x517ff5;_0x2e24be[_0x4795('0x30')]=_['keys'](db[_0x4795('0x4d')][_0x4795('0x2d')]);_0x2e24be[_0x4795('0x31')]=_[_0x4795('0x32')](_0xf1971b['query']);_0x2e24be['filters']=_[_0x4795('0x33')](_0x2e24be[_0x4795('0x30')],_0x2e24be[_0x4795('0x31')]);_0x2f31a7['attributes']=_['intersection'](_0x2e24be['model'],qs[_0x4795('0x35')](_0xf1971b[_0x4795('0x31')][_0x4795('0x35')]));_0x2f31a7[_0x4795('0x34')]=_0x2f31a7[_0x4795('0x34')]['length']?_0x2f31a7[_0x4795('0x34')]:_0x2e24be[_0x4795('0x30')];_0x2f31a7['order']=qs[_0x4795('0x3a')](_0xf1971b[_0x4795('0x31')]['sort']);_0x2f31a7['where']=qs['filters'](_[_0x4795('0x3c')](_0xf1971b['query'],_0x2e24be[_0x4795('0x3d')]));if(_0xf1971b[_0x4795('0x31')][_0x4795('0x3e')]){_0x2f31a7[_0x4795('0x3b')]=_['merge'](_0x2f31a7[_0x4795('0x3b')],{'$or':_[_0x4795('0x2c')](_0x2f31a7[_0x4795('0x34')],function(_0x3891ae){var _0xfd4c74={};_0xfd4c74[_0x3891ae]={'$like':'%'+_0xf1971b[_0x4795('0x31')][_0x4795('0x3e')]+'%'};return _0xfd4c74;})});}_0x2f31a7=_[_0x4795('0x3f')]({},_0x2f31a7,_0xf1971b[_0x4795('0x48')]);return _0x353815['getFields'](_0x2f31a7);}})[_0x4795('0x25')](function(_0x3cecef){if(_0x3cecef){_0x33c279=_0x3cecef['length'];if(!_0xf1971b[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x2f31a7[_0x4795('0x38')]=qs[_0x4795('0x38')](_0xf1971b[_0x4795('0x31')][_0x4795('0x38')]);_0x2f31a7[_0x4795('0x1c')]=qs['offset'](_0xf1971b[_0x4795('0x31')]['offset']);}return _0x353815[_0x4795('0x4c')](_0x2f31a7);}})['then'](function(_0x17061c){if(_0x17061c){return _0x17061c?{'count':_0x33c279,'rows':_0x17061c}:null;}})[_0x4795('0x25')](respondWithResult(_0x4c7f51,null))[_0x4795('0x44')](handleError(_0x4c7f51,null));};exports[_0x4795('0x4e')]=function(_0x4886a4,_0x17a633,_0x538555){var _0x1692b9={};var _0xb70f05={};var _0x4add22;var _0x2b4091;return db[_0x4795('0x40')][_0x4795('0x4f')]({'where':{'id':_0x4886a4[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x17a633,null))[_0x4795('0x25')](function(_0x4dfb38){if(_0x4dfb38){_0x4add22=_0x4dfb38;_0xb70f05[_0x4795('0x30')]=_[_0x4795('0x32')](db[_0x4795('0x4d')][_0x4795('0x2d')]);_0xb70f05['query']=_[_0x4795('0x32')](_0x4886a4[_0x4795('0x31')]);_0xb70f05[_0x4795('0x3d')]=_[_0x4795('0x33')](_0xb70f05[_0x4795('0x30')],_0xb70f05[_0x4795('0x31')]);_0x1692b9[_0x4795('0x34')]=_['intersection'](_0xb70f05[_0x4795('0x30')],qs['fields'](_0x4886a4['query'][_0x4795('0x35')]));_0x1692b9['attributes']=_0x1692b9[_0x4795('0x34')][_0x4795('0x47')]?_0x1692b9['attributes']:_0xb70f05[_0x4795('0x30')];_0x1692b9[_0x4795('0x39')]=qs[_0x4795('0x3a')](_0x4886a4[_0x4795('0x31')][_0x4795('0x3a')]);_0x1692b9[_0x4795('0x3b')]=qs['filters'](_[_0x4795('0x3c')](_0x4886a4[_0x4795('0x31')],_0xb70f05[_0x4795('0x3d')]));if(_0x4886a4[_0x4795('0x31')][_0x4795('0x3e')]){_0x1692b9[_0x4795('0x3b')]=_[_0x4795('0x3f')](_0x1692b9['where'],{'$or':_[_0x4795('0x2c')](_0x1692b9['attributes'],function(_0x45b65e){var _0x165101={};_0x165101[_0x45b65e]={'$like':'%'+_0x4886a4[_0x4795('0x31')]['filter']+'%'};return _0x165101;})});}_0x1692b9=_[_0x4795('0x3f')]({},_0x1692b9,_0x4886a4[_0x4795('0x48')]);return _0x4add22[_0x4795('0x4e')](_0x1692b9);}})[_0x4795('0x25')](function(_0x90576){if(_0x90576){_0x2b4091=_0x90576[_0x4795('0x47')];if(!_0x4886a4[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x1692b9[_0x4795('0x38')]=qs['limit'](_0x4886a4[_0x4795('0x31')][_0x4795('0x38')]);_0x1692b9[_0x4795('0x1c')]=qs[_0x4795('0x1c')](_0x4886a4[_0x4795('0x31')]['offset']);}return _0x4add22[_0x4795('0x4e')](_0x1692b9);}})[_0x4795('0x25')](function(_0x2d5ef5){if(_0x2d5ef5){return _0x2d5ef5?{'count':_0x2b4091,'rows':_0x2d5ef5}:null;}})[_0x4795('0x25')](respondWithResult(_0x17a633,null))['catch'](handleError(_0x17a633,null));};exports[_0x4795('0x50')]=function(_0x552ec6,_0x5bf034,_0xc15b27){var _0x3028e9={};var _0x33a8e5={};var _0x3da1de;var _0x33ceb7;return db[_0x4795('0x40')][_0x4795('0x4f')]({'where':{'id':_0x552ec6[_0x4795('0x46')]['id']}})[_0x4795('0x25')](handleEntityNotFound(_0x5bf034,null))[_0x4795('0x25')](function(_0x30bf51){if(_0x30bf51){_0x3da1de=_0x30bf51;_0x33a8e5[_0x4795('0x30')]=_[_0x4795('0x32')](db[_0x4795('0x4d')][_0x4795('0x2d')]);_0x33a8e5['query']=_[_0x4795('0x32')](_0x552ec6[_0x4795('0x31')]);_0x33a8e5['filters']=_['intersection'](_0x33a8e5['model'],_0x33a8e5[_0x4795('0x31')]);_0x3028e9[_0x4795('0x34')]=_[_0x4795('0x33')](_0x33a8e5[_0x4795('0x30')],qs[_0x4795('0x35')](_0x552ec6[_0x4795('0x31')][_0x4795('0x35')]));_0x3028e9[_0x4795('0x34')]=_0x3028e9['attributes'][_0x4795('0x47')]?_0x3028e9[_0x4795('0x34')]:_0x33a8e5[_0x4795('0x30')];_0x3028e9[_0x4795('0x39')]=qs[_0x4795('0x3a')](_0x552ec6[_0x4795('0x31')][_0x4795('0x3a')]);_0x3028e9[_0x4795('0x3b')]=qs[_0x4795('0x3d')](_['pick'](_0x552ec6[_0x4795('0x31')],_0x33a8e5[_0x4795('0x3d')]));if(_0x552ec6[_0x4795('0x31')]['filter']){_0x3028e9['where']=_[_0x4795('0x3f')](_0x3028e9[_0x4795('0x3b')],{'$or':_[_0x4795('0x2c')](_0x3028e9[_0x4795('0x34')],function(_0x59880c){var _0x2a08f3={};_0x2a08f3[_0x59880c]={'$like':'%'+_0x552ec6[_0x4795('0x31')][_0x4795('0x3e')]+'%'};return _0x2a08f3;})});}_0x3028e9=_[_0x4795('0x3f')]({},_0x3028e9,_0x552ec6[_0x4795('0x48')]);return _0x3da1de['getDescriptions'](_0x3028e9);}})[_0x4795('0x25')](function(_0x164014){if(_0x164014){_0x33ceb7=_0x164014[_0x4795('0x47')];if(!_0x552ec6[_0x4795('0x31')][_0x4795('0x36')](_0x4795('0x37'))){_0x3028e9[_0x4795('0x38')]=qs[_0x4795('0x38')](_0x552ec6['query'][_0x4795('0x38')]);_0x3028e9['offset']=qs[_0x4795('0x1c')](_0x552ec6[_0x4795('0x31')][_0x4795('0x1c')]);}return _0x3da1de[_0x4795('0x50')](_0x3028e9);}})['then'](function(_0x20eb76){if(_0x20eb76){return _0x20eb76?{'count':_0x33ceb7,'rows':_0x20eb76}:null;}})['then'](respondWithResult(_0x5bf034,null))[_0x4795('0x44')](handleError(_0x5bf034,null));};
\ No newline at end of file
+var _0x23f0=['params','intersection','find','catch','create','body','update','findOne','ServicenowField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','then','destroy','sendStatus','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show'];(function(_0x3ae516,_0x4b97c5){var _0x2b257a=function(_0x1aa718){while(--_0x1aa718){_0x3ae516['push'](_0x3ae516['shift']());}};_0x2b257a(++_0x4b97c5);}(_0x23f0,0x139));var _0x023f=function(_0x140157,_0x29b06f){_0x140157=_0x140157-0x0;var _0x3f8e46=_0x23f0[_0x140157];return _0x3f8e46;};'use strict';var emlformat=require(_0x023f('0x0'));var rimraf=require(_0x023f('0x1'));var zipdir=require(_0x023f('0x2'));var jsonpatch=require(_0x023f('0x3'));var rp=require('request-promise');var moment=require(_0x023f('0x4'));var BPromise=require(_0x023f('0x5'));var Mustache=require(_0x023f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x023f('0x7'));var csv=require(_0x023f('0x8'));var ejs=require(_0x023f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x023f('0xa'));var squel=require('squel');var crypto=require(_0x023f('0xb'));var jsforce=require(_0x023f('0xc'));var deskjs=require(_0x023f('0xd'));var toCsv=require(_0x023f('0x8'));var querystring=require('querystring');var Papa=require(_0x023f('0xe'));var Redis=require(_0x023f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x023f('0x10'));var hardwareService=require(_0x023f('0x11'));var logger=require('../../config/logger')(_0x023f('0x12'));var utils=require(_0x023f('0x13'));var config=require(_0x023f('0x14'));var licenseUtil=require(_0x023f('0x15'));var db=require(_0x023f('0x16'))['db'];function respondWithStatusCode(_0x451f1d,_0x3f677e){_0x3f677e=_0x3f677e||0xcc;return function(_0x2564a2){if(_0x2564a2){return _0x451f1d['sendStatus'](_0x3f677e);}return _0x451f1d['status'](_0x3f677e)[_0x023f('0x17')]();};}function respondWithResult(_0x588981,_0x7e80d1){_0x7e80d1=_0x7e80d1||0xc8;return function(_0x4f72dc){if(_0x4f72dc){return _0x588981[_0x023f('0x18')](_0x7e80d1)[_0x023f('0x19')](_0x4f72dc);}};}function respondWithFilteredResult(_0x372693,_0x338350){return function(_0x318892){if(_0x318892){var _0x129b50=typeof _0x338350[_0x023f('0x1a')]===_0x023f('0x1b')&&typeof _0x338350[_0x023f('0x1c')]===_0x023f('0x1b');var _0x1b6be9=_0x318892[_0x023f('0x1d')];var _0x2232ee=_0x129b50?0x0:_0x338350[_0x023f('0x1a')];var _0x3955df=_0x129b50?_0x318892[_0x023f('0x1d')]:_0x338350['offset']+_0x338350['limit'];var _0x460680;if(_0x3955df>=_0x1b6be9){_0x3955df=_0x1b6be9;_0x460680=0xc8;}else{_0x460680=0xce;}_0x372693['status'](_0x460680);return _0x372693['set']('Content-Range',_0x2232ee+'-'+_0x3955df+'/'+_0x1b6be9)[_0x023f('0x19')](_0x318892);}return null;};}function patchUpdates(_0x417d9d){return function(_0x1aebca){try{jsonpatch['apply'](_0x1aebca,_0x417d9d,!![]);}catch(_0x317aef){return BPromise['reject'](_0x317aef);}return _0x1aebca['save']();};}function saveUpdates(_0x497ece,_0x1f1a99){return function(_0x5d1706){if(_0x5d1706){return _0x5d1706['update'](_0x497ece)[_0x023f('0x1e')](function(_0x4fcad8){return _0x4fcad8;});}return null;};}function removeEntity(_0x46a892,_0x939a7f){return function(_0x46dbab){if(_0x46dbab){return _0x46dbab[_0x023f('0x1f')]()[_0x023f('0x1e')](function(){_0x46a892[_0x023f('0x18')](0xcc)[_0x023f('0x17')]();});}};}function handleEntityNotFound(_0x34cd4f,_0x1c66e5){return function(_0x3fbfda){if(!_0x3fbfda){_0x34cd4f[_0x023f('0x20')](0x194);}return _0x3fbfda;};}function handleError(_0x35cda2,_0x508465){_0x508465=_0x508465||0x1f4;return function(_0x41c60c){logger['error'](_0x41c60c[_0x023f('0x21')]);if(_0x41c60c['name']){delete _0x41c60c[_0x023f('0x22')];}_0x35cda2['status'](_0x508465)[_0x023f('0x23')](_0x41c60c);};}exports[_0x023f('0x24')]=function(_0x3dbd23,_0x36942f){var _0xb3d7c4={},_0xca06e5={},_0x588f5c={'count':0x0,'rows':[]};var _0x3539a0=_[_0x023f('0x25')](db[_0x023f('0x26')][_0x023f('0x27')],function(_0x1b002b){return{'name':_0x1b002b['fieldName'],'type':_0x1b002b[_0x023f('0x28')][_0x023f('0x29')]};});_0xca06e5['model']=_['map'](_0x3539a0,'name');_0xca06e5[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x3dbd23[_0x023f('0x2a')]);_0xca06e5[_0x023f('0x2c')]=_['intersection'](_0xca06e5[_0x023f('0x2d')],_0xca06e5[_0x023f('0x2a')]);_0xb3d7c4['attributes']=_['intersection'](_0xca06e5['model'],qs[_0x023f('0x2e')](_0x3dbd23['query'][_0x023f('0x2e')]));_0xb3d7c4['attributes']=_0xb3d7c4[_0x023f('0x2f')][_0x023f('0x30')]?_0xb3d7c4[_0x023f('0x2f')]:_0xca06e5[_0x023f('0x2d')];if(!_0x3dbd23[_0x023f('0x2a')][_0x023f('0x31')]('nolimit')){_0xb3d7c4[_0x023f('0x1c')]=qs[_0x023f('0x1c')](_0x3dbd23[_0x023f('0x2a')][_0x023f('0x1c')]);_0xb3d7c4[_0x023f('0x1a')]=qs['offset'](_0x3dbd23[_0x023f('0x2a')][_0x023f('0x1a')]);}_0xb3d7c4[_0x023f('0x32')]=qs['sort'](_0x3dbd23[_0x023f('0x2a')][_0x023f('0x33')]);_0xb3d7c4[_0x023f('0x34')]=qs['filters'](_[_0x023f('0x35')](_0x3dbd23[_0x023f('0x2a')],_0xca06e5['filters']),_0x3539a0);if(_0x3dbd23[_0x023f('0x2a')][_0x023f('0x36')]){_0xb3d7c4[_0x023f('0x34')]=_['merge'](_0xb3d7c4[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x3539a0,function(_0x11a00b){if(_0x11a00b[_0x023f('0x28')]!==_0x023f('0x37')){var _0x5b44b0={};_0x5b44b0[_0x11a00b[_0x023f('0x22')]]={'$like':'%'+_0x3dbd23[_0x023f('0x2a')][_0x023f('0x36')]+'%'};return _0x5b44b0;}})});}_0xb3d7c4=_[_0x023f('0x38')]({},_0xb3d7c4,_0x3dbd23[_0x023f('0x39')]);var _0x58ae58={'where':_0xb3d7c4['where']};return db[_0x023f('0x26')][_0x023f('0x1d')](_0x58ae58)['then'](function(_0x135bf8){_0x588f5c[_0x023f('0x1d')]=_0x135bf8;if(_0x3dbd23['query'][_0x023f('0x3a')]){_0xb3d7c4['include']=[{'all':!![]}];}return db[_0x023f('0x26')][_0x023f('0x3b')](_0xb3d7c4);})[_0x023f('0x1e')](function(_0x57391f){_0x588f5c[_0x023f('0x3c')]=_0x57391f;return _0x588f5c;})[_0x023f('0x1e')](respondWithFilteredResult(_0x36942f,_0xb3d7c4))['catch'](handleError(_0x36942f,null));};exports[_0x023f('0x3d')]=function(_0x25a8ac,_0x1a6eee){var _0x4fa6f7={'raw':![],'where':{'id':_0x25a8ac[_0x023f('0x3e')]['id']}},_0x44823a={};_0x44823a[_0x023f('0x2d')]=_[_0x023f('0x2b')](db[_0x023f('0x26')][_0x023f('0x27')]);_0x44823a[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x25a8ac[_0x023f('0x2a')]);_0x44823a[_0x023f('0x2c')]=_['intersection'](_0x44823a[_0x023f('0x2d')],_0x44823a[_0x023f('0x2a')]);_0x4fa6f7[_0x023f('0x2f')]=_[_0x023f('0x3f')](_0x44823a[_0x023f('0x2d')],qs['fields'](_0x25a8ac[_0x023f('0x2a')][_0x023f('0x2e')]));_0x4fa6f7[_0x023f('0x2f')]=_0x4fa6f7[_0x023f('0x2f')][_0x023f('0x30')]?_0x4fa6f7[_0x023f('0x2f')]:_0x44823a[_0x023f('0x2d')];if(_0x25a8ac[_0x023f('0x2a')][_0x023f('0x3a')]){_0x4fa6f7['include']=[{'all':!![]}];}_0x4fa6f7=_[_0x023f('0x38')]({},_0x4fa6f7,_0x25a8ac[_0x023f('0x39')]);return db['ServicenowConfiguration'][_0x023f('0x40')](_0x4fa6f7)['then'](handleEntityNotFound(_0x1a6eee,null))[_0x023f('0x1e')](respondWithResult(_0x1a6eee,null))[_0x023f('0x41')](handleError(_0x1a6eee,null));};exports[_0x023f('0x42')]=function(_0x191e69,_0x2c5691){return db[_0x023f('0x26')][_0x023f('0x42')](_0x191e69[_0x023f('0x43')],{})[_0x023f('0x1e')](respondWithResult(_0x2c5691,0xc9))[_0x023f('0x41')](handleError(_0x2c5691,null));};exports[_0x023f('0x44')]=function(_0x381c1a,_0x29291b){if(_0x381c1a[_0x023f('0x43')]['id']){delete _0x381c1a['body']['id'];}return db[_0x023f('0x26')][_0x023f('0x40')]({'where':{'id':_0x381c1a['params']['id']}})[_0x023f('0x1e')](handleEntityNotFound(_0x29291b,null))['then'](saveUpdates(_0x381c1a[_0x023f('0x43')],null))[_0x023f('0x1e')](respondWithResult(_0x29291b,null))[_0x023f('0x41')](handleError(_0x29291b,null));};exports[_0x023f('0x1f')]=function(_0x3d8c89,_0x29efcb){return db[_0x023f('0x26')][_0x023f('0x40')]({'where':{'id':_0x3d8c89[_0x023f('0x3e')]['id']}})[_0x023f('0x1e')](handleEntityNotFound(_0x29efcb,null))[_0x023f('0x1e')](removeEntity(_0x29efcb,null))[_0x023f('0x41')](handleError(_0x29efcb,null));};exports['getFields']=function(_0x1a79fb,_0x13b0ec,_0x25200d){var _0x2566c5={};var _0x7cfcab={};var _0x5bb505;var _0x51cc6a;return db[_0x023f('0x26')][_0x023f('0x45')]({'where':{'id':_0x1a79fb[_0x023f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x13b0ec,null))[_0x023f('0x1e')](function(_0x32dd0b){if(_0x32dd0b){_0x5bb505=_0x32dd0b;_0x7cfcab['model']=_[_0x023f('0x2b')](db[_0x023f('0x46')][_0x023f('0x27')]);_0x7cfcab[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x1a79fb['query']);_0x7cfcab[_0x023f('0x2c')]=_[_0x023f('0x3f')](_0x7cfcab[_0x023f('0x2d')],_0x7cfcab[_0x023f('0x2a')]);_0x2566c5['attributes']=_[_0x023f('0x3f')](_0x7cfcab[_0x023f('0x2d')],qs['fields'](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x2e')]));_0x2566c5[_0x023f('0x2f')]=_0x2566c5[_0x023f('0x2f')][_0x023f('0x30')]?_0x2566c5[_0x023f('0x2f')]:_0x7cfcab[_0x023f('0x2d')];_0x2566c5[_0x023f('0x32')]=qs[_0x023f('0x33')](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x33')]);_0x2566c5['where']=qs['filters'](_[_0x023f('0x35')](_0x1a79fb[_0x023f('0x2a')],_0x7cfcab[_0x023f('0x2c')]));if(_0x1a79fb[_0x023f('0x2a')]['filter']){_0x2566c5['where']=_['merge'](_0x2566c5[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x2566c5[_0x023f('0x2f')],function(_0x33d01b){var _0x45c208={};_0x45c208[_0x33d01b]={'$like':'%'+_0x1a79fb['query'][_0x023f('0x36')]+'%'};return _0x45c208;})});}_0x2566c5=_[_0x023f('0x38')]({},_0x2566c5,_0x1a79fb[_0x023f('0x39')]);return _0x5bb505[_0x023f('0x47')](_0x2566c5);}})['then'](function(_0x54ca0c){if(_0x54ca0c){_0x51cc6a=_0x54ca0c[_0x023f('0x30')];if(!_0x1a79fb[_0x023f('0x2a')][_0x023f('0x31')](_0x023f('0x48'))){_0x2566c5[_0x023f('0x1c')]=qs['limit'](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x1c')]);_0x2566c5[_0x023f('0x1a')]=qs[_0x023f('0x1a')](_0x1a79fb[_0x023f('0x2a')][_0x023f('0x1a')]);}return _0x5bb505[_0x023f('0x47')](_0x2566c5);}})[_0x023f('0x1e')](function(_0x153cf3){if(_0x153cf3){return _0x153cf3?{'count':_0x51cc6a,'rows':_0x153cf3}:null;}})['then'](respondWithResult(_0x13b0ec,null))['catch'](handleError(_0x13b0ec,null));};exports[_0x023f('0x49')]=function(_0x58e406,_0x2ea5e9,_0x47cd11){var _0x2b0587={};var _0x2e6fde={};var _0x4fd3a4;var _0x9331e1;return db[_0x023f('0x26')][_0x023f('0x45')]({'where':{'id':_0x58e406[_0x023f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2ea5e9,null))[_0x023f('0x1e')](function(_0x3f1f1e){if(_0x3f1f1e){_0x4fd3a4=_0x3f1f1e;_0x2e6fde[_0x023f('0x2d')]=_[_0x023f('0x2b')](db[_0x023f('0x46')][_0x023f('0x27')]);_0x2e6fde[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x58e406['query']);_0x2e6fde[_0x023f('0x2c')]=_[_0x023f('0x3f')](_0x2e6fde[_0x023f('0x2d')],_0x2e6fde['query']);_0x2b0587[_0x023f('0x2f')]=_[_0x023f('0x3f')](_0x2e6fde[_0x023f('0x2d')],qs['fields'](_0x58e406[_0x023f('0x2a')][_0x023f('0x2e')]));_0x2b0587[_0x023f('0x2f')]=_0x2b0587[_0x023f('0x2f')][_0x023f('0x30')]?_0x2b0587[_0x023f('0x2f')]:_0x2e6fde['model'];_0x2b0587['order']=qs[_0x023f('0x33')](_0x58e406[_0x023f('0x2a')][_0x023f('0x33')]);_0x2b0587[_0x023f('0x34')]=qs[_0x023f('0x2c')](_[_0x023f('0x35')](_0x58e406[_0x023f('0x2a')],_0x2e6fde[_0x023f('0x2c')]));if(_0x58e406[_0x023f('0x2a')][_0x023f('0x36')]){_0x2b0587[_0x023f('0x34')]=_[_0x023f('0x38')](_0x2b0587[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x2b0587[_0x023f('0x2f')],function(_0x2303fb){var _0x1955c3={};_0x1955c3[_0x2303fb]={'$like':'%'+_0x58e406[_0x023f('0x2a')][_0x023f('0x36')]+'%'};return _0x1955c3;})});}_0x2b0587=_['merge']({},_0x2b0587,_0x58e406[_0x023f('0x39')]);return _0x4fd3a4['getSubjects'](_0x2b0587);}})[_0x023f('0x1e')](function(_0x431795){if(_0x431795){_0x9331e1=_0x431795[_0x023f('0x30')];if(!_0x58e406[_0x023f('0x2a')]['hasOwnProperty'](_0x023f('0x48'))){_0x2b0587['limit']=qs[_0x023f('0x1c')](_0x58e406[_0x023f('0x2a')][_0x023f('0x1c')]);_0x2b0587[_0x023f('0x1a')]=qs['offset'](_0x58e406[_0x023f('0x2a')][_0x023f('0x1a')]);}return _0x4fd3a4[_0x023f('0x49')](_0x2b0587);}})[_0x023f('0x1e')](function(_0x3a9643){if(_0x3a9643){return _0x3a9643?{'count':_0x9331e1,'rows':_0x3a9643}:null;}})[_0x023f('0x1e')](respondWithResult(_0x2ea5e9,null))[_0x023f('0x41')](handleError(_0x2ea5e9,null));};exports['getDescriptions']=function(_0x5a1c96,_0x483bc8,_0x58b6df){var _0x1d30fb={};var _0x14092d={};var _0x4a5ce7;var _0x1dbb4a;return db[_0x023f('0x26')][_0x023f('0x45')]({'where':{'id':_0x5a1c96[_0x023f('0x3e')]['id']}})[_0x023f('0x1e')](handleEntityNotFound(_0x483bc8,null))[_0x023f('0x1e')](function(_0x582017){if(_0x582017){_0x4a5ce7=_0x582017;_0x14092d['model']=_[_0x023f('0x2b')](db[_0x023f('0x46')][_0x023f('0x27')]);_0x14092d[_0x023f('0x2a')]=_[_0x023f('0x2b')](_0x5a1c96[_0x023f('0x2a')]);_0x14092d['filters']=_['intersection'](_0x14092d[_0x023f('0x2d')],_0x14092d[_0x023f('0x2a')]);_0x1d30fb['attributes']=_['intersection'](_0x14092d['model'],qs['fields'](_0x5a1c96[_0x023f('0x2a')]['fields']));_0x1d30fb[_0x023f('0x2f')]=_0x1d30fb[_0x023f('0x2f')][_0x023f('0x30')]?_0x1d30fb[_0x023f('0x2f')]:_0x14092d[_0x023f('0x2d')];_0x1d30fb[_0x023f('0x32')]=qs[_0x023f('0x33')](_0x5a1c96['query'][_0x023f('0x33')]);_0x1d30fb['where']=qs['filters'](_[_0x023f('0x35')](_0x5a1c96['query'],_0x14092d[_0x023f('0x2c')]));if(_0x5a1c96[_0x023f('0x2a')]['filter']){_0x1d30fb[_0x023f('0x34')]=_[_0x023f('0x38')](_0x1d30fb[_0x023f('0x34')],{'$or':_[_0x023f('0x25')](_0x1d30fb['attributes'],function(_0x5a1983){var _0x5a7ce3={};_0x5a7ce3[_0x5a1983]={'$like':'%'+_0x5a1c96[_0x023f('0x2a')][_0x023f('0x36')]+'%'};return _0x5a7ce3;})});}_0x1d30fb=_['merge']({},_0x1d30fb,_0x5a1c96['options']);return _0x4a5ce7[_0x023f('0x4a')](_0x1d30fb);}})[_0x023f('0x1e')](function(_0x207f38){if(_0x207f38){_0x1dbb4a=_0x207f38[_0x023f('0x30')];if(!_0x5a1c96[_0x023f('0x2a')][_0x023f('0x31')]('nolimit')){_0x1d30fb[_0x023f('0x1c')]=qs['limit'](_0x5a1c96[_0x023f('0x2a')][_0x023f('0x1c')]);_0x1d30fb[_0x023f('0x1a')]=qs[_0x023f('0x1a')](_0x5a1c96['query'][_0x023f('0x1a')]);}return _0x4a5ce7[_0x023f('0x4a')](_0x1d30fb);}})[_0x023f('0x1e')](function(_0x2564b7){if(_0x2564b7){return _0x2564b7?{'count':_0x1dbb4a,'rows':_0x2564b7}:null;}})[_0x023f('0x1e')](respondWithResult(_0x483bc8,null))['catch'](handleError(_0x483bc8,null));};
\ No newline at end of file
index 66a9b70..0de050e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x4fc2,0x111));var _0x24fc=function(_0x46e85e,_0x48ad32){_0x46e85e=_0x46e85e-0x0;var _0x402ec5=_0x4fc2[_0x46e85e];return _0x402ec5;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1aa=['moment','bluebird','rimraf','../../config/environment','exports','ServicenowConfiguration','util','../../config/logger','api'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa1aa,0x19b));var _0xaa1a=function(_0x708e3b,_0x2d54b3){_0x708e3b=_0x708e3b-0x0;var _0x4353ed=_0xa1aa[_0x708e3b];return _0x4353ed;};'use strict';var _=require('lodash');var util=require(_0xaa1a('0x0'));var logger=require(_0xaa1a('0x1'))(_0xaa1a('0x2'));var moment=require(_0xaa1a('0x3'));var BPromise=require(_0xaa1a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa1a('0x5'));var config=require(_0xaa1a('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xaa1a('0x7')]=function(_0x370a4e,_0x243c15){return _0x370a4e['define'](_0xaa1a('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e207203..d8fb735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c75=['debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x5e8584,_0xab5d1f){var _0x500b5a=function(_0x5b4223){while(--_0x5b4223){_0x5e8584['push'](_0x5e8584['shift']());}};_0x500b5a(++_0xab5d1f);}(_0x0c75,0x6a));var _0x50c7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0c75[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x50c7('0x0'));var moment=require('moment');var BPromise=require(_0x50c7('0x1'));var rs=require(_0x50c7('0x2'));var fs=require('fs');var Redis=require(_0x50c7('0x3'));var db=require(_0x50c7('0x4'))['db'];var utils=require(_0x50c7('0x5'));var logger=require(_0x50c7('0x6'))(_0x50c7('0x7'));var config=require('../../config/environment');var jayson=require(_0x50c7('0x8'));var client=jayson['client'][_0x50c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x594830,_0x34a297,_0x172856){return new BPromise(function(_0x44d102,_0x53ef83){return client['request'](_0x594830,_0x172856)[_0x50c7('0xa')](function(_0x474dc0){logger[_0x50c7('0xb')](_0x50c7('0xc'),_0x34a297,_0x50c7('0xd'));logger[_0x50c7('0xe')](_0x50c7('0xf'),_0x34a297,'request\x20sent',JSON['stringify'](_0x474dc0));if(_0x474dc0[_0x50c7('0x10')]){if(_0x474dc0[_0x50c7('0x10')][_0x50c7('0x11')]===0x1f4){logger['error'](_0x50c7('0xc'),_0x34a297,_0x474dc0[_0x50c7('0x10')][_0x50c7('0x12')]);return _0x53ef83(_0x474dc0[_0x50c7('0x10')][_0x50c7('0x12')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x34a297,_0x474dc0[_0x50c7('0x10')][_0x50c7('0x12')]);return _0x44d102(_0x474dc0['error'][_0x50c7('0x12')]);}else{logger[_0x50c7('0xb')](_0x50c7('0xc'),_0x34a297,_0x50c7('0xd'));_0x44d102(_0x474dc0['result'][_0x50c7('0x12')]);}})[_0x50c7('0x13')](function(_0xc4d7f5){logger['error'](_0x50c7('0xc'),_0x34a297,_0xc4d7f5);_0x53ef83(_0xc4d7f5);});});}
\ No newline at end of file
+var _0xde4e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','ServicenowConfiguration,\x20%s,\x20%s','result','lodash'];(function(_0x35485a,_0x91cdd4){var _0x5148e6=function(_0x27ed1d){while(--_0x27ed1d){_0x35485a['push'](_0x35485a['shift']());}};_0x5148e6(++_0x91cdd4);}(_0xde4e,0x18e));var _0xede4=function(_0x3100eb,_0x3edfa9){_0x3100eb=_0x3100eb-0x0;var _0x21daf9=_0xde4e[_0x3100eb];return _0x21daf9;};'use strict';var _=require(_0xede4('0x0'));var util=require(_0xede4('0x1'));var moment=require('moment');var BPromise=require(_0xede4('0x2'));var rs=require(_0xede4('0x3'));var fs=require('fs');var Redis=require(_0xede4('0x4'));var db=require(_0xede4('0x5'))['db'];var utils=require(_0xede4('0x6'));var logger=require(_0xede4('0x7'))(_0xede4('0x8'));var config=require(_0xede4('0x9'));var jayson=require(_0xede4('0xa'));var client=jayson['client'][_0xede4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c2bdf,_0x227bd0,_0x387be8){return new BPromise(function(_0x22b2e6,_0x30a970){return client['request'](_0x2c2bdf,_0x387be8)['then'](function(_0x46ac85){logger[_0xede4('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x227bd0,_0xede4('0xd'));logger[_0xede4('0xe')](_0xede4('0xf'),_0x227bd0,_0xede4('0xd'),JSON[_0xede4('0x10')](_0x46ac85));if(_0x46ac85[_0xede4('0x11')]){if(_0x46ac85[_0xede4('0x11')]['code']===0x1f4){logger[_0xede4('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x227bd0,_0x46ac85['error'][_0xede4('0x12')]);return _0x30a970(_0x46ac85['error'][_0xede4('0x12')]);}logger[_0xede4('0x11')](_0xede4('0x13'),_0x227bd0,_0x46ac85['error'][_0xede4('0x12')]);return _0x22b2e6(_0x46ac85[_0xede4('0x11')][_0xede4('0x12')]);}else{logger[_0xede4('0xc')](_0xede4('0x13'),_0x227bd0,_0xede4('0xd'));_0x22b2e6(_0x46ac85[_0xede4('0x14')][_0xede4('0x12')]);}})['catch'](function(_0x53f95b){logger[_0xede4('0x11')](_0xede4('0x13'),_0x227bd0,_0x53f95b);_0x30a970(_0x53f95b);});});}
\ No newline at end of file
index fd9a1d3..d125a35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb9a=['./intServicenowField.controller','get','index','/:id','isAuthenticated','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x59237e,_0x3aff88){var _0x3b38ce=function(_0x405f2c){while(--_0x405f2c){_0x59237e['push'](_0x59237e['shift']());}};_0x3b38ce(++_0x3aff88);}(_0xdb9a,0xb5));var _0xadb9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xdb9a[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xadb9('0x0'));var util=require(_0xadb9('0x1'));var path=require(_0xadb9('0x2'));var timeout=require(_0xadb9('0x3'));var express=require(_0xadb9('0x4'));var router=express[_0xadb9('0x5')]();var fs_extra=require(_0xadb9('0x6'));var auth=require(_0xadb9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xadb9('0x8'));var controller=require(_0xadb9('0x9'));router[_0xadb9('0xa')]('/',auth['isAuthenticated'](),controller[_0xadb9('0xb')]);router['get'](_0xadb9('0xc'),auth[_0xadb9('0xd')](),controller[_0xadb9('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xadb9('0xf')](_0xadb9('0xc'),auth[_0xadb9('0xd')](),controller[_0xadb9('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xadb9('0x11')]);module[_0xadb9('0x12')]=router;
\ No newline at end of file
+var _0xcdb2=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller'];(function(_0x50a635,_0x158de3){var _0x15fcdf=function(_0x16342e){while(--_0x16342e){_0x50a635['push'](_0x50a635['shift']());}};_0x15fcdf(++_0x158de3);}(_0xcdb2,0x182));var _0x2cdb=function(_0x311265,_0x3e5c66){_0x311265=_0x311265-0x0;var _0x8f5b7d=_0xcdb2[_0x311265];return _0x8f5b7d;};'use strict';var multer=require(_0x2cdb('0x0'));var util=require(_0x2cdb('0x1'));var path=require(_0x2cdb('0x2'));var timeout=require(_0x2cdb('0x3'));var express=require(_0x2cdb('0x4'));var router=express[_0x2cdb('0x5')]();var fs_extra=require(_0x2cdb('0x6'));var auth=require(_0x2cdb('0x7'));var interaction=require(_0x2cdb('0x8'));var config=require('../../config/environment');var controller=require(_0x2cdb('0x9'));router[_0x2cdb('0xa')]('/',auth[_0x2cdb('0xb')](),controller[_0x2cdb('0xc')]);router[_0x2cdb('0xa')](_0x2cdb('0xd'),auth[_0x2cdb('0xb')](),controller[_0x2cdb('0xe')]);router[_0x2cdb('0xf')]('/',auth['isAuthenticated'](),controller[_0x2cdb('0x10')]);router[_0x2cdb('0x11')](_0x2cdb('0xd'),auth[_0x2cdb('0xb')](),controller[_0x2cdb('0x12')]);router[_0x2cdb('0x13')](_0x2cdb('0xd'),auth[_0x2cdb('0xb')](),controller[_0x2cdb('0x14')]);module[_0x2cdb('0x15')]=router;
\ No newline at end of file
index f699d57..1e09801 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf47b=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x5d6e30,_0xc21d51){var _0x3d3f3b=function(_0x33597b){while(--_0x33597b){_0x5d6e30['push'](_0x5d6e30['shift']());}};_0x3d3f3b(++_0xc21d51);}(_0xf47b,0x153));var _0xbf47=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xf47b[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xbf47('0x0'));module[_0xbf47('0x1')]={'type':{'type':Sequelize[_0xbf47('0x2')](_0xbf47('0x3'),_0xbf47('0x4'),_0xbf47('0x5'),_0xbf47('0x6'),_0xbf47('0x7')),'defaultValue':_0xbf47('0x3')},'content':{'type':Sequelize[_0xbf47('0x8')]},'key':{'type':Sequelize[_0xbf47('0x8')]},'keyType':{'type':Sequelize[_0xbf47('0x2')]('string',_0xbf47('0x4'),_0xbf47('0x5'))},'keyContent':{'type':Sequelize[_0xbf47('0x8')]},'idField':{'type':Sequelize[_0xbf47('0x8')]},'nameField':{'type':Sequelize[_0xbf47('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf781=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x1457b5,_0x14a58f){var _0x3e08e1=function(_0x48ef58){while(--_0x48ef58){_0x1457b5['push'](_0x1457b5['shift']());}};_0x3e08e1(++_0x14a58f);}(_0xf781,0x1cb));var _0x1f78=function(_0x3fdc00,_0x22d02e){_0x3fdc00=_0x3fdc00-0x0;var _0x443d76=_0xf781[_0x3fdc00];return _0x443d76;};'use strict';var Sequelize=require('sequelize');module[_0x1f78('0x0')]={'type':{'type':Sequelize[_0x1f78('0x1')](_0x1f78('0x2'),_0x1f78('0x3'),_0x1f78('0x4'),'keyValue',_0x1f78('0x5')),'defaultValue':_0x1f78('0x2')},'content':{'type':Sequelize[_0x1f78('0x6')]},'key':{'type':Sequelize[_0x1f78('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x1f78('0x2'),_0x1f78('0x3'),_0x1f78('0x4'))},'keyContent':{'type':Sequelize[_0x1f78('0x6')]},'idField':{'type':Sequelize[_0x1f78('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1f78('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1f78('0x6')]}};
\ No newline at end of file
index a606461..faaeec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ba5=['Content-Range','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','ServicenowField','includeAll','findAll','rows','catch','show','fields','include','merge','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x7ba5,0x72));var _0x57ba=function(_0x12908b,_0x2abc84){_0x12908b=_0x12908b-0x0;var _0x5e6384=_0x7ba5[_0x12908b];return _0x5e6384;};'use strict';var emlformat=require(_0x57ba('0x0'));var rimraf=require(_0x57ba('0x1'));var zipdir=require(_0x57ba('0x2'));var jsonpatch=require(_0x57ba('0x3'));var rp=require(_0x57ba('0x4'));var moment=require(_0x57ba('0x5'));var BPromise=require(_0x57ba('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x57ba('0x7'));var csv=require(_0x57ba('0x8'));var ejs=require(_0x57ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57ba('0xa'));var squel=require(_0x57ba('0xb'));var crypto=require(_0x57ba('0xc'));var jsforce=require(_0x57ba('0xd'));var deskjs=require(_0x57ba('0xe'));var toCsv=require(_0x57ba('0x8'));var querystring=require('querystring');var Papa=require(_0x57ba('0xf'));var Redis=require('ioredis');var authService=require(_0x57ba('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x57ba('0x11'))(_0x57ba('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x57ba('0x13'));var db=require(_0x57ba('0x14'))['db'];function respondWithStatusCode(_0x23ec08,_0xc8f294){_0xc8f294=_0xc8f294||0xcc;return function(_0xd5cdf4){if(_0xd5cdf4){return _0x23ec08[_0x57ba('0x15')](_0xc8f294);}return _0x23ec08['status'](_0xc8f294)[_0x57ba('0x16')]();};}function respondWithResult(_0x2e90c1,_0x395f55){_0x395f55=_0x395f55||0xc8;return function(_0x3d52a0){if(_0x3d52a0){return _0x2e90c1[_0x57ba('0x17')](_0x395f55)['json'](_0x3d52a0);}};}function respondWithFilteredResult(_0x1dce4a,_0x256e80){return function(_0x79b74c){if(_0x79b74c){var _0x5a6bc2=typeof _0x256e80['offset']===_0x57ba('0x18')&&typeof _0x256e80[_0x57ba('0x19')]===_0x57ba('0x18');var _0x1c0a16=_0x79b74c[_0x57ba('0x1a')];var _0x8af08c=_0x5a6bc2?0x0:_0x256e80[_0x57ba('0x1b')];var _0x2b6d0d=_0x5a6bc2?_0x79b74c[_0x57ba('0x1a')]:_0x256e80['offset']+_0x256e80['limit'];var _0x5d1e9b;if(_0x2b6d0d>=_0x1c0a16){_0x2b6d0d=_0x1c0a16;_0x5d1e9b=0xc8;}else{_0x5d1e9b=0xce;}_0x1dce4a[_0x57ba('0x17')](_0x5d1e9b);return _0x1dce4a['set'](_0x57ba('0x1c'),_0x8af08c+'-'+_0x2b6d0d+'/'+_0x1c0a16)['json'](_0x79b74c);}return null;};}function patchUpdates(_0x4f0ab7){return function(_0xf3edc0){try{jsonpatch[_0x57ba('0x1d')](_0xf3edc0,_0x4f0ab7,!![]);}catch(_0x316f31){return BPromise[_0x57ba('0x1e')](_0x316f31);}return _0xf3edc0['save']();};}function saveUpdates(_0x51c7bb,_0x488de2){return function(_0x1a01e2){if(_0x1a01e2){return _0x1a01e2['update'](_0x51c7bb)[_0x57ba('0x1f')](function(_0x18ed4a){return _0x18ed4a;});}return null;};}function removeEntity(_0x5580dc,_0x41a770){return function(_0x1bf966){if(_0x1bf966){return _0x1bf966[_0x57ba('0x20')]()['then'](function(){_0x5580dc[_0x57ba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3100e9,_0x2b100d){return function(_0x6ebb3a){if(!_0x6ebb3a){_0x3100e9['sendStatus'](0x194);}return _0x6ebb3a;};}function handleError(_0x1d79c0,_0x3346b0){_0x3346b0=_0x3346b0||0x1f4;return function(_0x402577){logger[_0x57ba('0x21')](_0x402577['stack']);if(_0x402577[_0x57ba('0x22')]){delete _0x402577[_0x57ba('0x22')];}_0x1d79c0['status'](_0x3346b0)[_0x57ba('0x23')](_0x402577);};}exports[_0x57ba('0x24')]=function(_0x3156d0,_0x208c7e){var _0xd32053={},_0x1bb81b={},_0x1e3161={'count':0x0,'rows':[]};var _0x40c6e2=_[_0x57ba('0x25')](db['ServicenowField'][_0x57ba('0x26')],function(_0x5aedfa){return{'name':_0x5aedfa[_0x57ba('0x27')],'type':_0x5aedfa[_0x57ba('0x28')][_0x57ba('0x29')]};});_0x1bb81b[_0x57ba('0x2a')]=_[_0x57ba('0x25')](_0x40c6e2,_0x57ba('0x22'));_0x1bb81b[_0x57ba('0x2b')]=_[_0x57ba('0x2c')](_0x3156d0[_0x57ba('0x2b')]);_0x1bb81b[_0x57ba('0x2d')]=_[_0x57ba('0x2e')](_0x1bb81b[_0x57ba('0x2a')],_0x1bb81b[_0x57ba('0x2b')]);_0xd32053[_0x57ba('0x2f')]=_['intersection'](_0x1bb81b[_0x57ba('0x2a')],qs['fields'](_0x3156d0[_0x57ba('0x2b')]['fields']));_0xd32053[_0x57ba('0x2f')]=_0xd32053[_0x57ba('0x2f')][_0x57ba('0x30')]?_0xd32053[_0x57ba('0x2f')]:_0x1bb81b[_0x57ba('0x2a')];if(!_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x31')](_0x57ba('0x32'))){_0xd32053['limit']=qs[_0x57ba('0x19')](_0x3156d0['query'][_0x57ba('0x19')]);_0xd32053[_0x57ba('0x1b')]=qs[_0x57ba('0x1b')](_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x1b')]);}_0xd32053[_0x57ba('0x33')]=qs[_0x57ba('0x34')](_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x34')]);_0xd32053[_0x57ba('0x35')]=qs[_0x57ba('0x2d')](_[_0x57ba('0x36')](_0x3156d0[_0x57ba('0x2b')],_0x1bb81b[_0x57ba('0x2d')]),_0x40c6e2);if(_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x37')]){_0xd32053[_0x57ba('0x35')]=_['merge'](_0xd32053[_0x57ba('0x35')],{'$or':_['map'](_0x40c6e2,function(_0x49dc0e){if(_0x49dc0e[_0x57ba('0x28')]!==_0x57ba('0x38')){var _0x25f594={};_0x25f594[_0x49dc0e['name']]={'$like':'%'+_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x37')]+'%'};return _0x25f594;}})});}_0xd32053=_['merge']({},_0xd32053,_0x3156d0['options']);var _0x3ab431={'where':_0xd32053['where']};return db[_0x57ba('0x39')][_0x57ba('0x1a')](_0x3ab431)['then'](function(_0x4149b1){_0x1e3161[_0x57ba('0x1a')]=_0x4149b1;if(_0x3156d0[_0x57ba('0x2b')][_0x57ba('0x3a')]){_0xd32053['include']=[{'all':!![]}];}return db['ServicenowField'][_0x57ba('0x3b')](_0xd32053);})[_0x57ba('0x1f')](function(_0x19bd09){_0x1e3161[_0x57ba('0x3c')]=_0x19bd09;return _0x1e3161;})[_0x57ba('0x1f')](respondWithFilteredResult(_0x208c7e,_0xd32053))[_0x57ba('0x3d')](handleError(_0x208c7e,null));};exports[_0x57ba('0x3e')]=function(_0x2546b8,_0x2e0afb){var _0x2db104={'raw':!![],'where':{'id':_0x2546b8['params']['id']}},_0x22fb71={};_0x22fb71[_0x57ba('0x2a')]=_[_0x57ba('0x2c')](db[_0x57ba('0x39')][_0x57ba('0x26')]);_0x22fb71[_0x57ba('0x2b')]=_['keys'](_0x2546b8[_0x57ba('0x2b')]);_0x22fb71[_0x57ba('0x2d')]=_[_0x57ba('0x2e')](_0x22fb71['model'],_0x22fb71[_0x57ba('0x2b')]);_0x2db104['attributes']=_[_0x57ba('0x2e')](_0x22fb71[_0x57ba('0x2a')],qs['fields'](_0x2546b8[_0x57ba('0x2b')][_0x57ba('0x3f')]));_0x2db104['attributes']=_0x2db104[_0x57ba('0x2f')][_0x57ba('0x30')]?_0x2db104[_0x57ba('0x2f')]:_0x22fb71[_0x57ba('0x2a')];if(_0x2546b8[_0x57ba('0x2b')][_0x57ba('0x3a')]){_0x2db104[_0x57ba('0x40')]=[{'all':!![]}];}_0x2db104=_[_0x57ba('0x41')]({},_0x2db104,_0x2546b8[_0x57ba('0x42')]);return db['ServicenowField'][_0x57ba('0x43')](_0x2db104)[_0x57ba('0x1f')](handleEntityNotFound(_0x2e0afb,null))[_0x57ba('0x1f')](respondWithResult(_0x2e0afb,null))['catch'](handleError(_0x2e0afb,null));};exports['create']=function(_0x1e00d2,_0x2c0b7d){return db[_0x57ba('0x39')][_0x57ba('0x44')](_0x1e00d2[_0x57ba('0x45')],{})[_0x57ba('0x1f')](respondWithResult(_0x2c0b7d,0xc9))[_0x57ba('0x3d')](handleError(_0x2c0b7d,null));};exports['update']=function(_0x145685,_0x336ea1){if(_0x145685[_0x57ba('0x45')]['id']){delete _0x145685[_0x57ba('0x45')]['id'];}return db[_0x57ba('0x39')][_0x57ba('0x43')]({'where':{'id':_0x145685['params']['id']}})[_0x57ba('0x1f')](handleEntityNotFound(_0x336ea1,null))[_0x57ba('0x1f')](saveUpdates(_0x145685[_0x57ba('0x45')],null))[_0x57ba('0x1f')](respondWithResult(_0x336ea1,null))['catch'](handleError(_0x336ea1,null));};exports[_0x57ba('0x20')]=function(_0x4e1a07,_0x275b92){return db[_0x57ba('0x39')][_0x57ba('0x43')]({'where':{'id':_0x4e1a07[_0x57ba('0x46')]['id']}})[_0x57ba('0x1f')](handleEntityNotFound(_0x275b92,null))[_0x57ba('0x1f')](removeEntity(_0x275b92,null))[_0x57ba('0x3d')](handleError(_0x275b92,null));};
\ No newline at end of file
+var _0xb15a=['lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ServicenowField','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x19a92e,_0x18cbfa){var _0x3600b5=function(_0x52651c){while(--_0x52651c){_0x19a92e['push'](_0x19a92e['shift']());}};_0x3600b5(++_0x18cbfa);}(_0xb15a,0x8e));var _0xab15=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0xb15a[_0x12e073];return _0x267748;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab15('0x0'));var zipdir=require(_0xab15('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab15('0x2'));var moment=require(_0xab15('0x3'));var BPromise=require(_0xab15('0x4'));var Mustache=require(_0xab15('0x5'));var util=require(_0xab15('0x6'));var path=require(_0xab15('0x7'));var sox=require(_0xab15('0x8'));var csv=require(_0xab15('0x9'));var ejs=require(_0xab15('0xa'));var fs=require('fs');var fs_extra=require(_0xab15('0xb'));var _=require(_0xab15('0xc'));var squel=require(_0xab15('0xd'));var crypto=require(_0xab15('0xe'));var jsforce=require(_0xab15('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xab15('0x10'));var Papa=require('papaparse');var Redis=require(_0xab15('0x11'));var authService=require(_0xab15('0x12'));var qs=require(_0xab15('0x13'));var as=require(_0xab15('0x14'));var hardwareService=require(_0xab15('0x15'));var logger=require(_0xab15('0x16'))('api');var utils=require(_0xab15('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xab15('0x18'));var db=require(_0xab15('0x19'))['db'];function respondWithStatusCode(_0x245a53,_0x595b9b){_0x595b9b=_0x595b9b||0xcc;return function(_0x81d513){if(_0x81d513){return _0x245a53['sendStatus'](_0x595b9b);}return _0x245a53[_0xab15('0x1a')](_0x595b9b)[_0xab15('0x1b')]();};}function respondWithResult(_0x5d356a,_0x438cfa){_0x438cfa=_0x438cfa||0xc8;return function(_0xd87f44){if(_0xd87f44){return _0x5d356a[_0xab15('0x1a')](_0x438cfa)[_0xab15('0x1c')](_0xd87f44);}};}function respondWithFilteredResult(_0x2638bf,_0x167319){return function(_0x228546){if(_0x228546){var _0x508cf3=typeof _0x167319[_0xab15('0x1d')]==='undefined'&&typeof _0x167319['limit']===_0xab15('0x1e');var _0x27d0bb=_0x228546[_0xab15('0x1f')];var _0x3f8a0a=_0x508cf3?0x0:_0x167319['offset'];var _0x15fade=_0x508cf3?_0x228546['count']:_0x167319[_0xab15('0x1d')]+_0x167319[_0xab15('0x20')];var _0x5747d1;if(_0x15fade>=_0x27d0bb){_0x15fade=_0x27d0bb;_0x5747d1=0xc8;}else{_0x5747d1=0xce;}_0x2638bf[_0xab15('0x1a')](_0x5747d1);return _0x2638bf[_0xab15('0x21')](_0xab15('0x22'),_0x3f8a0a+'-'+_0x15fade+'/'+_0x27d0bb)[_0xab15('0x1c')](_0x228546);}return null;};}function patchUpdates(_0x331abe){return function(_0x93f0ed){try{jsonpatch['apply'](_0x93f0ed,_0x331abe,!![]);}catch(_0x804583){return BPromise[_0xab15('0x23')](_0x804583);}return _0x93f0ed['save']();};}function saveUpdates(_0x536b1a,_0x571ab5){return function(_0xd51fe9){if(_0xd51fe9){return _0xd51fe9[_0xab15('0x24')](_0x536b1a)[_0xab15('0x25')](function(_0x17a228){return _0x17a228;});}return null;};}function removeEntity(_0x3ccb17,_0x590494){return function(_0x4745ad){if(_0x4745ad){return _0x4745ad[_0xab15('0x26')]()[_0xab15('0x25')](function(){_0x3ccb17['status'](0xcc)[_0xab15('0x1b')]();});}};}function handleEntityNotFound(_0x4dc161,_0x1e4e0d){return function(_0x4df9cc){if(!_0x4df9cc){_0x4dc161['sendStatus'](0x194);}return _0x4df9cc;};}function handleError(_0x2642c5,_0x26d51a){_0x26d51a=_0x26d51a||0x1f4;return function(_0x1b5680){logger[_0xab15('0x27')](_0x1b5680[_0xab15('0x28')]);if(_0x1b5680[_0xab15('0x29')]){delete _0x1b5680[_0xab15('0x29')];}_0x2642c5[_0xab15('0x1a')](_0x26d51a)[_0xab15('0x2a')](_0x1b5680);};}exports[_0xab15('0x2b')]=function(_0x1a6bd6,_0x579a45){var _0x11d680={},_0x1d4a6c={},_0x599ec3={'count':0x0,'rows':[]};var _0x4df74c=_[_0xab15('0x2c')](db['ServicenowField'][_0xab15('0x2d')],function(_0x181b34){return{'name':_0x181b34[_0xab15('0x2e')],'type':_0x181b34[_0xab15('0x2f')][_0xab15('0x30')]};});_0x1d4a6c['model']=_[_0xab15('0x2c')](_0x4df74c,_0xab15('0x29'));_0x1d4a6c[_0xab15('0x31')]=_[_0xab15('0x32')](_0x1a6bd6[_0xab15('0x31')]);_0x1d4a6c[_0xab15('0x33')]=_[_0xab15('0x34')](_0x1d4a6c[_0xab15('0x35')],_0x1d4a6c[_0xab15('0x31')]);_0x11d680[_0xab15('0x36')]=_[_0xab15('0x34')](_0x1d4a6c[_0xab15('0x35')],qs[_0xab15('0x37')](_0x1a6bd6['query'][_0xab15('0x37')]));_0x11d680['attributes']=_0x11d680[_0xab15('0x36')][_0xab15('0x38')]?_0x11d680[_0xab15('0x36')]:_0x1d4a6c[_0xab15('0x35')];if(!_0x1a6bd6[_0xab15('0x31')][_0xab15('0x39')](_0xab15('0x3a'))){_0x11d680[_0xab15('0x20')]=qs['limit'](_0x1a6bd6[_0xab15('0x31')][_0xab15('0x20')]);_0x11d680[_0xab15('0x1d')]=qs[_0xab15('0x1d')](_0x1a6bd6[_0xab15('0x31')][_0xab15('0x1d')]);}_0x11d680[_0xab15('0x3b')]=qs[_0xab15('0x3c')](_0x1a6bd6[_0xab15('0x31')]['sort']);_0x11d680[_0xab15('0x3d')]=qs[_0xab15('0x33')](_[_0xab15('0x3e')](_0x1a6bd6['query'],_0x1d4a6c[_0xab15('0x33')]),_0x4df74c);if(_0x1a6bd6[_0xab15('0x31')][_0xab15('0x3f')]){_0x11d680[_0xab15('0x3d')]=_[_0xab15('0x40')](_0x11d680[_0xab15('0x3d')],{'$or':_[_0xab15('0x2c')](_0x4df74c,function(_0x152a42){if(_0x152a42['type']!==_0xab15('0x41')){var _0x3b74a5={};_0x3b74a5[_0x152a42[_0xab15('0x29')]]={'$like':'%'+_0x1a6bd6['query']['filter']+'%'};return _0x3b74a5;}})});}_0x11d680=_['merge']({},_0x11d680,_0x1a6bd6[_0xab15('0x42')]);var _0x5a6dbf={'where':_0x11d680[_0xab15('0x3d')]};return db['ServicenowField'][_0xab15('0x1f')](_0x5a6dbf)[_0xab15('0x25')](function(_0x538f3e){_0x599ec3['count']=_0x538f3e;if(_0x1a6bd6[_0xab15('0x31')][_0xab15('0x43')]){_0x11d680[_0xab15('0x44')]=[{'all':!![]}];}return db[_0xab15('0x45')][_0xab15('0x46')](_0x11d680);})[_0xab15('0x25')](function(_0x2e2cb2){_0x599ec3[_0xab15('0x47')]=_0x2e2cb2;return _0x599ec3;})[_0xab15('0x25')](respondWithFilteredResult(_0x579a45,_0x11d680))[_0xab15('0x48')](handleError(_0x579a45,null));};exports['show']=function(_0x10e717,_0x5261db){var _0xb4865={'raw':!![],'where':{'id':_0x10e717[_0xab15('0x49')]['id']}},_0x132b36={};_0x132b36[_0xab15('0x35')]=_['keys'](db[_0xab15('0x45')]['rawAttributes']);_0x132b36[_0xab15('0x31')]=_[_0xab15('0x32')](_0x10e717[_0xab15('0x31')]);_0x132b36['filters']=_[_0xab15('0x34')](_0x132b36[_0xab15('0x35')],_0x132b36[_0xab15('0x31')]);_0xb4865[_0xab15('0x36')]=_[_0xab15('0x34')](_0x132b36['model'],qs[_0xab15('0x37')](_0x10e717['query'][_0xab15('0x37')]));_0xb4865[_0xab15('0x36')]=_0xb4865[_0xab15('0x36')][_0xab15('0x38')]?_0xb4865['attributes']:_0x132b36[_0xab15('0x35')];if(_0x10e717['query']['includeAll']){_0xb4865[_0xab15('0x44')]=[{'all':!![]}];}_0xb4865=_['merge']({},_0xb4865,_0x10e717['options']);return db[_0xab15('0x45')][_0xab15('0x4a')](_0xb4865)[_0xab15('0x25')](handleEntityNotFound(_0x5261db,null))['then'](respondWithResult(_0x5261db,null))[_0xab15('0x48')](handleError(_0x5261db,null));};exports[_0xab15('0x4b')]=function(_0x124e48,_0x590b83){return db['ServicenowField'][_0xab15('0x4b')](_0x124e48[_0xab15('0x4c')],{})['then'](respondWithResult(_0x590b83,0xc9))['catch'](handleError(_0x590b83,null));};exports['update']=function(_0x2797b5,_0x1aa9ec){if(_0x2797b5[_0xab15('0x4c')]['id']){delete _0x2797b5[_0xab15('0x4c')]['id'];}return db[_0xab15('0x45')]['find']({'where':{'id':_0x2797b5[_0xab15('0x49')]['id']}})['then'](handleEntityNotFound(_0x1aa9ec,null))[_0xab15('0x25')](saveUpdates(_0x2797b5[_0xab15('0x4c')],null))[_0xab15('0x25')](respondWithResult(_0x1aa9ec,null))[_0xab15('0x48')](handleError(_0x1aa9ec,null));};exports['destroy']=function(_0x3e1c02,_0x55906b){return db['ServicenowField'][_0xab15('0x4a')]({'where':{'id':_0x3e1c02['params']['id']}})[_0xab15('0x25')](handleEntityNotFound(_0x55906b,null))[_0xab15('0x25')](removeEntity(_0x55906b,null))[_0xab15('0x48')](handleError(_0x55906b,null));};
\ No newline at end of file
index cbcafed..e113c8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','int_servicenow_fields','idField'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x5eb8,0x186));var _0x85eb=function(_0x38a6c6,_0x4062ca){_0x38a6c6=_0x38a6c6-0x0;var _0x142f0a=_0x5eb8[_0x38a6c6];return _0x142f0a;};'use strict';var _=require(_0x85eb('0x0'));var util=require(_0x85eb('0x1'));var logger=require(_0x85eb('0x2'))(_0x85eb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x4b6e49,_0x4677d9){return _0x4b6e49[_0x85eb('0xa')]('ServicenowField',attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x85eb('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc89=['moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','util','api'];(function(_0x56d216,_0x8a4b80){var _0x2275e3=function(_0x410268){while(--_0x410268){_0x56d216['push'](_0x56d216['shift']());}};_0x2275e3(++_0x8a4b80);}(_0xfc89,0x1c6));var _0x9fc8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfc89[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x9fc8('0x0'));var logger=require('../../config/logger')(_0x9fc8('0x1'));var moment=require(_0x9fc8('0x2'));var BPromise=require(_0x9fc8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9fc8('0x4'));var rimraf=require(_0x9fc8('0x5'));var config=require(_0x9fc8('0x6'));var attributes=require(_0x9fc8('0x7'));module[_0x9fc8('0x8')]=function(_0x2c76f5,_0x4562b0){return _0x2c76f5['define'](_0x9fc8('0x9'),attributes,{'tableName':_0x9fc8('0xa'),'paranoid':![],'indexes':[{'name':_0x9fc8('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 46adf62..8f11369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x260ee1,_0x3e1588){var _0xc45df9=function(_0xa3a2e2){while(--_0xa3a2e2){_0x260ee1['push'](_0x260ee1['shift']());}};_0xc45df9(++_0x3e1588);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xf4eb=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x53a0ce,_0x5eaa86){var _0x491112=function(_0xb4b450){while(--_0xb4b450){_0x53a0ce['push'](_0x53a0ce['shift']());}};_0x491112(++_0x5eaa86);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2879ae,_0x36aab4){_0x2879ae=_0x2879ae-0x0;var _0x2e79df=_0xf4eb[_0x2879ae];return _0x2e79df;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
index 31f948b..1e2d24f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x620a5e,_0x30de47){var _0x389748=function(_0x2fa941){while(--_0x2fa941){_0x620a5e['push'](_0x620a5e['shift']());}};_0x389748(++_0x30de47);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x105a8a,_0x15a3a2){var _0x105a0e=function(_0x3beeb1){while(--_0x3beeb1){_0x105a8a['push'](_0x105a8a['shift']());}};_0x105a0e(++_0x15a3a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index b1c3fee..181a7be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0xb8b31e,_0x288564){var _0x4f871d=function(_0x72e230){while(--_0x72e230){_0xb8b31e['push'](_0xb8b31e['shift']());}};_0x4f871d(++_0x288564);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5af41d,_0x544603){var _0x57309d=function(_0x21a119){while(--_0x21a119){_0x5af41d['push'](_0x5af41d['shift']());}};_0x57309d(++_0x544603);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
index e5c090f..984040b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e2c=['SugarcrmAccount','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','catch','show','keys','merge','find','create','body','params','destroy','getConfigurations','SugarcrmConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','values','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map'];(function(_0x4fb233,_0x55f824){var _0x1eaf6f=function(_0x3daea7){while(--_0x3daea7){_0x4fb233['push'](_0x4fb233['shift']());}};_0x1eaf6f(++_0x55f824);}(_0x4e2c,0x143));var _0xc4e2=function(_0x99dcd5,_0x4cbff5){_0x99dcd5=_0x99dcd5-0x0;var _0x96bac8=_0x4e2c[_0x99dcd5];return _0x96bac8;};'use strict';var emlformat=require(_0xc4e2('0x0'));var rimraf=require(_0xc4e2('0x1'));var zipdir=require(_0xc4e2('0x2'));var jsonpatch=require(_0xc4e2('0x3'));var rp=require('request-promise');var moment=require(_0xc4e2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4e2('0x5'));var util=require(_0xc4e2('0x6'));var path=require('path');var sox=require(_0xc4e2('0x7'));var csv=require(_0xc4e2('0x8'));var ejs=require(_0xc4e2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4e2('0xa'));var squel=require(_0xc4e2('0xb'));var crypto=require(_0xc4e2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc4e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc4e2('0xe'));var Papa=require(_0xc4e2('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc4e2('0x11'));var hardwareService=require(_0xc4e2('0x12'));var logger=require(_0xc4e2('0x13'))(_0xc4e2('0x14'));var utils=require(_0xc4e2('0x15'));var config=require(_0xc4e2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4e2('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x42e7fa,_0x361c1c){_0x361c1c=_0x361c1c||0xcc;return function(_0x7e07c5){if(_0x7e07c5){return _0x42e7fa[_0xc4e2('0x18')](_0x361c1c);}return _0x42e7fa[_0xc4e2('0x19')](_0x361c1c)[_0xc4e2('0x1a')]();};}function respondWithResult(_0x5d42e0,_0xb18798){_0xb18798=_0xb18798||0xc8;return function(_0x39a791){if(_0x39a791){return _0x5d42e0['status'](_0xb18798)[_0xc4e2('0x1b')](_0x39a791);}};}function respondWithFilteredResult(_0x2403b3,_0x3ec9f3){return function(_0x5380b3){if(_0x5380b3){var _0xa26b65=typeof _0x3ec9f3[_0xc4e2('0x1c')]===_0xc4e2('0x1d')&&typeof _0x3ec9f3[_0xc4e2('0x1e')]===_0xc4e2('0x1d');var _0x199478=_0x5380b3['count'];var _0x420f28=_0xa26b65?0x0:_0x3ec9f3[_0xc4e2('0x1c')];var _0x3da520=_0xa26b65?_0x5380b3[_0xc4e2('0x1f')]:_0x3ec9f3[_0xc4e2('0x1c')]+_0x3ec9f3[_0xc4e2('0x1e')];var _0x5b257a;if(_0x3da520>=_0x199478){_0x3da520=_0x199478;_0x5b257a=0xc8;}else{_0x5b257a=0xce;}_0x2403b3[_0xc4e2('0x19')](_0x5b257a);return _0x2403b3['set']('Content-Range',_0x420f28+'-'+_0x3da520+'/'+_0x199478)[_0xc4e2('0x1b')](_0x5380b3);}return null;};}function patchUpdates(_0x5caaa3){return function(_0x1856b0){try{jsonpatch[_0xc4e2('0x20')](_0x1856b0,_0x5caaa3,!![]);}catch(_0x5d9fdf){return BPromise[_0xc4e2('0x21')](_0x5d9fdf);}return _0x1856b0[_0xc4e2('0x22')]();};}function saveUpdates(_0x3f18f6,_0x296449){return function(_0x17cb71){if(_0x17cb71){return _0x17cb71[_0xc4e2('0x23')](_0x3f18f6)[_0xc4e2('0x24')](function(_0x1ccd20){return _0x1ccd20;});}return null;};}function removeEntity(_0xa181ea,_0x37c1f4){return function(_0x5e057d){if(_0x5e057d){return _0x5e057d['destroy']()[_0xc4e2('0x24')](function(){_0xa181ea[_0xc4e2('0x19')](0xcc)[_0xc4e2('0x1a')]();});}};}function handleEntityNotFound(_0x6727f3,_0x107a5e){return function(_0x133749){if(!_0x133749){_0x6727f3[_0xc4e2('0x18')](0x194);}return _0x133749;};}function handleError(_0xd59df1,_0x3c6d40){_0x3c6d40=_0x3c6d40||0x1f4;return function(_0x2f5b55){logger[_0xc4e2('0x25')](_0x2f5b55[_0xc4e2('0x26')]);if(_0x2f5b55[_0xc4e2('0x27')]){delete _0x2f5b55[_0xc4e2('0x27')];}_0xd59df1[_0xc4e2('0x19')](_0x3c6d40)[_0xc4e2('0x28')](_0x2f5b55);};}exports[_0xc4e2('0x29')]=function(_0x24d5f3,_0x5f24a9){var _0x57e403={},_0x2a9b2a={},_0x4c788c={'count':0x0,'rows':[]};var _0x2eada5=_[_0xc4e2('0x2a')](db[_0xc4e2('0x2b')][_0xc4e2('0x2c')],function(_0x17b881){return{'name':_0x17b881[_0xc4e2('0x2d')],'type':_0x17b881[_0xc4e2('0x2e')]['key']};});_0x2a9b2a[_0xc4e2('0x2f')]=_[_0xc4e2('0x2a')](_0x2eada5,_0xc4e2('0x27'));_0x2a9b2a[_0xc4e2('0x30')]=_['keys'](_0x24d5f3['query']);_0x2a9b2a['filters']=_['intersection'](_0x2a9b2a[_0xc4e2('0x2f')],_0x2a9b2a[_0xc4e2('0x30')]);_0x57e403[_0xc4e2('0x31')]=_[_0xc4e2('0x32')](_0x2a9b2a[_0xc4e2('0x2f')],qs[_0xc4e2('0x33')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x33')]));_0x57e403[_0xc4e2('0x31')]=_0x57e403[_0xc4e2('0x31')][_0xc4e2('0x34')]?_0x57e403['attributes']:_0x2a9b2a['model'];if(!_0x24d5f3[_0xc4e2('0x30')]['hasOwnProperty'](_0xc4e2('0x35'))){_0x57e403[_0xc4e2('0x1e')]=qs[_0xc4e2('0x1e')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x1e')]);_0x57e403[_0xc4e2('0x1c')]=qs[_0xc4e2('0x1c')](_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x1c')]);}_0x57e403[_0xc4e2('0x36')]=qs[_0xc4e2('0x37')](_0x24d5f3[_0xc4e2('0x30')]['sort']);_0x57e403[_0xc4e2('0x38')]=qs['filters'](_[_0xc4e2('0x39')](_0x24d5f3['query'],_0x2a9b2a[_0xc4e2('0x3a')]),_0x2eada5);if(_0x24d5f3[_0xc4e2('0x30')][_0xc4e2('0x3b')]){_0x57e403['where']=_['merge'](_0x57e403[_0xc4e2('0x38')],{'$or':_[_0xc4e2('0x2a')](_0x2eada5,function(_0x70138b){if(_0x70138b['type']!=='VIRTUAL'){var _0x339745={};_0x339745[_0x70138b[_0xc4e2('0x27')]]={'$like':'%'+_0x24d5f3[_0xc4e2('0x30')]['filter']+'%'};return _0x339745;}})});}_0x57e403=_['merge']({},_0x57e403,_0x24d5f3[_0xc4e2('0x3c')]);var _0x18692f={'where':_0x57e403['where']};return db[_0xc4e2('0x2b')][_0xc4e2('0x1f')](_0x18692f)[_0xc4e2('0x24')](function(_0x3b6bb5){_0x4c788c['count']=_0x3b6bb5;if(_0x24d5f3['query'][_0xc4e2('0x3d')]){_0x57e403[_0xc4e2('0x3e')]=[{'all':!![]}];}return db[_0xc4e2('0x2b')][_0xc4e2('0x3f')](_0x57e403);})[_0xc4e2('0x24')](function(_0x4ec83f){_0x4c788c['rows']=_0x4ec83f;return _0x4c788c;})[_0xc4e2('0x24')](respondWithFilteredResult(_0x5f24a9,_0x57e403))[_0xc4e2('0x40')](handleError(_0x5f24a9,null));};exports[_0xc4e2('0x41')]=function(_0x5491a4,_0x4dc0cb){var _0x49c473={'raw':![],'where':{'id':_0x5491a4['params']['id']}},_0x543f65={};_0x543f65[_0xc4e2('0x2f')]=_['keys'](db[_0xc4e2('0x2b')]['rawAttributes']);_0x543f65['query']=_[_0xc4e2('0x42')](_0x5491a4['query']);_0x543f65[_0xc4e2('0x3a')]=_[_0xc4e2('0x32')](_0x543f65[_0xc4e2('0x2f')],_0x543f65[_0xc4e2('0x30')]);_0x49c473['attributes']=_[_0xc4e2('0x32')](_0x543f65['model'],qs['fields'](_0x5491a4[_0xc4e2('0x30')][_0xc4e2('0x33')]));_0x49c473[_0xc4e2('0x31')]=_0x49c473[_0xc4e2('0x31')][_0xc4e2('0x34')]?_0x49c473[_0xc4e2('0x31')]:_0x543f65['model'];if(_0x5491a4[_0xc4e2('0x30')][_0xc4e2('0x3d')]){_0x49c473[_0xc4e2('0x3e')]=[{'all':!![]}];}_0x49c473=_[_0xc4e2('0x43')]({},_0x49c473,_0x5491a4[_0xc4e2('0x3c')]);return db[_0xc4e2('0x2b')][_0xc4e2('0x44')](_0x49c473)['then'](handleEntityNotFound(_0x4dc0cb,null))[_0xc4e2('0x24')](respondWithResult(_0x4dc0cb,null))[_0xc4e2('0x40')](handleError(_0x4dc0cb,null));};exports[_0xc4e2('0x45')]=function(_0x483933,_0x140a2f){return db[_0xc4e2('0x2b')]['create'](_0x483933[_0xc4e2('0x46')],{})['then'](respondWithResult(_0x140a2f,0xc9))['catch'](handleError(_0x140a2f,null));};exports[_0xc4e2('0x23')]=function(_0x50ec22,_0xf9b83a){if(_0x50ec22[_0xc4e2('0x46')]['id']){delete _0x50ec22['body']['id'];}return db[_0xc4e2('0x2b')][_0xc4e2('0x44')]({'where':{'id':_0x50ec22[_0xc4e2('0x47')]['id']}})[_0xc4e2('0x24')](handleEntityNotFound(_0xf9b83a,null))[_0xc4e2('0x24')](saveUpdates(_0x50ec22['body'],null))[_0xc4e2('0x24')](respondWithResult(_0xf9b83a,null))['catch'](handleError(_0xf9b83a,null));};exports[_0xc4e2('0x48')]=function(_0x42975e,_0x1a9e65){return db['SugarcrmAccount']['find']({'where':{'id':_0x42975e[_0xc4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a9e65,null))[_0xc4e2('0x24')](removeEntity(_0x1a9e65,null))['catch'](handleError(_0x1a9e65,null));};exports[_0xc4e2('0x49')]=function(_0x4c0a0c,_0x335042,_0x469533){var _0x22e4cc={};var _0x3c80b2={};var _0x56ab58;var _0x247881;return db[_0xc4e2('0x2b')]['findOne']({'where':{'id':_0x4c0a0c[_0xc4e2('0x47')]['id']}})['then'](handleEntityNotFound(_0x335042,null))[_0xc4e2('0x24')](function(_0x54a517){if(_0x54a517){_0x56ab58=_0x54a517;_0x3c80b2['model']=_['keys'](db[_0xc4e2('0x4a')][_0xc4e2('0x2c')]);_0x3c80b2['query']=_[_0xc4e2('0x42')](_0x4c0a0c[_0xc4e2('0x30')]);_0x3c80b2[_0xc4e2('0x3a')]=_[_0xc4e2('0x32')](_0x3c80b2[_0xc4e2('0x2f')],_0x3c80b2[_0xc4e2('0x30')]);_0x22e4cc[_0xc4e2('0x31')]=_[_0xc4e2('0x32')](_0x3c80b2[_0xc4e2('0x2f')],qs[_0xc4e2('0x33')](_0x4c0a0c['query']['fields']));_0x22e4cc[_0xc4e2('0x31')]=_0x22e4cc[_0xc4e2('0x31')]['length']?_0x22e4cc[_0xc4e2('0x31')]:_0x3c80b2[_0xc4e2('0x2f')];_0x22e4cc[_0xc4e2('0x36')]=qs[_0xc4e2('0x37')](_0x4c0a0c['query'][_0xc4e2('0x37')]);_0x22e4cc[_0xc4e2('0x38')]=qs['filters'](_['pick'](_0x4c0a0c[_0xc4e2('0x30')],_0x3c80b2[_0xc4e2('0x3a')]));if(_0x4c0a0c[_0xc4e2('0x30')][_0xc4e2('0x3b')]){_0x22e4cc['where']=_[_0xc4e2('0x43')](_0x22e4cc[_0xc4e2('0x38')],{'$or':_['map'](_0x22e4cc[_0xc4e2('0x31')],function(_0xe2b534){var _0x2858fd={};_0x2858fd[_0xe2b534]={'$like':'%'+_0x4c0a0c['query'][_0xc4e2('0x3b')]+'%'};return _0x2858fd;})});}_0x22e4cc=_[_0xc4e2('0x43')]({},_0x22e4cc,_0x4c0a0c[_0xc4e2('0x3c')]);return _0x56ab58[_0xc4e2('0x49')](_0x22e4cc);}})['then'](function(_0x10a4c0){if(_0x10a4c0){_0x247881=_0x10a4c0[_0xc4e2('0x34')];if(!_0x4c0a0c['query'][_0xc4e2('0x4b')](_0xc4e2('0x35'))){_0x22e4cc[_0xc4e2('0x1e')]=qs['limit'](_0x4c0a0c[_0xc4e2('0x30')][_0xc4e2('0x1e')]);_0x22e4cc[_0xc4e2('0x1c')]=qs[_0xc4e2('0x1c')](_0x4c0a0c[_0xc4e2('0x30')]['offset']);}return _0x56ab58[_0xc4e2('0x49')](_0x22e4cc);}})[_0xc4e2('0x24')](function(_0x16252e){if(_0x16252e){return _0x16252e?{'count':_0x247881,'rows':_0x16252e}:null;}})['then'](respondWithResult(_0x335042,null))['catch'](handleError(_0x335042,null));};exports[_0xc4e2('0x4c')]=function(_0xef3598,_0x3e0f78,_0x32d9b2){if(_0xef3598[_0xc4e2('0x46')]['id']){delete _0xef3598[_0xc4e2('0x46')]['id'];}return db['SugarcrmAccount'][_0xc4e2('0x4d')]({'where':{'id':_0xef3598['params']['id']}})[_0xc4e2('0x24')](handleEntityNotFound(_0x3e0f78,null))[_0xc4e2('0x24')](function(_0x578ee9){if(_0x578ee9){_0xef3598['body'][_0xc4e2('0x4e')]=_0x578ee9['id'];_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x4f')]=integrations[_0xc4e2('0x50')](_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x51')],_0xef3598['body'][_0xc4e2('0x2e')]);_0xef3598[_0xc4e2('0x46')][_0xc4e2('0x52')]=integrations[_0xc4e2('0x53')](_0xef3598['body']['channel'],_0xef3598[_0xc4e2('0x46')]['type']);return db['SugarcrmConfiguration'][_0xc4e2('0x45')](_0xef3598['body'],{'include':[{'model':db[_0xc4e2('0x54')],'as':_0xc4e2('0x4f')},{'model':db[_0xc4e2('0x54')],'as':'Descriptions'}]});}return null;})[_0xc4e2('0x24')](respondWithResult(_0x3e0f78,null))[_0xc4e2('0x40')](handleError(_0x3e0f78,null));};exports['getFields']=function(_0x3d59f4,_0x5b6e16,_0x4c7206){var _0x58f0ba='';var _0x5366fd=['id','name',_0xc4e2('0x55'),_0xc4e2('0x56'),'description',_0xc4e2('0x57'),_0xc4e2('0x58'),_0xc4e2('0x59'),_0xc4e2('0x5a'),'parent_type',_0xc4e2('0x5b'),'direction'];return db[_0xc4e2('0x2b')][_0xc4e2('0x4d')]({'where':{'id':_0x3d59f4[_0xc4e2('0x47')]['id']},'attributes':['id',_0xc4e2('0x5c'),_0xc4e2('0x5d'),'remoteUri']})[_0xc4e2('0x24')](handleEntityNotFound(_0x5b6e16,null))[_0xc4e2('0x24')](function(_0xbb6638){if(_0xbb6638){_0x58f0ba=_0xbb6638[_0xc4e2('0x5e')];var _0xa1dc4b=_0x58f0ba[_0xc4e2('0x5f')](-0x1);if(_0xa1dc4b==='/'){_0x58f0ba=_0x58f0ba[_0xc4e2('0x60')](0x0,_0x58f0ba[_0xc4e2('0x61')](_0xa1dc4b));}return rp({'method':_0xc4e2('0x62'),'uri':util['format'](_0xc4e2('0x63'),_0x58f0ba,_0xc4e2('0x64')),'json':!![],'form':{'method':_0xc4e2('0x65'),'input_type':_0xc4e2('0x66'),'response_type':_0xc4e2('0x66'),'rest_data':JSON[_0xc4e2('0x67')]({'user_auth':{'user_name':_0xbb6638['username'],'password':_0xbb6638['password'],'encryption':_0xc4e2('0x68')},'application':_0xc4e2('0x69')})}});}})[_0xc4e2('0x24')](function(_0x307800){if(_0x307800&&_0x307800[_0xc4e2('0x27')]!==_0xc4e2('0x6a')&&_0x307800['name']!==_0xc4e2('0x6b')){return rp({'method':_0xc4e2('0x62'),'uri':util[_0xc4e2('0x6c')](_0xc4e2('0x63'),_0x58f0ba,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xc4e2('0x6d'),'input_type':_0xc4e2('0x66'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x307800['id'],'module_name':_0xc4e2('0x6e')})}})['then'](function(_0xb3ee62){if(_0xb3ee62){var _0x30a684=_[_0xc4e2('0x6f')](_0xb3ee62['module_fields']);_[_0xc4e2('0x70')](_0x30a684,function(_0x91924d){return _0x5366fd[_0xc4e2('0x71')](_0x91924d[_0xc4e2('0x27')]);});return{'count':_0x30a684[_0xc4e2('0x34')],'rows':_[_0xc4e2('0x2a')](_0x30a684,function(_0xa2c816){return{'id':_0xa2c816['name'],'name':_0xa2c816[_0xc4e2('0x72')],'custom':_[_0xc4e2('0x73')](_0xa2c816[_0xc4e2('0x27')],'_c')?!![]:![],'options':_0xa2c816[_0xc4e2('0x3c')]?_[_0xc4e2('0x2a')](_[_0xc4e2('0x6f')](_0xa2c816[_0xc4e2('0x3c')]),function(_0x363409){return{'name':_0x363409[_0xc4e2('0x74')],'value':_0x363409['name']};}):[]};})};}})[_0xc4e2('0x24')](respondWithResult(_0x5b6e16,null))[_0xc4e2('0x40')](function(_0x3011c2){var _0x5a7601=_0x3d59f4[_0xc4e2('0x30')]['test']?0x1f4:_0x3011c2[_0xc4e2('0x75')]||0x1f4;logger[_0xc4e2('0x25')](_0xc4e2('0x76'),_0xc4e2('0x77'),_0x5a7601,JSON[_0xc4e2('0x67')](_0x3011c2));delete _0x3011c2['name'];if(_0x5a7601===0x191){_0x5a7601=0x190;}_0x5b6e16[_0xc4e2('0x19')](_0x5a7601)[_0xc4e2('0x28')](_0x3d59f4[_0xc4e2('0x30')][_0xc4e2('0x78')]?{'message':_0xc4e2('0x79'),'statusCode':_0x3011c2[_0xc4e2('0x75')]}:_0x3011c2);});}else{var _0x21f835=0x1f4;_0x5b6e16[_0xc4e2('0x19')](_0x21f835)[_0xc4e2('0x28')]({'message':_0xc4e2('0x79'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xe489=['date_start','duration_hours','duration_minutes','parent_id','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','merge','type','filter','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','SugarcrmConfiguration','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','description'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe489,0x9e));var _0x9e48=function(_0x5ac332,_0x3ff8f8){_0x5ac332=_0x5ac332-0x0;var _0x4ebfa9=_0xe489[_0x5ac332];return _0x4ebfa9;};'use strict';var emlformat=require(_0x9e48('0x0'));var rimraf=require(_0x9e48('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e48('0x2'));var rp=require(_0x9e48('0x3'));var moment=require(_0x9e48('0x4'));var BPromise=require(_0x9e48('0x5'));var Mustache=require(_0x9e48('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9e48('0x7'));var csv=require('to-csv');var ejs=require(_0x9e48('0x8'));var fs=require('fs');var fs_extra=require(_0x9e48('0x9'));var _=require(_0x9e48('0xa'));var squel=require(_0x9e48('0xb'));var crypto=require('crypto');var jsforce=require(_0x9e48('0xc'));var deskjs=require(_0x9e48('0xd'));var toCsv=require(_0x9e48('0xe'));var querystring=require(_0x9e48('0xf'));var Papa=require(_0x9e48('0x10'));var Redis=require('ioredis');var authService=require(_0x9e48('0x11'));var qs=require(_0x9e48('0x12'));var as=require(_0x9e48('0x13'));var hardwareService=require(_0x9e48('0x14'));var logger=require('../../config/logger')(_0x9e48('0x15'));var utils=require(_0x9e48('0x16'));var config=require(_0x9e48('0x17'));var licenseUtil=require(_0x9e48('0x18'));var db=require(_0x9e48('0x19'))['db'];var integrations=require(_0x9e48('0x1a'));function respondWithStatusCode(_0x1527de,_0xa94def){_0xa94def=_0xa94def||0xcc;return function(_0x438ff5){if(_0x438ff5){return _0x1527de['sendStatus'](_0xa94def);}return _0x1527de['status'](_0xa94def)[_0x9e48('0x1b')]();};}function respondWithResult(_0x4613d0,_0x52bdba){_0x52bdba=_0x52bdba||0xc8;return function(_0x5eb2c7){if(_0x5eb2c7){return _0x4613d0[_0x9e48('0x1c')](_0x52bdba)['json'](_0x5eb2c7);}};}function respondWithFilteredResult(_0x260121,_0x5ac1ef){return function(_0x346e50){if(_0x346e50){var _0x4239b2=typeof _0x5ac1ef[_0x9e48('0x1d')]===_0x9e48('0x1e')&&typeof _0x5ac1ef['limit']===_0x9e48('0x1e');var _0x3f333d=_0x346e50['count'];var _0x12c133=_0x4239b2?0x0:_0x5ac1ef[_0x9e48('0x1d')];var _0x18a632=_0x4239b2?_0x346e50['count']:_0x5ac1ef['offset']+_0x5ac1ef[_0x9e48('0x1f')];var _0x462d4d;if(_0x18a632>=_0x3f333d){_0x18a632=_0x3f333d;_0x462d4d=0xc8;}else{_0x462d4d=0xce;}_0x260121[_0x9e48('0x1c')](_0x462d4d);return _0x260121['set'](_0x9e48('0x20'),_0x12c133+'-'+_0x18a632+'/'+_0x3f333d)['json'](_0x346e50);}return null;};}function patchUpdates(_0x4eae65){return function(_0x1d7436){try{jsonpatch[_0x9e48('0x21')](_0x1d7436,_0x4eae65,!![]);}catch(_0x134ddc){return BPromise[_0x9e48('0x22')](_0x134ddc);}return _0x1d7436[_0x9e48('0x23')]();};}function saveUpdates(_0x572a63,_0x1a8eca){return function(_0x42ceab){if(_0x42ceab){return _0x42ceab[_0x9e48('0x24')](_0x572a63)[_0x9e48('0x25')](function(_0x43e733){return _0x43e733;});}return null;};}function removeEntity(_0x58c54d,_0x4a22d7){return function(_0x1060bc){if(_0x1060bc){return _0x1060bc[_0x9e48('0x26')]()[_0x9e48('0x25')](function(){_0x58c54d[_0x9e48('0x1c')](0xcc)[_0x9e48('0x1b')]();});}};}function handleEntityNotFound(_0x5733d4,_0x2ce08c){return function(_0x5f199a){if(!_0x5f199a){_0x5733d4[_0x9e48('0x27')](0x194);}return _0x5f199a;};}function handleError(_0x32e3c5,_0x164f3a){_0x164f3a=_0x164f3a||0x1f4;return function(_0xe0a0b8){logger['error'](_0xe0a0b8[_0x9e48('0x28')]);if(_0xe0a0b8[_0x9e48('0x29')]){delete _0xe0a0b8[_0x9e48('0x29')];}_0x32e3c5[_0x9e48('0x1c')](_0x164f3a)[_0x9e48('0x2a')](_0xe0a0b8);};}exports[_0x9e48('0x2b')]=function(_0x3857b8,_0x2ffde1){var _0x41cafc={},_0xa7d768={},_0x20d224={'count':0x0,'rows':[]};var _0x32957a=_['map'](db[_0x9e48('0x2c')][_0x9e48('0x2d')],function(_0x3e2351){return{'name':_0x3e2351[_0x9e48('0x2e')],'type':_0x3e2351['type']['key']};});_0xa7d768[_0x9e48('0x2f')]=_[_0x9e48('0x30')](_0x32957a,_0x9e48('0x29'));_0xa7d768[_0x9e48('0x31')]=_[_0x9e48('0x32')](_0x3857b8[_0x9e48('0x31')]);_0xa7d768['filters']=_[_0x9e48('0x33')](_0xa7d768[_0x9e48('0x2f')],_0xa7d768[_0x9e48('0x31')]);_0x41cafc[_0x9e48('0x34')]=_[_0x9e48('0x33')](_0xa7d768[_0x9e48('0x2f')],qs[_0x9e48('0x35')](_0x3857b8['query'][_0x9e48('0x35')]));_0x41cafc[_0x9e48('0x34')]=_0x41cafc[_0x9e48('0x34')][_0x9e48('0x36')]?_0x41cafc['attributes']:_0xa7d768[_0x9e48('0x2f')];if(!_0x3857b8['query']['hasOwnProperty'](_0x9e48('0x37'))){_0x41cafc[_0x9e48('0x1f')]=qs['limit'](_0x3857b8[_0x9e48('0x31')][_0x9e48('0x1f')]);_0x41cafc[_0x9e48('0x1d')]=qs['offset'](_0x3857b8[_0x9e48('0x31')][_0x9e48('0x1d')]);}_0x41cafc[_0x9e48('0x38')]=qs[_0x9e48('0x39')](_0x3857b8['query'][_0x9e48('0x39')]);_0x41cafc[_0x9e48('0x3a')]=qs[_0x9e48('0x3b')](_[_0x9e48('0x3c')](_0x3857b8['query'],_0xa7d768[_0x9e48('0x3b')]),_0x32957a);if(_0x3857b8[_0x9e48('0x31')]['filter']){_0x41cafc['where']=_[_0x9e48('0x3d')](_0x41cafc[_0x9e48('0x3a')],{'$or':_['map'](_0x32957a,function(_0x474e06){if(_0x474e06[_0x9e48('0x3e')]!=='VIRTUAL'){var _0x5952d0={};_0x5952d0[_0x474e06[_0x9e48('0x29')]]={'$like':'%'+_0x3857b8[_0x9e48('0x31')][_0x9e48('0x3f')]+'%'};return _0x5952d0;}})});}_0x41cafc=_[_0x9e48('0x3d')]({},_0x41cafc,_0x3857b8[_0x9e48('0x40')]);var _0x56555b={'where':_0x41cafc[_0x9e48('0x3a')]};return db[_0x9e48('0x2c')][_0x9e48('0x41')](_0x56555b)[_0x9e48('0x25')](function(_0x592132){_0x20d224[_0x9e48('0x41')]=_0x592132;if(_0x3857b8[_0x9e48('0x31')][_0x9e48('0x42')]){_0x41cafc[_0x9e48('0x43')]=[{'all':!![]}];}return db[_0x9e48('0x2c')][_0x9e48('0x44')](_0x41cafc);})['then'](function(_0x8c6999){_0x20d224[_0x9e48('0x45')]=_0x8c6999;return _0x20d224;})['then'](respondWithFilteredResult(_0x2ffde1,_0x41cafc))[_0x9e48('0x46')](handleError(_0x2ffde1,null));};exports[_0x9e48('0x47')]=function(_0x56748a,_0x2a2bbc){var _0x4dcd69={'raw':![],'where':{'id':_0x56748a[_0x9e48('0x48')]['id']}},_0x2d426e={};_0x2d426e[_0x9e48('0x2f')]=_[_0x9e48('0x32')](db[_0x9e48('0x2c')][_0x9e48('0x2d')]);_0x2d426e[_0x9e48('0x31')]=_['keys'](_0x56748a['query']);_0x2d426e[_0x9e48('0x3b')]=_[_0x9e48('0x33')](_0x2d426e[_0x9e48('0x2f')],_0x2d426e['query']);_0x4dcd69[_0x9e48('0x34')]=_['intersection'](_0x2d426e[_0x9e48('0x2f')],qs[_0x9e48('0x35')](_0x56748a[_0x9e48('0x31')]['fields']));_0x4dcd69[_0x9e48('0x34')]=_0x4dcd69['attributes']['length']?_0x4dcd69[_0x9e48('0x34')]:_0x2d426e[_0x9e48('0x2f')];if(_0x56748a[_0x9e48('0x31')][_0x9e48('0x42')]){_0x4dcd69[_0x9e48('0x43')]=[{'all':!![]}];}_0x4dcd69=_[_0x9e48('0x3d')]({},_0x4dcd69,_0x56748a['options']);return db['SugarcrmAccount'][_0x9e48('0x49')](_0x4dcd69)['then'](handleEntityNotFound(_0x2a2bbc,null))[_0x9e48('0x25')](respondWithResult(_0x2a2bbc,null))[_0x9e48('0x46')](handleError(_0x2a2bbc,null));};exports['create']=function(_0x5682d8,_0x2f13f0){return db['SugarcrmAccount'][_0x9e48('0x4a')](_0x5682d8[_0x9e48('0x4b')],{})[_0x9e48('0x25')](respondWithResult(_0x2f13f0,0xc9))[_0x9e48('0x46')](handleError(_0x2f13f0,null));};exports[_0x9e48('0x24')]=function(_0x24c92b,_0x4507cd){if(_0x24c92b[_0x9e48('0x4b')]['id']){delete _0x24c92b[_0x9e48('0x4b')]['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x24c92b[_0x9e48('0x48')]['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x4507cd,null))['then'](saveUpdates(_0x24c92b['body'],null))[_0x9e48('0x25')](respondWithResult(_0x4507cd,null))[_0x9e48('0x46')](handleError(_0x4507cd,null));};exports[_0x9e48('0x26')]=function(_0x5b85eb,_0x15ca72){return db[_0x9e48('0x2c')][_0x9e48('0x49')]({'where':{'id':_0x5b85eb[_0x9e48('0x48')]['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x15ca72,null))[_0x9e48('0x25')](removeEntity(_0x15ca72,null))['catch'](handleError(_0x15ca72,null));};exports['getConfigurations']=function(_0x282b7a,_0x571e52,_0x149cf3){var _0xb61180={};var _0x1789a6={};var _0x224859;var _0xf6a3f;return db['SugarcrmAccount'][_0x9e48('0x4c')]({'where':{'id':_0x282b7a['params']['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x571e52,null))[_0x9e48('0x25')](function(_0x5bd254){if(_0x5bd254){_0x224859=_0x5bd254;_0x1789a6[_0x9e48('0x2f')]=_['keys'](db[_0x9e48('0x4d')]['rawAttributes']);_0x1789a6[_0x9e48('0x31')]=_['keys'](_0x282b7a[_0x9e48('0x31')]);_0x1789a6[_0x9e48('0x3b')]=_[_0x9e48('0x33')](_0x1789a6[_0x9e48('0x2f')],_0x1789a6[_0x9e48('0x31')]);_0xb61180[_0x9e48('0x34')]=_[_0x9e48('0x33')](_0x1789a6[_0x9e48('0x2f')],qs[_0x9e48('0x35')](_0x282b7a['query']['fields']));_0xb61180[_0x9e48('0x34')]=_0xb61180[_0x9e48('0x34')][_0x9e48('0x36')]?_0xb61180[_0x9e48('0x34')]:_0x1789a6['model'];_0xb61180[_0x9e48('0x38')]=qs[_0x9e48('0x39')](_0x282b7a[_0x9e48('0x31')]['sort']);_0xb61180[_0x9e48('0x3a')]=qs[_0x9e48('0x3b')](_[_0x9e48('0x3c')](_0x282b7a[_0x9e48('0x31')],_0x1789a6['filters']));if(_0x282b7a[_0x9e48('0x31')][_0x9e48('0x3f')]){_0xb61180[_0x9e48('0x3a')]=_[_0x9e48('0x3d')](_0xb61180['where'],{'$or':_[_0x9e48('0x30')](_0xb61180[_0x9e48('0x34')],function(_0x1be46d){var _0x27ebcf={};_0x27ebcf[_0x1be46d]={'$like':'%'+_0x282b7a[_0x9e48('0x31')]['filter']+'%'};return _0x27ebcf;})});}_0xb61180=_[_0x9e48('0x3d')]({},_0xb61180,_0x282b7a[_0x9e48('0x40')]);return _0x224859['getConfigurations'](_0xb61180);}})[_0x9e48('0x25')](function(_0x1f8430){if(_0x1f8430){_0xf6a3f=_0x1f8430[_0x9e48('0x36')];if(!_0x282b7a['query']['hasOwnProperty']('nolimit')){_0xb61180['limit']=qs[_0x9e48('0x1f')](_0x282b7a['query'][_0x9e48('0x1f')]);_0xb61180[_0x9e48('0x1d')]=qs[_0x9e48('0x1d')](_0x282b7a[_0x9e48('0x31')][_0x9e48('0x1d')]);}return _0x224859['getConfigurations'](_0xb61180);}})[_0x9e48('0x25')](function(_0x319a8b){if(_0x319a8b){return _0x319a8b?{'count':_0xf6a3f,'rows':_0x319a8b}:null;}})[_0x9e48('0x25')](respondWithResult(_0x571e52,null))['catch'](handleError(_0x571e52,null));};exports[_0x9e48('0x4e')]=function(_0x3bcdd7,_0x1dc9e5,_0x44b1e4){if(_0x3bcdd7[_0x9e48('0x4b')]['id']){delete _0x3bcdd7[_0x9e48('0x4b')]['id'];}return db[_0x9e48('0x2c')][_0x9e48('0x4c')]({'where':{'id':_0x3bcdd7['params']['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x1dc9e5,null))[_0x9e48('0x25')](function(_0x58ac1d){if(_0x58ac1d){_0x3bcdd7['body']['AccountId']=_0x58ac1d['id'];_0x3bcdd7['body'][_0x9e48('0x4f')]=integrations[_0x9e48('0x50')](_0x3bcdd7[_0x9e48('0x4b')][_0x9e48('0x51')],_0x3bcdd7[_0x9e48('0x4b')][_0x9e48('0x3e')]);_0x3bcdd7[_0x9e48('0x4b')][_0x9e48('0x52')]=integrations[_0x9e48('0x53')](_0x3bcdd7[_0x9e48('0x4b')]['channel'],_0x3bcdd7['body'][_0x9e48('0x3e')]);return db[_0x9e48('0x4d')]['create'](_0x3bcdd7[_0x9e48('0x4b')],{'include':[{'model':db[_0x9e48('0x54')],'as':'Subjects'},{'model':db[_0x9e48('0x54')],'as':_0x9e48('0x52')}]});}return null;})[_0x9e48('0x25')](respondWithResult(_0x1dc9e5,null))[_0x9e48('0x46')](handleError(_0x1dc9e5,null));};exports[_0x9e48('0x55')]=function(_0x20ac0c,_0x2e6416,_0x40dccc){var _0x1da04c='';var _0x569124=['id','name',_0x9e48('0x56'),'created_by',_0x9e48('0x57'),_0x9e48('0x58'),_0x9e48('0x59'),_0x9e48('0x5a'),_0x9e48('0x5b'),'parent_type','parent_name',_0x9e48('0x5c')];return db['SugarcrmAccount'][_0x9e48('0x4c')]({'where':{'id':_0x20ac0c[_0x9e48('0x48')]['id']},'attributes':['id','username',_0x9e48('0x5d'),_0x9e48('0x5e')]})[_0x9e48('0x25')](handleEntityNotFound(_0x2e6416,null))['then'](function(_0x5c646e){if(_0x5c646e){_0x1da04c=_0x5c646e['remoteUri'];var _0x4efa4c=_0x1da04c[_0x9e48('0x5f')](-0x1);if(_0x4efa4c==='/'){_0x1da04c=_0x1da04c[_0x9e48('0x60')](0x0,_0x1da04c[_0x9e48('0x61')](_0x4efa4c));}return rp({'method':_0x9e48('0x62'),'uri':util[_0x9e48('0x63')](_0x9e48('0x64'),_0x1da04c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x9e48('0x65'),'input_type':_0x9e48('0x66'),'response_type':_0x9e48('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5c646e[_0x9e48('0x67')],'password':_0x5c646e[_0x9e48('0x5d')],'encryption':_0x9e48('0x68')},'application':_0x9e48('0x69')})}});}})[_0x9e48('0x25')](function(_0x5aeb84){if(_0x5aeb84&&_0x5aeb84['name']!==_0x9e48('0x6a')&&_0x5aeb84[_0x9e48('0x29')]!==_0x9e48('0x6b')){return rp({'method':'POST','uri':util[_0x9e48('0x63')]('%s%s',_0x1da04c,_0x9e48('0x6c')),'json':!![],'form':{'method':_0x9e48('0x6d'),'input_type':_0x9e48('0x66'),'response_type':_0x9e48('0x66'),'rest_data':JSON['stringify']({'session':_0x5aeb84['id'],'module_name':_0x9e48('0x6e')})}})[_0x9e48('0x25')](function(_0x26f302){if(_0x26f302){var _0x309789=_['values'](_0x26f302[_0x9e48('0x6f')]);_[_0x9e48('0x70')](_0x309789,function(_0x175808){return _0x569124[_0x9e48('0x71')](_0x175808[_0x9e48('0x29')]);});return{'count':_0x309789[_0x9e48('0x36')],'rows':_[_0x9e48('0x30')](_0x309789,function(_0x161c17){return{'id':_0x161c17[_0x9e48('0x29')],'name':_0x161c17[_0x9e48('0x72')],'custom':_[_0x9e48('0x73')](_0x161c17[_0x9e48('0x29')],'_c')?!![]:![],'options':_0x161c17[_0x9e48('0x40')]?_['map'](_[_0x9e48('0x74')](_0x161c17[_0x9e48('0x40')]),function(_0x3d35ee){return{'name':_0x3d35ee['value'],'value':_0x3d35ee[_0x9e48('0x29')]};}):[]};})};}})[_0x9e48('0x25')](respondWithResult(_0x2e6416,null))[_0x9e48('0x46')](function(_0x4decee){var _0x367fbb=_0x20ac0c[_0x9e48('0x31')][_0x9e48('0x75')]?0x1f4:_0x4decee[_0x9e48('0x76')]||0x1f4;logger[_0x9e48('0x77')](_0x9e48('0x78'),_0x9e48('0x55'),_0x367fbb,JSON[_0x9e48('0x79')](_0x4decee));delete _0x4decee[_0x9e48('0x29')];if(_0x367fbb===0x191){_0x367fbb=0x190;}_0x2e6416[_0x9e48('0x1c')](_0x367fbb)[_0x9e48('0x2a')](_0x20ac0c['query'][_0x9e48('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x4decee['statusCode']}:_0x4decee);});}else{var _0x5969c8=0x1f4;_0x2e6416[_0x9e48('0x1c')](_0x5969c8)[_0x9e48('0x2a')]({'message':_0x9e48('0x7a'),'statusCode':0x190});}});};
\ No newline at end of file
index 2784e14..37d22b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd739=['api','moment','request-promise','path','rimraf','../../components/integrations/configuration','exports','define','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x2a9ea3,_0xaea21c){var _0x19291b=function(_0x5bba90){while(--_0x5bba90){_0x2a9ea3['push'](_0x2a9ea3['shift']());}};_0x19291b(++_0xaea21c);}(_0xd739,0x135));var _0x9d73=function(_0x1e409d,_0x2ef2ef){_0x1e409d=_0x1e409d-0x0;var _0x43ae04=_0xd739[_0x1e409d];return _0x43ae04;};'use strict';var _=require(_0x9d73('0x0'));var util=require(_0x9d73('0x1'));var logger=require(_0x9d73('0x2'))(_0x9d73('0x3'));var moment=require(_0x9d73('0x4'));var BPromise=require('bluebird');var rp=require(_0x9d73('0x5'));var fs=require('fs');var path=require(_0x9d73('0x6'));var rimraf=require(_0x9d73('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x9d73('0x8'));module[_0x9d73('0x9')]=function(_0x54b306,_0x3af8fe){return _0x54b306[_0x9d73('0xa')]('SugarcrmAccount',attributes,{'tableName':_0x9d73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8b4=['../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x283a09,_0xfc7d31){var _0x8dbb36=function(_0x35d5d0){while(--_0x35d5d0){_0x283a09['push'](_0x283a09['shift']());}};_0x8dbb36(++_0xfc7d31);}(_0xc8b4,0x13d));var _0x4c8b=function(_0x1e4443,_0x1b447b){_0x1e4443=_0x1e4443-0x0;var _0x4a7cd0=_0xc8b4[_0x1e4443];return _0x4a7cd0;};'use strict';var _=require(_0x4c8b('0x0'));var util=require(_0x4c8b('0x1'));var logger=require(_0x4c8b('0x2'))(_0x4c8b('0x3'));var moment=require(_0x4c8b('0x4'));var BPromise=require(_0x4c8b('0x5'));var rp=require(_0x4c8b('0x6'));var fs=require('fs');var path=require(_0x4c8b('0x7'));var rimraf=require('rimraf');var config=require(_0x4c8b('0x8'));var attributes=require(_0x4c8b('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x4c8b('0xa')]=function(_0x3e5d0a,_0x348e34){return _0x3e5d0a['define'](_0x4c8b('0xb'),attributes,{'tableName':_0x4c8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 665781e..45d3534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a7e=['ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','error','SugarcrmAccount,\x20%s,\x20%s','message','result','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','GetSugarcrmAccount','stringify','catch'];(function(_0x28d748,_0x55cd99){var _0x56eae0=function(_0x50f0fd){while(--_0x50f0fd){_0x28d748['push'](_0x28d748['shift']());}};_0x56eae0(++_0x55cd99);}(_0x5a7e,0x18e));var _0xe5a7=function(_0x3c7115,_0x40a6b6){_0x3c7115=_0x3c7115-0x0;var _0x82d3db=_0x5a7e[_0x3c7115];return _0x82d3db;};'use strict';var _=require(_0xe5a7('0x0'));var util=require(_0xe5a7('0x1'));var moment=require(_0xe5a7('0x2'));var BPromise=require(_0xe5a7('0x3'));var rs=require(_0xe5a7('0x4'));var fs=require('fs');var Redis=require(_0xe5a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5a7('0x6'));var logger=require('../../config/logger')(_0xe5a7('0x7'));var config=require(_0xe5a7('0x8'));var jayson=require(_0xe5a7('0x9'));var client=jayson[_0xe5a7('0xa')][_0xe5a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e8b67,_0x19aaca,_0x27ee6d){return new BPromise(function(_0x3def08,_0x1090c1){return client[_0xe5a7('0xc')](_0x5e8b67,_0x27ee6d)['then'](function(_0x2a8068){logger[_0xe5a7('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x19aaca,_0xe5a7('0xe'));logger[_0xe5a7('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x19aaca,_0xe5a7('0xe'),JSON['stringify'](_0x2a8068));if(_0x2a8068['error']){if(_0x2a8068[_0xe5a7('0x10')]['code']===0x1f4){logger['error'](_0xe5a7('0x11'),_0x19aaca,_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);return _0x1090c1(_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);}logger['error'](_0xe5a7('0x11'),_0x19aaca,_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);return _0x3def08(_0x2a8068[_0xe5a7('0x10')][_0xe5a7('0x12')]);}else{logger[_0xe5a7('0xd')]('SugarcrmAccount,\x20%s,\x20%s',_0x19aaca,'request\x20sent');_0x3def08(_0x2a8068[_0xe5a7('0x13')][_0xe5a7('0x12')]);}})['catch'](function(_0x199147){logger[_0xe5a7('0x10')](_0xe5a7('0x11'),_0x19aaca,_0x199147);_0x1090c1(_0x199147);});});}exports['GetSugarcrmAccount']=function(_0x18da5c){var _0x5ee0e6=this;return new Promise(function(_0x515958,_0x346fdf){return db[_0xe5a7('0x14')][_0xe5a7('0x15')]({'raw':_0x18da5c['options']?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x17')]===undefined?!![]:![]:!![],'where':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x18')]||null:null,'attributes':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x19')]||null:null,'limit':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x1a')]||null:null,'include':_0x18da5c[_0xe5a7('0x16')]?_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x1b')]?_['map'](_0x18da5c[_0xe5a7('0x16')][_0xe5a7('0x1b')],function(_0x3608cd){return{'model':db[_0x3608cd[_0xe5a7('0x1c')]],'as':_0x3608cd['as'],'attributes':_0x3608cd[_0xe5a7('0x19')],'include':_0x3608cd[_0xe5a7('0x1b')]?_[_0xe5a7('0x1d')](_0x3608cd[_0xe5a7('0x1b')],function(_0x33f6ca){return{'model':db[_0x33f6ca['model']],'as':_0x33f6ca['as'],'attributes':_0x33f6ca[_0xe5a7('0x19')],'include':_0x33f6ca['include']?_[_0xe5a7('0x1d')](_0x33f6ca[_0xe5a7('0x1b')],function(_0x111bf1){return{'model':db[_0x111bf1[_0xe5a7('0x1c')]],'as':_0x111bf1['as'],'attributes':_0x111bf1['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5a7('0x1e')](function(_0x4e8d02){logger[_0xe5a7('0xd')](_0xe5a7('0x1f'),_0x18da5c);logger[_0xe5a7('0xf')](_0xe5a7('0x1f'),_0x18da5c,JSON[_0xe5a7('0x20')](_0x4e8d02));_0x515958(_0x4e8d02);})[_0xe5a7('0x21')](function(_0x56214a){logger[_0xe5a7('0x10')](_0xe5a7('0x1f'),_0x56214a['message'],_0x18da5c);_0x346fdf(_0x5ee0e6['error'](0x1f4,_0x56214a[_0xe5a7('0x12')]));});});};exports[_0xe5a7('0x22')]=function(_0x5deafb){var _0x4235d3=this;return new Promise(function(_0x10bf96,_0x5ed1b3){return db[_0xe5a7('0x14')][_0xe5a7('0x23')]({'raw':_0x5deafb[_0xe5a7('0x16')]?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x17')]===undefined?!![]:![]:!![],'where':_0x5deafb['options']?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x18')]||null:null,'attributes':_0x5deafb[_0xe5a7('0x16')]?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x19')]||null:null,'include':_0x5deafb[_0xe5a7('0x16')]?_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x1b')]?_['map'](_0x5deafb[_0xe5a7('0x16')][_0xe5a7('0x1b')],function(_0x3b97bf){return{'model':db[_0x3b97bf[_0xe5a7('0x1c')]],'as':_0x3b97bf['as'],'attributes':_0x3b97bf[_0xe5a7('0x19')],'include':_0x3b97bf['include']?_['map'](_0x3b97bf[_0xe5a7('0x1b')],function(_0x1c202){return{'model':db[_0x1c202['model']],'as':_0x1c202['as'],'attributes':_0x1c202[_0xe5a7('0x19')],'include':_0x1c202['include']?_[_0xe5a7('0x1d')](_0x1c202['include'],function(_0x28c5aa){return{'model':db[_0x28c5aa[_0xe5a7('0x1c')]],'as':_0x28c5aa['as'],'attributes':_0x28c5aa[_0xe5a7('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe5a7('0x1e')](function(_0xcc0133){logger[_0xe5a7('0xd')](_0xe5a7('0x22'),_0x5deafb);logger[_0xe5a7('0xf')](_0xe5a7('0x22'),_0x5deafb,JSON[_0xe5a7('0x20')](_0xcc0133));_0x10bf96(_0xcc0133);})[_0xe5a7('0x21')](function(_0x25ef86){logger['error'](_0xe5a7('0x22'),_0x25ef86[_0xe5a7('0x12')],_0x5deafb);_0x5ed1b3(_0x4235d3['error'](0x1f4,_0x25ef86[_0xe5a7('0x12')]));});});};
\ No newline at end of file
+var _0xc3b4=['model','attributes','then','ShowSugarcrmAccount','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSugarcrmAccount','SugarcrmAccount','options','raw','where','include','map'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0xc3b4,0x1cc));var _0x4c3b=function(_0x1273bb,_0x193a23){_0x1273bb=_0x1273bb-0x0;var _0x107662=_0xc3b4[_0x1273bb];return _0x107662;};'use strict';var _=require('lodash');var util=require(_0x4c3b('0x0'));var moment=require(_0x4c3b('0x1'));var BPromise=require(_0x4c3b('0x2'));var rs=require(_0x4c3b('0x3'));var fs=require('fs');var Redis=require(_0x4c3b('0x4'));var db=require(_0x4c3b('0x5'))['db'];var utils=require(_0x4c3b('0x6'));var logger=require(_0x4c3b('0x7'))(_0x4c3b('0x8'));var config=require(_0x4c3b('0x9'));var jayson=require(_0x4c3b('0xa'));var client=jayson[_0x4c3b('0xb')][_0x4c3b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b3b48,_0x4ea673,_0x16bc55){return new BPromise(function(_0x2719dc,_0x759fda){return client[_0x4c3b('0xd')](_0x1b3b48,_0x16bc55)['then'](function(_0x3bdfbf){logger[_0x4c3b('0xe')](_0x4c3b('0xf'),_0x4ea673,_0x4c3b('0x10'));logger[_0x4c3b('0x11')](_0x4c3b('0x12'),_0x4ea673,_0x4c3b('0x10'),JSON[_0x4c3b('0x13')](_0x3bdfbf));if(_0x3bdfbf[_0x4c3b('0x14')]){if(_0x3bdfbf['error'][_0x4c3b('0x15')]===0x1f4){logger[_0x4c3b('0x14')](_0x4c3b('0xf'),_0x4ea673,_0x3bdfbf[_0x4c3b('0x14')][_0x4c3b('0x16')]);return _0x759fda(_0x3bdfbf[_0x4c3b('0x14')][_0x4c3b('0x16')]);}logger[_0x4c3b('0x14')](_0x4c3b('0xf'),_0x4ea673,_0x3bdfbf[_0x4c3b('0x14')]['message']);return _0x2719dc(_0x3bdfbf[_0x4c3b('0x14')][_0x4c3b('0x16')]);}else{logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x4ea673,'request\x20sent');_0x2719dc(_0x3bdfbf['result'][_0x4c3b('0x16')]);}})['catch'](function(_0x21b275){logger[_0x4c3b('0x14')](_0x4c3b('0xf'),_0x4ea673,_0x21b275);_0x759fda(_0x21b275);});});}exports[_0x4c3b('0x17')]=function(_0x58e545){var _0x24b920=this;return new Promise(function(_0x49fc22,_0x1590ca){return db[_0x4c3b('0x18')]['findAll']({'raw':_0x58e545[_0x4c3b('0x19')]?_0x58e545[_0x4c3b('0x19')][_0x4c3b('0x1a')]===undefined?!![]:![]:!![],'where':_0x58e545['options']?_0x58e545['options'][_0x4c3b('0x1b')]||null:null,'attributes':_0x58e545['options']?_0x58e545[_0x4c3b('0x19')]['attributes']||null:null,'limit':_0x58e545['options']?_0x58e545[_0x4c3b('0x19')]['limit']||null:null,'include':_0x58e545[_0x4c3b('0x19')]?_0x58e545[_0x4c3b('0x19')][_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x58e545[_0x4c3b('0x19')][_0x4c3b('0x1c')],function(_0x4c9670){return{'model':db[_0x4c9670[_0x4c3b('0x1e')]],'as':_0x4c9670['as'],'attributes':_0x4c9670[_0x4c3b('0x1f')],'include':_0x4c9670[_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x4c9670[_0x4c3b('0x1c')],function(_0x425258){return{'model':db[_0x425258[_0x4c3b('0x1e')]],'as':_0x425258['as'],'attributes':_0x425258[_0x4c3b('0x1f')],'include':_0x425258['include']?_[_0x4c3b('0x1d')](_0x425258[_0x4c3b('0x1c')],function(_0x1d6389){return{'model':db[_0x1d6389[_0x4c3b('0x1e')]],'as':_0x1d6389['as'],'attributes':_0x1d6389[_0x4c3b('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4c3b('0x20')](function(_0x18f150){logger[_0x4c3b('0xe')](_0x4c3b('0x17'),_0x58e545);logger['debug'](_0x4c3b('0x17'),_0x58e545,JSON[_0x4c3b('0x13')](_0x18f150));_0x49fc22(_0x18f150);})['catch'](function(_0x117856){logger[_0x4c3b('0x14')]('GetSugarcrmAccount',_0x117856[_0x4c3b('0x16')],_0x58e545);_0x1590ca(_0x24b920[_0x4c3b('0x14')](0x1f4,_0x117856['message']));});});};exports['ShowSugarcrmAccount']=function(_0x5f2388){var _0x3578f4=this;return new Promise(function(_0x1bed90,_0x96c75f){return db[_0x4c3b('0x18')]['find']({'raw':_0x5f2388[_0x4c3b('0x19')]?_0x5f2388[_0x4c3b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5f2388['options']?_0x5f2388['options'][_0x4c3b('0x1b')]||null:null,'attributes':_0x5f2388['options']?_0x5f2388[_0x4c3b('0x19')]['attributes']||null:null,'include':_0x5f2388[_0x4c3b('0x19')]?_0x5f2388['options'][_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x5f2388[_0x4c3b('0x19')]['include'],function(_0x8be7ea){return{'model':db[_0x8be7ea[_0x4c3b('0x1e')]],'as':_0x8be7ea['as'],'attributes':_0x8be7ea[_0x4c3b('0x1f')],'include':_0x8be7ea['include']?_['map'](_0x8be7ea[_0x4c3b('0x1c')],function(_0x447e26){return{'model':db[_0x447e26[_0x4c3b('0x1e')]],'as':_0x447e26['as'],'attributes':_0x447e26[_0x4c3b('0x1f')],'include':_0x447e26[_0x4c3b('0x1c')]?_[_0x4c3b('0x1d')](_0x447e26['include'],function(_0xa51a8a){return{'model':db[_0xa51a8a['model']],'as':_0xa51a8a['as'],'attributes':_0xa51a8a[_0x4c3b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2677c0){logger[_0x4c3b('0xe')](_0x4c3b('0x21'),_0x5f2388);logger[_0x4c3b('0x11')]('ShowSugarcrmAccount',_0x5f2388,JSON[_0x4c3b('0x13')](_0x2677c0));_0x1bed90(_0x2677c0);})[_0x4c3b('0x22')](function(_0xa2b0b4){logger[_0x4c3b('0x14')](_0x4c3b('0x21'),_0xa2b0b4[_0x4c3b('0x16')],_0x5f2388);_0x96c75f(_0x3578f4[_0x4c3b('0x14')](0x1f4,_0xa2b0b4[_0x4c3b('0x16')]));});});};
\ No newline at end of file
index f5f8b87..d6871ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f81=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x327c69,_0x27e755){var _0x49c1af=function(_0x21f59e){while(--_0x21f59e){_0x327c69['push'](_0x327c69['shift']());}};_0x49c1af(++_0x27e755);}(_0x1f81,0xab));var _0x11f8=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x1f81[_0x1406ae];return _0x23a076;};'use strict';var multer=require(_0x11f8('0x0'));var util=require(_0x11f8('0x1'));var path=require('path');var timeout=require(_0x11f8('0x2'));var express=require(_0x11f8('0x3'));var router=express['Router']();var fs_extra=require(_0x11f8('0x4'));var auth=require(_0x11f8('0x5'));var interaction=require(_0x11f8('0x6'));var config=require(_0x11f8('0x7'));var controller=require(_0x11f8('0x8'));router[_0x11f8('0x9')]('/',auth[_0x11f8('0xa')](),controller[_0x11f8('0xb')]);router['get'](_0x11f8('0xc'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xd')]);router[_0x11f8('0x9')](_0x11f8('0xe'),auth[_0x11f8('0xa')](),controller[_0x11f8('0xf')]);router[_0x11f8('0x9')](_0x11f8('0x10'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x11')]);router['get'](_0x11f8('0x12'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x13')]);router[_0x11f8('0x14')]('/',auth[_0x11f8('0xa')](),controller[_0x11f8('0x15')]);router['put'](_0x11f8('0xc'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x16')]);router['delete'](_0x11f8('0xc'),auth[_0x11f8('0xa')](),controller[_0x11f8('0x17')]);module[_0x11f8('0x18')]=router;
\ No newline at end of file
+var _0xc1a8=['put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x274f14,_0x58cf09){var _0x324332=function(_0x640267){while(--_0x640267){_0x274f14['push'](_0x274f14['shift']());}};_0x324332(++_0x58cf09);}(_0xc1a8,0xcb));var _0x8c1a=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0xc1a8[_0x27eda0];return _0x2b63a5;};'use strict';var multer=require(_0x8c1a('0x0'));var util=require(_0x8c1a('0x1'));var path=require(_0x8c1a('0x2'));var timeout=require('connect-timeout');var express=require(_0x8c1a('0x3'));var router=express[_0x8c1a('0x4')]();var fs_extra=require(_0x8c1a('0x5'));var auth=require(_0x8c1a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8c1a('0x7'));var controller=require(_0x8c1a('0x8'));router[_0x8c1a('0x9')]('/',auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xb')]);router['get'](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xd')]);router[_0x8c1a('0x9')](_0x8c1a('0xe'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0xf')]);router[_0x8c1a('0x9')](_0x8c1a('0x10'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x11')]);router[_0x8c1a('0x9')](_0x8c1a('0x12'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x13')]);router[_0x8c1a('0x14')]('/',auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x15')]);router[_0x8c1a('0x16')](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller[_0x8c1a('0x17')]);router['delete'](_0x8c1a('0xc'),auth[_0x8c1a('0xa')](),controller['destroy']);module[_0x8c1a('0x18')]=router;
\ No newline at end of file
index 877bdf7..1a93fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33e1=['exports','STRING','sequelize'];(function(_0x2b6c40,_0x392cab){var _0xfbd49d=function(_0x34086f){while(--_0x34086f){_0x2b6c40['push'](_0x2b6c40['shift']());}};_0xfbd49d(++_0x392cab);}(_0x33e1,0x113));var _0x133e=function(_0x5ad9dd,_0x542fef){_0x5ad9dd=_0x5ad9dd-0x0;var _0x2db6c0=_0x33e1[_0x5ad9dd];return _0x2db6c0;};'use strict';var Sequelize=require(_0x133e('0x0'));module[_0x133e('0x1')]={'name':{'type':Sequelize[_0x133e('0x2')]},'description':{'type':Sequelize[_0x133e('0x2')]}};
\ No newline at end of file
+var _0x18b9=['STRING','sequelize','exports'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x18b9,0x1de));var _0x918b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x18b9[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x918b('0x0'));module[_0x918b('0x1')]={'name':{'type':Sequelize[_0x918b('0x2')]},'description':{'type':Sequelize[_0x918b('0x2')]}};
\ No newline at end of file
index b9e6408..5092d5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf570=['catch','body','find','SugarcrmField','length','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','SugarcrmConfiguration','include','rows','show','params','includeAll','create'];(function(_0x60159e,_0x251a55){var _0x5d35b3=function(_0x5882b6){while(--_0x5882b6){_0x60159e['push'](_0x60159e['shift']());}};_0x5d35b3(++_0x251a55);}(_0xf570,0x1e3));var _0x0f57=function(_0x320c50,_0x6be7c7){_0x320c50=_0x320c50-0x0;var _0xd27ada=_0xf570[_0x320c50];return _0xd27ada;};'use strict';var emlformat=require(_0x0f57('0x0'));var rimraf=require(_0x0f57('0x1'));var zipdir=require(_0x0f57('0x2'));var jsonpatch=require(_0x0f57('0x3'));var rp=require(_0x0f57('0x4'));var moment=require(_0x0f57('0x5'));var BPromise=require(_0x0f57('0x6'));var Mustache=require('mustache');var util=require(_0x0f57('0x7'));var path=require(_0x0f57('0x8'));var sox=require('sox');var csv=require(_0x0f57('0x9'));var ejs=require(_0x0f57('0xa'));var fs=require('fs');var fs_extra=require(_0x0f57('0xb'));var _=require(_0x0f57('0xc'));var squel=require(_0x0f57('0xd'));var crypto=require(_0x0f57('0xe'));var jsforce=require(_0x0f57('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0f57('0x9'));var querystring=require('querystring');var Papa=require(_0x0f57('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f57('0x11'));var as=require(_0x0f57('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f57('0x13'))(_0x0f57('0x14'));var utils=require(_0x0f57('0x15'));var config=require(_0x0f57('0x16'));var licenseUtil=require(_0x0f57('0x17'));var db=require(_0x0f57('0x18'))['db'];function respondWithStatusCode(_0x50c4a4,_0x188e07){_0x188e07=_0x188e07||0xcc;return function(_0x59355f){if(_0x59355f){return _0x50c4a4['sendStatus'](_0x188e07);}return _0x50c4a4['status'](_0x188e07)[_0x0f57('0x19')]();};}function respondWithResult(_0x3a2cb3,_0x3d8abe){_0x3d8abe=_0x3d8abe||0xc8;return function(_0x419218){if(_0x419218){return _0x3a2cb3['status'](_0x3d8abe)[_0x0f57('0x1a')](_0x419218);}};}function respondWithFilteredResult(_0x34ae4e,_0x55ec48){return function(_0x56a541){if(_0x56a541){var _0x5ade89=typeof _0x55ec48[_0x0f57('0x1b')]===_0x0f57('0x1c')&&typeof _0x55ec48['limit']==='undefined';var _0x4d6b31=_0x56a541[_0x0f57('0x1d')];var _0x54679b=_0x5ade89?0x0:_0x55ec48[_0x0f57('0x1b')];var _0x451145=_0x5ade89?_0x56a541[_0x0f57('0x1d')]:_0x55ec48[_0x0f57('0x1b')]+_0x55ec48['limit'];var _0x3a8730;if(_0x451145>=_0x4d6b31){_0x451145=_0x4d6b31;_0x3a8730=0xc8;}else{_0x3a8730=0xce;}_0x34ae4e['status'](_0x3a8730);return _0x34ae4e[_0x0f57('0x1e')](_0x0f57('0x1f'),_0x54679b+'-'+_0x451145+'/'+_0x4d6b31)['json'](_0x56a541);}return null;};}function patchUpdates(_0x4cbc4e){return function(_0x11e17c){try{jsonpatch[_0x0f57('0x20')](_0x11e17c,_0x4cbc4e,!![]);}catch(_0x1018c8){return BPromise[_0x0f57('0x21')](_0x1018c8);}return _0x11e17c['save']();};}function saveUpdates(_0x544467,_0x1e25bb){return function(_0x56ccce){if(_0x56ccce){return _0x56ccce[_0x0f57('0x22')](_0x544467)[_0x0f57('0x23')](function(_0x26cfbf){return _0x26cfbf;});}return null;};}function removeEntity(_0x2de74b,_0x5b85c1){return function(_0x3f26c8){if(_0x3f26c8){return _0x3f26c8[_0x0f57('0x24')]()[_0x0f57('0x23')](function(){_0x2de74b[_0x0f57('0x25')](0xcc)[_0x0f57('0x19')]();});}};}function handleEntityNotFound(_0x22d4a4,_0x355711){return function(_0x1ee84e){if(!_0x1ee84e){_0x22d4a4['sendStatus'](0x194);}return _0x1ee84e;};}function handleError(_0x4dbee5,_0x54e512){_0x54e512=_0x54e512||0x1f4;return function(_0x4f9d45){logger[_0x0f57('0x26')](_0x4f9d45[_0x0f57('0x27')]);if(_0x4f9d45[_0x0f57('0x28')]){delete _0x4f9d45[_0x0f57('0x28')];}_0x4dbee5[_0x0f57('0x25')](_0x54e512)[_0x0f57('0x29')](_0x4f9d45);};}exports[_0x0f57('0x2a')]=function(_0x9bc863,_0x295a2a){var _0x56ce61={},_0x4dacd0={},_0x529eb1={'count':0x0,'rows':[]};var _0x569da5=_[_0x0f57('0x2b')](db['SugarcrmConfiguration'][_0x0f57('0x2c')],function(_0x33b8fe){return{'name':_0x33b8fe[_0x0f57('0x2d')],'type':_0x33b8fe['type'][_0x0f57('0x2e')]};});_0x4dacd0[_0x0f57('0x2f')]=_['map'](_0x569da5,_0x0f57('0x28'));_0x4dacd0[_0x0f57('0x30')]=_[_0x0f57('0x31')](_0x9bc863['query']);_0x4dacd0[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x4dacd0['model'],_0x4dacd0[_0x0f57('0x30')]);_0x56ce61[_0x0f57('0x34')]=_[_0x0f57('0x33')](_0x4dacd0[_0x0f57('0x2f')],qs[_0x0f57('0x35')](_0x9bc863[_0x0f57('0x30')][_0x0f57('0x35')]));_0x56ce61[_0x0f57('0x34')]=_0x56ce61['attributes']['length']?_0x56ce61[_0x0f57('0x34')]:_0x4dacd0[_0x0f57('0x2f')];if(!_0x9bc863['query'][_0x0f57('0x36')](_0x0f57('0x37'))){_0x56ce61[_0x0f57('0x38')]=qs['limit'](_0x9bc863['query'][_0x0f57('0x38')]);_0x56ce61[_0x0f57('0x1b')]=qs[_0x0f57('0x1b')](_0x9bc863[_0x0f57('0x30')]['offset']);}_0x56ce61[_0x0f57('0x39')]=qs['sort'](_0x9bc863[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x56ce61['where']=qs[_0x0f57('0x32')](_['pick'](_0x9bc863[_0x0f57('0x30')],_0x4dacd0['filters']),_0x569da5);if(_0x9bc863[_0x0f57('0x30')][_0x0f57('0x3b')]){_0x56ce61[_0x0f57('0x3c')]=_['merge'](_0x56ce61[_0x0f57('0x3c')],{'$or':_[_0x0f57('0x2b')](_0x569da5,function(_0x3b3c7f){if(_0x3b3c7f['type']!=='VIRTUAL'){var _0x48d3d5={};_0x48d3d5[_0x3b3c7f[_0x0f57('0x28')]]={'$like':'%'+_0x9bc863[_0x0f57('0x30')][_0x0f57('0x3b')]+'%'};return _0x48d3d5;}})});}_0x56ce61=_[_0x0f57('0x3d')]({},_0x56ce61,_0x9bc863[_0x0f57('0x3e')]);var _0x2d9640={'where':_0x56ce61[_0x0f57('0x3c')]};return db[_0x0f57('0x3f')][_0x0f57('0x1d')](_0x2d9640)[_0x0f57('0x23')](function(_0x1b8abf){_0x529eb1[_0x0f57('0x1d')]=_0x1b8abf;if(_0x9bc863['query']['includeAll']){_0x56ce61[_0x0f57('0x40')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x56ce61);})[_0x0f57('0x23')](function(_0x4c2977){_0x529eb1[_0x0f57('0x41')]=_0x4c2977;return _0x529eb1;})['then'](respondWithFilteredResult(_0x295a2a,_0x56ce61))['catch'](handleError(_0x295a2a,null));};exports[_0x0f57('0x42')]=function(_0x20790d,_0x180d2b){var _0x76bca={'raw':![],'where':{'id':_0x20790d[_0x0f57('0x43')]['id']}},_0x41671c={};_0x41671c[_0x0f57('0x2f')]=_[_0x0f57('0x31')](db[_0x0f57('0x3f')]['rawAttributes']);_0x41671c['query']=_['keys'](_0x20790d[_0x0f57('0x30')]);_0x41671c[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x41671c[_0x0f57('0x2f')],_0x41671c[_0x0f57('0x30')]);_0x76bca['attributes']=_[_0x0f57('0x33')](_0x41671c[_0x0f57('0x2f')],qs['fields'](_0x20790d[_0x0f57('0x30')][_0x0f57('0x35')]));_0x76bca['attributes']=_0x76bca[_0x0f57('0x34')]['length']?_0x76bca['attributes']:_0x41671c['model'];if(_0x20790d[_0x0f57('0x30')][_0x0f57('0x44')]){_0x76bca[_0x0f57('0x40')]=[{'all':!![]}];}_0x76bca=_[_0x0f57('0x3d')]({},_0x76bca,_0x20790d[_0x0f57('0x3e')]);return db[_0x0f57('0x3f')]['find'](_0x76bca)[_0x0f57('0x23')](handleEntityNotFound(_0x180d2b,null))[_0x0f57('0x23')](respondWithResult(_0x180d2b,null))['catch'](handleError(_0x180d2b,null));};exports['create']=function(_0x3ff530,_0x169bd1){return db['SugarcrmConfiguration'][_0x0f57('0x45')](_0x3ff530['body'],{})[_0x0f57('0x23')](respondWithResult(_0x169bd1,0xc9))[_0x0f57('0x46')](handleError(_0x169bd1,null));};exports[_0x0f57('0x22')]=function(_0x5358f0,_0x4ac57a){if(_0x5358f0[_0x0f57('0x47')]['id']){delete _0x5358f0[_0x0f57('0x47')]['id'];}return db[_0x0f57('0x3f')]['find']({'where':{'id':_0x5358f0['params']['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x4ac57a,null))[_0x0f57('0x23')](saveUpdates(_0x5358f0[_0x0f57('0x47')],null))[_0x0f57('0x23')](respondWithResult(_0x4ac57a,null))[_0x0f57('0x46')](handleError(_0x4ac57a,null));};exports[_0x0f57('0x24')]=function(_0x1f9395,_0x20686e){return db[_0x0f57('0x3f')][_0x0f57('0x48')]({'where':{'id':_0x1f9395[_0x0f57('0x43')]['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x20686e,null))['then'](removeEntity(_0x20686e,null))[_0x0f57('0x46')](handleError(_0x20686e,null));};exports['getFields']=function(_0x46b605,_0x38a54b,_0x56d812){var _0x43986b={};var _0x7573bf={};var _0x33faf7;var _0x3f13d0;return db[_0x0f57('0x3f')]['findOne']({'where':{'id':_0x46b605[_0x0f57('0x43')]['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x38a54b,null))['then'](function(_0x103021){if(_0x103021){_0x33faf7=_0x103021;_0x7573bf[_0x0f57('0x2f')]=_[_0x0f57('0x31')](db[_0x0f57('0x49')][_0x0f57('0x2c')]);_0x7573bf[_0x0f57('0x30')]=_[_0x0f57('0x31')](_0x46b605[_0x0f57('0x30')]);_0x7573bf[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x7573bf[_0x0f57('0x2f')],_0x7573bf['query']);_0x43986b[_0x0f57('0x34')]=_[_0x0f57('0x33')](_0x7573bf[_0x0f57('0x2f')],qs[_0x0f57('0x35')](_0x46b605[_0x0f57('0x30')][_0x0f57('0x35')]));_0x43986b[_0x0f57('0x34')]=_0x43986b['attributes'][_0x0f57('0x4a')]?_0x43986b[_0x0f57('0x34')]:_0x7573bf[_0x0f57('0x2f')];_0x43986b[_0x0f57('0x39')]=qs[_0x0f57('0x3a')](_0x46b605[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x43986b['where']=qs[_0x0f57('0x32')](_[_0x0f57('0x4b')](_0x46b605[_0x0f57('0x30')],_0x7573bf[_0x0f57('0x32')]));if(_0x46b605[_0x0f57('0x30')][_0x0f57('0x3b')]){_0x43986b['where']=_[_0x0f57('0x3d')](_0x43986b[_0x0f57('0x3c')],{'$or':_[_0x0f57('0x2b')](_0x43986b['attributes'],function(_0x1a4f91){var _0x29f2a7={};_0x29f2a7[_0x1a4f91]={'$like':'%'+_0x46b605[_0x0f57('0x30')][_0x0f57('0x3b')]+'%'};return _0x29f2a7;})});}_0x43986b=_[_0x0f57('0x3d')]({},_0x43986b,_0x46b605[_0x0f57('0x3e')]);return _0x33faf7['getFields'](_0x43986b);}})[_0x0f57('0x23')](function(_0x1fdca1){if(_0x1fdca1){_0x3f13d0=_0x1fdca1['length'];if(!_0x46b605[_0x0f57('0x30')][_0x0f57('0x36')](_0x0f57('0x37'))){_0x43986b[_0x0f57('0x38')]=qs[_0x0f57('0x38')](_0x46b605[_0x0f57('0x30')]['limit']);_0x43986b[_0x0f57('0x1b')]=qs['offset'](_0x46b605[_0x0f57('0x30')]['offset']);}return _0x33faf7[_0x0f57('0x4c')](_0x43986b);}})['then'](function(_0x228a2b){if(_0x228a2b){return _0x228a2b?{'count':_0x3f13d0,'rows':_0x228a2b}:null;}})[_0x0f57('0x23')](respondWithResult(_0x38a54b,null))['catch'](handleError(_0x38a54b,null));};exports['getSubjects']=function(_0x43f68e,_0x43e279,_0x10b853){var _0x4007d7={};var _0x49410c={};var _0x36ad44;var _0x1682f1;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x43f68e[_0x0f57('0x43')]['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x43e279,null))['then'](function(_0x3efee5){if(_0x3efee5){_0x36ad44=_0x3efee5;_0x49410c['model']=_[_0x0f57('0x31')](db[_0x0f57('0x49')][_0x0f57('0x2c')]);_0x49410c[_0x0f57('0x30')]=_[_0x0f57('0x31')](_0x43f68e[_0x0f57('0x30')]);_0x49410c['filters']=_[_0x0f57('0x33')](_0x49410c[_0x0f57('0x2f')],_0x49410c['query']);_0x4007d7['attributes']=_['intersection'](_0x49410c[_0x0f57('0x2f')],qs['fields'](_0x43f68e[_0x0f57('0x30')][_0x0f57('0x35')]));_0x4007d7[_0x0f57('0x34')]=_0x4007d7[_0x0f57('0x34')][_0x0f57('0x4a')]?_0x4007d7[_0x0f57('0x34')]:_0x49410c[_0x0f57('0x2f')];_0x4007d7['order']=qs[_0x0f57('0x3a')](_0x43f68e[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x4007d7[_0x0f57('0x3c')]=qs[_0x0f57('0x32')](_[_0x0f57('0x4b')](_0x43f68e['query'],_0x49410c[_0x0f57('0x32')]));if(_0x43f68e[_0x0f57('0x30')][_0x0f57('0x3b')]){_0x4007d7[_0x0f57('0x3c')]=_[_0x0f57('0x3d')](_0x4007d7['where'],{'$or':_[_0x0f57('0x2b')](_0x4007d7['attributes'],function(_0x5990ea){var _0x43d09c={};_0x43d09c[_0x5990ea]={'$like':'%'+_0x43f68e[_0x0f57('0x30')][_0x0f57('0x3b')]+'%'};return _0x43d09c;})});}_0x4007d7=_[_0x0f57('0x3d')]({},_0x4007d7,_0x43f68e[_0x0f57('0x3e')]);return _0x36ad44['getSubjects'](_0x4007d7);}})[_0x0f57('0x23')](function(_0x49f333){if(_0x49f333){_0x1682f1=_0x49f333[_0x0f57('0x4a')];if(!_0x43f68e['query']['hasOwnProperty']('nolimit')){_0x4007d7['limit']=qs[_0x0f57('0x38')](_0x43f68e['query'][_0x0f57('0x38')]);_0x4007d7['offset']=qs['offset'](_0x43f68e['query'][_0x0f57('0x1b')]);}return _0x36ad44[_0x0f57('0x4d')](_0x4007d7);}})['then'](function(_0x893a37){if(_0x893a37){return _0x893a37?{'count':_0x1682f1,'rows':_0x893a37}:null;}})[_0x0f57('0x23')](respondWithResult(_0x43e279,null))[_0x0f57('0x46')](handleError(_0x43e279,null));};exports[_0x0f57('0x4e')]=function(_0x495b27,_0x167a3c,_0x10ff11){var _0x1b8000={};var _0x5d88b9={};var _0x4618b2;var _0x4d3889;return db[_0x0f57('0x3f')]['findOne']({'where':{'id':_0x495b27['params']['id']}})[_0x0f57('0x23')](handleEntityNotFound(_0x167a3c,null))[_0x0f57('0x23')](function(_0x1a301e){if(_0x1a301e){_0x4618b2=_0x1a301e;_0x5d88b9[_0x0f57('0x2f')]=_[_0x0f57('0x31')](db[_0x0f57('0x49')][_0x0f57('0x2c')]);_0x5d88b9['query']=_[_0x0f57('0x31')](_0x495b27[_0x0f57('0x30')]);_0x5d88b9[_0x0f57('0x32')]=_[_0x0f57('0x33')](_0x5d88b9[_0x0f57('0x2f')],_0x5d88b9[_0x0f57('0x30')]);_0x1b8000[_0x0f57('0x34')]=_[_0x0f57('0x33')](_0x5d88b9['model'],qs[_0x0f57('0x35')](_0x495b27['query'][_0x0f57('0x35')]));_0x1b8000[_0x0f57('0x34')]=_0x1b8000['attributes']['length']?_0x1b8000[_0x0f57('0x34')]:_0x5d88b9[_0x0f57('0x2f')];_0x1b8000['order']=qs[_0x0f57('0x3a')](_0x495b27[_0x0f57('0x30')][_0x0f57('0x3a')]);_0x1b8000['where']=qs['filters'](_[_0x0f57('0x4b')](_0x495b27[_0x0f57('0x30')],_0x5d88b9[_0x0f57('0x32')]));if(_0x495b27['query'][_0x0f57('0x3b')]){_0x1b8000['where']=_[_0x0f57('0x3d')](_0x1b8000['where'],{'$or':_[_0x0f57('0x2b')](_0x1b8000['attributes'],function(_0x153884){var _0x3c6453={};_0x3c6453[_0x153884]={'$like':'%'+_0x495b27['query']['filter']+'%'};return _0x3c6453;})});}_0x1b8000=_[_0x0f57('0x3d')]({},_0x1b8000,_0x495b27['options']);return _0x4618b2[_0x0f57('0x4e')](_0x1b8000);}})[_0x0f57('0x23')](function(_0x2f8763){if(_0x2f8763){_0x4d3889=_0x2f8763[_0x0f57('0x4a')];if(!_0x495b27[_0x0f57('0x30')][_0x0f57('0x36')](_0x0f57('0x37'))){_0x1b8000[_0x0f57('0x38')]=qs['limit'](_0x495b27[_0x0f57('0x30')][_0x0f57('0x38')]);_0x1b8000[_0x0f57('0x1b')]=qs[_0x0f57('0x1b')](_0x495b27[_0x0f57('0x30')]['offset']);}return _0x4618b2[_0x0f57('0x4e')](_0x1b8000);}})[_0x0f57('0x23')](function(_0x117762){if(_0x117762){return _0x117762?{'count':_0x4d3889,'rows':_0x117762}:null;}})[_0x0f57('0x23')](respondWithResult(_0x167a3c,null))[_0x0f57('0x46')](handleError(_0x167a3c,null));};
\ No newline at end of file
+var _0xdfef=['apply','reject','save','update','destroy','then','error','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','getFields','findOne','SugarcrmField','sort','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x10bc04,_0x4682fe){var _0xb29042=function(_0x1e34e0){while(--_0x1e34e0){_0x10bc04['push'](_0x10bc04['shift']());}};_0xb29042(++_0x4682fe);}(_0xdfef,0xd7));var _0xfdfe=function(_0x408818,_0x1f7d46){_0x408818=_0x408818-0x0;var _0x3a3f9f=_0xdfef[_0x408818];return _0x3a3f9f;};'use strict';var emlformat=require(_0xfdfe('0x0'));var rimraf=require(_0xfdfe('0x1'));var zipdir=require(_0xfdfe('0x2'));var jsonpatch=require(_0xfdfe('0x3'));var rp=require(_0xfdfe('0x4'));var moment=require(_0xfdfe('0x5'));var BPromise=require(_0xfdfe('0x6'));var Mustache=require('mustache');var util=require(_0xfdfe('0x7'));var path=require(_0xfdfe('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdfe('0x9'));var fs=require('fs');var fs_extra=require(_0xfdfe('0xa'));var _=require(_0xfdfe('0xb'));var squel=require(_0xfdfe('0xc'));var crypto=require(_0xfdfe('0xd'));var jsforce=require(_0xfdfe('0xe'));var deskjs=require(_0xfdfe('0xf'));var toCsv=require(_0xfdfe('0x10'));var querystring=require(_0xfdfe('0x11'));var Papa=require(_0xfdfe('0x12'));var Redis=require('ioredis');var authService=require(_0xfdfe('0x13'));var qs=require(_0xfdfe('0x14'));var as=require(_0xfdfe('0x15'));var hardwareService=require(_0xfdfe('0x16'));var logger=require('../../config/logger')(_0xfdfe('0x17'));var utils=require(_0xfdfe('0x18'));var config=require(_0xfdfe('0x19'));var licenseUtil=require(_0xfdfe('0x1a'));var db=require(_0xfdfe('0x1b'))['db'];function respondWithStatusCode(_0x57fc74,_0x448b4e){_0x448b4e=_0x448b4e||0xcc;return function(_0x1285ac){if(_0x1285ac){return _0x57fc74['sendStatus'](_0x448b4e);}return _0x57fc74[_0xfdfe('0x1c')](_0x448b4e)[_0xfdfe('0x1d')]();};}function respondWithResult(_0x18ab67,_0x4f6fc5){_0x4f6fc5=_0x4f6fc5||0xc8;return function(_0x31604c){if(_0x31604c){return _0x18ab67[_0xfdfe('0x1c')](_0x4f6fc5)[_0xfdfe('0x1e')](_0x31604c);}};}function respondWithFilteredResult(_0x4587ae,_0x14b621){return function(_0x5d5388){if(_0x5d5388){var _0xaa52b8=typeof _0x14b621[_0xfdfe('0x1f')]===_0xfdfe('0x20')&&typeof _0x14b621[_0xfdfe('0x21')]===_0xfdfe('0x20');var _0x21a330=_0x5d5388[_0xfdfe('0x22')];var _0x3c9d9c=_0xaa52b8?0x0:_0x14b621[_0xfdfe('0x1f')];var _0x340309=_0xaa52b8?_0x5d5388[_0xfdfe('0x22')]:_0x14b621[_0xfdfe('0x1f')]+_0x14b621[_0xfdfe('0x21')];var _0x423b34;if(_0x340309>=_0x21a330){_0x340309=_0x21a330;_0x423b34=0xc8;}else{_0x423b34=0xce;}_0x4587ae['status'](_0x423b34);return _0x4587ae[_0xfdfe('0x23')](_0xfdfe('0x24'),_0x3c9d9c+'-'+_0x340309+'/'+_0x21a330)['json'](_0x5d5388);}return null;};}function patchUpdates(_0x196088){return function(_0x255175){try{jsonpatch[_0xfdfe('0x25')](_0x255175,_0x196088,!![]);}catch(_0x1a15cb){return BPromise[_0xfdfe('0x26')](_0x1a15cb);}return _0x255175[_0xfdfe('0x27')]();};}function saveUpdates(_0x3bf883,_0x275b77){return function(_0x250958){if(_0x250958){return _0x250958[_0xfdfe('0x28')](_0x3bf883)['then'](function(_0x2a3121){return _0x2a3121;});}return null;};}function removeEntity(_0x176f64,_0x51cf74){return function(_0x1c400f){if(_0x1c400f){return _0x1c400f[_0xfdfe('0x29')]()[_0xfdfe('0x2a')](function(){_0x176f64['status'](0xcc)[_0xfdfe('0x1d')]();});}};}function handleEntityNotFound(_0x4b9ddc,_0x2c7dcd){return function(_0x5e133f){if(!_0x5e133f){_0x4b9ddc['sendStatus'](0x194);}return _0x5e133f;};}function handleError(_0x371ccb,_0x14665d){_0x14665d=_0x14665d||0x1f4;return function(_0x17d574){logger[_0xfdfe('0x2b')](_0x17d574['stack']);if(_0x17d574[_0xfdfe('0x2c')]){delete _0x17d574[_0xfdfe('0x2c')];}_0x371ccb['status'](_0x14665d)[_0xfdfe('0x2d')](_0x17d574);};}exports[_0xfdfe('0x2e')]=function(_0x2923bd,_0x4c0d95){var _0x1c48b0={},_0x22f335={},_0x480fd9={'count':0x0,'rows':[]};var _0x1cb78c=_[_0xfdfe('0x2f')](db[_0xfdfe('0x30')][_0xfdfe('0x31')],function(_0x26c282){return{'name':_0x26c282['fieldName'],'type':_0x26c282[_0xfdfe('0x32')][_0xfdfe('0x33')]};});_0x22f335[_0xfdfe('0x34')]=_[_0xfdfe('0x2f')](_0x1cb78c,_0xfdfe('0x2c'));_0x22f335[_0xfdfe('0x35')]=_[_0xfdfe('0x36')](_0x2923bd[_0xfdfe('0x35')]);_0x22f335['filters']=_[_0xfdfe('0x37')](_0x22f335[_0xfdfe('0x34')],_0x22f335['query']);_0x1c48b0[_0xfdfe('0x38')]=_['intersection'](_0x22f335['model'],qs['fields'](_0x2923bd[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0x1c48b0[_0xfdfe('0x38')]=_0x1c48b0[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0x1c48b0['attributes']:_0x22f335[_0xfdfe('0x34')];if(!_0x2923bd[_0xfdfe('0x35')]['hasOwnProperty'](_0xfdfe('0x3b'))){_0x1c48b0['limit']=qs['limit'](_0x2923bd[_0xfdfe('0x35')]['limit']);_0x1c48b0[_0xfdfe('0x1f')]=qs['offset'](_0x2923bd['query'][_0xfdfe('0x1f')]);}_0x1c48b0[_0xfdfe('0x3c')]=qs['sort'](_0x2923bd[_0xfdfe('0x35')]['sort']);_0x1c48b0[_0xfdfe('0x3d')]=qs['filters'](_[_0xfdfe('0x3e')](_0x2923bd[_0xfdfe('0x35')],_0x22f335[_0xfdfe('0x3f')]),_0x1cb78c);if(_0x2923bd['query'][_0xfdfe('0x40')]){_0x1c48b0[_0xfdfe('0x3d')]=_[_0xfdfe('0x41')](_0x1c48b0['where'],{'$or':_['map'](_0x1cb78c,function(_0x346857){if(_0x346857[_0xfdfe('0x32')]!==_0xfdfe('0x42')){var _0x2cfa54={};_0x2cfa54[_0x346857['name']]={'$like':'%'+_0x2923bd[_0xfdfe('0x35')][_0xfdfe('0x40')]+'%'};return _0x2cfa54;}})});}_0x1c48b0=_[_0xfdfe('0x41')]({},_0x1c48b0,_0x2923bd[_0xfdfe('0x43')]);var _0x3a25a0={'where':_0x1c48b0['where']};return db['SugarcrmConfiguration']['count'](_0x3a25a0)[_0xfdfe('0x2a')](function(_0x568c83){_0x480fd9[_0xfdfe('0x22')]=_0x568c83;if(_0x2923bd[_0xfdfe('0x35')][_0xfdfe('0x44')]){_0x1c48b0['include']=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x1c48b0);})['then'](function(_0x2063c1){_0x480fd9[_0xfdfe('0x45')]=_0x2063c1;return _0x480fd9;})['then'](respondWithFilteredResult(_0x4c0d95,_0x1c48b0))[_0xfdfe('0x46')](handleError(_0x4c0d95,null));};exports[_0xfdfe('0x47')]=function(_0x347fc0,_0x525662){var _0x39a663={'raw':![],'where':{'id':_0x347fc0[_0xfdfe('0x48')]['id']}},_0x41eb5a={};_0x41eb5a['model']=_[_0xfdfe('0x36')](db[_0xfdfe('0x30')][_0xfdfe('0x31')]);_0x41eb5a[_0xfdfe('0x35')]=_['keys'](_0x347fc0['query']);_0x41eb5a[_0xfdfe('0x3f')]=_['intersection'](_0x41eb5a[_0xfdfe('0x34')],_0x41eb5a[_0xfdfe('0x35')]);_0x39a663['attributes']=_['intersection'](_0x41eb5a[_0xfdfe('0x34')],qs['fields'](_0x347fc0[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0x39a663['attributes']=_0x39a663[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0x39a663[_0xfdfe('0x38')]:_0x41eb5a['model'];if(_0x347fc0['query']['includeAll']){_0x39a663[_0xfdfe('0x49')]=[{'all':!![]}];}_0x39a663=_[_0xfdfe('0x41')]({},_0x39a663,_0x347fc0[_0xfdfe('0x43')]);return db['SugarcrmConfiguration'][_0xfdfe('0x4a')](_0x39a663)['then'](handleEntityNotFound(_0x525662,null))[_0xfdfe('0x2a')](respondWithResult(_0x525662,null))['catch'](handleError(_0x525662,null));};exports[_0xfdfe('0x4b')]=function(_0x4b94ed,_0x3bf323){return db[_0xfdfe('0x30')][_0xfdfe('0x4b')](_0x4b94ed[_0xfdfe('0x4c')],{})[_0xfdfe('0x2a')](respondWithResult(_0x3bf323,0xc9))['catch'](handleError(_0x3bf323,null));};exports[_0xfdfe('0x28')]=function(_0x757ff3,_0x39f700){if(_0x757ff3['body']['id']){delete _0x757ff3[_0xfdfe('0x4c')]['id'];}return db[_0xfdfe('0x30')]['find']({'where':{'id':_0x757ff3[_0xfdfe('0x48')]['id']}})['then'](handleEntityNotFound(_0x39f700,null))[_0xfdfe('0x2a')](saveUpdates(_0x757ff3[_0xfdfe('0x4c')],null))['then'](respondWithResult(_0x39f700,null))[_0xfdfe('0x46')](handleError(_0x39f700,null));};exports[_0xfdfe('0x29')]=function(_0x3be313,_0x238bb4){return db[_0xfdfe('0x30')][_0xfdfe('0x4a')]({'where':{'id':_0x3be313[_0xfdfe('0x48')]['id']}})['then'](handleEntityNotFound(_0x238bb4,null))[_0xfdfe('0x2a')](removeEntity(_0x238bb4,null))['catch'](handleError(_0x238bb4,null));};exports[_0xfdfe('0x4d')]=function(_0x489d2b,_0x1115a4,_0x259ca4){var _0x3a205f={};var _0x305302={};var _0x48cb3a;var _0x5908ab;return db[_0xfdfe('0x30')][_0xfdfe('0x4e')]({'where':{'id':_0x489d2b['params']['id']}})[_0xfdfe('0x2a')](handleEntityNotFound(_0x1115a4,null))[_0xfdfe('0x2a')](function(_0xfeca8a){if(_0xfeca8a){_0x48cb3a=_0xfeca8a;_0x305302[_0xfdfe('0x34')]=_['keys'](db[_0xfdfe('0x4f')][_0xfdfe('0x31')]);_0x305302[_0xfdfe('0x35')]=_['keys'](_0x489d2b['query']);_0x305302[_0xfdfe('0x3f')]=_[_0xfdfe('0x37')](_0x305302[_0xfdfe('0x34')],_0x305302['query']);_0x3a205f['attributes']=_[_0xfdfe('0x37')](_0x305302['model'],qs['fields'](_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0x3a205f['attributes']=_0x3a205f['attributes']['length']?_0x3a205f[_0xfdfe('0x38')]:_0x305302['model'];_0x3a205f[_0xfdfe('0x3c')]=qs[_0xfdfe('0x50')](_0x489d2b[_0xfdfe('0x35')]['sort']);_0x3a205f[_0xfdfe('0x3d')]=qs[_0xfdfe('0x3f')](_['pick'](_0x489d2b[_0xfdfe('0x35')],_0x305302[_0xfdfe('0x3f')]));if(_0x489d2b['query'][_0xfdfe('0x40')]){_0x3a205f[_0xfdfe('0x3d')]=_['merge'](_0x3a205f[_0xfdfe('0x3d')],{'$or':_[_0xfdfe('0x2f')](_0x3a205f['attributes'],function(_0x3c1dc3){var _0x6381e3={};_0x6381e3[_0x3c1dc3]={'$like':'%'+_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x40')]+'%'};return _0x6381e3;})});}_0x3a205f=_[_0xfdfe('0x41')]({},_0x3a205f,_0x489d2b['options']);return _0x48cb3a['getFields'](_0x3a205f);}})[_0xfdfe('0x2a')](function(_0x4c1715){if(_0x4c1715){_0x5908ab=_0x4c1715[_0xfdfe('0x3a')];if(!_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x51')]('nolimit')){_0x3a205f[_0xfdfe('0x21')]=qs[_0xfdfe('0x21')](_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x21')]);_0x3a205f[_0xfdfe('0x1f')]=qs[_0xfdfe('0x1f')](_0x489d2b[_0xfdfe('0x35')][_0xfdfe('0x1f')]);}return _0x48cb3a[_0xfdfe('0x4d')](_0x3a205f);}})[_0xfdfe('0x2a')](function(_0x2afe3a){if(_0x2afe3a){return _0x2afe3a?{'count':_0x5908ab,'rows':_0x2afe3a}:null;}})[_0xfdfe('0x2a')](respondWithResult(_0x1115a4,null))[_0xfdfe('0x46')](handleError(_0x1115a4,null));};exports[_0xfdfe('0x52')]=function(_0x490c21,_0x55d658,_0x58eefd){var _0x2d2d5b={};var _0x4676f3={};var _0x4aa3d6;var _0x4fe36a;return db[_0xfdfe('0x30')][_0xfdfe('0x4e')]({'where':{'id':_0x490c21[_0xfdfe('0x48')]['id']}})[_0xfdfe('0x2a')](handleEntityNotFound(_0x55d658,null))[_0xfdfe('0x2a')](function(_0x5c4fe9){if(_0x5c4fe9){_0x4aa3d6=_0x5c4fe9;_0x4676f3[_0xfdfe('0x34')]=_[_0xfdfe('0x36')](db[_0xfdfe('0x4f')]['rawAttributes']);_0x4676f3[_0xfdfe('0x35')]=_[_0xfdfe('0x36')](_0x490c21[_0xfdfe('0x35')]);_0x4676f3['filters']=_[_0xfdfe('0x37')](_0x4676f3[_0xfdfe('0x34')],_0x4676f3[_0xfdfe('0x35')]);_0x2d2d5b['attributes']=_[_0xfdfe('0x37')](_0x4676f3[_0xfdfe('0x34')],qs[_0xfdfe('0x39')](_0x490c21['query'][_0xfdfe('0x39')]));_0x2d2d5b['attributes']=_0x2d2d5b[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0x2d2d5b[_0xfdfe('0x38')]:_0x4676f3[_0xfdfe('0x34')];_0x2d2d5b[_0xfdfe('0x3c')]=qs[_0xfdfe('0x50')](_0x490c21[_0xfdfe('0x35')]['sort']);_0x2d2d5b[_0xfdfe('0x3d')]=qs['filters'](_[_0xfdfe('0x3e')](_0x490c21[_0xfdfe('0x35')],_0x4676f3['filters']));if(_0x490c21[_0xfdfe('0x35')]['filter']){_0x2d2d5b[_0xfdfe('0x3d')]=_[_0xfdfe('0x41')](_0x2d2d5b[_0xfdfe('0x3d')],{'$or':_[_0xfdfe('0x2f')](_0x2d2d5b[_0xfdfe('0x38')],function(_0xc2cb4f){var _0x312cef={};_0x312cef[_0xc2cb4f]={'$like':'%'+_0x490c21[_0xfdfe('0x35')][_0xfdfe('0x40')]+'%'};return _0x312cef;})});}_0x2d2d5b=_[_0xfdfe('0x41')]({},_0x2d2d5b,_0x490c21[_0xfdfe('0x43')]);return _0x4aa3d6[_0xfdfe('0x52')](_0x2d2d5b);}})[_0xfdfe('0x2a')](function(_0x4b589f){if(_0x4b589f){_0x4fe36a=_0x4b589f[_0xfdfe('0x3a')];if(!_0x490c21[_0xfdfe('0x35')][_0xfdfe('0x51')](_0xfdfe('0x3b'))){_0x2d2d5b[_0xfdfe('0x21')]=qs['limit'](_0x490c21[_0xfdfe('0x35')]['limit']);_0x2d2d5b[_0xfdfe('0x1f')]=qs[_0xfdfe('0x1f')](_0x490c21['query'][_0xfdfe('0x1f')]);}return _0x4aa3d6[_0xfdfe('0x52')](_0x2d2d5b);}})[_0xfdfe('0x2a')](function(_0x43840c){if(_0x43840c){return _0x43840c?{'count':_0x4fe36a,'rows':_0x43840c}:null;}})[_0xfdfe('0x2a')](respondWithResult(_0x55d658,null))[_0xfdfe('0x46')](handleError(_0x55d658,null));};exports[_0xfdfe('0x53')]=function(_0x17023c,_0x13d6be,_0x4168a2){var _0xd5b765={};var _0x14c3b8={};var _0x414614;var _0x2fee95;return db[_0xfdfe('0x30')][_0xfdfe('0x4e')]({'where':{'id':_0x17023c[_0xfdfe('0x48')]['id']}})[_0xfdfe('0x2a')](handleEntityNotFound(_0x13d6be,null))[_0xfdfe('0x2a')](function(_0x2fa913){if(_0x2fa913){_0x414614=_0x2fa913;_0x14c3b8[_0xfdfe('0x34')]=_['keys'](db[_0xfdfe('0x4f')][_0xfdfe('0x31')]);_0x14c3b8[_0xfdfe('0x35')]=_[_0xfdfe('0x36')](_0x17023c['query']);_0x14c3b8['filters']=_['intersection'](_0x14c3b8[_0xfdfe('0x34')],_0x14c3b8[_0xfdfe('0x35')]);_0xd5b765[_0xfdfe('0x38')]=_[_0xfdfe('0x37')](_0x14c3b8[_0xfdfe('0x34')],qs[_0xfdfe('0x39')](_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x39')]));_0xd5b765[_0xfdfe('0x38')]=_0xd5b765[_0xfdfe('0x38')][_0xfdfe('0x3a')]?_0xd5b765[_0xfdfe('0x38')]:_0x14c3b8[_0xfdfe('0x34')];_0xd5b765[_0xfdfe('0x3c')]=qs[_0xfdfe('0x50')](_0x17023c['query'][_0xfdfe('0x50')]);_0xd5b765['where']=qs[_0xfdfe('0x3f')](_['pick'](_0x17023c['query'],_0x14c3b8[_0xfdfe('0x3f')]));if(_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x40')]){_0xd5b765['where']=_[_0xfdfe('0x41')](_0xd5b765[_0xfdfe('0x3d')],{'$or':_[_0xfdfe('0x2f')](_0xd5b765['attributes'],function(_0x599a1b){var _0xe32e8e={};_0xe32e8e[_0x599a1b]={'$like':'%'+_0x17023c['query'][_0xfdfe('0x40')]+'%'};return _0xe32e8e;})});}_0xd5b765=_[_0xfdfe('0x41')]({},_0xd5b765,_0x17023c[_0xfdfe('0x43')]);return _0x414614[_0xfdfe('0x53')](_0xd5b765);}})[_0xfdfe('0x2a')](function(_0x27f605){if(_0x27f605){_0x2fee95=_0x27f605[_0xfdfe('0x3a')];if(!_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x51')](_0xfdfe('0x3b'))){_0xd5b765[_0xfdfe('0x21')]=qs['limit'](_0x17023c[_0xfdfe('0x35')][_0xfdfe('0x21')]);_0xd5b765[_0xfdfe('0x1f')]=qs[_0xfdfe('0x1f')](_0x17023c[_0xfdfe('0x35')]['offset']);}return _0x414614[_0xfdfe('0x53')](_0xd5b765);}})[_0xfdfe('0x2a')](function(_0x2cbfa7){if(_0x2cbfa7){return _0x2cbfa7?{'count':_0x2fee95,'rows':_0x2cbfa7}:null;}})[_0xfdfe('0x2a')](respondWithResult(_0x13d6be,null))[_0xfdfe('0x46')](handleError(_0x13d6be,null));};
\ No newline at end of file
index 1487ecf..00f1149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ec=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x61ec,0x193));var _0xc61e=function(_0x5848b0,_0x4883e8){_0x5848b0=_0x5848b0-0x0;var _0x3840e7=_0x61ec[_0x5848b0];return _0x3840e7;};'use strict';var _=require(_0xc61e('0x0'));var util=require(_0xc61e('0x1'));var logger=require(_0xc61e('0x2'))(_0xc61e('0x3'));var moment=require(_0xc61e('0x4'));var BPromise=require(_0xc61e('0x5'));var rp=require(_0xc61e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc61e('0x7'));var config=require(_0xc61e('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xc61e('0x9')]=function(_0x2b791c,_0x4f8a77){return _0x2b791c[_0xc61e('0xa')](_0xc61e('0xb'),attributes,{'tableName':_0xc61e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde9a=['api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger'];(function(_0x12ea53,_0x40fae5){var _0x5b79cf=function(_0x1fe1c6){while(--_0x1fe1c6){_0x12ea53['push'](_0x12ea53['shift']());}};_0x5b79cf(++_0x40fae5);}(_0xde9a,0x72));var _0xade9=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xde9a[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xade9('0x0'));var util=require(_0xade9('0x1'));var logger=require(_0xade9('0x2'))(_0xade9('0x3'));var moment=require(_0xade9('0x4'));var BPromise=require(_0xade9('0x5'));var rp=require(_0xade9('0x6'));var fs=require('fs');var path=require(_0xade9('0x7'));var rimraf=require(_0xade9('0x8'));var config=require('../../config/environment');var attributes=require(_0xade9('0x9'));module['exports']=function(_0x19ad89,_0x20f226){return _0x19ad89[_0xade9('0xa')](_0xade9('0xb'),attributes,{'tableName':_0xade9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8439c8d..fe2141c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa38f=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash'];(function(_0x275caa,_0x166d5e){var _0x28d670=function(_0x2a20e1){while(--_0x2a20e1){_0x275caa['push'](_0x275caa['shift']());}};_0x28d670(++_0x166d5e);}(_0xa38f,0x8b));var _0xfa38=function(_0x2a523b,_0x218e6c){_0x2a523b=_0x2a523b-0x0;var _0x3f70ab=_0xa38f[_0x2a523b];return _0x3f70ab;};'use strict';var _=require(_0xfa38('0x0'));var util=require(_0xfa38('0x1'));var moment=require('moment');var BPromise=require(_0xfa38('0x2'));var rs=require(_0xfa38('0x3'));var fs=require('fs');var Redis=require(_0xfa38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa38('0x5'));var logger=require(_0xfa38('0x6'))('rpc');var config=require(_0xfa38('0x7'));var jayson=require(_0xfa38('0x8'));var client=jayson['client'][_0xfa38('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d68fa,_0x28202d,_0x4c659b){return new BPromise(function(_0x5df4f4,_0x1d80af){return client['request'](_0x1d68fa,_0x4c659b)[_0xfa38('0xa')](function(_0x40cb01){logger[_0xfa38('0xb')](_0xfa38('0xc'),_0x28202d,_0xfa38('0xd'));logger[_0xfa38('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x28202d,_0xfa38('0xd'),JSON[_0xfa38('0xf')](_0x40cb01));if(_0x40cb01[_0xfa38('0x10')]){if(_0x40cb01[_0xfa38('0x10')][_0xfa38('0x11')]===0x1f4){logger[_0xfa38('0x10')](_0xfa38('0xc'),_0x28202d,_0x40cb01[_0xfa38('0x10')][_0xfa38('0x12')]);return _0x1d80af(_0x40cb01[_0xfa38('0x10')][_0xfa38('0x12')]);}logger[_0xfa38('0x10')](_0xfa38('0xc'),_0x28202d,_0x40cb01[_0xfa38('0x10')]['message']);return _0x5df4f4(_0x40cb01[_0xfa38('0x10')]['message']);}else{logger[_0xfa38('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x28202d,_0xfa38('0xd'));_0x5df4f4(_0x40cb01['result'][_0xfa38('0x12')]);}})[_0xfa38('0x13')](function(_0x5188a1){logger['error'](_0xfa38('0xc'),_0x28202d,_0x5188a1);_0x1d80af(_0x5188a1);});});}
\ No newline at end of file
+var _0x661c=['SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x661c,0x16d));var _0xc661=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x661c[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0xc661('0x0'));var util=require('util');var moment=require(_0xc661('0x1'));var BPromise=require(_0xc661('0x2'));var rs=require(_0xc661('0x3'));var fs=require('fs');var Redis=require(_0xc661('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc661('0x5'));var logger=require(_0xc661('0x6'))(_0xc661('0x7'));var config=require(_0xc661('0x8'));var jayson=require(_0xc661('0x9'));var client=jayson[_0xc661('0xa')][_0xc661('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x520620,_0x59a807,_0xc4cba0){return new BPromise(function(_0xebd7,_0x1ef21b){return client['request'](_0x520620,_0xc4cba0)[_0xc661('0xc')](function(_0x483a4b){logger['info'](_0xc661('0xd'),_0x59a807,'request\x20sent');logger[_0xc661('0xe')](_0xc661('0xf'),_0x59a807,_0xc661('0x10'),JSON[_0xc661('0x11')](_0x483a4b));if(_0x483a4b['error']){if(_0x483a4b[_0xc661('0x12')]['code']===0x1f4){logger[_0xc661('0x12')](_0xc661('0xd'),_0x59a807,_0x483a4b['error'][_0xc661('0x13')]);return _0x1ef21b(_0x483a4b[_0xc661('0x12')][_0xc661('0x13')]);}logger[_0xc661('0x12')](_0xc661('0xd'),_0x59a807,_0x483a4b['error'][_0xc661('0x13')]);return _0xebd7(_0x483a4b[_0xc661('0x12')][_0xc661('0x13')]);}else{logger['info'](_0xc661('0xd'),_0x59a807,'request\x20sent');_0xebd7(_0x483a4b['result'][_0xc661('0x13')]);}})[_0xc661('0x14')](function(_0x349fbd){logger['error'](_0xc661('0xd'),_0x59a807,_0x349fbd);_0x1ef21b(_0x349fbd);});});}
\ No newline at end of file
index af51836..af9cfa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd688=['index','get','/:id','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller'];(function(_0x53f74c,_0xd71010){var _0x467bc0=function(_0x58ab34){while(--_0x58ab34){_0x53f74c['push'](_0x53f74c['shift']());}};_0x467bc0(++_0xd71010);}(_0xd688,0xf1));var _0x8d68=function(_0x10f691,_0x125add){_0x10f691=_0x10f691-0x0;var _0x398fdc=_0xd688[_0x10f691];return _0x398fdc;};'use strict';var multer=require(_0x8d68('0x0'));var util=require(_0x8d68('0x1'));var path=require(_0x8d68('0x2'));var timeout=require(_0x8d68('0x3'));var express=require(_0x8d68('0x4'));var router=express[_0x8d68('0x5')]();var fs_extra=require(_0x8d68('0x6'));var auth=require(_0x8d68('0x7'));var interaction=require(_0x8d68('0x8'));var config=require(_0x8d68('0x9'));var controller=require(_0x8d68('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x8d68('0xb')]);router[_0x8d68('0xc')](_0x8d68('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x8d68('0xe')]('/',auth[_0x8d68('0xf')](),controller[_0x8d68('0x10')]);router['put'](_0x8d68('0xd'),auth['isAuthenticated'](),controller[_0x8d68('0x11')]);router[_0x8d68('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8d68('0x13')]);module[_0x8d68('0x14')]=router;
\ No newline at end of file
+var _0x3930=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','get','/:id','show','post'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3930,0x180));var _0x0393=function(_0x508dc5,_0x1aa23c){_0x508dc5=_0x508dc5-0x0;var _0x403554=_0x3930[_0x508dc5];return _0x403554;};'use strict';var multer=require(_0x0393('0x0'));var util=require(_0x0393('0x1'));var path=require(_0x0393('0x2'));var timeout=require(_0x0393('0x3'));var express=require(_0x0393('0x4'));var router=express[_0x0393('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0393('0x6'));var interaction=require(_0x0393('0x7'));var config=require(_0x0393('0x8'));var controller=require(_0x0393('0x9'));router['get']('/',auth[_0x0393('0xa')](),controller['index']);router[_0x0393('0xb')](_0x0393('0xc'),auth[_0x0393('0xa')](),controller[_0x0393('0xd')]);router[_0x0393('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0393('0xf')](_0x0393('0xc'),auth[_0x0393('0xa')](),controller[_0x0393('0x10')]);router[_0x0393('0x11')]('/:id',auth[_0x0393('0xa')](),controller[_0x0393('0x12')]);module['exports']=router;
\ No newline at end of file
index 68d5b44..9bc494d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4271=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x51a38e,_0x13fa4f){var _0x49308d=function(_0x15d4a0){while(--_0x15d4a0){_0x51a38e['push'](_0x51a38e['shift']());}};_0x49308d(++_0x13fa4f);}(_0x4271,0x1c1));var _0x1427=function(_0x2ecc09,_0x39f700){_0x2ecc09=_0x2ecc09-0x0;var _0x384ff7=_0x4271[_0x2ecc09];return _0x384ff7;};'use strict';var Sequelize=require(_0x1427('0x0'));module['exports']={'type':{'type':Sequelize[_0x1427('0x1')](_0x1427('0x2'),_0x1427('0x3'),'customVariable',_0x1427('0x4'),_0x1427('0x5')),'defaultValue':_0x1427('0x2')},'content':{'type':Sequelize[_0x1427('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1427('0x1')]('string',_0x1427('0x3'),_0x1427('0x7'))},'keyContent':{'type':Sequelize[_0x1427('0x6')]},'idField':{'type':Sequelize[_0x1427('0x6')]},'nameField':{'type':Sequelize[_0x1427('0x6')]},'customField':{'type':Sequelize[_0x1427('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1427('0x6')]}};
\ No newline at end of file
+var _0x2582=['variable','STRING','BOOLEAN','sequelize','ENUM','string','picklist'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2582,0x1d1));var _0x2258=function(_0x13453e,_0x409732){_0x13453e=_0x13453e-0x0;var _0x19d7ce=_0x2582[_0x13453e];return _0x19d7ce;};'use strict';var Sequelize=require(_0x2258('0x0'));module['exports']={'type':{'type':Sequelize[_0x2258('0x1')](_0x2258('0x2'),'variable','customVariable','keyValue',_0x2258('0x3')),'defaultValue':_0x2258('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2258('0x1')]('string',_0x2258('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2258('0x5')]},'nameField':{'type':Sequelize[_0x2258('0x5')]},'customField':{'type':Sequelize[_0x2258('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2258('0x5')]}};
\ No newline at end of file
index cb583b0..1b28220 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5b=['body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','map','SugarcrmField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','length','include','find','create'];(function(_0x57767f,_0x1cf845){var _0x474012=function(_0x592bd5){while(--_0x592bd5){_0x57767f['push'](_0x57767f['shift']());}};_0x474012(++_0x1cf845);}(_0xeb5b,0xeb));var _0xbeb5=function(_0x180e76,_0x6b0954){_0x180e76=_0x180e76-0x0;var _0x4465a6=_0xeb5b[_0x180e76];return _0x4465a6;};'use strict';var emlformat=require(_0xbeb5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbeb5('0x1'));var jsonpatch=require(_0xbeb5('0x2'));var rp=require('request-promise');var moment=require(_0xbeb5('0x3'));var BPromise=require(_0xbeb5('0x4'));var Mustache=require(_0xbeb5('0x5'));var util=require(_0xbeb5('0x6'));var path=require(_0xbeb5('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbeb5('0x8'));var fs=require('fs');var fs_extra=require(_0xbeb5('0x9'));var _=require(_0xbeb5('0xa'));var squel=require(_0xbeb5('0xb'));var crypto=require(_0xbeb5('0xc'));var jsforce=require(_0xbeb5('0xd'));var deskjs=require(_0xbeb5('0xe'));var toCsv=require(_0xbeb5('0xf'));var querystring=require(_0xbeb5('0x10'));var Papa=require(_0xbeb5('0x11'));var Redis=require(_0xbeb5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbeb5('0x13'));var as=require(_0xbeb5('0x14'));var hardwareService=require(_0xbeb5('0x15'));var logger=require(_0xbeb5('0x16'))(_0xbeb5('0x17'));var utils=require(_0xbeb5('0x18'));var config=require(_0xbeb5('0x19'));var licenseUtil=require(_0xbeb5('0x1a'));var db=require(_0xbeb5('0x1b'))['db'];function respondWithStatusCode(_0x2ccb83,_0x558500){_0x558500=_0x558500||0xcc;return function(_0x6b14b6){if(_0x6b14b6){return _0x2ccb83[_0xbeb5('0x1c')](_0x558500);}return _0x2ccb83[_0xbeb5('0x1d')](_0x558500)[_0xbeb5('0x1e')]();};}function respondWithResult(_0x16fc94,_0x34922d){_0x34922d=_0x34922d||0xc8;return function(_0x2dc58d){if(_0x2dc58d){return _0x16fc94['status'](_0x34922d)[_0xbeb5('0x1f')](_0x2dc58d);}};}function respondWithFilteredResult(_0x41be30,_0x1e6174){return function(_0x5ec694){if(_0x5ec694){var _0x52f2c8=typeof _0x1e6174[_0xbeb5('0x20')]===_0xbeb5('0x21')&&typeof _0x1e6174[_0xbeb5('0x22')]==='undefined';var _0xb51707=_0x5ec694[_0xbeb5('0x23')];var _0x311de4=_0x52f2c8?0x0:_0x1e6174[_0xbeb5('0x20')];var _0x4b303d=_0x52f2c8?_0x5ec694[_0xbeb5('0x23')]:_0x1e6174[_0xbeb5('0x20')]+_0x1e6174[_0xbeb5('0x22')];var _0x4b417a;if(_0x4b303d>=_0xb51707){_0x4b303d=_0xb51707;_0x4b417a=0xc8;}else{_0x4b417a=0xce;}_0x41be30[_0xbeb5('0x1d')](_0x4b417a);return _0x41be30[_0xbeb5('0x24')]('Content-Range',_0x311de4+'-'+_0x4b303d+'/'+_0xb51707)['json'](_0x5ec694);}return null;};}function patchUpdates(_0x3f274e){return function(_0x349cc8){try{jsonpatch[_0xbeb5('0x25')](_0x349cc8,_0x3f274e,!![]);}catch(_0x127816){return BPromise[_0xbeb5('0x26')](_0x127816);}return _0x349cc8['save']();};}function saveUpdates(_0x1f3bec,_0xd3387b){return function(_0x454fdf){if(_0x454fdf){return _0x454fdf[_0xbeb5('0x27')](_0x1f3bec)[_0xbeb5('0x28')](function(_0x533254){return _0x533254;});}return null;};}function removeEntity(_0x5f47ed,_0xc53995){return function(_0x19c0ee){if(_0x19c0ee){return _0x19c0ee[_0xbeb5('0x29')]()[_0xbeb5('0x28')](function(){_0x5f47ed[_0xbeb5('0x1d')](0xcc)[_0xbeb5('0x1e')]();});}};}function handleEntityNotFound(_0x4faf35,_0x4ebbf2){return function(_0x4e98fd){if(!_0x4e98fd){_0x4faf35[_0xbeb5('0x1c')](0x194);}return _0x4e98fd;};}function handleError(_0x138abd,_0x559e1d){_0x559e1d=_0x559e1d||0x1f4;return function(_0x15e81d){logger[_0xbeb5('0x2a')](_0x15e81d[_0xbeb5('0x2b')]);if(_0x15e81d['name']){delete _0x15e81d[_0xbeb5('0x2c')];}_0x138abd[_0xbeb5('0x1d')](_0x559e1d)['send'](_0x15e81d);};}exports['index']=function(_0x54f7b1,_0x614f6b){var _0x37659a={},_0x2a1bb7={},_0x286804={'count':0x0,'rows':[]};var _0xf5de1f=_[_0xbeb5('0x2d')](db[_0xbeb5('0x2e')][_0xbeb5('0x2f')],function(_0x3bee89){return{'name':_0x3bee89[_0xbeb5('0x30')],'type':_0x3bee89[_0xbeb5('0x31')][_0xbeb5('0x32')]};});_0x2a1bb7[_0xbeb5('0x33')]=_[_0xbeb5('0x2d')](_0xf5de1f,_0xbeb5('0x2c'));_0x2a1bb7[_0xbeb5('0x34')]=_[_0xbeb5('0x35')](_0x54f7b1[_0xbeb5('0x34')]);_0x2a1bb7[_0xbeb5('0x36')]=_[_0xbeb5('0x37')](_0x2a1bb7[_0xbeb5('0x33')],_0x2a1bb7[_0xbeb5('0x34')]);_0x37659a[_0xbeb5('0x38')]=_[_0xbeb5('0x37')](_0x2a1bb7[_0xbeb5('0x33')],qs[_0xbeb5('0x39')](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x39')]));_0x37659a[_0xbeb5('0x38')]=_0x37659a[_0xbeb5('0x38')]['length']?_0x37659a['attributes']:_0x2a1bb7[_0xbeb5('0x33')];if(!_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x3a')](_0xbeb5('0x3b'))){_0x37659a[_0xbeb5('0x22')]=qs[_0xbeb5('0x22')](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x22')]);_0x37659a['offset']=qs['offset'](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x20')]);}_0x37659a[_0xbeb5('0x3c')]=qs[_0xbeb5('0x3d')](_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x3d')]);_0x37659a[_0xbeb5('0x3e')]=qs[_0xbeb5('0x36')](_[_0xbeb5('0x3f')](_0x54f7b1[_0xbeb5('0x34')],_0x2a1bb7['filters']),_0xf5de1f);if(_0x54f7b1['query'][_0xbeb5('0x40')]){_0x37659a['where']=_['merge'](_0x37659a['where'],{'$or':_[_0xbeb5('0x2d')](_0xf5de1f,function(_0x5d12bc){if(_0x5d12bc[_0xbeb5('0x31')]!==_0xbeb5('0x41')){var _0xc2be2c={};_0xc2be2c[_0x5d12bc[_0xbeb5('0x2c')]]={'$like':'%'+_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x40')]+'%'};return _0xc2be2c;}})});}_0x37659a=_[_0xbeb5('0x42')]({},_0x37659a,_0x54f7b1[_0xbeb5('0x43')]);var _0x5de262={'where':_0x37659a['where']};return db[_0xbeb5('0x2e')]['count'](_0x5de262)[_0xbeb5('0x28')](function(_0x224a4b){_0x286804[_0xbeb5('0x23')]=_0x224a4b;if(_0x54f7b1[_0xbeb5('0x34')][_0xbeb5('0x44')]){_0x37659a['include']=[{'all':!![]}];}return db[_0xbeb5('0x2e')]['findAll'](_0x37659a);})[_0xbeb5('0x28')](function(_0x49862b){_0x286804[_0xbeb5('0x45')]=_0x49862b;return _0x286804;})['then'](respondWithFilteredResult(_0x614f6b,_0x37659a))[_0xbeb5('0x46')](handleError(_0x614f6b,null));};exports[_0xbeb5('0x47')]=function(_0x1ddbcb,_0x496b12){var _0x521a5f={'raw':!![],'where':{'id':_0x1ddbcb[_0xbeb5('0x48')]['id']}},_0x18253b={};_0x18253b[_0xbeb5('0x33')]=_[_0xbeb5('0x35')](db[_0xbeb5('0x2e')]['rawAttributes']);_0x18253b[_0xbeb5('0x34')]=_[_0xbeb5('0x35')](_0x1ddbcb[_0xbeb5('0x34')]);_0x18253b['filters']=_['intersection'](_0x18253b[_0xbeb5('0x33')],_0x18253b['query']);_0x521a5f[_0xbeb5('0x38')]=_[_0xbeb5('0x37')](_0x18253b['model'],qs['fields'](_0x1ddbcb[_0xbeb5('0x34')]['fields']));_0x521a5f['attributes']=_0x521a5f[_0xbeb5('0x38')][_0xbeb5('0x49')]?_0x521a5f[_0xbeb5('0x38')]:_0x18253b[_0xbeb5('0x33')];if(_0x1ddbcb[_0xbeb5('0x34')][_0xbeb5('0x44')]){_0x521a5f[_0xbeb5('0x4a')]=[{'all':!![]}];}_0x521a5f=_[_0xbeb5('0x42')]({},_0x521a5f,_0x1ddbcb['options']);return db[_0xbeb5('0x2e')][_0xbeb5('0x4b')](_0x521a5f)[_0xbeb5('0x28')](handleEntityNotFound(_0x496b12,null))[_0xbeb5('0x28')](respondWithResult(_0x496b12,null))['catch'](handleError(_0x496b12,null));};exports[_0xbeb5('0x4c')]=function(_0x97aea9,_0x300e16){return db[_0xbeb5('0x2e')][_0xbeb5('0x4c')](_0x97aea9[_0xbeb5('0x4d')],{})[_0xbeb5('0x28')](respondWithResult(_0x300e16,0xc9))[_0xbeb5('0x46')](handleError(_0x300e16,null));};exports[_0xbeb5('0x27')]=function(_0x58e38f,_0x49b92c){if(_0x58e38f[_0xbeb5('0x4d')]['id']){delete _0x58e38f[_0xbeb5('0x4d')]['id'];}return db[_0xbeb5('0x2e')][_0xbeb5('0x4b')]({'where':{'id':_0x58e38f[_0xbeb5('0x48')]['id']}})[_0xbeb5('0x28')](handleEntityNotFound(_0x49b92c,null))['then'](saveUpdates(_0x58e38f['body'],null))['then'](respondWithResult(_0x49b92c,null))[_0xbeb5('0x46')](handleError(_0x49b92c,null));};exports[_0xbeb5('0x29')]=function(_0x1c0b11,_0x383c23){return db[_0xbeb5('0x2e')][_0xbeb5('0x4b')]({'where':{'id':_0x1c0b11[_0xbeb5('0x48')]['id']}})[_0xbeb5('0x28')](handleEntityNotFound(_0x383c23,null))['then'](removeEntity(_0x383c23,null))[_0xbeb5('0x46')](handleError(_0x383c23,null));};
\ No newline at end of file
+var _0xe449=['ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','map','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','params','find','catch','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x483e77,_0x433e9b){var _0x359df0=function(_0x3c3d57){while(--_0x3c3d57){_0x483e77['push'](_0x483e77['shift']());}};_0x359df0(++_0x433e9b);}(_0xe449,0x11b));var _0x9e44=function(_0x18ae8a,_0x247fb8){_0x18ae8a=_0x18ae8a-0x0;var _0x43886e=_0xe449[_0x18ae8a];return _0x43886e;};'use strict';var emlformat=require(_0x9e44('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9e44('0x1'));var rp=require(_0x9e44('0x2'));var moment=require(_0x9e44('0x3'));var BPromise=require(_0x9e44('0x4'));var Mustache=require(_0x9e44('0x5'));var util=require(_0x9e44('0x6'));var path=require(_0x9e44('0x7'));var sox=require('sox');var csv=require(_0x9e44('0x8'));var ejs=require(_0x9e44('0x9'));var fs=require('fs');var fs_extra=require(_0x9e44('0xa'));var _=require('lodash');var squel=require(_0x9e44('0xb'));var crypto=require(_0x9e44('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9e44('0xd'));var toCsv=require(_0x9e44('0x8'));var querystring=require(_0x9e44('0xe'));var Papa=require(_0x9e44('0xf'));var Redis=require(_0x9e44('0x10'));var authService=require(_0x9e44('0x11'));var qs=require(_0x9e44('0x12'));var as=require(_0x9e44('0x13'));var hardwareService=require(_0x9e44('0x14'));var logger=require('../../config/logger')(_0x9e44('0x15'));var utils=require(_0x9e44('0x16'));var config=require(_0x9e44('0x17'));var licenseUtil=require(_0x9e44('0x18'));var db=require(_0x9e44('0x19'))['db'];function respondWithStatusCode(_0x46be93,_0x402b59){_0x402b59=_0x402b59||0xcc;return function(_0x2550dc){if(_0x2550dc){return _0x46be93['sendStatus'](_0x402b59);}return _0x46be93[_0x9e44('0x1a')](_0x402b59)[_0x9e44('0x1b')]();};}function respondWithResult(_0xd4487,_0x2b497e){_0x2b497e=_0x2b497e||0xc8;return function(_0x13aea9){if(_0x13aea9){return _0xd4487[_0x9e44('0x1a')](_0x2b497e)[_0x9e44('0x1c')](_0x13aea9);}};}function respondWithFilteredResult(_0x10b85e,_0x4fb55a){return function(_0x35c086){if(_0x35c086){var _0x27ab6c=typeof _0x4fb55a[_0x9e44('0x1d')]===_0x9e44('0x1e')&&typeof _0x4fb55a[_0x9e44('0x1f')]===_0x9e44('0x1e');var _0x43f570=_0x35c086[_0x9e44('0x20')];var _0x1fc1e6=_0x27ab6c?0x0:_0x4fb55a[_0x9e44('0x1d')];var _0x14c8eb=_0x27ab6c?_0x35c086[_0x9e44('0x20')]:_0x4fb55a['offset']+_0x4fb55a[_0x9e44('0x1f')];var _0x14f358;if(_0x14c8eb>=_0x43f570){_0x14c8eb=_0x43f570;_0x14f358=0xc8;}else{_0x14f358=0xce;}_0x10b85e[_0x9e44('0x1a')](_0x14f358);return _0x10b85e[_0x9e44('0x21')](_0x9e44('0x22'),_0x1fc1e6+'-'+_0x14c8eb+'/'+_0x43f570)[_0x9e44('0x1c')](_0x35c086);}return null;};}function patchUpdates(_0x2f3ce2){return function(_0x3677d9){try{jsonpatch[_0x9e44('0x23')](_0x3677d9,_0x2f3ce2,!![]);}catch(_0x550b74){return BPromise['reject'](_0x550b74);}return _0x3677d9[_0x9e44('0x24')]();};}function saveUpdates(_0x4d7d84,_0x2e0e98){return function(_0x35cbca){if(_0x35cbca){return _0x35cbca[_0x9e44('0x25')](_0x4d7d84)[_0x9e44('0x26')](function(_0x117576){return _0x117576;});}return null;};}function removeEntity(_0x20fcbd,_0x414b1d){return function(_0x132160){if(_0x132160){return _0x132160['destroy']()[_0x9e44('0x26')](function(){_0x20fcbd[_0x9e44('0x1a')](0xcc)[_0x9e44('0x1b')]();});}};}function handleEntityNotFound(_0x37a99d,_0x5f54e3){return function(_0x8149ed){if(!_0x8149ed){_0x37a99d['sendStatus'](0x194);}return _0x8149ed;};}function handleError(_0xce8b3,_0x3c98f1){_0x3c98f1=_0x3c98f1||0x1f4;return function(_0x2109aa){logger['error'](_0x2109aa['stack']);if(_0x2109aa[_0x9e44('0x27')]){delete _0x2109aa[_0x9e44('0x27')];}_0xce8b3[_0x9e44('0x1a')](_0x3c98f1)[_0x9e44('0x28')](_0x2109aa);};}exports[_0x9e44('0x29')]=function(_0x3c4071,_0x295c06){var _0x385926={},_0x4e3ef2={},_0x2785f2={'count':0x0,'rows':[]};var _0x5152b9=_['map'](db[_0x9e44('0x2a')][_0x9e44('0x2b')],function(_0x3f5f63){return{'name':_0x3f5f63[_0x9e44('0x2c')],'type':_0x3f5f63[_0x9e44('0x2d')][_0x9e44('0x2e')]};});_0x4e3ef2['model']=_[_0x9e44('0x2f')](_0x5152b9,_0x9e44('0x27'));_0x4e3ef2['query']=_[_0x9e44('0x30')](_0x3c4071[_0x9e44('0x31')]);_0x4e3ef2['filters']=_[_0x9e44('0x32')](_0x4e3ef2[_0x9e44('0x33')],_0x4e3ef2[_0x9e44('0x31')]);_0x385926['attributes']=_[_0x9e44('0x32')](_0x4e3ef2[_0x9e44('0x33')],qs[_0x9e44('0x34')](_0x3c4071[_0x9e44('0x31')][_0x9e44('0x34')]));_0x385926['attributes']=_0x385926[_0x9e44('0x35')][_0x9e44('0x36')]?_0x385926[_0x9e44('0x35')]:_0x4e3ef2[_0x9e44('0x33')];if(!_0x3c4071['query'][_0x9e44('0x37')](_0x9e44('0x38'))){_0x385926['limit']=qs[_0x9e44('0x1f')](_0x3c4071[_0x9e44('0x31')][_0x9e44('0x1f')]);_0x385926['offset']=qs['offset'](_0x3c4071['query'][_0x9e44('0x1d')]);}_0x385926['order']=qs[_0x9e44('0x39')](_0x3c4071[_0x9e44('0x31')][_0x9e44('0x39')]);_0x385926['where']=qs[_0x9e44('0x3a')](_[_0x9e44('0x3b')](_0x3c4071[_0x9e44('0x31')],_0x4e3ef2['filters']),_0x5152b9);if(_0x3c4071[_0x9e44('0x31')]['filter']){_0x385926[_0x9e44('0x3c')]=_[_0x9e44('0x3d')](_0x385926[_0x9e44('0x3c')],{'$or':_['map'](_0x5152b9,function(_0x10fdc3){if(_0x10fdc3[_0x9e44('0x2d')]!==_0x9e44('0x3e')){var _0xbf4a3e={};_0xbf4a3e[_0x10fdc3[_0x9e44('0x27')]]={'$like':'%'+_0x3c4071[_0x9e44('0x31')][_0x9e44('0x3f')]+'%'};return _0xbf4a3e;}})});}_0x385926=_[_0x9e44('0x3d')]({},_0x385926,_0x3c4071[_0x9e44('0x40')]);var _0x35fa8a={'where':_0x385926[_0x9e44('0x3c')]};return db[_0x9e44('0x2a')]['count'](_0x35fa8a)[_0x9e44('0x26')](function(_0x13658c){_0x2785f2[_0x9e44('0x20')]=_0x13658c;if(_0x3c4071[_0x9e44('0x31')][_0x9e44('0x41')]){_0x385926[_0x9e44('0x42')]=[{'all':!![]}];}return db[_0x9e44('0x2a')][_0x9e44('0x43')](_0x385926);})[_0x9e44('0x26')](function(_0x5430d3){_0x2785f2['rows']=_0x5430d3;return _0x2785f2;})[_0x9e44('0x26')](respondWithFilteredResult(_0x295c06,_0x385926))['catch'](handleError(_0x295c06,null));};exports['show']=function(_0x46a5ef,_0x12ceca){var _0xecf3f7={'raw':!![],'where':{'id':_0x46a5ef[_0x9e44('0x44')]['id']}},_0x1639b8={};_0x1639b8[_0x9e44('0x33')]=_[_0x9e44('0x30')](db[_0x9e44('0x2a')][_0x9e44('0x2b')]);_0x1639b8[_0x9e44('0x31')]=_[_0x9e44('0x30')](_0x46a5ef[_0x9e44('0x31')]);_0x1639b8[_0x9e44('0x3a')]=_['intersection'](_0x1639b8[_0x9e44('0x33')],_0x1639b8[_0x9e44('0x31')]);_0xecf3f7['attributes']=_[_0x9e44('0x32')](_0x1639b8[_0x9e44('0x33')],qs[_0x9e44('0x34')](_0x46a5ef['query'][_0x9e44('0x34')]));_0xecf3f7['attributes']=_0xecf3f7[_0x9e44('0x35')]['length']?_0xecf3f7['attributes']:_0x1639b8['model'];if(_0x46a5ef[_0x9e44('0x31')][_0x9e44('0x41')]){_0xecf3f7[_0x9e44('0x42')]=[{'all':!![]}];}_0xecf3f7=_[_0x9e44('0x3d')]({},_0xecf3f7,_0x46a5ef[_0x9e44('0x40')]);return db[_0x9e44('0x2a')][_0x9e44('0x45')](_0xecf3f7)[_0x9e44('0x26')](handleEntityNotFound(_0x12ceca,null))['then'](respondWithResult(_0x12ceca,null))[_0x9e44('0x46')](handleError(_0x12ceca,null));};exports[_0x9e44('0x47')]=function(_0x7b6f18,_0x396736){return db[_0x9e44('0x2a')][_0x9e44('0x47')](_0x7b6f18['body'],{})[_0x9e44('0x26')](respondWithResult(_0x396736,0xc9))['catch'](handleError(_0x396736,null));};exports[_0x9e44('0x25')]=function(_0x313e95,_0x2f491f){if(_0x313e95[_0x9e44('0x48')]['id']){delete _0x313e95[_0x9e44('0x48')]['id'];}return db[_0x9e44('0x2a')]['find']({'where':{'id':_0x313e95[_0x9e44('0x44')]['id']}})[_0x9e44('0x26')](handleEntityNotFound(_0x2f491f,null))[_0x9e44('0x26')](saveUpdates(_0x313e95[_0x9e44('0x48')],null))[_0x9e44('0x26')](respondWithResult(_0x2f491f,null))['catch'](handleError(_0x2f491f,null));};exports['destroy']=function(_0x361800,_0x599f1b){return db[_0x9e44('0x2a')]['find']({'where':{'id':_0x361800['params']['id']}})[_0x9e44('0x26')](handleEntityNotFound(_0x599f1b,null))['then'](removeEntity(_0x599f1b,null))['catch'](handleError(_0x599f1b,null));};
\ No newline at end of file
index 04d8d82..55b644d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc378=['idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x19c71e,_0x513c5b){var _0xf7df9b=function(_0x367349){while(--_0x367349){_0x19c71e['push'](_0x19c71e['shift']());}};_0xf7df9b(++_0x513c5b);}(_0xc378,0x166));var _0x8c37=function(_0x183256,_0x1a596d){_0x183256=_0x183256-0x0;var _0x5394a2=_0xc378[_0x183256];return _0x5394a2;};'use strict';var _=require(_0x8c37('0x0'));var util=require(_0x8c37('0x1'));var logger=require(_0x8c37('0x2'))(_0x8c37('0x3'));var moment=require(_0x8c37('0x4'));var BPromise=require(_0x8c37('0x5'));var rp=require(_0x8c37('0x6'));var fs=require('fs');var path=require(_0x8c37('0x7'));var rimraf=require(_0x8c37('0x8'));var config=require(_0x8c37('0x9'));var attributes=require(_0x8c37('0xa'));module[_0x8c37('0xb')]=function(_0x551d3d,_0x4d2375){return _0x551d3d[_0x8c37('0xc')](_0x8c37('0xd'),attributes,{'tableName':_0x8c37('0xe'),'paranoid':![],'indexes':[{'name':_0x8c37('0xf'),'fields':[_0x8c37('0x10'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x85d4=['api','bluebird','request-promise','path','../../config/environment','exports','define','SugarcrmField','FieldId','lodash','util','../../config/logger'];(function(_0x393fbf,_0x3edc9a){var _0x108b09=function(_0x1c9ceb){while(--_0x1c9ceb){_0x393fbf['push'](_0x393fbf['shift']());}};_0x108b09(++_0x3edc9a);}(_0x85d4,0x17d));var _0x485d=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x85d4[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x485d('0x0'));var util=require(_0x485d('0x1'));var logger=require(_0x485d('0x2'))(_0x485d('0x3'));var moment=require('moment');var BPromise=require(_0x485d('0x4'));var rp=require(_0x485d('0x5'));var fs=require('fs');var path=require(_0x485d('0x6'));var rimraf=require('rimraf');var config=require(_0x485d('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x485d('0x8')]=function(_0x5d5e6c,_0xc94e2c){return _0x5d5e6c[_0x485d('0x9')](_0x485d('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x485d('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4f93f18..67a9390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf769=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','../../mysqldb'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xf769,0x74));var _0x9f76=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xf769[_0x2f57b2];return _0x5ace77;};'use strict';var _=require('lodash');var util=require(_0x9f76('0x0'));var moment=require(_0x9f76('0x1'));var BPromise=require(_0x9f76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f76('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f76('0x4'))(_0x9f76('0x5'));var config=require(_0x9f76('0x6'));var jayson=require(_0x9f76('0x7'));var client=jayson[_0x9f76('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a7bb0,_0x34da6e,_0x368e9a){return new BPromise(function(_0x46fa95,_0x213074){return client['request'](_0x4a7bb0,_0x368e9a)[_0x9f76('0x9')](function(_0x407376){logger[_0x9f76('0xa')](_0x9f76('0xb'),_0x34da6e,_0x9f76('0xc'));logger[_0x9f76('0xd')](_0x9f76('0xe'),_0x34da6e,_0x9f76('0xc'),JSON[_0x9f76('0xf')](_0x407376));if(_0x407376[_0x9f76('0x10')]){if(_0x407376[_0x9f76('0x10')][_0x9f76('0x11')]===0x1f4){logger[_0x9f76('0x10')](_0x9f76('0xb'),_0x34da6e,_0x407376[_0x9f76('0x10')][_0x9f76('0x12')]);return _0x213074(_0x407376[_0x9f76('0x10')][_0x9f76('0x12')]);}logger[_0x9f76('0x10')](_0x9f76('0xb'),_0x34da6e,_0x407376[_0x9f76('0x10')][_0x9f76('0x12')]);return _0x46fa95(_0x407376['error'][_0x9f76('0x12')]);}else{logger[_0x9f76('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x34da6e,_0x9f76('0xc'));_0x46fa95(_0x407376[_0x9f76('0x13')]['message']);}})['catch'](function(_0x2fd9a5){logger[_0x9f76('0x10')](_0x9f76('0xb'),_0x34da6e,_0x2fd9a5);_0x213074(_0x2fd9a5);});});}
\ No newline at end of file
+var _0x302d=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','SugarcrmField,\x20%s,\x20%s','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x2f15be,_0x111590){var _0x38fbda=function(_0x232912){while(--_0x232912){_0x2f15be['push'](_0x2f15be['shift']());}};_0x38fbda(++_0x111590);}(_0x302d,0x158));var _0xd302=function(_0x32062d,_0x2fa92b){_0x32062d=_0x32062d-0x0;var _0x45ba71=_0x302d[_0x32062d];return _0x45ba71;};'use strict';var _=require(_0xd302('0x0'));var util=require('util');var moment=require(_0xd302('0x1'));var BPromise=require(_0xd302('0x2'));var rs=require(_0xd302('0x3'));var fs=require('fs');var Redis=require(_0xd302('0x4'));var db=require(_0xd302('0x5'))['db'];var utils=require(_0xd302('0x6'));var logger=require(_0xd302('0x7'))(_0xd302('0x8'));var config=require(_0xd302('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd302('0xa')][_0xd302('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b3c49,_0x170341,_0x1aa1b2){return new BPromise(function(_0x2f8faa,_0x3bf832){return client['request'](_0x1b3c49,_0x1aa1b2)[_0xd302('0xc')](function(_0x88046e){logger[_0xd302('0xd')](_0xd302('0xe'),_0x170341,'request\x20sent');logger[_0xd302('0xf')](_0xd302('0x10'),_0x170341,_0xd302('0x11'),JSON[_0xd302('0x12')](_0x88046e));if(_0x88046e[_0xd302('0x13')]){if(_0x88046e[_0xd302('0x13')][_0xd302('0x14')]===0x1f4){logger[_0xd302('0x13')](_0xd302('0xe'),_0x170341,_0x88046e[_0xd302('0x13')][_0xd302('0x15')]);return _0x3bf832(_0x88046e['error'][_0xd302('0x15')]);}logger[_0xd302('0x13')](_0xd302('0xe'),_0x170341,_0x88046e[_0xd302('0x13')][_0xd302('0x15')]);return _0x2f8faa(_0x88046e[_0xd302('0x13')]['message']);}else{logger[_0xd302('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x170341,_0xd302('0x11'));_0x2f8faa(_0x88046e['result'][_0xd302('0x15')]);}})[_0xd302('0x16')](function(_0x4e7513){logger[_0xd302('0x13')](_0xd302('0xe'),_0x170341,_0x4e7513);_0x3bf832(_0x4e7513);});});}
\ No newline at end of file
index 6bb56f1..5b04553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aaa=['get','index','isAuthenticated','show','/:id/configurations','getFields','post','create','addConfiguration','/:id','update','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller'];(function(_0x4be251,_0x2b3902){var _0x360a46=function(_0x3b3b02){while(--_0x3b3b02){_0x4be251['push'](_0x4be251['shift']());}};_0x360a46(++_0x2b3902);}(_0x8aaa,0x64));var _0xa8aa=function(_0x30f07a,_0x98341){_0x30f07a=_0x30f07a-0x0;var _0xb38461=_0x8aaa[_0x30f07a];return _0xb38461;};'use strict';var multer=require(_0xa8aa('0x0'));var util=require(_0xa8aa('0x1'));var path=require(_0xa8aa('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8aa('0x3'));var router=express[_0xa8aa('0x4')]();var fs_extra=require(_0xa8aa('0x5'));var auth=require(_0xa8aa('0x6'));var interaction=require(_0xa8aa('0x7'));var config=require(_0xa8aa('0x8'));var controller=require(_0xa8aa('0x9'));router[_0xa8aa('0xa')]('/',auth['isAuthenticated'](),controller[_0xa8aa('0xb')]);router['get']('/:id',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0xd')]);router['get'](_0xa8aa('0xe'),auth[_0xa8aa('0xc')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0xf')]);router[_0xa8aa('0x10')]('/',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x11')]);router[_0xa8aa('0x10')](_0xa8aa('0xe'),auth['isAuthenticated'](),controller[_0xa8aa('0x12')]);router['put'](_0xa8aa('0x13'),auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x14')]);router['delete']('/:id',auth[_0xa8aa('0xc')](),controller[_0xa8aa('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x579c=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id'];(function(_0x514563,_0x1cf4a9){var _0x47dab5=function(_0x3db341){while(--_0x3db341){_0x514563['push'](_0x514563['shift']());}};_0x47dab5(++_0x1cf4a9);}(_0x579c,0xda));var _0xc579=function(_0x3ce250,_0x25bed7){_0x3ce250=_0x3ce250-0x0;var _0xc9244a=_0x579c[_0x3ce250];return _0xc9244a;};'use strict';var multer=require(_0xc579('0x0'));var util=require(_0xc579('0x1'));var path=require(_0xc579('0x2'));var timeout=require(_0xc579('0x3'));var express=require(_0xc579('0x4'));var router=express['Router']();var fs_extra=require(_0xc579('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc579('0x6'));var config=require(_0xc579('0x7'));var controller=require(_0xc579('0x8'));router[_0xc579('0x9')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0xb')]);router[_0xc579('0x9')]('/:id',auth[_0xc579('0xa')](),controller[_0xc579('0xc')]);router[_0xc579('0x9')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0xe')]);router[_0xc579('0x9')](_0xc579('0xf'),auth['isAuthenticated'](),controller[_0xc579('0x10')]);router[_0xc579('0x11')]('/',auth[_0xc579('0xa')](),controller[_0xc579('0x12')]);router[_0xc579('0x11')](_0xc579('0xd'),auth[_0xc579('0xa')](),controller[_0xc579('0x13')]);router[_0xc579('0x14')](_0xc579('0x15'),auth[_0xc579('0xa')](),controller['update']);router[_0xc579('0x16')]('/:id',auth[_0xc579('0xa')](),controller['destroy']);module[_0xc579('0x17')]=router;
\ No newline at end of file
index 53700c1..abc6d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce0a=['sequelize','exports','STRING'];(function(_0x13a4bf,_0x56cb27){var _0x2933d6=function(_0x4a966f){while(--_0x4a966f){_0x13a4bf['push'](_0x13a4bf['shift']());}};_0x2933d6(++_0x56cb27);}(_0xce0a,0xcc));var _0xace0=function(_0x529059,_0x294a33){_0x529059=_0x529059-0x0;var _0x156bc2=_0xce0a[_0x529059];return _0x156bc2;};'use strict';var Sequelize=require(_0xace0('0x0'));module[_0xace0('0x1')]={'name':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xace0('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xace0('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x35a8=['STRING','HelpDesk','exports'];(function(_0x5664f8,_0x101e46){var _0x2383f2=function(_0x51c9d2){while(--_0x51c9d2){_0x5664f8['push'](_0x5664f8['shift']());}};_0x2383f2(++_0x101e46);}(_0x35a8,0xa4));var _0x835a=function(_0x447c74,_0x133a19){_0x447c74=_0x447c74-0x0;var _0x380241=_0x35a8[_0x447c74];return _0x380241;};'use strict';var Sequelize=require('sequelize');module[_0x835a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x835a('0x1')]},'username':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x835a('0x1')],'allowNull':![],'defaultValue':_0x835a('0x2')},'remoteUri':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x835a('0x1')],'allowNull':![]}};
\ No newline at end of file
index fa9d329..45dad50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c5a=['apply','reject','save','then','sendStatus','error','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','keys','include','find','create','body','params','destroy','findOne','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','getFields','description','remoteUri','accessKey','username','slice','substring','format','getchallenge','POST','login','result','token','success','includes','remove','editable','false','label','startsWith','cf_','picklistValues','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','json'];(function(_0x28509b,_0x5831ff){var _0x1e0b6=function(_0x37d8a2){while(--_0x37d8a2){_0x28509b['push'](_0x28509b['shift']());}};_0x1e0b6(++_0x5831ff);}(_0x8c5a,0x13c));var _0xa8c5=function(_0x298c8d,_0x3aa00b){_0x298c8d=_0x298c8d-0x0;var _0x178e04=_0x8c5a[_0x298c8d];return _0x178e04;};'use strict';var emlformat=require(_0xa8c5('0x0'));var rimraf=require(_0xa8c5('0x1'));var zipdir=require(_0xa8c5('0x2'));var jsonpatch=require(_0xa8c5('0x3'));var rp=require('request-promise');var moment=require(_0xa8c5('0x4'));var BPromise=require(_0xa8c5('0x5'));var Mustache=require(_0xa8c5('0x6'));var util=require(_0xa8c5('0x7'));var path=require(_0xa8c5('0x8'));var sox=require('sox');var csv=require(_0xa8c5('0x9'));var ejs=require(_0xa8c5('0xa'));var fs=require('fs');var fs_extra=require(_0xa8c5('0xb'));var _=require(_0xa8c5('0xc'));var squel=require('squel');var crypto=require(_0xa8c5('0xd'));var jsforce=require(_0xa8c5('0xe'));var deskjs=require(_0xa8c5('0xf'));var toCsv=require(_0xa8c5('0x9'));var querystring=require(_0xa8c5('0x10'));var Papa=require('papaparse');var Redis=require(_0xa8c5('0x11'));var authService=require(_0xa8c5('0x12'));var qs=require(_0xa8c5('0x13'));var as=require(_0xa8c5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa8c5('0x15'));var config=require(_0xa8c5('0x16'));var licenseUtil=require(_0xa8c5('0x17'));var db=require(_0xa8c5('0x18'))['db'];var integrations=require(_0xa8c5('0x19'));function respondWithStatusCode(_0x32eaf6,_0x504ba9){_0x504ba9=_0x504ba9||0xcc;return function(_0x3ab757){if(_0x3ab757){return _0x32eaf6['sendStatus'](_0x504ba9);}return _0x32eaf6['status'](_0x504ba9)[_0xa8c5('0x1a')]();};}function respondWithResult(_0x14c8a7,_0x184e61){_0x184e61=_0x184e61||0xc8;return function(_0x1a8f84){if(_0x1a8f84){return _0x14c8a7[_0xa8c5('0x1b')](_0x184e61)['json'](_0x1a8f84);}};}function respondWithFilteredResult(_0x2af8d8,_0x4a5b53){return function(_0x553249){if(_0x553249){var _0x1f660c=typeof _0x4a5b53[_0xa8c5('0x1c')]===_0xa8c5('0x1d')&&typeof _0x4a5b53[_0xa8c5('0x1e')]===_0xa8c5('0x1d');var _0x259cc8=_0x553249[_0xa8c5('0x1f')];var _0x42c4bd=_0x1f660c?0x0:_0x4a5b53['offset'];var _0x3f0660=_0x1f660c?_0x553249[_0xa8c5('0x1f')]:_0x4a5b53['offset']+_0x4a5b53[_0xa8c5('0x1e')];var _0x3e0c5c;if(_0x3f0660>=_0x259cc8){_0x3f0660=_0x259cc8;_0x3e0c5c=0xc8;}else{_0x3e0c5c=0xce;}_0x2af8d8['status'](_0x3e0c5c);return _0x2af8d8[_0xa8c5('0x20')](_0xa8c5('0x21'),_0x42c4bd+'-'+_0x3f0660+'/'+_0x259cc8)[_0xa8c5('0x22')](_0x553249);}return null;};}function patchUpdates(_0xf7634){return function(_0x273558){try{jsonpatch[_0xa8c5('0x23')](_0x273558,_0xf7634,!![]);}catch(_0x55f318){return BPromise[_0xa8c5('0x24')](_0x55f318);}return _0x273558[_0xa8c5('0x25')]();};}function saveUpdates(_0xfa75b0,_0x475ee1){return function(_0x3815eb){if(_0x3815eb){return _0x3815eb['update'](_0xfa75b0)[_0xa8c5('0x26')](function(_0x3dedc0){return _0x3dedc0;});}return null;};}function removeEntity(_0x5b1cfd,_0x5add14){return function(_0x168eb2){if(_0x168eb2){return _0x168eb2['destroy']()[_0xa8c5('0x26')](function(){_0x5b1cfd[_0xa8c5('0x1b')](0xcc)[_0xa8c5('0x1a')]();});}};}function handleEntityNotFound(_0x4f0429,_0x245468){return function(_0x305e97){if(!_0x305e97){_0x4f0429[_0xa8c5('0x27')](0x194);}return _0x305e97;};}function handleError(_0x415680,_0xe170ab){_0xe170ab=_0xe170ab||0x1f4;return function(_0x1881de){logger[_0xa8c5('0x28')](_0x1881de[_0xa8c5('0x29')]);if(_0x1881de[_0xa8c5('0x2a')]){delete _0x1881de[_0xa8c5('0x2a')];}_0x415680[_0xa8c5('0x1b')](_0xe170ab)[_0xa8c5('0x2b')](_0x1881de);};}exports[_0xa8c5('0x2c')]=function(_0x1d5fed,_0xc5a9c1){var _0x28934d={},_0x2bc6b8={},_0x27f526={'count':0x0,'rows':[]};var _0x523891=_['map'](db[_0xa8c5('0x2d')][_0xa8c5('0x2e')],function(_0x318dc0){return{'name':_0x318dc0[_0xa8c5('0x2f')],'type':_0x318dc0[_0xa8c5('0x30')]['key']};});_0x2bc6b8[_0xa8c5('0x31')]=_[_0xa8c5('0x32')](_0x523891,_0xa8c5('0x2a'));_0x2bc6b8[_0xa8c5('0x33')]=_['keys'](_0x1d5fed['query']);_0x2bc6b8[_0xa8c5('0x34')]=_[_0xa8c5('0x35')](_0x2bc6b8[_0xa8c5('0x31')],_0x2bc6b8['query']);_0x28934d[_0xa8c5('0x36')]=_['intersection'](_0x2bc6b8[_0xa8c5('0x31')],qs[_0xa8c5('0x37')](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x37')]));_0x28934d[_0xa8c5('0x36')]=_0x28934d[_0xa8c5('0x36')][_0xa8c5('0x38')]?_0x28934d[_0xa8c5('0x36')]:_0x2bc6b8[_0xa8c5('0x31')];if(!_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x39')](_0xa8c5('0x3a'))){_0x28934d['limit']=qs[_0xa8c5('0x1e')](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x1e')]);_0x28934d['offset']=qs['offset'](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x1c')]);}_0x28934d[_0xa8c5('0x3b')]=qs[_0xa8c5('0x3c')](_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x3c')]);_0x28934d['where']=qs[_0xa8c5('0x34')](_[_0xa8c5('0x3d')](_0x1d5fed['query'],_0x2bc6b8[_0xa8c5('0x34')]),_0x523891);if(_0x1d5fed[_0xa8c5('0x33')][_0xa8c5('0x3e')]){_0x28934d[_0xa8c5('0x3f')]=_[_0xa8c5('0x40')](_0x28934d[_0xa8c5('0x3f')],{'$or':_[_0xa8c5('0x32')](_0x523891,function(_0x4705f1){if(_0x4705f1[_0xa8c5('0x30')]!==_0xa8c5('0x41')){var _0x256dfb={};_0x256dfb[_0x4705f1['name']]={'$like':'%'+_0x1d5fed['query'][_0xa8c5('0x3e')]+'%'};return _0x256dfb;}})});}_0x28934d=_['merge']({},_0x28934d,_0x1d5fed[_0xa8c5('0x42')]);var _0x42b943={'where':_0x28934d[_0xa8c5('0x3f')]};return db[_0xa8c5('0x2d')]['count'](_0x42b943)[_0xa8c5('0x26')](function(_0x1e16ae){_0x27f526[_0xa8c5('0x1f')]=_0x1e16ae;if(_0x1d5fed['query'][_0xa8c5('0x43')]){_0x28934d['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xa8c5('0x44')](_0x28934d);})[_0xa8c5('0x26')](function(_0x4c612f){_0x27f526[_0xa8c5('0x45')]=_0x4c612f;return _0x27f526;})['then'](respondWithFilteredResult(_0xc5a9c1,_0x28934d))[_0xa8c5('0x46')](handleError(_0xc5a9c1,null));};exports['show']=function(_0x13f21d,_0x309c56){var _0x4605b6={'raw':![],'where':{'id':_0x13f21d['params']['id']}},_0x451e51={};_0x451e51[_0xa8c5('0x31')]=_[_0xa8c5('0x47')](db[_0xa8c5('0x2d')]['rawAttributes']);_0x451e51[_0xa8c5('0x33')]=_[_0xa8c5('0x47')](_0x13f21d[_0xa8c5('0x33')]);_0x451e51['filters']=_[_0xa8c5('0x35')](_0x451e51[_0xa8c5('0x31')],_0x451e51['query']);_0x4605b6[_0xa8c5('0x36')]=_[_0xa8c5('0x35')](_0x451e51[_0xa8c5('0x31')],qs[_0xa8c5('0x37')](_0x13f21d['query'][_0xa8c5('0x37')]));_0x4605b6['attributes']=_0x4605b6[_0xa8c5('0x36')][_0xa8c5('0x38')]?_0x4605b6[_0xa8c5('0x36')]:_0x451e51[_0xa8c5('0x31')];if(_0x13f21d[_0xa8c5('0x33')]['includeAll']){_0x4605b6[_0xa8c5('0x48')]=[{'all':!![]}];}_0x4605b6=_[_0xa8c5('0x40')]({},_0x4605b6,_0x13f21d['options']);return db['VtigerAccount'][_0xa8c5('0x49')](_0x4605b6)[_0xa8c5('0x26')](handleEntityNotFound(_0x309c56,null))[_0xa8c5('0x26')](respondWithResult(_0x309c56,null))[_0xa8c5('0x46')](handleError(_0x309c56,null));};exports[_0xa8c5('0x4a')]=function(_0x26a227,_0x1a622c){return db[_0xa8c5('0x2d')][_0xa8c5('0x4a')](_0x26a227[_0xa8c5('0x4b')],{})[_0xa8c5('0x26')](respondWithResult(_0x1a622c,0xc9))[_0xa8c5('0x46')](handleError(_0x1a622c,null));};exports['update']=function(_0x582694,_0x3cfde2){if(_0x582694[_0xa8c5('0x4b')]['id']){delete _0x582694[_0xa8c5('0x4b')]['id'];}return db[_0xa8c5('0x2d')]['find']({'where':{'id':_0x582694[_0xa8c5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3cfde2,null))['then'](saveUpdates(_0x582694[_0xa8c5('0x4b')],null))['then'](respondWithResult(_0x3cfde2,null))['catch'](handleError(_0x3cfde2,null));};exports[_0xa8c5('0x4d')]=function(_0x25debb,_0x51f42c){return db[_0xa8c5('0x2d')][_0xa8c5('0x49')]({'where':{'id':_0x25debb['params']['id']}})[_0xa8c5('0x26')](handleEntityNotFound(_0x51f42c,null))['then'](removeEntity(_0x51f42c,null))[_0xa8c5('0x46')](handleError(_0x51f42c,null));};exports['getConfigurations']=function(_0x2f9afa,_0x8c3ed1,_0xb479f8){var _0x1e47af={};var _0x59e193={};var _0x340e21;var _0x699f6;return db[_0xa8c5('0x2d')][_0xa8c5('0x4e')]({'where':{'id':_0x2f9afa[_0xa8c5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x8c3ed1,null))[_0xa8c5('0x26')](function(_0x1ff059){if(_0x1ff059){_0x340e21=_0x1ff059;_0x59e193[_0xa8c5('0x31')]=_[_0xa8c5('0x47')](db['VtigerConfiguration'][_0xa8c5('0x2e')]);_0x59e193[_0xa8c5('0x33')]=_[_0xa8c5('0x47')](_0x2f9afa[_0xa8c5('0x33')]);_0x59e193[_0xa8c5('0x34')]=_[_0xa8c5('0x35')](_0x59e193[_0xa8c5('0x31')],_0x59e193[_0xa8c5('0x33')]);_0x1e47af[_0xa8c5('0x36')]=_[_0xa8c5('0x35')](_0x59e193[_0xa8c5('0x31')],qs[_0xa8c5('0x37')](_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x37')]));_0x1e47af[_0xa8c5('0x36')]=_0x1e47af[_0xa8c5('0x36')]['length']?_0x1e47af[_0xa8c5('0x36')]:_0x59e193['model'];_0x1e47af[_0xa8c5('0x3b')]=qs[_0xa8c5('0x3c')](_0x2f9afa['query'][_0xa8c5('0x3c')]);_0x1e47af[_0xa8c5('0x3f')]=qs[_0xa8c5('0x34')](_[_0xa8c5('0x3d')](_0x2f9afa[_0xa8c5('0x33')],_0x59e193['filters']));if(_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x3e')]){_0x1e47af['where']=_['merge'](_0x1e47af['where'],{'$or':_[_0xa8c5('0x32')](_0x1e47af[_0xa8c5('0x36')],function(_0x34da0d){var _0x52adb5={};_0x52adb5[_0x34da0d]={'$like':'%'+_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x3e')]+'%'};return _0x52adb5;})});}_0x1e47af=_[_0xa8c5('0x40')]({},_0x1e47af,_0x2f9afa[_0xa8c5('0x42')]);return _0x340e21[_0xa8c5('0x4f')](_0x1e47af);}})[_0xa8c5('0x26')](function(_0x3c2db1){if(_0x3c2db1){_0x699f6=_0x3c2db1[_0xa8c5('0x38')];if(!_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x39')](_0xa8c5('0x3a'))){_0x1e47af[_0xa8c5('0x1e')]=qs[_0xa8c5('0x1e')](_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x1e')]);_0x1e47af[_0xa8c5('0x1c')]=qs[_0xa8c5('0x1c')](_0x2f9afa[_0xa8c5('0x33')][_0xa8c5('0x1c')]);}return _0x340e21[_0xa8c5('0x4f')](_0x1e47af);}})['then'](function(_0x54855a){if(_0x54855a){return _0x54855a?{'count':_0x699f6,'rows':_0x54855a}:null;}})[_0xa8c5('0x26')](respondWithResult(_0x8c3ed1,null))[_0xa8c5('0x46')](handleError(_0x8c3ed1,null));};exports[_0xa8c5('0x50')]=function(_0x2cff4e,_0x5b8a78,_0x5cef5c){if(_0x2cff4e[_0xa8c5('0x4b')]['id']){delete _0x2cff4e[_0xa8c5('0x4b')]['id'];}return db[_0xa8c5('0x2d')][_0xa8c5('0x4e')]({'where':{'id':_0x2cff4e[_0xa8c5('0x4c')]['id']}})[_0xa8c5('0x26')](handleEntityNotFound(_0x5b8a78,null))['then'](function(_0x2bdae4){if(_0x2bdae4){_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x51')]=_0x2bdae4['id'];_0x2cff4e[_0xa8c5('0x4b')]['Subjects']=integrations[_0xa8c5('0x52')](_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x53')],_0x2cff4e[_0xa8c5('0x4b')]['type']);_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x54')]=integrations[_0xa8c5('0x55')](_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x53')],_0x2cff4e[_0xa8c5('0x4b')][_0xa8c5('0x30')]);return db[_0xa8c5('0x56')][_0xa8c5('0x4a')](_0x2cff4e[_0xa8c5('0x4b')],{'include':[{'model':db[_0xa8c5('0x57')],'as':_0xa8c5('0x58')},{'model':db[_0xa8c5('0x57')],'as':_0xa8c5('0x54')}]});}return null;})[_0xa8c5('0x26')](respondWithResult(_0x5b8a78,null))[_0xa8c5('0x46')](handleError(_0x5b8a78,null));};var md5=require('md5');exports[_0xa8c5('0x59')]=function(_0x41bac0,_0x23852b,_0x30f55e){var _0x1caec4=null;var _0x6866ea=null;var _0x574874=null;var _0x5a1cc6=null;var _0x2995a8='';return db[_0xa8c5('0x2d')][_0xa8c5('0x4e')]({'where':{'id':_0x41bac0[_0xa8c5('0x4c')]['id']},'attributes':['id',_0xa8c5('0x2a'),'username',_0xa8c5('0x5a'),'moduleName',_0xa8c5('0x5b'),'serverUrl',_0xa8c5('0x5c')]})[_0xa8c5('0x26')](handleEntityNotFound(_0x23852b,null))['then'](function(_0x5361e0){if(_0x5361e0){_0x1caec4=_0x5361e0[_0xa8c5('0x5d')];_0x6866ea=_0x5361e0[_0xa8c5('0x5c')];_0x574874=_0x5361e0['moduleName'];_0x2995a8=_0x5361e0['remoteUri'];var _0x283a53=_0x2995a8[_0xa8c5('0x5e')](-0x1);if(_0x283a53==='/'){_0x2995a8=_0x2995a8[_0xa8c5('0x5f')](0x0,_0x2995a8['lastIndexOf'](_0x283a53));}_0x5a1cc6=util[_0xa8c5('0x60')]('%s/webservice.php',_0x2995a8);var _0x4398ad={'method':'GET','uri':_0x5a1cc6,'qs':{'operation':_0xa8c5('0x61'),'username':_0x5361e0[_0xa8c5('0x5d')]},'json':!![]};return rp(_0x4398ad);}})[_0xa8c5('0x26')](function(_0x11d679){if(_0x11d679['success']){var _0x5be379={'method':_0xa8c5('0x62'),'uri':_0x5a1cc6,'form':{'operation':_0xa8c5('0x63'),'username':_0x1caec4,'accessKey':md5(_0x11d679[_0xa8c5('0x64')][_0xa8c5('0x65')]+_0x6866ea)},'json':!![]};return rp(_0x5be379);}})['then'](function(_0x521f7d){if(_0x521f7d[_0xa8c5('0x66')]){var _0x7384c2={'method':'GET','uri':_0x5a1cc6,'qs':{'operation':'describe','username':_0x1caec4,'sessionName':_0x521f7d[_0xa8c5('0x64')]['sessionName'],'elementType':_0x574874},'json':!![]};return rp(_0x7384c2);}})[_0xa8c5('0x26')](function(_0x6d8cd7){if(_0x6d8cd7[_0xa8c5('0x66')]){var _0x311b00=['autogenerated','reference','owner'];_['remove'](_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')],function(_0x32f6f2){return _0x311b00[_0xa8c5('0x67')](_0x32f6f2[_0xa8c5('0x30')][_0xa8c5('0x2a')]);});_[_0xa8c5('0x68')](_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')],function(_0x2f634f){return _0x2f634f[_0xa8c5('0x69')]===_0xa8c5('0x6a');});return{'count':_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')][_0xa8c5('0x38')],'rows':_[_0xa8c5('0x32')](_0x6d8cd7[_0xa8c5('0x64')][_0xa8c5('0x37')],function(_0x20cc1f){return{'id':_0x20cc1f[_0xa8c5('0x2a')],'name':_0x20cc1f[_0xa8c5('0x6b')],'custom':_[_0xa8c5('0x6c')](_0x20cc1f[_0xa8c5('0x2a')],_0xa8c5('0x6d'))?!![]:![],'options':_0x20cc1f[_0xa8c5('0x30')][_0xa8c5('0x2a')]==='picklist'&&_0x20cc1f[_0xa8c5('0x30')][_0xa8c5('0x6e')][_0xa8c5('0x38')]>0x0?_['map'](_0x20cc1f[_0xa8c5('0x30')][_0xa8c5('0x6e')],function(_0x23baba){return{'name':_0x23baba[_0xa8c5('0x6b')],'value':_0x23baba[_0xa8c5('0x6f')]};}):[]};})};}})[_0xa8c5('0x26')](respondWithResult(_0x23852b,null))[_0xa8c5('0x46')](function(_0x43b687){console['log']('vTiger\x20error:\x20'+_0x43b687);var _0x13cb4f=_0x41bac0[_0xa8c5('0x33')][_0xa8c5('0x70')]?0x1f4:_0x43b687[_0xa8c5('0x71')]||0x1f4;logger[_0xa8c5('0x28')](_0xa8c5('0x72'),_0xa8c5('0x59'),_0x13cb4f,JSON[_0xa8c5('0x73')](_0x43b687));delete _0x43b687[_0xa8c5('0x2a')];if(_0x13cb4f===0x191){_0x13cb4f=0x190;}_0x23852b[_0xa8c5('0x1b')](_0x13cb4f)[_0xa8c5('0x2b')](_0x41bac0[_0xa8c5('0x33')][_0xa8c5('0x70')]?{'message':_0xa8c5('0x74'),'statusCode':_0x43b687['statusCode']}:_0x43b687);});};
\ No newline at end of file
+var _0xd303=['includes','editable','label','startsWith','picklistValues','value','log','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','stack','name','send','map','VtigerAccount','rawAttributes','key','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','include','findAll','rows','catch','show','params','model','fields','includeAll','find','create','body','update','destroy','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','serverUrl','accessKey','remoteUri','slice','substring','lastIndexOf','format','GET','getchallenge','success','POST','login','token','describe','result','sessionName','autogenerated','reference','owner','remove'];(function(_0x164ef5,_0xba6238){var _0x2d60c5=function(_0x34deca){while(--_0x34deca){_0x164ef5['push'](_0x164ef5['shift']());}};_0x2d60c5(++_0xba6238);}(_0xd303,0x181));var _0x3d30=function(_0x4fb122,_0x38df6a){_0x4fb122=_0x4fb122-0x0;var _0x78527=_0xd303[_0x4fb122];return _0x78527;};'use strict';var emlformat=require(_0x3d30('0x0'));var rimraf=require(_0x3d30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d30('0x2'));var rp=require(_0x3d30('0x3'));var moment=require(_0x3d30('0x4'));var BPromise=require(_0x3d30('0x5'));var Mustache=require('mustache');var util=require(_0x3d30('0x6'));var path=require(_0x3d30('0x7'));var sox=require(_0x3d30('0x8'));var csv=require(_0x3d30('0x9'));var ejs=require(_0x3d30('0xa'));var fs=require('fs');var fs_extra=require(_0x3d30('0xb'));var _=require(_0x3d30('0xc'));var squel=require('squel');var crypto=require(_0x3d30('0xd'));var jsforce=require(_0x3d30('0xe'));var deskjs=require(_0x3d30('0xf'));var toCsv=require(_0x3d30('0x9'));var querystring=require('querystring');var Papa=require(_0x3d30('0x10'));var Redis=require('ioredis');var authService=require(_0x3d30('0x11'));var qs=require(_0x3d30('0x12'));var as=require(_0x3d30('0x13'));var hardwareService=require(_0x3d30('0x14'));var logger=require('../../config/logger')(_0x3d30('0x15'));var utils=require(_0x3d30('0x16'));var config=require(_0x3d30('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d30('0x18'))['db'];var integrations=require(_0x3d30('0x19'));function respondWithStatusCode(_0xb86803,_0x189a6e){_0x189a6e=_0x189a6e||0xcc;return function(_0x5b7a50){if(_0x5b7a50){return _0xb86803[_0x3d30('0x1a')](_0x189a6e);}return _0xb86803['status'](_0x189a6e)[_0x3d30('0x1b')]();};}function respondWithResult(_0x24cbdc,_0x13500c){_0x13500c=_0x13500c||0xc8;return function(_0x3d6cc7){if(_0x3d6cc7){return _0x24cbdc[_0x3d30('0x1c')](_0x13500c)[_0x3d30('0x1d')](_0x3d6cc7);}};}function respondWithFilteredResult(_0x5aca34,_0x24a293){return function(_0x1d7fb1){if(_0x1d7fb1){var _0x4a2006=typeof _0x24a293[_0x3d30('0x1e')]===_0x3d30('0x1f')&&typeof _0x24a293['limit']===_0x3d30('0x1f');var _0x51f7bc=_0x1d7fb1[_0x3d30('0x20')];var _0x2ec625=_0x4a2006?0x0:_0x24a293[_0x3d30('0x1e')];var _0x393e93=_0x4a2006?_0x1d7fb1[_0x3d30('0x20')]:_0x24a293[_0x3d30('0x1e')]+_0x24a293[_0x3d30('0x21')];var _0x5b7e73;if(_0x393e93>=_0x51f7bc){_0x393e93=_0x51f7bc;_0x5b7e73=0xc8;}else{_0x5b7e73=0xce;}_0x5aca34['status'](_0x5b7e73);return _0x5aca34[_0x3d30('0x22')](_0x3d30('0x23'),_0x2ec625+'-'+_0x393e93+'/'+_0x51f7bc)[_0x3d30('0x1d')](_0x1d7fb1);}return null;};}function patchUpdates(_0x4b8799){return function(_0x35c8e0){try{jsonpatch[_0x3d30('0x24')](_0x35c8e0,_0x4b8799,!![]);}catch(_0x3cdbb8){return BPromise[_0x3d30('0x25')](_0x3cdbb8);}return _0x35c8e0[_0x3d30('0x26')]();};}function saveUpdates(_0x698e0f,_0x421987){return function(_0x2feb42){if(_0x2feb42){return _0x2feb42['update'](_0x698e0f)[_0x3d30('0x27')](function(_0xa1ffb2){return _0xa1ffb2;});}return null;};}function removeEntity(_0x11d389,_0x29bee8){return function(_0x394839){if(_0x394839){return _0x394839['destroy']()[_0x3d30('0x27')](function(){_0x11d389[_0x3d30('0x1c')](0xcc)[_0x3d30('0x1b')]();});}};}function handleEntityNotFound(_0x49b75d,_0xa81ebb){return function(_0x6fb75c){if(!_0x6fb75c){_0x49b75d[_0x3d30('0x1a')](0x194);}return _0x6fb75c;};}function handleError(_0x16327c,_0x2dfdb3){_0x2dfdb3=_0x2dfdb3||0x1f4;return function(_0x243dc5){logger['error'](_0x243dc5[_0x3d30('0x28')]);if(_0x243dc5['name']){delete _0x243dc5[_0x3d30('0x29')];}_0x16327c[_0x3d30('0x1c')](_0x2dfdb3)[_0x3d30('0x2a')](_0x243dc5);};}exports['index']=function(_0x4aa882,_0x3db689){var _0x14a963={},_0x15487f={},_0x30db3e={'count':0x0,'rows':[]};var _0x41c31d=_[_0x3d30('0x2b')](db[_0x3d30('0x2c')][_0x3d30('0x2d')],function(_0x51d463){return{'name':_0x51d463['fieldName'],'type':_0x51d463['type'][_0x3d30('0x2e')]};});_0x15487f['model']=_[_0x3d30('0x2b')](_0x41c31d,'name');_0x15487f[_0x3d30('0x2f')]=_[_0x3d30('0x30')](_0x4aa882[_0x3d30('0x2f')]);_0x15487f[_0x3d30('0x31')]=_[_0x3d30('0x32')](_0x15487f['model'],_0x15487f[_0x3d30('0x2f')]);_0x14a963[_0x3d30('0x33')]=_[_0x3d30('0x32')](_0x15487f['model'],qs['fields'](_0x4aa882[_0x3d30('0x2f')]['fields']));_0x14a963['attributes']=_0x14a963[_0x3d30('0x33')][_0x3d30('0x34')]?_0x14a963['attributes']:_0x15487f['model'];if(!_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x35')](_0x3d30('0x36'))){_0x14a963['limit']=qs[_0x3d30('0x21')](_0x4aa882[_0x3d30('0x2f')]['limit']);_0x14a963[_0x3d30('0x1e')]=qs[_0x3d30('0x1e')](_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x1e')]);}_0x14a963[_0x3d30('0x37')]=qs[_0x3d30('0x38')](_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x38')]);_0x14a963['where']=qs[_0x3d30('0x31')](_[_0x3d30('0x39')](_0x4aa882[_0x3d30('0x2f')],_0x15487f[_0x3d30('0x31')]),_0x41c31d);if(_0x4aa882[_0x3d30('0x2f')][_0x3d30('0x3a')]){_0x14a963[_0x3d30('0x3b')]=_[_0x3d30('0x3c')](_0x14a963[_0x3d30('0x3b')],{'$or':_[_0x3d30('0x2b')](_0x41c31d,function(_0x8918b2){if(_0x8918b2[_0x3d30('0x3d')]!=='VIRTUAL'){var _0x1b9821={};_0x1b9821[_0x8918b2[_0x3d30('0x29')]]={'$like':'%'+_0x4aa882['query']['filter']+'%'};return _0x1b9821;}})});}_0x14a963=_['merge']({},_0x14a963,_0x4aa882[_0x3d30('0x3e')]);var _0x4d2aa6={'where':_0x14a963[_0x3d30('0x3b')]};return db['VtigerAccount'][_0x3d30('0x20')](_0x4d2aa6)['then'](function(_0xcd229){_0x30db3e[_0x3d30('0x20')]=_0xcd229;if(_0x4aa882[_0x3d30('0x2f')]['includeAll']){_0x14a963[_0x3d30('0x3f')]=[{'all':!![]}];}return db[_0x3d30('0x2c')][_0x3d30('0x40')](_0x14a963);})['then'](function(_0x1af060){_0x30db3e[_0x3d30('0x41')]=_0x1af060;return _0x30db3e;})[_0x3d30('0x27')](respondWithFilteredResult(_0x3db689,_0x14a963))[_0x3d30('0x42')](handleError(_0x3db689,null));};exports[_0x3d30('0x43')]=function(_0x4bc34a,_0x53cf5b){var _0x4d5541={'raw':![],'where':{'id':_0x4bc34a[_0x3d30('0x44')]['id']}},_0x2054b1={};_0x2054b1[_0x3d30('0x45')]=_[_0x3d30('0x30')](db[_0x3d30('0x2c')][_0x3d30('0x2d')]);_0x2054b1[_0x3d30('0x2f')]=_[_0x3d30('0x30')](_0x4bc34a[_0x3d30('0x2f')]);_0x2054b1[_0x3d30('0x31')]=_[_0x3d30('0x32')](_0x2054b1['model'],_0x2054b1[_0x3d30('0x2f')]);_0x4d5541[_0x3d30('0x33')]=_[_0x3d30('0x32')](_0x2054b1[_0x3d30('0x45')],qs[_0x3d30('0x46')](_0x4bc34a[_0x3d30('0x2f')][_0x3d30('0x46')]));_0x4d5541[_0x3d30('0x33')]=_0x4d5541[_0x3d30('0x33')][_0x3d30('0x34')]?_0x4d5541[_0x3d30('0x33')]:_0x2054b1[_0x3d30('0x45')];if(_0x4bc34a[_0x3d30('0x2f')][_0x3d30('0x47')]){_0x4d5541[_0x3d30('0x3f')]=[{'all':!![]}];}_0x4d5541=_[_0x3d30('0x3c')]({},_0x4d5541,_0x4bc34a[_0x3d30('0x3e')]);return db[_0x3d30('0x2c')][_0x3d30('0x48')](_0x4d5541)[_0x3d30('0x27')](handleEntityNotFound(_0x53cf5b,null))['then'](respondWithResult(_0x53cf5b,null))[_0x3d30('0x42')](handleError(_0x53cf5b,null));};exports[_0x3d30('0x49')]=function(_0x80f43b,_0x2fa82b){return db[_0x3d30('0x2c')][_0x3d30('0x49')](_0x80f43b[_0x3d30('0x4a')],{})['then'](respondWithResult(_0x2fa82b,0xc9))[_0x3d30('0x42')](handleError(_0x2fa82b,null));};exports[_0x3d30('0x4b')]=function(_0x41b02c,_0x72a507){if(_0x41b02c[_0x3d30('0x4a')]['id']){delete _0x41b02c[_0x3d30('0x4a')]['id'];}return db[_0x3d30('0x2c')]['find']({'where':{'id':_0x41b02c[_0x3d30('0x44')]['id']}})[_0x3d30('0x27')](handleEntityNotFound(_0x72a507,null))['then'](saveUpdates(_0x41b02c[_0x3d30('0x4a')],null))[_0x3d30('0x27')](respondWithResult(_0x72a507,null))[_0x3d30('0x42')](handleError(_0x72a507,null));};exports[_0x3d30('0x4c')]=function(_0x1e64e4,_0x50ea53){return db[_0x3d30('0x2c')][_0x3d30('0x48')]({'where':{'id':_0x1e64e4[_0x3d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x50ea53,null))[_0x3d30('0x27')](removeEntity(_0x50ea53,null))[_0x3d30('0x42')](handleError(_0x50ea53,null));};exports[_0x3d30('0x4d')]=function(_0x5d8a06,_0x3f3a90,_0x1ebab8){var _0x23b044={};var _0x22814b={};var _0x26548a;var _0xd7252b;return db[_0x3d30('0x2c')]['findOne']({'where':{'id':_0x5d8a06[_0x3d30('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f3a90,null))[_0x3d30('0x27')](function(_0x1ebca5){if(_0x1ebca5){_0x26548a=_0x1ebca5;_0x22814b[_0x3d30('0x45')]=_[_0x3d30('0x30')](db['VtigerConfiguration'][_0x3d30('0x2d')]);_0x22814b[_0x3d30('0x2f')]=_[_0x3d30('0x30')](_0x5d8a06[_0x3d30('0x2f')]);_0x22814b['filters']=_[_0x3d30('0x32')](_0x22814b['model'],_0x22814b[_0x3d30('0x2f')]);_0x23b044['attributes']=_['intersection'](_0x22814b[_0x3d30('0x45')],qs['fields'](_0x5d8a06[_0x3d30('0x2f')]['fields']));_0x23b044['attributes']=_0x23b044['attributes'][_0x3d30('0x34')]?_0x23b044[_0x3d30('0x33')]:_0x22814b[_0x3d30('0x45')];_0x23b044[_0x3d30('0x37')]=qs['sort'](_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x38')]);_0x23b044[_0x3d30('0x3b')]=qs['filters'](_[_0x3d30('0x39')](_0x5d8a06['query'],_0x22814b[_0x3d30('0x31')]));if(_0x5d8a06[_0x3d30('0x2f')]['filter']){_0x23b044['where']=_[_0x3d30('0x3c')](_0x23b044['where'],{'$or':_[_0x3d30('0x2b')](_0x23b044[_0x3d30('0x33')],function(_0x27d7e5){var _0x3139eb={};_0x3139eb[_0x27d7e5]={'$like':'%'+_0x5d8a06['query']['filter']+'%'};return _0x3139eb;})});}_0x23b044=_[_0x3d30('0x3c')]({},_0x23b044,_0x5d8a06[_0x3d30('0x3e')]);return _0x26548a[_0x3d30('0x4d')](_0x23b044);}})['then'](function(_0x35cf03){if(_0x35cf03){_0xd7252b=_0x35cf03[_0x3d30('0x34')];if(!_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x35')](_0x3d30('0x36'))){_0x23b044[_0x3d30('0x21')]=qs[_0x3d30('0x21')](_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x21')]);_0x23b044[_0x3d30('0x1e')]=qs['offset'](_0x5d8a06[_0x3d30('0x2f')][_0x3d30('0x1e')]);}return _0x26548a[_0x3d30('0x4d')](_0x23b044);}})['then'](function(_0x53def0){if(_0x53def0){return _0x53def0?{'count':_0xd7252b,'rows':_0x53def0}:null;}})[_0x3d30('0x27')](respondWithResult(_0x3f3a90,null))[_0x3d30('0x42')](handleError(_0x3f3a90,null));};exports[_0x3d30('0x4e')]=function(_0x1fbd47,_0x3b2fee,_0x36713c){if(_0x1fbd47[_0x3d30('0x4a')]['id']){delete _0x1fbd47[_0x3d30('0x4a')]['id'];}return db[_0x3d30('0x2c')][_0x3d30('0x4f')]({'where':{'id':_0x1fbd47[_0x3d30('0x44')]['id']}})[_0x3d30('0x27')](handleEntityNotFound(_0x3b2fee,null))[_0x3d30('0x27')](function(_0x54bf54){if(_0x54bf54){_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x50')]=_0x54bf54['id'];_0x1fbd47['body'][_0x3d30('0x51')]=integrations[_0x3d30('0x52')](_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x53')],_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x3d')]);_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x54')]=integrations[_0x3d30('0x55')](_0x1fbd47[_0x3d30('0x4a')][_0x3d30('0x53')],_0x1fbd47['body'][_0x3d30('0x3d')]);return db['VtigerConfiguration']['create'](_0x1fbd47['body'],{'include':[{'model':db['VtigerField'],'as':_0x3d30('0x51')},{'model':db[_0x3d30('0x56')],'as':_0x3d30('0x54')}]});}return null;})[_0x3d30('0x27')](respondWithResult(_0x3b2fee,null))[_0x3d30('0x42')](handleError(_0x3b2fee,null));};var md5=require(_0x3d30('0x57'));exports[_0x3d30('0x58')]=function(_0x333f42,_0x213134,_0x2b3277){var _0x5656ab=null;var _0x561715=null;var _0x5c2006=null;var _0x39a8b2=null;var _0x32624a='';return db[_0x3d30('0x2c')][_0x3d30('0x4f')]({'where':{'id':_0x333f42[_0x3d30('0x44')]['id']},'attributes':['id',_0x3d30('0x29'),_0x3d30('0x59'),'description',_0x3d30('0x5a'),'remoteUri',_0x3d30('0x5b'),_0x3d30('0x5c')]})[_0x3d30('0x27')](handleEntityNotFound(_0x213134,null))[_0x3d30('0x27')](function(_0xc34053){if(_0xc34053){_0x5656ab=_0xc34053['username'];_0x561715=_0xc34053['accessKey'];_0x5c2006=_0xc34053[_0x3d30('0x5a')];_0x32624a=_0xc34053[_0x3d30('0x5d')];var _0x2799c1=_0x32624a[_0x3d30('0x5e')](-0x1);if(_0x2799c1==='/'){_0x32624a=_0x32624a[_0x3d30('0x5f')](0x0,_0x32624a[_0x3d30('0x60')](_0x2799c1));}_0x39a8b2=util[_0x3d30('0x61')]('%s/webservice.php',_0x32624a);var _0x374c4f={'method':_0x3d30('0x62'),'uri':_0x39a8b2,'qs':{'operation':_0x3d30('0x63'),'username':_0xc34053['username']},'json':!![]};return rp(_0x374c4f);}})[_0x3d30('0x27')](function(_0x40f759){if(_0x40f759[_0x3d30('0x64')]){var _0x3c2f44={'method':_0x3d30('0x65'),'uri':_0x39a8b2,'form':{'operation':_0x3d30('0x66'),'username':_0x5656ab,'accessKey':md5(_0x40f759['result'][_0x3d30('0x67')]+_0x561715)},'json':!![]};return rp(_0x3c2f44);}})[_0x3d30('0x27')](function(_0x2d697c){if(_0x2d697c['success']){var _0x22f5db={'method':_0x3d30('0x62'),'uri':_0x39a8b2,'qs':{'operation':_0x3d30('0x68'),'username':_0x5656ab,'sessionName':_0x2d697c[_0x3d30('0x69')][_0x3d30('0x6a')],'elementType':_0x5c2006},'json':!![]};return rp(_0x22f5db);}})[_0x3d30('0x27')](function(_0x567b5d){if(_0x567b5d['success']){var _0x3d12b4=[_0x3d30('0x6b'),_0x3d30('0x6c'),_0x3d30('0x6d')];_[_0x3d30('0x6e')](_0x567b5d['result']['fields'],function(_0x530bac){return _0x3d12b4[_0x3d30('0x6f')](_0x530bac[_0x3d30('0x3d')][_0x3d30('0x29')]);});_['remove'](_0x567b5d['result'][_0x3d30('0x46')],function(_0x5f31a2){return _0x5f31a2[_0x3d30('0x70')]==='false';});return{'count':_0x567b5d[_0x3d30('0x69')][_0x3d30('0x46')][_0x3d30('0x34')],'rows':_[_0x3d30('0x2b')](_0x567b5d[_0x3d30('0x69')][_0x3d30('0x46')],function(_0x20ece6){return{'id':_0x20ece6[_0x3d30('0x29')],'name':_0x20ece6[_0x3d30('0x71')],'custom':_[_0x3d30('0x72')](_0x20ece6[_0x3d30('0x29')],'cf_')?!![]:![],'options':_0x20ece6[_0x3d30('0x3d')][_0x3d30('0x29')]==='picklist'&&_0x20ece6['type'][_0x3d30('0x73')]['length']>0x0?_[_0x3d30('0x2b')](_0x20ece6['type'][_0x3d30('0x73')],function(_0x1e8bfb){return{'name':_0x1e8bfb[_0x3d30('0x71')],'value':_0x1e8bfb[_0x3d30('0x74')]};}):[]};})};}})[_0x3d30('0x27')](respondWithResult(_0x213134,null))[_0x3d30('0x42')](function(_0x5c0565){console[_0x3d30('0x75')](_0x3d30('0x76')+_0x5c0565);var _0x26c0ea=_0x333f42['query']['test']?0x1f4:_0x5c0565[_0x3d30('0x77')]||0x1f4;logger[_0x3d30('0x78')](_0x3d30('0x79'),'getFields',_0x26c0ea,JSON[_0x3d30('0x7a')](_0x5c0565));delete _0x5c0565[_0x3d30('0x29')];if(_0x26c0ea===0x191){_0x26c0ea=0x190;}_0x213134['status'](_0x26c0ea)[_0x3d30('0x2a')](_0x333f42[_0x3d30('0x2f')][_0x3d30('0x7b')]?{'message':'Wrong\x20credentials','statusCode':_0x5c0565['statusCode']}:_0x5c0565);});};
\ No newline at end of file
index bf64b3b..3524518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2c5=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b3611,_0x3af5e1){var _0x344c6d=function(_0x239981){while(--_0x239981){_0x3b3611['push'](_0x3b3611['shift']());}};_0x344c6d(++_0x3af5e1);}(_0xf2c5,0x6d));var _0x5f2c=function(_0x215083,_0x4cc12f){_0x215083=_0x215083-0x0;var _0x16b3cf=_0xf2c5[_0x215083];return _0x16b3cf;};'use strict';var _=require(_0x5f2c('0x0'));var util=require(_0x5f2c('0x1'));var logger=require(_0x5f2c('0x2'))('api');var moment=require(_0x5f2c('0x3'));var BPromise=require(_0x5f2c('0x4'));var rp=require(_0x5f2c('0x5'));var fs=require('fs');var path=require(_0x5f2c('0x6'));var rimraf=require(_0x5f2c('0x7'));var config=require(_0x5f2c('0x8'));var attributes=require(_0x5f2c('0x9'));var integrations=require(_0x5f2c('0xa'));module[_0x5f2c('0xb')]=function(_0x30b823,_0x580efb){return _0x30b823[_0x5f2c('0xc')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd02=['define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x56f98d,_0x19a7a7){var _0x4a4108=function(_0x45bb3a){while(--_0x45bb3a){_0x56f98d['push'](_0x56f98d['shift']());}};_0x4a4108(++_0x19a7a7);}(_0xdd02,0x1d1));var _0x2dd0=function(_0x5cab28,_0x169dfe){_0x5cab28=_0x5cab28-0x0;var _0x279423=_0xdd02[_0x5cab28];return _0x279423;};'use strict';var _=require(_0x2dd0('0x0'));var util=require(_0x2dd0('0x1'));var logger=require(_0x2dd0('0x2'))(_0x2dd0('0x3'));var moment=require(_0x2dd0('0x4'));var BPromise=require(_0x2dd0('0x5'));var rp=require(_0x2dd0('0x6'));var fs=require('fs');var path=require(_0x2dd0('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dd0('0x8'));var integrations=require(_0x2dd0('0x9'));module[_0x2dd0('0xa')]=function(_0x4dd002,_0x5c2969){return _0x4dd002[_0x2dd0('0xb')](_0x2dd0('0xc'),attributes,{'tableName':_0x2dd0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0c7da73..12584c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236c=['jayson/promise','client','http','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','options','raw','where','attributes','include','map','model','VtigerAccount','find','ShowVtigerAccount','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x25cd84,_0x568fe2){var _0xb0788f=function(_0x253173){while(--_0x253173){_0x25cd84['push'](_0x25cd84['shift']());}};_0xb0788f(++_0x568fe2);}(_0x236c,0x155));var _0xc236=function(_0x3b1f3d,_0x323833){_0x3b1f3d=_0x3b1f3d-0x0;var _0x408aa2=_0x236c[_0x3b1f3d];return _0x408aa2;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abd65,_0xd612c6,_0x4d349b){return new BPromise(function(_0x51a13b,_0x5bc6a2){return client['request'](_0x5abd65,_0x4d349b)[_0xc236('0xc')](function(_0x4b8dc6){logger[_0xc236('0xd')](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));logger[_0xc236('0x10')](_0xc236('0x11'),_0xd612c6,'request\x20sent',JSON[_0xc236('0x12')](_0x4b8dc6));if(_0x4b8dc6[_0xc236('0x13')]){if(_0x4b8dc6['error'][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('VtigerAccount,\x20%s,\x20%s',_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x5bc6a2(_0x4b8dc6['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0xe'),_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x51a13b(_0x4b8dc6[_0xc236('0x13')]['message']);}else{logger['info'](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));_0x51a13b(_0x4b8dc6[_0xc236('0x16')][_0xc236('0x15')]);}})[_0xc236('0x17')](function(_0x5ac3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xd612c6,_0x5ac3ed);_0x5bc6a2(_0x5ac3ed);});});}exports[_0xc236('0x18')]=function(_0x76f45){var _0x11ec65=this;return new Promise(function(_0x541a20,_0x13b432){return db['VtigerAccount']['findAll']({'raw':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1a')]===undefined?!![]:![]:!![],'where':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1b')]||null:null,'attributes':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1c')]||null:null,'limit':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')]['limit']||null:null,'include':_0x76f45[_0xc236('0x19')]?_0x76f45[_0xc236('0x19')][_0xc236('0x1d')]?_[_0xc236('0x1e')](_0x76f45[_0xc236('0x19')][_0xc236('0x1d')],function(_0x3a315b){return{'model':db[_0x3a315b[_0xc236('0x1f')]],'as':_0x3a315b['as'],'attributes':_0x3a315b[_0xc236('0x1c')],'include':_0x3a315b[_0xc236('0x1d')]?_[_0xc236('0x1e')](_0x3a315b['include'],function(_0x308cd6){return{'model':db[_0x308cd6[_0xc236('0x1f')]],'as':_0x308cd6['as'],'attributes':_0x308cd6[_0xc236('0x1c')],'include':_0x308cd6[_0xc236('0x1d')]?_['map'](_0x308cd6[_0xc236('0x1d')],function(_0x5da4b2){return{'model':db[_0x5da4b2['model']],'as':_0x5da4b2['as'],'attributes':_0x5da4b2[_0xc236('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36e578){logger['info'](_0xc236('0x18'),_0x76f45);logger['debug'](_0xc236('0x18'),_0x76f45,JSON[_0xc236('0x12')](_0x36e578));_0x541a20(_0x36e578);})['catch'](function(_0x5a61b5){logger[_0xc236('0x13')](_0xc236('0x18'),_0x5a61b5[_0xc236('0x15')],_0x76f45);_0x13b432(_0x11ec65[_0xc236('0x13')](0x1f4,_0x5a61b5['message']));});});};exports['ShowVtigerAccount']=function(_0x28ffa5){var _0x53b767=this;return new Promise(function(_0x2c756f,_0x4ddc87){return db[_0xc236('0x20')][_0xc236('0x21')]({'raw':_0x28ffa5['options']?_0x28ffa5['options'][_0xc236('0x1a')]===undefined?!![]:![]:!![],'where':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')][_0xc236('0x1b')]||null:null,'attributes':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')][_0xc236('0x1c')]||null:null,'include':_0x28ffa5[_0xc236('0x19')]?_0x28ffa5[_0xc236('0x19')]['include']?_['map'](_0x28ffa5['options'][_0xc236('0x1d')],function(_0xfda1f9){return{'model':db[_0xfda1f9[_0xc236('0x1f')]],'as':_0xfda1f9['as'],'attributes':_0xfda1f9[_0xc236('0x1c')],'include':_0xfda1f9[_0xc236('0x1d')]?_[_0xc236('0x1e')](_0xfda1f9[_0xc236('0x1d')],function(_0x5761de){return{'model':db[_0x5761de[_0xc236('0x1f')]],'as':_0x5761de['as'],'attributes':_0x5761de[_0xc236('0x1c')],'include':_0x5761de[_0xc236('0x1d')]?_['map'](_0x5761de[_0xc236('0x1d')],function(_0x2a8f33){return{'model':db[_0x2a8f33[_0xc236('0x1f')]],'as':_0x2a8f33['as'],'attributes':_0x2a8f33[_0xc236('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12348b){logger[_0xc236('0xd')](_0xc236('0x22'),_0x28ffa5);logger[_0xc236('0x10')](_0xc236('0x22'),_0x28ffa5,JSON[_0xc236('0x12')](_0x12348b));_0x2c756f(_0x12348b);})[_0xc236('0x17')](function(_0x11ca1c){logger[_0xc236('0x13')](_0xc236('0x22'),_0x11ca1c[_0xc236('0x15')],_0x28ffa5);_0x4ddc87(_0x53b767[_0xc236('0x13')](0x1f4,_0x11ca1c[_0xc236('0x15')]));});});};
\ No newline at end of file
+var _0x1339=['stringify','error','code','message','result','catch','VtigerAccount','findAll','options','attributes','map','include','model','GetVtigerAccount','debug','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4c67e1,_0xbfa4f){var _0x53ef74=function(_0x3fc9b2){while(--_0x3fc9b2){_0x4c67e1['push'](_0x4c67e1['shift']());}};_0x53ef74(++_0xbfa4f);}(_0x1339,0x1ed));var _0x9133=function(_0x31ea0e,_0x2bf19b){_0x31ea0e=_0x31ea0e-0x0;var _0x475789=_0x1339[_0x31ea0e];return _0x475789;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9133('0x0'));var BPromise=require(_0x9133('0x1'));var rs=require(_0x9133('0x2'));var fs=require('fs');var Redis=require(_0x9133('0x3'));var db=require(_0x9133('0x4'))['db'];var utils=require(_0x9133('0x5'));var logger=require(_0x9133('0x6'))(_0x9133('0x7'));var config=require('../../config/environment');var jayson=require(_0x9133('0x8'));var client=jayson[_0x9133('0x9')][_0x9133('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539af6,_0x2758e2,_0x334dcd){return new BPromise(function(_0x3059c4,_0x431a55){return client[_0x9133('0xb')](_0x539af6,_0x334dcd)[_0x9133('0xc')](function(_0x4294b7){logger[_0x9133('0xd')](_0x9133('0xe'),_0x2758e2,_0x9133('0xf'));logger['debug'](_0x9133('0x10'),_0x2758e2,_0x9133('0xf'),JSON[_0x9133('0x11')](_0x4294b7));if(_0x4294b7[_0x9133('0x12')]){if(_0x4294b7[_0x9133('0x12')][_0x9133('0x13')]===0x1f4){logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')]['message']);return _0x431a55(_0x4294b7['error'][_0x9133('0x14')]);}logger['error'](_0x9133('0xe'),_0x2758e2,_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);return _0x3059c4(_0x4294b7[_0x9133('0x12')][_0x9133('0x14')]);}else{logger[_0x9133('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x2758e2,_0x9133('0xf'));_0x3059c4(_0x4294b7[_0x9133('0x15')]['message']);}})[_0x9133('0x16')](function(_0xa46eb1){logger[_0x9133('0x12')](_0x9133('0xe'),_0x2758e2,_0xa46eb1);_0x431a55(_0xa46eb1);});});}exports['GetVtigerAccount']=function(_0x1f3484){var _0x573998=this;return new Promise(function(_0x3c48ef,_0x5d4a77){return db[_0x9133('0x17')][_0x9133('0x18')]({'raw':_0x1f3484['options']?_0x1f3484[_0x9133('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options']['where']||null:null,'attributes':_0x1f3484[_0x9133('0x19')]?_0x1f3484['options'][_0x9133('0x1a')]||null:null,'limit':_0x1f3484['options']?_0x1f3484['options']['limit']||null:null,'include':_0x1f3484[_0x9133('0x19')]?_0x1f3484[_0x9133('0x19')]['include']?_[_0x9133('0x1b')](_0x1f3484[_0x9133('0x19')][_0x9133('0x1c')],function(_0x26190c){return{'model':db[_0x26190c['model']],'as':_0x26190c['as'],'attributes':_0x26190c[_0x9133('0x1a')],'include':_0x26190c['include']?_[_0x9133('0x1b')](_0x26190c[_0x9133('0x1c')],function(_0x3f278d){return{'model':db[_0x3f278d[_0x9133('0x1d')]],'as':_0x3f278d['as'],'attributes':_0x3f278d[_0x9133('0x1a')],'include':_0x3f278d[_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x3f278d[_0x9133('0x1c')],function(_0x1b6b3e){return{'model':db[_0x1b6b3e[_0x9133('0x1d')]],'as':_0x1b6b3e['as'],'attributes':_0x1b6b3e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x477bf1){logger[_0x9133('0xd')](_0x9133('0x1e'),_0x1f3484);logger[_0x9133('0x1f')]('GetVtigerAccount',_0x1f3484,JSON['stringify'](_0x477bf1));_0x3c48ef(_0x477bf1);})[_0x9133('0x16')](function(_0x45966d){logger[_0x9133('0x12')](_0x9133('0x1e'),_0x45966d[_0x9133('0x14')],_0x1f3484);_0x5d4a77(_0x573998[_0x9133('0x12')](0x1f4,_0x45966d['message']));});});};exports['ShowVtigerAccount']=function(_0x5a27c1){var _0x1ad222=this;return new Promise(function(_0x4a4a8e,_0x43b5f3){return db[_0x9133('0x17')]['find']({'raw':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1['options'][_0x9133('0x20')]===undefined?!![]:![]:!![],'where':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1[_0x9133('0x19')]['where']||null:null,'attributes':_0x5a27c1[_0x9133('0x19')]?_0x5a27c1[_0x9133('0x19')][_0x9133('0x1a')]||null:null,'include':_0x5a27c1['options']?_0x5a27c1[_0x9133('0x19')][_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x5a27c1['options'][_0x9133('0x1c')],function(_0x20da68){return{'model':db[_0x20da68[_0x9133('0x1d')]],'as':_0x20da68['as'],'attributes':_0x20da68[_0x9133('0x1a')],'include':_0x20da68['include']?_[_0x9133('0x1b')](_0x20da68[_0x9133('0x1c')],function(_0x56719e){return{'model':db[_0x56719e[_0x9133('0x1d')]],'as':_0x56719e['as'],'attributes':_0x56719e[_0x9133('0x1a')],'include':_0x56719e[_0x9133('0x1c')]?_[_0x9133('0x1b')](_0x56719e[_0x9133('0x1c')],function(_0x2db377){return{'model':db[_0x2db377[_0x9133('0x1d')]],'as':_0x2db377['as'],'attributes':_0x2db377[_0x9133('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9133('0xc')](function(_0x335217){logger[_0x9133('0xd')]('ShowVtigerAccount',_0x5a27c1);logger[_0x9133('0x1f')](_0x9133('0x21'),_0x5a27c1,JSON['stringify'](_0x335217));_0x4a4a8e(_0x335217);})[_0x9133('0x16')](function(_0x3a2d1f){logger[_0x9133('0x12')](_0x9133('0x21'),_0x3a2d1f[_0x9133('0x14')],_0x5a27c1);_0x43b5f3(_0x1ad222[_0x9133('0x12')](0x1f4,_0x3a2d1f['message']));});});};
\ No newline at end of file
index 6d7c0f5..2c7169e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8f9=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','getFields','/:id/subjects','getDescriptions','create','put','update','exports','util'];(function(_0x9ea933,_0x565d76){var _0x4fdcd0=function(_0x1b1b59){while(--_0x1b1b59){_0x9ea933['push'](_0x9ea933['shift']());}};_0x4fdcd0(++_0x565d76);}(_0xf8f9,0x87));var _0x9f8f=function(_0x3be520,_0x46739c){_0x3be520=_0x3be520-0x0;var _0x1f7381=_0xf8f9[_0x3be520];return _0x1f7381;};'use strict';var multer=require('multer');var util=require(_0x9f8f('0x0'));var path=require(_0x9f8f('0x1'));var timeout=require(_0x9f8f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9f8f('0x3'));var interaction=require(_0x9f8f('0x4'));var config=require(_0x9f8f('0x5'));var controller=require('./intVtigerConfiguration.controller');router['get']('/',auth[_0x9f8f('0x6')](),controller['index']);router[_0x9f8f('0x7')](_0x9f8f('0x8'),auth['isAuthenticated'](),controller[_0x9f8f('0x9')]);router[_0x9f8f('0x7')]('/:id/fields',auth[_0x9f8f('0x6')](),controller[_0x9f8f('0xa')]);router['get'](_0x9f8f('0xb'),auth[_0x9f8f('0x6')](),controller['getSubjects']);router[_0x9f8f('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x9f8f('0xc')]);router['post']('/',auth[_0x9f8f('0x6')](),controller[_0x9f8f('0xd')]);router[_0x9f8f('0xe')](_0x9f8f('0x8'),auth[_0x9f8f('0x6')](),controller[_0x9f8f('0xf')]);router['delete']('/:id',auth[_0x9f8f('0x6')](),controller['destroy']);module[_0x9f8f('0x10')]=router;
\ No newline at end of file
+var _0x4ef9=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','/:id','show','get','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x49a8d1,_0x44c4cb){var _0x31909f=function(_0x190418){while(--_0x190418){_0x49a8d1['push'](_0x49a8d1['shift']());}};_0x31909f(++_0x44c4cb);}(_0x4ef9,0x10c));var _0x94ef=function(_0x2a7066,_0x279e23){_0x2a7066=_0x2a7066-0x0;var _0x21814e=_0x4ef9[_0x2a7066];return _0x21814e;};'use strict';var multer=require(_0x94ef('0x0'));var util=require(_0x94ef('0x1'));var path=require(_0x94ef('0x2'));var timeout=require(_0x94ef('0x3'));var express=require('express');var router=express[_0x94ef('0x4')]();var fs_extra=require(_0x94ef('0x5'));var auth=require(_0x94ef('0x6'));var interaction=require(_0x94ef('0x7'));var config=require('../../config/environment');var controller=require(_0x94ef('0x8'));router['get']('/',auth[_0x94ef('0x9')](),controller['index']);router['get'](_0x94ef('0xa'),auth[_0x94ef('0x9')](),controller[_0x94ef('0xb')]);router[_0x94ef('0xc')](_0x94ef('0xd'),auth[_0x94ef('0x9')](),controller['getFields']);router[_0x94ef('0xc')](_0x94ef('0xe'),auth[_0x94ef('0x9')](),controller['getSubjects']);router[_0x94ef('0xc')]('/:id/descriptions',auth[_0x94ef('0x9')](),controller[_0x94ef('0xf')]);router[_0x94ef('0x10')]('/',auth[_0x94ef('0x9')](),controller[_0x94ef('0x11')]);router[_0x94ef('0x12')](_0x94ef('0xa'),auth['isAuthenticated'](),controller[_0x94ef('0x13')]);router['delete'](_0x94ef('0xa'),auth[_0x94ef('0x9')](),controller[_0x94ef('0x14')]);module[_0x94ef('0x15')]=router;
\ No newline at end of file
index e4fc829..d05c9cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe619=['sequelize','exports','STRING'];(function(_0x5ad0fc,_0x35b8cd){var _0x3c8d05=function(_0x5bea89){while(--_0x5bea89){_0x5ad0fc['push'](_0x5ad0fc['shift']());}};_0x3c8d05(++_0x35b8cd);}(_0xe619,0x1e0));var _0x9e61=function(_0x30f020,_0x7d2cfa){_0x30f020=_0x30f020-0x0;var _0x3933c0=_0xe619[_0x30f020];return _0x3933c0;};'use strict';var Sequelize=require(_0x9e61('0x0'));module[_0x9e61('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9e61('0x2')]}};
\ No newline at end of file
+var _0xfb75=['STRING','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xfb75,0xf7));var _0x5fb7=function(_0xe85fc5,_0x2b163b){_0xe85fc5=_0xe85fc5-0x0;var _0x2dd759=_0xfb75[_0xe85fc5];return _0x2dd759;};'use strict';var Sequelize=require('sequelize');module[_0x5fb7('0x0')]={'name':{'type':Sequelize[_0x5fb7('0x1')]},'description':{'type':Sequelize[_0x5fb7('0x1')]}};
\ No newline at end of file
index 7b8dce6..4a46485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72e3=['end','error','stack','name','index','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','include','VtigerConfiguration','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','body','params','findOne','length','sort','filter','getFields','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy'];(function(_0x272eb9,_0x36b494){var _0x4d2120=function(_0x2af811){while(--_0x2af811){_0x272eb9['push'](_0x272eb9['shift']());}};_0x4d2120(++_0x36b494);}(_0x72e3,0x1b7));var _0x372e=function(_0x27d1ae,_0x2e03dd){_0x27d1ae=_0x27d1ae-0x0;var _0x49e658=_0x72e3[_0x27d1ae];return _0x49e658;};'use strict';var emlformat=require(_0x372e('0x0'));var rimraf=require(_0x372e('0x1'));var zipdir=require(_0x372e('0x2'));var jsonpatch=require(_0x372e('0x3'));var rp=require(_0x372e('0x4'));var moment=require(_0x372e('0x5'));var BPromise=require(_0x372e('0x6'));var Mustache=require(_0x372e('0x7'));var util=require('util');var path=require(_0x372e('0x8'));var sox=require('sox');var csv=require(_0x372e('0x9'));var ejs=require(_0x372e('0xa'));var fs=require('fs');var fs_extra=require(_0x372e('0xb'));var _=require(_0x372e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x372e('0xd'));var deskjs=require(_0x372e('0xe'));var toCsv=require(_0x372e('0x9'));var querystring=require(_0x372e('0xf'));var Papa=require('papaparse');var Redis=require(_0x372e('0x10'));var authService=require(_0x372e('0x11'));var qs=require(_0x372e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x372e('0x13'));var utils=require(_0x372e('0x14'));var config=require(_0x372e('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x103c9c,_0x3a7e07){_0x3a7e07=_0x3a7e07||0xcc;return function(_0x355760){if(_0x355760){return _0x103c9c[_0x372e('0x16')](_0x3a7e07);}return _0x103c9c[_0x372e('0x17')](_0x3a7e07)['end']();};}function respondWithResult(_0xa1ef5f,_0x21c0bd){_0x21c0bd=_0x21c0bd||0xc8;return function(_0xe5fff){if(_0xe5fff){return _0xa1ef5f[_0x372e('0x17')](_0x21c0bd)[_0x372e('0x18')](_0xe5fff);}};}function respondWithFilteredResult(_0x54e64a,_0x161b45){return function(_0x97ab89){if(_0x97ab89){var _0x559e0b=typeof _0x161b45[_0x372e('0x19')]==='undefined'&&typeof _0x161b45[_0x372e('0x1a')]===_0x372e('0x1b');var _0x471de0=_0x97ab89[_0x372e('0x1c')];var _0x3c2f81=_0x559e0b?0x0:_0x161b45[_0x372e('0x19')];var _0xf2b941=_0x559e0b?_0x97ab89[_0x372e('0x1c')]:_0x161b45[_0x372e('0x19')]+_0x161b45['limit'];var _0x1f81e3;if(_0xf2b941>=_0x471de0){_0xf2b941=_0x471de0;_0x1f81e3=0xc8;}else{_0x1f81e3=0xce;}_0x54e64a[_0x372e('0x17')](_0x1f81e3);return _0x54e64a['set']('Content-Range',_0x3c2f81+'-'+_0xf2b941+'/'+_0x471de0)[_0x372e('0x18')](_0x97ab89);}return null;};}function patchUpdates(_0xe28082){return function(_0x400a68){try{jsonpatch[_0x372e('0x1d')](_0x400a68,_0xe28082,!![]);}catch(_0x4ae02a){return BPromise[_0x372e('0x1e')](_0x4ae02a);}return _0x400a68[_0x372e('0x1f')]();};}function saveUpdates(_0x59931a,_0x675cd3){return function(_0x46102a){if(_0x46102a){return _0x46102a[_0x372e('0x20')](_0x59931a)[_0x372e('0x21')](function(_0x1d3be9){return _0x1d3be9;});}return null;};}function removeEntity(_0x34af21,_0x3d9e78){return function(_0x44ab92){if(_0x44ab92){return _0x44ab92[_0x372e('0x22')]()[_0x372e('0x21')](function(){_0x34af21[_0x372e('0x17')](0xcc)[_0x372e('0x23')]();});}};}function handleEntityNotFound(_0x139b53,_0x57852d){return function(_0x44d19e){if(!_0x44d19e){_0x139b53['sendStatus'](0x194);}return _0x44d19e;};}function handleError(_0x4eee56,_0x13e9cc){_0x13e9cc=_0x13e9cc||0x1f4;return function(_0x4b7321){logger[_0x372e('0x24')](_0x4b7321[_0x372e('0x25')]);if(_0x4b7321[_0x372e('0x26')]){delete _0x4b7321[_0x372e('0x26')];}_0x4eee56[_0x372e('0x17')](_0x13e9cc)['send'](_0x4b7321);};}exports[_0x372e('0x27')]=function(_0x24e524,_0x595b78){var _0x2cdde3={},_0x42ca8f={},_0x453ed4={'count':0x0,'rows':[]};var _0x52e93c=_['map'](db['VtigerConfiguration']['rawAttributes'],function(_0xee8dde){return{'name':_0xee8dde[_0x372e('0x28')],'type':_0xee8dde[_0x372e('0x29')][_0x372e('0x2a')]};});_0x42ca8f[_0x372e('0x2b')]=_[_0x372e('0x2c')](_0x52e93c,_0x372e('0x26'));_0x42ca8f[_0x372e('0x2d')]=_['keys'](_0x24e524[_0x372e('0x2d')]);_0x42ca8f[_0x372e('0x2e')]=_[_0x372e('0x2f')](_0x42ca8f[_0x372e('0x2b')],_0x42ca8f[_0x372e('0x2d')]);_0x2cdde3['attributes']=_[_0x372e('0x2f')](_0x42ca8f[_0x372e('0x2b')],qs[_0x372e('0x30')](_0x24e524[_0x372e('0x2d')][_0x372e('0x30')]));_0x2cdde3[_0x372e('0x31')]=_0x2cdde3[_0x372e('0x31')]['length']?_0x2cdde3[_0x372e('0x31')]:_0x42ca8f[_0x372e('0x2b')];if(!_0x24e524[_0x372e('0x2d')][_0x372e('0x32')](_0x372e('0x33'))){_0x2cdde3[_0x372e('0x1a')]=qs[_0x372e('0x1a')](_0x24e524[_0x372e('0x2d')]['limit']);_0x2cdde3['offset']=qs[_0x372e('0x19')](_0x24e524[_0x372e('0x2d')][_0x372e('0x19')]);}_0x2cdde3[_0x372e('0x34')]=qs['sort'](_0x24e524[_0x372e('0x2d')]['sort']);_0x2cdde3[_0x372e('0x35')]=qs['filters'](_[_0x372e('0x36')](_0x24e524[_0x372e('0x2d')],_0x42ca8f[_0x372e('0x2e')]),_0x52e93c);if(_0x24e524[_0x372e('0x2d')]['filter']){_0x2cdde3[_0x372e('0x35')]=_[_0x372e('0x37')](_0x2cdde3[_0x372e('0x35')],{'$or':_['map'](_0x52e93c,function(_0x21e977){if(_0x21e977[_0x372e('0x29')]!==_0x372e('0x38')){var _0x3f7adc={};_0x3f7adc[_0x21e977[_0x372e('0x26')]]={'$like':'%'+_0x24e524[_0x372e('0x2d')]['filter']+'%'};return _0x3f7adc;}})});}_0x2cdde3=_[_0x372e('0x37')]({},_0x2cdde3,_0x24e524[_0x372e('0x39')]);var _0x50c042={'where':_0x2cdde3[_0x372e('0x35')]};return db['VtigerConfiguration']['count'](_0x50c042)[_0x372e('0x21')](function(_0x44fc77){_0x453ed4[_0x372e('0x1c')]=_0x44fc77;if(_0x24e524['query']['includeAll']){_0x2cdde3[_0x372e('0x3a')]=[{'all':!![]}];}return db[_0x372e('0x3b')][_0x372e('0x3c')](_0x2cdde3);})[_0x372e('0x21')](function(_0x96e129){_0x453ed4[_0x372e('0x3d')]=_0x96e129;return _0x453ed4;})['then'](respondWithFilteredResult(_0x595b78,_0x2cdde3))[_0x372e('0x3e')](handleError(_0x595b78,null));};exports[_0x372e('0x3f')]=function(_0x291023,_0x3768c2){var _0x57765a={'raw':![],'where':{'id':_0x291023['params']['id']}},_0x2edeeb={};_0x2edeeb[_0x372e('0x2b')]=_[_0x372e('0x40')](db[_0x372e('0x3b')][_0x372e('0x41')]);_0x2edeeb[_0x372e('0x2d')]=_['keys'](_0x291023[_0x372e('0x2d')]);_0x2edeeb[_0x372e('0x2e')]=_['intersection'](_0x2edeeb[_0x372e('0x2b')],_0x2edeeb[_0x372e('0x2d')]);_0x57765a[_0x372e('0x31')]=_[_0x372e('0x2f')](_0x2edeeb['model'],qs['fields'](_0x291023[_0x372e('0x2d')]['fields']));_0x57765a[_0x372e('0x31')]=_0x57765a['attributes']['length']?_0x57765a[_0x372e('0x31')]:_0x2edeeb[_0x372e('0x2b')];if(_0x291023[_0x372e('0x2d')][_0x372e('0x42')]){_0x57765a['include']=[{'all':!![]}];}_0x57765a=_['merge']({},_0x57765a,_0x291023[_0x372e('0x39')]);return db[_0x372e('0x3b')][_0x372e('0x43')](_0x57765a)['then'](handleEntityNotFound(_0x3768c2,null))[_0x372e('0x21')](respondWithResult(_0x3768c2,null))['catch'](handleError(_0x3768c2,null));};exports['create']=function(_0x299a60,_0x1d696d){return db[_0x372e('0x3b')][_0x372e('0x44')](_0x299a60[_0x372e('0x45')],{})[_0x372e('0x21')](respondWithResult(_0x1d696d,0xc9))[_0x372e('0x3e')](handleError(_0x1d696d,null));};exports[_0x372e('0x20')]=function(_0x117627,_0x3e651e){if(_0x117627[_0x372e('0x45')]['id']){delete _0x117627[_0x372e('0x45')]['id'];}return db[_0x372e('0x3b')][_0x372e('0x43')]({'where':{'id':_0x117627[_0x372e('0x46')]['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x3e651e,null))[_0x372e('0x21')](saveUpdates(_0x117627[_0x372e('0x45')],null))[_0x372e('0x21')](respondWithResult(_0x3e651e,null))[_0x372e('0x3e')](handleError(_0x3e651e,null));};exports['destroy']=function(_0x4ee5fe,_0x525111){return db[_0x372e('0x3b')]['find']({'where':{'id':_0x4ee5fe['params']['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x525111,null))[_0x372e('0x21')](removeEntity(_0x525111,null))[_0x372e('0x3e')](handleError(_0x525111,null));};exports['getFields']=function(_0x966604,_0x2de533,_0x20f605){var _0x209c4d={};var _0x1dc76f={};var _0x463311;var _0x50eedd;return db['VtigerConfiguration'][_0x372e('0x47')]({'where':{'id':_0x966604[_0x372e('0x46')]['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x2de533,null))[_0x372e('0x21')](function(_0x5a1767){if(_0x5a1767){_0x463311=_0x5a1767;_0x1dc76f[_0x372e('0x2b')]=_[_0x372e('0x40')](db['VtigerField'][_0x372e('0x41')]);_0x1dc76f[_0x372e('0x2d')]=_['keys'](_0x966604[_0x372e('0x2d')]);_0x1dc76f['filters']=_['intersection'](_0x1dc76f[_0x372e('0x2b')],_0x1dc76f[_0x372e('0x2d')]);_0x209c4d[_0x372e('0x31')]=_['intersection'](_0x1dc76f[_0x372e('0x2b')],qs['fields'](_0x966604['query'][_0x372e('0x30')]));_0x209c4d['attributes']=_0x209c4d[_0x372e('0x31')][_0x372e('0x48')]?_0x209c4d['attributes']:_0x1dc76f[_0x372e('0x2b')];_0x209c4d[_0x372e('0x34')]=qs['sort'](_0x966604[_0x372e('0x2d')][_0x372e('0x49')]);_0x209c4d[_0x372e('0x35')]=qs['filters'](_[_0x372e('0x36')](_0x966604['query'],_0x1dc76f[_0x372e('0x2e')]));if(_0x966604[_0x372e('0x2d')][_0x372e('0x4a')]){_0x209c4d[_0x372e('0x35')]=_[_0x372e('0x37')](_0x209c4d['where'],{'$or':_[_0x372e('0x2c')](_0x209c4d[_0x372e('0x31')],function(_0x388c35){var _0x5958c8={};_0x5958c8[_0x388c35]={'$like':'%'+_0x966604['query']['filter']+'%'};return _0x5958c8;})});}_0x209c4d=_[_0x372e('0x37')]({},_0x209c4d,_0x966604[_0x372e('0x39')]);return _0x463311[_0x372e('0x4b')](_0x209c4d);}})[_0x372e('0x21')](function(_0x31d129){if(_0x31d129){_0x50eedd=_0x31d129[_0x372e('0x48')];if(!_0x966604['query'][_0x372e('0x32')](_0x372e('0x33'))){_0x209c4d['limit']=qs[_0x372e('0x1a')](_0x966604['query'][_0x372e('0x1a')]);_0x209c4d[_0x372e('0x19')]=qs[_0x372e('0x19')](_0x966604[_0x372e('0x2d')][_0x372e('0x19')]);}return _0x463311[_0x372e('0x4b')](_0x209c4d);}})[_0x372e('0x21')](function(_0x461cc5){if(_0x461cc5){return _0x461cc5?{'count':_0x50eedd,'rows':_0x461cc5}:null;}})[_0x372e('0x21')](respondWithResult(_0x2de533,null))[_0x372e('0x3e')](handleError(_0x2de533,null));};exports[_0x372e('0x4c')]=function(_0x1648f0,_0x1e7611,_0x540e3b){var _0x538255={};var _0x22bc6c={};var _0x4d066f;var _0x1dbd12;return db[_0x372e('0x3b')][_0x372e('0x47')]({'where':{'id':_0x1648f0[_0x372e('0x46')]['id']}})['then'](handleEntityNotFound(_0x1e7611,null))[_0x372e('0x21')](function(_0x5902ad){if(_0x5902ad){_0x4d066f=_0x5902ad;_0x22bc6c[_0x372e('0x2b')]=_['keys'](db[_0x372e('0x4d')][_0x372e('0x41')]);_0x22bc6c[_0x372e('0x2d')]=_[_0x372e('0x40')](_0x1648f0[_0x372e('0x2d')]);_0x22bc6c['filters']=_[_0x372e('0x2f')](_0x22bc6c[_0x372e('0x2b')],_0x22bc6c[_0x372e('0x2d')]);_0x538255['attributes']=_[_0x372e('0x2f')](_0x22bc6c[_0x372e('0x2b')],qs['fields'](_0x1648f0['query'][_0x372e('0x30')]));_0x538255[_0x372e('0x31')]=_0x538255[_0x372e('0x31')][_0x372e('0x48')]?_0x538255[_0x372e('0x31')]:_0x22bc6c[_0x372e('0x2b')];_0x538255[_0x372e('0x34')]=qs['sort'](_0x1648f0[_0x372e('0x2d')][_0x372e('0x49')]);_0x538255[_0x372e('0x35')]=qs[_0x372e('0x2e')](_[_0x372e('0x36')](_0x1648f0['query'],_0x22bc6c[_0x372e('0x2e')]));if(_0x1648f0[_0x372e('0x2d')]['filter']){_0x538255[_0x372e('0x35')]=_[_0x372e('0x37')](_0x538255[_0x372e('0x35')],{'$or':_['map'](_0x538255[_0x372e('0x31')],function(_0x188f96){var _0x204bb7={};_0x204bb7[_0x188f96]={'$like':'%'+_0x1648f0[_0x372e('0x2d')][_0x372e('0x4a')]+'%'};return _0x204bb7;})});}_0x538255=_[_0x372e('0x37')]({},_0x538255,_0x1648f0['options']);return _0x4d066f[_0x372e('0x4c')](_0x538255);}})[_0x372e('0x21')](function(_0x368680){if(_0x368680){_0x1dbd12=_0x368680['length'];if(!_0x1648f0[_0x372e('0x2d')][_0x372e('0x32')](_0x372e('0x33'))){_0x538255[_0x372e('0x1a')]=qs[_0x372e('0x1a')](_0x1648f0['query'][_0x372e('0x1a')]);_0x538255[_0x372e('0x19')]=qs[_0x372e('0x19')](_0x1648f0['query'][_0x372e('0x19')]);}return _0x4d066f[_0x372e('0x4c')](_0x538255);}})[_0x372e('0x21')](function(_0x113072){if(_0x113072){return _0x113072?{'count':_0x1dbd12,'rows':_0x113072}:null;}})[_0x372e('0x21')](respondWithResult(_0x1e7611,null))[_0x372e('0x3e')](handleError(_0x1e7611,null));};exports[_0x372e('0x4e')]=function(_0xb4a76f,_0x392335,_0x393886){var _0x2f12d4={};var _0x51f111={};var _0x3d01e7;var _0xc6f05f;return db[_0x372e('0x3b')][_0x372e('0x47')]({'where':{'id':_0xb4a76f[_0x372e('0x46')]['id']}})[_0x372e('0x21')](handleEntityNotFound(_0x392335,null))[_0x372e('0x21')](function(_0x4964e6){if(_0x4964e6){_0x3d01e7=_0x4964e6;_0x51f111[_0x372e('0x2b')]=_[_0x372e('0x40')](db['VtigerField'][_0x372e('0x41')]);_0x51f111[_0x372e('0x2d')]=_[_0x372e('0x40')](_0xb4a76f[_0x372e('0x2d')]);_0x51f111['filters']=_[_0x372e('0x2f')](_0x51f111[_0x372e('0x2b')],_0x51f111[_0x372e('0x2d')]);_0x2f12d4[_0x372e('0x31')]=_[_0x372e('0x2f')](_0x51f111[_0x372e('0x2b')],qs[_0x372e('0x30')](_0xb4a76f[_0x372e('0x2d')][_0x372e('0x30')]));_0x2f12d4['attributes']=_0x2f12d4['attributes'][_0x372e('0x48')]?_0x2f12d4[_0x372e('0x31')]:_0x51f111[_0x372e('0x2b')];_0x2f12d4[_0x372e('0x34')]=qs[_0x372e('0x49')](_0xb4a76f[_0x372e('0x2d')][_0x372e('0x49')]);_0x2f12d4['where']=qs[_0x372e('0x2e')](_[_0x372e('0x36')](_0xb4a76f[_0x372e('0x2d')],_0x51f111[_0x372e('0x2e')]));if(_0xb4a76f[_0x372e('0x2d')][_0x372e('0x4a')]){_0x2f12d4[_0x372e('0x35')]=_['merge'](_0x2f12d4['where'],{'$or':_[_0x372e('0x2c')](_0x2f12d4['attributes'],function(_0x1fe72b){var _0x3973b8={};_0x3973b8[_0x1fe72b]={'$like':'%'+_0xb4a76f['query'][_0x372e('0x4a')]+'%'};return _0x3973b8;})});}_0x2f12d4=_['merge']({},_0x2f12d4,_0xb4a76f[_0x372e('0x39')]);return _0x3d01e7[_0x372e('0x4e')](_0x2f12d4);}})[_0x372e('0x21')](function(_0x1ee327){if(_0x1ee327){_0xc6f05f=_0x1ee327[_0x372e('0x48')];if(!_0xb4a76f[_0x372e('0x2d')][_0x372e('0x32')](_0x372e('0x33'))){_0x2f12d4[_0x372e('0x1a')]=qs[_0x372e('0x1a')](_0xb4a76f[_0x372e('0x2d')][_0x372e('0x1a')]);_0x2f12d4[_0x372e('0x19')]=qs[_0x372e('0x19')](_0xb4a76f[_0x372e('0x2d')]['offset']);}return _0x3d01e7[_0x372e('0x4e')](_0x2f12d4);}})[_0x372e('0x21')](function(_0x240586){if(_0x240586){return _0x240586?{'count':_0xc6f05f,'rows':_0x240586}:null;}})['then'](respondWithResult(_0x392335,null))[_0x372e('0x3e')](handleError(_0x392335,null));};
\ No newline at end of file
+var _0x04cc=['hasOwnProperty','nolimit','order','sort','where','pick','filters','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','reject','save','update','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','model','query','intersection','attributes','fields','length'];(function(_0x388a72,_0x360390){var _0x2e0326=function(_0x93b95f){while(--_0x93b95f){_0x388a72['push'](_0x388a72['shift']());}};_0x2e0326(++_0x360390);}(_0x04cc,0x10d));var _0xc04c=function(_0x4b0830,_0x2e3b0a){_0x4b0830=_0x4b0830-0x0;var _0x1f53a7=_0x04cc[_0x4b0830];return _0x1f53a7;};'use strict';var emlformat=require(_0xc04c('0x0'));var rimraf=require(_0xc04c('0x1'));var zipdir=require(_0xc04c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc04c('0x3'));var moment=require(_0xc04c('0x4'));var BPromise=require(_0xc04c('0x5'));var Mustache=require(_0xc04c('0x6'));var util=require(_0xc04c('0x7'));var path=require('path');var sox=require(_0xc04c('0x8'));var csv=require('to-csv');var ejs=require(_0xc04c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc04c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc04c('0xb'));var deskjs=require(_0xc04c('0xc'));var toCsv=require(_0xc04c('0xd'));var querystring=require(_0xc04c('0xe'));var Papa=require(_0xc04c('0xf'));var Redis=require(_0xc04c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc04c('0x11'));var as=require(_0xc04c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc04c('0x13'))('api');var utils=require(_0xc04c('0x14'));var config=require(_0xc04c('0x15'));var licenseUtil=require(_0xc04c('0x16'));var db=require(_0xc04c('0x17'))['db'];function respondWithStatusCode(_0x2017b8,_0x47170c){_0x47170c=_0x47170c||0xcc;return function(_0x3c751d){if(_0x3c751d){return _0x2017b8[_0xc04c('0x18')](_0x47170c);}return _0x2017b8['status'](_0x47170c)[_0xc04c('0x19')]();};}function respondWithResult(_0x1ab9c5,_0x300305){_0x300305=_0x300305||0xc8;return function(_0x33e121){if(_0x33e121){return _0x1ab9c5['status'](_0x300305)[_0xc04c('0x1a')](_0x33e121);}};}function respondWithFilteredResult(_0x4904a9,_0x42c342){return function(_0x3a8681){if(_0x3a8681){var _0x49a51d=typeof _0x42c342[_0xc04c('0x1b')]==='undefined'&&typeof _0x42c342[_0xc04c('0x1c')]===_0xc04c('0x1d');var _0x777fd6=_0x3a8681[_0xc04c('0x1e')];var _0x34757a=_0x49a51d?0x0:_0x42c342['offset'];var _0x14d60e=_0x49a51d?_0x3a8681[_0xc04c('0x1e')]:_0x42c342[_0xc04c('0x1b')]+_0x42c342[_0xc04c('0x1c')];var _0xd2f90a;if(_0x14d60e>=_0x777fd6){_0x14d60e=_0x777fd6;_0xd2f90a=0xc8;}else{_0xd2f90a=0xce;}_0x4904a9[_0xc04c('0x1f')](_0xd2f90a);return _0x4904a9['set'](_0xc04c('0x20'),_0x34757a+'-'+_0x14d60e+'/'+_0x777fd6)[_0xc04c('0x1a')](_0x3a8681);}return null;};}function patchUpdates(_0x4e4bea){return function(_0x4521d8){try{jsonpatch['apply'](_0x4521d8,_0x4e4bea,!![]);}catch(_0x34198f){return BPromise[_0xc04c('0x21')](_0x34198f);}return _0x4521d8[_0xc04c('0x22')]();};}function saveUpdates(_0x40ee57,_0xb312da){return function(_0x249279){if(_0x249279){return _0x249279[_0xc04c('0x23')](_0x40ee57)[_0xc04c('0x24')](function(_0x391dd8){return _0x391dd8;});}return null;};}function removeEntity(_0x2dac80,_0x5a847a){return function(_0x51ad1d){if(_0x51ad1d){return _0x51ad1d['destroy']()[_0xc04c('0x24')](function(){_0x2dac80[_0xc04c('0x1f')](0xcc)[_0xc04c('0x19')]();});}};}function handleEntityNotFound(_0x2d72c6,_0x1bfe35){return function(_0x398253){if(!_0x398253){_0x2d72c6[_0xc04c('0x18')](0x194);}return _0x398253;};}function handleError(_0x5db434,_0x3cf428){_0x3cf428=_0x3cf428||0x1f4;return function(_0xa467a0){logger['error'](_0xa467a0[_0xc04c('0x25')]);if(_0xa467a0[_0xc04c('0x26')]){delete _0xa467a0['name'];}_0x5db434[_0xc04c('0x1f')](_0x3cf428)[_0xc04c('0x27')](_0xa467a0);};}exports[_0xc04c('0x28')]=function(_0x31f038,_0x321c98){var _0x24d70a={},_0x2eb512={},_0x9597d6={'count':0x0,'rows':[]};var _0xefaabb=_[_0xc04c('0x29')](db[_0xc04c('0x2a')][_0xc04c('0x2b')],function(_0x440904){return{'name':_0x440904[_0xc04c('0x2c')],'type':_0x440904['type']['key']};});_0x2eb512[_0xc04c('0x2d')]=_[_0xc04c('0x29')](_0xefaabb,_0xc04c('0x26'));_0x2eb512[_0xc04c('0x2e')]=_['keys'](_0x31f038['query']);_0x2eb512['filters']=_[_0xc04c('0x2f')](_0x2eb512[_0xc04c('0x2d')],_0x2eb512[_0xc04c('0x2e')]);_0x24d70a[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x2eb512['model'],qs['fields'](_0x31f038['query'][_0xc04c('0x31')]));_0x24d70a['attributes']=_0x24d70a[_0xc04c('0x30')][_0xc04c('0x32')]?_0x24d70a[_0xc04c('0x30')]:_0x2eb512['model'];if(!_0x31f038[_0xc04c('0x2e')][_0xc04c('0x33')](_0xc04c('0x34'))){_0x24d70a[_0xc04c('0x1c')]=qs['limit'](_0x31f038['query'][_0xc04c('0x1c')]);_0x24d70a[_0xc04c('0x1b')]=qs[_0xc04c('0x1b')](_0x31f038[_0xc04c('0x2e')]['offset']);}_0x24d70a[_0xc04c('0x35')]=qs[_0xc04c('0x36')](_0x31f038[_0xc04c('0x2e')][_0xc04c('0x36')]);_0x24d70a[_0xc04c('0x37')]=qs['filters'](_[_0xc04c('0x38')](_0x31f038[_0xc04c('0x2e')],_0x2eb512[_0xc04c('0x39')]),_0xefaabb);if(_0x31f038['query']['filter']){_0x24d70a['where']=_['merge'](_0x24d70a[_0xc04c('0x37')],{'$or':_[_0xc04c('0x29')](_0xefaabb,function(_0xd5ddb2){if(_0xd5ddb2[_0xc04c('0x3a')]!==_0xc04c('0x3b')){var _0x2b2381={};_0x2b2381[_0xd5ddb2['name']]={'$like':'%'+_0x31f038['query'][_0xc04c('0x3c')]+'%'};return _0x2b2381;}})});}_0x24d70a=_[_0xc04c('0x3d')]({},_0x24d70a,_0x31f038[_0xc04c('0x3e')]);var _0x2d134b={'where':_0x24d70a[_0xc04c('0x37')]};return db[_0xc04c('0x2a')]['count'](_0x2d134b)[_0xc04c('0x24')](function(_0x112341){_0x9597d6[_0xc04c('0x1e')]=_0x112341;if(_0x31f038[_0xc04c('0x2e')][_0xc04c('0x3f')]){_0x24d70a[_0xc04c('0x40')]=[{'all':!![]}];}return db[_0xc04c('0x2a')][_0xc04c('0x41')](_0x24d70a);})[_0xc04c('0x24')](function(_0x2cc841){_0x9597d6[_0xc04c('0x42')]=_0x2cc841;return _0x9597d6;})['then'](respondWithFilteredResult(_0x321c98,_0x24d70a))[_0xc04c('0x43')](handleError(_0x321c98,null));};exports[_0xc04c('0x44')]=function(_0x5001a8,_0x56867c){var _0x50acc0={'raw':![],'where':{'id':_0x5001a8[_0xc04c('0x45')]['id']}},_0x2fd562={};_0x2fd562[_0xc04c('0x2d')]=_[_0xc04c('0x46')](db[_0xc04c('0x2a')][_0xc04c('0x2b')]);_0x2fd562[_0xc04c('0x2e')]=_[_0xc04c('0x46')](_0x5001a8[_0xc04c('0x2e')]);_0x2fd562[_0xc04c('0x39')]=_['intersection'](_0x2fd562['model'],_0x2fd562[_0xc04c('0x2e')]);_0x50acc0[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x2fd562['model'],qs[_0xc04c('0x31')](_0x5001a8[_0xc04c('0x2e')][_0xc04c('0x31')]));_0x50acc0[_0xc04c('0x30')]=_0x50acc0[_0xc04c('0x30')][_0xc04c('0x32')]?_0x50acc0[_0xc04c('0x30')]:_0x2fd562[_0xc04c('0x2d')];if(_0x5001a8['query'][_0xc04c('0x3f')]){_0x50acc0['include']=[{'all':!![]}];}_0x50acc0=_[_0xc04c('0x3d')]({},_0x50acc0,_0x5001a8[_0xc04c('0x3e')]);return db[_0xc04c('0x2a')][_0xc04c('0x47')](_0x50acc0)[_0xc04c('0x24')](handleEntityNotFound(_0x56867c,null))[_0xc04c('0x24')](respondWithResult(_0x56867c,null))['catch'](handleError(_0x56867c,null));};exports[_0xc04c('0x48')]=function(_0x39d6c5,_0x2e9558){return db[_0xc04c('0x2a')][_0xc04c('0x48')](_0x39d6c5[_0xc04c('0x49')],{})['then'](respondWithResult(_0x2e9558,0xc9))['catch'](handleError(_0x2e9558,null));};exports[_0xc04c('0x23')]=function(_0x540bfb,_0xa5f3f){if(_0x540bfb[_0xc04c('0x49')]['id']){delete _0x540bfb[_0xc04c('0x49')]['id'];}return db[_0xc04c('0x2a')][_0xc04c('0x47')]({'where':{'id':_0x540bfb[_0xc04c('0x45')]['id']}})[_0xc04c('0x24')](handleEntityNotFound(_0xa5f3f,null))[_0xc04c('0x24')](saveUpdates(_0x540bfb[_0xc04c('0x49')],null))[_0xc04c('0x24')](respondWithResult(_0xa5f3f,null))['catch'](handleError(_0xa5f3f,null));};exports[_0xc04c('0x4a')]=function(_0x4dc174,_0x407cc3){return db['VtigerConfiguration'][_0xc04c('0x47')]({'where':{'id':_0x4dc174[_0xc04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x407cc3,null))[_0xc04c('0x24')](removeEntity(_0x407cc3,null))[_0xc04c('0x43')](handleError(_0x407cc3,null));};exports[_0xc04c('0x4b')]=function(_0x619fe3,_0x168252,_0xf8ad5b){var _0x52edd1={};var _0x3fac3b={};var _0x3801ed;var _0x19dd09;return db[_0xc04c('0x2a')][_0xc04c('0x4c')]({'where':{'id':_0x619fe3[_0xc04c('0x45')]['id']}})[_0xc04c('0x24')](handleEntityNotFound(_0x168252,null))['then'](function(_0x395100){if(_0x395100){_0x3801ed=_0x395100;_0x3fac3b[_0xc04c('0x2d')]=_['keys'](db[_0xc04c('0x4d')][_0xc04c('0x2b')]);_0x3fac3b[_0xc04c('0x2e')]=_[_0xc04c('0x46')](_0x619fe3[_0xc04c('0x2e')]);_0x3fac3b[_0xc04c('0x39')]=_[_0xc04c('0x2f')](_0x3fac3b[_0xc04c('0x2d')],_0x3fac3b[_0xc04c('0x2e')]);_0x52edd1[_0xc04c('0x30')]=_['intersection'](_0x3fac3b['model'],qs[_0xc04c('0x31')](_0x619fe3[_0xc04c('0x2e')]['fields']));_0x52edd1[_0xc04c('0x30')]=_0x52edd1[_0xc04c('0x30')][_0xc04c('0x32')]?_0x52edd1['attributes']:_0x3fac3b[_0xc04c('0x2d')];_0x52edd1['order']=qs[_0xc04c('0x36')](_0x619fe3[_0xc04c('0x2e')][_0xc04c('0x36')]);_0x52edd1['where']=qs[_0xc04c('0x39')](_['pick'](_0x619fe3[_0xc04c('0x2e')],_0x3fac3b[_0xc04c('0x39')]));if(_0x619fe3['query'][_0xc04c('0x3c')]){_0x52edd1[_0xc04c('0x37')]=_['merge'](_0x52edd1[_0xc04c('0x37')],{'$or':_[_0xc04c('0x29')](_0x52edd1[_0xc04c('0x30')],function(_0x2e7209){var _0x33d90a={};_0x33d90a[_0x2e7209]={'$like':'%'+_0x619fe3['query']['filter']+'%'};return _0x33d90a;})});}_0x52edd1=_[_0xc04c('0x3d')]({},_0x52edd1,_0x619fe3[_0xc04c('0x3e')]);return _0x3801ed[_0xc04c('0x4b')](_0x52edd1);}})[_0xc04c('0x24')](function(_0x341213){if(_0x341213){_0x19dd09=_0x341213[_0xc04c('0x32')];if(!_0x619fe3[_0xc04c('0x2e')]['hasOwnProperty'](_0xc04c('0x34'))){_0x52edd1[_0xc04c('0x1c')]=qs[_0xc04c('0x1c')](_0x619fe3[_0xc04c('0x2e')][_0xc04c('0x1c')]);_0x52edd1[_0xc04c('0x1b')]=qs[_0xc04c('0x1b')](_0x619fe3[_0xc04c('0x2e')][_0xc04c('0x1b')]);}return _0x3801ed[_0xc04c('0x4b')](_0x52edd1);}})[_0xc04c('0x24')](function(_0x64372d){if(_0x64372d){return _0x64372d?{'count':_0x19dd09,'rows':_0x64372d}:null;}})[_0xc04c('0x24')](respondWithResult(_0x168252,null))[_0xc04c('0x43')](handleError(_0x168252,null));};exports[_0xc04c('0x4e')]=function(_0x337537,_0x187776,_0x24b06c){var _0xeae454={};var _0x3b892a={};var _0x51a25c;var _0x56cbae;return db['VtigerConfiguration'][_0xc04c('0x4c')]({'where':{'id':_0x337537[_0xc04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x187776,null))[_0xc04c('0x24')](function(_0x3e6c09){if(_0x3e6c09){_0x51a25c=_0x3e6c09;_0x3b892a['model']=_[_0xc04c('0x46')](db[_0xc04c('0x4d')]['rawAttributes']);_0x3b892a[_0xc04c('0x2e')]=_['keys'](_0x337537[_0xc04c('0x2e')]);_0x3b892a[_0xc04c('0x39')]=_[_0xc04c('0x2f')](_0x3b892a['model'],_0x3b892a[_0xc04c('0x2e')]);_0xeae454[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x3b892a['model'],qs[_0xc04c('0x31')](_0x337537['query'][_0xc04c('0x31')]));_0xeae454['attributes']=_0xeae454['attributes'][_0xc04c('0x32')]?_0xeae454[_0xc04c('0x30')]:_0x3b892a[_0xc04c('0x2d')];_0xeae454[_0xc04c('0x35')]=qs[_0xc04c('0x36')](_0x337537[_0xc04c('0x2e')][_0xc04c('0x36')]);_0xeae454['where']=qs[_0xc04c('0x39')](_[_0xc04c('0x38')](_0x337537[_0xc04c('0x2e')],_0x3b892a[_0xc04c('0x39')]));if(_0x337537[_0xc04c('0x2e')][_0xc04c('0x3c')]){_0xeae454['where']=_['merge'](_0xeae454[_0xc04c('0x37')],{'$or':_['map'](_0xeae454[_0xc04c('0x30')],function(_0x34a018){var _0x55e983={};_0x55e983[_0x34a018]={'$like':'%'+_0x337537['query'][_0xc04c('0x3c')]+'%'};return _0x55e983;})});}_0xeae454=_[_0xc04c('0x3d')]({},_0xeae454,_0x337537[_0xc04c('0x3e')]);return _0x51a25c[_0xc04c('0x4e')](_0xeae454);}})[_0xc04c('0x24')](function(_0x4d85a2){if(_0x4d85a2){_0x56cbae=_0x4d85a2[_0xc04c('0x32')];if(!_0x337537['query'][_0xc04c('0x33')](_0xc04c('0x34'))){_0xeae454[_0xc04c('0x1c')]=qs['limit'](_0x337537[_0xc04c('0x2e')][_0xc04c('0x1c')]);_0xeae454[_0xc04c('0x1b')]=qs[_0xc04c('0x1b')](_0x337537['query'][_0xc04c('0x1b')]);}return _0x51a25c['getSubjects'](_0xeae454);}})['then'](function(_0x580cd7){if(_0x580cd7){return _0x580cd7?{'count':_0x56cbae,'rows':_0x580cd7}:null;}})['then'](respondWithResult(_0x187776,null))[_0xc04c('0x43')](handleError(_0x187776,null));};exports[_0xc04c('0x4f')]=function(_0x4af904,_0x2b7edd,_0x28aabb){var _0x96a9ee={};var _0x498858={};var _0xdf64aa;var _0x38b4c0;return db[_0xc04c('0x2a')][_0xc04c('0x4c')]({'where':{'id':_0x4af904[_0xc04c('0x45')]['id']}})[_0xc04c('0x24')](handleEntityNotFound(_0x2b7edd,null))[_0xc04c('0x24')](function(_0x3c3abf){if(_0x3c3abf){_0xdf64aa=_0x3c3abf;_0x498858['model']=_[_0xc04c('0x46')](db['VtigerField']['rawAttributes']);_0x498858[_0xc04c('0x2e')]=_['keys'](_0x4af904[_0xc04c('0x2e')]);_0x498858[_0xc04c('0x39')]=_[_0xc04c('0x2f')](_0x498858[_0xc04c('0x2d')],_0x498858['query']);_0x96a9ee[_0xc04c('0x30')]=_[_0xc04c('0x2f')](_0x498858['model'],qs['fields'](_0x4af904[_0xc04c('0x2e')]['fields']));_0x96a9ee[_0xc04c('0x30')]=_0x96a9ee[_0xc04c('0x30')][_0xc04c('0x32')]?_0x96a9ee[_0xc04c('0x30')]:_0x498858[_0xc04c('0x2d')];_0x96a9ee[_0xc04c('0x35')]=qs[_0xc04c('0x36')](_0x4af904[_0xc04c('0x2e')][_0xc04c('0x36')]);_0x96a9ee['where']=qs['filters'](_[_0xc04c('0x38')](_0x4af904[_0xc04c('0x2e')],_0x498858[_0xc04c('0x39')]));if(_0x4af904[_0xc04c('0x2e')][_0xc04c('0x3c')]){_0x96a9ee[_0xc04c('0x37')]=_[_0xc04c('0x3d')](_0x96a9ee['where'],{'$or':_[_0xc04c('0x29')](_0x96a9ee['attributes'],function(_0x38f1a7){var _0x3b7eb4={};_0x3b7eb4[_0x38f1a7]={'$like':'%'+_0x4af904['query'][_0xc04c('0x3c')]+'%'};return _0x3b7eb4;})});}_0x96a9ee=_[_0xc04c('0x3d')]({},_0x96a9ee,_0x4af904['options']);return _0xdf64aa['getDescriptions'](_0x96a9ee);}})[_0xc04c('0x24')](function(_0x5d35ce){if(_0x5d35ce){_0x38b4c0=_0x5d35ce['length'];if(!_0x4af904[_0xc04c('0x2e')][_0xc04c('0x33')]('nolimit')){_0x96a9ee['limit']=qs[_0xc04c('0x1c')](_0x4af904[_0xc04c('0x2e')][_0xc04c('0x1c')]);_0x96a9ee['offset']=qs['offset'](_0x4af904[_0xc04c('0x2e')][_0xc04c('0x1b')]);}return _0xdf64aa[_0xc04c('0x4f')](_0x96a9ee);}})[_0xc04c('0x24')](function(_0x3bad8e){if(_0x3bad8e){return _0x3bad8e?{'count':_0x38b4c0,'rows':_0x3bad8e}:null;}})['then'](respondWithResult(_0x2b7edd,null))[_0xc04c('0x43')](handleError(_0x2b7edd,null));};
\ No newline at end of file
index 3c825fb..89fdd18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe70c=['path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4d90e5,_0x148062){var _0x1dd518=function(_0x5d1bb9){while(--_0x5d1bb9){_0x4d90e5['push'](_0x4d90e5['shift']());}};_0x1dd518(++_0x148062);}(_0xe70c,0x69));var _0xce70=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe70c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xce70('0x0'));var util=require(_0xce70('0x1'));var logger=require(_0xce70('0x2'))(_0xce70('0x3'));var moment=require(_0xce70('0x4'));var BPromise=require(_0xce70('0x5'));var rp=require(_0xce70('0x6'));var fs=require('fs');var path=require(_0xce70('0x7'));var rimraf=require(_0xce70('0x8'));var config=require(_0xce70('0x9'));var attributes=require(_0xce70('0xa'));module[_0xce70('0xb')]=function(_0x4606d8,_0x4eb5f9){return _0x4606d8[_0xce70('0xc')]('VtigerConfiguration',attributes,{'tableName':_0xce70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3909=['rimraf','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3909,0x11c));var _0x9390=function(_0x10d8c7,_0xa80d12){_0x10d8c7=_0x10d8c7-0x0;var _0x4105b9=_0x3909[_0x10d8c7];return _0x4105b9;};'use strict';var _=require(_0x9390('0x0'));var util=require(_0x9390('0x1'));var logger=require('../../config/logger')(_0x9390('0x2'));var moment=require(_0x9390('0x3'));var BPromise=require(_0x9390('0x4'));var rp=require(_0x9390('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9390('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x9390('0x7')]=function(_0x249041,_0x449fc3){return _0x249041['define'](_0x9390('0x8'),attributes,{'tableName':_0x9390('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4ce73e4..40f7f74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36de=['http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0xd6239c,_0x4c2400){var _0x281c50=function(_0x5640e7){while(--_0x5640e7){_0xd6239c['push'](_0xd6239c['shift']());}};_0x281c50(++_0x4c2400);}(_0x36de,0x19a));var _0xe36d=function(_0x143659,_0x5d75f3){_0x143659=_0x143659-0x0;var _0x1f6d91=_0x36de[_0x143659];return _0x1f6d91;};'use strict';var _=require('lodash');var util=require(_0xe36d('0x0'));var moment=require(_0xe36d('0x1'));var BPromise=require(_0xe36d('0x2'));var rs=require(_0xe36d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe36d('0x4'))('rpc');var config=require(_0xe36d('0x5'));var jayson=require(_0xe36d('0x6'));var client=jayson[_0xe36d('0x7')][_0xe36d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x134dc8,_0x48fe37,_0x7a6ef){return new BPromise(function(_0x3b8e4d,_0x434b7c){return client['request'](_0x134dc8,_0x7a6ef)[_0xe36d('0x9')](function(_0x34eae9){logger[_0xe36d('0xa')](_0xe36d('0xb'),_0x48fe37,'request\x20sent');logger[_0xe36d('0xc')](_0xe36d('0xd'),_0x48fe37,_0xe36d('0xe'),JSON['stringify'](_0x34eae9));if(_0x34eae9['error']){if(_0x34eae9['error']['code']===0x1f4){logger[_0xe36d('0xf')](_0xe36d('0xb'),_0x48fe37,_0x34eae9[_0xe36d('0xf')][_0xe36d('0x10')]);return _0x434b7c(_0x34eae9[_0xe36d('0xf')][_0xe36d('0x10')]);}logger[_0xe36d('0xf')](_0xe36d('0xb'),_0x48fe37,_0x34eae9['error']['message']);return _0x3b8e4d(_0x34eae9['error'][_0xe36d('0x10')]);}else{logger[_0xe36d('0xa')](_0xe36d('0xb'),_0x48fe37,_0xe36d('0xe'));_0x3b8e4d(_0x34eae9[_0xe36d('0x11')][_0xe36d('0x10')]);}})[_0xe36d('0x12')](function(_0x310e91){logger[_0xe36d('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x48fe37,_0x310e91);_0x434b7c(_0x310e91);});});}
\ No newline at end of file
+var _0x17f2=['stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x15fd73,_0x4b68b3){var _0x54f633=function(_0x1f8003){while(--_0x1f8003){_0x15fd73['push'](_0x15fd73['shift']());}};_0x54f633(++_0x4b68b3);}(_0x17f2,0x17c));var _0x217f=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x17f2[_0x3dea7d];return _0x53919a;};'use strict';var _=require(_0x217f('0x0'));var util=require(_0x217f('0x1'));var moment=require('moment');var BPromise=require(_0x217f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x217f('0x3'));var db=require(_0x217f('0x4'))['db'];var utils=require(_0x217f('0x5'));var logger=require(_0x217f('0x6'))(_0x217f('0x7'));var config=require(_0x217f('0x8'));var jayson=require(_0x217f('0x9'));var client=jayson[_0x217f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x366df2,_0x25a493,_0x3b3709){return new BPromise(function(_0x498857,_0x20385e){return client['request'](_0x366df2,_0x3b3709)[_0x217f('0xb')](function(_0x24dbd7){logger[_0x217f('0xc')](_0x217f('0xd'),_0x25a493,'request\x20sent');logger[_0x217f('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x25a493,_0x217f('0xf'),JSON[_0x217f('0x10')](_0x24dbd7));if(_0x24dbd7['error']){if(_0x24dbd7['error'][_0x217f('0x11')]===0x1f4){logger[_0x217f('0x12')](_0x217f('0xd'),_0x25a493,_0x24dbd7[_0x217f('0x12')][_0x217f('0x13')]);return _0x20385e(_0x24dbd7['error'][_0x217f('0x13')]);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x25a493,_0x24dbd7[_0x217f('0x12')][_0x217f('0x13')]);return _0x498857(_0x24dbd7['error'][_0x217f('0x13')]);}else{logger[_0x217f('0xc')](_0x217f('0xd'),_0x25a493,'request\x20sent');_0x498857(_0x24dbd7[_0x217f('0x14')][_0x217f('0x13')]);}})[_0x217f('0x15')](function(_0x1ebe1d){logger[_0x217f('0x12')](_0x217f('0xd'),_0x25a493,_0x1ebe1d);_0x20385e(_0x1ebe1d);});});}
\ No newline at end of file
index e3760fc..969b2ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc83b=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerField.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x5c9fc7,_0x5c34b3){var _0x51cf5f=function(_0x4153a7){while(--_0x4153a7){_0x5c9fc7['push'](_0x5c9fc7['shift']());}};_0x51cf5f(++_0x5c34b3);}(_0xc83b,0x13d));var _0xbc83=function(_0x218cd7,_0x18fe6d){_0x218cd7=_0x218cd7-0x0;var _0xb5a5fb=_0xc83b[_0x218cd7];return _0xb5a5fb;};'use strict';var multer=require(_0xbc83('0x0'));var util=require(_0xbc83('0x1'));var path=require(_0xbc83('0x2'));var timeout=require(_0xbc83('0x3'));var express=require('express');var router=express[_0xbc83('0x4')]();var fs_extra=require(_0xbc83('0x5'));var auth=require(_0xbc83('0x6'));var interaction=require(_0xbc83('0x7'));var config=require('../../config/environment');var controller=require(_0xbc83('0x8'));router['get']('/',auth[_0xbc83('0x9')](),controller[_0xbc83('0xa')]);router[_0xbc83('0xb')]('/:id',auth[_0xbc83('0x9')](),controller[_0xbc83('0xc')]);router[_0xbc83('0xd')]('/',auth[_0xbc83('0x9')](),controller['create']);router[_0xbc83('0xe')](_0xbc83('0xf'),auth[_0xbc83('0x9')](),controller[_0xbc83('0x10')]);router[_0xbc83('0x11')](_0xbc83('0xf'),auth[_0xbc83('0x9')](),controller[_0xbc83('0x12')]);module[_0xbc83('0x13')]=router;
\ No newline at end of file
+var _0xa1d1=['index','show','post','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated'];(function(_0x1fb509,_0x16185c){var _0x1899d0=function(_0xfb6f6f){while(--_0xfb6f6f){_0x1fb509['push'](_0x1fb509['shift']());}};_0x1899d0(++_0x16185c);}(_0xa1d1,0x67));var _0x1a1d=function(_0x525279,_0x4092f8){_0x525279=_0x525279-0x0;var _0x1b1f05=_0xa1d1[_0x525279];return _0x1b1f05;};'use strict';var multer=require(_0x1a1d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1a1d('0x1'));var express=require(_0x1a1d('0x2'));var router=express[_0x1a1d('0x3')]();var fs_extra=require(_0x1a1d('0x4'));var auth=require(_0x1a1d('0x5'));var interaction=require(_0x1a1d('0x6'));var config=require(_0x1a1d('0x7'));var controller=require(_0x1a1d('0x8'));router[_0x1a1d('0x9')]('/',auth[_0x1a1d('0xa')](),controller[_0x1a1d('0xb')]);router['get']('/:id',auth[_0x1a1d('0xa')](),controller[_0x1a1d('0xc')]);router[_0x1a1d('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1a1d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1a1d('0xf')]);router[_0x1a1d('0x10')]('/:id',auth[_0x1a1d('0xa')](),controller[_0x1a1d('0x11')]);module[_0x1a1d('0x12')]=router;
\ No newline at end of file
index c35d93b..0ce0fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd96d=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x1cc34f,_0x27dbf2){var _0x333522=function(_0x3e4943){while(--_0x3e4943){_0x1cc34f['push'](_0x1cc34f['shift']());}};_0x333522(++_0x27dbf2);}(_0xd96d,0x19b));var _0xdd96=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd96d[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xdd96('0x0'));module['exports']={'type':{'type':Sequelize[_0xdd96('0x1')](_0xdd96('0x2'),_0xdd96('0x3'),_0xdd96('0x4'),_0xdd96('0x5'),_0xdd96('0x6')),'defaultValue':_0xdd96('0x2')},'content':{'type':Sequelize[_0xdd96('0x7')]},'key':{'type':Sequelize[_0xdd96('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdd96('0x2'),_0xdd96('0x3'),_0xdd96('0x4'))},'keyContent':{'type':Sequelize[_0xdd96('0x7')]},'idField':{'type':Sequelize[_0xdd96('0x7')]},'nameField':{'type':Sequelize[_0xdd96('0x7')]},'customField':{'type':Sequelize[_0xdd96('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdd96('0x7')]}};
\ No newline at end of file
+var _0x005a=['customVariable','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x005a,0x17c));var _0xa005=function(_0x234ac0,_0x44f8f1){_0x234ac0=_0x234ac0-0x0;var _0x882e83=_0x005a[_0x234ac0];return _0x882e83;};'use strict';var Sequelize=require(_0xa005('0x0'));module[_0xa005('0x1')]={'type':{'type':Sequelize[_0xa005('0x2')](_0xa005('0x3'),'variable',_0xa005('0x4'),'keyValue','picklist'),'defaultValue':_0xa005('0x3')},'content':{'type':Sequelize[_0xa005('0x5')]},'key':{'type':Sequelize[_0xa005('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xa005('0x3'),_0xa005('0x6'),_0xa005('0x4'))},'keyContent':{'type':Sequelize[_0xa005('0x5')]},'idField':{'type':Sequelize[_0xa005('0x5')]},'nameField':{'type':Sequelize[_0xa005('0x5')]},'customField':{'type':Sequelize[_0xa005('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa005('0x5')]}};
\ No newline at end of file
index 76b7977..d322f43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7211=['then','error','stack','name','index','map','VtigerField','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject'];(function(_0x383627,_0x5be16e){var _0x2c16a0=function(_0x569b72){while(--_0x569b72){_0x383627['push'](_0x383627['shift']());}};_0x2c16a0(++_0x5be16e);}(_0x7211,0x194));var _0x1721=function(_0x396068,_0x36f609){_0x396068=_0x396068-0x0;var _0x4b7783=_0x7211[_0x396068];return _0x4b7783;};'use strict';var emlformat=require(_0x1721('0x0'));var rimraf=require(_0x1721('0x1'));var zipdir=require(_0x1721('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1721('0x3'));var moment=require(_0x1721('0x4'));var BPromise=require(_0x1721('0x5'));var Mustache=require(_0x1721('0x6'));var util=require(_0x1721('0x7'));var path=require(_0x1721('0x8'));var sox=require(_0x1721('0x9'));var csv=require('to-csv');var ejs=require(_0x1721('0xa'));var fs=require('fs');var fs_extra=require(_0x1721('0xb'));var _=require(_0x1721('0xc'));var squel=require(_0x1721('0xd'));var crypto=require(_0x1721('0xe'));var jsforce=require(_0x1721('0xf'));var deskjs=require(_0x1721('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1721('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1721('0x12'));var hardwareService=require(_0x1721('0x13'));var logger=require(_0x1721('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x1721('0x15'));var licenseUtil=require(_0x1721('0x16'));var db=require(_0x1721('0x17'))['db'];function respondWithStatusCode(_0x3a21dd,_0x1b50ef){_0x1b50ef=_0x1b50ef||0xcc;return function(_0x562db5){if(_0x562db5){return _0x3a21dd[_0x1721('0x18')](_0x1b50ef);}return _0x3a21dd[_0x1721('0x19')](_0x1b50ef)[_0x1721('0x1a')]();};}function respondWithResult(_0x1a3c6b,_0x2d9c3d){_0x2d9c3d=_0x2d9c3d||0xc8;return function(_0x5de1d6){if(_0x5de1d6){return _0x1a3c6b[_0x1721('0x19')](_0x2d9c3d)[_0x1721('0x1b')](_0x5de1d6);}};}function respondWithFilteredResult(_0xc4cb6c,_0x499fc7){return function(_0x401408){if(_0x401408){var _0x88ce1=typeof _0x499fc7[_0x1721('0x1c')]===_0x1721('0x1d')&&typeof _0x499fc7[_0x1721('0x1e')]===_0x1721('0x1d');var _0x202325=_0x401408['count'];var _0x3c9dc5=_0x88ce1?0x0:_0x499fc7['offset'];var _0x2fb93b=_0x88ce1?_0x401408[_0x1721('0x1f')]:_0x499fc7[_0x1721('0x1c')]+_0x499fc7[_0x1721('0x1e')];var _0x4209f4;if(_0x2fb93b>=_0x202325){_0x2fb93b=_0x202325;_0x4209f4=0xc8;}else{_0x4209f4=0xce;}_0xc4cb6c['status'](_0x4209f4);return _0xc4cb6c['set']('Content-Range',_0x3c9dc5+'-'+_0x2fb93b+'/'+_0x202325)[_0x1721('0x1b')](_0x401408);}return null;};}function patchUpdates(_0x332d6e){return function(_0x3aad10){try{jsonpatch[_0x1721('0x20')](_0x3aad10,_0x332d6e,!![]);}catch(_0x31aca9){return BPromise[_0x1721('0x21')](_0x31aca9);}return _0x3aad10['save']();};}function saveUpdates(_0x3cf917,_0x58109c){return function(_0x52bf00){if(_0x52bf00){return _0x52bf00['update'](_0x3cf917)[_0x1721('0x22')](function(_0x391ff9){return _0x391ff9;});}return null;};}function removeEntity(_0x54d1ff,_0x5e311e){return function(_0x23cf4b){if(_0x23cf4b){return _0x23cf4b['destroy']()[_0x1721('0x22')](function(){_0x54d1ff[_0x1721('0x19')](0xcc)[_0x1721('0x1a')]();});}};}function handleEntityNotFound(_0x58f62d,_0x1c2239){return function(_0x5ceec4){if(!_0x5ceec4){_0x58f62d[_0x1721('0x18')](0x194);}return _0x5ceec4;};}function handleError(_0x4aa791,_0x277ac4){_0x277ac4=_0x277ac4||0x1f4;return function(_0x352b6c){logger[_0x1721('0x23')](_0x352b6c[_0x1721('0x24')]);if(_0x352b6c['name']){delete _0x352b6c[_0x1721('0x25')];}_0x4aa791['status'](_0x277ac4)['send'](_0x352b6c);};}exports[_0x1721('0x26')]=function(_0x47b22b,_0x2b832b){var _0x4004e4={},_0x24cf03={},_0x2dba6f={'count':0x0,'rows':[]};var _0x244b3d=_[_0x1721('0x27')](db[_0x1721('0x28')][_0x1721('0x29')],function(_0x36d169){return{'name':_0x36d169['fieldName'],'type':_0x36d169['type'][_0x1721('0x2a')]};});_0x24cf03['model']=_[_0x1721('0x27')](_0x244b3d,_0x1721('0x25'));_0x24cf03[_0x1721('0x2b')]=_[_0x1721('0x2c')](_0x47b22b[_0x1721('0x2b')]);_0x24cf03[_0x1721('0x2d')]=_[_0x1721('0x2e')](_0x24cf03[_0x1721('0x2f')],_0x24cf03[_0x1721('0x2b')]);_0x4004e4[_0x1721('0x30')]=_['intersection'](_0x24cf03[_0x1721('0x2f')],qs[_0x1721('0x31')](_0x47b22b[_0x1721('0x2b')][_0x1721('0x31')]));_0x4004e4[_0x1721('0x30')]=_0x4004e4['attributes'][_0x1721('0x32')]?_0x4004e4[_0x1721('0x30')]:_0x24cf03[_0x1721('0x2f')];if(!_0x47b22b[_0x1721('0x2b')][_0x1721('0x33')](_0x1721('0x34'))){_0x4004e4['limit']=qs[_0x1721('0x1e')](_0x47b22b[_0x1721('0x2b')]['limit']);_0x4004e4[_0x1721('0x1c')]=qs[_0x1721('0x1c')](_0x47b22b['query'][_0x1721('0x1c')]);}_0x4004e4[_0x1721('0x35')]=qs['sort'](_0x47b22b[_0x1721('0x2b')]['sort']);_0x4004e4[_0x1721('0x36')]=qs[_0x1721('0x2d')](_[_0x1721('0x37')](_0x47b22b[_0x1721('0x2b')],_0x24cf03[_0x1721('0x2d')]),_0x244b3d);if(_0x47b22b[_0x1721('0x2b')][_0x1721('0x38')]){_0x4004e4[_0x1721('0x36')]=_[_0x1721('0x39')](_0x4004e4[_0x1721('0x36')],{'$or':_[_0x1721('0x27')](_0x244b3d,function(_0x15cfbf){if(_0x15cfbf[_0x1721('0x3a')]!==_0x1721('0x3b')){var _0x240325={};_0x240325[_0x15cfbf[_0x1721('0x25')]]={'$like':'%'+_0x47b22b['query'][_0x1721('0x38')]+'%'};return _0x240325;}})});}_0x4004e4=_[_0x1721('0x39')]({},_0x4004e4,_0x47b22b[_0x1721('0x3c')]);var _0xe8efbe={'where':_0x4004e4[_0x1721('0x36')]};return db[_0x1721('0x28')][_0x1721('0x1f')](_0xe8efbe)[_0x1721('0x22')](function(_0x4d706e){_0x2dba6f[_0x1721('0x1f')]=_0x4d706e;if(_0x47b22b[_0x1721('0x2b')][_0x1721('0x3d')]){_0x4004e4[_0x1721('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0x1721('0x3f')](_0x4004e4);})[_0x1721('0x22')](function(_0x117865){_0x2dba6f[_0x1721('0x40')]=_0x117865;return _0x2dba6f;})[_0x1721('0x22')](respondWithFilteredResult(_0x2b832b,_0x4004e4))[_0x1721('0x41')](handleError(_0x2b832b,null));};exports[_0x1721('0x42')]=function(_0x3b006a,_0x377361){var _0x194333={'raw':!![],'where':{'id':_0x3b006a['params']['id']}},_0x43308f={};_0x43308f['model']=_[_0x1721('0x2c')](db['VtigerField']['rawAttributes']);_0x43308f[_0x1721('0x2b')]=_[_0x1721('0x2c')](_0x3b006a[_0x1721('0x2b')]);_0x43308f[_0x1721('0x2d')]=_[_0x1721('0x2e')](_0x43308f[_0x1721('0x2f')],_0x43308f[_0x1721('0x2b')]);_0x194333[_0x1721('0x30')]=_['intersection'](_0x43308f[_0x1721('0x2f')],qs['fields'](_0x3b006a[_0x1721('0x2b')][_0x1721('0x31')]));_0x194333[_0x1721('0x30')]=_0x194333[_0x1721('0x30')][_0x1721('0x32')]?_0x194333[_0x1721('0x30')]:_0x43308f[_0x1721('0x2f')];if(_0x3b006a[_0x1721('0x2b')][_0x1721('0x3d')]){_0x194333[_0x1721('0x3e')]=[{'all':!![]}];}_0x194333=_[_0x1721('0x39')]({},_0x194333,_0x3b006a[_0x1721('0x3c')]);return db['VtigerField'][_0x1721('0x43')](_0x194333)[_0x1721('0x22')](handleEntityNotFound(_0x377361,null))[_0x1721('0x22')](respondWithResult(_0x377361,null))[_0x1721('0x41')](handleError(_0x377361,null));};exports[_0x1721('0x44')]=function(_0x171e38,_0x9092cc){return db['VtigerField'][_0x1721('0x44')](_0x171e38[_0x1721('0x45')],{})[_0x1721('0x22')](respondWithResult(_0x9092cc,0xc9))[_0x1721('0x41')](handleError(_0x9092cc,null));};exports[_0x1721('0x46')]=function(_0x590d55,_0x1e0b19){if(_0x590d55[_0x1721('0x45')]['id']){delete _0x590d55[_0x1721('0x45')]['id'];}return db[_0x1721('0x28')][_0x1721('0x43')]({'where':{'id':_0x590d55[_0x1721('0x47')]['id']}})[_0x1721('0x22')](handleEntityNotFound(_0x1e0b19,null))[_0x1721('0x22')](saveUpdates(_0x590d55[_0x1721('0x45')],null))[_0x1721('0x22')](respondWithResult(_0x1e0b19,null))[_0x1721('0x41')](handleError(_0x1e0b19,null));};exports[_0x1721('0x48')]=function(_0x54f28e,_0x5088e4){return db[_0x1721('0x28')][_0x1721('0x43')]({'where':{'id':_0x54f28e[_0x1721('0x47')]['id']}})[_0x1721('0x22')](handleEntityNotFound(_0x5088e4,null))[_0x1721('0x22')](removeEntity(_0x5088e4,null))[_0x1721('0x41')](handleError(_0x5088e4,null));};
\ No newline at end of file
+var _0xb1f6=['util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','stack','name','VtigerField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','find','catch','create','update','body','destroy','rimraf','zip-dir'];(function(_0x1556ff,_0x4fd2ef){var _0x357e2e=function(_0xea81a7){while(--_0xea81a7){_0x1556ff['push'](_0x1556ff['shift']());}};_0x357e2e(++_0x4fd2ef);}(_0xb1f6,0x14d));var _0x6b1f=function(_0x226cd0,_0x4dab3b){_0x226cd0=_0x226cd0-0x0;var _0x2fcbfe=_0xb1f6[_0x226cd0];return _0x2fcbfe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b1f('0x0'));var zipdir=require(_0x6b1f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6b1f('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0x6b1f('0x3'));var ejs=require(_0x6b1f('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6b1f('0x5'));var squel=require(_0x6b1f('0x6'));var crypto=require('crypto');var jsforce=require(_0x6b1f('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x6b1f('0x3'));var querystring=require(_0x6b1f('0x8'));var Papa=require(_0x6b1f('0x9'));var Redis=require(_0x6b1f('0xa'));var authService=require('../../components/auth/service');var qs=require(_0x6b1f('0xb'));var as=require(_0x6b1f('0xc'));var hardwareService=require(_0x6b1f('0xd'));var logger=require('../../config/logger')(_0x6b1f('0xe'));var utils=require('../../config/utils');var config=require(_0x6b1f('0xf'));var licenseUtil=require(_0x6b1f('0x10'));var db=require(_0x6b1f('0x11'))['db'];function respondWithStatusCode(_0x5a8713,_0x4ce08d){_0x4ce08d=_0x4ce08d||0xcc;return function(_0x2bafa0){if(_0x2bafa0){return _0x5a8713[_0x6b1f('0x12')](_0x4ce08d);}return _0x5a8713['status'](_0x4ce08d)[_0x6b1f('0x13')]();};}function respondWithResult(_0x281582,_0x379430){_0x379430=_0x379430||0xc8;return function(_0xe1b7fd){if(_0xe1b7fd){return _0x281582[_0x6b1f('0x14')](_0x379430)[_0x6b1f('0x15')](_0xe1b7fd);}};}function respondWithFilteredResult(_0x1101df,_0x363638){return function(_0x24b042){if(_0x24b042){var _0x4a0f12=typeof _0x363638[_0x6b1f('0x16')]===_0x6b1f('0x17')&&typeof _0x363638['limit']==='undefined';var _0x5ed174=_0x24b042[_0x6b1f('0x18')];var _0x35d88b=_0x4a0f12?0x0:_0x363638[_0x6b1f('0x16')];var _0x34efc5=_0x4a0f12?_0x24b042['count']:_0x363638['offset']+_0x363638['limit'];var _0x41bd5e;if(_0x34efc5>=_0x5ed174){_0x34efc5=_0x5ed174;_0x41bd5e=0xc8;}else{_0x41bd5e=0xce;}_0x1101df[_0x6b1f('0x14')](_0x41bd5e);return _0x1101df[_0x6b1f('0x19')](_0x6b1f('0x1a'),_0x35d88b+'-'+_0x34efc5+'/'+_0x5ed174)['json'](_0x24b042);}return null;};}function patchUpdates(_0x4aa63a){return function(_0x4e5341){try{jsonpatch[_0x6b1f('0x1b')](_0x4e5341,_0x4aa63a,!![]);}catch(_0x4f1a9f){return BPromise[_0x6b1f('0x1c')](_0x4f1a9f);}return _0x4e5341[_0x6b1f('0x1d')]();};}function saveUpdates(_0x456a20,_0xbcb827){return function(_0x2c4b1b){if(_0x2c4b1b){return _0x2c4b1b['update'](_0x456a20)[_0x6b1f('0x1e')](function(_0x4a5b6a){return _0x4a5b6a;});}return null;};}function removeEntity(_0x5cdebb,_0x10a6d1){return function(_0x20495f){if(_0x20495f){return _0x20495f['destroy']()[_0x6b1f('0x1e')](function(){_0x5cdebb[_0x6b1f('0x14')](0xcc)[_0x6b1f('0x13')]();});}};}function handleEntityNotFound(_0xffb7e8,_0x16e384){return function(_0x53bba0){if(!_0x53bba0){_0xffb7e8[_0x6b1f('0x12')](0x194);}return _0x53bba0;};}function handleError(_0xef457a,_0x548115){_0x548115=_0x548115||0x1f4;return function(_0x31c27c){logger['error'](_0x31c27c[_0x6b1f('0x1f')]);if(_0x31c27c[_0x6b1f('0x20')]){delete _0x31c27c[_0x6b1f('0x20')];}_0xef457a[_0x6b1f('0x14')](_0x548115)['send'](_0x31c27c);};}exports['index']=function(_0x227f6f,_0x5e0472){var _0x901780={},_0xcf2e25={},_0x82a35={'count':0x0,'rows':[]};var _0x3a5741=_['map'](db[_0x6b1f('0x21')][_0x6b1f('0x22')],function(_0x3726c6){return{'name':_0x3726c6[_0x6b1f('0x23')],'type':_0x3726c6['type'][_0x6b1f('0x24')]};});_0xcf2e25[_0x6b1f('0x25')]=_[_0x6b1f('0x26')](_0x3a5741,'name');_0xcf2e25['query']=_[_0x6b1f('0x27')](_0x227f6f[_0x6b1f('0x28')]);_0xcf2e25[_0x6b1f('0x29')]=_[_0x6b1f('0x2a')](_0xcf2e25[_0x6b1f('0x25')],_0xcf2e25[_0x6b1f('0x28')]);_0x901780[_0x6b1f('0x2b')]=_[_0x6b1f('0x2a')](_0xcf2e25[_0x6b1f('0x25')],qs[_0x6b1f('0x2c')](_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x2c')]));_0x901780[_0x6b1f('0x2b')]=_0x901780[_0x6b1f('0x2b')][_0x6b1f('0x2d')]?_0x901780[_0x6b1f('0x2b')]:_0xcf2e25[_0x6b1f('0x25')];if(!_0x227f6f[_0x6b1f('0x28')]['hasOwnProperty'](_0x6b1f('0x2e'))){_0x901780[_0x6b1f('0x2f')]=qs['limit'](_0x227f6f[_0x6b1f('0x28')]['limit']);_0x901780[_0x6b1f('0x16')]=qs[_0x6b1f('0x16')](_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x16')]);}_0x901780[_0x6b1f('0x30')]=qs[_0x6b1f('0x31')](_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x31')]);_0x901780[_0x6b1f('0x32')]=qs['filters'](_[_0x6b1f('0x33')](_0x227f6f['query'],_0xcf2e25[_0x6b1f('0x29')]),_0x3a5741);if(_0x227f6f[_0x6b1f('0x28')][_0x6b1f('0x34')]){_0x901780[_0x6b1f('0x32')]=_[_0x6b1f('0x35')](_0x901780['where'],{'$or':_[_0x6b1f('0x26')](_0x3a5741,function(_0x219de1){if(_0x219de1[_0x6b1f('0x36')]!==_0x6b1f('0x37')){var _0x5d702b={};_0x5d702b[_0x219de1[_0x6b1f('0x20')]]={'$like':'%'+_0x227f6f[_0x6b1f('0x28')]['filter']+'%'};return _0x5d702b;}})});}_0x901780=_['merge']({},_0x901780,_0x227f6f[_0x6b1f('0x38')]);var _0x29c364={'where':_0x901780[_0x6b1f('0x32')]};return db[_0x6b1f('0x21')][_0x6b1f('0x18')](_0x29c364)[_0x6b1f('0x1e')](function(_0x27f8cd){_0x82a35[_0x6b1f('0x18')]=_0x27f8cd;if(_0x227f6f['query'][_0x6b1f('0x39')]){_0x901780[_0x6b1f('0x3a')]=[{'all':!![]}];}return db[_0x6b1f('0x21')]['findAll'](_0x901780);})['then'](function(_0x1cd4ba){_0x82a35['rows']=_0x1cd4ba;return _0x82a35;})[_0x6b1f('0x1e')](respondWithFilteredResult(_0x5e0472,_0x901780))['catch'](handleError(_0x5e0472,null));};exports[_0x6b1f('0x3b')]=function(_0x3d13b8,_0x2e74c4){var _0xfbfa56={'raw':!![],'where':{'id':_0x3d13b8[_0x6b1f('0x3c')]['id']}},_0x15b7d5={};_0x15b7d5[_0x6b1f('0x25')]=_[_0x6b1f('0x27')](db[_0x6b1f('0x21')][_0x6b1f('0x22')]);_0x15b7d5[_0x6b1f('0x28')]=_[_0x6b1f('0x27')](_0x3d13b8[_0x6b1f('0x28')]);_0x15b7d5[_0x6b1f('0x29')]=_[_0x6b1f('0x2a')](_0x15b7d5[_0x6b1f('0x25')],_0x15b7d5['query']);_0xfbfa56[_0x6b1f('0x2b')]=_[_0x6b1f('0x2a')](_0x15b7d5[_0x6b1f('0x25')],qs[_0x6b1f('0x2c')](_0x3d13b8[_0x6b1f('0x28')]['fields']));_0xfbfa56['attributes']=_0xfbfa56[_0x6b1f('0x2b')][_0x6b1f('0x2d')]?_0xfbfa56['attributes']:_0x15b7d5[_0x6b1f('0x25')];if(_0x3d13b8[_0x6b1f('0x28')][_0x6b1f('0x39')]){_0xfbfa56[_0x6b1f('0x3a')]=[{'all':!![]}];}_0xfbfa56=_['merge']({},_0xfbfa56,_0x3d13b8['options']);return db[_0x6b1f('0x21')][_0x6b1f('0x3d')](_0xfbfa56)[_0x6b1f('0x1e')](handleEntityNotFound(_0x2e74c4,null))[_0x6b1f('0x1e')](respondWithResult(_0x2e74c4,null))[_0x6b1f('0x3e')](handleError(_0x2e74c4,null));};exports[_0x6b1f('0x3f')]=function(_0x27ea30,_0x2b9cad){return db[_0x6b1f('0x21')][_0x6b1f('0x3f')](_0x27ea30['body'],{})[_0x6b1f('0x1e')](respondWithResult(_0x2b9cad,0xc9))[_0x6b1f('0x3e')](handleError(_0x2b9cad,null));};exports[_0x6b1f('0x40')]=function(_0x1c943d,_0x25c836){if(_0x1c943d['body']['id']){delete _0x1c943d[_0x6b1f('0x41')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x1c943d['params']['id']}})['then'](handleEntityNotFound(_0x25c836,null))[_0x6b1f('0x1e')](saveUpdates(_0x1c943d['body'],null))[_0x6b1f('0x1e')](respondWithResult(_0x25c836,null))[_0x6b1f('0x3e')](handleError(_0x25c836,null));};exports[_0x6b1f('0x42')]=function(_0x384fe3,_0x6dfe13){return db['VtigerField'][_0x6b1f('0x3d')]({'where':{'id':_0x384fe3['params']['id']}})[_0x6b1f('0x1e')](handleEntityNotFound(_0x6dfe13,null))[_0x6b1f('0x1e')](removeEntity(_0x6dfe13,null))['catch'](handleError(_0x6dfe13,null));};
\ No newline at end of file
index 49b2315..ce803ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc1=['vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x5bc1,0x193));var _0x15bc=function(_0x295583,_0x4756aa){_0x295583=_0x295583-0x0;var _0x4c2ae6=_0x5bc1[_0x295583];return _0x4c2ae6;};'use strict';var _=require(_0x15bc('0x0'));var util=require(_0x15bc('0x1'));var logger=require(_0x15bc('0x2'))(_0x15bc('0x3'));var moment=require(_0x15bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x15bc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15bc('0x6'));var config=require(_0x15bc('0x7'));var attributes=require(_0x15bc('0x8'));module[_0x15bc('0x9')]=function(_0x11e88c,_0x394641){return _0x11e88c[_0x15bc('0xa')](_0x15bc('0xb'),attributes,{'tableName':_0x15bc('0xc'),'paranoid':![],'indexes':[{'name':_0x15bc('0xd'),'fields':[_0x15bc('0xe'),_0x15bc('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9677=['path','rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird'];(function(_0x41ccec,_0x273430){var _0x5c3eb2=function(_0x217238){while(--_0x217238){_0x41ccec['push'](_0x41ccec['shift']());}};_0x5c3eb2(++_0x273430);}(_0x9677,0x1ea));var _0x7967=function(_0x34c825,_0x44cad4){_0x34c825=_0x34c825-0x0;var _0x2fde13=_0x9677[_0x34c825];return _0x2fde13;};'use strict';var _=require(_0x7967('0x0'));var util=require(_0x7967('0x1'));var logger=require(_0x7967('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7967('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7967('0x4'));var rimraf=require(_0x7967('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x7967('0x6')]=function(_0x1db010,_0x4df0ed){return _0x1db010[_0x7967('0x7')](_0x7967('0x8'),attributes,{'tableName':_0x7967('0x9'),'paranoid':![],'indexes':[{'name':_0x7967('0xa'),'fields':[_0x7967('0xb'),_0x7967('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 09f7d94..b50d20e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb50e=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x58755a,_0x44f1b8){var _0x27d13a=function(_0x4d0546){while(--_0x4d0546){_0x58755a['push'](_0x58755a['shift']());}};_0x27d13a(++_0x44f1b8);}(_0xb50e,0xee));var _0xeb50=function(_0x216c2f,_0xaf2d0e){_0x216c2f=_0x216c2f-0x0;var _0x1b6b9a=_0xb50e[_0x216c2f];return _0x1b6b9a;};'use strict';var _=require('lodash');var util=require(_0xeb50('0x0'));var moment=require('moment');var BPromise=require(_0xeb50('0x1'));var rs=require(_0xeb50('0x2'));var fs=require('fs');var Redis=require(_0xeb50('0x3'));var db=require(_0xeb50('0x4'))['db'];var utils=require(_0xeb50('0x5'));var logger=require('../../config/logger')(_0xeb50('0x6'));var config=require(_0xeb50('0x7'));var jayson=require(_0xeb50('0x8'));var client=jayson['client'][_0xeb50('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39976d,_0x12cccb,_0x1e6d13){return new BPromise(function(_0x3fe654,_0x3f40cd){return client[_0xeb50('0xa')](_0x39976d,_0x1e6d13)[_0xeb50('0xb')](function(_0x483a54){logger[_0xeb50('0xc')](_0xeb50('0xd'),_0x12cccb,_0xeb50('0xe'));logger[_0xeb50('0xf')](_0xeb50('0x10'),_0x12cccb,_0xeb50('0xe'),JSON[_0xeb50('0x11')](_0x483a54));if(_0x483a54[_0xeb50('0x12')]){if(_0x483a54[_0xeb50('0x12')][_0xeb50('0x13')]===0x1f4){logger[_0xeb50('0x12')]('VtigerField,\x20%s,\x20%s',_0x12cccb,_0x483a54[_0xeb50('0x12')][_0xeb50('0x14')]);return _0x3f40cd(_0x483a54['error']['message']);}logger['error'](_0xeb50('0xd'),_0x12cccb,_0x483a54['error'][_0xeb50('0x14')]);return _0x3fe654(_0x483a54[_0xeb50('0x12')]['message']);}else{logger['info'](_0xeb50('0xd'),_0x12cccb,_0xeb50('0xe'));_0x3fe654(_0x483a54[_0xeb50('0x15')][_0xeb50('0x14')]);}})['catch'](function(_0x2d91fe){logger[_0xeb50('0x12')](_0xeb50('0xd'),_0x12cccb,_0x2d91fe);_0x3f40cd(_0x2d91fe);});});}
\ No newline at end of file
+var _0x257b=['../../config/environment','jayson/promise','client','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x257b,0xbf));var _0xb257=function(_0x4d6266,_0x5b32bc){_0x4d6266=_0x4d6266-0x0;var _0x3118c8=_0x257b[_0x4d6266];return _0x3118c8;};'use strict';var _=require(_0xb257('0x0'));var util=require(_0xb257('0x1'));var moment=require(_0xb257('0x2'));var BPromise=require(_0xb257('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb257('0x4'));var db=require(_0xb257('0x5'))['db'];var utils=require(_0xb257('0x6'));var logger=require(_0xb257('0x7'))(_0xb257('0x8'));var config=require(_0xb257('0x9'));var jayson=require(_0xb257('0xa'));var client=jayson[_0xb257('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8338bf,_0x1b0043,_0x3b3178){return new BPromise(function(_0x3afb63,_0x595a7c){return client[_0xb257('0xc')](_0x8338bf,_0x3b3178)[_0xb257('0xd')](function(_0x5f54aa){logger[_0xb257('0xe')](_0xb257('0xf'),_0x1b0043,'request\x20sent');logger[_0xb257('0x10')](_0xb257('0x11'),_0x1b0043,_0xb257('0x12'),JSON[_0xb257('0x13')](_0x5f54aa));if(_0x5f54aa[_0xb257('0x14')]){if(_0x5f54aa[_0xb257('0x14')][_0xb257('0x15')]===0x1f4){logger['error'](_0xb257('0xf'),_0x1b0043,_0x5f54aa['error'][_0xb257('0x16')]);return _0x595a7c(_0x5f54aa[_0xb257('0x14')][_0xb257('0x16')]);}logger['error'](_0xb257('0xf'),_0x1b0043,_0x5f54aa['error'][_0xb257('0x16')]);return _0x3afb63(_0x5f54aa[_0xb257('0x14')][_0xb257('0x16')]);}else{logger[_0xb257('0xe')](_0xb257('0xf'),_0x1b0043,'request\x20sent');_0x3afb63(_0x5f54aa[_0xb257('0x17')][_0xb257('0x16')]);}})[_0xb257('0x18')](function(_0x264711){logger[_0xb257('0x14')](_0xb257('0xf'),_0x1b0043,_0x264711);_0x595a7c(_0x264711);});});}
\ No newline at end of file
index 89c4d5f..672682e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x250c=['getConfigurations','/:id/fields','getFields','create','/:id/configurations','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x390d3b,_0x24bddb){var _0x5f201c=function(_0x15998c){while(--_0x15998c){_0x390d3b['push'](_0x390d3b['shift']());}};_0x5f201c(++_0x24bddb);}(_0x250c,0x191));var _0xc250=function(_0x4add72,_0x95a9dc){_0x4add72=_0x4add72-0x0;var _0x1ab1d7=_0x250c[_0x4add72];return _0x1ab1d7;};'use strict';var multer=require('multer');var util=require(_0xc250('0x0'));var path=require(_0xc250('0x1'));var timeout=require(_0xc250('0x2'));var express=require(_0xc250('0x3'));var router=express[_0xc250('0x4')]();var fs_extra=require(_0xc250('0x5'));var auth=require(_0xc250('0x6'));var interaction=require(_0xc250('0x7'));var config=require('../../config/environment');var controller=require(_0xc250('0x8'));router[_0xc250('0x9')]('/',auth[_0xc250('0xa')](),controller['index']);router['get'](_0xc250('0xb'),auth[_0xc250('0xa')](),controller[_0xc250('0xc')]);router[_0xc250('0x9')]('/:id/configurations',auth[_0xc250('0xa')](),controller[_0xc250('0xd')]);router[_0xc250('0x9')](_0xc250('0xe'),auth[_0xc250('0xa')](),controller[_0xc250('0xf')]);router['post']('/',auth[_0xc250('0xa')](),controller[_0xc250('0x10')]);router['post'](_0xc250('0x11'),auth[_0xc250('0xa')](),controller['addConfiguration']);router[_0xc250('0x12')](_0xc250('0xb'),auth[_0xc250('0xa')](),controller[_0xc250('0x13')]);router[_0xc250('0x14')]('/:id',auth[_0xc250('0xa')](),controller[_0xc250('0x15')]);module[_0xc250('0x16')]=router;
\ No newline at end of file
+var _0xa543=['put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','post','/:id/configurations','addConfiguration'];(function(_0x1e4c19,_0x495a1a){var _0x1e1b9a=function(_0x586424){while(--_0x586424){_0x1e4c19['push'](_0x1e4c19['shift']());}};_0x1e1b9a(++_0x495a1a);}(_0xa543,0x101));var _0x3a54=function(_0x79007a,_0x249837){_0x79007a=_0x79007a-0x0;var _0x1a18b4=_0xa543[_0x79007a];return _0x1a18b4;};'use strict';var multer=require('multer');var util=require(_0x3a54('0x0'));var path=require(_0x3a54('0x1'));var timeout=require('connect-timeout');var express=require(_0x3a54('0x2'));var router=express[_0x3a54('0x3')]();var fs_extra=require(_0x3a54('0x4'));var auth=require(_0x3a54('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3a54('0x6'));var controller=require(_0x3a54('0x7'));router[_0x3a54('0x8')]('/',auth[_0x3a54('0x9')](),controller['index']);router[_0x3a54('0x8')](_0x3a54('0xa'),auth[_0x3a54('0x9')](),controller[_0x3a54('0xb')]);router[_0x3a54('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x3a54('0xc')]);router[_0x3a54('0x8')]('/:id/fields',auth[_0x3a54('0x9')](),controller['getFields']);router[_0x3a54('0xd')]('/',auth[_0x3a54('0x9')](),controller['create']);router[_0x3a54('0xd')](_0x3a54('0xe'),auth[_0x3a54('0x9')](),controller[_0x3a54('0xf')]);router[_0x3a54('0x10')](_0x3a54('0xa'),auth[_0x3a54('0x9')](),controller[_0x3a54('0x11')]);router[_0x3a54('0x12')](_0x3a54('0xa'),auth['isAuthenticated'](),controller[_0x3a54('0x13')]);module[_0x3a54('0x14')]=router;
\ No newline at end of file
index 06a10f7..7e72127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41ec=['integrationTab','exports','STRING','remoteUri','ENUM','password','token'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x41ec,0x143));var _0xc41e=function(_0x178dac,_0x4e893b){_0x178dac=_0x178dac-0x0;var _0x19a2cb=_0x41ec[_0x178dac];return _0x19a2cb;};'use strict';var Sequelize=require('sequelize');module[_0xc41e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc41e('0x1')]},'username':{'type':Sequelize[_0xc41e('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xc41e('0x1')]},'token':{'type':Sequelize[_0xc41e('0x1')]},'remoteUri':{'type':Sequelize[_0xc41e('0x1')],'unique':_0xc41e('0x2')},'authType':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x4'),_0xc41e('0x5')),'defaultValue':_0xc41e('0x4')},'serverUrl':{'type':Sequelize[_0xc41e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xc41e('0x3')](_0xc41e('0x6'),'newTab'),'defaultValue':_0xc41e('0x6')}};
\ No newline at end of file
+var _0x4888=['password','token','exports','STRING','username','remoteUri','ENUM'];(function(_0x3403bb,_0x28398b){var _0x1ae5c5=function(_0x545098){while(--_0x545098){_0x3403bb['push'](_0x3403bb['shift']());}};_0x1ae5c5(++_0x28398b);}(_0x4888,0x198));var _0x8488=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0x4888[_0x2786ea];return _0x5c38e5;};'use strict';var Sequelize=require('sequelize');module[_0x8488('0x0')]={'name':{'type':Sequelize[_0x8488('0x1')]},'description':{'type':Sequelize[_0x8488('0x1')]},'username':{'type':Sequelize[_0x8488('0x1')],'unique':_0x8488('0x2')},'password':{'type':Sequelize[_0x8488('0x1')]},'token':{'type':Sequelize[_0x8488('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8488('0x3')},'authType':{'type':Sequelize[_0x8488('0x4')](_0x8488('0x5'),_0x8488('0x6')),'defaultValue':_0x8488('0x5')},'serverUrl':{'type':Sequelize[_0x8488('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
index bd3b8fb..5eecd33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['headers','toString','base64','Basic\x20%s','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','options','find','catch','create','update','body','getConfigurations','ZendeskConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZendeskField','Descriptions','findOne','token','authType','remoteUri','substring','GET','format','%s/%s','password'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xb58b,0x1f1));var _0xbb58=function(_0x18a908,_0x1ef543){_0x18a908=_0x18a908-0x0;var _0x3d0d41=_0xb58b[_0x18a908];return _0x3d0d41;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbb58('0x18'));function respondWithStatusCode(_0x18810f,_0x4cda21){_0x4cda21=_0x4cda21||0xcc;return function(_0x132511){if(_0x132511){return _0x18810f[_0xbb58('0x19')](_0x4cda21);}return _0x18810f[_0xbb58('0x1a')](_0x4cda21)[_0xbb58('0x1b')]();};}function respondWithResult(_0x19ceda,_0x58245f){_0x58245f=_0x58245f||0xc8;return function(_0x110944){if(_0x110944){return _0x19ceda[_0xbb58('0x1a')](_0x58245f)['json'](_0x110944);}};}function respondWithFilteredResult(_0x4ba30e,_0x33c20f){return function(_0x445b1f){if(_0x445b1f){var _0x38d69a=typeof _0x33c20f['offset']==='undefined'&&typeof _0x33c20f['limit']==='undefined';var _0x28637b=_0x445b1f[_0xbb58('0x1c')];var _0x48f3e0=_0x38d69a?0x0:_0x33c20f[_0xbb58('0x1d')];var _0x497653=_0x38d69a?_0x445b1f[_0xbb58('0x1c')]:_0x33c20f[_0xbb58('0x1d')]+_0x33c20f[_0xbb58('0x1e')];var _0xb8f982;if(_0x497653>=_0x28637b){_0x497653=_0x28637b;_0xb8f982=0xc8;}else{_0xb8f982=0xce;}_0x4ba30e[_0xbb58('0x1a')](_0xb8f982);return _0x4ba30e[_0xbb58('0x1f')](_0xbb58('0x20'),_0x48f3e0+'-'+_0x497653+'/'+_0x28637b)['json'](_0x445b1f);}return null;};}function patchUpdates(_0x84f34){return function(_0x2d8c0f){try{jsonpatch[_0xbb58('0x21')](_0x2d8c0f,_0x84f34,!![]);}catch(_0x3b4dc6){return BPromise[_0xbb58('0x22')](_0x3b4dc6);}return _0x2d8c0f[_0xbb58('0x23')]();};}function saveUpdates(_0x49453a,_0x350be7){return function(_0x27bbec){if(_0x27bbec){return _0x27bbec['update'](_0x49453a)[_0xbb58('0x24')](function(_0x53b693){return _0x53b693;});}return null;};}function removeEntity(_0x21964d,_0x287822){return function(_0x152f22){if(_0x152f22){return _0x152f22[_0xbb58('0x25')]()[_0xbb58('0x24')](function(){_0x21964d[_0xbb58('0x1a')](0xcc)[_0xbb58('0x1b')]();});}};}function handleEntityNotFound(_0x15e4c5,_0x4e0303){return function(_0x283dff){if(!_0x283dff){_0x15e4c5[_0xbb58('0x19')](0x194);}return _0x283dff;};}function handleError(_0x1be0ae,_0x129094){_0x129094=_0x129094||0x1f4;return function(_0x8e9ed9){logger[_0xbb58('0x26')](_0x8e9ed9[_0xbb58('0x27')]);if(_0x8e9ed9[_0xbb58('0x28')]){delete _0x8e9ed9[_0xbb58('0x28')];}_0x1be0ae[_0xbb58('0x1a')](_0x129094)[_0xbb58('0x29')](_0x8e9ed9);};}exports[_0xbb58('0x2a')]=function(_0x2a0481,_0x4157c4){var _0x3559b6={},_0x573cca={},_0x2b0f73={'count':0x0,'rows':[]};var _0xe46bc1=_[_0xbb58('0x2b')](db[_0xbb58('0x2c')][_0xbb58('0x2d')],function(_0x9d379f){return{'name':_0x9d379f[_0xbb58('0x2e')],'type':_0x9d379f[_0xbb58('0x2f')][_0xbb58('0x30')]};});_0x573cca['model']=_[_0xbb58('0x2b')](_0xe46bc1,_0xbb58('0x28'));_0x573cca[_0xbb58('0x31')]=_[_0xbb58('0x32')](_0x2a0481[_0xbb58('0x31')]);_0x573cca[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],_0x573cca[_0xbb58('0x31')]);_0x3559b6[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x573cca[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x2a0481['query']['fields']));_0x3559b6['attributes']=_0x3559b6[_0xbb58('0x36')][_0xbb58('0x38')]?_0x3559b6[_0xbb58('0x36')]:_0x573cca[_0xbb58('0x35')];if(!_0x2a0481[_0xbb58('0x31')][_0xbb58('0x39')](_0xbb58('0x3a'))){_0x3559b6[_0xbb58('0x1e')]=qs['limit'](_0x2a0481[_0xbb58('0x31')][_0xbb58('0x1e')]);_0x3559b6['offset']=qs[_0xbb58('0x1d')](_0x2a0481['query'][_0xbb58('0x1d')]);}_0x3559b6['order']=qs[_0xbb58('0x3b')](_0x2a0481[_0xbb58('0x31')]['sort']);_0x3559b6[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x2a0481[_0xbb58('0x31')],_0x573cca[_0xbb58('0x33')]),_0xe46bc1);if(_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]){_0x3559b6[_0xbb58('0x3c')]=_['merge'](_0x3559b6[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0xe46bc1,function(_0x2da5ff){if(_0x2da5ff['type']!=='VIRTUAL'){var _0x133d56={};_0x133d56[_0x2da5ff['name']]={'$like':'%'+_0x2a0481[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x133d56;}})});}_0x3559b6=_[_0xbb58('0x3f')]({},_0x3559b6,_0x2a0481['options']);var _0x485830={'where':_0x3559b6[_0xbb58('0x3c')]};return db[_0xbb58('0x2c')][_0xbb58('0x1c')](_0x485830)[_0xbb58('0x24')](function(_0x34a745){_0x2b0f73[_0xbb58('0x1c')]=_0x34a745;if(_0x2a0481['query'][_0xbb58('0x40')]){_0x3559b6[_0xbb58('0x41')]=[{'all':!![]}];}return db[_0xbb58('0x2c')][_0xbb58('0x42')](_0x3559b6);})[_0xbb58('0x24')](function(_0x301e15){_0x2b0f73['rows']=_0x301e15;return _0x2b0f73;})[_0xbb58('0x24')](respondWithFilteredResult(_0x4157c4,_0x3559b6))['catch'](handleError(_0x4157c4,null));};exports[_0xbb58('0x43')]=function(_0x285ad4,_0x29fb1c){var _0x45817f={'raw':![],'where':{'id':_0x285ad4[_0xbb58('0x44')]['id']}},_0x54099f={};_0x54099f[_0xbb58('0x35')]=_[_0xbb58('0x32')](db[_0xbb58('0x2c')]['rawAttributes']);_0x54099f[_0xbb58('0x31')]=_['keys'](_0x285ad4[_0xbb58('0x31')]);_0x54099f[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],_0x54099f[_0xbb58('0x31')]);_0x45817f[_0xbb58('0x36')]=_[_0xbb58('0x34')](_0x54099f[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x285ad4[_0xbb58('0x31')][_0xbb58('0x37')]));_0x45817f[_0xbb58('0x36')]=_0x45817f[_0xbb58('0x36')]['length']?_0x45817f[_0xbb58('0x36')]:_0x54099f['model'];if(_0x285ad4['query'][_0xbb58('0x40')]){_0x45817f[_0xbb58('0x41')]=[{'all':!![]}];}_0x45817f=_[_0xbb58('0x3f')]({},_0x45817f,_0x285ad4[_0xbb58('0x45')]);return db[_0xbb58('0x2c')][_0xbb58('0x46')](_0x45817f)[_0xbb58('0x24')](handleEntityNotFound(_0x29fb1c,null))[_0xbb58('0x24')](respondWithResult(_0x29fb1c,null))[_0xbb58('0x47')](handleError(_0x29fb1c,null));};exports[_0xbb58('0x48')]=function(_0x440fb3,_0x59a8cf){return db[_0xbb58('0x2c')][_0xbb58('0x48')](_0x440fb3['body'],{})[_0xbb58('0x24')](respondWithResult(_0x59a8cf,0xc9))[_0xbb58('0x47')](handleError(_0x59a8cf,null));};exports[_0xbb58('0x49')]=function(_0xdb0ff7,_0x5de68e){if(_0xdb0ff7[_0xbb58('0x4a')]['id']){delete _0xdb0ff7['body']['id'];}return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0xdb0ff7[_0xbb58('0x44')]['id']}})['then'](handleEntityNotFound(_0x5de68e,null))[_0xbb58('0x24')](saveUpdates(_0xdb0ff7[_0xbb58('0x4a')],null))['then'](respondWithResult(_0x5de68e,null))[_0xbb58('0x47')](handleError(_0x5de68e,null));};exports['destroy']=function(_0x28301d,_0x2d81e0){return db[_0xbb58('0x2c')][_0xbb58('0x46')]({'where':{'id':_0x28301d[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x2d81e0,null))[_0xbb58('0x24')](removeEntity(_0x2d81e0,null))['catch'](handleError(_0x2d81e0,null));};exports[_0xbb58('0x4b')]=function(_0x1fd892,_0x592da8,_0x3efbc6){var _0x98157={};var _0x5c19b7={};var _0x22802c;var _0x44636b;return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x1fd892[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x592da8,null))[_0xbb58('0x24')](function(_0x592879){if(_0x592879){_0x22802c=_0x592879;_0x5c19b7[_0xbb58('0x35')]=_['keys'](db[_0xbb58('0x4c')][_0xbb58('0x2d')]);_0x5c19b7[_0xbb58('0x31')]=_['keys'](_0x1fd892['query']);_0x5c19b7[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x5c19b7[_0xbb58('0x35')],_0x5c19b7[_0xbb58('0x31')]);_0x98157[_0xbb58('0x36')]=_['intersection'](_0x5c19b7[_0xbb58('0x35')],qs[_0xbb58('0x37')](_0x1fd892[_0xbb58('0x31')]['fields']));_0x98157[_0xbb58('0x36')]=_0x98157[_0xbb58('0x36')][_0xbb58('0x38')]?_0x98157[_0xbb58('0x36')]:_0x5c19b7[_0xbb58('0x35')];_0x98157['order']=qs[_0xbb58('0x3b')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3b')]);_0x98157[_0xbb58('0x3c')]=qs[_0xbb58('0x33')](_[_0xbb58('0x3d')](_0x1fd892[_0xbb58('0x31')],_0x5c19b7[_0xbb58('0x33')]));if(_0x1fd892['query'][_0xbb58('0x3e')]){_0x98157['where']=_[_0xbb58('0x3f')](_0x98157[_0xbb58('0x3c')],{'$or':_[_0xbb58('0x2b')](_0x98157[_0xbb58('0x36')],function(_0x3d6fba){var _0x1dbbd9={};_0x1dbbd9[_0x3d6fba]={'$like':'%'+_0x1fd892[_0xbb58('0x31')][_0xbb58('0x3e')]+'%'};return _0x1dbbd9;})});}_0x98157=_[_0xbb58('0x3f')]({},_0x98157,_0x1fd892[_0xbb58('0x45')]);return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x3933f0){if(_0x3933f0){_0x44636b=_0x3933f0[_0xbb58('0x38')];if(!_0x1fd892[_0xbb58('0x31')]['hasOwnProperty'](_0xbb58('0x3a'))){_0x98157['limit']=qs[_0xbb58('0x1e')](_0x1fd892[_0xbb58('0x31')]['limit']);_0x98157[_0xbb58('0x1d')]=qs[_0xbb58('0x1d')](_0x1fd892[_0xbb58('0x31')][_0xbb58('0x1d')]);}return _0x22802c[_0xbb58('0x4b')](_0x98157);}})['then'](function(_0x54bf2e){if(_0x54bf2e){return _0x54bf2e?{'count':_0x44636b,'rows':_0x54bf2e}:null;}})[_0xbb58('0x24')](respondWithResult(_0x592da8,null))[_0xbb58('0x47')](handleError(_0x592da8,null));};exports[_0xbb58('0x4d')]=function(_0x4bbccf,_0x11d41e,_0x419215){if(_0x4bbccf['body']['id']){delete _0x4bbccf[_0xbb58('0x4a')]['id'];}return db[_0xbb58('0x2c')]['findOne']({'where':{'id':_0x4bbccf[_0xbb58('0x44')]['id']}})[_0xbb58('0x24')](handleEntityNotFound(_0x11d41e,null))[_0xbb58('0x24')](function(_0x3c932e){if(_0x3c932e){_0x4bbccf[_0xbb58('0x4a')]['AccountId']=_0x3c932e['id'];_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x4e')]=integrations[_0xbb58('0x4f')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf['body']['type']);_0x4bbccf[_0xbb58('0x4a')]['Descriptions']=integrations[_0xbb58('0x51')](_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x50')],_0x4bbccf[_0xbb58('0x4a')][_0xbb58('0x2f')]);return db[_0xbb58('0x4c')][_0xbb58('0x48')](_0x4bbccf[_0xbb58('0x4a')],{'include':[{'model':db[_0xbb58('0x52')],'as':_0xbb58('0x4e')},{'model':db['ZendeskField'],'as':_0xbb58('0x53')}]});}return null;})[_0xbb58('0x24')](respondWithResult(_0x11d41e,null))[_0xbb58('0x47')](handleError(_0x11d41e,null));};exports['getFields']=function(_0x50bf24,_0x4bdc30,_0x5e9319){var _0x1e315e='';return db[_0xbb58('0x2c')][_0xbb58('0x54')]({'where':{'id':_0x50bf24[_0xbb58('0x44')]['id']},'attributes':['id','username','password',_0xbb58('0x55'),_0xbb58('0x56'),'remoteUri']})[_0xbb58('0x24')](handleEntityNotFound(_0x4bdc30,null))[_0xbb58('0x24')](function(_0x3cd96a){if(_0x3cd96a){_0x1e315e=_0x3cd96a[_0xbb58('0x57')];var _0x382d16=_0x1e315e['slice'](-0x1);if(_0x382d16==='/'){_0x1e315e=_0x1e315e[_0xbb58('0x58')](0x0,_0x1e315e['lastIndexOf'](_0x382d16));}var _0x52cf79={'method':_0xbb58('0x59'),'uri':util[_0xbb58('0x5a')](_0xbb58('0x5b'),_0x1e315e,'ticket_fields'),'json':!![]};switch(_0x3cd96a[_0xbb58('0x56')]){case _0xbb58('0x5c'):_0x52cf79[_0xbb58('0x5d')]={'Authorization':util[_0xbb58('0x5a')]('Basic\x20%s',new Buffer(util[_0xbb58('0x5a')]('%s:%s',_0x3cd96a['username'],_0x3cd96a[_0xbb58('0x5c')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;case'token':_0x52cf79['headers']={'Authorization':util[_0xbb58('0x5a')](_0xbb58('0x60'),new Buffer(util[_0xbb58('0x5a')](_0xbb58('0x61'),_0x3cd96a[_0xbb58('0x62')],_0x3cd96a[_0xbb58('0x55')]))[_0xbb58('0x5e')](_0xbb58('0x5f')))};break;default:throw new db[(_0xbb58('0x63'))][(_0xbb58('0x64'))](_0xbb58('0x65'));}return rp(_0x52cf79);}})['then'](function(_0x502f55){if(_0x502f55){var _0x36e2eb=[_0xbb58('0x66'),_0xbb58('0x67'),'group',_0xbb58('0x68')];_[_0xbb58('0x69')](_0x502f55[_0xbb58('0x6a')],function(_0x494c33){return _0x36e2eb[_0xbb58('0x6b')](_0x494c33['type']);});return{'count':_0x502f55[_0xbb58('0x6a')]['length'],'rows':_[_0xbb58('0x2b')](_0x502f55[_0xbb58('0x6a')],function(_0xaf9d6){return{'id':_0xaf9d6['id'],'name':_0xaf9d6[_0xbb58('0x6c')]>0x7?_0xaf9d6[_0xbb58('0x6d')]:_0xaf9d6[_0xbb58('0x2f')],'custom':_0xaf9d6['position']>0x7?!![]:![],'options':_0xaf9d6['system_field_options']?_0xaf9d6[_0xbb58('0x6e')]:_0xaf9d6[_0xbb58('0x6f')]?_0xaf9d6['custom_field_options']:[]};})};}})[_0xbb58('0x24')](respondWithResult(_0x4bdc30,null))[_0xbb58('0x47')](function(_0x43eb15){var _0x5604d1=_0x50bf24[_0xbb58('0x31')]['test']?0x1f4:_0x43eb15[_0xbb58('0x70')]||0x1f4;logger[_0xbb58('0x26')](_0xbb58('0x71'),_0xbb58('0x72'),_0x5604d1,JSON[_0xbb58('0x73')](_0x43eb15));delete _0x43eb15[_0xbb58('0x28')];if(_0x5604d1===0x191){_0x5604d1=0x190;}_0x4bdc30[_0xbb58('0x1a')](_0x5604d1)['send'](_0x50bf24[_0xbb58('0x31')][_0xbb58('0x74')]?{'message':_0xbb58('0x75'),'statusCode':_0x43eb15['statusCode']}:_0x43eb15);});};
\ No newline at end of file
+var _0xb9a7=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','ZendeskAccount','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getDescriptions','ZendeskConfiguration','getFields','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','Basic\x20%s','username','toString','headers','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x3ea27c,_0xdfcd4f){var _0x1c0d43=function(_0x4160ea){while(--_0x4160ea){_0x3ea27c['push'](_0x3ea27c['shift']());}};_0x1c0d43(++_0xdfcd4f);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xb9a7[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b9a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7b9a('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x7b9a('0x2'));var util=require(_0x7b9a('0x3'));var path=require(_0x7b9a('0x4'));var sox=require(_0x7b9a('0x5'));var csv=require(_0x7b9a('0x6'));var ejs=require(_0x7b9a('0x7'));var fs=require('fs');var fs_extra=require(_0x7b9a('0x8'));var _=require(_0x7b9a('0x9'));var squel=require(_0x7b9a('0xa'));var crypto=require(_0x7b9a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7b9a('0xc'));var toCsv=require(_0x7b9a('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b9a('0xd'));var qs=require(_0x7b9a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b9a('0xf'));var logger=require('../../config/logger')(_0x7b9a('0x10'));var utils=require('../../config/utils');var config=require(_0x7b9a('0x11'));var licenseUtil=require(_0x7b9a('0x12'));var db=require(_0x7b9a('0x13'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x32f616,_0xec5949){_0xec5949=_0xec5949||0xcc;return function(_0x5e3875){if(_0x5e3875){return _0x32f616[_0x7b9a('0x14')](_0xec5949);}return _0x32f616[_0x7b9a('0x15')](_0xec5949)['end']();};}function respondWithResult(_0xb157e5,_0xde180d){_0xde180d=_0xde180d||0xc8;return function(_0x6fa16a){if(_0x6fa16a){return _0xb157e5[_0x7b9a('0x15')](_0xde180d)[_0x7b9a('0x16')](_0x6fa16a);}};}function respondWithFilteredResult(_0x346daa,_0x22a7e4){return function(_0x35e602){if(_0x35e602){var _0x2f1899=typeof _0x22a7e4['offset']===_0x7b9a('0x17')&&typeof _0x22a7e4['limit']===_0x7b9a('0x17');var _0xa217cb=_0x35e602[_0x7b9a('0x18')];var _0x169d16=_0x2f1899?0x0:_0x22a7e4[_0x7b9a('0x19')];var _0x180a67=_0x2f1899?_0x35e602[_0x7b9a('0x18')]:_0x22a7e4[_0x7b9a('0x19')]+_0x22a7e4[_0x7b9a('0x1a')];var _0x588c48;if(_0x180a67>=_0xa217cb){_0x180a67=_0xa217cb;_0x588c48=0xc8;}else{_0x588c48=0xce;}_0x346daa[_0x7b9a('0x15')](_0x588c48);return _0x346daa[_0x7b9a('0x1b')](_0x7b9a('0x1c'),_0x169d16+'-'+_0x180a67+'/'+_0xa217cb)['json'](_0x35e602);}return null;};}function patchUpdates(_0x993048){return function(_0x59a64d){try{jsonpatch[_0x7b9a('0x1d')](_0x59a64d,_0x993048,!![]);}catch(_0x517e93){return BPromise[_0x7b9a('0x1e')](_0x517e93);}return _0x59a64d[_0x7b9a('0x1f')]();};}function saveUpdates(_0x23d812,_0x54fda7){return function(_0x411eea){if(_0x411eea){return _0x411eea[_0x7b9a('0x20')](_0x23d812)['then'](function(_0x35aca7){return _0x35aca7;});}return null;};}function removeEntity(_0x374dca,_0x269c07){return function(_0x2f7d34){if(_0x2f7d34){return _0x2f7d34[_0x7b9a('0x21')]()['then'](function(){_0x374dca[_0x7b9a('0x15')](0xcc)[_0x7b9a('0x22')]();});}};}function handleEntityNotFound(_0x5809f5,_0x39b7ec){return function(_0x4fa111){if(!_0x4fa111){_0x5809f5[_0x7b9a('0x14')](0x194);}return _0x4fa111;};}function handleError(_0x3091ab,_0x4c2271){_0x4c2271=_0x4c2271||0x1f4;return function(_0x55d01c){logger[_0x7b9a('0x23')](_0x55d01c['stack']);if(_0x55d01c['name']){delete _0x55d01c[_0x7b9a('0x24')];}_0x3091ab['status'](_0x4c2271)['send'](_0x55d01c);};}exports[_0x7b9a('0x25')]=function(_0x4d5880,_0x5c89b6){var _0x314b6d={},_0x4fee38={},_0x1553ae={'count':0x0,'rows':[]};var _0x2e6144=_[_0x7b9a('0x26')](db['ZendeskAccount'][_0x7b9a('0x27')],function(_0x2ce78b){return{'name':_0x2ce78b[_0x7b9a('0x28')],'type':_0x2ce78b[_0x7b9a('0x29')][_0x7b9a('0x2a')]};});_0x4fee38[_0x7b9a('0x2b')]=_['map'](_0x2e6144,'name');_0x4fee38[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x4d5880[_0x7b9a('0x2c')]);_0x4fee38['filters']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],_0x4fee38['query']);_0x314b6d['attributes']=_[_0x7b9a('0x2e')](_0x4fee38[_0x7b9a('0x2b')],qs['fields'](_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x314b6d[_0x7b9a('0x30')]=_0x314b6d[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x314b6d['attributes']:_0x4fee38[_0x7b9a('0x2b')];if(!_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x32')](_0x7b9a('0x33'))){_0x314b6d[_0x7b9a('0x1a')]=qs[_0x7b9a('0x1a')](_0x4d5880['query']['limit']);_0x314b6d[_0x7b9a('0x19')]=qs[_0x7b9a('0x19')](_0x4d5880['query'][_0x7b9a('0x19')]);}_0x314b6d[_0x7b9a('0x34')]=qs[_0x7b9a('0x35')](_0x4d5880['query'][_0x7b9a('0x35')]);_0x314b6d[_0x7b9a('0x36')]=qs['filters'](_['pick'](_0x4d5880[_0x7b9a('0x2c')],_0x4fee38[_0x7b9a('0x37')]),_0x2e6144);if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x314b6d[_0x7b9a('0x36')]=_[_0x7b9a('0x39')](_0x314b6d[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x2e6144,function(_0x4af212){if(_0x4af212[_0x7b9a('0x29')]!=='VIRTUAL'){var _0x213370={};_0x213370[_0x4af212[_0x7b9a('0x24')]]={'$like':'%'+_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x213370;}})});}_0x314b6d=_[_0x7b9a('0x39')]({},_0x314b6d,_0x4d5880[_0x7b9a('0x3a')]);var _0x5e504f={'where':_0x314b6d[_0x7b9a('0x36')]};return db[_0x7b9a('0x3b')][_0x7b9a('0x18')](_0x5e504f)[_0x7b9a('0x3c')](function(_0x5af103){_0x1553ae[_0x7b9a('0x18')]=_0x5af103;if(_0x4d5880[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x314b6d[_0x7b9a('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x7b9a('0x3f')](_0x314b6d);})['then'](function(_0x1ee576){_0x1553ae[_0x7b9a('0x40')]=_0x1ee576;return _0x1553ae;})[_0x7b9a('0x3c')](respondWithFilteredResult(_0x5c89b6,_0x314b6d))[_0x7b9a('0x41')](handleError(_0x5c89b6,null));};exports[_0x7b9a('0x42')]=function(_0x41f541,_0x56e274){var _0x33edc6={'raw':![],'where':{'id':_0x41f541[_0x7b9a('0x43')]['id']}},_0x85770={};_0x85770['model']=_['keys'](db[_0x7b9a('0x3b')][_0x7b9a('0x27')]);_0x85770[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x41f541[_0x7b9a('0x2c')]);_0x85770[_0x7b9a('0x37')]=_['intersection'](_0x85770['model'],_0x85770['query']);_0x33edc6[_0x7b9a('0x30')]=_[_0x7b9a('0x2e')](_0x85770['model'],qs[_0x7b9a('0x2f')](_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x33edc6['attributes']=_0x33edc6[_0x7b9a('0x30')]['length']?_0x33edc6[_0x7b9a('0x30')]:_0x85770[_0x7b9a('0x2b')];if(_0x41f541[_0x7b9a('0x2c')][_0x7b9a('0x3d')]){_0x33edc6[_0x7b9a('0x3e')]=[{'all':!![]}];}_0x33edc6=_['merge']({},_0x33edc6,_0x41f541[_0x7b9a('0x3a')]);return db['ZendeskAccount'][_0x7b9a('0x44')](_0x33edc6)['then'](handleEntityNotFound(_0x56e274,null))['then'](respondWithResult(_0x56e274,null))[_0x7b9a('0x41')](handleError(_0x56e274,null));};exports[_0x7b9a('0x45')]=function(_0x717d08,_0x43cba){return db[_0x7b9a('0x3b')][_0x7b9a('0x45')](_0x717d08[_0x7b9a('0x46')],{})[_0x7b9a('0x3c')](respondWithResult(_0x43cba,0xc9))[_0x7b9a('0x41')](handleError(_0x43cba,null));};exports['update']=function(_0x1d7957,_0x4044ba){if(_0x1d7957['body']['id']){delete _0x1d7957['body']['id'];}return db['ZendeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x1d7957[_0x7b9a('0x43')]['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x4044ba,null))[_0x7b9a('0x3c')](saveUpdates(_0x1d7957['body'],null))[_0x7b9a('0x3c')](respondWithResult(_0x4044ba,null))[_0x7b9a('0x41')](handleError(_0x4044ba,null));};exports[_0x7b9a('0x21')]=function(_0x33b200,_0x2d083b){return db['ZendeskAccount'][_0x7b9a('0x44')]({'where':{'id':_0x33b200['params']['id']}})[_0x7b9a('0x3c')](handleEntityNotFound(_0x2d083b,null))[_0x7b9a('0x3c')](removeEntity(_0x2d083b,null))[_0x7b9a('0x41')](handleError(_0x2d083b,null));};exports[_0x7b9a('0x47')]=function(_0x52f2ca,_0xd42491,_0x2d353f){var _0x354a87={};var _0x28855a={};var _0x2b0db5;var _0x3e2f1b;return db[_0x7b9a('0x3b')]['findOne']({'where':{'id':_0x52f2ca['params']['id']}})['then'](handleEntityNotFound(_0xd42491,null))[_0x7b9a('0x3c')](function(_0x2f8929){if(_0x2f8929){_0x2b0db5=_0x2f8929;_0x28855a['model']=_['keys'](db['ZendeskConfiguration']['rawAttributes']);_0x28855a[_0x7b9a('0x2c')]=_[_0x7b9a('0x2d')](_0x52f2ca[_0x7b9a('0x2c')]);_0x28855a[_0x7b9a('0x37')]=_[_0x7b9a('0x2e')](_0x28855a[_0x7b9a('0x2b')],_0x28855a[_0x7b9a('0x2c')]);_0x354a87[_0x7b9a('0x30')]=_['intersection'](_0x28855a[_0x7b9a('0x2b')],qs['fields'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x2f')]));_0x354a87[_0x7b9a('0x30')]=_0x354a87[_0x7b9a('0x30')][_0x7b9a('0x31')]?_0x354a87['attributes']:_0x28855a[_0x7b9a('0x2b')];_0x354a87['order']=qs[_0x7b9a('0x35')](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x35')]);_0x354a87['where']=qs['filters'](_['pick'](_0x52f2ca['query'],_0x28855a[_0x7b9a('0x37')]));if(_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]){_0x354a87['where']=_[_0x7b9a('0x39')](_0x354a87[_0x7b9a('0x36')],{'$or':_[_0x7b9a('0x26')](_0x354a87[_0x7b9a('0x30')],function(_0xea7b37){var _0x4c3939={};_0x4c3939[_0xea7b37]={'$like':'%'+_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x38')]+'%'};return _0x4c3939;})});}_0x354a87=_[_0x7b9a('0x39')]({},_0x354a87,_0x52f2ca['options']);return _0x2b0db5['getConfigurations'](_0x354a87);}})['then'](function(_0x14e2d5){if(_0x14e2d5){_0x3e2f1b=_0x14e2d5[_0x7b9a('0x31')];if(!_0x52f2ca[_0x7b9a('0x2c')]['hasOwnProperty'](_0x7b9a('0x33'))){_0x354a87[_0x7b9a('0x1a')]=qs['limit'](_0x52f2ca[_0x7b9a('0x2c')]['limit']);_0x354a87[_0x7b9a('0x19')]=qs['offset'](_0x52f2ca[_0x7b9a('0x2c')][_0x7b9a('0x19')]);}return _0x2b0db5[_0x7b9a('0x47')](_0x354a87);}})[_0x7b9a('0x3c')](function(_0x5d45ae){if(_0x5d45ae){return _0x5d45ae?{'count':_0x3e2f1b,'rows':_0x5d45ae}:null;}})[_0x7b9a('0x3c')](respondWithResult(_0xd42491,null))[_0x7b9a('0x41')](handleError(_0xd42491,null));};exports[_0x7b9a('0x48')]=function(_0x273134,_0x567328,_0x239b62){if(_0x273134['body']['id']){delete _0x273134[_0x7b9a('0x46')]['id'];}return db['ZendeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x273134['params']['id']}})['then'](handleEntityNotFound(_0x567328,null))['then'](function(_0x48442a){if(_0x48442a){_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4a')]=_0x48442a['id'];_0x273134[_0x7b9a('0x46')][_0x7b9a('0x4b')]=integrations['getSubjects'](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134['body'][_0x7b9a('0x29')]);_0x273134['body']['Descriptions']=integrations[_0x7b9a('0x4c')](_0x273134[_0x7b9a('0x46')]['channel'],_0x273134[_0x7b9a('0x46')]['type']);return db[_0x7b9a('0x4d')][_0x7b9a('0x45')](_0x273134[_0x7b9a('0x46')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x7b9a('0x3c')](respondWithResult(_0x567328,null))[_0x7b9a('0x41')](handleError(_0x567328,null));};exports[_0x7b9a('0x4e')]=function(_0x2092b6,_0x261a43,_0x147d23){var _0x45014b='';return db['ZendeskAccount'][_0x7b9a('0x49')]({'where':{'id':_0x2092b6[_0x7b9a('0x43')]['id']},'attributes':['id','username',_0x7b9a('0x4f'),_0x7b9a('0x50'),_0x7b9a('0x51'),'remoteUri']})['then'](handleEntityNotFound(_0x261a43,null))[_0x7b9a('0x3c')](function(_0x8a3d84){if(_0x8a3d84){_0x45014b=_0x8a3d84['remoteUri'];var _0xc64c42=_0x45014b['slice'](-0x1);if(_0xc64c42==='/'){_0x45014b=_0x45014b[_0x7b9a('0x52')](0x0,_0x45014b[_0x7b9a('0x53')](_0xc64c42));}var _0x3a46e9={'method':'GET','uri':util[_0x7b9a('0x54')](_0x7b9a('0x55'),_0x45014b,_0x7b9a('0x56')),'json':!![]};switch(_0x8a3d84[_0x7b9a('0x51')]){case _0x7b9a('0x4f'):_0x3a46e9['headers']={'Authorization':util['format'](_0x7b9a('0x57'),new Buffer(util[_0x7b9a('0x54')]('%s:%s',_0x8a3d84[_0x7b9a('0x58')],_0x8a3d84[_0x7b9a('0x4f')]))[_0x7b9a('0x59')]('base64'))};break;case'token':_0x3a46e9[_0x7b9a('0x5a')]={'Authorization':util[_0x7b9a('0x54')](_0x7b9a('0x57'),new Buffer(util[_0x7b9a('0x54')]('%s/token:%s',_0x8a3d84[_0x7b9a('0x58')],_0x8a3d84[_0x7b9a('0x50')]))[_0x7b9a('0x59')]('base64'))};break;default:throw new db['Sequelize'][(_0x7b9a('0x5b'))](_0x7b9a('0x5c'));}return rp(_0x3a46e9);}})[_0x7b9a('0x3c')](function(_0x1934e2){if(_0x1934e2){var _0x48e5dd=[_0x7b9a('0x5d'),_0x7b9a('0x5e'),'group',_0x7b9a('0x5f')];_[_0x7b9a('0x60')](_0x1934e2[_0x7b9a('0x56')],function(_0x34f229){return _0x48e5dd[_0x7b9a('0x61')](_0x34f229[_0x7b9a('0x29')]);});return{'count':_0x1934e2[_0x7b9a('0x56')][_0x7b9a('0x31')],'rows':_[_0x7b9a('0x26')](_0x1934e2[_0x7b9a('0x56')],function(_0x4c41dc){return{'id':_0x4c41dc['id'],'name':_0x4c41dc['position']>0x7?_0x4c41dc['title']:_0x4c41dc[_0x7b9a('0x29')],'custom':_0x4c41dc[_0x7b9a('0x62')]>0x7?!![]:![],'options':_0x4c41dc['system_field_options']?_0x4c41dc[_0x7b9a('0x63')]:_0x4c41dc[_0x7b9a('0x64')]?_0x4c41dc['custom_field_options']:[]};})};}})[_0x7b9a('0x3c')](respondWithResult(_0x261a43,null))[_0x7b9a('0x41')](function(_0x3774e1){var _0x20c427=_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x65')]?0x1f4:_0x3774e1[_0x7b9a('0x66')]||0x1f4;logger[_0x7b9a('0x23')](_0x7b9a('0x67'),'getFields',_0x20c427,JSON[_0x7b9a('0x68')](_0x3774e1));delete _0x3774e1[_0x7b9a('0x24')];if(_0x20c427===0x191){_0x20c427=0x190;}_0x261a43[_0x7b9a('0x15')](_0x20c427)[_0x7b9a('0x69')](_0x2092b6[_0x7b9a('0x2c')][_0x7b9a('0x65')]?{'message':_0x7b9a('0x6a'),'statusCode':_0x3774e1[_0x7b9a('0x66')]}:_0x3774e1);});};
\ No newline at end of file
index 1118f0e..75b696d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dcf=['path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x50efe3,_0x1905f0){var _0x216f61=function(_0x27730a){while(--_0x27730a){_0x50efe3['push'](_0x50efe3['shift']());}};_0x216f61(++_0x1905f0);}(_0x8dcf,0x80));var _0xf8dc=function(_0x13a441,_0x422a55){_0x13a441=_0x13a441-0x0;var _0x17726f=_0x8dcf[_0x13a441];return _0x17726f;};'use strict';var _=require(_0xf8dc('0x0'));var util=require(_0xf8dc('0x1'));var logger=require(_0xf8dc('0x2'))(_0xf8dc('0x3'));var moment=require(_0xf8dc('0x4'));var BPromise=require(_0xf8dc('0x5'));var rp=require(_0xf8dc('0x6'));var fs=require('fs');var path=require(_0xf8dc('0x7'));var rimraf=require('rimraf');var config=require(_0xf8dc('0x8'));var attributes=require(_0xf8dc('0x9'));var integrations=require(_0xf8dc('0xa'));module[_0xf8dc('0xb')]=function(_0x11d549,_0x5abf75){return _0x11d549[_0xf8dc('0xc')](_0xf8dc('0xd'),attributes,{'tableName':_0xf8dc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3e7=['api','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xd3e7,0xa7));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7d3e('0x0'))(_0x7d3e('0x1'));var moment=require('moment');var BPromise=require(_0x7d3e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d3e('0x3'));var rimraf=require(_0x7d3e('0x4'));var config=require(_0x7d3e('0x5'));var attributes=require(_0x7d3e('0x6'));var integrations=require(_0x7d3e('0x7'));module[_0x7d3e('0x8')]=function(_0x414b9d,_0x27f48a){return _0x414b9d[_0x7d3e('0x9')](_0x7d3e('0xa'),attributes,{'tableName':_0x7d3e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6955419..b0f105c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a62=['catch','ZendeskAccount','findAll','options','raw','attributes','include','map','model','GetZendeskAccount','debug','find','where','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x142b0d,_0x18330d){var _0x26886a=function(_0x3f07ec){while(--_0x3f07ec){_0x142b0d['push'](_0x142b0d['shift']());}};_0x26886a(++_0x18330d);}(_0x8a62,0x18f));var _0x28a6=function(_0x11a069,_0x2060be){_0x11a069=_0x11a069-0x0;var _0x14a423=_0x8a62[_0x11a069];return _0x14a423;};'use strict';var _=require(_0x28a6('0x0'));var util=require('util');var moment=require(_0x28a6('0x1'));var BPromise=require(_0x28a6('0x2'));var rs=require(_0x28a6('0x3'));var fs=require('fs');var Redis=require(_0x28a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28a6('0x5'));var logger=require(_0x28a6('0x6'))(_0x28a6('0x7'));var config=require(_0x28a6('0x8'));var jayson=require(_0x28a6('0x9'));var client=jayson[_0x28a6('0xa')][_0x28a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x97d860,_0x5ae651,_0x38bbb0){return new BPromise(function(_0x1e8c79,_0x2bef20){return client['request'](_0x97d860,_0x38bbb0)[_0x28a6('0xc')](function(_0x5accd2){logger[_0x28a6('0xd')](_0x28a6('0xe'),_0x5ae651,'request\x20sent');logger['debug'](_0x28a6('0xf'),_0x5ae651,'request\x20sent',JSON[_0x28a6('0x10')](_0x5accd2));if(_0x5accd2['error']){if(_0x5accd2[_0x28a6('0x11')][_0x28a6('0x12')]===0x1f4){logger['error'](_0x28a6('0xe'),_0x5ae651,_0x5accd2[_0x28a6('0x11')][_0x28a6('0x13')]);return _0x2bef20(_0x5accd2[_0x28a6('0x11')]['message']);}logger[_0x28a6('0x11')](_0x28a6('0xe'),_0x5ae651,_0x5accd2['error']['message']);return _0x1e8c79(_0x5accd2[_0x28a6('0x11')][_0x28a6('0x13')]);}else{logger[_0x28a6('0xd')](_0x28a6('0xe'),_0x5ae651,_0x28a6('0x14'));_0x1e8c79(_0x5accd2['result'][_0x28a6('0x13')]);}})[_0x28a6('0x15')](function(_0x2cc484){logger[_0x28a6('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5ae651,_0x2cc484);_0x2bef20(_0x2cc484);});});}exports['GetZendeskAccount']=function(_0x5433ca){var _0x2b4d7d=this;return new Promise(function(_0xa0919f,_0x5328c9){return db[_0x28a6('0x16')][_0x28a6('0x17')]({'raw':_0x5433ca[_0x28a6('0x18')]?_0x5433ca['options'][_0x28a6('0x19')]===undefined?!![]:![]:!![],'where':_0x5433ca[_0x28a6('0x18')]?_0x5433ca[_0x28a6('0x18')]['where']||null:null,'attributes':_0x5433ca[_0x28a6('0x18')]?_0x5433ca[_0x28a6('0x18')][_0x28a6('0x1a')]||null:null,'limit':_0x5433ca[_0x28a6('0x18')]?_0x5433ca[_0x28a6('0x18')]['limit']||null:null,'include':_0x5433ca['options']?_0x5433ca[_0x28a6('0x18')][_0x28a6('0x1b')]?_[_0x28a6('0x1c')](_0x5433ca['options'][_0x28a6('0x1b')],function(_0x47d051){return{'model':db[_0x47d051[_0x28a6('0x1d')]],'as':_0x47d051['as'],'attributes':_0x47d051[_0x28a6('0x1a')],'include':_0x47d051['include']?_[_0x28a6('0x1c')](_0x47d051[_0x28a6('0x1b')],function(_0x48f976){return{'model':db[_0x48f976[_0x28a6('0x1d')]],'as':_0x48f976['as'],'attributes':_0x48f976[_0x28a6('0x1a')],'include':_0x48f976[_0x28a6('0x1b')]?_['map'](_0x48f976[_0x28a6('0x1b')],function(_0x21f6d4){return{'model':db[_0x21f6d4['model']],'as':_0x21f6d4['as'],'attributes':_0x21f6d4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x48daba){logger[_0x28a6('0xd')](_0x28a6('0x1e'),_0x5433ca);logger[_0x28a6('0x1f')](_0x28a6('0x1e'),_0x5433ca,JSON[_0x28a6('0x10')](_0x48daba));_0xa0919f(_0x48daba);})[_0x28a6('0x15')](function(_0x50cd4e){logger[_0x28a6('0x11')]('GetZendeskAccount',_0x50cd4e['message'],_0x5433ca);_0x5328c9(_0x2b4d7d[_0x28a6('0x11')](0x1f4,_0x50cd4e[_0x28a6('0x13')]));});});};exports['ShowZendeskAccount']=function(_0x4716a1){var _0x11c5af=this;return new Promise(function(_0x301b69,_0x46b70f){return db[_0x28a6('0x16')][_0x28a6('0x20')]({'raw':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')][_0x28a6('0x21')]||null:null,'attributes':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')][_0x28a6('0x1a')]||null:null,'include':_0x4716a1[_0x28a6('0x18')]?_0x4716a1[_0x28a6('0x18')][_0x28a6('0x1b')]?_[_0x28a6('0x1c')](_0x4716a1[_0x28a6('0x18')][_0x28a6('0x1b')],function(_0x3965bf){return{'model':db[_0x3965bf[_0x28a6('0x1d')]],'as':_0x3965bf['as'],'attributes':_0x3965bf[_0x28a6('0x1a')],'include':_0x3965bf[_0x28a6('0x1b')]?_[_0x28a6('0x1c')](_0x3965bf[_0x28a6('0x1b')],function(_0x19cb42){return{'model':db[_0x19cb42[_0x28a6('0x1d')]],'as':_0x19cb42['as'],'attributes':_0x19cb42[_0x28a6('0x1a')],'include':_0x19cb42[_0x28a6('0x1b')]?_['map'](_0x19cb42['include'],function(_0x268adf){return{'model':db[_0x268adf[_0x28a6('0x1d')]],'as':_0x268adf['as'],'attributes':_0x268adf[_0x28a6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x286287){logger[_0x28a6('0xd')](_0x28a6('0x22'),_0x4716a1);logger[_0x28a6('0x1f')](_0x28a6('0x22'),_0x4716a1,JSON[_0x28a6('0x10')](_0x286287));_0x301b69(_0x286287);})[_0x28a6('0x15')](function(_0x349702){logger[_0x28a6('0x11')]('ShowZendeskAccount',_0x349702[_0x28a6('0x13')],_0x4716a1);_0x46b70f(_0x11c5af[_0x28a6('0x11')](0x1f4,_0x349702[_0x28a6('0x13')]));});});};
\ No newline at end of file
+var _0x0e76=['client','http','request','then','info','request\x20sent','debug','error','ZendeskAccount,\x20%s,\x20%s','message','result','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowZendeskAccount','ZendeskAccount','find','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x574e1f,_0x22cf78){var _0x2c226a=function(_0x593f0d){while(--_0x593f0d){_0x574e1f['push'](_0x574e1f['shift']());}};_0x2c226a(++_0x22cf78);}(_0x0e76,0xc4));var _0x60e7=function(_0x845505,_0x19e5f3){_0x845505=_0x845505-0x0;var _0x2513b9=_0x0e76[_0x845505];return _0x2513b9;};'use strict';var _=require(_0x60e7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60e7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60e7('0x2'));var db=require(_0x60e7('0x3'))['db'];var utils=require(_0x60e7('0x4'));var logger=require(_0x60e7('0x5'))(_0x60e7('0x6'));var config=require('../../config/environment');var jayson=require(_0x60e7('0x7'));var client=jayson[_0x60e7('0x8')][_0x60e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xba29ef,_0xa2d5cb,_0x194535){return new BPromise(function(_0x4a15f2,_0xddad15){return client[_0x60e7('0xa')](_0xba29ef,_0x194535)[_0x60e7('0xb')](function(_0x51fff8){logger[_0x60e7('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0xa2d5cb,_0x60e7('0xd'));logger[_0x60e7('0xe')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0xa2d5cb,_0x60e7('0xd'),JSON['stringify'](_0x51fff8));if(_0x51fff8[_0x60e7('0xf')]){if(_0x51fff8[_0x60e7('0xf')]['code']===0x1f4){logger['error'](_0x60e7('0x10'),_0xa2d5cb,_0x51fff8[_0x60e7('0xf')][_0x60e7('0x11')]);return _0xddad15(_0x51fff8[_0x60e7('0xf')]['message']);}logger[_0x60e7('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0xa2d5cb,_0x51fff8[_0x60e7('0xf')][_0x60e7('0x11')]);return _0x4a15f2(_0x51fff8['error'][_0x60e7('0x11')]);}else{logger['info'](_0x60e7('0x10'),_0xa2d5cb,_0x60e7('0xd'));_0x4a15f2(_0x51fff8[_0x60e7('0x12')]['message']);}})['catch'](function(_0x376fde){logger['error'](_0x60e7('0x10'),_0xa2d5cb,_0x376fde);_0xddad15(_0x376fde);});});}exports[_0x60e7('0x13')]=function(_0x2a136a){var _0x29625d=this;return new Promise(function(_0x54a701,_0x676b92){return db['ZendeskAccount'][_0x60e7('0x14')]({'raw':_0x2a136a[_0x60e7('0x15')]?_0x2a136a[_0x60e7('0x15')][_0x60e7('0x16')]===undefined?!![]:![]:!![],'where':_0x2a136a[_0x60e7('0x15')]?_0x2a136a[_0x60e7('0x15')][_0x60e7('0x17')]||null:null,'attributes':_0x2a136a[_0x60e7('0x15')]?_0x2a136a['options'][_0x60e7('0x18')]||null:null,'limit':_0x2a136a[_0x60e7('0x15')]?_0x2a136a['options'][_0x60e7('0x19')]||null:null,'include':_0x2a136a['options']?_0x2a136a[_0x60e7('0x15')][_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x2a136a[_0x60e7('0x15')][_0x60e7('0x1a')],function(_0x4258a2){return{'model':db[_0x4258a2['model']],'as':_0x4258a2['as'],'attributes':_0x4258a2[_0x60e7('0x18')],'include':_0x4258a2[_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x4258a2['include'],function(_0x4a0605){return{'model':db[_0x4a0605[_0x60e7('0x1c')]],'as':_0x4a0605['as'],'attributes':_0x4a0605[_0x60e7('0x18')],'include':_0x4a0605[_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x4a0605['include'],function(_0x3c8084){return{'model':db[_0x3c8084[_0x60e7('0x1c')]],'as':_0x3c8084['as'],'attributes':_0x3c8084[_0x60e7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x60e7('0xb')](function(_0x4063dc){logger['info'](_0x60e7('0x13'),_0x2a136a);logger[_0x60e7('0xe')](_0x60e7('0x13'),_0x2a136a,JSON[_0x60e7('0x1d')](_0x4063dc));_0x54a701(_0x4063dc);})[_0x60e7('0x1e')](function(_0x311c17){logger['error'](_0x60e7('0x13'),_0x311c17['message'],_0x2a136a);_0x676b92(_0x29625d[_0x60e7('0xf')](0x1f4,_0x311c17['message']));});});};exports[_0x60e7('0x1f')]=function(_0x1c0efb){var _0x3f3d5d=this;return new Promise(function(_0x3d7a48,_0x2a9151){return db[_0x60e7('0x20')][_0x60e7('0x21')]({'raw':_0x1c0efb['options']?_0x1c0efb[_0x60e7('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1c0efb[_0x60e7('0x15')]?_0x1c0efb[_0x60e7('0x15')][_0x60e7('0x17')]||null:null,'attributes':_0x1c0efb[_0x60e7('0x15')]?_0x1c0efb[_0x60e7('0x15')][_0x60e7('0x18')]||null:null,'include':_0x1c0efb[_0x60e7('0x15')]?_0x1c0efb[_0x60e7('0x15')]['include']?_[_0x60e7('0x1b')](_0x1c0efb['options'][_0x60e7('0x1a')],function(_0x495a70){return{'model':db[_0x495a70['model']],'as':_0x495a70['as'],'attributes':_0x495a70['attributes'],'include':_0x495a70['include']?_['map'](_0x495a70['include'],function(_0x5e252d){return{'model':db[_0x5e252d[_0x60e7('0x1c')]],'as':_0x5e252d['as'],'attributes':_0x5e252d['attributes'],'include':_0x5e252d[_0x60e7('0x1a')]?_[_0x60e7('0x1b')](_0x5e252d[_0x60e7('0x1a')],function(_0x1d2113){return{'model':db[_0x1d2113[_0x60e7('0x1c')]],'as':_0x1d2113['as'],'attributes':_0x1d2113[_0x60e7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x60e7('0xb')](function(_0x22dd70){logger[_0x60e7('0xc')]('ShowZendeskAccount',_0x1c0efb);logger[_0x60e7('0xe')]('ShowZendeskAccount',_0x1c0efb,JSON[_0x60e7('0x1d')](_0x22dd70));_0x3d7a48(_0x22dd70);})[_0x60e7('0x1e')](function(_0x28a857){logger[_0x60e7('0xf')]('ShowZendeskAccount',_0x28a857[_0x60e7('0x11')],_0x1c0efb);_0x2a9151(_0x3f3d5d[_0x60e7('0xf')](0x1f4,_0x28a857[_0x60e7('0x11')]));});});};
\ No newline at end of file
index 186a426..aab72be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b5=['../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ab6ea,_0x5dd72d){var _0x11aeb1=function(_0x17da6e){while(--_0x17da6e){_0x4ab6ea['push'](_0x4ab6ea['shift']());}};_0x11aeb1(++_0x5dd72d);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x25bca6,_0xe415ea){_0x25bca6=_0x25bca6-0x0;var _0x3f8d02=_0xe5b5[_0x25bca6];return _0x3f8d02;};'use strict';var multer=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var path=require(_0x5e5b('0x2'));var timeout=require(_0x5e5b('0x3'));var express=require(_0x5e5b('0x4'));var router=express[_0x5e5b('0x5')]();var fs_extra=require(_0x5e5b('0x6'));var auth=require(_0x5e5b('0x7'));var interaction=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var controller=require(_0x5e5b('0xa'));router[_0x5e5b('0xb')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xd')]);router[_0x5e5b('0xb')](_0x5e5b('0xe'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0xf')]);router[_0x5e5b('0xb')](_0x5e5b('0x10'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x11')]);router[_0x5e5b('0xb')]('/:id/subjects',auth[_0x5e5b('0xc')](),controller['getSubjects']);router[_0x5e5b('0xb')](_0x5e5b('0x12'),auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x13')]);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0x5e5b('0x14')]);router[_0x5e5b('0x15')]('/',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x16')]);router[_0x5e5b('0x15')](_0x5e5b('0x17'),auth[_0x5e5b('0xc')](),controller['setTags']);router[_0x5e5b('0x18')](_0x5e5b('0xe'),auth['isAuthenticated'](),controller[_0x5e5b('0x19')]);router['delete']('/:id',auth[_0x5e5b('0xc')](),controller[_0x5e5b('0x1a')]);module[_0x5e5b('0x1b')]=router;
\ No newline at end of file
+var _0x4fc2=['get','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','/:id','show'];(function(_0x28669b,_0x5e10c2){var _0xd8b7ba=function(_0x4fb22d){while(--_0x4fb22d){_0x28669b['push'](_0x28669b['shift']());}};_0xd8b7ba(++_0x5e10c2);}(_0x4fc2,0x111));var _0x24fc=function(_0x2f4ea9,_0x195a39){_0x2f4ea9=_0x2f4ea9-0x0;var _0x2b1b8d=_0x4fc2[_0x2f4ea9];return _0x2b1b8d;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getFields']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['get'](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['getTags']);router[_0x24fc('0x14')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x15')]);router[_0x24fc('0x14')](_0x24fc('0x13'),auth[_0x24fc('0x9')](),controller['setTags']);router[_0x24fc('0x16')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x17')]);router['delete'](_0x24fc('0xb'),auth['isAuthenticated'](),controller[_0x24fc('0x18')]);module[_0x24fc('0x19')]=router;
\ No newline at end of file
index a688135..28ce366 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5955=['sequelize','exports','STRING'];(function(_0x673722,_0x275d7e){var _0x21249c=function(_0x25b4e7){while(--_0x25b4e7){_0x673722['push'](_0x673722['shift']());}};_0x21249c(++_0x275d7e);}(_0x5955,0x123));var _0x5595=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x5955[_0x208d75];return _0x382d27;};'use strict';var Sequelize=require(_0x5595('0x0'));module[_0x5595('0x1')]={'name':{'type':Sequelize[_0x5595('0x2')]},'description':{'type':Sequelize[_0x5595('0x2')]}};
\ No newline at end of file
index 38fa986..aa2c001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63c0=['show','params','length','includeAll','find','create','body','getFields','ZendeskField','getSubjects','findOne','order','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','name','send','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x63c0,0x66));var _0x063c=function(_0x235186,_0xf3fdc2){_0x235186=_0x235186-0x0;var _0x103007=_0x63c0[_0x235186];return _0x103007;};'use strict';var emlformat=require(_0x063c('0x0'));var rimraf=require(_0x063c('0x1'));var zipdir=require(_0x063c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x063c('0x3'));var moment=require('moment');var BPromise=require(_0x063c('0x4'));var Mustache=require(_0x063c('0x5'));var util=require(_0x063c('0x6'));var path=require(_0x063c('0x7'));var sox=require('sox');var csv=require(_0x063c('0x8'));var ejs=require(_0x063c('0x9'));var fs=require('fs');var fs_extra=require(_0x063c('0xa'));var _=require(_0x063c('0xb'));var squel=require(_0x063c('0xc'));var crypto=require(_0x063c('0xd'));var jsforce=require(_0x063c('0xe'));var deskjs=require(_0x063c('0xf'));var toCsv=require(_0x063c('0x8'));var querystring=require(_0x063c('0x10'));var Papa=require('papaparse');var Redis=require(_0x063c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x063c('0x12'));var as=require(_0x063c('0x13'));var hardwareService=require(_0x063c('0x14'));var logger=require(_0x063c('0x15'))(_0x063c('0x16'));var utils=require(_0x063c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x063c('0x18'));var db=require(_0x063c('0x19'))['db'];function respondWithStatusCode(_0x1407ab,_0x553728){_0x553728=_0x553728||0xcc;return function(_0x36f5e4){if(_0x36f5e4){return _0x1407ab[_0x063c('0x1a')](_0x553728);}return _0x1407ab[_0x063c('0x1b')](_0x553728)[_0x063c('0x1c')]();};}function respondWithResult(_0x1ee0dc,_0xa7e5e6){_0xa7e5e6=_0xa7e5e6||0xc8;return function(_0x240936){if(_0x240936){return _0x1ee0dc['status'](_0xa7e5e6)[_0x063c('0x1d')](_0x240936);}};}function respondWithFilteredResult(_0x157bd0,_0x4cfac6){return function(_0x501c48){if(_0x501c48){var _0xd9c07e=typeof _0x4cfac6['offset']===_0x063c('0x1e')&&typeof _0x4cfac6['limit']===_0x063c('0x1e');var _0x46c838=_0x501c48['count'];var _0x18c0bd=_0xd9c07e?0x0:_0x4cfac6['offset'];var _0x4fecab=_0xd9c07e?_0x501c48[_0x063c('0x1f')]:_0x4cfac6[_0x063c('0x20')]+_0x4cfac6[_0x063c('0x21')];var _0x2240aa;if(_0x4fecab>=_0x46c838){_0x4fecab=_0x46c838;_0x2240aa=0xc8;}else{_0x2240aa=0xce;}_0x157bd0[_0x063c('0x1b')](_0x2240aa);return _0x157bd0[_0x063c('0x22')](_0x063c('0x23'),_0x18c0bd+'-'+_0x4fecab+'/'+_0x46c838)[_0x063c('0x1d')](_0x501c48);}return null;};}function patchUpdates(_0x182fe2){return function(_0x544595){try{jsonpatch[_0x063c('0x24')](_0x544595,_0x182fe2,!![]);}catch(_0x119cb9){return BPromise[_0x063c('0x25')](_0x119cb9);}return _0x544595[_0x063c('0x26')]();};}function saveUpdates(_0x453133,_0x5c7420){return function(_0xe343fe){if(_0xe343fe){return _0xe343fe[_0x063c('0x27')](_0x453133)['then'](function(_0x9ea72b){return _0x9ea72b;});}return null;};}function removeEntity(_0x24c323,_0x40f5f1){return function(_0x186c9d){if(_0x186c9d){return _0x186c9d[_0x063c('0x28')]()[_0x063c('0x29')](function(){_0x24c323[_0x063c('0x1b')](0xcc)[_0x063c('0x1c')]();});}};}function handleEntityNotFound(_0x34982c,_0x1227a2){return function(_0x45777c){if(!_0x45777c){_0x34982c['sendStatus'](0x194);}return _0x45777c;};}function handleError(_0x2f0b1a,_0x4f391e){_0x4f391e=_0x4f391e||0x1f4;return function(_0xc0a549){logger['error'](_0xc0a549['stack']);if(_0xc0a549[_0x063c('0x2a')]){delete _0xc0a549[_0x063c('0x2a')];}_0x2f0b1a[_0x063c('0x1b')](_0x4f391e)[_0x063c('0x2b')](_0xc0a549);};}exports['index']=function(_0x3bf612,_0x4cebb4){var _0x2221e0={},_0x41fff2={},_0x46c6dd={'count':0x0,'rows':[]};var _0x39242c=_['map'](db[_0x063c('0x2c')][_0x063c('0x2d')],function(_0x588166){return{'name':_0x588166[_0x063c('0x2e')],'type':_0x588166[_0x063c('0x2f')][_0x063c('0x30')]};});_0x41fff2[_0x063c('0x31')]=_[_0x063c('0x32')](_0x39242c,_0x063c('0x2a'));_0x41fff2[_0x063c('0x33')]=_[_0x063c('0x34')](_0x3bf612[_0x063c('0x33')]);_0x41fff2['filters']=_[_0x063c('0x35')](_0x41fff2[_0x063c('0x31')],_0x41fff2[_0x063c('0x33')]);_0x2221e0['attributes']=_[_0x063c('0x35')](_0x41fff2[_0x063c('0x31')],qs[_0x063c('0x36')](_0x3bf612[_0x063c('0x33')]['fields']));_0x2221e0[_0x063c('0x37')]=_0x2221e0[_0x063c('0x37')]['length']?_0x2221e0[_0x063c('0x37')]:_0x41fff2[_0x063c('0x31')];if(!_0x3bf612[_0x063c('0x33')][_0x063c('0x38')](_0x063c('0x39'))){_0x2221e0[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x3bf612[_0x063c('0x33')][_0x063c('0x21')]);_0x2221e0[_0x063c('0x20')]=qs[_0x063c('0x20')](_0x3bf612['query'][_0x063c('0x20')]);}_0x2221e0['order']=qs['sort'](_0x3bf612[_0x063c('0x33')][_0x063c('0x3a')]);_0x2221e0[_0x063c('0x3b')]=qs[_0x063c('0x3c')](_[_0x063c('0x3d')](_0x3bf612[_0x063c('0x33')],_0x41fff2[_0x063c('0x3c')]),_0x39242c);if(_0x3bf612[_0x063c('0x33')][_0x063c('0x3e')]){_0x2221e0[_0x063c('0x3b')]=_['merge'](_0x2221e0[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x39242c,function(_0x5100d7){if(_0x5100d7['type']!==_0x063c('0x3f')){var _0x56f68f={};_0x56f68f[_0x5100d7[_0x063c('0x2a')]]={'$like':'%'+_0x3bf612['query'][_0x063c('0x3e')]+'%'};return _0x56f68f;}})});}_0x2221e0=_[_0x063c('0x40')]({},_0x2221e0,_0x3bf612[_0x063c('0x41')]);var _0x37a7cd={'where':_0x2221e0['where']};return db[_0x063c('0x2c')][_0x063c('0x1f')](_0x37a7cd)[_0x063c('0x29')](function(_0x1d1181){_0x46c6dd[_0x063c('0x1f')]=_0x1d1181;if(_0x3bf612[_0x063c('0x33')]['includeAll']){_0x2221e0[_0x063c('0x42')]=[{'all':!![]}];}return db[_0x063c('0x2c')][_0x063c('0x43')](_0x2221e0);})[_0x063c('0x29')](function(_0x153aa3){_0x46c6dd[_0x063c('0x44')]=_0x153aa3;return _0x46c6dd;})[_0x063c('0x29')](respondWithFilteredResult(_0x4cebb4,_0x2221e0))[_0x063c('0x45')](handleError(_0x4cebb4,null));};exports[_0x063c('0x46')]=function(_0x4f21a9,_0x458f7a){var _0x51ac05={'raw':![],'where':{'id':_0x4f21a9[_0x063c('0x47')]['id']}},_0x1425de={};_0x1425de[_0x063c('0x31')]=_['keys'](db[_0x063c('0x2c')][_0x063c('0x2d')]);_0x1425de['query']=_[_0x063c('0x34')](_0x4f21a9[_0x063c('0x33')]);_0x1425de['filters']=_[_0x063c('0x35')](_0x1425de['model'],_0x1425de[_0x063c('0x33')]);_0x51ac05[_0x063c('0x37')]=_[_0x063c('0x35')](_0x1425de[_0x063c('0x31')],qs[_0x063c('0x36')](_0x4f21a9['query'][_0x063c('0x36')]));_0x51ac05['attributes']=_0x51ac05[_0x063c('0x37')][_0x063c('0x48')]?_0x51ac05['attributes']:_0x1425de['model'];if(_0x4f21a9[_0x063c('0x33')][_0x063c('0x49')]){_0x51ac05[_0x063c('0x42')]=[{'all':!![]}];}_0x51ac05=_[_0x063c('0x40')]({},_0x51ac05,_0x4f21a9[_0x063c('0x41')]);return db[_0x063c('0x2c')][_0x063c('0x4a')](_0x51ac05)[_0x063c('0x29')](handleEntityNotFound(_0x458f7a,null))[_0x063c('0x29')](respondWithResult(_0x458f7a,null))[_0x063c('0x45')](handleError(_0x458f7a,null));};exports[_0x063c('0x4b')]=function(_0x25efb7,_0x18d9c2){return db[_0x063c('0x2c')][_0x063c('0x4b')](_0x25efb7[_0x063c('0x4c')],{})[_0x063c('0x29')](respondWithResult(_0x18d9c2,0xc9))['catch'](handleError(_0x18d9c2,null));};exports[_0x063c('0x27')]=function(_0x20bfa6,_0x291f0a){if(_0x20bfa6[_0x063c('0x4c')]['id']){delete _0x20bfa6[_0x063c('0x4c')]['id'];}return db['ZendeskConfiguration'][_0x063c('0x4a')]({'where':{'id':_0x20bfa6[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x291f0a,null))[_0x063c('0x29')](saveUpdates(_0x20bfa6['body'],null))[_0x063c('0x29')](respondWithResult(_0x291f0a,null))[_0x063c('0x45')](handleError(_0x291f0a,null));};exports['destroy']=function(_0x1382ec,_0x3dc9c7){return db['ZendeskConfiguration']['find']({'where':{'id':_0x1382ec[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x3dc9c7,null))['then'](removeEntity(_0x3dc9c7,null))['catch'](handleError(_0x3dc9c7,null));};exports[_0x063c('0x4d')]=function(_0x1feeff,_0x23fd92,_0x1f6f17){var _0x4393b8={};var _0x3a417d={};var _0x4761fe;var _0xb4a128;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x1feeff[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x23fd92,null))[_0x063c('0x29')](function(_0x1ed94f){if(_0x1ed94f){_0x4761fe=_0x1ed94f;_0x3a417d['model']=_[_0x063c('0x34')](db[_0x063c('0x4e')][_0x063c('0x2d')]);_0x3a417d[_0x063c('0x33')]=_['keys'](_0x1feeff['query']);_0x3a417d['filters']=_[_0x063c('0x35')](_0x3a417d['model'],_0x3a417d[_0x063c('0x33')]);_0x4393b8[_0x063c('0x37')]=_[_0x063c('0x35')](_0x3a417d['model'],qs[_0x063c('0x36')](_0x1feeff[_0x063c('0x33')][_0x063c('0x36')]));_0x4393b8[_0x063c('0x37')]=_0x4393b8[_0x063c('0x37')][_0x063c('0x48')]?_0x4393b8[_0x063c('0x37')]:_0x3a417d[_0x063c('0x31')];_0x4393b8['order']=qs[_0x063c('0x3a')](_0x1feeff[_0x063c('0x33')][_0x063c('0x3a')]);_0x4393b8['where']=qs[_0x063c('0x3c')](_[_0x063c('0x3d')](_0x1feeff[_0x063c('0x33')],_0x3a417d['filters']));if(_0x1feeff[_0x063c('0x33')]['filter']){_0x4393b8[_0x063c('0x3b')]=_[_0x063c('0x40')](_0x4393b8[_0x063c('0x3b')],{'$or':_['map'](_0x4393b8[_0x063c('0x37')],function(_0x5433e4){var _0x1192a0={};_0x1192a0[_0x5433e4]={'$like':'%'+_0x1feeff['query'][_0x063c('0x3e')]+'%'};return _0x1192a0;})});}_0x4393b8=_[_0x063c('0x40')]({},_0x4393b8,_0x1feeff[_0x063c('0x41')]);return _0x4761fe['getFields'](_0x4393b8);}})[_0x063c('0x29')](function(_0x8ae62f){if(_0x8ae62f){_0xb4a128=_0x8ae62f['length'];if(!_0x1feeff[_0x063c('0x33')][_0x063c('0x38')](_0x063c('0x39'))){_0x4393b8[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x1feeff['query'][_0x063c('0x21')]);_0x4393b8['offset']=qs[_0x063c('0x20')](_0x1feeff[_0x063c('0x33')]['offset']);}return _0x4761fe['getFields'](_0x4393b8);}})[_0x063c('0x29')](function(_0x3b6b86){if(_0x3b6b86){return _0x3b6b86?{'count':_0xb4a128,'rows':_0x3b6b86}:null;}})[_0x063c('0x29')](respondWithResult(_0x23fd92,null))[_0x063c('0x45')](handleError(_0x23fd92,null));};exports[_0x063c('0x4f')]=function(_0x389bf0,_0x743212,_0x578ba0){var _0x56ec5e={};var _0x10573d={};var _0x2b089c;var _0x4b5cb2;return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x389bf0[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x743212,null))[_0x063c('0x29')](function(_0x1b50f9){if(_0x1b50f9){_0x2b089c=_0x1b50f9;_0x10573d['model']=_[_0x063c('0x34')](db['ZendeskField']['rawAttributes']);_0x10573d['query']=_[_0x063c('0x34')](_0x389bf0[_0x063c('0x33')]);_0x10573d[_0x063c('0x3c')]=_['intersection'](_0x10573d[_0x063c('0x31')],_0x10573d[_0x063c('0x33')]);_0x56ec5e[_0x063c('0x37')]=_[_0x063c('0x35')](_0x10573d['model'],qs[_0x063c('0x36')](_0x389bf0[_0x063c('0x33')]['fields']));_0x56ec5e[_0x063c('0x37')]=_0x56ec5e[_0x063c('0x37')][_0x063c('0x48')]?_0x56ec5e[_0x063c('0x37')]:_0x10573d[_0x063c('0x31')];_0x56ec5e[_0x063c('0x51')]=qs['sort'](_0x389bf0['query'][_0x063c('0x3a')]);_0x56ec5e[_0x063c('0x3b')]=qs[_0x063c('0x3c')](_[_0x063c('0x3d')](_0x389bf0['query'],_0x10573d[_0x063c('0x3c')]));if(_0x389bf0['query'][_0x063c('0x3e')]){_0x56ec5e['where']=_['merge'](_0x56ec5e[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x56ec5e['attributes'],function(_0x30520c){var _0x3eadc0={};_0x3eadc0[_0x30520c]={'$like':'%'+_0x389bf0['query'][_0x063c('0x3e')]+'%'};return _0x3eadc0;})});}_0x56ec5e=_[_0x063c('0x40')]({},_0x56ec5e,_0x389bf0['options']);return _0x2b089c[_0x063c('0x4f')](_0x56ec5e);}})['then'](function(_0x4b32c1){if(_0x4b32c1){_0x4b5cb2=_0x4b32c1[_0x063c('0x48')];if(!_0x389bf0['query']['hasOwnProperty'](_0x063c('0x39'))){_0x56ec5e['limit']=qs['limit'](_0x389bf0[_0x063c('0x33')][_0x063c('0x21')]);_0x56ec5e[_0x063c('0x20')]=qs[_0x063c('0x20')](_0x389bf0[_0x063c('0x33')]['offset']);}return _0x2b089c[_0x063c('0x4f')](_0x56ec5e);}})[_0x063c('0x29')](function(_0x4211ff){if(_0x4211ff){return _0x4211ff?{'count':_0x4b5cb2,'rows':_0x4211ff}:null;}})['then'](respondWithResult(_0x743212,null))[_0x063c('0x45')](handleError(_0x743212,null));};exports[_0x063c('0x52')]=function(_0x4b29e9,_0x410fb2,_0x40ab2b){var _0x18517e={};var _0x19b352={};var _0x82343f;var _0x41f92d;return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x4b29e9[_0x063c('0x47')]['id']}})['then'](handleEntityNotFound(_0x410fb2,null))[_0x063c('0x29')](function(_0x141530){if(_0x141530){_0x82343f=_0x141530;_0x19b352[_0x063c('0x31')]=_['keys'](db['ZendeskField'][_0x063c('0x2d')]);_0x19b352[_0x063c('0x33')]=_[_0x063c('0x34')](_0x4b29e9[_0x063c('0x33')]);_0x19b352[_0x063c('0x3c')]=_[_0x063c('0x35')](_0x19b352[_0x063c('0x31')],_0x19b352['query']);_0x18517e[_0x063c('0x37')]=_[_0x063c('0x35')](_0x19b352[_0x063c('0x31')],qs[_0x063c('0x36')](_0x4b29e9['query'][_0x063c('0x36')]));_0x18517e[_0x063c('0x37')]=_0x18517e['attributes']['length']?_0x18517e['attributes']:_0x19b352[_0x063c('0x31')];_0x18517e['order']=qs[_0x063c('0x3a')](_0x4b29e9['query'][_0x063c('0x3a')]);_0x18517e[_0x063c('0x3b')]=qs['filters'](_[_0x063c('0x3d')](_0x4b29e9[_0x063c('0x33')],_0x19b352[_0x063c('0x3c')]));if(_0x4b29e9['query']['filter']){_0x18517e['where']=_[_0x063c('0x40')](_0x18517e[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x18517e['attributes'],function(_0x206530){var _0x30e01d={};_0x30e01d[_0x206530]={'$like':'%'+_0x4b29e9[_0x063c('0x33')][_0x063c('0x3e')]+'%'};return _0x30e01d;})});}_0x18517e=_[_0x063c('0x40')]({},_0x18517e,_0x4b29e9[_0x063c('0x41')]);return _0x82343f[_0x063c('0x52')](_0x18517e);}})[_0x063c('0x29')](function(_0x8db9e5){if(_0x8db9e5){_0x41f92d=_0x8db9e5[_0x063c('0x48')];if(!_0x4b29e9[_0x063c('0x33')][_0x063c('0x38')](_0x063c('0x39'))){_0x18517e[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x4b29e9['query']['limit']);_0x18517e['offset']=qs['offset'](_0x4b29e9[_0x063c('0x33')][_0x063c('0x20')]);}return _0x82343f[_0x063c('0x52')](_0x18517e);}})[_0x063c('0x29')](function(_0x1210bf){if(_0x1210bf){return _0x1210bf?{'count':_0x41f92d,'rows':_0x1210bf}:null;}})[_0x063c('0x29')](respondWithResult(_0x410fb2,null))[_0x063c('0x45')](handleError(_0x410fb2,null));};exports[_0x063c('0x53')]=function(_0x3c5288,_0x131909,_0xade72f){var _0x16e8b7={};var _0x4ca36e={};var _0x55ada2;var _0x2ab32e;return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x3c5288[_0x063c('0x47')]['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x131909,null))['then'](function(_0x4f5ff2){if(_0x4f5ff2){_0x55ada2=_0x4f5ff2;_0x4ca36e[_0x063c('0x31')]=_[_0x063c('0x34')](db['Tag']['rawAttributes']);_0x4ca36e['query']=_[_0x063c('0x34')](_0x3c5288['query']);_0x4ca36e[_0x063c('0x3c')]=_[_0x063c('0x35')](_0x4ca36e['model'],_0x4ca36e['query']);_0x16e8b7[_0x063c('0x37')]=_[_0x063c('0x35')](_0x4ca36e[_0x063c('0x31')],qs['fields'](_0x3c5288[_0x063c('0x33')][_0x063c('0x36')]));_0x16e8b7[_0x063c('0x37')]=_0x16e8b7[_0x063c('0x37')][_0x063c('0x48')]?_0x16e8b7[_0x063c('0x37')]:_0x4ca36e[_0x063c('0x31')];_0x16e8b7['order']=qs[_0x063c('0x3a')](_0x3c5288[_0x063c('0x33')]['sort']);_0x16e8b7[_0x063c('0x3b')]=qs['filters'](_[_0x063c('0x3d')](_0x3c5288[_0x063c('0x33')],_0x4ca36e['filters']));if(_0x3c5288['query'][_0x063c('0x3e')]){_0x16e8b7[_0x063c('0x3b')]=_[_0x063c('0x40')](_0x16e8b7[_0x063c('0x3b')],{'$or':_[_0x063c('0x32')](_0x16e8b7['attributes'],function(_0x13dde7){var _0x250b36={};_0x250b36[_0x13dde7]={'$like':'%'+_0x3c5288[_0x063c('0x33')][_0x063c('0x3e')]+'%'};return _0x250b36;})});}_0x16e8b7=_[_0x063c('0x40')]({},_0x16e8b7,_0x3c5288[_0x063c('0x41')]);return _0x55ada2[_0x063c('0x53')](_0x16e8b7);}})[_0x063c('0x29')](function(_0x12a0d4){if(_0x12a0d4){_0x2ab32e=_0x12a0d4[_0x063c('0x48')];if(!_0x3c5288[_0x063c('0x33')]['hasOwnProperty'](_0x063c('0x39'))){_0x16e8b7[_0x063c('0x21')]=qs[_0x063c('0x21')](_0x3c5288['query']['limit']);_0x16e8b7[_0x063c('0x20')]=qs[_0x063c('0x20')](_0x3c5288[_0x063c('0x33')][_0x063c('0x20')]);}return _0x55ada2['getTags'](_0x16e8b7);}})[_0x063c('0x29')](function(_0x333090){if(_0x333090){return _0x333090?{'count':_0x2ab32e,'rows':_0x333090}:null;}})[_0x063c('0x29')](respondWithResult(_0x131909,null))[_0x063c('0x45')](handleError(_0x131909,null));};exports['setTags']=function(_0x2d9c22,_0x36a1e1,_0x47ee40){if(_0x2d9c22[_0x063c('0x4c')]['id']){delete _0x2d9c22[_0x063c('0x4c')]['id'];}return db[_0x063c('0x2c')][_0x063c('0x50')]({'where':{'id':_0x2d9c22['params']['id']}})[_0x063c('0x29')](handleEntityNotFound(_0x36a1e1,null))['then'](function(_0x3e5321){if(_0x3e5321){return _0x3e5321[_0x063c('0x54')](_0x2d9c22[_0x063c('0x4c')][_0x063c('0x55')]||[]);}return null;})[_0x063c('0x29')](respondWithResult(_0x36a1e1,null))[_0x063c('0x45')](handleError(_0x36a1e1,null));};
\ No newline at end of file
+var _0xd3b7=['status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','getFields','ZendeskField','order','pick','getSubjects','findOne','nolimit','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x5235af,_0x428a33){var _0x3469c6=function(_0x2d7e93){while(--_0x2d7e93){_0x5235af['push'](_0x5235af['shift']());}};_0x3469c6(++_0x428a33);}(_0xd3b7,0x1d6));var _0x7d3b=function(_0x1f653b,_0x448456){_0x1f653b=_0x1f653b-0x0;var _0x14051e=_0xd3b7[_0x1f653b];return _0x14051e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d3b('0x0'));var zipdir=require(_0x7d3b('0x1'));var jsonpatch=require(_0x7d3b('0x2'));var rp=require(_0x7d3b('0x3'));var moment=require('moment');var BPromise=require(_0x7d3b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7d3b('0x5'));var sox=require(_0x7d3b('0x6'));var csv=require(_0x7d3b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d3b('0x8'));var squel=require(_0x7d3b('0x9'));var crypto=require(_0x7d3b('0xa'));var jsforce=require(_0x7d3b('0xb'));var deskjs=require(_0x7d3b('0xc'));var toCsv=require(_0x7d3b('0x7'));var querystring=require(_0x7d3b('0xd'));var Papa=require('papaparse');var Redis=require(_0x7d3b('0xe'));var authService=require(_0x7d3b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7d3b('0x10'));var hardwareService=require(_0x7d3b('0x11'));var logger=require('../../config/logger')(_0x7d3b('0x12'));var utils=require(_0x7d3b('0x13'));var config=require(_0x7d3b('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25d0ca,_0x1b9bc5){_0x1b9bc5=_0x1b9bc5||0xcc;return function(_0x4d0e3c){if(_0x4d0e3c){return _0x25d0ca[_0x7d3b('0x15')](_0x1b9bc5);}return _0x25d0ca[_0x7d3b('0x16')](_0x1b9bc5)[_0x7d3b('0x17')]();};}function respondWithResult(_0x4f3651,_0x375ad6){_0x375ad6=_0x375ad6||0xc8;return function(_0x5c3e58){if(_0x5c3e58){return _0x4f3651[_0x7d3b('0x16')](_0x375ad6)['json'](_0x5c3e58);}};}function respondWithFilteredResult(_0x4da621,_0x591e69){return function(_0x129131){if(_0x129131){var _0x1a029c=typeof _0x591e69[_0x7d3b('0x18')]===_0x7d3b('0x19')&&typeof _0x591e69[_0x7d3b('0x1a')]===_0x7d3b('0x19');var _0x31126f=_0x129131['count'];var _0x1fa65d=_0x1a029c?0x0:_0x591e69[_0x7d3b('0x18')];var _0x17c4e7=_0x1a029c?_0x129131[_0x7d3b('0x1b')]:_0x591e69[_0x7d3b('0x18')]+_0x591e69['limit'];var _0x49d121;if(_0x17c4e7>=_0x31126f){_0x17c4e7=_0x31126f;_0x49d121=0xc8;}else{_0x49d121=0xce;}_0x4da621[_0x7d3b('0x16')](_0x49d121);return _0x4da621[_0x7d3b('0x1c')](_0x7d3b('0x1d'),_0x1fa65d+'-'+_0x17c4e7+'/'+_0x31126f)[_0x7d3b('0x1e')](_0x129131);}return null;};}function patchUpdates(_0x3c8cbc){return function(_0x3f6079){try{jsonpatch['apply'](_0x3f6079,_0x3c8cbc,!![]);}catch(_0x417476){return BPromise['reject'](_0x417476);}return _0x3f6079[_0x7d3b('0x1f')]();};}function saveUpdates(_0xe1f410,_0xbb9f0){return function(_0x7cf9b4){if(_0x7cf9b4){return _0x7cf9b4[_0x7d3b('0x20')](_0xe1f410)[_0x7d3b('0x21')](function(_0x246018){return _0x246018;});}return null;};}function removeEntity(_0xf5753f,_0x1b6d65){return function(_0x370801){if(_0x370801){return _0x370801[_0x7d3b('0x22')]()[_0x7d3b('0x21')](function(){_0xf5753f[_0x7d3b('0x16')](0xcc)[_0x7d3b('0x17')]();});}};}function handleEntityNotFound(_0xeccfb0,_0xb46ae){return function(_0x4b105b){if(!_0x4b105b){_0xeccfb0[_0x7d3b('0x15')](0x194);}return _0x4b105b;};}function handleError(_0x3fbe22,_0x60a8ca){_0x60a8ca=_0x60a8ca||0x1f4;return function(_0x10d0d2){logger[_0x7d3b('0x23')](_0x10d0d2[_0x7d3b('0x24')]);if(_0x10d0d2[_0x7d3b('0x25')]){delete _0x10d0d2[_0x7d3b('0x25')];}_0x3fbe22['status'](_0x60a8ca)[_0x7d3b('0x26')](_0x10d0d2);};}exports['index']=function(_0x5664eb,_0x503a41){var _0x1792a5={},_0x33413b={},_0x5db3cd={'count':0x0,'rows':[]};var _0x154231=_['map'](db[_0x7d3b('0x27')][_0x7d3b('0x28')],function(_0x61e80){return{'name':_0x61e80[_0x7d3b('0x29')],'type':_0x61e80[_0x7d3b('0x2a')][_0x7d3b('0x2b')]};});_0x33413b[_0x7d3b('0x2c')]=_[_0x7d3b('0x2d')](_0x154231,_0x7d3b('0x25'));_0x33413b[_0x7d3b('0x2e')]=_[_0x7d3b('0x2f')](_0x5664eb[_0x7d3b('0x2e')]);_0x33413b[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0x33413b['model'],_0x33413b[_0x7d3b('0x2e')]);_0x1792a5[_0x7d3b('0x32')]=_[_0x7d3b('0x31')](_0x33413b[_0x7d3b('0x2c')],qs[_0x7d3b('0x33')](_0x5664eb['query'][_0x7d3b('0x33')]));_0x1792a5[_0x7d3b('0x32')]=_0x1792a5[_0x7d3b('0x32')]['length']?_0x1792a5[_0x7d3b('0x32')]:_0x33413b[_0x7d3b('0x2c')];if(!_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x34')]('nolimit')){_0x1792a5[_0x7d3b('0x1a')]=qs['limit'](_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x1792a5['offset']=qs[_0x7d3b('0x18')](_0x5664eb['query'][_0x7d3b('0x18')]);}_0x1792a5['order']=qs[_0x7d3b('0x35')](_0x5664eb['query'][_0x7d3b('0x35')]);_0x1792a5[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_['pick'](_0x5664eb[_0x7d3b('0x2e')],_0x33413b[_0x7d3b('0x30')]),_0x154231);if(_0x5664eb[_0x7d3b('0x2e')]['filter']){_0x1792a5[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x1792a5['where'],{'$or':_['map'](_0x154231,function(_0x282bea){if(_0x282bea['type']!==_0x7d3b('0x38')){var _0x4d1567={};_0x4d1567[_0x282bea[_0x7d3b('0x25')]]={'$like':'%'+_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x39')]+'%'};return _0x4d1567;}})});}_0x1792a5=_['merge']({},_0x1792a5,_0x5664eb[_0x7d3b('0x3a')]);var _0x5657b5={'where':_0x1792a5[_0x7d3b('0x36')]};return db[_0x7d3b('0x27')][_0x7d3b('0x1b')](_0x5657b5)[_0x7d3b('0x21')](function(_0x47dae8){_0x5db3cd['count']=_0x47dae8;if(_0x5664eb[_0x7d3b('0x2e')][_0x7d3b('0x3b')]){_0x1792a5['include']=[{'all':!![]}];}return db[_0x7d3b('0x27')][_0x7d3b('0x3c')](_0x1792a5);})[_0x7d3b('0x21')](function(_0xccfe17){_0x5db3cd[_0x7d3b('0x3d')]=_0xccfe17;return _0x5db3cd;})[_0x7d3b('0x21')](respondWithFilteredResult(_0x503a41,_0x1792a5))['catch'](handleError(_0x503a41,null));};exports[_0x7d3b('0x3e')]=function(_0x103150,_0x1172ad){var _0x20e017={'raw':![],'where':{'id':_0x103150[_0x7d3b('0x3f')]['id']}},_0x3c56e9={};_0x3c56e9[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db[_0x7d3b('0x27')]['rawAttributes']);_0x3c56e9['query']=_[_0x7d3b('0x2f')](_0x103150[_0x7d3b('0x2e')]);_0x3c56e9[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0x3c56e9[_0x7d3b('0x2c')],_0x3c56e9[_0x7d3b('0x2e')]);_0x20e017['attributes']=_['intersection'](_0x3c56e9['model'],qs[_0x7d3b('0x33')](_0x103150[_0x7d3b('0x2e')][_0x7d3b('0x33')]));_0x20e017[_0x7d3b('0x32')]=_0x20e017['attributes'][_0x7d3b('0x40')]?_0x20e017['attributes']:_0x3c56e9[_0x7d3b('0x2c')];if(_0x103150[_0x7d3b('0x2e')]['includeAll']){_0x20e017[_0x7d3b('0x41')]=[{'all':!![]}];}_0x20e017=_[_0x7d3b('0x37')]({},_0x20e017,_0x103150['options']);return db[_0x7d3b('0x27')][_0x7d3b('0x42')](_0x20e017)['then'](handleEntityNotFound(_0x1172ad,null))[_0x7d3b('0x21')](respondWithResult(_0x1172ad,null))[_0x7d3b('0x43')](handleError(_0x1172ad,null));};exports[_0x7d3b('0x44')]=function(_0x4b76e1,_0xc1af0e){return db[_0x7d3b('0x27')][_0x7d3b('0x44')](_0x4b76e1[_0x7d3b('0x45')],{})['then'](respondWithResult(_0xc1af0e,0xc9))[_0x7d3b('0x43')](handleError(_0xc1af0e,null));};exports['update']=function(_0x41b6f3,_0x13bc8c){if(_0x41b6f3[_0x7d3b('0x45')]['id']){delete _0x41b6f3['body']['id'];}return db[_0x7d3b('0x27')]['find']({'where':{'id':_0x41b6f3[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x13bc8c,null))[_0x7d3b('0x21')](saveUpdates(_0x41b6f3[_0x7d3b('0x45')],null))[_0x7d3b('0x21')](respondWithResult(_0x13bc8c,null))[_0x7d3b('0x43')](handleError(_0x13bc8c,null));};exports[_0x7d3b('0x22')]=function(_0xb7f8ee,_0x2d403a){return db[_0x7d3b('0x27')][_0x7d3b('0x42')]({'where':{'id':_0xb7f8ee['params']['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x2d403a,null))['then'](removeEntity(_0x2d403a,null))['catch'](handleError(_0x2d403a,null));};exports[_0x7d3b('0x46')]=function(_0x55f238,_0x55f498,_0x3777b6){var _0x11d2d8={};var _0x4dbf8c={};var _0x41636d;var _0x2a29c6;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x55f238[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x55f498,null))[_0x7d3b('0x21')](function(_0xed799d){if(_0xed799d){_0x41636d=_0xed799d;_0x4dbf8c['model']=_[_0x7d3b('0x2f')](db[_0x7d3b('0x47')][_0x7d3b('0x28')]);_0x4dbf8c[_0x7d3b('0x2e')]=_['keys'](_0x55f238[_0x7d3b('0x2e')]);_0x4dbf8c['filters']=_[_0x7d3b('0x31')](_0x4dbf8c[_0x7d3b('0x2c')],_0x4dbf8c[_0x7d3b('0x2e')]);_0x11d2d8['attributes']=_[_0x7d3b('0x31')](_0x4dbf8c[_0x7d3b('0x2c')],qs['fields'](_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x33')]));_0x11d2d8[_0x7d3b('0x32')]=_0x11d2d8[_0x7d3b('0x32')][_0x7d3b('0x40')]?_0x11d2d8[_0x7d3b('0x32')]:_0x4dbf8c[_0x7d3b('0x2c')];_0x11d2d8[_0x7d3b('0x48')]=qs['sort'](_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x35')]);_0x11d2d8['where']=qs['filters'](_[_0x7d3b('0x49')](_0x55f238[_0x7d3b('0x2e')],_0x4dbf8c[_0x7d3b('0x30')]));if(_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x11d2d8[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x11d2d8[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x11d2d8[_0x7d3b('0x32')],function(_0x5f5d69){var _0x320a2b={};_0x320a2b[_0x5f5d69]={'$like':'%'+_0x55f238['query'][_0x7d3b('0x39')]+'%'};return _0x320a2b;})});}_0x11d2d8=_['merge']({},_0x11d2d8,_0x55f238[_0x7d3b('0x3a')]);return _0x41636d['getFields'](_0x11d2d8);}})['then'](function(_0x48b41a){if(_0x48b41a){_0x2a29c6=_0x48b41a[_0x7d3b('0x40')];if(!_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x34')]('nolimit')){_0x11d2d8[_0x7d3b('0x1a')]=qs[_0x7d3b('0x1a')](_0x55f238[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x11d2d8[_0x7d3b('0x18')]=qs[_0x7d3b('0x18')](_0x55f238[_0x7d3b('0x2e')]['offset']);}return _0x41636d['getFields'](_0x11d2d8);}})['then'](function(_0x1550df){if(_0x1550df){return _0x1550df?{'count':_0x2a29c6,'rows':_0x1550df}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x55f498,null))[_0x7d3b('0x43')](handleError(_0x55f498,null));};exports[_0x7d3b('0x4a')]=function(_0x1c5cd0,_0x1bef77,_0x8a7fbe){var _0x671bc8={};var _0x12560d={};var _0x3e83f8;var _0x550296;return db[_0x7d3b('0x27')][_0x7d3b('0x4b')]({'where':{'id':_0x1c5cd0[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x1bef77,null))['then'](function(_0x2b3ae4){if(_0x2b3ae4){_0x3e83f8=_0x2b3ae4;_0x12560d[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db['ZendeskField']['rawAttributes']);_0x12560d[_0x7d3b('0x2e')]=_[_0x7d3b('0x2f')](_0x1c5cd0[_0x7d3b('0x2e')]);_0x12560d[_0x7d3b('0x30')]=_['intersection'](_0x12560d[_0x7d3b('0x2c')],_0x12560d[_0x7d3b('0x2e')]);_0x671bc8[_0x7d3b('0x32')]=_['intersection'](_0x12560d[_0x7d3b('0x2c')],qs[_0x7d3b('0x33')](_0x1c5cd0[_0x7d3b('0x2e')]['fields']));_0x671bc8[_0x7d3b('0x32')]=_0x671bc8[_0x7d3b('0x32')]['length']?_0x671bc8[_0x7d3b('0x32')]:_0x12560d[_0x7d3b('0x2c')];_0x671bc8['order']=qs[_0x7d3b('0x35')](_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x35')]);_0x671bc8[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_[_0x7d3b('0x49')](_0x1c5cd0['query'],_0x12560d[_0x7d3b('0x30')]));if(_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x671bc8[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x671bc8[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x671bc8[_0x7d3b('0x32')],function(_0x343ec7){var _0x1cdc6a={};_0x1cdc6a[_0x343ec7]={'$like':'%'+_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x39')]+'%'};return _0x1cdc6a;})});}_0x671bc8=_[_0x7d3b('0x37')]({},_0x671bc8,_0x1c5cd0[_0x7d3b('0x3a')]);return _0x3e83f8['getSubjects'](_0x671bc8);}})[_0x7d3b('0x21')](function(_0x227027){if(_0x227027){_0x550296=_0x227027['length'];if(!_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x34')](_0x7d3b('0x4c'))){_0x671bc8[_0x7d3b('0x1a')]=qs[_0x7d3b('0x1a')](_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x671bc8[_0x7d3b('0x18')]=qs[_0x7d3b('0x18')](_0x1c5cd0[_0x7d3b('0x2e')][_0x7d3b('0x18')]);}return _0x3e83f8[_0x7d3b('0x4a')](_0x671bc8);}})['then'](function(_0xffe31){if(_0xffe31){return _0xffe31?{'count':_0x550296,'rows':_0xffe31}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x1bef77,null))[_0x7d3b('0x43')](handleError(_0x1bef77,null));};exports['getDescriptions']=function(_0x74c258,_0x148e3a,_0x16c6dd){var _0x5c63e5={};var _0xc544ad={};var _0x14344f;var _0x25deda;return db[_0x7d3b('0x27')][_0x7d3b('0x4b')]({'where':{'id':_0x74c258['params']['id']}})['then'](handleEntityNotFound(_0x148e3a,null))[_0x7d3b('0x21')](function(_0x1ec8f9){if(_0x1ec8f9){_0x14344f=_0x1ec8f9;_0xc544ad[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db[_0x7d3b('0x47')][_0x7d3b('0x28')]);_0xc544ad['query']=_[_0x7d3b('0x2f')](_0x74c258[_0x7d3b('0x2e')]);_0xc544ad[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0xc544ad[_0x7d3b('0x2c')],_0xc544ad['query']);_0x5c63e5['attributes']=_[_0x7d3b('0x31')](_0xc544ad[_0x7d3b('0x2c')],qs['fields'](_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x33')]));_0x5c63e5[_0x7d3b('0x32')]=_0x5c63e5[_0x7d3b('0x32')][_0x7d3b('0x40')]?_0x5c63e5[_0x7d3b('0x32')]:_0xc544ad['model'];_0x5c63e5[_0x7d3b('0x48')]=qs[_0x7d3b('0x35')](_0x74c258['query'][_0x7d3b('0x35')]);_0x5c63e5[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_[_0x7d3b('0x49')](_0x74c258[_0x7d3b('0x2e')],_0xc544ad[_0x7d3b('0x30')]));if(_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x5c63e5[_0x7d3b('0x36')]=_[_0x7d3b('0x37')](_0x5c63e5[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x5c63e5[_0x7d3b('0x32')],function(_0x37eca6){var _0x31d1e4={};_0x31d1e4[_0x37eca6]={'$like':'%'+_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x39')]+'%'};return _0x31d1e4;})});}_0x5c63e5=_['merge']({},_0x5c63e5,_0x74c258[_0x7d3b('0x3a')]);return _0x14344f[_0x7d3b('0x4d')](_0x5c63e5);}})[_0x7d3b('0x21')](function(_0x169304){if(_0x169304){_0x25deda=_0x169304[_0x7d3b('0x40')];if(!_0x74c258['query']['hasOwnProperty'](_0x7d3b('0x4c'))){_0x5c63e5[_0x7d3b('0x1a')]=qs[_0x7d3b('0x1a')](_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x5c63e5['offset']=qs[_0x7d3b('0x18')](_0x74c258[_0x7d3b('0x2e')][_0x7d3b('0x18')]);}return _0x14344f['getDescriptions'](_0x5c63e5);}})[_0x7d3b('0x21')](function(_0x4b5bbc){if(_0x4b5bbc){return _0x4b5bbc?{'count':_0x25deda,'rows':_0x4b5bbc}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x148e3a,null))[_0x7d3b('0x43')](handleError(_0x148e3a,null));};exports['getTags']=function(_0x375a7f,_0x744f0d,_0x4ce4f4){var _0x33a771={};var _0x412792={};var _0x2d3c93;var _0x178a91;return db[_0x7d3b('0x27')][_0x7d3b('0x4b')]({'where':{'id':_0x375a7f['params']['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x744f0d,null))['then'](function(_0x252484){if(_0x252484){_0x2d3c93=_0x252484;_0x412792[_0x7d3b('0x2c')]=_[_0x7d3b('0x2f')](db[_0x7d3b('0x4e')][_0x7d3b('0x28')]);_0x412792['query']=_['keys'](_0x375a7f[_0x7d3b('0x2e')]);_0x412792[_0x7d3b('0x30')]=_[_0x7d3b('0x31')](_0x412792['model'],_0x412792['query']);_0x33a771[_0x7d3b('0x32')]=_[_0x7d3b('0x31')](_0x412792[_0x7d3b('0x2c')],qs['fields'](_0x375a7f['query'][_0x7d3b('0x33')]));_0x33a771['attributes']=_0x33a771['attributes'][_0x7d3b('0x40')]?_0x33a771[_0x7d3b('0x32')]:_0x412792[_0x7d3b('0x2c')];_0x33a771[_0x7d3b('0x48')]=qs[_0x7d3b('0x35')](_0x375a7f[_0x7d3b('0x2e')]['sort']);_0x33a771[_0x7d3b('0x36')]=qs[_0x7d3b('0x30')](_[_0x7d3b('0x49')](_0x375a7f['query'],_0x412792['filters']));if(_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x39')]){_0x33a771['where']=_[_0x7d3b('0x37')](_0x33a771[_0x7d3b('0x36')],{'$or':_[_0x7d3b('0x2d')](_0x33a771['attributes'],function(_0x38c2af){var _0x4afbf5={};_0x4afbf5[_0x38c2af]={'$like':'%'+_0x375a7f[_0x7d3b('0x2e')]['filter']+'%'};return _0x4afbf5;})});}_0x33a771=_[_0x7d3b('0x37')]({},_0x33a771,_0x375a7f[_0x7d3b('0x3a')]);return _0x2d3c93[_0x7d3b('0x4f')](_0x33a771);}})[_0x7d3b('0x21')](function(_0x3088ac){if(_0x3088ac){_0x178a91=_0x3088ac[_0x7d3b('0x40')];if(!_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x34')](_0x7d3b('0x4c'))){_0x33a771[_0x7d3b('0x1a')]=qs['limit'](_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x1a')]);_0x33a771[_0x7d3b('0x18')]=qs[_0x7d3b('0x18')](_0x375a7f[_0x7d3b('0x2e')][_0x7d3b('0x18')]);}return _0x2d3c93[_0x7d3b('0x4f')](_0x33a771);}})[_0x7d3b('0x21')](function(_0x1b621e){if(_0x1b621e){return _0x1b621e?{'count':_0x178a91,'rows':_0x1b621e}:null;}})[_0x7d3b('0x21')](respondWithResult(_0x744f0d,null))[_0x7d3b('0x43')](handleError(_0x744f0d,null));};exports[_0x7d3b('0x50')]=function(_0x1dad7e,_0x218664,_0x1e233a){if(_0x1dad7e['body']['id']){delete _0x1dad7e[_0x7d3b('0x45')]['id'];}return db['ZendeskConfiguration'][_0x7d3b('0x4b')]({'where':{'id':_0x1dad7e[_0x7d3b('0x3f')]['id']}})[_0x7d3b('0x21')](handleEntityNotFound(_0x218664,null))[_0x7d3b('0x21')](function(_0x4b15c8){if(_0x4b15c8){return _0x4b15c8[_0x7d3b('0x50')](_0x1dad7e['body'][_0x7d3b('0x51')]||[]);}return null;})[_0x7d3b('0x21')](respondWithResult(_0x218664,null))['catch'](handleError(_0x218664,null));};
\ No newline at end of file
index 79faee3..c889eeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','lodash','util','api'];(function(_0x5a8624,_0xc3b173){var _0x373959=function(_0x1f191c){while(--_0x1f191c){_0x5a8624['push'](_0x5a8624['shift']());}};_0x373959(++_0xc3b173);}(_0xe511,0x16f));var _0x1e51=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0xe511[_0x382168];return _0x3ecf7e;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var logger=require('../../config/logger')(_0x1e51('0x2'));var moment=require('moment');var BPromise=require(_0x1e51('0x3'));var rp=require(_0x1e51('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var attributes=require(_0x1e51('0x7'));module[_0x1e51('0x8')]=function(_0x480cca,_0x26b22c){return _0x480cca[_0x1e51('0x9')]('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb688=['exports','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes'];(function(_0x1304ad,_0x3857f4){var _0x4655f0=function(_0x5e0c78){while(--_0x5e0c78){_0x1304ad['push'](_0x1304ad['shift']());}};_0x4655f0(++_0x3857f4);}(_0xb688,0xcf));var _0x8b68=function(_0x429869,_0x5ca6df){_0x429869=_0x429869-0x0;var _0x3c2f89=_0xb688[_0x429869];return _0x3c2f89;};'use strict';var _=require('lodash');var util=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var moment=require(_0x8b68('0x3'));var BPromise=require(_0x8b68('0x4'));var rp=require(_0x8b68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var attributes=require(_0x8b68('0x8'));module[_0x8b68('0x9')]=function(_0x583d16,_0x34314e){return _0x583d16['define'](_0x8b68('0xa'),attributes,{'tableName':_0x8b68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 26a6c5a..0db12d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8445=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x8445,0xc2));var _0x5844=function(_0x62ff29,_0x5b5d4c){_0x62ff29=_0x62ff29-0x0;var _0x63583b=_0x8445[_0x62ff29];return _0x63583b;};'use strict';var _=require(_0x5844('0x0'));var util=require(_0x5844('0x1'));var moment=require('moment');var BPromise=require(_0x5844('0x2'));var rs=require(_0x5844('0x3'));var fs=require('fs');var Redis=require(_0x5844('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5844('0x5'));var logger=require(_0x5844('0x6'))('rpc');var config=require(_0x5844('0x7'));var jayson=require(_0x5844('0x8'));var client=jayson[_0x5844('0x9')][_0x5844('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19c5ef,_0x455360,_0x5dbbaa){return new BPromise(function(_0x57af83,_0x3ec542){return client[_0x5844('0xb')](_0x19c5ef,_0x5dbbaa)['then'](function(_0x44194b){logger[_0x5844('0xc')](_0x5844('0xd'),_0x455360,_0x5844('0xe'));logger[_0x5844('0xf')](_0x5844('0x10'),_0x455360,_0x5844('0xe'),JSON['stringify'](_0x44194b));if(_0x44194b[_0x5844('0x11')]){if(_0x44194b[_0x5844('0x11')][_0x5844('0x12')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x455360,_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);return _0x3ec542(_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);}logger[_0x5844('0x11')](_0x5844('0xd'),_0x455360,_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);return _0x57af83(_0x44194b[_0x5844('0x11')][_0x5844('0x13')]);}else{logger[_0x5844('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x455360,_0x5844('0xe'));_0x57af83(_0x44194b[_0x5844('0x14')]['message']);}})[_0x5844('0x15')](function(_0x5729da){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x455360,_0x5729da);_0x3ec542(_0x5729da);});});}
\ No newline at end of file
+var _0x4581=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2905ab,_0x215005){var _0x24f2eb=function(_0x7e3da6){while(--_0x7e3da6){_0x2905ab['push'](_0x2905ab['shift']());}};_0x24f2eb(++_0x215005);}(_0x4581,0x1a0));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x1458('0x0'));var util=require(_0x1458('0x1'));var moment=require(_0x1458('0x2'));var BPromise=require(_0x1458('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1458('0x4'));var db=require(_0x1458('0x5'))['db'];var utils=require(_0x1458('0x6'));var logger=require(_0x1458('0x7'))(_0x1458('0x8'));var config=require(_0x1458('0x9'));var jayson=require(_0x1458('0xa'));var client=jayson[_0x1458('0xb')][_0x1458('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x419645,_0x4d72b5,_0x26c762){return new BPromise(function(_0x13932e,_0x27887a){return client[_0x1458('0xd')](_0x419645,_0x26c762)[_0x1458('0xe')](function(_0x2c1952){logger['info'](_0x1458('0xf'),_0x4d72b5,_0x1458('0x10'));logger['debug'](_0x1458('0x11'),_0x4d72b5,_0x1458('0x10'),JSON['stringify'](_0x2c1952));if(_0x2c1952[_0x1458('0x12')]){if(_0x2c1952[_0x1458('0x12')][_0x1458('0x13')]===0x1f4){logger['error'](_0x1458('0xf'),_0x4d72b5,_0x2c1952[_0x1458('0x12')][_0x1458('0x14')]);return _0x27887a(_0x2c1952[_0x1458('0x12')]['message']);}logger[_0x1458('0x12')](_0x1458('0xf'),_0x4d72b5,_0x2c1952[_0x1458('0x12')]['message']);return _0x13932e(_0x2c1952[_0x1458('0x12')][_0x1458('0x14')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4d72b5,_0x1458('0x10'));_0x13932e(_0x2c1952[_0x1458('0x15')][_0x1458('0x14')]);}})[_0x1458('0x16')](function(_0x53210a){logger['error'](_0x1458('0xf'),_0x4d72b5,_0x53210a);_0x27887a(_0x53210a);});});}
\ No newline at end of file
index ba94205..b6a5300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd46=['show','post','create','put','update','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x1c783f,_0x1dded1){var _0x3c6b68=function(_0x2ac1b3){while(--_0x2ac1b3){_0x1c783f['push'](_0x1c783f['shift']());}};_0x3c6b68(++_0x1dded1);}(_0xbd46,0x114));var _0x6bd4=function(_0x48961c,_0x280e9d){_0x48961c=_0x48961c-0x0;var _0x1d895d=_0xbd46[_0x48961c];return _0x1d895d;};'use strict';var multer=require('multer');var util=require(_0x6bd4('0x0'));var path=require(_0x6bd4('0x1'));var timeout=require(_0x6bd4('0x2'));var express=require(_0x6bd4('0x3'));var router=express[_0x6bd4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6bd4('0x5'));var interaction=require(_0x6bd4('0x6'));var config=require('../../config/environment');var controller=require(_0x6bd4('0x7'));router[_0x6bd4('0x8')]('/',auth[_0x6bd4('0x9')](),controller[_0x6bd4('0xa')]);router[_0x6bd4('0x8')](_0x6bd4('0xb'),auth[_0x6bd4('0x9')](),controller[_0x6bd4('0xc')]);router[_0x6bd4('0xd')]('/',auth[_0x6bd4('0x9')](),controller[_0x6bd4('0xe')]);router[_0x6bd4('0xf')](_0x6bd4('0xb'),auth[_0x6bd4('0x9')](),controller[_0x6bd4('0x10')]);router['delete'](_0x6bd4('0xb'),auth[_0x6bd4('0x9')](),controller[_0x6bd4('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x48b0=['path','express','fs-extra','../../components/auth/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x1cfb2f,_0x2a2030){var _0x53d73e=function(_0x1826ec){while(--_0x1826ec){_0x1cfb2f['push'](_0x1cfb2f['shift']());}};_0x53d73e(++_0x2a2030);}(_0x48b0,0xf5));var _0x048b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48b0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x048b('0x0'));var util=require(_0x048b('0x1'));var path=require(_0x048b('0x2'));var timeout=require('connect-timeout');var express=require(_0x048b('0x3'));var router=express['Router']();var fs_extra=require(_0x048b('0x4'));var auth=require(_0x048b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x048b('0x6'));var controller=require(_0x048b('0x7'));router[_0x048b('0x8')]('/',auth[_0x048b('0x9')](),controller[_0x048b('0xa')]);router['get'](_0x048b('0xb'),auth[_0x048b('0x9')](),controller[_0x048b('0xc')]);router[_0x048b('0xd')]('/',auth[_0x048b('0x9')](),controller[_0x048b('0xe')]);router[_0x048b('0xf')]('/:id',auth[_0x048b('0x9')](),controller['update']);router[_0x048b('0x10')](_0x048b('0xb'),auth[_0x048b('0x9')](),controller[_0x048b('0x11')]);module[_0x048b('0x12')]=router;
\ No newline at end of file
index 0840c53..b6e6df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7086=['STRING','customVariable','sequelize','ENUM','string','variable','picklist'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7086,0xbf));var _0x6708=function(_0x3a5172,_0x5bf89c){_0x3a5172=_0x3a5172-0x0;var _0x21cd9d=_0x7086[_0x3a5172];return _0x21cd9d;};'use strict';var Sequelize=require(_0x6708('0x0'));module['exports']={'type':{'type':Sequelize[_0x6708('0x1')](_0x6708('0x2'),_0x6708('0x3'),'customVariable','keyValue',_0x6708('0x4')),'defaultValue':_0x6708('0x2')},'content':{'type':Sequelize[_0x6708('0x5')]},'key':{'type':Sequelize[_0x6708('0x5')]},'keyType':{'type':Sequelize[_0x6708('0x1')]('string','variable',_0x6708('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6708('0x5')]}};
\ No newline at end of file
+var _0x634c=['picklist','STRING','variable','customVariable','exports','ENUM','string','keyValue'];(function(_0x5c30c4,_0x472b42){var _0x11b348=function(_0x3e56e4){while(--_0x3e56e4){_0x5c30c4['push'](_0x5c30c4['shift']());}};_0x11b348(++_0x472b42);}(_0x634c,0xd4));var _0xc634=function(_0x31be94,_0x5e7476){_0x31be94=_0x31be94-0x0;var _0x25ebb8=_0x634c[_0x31be94];return _0x25ebb8;};'use strict';var Sequelize=require('sequelize');module[_0xc634('0x0')]={'type':{'type':Sequelize[_0xc634('0x1')](_0xc634('0x2'),'variable','customVariable',_0xc634('0x3'),_0xc634('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc634('0x5')]},'key':{'type':Sequelize[_0xc634('0x5')]},'keyType':{'type':Sequelize[_0xc634('0x1')](_0xc634('0x2'),_0xc634('0x6'),_0xc634('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xc634('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc634('0x5')]}};
\ No newline at end of file
index 1e5a3fb..b0771a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ae=['show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','status','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch'];(function(_0x3555e7,_0x4f1bfd){var _0x1cb906=function(_0xb7d345){while(--_0xb7d345){_0x3555e7['push'](_0x3555e7['shift']());}};_0x1cb906(++_0x4f1bfd);}(_0xc8ae,0x1c2));var _0xec8a=function(_0x574cc5,_0x44c3e3){_0x574cc5=_0x574cc5-0x0;var _0x2398cc=_0xc8ae[_0x574cc5];return _0x2398cc;};'use strict';var emlformat=require(_0xec8a('0x0'));var rimraf=require(_0xec8a('0x1'));var zipdir=require(_0xec8a('0x2'));var jsonpatch=require(_0xec8a('0x3'));var rp=require(_0xec8a('0x4'));var moment=require('moment');var BPromise=require(_0xec8a('0x5'));var Mustache=require('mustache');var util=require(_0xec8a('0x6'));var path=require(_0xec8a('0x7'));var sox=require(_0xec8a('0x8'));var csv=require(_0xec8a('0x9'));var ejs=require(_0xec8a('0xa'));var fs=require('fs');var fs_extra=require(_0xec8a('0xb'));var _=require(_0xec8a('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec8a('0xd'));var deskjs=require(_0xec8a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xec8a('0xf'));var Redis=require(_0xec8a('0x10'));var authService=require(_0xec8a('0x11'));var qs=require(_0xec8a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec8a('0x13'));var logger=require(_0xec8a('0x14'))(_0xec8a('0x15'));var utils=require('../../config/utils');var config=require(_0xec8a('0x16'));var licenseUtil=require(_0xec8a('0x17'));var db=require(_0xec8a('0x18'))['db'];function respondWithStatusCode(_0x43e9aa,_0x5d4ddf){_0x5d4ddf=_0x5d4ddf||0xcc;return function(_0x2d2653){if(_0x2d2653){return _0x43e9aa[_0xec8a('0x19')](_0x5d4ddf);}return _0x43e9aa['status'](_0x5d4ddf)[_0xec8a('0x1a')]();};}function respondWithResult(_0x4317dd,_0x932ed1){_0x932ed1=_0x932ed1||0xc8;return function(_0x519eca){if(_0x519eca){return _0x4317dd['status'](_0x932ed1)['json'](_0x519eca);}};}function respondWithFilteredResult(_0x1ee52b,_0x2e9edd){return function(_0x13a2d5){if(_0x13a2d5){var _0x4de2b9=typeof _0x2e9edd[_0xec8a('0x1b')]===_0xec8a('0x1c')&&typeof _0x2e9edd[_0xec8a('0x1d')]===_0xec8a('0x1c');var _0x5d7aa7=_0x13a2d5['count'];var _0x13b4fa=_0x4de2b9?0x0:_0x2e9edd[_0xec8a('0x1b')];var _0x115323=_0x4de2b9?_0x13a2d5['count']:_0x2e9edd['offset']+_0x2e9edd[_0xec8a('0x1d')];var _0x59753b;if(_0x115323>=_0x5d7aa7){_0x115323=_0x5d7aa7;_0x59753b=0xc8;}else{_0x59753b=0xce;}_0x1ee52b[_0xec8a('0x1e')](_0x59753b);return _0x1ee52b[_0xec8a('0x1f')](_0xec8a('0x20'),_0x13b4fa+'-'+_0x115323+'/'+_0x5d7aa7)[_0xec8a('0x21')](_0x13a2d5);}return null;};}function patchUpdates(_0x4a1cd2){return function(_0x13855b){try{jsonpatch[_0xec8a('0x22')](_0x13855b,_0x4a1cd2,!![]);}catch(_0x267af8){return BPromise[_0xec8a('0x23')](_0x267af8);}return _0x13855b['save']();};}function saveUpdates(_0x3f914d,_0x3d29cc){return function(_0x558508){if(_0x558508){return _0x558508[_0xec8a('0x24')](_0x3f914d)[_0xec8a('0x25')](function(_0x323759){return _0x323759;});}return null;};}function removeEntity(_0x1cd198,_0x190108){return function(_0x31ea81){if(_0x31ea81){return _0x31ea81[_0xec8a('0x26')]()[_0xec8a('0x25')](function(){_0x1cd198[_0xec8a('0x1e')](0xcc)[_0xec8a('0x1a')]();});}};}function handleEntityNotFound(_0x228c81,_0x15ee8c){return function(_0x5dad7b){if(!_0x5dad7b){_0x228c81['sendStatus'](0x194);}return _0x5dad7b;};}function handleError(_0x20eaae,_0x18d3c5){_0x18d3c5=_0x18d3c5||0x1f4;return function(_0x55e428){logger[_0xec8a('0x27')](_0x55e428[_0xec8a('0x28')]);if(_0x55e428[_0xec8a('0x29')]){delete _0x55e428[_0xec8a('0x29')];}_0x20eaae['status'](_0x18d3c5)['send'](_0x55e428);};}exports[_0xec8a('0x2a')]=function(_0x1d4f67,_0x5f2f70){var _0x786e51={},_0x2d7a50={},_0x51652a={'count':0x0,'rows':[]};var _0x16ce4d=_[_0xec8a('0x2b')](db[_0xec8a('0x2c')][_0xec8a('0x2d')],function(_0xa149a1){return{'name':_0xa149a1[_0xec8a('0x2e')],'type':_0xa149a1[_0xec8a('0x2f')][_0xec8a('0x30')]};});_0x2d7a50[_0xec8a('0x31')]=_[_0xec8a('0x2b')](_0x16ce4d,_0xec8a('0x29'));_0x2d7a50[_0xec8a('0x32')]=_[_0xec8a('0x33')](_0x1d4f67[_0xec8a('0x32')]);_0x2d7a50[_0xec8a('0x34')]=_[_0xec8a('0x35')](_0x2d7a50[_0xec8a('0x31')],_0x2d7a50[_0xec8a('0x32')]);_0x786e51['attributes']=_[_0xec8a('0x35')](_0x2d7a50['model'],qs[_0xec8a('0x36')](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x36')]));_0x786e51[_0xec8a('0x37')]=_0x786e51[_0xec8a('0x37')]['length']?_0x786e51[_0xec8a('0x37')]:_0x2d7a50[_0xec8a('0x31')];if(!_0x1d4f67[_0xec8a('0x32')]['hasOwnProperty'](_0xec8a('0x38'))){_0x786e51['limit']=qs[_0xec8a('0x1d')](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x1d')]);_0x786e51['offset']=qs['offset'](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x1b')]);}_0x786e51['order']=qs[_0xec8a('0x39')](_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x39')]);_0x786e51[_0xec8a('0x3a')]=qs[_0xec8a('0x34')](_[_0xec8a('0x3b')](_0x1d4f67[_0xec8a('0x32')],_0x2d7a50[_0xec8a('0x34')]),_0x16ce4d);if(_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x3c')]){_0x786e51['where']=_[_0xec8a('0x3d')](_0x786e51[_0xec8a('0x3a')],{'$or':_[_0xec8a('0x2b')](_0x16ce4d,function(_0x3c21e7){if(_0x3c21e7[_0xec8a('0x2f')]!=='VIRTUAL'){var _0x23e182={};_0x23e182[_0x3c21e7[_0xec8a('0x29')]]={'$like':'%'+_0x1d4f67['query'][_0xec8a('0x3c')]+'%'};return _0x23e182;}})});}_0x786e51=_[_0xec8a('0x3d')]({},_0x786e51,_0x1d4f67['options']);var _0x1c888e={'where':_0x786e51[_0xec8a('0x3a')]};return db[_0xec8a('0x2c')][_0xec8a('0x3e')](_0x1c888e)['then'](function(_0x581d6b){_0x51652a['count']=_0x581d6b;if(_0x1d4f67[_0xec8a('0x32')][_0xec8a('0x3f')]){_0x786e51[_0xec8a('0x40')]=[{'all':!![]}];}return db[_0xec8a('0x2c')][_0xec8a('0x41')](_0x786e51);})[_0xec8a('0x25')](function(_0x1fe0b8){_0x51652a[_0xec8a('0x42')]=_0x1fe0b8;return _0x51652a;})[_0xec8a('0x25')](respondWithFilteredResult(_0x5f2f70,_0x786e51))[_0xec8a('0x43')](handleError(_0x5f2f70,null));};exports[_0xec8a('0x44')]=function(_0x283749,_0x3475c9){var _0x3260ba={'raw':!![],'where':{'id':_0x283749[_0xec8a('0x45')]['id']}},_0x41a91b={};_0x41a91b['model']=_[_0xec8a('0x33')](db[_0xec8a('0x2c')]['rawAttributes']);_0x41a91b['query']=_['keys'](_0x283749[_0xec8a('0x32')]);_0x41a91b[_0xec8a('0x34')]=_[_0xec8a('0x35')](_0x41a91b[_0xec8a('0x31')],_0x41a91b[_0xec8a('0x32')]);_0x3260ba[_0xec8a('0x37')]=_['intersection'](_0x41a91b[_0xec8a('0x31')],qs[_0xec8a('0x36')](_0x283749[_0xec8a('0x32')]['fields']));_0x3260ba[_0xec8a('0x37')]=_0x3260ba[_0xec8a('0x37')][_0xec8a('0x46')]?_0x3260ba[_0xec8a('0x37')]:_0x41a91b[_0xec8a('0x31')];if(_0x283749[_0xec8a('0x32')][_0xec8a('0x3f')]){_0x3260ba[_0xec8a('0x40')]=[{'all':!![]}];}_0x3260ba=_[_0xec8a('0x3d')]({},_0x3260ba,_0x283749['options']);return db[_0xec8a('0x2c')][_0xec8a('0x47')](_0x3260ba)[_0xec8a('0x25')](handleEntityNotFound(_0x3475c9,null))[_0xec8a('0x25')](respondWithResult(_0x3475c9,null))[_0xec8a('0x43')](handleError(_0x3475c9,null));};exports[_0xec8a('0x48')]=function(_0x197667,_0x505718){return db['ZendeskField']['create'](_0x197667[_0xec8a('0x49')],{})[_0xec8a('0x25')](respondWithResult(_0x505718,0xc9))[_0xec8a('0x43')](handleError(_0x505718,null));};exports[_0xec8a('0x24')]=function(_0x44ab59,_0x4f5db4){if(_0x44ab59[_0xec8a('0x49')]['id']){delete _0x44ab59[_0xec8a('0x49')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x44ab59['params']['id']}})[_0xec8a('0x25')](handleEntityNotFound(_0x4f5db4,null))['then'](saveUpdates(_0x44ab59[_0xec8a('0x49')],null))['then'](respondWithResult(_0x4f5db4,null))[_0xec8a('0x43')](handleError(_0x4f5db4,null));};exports[_0xec8a('0x26')]=function(_0x111e64,_0x88f773){return db[_0xec8a('0x2c')]['find']({'where':{'id':_0x111e64['params']['id']}})[_0xec8a('0x25')](handleEntityNotFound(_0x88f773,null))['then'](removeEntity(_0x88f773,null))[_0xec8a('0x43')](handleError(_0x88f773,null));};
\ No newline at end of file
+var _0x63ce=['save','update','then','destroy','end','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','include','catch','params','keys','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0x5823aa,_0x15603c){var _0x4d7c56=function(_0x332eb0){while(--_0x332eb0){_0x5823aa['push'](_0x5823aa['shift']());}};_0x4d7c56(++_0x15603c);}(_0x63ce,0x147));var _0xe63c=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x63ce[_0x590b61];return _0x1a14dc;};'use strict';var emlformat=require(_0xe63c('0x0'));var rimraf=require(_0xe63c('0x1'));var zipdir=require(_0xe63c('0x2'));var jsonpatch=require(_0xe63c('0x3'));var rp=require(_0xe63c('0x4'));var moment=require(_0xe63c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe63c('0x6'));var util=require(_0xe63c('0x7'));var path=require(_0xe63c('0x8'));var sox=require(_0xe63c('0x9'));var csv=require('to-csv');var ejs=require(_0xe63c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe63c('0xb'));var jsforce=require(_0xe63c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe63c('0xd'));var querystring=require(_0xe63c('0xe'));var Papa=require('papaparse');var Redis=require(_0xe63c('0xf'));var authService=require(_0xe63c('0x10'));var qs=require(_0xe63c('0x11'));var as=require(_0xe63c('0x12'));var hardwareService=require(_0xe63c('0x13'));var logger=require('../../config/logger')(_0xe63c('0x14'));var utils=require(_0xe63c('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe63c('0x16'))['db'];function respondWithStatusCode(_0x2e4cbf,_0x5f0c6c){_0x5f0c6c=_0x5f0c6c||0xcc;return function(_0xa24a15){if(_0xa24a15){return _0x2e4cbf[_0xe63c('0x17')](_0x5f0c6c);}return _0x2e4cbf['status'](_0x5f0c6c)['end']();};}function respondWithResult(_0x5786e0,_0x558aa9){_0x558aa9=_0x558aa9||0xc8;return function(_0xf3046a){if(_0xf3046a){return _0x5786e0[_0xe63c('0x18')](_0x558aa9)[_0xe63c('0x19')](_0xf3046a);}};}function respondWithFilteredResult(_0x1cef6e,_0x1e541b){return function(_0x9738da){if(_0x9738da){var _0x420b74=typeof _0x1e541b[_0xe63c('0x1a')]===_0xe63c('0x1b')&&typeof _0x1e541b[_0xe63c('0x1c')]==='undefined';var _0x49ab54=_0x9738da['count'];var _0x3e02c3=_0x420b74?0x0:_0x1e541b[_0xe63c('0x1a')];var _0x59d3c1=_0x420b74?_0x9738da[_0xe63c('0x1d')]:_0x1e541b[_0xe63c('0x1a')]+_0x1e541b['limit'];var _0xfc20ab;if(_0x59d3c1>=_0x49ab54){_0x59d3c1=_0x49ab54;_0xfc20ab=0xc8;}else{_0xfc20ab=0xce;}_0x1cef6e[_0xe63c('0x18')](_0xfc20ab);return _0x1cef6e[_0xe63c('0x1e')](_0xe63c('0x1f'),_0x3e02c3+'-'+_0x59d3c1+'/'+_0x49ab54)['json'](_0x9738da);}return null;};}function patchUpdates(_0x309c21){return function(_0x5a8982){try{jsonpatch['apply'](_0x5a8982,_0x309c21,!![]);}catch(_0x19fc7e){return BPromise[_0xe63c('0x20')](_0x19fc7e);}return _0x5a8982[_0xe63c('0x21')]();};}function saveUpdates(_0x5c9ffc,_0x4afad0){return function(_0x54b1a7){if(_0x54b1a7){return _0x54b1a7[_0xe63c('0x22')](_0x5c9ffc)[_0xe63c('0x23')](function(_0xfed799){return _0xfed799;});}return null;};}function removeEntity(_0x2125aa,_0x3cf4b9){return function(_0x51b31){if(_0x51b31){return _0x51b31[_0xe63c('0x24')]()[_0xe63c('0x23')](function(){_0x2125aa[_0xe63c('0x18')](0xcc)[_0xe63c('0x25')]();});}};}function handleEntityNotFound(_0x3ad4b6,_0x8f585){return function(_0x19a190){if(!_0x19a190){_0x3ad4b6[_0xe63c('0x17')](0x194);}return _0x19a190;};}function handleError(_0x4d26f2,_0x27d4a1){_0x27d4a1=_0x27d4a1||0x1f4;return function(_0x10d0fd){logger['error'](_0x10d0fd[_0xe63c('0x26')]);if(_0x10d0fd[_0xe63c('0x27')]){delete _0x10d0fd['name'];}_0x4d26f2['status'](_0x27d4a1)[_0xe63c('0x28')](_0x10d0fd);};}exports[_0xe63c('0x29')]=function(_0x1afbdd,_0x27519d){var _0x51569a={},_0x5dd3a9={},_0x2dfbc7={'count':0x0,'rows':[]};var _0x52fc38=_[_0xe63c('0x2a')](db[_0xe63c('0x2b')][_0xe63c('0x2c')],function(_0x16b52e){return{'name':_0x16b52e[_0xe63c('0x2d')],'type':_0x16b52e['type'][_0xe63c('0x2e')]};});_0x5dd3a9[_0xe63c('0x2f')]=_[_0xe63c('0x2a')](_0x52fc38,'name');_0x5dd3a9[_0xe63c('0x30')]=_['keys'](_0x1afbdd[_0xe63c('0x30')]);_0x5dd3a9[_0xe63c('0x31')]=_[_0xe63c('0x32')](_0x5dd3a9[_0xe63c('0x2f')],_0x5dd3a9[_0xe63c('0x30')]);_0x51569a['attributes']=_['intersection'](_0x5dd3a9[_0xe63c('0x2f')],qs[_0xe63c('0x33')](_0x1afbdd['query'][_0xe63c('0x33')]));_0x51569a[_0xe63c('0x34')]=_0x51569a[_0xe63c('0x34')][_0xe63c('0x35')]?_0x51569a[_0xe63c('0x34')]:_0x5dd3a9[_0xe63c('0x2f')];if(!_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x36')](_0xe63c('0x37'))){_0x51569a[_0xe63c('0x1c')]=qs['limit'](_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x1c')]);_0x51569a[_0xe63c('0x1a')]=qs[_0xe63c('0x1a')](_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x1a')]);}_0x51569a[_0xe63c('0x38')]=qs[_0xe63c('0x39')](_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x39')]);_0x51569a['where']=qs[_0xe63c('0x31')](_[_0xe63c('0x3a')](_0x1afbdd[_0xe63c('0x30')],_0x5dd3a9[_0xe63c('0x31')]),_0x52fc38);if(_0x1afbdd[_0xe63c('0x30')]['filter']){_0x51569a['where']=_[_0xe63c('0x3b')](_0x51569a[_0xe63c('0x3c')],{'$or':_[_0xe63c('0x2a')](_0x52fc38,function(_0x4950da){if(_0x4950da[_0xe63c('0x3d')]!==_0xe63c('0x3e')){var _0x59f4b6={};_0x59f4b6[_0x4950da['name']]={'$like':'%'+_0x1afbdd[_0xe63c('0x30')][_0xe63c('0x3f')]+'%'};return _0x59f4b6;}})});}_0x51569a=_[_0xe63c('0x3b')]({},_0x51569a,_0x1afbdd['options']);var _0x4c9427={'where':_0x51569a[_0xe63c('0x3c')]};return db['ZendeskField'][_0xe63c('0x1d')](_0x4c9427)['then'](function(_0x349785){_0x2dfbc7['count']=_0x349785;if(_0x1afbdd[_0xe63c('0x30')]['includeAll']){_0x51569a[_0xe63c('0x40')]=[{'all':!![]}];}return db[_0xe63c('0x2b')]['findAll'](_0x51569a);})['then'](function(_0x4a9187){_0x2dfbc7['rows']=_0x4a9187;return _0x2dfbc7;})['then'](respondWithFilteredResult(_0x27519d,_0x51569a))[_0xe63c('0x41')](handleError(_0x27519d,null));};exports['show']=function(_0x3b78a7,_0x1bb940){var _0x3b6572={'raw':!![],'where':{'id':_0x3b78a7[_0xe63c('0x42')]['id']}},_0x3dae11={};_0x3dae11[_0xe63c('0x2f')]=_[_0xe63c('0x43')](db[_0xe63c('0x2b')]['rawAttributes']);_0x3dae11[_0xe63c('0x30')]=_['keys'](_0x3b78a7[_0xe63c('0x30')]);_0x3dae11[_0xe63c('0x31')]=_[_0xe63c('0x32')](_0x3dae11['model'],_0x3dae11[_0xe63c('0x30')]);_0x3b6572[_0xe63c('0x34')]=_[_0xe63c('0x32')](_0x3dae11['model'],qs[_0xe63c('0x33')](_0x3b78a7[_0xe63c('0x30')][_0xe63c('0x33')]));_0x3b6572[_0xe63c('0x34')]=_0x3b6572['attributes'][_0xe63c('0x35')]?_0x3b6572['attributes']:_0x3dae11[_0xe63c('0x2f')];if(_0x3b78a7[_0xe63c('0x30')]['includeAll']){_0x3b6572[_0xe63c('0x40')]=[{'all':!![]}];}_0x3b6572=_[_0xe63c('0x3b')]({},_0x3b6572,_0x3b78a7[_0xe63c('0x44')]);return db[_0xe63c('0x2b')][_0xe63c('0x45')](_0x3b6572)['then'](handleEntityNotFound(_0x1bb940,null))['then'](respondWithResult(_0x1bb940,null))['catch'](handleError(_0x1bb940,null));};exports[_0xe63c('0x46')]=function(_0x2555ae,_0x481b91){return db[_0xe63c('0x2b')][_0xe63c('0x46')](_0x2555ae[_0xe63c('0x47')],{})[_0xe63c('0x23')](respondWithResult(_0x481b91,0xc9))[_0xe63c('0x41')](handleError(_0x481b91,null));};exports[_0xe63c('0x22')]=function(_0x297e80,_0x592fb8){if(_0x297e80[_0xe63c('0x47')]['id']){delete _0x297e80[_0xe63c('0x47')]['id'];}return db[_0xe63c('0x2b')]['find']({'where':{'id':_0x297e80[_0xe63c('0x42')]['id']}})[_0xe63c('0x23')](handleEntityNotFound(_0x592fb8,null))[_0xe63c('0x23')](saveUpdates(_0x297e80[_0xe63c('0x47')],null))['then'](respondWithResult(_0x592fb8,null))[_0xe63c('0x41')](handleError(_0x592fb8,null));};exports[_0xe63c('0x24')]=function(_0x330af5,_0x46de9b){return db['ZendeskField'][_0xe63c('0x45')]({'where':{'id':_0x330af5[_0xe63c('0x42')]['id']}})[_0xe63c('0x23')](handleEntityNotFound(_0x46de9b,null))[_0xe63c('0x23')](removeEntity(_0x46de9b,null))['catch'](handleError(_0x46de9b,null));};
\ No newline at end of file
index 5091634..1178ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields'];(function(_0x709ab8,_0x44dc36){var _0x2660f5=function(_0x3ef0f7){while(--_0x3ef0f7){_0x709ab8['push'](_0x709ab8['shift']());}};_0x2660f5(++_0x44dc36);}(_0xbec5,0x16f));var _0x5bec=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0xbec5[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require(_0x5bec('0x2'))('api');var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5bec('0x6'));var attributes=require(_0x5bec('0x7'));module[_0x5bec('0x8')]=function(_0x4e9686,_0x3162d1){return _0x4e9686['define'](_0x5bec('0x9'),attributes,{'tableName':_0x5bec('0xa'),'paranoid':![],'indexes':[{'name':_0x5bec('0xb'),'fields':[_0x5bec('0xc'),_0x5bec('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa01a=['lodash','util','../../config/logger','moment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId'];(function(_0x4da7e4,_0x4e7569){var _0x310fc1=function(_0x4d18a5){while(--_0x4d18a5){_0x4da7e4['push'](_0x4da7e4['shift']());}};_0x310fc1(++_0x4e7569);}(_0xa01a,0xbe));var _0xaa01=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xa01a[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xaa01('0x0'));var util=require(_0xaa01('0x1'));var logger=require(_0xaa01('0x2'))('api');var moment=require(_0xaa01('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZendeskField.attributes');module[_0xaa01('0x4')]=function(_0x3cf9f2,_0x1c049f){return _0x3cf9f2[_0xaa01('0x5')](_0xaa01('0x6'),attributes,{'tableName':_0xaa01('0x7'),'paranoid':![],'indexes':[{'name':_0xaa01('0x8'),'fields':['idField',_0xaa01('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 56d7257..f29b08b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x489d=['result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x41e351,_0x76d509){var _0x59f58a=function(_0x4334f0){while(--_0x4334f0){_0x41e351['push'](_0x41e351['shift']());}};_0x59f58a(++_0x76d509);}(_0x489d,0x177));var _0xd489=function(_0x3fd4b2,_0xf797d0){_0x3fd4b2=_0x3fd4b2-0x0;var _0x4dff94=_0x489d[_0x3fd4b2];return _0x4dff94;};'use strict';var _=require('lodash');var util=require(_0xd489('0x0'));var moment=require(_0xd489('0x1'));var BPromise=require(_0xd489('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd489('0x3'));var db=require(_0xd489('0x4'))['db'];var utils=require(_0xd489('0x5'));var logger=require(_0xd489('0x6'))(_0xd489('0x7'));var config=require(_0xd489('0x8'));var jayson=require(_0xd489('0x9'));var client=jayson['client'][_0xd489('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x276795,_0x24f775,_0x365b9d){return new BPromise(function(_0x4d39bc,_0x235e21){return client[_0xd489('0xb')](_0x276795,_0x365b9d)[_0xd489('0xc')](function(_0x19e010){logger['info'](_0xd489('0xd'),_0x24f775,_0xd489('0xe'));logger[_0xd489('0xf')](_0xd489('0x10'),_0x24f775,'request\x20sent',JSON[_0xd489('0x11')](_0x19e010));if(_0x19e010[_0xd489('0x12')]){if(_0x19e010['error'][_0xd489('0x13')]===0x1f4){logger[_0xd489('0x12')](_0xd489('0xd'),_0x24f775,_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);return _0x235e21(_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);}logger['error'](_0xd489('0xd'),_0x24f775,_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);return _0x4d39bc(_0x19e010[_0xd489('0x12')][_0xd489('0x14')]);}else{logger['info'](_0xd489('0xd'),_0x24f775,_0xd489('0xe'));_0x4d39bc(_0x19e010[_0xd489('0x15')][_0xd489('0x14')]);}})['catch'](function(_0x4e7987){logger[_0xd489('0x12')](_0xd489('0xd'),_0x24f775,_0x4e7987);_0x235e21(_0x4e7987);});});}
\ No newline at end of file
+var _0x75fe=['info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x5ebecc,_0x540051){var _0x52673d=function(_0x258cfb){while(--_0x258cfb){_0x5ebecc['push'](_0x5ebecc['shift']());}};_0x52673d(++_0x540051);}(_0x75fe,0x1d7));var _0xe75f=function(_0x3eea50,_0x43721e){_0x3eea50=_0x3eea50-0x0;var _0xd423da=_0x75fe[_0x3eea50];return _0xd423da;};'use strict';var _=require(_0xe75f('0x0'));var util=require(_0xe75f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe75f('0x2'));var fs=require('fs');var Redis=require(_0xe75f('0x3'));var db=require(_0xe75f('0x4'))['db'];var utils=require(_0xe75f('0x5'));var logger=require(_0xe75f('0x6'))(_0xe75f('0x7'));var config=require(_0xe75f('0x8'));var jayson=require(_0xe75f('0x9'));var client=jayson[_0xe75f('0xa')][_0xe75f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34916d,_0x18ce15,_0x257c0a){return new BPromise(function(_0x2f8f03,_0x3abf8f){return client['request'](_0x34916d,_0x257c0a)[_0xe75f('0xc')](function(_0x12b125){logger[_0xe75f('0xd')](_0xe75f('0xe'),_0x18ce15,_0xe75f('0xf'));logger['debug'](_0xe75f('0x10'),_0x18ce15,'request\x20sent',JSON['stringify'](_0x12b125));if(_0x12b125['error']){if(_0x12b125[_0xe75f('0x11')][_0xe75f('0x12')]===0x1f4){logger[_0xe75f('0x11')](_0xe75f('0xe'),_0x18ce15,_0x12b125[_0xe75f('0x11')]['message']);return _0x3abf8f(_0x12b125[_0xe75f('0x11')][_0xe75f('0x13')]);}logger['error'](_0xe75f('0xe'),_0x18ce15,_0x12b125[_0xe75f('0x11')][_0xe75f('0x13')]);return _0x2f8f03(_0x12b125[_0xe75f('0x11')][_0xe75f('0x13')]);}else{logger[_0xe75f('0xd')]('ZendeskField,\x20%s,\x20%s',_0x18ce15,'request\x20sent');_0x2f8f03(_0x12b125[_0xe75f('0x14')][_0xe75f('0x13')]);}})[_0xe75f('0x15')](function(_0x1b856a){logger['error']('ZendeskField,\x20%s,\x20%s',_0x18ce15,_0x1b856a);_0x3abf8f(_0x1b856a);});});}
\ No newline at end of file
index c2733bf..41acfdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab21=['destroy','exports','multer','util','connect-timeout','express','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete'];(function(_0x1865d4,_0x569a81){var _0x1f0e1c=function(_0x57887d){while(--_0x57887d){_0x1865d4['push'](_0x1865d4['shift']());}};_0x1f0e1c(++_0x569a81);}(_0xab21,0x10a));var _0x1ab2=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xab21[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0x1ab2('0x0'));var util=require(_0x1ab2('0x1'));var path=require('path');var timeout=require(_0x1ab2('0x2'));var express=require(_0x1ab2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1ab2('0x4'));var controller=require(_0x1ab2('0x5'));router[_0x1ab2('0x6')]('/',auth[_0x1ab2('0x7')](),controller[_0x1ab2('0x8')]);router[_0x1ab2('0x6')](_0x1ab2('0x9'),auth['isAuthenticated'](),controller[_0x1ab2('0xa')]);router['get'](_0x1ab2('0xb'),auth[_0x1ab2('0x7')](),controller[_0x1ab2('0xc')]);router['get'](_0x1ab2('0xd'),auth[_0x1ab2('0x7')](),controller[_0x1ab2('0xe')]);router[_0x1ab2('0xf')]('/',auth[_0x1ab2('0x7')](),controller[_0x1ab2('0x10')]);router[_0x1ab2('0xf')](_0x1ab2('0xb'),auth[_0x1ab2('0x7')](),controller[_0x1ab2('0x11')]);router[_0x1ab2('0x12')](_0x1ab2('0x9'),auth[_0x1ab2('0x7')](),controller['update']);router[_0x1ab2('0x13')](_0x1ab2('0x9'),auth['isAuthenticated'](),controller[_0x1ab2('0x14')]);module[_0x1ab2('0x15')]=router;
\ No newline at end of file
+var _0x11e4=['/:id/fields','getFields','post','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id/configurations','get'];(function(_0x49d103,_0x1af355){var _0x54250a=function(_0xc7aab6){while(--_0xc7aab6){_0x49d103['push'](_0x49d103['shift']());}};_0x54250a(++_0x1af355);}(_0x11e4,0xf7));var _0x411e=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x11e4[_0x5f1391];return _0x50ebe3;};'use strict';var multer=require(_0x411e('0x0'));var util=require(_0x411e('0x1'));var path=require('path');var timeout=require(_0x411e('0x2'));var express=require(_0x411e('0x3'));var router=express[_0x411e('0x4')]();var fs_extra=require(_0x411e('0x5'));var auth=require(_0x411e('0x6'));var interaction=require(_0x411e('0x7'));var config=require(_0x411e('0x8'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x411e('0x9')](),controller[_0x411e('0xa')]);router['get']('/:id',auth[_0x411e('0x9')](),controller['show']);router['get'](_0x411e('0xb'),auth[_0x411e('0x9')](),controller['getConfigurations']);router[_0x411e('0xc')](_0x411e('0xd'),auth['isAuthenticated'](),controller[_0x411e('0xe')]);router[_0x411e('0xf')]('/',auth[_0x411e('0x9')](),controller['create']);router[_0x411e('0xf')](_0x411e('0xb'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x411e('0x10')](_0x411e('0x11'),auth[_0x411e('0x9')](),controller['update']);router['delete'](_0x411e('0x11'),auth[_0x411e('0x9')](),controller[_0x411e('0x12')]);module[_0x411e('0x13')]=router;
\ No newline at end of file
index 49250c8..1277a81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['exports','STRING','sequelize'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x41bb,0xc5));var _0xb41b=function(_0x592077,_0x457090){_0x592077=_0x592077-0x0;var _0x19099f=_0x41bb[_0x592077];return _0x19099f;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}};
\ No newline at end of file
+var _0xa75b=['sequelize','STRING'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xa75b,0x170));var _0xba75=function(_0x2b8820,_0x2fff8d){_0x2b8820=_0x2b8820-0x0;var _0x331b47=_0xa75b[_0x2b8820];return _0x331b47;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba75('0x1')]},'host':{'type':Sequelize[_0xba75('0x1')]},'zone':{'type':Sequelize[_0xba75('0x1')]},'clientId':{'type':Sequelize[_0xba75('0x1')]},'clientSecret':{'type':Sequelize[_0xba75('0x1')]},'serverUrl':{'type':Sequelize[_0xba75('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xba75('0x1')]},'refreshToken':{'type':Sequelize[_0xba75('0x1')]}};
\ No newline at end of file
index 9661afb..2d77f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcfe=['sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','then','error','name','send','index','map','ZohoAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','rawAttributes','create','body','update','find','destroy','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','refreshToken','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x16bf11,_0x461f7b){var _0x30e784=function(_0x14beb3){while(--_0x14beb3){_0x16bf11['push'](_0x16bf11['shift']());}};_0x30e784(++_0x461f7b);}(_0xdcfe,0x17b));var _0xedcf=function(_0x1a0aab,_0x1f75dd){_0x1a0aab=_0x1a0aab-0x0;var _0x87f61c=_0xdcfe[_0x1a0aab];return _0x87f61c;};'use strict';var emlformat=require(_0xedcf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedcf('0x1'));var jsonpatch=require(_0xedcf('0x2'));var rp=require(_0xedcf('0x3'));var moment=require(_0xedcf('0x4'));var BPromise=require(_0xedcf('0x5'));var Mustache=require(_0xedcf('0x6'));var util=require('util');var path=require(_0xedcf('0x7'));var sox=require(_0xedcf('0x8'));var csv=require(_0xedcf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xedcf('0xa'));var _=require(_0xedcf('0xb'));var squel=require('squel');var crypto=require(_0xedcf('0xc'));var jsforce=require(_0xedcf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xedcf('0x9'));var querystring=require(_0xedcf('0xe'));var Papa=require(_0xedcf('0xf'));var Redis=require('ioredis');var authService=require(_0xedcf('0x10'));var qs=require(_0xedcf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xedcf('0x12'))('api');var utils=require(_0xedcf('0x13'));var config=require(_0xedcf('0x14'));var licenseUtil=require(_0xedcf('0x15'));var db=require(_0xedcf('0x16'))['db'];var integrations=require(_0xedcf('0x17'));function respondWithStatusCode(_0x38f13b,_0x406aa9){_0x406aa9=_0x406aa9||0xcc;return function(_0xc3f6c5){if(_0xc3f6c5){return _0x38f13b[_0xedcf('0x18')](_0x406aa9);}return _0x38f13b['status'](_0x406aa9)['end']();};}function respondWithResult(_0x4ea5c1,_0x46bcc4){_0x46bcc4=_0x46bcc4||0xc8;return function(_0x36474e){if(_0x36474e){return _0x4ea5c1[_0xedcf('0x19')](_0x46bcc4)[_0xedcf('0x1a')](_0x36474e);}};}function respondWithFilteredResult(_0x1edd92,_0x323d52){return function(_0x2e27a6){if(_0x2e27a6){var _0x37928e=typeof _0x323d52[_0xedcf('0x1b')]==='undefined'&&typeof _0x323d52[_0xedcf('0x1c')]===_0xedcf('0x1d');var _0x315d0d=_0x2e27a6[_0xedcf('0x1e')];var _0x1ad115=_0x37928e?0x0:_0x323d52[_0xedcf('0x1b')];var _0x1e8c36=_0x37928e?_0x2e27a6[_0xedcf('0x1e')]:_0x323d52[_0xedcf('0x1b')]+_0x323d52[_0xedcf('0x1c')];var _0x13937d;if(_0x1e8c36>=_0x315d0d){_0x1e8c36=_0x315d0d;_0x13937d=0xc8;}else{_0x13937d=0xce;}_0x1edd92[_0xedcf('0x19')](_0x13937d);return _0x1edd92[_0xedcf('0x1f')](_0xedcf('0x20'),_0x1ad115+'-'+_0x1e8c36+'/'+_0x315d0d)[_0xedcf('0x1a')](_0x2e27a6);}return null;};}function patchUpdates(_0x533a80){return function(_0x3f57a0){try{jsonpatch['apply'](_0x3f57a0,_0x533a80,!![]);}catch(_0x47d8b0){return BPromise[_0xedcf('0x21')](_0x47d8b0);}return _0x3f57a0['save']();};}function saveUpdates(_0x4c51a9,_0x4f76f2){return function(_0x44ae6f){if(_0x44ae6f){return _0x44ae6f['update'](_0x4c51a9)[_0xedcf('0x22')](function(_0x273d17){return _0x273d17;});}return null;};}function removeEntity(_0x3e20ba,_0x590093){return function(_0xadc3f0){if(_0xadc3f0){return _0xadc3f0['destroy']()[_0xedcf('0x22')](function(){_0x3e20ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb81d,_0x2d38da){return function(_0x41ae9f){if(!_0x41ae9f){_0x5bb81d[_0xedcf('0x18')](0x194);}return _0x41ae9f;};}function handleError(_0x47916d,_0x44e8b0){_0x44e8b0=_0x44e8b0||0x1f4;return function(_0x43abdd){logger[_0xedcf('0x23')](_0x43abdd['stack']);if(_0x43abdd[_0xedcf('0x24')]){delete _0x43abdd['name'];}_0x47916d[_0xedcf('0x19')](_0x44e8b0)[_0xedcf('0x25')](_0x43abdd);};}exports[_0xedcf('0x26')]=function(_0x358c4b,_0x48d5ec){var _0x3f8b4d={},_0x43a734={},_0x2125f7={'count':0x0,'rows':[]};var _0x3c5841=_[_0xedcf('0x27')](db[_0xedcf('0x28')]['rawAttributes'],function(_0x4fde7e){return{'name':_0x4fde7e[_0xedcf('0x29')],'type':_0x4fde7e[_0xedcf('0x2a')][_0xedcf('0x2b')]};});_0x43a734[_0xedcf('0x2c')]=_[_0xedcf('0x27')](_0x3c5841,'name');_0x43a734[_0xedcf('0x2d')]=_[_0xedcf('0x2e')](_0x358c4b[_0xedcf('0x2d')]);_0x43a734[_0xedcf('0x2f')]=_[_0xedcf('0x30')](_0x43a734[_0xedcf('0x2c')],_0x43a734['query']);_0x3f8b4d['attributes']=_['intersection'](_0x43a734[_0xedcf('0x2c')],qs['fields'](_0x358c4b['query'][_0xedcf('0x31')]));_0x3f8b4d['attributes']=_0x3f8b4d[_0xedcf('0x32')][_0xedcf('0x33')]?_0x3f8b4d[_0xedcf('0x32')]:_0x43a734[_0xedcf('0x2c')];if(!_0x358c4b[_0xedcf('0x2d')]['hasOwnProperty'](_0xedcf('0x34'))){_0x3f8b4d['limit']=qs[_0xedcf('0x1c')](_0x358c4b[_0xedcf('0x2d')]['limit']);_0x3f8b4d[_0xedcf('0x1b')]=qs[_0xedcf('0x1b')](_0x358c4b['query'][_0xedcf('0x1b')]);}_0x3f8b4d[_0xedcf('0x35')]=qs[_0xedcf('0x36')](_0x358c4b[_0xedcf('0x2d')][_0xedcf('0x36')]);_0x3f8b4d[_0xedcf('0x37')]=qs[_0xedcf('0x2f')](_[_0xedcf('0x38')](_0x358c4b[_0xedcf('0x2d')],_0x43a734[_0xedcf('0x2f')]),_0x3c5841);if(_0x358c4b['query'][_0xedcf('0x39')]){_0x3f8b4d[_0xedcf('0x37')]=_[_0xedcf('0x3a')](_0x3f8b4d['where'],{'$or':_[_0xedcf('0x27')](_0x3c5841,function(_0x7e274a){if(_0x7e274a[_0xedcf('0x2a')]!==_0xedcf('0x3b')){var _0x30d013={};_0x30d013[_0x7e274a[_0xedcf('0x24')]]={'$like':'%'+_0x358c4b['query'][_0xedcf('0x39')]+'%'};return _0x30d013;}})});}_0x3f8b4d=_[_0xedcf('0x3a')]({},_0x3f8b4d,_0x358c4b[_0xedcf('0x3c')]);var _0x119ef9={'where':_0x3f8b4d[_0xedcf('0x37')]};return db['ZohoAccount']['count'](_0x119ef9)[_0xedcf('0x22')](function(_0x4a7469){_0x2125f7[_0xedcf('0x1e')]=_0x4a7469;if(_0x358c4b[_0xedcf('0x2d')]['includeAll']){_0x3f8b4d[_0xedcf('0x3d')]=[{'all':!![]}];}return db[_0xedcf('0x28')]['findAll'](_0x3f8b4d);})[_0xedcf('0x22')](function(_0x4b6276){_0x2125f7[_0xedcf('0x3e')]=_0x4b6276;return _0x2125f7;})[_0xedcf('0x22')](respondWithFilteredResult(_0x48d5ec,_0x3f8b4d))[_0xedcf('0x3f')](handleError(_0x48d5ec,null));};exports['show']=function(_0x203275,_0x1582a4){var _0x556a42={'raw':![],'where':{'id':_0x203275[_0xedcf('0x40')]['id']}},_0x16e543={};_0x16e543[_0xedcf('0x2c')]=_[_0xedcf('0x2e')](db['ZohoAccount'][_0xedcf('0x41')]);_0x16e543[_0xedcf('0x2d')]=_[_0xedcf('0x2e')](_0x203275[_0xedcf('0x2d')]);_0x16e543[_0xedcf('0x2f')]=_[_0xedcf('0x30')](_0x16e543[_0xedcf('0x2c')],_0x16e543['query']);_0x556a42[_0xedcf('0x32')]=_['intersection'](_0x16e543[_0xedcf('0x2c')],qs[_0xedcf('0x31')](_0x203275[_0xedcf('0x2d')][_0xedcf('0x31')]));_0x556a42[_0xedcf('0x32')]=_0x556a42[_0xedcf('0x32')][_0xedcf('0x33')]?_0x556a42[_0xedcf('0x32')]:_0x16e543[_0xedcf('0x2c')];if(_0x203275[_0xedcf('0x2d')]['includeAll']){_0x556a42['include']=[{'all':!![]}];}_0x556a42=_['merge']({},_0x556a42,_0x203275[_0xedcf('0x3c')]);return db[_0xedcf('0x28')]['find'](_0x556a42)[_0xedcf('0x22')](handleEntityNotFound(_0x1582a4,null))[_0xedcf('0x22')](respondWithResult(_0x1582a4,null))[_0xedcf('0x3f')](handleError(_0x1582a4,null));};exports[_0xedcf('0x42')]=function(_0x4c199a,_0x20152a){return db[_0xedcf('0x28')][_0xedcf('0x42')](_0x4c199a[_0xedcf('0x43')],{})[_0xedcf('0x22')](respondWithResult(_0x20152a,0xc9))[_0xedcf('0x3f')](handleError(_0x20152a,null));};exports[_0xedcf('0x44')]=function(_0x236171,_0x5b92f0){if(_0x236171['body']['id']){delete _0x236171[_0xedcf('0x43')]['id'];}return db[_0xedcf('0x28')][_0xedcf('0x45')]({'where':{'id':_0x236171[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0x5b92f0,null))[_0xedcf('0x22')](saveUpdates(_0x236171[_0xedcf('0x43')],null))[_0xedcf('0x22')](respondWithResult(_0x5b92f0,null))[_0xedcf('0x3f')](handleError(_0x5b92f0,null));};exports[_0xedcf('0x46')]=function(_0x468a07,_0x16924a){return db[_0xedcf('0x28')][_0xedcf('0x45')]({'where':{'id':_0x468a07[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0x16924a,null))[_0xedcf('0x22')](removeEntity(_0x16924a,null))[_0xedcf('0x3f')](handleError(_0x16924a,null));};exports[_0xedcf('0x47')]=function(_0x12ee55,_0xb680a1,_0x4cd4c3){var _0x47bc8d={};var _0x1c6dba={};var _0x4c827d;var _0x350bf9;return db['ZohoAccount'][_0xedcf('0x48')]({'where':{'id':_0x12ee55[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0xb680a1,null))[_0xedcf('0x22')](function(_0x22ee1d){if(_0x22ee1d){_0x4c827d=_0x22ee1d;_0x1c6dba['model']=_[_0xedcf('0x2e')](db['ZohoConfiguration']['rawAttributes']);_0x1c6dba[_0xedcf('0x2d')]=_[_0xedcf('0x2e')](_0x12ee55['query']);_0x1c6dba[_0xedcf('0x2f')]=_['intersection'](_0x1c6dba[_0xedcf('0x2c')],_0x1c6dba[_0xedcf('0x2d')]);_0x47bc8d[_0xedcf('0x32')]=_['intersection'](_0x1c6dba[_0xedcf('0x2c')],qs[_0xedcf('0x31')](_0x12ee55[_0xedcf('0x2d')][_0xedcf('0x31')]));_0x47bc8d[_0xedcf('0x32')]=_0x47bc8d['attributes'][_0xedcf('0x33')]?_0x47bc8d[_0xedcf('0x32')]:_0x1c6dba[_0xedcf('0x2c')];_0x47bc8d[_0xedcf('0x35')]=qs[_0xedcf('0x36')](_0x12ee55['query'][_0xedcf('0x36')]);_0x47bc8d[_0xedcf('0x37')]=qs[_0xedcf('0x2f')](_[_0xedcf('0x38')](_0x12ee55[_0xedcf('0x2d')],_0x1c6dba[_0xedcf('0x2f')]));if(_0x12ee55[_0xedcf('0x2d')]['filter']){_0x47bc8d[_0xedcf('0x37')]=_[_0xedcf('0x3a')](_0x47bc8d['where'],{'$or':_[_0xedcf('0x27')](_0x47bc8d[_0xedcf('0x32')],function(_0x4c6844){var _0x26ca95={};_0x26ca95[_0x4c6844]={'$like':'%'+_0x12ee55['query']['filter']+'%'};return _0x26ca95;})});}_0x47bc8d=_[_0xedcf('0x3a')]({},_0x47bc8d,_0x12ee55['options']);return _0x4c827d['getConfigurations'](_0x47bc8d);}})['then'](function(_0x55eacf){if(_0x55eacf){_0x350bf9=_0x55eacf['length'];if(!_0x12ee55['query'][_0xedcf('0x49')]('nolimit')){_0x47bc8d[_0xedcf('0x1c')]=qs['limit'](_0x12ee55[_0xedcf('0x2d')]['limit']);_0x47bc8d['offset']=qs[_0xedcf('0x1b')](_0x12ee55[_0xedcf('0x2d')][_0xedcf('0x1b')]);}return _0x4c827d[_0xedcf('0x47')](_0x47bc8d);}})['then'](function(_0x199a63){if(_0x199a63){return _0x199a63?{'count':_0x350bf9,'rows':_0x199a63}:null;}})['then'](respondWithResult(_0xb680a1,null))[_0xedcf('0x3f')](handleError(_0xb680a1,null));};exports[_0xedcf('0x4a')]=function(_0x280b61,_0x4d1a27,_0x45dfd4){if(_0x280b61[_0xedcf('0x43')]['id']){delete _0x280b61['body']['id'];}return db[_0xedcf('0x28')]['findOne']({'where':{'id':_0x280b61[_0xedcf('0x40')]['id']}})[_0xedcf('0x22')](handleEntityNotFound(_0x4d1a27,null))[_0xedcf('0x22')](function(_0xfb2eaa){if(_0xfb2eaa){_0x280b61[_0xedcf('0x43')][_0xedcf('0x4b')]=_0xfb2eaa['id'];_0x280b61[_0xedcf('0x43')]['Subjects']=integrations[_0xedcf('0x4c')](_0x280b61[_0xedcf('0x43')][_0xedcf('0x4d')],_0x280b61[_0xedcf('0x43')][_0xedcf('0x2a')]);_0x280b61['body']['Descriptions']=integrations[_0xedcf('0x4e')](_0x280b61[_0xedcf('0x43')][_0xedcf('0x4d')],_0x280b61[_0xedcf('0x43')][_0xedcf('0x2a')]);return db[_0xedcf('0x4f')][_0xedcf('0x42')](_0x280b61[_0xedcf('0x43')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0xedcf('0x50')],'as':_0xedcf('0x51')}]});}return null;})[_0xedcf('0x22')](respondWithResult(_0x4d1a27,null))[_0xedcf('0x3f')](handleError(_0x4d1a27,null));};function getAccessToken(_0x238308){return new Promise(function(_0x31217f,_0x300678){var _0x3b2b7e;switch(_0x238308['zone']){case'US':_0x3b2b7e=_0xedcf('0x52');break;case'AU':_0x3b2b7e=_0xedcf('0x53');break;case'EU':_0x3b2b7e='https://accounts.zoho.eu';break;case'IN':_0x3b2b7e=_0xedcf('0x54');break;case'CN':_0x3b2b7e=_0xedcf('0x55');break;default:_0x3b2b7e=_0xedcf('0x56');break;}var _0x19c801={'method':_0xedcf('0x57'),'uri':_0x3b2b7e+_0xedcf('0x58'),'qs':{'refresh_token':_0x238308['refreshToken'],'client_id':_0x238308[_0xedcf('0x59')],'client_secret':_0x238308[_0xedcf('0x5a')],'grant_type':_0xedcf('0x5b')},'json':!![]};return rp(_0x19c801)['then'](function(_0x344ecb){if(_0x344ecb[_0xedcf('0x5c')]){_0x31217f(_0x344ecb[_0xedcf('0x5c')]);}else{_0x300678('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xedcf('0x3f')](function(_0x151515){_0x300678(_0x151515);});});}exports['getFields']=function(_0xe4d715,_0x5f1519,_0x9e354e){var _0x5358f5,_0x4fd4db,_0x3b290e,_0x352968,_0x6cd88;return db['ZohoAccount'][_0xedcf('0x48')]({'where':{'id':_0xe4d715[_0xedcf('0x40')]['id']},'attributes':['id',_0xedcf('0x5d'),_0xedcf('0x5e'),_0xedcf('0x59'),_0xedcf('0x5a'),_0xedcf('0x5f'),_0xedcf('0x60'),'refreshToken']})[_0xedcf('0x22')](handleEntityNotFound(_0x5f1519,null))[_0xedcf('0x22')](function(_0x7ab072){_0x6cd88=_0x7ab072;_0x5358f5=_0x6cd88[_0xedcf('0x5d')];_0x4fd4db=_0x5358f5===_0xedcf('0x61')?'eu':_0xedcf('0x62');_0x3b290e=_0x6cd88[_0xedcf('0x5f')];var _0x509ad7=_0x3b290e[_0xedcf('0x63')](-0x1);if(_0x509ad7==='/'||_0x509ad7==='\x5c'||_0x509ad7===':'){_0x3b290e=_0x3b290e[_0xedcf('0x64')](0x0,_0x3b290e[_0xedcf('0x65')](_0x509ad7));}if(!_0x6cd88[_0xedcf('0x66')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x6cd88);})[_0xedcf('0x22')](function(_0x16eb5b){if(_0x16eb5b){return rp({'method':'GET','uri':util[_0xedcf('0x67')](_0xedcf('0x68'),_0x4fd4db),'qs':{'module':'Calls'},'headers':{'Authorization':_0xedcf('0x69')+_0x16eb5b},'json':!![]});}})[_0xedcf('0x22')](function(_0x53d2d7){if(_0x53d2d7){if(_0x53d2d7['response']&&_0x53d2d7['response'][_0xedcf('0x23')]){throw new Error(_0x53d2d7[_0xedcf('0x6a')][_0xedcf('0x23')]['message']);}var _0x1926eb=[];var _0x382209=[];var _0xf212e0=[_0xedcf('0x6b'),_0xedcf('0x6c'),_0xedcf('0x6d'),_0xedcf('0x6e'),_0xedcf('0x6f'),_0xedcf('0x70'),'Call_Start_Time',_0xedcf('0x71')];_0x382209=_[_0xedcf('0x72')](_0x53d2d7[_0xedcf('0x31')],function(_0xd3b3d0){return _0xf212e0[_0xedcf('0x73')](_0xd3b3d0[_0xedcf('0x74')]);});for(var _0x5d0b22=0x0;_0x5d0b22<_0x382209[_0xedcf('0x33')];_0x5d0b22++){if(_0x382209[_0x5d0b22][_0xedcf('0x75')]===![]){_0x1926eb[_0xedcf('0x76')]({'id':_0x382209[_0x5d0b22]['id'],'name':_0x382209[_0x5d0b22]['display_label'],'custom':_0x382209[_0x5d0b22][_0xedcf('0x77')],'options':_0x382209[_0x5d0b22][_0xedcf('0x78')]===_0xedcf('0x79')&&_0x382209[_0x5d0b22][_0xedcf('0x7a')][_0xedcf('0x33')]>-0x1?_[_0xedcf('0x27')](_0x382209[_0x5d0b22][_0xedcf('0x7a')],function(_0x2b66d2){return{'name':_0x2b66d2,'value':_0x2b66d2};}):[]});}}return{'count':_0x1926eb[_0xedcf('0x33')],'rows':_0x1926eb};}else{return{'count':0x0,'rows':[]};}})[_0xedcf('0x22')](respondWithResult(_0x5f1519,null))[_0xedcf('0x3f')](function(_0x34c6c0){var _0xc18999=_0xe4d715[_0xedcf('0x2d')][_0xedcf('0x7b')]?0x1f4:_0x34c6c0[_0xedcf('0x7c')]||0x1f4;logger[_0xedcf('0x23')](_0xedcf('0x7d'),_0xedcf('0x7e'),_0xc18999,JSON[_0xedcf('0x7f')](_0x34c6c0));delete _0x34c6c0[_0xedcf('0x24')];if(_0xc18999===0x191){_0xc18999=0x190;}_0x5f1519[_0xedcf('0x19')](_0xc18999)[_0xedcf('0x25')](_0xe4d715[_0xedcf('0x2d')]['test']?{'message':_0xedcf('0x80'),'statusCode':_0x34c6c0[_0xedcf('0x7c')]}:_0x34c6c0);});};
\ No newline at end of file
+var _0x45d3=['include','findAll','rows','catch','show','keys','length','find','create','body','params','findOne','ZohoConfiguration','order','filter','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zone','serverUrl','code','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Type','remove','includes','api_name','system_mandatory','push','data_type','picklist','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','options','ZohoAccount'];(function(_0x279753,_0x505f8a){var _0x18fc9d=function(_0xa9da25){while(--_0xa9da25){_0x279753['push'](_0x279753['shift']());}};_0x18fc9d(++_0x505f8a);}(_0x45d3,0x148));var _0x345d=function(_0x1a2254,_0xeffd13){_0x1a2254=_0x1a2254-0x0;var _0x4e940f=_0x45d3[_0x1a2254];return _0x4e940f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x345d('0x0'));var zipdir=require(_0x345d('0x1'));var jsonpatch=require(_0x345d('0x2'));var rp=require(_0x345d('0x3'));var moment=require(_0x345d('0x4'));var BPromise=require(_0x345d('0x5'));var Mustache=require(_0x345d('0x6'));var util=require(_0x345d('0x7'));var path=require(_0x345d('0x8'));var sox=require(_0x345d('0x9'));var csv=require(_0x345d('0xa'));var ejs=require(_0x345d('0xb'));var fs=require('fs');var fs_extra=require(_0x345d('0xc'));var _=require(_0x345d('0xd'));var squel=require(_0x345d('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x345d('0xf'));var toCsv=require(_0x345d('0xa'));var querystring=require('querystring');var Papa=require(_0x345d('0x10'));var Redis=require(_0x345d('0x11'));var authService=require(_0x345d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x345d('0x13'));var hardwareService=require(_0x345d('0x14'));var logger=require(_0x345d('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x345d('0x16'));var licenseUtil=require(_0x345d('0x17'));var db=require(_0x345d('0x18'))['db'];var integrations=require(_0x345d('0x19'));function respondWithStatusCode(_0x365b5e,_0x49e432){_0x49e432=_0x49e432||0xcc;return function(_0x3fbc69){if(_0x3fbc69){return _0x365b5e[_0x345d('0x1a')](_0x49e432);}return _0x365b5e[_0x345d('0x1b')](_0x49e432)[_0x345d('0x1c')]();};}function respondWithResult(_0x173b82,_0xb923e6){_0xb923e6=_0xb923e6||0xc8;return function(_0x299e29){if(_0x299e29){return _0x173b82[_0x345d('0x1b')](_0xb923e6)[_0x345d('0x1d')](_0x299e29);}};}function respondWithFilteredResult(_0x1cd08d,_0x611d5f){return function(_0x220f9e){if(_0x220f9e){var _0x2cff0f=typeof _0x611d5f[_0x345d('0x1e')]===_0x345d('0x1f')&&typeof _0x611d5f['limit']===_0x345d('0x1f');var _0x133a19=_0x220f9e['count'];var _0x5dc083=_0x2cff0f?0x0:_0x611d5f[_0x345d('0x1e')];var _0x53a80b=_0x2cff0f?_0x220f9e[_0x345d('0x20')]:_0x611d5f[_0x345d('0x1e')]+_0x611d5f['limit'];var _0x3d1c18;if(_0x53a80b>=_0x133a19){_0x53a80b=_0x133a19;_0x3d1c18=0xc8;}else{_0x3d1c18=0xce;}_0x1cd08d['status'](_0x3d1c18);return _0x1cd08d[_0x345d('0x21')](_0x345d('0x22'),_0x5dc083+'-'+_0x53a80b+'/'+_0x133a19)[_0x345d('0x1d')](_0x220f9e);}return null;};}function patchUpdates(_0x1cb7a1){return function(_0x31d0d7){try{jsonpatch[_0x345d('0x23')](_0x31d0d7,_0x1cb7a1,!![]);}catch(_0x5c42a9){return BPromise[_0x345d('0x24')](_0x5c42a9);}return _0x31d0d7[_0x345d('0x25')]();};}function saveUpdates(_0x427e90,_0x4a2207){return function(_0x23e3f7){if(_0x23e3f7){return _0x23e3f7[_0x345d('0x26')](_0x427e90)[_0x345d('0x27')](function(_0x4cc23d){return _0x4cc23d;});}return null;};}function removeEntity(_0x247391,_0xdfc0e3){return function(_0x3e22b7){if(_0x3e22b7){return _0x3e22b7[_0x345d('0x28')]()[_0x345d('0x27')](function(){_0x247391[_0x345d('0x1b')](0xcc)[_0x345d('0x1c')]();});}};}function handleEntityNotFound(_0x9e1d85,_0x8dacec){return function(_0x2e0914){if(!_0x2e0914){_0x9e1d85[_0x345d('0x1a')](0x194);}return _0x2e0914;};}function handleError(_0x290c59,_0x20feef){_0x20feef=_0x20feef||0x1f4;return function(_0x4c8b89){logger[_0x345d('0x29')](_0x4c8b89[_0x345d('0x2a')]);if(_0x4c8b89[_0x345d('0x2b')]){delete _0x4c8b89[_0x345d('0x2b')];}_0x290c59[_0x345d('0x1b')](_0x20feef)[_0x345d('0x2c')](_0x4c8b89);};}exports['index']=function(_0xa3a686,_0xaca25d){var _0x240682={},_0x4e2cbe={},_0x54e363={'count':0x0,'rows':[]};var _0x43bcea=_[_0x345d('0x2d')](db['ZohoAccount'][_0x345d('0x2e')],function(_0x43d501){return{'name':_0x43d501[_0x345d('0x2f')],'type':_0x43d501['type'][_0x345d('0x30')]};});_0x4e2cbe[_0x345d('0x31')]=_[_0x345d('0x2d')](_0x43bcea,_0x345d('0x2b'));_0x4e2cbe['query']=_['keys'](_0xa3a686[_0x345d('0x32')]);_0x4e2cbe[_0x345d('0x33')]=_[_0x345d('0x34')](_0x4e2cbe['model'],_0x4e2cbe[_0x345d('0x32')]);_0x240682['attributes']=_[_0x345d('0x34')](_0x4e2cbe['model'],qs[_0x345d('0x35')](_0xa3a686[_0x345d('0x32')][_0x345d('0x35')]));_0x240682[_0x345d('0x36')]=_0x240682[_0x345d('0x36')]['length']?_0x240682[_0x345d('0x36')]:_0x4e2cbe[_0x345d('0x31')];if(!_0xa3a686[_0x345d('0x32')]['hasOwnProperty'](_0x345d('0x37'))){_0x240682[_0x345d('0x38')]=qs['limit'](_0xa3a686[_0x345d('0x32')]['limit']);_0x240682[_0x345d('0x1e')]=qs['offset'](_0xa3a686[_0x345d('0x32')]['offset']);}_0x240682['order']=qs[_0x345d('0x39')](_0xa3a686[_0x345d('0x32')][_0x345d('0x39')]);_0x240682[_0x345d('0x3a')]=qs[_0x345d('0x33')](_[_0x345d('0x3b')](_0xa3a686[_0x345d('0x32')],_0x4e2cbe[_0x345d('0x33')]),_0x43bcea);if(_0xa3a686[_0x345d('0x32')]['filter']){_0x240682[_0x345d('0x3a')]=_[_0x345d('0x3c')](_0x240682[_0x345d('0x3a')],{'$or':_[_0x345d('0x2d')](_0x43bcea,function(_0x3a2d85){if(_0x3a2d85[_0x345d('0x3d')]!==_0x345d('0x3e')){var _0x798b38={};_0x798b38[_0x3a2d85['name']]={'$like':'%'+_0xa3a686[_0x345d('0x32')]['filter']+'%'};return _0x798b38;}})});}_0x240682=_[_0x345d('0x3c')]({},_0x240682,_0xa3a686[_0x345d('0x3f')]);var _0x135e94={'where':_0x240682[_0x345d('0x3a')]};return db[_0x345d('0x40')][_0x345d('0x20')](_0x135e94)[_0x345d('0x27')](function(_0xbf35c5){_0x54e363[_0x345d('0x20')]=_0xbf35c5;if(_0xa3a686['query']['includeAll']){_0x240682[_0x345d('0x41')]=[{'all':!![]}];}return db[_0x345d('0x40')][_0x345d('0x42')](_0x240682);})['then'](function(_0x20ff8f){_0x54e363[_0x345d('0x43')]=_0x20ff8f;return _0x54e363;})[_0x345d('0x27')](respondWithFilteredResult(_0xaca25d,_0x240682))[_0x345d('0x44')](handleError(_0xaca25d,null));};exports[_0x345d('0x45')]=function(_0x3e45e8,_0x26c33f){var _0x48961d={'raw':![],'where':{'id':_0x3e45e8['params']['id']}},_0xaab990={};_0xaab990[_0x345d('0x31')]=_[_0x345d('0x46')](db[_0x345d('0x40')][_0x345d('0x2e')]);_0xaab990[_0x345d('0x32')]=_['keys'](_0x3e45e8[_0x345d('0x32')]);_0xaab990[_0x345d('0x33')]=_[_0x345d('0x34')](_0xaab990[_0x345d('0x31')],_0xaab990[_0x345d('0x32')]);_0x48961d[_0x345d('0x36')]=_['intersection'](_0xaab990[_0x345d('0x31')],qs[_0x345d('0x35')](_0x3e45e8[_0x345d('0x32')][_0x345d('0x35')]));_0x48961d[_0x345d('0x36')]=_0x48961d[_0x345d('0x36')][_0x345d('0x47')]?_0x48961d[_0x345d('0x36')]:_0xaab990[_0x345d('0x31')];if(_0x3e45e8[_0x345d('0x32')]['includeAll']){_0x48961d['include']=[{'all':!![]}];}_0x48961d=_['merge']({},_0x48961d,_0x3e45e8[_0x345d('0x3f')]);return db['ZohoAccount'][_0x345d('0x48')](_0x48961d)[_0x345d('0x27')](handleEntityNotFound(_0x26c33f,null))[_0x345d('0x27')](respondWithResult(_0x26c33f,null))['catch'](handleError(_0x26c33f,null));};exports[_0x345d('0x49')]=function(_0x3e446d,_0x163f9e){return db[_0x345d('0x40')][_0x345d('0x49')](_0x3e446d[_0x345d('0x4a')],{})[_0x345d('0x27')](respondWithResult(_0x163f9e,0xc9))[_0x345d('0x44')](handleError(_0x163f9e,null));};exports[_0x345d('0x26')]=function(_0x415bbf,_0x1c5a21){if(_0x415bbf[_0x345d('0x4a')]['id']){delete _0x415bbf[_0x345d('0x4a')]['id'];}return db[_0x345d('0x40')][_0x345d('0x48')]({'where':{'id':_0x415bbf['params']['id']}})[_0x345d('0x27')](handleEntityNotFound(_0x1c5a21,null))[_0x345d('0x27')](saveUpdates(_0x415bbf[_0x345d('0x4a')],null))['then'](respondWithResult(_0x1c5a21,null))[_0x345d('0x44')](handleError(_0x1c5a21,null));};exports[_0x345d('0x28')]=function(_0x2f5ef8,_0x3c02c3){return db['ZohoAccount'][_0x345d('0x48')]({'where':{'id':_0x2f5ef8[_0x345d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c02c3,null))['then'](removeEntity(_0x3c02c3,null))['catch'](handleError(_0x3c02c3,null));};exports['getConfigurations']=function(_0x5846d2,_0x373f21,_0x12f5ce){var _0x22c645={};var _0x3f8ef2={};var _0x5e6703;var _0x188232;return db['ZohoAccount'][_0x345d('0x4c')]({'where':{'id':_0x5846d2[_0x345d('0x4b')]['id']}})[_0x345d('0x27')](handleEntityNotFound(_0x373f21,null))[_0x345d('0x27')](function(_0x179da3){if(_0x179da3){_0x5e6703=_0x179da3;_0x3f8ef2['model']=_[_0x345d('0x46')](db[_0x345d('0x4d')][_0x345d('0x2e')]);_0x3f8ef2[_0x345d('0x32')]=_[_0x345d('0x46')](_0x5846d2[_0x345d('0x32')]);_0x3f8ef2[_0x345d('0x33')]=_[_0x345d('0x34')](_0x3f8ef2[_0x345d('0x31')],_0x3f8ef2[_0x345d('0x32')]);_0x22c645[_0x345d('0x36')]=_['intersection'](_0x3f8ef2['model'],qs[_0x345d('0x35')](_0x5846d2[_0x345d('0x32')][_0x345d('0x35')]));_0x22c645[_0x345d('0x36')]=_0x22c645[_0x345d('0x36')][_0x345d('0x47')]?_0x22c645[_0x345d('0x36')]:_0x3f8ef2['model'];_0x22c645[_0x345d('0x4e')]=qs[_0x345d('0x39')](_0x5846d2[_0x345d('0x32')]['sort']);_0x22c645['where']=qs[_0x345d('0x33')](_[_0x345d('0x3b')](_0x5846d2[_0x345d('0x32')],_0x3f8ef2[_0x345d('0x33')]));if(_0x5846d2['query'][_0x345d('0x4f')]){_0x22c645[_0x345d('0x3a')]=_[_0x345d('0x3c')](_0x22c645[_0x345d('0x3a')],{'$or':_[_0x345d('0x2d')](_0x22c645[_0x345d('0x36')],function(_0xe11432){var _0xdf50f={};_0xdf50f[_0xe11432]={'$like':'%'+_0x5846d2[_0x345d('0x32')][_0x345d('0x4f')]+'%'};return _0xdf50f;})});}_0x22c645=_[_0x345d('0x3c')]({},_0x22c645,_0x5846d2[_0x345d('0x3f')]);return _0x5e6703[_0x345d('0x50')](_0x22c645);}})[_0x345d('0x27')](function(_0x3a5e64){if(_0x3a5e64){_0x188232=_0x3a5e64[_0x345d('0x47')];if(!_0x5846d2[_0x345d('0x32')][_0x345d('0x51')](_0x345d('0x37'))){_0x22c645[_0x345d('0x38')]=qs['limit'](_0x5846d2[_0x345d('0x32')][_0x345d('0x38')]);_0x22c645[_0x345d('0x1e')]=qs[_0x345d('0x1e')](_0x5846d2[_0x345d('0x32')][_0x345d('0x1e')]);}return _0x5e6703[_0x345d('0x50')](_0x22c645);}})[_0x345d('0x27')](function(_0x52ad0a){if(_0x52ad0a){return _0x52ad0a?{'count':_0x188232,'rows':_0x52ad0a}:null;}})[_0x345d('0x27')](respondWithResult(_0x373f21,null))[_0x345d('0x44')](handleError(_0x373f21,null));};exports[_0x345d('0x52')]=function(_0x1d13a7,_0x2f8c66,_0x292932){if(_0x1d13a7[_0x345d('0x4a')]['id']){delete _0x1d13a7[_0x345d('0x4a')]['id'];}return db[_0x345d('0x40')]['findOne']({'where':{'id':_0x1d13a7[_0x345d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f8c66,null))[_0x345d('0x27')](function(_0x396c82){if(_0x396c82){_0x1d13a7[_0x345d('0x4a')][_0x345d('0x53')]=_0x396c82['id'];_0x1d13a7['body'][_0x345d('0x54')]=integrations[_0x345d('0x55')](_0x1d13a7[_0x345d('0x4a')][_0x345d('0x56')],_0x1d13a7[_0x345d('0x4a')]['type']);_0x1d13a7[_0x345d('0x4a')][_0x345d('0x57')]=integrations[_0x345d('0x58')](_0x1d13a7['body'][_0x345d('0x56')],_0x1d13a7['body'][_0x345d('0x3d')]);return db[_0x345d('0x4d')]['create'](_0x1d13a7[_0x345d('0x4a')],{'include':[{'model':db['ZohoField'],'as':_0x345d('0x54')},{'model':db[_0x345d('0x59')],'as':'Descriptions'}]});}return null;})[_0x345d('0x27')](respondWithResult(_0x2f8c66,null))[_0x345d('0x44')](handleError(_0x2f8c66,null));};function getAccessToken(_0x263d51){return new Promise(function(_0x469786,_0x26715e){var _0x555309;switch(_0x263d51['zone']){case'US':_0x555309=_0x345d('0x5a');break;case'AU':_0x555309='https://accounts.zoho.com.au';break;case'EU':_0x555309=_0x345d('0x5b');break;case'IN':_0x555309='https://accounts.zoho.in';break;case'CN':_0x555309=_0x345d('0x5c');break;default:_0x555309=_0x345d('0x5b');break;}var _0x3782ca={'method':_0x345d('0x5d'),'uri':_0x555309+_0x345d('0x5e'),'qs':{'refresh_token':_0x263d51['refreshToken'],'client_id':_0x263d51[_0x345d('0x5f')],'client_secret':_0x263d51[_0x345d('0x60')],'grant_type':_0x345d('0x61')},'json':!![]};return rp(_0x3782ca)[_0x345d('0x27')](function(_0x46f906){if(_0x46f906['access_token']){_0x469786(_0x46f906[_0x345d('0x62')]);}else{_0x26715e(_0x345d('0x63'));}})[_0x345d('0x44')](function(_0x14eb44){_0x26715e(_0x14eb44);});});}exports['getFields']=function(_0x51084e,_0x20b7bb,_0x134ad0){var _0x564a7c,_0x317b1c,_0x1738ff,_0xa90f7c,_0x520bfe;return db[_0x345d('0x40')][_0x345d('0x4c')]({'where':{'id':_0x51084e[_0x345d('0x4b')]['id']},'attributes':['id',_0x345d('0x64'),_0x345d('0x65'),_0x345d('0x5f'),'clientSecret',_0x345d('0x66'),_0x345d('0x67'),'refreshToken']})[_0x345d('0x27')](handleEntityNotFound(_0x20b7bb,null))[_0x345d('0x27')](function(_0x395a4c){_0x520bfe=_0x395a4c;_0x564a7c=_0x520bfe[_0x345d('0x64')];_0x317b1c=_0x564a7c===_0x345d('0x68')?'eu':_0x345d('0x69');_0x1738ff=_0x520bfe[_0x345d('0x66')];var _0x967040=_0x1738ff[_0x345d('0x6a')](-0x1);if(_0x967040==='/'||_0x967040==='\x5c'||_0x967040===':'){_0x1738ff=_0x1738ff[_0x345d('0x6b')](0x0,_0x1738ff[_0x345d('0x6c')](_0x967040));}if(!_0x520bfe['refreshToken']){throw new Error(_0x345d('0x6d'));}return getAccessToken(_0x520bfe);})[_0x345d('0x27')](function(_0x25b14b){if(_0x25b14b){return rp({'method':'GET','uri':util[_0x345d('0x6e')](_0x345d('0x6f'),_0x317b1c),'qs':{'module':'Calls'},'headers':{'Authorization':_0x345d('0x70')+_0x25b14b},'json':!![]});}})[_0x345d('0x27')](function(_0x42273b){if(_0x42273b){if(_0x42273b[_0x345d('0x71')]&&_0x42273b[_0x345d('0x71')][_0x345d('0x29')]){throw new Error(_0x42273b['response'][_0x345d('0x29')]['message']);}var _0x183ebf=[];var _0x1eaf2f=[];var _0x41a592=[_0x345d('0x72'),_0x345d('0x73'),_0x345d('0x74'),'WhoId',_0x345d('0x75'),'Call_Result','Call_Start_Time',_0x345d('0x76')];_0x1eaf2f=_[_0x345d('0x77')](_0x42273b[_0x345d('0x35')],function(_0x418658){return _0x41a592[_0x345d('0x78')](_0x418658[_0x345d('0x79')]);});for(var _0x1f187e=0x0;_0x1f187e<_0x1eaf2f[_0x345d('0x47')];_0x1f187e++){if(_0x1eaf2f[_0x1f187e][_0x345d('0x7a')]===![]){_0x183ebf[_0x345d('0x7b')]({'id':_0x1eaf2f[_0x1f187e]['id'],'name':_0x1eaf2f[_0x1f187e]['display_label'],'custom':_0x1eaf2f[_0x1f187e]['custom_field'],'options':_0x1eaf2f[_0x1f187e][_0x345d('0x7c')]===_0x345d('0x7d')&&_0x1eaf2f[_0x1f187e]['pick_list_values'][_0x345d('0x47')]>-0x1?_[_0x345d('0x2d')](_0x1eaf2f[_0x1f187e]['pick_list_values'],function(_0x5e2ead){return{'name':_0x5e2ead,'value':_0x5e2ead};}):[]});}}return{'count':_0x183ebf[_0x345d('0x47')],'rows':_0x183ebf};}else{return{'count':0x0,'rows':[]};}})[_0x345d('0x27')](respondWithResult(_0x20b7bb,null))[_0x345d('0x44')](function(_0x4a50f0){var _0x401cfb=_0x51084e[_0x345d('0x32')]['test']?0x1f4:_0x4a50f0['statusCode']||0x1f4;logger[_0x345d('0x29')](_0x345d('0x7e'),_0x345d('0x7f'),_0x401cfb,JSON[_0x345d('0x80')](_0x4a50f0));delete _0x4a50f0['name'];if(_0x401cfb===0x191){_0x401cfb=0x190;}_0x20b7bb[_0x345d('0x1b')](_0x401cfb)[_0x345d('0x2c')](_0x51084e[_0x345d('0x32')][_0x345d('0x81')]?{'message':'Wrong\x20credentials','statusCode':_0x4a50f0[_0x345d('0x82')]}:_0x4a50f0);});};
\ No newline at end of file
index fe76e4b..d1b8526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba0b=['/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','lastIndexOf','then','info','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','clientId','clientSecret','code','host','serverUrl','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xba0b,0xc1));var _0xbba0=function(_0xc78e4,_0x21d43a){_0xc78e4=_0xc78e4-0x0;var _0x4ce621=_0xba0b[_0xc78e4];return _0x4ce621;};'use strict';var _=require(_0xbba0('0x0'));var util=require(_0xbba0('0x1'));var logger=require(_0xbba0('0x2'))(_0xbba0('0x3'));var moment=require(_0xbba0('0x4'));var BPromise=require('bluebird');var rp=require(_0xbba0('0x5'));var fs=require('fs');var path=require(_0xbba0('0x6'));var rimraf=require('rimraf');var config=require(_0xbba0('0x7'));var attributes=require(_0xbba0('0x8'));var integrations=require(_0xbba0('0x9'));module[_0xbba0('0xa')]=function(_0xae29cb,_0x174127){return _0xae29cb[_0xbba0('0xb')](_0xbba0('0xc'),attributes,{'tableName':_0xbba0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x22bc5,_0x438929,_0x1d802c){if(_0x22bc5[_0xbba0('0xe')]('zone')||_0x22bc5[_0xbba0('0xe')]('serverUrl')||_0x22bc5[_0xbba0('0xe')](_0xbba0('0xf'))||_0x22bc5[_0xbba0('0xe')](_0xbba0('0x10'))||_0x22bc5[_0xbba0('0xe')](_0xbba0('0x11'))||_0x22bc5[_0xbba0('0xe')](_0xbba0('0x12'))){var _0x1ee68d,_0x1740f0;_0x1ee68d=_0x22bc5[_0xbba0('0x13')];var _0x1c7d33=_0x1ee68d['slice'](-0x1);if(_0x1c7d33==='/'||_0x1c7d33==='\x5c'||_0x1c7d33===':'){_0x1ee68d=_0x1ee68d[_0xbba0('0x14')](0x0,_0x1ee68d['lastIndexOf'](_0x1c7d33));}switch(_0x22bc5['zone']){case'US':_0x1740f0=_0xbba0('0x15');break;case'AU':_0x1740f0=_0xbba0('0x16');break;case'IN':_0x1740f0=_0xbba0('0x17');break;case'CN':_0x1740f0=_0xbba0('0x18');break;default:_0x1740f0=_0xbba0('0x19');break;}var _0x1be72b={'method':_0xbba0('0x1a'),'uri':_0x1740f0+_0xbba0('0x1b'),'form':{'grant_type':_0xbba0('0x1c'),'client_id':_0x22bc5[_0xbba0('0xf')],'client_secret':_0x22bc5[_0xbba0('0x10')],'redirect_uri':_0x22bc5[_0xbba0('0x13')],'code':_0x22bc5['code']},'headers':{'Content-Type':_0xbba0('0x1d')}};return rp(_0x1be72b)['then'](function(_0x260df0){var _0x5957c4=JSON[_0xbba0('0x1e')](_0x260df0);if(_0x5957c4[_0xbba0('0x1f')]){_0x22bc5[_0xbba0('0x20')]=_0x5957c4[_0xbba0('0x1f')];logger['info'](util[_0xbba0('0x21')](_0xbba0('0x22'),_0x22bc5[_0xbba0('0x23')],_0x22bc5['id']));}else{logger[_0xbba0('0x24')](util[_0xbba0('0x21')](_0xbba0('0x25'),_0x22bc5[_0xbba0('0x23')],_0x22bc5['id']),util[_0xbba0('0x26')](_0x5957c4,{'showHidden':![],'depth':null}));}return _0x1d802c(null,_0x438929);})[_0xbba0('0x27')](function(_0x4a7a5b){logger[_0xbba0('0x24')](util['format'](_0xbba0('0x25'),_0x22bc5['name'],_0x22bc5['id']),util[_0xbba0('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d802c(_0x4a7a5b);});}else{return _0x1d802c(null,_0x438929);}},'beforeUpdate':function(_0x53bebd,_0x57eda9,_0x7d7252){if(_0x53bebd['changed'](_0xbba0('0x28'))||_0x53bebd['changed'](_0xbba0('0x13'))||_0x53bebd[_0xbba0('0xe')]('clientId')||_0x53bebd[_0xbba0('0xe')](_0xbba0('0x10'))||_0x53bebd[_0xbba0('0xe')]('code')||_0x53bebd[_0xbba0('0xe')](_0xbba0('0x12'))){var _0x329dec,_0x4a731a;_0x329dec=_0x53bebd[_0xbba0('0x13')];var _0x52e18c=_0x329dec['slice'](-0x1);if(_0x52e18c==='/'||_0x52e18c==='\x5c'||_0x52e18c===':'){_0x329dec=_0x329dec[_0xbba0('0x14')](0x0,_0x329dec[_0xbba0('0x29')](_0x52e18c));}switch(_0x53bebd[_0xbba0('0x28')]){case'US':_0x4a731a=_0xbba0('0x15');break;case'AU':_0x4a731a=_0xbba0('0x16');break;case'IN':_0x4a731a=_0xbba0('0x17');break;case'CN':_0x4a731a='https://accounts.zoho.com.cn';break;default:_0x4a731a='https://accounts.zoho.eu';break;}var _0x2b9d87={'method':_0xbba0('0x1a'),'uri':_0x4a731a+_0xbba0('0x1b'),'form':{'grant_type':'authorization_code','client_id':_0x53bebd[_0xbba0('0xf')],'client_secret':_0x53bebd[_0xbba0('0x10')],'redirect_uri':_0x53bebd[_0xbba0('0x13')],'code':_0x53bebd[_0xbba0('0x11')]},'headers':{'Content-Type':_0xbba0('0x1d')}};return rp(_0x2b9d87)[_0xbba0('0x2a')](function(_0x41e9e0){var _0x126c39=JSON[_0xbba0('0x1e')](_0x41e9e0);if(_0x126c39[_0xbba0('0x1f')]){_0x53bebd[_0xbba0('0x20')]=_0x126c39['refresh_token'];logger[_0xbba0('0x2b')](util[_0xbba0('0x21')](_0xbba0('0x22'),_0x53bebd['name'],_0x53bebd['id']));}else{logger[_0xbba0('0x24')](util[_0xbba0('0x21')](_0xbba0('0x25'),_0x53bebd['name'],_0x53bebd['id']),util[_0xbba0('0x26')](_0x126c39,{'showHidden':![],'depth':null}));}return _0x7d7252(null,_0x57eda9);})['catch'](function(_0x36a340){logger[_0xbba0('0x24')](util[_0xbba0('0x21')](_0xbba0('0x25'),_0x53bebd[_0xbba0('0x23')],_0x53bebd['id']),util[_0xbba0('0x26')](parsedResult,{'showHidden':![],'depth':null}));return _0x7d7252(_0x36a340);});}else{return _0x7d7252(null,_0x57eda9);}}}});};
\ No newline at end of file
+var _0x9345=['then','parse','refresh_token','refreshToken','info','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','zone','clientId','code','https://accounts.zoho.com','https://accounts.zoho.com.au','POST','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientSecret','slice','substring','lastIndexOf','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded'];(function(_0x44d928,_0xf3a195){var _0x526e3d=function(_0x1b6ec4){while(--_0x1b6ec4){_0x44d928['push'](_0x44d928['shift']());}};_0x526e3d(++_0xf3a195);}(_0x9345,0x90));var _0x5934=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x9345[_0x1faaa1];return _0x994ec;};'use strict';var _=require(_0x5934('0x0'));var util=require(_0x5934('0x1'));var logger=require(_0x5934('0x2'))(_0x5934('0x3'));var moment=require(_0x5934('0x4'));var BPromise=require(_0x5934('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5934('0x6'));var rimraf=require(_0x5934('0x7'));var config=require(_0x5934('0x8'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x5934('0x9'));module['exports']=function(_0xa980c4,_0x373350){return _0xa980c4[_0x5934('0xa')](_0x5934('0xb'),attributes,{'tableName':_0x5934('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2299c2,_0x3bee21,_0x40840c){if(_0x2299c2[_0x5934('0xd')]('zone')||_0x2299c2[_0x5934('0xd')](_0x5934('0xe'))||_0x2299c2[_0x5934('0xd')]('clientId')||_0x2299c2[_0x5934('0xd')](_0x5934('0xf'))||_0x2299c2[_0x5934('0xd')]('code')||_0x2299c2['changed']('host')){var _0x407238,_0x4e4323;_0x407238=_0x2299c2[_0x5934('0xe')];var _0x47a2ff=_0x407238[_0x5934('0x10')](-0x1);if(_0x47a2ff==='/'||_0x47a2ff==='\x5c'||_0x47a2ff===':'){_0x407238=_0x407238[_0x5934('0x11')](0x0,_0x407238[_0x5934('0x12')](_0x47a2ff));}switch(_0x2299c2['zone']){case'US':_0x4e4323='https://accounts.zoho.com';break;case'AU':_0x4e4323='https://accounts.zoho.com.au';break;case'IN':_0x4e4323=_0x5934('0x13');break;case'CN':_0x4e4323=_0x5934('0x14');break;default:_0x4e4323='https://accounts.zoho.eu';break;}var _0x2b9c15={'method':'POST','uri':_0x4e4323+_0x5934('0x15'),'form':{'grant_type':_0x5934('0x16'),'client_id':_0x2299c2['clientId'],'client_secret':_0x2299c2[_0x5934('0xf')],'redirect_uri':_0x2299c2[_0x5934('0xe')],'code':_0x2299c2['code']},'headers':{'Content-Type':_0x5934('0x17')}};return rp(_0x2b9c15)[_0x5934('0x18')](function(_0x3c7ab7){var _0xe25624=JSON[_0x5934('0x19')](_0x3c7ab7);if(_0xe25624[_0x5934('0x1a')]){_0x2299c2[_0x5934('0x1b')]=_0xe25624[_0x5934('0x1a')];logger[_0x5934('0x1c')](util[_0x5934('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2299c2['name'],_0x2299c2['id']));}else{logger[_0x5934('0x1e')](util[_0x5934('0x1d')](_0x5934('0x1f'),_0x2299c2['name'],_0x2299c2['id']),util[_0x5934('0x20')](_0xe25624,{'showHidden':![],'depth':null}));}return _0x40840c(null,_0x3bee21);})[_0x5934('0x21')](function(_0x38add2){logger[_0x5934('0x1e')](util[_0x5934('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2299c2[_0x5934('0x22')],_0x2299c2['id']),util[_0x5934('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x40840c(_0x38add2);});}else{return _0x40840c(null,_0x3bee21);}},'beforeUpdate':function(_0x503012,_0x4b23dd,_0x1263f4){if(_0x503012[_0x5934('0xd')](_0x5934('0x23'))||_0x503012[_0x5934('0xd')]('serverUrl')||_0x503012['changed'](_0x5934('0x24'))||_0x503012[_0x5934('0xd')](_0x5934('0xf'))||_0x503012[_0x5934('0xd')](_0x5934('0x25'))||_0x503012[_0x5934('0xd')]('host')){var _0x49b4c1,_0x424590;_0x49b4c1=_0x503012[_0x5934('0xe')];var _0x1543de=_0x49b4c1['slice'](-0x1);if(_0x1543de==='/'||_0x1543de==='\x5c'||_0x1543de===':'){_0x49b4c1=_0x49b4c1['substring'](0x0,_0x49b4c1[_0x5934('0x12')](_0x1543de));}switch(_0x503012[_0x5934('0x23')]){case'US':_0x424590=_0x5934('0x26');break;case'AU':_0x424590=_0x5934('0x27');break;case'IN':_0x424590='https://accounts.zoho.in';break;case'CN':_0x424590=_0x5934('0x14');break;default:_0x424590='https://accounts.zoho.eu';break;}var _0x48ddad={'method':_0x5934('0x28'),'uri':_0x424590+'/oauth/v2/token','form':{'grant_type':_0x5934('0x16'),'client_id':_0x503012[_0x5934('0x24')],'client_secret':_0x503012['clientSecret'],'redirect_uri':_0x503012[_0x5934('0xe')],'code':_0x503012[_0x5934('0x25')]},'headers':{'Content-Type':_0x5934('0x17')}};return rp(_0x48ddad)[_0x5934('0x18')](function(_0xaa190e){var _0x544ccd=JSON[_0x5934('0x19')](_0xaa190e);if(_0x544ccd[_0x5934('0x1a')]){_0x503012[_0x5934('0x1b')]=_0x544ccd[_0x5934('0x1a')];logger[_0x5934('0x1c')](util[_0x5934('0x1d')](_0x5934('0x29'),_0x503012[_0x5934('0x22')],_0x503012['id']));}else{logger['error'](util[_0x5934('0x1d')](_0x5934('0x1f'),_0x503012[_0x5934('0x22')],_0x503012['id']),util[_0x5934('0x20')](_0x544ccd,{'showHidden':![],'depth':null}));}return _0x1263f4(null,_0x4b23dd);})['catch'](function(_0x22885a){logger[_0x5934('0x1e')](util[_0x5934('0x1d')](_0x5934('0x1f'),_0x503012[_0x5934('0x22')],_0x503012['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1263f4(_0x22885a);});}else{return _0x1263f4(null,_0x4b23dd);}}}});};
\ No newline at end of file
index 62c9181..52b2a34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcaf2=['raw','attributes','limit','include','map','model','GetZohoAccount','stringify','catch','ShowZohoAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ZohoAccount','options'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xcaf2,0x8a));var _0x2caf=function(_0x52a58c,_0x102224){_0x52a58c=_0x52a58c-0x0;var _0x3e826a=_0xcaf2[_0x52a58c];return _0x3e826a;};'use strict';var _=require(_0x2caf('0x0'));var util=require('util');var moment=require(_0x2caf('0x1'));var BPromise=require(_0x2caf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2caf('0x3'));var db=require(_0x2caf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2caf('0x5'))('rpc');var config=require(_0x2caf('0x6'));var jayson=require(_0x2caf('0x7'));var client=jayson[_0x2caf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc44e4e,_0x314486,_0x4667c6){return new BPromise(function(_0x34e792,_0x5611aa){return client[_0x2caf('0x9')](_0xc44e4e,_0x4667c6)[_0x2caf('0xa')](function(_0x45e520){logger[_0x2caf('0xb')](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));logger[_0x2caf('0xe')](_0x2caf('0xf'),_0x314486,_0x2caf('0xd'),JSON['stringify'](_0x45e520));if(_0x45e520[_0x2caf('0x10')]){if(_0x45e520[_0x2caf('0x10')][_0x2caf('0x11')]===0x1f4){logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520[_0x2caf('0x10')][_0x2caf('0x12')]);return _0x5611aa(_0x45e520[_0x2caf('0x10')]['message']);}logger[_0x2caf('0x10')](_0x2caf('0xc'),_0x314486,_0x45e520['error']['message']);return _0x34e792(_0x45e520['error'][_0x2caf('0x12')]);}else{logger['info'](_0x2caf('0xc'),_0x314486,_0x2caf('0xd'));_0x34e792(_0x45e520[_0x2caf('0x13')][_0x2caf('0x12')]);}})['catch'](function(_0x184355){logger['error'](_0x2caf('0xc'),_0x314486,_0x184355);_0x5611aa(_0x184355);});});}exports['GetZohoAccount']=function(_0x4a33fc){var _0x3e975f=this;return new Promise(function(_0x58047b,_0xe72440){return db[_0x2caf('0x14')]['findAll']({'raw':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x16')]===undefined?!![]:![]:!![],'where':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')]['where']||null:null,'attributes':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x17')]||null:null,'limit':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x18')]||null:null,'include':_0x4a33fc[_0x2caf('0x15')]?_0x4a33fc[_0x2caf('0x15')][_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x4a33fc[_0x2caf('0x15')]['include'],function(_0x296305){return{'model':db[_0x296305[_0x2caf('0x1b')]],'as':_0x296305['as'],'attributes':_0x296305[_0x2caf('0x17')],'include':_0x296305[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x296305[_0x2caf('0x19')],function(_0x392196){return{'model':db[_0x392196[_0x2caf('0x1b')]],'as':_0x392196['as'],'attributes':_0x392196[_0x2caf('0x17')],'include':_0x392196[_0x2caf('0x19')]?_['map'](_0x392196[_0x2caf('0x19')],function(_0x325eda){return{'model':db[_0x325eda[_0x2caf('0x1b')]],'as':_0x325eda['as'],'attributes':_0x325eda[_0x2caf('0x17')]};}):[]};}):[]};}):[]:[]})[_0x2caf('0xa')](function(_0x17d3c6){logger[_0x2caf('0xb')](_0x2caf('0x1c'),_0x4a33fc);logger[_0x2caf('0xe')](_0x2caf('0x1c'),_0x4a33fc,JSON[_0x2caf('0x1d')](_0x17d3c6));_0x58047b(_0x17d3c6);})[_0x2caf('0x1e')](function(_0x158d60){logger['error'](_0x2caf('0x1c'),_0x158d60[_0x2caf('0x12')],_0x4a33fc);_0xe72440(_0x3e975f[_0x2caf('0x10')](0x1f4,_0x158d60[_0x2caf('0x12')]));});});};exports[_0x2caf('0x1f')]=function(_0x1f52bf){var _0x3812cd=this;return new Promise(function(_0x524e0c,_0x21b3c4){return db[_0x2caf('0x14')]['find']({'raw':_0x1f52bf[_0x2caf('0x15')]?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x16')]===undefined?!![]:![]:!![],'where':_0x1f52bf['options']?_0x1f52bf[_0x2caf('0x15')]['where']||null:null,'attributes':_0x1f52bf['options']?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x17')]||null:null,'include':_0x1f52bf[_0x2caf('0x15')]?_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x1f52bf[_0x2caf('0x15')][_0x2caf('0x19')],function(_0x20818e){return{'model':db[_0x20818e['model']],'as':_0x20818e['as'],'attributes':_0x20818e[_0x2caf('0x17')],'include':_0x20818e[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x20818e[_0x2caf('0x19')],function(_0x17c1b4){return{'model':db[_0x17c1b4[_0x2caf('0x1b')]],'as':_0x17c1b4['as'],'attributes':_0x17c1b4[_0x2caf('0x17')],'include':_0x17c1b4[_0x2caf('0x19')]?_[_0x2caf('0x1a')](_0x17c1b4[_0x2caf('0x19')],function(_0x105ec7){return{'model':db[_0x105ec7[_0x2caf('0x1b')]],'as':_0x105ec7['as'],'attributes':_0x105ec7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x410020){logger[_0x2caf('0xb')](_0x2caf('0x1f'),_0x1f52bf);logger[_0x2caf('0xe')]('ShowZohoAccount',_0x1f52bf,JSON[_0x2caf('0x1d')](_0x410020));_0x524e0c(_0x410020);})[_0x2caf('0x1e')](function(_0x4568f9){logger[_0x2caf('0x10')](_0x2caf('0x1f'),_0x4568f9[_0x2caf('0x12')],_0x1f52bf);_0x21b3c4(_0x3812cd[_0x2caf('0x10')](0x1f4,_0x4568f9[_0x2caf('0x12')]));});});};
\ No newline at end of file
+var _0xa7db=['../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5a62d3,_0xe1b696){var _0x36d159=function(_0x240c33){while(--_0x240c33){_0x5a62d3['push'](_0x5a62d3['shift']());}};_0x36d159(++_0xe1b696);}(_0xa7db,0xbf));var _0xba7d=function(_0x1d3ece,_0x556172){_0x1d3ece=_0x1d3ece-0x0;var _0x2feba1=_0xa7db[_0x1d3ece];return _0x2feba1;};'use strict';var _=require(_0xba7d('0x0'));var util=require(_0xba7d('0x1'));var moment=require(_0xba7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba7d('0x3'))['db'];var utils=require(_0xba7d('0x4'));var logger=require(_0xba7d('0x5'))(_0xba7d('0x6'));var config=require(_0xba7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba7d('0x8')][_0xba7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c089b,_0x1d891c,_0x4178b7){return new BPromise(function(_0x23a3b3,_0x52b290){return client[_0xba7d('0xa')](_0x3c089b,_0x4178b7)[_0xba7d('0xb')](function(_0x2b4c99){logger[_0xba7d('0xc')](_0xba7d('0xd'),_0x1d891c,'request\x20sent');logger[_0xba7d('0xe')](_0xba7d('0xf'),_0x1d891c,'request\x20sent',JSON[_0xba7d('0x10')](_0x2b4c99));if(_0x2b4c99[_0xba7d('0x11')]){if(_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x12')]===0x1f4){logger['error'](_0xba7d('0xd'),_0x1d891c,_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x13')]);return _0x52b290(_0x2b4c99[_0xba7d('0x11')]['message']);}logger[_0xba7d('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x1d891c,_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x13')]);return _0x23a3b3(_0x2b4c99[_0xba7d('0x11')][_0xba7d('0x13')]);}else{logger['info'](_0xba7d('0xd'),_0x1d891c,'request\x20sent');_0x23a3b3(_0x2b4c99['result'][_0xba7d('0x13')]);}})['catch'](function(_0x428246){logger[_0xba7d('0x11')](_0xba7d('0xd'),_0x1d891c,_0x428246);_0x52b290(_0x428246);});});}exports[_0xba7d('0x14')]=function(_0x4298eb){var _0x198166=this;return new Promise(function(_0xd2ae5c,_0x699ae9){return db[_0xba7d('0x15')][_0xba7d('0x16')]({'raw':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x18')]===undefined?!![]:![]:!![],'where':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x19')]||null:null,'attributes':_0x4298eb['options']?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1a')]||null:null,'limit':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1b')]||null:null,'include':_0x4298eb[_0xba7d('0x17')]?_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x4298eb[_0xba7d('0x17')][_0xba7d('0x1c')],function(_0x395c77){return{'model':db[_0x395c77[_0xba7d('0x1e')]],'as':_0x395c77['as'],'attributes':_0x395c77[_0xba7d('0x1a')],'include':_0x395c77['include']?_[_0xba7d('0x1d')](_0x395c77['include'],function(_0x337c24){return{'model':db[_0x337c24[_0xba7d('0x1e')]],'as':_0x337c24['as'],'attributes':_0x337c24[_0xba7d('0x1a')],'include':_0x337c24[_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x337c24[_0xba7d('0x1c')],function(_0x136889){return{'model':db[_0x136889[_0xba7d('0x1e')]],'as':_0x136889['as'],'attributes':_0x136889[_0xba7d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c6681){logger[_0xba7d('0xc')](_0xba7d('0x14'),_0x4298eb);logger[_0xba7d('0xe')](_0xba7d('0x14'),_0x4298eb,JSON[_0xba7d('0x10')](_0x4c6681));_0xd2ae5c(_0x4c6681);})['catch'](function(_0x244233){logger['error'](_0xba7d('0x14'),_0x244233[_0xba7d('0x13')],_0x4298eb);_0x699ae9(_0x198166[_0xba7d('0x11')](0x1f4,_0x244233['message']));});});};exports[_0xba7d('0x1f')]=function(_0x32d090){var _0x3298db=this;return new Promise(function(_0x4958a9,_0x2479b0){return db[_0xba7d('0x15')][_0xba7d('0x20')]({'raw':_0x32d090[_0xba7d('0x17')]?_0x32d090['options']['raw']===undefined?!![]:![]:!![],'where':_0x32d090[_0xba7d('0x17')]?_0x32d090['options']['where']||null:null,'attributes':_0x32d090[_0xba7d('0x17')]?_0x32d090[_0xba7d('0x17')][_0xba7d('0x1a')]||null:null,'include':_0x32d090[_0xba7d('0x17')]?_0x32d090[_0xba7d('0x17')][_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x32d090[_0xba7d('0x17')][_0xba7d('0x1c')],function(_0x40f26a){return{'model':db[_0x40f26a[_0xba7d('0x1e')]],'as':_0x40f26a['as'],'attributes':_0x40f26a[_0xba7d('0x1a')],'include':_0x40f26a[_0xba7d('0x1c')]?_[_0xba7d('0x1d')](_0x40f26a[_0xba7d('0x1c')],function(_0x22d462){return{'model':db[_0x22d462[_0xba7d('0x1e')]],'as':_0x22d462['as'],'attributes':_0x22d462[_0xba7d('0x1a')],'include':_0x22d462['include']?_[_0xba7d('0x1d')](_0x22d462[_0xba7d('0x1c')],function(_0x3f8bdf){return{'model':db[_0x3f8bdf[_0xba7d('0x1e')]],'as':_0x3f8bdf['as'],'attributes':_0x3f8bdf[_0xba7d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ad460){logger[_0xba7d('0xc')](_0xba7d('0x1f'),_0x32d090);logger[_0xba7d('0xe')](_0xba7d('0x1f'),_0x32d090,JSON[_0xba7d('0x10')](_0x4ad460));_0x4958a9(_0x4ad460);})['catch'](function(_0x4dfdc2){logger[_0xba7d('0x11')](_0xba7d('0x1f'),_0x4dfdc2['message'],_0x32d090);_0x2479b0(_0x3298db[_0xba7d('0x11')](0x1f4,_0x4dfdc2[_0xba7d('0x13')]));});});};
\ No newline at end of file
index 4f174f8..95f83fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3032=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','index','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getDescriptions','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x3d986d,_0x573a8c){var _0xf78f48=function(_0x169517){while(--_0x169517){_0x3d986d['push'](_0x3d986d['shift']());}};_0xf78f48(++_0x573a8c);}(_0x3032,0x95));var _0x2303=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3032[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2303('0x0'));var util=require(_0x2303('0x1'));var path=require(_0x2303('0x2'));var timeout=require(_0x2303('0x3'));var express=require(_0x2303('0x4'));var router=express['Router']();var fs_extra=require(_0x2303('0x5'));var auth=require(_0x2303('0x6'));var interaction=require(_0x2303('0x7'));var config=require(_0x2303('0x8'));var controller=require(_0x2303('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x2303('0xa')]);router[_0x2303('0xb')](_0x2303('0xc'),auth[_0x2303('0xd')](),controller['show']);router['get'](_0x2303('0xe'),auth[_0x2303('0xd')](),controller[_0x2303('0xf')]);router[_0x2303('0xb')](_0x2303('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x2303('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2303('0x11')]);router['post']('/',auth[_0x2303('0xd')](),controller[_0x2303('0x12')]);router[_0x2303('0x13')](_0x2303('0xc'),auth[_0x2303('0xd')](),controller[_0x2303('0x14')]);router['delete'](_0x2303('0xc'),auth[_0x2303('0xd')](),controller['destroy']);module[_0x2303('0x15')]=router;
\ No newline at end of file
+var _0x5f2c=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x5f2c,0x156));var _0xc5f2=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f2c[_0x580576];return _0x3f55a0;};'use strict';var multer=require(_0xc5f2('0x0'));var util=require(_0xc5f2('0x1'));var path=require('path');var timeout=require(_0xc5f2('0x2'));var express=require(_0xc5f2('0x3'));var router=express['Router']();var fs_extra=require(_0xc5f2('0x4'));var auth=require(_0xc5f2('0x5'));var interaction=require(_0xc5f2('0x6'));var config=require(_0xc5f2('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xc5f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xc5f2('0x9')]);router[_0xc5f2('0x8')](_0xc5f2('0xa'),auth[_0xc5f2('0xb')](),controller['show']);router[_0xc5f2('0x8')](_0xc5f2('0xc'),auth[_0xc5f2('0xb')](),controller[_0xc5f2('0xd')]);router['get'](_0xc5f2('0xe'),auth[_0xc5f2('0xb')](),controller['getSubjects']);router[_0xc5f2('0x8')]('/:id/descriptions',auth[_0xc5f2('0xb')](),controller['getDescriptions']);router[_0xc5f2('0xf')]('/',auth[_0xc5f2('0xb')](),controller[_0xc5f2('0x10')]);router[_0xc5f2('0x11')]('/:id',auth[_0xc5f2('0xb')](),controller['update']);router[_0xc5f2('0x12')]('/:id',auth[_0xc5f2('0xb')](),controller[_0xc5f2('0x13')]);module[_0xc5f2('0x14')]=router;
\ No newline at end of file
index 786e4e9..9ceded5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x480c=['STRING','contact','nothing','ENUM','contact_lead','lead'];(function(_0x44f662,_0x1bbe00){var _0x55af2a=function(_0x3f95ad){while(--_0x3f95ad){_0x44f662['push'](_0x44f662['shift']());}};_0x55af2a(++_0x1bbe00);}(_0x480c,0xcc));var _0xc480=function(_0x57f57a,_0x39d796){_0x57f57a=_0x57f57a-0x0;var _0x544e7c=_0x480c[_0x57f57a];return _0x544e7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc480('0x0')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xc480('0x1'),_0xc480('0x2')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xc480('0x3')](_0xc480('0x4'),_0xc480('0x1'),_0xc480('0x5')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xc480('0x0')]}};
\ No newline at end of file
+var _0xee1f=['contact_lead','STRING','sequelize','ENUM','lead','contact','nothing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee1f,0x198));var _0xfee1=function(_0x541c3f,_0x26f15f){_0x541c3f=_0x541c3f-0x0;var _0x1c4b8a=_0xee1f[_0x541c3f];return _0x1c4b8a;};'use strict';var Sequelize=require(_0xfee1('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xfee1('0x1')](_0xfee1('0x2'),_0xfee1('0x3'),_0xfee1('0x4')),'defaultValue':_0xfee1('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xfee1('0x5'),_0xfee1('0x3'),_0xfee1('0x2')),'defaultValue':_0xfee1('0x5')},'description':{'type':Sequelize[_0xfee1('0x6')]}};
\ No newline at end of file
index 0809e44..210a29a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3b6=['nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','type','VIRTUAL','merge','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','keys','options','find','create','params','body','findOne','ZohoField','pick','getFields'];(function(_0x4c0833,_0x2f9b00){var _0x3c24f9=function(_0x18568b){while(--_0x18568b){_0x4c0833['push'](_0x4c0833['shift']());}};_0x3c24f9(++_0x2f9b00);}(_0xf3b6,0xf0));var _0x6f3b=function(_0x4eb6d7,_0x46d1c5){_0x4eb6d7=_0x4eb6d7-0x0;var _0x18cfbc=_0xf3b6[_0x4eb6d7];return _0x18cfbc;};'use strict';var emlformat=require(_0x6f3b('0x0'));var rimraf=require(_0x6f3b('0x1'));var zipdir=require(_0x6f3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f3b('0x3'));var moment=require(_0x6f3b('0x4'));var BPromise=require(_0x6f3b('0x5'));var Mustache=require(_0x6f3b('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6f3b('0x7'));var csv=require('to-csv');var ejs=require(_0x6f3b('0x8'));var fs=require('fs');var fs_extra=require(_0x6f3b('0x9'));var _=require(_0x6f3b('0xa'));var squel=require(_0x6f3b('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f3b('0xc'));var deskjs=require(_0x6f3b('0xd'));var toCsv=require(_0x6f3b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f3b('0xf'));var authService=require(_0x6f3b('0x10'));var qs=require(_0x6f3b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f3b('0x12'))(_0x6f3b('0x13'));var utils=require(_0x6f3b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6f3b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3521d0,_0x275cd){_0x275cd=_0x275cd||0xcc;return function(_0xeaa436){if(_0xeaa436){return _0x3521d0[_0x6f3b('0x16')](_0x275cd);}return _0x3521d0[_0x6f3b('0x17')](_0x275cd)[_0x6f3b('0x18')]();};}function respondWithResult(_0x58a27e,_0x394547){_0x394547=_0x394547||0xc8;return function(_0x5e0e5c){if(_0x5e0e5c){return _0x58a27e[_0x6f3b('0x17')](_0x394547)[_0x6f3b('0x19')](_0x5e0e5c);}};}function respondWithFilteredResult(_0x23f92d,_0x56f5cb){return function(_0x4a3f4d){if(_0x4a3f4d){var _0x50c867=typeof _0x56f5cb['offset']===_0x6f3b('0x1a')&&typeof _0x56f5cb['limit']==='undefined';var _0x50f386=_0x4a3f4d[_0x6f3b('0x1b')];var _0x5414c3=_0x50c867?0x0:_0x56f5cb[_0x6f3b('0x1c')];var _0x104761=_0x50c867?_0x4a3f4d[_0x6f3b('0x1b')]:_0x56f5cb[_0x6f3b('0x1c')]+_0x56f5cb[_0x6f3b('0x1d')];var _0x407982;if(_0x104761>=_0x50f386){_0x104761=_0x50f386;_0x407982=0xc8;}else{_0x407982=0xce;}_0x23f92d[_0x6f3b('0x17')](_0x407982);return _0x23f92d[_0x6f3b('0x1e')](_0x6f3b('0x1f'),_0x5414c3+'-'+_0x104761+'/'+_0x50f386)[_0x6f3b('0x19')](_0x4a3f4d);}return null;};}function patchUpdates(_0x5652ab){return function(_0x3e0b56){try{jsonpatch[_0x6f3b('0x20')](_0x3e0b56,_0x5652ab,!![]);}catch(_0x49af22){return BPromise[_0x6f3b('0x21')](_0x49af22);}return _0x3e0b56['save']();};}function saveUpdates(_0x12fcf7,_0x3aeac9){return function(_0x362409){if(_0x362409){return _0x362409[_0x6f3b('0x22')](_0x12fcf7)['then'](function(_0x708f0a){return _0x708f0a;});}return null;};}function removeEntity(_0x1b30af,_0x27cda0){return function(_0x2b5c87){if(_0x2b5c87){return _0x2b5c87[_0x6f3b('0x23')]()[_0x6f3b('0x24')](function(){_0x1b30af[_0x6f3b('0x17')](0xcc)[_0x6f3b('0x18')]();});}};}function handleEntityNotFound(_0x41449d,_0x4a55db){return function(_0xe606c9){if(!_0xe606c9){_0x41449d[_0x6f3b('0x16')](0x194);}return _0xe606c9;};}function handleError(_0x3090ba,_0xc3348c){_0xc3348c=_0xc3348c||0x1f4;return function(_0x1b9b3f){logger[_0x6f3b('0x25')](_0x1b9b3f['stack']);if(_0x1b9b3f[_0x6f3b('0x26')]){delete _0x1b9b3f[_0x6f3b('0x26')];}_0x3090ba[_0x6f3b('0x17')](_0xc3348c)[_0x6f3b('0x27')](_0x1b9b3f);};}exports[_0x6f3b('0x28')]=function(_0x2e0d54,_0x15719f){var _0x500dab={},_0x529159={},_0x36df51={'count':0x0,'rows':[]};var _0x30297e=_[_0x6f3b('0x29')](db['ZohoConfiguration'][_0x6f3b('0x2a')],function(_0x215553){return{'name':_0x215553[_0x6f3b('0x2b')],'type':_0x215553['type']['key']};});_0x529159[_0x6f3b('0x2c')]=_[_0x6f3b('0x29')](_0x30297e,_0x6f3b('0x26'));_0x529159[_0x6f3b('0x2d')]=_['keys'](_0x2e0d54[_0x6f3b('0x2d')]);_0x529159[_0x6f3b('0x2e')]=_[_0x6f3b('0x2f')](_0x529159[_0x6f3b('0x2c')],_0x529159[_0x6f3b('0x2d')]);_0x500dab[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x529159['model'],qs[_0x6f3b('0x31')](_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x500dab[_0x6f3b('0x30')]=_0x500dab[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x500dab[_0x6f3b('0x30')]:_0x529159[_0x6f3b('0x2c')];if(!_0x2e0d54['query'][_0x6f3b('0x33')]('nolimit')){_0x500dab[_0x6f3b('0x1d')]=qs[_0x6f3b('0x1d')](_0x2e0d54['query'][_0x6f3b('0x1d')]);_0x500dab[_0x6f3b('0x1c')]=qs['offset'](_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x1c')]);}_0x500dab[_0x6f3b('0x34')]=qs[_0x6f3b('0x35')](_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x500dab[_0x6f3b('0x36')]=qs[_0x6f3b('0x2e')](_['pick'](_0x2e0d54[_0x6f3b('0x2d')],_0x529159[_0x6f3b('0x2e')]),_0x30297e);if(_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x37')]){_0x500dab[_0x6f3b('0x36')]=_['merge'](_0x500dab[_0x6f3b('0x36')],{'$or':_[_0x6f3b('0x29')](_0x30297e,function(_0x2d8a39){if(_0x2d8a39[_0x6f3b('0x38')]!==_0x6f3b('0x39')){var _0x3fe98d={};_0x3fe98d[_0x2d8a39[_0x6f3b('0x26')]]={'$like':'%'+_0x2e0d54['query'][_0x6f3b('0x37')]+'%'};return _0x3fe98d;}})});}_0x500dab=_[_0x6f3b('0x3a')]({},_0x500dab,_0x2e0d54['options']);var _0xf85b5d={'where':_0x500dab[_0x6f3b('0x36')]};return db[_0x6f3b('0x3b')][_0x6f3b('0x1b')](_0xf85b5d)[_0x6f3b('0x24')](function(_0x1e06d0){_0x36df51['count']=_0x1e06d0;if(_0x2e0d54[_0x6f3b('0x2d')][_0x6f3b('0x3c')]){_0x500dab[_0x6f3b('0x3d')]=[{'all':!![]}];}return db[_0x6f3b('0x3b')][_0x6f3b('0x3e')](_0x500dab);})[_0x6f3b('0x24')](function(_0x530d70){_0x36df51[_0x6f3b('0x3f')]=_0x530d70;return _0x36df51;})['then'](respondWithFilteredResult(_0x15719f,_0x500dab))[_0x6f3b('0x40')](handleError(_0x15719f,null));};exports[_0x6f3b('0x41')]=function(_0x37f7de,_0x2305b3){var _0x44d56f={'raw':![],'where':{'id':_0x37f7de['params']['id']}},_0x210a21={};_0x210a21[_0x6f3b('0x2c')]=_[_0x6f3b('0x42')](db[_0x6f3b('0x3b')][_0x6f3b('0x2a')]);_0x210a21[_0x6f3b('0x2d')]=_['keys'](_0x37f7de[_0x6f3b('0x2d')]);_0x210a21[_0x6f3b('0x2e')]=_[_0x6f3b('0x2f')](_0x210a21[_0x6f3b('0x2c')],_0x210a21[_0x6f3b('0x2d')]);_0x44d56f[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x210a21[_0x6f3b('0x2c')],qs[_0x6f3b('0x31')](_0x37f7de[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x44d56f[_0x6f3b('0x30')]=_0x44d56f[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x44d56f[_0x6f3b('0x30')]:_0x210a21['model'];if(_0x37f7de[_0x6f3b('0x2d')]['includeAll']){_0x44d56f['include']=[{'all':!![]}];}_0x44d56f=_[_0x6f3b('0x3a')]({},_0x44d56f,_0x37f7de[_0x6f3b('0x43')]);return db['ZohoConfiguration'][_0x6f3b('0x44')](_0x44d56f)[_0x6f3b('0x24')](handleEntityNotFound(_0x2305b3,null))[_0x6f3b('0x24')](respondWithResult(_0x2305b3,null))['catch'](handleError(_0x2305b3,null));};exports[_0x6f3b('0x45')]=function(_0x557060,_0x467046){return db[_0x6f3b('0x3b')][_0x6f3b('0x45')](_0x557060['body'],{})[_0x6f3b('0x24')](respondWithResult(_0x467046,0xc9))[_0x6f3b('0x40')](handleError(_0x467046,null));};exports['update']=function(_0x2b3bce,_0x40224e){if(_0x2b3bce['body']['id']){delete _0x2b3bce['body']['id'];}return db[_0x6f3b('0x3b')]['find']({'where':{'id':_0x2b3bce[_0x6f3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x40224e,null))[_0x6f3b('0x24')](saveUpdates(_0x2b3bce[_0x6f3b('0x47')],null))[_0x6f3b('0x24')](respondWithResult(_0x40224e,null))[_0x6f3b('0x40')](handleError(_0x40224e,null));};exports[_0x6f3b('0x23')]=function(_0x3c224c,_0x24a94a){return db[_0x6f3b('0x3b')][_0x6f3b('0x44')]({'where':{'id':_0x3c224c[_0x6f3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x24a94a,null))[_0x6f3b('0x24')](removeEntity(_0x24a94a,null))['catch'](handleError(_0x24a94a,null));};exports['getFields']=function(_0x5b4ee9,_0x38db5f,_0x5b4a2d){var _0x18359f={};var _0x27f0f9={};var _0x409b0e;var _0x52cfe6;return db[_0x6f3b('0x3b')][_0x6f3b('0x48')]({'where':{'id':_0x5b4ee9[_0x6f3b('0x46')]['id']}})['then'](handleEntityNotFound(_0x38db5f,null))[_0x6f3b('0x24')](function(_0x52369d){if(_0x52369d){_0x409b0e=_0x52369d;_0x27f0f9[_0x6f3b('0x2c')]=_['keys'](db[_0x6f3b('0x49')]['rawAttributes']);_0x27f0f9[_0x6f3b('0x2d')]=_[_0x6f3b('0x42')](_0x5b4ee9['query']);_0x27f0f9[_0x6f3b('0x2e')]=_['intersection'](_0x27f0f9[_0x6f3b('0x2c')],_0x27f0f9[_0x6f3b('0x2d')]);_0x18359f[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x27f0f9[_0x6f3b('0x2c')],qs['fields'](_0x5b4ee9[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x18359f['attributes']=_0x18359f[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x18359f[_0x6f3b('0x30')]:_0x27f0f9['model'];_0x18359f['order']=qs['sort'](_0x5b4ee9[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x18359f[_0x6f3b('0x36')]=qs[_0x6f3b('0x2e')](_[_0x6f3b('0x4a')](_0x5b4ee9[_0x6f3b('0x2d')],_0x27f0f9[_0x6f3b('0x2e')]));if(_0x5b4ee9[_0x6f3b('0x2d')]['filter']){_0x18359f['where']=_[_0x6f3b('0x3a')](_0x18359f[_0x6f3b('0x36')],{'$or':_['map'](_0x18359f[_0x6f3b('0x30')],function(_0xc6cc49){var _0xda6604={};_0xda6604[_0xc6cc49]={'$like':'%'+_0x5b4ee9['query'][_0x6f3b('0x37')]+'%'};return _0xda6604;})});}_0x18359f=_[_0x6f3b('0x3a')]({},_0x18359f,_0x5b4ee9['options']);return _0x409b0e[_0x6f3b('0x4b')](_0x18359f);}})[_0x6f3b('0x24')](function(_0x158045){if(_0x158045){_0x52cfe6=_0x158045[_0x6f3b('0x32')];if(!_0x5b4ee9['query'][_0x6f3b('0x33')](_0x6f3b('0x4c'))){_0x18359f[_0x6f3b('0x1d')]=qs[_0x6f3b('0x1d')](_0x5b4ee9[_0x6f3b('0x2d')][_0x6f3b('0x1d')]);_0x18359f[_0x6f3b('0x1c')]=qs[_0x6f3b('0x1c')](_0x5b4ee9[_0x6f3b('0x2d')]['offset']);}return _0x409b0e[_0x6f3b('0x4b')](_0x18359f);}})[_0x6f3b('0x24')](function(_0x39dda0){if(_0x39dda0){return _0x39dda0?{'count':_0x52cfe6,'rows':_0x39dda0}:null;}})[_0x6f3b('0x24')](respondWithResult(_0x38db5f,null))[_0x6f3b('0x40')](handleError(_0x38db5f,null));};exports[_0x6f3b('0x4d')]=function(_0x53471d,_0x35d0ac,_0x22f53f){var _0x4cdcdd={};var _0x33b283={};var _0x49de7a;var _0xcad5cb;return db[_0x6f3b('0x3b')][_0x6f3b('0x48')]({'where':{'id':_0x53471d['params']['id']}})[_0x6f3b('0x24')](handleEntityNotFound(_0x35d0ac,null))['then'](function(_0x54a6e5){if(_0x54a6e5){_0x49de7a=_0x54a6e5;_0x33b283['model']=_[_0x6f3b('0x42')](db[_0x6f3b('0x49')][_0x6f3b('0x2a')]);_0x33b283[_0x6f3b('0x2d')]=_[_0x6f3b('0x42')](_0x53471d[_0x6f3b('0x2d')]);_0x33b283['filters']=_[_0x6f3b('0x2f')](_0x33b283['model'],_0x33b283[_0x6f3b('0x2d')]);_0x4cdcdd[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x33b283[_0x6f3b('0x2c')],qs[_0x6f3b('0x31')](_0x53471d[_0x6f3b('0x2d')][_0x6f3b('0x31')]));_0x4cdcdd[_0x6f3b('0x30')]=_0x4cdcdd['attributes']['length']?_0x4cdcdd[_0x6f3b('0x30')]:_0x33b283[_0x6f3b('0x2c')];_0x4cdcdd['order']=qs[_0x6f3b('0x35')](_0x53471d[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x4cdcdd[_0x6f3b('0x36')]=qs[_0x6f3b('0x2e')](_[_0x6f3b('0x4a')](_0x53471d[_0x6f3b('0x2d')],_0x33b283[_0x6f3b('0x2e')]));if(_0x53471d['query'][_0x6f3b('0x37')]){_0x4cdcdd[_0x6f3b('0x36')]=_[_0x6f3b('0x3a')](_0x4cdcdd[_0x6f3b('0x36')],{'$or':_[_0x6f3b('0x29')](_0x4cdcdd[_0x6f3b('0x30')],function(_0x103fa0){var _0x3490bc={};_0x3490bc[_0x103fa0]={'$like':'%'+_0x53471d[_0x6f3b('0x2d')][_0x6f3b('0x37')]+'%'};return _0x3490bc;})});}_0x4cdcdd=_['merge']({},_0x4cdcdd,_0x53471d[_0x6f3b('0x43')]);return _0x49de7a['getSubjects'](_0x4cdcdd);}})[_0x6f3b('0x24')](function(_0x2b71d1){if(_0x2b71d1){_0xcad5cb=_0x2b71d1['length'];if(!_0x53471d['query'][_0x6f3b('0x33')](_0x6f3b('0x4c'))){_0x4cdcdd[_0x6f3b('0x1d')]=qs[_0x6f3b('0x1d')](_0x53471d['query'][_0x6f3b('0x1d')]);_0x4cdcdd['offset']=qs[_0x6f3b('0x1c')](_0x53471d[_0x6f3b('0x2d')]['offset']);}return _0x49de7a[_0x6f3b('0x4d')](_0x4cdcdd);}})[_0x6f3b('0x24')](function(_0x3d6aa3){if(_0x3d6aa3){return _0x3d6aa3?{'count':_0xcad5cb,'rows':_0x3d6aa3}:null;}})[_0x6f3b('0x24')](respondWithResult(_0x35d0ac,null))[_0x6f3b('0x40')](handleError(_0x35d0ac,null));};exports[_0x6f3b('0x4e')]=function(_0x257acb,_0x4f4627,_0x185ff2){var _0x3de655={};var _0x996abd={};var _0x44ca8e;var _0x5c64fa;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x257acb[_0x6f3b('0x46')]['id']}})[_0x6f3b('0x24')](handleEntityNotFound(_0x4f4627,null))[_0x6f3b('0x24')](function(_0x286480){if(_0x286480){_0x44ca8e=_0x286480;_0x996abd[_0x6f3b('0x2c')]=_[_0x6f3b('0x42')](db[_0x6f3b('0x49')][_0x6f3b('0x2a')]);_0x996abd[_0x6f3b('0x2d')]=_[_0x6f3b('0x42')](_0x257acb[_0x6f3b('0x2d')]);_0x996abd['filters']=_[_0x6f3b('0x2f')](_0x996abd[_0x6f3b('0x2c')],_0x996abd[_0x6f3b('0x2d')]);_0x3de655[_0x6f3b('0x30')]=_[_0x6f3b('0x2f')](_0x996abd['model'],qs[_0x6f3b('0x31')](_0x257acb['query'][_0x6f3b('0x31')]));_0x3de655[_0x6f3b('0x30')]=_0x3de655[_0x6f3b('0x30')][_0x6f3b('0x32')]?_0x3de655['attributes']:_0x996abd[_0x6f3b('0x2c')];_0x3de655['order']=qs[_0x6f3b('0x35')](_0x257acb[_0x6f3b('0x2d')][_0x6f3b('0x35')]);_0x3de655['where']=qs[_0x6f3b('0x2e')](_[_0x6f3b('0x4a')](_0x257acb[_0x6f3b('0x2d')],_0x996abd[_0x6f3b('0x2e')]));if(_0x257acb[_0x6f3b('0x2d')][_0x6f3b('0x37')]){_0x3de655[_0x6f3b('0x36')]=_['merge'](_0x3de655[_0x6f3b('0x36')],{'$or':_[_0x6f3b('0x29')](_0x3de655[_0x6f3b('0x30')],function(_0x12121c){var _0x1f33ed={};_0x1f33ed[_0x12121c]={'$like':'%'+_0x257acb['query'][_0x6f3b('0x37')]+'%'};return _0x1f33ed;})});}_0x3de655=_[_0x6f3b('0x3a')]({},_0x3de655,_0x257acb[_0x6f3b('0x43')]);return _0x44ca8e[_0x6f3b('0x4e')](_0x3de655);}})[_0x6f3b('0x24')](function(_0x67c5a8){if(_0x67c5a8){_0x5c64fa=_0x67c5a8[_0x6f3b('0x32')];if(!_0x257acb['query'][_0x6f3b('0x33')](_0x6f3b('0x4c'))){_0x3de655['limit']=qs['limit'](_0x257acb[_0x6f3b('0x2d')][_0x6f3b('0x1d')]);_0x3de655[_0x6f3b('0x1c')]=qs[_0x6f3b('0x1c')](_0x257acb['query']['offset']);}return _0x44ca8e[_0x6f3b('0x4e')](_0x3de655);}})['then'](function(_0x2a95cf){if(_0x2a95cf){return _0x2a95cf?{'count':_0x5c64fa,'rows':_0x2a95cf}:null;}})[_0x6f3b('0x24')](respondWithResult(_0x4f4627,null))[_0x6f3b('0x40')](handleError(_0x4f4627,null));};
\ No newline at end of file
+var _0x1cb3=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','ZohoConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','destroy','findOne','ZohoField','options','getFields','getSubjects','getDescriptions','eml-format','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','save','update','then','end','name','index','map','fieldName','type','key','model','query','filters'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1cb3,0x6b));var _0x31cb=function(_0xd274d5,_0x250e77){_0xd274d5=_0xd274d5-0x0;var _0x2188be=_0x1cb3[_0xd274d5];return _0x2188be;};'use strict';var emlformat=require(_0x31cb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x31cb('0x1'));var rp=require(_0x31cb('0x2'));var moment=require(_0x31cb('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x31cb('0x4'));var sox=require(_0x31cb('0x5'));var csv=require(_0x31cb('0x6'));var ejs=require(_0x31cb('0x7'));var fs=require('fs');var fs_extra=require(_0x31cb('0x8'));var _=require('lodash');var squel=require(_0x31cb('0x9'));var crypto=require(_0x31cb('0xa'));var jsforce=require(_0x31cb('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x31cb('0x6'));var querystring=require(_0x31cb('0xc'));var Papa=require(_0x31cb('0xd'));var Redis=require(_0x31cb('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x31cb('0xf'));var as=require(_0x31cb('0x10'));var hardwareService=require(_0x31cb('0x11'));var logger=require('../../config/logger')(_0x31cb('0x12'));var utils=require('../../config/utils');var config=require(_0x31cb('0x13'));var licenseUtil=require(_0x31cb('0x14'));var db=require(_0x31cb('0x15'))['db'];function respondWithStatusCode(_0x2de9bd,_0x343550){_0x343550=_0x343550||0xcc;return function(_0x1b59bc){if(_0x1b59bc){return _0x2de9bd[_0x31cb('0x16')](_0x343550);}return _0x2de9bd[_0x31cb('0x17')](_0x343550)['end']();};}function respondWithResult(_0x917f4d,_0x2f86cf){_0x2f86cf=_0x2f86cf||0xc8;return function(_0x1eecef){if(_0x1eecef){return _0x917f4d[_0x31cb('0x17')](_0x2f86cf)['json'](_0x1eecef);}};}function respondWithFilteredResult(_0x1802da,_0x2a4c91){return function(_0x5a60ac){if(_0x5a60ac){var _0x1a90b8=typeof _0x2a4c91[_0x31cb('0x18')]===_0x31cb('0x19')&&typeof _0x2a4c91[_0x31cb('0x1a')]===_0x31cb('0x19');var _0x476fcd=_0x5a60ac['count'];var _0x475f64=_0x1a90b8?0x0:_0x2a4c91['offset'];var _0x5026ee=_0x1a90b8?_0x5a60ac[_0x31cb('0x1b')]:_0x2a4c91[_0x31cb('0x18')]+_0x2a4c91[_0x31cb('0x1a')];var _0x11295e;if(_0x5026ee>=_0x476fcd){_0x5026ee=_0x476fcd;_0x11295e=0xc8;}else{_0x11295e=0xce;}_0x1802da[_0x31cb('0x17')](_0x11295e);return _0x1802da[_0x31cb('0x1c')]('Content-Range',_0x475f64+'-'+_0x5026ee+'/'+_0x476fcd)['json'](_0x5a60ac);}return null;};}function patchUpdates(_0xda301d){return function(_0x1f9462){try{jsonpatch[_0x31cb('0x1d')](_0x1f9462,_0xda301d,!![]);}catch(_0x234bbb){return BPromise['reject'](_0x234bbb);}return _0x1f9462[_0x31cb('0x1e')]();};}function saveUpdates(_0x5949f3,_0x4619d4){return function(_0x1bb246){if(_0x1bb246){return _0x1bb246[_0x31cb('0x1f')](_0x5949f3)[_0x31cb('0x20')](function(_0x4d1abe){return _0x4d1abe;});}return null;};}function removeEntity(_0x4ff8fd,_0x38baa6){return function(_0x28bef2){if(_0x28bef2){return _0x28bef2['destroy']()[_0x31cb('0x20')](function(){_0x4ff8fd[_0x31cb('0x17')](0xcc)[_0x31cb('0x21')]();});}};}function handleEntityNotFound(_0x2c5389,_0x564fb4){return function(_0x3591a6){if(!_0x3591a6){_0x2c5389[_0x31cb('0x16')](0x194);}return _0x3591a6;};}function handleError(_0x349cd0,_0x2ed650){_0x2ed650=_0x2ed650||0x1f4;return function(_0x2549b3){logger['error'](_0x2549b3['stack']);if(_0x2549b3[_0x31cb('0x22')]){delete _0x2549b3[_0x31cb('0x22')];}_0x349cd0[_0x31cb('0x17')](_0x2ed650)['send'](_0x2549b3);};}exports[_0x31cb('0x23')]=function(_0x448e93,_0x59e7fd){var _0xa41ed9={},_0x11324c={},_0x32f646={'count':0x0,'rows':[]};var _0x46588a=_[_0x31cb('0x24')](db['ZohoConfiguration']['rawAttributes'],function(_0x25fde9){return{'name':_0x25fde9[_0x31cb('0x25')],'type':_0x25fde9[_0x31cb('0x26')][_0x31cb('0x27')]};});_0x11324c[_0x31cb('0x28')]=_[_0x31cb('0x24')](_0x46588a,_0x31cb('0x22'));_0x11324c[_0x31cb('0x29')]=_['keys'](_0x448e93[_0x31cb('0x29')]);_0x11324c[_0x31cb('0x2a')]=_[_0x31cb('0x2b')](_0x11324c[_0x31cb('0x28')],_0x11324c[_0x31cb('0x29')]);_0xa41ed9[_0x31cb('0x2c')]=_[_0x31cb('0x2b')](_0x11324c[_0x31cb('0x28')],qs[_0x31cb('0x2d')](_0x448e93['query'][_0x31cb('0x2d')]));_0xa41ed9['attributes']=_0xa41ed9[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0xa41ed9[_0x31cb('0x2c')]:_0x11324c[_0x31cb('0x28')];if(!_0x448e93[_0x31cb('0x29')][_0x31cb('0x2f')](_0x31cb('0x30'))){_0xa41ed9[_0x31cb('0x1a')]=qs[_0x31cb('0x1a')](_0x448e93[_0x31cb('0x29')][_0x31cb('0x1a')]);_0xa41ed9[_0x31cb('0x18')]=qs[_0x31cb('0x18')](_0x448e93[_0x31cb('0x29')][_0x31cb('0x18')]);}_0xa41ed9[_0x31cb('0x31')]=qs[_0x31cb('0x32')](_0x448e93[_0x31cb('0x29')][_0x31cb('0x32')]);_0xa41ed9[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0x448e93[_0x31cb('0x29')],_0x11324c[_0x31cb('0x2a')]),_0x46588a);if(_0x448e93[_0x31cb('0x29')][_0x31cb('0x35')]){_0xa41ed9[_0x31cb('0x33')]=_[_0x31cb('0x36')](_0xa41ed9['where'],{'$or':_[_0x31cb('0x24')](_0x46588a,function(_0x6e5173){if(_0x6e5173[_0x31cb('0x26')]!=='VIRTUAL'){var _0x513c62={};_0x513c62[_0x6e5173[_0x31cb('0x22')]]={'$like':'%'+_0x448e93[_0x31cb('0x29')][_0x31cb('0x35')]+'%'};return _0x513c62;}})});}_0xa41ed9=_[_0x31cb('0x36')]({},_0xa41ed9,_0x448e93['options']);var _0x36b548={'where':_0xa41ed9[_0x31cb('0x33')]};return db[_0x31cb('0x37')][_0x31cb('0x1b')](_0x36b548)[_0x31cb('0x20')](function(_0x4703d5){_0x32f646[_0x31cb('0x1b')]=_0x4703d5;if(_0x448e93[_0x31cb('0x29')][_0x31cb('0x38')]){_0xa41ed9[_0x31cb('0x39')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0x31cb('0x3a')](_0xa41ed9);})['then'](function(_0x2ad653){_0x32f646[_0x31cb('0x3b')]=_0x2ad653;return _0x32f646;})[_0x31cb('0x20')](respondWithFilteredResult(_0x59e7fd,_0xa41ed9))[_0x31cb('0x3c')](handleError(_0x59e7fd,null));};exports[_0x31cb('0x3d')]=function(_0x42c9ce,_0x237c8f){var _0x4cae82={'raw':![],'where':{'id':_0x42c9ce[_0x31cb('0x3e')]['id']}},_0x43b163={};_0x43b163[_0x31cb('0x28')]=_[_0x31cb('0x3f')](db[_0x31cb('0x37')][_0x31cb('0x40')]);_0x43b163[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0x42c9ce['query']);_0x43b163[_0x31cb('0x2a')]=_[_0x31cb('0x2b')](_0x43b163[_0x31cb('0x28')],_0x43b163[_0x31cb('0x29')]);_0x4cae82[_0x31cb('0x2c')]=_[_0x31cb('0x2b')](_0x43b163['model'],qs[_0x31cb('0x2d')](_0x42c9ce['query'][_0x31cb('0x2d')]));_0x4cae82[_0x31cb('0x2c')]=_0x4cae82[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0x4cae82['attributes']:_0x43b163[_0x31cb('0x28')];if(_0x42c9ce[_0x31cb('0x29')][_0x31cb('0x38')]){_0x4cae82['include']=[{'all':!![]}];}_0x4cae82=_[_0x31cb('0x36')]({},_0x4cae82,_0x42c9ce['options']);return db[_0x31cb('0x37')][_0x31cb('0x41')](_0x4cae82)[_0x31cb('0x20')](handleEntityNotFound(_0x237c8f,null))['then'](respondWithResult(_0x237c8f,null))[_0x31cb('0x3c')](handleError(_0x237c8f,null));};exports['create']=function(_0x26fef3,_0x3b47c4){return db[_0x31cb('0x37')][_0x31cb('0x42')](_0x26fef3['body'],{})[_0x31cb('0x20')](respondWithResult(_0x3b47c4,0xc9))[_0x31cb('0x3c')](handleError(_0x3b47c4,null));};exports['update']=function(_0x2290bc,_0x87e2be){if(_0x2290bc[_0x31cb('0x43')]['id']){delete _0x2290bc[_0x31cb('0x43')]['id'];}return db[_0x31cb('0x37')]['find']({'where':{'id':_0x2290bc[_0x31cb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x87e2be,null))[_0x31cb('0x20')](saveUpdates(_0x2290bc['body'],null))[_0x31cb('0x20')](respondWithResult(_0x87e2be,null))[_0x31cb('0x3c')](handleError(_0x87e2be,null));};exports[_0x31cb('0x44')]=function(_0x8db683,_0x9e6507){return db[_0x31cb('0x37')][_0x31cb('0x41')]({'where':{'id':_0x8db683[_0x31cb('0x3e')]['id']}})[_0x31cb('0x20')](handleEntityNotFound(_0x9e6507,null))[_0x31cb('0x20')](removeEntity(_0x9e6507,null))[_0x31cb('0x3c')](handleError(_0x9e6507,null));};exports['getFields']=function(_0x316471,_0x142662,_0x4bae98){var _0x112db2={};var _0x46516b={};var _0x7e7aeb;var _0x39dd15;return db['ZohoConfiguration'][_0x31cb('0x45')]({'where':{'id':_0x316471[_0x31cb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x142662,null))['then'](function(_0x506e7d){if(_0x506e7d){_0x7e7aeb=_0x506e7d;_0x46516b['model']=_[_0x31cb('0x3f')](db[_0x31cb('0x46')]['rawAttributes']);_0x46516b[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0x316471[_0x31cb('0x29')]);_0x46516b['filters']=_[_0x31cb('0x2b')](_0x46516b[_0x31cb('0x28')],_0x46516b[_0x31cb('0x29')]);_0x112db2['attributes']=_['intersection'](_0x46516b[_0x31cb('0x28')],qs[_0x31cb('0x2d')](_0x316471[_0x31cb('0x29')][_0x31cb('0x2d')]));_0x112db2[_0x31cb('0x2c')]=_0x112db2[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0x112db2[_0x31cb('0x2c')]:_0x46516b['model'];_0x112db2[_0x31cb('0x31')]=qs[_0x31cb('0x32')](_0x316471[_0x31cb('0x29')][_0x31cb('0x32')]);_0x112db2[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0x316471[_0x31cb('0x29')],_0x46516b[_0x31cb('0x2a')]));if(_0x316471[_0x31cb('0x29')][_0x31cb('0x35')]){_0x112db2[_0x31cb('0x33')]=_['merge'](_0x112db2[_0x31cb('0x33')],{'$or':_['map'](_0x112db2[_0x31cb('0x2c')],function(_0x59e65a){var _0x411926={};_0x411926[_0x59e65a]={'$like':'%'+_0x316471[_0x31cb('0x29')]['filter']+'%'};return _0x411926;})});}_0x112db2=_['merge']({},_0x112db2,_0x316471[_0x31cb('0x47')]);return _0x7e7aeb[_0x31cb('0x48')](_0x112db2);}})['then'](function(_0x41789c){if(_0x41789c){_0x39dd15=_0x41789c['length'];if(!_0x316471[_0x31cb('0x29')]['hasOwnProperty'](_0x31cb('0x30'))){_0x112db2['limit']=qs[_0x31cb('0x1a')](_0x316471[_0x31cb('0x29')]['limit']);_0x112db2['offset']=qs[_0x31cb('0x18')](_0x316471[_0x31cb('0x29')][_0x31cb('0x18')]);}return _0x7e7aeb[_0x31cb('0x48')](_0x112db2);}})[_0x31cb('0x20')](function(_0x18ba73){if(_0x18ba73){return _0x18ba73?{'count':_0x39dd15,'rows':_0x18ba73}:null;}})[_0x31cb('0x20')](respondWithResult(_0x142662,null))[_0x31cb('0x3c')](handleError(_0x142662,null));};exports[_0x31cb('0x49')]=function(_0xec7315,_0x310ffc,_0x41829c){var _0x51da05={};var _0x3e3916={};var _0x45ed94;var _0x541623;return db[_0x31cb('0x37')]['findOne']({'where':{'id':_0xec7315[_0x31cb('0x3e')]['id']}})[_0x31cb('0x20')](handleEntityNotFound(_0x310ffc,null))[_0x31cb('0x20')](function(_0x10acd4){if(_0x10acd4){_0x45ed94=_0x10acd4;_0x3e3916[_0x31cb('0x28')]=_[_0x31cb('0x3f')](db[_0x31cb('0x46')][_0x31cb('0x40')]);_0x3e3916[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0xec7315[_0x31cb('0x29')]);_0x3e3916['filters']=_[_0x31cb('0x2b')](_0x3e3916[_0x31cb('0x28')],_0x3e3916['query']);_0x51da05['attributes']=_[_0x31cb('0x2b')](_0x3e3916[_0x31cb('0x28')],qs['fields'](_0xec7315[_0x31cb('0x29')][_0x31cb('0x2d')]));_0x51da05['attributes']=_0x51da05['attributes'][_0x31cb('0x2e')]?_0x51da05[_0x31cb('0x2c')]:_0x3e3916[_0x31cb('0x28')];_0x51da05['order']=qs['sort'](_0xec7315['query'][_0x31cb('0x32')]);_0x51da05[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0xec7315[_0x31cb('0x29')],_0x3e3916[_0x31cb('0x2a')]));if(_0xec7315[_0x31cb('0x29')][_0x31cb('0x35')]){_0x51da05[_0x31cb('0x33')]=_[_0x31cb('0x36')](_0x51da05[_0x31cb('0x33')],{'$or':_[_0x31cb('0x24')](_0x51da05[_0x31cb('0x2c')],function(_0x58eca1){var _0x242288={};_0x242288[_0x58eca1]={'$like':'%'+_0xec7315[_0x31cb('0x29')][_0x31cb('0x35')]+'%'};return _0x242288;})});}_0x51da05=_[_0x31cb('0x36')]({},_0x51da05,_0xec7315[_0x31cb('0x47')]);return _0x45ed94[_0x31cb('0x49')](_0x51da05);}})[_0x31cb('0x20')](function(_0x3a2162){if(_0x3a2162){_0x541623=_0x3a2162[_0x31cb('0x2e')];if(!_0xec7315[_0x31cb('0x29')][_0x31cb('0x2f')](_0x31cb('0x30'))){_0x51da05[_0x31cb('0x1a')]=qs[_0x31cb('0x1a')](_0xec7315['query'][_0x31cb('0x1a')]);_0x51da05['offset']=qs[_0x31cb('0x18')](_0xec7315[_0x31cb('0x29')][_0x31cb('0x18')]);}return _0x45ed94['getSubjects'](_0x51da05);}})[_0x31cb('0x20')](function(_0x1a296f){if(_0x1a296f){return _0x1a296f?{'count':_0x541623,'rows':_0x1a296f}:null;}})[_0x31cb('0x20')](respondWithResult(_0x310ffc,null))[_0x31cb('0x3c')](handleError(_0x310ffc,null));};exports['getDescriptions']=function(_0x3bdcef,_0x34021e,_0x2816b7){var _0x4569df={};var _0x33bbd3={};var _0x5d699d;var _0x8b8a9d;return db[_0x31cb('0x37')][_0x31cb('0x45')]({'where':{'id':_0x3bdcef[_0x31cb('0x3e')]['id']}})[_0x31cb('0x20')](handleEntityNotFound(_0x34021e,null))[_0x31cb('0x20')](function(_0x1d1f35){if(_0x1d1f35){_0x5d699d=_0x1d1f35;_0x33bbd3[_0x31cb('0x28')]=_[_0x31cb('0x3f')](db[_0x31cb('0x46')][_0x31cb('0x40')]);_0x33bbd3[_0x31cb('0x29')]=_[_0x31cb('0x3f')](_0x3bdcef[_0x31cb('0x29')]);_0x33bbd3[_0x31cb('0x2a')]=_[_0x31cb('0x2b')](_0x33bbd3[_0x31cb('0x28')],_0x33bbd3['query']);_0x4569df[_0x31cb('0x2c')]=_['intersection'](_0x33bbd3[_0x31cb('0x28')],qs[_0x31cb('0x2d')](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x2d')]));_0x4569df[_0x31cb('0x2c')]=_0x4569df[_0x31cb('0x2c')][_0x31cb('0x2e')]?_0x4569df[_0x31cb('0x2c')]:_0x33bbd3[_0x31cb('0x28')];_0x4569df[_0x31cb('0x31')]=qs[_0x31cb('0x32')](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x32')]);_0x4569df[_0x31cb('0x33')]=qs[_0x31cb('0x2a')](_[_0x31cb('0x34')](_0x3bdcef[_0x31cb('0x29')],_0x33bbd3[_0x31cb('0x2a')]));if(_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x35')]){_0x4569df[_0x31cb('0x33')]=_[_0x31cb('0x36')](_0x4569df['where'],{'$or':_[_0x31cb('0x24')](_0x4569df['attributes'],function(_0x30c349){var _0x367ac1={};_0x367ac1[_0x30c349]={'$like':'%'+_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x35')]+'%'};return _0x367ac1;})});}_0x4569df=_[_0x31cb('0x36')]({},_0x4569df,_0x3bdcef['options']);return _0x5d699d[_0x31cb('0x4a')](_0x4569df);}})['then'](function(_0x59bf4d){if(_0x59bf4d){_0x8b8a9d=_0x59bf4d[_0x31cb('0x2e')];if(!_0x3bdcef['query']['hasOwnProperty'](_0x31cb('0x30'))){_0x4569df[_0x31cb('0x1a')]=qs['limit'](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x1a')]);_0x4569df[_0x31cb('0x18')]=qs[_0x31cb('0x18')](_0x3bdcef[_0x31cb('0x29')][_0x31cb('0x18')]);}return _0x5d699d[_0x31cb('0x4a')](_0x4569df);}})[_0x31cb('0x20')](function(_0x1fd6e4){if(_0x1fd6e4){return _0x1fd6e4?{'count':_0x8b8a9d,'rows':_0x1fd6e4}:null;}})['then'](respondWithResult(_0x34021e,null))['catch'](handleError(_0x34021e,null));};
\ No newline at end of file
index 52ec5dc..7a927e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd25c=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define'];(function(_0x464b94,_0x3e4b53){var _0x1d53b4=function(_0x1bc83b){while(--_0x1bc83b){_0x464b94['push'](_0x464b94['shift']());}};_0x1d53b4(++_0x3e4b53);}(_0xd25c,0x12d));var _0xcd25=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xd25c[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xcd25('0x0'));var util=require(_0xcd25('0x1'));var logger=require(_0xcd25('0x2'))('api');var moment=require(_0xcd25('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd25('0x4'));var fs=require('fs');var path=require(_0xcd25('0x5'));var rimraf=require(_0xcd25('0x6'));var config=require(_0xcd25('0x7'));var attributes=require(_0xcd25('0x8'));module[_0xcd25('0x9')]=function(_0x487bdc,_0x737f04){return _0x487bdc[_0xcd25('0xa')](_0xcd25('0xb'),attributes,{'tableName':_0xcd25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7780=['int_zoho_configurations','../../config/logger','moment','bluebird','path','./intZohoConfiguration.attributes','exports','define'];(function(_0x41a76c,_0x3c97a1){var _0x338ff8=function(_0x1c6c99){while(--_0x1c6c99){_0x41a76c['push'](_0x41a76c['shift']());}};_0x338ff8(++_0x3c97a1);}(_0x7780,0x139));var _0x0778=function(_0x88281e,_0x502f0b){_0x88281e=_0x88281e-0x0;var _0x4c8edf=_0x7780[_0x88281e];return _0x4c8edf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0778('0x0'))('api');var moment=require(_0x0778('0x1'));var BPromise=require(_0x0778('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0778('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0778('0x4'));module[_0x0778('0x5')]=function(_0x52ae93,_0x2bf33a){return _0x52ae93[_0x0778('0x6')]('ZohoConfiguration',attributes,{'tableName':_0x0778('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9bdfb42..29db328 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce6b=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','catch'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xce6b,0xf0));var _0xbce6=function(_0x291307,_0x594da6){_0x291307=_0x291307-0x0;var _0x4d5f6a=_0xce6b[_0x291307];return _0x4d5f6a;};'use strict';var _=require(_0xbce6('0x0'));var util=require('util');var moment=require(_0xbce6('0x1'));var BPromise=require(_0xbce6('0x2'));var rs=require(_0xbce6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbce6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbce6('0x5'))(_0xbce6('0x6'));var config=require(_0xbce6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbce6('0x8')][_0xbce6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20ce3e,_0x1f5244,_0x5729f7){return new BPromise(function(_0x134aa4,_0x2db0d2){return client[_0xbce6('0xa')](_0x20ce3e,_0x5729f7)[_0xbce6('0xb')](function(_0x4f20e8){logger[_0xbce6('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f5244,_0xbce6('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1f5244,'request\x20sent',JSON[_0xbce6('0xe')](_0x4f20e8));if(_0x4f20e8['error']){if(_0x4f20e8[_0xbce6('0xf')][_0xbce6('0x10')]===0x1f4){logger['error'](_0xbce6('0x11'),_0x1f5244,_0x4f20e8['error']['message']);return _0x2db0d2(_0x4f20e8[_0xbce6('0xf')][_0xbce6('0x12')]);}logger['error'](_0xbce6('0x11'),_0x1f5244,_0x4f20e8['error'][_0xbce6('0x12')]);return _0x134aa4(_0x4f20e8[_0xbce6('0xf')][_0xbce6('0x12')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x1f5244,_0xbce6('0xd'));_0x134aa4(_0x4f20e8['result'][_0xbce6('0x12')]);}})[_0xbce6('0x13')](function(_0x32638b){logger[_0xbce6('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x1f5244,_0x32638b);_0x2db0d2(_0x32638b);});});}
\ No newline at end of file
+var _0x29e1=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util'];(function(_0x5c2bcf,_0x50fe61){var _0x3819d0=function(_0x1d2261){while(--_0x1d2261){_0x5c2bcf['push'](_0x5c2bcf['shift']());}};_0x3819d0(++_0x50fe61);}(_0x29e1,0x12a));var _0x129e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29e1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x129e('0x0'));var util=require(_0x129e('0x1'));var moment=require('moment');var BPromise=require(_0x129e('0x2'));var rs=require(_0x129e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x129e('0x4'))(_0x129e('0x5'));var config=require(_0x129e('0x6'));var jayson=require(_0x129e('0x7'));var client=jayson['client'][_0x129e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x778e35,_0x140795,_0x5cd6bd){return new BPromise(function(_0xcff0aa,_0xf2ac83){return client[_0x129e('0x9')](_0x778e35,_0x5cd6bd)[_0x129e('0xa')](function(_0xe4efb3){logger[_0x129e('0xb')](_0x129e('0xc'),_0x140795,'request\x20sent');logger[_0x129e('0xd')](_0x129e('0xe'),_0x140795,_0x129e('0xf'),JSON['stringify'](_0xe4efb3));if(_0xe4efb3[_0x129e('0x10')]){if(_0xe4efb3[_0x129e('0x10')]['code']===0x1f4){logger[_0x129e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x140795,_0xe4efb3[_0x129e('0x10')][_0x129e('0x11')]);return _0xf2ac83(_0xe4efb3[_0x129e('0x10')]['message']);}logger[_0x129e('0x10')](_0x129e('0xc'),_0x140795,_0xe4efb3[_0x129e('0x10')][_0x129e('0x11')]);return _0xcff0aa(_0xe4efb3[_0x129e('0x10')][_0x129e('0x11')]);}else{logger[_0x129e('0xb')](_0x129e('0xc'),_0x140795,'request\x20sent');_0xcff0aa(_0xe4efb3[_0x129e('0x12')][_0x129e('0x11')]);}})[_0x129e('0x13')](function(_0x1d5adf){logger[_0x129e('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x140795,_0x1d5adf);_0xf2ac83(_0x1d5adf);});});}
\ No newline at end of file
index 26094b5..52a9426 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8933=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoField.controller','get','index','/:id','isAuthenticated','show','post'];(function(_0x2494dc,_0x515019){var _0x5518c5=function(_0x58ccfb){while(--_0x58ccfb){_0x2494dc['push'](_0x2494dc['shift']());}};_0x5518c5(++_0x515019);}(_0x8933,0x124));var _0x3893=function(_0x3cb422,_0x44afda){_0x3cb422=_0x3cb422-0x0;var _0x42c12e=_0x8933[_0x3cb422];return _0x42c12e;};'use strict';var multer=require(_0x3893('0x0'));var util=require(_0x3893('0x1'));var path=require('path');var timeout=require(_0x3893('0x2'));var express=require(_0x3893('0x3'));var router=express[_0x3893('0x4')]();var fs_extra=require(_0x3893('0x5'));var auth=require(_0x3893('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3893('0x7'));router[_0x3893('0x8')]('/',auth['isAuthenticated'](),controller[_0x3893('0x9')]);router[_0x3893('0x8')](_0x3893('0xa'),auth[_0x3893('0xb')](),controller[_0x3893('0xc')]);router[_0x3893('0xd')]('/',auth[_0x3893('0xb')](),controller['create']);router['put'](_0x3893('0xa'),auth[_0x3893('0xb')](),controller[_0x3893('0xe')]);router[_0x3893('0xf')](_0x3893('0xa'),auth[_0x3893('0xb')](),controller[_0x3893('0x10')]);module[_0x3893('0x11')]=router;
\ No newline at end of file
+var _0xec93=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xec93,0x138));var _0x3ec9=function(_0x4c2406,_0x1de04d){_0x4c2406=_0x4c2406-0x0;var _0x344f78=_0xec93[_0x4c2406];return _0x344f78;};'use strict';var multer=require(_0x3ec9('0x0'));var util=require(_0x3ec9('0x1'));var path=require('path');var timeout=require(_0x3ec9('0x2'));var express=require(_0x3ec9('0x3'));var router=express[_0x3ec9('0x4')]();var fs_extra=require(_0x3ec9('0x5'));var auth=require(_0x3ec9('0x6'));var interaction=require(_0x3ec9('0x7'));var config=require(_0x3ec9('0x8'));var controller=require('./intZohoField.controller');router[_0x3ec9('0x9')]('/',auth[_0x3ec9('0xa')](),controller[_0x3ec9('0xb')]);router[_0x3ec9('0x9')](_0x3ec9('0xc'),auth[_0x3ec9('0xa')](),controller[_0x3ec9('0xd')]);router[_0x3ec9('0xe')]('/',auth[_0x3ec9('0xa')](),controller[_0x3ec9('0xf')]);router[_0x3ec9('0x10')]('/:id',auth[_0x3ec9('0xa')](),controller[_0x3ec9('0x11')]);router[_0x3ec9('0x12')](_0x3ec9('0xc'),auth[_0x3ec9('0xa')](),controller[_0x3ec9('0x13')]);module[_0x3ec9('0x14')]=router;
\ No newline at end of file
index 3baa9cd..2b560bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ee2=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x47a34e,_0x314cca){var _0x3fb5b0=function(_0xe44837){while(--_0xe44837){_0x47a34e['push'](_0x47a34e['shift']());}};_0x3fb5b0(++_0x314cca);}(_0x5ee2,0x89));var _0x25ee=function(_0x109b18,_0x365978){_0x109b18=_0x109b18-0x0;var _0x33e9f3=_0x5ee2[_0x109b18];return _0x33e9f3;};'use strict';var Sequelize=require(_0x25ee('0x0'));module[_0x25ee('0x1')]={'type':{'type':Sequelize[_0x25ee('0x2')](_0x25ee('0x3'),_0x25ee('0x4'),_0x25ee('0x5'),_0x25ee('0x6'),_0x25ee('0x7')),'defaultValue':_0x25ee('0x3')},'content':{'type':Sequelize[_0x25ee('0x8')]},'key':{'type':Sequelize[_0x25ee('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x25ee('0x4'),_0x25ee('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x25ee('0x8')]},'customField':{'type':Sequelize[_0x25ee('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x25ee('0x8')]}};
\ No newline at end of file
+var _0x3014=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x87f63d,_0x2f42ff){var _0xd17f15=function(_0xd834b2){while(--_0xd834b2){_0x87f63d['push'](_0x87f63d['shift']());}};_0xd17f15(++_0x2f42ff);}(_0x3014,0x1b5));var _0x4301=function(_0x54bd74,_0x34bce1){_0x54bd74=_0x54bd74-0x0;var _0x3e22a9=_0x3014[_0x54bd74];return _0x3e22a9;};'use strict';var Sequelize=require(_0x4301('0x0'));module[_0x4301('0x1')]={'type':{'type':Sequelize[_0x4301('0x2')](_0x4301('0x3'),'variable',_0x4301('0x4'),_0x4301('0x5'),_0x4301('0x6')),'defaultValue':_0x4301('0x3')},'content':{'type':Sequelize[_0x4301('0x7')]},'key':{'type':Sequelize[_0x4301('0x7')]},'keyType':{'type':Sequelize[_0x4301('0x2')]('string',_0x4301('0x8'),_0x4301('0x4'))},'keyContent':{'type':Sequelize[_0x4301('0x7')]},'idField':{'type':Sequelize[_0x4301('0x7')]},'nameField':{'type':Sequelize[_0x4301('0x7')]},'customField':{'type':Sequelize[_0x4301('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4301('0x7')]}};
\ No newline at end of file
index 6f7dd61..d6068eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a71=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','map','ZohoField','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','nolimit','order','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x277180,_0x3a33c3){var _0x45cd8f=function(_0x1adc59){while(--_0x1adc59){_0x277180['push'](_0x277180['shift']());}};_0x45cd8f(++_0x3a33c3);}(_0x0a71,0x122));var _0x10a7=function(_0xeb2ea,_0x429b45){_0xeb2ea=_0xeb2ea-0x0;var _0x347a31=_0x0a71[_0xeb2ea];return _0x347a31;};'use strict';var emlformat=require(_0x10a7('0x0'));var rimraf=require(_0x10a7('0x1'));var zipdir=require(_0x10a7('0x2'));var jsonpatch=require(_0x10a7('0x3'));var rp=require(_0x10a7('0x4'));var moment=require('moment');var BPromise=require(_0x10a7('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x10a7('0x6'));var csv=require(_0x10a7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x10a7('0x8'));var _=require(_0x10a7('0x9'));var squel=require(_0x10a7('0xa'));var crypto=require(_0x10a7('0xb'));var jsforce=require(_0x10a7('0xc'));var deskjs=require(_0x10a7('0xd'));var toCsv=require(_0x10a7('0x7'));var querystring=require(_0x10a7('0xe'));var Papa=require(_0x10a7('0xf'));var Redis=require(_0x10a7('0x10'));var authService=require(_0x10a7('0x11'));var qs=require(_0x10a7('0x12'));var as=require(_0x10a7('0x13'));var hardwareService=require(_0x10a7('0x14'));var logger=require(_0x10a7('0x15'))(_0x10a7('0x16'));var utils=require(_0x10a7('0x17'));var config=require(_0x10a7('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x10a7('0x19'))['db'];function respondWithStatusCode(_0x1979a1,_0x19d2b2){_0x19d2b2=_0x19d2b2||0xcc;return function(_0x245063){if(_0x245063){return _0x1979a1[_0x10a7('0x1a')](_0x19d2b2);}return _0x1979a1[_0x10a7('0x1b')](_0x19d2b2)[_0x10a7('0x1c')]();};}function respondWithResult(_0x59248e,_0x3ac4c0){_0x3ac4c0=_0x3ac4c0||0xc8;return function(_0x362ccb){if(_0x362ccb){return _0x59248e[_0x10a7('0x1b')](_0x3ac4c0)['json'](_0x362ccb);}};}function respondWithFilteredResult(_0x33fa73,_0x3962b3){return function(_0x3ad443){if(_0x3ad443){var _0x2a799a=typeof _0x3962b3[_0x10a7('0x1d')]==='undefined'&&typeof _0x3962b3[_0x10a7('0x1e')]===_0x10a7('0x1f');var _0x1d5da0=_0x3ad443[_0x10a7('0x20')];var _0x25f0ce=_0x2a799a?0x0:_0x3962b3['offset'];var _0x3ee726=_0x2a799a?_0x3ad443[_0x10a7('0x20')]:_0x3962b3[_0x10a7('0x1d')]+_0x3962b3[_0x10a7('0x1e')];var _0x251e27;if(_0x3ee726>=_0x1d5da0){_0x3ee726=_0x1d5da0;_0x251e27=0xc8;}else{_0x251e27=0xce;}_0x33fa73['status'](_0x251e27);return _0x33fa73['set'](_0x10a7('0x21'),_0x25f0ce+'-'+_0x3ee726+'/'+_0x1d5da0)[_0x10a7('0x22')](_0x3ad443);}return null;};}function patchUpdates(_0x2e269f){return function(_0x35c050){try{jsonpatch['apply'](_0x35c050,_0x2e269f,!![]);}catch(_0x1e9cd3){return BPromise[_0x10a7('0x23')](_0x1e9cd3);}return _0x35c050[_0x10a7('0x24')]();};}function saveUpdates(_0x3dac5d,_0xb118b7){return function(_0x204a27){if(_0x204a27){return _0x204a27[_0x10a7('0x25')](_0x3dac5d)['then'](function(_0x2b6c60){return _0x2b6c60;});}return null;};}function removeEntity(_0x1fc851,_0x37a9f4){return function(_0xac8099){if(_0xac8099){return _0xac8099[_0x10a7('0x26')]()[_0x10a7('0x27')](function(){_0x1fc851['status'](0xcc)[_0x10a7('0x1c')]();});}};}function handleEntityNotFound(_0x274f6f,_0x81bbcf){return function(_0x537a5d){if(!_0x537a5d){_0x274f6f['sendStatus'](0x194);}return _0x537a5d;};}function handleError(_0x15b454,_0x5d6c1d){_0x5d6c1d=_0x5d6c1d||0x1f4;return function(_0x4f33dc){logger[_0x10a7('0x28')](_0x4f33dc[_0x10a7('0x29')]);if(_0x4f33dc[_0x10a7('0x2a')]){delete _0x4f33dc['name'];}_0x15b454['status'](_0x5d6c1d)[_0x10a7('0x2b')](_0x4f33dc);};}exports['index']=function(_0x30176e,_0x4bce06){var _0x578d80={},_0x4efeb7={},_0x67200c={'count':0x0,'rows':[]};var _0x4b372b=_[_0x10a7('0x2c')](db[_0x10a7('0x2d')][_0x10a7('0x2e')],function(_0x9fc2e1){return{'name':_0x9fc2e1[_0x10a7('0x2f')],'type':_0x9fc2e1[_0x10a7('0x30')]['key']};});_0x4efeb7[_0x10a7('0x31')]=_[_0x10a7('0x2c')](_0x4b372b,_0x10a7('0x2a'));_0x4efeb7[_0x10a7('0x32')]=_['keys'](_0x30176e['query']);_0x4efeb7[_0x10a7('0x33')]=_[_0x10a7('0x34')](_0x4efeb7[_0x10a7('0x31')],_0x4efeb7['query']);_0x578d80['attributes']=_['intersection'](_0x4efeb7['model'],qs[_0x10a7('0x35')](_0x30176e['query']['fields']));_0x578d80[_0x10a7('0x36')]=_0x578d80[_0x10a7('0x36')][_0x10a7('0x37')]?_0x578d80[_0x10a7('0x36')]:_0x4efeb7[_0x10a7('0x31')];if(!_0x30176e['query']['hasOwnProperty'](_0x10a7('0x38'))){_0x578d80['limit']=qs[_0x10a7('0x1e')](_0x30176e[_0x10a7('0x32')][_0x10a7('0x1e')]);_0x578d80[_0x10a7('0x1d')]=qs[_0x10a7('0x1d')](_0x30176e[_0x10a7('0x32')][_0x10a7('0x1d')]);}_0x578d80[_0x10a7('0x39')]=qs['sort'](_0x30176e['query']['sort']);_0x578d80[_0x10a7('0x3a')]=qs[_0x10a7('0x33')](_[_0x10a7('0x3b')](_0x30176e[_0x10a7('0x32')],_0x4efeb7[_0x10a7('0x33')]),_0x4b372b);if(_0x30176e['query']['filter']){_0x578d80[_0x10a7('0x3a')]=_[_0x10a7('0x3c')](_0x578d80['where'],{'$or':_[_0x10a7('0x2c')](_0x4b372b,function(_0x39b712){if(_0x39b712[_0x10a7('0x30')]!=='VIRTUAL'){var _0x5105e1={};_0x5105e1[_0x39b712[_0x10a7('0x2a')]]={'$like':'%'+_0x30176e['query'][_0x10a7('0x3d')]+'%'};return _0x5105e1;}})});}_0x578d80=_[_0x10a7('0x3c')]({},_0x578d80,_0x30176e[_0x10a7('0x3e')]);var _0x18f6bc={'where':_0x578d80[_0x10a7('0x3a')]};return db[_0x10a7('0x2d')][_0x10a7('0x20')](_0x18f6bc)[_0x10a7('0x27')](function(_0x3c2e56){_0x67200c[_0x10a7('0x20')]=_0x3c2e56;if(_0x30176e[_0x10a7('0x32')][_0x10a7('0x3f')]){_0x578d80[_0x10a7('0x40')]=[{'all':!![]}];}return db['ZohoField'][_0x10a7('0x41')](_0x578d80);})[_0x10a7('0x27')](function(_0x2e6f54){_0x67200c[_0x10a7('0x42')]=_0x2e6f54;return _0x67200c;})[_0x10a7('0x27')](respondWithFilteredResult(_0x4bce06,_0x578d80))[_0x10a7('0x43')](handleError(_0x4bce06,null));};exports[_0x10a7('0x44')]=function(_0x41bc17,_0x109ebb){var _0x45d548={'raw':!![],'where':{'id':_0x41bc17[_0x10a7('0x45')]['id']}},_0x41c24d={};_0x41c24d[_0x10a7('0x31')]=_[_0x10a7('0x46')](db[_0x10a7('0x2d')][_0x10a7('0x2e')]);_0x41c24d['query']=_[_0x10a7('0x46')](_0x41bc17[_0x10a7('0x32')]);_0x41c24d[_0x10a7('0x33')]=_['intersection'](_0x41c24d[_0x10a7('0x31')],_0x41c24d['query']);_0x45d548['attributes']=_[_0x10a7('0x34')](_0x41c24d[_0x10a7('0x31')],qs['fields'](_0x41bc17[_0x10a7('0x32')]['fields']));_0x45d548[_0x10a7('0x36')]=_0x45d548[_0x10a7('0x36')][_0x10a7('0x37')]?_0x45d548['attributes']:_0x41c24d[_0x10a7('0x31')];if(_0x41bc17['query']['includeAll']){_0x45d548[_0x10a7('0x40')]=[{'all':!![]}];}_0x45d548=_[_0x10a7('0x3c')]({},_0x45d548,_0x41bc17[_0x10a7('0x3e')]);return db[_0x10a7('0x2d')][_0x10a7('0x47')](_0x45d548)[_0x10a7('0x27')](handleEntityNotFound(_0x109ebb,null))[_0x10a7('0x27')](respondWithResult(_0x109ebb,null))['catch'](handleError(_0x109ebb,null));};exports[_0x10a7('0x48')]=function(_0x14cc57,_0x111107){return db[_0x10a7('0x2d')]['create'](_0x14cc57[_0x10a7('0x49')],{})[_0x10a7('0x27')](respondWithResult(_0x111107,0xc9))[_0x10a7('0x43')](handleError(_0x111107,null));};exports[_0x10a7('0x25')]=function(_0x52a455,_0x347cc9){if(_0x52a455[_0x10a7('0x49')]['id']){delete _0x52a455[_0x10a7('0x49')]['id'];}return db[_0x10a7('0x2d')][_0x10a7('0x47')]({'where':{'id':_0x52a455[_0x10a7('0x45')]['id']}})['then'](handleEntityNotFound(_0x347cc9,null))['then'](saveUpdates(_0x52a455['body'],null))[_0x10a7('0x27')](respondWithResult(_0x347cc9,null))[_0x10a7('0x43')](handleError(_0x347cc9,null));};exports['destroy']=function(_0x28f9fb,_0x56b872){return db[_0x10a7('0x2d')][_0x10a7('0x47')]({'where':{'id':_0x28f9fb[_0x10a7('0x45')]['id']}})[_0x10a7('0x27')](handleEntityNotFound(_0x56b872,null))[_0x10a7('0x27')](removeEntity(_0x56b872,null))['catch'](handleError(_0x56b872,null));};
\ No newline at end of file
+var _0xb991=['ZohoField','fieldName','key','model','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x591413,_0x1a2950){var _0x5155ea=function(_0x31f5de){while(--_0x31f5de){_0x591413['push'](_0x591413['shift']());}};_0x5155ea(++_0x1a2950);}(_0xb991,0x69));var _0x1b99=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xb991[_0x4914e2];return _0x2dcd07;};'use strict';var emlformat=require(_0x1b99('0x0'));var rimraf=require(_0x1b99('0x1'));var zipdir=require(_0x1b99('0x2'));var jsonpatch=require(_0x1b99('0x3'));var rp=require(_0x1b99('0x4'));var moment=require(_0x1b99('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1b99('0x6'));var util=require(_0x1b99('0x7'));var path=require(_0x1b99('0x8'));var sox=require(_0x1b99('0x9'));var csv=require(_0x1b99('0xa'));var ejs=require(_0x1b99('0xb'));var fs=require('fs');var fs_extra=require(_0x1b99('0xc'));var _=require(_0x1b99('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b99('0xe'));var deskjs=require(_0x1b99('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1b99('0x10'));var Redis=require(_0x1b99('0x11'));var authService=require(_0x1b99('0x12'));var qs=require(_0x1b99('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b99('0x14'));var logger=require(_0x1b99('0x15'))(_0x1b99('0x16'));var utils=require(_0x1b99('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1b99('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x117a73,_0x269d98){_0x269d98=_0x269d98||0xcc;return function(_0x16b793){if(_0x16b793){return _0x117a73[_0x1b99('0x19')](_0x269d98);}return _0x117a73[_0x1b99('0x1a')](_0x269d98)[_0x1b99('0x1b')]();};}function respondWithResult(_0x1919cb,_0x574b69){_0x574b69=_0x574b69||0xc8;return function(_0x3079d9){if(_0x3079d9){return _0x1919cb['status'](_0x574b69)[_0x1b99('0x1c')](_0x3079d9);}};}function respondWithFilteredResult(_0x1f2945,_0x41b7e2){return function(_0x4a3a65){if(_0x4a3a65){var _0x15cbcc=typeof _0x41b7e2['offset']===_0x1b99('0x1d')&&typeof _0x41b7e2[_0x1b99('0x1e')]===_0x1b99('0x1d');var _0x1af21c=_0x4a3a65[_0x1b99('0x1f')];var _0x4e219e=_0x15cbcc?0x0:_0x41b7e2[_0x1b99('0x20')];var _0x480e94=_0x15cbcc?_0x4a3a65[_0x1b99('0x1f')]:_0x41b7e2[_0x1b99('0x20')]+_0x41b7e2[_0x1b99('0x1e')];var _0xe00fd0;if(_0x480e94>=_0x1af21c){_0x480e94=_0x1af21c;_0xe00fd0=0xc8;}else{_0xe00fd0=0xce;}_0x1f2945[_0x1b99('0x1a')](_0xe00fd0);return _0x1f2945[_0x1b99('0x21')](_0x1b99('0x22'),_0x4e219e+'-'+_0x480e94+'/'+_0x1af21c)[_0x1b99('0x1c')](_0x4a3a65);}return null;};}function patchUpdates(_0x392a9a){return function(_0x2641e6){try{jsonpatch['apply'](_0x2641e6,_0x392a9a,!![]);}catch(_0x5974a8){return BPromise[_0x1b99('0x23')](_0x5974a8);}return _0x2641e6[_0x1b99('0x24')]();};}function saveUpdates(_0x20d838,_0x558d7b){return function(_0x496d2d){if(_0x496d2d){return _0x496d2d[_0x1b99('0x25')](_0x20d838)[_0x1b99('0x26')](function(_0x1b8cf7){return _0x1b8cf7;});}return null;};}function removeEntity(_0x460d6c,_0x10406b){return function(_0x419937){if(_0x419937){return _0x419937[_0x1b99('0x27')]()[_0x1b99('0x26')](function(){_0x460d6c['status'](0xcc)[_0x1b99('0x1b')]();});}};}function handleEntityNotFound(_0x77db4a,_0x5a74c2){return function(_0x347251){if(!_0x347251){_0x77db4a[_0x1b99('0x19')](0x194);}return _0x347251;};}function handleError(_0x2cddb0,_0x51a923){_0x51a923=_0x51a923||0x1f4;return function(_0x176389){logger[_0x1b99('0x28')](_0x176389['stack']);if(_0x176389[_0x1b99('0x29')]){delete _0x176389['name'];}_0x2cddb0[_0x1b99('0x1a')](_0x51a923)[_0x1b99('0x2a')](_0x176389);};}exports[_0x1b99('0x2b')]=function(_0x394916,_0x5052cc){var _0x440778={},_0x19373b={},_0x2afc5b={'count':0x0,'rows':[]};var _0x3262f7=_[_0x1b99('0x2c')](db[_0x1b99('0x2d')]['rawAttributes'],function(_0x13988a){return{'name':_0x13988a[_0x1b99('0x2e')],'type':_0x13988a['type'][_0x1b99('0x2f')]};});_0x19373b[_0x1b99('0x30')]=_[_0x1b99('0x2c')](_0x3262f7,_0x1b99('0x29'));_0x19373b[_0x1b99('0x31')]=_['keys'](_0x394916[_0x1b99('0x31')]);_0x19373b['filters']=_['intersection'](_0x19373b[_0x1b99('0x30')],_0x19373b['query']);_0x440778['attributes']=_[_0x1b99('0x32')](_0x19373b['model'],qs['fields'](_0x394916['query']['fields']));_0x440778['attributes']=_0x440778[_0x1b99('0x33')]['length']?_0x440778[_0x1b99('0x33')]:_0x19373b[_0x1b99('0x30')];if(!_0x394916['query'][_0x1b99('0x34')](_0x1b99('0x35'))){_0x440778[_0x1b99('0x1e')]=qs[_0x1b99('0x1e')](_0x394916['query'][_0x1b99('0x1e')]);_0x440778[_0x1b99('0x20')]=qs[_0x1b99('0x20')](_0x394916[_0x1b99('0x31')][_0x1b99('0x20')]);}_0x440778['order']=qs[_0x1b99('0x36')](_0x394916[_0x1b99('0x31')][_0x1b99('0x36')]);_0x440778[_0x1b99('0x37')]=qs[_0x1b99('0x38')](_['pick'](_0x394916[_0x1b99('0x31')],_0x19373b[_0x1b99('0x38')]),_0x3262f7);if(_0x394916[_0x1b99('0x31')][_0x1b99('0x39')]){_0x440778[_0x1b99('0x37')]=_[_0x1b99('0x3a')](_0x440778[_0x1b99('0x37')],{'$or':_['map'](_0x3262f7,function(_0x701498){if(_0x701498[_0x1b99('0x3b')]!==_0x1b99('0x3c')){var _0x3367c1={};_0x3367c1[_0x701498['name']]={'$like':'%'+_0x394916['query'][_0x1b99('0x39')]+'%'};return _0x3367c1;}})});}_0x440778=_[_0x1b99('0x3a')]({},_0x440778,_0x394916[_0x1b99('0x3d')]);var _0x5236e3={'where':_0x440778[_0x1b99('0x37')]};return db['ZohoField']['count'](_0x5236e3)[_0x1b99('0x26')](function(_0x41b1b6){_0x2afc5b['count']=_0x41b1b6;if(_0x394916[_0x1b99('0x31')][_0x1b99('0x3e')]){_0x440778[_0x1b99('0x3f')]=[{'all':!![]}];}return db[_0x1b99('0x2d')][_0x1b99('0x40')](_0x440778);})['then'](function(_0x555960){_0x2afc5b[_0x1b99('0x41')]=_0x555960;return _0x2afc5b;})[_0x1b99('0x26')](respondWithFilteredResult(_0x5052cc,_0x440778))[_0x1b99('0x42')](handleError(_0x5052cc,null));};exports[_0x1b99('0x43')]=function(_0x27c48b,_0x1240ae){var _0x23dcee={'raw':!![],'where':{'id':_0x27c48b[_0x1b99('0x44')]['id']}},_0x12db83={};_0x12db83[_0x1b99('0x30')]=_[_0x1b99('0x45')](db[_0x1b99('0x2d')]['rawAttributes']);_0x12db83[_0x1b99('0x31')]=_['keys'](_0x27c48b[_0x1b99('0x31')]);_0x12db83[_0x1b99('0x38')]=_[_0x1b99('0x32')](_0x12db83[_0x1b99('0x30')],_0x12db83[_0x1b99('0x31')]);_0x23dcee[_0x1b99('0x33')]=_[_0x1b99('0x32')](_0x12db83[_0x1b99('0x30')],qs[_0x1b99('0x46')](_0x27c48b[_0x1b99('0x31')][_0x1b99('0x46')]));_0x23dcee[_0x1b99('0x33')]=_0x23dcee['attributes'][_0x1b99('0x47')]?_0x23dcee[_0x1b99('0x33')]:_0x12db83[_0x1b99('0x30')];if(_0x27c48b[_0x1b99('0x31')][_0x1b99('0x3e')]){_0x23dcee[_0x1b99('0x3f')]=[{'all':!![]}];}_0x23dcee=_[_0x1b99('0x3a')]({},_0x23dcee,_0x27c48b[_0x1b99('0x3d')]);return db[_0x1b99('0x2d')][_0x1b99('0x48')](_0x23dcee)[_0x1b99('0x26')](handleEntityNotFound(_0x1240ae,null))[_0x1b99('0x26')](respondWithResult(_0x1240ae,null))[_0x1b99('0x42')](handleError(_0x1240ae,null));};exports['create']=function(_0x4ac2a0,_0x31cf34){return db['ZohoField'][_0x1b99('0x49')](_0x4ac2a0[_0x1b99('0x4a')],{})['then'](respondWithResult(_0x31cf34,0xc9))['catch'](handleError(_0x31cf34,null));};exports['update']=function(_0x1992e5,_0x5f2e8a){if(_0x1992e5[_0x1b99('0x4a')]['id']){delete _0x1992e5[_0x1b99('0x4a')]['id'];}return db['ZohoField'][_0x1b99('0x48')]({'where':{'id':_0x1992e5[_0x1b99('0x44')]['id']}})[_0x1b99('0x26')](handleEntityNotFound(_0x5f2e8a,null))[_0x1b99('0x26')](saveUpdates(_0x1992e5['body'],null))[_0x1b99('0x26')](respondWithResult(_0x5f2e8a,null))['catch'](handleError(_0x5f2e8a,null));};exports[_0x1b99('0x27')]=function(_0x5e0d8d,_0x751245){return db[_0x1b99('0x2d')][_0x1b99('0x48')]({'where':{'id':_0x5e0d8d['params']['id']}})[_0x1b99('0x26')](handleEntityNotFound(_0x751245,null))['then'](removeEntity(_0x751245,null))[_0x1b99('0x42')](handleError(_0x751245,null));};
\ No newline at end of file
index ba37697..3ce70e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['exports','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x44c381,_0x1189ce){var _0x209d80=function(_0x6239e4){while(--_0x6239e4){_0x44c381['push'](_0x44c381['shift']());}};_0x209d80(++_0x1189ce);}(_0x8952,0x17e));var _0x2895=function(_0x3d2e6a,_0x2fbbed){_0x3d2e6a=_0x3d2e6a-0x0;var _0x51df7b=_0x8952[_0x3d2e6a];return _0x51df7b;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var logger=require(_0x2895('0x1'))(_0x2895('0x2'));var moment=require(_0x2895('0x3'));var BPromise=require(_0x2895('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2895('0x5'));var rimraf=require(_0x2895('0x6'));var config=require(_0x2895('0x7'));var attributes=require('./intZohoField.attributes');module[_0x2895('0x8')]=function(_0x73c245,_0x37305b){return _0x73c245['define']('ZohoField',attributes,{'tableName':_0x2895('0x9'),'paranoid':![],'indexes':[{'name':_0x2895('0xa'),'fields':[_0x2895('0xb'),_0x2895('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8aad=['request-promise','../../config/environment','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','bluebird'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x8aad,0x146));var _0xd8aa=function(_0x12a2d2,_0x2f7630){_0x12a2d2=_0x12a2d2-0x0;var _0x3df1f6=_0x8aad[_0x12a2d2];return _0x3df1f6;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var logger=require('../../config/logger')(_0xd8aa('0x2'));var moment=require('moment');var BPromise=require(_0xd8aa('0x3'));var rp=require(_0xd8aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8aa('0x5'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x16b648,_0x43ddeb){return _0x16b648[_0xd8aa('0x6')]('ZohoField',attributes,{'tableName':_0xd8aa('0x7'),'paranoid':![],'indexes':[{'name':_0xd8aa('0x8'),'fields':[_0xd8aa('0x9'),_0xd8aa('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 57dd82e..5051610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcbc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5723fe,_0xb98831){var _0x41a589=function(_0x1ad7be){while(--_0x1ad7be){_0x5723fe['push'](_0x5723fe['shift']());}};_0x41a589(++_0xb98831);}(_0xdcbc,0x97));var _0xcdcb=function(_0x2c1851,_0x22b210){_0x2c1851=_0x2c1851-0x0;var _0x570e5a=_0xdcbc[_0x2c1851];return _0x570e5a;};'use strict';var _=require(_0xcdcb('0x0'));var util=require(_0xcdcb('0x1'));var moment=require(_0xcdcb('0x2'));var BPromise=require(_0xcdcb('0x3'));var rs=require(_0xcdcb('0x4'));var fs=require('fs');var Redis=require(_0xcdcb('0x5'));var db=require(_0xcdcb('0x6'))['db'];var utils=require(_0xcdcb('0x7'));var logger=require(_0xcdcb('0x8'))(_0xcdcb('0x9'));var config=require(_0xcdcb('0xa'));var jayson=require(_0xcdcb('0xb'));var client=jayson[_0xcdcb('0xc')][_0xcdcb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2fea2,_0x96970f,_0x126113){return new BPromise(function(_0x41384c,_0x2e4aaf){return client[_0xcdcb('0xe')](_0x2fea2,_0x126113)['then'](function(_0x365c0a){logger['info'](_0xcdcb('0xf'),_0x96970f,'request\x20sent');logger[_0xcdcb('0x10')](_0xcdcb('0x11'),_0x96970f,_0xcdcb('0x12'),JSON[_0xcdcb('0x13')](_0x365c0a));if(_0x365c0a[_0xcdcb('0x14')]){if(_0x365c0a['error'][_0xcdcb('0x15')]===0x1f4){logger[_0xcdcb('0x14')]('ZohoField,\x20%s,\x20%s',_0x96970f,_0x365c0a['error'][_0xcdcb('0x16')]);return _0x2e4aaf(_0x365c0a['error'][_0xcdcb('0x16')]);}logger[_0xcdcb('0x14')](_0xcdcb('0xf'),_0x96970f,_0x365c0a[_0xcdcb('0x14')][_0xcdcb('0x16')]);return _0x41384c(_0x365c0a[_0xcdcb('0x14')][_0xcdcb('0x16')]);}else{logger[_0xcdcb('0x17')](_0xcdcb('0xf'),_0x96970f,_0xcdcb('0x12'));_0x41384c(_0x365c0a[_0xcdcb('0x18')]['message']);}})[_0xcdcb('0x19')](function(_0xc59ffb){logger[_0xcdcb('0x14')](_0xcdcb('0xf'),_0x96970f,_0xc59ffb);_0x2e4aaf(_0xc59ffb);});});}
\ No newline at end of file
+var _0x01c6=['debug','stringify','error','ZohoField,\x20%s,\x20%s','message','info','catch','lodash','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent'];(function(_0x590ebe,_0x1b2a98){var _0x3ffe78=function(_0x222409){while(--_0x222409){_0x590ebe['push'](_0x590ebe['shift']());}};_0x3ffe78(++_0x1b2a98);}(_0x01c6,0x17d));var _0x601c=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0x01c6[_0x334599];return _0x4cdff2;};'use strict';var _=require(_0x601c('0x0'));var util=require('util');var moment=require(_0x601c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x601c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x601c('0x3'))(_0x601c('0x4'));var config=require('../../config/environment');var jayson=require(_0x601c('0x5'));var client=jayson[_0x601c('0x6')][_0x601c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16aa20,_0x34d8a3,_0x2d958c){return new BPromise(function(_0x1334fc,_0x280f32){return client[_0x601c('0x8')](_0x16aa20,_0x2d958c)['then'](function(_0x20f3f8){logger['info']('ZohoField,\x20%s,\x20%s',_0x34d8a3,_0x601c('0x9'));logger[_0x601c('0xa')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x34d8a3,'request\x20sent',JSON[_0x601c('0xb')](_0x20f3f8));if(_0x20f3f8['error']){if(_0x20f3f8[_0x601c('0xc')]['code']===0x1f4){logger['error'](_0x601c('0xd'),_0x34d8a3,_0x20f3f8[_0x601c('0xc')][_0x601c('0xe')]);return _0x280f32(_0x20f3f8[_0x601c('0xc')][_0x601c('0xe')]);}logger[_0x601c('0xc')](_0x601c('0xd'),_0x34d8a3,_0x20f3f8['error'][_0x601c('0xe')]);return _0x1334fc(_0x20f3f8['error'][_0x601c('0xe')]);}else{logger[_0x601c('0xf')](_0x601c('0xd'),_0x34d8a3,_0x601c('0x9'));_0x1334fc(_0x20f3f8['result'][_0x601c('0xe')]);}})[_0x601c('0x10')](function(_0x444e55){logger[_0x601c('0xc')](_0x601c('0xd'),_0x34d8a3,_0x444e55);_0x280f32(_0x444e55);});});}
\ No newline at end of file
index 529a24b..39e92d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x311825,_0x40d25f){var _0x178115=function(_0x42b995){while(--_0x42b995){_0x311825['push'](_0x311825['shift']());}};_0x178115(++_0x40d25f);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5d0c25,_0x5b6e7c){var _0x12328e=function(_0x483940){while(--_0x483940){_0x5d0c25['push'](_0x5d0c25['shift']());}};_0x12328e(++_0x5b6e7c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x16b1a5,_0x318267){_0x16b1a5=_0x16b1a5-0x0;var _0x475e25=_0xcb91[_0x16b1a5];return _0x475e25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index d11cbf5..cb93257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c94=['unique_name_and_version','INTEGER','state','sequelize','STRING'];(function(_0x5334e2,_0x411d9a){var _0x277c98=function(_0x507ee2){while(--_0x507ee2){_0x5334e2['push'](_0x5334e2['shift']());}};_0x277c98(++_0x411d9a);}(_0x2c94,0xa3));var _0x42c9=function(_0x533fdb,_0x340586){_0x533fdb=_0x533fdb-0x0;var _0x393de1=_0x2c94[_0x533fdb];return _0x393de1;};'use strict';var Sequelize=require(_0x42c9('0x0'));module['exports']={'name':{'type':Sequelize[_0x42c9('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x42c9('0x1')],'allowNull':![],'unique':_0x42c9('0x2')},'main':{'type':Sequelize[_0x42c9('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x42c9('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x42c9('0x1')]},'size':{'type':Sequelize[_0x42c9('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x42c9('0x1')]},'logo':{'type':Sequelize[_0x42c9('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x42c9('0x4')},'description':{'type':Sequelize[_0x42c9('0x1')]},'title':{'type':Sequelize[_0x42c9('0x1')]},'remoteUri':{'type':Sequelize[_0x42c9('0x1')]},'link':{'type':Sequelize[_0x42c9('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0xe1d2=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','sequelize','exports','STRING'];(function(_0x17a689,_0x2e9a6f){var _0x5cadd9=function(_0x2b58c2){while(--_0x2b58c2){_0x17a689['push'](_0x17a689['shift']());}};_0x5cadd9(++_0x2e9a6f);}(_0xe1d2,0x19d));var _0x2e1d=function(_0x392817,_0x40b23c){_0x392817=_0x392817-0x0;var _0x3e6fe8=_0xe1d2[_0x392817];return _0x3e6fe8;};'use strict';var Sequelize=require(_0x2e1d('0x0'));module[_0x2e1d('0x1')]={'name':{'type':Sequelize[_0x2e1d('0x2')],'allowNull':![],'unique':_0x2e1d('0x3')},'version':{'type':Sequelize[_0x2e1d('0x2')],'allowNull':![],'unique':_0x2e1d('0x3')},'main':{'type':Sequelize[_0x2e1d('0x2')],'defaultValue':_0x2e1d('0x4')},'filename':{'type':Sequelize[_0x2e1d('0x2')]},'path':{'type':Sequelize[_0x2e1d('0x2')]},'type':{'type':Sequelize[_0x2e1d('0x2')]},'size':{'type':Sequelize[_0x2e1d('0x5')]},'active':{'type':Sequelize[_0x2e1d('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x2e1d('0x2')]},'state':{'type':Sequelize[_0x2e1d('0x2')],'unique':_0x2e1d('0x7')},'description':{'type':Sequelize[_0x2e1d('0x2')]},'title':{'type':Sequelize[_0x2e1d('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x2e1d('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index f709dff..b6a8877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','Integration','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body'];(function(_0x1784b5,_0xafadc3){var _0x443c98=function(_0x43cf2b){while(--_0x43cf2b){_0x1784b5['push'](_0x1784b5['shift']());}};_0x443c98(++_0xafadc3);}(_0xb016,0x159));var _0x6b01=function(_0x2c2dc4,_0x3a9559){_0x2c2dc4=_0x2c2dc4-0x0;var _0x476244=_0xb016[_0x2c2dc4];return _0x476244;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['Integration'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};
\ No newline at end of file
+var _0x2542=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','error','stack','name','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3d9dc2,_0x4d0f69){var _0x9f75a0=function(_0x23d927){while(--_0x23d927){_0x3d9dc2['push'](_0x3d9dc2['shift']());}};_0x9f75a0(++_0x4d0f69);}(_0x2542,0x169));var _0x2254=function(_0x3b46de,_0x2ea1a6){_0x3b46de=_0x3b46de-0x0;var _0xcc3190=_0x2542[_0x3b46de];return _0xcc3190;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['Integration'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['create']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')](_0x239ba0[_0x2254('0x4b')],{})[_0x2254('0x26')](respondWithResult(_0x405eb2,0xc9))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x3ac691,_0xa103ea){if(_0x3ac691['body']['id']){delete _0x3ac691[_0x2254('0x4b')]['id'];}return db[_0x2254('0x2c')]['find']({'where':{'id':_0x3ac691[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0xa103ea,null))[_0x2254('0x26')](saveUpdates(_0x3ac691[_0x2254('0x4b')],null))['then'](respondWithResult(_0xa103ea,null))[_0x2254('0x45')](handleError(_0xa103ea,null));};exports[_0x2254('0x4c')]=function(_0x4d2c96,_0x26d01a){return db[_0x2254('0x2c')][_0x2254('0x49')]({'where':{'id':_0x4d2c96[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x26d01a,null))[_0x2254('0x26')](removeEntity(_0x26d01a,null))[_0x2254('0x45')](handleError(_0x26d01a,null));};
\ No newline at end of file
index 5f5ab0d..5bb8eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5317=['exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./integration.attributes'];(function(_0x4eaff9,_0x391464){var _0x156fce=function(_0x55be1d){while(--_0x55be1d){_0x4eaff9['push'](_0x4eaff9['shift']());}};_0x156fce(++_0x391464);}(_0x5317,0x1c4));var _0x7531=function(_0xf502aa,_0x4ba0da){_0xf502aa=_0xf502aa-0x0;var _0x2a3ab4=_0x5317[_0xf502aa];return _0x2a3ab4;};'use strict';var _=require(_0x7531('0x0'));var util=require(_0x7531('0x1'));var logger=require(_0x7531('0x2'))(_0x7531('0x3'));var moment=require(_0x7531('0x4'));var BPromise=require(_0x7531('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7531('0x6'));var rimraf=require(_0x7531('0x7'));var config=require(_0x7531('0x8'));var attributes=require(_0x7531('0x9'));module[_0x7531('0xa')]=function(_0x1a8e5e,_0x383c83){return _0x1a8e5e[_0x7531('0xb')](_0x7531('0xc'),attributes,{'tableName':_0x7531('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x12a3=['util','../../config/logger','bluebird','request-promise','rimraf','exports','define','Integration','integrations','lodash'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x12a3,0x171));var _0x312a=function(_0x1c0292,_0x23bf85){_0x1c0292=_0x1c0292-0x0;var _0x30eab1=_0x12a3[_0x1c0292];return _0x30eab1;};'use strict';var _=require(_0x312a('0x0'));var util=require(_0x312a('0x1'));var logger=require(_0x312a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x312a('0x3'));var rp=require(_0x312a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x312a('0x5'));var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0x312a('0x6')]=function(_0x4ef554,_0x24661e){return _0x4ef554[_0x312a('0x7')](_0x312a('0x8'),attributes,{'tableName':_0x312a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7776e41..2fd6713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['then','info','Integration,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x484e94,_0x503356){var _0x18c80c=function(_0x1481de){while(--_0x1481de){_0x484e94['push'](_0x484e94['shift']());}};_0x18c80c(++_0x503356);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('Integration,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
+var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','catch','lodash'];(function(_0x1833f6,_0x251ed7){var _0x2d3244=function(_0x1f6789){while(--_0x1f6789){_0x1833f6['push'](_0x1833f6['shift']());}};_0x2d3244(++_0x251ed7);}(_0x66fa,0x117));var _0xa66f=function(_0x136b76,_0x112e4a){_0x136b76=_0x136b76-0x0;var _0x18a5ae=_0x66fa[_0x136b76];return _0x18a5ae;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('Integration,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('Integration,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});}
\ No newline at end of file
index 71d0003..1fad03f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x476c6c,_0x434db8){var _0xbb94db=function(_0x4be12){while(--_0x4be12){_0x476c6c['push'](_0x476c6c['shift']());}};_0xbb94db(++_0x434db8);}(_0xadb5,0xad));var _0x5adb=function(_0x1f1b12,_0x3e5337){_0x1f1b12=_0x1f1b12-0x0;var _0x574c7b=_0xadb5[_0x1f1b12];return _0x574c7b;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./integrationReport.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router;
\ No newline at end of file
+var _0x9f0e=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x9f0e,0x116));var _0xe9f0=function(_0x402d9e,_0x3928da){_0x402d9e=_0x402d9e-0x0;var _0xe13b73=_0x9f0e[_0x402d9e];return _0xe13b73;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require(_0xe9f0('0x1'));var path=require(_0xe9f0('0x2'));var timeout=require(_0xe9f0('0x3'));var express=require(_0xe9f0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe9f0('0x5'));var interaction=require(_0xe9f0('0x6'));var config=require(_0xe9f0('0x7'));var controller=require(_0xe9f0('0x8'));router[_0xe9f0('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe9f0('0x9')](_0xe9f0('0xa'),auth[_0xe9f0('0xb')](),controller['describe']);router[_0xe9f0('0x9')](_0xe9f0('0xc'),auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xe')]('/',auth[_0xe9f0('0xb')](),controller[_0xe9f0('0xf')]);router[_0xe9f0('0x10')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x11')]);router[_0xe9f0('0x12')](_0xe9f0('0xc'),auth['isAuthenticated'](),controller[_0xe9f0('0x13')]);module['exports']=router;
\ No newline at end of file
index 3e043ab..ca2f226 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50ef=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','sequelize','exports','STRING'];(function(_0x3d8dab,_0x33c953){var _0x2ae93a=function(_0x23af88){while(--_0x23af88){_0x3d8dab['push'](_0x3d8dab['shift']());}};_0x2ae93a(++_0x33c953);}(_0x50ef,0x173));var _0xf50e=function(_0xe2b986,_0x3c52bc){_0xe2b986=_0xe2b986-0x0;var _0x32cd20=_0x50ef[_0xe2b986];return _0x32cd20;};'use strict';var Sequelize=require(_0xf50e('0x0'));module[_0xf50e('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf50e('0x2')]},'exitStatus':{'type':Sequelize[_0xf50e('0x2')]},'ticketId':{'type':Sequelize[_0xf50e('0x2')]},'integrationId':{'type':Sequelize[_0xf50e('0x3')]},'contacts':{'type':Sequelize[_0xf50e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf50e('0x2')]},'calleridname':{'type':Sequelize[_0xf50e('0x2')]},'queue':{'type':Sequelize[_0xf50e('0x2')]},'interface':{'type':Sequelize[_0xf50e('0x2')]},'membername':{'type':Sequelize[_0xf50e('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf50e('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf50e('0x4')]},'holdtime':{'type':Sequelize[_0xf50e('0x3')]},'agentcomplete':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf50e('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf50e('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf50e('0x4')]},'agentdump':{'type':Sequelize[_0xf50e('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf50e('0x2')]},'channelstate':{'type':Sequelize[_0xf50e('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf50e('0x2')]},'language':{'type':Sequelize[_0xf50e('0x2')]},'accountcode':{'type':Sequelize[_0xf50e('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xf50e('0x2')]},'priority':{'type':Sequelize[_0xf50e('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf50e('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf50e('0x2')]},'destcalleridname':{'type':Sequelize[_0xf50e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf50e('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xf50e('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf50e('0x2')]},'destpriority':{'type':Sequelize[_0xf50e('0x2')]},'destuniqueid':{'type':Sequelize[_0xf50e('0x2')]},'messageId':{'type':Sequelize[_0xf50e('0x2')]},'inReplyTo':{'type':Sequelize[_0xf50e('0x2')]},'subject':{'type':Sequelize[_0xf50e('0x2')]},'from':{'type':Sequelize[_0xf50e('0x2')]},'to':{'type':Sequelize[_0xf50e('0x2')]},'cc':{'type':Sequelize[_0xf50e('0x2')]},'attachment':{'type':Sequelize[_0xf50e('0x6')]},'html':{'type':Sequelize[_0xf50e('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xf50e('0x7')](_0xf50e('0x8'),_0xf50e('0x9'),_0xf50e('0xa'),'FAILED')},'url':{'type':Sequelize[_0xf50e('0x2')]},'app':{'type':Sequelize[_0xf50e('0x2')]},'appdata':{'type':Sequelize[_0xf50e('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xb204=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','STRING'];(function(_0x265519,_0x116ebb){var _0x4c14cb=function(_0x377406){while(--_0x377406){_0x265519['push'](_0x265519['shift']());}};_0x4c14cb(++_0x116ebb);}(_0xb204,0xaa));var _0x4b20=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xb204[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x4b20('0x0')]},'eventChannel':{'type':Sequelize[_0x4b20('0x0')]},'exitStatus':{'type':Sequelize[_0x4b20('0x0')]},'ticketId':{'type':Sequelize[_0x4b20('0x0')]},'integrationId':{'type':Sequelize[_0x4b20('0x1')]},'contacts':{'type':Sequelize[_0x4b20('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4b20('0x0')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4b20('0x0')]},'interface':{'type':Sequelize[_0x4b20('0x0')]},'membername':{'type':Sequelize[_0x4b20('0x0')]},'agentcalledAt':{'type':Sequelize[_0x4b20('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x4b20('0x1')]},'agentcomplete':{'type':Sequelize[_0x4b20('0x3')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4b20('0x2')]},'talktime':{'type':Sequelize[_0x4b20('0x1')]},'agentacw':{'type':Sequelize[_0x4b20('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x4b20('0x1')]},'reason':{'type':Sequelize[_0x4b20('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x4b20('0x3')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4b20('0x2')]},'lastevent':{'type':Sequelize[_0x4b20('0x0')]},'channel':{'type':Sequelize[_0x4b20('0x0')]},'channelstate':{'type':Sequelize[_0x4b20('0x1')]},'channelstatedesc':{'type':Sequelize[_0x4b20('0x0')]},'connectedlinenum':{'type':Sequelize[_0x4b20('0x0')]},'connectedlinename':{'type':Sequelize[_0x4b20('0x0')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4b20('0x0')]},'context':{'type':Sequelize[_0x4b20('0x0')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4b20('0x0')]},'destchannelstate':{'type':Sequelize[_0x4b20('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x4b20('0x0')]},'destcalleridnum':{'type':Sequelize[_0x4b20('0x0')]},'destcalleridname':{'type':Sequelize[_0x4b20('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x4b20('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x4b20('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x4b20('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x4b20('0x0')]},'destuniqueid':{'type':Sequelize[_0x4b20('0x0')]},'messageId':{'type':Sequelize[_0x4b20('0x0')]},'inReplyTo':{'type':Sequelize[_0x4b20('0x0')]},'subject':{'type':Sequelize[_0x4b20('0x0')]},'from':{'type':Sequelize[_0x4b20('0x0')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x4b20('0x4')]},'html':{'type':Sequelize[_0x4b20('0x4')]},'text':{'type':Sequelize[_0x4b20('0x4')]},'status':{'type':Sequelize[_0x4b20('0x5')](_0x4b20('0x6'),_0x4b20('0x7'),'RECEIVED',_0x4b20('0x8'))},'url':{'type':Sequelize[_0x4b20('0x0')]},'app':{'type':Sequelize[_0x4b20('0x0')]},'appdata':{'type':Sequelize[_0x4b20('0x0')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 84317f5..f41af88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf492=['then','destroy','end','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','type','VIRTUAL','merge','options','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','Content-Range','apply','reject','save','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf492,0x111));var _0x2f49=function(_0x1839e2,_0xeb2fb3){_0x1839e2=_0x1839e2-0x0;var _0x9378cb=_0xf492[_0x1839e2];return _0x9378cb;};'use strict';var emlformat=require(_0x2f49('0x0'));var rimraf=require(_0x2f49('0x1'));var zipdir=require(_0x2f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f49('0x3'));var moment=require(_0x2f49('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2f49('0x5'));var util=require(_0x2f49('0x6'));var path=require(_0x2f49('0x7'));var sox=require(_0x2f49('0x8'));var csv=require(_0x2f49('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f49('0xa'));var _=require(_0x2f49('0xb'));var squel=require(_0x2f49('0xc'));var crypto=require(_0x2f49('0xd'));var jsforce=require(_0x2f49('0xe'));var deskjs=require(_0x2f49('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2f49('0x10'));var Papa=require(_0x2f49('0x11'));var Redis=require(_0x2f49('0x12'));var authService=require(_0x2f49('0x13'));var qs=require(_0x2f49('0x14'));var as=require(_0x2f49('0x15'));var hardwareService=require(_0x2f49('0x16'));var logger=require(_0x2f49('0x17'))(_0x2f49('0x18'));var utils=require(_0x2f49('0x19'));var config=require(_0x2f49('0x1a'));var licenseUtil=require(_0x2f49('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53b486,_0x10c41b){_0x10c41b=_0x10c41b||0xcc;return function(_0x5e77ce){if(_0x5e77ce){return _0x53b486[_0x2f49('0x1c')](_0x10c41b);}return _0x53b486[_0x2f49('0x1d')](_0x10c41b)['end']();};}function respondWithResult(_0x164f78,_0x194840){_0x194840=_0x194840||0xc8;return function(_0x37e46e){if(_0x37e46e){return _0x164f78[_0x2f49('0x1d')](_0x194840)[_0x2f49('0x1e')](_0x37e46e);}};}function respondWithFilteredResult(_0x34df0e,_0x1f1a21){return function(_0x135476){if(_0x135476){var _0x3a7f5d=typeof _0x1f1a21['offset']===_0x2f49('0x1f')&&typeof _0x1f1a21[_0x2f49('0x20')]===_0x2f49('0x1f');var _0x25012e=_0x135476[_0x2f49('0x21')];var _0x28920=_0x3a7f5d?0x0:_0x1f1a21['offset'];var _0x440c26=_0x3a7f5d?_0x135476[_0x2f49('0x21')]:_0x1f1a21['offset']+_0x1f1a21[_0x2f49('0x20')];var _0x46c69c;if(_0x440c26>=_0x25012e){_0x440c26=_0x25012e;_0x46c69c=0xc8;}else{_0x46c69c=0xce;}_0x34df0e['status'](_0x46c69c);return _0x34df0e['set'](_0x2f49('0x22'),_0x28920+'-'+_0x440c26+'/'+_0x25012e)[_0x2f49('0x1e')](_0x135476);}return null;};}function patchUpdates(_0x29d70c){return function(_0x36c73a){try{jsonpatch[_0x2f49('0x23')](_0x36c73a,_0x29d70c,!![]);}catch(_0x4cc9a5){return BPromise[_0x2f49('0x24')](_0x4cc9a5);}return _0x36c73a[_0x2f49('0x25')]();};}function saveUpdates(_0x33ab06,_0x3a7a11){return function(_0x86a95a){if(_0x86a95a){return _0x86a95a[_0x2f49('0x26')](_0x33ab06)[_0x2f49('0x27')](function(_0x2cbf42){return _0x2cbf42;});}return null;};}function removeEntity(_0x40f312,_0x313b3a){return function(_0x4368bf){if(_0x4368bf){return _0x4368bf[_0x2f49('0x28')]()[_0x2f49('0x27')](function(){_0x40f312[_0x2f49('0x1d')](0xcc)[_0x2f49('0x29')]();});}};}function handleEntityNotFound(_0x44c80e,_0x2ac132){return function(_0x501e6d){if(!_0x501e6d){_0x44c80e[_0x2f49('0x1c')](0x194);}return _0x501e6d;};}function handleError(_0x9a92df,_0x172450){_0x172450=_0x172450||0x1f4;return function(_0x1f9bec){logger['error'](_0x1f9bec[_0x2f49('0x2a')]);if(_0x1f9bec[_0x2f49('0x2b')]){delete _0x1f9bec[_0x2f49('0x2b')];}_0x9a92df['status'](_0x172450)[_0x2f49('0x2c')](_0x1f9bec);};}exports[_0x2f49('0x2d')]=function(_0x5d4100,_0x577b0f){var _0x28d089={},_0x43c349={},_0x310198={'count':0x0,'rows':[]};var _0x34f14d=_[_0x2f49('0x2e')](db[_0x2f49('0x2f')][_0x2f49('0x30')],function(_0x236c06){return{'name':_0x236c06[_0x2f49('0x31')],'type':_0x236c06['type'][_0x2f49('0x32')]};});_0x43c349[_0x2f49('0x33')]=_['map'](_0x34f14d,_0x2f49('0x2b'));_0x43c349[_0x2f49('0x34')]=_[_0x2f49('0x35')](_0x5d4100[_0x2f49('0x34')]);_0x43c349[_0x2f49('0x36')]=_[_0x2f49('0x37')](_0x43c349[_0x2f49('0x33')],_0x43c349[_0x2f49('0x34')]);_0x28d089[_0x2f49('0x38')]=_[_0x2f49('0x37')](_0x43c349[_0x2f49('0x33')],qs[_0x2f49('0x39')](_0x5d4100[_0x2f49('0x34')][_0x2f49('0x39')]));_0x28d089['attributes']=_0x28d089['attributes'][_0x2f49('0x3a')]?_0x28d089[_0x2f49('0x38')]:_0x43c349[_0x2f49('0x33')];if(!_0x5d4100[_0x2f49('0x34')][_0x2f49('0x3b')]('nolimit')){_0x28d089[_0x2f49('0x20')]=qs['limit'](_0x5d4100['query'][_0x2f49('0x20')]);_0x28d089[_0x2f49('0x3c')]=qs[_0x2f49('0x3c')](_0x5d4100[_0x2f49('0x34')]['offset']);}_0x28d089[_0x2f49('0x3d')]=qs[_0x2f49('0x3e')](_0x5d4100[_0x2f49('0x34')][_0x2f49('0x3e')]);_0x28d089[_0x2f49('0x3f')]=qs[_0x2f49('0x36')](_[_0x2f49('0x40')](_0x5d4100['query'],_0x43c349[_0x2f49('0x36')]),_0x34f14d);if(_0x5d4100[_0x2f49('0x34')][_0x2f49('0x41')]){_0x28d089[_0x2f49('0x3f')]=_['merge'](_0x28d089['where'],{'$or':_[_0x2f49('0x2e')](_0x34f14d,function(_0x5ebd75){if(_0x5ebd75[_0x2f49('0x42')]!==_0x2f49('0x43')){var _0x5bbc5a={};_0x5bbc5a[_0x5ebd75[_0x2f49('0x2b')]]={'$like':'%'+_0x5d4100[_0x2f49('0x34')][_0x2f49('0x41')]+'%'};return _0x5bbc5a;}})});}_0x28d089=_[_0x2f49('0x44')]({},_0x28d089,_0x5d4100[_0x2f49('0x45')]);var _0x11d036={'where':_0x28d089['where']};return db[_0x2f49('0x2f')][_0x2f49('0x21')](_0x11d036)[_0x2f49('0x27')](function(_0x2d8ac9){_0x310198[_0x2f49('0x21')]=_0x2d8ac9;if(_0x5d4100[_0x2f49('0x34')]['includeAll']){_0x28d089['include']=[{'all':!![]}];}return db['IntegrationReport'][_0x2f49('0x46')](_0x28d089);})[_0x2f49('0x27')](function(_0x5472ba){_0x310198[_0x2f49('0x47')]=_0x5472ba;return _0x310198;})['then'](respondWithFilteredResult(_0x577b0f,_0x28d089))[_0x2f49('0x48')](handleError(_0x577b0f,null));};exports['show']=function(_0x4ec323,_0x20ac43){var _0x5721f0={'raw':![],'where':{'id':_0x4ec323[_0x2f49('0x49')]['id']}},_0x3010e1={};_0x3010e1['model']=_[_0x2f49('0x35')](db[_0x2f49('0x2f')]['rawAttributes']);_0x3010e1['query']=_[_0x2f49('0x35')](_0x4ec323[_0x2f49('0x34')]);_0x3010e1[_0x2f49('0x36')]=_[_0x2f49('0x37')](_0x3010e1[_0x2f49('0x33')],_0x3010e1[_0x2f49('0x34')]);_0x5721f0[_0x2f49('0x38')]=_[_0x2f49('0x37')](_0x3010e1[_0x2f49('0x33')],qs[_0x2f49('0x39')](_0x4ec323[_0x2f49('0x34')]['fields']));_0x5721f0['attributes']=_0x5721f0[_0x2f49('0x38')][_0x2f49('0x3a')]?_0x5721f0['attributes']:_0x3010e1[_0x2f49('0x33')];if(_0x4ec323[_0x2f49('0x34')]['includeAll']){_0x5721f0['include']=[{'all':!![]}];}_0x5721f0=_[_0x2f49('0x44')]({},_0x5721f0,_0x4ec323[_0x2f49('0x45')]);return db[_0x2f49('0x2f')][_0x2f49('0x4a')](_0x5721f0)[_0x2f49('0x27')](handleEntityNotFound(_0x20ac43,null))['then'](respondWithResult(_0x20ac43,null))[_0x2f49('0x48')](handleError(_0x20ac43,null));};exports[_0x2f49('0x4b')]=function(_0x55a312,_0x22b413){return db[_0x2f49('0x2f')][_0x2f49('0x4b')](_0x55a312[_0x2f49('0x4c')],{})['then'](respondWithResult(_0x22b413,0xc9))['catch'](handleError(_0x22b413,null));};exports['update']=function(_0x1c0db2,_0x35f162){if(_0x1c0db2[_0x2f49('0x4c')]['id']){delete _0x1c0db2[_0x2f49('0x4c')]['id'];}return db[_0x2f49('0x2f')][_0x2f49('0x4a')]({'where':{'id':_0x1c0db2[_0x2f49('0x49')]['id']}})['then'](handleEntityNotFound(_0x35f162,null))[_0x2f49('0x27')](saveUpdates(_0x1c0db2[_0x2f49('0x4c')],null))[_0x2f49('0x27')](respondWithResult(_0x35f162,null))['catch'](handleError(_0x35f162,null));};exports[_0x2f49('0x28')]=function(_0x3810b8,_0x50f3a8){return db[_0x2f49('0x2f')][_0x2f49('0x4a')]({'where':{'id':_0x3810b8[_0x2f49('0x49')]['id']}})['then'](handleEntityNotFound(_0x50f3a8,null))[_0x2f49('0x27')](removeEntity(_0x50f3a8,null))[_0x2f49('0x48')](handleError(_0x50f3a8,null));};exports[_0x2f49('0x4d')]=function(_0x339bbc,_0x54f46b){return db['IntegrationReport'][_0x2f49('0x4d')]()[_0x2f49('0x27')](respondWithResult(_0x54f46b,null))[_0x2f49('0x48')](handleError(_0x54f46b,null));};
\ No newline at end of file
+var _0xf580=['update','then','end','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','count','includeAll','IntegrationReport','findAll','rows','catch','show','params','length','include','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save'];(function(_0x271f70,_0x57f428){var _0x4859f5=function(_0x1a063e){while(--_0x1a063e){_0x271f70['push'](_0x271f70['shift']());}};_0x4859f5(++_0x57f428);}(_0xf580,0x19e));var _0x0f58=function(_0x58dc18,_0x334df1){_0x58dc18=_0x58dc18-0x0;var _0xa469f6=_0xf580[_0x58dc18];return _0xa469f6;};'use strict';var emlformat=require(_0x0f58('0x0'));var rimraf=require(_0x0f58('0x1'));var zipdir=require(_0x0f58('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f58('0x3'));var moment=require(_0x0f58('0x4'));var BPromise=require(_0x0f58('0x5'));var Mustache=require(_0x0f58('0x6'));var util=require(_0x0f58('0x7'));var path=require('path');var sox=require(_0x0f58('0x8'));var csv=require(_0x0f58('0x9'));var ejs=require(_0x0f58('0xa'));var fs=require('fs');var fs_extra=require(_0x0f58('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f58('0xc'));var deskjs=require(_0x0f58('0xd'));var toCsv=require(_0x0f58('0x9'));var querystring=require(_0x0f58('0xe'));var Papa=require(_0x0f58('0xf'));var Redis=require(_0x0f58('0x10'));var authService=require(_0x0f58('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f58('0x12'));var logger=require(_0x0f58('0x13'))(_0x0f58('0x14'));var utils=require(_0x0f58('0x15'));var config=require(_0x0f58('0x16'));var licenseUtil=require(_0x0f58('0x17'));var db=require(_0x0f58('0x18'))['db'];function respondWithStatusCode(_0x38ebac,_0x18c867){_0x18c867=_0x18c867||0xcc;return function(_0x594282){if(_0x594282){return _0x38ebac[_0x0f58('0x19')](_0x18c867);}return _0x38ebac[_0x0f58('0x1a')](_0x18c867)['end']();};}function respondWithResult(_0x2d4b77,_0x34eb0c){_0x34eb0c=_0x34eb0c||0xc8;return function(_0x5d09e2){if(_0x5d09e2){return _0x2d4b77['status'](_0x34eb0c)[_0x0f58('0x1b')](_0x5d09e2);}};}function respondWithFilteredResult(_0xc0801,_0x460cd2){return function(_0x2d331b){if(_0x2d331b){var _0x51703d=typeof _0x460cd2[_0x0f58('0x1c')]===_0x0f58('0x1d')&&typeof _0x460cd2[_0x0f58('0x1e')]===_0x0f58('0x1d');var _0x3fc699=_0x2d331b['count'];var _0x38db53=_0x51703d?0x0:_0x460cd2['offset'];var _0x2e360b=_0x51703d?_0x2d331b['count']:_0x460cd2[_0x0f58('0x1c')]+_0x460cd2[_0x0f58('0x1e')];var _0x23345b;if(_0x2e360b>=_0x3fc699){_0x2e360b=_0x3fc699;_0x23345b=0xc8;}else{_0x23345b=0xce;}_0xc0801['status'](_0x23345b);return _0xc0801[_0x0f58('0x1f')](_0x0f58('0x20'),_0x38db53+'-'+_0x2e360b+'/'+_0x3fc699)['json'](_0x2d331b);}return null;};}function patchUpdates(_0x12f2d0){return function(_0x3098f0){try{jsonpatch[_0x0f58('0x21')](_0x3098f0,_0x12f2d0,!![]);}catch(_0x2e1905){return BPromise[_0x0f58('0x22')](_0x2e1905);}return _0x3098f0[_0x0f58('0x23')]();};}function saveUpdates(_0x1d1dd8,_0x24ad1b){return function(_0x1e7b9c){if(_0x1e7b9c){return _0x1e7b9c[_0x0f58('0x24')](_0x1d1dd8)['then'](function(_0x405ab8){return _0x405ab8;});}return null;};}function removeEntity(_0x48e2af,_0x4863be){return function(_0x18bbfb){if(_0x18bbfb){return _0x18bbfb['destroy']()[_0x0f58('0x25')](function(){_0x48e2af[_0x0f58('0x1a')](0xcc)[_0x0f58('0x26')]();});}};}function handleEntityNotFound(_0xbae2cd,_0x2e1599){return function(_0x48509b){if(!_0x48509b){_0xbae2cd[_0x0f58('0x19')](0x194);}return _0x48509b;};}function handleError(_0x1898fd,_0x5ce2c3){_0x5ce2c3=_0x5ce2c3||0x1f4;return function(_0xb0a32d){logger['error'](_0xb0a32d['stack']);if(_0xb0a32d['name']){delete _0xb0a32d[_0x0f58('0x27')];}_0x1898fd[_0x0f58('0x1a')](_0x5ce2c3)[_0x0f58('0x28')](_0xb0a32d);};}exports[_0x0f58('0x29')]=function(_0x454e10,_0x36d115){var _0x5db203={},_0x48fa5f={},_0x5deb9c={'count':0x0,'rows':[]};var _0x1c41ae=_[_0x0f58('0x2a')](db['IntegrationReport'][_0x0f58('0x2b')],function(_0x270721){return{'name':_0x270721[_0x0f58('0x2c')],'type':_0x270721[_0x0f58('0x2d')]['key']};});_0x48fa5f[_0x0f58('0x2e')]=_[_0x0f58('0x2a')](_0x1c41ae,_0x0f58('0x27'));_0x48fa5f[_0x0f58('0x2f')]=_[_0x0f58('0x30')](_0x454e10['query']);_0x48fa5f['filters']=_['intersection'](_0x48fa5f[_0x0f58('0x2e')],_0x48fa5f[_0x0f58('0x2f')]);_0x5db203[_0x0f58('0x31')]=_[_0x0f58('0x32')](_0x48fa5f['model'],qs[_0x0f58('0x33')](_0x454e10['query'][_0x0f58('0x33')]));_0x5db203[_0x0f58('0x31')]=_0x5db203[_0x0f58('0x31')]['length']?_0x5db203[_0x0f58('0x31')]:_0x48fa5f[_0x0f58('0x2e')];if(!_0x454e10[_0x0f58('0x2f')][_0x0f58('0x34')](_0x0f58('0x35'))){_0x5db203[_0x0f58('0x1e')]=qs['limit'](_0x454e10[_0x0f58('0x2f')][_0x0f58('0x1e')]);_0x5db203[_0x0f58('0x1c')]=qs[_0x0f58('0x1c')](_0x454e10[_0x0f58('0x2f')][_0x0f58('0x1c')]);}_0x5db203['order']=qs[_0x0f58('0x36')](_0x454e10[_0x0f58('0x2f')][_0x0f58('0x36')]);_0x5db203[_0x0f58('0x37')]=qs[_0x0f58('0x38')](_['pick'](_0x454e10['query'],_0x48fa5f[_0x0f58('0x38')]),_0x1c41ae);if(_0x454e10[_0x0f58('0x2f')][_0x0f58('0x39')]){_0x5db203['where']=_['merge'](_0x5db203[_0x0f58('0x37')],{'$or':_[_0x0f58('0x2a')](_0x1c41ae,function(_0xbacb9a){if(_0xbacb9a[_0x0f58('0x2d')]!=='VIRTUAL'){var _0x403794={};_0x403794[_0xbacb9a[_0x0f58('0x27')]]={'$like':'%'+_0x454e10['query'][_0x0f58('0x39')]+'%'};return _0x403794;}})});}_0x5db203=_[_0x0f58('0x3a')]({},_0x5db203,_0x454e10[_0x0f58('0x3b')]);var _0x4d881={'where':_0x5db203[_0x0f58('0x37')]};return db['IntegrationReport']['count'](_0x4d881)[_0x0f58('0x25')](function(_0x5138ea){_0x5deb9c[_0x0f58('0x3c')]=_0x5138ea;if(_0x454e10['query'][_0x0f58('0x3d')]){_0x5db203['include']=[{'all':!![]}];}return db[_0x0f58('0x3e')][_0x0f58('0x3f')](_0x5db203);})['then'](function(_0x28daaa){_0x5deb9c[_0x0f58('0x40')]=_0x28daaa;return _0x5deb9c;})[_0x0f58('0x25')](respondWithFilteredResult(_0x36d115,_0x5db203))[_0x0f58('0x41')](handleError(_0x36d115,null));};exports[_0x0f58('0x42')]=function(_0xc3f2f2,_0x1c9ce1){var _0x581d86={'raw':![],'where':{'id':_0xc3f2f2[_0x0f58('0x43')]['id']}},_0x49e087={};_0x49e087[_0x0f58('0x2e')]=_[_0x0f58('0x30')](db[_0x0f58('0x3e')][_0x0f58('0x2b')]);_0x49e087['query']=_[_0x0f58('0x30')](_0xc3f2f2['query']);_0x49e087[_0x0f58('0x38')]=_['intersection'](_0x49e087['model'],_0x49e087['query']);_0x581d86[_0x0f58('0x31')]=_[_0x0f58('0x32')](_0x49e087[_0x0f58('0x2e')],qs[_0x0f58('0x33')](_0xc3f2f2[_0x0f58('0x2f')][_0x0f58('0x33')]));_0x581d86[_0x0f58('0x31')]=_0x581d86[_0x0f58('0x31')][_0x0f58('0x44')]?_0x581d86[_0x0f58('0x31')]:_0x49e087[_0x0f58('0x2e')];if(_0xc3f2f2[_0x0f58('0x2f')][_0x0f58('0x3d')]){_0x581d86[_0x0f58('0x45')]=[{'all':!![]}];}_0x581d86=_[_0x0f58('0x3a')]({},_0x581d86,_0xc3f2f2[_0x0f58('0x3b')]);return db['IntegrationReport'][_0x0f58('0x46')](_0x581d86)[_0x0f58('0x25')](handleEntityNotFound(_0x1c9ce1,null))[_0x0f58('0x25')](respondWithResult(_0x1c9ce1,null))[_0x0f58('0x41')](handleError(_0x1c9ce1,null));};exports[_0x0f58('0x47')]=function(_0x530bdf,_0x2e991d){return db[_0x0f58('0x3e')]['create'](_0x530bdf[_0x0f58('0x48')],{})[_0x0f58('0x25')](respondWithResult(_0x2e991d,0xc9))[_0x0f58('0x41')](handleError(_0x2e991d,null));};exports['update']=function(_0x5113c4,_0x41f723){if(_0x5113c4[_0x0f58('0x48')]['id']){delete _0x5113c4[_0x0f58('0x48')]['id'];}return db[_0x0f58('0x3e')]['find']({'where':{'id':_0x5113c4[_0x0f58('0x43')]['id']}})['then'](handleEntityNotFound(_0x41f723,null))[_0x0f58('0x25')](saveUpdates(_0x5113c4[_0x0f58('0x48')],null))[_0x0f58('0x25')](respondWithResult(_0x41f723,null))[_0x0f58('0x41')](handleError(_0x41f723,null));};exports[_0x0f58('0x49')]=function(_0x244b6b,_0x21149c){return db['IntegrationReport'][_0x0f58('0x46')]({'where':{'id':_0x244b6b['params']['id']}})['then'](handleEntityNotFound(_0x21149c,null))[_0x0f58('0x25')](removeEntity(_0x21149c,null))[_0x0f58('0x41')](handleError(_0x21149c,null));};exports[_0x0f58('0x4a')]=function(_0x7ff75c,_0x32ef09){return db[_0x0f58('0x3e')][_0x0f58('0x4a')]()[_0x0f58('0x25')](respondWithResult(_0x32ef09,null))[_0x0f58('0x41')](handleError(_0x32ef09,null));};
\ No newline at end of file
index 384b4f2..cc9669c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1c4=['rimraf','./integrationReport.attributes','define','IntegrationReport','lodash','util','../../config/logger','request-promise','path'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb1c4,0x82));var _0x4b1c=function(_0x2cce1b,_0x59842e){_0x2cce1b=_0x2cce1b-0x0;var _0x2b8215=_0xb1c4[_0x2cce1b];return _0x2b8215;};'use strict';var _=require(_0x4b1c('0x0'));var util=require(_0x4b1c('0x1'));var logger=require(_0x4b1c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b1c('0x3'));var fs=require('fs');var path=require(_0x4b1c('0x4'));var rimraf=require(_0x4b1c('0x5'));var config=require('../../config/environment');var attributes=require(_0x4b1c('0x6'));module['exports']=function(_0x47ae3f,_0x28a794){return _0x47ae3f[_0x4b1c('0x7')](_0x4b1c('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48df=['rimraf','../../config/environment','./integrationReport.attributes','exports','define','report_integration','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x48df,0xd2));var _0xf48d=function(_0x137d1d,_0x35c663){_0x137d1d=_0x137d1d-0x0;var _0x485108=_0x48df[_0x137d1d];return _0x485108;};'use strict';var _=require(_0xf48d('0x0'));var util=require('util');var logger=require(_0xf48d('0x1'))('api');var moment=require(_0xf48d('0x2'));var BPromise=require(_0xf48d('0x3'));var rp=require(_0xf48d('0x4'));var fs=require('fs');var path=require(_0xf48d('0x5'));var rimraf=require(_0xf48d('0x6'));var config=require(_0xf48d('0x7'));var attributes=require(_0xf48d('0x8'));module[_0xf48d('0x9')]=function(_0xdb6283,_0x42294e){return _0xdb6283[_0xf48d('0xa')]('IntegrationReport',attributes,{'tableName':_0xf48d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9e735fc..52c18ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5223c2,_0xe0d88f){var _0x10f398=function(_0x15e4ae){while(--_0x15e4ae){_0x5223c2['push'](_0x5223c2['shift']());}};_0x10f398(++_0xe0d88f);}(_0x2ef3,0xba));var _0x32ef=function(_0x23a385,_0x1ba009){_0x23a385=_0x23a385-0x0;var _0x280dbc=_0x2ef3[_0x23a385];return _0x280dbc;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x1261=['then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x3cb194,_0x356817){var _0x36bfe5=function(_0x123ff1){while(--_0x123ff1){_0x3cb194['push'](_0x3cb194['shift']());}};_0x36bfe5(++_0x356817);}(_0x1261,0x144));var _0x1126=function(_0x40292e,_0xaa2a7b){_0x40292e=_0x40292e-0x0;var _0x1ed986=_0x1261[_0x40292e];return _0x1ed986;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
index 89c196a..6418de0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8daf=['post','create','addInterval','addIntervals','put','update','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8daf,0x15c));var _0xf8da=function(_0x1e8a13,_0x150633){_0x1e8a13=_0x1e8a13-0x0;var _0x1b5c34=_0x8daf[_0x1e8a13];return _0x1b5c34;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf8da('0x0'));var router=express[_0xf8da('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xf8da('0x2'));var interaction=require(_0xf8da('0x3'));var config=require(_0xf8da('0x4'));var controller=require(_0xf8da('0x5'));router[_0xf8da('0x6')]('/',auth[_0xf8da('0x7')](),controller[_0xf8da('0x8')]);router[_0xf8da('0x6')](_0xf8da('0x9'),auth['isAuthenticated'](),controller[_0xf8da('0xa')]);router['get'](_0xf8da('0xb'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xf8da('0xc')]('/',auth[_0xf8da('0x7')](),controller[_0xf8da('0xd')]);router[_0xf8da('0xc')](_0xf8da('0xb'),auth[_0xf8da('0x7')](),controller[_0xf8da('0xe')]);router[_0xf8da('0xc')]('/:id/sub_intervals/create_many',auth[_0xf8da('0x7')](),controller[_0xf8da('0xf')]);router[_0xf8da('0x10')](_0xf8da('0x9'),auth['isAuthenticated'](),controller[_0xf8da('0x11')]);router['delete'](_0xf8da('0x9'),auth[_0xf8da('0x7')](),controller[_0xf8da('0x12')]);module[_0xf8da('0x13')]=router;
\ No newline at end of file
+var _0x22ca=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','index','get','/:id','/:id/sub_intervals','isAuthenticated','getIntervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','exports','multer','util'];(function(_0x55d829,_0x43f06c){var _0x52163b=function(_0x493cd8){while(--_0x493cd8){_0x55d829['push'](_0x55d829['shift']());}};_0x52163b(++_0x43f06c);}(_0x22ca,0x1d9));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xa22c('0x0'));var util=require(_0xa22c('0x1'));var path=require(_0xa22c('0x2'));var timeout=require(_0xa22c('0x3'));var express=require(_0xa22c('0x4'));var router=express[_0xa22c('0x5')]();var fs_extra=require(_0xa22c('0x6'));var auth=require(_0xa22c('0x7'));var interaction=require(_0xa22c('0x8'));var config=require(_0xa22c('0x9'));var controller=require(_0xa22c('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xa22c('0xb')]);router[_0xa22c('0xc')](_0xa22c('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa22c('0xe'),auth[_0xa22c('0xf')](),controller[_0xa22c('0x10')]);router[_0xa22c('0x11')]('/',auth[_0xa22c('0xf')](),controller['create']);router[_0xa22c('0x11')](_0xa22c('0xe'),auth['isAuthenticated'](),controller[_0xa22c('0x12')]);router[_0xa22c('0x11')](_0xa22c('0x13'),auth[_0xa22c('0xf')](),controller[_0xa22c('0x14')]);router[_0xa22c('0x15')](_0xa22c('0xd'),auth[_0xa22c('0xf')](),controller['update']);router[_0xa22c('0x16')](_0xa22c('0xd'),auth['isAuthenticated'](),controller[_0xa22c('0x17')]);module[_0xa22c('0x18')]=router;
\ No newline at end of file
index d64221e..251ff2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x078b=['sequelize','STRING'];(function(_0x345d30,_0xb4c29c){var _0x2d1aa1=function(_0x3e9438){while(--_0x3e9438){_0x345d30['push'](_0x345d30['shift']());}};_0x2d1aa1(++_0xb4c29c);}(_0x078b,0x18a));var _0xb078=function(_0x4e791e,_0x12eb01){_0x4e791e=_0x4e791e-0x0;var _0x4009f5=_0x078b[_0x4e791e];return _0x4009f5;};'use strict';var Sequelize=require(_0xb078('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb078('0x1')]},'interval':{'type':Sequelize[_0xb078('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x796a=['sequelize','exports','STRING'];(function(_0x43c435,_0x10a7e6){var _0x9b076f=function(_0x5c3dc6){while(--_0x5c3dc6){_0x43c435['push'](_0x43c435['shift']());}};_0x9b076f(++_0x10a7e6);}(_0x796a,0xa5));var _0xa796=function(_0x5baadf,_0x1bb942){_0x5baadf=_0x5baadf-0x0;var _0x3cd985=_0x796a[_0x5baadf];return _0x3cd985;};'use strict';var Sequelize=require(_0xa796('0x0'));module[_0xa796('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa796('0x2')]},'interval':{'type':Sequelize[_0xa796('0x2')],'allowNull':!![]}};
\ No newline at end of file
index d1d83b8..00f7c9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbf0=['getIntervals','findOne','filter','map','nolimit','addIntervals','transaction','bulkCreate','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','get','Intervals','UserProfileResource','destroy','end','error','stack','name','send','index','Interval','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId'];(function(_0x4f5e02,_0x46a006){var _0x3f44bf=function(_0x12c071){while(--_0x12c071){_0x4f5e02['push'](_0x4f5e02['shift']());}};_0x3f44bf(++_0x46a006);}(_0xfbf0,0xc0));var _0x0fbf=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xfbf0[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require(_0x0fbf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0fbf('0x1'));var jsonpatch=require(_0x0fbf('0x2'));var rp=require(_0x0fbf('0x3'));var moment=require(_0x0fbf('0x4'));var BPromise=require(_0x0fbf('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0fbf('0x6'));var sox=require(_0x0fbf('0x7'));var csv=require(_0x0fbf('0x8'));var ejs=require(_0x0fbf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0fbf('0xa'));var squel=require(_0x0fbf('0xb'));var crypto=require('crypto');var jsforce=require(_0x0fbf('0xc'));var deskjs=require(_0x0fbf('0xd'));var toCsv=require(_0x0fbf('0x8'));var querystring=require(_0x0fbf('0xe'));var Papa=require(_0x0fbf('0xf'));var Redis=require(_0x0fbf('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0fbf('0x11'));var as=require(_0x0fbf('0x12'));var hardwareService=require(_0x0fbf('0x13'));var logger=require(_0x0fbf('0x14'))('api');var utils=require(_0x0fbf('0x15'));var config=require(_0x0fbf('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0fbf('0x17'))['db'];var extensions=require(_0x0fbf('0x18'));function respondWithStatusCode(_0x11a556,_0x5769e8){_0x5769e8=_0x5769e8||0xcc;return function(_0x2d2e5f){if(_0x2d2e5f){return _0x11a556[_0x0fbf('0x19')](_0x5769e8);}return _0x11a556[_0x0fbf('0x1a')](_0x5769e8)['end']();};}function respondWithResult(_0x30c6b9,_0x13b0d9){_0x13b0d9=_0x13b0d9||0xc8;return function(_0x239f62){if(_0x239f62){return _0x30c6b9[_0x0fbf('0x1a')](_0x13b0d9)[_0x0fbf('0x1b')](_0x239f62);}};}function respondWithFilteredResult(_0x40003e,_0x17030f){return function(_0x172011){if(_0x172011){var _0x4df18f=typeof _0x17030f[_0x0fbf('0x1c')]===_0x0fbf('0x1d')&&typeof _0x17030f[_0x0fbf('0x1e')]===_0x0fbf('0x1d');var _0x14b4fe=_0x172011[_0x0fbf('0x1f')];var _0xe790e9=_0x4df18f?0x0:_0x17030f['offset'];var _0x2f10e6=_0x4df18f?_0x172011['count']:_0x17030f['offset']+_0x17030f[_0x0fbf('0x1e')];var _0x4e7cd3;if(_0x2f10e6>=_0x14b4fe){_0x2f10e6=_0x14b4fe;_0x4e7cd3=0xc8;}else{_0x4e7cd3=0xce;}_0x40003e['status'](_0x4e7cd3);return _0x40003e[_0x0fbf('0x20')]('Content-Range',_0xe790e9+'-'+_0x2f10e6+'/'+_0x14b4fe)[_0x0fbf('0x1b')](_0x172011);}return null;};}function patchUpdates(_0x357ace){return function(_0x16274a){try{jsonpatch[_0x0fbf('0x21')](_0x16274a,_0x357ace,!![]);}catch(_0x5bcaa0){return BPromise[_0x0fbf('0x22')](_0x5bcaa0);}return _0x16274a['save']();};}function saveUpdates(_0x47ac0d,_0x4d1d44){return function(_0x114af6){if(_0x114af6){return _0x114af6[_0x0fbf('0x23')](_0x47ac0d)[_0x0fbf('0x24')](function(_0x571d16){return _0x571d16;});}return null;};}function removeEntity(_0x4dff3b,_0x878f10){return function(_0x38b23e){if(_0x38b23e){return _0x38b23e['destroy']()[_0x0fbf('0x24')](function(){var _0x84a931=_0x38b23e[_0x0fbf('0x25')]({'plain':!![]});var _0x43e37a=_0x0fbf('0x26');return db[_0x0fbf('0x27')][_0x0fbf('0x28')]({'where':{'type':_0x43e37a,'resourceId':_0x84a931['id']}})[_0x0fbf('0x24')](function(){return _0x38b23e;});})[_0x0fbf('0x24')](function(){_0x4dff3b[_0x0fbf('0x1a')](0xcc)[_0x0fbf('0x29')]();});}};}function handleEntityNotFound(_0x1140e8,_0x3e7e40){return function(_0x53b53c){if(!_0x53b53c){_0x1140e8['sendStatus'](0x194);}return _0x53b53c;};}function handleError(_0x2a9edd,_0xd889c0){_0xd889c0=_0xd889c0||0x1f4;return function(_0xaaa859){logger[_0x0fbf('0x2a')](_0xaaa859[_0x0fbf('0x2b')]);if(_0xaaa859[_0x0fbf('0x2c')]){delete _0xaaa859['name'];}_0x2a9edd[_0x0fbf('0x1a')](_0xd889c0)[_0x0fbf('0x2d')](_0xaaa859);};}exports[_0x0fbf('0x2e')]=function(_0x4a6427,_0x7b9769){var _0x1d2240={},_0xf8138={},_0x4cebd0={'count':0x0,'rows':[]};var _0x2fc2a1=_['map'](db[_0x0fbf('0x2f')][_0x0fbf('0x30')],function(_0xeca243){return{'name':_0xeca243['fieldName'],'type':_0xeca243[_0x0fbf('0x31')][_0x0fbf('0x32')]};});_0xf8138[_0x0fbf('0x33')]=_['map'](_0x2fc2a1,_0x0fbf('0x2c'));_0xf8138[_0x0fbf('0x34')]=_[_0x0fbf('0x35')](_0x4a6427['query']);_0xf8138[_0x0fbf('0x36')]=_['intersection'](_0xf8138[_0x0fbf('0x33')],_0xf8138[_0x0fbf('0x34')]);_0x1d2240[_0x0fbf('0x37')]=_[_0x0fbf('0x38')](_0xf8138['model'],qs['fields'](_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x39')]));_0x1d2240[_0x0fbf('0x37')]=_0x1d2240['attributes']['length']?_0x1d2240[_0x0fbf('0x37')]:_0xf8138['model'];if(!_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x3a')]('nolimit')){_0x1d2240[_0x0fbf('0x1e')]=qs[_0x0fbf('0x1e')](_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x1e')]);_0x1d2240['offset']=qs[_0x0fbf('0x1c')](_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x1c')]);}_0x1d2240[_0x0fbf('0x3b')]=qs[_0x0fbf('0x3c')](_0x4a6427['query']['sort']);_0x1d2240[_0x0fbf('0x3d')]=qs[_0x0fbf('0x36')](_[_0x0fbf('0x3e')](_0x4a6427['query'],_0xf8138[_0x0fbf('0x36')]),_0x2fc2a1);if(_0x4a6427[_0x0fbf('0x34')]['filter']){_0x1d2240['where']=_[_0x0fbf('0x3f')](_0x1d2240[_0x0fbf('0x3d')],{'$or':_['map'](_0x2fc2a1,function(_0x20b49c){if(_0x20b49c[_0x0fbf('0x31')]!==_0x0fbf('0x40')){var _0x185b5d={};_0x185b5d[_0x20b49c[_0x0fbf('0x2c')]]={'$like':'%'+_0x4a6427[_0x0fbf('0x34')]['filter']+'%'};return _0x185b5d;}})});}_0x1d2240=_[_0x0fbf('0x3f')]({},_0x1d2240,_0x4a6427[_0x0fbf('0x41')]);var _0x1f5ac9={'where':_0x1d2240[_0x0fbf('0x3d')]};return db[_0x0fbf('0x2f')]['count'](_0x1f5ac9)[_0x0fbf('0x24')](function(_0x231064){_0x4cebd0[_0x0fbf('0x1f')]=_0x231064;if(_0x4a6427[_0x0fbf('0x34')][_0x0fbf('0x42')]){_0x1d2240['include']=[{'all':!![]}];}return db['Interval'][_0x0fbf('0x43')](_0x1d2240);})[_0x0fbf('0x24')](function(_0x1b00d1){_0x4cebd0[_0x0fbf('0x44')]=_0x1b00d1;return _0x4cebd0;})[_0x0fbf('0x24')](respondWithFilteredResult(_0x7b9769,_0x1d2240))[_0x0fbf('0x45')](handleError(_0x7b9769,null));};exports[_0x0fbf('0x46')]=function(_0xdb619b,_0x4b6d43){var _0x3b990e={'raw':!![],'where':{'id':_0xdb619b[_0x0fbf('0x47')]['id']}},_0xa4cdda={};_0xa4cdda[_0x0fbf('0x33')]=_[_0x0fbf('0x35')](db[_0x0fbf('0x2f')][_0x0fbf('0x30')]);_0xa4cdda['query']=_[_0x0fbf('0x35')](_0xdb619b[_0x0fbf('0x34')]);_0xa4cdda['filters']=_[_0x0fbf('0x38')](_0xa4cdda['model'],_0xa4cdda[_0x0fbf('0x34')]);_0x3b990e[_0x0fbf('0x37')]=_['intersection'](_0xa4cdda[_0x0fbf('0x33')],qs[_0x0fbf('0x39')](_0xdb619b[_0x0fbf('0x34')]['fields']));_0x3b990e['attributes']=_0x3b990e[_0x0fbf('0x37')][_0x0fbf('0x48')]?_0x3b990e[_0x0fbf('0x37')]:_0xa4cdda['model'];if(_0xdb619b[_0x0fbf('0x34')]['includeAll']){_0x3b990e[_0x0fbf('0x49')]=[{'all':!![]}];}_0x3b990e=_[_0x0fbf('0x3f')]({},_0x3b990e,_0xdb619b['options']);return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')](_0x3b990e)['then'](handleEntityNotFound(_0x4b6d43,null))[_0x0fbf('0x24')](respondWithResult(_0x4b6d43,null))[_0x0fbf('0x45')](handleError(_0x4b6d43,null));};exports[_0x0fbf('0x4b')]=function(_0x2ee0c6,_0x1c7b80){return db[_0x0fbf('0x2f')]['create'](_0x2ee0c6[_0x0fbf('0x4c')],{})['then'](function(_0x346cf1){var _0x4d2db7=_0x2ee0c6['user'][_0x0fbf('0x25')]({'plain':!![]});if(!_0x4d2db7)throw new Error(_0x0fbf('0x4d'));if(_0x4d2db7[_0x0fbf('0x4e')]==='user'){var _0x356220=_0x346cf1[_0x0fbf('0x25')]({'plain':!![]});var _0x238092=_0x0fbf('0x26');return db[_0x0fbf('0x4f')][_0x0fbf('0x4a')]({'where':{'name':_0x238092,'userProfileId':_0x4d2db7['userProfileId']},'raw':!![]})[_0x0fbf('0x24')](function(_0x5d414f){if(_0x5d414f&&_0x5d414f[_0x0fbf('0x50')]===0x0){return db[_0x0fbf('0x27')][_0x0fbf('0x4b')]({'name':_0x356220[_0x0fbf('0x2c')],'resourceId':_0x356220['id'],'type':_0x5d414f[_0x0fbf('0x2c')],'sectionId':_0x5d414f['id']},{})['then'](function(){return _0x346cf1;});}else{return _0x346cf1;}})[_0x0fbf('0x45')](function(_0x205ae9){logger[_0x0fbf('0x2a')](_0x0fbf('0x51'),_0x205ae9);throw _0x205ae9;});}return _0x346cf1;})[_0x0fbf('0x24')](respondWithResult(_0x1c7b80,0xc9))[_0x0fbf('0x45')](handleError(_0x1c7b80,null));};exports[_0x0fbf('0x23')]=function(_0x281894,_0x28a732){if(_0x281894[_0x0fbf('0x4c')]['id']){delete _0x281894[_0x0fbf('0x4c')]['id'];}return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')]({'where':{'id':_0x281894[_0x0fbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x28a732,null))['then'](saveUpdates(_0x281894[_0x0fbf('0x4c')],null))[_0x0fbf('0x24')](respondWithResult(_0x28a732,null))[_0x0fbf('0x45')](handleError(_0x28a732,null));};exports['destroy']=function(_0x48b772,_0x4f40f9){return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')]({'where':{'id':_0x48b772[_0x0fbf('0x47')]['id']}})[_0x0fbf('0x24')](handleEntityNotFound(_0x4f40f9,null))[_0x0fbf('0x24')](removeEntity(_0x4f40f9,null))[_0x0fbf('0x45')](handleError(_0x4f40f9,null));};exports[_0x0fbf('0x52')]=function(_0x249bab,_0x28d433,_0x36be40){if(_0x249bab['body']['id']){delete _0x249bab[_0x0fbf('0x4c')]['id'];}return db[_0x0fbf('0x2f')][_0x0fbf('0x4a')]({'where':{'id':_0x249bab['params']['id']}})[_0x0fbf('0x24')](handleEntityNotFound(_0x28d433,null))[_0x0fbf('0x24')](function(_0x41f9b3){if(_0x41f9b3){_0x249bab[_0x0fbf('0x4c')][_0x0fbf('0x53')]=_0x41f9b3['id'];return db[_0x0fbf('0x2f')][_0x0fbf('0x4b')](_0x249bab[_0x0fbf('0x4c')]);}})[_0x0fbf('0x24')](respondWithResult(_0x28d433,null))[_0x0fbf('0x45')](handleError(_0x28d433,null));};exports[_0x0fbf('0x54')]=function(_0x3076b9,_0x4f2865,_0x4a62dd){var _0x2cb19a={};var _0xa736d5={};var _0x3ccaff;var _0x42bc50;return db[_0x0fbf('0x2f')][_0x0fbf('0x55')]({'where':{'id':_0x3076b9[_0x0fbf('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f2865,null))[_0x0fbf('0x24')](function(_0x39b46e){if(_0x39b46e){_0x3ccaff=_0x39b46e;_0xa736d5[_0x0fbf('0x33')]=_[_0x0fbf('0x35')](db[_0x0fbf('0x2f')][_0x0fbf('0x30')]);_0xa736d5['query']=_['keys'](_0x3076b9[_0x0fbf('0x34')]);_0xa736d5[_0x0fbf('0x36')]=_['intersection'](_0xa736d5[_0x0fbf('0x33')],_0xa736d5[_0x0fbf('0x34')]);_0x2cb19a['attributes']=_[_0x0fbf('0x38')](_0xa736d5[_0x0fbf('0x33')],qs[_0x0fbf('0x39')](_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x39')]));_0x2cb19a[_0x0fbf('0x37')]=_0x2cb19a[_0x0fbf('0x37')]['length']?_0x2cb19a['attributes']:_0xa736d5[_0x0fbf('0x33')];_0x2cb19a[_0x0fbf('0x3b')]=qs[_0x0fbf('0x3c')](_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x3c')]);_0x2cb19a[_0x0fbf('0x3d')]=qs[_0x0fbf('0x36')](_['pick'](_0x3076b9[_0x0fbf('0x34')],_0xa736d5[_0x0fbf('0x36')]));if(_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x56')]){_0x2cb19a[_0x0fbf('0x3d')]=_[_0x0fbf('0x3f')](_0x2cb19a[_0x0fbf('0x3d')],{'$or':_[_0x0fbf('0x57')](_0x2cb19a[_0x0fbf('0x37')],function(_0x4de5c7){var _0x29df24={};_0x29df24[_0x4de5c7]={'$like':'%'+_0x3076b9['query']['filter']+'%'};return _0x29df24;})});}_0x2cb19a=_['merge']({},_0x2cb19a,_0x3076b9['options']);return _0x3ccaff[_0x0fbf('0x54')](_0x2cb19a);}})[_0x0fbf('0x24')](function(_0x40d9a7){if(_0x40d9a7){_0x42bc50=_0x40d9a7['length'];if(!_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x3a')](_0x0fbf('0x58'))){_0x2cb19a[_0x0fbf('0x1e')]=qs[_0x0fbf('0x1e')](_0x3076b9['query'][_0x0fbf('0x1e')]);_0x2cb19a[_0x0fbf('0x1c')]=qs['offset'](_0x3076b9[_0x0fbf('0x34')][_0x0fbf('0x1c')]);}return _0x3ccaff[_0x0fbf('0x54')](_0x2cb19a);}})[_0x0fbf('0x24')](function(_0x41b984){if(_0x41b984){return _0x41b984?{'count':_0x42bc50,'rows':_0x41b984}:null;}})['then'](respondWithResult(_0x4f2865,null))[_0x0fbf('0x45')](handleError(_0x4f2865,null));};exports[_0x0fbf('0x59')]=function(_0x47a0df,_0x21e657,_0x3f5a15){return db[_0x0fbf('0x2f')][_0x0fbf('0x55')]({'where':{'id':_0x47a0df[_0x0fbf('0x47')]['id']}})[_0x0fbf('0x24')](handleEntityNotFound(_0x21e657,null))[_0x0fbf('0x24')](function(_0x57dd3e){if(_0x57dd3e){return db['sequelize'][_0x0fbf('0x5a')](function(_0x48821d){return db['Interval'][_0x0fbf('0x28')]({'where':{'IntervalId':_0x47a0df[_0x0fbf('0x47')]['id']},'transaction':_0x48821d})['then'](function(_0x25961b){var _0x3835ff=_['map'](_0x47a0df[_0x0fbf('0x4c')],function(_0x3ac306){delete _0x3ac306['id'];_0x3ac306[_0x0fbf('0x53')]=_0x47a0df[_0x0fbf('0x47')]['id'];return _0x3ac306;});return db['Interval'][_0x0fbf('0x5b')](_0x3835ff,{'transaction':_0x48821d});});})['then'](function(){return db[_0x0fbf('0x2f')][_0x0fbf('0x43')]({'where':{'IntervalId':_0x47a0df[_0x0fbf('0x47')]['id']}});});}})[_0x0fbf('0x24')](respondWithResult(_0x21e657,null))[_0x0fbf('0x45')](handleError(_0x21e657,null));};
\ No newline at end of file
+var _0x2c11=['hasOwnProperty','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','order','nolimit','addIntervals','transaction','bulkCreate','findAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','Intervals','then','name','send','map','Interval','rawAttributes','fieldName','type','query','model','attributes','intersection','fields','length'];(function(_0x2a1f5c,_0x49b13f){var _0x43ce3d=function(_0x66f0bd){while(--_0x66f0bd){_0x2a1f5c['push'](_0x2a1f5c['shift']());}};_0x43ce3d(++_0x49b13f);}(_0x2c11,0xd2));var _0x12c1=function(_0x306106,_0x7dc50d){_0x306106=_0x306106-0x0;var _0x4d6083=_0x2c11[_0x306106];return _0x4d6083;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x12c1('0x0'));var zipdir=require(_0x12c1('0x1'));var jsonpatch=require(_0x12c1('0x2'));var rp=require(_0x12c1('0x3'));var moment=require(_0x12c1('0x4'));var BPromise=require(_0x12c1('0x5'));var Mustache=require('mustache');var util=require(_0x12c1('0x6'));var path=require('path');var sox=require(_0x12c1('0x7'));var csv=require(_0x12c1('0x8'));var ejs=require(_0x12c1('0x9'));var fs=require('fs');var fs_extra=require(_0x12c1('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x12c1('0xb'));var jsforce=require(_0x12c1('0xc'));var deskjs=require(_0x12c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x12c1('0xe'));var Papa=require(_0x12c1('0xf'));var Redis=require('ioredis');var authService=require(_0x12c1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x12c1('0x11'));var hardwareService=require(_0x12c1('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x12c1('0x13'));var licenseUtil=require(_0x12c1('0x14'));var db=require(_0x12c1('0x15'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x1ad8f6,_0x516377){_0x516377=_0x516377||0xcc;return function(_0x34ff8d){if(_0x34ff8d){return _0x1ad8f6[_0x12c1('0x16')](_0x516377);}return _0x1ad8f6[_0x12c1('0x17')](_0x516377)[_0x12c1('0x18')]();};}function respondWithResult(_0xa85b81,_0x7b1888){_0x7b1888=_0x7b1888||0xc8;return function(_0x43d514){if(_0x43d514){return _0xa85b81[_0x12c1('0x17')](_0x7b1888)[_0x12c1('0x19')](_0x43d514);}};}function respondWithFilteredResult(_0x13ed22,_0x3a3d7d){return function(_0x453f7b){if(_0x453f7b){var _0x192897=typeof _0x3a3d7d[_0x12c1('0x1a')]===_0x12c1('0x1b')&&typeof _0x3a3d7d[_0x12c1('0x1c')]===_0x12c1('0x1b');var _0x2b537b=_0x453f7b[_0x12c1('0x1d')];var _0x5bad03=_0x192897?0x0:_0x3a3d7d[_0x12c1('0x1a')];var _0x270670=_0x192897?_0x453f7b[_0x12c1('0x1d')]:_0x3a3d7d[_0x12c1('0x1a')]+_0x3a3d7d['limit'];var _0x55ac9c;if(_0x270670>=_0x2b537b){_0x270670=_0x2b537b;_0x55ac9c=0xc8;}else{_0x55ac9c=0xce;}_0x13ed22['status'](_0x55ac9c);return _0x13ed22[_0x12c1('0x1e')](_0x12c1('0x1f'),_0x5bad03+'-'+_0x270670+'/'+_0x2b537b)[_0x12c1('0x19')](_0x453f7b);}return null;};}function patchUpdates(_0x3630ea){return function(_0x3268c2){try{jsonpatch['apply'](_0x3268c2,_0x3630ea,!![]);}catch(_0x29e007){return BPromise[_0x12c1('0x20')](_0x29e007);}return _0x3268c2[_0x12c1('0x21')]();};}function saveUpdates(_0x22ae29,_0x5885d2){return function(_0x836082){if(_0x836082){return _0x836082[_0x12c1('0x22')](_0x22ae29)['then'](function(_0x207c9e){return _0x207c9e;});}return null;};}function removeEntity(_0x3bd7af,_0x5e0114){return function(_0x175b22){if(_0x175b22){return _0x175b22[_0x12c1('0x23')]()['then'](function(){var _0x4292a4=_0x175b22['get']({'plain':!![]});var _0x2d0436=_0x12c1('0x24');return db['UserProfileResource'][_0x12c1('0x23')]({'where':{'type':_0x2d0436,'resourceId':_0x4292a4['id']}})[_0x12c1('0x25')](function(){return _0x175b22;});})[_0x12c1('0x25')](function(){_0x3bd7af[_0x12c1('0x17')](0xcc)[_0x12c1('0x18')]();});}};}function handleEntityNotFound(_0x4e0fda,_0x8d778c){return function(_0x5edc80){if(!_0x5edc80){_0x4e0fda[_0x12c1('0x16')](0x194);}return _0x5edc80;};}function handleError(_0x46497d,_0x411862){_0x411862=_0x411862||0x1f4;return function(_0x1623a5){logger['error'](_0x1623a5['stack']);if(_0x1623a5[_0x12c1('0x26')]){delete _0x1623a5[_0x12c1('0x26')];}_0x46497d[_0x12c1('0x17')](_0x411862)[_0x12c1('0x27')](_0x1623a5);};}exports['index']=function(_0x118f70,_0x8eb76c){var _0x1d4dfa={},_0x12a721={},_0x5b5fe7={'count':0x0,'rows':[]};var _0x2cd57e=_[_0x12c1('0x28')](db[_0x12c1('0x29')][_0x12c1('0x2a')],function(_0x316c2e){return{'name':_0x316c2e[_0x12c1('0x2b')],'type':_0x316c2e[_0x12c1('0x2c')]['key']};});_0x12a721['model']=_[_0x12c1('0x28')](_0x2cd57e,_0x12c1('0x26'));_0x12a721[_0x12c1('0x2d')]=_['keys'](_0x118f70['query']);_0x12a721['filters']=_['intersection'](_0x12a721[_0x12c1('0x2e')],_0x12a721[_0x12c1('0x2d')]);_0x1d4dfa[_0x12c1('0x2f')]=_[_0x12c1('0x30')](_0x12a721['model'],qs[_0x12c1('0x31')](_0x118f70[_0x12c1('0x2d')][_0x12c1('0x31')]));_0x1d4dfa['attributes']=_0x1d4dfa[_0x12c1('0x2f')][_0x12c1('0x32')]?_0x1d4dfa[_0x12c1('0x2f')]:_0x12a721[_0x12c1('0x2e')];if(!_0x118f70['query'][_0x12c1('0x33')]('nolimit')){_0x1d4dfa['limit']=qs[_0x12c1('0x1c')](_0x118f70[_0x12c1('0x2d')]['limit']);_0x1d4dfa[_0x12c1('0x1a')]=qs[_0x12c1('0x1a')](_0x118f70['query'][_0x12c1('0x1a')]);}_0x1d4dfa['order']=qs[_0x12c1('0x34')](_0x118f70[_0x12c1('0x2d')][_0x12c1('0x34')]);_0x1d4dfa[_0x12c1('0x35')]=qs[_0x12c1('0x36')](_['pick'](_0x118f70['query'],_0x12a721[_0x12c1('0x36')]),_0x2cd57e);if(_0x118f70['query'][_0x12c1('0x37')]){_0x1d4dfa[_0x12c1('0x35')]=_[_0x12c1('0x38')](_0x1d4dfa[_0x12c1('0x35')],{'$or':_[_0x12c1('0x28')](_0x2cd57e,function(_0x1b7c99){if(_0x1b7c99['type']!=='VIRTUAL'){var _0x4e012b={};_0x4e012b[_0x1b7c99[_0x12c1('0x26')]]={'$like':'%'+_0x118f70[_0x12c1('0x2d')][_0x12c1('0x37')]+'%'};return _0x4e012b;}})});}_0x1d4dfa=_[_0x12c1('0x38')]({},_0x1d4dfa,_0x118f70[_0x12c1('0x39')]);var _0x2d4e6b={'where':_0x1d4dfa[_0x12c1('0x35')]};return db[_0x12c1('0x29')][_0x12c1('0x1d')](_0x2d4e6b)[_0x12c1('0x25')](function(_0x581689){_0x5b5fe7[_0x12c1('0x1d')]=_0x581689;if(_0x118f70['query'][_0x12c1('0x3a')]){_0x1d4dfa[_0x12c1('0x3b')]=[{'all':!![]}];}return db[_0x12c1('0x29')]['findAll'](_0x1d4dfa);})[_0x12c1('0x25')](function(_0x259ed5){_0x5b5fe7[_0x12c1('0x3c')]=_0x259ed5;return _0x5b5fe7;})[_0x12c1('0x25')](respondWithFilteredResult(_0x8eb76c,_0x1d4dfa))[_0x12c1('0x3d')](handleError(_0x8eb76c,null));};exports[_0x12c1('0x3e')]=function(_0x56b4ce,_0x5d210c){var _0x5485a2={'raw':!![],'where':{'id':_0x56b4ce[_0x12c1('0x3f')]['id']}},_0x281bd8={};_0x281bd8[_0x12c1('0x2e')]=_[_0x12c1('0x40')](db['Interval']['rawAttributes']);_0x281bd8['query']=_[_0x12c1('0x40')](_0x56b4ce[_0x12c1('0x2d')]);_0x281bd8['filters']=_[_0x12c1('0x30')](_0x281bd8[_0x12c1('0x2e')],_0x281bd8[_0x12c1('0x2d')]);_0x5485a2[_0x12c1('0x2f')]=_[_0x12c1('0x30')](_0x281bd8['model'],qs[_0x12c1('0x31')](_0x56b4ce[_0x12c1('0x2d')][_0x12c1('0x31')]));_0x5485a2[_0x12c1('0x2f')]=_0x5485a2[_0x12c1('0x2f')][_0x12c1('0x32')]?_0x5485a2[_0x12c1('0x2f')]:_0x281bd8[_0x12c1('0x2e')];if(_0x56b4ce[_0x12c1('0x2d')]['includeAll']){_0x5485a2[_0x12c1('0x3b')]=[{'all':!![]}];}_0x5485a2=_[_0x12c1('0x38')]({},_0x5485a2,_0x56b4ce[_0x12c1('0x39')]);return db[_0x12c1('0x29')][_0x12c1('0x41')](_0x5485a2)[_0x12c1('0x25')](handleEntityNotFound(_0x5d210c,null))[_0x12c1('0x25')](respondWithResult(_0x5d210c,null))['catch'](handleError(_0x5d210c,null));};exports[_0x12c1('0x42')]=function(_0x3fdf90,_0x299c6a){return db[_0x12c1('0x29')][_0x12c1('0x42')](_0x3fdf90[_0x12c1('0x43')],{})[_0x12c1('0x25')](function(_0x1afe94){var _0x596e93=_0x3fdf90['user']['get']({'plain':!![]});if(!_0x596e93)throw new Error(_0x12c1('0x44'));if(_0x596e93[_0x12c1('0x45')]===_0x12c1('0x46')){var _0xff59d1=_0x1afe94[_0x12c1('0x47')]({'plain':!![]});var _0x13908e=_0x12c1('0x24');return db[_0x12c1('0x48')]['find']({'where':{'name':_0x13908e,'userProfileId':_0x596e93[_0x12c1('0x49')]},'raw':!![]})[_0x12c1('0x25')](function(_0x30cc6e){if(_0x30cc6e&&_0x30cc6e['autoAssociation']===0x0){return db[_0x12c1('0x4a')]['create']({'name':_0xff59d1['name'],'resourceId':_0xff59d1['id'],'type':_0x30cc6e[_0x12c1('0x26')],'sectionId':_0x30cc6e['id']},{})[_0x12c1('0x25')](function(){return _0x1afe94;});}else{return _0x1afe94;}})[_0x12c1('0x3d')](function(_0x4aa483){logger[_0x12c1('0x4b')](_0x12c1('0x4c'),_0x4aa483);throw _0x4aa483;});}return _0x1afe94;})[_0x12c1('0x25')](respondWithResult(_0x299c6a,0xc9))['catch'](handleError(_0x299c6a,null));};exports[_0x12c1('0x22')]=function(_0x14651e,_0x3b94c7){if(_0x14651e['body']['id']){delete _0x14651e[_0x12c1('0x43')]['id'];}return db[_0x12c1('0x29')][_0x12c1('0x41')]({'where':{'id':_0x14651e['params']['id']}})[_0x12c1('0x25')](handleEntityNotFound(_0x3b94c7,null))[_0x12c1('0x25')](saveUpdates(_0x14651e[_0x12c1('0x43')],null))[_0x12c1('0x25')](respondWithResult(_0x3b94c7,null))['catch'](handleError(_0x3b94c7,null));};exports[_0x12c1('0x23')]=function(_0x2b2864,_0x5c0fd4){return db[_0x12c1('0x29')][_0x12c1('0x41')]({'where':{'id':_0x2b2864[_0x12c1('0x3f')]['id']}})[_0x12c1('0x25')](handleEntityNotFound(_0x5c0fd4,null))[_0x12c1('0x25')](removeEntity(_0x5c0fd4,null))[_0x12c1('0x3d')](handleError(_0x5c0fd4,null));};exports[_0x12c1('0x4d')]=function(_0x14a257,_0x52c023,_0x1346e6){if(_0x14a257[_0x12c1('0x43')]['id']){delete _0x14a257['body']['id'];}return db[_0x12c1('0x29')]['find']({'where':{'id':_0x14a257[_0x12c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x52c023,null))[_0x12c1('0x25')](function(_0x4b0356){if(_0x4b0356){_0x14a257[_0x12c1('0x43')][_0x12c1('0x4e')]=_0x4b0356['id'];return db[_0x12c1('0x29')][_0x12c1('0x42')](_0x14a257[_0x12c1('0x43')]);}})[_0x12c1('0x25')](respondWithResult(_0x52c023,null))['catch'](handleError(_0x52c023,null));};exports[_0x12c1('0x4f')]=function(_0x2800ed,_0x7ac4b7,_0x437313){var _0x2ecd4f={};var _0x4b6171={};var _0x21fc9c;var _0x4cca65;return db[_0x12c1('0x29')][_0x12c1('0x50')]({'where':{'id':_0x2800ed[_0x12c1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7ac4b7,null))[_0x12c1('0x25')](function(_0x43b51a){if(_0x43b51a){_0x21fc9c=_0x43b51a;_0x4b6171[_0x12c1('0x2e')]=_[_0x12c1('0x40')](db[_0x12c1('0x29')][_0x12c1('0x2a')]);_0x4b6171['query']=_[_0x12c1('0x40')](_0x2800ed[_0x12c1('0x2d')]);_0x4b6171[_0x12c1('0x36')]=_['intersection'](_0x4b6171[_0x12c1('0x2e')],_0x4b6171[_0x12c1('0x2d')]);_0x2ecd4f[_0x12c1('0x2f')]=_[_0x12c1('0x30')](_0x4b6171[_0x12c1('0x2e')],qs['fields'](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x31')]));_0x2ecd4f[_0x12c1('0x2f')]=_0x2ecd4f['attributes'][_0x12c1('0x32')]?_0x2ecd4f[_0x12c1('0x2f')]:_0x4b6171['model'];_0x2ecd4f[_0x12c1('0x51')]=qs['sort'](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x34')]);_0x2ecd4f[_0x12c1('0x35')]=qs[_0x12c1('0x36')](_['pick'](_0x2800ed[_0x12c1('0x2d')],_0x4b6171[_0x12c1('0x36')]));if(_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x37')]){_0x2ecd4f['where']=_[_0x12c1('0x38')](_0x2ecd4f[_0x12c1('0x35')],{'$or':_[_0x12c1('0x28')](_0x2ecd4f[_0x12c1('0x2f')],function(_0x490db4){var _0x331f2b={};_0x331f2b[_0x490db4]={'$like':'%'+_0x2800ed['query']['filter']+'%'};return _0x331f2b;})});}_0x2ecd4f=_[_0x12c1('0x38')]({},_0x2ecd4f,_0x2800ed[_0x12c1('0x39')]);return _0x21fc9c[_0x12c1('0x4f')](_0x2ecd4f);}})[_0x12c1('0x25')](function(_0x1ad014){if(_0x1ad014){_0x4cca65=_0x1ad014[_0x12c1('0x32')];if(!_0x2800ed[_0x12c1('0x2d')]['hasOwnProperty'](_0x12c1('0x52'))){_0x2ecd4f[_0x12c1('0x1c')]=qs['limit'](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x1c')]);_0x2ecd4f[_0x12c1('0x1a')]=qs[_0x12c1('0x1a')](_0x2800ed[_0x12c1('0x2d')][_0x12c1('0x1a')]);}return _0x21fc9c[_0x12c1('0x4f')](_0x2ecd4f);}})[_0x12c1('0x25')](function(_0x3bebe1){if(_0x3bebe1){return _0x3bebe1?{'count':_0x4cca65,'rows':_0x3bebe1}:null;}})[_0x12c1('0x25')](respondWithResult(_0x7ac4b7,null))[_0x12c1('0x3d')](handleError(_0x7ac4b7,null));};exports[_0x12c1('0x53')]=function(_0x899bc1,_0xb89118,_0x3e3006){return db['Interval'][_0x12c1('0x50')]({'where':{'id':_0x899bc1[_0x12c1('0x3f')]['id']}})[_0x12c1('0x25')](handleEntityNotFound(_0xb89118,null))[_0x12c1('0x25')](function(_0x182558){if(_0x182558){return db['sequelize'][_0x12c1('0x54')](function(_0x57394c){return db[_0x12c1('0x29')]['destroy']({'where':{'IntervalId':_0x899bc1[_0x12c1('0x3f')]['id']},'transaction':_0x57394c})[_0x12c1('0x25')](function(_0x27fb12){var _0x48e493=_[_0x12c1('0x28')](_0x899bc1[_0x12c1('0x43')],function(_0x4f2115){delete _0x4f2115['id'];_0x4f2115[_0x12c1('0x4e')]=_0x899bc1[_0x12c1('0x3f')]['id'];return _0x4f2115;});return db[_0x12c1('0x29')][_0x12c1('0x55')](_0x48e493,{'transaction':_0x57394c});});})['then'](function(){return db[_0x12c1('0x29')][_0x12c1('0x56')]({'where':{'IntervalId':_0x899bc1[_0x12c1('0x3f')]['id']}});});}})[_0x12c1('0x25')](respondWithResult(_0xb89118,null))[_0x12c1('0x3d')](handleError(_0xb89118,null));};
\ No newline at end of file
index d06508e..d5f0369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x439a=['define','Interval','tools_intervals','rewrite','string','interval','getIntervals','then','all','reduce','iftime','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x439a,0x8e));var _0xa439=function(_0x124da8,_0x2f4adf){_0x124da8=_0x124da8-0x0;var _0x470b89=_0x439a[_0x124da8];return _0x470b89;};'use strict';var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');var iftime=require('../../utils/iftime')[_0xa439('0x0')];module[_0xa439('0x1')]=function(_0x1a435b){return _0x1a435b[_0xa439('0x2')](_0xa439('0x3'),attributes,{'tableName':_0xa439('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xaba966){extensions[_0xa439('0x5')](_0x1a435b,_0xaba966);},'afterBulkCreate':function(_0x315421,_0x152ab7,_0xa7c814){_0xa7c814();extensions['rewrite'](_0x1a435b,_0x315421[0x0]);},'afterUpdate':function(_0x3b9e5d){extensions[_0xa439('0x5')](_0x1a435b,_0x3b9e5d);},'afterDestroy':function(_0x5b5f40){extensions[_0xa439('0x5')](_0x1a435b,_0x5b5f40);}},'instanceMethods':{'ifTime':function(_0x7514a7=undefined,_0x14aa63=new Date()){if(typeof this['interval']===_0xa439('0x6')){return iftime(this[_0xa439('0x7')],_0x7514a7,_0x14aa63);}else{return this[_0xa439('0x8')]()[_0xa439('0x9')](function(_0x56e0ec){return Promise[_0xa439('0xa')](_0x56e0ec['map'](function(_0x131ec1){return _0x131ec1['ifTime'](_0x7514a7,_0x14aa63);}));})[_0xa439('0x9')](function(_0x2297b5){return _0x2297b5[_0xa439('0xb')](function(_0x2d5823,_0x2931c1){return _0x2d5823||_0x2931c1;},![]);});}}}});};
\ No newline at end of file
+var _0xa6a8=['tools_intervals','rewrite','interval','string','getIntervals','then','all','map','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','exports','Interval'];(function(_0x116415,_0x51b04c){var _0x196009=function(_0x34a8f3){while(--_0x34a8f3){_0x116415['push'](_0x116415['shift']());}};_0x196009(++_0x51b04c);}(_0xa6a8,0xc0));var _0x8a6a=function(_0x372f43,_0x49e943){_0x372f43=_0x372f43-0x0;var _0x1eec4c=_0xa6a8[_0x372f43];return _0x1eec4c;};'use strict';var attributes=require(_0x8a6a('0x0'));var extensions=require(_0x8a6a('0x1'));var iftime=require('../../utils/iftime')['iftime'];module[_0x8a6a('0x2')]=function(_0x35d93f){return _0x35d93f['define'](_0x8a6a('0x3'),attributes,{'tableName':_0x8a6a('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5f0d35){extensions['rewrite'](_0x35d93f,_0x5f0d35);},'afterBulkCreate':function(_0x248946,_0xcd065c,_0x5b3a92){_0x5b3a92();extensions[_0x8a6a('0x5')](_0x35d93f,_0x248946[0x0]);},'afterUpdate':function(_0x1888f){extensions[_0x8a6a('0x5')](_0x35d93f,_0x1888f);},'afterDestroy':function(_0x5ce0be){extensions['rewrite'](_0x35d93f,_0x5ce0be);}},'instanceMethods':{'ifTime':function(_0xb069e7=undefined,_0x3aa150=new Date()){if(typeof this[_0x8a6a('0x6')]===_0x8a6a('0x7')){return iftime(this[_0x8a6a('0x6')],_0xb069e7,_0x3aa150);}else{return this[_0x8a6a('0x8')]()[_0x8a6a('0x9')](function(_0x29bd0e){return Promise[_0x8a6a('0xa')](_0x29bd0e[_0x8a6a('0xb')](function(_0x1b9c44){return _0x1b9c44[_0x8a6a('0xc')](_0xb069e7,_0x3aa150);}));})['then'](function(_0x12d0dc){return _0x12d0dc[_0x8a6a('0xd')](function(_0x48f86f,_0x4bfd51){return _0x48f86f||_0x4bfd51;},![]);});}}}});};
\ No newline at end of file
index 503726f..9baa8cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc20b=['error','message','ShowInterval','find','findAll','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','IntervalIftime','lodash','util','../../mysqldb','../../utils/iftime','../../config/logger','GetInterval','Interval','options','raw','where','attributes','limit','map','include','model','then','info','debug','stringify','catch'];(function(_0x2417f9,_0x803ba4){var _0x142d82=function(_0xd430d1){while(--_0xd430d1){_0x2417f9['push'](_0x2417f9['shift']());}};_0x142d82(++_0x803ba4);}(_0xc20b,0x19a));var _0xbc20=function(_0x416e13,_0x42c655){_0x416e13=_0x416e13-0x0;var _0x1386f3=_0xc20b[_0x416e13];return _0x1386f3;};'use strict';var _=require(_0xbc20('0x0'));var util=require(_0xbc20('0x1'));var db=require(_0xbc20('0x2'))['db'];var iftime=require(_0xbc20('0x3'))['iftime'];var logger=require(_0xbc20('0x4'))('rpc');exports[_0xbc20('0x5')]=function(_0x102161){var _0x53a607=this;return new Promise(function(_0x24c9a8,_0x3b8420){return db[_0xbc20('0x6')]['findAll']({'raw':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')][_0xbc20('0x8')]===undefined?!![]:![]:!![],'where':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')][_0xbc20('0x9')]||null:null,'attributes':_0x102161[_0xbc20('0x7')]?_0x102161['options'][_0xbc20('0xa')]||null:null,'limit':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')][_0xbc20('0xb')]||null:null,'include':_0x102161[_0xbc20('0x7')]?_0x102161[_0xbc20('0x7')]['include']?_[_0xbc20('0xc')](_0x102161[_0xbc20('0x7')][_0xbc20('0xd')],function(_0xfc3de4){return{'model':db[_0xfc3de4[_0xbc20('0xe')]],'as':_0xfc3de4['as'],'attributes':_0xfc3de4['attributes'],'include':_0xfc3de4[_0xbc20('0xd')]?_[_0xbc20('0xc')](_0xfc3de4['include'],function(_0x453c6e){return{'model':db[_0x453c6e[_0xbc20('0xe')]],'as':_0x453c6e['as'],'attributes':_0x453c6e[_0xbc20('0xa')],'include':_0x453c6e[_0xbc20('0xd')]?_['map'](_0x453c6e[_0xbc20('0xd')],function(_0x5e3775){return{'model':db[_0x5e3775[_0xbc20('0xe')]],'as':_0x5e3775['as'],'attributes':_0x5e3775[_0xbc20('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbc20('0xf')](function(_0x4b0a17){logger[_0xbc20('0x10')](_0xbc20('0x5'),_0x102161);logger[_0xbc20('0x11')](_0xbc20('0x5'),_0x102161,JSON[_0xbc20('0x12')](_0x4b0a17));_0x24c9a8(_0x4b0a17);})[_0xbc20('0x13')](function(_0x9f547b){logger[_0xbc20('0x14')](_0xbc20('0x5'),_0x9f547b[_0xbc20('0x15')],_0x102161);_0x3b8420(_0x53a607['error'](0x1f4,_0x9f547b[_0xbc20('0x15')]));});});};exports[_0xbc20('0x16')]=function(_0x2e0e92){var _0x5084f8=this;return new Promise(function(_0x44f5f3,_0x5099c5){return db[_0xbc20('0x6')][_0xbc20('0x17')]({'raw':_0x2e0e92[_0xbc20('0x7')]?_0x2e0e92['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e0e92[_0xbc20('0x7')]?_0x2e0e92[_0xbc20('0x7')][_0xbc20('0x9')]||null:null,'attributes':_0x2e0e92[_0xbc20('0x7')]?_0x2e0e92[_0xbc20('0x7')][_0xbc20('0xa')]||null:null,'include':_0x2e0e92['options']?_0x2e0e92[_0xbc20('0x7')][_0xbc20('0xd')]?_['map'](_0x2e0e92[_0xbc20('0x7')][_0xbc20('0xd')],function(_0x491eec){return{'model':db[_0x491eec['model']],'as':_0x491eec['as'],'attributes':_0x491eec[_0xbc20('0xa')],'include':_0x491eec[_0xbc20('0xd')]?_['map'](_0x491eec[_0xbc20('0xd')],function(_0x1208e2){return{'model':db[_0x1208e2[_0xbc20('0xe')]],'as':_0x1208e2['as'],'attributes':_0x1208e2[_0xbc20('0xa')],'include':_0x1208e2[_0xbc20('0xd')]?_[_0xbc20('0xc')](_0x1208e2[_0xbc20('0xd')],function(_0x30279d){return{'model':db[_0x30279d['model']],'as':_0x30279d['as'],'attributes':_0x30279d[_0xbc20('0xa')]};}):[]};}):[]};}):[]:[]})[_0xbc20('0xf')](function(_0x31040d){logger['info'](_0xbc20('0x16'),_0x2e0e92);logger[_0xbc20('0x11')](_0xbc20('0x16'),_0x2e0e92,JSON[_0xbc20('0x12')](_0x31040d));_0x44f5f3(_0x31040d);})[_0xbc20('0x13')](function(_0x1068a8){logger[_0xbc20('0x14')](_0xbc20('0x16'),_0x1068a8[_0xbc20('0x15')],_0x2e0e92);_0x5099c5(_0x5084f8['error'](0x1f4,_0x1068a8[_0xbc20('0x15')]));});});};function checkArrayOfIntervals(_0x425524,_0x37f55b){var _0x2b2922=[];return db['Interval'][_0xbc20('0x18')]({'where':{'id':_0x425524}})['then'](function(_0xe6fb75){_0x2b2922=_0xe6fb75;return Promise[_0xbc20('0x19')](_0x2b2922[_0xbc20('0xc')](function(_0x45c70d){return _0x45c70d['ifTime'](_0x37f55b);}));})['then'](function(_0x3976ef){var _0x554b1d=_0x3976ef[_0xbc20('0x1a')](function(_0x55df96,_0x48064f){return _0x55df96||_0x48064f;},![]);logger[_0xbc20('0x10')](util[_0xbc20('0x1b')](_0xbc20('0x1c'),_0x2b2922[_0xbc20('0xc')](function(_0xb17ef2){return _0xb17ef2[_0xbc20('0x1d')];})['join'](',\x20'),_0x2b2922[_0xbc20('0xc')](function(_0x49753f){return _0x49753f['id'];})[_0xbc20('0x1e')](',\x20')));return _0x554b1d;});}function checkSingleInterval(_0x544601,_0x4e07ca){return db[_0xbc20('0x6')]['findById'](_0x544601)['then'](function(_0x4e6a5d){if(_0x4e6a5d){logger['info'](util[_0xbc20('0x1b')](_0xbc20('0x1f'),_0x4e6a5d[_0xbc20('0x1d')],_0x4e6a5d['id']));return _0x4e6a5d[_0xbc20('0x20')](_0x4e07ca);}});}exports['IntervalIftime']=function(_0xe424d){var _0x22dca4=_0xe424d[_0xbc20('0x21')];var _0x586429=Array[_0xbc20('0x22')](_0xe424d['intervals'])?_0xe424d['intervals']:typeof _0xe424d[_0xbc20('0x23')]===_0xbc20('0x24')?[_0xe424d['intervals']]:[];var _0x49379b=_0xe424d[_0xbc20('0x25')]||undefined;var _0x54748c=![];if(_0x586429[_0xbc20('0x26')]){logger['info'](util['format'](_0xbc20('0x27'),_0x586429[_0xbc20('0x1e')](';\x20')));}if(_0x49379b){logger[_0xbc20('0x10')](util[_0xbc20('0x1b')](_0xbc20('0x28'),_0x49379b));}logger['debug']('Iftime',_0x54748c);logger[_0xbc20('0x29')](_0xbc20('0x2a'),_0xe424d);return Promise['resolve']()[_0xbc20('0xf')](function(){if(Array[_0xbc20('0x22')](_0x22dca4)){return checkArrayOfIntervals(_0x22dca4,_0x49379b);}else if(_0x22dca4){return checkSingleInterval(_0x22dca4,_0x49379b);}})[_0xbc20('0xf')](function(_0xce4b3f){var _0x1705dd=_0x586429[_0xbc20('0x1a')](function(_0xdf9ece,_0x2cf2f5){return _0xdf9ece||iftime(_0x2cf2f5,_0x49379b);},![]);_0x54748c=_0xce4b3f||_0x1705dd;return _0x54748c;})[_0xbc20('0x13')](function(_0x1ac5fd){logger[_0xbc20('0x14')](_0xbc20('0x2a'),_0xe424d,_0x1ac5fd);throw this[_0xbc20('0x14')](0x1f4,_0x1ac5fd['message']);});};
\ No newline at end of file
+var _0xa0f1=['timezone','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','resolve','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','attributes','limit','include','model','map','debug','stringify','catch','message','error','find','then','info','ShowInterval','all','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','ifTime','IntervalIftime','isArray','intervals','string'];(function(_0x169600,_0x1d1346){var _0x3bee22=function(_0x19639b){while(--_0x19639b){_0x169600['push'](_0x169600['shift']());}};_0x3bee22(++_0x1d1346);}(_0xa0f1,0x1d2));var _0x1a0f=function(_0x41ffd9,_0x1c8414){_0x41ffd9=_0x41ffd9-0x0;var _0x225e4c=_0xa0f1[_0x41ffd9];return _0x225e4c;};'use strict';var _=require(_0x1a0f('0x0'));var util=require(_0x1a0f('0x1'));var db=require(_0x1a0f('0x2'))['db'];var iftime=require(_0x1a0f('0x3'))[_0x1a0f('0x4')];var logger=require(_0x1a0f('0x5'))(_0x1a0f('0x6'));exports[_0x1a0f('0x7')]=function(_0x571dd4){var _0x595714=this;return new Promise(function(_0x4aa751,_0x29bfac){return db[_0x1a0f('0x8')][_0x1a0f('0x9')]({'raw':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xb')]===undefined?!![]:![]:!![],'where':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4['options'][_0x1a0f('0xc')]||null:null,'attributes':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xd')]||null:null,'limit':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xe')]||null:null,'include':_0x571dd4[_0x1a0f('0xa')]?_0x571dd4['options'][_0x1a0f('0xf')]?_['map'](_0x571dd4[_0x1a0f('0xa')][_0x1a0f('0xf')],function(_0x302e23){return{'model':db[_0x302e23[_0x1a0f('0x10')]],'as':_0x302e23['as'],'attributes':_0x302e23[_0x1a0f('0xd')],'include':_0x302e23[_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0x302e23[_0x1a0f('0xf')],function(_0x4f6ad4){return{'model':db[_0x4f6ad4[_0x1a0f('0x10')]],'as':_0x4f6ad4['as'],'attributes':_0x4f6ad4[_0x1a0f('0xd')],'include':_0x4f6ad4[_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0x4f6ad4[_0x1a0f('0xf')],function(_0x1e35bf){return{'model':db[_0x1e35bf['model']],'as':_0x1e35bf['as'],'attributes':_0x1e35bf[_0x1a0f('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30c5f4){logger['info']('GetInterval',_0x571dd4);logger[_0x1a0f('0x12')]('GetInterval',_0x571dd4,JSON[_0x1a0f('0x13')](_0x30c5f4));_0x4aa751(_0x30c5f4);})[_0x1a0f('0x14')](function(_0xf39655){logger['error'](_0x1a0f('0x7'),_0xf39655[_0x1a0f('0x15')],_0x571dd4);_0x29bfac(_0x595714[_0x1a0f('0x16')](0x1f4,_0xf39655[_0x1a0f('0x15')]));});});};exports['ShowInterval']=function(_0x1c3d41){var _0x39a296=this;return new Promise(function(_0x5943ac,_0xa50141){return db[_0x1a0f('0x8')][_0x1a0f('0x17')]({'raw':_0x1c3d41['options']?_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xb')]===undefined?!![]:![]:!![],'where':_0x1c3d41[_0x1a0f('0xa')]?_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xc')]||null:null,'attributes':_0x1c3d41[_0x1a0f('0xa')]?_0x1c3d41[_0x1a0f('0xa')]['attributes']||null:null,'include':_0x1c3d41['options']?_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0x1c3d41[_0x1a0f('0xa')][_0x1a0f('0xf')],function(_0x1efb27){return{'model':db[_0x1efb27['model']],'as':_0x1efb27['as'],'attributes':_0x1efb27['attributes'],'include':_0x1efb27['include']?_['map'](_0x1efb27[_0x1a0f('0xf')],function(_0xea5f2e){return{'model':db[_0xea5f2e[_0x1a0f('0x10')]],'as':_0xea5f2e['as'],'attributes':_0xea5f2e[_0x1a0f('0xd')],'include':_0xea5f2e[_0x1a0f('0xf')]?_[_0x1a0f('0x11')](_0xea5f2e['include'],function(_0x46f738){return{'model':db[_0x46f738[_0x1a0f('0x10')]],'as':_0x46f738['as'],'attributes':_0x46f738['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a0f('0x18')](function(_0x3c2b14){logger[_0x1a0f('0x19')](_0x1a0f('0x1a'),_0x1c3d41);logger[_0x1a0f('0x12')](_0x1a0f('0x1a'),_0x1c3d41,JSON[_0x1a0f('0x13')](_0x3c2b14));_0x5943ac(_0x3c2b14);})['catch'](function(_0x11704d){logger['error']('ShowInterval',_0x11704d[_0x1a0f('0x15')],_0x1c3d41);_0xa50141(_0x39a296[_0x1a0f('0x16')](0x1f4,_0x11704d[_0x1a0f('0x15')]));});});};function checkArrayOfIntervals(_0x36a2a3,_0x37a0e5){var _0x2bc1ba=[];return db[_0x1a0f('0x8')][_0x1a0f('0x9')]({'where':{'id':_0x36a2a3}})['then'](function(_0xf75c2d){_0x2bc1ba=_0xf75c2d;return Promise[_0x1a0f('0x1b')](_0x2bc1ba[_0x1a0f('0x11')](function(_0x382e05){return _0x382e05['ifTime'](_0x37a0e5);}));})[_0x1a0f('0x18')](function(_0x21cefa){var _0x44b153=_0x21cefa[_0x1a0f('0x1c')](function(_0x3c003f,_0x3d0ea7){return _0x3c003f||_0x3d0ea7;},![]);logger['info'](util[_0x1a0f('0x1d')](_0x1a0f('0x1e'),_0x2bc1ba[_0x1a0f('0x11')](function(_0x5e6824){return _0x5e6824[_0x1a0f('0x1f')];})['join'](',\x20'),_0x2bc1ba[_0x1a0f('0x11')](function(_0x3e6587){return _0x3e6587['id'];})[_0x1a0f('0x20')](',\x20')));return _0x44b153;});}function checkSingleInterval(_0x273a45,_0x23cac4){return db[_0x1a0f('0x8')][_0x1a0f('0x21')](_0x273a45)['then'](function(_0x538cd1){if(_0x538cd1){logger['info'](util[_0x1a0f('0x1d')](_0x1a0f('0x22'),_0x538cd1[_0x1a0f('0x1f')],_0x538cd1['id']));return _0x538cd1[_0x1a0f('0x23')](_0x23cac4);}});}exports[_0x1a0f('0x24')]=function(_0x41e944){var _0x2fd99f=_0x41e944['intervalIds'];var _0x9c0b45=Array[_0x1a0f('0x25')](_0x41e944[_0x1a0f('0x26')])?_0x41e944[_0x1a0f('0x26')]:typeof _0x41e944[_0x1a0f('0x26')]===_0x1a0f('0x27')?[_0x41e944['intervals']]:[];var _0x122add=_0x41e944[_0x1a0f('0x28')]||undefined;var _0x17eec2=![];if(_0x9c0b45['length']){logger[_0x1a0f('0x19')](util[_0x1a0f('0x1d')](_0x1a0f('0x29'),_0x9c0b45['join'](';\x20')));}if(_0x122add){logger[_0x1a0f('0x19')](util[_0x1a0f('0x1d')](_0x1a0f('0x2a'),_0x122add));}logger[_0x1a0f('0x12')](_0x1a0f('0x2b'),_0x17eec2);logger[_0x1a0f('0x2c')](_0x1a0f('0x24'),_0x41e944);return Promise[_0x1a0f('0x2d')]()[_0x1a0f('0x18')](function(){if(Array['isArray'](_0x2fd99f)){return checkArrayOfIntervals(_0x2fd99f,_0x122add);}else if(_0x2fd99f){return checkSingleInterval(_0x2fd99f,_0x122add);}})[_0x1a0f('0x18')](function(_0x190632){var _0x826ed5=_0x9c0b45[_0x1a0f('0x1c')](function(_0x12aae1,_0x29cd44){return _0x12aae1||iftime(_0x29cd44,_0x122add);},![]);_0x17eec2=_0x190632||_0x826ed5;return _0x17eec2;})[_0x1a0f('0x14')](function(_0x4ca67c){logger[_0x1a0f('0x16')](_0x1a0f('0x24'),_0x41e944,_0x4ca67c);throw this[_0x1a0f('0x16')](0x1f4,_0x4ca67c[_0x1a0f('0x15')]);});};
\ No newline at end of file
index 0b9229f..9bd10cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x2644f8,_0x40977c){var _0x233fea=function(_0x308f49){while(--_0x308f49){_0x2644f8['push'](_0x2644f8['shift']());}};_0x233fea(++_0x40977c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xff28cc,_0x2f80b8){_0xff28cc=_0xff28cc-0x0;var _0x43d801=_0x5f2f[_0xff28cc];return _0x43d801;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router;
\ No newline at end of file
+var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x404d98,_0x362ba9){var _0x4c3664=function(_0x9cfe64){while(--_0x9cfe64){_0x404d98['push'](_0x404d98['shift']());}};_0x4c3664(++_0x362ba9);}(_0xadb5,0xad));var _0x5adb=function(_0x461c72,_0x566f9f){_0x461c72=_0x461c72-0x0;var _0x53a747=_0xadb5[_0x461c72];return _0x53a747;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
index 5bd013c..23a406d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0273=['customfield_10102','POST','application/json','Basic\x20','toString','base64','stringify','request','utf8','data','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','MOTGUI','Report','\x20from\x20','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504'];(function(_0x802ff7,_0x3ca9cc){var _0xa81f15=function(_0x3429fc){while(--_0x3429fc){_0x802ff7['push'](_0x802ff7['shift']());}};_0xa81f15(++_0x3ca9cc);}(_0x0273,0xe9));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3027('0x0'));var https=require(_0x3027('0x1'));var logger=require(_0x3027('0x2'))(_0x3027('0x3'));var USERNAME=_0x3027('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x56ba95,_0x600cd1){var _0x2b44f3={'fields':{'project':{'key':_0x56ba95['key']||_0x3027('0x5')},'summary':(_0x56ba95['summary']||_0x3027('0x6'))+_0x3027('0x7')+_0x56ba95['ip'],'description':_0x56ba95['description']||JSON['stringify'](_0x56ba95),'issuetype':{'name':_0x56ba95[_0x3027('0x8')]||_0x3027('0x9')}}};_0x2b44f3[_0x3027('0xa')][_0x3027('0xb')]=_0x56ba95[_0x3027('0xc')];_0x2b44f3['fields'][_0x3027('0xd')]=_0x56ba95[_0x3027('0xe')];_0x2b44f3[_0x3027('0xa')]['customfield_11502']=_0x56ba95[_0x3027('0xf')];_0x2b44f3[_0x3027('0xa')][_0x3027('0x10')]=_0x56ba95[_0x3027('0x11')];_0x2b44f3[_0x3027('0xa')][_0x3027('0x12')]=_0x56ba95['reason'];_0x2b44f3[_0x3027('0xa')][_0x3027('0x13')]=_0x56ba95['ip'];var _0x1d9972={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x3027('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x3027('0x15'),'Authorization':_0x3027('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x3027('0x17')](_0x3027('0x18'))}};var _0x459763=JSON[_0x3027('0x19')](_0x2b44f3);var _0x4fd1bd=https[_0x3027('0x1a')](_0x1d9972,function(_0x81eebe){_0x81eebe['setEncoding'](_0x3027('0x1b'));var _0x1fb50e='';_0x81eebe['on'](_0x3027('0x1c'),function(_0x97a4ba){_0x1fb50e+=_0x97a4ba;});_0x81eebe['on'](_0x3027('0x1d'),function(){if(_0x600cd1){return _0x600cd1['status'](_0x81eebe[_0x3027('0x1e')])[_0x3027('0x1f')](JSON['parse'](_0x1fb50e));}});});_0x4fd1bd['on']('error',function(_0x283d62){if(_0x600cd1){return _0x600cd1[_0x3027('0x20')](0x1f4)[_0x3027('0x1f')]({'errors':[{'message':_0x3027('0x21'),'type':_0x3027('0x22')}]});}});_0x4fd1bd[_0x3027('0x23')](_0x459763);_0x4fd1bd[_0x3027('0x1d')]();}exports[_0x3027('0x24')]=openIssue;exports[_0x3027('0x25')]=function(_0x4e6880,_0x366dd6){_0x4e6880[_0x3027('0x26')]['ip']=_0x4e6880['headers']['x-forwarded-for']||_0x4e6880['connection'][_0x3027('0x27')]||_0x4e6880[_0x3027('0x28')]['remoteAddress']||_0x4e6880[_0x3027('0x29')]['socket'][_0x3027('0x27')];return openIssue(_0x4e6880[_0x3027('0x26')],_0x366dd6);};
\ No newline at end of file
+var _0x9beb=['x-forwarded-for','connection','remoteAddress','bluebird','https','api','support','MOTGUI','\x20from\x20','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','stringify','setEncoding','utf8','statusCode','json','api.jira','write','end','body','headers'];(function(_0x2c692f,_0x25cab4){var _0x194ce3=function(_0x37c53f){while(--_0x37c53f){_0x2c692f['push'](_0x2c692f['shift']());}};_0x194ce3(++_0x25cab4);}(_0x9beb,0x106));var _0xb9be=function(_0x9eb20f,_0x4ff05f){_0x9eb20f=_0x9eb20f-0x0;var _0x300d18=_0x9beb[_0x9eb20f];return _0x300d18;};'use strict';var BPromise=require(_0xb9be('0x0'));var https=require(_0xb9be('0x1'));var logger=require('../../config/logger')(_0xb9be('0x2'));var USERNAME=_0xb9be('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x523750,_0x15ca1d){var _0x412f73={'fields':{'project':{'key':_0x523750['key']||_0xb9be('0x4')},'summary':(_0x523750['summary']||'Report')+_0xb9be('0x5')+_0x523750['ip'],'description':_0x523750['description']||JSON['stringify'](_0x523750),'issuetype':{'name':_0x523750['issuetype']||_0xb9be('0x6')}}};_0x412f73[_0xb9be('0x7')][_0xb9be('0x8')]=_0x523750[_0xb9be('0x9')];_0x412f73['fields'][_0xb9be('0xa')]=_0x523750[_0xb9be('0xb')];_0x412f73[_0xb9be('0x7')][_0xb9be('0xc')]=_0x523750[_0xb9be('0xd')];_0x412f73['fields'][_0xb9be('0xe')]=_0x523750[_0xb9be('0xf')];_0x412f73[_0xb9be('0x7')][_0xb9be('0x10')]=_0x523750[_0xb9be('0x11')];_0x412f73[_0xb9be('0x7')][_0xb9be('0x12')]=_0x523750['ip'];var _0x23e389={'host':_0xb9be('0x13'),'port':0x1bb,'path':_0xb9be('0x14'),'method':_0xb9be('0x15'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xb9be('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xb9be('0x17')]('base64')}};var _0x465664=JSON[_0xb9be('0x18')](_0x412f73);var _0x530bad=https['request'](_0x23e389,function(_0x18fccd){_0x18fccd[_0xb9be('0x19')](_0xb9be('0x1a'));var _0x4df305='';_0x18fccd['on']('data',function(_0xaa4d59){_0x4df305+=_0xaa4d59;});_0x18fccd['on']('end',function(){if(_0x15ca1d){return _0x15ca1d['status'](_0x18fccd[_0xb9be('0x1b')])[_0xb9be('0x1c')](JSON['parse'](_0x4df305));}});});_0x530bad['on']('error',function(_0x28827c){if(_0x15ca1d){return _0x15ca1d['status'](0x1f4)[_0xb9be('0x1c')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb9be('0x1d')}]});}});_0x530bad[_0xb9be('0x1e')](_0x465664);_0x530bad[_0xb9be('0x1f')]();}exports['openIssue']=openIssue;exports['send']=function(_0x178ca8,_0x23469e){_0x178ca8[_0xb9be('0x20')]['ip']=_0x178ca8[_0xb9be('0x21')][_0xb9be('0x22')]||_0x178ca8[_0xb9be('0x23')][_0xb9be('0x24')]||_0x178ca8['socket']['remoteAddress']||_0x178ca8[_0xb9be('0x23')]['socket']['remoteAddress'];return openIssue(_0x178ca8['body'],_0x23469e);};
\ No newline at end of file
index 98fe25e..9f28c40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x596921,_0x71146d){var _0x4b3ed0=function(_0x4c591c){while(--_0x4c591c){_0x596921['push'](_0x596921['shift']());}};_0x4b3ed0(++_0x71146d);}(_0x91a7,0xe7));var _0x791a=function(_0x4c2fcc,_0x3050fb){_0x4c2fcc=_0x4c2fcc-0x0;var _0x1e23fa=_0x91a7[_0x4c2fcc];return _0x1e23fa;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xa74f=['/describe','isAuthenticated','describe','show','post','put','/:id','update','delete','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','index','get'];(function(_0x47764b,_0x3bf238){var _0x10d86e=function(_0x51a5a1){while(--_0x51a5a1){_0x47764b['push'](_0x47764b['shift']());}};_0x10d86e(++_0x3bf238);}(_0xa74f,0x9a));var _0xfa74=function(_0x59d0cc,_0xa7c52b){_0x59d0cc=_0x59d0cc-0x0;var _0x2ae79f=_0xa74f[_0x59d0cc];return _0x2ae79f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0xc')]('/',auth[_0xfa74('0x9')](),controller['create']);router[_0xfa74('0xd')](_0xfa74('0xe'),auth['isAuthenticated'](),controller[_0xfa74('0xf')]);router[_0xfa74('0x10')](_0xfa74('0xe'),auth[_0xfa74('0x9')](),controller['destroy']);module[_0xfa74('0x11')]=router;
\ No newline at end of file
index 5f2d6ae..9162bd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x7a54,0x106));var _0x47a5=function(_0x1a5bb8,_0x46d858){_0x1a5bb8=_0x1a5bb8-0x0;var _0x4ab559=_0x7a54[_0x1a5bb8];return _0x4ab559;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7a54,0x106));var _0x47a5=function(_0x10945b,_0x535fbc){_0x10945b=_0x10945b-0x0;var _0x25ed9f=_0x7a54[_0x10945b];return _0x25ed9f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 8cad8e2..b02b8c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22da=['sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x22da,0x80));var _0xa22d=function(_0x3bc530,_0xf2338c){_0x3bc530=_0x3bc530-0x0;var _0x2b7382=_0x22da[_0x3bc530];return _0x2b7382;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa22d('0x0'));var jsonpatch=require(_0xa22d('0x1'));var rp=require(_0xa22d('0x2'));var moment=require(_0xa22d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa22d('0x4'));var util=require(_0xa22d('0x5'));var path=require(_0xa22d('0x6'));var sox=require(_0xa22d('0x7'));var csv=require('to-csv');var ejs=require(_0xa22d('0x8'));var fs=require('fs');var fs_extra=require(_0xa22d('0x9'));var _=require('lodash');var squel=require(_0xa22d('0xa'));var crypto=require(_0xa22d('0xb'));var jsforce=require(_0xa22d('0xc'));var deskjs=require(_0xa22d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa22d('0xe'));var Redis=require(_0xa22d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa22d('0x10'));var as=require(_0xa22d('0x11'));var hardwareService=require(_0xa22d('0x12'));var logger=require(_0xa22d('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa22d('0x14'));var licenseUtil=require(_0xa22d('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x184309,_0x515d6c){_0x515d6c=_0x515d6c||0xcc;return function(_0x983182){if(_0x983182){return _0x184309[_0xa22d('0x16')](_0x515d6c);}return _0x184309[_0xa22d('0x17')](_0x515d6c)['end']();};}function respondWithResult(_0x174a3f,_0x20d7f3){_0x20d7f3=_0x20d7f3||0xc8;return function(_0xc0d11d){if(_0xc0d11d){return _0x174a3f[_0xa22d('0x17')](_0x20d7f3)[_0xa22d('0x18')](_0xc0d11d);}};}function respondWithFilteredResult(_0x4dfa44,_0x132b1d){return function(_0x1b8627){if(_0x1b8627){var _0x2af5c6=typeof _0x132b1d[_0xa22d('0x19')]===_0xa22d('0x1a')&&typeof _0x132b1d[_0xa22d('0x1b')]===_0xa22d('0x1a');var _0x5e56a6=_0x1b8627[_0xa22d('0x1c')];var _0x3d78b9=_0x2af5c6?0x0:_0x132b1d[_0xa22d('0x19')];var _0x1ed22e=_0x2af5c6?_0x1b8627[_0xa22d('0x1c')]:_0x132b1d[_0xa22d('0x19')]+_0x132b1d[_0xa22d('0x1b')];var _0x184604;if(_0x1ed22e>=_0x5e56a6){_0x1ed22e=_0x5e56a6;_0x184604=0xc8;}else{_0x184604=0xce;}_0x4dfa44['status'](_0x184604);return _0x4dfa44[_0xa22d('0x1d')](_0xa22d('0x1e'),_0x3d78b9+'-'+_0x1ed22e+'/'+_0x5e56a6)[_0xa22d('0x18')](_0x1b8627);}return null;};}function patchUpdates(_0x4ed606){return function(_0x4c0aed){try{jsonpatch['apply'](_0x4c0aed,_0x4ed606,!![]);}catch(_0x2cd394){return BPromise[_0xa22d('0x1f')](_0x2cd394);}return _0x4c0aed[_0xa22d('0x20')]();};}function saveUpdates(_0x5071e1,_0x389675){return function(_0x45f528){if(_0x45f528){return _0x45f528[_0xa22d('0x21')](_0x5071e1)['then'](function(_0xdb2773){return _0xdb2773;});}return null;};}function removeEntity(_0x1088ea,_0x502219){return function(_0x24701d){if(_0x24701d){return _0x24701d[_0xa22d('0x22')]()[_0xa22d('0x23')](function(){_0x1088ea[_0xa22d('0x17')](0xcc)[_0xa22d('0x24')]();});}};}function handleEntityNotFound(_0x1c83e8,_0x55f1ce){return function(_0x58aa49){if(!_0x58aa49){_0x1c83e8['sendStatus'](0x194);}return _0x58aa49;};}function handleError(_0x70bfb8,_0x2e4b26){_0x2e4b26=_0x2e4b26||0x1f4;return function(_0x2fe9e0){logger[_0xa22d('0x25')](_0x2fe9e0[_0xa22d('0x26')]);if(_0x2fe9e0[_0xa22d('0x27')]){delete _0x2fe9e0[_0xa22d('0x27')];}_0x70bfb8[_0xa22d('0x17')](_0x2e4b26)[_0xa22d('0x28')](_0x2fe9e0);};}exports[_0xa22d('0x29')]=function(_0x594ac5,_0x5ba48b){var _0xf687b9={},_0x4d460f={},_0x550dd7={'count':0x0,'rows':[]};var _0x1d7b33=_[_0xa22d('0x2a')](db[_0xa22d('0x2b')][_0xa22d('0x2c')],function(_0x1614f4){return{'name':_0x1614f4[_0xa22d('0x2d')],'type':_0x1614f4[_0xa22d('0x2e')][_0xa22d('0x2f')]};});_0x4d460f['model']=_[_0xa22d('0x2a')](_0x1d7b33,_0xa22d('0x27'));_0x4d460f[_0xa22d('0x30')]=_[_0xa22d('0x31')](_0x594ac5[_0xa22d('0x30')]);_0x4d460f[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4d460f[_0xa22d('0x34')],_0x4d460f[_0xa22d('0x30')]);_0xf687b9[_0xa22d('0x35')]=_['intersection'](_0x4d460f[_0xa22d('0x34')],qs[_0xa22d('0x36')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x36')]));_0xf687b9[_0xa22d('0x35')]=_0xf687b9[_0xa22d('0x35')]['length']?_0xf687b9[_0xa22d('0x35')]:_0x4d460f[_0xa22d('0x34')];if(!_0x594ac5['query'][_0xa22d('0x37')]('nolimit')){_0xf687b9[_0xa22d('0x1b')]=qs[_0xa22d('0x1b')](_0x594ac5['query'][_0xa22d('0x1b')]);_0xf687b9['offset']=qs[_0xa22d('0x19')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x19')]);}_0xf687b9[_0xa22d('0x38')]=qs[_0xa22d('0x39')](_0x594ac5[_0xa22d('0x30')][_0xa22d('0x39')]);_0xf687b9[_0xa22d('0x3a')]=qs['filters'](_[_0xa22d('0x3b')](_0x594ac5[_0xa22d('0x30')],_0x4d460f['filters']),_0x1d7b33);if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]){_0xf687b9['where']=_['merge'](_0xf687b9[_0xa22d('0x3a')],{'$or':_[_0xa22d('0x2a')](_0x1d7b33,function(_0x109944){if(_0x109944[_0xa22d('0x2e')]!==_0xa22d('0x3d')){var _0x180c37={};_0x180c37[_0x109944[_0xa22d('0x27')]]={'$like':'%'+_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3c')]+'%'};return _0x180c37;}})});}_0xf687b9=_[_0xa22d('0x3e')]({},_0xf687b9,_0x594ac5['options']);var _0x36287a={'where':_0xf687b9[_0xa22d('0x3a')]};return db[_0xa22d('0x2b')][_0xa22d('0x1c')](_0x36287a)['then'](function(_0x11e608){_0x550dd7['count']=_0x11e608;if(_0x594ac5[_0xa22d('0x30')][_0xa22d('0x3f')]){_0xf687b9[_0xa22d('0x40')]=[{'all':!![]}];}return db[_0xa22d('0x2b')][_0xa22d('0x41')](_0xf687b9);})[_0xa22d('0x23')](function(_0x55034d){_0x550dd7[_0xa22d('0x42')]=_0x55034d;return _0x550dd7;})[_0xa22d('0x23')](respondWithFilteredResult(_0x5ba48b,_0xf687b9))['catch'](handleError(_0x5ba48b,null));};exports[_0xa22d('0x43')]=function(_0x2e44c3,_0x5404d1){var _0x42a36b={'raw':!![],'where':{'id':_0x2e44c3[_0xa22d('0x44')]['id']}},_0x4aebbe={};_0x4aebbe[_0xa22d('0x34')]=_[_0xa22d('0x31')](db['JscriptyAnswerReport'][_0xa22d('0x2c')]);_0x4aebbe[_0xa22d('0x30')]=_['keys'](_0x2e44c3[_0xa22d('0x30')]);_0x4aebbe[_0xa22d('0x32')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],_0x4aebbe[_0xa22d('0x30')]);_0x42a36b[_0xa22d('0x35')]=_[_0xa22d('0x33')](_0x4aebbe[_0xa22d('0x34')],qs['fields'](_0x2e44c3['query'][_0xa22d('0x36')]));_0x42a36b['attributes']=_0x42a36b[_0xa22d('0x35')]['length']?_0x42a36b[_0xa22d('0x35')]:_0x4aebbe['model'];if(_0x2e44c3[_0xa22d('0x30')][_0xa22d('0x3f')]){_0x42a36b[_0xa22d('0x40')]=[{'all':!![]}];}_0x42a36b=_[_0xa22d('0x3e')]({},_0x42a36b,_0x2e44c3[_0xa22d('0x45')]);return db[_0xa22d('0x2b')][_0xa22d('0x46')](_0x42a36b)[_0xa22d('0x23')](handleEntityNotFound(_0x5404d1,null))[_0xa22d('0x23')](respondWithResult(_0x5404d1,null))[_0xa22d('0x47')](handleError(_0x5404d1,null));};exports['create']=function(_0x5f488e,_0x132be8){return db['JscriptyAnswerReport'][_0xa22d('0x48')](_0x5f488e['body'],{})[_0xa22d('0x23')](respondWithResult(_0x132be8,0xc9))[_0xa22d('0x47')](handleError(_0x132be8,null));};exports['update']=function(_0x4a1d04,_0x37e2b2){if(_0x4a1d04['body']['id']){delete _0x4a1d04[_0xa22d('0x49')]['id'];}return db['JscriptyAnswerReport'][_0xa22d('0x46')]({'where':{'id':_0x4a1d04[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x37e2b2,null))[_0xa22d('0x23')](saveUpdates(_0x4a1d04[_0xa22d('0x49')],null))[_0xa22d('0x23')](respondWithResult(_0x37e2b2,null))[_0xa22d('0x47')](handleError(_0x37e2b2,null));};exports[_0xa22d('0x22')]=function(_0x45672b,_0x5e5847){return db[_0xa22d('0x2b')][_0xa22d('0x46')]({'where':{'id':_0x45672b[_0xa22d('0x44')]['id']}})[_0xa22d('0x23')](handleEntityNotFound(_0x5e5847,null))[_0xa22d('0x23')](removeEntity(_0x5e5847,null))[_0xa22d('0x47')](handleError(_0x5e5847,null));};exports[_0xa22d('0x4a')]=function(_0x432d39,_0x134e7a){return db[_0xa22d('0x2b')]['describe']()[_0xa22d('0x23')](respondWithResult(_0x134e7a,null))[_0xa22d('0x47')](handleError(_0x134e7a,null));};
\ No newline at end of file
+var _0x1501=['update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','then','stack','name','send','index','map','JscriptyAnswerReport','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body'];(function(_0x27b75d,_0x2e427f){var _0x45ef46=function(_0x55c93e){while(--_0x55c93e){_0x27b75d['push'](_0x27b75d['shift']());}};_0x45ef46(++_0x2e427f);}(_0x1501,0x126));var _0x1150=function(_0x5b701c,_0x23458a){_0x5b701c=_0x5b701c-0x0;var _0x580ad3=_0x1501[_0x5b701c];return _0x580ad3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1150('0x0'));var zipdir=require(_0x1150('0x1'));var jsonpatch=require(_0x1150('0x2'));var rp=require('request-promise');var moment=require(_0x1150('0x3'));var BPromise=require(_0x1150('0x4'));var Mustache=require(_0x1150('0x5'));var util=require(_0x1150('0x6'));var path=require('path');var sox=require(_0x1150('0x7'));var csv=require('to-csv');var ejs=require(_0x1150('0x8'));var fs=require('fs');var fs_extra=require(_0x1150('0x9'));var _=require(_0x1150('0xa'));var squel=require(_0x1150('0xb'));var crypto=require(_0x1150('0xc'));var jsforce=require(_0x1150('0xd'));var deskjs=require(_0x1150('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1150('0xf'));var Redis=require(_0x1150('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1150('0x11'));var hardwareService=require(_0x1150('0x12'));var logger=require(_0x1150('0x13'))(_0x1150('0x14'));var utils=require('../../config/utils');var config=require(_0x1150('0x15'));var licenseUtil=require(_0x1150('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3bcf2e,_0x4ca5ef){_0x4ca5ef=_0x4ca5ef||0xcc;return function(_0x1d2549){if(_0x1d2549){return _0x3bcf2e[_0x1150('0x17')](_0x4ca5ef);}return _0x3bcf2e[_0x1150('0x18')](_0x4ca5ef)[_0x1150('0x19')]();};}function respondWithResult(_0x787aac,_0x18f378){_0x18f378=_0x18f378||0xc8;return function(_0x474069){if(_0x474069){return _0x787aac[_0x1150('0x18')](_0x18f378)['json'](_0x474069);}};}function respondWithFilteredResult(_0x498bab,_0x3cc5e7){return function(_0x146d70){if(_0x146d70){var _0x54df42=typeof _0x3cc5e7[_0x1150('0x1a')]===_0x1150('0x1b')&&typeof _0x3cc5e7[_0x1150('0x1c')]===_0x1150('0x1b');var _0x378eb8=_0x146d70[_0x1150('0x1d')];var _0x35664d=_0x54df42?0x0:_0x3cc5e7['offset'];var _0x517569=_0x54df42?_0x146d70[_0x1150('0x1d')]:_0x3cc5e7[_0x1150('0x1a')]+_0x3cc5e7['limit'];var _0x1bac5b;if(_0x517569>=_0x378eb8){_0x517569=_0x378eb8;_0x1bac5b=0xc8;}else{_0x1bac5b=0xce;}_0x498bab['status'](_0x1bac5b);return _0x498bab[_0x1150('0x1e')]('Content-Range',_0x35664d+'-'+_0x517569+'/'+_0x378eb8)[_0x1150('0x1f')](_0x146d70);}return null;};}function patchUpdates(_0x4bdae2){return function(_0x5a96f8){try{jsonpatch[_0x1150('0x20')](_0x5a96f8,_0x4bdae2,!![]);}catch(_0x2f4fec){return BPromise[_0x1150('0x21')](_0x2f4fec);}return _0x5a96f8[_0x1150('0x22')]();};}function saveUpdates(_0xd10701,_0x3e25da){return function(_0x3f5fcf){if(_0x3f5fcf){return _0x3f5fcf['update'](_0xd10701)['then'](function(_0x30ca9c){return _0x30ca9c;});}return null;};}function removeEntity(_0x28b396,_0x37da51){return function(_0x440b93){if(_0x440b93){return _0x440b93['destroy']()[_0x1150('0x23')](function(){_0x28b396[_0x1150('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b82ba,_0x497ef2){return function(_0x39b1bd){if(!_0x39b1bd){_0x4b82ba[_0x1150('0x17')](0x194);}return _0x39b1bd;};}function handleError(_0x5707ce,_0x2fbda8){_0x2fbda8=_0x2fbda8||0x1f4;return function(_0x1ebf83){logger['error'](_0x1ebf83[_0x1150('0x24')]);if(_0x1ebf83[_0x1150('0x25')]){delete _0x1ebf83[_0x1150('0x25')];}_0x5707ce[_0x1150('0x18')](_0x2fbda8)[_0x1150('0x26')](_0x1ebf83);};}exports[_0x1150('0x27')]=function(_0x213e81,_0x3a88df){var _0x4ad8f3={},_0x32c245={},_0x3b67f9={'count':0x0,'rows':[]};var _0x26f6dd=_[_0x1150('0x28')](db[_0x1150('0x29')]['rawAttributes'],function(_0x1e3691){return{'name':_0x1e3691[_0x1150('0x2a')],'type':_0x1e3691[_0x1150('0x2b')]['key']};});_0x32c245['model']=_[_0x1150('0x28')](_0x26f6dd,_0x1150('0x25'));_0x32c245[_0x1150('0x2c')]=_[_0x1150('0x2d')](_0x213e81[_0x1150('0x2c')]);_0x32c245[_0x1150('0x2e')]=_[_0x1150('0x2f')](_0x32c245['model'],_0x32c245[_0x1150('0x2c')]);_0x4ad8f3[_0x1150('0x30')]=_['intersection'](_0x32c245[_0x1150('0x31')],qs['fields'](_0x213e81['query'][_0x1150('0x32')]));_0x4ad8f3[_0x1150('0x30')]=_0x4ad8f3[_0x1150('0x30')][_0x1150('0x33')]?_0x4ad8f3['attributes']:_0x32c245[_0x1150('0x31')];if(!_0x213e81[_0x1150('0x2c')][_0x1150('0x34')](_0x1150('0x35'))){_0x4ad8f3[_0x1150('0x1c')]=qs[_0x1150('0x1c')](_0x213e81[_0x1150('0x2c')]['limit']);_0x4ad8f3[_0x1150('0x1a')]=qs[_0x1150('0x1a')](_0x213e81[_0x1150('0x2c')]['offset']);}_0x4ad8f3[_0x1150('0x36')]=qs[_0x1150('0x37')](_0x213e81[_0x1150('0x2c')]['sort']);_0x4ad8f3['where']=qs[_0x1150('0x2e')](_[_0x1150('0x38')](_0x213e81[_0x1150('0x2c')],_0x32c245['filters']),_0x26f6dd);if(_0x213e81['query'][_0x1150('0x39')]){_0x4ad8f3[_0x1150('0x3a')]=_['merge'](_0x4ad8f3[_0x1150('0x3a')],{'$or':_[_0x1150('0x28')](_0x26f6dd,function(_0x1435d3){if(_0x1435d3['type']!=='VIRTUAL'){var _0x10572e={};_0x10572e[_0x1435d3[_0x1150('0x25')]]={'$like':'%'+_0x213e81['query'][_0x1150('0x39')]+'%'};return _0x10572e;}})});}_0x4ad8f3=_[_0x1150('0x3b')]({},_0x4ad8f3,_0x213e81[_0x1150('0x3c')]);var _0x51e2cf={'where':_0x4ad8f3[_0x1150('0x3a')]};return db[_0x1150('0x29')][_0x1150('0x1d')](_0x51e2cf)[_0x1150('0x23')](function(_0x10429c){_0x3b67f9[_0x1150('0x1d')]=_0x10429c;if(_0x213e81[_0x1150('0x2c')][_0x1150('0x3d')]){_0x4ad8f3['include']=[{'all':!![]}];}return db[_0x1150('0x29')][_0x1150('0x3e')](_0x4ad8f3);})['then'](function(_0x3e56b6){_0x3b67f9[_0x1150('0x3f')]=_0x3e56b6;return _0x3b67f9;})[_0x1150('0x23')](respondWithFilteredResult(_0x3a88df,_0x4ad8f3))[_0x1150('0x40')](handleError(_0x3a88df,null));};exports[_0x1150('0x41')]=function(_0x15e483,_0x539cff){var _0x11a7ed={'raw':!![],'where':{'id':_0x15e483[_0x1150('0x42')]['id']}},_0x4db1cf={};_0x4db1cf['model']=_[_0x1150('0x2d')](db['JscriptyAnswerReport'][_0x1150('0x43')]);_0x4db1cf[_0x1150('0x2c')]=_[_0x1150('0x2d')](_0x15e483['query']);_0x4db1cf['filters']=_[_0x1150('0x2f')](_0x4db1cf[_0x1150('0x31')],_0x4db1cf['query']);_0x11a7ed[_0x1150('0x30')]=_[_0x1150('0x2f')](_0x4db1cf[_0x1150('0x31')],qs[_0x1150('0x32')](_0x15e483[_0x1150('0x2c')][_0x1150('0x32')]));_0x11a7ed[_0x1150('0x30')]=_0x11a7ed['attributes'][_0x1150('0x33')]?_0x11a7ed[_0x1150('0x30')]:_0x4db1cf[_0x1150('0x31')];if(_0x15e483['query'][_0x1150('0x3d')]){_0x11a7ed[_0x1150('0x44')]=[{'all':!![]}];}_0x11a7ed=_['merge']({},_0x11a7ed,_0x15e483['options']);return db[_0x1150('0x29')]['find'](_0x11a7ed)[_0x1150('0x23')](handleEntityNotFound(_0x539cff,null))[_0x1150('0x23')](respondWithResult(_0x539cff,null))[_0x1150('0x40')](handleError(_0x539cff,null));};exports['create']=function(_0x2160a0,_0x41f1eb){return db[_0x1150('0x29')][_0x1150('0x45')](_0x2160a0[_0x1150('0x46')],{})[_0x1150('0x23')](respondWithResult(_0x41f1eb,0xc9))[_0x1150('0x40')](handleError(_0x41f1eb,null));};exports[_0x1150('0x47')]=function(_0xedd0b7,_0x4f10a1){if(_0xedd0b7[_0x1150('0x46')]['id']){delete _0xedd0b7[_0x1150('0x46')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0xedd0b7[_0x1150('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f10a1,null))['then'](saveUpdates(_0xedd0b7['body'],null))[_0x1150('0x23')](respondWithResult(_0x4f10a1,null))[_0x1150('0x40')](handleError(_0x4f10a1,null));};exports['destroy']=function(_0x18bf8b,_0x3e77f1){return db[_0x1150('0x29')]['find']({'where':{'id':_0x18bf8b[_0x1150('0x42')]['id']}})[_0x1150('0x23')](handleEntityNotFound(_0x3e77f1,null))['then'](removeEntity(_0x3e77f1,null))[_0x1150('0x40')](handleError(_0x3e77f1,null));};exports[_0x1150('0x48')]=function(_0x1f9062,_0x357854){return db[_0x1150('0x29')]['describe']()['then'](respondWithResult(_0x357854,null))[_0x1150('0x40')](handleError(_0x357854,null));};
\ No newline at end of file
index f5f44ea..65512c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ee5=['./jscriptyAnswerReport.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x35a27d,_0x5c68fd){var _0xd70155=function(_0xb78ae4){while(--_0xb78ae4){_0x35a27d['push'](_0x35a27d['shift']());}};_0xd70155(++_0x5c68fd);}(_0x6ee5,0x16b));var _0x56ee=function(_0x2ae89f,_0x470a01){_0x2ae89f=_0x2ae89f-0x0;var _0x333ebc=_0x6ee5[_0x2ae89f];return _0x333ebc;};'use strict';var _=require(_0x56ee('0x0'));var util=require(_0x56ee('0x1'));var logger=require(_0x56ee('0x2'))(_0x56ee('0x3'));var moment=require(_0x56ee('0x4'));var BPromise=require(_0x56ee('0x5'));var rp=require(_0x56ee('0x6'));var fs=require('fs');var path=require(_0x56ee('0x7'));var rimraf=require('rimraf');var config=require(_0x56ee('0x8'));var attributes=require(_0x56ee('0x9'));module[_0x56ee('0xa')]=function(_0x42893a,_0x42445a){return _0x42893a[_0x56ee('0xb')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa57c=['../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x3d8493,_0x1c1a97){var _0x68c1f6=function(_0x1abc8a){while(--_0x1abc8a){_0x3d8493['push'](_0x3d8493['shift']());}};_0x68c1f6(++_0x1c1a97);}(_0xa57c,0x95));var _0xca57=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xa57c[_0x4a53d];return _0x27410e;};'use strict';var _=require(_0xca57('0x0'));var util=require(_0xca57('0x1'));var logger=require(_0xca57('0x2'))(_0xca57('0x3'));var moment=require(_0xca57('0x4'));var BPromise=require('bluebird');var rp=require(_0xca57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xca57('0x6'));var config=require(_0xca57('0x7'));var attributes=require(_0xca57('0x8'));module[_0xca57('0x9')]=function(_0x5c7500,_0x15f646){return _0x5c7500[_0xca57('0xa')](_0xca57('0xb'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 248ecc5..9774c6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf2=['lodash','util','randomstring','ioredis','rpc','jayson/promise','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x15e06d,_0x4a6f77){var _0xdd4cde=function(_0x302ee9){while(--_0x302ee9){_0x15e06d['push'](_0x15e06d['shift']());}};_0xdd4cde(++_0x4a6f77);}(_0x3bf2,0xab));var _0x23bf=function(_0x7b360c,_0x5cec49){_0x7b360c=_0x7b360c-0x0;var _0x2dad8e=_0x3bf2[_0x7b360c];return _0x2dad8e;};'use strict';var _=require(_0x23bf('0x0'));var util=require(_0x23bf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x23bf('0x2'));var fs=require('fs');var Redis=require(_0x23bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23bf('0x4'));var config=require('../../config/environment');var jayson=require(_0x23bf('0x5'));var client=jayson['client'][_0x23bf('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x11fd5b,_0x1ec858,_0x9fedd7){return new BPromise(function(_0x15df8f,_0x12e2d8){return client[_0x23bf('0x7')](_0x11fd5b,_0x9fedd7)[_0x23bf('0x8')](function(_0x3e2117){logger['info'](_0x23bf('0x9'),_0x1ec858,_0x23bf('0xa'));logger[_0x23bf('0xb')](_0x23bf('0xc'),_0x1ec858,_0x23bf('0xa'),JSON['stringify'](_0x3e2117));if(_0x3e2117[_0x23bf('0xd')]){if(_0x3e2117[_0x23bf('0xd')][_0x23bf('0xe')]===0x1f4){logger[_0x23bf('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1ec858,_0x3e2117['error']['message']);return _0x12e2d8(_0x3e2117[_0x23bf('0xd')]['message']);}logger['error'](_0x23bf('0x9'),_0x1ec858,_0x3e2117['error'][_0x23bf('0xf')]);return _0x15df8f(_0x3e2117['error'][_0x23bf('0xf')]);}else{logger[_0x23bf('0x10')](_0x23bf('0x9'),_0x1ec858,'request\x20sent');_0x15df8f(_0x3e2117[_0x23bf('0x11')][_0x23bf('0xf')]);}})[_0x23bf('0x12')](function(_0x5e3622){logger[_0x23bf('0xd')](_0x23bf('0x9'),_0x1ec858,_0x5e3622);_0x12e2d8(_0x5e3622);});});}
\ No newline at end of file
+var _0x5934=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','JscriptyAnswerReport,\x20%s,\x20%s','message','catch'];(function(_0x33e55a,_0x3d5690){var _0x542283=function(_0x4eba1d){while(--_0x4eba1d){_0x33e55a['push'](_0x33e55a['shift']());}};_0x542283(++_0x3d5690);}(_0x5934,0x84));var _0x4593=function(_0x1fb97c,_0x294b0e){_0x1fb97c=_0x1fb97c-0x0;var _0x1af5e2=_0x5934[_0x1fb97c];return _0x1af5e2;};'use strict';var _=require(_0x4593('0x0'));var util=require(_0x4593('0x1'));var moment=require(_0x4593('0x2'));var BPromise=require(_0x4593('0x3'));var rs=require(_0x4593('0x4'));var fs=require('fs');var Redis=require(_0x4593('0x5'));var db=require(_0x4593('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4593('0x7'))(_0x4593('0x8'));var config=require(_0x4593('0x9'));var jayson=require(_0x4593('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8586,_0x5d8a36,_0x36e97d){return new BPromise(function(_0xc42541,_0x68b016){return client[_0x4593('0xb')](_0x5a8586,_0x36e97d)[_0x4593('0xc')](function(_0x4e1342){logger[_0x4593('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5d8a36,_0x4593('0xe'));logger[_0x4593('0xf')](_0x4593('0x10'),_0x5d8a36,'request\x20sent',JSON[_0x4593('0x11')](_0x4e1342));if(_0x4e1342['error']){if(_0x4e1342[_0x4593('0x12')]['code']===0x1f4){logger[_0x4593('0x12')](_0x4593('0x13'),_0x5d8a36,_0x4e1342[_0x4593('0x12')][_0x4593('0x14')]);return _0x68b016(_0x4e1342[_0x4593('0x12')]['message']);}logger['error'](_0x4593('0x13'),_0x5d8a36,_0x4e1342[_0x4593('0x12')]['message']);return _0xc42541(_0x4e1342[_0x4593('0x12')][_0x4593('0x14')]);}else{logger[_0x4593('0xd')](_0x4593('0x13'),_0x5d8a36,_0x4593('0xe'));_0xc42541(_0x4e1342['result'][_0x4593('0x14')]);}})[_0x4593('0x15')](function(_0x5c4b10){logger[_0x4593('0x12')](_0x4593('0x13'),_0x5d8a36,_0x5c4b10);_0x68b016(_0x5c4b10);});});}
\ No newline at end of file
index 9a55c69..c9bf0c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe11f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','exports','multer','path','express','Router','fs-extra'];(function(_0x370284,_0x3348d5){var _0x1445c8=function(_0x573a25){while(--_0x573a25){_0x370284['push'](_0x370284['shift']());}};_0x1445c8(++_0x3348d5);}(_0xe11f,0x1e9));var _0xfe11=function(_0x4339df,_0x568b7d){_0x4339df=_0x4339df-0x0;var _0x38c44c=_0xe11f[_0x4339df];return _0x38c44c;};'use strict';var multer=require(_0xfe11('0x0'));var util=require('util');var path=require(_0xfe11('0x1'));var timeout=require('connect-timeout');var express=require(_0xfe11('0x2'));var router=express[_0xfe11('0x3')]();var fs_extra=require(_0xfe11('0x4'));var auth=require(_0xfe11('0x5'));var interaction=require(_0xfe11('0x6'));var config=require(_0xfe11('0x7'));var controller=require(_0xfe11('0x8'));router[_0xfe11('0x9')]('/',auth['isAuthenticated'](),controller[_0xfe11('0xa')]);router[_0xfe11('0x9')](_0xfe11('0xb'),auth[_0xfe11('0xc')](),controller[_0xfe11('0xd')]);router[_0xfe11('0x9')]('/:id/sessions',auth['isAuthenticated'](),controller[_0xfe11('0xe')]);router[_0xfe11('0x9')](_0xfe11('0xf'),auth[_0xfe11('0xc')](),controller[_0xfe11('0x10')]);router[_0xfe11('0x9')](_0xfe11('0x11'),auth[_0xfe11('0xc')](),timeout(_0xfe11('0x12')),controller['getSummary']);router['post']('/',auth[_0xfe11('0xc')](),controller['create']);router[_0xfe11('0x13')](_0xfe11('0x14'),auth[_0xfe11('0xc')](),controller[_0xfe11('0x15')]);router[_0xfe11('0x16')]('/:id',auth[_0xfe11('0xc')](),controller[_0xfe11('0x17')]);router[_0xfe11('0x18')](_0xfe11('0xb'),auth[_0xfe11('0xc')](),controller['destroy']);module[_0xfe11('0x19')]=router;
\ No newline at end of file
+var _0xf342=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','post','/:id/clone','put'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xf342,0xd3));var _0x2f34=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf342[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2f34('0x0'));var util=require(_0x2f34('0x1'));var path=require(_0x2f34('0x2'));var timeout=require(_0x2f34('0x3'));var express=require(_0x2f34('0x4'));var router=express[_0x2f34('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2f34('0x6'));var interaction=require(_0x2f34('0x7'));var config=require(_0x2f34('0x8'));var controller=require(_0x2f34('0x9'));router[_0x2f34('0xa')]('/',auth[_0x2f34('0xb')](),controller[_0x2f34('0xc')]);router[_0x2f34('0xa')](_0x2f34('0xd'),auth['isAuthenticated'](),controller[_0x2f34('0xe')]);router[_0x2f34('0xa')](_0x2f34('0xf'),auth['isAuthenticated'](),controller[_0x2f34('0x10')]);router[_0x2f34('0xa')](_0x2f34('0x11'),auth[_0x2f34('0xb')](),controller['getAnswers']);router['get'](_0x2f34('0x12'),auth[_0x2f34('0xb')](),timeout(_0x2f34('0x13')),controller['getSummary']);router[_0x2f34('0x14')]('/',auth[_0x2f34('0xb')](),controller['create']);router[_0x2f34('0x14')](_0x2f34('0x15'),auth['isAuthenticated'](),controller['clone']);router[_0x2f34('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x2f34('0x17')]);router[_0x2f34('0x18')]('/:id',auth[_0x2f34('0xb')](),controller[_0x2f34('0x19')]);module['exports']=router;
\ No newline at end of file
index 9c22c9e..63580b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb747=['BOOLEAN','sequelize','exports','name','STRING','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x4f67e3,_0x32b097){var _0x5cedc0=function(_0x3cb7dc){while(--_0x3cb7dc){_0x4f67e3['push'](_0x4f67e3['shift']());}};_0x5cedc0(++_0x32b097);}(_0xb747,0x1f1));var _0x7b74=function(_0x4929fd,_0x2c9d98){_0x4929fd=_0x4929fd-0x0;var _0x1a700d=_0xb747[_0x4929fd];return _0x1a700d;};'use strict';var Sequelize=require(_0x7b74('0x0'));var _=require('lodash');var util=require('util');module[_0x7b74('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x7b74('0x2')},'description':{'type':Sequelize[_0x7b74('0x3')]},'formData':{'type':Sequelize[_0x7b74('0x4')](_0x7b74('0x5')),'set':function(_0x2e68fb){if(_[_0x7b74('0x6')](_0x2e68fb)){this[_0x7b74('0x7')](_0x7b74('0x8'),JSON[_0x7b74('0x9')](_0x2e68fb));}else if(_[_0x7b74('0xa')](_0x2e68fb)){this[_0x7b74('0x7')](_0x7b74('0x8'),_0x2e68fb);}else{this['setDataValue'](_0x7b74('0x8'),util[_0x7b74('0xb')](_0x7b74('0xc'),this[_0x7b74('0xd')](_0x7b74('0x2'))||'',this[_0x7b74('0xd')](_0x7b74('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x7b74('0xf')],'defaultValue':![]}};
\ No newline at end of file
+var _0xaf91=['exports','name','STRING','TEXT','long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util'];(function(_0x156854,_0x1a7e34){var _0x10c4fb=function(_0x56e121){while(--_0x56e121){_0x156854['push'](_0x156854['shift']());}};_0x10c4fb(++_0x1a7e34);}(_0xaf91,0xb9));var _0x1af9=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xaf91[_0x8dc04d];return _0x2f5f28;};'use strict';var Sequelize=require(_0x1af9('0x0'));var _=require('lodash');var util=require(_0x1af9('0x1'));module[_0x1af9('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x1af9('0x3')},'description':{'type':Sequelize[_0x1af9('0x4')]},'formData':{'type':Sequelize[_0x1af9('0x5')](_0x1af9('0x6')),'set':function(_0x4ed45c){if(_[_0x1af9('0x7')](_0x4ed45c)){this['setDataValue'](_0x1af9('0x8'),JSON[_0x1af9('0x9')](_0x4ed45c));}else if(_[_0x1af9('0xa')](_0x4ed45c)){this[_0x1af9('0xb')]('formData',_0x4ed45c);}else{this[_0x1af9('0xb')](_0x1af9('0x8'),util[_0x1af9('0xc')](_0x1af9('0xd'),this['getDataValue']('name')||'',this[_0x1af9('0xe')](_0x1af9('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1af9('0x10')],'defaultValue':![]}};
\ No newline at end of file
index 00fa0db..7047555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b1e=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','apply','reject','update','destroy','get','Projects','UserProfileResource','then','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','findAll','catch','params','keys','includeAll','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','getSessions','findOne','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x190ceb,_0x2345b2){var _0x5ce806=function(_0x432853){while(--_0x432853){_0x190ceb['push'](_0x190ceb['shift']());}};_0x5ce806(++_0x2345b2);}(_0x6b1e,0xd3));var _0xe6b1=function(_0x33606a,_0x195f9c){_0x33606a=_0x33606a-0x0;var _0x3f40af=_0x6b1e[_0x33606a];return _0x3f40af;};'use strict';var emlformat=require(_0xe6b1('0x0'));var rimraf=require(_0xe6b1('0x1'));var zipdir=require(_0xe6b1('0x2'));var jsonpatch=require(_0xe6b1('0x3'));var rp=require(_0xe6b1('0x4'));var moment=require(_0xe6b1('0x5'));var BPromise=require(_0xe6b1('0x6'));var Mustache=require(_0xe6b1('0x7'));var util=require(_0xe6b1('0x8'));var path=require(_0xe6b1('0x9'));var sox=require(_0xe6b1('0xa'));var csv=require(_0xe6b1('0xb'));var ejs=require(_0xe6b1('0xc'));var fs=require('fs');var fs_extra=require(_0xe6b1('0xd'));var _=require(_0xe6b1('0xe'));var squel=require('squel');var crypto=require(_0xe6b1('0xf'));var jsforce=require(_0xe6b1('0x10'));var deskjs=require(_0xe6b1('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe6b1('0x12'));var Redis=require(_0xe6b1('0x13'));var authService=require(_0xe6b1('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe6b1('0x15'));var logger=require(_0xe6b1('0x16'))(_0xe6b1('0x17'));var utils=require(_0xe6b1('0x18'));var config=require(_0xe6b1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6b1('0x1a'))['db'];function respondWithStatusCode(_0x17268,_0x36a29b){_0x36a29b=_0x36a29b||0xcc;return function(_0x16b737){if(_0x16b737){return _0x17268[_0xe6b1('0x1b')](_0x36a29b);}return _0x17268[_0xe6b1('0x1c')](_0x36a29b)[_0xe6b1('0x1d')]();};}function respondWithResult(_0x476e37,_0xbaba4c){_0xbaba4c=_0xbaba4c||0xc8;return function(_0x18b02f){if(_0x18b02f){return _0x476e37[_0xe6b1('0x1c')](_0xbaba4c)[_0xe6b1('0x1e')](_0x18b02f);}};}function respondWithFilteredResult(_0x50c4ce,_0x4cd915){return function(_0x51f1fc){if(_0x51f1fc){var _0x18aca4=typeof _0x4cd915[_0xe6b1('0x1f')]==='undefined'&&typeof _0x4cd915[_0xe6b1('0x20')]==='undefined';var _0x2697d2=_0x51f1fc[_0xe6b1('0x21')];var _0x23de8f=_0x18aca4?0x0:_0x4cd915['offset'];var _0x106ff9=_0x18aca4?_0x51f1fc['count']:_0x4cd915[_0xe6b1('0x1f')]+_0x4cd915[_0xe6b1('0x20')];var _0x1121ce;if(_0x106ff9>=_0x2697d2){_0x106ff9=_0x2697d2;_0x1121ce=0xc8;}else{_0x1121ce=0xce;}_0x50c4ce['status'](_0x1121ce);return _0x50c4ce['set']('Content-Range',_0x23de8f+'-'+_0x106ff9+'/'+_0x2697d2)['json'](_0x51f1fc);}return null;};}function patchUpdates(_0xe853c){return function(_0x10263a){try{jsonpatch[_0xe6b1('0x22')](_0x10263a,_0xe853c,!![]);}catch(_0x265ad6){return BPromise[_0xe6b1('0x23')](_0x265ad6);}return _0x10263a['save']();};}function saveUpdates(_0x6a7bb,_0x511fbb){return function(_0x307cac){if(_0x307cac){return _0x307cac[_0xe6b1('0x24')](_0x6a7bb)['then'](function(_0x233065){return _0x233065;});}return null;};}function removeEntity(_0x511482,_0xb8aa86){return function(_0x44f5c3){if(_0x44f5c3){return _0x44f5c3[_0xe6b1('0x25')]()['then'](function(){var _0x1480c4=_0x44f5c3[_0xe6b1('0x26')]({'plain':!![]});var _0x5d3731=_0xe6b1('0x27');return db[_0xe6b1('0x28')][_0xe6b1('0x25')]({'where':{'type':_0x5d3731,'resourceId':_0x1480c4['id']}})['then'](function(){return _0x44f5c3;});})[_0xe6b1('0x29')](function(){_0x511482[_0xe6b1('0x1c')](0xcc)[_0xe6b1('0x1d')]();});}};}function handleEntityNotFound(_0x4ac1e3,_0x33e718){return function(_0x36921a){if(!_0x36921a){_0x4ac1e3[_0xe6b1('0x1b')](0x194);}return _0x36921a;};}function handleError(_0x1b088c,_0x2ca04d){_0x2ca04d=_0x2ca04d||0x1f4;return function(_0x3dd04a){logger['error'](_0x3dd04a[_0xe6b1('0x2a')]);if(_0x3dd04a[_0xe6b1('0x2b')]){delete _0x3dd04a[_0xe6b1('0x2b')];}_0x1b088c[_0xe6b1('0x1c')](_0x2ca04d)[_0xe6b1('0x2c')](_0x3dd04a);};}exports[_0xe6b1('0x2d')]=function(_0x3a153c,_0x5c2514){var _0x49b974={},_0x2352f6={},_0x2e8b7c={'count':0x0,'rows':[]};var _0x5f0786=_[_0xe6b1('0x2e')](db[_0xe6b1('0x2f')][_0xe6b1('0x30')],function(_0x370a62){return{'name':_0x370a62[_0xe6b1('0x31')],'type':_0x370a62[_0xe6b1('0x32')][_0xe6b1('0x33')]};});_0x2352f6[_0xe6b1('0x34')]=_[_0xe6b1('0x2e')](_0x5f0786,_0xe6b1('0x2b'));_0x2352f6[_0xe6b1('0x35')]=_['keys'](_0x3a153c['query']);_0x2352f6['filters']=_[_0xe6b1('0x36')](_0x2352f6['model'],_0x2352f6[_0xe6b1('0x35')]);_0x49b974[_0xe6b1('0x37')]=_[_0xe6b1('0x36')](_0x2352f6[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x38')]));_0x49b974[_0xe6b1('0x37')]=_0x49b974[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x49b974[_0xe6b1('0x37')]:_0x2352f6[_0xe6b1('0x34')];if(!_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x3a')](_0xe6b1('0x3b'))){_0x49b974[_0xe6b1('0x20')]=qs[_0xe6b1('0x20')](_0x3a153c['query'][_0xe6b1('0x20')]);_0x49b974[_0xe6b1('0x1f')]=qs[_0xe6b1('0x1f')](_0x3a153c[_0xe6b1('0x35')]['offset']);}_0x49b974[_0xe6b1('0x3c')]=qs[_0xe6b1('0x3d')](_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x3d')]);_0x49b974['where']=qs[_0xe6b1('0x3e')](_[_0xe6b1('0x3f')](_0x3a153c['query'],_0x2352f6[_0xe6b1('0x3e')]),_0x5f0786);if(_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x40')]){_0x49b974[_0xe6b1('0x41')]=_['merge'](_0x49b974[_0xe6b1('0x41')],{'$or':_[_0xe6b1('0x2e')](_0x5f0786,function(_0x124bb5){if(_0x124bb5[_0xe6b1('0x32')]!==_0xe6b1('0x42')){var _0x58ef3c={};_0x58ef3c[_0x124bb5[_0xe6b1('0x2b')]]={'$like':'%'+_0x3a153c[_0xe6b1('0x35')][_0xe6b1('0x40')]+'%'};return _0x58ef3c;}})});}_0x49b974=_[_0xe6b1('0x43')]({},_0x49b974,_0x3a153c[_0xe6b1('0x44')]);var _0x353e74={'where':_0x49b974[_0xe6b1('0x41')]};return db[_0xe6b1('0x2f')][_0xe6b1('0x21')](_0x353e74)[_0xe6b1('0x29')](function(_0x3c4b08){_0x2e8b7c[_0xe6b1('0x21')]=_0x3c4b08;if(_0x3a153c['query']['includeAll']){_0x49b974['include']=[{'all':!![]}];}return db['JscriptyProject'][_0xe6b1('0x45')](_0x49b974);})[_0xe6b1('0x29')](function(_0x11958c){_0x2e8b7c['rows']=_0x11958c;return _0x2e8b7c;})[_0xe6b1('0x29')](respondWithFilteredResult(_0x5c2514,_0x49b974))[_0xe6b1('0x46')](handleError(_0x5c2514,null));};exports['show']=function(_0x5e4597,_0xa799bd){var _0x13c5f6={'raw':![],'where':{'id':_0x5e4597[_0xe6b1('0x47')]['id']}},_0x11f7fa={};_0x11f7fa['model']=_['keys'](db['JscriptyProject'][_0xe6b1('0x30')]);_0x11f7fa[_0xe6b1('0x35')]=_[_0xe6b1('0x48')](_0x5e4597[_0xe6b1('0x35')]);_0x11f7fa[_0xe6b1('0x3e')]=_[_0xe6b1('0x36')](_0x11f7fa['model'],_0x11f7fa[_0xe6b1('0x35')]);_0x13c5f6[_0xe6b1('0x37')]=_[_0xe6b1('0x36')](_0x11f7fa[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x5e4597[_0xe6b1('0x35')]['fields']));_0x13c5f6[_0xe6b1('0x37')]=_0x13c5f6[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x13c5f6[_0xe6b1('0x37')]:_0x11f7fa[_0xe6b1('0x34')];if(_0x5e4597['query'][_0xe6b1('0x49')]){_0x13c5f6[_0xe6b1('0x4a')]=[{'all':!![]}];}_0x13c5f6=_['merge']({},_0x13c5f6,_0x5e4597[_0xe6b1('0x44')]);return db[_0xe6b1('0x2f')][_0xe6b1('0x4b')](_0x13c5f6)[_0xe6b1('0x29')](handleEntityNotFound(_0xa799bd,null))[_0xe6b1('0x29')](respondWithResult(_0xa799bd,null))[_0xe6b1('0x46')](handleError(_0xa799bd,null));};exports[_0xe6b1('0x4c')]=function(_0x363592,_0x533608){return db[_0xe6b1('0x2f')][_0xe6b1('0x4c')](_0x363592['body'],{})[_0xe6b1('0x29')](function(_0x2199a6){var _0x363ad4=_0x363592[_0xe6b1('0x4d')][_0xe6b1('0x26')]({'plain':!![]});if(!_0x363ad4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x363ad4[_0xe6b1('0x4e')]===_0xe6b1('0x4d')){var _0x2135ec=_0x2199a6['get']({'plain':!![]});var _0x337a74=_0xe6b1('0x27');return db[_0xe6b1('0x4f')][_0xe6b1('0x4b')]({'where':{'name':_0x337a74,'userProfileId':_0x363ad4[_0xe6b1('0x50')]},'raw':!![]})['then'](function(_0xe7f621){if(_0xe7f621&&_0xe7f621[_0xe6b1('0x51')]===0x0){return db[_0xe6b1('0x28')][_0xe6b1('0x4c')]({'name':_0x2135ec[_0xe6b1('0x2b')],'resourceId':_0x2135ec['id'],'type':_0xe7f621[_0xe6b1('0x2b')],'sectionId':_0xe7f621['id']},{})[_0xe6b1('0x29')](function(){return _0x2199a6;});}else{return _0x2199a6;}})['catch'](function(_0x119cef){logger[_0xe6b1('0x52')](_0xe6b1('0x53'),_0x119cef);throw _0x119cef;});}return _0x2199a6;})['then'](respondWithResult(_0x533608,0xc9))[_0xe6b1('0x46')](handleError(_0x533608,null));};exports['clone']=function(_0x25e1c7,_0xb07fff){var _0xe57aa5={'where':{'id':_0x25e1c7[_0xe6b1('0x47')]['id']}},_0x88b783={};_0x88b783[_0xe6b1('0x34')]=_[_0xe6b1('0x48')](db[_0xe6b1('0x2f')]['rawAttributes']);_0xe57aa5[_0xe6b1('0x37')]=_[_0xe6b1('0x36')](_0x88b783[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x25e1c7[_0xe6b1('0x35')][_0xe6b1('0x38')]));_0xe57aa5[_0xe6b1('0x37')]=_0xe57aa5[_0xe6b1('0x37')]['length']?_0xe57aa5[_0xe6b1('0x37')]:_0x88b783[_0xe6b1('0x34')];if(_0x25e1c7[_0xe6b1('0x35')][_0xe6b1('0x49')]){_0xe57aa5[_0xe6b1('0x4a')]=[{'all':!![]}];}_0xe57aa5=_[_0xe6b1('0x43')]({},_0xe57aa5,_0x25e1c7[_0xe6b1('0x44')]);return db[_0xe6b1('0x2f')][_0xe6b1('0x4b')](_0xe57aa5)['then'](handleEntityNotFound(_0xb07fff,null))[_0xe6b1('0x29')](function(_0xfa4f2b){if(_0xfa4f2b){var _0x187453=_0xfa4f2b[_0xe6b1('0x26')]({'plain':!![]});_0x187453=qs[_0xe6b1('0x54')](_0x187453,['id',_0xe6b1('0x55'),_0xe6b1('0x56')]);_0x25e1c7['body']=_[_0xe6b1('0x54')](_0x25e1c7[_0xe6b1('0x57')],['id',_0xe6b1('0x55'),_0xe6b1('0x56')]);return db[_0xe6b1('0x2f')][_0xe6b1('0x4c')](_[_0xe6b1('0x43')](_0x187453,_0x25e1c7[_0xe6b1('0x57')]),{'include':_0x25e1c7['query'][_0xe6b1('0x49')]?[{'all':!![]}]:undefined})[_0xe6b1('0x29')](function(_0x112b2e){var _0x54e0b3=_0x25e1c7[_0xe6b1('0x4d')][_0xe6b1('0x26')]({'plain':!![]});if(!_0x54e0b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54e0b3['role']===_0xe6b1('0x4d')){var _0x38803f=_0x112b2e[_0xe6b1('0x26')]({'plain':!![]});var _0x165b12=_0xe6b1('0x27');return db['UserProfileSection'][_0xe6b1('0x4b')]({'where':{'name':_0x165b12,'userProfileId':_0x54e0b3['userProfileId']},'raw':!![]})['then'](function(_0x1198e5){if(_0x1198e5&&_0x1198e5[_0xe6b1('0x51')]===0x0){return db[_0xe6b1('0x28')][_0xe6b1('0x4c')]({'name':_0x38803f[_0xe6b1('0x2b')],'resourceId':_0x38803f['id'],'type':_0x1198e5[_0xe6b1('0x2b')],'sectionId':_0x1198e5['id']},{})[_0xe6b1('0x29')](function(){return _0x112b2e;});}else{return _0x112b2e;}})[_0xe6b1('0x46')](function(_0xc6d092){logger[_0xe6b1('0x52')](_0xe6b1('0x53'),_0xc6d092);throw _0xc6d092;});}return _0x112b2e;});}})[_0xe6b1('0x29')](respondWithResult(_0xb07fff,0xc9))['catch'](handleError(_0xb07fff,null));};exports[_0xe6b1('0x24')]=function(_0x526e4c,_0x2799a4){if(_0x526e4c[_0xe6b1('0x57')]['id']){delete _0x526e4c[_0xe6b1('0x57')]['id'];}return db[_0xe6b1('0x2f')]['find']({'where':{'id':_0x526e4c['params']['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0x2799a4,null))['then'](saveUpdates(_0x526e4c['body'],null))['then'](respondWithResult(_0x2799a4,null))[_0xe6b1('0x46')](handleError(_0x2799a4,null));};exports['destroy']=function(_0x410b9e,_0xca9809){return db[_0xe6b1('0x2f')][_0xe6b1('0x4b')]({'where':{'id':_0x410b9e['params']['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0xca9809,null))[_0xe6b1('0x29')](removeEntity(_0xca9809,null))[_0xe6b1('0x46')](handleError(_0xca9809,null));};exports[_0xe6b1('0x58')]=function(_0xa6259,_0x12ef99,_0x1ddfa3){var _0x1d460f={'raw':!![],'where':{}};var _0x2022d4={};var _0x376d67={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe6b1('0x59')]({'where':{'id':_0xa6259[_0xe6b1('0x47')]['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0x12ef99,null))[_0xe6b1('0x29')](function(_0x25be40){if(_0x25be40){_0x2022d4[_0xe6b1('0x34')]=_['keys'](db['JscriptySessionReport'][_0xe6b1('0x30')]);_0x2022d4['query']=_[_0xe6b1('0x48')](_0xa6259[_0xe6b1('0x35')]);_0x2022d4['filters']=_['intersection'](_0x2022d4[_0xe6b1('0x34')],_0x2022d4[_0xe6b1('0x35')]);_0x1d460f[_0xe6b1('0x37')]=_['intersection'](_0x2022d4[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0xa6259['query']['fields']));_0x1d460f[_0xe6b1('0x37')]=_0x1d460f[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x1d460f[_0xe6b1('0x37')]:_0x2022d4[_0xe6b1('0x34')];if(!_0xa6259[_0xe6b1('0x35')][_0xe6b1('0x3a')](_0xe6b1('0x3b'))){_0x1d460f[_0xe6b1('0x20')]=qs[_0xe6b1('0x20')](_0xa6259[_0xe6b1('0x35')]['limit']);_0x1d460f['offset']=qs[_0xe6b1('0x1f')](_0xa6259['query'][_0xe6b1('0x1f')]);}_0x1d460f['order']=qs[_0xe6b1('0x3d')](_0xa6259[_0xe6b1('0x35')][_0xe6b1('0x3d')]);_0x1d460f['where']=qs[_0xe6b1('0x3e')](_[_0xe6b1('0x3f')](_0xa6259['query'],_0x2022d4['filters']));_0x1d460f[_0xe6b1('0x41')]['ProjectId']=_0x25be40['id'];if(_0xa6259['query'][_0xe6b1('0x40')]){_0x1d460f[_0xe6b1('0x41')]=_[_0xe6b1('0x43')](_0x1d460f['where'],{'$or':_[_0xe6b1('0x2e')](_0x1d460f[_0xe6b1('0x37')],function(_0x2e6702){var _0x2a8f88={};_0x2a8f88[_0x2e6702]={'$like':'%'+_0xa6259['query'][_0xe6b1('0x40')]+'%'};return _0x2a8f88;})});}_0x1d460f=_[_0xe6b1('0x43')]({},_0x1d460f,_0xa6259['options']);return db[_0xe6b1('0x5a')][_0xe6b1('0x21')]({'where':_0x1d460f[_0xe6b1('0x41')]})[_0xe6b1('0x29')](function(_0x8ddf3a){_0x376d67[_0xe6b1('0x21')]=_0x8ddf3a;if(_0xa6259['query'][_0xe6b1('0x49')]){_0x1d460f[_0xe6b1('0x4a')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xe6b1('0x45')](_0x1d460f);})[_0xe6b1('0x29')](function(_0x268aed){_0x376d67[_0xe6b1('0x5b')]=_0x268aed;return _0x376d67;});}})[_0xe6b1('0x29')](respondWithFilteredResult(_0x12ef99,_0x1d460f))[_0xe6b1('0x46')](handleError(_0x12ef99,null));};exports[_0xe6b1('0x5c')]=function(_0x46d77b,_0x4f277d,_0x5a631c){var _0x5764c9={'raw':!![],'where':{}};var _0x3adb15={};var _0x33096d={'count':0x0,'rows':[]};return db[_0xe6b1('0x2f')][_0xe6b1('0x59')]({'where':{'id':_0x46d77b[_0xe6b1('0x47')]['id']}})[_0xe6b1('0x29')](handleEntityNotFound(_0x4f277d,null))[_0xe6b1('0x29')](function(_0xe2a333){if(_0xe2a333){_0x3adb15[_0xe6b1('0x34')]=_[_0xe6b1('0x48')](db[_0xe6b1('0x5d')][_0xe6b1('0x30')]);_0x3adb15['query']=_[_0xe6b1('0x48')](_0x46d77b['query']);_0x3adb15[_0xe6b1('0x3e')]=_[_0xe6b1('0x36')](_0x3adb15[_0xe6b1('0x34')],_0x3adb15['query']);_0x5764c9[_0xe6b1('0x37')]=_['intersection'](_0x3adb15[_0xe6b1('0x34')],qs[_0xe6b1('0x38')](_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x38')]));_0x5764c9[_0xe6b1('0x37')]=_0x5764c9[_0xe6b1('0x37')][_0xe6b1('0x39')]?_0x5764c9[_0xe6b1('0x37')]:_0x3adb15[_0xe6b1('0x34')];if(!_0x46d77b['query'][_0xe6b1('0x3a')](_0xe6b1('0x3b'))){_0x5764c9[_0xe6b1('0x20')]=qs[_0xe6b1('0x20')](_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x20')]);_0x5764c9[_0xe6b1('0x1f')]=qs[_0xe6b1('0x1f')](_0x46d77b['query'][_0xe6b1('0x1f')]);}_0x5764c9[_0xe6b1('0x3c')]=qs[_0xe6b1('0x3d')](_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x3d')]);_0x5764c9[_0xe6b1('0x41')]=qs[_0xe6b1('0x3e')](_['pick'](_0x46d77b[_0xe6b1('0x35')],_0x3adb15[_0xe6b1('0x3e')]));_0x5764c9[_0xe6b1('0x41')]['ProjectId']=_0xe2a333['id'];if(_0x46d77b['query']['filter']){_0x5764c9['where']=_[_0xe6b1('0x43')](_0x5764c9[_0xe6b1('0x41')],{'$or':_[_0xe6b1('0x2e')](_0x5764c9['attributes'],function(_0x4d8dc8){var _0x2c523b={};_0x2c523b[_0x4d8dc8]={'$like':'%'+_0x46d77b['query'][_0xe6b1('0x40')]+'%'};return _0x2c523b;})});}_0x5764c9=_[_0xe6b1('0x43')]({},_0x5764c9,_0x46d77b['options']);return db['JscriptyAnswerReport'][_0xe6b1('0x21')]({'where':_0x5764c9[_0xe6b1('0x41')]})[_0xe6b1('0x29')](function(_0x1780e0){_0x33096d[_0xe6b1('0x21')]=_0x1780e0;if(_0x46d77b[_0xe6b1('0x35')][_0xe6b1('0x49')]){_0x5764c9[_0xe6b1('0x4a')]=[{'all':!![]}];}return db[_0xe6b1('0x5d')][_0xe6b1('0x45')](_0x5764c9);})[_0xe6b1('0x29')](function(_0x396259){_0x33096d['rows']=_0x396259;return _0x33096d;});}})[_0xe6b1('0x29')](respondWithFilteredResult(_0x4f277d,_0x5764c9))[_0xe6b1('0x46')](handleError(_0x4f277d,null));};function char(_0x3e39fa){return _0xe6b1('0x5e')===typeof _0x3e39fa?String['fromCharCode'][_0xe6b1('0x22')](null,arguments):_0x3e39fa;}function needsEncapsulation(_0x535cd6){return!!_0x535cd6&&(_0x535cd6[_0xe6b1('0x5f')]()[_0xe6b1('0x60')](char(0xd))>=0x0||_0x535cd6[_0xe6b1('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x535cd6['toString']()[_0xe6b1('0x60')](char(0x2c))>=0x0||_0x535cd6[_0xe6b1('0x5f')]()[_0xe6b1('0x60')](char(0x22))>=0x0);}function encapsulate(_0xde7f3d){var _0x462acd=char(0x22),_0x4a5534='\x5c'+char(0x22),_0x4a6729=_0xde7f3d[_0xe6b1('0x5f')]()['replace'](new RegExp(_0x462acd,'g'),_0x4a5534);return _0x462acd+_0x4a6729+_0x462acd;}exports[_0xe6b1('0x61')]=function(_0x18cd66,_0x1f19d7,_0x511f4b){var _0x3ca99c,_0x373e96;var _0x5e7c0e={'where':{'ProjectId':_0x18cd66[_0xe6b1('0x47')]['id']}};if(_0x18cd66['query']['startTime']){_0x5e7c0e[_0xe6b1('0x41')][_0xe6b1('0x62')]=JSON[_0xe6b1('0x63')](_0x18cd66[_0xe6b1('0x35')][_0xe6b1('0x64')]);}return db[_0xe6b1('0x5a')]['findAll'](_0x5e7c0e)[_0xe6b1('0x29')](handleEntityNotFound(_0x1f19d7,null))[_0xe6b1('0x29')](function(_0x30d567){if(_0x30d567){_0x3ca99c=_0x30d567;return db[_0xe6b1('0x65')]['findAll']({'where':{'SessionId':{'$in':_[_0xe6b1('0x2e')](_0x3ca99c,'id')},'ProjectId':_0x18cd66[_0xe6b1('0x47')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x1f19d7,null))['then'](function(_0x3ee576){if(_0x3ee576){_0x373e96=_0x3ee576;var _0x2e443b={};for(var _0x73092d=0x0,_0x5c76be=_0x373e96[_0xe6b1('0x39')];_0x73092d<_0x5c76be;_0x73092d++){if(!_0x2e443b['hasOwnProperty'](_0x373e96[_0x73092d][_0xe6b1('0x66')])){_0x2e443b[_0x373e96[_0x73092d]['questionId']]=needsEncapsulation(_0x373e96[_0x73092d][_0xe6b1('0x67')])?encapsulate(_0x373e96[_0x73092d]['question']):_0x373e96[_0x73092d][_0xe6b1('0x67')];}}var _0x3883fc=[],_0x1e4d9f={};for(var _0x3b2296=0x0,_0x165d7f=_0x3ca99c['length'];_0x3b2296<_0x165d7f;_0x3b2296++){_0x1e4d9f={'ProjectId':_0x18cd66[_0xe6b1('0x47')]['id'],'SessionId':_0x3ca99c[_0x3b2296]['id'],'StartTime':moment(_0x3ca99c[_0x3b2296][_0xe6b1('0x62')])[_0xe6b1('0x68')](_0xe6b1('0x69'))};for(var _0xd9c6bd=0x0,_0x4a5f2b=_0x373e96[_0xe6b1('0x39')];_0xd9c6bd<_0x4a5f2b;_0xd9c6bd++){if(_0x373e96[_0xd9c6bd]['SessionId']==_0x3ca99c[_0x3b2296]['id']&&_0x2e443b['hasOwnProperty'](_0x373e96[_0xd9c6bd][_0xe6b1('0x66')])){_0x1e4d9f[_0x2e443b[_0x373e96[_0xd9c6bd][_0xe6b1('0x66')]]]=_0x373e96[_0xd9c6bd][_0xe6b1('0x6a')];}}for(var _0x37ad90 in _0x2e443b){if(!_0x1e4d9f[_0xe6b1('0x3a')](_0x2e443b[_0x37ad90])){_0x1e4d9f[_0x2e443b[_0x37ad90]]=null;}}_0x3883fc['push'](_0x1e4d9f);}return _0x3883fc;}})[_0xe6b1('0x29')](function(_0x364c44){if(!_[_0xe6b1('0x6b')](_0x364c44)){var _0x2182de=toCsv(_0x364c44);var _0xbce7cf=Date[_0xe6b1('0x6c')]();fs[_0xe6b1('0x6d')](util[_0xe6b1('0x68')](_0xe6b1('0x6e'),_0x18cd66[_0xe6b1('0x47')]['id'],_0xbce7cf),_0x2182de);_0x1f19d7['setHeader'](_0xe6b1('0x6f'),'attachment;\x20filename='+util[_0xe6b1('0x68')](_0xe6b1('0x70'),_0x18cd66[_0xe6b1('0x47')]['id'],_0xbce7cf));_0x1f19d7[_0xe6b1('0x71')]('Content-type',_0xe6b1('0x72'));return _0x1f19d7['download'](util[_0xe6b1('0x68')](_0xe6b1('0x6e'),_0x18cd66['params']['id'],_0xbce7cf));}else{return _0x1f19d7[_0xe6b1('0x1b')](0xcc);}})['catch'](handleError(_0x1f19d7,null));};
\ No newline at end of file
+var _0x9354=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','UserProfileSection','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','writeFileSync','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','map','VIRTUAL','filter','merge','options','JscriptyProject','include','findAll','catch','params','keys','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x545a8a,_0x43d2ea){var _0x54b049=function(_0x424533){while(--_0x424533){_0x545a8a['push'](_0x545a8a['shift']());}};_0x54b049(++_0x43d2ea);}(_0x9354,0x96));var _0x4935=function(_0xc2b4c8,_0x756a49){_0xc2b4c8=_0xc2b4c8-0x0;var _0x402443=_0x9354[_0xc2b4c8];return _0x402443;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4935('0x0'));var zipdir=require(_0x4935('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4935('0x2'));var moment=require(_0x4935('0x3'));var BPromise=require(_0x4935('0x4'));var Mustache=require(_0x4935('0x5'));var util=require('util');var path=require(_0x4935('0x6'));var sox=require(_0x4935('0x7'));var csv=require(_0x4935('0x8'));var ejs=require(_0x4935('0x9'));var fs=require('fs');var fs_extra=require(_0x4935('0xa'));var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x8'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4935('0x16'))['db'];function respondWithStatusCode(_0x32916f,_0x3bb388){_0x3bb388=_0x3bb388||0xcc;return function(_0x1c6c22){if(_0x1c6c22){return _0x32916f[_0x4935('0x17')](_0x3bb388);}return _0x32916f[_0x4935('0x18')](_0x3bb388)[_0x4935('0x19')]();};}function respondWithResult(_0x3a7c30,_0x57549f){_0x57549f=_0x57549f||0xc8;return function(_0x237e28){if(_0x237e28){return _0x3a7c30[_0x4935('0x18')](_0x57549f)[_0x4935('0x1a')](_0x237e28);}};}function respondWithFilteredResult(_0xa41961,_0x3652c4){return function(_0x24cc99){if(_0x24cc99){var _0x395a43=typeof _0x3652c4['offset']===_0x4935('0x1b')&&typeof _0x3652c4[_0x4935('0x1c')]===_0x4935('0x1b');var _0x123300=_0x24cc99[_0x4935('0x1d')];var _0x429ef3=_0x395a43?0x0:_0x3652c4['offset'];var _0xd70eff=_0x395a43?_0x24cc99[_0x4935('0x1d')]:_0x3652c4['offset']+_0x3652c4[_0x4935('0x1c')];var _0x10407f;if(_0xd70eff>=_0x123300){_0xd70eff=_0x123300;_0x10407f=0xc8;}else{_0x10407f=0xce;}_0xa41961[_0x4935('0x18')](_0x10407f);return _0xa41961['set']('Content-Range',_0x429ef3+'-'+_0xd70eff+'/'+_0x123300)[_0x4935('0x1a')](_0x24cc99);}return null;};}function patchUpdates(_0x6b849f){return function(_0x1ae059){try{jsonpatch[_0x4935('0x1e')](_0x1ae059,_0x6b849f,!![]);}catch(_0x41d76e){return BPromise[_0x4935('0x1f')](_0x41d76e);}return _0x1ae059[_0x4935('0x20')]();};}function saveUpdates(_0xe482a5,_0x58b2f3){return function(_0x2f520a){if(_0x2f520a){return _0x2f520a[_0x4935('0x21')](_0xe482a5)[_0x4935('0x22')](function(_0x2c701f){return _0x2c701f;});}return null;};}function removeEntity(_0x52c65a,_0x53530f){return function(_0x4dc1f5){if(_0x4dc1f5){return _0x4dc1f5[_0x4935('0x23')]()[_0x4935('0x22')](function(){var _0x3786ff=_0x4dc1f5[_0x4935('0x24')]({'plain':!![]});var _0x344e51=_0x4935('0x25');return db[_0x4935('0x26')][_0x4935('0x23')]({'where':{'type':_0x344e51,'resourceId':_0x3786ff['id']}})[_0x4935('0x22')](function(){return _0x4dc1f5;});})[_0x4935('0x22')](function(){_0x52c65a[_0x4935('0x18')](0xcc)[_0x4935('0x19')]();});}};}function handleEntityNotFound(_0x2c47ab,_0xbb00d6){return function(_0x359522){if(!_0x359522){_0x2c47ab['sendStatus'](0x194);}return _0x359522;};}function handleError(_0x5c3aaa,_0x5cec4d){_0x5cec4d=_0x5cec4d||0x1f4;return function(_0x1fc218){logger[_0x4935('0x27')](_0x1fc218['stack']);if(_0x1fc218[_0x4935('0x28')]){delete _0x1fc218[_0x4935('0x28')];}_0x5c3aaa[_0x4935('0x18')](_0x5cec4d)[_0x4935('0x29')](_0x1fc218);};}exports[_0x4935('0x2a')]=function(_0x24262e,_0x28afc2){var _0x2fe6da={},_0x5b3c8e={},_0xb7fe2a={'count':0x0,'rows':[]};var _0x2dcb0b=_['map'](db['JscriptyProject'][_0x4935('0x2b')],function(_0x479d28){return{'name':_0x479d28[_0x4935('0x2c')],'type':_0x479d28[_0x4935('0x2d')][_0x4935('0x2e')]};});_0x5b3c8e['model']=_['map'](_0x2dcb0b,_0x4935('0x28'));_0x5b3c8e[_0x4935('0x2f')]=_['keys'](_0x24262e[_0x4935('0x2f')]);_0x5b3c8e[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5b3c8e[_0x4935('0x32')],_0x5b3c8e[_0x4935('0x2f')]);_0x2fe6da['attributes']=_['intersection'](_0x5b3c8e[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24262e['query']['fields']));_0x2fe6da[_0x4935('0x34')]=_0x2fe6da['attributes'][_0x4935('0x35')]?_0x2fe6da[_0x4935('0x34')]:_0x5b3c8e[_0x4935('0x32')];if(!_0x24262e[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x2fe6da['limit']=qs[_0x4935('0x1c')](_0x24262e['query'][_0x4935('0x1c')]);_0x2fe6da['offset']=qs[_0x4935('0x38')](_0x24262e['query'][_0x4935('0x38')]);}_0x2fe6da[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x24262e[_0x4935('0x2f')][_0x4935('0x3a')]);_0x2fe6da[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x24262e['query'],_0x5b3c8e[_0x4935('0x30')]),_0x2dcb0b);if(_0x24262e['query']['filter']){_0x2fe6da[_0x4935('0x3b')]=_['merge'](_0x2fe6da[_0x4935('0x3b')],{'$or':_[_0x4935('0x3c')](_0x2dcb0b,function(_0x2d67e3){if(_0x2d67e3[_0x4935('0x2d')]!==_0x4935('0x3d')){var _0x53aac5={};_0x53aac5[_0x2d67e3['name']]={'$like':'%'+_0x24262e[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x53aac5;}})});}_0x2fe6da=_[_0x4935('0x3f')]({},_0x2fe6da,_0x24262e[_0x4935('0x40')]);var _0x4d9436={'where':_0x2fe6da[_0x4935('0x3b')]};return db[_0x4935('0x41')][_0x4935('0x1d')](_0x4d9436)['then'](function(_0x4e94f6){_0xb7fe2a[_0x4935('0x1d')]=_0x4e94f6;if(_0x24262e[_0x4935('0x2f')]['includeAll']){_0x2fe6da[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x41')][_0x4935('0x43')](_0x2fe6da);})[_0x4935('0x22')](function(_0x52ab0c){_0xb7fe2a['rows']=_0x52ab0c;return _0xb7fe2a;})[_0x4935('0x22')](respondWithFilteredResult(_0x28afc2,_0x2fe6da))[_0x4935('0x44')](handleError(_0x28afc2,null));};exports['show']=function(_0x1eaa47,_0x40f5ff){var _0x2195da={'raw':![],'where':{'id':_0x1eaa47[_0x4935('0x45')]['id']}},_0x5135fd={};_0x5135fd[_0x4935('0x32')]=_[_0x4935('0x46')](db[_0x4935('0x41')][_0x4935('0x2b')]);_0x5135fd[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x1eaa47[_0x4935('0x2f')]);_0x5135fd[_0x4935('0x30')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],_0x5135fd[_0x4935('0x2f')]);_0x2195da[_0x4935('0x34')]=_[_0x4935('0x31')](_0x5135fd[_0x4935('0x32')],qs[_0x4935('0x33')](_0x1eaa47[_0x4935('0x2f')][_0x4935('0x33')]));_0x2195da['attributes']=_0x2195da[_0x4935('0x34')]['length']?_0x2195da[_0x4935('0x34')]:_0x5135fd[_0x4935('0x32')];if(_0x1eaa47[_0x4935('0x2f')][_0x4935('0x47')]){_0x2195da['include']=[{'all':!![]}];}_0x2195da=_[_0x4935('0x3f')]({},_0x2195da,_0x1eaa47[_0x4935('0x40')]);return db[_0x4935('0x41')][_0x4935('0x48')](_0x2195da)[_0x4935('0x22')](handleEntityNotFound(_0x40f5ff,null))[_0x4935('0x22')](respondWithResult(_0x40f5ff,null))[_0x4935('0x44')](handleError(_0x40f5ff,null));};exports[_0x4935('0x49')]=function(_0x29b932,_0x392cba){return db['JscriptyProject'][_0x4935('0x49')](_0x29b932[_0x4935('0x4a')],{})['then'](function(_0x447a64){var _0x2636f4=_0x29b932[_0x4935('0x4b')][_0x4935('0x24')]({'plain':!![]});if(!_0x2636f4)throw new Error(_0x4935('0x4c'));if(_0x2636f4[_0x4935('0x4d')]===_0x4935('0x4b')){var _0x471fb1=_0x447a64['get']({'plain':!![]});var _0x57d0d9='Projects';return db['UserProfileSection'][_0x4935('0x48')]({'where':{'name':_0x57d0d9,'userProfileId':_0x2636f4[_0x4935('0x4e')]},'raw':!![]})[_0x4935('0x22')](function(_0x2072df){if(_0x2072df&&_0x2072df[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0x471fb1[_0x4935('0x28')],'resourceId':_0x471fb1['id'],'type':_0x2072df[_0x4935('0x28')],'sectionId':_0x2072df['id']},{})[_0x4935('0x22')](function(){return _0x447a64;});}else{return _0x447a64;}})[_0x4935('0x44')](function(_0x8196b4){logger[_0x4935('0x27')](_0x4935('0x50'),_0x8196b4);throw _0x8196b4;});}return _0x447a64;})[_0x4935('0x22')](respondWithResult(_0x392cba,0xc9))[_0x4935('0x44')](handleError(_0x392cba,null));};exports['clone']=function(_0x24b83b,_0x4e99bb){var _0x3ad7a6={'where':{'id':_0x24b83b['params']['id']}},_0xe08e62={};_0xe08e62[_0x4935('0x32')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x3ad7a6[_0x4935('0x34')]=_[_0x4935('0x31')](_0xe08e62[_0x4935('0x32')],qs[_0x4935('0x33')](_0x24b83b[_0x4935('0x2f')]['fields']));_0x3ad7a6['attributes']=_0x3ad7a6[_0x4935('0x34')][_0x4935('0x35')]?_0x3ad7a6[_0x4935('0x34')]:_0xe08e62['model'];if(_0x24b83b[_0x4935('0x2f')][_0x4935('0x47')]){_0x3ad7a6[_0x4935('0x42')]=[{'all':!![]}];}_0x3ad7a6=_[_0x4935('0x3f')]({},_0x3ad7a6,_0x24b83b['options']);return db[_0x4935('0x41')]['find'](_0x3ad7a6)['then'](handleEntityNotFound(_0x4e99bb,null))['then'](function(_0x24d870){if(_0x24d870){var _0x10cd78=_0x24d870['get']({'plain':!![]});_0x10cd78=qs[_0x4935('0x51')](_0x10cd78,['id',_0x4935('0x52'),'updatedAt']);_0x24b83b[_0x4935('0x4a')]=_[_0x4935('0x51')](_0x24b83b[_0x4935('0x4a')],['id',_0x4935('0x52'),_0x4935('0x53')]);return db[_0x4935('0x41')][_0x4935('0x49')](_['merge'](_0x10cd78,_0x24b83b[_0x4935('0x4a')]),{'include':_0x24b83b['query']['includeAll']?[{'all':!![]}]:undefined})[_0x4935('0x22')](function(_0xc3fb8f){var _0x4f7dc2=_0x24b83b['user'][_0x4935('0x24')]({'plain':!![]});if(!_0x4f7dc2)throw new Error(_0x4935('0x4c'));if(_0x4f7dc2[_0x4935('0x4d')]==='user'){var _0xf52dea=_0xc3fb8f['get']({'plain':!![]});var _0x3003a6=_0x4935('0x25');return db[_0x4935('0x54')][_0x4935('0x48')]({'where':{'name':_0x3003a6,'userProfileId':_0x4f7dc2[_0x4935('0x4e')]},'raw':!![]})['then'](function(_0x1eb15d){if(_0x1eb15d&&_0x1eb15d[_0x4935('0x4f')]===0x0){return db['UserProfileResource'][_0x4935('0x49')]({'name':_0xf52dea[_0x4935('0x28')],'resourceId':_0xf52dea['id'],'type':_0x1eb15d[_0x4935('0x28')],'sectionId':_0x1eb15d['id']},{})[_0x4935('0x22')](function(){return _0xc3fb8f;});}else{return _0xc3fb8f;}})[_0x4935('0x44')](function(_0x48e793){logger[_0x4935('0x27')](_0x4935('0x50'),_0x48e793);throw _0x48e793;});}return _0xc3fb8f;});}})[_0x4935('0x22')](respondWithResult(_0x4e99bb,0xc9))[_0x4935('0x44')](handleError(_0x4e99bb,null));};exports[_0x4935('0x21')]=function(_0x5d4435,_0xa5380a){if(_0x5d4435[_0x4935('0x4a')]['id']){delete _0x5d4435[_0x4935('0x4a')]['id'];}return db[_0x4935('0x41')][_0x4935('0x48')]({'where':{'id':_0x5d4435[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0xa5380a,null))[_0x4935('0x22')](saveUpdates(_0x5d4435[_0x4935('0x4a')],null))[_0x4935('0x22')](respondWithResult(_0xa5380a,null))[_0x4935('0x44')](handleError(_0xa5380a,null));};exports[_0x4935('0x23')]=function(_0x3a427c,_0x4824fd){return db['JscriptyProject'][_0x4935('0x48')]({'where':{'id':_0x3a427c[_0x4935('0x45')]['id']}})['then'](handleEntityNotFound(_0x4824fd,null))[_0x4935('0x22')](removeEntity(_0x4824fd,null))[_0x4935('0x44')](handleError(_0x4824fd,null));};exports['getSessions']=function(_0x4c5cdc,_0x1a7f52,_0xa4fa28){var _0x304d73={'raw':!![],'where':{}};var _0x2abd63={};var _0x105e38={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x4935('0x55')]({'where':{'id':_0x4c5cdc[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x1a7f52,null))[_0x4935('0x22')](function(_0x583964){if(_0x583964){_0x2abd63[_0x4935('0x32')]=_['keys'](db['JscriptySessionReport'][_0x4935('0x2b')]);_0x2abd63[_0x4935('0x2f')]=_['keys'](_0x4c5cdc[_0x4935('0x2f')]);_0x2abd63[_0x4935('0x30')]=_[_0x4935('0x31')](_0x2abd63['model'],_0x2abd63[_0x4935('0x2f')]);_0x304d73['attributes']=_['intersection'](_0x2abd63[_0x4935('0x32')],qs[_0x4935('0x33')](_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x33')]));_0x304d73[_0x4935('0x34')]=_0x304d73[_0x4935('0x34')][_0x4935('0x35')]?_0x304d73[_0x4935('0x34')]:_0x2abd63['model'];if(!_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x304d73['limit']=qs['limit'](_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x1c')]);_0x304d73['offset']=qs[_0x4935('0x38')](_0x4c5cdc['query']['offset']);}_0x304d73[_0x4935('0x39')]=qs[_0x4935('0x3a')](_0x4c5cdc[_0x4935('0x2f')]['sort']);_0x304d73['where']=qs[_0x4935('0x30')](_['pick'](_0x4c5cdc[_0x4935('0x2f')],_0x2abd63['filters']));_0x304d73[_0x4935('0x3b')][_0x4935('0x56')]=_0x583964['id'];if(_0x4c5cdc[_0x4935('0x2f')][_0x4935('0x3e')]){_0x304d73[_0x4935('0x3b')]=_[_0x4935('0x3f')](_0x304d73[_0x4935('0x3b')],{'$or':_['map'](_0x304d73[_0x4935('0x34')],function(_0x493392){var _0x2f2faf={};_0x2f2faf[_0x493392]={'$like':'%'+_0x4c5cdc[_0x4935('0x2f')]['filter']+'%'};return _0x2f2faf;})});}_0x304d73=_[_0x4935('0x3f')]({},_0x304d73,_0x4c5cdc['options']);return db[_0x4935('0x57')][_0x4935('0x1d')]({'where':_0x304d73['where']})['then'](function(_0x530e9f){_0x105e38[_0x4935('0x1d')]=_0x530e9f;if(_0x4c5cdc['query']['includeAll']){_0x304d73[_0x4935('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x4935('0x43')](_0x304d73);})['then'](function(_0x497246){_0x105e38['rows']=_0x497246;return _0x105e38;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x1a7f52,_0x304d73))['catch'](handleError(_0x1a7f52,null));};exports[_0x4935('0x58')]=function(_0x29dfcf,_0x22aa42,_0x41efae){var _0x32495e={'raw':!![],'where':{}};var _0x4a240b={};var _0x415c24={'count':0x0,'rows':[]};return db[_0x4935('0x41')]['findOne']({'where':{'id':_0x29dfcf[_0x4935('0x45')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x22aa42,null))['then'](function(_0x1ffef1){if(_0x1ffef1){_0x4a240b[_0x4935('0x32')]=_['keys'](db[_0x4935('0x59')]['rawAttributes']);_0x4a240b[_0x4935('0x2f')]=_[_0x4935('0x46')](_0x29dfcf['query']);_0x4a240b[_0x4935('0x30')]=_[_0x4935('0x31')](_0x4a240b['model'],_0x4a240b['query']);_0x32495e[_0x4935('0x34')]=_[_0x4935('0x31')](_0x4a240b['model'],qs[_0x4935('0x33')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x33')]));_0x32495e[_0x4935('0x34')]=_0x32495e['attributes'][_0x4935('0x35')]?_0x32495e[_0x4935('0x34')]:_0x4a240b['model'];if(!_0x29dfcf[_0x4935('0x2f')][_0x4935('0x36')](_0x4935('0x37'))){_0x32495e[_0x4935('0x1c')]=qs[_0x4935('0x1c')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x1c')]);_0x32495e[_0x4935('0x38')]=qs[_0x4935('0x38')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x38')]);}_0x32495e['order']=qs[_0x4935('0x3a')](_0x29dfcf[_0x4935('0x2f')][_0x4935('0x3a')]);_0x32495e[_0x4935('0x3b')]=qs[_0x4935('0x30')](_['pick'](_0x29dfcf[_0x4935('0x2f')],_0x4a240b[_0x4935('0x30')]));_0x32495e['where'][_0x4935('0x56')]=_0x1ffef1['id'];if(_0x29dfcf[_0x4935('0x2f')]['filter']){_0x32495e[_0x4935('0x3b')]=_[_0x4935('0x3f')](_0x32495e[_0x4935('0x3b')],{'$or':_['map'](_0x32495e[_0x4935('0x34')],function(_0x23165d){var _0x7240af={};_0x7240af[_0x23165d]={'$like':'%'+_0x29dfcf[_0x4935('0x2f')][_0x4935('0x3e')]+'%'};return _0x7240af;})});}_0x32495e=_['merge']({},_0x32495e,_0x29dfcf[_0x4935('0x40')]);return db[_0x4935('0x59')][_0x4935('0x1d')]({'where':_0x32495e[_0x4935('0x3b')]})[_0x4935('0x22')](function(_0x44f9fc){_0x415c24['count']=_0x44f9fc;if(_0x29dfcf[_0x4935('0x2f')][_0x4935('0x47')]){_0x32495e[_0x4935('0x42')]=[{'all':!![]}];}return db[_0x4935('0x59')][_0x4935('0x43')](_0x32495e);})[_0x4935('0x22')](function(_0x23fd89){_0x415c24['rows']=_0x23fd89;return _0x415c24;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x22aa42,_0x32495e))[_0x4935('0x44')](handleError(_0x22aa42,null));};function char(_0x42bdf0){return _0x4935('0x5a')===typeof _0x42bdf0?String[_0x4935('0x5b')]['apply'](null,arguments):_0x42bdf0;}function needsEncapsulation(_0x550728){return!!_0x550728&&(_0x550728[_0x4935('0x5c')]()[_0x4935('0x5d')](char(0xd))>=0x0||_0x550728[_0x4935('0x5c')]()[_0x4935('0x5d')](char(0xa))>=0x0||_0x550728[_0x4935('0x5c')]()['indexOf'](char(0x2c))>=0x0||_0x550728[_0x4935('0x5c')]()[_0x4935('0x5d')](char(0x22))>=0x0);}function encapsulate(_0xd682c5){var _0x478ef6=char(0x22),_0x5ccc66='\x5c'+char(0x22),_0xfab40=_0xd682c5[_0x4935('0x5c')]()[_0x4935('0x5e')](new RegExp(_0x478ef6,'g'),_0x5ccc66);return _0x478ef6+_0xfab40+_0x478ef6;}exports[_0x4935('0x5f')]=function(_0x38eb00,_0xe60fe,_0x47e1dd){var _0x1e91a8,_0x5e4177;var _0x44af25={'where':{'ProjectId':_0x38eb00['params']['id']}};if(_0x38eb00['query'][_0x4935('0x60')]){_0x44af25['where']['starttime']=JSON[_0x4935('0x61')](_0x38eb00[_0x4935('0x2f')]['startTime']);}return db[_0x4935('0x57')]['findAll'](_0x44af25)[_0x4935('0x22')](handleEntityNotFound(_0xe60fe,null))[_0x4935('0x22')](function(_0x338d0e){if(_0x338d0e){_0x1e91a8=_0x338d0e;return db[_0x4935('0x62')][_0x4935('0x43')]({'where':{'SessionId':{'$in':_[_0x4935('0x3c')](_0x1e91a8,'id')},'ProjectId':_0x38eb00['params']['id']},'order':_0x4935('0x63')});}})[_0x4935('0x22')](handleEntityNotFound(_0xe60fe,null))[_0x4935('0x22')](function(_0x5d53e6){if(_0x5d53e6){_0x5e4177=_0x5d53e6;var _0x2f3d51={};for(var _0xea6cf6=0x0,_0xf55e5f=_0x5e4177['length'];_0xea6cf6<_0xf55e5f;_0xea6cf6++){if(!_0x2f3d51[_0x4935('0x36')](_0x5e4177[_0xea6cf6][_0x4935('0x64')])){_0x2f3d51[_0x5e4177[_0xea6cf6][_0x4935('0x64')]]=needsEncapsulation(_0x5e4177[_0xea6cf6][_0x4935('0x65')])?encapsulate(_0x5e4177[_0xea6cf6][_0x4935('0x65')]):_0x5e4177[_0xea6cf6]['question'];}}var _0x3fa0e0=[],_0x490c7d={};for(var _0x19fe30=0x0,_0x4bc3e7=_0x1e91a8[_0x4935('0x35')];_0x19fe30<_0x4bc3e7;_0x19fe30++){_0x490c7d={'ProjectId':_0x38eb00['params']['id'],'SessionId':_0x1e91a8[_0x19fe30]['id'],'StartTime':moment(_0x1e91a8[_0x19fe30][_0x4935('0x66')])[_0x4935('0x67')](_0x4935('0x68'))};for(var _0x5d9398=0x0,_0x31d209=_0x5e4177[_0x4935('0x35')];_0x5d9398<_0x31d209;_0x5d9398++){if(_0x5e4177[_0x5d9398][_0x4935('0x69')]==_0x1e91a8[_0x19fe30]['id']&&_0x2f3d51[_0x4935('0x36')](_0x5e4177[_0x5d9398][_0x4935('0x64')])){_0x490c7d[_0x2f3d51[_0x5e4177[_0x5d9398][_0x4935('0x64')]]]=_0x5e4177[_0x5d9398][_0x4935('0x6a')];}}for(var _0x1fc18e in _0x2f3d51){if(!_0x490c7d[_0x4935('0x36')](_0x2f3d51[_0x1fc18e])){_0x490c7d[_0x2f3d51[_0x1fc18e]]=null;}}_0x3fa0e0['push'](_0x490c7d);}return _0x3fa0e0;}})[_0x4935('0x22')](function(_0x395908){if(!_[_0x4935('0x6b')](_0x395908)){var _0x1c1f95=toCsv(_0x395908);var _0x2df4fc=Date[_0x4935('0x6c')]();fs[_0x4935('0x6d')](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x38eb00[_0x4935('0x45')]['id'],_0x2df4fc),_0x1c1f95);_0xe60fe['setHeader']('Content-disposition',_0x4935('0x6e')+util[_0x4935('0x67')](_0x4935('0x6f'),_0x38eb00[_0x4935('0x45')]['id'],_0x2df4fc));_0xe60fe['setHeader'](_0x4935('0x70'),_0x4935('0x71'));return _0xe60fe['download'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x38eb00['params']['id'],_0x2df4fc));}else{return _0xe60fe['sendStatus'](0xcc);}})[_0x4935('0x44')](handleError(_0xe60fe,null));};
\ No newline at end of file
index aa307d4..4fb2933 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d25=['path','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1d25,0xba));var _0x51d2=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x1d25[_0x1d1219];return _0x5b5b89;};'use strict';var _=require(_0x51d2('0x0'));var util=require(_0x51d2('0x1'));var logger=require(_0x51d2('0x2'))(_0x51d2('0x3'));var moment=require(_0x51d2('0x4'));var BPromise=require('bluebird');var rp=require(_0x51d2('0x5'));var fs=require('fs');var path=require(_0x51d2('0x6'));var rimraf=require('rimraf');var config=require(_0x51d2('0x7'));var attributes=require(_0x51d2('0x8'));module[_0x51d2('0x9')]=function(_0x407091,_0x449fec){return _0x407091[_0x51d2('0xa')]('JscriptyProject',attributes,{'tableName':_0x51d2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6f1=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','./jscriptyProject.attributes','exports','JscriptyProject','jscripty_projects'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb6f1,0x118));var _0x1b6f=function(_0x5a26db,_0x2c5ccd){_0x5a26db=_0x5a26db-0x0;var _0x4619dd=_0xb6f1[_0x5a26db];return _0x4619dd;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var logger=require(_0x1b6f('0x1'))('api');var moment=require(_0x1b6f('0x2'));var BPromise=require(_0x1b6f('0x3'));var rp=require(_0x1b6f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b6f('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b6f('0x6'));module[_0x1b6f('0x7')]=function(_0xd4703b,_0x493c91){return _0xd4703b['define'](_0x1b6f('0x8'),attributes,{'tableName':_0x1b6f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d19f0fd..3d774e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4375af,_0x1c9918){var _0x138c81=function(_0x2db49c){while(--_0x2db49c){_0x4375af['push'](_0x4375af['shift']());}};_0x138c81(++_0x1c9918);}(_0xf4eb,0xec));var _0xbf4e=function(_0x58437f,_0x52723b){_0x58437f=_0x58437f-0x0;var _0x2f13ef=_0xf4eb[_0x58437f];return _0x2f13ef;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}
\ No newline at end of file
+var _0x9bde=['code','message','JscriptyProject,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x302411,_0x3c5147){var _0x3ddd54=function(_0x5425d8){while(--_0x5425d8){_0x302411['push'](_0x302411['shift']());}};_0x3ddd54(++_0x3c5147);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5a62b0,_0x531680){_0x5a62b0=_0x5a62b0-0x0;var _0xe2ca09=_0x9bde[_0x5a62b0];return _0xe2ca09;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});}
\ No newline at end of file
index 47bca4d..dd0f5d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ae=['../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc8ae,0x73));var _0xec8a=function(_0x1898d8,_0x20eabe){_0x1898d8=_0x1898d8-0x0;var _0x41e35c=_0xc8ae[_0x1898d8];return _0x41e35c;};'use strict';var multer=require('multer');var util=require(_0xec8a('0x0'));var path=require(_0xec8a('0x1'));var timeout=require(_0xec8a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xec8a('0x3'));var auth=require(_0xec8a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xec8a('0x5'));var controller=require(_0xec8a('0x6'));router['get']('/',auth[_0xec8a('0x7')](),controller[_0xec8a('0x8')]);router[_0xec8a('0x9')]('/describe',auth[_0xec8a('0x7')](),controller[_0xec8a('0xa')]);router[_0xec8a('0x9')](_0xec8a('0xb'),auth[_0xec8a('0x7')](),controller[_0xec8a('0xc')]);router[_0xec8a('0xd')]('/',auth[_0xec8a('0x7')](),controller[_0xec8a('0xe')]);router[_0xec8a('0xf')](_0xec8a('0xb'),auth[_0xec8a('0x7')](),controller[_0xec8a('0x10')]);router[_0xec8a('0x11')](_0xec8a('0xb'),auth[_0xec8a('0x7')](),controller[_0xec8a('0x12')]);module[_0xec8a('0x13')]=router;
\ No newline at end of file
+var _0xa3d0=['update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','post'];(function(_0x358e83,_0x1db30d){var _0x3da745=function(_0x48fcec){while(--_0x48fcec){_0x358e83['push'](_0x358e83['shift']());}};_0x3da745(++_0x1db30d);}(_0xa3d0,0x169));var _0x0a3d=function(_0x5ab8ae,_0x17821a){_0x5ab8ae=_0x5ab8ae-0x0;var _0x129f8a=_0xa3d0[_0x5ab8ae];return _0x129f8a;};'use strict';var multer=require(_0x0a3d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0a3d('0x1'));var express=require(_0x0a3d('0x2'));var router=express[_0x0a3d('0x3')]();var fs_extra=require(_0x0a3d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0a3d('0x5'));var config=require(_0x0a3d('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x0a3d('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a3d('0x8')]);router[_0x0a3d('0x7')](_0x0a3d('0x9'),auth[_0x0a3d('0xa')](),controller['describe']);router[_0x0a3d('0x7')](_0x0a3d('0xb'),auth[_0x0a3d('0xa')](),controller['show']);router[_0x0a3d('0xc')]('/',auth[_0x0a3d('0xa')](),controller['create']);router['put']('/:id',auth[_0x0a3d('0xa')](),controller[_0x0a3d('0xd')]);router[_0x0a3d('0xe')](_0x0a3d('0xb'),auth[_0x0a3d('0xa')](),controller[_0x0a3d('0xf')]);module[_0x0a3d('0x10')]=router;
\ No newline at end of file
index fb1a179..0709499 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7a54,0x106));var _0x47a5=function(_0x30e85a,_0x38e5b9){_0x30e85a=_0x30e85a-0x0;var _0x59770d=_0x7a54[_0x30e85a];return _0x59770d;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x4353c0,_0x512d64){_0x4353c0=_0x4353c0-0x0;var _0x88cbb6=_0x7a54[_0x4353c0];return _0x88cbb6;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index c21c0ba..79a7d1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe98c=['create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','includeAll','findAll','catch','params','length','include','merge','find'];(function(_0x2a0350,_0x249319){var _0x425220=function(_0x1d5f78){while(--_0x1d5f78){_0x2a0350['push'](_0x2a0350['shift']());}};_0x425220(++_0x249319);}(_0xe98c,0x1c6));var _0xce98=function(_0x59f6be,_0x472a09){_0x59f6be=_0x59f6be-0x0;var _0x2aef59=_0xe98c[_0x59f6be];return _0x2aef59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce98('0x0'));var zipdir=require(_0xce98('0x1'));var jsonpatch=require(_0xce98('0x2'));var rp=require(_0xce98('0x3'));var moment=require('moment');var BPromise=require(_0xce98('0x4'));var Mustache=require(_0xce98('0x5'));var util=require(_0xce98('0x6'));var path=require(_0xce98('0x7'));var sox=require(_0xce98('0x8'));var csv=require(_0xce98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce98('0xa'));var _=require(_0xce98('0xb'));var squel=require(_0xce98('0xc'));var crypto=require(_0xce98('0xd'));var jsforce=require(_0xce98('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xce98('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xce98('0xf'));var authService=require(_0xce98('0x10'));var qs=require(_0xce98('0x11'));var as=require(_0xce98('0x12'));var hardwareService=require(_0xce98('0x13'));var logger=require(_0xce98('0x14'))(_0xce98('0x15'));var utils=require(_0xce98('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xce98('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281f7c,_0xc6222d){_0xc6222d=_0xc6222d||0xcc;return function(_0xbd86d8){if(_0xbd86d8){return _0x281f7c[_0xce98('0x18')](_0xc6222d);}return _0x281f7c[_0xce98('0x19')](_0xc6222d)[_0xce98('0x1a')]();};}function respondWithResult(_0x22fa21,_0x6b1163){_0x6b1163=_0x6b1163||0xc8;return function(_0xe59a16){if(_0xe59a16){return _0x22fa21[_0xce98('0x19')](_0x6b1163)[_0xce98('0x1b')](_0xe59a16);}};}function respondWithFilteredResult(_0x1a9a9c,_0x3b94fc){return function(_0x3a72fa){if(_0x3a72fa){var _0x4601a5=typeof _0x3b94fc[_0xce98('0x1c')]===_0xce98('0x1d')&&typeof _0x3b94fc[_0xce98('0x1e')]===_0xce98('0x1d');var _0x29f629=_0x3a72fa[_0xce98('0x1f')];var _0x17d7e9=_0x4601a5?0x0:_0x3b94fc['offset'];var _0x11ecd2=_0x4601a5?_0x3a72fa[_0xce98('0x1f')]:_0x3b94fc[_0xce98('0x1c')]+_0x3b94fc[_0xce98('0x1e')];var _0x74336e;if(_0x11ecd2>=_0x29f629){_0x11ecd2=_0x29f629;_0x74336e=0xc8;}else{_0x74336e=0xce;}_0x1a9a9c[_0xce98('0x19')](_0x74336e);return _0x1a9a9c['set']('Content-Range',_0x17d7e9+'-'+_0x11ecd2+'/'+_0x29f629)[_0xce98('0x1b')](_0x3a72fa);}return null;};}function patchUpdates(_0xd05505){return function(_0x19fc56){try{jsonpatch[_0xce98('0x20')](_0x19fc56,_0xd05505,!![]);}catch(_0x32f4bd){return BPromise[_0xce98('0x21')](_0x32f4bd);}return _0x19fc56[_0xce98('0x22')]();};}function saveUpdates(_0x1c0bd8,_0x839600){return function(_0xa18e7b){if(_0xa18e7b){return _0xa18e7b[_0xce98('0x23')](_0x1c0bd8)[_0xce98('0x24')](function(_0x2e5d58){return _0x2e5d58;});}return null;};}function removeEntity(_0x3f4b1a,_0x4cea28){return function(_0xbdfd60){if(_0xbdfd60){return _0xbdfd60['destroy']()['then'](function(){_0x3f4b1a[_0xce98('0x19')](0xcc)[_0xce98('0x1a')]();});}};}function handleEntityNotFound(_0x9e1b7e,_0x266b60){return function(_0x21e8b3){if(!_0x21e8b3){_0x9e1b7e[_0xce98('0x18')](0x194);}return _0x21e8b3;};}function handleError(_0x2753c7,_0x1cbe02){_0x1cbe02=_0x1cbe02||0x1f4;return function(_0x234406){logger[_0xce98('0x25')](_0x234406[_0xce98('0x26')]);if(_0x234406['name']){delete _0x234406[_0xce98('0x27')];}_0x2753c7[_0xce98('0x19')](_0x1cbe02)[_0xce98('0x28')](_0x234406);};}exports[_0xce98('0x29')]=function(_0x3c4cfc,_0x2d7a16){var _0x1caa52={},_0x32a0a8={},_0x37eadd={'count':0x0,'rows':[]};var _0xd55217=_[_0xce98('0x2a')](db[_0xce98('0x2b')][_0xce98('0x2c')],function(_0x4ce974){return{'name':_0x4ce974[_0xce98('0x2d')],'type':_0x4ce974[_0xce98('0x2e')][_0xce98('0x2f')]};});_0x32a0a8[_0xce98('0x30')]=_['map'](_0xd55217,_0xce98('0x27'));_0x32a0a8[_0xce98('0x31')]=_[_0xce98('0x32')](_0x3c4cfc['query']);_0x32a0a8[_0xce98('0x33')]=_['intersection'](_0x32a0a8[_0xce98('0x30')],_0x32a0a8[_0xce98('0x31')]);_0x1caa52[_0xce98('0x34')]=_[_0xce98('0x35')](_0x32a0a8[_0xce98('0x30')],qs[_0xce98('0x36')](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x36')]));_0x1caa52[_0xce98('0x34')]=_0x1caa52[_0xce98('0x34')]['length']?_0x1caa52['attributes']:_0x32a0a8[_0xce98('0x30')];if(!_0x3c4cfc['query'][_0xce98('0x37')](_0xce98('0x38'))){_0x1caa52[_0xce98('0x1e')]=qs['limit'](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x1e')]);_0x1caa52[_0xce98('0x1c')]=qs[_0xce98('0x1c')](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x1c')]);}_0x1caa52[_0xce98('0x39')]=qs[_0xce98('0x3a')](_0x3c4cfc[_0xce98('0x31')][_0xce98('0x3a')]);_0x1caa52[_0xce98('0x3b')]=qs[_0xce98('0x33')](_['pick'](_0x3c4cfc[_0xce98('0x31')],_0x32a0a8['filters']),_0xd55217);if(_0x3c4cfc[_0xce98('0x31')]['filter']){_0x1caa52['where']=_['merge'](_0x1caa52['where'],{'$or':_['map'](_0xd55217,function(_0x1636c1){if(_0x1636c1[_0xce98('0x2e')]!==_0xce98('0x3c')){var _0x19b583={};_0x19b583[_0x1636c1[_0xce98('0x27')]]={'$like':'%'+_0x3c4cfc[_0xce98('0x31')][_0xce98('0x3d')]+'%'};return _0x19b583;}})});}_0x1caa52=_['merge']({},_0x1caa52,_0x3c4cfc[_0xce98('0x3e')]);var _0x11b51b={'where':_0x1caa52['where']};return db[_0xce98('0x2b')][_0xce98('0x1f')](_0x11b51b)[_0xce98('0x24')](function(_0x4c25b8){_0x37eadd[_0xce98('0x1f')]=_0x4c25b8;if(_0x3c4cfc[_0xce98('0x31')][_0xce98('0x3f')]){_0x1caa52['include']=[{'all':!![]}];}return db[_0xce98('0x2b')][_0xce98('0x40')](_0x1caa52);})[_0xce98('0x24')](function(_0x58f03e){_0x37eadd['rows']=_0x58f03e;return _0x37eadd;})[_0xce98('0x24')](respondWithFilteredResult(_0x2d7a16,_0x1caa52))[_0xce98('0x41')](handleError(_0x2d7a16,null));};exports['show']=function(_0x2f839c,_0x16f3e7){var _0xbf5914={'raw':!![],'where':{'id':_0x2f839c[_0xce98('0x42')]['id']}},_0xca343f={};_0xca343f[_0xce98('0x30')]=_[_0xce98('0x32')](db['JscriptyQuestionReport'][_0xce98('0x2c')]);_0xca343f[_0xce98('0x31')]=_[_0xce98('0x32')](_0x2f839c[_0xce98('0x31')]);_0xca343f[_0xce98('0x33')]=_[_0xce98('0x35')](_0xca343f[_0xce98('0x30')],_0xca343f[_0xce98('0x31')]);_0xbf5914[_0xce98('0x34')]=_[_0xce98('0x35')](_0xca343f[_0xce98('0x30')],qs[_0xce98('0x36')](_0x2f839c[_0xce98('0x31')][_0xce98('0x36')]));_0xbf5914[_0xce98('0x34')]=_0xbf5914[_0xce98('0x34')][_0xce98('0x43')]?_0xbf5914[_0xce98('0x34')]:_0xca343f['model'];if(_0x2f839c[_0xce98('0x31')][_0xce98('0x3f')]){_0xbf5914[_0xce98('0x44')]=[{'all':!![]}];}_0xbf5914=_[_0xce98('0x45')]({},_0xbf5914,_0x2f839c['options']);return db[_0xce98('0x2b')][_0xce98('0x46')](_0xbf5914)[_0xce98('0x24')](handleEntityNotFound(_0x16f3e7,null))[_0xce98('0x24')](respondWithResult(_0x16f3e7,null))[_0xce98('0x41')](handleError(_0x16f3e7,null));};exports[_0xce98('0x47')]=function(_0x1bedaf,_0x38690c){return db[_0xce98('0x2b')][_0xce98('0x47')](_0x1bedaf['body'],{})['then'](respondWithResult(_0x38690c,0xc9))[_0xce98('0x41')](handleError(_0x38690c,null));};exports[_0xce98('0x23')]=function(_0x14ba60,_0x4ce36c){if(_0x14ba60[_0xce98('0x48')]['id']){delete _0x14ba60[_0xce98('0x48')]['id'];}return db[_0xce98('0x2b')][_0xce98('0x46')]({'where':{'id':_0x14ba60[_0xce98('0x42')]['id']}})[_0xce98('0x24')](handleEntityNotFound(_0x4ce36c,null))[_0xce98('0x24')](saveUpdates(_0x14ba60[_0xce98('0x48')],null))[_0xce98('0x24')](respondWithResult(_0x4ce36c,null))['catch'](handleError(_0x4ce36c,null));};exports[_0xce98('0x49')]=function(_0x552982,_0x387caa){return db['JscriptyQuestionReport'][_0xce98('0x46')]({'where':{'id':_0x552982[_0xce98('0x42')]['id']}})[_0xce98('0x24')](handleEntityNotFound(_0x387caa,null))[_0xce98('0x24')](removeEntity(_0x387caa,null))[_0xce98('0x41')](handleError(_0x387caa,null));};exports[_0xce98('0x4a')]=function(_0x49046d,_0x10251f){return db[_0xce98('0x2b')]['describe']()[_0xce98('0x24')](respondWithResult(_0x10251f,null))[_0xce98('0x41')](handleError(_0x10251f,null));};
\ No newline at end of file
+var _0x46b4=['sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','update','then','destroy','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','filters','length','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path'];(function(_0x35b195,_0x8893d5){var _0x2433bf=function(_0x22be07){while(--_0x22be07){_0x35b195['push'](_0x35b195['shift']());}};_0x2433bf(++_0x8893d5);}(_0x46b4,0x8b));var _0x446b=function(_0x1e87b3,_0x4b48b1){_0x1e87b3=_0x1e87b3-0x0;var _0x2a5ccf=_0x46b4[_0x1e87b3];return _0x2a5ccf;};'use strict';var emlformat=require(_0x446b('0x0'));var rimraf=require(_0x446b('0x1'));var zipdir=require(_0x446b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x446b('0x3'));var moment=require(_0x446b('0x4'));var BPromise=require(_0x446b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x446b('0x6'));var sox=require(_0x446b('0x7'));var csv=require(_0x446b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x446b('0x9'));var _=require(_0x446b('0xa'));var squel=require(_0x446b('0xb'));var crypto=require(_0x446b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x446b('0xd'));var toCsv=require(_0x446b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x446b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x446b('0xf'));var as=require(_0x446b('0x10'));var hardwareService=require(_0x446b('0x11'));var logger=require(_0x446b('0x12'))('api');var utils=require(_0x446b('0x13'));var config=require(_0x446b('0x14'));var licenseUtil=require(_0x446b('0x15'));var db=require(_0x446b('0x16'))['db'];function respondWithStatusCode(_0x2d6573,_0x2c0037){_0x2c0037=_0x2c0037||0xcc;return function(_0x3c3907){if(_0x3c3907){return _0x2d6573[_0x446b('0x17')](_0x2c0037);}return _0x2d6573[_0x446b('0x18')](_0x2c0037)[_0x446b('0x19')]();};}function respondWithResult(_0x384c78,_0x4330b5){_0x4330b5=_0x4330b5||0xc8;return function(_0x2436dd){if(_0x2436dd){return _0x384c78[_0x446b('0x18')](_0x4330b5)[_0x446b('0x1a')](_0x2436dd);}};}function respondWithFilteredResult(_0x22b5c3,_0x24df04){return function(_0x3c7dfc){if(_0x3c7dfc){var _0x35cead=typeof _0x24df04[_0x446b('0x1b')]===_0x446b('0x1c')&&typeof _0x24df04[_0x446b('0x1d')]==='undefined';var _0x2c164a=_0x3c7dfc[_0x446b('0x1e')];var _0x59a413=_0x35cead?0x0:_0x24df04[_0x446b('0x1b')];var _0x4e989c=_0x35cead?_0x3c7dfc[_0x446b('0x1e')]:_0x24df04[_0x446b('0x1b')]+_0x24df04['limit'];var _0x18b36e;if(_0x4e989c>=_0x2c164a){_0x4e989c=_0x2c164a;_0x18b36e=0xc8;}else{_0x18b36e=0xce;}_0x22b5c3[_0x446b('0x18')](_0x18b36e);return _0x22b5c3[_0x446b('0x1f')]('Content-Range',_0x59a413+'-'+_0x4e989c+'/'+_0x2c164a)[_0x446b('0x1a')](_0x3c7dfc);}return null;};}function patchUpdates(_0x3d9fe6){return function(_0xbefb76){try{jsonpatch['apply'](_0xbefb76,_0x3d9fe6,!![]);}catch(_0x212ed1){return BPromise['reject'](_0x212ed1);}return _0xbefb76[_0x446b('0x20')]();};}function saveUpdates(_0x270b05,_0x3d1438){return function(_0x38994f){if(_0x38994f){return _0x38994f[_0x446b('0x21')](_0x270b05)[_0x446b('0x22')](function(_0x582eec){return _0x582eec;});}return null;};}function removeEntity(_0x38262f,_0x2cebdd){return function(_0x1060de){if(_0x1060de){return _0x1060de[_0x446b('0x23')]()[_0x446b('0x22')](function(){_0x38262f[_0x446b('0x18')](0xcc)[_0x446b('0x19')]();});}};}function handleEntityNotFound(_0xdf817b,_0x6167d0){return function(_0x732da5){if(!_0x732da5){_0xdf817b[_0x446b('0x17')](0x194);}return _0x732da5;};}function handleError(_0x385415,_0x33ac80){_0x33ac80=_0x33ac80||0x1f4;return function(_0x26ba2f){logger['error'](_0x26ba2f[_0x446b('0x24')]);if(_0x26ba2f[_0x446b('0x25')]){delete _0x26ba2f[_0x446b('0x25')];}_0x385415[_0x446b('0x18')](_0x33ac80)[_0x446b('0x26')](_0x26ba2f);};}exports[_0x446b('0x27')]=function(_0x1a7999,_0x5c47ae){var _0x37ecea={},_0x2f8a7d={},_0x253474={'count':0x0,'rows':[]};var _0x378ac4=_['map'](db[_0x446b('0x28')][_0x446b('0x29')],function(_0x287b19){return{'name':_0x287b19[_0x446b('0x2a')],'type':_0x287b19[_0x446b('0x2b')]['key']};});_0x2f8a7d[_0x446b('0x2c')]=_[_0x446b('0x2d')](_0x378ac4,_0x446b('0x25'));_0x2f8a7d[_0x446b('0x2e')]=_['keys'](_0x1a7999[_0x446b('0x2e')]);_0x2f8a7d['filters']=_['intersection'](_0x2f8a7d[_0x446b('0x2c')],_0x2f8a7d[_0x446b('0x2e')]);_0x37ecea[_0x446b('0x2f')]=_[_0x446b('0x30')](_0x2f8a7d[_0x446b('0x2c')],qs['fields'](_0x1a7999['query'][_0x446b('0x31')]));_0x37ecea[_0x446b('0x2f')]=_0x37ecea['attributes']['length']?_0x37ecea[_0x446b('0x2f')]:_0x2f8a7d[_0x446b('0x2c')];if(!_0x1a7999[_0x446b('0x2e')][_0x446b('0x32')](_0x446b('0x33'))){_0x37ecea[_0x446b('0x1d')]=qs[_0x446b('0x1d')](_0x1a7999[_0x446b('0x2e')]['limit']);_0x37ecea[_0x446b('0x1b')]=qs[_0x446b('0x1b')](_0x1a7999[_0x446b('0x2e')][_0x446b('0x1b')]);}_0x37ecea[_0x446b('0x34')]=qs[_0x446b('0x35')](_0x1a7999[_0x446b('0x2e')][_0x446b('0x35')]);_0x37ecea[_0x446b('0x36')]=qs['filters'](_[_0x446b('0x37')](_0x1a7999[_0x446b('0x2e')],_0x2f8a7d['filters']),_0x378ac4);if(_0x1a7999[_0x446b('0x2e')][_0x446b('0x38')]){_0x37ecea[_0x446b('0x36')]=_[_0x446b('0x39')](_0x37ecea['where'],{'$or':_['map'](_0x378ac4,function(_0x5c9325){if(_0x5c9325['type']!==_0x446b('0x3a')){var _0x5d1758={};_0x5d1758[_0x5c9325[_0x446b('0x25')]]={'$like':'%'+_0x1a7999[_0x446b('0x2e')][_0x446b('0x38')]+'%'};return _0x5d1758;}})});}_0x37ecea=_[_0x446b('0x39')]({},_0x37ecea,_0x1a7999[_0x446b('0x3b')]);var _0x2e1987={'where':_0x37ecea[_0x446b('0x36')]};return db[_0x446b('0x28')]['count'](_0x2e1987)[_0x446b('0x22')](function(_0x10c489){_0x253474[_0x446b('0x1e')]=_0x10c489;if(_0x1a7999[_0x446b('0x2e')][_0x446b('0x3c')]){_0x37ecea[_0x446b('0x3d')]=[{'all':!![]}];}return db[_0x446b('0x28')][_0x446b('0x3e')](_0x37ecea);})['then'](function(_0x2c2e76){_0x253474[_0x446b('0x3f')]=_0x2c2e76;return _0x253474;})[_0x446b('0x22')](respondWithFilteredResult(_0x5c47ae,_0x37ecea))[_0x446b('0x40')](handleError(_0x5c47ae,null));};exports['show']=function(_0x201206,_0x713661){var _0x1141f9={'raw':!![],'where':{'id':_0x201206['params']['id']}},_0x3bbeba={};_0x3bbeba[_0x446b('0x2c')]=_[_0x446b('0x41')](db[_0x446b('0x28')][_0x446b('0x29')]);_0x3bbeba[_0x446b('0x2e')]=_[_0x446b('0x41')](_0x201206[_0x446b('0x2e')]);_0x3bbeba[_0x446b('0x42')]=_[_0x446b('0x30')](_0x3bbeba[_0x446b('0x2c')],_0x3bbeba[_0x446b('0x2e')]);_0x1141f9[_0x446b('0x2f')]=_[_0x446b('0x30')](_0x3bbeba['model'],qs[_0x446b('0x31')](_0x201206[_0x446b('0x2e')][_0x446b('0x31')]));_0x1141f9[_0x446b('0x2f')]=_0x1141f9[_0x446b('0x2f')][_0x446b('0x43')]?_0x1141f9['attributes']:_0x3bbeba[_0x446b('0x2c')];if(_0x201206['query'][_0x446b('0x3c')]){_0x1141f9['include']=[{'all':!![]}];}_0x1141f9=_[_0x446b('0x39')]({},_0x1141f9,_0x201206[_0x446b('0x3b')]);return db[_0x446b('0x28')][_0x446b('0x44')](_0x1141f9)[_0x446b('0x22')](handleEntityNotFound(_0x713661,null))['then'](respondWithResult(_0x713661,null))[_0x446b('0x40')](handleError(_0x713661,null));};exports[_0x446b('0x45')]=function(_0x101386,_0x2f9e89){return db[_0x446b('0x28')][_0x446b('0x45')](_0x101386[_0x446b('0x46')],{})[_0x446b('0x22')](respondWithResult(_0x2f9e89,0xc9))[_0x446b('0x40')](handleError(_0x2f9e89,null));};exports['update']=function(_0x341aa3,_0x487e4b){if(_0x341aa3[_0x446b('0x46')]['id']){delete _0x341aa3[_0x446b('0x46')]['id'];}return db['JscriptyQuestionReport'][_0x446b('0x44')]({'where':{'id':_0x341aa3[_0x446b('0x47')]['id']}})['then'](handleEntityNotFound(_0x487e4b,null))['then'](saveUpdates(_0x341aa3[_0x446b('0x46')],null))['then'](respondWithResult(_0x487e4b,null))[_0x446b('0x40')](handleError(_0x487e4b,null));};exports[_0x446b('0x23')]=function(_0x2b0c51,_0x1c1795){return db['JscriptyQuestionReport'][_0x446b('0x44')]({'where':{'id':_0x2b0c51[_0x446b('0x47')]['id']}})[_0x446b('0x22')](handleEntityNotFound(_0x1c1795,null))[_0x446b('0x22')](removeEntity(_0x1c1795,null))[_0x446b('0x40')](handleError(_0x1c1795,null));};exports[_0x446b('0x48')]=function(_0x28e958,_0x326857){return db[_0x446b('0x28')]['describe']()[_0x446b('0x22')](respondWithResult(_0x326857,null))[_0x446b('0x40')](handleError(_0x326857,null));};
\ No newline at end of file
index 8e12942..b712182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fe7=['../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0x7fe7,0x1e7));var _0x77fe=function(_0x12605e,_0x3d8305){_0x12605e=_0x12605e-0x0;var _0x35fb69=_0x7fe7[_0x12605e];return _0x35fb69;};'use strict';var _=require(_0x77fe('0x0'));var util=require(_0x77fe('0x1'));var logger=require('../../config/logger')(_0x77fe('0x2'));var moment=require(_0x77fe('0x3'));var BPromise=require(_0x77fe('0x4'));var rp=require(_0x77fe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77fe('0x6'));var config=require(_0x77fe('0x7'));var attributes=require(_0x77fe('0x8'));module[_0x77fe('0x9')]=function(_0x58906f,_0x9ded71){return _0x58906f[_0x77fe('0xa')](_0x77fe('0xb'),attributes,{'tableName':_0x77fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3d5e=['api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','util','../../config/logger'];(function(_0x307c60,_0x5c7d49){var _0x590f7b=function(_0x499bce){while(--_0x499bce){_0x307c60['push'](_0x307c60['shift']());}};_0x590f7b(++_0x5c7d49);}(_0x3d5e,0x106));var _0xe3d5=function(_0x5260f6,_0x56d10b){_0x5260f6=_0x5260f6-0x0;var _0x46ecb8=_0x3d5e[_0x5260f6];return _0x46ecb8;};'use strict';var _=require('lodash');var util=require(_0xe3d5('0x0'));var logger=require(_0xe3d5('0x1'))(_0xe3d5('0x2'));var moment=require(_0xe3d5('0x3'));var BPromise=require(_0xe3d5('0x4'));var rp=require(_0xe3d5('0x5'));var fs=require('fs');var path=require(_0xe3d5('0x6'));var rimraf=require('rimraf');var config=require(_0xe3d5('0x7'));var attributes=require(_0xe3d5('0x8'));module[_0xe3d5('0x9')]=function(_0x58658e,_0x20f03f){return _0x58658e[_0xe3d5('0xa')](_0xe3d5('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fc51983..b04bd02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e5a=['../../config/environment','jayson/promise','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1283eb,_0x89559){var _0x574965=function(_0x4dc614){while(--_0x4dc614){_0x1283eb['push'](_0x1283eb['shift']());}};_0x574965(++_0x89559);}(_0x1e5a,0xd4));var _0xa1e5=function(_0x249315,_0x16a14d){_0x249315=_0x249315-0x0;var _0x27a2f2=_0x1e5a[_0x249315];return _0x27a2f2;};'use strict';var _=require('lodash');var util=require(_0xa1e5('0x0'));var moment=require('moment');var BPromise=require(_0xa1e5('0x1'));var rs=require(_0xa1e5('0x2'));var fs=require('fs');var Redis=require(_0xa1e5('0x3'));var db=require(_0xa1e5('0x4'))['db'];var utils=require(_0xa1e5('0x5'));var logger=require(_0xa1e5('0x6'))(_0xa1e5('0x7'));var config=require(_0xa1e5('0x8'));var jayson=require(_0xa1e5('0x9'));var client=jayson['client'][_0xa1e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x543339,_0x242685,_0x1de3fd){return new BPromise(function(_0x42949f,_0xf21862){return client[_0xa1e5('0xb')](_0x543339,_0x1de3fd)[_0xa1e5('0xc')](function(_0x5181ff){logger['info'](_0xa1e5('0xd'),_0x242685,_0xa1e5('0xe'));logger['debug'](_0xa1e5('0xf'),_0x242685,_0xa1e5('0xe'),JSON[_0xa1e5('0x10')](_0x5181ff));if(_0x5181ff['error']){if(_0x5181ff['error']['code']===0x1f4){logger[_0xa1e5('0x11')](_0xa1e5('0xd'),_0x242685,_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);return _0xf21862(_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x242685,_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);return _0x42949f(_0x5181ff[_0xa1e5('0x11')][_0xa1e5('0x12')]);}else{logger[_0xa1e5('0x13')](_0xa1e5('0xd'),_0x242685,_0xa1e5('0xe'));_0x42949f(_0x5181ff[_0xa1e5('0x14')][_0xa1e5('0x12')]);}})[_0xa1e5('0x15')](function(_0x573b01){logger[_0xa1e5('0x11')](_0xa1e5('0xd'),_0x242685,_0x573b01);_0xf21862(_0x573b01);});});}
\ No newline at end of file
+var _0x0be1=['code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x8a917c,_0x19c5f6){var _0x2c704e=function(_0x342f3a){while(--_0x342f3a){_0x8a917c['push'](_0x8a917c['shift']());}};_0x2c704e(++_0x19c5f6);}(_0x0be1,0x139));var _0x10be=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x0be1[_0x510b98];return _0x45e775;};'use strict';var _=require('lodash');var util=require(_0x10be('0x0'));var moment=require('moment');var BPromise=require(_0x10be('0x1'));var rs=require(_0x10be('0x2'));var fs=require('fs');var Redis=require(_0x10be('0x3'));var db=require(_0x10be('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x10be('0x5'))(_0x10be('0x6'));var config=require(_0x10be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x10be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x262fba,_0x49da3e,_0x5634bd){return new BPromise(function(_0xa6c2db,_0x5849a5){return client[_0x10be('0x9')](_0x262fba,_0x5634bd)[_0x10be('0xa')](function(_0x3d196a){logger[_0x10be('0xb')](_0x10be('0xc'),_0x49da3e,_0x10be('0xd'));logger[_0x10be('0xe')](_0x10be('0xf'),_0x49da3e,_0x10be('0xd'),JSON[_0x10be('0x10')](_0x3d196a));if(_0x3d196a['error']){if(_0x3d196a['error'][_0x10be('0x11')]===0x1f4){logger['error'](_0x10be('0xc'),_0x49da3e,_0x3d196a[_0x10be('0x12')][_0x10be('0x13')]);return _0x5849a5(_0x3d196a[_0x10be('0x12')][_0x10be('0x13')]);}logger[_0x10be('0x12')](_0x10be('0xc'),_0x49da3e,_0x3d196a['error'][_0x10be('0x13')]);return _0xa6c2db(_0x3d196a[_0x10be('0x12')][_0x10be('0x13')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x49da3e,_0x10be('0xd'));_0xa6c2db(_0x3d196a[_0x10be('0x14')]['message']);}})[_0x10be('0x15')](function(_0x2d99fa){logger[_0x10be('0x12')](_0x10be('0xc'),_0x49da3e,_0x2d99fa);_0x5849a5(_0x2d99fa);});});}
\ No newline at end of file
index 0bd52e4..f9d8a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa566=['/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index'];(function(_0xef33b7,_0x161990){var _0x166c0d=function(_0x1c0d94){while(--_0x1c0d94){_0xef33b7['push'](_0xef33b7['shift']());}};_0x166c0d(++_0x161990);}(_0xa566,0x12c));var _0x6a56=function(_0x191e50,_0x28a44d){_0x191e50=_0x191e50-0x0;var _0x477fca=_0xa566[_0x191e50];return _0x477fca;};'use strict';var multer=require(_0x6a56('0x0'));var util=require(_0x6a56('0x1'));var path=require(_0x6a56('0x2'));var timeout=require(_0x6a56('0x3'));var express=require(_0x6a56('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a56('0x5'));var interaction=require(_0x6a56('0x6'));var config=require(_0x6a56('0x7'));var controller=require(_0x6a56('0x8'));router[_0x6a56('0x9')]('/',auth[_0x6a56('0xa')](),controller[_0x6a56('0xb')]);router[_0x6a56('0x9')](_0x6a56('0xc'),auth['isAuthenticated'](),controller[_0x6a56('0xd')]);router[_0x6a56('0x9')](_0x6a56('0xe'),auth['isAuthenticated'](),controller[_0x6a56('0xf')]);router['get'](_0x6a56('0x10'),auth[_0x6a56('0xa')](),controller[_0x6a56('0x11')]);router[_0x6a56('0x12')]('/',auth[_0x6a56('0xa')](),controller[_0x6a56('0x13')]);router[_0x6a56('0x14')](_0x6a56('0xe'),auth[_0x6a56('0xa')](),controller['update']);router[_0x6a56('0x15')](_0x6a56('0xe'),auth[_0x6a56('0xa')](),controller[_0x6a56('0x16')]);module[_0x6a56('0x17')]=router;
\ No newline at end of file
+var _0x7112=['multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x7112,0xdc));var _0x2711=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7112[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2711('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2711('0x1'));var express=require(_0x2711('0x2'));var router=express[_0x2711('0x3')]();var fs_extra=require(_0x2711('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2711('0x5'));var config=require(_0x2711('0x6'));var controller=require(_0x2711('0x7'));router[_0x2711('0x8')]('/',auth[_0x2711('0x9')](),controller[_0x2711('0xa')]);router['get'](_0x2711('0xb'),auth[_0x2711('0x9')](),controller['describe']);router[_0x2711('0x8')](_0x2711('0xc'),auth['isAuthenticated'](),controller[_0x2711('0xd')]);router['get'](_0x2711('0xe'),auth[_0x2711('0x9')](),controller[_0x2711('0xf')]);router[_0x2711('0x10')]('/',auth['isAuthenticated'](),controller[_0x2711('0x11')]);router[_0x2711('0x12')](_0x2711('0xc'),auth[_0x2711('0x9')](),controller[_0x2711('0x13')]);router[_0x2711('0x14')]('/:id',auth[_0x2711('0x9')](),controller[_0x2711('0x15')]);module['exports']=router;
\ No newline at end of file
index 05829e0..fea4e90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x685b=['DATE','starttime','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x685b,0xbd));var _0xb685=function(_0x18d60d,_0x5dd41a){_0x18d60d=_0x18d60d-0x0;var _0x215743=_0x685b[_0x18d60d];return _0x215743;};'use strict';var moment=require(_0xb685('0x0'));var Sequelize=require(_0xb685('0x1'));module[_0xb685('0x2')]={'starttime':{'type':Sequelize[_0xb685('0x3')],'set':function(_0x11637c){this['setDataValue'](_0xb685('0x4'),_0x11637c);this[_0xb685('0x5')]('endtime',moment()['format'](_0xb685('0x6')));}},'endtime':{'type':Sequelize[_0xb685('0x3')]},'membername':{'type':Sequelize[_0xb685('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb685('0x7')]},'uniqueid':{'type':Sequelize[_0xb685('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x9136=['sequelize','exports','DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x47f4c2,_0x134e7b){var _0x22c63e=function(_0x5b8572){while(--_0x5b8572){_0x47f4c2['push'](_0x47f4c2['shift']());}};_0x22c63e(++_0x134e7b);}(_0x9136,0x138));var _0x6913=function(_0x5c7d50,_0x142570){_0x5c7d50=_0x5c7d50-0x0;var _0x803884=_0x9136[_0x5c7d50];return _0x803884;};'use strict';var moment=require('moment');var Sequelize=require(_0x6913('0x0'));module[_0x6913('0x1')]={'starttime':{'type':Sequelize[_0x6913('0x2')],'set':function(_0x381faa){this[_0x6913('0x3')]('starttime',_0x381faa);this[_0x6913('0x3')](_0x6913('0x4'),moment()['format'](_0x6913('0x5')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x6913('0x6')]},'projectname':{'type':Sequelize[_0x6913('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6913('0x6')]},'calleridname':{'type':Sequelize[_0x6913('0x6')]},'calleridnum':{'type':Sequelize[_0x6913('0x6')]},'completed':{'type':Sequelize[_0x6913('0x7')],'defaultValue':![]}};
\ No newline at end of file
index a4e7c31..118dc64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4cd=['eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','json','limit','undefined','count','offset','status','set','Content-Range','reject','save','update','then','destroy','end','stack','name','map','JscriptySessionReport','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','merge','where','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId'];(function(_0xb47911,_0x4499e6){var _0x312020=function(_0x45d7aa){while(--_0x45d7aa){_0xb47911['push'](_0xb47911['shift']());}};_0x312020(++_0x4499e6);}(_0xf4cd,0xe1));var _0xdf4c=function(_0x123b0f,_0x36d71e){_0x123b0f=_0x123b0f-0x0;var _0x40de58=_0xf4cd[_0x123b0f];return _0x40de58;};'use strict';var emlformat=require(_0xdf4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdf4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf4c('0x2'));var moment=require(_0xdf4c('0x3'));var BPromise=require(_0xdf4c('0x4'));var Mustache=require(_0xdf4c('0x5'));var util=require(_0xdf4c('0x6'));var path=require(_0xdf4c('0x7'));var sox=require(_0xdf4c('0x8'));var csv=require(_0xdf4c('0x9'));var ejs=require(_0xdf4c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf4c('0xb'));var _=require(_0xdf4c('0xc'));var squel=require(_0xdf4c('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdf4c('0x9'));var querystring=require('querystring');var Papa=require(_0xdf4c('0xf'));var Redis=require('ioredis');var authService=require(_0xdf4c('0x10'));var qs=require(_0xdf4c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf4c('0x12'));var logger=require(_0xdf4c('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf4c('0x14'))['db'];function respondWithStatusCode(_0x9c88e0,_0x5a3628){_0x5a3628=_0x5a3628||0xcc;return function(_0x50aff8){if(_0x50aff8){return _0x9c88e0[_0xdf4c('0x15')](_0x5a3628);}return _0x9c88e0['status'](_0x5a3628)['end']();};}function respondWithResult(_0x4c5e47,_0x369a7f){_0x369a7f=_0x369a7f||0xc8;return function(_0x5255cf){if(_0x5255cf){return _0x4c5e47['status'](_0x369a7f)[_0xdf4c('0x16')](_0x5255cf);}};}function respondWithFilteredResult(_0x2f00c8,_0x58c0ef){return function(_0x421e4a){if(_0x421e4a){var _0x8d9a42=typeof _0x58c0ef['offset']==='undefined'&&typeof _0x58c0ef[_0xdf4c('0x17')]===_0xdf4c('0x18');var _0x55ecde=_0x421e4a[_0xdf4c('0x19')];var _0x72c1ca=_0x8d9a42?0x0:_0x58c0ef[_0xdf4c('0x1a')];var _0x288091=_0x8d9a42?_0x421e4a['count']:_0x58c0ef[_0xdf4c('0x1a')]+_0x58c0ef[_0xdf4c('0x17')];var _0x59957e;if(_0x288091>=_0x55ecde){_0x288091=_0x55ecde;_0x59957e=0xc8;}else{_0x59957e=0xce;}_0x2f00c8[_0xdf4c('0x1b')](_0x59957e);return _0x2f00c8[_0xdf4c('0x1c')](_0xdf4c('0x1d'),_0x72c1ca+'-'+_0x288091+'/'+_0x55ecde)[_0xdf4c('0x16')](_0x421e4a);}return null;};}function patchUpdates(_0x332bc0){return function(_0x19e373){try{jsonpatch['apply'](_0x19e373,_0x332bc0,!![]);}catch(_0x546b98){return BPromise[_0xdf4c('0x1e')](_0x546b98);}return _0x19e373[_0xdf4c('0x1f')]();};}function saveUpdates(_0x5cc899,_0xf69fee){return function(_0x39269a){if(_0x39269a){return _0x39269a[_0xdf4c('0x20')](_0x5cc899)[_0xdf4c('0x21')](function(_0x3ee760){return _0x3ee760;});}return null;};}function removeEntity(_0x4bd7b6,_0x3fb7d7){return function(_0x5418f4){if(_0x5418f4){return _0x5418f4[_0xdf4c('0x22')]()[_0xdf4c('0x21')](function(){_0x4bd7b6[_0xdf4c('0x1b')](0xcc)[_0xdf4c('0x23')]();});}};}function handleEntityNotFound(_0x35e050,_0x21e23e){return function(_0x37b78d){if(!_0x37b78d){_0x35e050[_0xdf4c('0x15')](0x194);}return _0x37b78d;};}function handleError(_0x271e5a,_0x26c972){_0x26c972=_0x26c972||0x1f4;return function(_0x14de1e){logger['error'](_0x14de1e[_0xdf4c('0x24')]);if(_0x14de1e['name']){delete _0x14de1e[_0xdf4c('0x25')];}_0x271e5a[_0xdf4c('0x1b')](_0x26c972)['send'](_0x14de1e);};}exports['index']=function(_0x5d721d,_0x5ec36d){var _0x25b625={},_0x4e2cbf={},_0x38b452={'count':0x0,'rows':[]};var _0x5b40c0=_[_0xdf4c('0x26')](db[_0xdf4c('0x27')]['rawAttributes'],function(_0x31735b){return{'name':_0x31735b['fieldName'],'type':_0x31735b[_0xdf4c('0x28')][_0xdf4c('0x29')]};});_0x4e2cbf['model']=_[_0xdf4c('0x26')](_0x5b40c0,_0xdf4c('0x25'));_0x4e2cbf[_0xdf4c('0x2a')]=_[_0xdf4c('0x2b')](_0x5d721d[_0xdf4c('0x2a')]);_0x4e2cbf['filters']=_[_0xdf4c('0x2c')](_0x4e2cbf[_0xdf4c('0x2d')],_0x4e2cbf['query']);_0x25b625[_0xdf4c('0x2e')]=_[_0xdf4c('0x2c')](_0x4e2cbf[_0xdf4c('0x2d')],qs[_0xdf4c('0x2f')](_0x5d721d['query'][_0xdf4c('0x2f')]));_0x25b625['attributes']=_0x25b625['attributes'][_0xdf4c('0x30')]?_0x25b625[_0xdf4c('0x2e')]:_0x4e2cbf[_0xdf4c('0x2d')];if(!_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x31')](_0xdf4c('0x32'))){_0x25b625[_0xdf4c('0x17')]=qs['limit'](_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x17')]);_0x25b625[_0xdf4c('0x1a')]=qs[_0xdf4c('0x1a')](_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x1a')]);}_0x25b625[_0xdf4c('0x33')]=qs[_0xdf4c('0x34')](_0x5d721d['query'][_0xdf4c('0x34')]);_0x25b625['where']=qs['filters'](_[_0xdf4c('0x35')](_0x5d721d['query'],_0x4e2cbf[_0xdf4c('0x36')]),_0x5b40c0);if(_0x5d721d[_0xdf4c('0x2a')]['filter']){_0x25b625['where']=_[_0xdf4c('0x37')](_0x25b625[_0xdf4c('0x38')],{'$or':_[_0xdf4c('0x26')](_0x5b40c0,function(_0x145555){if(_0x145555[_0xdf4c('0x28')]!=='VIRTUAL'){var _0x1a7fdb={};_0x1a7fdb[_0x145555[_0xdf4c('0x25')]]={'$like':'%'+_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x39')]+'%'};return _0x1a7fdb;}})});}_0x25b625=_['merge']({},_0x25b625,_0x5d721d[_0xdf4c('0x3a')]);var _0x55c7ed={'where':_0x25b625['where']};return db[_0xdf4c('0x27')][_0xdf4c('0x19')](_0x55c7ed)[_0xdf4c('0x21')](function(_0x9c8221){_0x38b452[_0xdf4c('0x19')]=_0x9c8221;if(_0x5d721d[_0xdf4c('0x2a')][_0xdf4c('0x3b')]){_0x25b625[_0xdf4c('0x3c')]=[{'all':!![]}];}return db[_0xdf4c('0x27')][_0xdf4c('0x3d')](_0x25b625);})[_0xdf4c('0x21')](function(_0x336490){_0x38b452[_0xdf4c('0x3e')]=_0x336490;return _0x38b452;})['then'](respondWithFilteredResult(_0x5ec36d,_0x25b625))[_0xdf4c('0x3f')](handleError(_0x5ec36d,null));};exports[_0xdf4c('0x40')]=function(_0x1cf23e,_0x16e3d1){var _0x479e2a={'raw':!![],'where':{'id':_0x1cf23e[_0xdf4c('0x41')]['id']}},_0x140fe={};_0x140fe[_0xdf4c('0x2d')]=_[_0xdf4c('0x2b')](db[_0xdf4c('0x27')]['rawAttributes']);_0x140fe[_0xdf4c('0x2a')]=_['keys'](_0x1cf23e[_0xdf4c('0x2a')]);_0x140fe[_0xdf4c('0x36')]=_[_0xdf4c('0x2c')](_0x140fe[_0xdf4c('0x2d')],_0x140fe[_0xdf4c('0x2a')]);_0x479e2a[_0xdf4c('0x2e')]=_[_0xdf4c('0x2c')](_0x140fe['model'],qs[_0xdf4c('0x2f')](_0x1cf23e[_0xdf4c('0x2a')][_0xdf4c('0x2f')]));_0x479e2a['attributes']=_0x479e2a['attributes'][_0xdf4c('0x30')]?_0x479e2a[_0xdf4c('0x2e')]:_0x140fe[_0xdf4c('0x2d')];if(_0x1cf23e['query'][_0xdf4c('0x3b')]){_0x479e2a[_0xdf4c('0x3c')]=[{'all':!![]}];}_0x479e2a=_[_0xdf4c('0x37')]({},_0x479e2a,_0x1cf23e[_0xdf4c('0x3a')]);return db[_0xdf4c('0x27')][_0xdf4c('0x42')](_0x479e2a)[_0xdf4c('0x21')](handleEntityNotFound(_0x16e3d1,null))['then'](respondWithResult(_0x16e3d1,null))[_0xdf4c('0x3f')](handleError(_0x16e3d1,null));};exports[_0xdf4c('0x43')]=function(_0x954032,_0x1903c8){return db['JscriptySessionReport'][_0xdf4c('0x43')](_0x954032['body'],{})[_0xdf4c('0x21')](respondWithResult(_0x1903c8,0xc9))[_0xdf4c('0x3f')](handleError(_0x1903c8,null));};exports[_0xdf4c('0x20')]=function(_0x14a969,_0x14f152){if(_0x14a969[_0xdf4c('0x44')]['id']){delete _0x14a969['body']['id'];}return db[_0xdf4c('0x27')]['find']({'where':{'id':_0x14a969[_0xdf4c('0x41')]['id']}})[_0xdf4c('0x21')](handleEntityNotFound(_0x14f152,null))['then'](saveUpdates(_0x14a969[_0xdf4c('0x44')],null))[_0xdf4c('0x21')](respondWithResult(_0x14f152,null))['catch'](handleError(_0x14f152,null));};exports[_0xdf4c('0x22')]=function(_0x4f1352,_0x253d7d){return db[_0xdf4c('0x27')][_0xdf4c('0x42')]({'where':{'id':_0x4f1352[_0xdf4c('0x41')]['id']}})[_0xdf4c('0x21')](handleEntityNotFound(_0x253d7d,null))['then'](removeEntity(_0x253d7d,null))[_0xdf4c('0x3f')](handleError(_0x253d7d,null));};exports[_0xdf4c('0x45')]=function(_0x210251,_0x4d19af){return db[_0xdf4c('0x27')][_0xdf4c('0x45')]()[_0xdf4c('0x21')](respondWithResult(_0x4d19af,null))['catch'](handleError(_0x4d19af,null));};exports[_0xdf4c('0x46')]=function(_0x2524f5,_0x385722,_0x2662fe){var _0x18d8ac={'raw':!![],'where':{}};var _0x5d61={};var _0x50bc18={'count':0x0,'rows':[]};return db[_0xdf4c('0x27')][_0xdf4c('0x47')]({'where':{'id':_0x2524f5[_0xdf4c('0x41')]['id']}})[_0xdf4c('0x21')](handleEntityNotFound(_0x385722,null))['then'](function(_0x5ad98b){if(_0x5ad98b){_0x5d61[_0xdf4c('0x2d')]=_[_0xdf4c('0x2b')](db[_0xdf4c('0x48')][_0xdf4c('0x49')]);_0x5d61['query']=_[_0xdf4c('0x2b')](_0x2524f5['query']);_0x5d61[_0xdf4c('0x36')]=_[_0xdf4c('0x2c')](_0x5d61[_0xdf4c('0x2d')],_0x5d61[_0xdf4c('0x2a')]);_0x18d8ac[_0xdf4c('0x2e')]=_[_0xdf4c('0x2c')](_0x5d61['model'],qs['fields'](_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x2f')]));_0x18d8ac['attributes']=_0x18d8ac[_0xdf4c('0x2e')][_0xdf4c('0x30')]?_0x18d8ac['attributes']:_0x5d61['model'];if(!_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x31')](_0xdf4c('0x32'))){_0x18d8ac['limit']=qs[_0xdf4c('0x17')](_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x17')]);_0x18d8ac[_0xdf4c('0x1a')]=qs[_0xdf4c('0x1a')](_0x2524f5['query'][_0xdf4c('0x1a')]);}_0x18d8ac[_0xdf4c('0x33')]=qs[_0xdf4c('0x34')](_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x34')]);_0x18d8ac['where']=qs[_0xdf4c('0x36')](_[_0xdf4c('0x35')](_0x2524f5[_0xdf4c('0x2a')],_0x5d61['filters']));_0x18d8ac[_0xdf4c('0x38')][_0xdf4c('0x4a')]=_0x5ad98b['id'];if(_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x39')]){_0x18d8ac[_0xdf4c('0x38')]=_['merge'](_0x18d8ac[_0xdf4c('0x38')],{'$or':_[_0xdf4c('0x26')](_0x18d8ac[_0xdf4c('0x2e')],function(_0x2035c1){var _0x3b14ce={};_0x3b14ce[_0x2035c1]={'$like':'%'+_0x2524f5[_0xdf4c('0x2a')][_0xdf4c('0x39')]+'%'};return _0x3b14ce;})});}_0x18d8ac=_[_0xdf4c('0x37')]({},_0x18d8ac,_0x2524f5[_0xdf4c('0x3a')]);return db[_0xdf4c('0x48')][_0xdf4c('0x19')]({'where':_0x18d8ac[_0xdf4c('0x38')]})[_0xdf4c('0x21')](function(_0x2de406){_0x50bc18[_0xdf4c('0x19')]=_0x2de406;if(_0x2524f5[_0xdf4c('0x2a')]['includeAll']){_0x18d8ac[_0xdf4c('0x3c')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x18d8ac);})[_0xdf4c('0x21')](function(_0x4fd82c){_0x50bc18[_0xdf4c('0x3e')]=_0x4fd82c;return _0x50bc18;});}})[_0xdf4c('0x21')](respondWithFilteredResult(_0x385722,_0x18d8ac))[_0xdf4c('0x3f')](handleError(_0x385722,null));};
\ No newline at end of file
+var _0x0f45=['merge','options','includeAll','findAll','rows','catch','show','params','include','create','body','destroy','describe','getQuestions','findOne','pick','SessionId','JscriptyQuestionReport','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL'];(function(_0x64e2ec,_0x14692d){var _0x28f791=function(_0x3aff1c){while(--_0x3aff1c){_0x64e2ec['push'](_0x64e2ec['shift']());}};_0x28f791(++_0x14692d);}(_0x0f45,0x1a7));var _0x50f4=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x0f45[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x50f4('0x0'));var jsonpatch=require(_0x50f4('0x1'));var rp=require(_0x50f4('0x2'));var moment=require(_0x50f4('0x3'));var BPromise=require(_0x50f4('0x4'));var Mustache=require(_0x50f4('0x5'));var util=require('util');var path=require(_0x50f4('0x6'));var sox=require(_0x50f4('0x7'));var csv=require(_0x50f4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x50f4('0x9'));var _=require(_0x50f4('0xa'));var squel=require(_0x50f4('0xb'));var crypto=require(_0x50f4('0xc'));var jsforce=require(_0x50f4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x50f4('0xe'));var Redis=require(_0x50f4('0xf'));var authService=require(_0x50f4('0x10'));var qs=require(_0x50f4('0x11'));var as=require(_0x50f4('0x12'));var hardwareService=require(_0x50f4('0x13'));var logger=require(_0x50f4('0x14'))(_0x50f4('0x15'));var utils=require('../../config/utils');var config=require(_0x50f4('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68d315,_0x585ada){_0x585ada=_0x585ada||0xcc;return function(_0x21ec33){if(_0x21ec33){return _0x68d315[_0x50f4('0x17')](_0x585ada);}return _0x68d315[_0x50f4('0x18')](_0x585ada)[_0x50f4('0x19')]();};}function respondWithResult(_0x348f0a,_0x3ba3bd){_0x3ba3bd=_0x3ba3bd||0xc8;return function(_0x1b7b02){if(_0x1b7b02){return _0x348f0a[_0x50f4('0x18')](_0x3ba3bd)[_0x50f4('0x1a')](_0x1b7b02);}};}function respondWithFilteredResult(_0x36b44f,_0x46156b){return function(_0x4dfd0b){if(_0x4dfd0b){var _0x24a10c=typeof _0x46156b[_0x50f4('0x1b')]===_0x50f4('0x1c')&&typeof _0x46156b['limit']===_0x50f4('0x1c');var _0x989f7=_0x4dfd0b[_0x50f4('0x1d')];var _0x5dab71=_0x24a10c?0x0:_0x46156b['offset'];var _0x2e73e1=_0x24a10c?_0x4dfd0b[_0x50f4('0x1d')]:_0x46156b['offset']+_0x46156b['limit'];var _0x26b9d2;if(_0x2e73e1>=_0x989f7){_0x2e73e1=_0x989f7;_0x26b9d2=0xc8;}else{_0x26b9d2=0xce;}_0x36b44f['status'](_0x26b9d2);return _0x36b44f[_0x50f4('0x1e')](_0x50f4('0x1f'),_0x5dab71+'-'+_0x2e73e1+'/'+_0x989f7)['json'](_0x4dfd0b);}return null;};}function patchUpdates(_0x3685ad){return function(_0x4dfaaf){try{jsonpatch[_0x50f4('0x20')](_0x4dfaaf,_0x3685ad,!![]);}catch(_0x51d772){return BPromise[_0x50f4('0x21')](_0x51d772);}return _0x4dfaaf[_0x50f4('0x22')]();};}function saveUpdates(_0x301480,_0x5c4a52){return function(_0x4fafb3){if(_0x4fafb3){return _0x4fafb3[_0x50f4('0x23')](_0x301480)[_0x50f4('0x24')](function(_0x150ce4){return _0x150ce4;});}return null;};}function removeEntity(_0xba347b,_0x24ffd9){return function(_0x2c69bd){if(_0x2c69bd){return _0x2c69bd['destroy']()[_0x50f4('0x24')](function(){_0xba347b['status'](0xcc)[_0x50f4('0x19')]();});}};}function handleEntityNotFound(_0x2c411b,_0x2b37a4){return function(_0x4265c2){if(!_0x4265c2){_0x2c411b[_0x50f4('0x17')](0x194);}return _0x4265c2;};}function handleError(_0x3d3ff9,_0x1f99b5){_0x1f99b5=_0x1f99b5||0x1f4;return function(_0x32b524){logger[_0x50f4('0x25')](_0x32b524[_0x50f4('0x26')]);if(_0x32b524[_0x50f4('0x27')]){delete _0x32b524[_0x50f4('0x27')];}_0x3d3ff9[_0x50f4('0x18')](_0x1f99b5)['send'](_0x32b524);};}exports[_0x50f4('0x28')]=function(_0x336e6b,_0x52622f){var _0x1b5d49={},_0x179259={},_0x4b6297={'count':0x0,'rows':[]};var _0x296b22=_[_0x50f4('0x29')](db[_0x50f4('0x2a')][_0x50f4('0x2b')],function(_0x4564c1){return{'name':_0x4564c1[_0x50f4('0x2c')],'type':_0x4564c1[_0x50f4('0x2d')][_0x50f4('0x2e')]};});_0x179259['model']=_[_0x50f4('0x29')](_0x296b22,_0x50f4('0x27'));_0x179259['query']=_[_0x50f4('0x2f')](_0x336e6b[_0x50f4('0x30')]);_0x179259[_0x50f4('0x31')]=_['intersection'](_0x179259[_0x50f4('0x32')],_0x179259[_0x50f4('0x30')]);_0x1b5d49[_0x50f4('0x33')]=_[_0x50f4('0x34')](_0x179259[_0x50f4('0x32')],qs[_0x50f4('0x35')](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x35')]));_0x1b5d49[_0x50f4('0x33')]=_0x1b5d49[_0x50f4('0x33')][_0x50f4('0x36')]?_0x1b5d49[_0x50f4('0x33')]:_0x179259[_0x50f4('0x32')];if(!_0x336e6b[_0x50f4('0x30')][_0x50f4('0x37')](_0x50f4('0x38'))){_0x1b5d49[_0x50f4('0x39')]=qs['limit'](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x39')]);_0x1b5d49[_0x50f4('0x1b')]=qs[_0x50f4('0x1b')](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x1b')]);}_0x1b5d49[_0x50f4('0x3a')]=qs[_0x50f4('0x3b')](_0x336e6b[_0x50f4('0x30')][_0x50f4('0x3b')]);_0x1b5d49['where']=qs[_0x50f4('0x31')](_['pick'](_0x336e6b['query'],_0x179259[_0x50f4('0x31')]),_0x296b22);if(_0x336e6b[_0x50f4('0x30')][_0x50f4('0x3c')]){_0x1b5d49[_0x50f4('0x3d')]=_['merge'](_0x1b5d49[_0x50f4('0x3d')],{'$or':_['map'](_0x296b22,function(_0x35ce91){if(_0x35ce91[_0x50f4('0x2d')]!==_0x50f4('0x3e')){var _0x45bb2f={};_0x45bb2f[_0x35ce91[_0x50f4('0x27')]]={'$like':'%'+_0x336e6b[_0x50f4('0x30')][_0x50f4('0x3c')]+'%'};return _0x45bb2f;}})});}_0x1b5d49=_[_0x50f4('0x3f')]({},_0x1b5d49,_0x336e6b[_0x50f4('0x40')]);var _0x535261={'where':_0x1b5d49[_0x50f4('0x3d')]};return db[_0x50f4('0x2a')][_0x50f4('0x1d')](_0x535261)[_0x50f4('0x24')](function(_0x76a142){_0x4b6297['count']=_0x76a142;if(_0x336e6b[_0x50f4('0x30')][_0x50f4('0x41')]){_0x1b5d49['include']=[{'all':!![]}];}return db[_0x50f4('0x2a')][_0x50f4('0x42')](_0x1b5d49);})[_0x50f4('0x24')](function(_0x35bdf4){_0x4b6297[_0x50f4('0x43')]=_0x35bdf4;return _0x4b6297;})['then'](respondWithFilteredResult(_0x52622f,_0x1b5d49))[_0x50f4('0x44')](handleError(_0x52622f,null));};exports[_0x50f4('0x45')]=function(_0x9e6106,_0x294e3d){var _0x11eb99={'raw':!![],'where':{'id':_0x9e6106[_0x50f4('0x46')]['id']}},_0x49ac36={};_0x49ac36[_0x50f4('0x32')]=_[_0x50f4('0x2f')](db[_0x50f4('0x2a')][_0x50f4('0x2b')]);_0x49ac36[_0x50f4('0x30')]=_[_0x50f4('0x2f')](_0x9e6106[_0x50f4('0x30')]);_0x49ac36[_0x50f4('0x31')]=_[_0x50f4('0x34')](_0x49ac36[_0x50f4('0x32')],_0x49ac36[_0x50f4('0x30')]);_0x11eb99[_0x50f4('0x33')]=_[_0x50f4('0x34')](_0x49ac36['model'],qs['fields'](_0x9e6106['query'][_0x50f4('0x35')]));_0x11eb99[_0x50f4('0x33')]=_0x11eb99[_0x50f4('0x33')][_0x50f4('0x36')]?_0x11eb99[_0x50f4('0x33')]:_0x49ac36[_0x50f4('0x32')];if(_0x9e6106[_0x50f4('0x30')][_0x50f4('0x41')]){_0x11eb99[_0x50f4('0x47')]=[{'all':!![]}];}_0x11eb99=_[_0x50f4('0x3f')]({},_0x11eb99,_0x9e6106['options']);return db[_0x50f4('0x2a')]['find'](_0x11eb99)[_0x50f4('0x24')](handleEntityNotFound(_0x294e3d,null))[_0x50f4('0x24')](respondWithResult(_0x294e3d,null))[_0x50f4('0x44')](handleError(_0x294e3d,null));};exports[_0x50f4('0x48')]=function(_0x363b23,_0x34bfa3){return db['JscriptySessionReport'][_0x50f4('0x48')](_0x363b23['body'],{})[_0x50f4('0x24')](respondWithResult(_0x34bfa3,0xc9))['catch'](handleError(_0x34bfa3,null));};exports[_0x50f4('0x23')]=function(_0x3bf1bd,_0x53f4fc){if(_0x3bf1bd[_0x50f4('0x49')]['id']){delete _0x3bf1bd[_0x50f4('0x49')]['id'];}return db[_0x50f4('0x2a')]['find']({'where':{'id':_0x3bf1bd[_0x50f4('0x46')]['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x53f4fc,null))['then'](saveUpdates(_0x3bf1bd[_0x50f4('0x49')],null))[_0x50f4('0x24')](respondWithResult(_0x53f4fc,null))[_0x50f4('0x44')](handleError(_0x53f4fc,null));};exports[_0x50f4('0x4a')]=function(_0x5ea305,_0x370c61){return db[_0x50f4('0x2a')]['find']({'where':{'id':_0x5ea305[_0x50f4('0x46')]['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x370c61,null))[_0x50f4('0x24')](removeEntity(_0x370c61,null))[_0x50f4('0x44')](handleError(_0x370c61,null));};exports[_0x50f4('0x4b')]=function(_0x1fb54d,_0x4c81f6){return db[_0x50f4('0x2a')][_0x50f4('0x4b')]()[_0x50f4('0x24')](respondWithResult(_0x4c81f6,null))['catch'](handleError(_0x4c81f6,null));};exports[_0x50f4('0x4c')]=function(_0x424c59,_0x377f7c,_0x32cb17){var _0x5b444b={'raw':!![],'where':{}};var _0x49f3dd={};var _0x2b05ca={'count':0x0,'rows':[]};return db[_0x50f4('0x2a')][_0x50f4('0x4d')]({'where':{'id':_0x424c59['params']['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x377f7c,null))[_0x50f4('0x24')](function(_0x1e5265){if(_0x1e5265){_0x49f3dd['model']=_[_0x50f4('0x2f')](db['JscriptyQuestionReport']['rawAttributes']);_0x49f3dd[_0x50f4('0x30')]=_[_0x50f4('0x2f')](_0x424c59['query']);_0x49f3dd[_0x50f4('0x31')]=_['intersection'](_0x49f3dd[_0x50f4('0x32')],_0x49f3dd[_0x50f4('0x30')]);_0x5b444b[_0x50f4('0x33')]=_[_0x50f4('0x34')](_0x49f3dd['model'],qs['fields'](_0x424c59[_0x50f4('0x30')][_0x50f4('0x35')]));_0x5b444b[_0x50f4('0x33')]=_0x5b444b[_0x50f4('0x33')][_0x50f4('0x36')]?_0x5b444b['attributes']:_0x49f3dd['model'];if(!_0x424c59['query']['hasOwnProperty']('nolimit')){_0x5b444b[_0x50f4('0x39')]=qs[_0x50f4('0x39')](_0x424c59[_0x50f4('0x30')]['limit']);_0x5b444b['offset']=qs[_0x50f4('0x1b')](_0x424c59[_0x50f4('0x30')][_0x50f4('0x1b')]);}_0x5b444b[_0x50f4('0x3a')]=qs[_0x50f4('0x3b')](_0x424c59[_0x50f4('0x30')][_0x50f4('0x3b')]);_0x5b444b[_0x50f4('0x3d')]=qs['filters'](_[_0x50f4('0x4e')](_0x424c59[_0x50f4('0x30')],_0x49f3dd[_0x50f4('0x31')]));_0x5b444b[_0x50f4('0x3d')][_0x50f4('0x4f')]=_0x1e5265['id'];if(_0x424c59[_0x50f4('0x30')][_0x50f4('0x3c')]){_0x5b444b[_0x50f4('0x3d')]=_[_0x50f4('0x3f')](_0x5b444b['where'],{'$or':_[_0x50f4('0x29')](_0x5b444b['attributes'],function(_0x2aae2f){var _0x278b9c={};_0x278b9c[_0x2aae2f]={'$like':'%'+_0x424c59[_0x50f4('0x30')][_0x50f4('0x3c')]+'%'};return _0x278b9c;})});}_0x5b444b=_[_0x50f4('0x3f')]({},_0x5b444b,_0x424c59[_0x50f4('0x40')]);return db[_0x50f4('0x50')][_0x50f4('0x1d')]({'where':_0x5b444b[_0x50f4('0x3d')]})[_0x50f4('0x24')](function(_0x385837){_0x2b05ca['count']=_0x385837;if(_0x424c59[_0x50f4('0x30')]['includeAll']){_0x5b444b['include']=[{'all':!![]}];}return db[_0x50f4('0x50')][_0x50f4('0x42')](_0x5b444b);})[_0x50f4('0x24')](function(_0x2ccd33){_0x2b05ca[_0x50f4('0x43')]=_0x2ccd33;return _0x2b05ca;});}})[_0x50f4('0x24')](respondWithFilteredResult(_0x377f7c,_0x5b444b))[_0x50f4('0x44')](handleError(_0x377f7c,null));};
\ No newline at end of file
index caaf0d7..27db10e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1c=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','request-promise','path','rimraf','./jscriptySessionReport.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xed1c,0xe4));var _0xced1=function(_0xc60341,_0x521316){_0xc60341=_0xc60341-0x0;var _0x309ee7=_0xed1c[_0xc60341];return _0x309ee7;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3831=['define','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptySessionReport.attributes'];(function(_0x5bf174,_0x52067d){var _0x56c4da=function(_0x449f74){while(--_0x449f74){_0x5bf174['push'](_0x5bf174['shift']());}};_0x56c4da(++_0x52067d);}(_0x3831,0x14c));var _0x1383=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0x3831[_0x40f9a0];return _0x3e3144;};'use strict';var _=require(_0x1383('0x0'));var util=require('util');var logger=require(_0x1383('0x1'))(_0x1383('0x2'));var moment=require(_0x1383('0x3'));var BPromise=require(_0x1383('0x4'));var rp=require(_0x1383('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1383('0x6'));var config=require('../../config/environment');var attributes=require(_0x1383('0x7'));module['exports']=function(_0x5b64b1,_0x5eb4d8){return _0x5b64b1[_0x1383('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x1383('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0e739c0..087b14a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a0=['message','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x8e276f,_0x356cc2){var _0x2da08d=function(_0x3f69fd){while(--_0x3f69fd){_0x8e276f['push'](_0x8e276f['shift']());}};_0x2da08d(++_0x356cc2);}(_0x27a0,0xbf));var _0x027a=function(_0x4eb934,_0x13097f){_0x4eb934=_0x4eb934-0x0;var _0x3b763b=_0x27a0[_0x4eb934];return _0x3b763b;};'use strict';var _=require('lodash');var util=require(_0x027a('0x0'));var moment=require(_0x027a('0x1'));var BPromise=require(_0x027a('0x2'));var rs=require(_0x027a('0x3'));var fs=require('fs');var Redis=require(_0x027a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x027a('0x5'));var jayson=require(_0x027a('0x6'));var client=jayson[_0x027a('0x7')][_0x027a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe233ed,_0x3c7d67,_0x550fbb){return new BPromise(function(_0x3d1429,_0x271dfe){return client[_0x027a('0x9')](_0xe233ed,_0x550fbb)['then'](function(_0x44c56a){logger[_0x027a('0xa')](_0x027a('0xb'),_0x3c7d67,'request\x20sent');logger[_0x027a('0xc')](_0x027a('0xd'),_0x3c7d67,_0x027a('0xe'),JSON[_0x027a('0xf')](_0x44c56a));if(_0x44c56a[_0x027a('0x10')]){if(_0x44c56a[_0x027a('0x10')][_0x027a('0x11')]===0x1f4){logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x271dfe(_0x44c56a['error'][_0x027a('0x12')]);}logger[_0x027a('0x10')](_0x027a('0xb'),_0x3c7d67,_0x44c56a[_0x027a('0x10')][_0x027a('0x12')]);return _0x3d1429(_0x44c56a['error']['message']);}else{logger[_0x027a('0xa')]('JscriptySessionReport,\x20%s,\x20%s',_0x3c7d67,_0x027a('0xe'));_0x3d1429(_0x44c56a['result'][_0x027a('0x12')]);}})['catch'](function(_0x4dc3ab){logger['error'](_0x027a('0xb'),_0x3c7d67,_0x4dc3ab);_0x271dfe(_0x4dc3ab);});});}
\ No newline at end of file
+var _0x32b6=['JscriptySessionReport,\x20%s,\x20%s','message','info','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code'];(function(_0x3e9313,_0x59beba){var _0x4e5fa2=function(_0x4b5ae7){while(--_0x4b5ae7){_0x3e9313['push'](_0x3e9313['shift']());}};_0x4e5fa2(++_0x59beba);}(_0x32b6,0x1d1));var _0x632b=function(_0x55ef0c,_0x53f23a){_0x55ef0c=_0x55ef0c-0x0;var _0x14b174=_0x32b6[_0x55ef0c];return _0x14b174;};'use strict';var _=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var moment=require('moment');var BPromise=require(_0x632b('0x2'));var rs=require(_0x632b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x632b('0x4'));var logger=require(_0x632b('0x5'))(_0x632b('0x6'));var config=require(_0x632b('0x7'));var jayson=require(_0x632b('0x8'));var client=jayson[_0x632b('0x9')][_0x632b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10458a,_0x3bbf43,_0x43d6c7){return new BPromise(function(_0x5128f5,_0x33d711){return client[_0x632b('0xb')](_0x10458a,_0x43d6c7)[_0x632b('0xc')](function(_0x174201){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,'request\x20sent');logger[_0x632b('0xd')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3bbf43,_0x632b('0xe'),JSON[_0x632b('0xf')](_0x174201));if(_0x174201[_0x632b('0x10')]){if(_0x174201[_0x632b('0x10')][_0x632b('0x11')]===0x1f4){logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201[_0x632b('0x10')][_0x632b('0x13')]);return _0x33d711(_0x174201['error'][_0x632b('0x13')]);}logger[_0x632b('0x10')](_0x632b('0x12'),_0x3bbf43,_0x174201['error'][_0x632b('0x13')]);return _0x5128f5(_0x174201[_0x632b('0x10')][_0x632b('0x13')]);}else{logger[_0x632b('0x14')](_0x632b('0x12'),_0x3bbf43,_0x632b('0xe'));_0x5128f5(_0x174201['result'][_0x632b('0x13')]);}})['catch'](function(_0x4fdef2){logger[_0x632b('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x3bbf43,_0x4fdef2);_0x33d711(_0x4fdef2);});});}
\ No newline at end of file
index 854d676..cdb7591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c8f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','put','isAuthenticated','update','/download_log_file','multer','util','path'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x1c8f,0x12d));var _0xf1c8=function(_0x4ef5c3,_0x33c488){_0x4ef5c3=_0x4ef5c3-0x0;var _0x4254ad=_0x1c8f[_0x4ef5c3];return _0x4254ad;};'use strict';var multer=require(_0xf1c8('0x0'));var util=require(_0xf1c8('0x1'));var path=require(_0xf1c8('0x2'));var timeout=require(_0xf1c8('0x3'));var express=require(_0xf1c8('0x4'));var router=express[_0xf1c8('0x5')]();var fs_extra=require(_0xf1c8('0x6'));var auth=require(_0xf1c8('0x7'));var interaction=require(_0xf1c8('0x8'));var config=require(_0xf1c8('0x9'));var controller=require(_0xf1c8('0xa'));router[_0xf1c8('0xb')]('/',controller['index']);router[_0xf1c8('0xc')]('/:id',auth[_0xf1c8('0xd')](),controller[_0xf1c8('0xe')]);router[_0xf1c8('0xb')](_0xf1c8('0xf'),auth[_0xf1c8('0xd')](),controller['downloadLogFile']);module['exports']=router;
\ No newline at end of file
+var _0x848a=['fs-extra','../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','update','get','/download_log_file','isAuthenticated','exports','multer','util','express','Router'];(function(_0x596ed9,_0x22bb78){var _0x584f5b=function(_0x486516){while(--_0x486516){_0x596ed9['push'](_0x596ed9['shift']());}};_0x584f5b(++_0x22bb78);}(_0x848a,0x18c));var _0xa848=function(_0x343090,_0x433a80){_0x343090=_0x343090-0x0;var _0x3ff3e8=_0x848a[_0x343090];return _0x3ff3e8;};'use strict';var multer=require(_0xa848('0x0'));var util=require(_0xa848('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa848('0x2'));var router=express[_0xa848('0x3')]();var fs_extra=require(_0xa848('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa848('0x5'));var config=require(_0xa848('0x6'));var controller=require(_0xa848('0x7'));router['get']('/',controller[_0xa848('0x8')]);router[_0xa848('0x9')](_0xa848('0xa'),auth['isAuthenticated'](),controller[_0xa848('0xb')]);router[_0xa848('0xc')](_0xa848('0xd'),auth[_0xa848('0xe')](),controller['downloadLogFile']);module[_0xa848('0xf')]=router;
\ No newline at end of file
index b1e40c6..f893ed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x697a=['STRING','sequelize','exports','TEXT'];(function(_0x2e3587,_0x22c529){var _0x39d4a3=function(_0x922d6a){while(--_0x922d6a){_0x2e3587['push'](_0x2e3587['shift']());}};_0x39d4a3(++_0x22c529);}(_0x697a,0x1b1));var _0xa697=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x697a[_0x65c50e];return _0x4573e7;};'use strict';var Sequelize=require(_0xa697('0x0'));module[_0xa697('0x1')]={'license':{'type':Sequelize[_0xa697('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xa697('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x290e=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x95e7a2,_0x104957){var _0x5b387c=function(_0x225274){while(--_0x225274){_0x95e7a2['push'](_0x95e7a2['shift']());}};_0x5b387c(++_0x104957);}(_0x290e,0x82));var _0xe290=function(_0x424d75,_0x135168){_0x424d75=_0x424d75-0x0;var _0x3f1ecb=_0x290e[_0x424d75];return _0x3f1ecb;};'use strict';var Sequelize=require(_0xe290('0x0'));module[_0xe290('0x1')]={'license':{'type':Sequelize[_0xe290('0x2')]},'data1':{'type':Sequelize[_0xe290('0x3')]},'data2':{'type':Sequelize[_0xe290('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xe290('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index ed3a78f..4e5c0c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf599=['path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','model','keys','License','query','filters','intersection','fields','attributes','merge','options','getLicense','body','find','params','get','key','demo','catch','downloadLogFile','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','download','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x518093,_0x849a77){var _0x34b038=function(_0x1bf5d8){while(--_0x1bf5d8){_0x518093['push'](_0x518093['shift']());}};_0x34b038(++_0x849a77);}(_0xf599,0x122));var _0x9f59=function(_0x518189,_0x280941){_0x518189=_0x518189-0x0;var _0x14f749=_0xf599[_0x518189];return _0x14f749;};'use strict';var emlformat=require(_0x9f59('0x0'));var rimraf=require(_0x9f59('0x1'));var zipdir=require(_0x9f59('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f59('0x3'));var moment=require(_0x9f59('0x4'));var BPromise=require(_0x9f59('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9f59('0x6'));var sox=require(_0x9f59('0x7'));var csv=require(_0x9f59('0x8'));var ejs=require(_0x9f59('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f59('0xa'));var squel=require(_0x9f59('0xb'));var crypto=require('crypto');var jsforce=require(_0x9f59('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9f59('0xd'));var Redis=require(_0x9f59('0xe'));var authService=require(_0x9f59('0xf'));var qs=require(_0x9f59('0x10'));var as=require(_0x9f59('0x11'));var hardwareService=require(_0x9f59('0x12'));var logger=require(_0x9f59('0x13'))(_0x9f59('0x14'));var utils=require(_0x9f59('0x15'));var config=require(_0x9f59('0x16'));var licenseUtil=require(_0x9f59('0x17'));var db=require(_0x9f59('0x18'))['db'];function respondWithStatusCode(_0x4d3b20,_0x428c1f){_0x428c1f=_0x428c1f||0xcc;return function(_0x15344a){if(_0x15344a){return _0x4d3b20['sendStatus'](_0x428c1f);}return _0x4d3b20['status'](_0x428c1f)[_0x9f59('0x19')]();};}function respondWithResult(_0x1edad4,_0x226f7b){_0x226f7b=_0x226f7b||0xc8;return function(_0x3c43dc){if(_0x3c43dc){return _0x1edad4[_0x9f59('0x1a')](_0x226f7b)[_0x9f59('0x1b')](_0x3c43dc);}};}function respondWithFilteredResult(_0x9d7b7,_0x2614bb){return function(_0x42ffd2){if(_0x42ffd2){var _0x4583b8=typeof _0x2614bb[_0x9f59('0x1c')]===_0x9f59('0x1d')&&typeof _0x2614bb[_0x9f59('0x1e')]===_0x9f59('0x1d');var _0x535530=_0x42ffd2[_0x9f59('0x1f')];var _0x4eb265=_0x4583b8?0x0:_0x2614bb[_0x9f59('0x1c')];var _0x534444=_0x4583b8?_0x42ffd2[_0x9f59('0x1f')]:_0x2614bb[_0x9f59('0x1c')]+_0x2614bb[_0x9f59('0x1e')];var _0xc3bbd4;if(_0x534444>=_0x535530){_0x534444=_0x535530;_0xc3bbd4=0xc8;}else{_0xc3bbd4=0xce;}_0x9d7b7[_0x9f59('0x1a')](_0xc3bbd4);return _0x9d7b7[_0x9f59('0x20')]('Content-Range',_0x4eb265+'-'+_0x534444+'/'+_0x535530)[_0x9f59('0x1b')](_0x42ffd2);}return null;};}function patchUpdates(_0x5830ab){return function(_0x8921ac){try{jsonpatch[_0x9f59('0x21')](_0x8921ac,_0x5830ab,!![]);}catch(_0x4ede0a){return BPromise[_0x9f59('0x22')](_0x4ede0a);}return _0x8921ac[_0x9f59('0x23')]();};}function saveUpdates(_0x38805f,_0x4e5ac8){return function(_0x1559b1){if(_0x1559b1){return _0x1559b1[_0x9f59('0x24')](_0x38805f)[_0x9f59('0x25')](function(_0x321a86){return _0x321a86;});}return null;};}function removeEntity(_0x361fb1,_0x39fc16){return function(_0x964022){if(_0x964022){return _0x964022[_0x9f59('0x26')]()['then'](function(){_0x361fb1['status'](0xcc)[_0x9f59('0x19')]();});}};}function handleEntityNotFound(_0x3cf2d2,_0x7e9938){return function(_0x2284d5){if(!_0x2284d5){_0x3cf2d2[_0x9f59('0x27')](0x194);}return _0x2284d5;};}function handleError(_0x1b8652,_0x222d1a){_0x222d1a=_0x222d1a||0x1f4;return function(_0x3d7315){logger[_0x9f59('0x28')](_0x3d7315[_0x9f59('0x29')]);if(_0x3d7315[_0x9f59('0x2a')]){delete _0x3d7315['name'];}_0x1b8652[_0x9f59('0x1a')](_0x222d1a)[_0x9f59('0x2b')](_0x3d7315);};}var utilLicense=require(_0x9f59('0x17'));exports[_0x9f59('0x2c')]=function(_0x139f22,_0x369b77){var _0x264e56={'raw':!![],'where':{'id':0x1}},_0x359a63={};_0x359a63[_0x9f59('0x2d')]=_[_0x9f59('0x2e')](db[_0x9f59('0x2f')]['rawAttributes']);_0x359a63[_0x9f59('0x30')]=_[_0x9f59('0x2e')](_0x139f22[_0x9f59('0x30')]);_0x359a63[_0x9f59('0x31')]=_['intersection'](_0x359a63[_0x9f59('0x2d')],_0x359a63['query']);_0x264e56['attributes']=_[_0x9f59('0x32')](_0x359a63[_0x9f59('0x2d')],qs[_0x9f59('0x33')](_0x139f22['query']['fields']));_0x264e56[_0x9f59('0x34')]=_0x264e56[_0x9f59('0x34')]['length']?_0x264e56['attributes']:_0x359a63[_0x9f59('0x2d')];_0x264e56=_[_0x9f59('0x35')]({},_0x264e56,_0x139f22[_0x9f59('0x36')]);return utilLicense[_0x9f59('0x37')](_0x264e56)['then'](respondWithResult(_0x369b77,null))['catch'](handleError(_0x369b77,null));};exports['update']=function(_0x275e1c,_0x1d6c38){if(_0x275e1c[_0x9f59('0x38')]['id']){delete _0x275e1c[_0x9f59('0x38')]['id'];}return db['License'][_0x9f59('0x39')]({'where':{'id':_0x275e1c[_0x9f59('0x3a')]['id']}})[_0x9f59('0x25')](handleEntityNotFound(_0x1d6c38,null))['then'](function(_0x1ed7c0){var _0x4a4df1=_0x1ed7c0[_0x9f59('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x4a4df1,_0x275e1c[_0x9f59('0x38')][_0x9f59('0x3c')]);})[_0x9f59('0x25')](function(_0x4a5ac4){if(!_0x4a5ac4[_0x9f59('0x3d')]){return saveUpdates(_0x275e1c[_0x9f59('0x38')],null);}return _0x4a5ac4;})['then'](respondWithResult(_0x1d6c38,null))[_0x9f59('0x3e')](handleError(_0x1d6c38,null));};exports[_0x9f59('0x3f')]=function(_0x687959,_0x19ecfe){var _0x5c22b3=_0x9f59('0x40');var _0x369a5b=path[_0x9f59('0x41')](_0x9f59('0x42'),_0x9f59('0x43'),_0x9f59('0x44'),_0x5c22b3);_0x19ecfe[_0x9f59('0x45')](_0x9f59('0x46'),_0x9f59('0x47')+_0x5c22b3);_0x19ecfe[_0x9f59('0x20')](_0x9f59('0x48'),'text/plain');_0x19ecfe[_0x9f59('0x49')](_0x369a5b);};
\ No newline at end of file
+var _0xdc52=['status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','model','keys','rawAttributes','query','intersection','fields','attributes','length','merge','getLicense','catch','body','License','find','get','checkLicense','key','license-info.log','join','/var','log','xcally','setHeader','Content-Type','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5ec501,_0x2c2b66){var _0x54a0ce=function(_0x4a3bd6){while(--_0x4a3bd6){_0x5ec501['push'](_0x5ec501['shift']());}};_0x54a0ce(++_0x2c2b66);}(_0xdc52,0x1bd));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2dc5('0x0'));var rimraf=require(_0x2dc5('0x1'));var zipdir=require(_0x2dc5('0x2'));var jsonpatch=require(_0x2dc5('0x3'));var rp=require(_0x2dc5('0x4'));var moment=require(_0x2dc5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2dc5('0x6'));var path=require('path');var sox=require(_0x2dc5('0x7'));var csv=require('to-csv');var ejs=require(_0x2dc5('0x8'));var fs=require('fs');var fs_extra=require(_0x2dc5('0x9'));var _=require('lodash');var squel=require(_0x2dc5('0xa'));var crypto=require('crypto');var jsforce=require(_0x2dc5('0xb'));var deskjs=require(_0x2dc5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x2dc5('0xd'));var Papa=require(_0x2dc5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2dc5('0xf'));var as=require(_0x2dc5('0x10'));var hardwareService=require(_0x2dc5('0x11'));var logger=require('../../config/logger')(_0x2dc5('0x12'));var utils=require(_0x2dc5('0x13'));var config=require(_0x2dc5('0x14'));var licenseUtil=require(_0x2dc5('0x15'));var db=require(_0x2dc5('0x16'))['db'];function respondWithStatusCode(_0x27ab7f,_0x5ddf7d){_0x5ddf7d=_0x5ddf7d||0xcc;return function(_0x10d57f){if(_0x10d57f){return _0x27ab7f[_0x2dc5('0x17')](_0x5ddf7d);}return _0x27ab7f[_0x2dc5('0x18')](_0x5ddf7d)[_0x2dc5('0x19')]();};}function respondWithResult(_0x36bda0,_0x582714){_0x582714=_0x582714||0xc8;return function(_0x545497){if(_0x545497){return _0x36bda0[_0x2dc5('0x18')](_0x582714)[_0x2dc5('0x1a')](_0x545497);}};}function respondWithFilteredResult(_0x4dbe17,_0x1f66b1){return function(_0x213f97){if(_0x213f97){var _0x208ba5=typeof _0x1f66b1[_0x2dc5('0x1b')]===_0x2dc5('0x1c')&&typeof _0x1f66b1['limit']==='undefined';var _0x44d183=_0x213f97['count'];var _0x3008b8=_0x208ba5?0x0:_0x1f66b1['offset'];var _0x1463bd=_0x208ba5?_0x213f97[_0x2dc5('0x1d')]:_0x1f66b1['offset']+_0x1f66b1[_0x2dc5('0x1e')];var _0x151b59;if(_0x1463bd>=_0x44d183){_0x1463bd=_0x44d183;_0x151b59=0xc8;}else{_0x151b59=0xce;}_0x4dbe17[_0x2dc5('0x18')](_0x151b59);return _0x4dbe17[_0x2dc5('0x1f')](_0x2dc5('0x20'),_0x3008b8+'-'+_0x1463bd+'/'+_0x44d183)['json'](_0x213f97);}return null;};}function patchUpdates(_0x4ee437){return function(_0x23ea94){try{jsonpatch[_0x2dc5('0x21')](_0x23ea94,_0x4ee437,!![]);}catch(_0x2eeeae){return BPromise['reject'](_0x2eeeae);}return _0x23ea94[_0x2dc5('0x22')]();};}function saveUpdates(_0x59780a,_0x218f32){return function(_0x1f63f7){if(_0x1f63f7){return _0x1f63f7[_0x2dc5('0x23')](_0x59780a)[_0x2dc5('0x24')](function(_0x1b2490){return _0x1b2490;});}return null;};}function removeEntity(_0x2a5887,_0x5ee204){return function(_0x32bad6){if(_0x32bad6){return _0x32bad6[_0x2dc5('0x25')]()[_0x2dc5('0x24')](function(){_0x2a5887['status'](0xcc)[_0x2dc5('0x19')]();});}};}function handleEntityNotFound(_0x38d12b,_0x47f730){return function(_0x42458a){if(!_0x42458a){_0x38d12b[_0x2dc5('0x17')](0x194);}return _0x42458a;};}function handleError(_0x16ac3e,_0x5b51a0){_0x5b51a0=_0x5b51a0||0x1f4;return function(_0x4b9e93){logger[_0x2dc5('0x26')](_0x4b9e93[_0x2dc5('0x27')]);if(_0x4b9e93[_0x2dc5('0x28')]){delete _0x4b9e93[_0x2dc5('0x28')];}_0x16ac3e['status'](_0x5b51a0)[_0x2dc5('0x29')](_0x4b9e93);};}var utilLicense=require(_0x2dc5('0x15'));exports[_0x2dc5('0x2a')]=function(_0x178800,_0x1e0170){var _0x5957e3={'raw':!![],'where':{'id':0x1}},_0x4acd1e={};_0x4acd1e[_0x2dc5('0x2b')]=_[_0x2dc5('0x2c')](db['License'][_0x2dc5('0x2d')]);_0x4acd1e[_0x2dc5('0x2e')]=_[_0x2dc5('0x2c')](_0x178800[_0x2dc5('0x2e')]);_0x4acd1e['filters']=_[_0x2dc5('0x2f')](_0x4acd1e['model'],_0x4acd1e[_0x2dc5('0x2e')]);_0x5957e3['attributes']=_['intersection'](_0x4acd1e[_0x2dc5('0x2b')],qs[_0x2dc5('0x30')](_0x178800['query'][_0x2dc5('0x30')]));_0x5957e3[_0x2dc5('0x31')]=_0x5957e3['attributes'][_0x2dc5('0x32')]?_0x5957e3[_0x2dc5('0x31')]:_0x4acd1e[_0x2dc5('0x2b')];_0x5957e3=_[_0x2dc5('0x33')]({},_0x5957e3,_0x178800['options']);return utilLicense[_0x2dc5('0x34')](_0x5957e3)[_0x2dc5('0x24')](respondWithResult(_0x1e0170,null))[_0x2dc5('0x35')](handleError(_0x1e0170,null));};exports[_0x2dc5('0x23')]=function(_0x56e503,_0x5461b0){if(_0x56e503['body']['id']){delete _0x56e503[_0x2dc5('0x36')]['id'];}return db[_0x2dc5('0x37')][_0x2dc5('0x38')]({'where':{'id':_0x56e503['params']['id']}})[_0x2dc5('0x24')](handleEntityNotFound(_0x5461b0,null))[_0x2dc5('0x24')](function(_0x265068){var _0x5ce671=_0x265068[_0x2dc5('0x39')]({'plain':!![]});return utilLicense[_0x2dc5('0x3a')](_0x5ce671,_0x56e503[_0x2dc5('0x36')][_0x2dc5('0x3b')]);})[_0x2dc5('0x24')](function(_0x4ba712){if(!_0x4ba712['demo']){return saveUpdates(_0x56e503['body'],null);}return _0x4ba712;})[_0x2dc5('0x24')](respondWithResult(_0x5461b0,null))[_0x2dc5('0x35')](handleError(_0x5461b0,null));};exports['downloadLogFile']=function(_0x6b8efc,_0x3d8ea9){var _0x3da773=_0x2dc5('0x3c');var _0x5cf6d0=path[_0x2dc5('0x3d')](_0x2dc5('0x3e'),_0x2dc5('0x3f'),_0x2dc5('0x40'),_0x3da773);_0x3d8ea9[_0x2dc5('0x41')]('Content-disposition','attachment;\x20filename='+_0x3da773);_0x3d8ea9['set'](_0x2dc5('0x42'),'text/plain');_0x3d8ea9['download'](_0x5cf6d0);};
\ No newline at end of file
index 01acff3..83f179d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d5a=['request-promise','path','../../config/environment','./license.attributes','exports','define','License','util','../../config/logger','bluebird'];(function(_0x425af8,_0x366c35){var _0x5c2eb1=function(_0x44785f){while(--_0x44785f){_0x425af8['push'](_0x425af8['shift']());}};_0x5c2eb1(++_0x366c35);}(_0x5d5a,0x101));var _0xa5d5=function(_0x388a8b,_0x4ae93b){_0x388a8b=_0x388a8b-0x0;var _0x3f6ebe=_0x5d5a[_0x388a8b];return _0x3f6ebe;};'use strict';var _=require('lodash');var util=require(_0xa5d5('0x0'));var logger=require(_0xa5d5('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa5d5('0x2'));var rp=require(_0xa5d5('0x3'));var fs=require('fs');var path=require(_0xa5d5('0x4'));var rimraf=require('rimraf');var config=require(_0xa5d5('0x5'));var attributes=require(_0xa5d5('0x6'));module[_0xa5d5('0x7')]=function(_0x4342b2,_0x259a5e){return _0x4342b2[_0xa5d5('0x8')](_0xa5d5('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa901=['License','license','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define'];(function(_0x121df7,_0x207e61){var _0x227c4e=function(_0xafce7d){while(--_0xafce7d){_0x121df7['push'](_0x121df7['shift']());}};_0x227c4e(++_0x207e61);}(_0xa901,0xfe));var _0x1a90=function(_0x2c0409,_0x5cb4ef){_0x2c0409=_0x2c0409-0x0;var _0x551c0b=_0xa901[_0x2c0409];return _0x551c0b;};'use strict';var _=require('lodash');var util=require(_0x1a90('0x0'));var logger=require(_0x1a90('0x1'))(_0x1a90('0x2'));var moment=require('moment');var BPromise=require(_0x1a90('0x3'));var rp=require(_0x1a90('0x4'));var fs=require('fs');var path=require(_0x1a90('0x5'));var rimraf=require(_0x1a90('0x6'));var config=require(_0x1a90('0x7'));var attributes=require(_0x1a90('0x8'));module['exports']=function(_0x55acbd,_0x35d3b3){return _0x55acbd[_0x1a90('0x9')](_0x1a90('0xa'),attributes,{'tableName':_0x1a90('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 43b5b27..5160b09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d2e=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s'];(function(_0x13022a,_0x295704){var _0x454d7f=function(_0x34195a){while(--_0x34195a){_0x13022a['push'](_0x13022a['shift']());}};_0x454d7f(++_0x295704);}(_0x7d2e,0xb6));var _0xe7d2=function(_0x549c39,_0x1f88de){_0x549c39=_0x549c39-0x0;var _0xb88b84=_0x7d2e[_0x549c39];return _0xb88b84;};'use strict';var _=require('lodash');var util=require(_0xe7d2('0x0'));var moment=require(_0xe7d2('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7d2('0x2'));var fs=require('fs');var Redis=require(_0xe7d2('0x3'));var db=require(_0xe7d2('0x4'))['db'];var utils=require(_0xe7d2('0x5'));var logger=require(_0xe7d2('0x6'))(_0xe7d2('0x7'));var config=require(_0xe7d2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe7d2('0x9')][_0xe7d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b2890,_0x36c9fb,_0x56129a){return new BPromise(function(_0x227304,_0x3d5884){return client[_0xe7d2('0xb')](_0x4b2890,_0x56129a)['then'](function(_0x206bd8){logger[_0xe7d2('0xc')](_0xe7d2('0xd'),_0x36c9fb,_0xe7d2('0xe'));logger['debug'](_0xe7d2('0xf'),_0x36c9fb,_0xe7d2('0xe'),JSON[_0xe7d2('0x10')](_0x206bd8));if(_0x206bd8[_0xe7d2('0x11')]){if(_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x12')]===0x1f4){logger[_0xe7d2('0x11')](_0xe7d2('0xd'),_0x36c9fb,_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x13')]);return _0x3d5884(_0x206bd8['error'][_0xe7d2('0x13')]);}logger[_0xe7d2('0x11')](_0xe7d2('0xd'),_0x36c9fb,_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x13')]);return _0x227304(_0x206bd8[_0xe7d2('0x11')][_0xe7d2('0x13')]);}else{logger[_0xe7d2('0xc')](_0xe7d2('0xd'),_0x36c9fb,_0xe7d2('0xe'));_0x227304(_0x206bd8[_0xe7d2('0x14')][_0xe7d2('0x13')]);}})[_0xe7d2('0x15')](function(_0x40d5fc){logger['error'](_0xe7d2('0xd'),_0x36c9fb,_0x40d5fc);_0x3d5884(_0x40d5fc);});});}
\ No newline at end of file
+var _0xeafb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','License,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x31dfde,_0x521d49){var _0x42965b=function(_0x551d11){while(--_0x551d11){_0x31dfde['push'](_0x31dfde['shift']());}};_0x42965b(++_0x521d49);}(_0xeafb,0x13c));var _0xbeaf=function(_0x1707f0,_0x23f136){_0x1707f0=_0x1707f0-0x0;var _0xccacd1=_0xeafb[_0x1707f0];return _0xccacd1;};'use strict';var _=require('lodash');var util=require(_0xbeaf('0x0'));var moment=require(_0xbeaf('0x1'));var BPromise=require(_0xbeaf('0x2'));var rs=require(_0xbeaf('0x3'));var fs=require('fs');var Redis=require(_0xbeaf('0x4'));var db=require(_0xbeaf('0x5'))['db'];var utils=require(_0xbeaf('0x6'));var logger=require(_0xbeaf('0x7'))('rpc');var config=require(_0xbeaf('0x8'));var jayson=require(_0xbeaf('0x9'));var client=jayson[_0xbeaf('0xa')][_0xbeaf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5aee71,_0x28700f,_0xee5d8c){return new BPromise(function(_0x5eab68,_0x44eb8a){return client[_0xbeaf('0xc')](_0x5aee71,_0xee5d8c)['then'](function(_0x36ec2d){logger['info']('License,\x20%s,\x20%s',_0x28700f,_0xbeaf('0xd'));logger[_0xbeaf('0xe')]('License,\x20%s,\x20%s,\x20%s',_0x28700f,'request\x20sent',JSON[_0xbeaf('0xf')](_0x36ec2d));if(_0x36ec2d[_0xbeaf('0x10')]){if(_0x36ec2d[_0xbeaf('0x10')][_0xbeaf('0x11')]===0x1f4){logger[_0xbeaf('0x10')](_0xbeaf('0x12'),_0x28700f,_0x36ec2d[_0xbeaf('0x10')][_0xbeaf('0x13')]);return _0x44eb8a(_0x36ec2d[_0xbeaf('0x10')]['message']);}logger[_0xbeaf('0x10')]('License,\x20%s,\x20%s',_0x28700f,_0x36ec2d['error']['message']);return _0x5eab68(_0x36ec2d[_0xbeaf('0x10')][_0xbeaf('0x13')]);}else{logger[_0xbeaf('0x14')]('License,\x20%s,\x20%s',_0x28700f,'request\x20sent');_0x5eab68(_0x36ec2d[_0xbeaf('0x15')][_0xbeaf('0x13')]);}})[_0xbeaf('0x16')](function(_0x481ecb){logger[_0xbeaf('0x10')]('License,\x20%s,\x20%s',_0x28700f,_0x481ecb);_0x44eb8a(_0x481ecb);});});}
\ No newline at end of file
index 4c0fd0e..56cfed4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1c3=['delete','removeAnswers','removeImap','removeSmtp','removeAgents','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','getSmtp','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/dispositions','addDisposition','addAnswer','post','/:id/in_servers','addImap','/:id/out_servers','/:id/interactions','/:id/applications','/:id/send','send','/:id/users','addAgents','put','update'];(function(_0x266537,_0x1262b6){var _0xb25080=function(_0x4246d1){while(--_0x4246d1){_0x266537['push'](_0x266537['shift']());}};_0xb25080(++_0x1262b6);}(_0xe1c3,0x1ea));var _0x3e1c=function(_0x366c56,_0x23f34a){_0x366c56=_0x366c56-0x0;var _0x1673b7=_0xe1c3[_0x366c56];return _0x1673b7;};'use strict';var multer=require(_0x3e1c('0x0'));var util=require(_0x3e1c('0x1'));var path=require('path');var timeout=require(_0x3e1c('0x2'));var express=require(_0x3e1c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3e1c('0x4'));var config=require(_0x3e1c('0x5'));var controller=require(_0x3e1c('0x6'));router[_0x3e1c('0x7')]('/',auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x9')]);router[_0x3e1c('0x7')](_0x3e1c('0xa'),auth[_0x3e1c('0x8')](),controller['describe']);router[_0x3e1c('0x7')](_0x3e1c('0xb'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0xc')]);router[_0x3e1c('0x7')]('/:id/dispositions',auth[_0x3e1c('0x8')](),controller[_0x3e1c('0xd')]);router['get'](_0x3e1c('0xe'),auth['isAuthenticated'](),controller[_0x3e1c('0xf')]);router['get']('/:id/in_servers',auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x10')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x3e1c('0x11')]);router[_0x3e1c('0x7')]('/:id/interactions',auth[_0x3e1c('0x8')](),controller['getInteractions']);router[_0x3e1c('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x3e1c('0x12')]);router[_0x3e1c('0x7')](_0x3e1c('0x13'),auth['isAuthenticated'](),controller[_0x3e1c('0x14')]);router['get'](_0x3e1c('0x15'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x16')]);router[_0x3e1c('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post'](_0x3e1c('0x17'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x18')]);router['post'](_0x3e1c('0xe'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x19')]);router[_0x3e1c('0x1a')]('/',auth[_0x3e1c('0x8')](),controller['create']);router[_0x3e1c('0x1a')](_0x3e1c('0x1b'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x1c')]);router[_0x3e1c('0x1a')](_0x3e1c('0x1d'),auth['isAuthenticated'](),controller['addSmtp']);router[_0x3e1c('0x1a')](_0x3e1c('0x1e'),auth[_0x3e1c('0x8')](),controller['addInteraction']);router[_0x3e1c('0x1a')](_0x3e1c('0x1f'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x3e1c('0x20'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x21')]);router[_0x3e1c('0x1a')](_0x3e1c('0x22'),auth['isAuthenticated'](),controller[_0x3e1c('0x23')]);router[_0x3e1c('0x24')](_0x3e1c('0xb'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x25')]);router['delete'](_0x3e1c('0x17'),auth[_0x3e1c('0x8')](),controller['removeDispositions']);router[_0x3e1c('0x26')](_0x3e1c('0xe'),auth[_0x3e1c('0x8')](),controller[_0x3e1c('0x27')]);router['delete'](_0x3e1c('0x1b'),auth['isAuthenticated'](),controller[_0x3e1c('0x28')]);router[_0x3e1c('0x26')](_0x3e1c('0x1d'),auth['isAuthenticated'](),controller[_0x3e1c('0x29')]);router[_0x3e1c('0x26')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x3e1c('0x26')](_0x3e1c('0x22'),auth['isAuthenticated'](),controller[_0x3e1c('0x2a')]);module[_0x3e1c('0x2b')]=router;
\ No newline at end of file
+var _0x7757=['removeDispositions','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','getInteractions','/:id/messages','getMessages','/:id/verify','verifySmtp','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/applications','addApplications','send','update','delete'];(function(_0x4b9bf3,_0x26741b){var _0xcb4197=function(_0x4c79bf){while(--_0x4c79bf){_0x4b9bf3['push'](_0x4b9bf3['shift']());}};_0xcb4197(++_0x26741b);}(_0x7757,0x1aa));var _0x7775=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x7757[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x7775('0x0'));var util=require(_0x7775('0x1'));var path=require(_0x7775('0x2'));var timeout=require(_0x7775('0x3'));var express=require('express');var router=express[_0x7775('0x4')]();var fs_extra=require(_0x7775('0x5'));var auth=require(_0x7775('0x6'));var interaction=require(_0x7775('0x7'));var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0x7775('0x8')]('/',auth[_0x7775('0x9')](),controller[_0x7775('0xa')]);router[_0x7775('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7775('0xb')]);router[_0x7775('0x8')](_0x7775('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7775('0x8')](_0x7775('0xd'),auth[_0x7775('0x9')](),controller['getDispositions']);router[_0x7775('0x8')](_0x7775('0xe'),auth['isAuthenticated'](),controller[_0x7775('0xf')]);router[_0x7775('0x8')]('/:id/in_servers',auth[_0x7775('0x9')](),controller[_0x7775('0x10')]);router[_0x7775('0x8')]('/:id/out_servers',auth[_0x7775('0x9')](),controller['getSmtp']);router[_0x7775('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x7775('0x11')]);router[_0x7775('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x7775('0x8')](_0x7775('0x12'),auth[_0x7775('0x9')](),controller[_0x7775('0x13')]);router[_0x7775('0x8')](_0x7775('0x14'),auth[_0x7775('0x9')](),controller[_0x7775('0x15')]);router[_0x7775('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x7775('0x16')]('/:id/dispositions',auth[_0x7775('0x9')](),controller[_0x7775('0x17')]);router[_0x7775('0x16')](_0x7775('0xe'),auth[_0x7775('0x9')](),controller[_0x7775('0x18')]);router[_0x7775('0x16')]('/',auth[_0x7775('0x9')](),controller[_0x7775('0x19')]);router[_0x7775('0x16')](_0x7775('0x1a'),auth['isAuthenticated'](),controller[_0x7775('0x1b')]);router['post'](_0x7775('0x1c'),auth['isAuthenticated'](),controller[_0x7775('0x1d')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x7775('0x1e')]);router[_0x7775('0x16')](_0x7775('0x1f'),auth[_0x7775('0x9')](),controller[_0x7775('0x20')]);router[_0x7775('0x16')]('/:id/send',auth[_0x7775('0x9')](),controller[_0x7775('0x21')]);router['post']('/:id/users',auth[_0x7775('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7775('0x9')](),controller[_0x7775('0x22')]);router[_0x7775('0x23')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7775('0x24')]);router[_0x7775('0x23')](_0x7775('0xe'),auth[_0x7775('0x9')](),controller[_0x7775('0x25')]);router[_0x7775('0x23')](_0x7775('0x1a'),auth[_0x7775('0x9')](),controller['removeImap']);router['delete'](_0x7775('0x1c'),auth[_0x7775('0x9')](),controller[_0x7775('0x26')]);router[_0x7775('0x23')](_0x7775('0xc'),auth['isAuthenticated'](),controller[_0x7775('0x27')]);router['delete']('/:id/users',auth[_0x7775('0x9')](),controller[_0x7775('0x28')]);module[_0x7775('0x29')]=router;
\ No newline at end of file
index 6b41c4c..1666a7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ef=['outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM','hotmail','yahoo'];(function(_0x53df07,_0x43e242){var _0x14055e=function(_0x2b49e3){while(--_0x2b49e3){_0x53df07['push'](_0x53df07['shift']());}};_0x14055e(++_0x43e242);}(_0x08ef,0x130));var _0xf08e=function(_0x5f1f8f,_0x25acba){_0x5f1f8f=_0x5f1f8f-0x0;var _0x4435fb=_0x08ef[_0x5f1f8f];return _0x4435fb;};'use strict';var Sequelize=require(_0xf08e('0x0'));module[_0xf08e('0x1')]={'description':{'type':Sequelize[_0xf08e('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf08e('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xf08e('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf08e('0x4')]},'markAsUnread':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xf08e('0x2')],'allowNull':![],'defaultValue':_0xf08e('0x5')},'fontSize':{'type':Sequelize[_0xf08e('0x6')](0x2)[_0xf08e('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xf08e('0x4')],'defaultValue':function(){return _0xf08e('0x8');}},'notificationSound':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf08e('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xf08e('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xf08e('0x3')],'defaultValue':![],'comment':_0xf08e('0xa'),'set':function(_0x4318c3){if(!_0x4318c3)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xf08e('0xb')](_0xf08e('0xc'),_0x4318c3);}},'provider':{'type':Sequelize[_0xf08e('0xd')]('gmail',_0xf08e('0xe'),_0xf08e('0xf'),_0xf08e('0x10')),'defaultValue':null,'get':function(){if(!this[_0xf08e('0x11')](_0xf08e('0x12')))return _0xf08e('0x13');return this['getDataValue'](_0xf08e('0x12'));},'set':function(_0x2a31f5){if(_0x2a31f5==='custom')_0x2a31f5=null;return this['setDataValue'](_0xf08e('0x12'),_0x2a31f5);}}};
\ No newline at end of file
+var _0x7dfb=['INTEGER','UNSIGNED','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','yahoo','outlook365','custom','getDataValue','provider','sequelize','exports','STRING','BOOLEAN','Arial,Helvetica,sans-serif'];(function(_0x355af4,_0x138b6d){var _0x5e0477=function(_0x4dd267){while(--_0x4dd267){_0x355af4['push'](_0x355af4['shift']());}};_0x5e0477(++_0x138b6d);}(_0x7dfb,0x19d));var _0xb7df=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x7dfb[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0xb7df('0x0'));module[_0xb7df('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xb7df('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xb7df('0x2')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xb7df('0x2')],'allowNull':![],'defaultValue':_0xb7df('0x4')},'fontSize':{'type':Sequelize[_0xb7df('0x5')](0x2)[_0xb7df('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb7df('0x7');}},'notificationSound':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb7df('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb7df('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb7df('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xb7df('0x3')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x30cc7c){if(!_0x30cc7c)this[_0xb7df('0x9')](_0xb7df('0xa'),null);this[_0xb7df('0x9')](_0xb7df('0xb'),_0x30cc7c);}},'provider':{'type':Sequelize['ENUM'](_0xb7df('0xc'),_0xb7df('0xd'),_0xb7df('0xe'),_0xb7df('0xf')),'defaultValue':null,'get':function(){if(!this['getDataValue']('provider'))return _0xb7df('0x10');return this[_0xb7df('0x11')](_0xb7df('0x12'));},'set':function(_0x839a91){if(_0x839a91===_0xb7df('0x10'))_0x839a91=null;return this[_0xb7df('0x9')](_0xb7df('0x12'),_0x839a91);}}};
\ No newline at end of file
index a096369..9f38286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa269=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','rows','catch','show','params','Pause','find','body','provider','secure','describe','addDisposition','create','findOne','Disposition','MailAccountId','includeAll','include','findAll','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','custom','isNil','active','description','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','removeSmtp','addInteraction','MailInteraction','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','MailApplication','bulkCreate','stack','finally','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','CmList','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','format','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','List','defaults','ListId','from','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','User','getAgents','moment','bluebird','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','localhost','./mailAccount.socket','register','jayson/promise','client','request','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','MailAccounts','then','send','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp-mail.outlook.com','user','username','password','modernAuthentication','CloudProviderId','port','host','service','authentication','pass','Imap','Smtp','index','MailServerIn','MailServerOut','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes'];(function(_0x41609c,_0x599d97){var _0x445945=function(_0x159f51){while(--_0x159f51){_0x41609c['push'](_0x41609c['shift']());}};_0x445945(++_0x599d97);}(_0xa269,0x73));var _0x9a26=function(_0x11d975,_0x3f0dc1){_0x11d975=_0x11d975-0x0;var _0x2d63bb=_0xa269[_0x11d975];return _0x2d63bb;};'use strict';var moment=require(_0x9a26('0x0'));var BPromise=require(_0x9a26('0x1'));var util=require(_0x9a26('0x2'));var path=require(_0x9a26('0x3'));var _=require(_0x9a26('0x4'));var juice=require(_0x9a26('0x5'));var Redis=require(_0x9a26('0x6'));var qs=require(_0x9a26('0x7'));var logger=require(_0x9a26('0x8'))('api');var config=require('../../config/environment');var db=require(_0x9a26('0x9'))['db'];config[_0x9a26('0xa')]=_['defaults'](config['redis'],{'host':_0x9a26('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9a26('0xa')]));require(_0x9a26('0xc'))[_0x9a26('0xd')](socket);var jayson=require(_0x9a26('0xe'));var client=jayson[_0x9a26('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x3019d2,_0x497734,_0x164ab9,_0x5d05b3){return new BPromise(function(_0x33782d,_0xe17a84){var _0x407773=_0x5d05b3||client;return _0x407773[_0x9a26('0x10')](_0x3019d2,_0x164ab9)['then'](function(_0x9cd59f){logger['info'](_0x9a26('0x11'),_0x497734,_0x9a26('0x12'));logger['debug'](_0x9a26('0x13'),_0x497734,'request\x20sent',JSON[_0x9a26('0x14')](_0x9cd59f));if(_0x9cd59f[_0x9a26('0x15')]){if(_0x9cd59f[_0x9a26('0x15')][_0x9a26('0x16')]===0x1f4){logger[_0x9a26('0x15')](_0x9a26('0x11'),_0x497734,_0x9cd59f[_0x9a26('0x15')]['message']);return _0xe17a84(_0x9cd59f[_0x9a26('0x15')]['message']);}logger[_0x9a26('0x15')](_0x9a26('0x11'),_0x497734,_0x9cd59f[_0x9a26('0x15')]['message']);return _0x33782d(_0x9cd59f['error'][_0x9a26('0x17')]);}else{logger['info'](_0x9a26('0x11'),_0x497734,_0x9a26('0x12'));_0x33782d(_0x9cd59f[_0x9a26('0x18')][_0x9a26('0x17')]);}})['catch'](function(_0x63f973){logger[_0x9a26('0x15')](_0x9a26('0x11'),_0x497734,_0x63f973);_0xe17a84(_0x63f973);});});}function respondWithStatusCode(_0x204fa3,_0x17194e){_0x17194e=_0x17194e||0xcc;return function(_0x4dcb15){if(_0x4dcb15){return _0x204fa3['sendStatus'](_0x17194e);}return _0x204fa3[_0x9a26('0x19')](_0x17194e)[_0x9a26('0x1a')]();};}function respondWithResult(_0x224060,_0x5fc130){_0x5fc130=_0x5fc130||0xc8;return function(_0x48a755){if(_0x48a755){return _0x224060[_0x9a26('0x19')](_0x5fc130)[_0x9a26('0x1b')](_0x48a755);}};}function respondWithFilteredResult(_0x18aa24,_0x285d0e){return function(_0x6b771d){if(_0x6b771d){var _0x54ed31=typeof _0x285d0e[_0x9a26('0x1c')]==='undefined'&&typeof _0x285d0e[_0x9a26('0x1d')]===_0x9a26('0x1e');var _0x407880=_0x6b771d[_0x9a26('0x1f')];var _0xf047f3=_0x54ed31?0x0:_0x285d0e[_0x9a26('0x1c')];var _0x3cd6df=_0x54ed31?_0x6b771d[_0x9a26('0x1f')]:_0x285d0e['offset']+_0x285d0e[_0x9a26('0x1d')];var _0x23cf5f;if(_0x3cd6df>=_0x407880){_0x3cd6df=_0x407880;_0x23cf5f=0xc8;}else{_0x23cf5f=0xce;}_0x18aa24['status'](_0x23cf5f);return _0x18aa24[_0x9a26('0x20')](_0x9a26('0x21'),_0xf047f3+'-'+_0x3cd6df+'/'+_0x407880)[_0x9a26('0x1b')](_0x6b771d);}return null;};}function saveUpdates(_0x59115a){return function(_0x50fad3){if(_0x50fad3){return _0x50fad3[_0x9a26('0x22')](_0x59115a)['then'](function(_0x5e3af0){return _0x5e3af0;});}return null;};}function removeEntity(_0x42e89f){return function(_0xb846a1){if(_0xb846a1){return _0xb846a1[_0x9a26('0x23')]()['then'](function(){var _0x4135fa=_0xb846a1[_0x9a26('0x24')]({'plain':!![]});var _0x499c14=_0x9a26('0x25');return db['UserProfileResource'][_0x9a26('0x23')]({'where':{'type':_0x499c14,'resourceId':_0x4135fa['id']}})[_0x9a26('0x26')](function(){return _0xb846a1;});})['then'](function(){_0x42e89f[_0x9a26('0x19')](0xcc)[_0x9a26('0x1a')]();});}};}function handleEntityNotFound(_0x1bbdd5){return function(_0x2e4dcf){if(!_0x2e4dcf){_0x1bbdd5['sendStatus'](0x194);}return _0x2e4dcf;};}function handleError(_0x23dec3,_0x5ac9b7){_0x5ac9b7=_0x5ac9b7||0x1f4;return function(_0x286fed){logger[_0x9a26('0x15')](_0x286fed['stack']);if(_0x286fed['name']){delete _0x286fed['name'];}_0x23dec3[_0x9a26('0x19')](_0x5ac9b7)[_0x9a26('0x27')](_0x286fed);};}function getImapHost(_0x2703a4){switch(_0x2703a4){case _0x9a26('0x28'):return _0x9a26('0x29');case _0x9a26('0x2a'):return'imap.mail.yahoo.com';case _0x9a26('0x2b'):return _0x9a26('0x2c');case _0x9a26('0x2d'):return _0x9a26('0x2e');}throw new Error(_0x9a26('0x2f'),_0x2703a4);}function getSmtpHost(_0x173878){switch(_0x173878){case _0x9a26('0x28'):return _0x9a26('0x30');case'yahoo':return'smtp.mail.yahoo.com';case _0x9a26('0x2b'):return _0x9a26('0x31');case _0x9a26('0x2d'):return'smtp.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x173878);}function getAuthenticationOptions(_0x1bfffd,_0x390659){var _0x81748e={};var _0x5c57be={};if(_0x1bfffd){_0x81748e[_0x9a26('0x32')]=_0x5c57be[_0x9a26('0x32')]=_0x390659[_0x9a26('0x33')];_0x81748e[_0x9a26('0x34')]=_0x5c57be['pass']=_0x390659[_0x9a26('0x34')];if(_0x390659['modernAuthentication']){_0x81748e[_0x9a26('0x35')]=_0x5c57be[_0x9a26('0x35')]=!![];_0x81748e[_0x9a26('0x36')]=_0x5c57be[_0x9a26('0x36')]=_0x390659[_0x9a26('0x36')];_0x81748e[_0x9a26('0x34')]=_0x5c57be['pass']=null;}else{_0x81748e[_0x9a26('0x36')]=_0x5c57be[_0x9a26('0x36')]=null;}_0x81748e['host']=getImapHost(_0x1bfffd);_0x81748e[_0x9a26('0x37')]=0x3e1;_0x5c57be[_0x9a26('0x38')]=getSmtpHost(_0x1bfffd);_0x5c57be[_0x9a26('0x37')]=0x24b;_0x5c57be['secure']=![];_0x81748e[_0x9a26('0x39')]=_0x5c57be[_0x9a26('0x39')]=null;}else{if(_0x390659[_0x9a26('0x3a')]){_0x81748e[_0x9a26('0x32')]=_0x5c57be[_0x9a26('0x32')]=_0x390659['username'];_0x81748e[_0x9a26('0x34')]=_0x5c57be['pass']=_0x390659['password'];}else{_0x81748e[_0x9a26('0x3a')]=_0x5c57be[_0x9a26('0x3a')]=![];_0x81748e[_0x9a26('0x32')]=_0x5c57be['user']=null;_0x81748e[_0x9a26('0x34')]=_0x5c57be[_0x9a26('0x3b')]=null;}_0x81748e[_0x9a26('0x38')]=_0x390659[_0x9a26('0x3c')][_0x9a26('0x38')];_0x81748e[_0x9a26('0x37')]=_0x390659['Imap'][_0x9a26('0x37')];_0x5c57be['host']=_0x390659[_0x9a26('0x3d')][_0x9a26('0x38')];_0x5c57be[_0x9a26('0x37')]=_0x390659[_0x9a26('0x3d')]['port'];}return{'Imap':_0x81748e,'Smtp':_0x5c57be};}exports[_0x9a26('0x3e')]=function(_0x36af55,_0x37098e){var _0x57ab07={'include':[{'model':db[_0x9a26('0x3f')],'as':_0x9a26('0x3c')},{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d')},{'model':db['Pause'],'as':_0x9a26('0x41')}]},_0x15e688={},_0x7c3be2={'count':0x0,'rows':[]};var _0x5c4ff6=_[_0x9a26('0x42')](db[_0x9a26('0x43')][_0x9a26('0x44')],function(_0x1dc5d5){return{'name':_0x1dc5d5[_0x9a26('0x45')],'type':_0x1dc5d5['type'][_0x9a26('0x46')]};});_0x15e688[_0x9a26('0x47')]=_[_0x9a26('0x42')](_0x5c4ff6,_0x9a26('0x48'));_0x15e688[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0x36af55[_0x9a26('0x49')]);_0x15e688['filters']=_[_0x9a26('0x4b')](_0x15e688[_0x9a26('0x47')],_0x15e688['query']);_0x57ab07[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0x15e688[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x57ab07[_0x9a26('0x4c')]=_0x57ab07['attributes'][_0x9a26('0x4e')]?_0x57ab07[_0x9a26('0x4c')]:_0x15e688['model'];if(!_0x36af55[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x57ab07[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x57ab07[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x57ab07[_0x9a26('0x51')]=qs[_0x9a26('0x52')](_0x36af55[_0x9a26('0x49')][_0x9a26('0x52')]);_0x57ab07[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0x36af55['query'],_0x15e688[_0x9a26('0x54')]),_0x5c4ff6);if(_0x36af55[_0x9a26('0x49')][_0x9a26('0x56')]){_0x57ab07[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x57ab07[_0x9a26('0x53')],{'$or':_[_0x9a26('0x42')](_0x5c4ff6,function(_0x2a8549){if(_0x2a8549[_0x9a26('0x58')]!==_0x9a26('0x59')){var _0x5ad033={};_0x5ad033[_0x2a8549[_0x9a26('0x48')]]={'$like':'%'+_0x36af55[_0x9a26('0x49')]['filter']+'%'};return _0x5ad033;}})});}_0x57ab07=_['merge']({},_0x57ab07,_0x36af55[_0x9a26('0x5a')]);var _0x5259e2={'where':_0x57ab07['where']};return db[_0x9a26('0x43')][_0x9a26('0x1f')](_0x5259e2)[_0x9a26('0x26')](function(_0x3e5317){_0x7c3be2[_0x9a26('0x1f')]=_0x3e5317;if(_0x36af55[_0x9a26('0x49')]['includeAll']){_0x57ab07['include']=[{'all':!![]}];}return db[_0x9a26('0x43')]['findAll'](_0x57ab07);})[_0x9a26('0x26')](function(_0x20d6ba){_0x7c3be2[_0x9a26('0x5b')]=_0x20d6ba;return _0x7c3be2;})[_0x9a26('0x26')](respondWithFilteredResult(_0x37098e,_0x57ab07))[_0x9a26('0x5c')](handleError(_0x37098e,null));};exports[_0x9a26('0x5d')]=function(_0x2ad4ba,_0x5299d0){var _0xb3897b={'raw':![],'where':{'id':_0x2ad4ba[_0x9a26('0x5e')]['id']},'include':[{'model':db[_0x9a26('0x3f')],'as':_0x9a26('0x3c')},{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d')},{'model':db[_0x9a26('0x5f')],'as':_0x9a26('0x41')}]},_0x281192={};_0x281192['model']=_['keys'](db['MailAccount'][_0x9a26('0x44')]);_0x281192['query']=_[_0x9a26('0x4a')](_0x2ad4ba[_0x9a26('0x49')]);_0x281192[_0x9a26('0x54')]=_['intersection'](_0x281192[_0x9a26('0x47')],_0x281192[_0x9a26('0x49')]);_0xb3897b[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0x281192[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x2ad4ba['query'][_0x9a26('0x4d')]));_0xb3897b[_0x9a26('0x4c')]=_0xb3897b[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0xb3897b['attributes']:_0x281192['model'];if(_0x2ad4ba[_0x9a26('0x49')]['includeAll']){_0xb3897b['include']=[{'all':!![]}];}_0xb3897b=_[_0x9a26('0x57')]({},_0xb3897b,_0x2ad4ba[_0x9a26('0x5a')]);return db['MailAccount'][_0x9a26('0x60')](_0xb3897b)[_0x9a26('0x26')](handleEntityNotFound(_0x5299d0,null))[_0x9a26('0x26')](respondWithResult(_0x5299d0,null))['catch'](handleError(_0x5299d0,null));};exports[_0x9a26('0x22')]=function(_0x2a8d67,_0x5a0868){if(_0x2a8d67[_0x9a26('0x61')]['id']){delete _0x2a8d67[_0x9a26('0x61')]['id'];}var _0x2b2dfc=_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x62')]==='custom'?null:_0x2a8d67[_0x9a26('0x61')]['provider'];var _0x3f42d0=_0x2a8d67['body']['Imap']||{};var _0x3ae7e0=_0x2a8d67[_0x9a26('0x61')]['Smtp']||{};if(_0x2b2dfc){_0x3f42d0['host']=getImapHost(_0x2b2dfc);_0x3f42d0['port']=0x3e1;_0x3ae7e0[_0x9a26('0x38')]=getSmtpHost(_0x2b2dfc);_0x3ae7e0[_0x9a26('0x37')]=0x24b;_0x3ae7e0['secure']=![];}if(_0x3ae7e0['modernAuthentication']){_0x3ae7e0[_0x9a26('0x63')]=![];}else{_0x3ae7e0[_0x9a26('0x36')]=null;}if(!_0x3f42d0[_0x9a26('0x35')])_0x3f42d0[_0x9a26('0x36')]=null;_0x2a8d67[_0x9a26('0x61')]['Imap']=_0x3f42d0;_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x3d')]=_0x3ae7e0;return db[_0x9a26('0x43')]['find']({'where':{'id':_0x2a8d67[_0x9a26('0x5e')]['id']},'include':[{'model':db[_0x9a26('0x3f')],'as':'Imap'},{'model':db[_0x9a26('0x40')],'as':'Smtp'},{'model':db[_0x9a26('0x5f')],'as':_0x9a26('0x41')}]})[_0x9a26('0x26')](handleEntityNotFound(_0x5a0868,null))[_0x9a26('0x26')](function(_0x5ae534){if(!_0x5ae534)throw new Error('Mail\x20Account\x20not\x20found');if(_0x5ae534['service'])delete _0x2a8d67['body'][_0x9a26('0x3c')];return _0x5ae534;})['then'](saveUpdates(_0x2a8d67[_0x9a26('0x61')],null))[_0x9a26('0x26')](function(_0x1361cf){if(!_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x3c')])return _0x1361cf;return db['MailServerIn'][_0x9a26('0x22')](_0x2a8d67[_0x9a26('0x61')]['Imap'],{'where':{'MailAccountId':_0x1361cf['id']}})[_0x9a26('0x26')](function(){return _0x1361cf;});})[_0x9a26('0x26')](function(_0x3b7e99){if(!_0x2a8d67[_0x9a26('0x61')][_0x9a26('0x3d')])return _0x3b7e99;return db[_0x9a26('0x40')][_0x9a26('0x22')](_0x2a8d67['body'][_0x9a26('0x3d')],{'where':{'MailAccountId':_0x3b7e99['id']}})[_0x9a26('0x26')](function(){return _0x3b7e99;});})['then'](respondWithResult(_0x5a0868,null))['catch'](handleError(_0x5a0868,null));};exports[_0x9a26('0x64')]=function(_0x5eb2ff,_0x538145){return db['MailAccount'][_0x9a26('0x64')]()['then'](respondWithResult(_0x538145,null))['catch'](handleError(_0x538145,null));};exports[_0x9a26('0x65')]=function(_0x465614,_0x670c92){if(_0x465614[_0x9a26('0x61')]['id']){delete _0x465614['body']['id'];}return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x465614['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x670c92,null))[_0x9a26('0x26')](function(_0x2dde90){if(_0x2dde90){_0x465614[_0x9a26('0x61')]['MailAccountId']=_0x2dde90['id'];return db['Disposition'][_0x9a26('0x66')](_0x465614[_0x9a26('0x61')]);}})[_0x9a26('0x26')](respondWithResult(_0x670c92,null))['catch'](handleError(_0x670c92,null));};exports['getDispositions']=function(_0x228a8a,_0x126110){var _0x3f4e1c={'raw':![],'where':{}};var _0x196fa2={};var _0x39c251={'count':0x0,'rows':[]};return db['MailAccount'][_0x9a26('0x67')]({'where':{'id':_0x228a8a[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x126110,null))[_0x9a26('0x26')](function(_0x2234a1){if(_0x2234a1){_0x196fa2['model']=_[_0x9a26('0x4a')](db[_0x9a26('0x68')][_0x9a26('0x44')]);_0x196fa2[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0x228a8a[_0x9a26('0x49')]);_0x196fa2['filters']=_[_0x9a26('0x4b')](_0x196fa2[_0x9a26('0x47')],_0x196fa2[_0x9a26('0x49')]);_0x3f4e1c[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0x196fa2[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x228a8a[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x3f4e1c[_0x9a26('0x4c')]=_0x3f4e1c[_0x9a26('0x4c')]['length']?_0x3f4e1c['attributes']:_0x196fa2[_0x9a26('0x47')];if(!_0x228a8a[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x3f4e1c[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x228a8a['query']['limit']);_0x3f4e1c[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x228a8a[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x3f4e1c[_0x9a26('0x51')]=qs[_0x9a26('0x52')](_0x228a8a[_0x9a26('0x49')][_0x9a26('0x52')]);_0x3f4e1c[_0x9a26('0x53')]=qs['filters'](_[_0x9a26('0x55')](_0x228a8a[_0x9a26('0x49')],_0x196fa2[_0x9a26('0x54')]));_0x3f4e1c[_0x9a26('0x53')][_0x9a26('0x69')]=_0x2234a1['id'];if(_0x228a8a[_0x9a26('0x49')][_0x9a26('0x56')]){_0x3f4e1c[_0x9a26('0x53')]=_['merge'](_0x3f4e1c[_0x9a26('0x53')],{'$or':_['map'](_0x3f4e1c[_0x9a26('0x4c')],function(_0x13654a){var _0x25685b={};_0x25685b[_0x13654a]={'$like':'%'+_0x228a8a[_0x9a26('0x49')]['filter']+'%'};return _0x25685b;})});}_0x3f4e1c=_[_0x9a26('0x57')]({},_0x3f4e1c,_0x228a8a[_0x9a26('0x5a')]);return db[_0x9a26('0x68')][_0x9a26('0x1f')]({'where':_0x3f4e1c[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x2af862){_0x39c251[_0x9a26('0x1f')]=_0x2af862;if(_0x228a8a[_0x9a26('0x49')][_0x9a26('0x6a')]){_0x3f4e1c[_0x9a26('0x6b')]=[{'all':!![]}];}return db[_0x9a26('0x68')][_0x9a26('0x6c')](_0x3f4e1c);})['then'](function(_0x854809){_0x39c251[_0x9a26('0x5b')]=_0x854809;return _0x39c251;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x126110,_0x3f4e1c))[_0x9a26('0x5c')](handleError(_0x126110,null));};exports['removeDispositions']=function(_0x50a95a,_0x18f6b4){return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x50a95a['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x18f6b4,null))[_0x9a26('0x26')](function(_0x32f0d1){if(_0x32f0d1){return _0x32f0d1[_0x9a26('0x6d')](_0x50a95a['query'][_0x9a26('0x6e')]);}})[_0x9a26('0x26')](respondWithStatusCode(_0x18f6b4,null))['catch'](handleError(_0x18f6b4,null));};exports[_0x9a26('0x6f')]=function(_0x2278a2,_0x264b97){if(_0x2278a2[_0x9a26('0x61')]['id']){delete _0x2278a2['body']['id'];}return db[_0x9a26('0x43')]['find']({'where':{'id':_0x2278a2[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x264b97,null))['then'](function(_0x4a4467){if(_0x4a4467){_0x2278a2[_0x9a26('0x61')]['MailAccountId']=_0x4a4467['id'];return db[_0x9a26('0x70')][_0x9a26('0x66')](_0x2278a2['body']);}})[_0x9a26('0x26')](respondWithResult(_0x264b97,null))[_0x9a26('0x5c')](handleError(_0x264b97,null));};exports['getAnswers']=function(_0xc49144,_0x56b9a0){var _0x2b7651={'raw':![],'where':{}};var _0x1367e9={};var _0x362891={'count':0x0,'rows':[]};return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0xc49144[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x56b9a0,null))[_0x9a26('0x26')](function(_0xb336ad){if(_0xb336ad){_0x1367e9[_0x9a26('0x47')]=_['keys'](db[_0x9a26('0x70')][_0x9a26('0x44')]);_0x1367e9[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0xc49144[_0x9a26('0x49')]);_0x1367e9[_0x9a26('0x54')]=_[_0x9a26('0x4b')](_0x1367e9[_0x9a26('0x47')],_0x1367e9[_0x9a26('0x49')]);_0x2b7651['attributes']=_[_0x9a26('0x4b')](_0x1367e9['model'],qs['fields'](_0xc49144[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x2b7651['attributes']=_0x2b7651[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0x2b7651[_0x9a26('0x4c')]:_0x1367e9['model'];if(!_0xc49144[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x2b7651[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0xc49144[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x2b7651['offset']=qs[_0x9a26('0x1c')](_0xc49144[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x2b7651[_0x9a26('0x51')]=qs['sort'](_0xc49144['query'][_0x9a26('0x52')]);_0x2b7651[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0xc49144['query'],_0x1367e9[_0x9a26('0x54')]));_0x2b7651[_0x9a26('0x53')][_0x9a26('0x69')]=_0xb336ad['id'];if(_0xc49144[_0x9a26('0x49')][_0x9a26('0x56')]){_0x2b7651[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x2b7651['where'],{'$or':_[_0x9a26('0x42')](_0x2b7651[_0x9a26('0x4c')],function(_0x33283c){var _0x1c61e4={};_0x1c61e4[_0x33283c]={'$like':'%'+_0xc49144[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0x1c61e4;})});}_0x2b7651=_[_0x9a26('0x57')]({},_0x2b7651,_0xc49144[_0x9a26('0x5a')]);return db['CannedAnswer'][_0x9a26('0x1f')]({'where':_0x2b7651[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x16c3eb){_0x362891[_0x9a26('0x1f')]=_0x16c3eb;if(_0xc49144['query'][_0x9a26('0x6a')]){_0x2b7651[_0x9a26('0x6b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9a26('0x6c')](_0x2b7651);})[_0x9a26('0x26')](function(_0x3e5de0){_0x362891['rows']=_0x3e5de0;return _0x362891;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x56b9a0,_0x2b7651))[_0x9a26('0x5c')](handleError(_0x56b9a0,null));};exports[_0x9a26('0x71')]=function(_0x3946d6,_0x433019){return db['MailAccount']['find']({'where':{'id':_0x3946d6[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x433019,null))['then'](function(_0x1f705a){if(_0x1f705a){return _0x1f705a[_0x9a26('0x71')](_0x3946d6[_0x9a26('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x433019,null))[_0x9a26('0x5c')](handleError(_0x433019,null));};exports[_0x9a26('0x66')]=function(_0x56441b,_0x407d53){var _0x3c5d12={'name':_0x56441b[_0x9a26('0x61')][_0x9a26('0x48')],'key':_0x56441b[_0x9a26('0x61')][_0x9a26('0x46')],'provider':_0x56441b[_0x9a26('0x61')][_0x9a26('0x62')]===_0x9a26('0x72')?null:_0x56441b[_0x9a26('0x61')][_0x9a26('0x62')],'email':_0x56441b['body']['email'],'ListId':_0x56441b['body']['ListId'],'active':!_[_0x9a26('0x73')](_0x56441b['body']['active'])?_0x56441b[_0x9a26('0x61')][_0x9a26('0x74')]:!![],'description':_0x56441b['body'][_0x9a26('0x75')]||null};var _0x4a6164=getAuthenticationOptions(_0x3c5d12[_0x9a26('0x62')],_0x56441b[_0x9a26('0x61')]);_0x3c5d12[_0x9a26('0x3c')]=_0x4a6164[_0x9a26('0x3c')];_0x3c5d12['Smtp']=_0x4a6164[_0x9a26('0x3d')];return db[_0x9a26('0x43')][_0x9a26('0x66')](_0x3c5d12,{'include':[{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d')},{'model':db[_0x9a26('0x3f')],'as':_0x9a26('0x3c')}]})['then'](function(_0xae9964){var _0x3d64df=_0x56441b[_0x9a26('0x32')]['get']({'plain':!![]});if(!_0x3d64df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3d64df['role']===_0x9a26('0x32')){var _0x3298cc=_0xae9964[_0x9a26('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x9a26('0x60')]({'where':{'name':_0x9a26('0x25'),'userProfileId':_0x3d64df['userProfileId']},'raw':!![]})['then'](function(_0x515cfa){if(_0x515cfa&&_0x515cfa[_0x9a26('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x3298cc[_0x9a26('0x48')],'resourceId':_0x3298cc['id'],'type':_0x515cfa['name'],'sectionId':_0x515cfa['id']},{})[_0x9a26('0x26')](function(){return _0xae9964;});}else{return _0xae9964;}})[_0x9a26('0x5c')](function(_0x3a9788){logger[_0x9a26('0x15')](_0x9a26('0x77'),_0x3a9788);throw _0x3a9788;});}return _0xae9964;})[_0x9a26('0x26')](respondWithResult(_0x407d53,0xc9))['catch'](handleError(_0x407d53,null));};exports[_0x9a26('0x78')]=function(_0x1ae0cd,_0x1eb8a1){return db['MailAccount'][_0x9a26('0x67')]({'where':{'id':_0x1ae0cd[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x1eb8a1,null))[_0x9a26('0x26')](function(_0x560e8f){if(_0x560e8f){return _0x560e8f[_0x9a26('0x78')]();}return null;})['then'](respondWithResult(_0x1eb8a1,null))[_0x9a26('0x5c')](handleError(_0x1eb8a1,null));};exports[_0x9a26('0x79')]=function(_0x52de18,_0x902f17){if(_0x52de18['body']['id']){delete _0x52de18[_0x9a26('0x61')]['id'];}return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x52de18[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x902f17,null))[_0x9a26('0x26')](function(_0x190337){if(_0x190337){_0x52de18[_0x9a26('0x61')]['MailAccountId']=_0x190337['id'];return db[_0x9a26('0x3f')][_0x9a26('0x66')](_0x52de18['body']);}})['then'](respondWithResult(_0x902f17,null))[_0x9a26('0x5c')](handleError(_0x902f17,null));};exports[_0x9a26('0x7a')]=function(_0x18de52,_0x178e52){return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x18de52[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x178e52,null))['then'](function(_0x841857){if(_0x841857){return _0x841857[_0x9a26('0x7b')](null);}return null;})[_0x9a26('0x26')](respondWithStatusCode(_0x178e52,null))['catch'](handleError(_0x178e52,null));};exports[_0x9a26('0x7c')]=function(_0x2f6ace,_0x37cc8e){return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x2f6ace['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x37cc8e,null))[_0x9a26('0x26')](function(_0x14858e){if(_0x14858e){return _0x14858e[_0x9a26('0x7c')]();}return null;})[_0x9a26('0x26')](respondWithResult(_0x37cc8e,null))[_0x9a26('0x5c')](handleError(_0x37cc8e,null));};exports['addSmtp']=function(_0x56ce56,_0x23c85e){if(_0x56ce56[_0x9a26('0x61')]['id']){delete _0x56ce56[_0x9a26('0x61')]['id'];}return db['MailAccount'][_0x9a26('0x60')]({'where':{'id':_0x56ce56['params']['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x23c85e,null))[_0x9a26('0x26')](function(_0x3aa789){if(_0x3aa789){_0x56ce56[_0x9a26('0x61')][_0x9a26('0x69')]=_0x3aa789['id'];return db['MailServerOut']['create'](_0x56ce56[_0x9a26('0x61')]);}})['then'](respondWithResult(_0x23c85e,null))[_0x9a26('0x5c')](handleError(_0x23c85e,null));};exports[_0x9a26('0x7d')]=function(_0x19ad7d,_0x94540){return db['MailAccount'][_0x9a26('0x67')]({'where':{'id':_0x19ad7d[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x94540,null))[_0x9a26('0x26')](function(_0x367733){if(_0x367733){return _0x367733['setSmtp'](null);}return null;})[_0x9a26('0x26')](respondWithStatusCode(_0x94540,null))[_0x9a26('0x5c')](handleError(_0x94540,null));};exports[_0x9a26('0x7e')]=function(_0x4b748b,_0x566631){return db[_0x9a26('0x7f')][_0x9a26('0x60')]({'where':{'id':_0x4b748b[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x566631,null))[_0x9a26('0x26')](function(_0x1866a7){if(_0x1866a7){return _0x1866a7['addInteraction'](_0x4b748b['body']['ids'],_['omit'](_0x4b748b[_0x9a26('0x61')],[_0x9a26('0x6e'),'id'])||{});}})[_0x9a26('0x26')](respondWithResult(_0x566631,null))['catch'](handleError(_0x566631,null));};exports[_0x9a26('0x80')]=function(_0x63e08d,_0x40f72b){var _0x4fd1fb={'raw':![],'where':{}};var _0x2ee842={};var _0x231db6={'count':0x0,'rows':[]};return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x63e08d[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x40f72b,null))[_0x9a26('0x26')](function(_0x364b3f){if(_0x364b3f){_0x2ee842[_0x9a26('0x47')]=_['keys'](db[_0x9a26('0x7f')][_0x9a26('0x44')]);_0x2ee842[_0x9a26('0x49')]=_['keys'](_0x63e08d[_0x9a26('0x49')]);_0x2ee842[_0x9a26('0x54')]=_[_0x9a26('0x4b')](_0x2ee842['model'],_0x2ee842[_0x9a26('0x49')]);_0x4fd1fb[_0x9a26('0x4c')]=_['intersection'](_0x2ee842['model'],qs[_0x9a26('0x4d')](_0x63e08d[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x4fd1fb[_0x9a26('0x4c')]=_0x4fd1fb[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0x4fd1fb[_0x9a26('0x4c')]:_0x2ee842[_0x9a26('0x47')];if(!_0x63e08d[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x4fd1fb['limit']=qs[_0x9a26('0x1d')](_0x63e08d[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x4fd1fb[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x63e08d[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x4fd1fb['order']=qs[_0x9a26('0x52')](_0x63e08d['query'][_0x9a26('0x52')]);_0x4fd1fb[_0x9a26('0x53')]=qs['filters'](_['pick'](_0x63e08d[_0x9a26('0x49')],_0x2ee842['filters']));_0x4fd1fb[_0x9a26('0x53')][_0x9a26('0x69')]=_0x364b3f['id'];if(_0x63e08d[_0x9a26('0x49')]['filter']){_0x4fd1fb['where']=_[_0x9a26('0x57')](_0x4fd1fb['where'],{'$or':_[_0x9a26('0x42')](_0x4fd1fb['attributes'],function(_0x2b3599){var _0x4c62ad={};_0x4c62ad[_0x2b3599]={'$like':'%'+_0x63e08d['query'][_0x9a26('0x56')]+'%'};return _0x4c62ad;})});}_0x4fd1fb=_[_0x9a26('0x57')]({},_0x4fd1fb,_0x63e08d[_0x9a26('0x5a')]);return db[_0x9a26('0x7f')][_0x9a26('0x1f')]({'where':_0x4fd1fb[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x579032){_0x231db6[_0x9a26('0x1f')]=_0x579032;if(_0x63e08d[_0x9a26('0x49')][_0x9a26('0x6a')]){_0x4fd1fb['include']=[{'model':db[_0x9a26('0x81')],'as':_0x9a26('0x82'),'required':![]},{'model':db['User'],'as':_0x9a26('0x83'),'attributes':['name',_0x9a26('0x84'),_0x9a26('0x85')],'required':![]},{'model':db[_0x9a26('0x86')],'as':_0x9a26('0x87'),'attributes':['id',_0x9a26('0x48'),_0x9a26('0x88')],'where':_0x63e08d['query']['tag']?{'id':_0x63e08d['query'][_0x9a26('0x89')]}:undefined,'required':_0x63e08d[_0x9a26('0x49')][_0x9a26('0x89')]?!![]:![]}];}return db[_0x9a26('0x7f')]['findAll'](_0x4fd1fb);})[_0x9a26('0x26')](function(_0x59d694){_0x231db6[_0x9a26('0x5b')]=_0x59d694;return _0x231db6;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x40f72b,_0x4fd1fb))[_0x9a26('0x5c')](handleError(_0x40f72b,null));};exports[_0x9a26('0x8a')]=function addApplications(_0x496d40,_0x1b81e6){var _0x2dd5b8=_0x496d40[_0x9a26('0x5e')]['id'];var _0x54e1dd=_0x496d40[_0x9a26('0x61')];var _0x3cf1f3=0xc8;var _0x4f8142=null;return db[_0x9a26('0x8b')][_0x9a26('0x8c')]({'isolationLevel':db[_0x9a26('0x8b')][_0x9a26('0x8d')][_0x9a26('0x8e')]['READ_COMMITTED']},function(_0x308cd5){return db['MailAccount']['findOne']({'where':{'id':_0x2dd5b8},'transaction':_0x308cd5})[_0x9a26('0x26')](function(_0x4895cd){if(_0x4895cd){return db['MailApplication'][_0x9a26('0x23')]({'where':{'MailAccountId':_0x2dd5b8},'transaction':_0x308cd5})[_0x9a26('0x26')](function(){var _0x463adb=_[_0x9a26('0x42')](_0x54e1dd,function(_0x26e157){_0x26e157['MailAccountId']=_0x2dd5b8;return _0x26e157;});return db[_0x9a26('0x8f')][_0x9a26('0x90')](_0x463adb,{'transaction':_0x308cd5});});}else{_0x3cf1f3=0x194;_0x4f8142=[];}});})[_0x9a26('0x26')](function(){if(_0x3cf1f3!==0x194){return db[_0x9a26('0x8f')]['findAndCountAll']({'where':{'MailAccountId':_0x2dd5b8},'order':'priority'})[_0x9a26('0x26')](function(_0x5d5bbe){_0x4f8142=_0x5d5bbe;});}})[_0x9a26('0x5c')](function(_0x4e1965){_0x3cf1f3=0x1f4;logger[_0x9a26('0x15')](_0x4e1965[_0x9a26('0x91')]);if(_0x4e1965[_0x9a26('0x48')]){delete _0x4e1965[_0x9a26('0x48')];}_0x4f8142=_0x4e1965;})[_0x9a26('0x92')](function(){if(_0x4f8142===null){_0x1b81e6['sendStatus'](_0x3cf1f3);}else{if(_0x3cf1f3===0x1f4){_0x1b81e6[_0x9a26('0x19')](_0x3cf1f3)[_0x9a26('0x27')](_0x4f8142);}else{_0x1b81e6['status'](_0x3cf1f3)[_0x9a26('0x1b')](_0x4f8142);}}});};exports[_0x9a26('0x93')]=function(_0x2fef99,_0x4717df){var _0x32bd80={};var _0x20ccad={};var _0x282869;var _0x58594b;return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x2fef99[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x4717df,null))[_0x9a26('0x26')](function(_0x5a7d42){if(_0x5a7d42){_0x282869=_0x5a7d42;_0x20ccad[_0x9a26('0x47')]=_['keys'](db[_0x9a26('0x8f')][_0x9a26('0x44')]);_0x20ccad[_0x9a26('0x49')]=_[_0x9a26('0x4a')](_0x2fef99['query']);_0x20ccad[_0x9a26('0x54')]=_['intersection'](_0x20ccad[_0x9a26('0x47')],_0x20ccad['query']);_0x32bd80[_0x9a26('0x4c')]=_['intersection'](_0x20ccad[_0x9a26('0x47')],qs[_0x9a26('0x4d')](_0x2fef99['query'][_0x9a26('0x4d')]));_0x32bd80[_0x9a26('0x4c')]=_0x32bd80[_0x9a26('0x4c')][_0x9a26('0x4e')]?_0x32bd80[_0x9a26('0x4c')]:_0x20ccad[_0x9a26('0x47')];_0x32bd80['order']=qs[_0x9a26('0x52')](_0x2fef99['query'][_0x9a26('0x52')]);_0x32bd80['where']=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0x2fef99[_0x9a26('0x49')],_0x20ccad[_0x9a26('0x54')]));if(_0x2fef99[_0x9a26('0x49')]['filter']){_0x32bd80[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x32bd80[_0x9a26('0x53')],{'$or':_[_0x9a26('0x42')](_0x32bd80[_0x9a26('0x4c')],function(_0x31b0c4){var _0x1bc9cf={};_0x1bc9cf[_0x31b0c4]={'$like':'%'+_0x2fef99[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0x1bc9cf;})});}_0x32bd80=_['merge']({},_0x32bd80,_0x2fef99[_0x9a26('0x5a')]);return _0x282869['getApplications'](_0x32bd80);}})['then'](function(_0x700774){if(_0x700774){_0x58594b=_0x700774[_0x9a26('0x4e')];if(!_0x2fef99[_0x9a26('0x49')][_0x9a26('0x4f')](_0x9a26('0x50'))){_0x32bd80[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x2fef99[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x32bd80[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x2fef99[_0x9a26('0x49')]['offset']);}return _0x282869[_0x9a26('0x93')](_0x32bd80);}})[_0x9a26('0x26')](function(_0x1b3b6e){if(_0x1b3b6e){return _0x1b3b6e?{'count':_0x58594b,'rows':_0x1b3b6e}:null;}})[_0x9a26('0x26')](respondWithResult(_0x4717df,null))[_0x9a26('0x5c')](handleError(_0x4717df,null));};exports[_0x9a26('0x94')]=function(_0x586a0e,_0x2738f4){var _0x110dc2={'raw':!![],'where':{}};var _0x3c46c3={};var _0x1b258d={'count':0x0,'rows':[]};return db[_0x9a26('0x43')][_0x9a26('0x67')]({'where':{'id':_0x586a0e[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x2738f4,null))[_0x9a26('0x26')](function(_0x2b687d){if(_0x2b687d){_0x3c46c3[_0x9a26('0x47')]=_[_0x9a26('0x4a')](db['MailMessage'][_0x9a26('0x44')]);_0x3c46c3[_0x9a26('0x49')]=_['keys'](_0x586a0e[_0x9a26('0x49')]);_0x3c46c3[_0x9a26('0x54')]=_[_0x9a26('0x4b')](_0x3c46c3[_0x9a26('0x47')],_0x3c46c3['query']);_0x110dc2[_0x9a26('0x4c')]=_['intersection'](_0x3c46c3['model'],qs[_0x9a26('0x4d')](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x4d')]));_0x110dc2[_0x9a26('0x4c')]=_0x110dc2['attributes'][_0x9a26('0x4e')]?_0x110dc2[_0x9a26('0x4c')]:_0x3c46c3['model'];if(!_0x586a0e[_0x9a26('0x49')]['hasOwnProperty'](_0x9a26('0x50'))){_0x110dc2[_0x9a26('0x1d')]=qs['limit'](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x1d')]);_0x110dc2[_0x9a26('0x1c')]=qs[_0x9a26('0x1c')](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x1c')]);}_0x110dc2['order']=qs['sort'](_0x586a0e[_0x9a26('0x49')][_0x9a26('0x52')]);_0x110dc2[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_[_0x9a26('0x55')](_0x586a0e['query'],_0x3c46c3[_0x9a26('0x54')]));_0x110dc2[_0x9a26('0x53')][_0x9a26('0x69')]=_0x2b687d['id'];if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x56')]){_0x110dc2[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x110dc2['where'],{'$or':_[_0x9a26('0x42')](_0x110dc2[_0x9a26('0x4c')],function(_0x3f2a19){var _0xf343d2={};_0xf343d2[_0x3f2a19]={'$like':'%'+_0x586a0e[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0xf343d2;})});}if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x95')]){var _0x2ead32=_0x586a0e[_0x9a26('0x49')][_0x9a26('0x95')][_0x9a26('0x96')](',');var _0x4514b7={};_0x4514b7[_0x2ead32[0x0]]={'$gte':moment(_0x2ead32[0x1])['format'](_0x9a26('0x97'))};_0x110dc2['where']=_[_0x9a26('0x57')](_0x110dc2['where'],_0x4514b7);}_0x110dc2=_[_0x9a26('0x57')]({},_0x110dc2,_0x586a0e['options']);return db[_0x9a26('0x98')][_0x9a26('0x1f')]({'where':_0x110dc2[_0x9a26('0x53')]})[_0x9a26('0x26')](function(_0x1a85ee){_0x1b258d[_0x9a26('0x1f')]=_0x1a85ee;if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x6a')]){_0x110dc2['include']=[{'all':!![]}];}return db['MailMessage'][_0x9a26('0x6c')](_0x110dc2);})[_0x9a26('0x26')](function(_0x1d213f){if(_0x586a0e[_0x9a26('0x49')][_0x9a26('0x99')]===_0x9a26('0x9a')){for(var _0x2f0e7c=0x0;_0x2f0e7c<_0x1d213f[_0x9a26('0x4e')];_0x2f0e7c++){_0x1d213f[_0x2f0e7c]['body']=juice(_0x1d213f[_0x2f0e7c][_0x9a26('0x61')]);}}_0x1b258d[_0x9a26('0x5b')]=_0x1d213f;return _0x1b258d;});}})[_0x9a26('0x26')](respondWithFilteredResult(_0x2738f4,_0x110dc2))[_0x9a26('0x5c')](handleError(_0x2738f4,null));};exports['send']=function(_0x13360a,_0x26dad3){var _0x422b67,_0x140903={},_0x3120c2;if(_0x13360a[_0x9a26('0x61')]['to']){_0x3120c2=_0x13360a['body']['to'][_0x9a26('0x96')](',')[0x0];}return db[_0x9a26('0x43')]['find']({'where':{'id':_0x13360a[_0x9a26('0x5e')]['id']},'include':[{'model':db[_0x9a26('0x9b')],'as':'List','include':[{'model':db['CmContact'],'as':_0x9a26('0x9c'),'where':{'email':_0x3120c2},'limit':0x1,'order':[[_0x9a26('0x9d'),_0x9a26('0x9e')]]}]},{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d'),'raw':!![],'include':[{'model':db[_0x9a26('0x9f')],'as':_0x9a26('0x9f'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x26dad3,null))['then'](function(_0xc4f041){if(!_0xc4f041)return;_0x422b67=_0xc4f041;if(!_0xc4f041[_0x9a26('0x3d')])throw new Error(_0x9a26('0xa0'));if(_[_0x9a26('0x73')](_0x13360a['body']['from'])){_0x13360a[_0x9a26('0x61')]['from']=util[_0x9a26('0xa1')](_0x9a26('0xa2'),_0xc4f041['name'],_0xc4f041['email']||_0xc4f041['Smtp'][_0x9a26('0x32')]);}if(_0x13360a['body'][_0x9a26('0xa3')]&&_0x13360a[_0x9a26('0x61')]['attachments']['length']){for(var _0x5c22c4=0x0;_0x5c22c4<_0x13360a['body'][_0x9a26('0xa3')][_0x9a26('0x4e')];_0x5c22c4+=0x1){_0x13360a['body'][_0x9a26('0xa3')][_0x5c22c4]={'filename':_0x13360a[_0x9a26('0x61')][_0x9a26('0xa3')][_0x5c22c4]['name'],'path':path[_0x9a26('0xa4')](config[_0x9a26('0xa5')],_0x9a26('0xa6'),_0x13360a[_0x9a26('0x61')][_0x9a26('0xa3')][_0x5c22c4][_0x9a26('0xa7')])};}}var _0x3b2b1b=_0xc4f041[_0x9a26('0xa8')]();return respondWithRpcPromise(_0x9a26('0xa9'),_0x9a26('0xaa'),{'account':_0x3b2b1b,'message':_0x13360a[_0x9a26('0x61')]});})['then'](function(_0xf7b570){if(!_0xf7b570)return;_0x140903=_0xf7b570;if(!_0x422b67['List'])throw new Error(_0x9a26('0xab'));if(_0x422b67[_0x9a26('0xac')][_0x9a26('0x9c')]['length'])return _0x422b67[_0x9a26('0xac')]['Contacts'][0x0];return db[_0x9a26('0x81')]['create'](_[_0x9a26('0xad')](_0x13360a[_0x9a26('0x61')],{'firstName':_0x13360a[_0x9a26('0x61')]['to'],'email':_0x13360a['body']['to'],'phone':_0x13360a[_0x9a26('0x61')]['to'],'ListId':_0x422b67[_0x9a26('0xae')]}));})[_0x9a26('0x26')](function(_0x3c4ffa){if(!_0x3c4ffa)return;var _0x4de762={'UserId':_0x13360a['user']['id'],'ContactId':_0x3c4ffa['id'],'MailAccountId':_0x422b67['id'],'inReplyTo':_0x140903['messageId'],'to':_0x13360a[_0x9a26('0x61')][_0x9a26('0xaf')],'cc':_0x13360a[_0x9a26('0x61')]['cc'],'subject':_0x13360a[_0x9a26('0x61')][_0x9a26('0xb0')],'attach':_0x13360a[_0x9a26('0x61')]['attach'],'firstMsgDirection':_0x9a26('0xb1'),'lastMsgAt':moment()[_0x9a26('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x9a26('0xb1'),'Messages':[_[_0x9a26('0x57')](_0x13360a[_0x9a26('0x61')],{'messageId':_0x140903['messageId'],'sentAt':moment()[_0x9a26('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x422b67['id'],'UserId':_0x13360a[_0x9a26('0x32')]['id'],'ContactId':_0x3c4ffa['id']})]};if(_0x13360a[_0x9a26('0x61')][_0x9a26('0xb2')]){_0x4de762=_[_0x9a26('0x57')](_0x4de762,_0x13360a['body'][_0x9a26('0xb2')]);}return db[_0x9a26('0x7f')]['create'](_0x4de762,{'include':[{'model':db[_0x9a26('0x98')],'as':_0x9a26('0xb3')}]});})['then'](respondWithResult(_0x26dad3,null))[_0x9a26('0x5c')](handleError(_0x26dad3,null));};exports[_0x9a26('0xb4')]=function(_0x5c76ac,_0x3e2a14){return db[_0x9a26('0x43')]['find']({'where':{'id':_0x5c76ac['params']['id']},'include':[{'model':db[_0x9a26('0x40')],'as':_0x9a26('0x3d'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x9a26('0x26')](handleEntityNotFound(_0x3e2a14,null))[_0x9a26('0x26')](function(_0xa0aa2b){if(!_0xa0aa2b[_0x9a26('0x3d')])return;var _0x7541bb=_0xa0aa2b[_0x9a26('0xa8')]();return respondWithRpcPromise(_0x9a26('0xb5'),_0x9a26('0xb4'),{'account':_0x7541bb});})[_0x9a26('0x26')](respondWithResult(_0x3e2a14,null))[_0x9a26('0x5c')](handleError(_0x3e2a14,null));};exports['destroy']=function(_0x469ea9,_0x4aa0aa){return db[_0x9a26('0x43')]['find']({'where':{'id':_0x469ea9[_0x9a26('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4aa0aa,null))[_0x9a26('0x26')](function(_0x563b88){if(_0x563b88&&_0x563b88[_0x9a26('0x39')]){throw new db['Sequelize'][(_0x9a26('0xb6'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x563b88;})[_0x9a26('0x26')](removeEntity(_0x4aa0aa,null))[_0x9a26('0x5c')](handleError(_0x4aa0aa,null));};exports[_0x9a26('0xb7')]=function(_0x292bb7,_0x8dcd22){return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x292bb7[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x8dcd22,null))[_0x9a26('0x26')](function(_0x4da630){if(_0x4da630){return _0x4da630[_0x9a26('0xb7')](_0x292bb7['body'][_0x9a26('0x6e')],_['omit'](_0x292bb7[_0x9a26('0x61')],[_0x9a26('0x6e'),'id'])||{})[_0x9a26('0xb8')](function(_0x580dbb){for(var _0x5c66e4=0x0;_0x5c66e4<_0x292bb7['body'][_0x9a26('0x6e')][_0x9a26('0x4e')];_0x5c66e4+=0x1){socket[_0x9a26('0xb9')](_0x9a26('0xba'),{'UserId':Number(_0x292bb7[_0x9a26('0x61')][_0x9a26('0x6e')][_0x5c66e4]),'MailAccountId':Number(_0x292bb7['params']['id'])});}return _0x580dbb;});}})[_0x9a26('0x26')](respondWithResult(_0x8dcd22,null))[_0x9a26('0x5c')](handleError(_0x8dcd22,null));};exports[_0x9a26('0xbb')]=function(_0x3ad826,_0x188d82){return db[_0x9a26('0x43')][_0x9a26('0x60')]({'where':{'id':_0x3ad826[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x188d82,null))[_0x9a26('0x26')](function(_0x19be15){if(_0x19be15){return _0x19be15[_0x9a26('0xbb')](_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')])[_0x9a26('0x26')](function(){if(_[_0x9a26('0xbc')](_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')])){for(var _0xef35fd=0x0;_0xef35fd<_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')]['length'];_0xef35fd+=0x1){socket[_0x9a26('0xb9')](_0x9a26('0xbd'),{'UserId':Number(_0x3ad826[_0x9a26('0x49')][_0x9a26('0x6e')][_0xef35fd]),'MailAccountId':Number(_0x3ad826[_0x9a26('0x5e')]['id'])});}}else{socket[_0x9a26('0xb9')](_0x9a26('0xbd'),{'UserId':Number(_0x3ad826['query']['ids']),'MailAccountId':Number(_0x3ad826['params']['id'])});}});}})['then'](respondWithStatusCode(_0x188d82,null))[_0x9a26('0x5c')](handleError(_0x188d82,null));};exports['getAgents']=function(_0x23f8de,_0x43e453){var _0x36fdae={};var _0xda028c={};var _0x4789cc;var _0x446b07;return db[_0x9a26('0x43')]['findOne']({'where':{'id':_0x23f8de[_0x9a26('0x5e')]['id']}})[_0x9a26('0x26')](handleEntityNotFound(_0x43e453,null))['then'](function(_0xdb7b3b){if(_0xdb7b3b){_0x4789cc=_0xdb7b3b;_0xda028c[_0x9a26('0x47')]=_[_0x9a26('0x4a')](db[_0x9a26('0xbe')][_0x9a26('0x44')]);_0xda028c[_0x9a26('0x49')]=_['keys'](_0x23f8de[_0x9a26('0x49')]);_0xda028c['filters']=_[_0x9a26('0x4b')](_0xda028c['model'],_0xda028c[_0x9a26('0x49')]);_0x36fdae[_0x9a26('0x4c')]=_[_0x9a26('0x4b')](_0xda028c['model'],qs[_0x9a26('0x4d')](_0x23f8de[_0x9a26('0x49')]['fields']));_0x36fdae[_0x9a26('0x4c')]=_0x36fdae[_0x9a26('0x4c')]['length']?_0x36fdae[_0x9a26('0x4c')]:_0xda028c[_0x9a26('0x47')];_0x36fdae[_0x9a26('0x51')]=qs[_0x9a26('0x52')](_0x23f8de[_0x9a26('0x49')]['sort']);_0x36fdae[_0x9a26('0x53')]=qs[_0x9a26('0x54')](_['pick'](_0x23f8de[_0x9a26('0x49')],_0xda028c['filters']));if(_0x23f8de[_0x9a26('0x49')][_0x9a26('0x56')]){_0x36fdae[_0x9a26('0x53')]=_[_0x9a26('0x57')](_0x36fdae[_0x9a26('0x53')],{'$or':_[_0x9a26('0x42')](_0x36fdae['attributes'],function(_0x5176ef){var _0x4a3d6d={};_0x4a3d6d[_0x5176ef]={'$like':'%'+_0x23f8de[_0x9a26('0x49')][_0x9a26('0x56')]+'%'};return _0x4a3d6d;})});}_0x36fdae=_['merge']({},_0x36fdae,_0x23f8de[_0x9a26('0x5a')]);return _0x4789cc[_0x9a26('0xbf')](_0x36fdae);}})[_0x9a26('0x26')](function(_0x20e05d){if(_0x20e05d){_0x446b07=_0x20e05d['length'];if(!_0x23f8de['query'][_0x9a26('0x4f')]('nolimit')){_0x36fdae[_0x9a26('0x1d')]=qs[_0x9a26('0x1d')](_0x23f8de[_0x9a26('0x49')]['limit']);_0x36fdae['offset']=qs[_0x9a26('0x1c')](_0x23f8de[_0x9a26('0x49')][_0x9a26('0x1c')]);}return _0x4789cc['getAgents'](_0x36fdae);}})[_0x9a26('0x26')](function(_0x4990c3){if(_0x4990c3){return _0x4990c3?{'count':_0x446b07,'rows':_0x4990c3}:null;}})[_0x9a26('0x26')](respondWithResult(_0x43e453,null))['catch'](handleError(_0x43e453,null));};
\ No newline at end of file
+var _0xc165=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','DESC','CloudProvider','from','%s\x20<%s>','attachments','join','root','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','out','Interaction','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','../../components/parsers/qs','api','../../mysqldb','localhost','socket.io-emitter','redis','./mailAccount.socket','register','jayson/promise','client','request','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','MailAccounts','UserProfileResource','end','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','username','password','modernAuthentication','CloudProviderId','pass','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','MailAccount','include','findAll','rows','show','params','MailServerOut','length','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','create','getDispositions','findOne','nolimit','pick','Disposition','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','isNil','active','description','get'];(function(_0x27fc6c,_0x5d3fc8){var _0x28e8fa=function(_0x450e6c){while(--_0x450e6c){_0x27fc6c['push'](_0x27fc6c['shift']());}};_0x28e8fa(++_0x5d3fc8);}(_0xc165,0x1c6));var _0x5c16=function(_0x492b1c,_0x58840e){_0x492b1c=_0x492b1c-0x0;var _0xfd2d4c=_0xc165[_0x492b1c];return _0xfd2d4c;};'use strict';var moment=require(_0x5c16('0x0'));var BPromise=require(_0x5c16('0x1'));var util=require('util');var path=require(_0x5c16('0x2'));var _=require(_0x5c16('0x3'));var juice=require(_0x5c16('0x4'));var Redis=require('ioredis');var qs=require(_0x5c16('0x5'));var logger=require('../../config/logger')(_0x5c16('0x6'));var config=require('../../config/environment');var db=require(_0x5c16('0x7'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x5c16('0x8'),'port':0x18eb});var socket=require(_0x5c16('0x9'))(new Redis(config[_0x5c16('0xa')]));require(_0x5c16('0xb'))[_0x5c16('0xc')](socket);var jayson=require(_0x5c16('0xd'));var client=jayson[_0x5c16('0xe')]['http']({'port':0x232b});function respondWithRpcPromise(_0x199b7c,_0x557612,_0x25cc60,_0x360d75){return new BPromise(function(_0x53d9d9,_0x89cf2d){var _0x5e7bdd=_0x360d75||client;return _0x5e7bdd[_0x5c16('0xf')](_0x199b7c,_0x25cc60)['then'](function(_0xf98000){logger['info'](_0x5c16('0x10'),_0x557612,_0x5c16('0x11'));logger[_0x5c16('0x12')](_0x5c16('0x13'),_0x557612,_0x5c16('0x11'),JSON[_0x5c16('0x14')](_0xf98000));if(_0xf98000['error']){if(_0xf98000[_0x5c16('0x15')]['code']===0x1f4){logger['error'](_0x5c16('0x10'),_0x557612,_0xf98000[_0x5c16('0x15')][_0x5c16('0x16')]);return _0x89cf2d(_0xf98000['error'][_0x5c16('0x16')]);}logger[_0x5c16('0x15')](_0x5c16('0x10'),_0x557612,_0xf98000[_0x5c16('0x15')][_0x5c16('0x16')]);return _0x53d9d9(_0xf98000[_0x5c16('0x15')][_0x5c16('0x16')]);}else{logger[_0x5c16('0x17')](_0x5c16('0x10'),_0x557612,_0x5c16('0x11'));_0x53d9d9(_0xf98000[_0x5c16('0x18')]['message']);}})[_0x5c16('0x19')](function(_0x4bc044){logger['error']('MailAccount,\x20%s,\x20%s',_0x557612,_0x4bc044);_0x89cf2d(_0x4bc044);});});}function respondWithStatusCode(_0x1b9482,_0x4a3b2d){_0x4a3b2d=_0x4a3b2d||0xcc;return function(_0x237522){if(_0x237522){return _0x1b9482['sendStatus'](_0x4a3b2d);}return _0x1b9482[_0x5c16('0x1a')](_0x4a3b2d)['end']();};}function respondWithResult(_0x8e00b5,_0x15e83f){_0x15e83f=_0x15e83f||0xc8;return function(_0x9df3ff){if(_0x9df3ff){return _0x8e00b5[_0x5c16('0x1a')](_0x15e83f)[_0x5c16('0x1b')](_0x9df3ff);}};}function respondWithFilteredResult(_0x1168f8,_0x1550eb){return function(_0x369ba2){if(_0x369ba2){var _0x1527c2=typeof _0x1550eb[_0x5c16('0x1c')]===_0x5c16('0x1d')&&typeof _0x1550eb[_0x5c16('0x1e')]===_0x5c16('0x1d');var _0x3c90cc=_0x369ba2['count'];var _0x3eb20a=_0x1527c2?0x0:_0x1550eb[_0x5c16('0x1c')];var _0x3ac505=_0x1527c2?_0x369ba2[_0x5c16('0x1f')]:_0x1550eb[_0x5c16('0x1c')]+_0x1550eb[_0x5c16('0x1e')];var _0x2f98f7;if(_0x3ac505>=_0x3c90cc){_0x3ac505=_0x3c90cc;_0x2f98f7=0xc8;}else{_0x2f98f7=0xce;}_0x1168f8[_0x5c16('0x1a')](_0x2f98f7);return _0x1168f8[_0x5c16('0x20')](_0x5c16('0x21'),_0x3eb20a+'-'+_0x3ac505+'/'+_0x3c90cc)[_0x5c16('0x1b')](_0x369ba2);}return null;};}function saveUpdates(_0x515c30){return function(_0x58227f){if(_0x58227f){return _0x58227f['update'](_0x515c30)[_0x5c16('0x22')](function(_0x16006e){return _0x16006e;});}return null;};}function removeEntity(_0x5f4be5){return function(_0x4774a8){if(_0x4774a8){return _0x4774a8[_0x5c16('0x23')]()[_0x5c16('0x22')](function(){var _0xbb783=_0x4774a8['get']({'plain':!![]});var _0x15a9df=_0x5c16('0x24');return db[_0x5c16('0x25')][_0x5c16('0x23')]({'where':{'type':_0x15a9df,'resourceId':_0xbb783['id']}})[_0x5c16('0x22')](function(){return _0x4774a8;});})[_0x5c16('0x22')](function(){_0x5f4be5[_0x5c16('0x1a')](0xcc)[_0x5c16('0x26')]();});}};}function handleEntityNotFound(_0x312f85){return function(_0x2e02db){if(!_0x2e02db){_0x312f85['sendStatus'](0x194);}return _0x2e02db;};}function handleError(_0x41c308,_0x39a837){_0x39a837=_0x39a837||0x1f4;return function(_0x3cc10d){logger[_0x5c16('0x15')](_0x3cc10d[_0x5c16('0x27')]);if(_0x3cc10d[_0x5c16('0x28')]){delete _0x3cc10d[_0x5c16('0x28')];}_0x41c308[_0x5c16('0x1a')](_0x39a837)[_0x5c16('0x29')](_0x3cc10d);};}function getImapHost(_0x2f99c9){switch(_0x2f99c9){case _0x5c16('0x2a'):return _0x5c16('0x2b');case _0x5c16('0x2c'):return _0x5c16('0x2d');case _0x5c16('0x2e'):return _0x5c16('0x2f');case'outlook365':return'outlook.office365.com';}throw new Error(_0x5c16('0x30'),_0x2f99c9);}function getSmtpHost(_0x102864){switch(_0x102864){case _0x5c16('0x2a'):return'smtp.gmail.com';case _0x5c16('0x2c'):return _0x5c16('0x31');case _0x5c16('0x2e'):return _0x5c16('0x32');case _0x5c16('0x33'):return _0x5c16('0x34');}throw new Error(_0x5c16('0x30'),_0x102864);}function getAuthenticationOptions(_0x5d6cd6,_0x245c06){var _0x4ad80f={};var _0x19e50e={};if(_0x5d6cd6){_0x4ad80f[_0x5c16('0x35')]=_0x19e50e[_0x5c16('0x35')]=_0x245c06[_0x5c16('0x36')];_0x4ad80f[_0x5c16('0x37')]=_0x19e50e['pass']=_0x245c06['password'];if(_0x245c06[_0x5c16('0x38')]){_0x4ad80f['modernAuthentication']=_0x19e50e[_0x5c16('0x38')]=!![];_0x4ad80f['CloudProviderId']=_0x19e50e[_0x5c16('0x39')]=_0x245c06[_0x5c16('0x39')];_0x4ad80f['password']=_0x19e50e[_0x5c16('0x3a')]=null;}else{_0x4ad80f[_0x5c16('0x39')]=_0x19e50e[_0x5c16('0x39')]=null;}_0x4ad80f[_0x5c16('0x3b')]=getImapHost(_0x5d6cd6);_0x4ad80f['port']=0x3e1;_0x19e50e['host']=getSmtpHost(_0x5d6cd6);_0x19e50e[_0x5c16('0x3c')]=0x24b;_0x19e50e[_0x5c16('0x3d')]=![];_0x4ad80f[_0x5c16('0x3e')]=_0x19e50e['service']=null;}else{if(_0x245c06[_0x5c16('0x3f')]){_0x4ad80f[_0x5c16('0x35')]=_0x19e50e[_0x5c16('0x35')]=_0x245c06[_0x5c16('0x36')];_0x4ad80f[_0x5c16('0x37')]=_0x19e50e[_0x5c16('0x3a')]=_0x245c06[_0x5c16('0x37')];}else{_0x4ad80f[_0x5c16('0x3f')]=_0x19e50e['authentication']=![];_0x4ad80f[_0x5c16('0x35')]=_0x19e50e[_0x5c16('0x35')]=null;_0x4ad80f['password']=_0x19e50e[_0x5c16('0x3a')]=null;}_0x4ad80f[_0x5c16('0x3b')]=_0x245c06['Imap'][_0x5c16('0x3b')];_0x4ad80f[_0x5c16('0x3c')]=_0x245c06[_0x5c16('0x40')]['port'];_0x19e50e['host']=_0x245c06['Smtp'][_0x5c16('0x3b')];_0x19e50e[_0x5c16('0x3c')]=_0x245c06[_0x5c16('0x41')][_0x5c16('0x3c')];}return{'Imap':_0x4ad80f,'Smtp':_0x19e50e};}exports[_0x5c16('0x42')]=function(_0x4cc04a,_0x395347){var _0x40c23b={'include':[{'model':db[_0x5c16('0x43')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x5c16('0x41')},{'model':db[_0x5c16('0x44')],'as':_0x5c16('0x45')}]},_0x2574e9={},_0x215de4={'count':0x0,'rows':[]};var _0x4b4cff=_[_0x5c16('0x46')](db['MailAccount'][_0x5c16('0x47')],function(_0x28d58d){return{'name':_0x28d58d['fieldName'],'type':_0x28d58d['type'][_0x5c16('0x48')]};});_0x2574e9[_0x5c16('0x49')]=_['map'](_0x4b4cff,'name');_0x2574e9[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x4cc04a[_0x5c16('0x4a')]);_0x2574e9[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x2574e9[_0x5c16('0x49')],_0x2574e9[_0x5c16('0x4a')]);_0x40c23b[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x2574e9['model'],qs[_0x5c16('0x4f')](_0x4cc04a[_0x5c16('0x4a')]['fields']));_0x40c23b[_0x5c16('0x4e')]=_0x40c23b[_0x5c16('0x4e')]['length']?_0x40c23b[_0x5c16('0x4e')]:_0x2574e9[_0x5c16('0x49')];if(!_0x4cc04a[_0x5c16('0x4a')][_0x5c16('0x50')]('nolimit')){_0x40c23b[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x4cc04a[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x40c23b[_0x5c16('0x1c')]=qs[_0x5c16('0x1c')](_0x4cc04a[_0x5c16('0x4a')]['offset']);}_0x40c23b[_0x5c16('0x51')]=qs[_0x5c16('0x52')](_0x4cc04a[_0x5c16('0x4a')]['sort']);_0x40c23b[_0x5c16('0x53')]=qs[_0x5c16('0x4c')](_['pick'](_0x4cc04a[_0x5c16('0x4a')],_0x2574e9[_0x5c16('0x4c')]),_0x4b4cff);if(_0x4cc04a[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x40c23b['where']=_[_0x5c16('0x55')](_0x40c23b[_0x5c16('0x53')],{'$or':_['map'](_0x4b4cff,function(_0x363d03){if(_0x363d03[_0x5c16('0x56')]!==_0x5c16('0x57')){var _0x162e0c={};_0x162e0c[_0x363d03[_0x5c16('0x28')]]={'$like':'%'+_0x4cc04a['query'][_0x5c16('0x54')]+'%'};return _0x162e0c;}})});}_0x40c23b=_['merge']({},_0x40c23b,_0x4cc04a[_0x5c16('0x58')]);var _0x59b314={'where':_0x40c23b[_0x5c16('0x53')]};return db[_0x5c16('0x59')][_0x5c16('0x1f')](_0x59b314)['then'](function(_0x5dc6d5){_0x215de4[_0x5c16('0x1f')]=_0x5dc6d5;if(_0x4cc04a['query']['includeAll']){_0x40c23b[_0x5c16('0x5a')]=[{'all':!![]}];}return db[_0x5c16('0x59')][_0x5c16('0x5b')](_0x40c23b);})[_0x5c16('0x22')](function(_0x397541){_0x215de4[_0x5c16('0x5c')]=_0x397541;return _0x215de4;})[_0x5c16('0x22')](respondWithFilteredResult(_0x395347,_0x40c23b))[_0x5c16('0x19')](handleError(_0x395347,null));};exports[_0x5c16('0x5d')]=function(_0x7a8dbb,_0x32323d){var _0x433859={'raw':![],'where':{'id':_0x7a8dbb[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0x43')],'as':_0x5c16('0x40')},{'model':db[_0x5c16('0x5f')],'as':_0x5c16('0x41')},{'model':db[_0x5c16('0x44')],'as':_0x5c16('0x45')}]},_0x5bec6e={};_0x5bec6e[_0x5c16('0x49')]=_[_0x5c16('0x4b')](db['MailAccount'][_0x5c16('0x47')]);_0x5bec6e[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x7a8dbb[_0x5c16('0x4a')]);_0x5bec6e[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x5bec6e[_0x5c16('0x49')],_0x5bec6e[_0x5c16('0x4a')]);_0x433859[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x5bec6e[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0x7a8dbb[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x433859['attributes']=_0x433859[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x433859[_0x5c16('0x4e')]:_0x5bec6e[_0x5c16('0x49')];if(_0x7a8dbb[_0x5c16('0x4a')]['includeAll']){_0x433859[_0x5c16('0x5a')]=[{'all':!![]}];}_0x433859=_[_0x5c16('0x55')]({},_0x433859,_0x7a8dbb['options']);return db[_0x5c16('0x59')][_0x5c16('0x61')](_0x433859)[_0x5c16('0x22')](handleEntityNotFound(_0x32323d,null))[_0x5c16('0x22')](respondWithResult(_0x32323d,null))[_0x5c16('0x19')](handleError(_0x32323d,null));};exports[_0x5c16('0x62')]=function(_0x3bb5c9,_0x41bb15){if(_0x3bb5c9['body']['id']){delete _0x3bb5c9[_0x5c16('0x63')]['id'];}var _0x48e43c=_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x64')]===_0x5c16('0x65')?null:_0x3bb5c9['body'][_0x5c16('0x64')];var _0x287b4e=_0x3bb5c9['body']['Imap']||{};var _0x45451d=_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x41')]||{};if(_0x48e43c){_0x287b4e['host']=getImapHost(_0x48e43c);_0x287b4e[_0x5c16('0x3c')]=0x3e1;_0x45451d[_0x5c16('0x3b')]=getSmtpHost(_0x48e43c);_0x45451d[_0x5c16('0x3c')]=0x24b;_0x45451d[_0x5c16('0x3d')]=![];}if(_0x45451d[_0x5c16('0x38')]){_0x45451d[_0x5c16('0x3d')]=![];}else{_0x45451d[_0x5c16('0x39')]=null;}if(!_0x287b4e[_0x5c16('0x38')])_0x287b4e['CloudProviderId']=null;_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x40')]=_0x287b4e;_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x41')]=_0x45451d;return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x3bb5c9[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0x43')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x5c16('0x41')},{'model':db['Pause'],'as':_0x5c16('0x45')}]})[_0x5c16('0x22')](handleEntityNotFound(_0x41bb15,null))[_0x5c16('0x22')](function(_0x31b64e){if(!_0x31b64e)throw new Error(_0x5c16('0x66'));if(_0x31b64e[_0x5c16('0x3e')])delete _0x3bb5c9[_0x5c16('0x63')]['Imap'];return _0x31b64e;})[_0x5c16('0x22')](saveUpdates(_0x3bb5c9[_0x5c16('0x63')],null))[_0x5c16('0x22')](function(_0x4125e8){if(!_0x3bb5c9[_0x5c16('0x63')]['Imap'])return _0x4125e8;return db[_0x5c16('0x43')][_0x5c16('0x62')](_0x3bb5c9[_0x5c16('0x63')]['Imap'],{'where':{'MailAccountId':_0x4125e8['id']}})[_0x5c16('0x22')](function(){return _0x4125e8;});})[_0x5c16('0x22')](function(_0x589cb4){if(!_0x3bb5c9['body'][_0x5c16('0x41')])return _0x589cb4;return db[_0x5c16('0x5f')][_0x5c16('0x62')](_0x3bb5c9[_0x5c16('0x63')][_0x5c16('0x41')],{'where':{'MailAccountId':_0x589cb4['id']}})[_0x5c16('0x22')](function(){return _0x589cb4;});})[_0x5c16('0x22')](respondWithResult(_0x41bb15,null))[_0x5c16('0x19')](handleError(_0x41bb15,null));};exports[_0x5c16('0x67')]=function(_0x561db5,_0xc5e9fb){return db[_0x5c16('0x59')][_0x5c16('0x67')]()['then'](respondWithResult(_0xc5e9fb,null))[_0x5c16('0x19')](handleError(_0xc5e9fb,null));};exports[_0x5c16('0x68')]=function(_0xb4cb83,_0x439fd6){if(_0xb4cb83['body']['id']){delete _0xb4cb83[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0xb4cb83[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x439fd6,null))[_0x5c16('0x22')](function(_0x46c39a){if(_0x46c39a){_0xb4cb83[_0x5c16('0x63')][_0x5c16('0x69')]=_0x46c39a['id'];return db['Disposition'][_0x5c16('0x6a')](_0xb4cb83['body']);}})['then'](respondWithResult(_0x439fd6,null))[_0x5c16('0x19')](handleError(_0x439fd6,null));};exports[_0x5c16('0x6b')]=function(_0xc1eee,_0x166ef8){var _0x55bfe4={'raw':![],'where':{}};var _0x3ff07d={};var _0x2f0f97={'count':0x0,'rows':[]};return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0xc1eee['params']['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x166ef8,null))[_0x5c16('0x22')](function(_0x1db050){if(_0x1db050){_0x3ff07d[_0x5c16('0x49')]=_[_0x5c16('0x4b')](db['Disposition'][_0x5c16('0x47')]);_0x3ff07d[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0xc1eee['query']);_0x3ff07d[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x3ff07d[_0x5c16('0x49')],_0x3ff07d[_0x5c16('0x4a')]);_0x55bfe4['attributes']=_[_0x5c16('0x4d')](_0x3ff07d[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0xc1eee['query'][_0x5c16('0x4f')]));_0x55bfe4[_0x5c16('0x4e')]=_0x55bfe4[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x55bfe4[_0x5c16('0x4e')]:_0x3ff07d[_0x5c16('0x49')];if(!_0xc1eee['query'][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x55bfe4[_0x5c16('0x1e')]=qs['limit'](_0xc1eee[_0x5c16('0x4a')]['limit']);_0x55bfe4['offset']=qs[_0x5c16('0x1c')](_0xc1eee[_0x5c16('0x4a')][_0x5c16('0x1c')]);}_0x55bfe4[_0x5c16('0x51')]=qs[_0x5c16('0x52')](_0xc1eee['query'][_0x5c16('0x52')]);_0x55bfe4[_0x5c16('0x53')]=qs['filters'](_[_0x5c16('0x6e')](_0xc1eee[_0x5c16('0x4a')],_0x3ff07d[_0x5c16('0x4c')]));_0x55bfe4[_0x5c16('0x53')]['MailAccountId']=_0x1db050['id'];if(_0xc1eee['query'][_0x5c16('0x54')]){_0x55bfe4[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x55bfe4[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x55bfe4['attributes'],function(_0xb8d214){var _0x4a8050={};_0x4a8050[_0xb8d214]={'$like':'%'+_0xc1eee[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x4a8050;})});}_0x55bfe4=_[_0x5c16('0x55')]({},_0x55bfe4,_0xc1eee[_0x5c16('0x58')]);return db[_0x5c16('0x6f')]['count']({'where':_0x55bfe4[_0x5c16('0x53')]})[_0x5c16('0x22')](function(_0x5351a8){_0x2f0f97[_0x5c16('0x1f')]=_0x5351a8;if(_0xc1eee[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x55bfe4[_0x5c16('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x5c16('0x5b')](_0x55bfe4);})[_0x5c16('0x22')](function(_0x46418f){_0x2f0f97['rows']=_0x46418f;return _0x2f0f97;});}})[_0x5c16('0x22')](respondWithFilteredResult(_0x166ef8,_0x55bfe4))[_0x5c16('0x19')](handleError(_0x166ef8,null));};exports[_0x5c16('0x71')]=function(_0x493c97,_0x9c8d50){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x493c97['params']['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x9c8d50,null))[_0x5c16('0x22')](function(_0x349281){if(_0x349281){return _0x349281[_0x5c16('0x71')](_0x493c97[_0x5c16('0x4a')][_0x5c16('0x72')]);}})[_0x5c16('0x22')](respondWithStatusCode(_0x9c8d50,null))['catch'](handleError(_0x9c8d50,null));};exports[_0x5c16('0x73')]=function(_0x1d7380,_0x56b113){if(_0x1d7380[_0x5c16('0x63')]['id']){delete _0x1d7380[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x1d7380[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x56b113,null))[_0x5c16('0x22')](function(_0x1741b4){if(_0x1741b4){_0x1d7380[_0x5c16('0x63')][_0x5c16('0x69')]=_0x1741b4['id'];return db[_0x5c16('0x74')][_0x5c16('0x6a')](_0x1d7380[_0x5c16('0x63')]);}})[_0x5c16('0x22')](respondWithResult(_0x56b113,null))[_0x5c16('0x19')](handleError(_0x56b113,null));};exports[_0x5c16('0x75')]=function(_0x33f568,_0x1f8b54){var _0x288a24={'raw':![],'where':{}};var _0x371bc3={};var _0xf65d83={'count':0x0,'rows':[]};return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x33f568[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x1f8b54,null))[_0x5c16('0x22')](function(_0x510b3a){if(_0x510b3a){_0x371bc3['model']=_['keys'](db['CannedAnswer'][_0x5c16('0x47')]);_0x371bc3['query']=_[_0x5c16('0x4b')](_0x33f568['query']);_0x371bc3[_0x5c16('0x4c')]=_['intersection'](_0x371bc3[_0x5c16('0x49')],_0x371bc3[_0x5c16('0x4a')]);_0x288a24[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x371bc3[_0x5c16('0x49')],qs['fields'](_0x33f568[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x288a24[_0x5c16('0x4e')]=_0x288a24[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x288a24[_0x5c16('0x4e')]:_0x371bc3[_0x5c16('0x49')];if(!_0x33f568['query'][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x288a24[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x33f568[_0x5c16('0x4a')]['limit']);_0x288a24[_0x5c16('0x1c')]=qs['offset'](_0x33f568['query'][_0x5c16('0x1c')]);}_0x288a24[_0x5c16('0x51')]=qs['sort'](_0x33f568[_0x5c16('0x4a')][_0x5c16('0x52')]);_0x288a24[_0x5c16('0x53')]=qs[_0x5c16('0x4c')](_[_0x5c16('0x6e')](_0x33f568[_0x5c16('0x4a')],_0x371bc3['filters']));_0x288a24[_0x5c16('0x53')][_0x5c16('0x69')]=_0x510b3a['id'];if(_0x33f568[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x288a24['where']=_[_0x5c16('0x55')](_0x288a24[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x288a24[_0x5c16('0x4e')],function(_0x33a123){var _0x367187={};_0x367187[_0x33a123]={'$like':'%'+_0x33f568['query'][_0x5c16('0x54')]+'%'};return _0x367187;})});}_0x288a24=_[_0x5c16('0x55')]({},_0x288a24,_0x33f568[_0x5c16('0x58')]);return db['CannedAnswer'][_0x5c16('0x1f')]({'where':_0x288a24[_0x5c16('0x53')]})[_0x5c16('0x22')](function(_0x446515){_0xf65d83['count']=_0x446515;if(_0x33f568[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x288a24[_0x5c16('0x5a')]=[{'all':!![]}];}return db[_0x5c16('0x74')][_0x5c16('0x5b')](_0x288a24);})[_0x5c16('0x22')](function(_0x53cbce){_0xf65d83[_0x5c16('0x5c')]=_0x53cbce;return _0xf65d83;});}})[_0x5c16('0x22')](respondWithFilteredResult(_0x1f8b54,_0x288a24))[_0x5c16('0x19')](handleError(_0x1f8b54,null));};exports['removeAnswers']=function(_0x2d2e40,_0x42e735){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x2d2e40[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x42e735,null))[_0x5c16('0x22')](function(_0xb21b85){if(_0xb21b85){return _0xb21b85[_0x5c16('0x76')](_0x2d2e40[_0x5c16('0x4a')]['ids']);}})[_0x5c16('0x22')](respondWithStatusCode(_0x42e735,null))[_0x5c16('0x19')](handleError(_0x42e735,null));};exports[_0x5c16('0x6a')]=function(_0x20fdba,_0x11ea2e){var _0x199e19={'name':_0x20fdba['body'][_0x5c16('0x28')],'key':_0x20fdba['body'][_0x5c16('0x48')],'provider':_0x20fdba[_0x5c16('0x63')]['provider']==='custom'?null:_0x20fdba[_0x5c16('0x63')]['provider'],'email':_0x20fdba[_0x5c16('0x63')][_0x5c16('0x77')],'ListId':_0x20fdba[_0x5c16('0x63')][_0x5c16('0x78')],'active':!_[_0x5c16('0x79')](_0x20fdba[_0x5c16('0x63')][_0x5c16('0x7a')])?_0x20fdba['body'][_0x5c16('0x7a')]:!![],'description':_0x20fdba[_0x5c16('0x63')][_0x5c16('0x7b')]||null};var _0x20f761=getAuthenticationOptions(_0x199e19[_0x5c16('0x64')],_0x20fdba[_0x5c16('0x63')]);_0x199e19[_0x5c16('0x40')]=_0x20f761['Imap'];_0x199e19[_0x5c16('0x41')]=_0x20f761[_0x5c16('0x41')];return db[_0x5c16('0x59')]['create'](_0x199e19,{'include':[{'model':db[_0x5c16('0x5f')],'as':_0x5c16('0x41')},{'model':db[_0x5c16('0x43')],'as':_0x5c16('0x40')}]})['then'](function(_0x5f48e1){var _0x41e51e=_0x20fdba[_0x5c16('0x35')][_0x5c16('0x7c')]({'plain':!![]});if(!_0x41e51e)throw new Error(_0x5c16('0x7d'));if(_0x41e51e[_0x5c16('0x7e')]===_0x5c16('0x35')){var _0x5003b8=_0x5f48e1[_0x5c16('0x7c')]({'plain':!![]});return db['UserProfileSection'][_0x5c16('0x61')]({'where':{'name':_0x5c16('0x24'),'userProfileId':_0x41e51e[_0x5c16('0x7f')]},'raw':!![]})[_0x5c16('0x22')](function(_0x3dc562){if(_0x3dc562&&_0x3dc562[_0x5c16('0x80')]===0x0){return db[_0x5c16('0x25')][_0x5c16('0x6a')]({'name':_0x5003b8[_0x5c16('0x28')],'resourceId':_0x5003b8['id'],'type':_0x3dc562[_0x5c16('0x28')],'sectionId':_0x3dc562['id']},{})[_0x5c16('0x22')](function(){return _0x5f48e1;});}else{return _0x5f48e1;}})[_0x5c16('0x19')](function(_0x15553b){logger[_0x5c16('0x15')](_0x5c16('0x81'),_0x15553b);throw _0x15553b;});}return _0x5f48e1;})[_0x5c16('0x22')](respondWithResult(_0x11ea2e,0xc9))['catch'](handleError(_0x11ea2e,null));};exports['getImap']=function(_0x1b6d2f,_0x5524ed){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x1b6d2f[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x5524ed,null))['then'](function(_0x4d08df){if(_0x4d08df){return _0x4d08df[_0x5c16('0x82')]();}return null;})[_0x5c16('0x22')](respondWithResult(_0x5524ed,null))['catch'](handleError(_0x5524ed,null));};exports[_0x5c16('0x83')]=function(_0x2c8e8c,_0x16c596){if(_0x2c8e8c[_0x5c16('0x63')]['id']){delete _0x2c8e8c[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x2c8e8c[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x16c596,null))['then'](function(_0x33f367){if(_0x33f367){_0x2c8e8c[_0x5c16('0x63')][_0x5c16('0x69')]=_0x33f367['id'];return db['MailServerIn']['create'](_0x2c8e8c[_0x5c16('0x63')]);}})[_0x5c16('0x22')](respondWithResult(_0x16c596,null))[_0x5c16('0x19')](handleError(_0x16c596,null));};exports[_0x5c16('0x84')]=function(_0x180d11,_0x5801c5){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x180d11[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5801c5,null))[_0x5c16('0x22')](function(_0x274844){if(_0x274844){return _0x274844['setImap'](null);}return null;})[_0x5c16('0x22')](respondWithStatusCode(_0x5801c5,null))[_0x5c16('0x19')](handleError(_0x5801c5,null));};exports[_0x5c16('0x85')]=function(_0x1a5f0b,_0x5a7942){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x1a5f0b[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5a7942,null))[_0x5c16('0x22')](function(_0x2f183f){if(_0x2f183f){return _0x2f183f['getSmtp']();}return null;})['then'](respondWithResult(_0x5a7942,null))['catch'](handleError(_0x5a7942,null));};exports['addSmtp']=function(_0xa8d15a,_0x46621e){if(_0xa8d15a['body']['id']){delete _0xa8d15a[_0x5c16('0x63')]['id'];}return db[_0x5c16('0x59')]['find']({'where':{'id':_0xa8d15a[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x46621e,null))['then'](function(_0x491fa8){if(_0x491fa8){_0xa8d15a[_0x5c16('0x63')][_0x5c16('0x69')]=_0x491fa8['id'];return db[_0x5c16('0x5f')]['create'](_0xa8d15a[_0x5c16('0x63')]);}})[_0x5c16('0x22')](respondWithResult(_0x46621e,null))[_0x5c16('0x19')](handleError(_0x46621e,null));};exports['removeSmtp']=function(_0x1b5b08,_0x52fdbd){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x1b5b08[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x52fdbd,null))['then'](function(_0x56f01d){if(_0x56f01d){return _0x56f01d[_0x5c16('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x52fdbd,null))['catch'](handleError(_0x52fdbd,null));};exports[_0x5c16('0x87')]=function(_0x4b2853,_0x3cbe59){return db[_0x5c16('0x88')][_0x5c16('0x61')]({'where':{'id':_0x4b2853[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3cbe59,null))['then'](function(_0x48b526){if(_0x48b526){return _0x48b526[_0x5c16('0x87')](_0x4b2853[_0x5c16('0x63')][_0x5c16('0x72')],_[_0x5c16('0x89')](_0x4b2853[_0x5c16('0x63')],[_0x5c16('0x72'),'id'])||{});}})[_0x5c16('0x22')](respondWithResult(_0x3cbe59,null))[_0x5c16('0x19')](handleError(_0x3cbe59,null));};exports[_0x5c16('0x8a')]=function(_0x246b55,_0x38e375){var _0x71ab28={'raw':![],'where':{}};var _0x1d9b68={};var _0x4fa9e3={'count':0x0,'rows':[]};return db['MailAccount'][_0x5c16('0x6c')]({'where':{'id':_0x246b55['params']['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x38e375,null))[_0x5c16('0x22')](function(_0x532e08){if(_0x532e08){_0x1d9b68['model']=_[_0x5c16('0x4b')](db[_0x5c16('0x88')]['rawAttributes']);_0x1d9b68[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x246b55[_0x5c16('0x4a')]);_0x1d9b68[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x1d9b68['model'],_0x1d9b68[_0x5c16('0x4a')]);_0x71ab28[_0x5c16('0x4e')]=_['intersection'](_0x1d9b68[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0x246b55['query'][_0x5c16('0x4f')]));_0x71ab28['attributes']=_0x71ab28['attributes']['length']?_0x71ab28[_0x5c16('0x4e')]:_0x1d9b68[_0x5c16('0x49')];if(!_0x246b55[_0x5c16('0x4a')][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x71ab28[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x246b55['query']['limit']);_0x71ab28['offset']=qs['offset'](_0x246b55[_0x5c16('0x4a')]['offset']);}_0x71ab28['order']=qs['sort'](_0x246b55[_0x5c16('0x4a')][_0x5c16('0x52')]);_0x71ab28['where']=qs['filters'](_[_0x5c16('0x6e')](_0x246b55[_0x5c16('0x4a')],_0x1d9b68[_0x5c16('0x4c')]));_0x71ab28[_0x5c16('0x53')]['MailAccountId']=_0x532e08['id'];if(_0x246b55[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x71ab28[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x71ab28[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x71ab28[_0x5c16('0x4e')],function(_0x484cb8){var _0x5f4881={};_0x5f4881[_0x484cb8]={'$like':'%'+_0x246b55[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x5f4881;})});}_0x71ab28=_[_0x5c16('0x55')]({},_0x71ab28,_0x246b55[_0x5c16('0x58')]);return db[_0x5c16('0x88')][_0x5c16('0x1f')]({'where':_0x71ab28['where']})[_0x5c16('0x22')](function(_0x439187){_0x4fa9e3['count']=_0x439187;if(_0x246b55[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x71ab28['include']=[{'model':db['CmContact'],'as':_0x5c16('0x8b'),'required':![]},{'model':db[_0x5c16('0x8c')],'as':_0x5c16('0x8d'),'attributes':[_0x5c16('0x28'),_0x5c16('0x8e'),'internal'],'required':![]},{'model':db[_0x5c16('0x8f')],'as':_0x5c16('0x90'),'attributes':['id',_0x5c16('0x28'),_0x5c16('0x91')],'where':_0x246b55[_0x5c16('0x4a')][_0x5c16('0x92')]?{'id':_0x246b55[_0x5c16('0x4a')][_0x5c16('0x92')]}:undefined,'required':_0x246b55[_0x5c16('0x4a')][_0x5c16('0x92')]?!![]:![]}];}return db[_0x5c16('0x88')][_0x5c16('0x5b')](_0x71ab28);})[_0x5c16('0x22')](function(_0x5cdbe4){_0x4fa9e3['rows']=_0x5cdbe4;return _0x4fa9e3;});}})['then'](respondWithFilteredResult(_0x38e375,_0x71ab28))['catch'](handleError(_0x38e375,null));};exports[_0x5c16('0x93')]=function addApplications(_0x487f71,_0x162471){var _0x252e60=_0x487f71['params']['id'];var _0x3966d6=_0x487f71[_0x5c16('0x63')];var _0x5c854b=0xc8;var _0x78aa78=null;return db[_0x5c16('0x94')][_0x5c16('0x95')]({'isolationLevel':db[_0x5c16('0x94')][_0x5c16('0x96')]['ISOLATION_LEVELS'][_0x5c16('0x97')]},function(_0x248e15){return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x252e60},'transaction':_0x248e15})[_0x5c16('0x22')](function(_0x44d49c){if(_0x44d49c){return db['MailApplication'][_0x5c16('0x23')]({'where':{'MailAccountId':_0x252e60},'transaction':_0x248e15})[_0x5c16('0x22')](function(){var _0xd200e=_[_0x5c16('0x46')](_0x3966d6,function(_0x2cd40){_0x2cd40[_0x5c16('0x69')]=_0x252e60;return _0x2cd40;});return db[_0x5c16('0x98')][_0x5c16('0x99')](_0xd200e,{'transaction':_0x248e15});});}else{_0x5c854b=0x194;_0x78aa78=[];}});})[_0x5c16('0x22')](function(){if(_0x5c854b!==0x194){return db[_0x5c16('0x98')][_0x5c16('0x9a')]({'where':{'MailAccountId':_0x252e60},'order':_0x5c16('0x9b')})[_0x5c16('0x22')](function(_0xc64041){_0x78aa78=_0xc64041;});}})[_0x5c16('0x19')](function(_0x3c18fa){_0x5c854b=0x1f4;logger[_0x5c16('0x15')](_0x3c18fa[_0x5c16('0x27')]);if(_0x3c18fa['name']){delete _0x3c18fa[_0x5c16('0x28')];}_0x78aa78=_0x3c18fa;})[_0x5c16('0x9c')](function(){if(_0x78aa78===null){_0x162471[_0x5c16('0x9d')](_0x5c854b);}else{if(_0x5c854b===0x1f4){_0x162471[_0x5c16('0x1a')](_0x5c854b)['send'](_0x78aa78);}else{_0x162471['status'](_0x5c854b)[_0x5c16('0x1b')](_0x78aa78);}}});};exports[_0x5c16('0x9e')]=function(_0x16c498,_0x412dd9){var _0x1439bd={};var _0x254989={};var _0x31a32a;var _0xbfcf46;return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x16c498[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x412dd9,null))['then'](function(_0xe27c3){if(_0xe27c3){_0x31a32a=_0xe27c3;_0x254989['model']=_[_0x5c16('0x4b')](db[_0x5c16('0x98')][_0x5c16('0x47')]);_0x254989[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x16c498['query']);_0x254989[_0x5c16('0x4c')]=_['intersection'](_0x254989[_0x5c16('0x49')],_0x254989['query']);_0x1439bd[_0x5c16('0x4e')]=_['intersection'](_0x254989['model'],qs['fields'](_0x16c498[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x1439bd[_0x5c16('0x4e')]=_0x1439bd['attributes'][_0x5c16('0x60')]?_0x1439bd[_0x5c16('0x4e')]:_0x254989[_0x5c16('0x49')];_0x1439bd['order']=qs[_0x5c16('0x52')](_0x16c498['query']['sort']);_0x1439bd['where']=qs[_0x5c16('0x4c')](_['pick'](_0x16c498[_0x5c16('0x4a')],_0x254989[_0x5c16('0x4c')]));if(_0x16c498[_0x5c16('0x4a')][_0x5c16('0x54')]){_0x1439bd[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x1439bd[_0x5c16('0x53')],{'$or':_['map'](_0x1439bd[_0x5c16('0x4e')],function(_0x21e0f2){var _0x4e00f1={};_0x4e00f1[_0x21e0f2]={'$like':'%'+_0x16c498[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x4e00f1;})});}_0x1439bd=_[_0x5c16('0x55')]({},_0x1439bd,_0x16c498['options']);return _0x31a32a[_0x5c16('0x9e')](_0x1439bd);}})[_0x5c16('0x22')](function(_0x85a8e8){if(_0x85a8e8){_0xbfcf46=_0x85a8e8['length'];if(!_0x16c498['query'][_0x5c16('0x50')]('nolimit')){_0x1439bd[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x16c498[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x1439bd['offset']=qs[_0x5c16('0x1c')](_0x16c498[_0x5c16('0x4a')][_0x5c16('0x1c')]);}return _0x31a32a['getApplications'](_0x1439bd);}})[_0x5c16('0x22')](function(_0x19de9b){if(_0x19de9b){return _0x19de9b?{'count':_0xbfcf46,'rows':_0x19de9b}:null;}})['then'](respondWithResult(_0x412dd9,null))[_0x5c16('0x19')](handleError(_0x412dd9,null));};exports[_0x5c16('0x9f')]=function(_0x55538b,_0x54264e){var _0x16089d={'raw':!![],'where':{}};var _0x4b35ff={};var _0x551dfe={'count':0x0,'rows':[]};return db[_0x5c16('0x59')][_0x5c16('0x6c')]({'where':{'id':_0x55538b[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x54264e,null))[_0x5c16('0x22')](function(_0x25529d){if(_0x25529d){_0x4b35ff[_0x5c16('0x49')]=_[_0x5c16('0x4b')](db[_0x5c16('0xa0')]['rawAttributes']);_0x4b35ff[_0x5c16('0x4a')]=_[_0x5c16('0x4b')](_0x55538b[_0x5c16('0x4a')]);_0x4b35ff['filters']=_[_0x5c16('0x4d')](_0x4b35ff[_0x5c16('0x49')],_0x4b35ff[_0x5c16('0x4a')]);_0x16089d['attributes']=_['intersection'](_0x4b35ff[_0x5c16('0x49')],qs['fields'](_0x55538b[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x16089d[_0x5c16('0x4e')]=_0x16089d[_0x5c16('0x4e')]['length']?_0x16089d['attributes']:_0x4b35ff['model'];if(!_0x55538b['query'][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x16089d[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x55538b[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x16089d[_0x5c16('0x1c')]=qs['offset'](_0x55538b['query']['offset']);}_0x16089d[_0x5c16('0x51')]=qs['sort'](_0x55538b[_0x5c16('0x4a')]['sort']);_0x16089d['where']=qs['filters'](_[_0x5c16('0x6e')](_0x55538b[_0x5c16('0x4a')],_0x4b35ff[_0x5c16('0x4c')]));_0x16089d[_0x5c16('0x53')][_0x5c16('0x69')]=_0x25529d['id'];if(_0x55538b[_0x5c16('0x4a')]['filter']){_0x16089d[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x16089d[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x16089d[_0x5c16('0x4e')],function(_0x1cd61b){var _0x3a0baf={};_0x3a0baf[_0x1cd61b]={'$like':'%'+_0x55538b['query']['filter']+'%'};return _0x3a0baf;})});}if(_0x55538b['query'][_0x5c16('0xa1')]){var _0x4f66e9=_0x55538b[_0x5c16('0x4a')][_0x5c16('0xa1')][_0x5c16('0xa2')](',');var _0x54ee37={};_0x54ee37[_0x4f66e9[0x0]]={'$gte':moment(_0x4f66e9[0x1])[_0x5c16('0xa3')](_0x5c16('0xa4'))};_0x16089d[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x16089d[_0x5c16('0x53')],_0x54ee37);}_0x16089d=_[_0x5c16('0x55')]({},_0x16089d,_0x55538b[_0x5c16('0x58')]);return db[_0x5c16('0xa0')][_0x5c16('0x1f')]({'where':_0x16089d[_0x5c16('0x53')]})[_0x5c16('0x22')](function(_0x4582d8){_0x551dfe[_0x5c16('0x1f')]=_0x4582d8;if(_0x55538b[_0x5c16('0x4a')][_0x5c16('0x70')]){_0x16089d[_0x5c16('0x5a')]=[{'all':!![]}];}return db[_0x5c16('0xa0')]['findAll'](_0x16089d);})[_0x5c16('0x22')](function(_0x43fb4c){if(_0x55538b[_0x5c16('0x4a')]['inlineCss']==='true'){for(var _0x1299b2=0x0;_0x1299b2<_0x43fb4c[_0x5c16('0x60')];_0x1299b2++){_0x43fb4c[_0x1299b2][_0x5c16('0x63')]=juice(_0x43fb4c[_0x1299b2][_0x5c16('0x63')]);}}_0x551dfe[_0x5c16('0x5c')]=_0x43fb4c;return _0x551dfe;});}})['then'](respondWithFilteredResult(_0x54264e,_0x16089d))['catch'](handleError(_0x54264e,null));};exports[_0x5c16('0x29')]=function(_0x1dbd66,_0x17a581){var _0x3aad14,_0x2cf4a6={},_0x37d04a;if(_0x1dbd66[_0x5c16('0x63')]['to']){_0x37d04a=_0x1dbd66[_0x5c16('0x63')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x1dbd66[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0xa5')],'as':_0x5c16('0xa6'),'include':[{'model':db[_0x5c16('0xa7')],'as':'Contacts','where':{'email':_0x37d04a},'limit':0x1,'order':[['updatedAt',_0x5c16('0xa8')]]}]},{'model':db['MailServerOut'],'as':_0x5c16('0x41'),'raw':!![],'include':[{'model':db[_0x5c16('0xa9')],'as':'CloudProvider','raw':!![]}]}]})[_0x5c16('0x22')](handleEntityNotFound(_0x17a581,null))['then'](function(_0x19497a){if(!_0x19497a)return;_0x3aad14=_0x19497a;if(!_0x19497a[_0x5c16('0x41')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x5c16('0x79')](_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xaa')])){_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xaa')]=util['format'](_0x5c16('0xab'),_0x19497a['name'],_0x19497a[_0x5c16('0x77')]||_0x19497a[_0x5c16('0x41')]['user']);}if(_0x1dbd66[_0x5c16('0x63')]['attachments']&&_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xac')]['length']){for(var _0x39a0d1=0x0;_0x39a0d1<_0x1dbd66['body'][_0x5c16('0xac')][_0x5c16('0x60')];_0x39a0d1+=0x1){_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xac')][_0x39a0d1]={'filename':_0x1dbd66[_0x5c16('0x63')]['attachments'][_0x39a0d1][_0x5c16('0x28')],'path':path[_0x5c16('0xad')](config[_0x5c16('0xae')],'server/files/attachments',_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xac')][_0x39a0d1]['basename'])};}}var _0x36d60e=_0x19497a[_0x5c16('0xaf')]();return respondWithRpcPromise(_0x5c16('0xb0'),_0x5c16('0xb1'),{'account':_0x36d60e,'message':_0x1dbd66[_0x5c16('0x63')]});})[_0x5c16('0x22')](function(_0x5d6fc3){if(!_0x5d6fc3)return;_0x2cf4a6=_0x5d6fc3;if(!_0x3aad14[_0x5c16('0xa6')])throw new Error(_0x5c16('0xb2'));if(_0x3aad14[_0x5c16('0xa6')][_0x5c16('0xb3')][_0x5c16('0x60')])return _0x3aad14[_0x5c16('0xa6')][_0x5c16('0xb3')][0x0];return db[_0x5c16('0xa7')][_0x5c16('0x6a')](_['defaults'](_0x1dbd66['body'],{'firstName':_0x1dbd66['body']['to'],'email':_0x1dbd66[_0x5c16('0x63')]['to'],'phone':_0x1dbd66[_0x5c16('0x63')]['to'],'ListId':_0x3aad14[_0x5c16('0x78')]}));})[_0x5c16('0x22')](function(_0x1c90a2){if(!_0x1c90a2)return;var _0x21baa0={'UserId':_0x1dbd66[_0x5c16('0x35')]['id'],'ContactId':_0x1c90a2['id'],'MailAccountId':_0x3aad14['id'],'inReplyTo':_0x2cf4a6[_0x5c16('0xb4')],'to':_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xaa')],'cc':_0x1dbd66[_0x5c16('0x63')]['cc'],'subject':_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xb5')],'attach':_0x1dbd66['body']['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0x5c16('0xa3')](_0x5c16('0xa4')),'lastMsgDirection':_0x5c16('0xb6'),'Messages':[_['merge'](_0x1dbd66['body'],{'messageId':_0x2cf4a6[_0x5c16('0xb4')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x3aad14['id'],'UserId':_0x1dbd66[_0x5c16('0x35')]['id'],'ContactId':_0x1c90a2['id']})]};if(_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xb7')]){_0x21baa0=_[_0x5c16('0x55')](_0x21baa0,_0x1dbd66[_0x5c16('0x63')][_0x5c16('0xb7')]);}return db['MailInteraction']['create'](_0x21baa0,{'include':[{'model':db[_0x5c16('0xa0')],'as':'Messages'}]});})[_0x5c16('0x22')](respondWithResult(_0x17a581,null))[_0x5c16('0x19')](handleError(_0x17a581,null));};exports[_0x5c16('0xb8')]=function(_0x157eff,_0xc51bd){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x157eff[_0x5c16('0x5e')]['id']},'include':[{'model':db[_0x5c16('0x5f')],'as':_0x5c16('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5c16('0xa9'),'raw':!![]}]}]})[_0x5c16('0x22')](handleEntityNotFound(_0xc51bd,null))[_0x5c16('0x22')](function(_0x4603b0){if(!_0x4603b0[_0x5c16('0x41')])return;var _0x1c049a=_0x4603b0[_0x5c16('0xaf')]();return respondWithRpcPromise('VerifySmtp',_0x5c16('0xb8'),{'account':_0x1c049a});})['then'](respondWithResult(_0xc51bd,null))[_0x5c16('0x19')](handleError(_0xc51bd,null));};exports[_0x5c16('0x23')]=function(_0x4af299,_0x580b15){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x4af299[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x580b15,null))['then'](function(_0x5ddb51){if(_0x5ddb51&&_0x5ddb51[_0x5c16('0x3e')]){throw new db['Sequelize']['ValidationError'](_0x5c16('0xb9'));}return _0x5ddb51;})[_0x5c16('0x22')](removeEntity(_0x580b15,null))['catch'](handleError(_0x580b15,null));};exports['addAgents']=function(_0x58ccc8,_0x5f0a63){return db[_0x5c16('0x59')]['find']({'where':{'id':_0x58ccc8[_0x5c16('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5f0a63,null))[_0x5c16('0x22')](function(_0x1442e0){if(_0x1442e0){return _0x1442e0[_0x5c16('0xba')](_0x58ccc8[_0x5c16('0x63')][_0x5c16('0x72')],_[_0x5c16('0x89')](_0x58ccc8[_0x5c16('0x63')],[_0x5c16('0x72'),'id'])||{})[_0x5c16('0xbb')](function(_0xaa4726){for(var _0x115e52=0x0;_0x115e52<_0x58ccc8['body'][_0x5c16('0x72')]['length'];_0x115e52+=0x1){socket[_0x5c16('0xbc')](_0x5c16('0xbd'),{'UserId':Number(_0x58ccc8[_0x5c16('0x63')]['ids'][_0x115e52]),'MailAccountId':Number(_0x58ccc8[_0x5c16('0x5e')]['id'])});}return _0xaa4726;});}})[_0x5c16('0x22')](respondWithResult(_0x5f0a63,null))[_0x5c16('0x19')](handleError(_0x5f0a63,null));};exports['removeAgents']=function(_0x48b836,_0x2b7047){return db[_0x5c16('0x59')][_0x5c16('0x61')]({'where':{'id':_0x48b836[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x2b7047,null))['then'](function(_0x3158c3){if(_0x3158c3){return _0x3158c3[_0x5c16('0xbe')](_0x48b836[_0x5c16('0x4a')]['ids'])[_0x5c16('0x22')](function(){if(_['isArray'](_0x48b836['query']['ids'])){for(var _0x247d50=0x0;_0x247d50<_0x48b836['query'][_0x5c16('0x72')][_0x5c16('0x60')];_0x247d50+=0x1){socket['emit'](_0x5c16('0xbf'),{'UserId':Number(_0x48b836[_0x5c16('0x4a')]['ids'][_0x247d50]),'MailAccountId':Number(_0x48b836[_0x5c16('0x5e')]['id'])});}}else{socket[_0x5c16('0xbc')](_0x5c16('0xbf'),{'UserId':Number(_0x48b836[_0x5c16('0x4a')][_0x5c16('0x72')]),'MailAccountId':Number(_0x48b836[_0x5c16('0x5e')]['id'])});}});}})[_0x5c16('0x22')](respondWithStatusCode(_0x2b7047,null))[_0x5c16('0x19')](handleError(_0x2b7047,null));};exports[_0x5c16('0xc0')]=function(_0x380248,_0x477c1e){var _0x31b752={};var _0x22671e={};var _0x1766a3;var _0x50139e;return db[_0x5c16('0x59')]['findOne']({'where':{'id':_0x380248[_0x5c16('0x5e')]['id']}})[_0x5c16('0x22')](handleEntityNotFound(_0x477c1e,null))['then'](function(_0x439e2e){if(_0x439e2e){_0x1766a3=_0x439e2e;_0x22671e[_0x5c16('0x49')]=_['keys'](db[_0x5c16('0x8c')][_0x5c16('0x47')]);_0x22671e['query']=_[_0x5c16('0x4b')](_0x380248[_0x5c16('0x4a')]);_0x22671e[_0x5c16('0x4c')]=_[_0x5c16('0x4d')](_0x22671e['model'],_0x22671e[_0x5c16('0x4a')]);_0x31b752[_0x5c16('0x4e')]=_[_0x5c16('0x4d')](_0x22671e[_0x5c16('0x49')],qs[_0x5c16('0x4f')](_0x380248[_0x5c16('0x4a')][_0x5c16('0x4f')]));_0x31b752['attributes']=_0x31b752[_0x5c16('0x4e')][_0x5c16('0x60')]?_0x31b752['attributes']:_0x22671e[_0x5c16('0x49')];_0x31b752[_0x5c16('0x51')]=qs[_0x5c16('0x52')](_0x380248[_0x5c16('0x4a')]['sort']);_0x31b752[_0x5c16('0x53')]=qs[_0x5c16('0x4c')](_[_0x5c16('0x6e')](_0x380248['query'],_0x22671e[_0x5c16('0x4c')]));if(_0x380248['query'][_0x5c16('0x54')]){_0x31b752[_0x5c16('0x53')]=_[_0x5c16('0x55')](_0x31b752[_0x5c16('0x53')],{'$or':_[_0x5c16('0x46')](_0x31b752[_0x5c16('0x4e')],function(_0x2b4e85){var _0x1e0664={};_0x1e0664[_0x2b4e85]={'$like':'%'+_0x380248[_0x5c16('0x4a')][_0x5c16('0x54')]+'%'};return _0x1e0664;})});}_0x31b752=_[_0x5c16('0x55')]({},_0x31b752,_0x380248[_0x5c16('0x58')]);return _0x1766a3[_0x5c16('0xc0')](_0x31b752);}})[_0x5c16('0x22')](function(_0x213f97){if(_0x213f97){_0x50139e=_0x213f97[_0x5c16('0x60')];if(!_0x380248[_0x5c16('0x4a')][_0x5c16('0x50')](_0x5c16('0x6d'))){_0x31b752[_0x5c16('0x1e')]=qs[_0x5c16('0x1e')](_0x380248[_0x5c16('0x4a')][_0x5c16('0x1e')]);_0x31b752[_0x5c16('0x1c')]=qs[_0x5c16('0x1c')](_0x380248[_0x5c16('0x4a')]['offset']);}return _0x1766a3['getAgents'](_0x31b752);}})[_0x5c16('0x22')](function(_0x359eb8){if(_0x359eb8){return _0x359eb8?{'count':_0x50139e,'rows':_0x359eb8}:null;}})['then'](respondWithResult(_0x477c1e,null))['catch'](handleError(_0x477c1e,null));};
\ No newline at end of file
index a86702a..b5666d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6363=['emit','hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners','save','update','remove'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0x6363,0x13a));var _0x3636=function(_0x550155,_0x46a009){_0x550155=_0x550155-0x0;var _0xf6526a=_0x6363[_0x550155];return _0xf6526a;};'use strict';var EventEmitter=require(_0x3636('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x3636('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3636('0x2')](0x0);var events={'afterCreate':_0x3636('0x3'),'afterUpdate':_0x3636('0x4'),'afterDestroy':_0x3636('0x5')};function emitEvent(_0x684396){return function(_0x1335a2,_0xdf836f,_0x1e62e9){MailAccountEvents[_0x3636('0x6')](_0x684396+':'+_0x1335a2['id'],_0x1335a2);MailAccountEvents[_0x3636('0x6')](_0x684396,_0x1335a2);_0x1e62e9(null);};}for(var e in events){if(events[_0x3636('0x7')](e)){var event=events[e];MailAccount[_0x3636('0x8')](e,emitEvent(event));}}module[_0x3636('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0x0733=['emit','hasOwnProperty','hook','exports','MailAccount','setMaxListeners','save','remove'];(function(_0x35783b,_0x1be2fa){var _0x19e19b=function(_0x3fd261){while(--_0x3fd261){_0x35783b['push'](_0x35783b['shift']());}};_0x19e19b(++_0x1be2fa);}(_0x0733,0xc4));var _0x3073=function(_0x4e044a,_0x2ebb39){_0x4e044a=_0x4e044a-0x0;var _0x52be17=_0x0733[_0x4e044a];return _0x52be17;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x3073('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3073('0x1')](0x0);var events={'afterCreate':_0x3073('0x2'),'afterUpdate':'update','afterDestroy':_0x3073('0x3')};function emitEvent(_0x441cd2){return function(_0x5f2625,_0x322391,_0xfcabfd){MailAccountEvents[_0x3073('0x4')](_0x441cd2+':'+_0x5f2625['id'],_0x5f2625);MailAccountEvents[_0x3073('0x4')](_0x441cd2,_0x5f2625);_0xfcabfd(null);};}for(var e in events){if(events[_0x3073('0x5')](e)){var event=events[e];MailAccount[_0x3073('0x6')](e,emitEvent(event));}}module[_0x3073('0x7')]=MailAccountEvents;
\ No newline at end of file
index 2c757a7..2f0cae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2999=['mail_accounts','provider','custom','service','port','Smtp','secure','modernAuthentication','CloudProvider','auth','user','data5','pass','exports','MailAccount'];(function(_0x14e001,_0x569bf){var _0x2c09da=function(_0x2efab1){while(--_0x2efab1){_0x14e001['push'](_0x14e001['shift']());}};_0x2c09da(++_0x569bf);}(_0x2999,0x157));var _0x9299=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2999[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x9299('0x0')]=function(_0x10f206){return _0x10f206['define'](_0x9299('0x1'),attributes,{'tableName':_0x9299('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x3d7f57=this;var _0x4d1f87={'id':_0x3d7f57['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3d7f57[_0x9299('0x3')]!==_0x9299('0x4')){_0x4d1f87[_0x9299('0x5')]=_0x3d7f57['provider'];}else{_0x4d1f87['host']=_0x3d7f57['Smtp']['host'];_0x4d1f87[_0x9299('0x6')]=_0x3d7f57[_0x9299('0x7')][_0x9299('0x6')];_0x4d1f87[_0x9299('0x8')]=_0x3d7f57[_0x9299('0x7')][_0x9299('0x8')];}if(_0x3d7f57['Smtp']['authentication']){if(_0x3d7f57[_0x9299('0x7')][_0x9299('0x9')]){if(!_0x3d7f57[_0x9299('0x7')][_0x9299('0xa')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x4d1f87[_0x9299('0xb')]={'type':'OAuth2','user':_0x3d7f57[_0x9299('0x7')][_0x9299('0xc')],'accessToken':_0x3d7f57[_0x9299('0x7')]['CloudProvider'][_0x9299('0xd')]};}else{_0x4d1f87[_0x9299('0xb')]={'user':_0x3d7f57['Smtp']['user'],'pass':_0x3d7f57['Smtp'][_0x9299('0xe')]};}}return _0x4d1f87;}}});};
\ No newline at end of file
+var _0x8933=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','host','port','secure','Smtp','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','pass'];(function(_0x2fca4b,_0x6da735){var _0x36b2e1=function(_0x5e3fa8){while(--_0x5e3fa8){_0x2fca4b['push'](_0x2fca4b['shift']());}};_0x36b2e1(++_0x6da735);}(_0x8933,0x110));var _0x3893=function(_0x4a6eb7,_0x38b7fb){_0x4a6eb7=_0x4a6eb7-0x0;var _0x278ba7=_0x8933[_0x4a6eb7];return _0x278ba7;};'use strict';var attributes=require(_0x3893('0x0'));module[_0x3893('0x1')]=function(_0x54a231){return _0x54a231[_0x3893('0x2')](_0x3893('0x3'),attributes,{'tableName':_0x3893('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x6a46e0=this;var _0x3e7dd3={'id':_0x6a46e0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x6a46e0[_0x3893('0x5')]!=='custom'){_0x3e7dd3['service']=_0x6a46e0[_0x3893('0x5')];}else{_0x3e7dd3['host']=_0x6a46e0['Smtp'][_0x3893('0x6')];_0x3e7dd3[_0x3893('0x7')]=_0x6a46e0['Smtp']['port'];_0x3e7dd3[_0x3893('0x8')]=_0x6a46e0[_0x3893('0x9')]['secure'];}if(_0x6a46e0['Smtp'][_0x3893('0xa')]){if(_0x6a46e0['Smtp']['modernAuthentication']){if(!_0x6a46e0[_0x3893('0x9')][_0x3893('0xb')])throw new Error(_0x3893('0xc'));_0x3e7dd3['auth']={'type':_0x3893('0xd'),'user':_0x6a46e0[_0x3893('0x9')][_0x3893('0xe')],'accessToken':_0x6a46e0[_0x3893('0x9')][_0x3893('0xb')]['data5']};}else{_0x3e7dd3['auth']={'user':_0x6a46e0[_0x3893('0x9')][_0x3893('0xe')],'pass':_0x6a46e0[_0x3893('0x9')][_0x3893('0xf')]};}}return _0x3e7dd3;}}});};
\ No newline at end of file
index ad0ce49..716815b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x254e6e,_0x430741){var _0x21d732=function(_0x2cb3d4){while(--_0x2cb3d4){_0x254e6e['push'](_0x254e6e['shift']());}};_0x21d732(++_0x430741);}(_0x687b,0x14a));var _0xb687=function(_0x42bd43,_0x59fb77){_0x42bd43=_0x42bd43-0x0;var _0x421e88=_0x687b[_0x42bd43];return _0x421e88;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});};
\ No newline at end of file
+var _0x687b=['originTo','originCc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','ShowMailAccount','find','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','mail','difference','keys','CmContact','rawAttributes','createdAt','CompanyId','body','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','Contacts','updatedAt','DESC','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','length','close','autoclose','*,*,*,*','ListId','List\x20not\x20found','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','spread','update','interaction','get','created','contact'];(function(_0x1944c9,_0x1903c0){var _0x9a7545=function(_0x199b8b){while(--_0x199b8b){_0x1944c9['push'](_0x1944c9['shift']());}};_0x9a7545(++_0x1903c0);}(_0x687b,0x14a));var _0xb687=function(_0xbdf091,_0x35a06c){_0xbdf091=_0xbdf091-0x0;var _0x129fd5=_0x687b[_0xbdf091];return _0x129fd5;};'use strict';var _=require(_0xb687('0x0'));var moment=require(_0xb687('0x1'));var BPromise=require(_0xb687('0x2'));var rs=require(_0xb687('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var logger=require(_0xb687('0x4'))(_0xb687('0x5'));var config=require(_0xb687('0x6'));var jayson=require(_0xb687('0x7'));var client=jayson[_0xb687('0x8')][_0xb687('0x9')]({'port':0x232c});config[_0xb687('0xa')]=_[_0xb687('0xb')](config[_0xb687('0xa')],{'host':_0xb687('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb687('0xa')]));require(_0xb687('0xd'))['register'](socket);function respondWithRpcPromise(_0x1a99c5,_0x21e3ab,_0x825ad){return new BPromise(function(_0x15dc9a,_0x404fdb){return client[_0xb687('0xe')](_0x1a99c5,_0x825ad)[_0xb687('0xf')](function(_0xaf4727){logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));logger[_0xb687('0x12')](_0xb687('0x13'),_0x21e3ab,_0xb687('0x11'),JSON['stringify'](_0xaf4727));if(_0xaf4727['error']){if(_0xaf4727[_0xb687('0x14')][_0xb687('0x15')]===0x1f4){logger['error'](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x404fdb(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);return _0x15dc9a(_0xaf4727[_0xb687('0x14')][_0xb687('0x17')]);}else{logger[_0xb687('0x10')]('MailAccount,\x20%s,\x20%s',_0x21e3ab,_0xb687('0x11'));_0x15dc9a(_0xaf4727[_0xb687('0x18')][_0xb687('0x17')]);}})['catch'](function(_0x48958d){logger[_0xb687('0x14')](_0xb687('0x16'),_0x21e3ab,_0x48958d);_0x404fdb(_0x48958d);});});}exports[_0xb687('0x19')]=function(_0x4b593b){var _0x42cdd2=this;return new Promise(function(_0x481f1d,_0x1bd2bf){return db[_0xb687('0x1a')][_0xb687('0x1b')]({'raw':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b593b['options']?_0x4b593b[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x4b593b[_0xb687('0x1c')]?_0x4b593b['options'][_0xb687('0x1f')]||null:null,'limit':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x20')]||null:null,'include':_0x4b593b[_0xb687('0x1c')]?_0x4b593b[_0xb687('0x1c')][_0xb687('0x21')]?_[_0xb687('0x22')](_0x4b593b['options'][_0xb687('0x21')],function(_0x129347){return{'model':db[_0x129347[_0xb687('0x23')]],'as':_0x129347['as'],'attributes':_0x129347[_0xb687('0x1f')],'include':_0x129347[_0xb687('0x21')]?_[_0xb687('0x22')](_0x129347[_0xb687('0x21')],function(_0x3cb2f2){return{'model':db[_0x3cb2f2[_0xb687('0x23')]],'as':_0x3cb2f2['as'],'attributes':_0x3cb2f2[_0xb687('0x1f')],'include':_0x3cb2f2['include']?_[_0xb687('0x22')](_0x3cb2f2[_0xb687('0x21')],function(_0x392721){return{'model':db[_0x392721[_0xb687('0x23')]],'as':_0x392721['as'],'attributes':_0x392721[_0xb687('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x4e9a06){logger[_0xb687('0x10')]('GetMailAccount',_0x4b593b);logger[_0xb687('0x12')](_0xb687('0x19'),_0x4b593b,JSON[_0xb687('0x24')](_0x4e9a06));_0x481f1d(_0x4e9a06);})[_0xb687('0x25')](function(_0x1ad3ef){logger[_0xb687('0x14')](_0xb687('0x19'),_0x1ad3ef['message'],_0x4b593b);_0x1bd2bf(_0x42cdd2[_0xb687('0x14')](0x1f4,_0x1ad3ef[_0xb687('0x17')]));});});};exports[_0xb687('0x26')]=function(_0x22cd1d){var _0xa18fec=this;return new Promise(function(_0x263834,_0x44be88){return db[_0xb687('0x1a')][_0xb687('0x27')]({'raw':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x1e')]||null:null,'attributes':_0x22cd1d[_0xb687('0x1c')]?_0x22cd1d[_0xb687('0x1c')]['attributes']||null:null,'include':_0x22cd1d['options']?_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')]?_['map'](_0x22cd1d[_0xb687('0x1c')][_0xb687('0x21')],function(_0x548b83){return{'model':db[_0x548b83[_0xb687('0x23')]],'as':_0x548b83['as'],'attributes':_0x548b83['attributes'],'include':_0x548b83[_0xb687('0x21')]?_[_0xb687('0x22')](_0x548b83[_0xb687('0x21')],function(_0x3e146a){return{'model':db[_0x3e146a[_0xb687('0x23')]],'as':_0x3e146a['as'],'attributes':_0x3e146a[_0xb687('0x1f')],'include':_0x3e146a['include']?_[_0xb687('0x22')](_0x3e146a[_0xb687('0x21')],function(_0x2a73df){return{'model':db[_0x2a73df[_0xb687('0x23')]],'as':_0x2a73df['as'],'attributes':_0x2a73df['attributes']};}):[]};}):[]};}):[]:[]})[_0xb687('0xf')](function(_0x100f4a){if(_0x22cd1d[_0xb687('0x1c')][_0xb687('0x28')]===!![])_0x100f4a[_0xb687('0x29')]('smtpOptions',_0x100f4a[_0xb687('0x2a')]());logger[_0xb687('0x10')](_0xb687('0x26'),_0x22cd1d);logger[_0xb687('0x12')](_0xb687('0x26'),_0x22cd1d,JSON[_0xb687('0x24')](_0x100f4a));_0x263834(_0x100f4a);})['catch'](function(_0x5ad577){logger[_0xb687('0x14')]('ShowMailAccount',_0x5ad577[_0xb687('0x17')],_0x22cd1d);_0x44be88(_0xa18fec[_0xb687('0x14')](0x1f4,_0x5ad577['message']));});});};exports[_0xb687('0x2b')]=function(_0x2ce07a){var _0x57776b=this;return new Promise(function(_0x394b56,_0x28031e){var _0x127b25={'body':_0x2ce07a['body'],'channel':_0xb687('0x2c')};var _0x9cffb2=_[_0xb687('0x2d')](_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')]),[_0xb687('0x31'),'updatedAt',_0xb687('0x32'),'ListId']);var _0x50fdb7=![];if(_0x2ce07a[_0xb687('0x33')]['id']){delete _0x2ce07a[_0xb687('0x33')]['id'];}if(_['isNil'](_0x2ce07a[_0xb687('0x33')]['from'])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x34')));}if(_['isNil'](_0x2ce07a[_0xb687('0x33')][_0xb687('0x33')])||_0x2ce07a['body'][_0xb687('0x33')]===''){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x35')));}if(_[_0xb687('0x36')](_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0xb687('0x38')+_0x9cffb2));}if(!_[_0xb687('0x39')](_0x9cffb2,_0x2ce07a[_0xb687('0x33')][_0xb687('0x37')])){return _0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9cffb2));}var _0x1ac373={};_0x1ac373[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')];return db[_0xb687('0x1a')][_0xb687('0x27')]({'where':{'id':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xb687('0x2f')],'as':_0xb687('0x3c'),'where':_0x1ac373,'limit':0x1,'order':[[_0xb687('0x3d'),_0xb687('0x3e')]]}]},{'model':db['MailApplication'],'as':_0xb687('0x3f')},{'model':db[_0xb687('0x40')],'as':_0xb687('0x41'),'include':[{'model':db[_0xb687('0x42')],'as':'CloudProvider'}]}]})[_0xb687('0xf')](function(_0xfc4c5f){if(_0xfc4c5f&&_0xfc4c5f[_0xb687('0x43')]){var _0x401b99=_0xfc4c5f['get']({'plain':!![]});_0x127b25['account']=_[_0xb687('0x44')](_0x401b99,[_0xb687('0x3f'),_0xb687('0x43')]);_0x127b25['account']['smtpOptions']=_0xfc4c5f[_0xb687('0x2a')]();_0x127b25[_0xb687('0x45')]=_0x401b99[_0xb687('0x3f')];_0x127b25[_0xb687('0x46')]=_0x401b99[_0xb687('0x43')];_0x127b25[_0xb687('0x45')]=_[_0xb687('0x47')](_0x127b25[_0xb687('0x45')],['priority'],[_0xb687('0x48')]);if(_0x127b25[_0xb687('0x3b')]&&_0x127b25[_0xb687('0x3b')]['autoclose']){_0x127b25['applications']['push']({'id':0x0,'priority':_0x127b25['applications'][_0xb687('0x49')]+0x1,'app':_0xb687('0x4a'),'appdata':_0xb687('0x4b'),'interval':_0xb687('0x4c')});}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x3f')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x3f')];}if(_0x127b25[_0xb687('0x3b')][_0xb687('0x43')]){delete _0x127b25[_0xb687('0x3b')][_0xb687('0x43')];}if(_0x401b99[_0xb687('0x43')][_0xb687('0x3c')][_0xb687('0x49')]){return _0x401b99[_0xb687('0x43')][_0xb687('0x3c')][0x0];}var _0x4dca01=_['defaults'](_0x2ce07a[_0xb687('0x33')],{'firstName':_0x2ce07a[_0xb687('0x33')][_0xb687('0x3a')],'ListId':_0x401b99[_0xb687('0x4d')]});_0x4dca01[_0x2ce07a['body'][_0xb687('0x37')]]=_0x2ce07a[_0xb687('0x33')]['from'];return db[_0xb687('0x2f')]['create'](_0x4dca01);}else{throw new Error(_0xb687('0x4e'));}})[_0xb687('0xf')](function(_0x50fb31){_0x127b25['contact']=_0x50fb31;if(_0x50fb31){if(!_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId']){_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')]=rs['generate']()+'\x20'+_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')];}var _0x1a31f6={'ContactId':_0x50fb31['id'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['messageId'],'to':_0x2ce07a['body'][_0xb687('0x17')]['from'],'cc':_0x2ce07a['body']['message']['cc'],'subject':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x50')],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'};return db[_0xb687('0x54')][_0xb687('0x27')]({'where':{'closed':![],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id']},'include':[{'model':db[_0xb687('0x55')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x56')]}}]})[_0xb687('0xf')](function(_0x1c031f){if(_0x1c031f){return[_0x1c031f,![]];}return db[_0xb687('0x54')][_0xb687('0x57')](_0x1a31f6)['then'](function(_0x22da49){return[_0x22da49,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xb687('0x58')](function(_0x293281,_0x18993a){if(_0x293281){_0x50fdb7=_0x18993a;if(!_0x18993a){return _0x293281[_0xb687('0x59')]({'inReplyTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x4f')],'to':_0x2ce07a['body'][_0xb687('0x17')][_0xb687('0x3a')],'cc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['cc'],'subject':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x50')],'attach':_0x293281[_0xb687('0x51')]?_0x293281[_0xb687('0x51')]:_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x51')],'substatus':null,'substatusAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgAt':moment()[_0xb687('0x52')](_0xb687('0x53')),'lastMsgDirection':'in'});}else{return _0x293281;}}})[_0xb687('0xf')](function(_0x48838a){_0x127b25[_0xb687('0x5a')]=_0x48838a[_0xb687('0x5b')]({'plain':!![]});_0x127b25[_0xb687('0x5a')][_0xb687('0x5c')]=_0x50fdb7;return db['MailMessage'][_0xb687('0x57')]({'body':_0x2ce07a[_0xb687('0x33')]['body'],'MailAccountId':_0x2ce07a[_0xb687('0x3b')]['id'],'MailInteractionId':_0x48838a['id'],'direction':'in','ContactId':_0x127b25[_0xb687('0x5d')]['id'],'messageId':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x4f')],'from':_0x2ce07a[_0xb687('0x33')]['message'][_0xb687('0x3a')],'to':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['to'],'cc':_0x2ce07a[_0xb687('0x33')]['message']['cc'],'subject':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['subject'],'attach':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['attach'],'Attachments':_0x2ce07a['body'][_0xb687('0x17')]['attachments'],'originTo':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5e')],'originCc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x5f')],'bcc':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['bcc'],'ChatWebsiteId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x60')]||null,'originChannel':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')][_0xb687('0x61')]||'Email','ChatOfflineMessageId':_0x2ce07a[_0xb687('0x33')][_0xb687('0x17')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xb687('0x62')],'as':_0xb687('0x63')}]});})[_0xb687('0xf')](function(_0x1227fe){_0x127b25['message']=_0x1227fe;if(_0x127b25[_0xb687('0x5a')]['UserId']){return db['User'][_0xb687('0x27')]({'attributes':['id','name'],'where':{'id':_0x127b25['interaction'][_0xb687('0x64')]}})['then'](function(_0x137631){if(_0x137631){_0x127b25[_0xb687('0x45')]['unshift']({'id':0x0,'priority':0x0,'app':_0xb687('0x65'),'appdata':_0x137631[_0xb687('0x66')]+','+(_0x127b25['account'][_0xb687('0x67')]||0xa),'interval':_0xb687('0x4c')});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);});}return respondWithRpcPromise(_0xb687('0x68'),_0xb687('0x69'),_0x127b25);})[_0xb687('0xf')](function(_0x2ce516){_0x394b56(_0x2ce516);})[_0xb687('0x25')](function(_0x4092a0){_0x28031e(_0x57776b[_0xb687('0x14')](0x1f4,_0x4092a0['message']));});});};
\ No newline at end of file
index b721787..aec9099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d1=['emit','length','mailAccount:','save','remove','update'];(function(_0x39cc66,_0x4e9a07){var _0x44eaaa=function(_0x3f4582){while(--_0x3f4582){_0x39cc66['push'](_0x39cc66['shift']());}};_0x44eaaa(++_0x4e9a07);}(_0x50d1,0xf3));var _0x150d=function(_0x899324,_0x2979c0){_0x899324=_0x899324-0x0;var _0x1e5000=_0x50d1[_0x899324];return _0x1e5000;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x150d('0x0'),_0x150d('0x1'),_0x150d('0x2')];function createListener(_0x4bac16,_0xbe5d9f){return function(_0x2de52f){_0xbe5d9f[_0x150d('0x3')](_0x4bac16,_0x2de52f);};}function removeListener(_0x46f6ce,_0x192f54){return function(){MailAccountEvents['removeListener'](_0x46f6ce,_0x192f54);};}exports['register']=function(_0x37af08){for(var _0x199c23=0x0,_0x43215f=events[_0x150d('0x4')];_0x199c23<_0x43215f;_0x199c23++){var _0x1a0cb3=events[_0x199c23];var _0x17811d=createListener(_0x150d('0x5')+_0x1a0cb3,_0x37af08);MailAccountEvents['on'](_0x1a0cb3,_0x17811d);}};
\ No newline at end of file
+var _0x97db=['length','mailAccount:','./mailAccount.events','save','remove','emit','register'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97db,0x1b4));var _0xb97d=function(_0x39e182,_0x3b1020){_0x39e182=_0x39e182-0x0;var _0x225a2f=_0x97db[_0x39e182];return _0x225a2f;};'use strict';var MailAccountEvents=require(_0xb97d('0x0'));var events=[_0xb97d('0x1'),_0xb97d('0x2'),'update'];function createListener(_0x5dd79c,_0x3770f4){return function(_0xb18d5a){_0x3770f4[_0xb97d('0x3')](_0x5dd79c,_0xb18d5a);};}function removeListener(_0x4382d1,_0x536ee5){return function(){MailAccountEvents['removeListener'](_0x4382d1,_0x536ee5);};}exports[_0xb97d('0x4')]=function(_0x1f59dd){for(var _0x4a5902=0x0,_0x533149=events[_0xb97d('0x5')];_0x4a5902<_0x533149;_0x4a5902++){var _0x57cbd4=events[_0x4a5902];var _0x20f1e1=createListener(_0xb97d('0x6')+_0x57cbd4,_0x1f59dd);MailAccountEvents['on'](_0x57cbd4,_0x20f1e1);}};
\ No newline at end of file
index f8d4350..892111d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa041=['multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','/:id','update','delete','destroy','exports'];(function(_0x5162dc,_0x3f7428){var _0x2851a9=function(_0x5b9210){while(--_0x5b9210){_0x5162dc['push'](_0x5162dc['shift']());}};_0x2851a9(++_0x3f7428);}(_0xa041,0x16c));var _0x1a04=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa041[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1a04('0x0'));var util=require('util');var path=require(_0x1a04('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1a04('0x2'));var auth=require(_0x1a04('0x3'));var interaction=require(_0x1a04('0x4'));var config=require(_0x1a04('0x5'));var controller=require(_0x1a04('0x6'));router[_0x1a04('0x7')]('/:id',auth[_0x1a04('0x8')](),controller['show']);router['put'](_0x1a04('0x9'),auth[_0x1a04('0x8')](),controller[_0x1a04('0xa')]);router[_0x1a04('0xb')](_0x1a04('0x9'),auth[_0x1a04('0x8')](),controller[_0x1a04('0xc')]);module[_0x1a04('0xd')]=router;
\ No newline at end of file
+var _0xc9fa=['isAuthenticated','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0x31e0d3,_0x35eed4){var _0x830cb6=function(_0x3b5076){while(--_0x3b5076){_0x31e0d3['push'](_0x31e0d3['shift']());}};_0x830cb6(++_0x35eed4);}(_0xc9fa,0x77));var _0xac9f=function(_0xa74d52,_0x430427){_0xa74d52=_0xa74d52-0x0;var _0x1e1247=_0xc9fa[_0xa74d52];return _0x1e1247;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xac9f('0x0'));var timeout=require(_0xac9f('0x1'));var express=require(_0xac9f('0x2'));var router=express[_0xac9f('0x3')]();var fs_extra=require(_0xac9f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xac9f('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xac9f('0x6')]('/:id',auth[_0xac9f('0x7')](),controller['show']);router[_0xac9f('0x8')](_0xac9f('0x9'),auth[_0xac9f('0x7')](),controller[_0xac9f('0xa')]);router[_0xac9f('0xb')](_0xac9f('0x9'),auth[_0xac9f('0x7')](),controller[_0xac9f('0xc')]);module[_0xac9f('0xd')]=router;
\ No newline at end of file
index 33ea4f9..8bb339c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96d6=['TEXT','STRING','*,*,*,*','sequelize','exports','INTEGER','noop'];(function(_0xeffa08,_0x544edc){var _0x426e43=function(_0x2eddc1){while(--_0x2eddc1){_0xeffa08['push'](_0xeffa08['shift']());}};_0x426e43(++_0x544edc);}(_0x96d6,0xdc));var _0x696d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x96d6[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x696d('0x0'));module[_0x696d('0x1')]={'priority':{'type':Sequelize[_0x696d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x696d('0x3')},'appdata':{'type':Sequelize[_0x696d('0x4')]()},'description':{'type':Sequelize[_0x696d('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x696d('0x6')}};
\ No newline at end of file
+var _0x2fe7=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x25ad66,_0x46e4dc){var _0x141bc4=function(_0x3a7f8e){while(--_0x3a7f8e){_0x25ad66['push'](_0x25ad66['shift']());}};_0x141bc4(++_0x46e4dc);}(_0x2fe7,0x136));var _0x72fe=function(_0x19117c,_0x26dae2){_0x19117c=_0x19117c-0x0;var _0x4370de=_0x2fe7[_0x19117c];return _0x4370de;};'use strict';var Sequelize=require(_0x72fe('0x0'));module['exports']={'priority':{'type':Sequelize[_0x72fe('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x72fe('0x2')],'allowNull':![],'defaultValue':_0x72fe('0x3')},'appdata':{'type':Sequelize[_0x72fe('0x4')]()},'description':{'type':Sequelize[_0x72fe('0x2')]},'interval':{'type':Sequelize[_0x72fe('0x2')],'defaultValue':_0x72fe('0x5')}};
\ No newline at end of file
index 8603a56..0722568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x5429e6,_0x1f78fe){var _0x3c6711=function(_0x2aca23){while(--_0x2aca23){_0x5429e6['push'](_0x5429e6['shift']());}};_0x3c6711(++_0x1f78fe);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));};
\ No newline at end of file
+var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x5cab28,_0x307622){var _0xa3554d=function(_0x330139){while(--_0x330139){_0x5cab28['push'](_0x5cab28['shift']());}};_0xa3554d(++_0x307622);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x33a61a,_0x106e32){_0x33a61a=_0x33a61a-0x0;var _0x7c2dfd=_0xbdb7[_0x33a61a];return _0x7c2dfd;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));};
\ No newline at end of file
index 34471df..42dad65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9419=['../../config/logger','api','moment','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash'];(function(_0x31cc6e,_0x4da430){var _0x39a234=function(_0x3fe7cd){while(--_0x3fe7cd){_0x31cc6e['push'](_0x31cc6e['shift']());}};_0x39a234(++_0x4da430);}(_0x9419,0x1b7));var _0x9941=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x9419[_0x3c4f1f];return _0x19cb69;};'use strict';var _=require(_0x9941('0x0'));var util=require('util');var logger=require(_0x9941('0x1'))(_0x9941('0x2'));var moment=require(_0x9941('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9941('0x4'));var attributes=require(_0x9941('0x5'));module[_0x9941('0x6')]=function(_0x151edd,_0x2be7b2){return _0x151edd[_0x9941('0x7')](_0x9941('0x8'),attributes,{'tableName':_0x9941('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9941('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5173=['request-promise','path','./mailApplication.attributes','define','MailApplication','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x5173,0x178));var _0x3517=function(_0x5a22e8,_0x329992){_0x5a22e8=_0x5a22e8-0x0;var _0x389674=_0x5173[_0x5a22e8];return _0x389674;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3517('0x0'))(_0x3517('0x1'));var moment=require(_0x3517('0x2'));var BPromise=require(_0x3517('0x3'));var rp=require(_0x3517('0x4'));var fs=require('fs');var path=require(_0x3517('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3517('0x6'));module['exports']=function(_0x213bdb,_0xbb5a16){return _0x213bdb[_0x3517('0x7')](_0x3517('0x8'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3517('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 967850c..dd1a34e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde72=['MailApplication,\x20%s,\x20%s','message','result','catch','MailApplication','update','body','options','raw','where','limit','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0x3ed219,_0x40ff55){var _0x4953d7=function(_0xb7da7f){while(--_0xb7da7f){_0x3ed219['push'](_0x3ed219['shift']());}};_0x4953d7(++_0x40ff55);}(_0xde72,0x1ac));var _0x2de7=function(_0x2716b3,_0x856b60){_0x2716b3=_0x2716b3-0x0;var _0x33fb97=_0xde72[_0x2716b3];return _0x33fb97;};'use strict';var _=require(_0x2de7('0x0'));var util=require(_0x2de7('0x1'));var moment=require(_0x2de7('0x2'));var BPromise=require(_0x2de7('0x3'));var rs=require(_0x2de7('0x4'));var fs=require('fs');var Redis=require(_0x2de7('0x5'));var db=require(_0x2de7('0x6'))['db'];var utils=require(_0x2de7('0x7'));var logger=require('../../config/logger')(_0x2de7('0x8'));var config=require(_0x2de7('0x9'));var jayson=require(_0x2de7('0xa'));var client=jayson[_0x2de7('0xb')][_0x2de7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x139f85,_0x2aa1c7,_0x17a90e){return new BPromise(function(_0x25b94d,_0x3e01d4){return client[_0x2de7('0xd')](_0x139f85,_0x17a90e)[_0x2de7('0xe')](function(_0x4b773c){logger[_0x2de7('0xf')]('MailApplication,\x20%s,\x20%s',_0x2aa1c7,_0x2de7('0x10'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x2aa1c7,_0x2de7('0x10'),JSON[_0x2de7('0x11')](_0x4b773c));if(_0x4b773c[_0x2de7('0x12')]){if(_0x4b773c[_0x2de7('0x12')][_0x2de7('0x13')]===0x1f4){logger[_0x2de7('0x12')](_0x2de7('0x14'),_0x2aa1c7,_0x4b773c['error'][_0x2de7('0x15')]);return _0x3e01d4(_0x4b773c[_0x2de7('0x12')][_0x2de7('0x15')]);}logger[_0x2de7('0x12')](_0x2de7('0x14'),_0x2aa1c7,_0x4b773c[_0x2de7('0x12')]['message']);return _0x25b94d(_0x4b773c[_0x2de7('0x12')][_0x2de7('0x15')]);}else{logger[_0x2de7('0xf')](_0x2de7('0x14'),_0x2aa1c7,'request\x20sent');_0x25b94d(_0x4b773c[_0x2de7('0x16')]['message']);}})[_0x2de7('0x17')](function(_0x214579){logger[_0x2de7('0x12')](_0x2de7('0x14'),_0x2aa1c7,_0x214579);_0x3e01d4(_0x214579);});});}exports['UpdateMailApplication']=function(_0x3c5e34){var _0x764f1b=this;return new Promise(function(_0x48d18f,_0xcf3405){return db[_0x2de7('0x18')][_0x2de7('0x19')](_0x3c5e34[_0x2de7('0x1a')],{'raw':_0x3c5e34[_0x2de7('0x1b')]?_0x3c5e34['options'][_0x2de7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c5e34['options']?_0x3c5e34[_0x2de7('0x1b')][_0x2de7('0x1d')]||null:null,'attributes':_0x3c5e34[_0x2de7('0x1b')]?_0x3c5e34['options']['attributes']||null:null,'limit':_0x3c5e34[_0x2de7('0x1b')]?_0x3c5e34[_0x2de7('0x1b')][_0x2de7('0x1e')]||null:null})['then'](function(_0x5ec840){logger[_0x2de7('0xf')]('UpdateMailApplication',_0x3c5e34);logger['debug'](_0x2de7('0x1f'),_0x3c5e34,JSON[_0x2de7('0x11')](_0x5ec840));_0x48d18f(_0x5ec840);})['catch'](function(_0x216b14){logger[_0x2de7('0x12')](_0x2de7('0x1f'),_0x216b14[_0x2de7('0x15')],_0x3c5e34);_0xcf3405(_0x764f1b[_0x2de7('0x12')](0x1f4,_0x216b14[_0x2de7('0x15')]));});});};
\ No newline at end of file
+var _0x805b=['UpdateMailApplication','MailApplication','body','options','raw','limit','info','stringify','catch','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x2e8660,_0x5ca0c2){var _0x3dc331=function(_0x20f7c1){while(--_0x20f7c1){_0x2e8660['push'](_0x2e8660['shift']());}};_0x3dc331(++_0x5ca0c2);}(_0x805b,0x159));var _0xb805=function(_0x23b4ab,_0x5e64e9){_0x23b4ab=_0x23b4ab-0x0;var _0x1f0537=_0x805b[_0x23b4ab];return _0x1f0537;};'use strict';var _=require('lodash');var util=require(_0xb805('0x0'));var moment=require('moment');var BPromise=require(_0xb805('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb805('0x2'));var logger=require('../../config/logger')(_0xb805('0x3'));var config=require(_0xb805('0x4'));var jayson=require(_0xb805('0x5'));var client=jayson[_0xb805('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x390759,_0x4fbd33,_0xfd0bd9){return new BPromise(function(_0x228b2e,_0x411c5d){return client['request'](_0x390759,_0xfd0bd9)[_0xb805('0x7')](function(_0x5b4583){logger['info'](_0xb805('0x8'),_0x4fbd33,_0xb805('0x9'));logger[_0xb805('0xa')](_0xb805('0xb'),_0x4fbd33,'request\x20sent',JSON['stringify'](_0x5b4583));if(_0x5b4583['error']){if(_0x5b4583[_0xb805('0xc')]['code']===0x1f4){logger['error'](_0xb805('0x8'),_0x4fbd33,_0x5b4583[_0xb805('0xc')][_0xb805('0xd')]);return _0x411c5d(_0x5b4583[_0xb805('0xc')]['message']);}logger[_0xb805('0xc')](_0xb805('0x8'),_0x4fbd33,_0x5b4583[_0xb805('0xc')]['message']);return _0x228b2e(_0x5b4583[_0xb805('0xc')][_0xb805('0xd')]);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x4fbd33,_0xb805('0x9'));_0x228b2e(_0x5b4583[_0xb805('0xe')][_0xb805('0xd')]);}})['catch'](function(_0xd221ae){logger[_0xb805('0xc')]('MailApplication,\x20%s,\x20%s',_0x4fbd33,_0xd221ae);_0x411c5d(_0xd221ae);});});}exports[_0xb805('0xf')]=function(_0x195ba2){var _0x4091e4=this;return new Promise(function(_0x467a0e,_0x5ec00f){return db[_0xb805('0x10')]['update'](_0x195ba2[_0xb805('0x11')],{'raw':_0x195ba2[_0xb805('0x12')]?_0x195ba2['options'][_0xb805('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x195ba2[_0xb805('0x12')]?_0x195ba2[_0xb805('0x12')]['where']||null:null,'attributes':_0x195ba2[_0xb805('0x12')]?_0x195ba2[_0xb805('0x12')]['attributes']||null:null,'limit':_0x195ba2['options']?_0x195ba2[_0xb805('0x12')][_0xb805('0x14')]||null:null})[_0xb805('0x7')](function(_0x2e27b5){logger[_0xb805('0x15')](_0xb805('0xf'),_0x195ba2);logger[_0xb805('0xa')]('UpdateMailApplication',_0x195ba2,JSON[_0xb805('0x16')](_0x2e27b5));_0x467a0e(_0x2e27b5);})[_0xb805('0x17')](function(_0x32cdb9){logger[_0xb805('0xc')](_0xb805('0xf'),_0x32cdb9[_0xb805('0xd')],_0x195ba2);_0x5ec00f(_0x4091e4[_0xb805('0xc')](0x1f4,_0x32cdb9[_0xb805('0xd')]));});});};
\ No newline at end of file
index aa1d411..d9c1cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe559=['mail','mailinteraction:addtags','addTags','put','/:id','update','delete','mailinteraction:destroy','removeTags','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x4dbc75,_0x385ed7){var _0x309a56=function(_0x3d7795){while(--_0x3d7795){_0x4dbc75['push'](_0x4dbc75['shift']());}};_0x309a56(++_0x385ed7);}(_0xe559,0x1c9));var _0x9e55=function(_0x4f344c,_0x510a88){_0x4f344c=_0x4f344c-0x0;var _0x31b89e=_0xe559[_0x4f344c];return _0x31b89e;};'use strict';var express=require(_0x9e55('0x0'));var router=express['Router']();var auth=require(_0x9e55('0x1'));var interaction=require(_0x9e55('0x2'));var controller=require(_0x9e55('0x3'));router['get']('/',auth[_0x9e55('0x4')](),controller[_0x9e55('0x5')]);router[_0x9e55('0x6')](_0x9e55('0x7'),auth[_0x9e55('0x4')](),controller[_0x9e55('0x8')]);router[_0x9e55('0x6')]('/:id',auth[_0x9e55('0x4')](),controller[_0x9e55('0x9')]);router['get'](_0x9e55('0xa'),auth[_0x9e55('0x4')](),controller[_0x9e55('0xb')]);router[_0x9e55('0x6')](_0x9e55('0xc'),auth[_0x9e55('0x4')](),controller[_0x9e55('0xd')]);router[_0x9e55('0xe')]('/',auth[_0x9e55('0x4')](),controller[_0x9e55('0xf')]);router[_0x9e55('0xe')](_0x9e55('0xa'),auth[_0x9e55('0x4')](),controller[_0x9e55('0x10')]);router[_0x9e55('0xe')](_0x9e55('0x11'),auth['isAuthenticated'](),interaction[_0x9e55('0x12')](_0x9e55('0x13'),_0x9e55('0x14')),controller[_0x9e55('0x15')]);router[_0x9e55('0x16')](_0x9e55('0x17'),auth['isAuthenticated'](),interaction[_0x9e55('0x12')]('mail','mailinteraction:update'),controller[_0x9e55('0x18')]);router[_0x9e55('0x19')](_0x9e55('0x17'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x9e55('0x1a')),controller['destroy']);router[_0x9e55('0x19')](_0x9e55('0x11'),auth[_0x9e55('0x4')](),controller[_0x9e55('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xe580=['delete','removeTags','exports','express','Router','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','addTags','update','mailinteraction:destroy','destroy'];(function(_0x4d1ee2,_0x37b3d4){var _0x22aca9=function(_0x10fc9c){while(--_0x10fc9c){_0x4d1ee2['push'](_0x4d1ee2['shift']());}};_0x22aca9(++_0x37b3d4);}(_0xe580,0x1cb));var _0x0e58=function(_0x1007da,_0x4faa60){_0x1007da=_0x1007da-0x0;var _0x4bbfcc=_0xe580[_0x1007da];return _0x4bbfcc;};'use strict';var express=require(_0x0e58('0x0'));var router=express[_0x0e58('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require('./mailInteraction.controller');router[_0x0e58('0x2')]('/',auth['isAuthenticated'](),controller[_0x0e58('0x3')]);router['get'](_0x0e58('0x4'),auth[_0x0e58('0x5')](),controller[_0x0e58('0x6')]);router[_0x0e58('0x2')](_0x0e58('0x7'),auth[_0x0e58('0x5')](),controller['show']);router[_0x0e58('0x2')](_0x0e58('0x8'),auth[_0x0e58('0x5')](),controller[_0x0e58('0x9')]);router[_0x0e58('0x2')](_0x0e58('0xa'),auth[_0x0e58('0x5')](),controller[_0x0e58('0xb')]);router[_0x0e58('0xc')]('/',auth[_0x0e58('0x5')](),controller['create']);router['post'](_0x0e58('0x8'),auth[_0x0e58('0x5')](),controller[_0x0e58('0xd')]);router[_0x0e58('0xc')](_0x0e58('0xe'),auth['isAuthenticated'](),interaction[_0x0e58('0xf')](_0x0e58('0x10'),'mailinteraction:addtags'),controller[_0x0e58('0x11')]);router['put'](_0x0e58('0x7'),auth[_0x0e58('0x5')](),interaction[_0x0e58('0xf')](_0x0e58('0x10'),'mailinteraction:update'),controller[_0x0e58('0x12')]);router['delete'](_0x0e58('0x7'),auth[_0x0e58('0x5')](),interaction[_0x0e58('0xf')](_0x0e58('0x10'),_0x0e58('0x13')),controller[_0x0e58('0x14')]);router[_0x0e58('0x15')](_0x0e58('0xe'),auth[_0x0e58('0x5')](),controller[_0x0e58('0x16')]);module[_0x0e58('0x17')]=router;
\ No newline at end of file
index 45006b0..a708dfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x871e=['sequelize','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out'];(function(_0x1c7f3a,_0x2ca32e){var _0x51f02e=function(_0x59fa50){while(--_0x59fa50){_0x1c7f3a['push'](_0x1c7f3a['shift']());}};_0x51f02e(++_0x2ca32e);}(_0x871e,0x1b0));var _0xe871=function(_0x55bb17,_0xecb8e6){_0x55bb17=_0x55bb17-0x0;var _0x3a72e8=_0x871e[_0x55bb17];return _0x3a72e8;};'use strict';var Sequelize=require(_0xe871('0x0'));var iconv=require('iconv');module[_0xe871('0x1')]={'closed':{'type':Sequelize[_0xe871('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe871('0x3')]},'disposition':{'type':Sequelize[_0xe871('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xe871('0x4')]},'note':{'type':Sequelize[_0xe871('0x4')]},'inReplyTo':{'type':Sequelize[_0xe871('0x4')](0x1fe)},'to':{'type':Sequelize[_0xe871('0x4')]},'cc':{'type':Sequelize[_0xe871('0x5')](_0xe871('0x6'))},'subject':{'type':Sequelize[_0xe871('0x5')]()},'attach':{'type':Sequelize[_0xe871('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe871('0x3')]},'substatus':{'type':Sequelize[_0xe871('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe871('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe871('0x7')]('in',_0xe871('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xe871('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1f27=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x52d1eb,_0x1c4851){var _0x5ae68c=function(_0x21f800){while(--_0x21f800){_0x52d1eb['push'](_0x52d1eb['shift']());}};_0x5ae68c(++_0x1c4851);}(_0x1f27,0x13d));var _0x71f2=function(_0x391ed9,_0x2eb822){_0x391ed9=_0x391ed9-0x0;var _0xf7734d=_0x1f27[_0x391ed9];return _0xf7734d;};'use strict';var Sequelize=require(_0x71f2('0x0'));var iconv=require(_0x71f2('0x1'));module[_0x71f2('0x2')]={'closed':{'type':Sequelize[_0x71f2('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x71f2('0x4')]},'disposition':{'type':Sequelize[_0x71f2('0x5')]},'secondDisposition':{'type':Sequelize[_0x71f2('0x5')]},'thirdDisposition':{'type':Sequelize[_0x71f2('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x71f2('0x5')]},'cc':{'type':Sequelize[_0x71f2('0x6')](_0x71f2('0x7'))},'subject':{'type':Sequelize[_0x71f2('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x71f2('0x4')]},'substatus':{'type':Sequelize[_0x71f2('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x71f2('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x71f2('0x8')]('in',_0x71f2('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x71f2('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x71f2('0x8')]('in',_0x71f2('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x71f2('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 656234f..603abeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80e6=['findAll','mail','query','catch','model','keys','MailInteraction','filters','intersection','attributes','fields','include','merge','options','create','body','params','destroy','find','describe','addMessage','MailMessage','ids','findOne','length','hasOwnProperty','nolimit','limit','sort','where','MailInteractionId','filter','$gte','split','format','includeAll','inlineCss','true','rows','addTags','setTags','spread','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Attachments','Messages','from','bcc','subject','createdAt','mkdirSync','missing.recipient@your.company.com','headers','basename','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','api','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0x80e6,0x120));var _0x680e=function(_0x42a42c,_0x3a0391){_0x42a42c=_0x42a42c-0x0;var _0x871f2f=_0x80e6[_0x42a42c];return _0x871f2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x680e('0x0'));var zipdir=require('zip-dir');var moment=require(_0x680e('0x1'));var BPromise=require(_0x680e('0x2'));var util=require('util');var path=require(_0x680e('0x3'));var fs=require('fs');var _=require(_0x680e('0x4'));var juice=require(_0x680e('0x5'));var Redis=require(_0x680e('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x680e('0x7'));var logger=require('../../config/logger')(_0x680e('0x8'));var config=require('../../config/environment');var db=require(_0x680e('0x9'))['db'];var htmlEntities=require(_0x680e('0xa'));config[_0x680e('0xb')]=_[_0x680e('0xc')](config[_0x680e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x680e('0xd'))(new Redis(config[_0x680e('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x11bc2f,_0x30b3d7){_0x30b3d7=_0x30b3d7||0xcc;return function(_0x4489c5){if(_0x4489c5){return _0x11bc2f[_0x680e('0xe')](_0x30b3d7);}return _0x11bc2f[_0x680e('0xf')](_0x30b3d7)[_0x680e('0x10')]();};}function respondWithResult(_0x5211cd,_0x193b35){_0x193b35=_0x193b35||0xc8;return function(_0x201be5){if(_0x201be5){return _0x5211cd[_0x680e('0xf')](_0x193b35)[_0x680e('0x11')](_0x201be5);}};}function respondWithFilteredResult(_0x181d2f,_0x25d9d4){return function(_0x6f6c9c){if(_0x6f6c9c){var _0x4d2de2=typeof _0x25d9d4[_0x680e('0x12')]==='undefined'&&typeof _0x25d9d4['limit']===_0x680e('0x13');var _0x45c3dc=_0x6f6c9c[_0x680e('0x14')];var _0x248525=_0x4d2de2?0x0:_0x25d9d4[_0x680e('0x12')];var _0x2e83d9=_0x4d2de2?_0x6f6c9c['count']:_0x25d9d4['offset']+_0x25d9d4['limit'];var _0x1a1469;if(_0x2e83d9>=_0x45c3dc){_0x2e83d9=_0x45c3dc;_0x1a1469=0xc8;}else{_0x1a1469=0xce;}_0x181d2f[_0x680e('0xf')](_0x1a1469);return _0x181d2f[_0x680e('0x15')](_0x680e('0x16'),_0x248525+'-'+_0x2e83d9+'/'+_0x45c3dc)[_0x680e('0x11')](_0x6f6c9c);}return null;};}function saveUpdates(_0x5d97b2){return function(_0x4630b2){if(_0x4630b2){return _0x4630b2[_0x680e('0x17')](_0x5d97b2)[_0x680e('0x18')](function(_0x464441){return _0x464441;});}return null;};}function removeEntity(_0x20a10f){return function(_0x99ba30){if(_0x99ba30){return _0x99ba30['destroy']()[_0x680e('0x18')](function(){_0x20a10f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x19c616){return function(_0x472130){if(!_0x472130){_0x19c616[_0x680e('0xe')](0x194);}return _0x472130;};}function handleError(_0x532785,_0xeec072){_0xeec072=_0xeec072||0x1f4;return function(_0x4d8716){logger[_0x680e('0x19')](_0x4d8716[_0x680e('0x1a')]);if(_0x4d8716[_0x680e('0x1b')]){delete _0x4d8716[_0x680e('0x1b')];}_0x532785[_0x680e('0xf')](_0xeec072)[_0x680e('0x1c')](_0x4d8716);};}exports[_0x680e('0x1d')]=function(_0x57342b,_0x24e12a){var _0x4c5d34={};var _0x31bfeb=_[_0x680e('0x1e')](db['MailInteraction'][_0x680e('0x1f')],function(_0x5c3ce1){return{'name':_0x5c3ce1[_0x680e('0x20')],'type':_0x5c3ce1[_0x680e('0x21')][_0x680e('0x22')]};});_0x4c5d34=qs[_0x680e('0x23')](_0x31bfeb,_0x57342b);return interaction[_0x680e('0x24')](_0x680e('0x25'),_0x57342b[_0x680e('0x26')],_0x57342b['user'],_0x4c5d34,_0x31bfeb)['then'](respondWithFilteredResult(_0x24e12a,_0x4c5d34))[_0x680e('0x27')](handleError(_0x24e12a,null));};exports['show']=function(_0x1568f8,_0x4a63b9){var _0x253a9e={'raw':![],'where':{'id':_0x1568f8['params']['id']}},_0x52a311={};_0x52a311[_0x680e('0x28')]=_[_0x680e('0x29')](db[_0x680e('0x2a')][_0x680e('0x1f')]);_0x52a311[_0x680e('0x26')]=_[_0x680e('0x29')](_0x1568f8[_0x680e('0x26')]);_0x52a311[_0x680e('0x2b')]=_[_0x680e('0x2c')](_0x52a311[_0x680e('0x28')],_0x52a311[_0x680e('0x26')]);_0x253a9e[_0x680e('0x2d')]=_[_0x680e('0x2c')](_0x52a311[_0x680e('0x28')],qs['fields'](_0x1568f8['query'][_0x680e('0x2e')]));_0x253a9e[_0x680e('0x2d')]=_0x253a9e[_0x680e('0x2d')]['length']?_0x253a9e[_0x680e('0x2d')]:_0x52a311['model'];if(_0x1568f8['query']['includeAll']){_0x253a9e[_0x680e('0x2f')]=[{'all':!![]}];}_0x253a9e=_[_0x680e('0x30')]({},_0x253a9e,_0x1568f8[_0x680e('0x31')]);return db[_0x680e('0x2a')]['find'](_0x253a9e)[_0x680e('0x18')](handleEntityNotFound(_0x4a63b9,null))[_0x680e('0x18')](respondWithResult(_0x4a63b9,null))[_0x680e('0x27')](handleError(_0x4a63b9,null));};exports[_0x680e('0x32')]=function(_0x5c8c04,_0x4e7d35){return db[_0x680e('0x2a')]['create'](_0x5c8c04[_0x680e('0x33')],{})[_0x680e('0x18')](respondWithResult(_0x4e7d35,0xc9))[_0x680e('0x27')](handleError(_0x4e7d35,null));};exports['update']=function(_0x410e71,_0x204b8e){if(_0x410e71[_0x680e('0x33')]['id']){delete _0x410e71[_0x680e('0x33')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x410e71[_0x680e('0x34')]['id']}})['then'](handleEntityNotFound(_0x204b8e,null))[_0x680e('0x18')](saveUpdates(_0x410e71[_0x680e('0x33')],null))['then'](respondWithResult(_0x204b8e,null))[_0x680e('0x27')](handleError(_0x204b8e,null));};exports[_0x680e('0x35')]=function(_0x289382,_0x1895a0){return db['MailInteraction'][_0x680e('0x36')]({'where':{'id':_0x289382['params']['id']}})['then'](handleEntityNotFound(_0x1895a0,null))[_0x680e('0x18')](removeEntity(_0x1895a0,null))[_0x680e('0x27')](handleError(_0x1895a0,null));};exports[_0x680e('0x37')]=function(_0x1132e9,_0x26132c){return db[_0x680e('0x2a')]['describe']()[_0x680e('0x18')](respondWithResult(_0x26132c,null))[_0x680e('0x27')](handleError(_0x26132c,null));};exports[_0x680e('0x38')]=function(_0x2bc147,_0x1e0975){return db[_0x680e('0x39')]['find']({'where':{'id':_0x2bc147[_0x680e('0x34')]['id']}})[_0x680e('0x18')](handleEntityNotFound(_0x1e0975,null))['then'](function(_0x24da3d){if(_0x24da3d){return _0x24da3d[_0x680e('0x38')](_0x2bc147[_0x680e('0x33')][_0x680e('0x3a')],_['omit'](_0x2bc147['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x1e0975,null))[_0x680e('0x27')](handleError(_0x1e0975,null));};exports['getMessages']=function(_0x2ecc73,_0x3ba785){var _0x51dd09={'raw':![],'where':{}};var _0x1092fd={};var _0xe02198={'count':0x0,'rows':[]};return db[_0x680e('0x2a')][_0x680e('0x3b')]({'where':{'id':_0x2ecc73[_0x680e('0x34')]['id']}})[_0x680e('0x18')](handleEntityNotFound(_0x3ba785,null))[_0x680e('0x18')](function(_0x4d8b31){if(_0x4d8b31){_0x1092fd[_0x680e('0x28')]=_[_0x680e('0x29')](db[_0x680e('0x39')][_0x680e('0x1f')]);_0x1092fd[_0x680e('0x26')]=_[_0x680e('0x29')](_0x2ecc73['query']);_0x1092fd[_0x680e('0x2b')]=_[_0x680e('0x2c')](_0x1092fd[_0x680e('0x28')],_0x1092fd[_0x680e('0x26')]);_0x51dd09[_0x680e('0x2d')]=_[_0x680e('0x2c')](_0x1092fd[_0x680e('0x28')],qs[_0x680e('0x2e')](_0x2ecc73[_0x680e('0x26')]['fields']));_0x51dd09[_0x680e('0x2d')]=_0x51dd09[_0x680e('0x2d')][_0x680e('0x3c')]?_0x51dd09[_0x680e('0x2d')]:_0x1092fd[_0x680e('0x28')];if(!_0x2ecc73['query'][_0x680e('0x3d')](_0x680e('0x3e'))){_0x51dd09[_0x680e('0x3f')]=qs['limit'](_0x2ecc73[_0x680e('0x26')][_0x680e('0x3f')]);_0x51dd09[_0x680e('0x12')]=qs['offset'](_0x2ecc73[_0x680e('0x26')]['offset']);}_0x51dd09['order']=qs[_0x680e('0x40')](_0x2ecc73['query'][_0x680e('0x40')]);_0x51dd09[_0x680e('0x41')]=qs[_0x680e('0x2b')](_['pick'](_0x2ecc73[_0x680e('0x26')],_0x1092fd['filters']));_0x51dd09[_0x680e('0x41')][_0x680e('0x42')]=_0x4d8b31['id'];if(_0x2ecc73[_0x680e('0x26')][_0x680e('0x43')]){_0x51dd09[_0x680e('0x41')]=_[_0x680e('0x30')](_0x51dd09[_0x680e('0x41')],{'$or':_['map'](_0x51dd09[_0x680e('0x2d')],function(_0x5b8e7d){var _0x1ed61a={};_0x1ed61a[_0x5b8e7d]={'$like':'%'+_0x2ecc73[_0x680e('0x26')][_0x680e('0x43')]+'%'};return _0x1ed61a;})});}if(_0x2ecc73[_0x680e('0x26')][_0x680e('0x44')]){var _0x2caf92=_0x2ecc73[_0x680e('0x26')]['$gte'][_0x680e('0x45')](',');var _0x3420e2={};_0x3420e2[_0x2caf92[0x0]]={'$gte':moment(_0x2caf92[0x1])[_0x680e('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x51dd09['where']=_[_0x680e('0x30')](_0x51dd09['where'],_0x3420e2);}_0x51dd09=_[_0x680e('0x30')]({},_0x51dd09,_0x2ecc73[_0x680e('0x31')]);return db[_0x680e('0x39')]['count']({'where':_0x51dd09[_0x680e('0x41')]})[_0x680e('0x18')](function(_0x1e6dba){_0xe02198[_0x680e('0x14')]=_0x1e6dba;if(_0x2ecc73['query'][_0x680e('0x47')]){_0x51dd09['include']=[{'all':!![]}];}return db[_0x680e('0x39')][_0x680e('0x24')](_0x51dd09);})[_0x680e('0x18')](function(_0x3b1afa){if(_0x2ecc73[_0x680e('0x26')][_0x680e('0x48')]===_0x680e('0x49')){for(var _0x38b869=0x0;_0x38b869<_0x3b1afa['length'];_0x38b869++){_0x3b1afa[_0x38b869]['body']=juice(_0x3b1afa[_0x38b869]['body']);}}_0xe02198[_0x680e('0x4a')]=_0x3b1afa;return _0xe02198;});}})[_0x680e('0x18')](respondWithFilteredResult(_0x3ba785,_0x51dd09))[_0x680e('0x27')](handleError(_0x3ba785,null));};exports[_0x680e('0x4b')]=function(_0x13c1b4,_0x43a600){return db[_0x680e('0x2a')]['find']({'where':{'id':_0x13c1b4[_0x680e('0x34')]['id']}})['then'](handleEntityNotFound(_0x43a600,null))[_0x680e('0x18')](function(_0x1a8896){if(_0x1a8896){return _0x1a8896[_0x680e('0x4c')](_0x13c1b4[_0x680e('0x33')][_0x680e('0x3a')],_['omit'](_0x13c1b4[_0x680e('0x33')],[_0x680e('0x3a'),'id'])||{})[_0x680e('0x4d')](function(){return db['Tag'][_0x680e('0x24')]({'attributes':['id',_0x680e('0x1b'),_0x680e('0x4e')],'where':{'id':_0x13c1b4[_0x680e('0x33')][_0x680e('0x3a')]}});})['then'](function(_0x27e5c4){socket[_0x680e('0x4f')](_0x680e('0x50'),{'id':Number(_0x13c1b4[_0x680e('0x34')]['id']),'tags':_0x27e5c4||[]});return{'id':Number(_0x13c1b4[_0x680e('0x34')]['id']),'tags':_0x27e5c4||[]};});}})[_0x680e('0x18')](respondWithResult(_0x43a600,null))[_0x680e('0x27')](handleError(_0x43a600,null));};exports[_0x680e('0x51')]=function(_0x1cfef5,_0x14ab59){return db['MailInteraction'][_0x680e('0x36')]({'where':{'id':_0x1cfef5[_0x680e('0x34')]['id']}})[_0x680e('0x18')](handleEntityNotFound(_0x14ab59,null))['then'](function(_0x374886){if(_0x374886){return _0x374886[_0x680e('0x51')](_0x1cfef5[_0x680e('0x26')][_0x680e('0x3a')]);}})[_0x680e('0x18')](respondWithStatusCode(_0x14ab59,null))[_0x680e('0x27')](handleError(_0x14ab59,null));};exports[_0x680e('0x52')]=function(_0x2487de,_0x5011a4){var _0x5444a4=moment()[_0x680e('0x53')]()[_0x680e('0x54')]();var _0x117e11=path[_0x680e('0x55')](config[_0x680e('0x56')],_0x680e('0x57'),_0x680e('0x58'),_0x680e('0x59'));var _0x372910=path[_0x680e('0x55')](config[_0x680e('0x56')],_0x680e('0x57'),'files',_0x680e('0x5a'));var _0x4ac10f=path['join'](_0x117e11,_0x5444a4);var _0x246e62=util['format']('transcript-%d-%s.zip',_0x2487de[_0x680e('0x34')]['id'],_0x5444a4);var _0xb72e88=path[_0x680e('0x55')](_0x117e11,_0x246e62);var _0x1ce60b=[];if(_0x2487de[_0x680e('0x26')][_0x680e('0x5a')]){_0x1ce60b[_0x680e('0x5b')]({'model':db[_0x680e('0x5c')],'as':_0x680e('0x5d'),'raw':!![]});}var _0x3aebdb=[{'model':db['MailMessage'],'as':_0x680e('0x5e'),'attributes':['id',_0x680e('0x33'),_0x680e('0x5f'),'to','cc',_0x680e('0x60'),_0x680e('0x61'),_0x680e('0x62')],'where':{'secret':![]},'order':qs[_0x680e('0x40')]('id'),'include':_0x1ce60b}];return db['MailInteraction'][_0x680e('0x36')]({'where':{'id':_0x2487de[_0x680e('0x34')]['id']},'include':_0x3aebdb})[_0x680e('0x18')](handleEntityNotFound(_0x5011a4,null))['then'](function(_0xe340d7){if(_0xe340d7&&_0xe340d7[_0x680e('0x5e')]){var _0x2af460=_0xe340d7['get']({'plain':!![]});fs[_0x680e('0x63')](_0x4ac10f);return BPromise['each'](_0x2af460[_0x680e('0x5e')],function(_0x288d54,_0x223776){var _0x24511b={'from':_0x288d54['from'],'to':_0x288d54['to']||_0x680e('0x64'),'subject':_0x288d54[_0x680e('0x61')],'html':htmlEntities['decode'](_0x288d54['body']),'headers':{'Date':moment(_0x288d54['createdAt'])[_0x680e('0x46')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x288d54['cc']){_0x24511b[_0x680e('0x65')]['Cc']=_0x288d54['cc'];}if(_0x288d54['bcc']){_0x24511b[_0x680e('0x65')]['Bcc']=_0x288d54[_0x680e('0x60')];}return new BPromise(function(_0x4d84c3,_0x2a1adf){if(_0x288d54[_0x680e('0x5d')]){for(var _0x3c6766=0x0;_0x3c6766<_0x288d54[_0x680e('0x5d')][_0x680e('0x3c')];_0x3c6766++){var _0x2de410=_0x288d54[_0x680e('0x5d')][_0x3c6766];var _0x57f2a2=path['join'](_0x372910,_0x2de410[_0x680e('0x66')]);if(fs['existsSync'](_0x57f2a2)){_0x24511b[_0x680e('0x5a')]['push']({'name':_0x2de410[_0x680e('0x1b')],'contentType':_0x2de410[_0x680e('0x21')],'data':fs[_0x680e('0x67')](_0x57f2a2)});}}}emlformat[_0x680e('0x68')](_0x24511b,function(_0x416aa7,_0x109852){if(_0x416aa7)return _0x2a1adf(_0x416aa7);fs[_0x680e('0x69')](path[_0x680e('0x55')](_0x4ac10f,util[_0x680e('0x46')](_0x680e('0x6a'),_0x223776)),_0x109852);return _0x4d84c3(_0x109852);});});})[_0x680e('0x18')](function(){return new BPromise(function(_0x45878f,_0x5c5ad8){zipdir(_0x4ac10f,{'saveTo':_0xb72e88},function(_0x704baa,_0x115113){if(_0x704baa)return _0x5c5ad8(_0x704baa);return _0x45878f(_0x115113);});})[_0x680e('0x18')](function(){return new BPromise(function(_0x4692cd,_0x561db9){rimraf(_0x4ac10f,function(_0x294d16){if(_0x294d16)_0x561db9(_0x294d16);return _0x4692cd();});});})[_0x680e('0x18')](function(){return _0x5011a4[_0x680e('0x52')](_0xb72e88,_0x246e62,function(_0xdd6533){if(!_0xdd6533)fs[_0x680e('0x6b')](_0xb72e88);});});});}else{return _0x5011a4['sendStatus'](0xc8);}})[_0x680e('0x27')](handleError(_0x5011a4,null));};
\ No newline at end of file
+var _0x61a6=['spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','root','files','tmp','attachments','join','transcript-%d-%s.zip','push','Attachment','Messages','from','bcc','subject','createdAt','get','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','sendStatus','eml-format','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','end','json','undefined','limit','count','offset','status','Content-Range','update','then','error','stack','name','send','index','map','MailInteraction','type','key','findAll','mail','query','user','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','find','catch','body','destroy','describe','addMessage','MailMessage','ids','getMessages','findOne','rawAttributes','filters','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','format','true','rows','addTags','omit'];(function(_0x1628b3,_0x5f1805){var _0x4bad95=function(_0x1afa12){while(--_0x1afa12){_0x1628b3['push'](_0x1628b3['shift']());}};_0x4bad95(++_0x5f1805);}(_0x61a6,0x1e8));var _0x661a=function(_0x5d51be,_0x2d1764){_0x5d51be=_0x5d51be-0x0;var _0x5e899d=_0x61a6[_0x5d51be];return _0x5e899d;};'use strict';var emlformat=require(_0x661a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x661a('0x1'));var BPromise=require(_0x661a('0x2'));var util=require(_0x661a('0x3'));var path=require(_0x661a('0x4'));var fs=require('fs');var _=require('lodash');var juice=require('juice');var Redis=require(_0x661a('0x5'));var interaction=require(_0x661a('0x6'));var qs=require(_0x661a('0x7'));var logger=require(_0x661a('0x8'))(_0x661a('0x9'));var config=require(_0x661a('0xa'));var db=require(_0x661a('0xb'))['db'];var htmlEntities=require(_0x661a('0xc'));config['redis']=_[_0x661a('0xd')](config[_0x661a('0xe')],{'host':_0x661a('0xf'),'port':0x18eb});var socket=require(_0x661a('0x10'))(new Redis(config[_0x661a('0xe')]));require(_0x661a('0x11'))['register'](socket);function respondWithStatusCode(_0x285d28,_0x537b13){_0x537b13=_0x537b13||0xcc;return function(_0x3e41de){if(_0x3e41de){return _0x285d28['sendStatus'](_0x537b13);}return _0x285d28['status'](_0x537b13)[_0x661a('0x12')]();};}function respondWithResult(_0x1ef032,_0x2d2960){_0x2d2960=_0x2d2960||0xc8;return function(_0x3c303a){if(_0x3c303a){return _0x1ef032['status'](_0x2d2960)[_0x661a('0x13')](_0x3c303a);}};}function respondWithFilteredResult(_0x2212e0,_0x511d8f){return function(_0x1eb85c){if(_0x1eb85c){var _0x5a2cff=typeof _0x511d8f['offset']===_0x661a('0x14')&&typeof _0x511d8f[_0x661a('0x15')]===_0x661a('0x14');var _0x37beea=_0x1eb85c[_0x661a('0x16')];var _0x545855=_0x5a2cff?0x0:_0x511d8f[_0x661a('0x17')];var _0x1c9030=_0x5a2cff?_0x1eb85c[_0x661a('0x16')]:_0x511d8f[_0x661a('0x17')]+_0x511d8f[_0x661a('0x15')];var _0x1233f;if(_0x1c9030>=_0x37beea){_0x1c9030=_0x37beea;_0x1233f=0xc8;}else{_0x1233f=0xce;}_0x2212e0[_0x661a('0x18')](_0x1233f);return _0x2212e0['set'](_0x661a('0x19'),_0x545855+'-'+_0x1c9030+'/'+_0x37beea)['json'](_0x1eb85c);}return null;};}function saveUpdates(_0x372293){return function(_0x4d1a25){if(_0x4d1a25){return _0x4d1a25[_0x661a('0x1a')](_0x372293)[_0x661a('0x1b')](function(_0x1f1ec9){return _0x1f1ec9;});}return null;};}function removeEntity(_0x2abc3f){return function(_0x586663){if(_0x586663){return _0x586663['destroy']()[_0x661a('0x1b')](function(){_0x2abc3f[_0x661a('0x18')](0xcc)[_0x661a('0x12')]();});}};}function handleEntityNotFound(_0x11b04c){return function(_0x5cad3f){if(!_0x5cad3f){_0x11b04c['sendStatus'](0x194);}return _0x5cad3f;};}function handleError(_0x47a267,_0x3bca59){_0x3bca59=_0x3bca59||0x1f4;return function(_0x439777){logger[_0x661a('0x1c')](_0x439777[_0x661a('0x1d')]);if(_0x439777[_0x661a('0x1e')]){delete _0x439777['name'];}_0x47a267['status'](_0x3bca59)[_0x661a('0x1f')](_0x439777);};}exports[_0x661a('0x20')]=function(_0x1546b0,_0x4a5729){var _0x402330={};var _0x220fed=_[_0x661a('0x21')](db[_0x661a('0x22')]['rawAttributes'],function(_0x4dd609){return{'name':_0x4dd609['fieldName'],'type':_0x4dd609[_0x661a('0x23')][_0x661a('0x24')]};});_0x402330=qs['getOptions'](_0x220fed,_0x1546b0);return interaction[_0x661a('0x25')](_0x661a('0x26'),_0x1546b0[_0x661a('0x27')],_0x1546b0[_0x661a('0x28')],_0x402330,_0x220fed)[_0x661a('0x1b')](respondWithFilteredResult(_0x4a5729,_0x402330))['catch'](handleError(_0x4a5729,null));};exports[_0x661a('0x29')]=function(_0x530932,_0x2951e5){var _0x5ec98f={'raw':![],'where':{'id':_0x530932[_0x661a('0x2a')]['id']}},_0x53cc23={};_0x53cc23[_0x661a('0x2b')]=_[_0x661a('0x2c')](db['MailInteraction']['rawAttributes']);_0x53cc23[_0x661a('0x27')]=_['keys'](_0x530932[_0x661a('0x27')]);_0x53cc23['filters']=_[_0x661a('0x2d')](_0x53cc23[_0x661a('0x2b')],_0x53cc23['query']);_0x5ec98f[_0x661a('0x2e')]=_[_0x661a('0x2d')](_0x53cc23[_0x661a('0x2b')],qs[_0x661a('0x2f')](_0x530932[_0x661a('0x27')][_0x661a('0x2f')]));_0x5ec98f[_0x661a('0x2e')]=_0x5ec98f[_0x661a('0x2e')][_0x661a('0x30')]?_0x5ec98f[_0x661a('0x2e')]:_0x53cc23['model'];if(_0x530932[_0x661a('0x27')][_0x661a('0x31')]){_0x5ec98f['include']=[{'all':!![]}];}_0x5ec98f=_[_0x661a('0x32')]({},_0x5ec98f,_0x530932[_0x661a('0x33')]);return db[_0x661a('0x22')][_0x661a('0x34')](_0x5ec98f)[_0x661a('0x1b')](handleEntityNotFound(_0x2951e5,null))[_0x661a('0x1b')](respondWithResult(_0x2951e5,null))[_0x661a('0x35')](handleError(_0x2951e5,null));};exports['create']=function(_0x545708,_0x8398e4){return db[_0x661a('0x22')]['create'](_0x545708[_0x661a('0x36')],{})[_0x661a('0x1b')](respondWithResult(_0x8398e4,0xc9))[_0x661a('0x35')](handleError(_0x8398e4,null));};exports[_0x661a('0x1a')]=function(_0x158bdf,_0x1437c9){if(_0x158bdf[_0x661a('0x36')]['id']){delete _0x158bdf[_0x661a('0x36')]['id'];}return db['MailInteraction'][_0x661a('0x34')]({'where':{'id':_0x158bdf[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x1437c9,null))[_0x661a('0x1b')](saveUpdates(_0x158bdf['body'],null))[_0x661a('0x1b')](respondWithResult(_0x1437c9,null))[_0x661a('0x35')](handleError(_0x1437c9,null));};exports[_0x661a('0x37')]=function(_0x4428fd,_0x518275){return db['MailInteraction'][_0x661a('0x34')]({'where':{'id':_0x4428fd[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x518275,null))['then'](removeEntity(_0x518275,null))[_0x661a('0x35')](handleError(_0x518275,null));};exports['describe']=function(_0x3ac0e3,_0x3ff16b){return db[_0x661a('0x22')][_0x661a('0x38')]()['then'](respondWithResult(_0x3ff16b,null))[_0x661a('0x35')](handleError(_0x3ff16b,null));};exports[_0x661a('0x39')]=function(_0x52430f,_0x227b57){return db[_0x661a('0x3a')][_0x661a('0x34')]({'where':{'id':_0x52430f['params']['id']}})['then'](handleEntityNotFound(_0x227b57,null))[_0x661a('0x1b')](function(_0x27e9ce){if(_0x27e9ce){return _0x27e9ce['addMessage'](_0x52430f['body'][_0x661a('0x3b')],_['omit'](_0x52430f[_0x661a('0x36')],[_0x661a('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x227b57,null))[_0x661a('0x35')](handleError(_0x227b57,null));};exports[_0x661a('0x3c')]=function(_0x1ef6e5,_0x2c6977){var _0x2891f9={'raw':![],'where':{}};var _0x47ae63={};var _0x338258={'count':0x0,'rows':[]};return db['MailInteraction'][_0x661a('0x3d')]({'where':{'id':_0x1ef6e5[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x2c6977,null))[_0x661a('0x1b')](function(_0x17a139){if(_0x17a139){_0x47ae63[_0x661a('0x2b')]=_[_0x661a('0x2c')](db['MailMessage'][_0x661a('0x3e')]);_0x47ae63['query']=_['keys'](_0x1ef6e5[_0x661a('0x27')]);_0x47ae63[_0x661a('0x3f')]=_['intersection'](_0x47ae63[_0x661a('0x2b')],_0x47ae63[_0x661a('0x27')]);_0x2891f9[_0x661a('0x2e')]=_[_0x661a('0x2d')](_0x47ae63[_0x661a('0x2b')],qs[_0x661a('0x2f')](_0x1ef6e5[_0x661a('0x27')][_0x661a('0x2f')]));_0x2891f9[_0x661a('0x2e')]=_0x2891f9['attributes']['length']?_0x2891f9['attributes']:_0x47ae63[_0x661a('0x2b')];if(!_0x1ef6e5[_0x661a('0x27')]['hasOwnProperty'](_0x661a('0x40'))){_0x2891f9[_0x661a('0x15')]=qs[_0x661a('0x15')](_0x1ef6e5[_0x661a('0x27')]['limit']);_0x2891f9[_0x661a('0x17')]=qs['offset'](_0x1ef6e5[_0x661a('0x27')][_0x661a('0x17')]);}_0x2891f9[_0x661a('0x41')]=qs[_0x661a('0x42')](_0x1ef6e5[_0x661a('0x27')][_0x661a('0x42')]);_0x2891f9['where']=qs['filters'](_['pick'](_0x1ef6e5[_0x661a('0x27')],_0x47ae63[_0x661a('0x3f')]));_0x2891f9[_0x661a('0x43')][_0x661a('0x44')]=_0x17a139['id'];if(_0x1ef6e5[_0x661a('0x27')][_0x661a('0x45')]){_0x2891f9[_0x661a('0x43')]=_[_0x661a('0x32')](_0x2891f9[_0x661a('0x43')],{'$or':_[_0x661a('0x21')](_0x2891f9[_0x661a('0x2e')],function(_0x158f55){var _0x3bf441={};_0x3bf441[_0x158f55]={'$like':'%'+_0x1ef6e5[_0x661a('0x27')][_0x661a('0x45')]+'%'};return _0x3bf441;})});}if(_0x1ef6e5[_0x661a('0x27')][_0x661a('0x46')]){var _0x5db005=_0x1ef6e5[_0x661a('0x27')][_0x661a('0x46')][_0x661a('0x47')](',');var _0x240d4e={};_0x240d4e[_0x5db005[0x0]]={'$gte':moment(_0x5db005[0x1])[_0x661a('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2891f9[_0x661a('0x43')]=_['merge'](_0x2891f9[_0x661a('0x43')],_0x240d4e);}_0x2891f9=_['merge']({},_0x2891f9,_0x1ef6e5['options']);return db['MailMessage'][_0x661a('0x16')]({'where':_0x2891f9[_0x661a('0x43')]})[_0x661a('0x1b')](function(_0x56e13d){_0x338258[_0x661a('0x16')]=_0x56e13d;if(_0x1ef6e5['query'][_0x661a('0x31')]){_0x2891f9['include']=[{'all':!![]}];}return db[_0x661a('0x3a')]['findAll'](_0x2891f9);})[_0x661a('0x1b')](function(_0x165705){if(_0x1ef6e5[_0x661a('0x27')]['inlineCss']===_0x661a('0x49')){for(var _0x5d7b71=0x0;_0x5d7b71<_0x165705[_0x661a('0x30')];_0x5d7b71++){_0x165705[_0x5d7b71][_0x661a('0x36')]=juice(_0x165705[_0x5d7b71]['body']);}}_0x338258[_0x661a('0x4a')]=_0x165705;return _0x338258;});}})['then'](respondWithFilteredResult(_0x2c6977,_0x2891f9))['catch'](handleError(_0x2c6977,null));};exports[_0x661a('0x4b')]=function(_0x25864d,_0x5c289d){return db[_0x661a('0x22')][_0x661a('0x34')]({'where':{'id':_0x25864d[_0x661a('0x2a')]['id']}})[_0x661a('0x1b')](handleEntityNotFound(_0x5c289d,null))[_0x661a('0x1b')](function(_0x565267){if(_0x565267){return _0x565267['setTags'](_0x25864d[_0x661a('0x36')][_0x661a('0x3b')],_[_0x661a('0x4c')](_0x25864d[_0x661a('0x36')],[_0x661a('0x3b'),'id'])||{})[_0x661a('0x4d')](function(){return db[_0x661a('0x4e')][_0x661a('0x25')]({'attributes':['id',_0x661a('0x1e'),_0x661a('0x4f')],'where':{'id':_0x25864d[_0x661a('0x36')][_0x661a('0x3b')]}});})[_0x661a('0x1b')](function(_0x4725c0){socket[_0x661a('0x50')](_0x661a('0x51'),{'id':Number(_0x25864d[_0x661a('0x2a')]['id']),'tags':_0x4725c0||[]});return{'id':Number(_0x25864d[_0x661a('0x2a')]['id']),'tags':_0x4725c0||[]};});}})[_0x661a('0x1b')](respondWithResult(_0x5c289d,null))['catch'](handleError(_0x5c289d,null));};exports[_0x661a('0x52')]=function(_0x45e213,_0x50ddb0){return db[_0x661a('0x22')]['find']({'where':{'id':_0x45e213['params']['id']}})['then'](handleEntityNotFound(_0x50ddb0,null))[_0x661a('0x1b')](function(_0x48911f){if(_0x48911f){return _0x48911f['removeTags'](_0x45e213['query'][_0x661a('0x3b')]);}})[_0x661a('0x1b')](respondWithStatusCode(_0x50ddb0,null))[_0x661a('0x35')](handleError(_0x50ddb0,null));};exports[_0x661a('0x53')]=function(_0x207c97,_0x331158){var _0x27d835=moment()['unix']()[_0x661a('0x54')]();var _0x572ef0=path['join'](config[_0x661a('0x55')],'server',_0x661a('0x56'),_0x661a('0x57'));var _0x152094=path['join'](config[_0x661a('0x55')],'server',_0x661a('0x56'),_0x661a('0x58'));var _0x26fa75=path[_0x661a('0x59')](_0x572ef0,_0x27d835);var _0x256ef6=util[_0x661a('0x48')](_0x661a('0x5a'),_0x207c97[_0x661a('0x2a')]['id'],_0x27d835);var _0x543b48=path['join'](_0x572ef0,_0x256ef6);var _0x86f12b=[];if(_0x207c97[_0x661a('0x27')][_0x661a('0x58')]){_0x86f12b[_0x661a('0x5b')]({'model':db[_0x661a('0x5c')],'as':'Attachments','raw':!![]});}var _0x3b142d=[{'model':db[_0x661a('0x3a')],'as':_0x661a('0x5d'),'attributes':['id',_0x661a('0x36'),_0x661a('0x5e'),'to','cc',_0x661a('0x5f'),_0x661a('0x60'),_0x661a('0x61')],'where':{'secret':![]},'order':qs[_0x661a('0x42')]('id'),'include':_0x86f12b}];return db[_0x661a('0x22')][_0x661a('0x34')]({'where':{'id':_0x207c97[_0x661a('0x2a')]['id']},'include':_0x3b142d})[_0x661a('0x1b')](handleEntityNotFound(_0x331158,null))[_0x661a('0x1b')](function(_0x2a3d68){if(_0x2a3d68&&_0x2a3d68[_0x661a('0x5d')]){var _0x441aab=_0x2a3d68[_0x661a('0x62')]({'plain':!![]});fs['mkdirSync'](_0x26fa75);return BPromise[_0x661a('0x63')](_0x441aab[_0x661a('0x5d')],function(_0x2e3645,_0x56ba97){var _0x288b1a={'from':_0x2e3645[_0x661a('0x5e')],'to':_0x2e3645['to']||_0x661a('0x64'),'subject':_0x2e3645[_0x661a('0x60')],'html':htmlEntities[_0x661a('0x65')](_0x2e3645[_0x661a('0x36')]),'headers':{'Date':moment(_0x2e3645[_0x661a('0x61')])[_0x661a('0x48')](_0x661a('0x66'))},'attachments':[]};if(_0x2e3645['cc']){_0x288b1a[_0x661a('0x67')]['Cc']=_0x2e3645['cc'];}if(_0x2e3645['bcc']){_0x288b1a['headers'][_0x661a('0x68')]=_0x2e3645['bcc'];}return new BPromise(function(_0x240d11,_0x4b9472){if(_0x2e3645['Attachments']){for(var _0x283f6c=0x0;_0x283f6c<_0x2e3645[_0x661a('0x69')]['length'];_0x283f6c++){var _0x332fa5=_0x2e3645[_0x661a('0x69')][_0x283f6c];var _0x248cbf=path[_0x661a('0x59')](_0x152094,_0x332fa5[_0x661a('0x6a')]);if(fs[_0x661a('0x6b')](_0x248cbf)){_0x288b1a[_0x661a('0x58')][_0x661a('0x5b')]({'name':_0x332fa5[_0x661a('0x1e')],'contentType':_0x332fa5[_0x661a('0x23')],'data':fs['readFileSync'](_0x248cbf)});}}}emlformat[_0x661a('0x6c')](_0x288b1a,function(_0x316910,_0x248292){if(_0x316910)return _0x4b9472(_0x316910);fs[_0x661a('0x6d')](path[_0x661a('0x59')](_0x26fa75,util[_0x661a('0x48')](_0x661a('0x6e'),_0x56ba97)),_0x248292);return _0x240d11(_0x248292);});});})[_0x661a('0x1b')](function(){return new BPromise(function(_0x333b6a,_0x44d758){zipdir(_0x26fa75,{'saveTo':_0x543b48},function(_0x3e0099,_0x17e1d2){if(_0x3e0099)return _0x44d758(_0x3e0099);return _0x333b6a(_0x17e1d2);});})[_0x661a('0x1b')](function(){return new BPromise(function(_0x1b7d66,_0x4dd282){rimraf(_0x26fa75,function(_0x61bee){if(_0x61bee)_0x4dd282(_0x61bee);return _0x1b7d66();});});})[_0x661a('0x1b')](function(){return _0x331158[_0x661a('0x53')](_0x543b48,_0x256ef6,function(_0x5d7292){if(!_0x5d7292)fs[_0x661a('0x6f')](_0x543b48);});});});}else{return _0x331158[_0x661a('0x70')](0xc8);}})[_0x661a('0x35')](handleError(_0x331158,null));};
\ No newline at end of file
index 468a01f..c43f7c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b7f=['catch','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','then','setDataValue','map','findAll','length','emit'];(function(_0x4db098,_0x2272b1){var _0x941ba2=function(_0x4e2593){while(--_0x4e2593){_0x4db098['push'](_0x4db098['shift']());}};_0x941ba2(++_0x2272b1);}(_0x6b7f,0x64));var _0xf6b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b7f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xf6b7('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xf6b7('0x0'))['db'][_0xf6b7('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf6b7('0x2')](0x0);var events={'afterCreate':_0xf6b7('0x3'),'afterUpdate':_0xf6b7('0x4'),'afterDestroy':_0xf6b7('0x5')};function emitEvent(_0x1ebbef){return function(_0x2abdfa,_0x5df4d1,_0x10bcc5){_0x2abdfa['getUsers']({'attributes':['id'],'raw':!![]})[_0xf6b7('0x6')](function(_0x2b15f9){_0x2abdfa[_0xf6b7('0x7')]('Users',_0x2b15f9[_0xf6b7('0x8')](function(_0x5231b2){return{'id':_0x5231b2['id']};}));return MailMessage[_0xf6b7('0x9')]({'where':{'MailInteractionId':_0x2abdfa['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2639ed){_0x2abdfa[_0xf6b7('0x7')]('unreadMessages',_0x2639ed[_0xf6b7('0xa')]);MailInteractionEvents[_0xf6b7('0xb')](_0x1ebbef+':'+_0x2abdfa['id'],_0x2abdfa);MailInteractionEvents['emit'](_0x1ebbef,_0x2abdfa);_0x10bcc5(null);})[_0xf6b7('0xc')](_0x10bcc5(null));};}for(var e in events){if(events[_0xf6b7('0xd')](e)){var event=events[e];MailInteraction[_0xf6b7('0xe')](e,emitEvent(event));}}module[_0xf6b7('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0xbe1d=['getUsers','Users','map','findAll','then','setDataValue','emit','hasOwnProperty','hook','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe1d,0xcc));var _0xdbe1=function(_0x386408,_0x584c61){_0x386408=_0x386408-0x0;var _0xedb599=_0xbe1d[_0x386408];return _0xedb599;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xdbe1('0x0'))['db'][_0xdbe1('0x1')];var MailMessage=require(_0xdbe1('0x0'))['db'][_0xdbe1('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xdbe1('0x3')](0x0);var events={'afterCreate':_0xdbe1('0x4'),'afterUpdate':_0xdbe1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x50f79e){return function(_0x204bee,_0x31cb66,_0x303bd0){_0x204bee[_0xdbe1('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0xafee6c){_0x204bee['setDataValue'](_0xdbe1('0x7'),_0xafee6c[_0xdbe1('0x8')](function(_0x3d4a1c){return{'id':_0x3d4a1c['id']};}));return MailMessage[_0xdbe1('0x9')]({'where':{'MailInteractionId':_0x204bee['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdbe1('0xa')](function(_0x1405be){_0x204bee[_0xdbe1('0xb')]('unreadMessages',_0x1405be['length']);MailInteractionEvents[_0xdbe1('0xc')](_0x50f79e+':'+_0x204bee['id'],_0x204bee);MailInteractionEvents[_0xdbe1('0xc')](_0x50f79e,_0x204bee);_0x303bd0(null);})['catch'](_0x303bd0(null));};}for(var e in events){if(events[_0xdbe1('0xd')](e)){var event=events[e];MailInteraction[_0xdbe1('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index 5114c6c..b6b72ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aaf=['substatusAt','models','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x7aaf,0x11a));var _0xf7aa=function(_0x324392,_0x2dfc37){_0x324392=_0x324392-0x0;var _0x4557eb=_0x7aaf[_0x324392];return _0x4557eb;};'use strict';var _=require(_0xf7aa('0x0'));var util=require(_0xf7aa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf7aa('0x2'));var BPromise=require(_0xf7aa('0x3'));var rp=require(_0xf7aa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf7aa('0x5'));var attributes=require(_0xf7aa('0x6'));module['exports']=function(_0x38a8ed,_0x3b7810){return _0x38a8ed['define'](_0xf7aa('0x7'),attributes,{'tableName':_0xf7aa('0x8'),'paranoid':![],'indexes':[{'name':_0xf7aa('0x9'),'fields':[_0xf7aa('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x16f624,_0x55b2d9,_0x1da5fb){if(_0x16f624['substatus']){_0x16f624['substatusAt']=moment()[_0xf7aa('0xb')](_0xf7aa('0xc'));}if(_0x16f624[_0xf7aa('0xd')]){_0x16f624[_0xf7aa('0xe')]=moment()['format'](_0xf7aa('0xc'));}_0x1da5fb(null,_0x55b2d9);},'beforeUpdate':function(_0x313c74,_0x5b142e,_0x455779){if(_0x313c74[_0xf7aa('0xf')](_0xf7aa('0x10'))){_0x313c74[_0xf7aa('0x11')]=_0x313c74['substatus']?moment()[_0xf7aa('0xb')](_0xf7aa('0xc')):null;}if(_0x313c74[_0xf7aa('0xf')]('closed')){_0x313c74[_0xf7aa('0xe')]=moment()['format'](_0xf7aa('0xc'));_0x313c74[_0xf7aa('0x10')]=null;_0x313c74[_0xf7aa('0x11')]=null;}_0x455779(null,_0x313c74);},'afterUpdate':function(_0x5abd5a,_0x3a0b85,_0x40d155){var _0x2bcf66=_0x38a8ed[_0xf7aa('0x12')];var _0x28e8a1=_0x5abd5a['get']({'plain':!![]});if(_0x28e8a1['closed']){return _0x2bcf66['MailMessage'][_0xf7aa('0x13')]({'read':!![]},{'where':{'MailInteractionId':_0x28e8a1['id']}})['then'](function(){_0x40d155();})[_0xf7aa('0x14')](function(_0x3f3e2a){_0x40d155(_0x3f3e2a);});}else{_0x40d155();}}},'charset':_0xf7aa('0x15'),'collate':_0xf7aa('0x16')});};
\ No newline at end of file
+var _0xe32b=['define','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatusAt','changed','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','request-promise','path','rimraf','./mailInteraction.attributes','exports'];(function(_0xeb53a2,_0x1f3b36){var _0x33fa4e=function(_0x5366a4){while(--_0x5366a4){_0xeb53a2['push'](_0xeb53a2['shift']());}};_0x33fa4e(++_0x1f3b36);}(_0xe32b,0x16f));var _0xbe32=function(_0x18089b,_0x5ca656){_0x18089b=_0x18089b-0x0;var _0xad8fdd=_0xe32b[_0x18089b];return _0xad8fdd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbe32('0x0'))(_0xbe32('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbe32('0x2'));var fs=require('fs');var path=require(_0xbe32('0x3'));var rimraf=require(_0xbe32('0x4'));var config=require('../../config/environment');var attributes=require(_0xbe32('0x5'));module[_0xbe32('0x6')]=function(_0x3bb5b8,_0x5b68c0){return _0x3bb5b8[_0xbe32('0x7')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0xbe32('0x8')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e0680,_0x1a8225,_0x128d3b){if(_0x5e0680[_0xbe32('0x9')]){_0x5e0680['substatusAt']=moment()[_0xbe32('0xa')](_0xbe32('0xb'));}if(_0x5e0680[_0xbe32('0xc')]){_0x5e0680[_0xbe32('0xd')]=moment()[_0xbe32('0xa')](_0xbe32('0xb'));}_0x128d3b(null,_0x1a8225);},'beforeUpdate':function(_0x11a481,_0x347227,_0x5f2ad6){if(_0x11a481['changed'](_0xbe32('0x9'))){_0x11a481[_0xbe32('0xe')]=_0x11a481[_0xbe32('0x9')]?moment()[_0xbe32('0xa')](_0xbe32('0xb')):null;}if(_0x11a481[_0xbe32('0xf')](_0xbe32('0xc'))){_0x11a481[_0xbe32('0xd')]=moment()['format'](_0xbe32('0xb'));_0x11a481[_0xbe32('0x9')]=null;_0x11a481[_0xbe32('0xe')]=null;}_0x5f2ad6(null,_0x11a481);},'afterUpdate':function(_0x270a62,_0x1912af,_0x1e7b42){var _0x5dffeb=_0x3bb5b8[_0xbe32('0x10')];var _0x4a1a07=_0x270a62['get']({'plain':!![]});if(_0x4a1a07[_0xbe32('0xc')]){return _0x5dffeb[_0xbe32('0x11')][_0xbe32('0x12')]({'read':!![]},{'where':{'MailInteractionId':_0x4a1a07['id']}})['then'](function(){_0x1e7b42();})[_0xbe32('0x13')](function(_0x296de9){_0x1e7b42(_0x296de9);});}else{_0x1e7b42();}}},'charset':_0xbe32('0x14'),'collate':_0xbe32('0x15')});};
\ No newline at end of file
index 801a46f..bdf2f05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4649=['omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','AddTagsToMailInteraction','find','addTags'];(function(_0x4ba0ef,_0x23d774){var _0x2465fc=function(_0x2d840a){while(--_0x2d840a){_0x4ba0ef['push'](_0x4ba0ef['shift']());}};_0x2465fc(++_0x23d774);}(_0x4649,0x199));var _0x9464=function(_0x222043,_0x4e436d){_0x222043=_0x222043-0x0;var _0xfbe4b3=_0x4649[_0x222043];return _0xfbe4b3;};'use strict';var _=require(_0x9464('0x0'));var util=require('util');var moment=require(_0x9464('0x1'));var BPromise=require(_0x9464('0x2'));var rs=require(_0x9464('0x3'));var fs=require('fs');var Redis=require(_0x9464('0x4'));var db=require(_0x9464('0x5'))['db'];var utils=require(_0x9464('0x6'));var logger=require(_0x9464('0x7'))('rpc');var config=require(_0x9464('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9464('0x9')][_0x9464('0xa')]({'port':0x232a});config[_0x9464('0xb')]=_[_0x9464('0xc')](config['redis'],{'host':_0x9464('0xd'),'port':0x18eb});var socket=require(_0x9464('0xe'))(new Redis(config[_0x9464('0xb')]));require(_0x9464('0xf'))[_0x9464('0x10')](socket);function respondWithRpcPromise(_0x5d850a,_0x2480cb,_0x5a4436){return new BPromise(function(_0x1dc525,_0x13bef3){return client[_0x9464('0x11')](_0x5d850a,_0x5a4436)[_0x9464('0x12')](function(_0x7c211d){logger[_0x9464('0x13')]('MailInteraction,\x20%s,\x20%s',_0x2480cb,_0x9464('0x14'));logger[_0x9464('0x15')](_0x9464('0x16'),_0x2480cb,_0x9464('0x14'),JSON[_0x9464('0x17')](_0x7c211d));if(_0x7c211d['error']){if(_0x7c211d[_0x9464('0x18')][_0x9464('0x19')]===0x1f4){logger[_0x9464('0x18')](_0x9464('0x1a'),_0x2480cb,_0x7c211d[_0x9464('0x18')][_0x9464('0x1b')]);return _0x13bef3(_0x7c211d['error']['message']);}logger['error'](_0x9464('0x1a'),_0x2480cb,_0x7c211d['error']['message']);return _0x1dc525(_0x7c211d['error'][_0x9464('0x1b')]);}else{logger[_0x9464('0x13')](_0x9464('0x1a'),_0x2480cb,_0x9464('0x14'));_0x1dc525(_0x7c211d[_0x9464('0x1c')][_0x9464('0x1b')]);}})[_0x9464('0x1d')](function(_0x588430){logger[_0x9464('0x18')](_0x9464('0x1a'),_0x2480cb,_0x588430);_0x13bef3(_0x588430);});});}exports[_0x9464('0x1e')]=function(_0x11e019){var _0x427ed7=this;return new Promise(function(_0xf0eca5,_0x2ce7e6){return db[_0x9464('0x1f')][_0x9464('0x20')](_0x11e019[_0x9464('0x21')],{'raw':_0x11e019[_0x9464('0x22')]?_0x11e019['options'][_0x9464('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11e019['options']?_0x11e019[_0x9464('0x22')][_0x9464('0x24')]||null:null,'attributes':_0x11e019[_0x9464('0x22')]?_0x11e019[_0x9464('0x22')]['attributes']||null:null,'limit':_0x11e019['options']?_0x11e019[_0x9464('0x22')][_0x9464('0x25')]||null:null})[_0x9464('0x12')](function(_0x1f1b0c){logger[_0x9464('0x13')](_0x9464('0x1e'),_0x11e019);logger[_0x9464('0x15')](_0x9464('0x1e'),_0x11e019,JSON[_0x9464('0x17')](_0x1f1b0c));_0xf0eca5(_0x1f1b0c);})['catch'](function(_0x5549f0){logger[_0x9464('0x18')](_0x9464('0x1e'),_0x5549f0['message'],_0x11e019);_0x2ce7e6(_0x427ed7[_0x9464('0x18')](0x1f4,_0x5549f0['message']));});});};exports[_0x9464('0x26')]=function(_0xf82f6c){return new Promise(function(_0x321a8a,_0x37a1e2){return db[_0x9464('0x1f')][_0x9464('0x27')]({'where':_0xf82f6c[_0x9464('0x22')]?_0xf82f6c[_0x9464('0x22')][_0x9464('0x24')]||null:null})[_0x9464('0x12')](function(_0x2c0e07){if(_0x2c0e07){return _0x2c0e07[_0x9464('0x28')](_0xf82f6c[_0x9464('0x21')]['ids'],_[_0x9464('0x29')](_0xf82f6c[_0x9464('0x21')],[_0x9464('0x2a'),'id'])||{});}})[_0x9464('0x2b')](function(_0x38c5ac){logger[_0x9464('0x13')](_0x9464('0x2c'),_0xf82f6c);logger[_0x9464('0x15')](_0x9464('0x2c'),_0xf82f6c,JSON[_0x9464('0x17')](_0x38c5ac));_0x321a8a(_0x38c5ac);})[_0x9464('0x1d')](function(_0x120fe3){logger[_0x9464('0x18')](_0x9464('0x2c'),_0x120fe3[_0x9464('0x1b')],_0xf82f6c);_0x37a1e2(_this[_0x9464('0x18')](0x1f4,_0x120fe3[_0x9464('0x1b')]));});});};
\ No newline at end of file
+var _0x6011=['catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','AddTagsToMailInteraction','find','where','then','addTags','ids','omit','spread','AddTags','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x6011,0x196));var _0x1601=function(_0x49fdcb,_0x15df2d){_0x49fdcb=_0x49fdcb-0x0;var _0x5f463b=_0x6011[_0x49fdcb];return _0x5f463b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1601('0x0'));var db=require(_0x1601('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x1601('0x2'))(_0x1601('0x3'));var config=require(_0x1601('0x4'));var jayson=require(_0x1601('0x5'));var client=jayson[_0x1601('0x6')][_0x1601('0x7')]({'port':0x232a});config[_0x1601('0x8')]=_[_0x1601('0x9')](config[_0x1601('0x8')],{'host':_0x1601('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1601('0x8')]));require(_0x1601('0xb'))[_0x1601('0xc')](socket);function respondWithRpcPromise(_0x25b02d,_0x33def1,_0x58f45f){return new BPromise(function(_0x4dc693,_0x57e18a){return client[_0x1601('0xd')](_0x25b02d,_0x58f45f)['then'](function(_0x1d42b1){logger[_0x1601('0xe')](_0x1601('0xf'),_0x33def1,_0x1601('0x10'));logger[_0x1601('0x11')](_0x1601('0x12'),_0x33def1,_0x1601('0x10'),JSON[_0x1601('0x13')](_0x1d42b1));if(_0x1d42b1['error']){if(_0x1d42b1[_0x1601('0x14')]['code']===0x1f4){logger[_0x1601('0x14')]('MailInteraction,\x20%s,\x20%s',_0x33def1,_0x1d42b1[_0x1601('0x14')][_0x1601('0x15')]);return _0x57e18a(_0x1d42b1['error'][_0x1601('0x15')]);}logger[_0x1601('0x14')](_0x1601('0xf'),_0x33def1,_0x1d42b1['error']['message']);return _0x4dc693(_0x1d42b1[_0x1601('0x14')][_0x1601('0x15')]);}else{logger[_0x1601('0xe')](_0x1601('0xf'),_0x33def1,_0x1601('0x10'));_0x4dc693(_0x1d42b1[_0x1601('0x16')][_0x1601('0x15')]);}})[_0x1601('0x17')](function(_0x1ce2b2){logger['error']('MailInteraction,\x20%s,\x20%s',_0x33def1,_0x1ce2b2);_0x57e18a(_0x1ce2b2);});});}exports[_0x1601('0x18')]=function(_0x1ce486){var _0xb09057=this;return new Promise(function(_0x5bd8fb,_0x2c3b5d){return db[_0x1601('0x19')][_0x1601('0x1a')](_0x1ce486[_0x1601('0x1b')],{'raw':_0x1ce486[_0x1601('0x1c')]?_0x1ce486['options'][_0x1601('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ce486[_0x1601('0x1c')]?_0x1ce486[_0x1601('0x1c')]['where']||null:null,'attributes':_0x1ce486[_0x1601('0x1c')]?_0x1ce486[_0x1601('0x1c')]['attributes']||null:null,'limit':_0x1ce486[_0x1601('0x1c')]?_0x1ce486[_0x1601('0x1c')]['limit']||null:null})['then'](function(_0x65fb4f){logger[_0x1601('0xe')](_0x1601('0x18'),_0x1ce486);logger['debug'](_0x1601('0x18'),_0x1ce486,JSON[_0x1601('0x13')](_0x65fb4f));_0x5bd8fb(_0x65fb4f);})[_0x1601('0x17')](function(_0x250fcc){logger[_0x1601('0x14')]('UpdateMailInteraction',_0x250fcc['message'],_0x1ce486);_0x2c3b5d(_0xb09057[_0x1601('0x14')](0x1f4,_0x250fcc[_0x1601('0x15')]));});});};exports[_0x1601('0x1e')]=function(_0x4ee7b1){return new Promise(function(_0x2b55e1,_0x57eb42){return db[_0x1601('0x19')][_0x1601('0x1f')]({'where':_0x4ee7b1[_0x1601('0x1c')]?_0x4ee7b1['options'][_0x1601('0x20')]||null:null})[_0x1601('0x21')](function(_0x33b358){if(_0x33b358){return _0x33b358[_0x1601('0x22')](_0x4ee7b1['body'][_0x1601('0x23')],_[_0x1601('0x24')](_0x4ee7b1[_0x1601('0x1b')],[_0x1601('0x23'),'id'])||{});}})[_0x1601('0x25')](function(_0x2ad13d){logger[_0x1601('0xe')](_0x1601('0x26'),_0x4ee7b1);logger[_0x1601('0x11')](_0x1601('0x26'),_0x4ee7b1,JSON[_0x1601('0x13')](_0x2ad13d));_0x2b55e1(_0x2ad13d);})[_0x1601('0x17')](function(_0x274da8){logger['error'](_0x1601('0x26'),_0x274da8[_0x1601('0x15')],_0x4ee7b1);_0x57eb42(_this[_0x1601('0x14')](0x1f4,_0x274da8[_0x1601('0x15')]));});});};
\ No newline at end of file
index 6d3bf67..5b9a7ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09d8=['register','length','mailInteraction:','./mailInteraction.events','update'];(function(_0x533a4f,_0x4b9ddc){var _0x32fd1e=function(_0x373f64){while(--_0x373f64){_0x533a4f['push'](_0x533a4f['shift']());}};_0x32fd1e(++_0x4b9ddc);}(_0x09d8,0x12f));var _0x809d=function(_0x3f3663,_0xa80fa8){_0x3f3663=_0x3f3663-0x0;var _0x3b9dd0=_0x09d8[_0x3f3663];return _0x3b9dd0;};'use strict';var MailInteractionEvents=require(_0x809d('0x0'));var events=['save','remove',_0x809d('0x1')];function createListener(_0x425182,_0x474d96){return function(_0x1a85dc){_0x474d96['emit'](_0x425182,_0x1a85dc);};}function removeListener(_0x585699,_0x5814ae){return function(){MailInteractionEvents['removeListener'](_0x585699,_0x5814ae);};}exports[_0x809d('0x2')]=function(_0x555bf7){for(var _0x4655be=0x0,_0xce8bd9=events[_0x809d('0x3')];_0x4655be<_0xce8bd9;_0x4655be++){var _0x3cb42c=events[_0x4655be];var _0x1e21c6=createListener(_0x809d('0x4')+_0x3cb42c,_0x555bf7);MailInteractionEvents['on'](_0x3cb42c,_0x1e21c6);}};
\ No newline at end of file
+var _0xdec3=['remove','update','emit','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x36b400,_0x277ec5){var _0x4d47bf=function(_0x55372b){while(--_0x55372b){_0x36b400['push'](_0x36b400['shift']());}};_0x4d47bf(++_0x277ec5);}(_0xdec3,0x1b6));var _0x3dec=function(_0x50844d,_0x586c1e){_0x50844d=_0x50844d-0x0;var _0x1aef1c=_0xdec3[_0x50844d];return _0x1aef1c;};'use strict';var MailInteractionEvents=require(_0x3dec('0x0'));var events=[_0x3dec('0x1'),_0x3dec('0x2'),_0x3dec('0x3')];function createListener(_0x58776e,_0xaff333){return function(_0x2833f1){_0xaff333[_0x3dec('0x4')](_0x58776e,_0x2833f1);};}function removeListener(_0x553c23,_0x1f9386){return function(){MailInteractionEvents['removeListener'](_0x553c23,_0x1f9386);};}exports[_0x3dec('0x5')]=function(_0x2ce66e){for(var _0x9b2e46=0x0,_0x5389f4=events[_0x3dec('0x6')];_0x9b2e46<_0x5389f4;_0x9b2e46++){var _0x78f402=events[_0x9b2e46];var _0x26faf6=createListener(_0x3dec('0x7')+_0x78f402,_0x2ce66e);MailInteractionEvents['on'](_0x78f402,_0x26faf6);}};
\ No newline at end of file
index 8261089..8957eb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f9b=['Router','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','post','tracked','mail','mailmessage:create','create','/:id','update','put','/:id/accept','accept','destroy','exports','path','express'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x3f9b,0x11e));var _0xb3f9=function(_0x25b57c,_0x585294){_0x25b57c=_0x25b57c-0x0;var _0x5860ed=_0x3f9b[_0x25b57c];return _0x5860ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb3f9('0x0'));var timeout=require('connect-timeout');var express=require(_0xb3f9('0x1'));var router=express[_0xb3f9('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb3f9('0x3'));var controller=require(_0xb3f9('0x4'));router[_0xb3f9('0x5')]('/',auth['isAuthenticated'](),controller[_0xb3f9('0x6')]);router[_0xb3f9('0x5')](_0xb3f9('0x7'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x9')]);router['get']('/:id',auth[_0xb3f9('0x8')](),controller[_0xb3f9('0xa')]);router['get'](_0xb3f9('0xb'),auth['isAuthenticated'](),controller['download']);router[_0xb3f9('0xc')]('/',auth[_0xb3f9('0x8')](),interaction[_0xb3f9('0xd')](_0xb3f9('0xe'),_0xb3f9('0xf')),controller[_0xb3f9('0x10')]);router['put'](_0xb3f9('0x11'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x12')]);router[_0xb3f9('0x13')](_0xb3f9('0x14'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x15')]);router[_0xb3f9('0x13')]('/:id/reject',auth[_0xb3f9('0x8')](),controller['reject']);router['delete'](_0xb3f9('0x11'),auth[_0xb3f9('0x8')](),controller[_0xb3f9('0x16')]);module[_0xb3f9('0x17')]=router;
\ No newline at end of file
+var _0x128f=['reject','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject'];(function(_0x560f55,_0x1372c1){var _0x499fa4=function(_0x871916){while(--_0x871916){_0x560f55['push'](_0x560f55['shift']());}};_0x499fa4(++_0x1372c1);}(_0x128f,0xff));var _0xf128=function(_0x269b2c,_0x215c0d){_0x269b2c=_0x269b2c-0x0;var _0x499bbf=_0x128f[_0x269b2c];return _0x499bbf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf128('0x0'));var timeout=require(_0xf128('0x1'));var express=require(_0xf128('0x2'));var router=express[_0xf128('0x3')]();var fs_extra=require(_0xf128('0x4'));var auth=require(_0xf128('0x5'));var interaction=require(_0xf128('0x6'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router[_0xf128('0x7')]('/',auth[_0xf128('0x8')](),controller[_0xf128('0x9')]);router[_0xf128('0x7')](_0xf128('0xa'),auth[_0xf128('0x8')](),controller[_0xf128('0xb')]);router[_0xf128('0x7')]('/:id',auth[_0xf128('0x8')](),controller[_0xf128('0xc')]);router[_0xf128('0x7')](_0xf128('0xd'),auth[_0xf128('0x8')](),controller[_0xf128('0xe')]);router[_0xf128('0xf')]('/',auth[_0xf128('0x8')](),interaction[_0xf128('0x10')](_0xf128('0x11'),_0xf128('0x12')),controller[_0xf128('0x13')]);router[_0xf128('0x14')](_0xf128('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xf128('0x14')](_0xf128('0x16'),auth[_0xf128('0x8')](),controller[_0xf128('0x17')]);router['put'](_0xf128('0x18'),auth[_0xf128('0x8')](),controller[_0xf128('0x19')]);router['delete'](_0xf128('0x15'),auth[_0xf128('0x8')](),controller[_0xf128('0x1a')]);module[_0xf128('0x1b')]=router;
\ No newline at end of file
index b378ca1..e62c3ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ff0=['TEXT','long','medium','out','STRING','DATE','BOOLEAN','ENUM','Chat','Email','sequelize','lodash','exports'];(function(_0x457643,_0x20fba7){var _0x10c4ed=function(_0x4046da){while(--_0x4046da){_0x457643['push'](_0x457643['shift']());}};_0x10c4ed(++_0x20fba7);}(_0x6ff0,0x128));var _0x06ff=function(_0x5f1de4,_0x47c201){_0x5f1de4=_0x5f1de4-0x0;var _0x1aeaf0=_0x6ff0[_0x5f1de4];return _0x1aeaf0;};'use strict';var Sequelize=require(_0x06ff('0x0'));var _=require(_0x06ff('0x1'));module[_0x06ff('0x2')]={'body':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x06ff('0x6')),'defaultValue':_0x06ff('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x06ff('0x7')](0x1fe)},'from':{'type':Sequelize[_0x06ff('0x7')]},'to':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x06ff('0x4'))},'bcc':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x06ff('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x06ff('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x06ff('0x8')]},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x06ff('0x3')](_0x06ff('0x4'))},'originChannel':{'type':Sequelize[_0x06ff('0xa')]('Email',_0x06ff('0xb')),'defaultValue':_0x06ff('0xc'),'allowNull':![]}};
\ No newline at end of file
+var _0x8592=['TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','sequelize','lodash','exports'];(function(_0x49ed67,_0x290989){var _0x1523d5=function(_0x34a179){while(--_0x34a179){_0x49ed67['push'](_0x49ed67['shift']());}};_0x1523d5(++_0x290989);}(_0x8592,0xd5));var _0x2859=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x8592[_0x20845e];return _0x28cf2b;};'use strict';var Sequelize=require(_0x2859('0x0'));var _=require(_0x2859('0x1'));module[_0x2859('0x2')]={'body':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x2859('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2859('0x6')]('in',_0x2859('0x7')),'defaultValue':_0x2859('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2859('0x8')](0x1fe)},'from':{'type':Sequelize[_0x2859('0x8')]},'to':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4'))},'cc':{'type':Sequelize['TEXT'](_0x2859('0x4'))},'bcc':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4'))},'subject':{'type':Sequelize[_0x2859('0x3')]},'sentAt':{'type':Sequelize[_0x2859('0x9')]},'attach':{'type':Sequelize[_0x2859('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2859('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x2859('0x3')]('long')},'originCc':{'type':Sequelize[_0x2859('0x3')](_0x2859('0x4'))},'originChannel':{'type':Sequelize['ENUM']('Email','Chat'),'defaultValue':_0x2859('0xb'),'allowNull':![]}};
\ No newline at end of file
index 86b9536..374bd3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab8=['create','ListId','SendMail','sendMail','YYYY-MM-DD\x20HH:mm:ss','read','readAt','format','UserId','agent','get','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','fromString','EventManager','mail','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','motionChannel','reject','download','toString','files','tmp','server','message-%s.eml','from','bcc','subject','createdAt','Attachment','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','existsSync','push','readFileSync','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','status','offset','undefined','limit','count','Content-Range','json','update','destroy','end','sendStatus','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','MailMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','out','secret','split','findOne','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List'];(function(_0x3d11ed,_0x47a4b8){var _0xbbd56c=function(_0x49b4d7){while(--_0x49b4d7){_0x3d11ed['push'](_0x3d11ed['shift']());}};_0xbbd56c(++_0x47a4b8);}(_0x1ab8,0xe2));var _0x81ab=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1ab8[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x81ab('0x0'));var moment=require(_0x81ab('0x1'));var BPromise=require(_0x81ab('0x2'));var util=require(_0x81ab('0x3'));var path=require(_0x81ab('0x4'));var fs=require('fs');var _=require(_0x81ab('0x5'));var Redis=require(_0x81ab('0x6'));var htmlToText=require('html-to-text');var qs=require(_0x81ab('0x7'));var logger=require(_0x81ab('0x8'))(_0x81ab('0x9'));var interaction_log=require(_0x81ab('0x8'))(_0x81ab('0xa'));var config=require(_0x81ab('0xb'));var db=require(_0x81ab('0xc'))['db'];config[_0x81ab('0xd')]=_[_0x81ab('0xe')](config[_0x81ab('0xd')],{'host':_0x81ab('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x81ab('0xd')]));var htmlEntities=require('html-entities');require('./mailMessage.socket')[_0x81ab('0x10')](socket);var jayson=require(_0x81ab('0x11'));var client=jayson['client'][_0x81ab('0x12')]({'port':0x232c});var client9003=jayson[_0x81ab('0x13')][_0x81ab('0x12')]({'port':0x232b});var client9002=jayson[_0x81ab('0x13')][_0x81ab('0x12')]({'port':0x232a});function respondWithRpcPromise(_0xa4a95f,_0x11ce36,_0x6590b6,_0x543d76){return new BPromise(function(_0x3c55c2,_0x5a7c93){var _0x5cb23b=_0x543d76||client;return _0x5cb23b[_0x81ab('0x14')](_0xa4a95f,_0x6590b6)[_0x81ab('0x15')](function(_0xbf088){logger[_0x81ab('0x16')](_0x81ab('0x17'),_0x11ce36,_0x81ab('0x18'));logger[_0x81ab('0x19')](_0x81ab('0x1a'),_0x11ce36,_0x81ab('0x18'),JSON[_0x81ab('0x1b')](_0xbf088));if(_0xbf088['error']){if(_0xbf088['error'][_0x81ab('0x1c')]===0x1f4){logger['error'](_0x81ab('0x17'),_0x11ce36,_0xbf088[_0x81ab('0x1d')][_0x81ab('0x1e')]);return _0x5a7c93(_0xbf088['error'][_0x81ab('0x1e')]);}logger[_0x81ab('0x1d')](_0x81ab('0x17'),_0x11ce36,_0xbf088[_0x81ab('0x1d')][_0x81ab('0x1e')]);return _0x3c55c2(_0xbf088[_0x81ab('0x1d')][_0x81ab('0x1e')]);}else{logger[_0x81ab('0x16')](_0x81ab('0x17'),_0x11ce36,_0x81ab('0x18'));_0x3c55c2(_0xbf088[_0x81ab('0x1f')][_0x81ab('0x1e')]);}})[_0x81ab('0x20')](function(_0x546805){logger[_0x81ab('0x1d')]('MailMessage,\x20%s,\x20%s',_0x11ce36,_0x546805);_0x5a7c93(_0x546805);});});}function respondWithResult(_0x241ae9,_0x36f895){_0x36f895=_0x36f895||0xc8;return function(_0x23f88f){if(_0x23f88f){return _0x241ae9[_0x81ab('0x21')](_0x36f895)['json'](_0x23f88f);}};}function respondWithFilteredResult(_0x5191c5,_0x5ea440){return function(_0x13a90d){if(_0x13a90d){var _0x5a4ada=typeof _0x5ea440[_0x81ab('0x22')]===_0x81ab('0x23')&&typeof _0x5ea440[_0x81ab('0x24')]===_0x81ab('0x23');var _0x568dbf=_0x13a90d[_0x81ab('0x25')];var _0x8c7b9d=_0x5a4ada?0x0:_0x5ea440['offset'];var _0x1ec884=_0x5a4ada?_0x13a90d[_0x81ab('0x25')]:_0x5ea440['offset']+_0x5ea440['limit'];var _0x2cebf5;if(_0x1ec884>=_0x568dbf){_0x1ec884=_0x568dbf;_0x2cebf5=0xc8;}else{_0x2cebf5=0xce;}_0x5191c5[_0x81ab('0x21')](_0x2cebf5);return _0x5191c5['set'](_0x81ab('0x26'),_0x8c7b9d+'-'+_0x1ec884+'/'+_0x568dbf)[_0x81ab('0x27')](_0x13a90d);}return null;};}function saveUpdates(_0x5bc197){return function(_0x494b2b){if(_0x494b2b){return _0x494b2b[_0x81ab('0x28')](_0x5bc197)[_0x81ab('0x15')](function(_0x553c90){return _0x553c90;});}return null;};}function removeEntity(_0x5df743){return function(_0x3afec1){if(_0x3afec1){return _0x3afec1[_0x81ab('0x29')]()['then'](function(){_0x5df743['status'](0xcc)[_0x81ab('0x2a')]();});}};}function handleEntityNotFound(_0x105a35){return function(_0x1806e9){if(!_0x1806e9){_0x105a35[_0x81ab('0x2b')](0x194);}return _0x1806e9;};}function handleError(_0x245cfb,_0x3cfa75){_0x3cfa75=_0x3cfa75||0x1f4;return function(_0x33bcea){logger['error'](_0x33bcea[_0x81ab('0x2c')]);if(_0x33bcea['name']){delete _0x33bcea[_0x81ab('0x2d')];}_0x245cfb[_0x81ab('0x21')](_0x3cfa75)[_0x81ab('0x2e')](_0x33bcea);};}exports['index']=function(_0x33c012,_0x125f41){var _0x44f8da={},_0x4f12bf={},_0x50107c={'count':0x0,'rows':[]};var _0x4f6c0d=_['map'](db['MailMessage'][_0x81ab('0x2f')],function(_0x3817a2){return{'name':_0x3817a2[_0x81ab('0x30')],'type':_0x3817a2[_0x81ab('0x31')]['key']};});_0x4f12bf[_0x81ab('0x32')]=_[_0x81ab('0x33')](_0x4f6c0d,_0x81ab('0x2d'));_0x4f12bf[_0x81ab('0x34')]=_[_0x81ab('0x35')](_0x33c012[_0x81ab('0x34')]);_0x4f12bf[_0x81ab('0x36')]=_['intersection'](_0x4f12bf['model'],_0x4f12bf['query']);_0x44f8da[_0x81ab('0x37')]=_['intersection'](_0x4f12bf[_0x81ab('0x32')],qs[_0x81ab('0x38')](_0x33c012[_0x81ab('0x34')][_0x81ab('0x38')]));_0x44f8da[_0x81ab('0x37')]=_0x44f8da[_0x81ab('0x37')][_0x81ab('0x39')]?_0x44f8da[_0x81ab('0x37')]:_0x4f12bf[_0x81ab('0x32')];if(!_0x33c012[_0x81ab('0x34')][_0x81ab('0x3a')](_0x81ab('0x3b'))){_0x44f8da[_0x81ab('0x24')]=qs[_0x81ab('0x24')](_0x33c012[_0x81ab('0x34')][_0x81ab('0x24')]);_0x44f8da[_0x81ab('0x22')]=qs[_0x81ab('0x22')](_0x33c012[_0x81ab('0x34')][_0x81ab('0x22')]);}_0x44f8da['order']=qs[_0x81ab('0x3c')](_0x33c012['query'][_0x81ab('0x3c')]);_0x44f8da[_0x81ab('0x3d')]=qs[_0x81ab('0x36')](_['pick'](_0x33c012[_0x81ab('0x34')],_0x4f12bf[_0x81ab('0x36')]),_0x4f6c0d);if(_0x33c012['query'][_0x81ab('0x3e')]){_0x44f8da[_0x81ab('0x3d')]=_[_0x81ab('0x3f')](_0x44f8da[_0x81ab('0x3d')],{'$or':_['map'](_0x4f6c0d,function(_0x33ce80){if(_0x33ce80[_0x81ab('0x31')]!=='VIRTUAL'){var _0x4c75a4={};_0x4c75a4[_0x33ce80[_0x81ab('0x2d')]]={'$like':'%'+_0x33c012[_0x81ab('0x34')][_0x81ab('0x3e')]+'%'};return _0x4c75a4;}})});}_0x44f8da=_[_0x81ab('0x3f')]({},_0x44f8da,_0x33c012[_0x81ab('0x40')]);var _0xdf476b={'where':_0x44f8da[_0x81ab('0x3d')]};return db[_0x81ab('0x41')][_0x81ab('0x25')](_0xdf476b)[_0x81ab('0x15')](function(_0x96710e){_0x50107c[_0x81ab('0x25')]=_0x96710e;if(_0x33c012[_0x81ab('0x34')][_0x81ab('0x42')]){_0x44f8da[_0x81ab('0x43')]=[{'all':!![]}];}return db[_0x81ab('0x41')][_0x81ab('0x44')](_0x44f8da);})[_0x81ab('0x15')](function(_0xcf4770){_0x50107c[_0x81ab('0x45')]=_0xcf4770;return _0x50107c;})[_0x81ab('0x15')](respondWithFilteredResult(_0x125f41,_0x44f8da))[_0x81ab('0x20')](handleError(_0x125f41,null));};exports[_0x81ab('0x46')]=function(_0x5cb380,_0x3bfc64){var _0x1f4cba={'raw':!![],'where':{'id':_0x5cb380['params']['id']}},_0x37da2c={};_0x37da2c[_0x81ab('0x32')]=_['keys'](db[_0x81ab('0x41')][_0x81ab('0x2f')]);_0x37da2c[_0x81ab('0x34')]=_[_0x81ab('0x35')](_0x5cb380[_0x81ab('0x34')]);_0x37da2c[_0x81ab('0x36')]=_[_0x81ab('0x47')](_0x37da2c['model'],_0x37da2c[_0x81ab('0x34')]);_0x1f4cba[_0x81ab('0x37')]=_[_0x81ab('0x47')](_0x37da2c['model'],qs['fields'](_0x5cb380['query'][_0x81ab('0x38')]));_0x1f4cba[_0x81ab('0x37')]=_0x1f4cba['attributes'][_0x81ab('0x39')]?_0x1f4cba['attributes']:_0x37da2c[_0x81ab('0x32')];if(_0x5cb380[_0x81ab('0x34')][_0x81ab('0x42')]){_0x1f4cba['include']=[{'all':!![]}];}_0x1f4cba=_[_0x81ab('0x3f')]({},_0x1f4cba,_0x5cb380[_0x81ab('0x40')]);return db[_0x81ab('0x41')][_0x81ab('0x48')](_0x1f4cba)['then'](handleEntityNotFound(_0x3bfc64,null))[_0x81ab('0x15')](respondWithResult(_0x3bfc64,null))[_0x81ab('0x20')](handleError(_0x3bfc64,null));};exports[_0x81ab('0x28')]=function(_0xf09b38,_0x1f65c3){if(_0xf09b38[_0x81ab('0x49')]['id']){delete _0xf09b38[_0x81ab('0x49')]['id'];}return db[_0x81ab('0x41')][_0x81ab('0x48')]({'where':{'id':_0xf09b38[_0x81ab('0x4a')]['id']}})[_0x81ab('0x15')](handleEntityNotFound(_0x1f65c3,null))[_0x81ab('0x15')](saveUpdates(_0xf09b38[_0x81ab('0x49')],null))['then'](respondWithResult(_0x1f65c3,null))[_0x81ab('0x20')](handleError(_0x1f65c3,null));};exports[_0x81ab('0x29')]=function(_0x45ac65,_0x16a89f){return db['MailMessage'][_0x81ab('0x48')]({'where':{'id':_0x45ac65[_0x81ab('0x4a')]['id']}})[_0x81ab('0x15')](handleEntityNotFound(_0x16a89f,null))[_0x81ab('0x15')](removeEntity(_0x16a89f,null))[_0x81ab('0x20')](handleError(_0x16a89f,null));};exports[_0x81ab('0x4b')]=function(_0x45fff7,_0x5efae5){return db[_0x81ab('0x41')]['describe']()[_0x81ab('0x15')](respondWithResult(_0x5efae5,null))[_0x81ab('0x20')](handleError(_0x5efae5,null));};exports['create']=function(_0x417680,_0x23cb2d){return db[_0x81ab('0x41')]['create'](_0x417680[_0x81ab('0x49')])[_0x81ab('0x15')](function(_0x13edeb){if(_0x13edeb){if(_0x13edeb['direction']===_0x81ab('0x4c')&&!_0x13edeb[_0x81ab('0x4d')]){var _0x20d53c,_0x10a5e0,_0x4f2389;if(_0x417680[_0x81ab('0x49')]['to']){_0x10a5e0=_0x417680['body']['to'][_0x81ab('0x4e')](',')[0x0];}return db['MailAccount'][_0x81ab('0x4f')]({'where':{'id':_0x13edeb['MailAccountId']},'include':[{'model':db[_0x81ab('0x50')],'as':'List','include':[{'model':db[_0x81ab('0x51')],'as':_0x81ab('0x52'),'where':{'email':_0x10a5e0},'limit':0x1,'order':[[_0x81ab('0x53'),_0x81ab('0x54')]]}]},{'model':db['MailServerOut'],'as':_0x81ab('0x55'),'raw':!![],'include':[{'model':db[_0x81ab('0x56')],'as':_0x81ab('0x56'),'raw':!![]}]}]})[_0x81ab('0x15')](function(_0x12755b){_0x20d53c=_0x12755b;if(!_0x20d53c||!_0x20d53c['Smtp'])return;var _0x427b41=_0x20d53c[_0x81ab('0x57')]();if(_0x417680[_0x81ab('0x49')][_0x81ab('0x58')]&&_0x417680[_0x81ab('0x49')][_0x81ab('0x58')][_0x81ab('0x39')]){for(var _0x2bab9a=0x0;_0x2bab9a<_0x417680[_0x81ab('0x49')]['attachments']['length'];_0x2bab9a+=0x1){_0x417680[_0x81ab('0x49')]['attachments'][_0x2bab9a]={'filename':_0x417680['body'][_0x81ab('0x58')][_0x2bab9a][_0x81ab('0x2d')],'path':path[_0x81ab('0x59')](config[_0x81ab('0x5a')],_0x81ab('0x5b'),_0x417680[_0x81ab('0x49')]['attachments'][_0x2bab9a][_0x81ab('0x5c')])};}}_0x4f2389={'account':_0x427b41,'message':_0x417680[_0x81ab('0x49')]};return;})[_0x81ab('0x15')](function(){if(_0x20d53c[_0x81ab('0x5d')]){if(_0x20d53c[_0x81ab('0x5d')][_0x81ab('0x52')][_0x81ab('0x39')]){return _0x20d53c['List']['Contacts'][0x0];}else{return db[_0x81ab('0x51')][_0x81ab('0x5e')](_[_0x81ab('0xe')](_0x417680[_0x81ab('0x49')],{'firstName':_0x417680[_0x81ab('0x49')]['to'],'email':_0x417680[_0x81ab('0x49')]['to'],'phone':_0x417680[_0x81ab('0x49')]['to'],'ListId':_0x20d53c[_0x81ab('0x5f')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x81ab('0x15')](function(){if(_0x4f2389){return respondWithRpcPromise(_0x81ab('0x60'),_0x81ab('0x61'),_0x4f2389,client9003)[_0x81ab('0x15')](function(_0x39a19c){return _0x13edeb[_0x81ab('0x28')]({'read':!![],'messageId':_0x39a19c['messageId'],'sentAt':moment()['format'](_0x81ab('0x62'))});})[_0x81ab('0x20')](function(_0x306293){logger[_0x81ab('0x1d')]('%s',JSON['stringify'](_0x306293));return _0x13edeb;});}return _0x13edeb;});}return _0x13edeb;}})[_0x81ab('0x15')](respondWithResult(_0x23cb2d,0xc9))[_0x81ab('0x20')](handleError(_0x23cb2d,null));};exports['accept']=function(_0x49d8ad,_0x187602){var _0x2ecd4f={'agent':{},'channel':'mail'};if(_0x49d8ad[_0x81ab('0x49')]['id']){delete _0x49d8ad[_0x81ab('0x49')]['id'];}_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x63')]=!![];_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x64')]=moment()[_0x81ab('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')]=_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')]||_0x49d8ad['user']['id'];_0x2ecd4f[_0x81ab('0x67')]['id']=_0x49d8ad['body'][_0x81ab('0x66')];return db[_0x81ab('0x41')]['find']({'where':{'id':_0x49d8ad[_0x81ab('0x4a')]['id'],'UserId':null}})[_0x81ab('0x15')](handleEntityNotFound(_0x187602,null))[_0x81ab('0x15')](saveUpdates(_0x49d8ad[_0x81ab('0x49')],null))['then'](function(_0x13e878){if(_0x13e878){_0x2ecd4f[_0x81ab('0x1e')]=_0x13e878[_0x81ab('0x68')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x13e878['MailInteractionId']}});}return null;})[_0x81ab('0x15')](handleEntityNotFound(_0x187602,null))[_0x81ab('0x15')](function(_0xe44ab6){if(_0xe44ab6){return _0xe44ab6[_0x81ab('0x28')]({'UserId':_0x49d8ad['body']['UserId'],'read1stAt':_[_0x81ab('0x69')](_0xe44ab6[_0x81ab('0x6a')])?moment()[_0x81ab('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4d9477){if(_0x4d9477){_0x2ecd4f[_0x81ab('0x6b')]=_0x4d9477[_0x81ab('0x68')]({'plain':!![]});interaction_log[_0x81ab('0x16')](_0x81ab('0x6c'),_0x49d8ad[_0x81ab('0x6d')]['id'],_0x49d8ad['user'][_0x81ab('0x2d')],_0x49d8ad[_0x81ab('0x6d')][_0x81ab('0x6e')],_0x2ecd4f['interaction']['id'],_0x49d8ad['body']?JSON[_0x81ab('0x1b')](_0x49d8ad[_0x81ab('0x49')]):_0x81ab('0x6f'));return respondWithRpcPromise(_0x81ab('0x70'),'acceptMessage',_0x2ecd4f);}return null;})[_0x81ab('0x15')](function(_0x123894){var _0xbb45ea=_0x81ab('0x71')+_0x123894['message'][_0x81ab('0x72')];return db[_0x81ab('0x73')]['query'](_0xbb45ea,{'type':db['Sequelize'][_0x81ab('0x74')][_0x81ab('0x75')],'raw':!![]})[_0x81ab('0x15')](function(_0x52e639){return _0x52e639;});})[_0x81ab('0x15')](function(_0x44ff65){if(_0x44ff65){_0x2ecd4f['message'][_0x81ab('0x76')]=_0x44ff65[0x0];if(!_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')])return;return db[_0x81ab('0x77')][_0x81ab('0x48')]({'where':{'id':_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x66')],'role':'agent'},'attributes':['id',_0x81ab('0x2d'),_0x81ab('0x78'),_0x81ab('0x79'),_0x81ab('0x7a')],'raw':!![]});}return null;})['then'](function(_0x2a257d){if(!_0x2a257d)return null;_0x2ecd4f['message'][_0x81ab('0x67')]=_0x2a257d;return _0x2ecd4f;})[_0x81ab('0x15')](function(_0x3e7e00){if(_0x3e7e00){if(_0x49d8ad[_0x81ab('0x49')][_0x81ab('0x7b')]){_0x2ecd4f[_0x81ab('0x1e')][_0x81ab('0x7c')]=util[_0x81ab('0x65')](_0x81ab('0x7d'),_0x49d8ad[_0x81ab('0x6d')][_0x81ab('0x2d')]);_0x2ecd4f[_0x81ab('0x1e')][_0x81ab('0x7e')]=_0x2ecd4f[_0x81ab('0x7e')];_0x2ecd4f['message']['motionChannel']=_0x2ecd4f['channel'];_0x2ecd4f[_0x81ab('0x1e')][_0x81ab('0x7f')]=_0x81ab('0x80');_0x2ecd4f['message'][_0x81ab('0x49')]=htmlToText[_0x81ab('0x81')](_0x2ecd4f[_0x81ab('0x1e')]['body']);return respondWithRpcPromise(_0x81ab('0x82'),_0x81ab('0x82'),{'event':'acceptmessage','message':_0x2ecd4f[_0x81ab('0x1e')]},client9002)[_0x81ab('0x15')](function(){return _0x2ecd4f;});}return _0x2ecd4f;}return null;})[_0x81ab('0x15')](respondWithResult(_0x187602,null))[_0x81ab('0x20')](handleError(_0x187602,null));};exports['reject']=function(_0x4c8b86,_0x4decf7){var _0x119d2c={'agent':{},'channel':_0x81ab('0x83')};if(_0x4c8b86['body']['id']){delete _0x4c8b86[_0x81ab('0x49')]['id'];}_0x4c8b86['body'][_0x81ab('0x66')]=_0x4c8b86[_0x81ab('0x49')]['UserId']||_0x4c8b86[_0x81ab('0x6d')]['id'];_0x119d2c[_0x81ab('0x67')]['id']=_0x4c8b86['body']['UserId'];return db[_0x81ab('0x41')][_0x81ab('0x48')]({'where':{'id':_0x4c8b86[_0x81ab('0x4a')]['id'],'UserId':null}})[_0x81ab('0x15')](handleEntityNotFound(_0x4decf7,null))[_0x81ab('0x15')](function(_0x730486){if(_0x730486){_0x119d2c[_0x81ab('0x1e')]=_0x730486[_0x81ab('0x68')]({'plain':!![]});return db[_0x81ab('0x84')][_0x81ab('0x48')]({'where':{'id':_0x730486[_0x81ab('0x85')]}});}return null;})['then'](handleEntityNotFound(_0x4decf7,null))[_0x81ab('0x15')](function(_0x46472b){if(_0x46472b){_0x119d2c[_0x81ab('0x6b')]=_0x46472b[_0x81ab('0x68')]({'plain':!![]});interaction_log[_0x81ab('0x16')](_0x81ab('0x86'),_0x4c8b86[_0x81ab('0x6d')]['id'],_0x4c8b86[_0x81ab('0x6d')][_0x81ab('0x2d')],_0x4c8b86['user']['role'],_0x119d2c['interaction']['id'],_0x4c8b86[_0x81ab('0x49')]?JSON['stringify'](_0x4c8b86['body']):_0x81ab('0x6f'));return respondWithRpcPromise(_0x81ab('0x87'),_0x81ab('0x88'),_0x119d2c);}return null;})[_0x81ab('0x15')](function(_0x1f5ce0){var _0xfd5dd7=_0x81ab('0x71')+_0x1f5ce0[_0x81ab('0x1e')][_0x81ab('0x72')];return db[_0x81ab('0x73')]['query'](_0xfd5dd7,{'type':db[_0x81ab('0x89')][_0x81ab('0x74')]['SELECT'],'raw':!![]})[_0x81ab('0x15')](function(_0x53a4c1){return _0x53a4c1;});})[_0x81ab('0x15')](function(_0x49fcab){if(_0x49fcab){_0x119d2c[_0x81ab('0x1e')][_0x81ab('0x76')]=_0x49fcab[0x0];if(!_0x4c8b86['body'][_0x81ab('0x66')])return;return db['User']['find']({'where':{'id':_0x4c8b86[_0x81ab('0x49')][_0x81ab('0x66')],'role':'agent'},'attributes':['id',_0x81ab('0x2d'),_0x81ab('0x78'),_0x81ab('0x79'),'internal'],'raw':!![]});}return null;})['then'](function(_0xc99dc1){if(!_0xc99dc1)return null;_0x119d2c[_0x81ab('0x1e')][_0x81ab('0x67')]=_0xc99dc1;return _0x119d2c;})[_0x81ab('0x15')](function(_0x5baa03){if(_0x5baa03){_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x7c')]=util[_0x81ab('0x65')](_0x81ab('0x7d'),_0x4c8b86[_0x81ab('0x6d')][_0x81ab('0x2d')]);_0x5baa03['message'][_0x81ab('0x7e')]=_0x119d2c[_0x81ab('0x7e')];_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x8a')]=_0x119d2c[_0x81ab('0x7e')];_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x7f')]=_0x81ab('0x8b');_0x5baa03[_0x81ab('0x1e')][_0x81ab('0x49')]=htmlToText[_0x81ab('0x81')](_0x119d2c[_0x81ab('0x1e')][_0x81ab('0x49')]);respondWithRpcPromise(_0x81ab('0x82'),'EventManager',{'event':'rejectmessage','message':_0x5baa03[_0x81ab('0x1e')]},client9002);return _0x119d2c;}return null;})['then'](respondWithResult(_0x4decf7,null))['catch'](handleError(_0x4decf7,null));};exports[_0x81ab('0x8c')]=function(_0x29cbed,_0x4e713e){var _0x1a3cc6=moment()['unix']()[_0x81ab('0x8d')]();var _0xb32bc9=path[_0x81ab('0x59')](config[_0x81ab('0x5a')],'server',_0x81ab('0x8e'),_0x81ab('0x8f'));var _0x4e41a9=path['join'](config[_0x81ab('0x5a')],_0x81ab('0x90'),_0x81ab('0x8e'),'attachments');var _0x26ae34=util[_0x81ab('0x65')](_0x81ab('0x91'),_0x1a3cc6);return db[_0x81ab('0x41')]['find']({'where':{'id':_0x29cbed[_0x81ab('0x4a')]['id']},'attributes':['id',_0x81ab('0x49'),_0x81ab('0x92'),'to','cc',_0x81ab('0x93'),_0x81ab('0x94'),_0x81ab('0x95')],'include':_0x29cbed[_0x81ab('0x34')]['attachments']?[{'model':db[_0x81ab('0x96')],'as':'Attachments'}]:undefined})[_0x81ab('0x15')](handleEntityNotFound(_0x4e713e,null))[_0x81ab('0x15')](function(_0x314e6a){if(_0x314e6a){var _0x3004ad=_0x314e6a;var _0xd78866={'from':_0x3004ad[_0x81ab('0x92')],'to':_0x3004ad['to'],'subject':_0x3004ad[_0x81ab('0x94')],'html':htmlEntities[_0x81ab('0x97')](_0x3004ad[_0x81ab('0x49')]),'headers':{'Date':moment(_0x3004ad['createdAt'])[_0x81ab('0x65')](_0x81ab('0x98'))},'attachments':[]};if(_0x314e6a['cc']){_0xd78866['headers']['Cc']=_0x314e6a['cc'];}if(_0x314e6a[_0x81ab('0x93')]){_0xd78866['headers'][_0x81ab('0x99')]=_0x314e6a[_0x81ab('0x93')];}return new BPromise(function(_0x4afe61,_0x2697ff){if(_0x314e6a[_0x81ab('0x9a')]){for(var _0x34ef98=0x0;_0x34ef98<_0x314e6a[_0x81ab('0x9a')][_0x81ab('0x39')];_0x34ef98++){var _0x16247f=_0x314e6a[_0x81ab('0x9a')][_0x34ef98];var _0x44fa17=path['join'](_0x4e41a9,_0x16247f[_0x81ab('0x5c')]);if(fs[_0x81ab('0x9b')](_0x44fa17)){_0xd78866[_0x81ab('0x58')][_0x81ab('0x9c')]({'name':_0x16247f[_0x81ab('0x2d')],'contentType':_0x16247f[_0x81ab('0x31')],'data':fs[_0x81ab('0x9d')](_0x44fa17)});}}}emlformat['build'](_0xd78866,function(_0x12dd7d,_0xa29d5d){if(_0x12dd7d)return _0x2697ff(_0x12dd7d);fs[_0x81ab('0x9e')](path['join'](_0xb32bc9,_0x26ae34),_0xa29d5d);return _0x4afe61(_0xa29d5d);});});}})[_0x81ab('0x15')](function(_0x2f2eb2){if(_0x2f2eb2){return _0x4e713e['download'](path[_0x81ab('0x59')](_0xb32bc9,_0x26ae34),_0x26ae34,function(_0xe298ed){if(!_0xe298ed)fs[_0x81ab('0x9f')](path[_0x81ab('0x59')](_0xb32bc9,_0x26ae34));});}})['catch'](handleError(_0x4e713e,null));};
\ No newline at end of file
+var _0x279c=['ListId','sendMail','messageId','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','internal','manual','interface','channel','event','fromString','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','fullname','SIP/%s','EventManager','rejectmessage','download','unix','join','server','files','tmp','message-%s.eml','subject','Attachment','Attachments','from','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','existsSync','push','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','request','then','info','MailMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','options','include','MailMessage','findAll','rows','catch','show','includeAll','find','body','params','direction','out','secret','split','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','getSmtpOptions','attachments','root','server/files/attachments','basename','CmContact','create','defaults'];(function(_0x13f7eb,_0x84be3e){var _0x1d33a1=function(_0x41d342){while(--_0x41d342){_0x13f7eb['push'](_0x13f7eb['shift']());}};_0x1d33a1(++_0x84be3e);}(_0x279c,0xe6));var _0xc279=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x279c[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0xc279('0x0'));var moment=require(_0xc279('0x1'));var BPromise=require(_0xc279('0x2'));var util=require(_0xc279('0x3'));var path=require(_0xc279('0x4'));var fs=require('fs');var _=require(_0xc279('0x5'));var Redis=require(_0xc279('0x6'));var htmlToText=require(_0xc279('0x7'));var qs=require(_0xc279('0x8'));var logger=require(_0xc279('0x9'))(_0xc279('0xa'));var interaction_log=require(_0xc279('0x9'))(_0xc279('0xb'));var config=require(_0xc279('0xc'));var db=require('../../mysqldb')['db'];config[_0xc279('0xd')]=_['defaults'](config[_0xc279('0xd')],{'host':_0xc279('0xe'),'port':0x18eb});var socket=require(_0xc279('0xf'))(new Redis(config[_0xc279('0xd')]));var htmlEntities=require('html-entities');require(_0xc279('0x10'))[_0xc279('0x11')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc279('0x12')][_0xc279('0x13')]({'port':0x232c});var client9003=jayson[_0xc279('0x12')][_0xc279('0x13')]({'port':0x232b});var client9002=jayson[_0xc279('0x12')][_0xc279('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x3db417,_0x25795b,_0x50dc5d,_0x56d21b){return new BPromise(function(_0xc573ca,_0x37509c){var _0x2e5750=_0x56d21b||client;return _0x2e5750[_0xc279('0x14')](_0x3db417,_0x50dc5d)[_0xc279('0x15')](function(_0x273b8f){logger[_0xc279('0x16')](_0xc279('0x17'),_0x25795b,'request\x20sent');logger[_0xc279('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x25795b,'request\x20sent',JSON[_0xc279('0x19')](_0x273b8f));if(_0x273b8f['error']){if(_0x273b8f[_0xc279('0x1a')][_0xc279('0x1b')]===0x1f4){logger['error'](_0xc279('0x17'),_0x25795b,_0x273b8f[_0xc279('0x1a')][_0xc279('0x1c')]);return _0x37509c(_0x273b8f[_0xc279('0x1a')][_0xc279('0x1c')]);}logger[_0xc279('0x1a')](_0xc279('0x17'),_0x25795b,_0x273b8f['error'][_0xc279('0x1c')]);return _0xc573ca(_0x273b8f[_0xc279('0x1a')][_0xc279('0x1c')]);}else{logger[_0xc279('0x16')](_0xc279('0x17'),_0x25795b,_0xc279('0x1d'));_0xc573ca(_0x273b8f[_0xc279('0x1e')][_0xc279('0x1c')]);}})['catch'](function(_0x1ad880){logger['error'](_0xc279('0x17'),_0x25795b,_0x1ad880);_0x37509c(_0x1ad880);});});}function respondWithResult(_0x55d447,_0x45cc10){_0x45cc10=_0x45cc10||0xc8;return function(_0x18b0a0){if(_0x18b0a0){return _0x55d447[_0xc279('0x1f')](_0x45cc10)[_0xc279('0x20')](_0x18b0a0);}};}function respondWithFilteredResult(_0x56c2fc,_0x3ceefb){return function(_0x38bda1){if(_0x38bda1){var _0x218fe8=typeof _0x3ceefb[_0xc279('0x21')]===_0xc279('0x22')&&typeof _0x3ceefb[_0xc279('0x23')]===_0xc279('0x22');var _0x404cda=_0x38bda1[_0xc279('0x24')];var _0x43e493=_0x218fe8?0x0:_0x3ceefb[_0xc279('0x21')];var _0x5bb8b1=_0x218fe8?_0x38bda1[_0xc279('0x24')]:_0x3ceefb['offset']+_0x3ceefb[_0xc279('0x23')];var _0x205bda;if(_0x5bb8b1>=_0x404cda){_0x5bb8b1=_0x404cda;_0x205bda=0xc8;}else{_0x205bda=0xce;}_0x56c2fc[_0xc279('0x1f')](_0x205bda);return _0x56c2fc[_0xc279('0x25')](_0xc279('0x26'),_0x43e493+'-'+_0x5bb8b1+'/'+_0x404cda)[_0xc279('0x20')](_0x38bda1);}return null;};}function saveUpdates(_0x6629fa){return function(_0x3befab){if(_0x3befab){return _0x3befab[_0xc279('0x27')](_0x6629fa)[_0xc279('0x15')](function(_0x2b33ec){return _0x2b33ec;});}return null;};}function removeEntity(_0x52c508){return function(_0x24f965){if(_0x24f965){return _0x24f965[_0xc279('0x28')]()[_0xc279('0x15')](function(){_0x52c508[_0xc279('0x1f')](0xcc)[_0xc279('0x29')]();});}};}function handleEntityNotFound(_0x2d5b33){return function(_0x1a6f33){if(!_0x1a6f33){_0x2d5b33[_0xc279('0x2a')](0x194);}return _0x1a6f33;};}function handleError(_0x29759d,_0x3be520){_0x3be520=_0x3be520||0x1f4;return function(_0x2dde18){logger[_0xc279('0x1a')](_0x2dde18[_0xc279('0x2b')]);if(_0x2dde18[_0xc279('0x2c')]){delete _0x2dde18[_0xc279('0x2c')];}_0x29759d[_0xc279('0x1f')](_0x3be520)[_0xc279('0x2d')](_0x2dde18);};}exports[_0xc279('0x2e')]=function(_0x16dc22,_0x169888){var _0x1b2619={},_0x4b2089={},_0x5381e7={'count':0x0,'rows':[]};var _0x1f734d=_[_0xc279('0x2f')](db['MailMessage'][_0xc279('0x30')],function(_0x61afed){return{'name':_0x61afed[_0xc279('0x31')],'type':_0x61afed[_0xc279('0x32')][_0xc279('0x33')]};});_0x4b2089[_0xc279('0x34')]=_[_0xc279('0x2f')](_0x1f734d,_0xc279('0x2c'));_0x4b2089[_0xc279('0x35')]=_[_0xc279('0x36')](_0x16dc22['query']);_0x4b2089[_0xc279('0x37')]=_['intersection'](_0x4b2089['model'],_0x4b2089[_0xc279('0x35')]);_0x1b2619[_0xc279('0x38')]=_[_0xc279('0x39')](_0x4b2089[_0xc279('0x34')],qs[_0xc279('0x3a')](_0x16dc22[_0xc279('0x35')][_0xc279('0x3a')]));_0x1b2619['attributes']=_0x1b2619['attributes'][_0xc279('0x3b')]?_0x1b2619[_0xc279('0x38')]:_0x4b2089['model'];if(!_0x16dc22[_0xc279('0x35')]['hasOwnProperty'](_0xc279('0x3c'))){_0x1b2619[_0xc279('0x23')]=qs['limit'](_0x16dc22[_0xc279('0x35')]['limit']);_0x1b2619[_0xc279('0x21')]=qs[_0xc279('0x21')](_0x16dc22[_0xc279('0x35')]['offset']);}_0x1b2619[_0xc279('0x3d')]=qs['sort'](_0x16dc22[_0xc279('0x35')][_0xc279('0x3e')]);_0x1b2619[_0xc279('0x3f')]=qs[_0xc279('0x37')](_['pick'](_0x16dc22[_0xc279('0x35')],_0x4b2089[_0xc279('0x37')]),_0x1f734d);if(_0x16dc22[_0xc279('0x35')]['filter']){_0x1b2619[_0xc279('0x3f')]=_[_0xc279('0x40')](_0x1b2619[_0xc279('0x3f')],{'$or':_[_0xc279('0x2f')](_0x1f734d,function(_0x295881){if(_0x295881[_0xc279('0x32')]!==_0xc279('0x41')){var _0x105e49={};_0x105e49[_0x295881[_0xc279('0x2c')]]={'$like':'%'+_0x16dc22[_0xc279('0x35')]['filter']+'%'};return _0x105e49;}})});}_0x1b2619=_[_0xc279('0x40')]({},_0x1b2619,_0x16dc22[_0xc279('0x42')]);var _0x24248e={'where':_0x1b2619[_0xc279('0x3f')]};return db['MailMessage'][_0xc279('0x24')](_0x24248e)[_0xc279('0x15')](function(_0xb797ff){_0x5381e7['count']=_0xb797ff;if(_0x16dc22[_0xc279('0x35')]['includeAll']){_0x1b2619[_0xc279('0x43')]=[{'all':!![]}];}return db[_0xc279('0x44')][_0xc279('0x45')](_0x1b2619);})[_0xc279('0x15')](function(_0x4513c1){_0x5381e7[_0xc279('0x46')]=_0x4513c1;return _0x5381e7;})[_0xc279('0x15')](respondWithFilteredResult(_0x169888,_0x1b2619))[_0xc279('0x47')](handleError(_0x169888,null));};exports[_0xc279('0x48')]=function(_0x33d2cb,_0x41d387){var _0x546f89={'raw':!![],'where':{'id':_0x33d2cb['params']['id']}},_0x325bb1={};_0x325bb1['model']=_[_0xc279('0x36')](db['MailMessage']['rawAttributes']);_0x325bb1[_0xc279('0x35')]=_[_0xc279('0x36')](_0x33d2cb[_0xc279('0x35')]);_0x325bb1['filters']=_[_0xc279('0x39')](_0x325bb1[_0xc279('0x34')],_0x325bb1[_0xc279('0x35')]);_0x546f89['attributes']=_[_0xc279('0x39')](_0x325bb1[_0xc279('0x34')],qs[_0xc279('0x3a')](_0x33d2cb[_0xc279('0x35')][_0xc279('0x3a')]));_0x546f89[_0xc279('0x38')]=_0x546f89[_0xc279('0x38')]['length']?_0x546f89['attributes']:_0x325bb1['model'];if(_0x33d2cb[_0xc279('0x35')][_0xc279('0x49')]){_0x546f89['include']=[{'all':!![]}];}_0x546f89=_['merge']({},_0x546f89,_0x33d2cb[_0xc279('0x42')]);return db[_0xc279('0x44')][_0xc279('0x4a')](_0x546f89)['then'](handleEntityNotFound(_0x41d387,null))[_0xc279('0x15')](respondWithResult(_0x41d387,null))[_0xc279('0x47')](handleError(_0x41d387,null));};exports[_0xc279('0x27')]=function(_0x230576,_0x5c5799){if(_0x230576[_0xc279('0x4b')]['id']){delete _0x230576[_0xc279('0x4b')]['id'];}return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x230576['params']['id']}})['then'](handleEntityNotFound(_0x5c5799,null))['then'](saveUpdates(_0x230576[_0xc279('0x4b')],null))[_0xc279('0x15')](respondWithResult(_0x5c5799,null))[_0xc279('0x47')](handleError(_0x5c5799,null));};exports[_0xc279('0x28')]=function(_0x531406,_0x4139c6){return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x531406[_0xc279('0x4c')]['id']}})[_0xc279('0x15')](handleEntityNotFound(_0x4139c6,null))[_0xc279('0x15')](removeEntity(_0x4139c6,null))[_0xc279('0x47')](handleError(_0x4139c6,null));};exports['describe']=function(_0x33690c,_0x887fb6){return db['MailMessage']['describe']()[_0xc279('0x15')](respondWithResult(_0x887fb6,null))[_0xc279('0x47')](handleError(_0x887fb6,null));};exports['create']=function(_0x181244,_0x38ee42){return db[_0xc279('0x44')]['create'](_0x181244['body'])[_0xc279('0x15')](function(_0x4bb8ef){if(_0x4bb8ef){if(_0x4bb8ef[_0xc279('0x4d')]===_0xc279('0x4e')&&!_0x4bb8ef[_0xc279('0x4f')]){var _0x463949,_0x43517f,_0x1b36d2;if(_0x181244[_0xc279('0x4b')]['to']){_0x43517f=_0x181244[_0xc279('0x4b')]['to'][_0xc279('0x50')](',')[0x0];}return db['MailAccount'][_0xc279('0x51')]({'where':{'id':_0x4bb8ef[_0xc279('0x52')]},'include':[{'model':db[_0xc279('0x53')],'as':_0xc279('0x54'),'include':[{'model':db['CmContact'],'as':_0xc279('0x55'),'where':{'email':_0x43517f},'limit':0x1,'order':[[_0xc279('0x56'),_0xc279('0x57')]]}]},{'model':db[_0xc279('0x58')],'as':_0xc279('0x59'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x50b76b){_0x463949=_0x50b76b;if(!_0x463949||!_0x463949[_0xc279('0x59')])return;var _0x1f6719=_0x463949[_0xc279('0x5a')]();if(_0x181244[_0xc279('0x4b')][_0xc279('0x5b')]&&_0x181244[_0xc279('0x4b')][_0xc279('0x5b')]['length']){for(var _0xc2b943=0x0;_0xc2b943<_0x181244[_0xc279('0x4b')][_0xc279('0x5b')][_0xc279('0x3b')];_0xc2b943+=0x1){_0x181244['body']['attachments'][_0xc2b943]={'filename':_0x181244['body'][_0xc279('0x5b')][_0xc2b943][_0xc279('0x2c')],'path':path['join'](config[_0xc279('0x5c')],_0xc279('0x5d'),_0x181244[_0xc279('0x4b')]['attachments'][_0xc2b943][_0xc279('0x5e')])};}}_0x1b36d2={'account':_0x1f6719,'message':_0x181244['body']};return;})['then'](function(){if(_0x463949['List']){if(_0x463949[_0xc279('0x54')][_0xc279('0x55')][_0xc279('0x3b')]){return _0x463949['List']['Contacts'][0x0];}else{return db[_0xc279('0x5f')][_0xc279('0x60')](_[_0xc279('0x61')](_0x181244[_0xc279('0x4b')],{'firstName':_0x181244['body']['to'],'email':_0x181244[_0xc279('0x4b')]['to'],'phone':_0x181244[_0xc279('0x4b')]['to'],'ListId':_0x463949[_0xc279('0x62')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc279('0x15')](function(){if(_0x1b36d2){return respondWithRpcPromise('SendMail',_0xc279('0x63'),_0x1b36d2,client9003)[_0xc279('0x15')](function(_0x5d5e48){return _0x4bb8ef[_0xc279('0x27')]({'read':!![],'messageId':_0x5d5e48[_0xc279('0x64')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xc279('0x47')](function(_0x28a888){logger[_0xc279('0x1a')]('%s',JSON[_0xc279('0x19')](_0x28a888));return _0x4bb8ef;});}return _0x4bb8ef;});}return _0x4bb8ef;}})[_0xc279('0x15')](respondWithResult(_0x38ee42,0xc9))['catch'](handleError(_0x38ee42,null));};exports['accept']=function(_0x447774,_0x23a972){var _0x39e99d={'agent':{},'channel':_0xc279('0x65')};if(_0x447774[_0xc279('0x4b')]['id']){delete _0x447774['body']['id'];}_0x447774[_0xc279('0x4b')][_0xc279('0x66')]=!![];_0x447774[_0xc279('0x4b')][_0xc279('0x67')]=moment()[_0xc279('0x68')](_0xc279('0x69'));_0x447774[_0xc279('0x4b')][_0xc279('0x6a')]=_0x447774['body'][_0xc279('0x6a')]||_0x447774[_0xc279('0x6b')]['id'];_0x39e99d[_0xc279('0x6c')]['id']=_0x447774['body'][_0xc279('0x6a')];return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x447774['params']['id'],'UserId':null}})[_0xc279('0x15')](handleEntityNotFound(_0x23a972,null))[_0xc279('0x15')](saveUpdates(_0x447774[_0xc279('0x4b')],null))[_0xc279('0x15')](function(_0x4c6e5f){if(_0x4c6e5f){_0x39e99d[_0xc279('0x1c')]=_0x4c6e5f[_0xc279('0x6d')]({'plain':!![]});return db[_0xc279('0x6e')]['find']({'where':{'id':_0x4c6e5f[_0xc279('0x6f')]}});}return null;})['then'](handleEntityNotFound(_0x23a972,null))['then'](function(_0x29cdd1){if(_0x29cdd1){return _0x29cdd1['update']({'UserId':_0x447774[_0xc279('0x4b')][_0xc279('0x6a')],'read1stAt':_[_0xc279('0x70')](_0x29cdd1[_0xc279('0x71')])?moment()[_0xc279('0x68')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc279('0x15')](function(_0x341ece){if(_0x341ece){_0x39e99d[_0xc279('0x72')]=_0x341ece[_0xc279('0x6d')]({'plain':!![]});interaction_log['info'](_0xc279('0x73'),_0x447774[_0xc279('0x6b')]['id'],_0x447774[_0xc279('0x6b')][_0xc279('0x2c')],_0x447774[_0xc279('0x6b')][_0xc279('0x74')],_0x39e99d[_0xc279('0x72')]['id'],_0x447774[_0xc279('0x4b')]?JSON[_0xc279('0x19')](_0x447774['body']):_0xc279('0x75'));return respondWithRpcPromise(_0xc279('0x76'),_0xc279('0x77'),_0x39e99d);}return null;})[_0xc279('0x15')](function(_0x387521){var _0x48f167=_0xc279('0x78')+_0x387521[_0xc279('0x1c')][_0xc279('0x79')];return db[_0xc279('0x7a')][_0xc279('0x35')](_0x48f167,{'type':db[_0xc279('0x7b')]['QueryTypes'][_0xc279('0x7c')],'raw':!![]})[_0xc279('0x15')](function(_0x14b95a){return _0x14b95a;});})['then'](function(_0x2100bf){if(_0x2100bf){_0x39e99d[_0xc279('0x1c')][_0xc279('0x7d')]=_0x2100bf[0x0];if(!_0x447774[_0xc279('0x4b')][_0xc279('0x6a')])return;return db[_0xc279('0x7e')][_0xc279('0x4a')]({'where':{'id':_0x447774[_0xc279('0x4b')][_0xc279('0x6a')],'role':'agent'},'attributes':['id',_0xc279('0x2c'),'fullname',_0xc279('0x7f'),_0xc279('0x80')],'raw':!![]});}return null;})['then'](function(_0x2f7676){if(!_0x2f7676)return null;_0x39e99d[_0xc279('0x1c')][_0xc279('0x6c')]=_0x2f7676;return _0x39e99d;})[_0xc279('0x15')](function(_0x26d97a){if(_0x26d97a){if(_0x447774[_0xc279('0x4b')][_0xc279('0x81')]){_0x39e99d[_0xc279('0x1c')][_0xc279('0x82')]=util[_0xc279('0x68')]('SIP/%s',_0x447774[_0xc279('0x6b')][_0xc279('0x2c')]);_0x39e99d['message']['channel']=_0x39e99d[_0xc279('0x83')];_0x39e99d['message']['motionChannel']=_0x39e99d[_0xc279('0x83')];_0x39e99d['message'][_0xc279('0x84')]='accept';_0x39e99d['message'][_0xc279('0x4b')]=htmlToText[_0xc279('0x85')](_0x39e99d[_0xc279('0x1c')][_0xc279('0x4b')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0xc279('0x86'),'message':_0x39e99d[_0xc279('0x1c')]},client9002)[_0xc279('0x15')](function(){return _0x39e99d;});}return _0x39e99d;}return null;})['then'](respondWithResult(_0x23a972,null))['catch'](handleError(_0x23a972,null));};exports[_0xc279('0x87')]=function(_0x5e8996,_0x10f1de){var _0x2b2b53={'agent':{},'channel':_0xc279('0x65')};if(_0x5e8996[_0xc279('0x4b')]['id']){delete _0x5e8996[_0xc279('0x4b')]['id'];}_0x5e8996[_0xc279('0x4b')][_0xc279('0x6a')]=_0x5e8996[_0xc279('0x4b')]['UserId']||_0x5e8996[_0xc279('0x6b')]['id'];_0x2b2b53['agent']['id']=_0x5e8996[_0xc279('0x4b')][_0xc279('0x6a')];return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x5e8996[_0xc279('0x4c')]['id'],'UserId':null}})[_0xc279('0x15')](handleEntityNotFound(_0x10f1de,null))[_0xc279('0x15')](function(_0x35fc02){if(_0x35fc02){_0x2b2b53[_0xc279('0x1c')]=_0x35fc02[_0xc279('0x6d')]({'plain':!![]});return db[_0xc279('0x6e')][_0xc279('0x4a')]({'where':{'id':_0x35fc02[_0xc279('0x6f')]}});}return null;})[_0xc279('0x15')](handleEntityNotFound(_0x10f1de,null))['then'](function(_0x4b88a8){if(_0x4b88a8){_0x2b2b53['interaction']=_0x4b88a8['get']({'plain':!![]});interaction_log[_0xc279('0x16')](_0xc279('0x88'),_0x5e8996[_0xc279('0x6b')]['id'],_0x5e8996[_0xc279('0x6b')][_0xc279('0x2c')],_0x5e8996[_0xc279('0x6b')][_0xc279('0x74')],_0x2b2b53[_0xc279('0x72')]['id'],_0x5e8996['body']?JSON['stringify'](_0x5e8996[_0xc279('0x4b')]):_0xc279('0x75'));return respondWithRpcPromise(_0xc279('0x89'),_0xc279('0x8a'),_0x2b2b53);}return null;})[_0xc279('0x15')](function(_0xfb4c82){var _0x50ac87=_0xc279('0x78')+_0xfb4c82['message'][_0xc279('0x79')];return db[_0xc279('0x7a')]['query'](_0x50ac87,{'type':db[_0xc279('0x7b')][_0xc279('0x8b')][_0xc279('0x7c')],'raw':!![]})[_0xc279('0x15')](function(_0x37f4f0){return _0x37f4f0;});})['then'](function(_0x135d42){if(_0x135d42){_0x2b2b53['message']['contact']=_0x135d42[0x0];if(!_0x5e8996['body']['UserId'])return;return db[_0xc279('0x7e')][_0xc279('0x4a')]({'where':{'id':_0x5e8996[_0xc279('0x4b')][_0xc279('0x6a')],'role':_0xc279('0x6c')},'attributes':['id',_0xc279('0x2c'),_0xc279('0x8c'),_0xc279('0x7f'),_0xc279('0x80')],'raw':!![]});}return null;})[_0xc279('0x15')](function(_0x45bb50){if(!_0x45bb50)return null;_0x2b2b53[_0xc279('0x1c')][_0xc279('0x6c')]=_0x45bb50;return _0x2b2b53;})[_0xc279('0x15')](function(_0x16869c){if(_0x16869c){_0x16869c[_0xc279('0x1c')][_0xc279('0x82')]=util[_0xc279('0x68')](_0xc279('0x8d'),_0x5e8996[_0xc279('0x6b')]['name']);_0x16869c[_0xc279('0x1c')][_0xc279('0x83')]=_0x2b2b53[_0xc279('0x83')];_0x16869c[_0xc279('0x1c')]['motionChannel']=_0x2b2b53[_0xc279('0x83')];_0x16869c[_0xc279('0x1c')][_0xc279('0x84')]=_0xc279('0x87');_0x16869c[_0xc279('0x1c')][_0xc279('0x4b')]=htmlToText[_0xc279('0x85')](_0x2b2b53[_0xc279('0x1c')][_0xc279('0x4b')]);respondWithRpcPromise(_0xc279('0x8e'),_0xc279('0x8e'),{'event':_0xc279('0x8f'),'message':_0x16869c['message']},client9002);return _0x2b2b53;}return null;})[_0xc279('0x15')](respondWithResult(_0x10f1de,null))['catch'](handleError(_0x10f1de,null));};exports[_0xc279('0x90')]=function(_0x40bd5a,_0x2b3e50){var _0x5ccb52=moment()[_0xc279('0x91')]()['toString']();var _0x24aa37=path[_0xc279('0x92')](config[_0xc279('0x5c')],_0xc279('0x93'),_0xc279('0x94'),_0xc279('0x95'));var _0x24de86=path[_0xc279('0x92')](config[_0xc279('0x5c')],_0xc279('0x93'),'files',_0xc279('0x5b'));var _0xac0f40=util['format'](_0xc279('0x96'),_0x5ccb52);return db[_0xc279('0x44')][_0xc279('0x4a')]({'where':{'id':_0x40bd5a[_0xc279('0x4c')]['id']},'attributes':['id',_0xc279('0x4b'),'from','to','cc','bcc',_0xc279('0x97'),'createdAt'],'include':_0x40bd5a[_0xc279('0x35')]['attachments']?[{'model':db[_0xc279('0x98')],'as':_0xc279('0x99')}]:undefined})[_0xc279('0x15')](handleEntityNotFound(_0x2b3e50,null))[_0xc279('0x15')](function(_0x379b63){if(_0x379b63){var _0x11fc5e=_0x379b63;var _0x16b68f={'from':_0x11fc5e[_0xc279('0x9a')],'to':_0x11fc5e['to'],'subject':_0x11fc5e['subject'],'html':htmlEntities[_0xc279('0x9b')](_0x11fc5e[_0xc279('0x4b')]),'headers':{'Date':moment(_0x11fc5e[_0xc279('0x9c')])[_0xc279('0x68')](_0xc279('0x9d'))},'attachments':[]};if(_0x379b63['cc']){_0x16b68f[_0xc279('0x9e')]['Cc']=_0x379b63['cc'];}if(_0x379b63[_0xc279('0x9f')]){_0x16b68f[_0xc279('0x9e')]['Bcc']=_0x379b63[_0xc279('0x9f')];}return new BPromise(function(_0x4a6b62,_0x42a1d4){if(_0x379b63[_0xc279('0x99')]){for(var _0xa139ba=0x0;_0xa139ba<_0x379b63[_0xc279('0x99')][_0xc279('0x3b')];_0xa139ba++){var _0x473f8e=_0x379b63[_0xc279('0x99')][_0xa139ba];var _0x562da9=path[_0xc279('0x92')](_0x24de86,_0x473f8e['basename']);if(fs[_0xc279('0xa0')](_0x562da9)){_0x16b68f[_0xc279('0x5b')][_0xc279('0xa1')]({'name':_0x473f8e[_0xc279('0x2c')],'contentType':_0x473f8e[_0xc279('0x32')],'data':fs['readFileSync'](_0x562da9)});}}}emlformat[_0xc279('0xa2')](_0x16b68f,function(_0x54ac2f,_0x3231d0){if(_0x54ac2f)return _0x42a1d4(_0x54ac2f);fs['writeFileSync'](path[_0xc279('0x92')](_0x24aa37,_0xac0f40),_0x3231d0);return _0x4a6b62(_0x3231d0);});});}})[_0xc279('0x15')](function(_0xc32ed6){if(_0xc32ed6){return _0x2b3e50[_0xc279('0x90')](path['join'](_0x24aa37,_0xac0f40),_0xac0f40,function(_0x336c72){if(!_0x336c72)fs[_0xc279('0xa3')](path[_0xc279('0x92')](_0x24aa37,_0xac0f40));});}})[_0xc279('0x47')](handleError(_0x2b3e50,null));};
\ No newline at end of file
index e2064c4..0bd010e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d6a=['exports','../../mysqldb','save','update','remove','emit','hook'];(function(_0x262b56,_0x489281){var _0x106c6e=function(_0x42dd25){while(--_0x42dd25){_0x262b56['push'](_0x262b56['shift']());}};_0x106c6e(++_0x489281);}(_0x4d6a,0xd3));var _0xa4d6=function(_0x5aa295,_0x370e55){_0x5aa295=_0x5aa295-0x0;var _0x236b89=_0x4d6a[_0x5aa295];return _0x236b89;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xa4d6('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa4d6('0x1'),'afterUpdate':_0xa4d6('0x2'),'afterDestroy':_0xa4d6('0x3')};function emitEvent(_0x3b4cc6){return function(_0x5917c5,_0x265fb4,_0x306c8f){MailMessageEvents[_0xa4d6('0x4')](_0x3b4cc6+':'+_0x5917c5['id'],_0x5917c5);MailMessageEvents[_0xa4d6('0x4')](_0x3b4cc6,_0x5917c5);_0x306c8f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xa4d6('0x5')](e,emitEvent(event));}}module[_0xa4d6('0x6')]=MailMessageEvents;
\ No newline at end of file
+var _0xd65e=['events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x2497a9,_0x682249){var _0x19a2e9=function(_0x42955f){while(--_0x42955f){_0x2497a9['push'](_0x2497a9['shift']());}};_0x19a2e9(++_0x682249);}(_0xd65e,0x15f));var _0xed65=function(_0x53348c,_0x2a725d){_0x53348c=_0x53348c-0x0;var _0x45cdb4=_0xd65e[_0x53348c];return _0x45cdb4;};'use strict';var EventEmitter=require(_0xed65('0x0'));var MailMessage=require(_0xed65('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xed65('0x2')](0x0);var events={'afterCreate':_0xed65('0x3'),'afterUpdate':'update','afterDestroy':_0xed65('0x4')};function emitEvent(_0x416128){return function(_0x34ed9b,_0x33965a,_0x1a077b){MailMessageEvents[_0xed65('0x5')](_0x416128+':'+_0x34ed9b['id'],_0x34ed9b);MailMessageEvents[_0xed65('0x5')](_0x416128,_0x34ed9b);_0x1a077b(null);};}for(var e in events){if(events[_0xed65('0x6')](e)){var event=events[e];MailMessage[_0xed65('0x7')](e,emitEvent(event));}}module[_0xed65('0x8')]=MailMessageEvents;
\ No newline at end of file
index 3372922..5ffbeab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x601e=['secret','UserId','MailInteraction','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','direction','toLowerCase','out'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x601e,0x18a));var _0xe601=function(_0x50fda9,_0x5ee44b){_0x50fda9=_0x50fda9-0x0;var _0x36b92b=_0x601e[_0x50fda9];return _0x36b92b;};'use strict';var _=require(_0xe601('0x0'));var util=require(_0xe601('0x1'));var logger=require('../../config/logger')(_0xe601('0x2'));var moment=require(_0xe601('0x3'));var BPromise=require(_0xe601('0x4'));var rp=require(_0xe601('0x5'));var htmlToText=require(_0xe601('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe601('0x7'));var config=require('../../config/environment');var attributes=require(_0xe601('0x8'));module[_0xe601('0x9')]=function(_0x4266e4,_0x1f64b8){return _0x4266e4[_0xe601('0xa')]('MailMessage',attributes,{'tableName':_0xe601('0xb'),'paranoid':![],'indexes':[{'name':_0xe601('0xc'),'fields':[_0xe601('0xc')]},{'name':_0xe601('0xd'),'fields':[_0xe601('0xe'),_0xe601('0xf')],'type':_0xe601('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e3db2,_0x5aa042,_0x318cb5){if(_0x5e3db2['body']){_0x5e3db2[_0xe601('0xe')]=htmlToText[_0xe601('0x11')](_0x5e3db2[_0xe601('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x318cb5(null,_0x5aa042);},'afterCreate':function(_0x32a96d,_0x54798c,_0x356e2d){var _0x239e5f=_0x4266e4['models'];var _0x10c590=_0x32a96d['get']({'plain':!![]});if(_0x10c590[_0xe601('0x13')]['toLowerCase']()==='in'||_0x10c590['direction'][_0xe601('0x14')]()===_0xe601('0x15')&&!_0x10c590[_0xe601('0x16')]&&!_['isNil'](_0x10c590[_0xe601('0x17')])){_0x239e5f[_0xe601('0x18')][_0xe601('0x19')]({'where':{'id':_0x10c590[_0xe601('0x1a')]}})['then'](function(_0x47d785){if(_0x47d785){_0x47d785[_0xe601('0x1b')]({'lastMsgAt':_0x10c590[_0xe601('0x1c')],'lastMsgDirection':_0x10c590[_0xe601('0x13')][_0xe601('0x14')]()});}})[_0xe601('0x1d')](function(_0x4e16fd){console[_0xe601('0x1e')](_0x4e16fd);});}_0x356e2d();}},'charset':_0xe601('0x1f'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x7b11=['subject','body','fromString','models','get','direction','toLowerCase','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','messageId','fti_mail_messages','plainBody'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x7b11,0x6e));var _0x17b1=function(_0x465740,_0x2b33df){_0x465740=_0x465740-0x0;var _0xee6a3e=_0x7b11[_0x465740];return _0xee6a3e;};'use strict';var _=require('lodash');var util=require(_0x17b1('0x0'));var logger=require(_0x17b1('0x1'))(_0x17b1('0x2'));var moment=require(_0x17b1('0x3'));var BPromise=require(_0x17b1('0x4'));var rp=require(_0x17b1('0x5'));var htmlToText=require(_0x17b1('0x6'));var fs=require('fs');var path=require(_0x17b1('0x7'));var rimraf=require('rimraf');var config=require(_0x17b1('0x8'));var attributes=require(_0x17b1('0x9'));module[_0x17b1('0xa')]=function(_0x1ae055,_0x1eef24){return _0x1ae055['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x17b1('0xb'),'fields':[_0x17b1('0xb')]},{'name':_0x17b1('0xc'),'fields':[_0x17b1('0xd'),_0x17b1('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xbdce5b,_0x5ca330,_0x4e2154){if(_0xbdce5b[_0x17b1('0xf')]){_0xbdce5b[_0x17b1('0xd')]=htmlToText[_0x17b1('0x10')](_0xbdce5b['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4e2154(null,_0x5ca330);},'afterCreate':function(_0x30eacf,_0x552c73,_0x4a20b8){var _0x523d01=_0x1ae055[_0x17b1('0x11')];var _0x29db0d=_0x30eacf[_0x17b1('0x12')]({'plain':!![]});if(_0x29db0d[_0x17b1('0x13')][_0x17b1('0x14')]()==='in'||_0x29db0d[_0x17b1('0x13')][_0x17b1('0x14')]()==='out'&&!_0x29db0d[_0x17b1('0x15')]&&!_[_0x17b1('0x16')](_0x29db0d['UserId'])){_0x523d01[_0x17b1('0x17')][_0x17b1('0x18')]({'where':{'id':_0x29db0d[_0x17b1('0x19')]}})[_0x17b1('0x1a')](function(_0x32f039){if(_0x32f039){_0x32f039[_0x17b1('0x1b')]({'lastMsgAt':_0x29db0d[_0x17b1('0x1c')],'lastMsgDirection':_0x29db0d[_0x17b1('0x13')]['toLowerCase']()});}})[_0x17b1('0x1d')](function(_0xf88e2e){console[_0x17b1('0x1e')](_0xf88e2e);});}_0x4a20b8();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index e269ff0..61b31c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4dc704,_0x420ef8){var _0xe12eb3=function(_0x34a350){while(--_0x34a350){_0x4dc704['push'](_0x4dc704['shift']());}};_0xe12eb3(++_0x420ef8);}(_0x5c3c,0x132));var _0xc5c3=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5c3c[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});};
\ No newline at end of file
+var _0xd4f4=['CreateMailMessage','create','body','options','raw','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x87620d,_0x15d8b8){var _0x12f8a1=function(_0x4e37a6){while(--_0x4e37a6){_0x87620d['push'](_0x87620d['shift']());}};_0x12f8a1(++_0x15d8b8);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x190cc4,_0x5ba234){_0x190cc4=_0x190cc4-0x0;var _0x1cce5c=_0xd4f4[_0x190cc4];return _0x1cce5c;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x4d4f('0xb')]=_[_0x4d4f('0xc')](config[_0x4d4f('0xb')],{'host':_0x4d4f('0xd'),'port':0x18eb});var socket=require(_0x4d4f('0xe'))(new Redis(config[_0x4d4f('0xb')]));require(_0x4d4f('0xf'))[_0x4d4f('0x10')](socket);function respondWithRpcPromise(_0x385597,_0xba5200,_0x20db50){return new BPromise(function(_0x88b592,_0x128d39){return client[_0x4d4f('0x11')](_0x385597,_0x20db50)[_0x4d4f('0x12')](function(_0x28fb3e){logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0xba5200,_0x4d4f('0x15'),JSON[_0x4d4f('0x16')](_0x28fb3e));if(_0x28fb3e['error']){if(_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x18')]===0x1f4){logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x128d39(_0x28fb3e[_0x4d4f('0x17')]['message']);}logger[_0x4d4f('0x17')]('MailMessage,\x20%s,\x20%s',_0xba5200,_0x28fb3e[_0x4d4f('0x17')][_0x4d4f('0x19')]);return _0x88b592(_0x28fb3e[_0x4d4f('0x17')]['message']);}else{logger[_0x4d4f('0x13')](_0x4d4f('0x14'),_0xba5200,'request\x20sent');_0x88b592(_0x28fb3e['result']['message']);}})['catch'](function(_0x5eebec){logger[_0x4d4f('0x17')](_0x4d4f('0x14'),_0xba5200,_0x5eebec);_0x128d39(_0x5eebec);});});}exports[_0x4d4f('0x1a')]=function(_0x3566a5){var _0x5d7b1f=this;return new Promise(function(_0x5b2863,_0x1e1ae2){return db['MailMessage'][_0x4d4f('0x1b')](_0x3566a5[_0x4d4f('0x1c')],{'raw':_0x3566a5[_0x4d4f('0x1d')]?_0x3566a5[_0x4d4f('0x1d')][_0x4d4f('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x570520){logger[_0x4d4f('0x13')]('CreateMailMessage',_0x3566a5);logger[_0x4d4f('0x1f')](_0x4d4f('0x1a'),_0x3566a5,JSON[_0x4d4f('0x16')](_0x570520));_0x5b2863(_0x570520);})[_0x4d4f('0x20')](function(_0xf3f7a4){logger['error'](_0x4d4f('0x1a'),_0xf3f7a4[_0x4d4f('0x19')],_0x3566a5);_0x1e1ae2(_0x5d7b1f[_0x4d4f('0x17')](0x1f4,_0xf3f7a4[_0x4d4f('0x19')]));});});};
\ No newline at end of file
index f7125a2..876f2aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34ad=['./mailMessage.events','save','remove','update','emit','removeListener','register'];(function(_0x22fb20,_0x3a7406){var _0x59065e=function(_0x419250){while(--_0x419250){_0x22fb20['push'](_0x22fb20['shift']());}};_0x59065e(++_0x3a7406);}(_0x34ad,0x181));var _0xd34a=function(_0x250071,_0x301941){_0x250071=_0x250071-0x0;var _0x34e574=_0x34ad[_0x250071];return _0x34e574;};'use strict';var MailMessageEvents=require(_0xd34a('0x0'));var events=[_0xd34a('0x1'),_0xd34a('0x2'),_0xd34a('0x3')];function createListener(_0x523878,_0x430aed){return function(_0x2aa7d8){_0x430aed[_0xd34a('0x4')](_0x523878,_0x2aa7d8);};}function removeListener(_0x487e69,_0x2fe32a){return function(){MailMessageEvents[_0xd34a('0x5')](_0x487e69,_0x2fe32a);};}exports[_0xd34a('0x6')]=function(_0x200419){for(var _0x533822=0x0,_0x4b8326=events['length'];_0x533822<_0x4b8326;_0x533822++){var _0x42557b=events[_0x533822];var _0x2d62ce=createListener('mailMessage:'+_0x42557b,_0x200419);MailMessageEvents['on'](_0x42557b,_0x2d62ce);}};
\ No newline at end of file
+var _0x5dd6=['./mailMessage.events','update','emit','removeListener','mailMessage:'];(function(_0x1f97e8,_0x445a4a){var _0x1ed77c=function(_0x1c990d){while(--_0x1c990d){_0x1f97e8['push'](_0x1f97e8['shift']());}};_0x1ed77c(++_0x445a4a);}(_0x5dd6,0x140));var _0x65dd=function(_0x56b540,_0x37f450){_0x56b540=_0x56b540-0x0;var _0xf62ffc=_0x5dd6[_0x56b540];return _0xf62ffc;};'use strict';var MailMessageEvents=require(_0x65dd('0x0'));var events=['save','remove',_0x65dd('0x1')];function createListener(_0x14f7c1,_0x5b2d39){return function(_0x256276){_0x5b2d39[_0x65dd('0x2')](_0x14f7c1,_0x256276);};}function removeListener(_0x3e0a98,_0x23d754){return function(){MailMessageEvents[_0x65dd('0x3')](_0x3e0a98,_0x23d754);};}exports['register']=function(_0x5b4580){for(var _0x3317e2=0x0,_0x6b180f=events['length'];_0x3317e2<_0x6b180f;_0x3317e2++){var _0x5cf2a6=events[_0x3317e2];var _0x45cec0=createListener(_0x65dd('0x4')+_0x5cf2a6,_0x5b4580);MailMessageEvents['on'](_0x5cf2a6,_0x45cec0);}};
\ No newline at end of file
index 6a96bf1..3e18c31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x625d=['getAgents','post','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','show','getMembers','/:id/teams','getTeams'];(function(_0x31c1de,_0x5e926a){var _0x135cf1=function(_0x52f28c){while(--_0x52f28c){_0x31c1de['push'](_0x31c1de['shift']());}};_0x135cf1(++_0x5e926a);}(_0x625d,0x1e8));var _0xd625=function(_0xd8768,_0x3fedcb){_0xd8768=_0xd8768-0x0;var _0x46228f=_0x625d[_0xd8768];return _0x46228f;};'use strict';var multer=require(_0xd625('0x0'));var util=require(_0xd625('0x1'));var path=require(_0xd625('0x2'));var timeout=require(_0xd625('0x3'));var express=require(_0xd625('0x4'));var router=express[_0xd625('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd625('0x6'));var interaction=require(_0xd625('0x7'));var config=require('../../config/environment');var controller=require(_0xd625('0x8'));router[_0xd625('0x9')]('/',auth[_0xd625('0xa')](),controller[_0xd625('0xb')]);router[_0xd625('0x9')]('/describe',auth[_0xd625('0xa')](),controller['describe']);router[_0xd625('0x9')]('/:id',auth[_0xd625('0xa')](),controller[_0xd625('0xc')]);router[_0xd625('0x9')]('/:id/members',auth[_0xd625('0xa')](),controller[_0xd625('0xd')]);router[_0xd625('0x9')](_0xd625('0xe'),auth['isAuthenticated'](),controller[_0xd625('0xf')]);router[_0xd625('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xd625('0x10')]);router[_0xd625('0x11')]('/',auth[_0xd625('0xa')](),controller['create']);router[_0xd625('0x11')](_0xd625('0xe'),auth[_0xd625('0xa')](),controller[_0xd625('0x12')]);router[_0xd625('0x11')](_0xd625('0x13'),auth['isAuthenticated'](),controller[_0xd625('0x14')]);router[_0xd625('0x15')]('/:id',auth[_0xd625('0xa')](),controller[_0xd625('0x16')]);router[_0xd625('0x17')](_0xd625('0x18'),auth[_0xd625('0xa')](),controller[_0xd625('0x19')]);router['delete'](_0xd625('0xe'),auth[_0xd625('0xa')](),controller[_0xd625('0x1a')]);router['delete'](_0xd625('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xd625('0x1b')]=router;
\ No newline at end of file
+var _0xce37=['removeTeams','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete'];(function(_0x5c8871,_0x275ce9){var _0x4a505d=function(_0x48ec7b){while(--_0x48ec7b){_0x5c8871['push'](_0x5c8871['shift']());}};_0x4a505d(++_0x275ce9);}(_0xce37,0x8e));var _0x7ce3=function(_0x58cdfa,_0x4a0ac2){_0x58cdfa=_0x58cdfa-0x0;var _0x3139a6=_0xce37[_0x58cdfa];return _0x3139a6;};'use strict';var multer=require(_0x7ce3('0x0'));var util=require(_0x7ce3('0x1'));var path=require(_0x7ce3('0x2'));var timeout=require('connect-timeout');var express=require(_0x7ce3('0x3'));var router=express[_0x7ce3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7ce3('0x5'));var interaction=require(_0x7ce3('0x6'));var config=require(_0x7ce3('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x9')]);router[_0x7ce3('0xa')](_0x7ce3('0xb'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0xc')]);router['get'](_0x7ce3('0xd'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0xe')]);router['get'](_0x7ce3('0xf'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x10')]);router[_0x7ce3('0xa')](_0x7ce3('0x11'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x12')]);router[_0x7ce3('0xa')](_0x7ce3('0x13'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x14')]);router[_0x7ce3('0x15')]('/',auth[_0x7ce3('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0x7ce3('0x8')](),controller['addTeams']);router[_0x7ce3('0x15')](_0x7ce3('0x13'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x16')]);router[_0x7ce3('0x17')](_0x7ce3('0xd'),auth[_0x7ce3('0x8')](),controller[_0x7ce3('0x18')]);router[_0x7ce3('0x19')](_0x7ce3('0xd'),auth[_0x7ce3('0x8')](),controller['destroy']);router[_0x7ce3('0x19')](_0x7ce3('0x11'),auth['isAuthenticated'](),controller[_0x7ce3('0x1a')]);router[_0x7ce3('0x19')](_0x7ce3('0x13'),auth[_0x7ce3('0x8')](),controller['removeAgents']);module[_0x7ce3('0x1b')]=router;
\ No newline at end of file
index ff053b8..5e03a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c5=['name','INTEGER','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x23a9f5,_0x49a481){var _0x5b9ed9=function(_0x39142c){while(--_0x39142c){_0x23a9f5['push'](_0x23a9f5['shift']());}};_0x5b9ed9(++_0x49a481);}(_0xb0c5,0x1e0));var _0x5b0c=function(_0x11d9af,_0x2415d8){_0x11d9af=_0x11d9af-0x0;var _0x14b992=_0xb0c5[_0x11d9af];return _0x14b992;};'use strict';var Sequelize=require(_0x5b0c('0x0'));module[_0x5b0c('0x1')]={'name':{'type':Sequelize[_0x5b0c('0x2')],'unique':_0x5b0c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5b0c('0x2')]},'timeout':{'type':Sequelize[_0x5b0c('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5b0c('0x5'),_0x5b0c('0x6'))}};
\ No newline at end of file
+var _0x2049=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x2049,0x1cc));var _0x9204=function(_0x300334,_0x539b1e){_0x300334=_0x300334-0x0;var _0x57ff5d=_0x2049[_0x300334];return _0x57ff5d;};'use strict';var Sequelize=require(_0x9204('0x0'));module[_0x9204('0x1')]={'name':{'type':Sequelize[_0x9204('0x2')],'unique':_0x9204('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9204('0x2')]},'timeout':{'type':Sequelize[_0x9204('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9204('0x5')](_0x9204('0x6'),_0x9204('0x7'),'roundrobin')}};
\ No newline at end of file
index 953215d..4a60543 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9314=['online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','transaction','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','MailQueues','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','MailQueue','includeAll','include','findAll','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','options','UserMailQueue','UserId','agent','updatedAt','format','SIP','mailPause','createdAt','getTeams','keys','addTeams','ids','Team','Agents'];(function(_0x1643db,_0x42b03a){var _0x45117b=function(_0x471a00){while(--_0x471a00){_0x1643db['push'](_0x1643db['shift']());}};_0x45117b(++_0x42b03a);}(_0x9314,0xb2));var _0x4931=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9314[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x4931('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4931('0x1'));var jsonpatch=require(_0x4931('0x2'));var rp=require(_0x4931('0x3'));var moment=require(_0x4931('0x4'));var BPromise=require(_0x4931('0x5'));var Mustache=require(_0x4931('0x6'));var util=require(_0x4931('0x7'));var path=require(_0x4931('0x8'));var sox=require(_0x4931('0x9'));var csv=require(_0x4931('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4931('0xb'));var _=require(_0x4931('0xc'));var squel=require(_0x4931('0xd'));var crypto=require(_0x4931('0xe'));var jsforce=require(_0x4931('0xf'));var deskjs=require(_0x4931('0x10'));var toCsv=require(_0x4931('0xa'));var querystring=require(_0x4931('0x11'));var Papa=require(_0x4931('0x12'));var Redis=require(_0x4931('0x13'));var authService=require(_0x4931('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x4931('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4931('0x16'))(_0x4931('0x17'));var utils=require('../../config/utils');var config=require(_0x4931('0x18'));var licenseUtil=require(_0x4931('0x19'));var db=require(_0x4931('0x1a'))['db'];config[_0x4931('0x1b')]=_[_0x4931('0x1c')](config[_0x4931('0x1b')],{'host':_0x4931('0x1d'),'port':0x18eb});var socket=require(_0x4931('0x1e'))(new Redis(config[_0x4931('0x1b')]));require(_0x4931('0x1f'))[_0x4931('0x20')](socket);function respondWithStatusCode(_0x5796e0,_0x2c2eab){_0x2c2eab=_0x2c2eab||0xcc;return function(_0x231727){if(_0x231727){return _0x5796e0[_0x4931('0x21')](_0x2c2eab);}return _0x5796e0[_0x4931('0x22')](_0x2c2eab)[_0x4931('0x23')]();};}function respondWithResult(_0x19b80d,_0x544e51){_0x544e51=_0x544e51||0xc8;return function(_0x13851f){if(_0x13851f){return _0x19b80d[_0x4931('0x22')](_0x544e51)['json'](_0x13851f);}};}function respondWithFilteredResult(_0x53084a,_0x1858bf){return function(_0x4edd97){if(_0x4edd97){var _0x45bd6f=typeof _0x1858bf[_0x4931('0x24')]===_0x4931('0x25')&&typeof _0x1858bf[_0x4931('0x26')]==='undefined';var _0x25493f=_0x4edd97[_0x4931('0x27')];var _0x22f156=_0x45bd6f?0x0:_0x1858bf['offset'];var _0x4cba9c=_0x45bd6f?_0x4edd97[_0x4931('0x27')]:_0x1858bf[_0x4931('0x24')]+_0x1858bf['limit'];var _0x15947e;if(_0x4cba9c>=_0x25493f){_0x4cba9c=_0x25493f;_0x15947e=0xc8;}else{_0x15947e=0xce;}_0x53084a[_0x4931('0x22')](_0x15947e);return _0x53084a['set'](_0x4931('0x28'),_0x22f156+'-'+_0x4cba9c+'/'+_0x25493f)['json'](_0x4edd97);}return null;};}function patchUpdates(_0x329dc0){return function(_0x495ec1){try{jsonpatch[_0x4931('0x29')](_0x495ec1,_0x329dc0,!![]);}catch(_0x218d93){return BPromise[_0x4931('0x2a')](_0x218d93);}return _0x495ec1[_0x4931('0x2b')]();};}function saveUpdates(_0x251bf5,_0x25bc6d){return function(_0x42cc8){if(_0x42cc8){return _0x42cc8[_0x4931('0x2c')](_0x251bf5)[_0x4931('0x2d')](function(_0x51521f){return _0x51521f;});}return null;};}function removeEntity(_0xc92044,_0x41fdb6){return function(_0x382a42){if(_0x382a42){return _0x382a42[_0x4931('0x2e')]()[_0x4931('0x2d')](function(){var _0x3b8592=_0x382a42['get']({'plain':!![]});var _0xe6ac13=_0x4931('0x2f');return db['UserProfileResource'][_0x4931('0x2e')]({'where':{'type':_0xe6ac13,'resourceId':_0x3b8592['id']}})['then'](function(){return _0x382a42;});})[_0x4931('0x2d')](function(){_0xc92044[_0x4931('0x22')](0xcc)[_0x4931('0x23')]();});}};}function handleEntityNotFound(_0x4598c4,_0x459018){return function(_0x2acbe2){if(!_0x2acbe2){_0x4598c4[_0x4931('0x21')](0x194);}return _0x2acbe2;};}function handleError(_0x585c9a,_0x4b040e){_0x4b040e=_0x4b040e||0x1f4;return function(_0x5b7291){logger[_0x4931('0x30')](_0x5b7291[_0x4931('0x31')]);if(_0x5b7291['name']){delete _0x5b7291[_0x4931('0x32')];}_0x585c9a['status'](_0x4b040e)[_0x4931('0x33')](_0x5b7291);};}exports[_0x4931('0x34')]=function(_0x400ca1,_0x95dbbf){var _0x319a99={},_0x2e8b40={},_0x5df392={'count':0x0,'rows':[]};var _0x5e13e9=_['map'](db['MailQueue'][_0x4931('0x35')],function(_0x309639){return{'name':_0x309639[_0x4931('0x36')],'type':_0x309639[_0x4931('0x37')][_0x4931('0x38')]};});_0x2e8b40[_0x4931('0x39')]=_[_0x4931('0x3a')](_0x5e13e9,_0x4931('0x32'));_0x2e8b40[_0x4931('0x3b')]=_['keys'](_0x400ca1[_0x4931('0x3b')]);_0x2e8b40[_0x4931('0x3c')]=_[_0x4931('0x3d')](_0x2e8b40['model'],_0x2e8b40['query']);_0x319a99[_0x4931('0x3e')]=_['intersection'](_0x2e8b40['model'],qs[_0x4931('0x3f')](_0x400ca1[_0x4931('0x3b')][_0x4931('0x3f')]));_0x319a99['attributes']=_0x319a99[_0x4931('0x3e')][_0x4931('0x40')]?_0x319a99[_0x4931('0x3e')]:_0x2e8b40[_0x4931('0x39')];if(!_0x400ca1[_0x4931('0x3b')][_0x4931('0x41')](_0x4931('0x42'))){_0x319a99['limit']=qs[_0x4931('0x26')](_0x400ca1[_0x4931('0x3b')]['limit']);_0x319a99[_0x4931('0x24')]=qs['offset'](_0x400ca1[_0x4931('0x3b')][_0x4931('0x24')]);}_0x319a99['order']=qs[_0x4931('0x43')](_0x400ca1[_0x4931('0x3b')][_0x4931('0x43')]);_0x319a99[_0x4931('0x44')]=qs[_0x4931('0x3c')](_[_0x4931('0x45')](_0x400ca1['query'],_0x2e8b40['filters']),_0x5e13e9);if(_0x400ca1['query'][_0x4931('0x46')]){_0x319a99[_0x4931('0x44')]=_['merge'](_0x319a99['where'],{'$or':_['map'](_0x5e13e9,function(_0x3ffca2){if(_0x3ffca2['type']!==_0x4931('0x47')){var _0x111bc4={};_0x111bc4[_0x3ffca2[_0x4931('0x32')]]={'$like':'%'+_0x400ca1['query'][_0x4931('0x46')]+'%'};return _0x111bc4;}})});}_0x319a99=_[_0x4931('0x48')]({},_0x319a99,_0x400ca1['options']);var _0x49402e={'where':_0x319a99[_0x4931('0x44')]};return db[_0x4931('0x49')][_0x4931('0x27')](_0x49402e)[_0x4931('0x2d')](function(_0x12f8d7){_0x5df392[_0x4931('0x27')]=_0x12f8d7;if(_0x400ca1[_0x4931('0x3b')][_0x4931('0x4a')]){_0x319a99[_0x4931('0x4b')]=[{'all':!![]}];}return db[_0x4931('0x49')][_0x4931('0x4c')](_0x319a99);})[_0x4931('0x2d')](function(_0x230763){_0x5df392[_0x4931('0x4d')]=_0x230763;return _0x5df392;})['then'](respondWithFilteredResult(_0x95dbbf,_0x319a99))[_0x4931('0x4e')](handleError(_0x95dbbf,null));};exports[_0x4931('0x4f')]=function(_0x470209,_0x2e6159){var _0xd39faf={'raw':!![],'where':{'id':_0x470209['params']['id']}},_0x2ce271={};_0x2ce271['model']=_['keys'](db['MailQueue'][_0x4931('0x35')]);_0x2ce271[_0x4931('0x3b')]=_['keys'](_0x470209[_0x4931('0x3b')]);_0x2ce271[_0x4931('0x3c')]=_[_0x4931('0x3d')](_0x2ce271[_0x4931('0x39')],_0x2ce271[_0x4931('0x3b')]);_0xd39faf['attributes']=_[_0x4931('0x3d')](_0x2ce271[_0x4931('0x39')],qs[_0x4931('0x3f')](_0x470209[_0x4931('0x3b')]['fields']));_0xd39faf[_0x4931('0x3e')]=_0xd39faf[_0x4931('0x3e')][_0x4931('0x40')]?_0xd39faf[_0x4931('0x3e')]:_0x2ce271[_0x4931('0x39')];if(_0x470209['query'][_0x4931('0x4a')]){_0xd39faf[_0x4931('0x4b')]=[{'all':!![]}];}_0xd39faf=_['merge']({},_0xd39faf,_0x470209['options']);return db[_0x4931('0x49')][_0x4931('0x50')](_0xd39faf)[_0x4931('0x2d')](handleEntityNotFound(_0x2e6159,null))['then'](respondWithResult(_0x2e6159,null))[_0x4931('0x4e')](handleError(_0x2e6159,null));};exports['create']=function(_0x1c258a,_0x21960f){return db['MailQueue'][_0x4931('0x51')](_0x1c258a[_0x4931('0x52')],{})[_0x4931('0x2d')](function(_0x5bb46f){var _0x18c65d=_0x1c258a[_0x4931('0x53')][_0x4931('0x54')]({'plain':!![]});if(!_0x18c65d)throw new Error(_0x4931('0x55'));if(_0x18c65d[_0x4931('0x56')]===_0x4931('0x53')){var _0x5077da=_0x5bb46f['get']({'plain':!![]});var _0x571129='MailQueues';return db[_0x4931('0x57')]['find']({'where':{'name':_0x571129,'userProfileId':_0x18c65d[_0x4931('0x58')]},'raw':!![]})[_0x4931('0x2d')](function(_0xa26fc5){if(_0xa26fc5&&_0xa26fc5[_0x4931('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x5077da['name'],'resourceId':_0x5077da['id'],'type':_0xa26fc5['name'],'sectionId':_0xa26fc5['id']},{})[_0x4931('0x2d')](function(){return _0x5bb46f;});}else{return _0x5bb46f;}})[_0x4931('0x4e')](function(_0x567685){logger[_0x4931('0x30')](_0x4931('0x5a'),_0x567685);throw _0x567685;});}return _0x5bb46f;})['then'](respondWithResult(_0x21960f,0xc9))[_0x4931('0x4e')](handleError(_0x21960f,null));};exports[_0x4931('0x2c')]=function(_0x415224,_0x220f85){if(_0x415224[_0x4931('0x52')]['id']){delete _0x415224[_0x4931('0x52')]['id'];}return db['MailQueue'][_0x4931('0x50')]({'where':{'id':_0x415224[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x220f85,null))['then'](saveUpdates(_0x415224['body'],null))[_0x4931('0x2d')](respondWithResult(_0x220f85,null))['catch'](handleError(_0x220f85,null));};exports[_0x4931('0x2e')]=function(_0x51f146,_0x3a8f8a){return db['MailQueue']['find']({'where':{'id':_0x51f146[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x3a8f8a,null))['then'](removeEntity(_0x3a8f8a,null))[_0x4931('0x4e')](handleError(_0x3a8f8a,null));};exports[_0x4931('0x5c')]=function(_0x12c165,_0x522d5f){return db[_0x4931('0x49')][_0x4931('0x5c')]()[_0x4931('0x2d')](respondWithResult(_0x522d5f,null))['catch'](handleError(_0x522d5f,null));};exports[_0x4931('0x5d')]=function(_0xaa0a96,_0x223771,_0x127d99){var _0x5a44b3={'raw':!![],'where':{}},_0x7fdddb={},_0x909eea;return db[_0x4931('0x49')][_0x4931('0x5e')]({'where':{'id':_0xaa0a96[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x223771,null))[_0x4931('0x2d')](function(_0x38b604){if(_0x38b604){_0x909eea=_0x38b604[_0x4931('0x54')]({'plain':!![]});_0x7fdddb['model']=_['keys'](db['UserMailQueue'][_0x4931('0x35')]);_0x7fdddb[_0x4931('0x3b')]=_['keys'](_0xaa0a96[_0x4931('0x3b')]);_0x7fdddb['filters']=_[_0x4931('0x3d')](_0x7fdddb[_0x4931('0x39')],_0x7fdddb[_0x4931('0x3b')]);_0x5a44b3['attributes']=_[_0x4931('0x3d')](_0x7fdddb[_0x4931('0x39')],qs[_0x4931('0x3f')](_0xaa0a96[_0x4931('0x3b')][_0x4931('0x3f')]));_0x5a44b3[_0x4931('0x3e')]=_0x5a44b3['attributes'][_0x4931('0x40')]?_0x5a44b3['attributes']:_0x7fdddb['model'];if(!_0xaa0a96['query']['hasOwnProperty'](_0x4931('0x42'))){_0x5a44b3[_0x4931('0x26')]=qs['limit'](_0xaa0a96['query'][_0x4931('0x26')]);_0x5a44b3['offset']=qs[_0x4931('0x24')](_0xaa0a96[_0x4931('0x3b')][_0x4931('0x24')]);}_0x5a44b3['order']=qs[_0x4931('0x43')](_0xaa0a96[_0x4931('0x3b')]['sort']);_0x5a44b3[_0x4931('0x44')]=qs[_0x4931('0x3c')](_[_0x4931('0x45')](_0xaa0a96[_0x4931('0x3b')],_0x7fdddb[_0x4931('0x3c')]));_0x5a44b3[_0x4931('0x44')]['MailQueueId']=_0x38b604['id'];if(_0xaa0a96[_0x4931('0x3b')][_0x4931('0x46')]){_0x5a44b3['where']=_[_0x4931('0x48')](_0x5a44b3[_0x4931('0x44')],{'$or':_[_0x4931('0x3a')](_0x5a44b3['attributes'],function(_0x49474a){var _0x15862f={};_0x15862f[_0x49474a]={'$like':'%'+_0xaa0a96[_0x4931('0x3b')][_0x4931('0x46')]+'%'};return _0x15862f;})});}_0x5a44b3=_['merge']({},_0x5a44b3,_0xaa0a96[_0x4931('0x5f')]);return db[_0x4931('0x60')][_0x4931('0x4c')](_0x5a44b3);}})[_0x4931('0x2d')](function(_0x3e68e3){if(_0x3e68e3){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x3e68e3,_0x4931('0x61')),'role':_0x4931('0x62')},'attributes':['id',_0x4931('0x32'),'mailPause',_0x4931('0x63'),'createdAt']});}})['then'](function(_0x4da9c9){if(_0x4da9c9){return{'count':_0x4da9c9[_0x4931('0x27')],'rows':_[_0x4931('0x3a')](_0x4da9c9[_0x4931('0x4d')],function(_0x1d8cca){return{'membername':_0x1d8cca[_0x4931('0x32')],'UserId':_0x1d8cca['id'],'queue_name':_0x909eea[_0x4931('0x32')],'MailQueueId':_0x909eea['id'],'interface':util[_0x4931('0x64')]('%s/%s',_0x4931('0x65'),_0x1d8cca[_0x4931('0x32')]),'penalty':0x0,'paused':_0x1d8cca[_0x4931('0x66')],'createdAt':_0x1d8cca[_0x4931('0x67')],'updatedAt':_0x1d8cca[_0x4931('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4931('0x2d')](respondWithFilteredResult(_0x223771,_0x5a44b3))['catch'](handleError(_0x223771,null));};exports[_0x4931('0x68')]=function(_0x15d7ab,_0x483f9b,_0x5cb18a){var _0x2ed1bd={};var _0x4f25ec={};var _0x47caaa;var _0x255054;return db[_0x4931('0x49')][_0x4931('0x5e')]({'where':{'id':_0x15d7ab[_0x4931('0x5b')]['id']}})['then'](handleEntityNotFound(_0x483f9b,null))[_0x4931('0x2d')](function(_0x516e69){if(_0x516e69){_0x47caaa=_0x516e69;_0x4f25ec[_0x4931('0x39')]=_[_0x4931('0x69')](db['Team'][_0x4931('0x35')]);_0x4f25ec['query']=_[_0x4931('0x69')](_0x15d7ab[_0x4931('0x3b')]);_0x4f25ec[_0x4931('0x3c')]=_[_0x4931('0x3d')](_0x4f25ec[_0x4931('0x39')],_0x4f25ec[_0x4931('0x3b')]);_0x2ed1bd['attributes']=_[_0x4931('0x3d')](_0x4f25ec[_0x4931('0x39')],qs[_0x4931('0x3f')](_0x15d7ab[_0x4931('0x3b')][_0x4931('0x3f')]));_0x2ed1bd[_0x4931('0x3e')]=_0x2ed1bd[_0x4931('0x3e')][_0x4931('0x40')]?_0x2ed1bd[_0x4931('0x3e')]:_0x4f25ec[_0x4931('0x39')];_0x2ed1bd['order']=qs[_0x4931('0x43')](_0x15d7ab[_0x4931('0x3b')][_0x4931('0x43')]);_0x2ed1bd[_0x4931('0x44')]=qs[_0x4931('0x3c')](_['pick'](_0x15d7ab['query'],_0x4f25ec[_0x4931('0x3c')]));if(_0x15d7ab[_0x4931('0x3b')][_0x4931('0x46')]){_0x2ed1bd['where']=_['merge'](_0x2ed1bd[_0x4931('0x44')],{'$or':_[_0x4931('0x3a')](_0x2ed1bd[_0x4931('0x3e')],function(_0x3bb375){var _0x51067a={};_0x51067a[_0x3bb375]={'$like':'%'+_0x15d7ab[_0x4931('0x3b')][_0x4931('0x46')]+'%'};return _0x51067a;})});}_0x2ed1bd=_['merge']({},_0x2ed1bd,_0x15d7ab[_0x4931('0x5f')]);return _0x47caaa['getTeams'](_0x2ed1bd);}})[_0x4931('0x2d')](function(_0x3e58af){if(_0x3e58af){_0x255054=_0x3e58af[_0x4931('0x40')];if(!_0x15d7ab[_0x4931('0x3b')][_0x4931('0x41')](_0x4931('0x42'))){_0x2ed1bd['limit']=qs[_0x4931('0x26')](_0x15d7ab['query'][_0x4931('0x26')]);_0x2ed1bd[_0x4931('0x24')]=qs['offset'](_0x15d7ab[_0x4931('0x3b')]['offset']);}return _0x47caaa[_0x4931('0x68')](_0x2ed1bd);}})['then'](function(_0x2d1800){if(_0x2d1800){return _0x2d1800?{'count':_0x255054,'rows':_0x2d1800}:null;}})[_0x4931('0x2d')](respondWithResult(_0x483f9b,null))['catch'](handleError(_0x483f9b,null));};exports[_0x4931('0x6a')]=function(_0xe6a4a3,_0x551e5e,_0x576be9){var _0x30ad2a=_0xe6a4a3[_0x4931('0x52')][_0x4931('0x6b')];return db[_0x4931('0x6c')][_0x4931('0x4c')]({'where':{'id':_0x30ad2a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4931('0x6d'),'attributes':['id',_0x4931('0x32'),_0x4931('0x6e'),_0x4931('0x6f'),_0x4931('0x70')],'raw':!![]}]})[_0x4931('0x2d')](function(_0x590900){if(_0x590900){var _0x114ca7=_[_0x4931('0x71')](_0x590900,function(_0x258f98){var _0x227297=_0x258f98['get']({'plain':!![]});return _0x227297[_0x4931('0x6d')];});return db[_0x4931('0x49')][_0x4931('0x50')]({'where':{'id':_0xe6a4a3[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](function(_0x504ca2){return db[_0x4931('0x72')]['transaction'](function(_0x105dbb){return _0x504ca2[_0x4931('0x6a')](_0x30ad2a,{'transaction':_0x105dbb})['then'](function(){return BPromise[_0x4931('0x73')](_0x114ca7,function(_0x4ff5ca){return db[_0x4931('0x60')][_0x4931('0x74')]({'where':{'UserId':_0x4ff5ca['id'],'MailQueueId':_0xe6a4a3[_0x4931('0x5b')]['id']},'transaction':_0x105dbb});});})[_0x4931('0x2d')](function(){_0x114ca7[_0x4931('0x75')](function(_0x3f9359){socket['emit']('userMailQueue:save',{'UserId':_0x3f9359['id'],'MailQueueId':_0x504ca2['id']});});});});});}})['then'](respondWithStatusCode(_0x551e5e,null))[_0x4931('0x4e')](handleError(_0x551e5e,null));};exports[_0x4931('0x76')]=function(_0x2b10bd,_0x3babd9,_0x4d13e7){return db[_0x4931('0x6c')][_0x4931('0x4c')]({'where':{'id':_0x2b10bd[_0x4931('0x3b')][_0x4931('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4931('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x4931('0x2d')](handleEntityNotFound(_0x3babd9,null))[_0x4931('0x2d')](function(_0x466616){var _0xb416c7=_[_0x4931('0x3a')](_0x466616,'id');var _0x46a649=[];var _0x5ce722=[];var _0x170faa=squel[_0x4931('0x77')]();_0x170faa['field']('tq.TeamId')[_0x4931('0x78')]('team_has_mail_queues','tq')[_0x4931('0x79')](_0x4931('0x7a'),'ut',_0x4931('0x7b'))[_0x4931('0x44')]('MailQueueId\x20=\x20?',_0x2b10bd['params']['id']);for(var _0x33dbaa=0x0;_0x33dbaa<_0x466616[_0x4931('0x40')];_0x33dbaa+=0x1){let _0x3d3476=_0x466616[_0x33dbaa];for(var _0x18cf5d=0x0;_0x18cf5d<_0x3d3476[_0x4931('0x6d')][_0x4931('0x40')];_0x18cf5d+=0x1){let _0x281fdc=_0x3d3476['Agents'][_0x18cf5d];var _0x2cb693=_0x170faa[_0x4931('0x7c')]();_0x2cb693[_0x4931('0x44')]('ut.UserId\x20=\x20?',_0x281fdc['id']);_0x5ce722[_0x4931('0x7d')](db['sequelize'][_0x4931('0x3b')](_0x2cb693[_0x4931('0x7e')](),{'type':db[_0x4931('0x72')][_0x4931('0x7f')][_0x4931('0x80')]})[_0x4931('0x2d')](function(_0x257fbd){if(_0x257fbd[_0x4931('0x40')]===0x1){return _0x281fdc['id'];}else{var _0x171797=_[_0x4931('0x81')](_['map'](_0x257fbd,_0x4931('0x82')),function(_0x4a75d2){return _[_0x4931('0x83')](_0xb416c7,_0x4a75d2);});if(_0x171797){return _0x281fdc['id'];}}}));}}return BPromise['all'](_0x5ce722)['then'](function(_0x1070d1){_0x46a649=_(_0x46a649)['union'](_0x1070d1)['compact']()['value']();return db[_0x4931('0x49')]['find']({'where':{'id':_0x2b10bd[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](function(_0x3cab73){return db[_0x4931('0x72')][_0x4931('0x84')](function(_0xc1cd33){return _0x3cab73[_0x4931('0x76')](_0x2b10bd[_0x4931('0x3b')][_0x4931('0x6b')],{'transaction':_0xc1cd33})['then'](function(){if(!_[_0x4931('0x85')](_0x46a649)){return _0x3cab73[_0x4931('0x86')](_0x46a649,{'transaction':_0xc1cd33});}})[_0x4931('0x2d')](function(){_0x46a649[_0x4931('0x75')](function(_0x2853ca){socket[_0x4931('0x87')](_0x4931('0x88'),{'UserId':_0x2853ca,'MailQueueId':_0x3cab73['id']});});});});});});})['then'](respondWithStatusCode(_0x3babd9,null))[_0x4931('0x4e')](handleError(_0x3babd9,null));};exports[_0x4931('0x89')]=function(_0x3c21a6,_0x3122f8,_0x57a3e8){return db[_0x4931('0x49')][_0x4931('0x50')]({'where':{'id':_0x3c21a6[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x3122f8,null))[_0x4931('0x2d')](function(_0x573797){if(_0x573797){return _0x573797[_0x4931('0x89')](_0x3c21a6[_0x4931('0x52')][_0x4931('0x6b')],_[_0x4931('0x8a')](_0x3c21a6['body'],[_0x4931('0x6b'),'id'])||{})[_0x4931('0x8b')](function(_0x3fd9f5){for(var _0x7fb89d=0x0;_0x7fb89d<_0x3c21a6[_0x4931('0x52')][_0x4931('0x6b')][_0x4931('0x40')];_0x7fb89d+=0x1){socket[_0x4931('0x87')](_0x4931('0x8c'),{'UserId':Number(_0x3c21a6[_0x4931('0x52')][_0x4931('0x6b')][_0x7fb89d]),'MailQueueId':Number(_0x3c21a6[_0x4931('0x5b')]['id'])});}return _0x3fd9f5;});}})['then'](respondWithResult(_0x3122f8,null))[_0x4931('0x4e')](handleError(_0x3122f8,null));};exports['removeAgents']=function(_0x310e68,_0x3c11f0,_0x5b3793){return db[_0x4931('0x49')]['find']({'where':{'id':_0x310e68[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0x3c11f0,null))[_0x4931('0x2d')](function(_0x133ffc){if(_0x133ffc){return _0x133ffc[_0x4931('0x86')](_0x310e68[_0x4931('0x3b')][_0x4931('0x6b')])[_0x4931('0x2d')](function(){if(_[_0x4931('0x8d')](_0x310e68[_0x4931('0x3b')][_0x4931('0x6b')])){for(var _0x4b9273=0x0;_0x4b9273<_0x310e68[_0x4931('0x3b')]['ids']['length'];_0x4b9273+=0x1){socket[_0x4931('0x87')](_0x4931('0x88'),{'UserId':Number(_0x310e68[_0x4931('0x3b')]['ids'][_0x4b9273]),'MailQueueId':Number(_0x310e68['params']['id'])});}}else{socket[_0x4931('0x87')]('userMailQueue:remove',{'UserId':Number(_0x310e68[_0x4931('0x3b')][_0x4931('0x6b')]),'MailQueueId':Number(_0x310e68[_0x4931('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3c11f0,null))['catch'](handleError(_0x3c11f0,null));};exports[_0x4931('0x8e')]=function(_0x177853,_0xeed7f1,_0xabbb24){var _0x3bbf9f={};var _0x2473f4={};var _0x4d66d9;var _0x25fcfe;return db['MailQueue'][_0x4931('0x5e')]({'where':{'id':_0x177853[_0x4931('0x5b')]['id']}})[_0x4931('0x2d')](handleEntityNotFound(_0xeed7f1,null))[_0x4931('0x2d')](function(_0x41c769){if(_0x41c769){_0x4d66d9=_0x41c769;_0x2473f4[_0x4931('0x39')]=_[_0x4931('0x69')](db[_0x4931('0x8f')][_0x4931('0x35')]);_0x2473f4[_0x4931('0x3b')]=_['keys'](_0x177853[_0x4931('0x3b')]);_0x2473f4['filters']=_[_0x4931('0x3d')](_0x2473f4[_0x4931('0x39')],_0x2473f4[_0x4931('0x3b')]);_0x3bbf9f[_0x4931('0x3e')]=_['intersection'](_0x2473f4['model'],qs[_0x4931('0x3f')](_0x177853[_0x4931('0x3b')]['fields']));_0x3bbf9f['attributes']=_0x3bbf9f[_0x4931('0x3e')][_0x4931('0x40')]?_0x3bbf9f[_0x4931('0x3e')]:_0x2473f4['model'];_0x3bbf9f['order']=qs[_0x4931('0x43')](_0x177853[_0x4931('0x3b')][_0x4931('0x43')]);_0x3bbf9f[_0x4931('0x44')]=qs[_0x4931('0x3c')](_[_0x4931('0x45')](_0x177853[_0x4931('0x3b')],_0x2473f4[_0x4931('0x3c')]));if(_0x177853['query'][_0x4931('0x46')]){_0x3bbf9f[_0x4931('0x44')]=_['merge'](_0x3bbf9f[_0x4931('0x44')],{'$or':_[_0x4931('0x3a')](_0x3bbf9f[_0x4931('0x3e')],function(_0xb5cf40){var _0x3eec7a={};_0x3eec7a[_0xb5cf40]={'$like':'%'+_0x177853[_0x4931('0x3b')][_0x4931('0x46')]+'%'};return _0x3eec7a;})});}_0x3bbf9f=_[_0x4931('0x48')]({},_0x3bbf9f,_0x177853[_0x4931('0x5f')]);return _0x4d66d9[_0x4931('0x8e')](_0x3bbf9f);}})[_0x4931('0x2d')](function(_0xbb5d38){if(_0xbb5d38){_0x25fcfe=_0xbb5d38[_0x4931('0x40')];if(!_0x177853[_0x4931('0x3b')][_0x4931('0x41')](_0x4931('0x42'))){_0x3bbf9f[_0x4931('0x26')]=qs[_0x4931('0x26')](_0x177853[_0x4931('0x3b')][_0x4931('0x26')]);_0x3bbf9f['offset']=qs[_0x4931('0x24')](_0x177853[_0x4931('0x3b')][_0x4931('0x24')]);}return _0x4d66d9[_0x4931('0x8e')](_0x3bbf9f);}})[_0x4931('0x2d')](function(_0x22f580){if(_0x22f580){return _0x22f580?{'count':_0x25fcfe,'rows':_0x22f580}:null;}})['then'](respondWithResult(_0xeed7f1,null))[_0x4931('0x4e')](handleError(_0xeed7f1,null));};
\ No newline at end of file
+var _0x404b=['limit','offset','Content-Range','save','update','then','get','MailQueues','UserProfileResource','destroy','error','name','send','index','map','type','key','keys','filters','intersection','query','attributes','model','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','MailQueue','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','userProfileId','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','nolimit','options','User','agent','mailPause','createdAt','format','SIP','updatedAt','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userMailQueue:save','Team','select','field','tq.TeamId','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','transaction','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json'];(function(_0x5a3ac7,_0xa2bf9b){var _0x11678a=function(_0x36469f){while(--_0x36469f){_0x5a3ac7['push'](_0x5a3ac7['shift']());}};_0x11678a(++_0xa2bf9b);}(_0x404b,0x68));var _0xb404=function(_0x15d9a4,_0x5a7709){_0x15d9a4=_0x15d9a4-0x0;var _0x2d007e=_0x404b[_0x15d9a4];return _0x2d007e;};'use strict';var emlformat=require(_0xb404('0x0'));var rimraf=require(_0xb404('0x1'));var zipdir=require(_0xb404('0x2'));var jsonpatch=require(_0xb404('0x3'));var rp=require(_0xb404('0x4'));var moment=require(_0xb404('0x5'));var BPromise=require(_0xb404('0x6'));var Mustache=require('mustache');var util=require(_0xb404('0x7'));var path=require(_0xb404('0x8'));var sox=require(_0xb404('0x9'));var csv=require(_0xb404('0xa'));var ejs=require(_0xb404('0xb'));var fs=require('fs');var fs_extra=require(_0xb404('0xc'));var _=require(_0xb404('0xd'));var squel=require(_0xb404('0xe'));var crypto=require(_0xb404('0xf'));var jsforce=require(_0xb404('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb404('0xa'));var querystring=require(_0xb404('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb404('0x12'));var hardwareService=require(_0xb404('0x13'));var logger=require(_0xb404('0x14'))('api');var utils=require(_0xb404('0x15'));var config=require(_0xb404('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb404('0x17'))['db'];config[_0xb404('0x18')]=_[_0xb404('0x19')](config[_0xb404('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb404('0x1a'))(new Redis(config[_0xb404('0x18')]));require(_0xb404('0x1b'))[_0xb404('0x1c')](socket);function respondWithStatusCode(_0x321254,_0x4a3134){_0x4a3134=_0x4a3134||0xcc;return function(_0x3f53ee){if(_0x3f53ee){return _0x321254[_0xb404('0x1d')](_0x4a3134);}return _0x321254[_0xb404('0x1e')](_0x4a3134)[_0xb404('0x1f')]();};}function respondWithResult(_0x16db73,_0x1413c2){_0x1413c2=_0x1413c2||0xc8;return function(_0x26ece8){if(_0x26ece8){return _0x16db73[_0xb404('0x1e')](_0x1413c2)[_0xb404('0x20')](_0x26ece8);}};}function respondWithFilteredResult(_0x42d280,_0x1cfad5){return function(_0x31ecad){if(_0x31ecad){var _0xa3f144=typeof _0x1cfad5['offset']==='undefined'&&typeof _0x1cfad5[_0xb404('0x21')]==='undefined';var _0x4b6e5f=_0x31ecad['count'];var _0x565be9=_0xa3f144?0x0:_0x1cfad5['offset'];var _0x2c48c5=_0xa3f144?_0x31ecad['count']:_0x1cfad5[_0xb404('0x22')]+_0x1cfad5[_0xb404('0x21')];var _0x1feee4;if(_0x2c48c5>=_0x4b6e5f){_0x2c48c5=_0x4b6e5f;_0x1feee4=0xc8;}else{_0x1feee4=0xce;}_0x42d280['status'](_0x1feee4);return _0x42d280['set'](_0xb404('0x23'),_0x565be9+'-'+_0x2c48c5+'/'+_0x4b6e5f)[_0xb404('0x20')](_0x31ecad);}return null;};}function patchUpdates(_0x4c7ba6){return function(_0x7741db){try{jsonpatch['apply'](_0x7741db,_0x4c7ba6,!![]);}catch(_0x232eea){return BPromise['reject'](_0x232eea);}return _0x7741db[_0xb404('0x24')]();};}function saveUpdates(_0x238e1a,_0x25dee6){return function(_0x27ea46){if(_0x27ea46){return _0x27ea46[_0xb404('0x25')](_0x238e1a)[_0xb404('0x26')](function(_0xf88479){return _0xf88479;});}return null;};}function removeEntity(_0x30e023,_0x64c4a7){return function(_0x4fc434){if(_0x4fc434){return _0x4fc434['destroy']()[_0xb404('0x26')](function(){var _0x483497=_0x4fc434[_0xb404('0x27')]({'plain':!![]});var _0x1b4a09=_0xb404('0x28');return db[_0xb404('0x29')][_0xb404('0x2a')]({'where':{'type':_0x1b4a09,'resourceId':_0x483497['id']}})[_0xb404('0x26')](function(){return _0x4fc434;});})[_0xb404('0x26')](function(){_0x30e023[_0xb404('0x1e')](0xcc)[_0xb404('0x1f')]();});}};}function handleEntityNotFound(_0x22b5f6,_0x1075eb){return function(_0x20d81){if(!_0x20d81){_0x22b5f6['sendStatus'](0x194);}return _0x20d81;};}function handleError(_0xecad40,_0x55b3e2){_0x55b3e2=_0x55b3e2||0x1f4;return function(_0x2cf90e){logger[_0xb404('0x2b')](_0x2cf90e['stack']);if(_0x2cf90e['name']){delete _0x2cf90e[_0xb404('0x2c')];}_0xecad40[_0xb404('0x1e')](_0x55b3e2)[_0xb404('0x2d')](_0x2cf90e);};}exports[_0xb404('0x2e')]=function(_0xac632c,_0x400c16){var _0x43a317={},_0x26ce3b={},_0x496fda={'count':0x0,'rows':[]};var _0x2e0d17=_[_0xb404('0x2f')](db['MailQueue']['rawAttributes'],function(_0x5d13ad){return{'name':_0x5d13ad['fieldName'],'type':_0x5d13ad[_0xb404('0x30')][_0xb404('0x31')]};});_0x26ce3b['model']=_['map'](_0x2e0d17,_0xb404('0x2c'));_0x26ce3b['query']=_[_0xb404('0x32')](_0xac632c['query']);_0x26ce3b[_0xb404('0x33')]=_[_0xb404('0x34')](_0x26ce3b['model'],_0x26ce3b[_0xb404('0x35')]);_0x43a317[_0xb404('0x36')]=_[_0xb404('0x34')](_0x26ce3b[_0xb404('0x37')],qs[_0xb404('0x38')](_0xac632c[_0xb404('0x35')][_0xb404('0x38')]));_0x43a317['attributes']=_0x43a317[_0xb404('0x36')][_0xb404('0x39')]?_0x43a317['attributes']:_0x26ce3b[_0xb404('0x37')];if(!_0xac632c[_0xb404('0x35')]['hasOwnProperty']('nolimit')){_0x43a317[_0xb404('0x21')]=qs[_0xb404('0x21')](_0xac632c[_0xb404('0x35')]['limit']);_0x43a317[_0xb404('0x22')]=qs[_0xb404('0x22')](_0xac632c['query'][_0xb404('0x22')]);}_0x43a317[_0xb404('0x3a')]=qs[_0xb404('0x3b')](_0xac632c[_0xb404('0x35')][_0xb404('0x3b')]);_0x43a317[_0xb404('0x3c')]=qs[_0xb404('0x33')](_[_0xb404('0x3d')](_0xac632c[_0xb404('0x35')],_0x26ce3b[_0xb404('0x33')]),_0x2e0d17);if(_0xac632c[_0xb404('0x35')][_0xb404('0x3e')]){_0x43a317[_0xb404('0x3c')]=_[_0xb404('0x3f')](_0x43a317[_0xb404('0x3c')],{'$or':_[_0xb404('0x2f')](_0x2e0d17,function(_0x510f3b){if(_0x510f3b[_0xb404('0x30')]!==_0xb404('0x40')){var _0x2398fd={};_0x2398fd[_0x510f3b[_0xb404('0x2c')]]={'$like':'%'+_0xac632c[_0xb404('0x35')][_0xb404('0x3e')]+'%'};return _0x2398fd;}})});}_0x43a317=_[_0xb404('0x3f')]({},_0x43a317,_0xac632c['options']);var _0x384fe5={'where':_0x43a317[_0xb404('0x3c')]};return db['MailQueue']['count'](_0x384fe5)[_0xb404('0x26')](function(_0xe7eaa7){_0x496fda[_0xb404('0x41')]=_0xe7eaa7;if(_0xac632c[_0xb404('0x35')][_0xb404('0x42')]){_0x43a317[_0xb404('0x43')]=[{'all':!![]}];}return db[_0xb404('0x44')][_0xb404('0x45')](_0x43a317);})[_0xb404('0x26')](function(_0x8cb6e5){_0x496fda[_0xb404('0x46')]=_0x8cb6e5;return _0x496fda;})['then'](respondWithFilteredResult(_0x400c16,_0x43a317))[_0xb404('0x47')](handleError(_0x400c16,null));};exports[_0xb404('0x48')]=function(_0x1fd028,_0x3e3f51){var _0x472caf={'raw':!![],'where':{'id':_0x1fd028[_0xb404('0x49')]['id']}},_0x201577={};_0x201577[_0xb404('0x37')]=_[_0xb404('0x32')](db[_0xb404('0x44')][_0xb404('0x4a')]);_0x201577[_0xb404('0x35')]=_[_0xb404('0x32')](_0x1fd028[_0xb404('0x35')]);_0x201577[_0xb404('0x33')]=_[_0xb404('0x34')](_0x201577[_0xb404('0x37')],_0x201577['query']);_0x472caf[_0xb404('0x36')]=_[_0xb404('0x34')](_0x201577['model'],qs['fields'](_0x1fd028[_0xb404('0x35')][_0xb404('0x38')]));_0x472caf[_0xb404('0x36')]=_0x472caf[_0xb404('0x36')]['length']?_0x472caf[_0xb404('0x36')]:_0x201577[_0xb404('0x37')];if(_0x1fd028['query'][_0xb404('0x42')]){_0x472caf[_0xb404('0x43')]=[{'all':!![]}];}_0x472caf=_[_0xb404('0x3f')]({},_0x472caf,_0x1fd028['options']);return db[_0xb404('0x44')][_0xb404('0x4b')](_0x472caf)[_0xb404('0x26')](handleEntityNotFound(_0x3e3f51,null))[_0xb404('0x26')](respondWithResult(_0x3e3f51,null))[_0xb404('0x47')](handleError(_0x3e3f51,null));};exports[_0xb404('0x4c')]=function(_0xb20469,_0xc0975d){return db[_0xb404('0x44')][_0xb404('0x4c')](_0xb20469[_0xb404('0x4d')],{})[_0xb404('0x26')](function(_0x14e67c){var _0x410c8c=_0xb20469[_0xb404('0x4e')]['get']({'plain':!![]});if(!_0x410c8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410c8c[_0xb404('0x4f')]===_0xb404('0x4e')){var _0x415f87=_0x14e67c['get']({'plain':!![]});var _0x902abc=_0xb404('0x28');return db['UserProfileSection'][_0xb404('0x4b')]({'where':{'name':_0x902abc,'userProfileId':_0x410c8c[_0xb404('0x50')]},'raw':!![]})[_0xb404('0x26')](function(_0x852d8d){if(_0x852d8d&&_0x852d8d['autoAssociation']===0x0){return db[_0xb404('0x29')][_0xb404('0x4c')]({'name':_0x415f87[_0xb404('0x2c')],'resourceId':_0x415f87['id'],'type':_0x852d8d['name'],'sectionId':_0x852d8d['id']},{})[_0xb404('0x26')](function(){return _0x14e67c;});}else{return _0x14e67c;}})[_0xb404('0x47')](function(_0x5bb362){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bb362);throw _0x5bb362;});}return _0x14e67c;})[_0xb404('0x26')](respondWithResult(_0xc0975d,0xc9))[_0xb404('0x47')](handleError(_0xc0975d,null));};exports[_0xb404('0x25')]=function(_0x5d2507,_0x19296b){if(_0x5d2507[_0xb404('0x4d')]['id']){delete _0x5d2507['body']['id'];}return db['MailQueue'][_0xb404('0x4b')]({'where':{'id':_0x5d2507[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x19296b,null))['then'](saveUpdates(_0x5d2507['body'],null))['then'](respondWithResult(_0x19296b,null))[_0xb404('0x47')](handleError(_0x19296b,null));};exports[_0xb404('0x2a')]=function(_0x42519f,_0x508384){return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0x42519f[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x508384,null))[_0xb404('0x26')](removeEntity(_0x508384,null))['catch'](handleError(_0x508384,null));};exports[_0xb404('0x51')]=function(_0xd847df,_0x55be63){return db[_0xb404('0x44')][_0xb404('0x51')]()['then'](respondWithResult(_0x55be63,null))[_0xb404('0x47')](handleError(_0x55be63,null));};exports[_0xb404('0x52')]=function(_0x4aba81,_0x4b5e37,_0x3e0ee7){var _0x3f9ed2={'raw':!![],'where':{}},_0x1a861c={},_0x2662b9;return db['MailQueue'][_0xb404('0x53')]({'where':{'id':_0x4aba81[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x4b5e37,null))['then'](function(_0x585036){if(_0x585036){_0x2662b9=_0x585036[_0xb404('0x27')]({'plain':!![]});_0x1a861c[_0xb404('0x37')]=_['keys'](db[_0xb404('0x54')]['rawAttributes']);_0x1a861c[_0xb404('0x35')]=_['keys'](_0x4aba81[_0xb404('0x35')]);_0x1a861c['filters']=_[_0xb404('0x34')](_0x1a861c[_0xb404('0x37')],_0x1a861c[_0xb404('0x35')]);_0x3f9ed2['attributes']=_[_0xb404('0x34')](_0x1a861c['model'],qs[_0xb404('0x38')](_0x4aba81[_0xb404('0x35')]['fields']));_0x3f9ed2[_0xb404('0x36')]=_0x3f9ed2['attributes'][_0xb404('0x39')]?_0x3f9ed2[_0xb404('0x36')]:_0x1a861c[_0xb404('0x37')];if(!_0x4aba81[_0xb404('0x35')][_0xb404('0x55')](_0xb404('0x56'))){_0x3f9ed2[_0xb404('0x21')]=qs[_0xb404('0x21')](_0x4aba81[_0xb404('0x35')][_0xb404('0x21')]);_0x3f9ed2[_0xb404('0x22')]=qs[_0xb404('0x22')](_0x4aba81['query'][_0xb404('0x22')]);}_0x3f9ed2[_0xb404('0x3a')]=qs[_0xb404('0x3b')](_0x4aba81['query']['sort']);_0x3f9ed2[_0xb404('0x3c')]=qs['filters'](_[_0xb404('0x3d')](_0x4aba81[_0xb404('0x35')],_0x1a861c[_0xb404('0x33')]));_0x3f9ed2[_0xb404('0x3c')]['MailQueueId']=_0x585036['id'];if(_0x4aba81[_0xb404('0x35')][_0xb404('0x3e')]){_0x3f9ed2['where']=_['merge'](_0x3f9ed2['where'],{'$or':_[_0xb404('0x2f')](_0x3f9ed2[_0xb404('0x36')],function(_0xf5335){var _0x29bf72={};_0x29bf72[_0xf5335]={'$like':'%'+_0x4aba81['query']['filter']+'%'};return _0x29bf72;})});}_0x3f9ed2=_[_0xb404('0x3f')]({},_0x3f9ed2,_0x4aba81[_0xb404('0x57')]);return db[_0xb404('0x54')][_0xb404('0x45')](_0x3f9ed2);}})[_0xb404('0x26')](function(_0xd5b4d7){if(_0xd5b4d7){return db[_0xb404('0x58')]['findAndCountAll']({'where':{'id':_['map'](_0xd5b4d7,'UserId'),'role':_0xb404('0x59')},'attributes':['id','name',_0xb404('0x5a'),'updatedAt',_0xb404('0x5b')]});}})[_0xb404('0x26')](function(_0x4f731e){if(_0x4f731e){return{'count':_0x4f731e[_0xb404('0x41')],'rows':_[_0xb404('0x2f')](_0x4f731e['rows'],function(_0xbf9d6c){return{'membername':_0xbf9d6c[_0xb404('0x2c')],'UserId':_0xbf9d6c['id'],'queue_name':_0x2662b9['name'],'MailQueueId':_0x2662b9['id'],'interface':util[_0xb404('0x5c')]('%s/%s',_0xb404('0x5d'),_0xbf9d6c[_0xb404('0x2c')]),'penalty':0x0,'paused':_0xbf9d6c[_0xb404('0x5a')],'createdAt':_0xbf9d6c[_0xb404('0x5b')],'updatedAt':_0xbf9d6c[_0xb404('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb404('0x26')](respondWithFilteredResult(_0x4b5e37,_0x3f9ed2))[_0xb404('0x47')](handleError(_0x4b5e37,null));};exports[_0xb404('0x5f')]=function(_0x59c451,_0x1632e4,_0x297795){var _0x172a50={};var _0x47162e={};var _0x5810bf;var _0x4211ae;return db['MailQueue']['findOne']({'where':{'id':_0x59c451['params']['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x1632e4,null))[_0xb404('0x26')](function(_0x142d0c){if(_0x142d0c){_0x5810bf=_0x142d0c;_0x47162e[_0xb404('0x37')]=_['keys'](db['Team']['rawAttributes']);_0x47162e['query']=_[_0xb404('0x32')](_0x59c451[_0xb404('0x35')]);_0x47162e[_0xb404('0x33')]=_[_0xb404('0x34')](_0x47162e['model'],_0x47162e['query']);_0x172a50['attributes']=_[_0xb404('0x34')](_0x47162e['model'],qs[_0xb404('0x38')](_0x59c451[_0xb404('0x35')][_0xb404('0x38')]));_0x172a50[_0xb404('0x36')]=_0x172a50[_0xb404('0x36')][_0xb404('0x39')]?_0x172a50['attributes']:_0x47162e[_0xb404('0x37')];_0x172a50[_0xb404('0x3a')]=qs['sort'](_0x59c451[_0xb404('0x35')][_0xb404('0x3b')]);_0x172a50[_0xb404('0x3c')]=qs[_0xb404('0x33')](_['pick'](_0x59c451[_0xb404('0x35')],_0x47162e[_0xb404('0x33')]));if(_0x59c451[_0xb404('0x35')][_0xb404('0x3e')]){_0x172a50[_0xb404('0x3c')]=_[_0xb404('0x3f')](_0x172a50[_0xb404('0x3c')],{'$or':_['map'](_0x172a50[_0xb404('0x36')],function(_0x208060){var _0x1e6542={};_0x1e6542[_0x208060]={'$like':'%'+_0x59c451[_0xb404('0x35')][_0xb404('0x3e')]+'%'};return _0x1e6542;})});}_0x172a50=_[_0xb404('0x3f')]({},_0x172a50,_0x59c451[_0xb404('0x57')]);return _0x5810bf[_0xb404('0x5f')](_0x172a50);}})[_0xb404('0x26')](function(_0x2abd63){if(_0x2abd63){_0x4211ae=_0x2abd63[_0xb404('0x39')];if(!_0x59c451[_0xb404('0x35')]['hasOwnProperty'](_0xb404('0x56'))){_0x172a50[_0xb404('0x21')]=qs[_0xb404('0x21')](_0x59c451[_0xb404('0x35')][_0xb404('0x21')]);_0x172a50[_0xb404('0x22')]=qs[_0xb404('0x22')](_0x59c451[_0xb404('0x35')][_0xb404('0x22')]);}return _0x5810bf[_0xb404('0x5f')](_0x172a50);}})[_0xb404('0x26')](function(_0x4df164){if(_0x4df164){return _0x4df164?{'count':_0x4211ae,'rows':_0x4df164}:null;}})['then'](respondWithResult(_0x1632e4,null))['catch'](handleError(_0x1632e4,null));};exports[_0xb404('0x60')]=function(_0x3d6054,_0x3be33d,_0x519522){var _0x5aec66=_0x3d6054[_0xb404('0x4d')]['ids'];return db['Team'][_0xb404('0x45')]({'where':{'id':_0x5aec66},'attributes':['id'],'include':[{'model':db[_0xb404('0x58')],'as':_0xb404('0x61'),'attributes':['id',_0xb404('0x2c'),_0xb404('0x62'),_0xb404('0x63'),_0xb404('0x64')],'raw':!![]}]})['then'](function(_0x1b633d){if(_0x1b633d){var _0x35c109=_[_0xb404('0x65')](_0x1b633d,function(_0x43189c){var _0x38e3e2=_0x43189c[_0xb404('0x27')]({'plain':!![]});return _0x38e3e2[_0xb404('0x61')];});return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0x3d6054[_0xb404('0x49')]['id']}})[_0xb404('0x26')](function(_0x1553cd){return db['sequelize']['transaction'](function(_0x4567ab){return _0x1553cd[_0xb404('0x60')](_0x5aec66,{'transaction':_0x4567ab})[_0xb404('0x26')](function(){return BPromise['each'](_0x35c109,function(_0x5da0ff){return db[_0xb404('0x54')][_0xb404('0x66')]({'where':{'UserId':_0x5da0ff['id'],'MailQueueId':_0x3d6054[_0xb404('0x49')]['id']},'transaction':_0x4567ab});});})[_0xb404('0x26')](function(){_0x35c109[_0xb404('0x67')](function(_0x44e2b7){socket[_0xb404('0x68')](_0xb404('0x69'),{'UserId':_0x44e2b7['id'],'MailQueueId':_0x1553cd['id']});});});});});}})[_0xb404('0x26')](respondWithStatusCode(_0x3be33d,null))[_0xb404('0x47')](handleError(_0x3be33d,null));};exports['removeTeams']=function(_0xe76186,_0x1f9d6f,_0x47d737){return db[_0xb404('0x6a')][_0xb404('0x45')]({'where':{'id':_0xe76186[_0xb404('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xb404('0x58')],'as':_0xb404('0x61'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1f9d6f,null))[_0xb404('0x26')](function(_0x3b873b){var _0x408e3b=_['map'](_0x3b873b,'id');var _0x1033be=[];var _0x30157b=[];var _0x366701=squel[_0xb404('0x6b')]();_0x366701[_0xb404('0x6c')](_0xb404('0x6d'))[_0xb404('0x6e')](_0xb404('0x6f'),'tq')['join'](_0xb404('0x70'),'ut',_0xb404('0x71'))[_0xb404('0x3c')](_0xb404('0x72'),_0xe76186['params']['id']);for(var _0x5be722=0x0;_0x5be722<_0x3b873b[_0xb404('0x39')];_0x5be722+=0x1){let _0x2c7443=_0x3b873b[_0x5be722];for(var _0x100a94=0x0;_0x100a94<_0x2c7443[_0xb404('0x61')]['length'];_0x100a94+=0x1){let _0xeab0ae=_0x2c7443['Agents'][_0x100a94];var _0x471304=_0x366701['clone']();_0x471304[_0xb404('0x3c')](_0xb404('0x73'),_0xeab0ae['id']);_0x30157b[_0xb404('0x74')](db[_0xb404('0x75')][_0xb404('0x35')](_0x471304[_0xb404('0x76')](),{'type':db[_0xb404('0x75')][_0xb404('0x77')][_0xb404('0x78')]})[_0xb404('0x26')](function(_0x53a128){if(_0x53a128[_0xb404('0x39')]===0x1){return _0xeab0ae['id'];}else{var _0x390723=_[_0xb404('0x79')](_[_0xb404('0x2f')](_0x53a128,'TeamId'),function(_0x58a669){return _[_0xb404('0x7a')](_0x408e3b,_0x58a669);});if(_0x390723){return _0xeab0ae['id'];}}}));}}return BPromise[_0xb404('0x7b')](_0x30157b)['then'](function(_0xfa4b77){_0x1033be=_(_0x1033be)[_0xb404('0x7c')](_0xfa4b77)[_0xb404('0x7d')]()[_0xb404('0x7e')]();return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0xe76186['params']['id']}})[_0xb404('0x26')](function(_0x94f7f8){return db[_0xb404('0x75')][_0xb404('0x7f')](function(_0x23f1dd){return _0x94f7f8['removeTeams'](_0xe76186['query'][_0xb404('0x80')],{'transaction':_0x23f1dd})[_0xb404('0x26')](function(){if(!_[_0xb404('0x81')](_0x1033be)){return _0x94f7f8['removeAgents'](_0x1033be,{'transaction':_0x23f1dd});}})[_0xb404('0x26')](function(){_0x1033be[_0xb404('0x67')](function(_0x23716f){socket['emit'](_0xb404('0x82'),{'UserId':_0x23716f,'MailQueueId':_0x94f7f8['id']});});});});});});})[_0xb404('0x26')](respondWithStatusCode(_0x1f9d6f,null))[_0xb404('0x47')](handleError(_0x1f9d6f,null));};exports['addAgents']=function(_0x1bde29,_0x4d7785,_0xc011b8){return db['MailQueue'][_0xb404('0x4b')]({'where':{'id':_0x1bde29[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x4d7785,null))['then'](function(_0x16a38b){if(_0x16a38b){return _0x16a38b[_0xb404('0x83')](_0x1bde29[_0xb404('0x4d')]['ids'],_[_0xb404('0x84')](_0x1bde29['body'],[_0xb404('0x80'),'id'])||{})[_0xb404('0x85')](function(_0x49e002){for(var _0x220510=0x0;_0x220510<_0x1bde29[_0xb404('0x4d')][_0xb404('0x80')]['length'];_0x220510+=0x1){socket[_0xb404('0x68')](_0xb404('0x69'),{'UserId':Number(_0x1bde29[_0xb404('0x4d')][_0xb404('0x80')][_0x220510]),'MailQueueId':Number(_0x1bde29[_0xb404('0x49')]['id'])});}return _0x49e002;});}})[_0xb404('0x26')](respondWithResult(_0x4d7785,null))[_0xb404('0x47')](handleError(_0x4d7785,null));};exports[_0xb404('0x86')]=function(_0x4bc31c,_0x2c92da,_0x20e3d3){return db[_0xb404('0x44')][_0xb404('0x4b')]({'where':{'id':_0x4bc31c[_0xb404('0x49')]['id']}})[_0xb404('0x26')](handleEntityNotFound(_0x2c92da,null))[_0xb404('0x26')](function(_0x4b867e){if(_0x4b867e){return _0x4b867e[_0xb404('0x86')](_0x4bc31c[_0xb404('0x35')][_0xb404('0x80')])[_0xb404('0x26')](function(){if(_[_0xb404('0x87')](_0x4bc31c['query']['ids'])){for(var _0x57e587=0x0;_0x57e587<_0x4bc31c['query'][_0xb404('0x80')]['length'];_0x57e587+=0x1){socket[_0xb404('0x68')](_0xb404('0x82'),{'UserId':Number(_0x4bc31c[_0xb404('0x35')]['ids'][_0x57e587]),'MailQueueId':Number(_0x4bc31c[_0xb404('0x49')]['id'])});}}else{socket[_0xb404('0x68')](_0xb404('0x82'),{'UserId':Number(_0x4bc31c[_0xb404('0x35')][_0xb404('0x80')]),'MailQueueId':Number(_0x4bc31c[_0xb404('0x49')]['id'])});}});}})[_0xb404('0x26')](respondWithStatusCode(_0x2c92da,null))[_0xb404('0x47')](handleError(_0x2c92da,null));};exports[_0xb404('0x88')]=function(_0x4562ea,_0xa97057,_0x444e0e){var _0x50ea9c={};var _0x29d078={};var _0x3c3c5e;var _0x2ae57a;return db[_0xb404('0x44')][_0xb404('0x53')]({'where':{'id':_0x4562ea['params']['id']}})[_0xb404('0x26')](handleEntityNotFound(_0xa97057,null))[_0xb404('0x26')](function(_0x23b968){if(_0x23b968){_0x3c3c5e=_0x23b968;_0x29d078[_0xb404('0x37')]=_[_0xb404('0x32')](db[_0xb404('0x58')][_0xb404('0x4a')]);_0x29d078[_0xb404('0x35')]=_[_0xb404('0x32')](_0x4562ea[_0xb404('0x35')]);_0x29d078[_0xb404('0x33')]=_[_0xb404('0x34')](_0x29d078[_0xb404('0x37')],_0x29d078[_0xb404('0x35')]);_0x50ea9c['attributes']=_['intersection'](_0x29d078[_0xb404('0x37')],qs[_0xb404('0x38')](_0x4562ea['query']['fields']));_0x50ea9c[_0xb404('0x36')]=_0x50ea9c[_0xb404('0x36')][_0xb404('0x39')]?_0x50ea9c['attributes']:_0x29d078[_0xb404('0x37')];_0x50ea9c['order']=qs[_0xb404('0x3b')](_0x4562ea[_0xb404('0x35')][_0xb404('0x3b')]);_0x50ea9c[_0xb404('0x3c')]=qs[_0xb404('0x33')](_[_0xb404('0x3d')](_0x4562ea[_0xb404('0x35')],_0x29d078[_0xb404('0x33')]));if(_0x4562ea[_0xb404('0x35')]['filter']){_0x50ea9c['where']=_[_0xb404('0x3f')](_0x50ea9c['where'],{'$or':_[_0xb404('0x2f')](_0x50ea9c[_0xb404('0x36')],function(_0x36c437){var _0x2090b2={};_0x2090b2[_0x36c437]={'$like':'%'+_0x4562ea['query'][_0xb404('0x3e')]+'%'};return _0x2090b2;})});}_0x50ea9c=_['merge']({},_0x50ea9c,_0x4562ea[_0xb404('0x57')]);return _0x3c3c5e['getAgents'](_0x50ea9c);}})[_0xb404('0x26')](function(_0x2284bb){if(_0x2284bb){_0x2ae57a=_0x2284bb[_0xb404('0x39')];if(!_0x4562ea[_0xb404('0x35')]['hasOwnProperty'](_0xb404('0x56'))){_0x50ea9c['limit']=qs['limit'](_0x4562ea[_0xb404('0x35')][_0xb404('0x21')]);_0x50ea9c['offset']=qs[_0xb404('0x22')](_0x4562ea[_0xb404('0x35')][_0xb404('0x22')]);}return _0x3c3c5e[_0xb404('0x88')](_0x50ea9c);}})['then'](function(_0x4a55ef){if(_0x4a55ef){return _0x4a55ef?{'count':_0x2ae57a,'rows':_0x4a55ef}:null;}})[_0xb404('0x26')](respondWithResult(_0xa97057,null))[_0xb404('0x47')](handleError(_0xa97057,null));};
\ No newline at end of file
index c171e56..27451ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9142=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailQueue'];(function(_0x3d1ac3,_0x2d49c4){var _0x312663=function(_0x3c48f8){while(--_0x3c48f8){_0x3d1ac3['push'](_0x3d1ac3['shift']());}};_0x312663(++_0x2d49c4);}(_0x9142,0x72));var _0x2914=function(_0x4f2729,_0x1b08a6){_0x4f2729=_0x4f2729-0x0;var _0x1fdcd6=_0x9142[_0x4f2729];return _0x1fdcd6;};'use strict';var EventEmitter=require(_0x2914('0x0'));var MailQueue=require(_0x2914('0x1'))['db'][_0x2914('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2914('0x3'),'afterUpdate':_0x2914('0x4'),'afterDestroy':_0x2914('0x5')};function emitEvent(_0x263fde){return function(_0x47a80f,_0x42518b,_0xcb2515){MailQueueEvents[_0x2914('0x6')](_0x263fde+':'+_0x47a80f['id'],_0x47a80f);MailQueueEvents[_0x2914('0x6')](_0x263fde,_0x47a80f);_0xcb2515(null);};}for(var e in events){if(events[_0x2914('0x7')](e)){var event=events[e];MailQueue[_0x2914('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
+var _0x93e0=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0x55dded,_0x328b3d){var _0x1cace2=function(_0x46e093){while(--_0x46e093){_0x55dded['push'](_0x55dded['shift']());}};_0x1cace2(++_0x328b3d);}(_0x93e0,0x11d));var _0x093e=function(_0x56ef32,_0x3ad740){_0x56ef32=_0x56ef32-0x0;var _0xa0a908=_0x93e0[_0x56ef32];return _0xa0a908;};'use strict';var EventEmitter=require(_0x093e('0x0'));var MailQueue=require(_0x093e('0x1'))['db'][_0x093e('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x093e('0x3')](0x0);var events={'afterCreate':_0x093e('0x4'),'afterUpdate':'update','afterDestroy':_0x093e('0x5')};function emitEvent(_0x4f28a2){return function(_0x3a90b3,_0x2263af,_0x2be53c){MailQueueEvents[_0x093e('0x6')](_0x4f28a2+':'+_0x3a90b3['id'],_0x3a90b3);MailQueueEvents[_0x093e('0x6')](_0x4f28a2,_0x3a90b3);_0x2be53c(null);};}for(var e in events){if(events[_0x093e('0x7')](e)){var event=events[e];MailQueue[_0x093e('0x8')](e,emitEvent(event));}}module[_0x093e('0x9')]=MailQueueEvents;
\ No newline at end of file
index 461cc27..3bfa8b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d7=['exports','define','MailQueue','mail_queues','lodash','request-promise','../../config/environment','./mailQueue.attributes'];(function(_0x356f1d,_0x202df6){var _0x24b7e2=function(_0x13edcf){while(--_0x13edcf){_0x356f1d['push'](_0x356f1d['shift']());}};_0x24b7e2(++_0x202df6);}(_0x69d7,0xcc));var _0x769d=function(_0x466051,_0x20663e){_0x466051=_0x466051-0x0;var _0x393818=_0x69d7[_0x466051];return _0x393818;};'use strict';var _=require(_0x769d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x769d('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x769d('0x2'));var attributes=require(_0x769d('0x3'));module[_0x769d('0x4')]=function(_0x2da310,_0x6a221c){return _0x2da310[_0x769d('0x5')](_0x769d('0x6'),attributes,{'tableName':_0x769d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1473=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x328fd9,_0x364764){var _0x1b1755=function(_0x587e1d){while(--_0x587e1d){_0x328fd9['push'](_0x328fd9['shift']());}};_0x1b1755(++_0x364764);}(_0x1473,0xcb));var _0x3147=function(_0x3c919d,_0x7ee751){_0x3c919d=_0x3c919d-0x0;var _0x438700=_0x1473[_0x3c919d];return _0x438700;};'use strict';var _=require(_0x3147('0x0'));var util=require('util');var logger=require(_0x3147('0x1'))(_0x3147('0x2'));var moment=require(_0x3147('0x3'));var BPromise=require(_0x3147('0x4'));var rp=require(_0x3147('0x5'));var fs=require('fs');var path=require(_0x3147('0x6'));var rimraf=require(_0x3147('0x7'));var config=require(_0x3147('0x8'));var attributes=require(_0x3147('0x9'));module['exports']=function(_0x34f31d,_0x4c7852){return _0x34f31d[_0x3147('0xa')](_0x3147('0xb'),attributes,{'tableName':_0x3147('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7dc838e..c4cfc5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6780=['GetMailQueue','MailQueue','findAll','options','raw','attributes','limit','include','map','model','then','info','stringify','find','where','ShowMailQueue','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch'];(function(_0x54b268,_0x5c29e4){var _0x49b935=function(_0x2ca36e){while(--_0x2ca36e){_0x54b268['push'](_0x54b268['shift']());}};_0x49b935(++_0x5c29e4);}(_0x6780,0x121));var _0x0678=function(_0x411696,_0x766af7){_0x411696=_0x411696-0x0;var _0xc3d57b=_0x6780[_0x411696];return _0xc3d57b;};'use strict';var _=require(_0x0678('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0678('0x1'));var rs=require(_0x0678('0x2'));var fs=require('fs');var Redis=require(_0x0678('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0678('0x4'));var logger=require('../../config/logger')(_0x0678('0x5'));var config=require(_0x0678('0x6'));var jayson=require(_0x0678('0x7'));var client=jayson[_0x0678('0x8')][_0x0678('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0678('0xa')],{'host':_0x0678('0xb'),'port':0x18eb});var socket=require(_0x0678('0xc'))(new Redis(config[_0x0678('0xa')]));require(_0x0678('0xd'))[_0x0678('0xe')](socket);function respondWithRpcPromise(_0x47ba74,_0x30b6ed,_0x4b399e){return new BPromise(function(_0x28b521,_0x2c4a19){return client[_0x0678('0xf')](_0x47ba74,_0x4b399e)['then'](function(_0x1624b0){logger['info'](_0x0678('0x10'),_0x30b6ed,_0x0678('0x11'));logger[_0x0678('0x12')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x30b6ed,_0x0678('0x11'),JSON['stringify'](_0x1624b0));if(_0x1624b0[_0x0678('0x13')]){if(_0x1624b0[_0x0678('0x13')][_0x0678('0x14')]===0x1f4){logger[_0x0678('0x13')](_0x0678('0x10'),_0x30b6ed,_0x1624b0['error'][_0x0678('0x15')]);return _0x2c4a19(_0x1624b0[_0x0678('0x13')]['message']);}logger[_0x0678('0x13')]('MailQueue,\x20%s,\x20%s',_0x30b6ed,_0x1624b0['error']['message']);return _0x28b521(_0x1624b0[_0x0678('0x13')][_0x0678('0x15')]);}else{logger['info']('MailQueue,\x20%s,\x20%s',_0x30b6ed,_0x0678('0x11'));_0x28b521(_0x1624b0['result'][_0x0678('0x15')]);}})[_0x0678('0x16')](function(_0x12d515){logger[_0x0678('0x13')]('MailQueue,\x20%s,\x20%s',_0x30b6ed,_0x12d515);_0x2c4a19(_0x12d515);});});}exports[_0x0678('0x17')]=function(_0x3c7ded){var _0x3af85c=this;return new Promise(function(_0x3f8c20,_0x3e3511){return db[_0x0678('0x18')][_0x0678('0x19')]({'raw':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c7ded['options']?_0x3c7ded[_0x0678('0x1a')]['where']||null:null,'attributes':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1c')]||null:null,'limit':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1d')]||null:null,'include':_0x3c7ded[_0x0678('0x1a')]?_0x3c7ded[_0x0678('0x1a')][_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x3c7ded['options'][_0x0678('0x1e')],function(_0x44daea){return{'model':db[_0x44daea[_0x0678('0x20')]],'as':_0x44daea['as'],'attributes':_0x44daea['attributes'],'include':_0x44daea[_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x44daea['include'],function(_0x199706){return{'model':db[_0x199706['model']],'as':_0x199706['as'],'attributes':_0x199706['attributes'],'include':_0x199706['include']?_['map'](_0x199706[_0x0678('0x1e')],function(_0x11b330){return{'model':db[_0x11b330['model']],'as':_0x11b330['as'],'attributes':_0x11b330[_0x0678('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0678('0x21')](function(_0x14a79d){logger[_0x0678('0x22')](_0x0678('0x17'),_0x3c7ded);logger[_0x0678('0x12')]('GetMailQueue',_0x3c7ded,JSON[_0x0678('0x23')](_0x14a79d));_0x3f8c20(_0x14a79d);})['catch'](function(_0x25a326){logger['error']('GetMailQueue',_0x25a326[_0x0678('0x15')],_0x3c7ded);_0x3e3511(_0x3af85c['error'](0x1f4,_0x25a326[_0x0678('0x15')]));});});};exports['ShowMailQueue']=function(_0x10aeeb){var _0x1f5f12=this;return new Promise(function(_0x39b8ca,_0x438187){return db[_0x0678('0x18')][_0x0678('0x24')]({'raw':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb['options'][_0x0678('0x1b')]===undefined?!![]:![]:!![],'where':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb[_0x0678('0x1a')][_0x0678('0x25')]||null:null,'attributes':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb[_0x0678('0x1a')][_0x0678('0x1c')]||null:null,'include':_0x10aeeb[_0x0678('0x1a')]?_0x10aeeb[_0x0678('0x1a')][_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x10aeeb[_0x0678('0x1a')][_0x0678('0x1e')],function(_0x52f2a1){return{'model':db[_0x52f2a1[_0x0678('0x20')]],'as':_0x52f2a1['as'],'attributes':_0x52f2a1[_0x0678('0x1c')],'include':_0x52f2a1[_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x52f2a1[_0x0678('0x1e')],function(_0x29071e){return{'model':db[_0x29071e[_0x0678('0x20')]],'as':_0x29071e['as'],'attributes':_0x29071e['attributes'],'include':_0x29071e[_0x0678('0x1e')]?_[_0x0678('0x1f')](_0x29071e['include'],function(_0x5e1a8e){return{'model':db[_0x5e1a8e['model']],'as':_0x5e1a8e['as'],'attributes':_0x5e1a8e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0678('0x21')](function(_0x404733){logger['info'](_0x0678('0x26'),_0x10aeeb);logger['debug'](_0x0678('0x26'),_0x10aeeb,JSON['stringify'](_0x404733));_0x39b8ca(_0x404733);})[_0x0678('0x16')](function(_0x1dee9c){logger[_0x0678('0x13')]('ShowMailQueue',_0x1dee9c['message'],_0x10aeeb);_0x438187(_0x1f5f12[_0x0678('0x13')](0x1f4,_0x1dee9c[_0x0678('0x15')]));});});};
\ No newline at end of file
+var _0xb5eb=['options','raw','attributes','limit','include','map','model','ShowMailQueue','find','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb5eb,0xd1));var _0xbb5e=function(_0x3293b2,_0x1471d4){_0x3293b2=_0x3293b2-0x0;var _0x54c10a=_0xb5eb[_0x3293b2];return _0x54c10a;};'use strict';var _=require('lodash');var util=require(_0xbb5e('0x0'));var moment=require(_0xbb5e('0x1'));var BPromise=require(_0xbb5e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb5e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbb5e('0x4'))('rpc');var config=require(_0xbb5e('0x5'));var jayson=require(_0xbb5e('0x6'));var client=jayson[_0xbb5e('0x7')][_0xbb5e('0x8')]({'port':0x232a});config[_0xbb5e('0x9')]=_[_0xbb5e('0xa')](config['redis'],{'host':_0xbb5e('0xb'),'port':0x18eb});var socket=require(_0xbb5e('0xc'))(new Redis(config['redis']));require(_0xbb5e('0xd'))[_0xbb5e('0xe')](socket);function respondWithRpcPromise(_0x27092a,_0x2db69b,_0x3bdca7){return new BPromise(function(_0x7ee5f0,_0x3c2aa9){return client[_0xbb5e('0xf')](_0x27092a,_0x3bdca7)[_0xbb5e('0x10')](function(_0x33040f){logger[_0xbb5e('0x11')](_0xbb5e('0x12'),_0x2db69b,_0xbb5e('0x13'));logger[_0xbb5e('0x14')](_0xbb5e('0x15'),_0x2db69b,_0xbb5e('0x13'),JSON[_0xbb5e('0x16')](_0x33040f));if(_0x33040f[_0xbb5e('0x17')]){if(_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x18')]===0x1f4){logger[_0xbb5e('0x17')](_0xbb5e('0x12'),_0x2db69b,_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x19')]);return _0x3c2aa9(_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x19')]);}logger[_0xbb5e('0x17')](_0xbb5e('0x12'),_0x2db69b,_0x33040f[_0xbb5e('0x17')][_0xbb5e('0x19')]);return _0x7ee5f0(_0x33040f[_0xbb5e('0x17')]['message']);}else{logger[_0xbb5e('0x11')](_0xbb5e('0x12'),_0x2db69b,'request\x20sent');_0x7ee5f0(_0x33040f[_0xbb5e('0x1a')][_0xbb5e('0x19')]);}})[_0xbb5e('0x1b')](function(_0x52d9c){logger[_0xbb5e('0x17')]('MailQueue,\x20%s,\x20%s',_0x2db69b,_0x52d9c);_0x3c2aa9(_0x52d9c);});});}exports[_0xbb5e('0x1c')]=function(_0x45990b){var _0x26370b=this;return new Promise(function(_0x97b0f9,_0x2abc11){return db[_0xbb5e('0x1d')][_0xbb5e('0x1e')]({'raw':_0x45990b['options']?_0x45990b[_0xbb5e('0x1f')][_0xbb5e('0x20')]===undefined?!![]:![]:!![],'where':_0x45990b[_0xbb5e('0x1f')]?_0x45990b['options']['where']||null:null,'attributes':_0x45990b[_0xbb5e('0x1f')]?_0x45990b['options'][_0xbb5e('0x21')]||null:null,'limit':_0x45990b[_0xbb5e('0x1f')]?_0x45990b[_0xbb5e('0x1f')][_0xbb5e('0x22')]||null:null,'include':_0x45990b[_0xbb5e('0x1f')]?_0x45990b[_0xbb5e('0x1f')][_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x45990b[_0xbb5e('0x1f')]['include'],function(_0x53eb1e){return{'model':db[_0x53eb1e[_0xbb5e('0x25')]],'as':_0x53eb1e['as'],'attributes':_0x53eb1e['attributes'],'include':_0x53eb1e[_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x53eb1e[_0xbb5e('0x23')],function(_0x1a1822){return{'model':db[_0x1a1822['model']],'as':_0x1a1822['as'],'attributes':_0x1a1822[_0xbb5e('0x21')],'include':_0x1a1822[_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x1a1822[_0xbb5e('0x23')],function(_0x262379){return{'model':db[_0x262379[_0xbb5e('0x25')]],'as':_0x262379['as'],'attributes':_0x262379[_0xbb5e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb5e('0x10')](function(_0xac38b8){logger[_0xbb5e('0x11')]('GetMailQueue',_0x45990b);logger[_0xbb5e('0x14')](_0xbb5e('0x1c'),_0x45990b,JSON['stringify'](_0xac38b8));_0x97b0f9(_0xac38b8);})[_0xbb5e('0x1b')](function(_0x507e2a){logger[_0xbb5e('0x17')](_0xbb5e('0x1c'),_0x507e2a[_0xbb5e('0x19')],_0x45990b);_0x2abc11(_0x26370b[_0xbb5e('0x17')](0x1f4,_0x507e2a[_0xbb5e('0x19')]));});});};exports[_0xbb5e('0x26')]=function(_0x569b7f){var _0xfbb76d=this;return new Promise(function(_0x3aa7bb,_0x57e78f){return db[_0xbb5e('0x1d')][_0xbb5e('0x27')]({'raw':_0x569b7f['options']?_0x569b7f[_0xbb5e('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x569b7f[_0xbb5e('0x1f')]?_0x569b7f[_0xbb5e('0x1f')]['where']||null:null,'attributes':_0x569b7f['options']?_0x569b7f[_0xbb5e('0x1f')][_0xbb5e('0x21')]||null:null,'include':_0x569b7f['options']?_0x569b7f['options'][_0xbb5e('0x23')]?_['map'](_0x569b7f[_0xbb5e('0x1f')][_0xbb5e('0x23')],function(_0x3282b9){return{'model':db[_0x3282b9['model']],'as':_0x3282b9['as'],'attributes':_0x3282b9['attributes'],'include':_0x3282b9[_0xbb5e('0x23')]?_[_0xbb5e('0x24')](_0x3282b9[_0xbb5e('0x23')],function(_0x355767){return{'model':db[_0x355767['model']],'as':_0x355767['as'],'attributes':_0x355767[_0xbb5e('0x21')],'include':_0x355767['include']?_[_0xbb5e('0x24')](_0x355767[_0xbb5e('0x23')],function(_0x330649){return{'model':db[_0x330649[_0xbb5e('0x25')]],'as':_0x330649['as'],'attributes':_0x330649[_0xbb5e('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb5e('0x10')](function(_0x526501){logger[_0xbb5e('0x11')]('ShowMailQueue',_0x569b7f);logger[_0xbb5e('0x14')](_0xbb5e('0x26'),_0x569b7f,JSON[_0xbb5e('0x16')](_0x526501));_0x3aa7bb(_0x526501);})[_0xbb5e('0x1b')](function(_0x315a9c){logger[_0xbb5e('0x17')](_0xbb5e('0x26'),_0x315a9c[_0xbb5e('0x19')],_0x569b7f);_0x57e78f(_0xfbb76d[_0xbb5e('0x17')](0x1f4,_0x315a9c[_0xbb5e('0x19')]));});});};
\ No newline at end of file
index a2a37aa..47ebbc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf612=['register','length','mailQueue:','./mailQueue.events','remove','update','emit','removeListener'];(function(_0x40682e,_0x2a4b75){var _0x5d6eab=function(_0x378004){while(--_0x378004){_0x40682e['push'](_0x40682e['shift']());}};_0x5d6eab(++_0x2a4b75);}(_0xf612,0x14b));var _0x2f61=function(_0x3dc15b,_0xca4cda){_0x3dc15b=_0x3dc15b-0x0;var _0x223cdf=_0xf612[_0x3dc15b];return _0x223cdf;};'use strict';var MailQueueEvents=require(_0x2f61('0x0'));var events=['save',_0x2f61('0x1'),_0x2f61('0x2')];function createListener(_0x43a157,_0x422781){return function(_0x4ef27c){_0x422781[_0x2f61('0x3')](_0x43a157,_0x4ef27c);};}function removeListener(_0x2bb367,_0x1cfaab){return function(){MailQueueEvents[_0x2f61('0x4')](_0x2bb367,_0x1cfaab);};}exports[_0x2f61('0x5')]=function(_0x3a5eba){for(var _0x51986d=0x0,_0x9d4f08=events[_0x2f61('0x6')];_0x51986d<_0x9d4f08;_0x51986d++){var _0x369643=events[_0x51986d];var _0x5aa2ee=createListener(_0x2f61('0x7')+_0x369643,_0x3a5eba);MailQueueEvents['on'](_0x369643,_0x5aa2ee);}};
\ No newline at end of file
+var _0xb574=['update','emit','removeListener','mailQueue:','./mailQueue.events','save'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xb574,0x106));var _0x4b57=function(_0xb39c8b,_0x380979){_0xb39c8b=_0xb39c8b-0x0;var _0x556ec1=_0xb574[_0xb39c8b];return _0x556ec1;};'use strict';var MailQueueEvents=require(_0x4b57('0x0'));var events=[_0x4b57('0x1'),'remove',_0x4b57('0x2')];function createListener(_0x3d351b,_0x5a4911){return function(_0x413f1d){_0x5a4911[_0x4b57('0x3')](_0x3d351b,_0x413f1d);};}function removeListener(_0x168524,_0x919851){return function(){MailQueueEvents[_0x4b57('0x4')](_0x168524,_0x919851);};}exports['register']=function(_0x4eb019){for(var _0x1c97e5=0x0,_0x4a4a0f=events['length'];_0x1c97e5<_0x4a4a0f;_0x1c97e5++){var _0x4b2d65=events[_0x1c97e5];var _0x548ee8=createListener(_0x4b57('0x5')+_0x4b2d65,_0x4eb019);MailQueueEvents['on'](_0x4b2d65,_0x548ee8);}};
\ No newline at end of file
index 3920561..4b506ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe08b=['update','destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','show','create','put','/:id'];(function(_0x2366ca,_0x1275b4){var _0x28bb9d=function(_0x45017e){while(--_0x45017e){_0x2366ca['push'](_0x2366ca['shift']());}};_0x28bb9d(++_0x1275b4);}(_0xe08b,0xd3));var _0xbe08=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xe08b[_0x521929];return _0x632436;};'use strict';var multer=require(_0xbe08('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe08('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbe08('0x2'));var interaction=require(_0xbe08('0x3'));var config=require(_0xbe08('0x4'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0xbe08('0x5')](),controller[_0xbe08('0x6')]);router[_0xbe08('0x7')](_0xbe08('0x8'),auth[_0xbe08('0x5')](),controller['describe']);router[_0xbe08('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbe08('0x9')]);router['post']('/',auth[_0xbe08('0x5')](),controller[_0xbe08('0xa')]);router[_0xbe08('0xb')](_0xbe08('0xc'),auth['isAuthenticated'](),controller[_0xbe08('0xd')]);router['delete'](_0xbe08('0xc'),auth[_0xbe08('0x5')](),controller[_0xbe08('0xe')]);module[_0xbe08('0xf')]=router;
\ No newline at end of file
+var _0xfa7a=['show','post','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4fe7e9,_0x8fdd7e){var _0x5eec06=function(_0x335639){while(--_0x335639){_0x4fe7e9['push'](_0x4fe7e9['shift']());}};_0x5eec06(++_0x8fdd7e);}(_0xfa7a,0xee));var _0xafa7=function(_0x5cfdae,_0x1104e0){_0x5cfdae=_0x5cfdae-0x0;var _0x4170bb=_0xfa7a[_0x5cfdae];return _0x4170bb;};'use strict';var multer=require(_0xafa7('0x0'));var util=require(_0xafa7('0x1'));var path=require(_0xafa7('0x2'));var timeout=require('connect-timeout');var express=require(_0xafa7('0x3'));var router=express['Router']();var fs_extra=require(_0xafa7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xafa7('0x5'));var config=require(_0xafa7('0x6'));var controller=require(_0xafa7('0x7'));router[_0xafa7('0x8')]('/',auth[_0xafa7('0x9')](),controller[_0xafa7('0xa')]);router[_0xafa7('0x8')](_0xafa7('0xb'),auth[_0xafa7('0x9')](),controller[_0xafa7('0xc')]);router[_0xafa7('0x8')](_0xafa7('0xd'),auth[_0xafa7('0x9')](),controller[_0xafa7('0xe')]);router[_0xafa7('0xf')]('/',auth[_0xafa7('0x9')](),controller[_0xafa7('0x10')]);router[_0xafa7('0x11')]('/:id',auth[_0xafa7('0x9')](),controller['update']);router[_0xafa7('0x12')](_0xafa7('0xd'),auth[_0xafa7('0x9')](),controller[_0xafa7('0x13')]);module[_0xafa7('0x14')]=router;
\ No newline at end of file
index 7433eab..0a79b84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae02=['exports','STRING','DATE','moment','sequelize'];(function(_0x23f50b,_0x54dd96){var _0x29ddc1=function(_0x4e3d73){while(--_0x4e3d73){_0x23f50b['push'](_0x23f50b['shift']());}};_0x29ddc1(++_0x54dd96);}(_0xae02,0xb7));var _0x2ae0=function(_0x3348ed,_0x3c4f28){_0x3348ed=_0x3348ed-0x0;var _0xace2a8=_0xae02[_0x3348ed];return _0xace2a8;};'use strict';var moment=require(_0x2ae0('0x0'));var Sequelize=require(_0x2ae0('0x1'));module[_0x2ae0('0x2')]={'uniqueid':{'type':Sequelize[_0x2ae0('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x2ae0('0x4')]},'leaveAt':{'type':Sequelize[_0x2ae0('0x4')]},'acceptAt':{'type':Sequelize[_0x2ae0('0x4')]},'exitAt':{'type':Sequelize[_0x2ae0('0x4')]},'reason':{'type':Sequelize[_0x2ae0('0x3')]}};
\ No newline at end of file
+var _0x4725=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4725,0xdc));var _0x5472=function(_0x498e42,_0x2dee3c){_0x498e42=_0x498e42-0x0;var _0x1abbcf=_0x4725[_0x498e42];return _0x1abbcf;};'use strict';var moment=require(_0x5472('0x0'));var Sequelize=require(_0x5472('0x1'));module[_0x5472('0x2')]={'uniqueid':{'type':Sequelize[_0x5472('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5472('0x3')]},'joinAt':{'type':Sequelize[_0x5472('0x4')]},'leaveAt':{'type':Sequelize[_0x5472('0x4')]},'acceptAt':{'type':Sequelize[_0x5472('0x4')]},'exitAt':{'type':Sequelize[_0x5472('0x4')]},'reason':{'type':Sequelize[_0x5472('0x3')]}};
\ No newline at end of file
index e9ff458..20436c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbff5=['squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','map','MailQueueReport','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash'];(function(_0x1d0e07,_0x2037e9){var _0x8912e0=function(_0x3b1c66){while(--_0x3b1c66){_0x1d0e07['push'](_0x1d0e07['shift']());}};_0x8912e0(++_0x2037e9);}(_0xbff5,0x1bc));var _0x5bff=function(_0x557388,_0x1e36c9){_0x557388=_0x557388-0x0;var _0x2c2411=_0xbff5[_0x557388];return _0x2c2411;};'use strict';var emlformat=require(_0x5bff('0x0'));var rimraf=require(_0x5bff('0x1'));var zipdir=require(_0x5bff('0x2'));var jsonpatch=require(_0x5bff('0x3'));var rp=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var BPromise=require(_0x5bff('0x6'));var Mustache=require('mustache');var util=require(_0x5bff('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bff('0x8'));var ejs=require(_0x5bff('0x9'));var fs=require('fs');var fs_extra=require(_0x5bff('0xa'));var _=require(_0x5bff('0xb'));var squel=require(_0x5bff('0xc'));var crypto=require(_0x5bff('0xd'));var jsforce=require(_0x5bff('0xe'));var deskjs=require(_0x5bff('0xf'));var toCsv=require(_0x5bff('0x8'));var querystring=require('querystring');var Papa=require(_0x5bff('0x10'));var Redis=require('ioredis');var authService=require(_0x5bff('0x11'));var qs=require(_0x5bff('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5bff('0x13'));var logger=require('../../config/logger')(_0x5bff('0x14'));var utils=require('../../config/utils');var config=require(_0x5bff('0x15'));var licenseUtil=require(_0x5bff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x132dc9,_0x50e1e9){_0x50e1e9=_0x50e1e9||0xcc;return function(_0x335e78){if(_0x335e78){return _0x132dc9[_0x5bff('0x17')](_0x50e1e9);}return _0x132dc9['status'](_0x50e1e9)[_0x5bff('0x18')]();};}function respondWithResult(_0xa16a3f,_0x5b0d2d){_0x5b0d2d=_0x5b0d2d||0xc8;return function(_0x5f2a55){if(_0x5f2a55){return _0xa16a3f[_0x5bff('0x19')](_0x5b0d2d)[_0x5bff('0x1a')](_0x5f2a55);}};}function respondWithFilteredResult(_0x3a507c,_0x4d883e){return function(_0x2d22ab){if(_0x2d22ab){var _0x4612ec=typeof _0x4d883e[_0x5bff('0x1b')]==='undefined'&&typeof _0x4d883e[_0x5bff('0x1c')]===_0x5bff('0x1d');var _0x38daa0=_0x2d22ab['count'];var _0xc9fbc3=_0x4612ec?0x0:_0x4d883e[_0x5bff('0x1b')];var _0x36653b=_0x4612ec?_0x2d22ab[_0x5bff('0x1e')]:_0x4d883e['offset']+_0x4d883e[_0x5bff('0x1c')];var _0x5357d4;if(_0x36653b>=_0x38daa0){_0x36653b=_0x38daa0;_0x5357d4=0xc8;}else{_0x5357d4=0xce;}_0x3a507c[_0x5bff('0x19')](_0x5357d4);return _0x3a507c['set'](_0x5bff('0x1f'),_0xc9fbc3+'-'+_0x36653b+'/'+_0x38daa0)[_0x5bff('0x1a')](_0x2d22ab);}return null;};}function patchUpdates(_0x2a83ce){return function(_0x6cbfa){try{jsonpatch[_0x5bff('0x20')](_0x6cbfa,_0x2a83ce,!![]);}catch(_0x2012e4){return BPromise[_0x5bff('0x21')](_0x2012e4);}return _0x6cbfa[_0x5bff('0x22')]();};}function saveUpdates(_0x155e16,_0x490bc1){return function(_0x5f2593){if(_0x5f2593){return _0x5f2593[_0x5bff('0x23')](_0x155e16)[_0x5bff('0x24')](function(_0x1e7f8a){return _0x1e7f8a;});}return null;};}function removeEntity(_0x352b1f,_0x31d26b){return function(_0x3913fd){if(_0x3913fd){return _0x3913fd[_0x5bff('0x25')]()['then'](function(){_0x352b1f['status'](0xcc)[_0x5bff('0x18')]();});}};}function handleEntityNotFound(_0x53bd97,_0x220c8f){return function(_0xcc091d){if(!_0xcc091d){_0x53bd97[_0x5bff('0x17')](0x194);}return _0xcc091d;};}function handleError(_0x6f18f1,_0xfa361d){_0xfa361d=_0xfa361d||0x1f4;return function(_0x1140eb){logger[_0x5bff('0x26')](_0x1140eb[_0x5bff('0x27')]);if(_0x1140eb['name']){delete _0x1140eb['name'];}_0x6f18f1[_0x5bff('0x19')](_0xfa361d)[_0x5bff('0x28')](_0x1140eb);};}exports['index']=function(_0x36a7d2,_0x588078){var _0x5470cb={},_0x3eda3a={},_0x5cf207={'count':0x0,'rows':[]};var _0x3ed23b=_[_0x5bff('0x29')](db[_0x5bff('0x2a')][_0x5bff('0x2b')],function(_0x48aee1){return{'name':_0x48aee1[_0x5bff('0x2c')],'type':_0x48aee1['type'][_0x5bff('0x2d')]};});_0x3eda3a['model']=_[_0x5bff('0x29')](_0x3ed23b,_0x5bff('0x2e'));_0x3eda3a[_0x5bff('0x2f')]=_[_0x5bff('0x30')](_0x36a7d2[_0x5bff('0x2f')]);_0x3eda3a[_0x5bff('0x31')]=_['intersection'](_0x3eda3a[_0x5bff('0x32')],_0x3eda3a[_0x5bff('0x2f')]);_0x5470cb[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x3eda3a[_0x5bff('0x32')],qs[_0x5bff('0x35')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x35')]));_0x5470cb['attributes']=_0x5470cb[_0x5bff('0x33')][_0x5bff('0x36')]?_0x5470cb[_0x5bff('0x33')]:_0x3eda3a[_0x5bff('0x32')];if(!_0x36a7d2['query'][_0x5bff('0x37')](_0x5bff('0x38'))){_0x5470cb['limit']=qs[_0x5bff('0x1c')](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1c')]);_0x5470cb[_0x5bff('0x1b')]=qs['offset'](_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x1b')]);}_0x5470cb[_0x5bff('0x39')]=qs['sort'](_0x36a7d2[_0x5bff('0x2f')]['sort']);_0x5470cb[_0x5bff('0x3a')]=qs[_0x5bff('0x31')](_[_0x5bff('0x3b')](_0x36a7d2['query'],_0x3eda3a[_0x5bff('0x31')]),_0x3ed23b);if(_0x36a7d2[_0x5bff('0x2f')][_0x5bff('0x3c')]){_0x5470cb['where']=_[_0x5bff('0x3d')](_0x5470cb[_0x5bff('0x3a')],{'$or':_['map'](_0x3ed23b,function(_0x265cdb){if(_0x265cdb[_0x5bff('0x3e')]!==_0x5bff('0x3f')){var _0x77a071={};_0x77a071[_0x265cdb[_0x5bff('0x2e')]]={'$like':'%'+_0x36a7d2['query'][_0x5bff('0x3c')]+'%'};return _0x77a071;}})});}_0x5470cb=_['merge']({},_0x5470cb,_0x36a7d2[_0x5bff('0x40')]);var _0x2fecb9={'where':_0x5470cb[_0x5bff('0x3a')]};return db[_0x5bff('0x2a')][_0x5bff('0x1e')](_0x2fecb9)[_0x5bff('0x24')](function(_0x1d0346){_0x5cf207['count']=_0x1d0346;if(_0x36a7d2['query'][_0x5bff('0x41')]){_0x5470cb[_0x5bff('0x42')]=[{'all':!![]}];}return db[_0x5bff('0x2a')][_0x5bff('0x43')](_0x5470cb);})[_0x5bff('0x24')](function(_0xb7b82a){_0x5cf207[_0x5bff('0x44')]=_0xb7b82a;return _0x5cf207;})[_0x5bff('0x24')](respondWithFilteredResult(_0x588078,_0x5470cb))['catch'](handleError(_0x588078,null));};exports[_0x5bff('0x45')]=function(_0x49676f,_0x3dc13f){var _0x1b8c7f={'raw':!![],'where':{'id':_0x49676f[_0x5bff('0x46')]['id']}},_0x543517={};_0x543517[_0x5bff('0x32')]=_['keys'](db[_0x5bff('0x2a')][_0x5bff('0x2b')]);_0x543517[_0x5bff('0x2f')]=_['keys'](_0x49676f[_0x5bff('0x2f')]);_0x543517[_0x5bff('0x31')]=_[_0x5bff('0x34')](_0x543517['model'],_0x543517[_0x5bff('0x2f')]);_0x1b8c7f[_0x5bff('0x33')]=_[_0x5bff('0x34')](_0x543517[_0x5bff('0x32')],qs['fields'](_0x49676f[_0x5bff('0x2f')]['fields']));_0x1b8c7f['attributes']=_0x1b8c7f[_0x5bff('0x33')][_0x5bff('0x36')]?_0x1b8c7f['attributes']:_0x543517[_0x5bff('0x32')];if(_0x49676f[_0x5bff('0x2f')]['includeAll']){_0x1b8c7f[_0x5bff('0x42')]=[{'all':!![]}];}_0x1b8c7f=_[_0x5bff('0x3d')]({},_0x1b8c7f,_0x49676f[_0x5bff('0x40')]);return db[_0x5bff('0x2a')]['find'](_0x1b8c7f)[_0x5bff('0x24')](handleEntityNotFound(_0x3dc13f,null))[_0x5bff('0x24')](respondWithResult(_0x3dc13f,null))[_0x5bff('0x47')](handleError(_0x3dc13f,null));};exports[_0x5bff('0x48')]=function(_0x1e94c5,_0x2588b8){return db['MailQueueReport'][_0x5bff('0x48')](_0x1e94c5[_0x5bff('0x49')],{})['then'](respondWithResult(_0x2588b8,0xc9))[_0x5bff('0x47')](handleError(_0x2588b8,null));};exports['update']=function(_0x47fc14,_0x4ff13a){if(_0x47fc14[_0x5bff('0x49')]['id']){delete _0x47fc14[_0x5bff('0x49')]['id'];}return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x47fc14[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x4ff13a,null))[_0x5bff('0x24')](saveUpdates(_0x47fc14[_0x5bff('0x49')],null))['then'](respondWithResult(_0x4ff13a,null))[_0x5bff('0x47')](handleError(_0x4ff13a,null));};exports[_0x5bff('0x25')]=function(_0x5e99f5,_0x16c61e){return db['MailQueueReport'][_0x5bff('0x4a')]({'where':{'id':_0x5e99f5[_0x5bff('0x46')]['id']}})[_0x5bff('0x24')](handleEntityNotFound(_0x16c61e,null))[_0x5bff('0x24')](removeEntity(_0x16c61e,null))[_0x5bff('0x47')](handleError(_0x16c61e,null));};exports['describe']=function(_0x36089e,_0x18018e){return db['MailQueueReport'][_0x5bff('0x4b')]()[_0x5bff('0x24')](respondWithResult(_0x18018e,null))['catch'](handleError(_0x18018e,null));};
\ No newline at end of file
+var _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0xba34,0x119));var _0x4ba3=function(_0x3699b0,_0x15eddf){_0x3699b0=_0x3699b0-0x0;var _0x50d016=_0xba34[_0x3699b0];return _0x50d016;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['MailQueueReport']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));};
\ No newline at end of file
index ceb10c7..1e2d572 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bb4=['./mailQueueReport.attributes','define','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x985b60,_0x3dde28){var _0x1227df=function(_0x391431){while(--_0x391431){_0x985b60['push'](_0x985b60['shift']());}};_0x1227df(++_0x3dde28);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x53df61,_0xca26f5){_0x53df61=_0x53df61-0x0;var _0x466435=_0x1bb4[_0x53df61];return _0x466435;};'use strict';var _=require(_0x41bb('0x0'));var util=require(_0x41bb('0x1'));var logger=require(_0x41bb('0x2'))(_0x41bb('0x3'));var moment=require(_0x41bb('0x4'));var BPromise=require('bluebird');var rp=require(_0x41bb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x41bb('0x6'));var config=require('../../config/environment');var attributes=require(_0x41bb('0x7'));module['exports']=function(_0x232b17,_0x3ab646){return _0x232b17[_0x41bb('0x8')]('MailQueueReport',attributes,{'tableName':_0x41bb('0x9'),'paranoid':![],'indexes':[{'name':_0x41bb('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8a5=['report_mail_queue','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport'];(function(_0x2b2c53,_0x4bcf9b){var _0x311ec2=function(_0x4a8e72){while(--_0x4a8e72){_0x2b2c53['push'](_0x2b2c53['shift']());}};_0x311ec2(++_0x4bcf9b);}(_0xd8a5,0x160));var _0x5d8a=function(_0x3ba508,_0x4991d7){_0x3ba508=_0x3ba508-0x0;var _0x55fcf5=_0xd8a5[_0x3ba508];return _0x55fcf5;};'use strict';var _=require(_0x5d8a('0x0'));var util=require('util');var logger=require(_0x5d8a('0x1'))(_0x5d8a('0x2'));var moment=require('moment');var BPromise=require(_0x5d8a('0x3'));var rp=require(_0x5d8a('0x4'));var fs=require('fs');var path=require(_0x5d8a('0x5'));var rimraf=require(_0x5d8a('0x6'));var config=require(_0x5d8a('0x7'));var attributes=require(_0x5d8a('0x8'));module[_0x5d8a('0x9')]=function(_0x38eaa5,_0x1ef405){return _0x38eaa5[_0x5d8a('0xa')](_0x5d8a('0xb'),attributes,{'tableName':_0x5d8a('0xc'),'paranoid':![],'indexes':[{'name':_0x5d8a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 46729da..0f93af8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x470ce2,_0x4b3815){var _0x739076=function(_0x1f16f3){while(--_0x1f16f3){_0x470ce2['push'](_0x470ce2['shift']());}};_0x739076(++_0x4b3815);}(_0x2ef3,0xba));var _0x32ef=function(_0x2eebc3,_0xc2acdf){_0x2eebc3=_0x2eebc3-0x0;var _0x1a7f81=_0x2ef3[_0x2eebc3];return _0x1a7f81;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});};
\ No newline at end of file
+var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f517f,_0x397c41){var _0x3d1586=function(_0x1df0a8){while(--_0x1df0a8){_0x4f517f['push'](_0x4f517f['shift']());}};_0x3d1586(++_0x397c41);}(_0x1261,0x144));var _0x1126=function(_0xd27ded,_0x1164e2){_0xd27ded=_0xd27ded-0x0;var _0x5ef850=_0x1261[_0xd27ded];return _0x5ef850;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});};
\ No newline at end of file
index 195f957..665ce1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d5201,_0x28ccfc){var _0x163d60=function(_0x22a702){while(--_0x22a702){_0x2d5201['push'](_0x2d5201['shift']());}};_0x163d60(++_0x28ccfc);}(_0xe706,0xa3));var _0x6e70=function(_0xe5b349,_0x5f06e4){_0xe5b349=_0xe5b349-0x0;var _0x26b0ad=_0xe706[_0xe5b349];return _0x26b0ad;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x361e06,_0x209107){var _0x40591e=function(_0x56d733){while(--_0x56d733){_0x361e06['push'](_0x361e06['shift']());}};_0x40591e(++_0x209107);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 5b5318f..e6e8b86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ef=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x3e1c9c,_0x277057){var _0x651232=function(_0x24d6c6){while(--_0x24d6c6){_0x3e1c9c['push'](_0x3e1c9c['shift']());}};_0x651232(++_0x277057);}(_0x42ef,0x18e));var _0xf42e=function(_0x224fe5,_0x51fd03){_0x224fe5=_0x224fe5-0x0;var _0x4735a9=_0x42ef[_0x224fe5];return _0x4735a9;};'use strict';var Sequelize=require(_0xf42e('0x0'));module[_0xf42e('0x1')]={'description':{'type':Sequelize[_0xf42e('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xf42e('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf42e('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf42e('0x4')]},'tls':{'type':Sequelize[_0xf42e('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xf42e('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf42e('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf42e('0x2')]},'modernAuthentication':{'type':Sequelize[_0xf42e('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x75a9=['sequelize','STRING','BOOLEAN','INTEGER','INBOX'];(function(_0x2b4379,_0x43f502){var _0xb9a7f=function(_0x5ad58d){while(--_0x5ad58d){_0x2b4379['push'](_0x2b4379['shift']());}};_0xb9a7f(++_0x43f502);}(_0x75a9,0x1ef));var _0x975a=function(_0x2400df,_0x389337){_0x2400df=_0x2400df-0x0;var _0x1ee6d6=_0x75a9[_0x2400df];return _0x1ee6d6;};'use strict';var Sequelize=require(_0x975a('0x0'));module['exports']={'description':{'type':Sequelize[_0x975a('0x1')]},'host':{'type':Sequelize[_0x975a('0x1')]},'authentication':{'type':Sequelize[_0x975a('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x975a('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x975a('0x3')]},'tls':{'type':Sequelize[_0x975a('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x975a('0x1')],'defaultValue':_0x975a('0x4')},'connTimeout':{'type':Sequelize[_0x975a('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x975a('0x1')]},'modernAuthentication':{'type':Sequelize[_0x975a('0x2')],'defaultValue':![]}};
\ No newline at end of file
index d4f62e7..3885943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbabb=['request-promise','path','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','api','moment','bluebird'];(function(_0x36d1c1,_0x4e6866){var _0x19883d=function(_0x594e1d){while(--_0x594e1d){_0x36d1c1['push'](_0x36d1c1['shift']());}};_0x19883d(++_0x4e6866);}(_0xbabb,0x1e0));var _0xbbab=function(_0x43b55d,_0x47055e){_0x43b55d=_0x43b55d-0x0;var _0x5a8eea=_0xbabb[_0x43b55d];return _0x5a8eea;};'use strict';var _=require(_0xbbab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbbab('0x1'));var moment=require(_0xbbab('0x2'));var BPromise=require(_0xbbab('0x3'));var rp=require(_0xbbab('0x4'));var fs=require('fs');var path=require(_0xbbab('0x5'));var rimraf=require('rimraf');var config=require(_0xbbab('0x6'));var attributes=require(_0xbbab('0x7'));module[_0xbbab('0x8')]=function(_0x4200c8,_0x1e9e31){return _0x4200c8['define'](_0xbbab('0x9'),attributes,{'tableName':_0xbbab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb22d=['path','../../config/environment','exports','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0xe5b435,_0x568337){var _0x34d5de=function(_0x47bd9d){while(--_0x47bd9d){_0xe5b435['push'](_0xe5b435['shift']());}};_0x34d5de(++_0x568337);}(_0xb22d,0x13a));var _0xdb22=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0xb22d[_0x596c43];return _0x4e1315;};'use strict';var _=require(_0xdb22('0x0'));var util=require(_0xdb22('0x1'));var logger=require(_0xdb22('0x2'))(_0xdb22('0x3'));var moment=require('moment');var BPromise=require(_0xdb22('0x4'));var rp=require(_0xdb22('0x5'));var fs=require('fs');var path=require(_0xdb22('0x6'));var rimraf=require('rimraf');var config=require(_0xdb22('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xdb22('0x8')]=function(_0x5a94c6,_0x2a95f4){return _0x5a94c6['define']('MailServerIn',attributes,{'tableName':_0xdb22('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 134572c..e1af6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17f=['MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0xc17f,0xb8));var _0xfc17=function(_0x2b5784,_0x3fcb61){_0x2b5784=_0x2b5784-0x0;var _0x234ef2=_0xc17f[_0x2b5784];return _0x234ef2;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require(_0xfc17('0x3'));var rs=require(_0xfc17('0x4'));var fs=require('fs');var Redis=require(_0xfc17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc17('0x6'));var logger=require(_0xfc17('0x7'))(_0xfc17('0x8'));var config=require(_0xfc17('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfc17('0xa')][_0xfc17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21c2ef,_0x11fa33,_0x404ee0){return new BPromise(function(_0x3cd590,_0x149054){return client[_0xfc17('0xc')](_0x21c2ef,_0x404ee0)['then'](function(_0x33bd35){logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x11fa33,_0xfc17('0xf'),JSON[_0xfc17('0x10')](_0x33bd35));if(_0x33bd35[_0xfc17('0x11')]){if(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x12')]===0x1f4){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);return _0x149054(_0x33bd35[_0xfc17('0x11')]['message']);}logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x33bd35[_0xfc17('0x11')]['message']);return _0x3cd590(_0x33bd35[_0xfc17('0x11')][_0xfc17('0x13')]);}else{logger[_0xfc17('0xd')](_0xfc17('0xe'),_0x11fa33,_0xfc17('0xf'));_0x3cd590(_0x33bd35[_0xfc17('0x14')][_0xfc17('0x13')]);}})[_0xfc17('0x15')](function(_0x35f947){logger[_0xfc17('0x11')](_0xfc17('0xe'),_0x11fa33,_0x35f947);_0x149054(_0x35f947);});});}exports[_0xfc17('0x16')]=function(_0x2bbb0e){var _0x5b2c7c=this;return new Promise(function(_0x544740,_0x2aa3a2){return db[_0xfc17('0x17')][_0xfc17('0x18')]({'raw':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')]['where']||null:null,'attributes':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1b')]||null:null,'limit':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1c')]||null:null,'include':_0x2bbb0e[_0xfc17('0x19')]?_0x2bbb0e[_0xfc17('0x19')][_0xfc17('0x1d')]?_[_0xfc17('0x1e')](_0x2bbb0e['options'][_0xfc17('0x1d')],function(_0x2285df){return{'model':db[_0x2285df[_0xfc17('0x1f')]],'as':_0x2285df['as'],'attributes':_0x2285df[_0xfc17('0x1b')],'include':_0x2285df[_0xfc17('0x1d')]?_[_0xfc17('0x1e')](_0x2285df['include'],function(_0x1cab65){return{'model':db[_0x1cab65[_0xfc17('0x1f')]],'as':_0x1cab65['as'],'attributes':_0x1cab65['attributes'],'include':_0x1cab65[_0xfc17('0x1d')]?_[_0xfc17('0x1e')](_0x1cab65['include'],function(_0x4e4cf5){return{'model':db[_0x4e4cf5[_0xfc17('0x1f')]],'as':_0x4e4cf5['as'],'attributes':_0x4e4cf5[_0xfc17('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4301c3){logger[_0xfc17('0xd')]('GetMailServerIn',_0x2bbb0e);logger[_0xfc17('0x20')](_0xfc17('0x16'),_0x2bbb0e,JSON['stringify'](_0x4301c3));_0x544740(_0x4301c3);})[_0xfc17('0x15')](function(_0xfbd493){logger['error']('GetMailServerIn',_0xfbd493[_0xfc17('0x13')],_0x2bbb0e);_0x2aa3a2(_0x5b2c7c[_0xfc17('0x11')](0x1f4,_0xfbd493[_0xfc17('0x13')]));});});};
\ No newline at end of file
+var _0xfb70=['result','catch','MailServerIn','options','raw','where','limit','map','include','model','attributes','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5d9a8c,_0x3ab82f){var _0x4100c0=function(_0x4f79a1){while(--_0x4f79a1){_0x5d9a8c['push'](_0x5d9a8c['shift']());}};_0x4100c0(++_0x3ab82f);}(_0xfb70,0x150));var _0x0fb7=function(_0x1b0842,_0x210f4){_0x1b0842=_0x1b0842-0x0;var _0x5b5d98=_0xfb70[_0x1b0842];return _0x5b5d98;};'use strict';var _=require(_0x0fb7('0x0'));var util=require(_0x0fb7('0x1'));var moment=require(_0x0fb7('0x2'));var BPromise=require(_0x0fb7('0x3'));var rs=require(_0x0fb7('0x4'));var fs=require('fs');var Redis=require(_0x0fb7('0x5'));var db=require(_0x0fb7('0x6'))['db'];var utils=require(_0x0fb7('0x7'));var logger=require('../../config/logger')(_0x0fb7('0x8'));var config=require(_0x0fb7('0x9'));var jayson=require(_0x0fb7('0xa'));var client=jayson[_0x0fb7('0xb')][_0x0fb7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1737d1,_0x172099,_0x48643b){return new BPromise(function(_0xaca131,_0x3039b3){return client[_0x0fb7('0xd')](_0x1737d1,_0x48643b)[_0x0fb7('0xe')](function(_0x14db52){logger[_0x0fb7('0xf')](_0x0fb7('0x10'),_0x172099,_0x0fb7('0x11'));logger[_0x0fb7('0x12')](_0x0fb7('0x13'),_0x172099,_0x0fb7('0x11'),JSON[_0x0fb7('0x14')](_0x14db52));if(_0x14db52[_0x0fb7('0x15')]){if(_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x16')]===0x1f4){logger[_0x0fb7('0x15')](_0x0fb7('0x10'),_0x172099,_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);return _0x3039b3(_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);}logger['error'](_0x0fb7('0x10'),_0x172099,_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);return _0xaca131(_0x14db52[_0x0fb7('0x15')][_0x0fb7('0x17')]);}else{logger[_0x0fb7('0xf')](_0x0fb7('0x10'),_0x172099,'request\x20sent');_0xaca131(_0x14db52[_0x0fb7('0x18')][_0x0fb7('0x17')]);}})[_0x0fb7('0x19')](function(_0x44c80f){logger[_0x0fb7('0x15')](_0x0fb7('0x10'),_0x172099,_0x44c80f);_0x3039b3(_0x44c80f);});});}exports['GetMailServerIn']=function(_0x17eaf5){var _0x4ace36=this;return new Promise(function(_0x22d9f3,_0x5d0035){return db[_0x0fb7('0x1a')]['findAll']({'raw':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')][_0x0fb7('0x1c')]===undefined?!![]:![]:!![],'where':_0x17eaf5['options']?_0x17eaf5[_0x0fb7('0x1b')][_0x0fb7('0x1d')]||null:null,'attributes':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')]['attributes']||null:null,'limit':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')][_0x0fb7('0x1e')]||null:null,'include':_0x17eaf5[_0x0fb7('0x1b')]?_0x17eaf5[_0x0fb7('0x1b')]['include']?_[_0x0fb7('0x1f')](_0x17eaf5[_0x0fb7('0x1b')]['include'],function(_0x1e193a){return{'model':db[_0x1e193a['model']],'as':_0x1e193a['as'],'attributes':_0x1e193a['attributes'],'include':_0x1e193a['include']?_[_0x0fb7('0x1f')](_0x1e193a[_0x0fb7('0x20')],function(_0x5035a1){return{'model':db[_0x5035a1[_0x0fb7('0x21')]],'as':_0x5035a1['as'],'attributes':_0x5035a1[_0x0fb7('0x22')],'include':_0x5035a1[_0x0fb7('0x20')]?_[_0x0fb7('0x1f')](_0x5035a1[_0x0fb7('0x20')],function(_0x54024d){return{'model':db[_0x54024d['model']],'as':_0x54024d['as'],'attributes':_0x54024d[_0x0fb7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0fb7('0xe')](function(_0x52eea9){logger[_0x0fb7('0xf')](_0x0fb7('0x23'),_0x17eaf5);logger[_0x0fb7('0x12')](_0x0fb7('0x23'),_0x17eaf5,JSON[_0x0fb7('0x14')](_0x52eea9));_0x22d9f3(_0x52eea9);})[_0x0fb7('0x19')](function(_0x159f21){logger[_0x0fb7('0x15')](_0x0fb7('0x23'),_0x159f21[_0x0fb7('0x17')],_0x17eaf5);_0x5d0035(_0x4ace36[_0x0fb7('0x15')](0x1f4,_0x159f21[_0x0fb7('0x17')]));});});};
\ No newline at end of file
index 372856a..02e4750 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0x594a49,_0x49ef64){_0x594a49=_0x594a49-0x0;var _0x80a900=_0x7a54[_0x594a49];return _0x80a900;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index e70a2c6..bd83b0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x0bb5,0x148));var _0x50bb=function(_0x4b5d2f,_0x4ae600){_0x4b5d2f=_0x4b5d2f-0x0;var _0x351bc8=_0x0bb5[_0x4b5d2f];return _0x351bc8;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x50bb('0x2')]},'pass':{'type':Sequelize[_0x50bb('0x2')]},'port':{'type':Sequelize[_0x50bb('0x3')]},'secure':{'type':Sequelize[_0x50bb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x50bb('0x2')]},'authentication':{'type':Sequelize[_0x50bb('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x50bb('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbaf0=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x3bc0d4,_0x120707){var _0x5534a7=function(_0x32dd01){while(--_0x32dd01){_0x3bc0d4['push'](_0x3bc0d4['shift']());}};_0x5534a7(++_0x120707);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'description':{'type':Sequelize[_0x0baf('0x1')]},'host':{'type':Sequelize[_0x0baf('0x1')]},'user':{'type':Sequelize[_0x0baf('0x1')]},'pass':{'type':Sequelize[_0x0baf('0x1')]},'port':{'type':Sequelize[_0x0baf('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x0baf('0x1')]},'authentication':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':![]}};
\ No newline at end of file
index ee43f05..92838ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea0=['path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','send','index','MailServerOut','rawAttributes','fieldName','type','key','map','name','query','keys','filters','model','attributes','fields','length','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','create','body','find','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4ea0,0x16b));var _0x04ea=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x4ea0[_0x483102];return _0x5cc885;};'use strict';var emlformat=require(_0x04ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04ea('0x1'));var jsonpatch=require(_0x04ea('0x2'));var rp=require('request-promise');var moment=require(_0x04ea('0x3'));var BPromise=require(_0x04ea('0x4'));var Mustache=require(_0x04ea('0x5'));var util=require(_0x04ea('0x6'));var path=require(_0x04ea('0x7'));var sox=require(_0x04ea('0x8'));var csv=require(_0x04ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04ea('0xa'));var _=require(_0x04ea('0xb'));var squel=require(_0x04ea('0xc'));var crypto=require(_0x04ea('0xd'));var jsforce=require(_0x04ea('0xe'));var deskjs=require(_0x04ea('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x04ea('0x10'));var qs=require(_0x04ea('0x11'));var as=require(_0x04ea('0x12'));var hardwareService=require(_0x04ea('0x13'));var logger=require(_0x04ea('0x14'))(_0x04ea('0x15'));var utils=require(_0x04ea('0x16'));var config=require(_0x04ea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x04ea('0x18'))['db'];function respondWithStatusCode(_0xbc3894,_0x325b9b){_0x325b9b=_0x325b9b||0xcc;return function(_0x96dee2){if(_0x96dee2){return _0xbc3894[_0x04ea('0x19')](_0x325b9b);}return _0xbc3894[_0x04ea('0x1a')](_0x325b9b)[_0x04ea('0x1b')]();};}function respondWithResult(_0x4cbb60,_0x10991b){_0x10991b=_0x10991b||0xc8;return function(_0x1fdfc4){if(_0x1fdfc4){return _0x4cbb60[_0x04ea('0x1a')](_0x10991b)[_0x04ea('0x1c')](_0x1fdfc4);}};}function respondWithFilteredResult(_0x2c2116,_0x1b4a23){return function(_0x30e9c1){if(_0x30e9c1){var _0x2a64ae=typeof _0x1b4a23[_0x04ea('0x1d')]==='undefined'&&typeof _0x1b4a23[_0x04ea('0x1e')]===_0x04ea('0x1f');var _0x2ef994=_0x30e9c1[_0x04ea('0x20')];var _0x1139b5=_0x2a64ae?0x0:_0x1b4a23[_0x04ea('0x1d')];var _0x20a89e=_0x2a64ae?_0x30e9c1['count']:_0x1b4a23[_0x04ea('0x1d')]+_0x1b4a23['limit'];var _0x55c368;if(_0x20a89e>=_0x2ef994){_0x20a89e=_0x2ef994;_0x55c368=0xc8;}else{_0x55c368=0xce;}_0x2c2116[_0x04ea('0x1a')](_0x55c368);return _0x2c2116['set'](_0x04ea('0x21'),_0x1139b5+'-'+_0x20a89e+'/'+_0x2ef994)[_0x04ea('0x1c')](_0x30e9c1);}return null;};}function patchUpdates(_0x1e8c8f){return function(_0x96b47e){try{jsonpatch[_0x04ea('0x22')](_0x96b47e,_0x1e8c8f,!![]);}catch(_0x272f84){return BPromise[_0x04ea('0x23')](_0x272f84);}return _0x96b47e[_0x04ea('0x24')]();};}function saveUpdates(_0x1380ea,_0x141fba){return function(_0x43bba0){if(_0x43bba0){return _0x43bba0[_0x04ea('0x25')](_0x1380ea)['then'](function(_0x44e988){return _0x44e988;});}return null;};}function removeEntity(_0x3fc262,_0x38070e){return function(_0x3b77bc){if(_0x3b77bc){return _0x3b77bc['destroy']()[_0x04ea('0x26')](function(){_0x3fc262[_0x04ea('0x1a')](0xcc)[_0x04ea('0x1b')]();});}};}function handleEntityNotFound(_0x49e922,_0xd5592a){return function(_0x330293){if(!_0x330293){_0x49e922[_0x04ea('0x19')](0x194);}return _0x330293;};}function handleError(_0x4e7c62,_0x4abada){_0x4abada=_0x4abada||0x1f4;return function(_0x2e3444){logger[_0x04ea('0x27')](_0x2e3444[_0x04ea('0x28')]);if(_0x2e3444['name']){delete _0x2e3444['name'];}_0x4e7c62[_0x04ea('0x1a')](_0x4abada)[_0x04ea('0x29')](_0x2e3444);};}exports[_0x04ea('0x2a')]=function(_0x1f7dfc,_0x5dc52c){var _0x20180f={},_0x3d836b={},_0x50e21d={'count':0x0,'rows':[]};var _0x596cd8=_['map'](db[_0x04ea('0x2b')][_0x04ea('0x2c')],function(_0x26528c){return{'name':_0x26528c[_0x04ea('0x2d')],'type':_0x26528c[_0x04ea('0x2e')][_0x04ea('0x2f')]};});_0x3d836b['model']=_[_0x04ea('0x30')](_0x596cd8,_0x04ea('0x31'));_0x3d836b[_0x04ea('0x32')]=_[_0x04ea('0x33')](_0x1f7dfc['query']);_0x3d836b[_0x04ea('0x34')]=_['intersection'](_0x3d836b[_0x04ea('0x35')],_0x3d836b[_0x04ea('0x32')]);_0x20180f[_0x04ea('0x36')]=_['intersection'](_0x3d836b['model'],qs[_0x04ea('0x37')](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x37')]));_0x20180f['attributes']=_0x20180f[_0x04ea('0x36')][_0x04ea('0x38')]?_0x20180f[_0x04ea('0x36')]:_0x3d836b[_0x04ea('0x35')];if(!_0x1f7dfc[_0x04ea('0x32')]['hasOwnProperty']('nolimit')){_0x20180f[_0x04ea('0x1e')]=qs[_0x04ea('0x1e')](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x1e')]);_0x20180f[_0x04ea('0x1d')]=qs['offset'](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x1d')]);}_0x20180f['order']=qs[_0x04ea('0x39')](_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x39')]);_0x20180f['where']=qs[_0x04ea('0x34')](_[_0x04ea('0x3a')](_0x1f7dfc[_0x04ea('0x32')],_0x3d836b[_0x04ea('0x34')]),_0x596cd8);if(_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x3b')]){_0x20180f['where']=_[_0x04ea('0x3c')](_0x20180f[_0x04ea('0x3d')],{'$or':_[_0x04ea('0x30')](_0x596cd8,function(_0x518880){if(_0x518880[_0x04ea('0x2e')]!==_0x04ea('0x3e')){var _0x2a4b23={};_0x2a4b23[_0x518880[_0x04ea('0x31')]]={'$like':'%'+_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x3b')]+'%'};return _0x2a4b23;}})});}_0x20180f=_[_0x04ea('0x3c')]({},_0x20180f,_0x1f7dfc[_0x04ea('0x3f')]);var _0x12ce9d={'where':_0x20180f['where']};return db[_0x04ea('0x2b')][_0x04ea('0x20')](_0x12ce9d)['then'](function(_0x5ee985){_0x50e21d[_0x04ea('0x20')]=_0x5ee985;if(_0x1f7dfc[_0x04ea('0x32')][_0x04ea('0x40')]){_0x20180f['include']=[{'all':!![]}];}return db[_0x04ea('0x2b')]['findAll'](_0x20180f);})[_0x04ea('0x26')](function(_0xd5c104){_0x50e21d[_0x04ea('0x41')]=_0xd5c104;return _0x50e21d;})['then'](respondWithFilteredResult(_0x5dc52c,_0x20180f))[_0x04ea('0x42')](handleError(_0x5dc52c,null));};exports[_0x04ea('0x43')]=function(_0x464fd0,_0x162239){var _0x5ac141={'raw':!![],'where':{'id':_0x464fd0[_0x04ea('0x44')]['id']}},_0x12611a={};_0x12611a[_0x04ea('0x35')]=_[_0x04ea('0x33')](db['MailServerOut'][_0x04ea('0x2c')]);_0x12611a[_0x04ea('0x32')]=_[_0x04ea('0x33')](_0x464fd0[_0x04ea('0x32')]);_0x12611a['filters']=_['intersection'](_0x12611a['model'],_0x12611a['query']);_0x5ac141[_0x04ea('0x36')]=_[_0x04ea('0x45')](_0x12611a['model'],qs[_0x04ea('0x37')](_0x464fd0[_0x04ea('0x32')]['fields']));_0x5ac141[_0x04ea('0x36')]=_0x5ac141['attributes'][_0x04ea('0x38')]?_0x5ac141[_0x04ea('0x36')]:_0x12611a['model'];if(_0x464fd0[_0x04ea('0x32')][_0x04ea('0x40')]){_0x5ac141['include']=[{'all':!![]}];}_0x5ac141=_[_0x04ea('0x3c')]({},_0x5ac141,_0x464fd0[_0x04ea('0x3f')]);return db['MailServerOut']['find'](_0x5ac141)[_0x04ea('0x26')](handleEntityNotFound(_0x162239,null))[_0x04ea('0x26')](respondWithResult(_0x162239,null))['catch'](handleError(_0x162239,null));};exports[_0x04ea('0x46')]=function(_0x126d76,_0x4a512a){return db['MailServerOut'][_0x04ea('0x46')](_0x126d76[_0x04ea('0x47')],{})['then'](respondWithResult(_0x4a512a,0xc9))[_0x04ea('0x42')](handleError(_0x4a512a,null));};exports[_0x04ea('0x25')]=function(_0x17d361,_0x530b79){if(_0x17d361[_0x04ea('0x47')]['id']){delete _0x17d361[_0x04ea('0x47')]['id'];}return db['MailServerOut'][_0x04ea('0x48')]({'where':{'id':_0x17d361['params']['id']}})['then'](handleEntityNotFound(_0x530b79,null))[_0x04ea('0x26')](saveUpdates(_0x17d361[_0x04ea('0x47')],null))['then'](respondWithResult(_0x530b79,null))[_0x04ea('0x42')](handleError(_0x530b79,null));};exports[_0x04ea('0x49')]=function(_0xbbe860,_0x181cbe){return db[_0x04ea('0x2b')][_0x04ea('0x48')]({'where':{'id':_0xbbe860[_0x04ea('0x44')]['id']}})[_0x04ea('0x26')](handleEntityNotFound(_0x181cbe,null))[_0x04ea('0x26')](removeEntity(_0x181cbe,null))[_0x04ea('0x42')](handleError(_0x181cbe,null));};
\ No newline at end of file
+var _0x7624=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','MailServerOut','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x1a9cff,_0x42c896){var _0x33f7f0=function(_0x462db4){while(--_0x462db4){_0x1a9cff['push'](_0x1a9cff['shift']());}};_0x33f7f0(++_0x42c896);}(_0x7624,0x180));var _0x4762=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x7624[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x4762('0x0'));var rimraf=require(_0x4762('0x1'));var zipdir=require(_0x4762('0x2'));var jsonpatch=require(_0x4762('0x3'));var rp=require(_0x4762('0x4'));var moment=require(_0x4762('0x5'));var BPromise=require(_0x4762('0x6'));var Mustache=require(_0x4762('0x7'));var util=require('util');var path=require(_0x4762('0x8'));var sox=require(_0x4762('0x9'));var csv=require(_0x4762('0xa'));var ejs=require(_0x4762('0xb'));var fs=require('fs');var fs_extra=require(_0x4762('0xc'));var _=require(_0x4762('0xd'));var squel=require(_0x4762('0xe'));var crypto=require(_0x4762('0xf'));var jsforce=require(_0x4762('0x10'));var deskjs=require(_0x4762('0x11'));var toCsv=require(_0x4762('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4762('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4762('0x13'));var as=require(_0x4762('0x14'));var hardwareService=require(_0x4762('0x15'));var logger=require(_0x4762('0x16'))(_0x4762('0x17'));var utils=require(_0x4762('0x18'));var config=require(_0x4762('0x19'));var licenseUtil=require(_0x4762('0x1a'));var db=require(_0x4762('0x1b'))['db'];function respondWithStatusCode(_0x199558,_0x580c52){_0x580c52=_0x580c52||0xcc;return function(_0x9e0989){if(_0x9e0989){return _0x199558['sendStatus'](_0x580c52);}return _0x199558['status'](_0x580c52)[_0x4762('0x1c')]();};}function respondWithResult(_0x333e6c,_0x179280){_0x179280=_0x179280||0xc8;return function(_0x465ca7){if(_0x465ca7){return _0x333e6c['status'](_0x179280)[_0x4762('0x1d')](_0x465ca7);}};}function respondWithFilteredResult(_0x5ea7b1,_0x18c7d9){return function(_0x10dd70){if(_0x10dd70){var _0x3c0318=typeof _0x18c7d9[_0x4762('0x1e')]===_0x4762('0x1f')&&typeof _0x18c7d9[_0x4762('0x20')]==='undefined';var _0x170966=_0x10dd70['count'];var _0x44887e=_0x3c0318?0x0:_0x18c7d9[_0x4762('0x1e')];var _0x3681be=_0x3c0318?_0x10dd70[_0x4762('0x21')]:_0x18c7d9['offset']+_0x18c7d9[_0x4762('0x20')];var _0x1c5d1d;if(_0x3681be>=_0x170966){_0x3681be=_0x170966;_0x1c5d1d=0xc8;}else{_0x1c5d1d=0xce;}_0x5ea7b1[_0x4762('0x22')](_0x1c5d1d);return _0x5ea7b1[_0x4762('0x23')](_0x4762('0x24'),_0x44887e+'-'+_0x3681be+'/'+_0x170966)[_0x4762('0x1d')](_0x10dd70);}return null;};}function patchUpdates(_0x16f003){return function(_0x219a85){try{jsonpatch[_0x4762('0x25')](_0x219a85,_0x16f003,!![]);}catch(_0x573054){return BPromise[_0x4762('0x26')](_0x573054);}return _0x219a85[_0x4762('0x27')]();};}function saveUpdates(_0x12c4f0,_0x30cfd9){return function(_0x4cf13f){if(_0x4cf13f){return _0x4cf13f[_0x4762('0x28')](_0x12c4f0)[_0x4762('0x29')](function(_0x4cc7a8){return _0x4cc7a8;});}return null;};}function removeEntity(_0x1677d0,_0x377b26){return function(_0x2a87f5){if(_0x2a87f5){return _0x2a87f5[_0x4762('0x2a')]()[_0x4762('0x29')](function(){_0x1677d0['status'](0xcc)[_0x4762('0x1c')]();});}};}function handleEntityNotFound(_0x5a2079,_0x734a8f){return function(_0x1602c6){if(!_0x1602c6){_0x5a2079[_0x4762('0x2b')](0x194);}return _0x1602c6;};}function handleError(_0x287652,_0x5a2820){_0x5a2820=_0x5a2820||0x1f4;return function(_0x55ad9c){logger['error'](_0x55ad9c[_0x4762('0x2c')]);if(_0x55ad9c[_0x4762('0x2d')]){delete _0x55ad9c['name'];}_0x287652[_0x4762('0x22')](_0x5a2820)[_0x4762('0x2e')](_0x55ad9c);};}exports[_0x4762('0x2f')]=function(_0x249211,_0x35e08b){var _0x4d81de={},_0x379f89={},_0x119355={'count':0x0,'rows':[]};var _0x5a1c96=_['map'](db[_0x4762('0x30')][_0x4762('0x31')],function(_0x1be233){return{'name':_0x1be233['fieldName'],'type':_0x1be233[_0x4762('0x32')][_0x4762('0x33')]};});_0x379f89[_0x4762('0x34')]=_[_0x4762('0x35')](_0x5a1c96,_0x4762('0x2d'));_0x379f89['query']=_['keys'](_0x249211[_0x4762('0x36')]);_0x379f89[_0x4762('0x37')]=_[_0x4762('0x38')](_0x379f89[_0x4762('0x34')],_0x379f89[_0x4762('0x36')]);_0x4d81de[_0x4762('0x39')]=_[_0x4762('0x38')](_0x379f89[_0x4762('0x34')],qs[_0x4762('0x3a')](_0x249211[_0x4762('0x36')]['fields']));_0x4d81de[_0x4762('0x39')]=_0x4d81de[_0x4762('0x39')][_0x4762('0x3b')]?_0x4d81de[_0x4762('0x39')]:_0x379f89[_0x4762('0x34')];if(!_0x249211[_0x4762('0x36')][_0x4762('0x3c')](_0x4762('0x3d'))){_0x4d81de[_0x4762('0x20')]=qs[_0x4762('0x20')](_0x249211[_0x4762('0x36')][_0x4762('0x20')]);_0x4d81de['offset']=qs[_0x4762('0x1e')](_0x249211['query'][_0x4762('0x1e')]);}_0x4d81de[_0x4762('0x3e')]=qs[_0x4762('0x3f')](_0x249211[_0x4762('0x36')]['sort']);_0x4d81de[_0x4762('0x40')]=qs[_0x4762('0x37')](_['pick'](_0x249211[_0x4762('0x36')],_0x379f89[_0x4762('0x37')]),_0x5a1c96);if(_0x249211[_0x4762('0x36')]['filter']){_0x4d81de[_0x4762('0x40')]=_[_0x4762('0x41')](_0x4d81de[_0x4762('0x40')],{'$or':_[_0x4762('0x35')](_0x5a1c96,function(_0x19d6e3){if(_0x19d6e3[_0x4762('0x32')]!==_0x4762('0x42')){var _0x402d3b={};_0x402d3b[_0x19d6e3['name']]={'$like':'%'+_0x249211[_0x4762('0x36')][_0x4762('0x43')]+'%'};return _0x402d3b;}})});}_0x4d81de=_[_0x4762('0x41')]({},_0x4d81de,_0x249211[_0x4762('0x44')]);var _0x3c8cb8={'where':_0x4d81de[_0x4762('0x40')]};return db[_0x4762('0x30')][_0x4762('0x21')](_0x3c8cb8)[_0x4762('0x29')](function(_0x4c7118){_0x119355['count']=_0x4c7118;if(_0x249211['query'][_0x4762('0x45')]){_0x4d81de[_0x4762('0x46')]=[{'all':!![]}];}return db[_0x4762('0x30')][_0x4762('0x47')](_0x4d81de);})['then'](function(_0x3fa3cc){_0x119355[_0x4762('0x48')]=_0x3fa3cc;return _0x119355;})[_0x4762('0x29')](respondWithFilteredResult(_0x35e08b,_0x4d81de))['catch'](handleError(_0x35e08b,null));};exports[_0x4762('0x49')]=function(_0x132aa8,_0x53de09){var _0x29e8fb={'raw':!![],'where':{'id':_0x132aa8['params']['id']}},_0x1ce828={};_0x1ce828['model']=_['keys'](db[_0x4762('0x30')][_0x4762('0x31')]);_0x1ce828[_0x4762('0x36')]=_[_0x4762('0x4a')](_0x132aa8['query']);_0x1ce828[_0x4762('0x37')]=_[_0x4762('0x38')](_0x1ce828[_0x4762('0x34')],_0x1ce828[_0x4762('0x36')]);_0x29e8fb[_0x4762('0x39')]=_[_0x4762('0x38')](_0x1ce828[_0x4762('0x34')],qs[_0x4762('0x3a')](_0x132aa8[_0x4762('0x36')][_0x4762('0x3a')]));_0x29e8fb['attributes']=_0x29e8fb[_0x4762('0x39')][_0x4762('0x3b')]?_0x29e8fb[_0x4762('0x39')]:_0x1ce828['model'];if(_0x132aa8[_0x4762('0x36')][_0x4762('0x45')]){_0x29e8fb[_0x4762('0x46')]=[{'all':!![]}];}_0x29e8fb=_['merge']({},_0x29e8fb,_0x132aa8[_0x4762('0x44')]);return db[_0x4762('0x30')][_0x4762('0x4b')](_0x29e8fb)['then'](handleEntityNotFound(_0x53de09,null))[_0x4762('0x29')](respondWithResult(_0x53de09,null))['catch'](handleError(_0x53de09,null));};exports[_0x4762('0x4c')]=function(_0x5837e9,_0x7b3eb6){return db['MailServerOut'][_0x4762('0x4c')](_0x5837e9[_0x4762('0x4d')],{})[_0x4762('0x29')](respondWithResult(_0x7b3eb6,0xc9))['catch'](handleError(_0x7b3eb6,null));};exports['update']=function(_0x5eee03,_0x1aa017){if(_0x5eee03[_0x4762('0x4d')]['id']){delete _0x5eee03[_0x4762('0x4d')]['id'];}return db[_0x4762('0x30')][_0x4762('0x4b')]({'where':{'id':_0x5eee03[_0x4762('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1aa017,null))[_0x4762('0x29')](saveUpdates(_0x5eee03['body'],null))[_0x4762('0x29')](respondWithResult(_0x1aa017,null))['catch'](handleError(_0x1aa017,null));};exports[_0x4762('0x2a')]=function(_0xfd47b,_0x1b9a50){return db[_0x4762('0x30')][_0x4762('0x4b')]({'where':{'id':_0xfd47b[_0x4762('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1b9a50,null))['then'](removeEntity(_0x1b9a50,null))['catch'](handleError(_0x1b9a50,null));};
\ No newline at end of file
index e21d7af..12a50b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cd9=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out'];(function(_0x1fbde3,_0x59da39){var _0x2b092f=function(_0x18bd24){while(--_0x18bd24){_0x1fbde3['push'](_0x1fbde3['shift']());}};_0x2b092f(++_0x59da39);}(_0x3cd9,0xc0));var _0x93cd=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x3cd9[_0x37cc52];return _0x2b4a90;};'use strict';var _=require(_0x93cd('0x0'));var util=require(_0x93cd('0x1'));var logger=require(_0x93cd('0x2'))(_0x93cd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x93cd('0x4'));var fs=require('fs');var path=require(_0x93cd('0x5'));var rimraf=require('rimraf');var config=require(_0x93cd('0x6'));var attributes=require(_0x93cd('0x7'));module[_0x93cd('0x8')]=function(_0x14dd2e,_0x13152e){return _0x14dd2e[_0x93cd('0x9')](_0x93cd('0xa'),attributes,{'tableName':_0x93cd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c54=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger','api','moment'];(function(_0x1fe966,_0x2735b9){var _0x3f4fd2=function(_0x3633a5){while(--_0x3633a5){_0x1fe966['push'](_0x1fe966['shift']());}};_0x3f4fd2(++_0x2735b9);}(_0x5c54,0xa3));var _0x45c5=function(_0x3225fc,_0x20dfd9){_0x3225fc=_0x3225fc-0x0;var _0x5bfe37=_0x5c54[_0x3225fc];return _0x5bfe37;};'use strict';var _=require(_0x45c5('0x0'));var util=require(_0x45c5('0x1'));var logger=require(_0x45c5('0x2'))(_0x45c5('0x3'));var moment=require(_0x45c5('0x4'));var BPromise=require(_0x45c5('0x5'));var rp=require(_0x45c5('0x6'));var fs=require('fs');var path=require(_0x45c5('0x7'));var rimraf=require(_0x45c5('0x8'));var config=require(_0x45c5('0x9'));var attributes=require(_0x45c5('0xa'));module[_0x45c5('0xb')]=function(_0x30314d,_0x22c937){return _0x30314d[_0x45c5('0xc')](_0x45c5('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4e5b42e..79eee10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x418d65,_0x69d05c){var _0x3bb5e4=function(_0x43b92b){while(--_0x43b92b){_0x418d65['push'](_0x418d65['shift']());}};_0x3bb5e4(++_0x69d05c);}(_0x2ef3,0xba));var _0x32ef=function(_0x3641d1,_0x351017){_0x3641d1=_0x3641d1-0x0;var _0x336508=_0x2ef3[_0x3641d1];return _0x336508;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2cb984,_0x365f50){var _0x2f73e6=function(_0x315369){while(--_0x315369){_0x2cb984['push'](_0x2cb984['shift']());}};_0x2f73e6(++_0x365f50);}(_0xadb5,0xad));var _0x5adb=function(_0x154e5e,_0x35c6f0){_0x154e5e=_0x154e5e-0x0;var _0x1b63dc=_0xadb5[_0x154e5e];return _0x1b63dc;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index 9411f67..16a0498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f69=['fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x1e6659,_0x1f860c){var _0x4d16e4=function(_0x21c05a){while(--_0x21c05a){_0x1e6659['push'](_0x1e6659['shift']());}};_0x4d16e4(++_0x1f860c);}(_0x0f69,0x175));var _0x90f6=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x0f69[_0x456fb1];return _0x4083d6;};'use strict';var multer=require(_0x90f6('0x0'));var util=require(_0x90f6('0x1'));var path=require('path');var timeout=require(_0x90f6('0x2'));var express=require(_0x90f6('0x3'));var router=express[_0x90f6('0x4')]();var fs_extra=require(_0x90f6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x90f6('0x6'));var config=require(_0x90f6('0x7'));var controller=require(_0x90f6('0x8'));router['get']('/',auth[_0x90f6('0x9')](),controller[_0x90f6('0xa')]);router[_0x90f6('0xb')](_0x90f6('0xc'),auth[_0x90f6('0x9')](),controller[_0x90f6('0xd')]);router[_0x90f6('0xb')]('/:id',auth[_0x90f6('0x9')](),controller[_0x90f6('0xe')]);router[_0x90f6('0xf')]('/',auth[_0x90f6('0x9')](),controller[_0x90f6('0x10')]);router[_0x90f6('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x90f6('0x12')]);router[_0x90f6('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x90f6('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xee65=['update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','create','put'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xee65,0x145));var _0x5ee6=function(_0x3b6359,_0x373e86){_0x3b6359=_0x3b6359-0x0;var _0x18cdc4=_0xee65[_0x3b6359];return _0x18cdc4;};'use strict';var multer=require(_0x5ee6('0x0'));var util=require('util');var path=require(_0x5ee6('0x1'));var timeout=require(_0x5ee6('0x2'));var express=require(_0x5ee6('0x3'));var router=express['Router']();var fs_extra=require(_0x5ee6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5ee6('0x5'));var config=require(_0x5ee6('0x6'));var controller=require(_0x5ee6('0x7'));router['get']('/',auth[_0x5ee6('0x8')](),controller[_0x5ee6('0x9')]);router[_0x5ee6('0xa')](_0x5ee6('0xb'),auth[_0x5ee6('0x8')](),controller[_0x5ee6('0xc')]);router[_0x5ee6('0xa')]('/:id',auth[_0x5ee6('0x8')](),controller['show']);router['post']('/',auth[_0x5ee6('0x8')](),controller[_0x5ee6('0xd')]);router[_0x5ee6('0xe')]('/:id',auth[_0x5ee6('0x8')](),controller[_0x5ee6('0xf')]);router[_0x5ee6('0x10')](_0x5ee6('0x11'),auth[_0x5ee6('0x8')](),controller[_0x5ee6('0x12')]);module[_0x5ee6('0x13')]=router;
\ No newline at end of file
index d2dcdee..5b2e610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe714=['name','sequelize','STRING'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xe714,0xe2));var _0x4e71=function(_0x16ef16,_0x3b9d9a){_0x16ef16=_0x16ef16-0x0;var _0x53714e=_0xe714[_0x16ef16];return _0x53714e;};'use strict';var Sequelize=require(_0x4e71('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e71('0x1')],'unique':_0x4e71('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4e71('0x1')]}};
\ No newline at end of file
+var _0xc359=['name','STRING','exports'];(function(_0x2f5ee4,_0x584180){var _0x4ec263=function(_0x3ec7bd){while(--_0x3ec7bd){_0x2f5ee4['push'](_0x2f5ee4['shift']());}};_0x4ec263(++_0x584180);}(_0xc359,0x1d9));var _0x9c35=function(_0x5e2489,_0x2fd8be){_0x5e2489=_0x5e2489-0x0;var _0xa87596=_0xc359[_0x5e2489];return _0xa87596;};'use strict';var Sequelize=require('sequelize');module[_0x9c35('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x9c35('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9c35('0x2')]}};
\ No newline at end of file
index b825923..4fb95b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5867=['filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','length','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5867,0x9c));var _0x7586=function(_0x2869fc,_0x219d71){_0x2869fc=_0x2869fc-0x0;var _0x233d89=_0x5867[_0x2869fc];return _0x233d89;};'use strict';var emlformat=require(_0x7586('0x0'));var rimraf=require(_0x7586('0x1'));var zipdir=require(_0x7586('0x2'));var jsonpatch=require(_0x7586('0x3'));var rp=require('request-promise');var moment=require(_0x7586('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7586('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7586('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7586('0x7'));var _=require('lodash');var squel=require(_0x7586('0x8'));var crypto=require(_0x7586('0x9'));var jsforce=require(_0x7586('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7586('0xb'));var Papa=require(_0x7586('0xc'));var Redis=require(_0x7586('0xd'));var authService=require(_0x7586('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7586('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7586('0x10'));var utils=require('../../config/utils');var config=require(_0x7586('0x11'));var licenseUtil=require(_0x7586('0x12'));var db=require(_0x7586('0x13'))['db'];function respondWithStatusCode(_0x160cec,_0x4ff82c){_0x4ff82c=_0x4ff82c||0xcc;return function(_0x33c2e9){if(_0x33c2e9){return _0x160cec[_0x7586('0x14')](_0x4ff82c);}return _0x160cec[_0x7586('0x15')](_0x4ff82c)[_0x7586('0x16')]();};}function respondWithResult(_0x1914b1,_0x65c847){_0x65c847=_0x65c847||0xc8;return function(_0x3d1c80){if(_0x3d1c80){return _0x1914b1[_0x7586('0x15')](_0x65c847)[_0x7586('0x17')](_0x3d1c80);}};}function respondWithFilteredResult(_0x129482,_0x1bc4dd){return function(_0x29c6f){if(_0x29c6f){var _0x263cee=typeof _0x1bc4dd[_0x7586('0x18')]===_0x7586('0x19')&&typeof _0x1bc4dd['limit']===_0x7586('0x19');var _0x5ee909=_0x29c6f[_0x7586('0x1a')];var _0x5f1991=_0x263cee?0x0:_0x1bc4dd['offset'];var _0x3bcd45=_0x263cee?_0x29c6f['count']:_0x1bc4dd[_0x7586('0x18')]+_0x1bc4dd[_0x7586('0x1b')];var _0x485ab3;if(_0x3bcd45>=_0x5ee909){_0x3bcd45=_0x5ee909;_0x485ab3=0xc8;}else{_0x485ab3=0xce;}_0x129482['status'](_0x485ab3);return _0x129482[_0x7586('0x1c')](_0x7586('0x1d'),_0x5f1991+'-'+_0x3bcd45+'/'+_0x5ee909)['json'](_0x29c6f);}return null;};}function patchUpdates(_0x9a5f40){return function(_0x46d0ba){try{jsonpatch[_0x7586('0x1e')](_0x46d0ba,_0x9a5f40,!![]);}catch(_0x220f2a){return BPromise[_0x7586('0x1f')](_0x220f2a);}return _0x46d0ba[_0x7586('0x20')]();};}function saveUpdates(_0x38e07a,_0x3a7047){return function(_0x31c05f){if(_0x31c05f){return _0x31c05f['update'](_0x38e07a)['then'](function(_0x2a86f0){return _0x2a86f0;});}return null;};}function removeEntity(_0x35fc81,_0x1d83d3){return function(_0x3b04cd){if(_0x3b04cd){return _0x3b04cd[_0x7586('0x21')]()[_0x7586('0x22')](function(){_0x35fc81[_0x7586('0x15')](0xcc)[_0x7586('0x16')]();});}};}function handleEntityNotFound(_0x32a2e6,_0x11837d){return function(_0x2568d3){if(!_0x2568d3){_0x32a2e6[_0x7586('0x14')](0x194);}return _0x2568d3;};}function handleError(_0x578116,_0x5bc30d){_0x5bc30d=_0x5bc30d||0x1f4;return function(_0x4b81ce){logger[_0x7586('0x23')](_0x4b81ce[_0x7586('0x24')]);if(_0x4b81ce[_0x7586('0x25')]){delete _0x4b81ce[_0x7586('0x25')];}_0x578116['status'](_0x5bc30d)['send'](_0x4b81ce);};}exports['index']=function(_0x424034,_0x37b6cf){var _0x4ccd9c={},_0x31f65d={},_0x166dfe={'count':0x0,'rows':[]};var _0xb4e84e=_[_0x7586('0x26')](db[_0x7586('0x27')][_0x7586('0x28')],function(_0x55fc9f){return{'name':_0x55fc9f[_0x7586('0x29')],'type':_0x55fc9f[_0x7586('0x2a')][_0x7586('0x2b')]};});_0x31f65d[_0x7586('0x2c')]=_[_0x7586('0x26')](_0xb4e84e,_0x7586('0x25'));_0x31f65d[_0x7586('0x2d')]=_['keys'](_0x424034[_0x7586('0x2d')]);_0x31f65d[_0x7586('0x2e')]=_[_0x7586('0x2f')](_0x31f65d['model'],_0x31f65d['query']);_0x4ccd9c[_0x7586('0x30')]=_['intersection'](_0x31f65d[_0x7586('0x2c')],qs[_0x7586('0x31')](_0x424034[_0x7586('0x2d')][_0x7586('0x31')]));_0x4ccd9c['attributes']=_0x4ccd9c[_0x7586('0x30')]['length']?_0x4ccd9c[_0x7586('0x30')]:_0x31f65d['model'];if(!_0x424034['query'][_0x7586('0x32')](_0x7586('0x33'))){_0x4ccd9c[_0x7586('0x1b')]=qs[_0x7586('0x1b')](_0x424034['query'][_0x7586('0x1b')]);_0x4ccd9c['offset']=qs[_0x7586('0x18')](_0x424034['query']['offset']);}_0x4ccd9c['order']=qs[_0x7586('0x34')](_0x424034[_0x7586('0x2d')]['sort']);_0x4ccd9c[_0x7586('0x35')]=qs['filters'](_['pick'](_0x424034[_0x7586('0x2d')],_0x31f65d[_0x7586('0x2e')]),_0xb4e84e);if(_0x424034['query'][_0x7586('0x36')]){_0x4ccd9c[_0x7586('0x35')]=_[_0x7586('0x37')](_0x4ccd9c[_0x7586('0x35')],{'$or':_[_0x7586('0x26')](_0xb4e84e,function(_0x5d312f){if(_0x5d312f[_0x7586('0x2a')]!==_0x7586('0x38')){var _0xbf5541={};_0xbf5541[_0x5d312f['name']]={'$like':'%'+_0x424034[_0x7586('0x2d')][_0x7586('0x36')]+'%'};return _0xbf5541;}})});}_0x4ccd9c=_['merge']({},_0x4ccd9c,_0x424034[_0x7586('0x39')]);var _0x4cb14f={'where':_0x4ccd9c[_0x7586('0x35')]};return db[_0x7586('0x27')][_0x7586('0x1a')](_0x4cb14f)[_0x7586('0x22')](function(_0x451e95){_0x166dfe['count']=_0x451e95;if(_0x424034[_0x7586('0x2d')][_0x7586('0x3a')]){_0x4ccd9c[_0x7586('0x3b')]=[{'all':!![]}];}return db[_0x7586('0x27')]['findAll'](_0x4ccd9c);})[_0x7586('0x22')](function(_0xde2093){_0x166dfe[_0x7586('0x3c')]=_0xde2093;return _0x166dfe;})[_0x7586('0x22')](respondWithFilteredResult(_0x37b6cf,_0x4ccd9c))[_0x7586('0x3d')](handleError(_0x37b6cf,null));};exports['show']=function(_0x3b2fae,_0xc86729){var _0x3ae7a7={'raw':!![],'where':{'id':_0x3b2fae[_0x7586('0x3e')]['id']}},_0x180457={};_0x180457['model']=_['keys'](db[_0x7586('0x27')][_0x7586('0x28')]);_0x180457[_0x7586('0x2d')]=_[_0x7586('0x3f')](_0x3b2fae['query']);_0x180457['filters']=_[_0x7586('0x2f')](_0x180457[_0x7586('0x2c')],_0x180457[_0x7586('0x2d')]);_0x3ae7a7[_0x7586('0x30')]=_[_0x7586('0x2f')](_0x180457['model'],qs[_0x7586('0x31')](_0x3b2fae[_0x7586('0x2d')][_0x7586('0x31')]));_0x3ae7a7[_0x7586('0x30')]=_0x3ae7a7[_0x7586('0x30')][_0x7586('0x40')]?_0x3ae7a7['attributes']:_0x180457[_0x7586('0x2c')];if(_0x3b2fae['query'][_0x7586('0x3a')]){_0x3ae7a7[_0x7586('0x3b')]=[{'all':!![]}];}_0x3ae7a7=_[_0x7586('0x37')]({},_0x3ae7a7,_0x3b2fae[_0x7586('0x39')]);return db['MailSubstatus'][_0x7586('0x41')](_0x3ae7a7)[_0x7586('0x22')](handleEntityNotFound(_0xc86729,null))['then'](respondWithResult(_0xc86729,null))['catch'](handleError(_0xc86729,null));};exports[_0x7586('0x42')]=function(_0x24fcce,_0x28e49f){return db[_0x7586('0x27')]['create'](_0x24fcce[_0x7586('0x43')],{})[_0x7586('0x22')](respondWithResult(_0x28e49f,0xc9))[_0x7586('0x3d')](handleError(_0x28e49f,null));};exports[_0x7586('0x44')]=function(_0x554bef,_0x3c117d){if(_0x554bef[_0x7586('0x43')]['id']){delete _0x554bef[_0x7586('0x43')]['id'];}return db[_0x7586('0x27')]['find']({'where':{'id':_0x554bef[_0x7586('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3c117d,null))[_0x7586('0x22')](saveUpdates(_0x554bef[_0x7586('0x43')],null))[_0x7586('0x22')](respondWithResult(_0x3c117d,null))[_0x7586('0x3d')](handleError(_0x3c117d,null));};exports[_0x7586('0x21')]=function(_0x34d04d,_0x56a425){return db[_0x7586('0x27')][_0x7586('0x41')]({'where':{'id':_0x34d04d[_0x7586('0x3e')]['id']}})['then'](handleEntityNotFound(_0x56a425,null))[_0x7586('0x22')](removeEntity(_0x56a425,null))[_0x7586('0x3d')](handleError(_0x56a425,null));};exports[_0x7586('0x45')]=function(_0x24494,_0x320921){return db[_0x7586('0x27')][_0x7586('0x45')]()['then'](respondWithResult(_0x320921,null))['catch'](handleError(_0x320921,null));};
\ No newline at end of file
+var _0x52d2=['limit','count','set','Content-Range','apply','reject','save','then','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','fields','find','catch','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset'];(function(_0x45dfde,_0x597ea9){var _0x26ca3b=function(_0x35598a){while(--_0x35598a){_0x45dfde['push'](_0x45dfde['shift']());}};_0x26ca3b(++_0x597ea9);}(_0x52d2,0xbd));var _0x252d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x52d2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x252d('0x0'));var rimraf=require(_0x252d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x252d('0x2'));var rp=require(_0x252d('0x3'));var moment=require(_0x252d('0x4'));var BPromise=require(_0x252d('0x5'));var Mustache=require(_0x252d('0x6'));var util=require(_0x252d('0x7'));var path=require('path');var sox=require(_0x252d('0x8'));var csv=require(_0x252d('0x9'));var ejs=require(_0x252d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x252d('0xb'));var squel=require(_0x252d('0xc'));var crypto=require(_0x252d('0xd'));var jsforce=require(_0x252d('0xe'));var deskjs=require(_0x252d('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x252d('0x10'));var Redis=require(_0x252d('0x11'));var authService=require(_0x252d('0x12'));var qs=require(_0x252d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x252d('0x14'))(_0x252d('0x15'));var utils=require(_0x252d('0x16'));var config=require(_0x252d('0x17'));var licenseUtil=require(_0x252d('0x18'));var db=require(_0x252d('0x19'))['db'];function respondWithStatusCode(_0x56fd23,_0xdf9322){_0xdf9322=_0xdf9322||0xcc;return function(_0x49ab6e){if(_0x49ab6e){return _0x56fd23[_0x252d('0x1a')](_0xdf9322);}return _0x56fd23[_0x252d('0x1b')](_0xdf9322)['end']();};}function respondWithResult(_0x3dffb4,_0x1cdded){_0x1cdded=_0x1cdded||0xc8;return function(_0x2cd7e2){if(_0x2cd7e2){return _0x3dffb4[_0x252d('0x1b')](_0x1cdded)[_0x252d('0x1c')](_0x2cd7e2);}};}function respondWithFilteredResult(_0x1620eb,_0x3a8c9f){return function(_0x586c3d){if(_0x586c3d){var _0x38f493=typeof _0x3a8c9f[_0x252d('0x1d')]==='undefined'&&typeof _0x3a8c9f[_0x252d('0x1e')]==='undefined';var _0x3e9f5f=_0x586c3d[_0x252d('0x1f')];var _0x587237=_0x38f493?0x0:_0x3a8c9f['offset'];var _0x4b4071=_0x38f493?_0x586c3d[_0x252d('0x1f')]:_0x3a8c9f['offset']+_0x3a8c9f[_0x252d('0x1e')];var _0x449809;if(_0x4b4071>=_0x3e9f5f){_0x4b4071=_0x3e9f5f;_0x449809=0xc8;}else{_0x449809=0xce;}_0x1620eb[_0x252d('0x1b')](_0x449809);return _0x1620eb[_0x252d('0x20')](_0x252d('0x21'),_0x587237+'-'+_0x4b4071+'/'+_0x3e9f5f)['json'](_0x586c3d);}return null;};}function patchUpdates(_0x230dc4){return function(_0x13ed2d){try{jsonpatch[_0x252d('0x22')](_0x13ed2d,_0x230dc4,!![]);}catch(_0x3df25a){return BPromise[_0x252d('0x23')](_0x3df25a);}return _0x13ed2d[_0x252d('0x24')]();};}function saveUpdates(_0x20120e,_0x3fdabd){return function(_0x276d64){if(_0x276d64){return _0x276d64['update'](_0x20120e)[_0x252d('0x25')](function(_0x470505){return _0x470505;});}return null;};}function removeEntity(_0x5aa8e3,_0x34c7d3){return function(_0x2f52de){if(_0x2f52de){return _0x2f52de['destroy']()[_0x252d('0x25')](function(){_0x5aa8e3[_0x252d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31392d,_0xb810f0){return function(_0x5369b7){if(!_0x5369b7){_0x31392d[_0x252d('0x1a')](0x194);}return _0x5369b7;};}function handleError(_0x453d13,_0x3afadf){_0x3afadf=_0x3afadf||0x1f4;return function(_0x39baa6){logger['error'](_0x39baa6['stack']);if(_0x39baa6['name']){delete _0x39baa6[_0x252d('0x26')];}_0x453d13[_0x252d('0x1b')](_0x3afadf)[_0x252d('0x27')](_0x39baa6);};}exports[_0x252d('0x28')]=function(_0x5a9012,_0x52a964){var _0x126ab4={},_0x417fd3={},_0x5d3d7c={'count':0x0,'rows':[]};var _0x5d0804=_[_0x252d('0x29')](db[_0x252d('0x2a')][_0x252d('0x2b')],function(_0x44da5d){return{'name':_0x44da5d[_0x252d('0x2c')],'type':_0x44da5d[_0x252d('0x2d')][_0x252d('0x2e')]};});_0x417fd3[_0x252d('0x2f')]=_[_0x252d('0x29')](_0x5d0804,_0x252d('0x26'));_0x417fd3['query']=_[_0x252d('0x30')](_0x5a9012[_0x252d('0x31')]);_0x417fd3[_0x252d('0x32')]=_[_0x252d('0x33')](_0x417fd3[_0x252d('0x2f')],_0x417fd3[_0x252d('0x31')]);_0x126ab4[_0x252d('0x34')]=_[_0x252d('0x33')](_0x417fd3['model'],qs['fields'](_0x5a9012[_0x252d('0x31')]['fields']));_0x126ab4[_0x252d('0x34')]=_0x126ab4[_0x252d('0x34')][_0x252d('0x35')]?_0x126ab4[_0x252d('0x34')]:_0x417fd3[_0x252d('0x2f')];if(!_0x5a9012[_0x252d('0x31')][_0x252d('0x36')]('nolimit')){_0x126ab4[_0x252d('0x1e')]=qs[_0x252d('0x1e')](_0x5a9012[_0x252d('0x31')]['limit']);_0x126ab4[_0x252d('0x1d')]=qs['offset'](_0x5a9012['query'][_0x252d('0x1d')]);}_0x126ab4[_0x252d('0x37')]=qs[_0x252d('0x38')](_0x5a9012[_0x252d('0x31')][_0x252d('0x38')]);_0x126ab4[_0x252d('0x39')]=qs[_0x252d('0x32')](_[_0x252d('0x3a')](_0x5a9012['query'],_0x417fd3[_0x252d('0x32')]),_0x5d0804);if(_0x5a9012['query'][_0x252d('0x3b')]){_0x126ab4[_0x252d('0x39')]=_[_0x252d('0x3c')](_0x126ab4[_0x252d('0x39')],{'$or':_[_0x252d('0x29')](_0x5d0804,function(_0xcecce5){if(_0xcecce5['type']!==_0x252d('0x3d')){var _0x362759={};_0x362759[_0xcecce5[_0x252d('0x26')]]={'$like':'%'+_0x5a9012[_0x252d('0x31')][_0x252d('0x3b')]+'%'};return _0x362759;}})});}_0x126ab4=_['merge']({},_0x126ab4,_0x5a9012[_0x252d('0x3e')]);var _0x2e69c3={'where':_0x126ab4[_0x252d('0x39')]};return db[_0x252d('0x2a')][_0x252d('0x1f')](_0x2e69c3)[_0x252d('0x25')](function(_0x5e45e9){_0x5d3d7c['count']=_0x5e45e9;if(_0x5a9012[_0x252d('0x31')][_0x252d('0x3f')]){_0x126ab4[_0x252d('0x40')]=[{'all':!![]}];}return db[_0x252d('0x2a')][_0x252d('0x41')](_0x126ab4);})['then'](function(_0x364051){_0x5d3d7c['rows']=_0x364051;return _0x5d3d7c;})[_0x252d('0x25')](respondWithFilteredResult(_0x52a964,_0x126ab4))['catch'](handleError(_0x52a964,null));};exports['show']=function(_0x41e02d,_0x4eb110){var _0x164ca2={'raw':!![],'where':{'id':_0x41e02d['params']['id']}},_0xb6916d={};_0xb6916d[_0x252d('0x2f')]=_['keys'](db[_0x252d('0x2a')]['rawAttributes']);_0xb6916d['query']=_[_0x252d('0x30')](_0x41e02d['query']);_0xb6916d['filters']=_[_0x252d('0x33')](_0xb6916d[_0x252d('0x2f')],_0xb6916d[_0x252d('0x31')]);_0x164ca2['attributes']=_[_0x252d('0x33')](_0xb6916d[_0x252d('0x2f')],qs[_0x252d('0x42')](_0x41e02d[_0x252d('0x31')]['fields']));_0x164ca2[_0x252d('0x34')]=_0x164ca2[_0x252d('0x34')][_0x252d('0x35')]?_0x164ca2['attributes']:_0xb6916d[_0x252d('0x2f')];if(_0x41e02d[_0x252d('0x31')][_0x252d('0x3f')]){_0x164ca2[_0x252d('0x40')]=[{'all':!![]}];}_0x164ca2=_[_0x252d('0x3c')]({},_0x164ca2,_0x41e02d['options']);return db[_0x252d('0x2a')][_0x252d('0x43')](_0x164ca2)['then'](handleEntityNotFound(_0x4eb110,null))['then'](respondWithResult(_0x4eb110,null))[_0x252d('0x44')](handleError(_0x4eb110,null));};exports[_0x252d('0x45')]=function(_0x54be44,_0x425154){return db[_0x252d('0x2a')]['create'](_0x54be44[_0x252d('0x46')],{})[_0x252d('0x25')](respondWithResult(_0x425154,0xc9))[_0x252d('0x44')](handleError(_0x425154,null));};exports[_0x252d('0x47')]=function(_0x3eb6ec,_0x3ad791){if(_0x3eb6ec[_0x252d('0x46')]['id']){delete _0x3eb6ec[_0x252d('0x46')]['id'];}return db[_0x252d('0x2a')][_0x252d('0x43')]({'where':{'id':_0x3eb6ec[_0x252d('0x48')]['id']}})[_0x252d('0x25')](handleEntityNotFound(_0x3ad791,null))['then'](saveUpdates(_0x3eb6ec[_0x252d('0x46')],null))[_0x252d('0x25')](respondWithResult(_0x3ad791,null))['catch'](handleError(_0x3ad791,null));};exports['destroy']=function(_0x11b240,_0x16984f){return db[_0x252d('0x2a')][_0x252d('0x43')]({'where':{'id':_0x11b240[_0x252d('0x48')]['id']}})[_0x252d('0x25')](handleEntityNotFound(_0x16984f,null))['then'](removeEntity(_0x16984f,null))[_0x252d('0x44')](handleError(_0x16984f,null));};exports['describe']=function(_0x45e2d4,_0x163f4f){return db[_0x252d('0x2a')]['describe']()['then'](respondWithResult(_0x163f4f,null))[_0x252d('0x44')](handleError(_0x163f4f,null));};
\ No newline at end of file
index c56bdf1..ea023ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bad=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7bad,0x159));var _0xd7ba=function(_0x500861,_0x488886){_0x500861=_0x500861-0x0;var _0x3919fd=_0x7bad[_0x500861];return _0x3919fd;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0xd7ba('0x0'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd7ba('0x1')](0x0);var events={'afterUpdate':_0xd7ba('0x2')};function emitEvent(_0x380ff5){return function(_0x4dd47b,_0x498afc,_0x28caf2){MailSubstatusEvents['emit'](_0x380ff5+':'+_0x4dd47b['id'],_0x4dd47b);MailSubstatusEvents['emit'](_0x380ff5,_0x4dd47b);_0x28caf2(null);};}for(var e in events){if(events[_0xd7ba('0x3')](e)){var event=events[e];MailSubstatus[_0xd7ba('0x4')](e,emitEvent(event));}}module[_0xd7ba('0x5')]=MailSubstatusEvents;
\ No newline at end of file
+var _0x63b8=['update','emit','hook','events','MailSubstatus','setMaxListeners'];(function(_0x474857,_0x271c2a){var _0x37a55e=function(_0x15bb11){while(--_0x15bb11){_0x474857['push'](_0x474857['shift']());}};_0x37a55e(++_0x271c2a);}(_0x63b8,0x17d));var _0x863b=function(_0x4674c3,_0x48f787){_0x4674c3=_0x4674c3-0x0;var _0x95024c=_0x63b8[_0x4674c3];return _0x95024c;};'use strict';var EventEmitter=require(_0x863b('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x863b('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x863b('0x2')](0x0);var events={'afterUpdate':_0x863b('0x3')};function emitEvent(_0x505c39){return function(_0x32ee58,_0x5dd080,_0x4d37af){MailSubstatusEvents[_0x863b('0x4')](_0x505c39+':'+_0x32ee58['id'],_0x32ee58);MailSubstatusEvents['emit'](_0x505c39,_0x32ee58);_0x4d37af(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x863b('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
index 8d37bc2..a80d140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04c6=['_previousDataValues','then','catch','exports','models','define','Condition','update','name','mailSubstatus'];(function(_0x194fc0,_0x492fdb){var _0x52476b=function(_0xfd1713){while(--_0xfd1713){_0x194fc0['push'](_0x194fc0['shift']());}};_0x52476b(++_0x492fdb);}(_0x04c6,0xc1));var _0x604c=function(_0x44414a,_0x16fdca){_0x44414a=_0x44414a-0x0;var _0x32ac6e=_0x04c6[_0x44414a];return _0x32ac6e;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x604c('0x0')]=function(_0x194201){var _0x2dd879=_0x194201[_0x604c('0x1')];return _0x194201[_0x604c('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x27ab5c,_0x5a48fe,_0x1b0da3){return _0x2dd879[_0x604c('0x3')][_0x604c('0x4')]({'value':_0x27ab5c[_0x604c('0x5')]},{'where':{'field':_0x604c('0x6'),'value':_0x27ab5c[_0x604c('0x7')][_0x604c('0x5')]}})[_0x604c('0x8')](function(){_0x1b0da3();})[_0x604c('0x9')](function(_0x506992){_0x1b0da3(_0x506992);});}}});};
\ No newline at end of file
+var _0x22e4=['MailSubstatus','Condition','_previousDataValues','name','then','catch','./mailSubstatus.attributes','exports','models','define'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x22e4,0x150));var _0x422e=function(_0x47b30e,_0x281c63){_0x47b30e=_0x47b30e-0x0;var _0x4466b6=_0x22e4[_0x47b30e];return _0x4466b6;};'use strict';var attributes=require(_0x422e('0x0'));module[_0x422e('0x1')]=function(_0x45d05e){var _0x31a469=_0x45d05e[_0x422e('0x2')];return _0x45d05e[_0x422e('0x3')](_0x422e('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2083f0,_0x22c639,_0x254af5){return _0x31a469[_0x422e('0x5')]['update']({'value':_0x2083f0['name']},{'where':{'field':'mailSubstatus','value':_0x2083f0[_0x422e('0x6')][_0x422e('0x7')]}})[_0x422e('0x8')](function(){_0x254af5();})[_0x422e('0x9')](function(_0x1c69a6){_0x254af5(_0x1c69a6);});}}});};
\ No newline at end of file
index 8499b12..ee9eb75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d31=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','MailSubstatus,\x20%s,\x20%s','result','catch'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x7d31,0x165));var _0x17d3=function(_0x5dd778,_0x5045e8){_0x5dd778=_0x5dd778-0x0;var _0x359c75=_0x7d31[_0x5dd778];return _0x359c75;};'use strict';var _=require(_0x17d3('0x0'));var util=require('util');var moment=require(_0x17d3('0x1'));var BPromise=require(_0x17d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17d3('0x3'));var db=require(_0x17d3('0x4'))['db'];var utils=require(_0x17d3('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x17d3('0x6'));var jayson=require(_0x17d3('0x7'));var client=jayson[_0x17d3('0x8')][_0x17d3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x59037e,_0x59fd09,_0x2a92fd){return new BPromise(function(_0x326597,_0x3b2097){return client['request'](_0x59037e,_0x2a92fd)[_0x17d3('0xa')](function(_0x127759){logger[_0x17d3('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x17d3('0xc'));logger[_0x17d3('0xd')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x59fd09,'request\x20sent',JSON[_0x17d3('0xe')](_0x127759));if(_0x127759[_0x17d3('0xf')]){if(_0x127759[_0x17d3('0xf')][_0x17d3('0x10')]===0x1f4){logger[_0x17d3('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x127759[_0x17d3('0xf')][_0x17d3('0x11')]);return _0x3b2097(_0x127759['error'][_0x17d3('0x11')]);}logger[_0x17d3('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x127759[_0x17d3('0xf')][_0x17d3('0x11')]);return _0x326597(_0x127759[_0x17d3('0xf')][_0x17d3('0x11')]);}else{logger[_0x17d3('0xb')](_0x17d3('0x12'),_0x59fd09,_0x17d3('0xc'));_0x326597(_0x127759[_0x17d3('0x13')][_0x17d3('0x11')]);}})[_0x17d3('0x14')](function(_0x46db29){logger[_0x17d3('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x59fd09,_0x46db29);_0x3b2097(_0x46db29);});});}
\ No newline at end of file
+var _0x1b2b=['rpc','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x50f112,_0xd38e53){var _0x4ecf28=function(_0x62b75){while(--_0x62b75){_0x50f112['push'](_0x50f112['shift']());}};_0x4ecf28(++_0xd38e53);}(_0x1b2b,0xde));var _0xb1b2=function(_0x165194,_0x31a93e){_0x165194=_0x165194-0x0;var _0x2975f0=_0x1b2b[_0x165194];return _0x2975f0;};'use strict';var _=require(_0xb1b2('0x0'));var util=require(_0xb1b2('0x1'));var moment=require(_0xb1b2('0x2'));var BPromise=require(_0xb1b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1b2('0x4'));var db=require(_0xb1b2('0x5'))['db'];var utils=require(_0xb1b2('0x6'));var logger=require(_0xb1b2('0x7'))(_0xb1b2('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1b2('0x9'));var client=jayson[_0xb1b2('0xa')][_0xb1b2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x513b78,_0x81810f,_0x19aff3){return new BPromise(function(_0x4f76b8,_0x302a95){return client['request'](_0x513b78,_0x19aff3)['then'](function(_0x4e718a){logger[_0xb1b2('0xc')](_0xb1b2('0xd'),_0x81810f,_0xb1b2('0xe'));logger[_0xb1b2('0xf')](_0xb1b2('0x10'),_0x81810f,_0xb1b2('0xe'),JSON[_0xb1b2('0x11')](_0x4e718a));if(_0x4e718a[_0xb1b2('0x12')]){if(_0x4e718a[_0xb1b2('0x12')][_0xb1b2('0x13')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x81810f,_0x4e718a[_0xb1b2('0x12')][_0xb1b2('0x14')]);return _0x302a95(_0x4e718a['error'][_0xb1b2('0x14')]);}logger[_0xb1b2('0x12')](_0xb1b2('0xd'),_0x81810f,_0x4e718a[_0xb1b2('0x12')]['message']);return _0x4f76b8(_0x4e718a['error'][_0xb1b2('0x14')]);}else{logger[_0xb1b2('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x81810f,_0xb1b2('0xe'));_0x4f76b8(_0x4e718a[_0xb1b2('0x15')][_0xb1b2('0x14')]);}})[_0xb1b2('0x16')](function(_0x1e4b34){logger['error'](_0xb1b2('0xd'),_0x81810f,_0x1e4b34);_0x302a95(_0x1e4b34);});});}
\ No newline at end of file
index d4b3213..4bbfe85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8788=['get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','./mailTransferReport.controller'];(function(_0x2a3ffc,_0x3c2b77){var _0x22a20d=function(_0x52e470){while(--_0x52e470){_0x2a3ffc['push'](_0x2a3ffc['shift']());}};_0x22a20d(++_0x3c2b77);}(_0x8788,0xf6));var _0x8878=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0x8788[_0x38a7ac];return _0x53061a;};'use strict';var multer=require(_0x8878('0x0'));var util=require('util');var path=require(_0x8878('0x1'));var timeout=require('connect-timeout');var express=require(_0x8878('0x2'));var router=express['Router']();var fs_extra=require(_0x8878('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x8878('0x4'));var config=require('../../config/environment');var controller=require(_0x8878('0x5'));router[_0x8878('0x6')]('/',auth[_0x8878('0x7')](),controller['index']);router['get'](_0x8878('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x8878('0x6')](_0x8878('0x9'),auth[_0x8878('0x7')](),controller[_0x8878('0xa')]);router[_0x8878('0xb')]('/',auth[_0x8878('0x7')](),controller[_0x8878('0xc')]);router[_0x8878('0xd')](_0x8878('0x9'),auth[_0x8878('0x7')](),controller[_0x8878('0xe')]);router[_0x8878('0xf')](_0x8878('0x9'),auth[_0x8878('0x7')](),controller[_0x8878('0x10')]);module[_0x8878('0x11')]=router;
\ No newline at end of file
+var _0x69e7=['isAuthenticated','get','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x390143,_0x2b54ac){var _0x11361b=function(_0x3666c3){while(--_0x3666c3){_0x390143['push'](_0x390143['shift']());}};_0x11361b(++_0x2b54ac);}(_0x69e7,0xdc));var _0x769e=function(_0x45a48f,_0x64e6af){_0x45a48f=_0x45a48f-0x0;var _0x27b4c3=_0x69e7[_0x45a48f];return _0x27b4c3;};'use strict';var multer=require(_0x769e('0x0'));var util=require(_0x769e('0x1'));var path=require(_0x769e('0x2'));var timeout=require(_0x769e('0x3'));var express=require(_0x769e('0x4'));var router=express[_0x769e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x769e('0x6'));var interaction=require(_0x769e('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x769e('0x8')](),controller['index']);router[_0x769e('0x9')](_0x769e('0xa'),auth[_0x769e('0x8')](),controller[_0x769e('0xb')]);router['get'](_0x769e('0xc'),auth[_0x769e('0x8')](),controller[_0x769e('0xd')]);router[_0x769e('0xe')]('/',auth[_0x769e('0x8')](),controller['create']);router[_0x769e('0xf')](_0x769e('0xc'),auth[_0x769e('0x8')](),controller[_0x769e('0x10')]);router['delete'](_0x769e('0xc'),auth['isAuthenticated'](),controller[_0x769e('0x11')]);module[_0x769e('0x12')]=router;
\ No newline at end of file
index fe6a3a1..a8f9f64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x20c4de,_0x569bc0){var _0x4b0281=function(_0x83d393){while(--_0x83d393){_0x20c4de['push'](_0x20c4de['shift']());}};_0x4b0281(++_0x569bc0);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ab23a,_0x12d3f9){_0x4ab23a=_0x4ab23a-0x0;var _0x11cd33=_0xedd9[_0x4ab23a];return _0x11cd33;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1ce71c,_0x1f2369){var _0x38c215=function(_0x2777b7){while(--_0x2777b7){_0x1ce71c['push'](_0x1ce71c['shift']());}};_0x38c215(++_0x1f2369);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}};
\ No newline at end of file
index d08d830..1858056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa02b=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','MailTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','show','params','attributes','options','find','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x4e1269,_0x197395){var _0x293b6a=function(_0x5ac937){while(--_0x5ac937){_0x4e1269['push'](_0x4e1269['shift']());}};_0x293b6a(++_0x197395);}(_0xa02b,0x1ba));var _0xba02=function(_0x3ba671,_0x40d517){_0x3ba671=_0x3ba671-0x0;var _0x1a610d=_0xa02b[_0x3ba671];return _0x1a610d;};'use strict';var emlformat=require(_0xba02('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xba02('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xba02('0x2'));var moment=require(_0xba02('0x3'));var BPromise=require(_0xba02('0x4'));var Mustache=require('mustache');var util=require(_0xba02('0x5'));var path=require(_0xba02('0x6'));var sox=require(_0xba02('0x7'));var csv=require(_0xba02('0x8'));var ejs=require(_0xba02('0x9'));var fs=require('fs');var fs_extra=require(_0xba02('0xa'));var _=require(_0xba02('0xb'));var squel=require(_0xba02('0xc'));var crypto=require(_0xba02('0xd'));var jsforce=require(_0xba02('0xe'));var deskjs=require(_0xba02('0xf'));var toCsv=require(_0xba02('0x8'));var querystring=require(_0xba02('0x10'));var Papa=require(_0xba02('0x11'));var Redis=require(_0xba02('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xba02('0x13'));var as=require(_0xba02('0x14'));var hardwareService=require(_0xba02('0x15'));var logger=require(_0xba02('0x16'))(_0xba02('0x17'));var utils=require('../../config/utils');var config=require(_0xba02('0x18'));var licenseUtil=require(_0xba02('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a551a,_0x3244e9){_0x3244e9=_0x3244e9||0xcc;return function(_0x4d1ade){if(_0x4d1ade){return _0x1a551a['sendStatus'](_0x3244e9);}return _0x1a551a[_0xba02('0x1a')](_0x3244e9)['end']();};}function respondWithResult(_0x5564de,_0x48cb04){_0x48cb04=_0x48cb04||0xc8;return function(_0x3a99d7){if(_0x3a99d7){return _0x5564de[_0xba02('0x1a')](_0x48cb04)[_0xba02('0x1b')](_0x3a99d7);}};}function respondWithFilteredResult(_0x37b945,_0x247af0){return function(_0x5480bf){if(_0x5480bf){var _0x5dced7=typeof _0x247af0['offset']===_0xba02('0x1c')&&typeof _0x247af0[_0xba02('0x1d')]===_0xba02('0x1c');var _0x1ed230=_0x5480bf[_0xba02('0x1e')];var _0x3eb3c0=_0x5dced7?0x0:_0x247af0['offset'];var _0x23a639=_0x5dced7?_0x5480bf[_0xba02('0x1e')]:_0x247af0[_0xba02('0x1f')]+_0x247af0['limit'];var _0x5483aa;if(_0x23a639>=_0x1ed230){_0x23a639=_0x1ed230;_0x5483aa=0xc8;}else{_0x5483aa=0xce;}_0x37b945[_0xba02('0x1a')](_0x5483aa);return _0x37b945['set'](_0xba02('0x20'),_0x3eb3c0+'-'+_0x23a639+'/'+_0x1ed230)[_0xba02('0x1b')](_0x5480bf);}return null;};}function patchUpdates(_0x55fa4b){return function(_0x444f16){try{jsonpatch['apply'](_0x444f16,_0x55fa4b,!![]);}catch(_0x1af46f){return BPromise[_0xba02('0x21')](_0x1af46f);}return _0x444f16[_0xba02('0x22')]();};}function saveUpdates(_0x5b25f6,_0x3a9978){return function(_0x6491f8){if(_0x6491f8){return _0x6491f8[_0xba02('0x23')](_0x5b25f6)[_0xba02('0x24')](function(_0x51dfa8){return _0x51dfa8;});}return null;};}function removeEntity(_0x7826f5,_0x30ef02){return function(_0x1700fb){if(_0x1700fb){return _0x1700fb[_0xba02('0x25')]()['then'](function(){_0x7826f5[_0xba02('0x1a')](0xcc)[_0xba02('0x26')]();});}};}function handleEntityNotFound(_0x421e4f,_0x13d20e){return function(_0x1a83e6){if(!_0x1a83e6){_0x421e4f[_0xba02('0x27')](0x194);}return _0x1a83e6;};}function handleError(_0x3b7fe3,_0xd5c667){_0xd5c667=_0xd5c667||0x1f4;return function(_0x5e0a29){logger[_0xba02('0x28')](_0x5e0a29[_0xba02('0x29')]);if(_0x5e0a29[_0xba02('0x2a')]){delete _0x5e0a29[_0xba02('0x2a')];}_0x3b7fe3[_0xba02('0x1a')](_0xd5c667)['send'](_0x5e0a29);};}exports[_0xba02('0x2b')]=function(_0x2e2fb4,_0x3dfbfb){var _0x52e673={},_0x485694={},_0x443fde={'count':0x0,'rows':[]};var _0x7580b5=_['map'](db[_0xba02('0x2c')][_0xba02('0x2d')],function(_0x5a227b){return{'name':_0x5a227b[_0xba02('0x2e')],'type':_0x5a227b['type'][_0xba02('0x2f')]};});_0x485694[_0xba02('0x30')]=_[_0xba02('0x31')](_0x7580b5,_0xba02('0x2a'));_0x485694[_0xba02('0x32')]=_[_0xba02('0x33')](_0x2e2fb4[_0xba02('0x32')]);_0x485694[_0xba02('0x34')]=_['intersection'](_0x485694['model'],_0x485694[_0xba02('0x32')]);_0x52e673['attributes']=_[_0xba02('0x35')](_0x485694[_0xba02('0x30')],qs[_0xba02('0x36')](_0x2e2fb4[_0xba02('0x32')][_0xba02('0x36')]));_0x52e673['attributes']=_0x52e673['attributes'][_0xba02('0x37')]?_0x52e673['attributes']:_0x485694[_0xba02('0x30')];if(!_0x2e2fb4[_0xba02('0x32')][_0xba02('0x38')](_0xba02('0x39'))){_0x52e673[_0xba02('0x1d')]=qs[_0xba02('0x1d')](_0x2e2fb4['query']['limit']);_0x52e673[_0xba02('0x1f')]=qs[_0xba02('0x1f')](_0x2e2fb4['query'][_0xba02('0x1f')]);}_0x52e673[_0xba02('0x3a')]=qs[_0xba02('0x3b')](_0x2e2fb4[_0xba02('0x32')][_0xba02('0x3b')]);_0x52e673[_0xba02('0x3c')]=qs[_0xba02('0x34')](_['pick'](_0x2e2fb4[_0xba02('0x32')],_0x485694[_0xba02('0x34')]),_0x7580b5);if(_0x2e2fb4['query'][_0xba02('0x3d')]){_0x52e673['where']=_[_0xba02('0x3e')](_0x52e673['where'],{'$or':_[_0xba02('0x31')](_0x7580b5,function(_0x461561){if(_0x461561[_0xba02('0x3f')]!==_0xba02('0x40')){var _0x341918={};_0x341918[_0x461561[_0xba02('0x2a')]]={'$like':'%'+_0x2e2fb4[_0xba02('0x32')][_0xba02('0x3d')]+'%'};return _0x341918;}})});}_0x52e673=_[_0xba02('0x3e')]({},_0x52e673,_0x2e2fb4['options']);var _0x1c9c86={'where':_0x52e673[_0xba02('0x3c')]};return db[_0xba02('0x2c')][_0xba02('0x1e')](_0x1c9c86)['then'](function(_0x91cfd3){_0x443fde[_0xba02('0x1e')]=_0x91cfd3;if(_0x2e2fb4['query'][_0xba02('0x41')]){_0x52e673['include']=[{'all':!![]}];}return db[_0xba02('0x2c')][_0xba02('0x42')](_0x52e673);})[_0xba02('0x24')](function(_0x4d7a79){_0x443fde[_0xba02('0x43')]=_0x4d7a79;return _0x443fde;})[_0xba02('0x24')](respondWithFilteredResult(_0x3dfbfb,_0x52e673))[_0xba02('0x44')](handleError(_0x3dfbfb,null));};exports[_0xba02('0x45')]=function(_0x3dc6d0,_0x21dabe){var _0x55e233={'raw':!![],'where':{'id':_0x3dc6d0[_0xba02('0x46')]['id']}},_0x322ea6={};_0x322ea6[_0xba02('0x30')]=_[_0xba02('0x33')](db[_0xba02('0x2c')]['rawAttributes']);_0x322ea6[_0xba02('0x32')]=_['keys'](_0x3dc6d0[_0xba02('0x32')]);_0x322ea6['filters']=_[_0xba02('0x35')](_0x322ea6[_0xba02('0x30')],_0x322ea6['query']);_0x55e233[_0xba02('0x47')]=_['intersection'](_0x322ea6[_0xba02('0x30')],qs[_0xba02('0x36')](_0x3dc6d0[_0xba02('0x32')][_0xba02('0x36')]));_0x55e233['attributes']=_0x55e233[_0xba02('0x47')][_0xba02('0x37')]?_0x55e233['attributes']:_0x322ea6[_0xba02('0x30')];if(_0x3dc6d0[_0xba02('0x32')][_0xba02('0x41')]){_0x55e233['include']=[{'all':!![]}];}_0x55e233=_[_0xba02('0x3e')]({},_0x55e233,_0x3dc6d0[_0xba02('0x48')]);return db[_0xba02('0x2c')][_0xba02('0x49')](_0x55e233)[_0xba02('0x24')](handleEntityNotFound(_0x21dabe,null))[_0xba02('0x24')](respondWithResult(_0x21dabe,null))[_0xba02('0x44')](handleError(_0x21dabe,null));};exports['create']=function(_0x2a7592,_0x1efb1b){return db[_0xba02('0x2c')]['create'](_0x2a7592[_0xba02('0x4a')],{})[_0xba02('0x24')](respondWithResult(_0x1efb1b,0xc9))['catch'](handleError(_0x1efb1b,null));};exports[_0xba02('0x23')]=function(_0x2209e6,_0x1a28a2){if(_0x2209e6[_0xba02('0x4a')]['id']){delete _0x2209e6[_0xba02('0x4a')]['id'];}return db[_0xba02('0x2c')]['find']({'where':{'id':_0x2209e6[_0xba02('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a28a2,null))[_0xba02('0x24')](saveUpdates(_0x2209e6[_0xba02('0x4a')],null))[_0xba02('0x24')](respondWithResult(_0x1a28a2,null))[_0xba02('0x44')](handleError(_0x1a28a2,null));};exports['destroy']=function(_0xfbeafa,_0x2c6b61){return db[_0xba02('0x2c')][_0xba02('0x49')]({'where':{'id':_0xfbeafa[_0xba02('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c6b61,null))['then'](removeEntity(_0x2c6b61,null))[_0xba02('0x44')](handleError(_0x2c6b61,null));};exports['describe']=function(_0x3b9b8f,_0x1c319f){return db[_0xba02('0x2c')][_0xba02('0x4b')]()[_0xba02('0x24')](respondWithResult(_0x1c319f,null))[_0xba02('0x44')](handleError(_0x1c319f,null));};
\ No newline at end of file
+var _0x5a84=['sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','reject','save','update','then','destroy','error','name','send','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','MailTransferReport','includeAll','include','params','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x1c3d0b,_0x6a0247){var _0x47ce7a=function(_0x32f700){while(--_0x32f700){_0x1c3d0b['push'](_0x1c3d0b['shift']());}};_0x47ce7a(++_0x6a0247);}(_0x5a84,0x197));var _0x45a8=function(_0x417c2a,_0x16470e){_0x417c2a=_0x417c2a-0x0;var _0x284423=_0x5a84[_0x417c2a];return _0x284423;};'use strict';var emlformat=require(_0x45a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x45a8('0x1'));var jsonpatch=require(_0x45a8('0x2'));var rp=require(_0x45a8('0x3'));var moment=require('moment');var BPromise=require(_0x45a8('0x4'));var Mustache=require('mustache');var util=require(_0x45a8('0x5'));var path=require(_0x45a8('0x6'));var sox=require(_0x45a8('0x7'));var csv=require(_0x45a8('0x8'));var ejs=require(_0x45a8('0x9'));var fs=require('fs');var fs_extra=require(_0x45a8('0xa'));var _=require(_0x45a8('0xb'));var squel=require('squel');var crypto=require(_0x45a8('0xc'));var jsforce=require(_0x45a8('0xd'));var deskjs=require(_0x45a8('0xe'));var toCsv=require(_0x45a8('0x8'));var querystring=require('querystring');var Papa=require(_0x45a8('0xf'));var Redis=require(_0x45a8('0x10'));var authService=require(_0x45a8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x45a8('0x12'));var hardwareService=require(_0x45a8('0x13'));var logger=require(_0x45a8('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x45a8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x45a8('0x16'))['db'];function respondWithStatusCode(_0x339e6b,_0x4e75dd){_0x4e75dd=_0x4e75dd||0xcc;return function(_0x27a257){if(_0x27a257){return _0x339e6b['sendStatus'](_0x4e75dd);}return _0x339e6b[_0x45a8('0x17')](_0x4e75dd)[_0x45a8('0x18')]();};}function respondWithResult(_0x28878a,_0x53d8f6){_0x53d8f6=_0x53d8f6||0xc8;return function(_0x21d94c){if(_0x21d94c){return _0x28878a[_0x45a8('0x17')](_0x53d8f6)['json'](_0x21d94c);}};}function respondWithFilteredResult(_0x3a6561,_0x398bfa){return function(_0x3ee57a){if(_0x3ee57a){var _0x492d3c=typeof _0x398bfa[_0x45a8('0x19')]===_0x45a8('0x1a')&&typeof _0x398bfa[_0x45a8('0x1b')]===_0x45a8('0x1a');var _0x1ddf5f=_0x3ee57a[_0x45a8('0x1c')];var _0x540330=_0x492d3c?0x0:_0x398bfa[_0x45a8('0x19')];var _0x198bcb=_0x492d3c?_0x3ee57a[_0x45a8('0x1c')]:_0x398bfa['offset']+_0x398bfa['limit'];var _0x44f867;if(_0x198bcb>=_0x1ddf5f){_0x198bcb=_0x1ddf5f;_0x44f867=0xc8;}else{_0x44f867=0xce;}_0x3a6561[_0x45a8('0x17')](_0x44f867);return _0x3a6561['set']('Content-Range',_0x540330+'-'+_0x198bcb+'/'+_0x1ddf5f)['json'](_0x3ee57a);}return null;};}function patchUpdates(_0x5a8293){return function(_0x47bf3e){try{jsonpatch['apply'](_0x47bf3e,_0x5a8293,!![]);}catch(_0x297415){return BPromise[_0x45a8('0x1d')](_0x297415);}return _0x47bf3e[_0x45a8('0x1e')]();};}function saveUpdates(_0x18a6b2,_0x116114){return function(_0x31eb5c){if(_0x31eb5c){return _0x31eb5c[_0x45a8('0x1f')](_0x18a6b2)[_0x45a8('0x20')](function(_0x196dce){return _0x196dce;});}return null;};}function removeEntity(_0x553706,_0x2cd7f5){return function(_0x414e6b){if(_0x414e6b){return _0x414e6b[_0x45a8('0x21')]()[_0x45a8('0x20')](function(){_0x553706[_0x45a8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12fea9,_0x581d06){return function(_0x55eefa){if(!_0x55eefa){_0x12fea9['sendStatus'](0x194);}return _0x55eefa;};}function handleError(_0x282478,_0x2111d5){_0x2111d5=_0x2111d5||0x1f4;return function(_0x1ac007){logger[_0x45a8('0x22')](_0x1ac007['stack']);if(_0x1ac007[_0x45a8('0x23')]){delete _0x1ac007[_0x45a8('0x23')];}_0x282478[_0x45a8('0x17')](_0x2111d5)[_0x45a8('0x24')](_0x1ac007);};}exports['index']=function(_0x36e905,_0xea1e2a){var _0x347467={},_0x19c7f6={},_0x97ec1f={'count':0x0,'rows':[]};var _0x1bbaf4=_[_0x45a8('0x25')](db['MailTransferReport']['rawAttributes'],function(_0x272083){return{'name':_0x272083[_0x45a8('0x26')],'type':_0x272083['type'][_0x45a8('0x27')]};});_0x19c7f6[_0x45a8('0x28')]=_[_0x45a8('0x25')](_0x1bbaf4,_0x45a8('0x23'));_0x19c7f6['query']=_[_0x45a8('0x29')](_0x36e905[_0x45a8('0x2a')]);_0x19c7f6[_0x45a8('0x2b')]=_[_0x45a8('0x2c')](_0x19c7f6[_0x45a8('0x28')],_0x19c7f6[_0x45a8('0x2a')]);_0x347467['attributes']=_[_0x45a8('0x2c')](_0x19c7f6['model'],qs[_0x45a8('0x2d')](_0x36e905[_0x45a8('0x2a')][_0x45a8('0x2d')]));_0x347467[_0x45a8('0x2e')]=_0x347467[_0x45a8('0x2e')][_0x45a8('0x2f')]?_0x347467[_0x45a8('0x2e')]:_0x19c7f6[_0x45a8('0x28')];if(!_0x36e905[_0x45a8('0x2a')][_0x45a8('0x30')](_0x45a8('0x31'))){_0x347467[_0x45a8('0x1b')]=qs[_0x45a8('0x1b')](_0x36e905[_0x45a8('0x2a')][_0x45a8('0x1b')]);_0x347467[_0x45a8('0x19')]=qs[_0x45a8('0x19')](_0x36e905['query'][_0x45a8('0x19')]);}_0x347467[_0x45a8('0x32')]=qs[_0x45a8('0x33')](_0x36e905['query'][_0x45a8('0x33')]);_0x347467[_0x45a8('0x34')]=qs['filters'](_[_0x45a8('0x35')](_0x36e905[_0x45a8('0x2a')],_0x19c7f6[_0x45a8('0x2b')]),_0x1bbaf4);if(_0x36e905[_0x45a8('0x2a')]['filter']){_0x347467[_0x45a8('0x34')]=_[_0x45a8('0x36')](_0x347467['where'],{'$or':_['map'](_0x1bbaf4,function(_0x45c0ca){if(_0x45c0ca[_0x45a8('0x37')]!==_0x45a8('0x38')){var _0x2b47dd={};_0x2b47dd[_0x45c0ca['name']]={'$like':'%'+_0x36e905[_0x45a8('0x2a')][_0x45a8('0x39')]+'%'};return _0x2b47dd;}})});}_0x347467=_['merge']({},_0x347467,_0x36e905[_0x45a8('0x3a')]);var _0x14a9d8={'where':_0x347467[_0x45a8('0x34')]};return db[_0x45a8('0x3b')]['count'](_0x14a9d8)['then'](function(_0x3cd335){_0x97ec1f[_0x45a8('0x1c')]=_0x3cd335;if(_0x36e905[_0x45a8('0x2a')][_0x45a8('0x3c')]){_0x347467[_0x45a8('0x3d')]=[{'all':!![]}];}return db[_0x45a8('0x3b')]['findAll'](_0x347467);})[_0x45a8('0x20')](function(_0x9a8300){_0x97ec1f['rows']=_0x9a8300;return _0x97ec1f;})[_0x45a8('0x20')](respondWithFilteredResult(_0xea1e2a,_0x347467))['catch'](handleError(_0xea1e2a,null));};exports['show']=function(_0x3f6d3f,_0x4afa40){var _0x1dcccf={'raw':!![],'where':{'id':_0x3f6d3f[_0x45a8('0x3e')]['id']}},_0x524d7f={};_0x524d7f[_0x45a8('0x28')]=_[_0x45a8('0x29')](db['MailTransferReport'][_0x45a8('0x3f')]);_0x524d7f[_0x45a8('0x2a')]=_[_0x45a8('0x29')](_0x3f6d3f[_0x45a8('0x2a')]);_0x524d7f[_0x45a8('0x2b')]=_['intersection'](_0x524d7f[_0x45a8('0x28')],_0x524d7f[_0x45a8('0x2a')]);_0x1dcccf['attributes']=_[_0x45a8('0x2c')](_0x524d7f[_0x45a8('0x28')],qs[_0x45a8('0x2d')](_0x3f6d3f['query'][_0x45a8('0x2d')]));_0x1dcccf[_0x45a8('0x2e')]=_0x1dcccf[_0x45a8('0x2e')][_0x45a8('0x2f')]?_0x1dcccf[_0x45a8('0x2e')]:_0x524d7f[_0x45a8('0x28')];if(_0x3f6d3f[_0x45a8('0x2a')]['includeAll']){_0x1dcccf[_0x45a8('0x3d')]=[{'all':!![]}];}_0x1dcccf=_['merge']({},_0x1dcccf,_0x3f6d3f[_0x45a8('0x3a')]);return db[_0x45a8('0x3b')][_0x45a8('0x40')](_0x1dcccf)[_0x45a8('0x20')](handleEntityNotFound(_0x4afa40,null))[_0x45a8('0x20')](respondWithResult(_0x4afa40,null))[_0x45a8('0x41')](handleError(_0x4afa40,null));};exports[_0x45a8('0x42')]=function(_0x4b4f97,_0x344ba3){return db[_0x45a8('0x3b')]['create'](_0x4b4f97[_0x45a8('0x43')],{})[_0x45a8('0x20')](respondWithResult(_0x344ba3,0xc9))[_0x45a8('0x41')](handleError(_0x344ba3,null));};exports[_0x45a8('0x1f')]=function(_0x3303db,_0x2d62f1){if(_0x3303db[_0x45a8('0x43')]['id']){delete _0x3303db[_0x45a8('0x43')]['id'];}return db['MailTransferReport'][_0x45a8('0x40')]({'where':{'id':_0x3303db[_0x45a8('0x3e')]['id']}})[_0x45a8('0x20')](handleEntityNotFound(_0x2d62f1,null))['then'](saveUpdates(_0x3303db['body'],null))['then'](respondWithResult(_0x2d62f1,null))[_0x45a8('0x41')](handleError(_0x2d62f1,null));};exports[_0x45a8('0x21')]=function(_0x2a08fe,_0x241b5a){return db[_0x45a8('0x3b')][_0x45a8('0x40')]({'where':{'id':_0x2a08fe[_0x45a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x241b5a,null))['then'](removeEntity(_0x241b5a,null))[_0x45a8('0x41')](handleError(_0x241b5a,null));};exports[_0x45a8('0x44')]=function(_0x1f867f,_0x2e6251){return db['MailTransferReport']['describe']()[_0x45a8('0x20')](respondWithResult(_0x2e6251,null))[_0x45a8('0x41')](handleError(_0x2e6251,null));};
\ No newline at end of file
index 6339ffc..1e526c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x684d=['api','bluebird','path','rimraf','../../config/environment','exports','MailTransferReport','report_mail_transfer','uniqueid','util','../../config/logger'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x684d,0x174));var _0xd684=function(_0x7397ae,_0x47a49d){_0x7397ae=_0x7397ae-0x0;var _0x5c8635=_0x684d[_0x7397ae];return _0x5c8635;};'use strict';var _=require('lodash');var util=require(_0xd684('0x0'));var logger=require(_0xd684('0x1'))(_0xd684('0x2'));var moment=require('moment');var BPromise=require(_0xd684('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd684('0x4'));var rimraf=require(_0xd684('0x5'));var config=require(_0xd684('0x6'));var attributes=require('./mailTransferReport.attributes');module[_0xd684('0x7')]=function(_0x5f50ac,_0x3bf907){return _0x5f50ac['define'](_0xd684('0x8'),attributes,{'tableName':_0xd684('0x9'),'paranoid':![],'indexes':[{'name':_0xd684('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd307=['../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd307,0x110));var _0x7d30=function(_0xaf69f,_0x49063f){_0xaf69f=_0xaf69f-0x0;var _0x1cadef=_0xd307[_0xaf69f];return _0x1cadef;};'use strict';var _=require(_0x7d30('0x0'));var util=require(_0x7d30('0x1'));var logger=require(_0x7d30('0x2'))(_0x7d30('0x3'));var moment=require(_0x7d30('0x4'));var BPromise=require(_0x7d30('0x5'));var rp=require(_0x7d30('0x6'));var fs=require('fs');var path=require(_0x7d30('0x7'));var rimraf=require('rimraf');var config=require(_0x7d30('0x8'));var attributes=require(_0x7d30('0x9'));module['exports']=function(_0x400916,_0x449938){return _0x400916[_0x7d30('0xa')](_0x7d30('0xb'),attributes,{'tableName':_0x7d30('0xc'),'paranoid':![],'indexes':[{'name':_0x7d30('0xd'),'fields':[_0x7d30('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 58bae8a..c735ce5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a20=['request\x20sent','debug','stringify','error','message','result','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0x3b7bdb,_0x31cd72){var _0x3b27b8=function(_0x15b214){while(--_0x15b214){_0x3b7bdb['push'](_0x3b7bdb['shift']());}};_0x3b27b8(++_0x31cd72);}(_0x0a20,0x6a));var _0x00a2=function(_0x168c36,_0x8a04b6){_0x168c36=_0x168c36-0x0;var _0x17d5f4=_0x0a20[_0x168c36];return _0x17d5f4;};'use strict';var _=require(_0x00a2('0x0'));var util=require(_0x00a2('0x1'));var moment=require(_0x00a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00a2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x00a2('0x4'));var logger=require('../../config/logger')(_0x00a2('0x5'));var config=require(_0x00a2('0x6'));var jayson=require(_0x00a2('0x7'));var client=jayson[_0x00a2('0x8')][_0x00a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c7a5b,_0x2a8f65,_0x202184){return new BPromise(function(_0xfac293,_0x1cbeb1){return client[_0x00a2('0xa')](_0x2c7a5b,_0x202184)[_0x00a2('0xb')](function(_0xfb49ae){logger[_0x00a2('0xc')](_0x00a2('0xd'),_0x2a8f65,_0x00a2('0xe'));logger[_0x00a2('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2a8f65,_0x00a2('0xe'),JSON[_0x00a2('0x10')](_0xfb49ae));if(_0xfb49ae['error']){if(_0xfb49ae[_0x00a2('0x11')]['code']===0x1f4){logger[_0x00a2('0x11')](_0x00a2('0xd'),_0x2a8f65,_0xfb49ae['error'][_0x00a2('0x12')]);return _0x1cbeb1(_0xfb49ae[_0x00a2('0x11')][_0x00a2('0x12')]);}logger[_0x00a2('0x11')](_0x00a2('0xd'),_0x2a8f65,_0xfb49ae['error'][_0x00a2('0x12')]);return _0xfac293(_0xfb49ae[_0x00a2('0x11')][_0x00a2('0x12')]);}else{logger[_0x00a2('0xc')](_0x00a2('0xd'),_0x2a8f65,'request\x20sent');_0xfac293(_0xfb49ae[_0x00a2('0x13')][_0x00a2('0x12')]);}})['catch'](function(_0x19bede){logger[_0x00a2('0x11')](_0x00a2('0xd'),_0x2a8f65,_0x19bede);_0x1cbeb1(_0x19bede);});});}
\ No newline at end of file
+var _0x31ce=['message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x31ce,0x192));var _0xe31c=function(_0x788a54,_0x12450b){_0x788a54=_0x788a54-0x0;var _0x8b73a4=_0x31ce[_0x788a54];return _0x8b73a4;};'use strict';var _=require(_0xe31c('0x0'));var util=require('util');var moment=require(_0xe31c('0x1'));var BPromise=require(_0xe31c('0x2'));var rs=require(_0xe31c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe31c('0x4'))['db'];var utils=require(_0xe31c('0x5'));var logger=require(_0xe31c('0x6'))(_0xe31c('0x7'));var config=require(_0xe31c('0x8'));var jayson=require(_0xe31c('0x9'));var client=jayson[_0xe31c('0xa')][_0xe31c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13f33c,_0x4bb807,_0x1f1df6){return new BPromise(function(_0x2caa83,_0x284dd5){return client['request'](_0x13f33c,_0x1f1df6)['then'](function(_0x2d6d28){logger['info'](_0xe31c('0xc'),_0x4bb807,_0xe31c('0xd'));logger[_0xe31c('0xe')](_0xe31c('0xf'),_0x4bb807,'request\x20sent',JSON['stringify'](_0x2d6d28));if(_0x2d6d28['error']){if(_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x11')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4bb807,_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x12')]);return _0x284dd5(_0x2d6d28['error'][_0xe31c('0x12')]);}logger[_0xe31c('0x10')](_0xe31c('0xc'),_0x4bb807,_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x12')]);return _0x2caa83(_0x2d6d28[_0xe31c('0x10')][_0xe31c('0x12')]);}else{logger['info'](_0xe31c('0xc'),_0x4bb807,_0xe31c('0xd'));_0x2caa83(_0x2d6d28['result'][_0xe31c('0x12')]);}})[_0xe31c('0x13')](function(_0x5b5604){logger[_0xe31c('0x10')](_0xe31c('0xc'),_0x4bb807,_0x5b5604);_0x284dd5(_0x5b5604);});});}
\ No newline at end of file
index 74f4c7a..63b7a54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e95=['put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','describe','/:id','show','post','create'];(function(_0x428ba2,_0x2b75d7){var _0xe74e21=function(_0x4f409c){while(--_0x4f409c){_0x428ba2['push'](_0x428ba2['shift']());}};_0xe74e21(++_0x2b75d7);}(_0x1e95,0x11a));var _0x51e9=function(_0x9a7209,_0x1d172d){_0x9a7209=_0x9a7209-0x0;var _0x5c95af=_0x1e95[_0x9a7209];return _0x5c95af;};'use strict';var multer=require(_0x51e9('0x0'));var util=require(_0x51e9('0x1'));var path=require(_0x51e9('0x2'));var timeout=require(_0x51e9('0x3'));var express=require(_0x51e9('0x4'));var router=express[_0x51e9('0x5')]();var fs_extra=require(_0x51e9('0x6'));var auth=require(_0x51e9('0x7'));var interaction=require(_0x51e9('0x8'));var config=require(_0x51e9('0x9'));var controller=require(_0x51e9('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x51e9('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x51e9('0xc')]);router[_0x51e9('0xb')](_0x51e9('0xd'),auth['isAuthenticated'](),controller[_0x51e9('0xe')]);router[_0x51e9('0xf')]('/',auth['isAuthenticated'](),controller[_0x51e9('0x10')]);router[_0x51e9('0x11')](_0x51e9('0xd'),auth[_0x51e9('0x12')](),controller[_0x51e9('0x13')]);router[_0x51e9('0x14')](_0x51e9('0xd'),auth['isAuthenticated'](),controller[_0x51e9('0x15')]);module[_0x51e9('0x16')]=router;
\ No newline at end of file
+var _0xc4a0=['fs-extra','../../components/auth/service','./memberReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5cfadd,_0xef3204){var _0x467ec6=function(_0x3d7720){while(--_0x3d7720){_0x5cfadd['push'](_0x5cfadd['shift']());}};_0x467ec6(++_0xef3204);}(_0xc4a0,0x19d));var _0x0c4a=function(_0x589ede,_0x140064){_0x589ede=_0x589ede-0x0;var _0x5c6280=_0xc4a0[_0x589ede];return _0x5c6280;};'use strict';var multer=require(_0x0c4a('0x0'));var util=require('util');var path=require(_0x0c4a('0x1'));var timeout=require(_0x0c4a('0x2'));var express=require(_0x0c4a('0x3'));var router=express[_0x0c4a('0x4')]();var fs_extra=require(_0x0c4a('0x5'));var auth=require(_0x0c4a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0c4a('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x0c4a('0x8')]);router['get'](_0x0c4a('0x9'),auth[_0x0c4a('0xa')](),controller[_0x0c4a('0xb')]);router[_0x0c4a('0xc')](_0x0c4a('0xd'),auth[_0x0c4a('0xa')](),controller[_0x0c4a('0xe')]);router[_0x0c4a('0xf')]('/',auth[_0x0c4a('0xa')](),controller[_0x0c4a('0x10')]);router[_0x0c4a('0x11')]('/:id',auth[_0x0c4a('0xa')](),controller[_0x0c4a('0x12')]);router[_0x0c4a('0x13')](_0x0c4a('0xd'),auth[_0x0c4a('0xa')](),controller[_0x0c4a('0x14')]);module[_0x0c4a('0x15')]=router;
\ No newline at end of file
index f1b9ebc..a87ead3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c8e=['getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[destination]','talk:[dial\x20string]','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE'];(function(_0x2b387f,_0x33441c){var _0x3d4834=function(_0x1437db){while(--_0x1437db){_0x2b387f['push'](_0x2b387f['shift']());}};_0x3d4834(++_0x33441c);}(_0x2c8e,0x144));var _0xe2c8=function(_0x2c4f21,_0x4344a3){_0x2c4f21=_0x2c4f21-0x0;var _0x16bdc6=_0x2c8e[_0x2c4f21];return _0x16bdc6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xe2c8('0x0')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe2c8('0x1')]},'interface':{'type':Sequelize[_0xe2c8('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0xe2c8('0x2'),'comment':_0xe2c8('0x3')},'duration':{'type':Sequelize[_0xe2c8('0x4')]},'enterAt':{'type':Sequelize[_0xe2c8('0x5')]},'exitAt':{'type':Sequelize[_0xe2c8('0x5')],'set':function(_0x1e0f2e){var _0x16626f=moment(_0x1e0f2e);var _0x7f4719=moment(this[_0xe2c8('0x6')](_0xe2c8('0x7')));var _0x412fd7=_0x16626f[_0xe2c8('0x8')](_0x7f4719,_0xe2c8('0x9'));this[_0xe2c8('0xa')](_0xe2c8('0xb'),_0x1e0f2e);this[_0xe2c8('0xa')](_0xe2c8('0xc'),_0x412fd7>=0x0?_0x412fd7:null);}},'data1':{'type':Sequelize[_0xe2c8('0x1')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xe2c8('0x1')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xe2c8('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0xe2c8('0xe')},'data5':{'type':Sequelize[_0xe2c8('0x1')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xe2c8('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xe2c8('0x1')]}};
\ No newline at end of file
+var _0x86bd=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','STRING','DEFAULT\x20PAUSE'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0x86bd,0x172));var _0xd86b=function(_0x31e4cd,_0x2c4dbb){_0x31e4cd=_0x31e4cd-0x0;var _0x3a521d=_0x86bd[_0x31e4cd];return _0x3a521d;};'use strict';var Sequelize=require(_0xd86b('0x0'));var moment=require(_0xd86b('0x1'));module['exports']={'channel':{'type':Sequelize[_0xd86b('0x2')]},'membername':{'type':Sequelize[_0xd86b('0x2')]},'interface':{'type':Sequelize[_0xd86b('0x2')]},'type':{'type':Sequelize[_0xd86b('0x2')],'defaultValue':_0xd86b('0x3'),'comment':_0xd86b('0x4')},'duration':{'type':Sequelize[_0xd86b('0x5')]},'enterAt':{'type':Sequelize[_0xd86b('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x2c2c17){var _0x1bc528=moment(_0x2c2c17);var _0xa3d612=moment(this[_0xd86b('0x7')](_0xd86b('0x8')));var _0x1b1ea9=_0x1bc528[_0xd86b('0x9')](_0xa3d612,_0xd86b('0xa'));this[_0xd86b('0xb')](_0xd86b('0xc'),_0x2c2c17);this[_0xd86b('0xb')]('duration',_0x1b1ea9>=0x0?_0x1b1ea9:null);}},'data1':{'type':Sequelize[_0xd86b('0x2')],'comment':_0xd86b('0xd')},'data2':{'type':Sequelize[_0xd86b('0x2')],'comment':_0xd86b('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xd86b('0xf')},'data4':{'type':Sequelize[_0xd86b('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xd86b('0x2')],'comment':_0xd86b('0x10')},'role':{'type':Sequelize[_0xd86b('0x2')]},'internal':{'type':Sequelize[_0xd86b('0x5')]},'uniqueid':{'type':Sequelize[_0xd86b('0x2')]}};
\ No newline at end of file
index 84f4a6d..8d785d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x34e8,0x12c));var _0x834e=function(_0x14b12a,_0x186a49){_0x14b12a=_0x14b12a-0x0;var _0x3a7003=_0x34e8[_0x14b12a];return _0x3a7003;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
+var _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x320b67,_0x5e2e48){var _0x5667d4=function(_0x20ee6c){while(--_0x20ee6c){_0x320b67['push'](_0x320b67['shift']());}};_0x5667d4(++_0x5e2e48);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));};
\ No newline at end of file
index 8bec703..dcca725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc22d=['./memberReport.attributes','exports','MemberReport','report_member','membername_interface','interface','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x3aeae6,_0x201d94){var _0xc3594=function(_0x585f54){while(--_0x585f54){_0x3aeae6['push'](_0x3aeae6['shift']());}};_0xc3594(++_0x201d94);}(_0xc22d,0x172));var _0xdc22=function(_0x2149dd,_0x498100){_0x2149dd=_0x2149dd-0x0;var _0x248b01=_0xc22d[_0x2149dd];return _0x248b01;};'use strict';var _=require(_0xdc22('0x0'));var util=require(_0xdc22('0x1'));var logger=require(_0xdc22('0x2'))(_0xdc22('0x3'));var moment=require('moment');var BPromise=require(_0xdc22('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdc22('0x5'));var config=require(_0xdc22('0x6'));var attributes=require(_0xdc22('0x7'));module[_0xdc22('0x8')]=function(_0x4dc993,_0x556e1f){return _0x4dc993['define'](_0xdc22('0x9'),attributes,{'tableName':_0xdc22('0xa'),'paranoid':![],'indexes':[{'name':_0xdc22('0xb'),'fields':['membername',_0xdc22('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3885=['rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername_interface','membername','lodash','../../config/logger','api','bluebird','path'];(function(_0xa15bef,_0x1106f4){var _0x25f4c7=function(_0x139bdc){while(--_0x139bdc){_0xa15bef['push'](_0xa15bef['shift']());}};_0x25f4c7(++_0x1106f4);}(_0x3885,0x1c2));var _0x5388=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3885[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x5388('0x0'));var util=require('util');var logger=require(_0x5388('0x1'))(_0x5388('0x2'));var moment=require('moment');var BPromise=require(_0x5388('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5388('0x4'));var rimraf=require(_0x5388('0x5'));var config=require(_0x5388('0x6'));var attributes=require(_0x5388('0x7'));module[_0x5388('0x8')]=function(_0x5d292d,_0x396f11){return _0x5d292d[_0x5388('0x9')]('MemberReport',attributes,{'tableName':_0x5388('0xa'),'paranoid':![],'indexes':[{'name':_0x5388('0xb'),'fields':[_0x5388('0xc'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
index 171f599..371e9c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe015=['http','request','then','MemberReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetMemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','UpdateMemberReport','body','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0xe015,0x13b));var _0x5e01=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe015[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e01('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e01('0x4'));var logger=require(_0x5e01('0x5'))(_0x5e01('0x6'));var config=require(_0x5e01('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5e01('0x8')][_0x5e01('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de678,_0x48b05c,_0x414f73){return new BPromise(function(_0x3aeaef,_0x1420c2){return client[_0x5e01('0xa')](_0x4de678,_0x414f73)[_0x5e01('0xb')](function(_0x36bd7e){logger['info'](_0x5e01('0xc'),_0x48b05c,'request\x20sent');logger[_0x5e01('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x48b05c,_0x5e01('0xe'),JSON[_0x5e01('0xf')](_0x36bd7e));if(_0x36bd7e['error']){if(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x11')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x48b05c,_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);return _0x1420c2(_0x36bd7e[_0x5e01('0x10')][_0x5e01('0x12')]);}logger[_0x5e01('0x10')](_0x5e01('0xc'),_0x48b05c,_0x36bd7e['error'][_0x5e01('0x12')]);return _0x3aeaef(_0x36bd7e['error']['message']);}else{logger[_0x5e01('0x13')](_0x5e01('0xc'),_0x48b05c,'request\x20sent');_0x3aeaef(_0x36bd7e[_0x5e01('0x14')]['message']);}})[_0x5e01('0x15')](function(_0x5e4058){logger[_0x5e01('0x10')]('MemberReport,\x20%s,\x20%s',_0x48b05c,_0x5e4058);_0x1420c2(_0x5e4058);});});}exports[_0x5e01('0x16')]=function(_0x5eda1d){var _0x509c07=this;return new Promise(function(_0x35a002,_0x42b4f8){return db['MemberReport'][_0x5e01('0x17')]({'raw':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d[_0x5e01('0x18')][_0x5e01('0x19')]===undefined?!![]:![]:!![],'where':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d[_0x5e01('0x18')][_0x5e01('0x1a')]||null:null,'attributes':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d['options'][_0x5e01('0x1b')]||null:null,'limit':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d['options'][_0x5e01('0x1c')]||null:null,'include':_0x5eda1d[_0x5e01('0x18')]?_0x5eda1d[_0x5e01('0x18')][_0x5e01('0x1d')]?_[_0x5e01('0x1e')](_0x5eda1d[_0x5e01('0x18')]['include'],function(_0x329315){return{'model':db[_0x329315[_0x5e01('0x1f')]],'as':_0x329315['as'],'attributes':_0x329315[_0x5e01('0x1b')],'include':_0x329315[_0x5e01('0x1d')]?_['map'](_0x329315[_0x5e01('0x1d')],function(_0x23264f){return{'model':db[_0x23264f[_0x5e01('0x1f')]],'as':_0x23264f['as'],'attributes':_0x23264f['attributes'],'include':_0x23264f[_0x5e01('0x1d')]?_[_0x5e01('0x1e')](_0x23264f[_0x5e01('0x1d')],function(_0x28344a){return{'model':db[_0x28344a['model']],'as':_0x28344a['as'],'attributes':_0x28344a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e01('0xb')](function(_0x5f01dd){logger[_0x5e01('0x13')](_0x5e01('0x16'),_0x5eda1d);logger[_0x5e01('0xd')](_0x5e01('0x16'),_0x5eda1d,JSON['stringify'](_0x5f01dd));_0x35a002(_0x5f01dd);})['catch'](function(_0x4a4a9f){logger['error'](_0x5e01('0x16'),_0x4a4a9f['message'],_0x5eda1d);_0x42b4f8(_0x509c07[_0x5e01('0x10')](0x1f4,_0x4a4a9f[_0x5e01('0x12')]));});});};exports[_0x5e01('0x20')]=function(_0x494da9){var _0x393bf0=this;return new Promise(function(_0x36d7a8,_0x44b818){return db[_0x5e01('0x21')]['create'](_0x494da9['body'],{'raw':_0x494da9[_0x5e01('0x18')]?_0x494da9[_0x5e01('0x18')][_0x5e01('0x19')]===undefined?!![]:![]:!![]})[_0x5e01('0xb')](function(_0x350659){logger[_0x5e01('0x13')](_0x5e01('0x20'),_0x494da9);logger[_0x5e01('0xd')](_0x5e01('0x20'),_0x494da9,JSON[_0x5e01('0xf')](_0x350659));_0x36d7a8(_0x350659);})[_0x5e01('0x15')](function(_0x161b96){logger['error'](_0x5e01('0x20'),_0x161b96[_0x5e01('0x12')],_0x494da9);_0x44b818(_0x393bf0[_0x5e01('0x10')](0x1f4,_0x161b96['message']));});});};exports[_0x5e01('0x22')]=function(_0x12a1f4){var _0x5cca68=this;return new Promise(function(_0x3cc642,_0x2c38af){return db[_0x5e01('0x21')]['update'](_0x12a1f4[_0x5e01('0x23')],{'raw':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x1a')]||null:null,'attributes':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x1b')]||null:null,'limit':_0x12a1f4[_0x5e01('0x18')]?_0x12a1f4[_0x5e01('0x18')][_0x5e01('0x1c')]||null:null})[_0x5e01('0xb')](function(_0x260901){logger['info'](_0x5e01('0x22'),_0x12a1f4);logger['debug']('UpdateMemberReport',_0x12a1f4,JSON[_0x5e01('0xf')](_0x260901));_0x3cc642(_0x260901);})[_0x5e01('0x15')](function(_0x120b7b){logger[_0x5e01('0x10')](_0x5e01('0x22'),_0x120b7b['message'],_0x12a1f4);_0x2c38af(_0x5cca68[_0x5e01('0x10')](0x1f4,_0x120b7b[_0x5e01('0x12')]));});});};
\ No newline at end of file
+var _0x869e=['debug','create','CreateMemberReport','UpdateMemberReport','MemberReport','body','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetMemberReport'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x869e,0x15c));var _0xe869=function(_0x364a86,_0x39eab3){_0x364a86=_0x364a86-0x0;var _0x1605ca=_0x869e[_0x364a86];return _0x1605ca;};'use strict';var _=require(_0xe869('0x0'));var util=require(_0xe869('0x1'));var moment=require(_0xe869('0x2'));var BPromise=require('bluebird');var rs=require(_0xe869('0x3'));var fs=require('fs');var Redis=require(_0xe869('0x4'));var db=require(_0xe869('0x5'))['db'];var utils=require(_0xe869('0x6'));var logger=require(_0xe869('0x7'))('rpc');var config=require(_0xe869('0x8'));var jayson=require(_0xe869('0x9'));var client=jayson[_0xe869('0xa')][_0xe869('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x587ead,_0x4e201a,_0xb3936){return new BPromise(function(_0x296feb,_0x2fcf82){return client[_0xe869('0xc')](_0x587ead,_0xb3936)[_0xe869('0xd')](function(_0x3a0162){logger[_0xe869('0xe')](_0xe869('0xf'),_0x4e201a,'request\x20sent');logger['debug'](_0xe869('0x10'),_0x4e201a,_0xe869('0x11'),JSON[_0xe869('0x12')](_0x3a0162));if(_0x3a0162[_0xe869('0x13')]){if(_0x3a0162['error']['code']===0x1f4){logger[_0xe869('0x13')]('MemberReport,\x20%s,\x20%s',_0x4e201a,_0x3a0162[_0xe869('0x13')][_0xe869('0x14')]);return _0x2fcf82(_0x3a0162['error'][_0xe869('0x14')]);}logger[_0xe869('0x13')](_0xe869('0xf'),_0x4e201a,_0x3a0162[_0xe869('0x13')][_0xe869('0x14')]);return _0x296feb(_0x3a0162['error']['message']);}else{logger['info'](_0xe869('0xf'),_0x4e201a,'request\x20sent');_0x296feb(_0x3a0162[_0xe869('0x15')][_0xe869('0x14')]);}})[_0xe869('0x16')](function(_0x51c4c1){logger[_0xe869('0x13')](_0xe869('0xf'),_0x4e201a,_0x51c4c1);_0x2fcf82(_0x51c4c1);});});}exports['GetMemberReport']=function(_0x33f5a7){var _0x4fa1f2=this;return new Promise(function(_0x26c67c,_0x2c61d1){return db['MemberReport']['findAll']({'raw':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7['options'][_0xe869('0x18')]===undefined?!![]:![]:!![],'where':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7[_0xe869('0x17')][_0xe869('0x19')]||null:null,'attributes':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7[_0xe869('0x17')][_0xe869('0x1a')]||null:null,'limit':_0x33f5a7[_0xe869('0x17')]?_0x33f5a7[_0xe869('0x17')][_0xe869('0x1b')]||null:null,'include':_0x33f5a7['options']?_0x33f5a7[_0xe869('0x17')][_0xe869('0x1c')]?_[_0xe869('0x1d')](_0x33f5a7[_0xe869('0x17')][_0xe869('0x1c')],function(_0x4ddc31){return{'model':db[_0x4ddc31[_0xe869('0x1e')]],'as':_0x4ddc31['as'],'attributes':_0x4ddc31[_0xe869('0x1a')],'include':_0x4ddc31[_0xe869('0x1c')]?_[_0xe869('0x1d')](_0x4ddc31[_0xe869('0x1c')],function(_0x42320b){return{'model':db[_0x42320b[_0xe869('0x1e')]],'as':_0x42320b['as'],'attributes':_0x42320b[_0xe869('0x1a')],'include':_0x42320b[_0xe869('0x1c')]?_[_0xe869('0x1d')](_0x42320b[_0xe869('0x1c')],function(_0x31fec7){return{'model':db[_0x31fec7[_0xe869('0x1e')]],'as':_0x31fec7['as'],'attributes':_0x31fec7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe869('0xd')](function(_0x2be430){logger[_0xe869('0xe')](_0xe869('0x1f'),_0x33f5a7);logger[_0xe869('0x20')](_0xe869('0x1f'),_0x33f5a7,JSON['stringify'](_0x2be430));_0x26c67c(_0x2be430);})[_0xe869('0x16')](function(_0x3f3574){logger['error']('GetMemberReport',_0x3f3574[_0xe869('0x14')],_0x33f5a7);_0x2c61d1(_0x4fa1f2['error'](0x1f4,_0x3f3574[_0xe869('0x14')]));});});};exports['CreateMemberReport']=function(_0x538717){var _0xfdfacd=this;return new Promise(function(_0x42df51,_0x239a56){return db['MemberReport'][_0xe869('0x21')](_0x538717['body'],{'raw':_0x538717[_0xe869('0x17')]?_0x538717[_0xe869('0x17')][_0xe869('0x18')]===undefined?!![]:![]:!![]})[_0xe869('0xd')](function(_0x17a0fa){logger[_0xe869('0xe')](_0xe869('0x22'),_0x538717);logger['debug'](_0xe869('0x22'),_0x538717,JSON[_0xe869('0x12')](_0x17a0fa));_0x42df51(_0x17a0fa);})[_0xe869('0x16')](function(_0x5da05a){logger['error'](_0xe869('0x22'),_0x5da05a['message'],_0x538717);_0x239a56(_0xfdfacd['error'](0x1f4,_0x5da05a[_0xe869('0x14')]));});});};exports[_0xe869('0x23')]=function(_0x4db04b){var _0xd2763f=this;return new Promise(function(_0x453e5f,_0x168703){return db[_0xe869('0x24')]['update'](_0x4db04b[_0xe869('0x25')],{'raw':_0x4db04b[_0xe869('0x17')]?_0x4db04b[_0xe869('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4db04b[_0xe869('0x17')]?_0x4db04b[_0xe869('0x17')]['where']||null:null,'attributes':_0x4db04b[_0xe869('0x17')]?_0x4db04b[_0xe869('0x17')]['attributes']||null:null,'limit':_0x4db04b[_0xe869('0x17')]?_0x4db04b['options'][_0xe869('0x1b')]||null:null})[_0xe869('0xd')](function(_0x4ff975){logger[_0xe869('0xe')](_0xe869('0x23'),_0x4db04b);logger[_0xe869('0x20')](_0xe869('0x23'),_0x4db04b,JSON[_0xe869('0x12')](_0x4ff975));_0x453e5f(_0x4ff975);})['catch'](function(_0x3e3f5f){logger[_0xe869('0x13')](_0xe869('0x23'),_0x3e3f5f['message'],_0x4db04b);_0x168703(_0xd2763f[_0xe869('0x13')](0x1f4,_0x3e3f5f[_0xe869('0x14')]));});});};
\ No newline at end of file
index 6752521..a72b82c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a96=['../../config/environment','./migration.controller','get','index','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a1365,_0x2b383a){var _0xc7d258=function(_0x285bd1){while(--_0x285bd1){_0x5a1365['push'](_0x5a1365['shift']());}};_0xc7d258(++_0x2b383a);}(_0x2a96,0xb8));var _0x62a9=function(_0x1595ff,_0x238718){_0x1595ff=_0x1595ff-0x0;var _0x571b9d=_0x2a96[_0x1595ff];return _0x571b9d;};'use strict';var multer=require(_0x62a9('0x0'));var util=require(_0x62a9('0x1'));var path=require(_0x62a9('0x2'));var timeout=require(_0x62a9('0x3'));var express=require(_0x62a9('0x4'));var router=express['Router']();var fs_extra=require(_0x62a9('0x5'));var auth=require(_0x62a9('0x6'));var interaction=require(_0x62a9('0x7'));var config=require(_0x62a9('0x8'));var controller=require(_0x62a9('0x9'));router[_0x62a9('0xa')]('/',controller[_0x62a9('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x8994=['exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x1ab8c7,_0x28db6d){var _0x1b951f=function(_0x6c0e7a){while(--_0x6c0e7a){_0x1ab8c7['push'](_0x1ab8c7['shift']());}};_0x1b951f(++_0x28db6d);}(_0x8994,0x121));var _0x4899=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8994[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x4899('0x0'));var util=require(_0x4899('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4899('0x2'));var router=express[_0x4899('0x3')]();var fs_extra=require(_0x4899('0x4'));var auth=require(_0x4899('0x5'));var interaction=require(_0x4899('0x6'));var config=require(_0x4899('0x7'));var controller=require(_0x4899('0x8'));router[_0x4899('0x9')]('/',controller[_0x4899('0xa')]);module[_0x4899('0xb')]=router;
\ No newline at end of file
index 92528a7..4150244 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe306=['version','sequelize','exports','STRING'];(function(_0x416237,_0x3c6f82){var _0x5991e1=function(_0x2b766b){while(--_0x2b766b){_0x416237['push'](_0x416237['shift']());}};_0x5991e1(++_0x3c6f82);}(_0xe306,0xa9));var _0x6e30=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xe306[_0x1d6a82];return _0x5834ac;};'use strict';var Sequelize=require(_0x6e30('0x0'));module[_0x6e30('0x1')]={'version':{'type':Sequelize[_0x6e30('0x2')],'unique':_0x6e30('0x3')}};
\ No newline at end of file
+var _0x53eb=['version'];(function(_0x441305,_0x2e1483){var _0x581096=function(_0x40c78a){while(--_0x40c78a){_0x441305['push'](_0x441305['shift']());}};_0x581096(++_0x2e1483);}(_0x53eb,0x1ce));var _0xb53e=function(_0x29a24a,_0x258090){_0x29a24a=_0x29a24a-0x0;var _0x16c8f6=_0x53eb[_0x29a24a];return _0x16c8f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xb53e('0x0')}};
\ No newline at end of file
index 3fdc31a..3604900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x593f=['options','includeAll','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','index','map','Migration','type','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x3efe87,_0x35ad48){var _0x56a4cc=function(_0x47869e){while(--_0x47869e){_0x3efe87['push'](_0x3efe87['shift']());}};_0x56a4cc(++_0x35ad48);}(_0x593f,0x1e1));var _0xf593=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x593f[_0x44216d];return _0xeca523;};'use strict';var emlformat=require(_0xf593('0x0'));var rimraf=require(_0xf593('0x1'));var zipdir=require(_0xf593('0x2'));var jsonpatch=require(_0xf593('0x3'));var rp=require(_0xf593('0x4'));var moment=require('moment');var BPromise=require(_0xf593('0x5'));var Mustache=require(_0xf593('0x6'));var util=require(_0xf593('0x7'));var path=require('path');var sox=require(_0xf593('0x8'));var csv=require(_0xf593('0x9'));var ejs=require(_0xf593('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf593('0xb'));var squel=require(_0xf593('0xc'));var crypto=require('crypto');var jsforce=require(_0xf593('0xd'));var deskjs=require(_0xf593('0xe'));var toCsv=require(_0xf593('0x9'));var querystring=require(_0xf593('0xf'));var Papa=require(_0xf593('0x10'));var Redis=require(_0xf593('0x11'));var authService=require(_0xf593('0x12'));var qs=require(_0xf593('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf593('0x14'));var logger=require('../../config/logger')(_0xf593('0x15'));var utils=require('../../config/utils');var config=require(_0xf593('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf593('0x17'))['db'];function respondWithStatusCode(_0xc852a6,_0x1c70eb){_0x1c70eb=_0x1c70eb||0xcc;return function(_0x5e15ee){if(_0x5e15ee){return _0xc852a6[_0xf593('0x18')](_0x1c70eb);}return _0xc852a6[_0xf593('0x19')](_0x1c70eb)['end']();};}function respondWithResult(_0x984580,_0x4ae654){_0x4ae654=_0x4ae654||0xc8;return function(_0x5276d6){if(_0x5276d6){return _0x984580[_0xf593('0x19')](_0x4ae654)[_0xf593('0x1a')](_0x5276d6);}};}function respondWithFilteredResult(_0x34070,_0x46f8aa){return function(_0x44462b){if(_0x44462b){var _0x444769=typeof _0x46f8aa[_0xf593('0x1b')]===_0xf593('0x1c')&&typeof _0x46f8aa[_0xf593('0x1d')]===_0xf593('0x1c');var _0x5a2fb7=_0x44462b[_0xf593('0x1e')];var _0x49c0ea=_0x444769?0x0:_0x46f8aa[_0xf593('0x1b')];var _0x1444f9=_0x444769?_0x44462b[_0xf593('0x1e')]:_0x46f8aa[_0xf593('0x1b')]+_0x46f8aa[_0xf593('0x1d')];var _0x5ee60d;if(_0x1444f9>=_0x5a2fb7){_0x1444f9=_0x5a2fb7;_0x5ee60d=0xc8;}else{_0x5ee60d=0xce;}_0x34070[_0xf593('0x19')](_0x5ee60d);return _0x34070[_0xf593('0x1f')](_0xf593('0x20'),_0x49c0ea+'-'+_0x1444f9+'/'+_0x5a2fb7)['json'](_0x44462b);}return null;};}function patchUpdates(_0x1b274d){return function(_0x1866b3){try{jsonpatch['apply'](_0x1866b3,_0x1b274d,!![]);}catch(_0xb05e59){return BPromise[_0xf593('0x21')](_0xb05e59);}return _0x1866b3[_0xf593('0x22')]();};}function saveUpdates(_0x3551da,_0x373243){return function(_0x392b6d){if(_0x392b6d){return _0x392b6d['update'](_0x3551da)[_0xf593('0x23')](function(_0xb4bae4){return _0xb4bae4;});}return null;};}function removeEntity(_0x32ee41,_0x48a1f6){return function(_0x345820){if(_0x345820){return _0x345820[_0xf593('0x24')]()['then'](function(){_0x32ee41[_0xf593('0x19')](0xcc)[_0xf593('0x25')]();});}};}function handleEntityNotFound(_0x1883d0,_0x173dd9){return function(_0x27d716){if(!_0x27d716){_0x1883d0[_0xf593('0x18')](0x194);}return _0x27d716;};}function handleError(_0x4dd039,_0x424654){_0x424654=_0x424654||0x1f4;return function(_0x2c0909){logger[_0xf593('0x26')](_0x2c0909[_0xf593('0x27')]);if(_0x2c0909[_0xf593('0x28')]){delete _0x2c0909['name'];}_0x4dd039[_0xf593('0x19')](_0x424654)[_0xf593('0x29')](_0x2c0909);};}exports[_0xf593('0x2a')]=function(_0x4497c6,_0x38a3f1){var _0x39f7fa={},_0x49a5cd={},_0x1ad4eb={'count':0x0,'rows':[]};var _0x518d3d=_[_0xf593('0x2b')](db[_0xf593('0x2c')]['rawAttributes'],function(_0x1a3902){return{'name':_0x1a3902['fieldName'],'type':_0x1a3902[_0xf593('0x2d')][_0xf593('0x2e')]};});_0x49a5cd[_0xf593('0x2f')]=_[_0xf593('0x2b')](_0x518d3d,_0xf593('0x28'));_0x49a5cd[_0xf593('0x30')]=_['keys'](_0x4497c6[_0xf593('0x30')]);_0x49a5cd[_0xf593('0x31')]=_[_0xf593('0x32')](_0x49a5cd[_0xf593('0x2f')],_0x49a5cd[_0xf593('0x30')]);_0x39f7fa['attributes']=_['intersection'](_0x49a5cd['model'],qs[_0xf593('0x33')](_0x4497c6[_0xf593('0x30')][_0xf593('0x33')]));_0x39f7fa['attributes']=_0x39f7fa['attributes'][_0xf593('0x34')]?_0x39f7fa[_0xf593('0x35')]:_0x49a5cd['model'];if(!_0x4497c6[_0xf593('0x30')][_0xf593('0x36')](_0xf593('0x37'))){_0x39f7fa[_0xf593('0x1d')]=qs['limit'](_0x4497c6[_0xf593('0x30')]['limit']);_0x39f7fa[_0xf593('0x1b')]=qs[_0xf593('0x1b')](_0x4497c6['query'][_0xf593('0x1b')]);}_0x39f7fa[_0xf593('0x38')]=qs[_0xf593('0x39')](_0x4497c6['query'][_0xf593('0x39')]);_0x39f7fa[_0xf593('0x3a')]=qs[_0xf593('0x31')](_[_0xf593('0x3b')](_0x4497c6[_0xf593('0x30')],_0x49a5cd[_0xf593('0x31')]),_0x518d3d);if(_0x4497c6[_0xf593('0x30')][_0xf593('0x3c')]){_0x39f7fa[_0xf593('0x3a')]=_[_0xf593('0x3d')](_0x39f7fa[_0xf593('0x3a')],{'$or':_[_0xf593('0x2b')](_0x518d3d,function(_0x1aa29a){if(_0x1aa29a[_0xf593('0x2d')]!==_0xf593('0x3e')){var _0x164c3f={};_0x164c3f[_0x1aa29a[_0xf593('0x28')]]={'$like':'%'+_0x4497c6[_0xf593('0x30')][_0xf593('0x3c')]+'%'};return _0x164c3f;}})});}_0x39f7fa=_[_0xf593('0x3d')]({},_0x39f7fa,_0x4497c6[_0xf593('0x3f')]);var _0x35d365={'where':_0x39f7fa[_0xf593('0x3a')]};return db[_0xf593('0x2c')][_0xf593('0x1e')](_0x35d365)[_0xf593('0x23')](function(_0x2817dd){_0x1ad4eb['count']=_0x2817dd;if(_0x4497c6[_0xf593('0x30')][_0xf593('0x40')]){_0x39f7fa[_0xf593('0x41')]=[{'all':!![]}];}return db[_0xf593('0x2c')][_0xf593('0x42')](_0x39f7fa);})[_0xf593('0x23')](function(_0x584dd7){_0x1ad4eb['rows']=_0x584dd7;return _0x1ad4eb;})[_0xf593('0x23')](respondWithFilteredResult(_0x38a3f1,_0x39f7fa))[_0xf593('0x43')](handleError(_0x38a3f1,null));};
\ No newline at end of file
+var _0xac81=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4b087d,_0xb57eb0){var _0x122d6d=function(_0x1d4b3c){while(--_0x1d4b3c){_0x4b087d['push'](_0x4b087d['shift']());}};_0x122d6d(++_0xb57eb0);}(_0xac81,0x1c8));var _0x1ac8=function(_0x107aa2,_0x75b949){_0x107aa2=_0x107aa2-0x0;var _0x33d933=_0xac81[_0x107aa2];return _0x33d933;};'use strict';var emlformat=require(_0x1ac8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ac8('0x1'));var rp=require(_0x1ac8('0x2'));var moment=require('moment');var BPromise=require(_0x1ac8('0x3'));var Mustache=require(_0x1ac8('0x4'));var util=require(_0x1ac8('0x5'));var path=require(_0x1ac8('0x6'));var sox=require(_0x1ac8('0x7'));var csv=require(_0x1ac8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ac8('0x9'));var _=require(_0x1ac8('0xa'));var squel=require(_0x1ac8('0xb'));var crypto=require(_0x1ac8('0xc'));var jsforce=require(_0x1ac8('0xd'));var deskjs=require(_0x1ac8('0xe'));var toCsv=require(_0x1ac8('0x8'));var querystring=require(_0x1ac8('0xf'));var Papa=require(_0x1ac8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1ac8('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ac8('0x12'));var logger=require(_0x1ac8('0x13'))('api');var utils=require(_0x1ac8('0x14'));var config=require(_0x1ac8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ac8('0x16'))['db'];function respondWithStatusCode(_0x55ea22,_0x5923c5){_0x5923c5=_0x5923c5||0xcc;return function(_0x57a30a){if(_0x57a30a){return _0x55ea22[_0x1ac8('0x17')](_0x5923c5);}return _0x55ea22[_0x1ac8('0x18')](_0x5923c5)[_0x1ac8('0x19')]();};}function respondWithResult(_0x5ece70,_0x5d28dd){_0x5d28dd=_0x5d28dd||0xc8;return function(_0x5149e3){if(_0x5149e3){return _0x5ece70[_0x1ac8('0x18')](_0x5d28dd)[_0x1ac8('0x1a')](_0x5149e3);}};}function respondWithFilteredResult(_0x2d69c6,_0x1db691){return function(_0x4714f4){if(_0x4714f4){var _0x512e0f=typeof _0x1db691[_0x1ac8('0x1b')]==='undefined'&&typeof _0x1db691[_0x1ac8('0x1c')]===_0x1ac8('0x1d');var _0x25d1a8=_0x4714f4['count'];var _0x455747=_0x512e0f?0x0:_0x1db691[_0x1ac8('0x1b')];var _0x31e35f=_0x512e0f?_0x4714f4[_0x1ac8('0x1e')]:_0x1db691[_0x1ac8('0x1b')]+_0x1db691[_0x1ac8('0x1c')];var _0x55e89a;if(_0x31e35f>=_0x25d1a8){_0x31e35f=_0x25d1a8;_0x55e89a=0xc8;}else{_0x55e89a=0xce;}_0x2d69c6[_0x1ac8('0x18')](_0x55e89a);return _0x2d69c6[_0x1ac8('0x1f')](_0x1ac8('0x20'),_0x455747+'-'+_0x31e35f+'/'+_0x25d1a8)[_0x1ac8('0x1a')](_0x4714f4);}return null;};}function patchUpdates(_0xd9405){return function(_0x1ee896){try{jsonpatch[_0x1ac8('0x21')](_0x1ee896,_0xd9405,!![]);}catch(_0xb278df){return BPromise[_0x1ac8('0x22')](_0xb278df);}return _0x1ee896['save']();};}function saveUpdates(_0x3eee25,_0x3f5ac2){return function(_0xec9d29){if(_0xec9d29){return _0xec9d29[_0x1ac8('0x23')](_0x3eee25)[_0x1ac8('0x24')](function(_0x3b8c44){return _0x3b8c44;});}return null;};}function removeEntity(_0x4da88e,_0x3fcb15){return function(_0x575f8f){if(_0x575f8f){return _0x575f8f[_0x1ac8('0x25')]()[_0x1ac8('0x24')](function(){_0x4da88e['status'](0xcc)[_0x1ac8('0x19')]();});}};}function handleEntityNotFound(_0x4bee5b,_0x4ac3fa){return function(_0x50464d){if(!_0x50464d){_0x4bee5b[_0x1ac8('0x17')](0x194);}return _0x50464d;};}function handleError(_0xa8bf3f,_0x5343fb){_0x5343fb=_0x5343fb||0x1f4;return function(_0x55f38e){logger[_0x1ac8('0x26')](_0x55f38e[_0x1ac8('0x27')]);if(_0x55f38e[_0x1ac8('0x28')]){delete _0x55f38e[_0x1ac8('0x28')];}_0xa8bf3f[_0x1ac8('0x18')](_0x5343fb)['send'](_0x55f38e);};}exports[_0x1ac8('0x29')]=function(_0x34c974,_0x24932f){var _0x4ac5ee={},_0x33ed76={},_0x279c32={'count':0x0,'rows':[]};var _0x229908=_[_0x1ac8('0x2a')](db[_0x1ac8('0x2b')][_0x1ac8('0x2c')],function(_0x5d736e){return{'name':_0x5d736e[_0x1ac8('0x2d')],'type':_0x5d736e[_0x1ac8('0x2e')][_0x1ac8('0x2f')]};});_0x33ed76['model']=_[_0x1ac8('0x2a')](_0x229908,_0x1ac8('0x28'));_0x33ed76[_0x1ac8('0x30')]=_[_0x1ac8('0x31')](_0x34c974[_0x1ac8('0x30')]);_0x33ed76[_0x1ac8('0x32')]=_['intersection'](_0x33ed76[_0x1ac8('0x33')],_0x33ed76[_0x1ac8('0x30')]);_0x4ac5ee['attributes']=_['intersection'](_0x33ed76[_0x1ac8('0x33')],qs[_0x1ac8('0x34')](_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x34')]));_0x4ac5ee[_0x1ac8('0x35')]=_0x4ac5ee['attributes'][_0x1ac8('0x36')]?_0x4ac5ee[_0x1ac8('0x35')]:_0x33ed76[_0x1ac8('0x33')];if(!_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x37')](_0x1ac8('0x38'))){_0x4ac5ee[_0x1ac8('0x1c')]=qs[_0x1ac8('0x1c')](_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x1c')]);_0x4ac5ee[_0x1ac8('0x1b')]=qs[_0x1ac8('0x1b')](_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x1b')]);}_0x4ac5ee[_0x1ac8('0x39')]=qs[_0x1ac8('0x3a')](_0x34c974['query'][_0x1ac8('0x3a')]);_0x4ac5ee[_0x1ac8('0x3b')]=qs[_0x1ac8('0x32')](_[_0x1ac8('0x3c')](_0x34c974['query'],_0x33ed76[_0x1ac8('0x32')]),_0x229908);if(_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x3d')]){_0x4ac5ee[_0x1ac8('0x3b')]=_[_0x1ac8('0x3e')](_0x4ac5ee[_0x1ac8('0x3b')],{'$or':_['map'](_0x229908,function(_0x2242b9){if(_0x2242b9[_0x1ac8('0x2e')]!=='VIRTUAL'){var _0x5dfcd3={};_0x5dfcd3[_0x2242b9[_0x1ac8('0x28')]]={'$like':'%'+_0x34c974[_0x1ac8('0x30')][_0x1ac8('0x3d')]+'%'};return _0x5dfcd3;}})});}_0x4ac5ee=_['merge']({},_0x4ac5ee,_0x34c974[_0x1ac8('0x3f')]);var _0x370594={'where':_0x4ac5ee['where']};return db[_0x1ac8('0x2b')][_0x1ac8('0x1e')](_0x370594)[_0x1ac8('0x24')](function(_0x4f0ace){_0x279c32[_0x1ac8('0x1e')]=_0x4f0ace;if(_0x34c974[_0x1ac8('0x30')]['includeAll']){_0x4ac5ee[_0x1ac8('0x40')]=[{'all':!![]}];}return db[_0x1ac8('0x2b')][_0x1ac8('0x41')](_0x4ac5ee);})['then'](function(_0x2cf6b1){_0x279c32[_0x1ac8('0x42')]=_0x2cf6b1;return _0x279c32;})[_0x1ac8('0x24')](respondWithFilteredResult(_0x24932f,_0x4ac5ee))[_0x1ac8('0x43')](handleError(_0x24932f,null));};
\ No newline at end of file
index b1134d2..7426386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42bc=['bluebird','rimraf','../../config/environment','./migration.attributes','migrations','lodash','../../config/logger','api','moment'];(function(_0x383def,_0x3ae0f0){var _0x54979e=function(_0x2746d7){while(--_0x2746d7){_0x383def['push'](_0x383def['shift']());}};_0x54979e(++_0x3ae0f0);}(_0x42bc,0x10a));var _0xc42b=function(_0x2dd628,_0x3c22e4){_0x2dd628=_0x2dd628-0x0;var _0x2e138c=_0x42bc[_0x2dd628];return _0x2e138c;};'use strict';var _=require(_0xc42b('0x0'));var util=require('util');var logger=require(_0xc42b('0x1'))(_0xc42b('0x2'));var moment=require(_0xc42b('0x3'));var BPromise=require(_0xc42b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc42b('0x5'));var config=require(_0xc42b('0x6'));var attributes=require(_0xc42b('0x7'));module['exports']=function(_0x11d153,_0x335707){return _0x11d153['define']('Migration',attributes,{'tableName':_0xc42b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9719=['path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','util','../../config/logger','api','request-promise'];(function(_0x149a9b,_0x5bb275){var _0x2c2bf6=function(_0xfe0c14){while(--_0xfe0c14){_0x149a9b['push'](_0x149a9b['shift']());}};_0x2c2bf6(++_0x5bb275);}(_0x9719,0xec));var _0x9971=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9719[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x9971('0x0'));var logger=require(_0x9971('0x1'))(_0x9971('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9971('0x3'));var fs=require('fs');var path=require(_0x9971('0x4'));var rimraf=require(_0x9971('0x5'));var config=require(_0x9971('0x6'));var attributes=require(_0x9971('0x7'));module[_0x9971('0x8')]=function(_0x7cf920,_0x35fe55){return _0x7cf920[_0x9971('0x9')](_0x9971('0xa'),attributes,{'tableName':_0x9971('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 07660b7..e6b2782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3189=['../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x52c536,_0x26689a){var _0x17e2e9=function(_0x449100){while(--_0x449100){_0x52c536['push'](_0x52c536['shift']());}};_0x17e2e9(++_0x26689a);}(_0x3189,0xae));var _0x9318=function(_0x450eab,_0x4e6ae4){_0x450eab=_0x450eab-0x0;var _0x4859b8=_0x3189[_0x450eab];return _0x4859b8;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var moment=require('moment');var BPromise=require(_0x9318('0x2'));var rs=require(_0x9318('0x3'));var fs=require('fs');var Redis=require(_0x9318('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9318('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9318('0x6'));var jayson=require(_0x9318('0x7'));var client=jayson['client'][_0x9318('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bb3c3,_0x4dbe95,_0x2f6831){return new BPromise(function(_0x324307,_0x1bfed6){return client['request'](_0x4bb3c3,_0x2f6831)[_0x9318('0x9')](function(_0x2e8d1c){logger[_0x9318('0xa')](_0x9318('0xb'),_0x4dbe95,'request\x20sent');logger['debug'](_0x9318('0xc'),_0x4dbe95,'request\x20sent',JSON[_0x9318('0xd')](_0x2e8d1c));if(_0x2e8d1c[_0x9318('0xe')]){if(_0x2e8d1c[_0x9318('0xe')]['code']===0x1f4){logger[_0x9318('0xe')]('Migration,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c['error'][_0x9318('0xf')]);return _0x1bfed6(_0x2e8d1c['error'][_0x9318('0xf')]);}logger[_0x9318('0xe')]('Migration,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c[_0x9318('0xe')][_0x9318('0xf')]);return _0x324307(_0x2e8d1c[_0x9318('0xe')]['message']);}else{logger['info'](_0x9318('0xb'),_0x4dbe95,_0x9318('0x10'));_0x324307(_0x2e8d1c['result'][_0x9318('0xf')]);}})[_0x9318('0x11')](function(_0x5e1238){logger[_0x9318('0xe')](_0x9318('0xb'),_0x4dbe95,_0x5e1238);_0x1bfed6(_0x5e1238);});});}
\ No newline at end of file
+var _0x0c5d=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x5a593b,_0x280c1e){_0x5a593b=_0x5a593b-0x0;var _0x200973=_0x0c5d[_0x5a593b];return _0x200973;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var moment=require('moment');var BPromise=require(_0xd0c5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0c5('0x3'));var db=require(_0xd0c5('0x4'))['db'];var utils=require(_0xd0c5('0x5'));var logger=require(_0xd0c5('0x6'))(_0xd0c5('0x7'));var config=require(_0xd0c5('0x8'));var jayson=require(_0xd0c5('0x9'));var client=jayson[_0xd0c5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ef2f6,_0x518801,_0x47f0f4){return new BPromise(function(_0x365e04,_0x4be307){return client['request'](_0x2ef2f6,_0x47f0f4)[_0xd0c5('0xb')](function(_0x227cb7){logger['info'](_0xd0c5('0xc'),_0x518801,_0xd0c5('0xd'));logger['debug'](_0xd0c5('0xe'),_0x518801,_0xd0c5('0xd'),JSON[_0xd0c5('0xf')](_0x227cb7));if(_0x227cb7[_0xd0c5('0x10')]){if(_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x11')]===0x1f4){logger[_0xd0c5('0x10')](_0xd0c5('0xc'),_0x518801,_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x12')]);return _0x4be307(_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x12')]);}logger['error'](_0xd0c5('0xc'),_0x518801,_0x227cb7[_0xd0c5('0x10')][_0xd0c5('0x12')]);return _0x365e04(_0x227cb7[_0xd0c5('0x10')]['message']);}else{logger[_0xd0c5('0x13')](_0xd0c5('0xc'),_0x518801,_0xd0c5('0xd'));_0x365e04(_0x227cb7[_0xd0c5('0x14')]['message']);}})[_0xd0c5('0x15')](function(_0x5809ba){logger[_0xd0c5('0x10')]('Migration,\x20%s,\x20%s',_0x518801,_0x5809ba);_0x4be307(_0x5809ba);});});}
\ No newline at end of file
index b436d99..4de4e15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe797=['./network.controller','get','isAuthenticated','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe6ba3b,_0x58e953){var _0x19adbe=function(_0x3ec442){while(--_0x3ec442){_0xe6ba3b['push'](_0xe6ba3b['shift']());}};_0x19adbe(++_0x58e953);}(_0xe797,0x12a));var _0x7e79=function(_0x345736,_0x3817c2){_0x345736=_0x345736-0x0;var _0x36ca70=_0xe797[_0x345736];return _0x36ca70;};'use strict';var multer=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var path=require(_0x7e79('0x2'));var timeout=require(_0x7e79('0x3'));var express=require(_0x7e79('0x4'));var router=express[_0x7e79('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7e79('0x6'));var interaction=require(_0x7e79('0x7'));var config=require('../../config/environment');var controller=require(_0x7e79('0x8'));router[_0x7e79('0x9')]('/',auth[_0x7e79('0xa')](),controller['index']);router['get'](_0x7e79('0xb'),auth[_0x7e79('0xa')](),controller['show']);router['post']('/',auth[_0x7e79('0xa')](),controller[_0x7e79('0xc')]);router[_0x7e79('0xd')]('/:id',auth[_0x7e79('0xa')](),controller[_0x7e79('0xe')]);router[_0x7e79('0xf')](_0x7e79('0xb'),auth[_0x7e79('0xa')](),controller[_0x7e79('0x10')]);module[_0x7e79('0x11')]=router;
\ No newline at end of file
+var _0x2340=['./network.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x34b3f5,_0x573f9f){var _0x39146b=function(_0x339f7c){while(--_0x339f7c){_0x34b3f5['push'](_0x34b3f5['shift']());}};_0x39146b(++_0x573f9f);}(_0x2340,0x1e6));var _0x0234=function(_0x8eadaa,_0x37c691){_0x8eadaa=_0x8eadaa-0x0;var _0x18b161=_0x2340[_0x8eadaa];return _0x18b161;};'use strict';var multer=require(_0x0234('0x0'));var util=require(_0x0234('0x1'));var path=require(_0x0234('0x2'));var timeout=require(_0x0234('0x3'));var express=require('express');var router=express[_0x0234('0x4')]();var fs_extra=require(_0x0234('0x5'));var auth=require(_0x0234('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0234('0x7'));var controller=require(_0x0234('0x8'));router[_0x0234('0x9')]('/',auth[_0x0234('0xa')](),controller[_0x0234('0xb')]);router[_0x0234('0x9')](_0x0234('0xc'),auth[_0x0234('0xa')](),controller[_0x0234('0xd')]);router[_0x0234('0xe')]('/',auth[_0x0234('0xa')](),controller['create']);router['put']('/:id',auth[_0x0234('0xa')](),controller[_0x0234('0xf')]);router[_0x0234('0x10')](_0x0234('0xc'),auth[_0x0234('0xa')](),controller[_0x0234('0x11')]);module[_0x0234('0x12')]=router;
\ No newline at end of file
index 25c0df2..509828d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cc5=['externip','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x0cc5,0xd5));var _0x50cc=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x0cc5[_0xf91841];return _0x4b9c44;};'use strict';var Sequelize=require(_0x50cc('0x0'));module[_0x50cc('0x1')]={'type':{'type':Sequelize[_0x50cc('0x2')](_0x50cc('0x3'),_0x50cc('0x4'),'stun',_0x50cc('0x5'))},'value':{'type':Sequelize[_0x50cc('0x6')]},'username':{'type':Sequelize[_0x50cc('0x6')]},'password':{'type':Sequelize[_0x50cc('0x6')]}};
\ No newline at end of file
+var _0x5a83=['ENUM','localnet','externip','stun','STRING','sequelize'];(function(_0x2740ea,_0x319d1d){var _0x124b89=function(_0x535774){while(--_0x535774){_0x2740ea['push'](_0x2740ea['shift']());}};_0x124b89(++_0x319d1d);}(_0x5a83,0xb3));var _0x35a8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5a83[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x35a8('0x0'));module['exports']={'type':{'type':Sequelize[_0x35a8('0x1')](_0x35a8('0x2'),_0x35a8('0x3'),_0x35a8('0x4'),'turn')},'value':{'type':Sequelize[_0x35a8('0x5')]},'username':{'type':Sequelize[_0x35a8('0x5')]},'password':{'type':Sequelize[_0x35a8('0x5')]}};
\ No newline at end of file
index dac07e9..3634a10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe825=['undefined','limit','count','set','update','then','destroy','end','sendStatus','name','index','map','Network','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','includeAll','include','findAll','show','params','options','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','TURN','util','path','ejs','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','info','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Network,\x20%s,\x20%s','message','catch','status','json','offset'];(function(_0x57b804,_0x2eb3b1){var _0x8b6d8=function(_0x1bca0a){while(--_0x1bca0a){_0x57b804['push'](_0x57b804['shift']());}};_0x8b6d8(++_0x2eb3b1);}(_0xe825,0x1cf));var _0x5e82=function(_0x8e971e,_0xd060a7){_0x8e971e=_0x8e971e-0x0;var _0x52228c=_0xe825[_0x8e971e];return _0x52228c;};'use strict';var util=require(_0x5e82('0x0'));var path=require(_0x5e82('0x1'));var ejs=require(_0x5e82('0x2'));var fs=require('fs');var _=require('lodash');var qs=require(_0x5e82('0x3'));var logger=require(_0x5e82('0x4'))(_0x5e82('0x5'));var config=require(_0x5e82('0x6'));var db=require(_0x5e82('0x7'))['db'];var jayson=require(_0x5e82('0x8'));var client=jayson['client'][_0x5e82('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa7b39f,_0xb9a05f,_0x1b7f20,_0x46d9b5){return new Promise(function(_0x32a7de,_0x2648d9){var _0x5e57fe=_0x46d9b5||client;return _0x5e57fe['request'](_0xa7b39f,_0x1b7f20)['then'](function(_0x4cb9bc){logger[_0x5e82('0xa')]('Network,\x20%s,\x20%s',_0xb9a05f,'request\x20sent');logger[_0x5e82('0xb')](_0x5e82('0xc'),_0xb9a05f,_0x5e82('0xd'),JSON[_0x5e82('0xe')](_0x4cb9bc));if(_0x4cb9bc[_0x5e82('0xf')]){if(_0x4cb9bc[_0x5e82('0xf')][_0x5e82('0x10')]===0x1f4){logger[_0x5e82('0xf')](_0x5e82('0x11'),_0xb9a05f,_0x4cb9bc[_0x5e82('0xf')]['message']);return _0x2648d9(_0x4cb9bc['error'][_0x5e82('0x12')]);}logger[_0x5e82('0xf')](_0x5e82('0x11'),_0xb9a05f,_0x4cb9bc[_0x5e82('0xf')][_0x5e82('0x12')]);return _0x32a7de(_0x4cb9bc['error'][_0x5e82('0x12')]);}else{logger[_0x5e82('0xa')]('Network,\x20%s,\x20%s',_0xb9a05f,'request\x20sent');_0x32a7de(_0x4cb9bc['result']['message']);}})[_0x5e82('0x13')](function(_0x5f22df){logger[_0x5e82('0xf')](_0x5e82('0x11'),_0xb9a05f,_0x5f22df);_0x2648d9(_0x5f22df);});});}function respondWithResult(_0x2ad5d3,_0x1d7248){_0x1d7248=_0x1d7248||0xc8;return function(_0x1f5c82){if(_0x1f5c82){return _0x2ad5d3[_0x5e82('0x14')](_0x1d7248)[_0x5e82('0x15')](_0x1f5c82);}};}function respondWithFilteredResult(_0x4de248,_0x4153b0){return function(_0x3ea237){if(_0x3ea237){var _0x2d74ae=typeof _0x4153b0[_0x5e82('0x16')]===_0x5e82('0x17')&&typeof _0x4153b0[_0x5e82('0x18')]===_0x5e82('0x17');var _0x4c0651=_0x3ea237[_0x5e82('0x19')];var _0x48d70b=_0x2d74ae?0x0:_0x4153b0[_0x5e82('0x16')];var _0x55d94f=_0x2d74ae?_0x3ea237[_0x5e82('0x19')]:_0x4153b0[_0x5e82('0x16')]+_0x4153b0['limit'];var _0x3a5a1b;if(_0x55d94f>=_0x4c0651){_0x55d94f=_0x4c0651;_0x3a5a1b=0xc8;}else{_0x3a5a1b=0xce;}_0x4de248[_0x5e82('0x14')](_0x3a5a1b);return _0x4de248[_0x5e82('0x1a')]('Content-Range',_0x48d70b+'-'+_0x55d94f+'/'+_0x4c0651)[_0x5e82('0x15')](_0x3ea237);}return null;};}function saveUpdates(_0x169fb7){return function(_0xc8182e){if(_0xc8182e){return _0xc8182e[_0x5e82('0x1b')](_0x169fb7)[_0x5e82('0x1c')](function(_0x4b748c){return _0x4b748c;});}return null;};}function removeEntity(_0x5e6a5e){return function(_0x3baca2){if(_0x3baca2){return _0x3baca2[_0x5e82('0x1d')]()['then'](function(){_0x5e6a5e[_0x5e82('0x14')](0xcc)[_0x5e82('0x1e')]();});}};}function handleEntityNotFound(_0x37049c){return function(_0x3798a9){if(!_0x3798a9){_0x37049c[_0x5e82('0x1f')](0x194);}return _0x3798a9;};}function handleError(_0x5eccc0,_0x70b09a){_0x70b09a=_0x70b09a||0x1f4;return function(_0x447a8a){logger[_0x5e82('0xf')](_0x447a8a['stack']);if(_0x447a8a[_0x5e82('0x20')]){delete _0x447a8a[_0x5e82('0x20')];}_0x5eccc0['status'](_0x70b09a)['send'](_0x447a8a);};}exports[_0x5e82('0x21')]=function(_0x4fd736,_0x501e88){var _0x58e4af={},_0x114c9b={},_0xd83e9a={'count':0x0,'rows':[]};var _0x56f373=_[_0x5e82('0x22')](db[_0x5e82('0x23')][_0x5e82('0x24')],function(_0x4ec133){return{'name':_0x4ec133[_0x5e82('0x25')],'type':_0x4ec133[_0x5e82('0x26')]['key']};});_0x114c9b[_0x5e82('0x27')]=_['map'](_0x56f373,_0x5e82('0x20'));_0x114c9b['query']=_[_0x5e82('0x28')](_0x4fd736['query']);_0x114c9b[_0x5e82('0x29')]=_[_0x5e82('0x2a')](_0x114c9b[_0x5e82('0x27')],_0x114c9b[_0x5e82('0x2b')]);_0x58e4af['attributes']=_[_0x5e82('0x2a')](_0x114c9b[_0x5e82('0x27')],qs[_0x5e82('0x2c')](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x2c')]));_0x58e4af[_0x5e82('0x2d')]=_0x58e4af['attributes'][_0x5e82('0x2e')]?_0x58e4af[_0x5e82('0x2d')]:_0x114c9b[_0x5e82('0x27')];if(!_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x2f')]('nolimit')){_0x58e4af[_0x5e82('0x18')]=qs['limit'](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x18')]);_0x58e4af[_0x5e82('0x16')]=qs[_0x5e82('0x16')](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x16')]);}_0x58e4af[_0x5e82('0x30')]=qs[_0x5e82('0x31')](_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x31')]);_0x58e4af['where']=qs['filters'](_['pick'](_0x4fd736[_0x5e82('0x2b')],_0x114c9b[_0x5e82('0x29')]),_0x56f373);if(_0x4fd736['query'][_0x5e82('0x32')]){_0x58e4af[_0x5e82('0x33')]=_['merge'](_0x58e4af[_0x5e82('0x33')],{'$or':_[_0x5e82('0x22')](_0x56f373,function(_0xc7d559){if(_0xc7d559[_0x5e82('0x26')]!=='VIRTUAL'){var _0x2feef9={};_0x2feef9[_0xc7d559[_0x5e82('0x20')]]={'$like':'%'+_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x32')]+'%'};return _0x2feef9;}})});}_0x58e4af=_[_0x5e82('0x34')]({},_0x58e4af,_0x4fd736['options']);var _0x47b10d={'where':_0x58e4af[_0x5e82('0x33')]};return db[_0x5e82('0x23')][_0x5e82('0x19')](_0x47b10d)['then'](function(_0x2e732b){_0xd83e9a['count']=_0x2e732b;if(_0x4fd736[_0x5e82('0x2b')][_0x5e82('0x35')]){_0x58e4af[_0x5e82('0x36')]=[{'all':!![]}];}return db[_0x5e82('0x23')][_0x5e82('0x37')](_0x58e4af);})[_0x5e82('0x1c')](function(_0x2c701a){_0xd83e9a['rows']=_0x2c701a;return _0xd83e9a;})['then'](respondWithFilteredResult(_0x501e88,_0x58e4af))[_0x5e82('0x13')](handleError(_0x501e88,null));};exports[_0x5e82('0x38')]=function(_0x464f51,_0x161168){var _0x537b5e={'raw':!![],'where':{'id':_0x464f51[_0x5e82('0x39')]['id']}},_0x598cb5={};_0x598cb5[_0x5e82('0x27')]=_[_0x5e82('0x28')](db[_0x5e82('0x23')][_0x5e82('0x24')]);_0x598cb5[_0x5e82('0x2b')]=_[_0x5e82('0x28')](_0x464f51[_0x5e82('0x2b')]);_0x598cb5[_0x5e82('0x29')]=_[_0x5e82('0x2a')](_0x598cb5['model'],_0x598cb5[_0x5e82('0x2b')]);_0x537b5e[_0x5e82('0x2d')]=_[_0x5e82('0x2a')](_0x598cb5['model'],qs[_0x5e82('0x2c')](_0x464f51[_0x5e82('0x2b')][_0x5e82('0x2c')]));_0x537b5e[_0x5e82('0x2d')]=_0x537b5e[_0x5e82('0x2d')][_0x5e82('0x2e')]?_0x537b5e['attributes']:_0x598cb5['model'];if(_0x464f51['query'][_0x5e82('0x35')]){_0x537b5e[_0x5e82('0x36')]=[{'all':!![]}];}_0x537b5e=_[_0x5e82('0x34')]({},_0x537b5e,_0x464f51[_0x5e82('0x3a')]);return db['Network']['find'](_0x537b5e)[_0x5e82('0x1c')](handleEntityNotFound(_0x161168,null))[_0x5e82('0x1c')](respondWithResult(_0x161168,null))[_0x5e82('0x13')](handleError(_0x161168,null));};exports[_0x5e82('0x3b')]=function(_0x4cf065,_0x5613bf){var _0x2d9560;return db[_0x5e82('0x23')][_0x5e82('0x3b')](_0x4cf065[_0x5e82('0x3c')],{'raw':!![]})['then'](function(_0x1ed83d){_0x2d9560=_0x1ed83d;return db[_0x5e82('0x23')][_0x5e82('0x37')]({'where':{'type':_0x4cf065[_0x5e82('0x3c')][_0x5e82('0x26')]},'raw':!![]});})[_0x5e82('0x1c')](function(_0x304eda){if(_0x2d9560['type'][_0x5e82('0x3d')]()==_0x5e82('0x3e')){var _0x2a8e47=fs[_0x5e82('0x3f')](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x42')),_0x5e82('0x43'));var _0x108ba5=ejs[_0x5e82('0x44')](_0x2a8e47,{'networks':_0x304eda||[]});fs[_0x5e82('0x45')](_0x5e82('0x46'),_0x108ba5);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x3b'),{'module':'res_stun_monitor.so'});}else if(_0x2d9560[_0x5e82('0x26')][_0x5e82('0x3d')]()=='TURN'){var _0x2845e1=fs[_0x5e82('0x3f')](path['join'](config[_0x5e82('0x41')],_0x5e82('0x48')),_0x5e82('0x43'));var _0x19873d=ejs[_0x5e82('0x44')](_0x2845e1,{'networks':_0x304eda||[]});fs[_0x5e82('0x45')](_0x5e82('0x49'),_0x19873d);return respondWithRpcPromise('Reload',_0x5e82('0x3b'),{'module':_0x5e82('0x4a')});}else{var _0xdfe02a=fs['readFileSync'](path[_0x5e82('0x40')](config['root'],_0x5e82('0x4b')),_0x5e82('0x43'));var _0x30a82e=ejs[_0x5e82('0x44')](_0xdfe02a,{'networks':_0x304eda||[]});fs['writeFileSync'](util[_0x5e82('0x4c')](_0x5e82('0x4d'),_0x4cf065[_0x5e82('0x3c')]['type'][_0x5e82('0x4e')]()),_0x30a82e);return respondWithRpcPromise(_0x5e82('0x47'),'create',{'module':_0x5e82('0x4f')});}})[_0x5e82('0x1c')](function(){return _0x2d9560;})[_0x5e82('0x1c')](respondWithResult(_0x5613bf,0xc9))[_0x5e82('0x13')](handleError(_0x5613bf,null));};exports[_0x5e82('0x1b')]=function(_0x902ec5,_0x4c1f9a){var _0x1f9d05;return db[_0x5e82('0x23')]['find']({'where':{'id':_0x902ec5[_0x5e82('0x39')]['id']}})[_0x5e82('0x1c')](handleEntityNotFound(_0x4c1f9a,null))[_0x5e82('0x1c')](saveUpdates(_0x902ec5[_0x5e82('0x3c')],null))['then'](function(_0x5b0c88){if(_0x5b0c88){_0x1f9d05=_0x5b0c88;return db[_0x5e82('0x23')][_0x5e82('0x37')]({'where':{'type':_0x1f9d05['type']},'raw':!![]});}return null;})[_0x5e82('0x1c')](function(_0x31a78a){if(_0x1f9d05['type'][_0x5e82('0x3d')]()==_0x5e82('0x3e')){var _0x2f36f8=fs[_0x5e82('0x3f')](path[_0x5e82('0x40')](config['root'],_0x5e82('0x42')),'utf8');var _0x33cd71=ejs[_0x5e82('0x44')](_0x2f36f8,{'networks':_0x31a78a||[]});fs[_0x5e82('0x45')]('/etc/asterisk/stun_xcally.conf',_0x33cd71);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x1b'),{'module':_0x5e82('0x4a')});}else if(_0x1f9d05['type']['toUpperCase']()==_0x5e82('0x50')){var _0x10680b=fs['readFileSync'](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x48')),'utf8');var _0x21bec1=ejs['render'](_0x10680b,{'networks':_0x31a78a||[]});fs[_0x5e82('0x45')](_0x5e82('0x49'),_0x21bec1);return respondWithRpcPromise(_0x5e82('0x47'),'update',{'module':_0x5e82('0x4a')});}else{var _0x2ac4a1=fs['readFileSync'](path['join'](config[_0x5e82('0x41')],_0x5e82('0x4b')),_0x5e82('0x43'));var _0x2c46b4=ejs[_0x5e82('0x44')](_0x2ac4a1,{'networks':_0x31a78a||[]});fs[_0x5e82('0x45')](util[_0x5e82('0x4c')](_0x5e82('0x4d'),_0x902ec5[_0x5e82('0x3c')][_0x5e82('0x26')]['toLowerCase']()),_0x2c46b4);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x1b'),{'module':_0x5e82('0x4f')});}})[_0x5e82('0x1c')](function(_0x2b025a){if(_0x2b025a){return _0x1f9d05;}return null;})['then'](respondWithResult(_0x4c1f9a,null))['catch'](handleError(_0x4c1f9a,null));};exports[_0x5e82('0x1d')]=function(_0x4a7cca,_0x1cdc4f){var _0x3639b3;return db[_0x5e82('0x23')]['find']({'where':{'id':_0x4a7cca[_0x5e82('0x39')]['id']}})[_0x5e82('0x1c')](function(_0x38bb5b){_0x3639b3=_0x38bb5b;return _0x38bb5b;})[_0x5e82('0x1c')](handleEntityNotFound(_0x1cdc4f,null))[_0x5e82('0x1c')](removeEntity(_0x1cdc4f,null))[_0x5e82('0x1c')](function(){if(_0x3639b3){return db[_0x5e82('0x23')][_0x5e82('0x37')]({'where':{'type':_0x3639b3[_0x5e82('0x26')]},'raw':!![]});}})['then'](function(_0x4466b2){if(_0x3639b3[_0x5e82('0x26')][_0x5e82('0x3d')]()==_0x5e82('0x3e')){var _0x556a76=fs[_0x5e82('0x3f')](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x42')),_0x5e82('0x43'));var _0x1b095e=ejs[_0x5e82('0x44')](_0x556a76,{'networks':_0x4466b2||[]});fs[_0x5e82('0x45')](_0x5e82('0x46'),_0x1b095e);return respondWithRpcPromise(_0x5e82('0x47'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x3639b3[_0x5e82('0x26')][_0x5e82('0x3d')]()==_0x5e82('0x50')){var _0x292098=fs['readFileSync'](path[_0x5e82('0x40')](config[_0x5e82('0x41')],_0x5e82('0x48')),_0x5e82('0x43'));var _0x3bf3aa=ejs[_0x5e82('0x44')](_0x292098,{'networks':_0x4466b2||[]});fs[_0x5e82('0x45')](_0x5e82('0x49'),_0x3bf3aa);return respondWithRpcPromise(_0x5e82('0x47'),_0x5e82('0x1d'),{'module':_0x5e82('0x4a')});}else{var _0x5be0a4=fs[_0x5e82('0x3f')](path['join'](config[_0x5e82('0x41')],'server/files/templates/network.ejs'),_0x5e82('0x43'));var _0x4d324e=ejs[_0x5e82('0x44')](_0x5be0a4,{'networks':_0x4466b2||[]});fs[_0x5e82('0x45')](util[_0x5e82('0x4c')](_0x5e82('0x4d'),_0x3639b3[_0x5e82('0x26')][_0x5e82('0x4e')]()),_0x4d324e);return respondWithRpcPromise(_0x5e82('0x47'),'destroy',{'module':_0x5e82('0x4f')});}})['catch'](handleError(_0x1cdc4f,null));};
\ No newline at end of file
+var _0xbe13=['readFileSync','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','chan_sip.so','TURN','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','util','path','ejs','lodash','api','../../config/environment','../../mysqldb','client','http','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','sendStatus','stack','name','send','index','Network','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase'];(function(_0x36326d,_0x2bac19){var _0x495c5e=function(_0xe8dbb2){while(--_0xe8dbb2){_0x36326d['push'](_0x36326d['shift']());}};_0x495c5e(++_0x2bac19);}(_0xbe13,0x151));var _0x3be1=function(_0x55d8c7,_0x593fb7){_0x55d8c7=_0x55d8c7-0x0;var _0x11d663=_0xbe13[_0x55d8c7];return _0x11d663;};'use strict';var util=require(_0x3be1('0x0'));var path=require(_0x3be1('0x1'));var ejs=require(_0x3be1('0x2'));var fs=require('fs');var _=require(_0x3be1('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x3be1('0x4'));var config=require(_0x3be1('0x5'));var db=require(_0x3be1('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3be1('0x7')][_0x3be1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d49cd,_0x147a07,_0x20479a,_0x37ff68){return new Promise(function(_0x399a97,_0x447593){var _0x2e3311=_0x37ff68||client;return _0x2e3311['request'](_0x4d49cd,_0x20479a)[_0x3be1('0x9')](function(_0x2fe5f0){logger['info'](_0x3be1('0xa'),_0x147a07,_0x3be1('0xb'));logger[_0x3be1('0xc')](_0x3be1('0xd'),_0x147a07,'request\x20sent',JSON[_0x3be1('0xe')](_0x2fe5f0));if(_0x2fe5f0[_0x3be1('0xf')]){if(_0x2fe5f0[_0x3be1('0xf')][_0x3be1('0x10')]===0x1f4){logger[_0x3be1('0xf')](_0x3be1('0xa'),_0x147a07,_0x2fe5f0[_0x3be1('0xf')]['message']);return _0x447593(_0x2fe5f0[_0x3be1('0xf')][_0x3be1('0x11')]);}logger[_0x3be1('0xf')](_0x3be1('0xa'),_0x147a07,_0x2fe5f0['error']['message']);return _0x399a97(_0x2fe5f0[_0x3be1('0xf')][_0x3be1('0x11')]);}else{logger['info'](_0x3be1('0xa'),_0x147a07,_0x3be1('0xb'));_0x399a97(_0x2fe5f0['result']['message']);}})[_0x3be1('0x12')](function(_0xc2a37c){logger[_0x3be1('0xf')]('Network,\x20%s,\x20%s',_0x147a07,_0xc2a37c);_0x447593(_0xc2a37c);});});}function respondWithResult(_0x33fbc4,_0x3d6ce8){_0x3d6ce8=_0x3d6ce8||0xc8;return function(_0x2bb697){if(_0x2bb697){return _0x33fbc4['status'](_0x3d6ce8)[_0x3be1('0x13')](_0x2bb697);}};}function respondWithFilteredResult(_0x7b587a,_0x292977){return function(_0x31c62d){if(_0x31c62d){var _0x2fc652=typeof _0x292977[_0x3be1('0x14')]===_0x3be1('0x15')&&typeof _0x292977[_0x3be1('0x16')]===_0x3be1('0x15');var _0x32e5a6=_0x31c62d['count'];var _0x1333ec=_0x2fc652?0x0:_0x292977[_0x3be1('0x14')];var _0x48e2cc=_0x2fc652?_0x31c62d[_0x3be1('0x17')]:_0x292977[_0x3be1('0x14')]+_0x292977[_0x3be1('0x16')];var _0x355258;if(_0x48e2cc>=_0x32e5a6){_0x48e2cc=_0x32e5a6;_0x355258=0xc8;}else{_0x355258=0xce;}_0x7b587a[_0x3be1('0x18')](_0x355258);return _0x7b587a[_0x3be1('0x19')](_0x3be1('0x1a'),_0x1333ec+'-'+_0x48e2cc+'/'+_0x32e5a6)[_0x3be1('0x13')](_0x31c62d);}return null;};}function saveUpdates(_0x1e4623){return function(_0x2164bc){if(_0x2164bc){return _0x2164bc[_0x3be1('0x1b')](_0x1e4623)[_0x3be1('0x9')](function(_0x36a52d){return _0x36a52d;});}return null;};}function removeEntity(_0x55566b){return function(_0x4ff59d){if(_0x4ff59d){return _0x4ff59d[_0x3be1('0x1c')]()['then'](function(){_0x55566b[_0x3be1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f4eff){return function(_0x12ebeb){if(!_0x12ebeb){_0x3f4eff[_0x3be1('0x1d')](0x194);}return _0x12ebeb;};}function handleError(_0x203225,_0x3041d4){_0x3041d4=_0x3041d4||0x1f4;return function(_0x2bd08f){logger[_0x3be1('0xf')](_0x2bd08f[_0x3be1('0x1e')]);if(_0x2bd08f[_0x3be1('0x1f')]){delete _0x2bd08f[_0x3be1('0x1f')];}_0x203225[_0x3be1('0x18')](_0x3041d4)[_0x3be1('0x20')](_0x2bd08f);};}exports[_0x3be1('0x21')]=function(_0x156c96,_0x2c0c01){var _0x6ec0eb={},_0x554744={},_0x5c4aba={'count':0x0,'rows':[]};var _0x2a6ece=_['map'](db[_0x3be1('0x22')][_0x3be1('0x23')],function(_0x46a955){return{'name':_0x46a955[_0x3be1('0x24')],'type':_0x46a955['type']['key']};});_0x554744[_0x3be1('0x25')]=_[_0x3be1('0x26')](_0x2a6ece,_0x3be1('0x1f'));_0x554744[_0x3be1('0x27')]=_[_0x3be1('0x28')](_0x156c96[_0x3be1('0x27')]);_0x554744[_0x3be1('0x29')]=_[_0x3be1('0x2a')](_0x554744[_0x3be1('0x25')],_0x554744[_0x3be1('0x27')]);_0x6ec0eb[_0x3be1('0x2b')]=_[_0x3be1('0x2a')](_0x554744['model'],qs[_0x3be1('0x2c')](_0x156c96[_0x3be1('0x27')]['fields']));_0x6ec0eb[_0x3be1('0x2b')]=_0x6ec0eb['attributes'][_0x3be1('0x2d')]?_0x6ec0eb['attributes']:_0x554744[_0x3be1('0x25')];if(!_0x156c96[_0x3be1('0x27')]['hasOwnProperty'](_0x3be1('0x2e'))){_0x6ec0eb[_0x3be1('0x16')]=qs[_0x3be1('0x16')](_0x156c96[_0x3be1('0x27')][_0x3be1('0x16')]);_0x6ec0eb[_0x3be1('0x14')]=qs['offset'](_0x156c96[_0x3be1('0x27')][_0x3be1('0x14')]);}_0x6ec0eb[_0x3be1('0x2f')]=qs[_0x3be1('0x30')](_0x156c96['query'][_0x3be1('0x30')]);_0x6ec0eb['where']=qs[_0x3be1('0x29')](_['pick'](_0x156c96['query'],_0x554744['filters']),_0x2a6ece);if(_0x156c96[_0x3be1('0x27')][_0x3be1('0x31')]){_0x6ec0eb[_0x3be1('0x32')]=_[_0x3be1('0x33')](_0x6ec0eb[_0x3be1('0x32')],{'$or':_[_0x3be1('0x26')](_0x2a6ece,function(_0x5233e5){if(_0x5233e5[_0x3be1('0x34')]!=='VIRTUAL'){var _0x3ea43e={};_0x3ea43e[_0x5233e5[_0x3be1('0x1f')]]={'$like':'%'+_0x156c96[_0x3be1('0x27')][_0x3be1('0x31')]+'%'};return _0x3ea43e;}})});}_0x6ec0eb=_[_0x3be1('0x33')]({},_0x6ec0eb,_0x156c96[_0x3be1('0x35')]);var _0x5bcd36={'where':_0x6ec0eb[_0x3be1('0x32')]};return db[_0x3be1('0x22')]['count'](_0x5bcd36)['then'](function(_0x7bd0b4){_0x5c4aba[_0x3be1('0x17')]=_0x7bd0b4;if(_0x156c96[_0x3be1('0x27')][_0x3be1('0x36')]){_0x6ec0eb['include']=[{'all':!![]}];}return db[_0x3be1('0x22')][_0x3be1('0x37')](_0x6ec0eb);})[_0x3be1('0x9')](function(_0xd27c60){_0x5c4aba[_0x3be1('0x38')]=_0xd27c60;return _0x5c4aba;})[_0x3be1('0x9')](respondWithFilteredResult(_0x2c0c01,_0x6ec0eb))['catch'](handleError(_0x2c0c01,null));};exports[_0x3be1('0x39')]=function(_0x2497e1,_0x45c8d1){var _0x13d2b7={'raw':!![],'where':{'id':_0x2497e1[_0x3be1('0x3a')]['id']}},_0x2d046d={};_0x2d046d['model']=_[_0x3be1('0x28')](db[_0x3be1('0x22')]['rawAttributes']);_0x2d046d['query']=_[_0x3be1('0x28')](_0x2497e1['query']);_0x2d046d[_0x3be1('0x29')]=_['intersection'](_0x2d046d[_0x3be1('0x25')],_0x2d046d[_0x3be1('0x27')]);_0x13d2b7[_0x3be1('0x2b')]=_[_0x3be1('0x2a')](_0x2d046d[_0x3be1('0x25')],qs[_0x3be1('0x2c')](_0x2497e1['query'][_0x3be1('0x2c')]));_0x13d2b7[_0x3be1('0x2b')]=_0x13d2b7[_0x3be1('0x2b')][_0x3be1('0x2d')]?_0x13d2b7[_0x3be1('0x2b')]:_0x2d046d['model'];if(_0x2497e1[_0x3be1('0x27')][_0x3be1('0x36')]){_0x13d2b7['include']=[{'all':!![]}];}_0x13d2b7=_[_0x3be1('0x33')]({},_0x13d2b7,_0x2497e1[_0x3be1('0x35')]);return db[_0x3be1('0x22')][_0x3be1('0x3b')](_0x13d2b7)['then'](handleEntityNotFound(_0x45c8d1,null))[_0x3be1('0x9')](respondWithResult(_0x45c8d1,null))['catch'](handleError(_0x45c8d1,null));};exports['create']=function(_0x4b791e,_0x3d5975){var _0x16c7aa;return db['Network'][_0x3be1('0x3c')](_0x4b791e[_0x3be1('0x3d')],{'raw':!![]})[_0x3be1('0x9')](function(_0x232585){_0x16c7aa=_0x232585;return db[_0x3be1('0x22')][_0x3be1('0x37')]({'where':{'type':_0x4b791e[_0x3be1('0x3d')]['type']},'raw':!![]});})[_0x3be1('0x9')](function(_0x388642){if(_0x16c7aa['type']['toUpperCase']()==_0x3be1('0x3e')){var _0x3c0d8a=fs['readFileSync'](path[_0x3be1('0x3f')](config[_0x3be1('0x40')],_0x3be1('0x41')),_0x3be1('0x42'));var _0x509556=ejs[_0x3be1('0x43')](_0x3c0d8a,{'networks':_0x388642||[]});fs[_0x3be1('0x44')](_0x3be1('0x45'),_0x509556);return respondWithRpcPromise(_0x3be1('0x46'),'create',{'module':_0x3be1('0x47')});}else if(_0x16c7aa['type'][_0x3be1('0x48')]()=='TURN'){var _0x42f13a=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config[_0x3be1('0x40')],_0x3be1('0x4a')),_0x3be1('0x42'));var _0x411f10=ejs[_0x3be1('0x43')](_0x42f13a,{'networks':_0x388642||[]});fs[_0x3be1('0x44')]('/etc/asterisk/turn_xcally.conf',_0x411f10);return respondWithRpcPromise(_0x3be1('0x46'),'create',{'module':_0x3be1('0x47')});}else{var _0x1c2dca=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x4b')),_0x3be1('0x42'));var _0xab0555=ejs[_0x3be1('0x43')](_0x1c2dca,{'networks':_0x388642||[]});fs['writeFileSync'](util[_0x3be1('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x4b791e[_0x3be1('0x3d')][_0x3be1('0x34')][_0x3be1('0x4d')]()),_0xab0555);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x3c'),{'module':_0x3be1('0x4e')});}})[_0x3be1('0x9')](function(){return _0x16c7aa;})['then'](respondWithResult(_0x3d5975,0xc9))[_0x3be1('0x12')](handleError(_0x3d5975,null));};exports['update']=function(_0x29ad13,_0x3e83dd){var _0x289df8;return db['Network']['find']({'where':{'id':_0x29ad13[_0x3be1('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3e83dd,null))[_0x3be1('0x9')](saveUpdates(_0x29ad13['body'],null))['then'](function(_0x1caa5b){if(_0x1caa5b){_0x289df8=_0x1caa5b;return db[_0x3be1('0x22')][_0x3be1('0x37')]({'where':{'type':_0x289df8[_0x3be1('0x34')]},'raw':!![]});}return null;})['then'](function(_0x5c3bde){if(_0x289df8[_0x3be1('0x34')]['toUpperCase']()=='STUN'){var _0x2f55dc=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x41')),_0x3be1('0x42'));var _0x1cb495=ejs['render'](_0x2f55dc,{'networks':_0x5c3bde||[]});fs['writeFileSync'](_0x3be1('0x45'),_0x1cb495);return respondWithRpcPromise(_0x3be1('0x46'),'update',{'module':_0x3be1('0x47')});}else if(_0x289df8[_0x3be1('0x34')][_0x3be1('0x48')]()==_0x3be1('0x4f')){var _0x508541=fs['readFileSync'](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x4a')),'utf8');var _0x402421=ejs[_0x3be1('0x43')](_0x508541,{'networks':_0x5c3bde||[]});fs['writeFileSync'](_0x3be1('0x50'),_0x402421);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x1b'),{'module':_0x3be1('0x47')});}else{var _0x5893cc=fs[_0x3be1('0x49')](path[_0x3be1('0x3f')](config['root'],_0x3be1('0x4b')),_0x3be1('0x42'));var _0x43427b=ejs[_0x3be1('0x43')](_0x5893cc,{'networks':_0x5c3bde||[]});fs[_0x3be1('0x44')](util[_0x3be1('0x4c')](_0x3be1('0x51'),_0x29ad13[_0x3be1('0x3d')]['type']['toLowerCase']()),_0x43427b);return respondWithRpcPromise(_0x3be1('0x46'),'update',{'module':'chan_sip.so'});}})[_0x3be1('0x9')](function(_0x4159c7){if(_0x4159c7){return _0x289df8;}return null;})['then'](respondWithResult(_0x3e83dd,null))['catch'](handleError(_0x3e83dd,null));};exports[_0x3be1('0x1c')]=function(_0x32ec3d,_0x3ebd5d){var _0x38fafb;return db[_0x3be1('0x22')]['find']({'where':{'id':_0x32ec3d[_0x3be1('0x3a')]['id']}})['then'](function(_0x19674d){_0x38fafb=_0x19674d;return _0x19674d;})[_0x3be1('0x9')](handleEntityNotFound(_0x3ebd5d,null))[_0x3be1('0x9')](removeEntity(_0x3ebd5d,null))['then'](function(){if(_0x38fafb){return db[_0x3be1('0x22')]['findAll']({'where':{'type':_0x38fafb['type']},'raw':!![]});}})[_0x3be1('0x9')](function(_0x192459){if(_0x38fafb[_0x3be1('0x34')]['toUpperCase']()==_0x3be1('0x3e')){var _0x39886c=fs['readFileSync'](path[_0x3be1('0x3f')](config[_0x3be1('0x40')],_0x3be1('0x41')),_0x3be1('0x42'));var _0x334c47=ejs[_0x3be1('0x43')](_0x39886c,{'networks':_0x192459||[]});fs[_0x3be1('0x44')](_0x3be1('0x45'),_0x334c47);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x1c'),{'module':_0x3be1('0x47')});}else if(_0x38fafb[_0x3be1('0x34')][_0x3be1('0x48')]()==_0x3be1('0x4f')){var _0xb0f02d=fs[_0x3be1('0x49')](path['join'](config['root'],_0x3be1('0x4a')),_0x3be1('0x42'));var _0x110e2c=ejs[_0x3be1('0x43')](_0xb0f02d,{'networks':_0x192459||[]});fs[_0x3be1('0x44')](_0x3be1('0x50'),_0x110e2c);return respondWithRpcPromise('Reload',_0x3be1('0x1c'),{'module':_0x3be1('0x47')});}else{var _0x1f58ff=fs[_0x3be1('0x49')](path['join'](config[_0x3be1('0x40')],'server/files/templates/network.ejs'),_0x3be1('0x42'));var _0x1e8c87=ejs['render'](_0x1f58ff,{'networks':_0x192459||[]});fs['writeFileSync'](util[_0x3be1('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x38fafb['type']['toLowerCase']()),_0x1e8c87);return respondWithRpcPromise(_0x3be1('0x46'),_0x3be1('0x1c'),{'module':_0x3be1('0x4e')});}})['catch'](handleError(_0x3ebd5d,null));};
\ No newline at end of file
index e47b520..e9c41b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a24=['util','api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','network','lodash'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x6a24,0xd1));var _0x46a2=function(_0x45a237,_0x16e04f){_0x45a237=_0x45a237-0x0;var _0x48b798=_0x6a24[_0x45a237];return _0x48b798;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var BPromise=require(_0x46a2('0x4'));var rp=require(_0x46a2('0x5'));var fs=require('fs');var path=require(_0x46a2('0x6'));var rimraf=require('rimraf');var config=require(_0x46a2('0x7'));var attributes=require(_0x46a2('0x8'));module['exports']=function(_0x22de0d,_0x8b6541){return _0x22de0d['define']('Network',attributes,{'tableName':_0x46a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['rimraf','./network.attributes','exports','define','network','../../config/logger','api','moment','bluebird','path'];(function(_0xd4245d,_0x420ff3){var _0x4efb29=function(_0x127898){while(--_0x127898){_0xd4245d['push'](_0xd4245d['shift']());}};_0x4efb29(++_0x420ff3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3ba924,_0x3b99f0){_0x3ba924=_0x3ba924-0x0;var _0x4cc1df=_0xcb91[_0x3ba924];return _0x4cc1df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('Network',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5322789..5d36df5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x2fcabd,_0x1191f5){_0x2fcabd=_0x2fcabd-0x0;var _0x21e872=_0x7a54[_0x2fcabd];return _0x21e872;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1cec08,_0xaeb34a){var _0x31535e=function(_0x393276){while(--_0x393276){_0x1cec08['push'](_0x1cec08['shift']());}};_0x31535e(++_0xaeb34a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index 0e90d6a..6b8f5b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94ad=['/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','notify','addApplications','addAgents','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x530f5d,_0x35df7f){var _0x2c1900=function(_0x14ea32){while(--_0x14ea32){_0x530f5d['push'](_0x530f5d['shift']());}};_0x2c1900(++_0x35df7f);}(_0x94ad,0x115));var _0xd94a=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x94ad[_0x49d41c];return _0xb64c5f;};'use strict';var multer=require(_0xd94a('0x0'));var util=require(_0xd94a('0x1'));var path=require(_0xd94a('0x2'));var timeout=require(_0xd94a('0x3'));var express=require(_0xd94a('0x4'));var router=express[_0xd94a('0x5')]();var fs_extra=require(_0xd94a('0x6'));var auth=require(_0xd94a('0x7'));var interaction=require(_0xd94a('0x8'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0xd94a('0x9')]('/',auth[_0xd94a('0xa')](),controller['index']);router[_0xd94a('0x9')](_0xd94a('0xb'),auth['isAuthenticated'](),controller[_0xd94a('0xc')]);router[_0xd94a('0x9')](_0xd94a('0xd'),auth['isAuthenticated'](),controller[_0xd94a('0xe')]);router[_0xd94a('0x9')](_0xd94a('0xf'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x10')]);router[_0xd94a('0x9')](_0xd94a('0x11'),auth['isAuthenticated'](),controller[_0xd94a('0x12')]);router[_0xd94a('0x9')](_0xd94a('0x13'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x14')]);router[_0xd94a('0x9')](_0xd94a('0x15'),auth['isAuthenticated'](),controller['getInteractions']);router[_0xd94a('0x9')](_0xd94a('0x16'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x17')]);router[_0xd94a('0x18')]('/',auth[_0xd94a('0xa')](),controller[_0xd94a('0x19')]);router[_0xd94a('0x18')](_0xd94a('0xf'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x1a')]);router[_0xd94a('0x18')](_0xd94a('0x11'),auth[_0xd94a('0xa')](),controller['addAnswer']);router['post']('/:id/notify',controller[_0xd94a('0x1b')]);router['post'](_0xd94a('0x13'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x1c')]);router[_0xd94a('0x18')](_0xd94a('0x16'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x1d')]);router[_0xd94a('0x18')]('/:id/send',auth[_0xd94a('0xa')](),controller[_0xd94a('0x1e')]);router[_0xd94a('0x1f')]('/:id',auth[_0xd94a('0xa')](),controller['update']);router[_0xd94a('0x20')](_0xd94a('0xd'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x21')]);router[_0xd94a('0x20')](_0xd94a('0xf'),auth['isAuthenticated'](),controller[_0xd94a('0x22')]);router[_0xd94a('0x20')](_0xd94a('0x11'),auth[_0xd94a('0xa')](),controller[_0xd94a('0x23')]);router[_0xd94a('0x20')]('/:id/users',auth[_0xd94a('0xa')](),controller[_0xd94a('0x24')]);module['exports']=router;
\ No newline at end of file
+var _0x59c8=['addApplications','addAgents','/:id/send','send','update','delete','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','/describe','describe','get','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications'];(function(_0x3e5752,_0x4ff7d6){var _0x4abbc9=function(_0x3218ee){while(--_0x3218ee){_0x3e5752['push'](_0x3e5752['shift']());}};_0x4abbc9(++_0x4ff7d6);}(_0x59c8,0x99));var _0x859c=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x59c8[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x859c('0x0'));var path=require('path');var timeout=require(_0x859c('0x1'));var express=require(_0x859c('0x2'));var router=express[_0x859c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x859c('0x4'));var interaction=require(_0x859c('0x5'));var config=require(_0x859c('0x6'));var controller=require(_0x859c('0x7'));router['get']('/',auth[_0x859c('0x8')](),controller['index']);router['get'](_0x859c('0x9'),auth[_0x859c('0x8')](),controller[_0x859c('0xa')]);router[_0x859c('0xb')](_0x859c('0xc'),auth[_0x859c('0x8')](),controller[_0x859c('0xd')]);router[_0x859c('0xb')](_0x859c('0xe'),auth[_0x859c('0x8')](),controller['getDispositions']);router[_0x859c('0xb')](_0x859c('0xf'),auth[_0x859c('0x8')](),controller[_0x859c('0x10')]);router[_0x859c('0xb')]('/:id/applications',auth[_0x859c('0x8')](),controller['getApplications']);router['get'](_0x859c('0x11'),auth[_0x859c('0x8')](),controller['getInteractions']);router['get'](_0x859c('0x12'),auth[_0x859c('0x8')](),controller[_0x859c('0x13')]);router[_0x859c('0x14')]('/',auth['isAuthenticated'](),controller[_0x859c('0x15')]);router[_0x859c('0x14')](_0x859c('0xe'),auth[_0x859c('0x8')](),controller[_0x859c('0x16')]);router[_0x859c('0x14')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x859c('0x17')]);router['post'](_0x859c('0x18'),controller[_0x859c('0x19')]);router[_0x859c('0x14')](_0x859c('0x1a'),auth[_0x859c('0x8')](),controller[_0x859c('0x1b')]);router[_0x859c('0x14')]('/:id/users',auth[_0x859c('0x8')](),controller[_0x859c('0x1c')]);router[_0x859c('0x14')](_0x859c('0x1d'),auth['isAuthenticated'](),controller[_0x859c('0x1e')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x859c('0x1f')]);router[_0x859c('0x20')](_0x859c('0xc'),auth[_0x859c('0x8')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x859c('0x8')](),controller[_0x859c('0x21')]);router[_0x859c('0x20')]('/:id/canned_answers',auth[_0x859c('0x8')](),controller[_0x859c('0x22')]);router[_0x859c('0x20')](_0x859c('0x12'),auth['isAuthenticated'](),controller[_0x859c('0x23')]);module['exports']=router;
\ No newline at end of file
index 5f3220e..5eb83bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b6b=['STRING','name','generate','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring'];(function(_0x42bfb7,_0x25a3ec){var _0x5c497d=function(_0x48e83e){while(--_0x48e83e){_0x42bfb7['push'](_0x42bfb7['shift']());}};_0x5c497d(++_0x25a3ec);}(_0x5b6b,0x1d4));var _0xb5b6=function(_0x5368b0,_0x4c44b6){_0x5368b0=_0x5368b0-0x0;var _0x489ace=_0x5b6b[_0x5368b0];return _0x489ace;};'use strict';var Sequelize=require(_0xb5b6('0x0'));var rs=require(_0xb5b6('0x1'));module['exports']={'name':{'type':Sequelize[_0xb5b6('0x2')],'unique':_0xb5b6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xb5b6('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb5b6('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb5b6('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb5b6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb5b6('0x2')]},'queueTransfer':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb5b6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb5b6('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb5b6('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb5b6('0x5')],'defaultValue':![],'comment':_0xb5b6('0x7'),'set':function(_0x5152df){if(!_0x5152df)this[_0xb5b6('0x8')]('mandatoryDispositionPauseId',null);this[_0xb5b6('0x8')](_0xb5b6('0x9'),_0x5152df);}}};
\ No newline at end of file
+var _0x83ef=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x221ba2,_0x79208){var _0x47d08e=function(_0xaf14ee){while(--_0xaf14ee){_0x221ba2['push'](_0x221ba2['shift']());}};_0x47d08e(++_0x79208);}(_0x83ef,0x1e3));var _0xf83e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x83ef[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xf83e('0x0'));var rs=require(_0xf83e('0x1'));module[_0xf83e('0x2')]={'name':{'type':Sequelize[_0xf83e('0x3')],'unique':_0xf83e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xf83e('0x3')]},'token':{'type':Sequelize[_0xf83e('0x3')],'defaultValue':function(){return rs[_0xf83e('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf83e('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf83e('0x6')],'defaultValue':function(){return _0xf83e('0x7');}},'notificationSound':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf83e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf83e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf83e('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0xf83e('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf83e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1eedda){if(!_0x1eedda)this[_0xf83e('0xb')](_0xf83e('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x1eedda);}}};
\ No newline at end of file
index 4dd4ab0..19f39ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8ee=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','Pause','include','options','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','Disposition','getDispositions','findOne','hasOwnProperty','includeAll','removeDispositions','addAnswer','OpenchannelAccountId','CannedAnswer','getAnswers','ids','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','OpenchannelApplication','Applications','List','account','list','applications','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','agent','forcedOwnership','Start','startRouting','EventManager','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','User','Owner','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','defaults','ListId','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys'];(function(_0x32945a,_0x3919d5){var _0x2941d4=function(_0x5cd8ca){while(--_0x5cd8ca){_0x32945a['push'](_0x32945a['shift']());}};_0x2941d4(++_0x3919d5);}(_0xd8ee,0x1f2));var _0xed8e=function(_0x424c15,_0x4e1f19){_0x424c15=_0x424c15-0x0;var _0xc61cf9=_0xd8ee[_0x424c15];return _0xc61cf9;};'use strict';var emlformat=require(_0xed8e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xed8e('0x1'));var jsonpatch=require(_0xed8e('0x2'));var rp=require(_0xed8e('0x3'));var moment=require('moment');var BPromise=require(_0xed8e('0x4'));var Mustache=require(_0xed8e('0x5'));var util=require(_0xed8e('0x6'));var path=require(_0xed8e('0x7'));var sox=require(_0xed8e('0x8'));var csv=require(_0xed8e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed8e('0xa'));var _=require(_0xed8e('0xb'));var squel=require(_0xed8e('0xc'));var crypto=require(_0xed8e('0xd'));var jsforce=require(_0xed8e('0xe'));var deskjs=require(_0xed8e('0xf'));var toCsv=require(_0xed8e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xed8e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xed8e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed8e('0x12'))(_0xed8e('0x13'));var utils=require('../../config/utils');var config=require(_0xed8e('0x14'));var licenseUtil=require(_0xed8e('0x15'));var db=require('../../mysqldb')['db'];config[_0xed8e('0x16')]=_['defaults'](config[_0xed8e('0x16')],{'host':_0xed8e('0x17'),'port':0x18eb});var socket=require(_0xed8e('0x18'))(new Redis(config[_0xed8e('0x16')]));require(_0xed8e('0x19'))[_0xed8e('0x1a')](socket);var jayson=require(_0xed8e('0x1b'));var client=jayson[_0xed8e('0x1c')][_0xed8e('0x1d')]({'port':0x232c});var client9002=jayson[_0xed8e('0x1c')][_0xed8e('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x28dd7b,_0x280499,_0x4cefe4,_0x35f69d){return new BPromise(function(_0x51a804,_0x27f63b){var _0xec2257=_0x35f69d||client;return _0xec2257['request'](_0x28dd7b,_0x4cefe4)[_0xed8e('0x1e')](function(_0x167924){logger[_0xed8e('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x280499,'request\x20sent');logger['debug'](_0xed8e('0x20'),_0x280499,_0xed8e('0x21'),JSON[_0xed8e('0x22')](_0x167924));if(_0x167924[_0xed8e('0x23')]){if(_0x167924['error']['code']===0x1f4){logger[_0xed8e('0x23')](_0xed8e('0x24'),_0x280499,_0x167924[_0xed8e('0x23')][_0xed8e('0x25')]);return _0x27f63b(_0x167924[_0xed8e('0x23')]['message']);}logger['error'](_0xed8e('0x24'),_0x280499,_0x167924['error'][_0xed8e('0x25')]);return _0x51a804(_0x167924[_0xed8e('0x23')]['message']);}else{logger[_0xed8e('0x1f')](_0xed8e('0x24'),_0x280499,'request\x20sent');_0x51a804(_0x167924[_0xed8e('0x26')]['message']);}})['catch'](function(_0x26c644){logger[_0xed8e('0x23')](_0xed8e('0x24'),_0x280499,_0x26c644);_0x27f63b(_0x26c644);});});}function respondWithStatusCode(_0x91cfdc,_0x177e05){_0x177e05=_0x177e05||0xcc;return function(_0xbbecf4){if(_0xbbecf4){return _0x91cfdc[_0xed8e('0x27')](_0x177e05);}return _0x91cfdc[_0xed8e('0x28')](_0x177e05)[_0xed8e('0x29')]();};}function respondWithResult(_0x2be2be,_0x2bd5ee){_0x2bd5ee=_0x2bd5ee||0xc8;return function(_0x4be629){if(_0x4be629){return _0x2be2be['status'](_0x2bd5ee)['json'](_0x4be629);}};}function respondWithFilteredResult(_0x3ce206,_0x177d69){return function(_0x56ca88){if(_0x56ca88){var _0x112f4b=typeof _0x177d69['offset']===_0xed8e('0x2a')&&typeof _0x177d69[_0xed8e('0x2b')]===_0xed8e('0x2a');var _0xb99b19=_0x56ca88[_0xed8e('0x2c')];var _0x432f03=_0x112f4b?0x0:_0x177d69[_0xed8e('0x2d')];var _0x8970df=_0x112f4b?_0x56ca88[_0xed8e('0x2c')]:_0x177d69['offset']+_0x177d69[_0xed8e('0x2b')];var _0x120eab;if(_0x8970df>=_0xb99b19){_0x8970df=_0xb99b19;_0x120eab=0xc8;}else{_0x120eab=0xce;}_0x3ce206[_0xed8e('0x28')](_0x120eab);return _0x3ce206[_0xed8e('0x2e')](_0xed8e('0x2f'),_0x432f03+'-'+_0x8970df+'/'+_0xb99b19)[_0xed8e('0x30')](_0x56ca88);}return null;};}function patchUpdates(_0x1e2907){return function(_0x2c7994){try{jsonpatch[_0xed8e('0x31')](_0x2c7994,_0x1e2907,!![]);}catch(_0x2c7687){return BPromise[_0xed8e('0x32')](_0x2c7687);}return _0x2c7994[_0xed8e('0x33')]();};}function saveUpdates(_0x10be92,_0x320a35){return function(_0x2c1546){if(_0x2c1546){return _0x2c1546[_0xed8e('0x34')](_0x10be92)[_0xed8e('0x1e')](function(_0x3e7e80){return _0x3e7e80;});}return null;};}function removeEntity(_0x255516,_0xb63e7e){return function(_0x43c7de){if(_0x43c7de){return _0x43c7de[_0xed8e('0x35')]()[_0xed8e('0x1e')](function(){var _0x1127d2=_0x43c7de[_0xed8e('0x36')]({'plain':!![]});var _0x49623c=_0xed8e('0x37');return db[_0xed8e('0x38')][_0xed8e('0x35')]({'where':{'type':_0x49623c,'resourceId':_0x1127d2['id']}})[_0xed8e('0x1e')](function(){return _0x43c7de;});})[_0xed8e('0x1e')](function(){_0x255516['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b9f9e,_0x529e45){return function(_0x13ebf1){if(!_0x13ebf1){_0x1b9f9e[_0xed8e('0x27')](0x194);}return _0x13ebf1;};}function handleError(_0x402971,_0x438c1d){_0x438c1d=_0x438c1d||0x1f4;return function(_0x379220){logger[_0xed8e('0x23')](_0x379220[_0xed8e('0x39')]);if(_0x379220[_0xed8e('0x3a')]){delete _0x379220[_0xed8e('0x3a')];}_0x402971['status'](_0x438c1d)['send'](_0x379220);};}exports[_0xed8e('0x3b')]=function(_0x2760ca,_0x2874ac){var _0x1bac81={'include':[{'model':db['Pause'],'as':_0xed8e('0x3c')}]},_0x116423={},_0x5b2837={'count':0x0,'rows':[]};var _0x2eca2a=_[_0xed8e('0x3d')](db[_0xed8e('0x3e')][_0xed8e('0x3f')],function(_0x14dbff){return{'name':_0x14dbff[_0xed8e('0x40')],'type':_0x14dbff[_0xed8e('0x41')][_0xed8e('0x42')]};});_0x116423[_0xed8e('0x43')]=_['map'](_0x2eca2a,_0xed8e('0x3a'));_0x116423['query']=_[_0xed8e('0x44')](_0x2760ca[_0xed8e('0x45')]);_0x116423[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0x116423[_0xed8e('0x43')],_0x116423['query']);_0x1bac81['attributes']=_[_0xed8e('0x47')](_0x116423['model'],qs[_0xed8e('0x48')](_0x2760ca['query'][_0xed8e('0x48')]));_0x1bac81[_0xed8e('0x49')]=_0x1bac81[_0xed8e('0x49')][_0xed8e('0x4a')]?_0x1bac81[_0xed8e('0x49')]:_0x116423[_0xed8e('0x43')];if(!_0x2760ca['query']['hasOwnProperty'](_0xed8e('0x4b'))){_0x1bac81[_0xed8e('0x2b')]=qs['limit'](_0x2760ca[_0xed8e('0x45')][_0xed8e('0x2b')]);_0x1bac81[_0xed8e('0x2d')]=qs['offset'](_0x2760ca['query'][_0xed8e('0x2d')]);}_0x1bac81[_0xed8e('0x4c')]=qs['sort'](_0x2760ca[_0xed8e('0x45')][_0xed8e('0x4d')]);_0x1bac81[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x2760ca[_0xed8e('0x45')],_0x116423[_0xed8e('0x46')]),_0x2eca2a);if(_0x2760ca[_0xed8e('0x45')][_0xed8e('0x50')]){_0x1bac81[_0xed8e('0x4e')]=_[_0xed8e('0x51')](_0x1bac81['where'],{'$or':_[_0xed8e('0x3d')](_0x2eca2a,function(_0xebe3c9){if(_0xebe3c9[_0xed8e('0x41')]!==_0xed8e('0x52')){var _0x43c4b4={};_0x43c4b4[_0xebe3c9['name']]={'$like':'%'+_0x2760ca[_0xed8e('0x45')]['filter']+'%'};return _0x43c4b4;}})});}_0x1bac81=_[_0xed8e('0x51')]({},_0x1bac81,_0x2760ca['options']);var _0x42a6df={'where':_0x1bac81[_0xed8e('0x4e')]};return db[_0xed8e('0x3e')][_0xed8e('0x2c')](_0x42a6df)[_0xed8e('0x1e')](function(_0x9bdfff){_0x5b2837[_0xed8e('0x2c')]=_0x9bdfff;if(_0x2760ca[_0xed8e('0x45')]['includeAll']){_0x1bac81['include']=[{'all':!![]}];}return db[_0xed8e('0x3e')][_0xed8e('0x53')](_0x1bac81);})['then'](function(_0x183bae){_0x5b2837[_0xed8e('0x54')]=_0x183bae;return _0x5b2837;})[_0xed8e('0x1e')](respondWithFilteredResult(_0x2874ac,_0x1bac81))[_0xed8e('0x55')](handleError(_0x2874ac,null));};exports[_0xed8e('0x56')]=function(_0x49c962,_0x45694b){var _0x342198={'raw':![],'where':{'id':_0x49c962['params']['id']},'include':[{'model':db[_0xed8e('0x57')],'as':_0xed8e('0x3c')}]},_0x17bd9b={};_0x17bd9b[_0xed8e('0x43')]=_[_0xed8e('0x44')](db['OpenchannelAccount'][_0xed8e('0x3f')]);_0x17bd9b[_0xed8e('0x45')]=_[_0xed8e('0x44')](_0x49c962['query']);_0x17bd9b['filters']=_['intersection'](_0x17bd9b[_0xed8e('0x43')],_0x17bd9b[_0xed8e('0x45')]);_0x342198[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0x17bd9b[_0xed8e('0x43')],qs['fields'](_0x49c962[_0xed8e('0x45')][_0xed8e('0x48')]));_0x342198['attributes']=_0x342198[_0xed8e('0x49')][_0xed8e('0x4a')]?_0x342198['attributes']:_0x17bd9b['model'];if(_0x49c962['query']['includeAll']){_0x342198[_0xed8e('0x58')]=[{'all':!![]}];}_0x342198=_[_0xed8e('0x51')]({},_0x342198,_0x49c962[_0xed8e('0x59')]);return db[_0xed8e('0x3e')][_0xed8e('0x5a')](_0x342198)[_0xed8e('0x1e')](handleEntityNotFound(_0x45694b,null))[_0xed8e('0x1e')](respondWithResult(_0x45694b,null))[_0xed8e('0x55')](handleError(_0x45694b,null));};exports['create']=function(_0x5cdd78,_0x5b1b9f){return db['OpenchannelAccount'][_0xed8e('0x5b')](_0x5cdd78[_0xed8e('0x5c')],{})[_0xed8e('0x1e')](function(_0x48dddf){var _0x3da66b=_0x5cdd78[_0xed8e('0x5d')][_0xed8e('0x36')]({'plain':!![]});if(!_0x3da66b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3da66b[_0xed8e('0x5e')]===_0xed8e('0x5d')){var _0x116b60=_0x48dddf[_0xed8e('0x36')]({'plain':!![]});var _0x4727fe=_0xed8e('0x37');return db[_0xed8e('0x5f')][_0xed8e('0x5a')]({'where':{'name':_0x4727fe,'userProfileId':_0x3da66b[_0xed8e('0x60')]},'raw':!![]})[_0xed8e('0x1e')](function(_0x4fc90f){if(_0x4fc90f&&_0x4fc90f[_0xed8e('0x61')]===0x0){return db['UserProfileResource'][_0xed8e('0x5b')]({'name':_0x116b60[_0xed8e('0x3a')],'resourceId':_0x116b60['id'],'type':_0x4fc90f[_0xed8e('0x3a')],'sectionId':_0x4fc90f['id']},{})[_0xed8e('0x1e')](function(){return _0x48dddf;});}else{return _0x48dddf;}})[_0xed8e('0x55')](function(_0x2681ef){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2681ef);throw _0x2681ef;});}return _0x48dddf;})[_0xed8e('0x1e')](respondWithResult(_0x5b1b9f,0xc9))['catch'](handleError(_0x5b1b9f,null));};exports['update']=function(_0x21d518,_0x3a4dbd){if(_0x21d518['body']['id']){delete _0x21d518[_0xed8e('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x21d518['params']['id']},'include':[{'model':db[_0xed8e('0x57')],'as':_0xed8e('0x3c')}]})[_0xed8e('0x1e')](handleEntityNotFound(_0x3a4dbd,null))[_0xed8e('0x1e')](saveUpdates(_0x21d518[_0xed8e('0x5c')],null))[_0xed8e('0x1e')](respondWithResult(_0x3a4dbd,null))[_0xed8e('0x55')](handleError(_0x3a4dbd,null));};exports['destroy']=function(_0xc4696,_0x3aec9e){return db['OpenchannelAccount'][_0xed8e('0x5a')]({'where':{'id':_0xc4696[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x3aec9e,null))['then'](removeEntity(_0x3aec9e,null))[_0xed8e('0x55')](handleError(_0x3aec9e,null));};exports['describe']=function(_0x47b0a4,_0x3af02a){return db[_0xed8e('0x3e')][_0xed8e('0x63')]()[_0xed8e('0x1e')](respondWithResult(_0x3af02a,null))[_0xed8e('0x55')](handleError(_0x3af02a,null));};exports['addDisposition']=function(_0x34ac5b,_0x3b40d9,_0x51eb53){if(_0x34ac5b[_0xed8e('0x5c')]['id']){delete _0x34ac5b[_0xed8e('0x5c')]['id'];}return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x34ac5b[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x3b40d9,null))[_0xed8e('0x1e')](function(_0x5eff5){if(_0x5eff5){_0x34ac5b[_0xed8e('0x5c')]['OpenchannelAccountId']=_0x5eff5['id'];return db[_0xed8e('0x64')][_0xed8e('0x5b')](_0x34ac5b[_0xed8e('0x5c')]);}})['then'](respondWithResult(_0x3b40d9,null))[_0xed8e('0x55')](handleError(_0x3b40d9,null));};exports[_0xed8e('0x65')]=function(_0x3cdbaa,_0x19c0cd,_0xd5a94){var _0x214fb1={'raw':![],'where':{}};var _0x313e09={};var _0x10102a={'count':0x0,'rows':[]};return db[_0xed8e('0x3e')][_0xed8e('0x66')]({'where':{'id':_0x3cdbaa[_0xed8e('0x62')]['id']}})['then'](handleEntityNotFound(_0x19c0cd,null))['then'](function(_0x627dcc){if(_0x627dcc){_0x313e09[_0xed8e('0x43')]=_['keys'](db['Disposition'][_0xed8e('0x3f')]);_0x313e09['query']=_[_0xed8e('0x44')](_0x3cdbaa['query']);_0x313e09[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0x313e09['model'],_0x313e09[_0xed8e('0x45')]);_0x214fb1[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0x313e09[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x48')]));_0x214fb1[_0xed8e('0x49')]=_0x214fb1[_0xed8e('0x49')]['length']?_0x214fb1['attributes']:_0x313e09[_0xed8e('0x43')];if(!_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x67')](_0xed8e('0x4b'))){_0x214fb1['limit']=qs['limit'](_0x3cdbaa[_0xed8e('0x45')]['limit']);_0x214fb1[_0xed8e('0x2d')]=qs['offset'](_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x2d')]);}_0x214fb1[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x3cdbaa[_0xed8e('0x45')]['sort']);_0x214fb1[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x3cdbaa[_0xed8e('0x45')],_0x313e09[_0xed8e('0x46')]));_0x214fb1[_0xed8e('0x4e')]['OpenchannelAccountId']=_0x627dcc['id'];if(_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x50')]){_0x214fb1[_0xed8e('0x4e')]=_['merge'](_0x214fb1[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x214fb1[_0xed8e('0x49')],function(_0x1eb26b){var _0x3a7960={};_0x3a7960[_0x1eb26b]={'$like':'%'+_0x3cdbaa['query']['filter']+'%'};return _0x3a7960;})});}_0x214fb1=_[_0xed8e('0x51')]({},_0x214fb1,_0x3cdbaa[_0xed8e('0x59')]);return db[_0xed8e('0x64')][_0xed8e('0x2c')]({'where':_0x214fb1[_0xed8e('0x4e')]})[_0xed8e('0x1e')](function(_0x593a30){_0x10102a['count']=_0x593a30;if(_0x3cdbaa[_0xed8e('0x45')][_0xed8e('0x68')]){_0x214fb1[_0xed8e('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xed8e('0x53')](_0x214fb1);})[_0xed8e('0x1e')](function(_0x1ddfe5){_0x10102a[_0xed8e('0x54')]=_0x1ddfe5;return _0x10102a;});}})[_0xed8e('0x1e')](respondWithFilteredResult(_0x19c0cd,_0x214fb1))['catch'](handleError(_0x19c0cd,null));};exports[_0xed8e('0x69')]=function(_0x2bdbf,_0x12d547,_0x17e6cf){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x2bdbf[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x12d547,null))[_0xed8e('0x1e')](function(_0x46c4cf){if(_0x46c4cf){return _0x46c4cf[_0xed8e('0x69')](_0x2bdbf[_0xed8e('0x45')]['ids']);}})[_0xed8e('0x1e')](respondWithStatusCode(_0x12d547,null))[_0xed8e('0x55')](handleError(_0x12d547,null));};exports[_0xed8e('0x6a')]=function(_0x1d0624,_0x55dbe9,_0x47e11a){if(_0x1d0624[_0xed8e('0x5c')]['id']){delete _0x1d0624[_0xed8e('0x5c')]['id'];}return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x1d0624['params']['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x55dbe9,null))[_0xed8e('0x1e')](function(_0x3ed53d){if(_0x3ed53d){_0x1d0624[_0xed8e('0x5c')][_0xed8e('0x6b')]=_0x3ed53d['id'];return db[_0xed8e('0x6c')][_0xed8e('0x5b')](_0x1d0624[_0xed8e('0x5c')]);}})[_0xed8e('0x1e')](respondWithResult(_0x55dbe9,null))[_0xed8e('0x55')](handleError(_0x55dbe9,null));};exports[_0xed8e('0x6d')]=function(_0x4d8eb1,_0x3b945e,_0x5db453){var _0x151e30={'raw':![],'where':{}};var _0x34bee8={};var _0x2c9a4e={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xed8e('0x66')]({'where':{'id':_0x4d8eb1[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x3b945e,null))[_0xed8e('0x1e')](function(_0xe7a3d1){if(_0xe7a3d1){_0x34bee8[_0xed8e('0x43')]=_['keys'](db['CannedAnswer'][_0xed8e('0x3f')]);_0x34bee8['query']=_[_0xed8e('0x44')](_0x4d8eb1['query']);_0x34bee8[_0xed8e('0x46')]=_['intersection'](_0x34bee8[_0xed8e('0x43')],_0x34bee8[_0xed8e('0x45')]);_0x151e30['attributes']=_[_0xed8e('0x47')](_0x34bee8[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x48')]));_0x151e30[_0xed8e('0x49')]=_0x151e30['attributes']['length']?_0x151e30[_0xed8e('0x49')]:_0x34bee8['model'];if(!_0x4d8eb1[_0xed8e('0x45')]['hasOwnProperty'](_0xed8e('0x4b'))){_0x151e30[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x4d8eb1[_0xed8e('0x45')]['limit']);_0x151e30[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x2d')]);}_0x151e30[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x4d8eb1['query'][_0xed8e('0x4d')]);_0x151e30[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x4d8eb1['query'],_0x34bee8[_0xed8e('0x46')]));_0x151e30[_0xed8e('0x4e')]['OpenchannelAccountId']=_0xe7a3d1['id'];if(_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x50')]){_0x151e30['where']=_[_0xed8e('0x51')](_0x151e30[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x151e30[_0xed8e('0x49')],function(_0x56a6c7){var _0x49170f={};_0x49170f[_0x56a6c7]={'$like':'%'+_0x4d8eb1[_0xed8e('0x45')][_0xed8e('0x50')]+'%'};return _0x49170f;})});}_0x151e30=_[_0xed8e('0x51')]({},_0x151e30,_0x4d8eb1['options']);return db[_0xed8e('0x6c')][_0xed8e('0x2c')]({'where':_0x151e30[_0xed8e('0x4e')]})['then'](function(_0x1ffdf5){_0x2c9a4e[_0xed8e('0x2c')]=_0x1ffdf5;if(_0x4d8eb1['query']['includeAll']){_0x151e30[_0xed8e('0x58')]=[{'all':!![]}];}return db[_0xed8e('0x6c')][_0xed8e('0x53')](_0x151e30);})[_0xed8e('0x1e')](function(_0x5003c3){_0x2c9a4e['rows']=_0x5003c3;return _0x2c9a4e;});}})[_0xed8e('0x1e')](respondWithFilteredResult(_0x3b945e,_0x151e30))[_0xed8e('0x55')](handleError(_0x3b945e,null));};exports['removeAnswers']=function(_0x1850c2,_0x35bd1b,_0x144a5e){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x1850c2[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x35bd1b,null))[_0xed8e('0x1e')](function(_0x4896a0){if(_0x4896a0){return _0x4896a0['removeAnswers'](_0x1850c2['query'][_0xed8e('0x6e')]);}})[_0xed8e('0x1e')](respondWithStatusCode(_0x35bd1b,null))[_0xed8e('0x55')](handleError(_0x35bd1b,null));};exports['notify']=function(_0x1fcb9b,_0x4b8840,_0x1a7be1){var _0x211bbf={'body':_0x1fcb9b[_0xed8e('0x5c')],'channel':_0xed8e('0x6f')};var _0x44f6bf=[];var _0x336238=[];var _0x3bec6c={};var _0x56298c=![];return db[_0xed8e('0x70')][_0xed8e('0x63')]()[_0xed8e('0x1e')](function(_0x17312f){if(!_0x17312f){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))](_0xed8e('0x73'));}_0x44f6bf=_[_0xed8e('0x74')](_[_0xed8e('0x44')](_0x17312f),[_0xed8e('0x75'),_0xed8e('0x76')]);_0x336238=_[_0xed8e('0x74')](_[_0xed8e('0x44')](_0x17312f),[_0xed8e('0x75'),_0xed8e('0x76'),_0xed8e('0x77'),'ListId']);if(_0x1fcb9b['body']['id']){delete _0x1fcb9b[_0xed8e('0x5c')]['id'];}if(_['isNil'](_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')])){throw new db['Sequelize'][(_0xed8e('0x72'))](_0xed8e('0x79'));}if(_['isNil'](_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x5c')])||_0x1fcb9b[_0xed8e('0x5c')]['body']===''){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xed8e('0x7a')](_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x7b')])){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))](_0xed8e('0x7c')+_0x336238);}if(!_['includes'](_0x336238,_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x7b')])){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x336238);}_0x3bec6c[_0x1fcb9b['body'][_0xed8e('0x7b')]]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')];})['then'](function(){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x1fcb9b['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xed8e('0x7d'),'where':_0x3bec6c,'limit':0x1,'order':[['updatedAt',_0xed8e('0x7e')]]}]},{'model':db[_0xed8e('0x7f')],'as':_0xed8e('0x80')}]});})[_0xed8e('0x1e')](handleEntityNotFound(_0x4b8840,null))[_0xed8e('0x1e')](function(_0x1a7009){if(_0x1a7009&&_0x1a7009[_0xed8e('0x81')]){_0x211bbf[_0xed8e('0x82')]=_0x1a7009;_0x211bbf['applications']=_0x1a7009['Applications'];_0x211bbf[_0xed8e('0x83')]=_0x1a7009['List'];_0x211bbf[_0xed8e('0x84')]=_[_0xed8e('0x85')](_0x211bbf[_0xed8e('0x84')],[_0xed8e('0x86')],[_0xed8e('0x87')]);if(_0x211bbf[_0xed8e('0x82')]['Applications']){delete _0x211bbf[_0xed8e('0x82')][_0xed8e('0x80')];}if(_0x211bbf[_0xed8e('0x82')][_0xed8e('0x81')]&&_0x211bbf[_0xed8e('0x82')][_0xed8e('0x81')]['Contacts']['length']){return _0x211bbf[_0xed8e('0x82')][_0xed8e('0x81')]['Contacts'][0x0];}var _0xcde89e=_['defaults'](_0x1fcb9b[_0xed8e('0x5c')],{'firstName':_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')],'ListId':_0x1a7009['ListId']});_0xcde89e[_0x1fcb9b[_0xed8e('0x5c')]['mapKey']]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x78')];return db[_0xed8e('0x70')][_0xed8e('0x5b')](_0xcde89e,{'fields':_0x44f6bf,'raw':!![]});}})[_0xed8e('0x1e')](handleEntityNotFound(_0x4b8840,null))[_0xed8e('0x1e')](function(_0x379218){_0x211bbf['contact']=_0x379218;if(_0x379218){var _0x42711f={'ContactId':_0x379218['id'],'OpenchannelAccountId':_0x1fcb9b['params']['id'],'from':(_0x379218[_0xed8e('0x88')]||'')+'\x20'+(_0x379218[_0xed8e('0x89')]||'')};var _0x3807b0={'OpenchannelAccountId':_0x1fcb9b[_0xed8e('0x62')]['id'],'closed':![]};if(_0x1fcb9b['body'][_0xed8e('0x8a')]){_0x3807b0[_0xed8e('0x8a')]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x8a')];return db[_0xed8e('0x8b')]['find']({'where':_0x3807b0})[_0xed8e('0x1e')](function(_0x32367f){if(_0x32367f){return[_0x32367f,![]];}_0x42711f[_0xed8e('0x8a')]=_0x1fcb9b['body']['threadId'];_0x42711f[_0xed8e('0x8c')]=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x8c')];return db[_0xed8e('0x8b')][_0xed8e('0x5b')](_0x42711f)[_0xed8e('0x1e')](function(_0x388dde){return[_0x388dde,!![]];});});}else{_0x3807b0[_0xed8e('0x8a')]=null;}_0x3807b0[_0xed8e('0x8d')]=_0x379218['id'];return db[_0xed8e('0x8b')][_0xed8e('0x5a')]({'where':_0x3807b0})[_0xed8e('0x1e')](function(_0x40f045){if(_0x40f045){return[_0x40f045,![]];}return db['OpenchannelInteraction'][_0xed8e('0x5b')](_0x42711f)[_0xed8e('0x1e')](function(_0x5b8dd7){return[_0x5b8dd7,!![]];});});}})[_0xed8e('0x8e')](function(_0x4894e8,_0x5efec7){if(_0x4894e8){_0x56298c=_0x5efec7;if(!_0x5efec7){var _0x380bb7={'from':(_0x211bbf[_0xed8e('0x8f')][_0xed8e('0x88')]||'')+'\x20'+(_0x211bbf[_0xed8e('0x8f')][_0xed8e('0x89')]||'')};if(_0x1fcb9b['body'][_0xed8e('0x8a')]&&_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x90')]&&_0x1fcb9b['body']['threadId']!=_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x90')]){_0x380bb7[_0xed8e('0x8a')]=_0x1fcb9b['body'][_0xed8e('0x90')];}return _0x4894e8[_0xed8e('0x34')](_0x380bb7);}else{return _0x4894e8;}}})[_0xed8e('0x1e')](function(_0x9d342e){_0x211bbf[_0xed8e('0x91')]=_0x9d342e[_0xed8e('0x36')]({'plain':!![]});_0x211bbf[_0xed8e('0x91')][_0xed8e('0x92')]=_0x56298c;if(_0x211bbf[_0xed8e('0x91')][_0xed8e('0x92')]){if(_0x211bbf[_0xed8e('0x82')][_0xed8e('0x93')]){_0x211bbf[_0xed8e('0x84')][_0xed8e('0x94')]({'id':0x0,'priority':_0x211bbf[_0xed8e('0x84')][_0xed8e('0x4a')]+0x1,'app':_0xed8e('0x95'),'appdata':_0xed8e('0x96'),'interval':_0xed8e('0x97')});}}return db[_0xed8e('0x98')][_0xed8e('0x5b')]({'body':_0x1fcb9b['body'][_0xed8e('0x5c')],'OpenchannelAccountId':_0x1fcb9b['params']['id'],'OpenchannelInteractionId':_0x9d342e['id'],'direction':'in','ContactId':_0x211bbf[_0xed8e('0x8f')]['id'],'AttachmentId':_0x1fcb9b[_0xed8e('0x5c')][_0xed8e('0x99')]});})['then'](function(_0x5f3e8a){_0x211bbf[_0xed8e('0x25')]=_0x5f3e8a;if(_0x211bbf[_0xed8e('0x91')]['UserId']){return db['User']['find']({'attributes':['id',_0xed8e('0x3a')],'where':{'id':_0x211bbf[_0xed8e('0x91')][_0xed8e('0x9a')]}})[_0xed8e('0x1e')](function(_0x14fa08){if(_0x14fa08){_0x211bbf[_0xed8e('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0xed8e('0x9b'),'appdata':_0x14fa08[_0xed8e('0x3a')]+','+(_0x211bbf[_0xed8e('0x82')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x211bbf[_0xed8e('0x9c')]=![];}return respondWithRpcPromise(_0xed8e('0x9d'),_0xed8e('0x9e'),_0x211bbf);});}return respondWithRpcPromise(_0xed8e('0x9d'),_0xed8e('0x9e'),_0x211bbf);})[_0xed8e('0x1e')](function(_0x3a92fc){respondWithRpcPromise(_0xed8e('0x9f'),'EventManager',{'event':'notify','message':_0x3a92fc},client9002);return _0x3a92fc;})[_0xed8e('0x1e')](respondWithResult(_0x4b8840,null))[_0xed8e('0x55')](handleError(_0x4b8840,null));};exports['addApplications']=function(_0x477812,_0xad91dd){var _0x4d3738=_0x477812[_0xed8e('0x62')]['id'];var _0x340203=_0x477812['body'];var _0x43cb76=0xc8;var _0x3e18c4=null;return db[_0xed8e('0xa0')]['transaction']({'isolationLevel':db[_0xed8e('0xa0')]['Transaction'][_0xed8e('0xa1')][_0xed8e('0xa2')]},function(_0x353aae){return db[_0xed8e('0x3e')][_0xed8e('0x66')]({'where':{'id':_0x4d3738},'transaction':_0x353aae})[_0xed8e('0x1e')](function(_0x1615a7){if(_0x1615a7){return db['OpenchannelApplication'][_0xed8e('0x35')]({'where':{'OpenchannelAccountId':_0x4d3738},'transaction':_0x353aae})[_0xed8e('0x1e')](function(){var _0x101238=_[_0xed8e('0x3d')](_0x340203,function(_0x15aa91){_0x15aa91[_0xed8e('0x6b')]=_0x4d3738;return _0x15aa91;});return db[_0xed8e('0x7f')][_0xed8e('0xa3')](_0x101238,{'transaction':_0x353aae});});}else{_0x43cb76=0x194;_0x3e18c4=[];}});})[_0xed8e('0x1e')](function(){if(_0x43cb76!==0x194){return db[_0xed8e('0x7f')][_0xed8e('0xa4')]({'where':{'OpenchannelAccountId':_0x4d3738},'order':'priority'})[_0xed8e('0x1e')](function(_0x38a251){_0x3e18c4=_0x38a251;});}})[_0xed8e('0x55')](function(_0x6649b9){_0x43cb76=0x1f4;logger[_0xed8e('0x23')](_0x6649b9['stack']);if(_0x6649b9['name']){delete _0x6649b9[_0xed8e('0x3a')];}_0x3e18c4=_0x6649b9;})[_0xed8e('0xa5')](function(){if(_0x3e18c4===null){_0xad91dd[_0xed8e('0x27')](_0x43cb76);}else{if(_0x43cb76===0x1f4){_0xad91dd['status'](_0x43cb76)['send'](_0x3e18c4);}else{_0xad91dd[_0xed8e('0x28')](_0x43cb76)['json'](_0x3e18c4);}}});};exports[_0xed8e('0xa6')]=function(_0x1352b4,_0x15b21a,_0x3ff7ba){var _0x81d053={};var _0xf32e33={};var _0x2dcc8a;var _0x392cea;return db['OpenchannelAccount'][_0xed8e('0x66')]({'where':{'id':_0x1352b4[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x15b21a,null))['then'](function(_0x9f5ed9){if(_0x9f5ed9){_0x2dcc8a=_0x9f5ed9;_0xf32e33[_0xed8e('0x43')]=_[_0xed8e('0x44')](db['OpenchannelApplication'][_0xed8e('0x3f')]);_0xf32e33['query']=_[_0xed8e('0x44')](_0x1352b4[_0xed8e('0x45')]);_0xf32e33[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0xf32e33[_0xed8e('0x43')],_0xf32e33[_0xed8e('0x45')]);_0x81d053[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0xf32e33[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x1352b4['query'][_0xed8e('0x48')]));_0x81d053[_0xed8e('0x49')]=_0x81d053[_0xed8e('0x49')][_0xed8e('0x4a')]?_0x81d053[_0xed8e('0x49')]:_0xf32e33[_0xed8e('0x43')];_0x81d053[_0xed8e('0x4c')]=qs['sort'](_0x1352b4[_0xed8e('0x45')][_0xed8e('0x4d')]);_0x81d053[_0xed8e('0x4e')]=qs['filters'](_[_0xed8e('0x4f')](_0x1352b4[_0xed8e('0x45')],_0xf32e33[_0xed8e('0x46')]));if(_0x1352b4['query'][_0xed8e('0x50')]){_0x81d053[_0xed8e('0x4e')]=_[_0xed8e('0x51')](_0x81d053[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x81d053['attributes'],function(_0x7caa64){var _0x3964c3={};_0x3964c3[_0x7caa64]={'$like':'%'+_0x1352b4[_0xed8e('0x45')]['filter']+'%'};return _0x3964c3;})});}_0x81d053=_[_0xed8e('0x51')]({},_0x81d053,_0x1352b4[_0xed8e('0x59')]);return _0x2dcc8a[_0xed8e('0xa6')](_0x81d053);}})[_0xed8e('0x1e')](function(_0x53ec47){if(_0x53ec47){_0x392cea=_0x53ec47['length'];if(!_0x1352b4[_0xed8e('0x45')]['hasOwnProperty']('nolimit')){_0x81d053[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x1352b4[_0xed8e('0x45')][_0xed8e('0x2b')]);_0x81d053[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x1352b4[_0xed8e('0x45')][_0xed8e('0x2d')]);}return _0x2dcc8a['getApplications'](_0x81d053);}})[_0xed8e('0x1e')](function(_0x59d438){if(_0x59d438){return _0x59d438?{'count':_0x392cea,'rows':_0x59d438}:null;}})[_0xed8e('0x1e')](respondWithResult(_0x15b21a,null))[_0xed8e('0x55')](handleError(_0x15b21a,null));};exports[_0xed8e('0xa7')]=function(_0x2837c6,_0x90e8e2,_0x4570a6){var _0x369872={'raw':![],'where':{}};var _0x248826={};var _0x4f275d={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xed8e('0x66')]({'where':{'id':_0x2837c6[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x90e8e2,null))['then'](function(_0x56e210){if(_0x56e210){_0x248826[_0xed8e('0x43')]=_[_0xed8e('0x44')](db[_0xed8e('0x8b')][_0xed8e('0x3f')]);_0x248826['query']=_[_0xed8e('0x44')](_0x2837c6['query']);_0x248826[_0xed8e('0x46')]=_['intersection'](_0x248826[_0xed8e('0x43')],_0x248826[_0xed8e('0x45')]);_0x369872[_0xed8e('0x49')]=_[_0xed8e('0x47')](_0x248826[_0xed8e('0x43')],qs['fields'](_0x2837c6[_0xed8e('0x45')][_0xed8e('0x48')]));_0x369872['attributes']=_0x369872[_0xed8e('0x49')]['length']?_0x369872[_0xed8e('0x49')]:_0x248826[_0xed8e('0x43')];if(!_0x2837c6['query'][_0xed8e('0x67')](_0xed8e('0x4b'))){_0x369872[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x2837c6['query'][_0xed8e('0x2b')]);_0x369872[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x2837c6[_0xed8e('0x45')][_0xed8e('0x2d')]);}_0x369872[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x2837c6[_0xed8e('0x45')][_0xed8e('0x4d')]);_0x369872['where']=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x2837c6[_0xed8e('0x45')],_0x248826[_0xed8e('0x46')]));_0x369872[_0xed8e('0x4e')][_0xed8e('0x6b')]=_0x56e210['id'];if(_0x2837c6[_0xed8e('0x45')][_0xed8e('0x50')]){_0x369872['where']=_['merge'](_0x369872[_0xed8e('0x4e')],{'$or':_['map'](_0x369872[_0xed8e('0x49')],function(_0x5c35ef){var _0x145b1f={};_0x145b1f[_0x5c35ef]={'$like':'%'+_0x2837c6[_0xed8e('0x45')][_0xed8e('0x50')]+'%'};return _0x145b1f;})});}_0x369872=_['merge']({},_0x369872,_0x2837c6[_0xed8e('0x59')]);return db[_0xed8e('0x8b')][_0xed8e('0x2c')]({'where':_0x369872[_0xed8e('0x4e')]})['then'](function(_0x57a39a){_0x4f275d[_0xed8e('0x2c')]=_0x57a39a;if(_0x2837c6[_0xed8e('0x45')][_0xed8e('0x68')]){_0x369872[_0xed8e('0x58')]=[{'model':db[_0xed8e('0x70')],'as':'Contact','required':![]},{'model':db[_0xed8e('0xa8')],'as':_0xed8e('0xa9'),'attributes':[_0xed8e('0x3a'),_0xed8e('0xaa'),_0xed8e('0xab')],'required':![]},{'model':db['Tag'],'as':_0xed8e('0xac'),'attributes':['id',_0xed8e('0x3a'),_0xed8e('0xad')],'where':_0x2837c6[_0xed8e('0x45')][_0xed8e('0xae')]?{'id':_0x2837c6[_0xed8e('0x45')]['tag']}:undefined,'required':_0x2837c6[_0xed8e('0x45')][_0xed8e('0xae')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xed8e('0x53')](_0x369872);})['then'](function(_0x33d032){_0x4f275d['rows']=_0x33d032;return _0x4f275d;});}})[_0xed8e('0x1e')](respondWithFilteredResult(_0x90e8e2,_0x369872))[_0xed8e('0x55')](handleError(_0x90e8e2,null));};exports['addAgents']=function(_0x576387,_0x3729fb,_0x4e353a){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x576387[_0xed8e('0x62')]['id']}})['then'](handleEntityNotFound(_0x3729fb,null))[_0xed8e('0x1e')](function(_0x1d2bdc){if(_0x1d2bdc){return _0x1d2bdc[_0xed8e('0xaf')](_0x576387[_0xed8e('0x5c')][_0xed8e('0x6e')],_['omit'](_0x576387[_0xed8e('0x5c')],['ids','id'])||{})[_0xed8e('0x8e')](function(_0x37e59f){for(var _0x57c0d8=0x0;_0x57c0d8<_0x576387['body']['ids'][_0xed8e('0x4a')];_0x57c0d8+=0x1){socket[_0xed8e('0xb0')](_0xed8e('0xb1'),{'UserId':Number(_0x576387[_0xed8e('0x5c')][_0xed8e('0x6e')][_0x57c0d8]),'OpenchannelAccountId':Number(_0x576387[_0xed8e('0x62')]['id'])});}return _0x37e59f;});}})[_0xed8e('0x1e')](respondWithResult(_0x3729fb,null))[_0xed8e('0x55')](handleError(_0x3729fb,null));};exports[_0xed8e('0xb2')]=function(_0x15d584,_0x2e20bb,_0x33b3e7){return db[_0xed8e('0x3e')][_0xed8e('0x5a')]({'where':{'id':_0x15d584[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x2e20bb,null))[_0xed8e('0x1e')](function(_0x361827){if(_0x361827){return _0x361827[_0xed8e('0xb2')](_0x15d584[_0xed8e('0x45')]['ids'])[_0xed8e('0x1e')](function(){if(_['isArray'](_0x15d584[_0xed8e('0x45')]['ids'])){for(var _0xe8e6c8=0x0;_0xe8e6c8<_0x15d584['query'][_0xed8e('0x6e')][_0xed8e('0x4a')];_0xe8e6c8+=0x1){socket[_0xed8e('0xb0')]('userOpenchannelAccount:remove',{'UserId':Number(_0x15d584['query'][_0xed8e('0x6e')][_0xe8e6c8]),'OpenchannelAccountId':Number(_0x15d584['params']['id'])});}}else{socket[_0xed8e('0xb0')](_0xed8e('0xb3'),{'UserId':Number(_0x15d584[_0xed8e('0x45')][_0xed8e('0x6e')]),'OpenchannelAccountId':Number(_0x15d584[_0xed8e('0x62')]['id'])});}});}})[_0xed8e('0x1e')](respondWithStatusCode(_0x2e20bb,null))[_0xed8e('0x55')](handleError(_0x2e20bb,null));};exports[_0xed8e('0xb4')]=function(_0x2c86e8,_0x397b5e,_0x36bcbb){var _0x46eafa={};var _0x1ee1d0={};var _0x3b272c;var _0x5742f6;return db[_0xed8e('0x3e')]['findOne']({'where':{'id':_0x2c86e8[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x397b5e,null))[_0xed8e('0x1e')](function(_0x510b9d){if(_0x510b9d){_0x3b272c=_0x510b9d;_0x1ee1d0[_0xed8e('0x43')]=_[_0xed8e('0x44')](db[_0xed8e('0xa8')]['rawAttributes']);_0x1ee1d0[_0xed8e('0x45')]=_[_0xed8e('0x44')](_0x2c86e8[_0xed8e('0x45')]);_0x1ee1d0[_0xed8e('0x46')]=_[_0xed8e('0x47')](_0x1ee1d0[_0xed8e('0x43')],_0x1ee1d0[_0xed8e('0x45')]);_0x46eafa['attributes']=_['intersection'](_0x1ee1d0[_0xed8e('0x43')],qs[_0xed8e('0x48')](_0x2c86e8[_0xed8e('0x45')]['fields']));_0x46eafa['attributes']=_0x46eafa[_0xed8e('0x49')]['length']?_0x46eafa['attributes']:_0x1ee1d0['model'];_0x46eafa[_0xed8e('0x4c')]=qs[_0xed8e('0x4d')](_0x2c86e8[_0xed8e('0x45')]['sort']);_0x46eafa[_0xed8e('0x4e')]=qs[_0xed8e('0x46')](_[_0xed8e('0x4f')](_0x2c86e8[_0xed8e('0x45')],_0x1ee1d0['filters']));if(_0x2c86e8[_0xed8e('0x45')][_0xed8e('0x50')]){_0x46eafa[_0xed8e('0x4e')]=_[_0xed8e('0x51')](_0x46eafa[_0xed8e('0x4e')],{'$or':_[_0xed8e('0x3d')](_0x46eafa[_0xed8e('0x49')],function(_0x1bb460){var _0x105f5e={};_0x105f5e[_0x1bb460]={'$like':'%'+_0x2c86e8['query']['filter']+'%'};return _0x105f5e;})});}_0x46eafa=_[_0xed8e('0x51')]({},_0x46eafa,_0x2c86e8[_0xed8e('0x59')]);return _0x3b272c[_0xed8e('0xb4')](_0x46eafa);}})['then'](function(_0x5d7adf){if(_0x5d7adf){_0x5742f6=_0x5d7adf[_0xed8e('0x4a')];if(!_0x2c86e8[_0xed8e('0x45')][_0xed8e('0x67')](_0xed8e('0x4b'))){_0x46eafa[_0xed8e('0x2b')]=qs[_0xed8e('0x2b')](_0x2c86e8['query'][_0xed8e('0x2b')]);_0x46eafa[_0xed8e('0x2d')]=qs[_0xed8e('0x2d')](_0x2c86e8[_0xed8e('0x45')]['offset']);}return _0x3b272c[_0xed8e('0xb4')](_0x46eafa);}})[_0xed8e('0x1e')](function(_0x110f23){if(_0x110f23){return _0x110f23?{'count':_0x5742f6,'rows':_0x110f23}:null;}})[_0xed8e('0x1e')](respondWithResult(_0x397b5e,null))[_0xed8e('0x55')](handleError(_0x397b5e,null));};exports[_0xed8e('0xb5')]=function(_0x171a29,_0x348e1c,_0x55eef3){var _0x343abc,_0x511174,_0x26b17a;if(_['isNil'](_0x171a29['body'][_0xed8e('0x5c')])||_0x171a29[_0xed8e('0x5c')][_0xed8e('0x5c')]===''){throw new db[(_0xed8e('0x71'))][(_0xed8e('0x72'))](_0xed8e('0xb6'));}if(_[_0xed8e('0x7a')](_0x171a29[_0xed8e('0x5c')]['to'])){}_0x343abc=_0x171a29[_0xed8e('0x5c')]['to'];return db[_0xed8e('0x3e')]['findOne']({'where':{'id':_0x171a29[_0xed8e('0x62')]['id']}})[_0xed8e('0x1e')](handleEntityNotFound(_0x348e1c,null))['then'](function(_0x3461e0){if(_0x3461e0){return db[_0xed8e('0x3e')]['find']({'where':{'id':_0x3461e0['id']},'include':[{'model':db[_0xed8e('0xb7')],'as':'List','include':[{'model':db[_0xed8e('0x70')],'as':_0xed8e('0x7d'),'where':{[_0x3461e0[_0xed8e('0x7b')]]:_0x343abc},'limit':0x1,'order':[[_0xed8e('0x76'),_0xed8e('0x7e')]]}]}]})[_0xed8e('0x1e')](handleEntityNotFound(_0x348e1c,null))[_0xed8e('0x1e')](function(_0x2b565c){if(_0x2b565c&&_0x2b565c[_0xed8e('0x81')]){_0x511174=_0x2b565c[_0xed8e('0x36')]({'plain':!![]});if(_0x511174[_0xed8e('0x81')]&&_0x511174[_0xed8e('0x81')][_0xed8e('0x7d')][_0xed8e('0x4a')]){return _0x511174['List'][_0xed8e('0x7d')][0x0];}return db[_0xed8e('0x70')][_0xed8e('0x5b')](_[_0xed8e('0xb8')](_0x171a29[_0xed8e('0x5c')],{'firstName':_0x343abc,[_0x2b565c[_0xed8e('0x7b')]]:_0x343abc,'phone':_0x343abc,'ListId':_0x511174[_0xed8e('0xb9')]}));}})[_0xed8e('0x1e')](handleEntityNotFound(_0x348e1c,null))['then'](function(_0x2206bc){if(_0x2206bc){_0x26b17a=_0x2206bc;return db[_0xed8e('0x8b')][_0xed8e('0x5a')]({'where':{'ContactId':_0x26b17a['id'],'closed':![],'OpenchannelAccountId':_0x511174['id']}})[_0xed8e('0x1e')](function(_0x1228a6){if(_0x1228a6){return[_0x1228a6,![]];}return db[_0xed8e('0x8b')][_0xed8e('0x5b')]({'UserId':_0x171a29['user']['id'],'ContactId':_0x26b17a['id'],'OpenchannelAccountId':_0x511174['id'],'lastMsgDirection':'out','firstMsgDirection':_0xed8e('0xba'),'Messages':[_[_0xed8e('0x51')](_0x171a29['body'],{'read':![],'body':_0x171a29[_0xed8e('0x5c')][_0xed8e('0x5c')],'OpenchannelAccountId':_0x511174['id'],'UserId':_0x171a29[_0xed8e('0x5d')]['id'],'ContactId':_0x26b17a['id']})]},{'include':[{'model':db[_0xed8e('0x98')],'as':_0xed8e('0xbb')}]})[_0xed8e('0x1e')](function(_0x40819a){return[_0x40819a,!![]];});});}})['spread'](function(_0x3f8d83,_0x13cfab){if(_0x13cfab){return _0x3f8d83;}return db[_0xed8e('0x98')][_0xed8e('0x5b')](_[_0xed8e('0x51')](_0x171a29[_0xed8e('0x5c')],{'read':![],'body':_0x171a29[_0xed8e('0x5c')][_0xed8e('0x5c')],'OpenchannelAccountId':_0x511174['id'],'OpenchannelInteractionId':_0x3f8d83['id'],'UserId':_0x171a29[_0xed8e('0x5d')]['id'],'ContactId':_0x26b17a['id']}))['then'](function(_0x485dd8){_0x3f8d83['dataValues'][_0xed8e('0xbb')]=[];_0x3f8d83[_0xed8e('0xbc')][_0xed8e('0xbb')][_0xed8e('0x94')](_0x485dd8[_0xed8e('0xbc')]);return _0x3f8d83;});});}})['then'](respondWithResult(_0x348e1c,null))['catch'](handleError(_0x348e1c,null));};
\ No newline at end of file
+var _0xd863=['asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','update','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','priority'];(function(_0x7e122b,_0x4665bd){var _0x5558c7=function(_0x22daa4){while(--_0x22daa4){_0x7e122b['push'](_0x7e122b['shift']());}};_0x5558c7(++_0x4665bd);}(_0xd863,0x1c7));var _0x3d86=function(_0xeae1a,_0x18b5cb){_0xeae1a=_0xeae1a-0x0;var _0x56573a=_0xd863[_0xeae1a];return _0x56573a;};'use strict';var emlformat=require(_0x3d86('0x0'));var rimraf=require(_0x3d86('0x1'));var zipdir=require(_0x3d86('0x2'));var jsonpatch=require(_0x3d86('0x3'));var rp=require(_0x3d86('0x4'));var moment=require('moment');var BPromise=require(_0x3d86('0x5'));var Mustache=require(_0x3d86('0x6'));var util=require(_0x3d86('0x7'));var path=require(_0x3d86('0x8'));var sox=require('sox');var csv=require(_0x3d86('0x9'));var ejs=require(_0x3d86('0xa'));var fs=require('fs');var fs_extra=require(_0x3d86('0xb'));var _=require(_0x3d86('0xc'));var squel=require(_0x3d86('0xd'));var crypto=require(_0x3d86('0xe'));var jsforce=require(_0x3d86('0xf'));var deskjs=require(_0x3d86('0x10'));var toCsv=require(_0x3d86('0x9'));var querystring=require(_0x3d86('0x11'));var Papa=require(_0x3d86('0x12'));var Redis=require(_0x3d86('0x13'));var authService=require(_0x3d86('0x14'));var qs=require(_0x3d86('0x15'));var as=require(_0x3d86('0x16'));var hardwareService=require(_0x3d86('0x17'));var logger=require('../../config/logger')(_0x3d86('0x18'));var utils=require(_0x3d86('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x3d86('0x1a'));var db=require(_0x3d86('0x1b'))['db'];config[_0x3d86('0x1c')]=_[_0x3d86('0x1d')](config[_0x3d86('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d86('0x1e'))(new Redis(config[_0x3d86('0x1c')]));require(_0x3d86('0x1f'))[_0x3d86('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d86('0x21')][_0x3d86('0x22')]({'port':0x232c});var client9002=jayson[_0x3d86('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8ae3,_0x22c597,_0x15fb30,_0x2e81b2){return new BPromise(function(_0x19505e,_0x52c6cd){var _0x3216b2=_0x2e81b2||client;return _0x3216b2[_0x3d86('0x23')](_0x4a8ae3,_0x15fb30)['then'](function(_0x4ae735){logger[_0x3d86('0x24')](_0x3d86('0x25'),_0x22c597,'request\x20sent');logger['debug'](_0x3d86('0x26'),_0x22c597,_0x3d86('0x27'),JSON['stringify'](_0x4ae735));if(_0x4ae735[_0x3d86('0x28')]){if(_0x4ae735[_0x3d86('0x28')][_0x3d86('0x29')]===0x1f4){logger[_0x3d86('0x28')](_0x3d86('0x25'),_0x22c597,_0x4ae735[_0x3d86('0x28')]['message']);return _0x52c6cd(_0x4ae735['error'][_0x3d86('0x2a')]);}logger[_0x3d86('0x28')](_0x3d86('0x25'),_0x22c597,_0x4ae735[_0x3d86('0x28')][_0x3d86('0x2a')]);return _0x19505e(_0x4ae735[_0x3d86('0x28')][_0x3d86('0x2a')]);}else{logger[_0x3d86('0x24')](_0x3d86('0x25'),_0x22c597,_0x3d86('0x27'));_0x19505e(_0x4ae735[_0x3d86('0x2b')][_0x3d86('0x2a')]);}})[_0x3d86('0x2c')](function(_0x1d1899){logger[_0x3d86('0x28')](_0x3d86('0x25'),_0x22c597,_0x1d1899);_0x52c6cd(_0x1d1899);});});}function respondWithStatusCode(_0x496f19,_0x4d2255){_0x4d2255=_0x4d2255||0xcc;return function(_0x28a233){if(_0x28a233){return _0x496f19[_0x3d86('0x2d')](_0x4d2255);}return _0x496f19[_0x3d86('0x2e')](_0x4d2255)[_0x3d86('0x2f')]();};}function respondWithResult(_0x30407f,_0x45cf57){_0x45cf57=_0x45cf57||0xc8;return function(_0x10cf57){if(_0x10cf57){return _0x30407f[_0x3d86('0x2e')](_0x45cf57)[_0x3d86('0x30')](_0x10cf57);}};}function respondWithFilteredResult(_0x1e5b1f,_0x5c8d75){return function(_0x44fd02){if(_0x44fd02){var _0x520730=typeof _0x5c8d75['offset']===_0x3d86('0x31')&&typeof _0x5c8d75[_0x3d86('0x32')]===_0x3d86('0x31');var _0x32a671=_0x44fd02['count'];var _0x386bea=_0x520730?0x0:_0x5c8d75['offset'];var _0x307652=_0x520730?_0x44fd02[_0x3d86('0x33')]:_0x5c8d75[_0x3d86('0x34')]+_0x5c8d75[_0x3d86('0x32')];var _0x92b3f7;if(_0x307652>=_0x32a671){_0x307652=_0x32a671;_0x92b3f7=0xc8;}else{_0x92b3f7=0xce;}_0x1e5b1f[_0x3d86('0x2e')](_0x92b3f7);return _0x1e5b1f[_0x3d86('0x35')](_0x3d86('0x36'),_0x386bea+'-'+_0x307652+'/'+_0x32a671)[_0x3d86('0x30')](_0x44fd02);}return null;};}function patchUpdates(_0x360328){return function(_0x1a4fae){try{jsonpatch[_0x3d86('0x37')](_0x1a4fae,_0x360328,!![]);}catch(_0x356acc){return BPromise[_0x3d86('0x38')](_0x356acc);}return _0x1a4fae[_0x3d86('0x39')]();};}function saveUpdates(_0x47e133,_0x2f7697){return function(_0xd5c301){if(_0xd5c301){return _0xd5c301['update'](_0x47e133)[_0x3d86('0x3a')](function(_0x585ff0){return _0x585ff0;});}return null;};}function removeEntity(_0x61cfb2,_0x5bc300){return function(_0x3db8a2){if(_0x3db8a2){return _0x3db8a2[_0x3d86('0x3b')]()[_0x3d86('0x3a')](function(){var _0x3970b3=_0x3db8a2[_0x3d86('0x3c')]({'plain':!![]});var _0x4016f2=_0x3d86('0x3d');return db[_0x3d86('0x3e')][_0x3d86('0x3b')]({'where':{'type':_0x4016f2,'resourceId':_0x3970b3['id']}})[_0x3d86('0x3a')](function(){return _0x3db8a2;});})[_0x3d86('0x3a')](function(){_0x61cfb2[_0x3d86('0x2e')](0xcc)[_0x3d86('0x2f')]();});}};}function handleEntityNotFound(_0x446cfc,_0x3f5201){return function(_0x56e12c){if(!_0x56e12c){_0x446cfc[_0x3d86('0x2d')](0x194);}return _0x56e12c;};}function handleError(_0x2d1758,_0x3cc3c3){_0x3cc3c3=_0x3cc3c3||0x1f4;return function(_0x1a7abb){logger[_0x3d86('0x28')](_0x1a7abb[_0x3d86('0x3f')]);if(_0x1a7abb[_0x3d86('0x40')]){delete _0x1a7abb['name'];}_0x2d1758[_0x3d86('0x2e')](_0x3cc3c3)[_0x3d86('0x41')](_0x1a7abb);};}exports[_0x3d86('0x42')]=function(_0x1d1979,_0x1cdf6e){var _0x2bb53f={'include':[{'model':db[_0x3d86('0x43')],'as':_0x3d86('0x44')}]},_0x13231d={},_0x76dc01={'count':0x0,'rows':[]};var _0x2dc617=_[_0x3d86('0x45')](db[_0x3d86('0x46')][_0x3d86('0x47')],function(_0x36d181){return{'name':_0x36d181['fieldName'],'type':_0x36d181['type'][_0x3d86('0x48')]};});_0x13231d['model']=_['map'](_0x2dc617,_0x3d86('0x40'));_0x13231d[_0x3d86('0x49')]=_[_0x3d86('0x4a')](_0x1d1979['query']);_0x13231d[_0x3d86('0x4b')]=_['intersection'](_0x13231d[_0x3d86('0x4c')],_0x13231d[_0x3d86('0x49')]);_0x2bb53f['attributes']=_[_0x3d86('0x4d')](_0x13231d[_0x3d86('0x4c')],qs[_0x3d86('0x4e')](_0x1d1979[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x2bb53f['attributes']=_0x2bb53f[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x2bb53f[_0x3d86('0x4f')]:_0x13231d[_0x3d86('0x4c')];if(!_0x1d1979[_0x3d86('0x49')][_0x3d86('0x51')](_0x3d86('0x52'))){_0x2bb53f[_0x3d86('0x32')]=qs[_0x3d86('0x32')](_0x1d1979[_0x3d86('0x49')]['limit']);_0x2bb53f[_0x3d86('0x34')]=qs[_0x3d86('0x34')](_0x1d1979[_0x3d86('0x49')][_0x3d86('0x34')]);}_0x2bb53f[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x1d1979[_0x3d86('0x49')][_0x3d86('0x54')]);_0x2bb53f[_0x3d86('0x55')]=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x1d1979[_0x3d86('0x49')],_0x13231d[_0x3d86('0x4b')]),_0x2dc617);if(_0x1d1979[_0x3d86('0x49')][_0x3d86('0x57')]){_0x2bb53f[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x2bb53f['where'],{'$or':_['map'](_0x2dc617,function(_0x3437f7){if(_0x3437f7[_0x3d86('0x59')]!==_0x3d86('0x5a')){var _0x7764f9={};_0x7764f9[_0x3437f7[_0x3d86('0x40')]]={'$like':'%'+_0x1d1979[_0x3d86('0x49')]['filter']+'%'};return _0x7764f9;}})});}_0x2bb53f=_[_0x3d86('0x58')]({},_0x2bb53f,_0x1d1979[_0x3d86('0x5b')]);var _0x313864={'where':_0x2bb53f[_0x3d86('0x55')]};return db[_0x3d86('0x46')]['count'](_0x313864)[_0x3d86('0x3a')](function(_0x67d1a0){_0x76dc01[_0x3d86('0x33')]=_0x67d1a0;if(_0x1d1979['query'][_0x3d86('0x5c')]){_0x2bb53f[_0x3d86('0x5d')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x3d86('0x5e')](_0x2bb53f);})[_0x3d86('0x3a')](function(_0x2feade){_0x76dc01[_0x3d86('0x5f')]=_0x2feade;return _0x76dc01;})[_0x3d86('0x3a')](respondWithFilteredResult(_0x1cdf6e,_0x2bb53f))['catch'](handleError(_0x1cdf6e,null));};exports[_0x3d86('0x60')]=function(_0x57c4d4,_0x3771bb){var _0x4401f5={'raw':![],'where':{'id':_0x57c4d4['params']['id']},'include':[{'model':db[_0x3d86('0x43')],'as':_0x3d86('0x44')}]},_0x416ea5={};_0x416ea5[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db['OpenchannelAccount'][_0x3d86('0x47')]);_0x416ea5['query']=_[_0x3d86('0x4a')](_0x57c4d4['query']);_0x416ea5[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x416ea5[_0x3d86('0x4c')],_0x416ea5['query']);_0x4401f5[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x416ea5[_0x3d86('0x4c')],qs[_0x3d86('0x4e')](_0x57c4d4[_0x3d86('0x49')]['fields']));_0x4401f5[_0x3d86('0x4f')]=_0x4401f5[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x4401f5[_0x3d86('0x4f')]:_0x416ea5[_0x3d86('0x4c')];if(_0x57c4d4[_0x3d86('0x49')][_0x3d86('0x5c')]){_0x4401f5['include']=[{'all':!![]}];}_0x4401f5=_['merge']({},_0x4401f5,_0x57c4d4[_0x3d86('0x5b')]);return db[_0x3d86('0x46')][_0x3d86('0x61')](_0x4401f5)[_0x3d86('0x3a')](handleEntityNotFound(_0x3771bb,null))[_0x3d86('0x3a')](respondWithResult(_0x3771bb,null))['catch'](handleError(_0x3771bb,null));};exports[_0x3d86('0x62')]=function(_0x2503f9,_0xed6856){return db[_0x3d86('0x46')][_0x3d86('0x62')](_0x2503f9[_0x3d86('0x63')],{})[_0x3d86('0x3a')](function(_0x1f6750){var _0x2be8f3=_0x2503f9['user'][_0x3d86('0x3c')]({'plain':!![]});if(!_0x2be8f3)throw new Error(_0x3d86('0x64'));if(_0x2be8f3['role']===_0x3d86('0x65')){var _0x38697a=_0x1f6750[_0x3d86('0x3c')]({'plain':!![]});var _0x268f2f=_0x3d86('0x3d');return db[_0x3d86('0x66')]['find']({'where':{'name':_0x268f2f,'userProfileId':_0x2be8f3[_0x3d86('0x67')]},'raw':!![]})[_0x3d86('0x3a')](function(_0x37b087){if(_0x37b087&&_0x37b087[_0x3d86('0x68')]===0x0){return db[_0x3d86('0x3e')]['create']({'name':_0x38697a[_0x3d86('0x40')],'resourceId':_0x38697a['id'],'type':_0x37b087[_0x3d86('0x40')],'sectionId':_0x37b087['id']},{})[_0x3d86('0x3a')](function(){return _0x1f6750;});}else{return _0x1f6750;}})[_0x3d86('0x2c')](function(_0xdeddce){logger['error'](_0x3d86('0x69'),_0xdeddce);throw _0xdeddce;});}return _0x1f6750;})[_0x3d86('0x3a')](respondWithResult(_0xed6856,0xc9))[_0x3d86('0x2c')](handleError(_0xed6856,null));};exports['update']=function(_0x4cfdae,_0x4da549){if(_0x4cfdae[_0x3d86('0x63')]['id']){delete _0x4cfdae[_0x3d86('0x63')]['id'];}return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x4cfdae[_0x3d86('0x6a')]['id']},'include':[{'model':db[_0x3d86('0x43')],'as':_0x3d86('0x44')}]})[_0x3d86('0x3a')](handleEntityNotFound(_0x4da549,null))[_0x3d86('0x3a')](saveUpdates(_0x4cfdae[_0x3d86('0x63')],null))[_0x3d86('0x3a')](respondWithResult(_0x4da549,null))[_0x3d86('0x2c')](handleError(_0x4da549,null));};exports['destroy']=function(_0x2a32a7,_0x227cfe){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x2a32a7[_0x3d86('0x6a')]['id']}})['then'](handleEntityNotFound(_0x227cfe,null))[_0x3d86('0x3a')](removeEntity(_0x227cfe,null))[_0x3d86('0x2c')](handleError(_0x227cfe,null));};exports[_0x3d86('0x6b')]=function(_0xf5058e,_0x2cb256){return db[_0x3d86('0x46')][_0x3d86('0x6b')]()[_0x3d86('0x3a')](respondWithResult(_0x2cb256,null))[_0x3d86('0x2c')](handleError(_0x2cb256,null));};exports['addDisposition']=function(_0x3a0536,_0x489453,_0x33cc18){if(_0x3a0536[_0x3d86('0x63')]['id']){delete _0x3a0536[_0x3d86('0x63')]['id'];}return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x3a0536[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x489453,null))['then'](function(_0x4136de){if(_0x4136de){_0x3a0536[_0x3d86('0x63')][_0x3d86('0x6c')]=_0x4136de['id'];return db[_0x3d86('0x6d')]['create'](_0x3a0536['body']);}})[_0x3d86('0x3a')](respondWithResult(_0x489453,null))[_0x3d86('0x2c')](handleError(_0x489453,null));};exports['getDispositions']=function(_0x5310f1,_0x104fc5,_0x46be7e){var _0xd4e5ed={'raw':![],'where':{}};var _0x5e45c2={};var _0x3e485c={'count':0x0,'rows':[]};return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x5310f1[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x104fc5,null))[_0x3d86('0x3a')](function(_0x2a6f3b){if(_0x2a6f3b){_0x5e45c2[_0x3d86('0x4c')]=_['keys'](db[_0x3d86('0x6d')]['rawAttributes']);_0x5e45c2['query']=_[_0x3d86('0x4a')](_0x5310f1[_0x3d86('0x49')]);_0x5e45c2[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x5e45c2[_0x3d86('0x4c')],_0x5e45c2[_0x3d86('0x49')]);_0xd4e5ed[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x5e45c2['model'],qs[_0x3d86('0x4e')](_0x5310f1[_0x3d86('0x49')][_0x3d86('0x4e')]));_0xd4e5ed['attributes']=_0xd4e5ed[_0x3d86('0x4f')][_0x3d86('0x50')]?_0xd4e5ed[_0x3d86('0x4f')]:_0x5e45c2[_0x3d86('0x4c')];if(!_0x5310f1[_0x3d86('0x49')]['hasOwnProperty'](_0x3d86('0x52'))){_0xd4e5ed['limit']=qs[_0x3d86('0x32')](_0x5310f1[_0x3d86('0x49')][_0x3d86('0x32')]);_0xd4e5ed['offset']=qs['offset'](_0x5310f1['query'][_0x3d86('0x34')]);}_0xd4e5ed[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x5310f1[_0x3d86('0x49')][_0x3d86('0x54')]);_0xd4e5ed[_0x3d86('0x55')]=qs['filters'](_[_0x3d86('0x56')](_0x5310f1[_0x3d86('0x49')],_0x5e45c2[_0x3d86('0x4b')]));_0xd4e5ed['where'][_0x3d86('0x6c')]=_0x2a6f3b['id'];if(_0x5310f1[_0x3d86('0x49')][_0x3d86('0x57')]){_0xd4e5ed[_0x3d86('0x55')]=_['merge'](_0xd4e5ed['where'],{'$or':_['map'](_0xd4e5ed[_0x3d86('0x4f')],function(_0x5167e6){var _0x3209d3={};_0x3209d3[_0x5167e6]={'$like':'%'+_0x5310f1['query']['filter']+'%'};return _0x3209d3;})});}_0xd4e5ed=_[_0x3d86('0x58')]({},_0xd4e5ed,_0x5310f1[_0x3d86('0x5b')]);return db[_0x3d86('0x6d')][_0x3d86('0x33')]({'where':_0xd4e5ed['where']})[_0x3d86('0x3a')](function(_0x3c9c37){_0x3e485c[_0x3d86('0x33')]=_0x3c9c37;if(_0x5310f1[_0x3d86('0x49')]['includeAll']){_0xd4e5ed[_0x3d86('0x5d')]=[{'all':!![]}];}return db[_0x3d86('0x6d')]['findAll'](_0xd4e5ed);})[_0x3d86('0x3a')](function(_0x46371f){_0x3e485c[_0x3d86('0x5f')]=_0x46371f;return _0x3e485c;});}})[_0x3d86('0x3a')](respondWithFilteredResult(_0x104fc5,_0xd4e5ed))[_0x3d86('0x2c')](handleError(_0x104fc5,null));};exports[_0x3d86('0x6f')]=function(_0x2251de,_0x332c94,_0x5ec376){return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x2251de['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x332c94,null))[_0x3d86('0x3a')](function(_0x3c4096){if(_0x3c4096){return _0x3c4096[_0x3d86('0x6f')](_0x2251de['query'][_0x3d86('0x70')]);}})[_0x3d86('0x3a')](respondWithStatusCode(_0x332c94,null))[_0x3d86('0x2c')](handleError(_0x332c94,null));};exports[_0x3d86('0x71')]=function(_0x5ef71e,_0x5bd84c,_0x108794){if(_0x5ef71e[_0x3d86('0x63')]['id']){delete _0x5ef71e[_0x3d86('0x63')]['id'];}return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x5ef71e['params']['id']}})['then'](handleEntityNotFound(_0x5bd84c,null))['then'](function(_0x3ce839){if(_0x3ce839){_0x5ef71e['body']['OpenchannelAccountId']=_0x3ce839['id'];return db['CannedAnswer'][_0x3d86('0x62')](_0x5ef71e[_0x3d86('0x63')]);}})[_0x3d86('0x3a')](respondWithResult(_0x5bd84c,null))['catch'](handleError(_0x5bd84c,null));};exports[_0x3d86('0x72')]=function(_0x6f648c,_0x498971,_0x459a19){var _0x3009d2={'raw':![],'where':{}};var _0x5647da={};var _0x176f02={'count':0x0,'rows':[]};return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x6f648c['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x498971,null))[_0x3d86('0x3a')](function(_0x108792){if(_0x108792){_0x5647da[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db['CannedAnswer']['rawAttributes']);_0x5647da[_0x3d86('0x49')]=_[_0x3d86('0x4a')](_0x6f648c['query']);_0x5647da[_0x3d86('0x4b')]=_['intersection'](_0x5647da[_0x3d86('0x4c')],_0x5647da[_0x3d86('0x49')]);_0x3009d2[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x5647da['model'],qs[_0x3d86('0x4e')](_0x6f648c[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x3009d2[_0x3d86('0x4f')]=_0x3009d2['attributes'][_0x3d86('0x50')]?_0x3009d2[_0x3d86('0x4f')]:_0x5647da[_0x3d86('0x4c')];if(!_0x6f648c[_0x3d86('0x49')]['hasOwnProperty'](_0x3d86('0x52'))){_0x3009d2[_0x3d86('0x32')]=qs['limit'](_0x6f648c[_0x3d86('0x49')]['limit']);_0x3009d2['offset']=qs[_0x3d86('0x34')](_0x6f648c[_0x3d86('0x49')][_0x3d86('0x34')]);}_0x3009d2[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x6f648c[_0x3d86('0x49')]['sort']);_0x3009d2['where']=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x6f648c[_0x3d86('0x49')],_0x5647da[_0x3d86('0x4b')]));_0x3009d2[_0x3d86('0x55')]['OpenchannelAccountId']=_0x108792['id'];if(_0x6f648c['query'][_0x3d86('0x57')]){_0x3009d2[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x3009d2['where'],{'$or':_[_0x3d86('0x45')](_0x3009d2[_0x3d86('0x4f')],function(_0x5e25bf){var _0x1cf430={};_0x1cf430[_0x5e25bf]={'$like':'%'+_0x6f648c[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0x1cf430;})});}_0x3009d2=_[_0x3d86('0x58')]({},_0x3009d2,_0x6f648c[_0x3d86('0x5b')]);return db[_0x3d86('0x73')][_0x3d86('0x33')]({'where':_0x3009d2[_0x3d86('0x55')]})[_0x3d86('0x3a')](function(_0x29ff5d){_0x176f02[_0x3d86('0x33')]=_0x29ff5d;if(_0x6f648c['query'][_0x3d86('0x5c')]){_0x3009d2[_0x3d86('0x5d')]=[{'all':!![]}];}return db[_0x3d86('0x73')][_0x3d86('0x5e')](_0x3009d2);})[_0x3d86('0x3a')](function(_0x431045){_0x176f02[_0x3d86('0x5f')]=_0x431045;return _0x176f02;});}})['then'](respondWithFilteredResult(_0x498971,_0x3009d2))[_0x3d86('0x2c')](handleError(_0x498971,null));};exports[_0x3d86('0x74')]=function(_0x16e2ad,_0x17c1ba,_0x330a9b){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x16e2ad['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x17c1ba,null))[_0x3d86('0x3a')](function(_0x2bed55){if(_0x2bed55){return _0x2bed55[_0x3d86('0x74')](_0x16e2ad[_0x3d86('0x49')][_0x3d86('0x70')]);}})[_0x3d86('0x3a')](respondWithStatusCode(_0x17c1ba,null))[_0x3d86('0x2c')](handleError(_0x17c1ba,null));};exports['notify']=function(_0x1a9e7f,_0x85a338,_0x3e6c5c){var _0x1a6b9d={'body':_0x1a9e7f[_0x3d86('0x63')],'channel':_0x3d86('0x75')};var _0x30961f=[];var _0x2712d8=[];var _0x18e215={};var _0x2d26a2=![];return db[_0x3d86('0x76')]['describe']()[_0x3d86('0x3a')](function(_0x3f999b){if(!_0x3f999b){throw new db[(_0x3d86('0x77'))][(_0x3d86('0x78'))](_0x3d86('0x79'));}_0x30961f=_[_0x3d86('0x7a')](_[_0x3d86('0x4a')](_0x3f999b),[_0x3d86('0x7b'),'updatedAt']);_0x2712d8=_['difference'](_['keys'](_0x3f999b),['createdAt',_0x3d86('0x7c'),_0x3d86('0x7d'),_0x3d86('0x7e')]);if(_0x1a9e7f[_0x3d86('0x63')]['id']){delete _0x1a9e7f[_0x3d86('0x63')]['id'];}if(_[_0x3d86('0x7f')](_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x80')])){throw new db[(_0x3d86('0x77'))]['ValidationError'](_0x3d86('0x81'));}if(_[_0x3d86('0x7f')](_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x63')])||_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x63')]===''){throw new db[(_0x3d86('0x77'))][(_0x3d86('0x78'))](_0x3d86('0x82'));}if(_[_0x3d86('0x7f')](_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')])){throw new db['Sequelize']['ValidationError'](_0x3d86('0x84')+_0x2712d8);}if(!_['includes'](_0x2712d8,_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')])){throw new db['Sequelize']['ValidationError'](_0x3d86('0x85')+_0x2712d8);}_0x18e215[_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')]]=_0x1a9e7f[_0x3d86('0x63')]['from'];})[_0x3d86('0x3a')](function(){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x1a9e7f[_0x3d86('0x6a')]['id']},'include':[{'model':db['CmList'],'as':_0x3d86('0x86'),'include':[{'model':db[_0x3d86('0x76')],'as':_0x3d86('0x87'),'where':_0x18e215,'limit':0x1,'order':[[_0x3d86('0x7c'),_0x3d86('0x88')]]}]},{'model':db[_0x3d86('0x89')],'as':_0x3d86('0x8a')}]});})[_0x3d86('0x3a')](handleEntityNotFound(_0x85a338,null))[_0x3d86('0x3a')](function(_0x5005e7){if(_0x5005e7&&_0x5005e7[_0x3d86('0x86')]){_0x1a6b9d['account']=_0x5005e7;_0x1a6b9d[_0x3d86('0x8b')]=_0x5005e7['Applications'];_0x1a6b9d[_0x3d86('0x8c')]=_0x5005e7[_0x3d86('0x86')];_0x1a6b9d[_0x3d86('0x8b')]=_['orderBy'](_0x1a6b9d['applications'],[_0x3d86('0x8d')],[_0x3d86('0x8e')]);if(_0x1a6b9d[_0x3d86('0x8f')][_0x3d86('0x8a')]){delete _0x1a6b9d[_0x3d86('0x8f')]['Applications'];}if(_0x1a6b9d['account'][_0x3d86('0x86')]&&_0x1a6b9d[_0x3d86('0x8f')][_0x3d86('0x86')][_0x3d86('0x87')][_0x3d86('0x50')]){return _0x1a6b9d[_0x3d86('0x8f')]['List']['Contacts'][0x0];}var _0xf1e841=_[_0x3d86('0x1d')](_0x1a9e7f[_0x3d86('0x63')],{'firstName':_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x80')],'ListId':_0x5005e7[_0x3d86('0x7e')]});_0xf1e841[_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x83')]]=_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x80')];return db[_0x3d86('0x76')]['create'](_0xf1e841,{'fields':_0x30961f,'raw':!![]});}})[_0x3d86('0x3a')](handleEntityNotFound(_0x85a338,null))[_0x3d86('0x3a')](function(_0x368f2e){_0x1a6b9d[_0x3d86('0x90')]=_0x368f2e;if(_0x368f2e){var _0x2f4d9a={'ContactId':_0x368f2e['id'],'OpenchannelAccountId':_0x1a9e7f[_0x3d86('0x6a')]['id'],'from':(_0x368f2e[_0x3d86('0x91')]||'')+'\x20'+(_0x368f2e[_0x3d86('0x92')]||'')};var _0x102bcc={'OpenchannelAccountId':_0x1a9e7f[_0x3d86('0x6a')]['id'],'closed':![]};if(_0x1a9e7f[_0x3d86('0x63')]['threadId']){_0x102bcc[_0x3d86('0x93')]=_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x93')];return db[_0x3d86('0x94')][_0x3d86('0x61')]({'where':_0x102bcc})[_0x3d86('0x3a')](function(_0x273b8f){if(_0x273b8f){return[_0x273b8f,![]];}_0x2f4d9a[_0x3d86('0x93')]=_0x1a9e7f[_0x3d86('0x63')]['threadId'];_0x2f4d9a[_0x3d86('0x95')]=_0x1a9e7f['body']['externalUrl'];return db[_0x3d86('0x94')][_0x3d86('0x62')](_0x2f4d9a)['then'](function(_0x356b06){return[_0x356b06,!![]];});});}else{_0x102bcc['threadId']=null;}_0x102bcc[_0x3d86('0x96')]=_0x368f2e['id'];return db[_0x3d86('0x94')][_0x3d86('0x61')]({'where':_0x102bcc})[_0x3d86('0x3a')](function(_0x5896e4){if(_0x5896e4){return[_0x5896e4,![]];}return db[_0x3d86('0x94')][_0x3d86('0x62')](_0x2f4d9a)[_0x3d86('0x3a')](function(_0x18a64c){return[_0x18a64c,!![]];});});}})[_0x3d86('0x97')](function(_0x52f309,_0x3eeb95){if(_0x52f309){_0x2d26a2=_0x3eeb95;if(!_0x3eeb95){var _0x4633a2={'from':(_0x1a6b9d[_0x3d86('0x90')]['firstName']||'')+'\x20'+(_0x1a6b9d[_0x3d86('0x90')][_0x3d86('0x92')]||'')};if(_0x1a9e7f['body'][_0x3d86('0x93')]&&_0x1a9e7f[_0x3d86('0x63')]['messageId']&&_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x93')]!=_0x1a9e7f['body'][_0x3d86('0x98')]){_0x4633a2[_0x3d86('0x93')]=_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0x98')];}return _0x52f309[_0x3d86('0x99')](_0x4633a2);}else{return _0x52f309;}}})[_0x3d86('0x3a')](function(_0x4c25fa){_0x1a6b9d[_0x3d86('0x9a')]=_0x4c25fa[_0x3d86('0x3c')]({'plain':!![]});_0x1a6b9d['interaction'][_0x3d86('0x9b')]=_0x2d26a2;if(_0x1a6b9d[_0x3d86('0x9a')][_0x3d86('0x9b')]){if(_0x1a6b9d['account'][_0x3d86('0x9c')]){_0x1a6b9d['applications']['push']({'id':0x0,'priority':_0x1a6b9d[_0x3d86('0x8b')]['length']+0x1,'app':_0x3d86('0x9d'),'appdata':_0x3d86('0x9e'),'interval':_0x3d86('0x9f')});}}return db[_0x3d86('0xa0')]['create']({'body':_0x1a9e7f[_0x3d86('0x63')]['body'],'OpenchannelAccountId':_0x1a9e7f['params']['id'],'OpenchannelInteractionId':_0x4c25fa['id'],'direction':'in','ContactId':_0x1a6b9d[_0x3d86('0x90')]['id'],'AttachmentId':_0x1a9e7f[_0x3d86('0x63')][_0x3d86('0xa1')]});})[_0x3d86('0x3a')](function(_0xcde7e8){_0x1a6b9d[_0x3d86('0x2a')]=_0xcde7e8;if(_0x1a6b9d['interaction']['UserId']){return db[_0x3d86('0xa2')][_0x3d86('0x61')]({'attributes':['id',_0x3d86('0x40')],'where':{'id':_0x1a6b9d[_0x3d86('0x9a')][_0x3d86('0xa3')]}})[_0x3d86('0x3a')](function(_0x2d746d){if(_0x2d746d){_0x1a6b9d['applications'][_0x3d86('0xa4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2d746d[_0x3d86('0x40')]+','+(_0x1a6b9d[_0x3d86('0x8f')][_0x3d86('0xa5')]||0xa),'interval':'*,*,*,*'});_0x1a6b9d[_0x3d86('0xa6')]=![];}return respondWithRpcPromise(_0x3d86('0xa7'),_0x3d86('0xa8'),_0x1a6b9d);});}return respondWithRpcPromise('Start',_0x3d86('0xa8'),_0x1a6b9d);})[_0x3d86('0x3a')](function(_0x448398){respondWithRpcPromise(_0x3d86('0xa9'),_0x3d86('0xa9'),{'event':_0x3d86('0xaa'),'message':_0x448398},client9002);return _0x448398;})[_0x3d86('0x3a')](respondWithResult(_0x85a338,null))['catch'](handleError(_0x85a338,null));};exports[_0x3d86('0xab')]=function(_0x1a10a2,_0x52cfd0){var _0x1dd729=_0x1a10a2[_0x3d86('0x6a')]['id'];var _0x27af37=_0x1a10a2[_0x3d86('0x63')];var _0x24dc15=0xc8;var _0x549e31=null;return db['sequelize'][_0x3d86('0xac')]({'isolationLevel':db[_0x3d86('0xad')][_0x3d86('0xae')]['ISOLATION_LEVELS'][_0x3d86('0xaf')]},function(_0x37f2ea){return db['OpenchannelAccount'][_0x3d86('0x6e')]({'where':{'id':_0x1dd729},'transaction':_0x37f2ea})['then'](function(_0x4cc811){if(_0x4cc811){return db[_0x3d86('0x89')][_0x3d86('0x3b')]({'where':{'OpenchannelAccountId':_0x1dd729},'transaction':_0x37f2ea})[_0x3d86('0x3a')](function(){var _0x3cf8b9=_[_0x3d86('0x45')](_0x27af37,function(_0x4c27ef){_0x4c27ef[_0x3d86('0x6c')]=_0x1dd729;return _0x4c27ef;});return db[_0x3d86('0x89')][_0x3d86('0xb0')](_0x3cf8b9,{'transaction':_0x37f2ea});});}else{_0x24dc15=0x194;_0x549e31=[];}});})[_0x3d86('0x3a')](function(){if(_0x24dc15!==0x194){return db[_0x3d86('0x89')][_0x3d86('0xb1')]({'where':{'OpenchannelAccountId':_0x1dd729},'order':_0x3d86('0x8d')})[_0x3d86('0x3a')](function(_0x68dd2e){_0x549e31=_0x68dd2e;});}})[_0x3d86('0x2c')](function(_0x30b8e7){_0x24dc15=0x1f4;logger[_0x3d86('0x28')](_0x30b8e7[_0x3d86('0x3f')]);if(_0x30b8e7[_0x3d86('0x40')]){delete _0x30b8e7['name'];}_0x549e31=_0x30b8e7;})[_0x3d86('0xb2')](function(){if(_0x549e31===null){_0x52cfd0['sendStatus'](_0x24dc15);}else{if(_0x24dc15===0x1f4){_0x52cfd0[_0x3d86('0x2e')](_0x24dc15)[_0x3d86('0x41')](_0x549e31);}else{_0x52cfd0[_0x3d86('0x2e')](_0x24dc15)[_0x3d86('0x30')](_0x549e31);}}});};exports[_0x3d86('0xb3')]=function(_0x709714,_0x1bffd6,_0x154984){var _0x5a8a41={};var _0x2636ad={};var _0x560730;var _0x59a8fe;return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x709714['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x1bffd6,null))[_0x3d86('0x3a')](function(_0xb6bc9f){if(_0xb6bc9f){_0x560730=_0xb6bc9f;_0x2636ad[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db[_0x3d86('0x89')][_0x3d86('0x47')]);_0x2636ad['query']=_['keys'](_0x709714['query']);_0x2636ad[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x2636ad['model'],_0x2636ad['query']);_0x5a8a41[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x2636ad[_0x3d86('0x4c')],qs['fields'](_0x709714[_0x3d86('0x49')]['fields']));_0x5a8a41['attributes']=_0x5a8a41[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x5a8a41[_0x3d86('0x4f')]:_0x2636ad[_0x3d86('0x4c')];_0x5a8a41[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x709714[_0x3d86('0x49')][_0x3d86('0x54')]);_0x5a8a41['where']=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x709714[_0x3d86('0x49')],_0x2636ad[_0x3d86('0x4b')]));if(_0x709714[_0x3d86('0x49')]['filter']){_0x5a8a41[_0x3d86('0x55')]=_['merge'](_0x5a8a41['where'],{'$or':_[_0x3d86('0x45')](_0x5a8a41[_0x3d86('0x4f')],function(_0x49b308){var _0x1e3ff2={};_0x1e3ff2[_0x49b308]={'$like':'%'+_0x709714[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0x1e3ff2;})});}_0x5a8a41=_[_0x3d86('0x58')]({},_0x5a8a41,_0x709714[_0x3d86('0x5b')]);return _0x560730[_0x3d86('0xb3')](_0x5a8a41);}})[_0x3d86('0x3a')](function(_0x2fb5e8){if(_0x2fb5e8){_0x59a8fe=_0x2fb5e8[_0x3d86('0x50')];if(!_0x709714['query'][_0x3d86('0x51')]('nolimit')){_0x5a8a41[_0x3d86('0x32')]=qs[_0x3d86('0x32')](_0x709714[_0x3d86('0x49')]['limit']);_0x5a8a41['offset']=qs['offset'](_0x709714['query'][_0x3d86('0x34')]);}return _0x560730[_0x3d86('0xb3')](_0x5a8a41);}})['then'](function(_0x5040f9){if(_0x5040f9){return _0x5040f9?{'count':_0x59a8fe,'rows':_0x5040f9}:null;}})['then'](respondWithResult(_0x1bffd6,null))[_0x3d86('0x2c')](handleError(_0x1bffd6,null));};exports[_0x3d86('0xb4')]=function(_0x2b673e,_0x417420,_0x3c41bd){var _0x3fd491={'raw':![],'where':{}};var _0x5e73f8={};var _0x2f1132={'count':0x0,'rows':[]};return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x2b673e[_0x3d86('0x6a')]['id']}})['then'](handleEntityNotFound(_0x417420,null))[_0x3d86('0x3a')](function(_0x2d8001){if(_0x2d8001){_0x5e73f8['model']=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x5e73f8[_0x3d86('0x49')]=_['keys'](_0x2b673e[_0x3d86('0x49')]);_0x5e73f8[_0x3d86('0x4b')]=_['intersection'](_0x5e73f8[_0x3d86('0x4c')],_0x5e73f8[_0x3d86('0x49')]);_0x3fd491[_0x3d86('0x4f')]=_[_0x3d86('0x4d')](_0x5e73f8[_0x3d86('0x4c')],qs[_0x3d86('0x4e')](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x3fd491[_0x3d86('0x4f')]=_0x3fd491['attributes']['length']?_0x3fd491[_0x3d86('0x4f')]:_0x5e73f8['model'];if(!_0x2b673e[_0x3d86('0x49')][_0x3d86('0x51')]('nolimit')){_0x3fd491['limit']=qs[_0x3d86('0x32')](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x32')]);_0x3fd491[_0x3d86('0x34')]=qs['offset'](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x34')]);}_0x3fd491[_0x3d86('0x53')]=qs[_0x3d86('0x54')](_0x2b673e[_0x3d86('0x49')][_0x3d86('0x54')]);_0x3fd491['where']=qs['filters'](_[_0x3d86('0x56')](_0x2b673e[_0x3d86('0x49')],_0x5e73f8[_0x3d86('0x4b')]));_0x3fd491[_0x3d86('0x55')][_0x3d86('0x6c')]=_0x2d8001['id'];if(_0x2b673e[_0x3d86('0x49')][_0x3d86('0x57')]){_0x3fd491[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x3fd491[_0x3d86('0x55')],{'$or':_[_0x3d86('0x45')](_0x3fd491['attributes'],function(_0x408713){var _0xb9c1a7={};_0xb9c1a7[_0x408713]={'$like':'%'+_0x2b673e[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0xb9c1a7;})});}_0x3fd491=_[_0x3d86('0x58')]({},_0x3fd491,_0x2b673e['options']);return db[_0x3d86('0x94')]['count']({'where':_0x3fd491[_0x3d86('0x55')]})['then'](function(_0x553200){_0x2f1132[_0x3d86('0x33')]=_0x553200;if(_0x2b673e[_0x3d86('0x49')][_0x3d86('0x5c')]){_0x3fd491[_0x3d86('0x5d')]=[{'model':db[_0x3d86('0x76')],'as':_0x3d86('0xb5'),'required':![]},{'model':db['User'],'as':_0x3d86('0xb6'),'attributes':[_0x3d86('0x40'),'fullname','internal'],'required':![]},{'model':db[_0x3d86('0xb7')],'as':_0x3d86('0xb8'),'attributes':['id',_0x3d86('0x40'),_0x3d86('0xb9')],'where':_0x2b673e['query']['tag']?{'id':_0x2b673e[_0x3d86('0x49')][_0x3d86('0xba')]}:undefined,'required':_0x2b673e[_0x3d86('0x49')][_0x3d86('0xba')]?!![]:![]}];}return db[_0x3d86('0x94')][_0x3d86('0x5e')](_0x3fd491);})[_0x3d86('0x3a')](function(_0x5584b9){_0x2f1132[_0x3d86('0x5f')]=_0x5584b9;return _0x2f1132;});}})[_0x3d86('0x3a')](respondWithFilteredResult(_0x417420,_0x3fd491))[_0x3d86('0x2c')](handleError(_0x417420,null));};exports['addAgents']=function(_0x24f674,_0x4c2130,_0x5d1b16){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x24f674[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x4c2130,null))[_0x3d86('0x3a')](function(_0x39b71d){if(_0x39b71d){return _0x39b71d[_0x3d86('0xbb')](_0x24f674['body'][_0x3d86('0x70')],_[_0x3d86('0xbc')](_0x24f674[_0x3d86('0x63')],[_0x3d86('0x70'),'id'])||{})[_0x3d86('0x97')](function(_0x4d65aa){for(var _0x464ce6=0x0;_0x464ce6<_0x24f674[_0x3d86('0x63')]['ids'][_0x3d86('0x50')];_0x464ce6+=0x1){socket[_0x3d86('0xbd')](_0x3d86('0xbe'),{'UserId':Number(_0x24f674[_0x3d86('0x63')][_0x3d86('0x70')][_0x464ce6]),'OpenchannelAccountId':Number(_0x24f674[_0x3d86('0x6a')]['id'])});}return _0x4d65aa;});}})[_0x3d86('0x3a')](respondWithResult(_0x4c2130,null))[_0x3d86('0x2c')](handleError(_0x4c2130,null));};exports[_0x3d86('0xbf')]=function(_0x408e0b,_0x5ae975,_0x1dbe16){return db['OpenchannelAccount'][_0x3d86('0x61')]({'where':{'id':_0x408e0b[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x5ae975,null))[_0x3d86('0x3a')](function(_0x48a567){if(_0x48a567){return _0x48a567['removeAgents'](_0x408e0b['query']['ids'])[_0x3d86('0x3a')](function(){if(_[_0x3d86('0xc0')](_0x408e0b[_0x3d86('0x49')][_0x3d86('0x70')])){for(var _0x449a16=0x0;_0x449a16<_0x408e0b[_0x3d86('0x49')]['ids'][_0x3d86('0x50')];_0x449a16+=0x1){socket[_0x3d86('0xbd')](_0x3d86('0xc1'),{'UserId':Number(_0x408e0b[_0x3d86('0x49')][_0x3d86('0x70')][_0x449a16]),'OpenchannelAccountId':Number(_0x408e0b[_0x3d86('0x6a')]['id'])});}}else{socket[_0x3d86('0xbd')](_0x3d86('0xc1'),{'UserId':Number(_0x408e0b[_0x3d86('0x49')][_0x3d86('0x70')]),'OpenchannelAccountId':Number(_0x408e0b['params']['id'])});}});}})[_0x3d86('0x3a')](respondWithStatusCode(_0x5ae975,null))['catch'](handleError(_0x5ae975,null));};exports[_0x3d86('0xc2')]=function(_0x19b447,_0x34a9db,_0x5c35d4){var _0x25fdcb={};var _0x288da={};var _0x12f74d;var _0x4301fb;return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x19b447['params']['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x34a9db,null))['then'](function(_0x5346df){if(_0x5346df){_0x12f74d=_0x5346df;_0x288da[_0x3d86('0x4c')]=_[_0x3d86('0x4a')](db[_0x3d86('0xa2')][_0x3d86('0x47')]);_0x288da[_0x3d86('0x49')]=_['keys'](_0x19b447['query']);_0x288da[_0x3d86('0x4b')]=_[_0x3d86('0x4d')](_0x288da[_0x3d86('0x4c')],_0x288da[_0x3d86('0x49')]);_0x25fdcb[_0x3d86('0x4f')]=_['intersection'](_0x288da['model'],qs['fields'](_0x19b447[_0x3d86('0x49')][_0x3d86('0x4e')]));_0x25fdcb[_0x3d86('0x4f')]=_0x25fdcb[_0x3d86('0x4f')][_0x3d86('0x50')]?_0x25fdcb[_0x3d86('0x4f')]:_0x288da[_0x3d86('0x4c')];_0x25fdcb[_0x3d86('0x53')]=qs['sort'](_0x19b447[_0x3d86('0x49')][_0x3d86('0x54')]);_0x25fdcb[_0x3d86('0x55')]=qs[_0x3d86('0x4b')](_[_0x3d86('0x56')](_0x19b447[_0x3d86('0x49')],_0x288da[_0x3d86('0x4b')]));if(_0x19b447[_0x3d86('0x49')][_0x3d86('0x57')]){_0x25fdcb[_0x3d86('0x55')]=_[_0x3d86('0x58')](_0x25fdcb['where'],{'$or':_[_0x3d86('0x45')](_0x25fdcb[_0x3d86('0x4f')],function(_0x3b6980){var _0x5600fa={};_0x5600fa[_0x3b6980]={'$like':'%'+_0x19b447[_0x3d86('0x49')][_0x3d86('0x57')]+'%'};return _0x5600fa;})});}_0x25fdcb=_[_0x3d86('0x58')]({},_0x25fdcb,_0x19b447[_0x3d86('0x5b')]);return _0x12f74d['getAgents'](_0x25fdcb);}})['then'](function(_0x19cffd){if(_0x19cffd){_0x4301fb=_0x19cffd['length'];if(!_0x19b447['query'][_0x3d86('0x51')]('nolimit')){_0x25fdcb['limit']=qs[_0x3d86('0x32')](_0x19b447[_0x3d86('0x49')][_0x3d86('0x32')]);_0x25fdcb[_0x3d86('0x34')]=qs[_0x3d86('0x34')](_0x19b447[_0x3d86('0x49')]['offset']);}return _0x12f74d[_0x3d86('0xc2')](_0x25fdcb);}})['then'](function(_0x446d76){if(_0x446d76){return _0x446d76?{'count':_0x4301fb,'rows':_0x446d76}:null;}})[_0x3d86('0x3a')](respondWithResult(_0x34a9db,null))[_0x3d86('0x2c')](handleError(_0x34a9db,null));};exports['send']=function(_0x36bc0e,_0x795dde,_0x1267e0){var _0x24b8bf,_0x3f1a8c,_0x3dd450;if(_[_0x3d86('0x7f')](_0x36bc0e[_0x3d86('0x63')]['body'])||_0x36bc0e['body'][_0x3d86('0x63')]===''){throw new db['Sequelize'][(_0x3d86('0x78'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x36bc0e[_0x3d86('0x63')]['to'])){}_0x24b8bf=_0x36bc0e[_0x3d86('0x63')]['to'];return db[_0x3d86('0x46')][_0x3d86('0x6e')]({'where':{'id':_0x36bc0e[_0x3d86('0x6a')]['id']}})[_0x3d86('0x3a')](handleEntityNotFound(_0x795dde,null))[_0x3d86('0x3a')](function(_0x25ce91){if(_0x25ce91){return db[_0x3d86('0x46')][_0x3d86('0x61')]({'where':{'id':_0x25ce91['id']},'include':[{'model':db[_0x3d86('0xc3')],'as':_0x3d86('0x86'),'include':[{'model':db[_0x3d86('0x76')],'as':'Contacts','where':{[_0x25ce91['mapKey']]:_0x24b8bf},'limit':0x1,'order':[[_0x3d86('0x7c'),_0x3d86('0x88')]]}]}]})[_0x3d86('0x3a')](handleEntityNotFound(_0x795dde,null))[_0x3d86('0x3a')](function(_0x131da8){if(_0x131da8&&_0x131da8['List']){_0x3f1a8c=_0x131da8['get']({'plain':!![]});if(_0x3f1a8c[_0x3d86('0x86')]&&_0x3f1a8c[_0x3d86('0x86')][_0x3d86('0x87')][_0x3d86('0x50')]){return _0x3f1a8c[_0x3d86('0x86')][_0x3d86('0x87')][0x0];}return db[_0x3d86('0x76')]['create'](_['defaults'](_0x36bc0e[_0x3d86('0x63')],{'firstName':_0x24b8bf,[_0x131da8[_0x3d86('0x83')]]:_0x24b8bf,'phone':_0x24b8bf,'ListId':_0x3f1a8c[_0x3d86('0x7e')]}));}})[_0x3d86('0x3a')](handleEntityNotFound(_0x795dde,null))[_0x3d86('0x3a')](function(_0x1b053){if(_0x1b053){_0x3dd450=_0x1b053;return db[_0x3d86('0x94')]['find']({'where':{'ContactId':_0x3dd450['id'],'closed':![],'OpenchannelAccountId':_0x3f1a8c['id']}})[_0x3d86('0x3a')](function(_0x3809fd){if(_0x3809fd){return[_0x3809fd,![]];}return db[_0x3d86('0x94')]['create']({'UserId':_0x36bc0e['user']['id'],'ContactId':_0x3dd450['id'],'OpenchannelAccountId':_0x3f1a8c['id'],'lastMsgDirection':'out','firstMsgDirection':_0x3d86('0xc4'),'Messages':[_[_0x3d86('0x58')](_0x36bc0e[_0x3d86('0x63')],{'read':![],'body':_0x36bc0e['body'][_0x3d86('0x63')],'OpenchannelAccountId':_0x3f1a8c['id'],'UserId':_0x36bc0e[_0x3d86('0x65')]['id'],'ContactId':_0x3dd450['id']})]},{'include':[{'model':db[_0x3d86('0xa0')],'as':_0x3d86('0xc5')}]})[_0x3d86('0x3a')](function(_0x4fd560){return[_0x4fd560,!![]];});});}})['spread'](function(_0x15c05e,_0x32341c){if(_0x32341c){return _0x15c05e;}return db[_0x3d86('0xa0')][_0x3d86('0x62')](_['merge'](_0x36bc0e[_0x3d86('0x63')],{'read':![],'body':_0x36bc0e[_0x3d86('0x63')]['body'],'OpenchannelAccountId':_0x3f1a8c['id'],'OpenchannelInteractionId':_0x15c05e['id'],'UserId':_0x36bc0e[_0x3d86('0x65')]['id'],'ContactId':_0x3dd450['id']}))[_0x3d86('0x3a')](function(_0x2e3828){_0x15c05e[_0x3d86('0xc6')]['Messages']=[];_0x15c05e[_0x3d86('0xc6')][_0x3d86('0xc5')]['push'](_0x2e3828[_0x3d86('0xc6')]);return _0x15c05e;});});}})[_0x3d86('0x3a')](respondWithResult(_0x795dde,null))[_0x3d86('0x2c')](handleError(_0x795dde,null));};
\ No newline at end of file
index c1e5764..a7756b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6324=['hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners','update','emit'];(function(_0x59e1e9,_0x3c3840){var _0x2bd878=function(_0x3c66a3){while(--_0x3c66a3){_0x59e1e9['push'](_0x59e1e9['shift']());}};_0x2bd878(++_0x3c3840);}(_0x6324,0x142));var _0x4632=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x6324[_0x35b7d4];return _0x4e8cee;};'use strict';var EventEmitter=require(_0x4632('0x0'));var OpenchannelAccount=require(_0x4632('0x1'))['db'][_0x4632('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x4632('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4632('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3bea40){return function(_0x54c200,_0x13b218,_0x592e39){OpenchannelAccountEvents[_0x4632('0x5')](_0x3bea40+':'+_0x54c200['id'],_0x54c200);OpenchannelAccountEvents[_0x4632('0x5')](_0x3bea40,_0x54c200);_0x592e39(null);};}for(var e in events){if(events[_0x4632('0x6')](e)){var event=events[e];OpenchannelAccount[_0x4632('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x2dae=['remove','emit','hasOwnProperty','hook','exports','events','OpenchannelAccount','setMaxListeners','save','update'];(function(_0x4143f6,_0x53bb83){var _0x5a7f19=function(_0x57fe20){while(--_0x57fe20){_0x4143f6['push'](_0x4143f6['shift']());}};_0x5a7f19(++_0x53bb83);}(_0x2dae,0xc3));var _0xe2da=function(_0x5d3903,_0x3d6c3e){_0x5d3903=_0x5d3903-0x0;var _0x4b8bc9=_0x2dae[_0x5d3903];return _0x4b8bc9;};'use strict';var EventEmitter=require(_0xe2da('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xe2da('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe2da('0x2')](0x0);var events={'afterCreate':_0xe2da('0x3'),'afterUpdate':_0xe2da('0x4'),'afterDestroy':_0xe2da('0x5')};function emitEvent(_0x481d97){return function(_0x25b9f2,_0x439b5d,_0x77e45e){OpenchannelAccountEvents[_0xe2da('0x6')](_0x481d97+':'+_0x25b9f2['id'],_0x25b9f2);OpenchannelAccountEvents['emit'](_0x481d97,_0x25b9f2);_0x77e45e(null);};}for(var e in events){if(events[_0xe2da('0x7')](e)){var event=events[e];OpenchannelAccount[_0xe2da('0x8')](e,emitEvent(event));}}module[_0xe2da('0x9')]=OpenchannelAccountEvents;
\ No newline at end of file
index a69dcaf..a7a00e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x407270,_0x389e7c){var _0x2f25db=function(_0x5119cd){while(--_0x5119cd){_0x407270['push'](_0x407270['shift']());}};_0x2f25db(++_0x389e7c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x15f411,_0x36d2c2){var _0x507874=function(_0x3a40c7){while(--_0x3a40c7){_0x15f411['push'](_0x15f411['shift']());}};_0x507874(++_0x36d2c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0456f23..91630e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe130=['then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xe130,0x127));var _0x0e13=function(_0x173d17,_0x1617f6){_0x173d17=_0x173d17-0x0;var _0x49abf9=_0xe130[_0x173d17];return _0x49abf9;};'use strict';var _=require(_0x0e13('0x0'));var util=require(_0x0e13('0x1'));var moment=require('moment');var BPromise=require(_0x0e13('0x2'));var rs=require(_0x0e13('0x3'));var fs=require('fs');var Redis=require(_0x0e13('0x4'));var db=require(_0x0e13('0x5'))['db'];var utils=require(_0x0e13('0x6'));var logger=require('../../config/logger')(_0x0e13('0x7'));var config=require(_0x0e13('0x8'));var jayson=require(_0x0e13('0x9'));var client=jayson[_0x0e13('0xa')]['http']({'port':0x232a});config[_0x0e13('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0e13('0xc'))(new Redis(config[_0x0e13('0xb')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x2906e9,_0x124e0d,_0x3aad73){return new BPromise(function(_0x2e385d,_0x53f9a9){return client['request'](_0x2906e9,_0x3aad73)[_0x0e13('0xd')](function(_0x37a04e){logger[_0x0e13('0xe')](_0x0e13('0xf'),_0x124e0d,'request\x20sent');logger[_0x0e13('0x10')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x124e0d,_0x0e13('0x11'),JSON[_0x0e13('0x12')](_0x37a04e));if(_0x37a04e[_0x0e13('0x13')]){if(_0x37a04e[_0x0e13('0x13')][_0x0e13('0x14')]===0x1f4){logger[_0x0e13('0x13')](_0x0e13('0xf'),_0x124e0d,_0x37a04e[_0x0e13('0x13')][_0x0e13('0x15')]);return _0x53f9a9(_0x37a04e['error'][_0x0e13('0x15')]);}logger[_0x0e13('0x13')](_0x0e13('0xf'),_0x124e0d,_0x37a04e[_0x0e13('0x13')][_0x0e13('0x15')]);return _0x2e385d(_0x37a04e[_0x0e13('0x13')]['message']);}else{logger[_0x0e13('0xe')](_0x0e13('0xf'),_0x124e0d,'request\x20sent');_0x2e385d(_0x37a04e['result'][_0x0e13('0x15')]);}})['catch'](function(_0x2063ca){logger['error'](_0x0e13('0xf'),_0x124e0d,_0x2063ca);_0x53f9a9(_0x2063ca);});});}
\ No newline at end of file
+var _0xe605=['jayson/promise','client','http','redis','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a51f2,_0x578f65){var _0x574a7e=function(_0x45ed43){while(--_0x45ed43){_0x4a51f2['push'](_0x4a51f2['shift']());}};_0x574a7e(++_0x578f65);}(_0xe605,0x92));var _0x5e60=function(_0x468d0,_0x49f7cf){_0x468d0=_0x468d0-0x0;var _0x31a0f2=_0xe605[_0x468d0];return _0x31a0f2;};'use strict';var _=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var moment=require('moment');var BPromise=require(_0x5e60('0x2'));var rs=require(_0x5e60('0x3'));var fs=require('fs');var Redis=require(_0x5e60('0x4'));var db=require(_0x5e60('0x5'))['db'];var utils=require(_0x5e60('0x6'));var logger=require(_0x5e60('0x7'))(_0x5e60('0x8'));var config=require(_0x5e60('0x9'));var jayson=require(_0x5e60('0xa'));var client=jayson[_0x5e60('0xb')][_0x5e60('0xc')]({'port':0x232a});config[_0x5e60('0xd')]=_['defaults'](config[_0x5e60('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5e60('0xe'))[_0x5e60('0xf')](socket);function respondWithRpcPromise(_0x150a51,_0x2c5425,_0x331b3e){return new BPromise(function(_0x2cbe4e,_0x56f05a){return client[_0x5e60('0x10')](_0x150a51,_0x331b3e)['then'](function(_0x1d2558){logger[_0x5e60('0x11')](_0x5e60('0x12'),_0x2c5425,'request\x20sent');logger[_0x5e60('0x13')](_0x5e60('0x14'),_0x2c5425,_0x5e60('0x15'),JSON[_0x5e60('0x16')](_0x1d2558));if(_0x1d2558[_0x5e60('0x17')]){if(_0x1d2558[_0x5e60('0x17')]['code']===0x1f4){logger[_0x5e60('0x17')](_0x5e60('0x12'),_0x2c5425,_0x1d2558[_0x5e60('0x17')][_0x5e60('0x18')]);return _0x56f05a(_0x1d2558['error'][_0x5e60('0x18')]);}logger['error'](_0x5e60('0x12'),_0x2c5425,_0x1d2558[_0x5e60('0x17')]['message']);return _0x2cbe4e(_0x1d2558[_0x5e60('0x17')][_0x5e60('0x18')]);}else{logger[_0x5e60('0x11')](_0x5e60('0x12'),_0x2c5425,'request\x20sent');_0x2cbe4e(_0x1d2558[_0x5e60('0x19')][_0x5e60('0x18')]);}})['catch'](function(_0x1fa0f8){logger[_0x5e60('0x17')](_0x5e60('0x12'),_0x2c5425,_0x1fa0f8);_0x56f05a(_0x1fa0f8);});});}
\ No newline at end of file
index 1ec7d0e..6215c25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9090=['remove','update','emit','register','length','./openchannelAccount.events','save'];(function(_0x2d5e39,_0x39b71d){var _0x4260f0=function(_0x37d89f){while(--_0x37d89f){_0x2d5e39['push'](_0x2d5e39['shift']());}};_0x4260f0(++_0x39b71d);}(_0x9090,0x17f));var _0x0909=function(_0x3bf120,_0x58885e){_0x3bf120=_0x3bf120-0x0;var _0x3c92cc=_0x9090[_0x3bf120];return _0x3c92cc;};'use strict';var OpenchannelAccountEvents=require(_0x0909('0x0'));var events=[_0x0909('0x1'),_0x0909('0x2'),_0x0909('0x3')];function createListener(_0x27eba2,_0x5466c8){return function(_0x51923f){_0x5466c8[_0x0909('0x4')](_0x27eba2,_0x51923f);};}function removeListener(_0x289665,_0x29bc19){return function(){OpenchannelAccountEvents['removeListener'](_0x289665,_0x29bc19);};}exports[_0x0909('0x5')]=function(_0x42af40){for(var _0x5317db=0x0,_0x41d8fc=events[_0x0909('0x6')];_0x5317db<_0x41d8fc;_0x5317db++){var _0x32bf48=events[_0x5317db];var _0x1755ee=createListener('openchannelAccount:'+_0x32bf48,_0x42af40);OpenchannelAccountEvents['on'](_0x32bf48,_0x1755ee);}};
\ No newline at end of file
+var _0xf6e8=['removeListener','register','length','openchannelAccount:','save','remove','update'];(function(_0x4ebb6b,_0x5ed2f9){var _0x56de95=function(_0x23d73f){while(--_0x23d73f){_0x4ebb6b['push'](_0x4ebb6b['shift']());}};_0x56de95(++_0x5ed2f9);}(_0xf6e8,0xc1));var _0x8f6e=function(_0x121b8b,_0x3b5324){_0x121b8b=_0x121b8b-0x0;var _0x2c0e41=_0xf6e8[_0x121b8b];return _0x2c0e41;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x8f6e('0x0'),_0x8f6e('0x1'),_0x8f6e('0x2')];function createListener(_0x1a5d5b,_0x3c2632){return function(_0x24d74f){_0x3c2632['emit'](_0x1a5d5b,_0x24d74f);};}function removeListener(_0xac263e,_0x55673a){return function(){OpenchannelAccountEvents[_0x8f6e('0x3')](_0xac263e,_0x55673a);};}exports[_0x8f6e('0x4')]=function(_0x5a5609){for(var _0x7b6df3=0x0,_0x233158=events[_0x8f6e('0x5')];_0x7b6df3<_0x233158;_0x7b6df3++){var _0x71b52c=events[_0x7b6df3];var _0x423ed4=createListener(_0x8f6e('0x6')+_0x71b52c,_0x5a5609);OpenchannelAccountEvents['on'](_0x71b52c,_0x423ed4);}};
\ No newline at end of file
index 9974f4d..952f98a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaae0=['/:id','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index'];(function(_0x3b90bb,_0x24cb38){var _0x45ef92=function(_0x4472bb){while(--_0x4472bb){_0x3b90bb['push'](_0x3b90bb['shift']());}};_0x45ef92(++_0x24cb38);}(_0xaae0,0x72));var _0x0aae=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xaae0[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x0aae('0x0'));var util=require(_0x0aae('0x1'));var path=require(_0x0aae('0x2'));var timeout=require(_0x0aae('0x3'));var express=require('express');var router=express[_0x0aae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0aae('0x5'));var interaction=require(_0x0aae('0x6'));var config=require(_0x0aae('0x7'));var controller=require(_0x0aae('0x8'));router[_0x0aae('0x9')]('/',auth[_0x0aae('0xa')](),controller[_0x0aae('0xb')]);router['get'](_0x0aae('0xc'),auth[_0x0aae('0xa')](),controller['show']);router['post']('/',auth[_0x0aae('0xa')](),controller['create']);router[_0x0aae('0xd')]('/:id',auth[_0x0aae('0xa')](),controller[_0x0aae('0xe')]);router[_0x0aae('0xf')](_0x0aae('0xc'),auth[_0x0aae('0xa')](),controller[_0x0aae('0x10')]);module[_0x0aae('0x11')]=router;
\ No newline at end of file
+var _0x1f8d=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x53ad78,_0x48bdd7){var _0x2d4161=function(_0x17b58c){while(--_0x17b58c){_0x53ad78['push'](_0x53ad78['shift']());}};_0x2d4161(++_0x48bdd7);}(_0x1f8d,0x150));var _0xd1f8=function(_0xe09aaa,_0x410ee9){_0xe09aaa=_0xe09aaa-0x0;var _0x38f145=_0x1f8d[_0xe09aaa];return _0x38f145;};'use strict';var multer=require(_0xd1f8('0x0'));var util=require('util');var path=require(_0xd1f8('0x1'));var timeout=require(_0xd1f8('0x2'));var express=require(_0xd1f8('0x3'));var router=express[_0xd1f8('0x4')]();var fs_extra=require(_0xd1f8('0x5'));var auth=require(_0xd1f8('0x6'));var interaction=require(_0xd1f8('0x7'));var config=require(_0xd1f8('0x8'));var controller=require('./openchannelApplication.controller');router[_0xd1f8('0x9')]('/',auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xb')]);router[_0xd1f8('0x9')](_0xd1f8('0xc'),auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xd')]);router['post']('/',auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xe')]);router['put'](_0xd1f8('0xc'),auth[_0xd1f8('0xa')](),controller[_0xd1f8('0xf')]);router['delete'](_0xd1f8('0xc'),auth['isAuthenticated'](),controller[_0xd1f8('0x10')]);module[_0xd1f8('0x11')]=router;
\ No newline at end of file
index 8820e17..6a689e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02a7=['*,*,*,*','sequelize','INTEGER','STRING','TEXT'];(function(_0x3b2879,_0x4071fa){var _0x4f46f0=function(_0x1dc691){while(--_0x1dc691){_0x3b2879['push'](_0x3b2879['shift']());}};_0x4f46f0(++_0x4071fa);}(_0x02a7,0x12d));var _0x702a=function(_0x46b031,_0x50794c){_0x46b031=_0x46b031-0x0;var _0x59126d=_0x02a7[_0x46b031];return _0x59126d;};'use strict';var Sequelize=require(_0x702a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x702a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x702a('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x702a('0x3')]()},'description':{'type':Sequelize[_0x702a('0x2')]},'interval':{'type':Sequelize[_0x702a('0x2')],'defaultValue':_0x702a('0x4')}};
\ No newline at end of file
+var _0xc698=['INTEGER','STRING','noop','sequelize','exports'];(function(_0x50de95,_0x4ba9bc){var _0x248ce1=function(_0x224fde){while(--_0x224fde){_0x50de95['push'](_0x50de95['shift']());}};_0x248ce1(++_0x4ba9bc);}(_0xc698,0x85));var _0x8c69=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xc698[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x8c69('0x0'));module[_0x8c69('0x1')]={'priority':{'type':Sequelize[_0x8c69('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8c69('0x3')],'allowNull':![],'defaultValue':_0x8c69('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8c69('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index cfe4fb7..be87892 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb93=['squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash'];(function(_0x454130,_0xaef2dd){var _0x4ae1a7=function(_0x2f1a0e){while(--_0x2f1a0e){_0x454130['push'](_0x454130['shift']());}};_0x4ae1a7(++_0xaef2dd);}(_0xbb93,0x171));var _0x3bb9=function(_0x16e229,_0x36a3c4){_0x16e229=_0x16e229-0x0;var _0x509eec=_0xbb93[_0x16e229];return _0x509eec;};'use strict';var emlformat=require(_0x3bb9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bb9('0x1'));var jsonpatch=require(_0x3bb9('0x2'));var rp=require(_0x3bb9('0x3'));var moment=require(_0x3bb9('0x4'));var BPromise=require(_0x3bb9('0x5'));var Mustache=require(_0x3bb9('0x6'));var util=require('util');var path=require(_0x3bb9('0x7'));var sox=require(_0x3bb9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3bb9('0x9'));var _=require(_0x3bb9('0xa'));var squel=require(_0x3bb9('0xb'));var crypto=require(_0x3bb9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3bb9('0xd'));var toCsv=require(_0x3bb9('0xe'));var querystring=require(_0x3bb9('0xf'));var Papa=require(_0x3bb9('0x10'));var Redis=require(_0x3bb9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3bb9('0x12'));var hardwareService=require(_0x3bb9('0x13'));var logger=require(_0x3bb9('0x14'))(_0x3bb9('0x15'));var utils=require(_0x3bb9('0x16'));var config=require(_0x3bb9('0x17'));var licenseUtil=require(_0x3bb9('0x18'));var db=require(_0x3bb9('0x19'))['db'];function respondWithStatusCode(_0x10e4c5,_0x363f7d){_0x363f7d=_0x363f7d||0xcc;return function(_0x29da64){if(_0x29da64){return _0x10e4c5[_0x3bb9('0x1a')](_0x363f7d);}return _0x10e4c5[_0x3bb9('0x1b')](_0x363f7d)[_0x3bb9('0x1c')]();};}function respondWithResult(_0x15d22f,_0x29f75c){_0x29f75c=_0x29f75c||0xc8;return function(_0x16231f){if(_0x16231f){return _0x15d22f[_0x3bb9('0x1b')](_0x29f75c)['json'](_0x16231f);}};}function respondWithFilteredResult(_0x2cbefd,_0x1571f1){return function(_0x5ca1e6){if(_0x5ca1e6){var _0xf86243=typeof _0x1571f1[_0x3bb9('0x1d')]==='undefined'&&typeof _0x1571f1[_0x3bb9('0x1e')]===_0x3bb9('0x1f');var _0x13a597=_0x5ca1e6['count'];var _0x269e8b=_0xf86243?0x0:_0x1571f1[_0x3bb9('0x1d')];var _0x316628=_0xf86243?_0x5ca1e6[_0x3bb9('0x20')]:_0x1571f1['offset']+_0x1571f1['limit'];var _0x51e9c2;if(_0x316628>=_0x13a597){_0x316628=_0x13a597;_0x51e9c2=0xc8;}else{_0x51e9c2=0xce;}_0x2cbefd[_0x3bb9('0x1b')](_0x51e9c2);return _0x2cbefd[_0x3bb9('0x21')](_0x3bb9('0x22'),_0x269e8b+'-'+_0x316628+'/'+_0x13a597)['json'](_0x5ca1e6);}return null;};}function patchUpdates(_0x480e91){return function(_0x6a03b5){try{jsonpatch[_0x3bb9('0x23')](_0x6a03b5,_0x480e91,!![]);}catch(_0x2bfd5e){return BPromise[_0x3bb9('0x24')](_0x2bfd5e);}return _0x6a03b5[_0x3bb9('0x25')]();};}function saveUpdates(_0x56571f,_0x13378a){return function(_0x3abbdb){if(_0x3abbdb){return _0x3abbdb['update'](_0x56571f)['then'](function(_0x20c875){return _0x20c875;});}return null;};}function removeEntity(_0x407028,_0x5eba62){return function(_0x2b072f){if(_0x2b072f){return _0x2b072f[_0x3bb9('0x26')]()['then'](function(){_0x407028[_0x3bb9('0x1b')](0xcc)[_0x3bb9('0x1c')]();});}};}function handleEntityNotFound(_0x2ce9cc,_0x334eb3){return function(_0x3f4b2d){if(!_0x3f4b2d){_0x2ce9cc['sendStatus'](0x194);}return _0x3f4b2d;};}function handleError(_0x3f447f,_0x3ee392){_0x3ee392=_0x3ee392||0x1f4;return function(_0x55ab73){logger['error'](_0x55ab73[_0x3bb9('0x27')]);if(_0x55ab73['name']){delete _0x55ab73[_0x3bb9('0x28')];}_0x3f447f[_0x3bb9('0x1b')](_0x3ee392)[_0x3bb9('0x29')](_0x55ab73);};}exports[_0x3bb9('0x2a')]=function(_0x531ae6,_0x5bad9c){var _0x3a6187={},_0x491285={},_0x1e8eae={'count':0x0,'rows':[]};var _0x2c9a98=_[_0x3bb9('0x2b')](db[_0x3bb9('0x2c')][_0x3bb9('0x2d')],function(_0x4b8d67){return{'name':_0x4b8d67[_0x3bb9('0x2e')],'type':_0x4b8d67[_0x3bb9('0x2f')]['key']};});_0x491285['model']=_[_0x3bb9('0x2b')](_0x2c9a98,'name');_0x491285['query']=_[_0x3bb9('0x30')](_0x531ae6[_0x3bb9('0x31')]);_0x491285[_0x3bb9('0x32')]=_[_0x3bb9('0x33')](_0x491285[_0x3bb9('0x34')],_0x491285[_0x3bb9('0x31')]);_0x3a6187[_0x3bb9('0x35')]=_[_0x3bb9('0x33')](_0x491285[_0x3bb9('0x34')],qs[_0x3bb9('0x36')](_0x531ae6['query']['fields']));_0x3a6187[_0x3bb9('0x35')]=_0x3a6187[_0x3bb9('0x35')][_0x3bb9('0x37')]?_0x3a6187[_0x3bb9('0x35')]:_0x491285['model'];if(!_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x38')]('nolimit')){_0x3a6187[_0x3bb9('0x1e')]=qs[_0x3bb9('0x1e')](_0x531ae6['query'][_0x3bb9('0x1e')]);_0x3a6187[_0x3bb9('0x1d')]=qs['offset'](_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x1d')]);}_0x3a6187[_0x3bb9('0x39')]=qs[_0x3bb9('0x3a')](_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x3a')]);_0x3a6187[_0x3bb9('0x3b')]=qs[_0x3bb9('0x32')](_['pick'](_0x531ae6[_0x3bb9('0x31')],_0x491285[_0x3bb9('0x32')]),_0x2c9a98);if(_0x531ae6[_0x3bb9('0x31')][_0x3bb9('0x3c')]){_0x3a6187['where']=_[_0x3bb9('0x3d')](_0x3a6187[_0x3bb9('0x3b')],{'$or':_[_0x3bb9('0x2b')](_0x2c9a98,function(_0x581735){if(_0x581735[_0x3bb9('0x2f')]!==_0x3bb9('0x3e')){var _0x32bd25={};_0x32bd25[_0x581735[_0x3bb9('0x28')]]={'$like':'%'+_0x531ae6['query'][_0x3bb9('0x3c')]+'%'};return _0x32bd25;}})});}_0x3a6187=_[_0x3bb9('0x3d')]({},_0x3a6187,_0x531ae6[_0x3bb9('0x3f')]);var _0x170d18={'where':_0x3a6187[_0x3bb9('0x3b')]};return db[_0x3bb9('0x2c')]['count'](_0x170d18)[_0x3bb9('0x40')](function(_0x41923c){_0x1e8eae[_0x3bb9('0x20')]=_0x41923c;if(_0x531ae6['query'][_0x3bb9('0x41')]){_0x3a6187[_0x3bb9('0x42')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x3bb9('0x43')](_0x3a6187);})['then'](function(_0x4fafe6){_0x1e8eae[_0x3bb9('0x44')]=_0x4fafe6;return _0x1e8eae;})[_0x3bb9('0x40')](respondWithFilteredResult(_0x5bad9c,_0x3a6187))[_0x3bb9('0x45')](handleError(_0x5bad9c,null));};exports[_0x3bb9('0x46')]=function(_0x36932a,_0x41bd50){var _0x3eda43={'raw':!![],'where':{'id':_0x36932a[_0x3bb9('0x47')]['id']}},_0x9f96bd={};_0x9f96bd[_0x3bb9('0x34')]=_['keys'](db[_0x3bb9('0x2c')][_0x3bb9('0x2d')]);_0x9f96bd[_0x3bb9('0x31')]=_[_0x3bb9('0x30')](_0x36932a['query']);_0x9f96bd[_0x3bb9('0x32')]=_[_0x3bb9('0x33')](_0x9f96bd['model'],_0x9f96bd[_0x3bb9('0x31')]);_0x3eda43[_0x3bb9('0x35')]=_[_0x3bb9('0x33')](_0x9f96bd[_0x3bb9('0x34')],qs[_0x3bb9('0x36')](_0x36932a[_0x3bb9('0x31')][_0x3bb9('0x36')]));_0x3eda43[_0x3bb9('0x35')]=_0x3eda43[_0x3bb9('0x35')]['length']?_0x3eda43[_0x3bb9('0x35')]:_0x9f96bd[_0x3bb9('0x34')];if(_0x36932a[_0x3bb9('0x31')][_0x3bb9('0x41')]){_0x3eda43[_0x3bb9('0x42')]=[{'all':!![]}];}_0x3eda43=_[_0x3bb9('0x3d')]({},_0x3eda43,_0x36932a[_0x3bb9('0x3f')]);return db['OpenchannelApplication'][_0x3bb9('0x48')](_0x3eda43)[_0x3bb9('0x40')](handleEntityNotFound(_0x41bd50,null))[_0x3bb9('0x40')](respondWithResult(_0x41bd50,null))[_0x3bb9('0x45')](handleError(_0x41bd50,null));};exports[_0x3bb9('0x49')]=function(_0x2dd93a,_0x45bda7){return db[_0x3bb9('0x2c')]['create'](_0x2dd93a[_0x3bb9('0x4a')],{})['then'](respondWithResult(_0x45bda7,0xc9))[_0x3bb9('0x45')](handleError(_0x45bda7,null));};exports[_0x3bb9('0x4b')]=function(_0x215aa7,_0x1a86df){if(_0x215aa7[_0x3bb9('0x4a')]['id']){delete _0x215aa7[_0x3bb9('0x4a')]['id'];}return db[_0x3bb9('0x2c')][_0x3bb9('0x48')]({'where':{'id':_0x215aa7[_0x3bb9('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a86df,null))['then'](saveUpdates(_0x215aa7[_0x3bb9('0x4a')],null))[_0x3bb9('0x40')](respondWithResult(_0x1a86df,null))[_0x3bb9('0x45')](handleError(_0x1a86df,null));};exports['destroy']=function(_0x4cfbc8,_0xc13089){return db['OpenchannelApplication'][_0x3bb9('0x48')]({'where':{'id':_0x4cfbc8[_0x3bb9('0x47')]['id']}})[_0x3bb9('0x40')](handleEntityNotFound(_0xc13089,null))[_0x3bb9('0x40')](removeEntity(_0xc13089,null))['catch'](handleError(_0xc13089,null));};
\ No newline at end of file
+var _0x7fab=['destroy','error','stack','name','send','index','rawAttributes','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','OpenchannelApplication','count','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','Content-Range','apply','reject','save','update','then'];(function(_0x13e2fe,_0x155d6e){var _0xf11902=function(_0x22e7ad){while(--_0x22e7ad){_0x13e2fe['push'](_0x13e2fe['shift']());}};_0xf11902(++_0x155d6e);}(_0x7fab,0x19d));var _0xb7fa=function(_0x3167a8,_0x4d5006){_0x3167a8=_0x3167a8-0x0;var _0x20073f=_0x7fab[_0x3167a8];return _0x20073f;};'use strict';var emlformat=require(_0xb7fa('0x0'));var rimraf=require(_0xb7fa('0x1'));var zipdir=require(_0xb7fa('0x2'));var jsonpatch=require(_0xb7fa('0x3'));var rp=require(_0xb7fa('0x4'));var moment=require(_0xb7fa('0x5'));var BPromise=require(_0xb7fa('0x6'));var Mustache=require(_0xb7fa('0x7'));var util=require(_0xb7fa('0x8'));var path=require(_0xb7fa('0x9'));var sox=require(_0xb7fa('0xa'));var csv=require(_0xb7fa('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb7fa('0xc'));var _=require(_0xb7fa('0xd'));var squel=require(_0xb7fa('0xe'));var crypto=require('crypto');var jsforce=require(_0xb7fa('0xf'));var deskjs=require(_0xb7fa('0x10'));var toCsv=require(_0xb7fa('0xb'));var querystring=require(_0xb7fa('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb7fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb7fa('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7fa('0x14'))(_0xb7fa('0x15'));var utils=require(_0xb7fa('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb7fa('0x17'))['db'];function respondWithStatusCode(_0x4ed4c8,_0x4542cc){_0x4542cc=_0x4542cc||0xcc;return function(_0x5a522d){if(_0x5a522d){return _0x4ed4c8[_0xb7fa('0x18')](_0x4542cc);}return _0x4ed4c8[_0xb7fa('0x19')](_0x4542cc)[_0xb7fa('0x1a')]();};}function respondWithResult(_0x174e59,_0x549972){_0x549972=_0x549972||0xc8;return function(_0x4556cc){if(_0x4556cc){return _0x174e59[_0xb7fa('0x19')](_0x549972)[_0xb7fa('0x1b')](_0x4556cc);}};}function respondWithFilteredResult(_0x145021,_0x20c86f){return function(_0x521c68){if(_0x521c68){var _0x33f2ab=typeof _0x20c86f['offset']===_0xb7fa('0x1c')&&typeof _0x20c86f[_0xb7fa('0x1d')]==='undefined';var _0x475022=_0x521c68['count'];var _0xf421e1=_0x33f2ab?0x0:_0x20c86f[_0xb7fa('0x1e')];var _0x4e0e91=_0x33f2ab?_0x521c68['count']:_0x20c86f['offset']+_0x20c86f[_0xb7fa('0x1d')];var _0xe6b0f1;if(_0x4e0e91>=_0x475022){_0x4e0e91=_0x475022;_0xe6b0f1=0xc8;}else{_0xe6b0f1=0xce;}_0x145021[_0xb7fa('0x19')](_0xe6b0f1);return _0x145021['set'](_0xb7fa('0x1f'),_0xf421e1+'-'+_0x4e0e91+'/'+_0x475022)[_0xb7fa('0x1b')](_0x521c68);}return null;};}function patchUpdates(_0x21e9c9){return function(_0x280b7c){try{jsonpatch[_0xb7fa('0x20')](_0x280b7c,_0x21e9c9,!![]);}catch(_0x21df1a){return BPromise[_0xb7fa('0x21')](_0x21df1a);}return _0x280b7c[_0xb7fa('0x22')]();};}function saveUpdates(_0x374f5e,_0x1592ed){return function(_0x28c1c8){if(_0x28c1c8){return _0x28c1c8[_0xb7fa('0x23')](_0x374f5e)[_0xb7fa('0x24')](function(_0x32a991){return _0x32a991;});}return null;};}function removeEntity(_0x202998,_0xbd95b0){return function(_0x59641d){if(_0x59641d){return _0x59641d[_0xb7fa('0x25')]()['then'](function(){_0x202998[_0xb7fa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a2f9,_0x537f2a){return function(_0x391cff){if(!_0x391cff){_0x51a2f9[_0xb7fa('0x18')](0x194);}return _0x391cff;};}function handleError(_0x9e3eba,_0xa79252){_0xa79252=_0xa79252||0x1f4;return function(_0x407479){logger[_0xb7fa('0x26')](_0x407479[_0xb7fa('0x27')]);if(_0x407479['name']){delete _0x407479[_0xb7fa('0x28')];}_0x9e3eba[_0xb7fa('0x19')](_0xa79252)[_0xb7fa('0x29')](_0x407479);};}exports[_0xb7fa('0x2a')]=function(_0x1053b5,_0x48b5aa){var _0x890e5e={},_0x4ea07c={},_0x4818e1={'count':0x0,'rows':[]};var _0x2f0d8b=_['map'](db['OpenchannelApplication'][_0xb7fa('0x2b')],function(_0x2ce9ca){return{'name':_0x2ce9ca['fieldName'],'type':_0x2ce9ca[_0xb7fa('0x2c')][_0xb7fa('0x2d')]};});_0x4ea07c['model']=_[_0xb7fa('0x2e')](_0x2f0d8b,_0xb7fa('0x28'));_0x4ea07c[_0xb7fa('0x2f')]=_['keys'](_0x1053b5[_0xb7fa('0x2f')]);_0x4ea07c['filters']=_[_0xb7fa('0x30')](_0x4ea07c[_0xb7fa('0x31')],_0x4ea07c[_0xb7fa('0x2f')]);_0x890e5e[_0xb7fa('0x32')]=_[_0xb7fa('0x30')](_0x4ea07c[_0xb7fa('0x31')],qs[_0xb7fa('0x33')](_0x1053b5['query'][_0xb7fa('0x33')]));_0x890e5e[_0xb7fa('0x32')]=_0x890e5e[_0xb7fa('0x32')][_0xb7fa('0x34')]?_0x890e5e['attributes']:_0x4ea07c['model'];if(!_0x1053b5['query'][_0xb7fa('0x35')](_0xb7fa('0x36'))){_0x890e5e[_0xb7fa('0x1d')]=qs[_0xb7fa('0x1d')](_0x1053b5[_0xb7fa('0x2f')][_0xb7fa('0x1d')]);_0x890e5e[_0xb7fa('0x1e')]=qs[_0xb7fa('0x1e')](_0x1053b5[_0xb7fa('0x2f')]['offset']);}_0x890e5e[_0xb7fa('0x37')]=qs['sort'](_0x1053b5[_0xb7fa('0x2f')]['sort']);_0x890e5e[_0xb7fa('0x38')]=qs[_0xb7fa('0x39')](_['pick'](_0x1053b5['query'],_0x4ea07c[_0xb7fa('0x39')]),_0x2f0d8b);if(_0x1053b5[_0xb7fa('0x2f')][_0xb7fa('0x3a')]){_0x890e5e[_0xb7fa('0x38')]=_[_0xb7fa('0x3b')](_0x890e5e[_0xb7fa('0x38')],{'$or':_[_0xb7fa('0x2e')](_0x2f0d8b,function(_0x39dcf5){if(_0x39dcf5[_0xb7fa('0x2c')]!==_0xb7fa('0x3c')){var _0x4d8ab9={};_0x4d8ab9[_0x39dcf5[_0xb7fa('0x28')]]={'$like':'%'+_0x1053b5['query'][_0xb7fa('0x3a')]+'%'};return _0x4d8ab9;}})});}_0x890e5e=_[_0xb7fa('0x3b')]({},_0x890e5e,_0x1053b5[_0xb7fa('0x3d')]);var _0x18d20c={'where':_0x890e5e[_0xb7fa('0x38')]};return db[_0xb7fa('0x3e')]['count'](_0x18d20c)['then'](function(_0xcaf3cf){_0x4818e1[_0xb7fa('0x3f')]=_0xcaf3cf;if(_0x1053b5[_0xb7fa('0x2f')][_0xb7fa('0x40')]){_0x890e5e[_0xb7fa('0x41')]=[{'all':!![]}];}return db[_0xb7fa('0x3e')][_0xb7fa('0x42')](_0x890e5e);})[_0xb7fa('0x24')](function(_0x1cbd77){_0x4818e1[_0xb7fa('0x43')]=_0x1cbd77;return _0x4818e1;})[_0xb7fa('0x24')](respondWithFilteredResult(_0x48b5aa,_0x890e5e))['catch'](handleError(_0x48b5aa,null));};exports[_0xb7fa('0x44')]=function(_0x89d28b,_0x1e751f){var _0xaf3e41={'raw':!![],'where':{'id':_0x89d28b[_0xb7fa('0x45')]['id']}},_0x2f1cb1={};_0x2f1cb1[_0xb7fa('0x31')]=_[_0xb7fa('0x46')](db[_0xb7fa('0x3e')][_0xb7fa('0x2b')]);_0x2f1cb1[_0xb7fa('0x2f')]=_[_0xb7fa('0x46')](_0x89d28b[_0xb7fa('0x2f')]);_0x2f1cb1[_0xb7fa('0x39')]=_['intersection'](_0x2f1cb1[_0xb7fa('0x31')],_0x2f1cb1[_0xb7fa('0x2f')]);_0xaf3e41[_0xb7fa('0x32')]=_[_0xb7fa('0x30')](_0x2f1cb1[_0xb7fa('0x31')],qs[_0xb7fa('0x33')](_0x89d28b['query'][_0xb7fa('0x33')]));_0xaf3e41[_0xb7fa('0x32')]=_0xaf3e41[_0xb7fa('0x32')][_0xb7fa('0x34')]?_0xaf3e41[_0xb7fa('0x32')]:_0x2f1cb1[_0xb7fa('0x31')];if(_0x89d28b[_0xb7fa('0x2f')][_0xb7fa('0x40')]){_0xaf3e41['include']=[{'all':!![]}];}_0xaf3e41=_['merge']({},_0xaf3e41,_0x89d28b['options']);return db[_0xb7fa('0x3e')][_0xb7fa('0x47')](_0xaf3e41)[_0xb7fa('0x24')](handleEntityNotFound(_0x1e751f,null))[_0xb7fa('0x24')](respondWithResult(_0x1e751f,null))[_0xb7fa('0x48')](handleError(_0x1e751f,null));};exports[_0xb7fa('0x49')]=function(_0x49d77c,_0x4ef917){return db[_0xb7fa('0x3e')][_0xb7fa('0x49')](_0x49d77c[_0xb7fa('0x4a')],{})[_0xb7fa('0x24')](respondWithResult(_0x4ef917,0xc9))[_0xb7fa('0x48')](handleError(_0x4ef917,null));};exports['update']=function(_0x4cf739,_0x272699){if(_0x4cf739[_0xb7fa('0x4a')]['id']){delete _0x4cf739[_0xb7fa('0x4a')]['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x4cf739[_0xb7fa('0x45')]['id']}})[_0xb7fa('0x24')](handleEntityNotFound(_0x272699,null))[_0xb7fa('0x24')](saveUpdates(_0x4cf739[_0xb7fa('0x4a')],null))['then'](respondWithResult(_0x272699,null))[_0xb7fa('0x48')](handleError(_0x272699,null));};exports[_0xb7fa('0x25')]=function(_0x536080,_0x512fac){return db[_0xb7fa('0x3e')][_0xb7fa('0x47')]({'where':{'id':_0x536080['params']['id']}})[_0xb7fa('0x24')](handleEntityNotFound(_0x512fac,null))['then'](removeEntity(_0x512fac,null))['catch'](handleError(_0x512fac,null));};
\ No newline at end of file
index ffcdace..2d1f604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8974=['bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x3860e8,_0x1c9a64){var _0x583f4d=function(_0x3dc6f2){while(--_0x3dc6f2){_0x3860e8['push'](_0x3860e8['shift']());}};_0x583f4d(++_0x1c9a64);}(_0x8974,0xdc));var _0x4897=function(_0xa8651c,_0x28b10a){_0xa8651c=_0xa8651c-0x0;var _0x3467c9=_0x8974[_0xa8651c];return _0x3467c9;};'use strict';var _=require(_0x4897('0x0'));var util=require(_0x4897('0x1'));var logger=require('../../config/logger')(_0x4897('0x2'));var moment=require(_0x4897('0x3'));var BPromise=require(_0x4897('0x4'));var rp=require(_0x4897('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4897('0x6'));var config=require(_0x4897('0x7'));var attributes=require(_0x4897('0x8'));module[_0x4897('0x9')]=function(_0x2a0172,_0x3c1fe9){return _0x2a0172[_0x4897('0xa')](_0x4897('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4897('0xc'),'collate':_0x4897('0xd')});};
\ No newline at end of file
+var _0x9b49=['lodash','util','../../config/logger','api','request-promise','rimraf','./openchannelApplication.attributes','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x39b82f,_0x101ffc){var _0x1cbdd9=function(_0xe80b5e){while(--_0xe80b5e){_0x39b82f['push'](_0x39b82f['shift']());}};_0x1cbdd9(++_0x101ffc);}(_0x9b49,0x82));var _0x99b4=function(_0x5a42d9,_0x2d397e){_0x5a42d9=_0x5a42d9-0x0;var _0x190cf2=_0x9b49[_0x5a42d9];return _0x190cf2;};'use strict';var _=require(_0x99b4('0x0'));var util=require(_0x99b4('0x1'));var logger=require(_0x99b4('0x2'))(_0x99b4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x99b4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x99b4('0x5'));var config=require('../../config/environment');var attributes=require(_0x99b4('0x6'));module['exports']=function(_0x5efd3f,_0x378ba1){return _0x5efd3f['define'](_0x99b4('0x7'),attributes,{'tableName':_0x99b4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x99b4('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7ad1235..01eb4d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x296a=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x3aa8c3,_0x298581){var _0x538ad2=function(_0x459d56){while(--_0x459d56){_0x3aa8c3['push'](_0x3aa8c3['shift']());}};_0x538ad2(++_0x298581);}(_0x296a,0x15a));var _0xa296=function(_0x396a8e,_0x354607){_0x396a8e=_0x396a8e-0x0;var _0xa0d55b=_0x296a[_0x396a8e];return _0xa0d55b;};'use strict';var _=require(_0xa296('0x0'));var util=require(_0xa296('0x1'));var moment=require(_0xa296('0x2'));var BPromise=require(_0xa296('0x3'));var rs=require(_0xa296('0x4'));var fs=require('fs');var Redis=require(_0xa296('0x5'));var db=require(_0xa296('0x6'))['db'];var utils=require(_0xa296('0x7'));var logger=require(_0xa296('0x8'))(_0xa296('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa296('0xa')][_0xa296('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48cb37,_0x39f79c,_0x4836f5){return new BPromise(function(_0x5d0bf0,_0x169ca1){return client[_0xa296('0xc')](_0x48cb37,_0x4836f5)[_0xa296('0xd')](function(_0x518c8f){logger[_0xa296('0xe')](_0xa296('0xf'),_0x39f79c,_0xa296('0x10'));logger['debug'](_0xa296('0x11'),_0x39f79c,'request\x20sent',JSON[_0xa296('0x12')](_0x518c8f));if(_0x518c8f['error']){if(_0x518c8f[_0xa296('0x13')]['code']===0x1f4){logger[_0xa296('0x13')](_0xa296('0xf'),_0x39f79c,_0x518c8f[_0xa296('0x13')][_0xa296('0x14')]);return _0x169ca1(_0x518c8f['error'][_0xa296('0x14')]);}logger[_0xa296('0x13')](_0xa296('0xf'),_0x39f79c,_0x518c8f[_0xa296('0x13')][_0xa296('0x14')]);return _0x5d0bf0(_0x518c8f[_0xa296('0x13')][_0xa296('0x14')]);}else{logger[_0xa296('0xe')](_0xa296('0xf'),_0x39f79c,_0xa296('0x10'));_0x5d0bf0(_0x518c8f[_0xa296('0x15')][_0xa296('0x14')]);}})[_0xa296('0x16')](function(_0x56be18){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x39f79c,_0x56be18);_0x169ca1(_0x56be18);});});}exports[_0xa296('0x17')]=function(_0x9e7055){var _0x4a84f2=this;return new Promise(function(_0x53203c,_0x23d8df){return db[_0xa296('0x18')][_0xa296('0x19')](_0x9e7055[_0xa296('0x1a')],{'raw':_0x9e7055[_0xa296('0x1b')]?_0x9e7055[_0xa296('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9e7055[_0xa296('0x1b')]?_0x9e7055[_0xa296('0x1b')]['where']||null:null,'attributes':_0x9e7055['options']?_0x9e7055[_0xa296('0x1b')]['attributes']||null:null,'limit':_0x9e7055['options']?_0x9e7055['options'][_0xa296('0x1c')]||null:null})[_0xa296('0xd')](function(_0x3db539){logger[_0xa296('0xe')](_0xa296('0x17'),_0x9e7055);logger[_0xa296('0x1d')](_0xa296('0x17'),_0x9e7055,JSON[_0xa296('0x12')](_0x3db539));_0x53203c(_0x3db539);})[_0xa296('0x16')](function(_0x3deeb3){logger[_0xa296('0x13')]('UpdateOpenchannelApplication',_0x3deeb3[_0xa296('0x14')],_0x9e7055);_0x23d8df(_0x4a84f2[_0xa296('0x13')](0x1f4,_0x3deeb3['message']));});});};
\ No newline at end of file
+var _0xc24c=['UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','lodash','util','randomstring','../../config/utils','../../config/environment','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x5e24ea,_0xb25510){var _0x2f8126=function(_0x45e251){while(--_0x45e251){_0x5e24ea['push'](_0x5e24ea['shift']());}};_0x2f8126(++_0xb25510);}(_0xc24c,0x13e));var _0xcc24=function(_0x39569c,_0x346f99){_0x39569c=_0x39569c-0x0;var _0x50ad3b=_0xc24c[_0x39569c];return _0x50ad3b;};'use strict';var _=require(_0xcc24('0x0'));var util=require(_0xcc24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc24('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcc24('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xcc24('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xcc24('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56bfac,_0x96dfa7,_0x1dccbb){return new BPromise(function(_0x5f54e7,_0x587648){return client[_0xcc24('0x6')](_0x56bfac,_0x1dccbb)[_0xcc24('0x7')](function(_0x292cd6){logger[_0xcc24('0x8')](_0xcc24('0x9'),_0x96dfa7,_0xcc24('0xa'));logger[_0xcc24('0xb')](_0xcc24('0xc'),_0x96dfa7,_0xcc24('0xa'),JSON[_0xcc24('0xd')](_0x292cd6));if(_0x292cd6['error']){if(_0x292cd6[_0xcc24('0xe')][_0xcc24('0xf')]===0x1f4){logger['error'](_0xcc24('0x9'),_0x96dfa7,_0x292cd6[_0xcc24('0xe')][_0xcc24('0x10')]);return _0x587648(_0x292cd6[_0xcc24('0xe')][_0xcc24('0x10')]);}logger[_0xcc24('0xe')](_0xcc24('0x9'),_0x96dfa7,_0x292cd6[_0xcc24('0xe')]['message']);return _0x5f54e7(_0x292cd6[_0xcc24('0xe')][_0xcc24('0x10')]);}else{logger[_0xcc24('0x8')](_0xcc24('0x9'),_0x96dfa7,_0xcc24('0xa'));_0x5f54e7(_0x292cd6['result'][_0xcc24('0x10')]);}})[_0xcc24('0x11')](function(_0x13d53c){logger[_0xcc24('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x96dfa7,_0x13d53c);_0x587648(_0x13d53c);});});}exports[_0xcc24('0x12')]=function(_0x4a4d7b){var _0x4c6c52=this;return new Promise(function(_0xfe3f96,_0x4d4645){return db[_0xcc24('0x13')][_0xcc24('0x14')](_0x4a4d7b['body'],{'raw':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b[_0xcc24('0x15')][_0xcc24('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b['options'][_0xcc24('0x17')]||null:null,'attributes':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b[_0xcc24('0x15')]['attributes']||null:null,'limit':_0x4a4d7b[_0xcc24('0x15')]?_0x4a4d7b[_0xcc24('0x15')]['limit']||null:null})['then'](function(_0x4cd4de){logger[_0xcc24('0x8')](_0xcc24('0x12'),_0x4a4d7b);logger[_0xcc24('0xb')]('UpdateOpenchannelApplication',_0x4a4d7b,JSON[_0xcc24('0xd')](_0x4cd4de));_0xfe3f96(_0x4cd4de);})[_0xcc24('0x11')](function(_0x20f965){logger[_0xcc24('0xe')]('UpdateOpenchannelApplication',_0x20f965['message'],_0x4a4d7b);_0x4d4645(_0x4c6c52['error'](0x1f4,_0x20f965[_0xcc24('0x10')]));});});};
\ No newline at end of file
index 40093c0..83bf112 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26c9=['getMessages','/:id/download','download','post','/:id/messages','/:id/tags','tracked','openchannelinteraction:addtags','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xafb06e,_0x2d1f57){var _0x37b6f2=function(_0x1e0fd1){while(--_0x1e0fd1){_0xafb06e['push'](_0xafb06e['shift']());}};_0x37b6f2(++_0x2d1f57);}(_0x26c9,0x19d));var _0x926c=function(_0x58d1ba,_0x16d0a7){_0x58d1ba=_0x58d1ba-0x0;var _0x199fdc=_0x26c9[_0x58d1ba];return _0x199fdc;};'use strict';var multer=require(_0x926c('0x0'));var util=require(_0x926c('0x1'));var path=require(_0x926c('0x2'));var timeout=require(_0x926c('0x3'));var express=require(_0x926c('0x4'));var router=express[_0x926c('0x5')]();var fs_extra=require(_0x926c('0x6'));var auth=require(_0x926c('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x926c('0x8'));var controller=require(_0x926c('0x9'));router[_0x926c('0xa')]('/',auth[_0x926c('0xb')](),controller[_0x926c('0xc')]);router[_0x926c('0xa')](_0x926c('0xd'),auth['isAuthenticated'](),controller[_0x926c('0xe')]);router[_0x926c('0xa')](_0x926c('0xf'),auth[_0x926c('0xb')](),controller['show']);router[_0x926c('0xa')]('/:id/messages',auth[_0x926c('0xb')](),controller[_0x926c('0x10')]);router['get'](_0x926c('0x11'),auth[_0x926c('0xb')](),controller[_0x926c('0x12')]);router['post']('/',auth[_0x926c('0xb')](),controller['create']);router[_0x926c('0x13')](_0x926c('0x14'),auth[_0x926c('0xb')](),controller['addMessage']);router[_0x926c('0x13')](_0x926c('0x15'),auth['isAuthenticated'](),interaction[_0x926c('0x16')]('openchannel',_0x926c('0x17')),controller['addTags']);router[_0x926c('0x18')](_0x926c('0xf'),auth[_0x926c('0xb')](),interaction[_0x926c('0x16')](_0x926c('0x19'),_0x926c('0x1a')),controller[_0x926c('0x1b')]);router[_0x926c('0x1c')](_0x926c('0xf'),auth[_0x926c('0xb')](),interaction[_0x926c('0x16')](_0x926c('0x19'),_0x926c('0x1d')),controller[_0x926c('0x1e')]);router[_0x926c('0x1c')](_0x926c('0x15'),auth['isAuthenticated'](),controller[_0x926c('0x1f')]);module[_0x926c('0x20')]=router;
\ No newline at end of file
+var _0x68ee=['openchannelinteraction:addtags','addTags','put','openchannel','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','tracked'];(function(_0x480214,_0x3b9448){var _0x3a8105=function(_0x172174){while(--_0x172174){_0x480214['push'](_0x480214['shift']());}};_0x3a8105(++_0x3b9448);}(_0x68ee,0x93));var _0xe68e=function(_0x3a80f7,_0x2cfef2){_0x3a80f7=_0x3a80f7-0x0;var _0x1e3eff=_0x68ee[_0x3a80f7];return _0x1e3eff;};'use strict';var multer=require(_0xe68e('0x0'));var util=require('util');var path=require(_0xe68e('0x1'));var timeout=require(_0xe68e('0x2'));var express=require(_0xe68e('0x3'));var router=express[_0xe68e('0x4')]();var fs_extra=require(_0xe68e('0x5'));var auth=require(_0xe68e('0x6'));var interaction=require(_0xe68e('0x7'));var config=require(_0xe68e('0x8'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xe68e('0x9')](),controller[_0xe68e('0xa')]);router[_0xe68e('0xb')](_0xe68e('0xc'),auth[_0xe68e('0x9')](),controller[_0xe68e('0xd')]);router['get'](_0xe68e('0xe'),auth[_0xe68e('0x9')](),controller[_0xe68e('0xf')]);router[_0xe68e('0xb')](_0xe68e('0x10'),auth[_0xe68e('0x9')](),controller[_0xe68e('0x11')]);router[_0xe68e('0xb')](_0xe68e('0x12'),auth[_0xe68e('0x9')](),controller[_0xe68e('0x13')]);router['post']('/',auth[_0xe68e('0x9')](),controller[_0xe68e('0x14')]);router[_0xe68e('0x15')]('/:id/messages',auth[_0xe68e('0x9')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0xe68e('0x16')]('openchannel',_0xe68e('0x17')),controller[_0xe68e('0x18')]);router[_0xe68e('0x19')](_0xe68e('0xe'),auth['isAuthenticated'](),interaction[_0xe68e('0x16')](_0xe68e('0x1a'),_0xe68e('0x1b')),controller['update']);router[_0xe68e('0x1c')]('/:id',auth[_0xe68e('0x9')](),interaction[_0xe68e('0x16')](_0xe68e('0x1a'),_0xe68e('0x1d')),controller[_0xe68e('0x1e')]);router[_0xe68e('0x1c')](_0xe68e('0x1f'),auth[_0xe68e('0x9')](),controller[_0xe68e('0x20')]);module[_0xe68e('0x21')]=router;
\ No newline at end of file
index 8ba080f..4e3081d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe64a=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3898d9,_0x12b009){var _0x41ec09=function(_0x1190c2){while(--_0x1190c2){_0x3898d9['push'](_0x3898d9['shift']());}};_0x41ec09(++_0x12b009);}(_0xe64a,0x1e0));var _0xae64=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe64a[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xae64('0x0'));module[_0xae64('0x1')]={'closed':{'type':Sequelize[_0xae64('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xae64('0x3')]},'disposition':{'type':Sequelize[_0xae64('0x4')]},'secondDisposition':{'type':Sequelize[_0xae64('0x4')]},'thirdDisposition':{'type':Sequelize[_0xae64('0x4')]},'note':{'type':Sequelize[_0xae64('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xae64('0x5')]('in',_0xae64('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xae64('0x5')]('in',_0xae64('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xae64('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xae64('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x8868=['STRING','out','ENUM','sequelize','exports','BOOLEAN','DATE'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x8868,0x1ca));var _0x8886=function(_0x12cd77,_0x615b14){_0x12cd77=_0x12cd77-0x0;var _0x3dc46b=_0x8868[_0x12cd77];return _0x3dc46b;};'use strict';var Sequelize=require(_0x8886('0x0'));module[_0x8886('0x1')]={'closed':{'type':Sequelize[_0x8886('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8886('0x3')]},'disposition':{'type':Sequelize[_0x8886('0x4')]},'secondDisposition':{'type':Sequelize[_0x8886('0x4')]},'thirdDisposition':{'type':Sequelize[_0x8886('0x4')]},'note':{'type':Sequelize[_0x8886('0x4')]},'read1stAt':{'type':Sequelize[_0x8886('0x3')]},'threadId':{'type':Sequelize[_0x8886('0x4')]},'externalUrl':{'type':Sequelize[_0x8886('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8886('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x8886('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x8886('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index e01b3d2..3faed0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fae=['redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','then','destroy','error','stack','name','send','map','OpenchannelInteraction','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','describe','addMessage','ids','omit','OpenchannelMessage','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','tmp','files','attachments','join','format','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','Openchannel','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','lastName','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','rimraf','zip-dir','moment','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','defaults'];(function(_0x34e9c8,_0x1d2f14){var _0x570baa=function(_0x4f8913){while(--_0x4f8913){_0x34e9c8['push'](_0x34e9c8['shift']());}};_0x570baa(++_0x1d2f14);}(_0x5fae,0x77));var _0xe5fa=function(_0x1eedae,_0xf9d3f2){_0x1eedae=_0x1eedae-0x0;var _0x40b674=_0x5fae[_0x1eedae];return _0x40b674;};'use strict';var rimraf=require(_0xe5fa('0x0'));var zipdir=require(_0xe5fa('0x1'));var moment=require(_0xe5fa('0x2'));var util=require('util');var path=require(_0xe5fa('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe5fa('0x4'));var Redis=require(_0xe5fa('0x5'));var interaction=require(_0xe5fa('0x6'));var qs=require(_0xe5fa('0x7'));var pdf=require(_0xe5fa('0x8'));var logger=require(_0xe5fa('0x9'))(_0xe5fa('0xa'));var config=require(_0xe5fa('0xb'));var db=require(_0xe5fa('0xc'))['db'];config['redis']=_[_0xe5fa('0xd')](config[_0xe5fa('0xe')],{'host':_0xe5fa('0xf'),'port':0x18eb});var socket=require(_0xe5fa('0x10'))(new Redis(config[_0xe5fa('0xe')]));require('./openchannelInteraction.socket')[_0xe5fa('0x11')](socket);function respondWithStatusCode(_0x26a9cd,_0x825c3a){_0x825c3a=_0x825c3a||0xcc;return function(_0xd4cfb1){if(_0xd4cfb1){return _0x26a9cd[_0xe5fa('0x12')](_0x825c3a);}return _0x26a9cd[_0xe5fa('0x13')](_0x825c3a)[_0xe5fa('0x14')]();};}function respondWithResult(_0x2e1615,_0x53a96a){_0x53a96a=_0x53a96a||0xc8;return function(_0x221920){if(_0x221920){return _0x2e1615[_0xe5fa('0x13')](_0x53a96a)[_0xe5fa('0x15')](_0x221920);}};}function respondWithFilteredResult(_0x5b935b,_0x17c495){return function(_0x27028a){if(_0x27028a){var _0x31062b=typeof _0x17c495[_0xe5fa('0x16')]==='undefined'&&typeof _0x17c495[_0xe5fa('0x17')]==='undefined';var _0x130c04=_0x27028a[_0xe5fa('0x18')];var _0xae1d3d=_0x31062b?0x0:_0x17c495[_0xe5fa('0x16')];var _0xb7408a=_0x31062b?_0x27028a['count']:_0x17c495[_0xe5fa('0x16')]+_0x17c495[_0xe5fa('0x17')];var _0x2d5c11;if(_0xb7408a>=_0x130c04){_0xb7408a=_0x130c04;_0x2d5c11=0xc8;}else{_0x2d5c11=0xce;}_0x5b935b[_0xe5fa('0x13')](_0x2d5c11);return _0x5b935b[_0xe5fa('0x19')](_0xe5fa('0x1a'),_0xae1d3d+'-'+_0xb7408a+'/'+_0x130c04)[_0xe5fa('0x15')](_0x27028a);}return null;};}function saveUpdates(_0x34d48b){return function(_0x58d9ff){if(_0x58d9ff){return _0x58d9ff['update'](_0x34d48b)[_0xe5fa('0x1b')](function(_0x514712){return _0x514712;});}return null;};}function removeEntity(_0x4c0f55){return function(_0x3a1729){if(_0x3a1729){return _0x3a1729[_0xe5fa('0x1c')]()[_0xe5fa('0x1b')](function(){_0x4c0f55[_0xe5fa('0x13')](0xcc)[_0xe5fa('0x14')]();});}};}function handleEntityNotFound(_0x2fafa5){return function(_0x1345e2){if(!_0x1345e2){_0x2fafa5[_0xe5fa('0x12')](0x194);}return _0x1345e2;};}function handleError(_0x1d2ad4,_0x1f77e2){_0x1f77e2=_0x1f77e2||0x1f4;return function(_0x18779e){logger[_0xe5fa('0x1d')](_0x18779e[_0xe5fa('0x1e')]);if(_0x18779e[_0xe5fa('0x1f')]){delete _0x18779e[_0xe5fa('0x1f')];}_0x1d2ad4[_0xe5fa('0x13')](_0x1f77e2)[_0xe5fa('0x20')](_0x18779e);};}exports['index']=function(_0x42b6e2,_0x554d33){var _0x36ce68={};var _0xbe2203=_[_0xe5fa('0x21')](db[_0xe5fa('0x22')][_0xe5fa('0x23')],function(_0x353651){return{'name':_0x353651[_0xe5fa('0x24')],'type':_0x353651[_0xe5fa('0x25')]['key']};});_0x36ce68=qs[_0xe5fa('0x26')](_0xbe2203,_0x42b6e2);return interaction[_0xe5fa('0x27')](_0xe5fa('0x28'),_0x42b6e2[_0xe5fa('0x29')],_0x42b6e2[_0xe5fa('0x2a')],_0x36ce68,_0xbe2203)['then'](respondWithFilteredResult(_0x554d33,_0x36ce68))[_0xe5fa('0x2b')](handleError(_0x554d33,null));};exports[_0xe5fa('0x2c')]=function(_0x2ac563,_0xf738c3){var _0x2b0d0d={};if(_0x2ac563[_0xe5fa('0x29')][_0xe5fa('0x25')]&&_0x2ac563[_0xe5fa('0x29')][_0xe5fa('0x25')]==='from'){_0x2b0d0d['from']=_0x2ac563[_0xe5fa('0x2d')]['id'];}else{_0x2b0d0d['id']=_0x2ac563[_0xe5fa('0x2d')]['id'];}var _0x4d423d={'raw':![],'where':_0x2b0d0d},_0x197b2a={};_0x197b2a[_0xe5fa('0x2e')]=_['keys'](db[_0xe5fa('0x22')][_0xe5fa('0x23')]);_0x197b2a['query']=_[_0xe5fa('0x2f')](_0x2ac563[_0xe5fa('0x29')]);_0x197b2a[_0xe5fa('0x30')]=_[_0xe5fa('0x31')](_0x197b2a['model'],_0x197b2a[_0xe5fa('0x29')]);_0x4d423d[_0xe5fa('0x32')]=_[_0xe5fa('0x31')](_0x197b2a[_0xe5fa('0x2e')],qs[_0xe5fa('0x33')](_0x2ac563['query'][_0xe5fa('0x33')]));_0x4d423d[_0xe5fa('0x32')]=_0x4d423d[_0xe5fa('0x32')][_0xe5fa('0x34')]?_0x4d423d[_0xe5fa('0x32')]:_0x197b2a['model'];if(_0x2ac563['query'][_0xe5fa('0x35')]){_0x4d423d[_0xe5fa('0x36')]=[{'all':!![]}];}_0x4d423d=_[_0xe5fa('0x37')]({},_0x4d423d,_0x2ac563[_0xe5fa('0x38')]);return db[_0xe5fa('0x22')][_0xe5fa('0x39')](_0x4d423d)[_0xe5fa('0x1b')](handleEntityNotFound(_0xf738c3,null))[_0xe5fa('0x1b')](respondWithResult(_0xf738c3,null))[_0xe5fa('0x2b')](handleError(_0xf738c3,null));};exports[_0xe5fa('0x3a')]=function(_0x4eeab3,_0x24678d){return db[_0xe5fa('0x22')][_0xe5fa('0x3a')](_0x4eeab3[_0xe5fa('0x3b')],{})[_0xe5fa('0x1b')](respondWithResult(_0x24678d,0xc9))[_0xe5fa('0x2b')](handleError(_0x24678d,null));};exports[_0xe5fa('0x3c')]=function(_0x1c2a09,_0x46b17f){if(_0x1c2a09[_0xe5fa('0x3b')]['id']){delete _0x1c2a09[_0xe5fa('0x3b')]['id'];}return db['OpenchannelInteraction'][_0xe5fa('0x39')]({'where':{'id':_0x1c2a09[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x46b17f,null))[_0xe5fa('0x1b')](saveUpdates(_0x1c2a09['body'],null))[_0xe5fa('0x1b')](respondWithResult(_0x46b17f,null))[_0xe5fa('0x2b')](handleError(_0x46b17f,null));};exports['destroy']=function(_0x500419,_0x5013eb){return db[_0xe5fa('0x22')][_0xe5fa('0x39')]({'where':{'id':_0x500419[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x5013eb,null))[_0xe5fa('0x1b')](removeEntity(_0x5013eb,null))[_0xe5fa('0x2b')](handleError(_0x5013eb,null));};exports[_0xe5fa('0x3d')]=function(_0x6afcad,_0x174b06){return db['OpenchannelInteraction']['describe']()[_0xe5fa('0x1b')](respondWithResult(_0x174b06,null))['catch'](handleError(_0x174b06,null));};exports[_0xe5fa('0x3e')]=function(_0x29eaf5,_0x13ec42){return db['OpenchannelMessage'][_0xe5fa('0x39')]({'where':{'id':_0x29eaf5['params']['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x13ec42,null))[_0xe5fa('0x1b')](function(_0x25635b){if(_0x25635b){return _0x25635b[_0xe5fa('0x3e')](_0x29eaf5[_0xe5fa('0x3b')][_0xe5fa('0x3f')],_[_0xe5fa('0x40')](_0x29eaf5[_0xe5fa('0x3b')],[_0xe5fa('0x3f'),'id'])||{});}})[_0xe5fa('0x1b')](respondWithResult(_0x13ec42,null))[_0xe5fa('0x2b')](handleError(_0x13ec42,null));};exports['getMessages']=function(_0x21092b,_0x16323c){var _0x1698a1={'raw':![],'where':{}};var _0x52b544={};var _0x497c40={'count':0x0,'rows':[]};return db[_0xe5fa('0x22')]['findOne']({'where':{'id':_0x21092b[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x16323c,null))[_0xe5fa('0x1b')](function(_0x4b77b6){if(_0x4b77b6){_0x52b544['model']=_['keys'](db[_0xe5fa('0x41')][_0xe5fa('0x23')]);_0x52b544['query']=_[_0xe5fa('0x2f')](_0x21092b[_0xe5fa('0x29')]);_0x52b544[_0xe5fa('0x30')]=_['intersection'](_0x52b544[_0xe5fa('0x2e')],_0x52b544[_0xe5fa('0x29')]);_0x1698a1[_0xe5fa('0x32')]=_[_0xe5fa('0x31')](_0x52b544[_0xe5fa('0x2e')],qs[_0xe5fa('0x33')](_0x21092b['query'][_0xe5fa('0x33')]));_0x1698a1[_0xe5fa('0x32')]=_0x1698a1[_0xe5fa('0x32')][_0xe5fa('0x34')]?_0x1698a1[_0xe5fa('0x32')]:_0x52b544[_0xe5fa('0x2e')];if(!_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x42')](_0xe5fa('0x43'))){_0x1698a1[_0xe5fa('0x17')]=qs[_0xe5fa('0x17')](_0x21092b[_0xe5fa('0x29')]['limit']);_0x1698a1[_0xe5fa('0x16')]=qs[_0xe5fa('0x16')](_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x16')]);}_0x1698a1[_0xe5fa('0x44')]=qs[_0xe5fa('0x45')](_0x21092b[_0xe5fa('0x29')]['sort']);_0x1698a1[_0xe5fa('0x46')]=qs[_0xe5fa('0x30')](_[_0xe5fa('0x47')](_0x21092b[_0xe5fa('0x29')],_0x52b544['filters']));_0x1698a1[_0xe5fa('0x46')][_0xe5fa('0x48')]=_0x4b77b6['id'];if(_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x49')]){_0x1698a1['where']=_[_0xe5fa('0x37')](_0x1698a1[_0xe5fa('0x46')],{'$or':_[_0xe5fa('0x21')](_0x1698a1[_0xe5fa('0x32')],function(_0x6a2635){var _0x5c22cd={};_0x5c22cd[_0x6a2635]={'$like':'%'+_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x49')]+'%'};return _0x5c22cd;})});}if(_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x4a')]){var _0x3ffde8=_0x21092b['query'][_0xe5fa('0x4a')][_0xe5fa('0x4b')](',');var _0x5dc233={};_0x5dc233[_0x3ffde8[0x0]]={'$gte':moment(_0x3ffde8[0x1])['format'](_0xe5fa('0x4c'))};_0x1698a1[_0xe5fa('0x46')]=_['merge'](_0x1698a1['where'],_0x5dc233);}_0x1698a1=_[_0xe5fa('0x37')]({},_0x1698a1,_0x21092b['options']);return db['OpenchannelMessage']['count']({'where':_0x1698a1[_0xe5fa('0x46')]})[_0xe5fa('0x1b')](function(_0x38146f){_0x497c40[_0xe5fa('0x18')]=_0x38146f;if(_0x21092b[_0xe5fa('0x29')][_0xe5fa('0x35')]){_0x1698a1[_0xe5fa('0x36')]=[{'all':!![]}];}return db[_0xe5fa('0x41')][_0xe5fa('0x27')](_0x1698a1);})['then'](function(_0x48fa49){_0x497c40[_0xe5fa('0x4d')]=_0x48fa49;return _0x497c40;});}})['then'](respondWithFilteredResult(_0x16323c,_0x1698a1))[_0xe5fa('0x2b')](handleError(_0x16323c,null));};exports[_0xe5fa('0x4e')]=function(_0x111fba,_0x41d9e2){return db[_0xe5fa('0x22')][_0xe5fa('0x39')]({'where':{'id':_0x111fba[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x41d9e2,null))[_0xe5fa('0x1b')](function(_0x1f4159){if(_0x1f4159){return _0x1f4159[_0xe5fa('0x4f')](_0x111fba['body'][_0xe5fa('0x3f')],_['omit'](_0x111fba['body'],[_0xe5fa('0x3f'),'id'])||{})[_0xe5fa('0x50')](function(){return db[_0xe5fa('0x51')]['findAll']({'attributes':['id',_0xe5fa('0x1f'),_0xe5fa('0x52')],'where':{'id':_0x111fba[_0xe5fa('0x3b')][_0xe5fa('0x3f')]}});})[_0xe5fa('0x1b')](function(_0x595b83){socket[_0xe5fa('0x53')](_0xe5fa('0x54'),{'id':Number(_0x111fba['params']['id']),'tags':_0x595b83||[]});return{'id':Number(_0x111fba[_0xe5fa('0x2d')]['id']),'tags':_0x595b83||[]};});}})[_0xe5fa('0x1b')](respondWithResult(_0x41d9e2,null))[_0xe5fa('0x2b')](handleError(_0x41d9e2,null));};exports[_0xe5fa('0x55')]=function(_0x219080,_0x481d0c){return db[_0xe5fa('0x22')][_0xe5fa('0x39')]({'where':{'id':_0x219080[_0xe5fa('0x2d')]['id']}})[_0xe5fa('0x1b')](handleEntityNotFound(_0x481d0c,null))['then'](function(_0x3cf8f5){if(_0x3cf8f5){return _0x3cf8f5['removeTags'](_0x219080[_0xe5fa('0x29')][_0xe5fa('0x3f')]);}})[_0xe5fa('0x1b')](respondWithStatusCode(_0x481d0c,null))[_0xe5fa('0x2b')](handleError(_0x481d0c,null));};exports[_0xe5fa('0x56')]=function(_0x5e40f1,_0x22c11d){var _0x412967=moment()[_0xe5fa('0x57')]()[_0xe5fa('0x58')]();var _0x22c858=path['join'](config[_0xe5fa('0x59')],'server','files',_0xe5fa('0x5a'));var _0x3abca5=path['join'](config['root'],'server',_0xe5fa('0x5b'),_0xe5fa('0x5c'));var _0x74fa6b=path[_0xe5fa('0x5d')](_0x22c858,_0x412967);var _0xaebc37=util[_0xe5fa('0x5e')](_0xe5fa('0x5f'),_0x5e40f1['params']['id'],_0x412967);var _0x3b7428=path['join'](_0x22c858,_0xaebc37);var _0x5c3032=[];_0x5c3032[_0xe5fa('0x60')]({'model':db[_0xe5fa('0x61')],'as':_0xe5fa('0x61'),'attributes':['id',_0xe5fa('0x62')],'raw':!![]});_0x5c3032[_0xe5fa('0x60')]({'model':db[_0xe5fa('0x63')],'as':_0xe5fa('0x64'),'attributes':['id',_0xe5fa('0x65'),'lastName'],'raw':!![]});if(_0x5e40f1[_0xe5fa('0x29')][_0xe5fa('0x5c')]){_0x5c3032[_0xe5fa('0x60')]({'model':db['Attachment'],'as':_0xe5fa('0x66'),'raw':!![]});}var _0x3cd553=[{'model':db[_0xe5fa('0x41')],'as':_0xe5fa('0x67'),'attributes':['id',_0xe5fa('0x3b'),_0xe5fa('0x68'),_0xe5fa('0x69'),_0xe5fa('0x6a'),_0xe5fa('0x6b')],'include':_0x5c3032}];_0x3cd553['push']({'model':db[_0xe5fa('0x6c')],'as':_0xe5fa('0x6d'),'attributes':['id','name']});_0x3cd553[_0xe5fa('0x60')]({'model':db[_0xe5fa('0x61')],'as':_0xe5fa('0x6e'),'attributes':['id',_0xe5fa('0x62')]});return db['OpenchannelInteraction'][_0xe5fa('0x39')]({'where':{'id':_0x5e40f1['params']['id']},'include':_0x3cd553})['then'](handleEntityNotFound(_0x22c11d,null))[_0xe5fa('0x1b')](function(_0x2dd96d){if(_0x2dd96d){var _0x4aed6a=_0x2dd96d[_0xe5fa('0x6f')]({'plain':!![]});fs['mkdirSync'](_0x74fa6b);var _0x270bbe={'channel':_0xe5fa('0x70'),'account':_0x4aed6a[_0xe5fa('0x6d')][_0xe5fa('0x1f')],'agent':_0x4aed6a[_0xe5fa('0x6e')]?_0x4aed6a[_0xe5fa('0x6e')][_0xe5fa('0x62')]:'N.A.','createdAt':moment(_0x4aed6a['createdAt'])[_0xe5fa('0x5e')](_0xe5fa('0x4c'))[_0xe5fa('0x58')](),'closedAt':_0x4aed6a[_0xe5fa('0x71')]?moment(_0x4aed6a[_0xe5fa('0x72')])[_0xe5fa('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe5fa('0x58')]():'','disposition':_0x4aed6a[_0xe5fa('0x73')],'visibility':_0x4aed6a[_0xe5fa('0x74')]?'Public':_0xe5fa('0x75'),'messages':_(_0x4aed6a['Messages'])['filter']({'secret':![]})[_0xe5fa('0x21')](function(_0x5e59b1){if(_0x5e59b1[_0xe5fa('0x66')]){var _0x228a77=path['join'](_0x3abca5,_0x5e59b1[_0xe5fa('0x66')][_0xe5fa('0x76')]);if(fs[_0xe5fa('0x77')](_0x228a77)){fs[_0xe5fa('0x78')](_0x228a77)[_0xe5fa('0x79')](fs[_0xe5fa('0x7a')](path[_0xe5fa('0x5d')](_0x74fa6b,_0x5e59b1[_0xe5fa('0x66')][_0xe5fa('0x76')])));}}return{'date':moment(_0x5e59b1[_0xe5fa('0x68')])[_0xe5fa('0x5e')](_0xe5fa('0x4c'))[_0xe5fa('0x58')](),'sender':_0x5e59b1['direction']===_0xe5fa('0x7b')?_0x5e59b1[_0xe5fa('0x61')]?_0x5e59b1[_0xe5fa('0x61')]['fullname']:'System':_0x5e59b1[_0xe5fa('0x64')][_0xe5fa('0x65')]+(_0x5e59b1[_0xe5fa('0x64')]['lastName']?'\x20'+_0x5e59b1['Contact'][_0xe5fa('0x7c')]:''),'body':_0x5e59b1[_0xe5fa('0x66')]?_0x5e59b1[_0xe5fa('0x66')][_0xe5fa('0x76')]:_0x5e59b1[_0xe5fa('0x3b')],'direction':_0x5e59b1[_0xe5fa('0x69')]===_0xe5fa('0x7b')?'A':'C','secret':_0x5e59b1[_0xe5fa('0x6a')],'read':_0x5e59b1['read'],'attachment':_0x5e59b1[_0xe5fa('0x66')]};})[_0xe5fa('0x7d')]()};return ejs[_0xe5fa('0x7e')](path[_0xe5fa('0x5d')](config[_0xe5fa('0x59')],'server',_0xe5fa('0x7f'),_0xe5fa('0x80')),{'interaction':_0x270bbe})['then'](function(_0x2b9f3d){var _0x1b8d4a=path[_0xe5fa('0x5d')](_0x74fa6b,_0xe5fa('0x81')+_0x4aed6a['id']+'-'+_0x412967+_0xe5fa('0x82'));var _0x158a16={'path':_0x1b8d4a,'channel':_0xe5fa('0x70'),'interactionId':_0x4aed6a['id']};return pdf[_0xe5fa('0x83')](_0x2b9f3d,_0x158a16);})[_0xe5fa('0x1b')](function(){return new Promise(function(_0x565dbc,_0x1011d2){zipdir(_0x74fa6b,{'saveTo':_0x3b7428},function(_0x1c2afe,_0x1455e5){if(_0x1c2afe)return _0x1011d2(_0x1c2afe);return _0x565dbc(_0x1455e5);});})[_0xe5fa('0x1b')](function(){return new Promise(function(_0x41826c,_0x386a1b){rimraf(_0x74fa6b,function(_0x8e0018){if(_0x8e0018)_0x386a1b(_0x8e0018);return _0x41826c();});});})['then'](function(){return _0x22c11d[_0xe5fa('0x56')](_0x3b7428,_0xaebc37,function(_0x3d0000){if(_0x3d0000){logger[_0xe5fa('0x1d')](_0xe5fa('0x84'),_0x3d0000);}else{fs['unlinkSync'](_0x3b7428);}});});});}else{return _0x22c11d[_0xe5fa('0x12')](0xc8);}})[_0xe5fa('0x2b')](handleError(_0x22c11d,null));};
\ No newline at end of file
+var _0xed36=['length','merge','options','find','body','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','nolimit','offset','sort','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','removeTags','download','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','createdAt','toString','disposition','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','out','System','Contact','read','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','update','then','destroy','error','stack','name','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','query','user','catch','show','from','params','keys','filters','intersection','model','fields','attributes'];(function(_0x1d5b3d,_0x5c7145){var _0xc810b9=function(_0x2b11fa){while(--_0x2b11fa){_0x1d5b3d['push'](_0x1d5b3d['shift']());}};_0xc810b9(++_0x5c7145);}(_0xed36,0xc6));var _0x6ed3=function(_0x6696d,_0x2fb8ac){_0x6696d=_0x6696d-0x0;var _0x587a4c=_0xed36[_0x6696d];return _0x587a4c;};'use strict';var rimraf=require(_0x6ed3('0x0'));var zipdir=require(_0x6ed3('0x1'));var moment=require(_0x6ed3('0x2'));var util=require(_0x6ed3('0x3'));var path=require('path');var ejs=require(_0x6ed3('0x4'));var fs=require('fs');var _=require(_0x6ed3('0x5'));var Redis=require(_0x6ed3('0x6'));var interaction=require(_0x6ed3('0x7'));var qs=require(_0x6ed3('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x6ed3('0x9'))(_0x6ed3('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x6ed3('0xb')]=_[_0x6ed3('0xc')](config[_0x6ed3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6ed3('0xd'))(new Redis(config['redis']));require(_0x6ed3('0xe'))[_0x6ed3('0xf')](socket);function respondWithStatusCode(_0x204ed9,_0x5d460a){_0x5d460a=_0x5d460a||0xcc;return function(_0x56ecaa){if(_0x56ecaa){return _0x204ed9[_0x6ed3('0x10')](_0x5d460a);}return _0x204ed9[_0x6ed3('0x11')](_0x5d460a)[_0x6ed3('0x12')]();};}function respondWithResult(_0x5e0f47,_0x1be238){_0x1be238=_0x1be238||0xc8;return function(_0x4eee25){if(_0x4eee25){return _0x5e0f47['status'](_0x1be238)[_0x6ed3('0x13')](_0x4eee25);}};}function respondWithFilteredResult(_0x539f59,_0x27e717){return function(_0x47a7ae){if(_0x47a7ae){var _0x43467a=typeof _0x27e717['offset']===_0x6ed3('0x14')&&typeof _0x27e717['limit']==='undefined';var _0x1c860f=_0x47a7ae[_0x6ed3('0x15')];var _0x4a049d=_0x43467a?0x0:_0x27e717['offset'];var _0x2d232e=_0x43467a?_0x47a7ae[_0x6ed3('0x15')]:_0x27e717['offset']+_0x27e717[_0x6ed3('0x16')];var _0xe01c97;if(_0x2d232e>=_0x1c860f){_0x2d232e=_0x1c860f;_0xe01c97=0xc8;}else{_0xe01c97=0xce;}_0x539f59[_0x6ed3('0x11')](_0xe01c97);return _0x539f59[_0x6ed3('0x17')](_0x6ed3('0x18'),_0x4a049d+'-'+_0x2d232e+'/'+_0x1c860f)[_0x6ed3('0x13')](_0x47a7ae);}return null;};}function saveUpdates(_0x9e81b2){return function(_0x49a953){if(_0x49a953){return _0x49a953[_0x6ed3('0x19')](_0x9e81b2)[_0x6ed3('0x1a')](function(_0x450be1){return _0x450be1;});}return null;};}function removeEntity(_0x4073d9){return function(_0x36bf90){if(_0x36bf90){return _0x36bf90[_0x6ed3('0x1b')]()[_0x6ed3('0x1a')](function(){_0x4073d9[_0x6ed3('0x11')](0xcc)[_0x6ed3('0x12')]();});}};}function handleEntityNotFound(_0x173f6d){return function(_0x460471){if(!_0x460471){_0x173f6d['sendStatus'](0x194);}return _0x460471;};}function handleError(_0x2725dd,_0x40299e){_0x40299e=_0x40299e||0x1f4;return function(_0x548b09){logger[_0x6ed3('0x1c')](_0x548b09[_0x6ed3('0x1d')]);if(_0x548b09[_0x6ed3('0x1e')]){delete _0x548b09['name'];}_0x2725dd[_0x6ed3('0x11')](_0x40299e)['send'](_0x548b09);};}exports[_0x6ed3('0x1f')]=function(_0x3fab16,_0x117499){var _0x90518e={};var _0x2b94a0=_[_0x6ed3('0x20')](db[_0x6ed3('0x21')][_0x6ed3('0x22')],function(_0x1a58cb){return{'name':_0x1a58cb[_0x6ed3('0x23')],'type':_0x1a58cb[_0x6ed3('0x24')][_0x6ed3('0x25')]};});_0x90518e=qs[_0x6ed3('0x26')](_0x2b94a0,_0x3fab16);return interaction[_0x6ed3('0x27')]('openchannel',_0x3fab16[_0x6ed3('0x28')],_0x3fab16[_0x6ed3('0x29')],_0x90518e,_0x2b94a0)['then'](respondWithFilteredResult(_0x117499,_0x90518e))[_0x6ed3('0x2a')](handleError(_0x117499,null));};exports[_0x6ed3('0x2b')]=function(_0x1aa040,_0x1fc5aa){var _0xa997d3={};if(_0x1aa040[_0x6ed3('0x28')][_0x6ed3('0x24')]&&_0x1aa040[_0x6ed3('0x28')][_0x6ed3('0x24')]==='from'){_0xa997d3[_0x6ed3('0x2c')]=_0x1aa040[_0x6ed3('0x2d')]['id'];}else{_0xa997d3['id']=_0x1aa040['params']['id'];}var _0x6f5a88={'raw':![],'where':_0xa997d3},_0x5a96d2={};_0x5a96d2['model']=_[_0x6ed3('0x2e')](db[_0x6ed3('0x21')][_0x6ed3('0x22')]);_0x5a96d2[_0x6ed3('0x28')]=_[_0x6ed3('0x2e')](_0x1aa040[_0x6ed3('0x28')]);_0x5a96d2[_0x6ed3('0x2f')]=_[_0x6ed3('0x30')](_0x5a96d2[_0x6ed3('0x31')],_0x5a96d2['query']);_0x6f5a88['attributes']=_[_0x6ed3('0x30')](_0x5a96d2[_0x6ed3('0x31')],qs[_0x6ed3('0x32')](_0x1aa040[_0x6ed3('0x28')]['fields']));_0x6f5a88[_0x6ed3('0x33')]=_0x6f5a88[_0x6ed3('0x33')][_0x6ed3('0x34')]?_0x6f5a88[_0x6ed3('0x33')]:_0x5a96d2[_0x6ed3('0x31')];if(_0x1aa040[_0x6ed3('0x28')]['includeAll']){_0x6f5a88['include']=[{'all':!![]}];}_0x6f5a88=_[_0x6ed3('0x35')]({},_0x6f5a88,_0x1aa040[_0x6ed3('0x36')]);return db['OpenchannelInteraction'][_0x6ed3('0x37')](_0x6f5a88)[_0x6ed3('0x1a')](handleEntityNotFound(_0x1fc5aa,null))[_0x6ed3('0x1a')](respondWithResult(_0x1fc5aa,null))[_0x6ed3('0x2a')](handleError(_0x1fc5aa,null));};exports['create']=function(_0x31faeb,_0x34128b){return db['OpenchannelInteraction']['create'](_0x31faeb[_0x6ed3('0x38')],{})['then'](respondWithResult(_0x34128b,0xc9))[_0x6ed3('0x2a')](handleError(_0x34128b,null));};exports[_0x6ed3('0x19')]=function(_0x2e6a4f,_0x1ed610){if(_0x2e6a4f[_0x6ed3('0x38')]['id']){delete _0x2e6a4f[_0x6ed3('0x38')]['id'];}return db[_0x6ed3('0x21')][_0x6ed3('0x37')]({'where':{'id':_0x2e6a4f[_0x6ed3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x1ed610,null))['then'](saveUpdates(_0x2e6a4f[_0x6ed3('0x38')],null))[_0x6ed3('0x1a')](respondWithResult(_0x1ed610,null))[_0x6ed3('0x2a')](handleError(_0x1ed610,null));};exports['destroy']=function(_0x551087,_0x8f255a){return db[_0x6ed3('0x21')][_0x6ed3('0x37')]({'where':{'id':_0x551087[_0x6ed3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x8f255a,null))[_0x6ed3('0x1a')](removeEntity(_0x8f255a,null))[_0x6ed3('0x2a')](handleError(_0x8f255a,null));};exports[_0x6ed3('0x39')]=function(_0x3dfce8,_0x296246){return db[_0x6ed3('0x21')][_0x6ed3('0x39')]()['then'](respondWithResult(_0x296246,null))['catch'](handleError(_0x296246,null));};exports[_0x6ed3('0x3a')]=function(_0x27d1b8,_0x424ef3){return db[_0x6ed3('0x3b')]['find']({'where':{'id':_0x27d1b8['params']['id']}})[_0x6ed3('0x1a')](handleEntityNotFound(_0x424ef3,null))['then'](function(_0x44b133){if(_0x44b133){return _0x44b133[_0x6ed3('0x3a')](_0x27d1b8['body'][_0x6ed3('0x3c')],_[_0x6ed3('0x3d')](_0x27d1b8[_0x6ed3('0x38')],[_0x6ed3('0x3c'),'id'])||{});}})[_0x6ed3('0x1a')](respondWithResult(_0x424ef3,null))[_0x6ed3('0x2a')](handleError(_0x424ef3,null));};exports[_0x6ed3('0x3e')]=function(_0x252e76,_0x4d419a){var _0x47e427={'raw':![],'where':{}};var _0x4bdce1={};var _0x1d79e3={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x6ed3('0x3f')]({'where':{'id':_0x252e76[_0x6ed3('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4d419a,null))['then'](function(_0x4c445b){if(_0x4c445b){_0x4bdce1[_0x6ed3('0x31')]=_[_0x6ed3('0x2e')](db[_0x6ed3('0x3b')][_0x6ed3('0x22')]);_0x4bdce1['query']=_[_0x6ed3('0x2e')](_0x252e76[_0x6ed3('0x28')]);_0x4bdce1[_0x6ed3('0x2f')]=_[_0x6ed3('0x30')](_0x4bdce1[_0x6ed3('0x31')],_0x4bdce1[_0x6ed3('0x28')]);_0x47e427[_0x6ed3('0x33')]=_['intersection'](_0x4bdce1[_0x6ed3('0x31')],qs[_0x6ed3('0x32')](_0x252e76['query']['fields']));_0x47e427[_0x6ed3('0x33')]=_0x47e427[_0x6ed3('0x33')]['length']?_0x47e427[_0x6ed3('0x33')]:_0x4bdce1[_0x6ed3('0x31')];if(!_0x252e76['query']['hasOwnProperty'](_0x6ed3('0x40'))){_0x47e427[_0x6ed3('0x16')]=qs[_0x6ed3('0x16')](_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x16')]);_0x47e427[_0x6ed3('0x41')]=qs['offset'](_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x41')]);}_0x47e427['order']=qs[_0x6ed3('0x42')](_0x252e76[_0x6ed3('0x28')]['sort']);_0x47e427[_0x6ed3('0x43')]=qs[_0x6ed3('0x2f')](_['pick'](_0x252e76[_0x6ed3('0x28')],_0x4bdce1[_0x6ed3('0x2f')]));_0x47e427[_0x6ed3('0x43')]['OpenchannelInteractionId']=_0x4c445b['id'];if(_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x44')]){_0x47e427['where']=_[_0x6ed3('0x35')](_0x47e427[_0x6ed3('0x43')],{'$or':_['map'](_0x47e427['attributes'],function(_0x1c777c){var _0x31590e={};_0x31590e[_0x1c777c]={'$like':'%'+_0x252e76[_0x6ed3('0x28')]['filter']+'%'};return _0x31590e;})});}if(_0x252e76['query'][_0x6ed3('0x45')]){var _0x56b004=_0x252e76[_0x6ed3('0x28')][_0x6ed3('0x45')][_0x6ed3('0x46')](',');var _0x1ec616={};_0x1ec616[_0x56b004[0x0]]={'$gte':moment(_0x56b004[0x1])['format'](_0x6ed3('0x47'))};_0x47e427[_0x6ed3('0x43')]=_[_0x6ed3('0x35')](_0x47e427[_0x6ed3('0x43')],_0x1ec616);}_0x47e427=_[_0x6ed3('0x35')]({},_0x47e427,_0x252e76[_0x6ed3('0x36')]);return db[_0x6ed3('0x3b')][_0x6ed3('0x15')]({'where':_0x47e427[_0x6ed3('0x43')]})['then'](function(_0xee934e){_0x1d79e3['count']=_0xee934e;if(_0x252e76[_0x6ed3('0x28')]['includeAll']){_0x47e427['include']=[{'all':!![]}];}return db[_0x6ed3('0x3b')][_0x6ed3('0x27')](_0x47e427);})['then'](function(_0x483772){_0x1d79e3[_0x6ed3('0x48')]=_0x483772;return _0x1d79e3;});}})[_0x6ed3('0x1a')](respondWithFilteredResult(_0x4d419a,_0x47e427))[_0x6ed3('0x2a')](handleError(_0x4d419a,null));};exports[_0x6ed3('0x49')]=function(_0xe47872,_0x2a6868){return db[_0x6ed3('0x21')]['find']({'where':{'id':_0xe47872[_0x6ed3('0x2d')]['id']}})[_0x6ed3('0x1a')](handleEntityNotFound(_0x2a6868,null))['then'](function(_0x3684e5){if(_0x3684e5){return _0x3684e5[_0x6ed3('0x4a')](_0xe47872[_0x6ed3('0x38')][_0x6ed3('0x3c')],_[_0x6ed3('0x3d')](_0xe47872[_0x6ed3('0x38')],['ids','id'])||{})[_0x6ed3('0x4b')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0xe47872['body'][_0x6ed3('0x3c')]}});})['then'](function(_0x51f66a){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0xe47872[_0x6ed3('0x2d')]['id']),'tags':_0x51f66a||[]});return{'id':Number(_0xe47872['params']['id']),'tags':_0x51f66a||[]};});}})[_0x6ed3('0x1a')](respondWithResult(_0x2a6868,null))['catch'](handleError(_0x2a6868,null));};exports[_0x6ed3('0x4c')]=function(_0x3e13a6,_0x400a57){return db['OpenchannelInteraction']['find']({'where':{'id':_0x3e13a6[_0x6ed3('0x2d')]['id']}})[_0x6ed3('0x1a')](handleEntityNotFound(_0x400a57,null))[_0x6ed3('0x1a')](function(_0x136c39){if(_0x136c39){return _0x136c39[_0x6ed3('0x4c')](_0x3e13a6[_0x6ed3('0x28')][_0x6ed3('0x3c')]);}})[_0x6ed3('0x1a')](respondWithStatusCode(_0x400a57,null))[_0x6ed3('0x2a')](handleError(_0x400a57,null));};exports[_0x6ed3('0x4d')]=function(_0x5e0a9e,_0x59d0dc){var _0x1e17b4=moment()[_0x6ed3('0x4e')]()['toString']();var _0x530e31=path[_0x6ed3('0x4f')](config[_0x6ed3('0x50')],_0x6ed3('0x51'),_0x6ed3('0x52'),_0x6ed3('0x53'));var _0x5b48fe=path['join'](config[_0x6ed3('0x50')],_0x6ed3('0x51'),_0x6ed3('0x52'),_0x6ed3('0x54'));var _0x381829=path[_0x6ed3('0x4f')](_0x530e31,_0x1e17b4);var _0xe193c8=util[_0x6ed3('0x55')](_0x6ed3('0x56'),_0x5e0a9e[_0x6ed3('0x2d')]['id'],_0x1e17b4);var _0x4ee158=path[_0x6ed3('0x4f')](_0x530e31,_0xe193c8);var _0x514a46=[];_0x514a46[_0x6ed3('0x57')]({'model':db[_0x6ed3('0x58')],'as':_0x6ed3('0x58'),'attributes':['id',_0x6ed3('0x59')],'raw':!![]});_0x514a46[_0x6ed3('0x57')]({'model':db[_0x6ed3('0x5a')],'as':'Contact','attributes':['id',_0x6ed3('0x5b'),_0x6ed3('0x5c')],'raw':!![]});if(_0x5e0a9e[_0x6ed3('0x28')][_0x6ed3('0x54')]){_0x514a46[_0x6ed3('0x57')]({'model':db['Attachment'],'as':_0x6ed3('0x5d'),'raw':!![]});}var _0x372362=[{'model':db[_0x6ed3('0x3b')],'as':_0x6ed3('0x5e'),'attributes':['id',_0x6ed3('0x38'),'createdAt',_0x6ed3('0x5f'),_0x6ed3('0x60'),'read'],'include':_0x514a46}];_0x372362['push']({'model':db[_0x6ed3('0x61')],'as':'Account','attributes':['id',_0x6ed3('0x1e')]});_0x372362['push']({'model':db['User'],'as':_0x6ed3('0x62'),'attributes':['id',_0x6ed3('0x59')]});return db[_0x6ed3('0x21')][_0x6ed3('0x37')]({'where':{'id':_0x5e0a9e[_0x6ed3('0x2d')]['id']},'include':_0x372362})[_0x6ed3('0x1a')](handleEntityNotFound(_0x59d0dc,null))[_0x6ed3('0x1a')](function(_0x1e4651){if(_0x1e4651){var _0x34ad79=_0x1e4651['get']({'plain':!![]});fs[_0x6ed3('0x63')](_0x381829);var _0x140288={'channel':_0x6ed3('0x64'),'account':_0x34ad79[_0x6ed3('0x65')][_0x6ed3('0x1e')],'agent':_0x34ad79[_0x6ed3('0x62')]?_0x34ad79[_0x6ed3('0x62')][_0x6ed3('0x59')]:_0x6ed3('0x66'),'createdAt':moment(_0x34ad79[_0x6ed3('0x67')])[_0x6ed3('0x55')](_0x6ed3('0x47'))[_0x6ed3('0x68')](),'closedAt':_0x34ad79['closed']?moment(_0x34ad79['closedAt'])[_0x6ed3('0x55')](_0x6ed3('0x47'))[_0x6ed3('0x68')]():'','disposition':_0x34ad79[_0x6ed3('0x69')],'visibility':_0x34ad79[_0x6ed3('0x6a')]?_0x6ed3('0x6b'):_0x6ed3('0x6c'),'messages':_(_0x34ad79[_0x6ed3('0x5e')])[_0x6ed3('0x44')]({'secret':![]})[_0x6ed3('0x20')](function(_0x3ff62b){if(_0x3ff62b[_0x6ed3('0x5d')]){var _0x31a6d2=path[_0x6ed3('0x4f')](_0x5b48fe,_0x3ff62b[_0x6ed3('0x5d')][_0x6ed3('0x6d')]);if(fs['existsSync'](_0x31a6d2)){fs[_0x6ed3('0x6e')](_0x31a6d2)[_0x6ed3('0x6f')](fs[_0x6ed3('0x70')](path[_0x6ed3('0x4f')](_0x381829,_0x3ff62b[_0x6ed3('0x5d')][_0x6ed3('0x6d')])));}}return{'date':moment(_0x3ff62b[_0x6ed3('0x67')])[_0x6ed3('0x55')](_0x6ed3('0x47'))[_0x6ed3('0x68')](),'sender':_0x3ff62b[_0x6ed3('0x5f')]===_0x6ed3('0x71')?_0x3ff62b[_0x6ed3('0x58')]?_0x3ff62b[_0x6ed3('0x58')][_0x6ed3('0x59')]:_0x6ed3('0x72'):_0x3ff62b['Contact'][_0x6ed3('0x5b')]+(_0x3ff62b[_0x6ed3('0x73')][_0x6ed3('0x5c')]?'\x20'+_0x3ff62b['Contact'][_0x6ed3('0x5c')]:''),'body':_0x3ff62b['Attachment']?_0x3ff62b[_0x6ed3('0x5d')][_0x6ed3('0x6d')]:_0x3ff62b['body'],'direction':_0x3ff62b['direction']==='out'?'A':'C','secret':_0x3ff62b[_0x6ed3('0x60')],'read':_0x3ff62b[_0x6ed3('0x74')],'attachment':_0x3ff62b['Attachment']};})[_0x6ed3('0x75')]()};return ejs[_0x6ed3('0x76')](path[_0x6ed3('0x4f')](config[_0x6ed3('0x50')],_0x6ed3('0x51'),_0x6ed3('0x77'),'downloadInteraction.ejs'),{'interaction':_0x140288})[_0x6ed3('0x1a')](function(_0x2839a9){var _0x36f06b=path[_0x6ed3('0x4f')](_0x381829,_0x6ed3('0x78')+_0x34ad79['id']+'-'+_0x1e17b4+_0x6ed3('0x79'));var _0x57c6c8={'path':_0x36f06b,'channel':_0x6ed3('0x64'),'interactionId':_0x34ad79['id']};return pdf[_0x6ed3('0x7a')](_0x2839a9,_0x57c6c8);})['then'](function(){return new Promise(function(_0x732dd8,_0x18d802){zipdir(_0x381829,{'saveTo':_0x4ee158},function(_0x5ebdfb,_0x91ce80){if(_0x5ebdfb)return _0x18d802(_0x5ebdfb);return _0x732dd8(_0x91ce80);});})['then'](function(){return new Promise(function(_0x5860e7,_0x2034b9){rimraf(_0x381829,function(_0x29be27){if(_0x29be27)_0x2034b9(_0x29be27);return _0x5860e7();});});})[_0x6ed3('0x1a')](function(){return _0x59d0dc[_0x6ed3('0x4d')](_0x4ee158,_0xe193c8,function(_0x9acc3f){if(_0x9acc3f){logger[_0x6ed3('0x1c')](_0x6ed3('0x7b'),_0x9acc3f);}else{fs[_0x6ed3('0x7c')](_0x4ee158);}});});});}else{return _0x59d0dc['sendStatus'](0xc8);}})[_0x6ed3('0x2a')](handleError(_0x59d0dc,null));};
\ No newline at end of file
index e6d514c..954b837 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eff=['catch','hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x501fde,_0x1ee95c){var _0x248bbe=function(_0x55dca6){while(--_0x55dca6){_0x501fde['push'](_0x501fde['shift']());}};_0x248bbe(++_0x1ee95c);}(_0x5eff,0xd2));var _0xf5ef=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x5eff[_0x32f7d7];return _0x133d09;};'use strict';var EventEmitter=require(_0xf5ef('0x0'));var OpenchannelInteraction=require(_0xf5ef('0x1'))['db'][_0xf5ef('0x2')];var OpenchannelMessage=require(_0xf5ef('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf5ef('0x3')](0x0);var events={'afterCreate':_0xf5ef('0x4'),'afterUpdate':_0xf5ef('0x5'),'afterDestroy':_0xf5ef('0x6')};function emitEvent(_0x5c653c){return function(_0x22c0cf,_0x263592,_0x42fb84){_0x22c0cf['getUsers']({'attributes':['id'],'raw':!![]})[_0xf5ef('0x7')](function(_0x34b03d){_0x22c0cf[_0xf5ef('0x8')](_0xf5ef('0x9'),_0x34b03d[_0xf5ef('0xa')](function(_0x5646fc){return{'id':_0x5646fc['id']};}));return OpenchannelMessage[_0xf5ef('0xb')]({'where':{'OpenchannelInteractionId':_0x22c0cf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf5ef('0x7')](function(_0x11c264){_0x22c0cf[_0xf5ef('0x8')](_0xf5ef('0xc'),_0x11c264[_0xf5ef('0xd')]);OpenchannelInteractionEvents['emit'](_0x5c653c+':'+_0x22c0cf['id'],_0x22c0cf);OpenchannelInteractionEvents['emit'](_0x5c653c,_0x22c0cf);_0x42fb84(null);})[_0xf5ef('0xe')](_0x42fb84(null));};}for(var e in events){if(events[_0xf5ef('0xf')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0xaafc=['catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','getUsers','then','map','findAll','emit'];(function(_0x74d12d,_0x1970a1){var _0x325250=function(_0x126e57){while(--_0x126e57){_0x74d12d['push'](_0x74d12d['shift']());}};_0x325250(++_0x1970a1);}(_0xaafc,0xff));var _0xcaaf=function(_0x4ba1fe,_0x1c4c1d){_0x4ba1fe=_0x4ba1fe-0x0;var _0xa7a837=_0xaafc[_0x4ba1fe];return _0xa7a837;};'use strict';var EventEmitter=require(_0xcaaf('0x0'));var OpenchannelInteraction=require(_0xcaaf('0x1'))['db'][_0xcaaf('0x2')];var OpenchannelMessage=require(_0xcaaf('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xcaaf('0x3')](0x0);var events={'afterCreate':_0xcaaf('0x4'),'afterUpdate':_0xcaaf('0x5'),'afterDestroy':'remove'};function emitEvent(_0x36017f){return function(_0x4b89c7,_0x54ec26,_0x4168e6){_0x4b89c7[_0xcaaf('0x6')]({'attributes':['id'],'raw':!![]})[_0xcaaf('0x7')](function(_0x4ce178){_0x4b89c7['setDataValue']('Users',_0x4ce178[_0xcaaf('0x8')](function(_0x190c30){return{'id':_0x190c30['id']};}));return OpenchannelMessage[_0xcaaf('0x9')]({'where':{'OpenchannelInteractionId':_0x4b89c7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcaaf('0x7')](function(_0x5f1fd2){_0x4b89c7['setDataValue']('unreadMessages',_0x5f1fd2['length']);OpenchannelInteractionEvents[_0xcaaf('0xa')](_0x36017f+':'+_0x4b89c7['id'],_0x4b89c7);OpenchannelInteractionEvents[_0xcaaf('0xa')](_0x36017f,_0x4b89c7);_0x4168e6(null);})[_0xcaaf('0xb')](_0x4168e6(null));};}for(var e in events){if(events[_0xcaaf('0xc')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xcaaf('0xd')]=OpenchannelInteractionEvents;
\ No newline at end of file
index e8b0690..2c68975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad60=['api','bluebird','request-promise','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger'];(function(_0x59ebcc,_0x29dc7c){var _0x5a5356=function(_0x50928f){while(--_0x50928f){_0x59ebcc['push'](_0x59ebcc['shift']());}};_0x5a5356(++_0x29dc7c);}(_0xad60,0x19f));var _0x0ad6=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xad60[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ad6('0x0'))(_0x0ad6('0x1'));var moment=require('moment');var BPromise=require(_0x0ad6('0x2'));var rp=require(_0x0ad6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad6('0x4'));var config=require('../../config/environment');var attributes=require(_0x0ad6('0x5'));module[_0x0ad6('0x6')]=function(_0x2a5a88,_0x245a04){return _0x2a5a88[_0x0ad6('0x7')](_0x0ad6('0x8'),attributes,{'tableName':_0x0ad6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ad6('0xa'),'collate':_0x0ad6('0xb'),'hooks':{'beforeUpdate':function(_0x480325,_0x41d2bf,_0xb5eb02){if(_0x480325[_0x0ad6('0xc')](_0x0ad6('0xd'))){_0x480325['closedAt']=moment()[_0x0ad6('0xe')](_0x0ad6('0xf'));}_0xb5eb02(null,_0x480325);}}});};
\ No newline at end of file
+var _0x1d63=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x11a361,_0x227f16){var _0x488c43=function(_0x327c93){while(--_0x327c93){_0x11a361['push'](_0x11a361['shift']());}};_0x488c43(++_0x227f16);}(_0x1d63,0x144));var _0x31d6=function(_0x58c6b9,_0x901130){_0x58c6b9=_0x58c6b9-0x0;var _0xa03aeb=_0x1d63[_0x58c6b9];return _0xa03aeb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x31d6('0x0'))(_0x31d6('0x1'));var moment=require(_0x31d6('0x2'));var BPromise=require(_0x31d6('0x3'));var rp=require(_0x31d6('0x4'));var fs=require('fs');var path=require(_0x31d6('0x5'));var rimraf=require(_0x31d6('0x6'));var config=require(_0x31d6('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x31d6('0x8')]=function(_0x27a344,_0xfef695){return _0x27a344[_0x31d6('0x9')](_0x31d6('0xa'),attributes,{'tableName':_0x31d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x31d6('0xc'),'collate':_0x31d6('0xd'),'hooks':{'beforeUpdate':function(_0x5b9a1c,_0x35ec04,_0x394725){if(_0x5b9a1c[_0x31d6('0xe')]('closed')){_0x5b9a1c[_0x31d6('0xf')]=moment()[_0x31d6('0x10')](_0x31d6('0x11'));}_0x394725(null,_0x5b9a1c);}}});};
\ No newline at end of file
index 69c20c4..f229ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7b6=['request\x20sent','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','info','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','stringify','catch','AddTagsToOpenchannelInteraction','addTags','omit','ids','AddTags','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x2e5069,_0x3a1115){var _0x2f00ad=function(_0x3cba4f){while(--_0x3cba4f){_0x2e5069['push'](_0x2e5069['shift']());}};_0x2f00ad(++_0x3a1115);}(_0xe7b6,0x170));var _0x6e7b=function(_0x2bcedb,_0x545cf4){_0x2bcedb=_0x2bcedb-0x0;var _0x1c7e2e=_0xe7b6[_0x2bcedb];return _0x1c7e2e;};'use strict';var _=require(_0x6e7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6e7b('0x1'));var fs=require('fs');var Redis=require(_0x6e7b('0x2'));var db=require(_0x6e7b('0x3'))['db'];var utils=require(_0x6e7b('0x4'));var logger=require(_0x6e7b('0x5'))(_0x6e7b('0x6'));var config=require(_0x6e7b('0x7'));var jayson=require(_0x6e7b('0x8'));var client=jayson[_0x6e7b('0x9')][_0x6e7b('0xa')]({'port':0x232a});config[_0x6e7b('0xb')]=_[_0x6e7b('0xc')](config[_0x6e7b('0xb')],{'host':_0x6e7b('0xd'),'port':0x18eb});var socket=require(_0x6e7b('0xe'))(new Redis(config[_0x6e7b('0xb')]));require(_0x6e7b('0xf'))['register'](socket);function respondWithRpcPromise(_0x1542c6,_0x1520a5,_0x3ebec6){return new BPromise(function(_0x115d78,_0xc62534){return client[_0x6e7b('0x10')](_0x1542c6,_0x3ebec6)['then'](function(_0x1a32c4){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x1520a5,'request\x20sent');logger[_0x6e7b('0x11')](_0x6e7b('0x12'),_0x1520a5,_0x6e7b('0x13'),JSON['stringify'](_0x1a32c4));if(_0x1a32c4['error']){if(_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x15')]===0x1f4){logger[_0x6e7b('0x14')](_0x6e7b('0x16'),_0x1520a5,_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x17')]);return _0xc62534(_0x1a32c4['error']['message']);}logger[_0x6e7b('0x14')](_0x6e7b('0x16'),_0x1520a5,_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x17')]);return _0x115d78(_0x1a32c4[_0x6e7b('0x14')][_0x6e7b('0x17')]);}else{logger[_0x6e7b('0x18')](_0x6e7b('0x16'),_0x1520a5,_0x6e7b('0x13'));_0x115d78(_0x1a32c4[_0x6e7b('0x19')]['message']);}})['catch'](function(_0x15c9c4){logger['error'](_0x6e7b('0x16'),_0x1520a5,_0x15c9c4);_0xc62534(_0x15c9c4);});});}exports[_0x6e7b('0x1a')]=function(_0x4f7c4b){var _0x444464=this;return new Promise(function(_0x585cd9,_0x511629){return db[_0x6e7b('0x1b')][_0x6e7b('0x1c')](_0x4f7c4b[_0x6e7b('0x1d')],{'raw':_0x4f7c4b[_0x6e7b('0x1e')]?_0x4f7c4b[_0x6e7b('0x1e')][_0x6e7b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7c4b[_0x6e7b('0x1e')]?_0x4f7c4b['options'][_0x6e7b('0x20')]||null:null,'attributes':_0x4f7c4b['options']?_0x4f7c4b[_0x6e7b('0x1e')][_0x6e7b('0x21')]||null:null,'limit':_0x4f7c4b[_0x6e7b('0x1e')]?_0x4f7c4b['options'][_0x6e7b('0x22')]||null:null})[_0x6e7b('0x23')](function(_0x2b123d){logger[_0x6e7b('0x18')](_0x6e7b('0x1a'),_0x4f7c4b);logger[_0x6e7b('0x11')](_0x6e7b('0x1a'),_0x4f7c4b,JSON[_0x6e7b('0x24')](_0x2b123d));_0x585cd9(_0x2b123d);})[_0x6e7b('0x25')](function(_0xd26c31){logger['error'](_0x6e7b('0x1a'),_0xd26c31[_0x6e7b('0x17')],_0x4f7c4b);_0x511629(_0x444464[_0x6e7b('0x14')](0x1f4,_0xd26c31[_0x6e7b('0x17')]));});});};exports[_0x6e7b('0x26')]=function(_0x38115c){return new Promise(function(_0xe898d4,_0x382d31){return db[_0x6e7b('0x1b')]['find']({'where':_0x38115c[_0x6e7b('0x1e')]?_0x38115c[_0x6e7b('0x1e')]['where']||null:null})[_0x6e7b('0x23')](function(_0x53f864){if(_0x53f864){return _0x53f864[_0x6e7b('0x27')](_0x38115c[_0x6e7b('0x1d')]['ids'],_[_0x6e7b('0x28')](_0x38115c[_0x6e7b('0x1d')],[_0x6e7b('0x29'),'id'])||{});}})['spread'](function(_0x437b6e){logger['info']('AddTags',_0x38115c);logger[_0x6e7b('0x11')](_0x6e7b('0x2a'),_0x38115c,JSON[_0x6e7b('0x24')](_0x437b6e));_0xe898d4(_0x437b6e);})['catch'](function(_0xe3a380){logger['error'](_0x6e7b('0x2a'),_0xe3a380[_0x6e7b('0x17')],_0x38115c);_0x382d31(_this['error'](0x1f4,_0xe3a380[_0x6e7b('0x17')]));});});};
\ No newline at end of file
+var _0x9cc8=['options','where','attributes','AddTagsToOpenchannelInteraction','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body'];(function(_0x5c948e,_0x237461){var _0x626fc2=function(_0x58de51){while(--_0x58de51){_0x5c948e['push'](_0x5c948e['shift']());}};_0x626fc2(++_0x237461);}(_0x9cc8,0xf2));var _0x89cc=function(_0x4e53e5,_0x27b3d0){_0x4e53e5=_0x4e53e5-0x0;var _0x287818=_0x9cc8[_0x4e53e5];return _0x287818;};'use strict';var _=require(_0x89cc('0x0'));var util=require(_0x89cc('0x1'));var moment=require(_0x89cc('0x2'));var BPromise=require(_0x89cc('0x3'));var rs=require(_0x89cc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x89cc('0x6'))(_0x89cc('0x7'));var config=require(_0x89cc('0x8'));var jayson=require(_0x89cc('0x9'));var client=jayson[_0x89cc('0xa')][_0x89cc('0xb')]({'port':0x232a});config[_0x89cc('0xc')]=_[_0x89cc('0xd')](config[_0x89cc('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x89cc('0xe')](socket);function respondWithRpcPromise(_0x4f4b9a,_0x3d7afc,_0x119c00){return new BPromise(function(_0x4b64e4,_0x3df31b){return client[_0x89cc('0xf')](_0x4f4b9a,_0x119c00)[_0x89cc('0x10')](function(_0x55adbf){logger[_0x89cc('0x11')](_0x89cc('0x12'),_0x3d7afc,_0x89cc('0x13'));logger[_0x89cc('0x14')](_0x89cc('0x15'),_0x3d7afc,'request\x20sent',JSON[_0x89cc('0x16')](_0x55adbf));if(_0x55adbf[_0x89cc('0x17')]){if(_0x55adbf[_0x89cc('0x17')]['code']===0x1f4){logger[_0x89cc('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3d7afc,_0x55adbf[_0x89cc('0x17')][_0x89cc('0x18')]);return _0x3df31b(_0x55adbf[_0x89cc('0x17')]['message']);}logger['error'](_0x89cc('0x12'),_0x3d7afc,_0x55adbf[_0x89cc('0x17')]['message']);return _0x4b64e4(_0x55adbf['error']['message']);}else{logger[_0x89cc('0x11')](_0x89cc('0x12'),_0x3d7afc,_0x89cc('0x13'));_0x4b64e4(_0x55adbf[_0x89cc('0x19')][_0x89cc('0x18')]);}})[_0x89cc('0x1a')](function(_0x50793f){logger['error'](_0x89cc('0x12'),_0x3d7afc,_0x50793f);_0x3df31b(_0x50793f);});});}exports[_0x89cc('0x1b')]=function(_0x3bcf0c){var _0xf3aef4=this;return new Promise(function(_0x5eee79,_0x429d2d){return db[_0x89cc('0x1c')][_0x89cc('0x1d')](_0x3bcf0c[_0x89cc('0x1e')],{'raw':_0x3bcf0c['options']?_0x3bcf0c[_0x89cc('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bcf0c[_0x89cc('0x1f')]?_0x3bcf0c[_0x89cc('0x1f')][_0x89cc('0x20')]||null:null,'attributes':_0x3bcf0c[_0x89cc('0x1f')]?_0x3bcf0c['options'][_0x89cc('0x21')]||null:null,'limit':_0x3bcf0c[_0x89cc('0x1f')]?_0x3bcf0c[_0x89cc('0x1f')]['limit']||null:null})[_0x89cc('0x10')](function(_0x3aad00){logger[_0x89cc('0x11')](_0x89cc('0x1b'),_0x3bcf0c);logger[_0x89cc('0x14')](_0x89cc('0x1b'),_0x3bcf0c,JSON[_0x89cc('0x16')](_0x3aad00));_0x5eee79(_0x3aad00);})[_0x89cc('0x1a')](function(_0x5dcbba){logger[_0x89cc('0x17')]('UpdateOpenchannelInteraction',_0x5dcbba['message'],_0x3bcf0c);_0x429d2d(_0xf3aef4['error'](0x1f4,_0x5dcbba[_0x89cc('0x18')]));});});};exports[_0x89cc('0x22')]=function(_0x2ead52){return new Promise(function(_0x1d75b2,_0x44faf0){return db['OpenchannelInteraction']['find']({'where':_0x2ead52[_0x89cc('0x1f')]?_0x2ead52['options'][_0x89cc('0x20')]||null:null})[_0x89cc('0x10')](function(_0x37925a){if(_0x37925a){return _0x37925a[_0x89cc('0x23')](_0x2ead52[_0x89cc('0x1e')][_0x89cc('0x24')],_['omit'](_0x2ead52[_0x89cc('0x1e')],[_0x89cc('0x24'),'id'])||{});}})[_0x89cc('0x25')](function(_0x12ce31){logger[_0x89cc('0x11')]('AddTags',_0x2ead52);logger[_0x89cc('0x14')](_0x89cc('0x26'),_0x2ead52,JSON['stringify'](_0x12ce31));_0x1d75b2(_0x12ce31);})[_0x89cc('0x1a')](function(_0x4353f9){logger['error']('AddTags',_0x4353f9['message'],_0x2ead52);_0x44faf0(_this[_0x89cc('0x17')](0x1f4,_0x4353f9['message']));});});};
\ No newline at end of file
index 290545f..1de2800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6650=['update','emit','register','./openchannelInteraction.events','save','remove'];(function(_0x5ac84c,_0x287781){var _0x3c53d2=function(_0x40cde0){while(--_0x40cde0){_0x5ac84c['push'](_0x5ac84c['shift']());}};_0x3c53d2(++_0x287781);}(_0x6650,0x1a1));var _0x0665=function(_0x5e16f8,_0x3c55b3){_0x5e16f8=_0x5e16f8-0x0;var _0x10c885=_0x6650[_0x5e16f8];return _0x10c885;};'use strict';var OpenchannelInteractionEvents=require(_0x0665('0x0'));var events=[_0x0665('0x1'),_0x0665('0x2'),_0x0665('0x3')];function createListener(_0xbe4722,_0x44bed7){return function(_0x9f9c90){_0x44bed7[_0x0665('0x4')](_0xbe4722,_0x9f9c90);};}function removeListener(_0x5d0a51,_0x406971){return function(){OpenchannelInteractionEvents['removeListener'](_0x5d0a51,_0x406971);};}exports[_0x0665('0x5')]=function(_0x323486){for(var _0x46d84a=0x0,_0x4cdcc6=events['length'];_0x46d84a<_0x4cdcc6;_0x46d84a++){var _0x53f696=events[_0x46d84a];var _0x58ed97=createListener('openchannelInteraction:'+_0x53f696,_0x323486);OpenchannelInteractionEvents['on'](_0x53f696,_0x58ed97);}};
\ No newline at end of file
+var _0x699b=['register','./openchannelInteraction.events','remove','emit','removeListener'];(function(_0x3060c0,_0x1900ed){var _0x494ad2=function(_0x314783){while(--_0x314783){_0x3060c0['push'](_0x3060c0['shift']());}};_0x494ad2(++_0x1900ed);}(_0x699b,0x1cd));var _0xb699=function(_0x36bf85,_0x5f0214){_0x36bf85=_0x36bf85-0x0;var _0x42a522=_0x699b[_0x36bf85];return _0x42a522;};'use strict';var OpenchannelInteractionEvents=require(_0xb699('0x0'));var events=['save',_0xb699('0x1'),'update'];function createListener(_0x2f48ff,_0x2c36ca){return function(_0x18ea81){_0x2c36ca[_0xb699('0x2')](_0x2f48ff,_0x18ea81);};}function removeListener(_0x549082,_0x12d214){return function(){OpenchannelInteractionEvents[_0xb699('0x3')](_0x549082,_0x12d214);};}exports[_0xb699('0x4')]=function(_0x23e34d){for(var _0x6c3066=0x0,_0xfcbce7=events['length'];_0x6c3066<_0xfcbce7;_0x6c3066++){var _0x47ed8a=events[_0x6c3066];var _0x88d924=createListener('openchannelInteraction:'+_0x47ed8a,_0x23e34d);OpenchannelInteractionEvents['on'](_0x47ed8a,_0x88d924);}};
\ No newline at end of file
index 6b72a8d..b0459da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x58eca9,_0x219608){var _0x25a12e=function(_0x1d3695){while(--_0x1d3695){_0x58eca9['push'](_0x58eca9['shift']());}};_0x25a12e(++_0x219608);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xcb91[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router;
\ No newline at end of file
+var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x29266f,_0xbe0015){var _0x16c306=function(_0x38a7c4){while(--_0x38a7c4){_0x29266f['push'](_0x29266f['shift']());}};_0x16c306(++_0xbe0015);}(_0xe706,0xa3));var _0x6e70=function(_0x197043,_0x3ebf47){_0x197043=_0x197043-0x0;var _0x233e33=_0xe706[_0x197043];return _0x233e33;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router;
\ No newline at end of file
index af7ebfc..67f23b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1678=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x56c59b,_0x27a5c0){var _0x1f3095=function(_0x2a71a0){while(--_0x2a71a0){_0x56c59b['push'](_0x56c59b['shift']());}};_0x1f3095(++_0x27a5c0);}(_0x1678,0x17b));var _0x8167=function(_0xe67313,_0x32599a){_0xe67313=_0xe67313-0x0;var _0x1d9a1f=_0x1678[_0xe67313];return _0x1d9a1f;};'use strict';var Sequelize=require(_0x8167('0x0'));module[_0x8167('0x1')]={'body':{'type':Sequelize[_0x8167('0x2')](_0x8167('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x8167('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8167('0x5')),'defaultValue':_0x8167('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8167('0x6')]},'providerName':{'type':Sequelize[_0x8167('0x7')]},'providerResponse':{'type':Sequelize[_0x8167('0x2')]}};
\ No newline at end of file
+var _0x1775=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4e4c69,_0x5d7f1c){var _0x35def9=function(_0x1c962f){while(--_0x1c962f){_0x4e4c69['push'](_0x4e4c69['shift']());}};_0x35def9(++_0x5d7f1c);}(_0x1775,0x1db));var _0x5177=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1775[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'body':{'type':Sequelize[_0x5177('0x1')](_0x5177('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x5177('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5177('0x4')]('in',_0x5177('0x5')),'defaultValue':_0x5177('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x5177('0x6')]},'providerName':{'type':Sequelize[_0x5177('0x7')]},'providerResponse':{'type':Sequelize[_0x5177('0x1')]}};
\ No newline at end of file
index 9092371..5220f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95bb=['../../mysqldb','defaults','localhost','socket.io-emitter','redis','./openchannelMessage.socket','register','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','key','query','keys','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','options','includeAll','include','rows','show','params','length','merge','find','body','describe','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','rejectMessage','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x48ec91,_0x212edc){var _0x22766c=function(_0x136751){while(--_0x136751){_0x48ec91['push'](_0x48ec91['shift']());}};_0x22766c(++_0x212edc);}(_0x95bb,0xed));var _0xb95b=function(_0x153e72,_0x22bed5){_0x153e72=_0x153e72-0x0;var _0x2fd233=_0x95bb[_0x153e72];return _0x2fd233;};'use strict';var emlformat=require(_0xb95b('0x0'));var rimraf=require(_0xb95b('0x1'));var zipdir=require(_0xb95b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb95b('0x3'));var moment=require(_0xb95b('0x4'));var BPromise=require(_0xb95b('0x5'));var Mustache=require(_0xb95b('0x6'));var util=require('util');var path=require(_0xb95b('0x7'));var sox=require(_0xb95b('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb95b('0x9'));var _=require(_0xb95b('0xa'));var squel=require(_0xb95b('0xb'));var crypto=require(_0xb95b('0xc'));var jsforce=require(_0xb95b('0xd'));var deskjs=require(_0xb95b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb95b('0xf'));var Papa=require(_0xb95b('0x10'));var Redis=require('ioredis');var authService=require(_0xb95b('0x11'));var qs=require(_0xb95b('0x12'));var as=require(_0xb95b('0x13'));var hardwareService=require(_0xb95b('0x14'));var logger=require(_0xb95b('0x15'))('api');var utils=require(_0xb95b('0x16'));var config=require(_0xb95b('0x17'));var licenseUtil=require(_0xb95b('0x18'));var db=require(_0xb95b('0x19'))['db'];config['redis']=_[_0xb95b('0x1a')](config['redis'],{'host':_0xb95b('0x1b'),'port':0x18eb});var socket=require(_0xb95b('0x1c'))(new Redis(config[_0xb95b('0x1d')]));require(_0xb95b('0x1e'))[_0xb95b('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb95b('0x20')][_0xb95b('0x21')]({'port':0x232c});var client9002=jayson[_0xb95b('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x142f23,_0x5254da,_0x5d56ec,_0xa009a8){return new BPromise(function(_0x2b3fee,_0x1103e4){var _0xa7ff6=_0xa009a8||client;return _0xa7ff6['request'](_0x142f23,_0x5d56ec)[_0xb95b('0x22')](function(_0x58c3ee){logger[_0xb95b('0x23')](_0xb95b('0x24'),_0x5254da,'request\x20sent');logger[_0xb95b('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x5254da,_0xb95b('0x26'),JSON['stringify'](_0x58c3ee));if(_0x58c3ee[_0xb95b('0x27')]){if(_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x28')]===0x1f4){logger[_0xb95b('0x27')](_0xb95b('0x24'),_0x5254da,_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x29')]);return _0x1103e4(_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x29')]);}logger['error'](_0xb95b('0x24'),_0x5254da,_0x58c3ee[_0xb95b('0x27')][_0xb95b('0x29')]);return _0x2b3fee(_0x58c3ee[_0xb95b('0x27')]['message']);}else{logger[_0xb95b('0x23')](_0xb95b('0x24'),_0x5254da,_0xb95b('0x26'));_0x2b3fee(_0x58c3ee[_0xb95b('0x2a')][_0xb95b('0x29')]);}})[_0xb95b('0x2b')](function(_0x329318){logger[_0xb95b('0x27')](_0xb95b('0x24'),_0x5254da,_0x329318);_0x1103e4(_0x329318);});});}function respondWithStatusCode(_0x503338,_0x38b5b4){_0x38b5b4=_0x38b5b4||0xcc;return function(_0x4d14f0){if(_0x4d14f0){return _0x503338['sendStatus'](_0x38b5b4);}return _0x503338[_0xb95b('0x2c')](_0x38b5b4)['end']();};}function respondWithResult(_0x391435,_0x3cc327){_0x3cc327=_0x3cc327||0xc8;return function(_0x4380bb){if(_0x4380bb){return _0x391435[_0xb95b('0x2c')](_0x3cc327)[_0xb95b('0x2d')](_0x4380bb);}};}function respondWithFilteredResult(_0x4bc66c,_0x1ce409){return function(_0xa0ec19){if(_0xa0ec19){var _0x9b9159=typeof _0x1ce409['offset']===_0xb95b('0x2e')&&typeof _0x1ce409[_0xb95b('0x2f')]===_0xb95b('0x2e');var _0x854b73=_0xa0ec19['count'];var _0x45f41a=_0x9b9159?0x0:_0x1ce409['offset'];var _0x2b4d22=_0x9b9159?_0xa0ec19[_0xb95b('0x30')]:_0x1ce409[_0xb95b('0x31')]+_0x1ce409[_0xb95b('0x2f')];var _0x46c519;if(_0x2b4d22>=_0x854b73){_0x2b4d22=_0x854b73;_0x46c519=0xc8;}else{_0x46c519=0xce;}_0x4bc66c[_0xb95b('0x2c')](_0x46c519);return _0x4bc66c[_0xb95b('0x32')](_0xb95b('0x33'),_0x45f41a+'-'+_0x2b4d22+'/'+_0x854b73)[_0xb95b('0x2d')](_0xa0ec19);}return null;};}function patchUpdates(_0x3c4ac7){return function(_0x3d4aa4){try{jsonpatch[_0xb95b('0x34')](_0x3d4aa4,_0x3c4ac7,!![]);}catch(_0x3e7825){return BPromise[_0xb95b('0x35')](_0x3e7825);}return _0x3d4aa4[_0xb95b('0x36')]();};}function saveUpdates(_0x180929,_0x18ddaf){return function(_0x83ac2b){if(_0x83ac2b){return _0x83ac2b[_0xb95b('0x37')](_0x180929)[_0xb95b('0x22')](function(_0x3d7807){return _0x3d7807;});}return null;};}function removeEntity(_0x1ab692,_0x2ea0d6){return function(_0x373bf){if(_0x373bf){return _0x373bf[_0xb95b('0x38')]()[_0xb95b('0x22')](function(){_0x1ab692[_0xb95b('0x2c')](0xcc)[_0xb95b('0x39')]();});}};}function handleEntityNotFound(_0x1aca83,_0x16f882){return function(_0x30521c){if(!_0x30521c){_0x1aca83['sendStatus'](0x194);}return _0x30521c;};}function handleError(_0x3ece8d,_0x46becc){_0x46becc=_0x46becc||0x1f4;return function(_0x39bc6f){logger[_0xb95b('0x27')](_0x39bc6f[_0xb95b('0x3a')]);if(_0x39bc6f[_0xb95b('0x3b')]){delete _0x39bc6f[_0xb95b('0x3b')];}_0x3ece8d[_0xb95b('0x2c')](_0x46becc)[_0xb95b('0x3c')](_0x39bc6f);};}exports['index']=function(_0x228c90,_0x705da7){var _0x4e8bde={},_0x14f10b={},_0x3f43d3={'count':0x0,'rows':[]};var _0x2ea8ea=_[_0xb95b('0x3d')](db[_0xb95b('0x3e')][_0xb95b('0x3f')],function(_0x48a47d){return{'name':_0x48a47d[_0xb95b('0x40')],'type':_0x48a47d['type'][_0xb95b('0x41')]};});_0x14f10b['model']=_['map'](_0x2ea8ea,'name');_0x14f10b[_0xb95b('0x42')]=_[_0xb95b('0x43')](_0x228c90[_0xb95b('0x42')]);_0x14f10b['filters']=_[_0xb95b('0x44')](_0x14f10b['model'],_0x14f10b[_0xb95b('0x42')]);_0x4e8bde[_0xb95b('0x45')]=_[_0xb95b('0x44')](_0x14f10b['model'],qs[_0xb95b('0x46')](_0x228c90[_0xb95b('0x42')][_0xb95b('0x46')]));_0x4e8bde[_0xb95b('0x45')]=_0x4e8bde[_0xb95b('0x45')]['length']?_0x4e8bde[_0xb95b('0x45')]:_0x14f10b[_0xb95b('0x47')];if(!_0x228c90['query'][_0xb95b('0x48')](_0xb95b('0x49'))){_0x4e8bde['limit']=qs[_0xb95b('0x2f')](_0x228c90[_0xb95b('0x42')][_0xb95b('0x2f')]);_0x4e8bde['offset']=qs['offset'](_0x228c90['query'][_0xb95b('0x31')]);}_0x4e8bde[_0xb95b('0x4a')]=qs['sort'](_0x228c90[_0xb95b('0x42')][_0xb95b('0x4b')]);_0x4e8bde['where']=qs[_0xb95b('0x4c')](_[_0xb95b('0x4d')](_0x228c90[_0xb95b('0x42')],_0x14f10b['filters']),_0x2ea8ea);if(_0x228c90['query'][_0xb95b('0x4e')]){_0x4e8bde[_0xb95b('0x4f')]=_['merge'](_0x4e8bde[_0xb95b('0x4f')],{'$or':_[_0xb95b('0x3d')](_0x2ea8ea,function(_0x5ebdc1){if(_0x5ebdc1[_0xb95b('0x50')]!==_0xb95b('0x51')){var _0x675165={};_0x675165[_0x5ebdc1[_0xb95b('0x3b')]]={'$like':'%'+_0x228c90[_0xb95b('0x42')][_0xb95b('0x4e')]+'%'};return _0x675165;}})});}_0x4e8bde=_['merge']({},_0x4e8bde,_0x228c90[_0xb95b('0x52')]);var _0xda6a01={'where':_0x4e8bde[_0xb95b('0x4f')]};return db[_0xb95b('0x3e')][_0xb95b('0x30')](_0xda6a01)[_0xb95b('0x22')](function(_0x4661cd){_0x3f43d3[_0xb95b('0x30')]=_0x4661cd;if(_0x228c90['query'][_0xb95b('0x53')]){_0x4e8bde[_0xb95b('0x54')]=[{'all':!![]}];}return db[_0xb95b('0x3e')]['findAll'](_0x4e8bde);})['then'](function(_0x37e8e6){_0x3f43d3[_0xb95b('0x55')]=_0x37e8e6;return _0x3f43d3;})['then'](respondWithFilteredResult(_0x705da7,_0x4e8bde))['catch'](handleError(_0x705da7,null));};exports[_0xb95b('0x56')]=function(_0x487f16,_0x26708b){var _0x723a00={'raw':!![],'where':{'id':_0x487f16[_0xb95b('0x57')]['id']}},_0x11e92e={};_0x11e92e['model']=_[_0xb95b('0x43')](db[_0xb95b('0x3e')][_0xb95b('0x3f')]);_0x11e92e['query']=_[_0xb95b('0x43')](_0x487f16[_0xb95b('0x42')]);_0x11e92e['filters']=_[_0xb95b('0x44')](_0x11e92e[_0xb95b('0x47')],_0x11e92e[_0xb95b('0x42')]);_0x723a00[_0xb95b('0x45')]=_[_0xb95b('0x44')](_0x11e92e['model'],qs[_0xb95b('0x46')](_0x487f16[_0xb95b('0x42')][_0xb95b('0x46')]));_0x723a00['attributes']=_0x723a00[_0xb95b('0x45')][_0xb95b('0x58')]?_0x723a00[_0xb95b('0x45')]:_0x11e92e[_0xb95b('0x47')];if(_0x487f16[_0xb95b('0x42')][_0xb95b('0x53')]){_0x723a00['include']=[{'all':!![]}];}_0x723a00=_[_0xb95b('0x59')]({},_0x723a00,_0x487f16['options']);return db[_0xb95b('0x3e')][_0xb95b('0x5a')](_0x723a00)[_0xb95b('0x22')](handleEntityNotFound(_0x26708b,null))[_0xb95b('0x22')](respondWithResult(_0x26708b,null))[_0xb95b('0x2b')](handleError(_0x26708b,null));};exports['create']=function(_0x15ca15,_0x11a082){return db[_0xb95b('0x3e')]['create'](_0x15ca15[_0xb95b('0x5b')],{})['then'](respondWithResult(_0x11a082,0xc9))[_0xb95b('0x2b')](handleError(_0x11a082,null));};exports[_0xb95b('0x37')]=function(_0x3d48ce,_0x289d6b){if(_0x3d48ce[_0xb95b('0x5b')]['id']){delete _0x3d48ce[_0xb95b('0x5b')]['id'];}return db[_0xb95b('0x3e')][_0xb95b('0x5a')]({'where':{'id':_0x3d48ce['params']['id']}})[_0xb95b('0x22')](handleEntityNotFound(_0x289d6b,null))[_0xb95b('0x22')](saveUpdates(_0x3d48ce[_0xb95b('0x5b')],null))['then'](respondWithResult(_0x289d6b,null))[_0xb95b('0x2b')](handleError(_0x289d6b,null));};exports[_0xb95b('0x38')]=function(_0x3fd68a,_0x5ef228){return db[_0xb95b('0x3e')][_0xb95b('0x5a')]({'where':{'id':_0x3fd68a[_0xb95b('0x57')]['id']}})['then'](handleEntityNotFound(_0x5ef228,null))[_0xb95b('0x22')](removeEntity(_0x5ef228,null))['catch'](handleError(_0x5ef228,null));};exports[_0xb95b('0x5c')]=function(_0x278cff,_0x3ec880){return db[_0xb95b('0x3e')][_0xb95b('0x5c')]()[_0xb95b('0x22')](respondWithResult(_0x3ec880,null))[_0xb95b('0x2b')](handleError(_0x3ec880,null));};var interaction_log=require(_0xb95b('0x15'))('openchannel-interactions');exports[_0xb95b('0x5d')]=function(_0x349fde,_0x21d5a9,_0xccfd0b){var _0xf7f663={'agent':{},'channel':_0xb95b('0x5e')};if(_0x349fde[_0xb95b('0x5b')]['id']){delete _0x349fde[_0xb95b('0x5b')]['id'];}_0x349fde[_0xb95b('0x5b')]['read']=!![];_0x349fde[_0xb95b('0x5b')][_0xb95b('0x5f')]=moment()[_0xb95b('0x60')](_0xb95b('0x61'));_0x349fde[_0xb95b('0x5b')][_0xb95b('0x62')]=_0x349fde['body'][_0xb95b('0x62')]||_0x349fde[_0xb95b('0x63')]['id'];_0xf7f663[_0xb95b('0x64')]['id']=_0x349fde[_0xb95b('0x5b')][_0xb95b('0x62')];return db['OpenchannelMessage']['find']({'where':{'id':_0x349fde[_0xb95b('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x21d5a9,null))['then'](saveUpdates(_0x349fde['body'],null))['then'](function(_0x38ab19){if(_0x38ab19){_0xf7f663['message']=_0x38ab19[_0xb95b('0x65')]({'plain':!![]});return db[_0xb95b('0x66')][_0xb95b('0x5a')]({'where':{'id':_0x38ab19[_0xb95b('0x67')]}});}return null;})[_0xb95b('0x22')](handleEntityNotFound(_0x21d5a9,null))[_0xb95b('0x22')](function(_0x4d14a9){if(_0x4d14a9){return _0x4d14a9['update']({'UserId':_0x349fde[_0xb95b('0x5b')][_0xb95b('0x62')],'read1stAt':_[_0xb95b('0x68')](_0x4d14a9[_0xb95b('0x69')])?moment()[_0xb95b('0x60')](_0xb95b('0x61')):undefined});}return null;})['then'](function(_0x46bbfe){if(_0x46bbfe){_0xf7f663[_0xb95b('0x6a')]=_0x46bbfe['get']({'plain':!![]});interaction_log[_0xb95b('0x23')](_0xb95b('0x6b'),_0x349fde[_0xb95b('0x63')]['id'],_0x349fde[_0xb95b('0x63')][_0xb95b('0x3b')],_0x349fde[_0xb95b('0x63')][_0xb95b('0x6c')],_0xf7f663[_0xb95b('0x6a')]['id'],_0x349fde[_0xb95b('0x5b')]?JSON['stringify'](_0x349fde[_0xb95b('0x5b')]):_0xb95b('0x6d'));return respondWithRpcPromise(_0xb95b('0x6e'),'acceptMessage',_0xf7f663);}return null;})[_0xb95b('0x22')](function(_0x4d902a){var _0x5a9c2a=_0xb95b('0x6f')+_0x4d902a[_0xb95b('0x29')][_0xb95b('0x70')];return db['sequelize'][_0xb95b('0x42')](_0x5a9c2a,{'type':db[_0xb95b('0x71')]['QueryTypes'][_0xb95b('0x72')],'raw':!![]})[_0xb95b('0x22')](function(_0x41479b){return _0x41479b;});})[_0xb95b('0x22')](function(_0x335e4f){if(_0x335e4f){_0xf7f663[_0xb95b('0x29')][_0xb95b('0x73')]=_0x335e4f[0x0];if(!_0x349fde[_0xb95b('0x5b')]['UserId'])return;return db['User'][_0xb95b('0x5a')]({'where':{'id':_0x349fde['body'][_0xb95b('0x62')],'role':_0xb95b('0x64')},'attributes':['id',_0xb95b('0x3b'),_0xb95b('0x74'),'email',_0xb95b('0x75')],'raw':!![]});}return null;})[_0xb95b('0x22')](function(_0x428897){if(!_0x428897)return null;_0xf7f663[_0xb95b('0x29')]['agent']=_0x428897;return _0xf7f663;})[_0xb95b('0x22')](function(_0x28542e){if(_0x28542e){if(_0x349fde[_0xb95b('0x5b')][_0xb95b('0x76')]){_0xf7f663[_0xb95b('0x29')][_0xb95b('0x77')]=util[_0xb95b('0x60')](_0xb95b('0x78'),_0x349fde['user'][_0xb95b('0x3b')]);_0xf7f663['message'][_0xb95b('0x79')]=_0xf7f663[_0xb95b('0x79')];_0xf7f663[_0xb95b('0x29')]['motionChannel']=_0xf7f663['channel'];_0xf7f663[_0xb95b('0x29')][_0xb95b('0x7a')]='accept';return respondWithRpcPromise(_0xb95b('0x7b'),_0xb95b('0x7b'),{'event':_0xb95b('0x7c'),'message':_0xf7f663[_0xb95b('0x29')]},client9002)['then'](function(){return _0xf7f663;});}return _0xf7f663;}return null;})[_0xb95b('0x22')](respondWithResult(_0x21d5a9,null))[_0xb95b('0x2b')](handleError(_0x21d5a9,null));};var interaction_log=require(_0xb95b('0x15'))('openchannel-interactions');exports['reject']=function(_0x414536,_0x1b7e0e,_0x23871b){var _0x3c7e34={'agent':{},'channel':_0xb95b('0x5e')};if(_0x414536['body']['id']){delete _0x414536[_0xb95b('0x5b')]['id'];}_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')]=_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')]||_0x414536[_0xb95b('0x63')]['id'];_0x3c7e34[_0xb95b('0x64')]['id']=_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')];return db[_0xb95b('0x3e')][_0xb95b('0x5a')]({'where':{'id':_0x414536[_0xb95b('0x57')]['id'],'UserId':null}})[_0xb95b('0x22')](handleEntityNotFound(_0x1b7e0e,null))['then'](function(_0x55ecf7){if(_0x55ecf7){_0x3c7e34['message']=_0x55ecf7[_0xb95b('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb95b('0x5a')]({'where':{'id':_0x55ecf7[_0xb95b('0x67')]}});}return null;})[_0xb95b('0x22')](handleEntityNotFound(_0x1b7e0e,null))['then'](function(_0x2d9052){if(_0x2d9052){_0x3c7e34[_0xb95b('0x6a')]=_0x2d9052[_0xb95b('0x65')]({'plain':!![]});interaction_log[_0xb95b('0x23')](_0xb95b('0x7d'),_0x414536[_0xb95b('0x63')]['id'],_0x414536[_0xb95b('0x63')][_0xb95b('0x3b')],_0x414536[_0xb95b('0x63')][_0xb95b('0x6c')],_0x3c7e34[_0xb95b('0x6a')]['id'],_0x414536['body']?JSON[_0xb95b('0x7e')](_0x414536[_0xb95b('0x5b')]):_0xb95b('0x6d'));return respondWithRpcPromise('RejectMessage',_0xb95b('0x7f'),_0x3c7e34);}return null;})['then'](function(_0x454f45){var _0x25e07e=_0xb95b('0x6f')+_0x454f45[_0xb95b('0x29')]['ContactId'];return db['sequelize']['query'](_0x25e07e,{'type':db[_0xb95b('0x71')]['QueryTypes']['SELECT'],'raw':!![]})[_0xb95b('0x22')](function(_0x2a50fb){return _0x2a50fb;});})[_0xb95b('0x22')](function(_0x25a825){if(_0x25a825){_0x3c7e34[_0xb95b('0x29')]['contact']=_0x25a825[0x0];if(!_0x414536['body'][_0xb95b('0x62')])return;return db[_0xb95b('0x80')][_0xb95b('0x5a')]({'where':{'id':_0x414536[_0xb95b('0x5b')][_0xb95b('0x62')],'role':_0xb95b('0x64')},'attributes':['id',_0xb95b('0x3b'),_0xb95b('0x74'),'email',_0xb95b('0x75')],'raw':!![]});}return null;})['then'](function(_0x1ebdc7){if(!_0x1ebdc7)return null;_0x3c7e34[_0xb95b('0x29')]['agent']=_0x1ebdc7;return _0x3c7e34;})[_0xb95b('0x22')](function(_0xb8a60d){if(_0xb8a60d){_0xb8a60d[_0xb95b('0x29')]['interface']=util[_0xb95b('0x60')](_0xb95b('0x78'),_0x414536[_0xb95b('0x63')][_0xb95b('0x3b')]);_0xb8a60d['message'][_0xb95b('0x79')]=_0x3c7e34[_0xb95b('0x79')];_0xb8a60d[_0xb95b('0x29')][_0xb95b('0x81')]=_0x3c7e34[_0xb95b('0x79')];_0xb8a60d[_0xb95b('0x29')][_0xb95b('0x7a')]=_0xb95b('0x35');respondWithRpcPromise(_0xb95b('0x7b'),_0xb95b('0x7b'),{'event':_0xb95b('0x82'),'message':_0xb8a60d[_0xb95b('0x29')]},client9002);return _0x3c7e34;}return null;})[_0xb95b('0x22')](respondWithResult(_0x1b7e0e,null))[_0xb95b('0x2b')](handleError(_0x1b7e0e,null));};
\ No newline at end of file
+var _0x03e2=['SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','sendStatus','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','include','findAll','rows','show','params','find','create','body','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','sequelize','Sequelize','QueryTypes'];(function(_0x206fba,_0x33dfed){var _0x5c565c=function(_0x487543){while(--_0x487543){_0x206fba['push'](_0x206fba['shift']());}};_0x5c565c(++_0x33dfed);}(_0x03e2,0x119));var _0x203e=function(_0x28d409,_0x4a42e4){_0x28d409=_0x28d409-0x0;var _0x419dc1=_0x03e2[_0x28d409];return _0x419dc1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x203e('0x0'));var zipdir=require(_0x203e('0x1'));var jsonpatch=require(_0x203e('0x2'));var rp=require(_0x203e('0x3'));var moment=require(_0x203e('0x4'));var BPromise=require(_0x203e('0x5'));var Mustache=require(_0x203e('0x6'));var util=require(_0x203e('0x7'));var path=require(_0x203e('0x8'));var sox=require('sox');var csv=require(_0x203e('0x9'));var ejs=require(_0x203e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x203e('0xb'));var squel=require(_0x203e('0xc'));var crypto=require('crypto');var jsforce=require(_0x203e('0xd'));var deskjs=require(_0x203e('0xe'));var toCsv=require(_0x203e('0x9'));var querystring=require('querystring');var Papa=require(_0x203e('0xf'));var Redis=require(_0x203e('0x10'));var authService=require(_0x203e('0x11'));var qs=require(_0x203e('0x12'));var as=require(_0x203e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x203e('0x14'))(_0x203e('0x15'));var utils=require(_0x203e('0x16'));var config=require(_0x203e('0x17'));var licenseUtil=require(_0x203e('0x18'));var db=require(_0x203e('0x19'))['db'];config['redis']=_['defaults'](config[_0x203e('0x1a')],{'host':_0x203e('0x1b'),'port':0x18eb});var socket=require(_0x203e('0x1c'))(new Redis(config[_0x203e('0x1a')]));require(_0x203e('0x1d'))[_0x203e('0x1e')](socket);var jayson=require(_0x203e('0x1f'));var client=jayson['client'][_0x203e('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x203e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x311d5d,_0x267640,_0x4d6191,_0x47f409){return new BPromise(function(_0x3cce10,_0x14ec51){var _0x2a1d6a=_0x47f409||client;return _0x2a1d6a[_0x203e('0x21')](_0x311d5d,_0x4d6191)[_0x203e('0x22')](function(_0xe52db6){logger[_0x203e('0x23')](_0x203e('0x24'),_0x267640,_0x203e('0x25'));logger[_0x203e('0x26')](_0x203e('0x27'),_0x267640,_0x203e('0x25'),JSON['stringify'](_0xe52db6));if(_0xe52db6[_0x203e('0x28')]){if(_0xe52db6['error'][_0x203e('0x29')]===0x1f4){logger[_0x203e('0x28')](_0x203e('0x24'),_0x267640,_0xe52db6['error'][_0x203e('0x2a')]);return _0x14ec51(_0xe52db6[_0x203e('0x28')]['message']);}logger[_0x203e('0x28')](_0x203e('0x24'),_0x267640,_0xe52db6[_0x203e('0x28')][_0x203e('0x2a')]);return _0x3cce10(_0xe52db6[_0x203e('0x28')]['message']);}else{logger[_0x203e('0x23')](_0x203e('0x24'),_0x267640,'request\x20sent');_0x3cce10(_0xe52db6['result'][_0x203e('0x2a')]);}})[_0x203e('0x2b')](function(_0x47e294){logger['error'](_0x203e('0x24'),_0x267640,_0x47e294);_0x14ec51(_0x47e294);});});}function respondWithStatusCode(_0xf5f1bc,_0xcfcbb){_0xcfcbb=_0xcfcbb||0xcc;return function(_0x4f3ae5){if(_0x4f3ae5){return _0xf5f1bc['sendStatus'](_0xcfcbb);}return _0xf5f1bc[_0x203e('0x2c')](_0xcfcbb)[_0x203e('0x2d')]();};}function respondWithResult(_0x444df7,_0x12d5ab){_0x12d5ab=_0x12d5ab||0xc8;return function(_0x1b3933){if(_0x1b3933){return _0x444df7[_0x203e('0x2c')](_0x12d5ab)[_0x203e('0x2e')](_0x1b3933);}};}function respondWithFilteredResult(_0x1d870d,_0x4c3018){return function(_0x56218a){if(_0x56218a){var _0x2a5141=typeof _0x4c3018[_0x203e('0x2f')]===_0x203e('0x30')&&typeof _0x4c3018[_0x203e('0x31')]===_0x203e('0x30');var _0x4d8bd2=_0x56218a['count'];var _0x400c8f=_0x2a5141?0x0:_0x4c3018[_0x203e('0x2f')];var _0x2a10f7=_0x2a5141?_0x56218a[_0x203e('0x32')]:_0x4c3018[_0x203e('0x2f')]+_0x4c3018[_0x203e('0x31')];var _0x568193;if(_0x2a10f7>=_0x4d8bd2){_0x2a10f7=_0x4d8bd2;_0x568193=0xc8;}else{_0x568193=0xce;}_0x1d870d[_0x203e('0x2c')](_0x568193);return _0x1d870d[_0x203e('0x33')]('Content-Range',_0x400c8f+'-'+_0x2a10f7+'/'+_0x4d8bd2)['json'](_0x56218a);}return null;};}function patchUpdates(_0x33e1f5){return function(_0x4ba156){try{jsonpatch['apply'](_0x4ba156,_0x33e1f5,!![]);}catch(_0x5610dc){return BPromise[_0x203e('0x34')](_0x5610dc);}return _0x4ba156[_0x203e('0x35')]();};}function saveUpdates(_0x1f66a2,_0x35166a){return function(_0x30df80){if(_0x30df80){return _0x30df80[_0x203e('0x36')](_0x1f66a2)[_0x203e('0x22')](function(_0x400094){return _0x400094;});}return null;};}function removeEntity(_0x2a8717,_0x36eee3){return function(_0x26ae3f){if(_0x26ae3f){return _0x26ae3f[_0x203e('0x37')]()[_0x203e('0x22')](function(){_0x2a8717['status'](0xcc)[_0x203e('0x2d')]();});}};}function handleEntityNotFound(_0x368af9,_0x386f46){return function(_0x432d91){if(!_0x432d91){_0x368af9[_0x203e('0x38')](0x194);}return _0x432d91;};}function handleError(_0x343778,_0x7936c){_0x7936c=_0x7936c||0x1f4;return function(_0x6c357d){logger['error'](_0x6c357d['stack']);if(_0x6c357d[_0x203e('0x39')]){delete _0x6c357d[_0x203e('0x39')];}_0x343778['status'](_0x7936c)[_0x203e('0x3a')](_0x6c357d);};}exports[_0x203e('0x3b')]=function(_0x413972,_0x962a02){var _0x10578b={},_0xdca444={},_0x18622b={'count':0x0,'rows':[]};var _0x3954a0=_[_0x203e('0x3c')](db['OpenchannelMessage'][_0x203e('0x3d')],function(_0x1a6391){return{'name':_0x1a6391[_0x203e('0x3e')],'type':_0x1a6391[_0x203e('0x3f')]['key']};});_0xdca444['model']=_[_0x203e('0x3c')](_0x3954a0,_0x203e('0x39'));_0xdca444[_0x203e('0x40')]=_[_0x203e('0x41')](_0x413972[_0x203e('0x40')]);_0xdca444[_0x203e('0x42')]=_[_0x203e('0x43')](_0xdca444['model'],_0xdca444[_0x203e('0x40')]);_0x10578b[_0x203e('0x44')]=_[_0x203e('0x43')](_0xdca444[_0x203e('0x45')],qs[_0x203e('0x46')](_0x413972[_0x203e('0x40')][_0x203e('0x46')]));_0x10578b[_0x203e('0x44')]=_0x10578b[_0x203e('0x44')][_0x203e('0x47')]?_0x10578b[_0x203e('0x44')]:_0xdca444[_0x203e('0x45')];if(!_0x413972[_0x203e('0x40')]['hasOwnProperty'](_0x203e('0x48'))){_0x10578b[_0x203e('0x31')]=qs[_0x203e('0x31')](_0x413972[_0x203e('0x40')]['limit']);_0x10578b[_0x203e('0x2f')]=qs[_0x203e('0x2f')](_0x413972['query'][_0x203e('0x2f')]);}_0x10578b[_0x203e('0x49')]=qs['sort'](_0x413972[_0x203e('0x40')][_0x203e('0x4a')]);_0x10578b[_0x203e('0x4b')]=qs[_0x203e('0x42')](_[_0x203e('0x4c')](_0x413972[_0x203e('0x40')],_0xdca444[_0x203e('0x42')]),_0x3954a0);if(_0x413972[_0x203e('0x40')][_0x203e('0x4d')]){_0x10578b[_0x203e('0x4b')]=_['merge'](_0x10578b['where'],{'$or':_['map'](_0x3954a0,function(_0x4c93f3){if(_0x4c93f3[_0x203e('0x3f')]!=='VIRTUAL'){var _0x436a44={};_0x436a44[_0x4c93f3[_0x203e('0x39')]]={'$like':'%'+_0x413972['query'][_0x203e('0x4d')]+'%'};return _0x436a44;}})});}_0x10578b=_[_0x203e('0x4e')]({},_0x10578b,_0x413972[_0x203e('0x4f')]);var _0x1cc9d2={'where':_0x10578b[_0x203e('0x4b')]};return db[_0x203e('0x50')]['count'](_0x1cc9d2)[_0x203e('0x22')](function(_0x4a32a5){_0x18622b[_0x203e('0x32')]=_0x4a32a5;if(_0x413972[_0x203e('0x40')][_0x203e('0x51')]){_0x10578b[_0x203e('0x52')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x203e('0x53')](_0x10578b);})[_0x203e('0x22')](function(_0x430ae3){_0x18622b[_0x203e('0x54')]=_0x430ae3;return _0x18622b;})[_0x203e('0x22')](respondWithFilteredResult(_0x962a02,_0x10578b))[_0x203e('0x2b')](handleError(_0x962a02,null));};exports[_0x203e('0x55')]=function(_0x56301f,_0x49cba2){var _0x2568a7={'raw':!![],'where':{'id':_0x56301f[_0x203e('0x56')]['id']}},_0x2785a9={};_0x2785a9['model']=_[_0x203e('0x41')](db['OpenchannelMessage']['rawAttributes']);_0x2785a9[_0x203e('0x40')]=_[_0x203e('0x41')](_0x56301f['query']);_0x2785a9[_0x203e('0x42')]=_[_0x203e('0x43')](_0x2785a9[_0x203e('0x45')],_0x2785a9['query']);_0x2568a7[_0x203e('0x44')]=_[_0x203e('0x43')](_0x2785a9[_0x203e('0x45')],qs[_0x203e('0x46')](_0x56301f[_0x203e('0x40')][_0x203e('0x46')]));_0x2568a7['attributes']=_0x2568a7['attributes'][_0x203e('0x47')]?_0x2568a7[_0x203e('0x44')]:_0x2785a9['model'];if(_0x56301f[_0x203e('0x40')][_0x203e('0x51')]){_0x2568a7['include']=[{'all':!![]}];}_0x2568a7=_['merge']({},_0x2568a7,_0x56301f[_0x203e('0x4f')]);return db[_0x203e('0x50')][_0x203e('0x57')](_0x2568a7)[_0x203e('0x22')](handleEntityNotFound(_0x49cba2,null))['then'](respondWithResult(_0x49cba2,null))[_0x203e('0x2b')](handleError(_0x49cba2,null));};exports[_0x203e('0x58')]=function(_0x223ffc,_0x228cca){return db[_0x203e('0x50')][_0x203e('0x58')](_0x223ffc[_0x203e('0x59')],{})[_0x203e('0x22')](respondWithResult(_0x228cca,0xc9))['catch'](handleError(_0x228cca,null));};exports[_0x203e('0x36')]=function(_0x19157f,_0x28d1e2){if(_0x19157f[_0x203e('0x59')]['id']){delete _0x19157f['body']['id'];}return db[_0x203e('0x50')]['find']({'where':{'id':_0x19157f[_0x203e('0x56')]['id']}})[_0x203e('0x22')](handleEntityNotFound(_0x28d1e2,null))[_0x203e('0x22')](saveUpdates(_0x19157f[_0x203e('0x59')],null))[_0x203e('0x22')](respondWithResult(_0x28d1e2,null))['catch'](handleError(_0x28d1e2,null));};exports['destroy']=function(_0xa5532f,_0x432ae1){return db[_0x203e('0x50')]['find']({'where':{'id':_0xa5532f['params']['id']}})[_0x203e('0x22')](handleEntityNotFound(_0x432ae1,null))[_0x203e('0x22')](removeEntity(_0x432ae1,null))['catch'](handleError(_0x432ae1,null));};exports['describe']=function(_0x522542,_0x38d03b){return db['OpenchannelMessage']['describe']()[_0x203e('0x22')](respondWithResult(_0x38d03b,null))[_0x203e('0x2b')](handleError(_0x38d03b,null));};var interaction_log=require(_0x203e('0x14'))(_0x203e('0x5a'));exports[_0x203e('0x5b')]=function(_0x37e026,_0x73fa63,_0x20a51b){var _0x111487={'agent':{},'channel':_0x203e('0x5c')};if(_0x37e026[_0x203e('0x59')]['id']){delete _0x37e026[_0x203e('0x59')]['id'];}_0x37e026['body']['read']=!![];_0x37e026[_0x203e('0x59')][_0x203e('0x5d')]=moment()[_0x203e('0x5e')](_0x203e('0x5f'));_0x37e026[_0x203e('0x59')][_0x203e('0x60')]=_0x37e026[_0x203e('0x59')][_0x203e('0x60')]||_0x37e026[_0x203e('0x61')]['id'];_0x111487[_0x203e('0x62')]['id']=_0x37e026[_0x203e('0x59')][_0x203e('0x60')];return db[_0x203e('0x50')][_0x203e('0x57')]({'where':{'id':_0x37e026[_0x203e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x73fa63,null))['then'](saveUpdates(_0x37e026[_0x203e('0x59')],null))['then'](function(_0x2cde04){if(_0x2cde04){_0x111487[_0x203e('0x2a')]=_0x2cde04['get']({'plain':!![]});return db[_0x203e('0x63')]['find']({'where':{'id':_0x2cde04['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x73fa63,null))[_0x203e('0x22')](function(_0x55570d){if(_0x55570d){return _0x55570d['update']({'UserId':_0x37e026[_0x203e('0x59')][_0x203e('0x60')],'read1stAt':_[_0x203e('0x64')](_0x55570d[_0x203e('0x65')])?moment()[_0x203e('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x203e('0x22')](function(_0x2e9e7a){if(_0x2e9e7a){_0x111487[_0x203e('0x66')]=_0x2e9e7a[_0x203e('0x67')]({'plain':!![]});interaction_log[_0x203e('0x23')](_0x203e('0x68'),_0x37e026[_0x203e('0x61')]['id'],_0x37e026['user'][_0x203e('0x39')],_0x37e026[_0x203e('0x61')][_0x203e('0x69')],_0x111487[_0x203e('0x66')]['id'],_0x37e026[_0x203e('0x59')]?JSON[_0x203e('0x6a')](_0x37e026['body']):_0x203e('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x203e('0x6c'),_0x111487);}return null;})[_0x203e('0x22')](function(_0xd3854c){var _0x54189d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd3854c[_0x203e('0x2a')]['ContactId'];return db[_0x203e('0x6d')][_0x203e('0x40')](_0x54189d,{'type':db[_0x203e('0x6e')][_0x203e('0x6f')][_0x203e('0x70')],'raw':!![]})['then'](function(_0x49de08){return _0x49de08;});})['then'](function(_0x5c5535){if(_0x5c5535){_0x111487[_0x203e('0x2a')][_0x203e('0x71')]=_0x5c5535[0x0];if(!_0x37e026[_0x203e('0x59')]['UserId'])return;return db[_0x203e('0x72')][_0x203e('0x57')]({'where':{'id':_0x37e026[_0x203e('0x59')][_0x203e('0x60')],'role':_0x203e('0x62')},'attributes':['id',_0x203e('0x39'),_0x203e('0x73'),_0x203e('0x74'),_0x203e('0x75')],'raw':!![]});}return null;})[_0x203e('0x22')](function(_0x2fc11a){if(!_0x2fc11a)return null;_0x111487[_0x203e('0x2a')][_0x203e('0x62')]=_0x2fc11a;return _0x111487;})[_0x203e('0x22')](function(_0x5da889){if(_0x5da889){if(_0x37e026[_0x203e('0x59')][_0x203e('0x76')]){_0x111487[_0x203e('0x2a')][_0x203e('0x77')]=util[_0x203e('0x5e')](_0x203e('0x78'),_0x37e026[_0x203e('0x61')][_0x203e('0x39')]);_0x111487[_0x203e('0x2a')]['channel']=_0x111487[_0x203e('0x79')];_0x111487[_0x203e('0x2a')][_0x203e('0x7a')]=_0x111487[_0x203e('0x79')];_0x111487[_0x203e('0x2a')][_0x203e('0x7b')]=_0x203e('0x5b');return respondWithRpcPromise(_0x203e('0x7c'),'EventManager',{'event':_0x203e('0x7d'),'message':_0x111487['message']},client9002)[_0x203e('0x22')](function(){return _0x111487;});}return _0x111487;}return null;})[_0x203e('0x22')](respondWithResult(_0x73fa63,null))[_0x203e('0x2b')](handleError(_0x73fa63,null));};var interaction_log=require(_0x203e('0x14'))(_0x203e('0x5a'));exports['reject']=function(_0xc1fdf9,_0x70ac44,_0x4edd4c){var _0x258c40={'agent':{},'channel':_0x203e('0x5c')};if(_0xc1fdf9[_0x203e('0x59')]['id']){delete _0xc1fdf9[_0x203e('0x59')]['id'];}_0xc1fdf9[_0x203e('0x59')]['UserId']=_0xc1fdf9[_0x203e('0x59')][_0x203e('0x60')]||_0xc1fdf9['user']['id'];_0x258c40[_0x203e('0x62')]['id']=_0xc1fdf9[_0x203e('0x59')]['UserId'];return db['OpenchannelMessage'][_0x203e('0x57')]({'where':{'id':_0xc1fdf9[_0x203e('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x70ac44,null))[_0x203e('0x22')](function(_0x5f3a40){if(_0x5f3a40){_0x258c40['message']=_0x5f3a40[_0x203e('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x203e('0x57')]({'where':{'id':_0x5f3a40[_0x203e('0x7e')]}});}return null;})[_0x203e('0x22')](handleEntityNotFound(_0x70ac44,null))[_0x203e('0x22')](function(_0x3cdf4f){if(_0x3cdf4f){_0x258c40[_0x203e('0x66')]=_0x3cdf4f[_0x203e('0x67')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc1fdf9[_0x203e('0x61')]['id'],_0xc1fdf9[_0x203e('0x61')]['name'],_0xc1fdf9['user'][_0x203e('0x69')],_0x258c40[_0x203e('0x66')]['id'],_0xc1fdf9[_0x203e('0x59')]?JSON['stringify'](_0xc1fdf9[_0x203e('0x59')]):'null');return respondWithRpcPromise(_0x203e('0x7f'),_0x203e('0x80'),_0x258c40);}return null;})['then'](function(_0x1152bf){var _0x56114c=_0x203e('0x81')+_0x1152bf[_0x203e('0x2a')]['ContactId'];return db[_0x203e('0x6d')][_0x203e('0x40')](_0x56114c,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x203e('0x22')](function(_0x6f2170){return _0x6f2170;});})[_0x203e('0x22')](function(_0xbd3331){if(_0xbd3331){_0x258c40['message']['contact']=_0xbd3331[0x0];if(!_0xc1fdf9['body'][_0x203e('0x60')])return;return db[_0x203e('0x72')]['find']({'where':{'id':_0xc1fdf9[_0x203e('0x59')][_0x203e('0x60')],'role':_0x203e('0x62')},'attributes':['id','name',_0x203e('0x73'),'email',_0x203e('0x75')],'raw':!![]});}return null;})[_0x203e('0x22')](function(_0x17fdfb){if(!_0x17fdfb)return null;_0x258c40[_0x203e('0x2a')][_0x203e('0x62')]=_0x17fdfb;return _0x258c40;})[_0x203e('0x22')](function(_0x4e58ab){if(_0x4e58ab){_0x4e58ab[_0x203e('0x2a')][_0x203e('0x77')]=util[_0x203e('0x5e')](_0x203e('0x78'),_0xc1fdf9[_0x203e('0x61')][_0x203e('0x39')]);_0x4e58ab[_0x203e('0x2a')][_0x203e('0x79')]=_0x258c40[_0x203e('0x79')];_0x4e58ab[_0x203e('0x2a')][_0x203e('0x7a')]=_0x258c40[_0x203e('0x79')];_0x4e58ab[_0x203e('0x2a')][_0x203e('0x7b')]='reject';respondWithRpcPromise(_0x203e('0x7c'),_0x203e('0x7c'),{'event':_0x203e('0x82'),'message':_0x4e58ab[_0x203e('0x2a')]},client9002);return _0x258c40;}return null;})[_0x203e('0x22')](respondWithResult(_0x70ac44,null))[_0x203e('0x2b')](handleError(_0x70ac44,null));};
\ No newline at end of file
index 01999b1..accbfc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3aa=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0xe3aa,0x9f));var _0xae3a=function(_0x171e51,_0x2c4d43){_0x171e51=_0x171e51-0x0;var _0x27b1ea=_0xe3aa[_0x171e51];return _0x27b1ea;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xae3a('0x0'))['db'][_0xae3a('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xae3a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xae3a('0x3'),'afterDestroy':_0xae3a('0x4')};function emitEvent(_0x4b97a){return function(_0x5d5e2b,_0x5939d2,_0x2a6566){OpenchannelMessageEvents[_0xae3a('0x5')](_0x4b97a+':'+_0x5d5e2b['id'],_0x5d5e2b);OpenchannelMessageEvents[_0xae3a('0x5')](_0x4b97a,_0x5d5e2b);_0x2a6566(null);};}for(var e in events){if(events[_0xae3a('0x6')](e)){var event=events[e];OpenchannelMessage[_0xae3a('0x7')](e,emitEvent(event));}}module[_0xae3a('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x64f7=['OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x405541,_0x2945cc){var _0x194a1e=function(_0x46fffe){while(--_0x46fffe){_0x405541['push'](_0x405541['shift']());}};_0x194a1e(++_0x2945cc);}(_0x64f7,0xe5));var _0x764f=function(_0x1cb930,_0x55a2f4){_0x1cb930=_0x1cb930-0x0;var _0x5bd112=_0x64f7[_0x1cb930];return _0x5bd112;};'use strict';var EventEmitter=require(_0x764f('0x0'));var OpenchannelMessage=require(_0x764f('0x1'))['db'][_0x764f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x764f('0x3')](0x0);var events={'afterCreate':_0x764f('0x4'),'afterUpdate':_0x764f('0x5'),'afterDestroy':_0x764f('0x6')};function emitEvent(_0x5ce911){return function(_0x20bf2b,_0x4fed46,_0x311617){OpenchannelMessageEvents[_0x764f('0x7')](_0x5ce911+':'+_0x20bf2b['id'],_0x20bf2b);OpenchannelMessageEvents[_0x764f('0x7')](_0x5ce911,_0x20bf2b);_0x311617(null);};}for(var e in events){if(events[_0x764f('0x8')](e)){var event=events[e];OpenchannelMessage[_0x764f('0x9')](e,emitEvent(event));}}module[_0x764f('0xa')]=OpenchannelMessageEvents;
\ No newline at end of file
index 00741bf..9090c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b8=['OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','omit','Contact','method','GET','POST','body','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','OpenchannelMessage','openchannel_messages','FULLTEXT','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','then','update','createdAt','catch','error','out','secret','CmContact','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','replyUri','info'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xd8b8,0x1a9));var _0x8d8b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd8b8[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x8d8b('0x0'));var util=require(_0x8d8b('0x1'));var logger=require(_0x8d8b('0x2'))(_0x8d8b('0x3'));var moment=require(_0x8d8b('0x4'));var BPromise=require(_0x8d8b('0x5'));var rp=require(_0x8d8b('0x6'));var fs=require('fs');var path=require(_0x8d8b('0x7'));var rimraf=require('rimraf');var config=require(_0x8d8b('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x8d8b('0x9')]=function(_0x19b73e,_0x4a52ad){return _0x19b73e[_0x8d8b('0xa')](_0x8d8b('0xb'),attributes,{'tableName':_0x8d8b('0xc'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x8d8b('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b90ad,_0x29581f,_0x191f35){var _0x5d700d=_0x19b73e['models'];var _0x4e8838=_0x2b90ad[_0x8d8b('0xe')]({'plain':!![]});if(_0x4e8838[_0x8d8b('0xf')][_0x8d8b('0x10')]()==='in'||_0x4e8838[_0x8d8b('0xf')][_0x8d8b('0x10')]()==='out'&&!_0x4e8838['secret']&&!_[_0x8d8b('0x11')](_0x4e8838[_0x8d8b('0x12')])){_0x5d700d[_0x8d8b('0x13')]['findOne']({'where':{'id':_0x4e8838['OpenchannelInteractionId']}})[_0x8d8b('0x14')](function(_0x5ec8fa){if(_0x5ec8fa){_0x5ec8fa[_0x8d8b('0x15')]({'lastMsgAt':_0x4e8838[_0x8d8b('0x16')],'lastMsgDirection':_0x4e8838[_0x8d8b('0xf')][_0x8d8b('0x10')]()});}})[_0x8d8b('0x17')](function(_0x3f7851){console[_0x8d8b('0x18')](_0x3f7851);});}if(_0x4e8838[_0x8d8b('0xf')]===_0x8d8b('0x19')&&!_0x4e8838[_0x8d8b('0x1a')]){var _0x14a328;_0x5d700d[_0x8d8b('0x1b')]['describe']()[_0x8d8b('0x14')](function(_0x310b0c){return _0x5d700d[_0x8d8b('0x1c')][_0x8d8b('0x1d')]({'where':{'id':_0x4e8838[_0x8d8b('0x1e')]},'include':[{'model':_0x5d700d[_0x8d8b('0x13')],'as':'Interactions','where':{'id':_0x4e8838[_0x8d8b('0x1f')]},'limit':0x1,'include':[{'model':_0x5d700d[_0x8d8b('0x1b')],'as':'Contact','attributes':_['keys'](_0x310b0c)}]}]});})[_0x8d8b('0x14')](function(_0x51a8e9){_0x14a328=_0x51a8e9[_0x8d8b('0xe')]({'plain':!![]});if(_0x14a328&&_0x14a328[_0x8d8b('0x20')]){logger[_0x8d8b('0x21')](_0x8d8b('0x22'),'afterCreate',util[_0x8d8b('0x23')](_0x8d8b('0x24'),_0x4e8838['id'],_0x14a328[_0x8d8b('0x20')]));if(_0x14a328[_0x8d8b('0x25')]&&_0x14a328['Interactions'][_0x8d8b('0x26')]){_0x4e8838['Interaction']=_[_0x8d8b('0x27')](_0x14a328[_0x8d8b('0x25')][0x0],_0x8d8b('0x28'));_0x4e8838[_0x8d8b('0x28')]=_0x14a328[_0x8d8b('0x25')][0x0][_0x8d8b('0x28')];}var _0x29581f={'method':'POST','uri':encodeURI(_0x14a328[_0x8d8b('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x29581f[_0x8d8b('0x29')]){case _0x8d8b('0x2a'):_0x29581f['qs']=_0x4e8838;break;case _0x8d8b('0x2b'):_0x29581f[_0x8d8b('0x2c')]=_0x4e8838;break;}return rp(_0x29581f)[_0x8d8b('0x14')](function(_0x30f6e0){logger['info'](_0x8d8b('0x22'),_0x8d8b('0x2d'),util['format'](_0x8d8b('0x2e'),_0x4e8838['id'],_0x14a328['replyUri']));if(_0x30f6e0[_0x8d8b('0x2c')][_0x8d8b('0x2f')]&&_0x30f6e0[_0x8d8b('0x2c')]['threadId']!=_0x4e8838[_0x8d8b('0x30')]['threadId']){return _0x5d700d['OpenchannelInteraction'][_0x8d8b('0x15')]({'threadId':_0x30f6e0[_0x8d8b('0x2c')]['threadId']},{'where':{'id':_0x4e8838[_0x8d8b('0x30')]['id']}});}else{return;}})[_0x8d8b('0x14')](function(){return _0x2b90ad[_0x8d8b('0x15')]({'read':!![]});})[_0x8d8b('0x17')](function(_0x57c295){logger[_0x8d8b('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x8d8b('0x2d'),util['inspect'](_0x57c295,{'showHidden':![],'depth':null}));_0x191f35();});}else{_0x191f35();}})[_0x8d8b('0x31')](function(){_0x191f35();});}else{_0x191f35();}}},'charset':'utf8mb4','collate':_0x8d8b('0x32')});};
\ No newline at end of file
+var _0x5ee4=['length','Interaction','omit','Contact','method','GET','body','info','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','exports','define','fti_openchannel_messages','models','get','direction','toLowerCase','secret','isNil','findOne','OpenchannelInteractionId','then','update','createdAt','error','out','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Interactions'];(function(_0x46804c,_0x3eea5a){var _0x421408=function(_0x49b379){while(--_0x49b379){_0x46804c['push'](_0x46804c['shift']());}};_0x421408(++_0x3eea5a);}(_0x5ee4,0x1e4));var _0x45ee=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5ee4[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x45ee('0x0'));var util=require(_0x45ee('0x1'));var logger=require('../../config/logger')(_0x45ee('0x2'));var moment=require(_0x45ee('0x3'));var BPromise=require('bluebird');var rp=require(_0x45ee('0x4'));var fs=require('fs');var path=require(_0x45ee('0x5'));var rimraf=require(_0x45ee('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0x45ee('0x7')]=function(_0x5b754c,_0x479821){return _0x5b754c[_0x45ee('0x8')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x45ee('0x9'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f5285,_0x24abd9,_0x3c05d2){var _0x3e0875=_0x5b754c[_0x45ee('0xa')];var _0x19f4ee=_0x3f5285[_0x45ee('0xb')]({'plain':!![]});if(_0x19f4ee[_0x45ee('0xc')][_0x45ee('0xd')]()==='in'||_0x19f4ee[_0x45ee('0xc')][_0x45ee('0xd')]()==='out'&&!_0x19f4ee[_0x45ee('0xe')]&&!_[_0x45ee('0xf')](_0x19f4ee['UserId'])){_0x3e0875['OpenchannelInteraction'][_0x45ee('0x10')]({'where':{'id':_0x19f4ee[_0x45ee('0x11')]}})[_0x45ee('0x12')](function(_0x4c74ab){if(_0x4c74ab){_0x4c74ab[_0x45ee('0x13')]({'lastMsgAt':_0x19f4ee[_0x45ee('0x14')],'lastMsgDirection':_0x19f4ee['direction'][_0x45ee('0xd')]()});}})['catch'](function(_0xb154da){console[_0x45ee('0x15')](_0xb154da);});}if(_0x19f4ee[_0x45ee('0xc')]===_0x45ee('0x16')&&!_0x19f4ee[_0x45ee('0xe')]){var _0xeef1cd;_0x3e0875[_0x45ee('0x17')][_0x45ee('0x18')]()[_0x45ee('0x12')](function(_0x4ae4b7){return _0x3e0875['OpenchannelAccount'][_0x45ee('0x19')]({'where':{'id':_0x19f4ee[_0x45ee('0x1a')]},'include':[{'model':_0x3e0875[_0x45ee('0x1b')],'as':'Interactions','where':{'id':_0x19f4ee[_0x45ee('0x11')]},'limit':0x1,'include':[{'model':_0x3e0875[_0x45ee('0x17')],'as':'Contact','attributes':_[_0x45ee('0x1c')](_0x4ae4b7)}]}]});})['then'](function(_0x339d83){_0xeef1cd=_0x339d83[_0x45ee('0xb')]({'plain':!![]});if(_0xeef1cd&&_0xeef1cd[_0x45ee('0x1d')]){logger['info'](_0x45ee('0x1e'),_0x45ee('0x1f'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x19f4ee['id'],_0xeef1cd['replyUri']));if(_0xeef1cd[_0x45ee('0x20')]&&_0xeef1cd['Interactions'][_0x45ee('0x21')]){_0x19f4ee[_0x45ee('0x22')]=_[_0x45ee('0x23')](_0xeef1cd[_0x45ee('0x20')][0x0],'Contact');_0x19f4ee[_0x45ee('0x24')]=_0xeef1cd[_0x45ee('0x20')][0x0][_0x45ee('0x24')];}var _0x24abd9={'method':'POST','uri':encodeURI(_0xeef1cd[_0x45ee('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x24abd9[_0x45ee('0x25')]){case _0x45ee('0x26'):_0x24abd9['qs']=_0x19f4ee;break;case'POST':_0x24abd9[_0x45ee('0x27')]=_0x19f4ee;break;}return rp(_0x24abd9)['then'](function(_0x24c1fc){logger[_0x45ee('0x28')](_0x45ee('0x1e'),_0x45ee('0x1f'),util[_0x45ee('0x29')](_0x45ee('0x2a'),_0x19f4ee['id'],_0xeef1cd[_0x45ee('0x1d')]));if(_0x24c1fc[_0x45ee('0x27')][_0x45ee('0x2b')]&&_0x24c1fc[_0x45ee('0x27')][_0x45ee('0x2b')]!=_0x19f4ee[_0x45ee('0x22')][_0x45ee('0x2b')]){return _0x3e0875[_0x45ee('0x1b')][_0x45ee('0x13')]({'threadId':_0x24c1fc[_0x45ee('0x27')][_0x45ee('0x2b')]},{'where':{'id':_0x19f4ee[_0x45ee('0x22')]['id']}});}else{return;}})[_0x45ee('0x12')](function(){return _0x3f5285[_0x45ee('0x13')]({'read':!![]});})[_0x45ee('0x2c')](function(_0x5298a6){logger[_0x45ee('0x15')](_0x45ee('0x1e'),'afterCreate',util[_0x45ee('0x2d')](_0x5298a6,{'showHidden':![],'depth':null}));_0x3c05d2();});}else{_0x3c05d2();}})['finally'](function(){_0x3c05d2();});}else{_0x3c05d2();}}},'charset':'utf8mb4','collate':_0x45ee('0x2e')});};
\ No newline at end of file
index a27ace5..a7730e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x76e73f,_0x1873ac){var _0x2a56fc=function(_0x46b459){while(--_0x46b459){_0x76e73f['push'](_0x76e73f['shift']());}};_0x2a56fc(++_0x1873ac);}(_0x7a54,0x106));var _0x47a5=function(_0x2aae26,_0x332117){_0x2aae26=_0x2aae26-0x0;var _0x562ec6=_0x7a54[_0x2aae26];return _0x562ec6;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});};
\ No newline at end of file
+var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0xdb28,0x106));var _0x8db2=function(_0x6cba38,_0x5b872c){_0x6cba38=_0x6cba38-0x0;var _0x59582c=_0xdb28[_0x6cba38];return _0x59582c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
index 8934021..aaebeb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ce=['register','openchannelMessage:','save','remove','update','emit','removeListener'];(function(_0x3af0f0,_0x57c1c2){var _0x5104dd=function(_0x35b734){while(--_0x35b734){_0x3af0f0['push'](_0x3af0f0['shift']());}};_0x5104dd(++_0x57c1c2);}(_0x24ce,0x1de));var _0xe24c=function(_0x3d234a,_0x56c809){_0x3d234a=_0x3d234a-0x0;var _0x2ab76a=_0x24ce[_0x3d234a];return _0x2ab76a;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe24c('0x0'),_0xe24c('0x1'),_0xe24c('0x2')];function createListener(_0x1ce128,_0x493bd8){return function(_0x5d60b2){_0x493bd8[_0xe24c('0x3')](_0x1ce128,_0x5d60b2);};}function removeListener(_0x48f802,_0x4d6727){return function(){OpenchannelMessageEvents[_0xe24c('0x4')](_0x48f802,_0x4d6727);};}exports[_0xe24c('0x5')]=function(_0x6f92e0){for(var _0x1ac59c=0x0,_0xe1d970=events['length'];_0x1ac59c<_0xe1d970;_0x1ac59c++){var _0x6d00e=events[_0x1ac59c];var _0x2d8dde=createListener(_0xe24c('0x6')+_0x6d00e,_0x6f92e0);OpenchannelMessageEvents['on'](_0x6d00e,_0x2d8dde);}};
\ No newline at end of file
+var _0x2bae=['emit','register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0xe2ba('0x0'));var events=[_0xe2ba('0x1'),_0xe2ba('0x2'),_0xe2ba('0x3')];function createListener(_0x3c97d7,_0x251690){return function(_0x5e0e85){_0x251690[_0xe2ba('0x4')](_0x3c97d7,_0x5e0e85);};}function removeListener(_0x52f39e,_0x442279){return function(){OpenchannelMessageEvents['removeListener'](_0x52f39e,_0x442279);};}exports[_0xe2ba('0x5')]=function(_0x129677){for(var _0x21601e=0x0,_0x4933a0=events[_0xe2ba('0x6')];_0x21601e<_0x4933a0;_0x21601e++){var _0x21076b=events[_0x21601e];var _0x12be92=createListener(_0xe2ba('0x7')+_0x21076b,_0x129677);OpenchannelMessageEvents['on'](_0x21076b,_0x12be92);}};
\ No newline at end of file
index 2c42d54..54ad365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2ea=['../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2e23cd,_0x7c5cb3){var _0x32a2f4=function(_0x3f358d){while(--_0x3f358d){_0x2e23cd['push'](_0x2e23cd['shift']());}};_0x32a2f4(++_0x7c5cb3);}(_0xb2ea,0x7c));var _0xab2e=function(_0x3baaf2,_0x894e3d){_0x3baaf2=_0x3baaf2-0x0;var _0x50e8b0=_0xb2ea[_0x3baaf2];return _0x50e8b0;};'use strict';var multer=require(_0xab2e('0x0'));var util=require(_0xab2e('0x1'));var path=require(_0xab2e('0x2'));var timeout=require('connect-timeout');var express=require(_0xab2e('0x3'));var router=express[_0xab2e('0x4')]();var fs_extra=require(_0xab2e('0x5'));var auth=require(_0xab2e('0x6'));var interaction=require(_0xab2e('0x7'));var config=require(_0xab2e('0x8'));var controller=require(_0xab2e('0x9'));router[_0xab2e('0xa')]('/',auth[_0xab2e('0xb')](),controller[_0xab2e('0xc')]);router[_0xab2e('0xa')](_0xab2e('0xd'),auth[_0xab2e('0xb')](),controller[_0xab2e('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xab2e('0xa')](_0xab2e('0xf'),auth['isAuthenticated'](),controller[_0xab2e('0x10')]);router['get'](_0xab2e('0x11'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x12')]);router[_0xab2e('0xa')]('/:id/users',auth[_0xab2e('0xb')](),controller[_0xab2e('0x13')]);router[_0xab2e('0x14')]('/',auth[_0xab2e('0xb')](),controller[_0xab2e('0x15')]);router[_0xab2e('0x14')](_0xab2e('0x11'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x16')]);router[_0xab2e('0x14')](_0xab2e('0x17'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x18')]);router[_0xab2e('0x19')]('/:id',auth[_0xab2e('0xb')](),controller[_0xab2e('0x1a')]);router[_0xab2e('0x1b')](_0xab2e('0x1c'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x1d')]);router[_0xab2e('0x1b')]('/:id/teams',auth[_0xab2e('0xb')](),controller[_0xab2e('0x1e')]);router[_0xab2e('0x1b')](_0xab2e('0x17'),auth[_0xab2e('0xb')](),controller[_0xab2e('0x1f')]);module[_0xab2e('0x20')]=router;
\ No newline at end of file
+var _0xc410=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','create','post','addAgents','update','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4e6af2,_0x5b9d85){var _0x3e932a=function(_0xaf01a5){while(--_0xaf01a5){_0x4e6af2['push'](_0x4e6af2['shift']());}};_0x3e932a(++_0x5b9d85);}(_0xc410,0x106));var _0x0c41=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xc410[_0x43941d];return _0x27b82a;};'use strict';var multer=require(_0x0c41('0x0'));var util=require(_0x0c41('0x1'));var path=require(_0x0c41('0x2'));var timeout=require(_0x0c41('0x3'));var express=require(_0x0c41('0x4'));var router=express[_0x0c41('0x5')]();var fs_extra=require(_0x0c41('0x6'));var auth=require(_0x0c41('0x7'));var interaction=require(_0x0c41('0x8'));var config=require(_0x0c41('0x9'));var controller=require('./openchannelQueue.controller');router[_0x0c41('0xa')]('/',auth[_0x0c41('0xb')](),controller[_0x0c41('0xc')]);router[_0x0c41('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x0c41('0xd')]);router[_0x0c41('0xa')](_0x0c41('0xe'),auth[_0x0c41('0xb')](),controller[_0x0c41('0xf')]);router[_0x0c41('0xa')](_0x0c41('0x10'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x11')]);router[_0x0c41('0xa')](_0x0c41('0x12'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x13')]);router['get'](_0x0c41('0x14'),auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x0c41('0xb')](),controller[_0x0c41('0x15')]);router[_0x0c41('0x16')](_0x0c41('0x12'),auth[_0x0c41('0xb')](),controller['addTeams']);router['post'](_0x0c41('0x14'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x17')]);router['put'](_0x0c41('0xe'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x18')]);router['delete'](_0x0c41('0xe'),auth[_0x0c41('0xb')](),controller['destroy']);router['delete'](_0x0c41('0x12'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x19')]);router['delete'](_0x0c41('0x14'),auth[_0x0c41('0xb')](),controller[_0x0c41('0x1a')]);module['exports']=router;
\ No newline at end of file
index 6dd41ef..e80ede8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a1b=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0xbf7a0a,_0x1d22e9){var _0x31b1ed=function(_0x3721fa){while(--_0x3721fa){_0xbf7a0a['push'](_0xbf7a0a['shift']());}};_0x31b1ed(++_0x1d22e9);}(_0x0a1b,0x1ee));var _0xb0a1=function(_0x38babc,_0x51eee5){_0x38babc=_0x38babc-0x0;var _0x5777a9=_0x0a1b[_0x38babc];return _0x5777a9;};'use strict';var Sequelize=require(_0xb0a1('0x0'));module[_0xb0a1('0x1')]={'name':{'type':Sequelize[_0xb0a1('0x2')],'unique':_0xb0a1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb0a1('0x2')]},'timeout':{'type':Sequelize[_0xb0a1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb0a1('0x5')](_0xb0a1('0x6'),_0xb0a1('0x7'),'roundrobin')}};
\ No newline at end of file
+var _0xa17a=['sequelize','exports','STRING','name','INTEGER','ENUM','beepall','roundrobin'];(function(_0x1c3281,_0x5c69a0){var _0x27588d=function(_0x47114c){while(--_0x47114c){_0x1c3281['push'](_0x1c3281['shift']());}};_0x27588d(++_0x5c69a0);}(_0xa17a,0x1e8));var _0xaa17=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0xa17a[_0x4d8789];return _0x404e41;};'use strict';var Sequelize=require(_0xaa17('0x0'));module[_0xaa17('0x1')]={'name':{'type':Sequelize[_0xaa17('0x2')],'unique':_0xaa17('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xaa17('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaa17('0x5')]('rrmemory',_0xaa17('0x6'),_0xaa17('0x7'))}};
\ No newline at end of file
index fa5f49a..acdabb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdab=['fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','sendStatus','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','createdAt','rows','format','%s/%s','SIP','openchannelPause','updatedAt','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','all','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5dfe60,_0x5818df){var _0x1bf845=function(_0x23c200){while(--_0x23c200){_0x5dfe60['push'](_0x5dfe60['shift']());}};_0x1bf845(++_0x5818df);}(_0xcdab,0x10c));var _0xbcda=function(_0x1d606d,_0x376e51){_0x1d606d=_0x1d606d-0x0;var _0x3c38bd=_0xcdab[_0x1d606d];return _0x3c38bd;};'use strict';var emlformat=require(_0xbcda('0x0'));var rimraf=require(_0xbcda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbcda('0x2'));var rp=require(_0xbcda('0x3'));var moment=require(_0xbcda('0x4'));var BPromise=require(_0xbcda('0x5'));var Mustache=require(_0xbcda('0x6'));var util=require(_0xbcda('0x7'));var path=require(_0xbcda('0x8'));var sox=require(_0xbcda('0x9'));var csv=require(_0xbcda('0xa'));var ejs=require(_0xbcda('0xb'));var fs=require('fs');var fs_extra=require(_0xbcda('0xc'));var _=require(_0xbcda('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbcda('0xe'));var deskjs=require(_0xbcda('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbcda('0x10'));var Redis=require(_0xbcda('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbcda('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbcda('0x13'));var logger=require(_0xbcda('0x14'))('api');var utils=require(_0xbcda('0x15'));var config=require(_0xbcda('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbcda('0x17')]=_[_0xbcda('0x18')](config[_0xbcda('0x17')],{'host':_0xbcda('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbcda('0x17')]));require(_0xbcda('0x1a'))[_0xbcda('0x1b')](socket);function respondWithStatusCode(_0x29c079,_0x55b7ff){_0x55b7ff=_0x55b7ff||0xcc;return function(_0x584032){if(_0x584032){return _0x29c079['sendStatus'](_0x55b7ff);}return _0x29c079[_0xbcda('0x1c')](_0x55b7ff)[_0xbcda('0x1d')]();};}function respondWithResult(_0x14e45f,_0x202c93){_0x202c93=_0x202c93||0xc8;return function(_0x10d85c){if(_0x10d85c){return _0x14e45f[_0xbcda('0x1c')](_0x202c93)[_0xbcda('0x1e')](_0x10d85c);}};}function respondWithFilteredResult(_0x1c74d2,_0x5c699f){return function(_0xaffe30){if(_0xaffe30){var _0xcab36c=typeof _0x5c699f[_0xbcda('0x1f')]===_0xbcda('0x20')&&typeof _0x5c699f[_0xbcda('0x21')]===_0xbcda('0x20');var _0x1f6d9c=_0xaffe30[_0xbcda('0x22')];var _0x33002b=_0xcab36c?0x0:_0x5c699f['offset'];var _0x15b210=_0xcab36c?_0xaffe30[_0xbcda('0x22')]:_0x5c699f['offset']+_0x5c699f['limit'];var _0x4c92b3;if(_0x15b210>=_0x1f6d9c){_0x15b210=_0x1f6d9c;_0x4c92b3=0xc8;}else{_0x4c92b3=0xce;}_0x1c74d2[_0xbcda('0x1c')](_0x4c92b3);return _0x1c74d2['set']('Content-Range',_0x33002b+'-'+_0x15b210+'/'+_0x1f6d9c)['json'](_0xaffe30);}return null;};}function patchUpdates(_0x2dc3a2){return function(_0x120641){try{jsonpatch[_0xbcda('0x23')](_0x120641,_0x2dc3a2,!![]);}catch(_0x450e1d){return BPromise['reject'](_0x450e1d);}return _0x120641[_0xbcda('0x24')]();};}function saveUpdates(_0xcaa1d3,_0x4e22ea){return function(_0x105a14){if(_0x105a14){return _0x105a14[_0xbcda('0x25')](_0xcaa1d3)[_0xbcda('0x26')](function(_0x317fbc){return _0x317fbc;});}return null;};}function removeEntity(_0x540dce,_0x115015){return function(_0x290047){if(_0x290047){return _0x290047[_0xbcda('0x27')]()[_0xbcda('0x26')](function(){var _0xd290b0=_0x290047[_0xbcda('0x28')]({'plain':!![]});var _0x348f42=_0xbcda('0x29');return db[_0xbcda('0x2a')]['destroy']({'where':{'type':_0x348f42,'resourceId':_0xd290b0['id']}})['then'](function(){return _0x290047;});})[_0xbcda('0x26')](function(){_0x540dce['status'](0xcc)[_0xbcda('0x1d')]();});}};}function handleEntityNotFound(_0x43f612,_0x48c54b){return function(_0x22ded1){if(!_0x22ded1){_0x43f612[_0xbcda('0x2b')](0x194);}return _0x22ded1;};}function handleError(_0x2425d1,_0x42e149){_0x42e149=_0x42e149||0x1f4;return function(_0x59c294){logger[_0xbcda('0x2c')](_0x59c294['stack']);if(_0x59c294[_0xbcda('0x2d')]){delete _0x59c294[_0xbcda('0x2d')];}_0x2425d1['status'](_0x42e149)[_0xbcda('0x2e')](_0x59c294);};}exports[_0xbcda('0x2f')]=function(_0x3ba406,_0x57393b){var _0x2cbcc9={},_0x2df3d8={},_0x5731ef={'count':0x0,'rows':[]};var _0x1cda17=_[_0xbcda('0x30')](db[_0xbcda('0x31')][_0xbcda('0x32')],function(_0x3eb093){return{'name':_0x3eb093[_0xbcda('0x33')],'type':_0x3eb093[_0xbcda('0x34')][_0xbcda('0x35')]};});_0x2df3d8['model']=_['map'](_0x1cda17,_0xbcda('0x2d'));_0x2df3d8[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x3ba406[_0xbcda('0x36')]);_0x2df3d8[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x2df3d8[_0xbcda('0x3a')],_0x2df3d8['query']);_0x2cbcc9[_0xbcda('0x3b')]=_[_0xbcda('0x39')](_0x2df3d8[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x3ba406[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x2cbcc9[_0xbcda('0x3b')]=_0x2cbcc9[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x2cbcc9[_0xbcda('0x3b')]:_0x2df3d8[_0xbcda('0x3a')];if(!_0x3ba406[_0xbcda('0x36')][_0xbcda('0x3e')](_0xbcda('0x3f'))){_0x2cbcc9[_0xbcda('0x21')]=qs[_0xbcda('0x21')](_0x3ba406['query'][_0xbcda('0x21')]);_0x2cbcc9[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x3ba406[_0xbcda('0x36')]['offset']);}_0x2cbcc9[_0xbcda('0x40')]=qs[_0xbcda('0x41')](_0x3ba406[_0xbcda('0x36')][_0xbcda('0x41')]);_0x2cbcc9[_0xbcda('0x42')]=qs[_0xbcda('0x38')](_[_0xbcda('0x43')](_0x3ba406[_0xbcda('0x36')],_0x2df3d8[_0xbcda('0x38')]),_0x1cda17);if(_0x3ba406[_0xbcda('0x36')][_0xbcda('0x44')]){_0x2cbcc9[_0xbcda('0x42')]=_[_0xbcda('0x45')](_0x2cbcc9['where'],{'$or':_[_0xbcda('0x30')](_0x1cda17,function(_0x404d34){if(_0x404d34[_0xbcda('0x34')]!==_0xbcda('0x46')){var _0x2becc6={};_0x2becc6[_0x404d34[_0xbcda('0x2d')]]={'$like':'%'+_0x3ba406[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x2becc6;}})});}_0x2cbcc9=_[_0xbcda('0x45')]({},_0x2cbcc9,_0x3ba406[_0xbcda('0x47')]);var _0x2c32af={'where':_0x2cbcc9[_0xbcda('0x42')]};return db[_0xbcda('0x31')]['count'](_0x2c32af)['then'](function(_0x4f7c52){_0x5731ef[_0xbcda('0x22')]=_0x4f7c52;if(_0x3ba406[_0xbcda('0x36')][_0xbcda('0x48')]){_0x2cbcc9['include']=[{'all':!![]}];}return db[_0xbcda('0x31')][_0xbcda('0x49')](_0x2cbcc9);})[_0xbcda('0x26')](function(_0x518955){_0x5731ef['rows']=_0x518955;return _0x5731ef;})[_0xbcda('0x26')](respondWithFilteredResult(_0x57393b,_0x2cbcc9))[_0xbcda('0x4a')](handleError(_0x57393b,null));};exports[_0xbcda('0x4b')]=function(_0x245b96,_0x52e0c2){var _0x1c915a={'raw':!![],'where':{'id':_0x245b96[_0xbcda('0x4c')]['id']}},_0x22ad22={};_0x22ad22[_0xbcda('0x3a')]=_['keys'](db[_0xbcda('0x31')][_0xbcda('0x32')]);_0x22ad22[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x245b96['query']);_0x22ad22[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x22ad22['model'],_0x22ad22['query']);_0x1c915a[_0xbcda('0x3b')]=_['intersection'](_0x22ad22['model'],qs[_0xbcda('0x3c')](_0x245b96[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x1c915a[_0xbcda('0x3b')]=_0x1c915a[_0xbcda('0x3b')]['length']?_0x1c915a[_0xbcda('0x3b')]:_0x22ad22[_0xbcda('0x3a')];if(_0x245b96[_0xbcda('0x36')]['includeAll']){_0x1c915a[_0xbcda('0x4d')]=[{'all':!![]}];}_0x1c915a=_[_0xbcda('0x45')]({},_0x1c915a,_0x245b96[_0xbcda('0x47')]);return db[_0xbcda('0x31')][_0xbcda('0x4e')](_0x1c915a)[_0xbcda('0x26')](handleEntityNotFound(_0x52e0c2,null))['then'](respondWithResult(_0x52e0c2,null))['catch'](handleError(_0x52e0c2,null));};exports[_0xbcda('0x4f')]=function(_0x52b4e9,_0xa52bbe){return db['OpenchannelQueue'][_0xbcda('0x4f')](_0x52b4e9[_0xbcda('0x50')],{})[_0xbcda('0x26')](function(_0x28897e){var _0x1e266f=_0x52b4e9[_0xbcda('0x51')][_0xbcda('0x28')]({'plain':!![]});if(!_0x1e266f)throw new Error(_0xbcda('0x52'));if(_0x1e266f[_0xbcda('0x53')]===_0xbcda('0x51')){var _0x4506fa=_0x28897e[_0xbcda('0x28')]({'plain':!![]});var _0x14840d=_0xbcda('0x29');return db[_0xbcda('0x54')][_0xbcda('0x4e')]({'where':{'name':_0x14840d,'userProfileId':_0x1e266f[_0xbcda('0x55')]},'raw':!![]})[_0xbcda('0x26')](function(_0x105fad){if(_0x105fad&&_0x105fad[_0xbcda('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x4506fa[_0xbcda('0x2d')],'resourceId':_0x4506fa['id'],'type':_0x105fad[_0xbcda('0x2d')],'sectionId':_0x105fad['id']},{})[_0xbcda('0x26')](function(){return _0x28897e;});}else{return _0x28897e;}})[_0xbcda('0x4a')](function(_0xae62e7){logger[_0xbcda('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xae62e7);throw _0xae62e7;});}return _0x28897e;})['then'](respondWithResult(_0xa52bbe,0xc9))[_0xbcda('0x4a')](handleError(_0xa52bbe,null));};exports[_0xbcda('0x25')]=function(_0x57578e,_0x18d9cb){if(_0x57578e['body']['id']){delete _0x57578e[_0xbcda('0x50')]['id'];}return db[_0xbcda('0x31')]['find']({'where':{'id':_0x57578e[_0xbcda('0x4c')]['id']}})['then'](handleEntityNotFound(_0x18d9cb,null))['then'](saveUpdates(_0x57578e[_0xbcda('0x50')],null))['then'](respondWithResult(_0x18d9cb,null))[_0xbcda('0x4a')](handleError(_0x18d9cb,null));};exports[_0xbcda('0x27')]=function(_0x1b9c6d,_0x239f6a){return db[_0xbcda('0x31')]['find']({'where':{'id':_0x1b9c6d[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x239f6a,null))['then'](removeEntity(_0x239f6a,null))[_0xbcda('0x4a')](handleError(_0x239f6a,null));};exports[_0xbcda('0x57')]=function(_0x43277a,_0x1fc02a){return db['OpenchannelQueue'][_0xbcda('0x57')]()[_0xbcda('0x26')](respondWithResult(_0x1fc02a,null))[_0xbcda('0x4a')](handleError(_0x1fc02a,null));};exports[_0xbcda('0x58')]=function(_0x2ac4d4,_0x2993c9,_0x457bb7){var _0x1d1da5={'raw':!![],'where':{}},_0x2cc6a1={},_0x3051df;return db[_0xbcda('0x31')][_0xbcda('0x59')]({'where':{'id':_0x2ac4d4['params']['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x2993c9,null))[_0xbcda('0x26')](function(_0x3f37d8){if(_0x3f37d8){_0x3051df=_0x3f37d8['get']({'plain':!![]});_0x2cc6a1[_0xbcda('0x3a')]=_['keys'](db[_0xbcda('0x5a')][_0xbcda('0x32')]);_0x2cc6a1[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x2ac4d4[_0xbcda('0x36')]);_0x2cc6a1[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x2cc6a1[_0xbcda('0x3a')],_0x2cc6a1[_0xbcda('0x36')]);_0x1d1da5['attributes']=_['intersection'](_0x2cc6a1[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x2ac4d4[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x1d1da5['attributes']=_0x1d1da5[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x1d1da5[_0xbcda('0x3b')]:_0x2cc6a1[_0xbcda('0x3a')];if(!_0x2ac4d4['query'][_0xbcda('0x3e')]('nolimit')){_0x1d1da5[_0xbcda('0x21')]=qs[_0xbcda('0x21')](_0x2ac4d4['query']['limit']);_0x1d1da5[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x2ac4d4['query'][_0xbcda('0x1f')]);}_0x1d1da5[_0xbcda('0x40')]=qs[_0xbcda('0x41')](_0x2ac4d4[_0xbcda('0x36')]['sort']);_0x1d1da5[_0xbcda('0x42')]=qs[_0xbcda('0x38')](_['pick'](_0x2ac4d4[_0xbcda('0x36')],_0x2cc6a1['filters']));_0x1d1da5[_0xbcda('0x42')][_0xbcda('0x5b')]=_0x3f37d8['id'];if(_0x2ac4d4[_0xbcda('0x36')][_0xbcda('0x44')]){_0x1d1da5[_0xbcda('0x42')]=_[_0xbcda('0x45')](_0x1d1da5[_0xbcda('0x42')],{'$or':_[_0xbcda('0x30')](_0x1d1da5[_0xbcda('0x3b')],function(_0x40cf74){var _0x557df5={};_0x557df5[_0x40cf74]={'$like':'%'+_0x2ac4d4[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x557df5;})});}_0x1d1da5=_['merge']({},_0x1d1da5,_0x2ac4d4[_0xbcda('0x47')]);return db[_0xbcda('0x5a')][_0xbcda('0x49')](_0x1d1da5);}})['then'](function(_0x11c3bd){if(_0x11c3bd){return db[_0xbcda('0x5c')][_0xbcda('0x5d')]({'where':{'id':_['map'](_0x11c3bd,_0xbcda('0x5e')),'role':_0xbcda('0x5f')},'attributes':['id',_0xbcda('0x2d'),'openchannelPause','updatedAt',_0xbcda('0x60')]});}})[_0xbcda('0x26')](function(_0x491e73){if(_0x491e73){return{'count':_0x491e73[_0xbcda('0x22')],'rows':_['map'](_0x491e73[_0xbcda('0x61')],function(_0x4066ee){return{'membername':_0x4066ee['name'],'UserId':_0x4066ee['id'],'queue_name':_0x3051df['name'],'OpenchannelQueueId':_0x3051df['id'],'interface':util[_0xbcda('0x62')](_0xbcda('0x63'),_0xbcda('0x64'),_0x4066ee['name']),'penalty':0x0,'paused':_0x4066ee[_0xbcda('0x65')],'createdAt':_0x4066ee[_0xbcda('0x60')],'updatedAt':_0x4066ee[_0xbcda('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xbcda('0x26')](respondWithFilteredResult(_0x2993c9,_0x1d1da5))[_0xbcda('0x4a')](handleError(_0x2993c9,null));};exports[_0xbcda('0x67')]=function(_0x4718d8,_0x134151,_0xc3edb0){var _0x197fa2={};var _0x41415e={};var _0x531019;var _0xaa2874;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x4718d8[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x134151,null))[_0xbcda('0x26')](function(_0x1eeb36){if(_0x1eeb36){_0x531019=_0x1eeb36;_0x41415e[_0xbcda('0x3a')]=_[_0xbcda('0x37')](db[_0xbcda('0x68')]['rawAttributes']);_0x41415e[_0xbcda('0x36')]=_[_0xbcda('0x37')](_0x4718d8['query']);_0x41415e[_0xbcda('0x38')]=_[_0xbcda('0x39')](_0x41415e[_0xbcda('0x3a')],_0x41415e[_0xbcda('0x36')]);_0x197fa2[_0xbcda('0x3b')]=_[_0xbcda('0x39')](_0x41415e[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x197fa2[_0xbcda('0x3b')]=_0x197fa2[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x197fa2[_0xbcda('0x3b')]:_0x41415e[_0xbcda('0x3a')];_0x197fa2['order']=qs[_0xbcda('0x41')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x41')]);_0x197fa2['where']=qs[_0xbcda('0x38')](_[_0xbcda('0x43')](_0x4718d8[_0xbcda('0x36')],_0x41415e[_0xbcda('0x38')]));if(_0x4718d8[_0xbcda('0x36')][_0xbcda('0x44')]){_0x197fa2[_0xbcda('0x42')]=_[_0xbcda('0x45')](_0x197fa2[_0xbcda('0x42')],{'$or':_['map'](_0x197fa2[_0xbcda('0x3b')],function(_0x244ff7){var _0x20f408={};_0x20f408[_0x244ff7]={'$like':'%'+_0x4718d8[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x20f408;})});}_0x197fa2=_[_0xbcda('0x45')]({},_0x197fa2,_0x4718d8['options']);return _0x531019['getTeams'](_0x197fa2);}})[_0xbcda('0x26')](function(_0x132dff){if(_0x132dff){_0xaa2874=_0x132dff[_0xbcda('0x3d')];if(!_0x4718d8[_0xbcda('0x36')]['hasOwnProperty'](_0xbcda('0x3f'))){_0x197fa2[_0xbcda('0x21')]=qs[_0xbcda('0x21')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x21')]);_0x197fa2[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x4718d8[_0xbcda('0x36')][_0xbcda('0x1f')]);}return _0x531019['getTeams'](_0x197fa2);}})[_0xbcda('0x26')](function(_0x217233){if(_0x217233){return _0x217233?{'count':_0xaa2874,'rows':_0x217233}:null;}})[_0xbcda('0x26')](respondWithResult(_0x134151,null))[_0xbcda('0x4a')](handleError(_0x134151,null));};exports['addTeams']=function(_0x19fded,_0x32f07a,_0x3ea444){var _0x5b4339=_0x19fded[_0xbcda('0x50')]['ids'];return db[_0xbcda('0x68')][_0xbcda('0x49')]({'where':{'id':_0x5b4339},'attributes':['id'],'include':[{'model':db[_0xbcda('0x5c')],'as':_0xbcda('0x69'),'attributes':['id','name',_0xbcda('0x6a'),_0xbcda('0x6b'),_0xbcda('0x6c')],'raw':!![]}]})[_0xbcda('0x26')](function(_0xead492){if(_0xead492){var _0x3f2d06=_[_0xbcda('0x6d')](_0xead492,function(_0x5716ee){var _0x1a67f6=_0x5716ee['get']({'plain':!![]});return _0x1a67f6[_0xbcda('0x69')];});return db[_0xbcda('0x31')][_0xbcda('0x4e')]({'where':{'id':_0x19fded[_0xbcda('0x4c')]['id']}})['then'](function(_0xb487a){return db[_0xbcda('0x6e')][_0xbcda('0x6f')](function(_0x877d77){return _0xb487a[_0xbcda('0x70')](_0x5b4339,{'transaction':_0x877d77})[_0xbcda('0x26')](function(){return BPromise[_0xbcda('0x71')](_0x3f2d06,function(_0x3e4820){return db[_0xbcda('0x5a')]['findOrCreate']({'where':{'UserId':_0x3e4820['id'],'OpenchannelQueueId':_0x19fded[_0xbcda('0x4c')]['id']},'transaction':_0x877d77});});})[_0xbcda('0x26')](function(){_0x3f2d06[_0xbcda('0x72')](function(_0xd5c61a){socket[_0xbcda('0x73')](_0xbcda('0x74'),{'UserId':_0xd5c61a['id'],'OpenchannelQueueId':_0xb487a['id']});});});});});}})['then'](respondWithStatusCode(_0x32f07a,null))[_0xbcda('0x4a')](handleError(_0x32f07a,null));};exports[_0xbcda('0x75')]=function(_0x2011ba,_0x2e49f1,_0x168223){return db[_0xbcda('0x68')][_0xbcda('0x49')]({'where':{'id':_0x2011ba[_0xbcda('0x36')][_0xbcda('0x76')]},'attributes':['id'],'include':[{'model':db[_0xbcda('0x5c')],'as':_0xbcda('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2e49f1,null))[_0xbcda('0x26')](function(_0x8174b4){var _0x49a7cf=_[_0xbcda('0x30')](_0x8174b4,'id');var _0x4515ba=[];var _0x4841eb=[];var _0x54222c=squel[_0xbcda('0x77')]();_0x54222c[_0xbcda('0x78')](_0xbcda('0x79'))[_0xbcda('0x7a')]('team_has_openchannel_queues','tq')[_0xbcda('0x7b')]('user_has_teams','ut',_0xbcda('0x7c'))[_0xbcda('0x42')](_0xbcda('0x7d'),_0x2011ba[_0xbcda('0x4c')]['id']);for(var _0x340718=0x0;_0x340718<_0x8174b4[_0xbcda('0x3d')];_0x340718+=0x1){let _0x407f71=_0x8174b4[_0x340718];for(var _0x59a140=0x0;_0x59a140<_0x407f71['Agents'][_0xbcda('0x3d')];_0x59a140+=0x1){let _0x44ed16=_0x407f71[_0xbcda('0x69')][_0x59a140];var _0x3f52e2=_0x54222c[_0xbcda('0x7e')]();_0x3f52e2['where'](_0xbcda('0x7f'),_0x44ed16['id']);_0x4841eb['push'](db[_0xbcda('0x6e')][_0xbcda('0x36')](_0x3f52e2[_0xbcda('0x80')](),{'type':db[_0xbcda('0x6e')][_0xbcda('0x81')]['SELECT']})[_0xbcda('0x26')](function(_0x43aa41){if(_0x43aa41[_0xbcda('0x3d')]===0x1){return _0x44ed16['id'];}else{var _0x1f851c=_[_0xbcda('0x82')](_['map'](_0x43aa41,_0xbcda('0x83')),function(_0x430ad0){return _['includes'](_0x49a7cf,_0x430ad0);});if(_0x1f851c){return _0x44ed16['id'];}}}));}}return BPromise[_0xbcda('0x84')](_0x4841eb)[_0xbcda('0x26')](function(_0xc62c2e){_0x4515ba=_(_0x4515ba)['union'](_0xc62c2e)['compact']()[_0xbcda('0x85')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x2011ba[_0xbcda('0x4c')]['id']}})['then'](function(_0xde1557){return db[_0xbcda('0x6e')]['transaction'](function(_0x4bf194){return _0xde1557[_0xbcda('0x75')](_0x2011ba[_0xbcda('0x36')][_0xbcda('0x76')],{'transaction':_0x4bf194})['then'](function(){if(!_[_0xbcda('0x86')](_0x4515ba)){return _0xde1557[_0xbcda('0x87')](_0x4515ba,{'transaction':_0x4bf194});}})['then'](function(){_0x4515ba[_0xbcda('0x72')](function(_0x14a632){socket[_0xbcda('0x73')](_0xbcda('0x88'),{'UserId':_0x14a632,'OpenchannelQueueId':_0xde1557['id']});});});});});});})['then'](respondWithStatusCode(_0x2e49f1,null))[_0xbcda('0x4a')](handleError(_0x2e49f1,null));};exports[_0xbcda('0x89')]=function(_0x8f67bf,_0x270d00,_0x53e77b){return db[_0xbcda('0x31')][_0xbcda('0x4e')]({'where':{'id':_0x8f67bf[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x270d00,null))['then'](function(_0x57ec74){if(_0x57ec74){return _0x57ec74[_0xbcda('0x89')](_0x8f67bf[_0xbcda('0x50')]['ids'],_['omit'](_0x8f67bf['body'],['ids','id'])||{})['spread'](function(_0x736b04){for(var _0xaaeb0=0x0;_0xaaeb0<_0x8f67bf[_0xbcda('0x50')]['ids'][_0xbcda('0x3d')];_0xaaeb0+=0x1){socket[_0xbcda('0x73')](_0xbcda('0x74'),{'UserId':Number(_0x8f67bf[_0xbcda('0x50')][_0xbcda('0x76')][_0xaaeb0]),'OpenchannelQueueId':Number(_0x8f67bf['params']['id'])});}return _0x736b04;});}})[_0xbcda('0x26')](respondWithResult(_0x270d00,null))[_0xbcda('0x4a')](handleError(_0x270d00,null));};exports[_0xbcda('0x87')]=function(_0x1b0f00,_0x13cc68,_0x409476){return db[_0xbcda('0x31')]['find']({'where':{'id':_0x1b0f00[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x13cc68,null))[_0xbcda('0x26')](function(_0x287509){if(_0x287509){return _0x287509['removeAgents'](_0x1b0f00[_0xbcda('0x36')][_0xbcda('0x76')])[_0xbcda('0x26')](function(){if(_[_0xbcda('0x8a')](_0x1b0f00[_0xbcda('0x36')]['ids'])){for(var _0x5cea1a=0x0;_0x5cea1a<_0x1b0f00[_0xbcda('0x36')]['ids'][_0xbcda('0x3d')];_0x5cea1a+=0x1){socket[_0xbcda('0x73')](_0xbcda('0x88'),{'UserId':Number(_0x1b0f00['query'][_0xbcda('0x76')][_0x5cea1a]),'OpenchannelQueueId':Number(_0x1b0f00[_0xbcda('0x4c')]['id'])});}}else{socket[_0xbcda('0x73')](_0xbcda('0x88'),{'UserId':Number(_0x1b0f00['query']['ids']),'OpenchannelQueueId':Number(_0x1b0f00['params']['id'])});}});}})[_0xbcda('0x26')](respondWithStatusCode(_0x13cc68,null))['catch'](handleError(_0x13cc68,null));};exports[_0xbcda('0x8b')]=function(_0x32830d,_0x5a4889,_0x4ff757){var _0x43323e={};var _0x3e3553={};var _0x51f9f3;var _0x3da074;return db[_0xbcda('0x31')][_0xbcda('0x59')]({'where':{'id':_0x32830d[_0xbcda('0x4c')]['id']}})[_0xbcda('0x26')](handleEntityNotFound(_0x5a4889,null))['then'](function(_0x4dbaa0){if(_0x4dbaa0){_0x51f9f3=_0x4dbaa0;_0x3e3553[_0xbcda('0x3a')]=_[_0xbcda('0x37')](db[_0xbcda('0x5c')][_0xbcda('0x32')]);_0x3e3553[_0xbcda('0x36')]=_['keys'](_0x32830d['query']);_0x3e3553[_0xbcda('0x38')]=_['intersection'](_0x3e3553[_0xbcda('0x3a')],_0x3e3553['query']);_0x43323e[_0xbcda('0x3b')]=_['intersection'](_0x3e3553[_0xbcda('0x3a')],qs[_0xbcda('0x3c')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x3c')]));_0x43323e[_0xbcda('0x3b')]=_0x43323e[_0xbcda('0x3b')][_0xbcda('0x3d')]?_0x43323e[_0xbcda('0x3b')]:_0x3e3553[_0xbcda('0x3a')];_0x43323e['order']=qs[_0xbcda('0x41')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x41')]);_0x43323e[_0xbcda('0x42')]=qs[_0xbcda('0x38')](_['pick'](_0x32830d[_0xbcda('0x36')],_0x3e3553[_0xbcda('0x38')]));if(_0x32830d[_0xbcda('0x36')][_0xbcda('0x44')]){_0x43323e['where']=_['merge'](_0x43323e['where'],{'$or':_[_0xbcda('0x30')](_0x43323e['attributes'],function(_0x19e3b9){var _0x13144f={};_0x13144f[_0x19e3b9]={'$like':'%'+_0x32830d[_0xbcda('0x36')][_0xbcda('0x44')]+'%'};return _0x13144f;})});}_0x43323e=_[_0xbcda('0x45')]({},_0x43323e,_0x32830d[_0xbcda('0x47')]);return _0x51f9f3['getAgents'](_0x43323e);}})[_0xbcda('0x26')](function(_0x54594b){if(_0x54594b){_0x3da074=_0x54594b[_0xbcda('0x3d')];if(!_0x32830d[_0xbcda('0x36')][_0xbcda('0x3e')]('nolimit')){_0x43323e['limit']=qs[_0xbcda('0x21')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x21')]);_0x43323e[_0xbcda('0x1f')]=qs[_0xbcda('0x1f')](_0x32830d[_0xbcda('0x36')][_0xbcda('0x1f')]);}return _0x51f9f3[_0xbcda('0x8b')](_0x43323e);}})[_0xbcda('0x26')](function(_0x3bedda){if(_0x3bedda){return _0x3bedda?{'count':_0x3da074,'rows':_0x3bedda}:null;}})[_0xbcda('0x26')](respondWithResult(_0x5a4889,null))[_0xbcda('0x4a')](handleError(_0x5a4889,null));};
\ No newline at end of file
+var _0x7601=['from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','OpenchannelQueues','destroy','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMembers','UserOpenchannelQueue','OpenchannelQueueId','User','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId'];(function(_0x1f34d5,_0xf431f5){var _0x214491=function(_0x488a76){while(--_0x488a76){_0x1f34d5['push'](_0x1f34d5['shift']());}};_0x214491(++_0xf431f5);}(_0x7601,0x1c5));var _0x1760=function(_0x5382db,_0xb7e59b){_0x5382db=_0x5382db-0x0;var _0x2f4b39=_0x7601[_0x5382db];return _0x2f4b39;};'use strict';var emlformat=require(_0x1760('0x0'));var rimraf=require(_0x1760('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1760('0x2'));var rp=require('request-promise');var moment=require(_0x1760('0x3'));var BPromise=require(_0x1760('0x4'));var Mustache=require(_0x1760('0x5'));var util=require(_0x1760('0x6'));var path=require(_0x1760('0x7'));var sox=require(_0x1760('0x8'));var csv=require(_0x1760('0x9'));var ejs=require(_0x1760('0xa'));var fs=require('fs');var fs_extra=require(_0x1760('0xb'));var _=require(_0x1760('0xc'));var squel=require(_0x1760('0xd'));var crypto=require(_0x1760('0xe'));var jsforce=require(_0x1760('0xf'));var deskjs=require(_0x1760('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1760('0x11'));var Papa=require('papaparse');var Redis=require(_0x1760('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1760('0x13'));var hardwareService=require(_0x1760('0x14'));var logger=require(_0x1760('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1760('0x16'));var licenseUtil=require(_0x1760('0x17'));var db=require('../../mysqldb')['db'];config[_0x1760('0x18')]=_[_0x1760('0x19')](config['redis'],{'host':_0x1760('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1760('0x18')]));require('./openchannelQueue.socket')[_0x1760('0x1b')](socket);function respondWithStatusCode(_0x3c6324,_0x35dba9){_0x35dba9=_0x35dba9||0xcc;return function(_0x5c82cf){if(_0x5c82cf){return _0x3c6324[_0x1760('0x1c')](_0x35dba9);}return _0x3c6324[_0x1760('0x1d')](_0x35dba9)['end']();};}function respondWithResult(_0x21acbc,_0x4f5763){_0x4f5763=_0x4f5763||0xc8;return function(_0x66b5c){if(_0x66b5c){return _0x21acbc['status'](_0x4f5763)[_0x1760('0x1e')](_0x66b5c);}};}function respondWithFilteredResult(_0x9385bc,_0x10f2ac){return function(_0x2304e4){if(_0x2304e4){var _0x3cab8f=typeof _0x10f2ac[_0x1760('0x1f')]===_0x1760('0x20')&&typeof _0x10f2ac[_0x1760('0x21')]===_0x1760('0x20');var _0x5e295c=_0x2304e4[_0x1760('0x22')];var _0x9bcd1a=_0x3cab8f?0x0:_0x10f2ac[_0x1760('0x1f')];var _0x214563=_0x3cab8f?_0x2304e4['count']:_0x10f2ac[_0x1760('0x1f')]+_0x10f2ac[_0x1760('0x21')];var _0x391211;if(_0x214563>=_0x5e295c){_0x214563=_0x5e295c;_0x391211=0xc8;}else{_0x391211=0xce;}_0x9385bc[_0x1760('0x1d')](_0x391211);return _0x9385bc[_0x1760('0x23')](_0x1760('0x24'),_0x9bcd1a+'-'+_0x214563+'/'+_0x5e295c)[_0x1760('0x1e')](_0x2304e4);}return null;};}function patchUpdates(_0x2ebb80){return function(_0x35d622){try{jsonpatch[_0x1760('0x25')](_0x35d622,_0x2ebb80,!![]);}catch(_0x193d67){return BPromise[_0x1760('0x26')](_0x193d67);}return _0x35d622['save']();};}function saveUpdates(_0x180192,_0x1cd81b){return function(_0x7e3f8d){if(_0x7e3f8d){return _0x7e3f8d[_0x1760('0x27')](_0x180192)[_0x1760('0x28')](function(_0x24bf68){return _0x24bf68;});}return null;};}function removeEntity(_0x1b48a9,_0x32370a){return function(_0x348a67){if(_0x348a67){return _0x348a67['destroy']()[_0x1760('0x28')](function(){var _0x247eb1=_0x348a67['get']({'plain':!![]});var _0x4a5569=_0x1760('0x29');return db['UserProfileResource'][_0x1760('0x2a')]({'where':{'type':_0x4a5569,'resourceId':_0x247eb1['id']}})[_0x1760('0x28')](function(){return _0x348a67;});})['then'](function(){_0x1b48a9[_0x1760('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46626f,_0x168940){return function(_0x56927e){if(!_0x56927e){_0x46626f[_0x1760('0x1c')](0x194);}return _0x56927e;};}function handleError(_0x4e0cb5,_0xb970ec){_0xb970ec=_0xb970ec||0x1f4;return function(_0x5c9e3d){logger[_0x1760('0x2b')](_0x5c9e3d[_0x1760('0x2c')]);if(_0x5c9e3d[_0x1760('0x2d')]){delete _0x5c9e3d['name'];}_0x4e0cb5[_0x1760('0x1d')](_0xb970ec)[_0x1760('0x2e')](_0x5c9e3d);};}exports[_0x1760('0x2f')]=function(_0x987dcb,_0x452634){var _0x5c6f90={},_0x2bf8e1={},_0x332ce8={'count':0x0,'rows':[]};var _0x3bef9d=_[_0x1760('0x30')](db[_0x1760('0x31')][_0x1760('0x32')],function(_0x5dc8cd){return{'name':_0x5dc8cd[_0x1760('0x33')],'type':_0x5dc8cd[_0x1760('0x34')][_0x1760('0x35')]};});_0x2bf8e1[_0x1760('0x36')]=_[_0x1760('0x30')](_0x3bef9d,_0x1760('0x2d'));_0x2bf8e1[_0x1760('0x37')]=_[_0x1760('0x38')](_0x987dcb[_0x1760('0x37')]);_0x2bf8e1[_0x1760('0x39')]=_[_0x1760('0x3a')](_0x2bf8e1[_0x1760('0x36')],_0x2bf8e1['query']);_0x5c6f90[_0x1760('0x3b')]=_[_0x1760('0x3a')](_0x2bf8e1[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x987dcb[_0x1760('0x37')][_0x1760('0x3c')]));_0x5c6f90[_0x1760('0x3b')]=_0x5c6f90[_0x1760('0x3b')][_0x1760('0x3d')]?_0x5c6f90[_0x1760('0x3b')]:_0x2bf8e1[_0x1760('0x36')];if(!_0x987dcb[_0x1760('0x37')][_0x1760('0x3e')](_0x1760('0x3f'))){_0x5c6f90[_0x1760('0x21')]=qs[_0x1760('0x21')](_0x987dcb[_0x1760('0x37')][_0x1760('0x21')]);_0x5c6f90[_0x1760('0x1f')]=qs[_0x1760('0x1f')](_0x987dcb[_0x1760('0x37')][_0x1760('0x1f')]);}_0x5c6f90[_0x1760('0x40')]=qs[_0x1760('0x41')](_0x987dcb[_0x1760('0x37')][_0x1760('0x41')]);_0x5c6f90[_0x1760('0x42')]=qs[_0x1760('0x39')](_[_0x1760('0x43')](_0x987dcb[_0x1760('0x37')],_0x2bf8e1[_0x1760('0x39')]),_0x3bef9d);if(_0x987dcb[_0x1760('0x37')][_0x1760('0x44')]){_0x5c6f90['where']=_[_0x1760('0x45')](_0x5c6f90[_0x1760('0x42')],{'$or':_[_0x1760('0x30')](_0x3bef9d,function(_0x42ecc0){if(_0x42ecc0['type']!=='VIRTUAL'){var _0x46de32={};_0x46de32[_0x42ecc0[_0x1760('0x2d')]]={'$like':'%'+_0x987dcb['query'][_0x1760('0x44')]+'%'};return _0x46de32;}})});}_0x5c6f90=_['merge']({},_0x5c6f90,_0x987dcb[_0x1760('0x46')]);var _0x3cc6e7={'where':_0x5c6f90[_0x1760('0x42')]};return db['OpenchannelQueue'][_0x1760('0x22')](_0x3cc6e7)['then'](function(_0x81b550){_0x332ce8[_0x1760('0x22')]=_0x81b550;if(_0x987dcb['query'][_0x1760('0x47')]){_0x5c6f90[_0x1760('0x48')]=[{'all':!![]}];}return db[_0x1760('0x31')][_0x1760('0x49')](_0x5c6f90);})['then'](function(_0x2d8011){_0x332ce8[_0x1760('0x4a')]=_0x2d8011;return _0x332ce8;})[_0x1760('0x28')](respondWithFilteredResult(_0x452634,_0x5c6f90))[_0x1760('0x4b')](handleError(_0x452634,null));};exports[_0x1760('0x4c')]=function(_0x108d6a,_0x14c49b){var _0x354803={'raw':!![],'where':{'id':_0x108d6a[_0x1760('0x4d')]['id']}},_0x458df9={};_0x458df9[_0x1760('0x36')]=_[_0x1760('0x38')](db['OpenchannelQueue'][_0x1760('0x32')]);_0x458df9[_0x1760('0x37')]=_[_0x1760('0x38')](_0x108d6a['query']);_0x458df9[_0x1760('0x39')]=_[_0x1760('0x3a')](_0x458df9[_0x1760('0x36')],_0x458df9['query']);_0x354803[_0x1760('0x3b')]=_[_0x1760('0x3a')](_0x458df9[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x108d6a['query'][_0x1760('0x3c')]));_0x354803[_0x1760('0x3b')]=_0x354803[_0x1760('0x3b')][_0x1760('0x3d')]?_0x354803['attributes']:_0x458df9[_0x1760('0x36')];if(_0x108d6a['query'][_0x1760('0x47')]){_0x354803[_0x1760('0x48')]=[{'all':!![]}];}_0x354803=_[_0x1760('0x45')]({},_0x354803,_0x108d6a[_0x1760('0x46')]);return db[_0x1760('0x31')][_0x1760('0x4e')](_0x354803)[_0x1760('0x28')](handleEntityNotFound(_0x14c49b,null))[_0x1760('0x28')](respondWithResult(_0x14c49b,null))[_0x1760('0x4b')](handleError(_0x14c49b,null));};exports[_0x1760('0x4f')]=function(_0x1afd2d,_0x2200ec){return db[_0x1760('0x31')]['create'](_0x1afd2d[_0x1760('0x50')],{})['then'](function(_0xe6825d){var _0x5da1bb=_0x1afd2d['user'][_0x1760('0x51')]({'plain':!![]});if(!_0x5da1bb)throw new Error(_0x1760('0x52'));if(_0x5da1bb['role']===_0x1760('0x53')){var _0x2f910f=_0xe6825d[_0x1760('0x51')]({'plain':!![]});var _0x1fa16d=_0x1760('0x29');return db[_0x1760('0x54')][_0x1760('0x4e')]({'where':{'name':_0x1fa16d,'userProfileId':_0x5da1bb['userProfileId']},'raw':!![]})[_0x1760('0x28')](function(_0x427061){if(_0x427061&&_0x427061[_0x1760('0x55')]===0x0){return db[_0x1760('0x56')]['create']({'name':_0x2f910f[_0x1760('0x2d')],'resourceId':_0x2f910f['id'],'type':_0x427061[_0x1760('0x2d')],'sectionId':_0x427061['id']},{})[_0x1760('0x28')](function(){return _0xe6825d;});}else{return _0xe6825d;}})[_0x1760('0x4b')](function(_0xa21542){logger[_0x1760('0x2b')](_0x1760('0x57'),_0xa21542);throw _0xa21542;});}return _0xe6825d;})[_0x1760('0x28')](respondWithResult(_0x2200ec,0xc9))['catch'](handleError(_0x2200ec,null));};exports['update']=function(_0x855439,_0x1761d9){if(_0x855439[_0x1760('0x50')]['id']){delete _0x855439[_0x1760('0x50')]['id'];}return db['OpenchannelQueue'][_0x1760('0x4e')]({'where':{'id':_0x855439[_0x1760('0x4d')]['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x1761d9,null))[_0x1760('0x28')](saveUpdates(_0x855439[_0x1760('0x50')],null))[_0x1760('0x28')](respondWithResult(_0x1761d9,null))[_0x1760('0x4b')](handleError(_0x1761d9,null));};exports[_0x1760('0x2a')]=function(_0x20850d,_0x1ec6d0){return db[_0x1760('0x31')][_0x1760('0x4e')]({'where':{'id':_0x20850d[_0x1760('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ec6d0,null))[_0x1760('0x28')](removeEntity(_0x1ec6d0,null))['catch'](handleError(_0x1ec6d0,null));};exports['describe']=function(_0x2da396,_0x31014d){return db['OpenchannelQueue']['describe']()[_0x1760('0x28')](respondWithResult(_0x31014d,null))[_0x1760('0x4b')](handleError(_0x31014d,null));};exports[_0x1760('0x58')]=function(_0x3c496f,_0x435a47,_0x2d056f){var _0x55c693={'raw':!![],'where':{}},_0x42e96c={},_0x1521d8;return db[_0x1760('0x31')]['findOne']({'where':{'id':_0x3c496f['params']['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x435a47,null))['then'](function(_0x1d8912){if(_0x1d8912){_0x1521d8=_0x1d8912[_0x1760('0x51')]({'plain':!![]});_0x42e96c[_0x1760('0x36')]=_[_0x1760('0x38')](db[_0x1760('0x59')]['rawAttributes']);_0x42e96c[_0x1760('0x37')]=_[_0x1760('0x38')](_0x3c496f['query']);_0x42e96c['filters']=_['intersection'](_0x42e96c['model'],_0x42e96c[_0x1760('0x37')]);_0x55c693[_0x1760('0x3b')]=_[_0x1760('0x3a')](_0x42e96c[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x3c496f['query']['fields']));_0x55c693[_0x1760('0x3b')]=_0x55c693[_0x1760('0x3b')][_0x1760('0x3d')]?_0x55c693[_0x1760('0x3b')]:_0x42e96c['model'];if(!_0x3c496f['query'][_0x1760('0x3e')](_0x1760('0x3f'))){_0x55c693['limit']=qs[_0x1760('0x21')](_0x3c496f[_0x1760('0x37')][_0x1760('0x21')]);_0x55c693[_0x1760('0x1f')]=qs[_0x1760('0x1f')](_0x3c496f[_0x1760('0x37')][_0x1760('0x1f')]);}_0x55c693[_0x1760('0x40')]=qs['sort'](_0x3c496f[_0x1760('0x37')]['sort']);_0x55c693[_0x1760('0x42')]=qs[_0x1760('0x39')](_[_0x1760('0x43')](_0x3c496f['query'],_0x42e96c['filters']));_0x55c693[_0x1760('0x42')][_0x1760('0x5a')]=_0x1d8912['id'];if(_0x3c496f['query'][_0x1760('0x44')]){_0x55c693['where']=_[_0x1760('0x45')](_0x55c693[_0x1760('0x42')],{'$or':_[_0x1760('0x30')](_0x55c693[_0x1760('0x3b')],function(_0x135737){var _0x1dd7c1={};_0x1dd7c1[_0x135737]={'$like':'%'+_0x3c496f['query'][_0x1760('0x44')]+'%'};return _0x1dd7c1;})});}_0x55c693=_['merge']({},_0x55c693,_0x3c496f[_0x1760('0x46')]);return db[_0x1760('0x59')][_0x1760('0x49')](_0x55c693);}})['then'](function(_0x5b93d8){if(_0x5b93d8){return db[_0x1760('0x5b')]['findAndCountAll']({'where':{'id':_[_0x1760('0x30')](_0x5b93d8,'UserId'),'role':_0x1760('0x5c')},'attributes':['id',_0x1760('0x2d'),_0x1760('0x5d'),'updatedAt',_0x1760('0x5e')]});}})[_0x1760('0x28')](function(_0x472b55){if(_0x472b55){return{'count':_0x472b55[_0x1760('0x22')],'rows':_[_0x1760('0x30')](_0x472b55[_0x1760('0x4a')],function(_0xf2351e){return{'membername':_0xf2351e[_0x1760('0x2d')],'UserId':_0xf2351e['id'],'queue_name':_0x1521d8[_0x1760('0x2d')],'OpenchannelQueueId':_0x1521d8['id'],'interface':util[_0x1760('0x5f')](_0x1760('0x60'),_0x1760('0x61'),_0xf2351e[_0x1760('0x2d')]),'penalty':0x0,'paused':_0xf2351e['openchannelPause'],'createdAt':_0xf2351e[_0x1760('0x5e')],'updatedAt':_0xf2351e[_0x1760('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1760('0x28')](respondWithFilteredResult(_0x435a47,_0x55c693))[_0x1760('0x4b')](handleError(_0x435a47,null));};exports[_0x1760('0x63')]=function(_0x3397e1,_0x369c72,_0x5c1372){var _0x72fc3c={};var _0xf79b2a={};var _0x5d7d19;var _0xbecf3e;return db['OpenchannelQueue'][_0x1760('0x64')]({'where':{'id':_0x3397e1[_0x1760('0x4d')]['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x369c72,null))[_0x1760('0x28')](function(_0xb529f4){if(_0xb529f4){_0x5d7d19=_0xb529f4;_0xf79b2a[_0x1760('0x36')]=_[_0x1760('0x38')](db[_0x1760('0x65')][_0x1760('0x32')]);_0xf79b2a[_0x1760('0x37')]=_[_0x1760('0x38')](_0x3397e1['query']);_0xf79b2a[_0x1760('0x39')]=_[_0x1760('0x3a')](_0xf79b2a[_0x1760('0x36')],_0xf79b2a[_0x1760('0x37')]);_0x72fc3c['attributes']=_[_0x1760('0x3a')](_0xf79b2a[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x3397e1[_0x1760('0x37')][_0x1760('0x3c')]));_0x72fc3c[_0x1760('0x3b')]=_0x72fc3c['attributes'][_0x1760('0x3d')]?_0x72fc3c[_0x1760('0x3b')]:_0xf79b2a[_0x1760('0x36')];_0x72fc3c['order']=qs[_0x1760('0x41')](_0x3397e1[_0x1760('0x37')][_0x1760('0x41')]);_0x72fc3c[_0x1760('0x42')]=qs[_0x1760('0x39')](_[_0x1760('0x43')](_0x3397e1[_0x1760('0x37')],_0xf79b2a[_0x1760('0x39')]));if(_0x3397e1[_0x1760('0x37')][_0x1760('0x44')]){_0x72fc3c[_0x1760('0x42')]=_[_0x1760('0x45')](_0x72fc3c['where'],{'$or':_[_0x1760('0x30')](_0x72fc3c[_0x1760('0x3b')],function(_0x1fe5ee){var _0x4e7c9c={};_0x4e7c9c[_0x1fe5ee]={'$like':'%'+_0x3397e1['query'][_0x1760('0x44')]+'%'};return _0x4e7c9c;})});}_0x72fc3c=_[_0x1760('0x45')]({},_0x72fc3c,_0x3397e1['options']);return _0x5d7d19['getTeams'](_0x72fc3c);}})[_0x1760('0x28')](function(_0x4f5f3b){if(_0x4f5f3b){_0xbecf3e=_0x4f5f3b[_0x1760('0x3d')];if(!_0x3397e1[_0x1760('0x37')][_0x1760('0x3e')](_0x1760('0x3f'))){_0x72fc3c[_0x1760('0x21')]=qs['limit'](_0x3397e1[_0x1760('0x37')][_0x1760('0x21')]);_0x72fc3c[_0x1760('0x1f')]=qs[_0x1760('0x1f')](_0x3397e1[_0x1760('0x37')][_0x1760('0x1f')]);}return _0x5d7d19['getTeams'](_0x72fc3c);}})[_0x1760('0x28')](function(_0x57fb05){if(_0x57fb05){return _0x57fb05?{'count':_0xbecf3e,'rows':_0x57fb05}:null;}})[_0x1760('0x28')](respondWithResult(_0x369c72,null))[_0x1760('0x4b')](handleError(_0x369c72,null));};exports[_0x1760('0x66')]=function(_0xac3b55,_0x3ecf6f,_0x2a408e){var _0x55f0d3=_0xac3b55[_0x1760('0x50')][_0x1760('0x67')];return db['Team'][_0x1760('0x49')]({'where':{'id':_0x55f0d3},'attributes':['id'],'include':[{'model':db[_0x1760('0x5b')],'as':_0x1760('0x68'),'attributes':['id',_0x1760('0x2d'),_0x1760('0x69'),_0x1760('0x6a'),'interface'],'raw':!![]}]})[_0x1760('0x28')](function(_0x30e9e7){if(_0x30e9e7){var _0xb9269e=_['flatMap'](_0x30e9e7,function(_0x3c340b){var _0x3f9d83=_0x3c340b['get']({'plain':!![]});return _0x3f9d83['Agents'];});return db[_0x1760('0x31')][_0x1760('0x4e')]({'where':{'id':_0xac3b55['params']['id']}})[_0x1760('0x28')](function(_0x1b1491){return db['sequelize'][_0x1760('0x6b')](function(_0x58f68f){return _0x1b1491['addTeams'](_0x55f0d3,{'transaction':_0x58f68f})[_0x1760('0x28')](function(){return BPromise['each'](_0xb9269e,function(_0x4c261e){return db[_0x1760('0x59')][_0x1760('0x6c')]({'where':{'UserId':_0x4c261e['id'],'OpenchannelQueueId':_0xac3b55[_0x1760('0x4d')]['id']},'transaction':_0x58f68f});});})[_0x1760('0x28')](function(){_0xb9269e[_0x1760('0x6d')](function(_0x438fb4){socket[_0x1760('0x6e')](_0x1760('0x6f'),{'UserId':_0x438fb4['id'],'OpenchannelQueueId':_0x1b1491['id']});});});});});}})[_0x1760('0x28')](respondWithStatusCode(_0x3ecf6f,null))[_0x1760('0x4b')](handleError(_0x3ecf6f,null));};exports[_0x1760('0x70')]=function(_0x3d90e8,_0x3e0700,_0x37b2da){return db[_0x1760('0x65')][_0x1760('0x49')]({'where':{'id':_0x3d90e8[_0x1760('0x37')][_0x1760('0x67')]},'attributes':['id'],'include':[{'model':db[_0x1760('0x5b')],'as':_0x1760('0x68'),'attributes':['id'],'raw':!![]}]})[_0x1760('0x28')](handleEntityNotFound(_0x3e0700,null))[_0x1760('0x28')](function(_0x5ac44a){var _0x5158a6=_[_0x1760('0x30')](_0x5ac44a,'id');var _0xf8b319=[];var _0x2525fe=[];var _0x3c8c59=squel['select']();_0x3c8c59[_0x1760('0x71')](_0x1760('0x72'))[_0x1760('0x73')](_0x1760('0x74'),'tq')[_0x1760('0x75')](_0x1760('0x76'),'ut',_0x1760('0x77'))[_0x1760('0x42')](_0x1760('0x78'),_0x3d90e8[_0x1760('0x4d')]['id']);for(var _0x5a9f95=0x0;_0x5a9f95<_0x5ac44a[_0x1760('0x3d')];_0x5a9f95+=0x1){let _0x41eeba=_0x5ac44a[_0x5a9f95];for(var _0x3ed403=0x0;_0x3ed403<_0x41eeba[_0x1760('0x68')]['length'];_0x3ed403+=0x1){let _0x4f904a=_0x41eeba[_0x1760('0x68')][_0x3ed403];var _0x1fc293=_0x3c8c59[_0x1760('0x79')]();_0x1fc293[_0x1760('0x42')](_0x1760('0x7a'),_0x4f904a['id']);_0x2525fe[_0x1760('0x7b')](db['sequelize']['query'](_0x1fc293[_0x1760('0x7c')](),{'type':db[_0x1760('0x7d')][_0x1760('0x7e')][_0x1760('0x7f')]})[_0x1760('0x28')](function(_0x53bbf3){if(_0x53bbf3[_0x1760('0x3d')]===0x1){return _0x4f904a['id'];}else{var _0x16b0c5=_['every'](_[_0x1760('0x30')](_0x53bbf3,_0x1760('0x80')),function(_0x2392d1){return _[_0x1760('0x81')](_0x5158a6,_0x2392d1);});if(_0x16b0c5){return _0x4f904a['id'];}}}));}}return BPromise[_0x1760('0x82')](_0x2525fe)[_0x1760('0x28')](function(_0x863d2a){_0xf8b319=_(_0xf8b319)[_0x1760('0x83')](_0x863d2a)[_0x1760('0x84')]()[_0x1760('0x85')]();return db['OpenchannelQueue'][_0x1760('0x4e')]({'where':{'id':_0x3d90e8[_0x1760('0x4d')]['id']}})['then'](function(_0x5446e5){return db[_0x1760('0x7d')]['transaction'](function(_0x19b9d2){return _0x5446e5[_0x1760('0x70')](_0x3d90e8[_0x1760('0x37')][_0x1760('0x67')],{'transaction':_0x19b9d2})[_0x1760('0x28')](function(){if(!_[_0x1760('0x86')](_0xf8b319)){return _0x5446e5[_0x1760('0x87')](_0xf8b319,{'transaction':_0x19b9d2});}})[_0x1760('0x28')](function(){_0xf8b319['forEach'](function(_0xf3564f){socket[_0x1760('0x6e')]('userOpenchannelQueue:remove',{'UserId':_0xf3564f,'OpenchannelQueueId':_0x5446e5['id']});});});});});});})[_0x1760('0x28')](respondWithStatusCode(_0x3e0700,null))[_0x1760('0x4b')](handleError(_0x3e0700,null));};exports[_0x1760('0x88')]=function(_0x2503c1,_0x50425b,_0x430fe6){return db[_0x1760('0x31')]['find']({'where':{'id':_0x2503c1['params']['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x50425b,null))[_0x1760('0x28')](function(_0x15c447){if(_0x15c447){return _0x15c447[_0x1760('0x88')](_0x2503c1[_0x1760('0x50')][_0x1760('0x67')],_[_0x1760('0x89')](_0x2503c1[_0x1760('0x50')],[_0x1760('0x67'),'id'])||{})[_0x1760('0x8a')](function(_0x222d1f){for(var _0x5ae76c=0x0;_0x5ae76c<_0x2503c1[_0x1760('0x50')][_0x1760('0x67')][_0x1760('0x3d')];_0x5ae76c+=0x1){socket[_0x1760('0x6e')]('userOpenchannelQueue:save',{'UserId':Number(_0x2503c1['body'][_0x1760('0x67')][_0x5ae76c]),'OpenchannelQueueId':Number(_0x2503c1[_0x1760('0x4d')]['id'])});}return _0x222d1f;});}})[_0x1760('0x28')](respondWithResult(_0x50425b,null))[_0x1760('0x4b')](handleError(_0x50425b,null));};exports[_0x1760('0x87')]=function(_0x4e44a0,_0x339d02,_0x3928ed){return db[_0x1760('0x31')][_0x1760('0x4e')]({'where':{'id':_0x4e44a0[_0x1760('0x4d')]['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x339d02,null))['then'](function(_0x112796){if(_0x112796){return _0x112796[_0x1760('0x87')](_0x4e44a0[_0x1760('0x37')][_0x1760('0x67')])[_0x1760('0x28')](function(){if(_[_0x1760('0x8b')](_0x4e44a0['query'][_0x1760('0x67')])){for(var _0x225145=0x0;_0x225145<_0x4e44a0['query']['ids'][_0x1760('0x3d')];_0x225145+=0x1){socket[_0x1760('0x6e')](_0x1760('0x8c'),{'UserId':Number(_0x4e44a0[_0x1760('0x37')][_0x1760('0x67')][_0x225145]),'OpenchannelQueueId':Number(_0x4e44a0[_0x1760('0x4d')]['id'])});}}else{socket[_0x1760('0x6e')]('userOpenchannelQueue:remove',{'UserId':Number(_0x4e44a0[_0x1760('0x37')][_0x1760('0x67')]),'OpenchannelQueueId':Number(_0x4e44a0[_0x1760('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x339d02,null))[_0x1760('0x4b')](handleError(_0x339d02,null));};exports[_0x1760('0x8d')]=function(_0x258eeb,_0x1aa5b8,_0x5be44c){var _0x1783bf={};var _0x234ab5={};var _0x228c8c;var _0x358e68;return db[_0x1760('0x31')][_0x1760('0x64')]({'where':{'id':_0x258eeb['params']['id']}})[_0x1760('0x28')](handleEntityNotFound(_0x1aa5b8,null))[_0x1760('0x28')](function(_0x113e0a){if(_0x113e0a){_0x228c8c=_0x113e0a;_0x234ab5[_0x1760('0x36')]=_[_0x1760('0x38')](db[_0x1760('0x5b')][_0x1760('0x32')]);_0x234ab5['query']=_['keys'](_0x258eeb['query']);_0x234ab5[_0x1760('0x39')]=_[_0x1760('0x3a')](_0x234ab5[_0x1760('0x36')],_0x234ab5[_0x1760('0x37')]);_0x1783bf['attributes']=_[_0x1760('0x3a')](_0x234ab5[_0x1760('0x36')],qs[_0x1760('0x3c')](_0x258eeb[_0x1760('0x37')][_0x1760('0x3c')]));_0x1783bf[_0x1760('0x3b')]=_0x1783bf[_0x1760('0x3b')]['length']?_0x1783bf['attributes']:_0x234ab5[_0x1760('0x36')];_0x1783bf['order']=qs['sort'](_0x258eeb['query'][_0x1760('0x41')]);_0x1783bf[_0x1760('0x42')]=qs[_0x1760('0x39')](_['pick'](_0x258eeb[_0x1760('0x37')],_0x234ab5[_0x1760('0x39')]));if(_0x258eeb[_0x1760('0x37')][_0x1760('0x44')]){_0x1783bf[_0x1760('0x42')]=_[_0x1760('0x45')](_0x1783bf[_0x1760('0x42')],{'$or':_['map'](_0x1783bf[_0x1760('0x3b')],function(_0x2c835a){var _0x221c5e={};_0x221c5e[_0x2c835a]={'$like':'%'+_0x258eeb[_0x1760('0x37')]['filter']+'%'};return _0x221c5e;})});}_0x1783bf=_[_0x1760('0x45')]({},_0x1783bf,_0x258eeb['options']);return _0x228c8c[_0x1760('0x8d')](_0x1783bf);}})['then'](function(_0x2a9c2e){if(_0x2a9c2e){_0x358e68=_0x2a9c2e[_0x1760('0x3d')];if(!_0x258eeb['query']['hasOwnProperty'](_0x1760('0x3f'))){_0x1783bf[_0x1760('0x21')]=qs[_0x1760('0x21')](_0x258eeb[_0x1760('0x37')][_0x1760('0x21')]);_0x1783bf[_0x1760('0x1f')]=qs['offset'](_0x258eeb[_0x1760('0x37')][_0x1760('0x1f')]);}return _0x228c8c[_0x1760('0x8d')](_0x1783bf);}})[_0x1760('0x28')](function(_0xad68){if(_0xad68){return _0xad68?{'count':_0x358e68,'rows':_0xad68}:null;}})[_0x1760('0x28')](respondWithResult(_0x1aa5b8,null))['catch'](handleError(_0x1aa5b8,null));};
\ No newline at end of file
index 8893090..8b75b94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70bc=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x19d91f,_0xd81865){var _0xfc0bf2=function(_0x3c6e13){while(--_0x3c6e13){_0x19d91f['push'](_0x19d91f['shift']());}};_0xfc0bf2(++_0xd81865);}(_0x70bc,0x72));var _0xc70b=function(_0x444cd7,_0x34abe7){_0x444cd7=_0x444cd7-0x0;var _0x2fe0f6=_0x70bc[_0x444cd7];return _0x2fe0f6;};'use strict';var EventEmitter=require(_0xc70b('0x0'));var OpenchannelQueue=require(_0xc70b('0x1'))['db'][_0xc70b('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc70b('0x3')](0x0);var events={'afterCreate':_0xc70b('0x4'),'afterUpdate':_0xc70b('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ecf6f){return function(_0x4b62cc,_0x5e356f,_0x33752a){OpenchannelQueueEvents['emit'](_0x4ecf6f+':'+_0x4b62cc['id'],_0x4b62cc);OpenchannelQueueEvents[_0xc70b('0x6')](_0x4ecf6f,_0x4b62cc);_0x33752a(null);};}for(var e in events){if(events[_0xc70b('0x7')](e)){var event=events[e];OpenchannelQueue[_0xc70b('0x8')](e,emitEvent(event));}}module[_0xc70b('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x8a6e=['OpenchannelQueue','setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c07fb,_0x504b8e){var _0x541fe6=function(_0x5f318f){while(--_0x5f318f){_0x5c07fb['push'](_0x5c07fb['shift']());}};_0x541fe6(++_0x504b8e);}(_0x8a6e,0xfa));var _0xe8a6=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8a6e[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0xe8a6('0x0'));var OpenchannelQueue=require(_0xe8a6('0x1'))['db'][_0xe8a6('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xe8a6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe8a6('0x4'),'afterDestroy':_0xe8a6('0x5')};function emitEvent(_0x1f0046){return function(_0x44076e,_0x241ad5,_0x195ebe){OpenchannelQueueEvents[_0xe8a6('0x6')](_0x1f0046+':'+_0x44076e['id'],_0x44076e);OpenchannelQueueEvents['emit'](_0x1f0046,_0x44076e);_0x195ebe(null);};}for(var e in events){if(events[_0xe8a6('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xe8a6('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
index 9ec8a82..4e8e8a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ac=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash'];(function(_0x22f6a4,_0x233227){var _0x1c7d20=function(_0x37ec49){while(--_0x37ec49){_0x22f6a4['push'](_0x22f6a4['shift']());}};_0x1c7d20(++_0x233227);}(_0xd2ac,0x1ac));var _0xcd2a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd2ac[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xcd2a('0x0'));var util=require(_0xcd2a('0x1'));var logger=require(_0xcd2a('0x2'))(_0xcd2a('0x3'));var moment=require(_0xcd2a('0x4'));var BPromise=require(_0xcd2a('0x5'));var rp=require(_0xcd2a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd2a('0x7'));var config=require(_0xcd2a('0x8'));var attributes=require(_0xcd2a('0x9'));module['exports']=function(_0x27bf63,_0x78bcbe){return _0x27bf63[_0xcd2a('0xa')](_0xcd2a('0xb'),attributes,{'tableName':_0xcd2a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7772=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x54e430,_0x2d71b9){var _0x12319c=function(_0x26a2f0){while(--_0x26a2f0){_0x54e430['push'](_0x54e430['shift']());}};_0x12319c(++_0x2d71b9);}(_0x7772,0x139));var _0x2777=function(_0x463b4a,_0x41f9fb){_0x463b4a=_0x463b4a-0x0;var _0xd87e6b=_0x7772[_0x463b4a];return _0xd87e6b;};'use strict';var _=require(_0x2777('0x0'));var util=require('util');var logger=require(_0x2777('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2777('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2777('0x3'));var rimraf=require(_0x2777('0x4'));var config=require(_0x2777('0x5'));var attributes=require(_0x2777('0x6'));module[_0x2777('0x7')]=function(_0x348154,_0x343214){return _0x348154[_0x2777('0x8')](_0x2777('0x9'),attributes,{'tableName':_0x2777('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 39b0abe..8a67ceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcba1=['stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','model','map','then','where','ShowOpenchannelQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x212311,_0xa91e89){var _0x3d67a4=function(_0x22536c){while(--_0x22536c){_0x212311['push'](_0x212311['shift']());}};_0x3d67a4(++_0xa91e89);}(_0xcba1,0x1c1));var _0x1cba=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0xcba1[_0x404957];return _0x4e0365;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cba('0x0'));var BPromise=require(_0x1cba('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cba('0x2'));var db=require(_0x1cba('0x3'))['db'];var utils=require(_0x1cba('0x4'));var logger=require(_0x1cba('0x5'))(_0x1cba('0x6'));var config=require(_0x1cba('0x7'));var jayson=require(_0x1cba('0x8'));var client=jayson[_0x1cba('0x9')]['http']({'port':0x232a});config[_0x1cba('0xa')]=_[_0x1cba('0xb')](config['redis'],{'host':_0x1cba('0xc'),'port':0x18eb});var socket=require(_0x1cba('0xd'))(new Redis(config[_0x1cba('0xa')]));require('./openchannelQueue.socket')[_0x1cba('0xe')](socket);function respondWithRpcPromise(_0x4f21b3,_0x395407,_0x12a751){return new BPromise(function(_0x524936,_0x4f7696){return client[_0x1cba('0xf')](_0x4f21b3,_0x12a751)['then'](function(_0x437b69){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x395407,_0x1cba('0x10'));logger[_0x1cba('0x11')](_0x1cba('0x12'),_0x395407,_0x1cba('0x10'),JSON[_0x1cba('0x13')](_0x437b69));if(_0x437b69[_0x1cba('0x14')]){if(_0x437b69[_0x1cba('0x14')][_0x1cba('0x15')]===0x1f4){logger[_0x1cba('0x14')](_0x1cba('0x16'),_0x395407,_0x437b69[_0x1cba('0x14')]['message']);return _0x4f7696(_0x437b69[_0x1cba('0x14')][_0x1cba('0x17')]);}logger[_0x1cba('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x395407,_0x437b69[_0x1cba('0x14')][_0x1cba('0x17')]);return _0x524936(_0x437b69[_0x1cba('0x14')][_0x1cba('0x17')]);}else{logger[_0x1cba('0x18')](_0x1cba('0x16'),_0x395407,_0x1cba('0x10'));_0x524936(_0x437b69[_0x1cba('0x19')][_0x1cba('0x17')]);}})[_0x1cba('0x1a')](function(_0x3201ec){logger[_0x1cba('0x14')](_0x1cba('0x16'),_0x395407,_0x3201ec);_0x4f7696(_0x3201ec);});});}exports[_0x1cba('0x1b')]=function(_0x1c8250){var _0x15a4af=this;return new Promise(function(_0x24c5fa,_0x5beee9){return db[_0x1cba('0x1c')][_0x1cba('0x1d')]({'raw':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250['options'][_0x1cba('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250['options']['where']||null:null,'attributes':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250[_0x1cba('0x1e')][_0x1cba('0x20')]||null:null,'limit':_0x1c8250['options']?_0x1c8250[_0x1cba('0x1e')]['limit']||null:null,'include':_0x1c8250[_0x1cba('0x1e')]?_0x1c8250[_0x1cba('0x1e')][_0x1cba('0x21')]?_['map'](_0x1c8250[_0x1cba('0x1e')][_0x1cba('0x21')],function(_0x36f544){return{'model':db[_0x36f544[_0x1cba('0x22')]],'as':_0x36f544['as'],'attributes':_0x36f544[_0x1cba('0x20')],'include':_0x36f544[_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x36f544[_0x1cba('0x21')],function(_0x17f19e){return{'model':db[_0x17f19e['model']],'as':_0x17f19e['as'],'attributes':_0x17f19e['attributes'],'include':_0x17f19e[_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x17f19e[_0x1cba('0x21')],function(_0xb2563b){return{'model':db[_0xb2563b[_0x1cba('0x22')]],'as':_0xb2563b['as'],'attributes':_0xb2563b[_0x1cba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1cba('0x24')](function(_0x543336){logger['info']('GetOpenchannelQueue',_0x1c8250);logger['debug'](_0x1cba('0x1b'),_0x1c8250,JSON['stringify'](_0x543336));_0x24c5fa(_0x543336);})[_0x1cba('0x1a')](function(_0x4494b6){logger[_0x1cba('0x14')](_0x1cba('0x1b'),_0x4494b6['message'],_0x1c8250);_0x5beee9(_0x15a4af[_0x1cba('0x14')](0x1f4,_0x4494b6[_0x1cba('0x17')]));});});};exports['ShowOpenchannelQueue']=function(_0x40c8a0){var _0x1e123e=this;return new Promise(function(_0x54b1fb,_0x5e660c){return db[_0x1cba('0x1c')]['find']({'raw':_0x40c8a0[_0x1cba('0x1e')]?_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x1f')]===undefined?!![]:![]:!![],'where':_0x40c8a0[_0x1cba('0x1e')]?_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x25')]||null:null,'attributes':_0x40c8a0[_0x1cba('0x1e')]?_0x40c8a0[_0x1cba('0x1e')]['attributes']||null:null,'include':_0x40c8a0['options']?_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x40c8a0[_0x1cba('0x1e')][_0x1cba('0x21')],function(_0x15dd62){return{'model':db[_0x15dd62[_0x1cba('0x22')]],'as':_0x15dd62['as'],'attributes':_0x15dd62[_0x1cba('0x20')],'include':_0x15dd62[_0x1cba('0x21')]?_['map'](_0x15dd62[_0x1cba('0x21')],function(_0x485887){return{'model':db[_0x485887[_0x1cba('0x22')]],'as':_0x485887['as'],'attributes':_0x485887[_0x1cba('0x20')],'include':_0x485887[_0x1cba('0x21')]?_[_0x1cba('0x23')](_0x485887['include'],function(_0x285295){return{'model':db[_0x285295['model']],'as':_0x285295['as'],'attributes':_0x285295[_0x1cba('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1cba('0x24')](function(_0x395c61){logger['info'](_0x1cba('0x26'),_0x40c8a0);logger[_0x1cba('0x11')]('ShowOpenchannelQueue',_0x40c8a0,JSON[_0x1cba('0x13')](_0x395c61));_0x54b1fb(_0x395c61);})['catch'](function(_0xac81de){logger[_0x1cba('0x14')](_0x1cba('0x26'),_0xac81de['message'],_0x40c8a0);_0x5e660c(_0x1e123e['error'](0x1f4,_0xac81de['message']));});});};
\ No newline at end of file
+var _0x8be6=['raw','where','attributes','map','include','model','then','find','ShowOpenchannelQueue','lodash','util','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./openchannelQueue.socket','register','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetOpenchannelQueue','OpenchannelQueue','options'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8be6,0x6c));var _0x68be=function(_0xf7b006,_0x18c938){_0xf7b006=_0xf7b006-0x0;var _0x3ac6e5=_0x8be6[_0xf7b006];return _0x3ac6e5;};'use strict';var _=require(_0x68be('0x0'));var util=require(_0x68be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x68be('0x2'));var logger=require(_0x68be('0x3'))(_0x68be('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x68be('0x5')]['http']({'port':0x232a});config[_0x68be('0x6')]=_[_0x68be('0x7')](config[_0x68be('0x6')],{'host':_0x68be('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x68be('0x6')]));require(_0x68be('0x9'))[_0x68be('0xa')](socket);function respondWithRpcPromise(_0x1f99d9,_0x5bba3a,_0x5a6b72){return new BPromise(function(_0x1a2867,_0x48e281){return client['request'](_0x1f99d9,_0x5a6b72)['then'](function(_0x3f0540){logger[_0x68be('0xb')](_0x68be('0xc'),_0x5bba3a,_0x68be('0xd'));logger[_0x68be('0xe')](_0x68be('0xf'),_0x5bba3a,_0x68be('0xd'),JSON[_0x68be('0x10')](_0x3f0540));if(_0x3f0540[_0x68be('0x11')]){if(_0x3f0540[_0x68be('0x11')][_0x68be('0x12')]===0x1f4){logger[_0x68be('0x11')](_0x68be('0xc'),_0x5bba3a,_0x3f0540[_0x68be('0x11')][_0x68be('0x13')]);return _0x48e281(_0x3f0540['error'][_0x68be('0x13')]);}logger[_0x68be('0x11')](_0x68be('0xc'),_0x5bba3a,_0x3f0540[_0x68be('0x11')][_0x68be('0x13')]);return _0x1a2867(_0x3f0540[_0x68be('0x11')][_0x68be('0x13')]);}else{logger[_0x68be('0xb')](_0x68be('0xc'),_0x5bba3a,_0x68be('0xd'));_0x1a2867(_0x3f0540['result'][_0x68be('0x13')]);}})[_0x68be('0x14')](function(_0x2179aa){logger['error'](_0x68be('0xc'),_0x5bba3a,_0x2179aa);_0x48e281(_0x2179aa);});});}exports[_0x68be('0x15')]=function(_0xc56370){var _0x2014de=this;return new Promise(function(_0x6c927b,_0x43bb69){return db[_0x68be('0x16')]['findAll']({'raw':_0xc56370[_0x68be('0x17')]?_0xc56370['options'][_0x68be('0x18')]===undefined?!![]:![]:!![],'where':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')][_0x68be('0x19')]||null:null,'attributes':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')][_0x68be('0x1a')]||null:null,'limit':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')]['limit']||null:null,'include':_0xc56370[_0x68be('0x17')]?_0xc56370[_0x68be('0x17')]['include']?_[_0x68be('0x1b')](_0xc56370[_0x68be('0x17')][_0x68be('0x1c')],function(_0x37fa7e){return{'model':db[_0x37fa7e[_0x68be('0x1d')]],'as':_0x37fa7e['as'],'attributes':_0x37fa7e[_0x68be('0x1a')],'include':_0x37fa7e['include']?_['map'](_0x37fa7e['include'],function(_0x460042){return{'model':db[_0x460042[_0x68be('0x1d')]],'as':_0x460042['as'],'attributes':_0x460042[_0x68be('0x1a')],'include':_0x460042['include']?_[_0x68be('0x1b')](_0x460042[_0x68be('0x1c')],function(_0x426b08){return{'model':db[_0x426b08['model']],'as':_0x426b08['as'],'attributes':_0x426b08[_0x68be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68be('0x1e')](function(_0x338fb0){logger[_0x68be('0xb')]('GetOpenchannelQueue',_0xc56370);logger[_0x68be('0xe')]('GetOpenchannelQueue',_0xc56370,JSON['stringify'](_0x338fb0));_0x6c927b(_0x338fb0);})[_0x68be('0x14')](function(_0x2267ab){logger[_0x68be('0x11')](_0x68be('0x15'),_0x2267ab[_0x68be('0x13')],_0xc56370);_0x43bb69(_0x2014de[_0x68be('0x11')](0x1f4,_0x2267ab[_0x68be('0x13')]));});});};exports['ShowOpenchannelQueue']=function(_0x58039d){var _0xbdb4bd=this;return new Promise(function(_0x433dbb,_0x215938){return db[_0x68be('0x16')][_0x68be('0x1f')]({'raw':_0x58039d[_0x68be('0x17')]?_0x58039d['options'][_0x68be('0x18')]===undefined?!![]:![]:!![],'where':_0x58039d[_0x68be('0x17')]?_0x58039d[_0x68be('0x17')]['where']||null:null,'attributes':_0x58039d[_0x68be('0x17')]?_0x58039d[_0x68be('0x17')][_0x68be('0x1a')]||null:null,'include':_0x58039d[_0x68be('0x17')]?_0x58039d[_0x68be('0x17')][_0x68be('0x1c')]?_['map'](_0x58039d[_0x68be('0x17')][_0x68be('0x1c')],function(_0x23aa58){return{'model':db[_0x23aa58[_0x68be('0x1d')]],'as':_0x23aa58['as'],'attributes':_0x23aa58[_0x68be('0x1a')],'include':_0x23aa58[_0x68be('0x1c')]?_[_0x68be('0x1b')](_0x23aa58[_0x68be('0x1c')],function(_0x580dd9){return{'model':db[_0x580dd9[_0x68be('0x1d')]],'as':_0x580dd9['as'],'attributes':_0x580dd9['attributes'],'include':_0x580dd9[_0x68be('0x1c')]?_[_0x68be('0x1b')](_0x580dd9['include'],function(_0x1b99c6){return{'model':db[_0x1b99c6[_0x68be('0x1d')]],'as':_0x1b99c6['as'],'attributes':_0x1b99c6[_0x68be('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68be('0x1e')](function(_0x56f30c){logger[_0x68be('0xb')](_0x68be('0x20'),_0x58039d);logger[_0x68be('0xe')](_0x68be('0x20'),_0x58039d,JSON[_0x68be('0x10')](_0x56f30c));_0x433dbb(_0x56f30c);})[_0x68be('0x14')](function(_0xeb921e){logger[_0x68be('0x11')](_0x68be('0x20'),_0xeb921e['message'],_0x58039d);_0x215938(_0xbdb4bd[_0x68be('0x11')](0x1f4,_0xeb921e[_0x68be('0x13')]));});});};
\ No newline at end of file
index 84b848b..d48659f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f2e=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x5894cf,_0x5b71db){var _0x5afcf3=function(_0x9a15ea){while(--_0x9a15ea){_0x5894cf['push'](_0x5894cf['shift']());}};_0x5afcf3(++_0x5b71db);}(_0x3f2e,0x143));var _0xe3f2=function(_0xf57e93,_0x459863){_0xf57e93=_0xf57e93-0x0;var _0x15228b=_0x3f2e[_0xf57e93];return _0x15228b;};'use strict';var OpenchannelQueueEvents=require(_0xe3f2('0x0'));var events=[_0xe3f2('0x1'),_0xe3f2('0x2'),_0xe3f2('0x3')];function createListener(_0x3f1d2e,_0x521a87){return function(_0x4bc024){_0x521a87[_0xe3f2('0x4')](_0x3f1d2e,_0x4bc024);};}function removeListener(_0x95f7bd,_0x11bf5a){return function(){OpenchannelQueueEvents[_0xe3f2('0x5')](_0x95f7bd,_0x11bf5a);};}exports[_0xe3f2('0x6')]=function(_0xc4f276){for(var _0x2df36f=0x0,_0x14cd90=events[_0xe3f2('0x7')];_0x2df36f<_0x14cd90;_0x2df36f++){var _0x2e2327=events[_0x2df36f];var _0x5dfd83=createListener(_0xe3f2('0x8')+_0x2e2327,_0xc4f276);OpenchannelQueueEvents['on'](_0x2e2327,_0x5dfd83);}};
\ No newline at end of file
+var _0x613a=['removeListener','register','length','openchannelQueue:','save','update','emit'];(function(_0x5d2a7d,_0x1ca06c){var _0x14e58b=function(_0x23be04){while(--_0x23be04){_0x5d2a7d['push'](_0x5d2a7d['shift']());}};_0x14e58b(++_0x1ca06c);}(_0x613a,0x89));var _0xa613=function(_0x2a8e05,_0x357e55){_0x2a8e05=_0x2a8e05-0x0;var _0x24f608=_0x613a[_0x2a8e05];return _0x24f608;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xa613('0x0'),'remove',_0xa613('0x1')];function createListener(_0x58e05d,_0x337a27){return function(_0x320e20){_0x337a27[_0xa613('0x2')](_0x58e05d,_0x320e20);};}function removeListener(_0x23d067,_0x222f1c){return function(){OpenchannelQueueEvents[_0xa613('0x3')](_0x23d067,_0x222f1c);};}exports[_0xa613('0x4')]=function(_0x4b31db){for(var _0x3f9307=0x0,_0x101425=events[_0xa613('0x5')];_0x3f9307<_0x101425;_0x3f9307++){var _0x34e444=events[_0x3f9307];var _0x64dc05=createListener(_0xa613('0x6')+_0x34e444,_0x4b31db);OpenchannelQueueEvents['on'](_0x34e444,_0x64dc05);}};
\ No newline at end of file
index eb81725..6c075e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b10=['../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x1b10,0x18a));var _0x01b1=function(_0xd4b888,_0x1aea0a){_0xd4b888=_0xd4b888-0x0;var _0x3a77f4=_0x1b10[_0xd4b888];return _0x3a77f4;};'use strict';var multer=require(_0x01b1('0x0'));var util=require(_0x01b1('0x1'));var path=require('path');var timeout=require(_0x01b1('0x2'));var express=require(_0x01b1('0x3'));var router=express['Router']();var fs_extra=require(_0x01b1('0x4'));var auth=require(_0x01b1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x01b1('0x6'));var controller=require(_0x01b1('0x7'));router['get']('/',auth[_0x01b1('0x8')](),controller[_0x01b1('0x9')]);router[_0x01b1('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x01b1('0xb')]);router[_0x01b1('0xa')](_0x01b1('0xc'),auth['isAuthenticated'](),controller[_0x01b1('0xd')]);router[_0x01b1('0xe')]('/',auth[_0x01b1('0x8')](),controller['create']);router[_0x01b1('0xf')](_0x01b1('0xc'),auth[_0x01b1('0x8')](),controller['update']);router[_0x01b1('0x10')](_0x01b1('0xc'),auth['isAuthenticated'](),controller[_0x01b1('0x11')]);module[_0x01b1('0x12')]=router;
\ No newline at end of file
+var _0x9fc5=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','delete','destroy','exports'];(function(_0x208961,_0x4a51ba){var _0xb86f35=function(_0x2dd418){while(--_0x2dd418){_0x208961['push'](_0x208961['shift']());}};_0xb86f35(++_0x4a51ba);}(_0x9fc5,0x1e4));var _0x59fc=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0x9fc5[_0x9a3e0f];return _0x3d2a9a;};'use strict';var multer=require('multer');var util=require(_0x59fc('0x0'));var path=require(_0x59fc('0x1'));var timeout=require(_0x59fc('0x2'));var express=require(_0x59fc('0x3'));var router=express[_0x59fc('0x4')]();var fs_extra=require(_0x59fc('0x5'));var auth=require(_0x59fc('0x6'));var interaction=require(_0x59fc('0x7'));var config=require(_0x59fc('0x8'));var controller=require(_0x59fc('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x59fc('0xa')]);router[_0x59fc('0xb')](_0x59fc('0xc'),auth[_0x59fc('0xd')](),controller[_0x59fc('0xe')]);router[_0x59fc('0xb')](_0x59fc('0xf'),auth[_0x59fc('0xd')](),controller['show']);router[_0x59fc('0x10')]('/',auth[_0x59fc('0xd')](),controller[_0x59fc('0x11')]);router[_0x59fc('0x12')](_0x59fc('0xf'),auth[_0x59fc('0xd')](),controller['update']);router[_0x59fc('0x13')](_0x59fc('0xf'),auth[_0x59fc('0xd')](),controller[_0x59fc('0x14')]);module[_0x59fc('0x15')]=router;
\ No newline at end of file
index 66519a4..b5337eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60b0=['sequelize','exports','STRING','DATE','moment'];(function(_0x49058d,_0x3ef29d){var _0x46ff41=function(_0x38a00f){while(--_0x38a00f){_0x49058d['push'](_0x49058d['shift']());}};_0x46ff41(++_0x3ef29d);}(_0x60b0,0x77));var _0x060b=function(_0x5f0501,_0x19196e){_0x5f0501=_0x5f0501-0x0;var _0x3c2c45=_0x60b0[_0x5f0501];return _0x3c2c45;};'use strict';var moment=require(_0x060b('0x0'));var Sequelize=require(_0x060b('0x1'));module[_0x060b('0x2')]={'uniqueid':{'type':Sequelize[_0x060b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x060b('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x060b('0x4')]},'acceptAt':{'type':Sequelize[_0x060b('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x025f=['STRING','DATE','moment','sequelize','exports'];(function(_0x4a3939,_0xf73af6){var _0xc9785a=function(_0x17317d){while(--_0x17317d){_0x4a3939['push'](_0x4a3939['shift']());}};_0xc9785a(++_0xf73af6);}(_0x025f,0x160));var _0xf025=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x025f[_0x4565bf];return _0x5610ba;};'use strict';var moment=require(_0xf025('0x0'));var Sequelize=require(_0xf025('0x1'));module[_0xf025('0x2')]={'uniqueid':{'type':Sequelize[_0xf025('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf025('0x3')]},'joinAt':{'type':Sequelize[_0xf025('0x4')]},'leaveAt':{'type':Sequelize[_0xf025('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf025('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d34a70d..b2f6e52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaebd=['rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x188128,_0xc8a300){var _0x367d22=function(_0x504d1d){while(--_0x504d1d){_0x188128['push'](_0x188128['shift']());}};_0x367d22(++_0xc8a300);}(_0xaebd,0x17b));var _0xdaeb=function(_0x341466,_0x52f2b0){_0x341466=_0x341466-0x0;var _0x2248a0=_0xaebd[_0x341466];return _0x2248a0;};'use strict';var emlformat=require(_0xdaeb('0x0'));var rimraf=require(_0xdaeb('0x1'));var zipdir=require(_0xdaeb('0x2'));var jsonpatch=require(_0xdaeb('0x3'));var rp=require(_0xdaeb('0x4'));var moment=require(_0xdaeb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdaeb('0x6'));var util=require(_0xdaeb('0x7'));var path=require(_0xdaeb('0x8'));var sox=require('sox');var csv=require(_0xdaeb('0x9'));var ejs=require(_0xdaeb('0xa'));var fs=require('fs');var fs_extra=require(_0xdaeb('0xb'));var _=require(_0xdaeb('0xc'));var squel=require(_0xdaeb('0xd'));var crypto=require('crypto');var jsforce=require(_0xdaeb('0xe'));var deskjs=require(_0xdaeb('0xf'));var toCsv=require(_0xdaeb('0x9'));var querystring=require(_0xdaeb('0x10'));var Papa=require(_0xdaeb('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdaeb('0x12'));var hardwareService=require(_0xdaeb('0x13'));var logger=require(_0xdaeb('0x14'))(_0xdaeb('0x15'));var utils=require(_0xdaeb('0x16'));var config=require(_0xdaeb('0x17'));var licenseUtil=require(_0xdaeb('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x19e0ef,_0x8ef751){_0x8ef751=_0x8ef751||0xcc;return function(_0xc48937){if(_0xc48937){return _0x19e0ef[_0xdaeb('0x19')](_0x8ef751);}return _0x19e0ef[_0xdaeb('0x1a')](_0x8ef751)['end']();};}function respondWithResult(_0xa40f0f,_0x19a6a2){_0x19a6a2=_0x19a6a2||0xc8;return function(_0x56e015){if(_0x56e015){return _0xa40f0f[_0xdaeb('0x1a')](_0x19a6a2)[_0xdaeb('0x1b')](_0x56e015);}};}function respondWithFilteredResult(_0x5a7f04,_0x3f0575){return function(_0x1659b5){if(_0x1659b5){var _0x2285dc=typeof _0x3f0575[_0xdaeb('0x1c')]===_0xdaeb('0x1d')&&typeof _0x3f0575['limit']===_0xdaeb('0x1d');var _0x63036c=_0x1659b5['count'];var _0x114d60=_0x2285dc?0x0:_0x3f0575[_0xdaeb('0x1c')];var _0x4ba793=_0x2285dc?_0x1659b5[_0xdaeb('0x1e')]:_0x3f0575[_0xdaeb('0x1c')]+_0x3f0575[_0xdaeb('0x1f')];var _0x44ad78;if(_0x4ba793>=_0x63036c){_0x4ba793=_0x63036c;_0x44ad78=0xc8;}else{_0x44ad78=0xce;}_0x5a7f04[_0xdaeb('0x1a')](_0x44ad78);return _0x5a7f04[_0xdaeb('0x20')]('Content-Range',_0x114d60+'-'+_0x4ba793+'/'+_0x63036c)['json'](_0x1659b5);}return null;};}function patchUpdates(_0x4987fc){return function(_0x3ea449){try{jsonpatch['apply'](_0x3ea449,_0x4987fc,!![]);}catch(_0x4a564d){return BPromise[_0xdaeb('0x21')](_0x4a564d);}return _0x3ea449[_0xdaeb('0x22')]();};}function saveUpdates(_0x598dc1,_0x1163ca){return function(_0x1dd54b){if(_0x1dd54b){return _0x1dd54b[_0xdaeb('0x23')](_0x598dc1)[_0xdaeb('0x24')](function(_0x1fd72b){return _0x1fd72b;});}return null;};}function removeEntity(_0x931a7b,_0x2b16b4){return function(_0x2f7f62){if(_0x2f7f62){return _0x2f7f62[_0xdaeb('0x25')]()[_0xdaeb('0x24')](function(){_0x931a7b[_0xdaeb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27739b,_0xdd68e6){return function(_0xc45e40){if(!_0xc45e40){_0x27739b[_0xdaeb('0x19')](0x194);}return _0xc45e40;};}function handleError(_0x4993f3,_0x5882ff){_0x5882ff=_0x5882ff||0x1f4;return function(_0x5805cc){logger['error'](_0x5805cc[_0xdaeb('0x26')]);if(_0x5805cc['name']){delete _0x5805cc[_0xdaeb('0x27')];}_0x4993f3[_0xdaeb('0x1a')](_0x5882ff)[_0xdaeb('0x28')](_0x5805cc);};}exports[_0xdaeb('0x29')]=function(_0x4f4327,_0x31d07c){var _0x509df9={},_0x31b52e={},_0x17dbf0={'count':0x0,'rows':[]};var _0x1d40aa=_[_0xdaeb('0x2a')](db[_0xdaeb('0x2b')][_0xdaeb('0x2c')],function(_0x182ced){return{'name':_0x182ced[_0xdaeb('0x2d')],'type':_0x182ced[_0xdaeb('0x2e')][_0xdaeb('0x2f')]};});_0x31b52e[_0xdaeb('0x30')]=_[_0xdaeb('0x2a')](_0x1d40aa,_0xdaeb('0x27'));_0x31b52e[_0xdaeb('0x31')]=_[_0xdaeb('0x32')](_0x4f4327[_0xdaeb('0x31')]);_0x31b52e[_0xdaeb('0x33')]=_[_0xdaeb('0x34')](_0x31b52e[_0xdaeb('0x30')],_0x31b52e['query']);_0x509df9[_0xdaeb('0x35')]=_['intersection'](_0x31b52e[_0xdaeb('0x30')],qs['fields'](_0x4f4327['query']['fields']));_0x509df9[_0xdaeb('0x35')]=_0x509df9[_0xdaeb('0x35')][_0xdaeb('0x36')]?_0x509df9[_0xdaeb('0x35')]:_0x31b52e[_0xdaeb('0x30')];if(!_0x4f4327[_0xdaeb('0x31')]['hasOwnProperty'](_0xdaeb('0x37'))){_0x509df9[_0xdaeb('0x1f')]=qs[_0xdaeb('0x1f')](_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x1f')]);_0x509df9[_0xdaeb('0x1c')]=qs['offset'](_0x4f4327[_0xdaeb('0x31')]['offset']);}_0x509df9[_0xdaeb('0x38')]=qs[_0xdaeb('0x39')](_0x4f4327['query'][_0xdaeb('0x39')]);_0x509df9['where']=qs[_0xdaeb('0x33')](_['pick'](_0x4f4327[_0xdaeb('0x31')],_0x31b52e[_0xdaeb('0x33')]),_0x1d40aa);if(_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x3a')]){_0x509df9[_0xdaeb('0x3b')]=_[_0xdaeb('0x3c')](_0x509df9[_0xdaeb('0x3b')],{'$or':_['map'](_0x1d40aa,function(_0x1526f8){if(_0x1526f8[_0xdaeb('0x2e')]!==_0xdaeb('0x3d')){var _0x2b20d5={};_0x2b20d5[_0x1526f8['name']]={'$like':'%'+_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x3a')]+'%'};return _0x2b20d5;}})});}_0x509df9=_[_0xdaeb('0x3c')]({},_0x509df9,_0x4f4327[_0xdaeb('0x3e')]);var _0x311874={'where':_0x509df9[_0xdaeb('0x3b')]};return db[_0xdaeb('0x2b')][_0xdaeb('0x1e')](_0x311874)['then'](function(_0x3808d1){_0x17dbf0[_0xdaeb('0x1e')]=_0x3808d1;if(_0x4f4327[_0xdaeb('0x31')][_0xdaeb('0x3f')]){_0x509df9[_0xdaeb('0x40')]=[{'all':!![]}];}return db[_0xdaeb('0x2b')]['findAll'](_0x509df9);})[_0xdaeb('0x24')](function(_0xf570ba){_0x17dbf0[_0xdaeb('0x41')]=_0xf570ba;return _0x17dbf0;})[_0xdaeb('0x24')](respondWithFilteredResult(_0x31d07c,_0x509df9))[_0xdaeb('0x42')](handleError(_0x31d07c,null));};exports[_0xdaeb('0x43')]=function(_0x57196c,_0x26297f){var _0x3668f0={'raw':!![],'where':{'id':_0x57196c[_0xdaeb('0x44')]['id']}},_0x27ab6d={};_0x27ab6d['model']=_[_0xdaeb('0x32')](db[_0xdaeb('0x2b')]['rawAttributes']);_0x27ab6d[_0xdaeb('0x31')]=_[_0xdaeb('0x32')](_0x57196c['query']);_0x27ab6d[_0xdaeb('0x33')]=_[_0xdaeb('0x34')](_0x27ab6d['model'],_0x27ab6d[_0xdaeb('0x31')]);_0x3668f0[_0xdaeb('0x35')]=_[_0xdaeb('0x34')](_0x27ab6d[_0xdaeb('0x30')],qs['fields'](_0x57196c[_0xdaeb('0x31')][_0xdaeb('0x45')]));_0x3668f0[_0xdaeb('0x35')]=_0x3668f0[_0xdaeb('0x35')][_0xdaeb('0x36')]?_0x3668f0[_0xdaeb('0x35')]:_0x27ab6d['model'];if(_0x57196c['query'][_0xdaeb('0x3f')]){_0x3668f0['include']=[{'all':!![]}];}_0x3668f0=_[_0xdaeb('0x3c')]({},_0x3668f0,_0x57196c[_0xdaeb('0x3e')]);return db[_0xdaeb('0x2b')][_0xdaeb('0x46')](_0x3668f0)[_0xdaeb('0x24')](handleEntityNotFound(_0x26297f,null))[_0xdaeb('0x24')](respondWithResult(_0x26297f,null))[_0xdaeb('0x42')](handleError(_0x26297f,null));};exports[_0xdaeb('0x47')]=function(_0x2c6884,_0xe7f505){return db['OpenchannelQueueReport'][_0xdaeb('0x47')](_0x2c6884[_0xdaeb('0x48')],{})[_0xdaeb('0x24')](respondWithResult(_0xe7f505,0xc9))[_0xdaeb('0x42')](handleError(_0xe7f505,null));};exports[_0xdaeb('0x23')]=function(_0x473f83,_0x3b21f7){if(_0x473f83[_0xdaeb('0x48')]['id']){delete _0x473f83[_0xdaeb('0x48')]['id'];}return db['OpenchannelQueueReport'][_0xdaeb('0x46')]({'where':{'id':_0x473f83[_0xdaeb('0x44')]['id']}})[_0xdaeb('0x24')](handleEntityNotFound(_0x3b21f7,null))[_0xdaeb('0x24')](saveUpdates(_0x473f83[_0xdaeb('0x48')],null))['then'](respondWithResult(_0x3b21f7,null))[_0xdaeb('0x42')](handleError(_0x3b21f7,null));};exports[_0xdaeb('0x25')]=function(_0x559a3f,_0x3b95fd){return db[_0xdaeb('0x2b')][_0xdaeb('0x46')]({'where':{'id':_0x559a3f['params']['id']}})[_0xdaeb('0x24')](handleEntityNotFound(_0x3b95fd,null))[_0xdaeb('0x24')](removeEntity(_0x3b95fd,null))[_0xdaeb('0x42')](handleError(_0x3b95fd,null));};exports[_0xdaeb('0x49')]=function(_0x5d9ccd,_0x17a113){return db[_0xdaeb('0x2b')][_0xdaeb('0x49')]()[_0xdaeb('0x24')](respondWithResult(_0x17a113,null))[_0xdaeb('0x42')](handleError(_0x17a113,null));};
\ No newline at end of file
+var _0xe7c1=['request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4fe49a,_0x49b890){var _0x537689=function(_0x2d1b25){while(--_0x2d1b25){_0x4fe49a['push'](_0x4fe49a['shift']());}};_0x537689(++_0x49b890);}(_0xe7c1,0x124));var _0x1e7c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xe7c1[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x1e7c('0x0'));var rimraf=require(_0x1e7c('0x1'));var zipdir=require(_0x1e7c('0x2'));var jsonpatch=require(_0x1e7c('0x3'));var rp=require(_0x1e7c('0x4'));var moment=require('moment');var BPromise=require(_0x1e7c('0x5'));var Mustache=require(_0x1e7c('0x6'));var util=require('util');var path=require(_0x1e7c('0x7'));var sox=require(_0x1e7c('0x8'));var csv=require(_0x1e7c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e7c('0xa'));var squel=require(_0x1e7c('0xb'));var crypto=require(_0x1e7c('0xc'));var jsforce=require(_0x1e7c('0xd'));var deskjs=require(_0x1e7c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1e7c('0xf'));var Papa=require(_0x1e7c('0x10'));var Redis=require('ioredis');var authService=require(_0x1e7c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1e7c('0x12'));var hardwareService=require(_0x1e7c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1e7c('0x14'));var config=require(_0x1e7c('0x15'));var licenseUtil=require(_0x1e7c('0x16'));var db=require(_0x1e7c('0x17'))['db'];function respondWithStatusCode(_0x4620d1,_0x316777){_0x316777=_0x316777||0xcc;return function(_0x5a3057){if(_0x5a3057){return _0x4620d1[_0x1e7c('0x18')](_0x316777);}return _0x4620d1[_0x1e7c('0x19')](_0x316777)[_0x1e7c('0x1a')]();};}function respondWithResult(_0x1cd60d,_0x18e0e8){_0x18e0e8=_0x18e0e8||0xc8;return function(_0xe4bcb9){if(_0xe4bcb9){return _0x1cd60d[_0x1e7c('0x19')](_0x18e0e8)['json'](_0xe4bcb9);}};}function respondWithFilteredResult(_0x4b10d8,_0x5a3228){return function(_0x3c3458){if(_0x3c3458){var _0x2c68ee=typeof _0x5a3228[_0x1e7c('0x1b')]==='undefined'&&typeof _0x5a3228[_0x1e7c('0x1c')]===_0x1e7c('0x1d');var _0x330fc0=_0x3c3458[_0x1e7c('0x1e')];var _0x6fda84=_0x2c68ee?0x0:_0x5a3228[_0x1e7c('0x1b')];var _0x37859d=_0x2c68ee?_0x3c3458[_0x1e7c('0x1e')]:_0x5a3228[_0x1e7c('0x1b')]+_0x5a3228[_0x1e7c('0x1c')];var _0x43a84f;if(_0x37859d>=_0x330fc0){_0x37859d=_0x330fc0;_0x43a84f=0xc8;}else{_0x43a84f=0xce;}_0x4b10d8[_0x1e7c('0x19')](_0x43a84f);return _0x4b10d8[_0x1e7c('0x1f')](_0x1e7c('0x20'),_0x6fda84+'-'+_0x37859d+'/'+_0x330fc0)['json'](_0x3c3458);}return null;};}function patchUpdates(_0x98b58d){return function(_0x852748){try{jsonpatch[_0x1e7c('0x21')](_0x852748,_0x98b58d,!![]);}catch(_0x229b07){return BPromise[_0x1e7c('0x22')](_0x229b07);}return _0x852748['save']();};}function saveUpdates(_0x12d269,_0x87cb65){return function(_0xb4d11d){if(_0xb4d11d){return _0xb4d11d[_0x1e7c('0x23')](_0x12d269)['then'](function(_0x57f6d2){return _0x57f6d2;});}return null;};}function removeEntity(_0x507f21,_0x840693){return function(_0x33ca56){if(_0x33ca56){return _0x33ca56[_0x1e7c('0x24')]()[_0x1e7c('0x25')](function(){_0x507f21[_0x1e7c('0x19')](0xcc)[_0x1e7c('0x1a')]();});}};}function handleEntityNotFound(_0x23f6f0,_0x8073ef){return function(_0x1b5a78){if(!_0x1b5a78){_0x23f6f0[_0x1e7c('0x18')](0x194);}return _0x1b5a78;};}function handleError(_0x1c8294,_0x35e386){_0x35e386=_0x35e386||0x1f4;return function(_0xa3491b){logger[_0x1e7c('0x26')](_0xa3491b['stack']);if(_0xa3491b[_0x1e7c('0x27')]){delete _0xa3491b[_0x1e7c('0x27')];}_0x1c8294[_0x1e7c('0x19')](_0x35e386)[_0x1e7c('0x28')](_0xa3491b);};}exports[_0x1e7c('0x29')]=function(_0x1abc37,_0x70adf3){var _0x23db14={},_0x2dd2fd={},_0x5b9abd={'count':0x0,'rows':[]};var _0x12cf2d=_[_0x1e7c('0x2a')](db[_0x1e7c('0x2b')][_0x1e7c('0x2c')],function(_0x1eb2fb){return{'name':_0x1eb2fb[_0x1e7c('0x2d')],'type':_0x1eb2fb[_0x1e7c('0x2e')][_0x1e7c('0x2f')]};});_0x2dd2fd[_0x1e7c('0x30')]=_[_0x1e7c('0x2a')](_0x12cf2d,_0x1e7c('0x27'));_0x2dd2fd[_0x1e7c('0x31')]=_[_0x1e7c('0x32')](_0x1abc37['query']);_0x2dd2fd['filters']=_[_0x1e7c('0x33')](_0x2dd2fd[_0x1e7c('0x30')],_0x2dd2fd[_0x1e7c('0x31')]);_0x23db14[_0x1e7c('0x34')]=_[_0x1e7c('0x33')](_0x2dd2fd[_0x1e7c('0x30')],qs[_0x1e7c('0x35')](_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x35')]));_0x23db14[_0x1e7c('0x34')]=_0x23db14[_0x1e7c('0x34')]['length']?_0x23db14[_0x1e7c('0x34')]:_0x2dd2fd[_0x1e7c('0x30')];if(!_0x1abc37[_0x1e7c('0x31')]['hasOwnProperty'](_0x1e7c('0x36'))){_0x23db14[_0x1e7c('0x1c')]=qs['limit'](_0x1abc37['query'][_0x1e7c('0x1c')]);_0x23db14[_0x1e7c('0x1b')]=qs[_0x1e7c('0x1b')](_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x1b')]);}_0x23db14['order']=qs[_0x1e7c('0x37')](_0x1abc37['query'][_0x1e7c('0x37')]);_0x23db14[_0x1e7c('0x38')]=qs[_0x1e7c('0x39')](_[_0x1e7c('0x3a')](_0x1abc37[_0x1e7c('0x31')],_0x2dd2fd[_0x1e7c('0x39')]),_0x12cf2d);if(_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x3b')]){_0x23db14[_0x1e7c('0x38')]=_[_0x1e7c('0x3c')](_0x23db14['where'],{'$or':_['map'](_0x12cf2d,function(_0x2b8c81){if(_0x2b8c81['type']!==_0x1e7c('0x3d')){var _0x177cf3={};_0x177cf3[_0x2b8c81[_0x1e7c('0x27')]]={'$like':'%'+_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x3b')]+'%'};return _0x177cf3;}})});}_0x23db14=_['merge']({},_0x23db14,_0x1abc37[_0x1e7c('0x3e')]);var _0x2cfe0b={'where':_0x23db14[_0x1e7c('0x38')]};return db[_0x1e7c('0x2b')]['count'](_0x2cfe0b)[_0x1e7c('0x25')](function(_0xbf5e9e){_0x5b9abd['count']=_0xbf5e9e;if(_0x1abc37[_0x1e7c('0x31')][_0x1e7c('0x3f')]){_0x23db14[_0x1e7c('0x40')]=[{'all':!![]}];}return db[_0x1e7c('0x2b')][_0x1e7c('0x41')](_0x23db14);})[_0x1e7c('0x25')](function(_0x35e619){_0x5b9abd[_0x1e7c('0x42')]=_0x35e619;return _0x5b9abd;})[_0x1e7c('0x25')](respondWithFilteredResult(_0x70adf3,_0x23db14))[_0x1e7c('0x43')](handleError(_0x70adf3,null));};exports['show']=function(_0x3307d7,_0x198a9f){var _0x452728={'raw':!![],'where':{'id':_0x3307d7[_0x1e7c('0x44')]['id']}},_0x7169ea={};_0x7169ea[_0x1e7c('0x30')]=_[_0x1e7c('0x32')](db[_0x1e7c('0x2b')][_0x1e7c('0x2c')]);_0x7169ea['query']=_[_0x1e7c('0x32')](_0x3307d7[_0x1e7c('0x31')]);_0x7169ea['filters']=_[_0x1e7c('0x33')](_0x7169ea[_0x1e7c('0x30')],_0x7169ea[_0x1e7c('0x31')]);_0x452728['attributes']=_[_0x1e7c('0x33')](_0x7169ea[_0x1e7c('0x30')],qs[_0x1e7c('0x35')](_0x3307d7[_0x1e7c('0x31')]['fields']));_0x452728[_0x1e7c('0x34')]=_0x452728['attributes'][_0x1e7c('0x45')]?_0x452728['attributes']:_0x7169ea[_0x1e7c('0x30')];if(_0x3307d7['query'][_0x1e7c('0x3f')]){_0x452728[_0x1e7c('0x40')]=[{'all':!![]}];}_0x452728=_[_0x1e7c('0x3c')]({},_0x452728,_0x3307d7[_0x1e7c('0x3e')]);return db[_0x1e7c('0x2b')]['find'](_0x452728)[_0x1e7c('0x25')](handleEntityNotFound(_0x198a9f,null))[_0x1e7c('0x25')](respondWithResult(_0x198a9f,null))[_0x1e7c('0x43')](handleError(_0x198a9f,null));};exports[_0x1e7c('0x46')]=function(_0xedce4b,_0x3d9e47){return db[_0x1e7c('0x2b')]['create'](_0xedce4b[_0x1e7c('0x47')],{})[_0x1e7c('0x25')](respondWithResult(_0x3d9e47,0xc9))[_0x1e7c('0x43')](handleError(_0x3d9e47,null));};exports[_0x1e7c('0x23')]=function(_0x2442e8,_0x5d4415){if(_0x2442e8[_0x1e7c('0x47')]['id']){delete _0x2442e8['body']['id'];}return db[_0x1e7c('0x2b')]['find']({'where':{'id':_0x2442e8[_0x1e7c('0x44')]['id']}})[_0x1e7c('0x25')](handleEntityNotFound(_0x5d4415,null))[_0x1e7c('0x25')](saveUpdates(_0x2442e8[_0x1e7c('0x47')],null))[_0x1e7c('0x25')](respondWithResult(_0x5d4415,null))[_0x1e7c('0x43')](handleError(_0x5d4415,null));};exports[_0x1e7c('0x24')]=function(_0x1b85c9,_0xbdfa8b){return db['OpenchannelQueueReport'][_0x1e7c('0x48')]({'where':{'id':_0x1b85c9[_0x1e7c('0x44')]['id']}})[_0x1e7c('0x25')](handleEntityNotFound(_0xbdfa8b,null))['then'](removeEntity(_0xbdfa8b,null))[_0x1e7c('0x43')](handleError(_0xbdfa8b,null));};exports[_0x1e7c('0x49')]=function(_0x17c243,_0x145812){return db['OpenchannelQueueReport'][_0x1e7c('0x49')]()[_0x1e7c('0x25')](respondWithResult(_0x145812,null))[_0x1e7c('0x43')](handleError(_0x145812,null));};
\ No newline at end of file
index 78d821a..57e7c5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x4c2709,_0x4ebcdc){var _0x534ce1=function(_0x34b005){while(--_0x34b005){_0x4c2709['push'](_0x4c2709['shift']());}};_0x534ce1(++_0x4ebcdc);}(_0x326f,0xd1));var _0xf326=function(_0x2d7f3a,_0x37fb7b){_0x2d7f3a=_0x2d7f3a-0x0;var _0x57a9e4=_0x326f[_0x2d7f3a];return _0x57a9e4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x58f269,_0x285930){var _0x2524dc=function(_0x5592c0){while(--_0x5592c0){_0x58f269['push'](_0x58f269['shift']());}};_0x2524dc(++_0x285930);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xc4aa[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index a02678c..f425251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0447=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','raw','then','UpdateOpenchannelQueueReport','update','body','options','where','attributes','limit','catch','lodash'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0447,0x8b));var _0x7044=function(_0x3599fc,_0x5455e8){_0x3599fc=_0x3599fc-0x0;var _0x5991c7=_0x0447[_0x3599fc];return _0x5991c7;};'use strict';var _=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var moment=require(_0x7044('0x2'));var BPromise=require(_0x7044('0x3'));var rs=require(_0x7044('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7044('0x5'))['db'];var utils=require(_0x7044('0x6'));var logger=require(_0x7044('0x7'))(_0x7044('0x8'));var config=require(_0x7044('0x9'));var jayson=require(_0x7044('0xa'));var client=jayson[_0x7044('0xb')][_0x7044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x66b8cb,_0x51de50,_0x72d341){return new BPromise(function(_0x42d53b,_0x2a2b36){return client[_0x7044('0xd')](_0x66b8cb,_0x72d341)['then'](function(_0x41616d){logger[_0x7044('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x51de50,_0x7044('0xf'));logger[_0x7044('0x10')](_0x7044('0x11'),_0x51de50,_0x7044('0xf'),JSON['stringify'](_0x41616d));if(_0x41616d[_0x7044('0x12')]){if(_0x41616d['error']['code']===0x1f4){logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')][_0x7044('0x14')]);return _0x2a2b36(_0x41616d[_0x7044('0x12')]['message']);}logger['error'](_0x7044('0x13'),_0x51de50,_0x41616d[_0x7044('0x12')]['message']);return _0x42d53b(_0x41616d['error'][_0x7044('0x14')]);}else{logger[_0x7044('0xe')](_0x7044('0x13'),_0x51de50,_0x7044('0xf'));_0x42d53b(_0x41616d[_0x7044('0x15')][_0x7044('0x14')]);}})['catch'](function(_0xdae8a){logger[_0x7044('0x12')](_0x7044('0x13'),_0x51de50,_0xdae8a);_0x2a2b36(_0xdae8a);});});}exports[_0x7044('0x16')]=function(_0x219486){var _0x3f373c=this;return new Promise(function(_0x4df89b,_0x1f300e){return db[_0x7044('0x17')][_0x7044('0x18')](_0x219486['body'],{'raw':_0x219486['options']?_0x219486['options'][_0x7044('0x19')]===undefined?!![]:![]:!![]})[_0x7044('0x1a')](function(_0x2c5dcb){logger[_0x7044('0xe')](_0x7044('0x16'),_0x219486);logger['debug'](_0x7044('0x16'),_0x219486,JSON['stringify'](_0x2c5dcb));_0x4df89b(_0x2c5dcb);})['catch'](function(_0x3db88b){logger[_0x7044('0x12')](_0x7044('0x16'),_0x3db88b[_0x7044('0x14')],_0x219486);_0x1f300e(_0x3f373c[_0x7044('0x12')](0x1f4,_0x3db88b[_0x7044('0x14')]));});});};exports[_0x7044('0x1b')]=function(_0x9452a1){var _0x4271b5=this;return new Promise(function(_0x5e2c9a,_0x5d7d8a){return db[_0x7044('0x17')][_0x7044('0x1c')](_0x9452a1[_0x7044('0x1d')],{'raw':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x1f')]||null:null,'attributes':_0x9452a1[_0x7044('0x1e')]?_0x9452a1[_0x7044('0x1e')][_0x7044('0x20')]||null:null,'limit':_0x9452a1['options']?_0x9452a1[_0x7044('0x1e')][_0x7044('0x21')]||null:null})[_0x7044('0x1a')](function(_0x1a75ff){logger['info'](_0x7044('0x1b'),_0x9452a1);logger['debug']('UpdateOpenchannelQueueReport',_0x9452a1,JSON['stringify'](_0x1a75ff));_0x5e2c9a(_0x1a75ff);})[_0x7044('0x22')](function(_0x55ea91){logger[_0x7044('0x12')](_0x7044('0x1b'),_0x55ea91['message'],_0x9452a1);_0x5d7d8a(_0x4271b5['error'](0x1f4,_0x55ea91[_0x7044('0x14')]));});});};
\ No newline at end of file
+var _0x51c5=['attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','catch','CreateOpenchannelQueueReport','create','options','raw','then','OpenchannelQueueReport','update','body','where'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0x51c5,0x8f));var _0x551c=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x51c5[_0x580647];return _0x5f0792;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['OpenchannelQueueReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateOpenchannelQueueReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x194a1d){var _0x52cea5=this;return new Promise(function(_0x164343,_0x30f639){return db[_0x551c('0x1c')][_0x551c('0x1d')](_0x194a1d[_0x551c('0x1e')],{'raw':_0x194a1d[_0x551c('0x19')]?_0x194a1d[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x1f')]||null:null,'attributes':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x20')]||null:null,'limit':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x21')]||null:null})[_0x551c('0x1b')](function(_0x1600b5){logger[_0x551c('0x15')]('UpdateOpenchannelQueueReport',_0x194a1d);logger[_0x551c('0xe')](_0x551c('0x22'),_0x194a1d,JSON[_0x551c('0x10')](_0x1600b5));_0x164343(_0x1600b5);})['catch'](function(_0x3aa0c0){logger[_0x551c('0x11')]('UpdateOpenchannelQueueReport',_0x3aa0c0['message'],_0x194a1d);_0x30f639(_0x52cea5[_0x551c('0x11')](0x1f4,_0x3aa0c0[_0x551c('0x13')]));});});};
\ No newline at end of file
index 80ca362..2d6f4dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fe8=['post','create','put','/:id','update','delete','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x2fe8,0xfd));var _0x82fe=function(_0x456465,_0x3b6929){_0x456465=_0x456465-0x0;var _0x208338=_0x2fe8[_0x456465];return _0x208338;};'use strict';var multer=require('multer');var util=require(_0x82fe('0x0'));var path=require(_0x82fe('0x1'));var timeout=require(_0x82fe('0x2'));var express=require(_0x82fe('0x3'));var router=express['Router']();var fs_extra=require(_0x82fe('0x4'));var auth=require(_0x82fe('0x5'));var interaction=require(_0x82fe('0x6'));var config=require('../../config/environment');var controller=require(_0x82fe('0x7'));router[_0x82fe('0x8')]('/',auth[_0x82fe('0x9')](),controller[_0x82fe('0xa')]);router[_0x82fe('0x8')](_0x82fe('0xb'),auth[_0x82fe('0x9')](),controller[_0x82fe('0xc')]);router[_0x82fe('0x8')]('/:id',auth[_0x82fe('0x9')](),controller['show']);router[_0x82fe('0xd')]('/',auth[_0x82fe('0x9')](),controller[_0x82fe('0xe')]);router[_0x82fe('0xf')](_0x82fe('0x10'),auth[_0x82fe('0x9')](),controller[_0x82fe('0x11')]);router[_0x82fe('0x12')](_0x82fe('0x10'),auth[_0x82fe('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3ce6=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ce6,0x118));var _0x63ce=function(_0x57206a,_0x3e9a18){_0x57206a=_0x57206a-0x0;var _0xf54af4=_0x3ce6[_0x57206a];return _0xf54af4;};'use strict';var multer=require(_0x63ce('0x0'));var util=require('util');var path=require(_0x63ce('0x1'));var timeout=require(_0x63ce('0x2'));var express=require(_0x63ce('0x3'));var router=express['Router']();var fs_extra=require(_0x63ce('0x4'));var auth=require(_0x63ce('0x5'));var interaction=require(_0x63ce('0x6'));var config=require(_0x63ce('0x7'));var controller=require(_0x63ce('0x8'));router[_0x63ce('0x9')]('/',auth[_0x63ce('0xa')](),controller[_0x63ce('0xb')]);router['get'](_0x63ce('0xc'),auth[_0x63ce('0xa')](),controller[_0x63ce('0xd')]);router[_0x63ce('0x9')](_0x63ce('0xe'),auth[_0x63ce('0xa')](),controller[_0x63ce('0xf')]);router[_0x63ce('0x10')]('/',auth[_0x63ce('0xa')](),controller['create']);router['put']('/:id',auth[_0x63ce('0xa')](),controller[_0x63ce('0x11')]);router[_0x63ce('0x12')](_0x63ce('0xe'),auth[_0x63ce('0xa')](),controller['destroy']);module[_0x63ce('0x13')]=router;
\ No newline at end of file
index 3d89113..fdccb04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4841da,_0x1a5d31){var _0x8befd1=function(_0x17c9fc){while(--_0x17c9fc){_0x4841da['push'](_0x4841da['shift']());}};_0x8befd1(++_0x1a5d31);}(_0x34e8,0x12c));var _0x834e=function(_0x334117,_0x358db7){_0x334117=_0x334117-0x0;var _0x158162=_0x34e8[_0x334117];return _0x158162;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x69752e,_0x2579f6){var _0x506a36=function(_0x1793bc){while(--_0x1793bc){_0x69752e['push'](_0x69752e['shift']());}};_0x506a36(++_0x2579f6);}(_0x54ef,0x112));var _0xf54e=function(_0x498147,_0x473ac3){_0x498147=_0x498147-0x0;var _0x53b8ce=_0x54ef[_0x498147];return _0x53b8ce;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
index f222e3b..68c7769 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x519e=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','OpenchannelTransferReport','fieldName','type','model','map','name','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0x519e,0x172));var _0xe519=function(_0x526b0e,_0x1e768c){_0x526b0e=_0x526b0e-0x0;var _0x149436=_0x519e[_0x526b0e];return _0x149436;};'use strict';var emlformat=require(_0xe519('0x0'));var rimraf=require(_0xe519('0x1'));var zipdir=require(_0xe519('0x2'));var jsonpatch=require(_0xe519('0x3'));var rp=require(_0xe519('0x4'));var moment=require(_0xe519('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe519('0x6'));var util=require(_0xe519('0x7'));var path=require(_0xe519('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe519('0x9'));var fs=require('fs');var fs_extra=require(_0xe519('0xa'));var _=require(_0xe519('0xb'));var squel=require('squel');var crypto=require(_0xe519('0xc'));var jsforce=require(_0xe519('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe519('0xe'));var querystring=require(_0xe519('0xf'));var Papa=require('papaparse');var Redis=require(_0xe519('0x10'));var authService=require(_0xe519('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe519('0x12'));var hardwareService=require(_0xe519('0x13'));var logger=require(_0xe519('0x14'))(_0xe519('0x15'));var utils=require(_0xe519('0x16'));var config=require(_0xe519('0x17'));var licenseUtil=require(_0xe519('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d7bb6,_0x5d4849){_0x5d4849=_0x5d4849||0xcc;return function(_0x174aa0){if(_0x174aa0){return _0x3d7bb6[_0xe519('0x19')](_0x5d4849);}return _0x3d7bb6['status'](_0x5d4849)[_0xe519('0x1a')]();};}function respondWithResult(_0x2342ad,_0x4a6086){_0x4a6086=_0x4a6086||0xc8;return function(_0x41a9b2){if(_0x41a9b2){return _0x2342ad[_0xe519('0x1b')](_0x4a6086)[_0xe519('0x1c')](_0x41a9b2);}};}function respondWithFilteredResult(_0x27b7b3,_0x9ce81){return function(_0x456000){if(_0x456000){var _0x69bedc=typeof _0x9ce81[_0xe519('0x1d')]===_0xe519('0x1e')&&typeof _0x9ce81[_0xe519('0x1f')]===_0xe519('0x1e');var _0x5e1ac1=_0x456000[_0xe519('0x20')];var _0x16753e=_0x69bedc?0x0:_0x9ce81[_0xe519('0x1d')];var _0x31ebfd=_0x69bedc?_0x456000['count']:_0x9ce81['offset']+_0x9ce81[_0xe519('0x1f')];var _0x384869;if(_0x31ebfd>=_0x5e1ac1){_0x31ebfd=_0x5e1ac1;_0x384869=0xc8;}else{_0x384869=0xce;}_0x27b7b3['status'](_0x384869);return _0x27b7b3[_0xe519('0x21')](_0xe519('0x22'),_0x16753e+'-'+_0x31ebfd+'/'+_0x5e1ac1)[_0xe519('0x1c')](_0x456000);}return null;};}function patchUpdates(_0x5d6eaf){return function(_0x244608){try{jsonpatch[_0xe519('0x23')](_0x244608,_0x5d6eaf,!![]);}catch(_0x24e5a5){return BPromise[_0xe519('0x24')](_0x24e5a5);}return _0x244608[_0xe519('0x25')]();};}function saveUpdates(_0x51a7aa,_0xd471d9){return function(_0x72a4cb){if(_0x72a4cb){return _0x72a4cb[_0xe519('0x26')](_0x51a7aa)[_0xe519('0x27')](function(_0x11bf2c){return _0x11bf2c;});}return null;};}function removeEntity(_0x3c9f47,_0x16ec7d){return function(_0x94191c){if(_0x94191c){return _0x94191c[_0xe519('0x28')]()[_0xe519('0x27')](function(){_0x3c9f47[_0xe519('0x1b')](0xcc)[_0xe519('0x1a')]();});}};}function handleEntityNotFound(_0x45924a,_0x502a95){return function(_0x81de04){if(!_0x81de04){_0x45924a[_0xe519('0x19')](0x194);}return _0x81de04;};}function handleError(_0x1a8f87,_0x4a2b4d){_0x4a2b4d=_0x4a2b4d||0x1f4;return function(_0x4fd817){logger[_0xe519('0x29')](_0x4fd817[_0xe519('0x2a')]);if(_0x4fd817['name']){delete _0x4fd817['name'];}_0x1a8f87[_0xe519('0x1b')](_0x4a2b4d)['send'](_0x4fd817);};}exports[_0xe519('0x2b')]=function(_0x49f261,_0x511fd3){var _0x3cbd9b={},_0x4f53b0={},_0x28ea4b={'count':0x0,'rows':[]};var _0x1a24ad=_['map'](db[_0xe519('0x2c')]['rawAttributes'],function(_0x1157bc){return{'name':_0x1157bc[_0xe519('0x2d')],'type':_0x1157bc[_0xe519('0x2e')]['key']};});_0x4f53b0[_0xe519('0x2f')]=_[_0xe519('0x30')](_0x1a24ad,_0xe519('0x31'));_0x4f53b0['query']=_[_0xe519('0x32')](_0x49f261[_0xe519('0x33')]);_0x4f53b0[_0xe519('0x34')]=_[_0xe519('0x35')](_0x4f53b0[_0xe519('0x2f')],_0x4f53b0[_0xe519('0x33')]);_0x3cbd9b[_0xe519('0x36')]=_[_0xe519('0x35')](_0x4f53b0['model'],qs['fields'](_0x49f261[_0xe519('0x33')][_0xe519('0x37')]));_0x3cbd9b[_0xe519('0x36')]=_0x3cbd9b[_0xe519('0x36')][_0xe519('0x38')]?_0x3cbd9b[_0xe519('0x36')]:_0x4f53b0[_0xe519('0x2f')];if(!_0x49f261[_0xe519('0x33')]['hasOwnProperty'](_0xe519('0x39'))){_0x3cbd9b['limit']=qs[_0xe519('0x1f')](_0x49f261[_0xe519('0x33')]['limit']);_0x3cbd9b['offset']=qs[_0xe519('0x1d')](_0x49f261['query'][_0xe519('0x1d')]);}_0x3cbd9b['order']=qs['sort'](_0x49f261[_0xe519('0x33')][_0xe519('0x3a')]);_0x3cbd9b[_0xe519('0x3b')]=qs['filters'](_[_0xe519('0x3c')](_0x49f261['query'],_0x4f53b0['filters']),_0x1a24ad);if(_0x49f261['query'][_0xe519('0x3d')]){_0x3cbd9b[_0xe519('0x3b')]=_['merge'](_0x3cbd9b[_0xe519('0x3b')],{'$or':_[_0xe519('0x30')](_0x1a24ad,function(_0x47d19c){if(_0x47d19c[_0xe519('0x2e')]!=='VIRTUAL'){var _0x2c3589={};_0x2c3589[_0x47d19c[_0xe519('0x31')]]={'$like':'%'+_0x49f261['query'][_0xe519('0x3d')]+'%'};return _0x2c3589;}})});}_0x3cbd9b=_[_0xe519('0x3e')]({},_0x3cbd9b,_0x49f261[_0xe519('0x3f')]);var _0x592c3c={'where':_0x3cbd9b['where']};return db[_0xe519('0x2c')][_0xe519('0x20')](_0x592c3c)[_0xe519('0x27')](function(_0x39dc28){_0x28ea4b[_0xe519('0x20')]=_0x39dc28;if(_0x49f261[_0xe519('0x33')][_0xe519('0x40')]){_0x3cbd9b[_0xe519('0x41')]=[{'all':!![]}];}return db[_0xe519('0x2c')][_0xe519('0x42')](_0x3cbd9b);})['then'](function(_0x33767d){_0x28ea4b['rows']=_0x33767d;return _0x28ea4b;})['then'](respondWithFilteredResult(_0x511fd3,_0x3cbd9b))[_0xe519('0x43')](handleError(_0x511fd3,null));};exports[_0xe519('0x44')]=function(_0x1db306,_0x8a195e){var _0x45ff1c={'raw':!![],'where':{'id':_0x1db306[_0xe519('0x45')]['id']}},_0x30d4ec={};_0x30d4ec[_0xe519('0x2f')]=_['keys'](db['OpenchannelTransferReport'][_0xe519('0x46')]);_0x30d4ec[_0xe519('0x33')]=_[_0xe519('0x32')](_0x1db306[_0xe519('0x33')]);_0x30d4ec[_0xe519('0x34')]=_[_0xe519('0x35')](_0x30d4ec[_0xe519('0x2f')],_0x30d4ec['query']);_0x45ff1c[_0xe519('0x36')]=_[_0xe519('0x35')](_0x30d4ec['model'],qs[_0xe519('0x37')](_0x1db306[_0xe519('0x33')][_0xe519('0x37')]));_0x45ff1c[_0xe519('0x36')]=_0x45ff1c[_0xe519('0x36')][_0xe519('0x38')]?_0x45ff1c[_0xe519('0x36')]:_0x30d4ec['model'];if(_0x1db306['query'][_0xe519('0x40')]){_0x45ff1c[_0xe519('0x41')]=[{'all':!![]}];}_0x45ff1c=_[_0xe519('0x3e')]({},_0x45ff1c,_0x1db306[_0xe519('0x3f')]);return db[_0xe519('0x2c')][_0xe519('0x47')](_0x45ff1c)['then'](handleEntityNotFound(_0x8a195e,null))[_0xe519('0x27')](respondWithResult(_0x8a195e,null))[_0xe519('0x43')](handleError(_0x8a195e,null));};exports[_0xe519('0x48')]=function(_0x1f90a2,_0x254537){return db[_0xe519('0x2c')][_0xe519('0x48')](_0x1f90a2[_0xe519('0x49')],{})[_0xe519('0x27')](respondWithResult(_0x254537,0xc9))[_0xe519('0x43')](handleError(_0x254537,null));};exports[_0xe519('0x26')]=function(_0x488003,_0x39f92a){if(_0x488003['body']['id']){delete _0x488003['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x488003[_0xe519('0x45')]['id']}})[_0xe519('0x27')](handleEntityNotFound(_0x39f92a,null))['then'](saveUpdates(_0x488003[_0xe519('0x49')],null))[_0xe519('0x27')](respondWithResult(_0x39f92a,null))[_0xe519('0x43')](handleError(_0x39f92a,null));};exports[_0xe519('0x28')]=function(_0x1b85d2,_0x33d228){return db[_0xe519('0x2c')][_0xe519('0x47')]({'where':{'id':_0x1b85d2[_0xe519('0x45')]['id']}})[_0xe519('0x27')](handleEntityNotFound(_0x33d228,null))['then'](removeEntity(_0x33d228,null))[_0xe519('0x43')](handleError(_0x33d228,null));};exports['describe']=function(_0x1fe531,_0x1238ce){return db[_0xe519('0x2c')]['describe']()['then'](respondWithResult(_0x1238ce,null))['catch'](handleError(_0x1238ce,null));};
\ No newline at end of file
+var _0xb287=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','error','name','send','index','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','fields','includeAll','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs','fs-extra'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xb287,0x1a6));var _0x7b28=function(_0x43134c,_0x79bf87){_0x43134c=_0x43134c-0x0;var _0x4ded1c=_0xb287[_0x43134c];return _0x4ded1c;};'use strict';var emlformat=require(_0x7b28('0x0'));var rimraf=require(_0x7b28('0x1'));var zipdir=require(_0x7b28('0x2'));var jsonpatch=require(_0x7b28('0x3'));var rp=require('request-promise');var moment=require(_0x7b28('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7b28('0x5'));var path=require('path');var sox=require(_0x7b28('0x6'));var csv=require(_0x7b28('0x7'));var ejs=require(_0x7b28('0x8'));var fs=require('fs');var fs_extra=require(_0x7b28('0x9'));var _=require(_0x7b28('0xa'));var squel=require(_0x7b28('0xb'));var crypto=require(_0x7b28('0xc'));var jsforce=require(_0x7b28('0xd'));var deskjs=require(_0x7b28('0xe'));var toCsv=require(_0x7b28('0x7'));var querystring=require(_0x7b28('0xf'));var Papa=require(_0x7b28('0x10'));var Redis=require(_0x7b28('0x11'));var authService=require(_0x7b28('0x12'));var qs=require(_0x7b28('0x13'));var as=require(_0x7b28('0x14'));var hardwareService=require(_0x7b28('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7b28('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b28('0x17'));var db=require(_0x7b28('0x18'))['db'];function respondWithStatusCode(_0x1e1e12,_0x224b56){_0x224b56=_0x224b56||0xcc;return function(_0x58ceb4){if(_0x58ceb4){return _0x1e1e12[_0x7b28('0x19')](_0x224b56);}return _0x1e1e12['status'](_0x224b56)[_0x7b28('0x1a')]();};}function respondWithResult(_0x350c05,_0x409cba){_0x409cba=_0x409cba||0xc8;return function(_0x1c2139){if(_0x1c2139){return _0x350c05['status'](_0x409cba)[_0x7b28('0x1b')](_0x1c2139);}};}function respondWithFilteredResult(_0x39948a,_0x2d55db){return function(_0x29604a){if(_0x29604a){var _0x2d7cd1=typeof _0x2d55db[_0x7b28('0x1c')]===_0x7b28('0x1d')&&typeof _0x2d55db[_0x7b28('0x1e')]===_0x7b28('0x1d');var _0x522d61=_0x29604a[_0x7b28('0x1f')];var _0x274ca0=_0x2d7cd1?0x0:_0x2d55db[_0x7b28('0x1c')];var _0xdfdf2c=_0x2d7cd1?_0x29604a['count']:_0x2d55db[_0x7b28('0x1c')]+_0x2d55db['limit'];var _0x4f540c;if(_0xdfdf2c>=_0x522d61){_0xdfdf2c=_0x522d61;_0x4f540c=0xc8;}else{_0x4f540c=0xce;}_0x39948a[_0x7b28('0x20')](_0x4f540c);return _0x39948a[_0x7b28('0x21')](_0x7b28('0x22'),_0x274ca0+'-'+_0xdfdf2c+'/'+_0x522d61)['json'](_0x29604a);}return null;};}function patchUpdates(_0x567498){return function(_0x1a6dee){try{jsonpatch[_0x7b28('0x23')](_0x1a6dee,_0x567498,!![]);}catch(_0x338bdb){return BPromise[_0x7b28('0x24')](_0x338bdb);}return _0x1a6dee['save']();};}function saveUpdates(_0x66977b,_0x46a9f7){return function(_0x5a9a0f){if(_0x5a9a0f){return _0x5a9a0f[_0x7b28('0x25')](_0x66977b)[_0x7b28('0x26')](function(_0x3d256a){return _0x3d256a;});}return null;};}function removeEntity(_0x5c5385,_0x57b42f){return function(_0x57fca1){if(_0x57fca1){return _0x57fca1['destroy']()['then'](function(){_0x5c5385[_0x7b28('0x20')](0xcc)[_0x7b28('0x1a')]();});}};}function handleEntityNotFound(_0x4d3af1,_0x4b4bc6){return function(_0x5f2b51){if(!_0x5f2b51){_0x4d3af1[_0x7b28('0x19')](0x194);}return _0x5f2b51;};}function handleError(_0x2d852c,_0x1107f6){_0x1107f6=_0x1107f6||0x1f4;return function(_0x27c9d7){logger[_0x7b28('0x27')](_0x27c9d7['stack']);if(_0x27c9d7[_0x7b28('0x28')]){delete _0x27c9d7['name'];}_0x2d852c[_0x7b28('0x20')](_0x1107f6)[_0x7b28('0x29')](_0x27c9d7);};}exports[_0x7b28('0x2a')]=function(_0x150234,_0x3b758e){var _0x34fe35={},_0xf06b09={},_0x2e7386={'count':0x0,'rows':[]};var _0x406ac7=_['map'](db[_0x7b28('0x2b')]['rawAttributes'],function(_0x104777){return{'name':_0x104777[_0x7b28('0x2c')],'type':_0x104777[_0x7b28('0x2d')][_0x7b28('0x2e')]};});_0xf06b09[_0x7b28('0x2f')]=_['map'](_0x406ac7,_0x7b28('0x28'));_0xf06b09[_0x7b28('0x30')]=_[_0x7b28('0x31')](_0x150234[_0x7b28('0x30')]);_0xf06b09[_0x7b28('0x32')]=_[_0x7b28('0x33')](_0xf06b09[_0x7b28('0x2f')],_0xf06b09[_0x7b28('0x30')]);_0x34fe35[_0x7b28('0x34')]=_[_0x7b28('0x33')](_0xf06b09['model'],qs['fields'](_0x150234[_0x7b28('0x30')]['fields']));_0x34fe35[_0x7b28('0x34')]=_0x34fe35['attributes'][_0x7b28('0x35')]?_0x34fe35[_0x7b28('0x34')]:_0xf06b09[_0x7b28('0x2f')];if(!_0x150234['query']['hasOwnProperty']('nolimit')){_0x34fe35[_0x7b28('0x1e')]=qs[_0x7b28('0x1e')](_0x150234[_0x7b28('0x30')][_0x7b28('0x1e')]);_0x34fe35['offset']=qs[_0x7b28('0x1c')](_0x150234['query'][_0x7b28('0x1c')]);}_0x34fe35[_0x7b28('0x36')]=qs[_0x7b28('0x37')](_0x150234[_0x7b28('0x30')][_0x7b28('0x37')]);_0x34fe35[_0x7b28('0x38')]=qs[_0x7b28('0x32')](_[_0x7b28('0x39')](_0x150234[_0x7b28('0x30')],_0xf06b09[_0x7b28('0x32')]),_0x406ac7);if(_0x150234[_0x7b28('0x30')][_0x7b28('0x3a')]){_0x34fe35[_0x7b28('0x38')]=_[_0x7b28('0x3b')](_0x34fe35['where'],{'$or':_['map'](_0x406ac7,function(_0x4a7011){if(_0x4a7011[_0x7b28('0x2d')]!=='VIRTUAL'){var _0x137323={};_0x137323[_0x4a7011[_0x7b28('0x28')]]={'$like':'%'+_0x150234[_0x7b28('0x30')]['filter']+'%'};return _0x137323;}})});}_0x34fe35=_[_0x7b28('0x3b')]({},_0x34fe35,_0x150234[_0x7b28('0x3c')]);var _0x5e2455={'where':_0x34fe35['where']};return db[_0x7b28('0x2b')]['count'](_0x5e2455)['then'](function(_0x29f1c){_0x2e7386[_0x7b28('0x1f')]=_0x29f1c;if(_0x150234[_0x7b28('0x30')]['includeAll']){_0x34fe35[_0x7b28('0x3d')]=[{'all':!![]}];}return db[_0x7b28('0x2b')][_0x7b28('0x3e')](_0x34fe35);})['then'](function(_0x370eb1){_0x2e7386['rows']=_0x370eb1;return _0x2e7386;})[_0x7b28('0x26')](respondWithFilteredResult(_0x3b758e,_0x34fe35))[_0x7b28('0x3f')](handleError(_0x3b758e,null));};exports[_0x7b28('0x40')]=function(_0x2a053d,_0x5a6d15){var _0x316aa9={'raw':!![],'where':{'id':_0x2a053d[_0x7b28('0x41')]['id']}},_0x1c7e01={};_0x1c7e01[_0x7b28('0x2f')]=_['keys'](db[_0x7b28('0x2b')]['rawAttributes']);_0x1c7e01[_0x7b28('0x30')]=_[_0x7b28('0x31')](_0x2a053d[_0x7b28('0x30')]);_0x1c7e01[_0x7b28('0x32')]=_[_0x7b28('0x33')](_0x1c7e01[_0x7b28('0x2f')],_0x1c7e01['query']);_0x316aa9[_0x7b28('0x34')]=_[_0x7b28('0x33')](_0x1c7e01['model'],qs[_0x7b28('0x42')](_0x2a053d[_0x7b28('0x30')][_0x7b28('0x42')]));_0x316aa9['attributes']=_0x316aa9['attributes'][_0x7b28('0x35')]?_0x316aa9['attributes']:_0x1c7e01['model'];if(_0x2a053d[_0x7b28('0x30')][_0x7b28('0x43')]){_0x316aa9[_0x7b28('0x3d')]=[{'all':!![]}];}_0x316aa9=_[_0x7b28('0x3b')]({},_0x316aa9,_0x2a053d['options']);return db[_0x7b28('0x2b')]['find'](_0x316aa9)[_0x7b28('0x26')](handleEntityNotFound(_0x5a6d15,null))[_0x7b28('0x26')](respondWithResult(_0x5a6d15,null))[_0x7b28('0x3f')](handleError(_0x5a6d15,null));};exports[_0x7b28('0x44')]=function(_0x21dfce,_0xb6dc4a){return db['OpenchannelTransferReport'][_0x7b28('0x44')](_0x21dfce[_0x7b28('0x45')],{})[_0x7b28('0x26')](respondWithResult(_0xb6dc4a,0xc9))[_0x7b28('0x3f')](handleError(_0xb6dc4a,null));};exports[_0x7b28('0x25')]=function(_0x2d495c,_0x27de2b){if(_0x2d495c[_0x7b28('0x45')]['id']){delete _0x2d495c[_0x7b28('0x45')]['id'];}return db[_0x7b28('0x2b')]['find']({'where':{'id':_0x2d495c['params']['id']}})[_0x7b28('0x26')](handleEntityNotFound(_0x27de2b,null))[_0x7b28('0x26')](saveUpdates(_0x2d495c['body'],null))['then'](respondWithResult(_0x27de2b,null))[_0x7b28('0x3f')](handleError(_0x27de2b,null));};exports[_0x7b28('0x46')]=function(_0x3adfe2,_0x371674){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3adfe2[_0x7b28('0x41')]['id']}})[_0x7b28('0x26')](handleEntityNotFound(_0x371674,null))[_0x7b28('0x26')](removeEntity(_0x371674,null))[_0x7b28('0x3f')](handleError(_0x371674,null));};exports[_0x7b28('0x47')]=function(_0x131a96,_0x291675){return db[_0x7b28('0x2b')][_0x7b28('0x47')]()[_0x7b28('0x26')](respondWithResult(_0x291675,null))[_0x7b28('0x3f')](handleError(_0x291675,null));};
\ No newline at end of file
index 0f0ad23..f9f6195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7048=['../../config/logger','bluebird','path','rimraf','exports','report_openchannel_transfer','uniqueid','lodash'];(function(_0x1da243,_0xdfdfb8){var _0x3ebf50=function(_0x4b6555){while(--_0x4b6555){_0x1da243['push'](_0x1da243['shift']());}};_0x3ebf50(++_0xdfdfb8);}(_0x7048,0xaf));var _0x8704=function(_0x549c5c,_0x4acd40){_0x549c5c=_0x549c5c-0x0;var _0x2c8a18=_0x7048[_0x549c5c];return _0x2c8a18;};'use strict';var _=require(_0x8704('0x0'));var util=require('util');var logger=require(_0x8704('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8704('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8704('0x3'));var rimraf=require(_0x8704('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x8704('0x5')]=function(_0x10920f,_0x54edad){return _0x10920f['define']('OpenchannelTransferReport',attributes,{'tableName':_0x8704('0x6'),'paranoid':![],'indexes':[{'name':_0x8704('0x7'),'fields':[_0x8704('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf69a=['bluebird','request-promise','path','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x338a33,_0xd61e6a){var _0x3a5225=function(_0x13beca){while(--_0x13beca){_0x338a33['push'](_0x338a33['shift']());}};_0x3a5225(++_0xd61e6a);}(_0xf69a,0xf3));var _0xaf69=function(_0x5628b8,_0x145582){_0x5628b8=_0x5628b8-0x0;var _0x3ce423=_0xf69a[_0x5628b8];return _0x3ce423;};'use strict';var _=require('lodash');var util=require(_0xaf69('0x0'));var logger=require(_0xaf69('0x1'))(_0xaf69('0x2'));var moment=require(_0xaf69('0x3'));var BPromise=require(_0xaf69('0x4'));var rp=require(_0xaf69('0x5'));var fs=require('fs');var path=require(_0xaf69('0x6'));var rimraf=require('rimraf');var config=require(_0xaf69('0x7'));var attributes=require(_0xaf69('0x8'));module['exports']=function(_0x29dca2,_0x3f1e7e){return _0x29dca2[_0xaf69('0x9')](_0xaf69('0xa'),attributes,{'tableName':_0xaf69('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xaf69('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a5e0f00..4d6a2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3473d4,_0x3b0da8){_0x3473d4=_0x3473d4-0x0;var _0x53372e=_0x1cb9[_0x3473d4];return _0x53372e;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0xd13e=['OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa291c4,_0x44c16b){var _0x24086f=function(_0xe60e24){while(--_0xe60e24){_0xa291c4['push'](_0xa291c4['shift']());}};_0x24086f(++_0x44c16b);}(_0xd13e,0x193));var _0xed13=function(_0x3d79b7,_0x136918){_0x3d79b7=_0x3d79b7-0x0;var _0x3ad4b0=_0xd13e[_0x3d79b7];return _0x3ad4b0;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});}
\ No newline at end of file
index 0068b14..3b659f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a9=['post','put','update','delete','destroy','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0xc6a9,0x140));var _0x9c6a=function(_0x34ae7d,_0x359c6f){_0x34ae7d=_0x34ae7d-0x0;var _0x5d4f3d=_0xc6a9[_0x34ae7d];return _0x5d4f3d;};'use strict';var multer=require('multer');var util=require(_0x9c6a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c6a('0x1')]();var fs_extra=require(_0x9c6a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x9c6a('0x3'));var config=require(_0x9c6a('0x4'));var controller=require(_0x9c6a('0x5'));router[_0x9c6a('0x6')]('/',auth[_0x9c6a('0x7')](),controller['index']);router[_0x9c6a('0x6')](_0x9c6a('0x8'),auth[_0x9c6a('0x7')](),controller[_0x9c6a('0x9')]);router[_0x9c6a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9c6a('0xb')]('/:id',auth[_0x9c6a('0x7')](),controller[_0x9c6a('0xc')]);router[_0x9c6a('0xd')](_0x9c6a('0x8'),auth[_0x9c6a('0x7')](),controller[_0x9c6a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x79c6=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index'];(function(_0x3fb25f,_0x4b35a3){var _0x5ea642=function(_0x3ee03e){while(--_0x3ee03e){_0x3fb25f['push'](_0x3fb25f['shift']());}};_0x5ea642(++_0x4b35a3);}(_0x79c6,0x158));var _0x679c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x79c6[_0x1da527];return _0x40fc7c;};'use strict';var multer=require(_0x679c('0x0'));var util=require(_0x679c('0x1'));var path=require(_0x679c('0x2'));var timeout=require('connect-timeout');var express=require(_0x679c('0x3'));var router=express[_0x679c('0x4')]();var fs_extra=require(_0x679c('0x5'));var auth=require(_0x679c('0x6'));var interaction=require(_0x679c('0x7'));var config=require(_0x679c('0x8'));var controller=require(_0x679c('0x9'));router[_0x679c('0xa')]('/',auth[_0x679c('0xb')](),controller[_0x679c('0xc')]);router[_0x679c('0xa')](_0x679c('0xd'),auth[_0x679c('0xb')](),controller[_0x679c('0xe')]);router[_0x679c('0xf')]('/',auth[_0x679c('0xb')](),controller[_0x679c('0x10')]);router['put'](_0x679c('0xd'),auth['isAuthenticated'](),controller[_0x679c('0x11')]);router[_0x679c('0x12')](_0x679c('0xd'),auth[_0x679c('0xb')](),controller[_0x679c('0x13')]);module[_0x679c('0x14')]=router;
\ No newline at end of file
index 11d329b..fb1a7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a73=['name','sequelize','exports','STRING'];(function(_0x23b65e,_0x5a54ba){var _0xddd6fd=function(_0x339cfb){while(--_0x339cfb){_0x23b65e['push'](_0x23b65e['shift']());}};_0xddd6fd(++_0x5a54ba);}(_0x8a73,0xe1));var _0x38a7=function(_0x42bd88,_0x2e0120){_0x42bd88=_0x42bd88-0x0;var _0x545142=_0x8a73[_0x42bd88];return _0x545142;};'use strict';var Sequelize=require(_0x38a7('0x0'));module[_0x38a7('0x1')]={'name':{'type':Sequelize[_0x38a7('0x2')],'unique':_0x38a7('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x38a7('0x2')]}};
\ No newline at end of file
+var _0x2aff=['name','sequelize'];(function(_0x23fb07,_0xff70bc){var _0x950061=function(_0x917cb9){while(--_0x917cb9){_0x23fb07['push'](_0x23fb07['shift']());}};_0x950061(++_0xff70bc);}(_0x2aff,0x1ad));var _0xf2af=function(_0x456a88,_0x73be2f){_0x456a88=_0x456a88-0x0;var _0x28b76b=_0x2aff[_0x456a88];return _0x28b76b;};'use strict';var Sequelize=require(_0xf2af('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf2af('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 75e6b9f..6a63c5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0071=['request-promise','moment','bluebird','util','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','Pauses','sendStatus','error','stack','name','send','index','map','Pause','rawAttributes','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','rimraf','zip-dir','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0071,0x19c));var _0x1007=function(_0xcadb77,_0x87039e){_0xcadb77=_0xcadb77-0x0;var _0x540ae1=_0x0071[_0xcadb77];return _0x540ae1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1007('0x0'));var zipdir=require(_0x1007('0x1'));var jsonpatch=require(_0x1007('0x2'));var rp=require(_0x1007('0x3'));var moment=require(_0x1007('0x4'));var BPromise=require(_0x1007('0x5'));var Mustache=require('mustache');var util=require(_0x1007('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1007('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1007('0x8'));var squel=require('squel');var crypto=require(_0x1007('0x9'));var jsforce=require(_0x1007('0xa'));var deskjs=require(_0x1007('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1007('0xc'));var Redis=require(_0x1007('0xd'));var authService=require(_0x1007('0xe'));var qs=require(_0x1007('0xf'));var as=require(_0x1007('0x10'));var hardwareService=require(_0x1007('0x11'));var logger=require(_0x1007('0x12'))(_0x1007('0x13'));var utils=require(_0x1007('0x14'));var config=require(_0x1007('0x15'));var licenseUtil=require(_0x1007('0x16'));var db=require(_0x1007('0x17'))['db'];function respondWithStatusCode(_0x17af60,_0x2664a9){_0x2664a9=_0x2664a9||0xcc;return function(_0x2ce594){if(_0x2ce594){return _0x17af60['sendStatus'](_0x2664a9);}return _0x17af60[_0x1007('0x18')](_0x2664a9)[_0x1007('0x19')]();};}function respondWithResult(_0xc3dad5,_0x3de126){_0x3de126=_0x3de126||0xc8;return function(_0x3d69e6){if(_0x3d69e6){return _0xc3dad5[_0x1007('0x18')](_0x3de126)['json'](_0x3d69e6);}};}function respondWithFilteredResult(_0x4459b1,_0x160bdd){return function(_0x5191f4){if(_0x5191f4){var _0x5c4be5=typeof _0x160bdd[_0x1007('0x1a')]===_0x1007('0x1b')&&typeof _0x160bdd['limit']===_0x1007('0x1b');var _0x2fa4bb=_0x5191f4[_0x1007('0x1c')];var _0x22b116=_0x5c4be5?0x0:_0x160bdd[_0x1007('0x1a')];var _0x115d7c=_0x5c4be5?_0x5191f4['count']:_0x160bdd['offset']+_0x160bdd[_0x1007('0x1d')];var _0x187165;if(_0x115d7c>=_0x2fa4bb){_0x115d7c=_0x2fa4bb;_0x187165=0xc8;}else{_0x187165=0xce;}_0x4459b1[_0x1007('0x18')](_0x187165);return _0x4459b1[_0x1007('0x1e')](_0x1007('0x1f'),_0x22b116+'-'+_0x115d7c+'/'+_0x2fa4bb)['json'](_0x5191f4);}return null;};}function patchUpdates(_0x3193cd){return function(_0x20b3e3){try{jsonpatch[_0x1007('0x20')](_0x20b3e3,_0x3193cd,!![]);}catch(_0x808028){return BPromise[_0x1007('0x21')](_0x808028);}return _0x20b3e3[_0x1007('0x22')]();};}function saveUpdates(_0x575b8d,_0x409e39){return function(_0x5b501d){if(_0x5b501d){return _0x5b501d['update'](_0x575b8d)[_0x1007('0x23')](function(_0x385334){return _0x385334;});}return null;};}function removeEntity(_0x2249af,_0x508d5d){return function(_0x5478ff){if(_0x5478ff){return _0x5478ff[_0x1007('0x24')]()[_0x1007('0x23')](function(){var _0x2e9bbe=_0x5478ff[_0x1007('0x25')]({'plain':!![]});var _0x3a8394=_0x1007('0x26');return db['UserProfileResource'][_0x1007('0x24')]({'where':{'type':_0x3a8394,'resourceId':_0x2e9bbe['id']}})['then'](function(){return _0x5478ff;});})[_0x1007('0x23')](function(){_0x2249af[_0x1007('0x18')](0xcc)[_0x1007('0x19')]();});}};}function handleEntityNotFound(_0x306d77,_0x3fe7b8){return function(_0x5ad50a){if(!_0x5ad50a){_0x306d77[_0x1007('0x27')](0x194);}return _0x5ad50a;};}function handleError(_0x2252d9,_0xcf54c3){_0xcf54c3=_0xcf54c3||0x1f4;return function(_0xc4df81){logger[_0x1007('0x28')](_0xc4df81[_0x1007('0x29')]);if(_0xc4df81[_0x1007('0x2a')]){delete _0xc4df81[_0x1007('0x2a')];}_0x2252d9[_0x1007('0x18')](_0xcf54c3)[_0x1007('0x2b')](_0xc4df81);};}exports[_0x1007('0x2c')]=function(_0x5a5185,_0x59a6c3){var _0x3a3042={},_0x43eecc={},_0x35d068={'count':0x0,'rows':[]};var _0x1a0494=_[_0x1007('0x2d')](db[_0x1007('0x2e')][_0x1007('0x2f')],function(_0x20739f){return{'name':_0x20739f['fieldName'],'type':_0x20739f['type'][_0x1007('0x30')]};});_0x43eecc[_0x1007('0x31')]=_[_0x1007('0x2d')](_0x1a0494,_0x1007('0x2a'));_0x43eecc['query']=_['keys'](_0x5a5185[_0x1007('0x32')]);_0x43eecc['filters']=_['intersection'](_0x43eecc[_0x1007('0x31')],_0x43eecc[_0x1007('0x32')]);_0x3a3042[_0x1007('0x33')]=_[_0x1007('0x34')](_0x43eecc[_0x1007('0x31')],qs[_0x1007('0x35')](_0x5a5185[_0x1007('0x32')][_0x1007('0x35')]));_0x3a3042[_0x1007('0x33')]=_0x3a3042[_0x1007('0x33')][_0x1007('0x36')]?_0x3a3042['attributes']:_0x43eecc['model'];if(!_0x5a5185['query'][_0x1007('0x37')]('nolimit')){_0x3a3042[_0x1007('0x1d')]=qs['limit'](_0x5a5185['query'][_0x1007('0x1d')]);_0x3a3042[_0x1007('0x1a')]=qs[_0x1007('0x1a')](_0x5a5185[_0x1007('0x32')][_0x1007('0x1a')]);}_0x3a3042[_0x1007('0x38')]=qs[_0x1007('0x39')](_0x5a5185['query'][_0x1007('0x39')]);_0x3a3042['where']=qs['filters'](_[_0x1007('0x3a')](_0x5a5185[_0x1007('0x32')],_0x43eecc[_0x1007('0x3b')]),_0x1a0494);if(_0x5a5185[_0x1007('0x32')][_0x1007('0x3c')]){_0x3a3042[_0x1007('0x3d')]=_[_0x1007('0x3e')](_0x3a3042[_0x1007('0x3d')],{'$or':_[_0x1007('0x2d')](_0x1a0494,function(_0x5cc9e0){if(_0x5cc9e0['type']!==_0x1007('0x3f')){var _0x4b8ed1={};_0x4b8ed1[_0x5cc9e0[_0x1007('0x2a')]]={'$like':'%'+_0x5a5185['query']['filter']+'%'};return _0x4b8ed1;}})});}_0x3a3042=_['merge']({},_0x3a3042,_0x5a5185[_0x1007('0x40')]);var _0xc3c02b={'where':_0x3a3042[_0x1007('0x3d')]};return db[_0x1007('0x2e')][_0x1007('0x1c')](_0xc3c02b)[_0x1007('0x23')](function(_0x2d26da){_0x35d068[_0x1007('0x1c')]=_0x2d26da;if(_0x5a5185[_0x1007('0x32')][_0x1007('0x41')]){_0x3a3042[_0x1007('0x42')]=[{'all':!![]}];}return db['Pause'][_0x1007('0x43')](_0x3a3042);})[_0x1007('0x23')](function(_0x3d1d0d){_0x35d068[_0x1007('0x44')]=_0x3d1d0d;return _0x35d068;})[_0x1007('0x23')](respondWithFilteredResult(_0x59a6c3,_0x3a3042))[_0x1007('0x45')](handleError(_0x59a6c3,null));};exports[_0x1007('0x46')]=function(_0x26fe5d,_0xd8544e){var _0x21edd0={'raw':!![],'where':{'id':_0x26fe5d['params']['id']}},_0xd8462b={};_0xd8462b[_0x1007('0x31')]=_[_0x1007('0x47')](db[_0x1007('0x2e')]['rawAttributes']);_0xd8462b['query']=_['keys'](_0x26fe5d[_0x1007('0x32')]);_0xd8462b[_0x1007('0x3b')]=_[_0x1007('0x34')](_0xd8462b[_0x1007('0x31')],_0xd8462b[_0x1007('0x32')]);_0x21edd0[_0x1007('0x33')]=_[_0x1007('0x34')](_0xd8462b['model'],qs[_0x1007('0x35')](_0x26fe5d[_0x1007('0x32')]['fields']));_0x21edd0[_0x1007('0x33')]=_0x21edd0[_0x1007('0x33')][_0x1007('0x36')]?_0x21edd0[_0x1007('0x33')]:_0xd8462b['model'];if(_0x26fe5d['query']['includeAll']){_0x21edd0[_0x1007('0x42')]=[{'all':!![]}];}_0x21edd0=_[_0x1007('0x3e')]({},_0x21edd0,_0x26fe5d['options']);return db[_0x1007('0x2e')][_0x1007('0x48')](_0x21edd0)[_0x1007('0x23')](handleEntityNotFound(_0xd8544e,null))['then'](respondWithResult(_0xd8544e,null))[_0x1007('0x45')](handleError(_0xd8544e,null));};exports[_0x1007('0x49')]=function(_0x5684bc,_0x35fa6a){return db['Pause'][_0x1007('0x49')](_0x5684bc[_0x1007('0x4a')],{})['then'](function(_0x10aca2){var _0x3ba900=_0x5684bc[_0x1007('0x4b')][_0x1007('0x25')]({'plain':!![]});if(!_0x3ba900)throw new Error(_0x1007('0x4c'));if(_0x3ba900['role']==='user'){var _0x5e1842=_0x10aca2[_0x1007('0x25')]({'plain':!![]});var _0x326bde=_0x1007('0x26');return db[_0x1007('0x4d')]['find']({'where':{'name':_0x326bde,'userProfileId':_0x3ba900['userProfileId']},'raw':!![]})[_0x1007('0x23')](function(_0xdae89){if(_0xdae89&&_0xdae89[_0x1007('0x4e')]===0x0){return db[_0x1007('0x4f')][_0x1007('0x49')]({'name':_0x5e1842['name'],'resourceId':_0x5e1842['id'],'type':_0xdae89['name'],'sectionId':_0xdae89['id']},{})['then'](function(){return _0x10aca2;});}else{return _0x10aca2;}})['catch'](function(_0x29979){logger[_0x1007('0x28')](_0x1007('0x50'),_0x29979);throw _0x29979;});}return _0x10aca2;})[_0x1007('0x23')](respondWithResult(_0x35fa6a,0xc9))[_0x1007('0x45')](handleError(_0x35fa6a,null));};exports[_0x1007('0x51')]=function(_0x5869f3,_0x596d0b){if(_0x5869f3[_0x1007('0x4a')]['id']){delete _0x5869f3[_0x1007('0x4a')]['id'];}return db[_0x1007('0x2e')][_0x1007('0x48')]({'where':{'id':_0x5869f3[_0x1007('0x52')]['id']}})['then'](handleEntityNotFound(_0x596d0b,null))[_0x1007('0x23')](saveUpdates(_0x5869f3[_0x1007('0x4a')],null))[_0x1007('0x23')](respondWithResult(_0x596d0b,null))[_0x1007('0x45')](handleError(_0x596d0b,null));};exports[_0x1007('0x24')]=function(_0x509e3a,_0x16cec3){return db[_0x1007('0x2e')]['find']({'where':{'id':_0x509e3a['params']['id']}})[_0x1007('0x23')](handleEntityNotFound(_0x16cec3,null))[_0x1007('0x23')](removeEntity(_0x16cec3,null))['catch'](handleError(_0x16cec3,null));};
\ No newline at end of file
+var _0x84e9=['index','map','Pause','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','params','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','Pauses','name'];(function(_0x641afe,_0x22d726){var _0x2dfe9a=function(_0x33a370){while(--_0x33a370){_0x641afe['push'](_0x641afe['shift']());}};_0x2dfe9a(++_0x22d726);}(_0x84e9,0x108));var _0x984e=function(_0x5ebaff,_0x27caaa){_0x5ebaff=_0x5ebaff-0x0;var _0x4b2871=_0x84e9[_0x5ebaff];return _0x4b2871;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x984e('0x0'));var jsonpatch=require(_0x984e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x984e('0x2'));var Mustache=require(_0x984e('0x3'));var util=require('util');var path=require(_0x984e('0x4'));var sox=require(_0x984e('0x5'));var csv=require(_0x984e('0x6'));var ejs=require(_0x984e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x984e('0x8'));var crypto=require(_0x984e('0x9'));var jsforce=require(_0x984e('0xa'));var deskjs=require(_0x984e('0xb'));var toCsv=require(_0x984e('0x6'));var querystring=require(_0x984e('0xc'));var Papa=require('papaparse');var Redis=require(_0x984e('0xd'));var authService=require(_0x984e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x984e('0xf'));var hardwareService=require(_0x984e('0x10'));var logger=require(_0x984e('0x11'))(_0x984e('0x12'));var utils=require(_0x984e('0x13'));var config=require(_0x984e('0x14'));var licenseUtil=require(_0x984e('0x15'));var db=require(_0x984e('0x16'))['db'];function respondWithStatusCode(_0x7e92c8,_0xc8ebd1){_0xc8ebd1=_0xc8ebd1||0xcc;return function(_0x2d54c){if(_0x2d54c){return _0x7e92c8[_0x984e('0x17')](_0xc8ebd1);}return _0x7e92c8[_0x984e('0x18')](_0xc8ebd1)[_0x984e('0x19')]();};}function respondWithResult(_0x36fad2,_0x4835a7){_0x4835a7=_0x4835a7||0xc8;return function(_0x55537f){if(_0x55537f){return _0x36fad2[_0x984e('0x18')](_0x4835a7)[_0x984e('0x1a')](_0x55537f);}};}function respondWithFilteredResult(_0x307544,_0x2b6237){return function(_0x27efe3){if(_0x27efe3){var _0x4124a1=typeof _0x2b6237['offset']==='undefined'&&typeof _0x2b6237[_0x984e('0x1b')]==='undefined';var _0x4915f0=_0x27efe3[_0x984e('0x1c')];var _0x37a768=_0x4124a1?0x0:_0x2b6237[_0x984e('0x1d')];var _0x318c39=_0x4124a1?_0x27efe3[_0x984e('0x1c')]:_0x2b6237[_0x984e('0x1d')]+_0x2b6237['limit'];var _0x5cb608;if(_0x318c39>=_0x4915f0){_0x318c39=_0x4915f0;_0x5cb608=0xc8;}else{_0x5cb608=0xce;}_0x307544[_0x984e('0x18')](_0x5cb608);return _0x307544[_0x984e('0x1e')](_0x984e('0x1f'),_0x37a768+'-'+_0x318c39+'/'+_0x4915f0)['json'](_0x27efe3);}return null;};}function patchUpdates(_0x41e7c6){return function(_0x44d01b){try{jsonpatch[_0x984e('0x20')](_0x44d01b,_0x41e7c6,!![]);}catch(_0x3e5519){return BPromise[_0x984e('0x21')](_0x3e5519);}return _0x44d01b[_0x984e('0x22')]();};}function saveUpdates(_0x43e921,_0x1475aa){return function(_0x2d6f38){if(_0x2d6f38){return _0x2d6f38['update'](_0x43e921)[_0x984e('0x23')](function(_0x13179a){return _0x13179a;});}return null;};}function removeEntity(_0x54b935,_0x2aeab5){return function(_0x4dac1c){if(_0x4dac1c){return _0x4dac1c[_0x984e('0x24')]()[_0x984e('0x23')](function(){var _0x17dfa5=_0x4dac1c[_0x984e('0x25')]({'plain':!![]});var _0x5e2ece=_0x984e('0x26');return db['UserProfileResource'][_0x984e('0x24')]({'where':{'type':_0x5e2ece,'resourceId':_0x17dfa5['id']}})[_0x984e('0x23')](function(){return _0x4dac1c;});})[_0x984e('0x23')](function(){_0x54b935[_0x984e('0x18')](0xcc)[_0x984e('0x19')]();});}};}function handleEntityNotFound(_0x13d9fa,_0x266453){return function(_0xddb545){if(!_0xddb545){_0x13d9fa['sendStatus'](0x194);}return _0xddb545;};}function handleError(_0x238a3f,_0x17a272){_0x17a272=_0x17a272||0x1f4;return function(_0x5e5bc8){logger['error'](_0x5e5bc8['stack']);if(_0x5e5bc8['name']){delete _0x5e5bc8[_0x984e('0x27')];}_0x238a3f[_0x984e('0x18')](_0x17a272)['send'](_0x5e5bc8);};}exports[_0x984e('0x28')]=function(_0x194345,_0x59acf9){var _0x3e17b0={},_0x3b07ac={},_0x262bd2={'count':0x0,'rows':[]};var _0x42541c=_[_0x984e('0x29')](db[_0x984e('0x2a')]['rawAttributes'],function(_0x381456){return{'name':_0x381456[_0x984e('0x2b')],'type':_0x381456[_0x984e('0x2c')][_0x984e('0x2d')]};});_0x3b07ac[_0x984e('0x2e')]=_[_0x984e('0x29')](_0x42541c,_0x984e('0x27'));_0x3b07ac[_0x984e('0x2f')]=_[_0x984e('0x30')](_0x194345[_0x984e('0x2f')]);_0x3b07ac['filters']=_[_0x984e('0x31')](_0x3b07ac[_0x984e('0x2e')],_0x3b07ac[_0x984e('0x2f')]);_0x3e17b0[_0x984e('0x32')]=_[_0x984e('0x31')](_0x3b07ac[_0x984e('0x2e')],qs[_0x984e('0x33')](_0x194345[_0x984e('0x2f')][_0x984e('0x33')]));_0x3e17b0['attributes']=_0x3e17b0[_0x984e('0x32')][_0x984e('0x34')]?_0x3e17b0[_0x984e('0x32')]:_0x3b07ac[_0x984e('0x2e')];if(!_0x194345[_0x984e('0x2f')][_0x984e('0x35')]('nolimit')){_0x3e17b0[_0x984e('0x1b')]=qs[_0x984e('0x1b')](_0x194345[_0x984e('0x2f')][_0x984e('0x1b')]);_0x3e17b0[_0x984e('0x1d')]=qs[_0x984e('0x1d')](_0x194345[_0x984e('0x2f')][_0x984e('0x1d')]);}_0x3e17b0[_0x984e('0x36')]=qs[_0x984e('0x37')](_0x194345['query'][_0x984e('0x37')]);_0x3e17b0['where']=qs[_0x984e('0x38')](_[_0x984e('0x39')](_0x194345[_0x984e('0x2f')],_0x3b07ac['filters']),_0x42541c);if(_0x194345['query'][_0x984e('0x3a')]){_0x3e17b0[_0x984e('0x3b')]=_['merge'](_0x3e17b0[_0x984e('0x3b')],{'$or':_[_0x984e('0x29')](_0x42541c,function(_0x1a2f33){if(_0x1a2f33['type']!=='VIRTUAL'){var _0x43ddb6={};_0x43ddb6[_0x1a2f33[_0x984e('0x27')]]={'$like':'%'+_0x194345[_0x984e('0x2f')][_0x984e('0x3a')]+'%'};return _0x43ddb6;}})});}_0x3e17b0=_[_0x984e('0x3c')]({},_0x3e17b0,_0x194345[_0x984e('0x3d')]);var _0x5a0989={'where':_0x3e17b0[_0x984e('0x3b')]};return db[_0x984e('0x2a')]['count'](_0x5a0989)[_0x984e('0x23')](function(_0x1a69a4){_0x262bd2['count']=_0x1a69a4;if(_0x194345[_0x984e('0x2f')][_0x984e('0x3e')]){_0x3e17b0[_0x984e('0x3f')]=[{'all':!![]}];}return db[_0x984e('0x2a')]['findAll'](_0x3e17b0);})[_0x984e('0x23')](function(_0x32618d){_0x262bd2['rows']=_0x32618d;return _0x262bd2;})['then'](respondWithFilteredResult(_0x59acf9,_0x3e17b0))['catch'](handleError(_0x59acf9,null));};exports['show']=function(_0x4a9753,_0x527369){var _0x16ce3b={'raw':!![],'where':{'id':_0x4a9753[_0x984e('0x40')]['id']}},_0x1dcdb3={};_0x1dcdb3[_0x984e('0x2e')]=_[_0x984e('0x30')](db[_0x984e('0x2a')][_0x984e('0x41')]);_0x1dcdb3['query']=_[_0x984e('0x30')](_0x4a9753['query']);_0x1dcdb3[_0x984e('0x38')]=_[_0x984e('0x31')](_0x1dcdb3[_0x984e('0x2e')],_0x1dcdb3[_0x984e('0x2f')]);_0x16ce3b['attributes']=_[_0x984e('0x31')](_0x1dcdb3[_0x984e('0x2e')],qs[_0x984e('0x33')](_0x4a9753[_0x984e('0x2f')][_0x984e('0x33')]));_0x16ce3b[_0x984e('0x32')]=_0x16ce3b[_0x984e('0x32')][_0x984e('0x34')]?_0x16ce3b['attributes']:_0x1dcdb3[_0x984e('0x2e')];if(_0x4a9753[_0x984e('0x2f')][_0x984e('0x3e')]){_0x16ce3b[_0x984e('0x3f')]=[{'all':!![]}];}_0x16ce3b=_[_0x984e('0x3c')]({},_0x16ce3b,_0x4a9753[_0x984e('0x3d')]);return db[_0x984e('0x2a')][_0x984e('0x42')](_0x16ce3b)[_0x984e('0x23')](handleEntityNotFound(_0x527369,null))['then'](respondWithResult(_0x527369,null))[_0x984e('0x43')](handleError(_0x527369,null));};exports[_0x984e('0x44')]=function(_0x1b0a13,_0x278ad5){return db[_0x984e('0x2a')][_0x984e('0x44')](_0x1b0a13[_0x984e('0x45')],{})[_0x984e('0x23')](function(_0x2c2786){var _0x39ac2e=_0x1b0a13['user'][_0x984e('0x25')]({'plain':!![]});if(!_0x39ac2e)throw new Error(_0x984e('0x46'));if(_0x39ac2e['role']==='user'){var _0x5e9943=_0x2c2786[_0x984e('0x25')]({'plain':!![]});var _0x3d83e7=_0x984e('0x26');return db[_0x984e('0x47')][_0x984e('0x42')]({'where':{'name':_0x3d83e7,'userProfileId':_0x39ac2e[_0x984e('0x48')]},'raw':!![]})[_0x984e('0x23')](function(_0x582766){if(_0x582766&&_0x582766['autoAssociation']===0x0){return db[_0x984e('0x49')][_0x984e('0x44')]({'name':_0x5e9943[_0x984e('0x27')],'resourceId':_0x5e9943['id'],'type':_0x582766[_0x984e('0x27')],'sectionId':_0x582766['id']},{})[_0x984e('0x23')](function(){return _0x2c2786;});}else{return _0x2c2786;}})[_0x984e('0x43')](function(_0x4f1a1e){logger['error'](_0x984e('0x4a'),_0x4f1a1e);throw _0x4f1a1e;});}return _0x2c2786;})[_0x984e('0x23')](respondWithResult(_0x278ad5,0xc9))['catch'](handleError(_0x278ad5,null));};exports[_0x984e('0x4b')]=function(_0x2c6e9e,_0x37147a){if(_0x2c6e9e[_0x984e('0x45')]['id']){delete _0x2c6e9e[_0x984e('0x45')]['id'];}return db['Pause'][_0x984e('0x42')]({'where':{'id':_0x2c6e9e[_0x984e('0x40')]['id']}})[_0x984e('0x23')](handleEntityNotFound(_0x37147a,null))[_0x984e('0x23')](saveUpdates(_0x2c6e9e[_0x984e('0x45')],null))['then'](respondWithResult(_0x37147a,null))[_0x984e('0x43')](handleError(_0x37147a,null));};exports['destroy']=function(_0x5119b9,_0x4d18ea){return db[_0x984e('0x2a')][_0x984e('0x42')]({'where':{'id':_0x5119b9[_0x984e('0x40')]['id']}})[_0x984e('0x23')](handleEntityNotFound(_0x4d18ea,null))[_0x984e('0x23')](removeEntity(_0x4d18ea,null))[_0x984e('0x43')](handleError(_0x4d18ea,null));};
\ No newline at end of file
index c08b0e8..02ab937 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x1c1f09,_0x5ef7d2){var _0x5e449e=function(_0xcaa5a){while(--_0xcaa5a){_0x1c1f09['push'](_0x1c1f09['shift']());}};_0x5e449e(++_0x5ef7d2);}(_0x326f,0xd1));var _0xf326=function(_0x5570af,_0x56e352){_0x5570af=_0x5570af-0x0;var _0x38b434=_0x326f[_0x5570af];return _0x38b434;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0xe4cf0a,_0x298c16){var _0xa09b61=function(_0x2946e3){while(--_0x2946e3){_0xe4cf0a['push'](_0xe4cf0a['shift']());}};_0xa09b61(++_0x298c16);}(_0x814b,0x1a2));var _0xb814=function(_0x5016c9,_0x57cdf0){_0x5016c9=_0x5016c9-0x0;var _0x5371ee=_0x814b[_0x5016c9];return _0x5371ee;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b6414e0..bcba72c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x216905,_0x106b0b){var _0x4d5cd1=function(_0x46d419){while(--_0x46d419){_0x216905['push'](_0x216905['shift']());}};_0x4d5cd1(++_0x106b0b);}(_0x7a54,0x106));var _0x47a5=function(_0x395a08,_0x56f13f){_0x395a08=_0x395a08-0x0;var _0x32d417=_0x7a54[_0x395a08];return _0x32d417;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x44bf35,_0x551681){var _0x2e7733=function(_0x448c84){while(--_0x448c84){_0x44bf35['push'](_0x44bf35['shift']());}};_0x2e7733(++_0x551681);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c70d0,_0xfeac42){_0x5c70d0=_0x5c70d0-0x0;var _0x484491=_0xb10b[_0x5c70d0];return _0x484491;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
index 8b8e75e..90cf2c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2123=['join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','isAuthenticated','show','/:id/download','diskStorage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2123,0x190));var _0x3212=function(_0x307a68,_0x3991c5){_0x307a68=_0x307a68-0x0;var _0x5d23fd=_0x2123[_0x307a68];return _0x5d23fd;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),controller['webhookGet']);router[_0x3212('0xb')]('/:id',auth[_0x3212('0xe')](),controller[_0x3212('0xf')]);router[_0x3212('0xb')](_0x3212('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x3212('0x11')]({'destination':function(_0xf166c2,_0x1a3b2f,_0x23f7e3){_0x23f7e3(null,path[_0x3212('0x12')](config[_0x3212('0x13')],_0x3212('0x14')));},'filename':function(_0x359cef,_0x26c1c8,_0x2d5fce){_0x26c1c8[_0x3212('0x15')]=_0x26c1c8[_0x3212('0x15')][_0x3212('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d5fce(null,util[_0x3212('0x17')](_0x3212('0x18'),path[_0x3212('0x19')](_0x26c1c8[_0x3212('0x15')],path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])),Date[_0x3212('0x1b')](),path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])));}})});router['post']('/',upload[_0x3212('0x1c')](_0x3212('0x1d')),controller[_0x3212('0x1e')]);router[_0x3212('0x1f')](_0x3212('0xd'),controller[_0x3212('0x20')]);router[_0x3212('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x3212('0x22')]);router['delete'](_0x3212('0x23'),auth[_0x3212('0xe')](),controller[_0x3212('0x24')]);module[_0x3212('0x25')]=router;
\ No newline at end of file
+var _0x668b=['fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/webhook','webhookGet','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','webhookPost','put','update','/:id','delete','exports','multer','util','connect-timeout','express'];(function(_0xd14b9a,_0x5d0192){var _0x4fd672=function(_0x1e6afe){while(--_0x1e6afe){_0xd14b9a['push'](_0xd14b9a['shift']());}};_0x4fd672(++_0x5d0192);}(_0x668b,0x140));var _0xb668=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0x668b[_0xccf869];return _0x21a9db;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require('path');var timeout=require(_0xb668('0x2'));var express=require(_0xb668('0x3'));var router=express['Router']();var fs_extra=require(_0xb668('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var controller=require(_0xb668('0x7'));router['get']('/',auth[_0xb668('0x8')](),controller[_0xb668('0x9')]);router[_0xb668('0xa')](_0xb668('0xb'),controller[_0xb668('0xc')]);router[_0xb668('0xa')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0xd')]);router[_0xb668('0xa')](_0xb668('0xe'),auth[_0xb668('0x8')](),controller[_0xb668('0xf')]);var upload=multer({'storage':multer[_0xb668('0x10')]({'destination':function(_0x3616e9,_0x567ea9,_0x3b15a6){_0x3b15a6(null,path[_0xb668('0x11')](config[_0xb668('0x12')],_0xb668('0x13')));},'filename':function(_0x16ca75,_0x167057,_0x1d111a){_0x167057[_0xb668('0x14')]=_0x167057[_0xb668('0x14')][_0xb668('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d111a(null,util[_0xb668('0x16')](_0xb668('0x17'),path[_0xb668('0x18')](_0x167057[_0xb668('0x14')],path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])),Date[_0xb668('0x1a')](),path[_0xb668('0x19')](_0x167057[_0xb668('0x14')])));}})});router[_0xb668('0x1b')]('/',upload[_0xb668('0x1c')](_0xb668('0x1d')),controller['upload']);router[_0xb668('0x1b')]('/webhook',controller[_0xb668('0x1e')]);router[_0xb668('0x1f')]('/:id',auth[_0xb668('0x8')](),controller[_0xb668('0x20')]);router['delete'](_0xb668('0x21'),auth['isAuthenticated'](),controller[_0xb668('0x22')]);module[_0xb668('0x23')]=router;
\ No newline at end of file
index 332930b..4b6d650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x820a=['The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','TEXT','STRING'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x820a,0x187));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xa820('0x0'));module[_0xa820('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xa820('0x2'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xa820('0x3')]},'path':{'type':Sequelize[_0xa820('0x4')],'comment':_0xa820('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa820('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0xa820('0x7'),_0xa820('0x8'),_0xa820('0x9'),_0xa820('0xa')),'defaultValue':_0xa820('0x9'),'comment':_0xa820('0xb')},'icon':{'type':Sequelize[_0xa820('0x4')]},'adminUrl':{'type':Sequelize[_0xa820('0x4')]},'agentUrl':{'type':Sequelize[_0xa820('0x4')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xa820('0x4')]}};
\ No newline at end of file
+var _0xb3f3=['exports','STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0xb38a96,_0xfeb8f0){var _0x1a362a=function(_0x57d24a){while(--_0x57d24a){_0xb38a96['push'](_0xb38a96['shift']());}};_0x1a362a(++_0xfeb8f0);}(_0xb3f3,0x74));var _0x3b3f=function(_0x52bfa5,_0x42cf21){_0x52bfa5=_0x52bfa5-0x0;var _0x26f80b=_0xb3f3[_0x52bfa5];return _0x26f80b;};'use strict';var Sequelize=require(_0x3b3f('0x0'));module[_0x3b3f('0x1')]={'name':{'type':Sequelize[_0x3b3f('0x2')]},'type':{'type':Sequelize[_0x3b3f('0x3')](_0x3b3f('0x4'),_0x3b3f('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x3b3f('0x6')]},'path':{'type':Sequelize[_0x3b3f('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x3b3f('0x7')],'defaultValue':0x0,'comment':_0x3b3f('0x8')},'sidebar':{'type':Sequelize[_0x3b3f('0x3')](_0x3b3f('0x9'),_0x3b3f('0xa'),_0x3b3f('0xb'),'never'),'defaultValue':'always','comment':_0x3b3f('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x3b3f('0x2')]},'agentUrl':{'type':Sequelize[_0x3b3f('0x2')]},'scriptName':{'type':Sequelize[_0x3b3f('0x2')]},'scriptPath':{'type':Sequelize[_0x3b3f('0x2')]}};
\ No newline at end of file
index 18cca0f..3d031af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ed=['Plugins','end','error','stack','name','send','index','map','Plugin','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','include','findAll','catch','show','rawAttributes','includeAll','find','params','server/files/plugins','format','%s.zip','basename','zip','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','root','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','role','body','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','method','statusCode','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','extract-zip','rimraf','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get'];(function(_0x1a87bd,_0x51ea95){var _0x6a2313=function(_0x1aa260){while(--_0x1aa260){_0x1a87bd['push'](_0x1a87bd['shift']());}};_0x6a2313(++_0x51ea95);}(_0x60ed,0x1db));var _0xd60e=function(_0x4650ab,_0x25ec31){_0x4650ab=_0x4650ab-0x0;var _0x672ad4=_0x60ed[_0x4650ab];return _0x672ad4;};'use strict';var emlformat=require(_0xd60e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd60e('0x1'));var rp=require(_0xd60e('0x2'));var moment=require(_0xd60e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd60e('0x4'));var path=require(_0xd60e('0x5'));var sox=require(_0xd60e('0x6'));var csv=require(_0xd60e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd60e('0x8'));var squel=require(_0xd60e('0x9'));var crypto=require(_0xd60e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd60e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd60e('0xc'));var Papa=require('papaparse');var extract=require(_0xd60e('0xd'));var rimraf=require(_0xd60e('0xe'));var archiver=require(_0xd60e('0xf'));var Redis=require(_0xd60e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd60e('0x11'));var as=require(_0xd60e('0x12'));var hardwareService=require(_0xd60e('0x13'));var logger=require('../../config/logger')(_0xd60e('0x14'));var utils=require(_0xd60e('0x15'));var config=require(_0xd60e('0x16'));var licenseUtil=require(_0xd60e('0x17'));var db=require(_0xd60e('0x18'))['db'];config[_0xd60e('0x19')]=_[_0xd60e('0x1a')](config[_0xd60e('0x19')],{'host':_0xd60e('0x1b'),'port':0x18eb});var socket=require(_0xd60e('0x1c'))(new Redis(config['redis']));require(_0xd60e('0x1d'))[_0xd60e('0x1e')](socket);function respondWithStatusCode(_0x3cfc03,_0x3dbcbd){_0x3dbcbd=_0x3dbcbd||0xcc;return function(_0x3d66e6){if(_0x3d66e6){return _0x3cfc03[_0xd60e('0x1f')](_0x3dbcbd);}return _0x3cfc03[_0xd60e('0x20')](_0x3dbcbd)['end']();};}function respondWithResult(_0x3ad839,_0x4e49d9){_0x4e49d9=_0x4e49d9||0xc8;return function(_0x55fdac){if(_0x55fdac){return _0x3ad839['status'](_0x4e49d9)[_0xd60e('0x21')](_0x55fdac);}};}function respondWithFilteredResult(_0x12458c,_0x60c61f){return function(_0x13f887){if(_0x13f887){var _0x1cedad=typeof _0x60c61f['offset']===_0xd60e('0x22')&&typeof _0x60c61f['limit']===_0xd60e('0x22');var _0x5addb3=_0x13f887[_0xd60e('0x23')];var _0x4d529f=_0x1cedad?0x0:_0x60c61f['offset'];var _0x2754e5=_0x1cedad?_0x13f887[_0xd60e('0x23')]:_0x60c61f[_0xd60e('0x24')]+_0x60c61f[_0xd60e('0x25')];var _0x1253c9;if(_0x2754e5>=_0x5addb3){_0x2754e5=_0x5addb3;_0x1253c9=0xc8;}else{_0x1253c9=0xce;}_0x12458c[_0xd60e('0x20')](_0x1253c9);return _0x12458c[_0xd60e('0x26')](_0xd60e('0x27'),_0x4d529f+'-'+_0x2754e5+'/'+_0x5addb3)[_0xd60e('0x21')](_0x13f887);}return null;};}function patchUpdates(_0x4b20b3){return function(_0x3dc3a7){try{jsonpatch[_0xd60e('0x28')](_0x3dc3a7,_0x4b20b3,!![]);}catch(_0x256cdc){return BPromise[_0xd60e('0x29')](_0x256cdc);}return _0x3dc3a7[_0xd60e('0x2a')]();};}function saveUpdates(_0x364be2,_0x2009d6){return function(_0x14fed3){if(_0x14fed3){return _0x14fed3[_0xd60e('0x2b')](_0x364be2)[_0xd60e('0x2c')](function(_0x1b2947){return _0x1b2947;});}return null;};}function removeEntity(_0x4ed6fb,_0x1930d2){return function(_0x43f3c9){if(_0x43f3c9){return _0x43f3c9[_0xd60e('0x2d')]()['then'](function(){var _0x532c19=_0x43f3c9[_0xd60e('0x2e')]({'plain':!![]});var _0xdded74=_0xd60e('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0xdded74,'resourceId':_0x532c19['id']}})[_0xd60e('0x2c')](function(){return _0x43f3c9;});})[_0xd60e('0x2c')](function(){_0x4ed6fb[_0xd60e('0x20')](0xcc)[_0xd60e('0x30')]();});}};}function handleEntityNotFound(_0xa2c6ac,_0x476b56){return function(_0x226f37){if(!_0x226f37){_0xa2c6ac['sendStatus'](0x194);}return _0x226f37;};}function handleError(_0x318605,_0x161a82){_0x161a82=_0x161a82||0x1f4;return function(_0x2d4e16){logger[_0xd60e('0x31')](_0x2d4e16[_0xd60e('0x32')]);if(_0x2d4e16[_0xd60e('0x33')]){delete _0x2d4e16['name'];}_0x318605[_0xd60e('0x20')](_0x161a82)[_0xd60e('0x34')](_0x2d4e16);};}exports[_0xd60e('0x35')]=function(_0x228943,_0x3be3f8){var _0x577129={},_0x1b8b96={},_0xaf8856={'count':0x0,'rows':[]};var _0x13c3ef=_[_0xd60e('0x36')](db[_0xd60e('0x37')]['rawAttributes'],function(_0x55a509){return{'name':_0x55a509[_0xd60e('0x38')],'type':_0x55a509['type'][_0xd60e('0x39')]};});_0x1b8b96[_0xd60e('0x3a')]=_[_0xd60e('0x36')](_0x13c3ef,'name');_0x1b8b96[_0xd60e('0x3b')]=_[_0xd60e('0x3c')](_0x228943[_0xd60e('0x3b')]);_0x1b8b96[_0xd60e('0x3d')]=_[_0xd60e('0x3e')](_0x1b8b96[_0xd60e('0x3a')],_0x1b8b96['query']);_0x577129[_0xd60e('0x3f')]=_['intersection'](_0x1b8b96[_0xd60e('0x3a')],qs[_0xd60e('0x40')](_0x228943['query'][_0xd60e('0x40')]));_0x577129[_0xd60e('0x3f')]=_0x577129[_0xd60e('0x3f')][_0xd60e('0x41')]?_0x577129['attributes']:_0x1b8b96[_0xd60e('0x3a')];if(!_0x228943[_0xd60e('0x3b')][_0xd60e('0x42')](_0xd60e('0x43'))){_0x577129[_0xd60e('0x25')]=qs[_0xd60e('0x25')](_0x228943['query'][_0xd60e('0x25')]);_0x577129[_0xd60e('0x24')]=qs[_0xd60e('0x24')](_0x228943[_0xd60e('0x3b')]['offset']);}_0x577129[_0xd60e('0x44')]=qs['sort'](_0x228943['query'][_0xd60e('0x45')]);_0x577129[_0xd60e('0x46')]=qs[_0xd60e('0x3d')](_[_0xd60e('0x47')](_0x228943[_0xd60e('0x3b')],_0x1b8b96['filters']),_0x13c3ef);if(_0x228943[_0xd60e('0x3b')]['filter']){_0x577129['where']=_[_0xd60e('0x48')](_0x577129[_0xd60e('0x46')],{'$or':_['map'](_0x13c3ef,function(_0x39166a){if(_0x39166a[_0xd60e('0x49')]!=='VIRTUAL'){var _0x3cd0ab={};_0x3cd0ab[_0x39166a[_0xd60e('0x33')]]={'$like':'%'+_0x228943['query'][_0xd60e('0x4a')]+'%'};return _0x3cd0ab;}})});}_0x577129=_['merge']({},_0x577129,_0x228943[_0xd60e('0x4b')]);var _0x110e98={'where':_0x577129[_0xd60e('0x46')]};return db[_0xd60e('0x37')]['count'](_0x110e98)[_0xd60e('0x2c')](function(_0x7222cc){_0xaf8856[_0xd60e('0x23')]=_0x7222cc;if(_0x228943[_0xd60e('0x3b')]['includeAll']){_0x577129[_0xd60e('0x4c')]=[{'all':!![]}];}return db['Plugin'][_0xd60e('0x4d')](_0x577129);})[_0xd60e('0x2c')](function(_0x2336c2){_0xaf8856['rows']=_0x2336c2;return _0xaf8856;})[_0xd60e('0x2c')](respondWithFilteredResult(_0x3be3f8,_0x577129))[_0xd60e('0x4e')](handleError(_0x3be3f8,null));};exports[_0xd60e('0x4f')]=function(_0x51ce77,_0x2cddbf){var _0x5e868c={'raw':!![],'where':{'id':_0x51ce77['params']['id']}},_0x23ac7e={};_0x23ac7e[_0xd60e('0x3a')]=_['keys'](db[_0xd60e('0x37')][_0xd60e('0x50')]);_0x23ac7e[_0xd60e('0x3b')]=_[_0xd60e('0x3c')](_0x51ce77['query']);_0x23ac7e['filters']=_[_0xd60e('0x3e')](_0x23ac7e[_0xd60e('0x3a')],_0x23ac7e[_0xd60e('0x3b')]);_0x5e868c[_0xd60e('0x3f')]=_[_0xd60e('0x3e')](_0x23ac7e[_0xd60e('0x3a')],qs[_0xd60e('0x40')](_0x51ce77[_0xd60e('0x3b')][_0xd60e('0x40')]));_0x5e868c['attributes']=_0x5e868c['attributes'][_0xd60e('0x41')]?_0x5e868c['attributes']:_0x23ac7e['model'];if(_0x51ce77[_0xd60e('0x3b')][_0xd60e('0x51')]){_0x5e868c[_0xd60e('0x4c')]=[{'all':!![]}];}_0x5e868c=_['merge']({},_0x5e868c,_0x51ce77[_0xd60e('0x4b')]);return db[_0xd60e('0x37')][_0xd60e('0x52')](_0x5e868c)[_0xd60e('0x2c')](handleEntityNotFound(_0x2cddbf,null))[_0xd60e('0x2c')](respondWithResult(_0x2cddbf,null))[_0xd60e('0x4e')](handleError(_0x2cddbf,null));};exports['download']=function(_0x777529,_0x2af747,_0x3c2061){return db[_0xd60e('0x37')]['find']({'where':{'id':_0x777529[_0xd60e('0x53')]['id']},'attributes':[_0xd60e('0x33'),_0xd60e('0x5')],'raw':!![]})[_0xd60e('0x2c')](handleEntityNotFound(_0x2af747,null))[_0xd60e('0x2c')](function(_0x59b070){if(_0x59b070){var _0x5d596e=path['join'](config['root'],_0xd60e('0x54'),util[_0xd60e('0x55')](_0xd60e('0x56'),path[_0xd60e('0x57')](_0x59b070[_0xd60e('0x5')])));var _0x2f45ec=fs['createWriteStream'](_0x5d596e);var _0x725b5b=archiver(_0xd60e('0x58'),{'zlib':{'level':0x9}});_0x725b5b['on']('warning',function(_0x4158a5){if(_0x4158a5[_0xd60e('0x59')]===_0xd60e('0x5a')){logger['error'](_0x4158a5);}else{throw new db['Sequelize'][(_0xd60e('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x725b5b['on'](_0xd60e('0x31'),function(_0x1d1fd0){throw new db[(_0xd60e('0x5c'))][(_0xd60e('0x5b'))](_0xd60e('0x5d'));});_0x725b5b['pipe'](_0x2f45ec);_0x725b5b[_0xd60e('0x5e')](_0xd60e('0x5f'),{'cwd':path[_0xd60e('0x60')](config['root'],_0xd60e('0x54'),path[_0xd60e('0x61')](_0x59b070[_0xd60e('0x5')])),'ignore':[path[_0xd60e('0x60')](path[_0xd60e('0x57')](_0x59b070[_0xd60e('0x5')]),_0xd60e('0x62')),path['join'](path[_0xd60e('0x57')](_0x59b070['path']),_0xd60e('0x63'))],'nodir':!![]})['finalize']();_0x2f45ec['on']('close',function(){if(!fs[_0xd60e('0x64')](_0x5d596e)){throw new db[(_0xd60e('0x5c'))][(_0xd60e('0x5b'))](_0xd60e('0x65'));}return _0x2af747[_0xd60e('0x66')](_0x5d596e,util[_0xd60e('0x55')]('%s.zip',path[_0xd60e('0x57')](_0x59b070[_0xd60e('0x5')])),function(_0x3c14bb){if(_0x3c14bb){throw new db['Sequelize'][(_0xd60e('0x5b'))](_0xd60e('0x67'));}fs[_0xd60e('0x68')](_0x5d596e);logger[_0xd60e('0x69')](_0xd60e('0x6a'));logger[_0xd60e('0x69')](_0xd60e('0x6b'));});});}return null;})['catch'](handleError(_0x2af747,null));};exports[_0xd60e('0x6c')]=function(_0x50904d,_0x50f2ef,_0x50bb4e){var _0x11e13f=path[_0xd60e('0x57')](_0x50904d['file'][_0xd60e('0x6d')],path[_0xd60e('0x6e')](_0x50904d[_0xd60e('0x6f')][_0xd60e('0x6d')]));var _0x296619=path['join'](config[_0xd60e('0x70')],_0xd60e('0x54'),_0x50904d[_0xd60e('0x6f')]['filename']);var _0x5c157a=path[_0xd60e('0x60')](config[_0xd60e('0x70')],_0xd60e('0x54'),_0x11e13f);logger[_0xd60e('0x69')](_0xd60e('0x71'),_0x296619);logger[_0xd60e('0x69')](_0xd60e('0x72'),_0x5c157a);try{fs['chmodSync'](_0x296619,parseInt('0777',0x8));extract(_0x296619,{'dir':_0x5c157a},function(_0x46c8ec){if(_0x46c8ec){logger[_0xd60e('0x31')](_0x46c8ec);handleError(_0x46c8ec,!![]);};var _0x2e716a=fs[_0xd60e('0x73')](_0x5c157a);if(_0x2e716a[_0xd60e('0x41')]>0x1){removeReferences(_0x296619,_0x5c157a);logger[_0xd60e('0x31')](_0xd60e('0x74'));return _0x50bb4e(new Error(_0xd60e('0x74')));}var _0x1613a5=fs[_0xd60e('0x75')](path['join'](_0x5c157a,_0x2e716a[0x0]));if(_0x1613a5['isFile']()){removeReferences(_0x296619,_0x5c157a);logger[_0xd60e('0x31')](_0xd60e('0x74'));return _0x50bb4e(new Error(_0xd60e('0x74')));}if(_0x1613a5[_0xd60e('0x76')]()){var _0x3ebd0b=fs['readdirSync'](path[_0xd60e('0x60')](_0x5c157a,_0x2e716a[0x0]));if(_0x3ebd0b[_0xd60e('0x41')]===0x0){removeReferences(_0x296619,_0x5c157a);logger[_0xd60e('0x31')](_0xd60e('0x74'));return _0x50bb4e(new Error(_0xd60e('0x74')));}var _0xee3352=_0x3ebd0b['some'](function(_0x151129){return _0x151129===_0xd60e('0x77');});if(!_0xee3352){return _0x50bb4e(new Error(_0xd60e('0x78')));}var _0x29a939=fs['readFileSync'](path[_0xd60e('0x60')](_0x5c157a,_0x2e716a[0x0],_0xd60e('0x77')));var _0x1a9ae3=JSON[_0xd60e('0x79')](_0x29a939);if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x33')]){return _0x50bb4e(new Error(_0xd60e('0x7a')));}if(_0xd60e('0x22')==typeof _0x1a9ae3['type']){return _0x50bb4e(new Error(_0xd60e('0x7b')));}if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x7c')]){return _0x50bb4e(new Error(_0xd60e('0x7d')));}if(_0xd60e('0x22')==typeof _0x1a9ae3['parameters']){return _0x50bb4e(new Error(_0xd60e('0x7e')));}if(_0x1a9ae3[_0xd60e('0x49')]===_0xd60e('0x7f')){if('undefined'==typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')]){return _0x50bb4e(new Error(_0xd60e('0x82')));}if('undefined'==typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')][_0xd60e('0x83')]&&_0xd60e('0x22')==typeof _0x1a9ae3['parameters'][_0xd60e('0x81')][_0xd60e('0x84')]){return _0x50bb4e(new Error(_0xd60e('0x85')));}}else if(_0x1a9ae3[_0xd60e('0x49')]===_0xd60e('0x86')){if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x80')]['scriptName']){return _0x50bb4e(new Error(_0xd60e('0x87')));}if(_0xd60e('0x22')==typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x88')]){return _0x50bb4e(new Error(_0xd60e('0x89')));}}else{return _0x50bb4e(new Error(_0xd60e('0x8a')));}var _0x110c65=_0x1a9ae3[_0xd60e('0x33')];var _0x902c58=_0x1a9ae3[_0xd60e('0x8b')];var _0x405415=_0x1a9ae3[_0xd60e('0x49')];var _0xa34a5c=_0x1a9ae3[_0xd60e('0x8c')]?_0x1a9ae3['sidebar']:_0xd60e('0x8d');var _0x21df51=_0x1a9ae3[_0xd60e('0x8e')]?_0x1a9ae3['icon']:_0xd60e('0x8f');var _0x569bbe='';var _0x4afd5e='';var _0x458c8e='';var _0x38c450='';var _0x9b5e44=_0x1a9ae3['version'];if(_0x405415===_0xd60e('0x7f')){if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')]['views'][_0xd60e('0x83')]){var _0x2a7c2f=_0x1a9ae3[_0xd60e('0x80')]['views'][_0xd60e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xd60e('0x90')](_0x2a7c2f)){_0x569bbe=path[_0xd60e('0x60')](_0xd60e('0x91'),_0x11e13f,_0x2e716a[0x0],_0x2a7c2f);}else{_0x569bbe=_0x2a7c2f;}}else{logger[_0xd60e('0x69')](_0xd60e('0x92'));}if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')]['views'][_0xd60e('0x84')]){var _0x1da356=_0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')][_0xd60e('0x84')];if(!/^(f|ht)tps?:\/\//i[_0xd60e('0x90')](_0x1da356)){_0x4afd5e=path[_0xd60e('0x60')]('plugins',_0x11e13f,_0x2e716a[0x0],_0x1da356);}else{_0x4afd5e=_0x1da356;}}else{logger[_0xd60e('0x69')](_0xd60e('0x93'));}}else if(_0x405415===_0xd60e('0x86')){_0x458c8e=_0x1a9ae3['parameters'][_0xd60e('0x94')];_0x38c450=_0x1a9ae3['parameters']['scriptPath'];if('undefined'!=typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')]){if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')]['admin']){var _0x2a7c2f=_0x1a9ae3['parameters']['views'][_0xd60e('0x83')];if(!/^(f|ht)tps?:\/\//i[_0xd60e('0x90')](_0x2a7c2f)){_0x569bbe=path['join'](_0xd60e('0x91'),_0x11e13f,_0x2e716a[0x0],_0x2a7c2f);}else{_0x569bbe=_0x2a7c2f;}}if(_0xd60e('0x22')!=typeof _0x1a9ae3[_0xd60e('0x80')]['views']['agent']){var _0x1da356=_0x1a9ae3[_0xd60e('0x80')][_0xd60e('0x81')][_0xd60e('0x84')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1da356)){_0x4afd5e=path['join'](_0xd60e('0x91'),_0x11e13f,_0x2e716a[0x0],_0x1da356);}else{_0x4afd5e=_0x1da356;}}}}var _0x79a8a4={'name':_0x110c65,'description':_0x902c58,'path':path['join'](_0x11e13f,_0x2e716a[0x0]),'type':_0x405415,'sidebar':_0xa34a5c,'icon':_0x21df51,'adminUrl':_0x569bbe,'agentUrl':_0x4afd5e,'scriptName':_0x458c8e,'scriptPath':_0x38c450,'version':_0x9b5e44};removeReferences(_0x296619,null);return db[_0xd60e('0x37')][_0xd60e('0x95')](_0x79a8a4)[_0xd60e('0x2c')](function(_0x5eceb6){var _0x1705a5={'role':_0x50904d['body'][_0xd60e('0x96')],'userProfileId':_0x50904d[_0xd60e('0x97')][_0xd60e('0x98')]};if(!_0x1705a5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1705a5[_0xd60e('0x96')]===_0xd60e('0x99')){var _0xf76354=_0x5eceb6[_0xd60e('0x2e')]({'plain':!![]});return db[_0xd60e('0x9a')][_0xd60e('0x52')]({'where':{'name':'Plugins','userProfileId':_0x1705a5['userProfileId']},'raw':!![]})[_0xd60e('0x2c')](function(_0x2ed652){if(_0x2ed652&&_0x2ed652[_0xd60e('0x9b')]===0x0){return db['UserProfileResource']['create']({'name':_0xf76354[_0xd60e('0x33')],'resourceId':_0xf76354['id'],'type':_0x2ed652[_0xd60e('0x33')],'sectionId':_0x2ed652['id']},{})[_0xd60e('0x2c')](function(){return _0x5eceb6;});}else{return _0x5eceb6;}})[_0xd60e('0x4e')](function(_0x3e03fc){logger[_0xd60e('0x31')](_0xd60e('0x9c'),_0x3e03fc);throw _0x3e03fc;});}return _0x5eceb6;})[_0xd60e('0x2c')](respondWithResult(_0x50f2ef,null))[_0xd60e('0x4e')](handleError(_0x50f2ef,null));}});}catch(_0x328dda){_0x50f2ef[_0xd60e('0x20')](0x1f4)[_0xd60e('0x34')](_0x328dda);}};function removeReferences(_0x4474cc,_0x510f60){try{if(_0x4474cc){fs[_0xd60e('0x68')](_0x4474cc);logger[_0xd60e('0x69')]('Zip\x20archive\x20removed');}if(_0x510f60){rimraf(_0x510f60,function(){});logger[_0xd60e('0x69')](_0xd60e('0x9d'));}}catch(_0x554b1d){logger[_0xd60e('0x31')](_0x554b1d);}}exports[_0xd60e('0x2b')]=function(_0x24b7ec,_0x52855a,_0x11c901){return db['Plugin'][_0xd60e('0x52')]({'where':{'id':_0x24b7ec['params']['id']}})[_0xd60e('0x2c')](handleEntityNotFound(_0x52855a,null))[_0xd60e('0x2c')](saveUpdates(_0x24b7ec[_0xd60e('0x97')],null))[_0xd60e('0x2c')](respondWithResult(_0x52855a,null))['catch'](handleError(_0x52855a,null));};exports[_0xd60e('0x9e')]=function(_0x5c1792,_0x583c47,_0x5a33f5){return db[_0xd60e('0x37')][_0xd60e('0x52')]({'where':{'id':_0x5c1792['params']['id']}})[_0xd60e('0x2c')](function(_0x2f2d9d){if(_0x2f2d9d){return _0x2f2d9d[_0xd60e('0x2d')]();}})[_0xd60e('0x2c')](function(_0x2ffc8f){rimraf(path[_0xd60e('0x60')](config[_0xd60e('0x70')],'server/files/plugins',path['dirname'](_0x2ffc8f[_0xd60e('0x5')])),function(){});return _0x2ffc8f;})['then'](handleEntityNotFound(_0x583c47,null))[_0xd60e('0x2c')](respondWithStatusCode(_0x583c47,null))[_0xd60e('0x4e')](handleError(_0x583c47,null));};exports[_0xd60e('0x9f')]=function(_0x4c58b0,_0x1a2650,_0x19c2b9){return BPromise[_0xd60e('0xa0')]()['then'](function(){if(!_0x4c58b0[_0xd60e('0x3b')]['path']){throw new Error(_0xd60e('0xa1'));}if(!_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa2')]){throw new Error(_0xd60e('0xa3'));}var _0x1960c4=_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa4')]?_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa4')]+':'+_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa2')]:_0xd60e('0xa5')+_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa2')];var _0x518f65=_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0x21')]?_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0x21')]:!![];var _0x203e95=_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0xa6')]?_0x4c58b0[_0xd60e('0x3b')]['encoding']:null;var _0x5f3c16={'method':_0x4c58b0['method'],'uri':util['format'](_0xd60e('0xa7'),_0x1960c4,_0x4c58b0[_0xd60e('0x3b')][_0xd60e('0x5')]),'json':_0x518f65,'resolveWithFullResponse':!![],'encoding':_0x203e95,'qs':_0x4c58b0['query']};if(_0x4c58b0[_0xd60e('0xa8')]){_0x5f3c16[_0xd60e('0xa8')]=_0x4c58b0[_0xd60e('0xa8')];if(_0x5f3c16['headers'][_0xd60e('0xa9')]){delete _0x5f3c16['headers']['content-length'];}}if(_0x5f3c16['headers'][_0xd60e('0xaa')]){delete _0x5f3c16[_0xd60e('0xa8')][_0xd60e('0xaa')];}return rp(_0x5f3c16);})['then'](function(_0x2fe77f){if(_0x2fe77f){_0x1a2650[_0xd60e('0x26')](_0x2fe77f[_0xd60e('0xa8')]);logger[_0xd60e('0x69')](_0x2fe77f[_0xd60e('0x97')]);if(_[_0xd60e('0xab')](_0x4c58b0['query'][_0xd60e('0x5')],'download')&&_0x2fe77f['statusCode']==0x1f4){return _0x1a2650[_0xd60e('0x1f')](_0x2fe77f['statusCode']);}else{return _0x1a2650[_0xd60e('0x20')](_0x2fe77f['statusCode'])[_0xd60e('0x34')](_0x2fe77f['body']);}}else{return _0x1a2650[_0xd60e('0x1f')](0xc8);}})[_0xd60e('0x4e')](handleError(_0x1a2650,null));};exports['webhookPost']=function(_0x35d4a5,_0x28b807,_0x18f136){return BPromise[_0xd60e('0xa0')]()['then'](function(){if(!_0x35d4a5['query'][_0xd60e('0x5')]){throw new Error(_0xd60e('0xa1'));}if(!_0x35d4a5[_0xd60e('0x3b')]['port']){throw new Error(_0xd60e('0xa3'));}var _0x49c354=_0x35d4a5[_0xd60e('0x3b')][_0xd60e('0xa4')]?_0x35d4a5[_0xd60e('0x3b')]['hostname']+':'+_0x35d4a5[_0xd60e('0x3b')]['port']:_0xd60e('0xa5')+_0x35d4a5['query']['port'];var _0x20a5d7=_0x35d4a5[_0xd60e('0x3b')][_0xd60e('0x21')]?_0x35d4a5[_0xd60e('0x3b')]['json']:!![];var _0x6b973f=_0x35d4a5[_0xd60e('0x3b')]['encoding']?_0x35d4a5[_0xd60e('0x3b')][_0xd60e('0xa6')]:null;var _0x136c1d={'method':_0x35d4a5[_0xd60e('0xac')],'uri':util[_0xd60e('0x55')]('%s%s',_0x49c354,_0x35d4a5['query'][_0xd60e('0x5')]),'json':_0x20a5d7,'resolveWithFullResponse':!![],'encoding':_0x6b973f,'body':_0x35d4a5[_0xd60e('0x97')]};if(_0x35d4a5['headers']){_0x136c1d[_0xd60e('0xa8')]=_0x35d4a5[_0xd60e('0xa8')];if(_0x136c1d[_0xd60e('0xa8')]['content-length']){delete _0x136c1d[_0xd60e('0xa8')][_0xd60e('0xa9')];}}if(_0x136c1d['headers']['content-type']){delete _0x136c1d[_0xd60e('0xa8')][_0xd60e('0xaa')];}return rp(_0x136c1d);})['then'](function(_0x420822){if(_0x420822){_0x28b807[_0xd60e('0x26')](_0x420822[_0xd60e('0xa8')]);logger['info'](_0x420822[_0xd60e('0x97')]);return _0x28b807[_0xd60e('0x20')](_0x420822[_0xd60e('0xad')])[_0xd60e('0x34')](_0x420822['body']);}else{return _0x28b807['sendStatus'](0xc8);}})[_0xd60e('0x4e')](handleError(_0x28b807,null));};
\ No newline at end of file
+var _0xab27=['headers','content-length','content-type','endsWith','statusCode','webhookPost','resolve','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','merge','options','Plugin','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','pipe','glob','node_modules/**/*','attachments/**/*','finalize','info','Temporary\x20file\x20removed','upload','file','filename','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon-apps','test','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Zip\x20archive\x20removed','dirname','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0xab27,0x1f3));var _0x7ab2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab27[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x7ab2('0x0'));var rimraf=require(_0x7ab2('0x1'));var zipdir=require(_0x7ab2('0x2'));var jsonpatch=require(_0x7ab2('0x3'));var rp=require('request-promise');var moment=require(_0x7ab2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7ab2('0x5'));var util=require(_0x7ab2('0x6'));var path=require(_0x7ab2('0x7'));var sox=require(_0x7ab2('0x8'));var csv=require(_0x7ab2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7ab2('0xa'));var _=require('lodash');var squel=require(_0x7ab2('0xb'));var crypto=require(_0x7ab2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ab2('0x9'));var querystring=require(_0x7ab2('0xd'));var Papa=require(_0x7ab2('0xe'));var extract=require(_0x7ab2('0xf'));var rimraf=require('rimraf');var archiver=require(_0x7ab2('0x10'));var Redis=require('ioredis');var authService=require(_0x7ab2('0x11'));var qs=require(_0x7ab2('0x12'));var as=require(_0x7ab2('0x13'));var hardwareService=require(_0x7ab2('0x14'));var logger=require(_0x7ab2('0x15'))(_0x7ab2('0x16'));var utils=require(_0x7ab2('0x17'));var config=require(_0x7ab2('0x18'));var licenseUtil=require(_0x7ab2('0x19'));var db=require(_0x7ab2('0x1a'))['db'];config['redis']=_[_0x7ab2('0x1b')](config['redis'],{'host':_0x7ab2('0x1c'),'port':0x18eb});var socket=require(_0x7ab2('0x1d'))(new Redis(config[_0x7ab2('0x1e')]));require(_0x7ab2('0x1f'))[_0x7ab2('0x20')](socket);function respondWithStatusCode(_0x34d550,_0x4e58c6){_0x4e58c6=_0x4e58c6||0xcc;return function(_0x3c8c52){if(_0x3c8c52){return _0x34d550['sendStatus'](_0x4e58c6);}return _0x34d550[_0x7ab2('0x21')](_0x4e58c6)[_0x7ab2('0x22')]();};}function respondWithResult(_0xcf9dc5,_0x34717b){_0x34717b=_0x34717b||0xc8;return function(_0xe24169){if(_0xe24169){return _0xcf9dc5[_0x7ab2('0x21')](_0x34717b)[_0x7ab2('0x23')](_0xe24169);}};}function respondWithFilteredResult(_0x3def5e,_0x59e7ca){return function(_0x57adc1){if(_0x57adc1){var _0x5078e0=typeof _0x59e7ca[_0x7ab2('0x24')]===_0x7ab2('0x25')&&typeof _0x59e7ca[_0x7ab2('0x26')]===_0x7ab2('0x25');var _0x63344a=_0x57adc1[_0x7ab2('0x27')];var _0x1ae7a8=_0x5078e0?0x0:_0x59e7ca[_0x7ab2('0x24')];var _0x5d149c=_0x5078e0?_0x57adc1[_0x7ab2('0x27')]:_0x59e7ca[_0x7ab2('0x24')]+_0x59e7ca[_0x7ab2('0x26')];var _0x1c9e92;if(_0x5d149c>=_0x63344a){_0x5d149c=_0x63344a;_0x1c9e92=0xc8;}else{_0x1c9e92=0xce;}_0x3def5e['status'](_0x1c9e92);return _0x3def5e[_0x7ab2('0x28')](_0x7ab2('0x29'),_0x1ae7a8+'-'+_0x5d149c+'/'+_0x63344a)[_0x7ab2('0x23')](_0x57adc1);}return null;};}function patchUpdates(_0xe5577){return function(_0x11ab34){try{jsonpatch[_0x7ab2('0x2a')](_0x11ab34,_0xe5577,!![]);}catch(_0x1365d4){return BPromise[_0x7ab2('0x2b')](_0x1365d4);}return _0x11ab34[_0x7ab2('0x2c')]();};}function saveUpdates(_0x3bc248,_0x4ee499){return function(_0x3afd9f){if(_0x3afd9f){return _0x3afd9f[_0x7ab2('0x2d')](_0x3bc248)[_0x7ab2('0x2e')](function(_0x9002e2){return _0x9002e2;});}return null;};}function removeEntity(_0x3a925a,_0x5a0ac1){return function(_0x2492c0){if(_0x2492c0){return _0x2492c0[_0x7ab2('0x2f')]()[_0x7ab2('0x2e')](function(){var _0x1d76ee=_0x2492c0[_0x7ab2('0x30')]({'plain':!![]});var _0xabf657='Plugins';return db[_0x7ab2('0x31')][_0x7ab2('0x2f')]({'where':{'type':_0xabf657,'resourceId':_0x1d76ee['id']}})[_0x7ab2('0x2e')](function(){return _0x2492c0;});})['then'](function(){_0x3a925a[_0x7ab2('0x21')](0xcc)[_0x7ab2('0x22')]();});}};}function handleEntityNotFound(_0x2f4bb0,_0x3a8178){return function(_0x13c799){if(!_0x13c799){_0x2f4bb0[_0x7ab2('0x32')](0x194);}return _0x13c799;};}function handleError(_0x5dd184,_0x532f08){_0x532f08=_0x532f08||0x1f4;return function(_0x46cb6b){logger[_0x7ab2('0x33')](_0x46cb6b['stack']);if(_0x46cb6b[_0x7ab2('0x34')]){delete _0x46cb6b['name'];}_0x5dd184[_0x7ab2('0x21')](_0x532f08)[_0x7ab2('0x35')](_0x46cb6b);};}exports[_0x7ab2('0x36')]=function(_0x47ff45,_0x4ed37b){var _0x5be69a={},_0x217826={},_0x51b94c={'count':0x0,'rows':[]};var _0x309fa6=_['map'](db['Plugin'][_0x7ab2('0x37')],function(_0xf32738){return{'name':_0xf32738[_0x7ab2('0x38')],'type':_0xf32738['type'][_0x7ab2('0x39')]};});_0x217826[_0x7ab2('0x3a')]=_['map'](_0x309fa6,_0x7ab2('0x34'));_0x217826[_0x7ab2('0x3b')]=_[_0x7ab2('0x3c')](_0x47ff45[_0x7ab2('0x3b')]);_0x217826[_0x7ab2('0x3d')]=_[_0x7ab2('0x3e')](_0x217826['model'],_0x217826[_0x7ab2('0x3b')]);_0x5be69a['attributes']=_[_0x7ab2('0x3e')](_0x217826['model'],qs[_0x7ab2('0x3f')](_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x3f')]));_0x5be69a['attributes']=_0x5be69a[_0x7ab2('0x40')][_0x7ab2('0x41')]?_0x5be69a['attributes']:_0x217826[_0x7ab2('0x3a')];if(!_0x47ff45['query'][_0x7ab2('0x42')](_0x7ab2('0x43'))){_0x5be69a[_0x7ab2('0x26')]=qs[_0x7ab2('0x26')](_0x47ff45['query'][_0x7ab2('0x26')]);_0x5be69a[_0x7ab2('0x24')]=qs['offset'](_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x24')]);}_0x5be69a[_0x7ab2('0x44')]=qs[_0x7ab2('0x45')](_0x47ff45['query'][_0x7ab2('0x45')]);_0x5be69a[_0x7ab2('0x46')]=qs[_0x7ab2('0x3d')](_[_0x7ab2('0x47')](_0x47ff45[_0x7ab2('0x3b')],_0x217826['filters']),_0x309fa6);if(_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x48')]){_0x5be69a[_0x7ab2('0x46')]=_['merge'](_0x5be69a[_0x7ab2('0x46')],{'$or':_[_0x7ab2('0x49')](_0x309fa6,function(_0x3c5c04){if(_0x3c5c04[_0x7ab2('0x4a')]!=='VIRTUAL'){var _0x50c834={};_0x50c834[_0x3c5c04[_0x7ab2('0x34')]]={'$like':'%'+_0x47ff45['query'][_0x7ab2('0x48')]+'%'};return _0x50c834;}})});}_0x5be69a=_[_0x7ab2('0x4b')]({},_0x5be69a,_0x47ff45[_0x7ab2('0x4c')]);var _0x1cc956={'where':_0x5be69a[_0x7ab2('0x46')]};return db[_0x7ab2('0x4d')][_0x7ab2('0x27')](_0x1cc956)[_0x7ab2('0x2e')](function(_0x44bb40){_0x51b94c['count']=_0x44bb40;if(_0x47ff45[_0x7ab2('0x3b')][_0x7ab2('0x4e')]){_0x5be69a[_0x7ab2('0x4f')]=[{'all':!![]}];}return db[_0x7ab2('0x4d')][_0x7ab2('0x50')](_0x5be69a);})[_0x7ab2('0x2e')](function(_0x44dcc6){_0x51b94c[_0x7ab2('0x51')]=_0x44dcc6;return _0x51b94c;})[_0x7ab2('0x2e')](respondWithFilteredResult(_0x4ed37b,_0x5be69a))[_0x7ab2('0x52')](handleError(_0x4ed37b,null));};exports[_0x7ab2('0x53')]=function(_0x836617,_0x3251dc){var _0x3cb9b7={'raw':!![],'where':{'id':_0x836617[_0x7ab2('0x54')]['id']}},_0x406487={};_0x406487[_0x7ab2('0x3a')]=_[_0x7ab2('0x3c')](db[_0x7ab2('0x4d')][_0x7ab2('0x37')]);_0x406487['query']=_['keys'](_0x836617[_0x7ab2('0x3b')]);_0x406487[_0x7ab2('0x3d')]=_[_0x7ab2('0x3e')](_0x406487[_0x7ab2('0x3a')],_0x406487['query']);_0x3cb9b7[_0x7ab2('0x40')]=_[_0x7ab2('0x3e')](_0x406487[_0x7ab2('0x3a')],qs[_0x7ab2('0x3f')](_0x836617[_0x7ab2('0x3b')][_0x7ab2('0x3f')]));_0x3cb9b7[_0x7ab2('0x40')]=_0x3cb9b7[_0x7ab2('0x40')]['length']?_0x3cb9b7[_0x7ab2('0x40')]:_0x406487['model'];if(_0x836617['query'][_0x7ab2('0x4e')]){_0x3cb9b7[_0x7ab2('0x4f')]=[{'all':!![]}];}_0x3cb9b7=_['merge']({},_0x3cb9b7,_0x836617['options']);return db['Plugin'][_0x7ab2('0x55')](_0x3cb9b7)[_0x7ab2('0x2e')](handleEntityNotFound(_0x3251dc,null))[_0x7ab2('0x2e')](respondWithResult(_0x3251dc,null))[_0x7ab2('0x52')](handleError(_0x3251dc,null));};exports[_0x7ab2('0x56')]=function(_0x4bb5d5,_0x539f43,_0x393fa6){return db['Plugin'][_0x7ab2('0x55')]({'where':{'id':_0x4bb5d5[_0x7ab2('0x54')]['id']},'attributes':[_0x7ab2('0x34'),_0x7ab2('0x7')],'raw':!![]})[_0x7ab2('0x2e')](handleEntityNotFound(_0x539f43,null))[_0x7ab2('0x2e')](function(_0x5f3415){if(_0x5f3415){var _0x369984=path[_0x7ab2('0x57')](config[_0x7ab2('0x58')],'server/files/plugins',util[_0x7ab2('0x59')](_0x7ab2('0x5a'),path[_0x7ab2('0x5b')](_0x5f3415[_0x7ab2('0x7')])));var _0x27b319=fs[_0x7ab2('0x5c')](_0x369984);var _0x3c0cc0=archiver(_0x7ab2('0x5d'),{'zlib':{'level':0x9}});_0x3c0cc0['on'](_0x7ab2('0x5e'),function(_0x4164d8){if(_0x4164d8[_0x7ab2('0x5f')]===_0x7ab2('0x60')){logger[_0x7ab2('0x33')](_0x4164d8);}else{throw new db[(_0x7ab2('0x61'))][(_0x7ab2('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3c0cc0['on'](_0x7ab2('0x33'),function(_0x509588){throw new db[(_0x7ab2('0x61'))][(_0x7ab2('0x62'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3c0cc0[_0x7ab2('0x63')](_0x27b319);_0x3c0cc0[_0x7ab2('0x64')]('**/*',{'cwd':path['join'](config[_0x7ab2('0x58')],'server/files/plugins',path['dirname'](_0x5f3415[_0x7ab2('0x7')])),'ignore':[path['join'](path['basename'](_0x5f3415[_0x7ab2('0x7')]),_0x7ab2('0x65')),path[_0x7ab2('0x57')](path[_0x7ab2('0x5b')](_0x5f3415['path']),_0x7ab2('0x66'))],'nodir':!![]})[_0x7ab2('0x67')]();_0x27b319['on']('close',function(){if(!fs['existsSync'](_0x369984)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x539f43[_0x7ab2('0x56')](_0x369984,util[_0x7ab2('0x59')](_0x7ab2('0x5a'),path['basename'](_0x5f3415[_0x7ab2('0x7')])),function(_0x290ce9){if(_0x290ce9){throw new db['Sequelize']['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x369984);logger[_0x7ab2('0x68')]('Download\x20completed');logger[_0x7ab2('0x68')](_0x7ab2('0x69'));});});}return null;})[_0x7ab2('0x52')](handleError(_0x539f43,null));};exports[_0x7ab2('0x6a')]=function(_0xa38352,_0x3e131a,_0x3fe385){var _0x131fd6=path[_0x7ab2('0x5b')](_0xa38352[_0x7ab2('0x6b')][_0x7ab2('0x6c')],path['extname'](_0xa38352[_0x7ab2('0x6b')]['filename']));var _0x399d70=path[_0x7ab2('0x57')](config['root'],_0x7ab2('0x6d'),_0xa38352['file'][_0x7ab2('0x6c')]);var _0x4e0935=path['join'](config[_0x7ab2('0x58')],'server/files/plugins',_0x131fd6);logger[_0x7ab2('0x68')](_0x7ab2('0x6e'),_0x399d70);logger[_0x7ab2('0x68')]('Plugin\x20upload\x20destination:\x20%s',_0x4e0935);try{fs['chmodSync'](_0x399d70,parseInt(_0x7ab2('0x6f'),0x8));extract(_0x399d70,{'dir':_0x4e0935},function(_0x4f154b){if(_0x4f154b){logger[_0x7ab2('0x33')](_0x4f154b);handleError(_0x4f154b,!![]);};var _0x3817e6=fs['readdirSync'](_0x4e0935);if(_0x3817e6[_0x7ab2('0x41')]>0x1){removeReferences(_0x399d70,_0x4e0935);logger[_0x7ab2('0x33')]('Invalid\x20plugin\x20structure');return _0x3fe385(new Error(_0x7ab2('0x70')));}var _0x28247e=fs[_0x7ab2('0x71')](path[_0x7ab2('0x57')](_0x4e0935,_0x3817e6[0x0]));if(_0x28247e[_0x7ab2('0x72')]()){removeReferences(_0x399d70,_0x4e0935);logger[_0x7ab2('0x33')](_0x7ab2('0x70'));return _0x3fe385(new Error(_0x7ab2('0x70')));}if(_0x28247e[_0x7ab2('0x73')]()){var _0x483424=fs['readdirSync'](path[_0x7ab2('0x57')](_0x4e0935,_0x3817e6[0x0]));if(_0x483424[_0x7ab2('0x41')]===0x0){removeReferences(_0x399d70,_0x4e0935);logger[_0x7ab2('0x33')](_0x7ab2('0x70'));return _0x3fe385(new Error(_0x7ab2('0x70')));}var _0x304f69=_0x483424[_0x7ab2('0x74')](function(_0x416748){return _0x416748==='manifest.json';});if(!_0x304f69){return _0x3fe385(new Error('Plugin\x20manifest\x20missing'));}var _0x10ba26=fs[_0x7ab2('0x75')](path[_0x7ab2('0x57')](_0x4e0935,_0x3817e6[0x0],'manifest.json'));var _0x5d303a=JSON['parse'](_0x10ba26);if(_0x7ab2('0x25')==typeof _0x5d303a[_0x7ab2('0x34')]){return _0x3fe385(new Error(_0x7ab2('0x76')));}if(_0x7ab2('0x25')==typeof _0x5d303a['type']){return _0x3fe385(new Error(_0x7ab2('0x77')));}if('undefined'==typeof _0x5d303a[_0x7ab2('0x78')]){return _0x3fe385(new Error(_0x7ab2('0x79')));}if(_0x7ab2('0x25')==typeof _0x5d303a['parameters']){return _0x3fe385(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5d303a[_0x7ab2('0x4a')]===_0x7ab2('0x7a')){if('undefined'==typeof _0x5d303a[_0x7ab2('0x7b')]['views']){return _0x3fe385(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7d')]&&_0x7ab2('0x25')==typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')]){return _0x3fe385(new Error(_0x7ab2('0x7f')));}}else if(_0x5d303a[_0x7ab2('0x4a')]===_0x7ab2('0x80')){if(_0x7ab2('0x25')==typeof _0x5d303a['parameters'][_0x7ab2('0x81')]){return _0x3fe385(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x5d303a['parameters'][_0x7ab2('0x82')]){return _0x3fe385(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x3fe385(new Error(_0x7ab2('0x83')));}var _0x2d4701=_0x5d303a[_0x7ab2('0x34')];var _0x358d22=_0x5d303a[_0x7ab2('0x84')];var _0x59bc62=_0x5d303a['type'];var _0x2a5ee3=_0x5d303a[_0x7ab2('0x85')]?_0x5d303a[_0x7ab2('0x85')]:_0x7ab2('0x86');var _0x48f295=_0x5d303a['icon']?_0x5d303a['icon']:_0x7ab2('0x87');var _0x378391='';var _0x1f5f09='';var _0x26f641='';var _0xc18dce='';var _0x34dc21=_0x5d303a[_0x7ab2('0x78')];if(_0x59bc62===_0x7ab2('0x7a')){if(_0x7ab2('0x25')!=typeof _0x5d303a[_0x7ab2('0x7b')]['views'][_0x7ab2('0x7d')]){var _0x29a207=_0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x7ab2('0x88')](_0x29a207)){_0x378391=path[_0x7ab2('0x57')](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x29a207);}else{_0x378391=_0x29a207;}}else{logger[_0x7ab2('0x68')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x7ab2('0x25')!=typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')]){var _0x40e1b5=_0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x40e1b5)){_0x1f5f09=path['join'](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x40e1b5);}else{_0x1f5f09=_0x40e1b5;}}else{logger[_0x7ab2('0x68')](_0x7ab2('0x8a'));}}else if(_0x59bc62===_0x7ab2('0x80')){_0x26f641=_0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x81')];_0xc18dce=_0x5d303a['parameters'][_0x7ab2('0x82')];if(_0x7ab2('0x25')!=typeof _0x5d303a['parameters']['views']){if(_0x7ab2('0x25')!=typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7d')]){var _0x29a207=_0x5d303a['parameters'][_0x7ab2('0x7c')][_0x7ab2('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x29a207)){_0x378391=path[_0x7ab2('0x57')](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x29a207);}else{_0x378391=_0x29a207;}}if('undefined'!=typeof _0x5d303a[_0x7ab2('0x7b')][_0x7ab2('0x7c')][_0x7ab2('0x7e')]){var _0x40e1b5=_0x5d303a['parameters'][_0x7ab2('0x7c')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x7ab2('0x88')](_0x40e1b5)){_0x1f5f09=path['join'](_0x7ab2('0x89'),_0x131fd6,_0x3817e6[0x0],_0x40e1b5);}else{_0x1f5f09=_0x40e1b5;}}}}var _0x50889a={'name':_0x2d4701,'description':_0x358d22,'path':path[_0x7ab2('0x57')](_0x131fd6,_0x3817e6[0x0]),'type':_0x59bc62,'sidebar':_0x2a5ee3,'icon':_0x48f295,'adminUrl':_0x378391,'agentUrl':_0x1f5f09,'scriptName':_0x26f641,'scriptPath':_0xc18dce,'version':_0x34dc21};removeReferences(_0x399d70,null);return db[_0x7ab2('0x4d')][_0x7ab2('0x8b')](_0x50889a)[_0x7ab2('0x2e')](function(_0x27b2bc){var _0x1c70bf={'role':_0xa38352[_0x7ab2('0x8c')][_0x7ab2('0x8d')],'userProfileId':_0xa38352['body']['userProfileId']};if(!_0x1c70bf)throw new Error(_0x7ab2('0x8e'));if(_0x1c70bf[_0x7ab2('0x8d')]===_0x7ab2('0x8f')){var _0x5c17a4=_0x27b2bc[_0x7ab2('0x30')]({'plain':!![]});return db[_0x7ab2('0x90')][_0x7ab2('0x55')]({'where':{'name':'Plugins','userProfileId':_0x1c70bf[_0x7ab2('0x91')]},'raw':!![]})[_0x7ab2('0x2e')](function(_0x30b032){if(_0x30b032&&_0x30b032['autoAssociation']===0x0){return db[_0x7ab2('0x31')]['create']({'name':_0x5c17a4['name'],'resourceId':_0x5c17a4['id'],'type':_0x30b032['name'],'sectionId':_0x30b032['id']},{})[_0x7ab2('0x2e')](function(){return _0x27b2bc;});}else{return _0x27b2bc;}})[_0x7ab2('0x52')](function(_0x4c81e5){logger[_0x7ab2('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c81e5);throw _0x4c81e5;});}return _0x27b2bc;})[_0x7ab2('0x2e')](respondWithResult(_0x3e131a,null))['catch'](handleError(_0x3e131a,null));}});}catch(_0x1039e3){_0x3e131a[_0x7ab2('0x21')](0x1f4)[_0x7ab2('0x35')](_0x1039e3);}};function removeReferences(_0x163619,_0x5c05ce){try{if(_0x163619){fs['unlinkSync'](_0x163619);logger[_0x7ab2('0x68')](_0x7ab2('0x92'));}if(_0x5c05ce){rimraf(_0x5c05ce,function(){});logger[_0x7ab2('0x68')]('Extracted\x20folder\x20removed');}}catch(_0x3f87a4){logger[_0x7ab2('0x33')](_0x3f87a4);}}exports[_0x7ab2('0x2d')]=function(_0x564bc5,_0x580be4,_0x176dcb){return db[_0x7ab2('0x4d')]['find']({'where':{'id':_0x564bc5['params']['id']}})['then'](handleEntityNotFound(_0x580be4,null))[_0x7ab2('0x2e')](saveUpdates(_0x564bc5[_0x7ab2('0x8c')],null))[_0x7ab2('0x2e')](respondWithResult(_0x580be4,null))[_0x7ab2('0x52')](handleError(_0x580be4,null));};exports['delete']=function(_0x3cb115,_0x110e39,_0x5e7e21){return db[_0x7ab2('0x4d')]['find']({'where':{'id':_0x3cb115['params']['id']}})[_0x7ab2('0x2e')](function(_0x264d49){if(_0x264d49){return _0x264d49[_0x7ab2('0x2f')]();}})['then'](function(_0x2fa999){rimraf(path[_0x7ab2('0x57')](config[_0x7ab2('0x58')],_0x7ab2('0x6d'),path[_0x7ab2('0x93')](_0x2fa999['path'])),function(){});return _0x2fa999;})[_0x7ab2('0x2e')](handleEntityNotFound(_0x110e39,null))[_0x7ab2('0x2e')](respondWithStatusCode(_0x110e39,null))['catch'](handleError(_0x110e39,null));};exports[_0x7ab2('0x94')]=function(_0x440073,_0x4c36ea,_0xdec882){return BPromise['resolve']()[_0x7ab2('0x2e')](function(){if(!_0x440073['query'][_0x7ab2('0x7')]){throw new Error(_0x7ab2('0x95'));}if(!_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x96')]){throw new Error(_0x7ab2('0x97'));}var _0x481599=_0x440073[_0x7ab2('0x3b')]['hostname']?_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x98')]+':'+_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x96')]:_0x7ab2('0x99')+_0x440073[_0x7ab2('0x3b')]['port'];var _0xebd93b=_0x440073[_0x7ab2('0x3b')]['json']?_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x23')]:!![];var _0x4692db=_0x440073['query'][_0x7ab2('0x9a')]?_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x9a')]:null;var _0x5d5923={'method':_0x440073[_0x7ab2('0x9b')],'uri':util[_0x7ab2('0x59')](_0x7ab2('0x9c'),_0x481599,_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x7')]),'json':_0xebd93b,'resolveWithFullResponse':!![],'encoding':_0x4692db,'qs':_0x440073['query']};if(_0x440073[_0x7ab2('0x9d')]){_0x5d5923[_0x7ab2('0x9d')]=_0x440073[_0x7ab2('0x9d')];if(_0x5d5923['headers']['content-length']){delete _0x5d5923[_0x7ab2('0x9d')][_0x7ab2('0x9e')];}}if(_0x5d5923['headers'][_0x7ab2('0x9f')]){delete _0x5d5923['headers'][_0x7ab2('0x9f')];}return rp(_0x5d5923);})[_0x7ab2('0x2e')](function(_0x235117){if(_0x235117){_0x4c36ea[_0x7ab2('0x28')](_0x235117[_0x7ab2('0x9d')]);logger[_0x7ab2('0x68')](_0x235117[_0x7ab2('0x8c')]);if(_[_0x7ab2('0xa0')](_0x440073[_0x7ab2('0x3b')][_0x7ab2('0x7')],'download')&&_0x235117[_0x7ab2('0xa1')]==0x1f4){return _0x4c36ea[_0x7ab2('0x32')](_0x235117['statusCode']);}else{return _0x4c36ea[_0x7ab2('0x21')](_0x235117[_0x7ab2('0xa1')])[_0x7ab2('0x35')](_0x235117['body']);}}else{return _0x4c36ea[_0x7ab2('0x32')](0xc8);}})[_0x7ab2('0x52')](handleError(_0x4c36ea,null));};exports[_0x7ab2('0xa2')]=function(_0x5bc2ce,_0x455550,_0x45b0dc){return BPromise[_0x7ab2('0xa3')]()[_0x7ab2('0x2e')](function(){if(!_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x96')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x134794=_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x98')]?_0x5bc2ce[_0x7ab2('0x3b')]['hostname']+':'+_0x5bc2ce[_0x7ab2('0x3b')]['port']:_0x7ab2('0x99')+_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x96')];var _0x47e336=_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x23')]?_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x23')]:!![];var _0x446fd6=_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x9a')]?_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x9a')]:null;var _0x48226c={'method':_0x5bc2ce[_0x7ab2('0x9b')],'uri':util['format'](_0x7ab2('0x9c'),_0x134794,_0x5bc2ce[_0x7ab2('0x3b')][_0x7ab2('0x7')]),'json':_0x47e336,'resolveWithFullResponse':!![],'encoding':_0x446fd6,'body':_0x5bc2ce['body']};if(_0x5bc2ce[_0x7ab2('0x9d')]){_0x48226c['headers']=_0x5bc2ce[_0x7ab2('0x9d')];if(_0x48226c[_0x7ab2('0x9d')][_0x7ab2('0x9e')]){delete _0x48226c[_0x7ab2('0x9d')][_0x7ab2('0x9e')];}}if(_0x48226c[_0x7ab2('0x9d')][_0x7ab2('0x9f')]){delete _0x48226c['headers'][_0x7ab2('0x9f')];}return rp(_0x48226c);})[_0x7ab2('0x2e')](function(_0x415bd0){if(_0x415bd0){_0x455550[_0x7ab2('0x28')](_0x415bd0[_0x7ab2('0x9d')]);logger[_0x7ab2('0x68')](_0x415bd0['body']);return _0x455550[_0x7ab2('0x21')](_0x415bd0[_0x7ab2('0xa1')])[_0x7ab2('0x35')](_0x415bd0['body']);}else{return _0x455550['sendStatus'](0xc8);}})['catch'](handleError(_0x455550,null));};
\ No newline at end of file
index aeda1d7..0c4d8b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x13f5,0xc3));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x513f('0x0'));var Plugin=require(_0x513f('0x1'))['db'][_0x513f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x513f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x513f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c30ef){return function(_0xd61dcf,_0x10ae9e,_0x3a9531){PluginEvents[_0x513f('0x5')](_0x5c30ef+':'+_0xd61dcf['id'],_0xd61dcf);PluginEvents[_0x513f('0x5')](_0x5c30ef,_0xd61dcf);_0x3a9531(null);};}for(var e in events){if(events[_0x513f('0x6')](e)){var event=events[e];Plugin[_0x513f('0x7')](e,emitEvent(event));}}module[_0x513f('0x8')]=PluginEvents;
\ No newline at end of file
+var _0xe015=['update','emit','hasOwnProperty','events','../../mysqldb','Plugin'];(function(_0x41159e,_0x1e07a3){var _0x5a3d18=function(_0x21316d){while(--_0x21316d){_0x41159e['push'](_0x41159e['shift']());}};_0x5a3d18(++_0x1e07a3);}(_0xe015,0x13b));var _0x5e01=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xe015[_0x465028];return _0xb783d4;};'use strict';var EventEmitter=require(_0x5e01('0x0'));var Plugin=require(_0x5e01('0x1'))['db'][_0x5e01('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e01('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2136cf){return function(_0x420f00,_0x7ce4b9,_0x241c0e){PluginEvents['emit'](_0x2136cf+':'+_0x420f00['id'],_0x420f00);PluginEvents[_0x5e01('0x4')](_0x2136cf,_0x420f00);_0x241c0e(null);};}for(var e in events){if(events[_0x5e01('0x5')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index 185ece3..ee90659 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f4a=['./plugin.attributes','exports','define','Plugin','plugins','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2492f,_0x40f73c){var _0x32372c=function(_0x423de8){while(--_0x423de8){_0x2492f['push'](_0x2492f['shift']());}};_0x32372c(++_0x40f73c);}(_0x6f4a,0x155));var _0xa6f4=function(_0x3824ed,_0x466288){_0x3824ed=_0x3824ed-0x0;var _0x1ae4d3=_0x6f4a[_0x3824ed];return _0x1ae4d3;};'use strict';var _=require('lodash');var util=require(_0xa6f4('0x0'));var logger=require(_0xa6f4('0x1'))(_0xa6f4('0x2'));var moment=require(_0xa6f4('0x3'));var BPromise=require(_0xa6f4('0x4'));var rp=require(_0xa6f4('0x5'));var fs=require('fs');var path=require(_0xa6f4('0x6'));var rimraf=require(_0xa6f4('0x7'));var config=require(_0xa6f4('0x8'));var attributes=require(_0xa6f4('0x9'));module[_0xa6f4('0xa')]=function(_0x16f48c,_0x266b73){return _0x16f48c[_0xa6f4('0xb')](_0xa6f4('0xc'),attributes,{'tableName':_0xa6f4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x64a1=['../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4cc430,_0x266e77){var _0xfaaf65=function(_0x5add12){while(--_0x5add12){_0x4cc430['push'](_0x4cc430['shift']());}};_0xfaaf65(++_0x266e77);}(_0x64a1,0x13e));var _0x164a=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x64a1[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0x164a('0x0'));var util=require(_0x164a('0x1'));var logger=require(_0x164a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x164a('0x3'));var rp=require(_0x164a('0x4'));var fs=require('fs');var path=require(_0x164a('0x5'));var rimraf=require('rimraf');var config=require(_0x164a('0x6'));var attributes=require(_0x164a('0x7'));module[_0x164a('0x8')]=function(_0x34f70e,_0x576f6f){return _0x34f70e[_0x164a('0x9')](_0x164a('0xa'),attributes,{'tableName':_0x164a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce6e4a8..c2db0f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbba=['Plugin,\x20%s,\x20%s','info','catch','CreatePlugin','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./plugin.socket','register','request','then','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x583e98,_0x264428){var _0x186295=function(_0x86921c){while(--_0x86921c){_0x583e98['push'](_0x583e98['shift']());}};_0x186295(++_0x264428);}(_0xfbba,0x118));var _0xafbb=function(_0x32efa9,_0x18788a){_0x32efa9=_0x32efa9-0x0;var _0x806f65=_0xfbba[_0x32efa9];return _0x806f65;};'use strict';var _=require('lodash');var util=require(_0xafbb('0x0'));var moment=require(_0xafbb('0x1'));var BPromise=require(_0xafbb('0x2'));var rs=require(_0xafbb('0x3'));var fs=require('fs');var Redis=require(_0xafbb('0x4'));var db=require(_0xafbb('0x5'))['db'];var utils=require(_0xafbb('0x6'));var logger=require(_0xafbb('0x7'))(_0xafbb('0x8'));var config=require(_0xafbb('0x9'));var jayson=require(_0xafbb('0xa'));var client=jayson[_0xafbb('0xb')][_0xafbb('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xafbb('0xd')],{'host':_0xafbb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xafbb('0xd')]));require(_0xafbb('0xf'))[_0xafbb('0x10')](socket);function respondWithRpcPromise(_0x26914b,_0xfa481,_0x25d83a){return new BPromise(function(_0x53376c,_0x3d962e){return client[_0xafbb('0x11')](_0x26914b,_0x25d83a)[_0xafbb('0x12')](function(_0x169c94){logger['info']('Plugin,\x20%s,\x20%s',_0xfa481,_0xafbb('0x13'));logger[_0xafbb('0x14')](_0xafbb('0x15'),_0xfa481,_0xafbb('0x13'),JSON[_0xafbb('0x16')](_0x169c94));if(_0x169c94['error']){if(_0x169c94['error'][_0xafbb('0x17')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xfa481,_0x169c94[_0xafbb('0x18')][_0xafbb('0x19')]);return _0x3d962e(_0x169c94['error'][_0xafbb('0x19')]);}logger[_0xafbb('0x18')](_0xafbb('0x1a'),_0xfa481,_0x169c94[_0xafbb('0x18')][_0xafbb('0x19')]);return _0x53376c(_0x169c94[_0xafbb('0x18')][_0xafbb('0x19')]);}else{logger[_0xafbb('0x1b')](_0xafbb('0x1a'),_0xfa481,_0xafbb('0x13'));_0x53376c(_0x169c94['result'][_0xafbb('0x19')]);}})[_0xafbb('0x1c')](function(_0x326328){logger[_0xafbb('0x18')]('Plugin,\x20%s,\x20%s',_0xfa481,_0x326328);_0x3d962e(_0x326328);});});}exports[_0xafbb('0x1d')]=function(_0x1cd268){var _0x560f7f=this;return new Promise(function(_0x5ed59f,_0x1101f5){return db['Plugin'][_0xafbb('0x1e')](_0x1cd268[_0xafbb('0x1f')],{'raw':_0x1cd268[_0xafbb('0x20')]?_0x1cd268[_0xafbb('0x20')][_0xafbb('0x21')]===undefined?!![]:![]:!![]})[_0xafbb('0x12')](function(_0x30ef2c){logger[_0xafbb('0x1b')]('CreatePlugin',_0x1cd268);logger[_0xafbb('0x14')]('CreatePlugin',_0x1cd268,JSON[_0xafbb('0x16')](_0x30ef2c));_0x5ed59f(_0x30ef2c);})[_0xafbb('0x1c')](function(_0x17f265){logger[_0xafbb('0x18')](_0xafbb('0x1d'),_0x17f265[_0xafbb('0x19')],_0x1cd268);_0x1101f5(_0x560f7f['error'](0x1f4,_0x17f265['message']));});});};
\ No newline at end of file
+var _0xab01=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreatePlugin','options','raw','debug','catch','util','moment'];(function(_0x2bfe52,_0x43946e){var _0x1cf649=function(_0xc8300c){while(--_0xc8300c){_0x2bfe52['push'](_0x2bfe52['shift']());}};_0x1cf649(++_0x43946e);}(_0xab01,0x99));var _0x1ab0=function(_0xa042a2,_0x59f0b9){_0xa042a2=_0xa042a2-0x0;var _0x398132=_0xab01[_0xa042a2];return _0x398132;};'use strict';var _=require('lodash');var util=require(_0x1ab0('0x0'));var moment=require(_0x1ab0('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ab0('0x2'));var fs=require('fs');var Redis=require(_0x1ab0('0x3'));var db=require(_0x1ab0('0x4'))['db'];var utils=require(_0x1ab0('0x5'));var logger=require(_0x1ab0('0x6'))(_0x1ab0('0x7'));var config=require(_0x1ab0('0x8'));var jayson=require(_0x1ab0('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x1ab0('0xa')](config[_0x1ab0('0xb')],{'host':_0x1ab0('0xc'),'port':0x18eb});var socket=require(_0x1ab0('0xd'))(new Redis(config[_0x1ab0('0xb')]));require(_0x1ab0('0xe'))[_0x1ab0('0xf')](socket);function respondWithRpcPromise(_0x17f5e3,_0x31ac41,_0x54e133){return new BPromise(function(_0x1759e9,_0x55c100){return client[_0x1ab0('0x10')](_0x17f5e3,_0x54e133)[_0x1ab0('0x11')](function(_0x3a4582){logger[_0x1ab0('0x12')](_0x1ab0('0x13'),_0x31ac41,_0x1ab0('0x14'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x31ac41,'request\x20sent',JSON[_0x1ab0('0x15')](_0x3a4582));if(_0x3a4582[_0x1ab0('0x16')]){if(_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x17')]===0x1f4){logger[_0x1ab0('0x16')]('Plugin,\x20%s,\x20%s',_0x31ac41,_0x3a4582['error'][_0x1ab0('0x18')]);return _0x55c100(_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x18')]);}logger[_0x1ab0('0x16')]('Plugin,\x20%s,\x20%s',_0x31ac41,_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x18')]);return _0x1759e9(_0x3a4582[_0x1ab0('0x16')][_0x1ab0('0x18')]);}else{logger[_0x1ab0('0x12')](_0x1ab0('0x13'),_0x31ac41,_0x1ab0('0x14'));_0x1759e9(_0x3a4582[_0x1ab0('0x19')][_0x1ab0('0x18')]);}})['catch'](function(_0x22af64){logger[_0x1ab0('0x16')](_0x1ab0('0x13'),_0x31ac41,_0x22af64);_0x55c100(_0x22af64);});});}exports[_0x1ab0('0x1a')]=function(_0x3d1744){var _0xb6f234=this;return new Promise(function(_0x3f50f0,_0x59f2d6){return db['Plugin']['create'](_0x3d1744['body'],{'raw':_0x3d1744[_0x1ab0('0x1b')]?_0x3d1744['options'][_0x1ab0('0x1c')]===undefined?!![]:![]:!![]})[_0x1ab0('0x11')](function(_0x416d1d){logger[_0x1ab0('0x12')](_0x1ab0('0x1a'),_0x3d1744);logger[_0x1ab0('0x1d')]('CreatePlugin',_0x3d1744,JSON[_0x1ab0('0x15')](_0x416d1d));_0x3f50f0(_0x416d1d);})[_0x1ab0('0x1e')](function(_0x5294a4){logger[_0x1ab0('0x16')](_0x1ab0('0x1a'),_0x5294a4['message'],_0x3d1744);_0x59f2d6(_0xb6f234[_0x1ab0('0x16')](0x1f4,_0x5294a4[_0x1ab0('0x18')]));});});};
\ No newline at end of file
index e6e5fce..1b3df48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0324=['removeListener','register','length','plugin:','./plugin.events','emit'];(function(_0x24655a,_0x7fa437){var _0x5f4ad4=function(_0x5a3f70){while(--_0x5a3f70){_0x24655a['push'](_0x24655a['shift']());}};_0x5f4ad4(++_0x7fa437);}(_0x0324,0x148));var _0x4032=function(_0x4b3dd1,_0x21edc3){_0x4b3dd1=_0x4b3dd1-0x0;var _0x21598a=_0x0324[_0x4b3dd1];return _0x21598a;};'use strict';var PluginEvents=require(_0x4032('0x0'));var events=['save','remove','update'];function createListener(_0x2ac231,_0x336f64){return function(_0x2ee51f){_0x336f64[_0x4032('0x1')](_0x2ac231,_0x2ee51f);};}function removeListener(_0x269573,_0x2f958d){return function(){PluginEvents[_0x4032('0x2')](_0x269573,_0x2f958d);};}exports[_0x4032('0x3')]=function(_0x479859){for(var _0x3c8e1e=0x0,_0x14cf95=events[_0x4032('0x4')];_0x3c8e1e<_0x14cf95;_0x3c8e1e++){var _0x18e0c1=events[_0x3c8e1e];var _0x2b1e59=createListener(_0x4032('0x5')+_0x18e0c1,_0x479859);PluginEvents['on'](_0x18e0c1,_0x2b1e59);}};
\ No newline at end of file
+var _0x063a=['update','emit','removeListener','register','./plugin.events','remove'];(function(_0x271801,_0x5ea1f6){var _0x119da4=function(_0x4c9910){while(--_0x4c9910){_0x271801['push'](_0x271801['shift']());}};_0x119da4(++_0x5ea1f6);}(_0x063a,0xa6));var _0xa063=function(_0x195988,_0x3062be){_0x195988=_0x195988-0x0;var _0x2da5e4=_0x063a[_0x195988];return _0x2da5e4;};'use strict';var PluginEvents=require(_0xa063('0x0'));var events=['save',_0xa063('0x1'),_0xa063('0x2')];function createListener(_0x96272f,_0x33c241){return function(_0x44173c){_0x33c241[_0xa063('0x3')](_0x96272f,_0x44173c);};}function removeListener(_0x5cf50c,_0x18ddf0){return function(){PluginEvents[_0xa063('0x4')](_0x5cf50c,_0x18ddf0);};}exports[_0xa063('0x5')]=function(_0xd2a15d){for(var _0x49ff03=0x0,_0x4011b9=events['length'];_0x49ff03<_0x4011b9;_0x49ff03++){var _0x438cbd=events[_0x49ff03];var _0x225268=createListener('plugin:'+_0x438cbd,_0xd2a15d);PluginEvents['on'](_0x438cbd,_0x225268);}};
\ No newline at end of file
index 31d7171..cdb6e23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x30e063,_0xb1d240){var _0x1439f5=function(_0x473e6c){while(--_0x473e6c){_0x30e063['push'](_0x30e063['shift']());}};_0x1439f5(++_0xb1d240);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x23479d,_0x4b876c){var _0x587452=function(_0x2b7653){while(--_0x2b7653){_0x23479d['push'](_0x23479d['shift']());}};_0x587452(++_0x4b876c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
index f97466f..1b4db64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['bluebird','status','error','name','send','npm\x20install','info','index','list','reject','express','motion2','catch','show','describe','params','then','create','script','join','../../files/plugins','body','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','path','child_process','exec'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0x54ef,0x112));var _0xf54e=function(_0x14962f,_0xf109c5){_0x14962f=_0x14962f-0x0;var _0x532300=_0x54ef[_0x14962f];return _0x532300;};'use strict';var _=require(_0xf54e('0x0'));var pm2=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var path=require(_0xf54e('0x3'));var exec=require(_0xf54e('0x4'))[_0xf54e('0x5')];var BPromise=require(_0xf54e('0x6'));function handleEntityNotFound(_0x8b6bb6,_0x431e36){return function(_0x12d43f){if(!_0x12d43f){_0x8b6bb6['sendStatus'](0x194);;}return _0x12d43f;};}function respondWithResult(_0x55e611,_0x18e84e){_0x18e84e=_0x18e84e||0xc8;return function(_0x99cf9){if(_0x99cf9){return _0x55e611[_0xf54e('0x7')](_0x18e84e)['json'](_0x99cf9);}return null;};}function handleError(_0x27e69b,_0x57a1ce){_0x57a1ce=_0x57a1ce||0x1f4;return function(_0x40a75d){logger[_0xf54e('0x8')](_0x40a75d['stack']);if(_0x40a75d[_0xf54e('0x9')]){delete _0x40a75d[_0xf54e('0x9')];}_0x27e69b[_0xf54e('0x7')](_0x57a1ce)[_0xf54e('0xa')](_0x40a75d);};}function execChildProcess(){return new BPromise(function(_0x5f232a,_0x558502){exec(_0xf54e('0xb'),function(_0x143d66,_0x326eef,_0x553759){logger[_0xf54e('0xc')](_0x326eef);logger['info'](_0x553759);if(_0x143d66){logger['error'](_0x143d66);return _0x558502(_0x143d66);}return _0x5f232a(_0x326eef);});});}exports[_0xf54e('0xd')]=function(_0x2033e9,_0x28f776){return pm2[_0xf54e('0xe')]()['then'](function(_0x331732){if(_0x331732){var _0x1bbeaa=_[_0xf54e('0xf')](_0x331732,function(_0x15f639){return _0x15f639['name']===_0xf54e('0x10')||_0x15f639[_0xf54e('0x9')]===_0xf54e('0x11');});return{'rows':_0x1bbeaa,'count':_0x1bbeaa['length']};}return null;})['then'](respondWithResult(_0x28f776,null))[_0xf54e('0x12')](handleError(_0x28f776,null));};exports[_0xf54e('0x13')]=function(_0x1c02e7,_0x9647f){return pm2[_0xf54e('0x14')](_0x1c02e7[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x9647f,null))[_0xf54e('0x16')](handleEntityNotFound(_0x9647f,null))[_0xf54e('0x12')](handleError(_0x9647f,null));};exports[_0xf54e('0x17')]=function(_0x226c96,_0x50fc66){if(_0x226c96['body'][_0xf54e('0x9')]&&_0x226c96['body'][_0xf54e('0x18')]){var _0x1bfe99=path[_0xf54e('0x19')](__dirname,_0xf54e('0x1a'),_0x226c96[_0xf54e('0x1b')][_0xf54e('0x18')]);var _0x388aa0=process[_0xf54e('0x1c')]();process[_0xf54e('0x1d')](path[_0xf54e('0x1e')](_0x1bfe99));return execChildProcess()[_0xf54e('0x16')](function(_0x5b83df){process[_0xf54e('0x1d')](_0x388aa0);return pm2['start']({'name':_0x226c96[_0xf54e('0x1b')][_0xf54e('0x9')],'script':_0x1bfe99});})[_0xf54e('0x16')](function(_0x474b61){pm2[_0xf54e('0x1f')]();return _0x474b61[0x0];})[_0xf54e('0x16')](respondWithResult(_0x50fc66,0xc9))[_0xf54e('0x12')](handleError(_0x50fc66,null));}else{return _0x50fc66[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x20')});}};exports[_0xf54e('0x21')]=function(_0x39c0ae,_0x2ea001){if(_0x39c0ae['body']['id']){delete _0x39c0ae[_0xf54e('0x1b')]['id'];}var _0x4cbf7c={'online':_0xf54e('0x22'),'stopped':'stop'};if(_0x4cbf7c[_0xf54e('0x23')](_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')])){return pm2[_0x4cbf7c[_0x39c0ae[_0xf54e('0x1b')][_0xf54e('0x7')]]](_0x39c0ae[_0xf54e('0x15')]['id'])[_0xf54e('0x16')](respondWithResult(_0x2ea001,0xc8))['catch'](handleError(_0x2ea001,null));}else{return _0x2ea001['status'](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x24')});}};exports[_0xf54e('0x25')]=function(_0x16d00f,_0xb2d4c4){if(_0x16d00f[_0xf54e('0x1b')]['id']){delete _0x16d00f[_0xf54e('0x1b')]['id'];}if(_0x16d00f[_0xf54e('0x15')]['id']){return pm2[_0xf54e('0x26')](_0x16d00f[_0xf54e('0x15')]['id'])['then'](function(_0x5f29d3){pm2[_0xf54e('0x1f')]();return _0x5f29d3[0x0];})[_0xf54e('0x16')](respondWithResult(_0xb2d4c4,null))['catch'](handleError(_0xb2d4c4,null));}else{return _0xb2d4c4[_0xf54e('0x7')](0x1f4)[_0xf54e('0xa')]({'message':_0xf54e('0x27')});}};
\ No newline at end of file
+var _0x579c=['express','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','sendStatus','json','error','stack','name','send','npm\x20install','info','index','then'];(function(_0x11b4bc,_0x5e095d){var _0x30eb89=function(_0x250bf9){while(--_0x250bf9){_0x11b4bc['push'](_0x11b4bc['shift']());}};_0x30eb89(++_0x5e095d);}(_0x579c,0xda));var _0xc579=function(_0x3079a6,_0x4c0bf2){_0x3079a6=_0x3079a6-0x0;var _0x55cc26=_0x579c[_0x3079a6];return _0x55cc26;};'use strict';var _=require(_0xc579('0x0'));var pm2=require(_0xc579('0x1'));var logger=require(_0xc579('0x2'))(_0xc579('0x3'));var path=require(_0xc579('0x4'));var exec=require('child_process')[_0xc579('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x21a0a2,_0x3b913c){return function(_0x1ce62b){if(!_0x1ce62b){_0x21a0a2[_0xc579('0x6')](0x194);;}return _0x1ce62b;};}function respondWithResult(_0x124ee5,_0x1bd276){_0x1bd276=_0x1bd276||0xc8;return function(_0x2e451b){if(_0x2e451b){return _0x124ee5['status'](_0x1bd276)[_0xc579('0x7')](_0x2e451b);}return null;};}function handleError(_0x293c4a,_0x2ce949){_0x2ce949=_0x2ce949||0x1f4;return function(_0x2361fc){logger[_0xc579('0x8')](_0x2361fc[_0xc579('0x9')]);if(_0x2361fc[_0xc579('0xa')]){delete _0x2361fc[_0xc579('0xa')];}_0x293c4a['status'](_0x2ce949)[_0xc579('0xb')](_0x2361fc);};}function execChildProcess(){return new BPromise(function(_0x2048bc,_0x17e37f){exec(_0xc579('0xc'),function(_0x9e3fd3,_0x4577a2,_0x2a8e70){logger[_0xc579('0xd')](_0x4577a2);logger[_0xc579('0xd')](_0x2a8e70);if(_0x9e3fd3){logger[_0xc579('0x8')](_0x9e3fd3);return _0x17e37f(_0x9e3fd3);}return _0x2048bc(_0x4577a2);});});}exports[_0xc579('0xe')]=function(_0x4ac675,_0x177314){return pm2['list']()[_0xc579('0xf')](function(_0x59243e){if(_0x59243e){var _0x424e15=_['reject'](_0x59243e,function(_0x44cd32){return _0x44cd32['name']===_0xc579('0x10')||_0x44cd32[_0xc579('0xa')]==='motion2';});return{'rows':_0x424e15,'count':_0x424e15['length']};}return null;})[_0xc579('0xf')](respondWithResult(_0x177314,null))[_0xc579('0x11')](handleError(_0x177314,null));};exports[_0xc579('0x12')]=function(_0x414ee7,_0x7d5865){return pm2[_0xc579('0x13')](_0x414ee7[_0xc579('0x14')]['id'])[_0xc579('0xf')](respondWithResult(_0x7d5865,null))[_0xc579('0xf')](handleEntityNotFound(_0x7d5865,null))[_0xc579('0x11')](handleError(_0x7d5865,null));};exports['create']=function(_0x463f5e,_0x2b7d74){if(_0x463f5e['body'][_0xc579('0xa')]&&_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]){var _0x6501bc=path[_0xc579('0x17')](__dirname,_0xc579('0x18'),_0x463f5e[_0xc579('0x15')][_0xc579('0x16')]);var _0x55781e=process[_0xc579('0x19')]();process[_0xc579('0x1a')](path[_0xc579('0x1b')](_0x6501bc));return execChildProcess()[_0xc579('0xf')](function(_0x1da86e){process['chdir'](_0x55781e);return pm2[_0xc579('0x1c')]({'name':_0x463f5e[_0xc579('0x15')][_0xc579('0xa')],'script':_0x6501bc});})['then'](function(_0x45e1ac){pm2['dump']();return _0x45e1ac[0x0];})[_0xc579('0xf')](respondWithResult(_0x2b7d74,0xc9))[_0xc579('0x11')](handleError(_0x2b7d74,null));}else{return _0x2b7d74[_0xc579('0x1d')](0x1f4)['send']({'message':_0xc579('0x1e')});}};exports['update']=function(_0x532b33,_0x56439a){if(_0x532b33[_0xc579('0x15')]['id']){delete _0x532b33[_0xc579('0x15')]['id'];}var _0xfdbb73={'online':_0xc579('0x1f'),'stopped':_0xc579('0x20')};if(_0xfdbb73[_0xc579('0x21')](_0x532b33[_0xc579('0x15')]['status'])){return pm2[_0xfdbb73[_0x532b33['body'][_0xc579('0x1d')]]](_0x532b33['params']['id'])[_0xc579('0xf')](respondWithResult(_0x56439a,0xc8))[_0xc579('0x11')](handleError(_0x56439a,null));}else{return _0x56439a[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x22')});}};exports[_0xc579('0x23')]=function(_0x45e6a3,_0x133d08){if(_0x45e6a3['body']['id']){delete _0x45e6a3[_0xc579('0x15')]['id'];}if(_0x45e6a3[_0xc579('0x14')]['id']){return pm2[_0xc579('0x24')](_0x45e6a3[_0xc579('0x14')]['id'])['then'](function(_0x57299e){pm2[_0xc579('0x25')]();return _0x57299e[0x0];})['then'](respondWithResult(_0x133d08,null))[_0xc579('0x11')](handleError(_0x133d08,null));}else{return _0x133d08[_0xc579('0x1d')](0x1f4)[_0xc579('0xb')]({'message':_0xc579('0x26')});}};
\ No newline at end of file
index 1a311f1..c70c2ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x632b=['isAuthenticated','get','/queues','getQueues','exports','express','./realtime.controller','/agents'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x632b,0x14d));var _0xb632=function(_0x3f38b4,_0x3ade17){_0x3f38b4=_0x3f38b4-0x0;var _0x4cf7eb=_0x632b[_0x3f38b4];return _0x4cf7eb;};'use strict';var express=require(_0xb632('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xb632('0x1'));router['get'](_0xb632('0x2'),auth[_0xb632('0x3')](),controller['getAgents']);router[_0xb632('0x4')](_0xb632('0x5'),auth[_0xb632('0x3')](),controller[_0xb632('0x6')]);module[_0xb632('0x7')]=router;
\ No newline at end of file
+var _0x164b=['getAgents','getQueues','exports','Router','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x164b,0x7b));var _0xb164=function(_0x51e1d5,_0x399588){_0x51e1d5=_0x51e1d5-0x0;var _0x105666=_0x164b[_0x51e1d5];return _0x105666;};'use strict';var express=require('express');var router=express[_0xb164('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xb164('0x1'));router[_0xb164('0x2')](_0xb164('0x3'),auth[_0xb164('0x4')](),controller[_0xb164('0x5')]);router[_0xb164('0x2')]('/queues',auth[_0xb164('0x4')](),controller[_0xb164('0x6')]);module[_0xb164('0x7')]=router;
\ No newline at end of file
index 61332c5..22a7c32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236b=['Queue','name','outbound','dialMethod','userProfileId','voice','QueueCampaigns','Queues','filter','getResources','findAndCountAll','getRealtimeQueues','initializeQueues','util','../../components/realtime/agents','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','offset','limit','count','status','set','json','getChannels','globalQueueFilter','pauseTypeFilter','pause','resolve','query','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','globalStatus','getUpdatedSortOptions','fields','join','order','then','getAgentIdsByQueues','getRealtimeAgents','getAgentIdsByStatus','map','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','length','sequelize','FIELD(id,','forEach','*pause','push','Pause','where','merge','user','assign','UserProfile','rows','filterAgentAttributes','getAgentStatus','Status','sortAgentsByStatus','pick','catch','getQueues','startCase'];(function(_0x203eb0,_0x288756){var _0x51a005=function(_0x431821){while(--_0x431821){_0x203eb0['push'](_0x203eb0['shift']());}};_0x51a005(++_0x288756);}(_0x236b,0x198));var _0xb236=function(_0x3dd399,_0x1268b5){_0x3dd399=_0x3dd399-0x0;var _0x1b6283=_0x236b[_0x3dd399];return _0x1b6283;};'use strict';var _=require('lodash');var util=require(_0xb236('0x0'));var rta=require(_0xb236('0x1'));var rtq=require('../../components/realtime/queues');var qs=require(_0xb236('0x2'));var utils=require(_0xb236('0x3'));var db=require(_0xb236('0x4'))['db'];var APIBadRequestError=require(_0xb236('0x5'))[_0xb236('0x6')];var APIHandleError=require(_0xb236('0x5'))['handleError'];function respondWithFilteredResult(_0x4ffe26,_0x1fd7ab){return function(_0x411435){if(_0x411435){var _0x39c843=typeof _0x1fd7ab[_0xb236('0x7')]==='undefined'&&typeof _0x1fd7ab[_0xb236('0x8')]==='undefined';var _0x558d81=_0x411435[_0xb236('0x9')];var _0x5892fd=_0x39c843?0x0:_0x1fd7ab[_0xb236('0x7')];var _0x3f9162=_0x39c843?_0x411435['count']:_0x1fd7ab[_0xb236('0x7')]+_0x1fd7ab[_0xb236('0x8')];var _0x316283;if(_0x3f9162>=_0x558d81){_0x3f9162=_0x558d81;_0x316283=0xc8;}else{_0x316283=0xce;}_0x4ffe26[_0xb236('0xa')](_0x316283);return _0x4ffe26[_0xb236('0xb')]('Content-Range',_0x5892fd+'-'+_0x3f9162+'/'+_0x558d81)[_0xb236('0xc')](_0x411435);}return null;};}exports['getAgents']=function(_0x55845a,_0x269b38){var _0x28dd08={'count':0x0,'rows':[]};var _0x4c9c3f={};var _0x204d6d;var _0x1ad36d=utils[_0xb236('0xd')]();var _0x285e75;var _0xc2413d;var _0xa02480=_0x55845a['query'][_0xb236('0xe')];var _0x446fbb=_0x55845a['query']['globalStatusFilter'];var _0x4084ce=_0x55845a['query'][_0xb236('0xf')];var _0x42eb7e=_0x446fbb===_0xb236('0x10')||_0x446fbb==='*pause'?!![]:![];var _0x3934e8=[];var _0x2f3baa;var _0x42f56b;Promise[_0xb236('0x11')]()['then'](function(){if(_0x55845a[_0xb236('0x12')][_0xb236('0x13')]){if(!utils[_0xb236('0x14')](_0x55845a[_0xb236('0x12')][_0xb236('0x13')])){throw new APIBadRequestError(util[_0xb236('0x15')](_0xb236('0x16'),_0x55845a['query'][_0xb236('0x13')]));}_0x204d6d=_0x55845a['query'][_0xb236('0x13')][_0xb236('0x17')]();}if(!_0x55845a[_0xb236('0x12')][_0xb236('0x18')]||!_0x55845a[_0xb236('0x12')][_0xb236('0x18')][_0xb236('0x19')](_0xb236('0x1a'))){_0x55845a[_0xb236('0x12')]['sort']=rta['validateSortParameter'](_0x55845a[_0xb236('0x12')]['sort']);return;}var _0x4b9c15=rta[_0xb236('0x1b')](_0x55845a[_0xb236('0x12')]['sort']);_0x55845a[_0xb236('0x12')][_0xb236('0x18')]=_0x4b9c15[_0xb236('0x1c')][_0xb236('0x1d')](',');_0x2f3baa=_0x4b9c15[_0xb236('0x1e')];})[_0xb236('0x1f')](function(){if(!_0xa02480){return[];}return rta[_0xb236('0x20')](_0xa02480,_0x204d6d);})[_0xb236('0x1f')](function(_0x5ece9c){_0x3934e8=_0x5ece9c;return rta[_0xb236('0x21')]();})[_0xb236('0x1f')](function(_0x283b15){_0xc2413d=_0x283b15['rows'];if((!_0x446fbb||_0x42eb7e)&&!_0x2f3baa){return _0x3934e8;}if(_0x2f3baa&&!_0x446fbb){return rta['getSortedAgentsIdsByStatus'](_0xc2413d,_0x3934e8,_0x2f3baa);}else{return rta[_0xb236('0x22')](_0xc2413d,_0x3934e8,_0x446fbb);}})[_0xb236('0x1f')](function(_0x2814e8){_0x3934e8=_0x2814e8;var _0x1b831e=![];if(_0x3934e8['length']===0x0){if(_0xa02480||_0x446fbb){_0x1b831e=!![];}if(_0x42eb7e){_0x1b831e=![];}}if(_0x1b831e){return _0x28dd08;}var _0x2377d4=_[_0xb236('0x23')](db[_0xb236('0x24')][_0xb236('0x25')],function(_0x381cad){return{'name':_0x381cad[_0xb236('0x26')],'type':_0x381cad[_0xb236('0x27')][_0xb236('0x28')]};});_0x55845a[_0xb236('0x12')][_0xb236('0x29')]=_0xb236('0x2a');_0x55845a[_0xb236('0x12')][_0xb236('0x2b')]=!![];_0x4c9c3f=qs[_0xb236('0x2c')](_0x2377d4,_0x55845a);_0x4c9c3f['raw']=!![];var _0x2710d5=[];if(_0x3934e8[_0xb236('0x2d')]>0x0){_0x2710d5['push']({'id':{'$in':_0x3934e8}});if(_0x2f3baa&&!_0x446fbb){_0x42f56b=[db[_0xb236('0x2e')]['literal'](_0xb236('0x2f')+_0x3934e8+')')];_0x4c9c3f[_0xb236('0x1e')]=_0x42f56b;}}if(_0x42eb7e){_0x1ad36d[_0xb236('0x30')](function(_0x23733d){var _0x345631=!![];if(_0x446fbb===_0xb236('0x31')&&_0x204d6d!==_0x23733d){_0x345631=![];}_0x2710d5[_0xb236('0x32')]({[_0x23733d+_0xb236('0x33')]:_0x345631});});if(_0x4084ce){_0x2710d5['push']({'pauseType':_0x4084ce});}}else if(_0x446fbb){_0x1ad36d['forEach'](function(_0x3298fa){_0x2710d5[_0xb236('0x32')]({[_0x3298fa+'Pause']:![]});});}_0x4c9c3f[_0xb236('0x34')]=_[_0xb236('0x35')](_0x4c9c3f['where'],{'$and':_0x2710d5});if(_0x55845a[_0xb236('0x36')][_0xb236('0x29')]===_0xb236('0x36')){var _0x29faa0={'params':{'id':_0x55845a[_0xb236('0x36')]['userProfileId']},'query':{'section':'Agents','role':'agent','online':!![],'raw':!![],'ids':_0x3934e8,'customSorting':_0x42f56b}};if(_0x42eb7e){_0x29faa0[_0xb236('0x12')]['extraQueryConditions']=_0x2710d5;}_0x29faa0[_0xb236('0x12')]=Object[_0xb236('0x37')](_0x29faa0['query'],_0x55845a['query']);delete _0x29faa0[_0xb236('0x12')]['id'];return db[_0xb236('0x38')]['getResources'](_0x29faa0);}return db[_0xb236('0x24')]['findAndCountAll'](_0x4c9c3f);})[_0xb236('0x1f')](function(_0x2531e4){_0x28dd08[_0xb236('0x9')]=_0x2531e4[_0xb236('0x9')];_0x285e75=_0x2531e4[_0xb236('0x39')];return _0x285e75[_0xb236('0x23')](function(_0x18157a){var _0xf0effd=_['find'](_0xc2413d,['id',_0x18157a['id']]);if(_0xf0effd){var _0x40ff3c=rta[_0xb236('0x3a')](_0xf0effd);_[_0xb236('0x35')](_0x18157a,_0x40ff3c);}_0x18157a[_0xb236('0x1a')]=rta[_0xb236('0x3b')](_0x18157a);if(_0x18157a['globalStatus'][_0xb236('0x19')](_0xb236('0x10'))){_0x1ad36d[_0xb236('0x30')](function(_0x55aa0f){if(_0x18157a[_0x55aa0f+_0xb236('0x33')]){_0x18157a[_0x55aa0f+_0xb236('0x3c')]=_0xb236('0x10');}});}return _0x18157a;});})[_0xb236('0x1f')](function(_0x57b422){if(!_0x2f3baa||_0x42f56b){return _0x57b422;}return rta[_0xb236('0x3d')](_0x57b422,_0x2f3baa);})[_0xb236('0x1f')](function(_0x131942){var _0xc16656=null;if(_0x55845a[_0xb236('0x12')][_0xb236('0x1c')]){var _0x489780=_0x55845a[_0xb236('0x12')]['fields']['split'](',');_0xc16656=_0x131942[_0xb236('0x23')](function(_0x223a62){return _[_0xb236('0x3e')](_0x223a62,_0x489780);});}_0x28dd08['rows']=_0xc16656||_0x131942;return _0x28dd08;})[_0xb236('0x1f')](respondWithFilteredResult(_0x269b38,_0x4c9c3f))[_0xb236('0x3f')](APIHandleError(_0x269b38));};exports[_0xb236('0x40')]=function(_0x5876fc,_0x3948ff){var _0x19a63a={'count':0x0,'rows':[]};var _0xc325d3={};var _0x4b5f78;var _0x33e727;var _0x48dc91;Promise[_0xb236('0x11')]()['then'](function(){if(_0x5876fc['query'][_0xb236('0x13')]){if(!utils[_0xb236('0x14')](_0x5876fc[_0xb236('0x12')]['channel'])){throw new APIBadRequestError(util[_0xb236('0x15')](_0xb236('0x16'),_0x5876fc[_0xb236('0x12')]['channel']));}_0x4b5f78=_0x5876fc[_0xb236('0x12')][_0xb236('0x13')][_0xb236('0x17')]();}var _0x54f2b9=_[_0xb236('0x41')](_0x4b5f78)+_0xb236('0x42');var _0x145c5e=_[_0xb236('0x23')](db[_0x54f2b9][_0xb236('0x25')],function(_0x2a1329){return{'name':_0x2a1329[_0xb236('0x26')],'type':_0x2a1329[_0xb236('0x27')][_0xb236('0x28')]};});if(!_0x5876fc[_0xb236('0x12')][_0xb236('0x1c')]){var _0x29fe47=['id',_0xb236('0x43')];if(_0x4b5f78==='voice'){_0x29fe47[_0xb236('0x32')](_0xb236('0x27'));if(_0x5876fc[_0xb236('0x12')][_0xb236('0x27')]===_0xb236('0x44')){_0x29fe47['push'](['dialActive',_0xb236('0x45')]);}}_0x5876fc['query']['fields']=_0x29fe47[_0xb236('0x1d')](',');}_0xc325d3=qs[_0xb236('0x2c')](_0x145c5e,_0x5876fc);if(_0x5876fc[_0xb236('0x36')]['role']===_0xb236('0x36')){var _0x28ff4c={'params':{'id':_0x5876fc['user'][_0xb236('0x46')]},'query':{'section':_0x4b5f78===_0xb236('0x47')&&_0x5876fc[_0xb236('0x12')][_0xb236('0x27')]===_0xb236('0x44')?_0xb236('0x48'):_['startCase'](_0x4b5f78)+_0xb236('0x49'),'type':_0x5876fc[_0xb236('0x12')][_0xb236('0x27')],'nolimit':!![],'sort':_0xb236('0x43'),'filter':_0x5876fc[_0xb236('0x12')][_0xb236('0x4a')]}};return db[_0xb236('0x38')][_0xb236('0x4b')](_0x28ff4c);}return db[_0x54f2b9][_0xb236('0x4c')](_0xc325d3);})['then'](function(_0x4b2a6e){_0x19a63a['count']=_0x4b2a6e[_0xb236('0x9')];_0x33e727=_0x4b2a6e[_0xb236('0x39')];return rtq[_0xb236('0x4d')](_0x5876fc,_0x4b5f78);})[_0xb236('0x1f')](function(_0x456f83){_0x48dc91=_0x456f83[_0xb236('0x39')];return rtq[_0xb236('0x4e')](_0x33e727,_0x48dc91,_0x4b5f78,_0x5876fc[_0xb236('0x12')][_0xb236('0x27')]);})[_0xb236('0x1f')](function(_0x3fe224){_0x19a63a[_0xb236('0x39')]=_0x3fe224;return _0x19a63a;})[_0xb236('0x1f')](respondWithFilteredResult(_0x3948ff,_0xc325d3))[_0xb236('0x3f')](APIHandleError(_0x3948ff));};
\ No newline at end of file
+var _0x8321=['getAgentStatus','globalStatus','Status','sortAgentsByStatus','pick','catch','getQueues','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','Queue','name','voice','dialActive','dialMethod','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getRealtimeQueues','initializeQueues','util','../../components/realtime/queues','../../config/utils','../../mysqldb','../../errors/api','APIBadRequestError','handleError','offset','limit','undefined','count','status','set','json','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','pause','*pause','resolve','then','format','channel','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','order','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','online','getOptions','raw','push','sequelize','literal','FIELD(id,','forEach','Pause','merge','where','user','Agents','extraQueryConditions','getResources','findAndCountAll','find','filterAgentAttributes'];(function(_0x3d8ddb,_0x2cd68f){var _0x4010d3=function(_0x415ce5){while(--_0x415ce5){_0x3d8ddb['push'](_0x3d8ddb['shift']());}};_0x4010d3(++_0x2cd68f);}(_0x8321,0xbf));var _0x1832=function(_0x504ceb,_0xec7924){_0x504ceb=_0x504ceb-0x0;var _0x2ff29f=_0x8321[_0x504ceb];return _0x2ff29f;};'use strict';var _=require('lodash');var util=require(_0x1832('0x0'));var rta=require('../../components/realtime/agents');var rtq=require(_0x1832('0x1'));var qs=require('../../components/parsers/qs');var utils=require(_0x1832('0x2'));var db=require(_0x1832('0x3'))['db'];var APIBadRequestError=require(_0x1832('0x4'))[_0x1832('0x5')];var APIHandleError=require('../../errors/api')[_0x1832('0x6')];function respondWithFilteredResult(_0x16a33d,_0x5ab77f){return function(_0xb4f6e2){if(_0xb4f6e2){var _0x229cce=typeof _0x5ab77f[_0x1832('0x7')]==='undefined'&&typeof _0x5ab77f[_0x1832('0x8')]===_0x1832('0x9');var _0x1ad647=_0xb4f6e2['count'];var _0x1d47ef=_0x229cce?0x0:_0x5ab77f[_0x1832('0x7')];var _0x2bc069=_0x229cce?_0xb4f6e2[_0x1832('0xa')]:_0x5ab77f[_0x1832('0x7')]+_0x5ab77f['limit'];var _0x58ad6b;if(_0x2bc069>=_0x1ad647){_0x2bc069=_0x1ad647;_0x58ad6b=0xc8;}else{_0x58ad6b=0xce;}_0x16a33d[_0x1832('0xb')](_0x58ad6b);return _0x16a33d[_0x1832('0xc')]('Content-Range',_0x1d47ef+'-'+_0x2bc069+'/'+_0x1ad647)[_0x1832('0xd')](_0xb4f6e2);}return null;};}exports['getAgents']=function(_0xd5646e,_0x360baf){var _0x15d5ed={'count':0x0,'rows':[]};var _0x2804ec={};var _0x5dece4;var _0x111115=utils[_0x1832('0xe')]();var _0x538a0a;var _0x4d7f25;var _0x39fc0f=_0xd5646e[_0x1832('0xf')][_0x1832('0x10')];var _0x1590aa=_0xd5646e[_0x1832('0xf')][_0x1832('0x11')];var _0x122dba=_0xd5646e['query'][_0x1832('0x12')];var _0x5d4b94=_0x1590aa===_0x1832('0x13')||_0x1590aa===_0x1832('0x14')?!![]:![];var _0x3d6236=[];var _0x32f07f;var _0x3b61de;Promise[_0x1832('0x15')]()[_0x1832('0x16')](function(){if(_0xd5646e[_0x1832('0xf')]['channel']){if(!utils['isValidChannel'](_0xd5646e[_0x1832('0xf')]['channel'])){throw new APIBadRequestError(util[_0x1832('0x17')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0xd5646e[_0x1832('0xf')][_0x1832('0x18')]));}_0x5dece4=_0xd5646e[_0x1832('0xf')][_0x1832('0x18')][_0x1832('0x19')]();}if(!_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]||!_0xd5646e[_0x1832('0xf')]['sort'][_0x1832('0x1b')]('globalStatus')){_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]=rta[_0x1832('0x1c')](_0xd5646e[_0x1832('0xf')]['sort']);return;}var _0x636331=rta[_0x1832('0x1d')](_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]);_0xd5646e[_0x1832('0xf')][_0x1832('0x1a')]=_0x636331[_0x1832('0x1e')][_0x1832('0x1f')](',');_0x32f07f=_0x636331[_0x1832('0x20')];})[_0x1832('0x16')](function(){if(!_0x39fc0f){return[];}return rta['getAgentIdsByQueues'](_0x39fc0f,_0x5dece4);})[_0x1832('0x16')](function(_0x41f7f2){_0x3d6236=_0x41f7f2;return rta[_0x1832('0x21')]();})[_0x1832('0x16')](function(_0x30066d){_0x4d7f25=_0x30066d[_0x1832('0x22')];if((!_0x1590aa||_0x5d4b94)&&!_0x32f07f){return _0x3d6236;}if(_0x32f07f&&!_0x1590aa){return rta[_0x1832('0x23')](_0x4d7f25,_0x3d6236,_0x32f07f);}else{return rta[_0x1832('0x24')](_0x4d7f25,_0x3d6236,_0x1590aa);}})[_0x1832('0x16')](function(_0x4a7976){_0x3d6236=_0x4a7976;var _0x1fe455=![];if(_0x3d6236[_0x1832('0x25')]===0x0){if(_0x39fc0f||_0x1590aa){_0x1fe455=!![];}if(_0x5d4b94){_0x1fe455=![];}}if(_0x1fe455){return _0x15d5ed;}var _0x22f67e=_[_0x1832('0x26')](db[_0x1832('0x27')][_0x1832('0x28')],function(_0x5d3a9f){return{'name':_0x5d3a9f[_0x1832('0x29')],'type':_0x5d3a9f[_0x1832('0x2a')][_0x1832('0x2b')]};});_0xd5646e[_0x1832('0xf')][_0x1832('0x2c')]=_0x1832('0x2d');_0xd5646e['query'][_0x1832('0x2e')]=!![];_0x2804ec=qs[_0x1832('0x2f')](_0x22f67e,_0xd5646e);_0x2804ec[_0x1832('0x30')]=!![];var _0x474259=[];if(_0x3d6236['length']>0x0){_0x474259[_0x1832('0x31')]({'id':{'$in':_0x3d6236}});if(_0x32f07f&&!_0x1590aa){_0x3b61de=[db[_0x1832('0x32')][_0x1832('0x33')](_0x1832('0x34')+_0x3d6236+')')];_0x2804ec[_0x1832('0x20')]=_0x3b61de;}}if(_0x5d4b94){_0x111115[_0x1832('0x35')](function(_0x3a6048){var _0x3d10de=!![];if(_0x1590aa===_0x1832('0x14')&&_0x5dece4!==_0x3a6048){_0x3d10de=![];}_0x474259['push']({[_0x3a6048+_0x1832('0x36')]:_0x3d10de});});if(_0x122dba){_0x474259[_0x1832('0x31')]({'pauseType':_0x122dba});}}else if(_0x1590aa){_0x111115[_0x1832('0x35')](function(_0x2c9c2e){_0x474259['push']({[_0x2c9c2e+'Pause']:![]});});}_0x2804ec['where']=_[_0x1832('0x37')](_0x2804ec[_0x1832('0x38')],{'$and':_0x474259});if(_0xd5646e[_0x1832('0x39')][_0x1832('0x2c')]===_0x1832('0x39')){var _0x50b4b5={'params':{'id':_0xd5646e['user']['userProfileId']},'query':{'section':_0x1832('0x3a'),'role':'agent','online':!![],'raw':!![],'ids':_0x3d6236,'customSorting':_0x3b61de}};if(_0x5d4b94){_0x50b4b5[_0x1832('0xf')][_0x1832('0x3b')]=_0x474259;}_0x50b4b5['query']=Object['assign'](_0x50b4b5[_0x1832('0xf')],_0xd5646e['query']);delete _0x50b4b5['query']['id'];return db['UserProfile'][_0x1832('0x3c')](_0x50b4b5);}return db[_0x1832('0x27')][_0x1832('0x3d')](_0x2804ec);})[_0x1832('0x16')](function(_0x1b2b42){_0x15d5ed[_0x1832('0xa')]=_0x1b2b42[_0x1832('0xa')];_0x538a0a=_0x1b2b42[_0x1832('0x22')];return _0x538a0a[_0x1832('0x26')](function(_0x592469){var _0x3b2497=_[_0x1832('0x3e')](_0x4d7f25,['id',_0x592469['id']]);if(_0x3b2497){var _0x58982b=rta[_0x1832('0x3f')](_0x3b2497);_['merge'](_0x592469,_0x58982b);}_0x592469['globalStatus']=rta[_0x1832('0x40')](_0x592469);if(_0x592469[_0x1832('0x41')]['includes'](_0x1832('0x13'))){_0x111115['forEach'](function(_0xcadf4a){if(_0x592469[_0xcadf4a+'Pause']){_0x592469[_0xcadf4a+_0x1832('0x42')]=_0x1832('0x13');}});}return _0x592469;});})[_0x1832('0x16')](function(_0x12d2a8){if(!_0x32f07f||_0x3b61de){return _0x12d2a8;}return rta[_0x1832('0x43')](_0x12d2a8,_0x32f07f);})[_0x1832('0x16')](function(_0x279dc3){var _0x2a2a81=null;if(_0xd5646e[_0x1832('0xf')][_0x1832('0x1e')]){var _0x298dab=_0xd5646e['query']['fields']['split'](',');_0x2a2a81=_0x279dc3[_0x1832('0x26')](function(_0x593505){return _[_0x1832('0x44')](_0x593505,_0x298dab);});}_0x15d5ed[_0x1832('0x22')]=_0x2a2a81||_0x279dc3;return _0x15d5ed;})[_0x1832('0x16')](respondWithFilteredResult(_0x360baf,_0x2804ec))[_0x1832('0x45')](APIHandleError(_0x360baf));};exports[_0x1832('0x46')]=function(_0x4b58f2,_0x589dd6){var _0x4124e2={'count':0x0,'rows':[]};var _0x45d98b={};var _0x54fc24;var _0x2b1c7d;var _0x5197c5;Promise['resolve']()[_0x1832('0x16')](function(){if(_0x4b58f2[_0x1832('0xf')][_0x1832('0x18')]){if(!utils[_0x1832('0x47')](_0x4b58f2['query'][_0x1832('0x18')])){throw new APIBadRequestError(util['format'](_0x1832('0x48'),_0x4b58f2[_0x1832('0xf')][_0x1832('0x18')]));}_0x54fc24=_0x4b58f2['query'][_0x1832('0x18')][_0x1832('0x19')]();}var _0x423300=_['startCase'](_0x54fc24)+_0x1832('0x49');var _0x17e7c1=_['map'](db[_0x423300]['rawAttributes'],function(_0x497e10){return{'name':_0x497e10[_0x1832('0x29')],'type':_0x497e10[_0x1832('0x2a')][_0x1832('0x2b')]};});if(!_0x4b58f2['query'][_0x1832('0x1e')]){var _0x92132d=['id',_0x1832('0x4a')];if(_0x54fc24===_0x1832('0x4b')){_0x92132d[_0x1832('0x31')](_0x1832('0x2a'));if(_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')]==='outbound'){_0x92132d['push']([_0x1832('0x4c'),_0x1832('0x4d')]);}}_0x4b58f2['query'][_0x1832('0x1e')]=_0x92132d[_0x1832('0x1f')](',');}_0x45d98b=qs[_0x1832('0x2f')](_0x17e7c1,_0x4b58f2);if(_0x4b58f2[_0x1832('0x39')][_0x1832('0x2c')]===_0x1832('0x39')){var _0x3549a2={'params':{'id':_0x4b58f2[_0x1832('0x39')][_0x1832('0x4e')]},'query':{'section':_0x54fc24==='voice'&&_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')]===_0x1832('0x4f')?_0x1832('0x50'):_['startCase'](_0x54fc24)+'Queues','type':_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')],'nolimit':!![],'sort':_0x1832('0x4a'),'filter':_0x4b58f2['query'][_0x1832('0x51')]}};return db[_0x1832('0x52')][_0x1832('0x3c')](_0x3549a2);}return db[_0x423300][_0x1832('0x3d')](_0x45d98b);})[_0x1832('0x16')](function(_0x1039b0){_0x4124e2[_0x1832('0xa')]=_0x1039b0['count'];_0x2b1c7d=_0x1039b0[_0x1832('0x22')];return rtq[_0x1832('0x53')](_0x4b58f2,_0x54fc24);})[_0x1832('0x16')](function(_0x5ef5d0){_0x5197c5=_0x5ef5d0[_0x1832('0x22')];return rtq[_0x1832('0x54')](_0x2b1c7d,_0x5197c5,_0x54fc24,_0x4b58f2[_0x1832('0xf')][_0x1832('0x2a')]);})[_0x1832('0x16')](function(_0x4f5f53){_0x4124e2['rows']=_0x4f5f53;return _0x4124e2;})[_0x1832('0x16')](respondWithFilteredResult(_0x589dd6,_0x45d98b))['catch'](APIHandleError(_0x589dd6));};
\ No newline at end of file
index c5315e9..38065f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x508c10,_0x5a15f0){var _0x3108b5=function(_0x4bccaa){while(--_0x4bccaa){_0x508c10['push'](_0x508c10['shift']());}};_0x3108b5(++_0x5a15f0);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1bdeba,_0x5dd8db){var _0x59028c=function(_0x7c8bd5){while(--_0x7c8bd5){_0x1bdeba['push'](_0x1bdeba['shift']());}};_0x59028c(++_0x5dd8db);}(_0xedd9,0xfc));var _0x9edd=function(_0x2a02b9,_0x110c2c){_0x2a02b9=_0x2a02b9-0x0;var _0x578f84=_0xedd9[_0x2a02b9];return _0x578f84;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 5116e44..91829fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dee=['DATE','INTEGER','sequelize','exports','STRING'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x0dee,0xf7));var _0xe0de=function(_0x5871fe,_0xed78a3){_0x5871fe=_0x5871fe-0x0;var _0x1517fd=_0x0dee[_0x5871fe];return _0x1517fd;};'use strict';var Sequelize=require(_0xe0de('0x0'));module[_0xe0de('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe0de('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xe0de('0x2')]},'starttime':{'type':Sequelize[_0xe0de('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe0de('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xe0de('0x2')]},'campaigntype':{'type':Sequelize[_0xe0de('0x2')]},'membername':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x872a=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x96791d,_0x16f0f1){var _0x3e2cad=function(_0x350327){while(--_0x350327){_0x96791d['push'](_0x96791d['shift']());}};_0x3e2cad(++_0x16f0f1);}(_0x872a,0x100));var _0xa872=function(_0x76c66e,_0x5c6276){_0x76c66e=_0x76c66e-0x0;var _0x1c6f1f=_0x872a[_0x76c66e];return _0x1c6f1f;};'use strict';var Sequelize=require(_0xa872('0x0'));module[_0xa872('0x1')]={'state':{'type':Sequelize[_0xa872('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xa872('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa872('0x4')]},'ringtime':{'type':Sequelize[_0xa872('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xa872('0x3')]},'campaigntype':{'type':Sequelize[_0xa872('0x3')]},'membername':{'type':Sequelize[_0xa872('0x3')]}};
\ No newline at end of file
index 3b1fedb..9e0da9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4108=['exports','define','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x536d6c,_0xca1336){var _0x414887=function(_0x557d21){while(--_0x557d21){_0x536d6c['push'](_0x536d6c['shift']());}};_0x414887(++_0xca1336);}(_0x4108,0xb7));var _0x8410=function(_0x3f01b8,_0x441c76){_0x3f01b8=_0x3f01b8-0x0;var _0x1b4c8e=_0x4108[_0x3f01b8];return _0x1b4c8e;};'use strict';var _=require(_0x8410('0x0'));var util=require(_0x8410('0x1'));var logger=require(_0x8410('0x2'))(_0x8410('0x3'));var moment=require(_0x8410('0x4'));var BPromise=require(_0x8410('0x5'));var rp=require(_0x8410('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8410('0x7'));var config=require(_0x8410('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0x8410('0x9')]=function(_0x3f4172,_0x470521){return _0x3f4172[_0x8410('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x8410('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcbf=['exports','define','ReportAgentPreview','report_agent_preview','util','api','moment','bluebird','request-promise','path','./reportAgentPreview.attributes'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xfcbf,0x10c));var _0xffcb=function(_0x3982d2,_0x54927f){_0x3982d2=_0x3982d2-0x0;var _0x508989=_0xfcbf[_0x3982d2];return _0x508989;};'use strict';var _=require('lodash');var util=require(_0xffcb('0x0'));var logger=require('../../config/logger')(_0xffcb('0x1'));var moment=require(_0xffcb('0x2'));var BPromise=require(_0xffcb('0x3'));var rp=require(_0xffcb('0x4'));var fs=require('fs');var path=require(_0xffcb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xffcb('0x6'));module[_0xffcb('0x7')]=function(_0x294e25,_0x4e9ff1){return _0x294e25[_0xffcb('0x8')](_0xffcb('0x9'),attributes,{'tableName':_0xffcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 94382bc..2bddc1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf783=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xf783,0x19b));var _0x3f78=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf783[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3f78('0x0'));var util=require('util');var moment=require(_0x3f78('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f78('0x2'));var db=require(_0x3f78('0x3'))['db'];var utils=require(_0x3f78('0x4'));var logger=require(_0x3f78('0x5'))('rpc');var config=require(_0x3f78('0x6'));var jayson=require(_0x3f78('0x7'));var client=jayson['client'][_0x3f78('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4616b5,_0x5f14bd,_0x5e6413){return new BPromise(function(_0x582ab5,_0x706a80){return client[_0x3f78('0x9')](_0x4616b5,_0x5e6413)[_0x3f78('0xa')](function(_0x1f4af2){logger[_0x3f78('0xb')](_0x3f78('0xc'),_0x5f14bd,'request\x20sent');logger[_0x3f78('0xd')](_0x3f78('0xe'),_0x5f14bd,_0x3f78('0xf'),JSON[_0x3f78('0x10')](_0x1f4af2));if(_0x1f4af2[_0x3f78('0x11')]){if(_0x1f4af2['error'][_0x3f78('0x12')]===0x1f4){logger[_0x3f78('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x5f14bd,_0x1f4af2[_0x3f78('0x11')]['message']);return _0x706a80(_0x1f4af2['error']['message']);}logger[_0x3f78('0x11')](_0x3f78('0xc'),_0x5f14bd,_0x1f4af2[_0x3f78('0x11')][_0x3f78('0x13')]);return _0x582ab5(_0x1f4af2[_0x3f78('0x11')]['message']);}else{logger[_0x3f78('0xb')](_0x3f78('0xc'),_0x5f14bd,_0x3f78('0xf'));_0x582ab5(_0x1f4af2['result'][_0x3f78('0x13')]);}})[_0x3f78('0x14')](function(_0x2ce87d){logger['error'](_0x3f78('0xc'),_0x5f14bd,_0x2ce87d);_0x706a80(_0x2ce87d);});});}exports[_0x3f78('0x15')]=function(_0xb63982){var _0x1aacbb=this;return new Promise(function(_0xbd90b5,_0x43b528){return db[_0x3f78('0x16')][_0x3f78('0x17')](_0xb63982[_0x3f78('0x18')],{'raw':_0xb63982[_0x3f78('0x19')]?_0xb63982[_0x3f78('0x19')][_0x3f78('0x1a')]===undefined?!![]:![]:!![]})[_0x3f78('0xa')](function(_0x24ca69){logger[_0x3f78('0xb')](_0x3f78('0x15'),_0xb63982);logger['debug']('CreateReportAgentPreview',_0xb63982,JSON[_0x3f78('0x10')](_0x24ca69));_0xbd90b5(_0x24ca69);})[_0x3f78('0x14')](function(_0x31cfee){logger[_0x3f78('0x11')](_0x3f78('0x15'),_0x31cfee[_0x3f78('0x13')],_0xb63982);_0x43b528(_0x1aacbb[_0x3f78('0x11')](0x1f4,_0x31cfee['message']));});});};
\ No newline at end of file
+var _0x6111=['create','body','options','raw','debug','CreateReportAgentPreview','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x11ec6c,_0x1a8169){var _0xb59506=function(_0x58e31d){while(--_0x58e31d){_0x11ec6c['push'](_0x11ec6c['shift']());}};_0xb59506(++_0x1a8169);}(_0x6111,0x97));var _0x1611=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x6111[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x1611('0x0'));var moment=require(_0x1611('0x1'));var BPromise=require(_0x1611('0x2'));var rs=require(_0x1611('0x3'));var fs=require('fs');var Redis=require(_0x1611('0x4'));var db=require(_0x1611('0x5'))['db'];var utils=require(_0x1611('0x6'));var logger=require(_0x1611('0x7'))(_0x1611('0x8'));var config=require(_0x1611('0x9'));var jayson=require(_0x1611('0xa'));var client=jayson[_0x1611('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f274d,_0x3ebdab,_0x19c562){return new BPromise(function(_0x558961,_0x2bb9a5){return client['request'](_0x3f274d,_0x19c562)[_0x1611('0xc')](function(_0xd81f46){logger['info'](_0x1611('0xd'),_0x3ebdab,'request\x20sent');logger['debug'](_0x1611('0xe'),_0x3ebdab,'request\x20sent',JSON[_0x1611('0xf')](_0xd81f46));if(_0xd81f46['error']){if(_0xd81f46[_0x1611('0x10')][_0x1611('0x11')]===0x1f4){logger[_0x1611('0x10')](_0x1611('0xd'),_0x3ebdab,_0xd81f46[_0x1611('0x10')][_0x1611('0x12')]);return _0x2bb9a5(_0xd81f46['error'][_0x1611('0x12')]);}logger[_0x1611('0x10')](_0x1611('0xd'),_0x3ebdab,_0xd81f46[_0x1611('0x10')][_0x1611('0x12')]);return _0x558961(_0xd81f46[_0x1611('0x10')][_0x1611('0x12')]);}else{logger[_0x1611('0x13')](_0x1611('0xd'),_0x3ebdab,_0x1611('0x14'));_0x558961(_0xd81f46[_0x1611('0x15')][_0x1611('0x12')]);}})[_0x1611('0x16')](function(_0x11b76e){logger[_0x1611('0x10')](_0x1611('0xd'),_0x3ebdab,_0x11b76e);_0x2bb9a5(_0x11b76e);});});}exports['CreateReportAgentPreview']=function(_0x45d72c){var _0x48e4c0=this;return new Promise(function(_0x4b5714,_0x50addb){return db['ReportAgentPreview'][_0x1611('0x17')](_0x45d72c[_0x1611('0x18')],{'raw':_0x45d72c[_0x1611('0x19')]?_0x45d72c[_0x1611('0x19')][_0x1611('0x1a')]===undefined?!![]:![]:!![]})[_0x1611('0xc')](function(_0x4e59a1){logger['info']('CreateReportAgentPreview',_0x45d72c);logger[_0x1611('0x1b')](_0x1611('0x1c'),_0x45d72c,JSON[_0x1611('0xf')](_0x4e59a1));_0x4b5714(_0x4e59a1);})['catch'](function(_0x21408a){logger[_0x1611('0x10')](_0x1611('0x1c'),_0x21408a[_0x1611('0x12')],_0x45d72c);_0x50addb(_0x48e4c0['error'](0x1f4,_0x21408a[_0x1611('0x12')]));});});};
\ No newline at end of file
index 801bd09..574d3fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaff1=['/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','showChatQueues','/fax/queues/:id/notify','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','/voice/queues/preview/:id','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','/campaigns','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions'];(function(_0x43ea10,_0x30897e){var _0x54a1b1=function(_0x1d35bf){while(--_0x1d35bf){_0x43ea10['push'](_0x43ea10['shift']());}};_0x54a1b1(++_0x30897e);}(_0xaff1,0x130));var _0x1aff=function(_0x184d1c,_0x4a7a34){_0x184d1c=_0x184d1c-0x0;var _0x20c6b6=_0xaff1[_0x184d1c];return _0x20c6b6;};'use strict';var multer=require(_0x1aff('0x0'));var util=require(_0x1aff('0x1'));var path=require(_0x1aff('0x2'));var express=require(_0x1aff('0x3'));var router=express[_0x1aff('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x1aff('0x5'));router[_0x1aff('0x6')](_0x1aff('0x7'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x9')]);router[_0x1aff('0x6')](_0x1aff('0xa'),auth[_0x1aff('0x8')](),controller['voiceChannelMixMonitor']);router[_0x1aff('0x6')](_0x1aff('0xb'),auth[_0x1aff('0x8')](),controller[_0x1aff('0xc')]);router[_0x1aff('0x6')](_0x1aff('0xd'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x1aff('0x6')](_0x1aff('0xe'),auth[_0x1aff('0x8')](),controller[_0x1aff('0xf')]);router[_0x1aff('0x6')]('/mail/queues',auth[_0x1aff('0x8')](),controller['mailQueues']);router['get']('/mail/accounts',auth['isAuthenticated'](),controller[_0x1aff('0x10')]);router[_0x1aff('0x6')]('/openchannel/queues',auth[_0x1aff('0x8')](),controller[_0x1aff('0x11')]);router[_0x1aff('0x6')](_0x1aff('0x12'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x13')]);router['get'](_0x1aff('0x14'),auth[_0x1aff('0x8')](),controller['whatsappQueues']);router['get'](_0x1aff('0x15'),auth[_0x1aff('0x8')](),controller['faxQueues']);router[_0x1aff('0x6')](_0x1aff('0x16'),auth[_0x1aff('0x8')](),controller['voiceQueuesPreview']);router[_0x1aff('0x6')]('/voice/queues/channels',auth[_0x1aff('0x8')](),controller[_0x1aff('0x17')]);router[_0x1aff('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x1aff('0x8')](),controller[_0x1aff('0x18')]);router[_0x1aff('0x6')](_0x1aff('0x19'),auth[_0x1aff('0x8')](),controller['voiceQueuesChannelHangup']);router[_0x1aff('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x1aff('0x8')](),controller[_0x1aff('0x1a')]);router[_0x1aff('0x6')](_0x1aff('0x1b'),auth['isAuthenticated'](),controller[_0x1aff('0x1c')]);router['put']('/voice/queues/:id',auth[_0x1aff('0x8')](),controller['updateVoiceQueue']);router[_0x1aff('0x6')](_0x1aff('0x1d'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x1e')]);router[_0x1aff('0x6')]('/outbound/channels',auth[_0x1aff('0x8')](),controller[_0x1aff('0x1f')]);router[_0x1aff('0x6')](_0x1aff('0x20'),auth['isAuthenticated'](),controller[_0x1aff('0x21')]);router['put'](_0x1aff('0x22'),auth[_0x1aff('0x8')](),controller['agentCapacity']);router[_0x1aff('0x6')]('/telephones',auth[_0x1aff('0x8')](),controller[_0x1aff('0x23')]);router[_0x1aff('0x6')](_0x1aff('0x24'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x25')]);router[_0x1aff('0x6')](_0x1aff('0x26'),auth['isAuthenticated'](),controller['campaigns']);router[_0x1aff('0x6')]('/fax/accounts',auth['isAuthenticated'](),controller['faxAccounts']);router[_0x1aff('0x6')](_0x1aff('0x27'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x1aff('0x6')](_0x1aff('0x28'),auth[_0x1aff('0x8')](),controller['mailQueuesWaitingInteractions']);router['get'](_0x1aff('0x29'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x2a')]);router[_0x1aff('0x6')](_0x1aff('0x2b'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x1aff('0x6')](_0x1aff('0x2c'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x2d')]);router['get'](_0x1aff('0x2e'),auth['isAuthenticated'](),controller[_0x1aff('0x2f')]);router[_0x1aff('0x30')](_0x1aff('0x31'),auth['isAuthenticated'](),controller[_0x1aff('0x32')](_0x1aff('0x33')));router['get'](_0x1aff('0x34'),auth['isAuthenticated'](),controller[_0x1aff('0x35')]);router[_0x1aff('0x30')]('/chat/queues/:id/notify',auth[_0x1aff('0x8')](),controller[_0x1aff('0x32')]('chat'));router['get']('/chat/queues/:id',auth[_0x1aff('0x8')](),controller[_0x1aff('0x36')]);router['post'](_0x1aff('0x37'),auth[_0x1aff('0x8')](),controller['queueNotify']('fax'));router[_0x1aff('0x6')]('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x1aff('0x30')](_0x1aff('0x38'),auth['isAuthenticated'](),controller[_0x1aff('0x32')](_0x1aff('0x39')));router['get'](_0x1aff('0x3a'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router['post'](_0x1aff('0x3b'),auth[_0x1aff('0x8')](),controller['queueNotify'](_0x1aff('0x3c')));router[_0x1aff('0x30')](_0x1aff('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x1aff('0x3e')));router[_0x1aff('0x6')](_0x1aff('0x3f'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x40')]);router[_0x1aff('0x6')](_0x1aff('0x41'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x1aff('0x30')](_0x1aff('0x42'),auth[_0x1aff('0x8')](),controller[_0x1aff('0x43')]);module[_0x1aff('0x44')]=router;
\ No newline at end of file
+var _0x47ce=['mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','./rpc.controller','get','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify'];(function(_0x1e8bdc,_0x2115d8){var _0x5a41a9=function(_0x399720){while(--_0x399720){_0x1e8bdc['push'](_0x1e8bdc['shift']());}};_0x5a41a9(++_0x2115d8);}(_0x47ce,0x165));var _0xe47c=function(_0x369e0e,_0x318c72){_0x369e0e=_0x369e0e-0x0;var _0x5a6c64=_0x47ce[_0x369e0e];return _0x5a6c64;};'use strict';var multer=require(_0xe47c('0x0'));var util=require(_0xe47c('0x1'));var path=require(_0xe47c('0x2'));var express=require(_0xe47c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe47c('0x4'));router[_0xe47c('0x5')]('/voice/channels',auth[_0xe47c('0x6')](),controller['voiceChannels']);router[_0xe47c('0x5')](_0xe47c('0x7'),auth['isAuthenticated'](),controller[_0xe47c('0x8')]);router[_0xe47c('0x5')](_0xe47c('0x9'),auth[_0xe47c('0x6')](),controller[_0xe47c('0xa')]);router[_0xe47c('0x5')](_0xe47c('0xb'),auth[_0xe47c('0x6')](),controller[_0xe47c('0xc')]);router['get'](_0xe47c('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0xe47c('0x5')]('/mail/queues',auth[_0xe47c('0x6')](),controller[_0xe47c('0xe')]);router[_0xe47c('0x5')](_0xe47c('0xf'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x10')]);router['get'](_0xe47c('0x11'),auth['isAuthenticated'](),controller[_0xe47c('0x12')]);router[_0xe47c('0x5')]('/sms/queues',auth[_0xe47c('0x6')](),controller[_0xe47c('0x13')]);router[_0xe47c('0x5')](_0xe47c('0x14'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x15')]);router['get'](_0xe47c('0x16'),auth[_0xe47c('0x6')](),controller['faxQueues']);router[_0xe47c('0x5')](_0xe47c('0x17'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x18')]);router[_0xe47c('0x5')]('/voice/queues/channels',auth[_0xe47c('0x6')](),controller[_0xe47c('0x19')]);router[_0xe47c('0x5')](_0xe47c('0x1a'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x1b')]);router[_0xe47c('0x5')](_0xe47c('0x1c'),auth[_0xe47c('0x6')](),controller['voiceQueuesChannelHangup']);router['get'](_0xe47c('0x1d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x1e')]);router[_0xe47c('0x5')]('/voice/queues/:id',auth[_0xe47c('0x6')](),controller[_0xe47c('0x1f')]);router['put'](_0xe47c('0x20'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x21')]);router[_0xe47c('0x5')](_0xe47c('0x22'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x23')]);router['get'](_0xe47c('0x24'),auth['isAuthenticated'](),controller[_0xe47c('0x25')]);router[_0xe47c('0x5')](_0xe47c('0x26'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x27')]);router['put'](_0xe47c('0x28'),auth['isAuthenticated'](),controller[_0xe47c('0x29')]);router[_0xe47c('0x5')]('/telephones',auth[_0xe47c('0x6')](),controller[_0xe47c('0x2a')]);router[_0xe47c('0x5')](_0xe47c('0x2b'),auth['isAuthenticated'](),controller[_0xe47c('0x2c')]);router[_0xe47c('0x5')](_0xe47c('0x2d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x2e')]);router['get'](_0xe47c('0x2f'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x30')]);router[_0xe47c('0x5')](_0xe47c('0x31'),auth['isAuthenticated'](),controller[_0xe47c('0x32')]);router['get'](_0xe47c('0x33'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x34')]);router[_0xe47c('0x5')](_0xe47c('0x35'),auth['isAuthenticated'](),controller[_0xe47c('0x36')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth[_0xe47c('0x6')](),controller[_0xe47c('0x37')]);router[_0xe47c('0x5')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xe47c('0x38')]);router[_0xe47c('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xe47c('0x6')](),controller[_0xe47c('0x39')]);router[_0xe47c('0x5')](_0xe47c('0x3a'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3b')]);router[_0xe47c('0x3c')](_0xe47c('0x3d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x3f')));router[_0xe47c('0x5')](_0xe47c('0x40'),auth['isAuthenticated'](),controller[_0xe47c('0x41')]);router['post'](_0xe47c('0x42'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x43')));router[_0xe47c('0x5')](_0xe47c('0x44'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x45')]);router[_0xe47c('0x3c')]('/fax/queues/:id/notify',auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x46')));router[_0xe47c('0x5')]('/fax/queues/:id',auth[_0xe47c('0x6')](),controller[_0xe47c('0x47')]);router[_0xe47c('0x3c')](_0xe47c('0x48'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x49')));router[_0xe47c('0x5')](_0xe47c('0x4a'),auth[_0xe47c('0x6')](),controller['showOpenchannelQueues']);router[_0xe47c('0x3c')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe47c('0x3e')]('sms'));router[_0xe47c('0x3c')](_0xe47c('0x4b'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x3e')](_0xe47c('0x4c')));router[_0xe47c('0x5')](_0xe47c('0x4d'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x4e')]);router[_0xe47c('0x5')](_0xe47c('0x4f'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x50')]);router['post'](_0xe47c('0x51'),auth[_0xe47c('0x6')](),controller[_0xe47c('0x52')]);module[_0xe47c('0x53')]=router;
\ No newline at end of file
index ef7130a..388ee06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dfd=['interface','format','SIP/%s','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','filter','indexOf','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','findOne','InteractionId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','query','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes'];(function(_0x5a6a1c,_0xb802eb){var _0x132a0e=function(_0x4c3280){while(--_0x4c3280){_0x5a6a1c['push'](_0x5a6a1c['shift']());}};_0x132a0e(++_0xb802eb);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xd7df('0x0'));var moment=require(_0xd7df('0x1'));var _=require(_0xd7df('0x2'));var util=require(_0xd7df('0x3'));var db=require(_0xd7df('0x4'))['db'];var logger=require(_0xd7df('0x5'))(_0xd7df('0x6'));var jayson=require(_0xd7df('0x7'));var amiClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232a});var mailClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232b});var routingClient=jayson[_0xd7df('0x8')][_0xd7df('0x9')]({'port':0x232c});function respondWithRpcPromise(_0x354ea7,_0x16e50,_0x2c48a4){return new BPromise(function(_0x5c220a,_0xab6742){var _0xb3557a=_0x2c48a4?_0x2c48a4:amiClient;return _0xb3557a[_0xd7df('0xa')](_0x354ea7,_0x16e50)[_0xd7df('0xb')](function(_0x5e59c3){if(_0x5e59c3[_0xd7df('0xc')]){if(_0x5e59c3['error'][_0xd7df('0xd')]===0x1f4){return _0xab6742(_0x5e59c3['error'][_0xd7df('0xe')]);}return _0x5c220a(_0x5e59c3[_0xd7df('0xc')][_0xd7df('0xe')]);}else{_0x5c220a(_0x5e59c3[_0xd7df('0xf')]);}})[_0xd7df('0x10')](function(_0x174c88){_0xab6742(_0x174c88);});});}function respondWithResult(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xc8;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x11')](_0x3da618)[_0xd7df('0x12')](_0x7ba3c);}return _0x2e8187[_0xd7df('0x13')](0x194);};}function handleError(_0xe1595f,_0x196632){_0x196632=_0x196632||0x1f4;return function(_0x3b2559){logger[_0xd7df('0xc')](_0x3b2559[_0xd7df('0x14')]);if(_0x3b2559['name']){delete _0x3b2559[_0xd7df('0x15')];}_0xe1595f[_0xd7df('0x11')](_0x196632)['send'](_0x3b2559);};}function findById(_0x18d38f){return function(_0xbe1c5e){if(!_['isNil'](_0x18d38f)&&!_[_0xd7df('0x16')](_0xbe1c5e)&&!_[_0xd7df('0x16')](_0xbe1c5e[_0xd7df('0x17')])){return _['find'](_0xbe1c5e[_0xd7df('0x17')],function(_0x471621){return _0x471621['id']==_0x18d38f;});}return null;};}exports[_0xd7df('0x18')]=function(_0x5ba653,_0x96d86e){return respondWithRpcPromise(_0xd7df('0x19'),_0x5ba653[_0xd7df('0x1a')])['then'](respondWithResult(_0x96d86e,null))[_0xd7df('0x10')](handleError(_0x96d86e,null));};exports['voiceChannelMixMonitor']=function(_0x225e33,_0x5ab737){return respondWithRpcPromise(_0xd7df('0x1b'),_[_0xd7df('0x1c')](_0x225e33[_0xd7df('0x1a')],_0x225e33['params']))[_0xd7df('0xb')](respondWithResult(_0x5ab737,null))['catch'](handleError(_0x5ab737,null));};exports[_0xd7df('0x1d')]=function(_0x379e4a,_0x40e7af){return respondWithRpcPromise(_0xd7df('0x1e'),_[_0xd7df('0x1c')](_0x379e4a[_0xd7df('0x1a')],_0x379e4a[_0xd7df('0x1f')]))['then'](respondWithResult(_0x40e7af,null))['catch'](handleError(_0x40e7af,null));};exports[_0xd7df('0x20')]=function(_0x38db14,_0x26047f){return respondWithRpcPromise(_0xd7df('0x21'),_0x38db14[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x26047f,null))[_0xd7df('0x10')](handleError(_0x26047f,null));};exports[_0xd7df('0x22')]=function(_0x163904,_0x5c4d17){return respondWithRpcPromise(_0xd7df('0x21'),_0x163904[_0xd7df('0x1a')])[_0xd7df('0xb')](findById(_0x163904[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x5c4d17,null))[_0xd7df('0x10')](handleError(_0x5c4d17,null));};exports[_0xd7df('0x23')]=function(_0x36de76,_0x5195cf){return respondWithRpcPromise('UpdateVoiceQueue',_['merge'](_0x36de76['body'],_0x36de76['params']))[_0xd7df('0xb')](respondWithResult(_0x5195cf,null))['catch'](handleError(_0x5195cf,null));};exports[_0xd7df('0x24')]=function(_0x156612,_0x503a90){return respondWithRpcPromise(_0xd7df('0x25'),_[_0xd7df('0x1c')](_0x156612['query'],_0x156612[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x503a90,null))[_0xd7df('0x10')](handleError(_0x503a90,null));};exports[_0xd7df('0x26')]=function(_0x40f965,_0x3304c4){return respondWithRpcPromise('VoiceQueuesChannels',_0x40f965[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x3304c4,null))[_0xd7df('0x10')](handleError(_0x3304c4,null));};exports[_0xd7df('0x27')]=function(_0x363f2d,_0x4cecf2){return respondWithRpcPromise(_0xd7df('0x28'),_[_0xd7df('0x1c')](_0x363f2d[_0xd7df('0x1a')],_0x363f2d[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x4cecf2,null))['catch'](handleError(_0x4cecf2,null));};exports['voiceQueuesChannelHangup']=function(_0x4051fb,_0x564562){return respondWithRpcPromise(_0xd7df('0x29'),_[_0xd7df('0x1c')](_0x4051fb[_0xd7df('0x1a')],_0x4051fb[_0xd7df('0x1f')]))['then'](respondWithResult(_0x564562,null))['catch'](handleError(_0x564562,null));};exports['voiceQueuesChannelRedirect']=function(_0x2a96e3,_0x15e682){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd7df('0x1c')](_0x2a96e3[_0xd7df('0x1a')],_0x2a96e3[_0xd7df('0x1f')]))[_0xd7df('0xb')](respondWithResult(_0x15e682,null))['catch'](handleError(_0x15e682,null));};exports[_0xd7df('0x2a')]=function(_0x45642c,_0x5f0a6d){return respondWithRpcPromise(_0xd7df('0x2b'),_0x45642c['query'])[_0xd7df('0xb')](respondWithResult(_0x5f0a6d,null))[_0xd7df('0x10')](handleError(_0x5f0a6d,null));};exports[_0xd7df('0x2c')]=function(_0x59c755,_0x138391){return respondWithRpcPromise(_0xd7df('0x2d'),_0x59c755[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x138391,null))['catch'](handleError(_0x138391,null));};exports[_0xd7df('0x2e')]=function(_0x230857,_0x2314e6){var _0x4f6286;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')])[_0xd7df('0xb')](function(_0x517824){_0x4f6286=_0x517824;return respondWithRpcPromise(_0xd7df('0x2f'),_0x230857[_0xd7df('0x1a')],routingClient);})['then'](function(_0x4b2561){return _[_0xd7df('0x1c')]({},_0x4b2561,_0x4f6286);})[_0xd7df('0xb')](respondWithResult(_0x2314e6,null))[_0xd7df('0x10')](handleError(_0x2314e6,null));};exports['agentCapacity']=function(_0x5e8cd0,_0x2c149e){if(_0x5e8cd0['body']&&_0x5e8cd0[_0xd7df('0x30')]['interaction']&&_0x5e8cd0['user']&&_0x5e8cd0[_0xd7df('0x31')]['name']){for(var _0x18ef10 in _0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')]){if(_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0xd7df('0x33')](_0x18ef10)){db[_0xd7df('0x34')][_0xd7df('0x35')]({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')]['name'],'type':_0xd7df('0x36'),'exitAt':null,'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10]&&_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0xd7df('0x37')]?{'$notIn':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10]}:{'$ne':null}}})[_0xd7df('0xb')](function(_0x38056b){var _0x3a3c1a=moment()['format'](_0xd7df('0x38'));for(var _0x563f90=0x0,_0x49085b=_0x38056b['length'];_0x563f90<_0x49085b;_0x563f90+=0x1){_0x38056b[_0x563f90][_0xd7df('0x39')]({'exitAt':_0x3a3c1a});}});for(var _0x162900=0x0;_0x162900<_0x5e8cd0[_0xd7df('0x30')]['interaction'][_0x18ef10]['length'];_0x162900+=0x1){db[_0xd7df('0x34')]['findOrCreate']({'where':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'type':_0xd7df('0x36'),'uniqueid':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x32')][_0x18ef10][_0x162900],'exitAt':null},'defaults':{'channel':_0x18ef10,'membername':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x15')],'interface':_[_0xd7df('0x16')](_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')])?util[_0xd7df('0x3b')](_0xd7df('0x3c'),_0x5e8cd0['user'][_0xd7df('0x15')]):_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3a')],'type':_0xd7df('0x36'),'enterAt':moment()[_0xd7df('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd7df('0x3d'),'internal':_0x5e8cd0[_0xd7df('0x31')][_0xd7df('0x3e')],'uniqueid':_0x5e8cd0['body'][_0xd7df('0x32')][_0x18ef10][_0x162900]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x5e8cd0[_0xd7df('0x1f')]['id'],'capacity':_0x5e8cd0[_0xd7df('0x30')][_0xd7df('0x3f')]},routingClient)[_0xd7df('0xb')](respondWithResult(_0x2c149e,null))[_0xd7df('0x10')](handleError(_0x2c149e,null));};exports['telephones']=function(_0x4abe81,_0x53ec02){return respondWithRpcPromise(_0xd7df('0x40'),_0x4abe81['query'])[_0xd7df('0xb')](respondWithResult(_0x53ec02,null))[_0xd7df('0x10')](handleError(_0x53ec02,null));};exports[_0xd7df('0x41')]=function(_0xdf3046,_0x275af9){return respondWithRpcPromise(_0xd7df('0x42'),_0xdf3046[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x275af9,null))[_0xd7df('0x10')](handleError(_0x275af9,null));};exports[_0xd7df('0x43')]=function(_0x382d11,_0x327365){return respondWithRpcPromise(_0xd7df('0x44'),_0x382d11[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x327365,null))[_0xd7df('0x10')](handleError(_0x327365,null));};exports['chatQueues']=function(_0x332db5,_0x28c9b7){return respondWithRpcPromise('ChatQueues',_0x332db5['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x28c9b7,null))['catch'](handleError(_0x28c9b7,null));};exports[_0xd7df('0x45')]=function(_0x4fb55a,_0x1f34c2){return respondWithRpcPromise(_0xd7df('0x46'),_0x4fb55a[_0xd7df('0x1a')],routingClient)['then'](findById(_0x4fb55a['params']['id']))['then'](respondWithResult(_0x1f34c2,null))[_0xd7df('0x10')](handleError(_0x1f34c2,null));};exports[_0xd7df('0x47')]=function(_0x19c387,_0x527b6f){return respondWithRpcPromise(_0xd7df('0x48'),_0x19c387[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x527b6f,null))[_0xd7df('0x10')](handleError(_0x527b6f,null));};exports[_0xd7df('0x49')]=function(_0x35204f,_0x25d187){return respondWithRpcPromise(_0xd7df('0x48'),_0x35204f[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x35204f[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x25d187,null))[_0xd7df('0x10')](handleError(_0x25d187,null));};exports[_0xd7df('0x4a')]=function(_0x398e43,_0x3dba78){return respondWithRpcPromise(_0xd7df('0x4b'),_0x398e43[_0xd7df('0x1a')],mailClient)[_0xd7df('0xb')](respondWithResult(_0x3dba78,null))[_0xd7df('0x10')](handleError(_0x3dba78,null));};exports[_0xd7df('0x4c')]=function(_0x3f2775,_0x1e6277){return respondWithRpcPromise(_0xd7df('0x4d'),_0x3f2775[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x1e6277,null))[_0xd7df('0x10')](handleError(_0x1e6277,null));};exports[_0xd7df('0x4e')]=function(_0x3912d6,_0x51ae2b){return respondWithRpcPromise('OpenchannelQueues',_0x3912d6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3912d6[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x51ae2b,null))[_0xd7df('0x10')](handleError(_0x51ae2b,null));};exports[_0xd7df('0x4f')]=function(_0x1e87aa,_0x2786a6){return respondWithRpcPromise('SmsQueues',_0x1e87aa[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2786a6,null))[_0xd7df('0x10')](handleError(_0x2786a6,null));};exports[_0xd7df('0x50')]=function(_0x19a25b,_0x2fbc53){return respondWithRpcPromise(_0xd7df('0x51'),_0x19a25b[_0xd7df('0x1a')],routingClient)['then'](findById(_0x19a25b[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x2fbc53,null))['catch'](handleError(_0x2fbc53,null));};exports['whatsappQueues']=function(_0x481fa5,_0x264c5b){return respondWithRpcPromise(_0xd7df('0x52'),_0x481fa5[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x264c5b,null))['catch'](handleError(_0x264c5b,null));};exports[_0xd7df('0x53')]=function(_0x3d45cf,_0x19df03){return respondWithRpcPromise(_0xd7df('0x52'),_0x3d45cf[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](findById(_0x3d45cf[_0xd7df('0x1f')]['id']))['then'](respondWithResult(_0x19df03,null))['catch'](handleError(_0x19df03,null));};exports[_0xd7df('0x54')]=function(_0x5c1e68,_0x588537){return respondWithRpcPromise(_0xd7df('0x55'),_0x5c1e68[_0xd7df('0x1a')],routingClient)['then'](respondWithResult(_0x588537,null))['catch'](handleError(_0x588537,null));};exports[_0xd7df('0x56')]=function(_0x44d824,_0x49bf7e){return respondWithRpcPromise(_0xd7df('0x55'),_0x44d824[_0xd7df('0x1a')],routingClient)['then'](findById(_0x44d824[_0xd7df('0x1f')]['id']))[_0xd7df('0xb')](respondWithResult(_0x49bf7e,null))['catch'](handleError(_0x49bf7e,null));};exports[_0xd7df('0x57')]=function(_0x519f72,_0x56f55d){return respondWithRpcPromise(_0xd7df('0x58'),_0x519f72[_0xd7df('0x1a')])[_0xd7df('0xb')](respondWithResult(_0x56f55d,null))[_0xd7df('0x10')](handleError(_0x56f55d,null));};exports[_0xd7df('0x59')]=function(_0x40b2a1,_0x5831c1){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x40b2a1[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x5831c1,null))[_0xd7df('0x10')](handleError(_0x5831c1,null));};exports[_0xd7df('0x5a')]=function(_0x19b0e6,_0x31f681){return respondWithRpcPromise(_0xd7df('0x5b'),_0x19b0e6[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x31f681,null))['catch'](handleError(_0x31f681,null));};exports[_0xd7df('0x5c')]=function(_0x1682ca,_0x4e9806){return respondWithRpcPromise(_0xd7df('0x5d'),_0x1682ca[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4e9806,null))[_0xd7df('0x10')](handleError(_0x4e9806,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4e5363,_0x5628ed){return respondWithRpcPromise(_0xd7df('0x5d'),_0x4e5363['query'],routingClient)[_0xd7df('0xb')](function(_0x2b1b30){if(_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')]!==undefined){var _0x2d8a31=_(_0x2b1b30[_0xd7df('0x17')])['filter']([_0x4e5363[_0xd7df('0x1a')][_0xd7df('0x5e')],_0x4e5363[_0xd7df('0x1f')]['id']])['map'](_0xd7df('0x5f'))[_0xd7df('0x60')]()['value']();return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x157290){return _0x2d8a31[_0xd7df('0x62')](_0x157290[_0xd7df('0x5f')])>-0x1;});}else{return _0x2b1b30[_0xd7df('0x17')][_0xd7df('0x61')](function(_0x5e93cc){return _0x5e93cc[_0xd7df('0x5f')]===parseInt(_0x4e5363[_0xd7df('0x1f')]['id']);});}})[_0xd7df('0xb')](respondWithResult(_0x5628ed,null))[_0xd7df('0x10')](handleError(_0x5628ed,null));};exports['smsQueuesWaitingInteractions']=function(_0x531a07,_0x2e1e96){return respondWithRpcPromise(_0xd7df('0x63'),_0x531a07[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x2e1e96,null))[_0xd7df('0x10')](handleError(_0x2e1e96,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x2329ce,_0x4f739b){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x2329ce[_0xd7df('0x1a')],routingClient)[_0xd7df('0xb')](respondWithResult(_0x4f739b,null))[_0xd7df('0x10')](handleError(_0x4f739b,null));};exports[_0xd7df('0x64')]=function(_0x30c401,_0x3ece24){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x30c401['query'],routingClient)[_0xd7df('0xb')](respondWithResult(_0x3ece24,null))[_0xd7df('0x10')](handleError(_0x3ece24,null));};exports[_0xd7df('0x65')]=function(_0x175a36){return function(_0x5cb2b0,_0xac3b73){var _0x5df36d,_0x158bd9;var _0x5b73e5=_[_0xd7df('0x66')](_0x175a36);var _0x1ed032=_0x175a36===_0xd7df('0x67')?_0xd7df('0x68'):_0xd7df('0x69');return db[_0x5b73e5+_0xd7df('0x6a')]['findOne']({'raw':!![],'where':{'id':_0x5cb2b0[_0xd7df('0x1f')]['id']}})['then'](function(_0x1e2355){if(_[_0xd7df('0x16')](_0x1e2355)){throw new Error(_0x5b73e5+_0xd7df('0x6b'));}_0x5df36d=_0x1e2355;return db[_0x5b73e5+_0xd7df('0x6c')]['findOne']({'where':{'id':_0x5cb2b0[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x5b73e5+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x5b73e5+_0x1ed032],'as':_0xd7df('0x69')}]});})[_0xd7df('0xb')](function(_0x40a665){if(_[_0xd7df('0x16')](_0x40a665)){throw new Error(_0x5b73e5+_0xd7df('0x6f'));}_0x158bd9=_0x40a665;return _0x40a665[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0x15bd27={'uniqueid':_0x175a36+'.'+_0x158bd9['id']+'.'+_0x158bd9['Interaction']['id'],'FromUserId':_0x5cb2b0[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71')};_0x15bd27[_0x5b73e5+_0xd7df('0x72')]=_0x158bd9['id'];_0x15bd27[_0x5b73e5+'InteractionId']=_0x158bd9['Interaction']['id'];_0x15bd27[_0xd7df('0x73')+_0x5b73e5+_0x1ed032+'Id']=_0x158bd9[_0xd7df('0x69')]['id'];_0x15bd27['To'+_0x5b73e5+_0xd7df('0x74')]=_0x5df36d['id'];return db[_0x5b73e5+_0xd7df('0x75')][_0xd7df('0x76')](_0x15bd27);})[_0xd7df('0xb')](function(){return respondWithRpcPromise(_0xd7df('0x77'),{'channel':_0x175a36,'interaction':_0x158bd9[_0xd7df('0x6e')],'message':_0x158bd9,'account':_0x158bd9[_0xd7df('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x71'),'appdata':_0x5df36d['name']+','+(_0x158bd9[_0xd7df('0x69')][_0xd7df('0x78')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0xac3b73,null))[_0xd7df('0x10')](handleError(_0xac3b73,null));};};exports[_0xd7df('0x7a')]=function(_0x50c5b9,_0x518092){var _0xa3ae43,_0x31b159;if(_[_0xd7df('0x16')](_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x1a888c=_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x7b')];var _0x3d9fba=_[_0xd7df('0x66')](_0x1a888c);var _0x2861e3=_0x1a888c===_0xd7df('0x67')?'Website':_0xd7df('0x69');return db['User']['findOne']({'raw':!![],'where':{'id':_0x50c5b9[_0xd7df('0x1f')]['id'],'role':_0xd7df('0x3d')}})[_0xd7df('0xb')](function(_0x5092d2){if(_[_0xd7df('0x16')](_0x5092d2)){throw new Error('Agent\x20not\x20found');}_0xa3ae43=_0x5092d2;return db[_0x3d9fba+'Message'][_0xd7df('0x7c')]({'where':{'id':_0x50c5b9[_0xd7df('0x30')][_0xd7df('0x6d')]},'include':[{'model':db[_0x3d9fba+_0xd7df('0x6e')],'as':_0xd7df('0x6e')},{'model':db[_0x3d9fba+_0x2861e3],'as':'Account'}]});})['then'](function(_0x3f2ecd){if(_[_0xd7df('0x16')](_0x3f2ecd)){throw new Error(_0x3d9fba+_0xd7df('0x6f'));}_0x31b159=_0x3f2ecd;return _0x3f2ecd[_0xd7df('0x70')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd7df('0xb')](function(){var _0xc447e8={'uniqueid':_0x1a888c+'.'+_0x31b159['id']+'.'+_0x31b159[_0xd7df('0x6e')]['id'],'FromUserId':_0x50c5b9[_0xd7df('0x31')]['id'],'type':_0xd7df('0x71'),'ToUserId':_0xa3ae43['id']};_0xc447e8[_0x3d9fba+_0xd7df('0x72')]=_0x31b159['id'];_0xc447e8[_0x3d9fba+_0xd7df('0x7d')]=_0x31b159[_0xd7df('0x6e')]['id'];_0xc447e8[_0xd7df('0x73')+_0x3d9fba+_0x2861e3+'Id']=_0x31b159['Account']['id'];return db[_0x3d9fba+_0xd7df('0x75')][_0xd7df('0x76')](_0xc447e8);})[_0xd7df('0xb')](function(){return respondWithRpcPromise('Start',{'channel':_0x1a888c,'interaction':_0x31b159[_0xd7df('0x6e')],'message':_0x31b159,'account':_0x31b159['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd7df('0x3d'),'appdata':_0xa3ae43[_0xd7df('0x15')]+','+(_0x31b159['Account'][_0xd7df('0x7e')]||0x12c),'interval':_0xd7df('0x79')}]},routingClient);})[_0xd7df('0xb')](respondWithResult(_0x518092,null))[_0xd7df('0x10')](handleError(_0x518092,null));};
\ No newline at end of file
+var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x51ed36,_0x383754){var _0x574db6=function(_0x4697cb){while(--_0x4697cb){_0x51ed36['push'](_0x51ed36['shift']());}};_0x574db6(++_0x383754);}(_0x6f47,0xc7));var _0x76f4=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6f47[_0x173441];return _0x2423a8;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));};
\ No newline at end of file
index f1d627f..a0901ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc97=['/:id','show','run','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0xfc97,0xf1));var _0x7fc9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfc97[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x7fc9('0x0'));var path=require(_0x7fc9('0x1'));var timeout=require(_0x7fc9('0x2'));var express=require(_0x7fc9('0x3'));var router=express[_0x7fc9('0x4')]();var fs_extra=require(_0x7fc9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7fc9('0x6'));var config=require(_0x7fc9('0x7'));var controller=require(_0x7fc9('0x8'));router[_0x7fc9('0x9')]('/',auth[_0x7fc9('0xa')](),controller['index']);router[_0x7fc9('0x9')](_0x7fc9('0xb'),auth[_0x7fc9('0xa')](),controller[_0x7fc9('0xc')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x7fc9('0xd')]);router[_0x7fc9('0xe')]('/',auth['isAuthenticated'](),controller[_0x7fc9('0xf')]);router[_0x7fc9('0x10')]('/:id',auth[_0x7fc9('0xa')](),controller[_0x7fc9('0x11')]);router[_0x7fc9('0x12')](_0x7fc9('0xb'),auth[_0x7fc9('0xa')](),controller[_0x7fc9('0x13')]);module[_0x7fc9('0x14')]=router;
\ No newline at end of file
+var _0xa4d1=['post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run'];(function(_0x2d7aae,_0x41b5bd){var _0x3a3e5e=function(_0x27d878){while(--_0x27d878){_0x2d7aae['push'](_0x2d7aae['shift']());}};_0x3a3e5e(++_0x41b5bd);}(_0xa4d1,0xbf));var _0x1a4d=function(_0x1e4022,_0x2ce85a){_0x1e4022=_0x1e4022-0x0;var _0x51c0c2=_0xa4d1[_0x1e4022];return _0x51c0c2;};'use strict';var multer=require(_0x1a4d('0x0'));var util=require(_0x1a4d('0x1'));var path=require(_0x1a4d('0x2'));var timeout=require('connect-timeout');var express=require(_0x1a4d('0x3'));var router=express[_0x1a4d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1a4d('0x5'));var interaction=require(_0x1a4d('0x6'));var config=require(_0x1a4d('0x7'));var controller=require(_0x1a4d('0x8'));router[_0x1a4d('0x9')]('/',auth[_0x1a4d('0xa')](),controller[_0x1a4d('0xb')]);router[_0x1a4d('0x9')](_0x1a4d('0xc'),auth[_0x1a4d('0xa')](),controller[_0x1a4d('0xd')]);router[_0x1a4d('0x9')](_0x1a4d('0xe'),auth[_0x1a4d('0xa')](),controller[_0x1a4d('0xf')]);router[_0x1a4d('0x10')]('/',auth[_0x1a4d('0xa')](),controller[_0x1a4d('0x11')]);router[_0x1a4d('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x1a4d('0x13')]);router[_0x1a4d('0x14')]('/:id',auth[_0x1a4d('0xa')](),controller[_0x1a4d('0x15')]);module[_0x1a4d('0x16')]=router;
\ No newline at end of file
index bce4e0a..d577780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b4d=['ENUM','years','quarters','months','weeks','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x2b4d,0x189));var _0xd2b4=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0x2b4d[_0x200827];return _0x120047;};'use strict';var Sequelize=require(_0xd2b4('0x0'));module[_0xd2b4('0x1')]={'name':{'type':Sequelize[_0xd2b4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd2b4('0x2')]},'active':{'type':Sequelize[_0xd2b4('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd2b4('0x2')],'allowNull':![],'defaultValue':_0xd2b4('0x4')},'startAt':{'type':Sequelize[_0xd2b4('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd2b4('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd2b4('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd2b4('0x7')](_0xd2b4('0x8'),_0xd2b4('0x9'),_0xd2b4('0xa'),_0xd2b4('0xb'),'days',_0xd2b4('0xc'),_0xd2b4('0xd')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xd2b4('0x7')](_0xd2b4('0xe'),_0xd2b4('0xf'),_0xd2b4('0x10')),'allowNull':![],'defaultValue':_0xd2b4('0xe')},'type':{'type':Sequelize['ENUM'](_0xd2b4('0x11'),_0xd2b4('0x12')),'allowNull':![],'defaultValue':_0xd2b4('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xd2b4('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xd2b4('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xd2b4('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x014b=['days','hours','minutes','csv','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','weeks'];(function(_0x14ae10,_0x5dee7c){var _0x16d6b4=function(_0xf9d956){while(--_0xf9d956){_0x14ae10['push'](_0x14ae10['shift']());}};_0x16d6b4(++_0x5dee7c);}(_0x014b,0x170));var _0xb014=function(_0x13fc45,_0x27004d){_0x13fc45=_0x13fc45-0x0;var _0x257fe7=_0x014b[_0x13fc45];return _0x257fe7;};'use strict';var Sequelize=require(_0xb014('0x0'));module[_0xb014('0x1')]={'name':{'type':Sequelize[_0xb014('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb014('0x2')]},'active':{'type':Sequelize[_0xb014('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xb014('0x2')],'allowNull':![],'defaultValue':_0xb014('0x4')},'startAt':{'type':Sequelize[_0xb014('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xb014('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xb014('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xb014('0x7')](_0xb014('0x8'),'quarters','months',_0xb014('0x9'),_0xb014('0xa'),_0xb014('0xb'),_0xb014('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xb014('0x7')](_0xb014('0xd'),'pdf',_0xb014('0xe')),'allowNull':![],'defaultValue':_0xb014('0xd')},'type':{'type':Sequelize['ENUM'](_0xb014('0xf'),_0xb014('0x10')),'allowNull':![],'defaultValue':_0xb014('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xb014('0x2')]},'cc':{'type':Sequelize[_0xb014('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 60aae94..a6db922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57a7=['merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','includeAll','find','create','body','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','../../config/schedule','run','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','get','Scheduler','UserProfileResource','destroy','error','send','Schedule','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x57a7,0x11a));var _0x757a=function(_0x178fc3,_0x208005){_0x178fc3=_0x178fc3-0x0;var _0x3ee5ef=_0x57a7[_0x178fc3];return _0x3ee5ef;};'use strict';var emlformat=require(_0x757a('0x0'));var rimraf=require(_0x757a('0x1'));var zipdir=require(_0x757a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x757a('0x3'));var moment=require(_0x757a('0x4'));var BPromise=require(_0x757a('0x5'));var Mustache=require(_0x757a('0x6'));var util=require(_0x757a('0x7'));var path=require('path');var sox=require(_0x757a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x757a('0x9'));var _=require(_0x757a('0xa'));var squel=require(_0x757a('0xb'));var crypto=require(_0x757a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x757a('0xd'));var toCsv=require(_0x757a('0xe'));var querystring=require(_0x757a('0xf'));var Papa=require(_0x757a('0x10'));var Redis=require(_0x757a('0x11'));var authService=require(_0x757a('0x12'));var qs=require(_0x757a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x757a('0x14'));var logger=require(_0x757a('0x15'))(_0x757a('0x16'));var utils=require(_0x757a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x757a('0x18'));var db=require(_0x757a('0x19'))['db'];function respondWithStatusCode(_0x6e38f,_0x345948){_0x345948=_0x345948||0xcc;return function(_0x23c0ab){if(_0x23c0ab){return _0x6e38f[_0x757a('0x1a')](_0x345948);}return _0x6e38f[_0x757a('0x1b')](_0x345948)[_0x757a('0x1c')]();};}function respondWithResult(_0x3fc1c6,_0x1bf805){_0x1bf805=_0x1bf805||0xc8;return function(_0x5c2aaa){if(_0x5c2aaa){return _0x3fc1c6[_0x757a('0x1b')](_0x1bf805)['json'](_0x5c2aaa);}};}function respondWithFilteredResult(_0x2d5273,_0x55da69){return function(_0x56cd1f){if(_0x56cd1f){var _0x3adb3b=typeof _0x55da69['offset']===_0x757a('0x1d')&&typeof _0x55da69[_0x757a('0x1e')]==='undefined';var _0x274c2e=_0x56cd1f[_0x757a('0x1f')];var _0x478a2b=_0x3adb3b?0x0:_0x55da69[_0x757a('0x20')];var _0x12bd78=_0x3adb3b?_0x56cd1f['count']:_0x55da69[_0x757a('0x20')]+_0x55da69['limit'];var _0x4faa04;if(_0x12bd78>=_0x274c2e){_0x12bd78=_0x274c2e;_0x4faa04=0xc8;}else{_0x4faa04=0xce;}_0x2d5273[_0x757a('0x1b')](_0x4faa04);return _0x2d5273[_0x757a('0x21')](_0x757a('0x22'),_0x478a2b+'-'+_0x12bd78+'/'+_0x274c2e)[_0x757a('0x23')](_0x56cd1f);}return null;};}function patchUpdates(_0x52ff59){return function(_0x507717){try{jsonpatch[_0x757a('0x24')](_0x507717,_0x52ff59,!![]);}catch(_0x27bee2){return BPromise[_0x757a('0x25')](_0x27bee2);}return _0x507717[_0x757a('0x26')]();};}function saveUpdates(_0x23a997,_0x450bc2){return function(_0x2d0ed5){if(_0x2d0ed5){return _0x2d0ed5['update'](_0x23a997)[_0x757a('0x27')](function(_0x72817a){return _0x72817a;});}return null;};}function removeEntity(_0x1518e6,_0x21babb){return function(_0x11af35){if(_0x11af35){return _0x11af35['destroy']()[_0x757a('0x27')](function(){var _0x23817b=_0x11af35[_0x757a('0x28')]({'plain':!![]});var _0x5805ce=_0x757a('0x29');return db[_0x757a('0x2a')][_0x757a('0x2b')]({'where':{'type':_0x5805ce,'resourceId':_0x23817b['id']}})[_0x757a('0x27')](function(){return _0x11af35;});})[_0x757a('0x27')](function(){_0x1518e6[_0x757a('0x1b')](0xcc)[_0x757a('0x1c')]();});}};}function handleEntityNotFound(_0x251d11,_0x588ed8){return function(_0x1c9625){if(!_0x1c9625){_0x251d11[_0x757a('0x1a')](0x194);}return _0x1c9625;};}function handleError(_0x407066,_0x4e247f){_0x4e247f=_0x4e247f||0x1f4;return function(_0x18a275){logger[_0x757a('0x2c')](_0x18a275['stack']);if(_0x18a275['name']){delete _0x18a275['name'];}_0x407066[_0x757a('0x1b')](_0x4e247f)[_0x757a('0x2d')](_0x18a275);};}exports['index']=function(_0x581569,_0x336f80){var _0x1e5a5a={},_0x4be54d={},_0x117264={'count':0x0,'rows':[]};var _0x28d6da=_['map'](db[_0x757a('0x2e')][_0x757a('0x2f')],function(_0xffe3ca){return{'name':_0xffe3ca[_0x757a('0x30')],'type':_0xffe3ca[_0x757a('0x31')][_0x757a('0x32')]};});_0x4be54d[_0x757a('0x33')]=_[_0x757a('0x34')](_0x28d6da,_0x757a('0x35'));_0x4be54d[_0x757a('0x36')]=_['keys'](_0x581569[_0x757a('0x36')]);_0x4be54d['filters']=_[_0x757a('0x37')](_0x4be54d[_0x757a('0x33')],_0x4be54d['query']);_0x1e5a5a[_0x757a('0x38')]=_[_0x757a('0x37')](_0x4be54d['model'],qs[_0x757a('0x39')](_0x581569[_0x757a('0x36')][_0x757a('0x39')]));_0x1e5a5a[_0x757a('0x38')]=_0x1e5a5a[_0x757a('0x38')]['length']?_0x1e5a5a[_0x757a('0x38')]:_0x4be54d[_0x757a('0x33')];if(!_0x581569[_0x757a('0x36')][_0x757a('0x3a')](_0x757a('0x3b'))){_0x1e5a5a['limit']=qs[_0x757a('0x1e')](_0x581569['query'][_0x757a('0x1e')]);_0x1e5a5a[_0x757a('0x20')]=qs[_0x757a('0x20')](_0x581569[_0x757a('0x36')][_0x757a('0x20')]);}_0x1e5a5a[_0x757a('0x3c')]=qs[_0x757a('0x3d')](_0x581569['query']['sort']);_0x1e5a5a[_0x757a('0x3e')]=qs['filters'](_[_0x757a('0x3f')](_0x581569['query'],_0x4be54d[_0x757a('0x40')]),_0x28d6da);if(_0x581569[_0x757a('0x36')][_0x757a('0x41')]){_0x1e5a5a['where']=_[_0x757a('0x42')](_0x1e5a5a[_0x757a('0x3e')],{'$or':_[_0x757a('0x34')](_0x28d6da,function(_0x1a25bb){if(_0x1a25bb[_0x757a('0x31')]!==_0x757a('0x43')){var _0x1c631f={};_0x1c631f[_0x1a25bb['name']]={'$like':'%'+_0x581569[_0x757a('0x36')][_0x757a('0x41')]+'%'};return _0x1c631f;}})});}_0x1e5a5a=_['merge']({},_0x1e5a5a,_0x581569[_0x757a('0x44')]);var _0x3148cd={'where':_0x1e5a5a[_0x757a('0x3e')]};return db['Schedule']['count'](_0x3148cd)[_0x757a('0x27')](function(_0xf44ab5){_0x117264[_0x757a('0x1f')]=_0xf44ab5;if(_0x581569['query']['includeAll']){_0x1e5a5a[_0x757a('0x45')]=[{'all':!![]}];}return db[_0x757a('0x2e')][_0x757a('0x46')](_0x1e5a5a);})['then'](function(_0x3848aa){_0x117264[_0x757a('0x47')]=_0x3848aa;return _0x117264;})[_0x757a('0x27')](respondWithFilteredResult(_0x336f80,_0x1e5a5a))[_0x757a('0x48')](handleError(_0x336f80,null));};exports[_0x757a('0x49')]=function(_0x19af3c,_0x14a908){var _0x2d8355={'raw':![],'where':{'id':_0x19af3c['params']['id']}},_0x2ef0ae={};_0x2ef0ae[_0x757a('0x33')]=_['keys'](db[_0x757a('0x2e')]['rawAttributes']);_0x2ef0ae[_0x757a('0x36')]=_[_0x757a('0x4a')](_0x19af3c[_0x757a('0x36')]);_0x2ef0ae[_0x757a('0x40')]=_[_0x757a('0x37')](_0x2ef0ae[_0x757a('0x33')],_0x2ef0ae[_0x757a('0x36')]);_0x2d8355['attributes']=_['intersection'](_0x2ef0ae[_0x757a('0x33')],qs[_0x757a('0x39')](_0x19af3c[_0x757a('0x36')][_0x757a('0x39')]));_0x2d8355['attributes']=_0x2d8355[_0x757a('0x38')]['length']?_0x2d8355[_0x757a('0x38')]:_0x2ef0ae[_0x757a('0x33')];if(_0x19af3c[_0x757a('0x36')][_0x757a('0x4b')]){_0x2d8355[_0x757a('0x45')]=[{'all':!![]}];}_0x2d8355=_[_0x757a('0x42')]({},_0x2d8355,_0x19af3c[_0x757a('0x44')]);return db['Schedule'][_0x757a('0x4c')](_0x2d8355)[_0x757a('0x27')](handleEntityNotFound(_0x14a908,null))[_0x757a('0x27')](respondWithResult(_0x14a908,null))[_0x757a('0x48')](handleError(_0x14a908,null));};exports[_0x757a('0x4d')]=function(_0x55f259,_0x5e6a8b){return db[_0x757a('0x2e')][_0x757a('0x4d')](_0x55f259[_0x757a('0x4e')],{})[_0x757a('0x27')](function(_0x748203){var _0x7a2e88=_0x55f259['user']['get']({'plain':!![]});if(!_0x7a2e88)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7a2e88[_0x757a('0x4f')]==='user'){var _0x4c047a=_0x748203[_0x757a('0x28')]({'plain':!![]});var _0x20b43e='Scheduler';return db[_0x757a('0x50')]['find']({'where':{'name':_0x20b43e,'userProfileId':_0x7a2e88[_0x757a('0x51')]},'raw':!![]})[_0x757a('0x27')](function(_0x4430f4){if(_0x4430f4&&_0x4430f4['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4c047a['name'],'resourceId':_0x4c047a['id'],'type':_0x4430f4[_0x757a('0x35')],'sectionId':_0x4430f4['id']},{})[_0x757a('0x27')](function(){return _0x748203;});}else{return _0x748203;}})['catch'](function(_0x1db92e){logger[_0x757a('0x2c')](_0x757a('0x52'),_0x1db92e);throw _0x1db92e;});}return _0x748203;})[_0x757a('0x27')](respondWithResult(_0x5e6a8b,0xc9))['catch'](handleError(_0x5e6a8b,null));};exports[_0x757a('0x53')]=function(_0x12c041,_0x3e1305){if(_0x12c041[_0x757a('0x4e')]['id']){delete _0x12c041[_0x757a('0x4e')]['id'];}return db[_0x757a('0x2e')]['find']({'where':{'id':_0x12c041[_0x757a('0x54')]['id']}})[_0x757a('0x27')](handleEntityNotFound(_0x3e1305,null))[_0x757a('0x27')](saveUpdates(_0x12c041['body'],null))[_0x757a('0x27')](respondWithResult(_0x3e1305,null))['catch'](handleError(_0x3e1305,null));};exports[_0x757a('0x2b')]=function(_0x218821,_0x5e8c80){return db['Schedule'][_0x757a('0x4c')]({'where':{'id':_0x218821[_0x757a('0x54')]['id']}})[_0x757a('0x27')](handleEntityNotFound(_0x5e8c80,null))['then'](removeEntity(_0x5e8c80,null))['catch'](handleError(_0x5e8c80,null));};exports['run']=function(_0x405f28,_0x2f5990,_0x374e70){var _0x3d02d9=require(_0x757a('0x55'));return db[_0x757a('0x2e')]['find']({'where':{'id':_0x405f28[_0x757a('0x54')]['id']},'raw':!![]})[_0x757a('0x27')](handleEntityNotFound(_0x2f5990,null))[_0x757a('0x27')](function(){_0x3d02d9[_0x757a('0x56')](_0x405f28[_0x757a('0x54')]['id']);})[_0x757a('0x27')](respondWithStatusCode(_0x2f5990,null))['catch'](handleError(_0x2f5990,null));};
\ No newline at end of file
+var _0x2b20=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','get','Scheduler','UserProfileResource','then','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','attributes','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule'];(function(_0x3a9a79,_0xb12070){var _0x2a7bd0=function(_0x374cba){while(--_0x374cba){_0x3a9a79['push'](_0x3a9a79['shift']());}};_0x2a7bd0(++_0xb12070);}(_0x2b20,0x195));var _0x02b2=function(_0x4caa6f,_0x318878){_0x4caa6f=_0x4caa6f-0x0;var _0x11432c=_0x2b20[_0x4caa6f];return _0x11432c;};'use strict';var emlformat=require(_0x02b2('0x0'));var rimraf=require(_0x02b2('0x1'));var zipdir=require(_0x02b2('0x2'));var jsonpatch=require(_0x02b2('0x3'));var rp=require(_0x02b2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x02b2('0x5'));var util=require(_0x02b2('0x6'));var path=require(_0x02b2('0x7'));var sox=require('sox');var csv=require(_0x02b2('0x8'));var ejs=require(_0x02b2('0x9'));var fs=require('fs');var fs_extra=require(_0x02b2('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x02b2('0xb'));var toCsv=require(_0x02b2('0x8'));var querystring=require('querystring');var Papa=require(_0x02b2('0xc'));var Redis=require(_0x02b2('0xd'));var authService=require(_0x02b2('0xe'));var qs=require(_0x02b2('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02b2('0x10'));var logger=require('../../config/logger')(_0x02b2('0x11'));var utils=require('../../config/utils');var config=require(_0x02b2('0x12'));var licenseUtil=require(_0x02b2('0x13'));var db=require(_0x02b2('0x14'))['db'];function respondWithStatusCode(_0x25d4fb,_0x32f233){_0x32f233=_0x32f233||0xcc;return function(_0x2c8441){if(_0x2c8441){return _0x25d4fb[_0x02b2('0x15')](_0x32f233);}return _0x25d4fb[_0x02b2('0x16')](_0x32f233)[_0x02b2('0x17')]();};}function respondWithResult(_0x476dd6,_0x2cbf76){_0x2cbf76=_0x2cbf76||0xc8;return function(_0x490ae9){if(_0x490ae9){return _0x476dd6['status'](_0x2cbf76)['json'](_0x490ae9);}};}function respondWithFilteredResult(_0x30dba5,_0x4da923){return function(_0x5cf5d3){if(_0x5cf5d3){var _0x447020=typeof _0x4da923[_0x02b2('0x18')]===_0x02b2('0x19')&&typeof _0x4da923[_0x02b2('0x1a')]===_0x02b2('0x19');var _0x411be2=_0x5cf5d3[_0x02b2('0x1b')];var _0x4dbf94=_0x447020?0x0:_0x4da923[_0x02b2('0x18')];var _0x40218a=_0x447020?_0x5cf5d3['count']:_0x4da923[_0x02b2('0x18')]+_0x4da923['limit'];var _0x1433ff;if(_0x40218a>=_0x411be2){_0x40218a=_0x411be2;_0x1433ff=0xc8;}else{_0x1433ff=0xce;}_0x30dba5['status'](_0x1433ff);return _0x30dba5[_0x02b2('0x1c')](_0x02b2('0x1d'),_0x4dbf94+'-'+_0x40218a+'/'+_0x411be2)[_0x02b2('0x1e')](_0x5cf5d3);}return null;};}function patchUpdates(_0x4a7eba){return function(_0x515e15){try{jsonpatch[_0x02b2('0x1f')](_0x515e15,_0x4a7eba,!![]);}catch(_0xf6aad2){return BPromise[_0x02b2('0x20')](_0xf6aad2);}return _0x515e15[_0x02b2('0x21')]();};}function saveUpdates(_0x598f7f,_0x4d216a){return function(_0x402424){if(_0x402424){return _0x402424['update'](_0x598f7f)['then'](function(_0x52a0ad){return _0x52a0ad;});}return null;};}function removeEntity(_0x13adcc,_0x21efc5){return function(_0x5c2b98){if(_0x5c2b98){return _0x5c2b98[_0x02b2('0x22')]()['then'](function(){var _0x5a184c=_0x5c2b98[_0x02b2('0x23')]({'plain':!![]});var _0x480d85=_0x02b2('0x24');return db[_0x02b2('0x25')][_0x02b2('0x22')]({'where':{'type':_0x480d85,'resourceId':_0x5a184c['id']}})[_0x02b2('0x26')](function(){return _0x5c2b98;});})[_0x02b2('0x26')](function(){_0x13adcc[_0x02b2('0x16')](0xcc)[_0x02b2('0x17')]();});}};}function handleEntityNotFound(_0x536e3f,_0xcbfaae){return function(_0x154a98){if(!_0x154a98){_0x536e3f['sendStatus'](0x194);}return _0x154a98;};}function handleError(_0x269045,_0x2e3f2f){_0x2e3f2f=_0x2e3f2f||0x1f4;return function(_0x3b29b7){logger[_0x02b2('0x27')](_0x3b29b7[_0x02b2('0x28')]);if(_0x3b29b7[_0x02b2('0x29')]){delete _0x3b29b7[_0x02b2('0x29')];}_0x269045['status'](_0x2e3f2f)[_0x02b2('0x2a')](_0x3b29b7);};}exports[_0x02b2('0x2b')]=function(_0x3dc19b,_0x5ecd5e){var _0x447c93={},_0x362a1f={},_0xa03b17={'count':0x0,'rows':[]};var _0x51d5bb=_[_0x02b2('0x2c')](db[_0x02b2('0x2d')][_0x02b2('0x2e')],function(_0x2ab7c4){return{'name':_0x2ab7c4[_0x02b2('0x2f')],'type':_0x2ab7c4[_0x02b2('0x30')][_0x02b2('0x31')]};});_0x362a1f[_0x02b2('0x32')]=_[_0x02b2('0x2c')](_0x51d5bb,_0x02b2('0x29'));_0x362a1f[_0x02b2('0x33')]=_['keys'](_0x3dc19b[_0x02b2('0x33')]);_0x362a1f[_0x02b2('0x34')]=_[_0x02b2('0x35')](_0x362a1f[_0x02b2('0x32')],_0x362a1f[_0x02b2('0x33')]);_0x447c93['attributes']=_[_0x02b2('0x35')](_0x362a1f['model'],qs[_0x02b2('0x36')](_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x36')]));_0x447c93['attributes']=_0x447c93['attributes'][_0x02b2('0x37')]?_0x447c93[_0x02b2('0x38')]:_0x362a1f[_0x02b2('0x32')];if(!_0x3dc19b[_0x02b2('0x33')]['hasOwnProperty']('nolimit')){_0x447c93[_0x02b2('0x1a')]=qs['limit'](_0x3dc19b['query'][_0x02b2('0x1a')]);_0x447c93[_0x02b2('0x18')]=qs[_0x02b2('0x18')](_0x3dc19b['query'][_0x02b2('0x18')]);}_0x447c93['order']=qs[_0x02b2('0x39')](_0x3dc19b['query'][_0x02b2('0x39')]);_0x447c93[_0x02b2('0x3a')]=qs[_0x02b2('0x34')](_['pick'](_0x3dc19b['query'],_0x362a1f['filters']),_0x51d5bb);if(_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x3b')]){_0x447c93['where']=_[_0x02b2('0x3c')](_0x447c93['where'],{'$or':_[_0x02b2('0x2c')](_0x51d5bb,function(_0x4435b8){if(_0x4435b8['type']!==_0x02b2('0x3d')){var _0x11d434={};_0x11d434[_0x4435b8[_0x02b2('0x29')]]={'$like':'%'+_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x3b')]+'%'};return _0x11d434;}})});}_0x447c93=_[_0x02b2('0x3c')]({},_0x447c93,_0x3dc19b[_0x02b2('0x3e')]);var _0x19e3a4={'where':_0x447c93['where']};return db[_0x02b2('0x2d')][_0x02b2('0x1b')](_0x19e3a4)['then'](function(_0x4e1a0d){_0xa03b17[_0x02b2('0x1b')]=_0x4e1a0d;if(_0x3dc19b[_0x02b2('0x33')][_0x02b2('0x3f')]){_0x447c93[_0x02b2('0x40')]=[{'all':!![]}];}return db[_0x02b2('0x2d')][_0x02b2('0x41')](_0x447c93);})['then'](function(_0x120057){_0xa03b17[_0x02b2('0x42')]=_0x120057;return _0xa03b17;})['then'](respondWithFilteredResult(_0x5ecd5e,_0x447c93))['catch'](handleError(_0x5ecd5e,null));};exports['show']=function(_0x2f85e0,_0x36fd3e){var _0x3b26c8={'raw':![],'where':{'id':_0x2f85e0[_0x02b2('0x43')]['id']}},_0x464144={};_0x464144['model']=_['keys'](db[_0x02b2('0x2d')]['rawAttributes']);_0x464144[_0x02b2('0x33')]=_[_0x02b2('0x44')](_0x2f85e0[_0x02b2('0x33')]);_0x464144['filters']=_[_0x02b2('0x35')](_0x464144['model'],_0x464144[_0x02b2('0x33')]);_0x3b26c8[_0x02b2('0x38')]=_[_0x02b2('0x35')](_0x464144[_0x02b2('0x32')],qs['fields'](_0x2f85e0[_0x02b2('0x33')]['fields']));_0x3b26c8['attributes']=_0x3b26c8[_0x02b2('0x38')]['length']?_0x3b26c8[_0x02b2('0x38')]:_0x464144[_0x02b2('0x32')];if(_0x2f85e0[_0x02b2('0x33')][_0x02b2('0x3f')]){_0x3b26c8[_0x02b2('0x40')]=[{'all':!![]}];}_0x3b26c8=_['merge']({},_0x3b26c8,_0x2f85e0[_0x02b2('0x3e')]);return db[_0x02b2('0x2d')][_0x02b2('0x45')](_0x3b26c8)['then'](handleEntityNotFound(_0x36fd3e,null))['then'](respondWithResult(_0x36fd3e,null))[_0x02b2('0x46')](handleError(_0x36fd3e,null));};exports[_0x02b2('0x47')]=function(_0x25591b,_0xa0c351){return db[_0x02b2('0x2d')]['create'](_0x25591b['body'],{})['then'](function(_0x3ef83a){var _0x69fe02=_0x25591b['user'][_0x02b2('0x23')]({'plain':!![]});if(!_0x69fe02)throw new Error(_0x02b2('0x48'));if(_0x69fe02['role']==='user'){var _0x45a63d=_0x3ef83a['get']({'plain':!![]});var _0x9248fc=_0x02b2('0x24');return db[_0x02b2('0x49')]['find']({'where':{'name':_0x9248fc,'userProfileId':_0x69fe02[_0x02b2('0x4a')]},'raw':!![]})[_0x02b2('0x26')](function(_0xdf4ee3){if(_0xdf4ee3&&_0xdf4ee3[_0x02b2('0x4b')]===0x0){return db[_0x02b2('0x25')][_0x02b2('0x47')]({'name':_0x45a63d[_0x02b2('0x29')],'resourceId':_0x45a63d['id'],'type':_0xdf4ee3[_0x02b2('0x29')],'sectionId':_0xdf4ee3['id']},{})[_0x02b2('0x26')](function(){return _0x3ef83a;});}else{return _0x3ef83a;}})['catch'](function(_0x401619){logger[_0x02b2('0x27')](_0x02b2('0x4c'),_0x401619);throw _0x401619;});}return _0x3ef83a;})[_0x02b2('0x26')](respondWithResult(_0xa0c351,0xc9))[_0x02b2('0x46')](handleError(_0xa0c351,null));};exports[_0x02b2('0x4d')]=function(_0x24af8a,_0x5aa09d){if(_0x24af8a[_0x02b2('0x4e')]['id']){delete _0x24af8a[_0x02b2('0x4e')]['id'];}return db['Schedule']['find']({'where':{'id':_0x24af8a[_0x02b2('0x43')]['id']}})[_0x02b2('0x26')](handleEntityNotFound(_0x5aa09d,null))[_0x02b2('0x26')](saveUpdates(_0x24af8a[_0x02b2('0x4e')],null))[_0x02b2('0x26')](respondWithResult(_0x5aa09d,null))['catch'](handleError(_0x5aa09d,null));};exports[_0x02b2('0x22')]=function(_0xda738e,_0x26c14f){return db[_0x02b2('0x2d')][_0x02b2('0x45')]({'where':{'id':_0xda738e[_0x02b2('0x43')]['id']}})['then'](handleEntityNotFound(_0x26c14f,null))['then'](removeEntity(_0x26c14f,null))['catch'](handleError(_0x26c14f,null));};exports[_0x02b2('0x4f')]=function(_0x276f84,_0x430395,_0x39e8f5){var _0xd6cc01=require(_0x02b2('0x50'));return db['Schedule'][_0x02b2('0x45')]({'where':{'id':_0x276f84[_0x02b2('0x43')]['id']},'raw':!![]})[_0x02b2('0x26')](handleEntityNotFound(_0x430395,null))[_0x02b2('0x26')](function(){_0xd6cc01[_0x02b2('0x4f')](_0x276f84[_0x02b2('0x43')]['id']);})['then'](respondWithStatusCode(_0x430395,null))['catch'](handleError(_0x430395,null));};
\ No newline at end of file
index bf07d4c..8231761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe509=['Schedule','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0xe509,0x14b));var _0x9e50=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0xe509[_0x3ba422];return _0x20b5dd;};'use strict';var _=require(_0x9e50('0x0'));var util=require(_0x9e50('0x1'));var logger=require(_0x9e50('0x2'))(_0x9e50('0x3'));var moment=require(_0x9e50('0x4'));var BPromise=require(_0x9e50('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e50('0x6'));var rimraf=require('rimraf');var config=require(_0x9e50('0x7'));var attributes=require('./schedule.attributes');module[_0x9e50('0x8')]=function(_0x8df99f,_0x341f83){return _0x8df99f['define'](_0x9e50('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5556=['define','Schedule','tools_schedules','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbb2e58,_0x1fe145){var _0x2f0d91=function(_0x331b3c){while(--_0x331b3c){_0xbb2e58['push'](_0xbb2e58['shift']());}};_0x2f0d91(++_0x1fe145);}(_0x5556,0x18f));var _0x6555=function(_0x5e8fe9,_0x1d3d88){_0x5e8fe9=_0x5e8fe9-0x0;var _0x5158b9=_0x5556[_0x5e8fe9];return _0x5158b9;};'use strict';var _=require('lodash');var util=require(_0x6555('0x0'));var logger=require(_0x6555('0x1'))(_0x6555('0x2'));var moment=require(_0x6555('0x3'));var BPromise=require(_0x6555('0x4'));var rp=require(_0x6555('0x5'));var fs=require('fs');var path=require(_0x6555('0x6'));var rimraf=require(_0x6555('0x7'));var config=require(_0x6555('0x8'));var attributes=require('./schedule.attributes');module['exports']=function(_0x5fd5e7,_0x34d7e5){return _0x5fd5e7[_0x6555('0x9')](_0x6555('0xa'),attributes,{'tableName':_0x6555('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf646cb..a35da04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1026=['error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1026,0x148));var _0x6102=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x1026[_0x5d6e30];return _0x3d3f3b;};'use strict';var _=require(_0x6102('0x0'));var util=require(_0x6102('0x1'));var moment=require('moment');var BPromise=require(_0x6102('0x2'));var rs=require(_0x6102('0x3'));var fs=require('fs');var Redis=require(_0x6102('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6102('0x5'));var logger=require('../../config/logger')(_0x6102('0x6'));var config=require(_0x6102('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6102('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14ae81,_0x1c5d67,_0x3455b0){return new BPromise(function(_0x19078b,_0x427e0d){return client[_0x6102('0x9')](_0x14ae81,_0x3455b0)['then'](function(_0x50bf58){logger[_0x6102('0xa')](_0x6102('0xb'),_0x1c5d67,_0x6102('0xc'));logger['debug'](_0x6102('0xd'),_0x1c5d67,_0x6102('0xc'),JSON['stringify'](_0x50bf58));if(_0x50bf58[_0x6102('0xe')]){if(_0x50bf58[_0x6102('0xe')]['code']===0x1f4){logger['error'](_0x6102('0xb'),_0x1c5d67,_0x50bf58['error'][_0x6102('0xf')]);return _0x427e0d(_0x50bf58[_0x6102('0xe')][_0x6102('0xf')]);}logger[_0x6102('0xe')](_0x6102('0xb'),_0x1c5d67,_0x50bf58[_0x6102('0xe')]['message']);return _0x19078b(_0x50bf58[_0x6102('0xe')]['message']);}else{logger[_0x6102('0xa')](_0x6102('0xb'),_0x1c5d67,'request\x20sent');_0x19078b(_0x50bf58[_0x6102('0x10')][_0x6102('0xf')]);}})[_0x6102('0x11')](function(_0x55782e){logger[_0x6102('0xe')](_0x6102('0xb'),_0x1c5d67,_0x55782e);_0x427e0d(_0x55782e);});});}
\ No newline at end of file
+var _0x9ee6=['info','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x9ee6,0x1d8));var _0x69ee=function(_0x593d89,_0x45145f){_0x593d89=_0x593d89-0x0;var _0x4aa403=_0x9ee6[_0x593d89];return _0x4aa403;};'use strict';var _=require('lodash');var util=require(_0x69ee('0x0'));var moment=require(_0x69ee('0x1'));var BPromise=require('bluebird');var rs=require(_0x69ee('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ee('0x3'))['db'];var utils=require(_0x69ee('0x4'));var logger=require(_0x69ee('0x5'))(_0x69ee('0x6'));var config=require(_0x69ee('0x7'));var jayson=require(_0x69ee('0x8'));var client=jayson[_0x69ee('0x9')][_0x69ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1681b4,_0x4edbaa,_0x252c14){return new BPromise(function(_0x157338,_0x4b7a34){return client['request'](_0x1681b4,_0x252c14)[_0x69ee('0xb')](function(_0x474c35){logger[_0x69ee('0xc')](_0x69ee('0xd'),_0x4edbaa,'request\x20sent');logger['debug'](_0x69ee('0xe'),_0x4edbaa,_0x69ee('0xf'),JSON[_0x69ee('0x10')](_0x474c35));if(_0x474c35[_0x69ee('0x11')]){if(_0x474c35['error'][_0x69ee('0x12')]===0x1f4){logger[_0x69ee('0x11')](_0x69ee('0xd'),_0x4edbaa,_0x474c35['error'][_0x69ee('0x13')]);return _0x4b7a34(_0x474c35[_0x69ee('0x11')][_0x69ee('0x13')]);}logger[_0x69ee('0x11')]('Schedule,\x20%s,\x20%s',_0x4edbaa,_0x474c35['error'][_0x69ee('0x13')]);return _0x157338(_0x474c35[_0x69ee('0x11')]['message']);}else{logger[_0x69ee('0xc')](_0x69ee('0xd'),_0x4edbaa,'request\x20sent');_0x157338(_0x474c35[_0x69ee('0x14')]['message']);}})[_0x69ee('0x15')](function(_0x278246){logger[_0x69ee('0x11')](_0x69ee('0xd'),_0x4edbaa,_0x278246);_0x4b7a34(_0x278246);});});}
\ No newline at end of file
index a0e35fb..e2d6152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7935=['get','index','isAuthenticated','describe','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0x421689,_0x3a81ff){var _0x1df39d=function(_0x31e135){while(--_0x31e135){_0x421689['push'](_0x421689['shift']());}};_0x1df39d(++_0x3a81ff);}(_0x7935,0x18e));var _0x5793=function(_0x5e8eae,_0x4f81e0){_0x5e8eae=_0x5e8eae-0x0;var _0xdd09cd=_0x7935[_0x5e8eae];return _0xdd09cd;};'use strict';var multer=require(_0x5793('0x0'));var util=require(_0x5793('0x1'));var path=require('path');var timeout=require(_0x5793('0x2'));var express=require(_0x5793('0x3'));var router=express[_0x5793('0x4')]();var fs_extra=require(_0x5793('0x5'));var auth=require(_0x5793('0x6'));var interaction=require(_0x5793('0x7'));var config=require(_0x5793('0x8'));var controller=require(_0x5793('0x9'));router[_0x5793('0xa')]('/',auth['isAuthenticated'](),controller[_0x5793('0xb')]);router['get']('/describe',auth[_0x5793('0xc')](),controller[_0x5793('0xd')]);router[_0x5793('0xa')]('/:id',auth[_0x5793('0xc')](),controller[_0x5793('0xe')]);router[_0x5793('0xa')](_0x5793('0xf'),auth['isAuthenticated'](),controller[_0x5793('0x10')]);router[_0x5793('0x11')]('/',auth[_0x5793('0xc')](),controller[_0x5793('0x12')]);router[_0x5793('0x13')](_0x5793('0x14'),auth[_0x5793('0xc')](),controller[_0x5793('0x15')]);router[_0x5793('0x16')](_0x5793('0x14'),auth[_0x5793('0xc')](),controller[_0x5793('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x96d5=['download','post','create','/:id','delete','destroy','exports','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','show','/:id/download'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x96d5,0x183));var _0x596d=function(_0x151ae3,_0x3a9195){_0x151ae3=_0x151ae3-0x0;var _0x564680=_0x96d5[_0x151ae3];return _0x564680;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x596d('0x0'));var timeout=require('connect-timeout');var express=require(_0x596d('0x1'));var router=express[_0x596d('0x2')]();var fs_extra=require(_0x596d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x596d('0x4'));var config=require(_0x596d('0x5'));var controller=require(_0x596d('0x6'));router[_0x596d('0x7')]('/',auth[_0x596d('0x8')](),controller[_0x596d('0x9')]);router[_0x596d('0x7')]('/describe',auth[_0x596d('0x8')](),controller['describe']);router[_0x596d('0x7')]('/:id',auth[_0x596d('0x8')](),controller[_0x596d('0xa')]);router[_0x596d('0x7')](_0x596d('0xb'),auth[_0x596d('0x8')](),controller[_0x596d('0xc')]);router[_0x596d('0xd')]('/',auth['isAuthenticated'](),controller[_0x596d('0xe')]);router['put'](_0x596d('0xf'),auth[_0x596d('0x8')](),controller['update']);router[_0x596d('0x10')]('/:id',auth[_0x596d('0x8')](),controller[_0x596d('0x11')]);module[_0x596d('0x12')]=router;
\ No newline at end of file
index 7837a71..9263c77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d37=['replace','INTEGER','setDataValue','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','extname','STRING'];(function(_0x1c5950,_0x49e128){var _0x2b720a=function(_0x4454f1){while(--_0x4454f1){_0x1c5950['push'](_0x1c5950['shift']());}};_0x2b720a(++_0x49e128);}(_0x7d37,0x1db));var _0x77d3=function(_0x5c1f3e,_0x318920){_0x5c1f3e=_0x5c1f3e-0x0;var _0x2fbff6=_0x7d37[_0x5c1f3e];return _0x2fbff6;};'use strict';var Sequelize=require(_0x77d3('0x0'));var moment=require(_0x77d3('0x1'));var path=require(_0x77d3('0x2'));var config=require('../../config/environment');module[_0x77d3('0x3')]={'format':{'type':Sequelize[_0x77d3('0x4')],'get':function(){return this[_0x77d3('0x5')]('value')?path[_0x77d3('0x6')](this[_0x77d3('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x77d3('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x77d3('0x7')],'set':function(_0x519c6e){var _0x40235d=_0x519c6e[_0x77d3('0x8')](/\\/g,'/');this['setDataValue']('value',_0x40235d);}},'rating':{'type':Sequelize[_0x77d3('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x77d3('0x9')],'set':function(_0x506caa){this[_0x77d3('0xa')]('startedAt',moment()[_0x77d3('0xb')](_0x506caa,'ms'));this['setDataValue'](_0x77d3('0xc'),moment());this['setDataValue'](_0x77d3('0xd'),_0x506caa);}},'startedAt':{'type':Sequelize[_0x77d3('0xe')],'get':function(){return moment(this[_0x77d3('0x5')](_0x77d3('0xf')))[_0x77d3('0x10')](_0x77d3('0x11'))[_0x77d3('0x12')]();}},'closedAt':{'type':Sequelize[_0x77d3('0xe')],'get':function(){return moment(this[_0x77d3('0x5')]('closedAt'))[_0x77d3('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x77d3('0x5')](_0x77d3('0x13')))[_0x77d3('0x10')](_0x77d3('0x11'))[_0x77d3('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x77d3('0x5')](_0x77d3('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x77d3('0x12')]();}}};
\ No newline at end of file
+var _0x5430=['duration','DATE','getDataValue','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','closedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','extname','STRING','setDataValue','value','INTEGER','subtract'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5430,0x10c));var _0x0543=function(_0x4a9d03,_0x19351c){_0x4a9d03=_0x4a9d03-0x0;var _0x44e6ae=_0x5430[_0x4a9d03];return _0x44e6ae;};'use strict';var Sequelize=require(_0x0543('0x0'));var moment=require(_0x0543('0x1'));var path=require(_0x0543('0x2'));var config=require(_0x0543('0x3'));module[_0x0543('0x4')]={'format':{'type':Sequelize[_0x0543('0x5')],'get':function(){return this['getDataValue']('value')?path[_0x0543('0x6')](this['getDataValue']('value')):undefined;}},'interactionid':{'type':Sequelize[_0x0543('0x7')]},'channel':{'type':Sequelize[_0x0543('0x7')]},'value':{'type':Sequelize[_0x0543('0x7')],'set':function(_0x319568){var _0x46bca7=_0x319568['replace'](/\\/g,'/');this[_0x0543('0x8')](_0x0543('0x9'),_0x46bca7);}},'rating':{'type':Sequelize[_0x0543('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0543('0xa')],'set':function(_0x2fb723){this[_0x0543('0x8')]('startedAt',moment()[_0x0543('0xb')](_0x2fb723,'ms'));this[_0x0543('0x8')]('closedAt',moment());this[_0x0543('0x8')](_0x0543('0xc'),_0x2fb723);}},'startedAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this[_0x0543('0xe')](_0x0543('0xf')))[_0x0543('0x10')](_0x0543('0x11'))[_0x0543('0x12')]();}},'closedAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this[_0x0543('0xe')](_0x0543('0x13')))[_0x0543('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x0543('0x12')]();}},'createdAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0x0543('0x10')](_0x0543('0x11'))[_0x0543('0x12')]();}},'updatedAt':{'type':Sequelize[_0x0543('0xd')],'get':function(){return moment(this[_0x0543('0xe')]('updatedAt'))[_0x0543('0x10')](_0x0543('0x11'))[_0x0543('0x12')]();}}};
\ No newline at end of file
index 1836012..da08685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dfd=['../../components/encryptor','uniqueid','join','%s.cypher','existsSync','decryptFile','secrets','root','server/files/screen_recordings','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','stack','name','send','index','ScreenRecording','fieldName','key','model','map','format','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','length','catch','create','body','duration','createdAt','closedAt','value','find','describe','download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd7df('0x0'));var rimraf=require(_0xd7df('0x1'));var zipdir=require(_0xd7df('0x2'));var jsonpatch=require(_0xd7df('0x3'));var rp=require(_0xd7df('0x4'));var moment=require(_0xd7df('0x5'));var BPromise=require(_0xd7df('0x6'));var Mustache=require(_0xd7df('0x7'));var util=require(_0xd7df('0x8'));var path=require(_0xd7df('0x9'));var sox=require(_0xd7df('0xa'));var csv=require(_0xd7df('0xb'));var ejs=require(_0xd7df('0xc'));var fs=require('fs');var fs_extra=require(_0xd7df('0xd'));var _=require(_0xd7df('0xe'));var squel=require(_0xd7df('0xf'));var crypto=require(_0xd7df('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xd7df('0x11'));var toCsv=require(_0xd7df('0xb'));var querystring=require(_0xd7df('0x12'));var Papa=require(_0xd7df('0x13'));var Redis=require('ioredis');var authService=require(_0xd7df('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xd7df('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd7df('0x16'))(_0xd7df('0x17'));var utils=require(_0xd7df('0x18'));var config=require(_0xd7df('0x19'));var licenseUtil=require(_0xd7df('0x1a'));var db=require(_0xd7df('0x1b'))['db'];function respondWithStatusCode(_0x2e8187,_0x3da618){_0x3da618=_0x3da618||0xcc;return function(_0x7ba3c){if(_0x7ba3c){return _0x2e8187[_0xd7df('0x1c')](_0x3da618);}return _0x2e8187[_0xd7df('0x1d')](_0x3da618)[_0xd7df('0x1e')]();};}function respondWithResult(_0xe1595f,_0x196632){_0x196632=_0x196632||0xc8;return function(_0x3b2559){if(_0x3b2559){return _0xe1595f[_0xd7df('0x1d')](_0x196632)[_0xd7df('0x1f')](_0x3b2559);}};}function respondWithFilteredResult(_0x57b8be,_0x4c5cf){return function(_0x23cdbc){if(_0x23cdbc){var _0x513b13=typeof _0x4c5cf[_0xd7df('0x20')]===_0xd7df('0x21')&&typeof _0x4c5cf['limit']===_0xd7df('0x21');var _0x30ee65=_0x23cdbc[_0xd7df('0x22')];var _0x5210e5=_0x513b13?0x0:_0x4c5cf[_0xd7df('0x20')];var _0x471621=_0x513b13?_0x23cdbc[_0xd7df('0x22')]:_0x4c5cf['offset']+_0x4c5cf[_0xd7df('0x23')];var _0x20dc3e;if(_0x471621>=_0x30ee65){_0x471621=_0x30ee65;_0x20dc3e=0xc8;}else{_0x20dc3e=0xce;}_0x57b8be[_0xd7df('0x1d')](_0x20dc3e);return _0x57b8be['set'](_0xd7df('0x24'),_0x5210e5+'-'+_0x471621+'/'+_0x30ee65)['json'](_0x23cdbc);}return null;};}function patchUpdates(_0x225e33){return function(_0x5ab737){try{jsonpatch[_0xd7df('0x25')](_0x5ab737,_0x225e33,!![]);}catch(_0x342b54){return BPromise[_0xd7df('0x26')](_0x342b54);}return _0x5ab737['save']();};}function saveUpdates(_0xc50077,_0x502ae8){return function(_0x44079b){if(_0x44079b){return _0x44079b[_0xd7df('0x27')](_0xc50077)[_0xd7df('0x28')](function(_0x29f354){return _0x29f354;});}return null;};}function removeEntity(_0x1c774b,_0xa80cbf){return function(_0x1e3bf3){if(_0x1e3bf3){return _0x1e3bf3['destroy']()['then'](function(){_0x1c774b[_0xd7df('0x1d')](0xcc)[_0xd7df('0x1e')]();});}};}function handleEntityNotFound(_0x26047f,_0x459f11){return function(_0x13f190){if(!_0x13f190){_0x26047f[_0xd7df('0x1c')](0x194);}return _0x13f190;};}function handleError(_0x373359,_0x2b6fde){_0x2b6fde=_0x2b6fde||0x1f4;return function(_0x163904){logger['error'](_0x163904[_0xd7df('0x29')]);if(_0x163904[_0xd7df('0x2a')]){delete _0x163904[_0xd7df('0x2a')];}_0x373359[_0xd7df('0x1d')](_0x2b6fde)[_0xd7df('0x2b')](_0x163904);};}exports[_0xd7df('0x2c')]=function(_0x3f78fa,_0x36de76){var _0x5195cf={},_0x4ba779={},_0x52b56a={'count':0x0,'rows':[]};var _0x58584d=_['map'](db[_0xd7df('0x2d')]['rawAttributes'],function(_0xd366b){return{'name':_0xd366b[_0xd7df('0x2e')],'type':_0xd366b['type'][_0xd7df('0x2f')]};});_0x4ba779[_0xd7df('0x30')]=_['differenceBy'](_[_0xd7df('0x31')](_0x58584d,_0xd7df('0x2a')),[_0xd7df('0x32')]);_0x4ba779[_0xd7df('0x33')]=_[_0xd7df('0x34')](_0x3f78fa[_0xd7df('0x33')]);_0x4ba779['filters']=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],_0x4ba779[_0xd7df('0x33')]);_0x5195cf[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0x4ba779[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5195cf[_0xd7df('0x36')]=_0x5195cf[_0xd7df('0x36')]['length']?_0x5195cf['attributes']:_0x4ba779[_0xd7df('0x30')];if(!_0x3f78fa['query'][_0xd7df('0x38')](_0xd7df('0x39'))){_0x5195cf[_0xd7df('0x23')]=qs[_0xd7df('0x23')](_0x3f78fa['query']['limit']);_0x5195cf['offset']=qs[_0xd7df('0x20')](_0x3f78fa[_0xd7df('0x33')]['offset']);}_0x5195cf[_0xd7df('0x3a')]=qs[_0xd7df('0x3b')](_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3b')]);_0x5195cf['where']=qs[_0xd7df('0x3c')](_[_0xd7df('0x3d')](_0x3f78fa['query'],_0x4ba779[_0xd7df('0x3c')]),_0x58584d);if(_0x3f78fa['query'][_0xd7df('0x3e')]){_0x5195cf[_0xd7df('0x3f')]=_[_0xd7df('0x40')](_0x5195cf['where'],{'$or':_[_0xd7df('0x31')](_0x58584d,function(_0x2a7252){if(_0x2a7252[_0xd7df('0x41')]!==_0xd7df('0x42')){var _0x54ea42={};_0x54ea42[_0x2a7252[_0xd7df('0x2a')]]={'$like':'%'+_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x3e')]+'%'};return _0x54ea42;}})});}_0x5195cf=_['merge']({},_0x5195cf,_0x3f78fa[_0xd7df('0x43')]);var _0x207852={'where':_0x5195cf[_0xd7df('0x3f')]};return db['ScreenRecording'][_0xd7df('0x22')](_0x207852)[_0xd7df('0x28')](function(_0x4910cb){_0x52b56a['count']=_0x4910cb;if(_0x3f78fa[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5195cf[_0xd7df('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x5195cf);})[_0xd7df('0x28')](function(_0x4ebdbe){_0x52b56a[_0xd7df('0x46')]=_0x4ebdbe;return _0x52b56a;})['then'](respondWithFilteredResult(_0x36de76,_0x5195cf))['catch'](handleError(_0x36de76,null));};exports[_0xd7df('0x47')]=function(_0x579d0f,_0x18ef10){var _0x5302f4={'raw':![],'where':{'id':_0x579d0f[_0xd7df('0x48')]['id']}},_0xad2d69={};_0xad2d69[_0xd7df('0x30')]=_[_0xd7df('0x34')](db[_0xd7df('0x2d')][_0xd7df('0x49')]);_0xad2d69[_0xd7df('0x33')]=_['keys'](_0x579d0f[_0xd7df('0x33')]);_0xad2d69['filters']=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],_0xad2d69[_0xd7df('0x33')]);_0x5302f4[_0xd7df('0x36')]=_[_0xd7df('0x35')](_0xad2d69[_0xd7df('0x30')],qs[_0xd7df('0x37')](_0x579d0f[_0xd7df('0x33')][_0xd7df('0x37')]));_0x5302f4['attributes']=_0x5302f4[_0xd7df('0x36')][_0xd7df('0x4a')]?_0x5302f4['attributes']:_0xad2d69['model'];if(_0x579d0f[_0xd7df('0x33')][_0xd7df('0x44')]){_0x5302f4[_0xd7df('0x45')]=[{'all':!![]}];}_0x5302f4=_['merge']({},_0x5302f4,_0x579d0f['options']);return db[_0xd7df('0x2d')]['find'](_0x5302f4)[_0xd7df('0x28')](handleEntityNotFound(_0x18ef10,null))[_0xd7df('0x28')](respondWithResult(_0x18ef10,null))[_0xd7df('0x4b')](handleError(_0x18ef10,null));};exports[_0xd7df('0x4c')]=function(_0x1838aa,_0x28c13f){return db[_0xd7df('0x2d')][_0xd7df('0x4c')](_0x1838aa[_0xd7df('0x4d')],{})[_0xd7df('0x28')](respondWithResult(_0x28c13f,0xc9))[_0xd7df('0x4b')](handleError(_0x28c13f,null));};exports[_0xd7df('0x27')]=function(_0x54222c,_0x1f2f99){if(_0x54222c[_0xd7df('0x4d')]['id']){delete _0x54222c[_0xd7df('0x4d')]['id'];}delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x4e')];delete _0x54222c['body'][_0xd7df('0x4f')];delete _0x54222c[_0xd7df('0x4d')][_0xd7df('0x50')];delete _0x54222c['body'][_0xd7df('0x51')];return db['ScreenRecording'][_0xd7df('0x52')]({'where':{'id':_0x54222c[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](handleEntityNotFound(_0x1f2f99,null))[_0xd7df('0x28')](saveUpdates(_0x54222c[_0xd7df('0x4d')],null))['then'](respondWithResult(_0x1f2f99,null))['catch'](handleError(_0x1f2f99,null));};exports['describe']=function(_0xe4b221,_0x4a6cf5){return db[_0xd7df('0x2d')][_0xd7df('0x53')]()[_0xd7df('0x28')](respondWithResult(_0x4a6cf5,null))[_0xd7df('0x4b')](handleError(_0x4a6cf5,null));};exports[_0xd7df('0x54')]=function(_0x418da,_0xf72803,_0xb054d7){var _0x453876=require(_0xd7df('0x55'));var _0x382d11=![];var _0x327365={};if(_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]&&_0x418da[_0xd7df('0x33')][_0xd7df('0x41')]==='uniqueid'){_0x327365[_0xd7df('0x56')]=_0x418da[_0xd7df('0x48')]['id'];}else{_0x327365['id']=_0x418da['params']['id'];}return db['ScreenRecording'][_0xd7df('0x52')]({'where':_0x327365,'attributes':['id','value'],'raw':!![]})[_0xd7df('0x28')](handleEntityNotFound(_0xf72803,null))['then'](function(_0x1f34c2){if(_0x1f34c2){var _0x28151a=path[_0xd7df('0x57')](config['root'],'server/files/screen_recordings',_0x1f34c2['value']);var _0x3666ba=util[_0xd7df('0x32')](_0xd7df('0x58'),_0x28151a);if(fs[_0xd7df('0x59')](_0x3666ba)){_0x382d11=!![];return _0x453876[_0xd7df('0x5a')](_0x3666ba,_0x28151a,config[_0xd7df('0x5b')]['recording'])[_0xd7df('0x28')](function(){return _0x1f34c2;});}return _0x1f34c2;}})[_0xd7df('0x28')](function(_0x35204f){if(_0x35204f){var _0x25d187=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x35204f[_0xd7df('0x51')]);if(!fs[_0xd7df('0x59')](_0x25d187)){throw new db[(_0xd7df('0x5e'))][(_0xd7df('0x5f'))](_0xd7df('0x60'));}if(_0x35204f[_0xd7df('0x61')]){return _0xf72803[_0xd7df('0x54')](_0x25d187,_0x35204f[_0xd7df('0x61')]+path[_0xd7df('0x62')](_0x25d187),function(){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}else{return _0xf72803[_0xd7df('0x54')](_0x25d187,function(_0x3f2775){if(_0x382d11){fs[_0xd7df('0x63')](_0x25d187);}});}}})[_0xd7df('0x4b')](function(_0x393a3a){if(_0x393a3a[_0xd7df('0x64')]===_0xd7df('0x60')){_0xf72803[_0xd7df('0x1d')](0x194)[_0xd7df('0x2b')]('Not\x20found');}else{return handleError(_0xf72803,null);}});};exports['destroy']=function(_0x327402,_0x28f550){return db[_0xd7df('0x2d')]['find']({'where':{'id':_0x327402[_0xd7df('0x48')]['id']}})[_0xd7df('0x28')](function(_0x1e87aa){if(_[_0xd7df('0x65')](_0x1e87aa)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1e87aa;})[_0xd7df('0x28')](function(_0x20ad50){var _0xb06a56=path[_0xd7df('0x57')](config[_0xd7df('0x5c')],_0xd7df('0x5d'),_0x20ad50[_0xd7df('0x51')]);logger[_0xd7df('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0xb06a56);if(!_[_0xd7df('0x65')](_0x20ad50[_0xd7df('0x51')])&&fs['existsSync'](_0xb06a56)){logger['info']('File:\x20\x22'+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}_0xb06a56=_0xb06a56+_0xd7df('0x69');if(!_[_0xd7df('0x65')](_0x20ad50['value'])&&fs[_0xd7df('0x59')](_0xb06a56)){logger[_0xd7df('0x66')](_0xd7df('0x6a')+_0xb06a56+_0xd7df('0x67'));fs[_0xd7df('0x68')](_0xb06a56);}return _0x20ad50;})[_0xd7df('0x28')](function(_0x4124b8){if(!_0x4124b8)throw new InternalError();return _0x4124b8['destroy']();})['then'](function(){_0x28f550[_0xd7df('0x1d')](0xcc)['end']();})[_0xd7df('0x4b')](handleError(_0x28f550,null));};
\ No newline at end of file
+var _0xac9d=['extname','unlink','send','Not\x20found','isNil','Entity\x20not\x20found','root','info','unlinkSync','.cypher','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','closedAt','value','describe','download','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename'];(function(_0x337934,_0x5b9298){var _0x242af0=function(_0x1880f1){while(--_0x1880f1){_0x337934['push'](_0x337934['shift']());}};_0x242af0(++_0x5b9298);}(_0xac9d,0x14d));var _0xdac9=function(_0x425b19,_0x2dcf14){_0x425b19=_0x425b19-0x0;var _0x15ecab=_0xac9d[_0x425b19];return _0x15ecab;};'use strict';var emlformat=require(_0xdac9('0x0'));var rimraf=require(_0xdac9('0x1'));var zipdir=require(_0xdac9('0x2'));var jsonpatch=require(_0xdac9('0x3'));var rp=require(_0xdac9('0x4'));var moment=require(_0xdac9('0x5'));var BPromise=require(_0xdac9('0x6'));var Mustache=require(_0xdac9('0x7'));var util=require('util');var path=require(_0xdac9('0x8'));var sox=require('sox');var csv=require(_0xdac9('0x9'));var ejs=require(_0xdac9('0xa'));var fs=require('fs');var fs_extra=require(_0xdac9('0xb'));var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var licenseUtil=require(_0xdac9('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e97,_0xeddbc1){_0xeddbc1=_0xeddbc1||0xcc;return function(_0xbfe6d8){if(_0xbfe6d8){return _0x3d8e97['sendStatus'](_0xeddbc1);}return _0x3d8e97[_0xdac9('0x1b')](_0xeddbc1)[_0xdac9('0x1c')]();};}function respondWithResult(_0x9e1bf6,_0x5f0bbd){_0x5f0bbd=_0x5f0bbd||0xc8;return function(_0x5dd536){if(_0x5dd536){return _0x9e1bf6[_0xdac9('0x1b')](_0x5f0bbd)[_0xdac9('0x1d')](_0x5dd536);}};}function respondWithFilteredResult(_0x50f9fe,_0x76af7a){return function(_0x36cbe4){if(_0x36cbe4){var _0x152ea5=typeof _0x76af7a[_0xdac9('0x1e')]===_0xdac9('0x1f')&&typeof _0x76af7a[_0xdac9('0x20')]===_0xdac9('0x1f');var _0xec1016=_0x36cbe4['count'];var _0x283343=_0x152ea5?0x0:_0x76af7a[_0xdac9('0x1e')];var _0x571e07=_0x152ea5?_0x36cbe4[_0xdac9('0x21')]:_0x76af7a[_0xdac9('0x1e')]+_0x76af7a[_0xdac9('0x20')];var _0x181d11;if(_0x571e07>=_0xec1016){_0x571e07=_0xec1016;_0x181d11=0xc8;}else{_0x181d11=0xce;}_0x50f9fe['status'](_0x181d11);return _0x50f9fe['set'](_0xdac9('0x22'),_0x283343+'-'+_0x571e07+'/'+_0xec1016)[_0xdac9('0x1d')](_0x36cbe4);}return null;};}function patchUpdates(_0x2b9d91){return function(_0x395ec7){try{jsonpatch['apply'](_0x395ec7,_0x2b9d91,!![]);}catch(_0x23ee5e){return BPromise[_0xdac9('0x23')](_0x23ee5e);}return _0x395ec7[_0xdac9('0x24')]();};}function saveUpdates(_0xae680a,_0xe7bd10){return function(_0x42317c){if(_0x42317c){return _0x42317c[_0xdac9('0x25')](_0xae680a)[_0xdac9('0x26')](function(_0x419f0c){return _0x419f0c;});}return null;};}function removeEntity(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(_0x2943f5){return _0x2943f5[_0xdac9('0x27')]()[_0xdac9('0x26')](function(){_0x33de5c[_0xdac9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e631a,_0x5686db){return function(_0x3ce475){if(!_0x3ce475){_0x1e631a[_0xdac9('0x28')](0x194);}return _0x3ce475;};}function handleError(_0x566d8c,_0x433be9){_0x433be9=_0x433be9||0x1f4;return function(_0x5105f1){logger[_0xdac9('0x29')](_0x5105f1[_0xdac9('0x2a')]);if(_0x5105f1[_0xdac9('0x2b')]){delete _0x5105f1[_0xdac9('0x2b')];}_0x566d8c['status'](_0x433be9)['send'](_0x5105f1);};}exports[_0xdac9('0x2c')]=function(_0x170afd,_0x4fe3bd){var _0x4c4e21={},_0x3eed7a={},_0x3505c5={'count':0x0,'rows':[]};var _0x13efba=_[_0xdac9('0x2d')](db[_0xdac9('0x2e')][_0xdac9('0x2f')],function(_0xed99f9){return{'name':_0xed99f9[_0xdac9('0x30')],'type':_0xed99f9[_0xdac9('0x31')][_0xdac9('0x32')]};});_0x3eed7a[_0xdac9('0x33')]=_[_0xdac9('0x34')](_[_0xdac9('0x2d')](_0x13efba,_0xdac9('0x2b')),[_0xdac9('0x35')]);_0x3eed7a[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x170afd[_0xdac9('0x36')]);_0x3eed7a[_0xdac9('0x38')]=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],_0x3eed7a['query']);_0x4c4e21['attributes']=_[_0xdac9('0x39')](_0x3eed7a[_0xdac9('0x33')],qs[_0xdac9('0x3a')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x3a')]));_0x4c4e21['attributes']=_0x4c4e21[_0xdac9('0x3b')]['length']?_0x4c4e21[_0xdac9('0x3b')]:_0x3eed7a[_0xdac9('0x33')];if(!_0x170afd['query'][_0xdac9('0x3c')]('nolimit')){_0x4c4e21['limit']=qs[_0xdac9('0x20')](_0x170afd[_0xdac9('0x36')][_0xdac9('0x20')]);_0x4c4e21[_0xdac9('0x1e')]=qs[_0xdac9('0x1e')](_0x170afd[_0xdac9('0x36')]['offset']);}_0x4c4e21[_0xdac9('0x3d')]=qs[_0xdac9('0x3e')](_0x170afd['query'][_0xdac9('0x3e')]);_0x4c4e21[_0xdac9('0x3f')]=qs[_0xdac9('0x38')](_[_0xdac9('0x40')](_0x170afd[_0xdac9('0x36')],_0x3eed7a[_0xdac9('0x38')]),_0x13efba);if(_0x170afd[_0xdac9('0x36')]['filter']){_0x4c4e21[_0xdac9('0x3f')]=_[_0xdac9('0x41')](_0x4c4e21[_0xdac9('0x3f')],{'$or':_['map'](_0x13efba,function(_0x9c732e){if(_0x9c732e[_0xdac9('0x31')]!==_0xdac9('0x42')){var _0x1d6f88={};_0x1d6f88[_0x9c732e['name']]={'$like':'%'+_0x170afd['query'][_0xdac9('0x43')]+'%'};return _0x1d6f88;}})});}_0x4c4e21=_[_0xdac9('0x41')]({},_0x4c4e21,_0x170afd[_0xdac9('0x44')]);var _0x260f0e={'where':_0x4c4e21[_0xdac9('0x3f')]};return db['ScreenRecording'][_0xdac9('0x21')](_0x260f0e)['then'](function(_0xd74baf){_0x3505c5[_0xdac9('0x21')]=_0xd74baf;if(_0x170afd[_0xdac9('0x36')][_0xdac9('0x45')]){_0x4c4e21[_0xdac9('0x46')]=[{'all':!![]}];}return db[_0xdac9('0x2e')][_0xdac9('0x47')](_0x4c4e21);})[_0xdac9('0x26')](function(_0x11362d){_0x3505c5[_0xdac9('0x48')]=_0x11362d;return _0x3505c5;})[_0xdac9('0x26')](respondWithFilteredResult(_0x4fe3bd,_0x4c4e21))[_0xdac9('0x49')](handleError(_0x4fe3bd,null));};exports[_0xdac9('0x4a')]=function(_0x441676,_0x5335ae){var _0x3857cf={'raw':![],'where':{'id':_0x441676['params']['id']}},_0x272b52={};_0x272b52[_0xdac9('0x33')]=_[_0xdac9('0x37')](db[_0xdac9('0x2e')][_0xdac9('0x2f')]);_0x272b52[_0xdac9('0x36')]=_[_0xdac9('0x37')](_0x441676['query']);_0x272b52[_0xdac9('0x38')]=_['intersection'](_0x272b52[_0xdac9('0x33')],_0x272b52[_0xdac9('0x36')]);_0x3857cf[_0xdac9('0x3b')]=_[_0xdac9('0x39')](_0x272b52['model'],qs['fields'](_0x441676['query'][_0xdac9('0x3a')]));_0x3857cf['attributes']=_0x3857cf['attributes'][_0xdac9('0x4b')]?_0x3857cf[_0xdac9('0x3b')]:_0x272b52['model'];if(_0x441676['query'][_0xdac9('0x45')]){_0x3857cf[_0xdac9('0x46')]=[{'all':!![]}];}_0x3857cf=_[_0xdac9('0x41')]({},_0x3857cf,_0x441676[_0xdac9('0x44')]);return db[_0xdac9('0x2e')][_0xdac9('0x4c')](_0x3857cf)[_0xdac9('0x26')](handleEntityNotFound(_0x5335ae,null))[_0xdac9('0x26')](respondWithResult(_0x5335ae,null))['catch'](handleError(_0x5335ae,null));};exports[_0xdac9('0x4d')]=function(_0x3bd946,_0xfa104f){return db[_0xdac9('0x2e')][_0xdac9('0x4d')](_0x3bd946[_0xdac9('0x4e')],{})[_0xdac9('0x26')](respondWithResult(_0xfa104f,0xc9))[_0xdac9('0x49')](handleError(_0xfa104f,null));};exports[_0xdac9('0x25')]=function(_0x242c24,_0x257e48){if(_0x242c24[_0xdac9('0x4e')]['id']){delete _0x242c24[_0xdac9('0x4e')]['id'];}delete _0x242c24[_0xdac9('0x4e')]['duration'];delete _0x242c24['body']['createdAt'];delete _0x242c24[_0xdac9('0x4e')][_0xdac9('0x4f')];delete _0x242c24['body'][_0xdac9('0x50')];return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':{'id':_0x242c24['params']['id']}})[_0xdac9('0x26')](handleEntityNotFound(_0x257e48,null))[_0xdac9('0x26')](saveUpdates(_0x242c24['body'],null))['then'](respondWithResult(_0x257e48,null))[_0xdac9('0x49')](handleError(_0x257e48,null));};exports[_0xdac9('0x51')]=function(_0x222de9,_0x370532){return db[_0xdac9('0x2e')][_0xdac9('0x51')]()[_0xdac9('0x26')](respondWithResult(_0x370532,null))[_0xdac9('0x49')](handleError(_0x370532,null));};exports[_0xdac9('0x52')]=function(_0x41579a,_0x10a2cc,_0x32b5f5){var _0xecb50a=require(_0xdac9('0x53'));var _0x35a378=![];var _0x5d0b43={};if(_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]&&_0x41579a[_0xdac9('0x36')][_0xdac9('0x31')]===_0xdac9('0x54')){_0x5d0b43[_0xdac9('0x54')]=_0x41579a['params']['id'];}else{_0x5d0b43['id']=_0x41579a[_0xdac9('0x55')]['id'];}return db[_0xdac9('0x2e')][_0xdac9('0x4c')]({'where':_0x5d0b43,'attributes':['id',_0xdac9('0x50')],'raw':!![]})[_0xdac9('0x26')](handleEntityNotFound(_0x10a2cc,null))[_0xdac9('0x26')](function(_0x1eec39){if(_0x1eec39){var _0x243862=path[_0xdac9('0x56')](config['root'],_0xdac9('0x57'),_0x1eec39[_0xdac9('0x50')]);var _0x3cab26=util[_0xdac9('0x35')](_0xdac9('0x58'),_0x243862);if(fs[_0xdac9('0x59')](_0x3cab26)){_0x35a378=!![];return _0xecb50a['decryptFile'](_0x3cab26,_0x243862,config['secrets'][_0xdac9('0x5a')])[_0xdac9('0x26')](function(){return _0x1eec39;});}return _0x1eec39;}})[_0xdac9('0x26')](function(_0x46017d){if(_0x46017d){var _0x1c1f5f=path[_0xdac9('0x56')](config['root'],'server/files/screen_recordings',_0x46017d['value']);if(!fs[_0xdac9('0x59')](_0x1c1f5f)){throw new db[(_0xdac9('0x5b'))][(_0xdac9('0x5c'))](_0xdac9('0x5d'));}if(_0x46017d['filename']){return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,_0x46017d[_0xdac9('0x5e')]+path[_0xdac9('0x5f')](_0x1c1f5f),function(){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}else{return _0x10a2cc[_0xdac9('0x52')](_0x1c1f5f,function(_0x496d9c){if(_0x35a378){fs[_0xdac9('0x60')](_0x1c1f5f);}});}}})['catch'](function(_0x60b64e){if(_0x60b64e['message']===_0xdac9('0x5d')){_0x10a2cc[_0xdac9('0x1b')](0x194)[_0xdac9('0x61')](_0xdac9('0x62'));}else{return handleError(_0x10a2cc,null);}});};exports[_0xdac9('0x27')]=function(_0x40dec7,_0x232440){return db['ScreenRecording']['find']({'where':{'id':_0x40dec7['params']['id']}})[_0xdac9('0x26')](function(_0x42ba53){if(_[_0xdac9('0x63')](_0x42ba53)){throw new ReferenceError(_0xdac9('0x64'));}return _0x42ba53;})[_0xdac9('0x26')](function(_0x29df1d){var _0x288e7e=path['join'](config[_0xdac9('0x65')],'server/files/screen_recordings',_0x29df1d['value']);logger[_0xdac9('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x288e7e);if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')]('File:\x20\x22'+_0x288e7e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xdac9('0x67')](_0x288e7e);}_0x288e7e=_0x288e7e+_0xdac9('0x68');if(!_['isNil'](_0x29df1d[_0xdac9('0x50')])&&fs[_0xdac9('0x59')](_0x288e7e)){logger[_0xdac9('0x66')](_0xdac9('0x69')+_0x288e7e+_0xdac9('0x6a'));fs[_0xdac9('0x67')](_0x288e7e);}return _0x29df1d;})[_0xdac9('0x26')](function(_0xef4531){if(!_0xef4531)throw new InternalError();return _0xef4531[_0xdac9('0x27')]();})[_0xdac9('0x26')](function(){_0x232440[_0xdac9('0x1b')](0xcc)[_0xdac9('0x1c')]();})['catch'](handleError(_0x232440,null));};
\ No newline at end of file
index ba07f5f..076188b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ba=['util','../../config/logger','api','path','rimraf','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x36258e,_0x3c60ab){var _0x476be9=function(_0x48014a){while(--_0x48014a){_0x36258e['push'](_0x36258e['shift']());}};_0x476be9(++_0x3c60ab);}(_0x55ba,0x6d));var _0xa55b=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x55ba[_0x4709c8];return _0x478cdd;};'use strict';var _=require(_0xa55b('0x0'));var util=require(_0xa55b('0x1'));var logger=require(_0xa55b('0x2'))(_0xa55b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa55b('0x4'));var rimraf=require(_0xa55b('0x5'));var config=require('../../config/environment');var attributes=require(_0xa55b('0x6'));module['exports']=function(_0xeb91ae,_0x15b21c){return _0xeb91ae[_0xa55b('0x7')](_0xa55b('0x8'),attributes,{'tableName':_0xa55b('0x9'),'paranoid':![],'indexes':[{'name':_0xa55b('0xa'),'fields':[_0xa55b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x210f=['ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x375201,_0x2cdbd8){var _0x55f38f=function(_0x129187){while(--_0x129187){_0x375201['push'](_0x375201['shift']());}};_0x55f38f(++_0x2cdbd8);}(_0x210f,0xe3));var _0xf210=function(_0x153b8c,_0x16dfeb){_0x153b8c=_0x153b8c-0x0;var _0x53d528=_0x210f[_0x153b8c];return _0x53d528;};'use strict';var _=require(_0xf210('0x0'));var util=require(_0xf210('0x1'));var logger=require('../../config/logger')(_0xf210('0x2'));var moment=require(_0xf210('0x3'));var BPromise=require(_0xf210('0x4'));var rp=require(_0xf210('0x5'));var fs=require('fs');var path=require(_0xf210('0x6'));var rimraf=require(_0xf210('0x7'));var config=require(_0xf210('0x8'));var attributes=require('./screenRecording.attributes');module[_0xf210('0x9')]=function(_0x1ff621,_0x2a4fa9){return _0x1ff621[_0xf210('0xa')](_0xf210('0xb'),attributes,{'tableName':_0xf210('0xc'),'paranoid':![],'indexes':[{'name':_0xf210('0xd'),'fields':[_0xf210('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index e061358..4555152 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f4=['client','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x26f4,0xcc));var _0x426f=function(_0x486c31,_0x1fb2bd){_0x486c31=_0x486c31-0x0;var _0x1a61f6=_0x26f4[_0x486c31];return _0x1a61f6;};'use strict';var _=require(_0x426f('0x0'));var util=require(_0x426f('0x1'));var moment=require(_0x426f('0x2'));var BPromise=require(_0x426f('0x3'));var rs=require(_0x426f('0x4'));var fs=require('fs');var Redis=require(_0x426f('0x5'));var db=require(_0x426f('0x6'))['db'];var utils=require(_0x426f('0x7'));var logger=require(_0x426f('0x8'))(_0x426f('0x9'));var config=require(_0x426f('0xa'));var jayson=require(_0x426f('0xb'));var client=jayson[_0x426f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bdb0e,_0x471f4b,_0x21cbac){return new BPromise(function(_0xe54893,_0x3a485b){return client['request'](_0x1bdb0e,_0x21cbac)[_0x426f('0xd')](function(_0x51cdb5){logger['info'](_0x426f('0xe'),_0x471f4b,_0x426f('0xf'));logger[_0x426f('0x10')](_0x426f('0x11'),_0x471f4b,_0x426f('0xf'),JSON[_0x426f('0x12')](_0x51cdb5));if(_0x51cdb5[_0x426f('0x13')]){if(_0x51cdb5[_0x426f('0x13')][_0x426f('0x14')]===0x1f4){logger[_0x426f('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x471f4b,_0x51cdb5[_0x426f('0x13')]['message']);return _0x3a485b(_0x51cdb5[_0x426f('0x13')][_0x426f('0x15')]);}logger[_0x426f('0x13')](_0x426f('0xe'),_0x471f4b,_0x51cdb5['error']['message']);return _0xe54893(_0x51cdb5['error'][_0x426f('0x15')]);}else{logger[_0x426f('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x471f4b,_0x426f('0xf'));_0xe54893(_0x51cdb5[_0x426f('0x17')][_0x426f('0x15')]);}})['catch'](function(_0x2378eb){logger[_0x426f('0x13')](_0x426f('0xe'),_0x471f4b,_0x2378eb);_0x3a485b(_0x2378eb);});});}
\ No newline at end of file
+var _0x8930=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x8930,0x192));var _0x0893=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8930[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x0893('0x0'));var util=require(_0x0893('0x1'));var moment=require(_0x0893('0x2'));var BPromise=require(_0x0893('0x3'));var rs=require(_0x0893('0x4'));var fs=require('fs');var Redis=require(_0x0893('0x5'));var db=require(_0x0893('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0893('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0893('0x8'));var client=jayson[_0x0893('0x9')][_0x0893('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b0c30,_0xd7968,_0x375baa){return new BPromise(function(_0x56370e,_0x5064e7){return client[_0x0893('0xb')](_0x2b0c30,_0x375baa)[_0x0893('0xc')](function(_0x25ee0c){logger[_0x0893('0xd')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x0893('0xe'));logger[_0x0893('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0xd7968,_0x0893('0xe'),JSON[_0x0893('0x10')](_0x25ee0c));if(_0x25ee0c[_0x0893('0x11')]){if(_0x25ee0c[_0x0893('0x11')]['code']===0x1f4){logger[_0x0893('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x25ee0c['error'][_0x0893('0x12')]);return _0x5064e7(_0x25ee0c[_0x0893('0x11')][_0x0893('0x12')]);}logger[_0x0893('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x25ee0c[_0x0893('0x11')][_0x0893('0x12')]);return _0x56370e(_0x25ee0c[_0x0893('0x11')][_0x0893('0x12')]);}else{logger[_0x0893('0xd')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x0893('0xe'));_0x56370e(_0x25ee0c[_0x0893('0x13')][_0x0893('0x12')]);}})[_0x0893('0x14')](function(_0x3d8b76){logger[_0x0893('0x11')]('ScreenRecording,\x20%s,\x20%s',_0xd7968,_0x3d8b76);_0x5064e7(_0x3d8b76);});});}
\ No newline at end of file
index cc6dcb3..820d774 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b37=['gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','format','%s%s','logo','extname','originalname','single','file','addLogo','join','server/files/images/logos/','logologin','preferred','post','addPreferred','favicon','addFavicon','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr'];(function(_0x470cce,_0x92ab62){var _0x371fbd=function(_0x255649){while(--_0x255649){_0x470cce['push'](_0x470cce['shift']());}};_0x371fbd(++_0x92ab62);}(_0x6b37,0x90));var _0x76b3=function(_0x565060,_0x5ac753){_0x565060=_0x565060-0x0;var _0xe6e453=_0x6b37[_0x565060];return _0xe6e453;};'use strict';var multer=require(_0x76b3('0x0'));var util=require(_0x76b3('0x1'));var path=require(_0x76b3('0x2'));var timeout=require(_0x76b3('0x3'));var express=require('express');var router=express[_0x76b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76b3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x76b3('0x6'));router[_0x76b3('0x7')]('/',auth[_0x76b3('0x8')](),controller[_0x76b3('0x9')]);router[_0x76b3('0x7')](_0x76b3('0xa'),controller['getDate']);router[_0x76b3('0x7')](_0x76b3('0xb'),controller[_0x76b3('0xc')]);router[_0x76b3('0x7')]('/:id/logo',controller['getLogo']);router[_0x76b3('0x7')](_0x76b3('0xd'),controller[_0x76b3('0xe')]);router[_0x76b3('0x7')](_0x76b3('0xf'),controller[_0x76b3('0x10')]);router['get'](_0x76b3('0x11'),controller[_0x76b3('0x12')]);router[_0x76b3('0x7')](_0x76b3('0x13'),controller[_0x76b3('0x14')]);var upload=multer({'storage':multer[_0x76b3('0x15')]({'destination':function(_0x216019,_0x13b06,_0x5a3cb8){_0x5a3cb8(null,path['join'](config[_0x76b3('0x16')],'server/files/images/logos/'));},'filename':function(_0x5a195b,_0x2f39b8,_0x4bf862){_0x4bf862(null,util[_0x76b3('0x17')](_0x76b3('0x18'),_0x76b3('0x19'),path[_0x76b3('0x1a')](_0x2f39b8[_0x76b3('0x1b')])));}})});router['post']('/:id/logo',upload[_0x76b3('0x1c')](_0x76b3('0x1d')),controller[_0x76b3('0x1e')]);var upload=multer({'storage':multer[_0x76b3('0x15')]({'destination':function(_0x444d30,_0x3f6634,_0x1efc31){_0x1efc31(null,path[_0x76b3('0x1f')](config[_0x76b3('0x16')],_0x76b3('0x20')));},'filename':function(_0x568bb7,_0x504b15,_0x4b21d9){_0x4b21d9(null,util[_0x76b3('0x17')](_0x76b3('0x18'),_0x76b3('0x21'),path[_0x76b3('0x1a')](_0x504b15['originalname'])));}})});router['post']('/:id/logo_login',upload['single'](_0x76b3('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x76b3('0x15')]({'destination':function(_0x59d951,_0x188298,_0x2922d8){_0x2922d8(null,path['join'](config[_0x76b3('0x16')],_0x76b3('0x20')));},'filename':function(_0x1f7797,_0x2e4a53,_0x43012d){_0x43012d(null,util[_0x76b3('0x17')](_0x76b3('0x18'),_0x76b3('0x22'),path[_0x76b3('0x1a')](_0x2e4a53['originalname'])));}})});router[_0x76b3('0x23')](_0x76b3('0x11'),upload[_0x76b3('0x1c')](_0x76b3('0x1d')),controller[_0x76b3('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cc127,_0x4670f1,_0x4b1974){_0x4b1974(null,path[_0x76b3('0x1f')](config[_0x76b3('0x16')],'server/files/images/logos/'));},'filename':function(_0x399626,_0x355a3a,_0x1e2ff8){_0x1e2ff8(null,util['format'](_0x76b3('0x18'),_0x76b3('0x25'),path[_0x76b3('0x1a')](_0x355a3a['originalname'])));}})});router[_0x76b3('0x23')](_0x76b3('0x13'),upload['single'](_0x76b3('0x1d')),controller[_0x76b3('0x26')]);router['put']('/:id',auth[_0x76b3('0x8')](),controller['update']);module[_0x76b3('0x27')]=router;
\ No newline at end of file
+var _0xfb2c=['get','isAuthenticated','index','/now','/:id','show','getLogo','/:id/logo_login','/:id/gdpr','/:id/preferred','getPreferred','getFavicon','join','root','server/files/images/logos/','%s%s','logo','originalname','/:id/logo','file','addLogo','diskStorage','format','logologin','extname','preferred','post','single','addFavicon','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48b81e,_0x1ba337){var _0x4f05f1=function(_0xca85d5){while(--_0xca85d5){_0x48b81e['push'](_0x48b81e['shift']());}};_0x4f05f1(++_0x1ba337);}(_0xfb2c,0x102));var _0xcfb2=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xfb2c[_0x2a6809];return _0x11c371;};'use strict';var multer=require('multer');var util=require(_0xcfb2('0x0'));var path=require('path');var timeout=require(_0xcfb2('0x1'));var express=require(_0xcfb2('0x2'));var router=express[_0xcfb2('0x3')]();var fs_extra=require(_0xcfb2('0x4'));var auth=require(_0xcfb2('0x5'));var interaction=require(_0xcfb2('0x6'));var config=require(_0xcfb2('0x7'));var controller=require('./setting.controller');router[_0xcfb2('0x8')]('/',auth[_0xcfb2('0x9')](),controller[_0xcfb2('0xa')]);router[_0xcfb2('0x8')](_0xcfb2('0xb'),controller['getDate']);router['get'](_0xcfb2('0xc'),controller[_0xcfb2('0xd')]);router['get']('/:id/logo',controller[_0xcfb2('0xe')]);router[_0xcfb2('0x8')](_0xcfb2('0xf'),controller['getLogoLogin']);router[_0xcfb2('0x8')](_0xcfb2('0x10'),controller['gdpr']);router[_0xcfb2('0x8')](_0xcfb2('0x11'),controller[_0xcfb2('0x12')]);router[_0xcfb2('0x8')]('/:id/favicon',controller[_0xcfb2('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c18e2,_0x54a0a7,_0x16b137){_0x16b137(null,path[_0xcfb2('0x14')](config[_0xcfb2('0x15')],_0xcfb2('0x16')));},'filename':function(_0x1d809a,_0x56ae34,_0x532b0c){_0x532b0c(null,util['format'](_0xcfb2('0x17'),_0xcfb2('0x18'),path['extname'](_0x56ae34[_0xcfb2('0x19')])));}})});router['post'](_0xcfb2('0x1a'),upload['single'](_0xcfb2('0x1b')),controller[_0xcfb2('0x1c')]);var upload=multer({'storage':multer[_0xcfb2('0x1d')]({'destination':function(_0x3418fa,_0xb66a58,_0x44278c){_0x44278c(null,path[_0xcfb2('0x14')](config['root'],_0xcfb2('0x16')));},'filename':function(_0x13d3bb,_0x5846d8,_0x5ed8c6){_0x5ed8c6(null,util[_0xcfb2('0x1e')](_0xcfb2('0x17'),_0xcfb2('0x1f'),path[_0xcfb2('0x20')](_0x5846d8['originalname'])));}})});router['post'](_0xcfb2('0xf'),upload['single'](_0xcfb2('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xcfb2('0x1d')]({'destination':function(_0x5367fc,_0x1e973c,_0x5566d3){_0x5566d3(null,path[_0xcfb2('0x14')](config[_0xcfb2('0x15')],_0xcfb2('0x16')));},'filename':function(_0x456264,_0x32cc36,_0x39327b){_0x39327b(null,util[_0xcfb2('0x1e')](_0xcfb2('0x17'),_0xcfb2('0x21'),path[_0xcfb2('0x20')](_0x32cc36[_0xcfb2('0x19')])));}})});router[_0xcfb2('0x22')](_0xcfb2('0x11'),upload[_0xcfb2('0x23')](_0xcfb2('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0xcfb2('0x1d')]({'destination':function(_0x4f3e97,_0x5daa9e,_0x1dc65f){_0x1dc65f(null,path[_0xcfb2('0x14')](config[_0xcfb2('0x15')],_0xcfb2('0x16')));},'filename':function(_0x494976,_0x5bbe32,_0x4040a8){_0x4040a8(null,util[_0xcfb2('0x1e')]('%s%s','favicon',path['extname'](_0x5bbe32[_0xcfb2('0x19')])));}})});router[_0xcfb2('0x22')]('/:id/favicon',upload['single']('file'),controller[_0xcfb2('0x24')]);router['put'](_0xcfb2('0xc'),auth['isAuthenticated'](),controller['update']);module[_0xcfb2('0x25')]=router;
\ No newline at end of file
index 24ecc2c..7833541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x5a3f8b,_0x30aef7){var _0x42bacc=function(_0x2b461e){while(--_0x2b461e){_0x5a3f8b['push'](_0x5a3f8b['shift']());}};_0x42bacc(++_0x30aef7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
+var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x129a8b,_0xa20f08){var _0x57b603=function(_0x55cc90){while(--_0x55cc90){_0x129a8b['push'](_0x129a8b['shift']());}};_0x57b603(++_0xa20f08);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
index 8a65f64..f5deead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5ec=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show','keys','includeAll','find','update','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','root','toLower','default_logo.svg','upperFirst','custom','existsSync','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultPreferred','default_loginLogo.svg','default','preferred','getPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','status','end','json','offset','undefined','limit','count','set','apply','reject','sendStatus','stack','name','send','index','map','Setting','rawAttributes'];(function(_0x4d9fdb,_0x4fbf99){var _0x49d254=function(_0x224011){while(--_0x224011){_0x4d9fdb['push'](_0x4d9fdb['shift']());}};_0x49d254(++_0x4fbf99);}(_0xd5ec,0xb8));var _0xcd5e=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xd5ec[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0xcd5e('0x0'));var rimraf=require(_0xcd5e('0x1'));var zipdir=require(_0xcd5e('0x2'));var jsonpatch=require(_0xcd5e('0x3'));var rp=require('request-promise');var moment=require(_0xcd5e('0x4'));var BPromise=require(_0xcd5e('0x5'));var Mustache=require(_0xcd5e('0x6'));var util=require(_0xcd5e('0x7'));var path=require(_0xcd5e('0x8'));var sox=require(_0xcd5e('0x9'));var csv=require(_0xcd5e('0xa'));var ejs=require(_0xcd5e('0xb'));var fs=require('fs');var fs_extra=require(_0xcd5e('0xc'));var _=require(_0xcd5e('0xd'));var squel=require(_0xcd5e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd5e('0xf'));var toCsv=require(_0xcd5e('0xa'));var querystring=require(_0xcd5e('0x10'));var Papa=require('papaparse');var Redis=require(_0xcd5e('0x11'));var authService=require(_0xcd5e('0x12'));var qs=require(_0xcd5e('0x13'));var as=require(_0xcd5e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5e('0x15'))('api');var utils=require(_0xcd5e('0x16'));var config=require(_0xcd5e('0x17'));var licenseUtil=require(_0xcd5e('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xcd5e('0x19'));var client=jayson[_0xcd5e('0x1a')][_0xcd5e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x576716,_0x44a8b8,_0x1a933d,_0x25f0b8){return new BPromise(function(_0x32f947,_0x4203a9){var _0x38b33c=_0x25f0b8||client;return _0x38b33c['request'](_0x576716,_0x1a933d)[_0xcd5e('0x1c')](function(_0x40a6de){logger[_0xcd5e('0x1d')]('Setting,\x20%s,\x20%s',_0x44a8b8,'request\x20sent');logger[_0xcd5e('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x44a8b8,_0xcd5e('0x1f'),JSON[_0xcd5e('0x20')](_0x40a6de));if(_0x40a6de[_0xcd5e('0x21')]){if(_0x40a6de[_0xcd5e('0x21')][_0xcd5e('0x22')]===0x1f4){logger[_0xcd5e('0x21')](_0xcd5e('0x23'),_0x44a8b8,_0x40a6de[_0xcd5e('0x21')]['message']);return _0x4203a9(_0x40a6de[_0xcd5e('0x21')][_0xcd5e('0x24')]);}logger['error'](_0xcd5e('0x23'),_0x44a8b8,_0x40a6de[_0xcd5e('0x21')][_0xcd5e('0x24')]);return _0x32f947(_0x40a6de[_0xcd5e('0x21')]['message']);}else{logger[_0xcd5e('0x1d')](_0xcd5e('0x23'),_0x44a8b8,_0xcd5e('0x1f'));_0x32f947(_0x40a6de['result']['message']);}})[_0xcd5e('0x25')](function(_0xa5ce29){logger[_0xcd5e('0x21')](_0xcd5e('0x23'),_0x44a8b8,_0xa5ce29);_0x4203a9(_0xa5ce29);});});}function respondWithStatusCode(_0x88e21d,_0x3f2f15){_0x3f2f15=_0x3f2f15||0xcc;return function(_0x109209){if(_0x109209){return _0x88e21d['sendStatus'](_0x3f2f15);}return _0x88e21d[_0xcd5e('0x26')](_0x3f2f15)[_0xcd5e('0x27')]();};}function respondWithResult(_0x28cc4f,_0x1b5a89){_0x1b5a89=_0x1b5a89||0xc8;return function(_0x57e339){if(_0x57e339){return _0x28cc4f[_0xcd5e('0x26')](_0x1b5a89)[_0xcd5e('0x28')](_0x57e339);}};}function respondWithFilteredResult(_0x2371b8,_0x4d4125){return function(_0x8930c7){if(_0x8930c7){var _0x335758=typeof _0x4d4125[_0xcd5e('0x29')]===_0xcd5e('0x2a')&&typeof _0x4d4125[_0xcd5e('0x2b')]===_0xcd5e('0x2a');var _0x572527=_0x8930c7['count'];var _0x44ac50=_0x335758?0x0:_0x4d4125[_0xcd5e('0x29')];var _0x1d3752=_0x335758?_0x8930c7[_0xcd5e('0x2c')]:_0x4d4125[_0xcd5e('0x29')]+_0x4d4125[_0xcd5e('0x2b')];var _0x1576af;if(_0x1d3752>=_0x572527){_0x1d3752=_0x572527;_0x1576af=0xc8;}else{_0x1576af=0xce;}_0x2371b8[_0xcd5e('0x26')](_0x1576af);return _0x2371b8[_0xcd5e('0x2d')]('Content-Range',_0x44ac50+'-'+_0x1d3752+'/'+_0x572527)['json'](_0x8930c7);}return null;};}function patchUpdates(_0x495d42){return function(_0x1f03d3){try{jsonpatch[_0xcd5e('0x2e')](_0x1f03d3,_0x495d42,!![]);}catch(_0x5ec598){return BPromise[_0xcd5e('0x2f')](_0x5ec598);}return _0x1f03d3['save']();};}function saveUpdates(_0x366fc8,_0x1cacc5){return function(_0x7cee7d){if(_0x7cee7d){return _0x7cee7d['update'](_0x366fc8)[_0xcd5e('0x1c')](function(_0x3c2d2b){return _0x3c2d2b;});}return null;};}function removeEntity(_0x2f9c40,_0x2d8d90){return function(_0x3ecda5){if(_0x3ecda5){return _0x3ecda5['destroy']()[_0xcd5e('0x1c')](function(){_0x2f9c40[_0xcd5e('0x26')](0xcc)[_0xcd5e('0x27')]();});}};}function handleEntityNotFound(_0x3b51be,_0x19f81c){return function(_0x541be1){if(!_0x541be1){_0x3b51be[_0xcd5e('0x30')](0x194);}return _0x541be1;};}function handleError(_0x46ae80,_0x4e84d1){_0x4e84d1=_0x4e84d1||0x1f4;return function(_0x3af373){logger[_0xcd5e('0x21')](_0x3af373[_0xcd5e('0x31')]);if(_0x3af373[_0xcd5e('0x32')]){delete _0x3af373[_0xcd5e('0x32')];}_0x46ae80[_0xcd5e('0x26')](_0x4e84d1)[_0xcd5e('0x33')](_0x3af373);};}exports[_0xcd5e('0x34')]=function(_0x1af318,_0x498c0b){var _0x22c8d0={},_0x1edab8={},_0xdf5e2a={'count':0x0,'rows':[]};var _0x39b7f6=_[_0xcd5e('0x35')](db[_0xcd5e('0x36')][_0xcd5e('0x37')],function(_0x2e59e3){return{'name':_0x2e59e3[_0xcd5e('0x38')],'type':_0x2e59e3[_0xcd5e('0x39')][_0xcd5e('0x3a')]};});_0x1edab8[_0xcd5e('0x3b')]=_[_0xcd5e('0x35')](_0x39b7f6,_0xcd5e('0x32'));_0x1edab8[_0xcd5e('0x3c')]=_['keys'](_0x1af318[_0xcd5e('0x3c')]);_0x1edab8[_0xcd5e('0x3d')]=_[_0xcd5e('0x3e')](_0x1edab8[_0xcd5e('0x3b')],_0x1edab8[_0xcd5e('0x3c')]);_0x22c8d0[_0xcd5e('0x3f')]=_[_0xcd5e('0x3e')](_0x1edab8[_0xcd5e('0x3b')],qs[_0xcd5e('0x40')](_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x40')]));_0x22c8d0[_0xcd5e('0x3f')]=_0x22c8d0[_0xcd5e('0x3f')][_0xcd5e('0x41')]?_0x22c8d0[_0xcd5e('0x3f')]:_0x1edab8['model'];if(!_0x1af318['query'][_0xcd5e('0x42')](_0xcd5e('0x43'))){_0x22c8d0['limit']=qs[_0xcd5e('0x2b')](_0x1af318[_0xcd5e('0x3c')]['limit']);_0x22c8d0['offset']=qs[_0xcd5e('0x29')](_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x29')]);}_0x22c8d0[_0xcd5e('0x44')]=qs['sort'](_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x45')]);_0x22c8d0[_0xcd5e('0x46')]=qs[_0xcd5e('0x3d')](_[_0xcd5e('0x47')](_0x1af318[_0xcd5e('0x3c')],_0x1edab8['filters']),_0x39b7f6);if(_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x48')]){_0x22c8d0[_0xcd5e('0x46')]=_[_0xcd5e('0x49')](_0x22c8d0[_0xcd5e('0x46')],{'$or':_['map'](_0x39b7f6,function(_0x190891){if(_0x190891[_0xcd5e('0x39')]!=='VIRTUAL'){var _0x2c7f60={};_0x2c7f60[_0x190891[_0xcd5e('0x32')]]={'$like':'%'+_0x1af318[_0xcd5e('0x3c')][_0xcd5e('0x48')]+'%'};return _0x2c7f60;}})});}_0x22c8d0=_[_0xcd5e('0x49')]({},_0x22c8d0,_0x1af318[_0xcd5e('0x4a')]);var _0xca5628={'where':_0x22c8d0['where']};return db['Setting'][_0xcd5e('0x2c')](_0xca5628)[_0xcd5e('0x1c')](function(_0x5bbd0c){_0xdf5e2a[_0xcd5e('0x2c')]=_0x5bbd0c;if(_0x1af318[_0xcd5e('0x3c')]['includeAll']){_0x22c8d0[_0xcd5e('0x4b')]=[{'all':!![]}];}return db[_0xcd5e('0x36')][_0xcd5e('0x4c')](_0x22c8d0);})[_0xcd5e('0x1c')](function(_0x598503){_0xdf5e2a['rows']=_0x598503;return _0xdf5e2a;})[_0xcd5e('0x1c')](respondWithFilteredResult(_0x498c0b,_0x22c8d0))[_0xcd5e('0x25')](handleError(_0x498c0b,null));};exports[_0xcd5e('0x4d')]=function(_0x3b8b45,_0x2c625a){var _0x18f89a={'raw':![],'where':{'id':_0x3b8b45['params']['id']}},_0x1326a2={};_0x1326a2[_0xcd5e('0x3b')]=_[_0xcd5e('0x4e')](db[_0xcd5e('0x36')][_0xcd5e('0x37')]);_0x1326a2[_0xcd5e('0x3c')]=_[_0xcd5e('0x4e')](_0x3b8b45[_0xcd5e('0x3c')]);_0x1326a2['filters']=_[_0xcd5e('0x3e')](_0x1326a2[_0xcd5e('0x3b')],_0x1326a2[_0xcd5e('0x3c')]);_0x18f89a['attributes']=_[_0xcd5e('0x3e')](_0x1326a2[_0xcd5e('0x3b')],qs[_0xcd5e('0x40')](_0x3b8b45[_0xcd5e('0x3c')][_0xcd5e('0x40')]));_0x18f89a[_0xcd5e('0x3f')]=_0x18f89a[_0xcd5e('0x3f')][_0xcd5e('0x41')]?_0x18f89a[_0xcd5e('0x3f')]:_0x1326a2[_0xcd5e('0x3b')];if(_0x3b8b45['query'][_0xcd5e('0x4f')]){_0x18f89a[_0xcd5e('0x4b')]=[{'all':!![]}];}_0x18f89a=_['merge']({},_0x18f89a,_0x3b8b45['options']);return db['Setting'][_0xcd5e('0x50')](_0x18f89a)[_0xcd5e('0x1c')](handleEntityNotFound(_0x2c625a,null))['then'](respondWithResult(_0x2c625a,null))[_0xcd5e('0x25')](handleError(_0x2c625a,null));};exports[_0xcd5e('0x51')]=function(_0x4cac4f,_0x4a3ab0){if(_0x4cac4f[_0xcd5e('0x52')]['id']){delete _0x4cac4f['body']['id'];}return db[_0xcd5e('0x36')]['find']({'where':{'id':_0x4cac4f[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x4a3ab0,null))[_0xcd5e('0x1c')](saveUpdates(_0x4cac4f['body'],null))[_0xcd5e('0x1c')](respondWithResult(_0x4a3ab0,null))['catch'](handleError(_0x4a3ab0,null));};exports[_0xcd5e('0x54')]=function(_0x54babc,_0x6b946d,_0x3dd5c7){if(_0x54babc[_0xcd5e('0x55')]&&_0x54babc['file'][_0xcd5e('0x56')]){_0x54babc[_0xcd5e('0x52')][_0xcd5e('0x57')]=_0x54babc[_0xcd5e('0x55')][_0xcd5e('0x56')];}return db[_0xcd5e('0x36')][_0xcd5e('0x50')]({'where':{'id':_0x54babc[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x6b946d,null))[_0xcd5e('0x1c')](saveUpdates(_0x54babc[_0xcd5e('0x52')],null))[_0xcd5e('0x1c')](respondWithResult(_0x6b946d,null))[_0xcd5e('0x25')](handleError(_0x6b946d,null));};exports[_0xcd5e('0x58')]=function(_0x455609,_0x39cc5d,_0x46ebe4){if(_0x455609[_0xcd5e('0x55')]&&_0x455609['file'][_0xcd5e('0x56')]){_0x455609['body'][_0xcd5e('0x59')]=_0x455609[_0xcd5e('0x55')][_0xcd5e('0x56')];}return db['Setting']['find']({'where':{'id':_0x455609[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x39cc5d,null))[_0xcd5e('0x1c')](saveUpdates(_0x455609[_0xcd5e('0x52')],null))['then'](respondWithResult(_0x39cc5d,null))['catch'](handleError(_0x39cc5d,null));};var utilLicense=require(_0xcd5e('0x18'));exports[_0xcd5e('0x5a')]=function(_0x30e56e,_0x42e97a,_0x4f9737){var _0x4afece='server/files/images/logos';var _0xa423b5={'custom':![]};return utilLicense[_0xcd5e('0x5b')]()['then'](function(_0x53fbd3){if(_0x53fbd3){_0xa423b5=_0x53fbd3;}return db[_0xcd5e('0x36')][_0xcd5e('0x50')]({'where':{'id':_0x30e56e[_0xcd5e('0x53')]['id']},'attributes':[_0xcd5e('0x57'),_0xcd5e('0x59'),'preferred',_0xcd5e('0x5c'),_0xcd5e('0x5d'),_0xcd5e('0x5e'),'defaultPreferred',_0xcd5e('0x5f')],'raw':!![]});})[_0xcd5e('0x1c')](handleEntityNotFound(_0x42e97a,null))[_0xcd5e('0x1c')](function(_0x34e01e){if(_0x34e01e){var _0x52d756=_0x34e01e[_0xcd5e('0x57')]&&fs['existsSync'](path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_[_0xcd5e('0x62')](_0x34e01e[_0xcd5e('0x57')])))?path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_['toLower'](_0x34e01e[_0xcd5e('0x57')])):path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_[_0xcd5e('0x62')](_0xcd5e('0x63')));var _0x523d38='default'+_[_0xcd5e('0x64')](_0xcd5e('0x57'));if(_0x34e01e[_0x523d38]||!_0xa423b5[_0xcd5e('0x65')]){_0x52d756=path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x4afece,_[_0xcd5e('0x62')]('default_logo.svg'));}if(!fs[_0xcd5e('0x66')](_0x52d756)){throw new db[(_0xcd5e('0x67'))][(_0xcd5e('0x68'))](_[_0xcd5e('0x64')]('logo')+_0xcd5e('0x69'));}return _0x42e97a[_0xcd5e('0x6a')](_0x52d756);}})[_0xcd5e('0x25')](handleError(_0x42e97a,null));};var utilLicense=require('../../config/license/util');exports[_0xcd5e('0x6b')]=function(_0x1396ba,_0x7695d0,_0x4d03f6){var _0x1fe9b3='server/files/images/logos';var _0x5e08ba={'custom':![]};return utilLicense[_0xcd5e('0x5b')]()[_0xcd5e('0x1c')](function(_0x32cbc3){if(_0x32cbc3){_0x5e08ba=_0x32cbc3;}return db[_0xcd5e('0x36')][_0xcd5e('0x50')]({'where':{'id':_0x1396ba[_0xcd5e('0x53')]['id']},'attributes':['logo',_0xcd5e('0x59'),'preferred',_0xcd5e('0x5c'),_0xcd5e('0x5d'),'defaultLoginLogo',_0xcd5e('0x6c'),_0xcd5e('0x5f')],'raw':!![]});})[_0xcd5e('0x1c')](handleEntityNotFound(_0x7695d0,null))[_0xcd5e('0x1c')](function(_0x50a1fb){if(_0x50a1fb){var _0x1eed62=_0x50a1fb[_0xcd5e('0x59')]&&fs[_0xcd5e('0x66')](path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_[_0xcd5e('0x62')](_0x50a1fb['loginLogo'])))?path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_[_0xcd5e('0x62')](_0x50a1fb[_0xcd5e('0x59')])):path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_[_0xcd5e('0x62')](_0xcd5e('0x6d')));var _0x9825aa=_0xcd5e('0x6e')+_[_0xcd5e('0x64')](_0xcd5e('0x59'));if(_0x50a1fb[_0x9825aa]||!_0x5e08ba['custom']){_0x1eed62=path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x1fe9b3,_['toLower'](_0xcd5e('0x6d')));}if(!fs[_0xcd5e('0x66')](_0x1eed62)){throw new db[(_0xcd5e('0x67'))]['ValidationError'](_[_0xcd5e('0x64')](_0xcd5e('0x59'))+_0xcd5e('0x69'));}return _0x7695d0[_0xcd5e('0x6a')](_0x1eed62);}})[_0xcd5e('0x25')](handleError(_0x7695d0,null));};exports['gdpr']=function(_0x477f07,_0x528e83){return db[_0xcd5e('0x36')]['find']({'where':{'id':_0x477f07[_0xcd5e('0x53')]['id']},'attributes':['securePassword']})[_0xcd5e('0x1c')](respondWithResult(_0x528e83,null))['catch'](handleError(_0x528e83,null));};exports['addPreferred']=function(_0x46a555,_0x5e5de5,_0x2d3b4d){if(_0x46a555[_0xcd5e('0x55')]&&_0x46a555[_0xcd5e('0x55')]['filename']){_0x46a555[_0xcd5e('0x52')][_0xcd5e('0x6f')]=_0x46a555['file'][_0xcd5e('0x56')];}return db['Setting'][_0xcd5e('0x50')]({'where':{'id':_0x46a555[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x5e5de5,null))[_0xcd5e('0x1c')](saveUpdates(_0x46a555[_0xcd5e('0x52')],null))[_0xcd5e('0x1c')](respondWithResult(_0x5e5de5,null))['catch'](handleError(_0x5e5de5,null));};var utilLicense=require('../../config/license/util');exports[_0xcd5e('0x70')]=function(_0x1c9f3e,_0x278865,_0x2e4c51){var _0x45177f='server/files/images/logos';var _0x1341c0={'custom':![]};return utilLicense[_0xcd5e('0x5b')]()[_0xcd5e('0x1c')](function(_0x2071e4){if(_0x2071e4){_0x1341c0=_0x2071e4;}return db['Setting']['find']({'where':{'id':_0x1c9f3e[_0xcd5e('0x53')]['id']},'attributes':[_0xcd5e('0x57'),'loginLogo','preferred',_0xcd5e('0x5c'),_0xcd5e('0x5d'),_0xcd5e('0x5e'),_0xcd5e('0x6c'),'defaultFavicon'],'raw':!![]});})[_0xcd5e('0x1c')](handleEntityNotFound(_0x278865,null))[_0xcd5e('0x1c')](function(_0x5bda13){if(_0x5bda13){var _0x47f2f2=_0x5bda13[_0xcd5e('0x6f')]&&fs['existsSync'](path[_0xcd5e('0x60')](config['root'],_0x45177f,_[_0xcd5e('0x62')](_0x5bda13['preferred'])))?path[_0xcd5e('0x60')](config['root'],_0x45177f,_[_0xcd5e('0x62')](_0x5bda13[_0xcd5e('0x6f')])):path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x45177f,_['toLower'](_0xcd5e('0x71')));var _0x1b4803=_0xcd5e('0x6e')+_['upperFirst'](_0xcd5e('0x6f'));if(_0x5bda13[_0x1b4803]||!_0x1341c0['custom']||!_0x1341c0[_0xcd5e('0x6f')]){_0x47f2f2=path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x45177f,_[_0xcd5e('0x62')]('default_preferred.png'));}if(!fs['existsSync'](_0x47f2f2)){throw new db[(_0xcd5e('0x67'))][(_0xcd5e('0x68'))](_['upperFirst'](_0xcd5e('0x6f'))+'\x20not\x20found');}return _0x278865[_0xcd5e('0x6a')](_0x47f2f2);}})[_0xcd5e('0x25')](handleError(_0x278865,null));};exports['addFavicon']=function(_0x32b171,_0x44ce88,_0x2b1ea9){if(_0x32b171[_0xcd5e('0x55')]&&_0x32b171[_0xcd5e('0x55')][_0xcd5e('0x56')]){_0x32b171[_0xcd5e('0x52')][_0xcd5e('0x5c')]=_0x32b171[_0xcd5e('0x55')]['filename'];}return db[_0xcd5e('0x36')]['find']({'where':{'id':_0x32b171[_0xcd5e('0x53')]['id']}})[_0xcd5e('0x1c')](handleEntityNotFound(_0x44ce88,null))[_0xcd5e('0x1c')](saveUpdates(_0x32b171['body'],null))[_0xcd5e('0x1c')](respondWithResult(_0x44ce88,null))[_0xcd5e('0x25')](handleError(_0x44ce88,null));};var utilLicense=require(_0xcd5e('0x18'));exports[_0xcd5e('0x72')]=function(_0x216d9e,_0xdef40d,_0x5aff0e){var _0x164b35='server/files/images/logos';var _0x5a8427={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xe1fbcd){if(_0xe1fbcd){_0x5a8427=_0xe1fbcd;}return db['Setting'][_0xcd5e('0x50')]({'where':{'id':_0x216d9e[_0xcd5e('0x53')]['id']},'attributes':[_0xcd5e('0x57'),_0xcd5e('0x59'),_0xcd5e('0x6f'),'favicon',_0xcd5e('0x5d'),_0xcd5e('0x5e'),_0xcd5e('0x6c'),_0xcd5e('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0xdef40d,null))['then'](function(_0x25e546){if(_0x25e546){var _0x5b6ef2=_0x25e546[_0xcd5e('0x5c')]&&fs['existsSync'](path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x164b35,_[_0xcd5e('0x62')](_0x25e546['favicon'])))?path[_0xcd5e('0x60')](config[_0xcd5e('0x61')],_0x164b35,_[_0xcd5e('0x62')](_0x25e546['favicon'])):path[_0xcd5e('0x60')](config['root'],_0x164b35,_[_0xcd5e('0x62')](_0xcd5e('0x73')));var _0x1cf08c='default'+_[_0xcd5e('0x64')](_0xcd5e('0x5c'));if(_0x25e546[_0x1cf08c]||!_0x5a8427[_0xcd5e('0x65')]){_0x5b6ef2=path[_0xcd5e('0x60')](config['root'],_0x164b35,_[_0xcd5e('0x62')](_0xcd5e('0x73')));}if(!fs[_0xcd5e('0x66')](_0x5b6ef2)){throw new db[(_0xcd5e('0x67'))][(_0xcd5e('0x68'))](_[_0xcd5e('0x64')](_0xcd5e('0x5c'))+_0xcd5e('0x69'));}return _0xdef40d['download'](_0x5b6ef2);}})[_0xcd5e('0x25')](handleError(_0xdef40d,null));};exports[_0xcd5e('0x74')]=function(_0x1b5073,_0x15b0b4){var _0x2bc18a={'offset':moment()[_0xcd5e('0x75')]()};_0x2bc18a[_0xcd5e('0x76')]=moment()[_0xcd5e('0x75')](_0x2bc18a[_0xcd5e('0x29')])[_0xcd5e('0x77')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x15b0b4[_0xcd5e('0x26')](0xc8)[_0xcd5e('0x33')](_0x2bc18a);};
\ No newline at end of file
+var _0x6aa0=['attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','body','params','file','filename','logo','find','addLogoLogin','loginLogo','../../config/license/util','getLogo','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','join','toLower','root','default','custom','default_logo.svg','\x20not\x20found','getLogoLogin','server/files/images/logos','getLicense','defaultPreferred','existsSync','upperFirst','default_loginLogo.svg','ValidationError','download','gdpr','securePassword','preferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','Sequelize','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','Setting','fieldName','type','key','query','keys','filters','intersection','model'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x6aa0,0xb8));var _0x06aa=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x6aa0[_0xef8146];return _0x5a6cb0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06aa('0x0'));var zipdir=require(_0x06aa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x06aa('0x2'));var moment=require('moment');var BPromise=require(_0x06aa('0x3'));var Mustache=require(_0x06aa('0x4'));var util=require(_0x06aa('0x5'));var path=require('path');var sox=require(_0x06aa('0x6'));var csv=require(_0x06aa('0x7'));var ejs=require(_0x06aa('0x8'));var fs=require('fs');var fs_extra=require(_0x06aa('0x9'));var _=require(_0x06aa('0xa'));var squel=require('squel');var crypto=require(_0x06aa('0xb'));var jsforce=require(_0x06aa('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x06aa('0x7'));var querystring=require(_0x06aa('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x06aa('0xe'));var qs=require(_0x06aa('0xf'));var as=require(_0x06aa('0x10'));var hardwareService=require(_0x06aa('0x11'));var logger=require(_0x06aa('0x12'))(_0x06aa('0x13'));var utils=require('../../config/utils');var config=require(_0x06aa('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x06aa('0x15'))['db'];var jayson=require(_0x06aa('0x16'));var client=jayson[_0x06aa('0x17')][_0x06aa('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x1f1a64,_0x42aa88,_0xb6a1ba,_0x5d8703){return new BPromise(function(_0xb97b6,_0xc5b667){var _0x771dd3=_0x5d8703||client;return _0x771dd3[_0x06aa('0x19')](_0x1f1a64,_0xb6a1ba)[_0x06aa('0x1a')](function(_0x2ab497){logger[_0x06aa('0x1b')](_0x06aa('0x1c'),_0x42aa88,_0x06aa('0x1d'));logger[_0x06aa('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x42aa88,_0x06aa('0x1d'),JSON['stringify'](_0x2ab497));if(_0x2ab497['error']){if(_0x2ab497[_0x06aa('0x1f')][_0x06aa('0x20')]===0x1f4){logger[_0x06aa('0x1f')](_0x06aa('0x1c'),_0x42aa88,_0x2ab497[_0x06aa('0x1f')]['message']);return _0xc5b667(_0x2ab497['error'][_0x06aa('0x21')]);}logger[_0x06aa('0x1f')](_0x06aa('0x1c'),_0x42aa88,_0x2ab497[_0x06aa('0x1f')]['message']);return _0xb97b6(_0x2ab497[_0x06aa('0x1f')]['message']);}else{logger[_0x06aa('0x1b')]('Setting,\x20%s,\x20%s',_0x42aa88,_0x06aa('0x1d'));_0xb97b6(_0x2ab497[_0x06aa('0x22')][_0x06aa('0x21')]);}})[_0x06aa('0x23')](function(_0x26f0b6){logger[_0x06aa('0x1f')]('Setting,\x20%s,\x20%s',_0x42aa88,_0x26f0b6);_0xc5b667(_0x26f0b6);});});}function respondWithStatusCode(_0x4ce369,_0x268b85){_0x268b85=_0x268b85||0xcc;return function(_0x325cfd){if(_0x325cfd){return _0x4ce369[_0x06aa('0x24')](_0x268b85);}return _0x4ce369['status'](_0x268b85)[_0x06aa('0x25')]();};}function respondWithResult(_0x42ce50,_0x2c16f5){_0x2c16f5=_0x2c16f5||0xc8;return function(_0x109cab){if(_0x109cab){return _0x42ce50[_0x06aa('0x26')](_0x2c16f5)['json'](_0x109cab);}};}function respondWithFilteredResult(_0x4dbdc3,_0x337fa4){return function(_0x3a65a0){if(_0x3a65a0){var _0x547c9d=typeof _0x337fa4[_0x06aa('0x27')]===_0x06aa('0x28')&&typeof _0x337fa4[_0x06aa('0x29')]===_0x06aa('0x28');var _0x52fd66=_0x3a65a0[_0x06aa('0x2a')];var _0x141d06=_0x547c9d?0x0:_0x337fa4[_0x06aa('0x27')];var _0x4b7312=_0x547c9d?_0x3a65a0[_0x06aa('0x2a')]:_0x337fa4[_0x06aa('0x27')]+_0x337fa4[_0x06aa('0x29')];var _0x4fead2;if(_0x4b7312>=_0x52fd66){_0x4b7312=_0x52fd66;_0x4fead2=0xc8;}else{_0x4fead2=0xce;}_0x4dbdc3['status'](_0x4fead2);return _0x4dbdc3[_0x06aa('0x2b')](_0x06aa('0x2c'),_0x141d06+'-'+_0x4b7312+'/'+_0x52fd66)[_0x06aa('0x2d')](_0x3a65a0);}return null;};}function patchUpdates(_0x1ee71d){return function(_0x31ceec){try{jsonpatch[_0x06aa('0x2e')](_0x31ceec,_0x1ee71d,!![]);}catch(_0x1aeb4f){return BPromise[_0x06aa('0x2f')](_0x1aeb4f);}return _0x31ceec[_0x06aa('0x30')]();};}function saveUpdates(_0x31faf7,_0x10ab4c){return function(_0x3486f2){if(_0x3486f2){return _0x3486f2[_0x06aa('0x31')](_0x31faf7)[_0x06aa('0x1a')](function(_0x365c41){return _0x365c41;});}return null;};}function removeEntity(_0x5791d0,_0x441450){return function(_0x58a1b4){if(_0x58a1b4){return _0x58a1b4[_0x06aa('0x32')]()[_0x06aa('0x1a')](function(){_0x5791d0[_0x06aa('0x26')](0xcc)[_0x06aa('0x25')]();});}};}function handleEntityNotFound(_0x4e4778,_0x2ca126){return function(_0x259b74){if(!_0x259b74){_0x4e4778[_0x06aa('0x24')](0x194);}return _0x259b74;};}function handleError(_0x471f49,_0xcba1fb){_0xcba1fb=_0xcba1fb||0x1f4;return function(_0x5d2266){logger[_0x06aa('0x1f')](_0x5d2266[_0x06aa('0x33')]);if(_0x5d2266[_0x06aa('0x34')]){delete _0x5d2266[_0x06aa('0x34')];}_0x471f49[_0x06aa('0x26')](_0xcba1fb)['send'](_0x5d2266);};}exports['index']=function(_0x3d4d5c,_0x15288a){var _0x19ac90={},_0x54c459={},_0xaf0433={'count':0x0,'rows':[]};var _0x3f284a=_['map'](db[_0x06aa('0x35')]['rawAttributes'],function(_0x56c5db){return{'name':_0x56c5db[_0x06aa('0x36')],'type':_0x56c5db[_0x06aa('0x37')][_0x06aa('0x38')]};});_0x54c459['model']=_['map'](_0x3f284a,'name');_0x54c459[_0x06aa('0x39')]=_[_0x06aa('0x3a')](_0x3d4d5c[_0x06aa('0x39')]);_0x54c459[_0x06aa('0x3b')]=_[_0x06aa('0x3c')](_0x54c459[_0x06aa('0x3d')],_0x54c459[_0x06aa('0x39')]);_0x19ac90[_0x06aa('0x3e')]=_[_0x06aa('0x3c')](_0x54c459[_0x06aa('0x3d')],qs[_0x06aa('0x3f')](_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x3f')]));_0x19ac90['attributes']=_0x19ac90[_0x06aa('0x3e')][_0x06aa('0x40')]?_0x19ac90[_0x06aa('0x3e')]:_0x54c459[_0x06aa('0x3d')];if(!_0x3d4d5c['query']['hasOwnProperty'](_0x06aa('0x41'))){_0x19ac90['limit']=qs[_0x06aa('0x29')](_0x3d4d5c[_0x06aa('0x39')]['limit']);_0x19ac90['offset']=qs[_0x06aa('0x27')](_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x27')]);}_0x19ac90[_0x06aa('0x42')]=qs[_0x06aa('0x43')](_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x43')]);_0x19ac90[_0x06aa('0x44')]=qs['filters'](_[_0x06aa('0x45')](_0x3d4d5c[_0x06aa('0x39')],_0x54c459['filters']),_0x3f284a);if(_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x46')]){_0x19ac90[_0x06aa('0x44')]=_[_0x06aa('0x47')](_0x19ac90[_0x06aa('0x44')],{'$or':_[_0x06aa('0x48')](_0x3f284a,function(_0x404776){if(_0x404776['type']!==_0x06aa('0x49')){var _0xb342fd={};_0xb342fd[_0x404776[_0x06aa('0x34')]]={'$like':'%'+_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x46')]+'%'};return _0xb342fd;}})});}_0x19ac90=_[_0x06aa('0x47')]({},_0x19ac90,_0x3d4d5c[_0x06aa('0x4a')]);var _0x20f87d={'where':_0x19ac90['where']};return db[_0x06aa('0x35')]['count'](_0x20f87d)[_0x06aa('0x1a')](function(_0x4b1178){_0xaf0433[_0x06aa('0x2a')]=_0x4b1178;if(_0x3d4d5c[_0x06aa('0x39')][_0x06aa('0x4b')]){_0x19ac90[_0x06aa('0x4c')]=[{'all':!![]}];}return db[_0x06aa('0x35')][_0x06aa('0x4d')](_0x19ac90);})[_0x06aa('0x1a')](function(_0x5a4b9a){_0xaf0433[_0x06aa('0x4e')]=_0x5a4b9a;return _0xaf0433;})[_0x06aa('0x1a')](respondWithFilteredResult(_0x15288a,_0x19ac90))[_0x06aa('0x23')](handleError(_0x15288a,null));};exports['show']=function(_0x4dedb3,_0x567e1b){var _0x586cc4={'raw':![],'where':{'id':_0x4dedb3['params']['id']}},_0x147931={};_0x147931[_0x06aa('0x3d')]=_['keys'](db[_0x06aa('0x35')][_0x06aa('0x4f')]);_0x147931['query']=_[_0x06aa('0x3a')](_0x4dedb3['query']);_0x147931[_0x06aa('0x3b')]=_['intersection'](_0x147931[_0x06aa('0x3d')],_0x147931[_0x06aa('0x39')]);_0x586cc4['attributes']=_[_0x06aa('0x3c')](_0x147931[_0x06aa('0x3d')],qs[_0x06aa('0x3f')](_0x4dedb3[_0x06aa('0x39')]['fields']));_0x586cc4[_0x06aa('0x3e')]=_0x586cc4[_0x06aa('0x3e')]['length']?_0x586cc4[_0x06aa('0x3e')]:_0x147931[_0x06aa('0x3d')];if(_0x4dedb3[_0x06aa('0x39')]['includeAll']){_0x586cc4['include']=[{'all':!![]}];}_0x586cc4=_[_0x06aa('0x47')]({},_0x586cc4,_0x4dedb3[_0x06aa('0x4a')]);return db[_0x06aa('0x35')]['find'](_0x586cc4)['then'](handleEntityNotFound(_0x567e1b,null))['then'](respondWithResult(_0x567e1b,null))[_0x06aa('0x23')](handleError(_0x567e1b,null));};exports[_0x06aa('0x31')]=function(_0x14f8e9,_0x191774){if(_0x14f8e9[_0x06aa('0x50')]['id']){delete _0x14f8e9['body']['id'];}return db['Setting']['find']({'where':{'id':_0x14f8e9[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0x191774,null))[_0x06aa('0x1a')](saveUpdates(_0x14f8e9[_0x06aa('0x50')],null))[_0x06aa('0x1a')](respondWithResult(_0x191774,null))[_0x06aa('0x23')](handleError(_0x191774,null));};exports['addLogo']=function(_0x46f7b2,_0x5d6a53,_0x44edda){if(_0x46f7b2['file']&&_0x46f7b2[_0x06aa('0x52')][_0x06aa('0x53')]){_0x46f7b2[_0x06aa('0x50')][_0x06aa('0x54')]=_0x46f7b2[_0x06aa('0x52')][_0x06aa('0x53')];}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x46f7b2[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0x5d6a53,null))[_0x06aa('0x1a')](saveUpdates(_0x46f7b2['body'],null))[_0x06aa('0x1a')](respondWithResult(_0x5d6a53,null))[_0x06aa('0x23')](handleError(_0x5d6a53,null));};exports[_0x06aa('0x56')]=function(_0x39dfc0,_0x36bc3f,_0x585fed){if(_0x39dfc0[_0x06aa('0x52')]&&_0x39dfc0[_0x06aa('0x52')][_0x06aa('0x53')]){_0x39dfc0[_0x06aa('0x50')][_0x06aa('0x57')]=_0x39dfc0[_0x06aa('0x52')]['filename'];}return db['Setting'][_0x06aa('0x55')]({'where':{'id':_0x39dfc0[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0x36bc3f,null))[_0x06aa('0x1a')](saveUpdates(_0x39dfc0['body'],null))[_0x06aa('0x1a')](respondWithResult(_0x36bc3f,null))['catch'](handleError(_0x36bc3f,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x59')]=function(_0x24077d,_0x5be514,_0x2bcf09){var _0x252468='server/files/images/logos';var _0x4c18c8={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1f050f){if(_0x1f050f){_0x4c18c8=_0x1f050f;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x24077d['params']['id']},'attributes':[_0x06aa('0x54'),_0x06aa('0x57'),'preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),_0x06aa('0x5c'),'defaultPreferred',_0x06aa('0x5d')],'raw':!![]});})[_0x06aa('0x1a')](handleEntityNotFound(_0x5be514,null))['then'](function(_0xe46b23){if(_0xe46b23){var _0x26b172=_0xe46b23[_0x06aa('0x54')]&&fs['existsSync'](path[_0x06aa('0x5e')](config['root'],_0x252468,_[_0x06aa('0x5f')](_0xe46b23[_0x06aa('0x54')])))?path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x252468,_[_0x06aa('0x5f')](_0xe46b23['logo'])):path[_0x06aa('0x5e')](config['root'],_0x252468,_[_0x06aa('0x5f')]('default_logo.svg'));var _0x388a03=_0x06aa('0x61')+_['upperFirst'](_0x06aa('0x54'));if(_0xe46b23[_0x388a03]||!_0x4c18c8[_0x06aa('0x62')]){_0x26b172=path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x252468,_[_0x06aa('0x5f')](_0x06aa('0x63')));}if(!fs['existsSync'](_0x26b172)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x06aa('0x54'))+_0x06aa('0x64'));}return _0x5be514['download'](_0x26b172);}})['catch'](handleError(_0x5be514,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x65')]=function(_0x3043e1,_0x1899de,_0x2f42b8){var _0x390f3f=_0x06aa('0x66');var _0x1d2b69={'custom':![]};return utilLicense[_0x06aa('0x67')]()['then'](function(_0x8bfee9){if(_0x8bfee9){_0x1d2b69=_0x8bfee9;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x3043e1['params']['id']},'attributes':[_0x06aa('0x54'),'loginLogo','preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),_0x06aa('0x5c'),_0x06aa('0x68'),_0x06aa('0x5d')],'raw':!![]});})[_0x06aa('0x1a')](handleEntityNotFound(_0x1899de,null))[_0x06aa('0x1a')](function(_0x3d61a1){if(_0x3d61a1){var _0x547ea3=_0x3d61a1['loginLogo']&&fs[_0x06aa('0x69')](path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x390f3f,_['toLower'](_0x3d61a1[_0x06aa('0x57')])))?path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x390f3f,_[_0x06aa('0x5f')](_0x3d61a1[_0x06aa('0x57')])):path['join'](config[_0x06aa('0x60')],_0x390f3f,_[_0x06aa('0x5f')]('default_loginLogo.svg'));var _0x547e25=_0x06aa('0x61')+_[_0x06aa('0x6a')](_0x06aa('0x57'));if(_0x3d61a1[_0x547e25]||!_0x1d2b69['custom']){_0x547ea3=path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x390f3f,_[_0x06aa('0x5f')](_0x06aa('0x6b')));}if(!fs[_0x06aa('0x69')](_0x547ea3)){throw new db['Sequelize'][(_0x06aa('0x6c'))](_[_0x06aa('0x6a')]('loginLogo')+_0x06aa('0x64'));}return _0x1899de[_0x06aa('0x6d')](_0x547ea3);}})[_0x06aa('0x23')](handleError(_0x1899de,null));};exports[_0x06aa('0x6e')]=function(_0x1c1da7,_0x58a053){return db[_0x06aa('0x35')]['find']({'where':{'id':_0x1c1da7[_0x06aa('0x51')]['id']},'attributes':[_0x06aa('0x6f')]})[_0x06aa('0x1a')](respondWithResult(_0x58a053,null))[_0x06aa('0x23')](handleError(_0x58a053,null));};exports['addPreferred']=function(_0x37c422,_0xa93acb,_0x3457b6){if(_0x37c422[_0x06aa('0x52')]&&_0x37c422[_0x06aa('0x52')][_0x06aa('0x53')]){_0x37c422[_0x06aa('0x50')][_0x06aa('0x70')]=_0x37c422[_0x06aa('0x52')][_0x06aa('0x53')];}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x37c422[_0x06aa('0x51')]['id']}})[_0x06aa('0x1a')](handleEntityNotFound(_0xa93acb,null))['then'](saveUpdates(_0x37c422[_0x06aa('0x50')],null))[_0x06aa('0x1a')](respondWithResult(_0xa93acb,null))[_0x06aa('0x23')](handleError(_0xa93acb,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x71')]=function(_0x118cb9,_0x3d884b,_0x1789c1){var _0x4fa1c2=_0x06aa('0x66');var _0x1d2edc={'custom':![]};return utilLicense[_0x06aa('0x67')]()[_0x06aa('0x1a')](function(_0x431142){if(_0x431142){_0x1d2edc=_0x431142;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x118cb9[_0x06aa('0x51')]['id']},'attributes':[_0x06aa('0x54'),_0x06aa('0x57'),'preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),'defaultLoginLogo',_0x06aa('0x68'),_0x06aa('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x3d884b,null))[_0x06aa('0x1a')](function(_0x258499){if(_0x258499){var _0xf30458=_0x258499[_0x06aa('0x70')]&&fs['existsSync'](path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x4fa1c2,_[_0x06aa('0x5f')](_0x258499[_0x06aa('0x70')])))?path[_0x06aa('0x5e')](config['root'],_0x4fa1c2,_['toLower'](_0x258499[_0x06aa('0x70')])):path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x4fa1c2,_[_0x06aa('0x5f')](_0x06aa('0x72')));var _0x4fa836=_0x06aa('0x61')+_[_0x06aa('0x6a')](_0x06aa('0x70'));if(_0x258499[_0x4fa836]||!_0x1d2edc[_0x06aa('0x62')]||!_0x1d2edc[_0x06aa('0x70')]){_0xf30458=path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x4fa1c2,_[_0x06aa('0x5f')](_0x06aa('0x72')));}if(!fs['existsSync'](_0xf30458)){throw new db['Sequelize'][(_0x06aa('0x6c'))](_['upperFirst'](_0x06aa('0x70'))+_0x06aa('0x64'));}return _0x3d884b[_0x06aa('0x6d')](_0xf30458);}})[_0x06aa('0x23')](handleError(_0x3d884b,null));};exports[_0x06aa('0x73')]=function(_0x5ae556,_0x101d73,_0x336065){if(_0x5ae556[_0x06aa('0x52')]&&_0x5ae556[_0x06aa('0x52')][_0x06aa('0x53')]){_0x5ae556[_0x06aa('0x50')][_0x06aa('0x5a')]=_0x5ae556[_0x06aa('0x52')]['filename'];}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x5ae556['params']['id']}})['then'](handleEntityNotFound(_0x101d73,null))[_0x06aa('0x1a')](saveUpdates(_0x5ae556[_0x06aa('0x50')],null))[_0x06aa('0x1a')](respondWithResult(_0x101d73,null))['catch'](handleError(_0x101d73,null));};var utilLicense=require(_0x06aa('0x58'));exports[_0x06aa('0x74')]=function(_0x2a7ee3,_0x2df46c,_0x4e5123){var _0x264da4='server/files/images/logos';var _0x2ca83a={'custom':![]};return utilLicense['getLicense']()[_0x06aa('0x1a')](function(_0x153d06){if(_0x153d06){_0x2ca83a=_0x153d06;}return db[_0x06aa('0x35')][_0x06aa('0x55')]({'where':{'id':_0x2a7ee3[_0x06aa('0x51')]['id']},'attributes':[_0x06aa('0x54'),_0x06aa('0x57'),'preferred',_0x06aa('0x5a'),_0x06aa('0x5b'),_0x06aa('0x5c'),'defaultPreferred',_0x06aa('0x5d')],'raw':!![]});})[_0x06aa('0x1a')](handleEntityNotFound(_0x2df46c,null))[_0x06aa('0x1a')](function(_0x1ebb51){if(_0x1ebb51){var _0x2045d2=_0x1ebb51[_0x06aa('0x5a')]&&fs[_0x06aa('0x69')](path[_0x06aa('0x5e')](config[_0x06aa('0x60')],_0x264da4,_['toLower'](_0x1ebb51[_0x06aa('0x5a')])))?path['join'](config[_0x06aa('0x60')],_0x264da4,_['toLower'](_0x1ebb51['favicon'])):path[_0x06aa('0x5e')](config['root'],_0x264da4,_[_0x06aa('0x5f')](_0x06aa('0x75')));var _0x1a3cd6=_0x06aa('0x61')+_[_0x06aa('0x6a')](_0x06aa('0x5a'));if(_0x1ebb51[_0x1a3cd6]||!_0x2ca83a[_0x06aa('0x62')]){_0x2045d2=path['join'](config[_0x06aa('0x60')],_0x264da4,_[_0x06aa('0x5f')]('default_favicon.ico'));}if(!fs[_0x06aa('0x69')](_0x2045d2)){throw new db[(_0x06aa('0x76'))]['ValidationError'](_[_0x06aa('0x6a')](_0x06aa('0x5a'))+'\x20not\x20found');}return _0x2df46c[_0x06aa('0x6d')](_0x2045d2);}})[_0x06aa('0x23')](handleError(_0x2df46c,null));};exports[_0x06aa('0x77')]=function(_0x594129,_0x54c604){var _0x105f0e={'offset':moment()[_0x06aa('0x78')]()};_0x105f0e['now']=moment()[_0x06aa('0x78')](_0x105f0e[_0x06aa('0x27')])[_0x06aa('0x79')](_0x06aa('0x7a'));return _0x54c604[_0x06aa('0x26')](0xc8)['send'](_0x105f0e);};
\ No newline at end of file
index d83c469..b5e0aee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x7217,0x19e));var _0x7721=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x7217[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6f59494..c3fce72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde31=['ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4d51f4,_0x3be8c1){var _0x7a3ad3=function(_0x3dffbd){while(--_0x3dffbd){_0x4d51f4['push'](_0x4d51f4['shift']());}};_0x7a3ad3(++_0x3be8c1);}(_0xde31,0x155));var _0x1de3=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xde31[_0x22b8a3];return _0x199a0c;};'use strict';var _=require(_0x1de3('0x0'));var util=require(_0x1de3('0x1'));var moment=require(_0x1de3('0x2'));var BPromise=require(_0x1de3('0x3'));var rs=require(_0x1de3('0x4'));var fs=require('fs');var Redis=require(_0x1de3('0x5'));var db=require(_0x1de3('0x6'))['db'];var utils=require(_0x1de3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1de3('0x8'));var jayson=require(_0x1de3('0x9'));var client=jayson[_0x1de3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cc51f,_0x5c876f,_0x2275d2){return new BPromise(function(_0xdabac5,_0x52d8a0){return client[_0x1de3('0xb')](_0x3cc51f,_0x2275d2)[_0x1de3('0xc')](function(_0x2dce76){logger[_0x1de3('0xd')](_0x1de3('0xe'),_0x5c876f,_0x1de3('0xf'));logger['debug'](_0x1de3('0x10'),_0x5c876f,_0x1de3('0xf'),JSON['stringify'](_0x2dce76));if(_0x2dce76[_0x1de3('0x11')]){if(_0x2dce76[_0x1de3('0x11')][_0x1de3('0x12')]===0x1f4){logger[_0x1de3('0x11')](_0x1de3('0xe'),_0x5c876f,_0x2dce76[_0x1de3('0x11')][_0x1de3('0x13')]);return _0x52d8a0(_0x2dce76[_0x1de3('0x11')]['message']);}logger[_0x1de3('0x11')](_0x1de3('0xe'),_0x5c876f,_0x2dce76[_0x1de3('0x11')]['message']);return _0xdabac5(_0x2dce76[_0x1de3('0x11')][_0x1de3('0x13')]);}else{logger[_0x1de3('0xd')](_0x1de3('0xe'),_0x5c876f,_0x1de3('0xf'));_0xdabac5(_0x2dce76[_0x1de3('0x14')][_0x1de3('0x13')]);}})[_0x1de3('0x15')](function(_0xe499ae){logger[_0x1de3('0x11')](_0x1de3('0xe'),_0x5c876f,_0xe499ae);_0x52d8a0(_0xe499ae);});});}exports[_0x1de3('0x16')]=function(_0x21def9){var _0xd8b73f=this;return new Promise(function(_0x8e1340,_0x41f532){return db[_0x1de3('0x17')][_0x1de3('0x18')]({'raw':_0x21def9['options']?_0x21def9[_0x1de3('0x19')][_0x1de3('0x1a')]===undefined?!![]:![]:!![],'where':_0x21def9['options']?_0x21def9[_0x1de3('0x19')][_0x1de3('0x1b')]||null:null,'attributes':_0x21def9[_0x1de3('0x19')]?_0x21def9['options'][_0x1de3('0x1c')]||null:null,'include':_0x21def9['options']?_0x21def9[_0x1de3('0x19')][_0x1de3('0x1d')]?_[_0x1de3('0x1e')](_0x21def9[_0x1de3('0x19')][_0x1de3('0x1d')],function(_0x26289f){return{'model':db[_0x26289f['model']],'as':_0x26289f['as'],'attributes':_0x26289f[_0x1de3('0x1c')],'include':_0x26289f[_0x1de3('0x1d')]?_[_0x1de3('0x1e')](_0x26289f[_0x1de3('0x1d')],function(_0x39f25d){return{'model':db[_0x39f25d['model']],'as':_0x39f25d['as'],'attributes':_0x39f25d[_0x1de3('0x1c')],'include':_0x39f25d[_0x1de3('0x1d')]?_[_0x1de3('0x1e')](_0x39f25d[_0x1de3('0x1d')],function(_0x548db1){return{'model':db[_0x548db1[_0x1de3('0x1f')]],'as':_0x548db1['as'],'attributes':_0x548db1[_0x1de3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1de3('0xc')](function(_0x52e132){logger[_0x1de3('0xd')]('ShowSetting',_0x21def9);logger['debug']('ShowSetting',_0x21def9,JSON[_0x1de3('0x20')](_0x52e132));_0x8e1340(_0x52e132);})[_0x1de3('0x15')](function(_0x3797f6){logger[_0x1de3('0x11')](_0x1de3('0x16'),_0x3797f6['message'],_0x21def9);_0x41f532(_0xd8b73f[_0x1de3('0x11')](0x1f4,_0x3797f6[_0x1de3('0x13')]));});});};
\ No newline at end of file
+var _0x68a1=['jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x56d697,_0x5cd98a){var _0x1dc372=function(_0xf90757){while(--_0xf90757){_0x56d697['push'](_0x56d697['shift']());}};_0x1dc372(++_0x5cd98a);}(_0x68a1,0x162));var _0x168a=function(_0x25f22d,_0x259c8d){_0x25f22d=_0x25f22d-0x0;var _0x7bf160=_0x68a1[_0x25f22d];return _0x7bf160;};'use strict';var _=require(_0x168a('0x0'));var util=require(_0x168a('0x1'));var moment=require(_0x168a('0x2'));var BPromise=require(_0x168a('0x3'));var rs=require(_0x168a('0x4'));var fs=require('fs');var Redis=require(_0x168a('0x5'));var db=require(_0x168a('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x168a('0x7'));var config=require(_0x168a('0x8'));var jayson=require(_0x168a('0x9'));var client=jayson[_0x168a('0xa')][_0x168a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x187d8c,_0x5b5dc4,_0x5223bc){return new BPromise(function(_0x1b7415,_0x5b5471){return client['request'](_0x187d8c,_0x5223bc)[_0x168a('0xc')](function(_0x4e37ff){logger[_0x168a('0xd')](_0x168a('0xe'),_0x5b5dc4,'request\x20sent');logger[_0x168a('0xf')](_0x168a('0x10'),_0x5b5dc4,_0x168a('0x11'),JSON[_0x168a('0x12')](_0x4e37ff));if(_0x4e37ff[_0x168a('0x13')]){if(_0x4e37ff[_0x168a('0x13')][_0x168a('0x14')]===0x1f4){logger['error'](_0x168a('0xe'),_0x5b5dc4,_0x4e37ff[_0x168a('0x13')][_0x168a('0x15')]);return _0x5b5471(_0x4e37ff[_0x168a('0x13')][_0x168a('0x15')]);}logger[_0x168a('0x13')](_0x168a('0xe'),_0x5b5dc4,_0x4e37ff['error'][_0x168a('0x15')]);return _0x1b7415(_0x4e37ff[_0x168a('0x13')][_0x168a('0x15')]);}else{logger[_0x168a('0xd')](_0x168a('0xe'),_0x5b5dc4,_0x168a('0x11'));_0x1b7415(_0x4e37ff[_0x168a('0x16')][_0x168a('0x15')]);}})[_0x168a('0x17')](function(_0x695582){logger[_0x168a('0x13')](_0x168a('0xe'),_0x5b5dc4,_0x695582);_0x5b5471(_0x695582);});});}exports[_0x168a('0x18')]=function(_0x5400a1){var _0x269810=this;return new Promise(function(_0x1de3d6,_0x5e4723){return db[_0x168a('0x19')][_0x168a('0x1a')]({'raw':_0x5400a1[_0x168a('0x1b')]?_0x5400a1[_0x168a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5400a1[_0x168a('0x1b')]?_0x5400a1[_0x168a('0x1b')][_0x168a('0x1c')]||null:null,'attributes':_0x5400a1['options']?_0x5400a1[_0x168a('0x1b')][_0x168a('0x1d')]||null:null,'include':_0x5400a1[_0x168a('0x1b')]?_0x5400a1[_0x168a('0x1b')][_0x168a('0x1e')]?_[_0x168a('0x1f')](_0x5400a1[_0x168a('0x1b')]['include'],function(_0x1ebd38){return{'model':db[_0x1ebd38[_0x168a('0x20')]],'as':_0x1ebd38['as'],'attributes':_0x1ebd38['attributes'],'include':_0x1ebd38[_0x168a('0x1e')]?_[_0x168a('0x1f')](_0x1ebd38[_0x168a('0x1e')],function(_0x4b8130){return{'model':db[_0x4b8130[_0x168a('0x20')]],'as':_0x4b8130['as'],'attributes':_0x4b8130[_0x168a('0x1d')],'include':_0x4b8130[_0x168a('0x1e')]?_[_0x168a('0x1f')](_0x4b8130[_0x168a('0x1e')],function(_0x108146){return{'model':db[_0x108146['model']],'as':_0x108146['as'],'attributes':_0x108146['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x30e0b7){logger[_0x168a('0xd')]('ShowSetting',_0x5400a1);logger[_0x168a('0xf')](_0x168a('0x18'),_0x5400a1,JSON[_0x168a('0x12')](_0x30e0b7));_0x1de3d6(_0x30e0b7);})[_0x168a('0x17')](function(_0x3f32c4){logger[_0x168a('0x13')](_0x168a('0x18'),_0x3f32c4['message'],_0x5400a1);_0x5e4723(_0x269810[_0x168a('0x13')](0x1f4,_0x3f32c4[_0x168a('0x15')]));});});};
\ No newline at end of file
index c6e0ca3..7261a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x470e3f,_0x3b513d){_0x470e3f=_0x470e3f-0x0;var _0x4fd22b=_0xf494[_0x470e3f];return _0x4fd22b;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router;
\ No newline at end of file
+var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x37c7ad,_0x45ada7){var _0xa2d781=function(_0x3f5617){while(--_0x3f5617){_0x37c7ad['push'](_0x37c7ad['shift']());}};_0xa2d781(++_0x45ada7);}(_0x53ec,0x192));var _0xc53e=function(_0x96a05,_0x1f4b8c){_0x96a05=_0x96a05-0x0;var _0x253e31=_0x53ec[_0x96a05];return _0x253e31;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router;
\ No newline at end of file
index 2dfc00f..5ea6da3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6023=['name','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','bandwidth','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6023,0x105));var _0x3602=function(_0x2e2b43,_0x55bd4c){_0x2e2b43=_0x2e2b43-0x0;var _0x56e57e=_0x6023[_0x2e2b43];return _0x56e57e;};'use strict';var Sequelize=require(_0x3602('0x0'));var rs=require(_0x3602('0x1'));module[_0x3602('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x3602('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3602('0x4')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x3602('0x4')],'defaultValue':function(){return rs[_0x3602('0x5')]();}},'phone':{'type':Sequelize[_0x3602('0x4')]},'type':{'type':Sequelize[_0x3602('0x6')](_0x3602('0x7'),'skebby',_0x3602('0x8'),_0x3602('0x9'),_0x3602('0xa'),'clickatell',_0x3602('0xb'),_0x3602('0xc'),_0x3602('0xd'),_0x3602('0xe'))},'accountSid':{'type':Sequelize[_0x3602('0x4')]},'authId':{'type':Sequelize[_0x3602('0x4')]},'authToken':{'type':Sequelize[_0x3602('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x3602('0x4')]},'password':{'type':Sequelize[_0x3602('0x4')]},'apiKey':{'type':Sequelize[_0x3602('0x4')]},'applicationId':{'type':Sequelize[_0x3602('0x4')]},'accountId':{'type':Sequelize[_0x3602('0x4')]},'senderString':{'type':Sequelize[_0x3602('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x3602('0xf')],'defaultValue':function(){return _0x3602('0x10');}},'notificationSound':{'type':Sequelize[_0x3602('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3602('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3602('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3602('0x12')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3602('0x11')],'defaultValue':![],'comment':_0x3602('0x13'),'set':function(_0x1cd7b7){if(!_0x1cd7b7)this[_0x3602('0x14')]('mandatoryDispositionPauseId',null);this[_0x3602('0x14')](_0x3602('0x15'),_0x1cd7b7);}}};
\ No newline at end of file
+var _0x818c=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x27766b,_0x155221){var _0x3de10e=function(_0xebc741){while(--_0xebc741){_0x27766b['push'](_0x27766b['shift']());}};_0x3de10e(++_0x155221);}(_0x818c,0x121));var _0xc818=function(_0x21ce3a,_0x2e5ffa){_0x21ce3a=_0x21ce3a-0x0;var _0x5221e0=_0x818c[_0x21ce3a];return _0x5221e0;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc818('0x0'));module[_0xc818('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc818('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc818('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc818('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc818('0x5')](_0xc818('0x6'),_0xc818('0x7'),_0xc818('0x8'),_0xc818('0x9'),'plivo',_0xc818('0xa'),_0xc818('0xb'),_0xc818('0xc'),_0xc818('0xd'),_0xc818('0xe'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xc818('0x3')]},'smsMethod':{'type':Sequelize[_0xc818('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc818('0x3')]},'password':{'type':Sequelize[_0xc818('0x3')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xc818('0x3')]},'senderString':{'type':Sequelize[_0xc818('0x3')]},'deliveryReport':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xc818('0x3')]},'notificationTemplate':{'type':Sequelize[_0xc818('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc818('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc818('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc818('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc818('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc818('0x12')},'mandatoryDisposition':{'type':Sequelize[_0xc818('0xf')],'defaultValue':![],'comment':_0xc818('0x13'),'set':function(_0x182d5c){if(!_0x182d5c)this['setDataValue'](_0xc818('0x14'),null);this['setDataValue'](_0xc818('0x15'),_0x182d5c);}}};
\ No newline at end of file
index 6e7f15b..ee21698 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb33=['destroy','SmsAccounts','UserProfileResource','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','options','includeAll','include','findAll','params','mandatoryDispositionPause','keys','fields','find','create','body','user','get','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','getDispositions','Disposition','rows','removeDispositions','ids','addAnswer','findOne','CannedAnswer','removeAnswers','sms','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','twilio','From','Body','MessageSid','skebby','from','sender','text','connectel','clicksend','plivo','MessageUUID','infobip','results','messageId','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','contact','SmsInteraction','spread','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','SmsApplication','bulkCreate','findAndCountAll','stack','finally','getApplications','pick','Contact','User','Owner','fullname','internal','Tag','Tags','tag','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','clickatell','redif','error_code','DELIVERED','DELIVERED_TO_GATEWAY','message-delivered','ACCEPTD','statusGet','state','csc','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','json','limit','count','status','set','Content-Range','apply','reject','save','update','then'];(function(_0x2986d9,_0x542e58){var _0x2fbd2c=function(_0x988538){while(--_0x988538){_0x2986d9['push'](_0x2986d9['shift']());}};_0x2fbd2c(++_0x542e58);}(_0xcb33,0xae));var _0x3cb3=function(_0x1f860e,_0x19efa5){_0x1f860e=_0x1f860e-0x0;var _0x1d16d6=_0xcb33[_0x1f860e];return _0x1d16d6;};'use strict';var emlformat=require(_0x3cb3('0x0'));var rimraf=require(_0x3cb3('0x1'));var zipdir=require(_0x3cb3('0x2'));var jsonpatch=require(_0x3cb3('0x3'));var rp=require('request-promise');var moment=require(_0x3cb3('0x4'));var BPromise=require(_0x3cb3('0x5'));var Mustache=require('mustache');var util=require(_0x3cb3('0x6'));var path=require(_0x3cb3('0x7'));var sox=require(_0x3cb3('0x8'));var csv=require(_0x3cb3('0x9'));var ejs=require(_0x3cb3('0xa'));var fs=require('fs');var fs_extra=require(_0x3cb3('0xb'));var _=require(_0x3cb3('0xc'));var squel=require('squel');var crypto=require(_0x3cb3('0xd'));var jsforce=require(_0x3cb3('0xe'));var deskjs=require(_0x3cb3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3cb3('0x10'));var Papa=require(_0x3cb3('0x11'));var Redis=require(_0x3cb3('0x12'));var authService=require(_0x3cb3('0x13'));var qs=require(_0x3cb3('0x14'));var as=require(_0x3cb3('0x15'));var hardwareService=require(_0x3cb3('0x16'));var logger=require(_0x3cb3('0x17'))('api');var utils=require(_0x3cb3('0x18'));var config=require(_0x3cb3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3cb3('0x1a'))['db'];config['redis']=_[_0x3cb3('0x1b')](config[_0x3cb3('0x1c')],{'host':_0x3cb3('0x1d'),'port':0x18eb});var socket=require(_0x3cb3('0x1e'))(new Redis(config[_0x3cb3('0x1c')]));require(_0x3cb3('0x1f'))[_0x3cb3('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3cb3('0x21')][_0x3cb3('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x34739d,_0x4a340c,_0x251049,_0xf83850){return new BPromise(function(_0x272f01,_0x12f52f){var _0xfa8bf7=_0xf83850||client;return _0xfa8bf7[_0x3cb3('0x23')](_0x34739d,_0x251049)['then'](function(_0x3e714d){logger[_0x3cb3('0x24')](_0x3cb3('0x25'),_0x4a340c,_0x3cb3('0x26'));logger[_0x3cb3('0x27')](_0x3cb3('0x28'),_0x4a340c,'request\x20sent',JSON['stringify'](_0x3e714d));if(_0x3e714d[_0x3cb3('0x29')]){if(_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2a')]===0x1f4){logger[_0x3cb3('0x29')]('SmsAccount,\x20%s,\x20%s',_0x4a340c,_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2b')]);return _0x12f52f(_0x3e714d[_0x3cb3('0x29')]['message']);}logger[_0x3cb3('0x29')](_0x3cb3('0x25'),_0x4a340c,_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2b')]);return _0x272f01(_0x3e714d[_0x3cb3('0x29')][_0x3cb3('0x2b')]);}else{logger[_0x3cb3('0x24')](_0x3cb3('0x25'),_0x4a340c,_0x3cb3('0x26'));_0x272f01(_0x3e714d[_0x3cb3('0x2c')][_0x3cb3('0x2b')]);}})[_0x3cb3('0x2d')](function(_0x173325){logger['error']('SmsAccount,\x20%s,\x20%s',_0x4a340c,_0x173325);_0x12f52f(_0x173325);});});}function respondWithStatusCode(_0x36c188,_0x96279d){_0x96279d=_0x96279d||0xcc;return function(_0x336c6d){if(_0x336c6d){return _0x36c188[_0x3cb3('0x2e')](_0x96279d);}return _0x36c188['status'](_0x96279d)[_0x3cb3('0x2f')]();};}function respondWithResult(_0x543ae8,_0x3f67e4){_0x3f67e4=_0x3f67e4||0xc8;return function(_0x4c480a){if(_0x4c480a){return _0x543ae8['status'](_0x3f67e4)[_0x3cb3('0x30')](_0x4c480a);}};}function respondWithFilteredResult(_0x19004a,_0x339a65){return function(_0x31a01d){if(_0x31a01d){var _0x58e33f=typeof _0x339a65['offset']==='undefined'&&typeof _0x339a65[_0x3cb3('0x31')]==='undefined';var _0x9639e6=_0x31a01d[_0x3cb3('0x32')];var _0x43963c=_0x58e33f?0x0:_0x339a65['offset'];var _0x3a2b99=_0x58e33f?_0x31a01d[_0x3cb3('0x32')]:_0x339a65['offset']+_0x339a65['limit'];var _0x4a6ad4;if(_0x3a2b99>=_0x9639e6){_0x3a2b99=_0x9639e6;_0x4a6ad4=0xc8;}else{_0x4a6ad4=0xce;}_0x19004a[_0x3cb3('0x33')](_0x4a6ad4);return _0x19004a[_0x3cb3('0x34')](_0x3cb3('0x35'),_0x43963c+'-'+_0x3a2b99+'/'+_0x9639e6)[_0x3cb3('0x30')](_0x31a01d);}return null;};}function patchUpdates(_0x594219){return function(_0x25e586){try{jsonpatch[_0x3cb3('0x36')](_0x25e586,_0x594219,!![]);}catch(_0x59692c){return BPromise[_0x3cb3('0x37')](_0x59692c);}return _0x25e586[_0x3cb3('0x38')]();};}function saveUpdates(_0xb5430,_0x1f987c){return function(_0x5a383a){if(_0x5a383a){return _0x5a383a[_0x3cb3('0x39')](_0xb5430)[_0x3cb3('0x3a')](function(_0x71cf8c){return _0x71cf8c;});}return null;};}function removeEntity(_0x358b5b,_0x429441){return function(_0x5d41c0){if(_0x5d41c0){return _0x5d41c0[_0x3cb3('0x3b')]()[_0x3cb3('0x3a')](function(){var _0x229433=_0x5d41c0['get']({'plain':!![]});var _0x4ad27a=_0x3cb3('0x3c');return db[_0x3cb3('0x3d')][_0x3cb3('0x3b')]({'where':{'type':_0x4ad27a,'resourceId':_0x229433['id']}})[_0x3cb3('0x3a')](function(){return _0x5d41c0;});})[_0x3cb3('0x3a')](function(){_0x358b5b[_0x3cb3('0x33')](0xcc)[_0x3cb3('0x2f')]();});}};}function handleEntityNotFound(_0x4b2a98,_0x2edb66){return function(_0x494e9c){if(!_0x494e9c){_0x4b2a98[_0x3cb3('0x2e')](0x194);}return _0x494e9c;};}function handleError(_0x3ed687,_0x2c0b14){_0x2c0b14=_0x2c0b14||0x1f4;return function(_0x55c2d9){logger['error'](_0x55c2d9['stack']);if(_0x55c2d9[_0x3cb3('0x3e')]){delete _0x55c2d9[_0x3cb3('0x3e')];}_0x3ed687[_0x3cb3('0x33')](_0x2c0b14)[_0x3cb3('0x3f')](_0x55c2d9);};}exports[_0x3cb3('0x40')]=function(_0x2f026c,_0x32f914){var _0x50fa2c={'include':[{'model':db[_0x3cb3('0x41')],'as':'mandatoryDispositionPause'}]},_0x309e45={},_0x123821={'count':0x0,'rows':[]};var _0x50bd6e=_[_0x3cb3('0x42')](db[_0x3cb3('0x43')][_0x3cb3('0x44')],function(_0x579fe1){return{'name':_0x579fe1[_0x3cb3('0x45')],'type':_0x579fe1[_0x3cb3('0x46')][_0x3cb3('0x47')]};});_0x309e45[_0x3cb3('0x48')]=_[_0x3cb3('0x42')](_0x50bd6e,_0x3cb3('0x3e'));_0x309e45[_0x3cb3('0x49')]=_['keys'](_0x2f026c[_0x3cb3('0x49')]);_0x309e45[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x309e45['model'],_0x309e45['query']);_0x50fa2c[_0x3cb3('0x4c')]=_[_0x3cb3('0x4b')](_0x309e45['model'],qs['fields'](_0x2f026c['query']['fields']));_0x50fa2c[_0x3cb3('0x4c')]=_0x50fa2c[_0x3cb3('0x4c')][_0x3cb3('0x4d')]?_0x50fa2c[_0x3cb3('0x4c')]:_0x309e45['model'];if(!_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x4e')](_0x3cb3('0x4f'))){_0x50fa2c[_0x3cb3('0x31')]=qs[_0x3cb3('0x31')](_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0x50fa2c[_0x3cb3('0x50')]=qs['offset'](_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x50')]);}_0x50fa2c[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x52')]);_0x50fa2c[_0x3cb3('0x53')]=qs[_0x3cb3('0x4a')](_['pick'](_0x2f026c[_0x3cb3('0x49')],_0x309e45[_0x3cb3('0x4a')]),_0x50bd6e);if(_0x2f026c['query'][_0x3cb3('0x54')]){_0x50fa2c[_0x3cb3('0x53')]=_['merge'](_0x50fa2c[_0x3cb3('0x53')],{'$or':_['map'](_0x50bd6e,function(_0x1545fd){if(_0x1545fd[_0x3cb3('0x46')]!=='VIRTUAL'){var _0x2e4598={};_0x2e4598[_0x1545fd[_0x3cb3('0x3e')]]={'$like':'%'+_0x2f026c[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x2e4598;}})});}_0x50fa2c=_[_0x3cb3('0x55')]({},_0x50fa2c,_0x2f026c[_0x3cb3('0x56')]);var _0xf0fc8={'where':_0x50fa2c[_0x3cb3('0x53')]};return db[_0x3cb3('0x43')][_0x3cb3('0x32')](_0xf0fc8)[_0x3cb3('0x3a')](function(_0x3e7913){_0x123821['count']=_0x3e7913;if(_0x2f026c['query'][_0x3cb3('0x57')]){_0x50fa2c[_0x3cb3('0x58')]=[{'all':!![]}];}return db[_0x3cb3('0x43')][_0x3cb3('0x59')](_0x50fa2c);})[_0x3cb3('0x3a')](function(_0x589210){_0x123821['rows']=_0x589210;return _0x123821;})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x32f914,_0x50fa2c))[_0x3cb3('0x2d')](handleError(_0x32f914,null));};exports['show']=function(_0x1575b2,_0x2daaa1){var _0x4c2d8a={'raw':![],'where':{'id':_0x1575b2[_0x3cb3('0x5a')]['id']},'include':[{'model':db[_0x3cb3('0x41')],'as':_0x3cb3('0x5b')}]},_0x5af24a={};_0x5af24a['model']=_[_0x3cb3('0x5c')](db[_0x3cb3('0x43')][_0x3cb3('0x44')]);_0x5af24a[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x1575b2[_0x3cb3('0x49')]);_0x5af24a['filters']=_['intersection'](_0x5af24a[_0x3cb3('0x48')],_0x5af24a[_0x3cb3('0x49')]);_0x4c2d8a[_0x3cb3('0x4c')]=_['intersection'](_0x5af24a[_0x3cb3('0x48')],qs[_0x3cb3('0x5d')](_0x1575b2['query']['fields']));_0x4c2d8a[_0x3cb3('0x4c')]=_0x4c2d8a['attributes']['length']?_0x4c2d8a[_0x3cb3('0x4c')]:_0x5af24a[_0x3cb3('0x48')];if(_0x1575b2['query'][_0x3cb3('0x57')]){_0x4c2d8a['include']=[{'all':!![]}];}_0x4c2d8a=_[_0x3cb3('0x55')]({},_0x4c2d8a,_0x1575b2[_0x3cb3('0x56')]);return db[_0x3cb3('0x43')][_0x3cb3('0x5e')](_0x4c2d8a)[_0x3cb3('0x3a')](handleEntityNotFound(_0x2daaa1,null))[_0x3cb3('0x3a')](respondWithResult(_0x2daaa1,null))['catch'](handleError(_0x2daaa1,null));};exports[_0x3cb3('0x5f')]=function(_0x15aa08,_0x1f4c00){return db[_0x3cb3('0x43')]['create'](_0x15aa08[_0x3cb3('0x60')],{})['then'](function(_0x150525){var _0x38623c=_0x15aa08[_0x3cb3('0x61')][_0x3cb3('0x62')]({'plain':!![]});if(!_0x38623c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38623c[_0x3cb3('0x63')]==='user'){var _0x59949e=_0x150525[_0x3cb3('0x62')]({'plain':!![]});var _0x3d6736=_0x3cb3('0x3c');return db['UserProfileSection'][_0x3cb3('0x5e')]({'where':{'name':_0x3d6736,'userProfileId':_0x38623c[_0x3cb3('0x64')]},'raw':!![]})[_0x3cb3('0x3a')](function(_0x4f12f6){if(_0x4f12f6&&_0x4f12f6['autoAssociation']===0x0){return db[_0x3cb3('0x3d')][_0x3cb3('0x5f')]({'name':_0x59949e[_0x3cb3('0x3e')],'resourceId':_0x59949e['id'],'type':_0x4f12f6[_0x3cb3('0x3e')],'sectionId':_0x4f12f6['id']},{})['then'](function(){return _0x150525;});}else{return _0x150525;}})['catch'](function(_0x33077a){logger['error'](_0x3cb3('0x65'),_0x33077a);throw _0x33077a;});}return _0x150525;})[_0x3cb3('0x3a')](respondWithResult(_0x1f4c00,0xc9))[_0x3cb3('0x2d')](handleError(_0x1f4c00,null));};exports[_0x3cb3('0x39')]=function(_0x4c4a9c,_0x3c25c9){if(_0x4c4a9c[_0x3cb3('0x60')]['id']){delete _0x4c4a9c[_0x3cb3('0x60')]['id'];}return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x4c4a9c[_0x3cb3('0x5a')]['id']},'include':[{'model':db[_0x3cb3('0x41')],'as':_0x3cb3('0x5b')}]})[_0x3cb3('0x3a')](handleEntityNotFound(_0x3c25c9,null))['then'](saveUpdates(_0x4c4a9c[_0x3cb3('0x60')],null))[_0x3cb3('0x3a')](respondWithResult(_0x3c25c9,null))['catch'](handleError(_0x3c25c9,null));};exports[_0x3cb3('0x3b')]=function(_0x1d8efc,_0xa3c660){return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x1d8efc['params']['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0xa3c660,null))['then'](removeEntity(_0xa3c660,null))[_0x3cb3('0x2d')](handleError(_0xa3c660,null));};exports[_0x3cb3('0x66')]=function(_0x320615,_0x112ccf){return db[_0x3cb3('0x43')]['describe']()[_0x3cb3('0x3a')](respondWithResult(_0x112ccf,null))[_0x3cb3('0x2d')](handleError(_0x112ccf,null));};exports[_0x3cb3('0x67')]=function(_0x5d1f20,_0x24ad31,_0x56eaa6){if(_0x5d1f20['body']['id']){delete _0x5d1f20['body']['id'];}return db[_0x3cb3('0x43')]['find']({'where':{'id':_0x5d1f20[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x24ad31,null))[_0x3cb3('0x3a')](function(_0x42ca0d){if(_0x42ca0d){_0x5d1f20[_0x3cb3('0x60')][_0x3cb3('0x68')]=_0x42ca0d['id'];return db['Disposition'][_0x3cb3('0x5f')](_0x5d1f20[_0x3cb3('0x60')]);}})[_0x3cb3('0x3a')](respondWithResult(_0x24ad31,null))[_0x3cb3('0x2d')](handleError(_0x24ad31,null));};exports[_0x3cb3('0x69')]=function(_0x4737eb,_0x4d6461,_0x12933e){var _0x4d5819={'raw':![],'where':{}};var _0x2827d9={};var _0x1774ee={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4737eb[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x4d6461,null))[_0x3cb3('0x3a')](function(_0x164596){if(_0x164596){_0x2827d9[_0x3cb3('0x48')]=_[_0x3cb3('0x5c')](db[_0x3cb3('0x6a')][_0x3cb3('0x44')]);_0x2827d9[_0x3cb3('0x49')]=_['keys'](_0x4737eb['query']);_0x2827d9[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x2827d9[_0x3cb3('0x48')],_0x2827d9[_0x3cb3('0x49')]);_0x4d5819[_0x3cb3('0x4c')]=_[_0x3cb3('0x4b')](_0x2827d9[_0x3cb3('0x48')],qs['fields'](_0x4737eb[_0x3cb3('0x49')]['fields']));_0x4d5819[_0x3cb3('0x4c')]=_0x4d5819[_0x3cb3('0x4c')]['length']?_0x4d5819[_0x3cb3('0x4c')]:_0x2827d9[_0x3cb3('0x48')];if(!_0x4737eb[_0x3cb3('0x49')]['hasOwnProperty']('nolimit')){_0x4d5819['limit']=qs[_0x3cb3('0x31')](_0x4737eb[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0x4d5819[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x4737eb[_0x3cb3('0x49')]['offset']);}_0x4d5819['order']=qs['sort'](_0x4737eb[_0x3cb3('0x49')]['sort']);_0x4d5819[_0x3cb3('0x53')]=qs['filters'](_['pick'](_0x4737eb[_0x3cb3('0x49')],_0x2827d9[_0x3cb3('0x4a')]));_0x4d5819['where'][_0x3cb3('0x68')]=_0x164596['id'];if(_0x4737eb[_0x3cb3('0x49')]['filter']){_0x4d5819[_0x3cb3('0x53')]=_[_0x3cb3('0x55')](_0x4d5819[_0x3cb3('0x53')],{'$or':_['map'](_0x4d5819['attributes'],function(_0x7f2ebe){var _0x1926bb={};_0x1926bb[_0x7f2ebe]={'$like':'%'+_0x4737eb[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x1926bb;})});}_0x4d5819=_['merge']({},_0x4d5819,_0x4737eb[_0x3cb3('0x56')]);return db[_0x3cb3('0x6a')][_0x3cb3('0x32')]({'where':_0x4d5819[_0x3cb3('0x53')]})[_0x3cb3('0x3a')](function(_0x108536){_0x1774ee[_0x3cb3('0x32')]=_0x108536;if(_0x4737eb[_0x3cb3('0x49')][_0x3cb3('0x57')]){_0x4d5819[_0x3cb3('0x58')]=[{'all':!![]}];}return db[_0x3cb3('0x6a')][_0x3cb3('0x59')](_0x4d5819);})[_0x3cb3('0x3a')](function(_0x503ae3){_0x1774ee[_0x3cb3('0x6b')]=_0x503ae3;return _0x1774ee;});}})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x4d6461,_0x4d5819))[_0x3cb3('0x2d')](handleError(_0x4d6461,null));};exports[_0x3cb3('0x6c')]=function(_0x4c9c4c,_0x17d625,_0x12ad51){return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x4c9c4c['params']['id']}})['then'](handleEntityNotFound(_0x17d625,null))['then'](function(_0x2414ea){if(_0x2414ea){return _0x2414ea[_0x3cb3('0x6c')](_0x4c9c4c[_0x3cb3('0x49')][_0x3cb3('0x6d')]);}})[_0x3cb3('0x3a')](respondWithStatusCode(_0x17d625,null))['catch'](handleError(_0x17d625,null));};exports[_0x3cb3('0x6e')]=function(_0x476017,_0x316aba,_0x254e3b){if(_0x476017[_0x3cb3('0x60')]['id']){delete _0x476017['body']['id'];}return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x476017[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x316aba,null))[_0x3cb3('0x3a')](function(_0x2441d8){if(_0x2441d8){_0x476017[_0x3cb3('0x60')][_0x3cb3('0x68')]=_0x2441d8['id'];return db['CannedAnswer']['create'](_0x476017[_0x3cb3('0x60')]);}})[_0x3cb3('0x3a')](respondWithResult(_0x316aba,null))['catch'](handleError(_0x316aba,null));};exports['getAnswers']=function(_0x4db0f5,_0x1e3249,_0x4367f3){var _0x276110={'raw':![],'where':{}};var _0x2b7295={};var _0x2802ed={'count':0x0,'rows':[]};return db[_0x3cb3('0x43')][_0x3cb3('0x6f')]({'where':{'id':_0x4db0f5[_0x3cb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e3249,null))[_0x3cb3('0x3a')](function(_0x45cde3){if(_0x45cde3){_0x2b7295[_0x3cb3('0x48')]=_['keys'](db['CannedAnswer'][_0x3cb3('0x44')]);_0x2b7295[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x4db0f5[_0x3cb3('0x49')]);_0x2b7295[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x2b7295[_0x3cb3('0x48')],_0x2b7295['query']);_0x276110['attributes']=_[_0x3cb3('0x4b')](_0x2b7295[_0x3cb3('0x48')],qs[_0x3cb3('0x5d')](_0x4db0f5[_0x3cb3('0x49')]['fields']));_0x276110[_0x3cb3('0x4c')]=_0x276110[_0x3cb3('0x4c')][_0x3cb3('0x4d')]?_0x276110[_0x3cb3('0x4c')]:_0x2b7295[_0x3cb3('0x48')];if(!_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x4e')](_0x3cb3('0x4f'))){_0x276110[_0x3cb3('0x31')]=qs[_0x3cb3('0x31')](_0x4db0f5[_0x3cb3('0x49')]['limit']);_0x276110[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x50')]);}_0x276110[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x4db0f5[_0x3cb3('0x49')]['sort']);_0x276110['where']=qs[_0x3cb3('0x4a')](_['pick'](_0x4db0f5[_0x3cb3('0x49')],_0x2b7295[_0x3cb3('0x4a')]));_0x276110[_0x3cb3('0x53')][_0x3cb3('0x68')]=_0x45cde3['id'];if(_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x54')]){_0x276110[_0x3cb3('0x53')]=_['merge'](_0x276110[_0x3cb3('0x53')],{'$or':_[_0x3cb3('0x42')](_0x276110[_0x3cb3('0x4c')],function(_0x3b226c){var _0x4f4cb5={};_0x4f4cb5[_0x3b226c]={'$like':'%'+_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x4f4cb5;})});}_0x276110=_[_0x3cb3('0x55')]({},_0x276110,_0x4db0f5[_0x3cb3('0x56')]);return db[_0x3cb3('0x70')][_0x3cb3('0x32')]({'where':_0x276110[_0x3cb3('0x53')]})[_0x3cb3('0x3a')](function(_0xa60685){_0x2802ed[_0x3cb3('0x32')]=_0xa60685;if(_0x4db0f5[_0x3cb3('0x49')][_0x3cb3('0x57')]){_0x276110[_0x3cb3('0x58')]=[{'all':!![]}];}return db[_0x3cb3('0x70')][_0x3cb3('0x59')](_0x276110);})[_0x3cb3('0x3a')](function(_0x3f8730){_0x2802ed[_0x3cb3('0x6b')]=_0x3f8730;return _0x2802ed;});}})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x1e3249,_0x276110))[_0x3cb3('0x2d')](handleError(_0x1e3249,null));};exports[_0x3cb3('0x71')]=function(_0x52c2e2,_0x2a560c,_0x55cd97){return db['SmsAccount'][_0x3cb3('0x5e')]({'where':{'id':_0x52c2e2['params']['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x2a560c,null))['then'](function(_0x5133a4){if(_0x5133a4){return _0x5133a4[_0x3cb3('0x71')](_0x52c2e2[_0x3cb3('0x49')][_0x3cb3('0x6d')]);}})['then'](respondWithStatusCode(_0x2a560c,null))['catch'](handleError(_0x2a560c,null));};exports['notify']=function(_0x13321d,_0xc7163d,_0x12aada){var _0x24e949={'channel':_0x3cb3('0x72')};var _0x53d5fa=[];var _0x2afbce=[];var _0x28a9ce={};return db['SmsAccount']['find']({'where':{'id':_0x13321d[_0x3cb3('0x5a')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x3cb3('0x73')}]})['then'](handleEntityNotFound(_0xc7163d,null))[_0x3cb3('0x3a')](function(_0x5587a1){_0x24e949[_0x3cb3('0x74')]=_0x5587a1;_0x24e949[_0x3cb3('0x75')]=_[_0x3cb3('0x76')](_0x5587a1['Applications'],[_0x3cb3('0x77')],[_0x3cb3('0x78')]);if(_0x24e949['account'][_0x3cb3('0x73')]){delete _0x24e949[_0x3cb3('0x74')][_0x3cb3('0x73')];}return db[_0x3cb3('0x79')][_0x3cb3('0x66')]();})[_0x3cb3('0x3a')](function(_0xb13c43){if(!_0xb13c43){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))]('no\x20available\x20attributes');}_0x53d5fa=_[_0x3cb3('0x7c')](_[_0x3cb3('0x5c')](_0xb13c43),['createdAt',_0x3cb3('0x7d')]);_0x2afbce=_['difference'](_['keys'](_0xb13c43),[_0x3cb3('0x7e'),_0x3cb3('0x7d'),_0x3cb3('0x7f'),_0x3cb3('0x80')]);_0x24e949[_0x3cb3('0x60')]={'mapKey':'mobile'};if(_0x24e949[_0x3cb3('0x74')][_0x3cb3('0x46')]){switch(_0x24e949[_0x3cb3('0x74')]['type']){case _0x3cb3('0x81'):_0x24e949[_0x3cb3('0x60')]['from']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x82')];_0x24e949[_0x3cb3('0x60')]['body']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x83')];_0x24e949['body']['messageId']=_0x13321d['body'][_0x3cb3('0x84')];break;case _0x3cb3('0x85'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]='+'+_0x13321d['body'][_0x3cb3('0x87')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d['body'][_0x3cb3('0x88')];break;case _0x3cb3('0x89'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x2b')];break;case _0x3cb3('0x8a'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d['body'][_0x3cb3('0x86')];_0x24e949['body'][_0x3cb3('0x60')]=_0x13321d['body'][_0x3cb3('0x60')];_0x24e949[_0x3cb3('0x60')]['messageId']=_0x13321d[_0x3cb3('0x60')]['message_id'];break;case _0x3cb3('0x8b'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d[_0x3cb3('0x60')]['From'];_0x24e949[_0x3cb3('0x60')]['body']=_0x13321d[_0x3cb3('0x60')]['Text'];_0x24e949[_0x3cb3('0x60')]['messageId']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x8c')];break;case _0x3cb3('0x8d'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]='+'+_0x13321d['body'][_0x3cb3('0x8e')][0x0][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')]['body']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x8e')][0x0][_0x3cb3('0x88')];_0x24e949['body'][_0x3cb3('0x8f')]=_0x13321d['body']['results'][0x0][_0x3cb3('0x8f')];break;case'csc':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d['body'][_0x3cb3('0x90')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x91')][_0x3cb3('0x2b')];break;case'clickatell':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x92')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x88')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')]=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x93')];break;case _0x3cb3('0x94'):_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')]=_0x13321d[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')]['id'];_0x24e949[_0x3cb3('0x60')]['from']=_0x13321d['body'][0x0]['message'][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')][_0x3cb3('0x88')];break;case _0x3cb3('0x95'):_0x24e949['body']['from']=_0x13321d[_0x3cb3('0x60')][_0x3cb3('0x86')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]=_0x13321d['body'][_0x3cb3('0x2b')];_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')]=_0x13321d['body'][_0x3cb3('0x96')];break;}}if(_0x24e949['body']['id']){delete _0x24e949['body']['id'];}if(_['isNil'](_0x24e949['body']['from'])){throw new db[(_0x3cb3('0x7a'))]['ValidationError'](_0x3cb3('0x97'));}if(_[_0x3cb3('0x98')](_0x24e949[_0x3cb3('0x60')]['body'])||_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')]===''){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x99'));}if(_[_0x3cb3('0x98')](_0x24e949['body'][_0x3cb3('0x9a')])){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x9b')+_0x2afbce);}if(!_[_0x3cb3('0x9c')](_0x2afbce,_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x9a')])){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x9d')+_0x2afbce);}_0x28a9ce[_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x9a')]]=_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')];return db['CmList'][_0x3cb3('0x5e')]({'where':{'id':_0x24e949[_0x3cb3('0x74')][_0x3cb3('0x80')]},'include':[{'model':db['CmContact'],'as':_0x3cb3('0x9e'),'where':_0x28a9ce,'limit':0x1,'order':[['updatedAt',_0x3cb3('0x9f')]]}]});})[_0x3cb3('0x3a')](handleEntityNotFound(_0xc7163d,null))[_0x3cb3('0x3a')](function(_0x328108){if(_0x328108){_0x24e949['list']=_['omit'](_0x328108,[_0x3cb3('0x9e')]);if(_0x328108[_0x3cb3('0x9e')]['length']){return _0x328108[_0x3cb3('0x9e')][0x0];}var _0x1b1db5=_[_0x3cb3('0x1b')](_0x24e949['body'],{'firstName':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')],'ListId':_0x328108['id']});_0x1b1db5[_0x24e949[_0x3cb3('0x60')]['mapKey']]=_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')];return db[_0x3cb3('0x79')][_0x3cb3('0x5f')](_0x1b1db5,{'fields':_0x53d5fa,'raw':!![]});}})[_0x3cb3('0x3a')](handleEntityNotFound(_0xc7163d,null))[_0x3cb3('0x3a')](function(_0x155b5f){if(_0x155b5f){_0x24e949[_0x3cb3('0xa0')]=_0x155b5f;var _0x94587b={'ContactId':_0x155b5f['id'],'phone':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x86')],'SmsAccountId':_0x13321d[_0x3cb3('0x5a')]['id']};var _0x53c906={'ContactId':_0x155b5f['id'],'SmsAccountId':_0x13321d['params']['id'],'closed':![]};return db[_0x3cb3('0xa1')][_0x3cb3('0x5e')]({'where':_0x53c906})['then'](function(_0x285706){if(_0x285706){return[_0x285706,![]];}return db['SmsInteraction'][_0x3cb3('0x5f')](_0x94587b)['then'](function(_0x2240ba){return[_0x2240ba,!![]];});});}})[_0x3cb3('0xa2')](function(_0x7d39f4,_0x2d12ae){_0x24e949[_0x3cb3('0xa3')]=_0x7d39f4[_0x3cb3('0x62')]({'plain':!![]});_0x24e949['interaction'][_0x3cb3('0xa4')]=![];if(_0x2d12ae){if(_0x24e949[_0x3cb3('0x74')]['autoclose']){_0x24e949[_0x3cb3('0x75')][_0x3cb3('0xa5')]({'id':0x0,'priority':_0x24e949[_0x3cb3('0x75')][_0x3cb3('0x4d')]+0x1,'app':_0x3cb3('0xa6'),'appdata':_0x3cb3('0xa7'),'interval':_0x3cb3('0xa8')});}_0x24e949[_0x3cb3('0xa3')][_0x3cb3('0xa4')]=!![];}return db[_0x3cb3('0xa9')][_0x3cb3('0x5f')]({'phone':_0x24e949['body'][_0x3cb3('0x86')],'messageId':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x8f')],'body':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0x60')],'SmsAccountId':_0x13321d[_0x3cb3('0x5a')]['id'],'SmsInteractionId':_0x7d39f4['id'],'direction':'in','ContactId':_0x7d39f4[_0x3cb3('0xaa')],'AttachmentId':_0x24e949[_0x3cb3('0x60')][_0x3cb3('0xab')]});})['then'](function(_0x54c8e7){_0x24e949[_0x3cb3('0x2b')]=_0x54c8e7;if(_0x24e949[_0x3cb3('0xa3')]['UserId']){return db['User'][_0x3cb3('0x5e')]({'attributes':['id',_0x3cb3('0x3e')],'where':{'id':_0x24e949[_0x3cb3('0xa3')][_0x3cb3('0xac')]}})[_0x3cb3('0x3a')](function(_0x8b92b4){if(_0x8b92b4){_0x24e949['applications'][_0x3cb3('0xad')]({'id':0x0,'priority':0x0,'app':_0x3cb3('0xae'),'appdata':_0x8b92b4[_0x3cb3('0x3e')]+','+(_0x24e949['account'][_0x3cb3('0xaf')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3cb3('0xb0'),'startRouting',_0x24e949);});}return respondWithRpcPromise(_0x3cb3('0xb0'),_0x3cb3('0xb1'),_0x24e949);})['then'](function(_0x2d4bfa){if(_0x2d4bfa){var _0x45f686=0xc8;var _0x10d3f7=_0x3cb3('0xb2');logger['info'](_0x3cb3('0x28'),_0x10d3f7,_0x45f686,_0x3cb3('0xb3'));logger[_0x3cb3('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x10d3f7,_0x45f686,_0x3cb3('0xb3'),JSON['stringify'](_0x2d4bfa));if(_0x24e949['account'][_0x3cb3('0x46')]==='twilio'){return _0xc7163d[_0x3cb3('0x33')](_0x45f686)[_0x3cb3('0x34')](_0x3cb3('0xb4'),'text/xml')[_0x3cb3('0x3f')](_0x3cb3('0xb5'));}else{return _0xc7163d['status'](_0x45f686)['json'](_0x2d4bfa);}}})['catch'](handleError(_0xc7163d,null));};exports[_0x3cb3('0xb6')]=function(_0x5a6bf5,_0x34e093){var _0x5d3308=_0x5a6bf5['params']['id'];var _0x5c6e0c=_0x5a6bf5[_0x3cb3('0x60')];var _0x3af2d0=0xc8;var _0x5a611b=null;return db[_0x3cb3('0xb7')][_0x3cb3('0xb8')]({'isolationLevel':db[_0x3cb3('0xb7')][_0x3cb3('0xb9')]['ISOLATION_LEVELS'][_0x3cb3('0xba')]},function(_0x4998d0){return db[_0x3cb3('0x43')][_0x3cb3('0x6f')]({'where':{'id':_0x5d3308},'transaction':_0x4998d0})[_0x3cb3('0x3a')](function(_0x5288de){if(_0x5288de){return db[_0x3cb3('0xbb')][_0x3cb3('0x3b')]({'where':{'SmsAccountId':_0x5d3308},'transaction':_0x4998d0})['then'](function(){var _0x19dcce=_[_0x3cb3('0x42')](_0x5c6e0c,function(_0xf3d69d){_0xf3d69d[_0x3cb3('0x68')]=_0x5d3308;return _0xf3d69d;});return db[_0x3cb3('0xbb')][_0x3cb3('0xbc')](_0x19dcce,{'transaction':_0x4998d0});});}else{_0x3af2d0=0x194;_0x5a611b=[];}});})[_0x3cb3('0x3a')](function(){if(_0x3af2d0!==0x194){return db[_0x3cb3('0xbb')][_0x3cb3('0xbd')]({'where':{'SmsAccountId':_0x5d3308},'order':_0x3cb3('0x77')})[_0x3cb3('0x3a')](function(_0x5be21a){_0x5a611b=_0x5be21a;});}})['catch'](function(_0x2945c1){_0x3af2d0=0x1f4;logger[_0x3cb3('0x29')](_0x2945c1[_0x3cb3('0xbe')]);if(_0x2945c1[_0x3cb3('0x3e')]){delete _0x2945c1[_0x3cb3('0x3e')];}_0x5a611b=_0x2945c1;})[_0x3cb3('0xbf')](function(){if(_0x5a611b===null){_0x34e093[_0x3cb3('0x2e')](_0x3af2d0);}else{if(_0x3af2d0===0x1f4){_0x34e093[_0x3cb3('0x33')](_0x3af2d0)[_0x3cb3('0x3f')](_0x5a611b);}else{_0x34e093['status'](_0x3af2d0)['json'](_0x5a611b);}}});};exports[_0x3cb3('0xc0')]=function(_0x3c5489,_0x3e1ee5,_0x2a45d9){var _0x225d2a={};var _0x9609f3={};var _0x604bc4;var _0x12b571;return db['SmsAccount']['findOne']({'where':{'id':_0x3c5489[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x3e1ee5,null))[_0x3cb3('0x3a')](function(_0x4b3e9f){if(_0x4b3e9f){_0x604bc4=_0x4b3e9f;_0x9609f3['model']=_[_0x3cb3('0x5c')](db[_0x3cb3('0xbb')][_0x3cb3('0x44')]);_0x9609f3[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x3c5489[_0x3cb3('0x49')]);_0x9609f3[_0x3cb3('0x4a')]=_[_0x3cb3('0x4b')](_0x9609f3[_0x3cb3('0x48')],_0x9609f3[_0x3cb3('0x49')]);_0x225d2a[_0x3cb3('0x4c')]=_['intersection'](_0x9609f3[_0x3cb3('0x48')],qs[_0x3cb3('0x5d')](_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x5d')]));_0x225d2a[_0x3cb3('0x4c')]=_0x225d2a[_0x3cb3('0x4c')]['length']?_0x225d2a[_0x3cb3('0x4c')]:_0x9609f3['model'];_0x225d2a[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x3c5489[_0x3cb3('0x49')]['sort']);_0x225d2a[_0x3cb3('0x53')]=qs[_0x3cb3('0x4a')](_[_0x3cb3('0xc1')](_0x3c5489['query'],_0x9609f3['filters']));if(_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x54')]){_0x225d2a[_0x3cb3('0x53')]=_['merge'](_0x225d2a[_0x3cb3('0x53')],{'$or':_[_0x3cb3('0x42')](_0x225d2a[_0x3cb3('0x4c')],function(_0x4d88d9){var _0x1bb043={};_0x1bb043[_0x4d88d9]={'$like':'%'+_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x1bb043;})});}_0x225d2a=_[_0x3cb3('0x55')]({},_0x225d2a,_0x3c5489[_0x3cb3('0x56')]);return _0x604bc4['getApplications'](_0x225d2a);}})[_0x3cb3('0x3a')](function(_0x3a292d){if(_0x3a292d){_0x12b571=_0x3a292d[_0x3cb3('0x4d')];if(!_0x3c5489[_0x3cb3('0x49')][_0x3cb3('0x4e')]('nolimit')){_0x225d2a[_0x3cb3('0x31')]=qs['limit'](_0x3c5489[_0x3cb3('0x49')]['limit']);_0x225d2a['offset']=qs[_0x3cb3('0x50')](_0x3c5489['query'][_0x3cb3('0x50')]);}return _0x604bc4[_0x3cb3('0xc0')](_0x225d2a);}})[_0x3cb3('0x3a')](function(_0x35a8d3){if(_0x35a8d3){return _0x35a8d3?{'count':_0x12b571,'rows':_0x35a8d3}:null;}})[_0x3cb3('0x3a')](respondWithResult(_0x3e1ee5,null))[_0x3cb3('0x2d')](handleError(_0x3e1ee5,null));};exports['getInteractions']=function(_0x13fe6b,_0x3a07e3,_0x4d38bd){var _0x42034e={'raw':![],'where':{}};var _0x13f237={};var _0x2f20a7={'count':0x0,'rows':[]};return db[_0x3cb3('0x43')][_0x3cb3('0x6f')]({'where':{'id':_0x13fe6b[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x3a07e3,null))[_0x3cb3('0x3a')](function(_0x4ff320){if(_0x4ff320){_0x13f237[_0x3cb3('0x48')]=_[_0x3cb3('0x5c')](db[_0x3cb3('0xa1')][_0x3cb3('0x44')]);_0x13f237[_0x3cb3('0x49')]=_[_0x3cb3('0x5c')](_0x13fe6b['query']);_0x13f237['filters']=_[_0x3cb3('0x4b')](_0x13f237['model'],_0x13f237['query']);_0x42034e[_0x3cb3('0x4c')]=_[_0x3cb3('0x4b')](_0x13f237[_0x3cb3('0x48')],qs['fields'](_0x13fe6b['query'][_0x3cb3('0x5d')]));_0x42034e['attributes']=_0x42034e[_0x3cb3('0x4c')][_0x3cb3('0x4d')]?_0x42034e[_0x3cb3('0x4c')]:_0x13f237[_0x3cb3('0x48')];if(!_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x4e')]('nolimit')){_0x42034e[_0x3cb3('0x31')]=qs[_0x3cb3('0x31')](_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0x42034e[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x13fe6b['query'][_0x3cb3('0x50')]);}_0x42034e[_0x3cb3('0x51')]=qs[_0x3cb3('0x52')](_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x52')]);_0x42034e[_0x3cb3('0x53')]=qs[_0x3cb3('0x4a')](_[_0x3cb3('0xc1')](_0x13fe6b[_0x3cb3('0x49')],_0x13f237[_0x3cb3('0x4a')]));_0x42034e[_0x3cb3('0x53')][_0x3cb3('0x68')]=_0x4ff320['id'];if(_0x13fe6b[_0x3cb3('0x49')]['filter']){_0x42034e[_0x3cb3('0x53')]=_['merge'](_0x42034e[_0x3cb3('0x53')],{'$or':_['map'](_0x42034e['attributes'],function(_0x1bbf65){var _0x4e2d0b={};_0x4e2d0b[_0x1bbf65]={'$like':'%'+_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x4e2d0b;})});}_0x42034e=_[_0x3cb3('0x55')]({},_0x42034e,_0x13fe6b['options']);return db[_0x3cb3('0xa1')][_0x3cb3('0x32')]({'where':_0x42034e[_0x3cb3('0x53')]})[_0x3cb3('0x3a')](function(_0x4534a6){_0x2f20a7[_0x3cb3('0x32')]=_0x4534a6;if(_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0x57')]){_0x42034e[_0x3cb3('0x58')]=[{'model':db['CmContact'],'as':_0x3cb3('0xc2'),'required':![]},{'model':db[_0x3cb3('0xc3')],'as':_0x3cb3('0xc4'),'attributes':[_0x3cb3('0x3e'),_0x3cb3('0xc5'),_0x3cb3('0xc6')],'required':![]},{'model':db[_0x3cb3('0xc7')],'as':_0x3cb3('0xc8'),'attributes':['id','name','color'],'where':_0x13fe6b[_0x3cb3('0x49')][_0x3cb3('0xc9')]?{'id':_0x13fe6b['query'][_0x3cb3('0xc9')]}:undefined,'required':_0x13fe6b['query'][_0x3cb3('0xc9')]?!![]:![]}];}return db[_0x3cb3('0xa1')][_0x3cb3('0x59')](_0x42034e);})[_0x3cb3('0x3a')](function(_0x54f527){_0x2f20a7[_0x3cb3('0x6b')]=_0x54f527;return _0x2f20a7;});}})[_0x3cb3('0x3a')](respondWithFilteredResult(_0x3a07e3,_0x42034e))[_0x3cb3('0x2d')](handleError(_0x3a07e3,null));};exports[_0x3cb3('0x3f')]=function(_0x1bc22,_0x581427,_0x1981d3){var _0x3c2cb6,_0x9d990c,_0x55cf4d;if(_['isNil'](_0x1bc22[_0x3cb3('0x60')]['body'])||_0x1bc22[_0x3cb3('0x60')][_0x3cb3('0x60')]===''){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))](_0x3cb3('0x99'));}if(_['isNil'](_0x1bc22[_0x3cb3('0x60')]['to'])){throw new db[(_0x3cb3('0x7a'))][(_0x3cb3('0x7b'))]('to\x20is\x20mandatory');}_0x3c2cb6=_0x1bc22[_0x3cb3('0x60')]['to'];return db[_0x3cb3('0x43')]['find']({'where':{'id':_0x1bc22['params']['id']},'include':[{'model':db[_0x3cb3('0xca')],'as':_0x3cb3('0xcb'),'include':[{'model':db['CmContact'],'as':_0x3cb3('0x9e'),'where':{'mobile':_0x3c2cb6},'limit':0x1,'order':[[_0x3cb3('0x7d'),_0x3cb3('0x9f')]]}]}]})[_0x3cb3('0x3a')](handleEntityNotFound(_0x581427,null))[_0x3cb3('0x3a')](function(_0x393c16){if(_0x393c16&&_0x393c16['List']){_0x9d990c=_0x393c16['get']({'plain':!![]});if(_0x9d990c[_0x3cb3('0xcb')]&&_0x9d990c['List']['Contacts']['length']){return _0x9d990c[_0x3cb3('0xcb')][_0x3cb3('0x9e')][0x0];}return db['CmContact'][_0x3cb3('0x5f')](_[_0x3cb3('0x1b')](_0x1bc22[_0x3cb3('0x60')],{'firstName':_0x3c2cb6,'mobile':_0x3c2cb6,'phone':_0x3c2cb6,'ListId':_0x9d990c[_0x3cb3('0x80')]}));}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x581427,null))[_0x3cb3('0x3a')](function(_0x47c69f){if(_0x47c69f){_0x55cf4d=_0x47c69f;return db['SmsInteraction'][_0x3cb3('0x5e')]({'where':{'ContactId':_0x55cf4d['id'],'closed':![],'SmsAccountId':_0x9d990c['id']}})[_0x3cb3('0x3a')](function(_0x34c87b){if(_0x34c87b){return[_0x34c87b,![]];}return db[_0x3cb3('0xa1')][_0x3cb3('0x5f')]({'UserId':_0x1bc22[_0x3cb3('0x61')]['id'],'ContactId':_0x55cf4d['id'],'SmsAccountId':_0x9d990c['id'],'phone':_0x3c2cb6,'firstMsgDirection':_0x3cb3('0xcc'),'Messages':[_[_0x3cb3('0x55')](_0x1bc22[_0x3cb3('0x60')],{'read':![],'body':_0x1bc22[_0x3cb3('0x60')][_0x3cb3('0x60')],'phone':_0x3c2cb6,'SmsAccountId':_0x9d990c['id'],'UserId':_0x1bc22[_0x3cb3('0x61')]['id'],'ContactId':_0x55cf4d['id']})]},{'include':[{'model':db[_0x3cb3('0xa9')],'as':_0x3cb3('0xcd')}]})['then'](function(_0x2d080f){return[_0x2d080f,!![]];});});}})[_0x3cb3('0xa2')](function(_0x5ea4ad,_0x482621){if(_0x482621){return _0x5ea4ad;}return db[_0x3cb3('0xa9')][_0x3cb3('0x5f')](_[_0x3cb3('0x55')](_0x1bc22[_0x3cb3('0x60')],{'read':![],'body':_0x1bc22['body'][_0x3cb3('0x60')],'phone':_0x3c2cb6,'SmsAccountId':_0x9d990c['id'],'SmsInteractionId':_0x5ea4ad['id'],'UserId':_0x1bc22[_0x3cb3('0x61')]['id'],'ContactId':_0x55cf4d['id']}))['then'](function(_0x187318){_0x5ea4ad[_0x3cb3('0xce')][_0x3cb3('0xcd')]=[];_0x5ea4ad[_0x3cb3('0xce')][_0x3cb3('0xcd')][_0x3cb3('0xa5')](_0x187318[_0x3cb3('0xce')]);return _0x5ea4ad;});})[_0x3cb3('0x3a')](respondWithResult(_0x581427,null))[_0x3cb3('0x2d')](handleError(_0x581427,null));};exports[_0x3cb3('0x33')]=function(_0x2550dd,_0x1e5ce4,_0x5e265d){if(_0x2550dd['body']['id']){delete _0x2550dd[_0x3cb3('0x60')]['id'];}var _0x32211a,_0x1f6b0d,_0x4f4798;return db['SmsAccount'][_0x3cb3('0x5e')]({'where':{'id':_0x2550dd[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x1e5ce4,null))[_0x3cb3('0x3a')](function(_0x4162a4){if(_0x4162a4){_0x4f4798=_0x4162a4;logger['debug'](_0x3cb3('0x28'),'status',_0x3cb3('0xcf'),_0x4162a4[_0x3cb3('0x46')],util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));switch(_0x4162a4[_0x3cb3('0x46')]){case _0x3cb3('0x85'):if(_0x2550dd['body'][_0x3cb3('0xd1')]&&_0x2550dd['body'][_0x3cb3('0x33')]){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x33')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')]['skebby_dispatch_id']}});}break;case _0x3cb3('0x89'):if(_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd2')]&&_0x2550dd['body'][_0x3cb3('0xd3')]){_0x1f6b0d=_0x2550dd['body'][_0x3cb3('0xd3')];return db[_0x3cb3('0xa9')]['find']({'where':{'messageId':_0x2550dd['body'][_0x3cb3('0xd2')]}});}break;case'clicksend':if(_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd4')]&&_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd5')]){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd5')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd4')]}});}break;case _0x3cb3('0x8d'):var _0x29389b=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8e')][0x0];if(_0x29389b[_0x3cb3('0x8f')]&&_0x29389b[_0x3cb3('0x33')][_0x3cb3('0xd6')]==='DELIVERED'){_0x1f6b0d=_0x29389b['status'][_0x3cb3('0xd6')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x29389b[_0x3cb3('0x8f')]}});}break;case _0x3cb3('0xd7'):if(_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8f')]&&_0x2550dd['body'][_0x3cb3('0x33')]){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x33')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8f')]}});}break;case'bandwidth':if(_0x2550dd[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')]['id']){_0x1f6b0d=_0x2550dd[_0x3cb3('0x60')][0x0][_0x3cb3('0x46')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd[_0x3cb3('0x60')][0x0][_0x3cb3('0x2b')]['id']}});}break;case _0x3cb3('0x95'):if(_0x2550dd['body'][_0x3cb3('0xd8')]&&_0x2550dd[_0x3cb3('0x60')]['status']){_0x1f6b0d=_0x2550dd['body']['status'];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x2550dd['body']['redif']}});}break;}}})['then'](handleEntityNotFound(_0x1e5ce4,null))[_0x3cb3('0x3a')](function(_0x1680de){if(_0x1680de){_0x32211a=_0x1680de;switch(_0x4f4798[_0x3cb3('0x46')]){case _0x3cb3('0x85'):if(_0x1f6b0d==='DELIVERED'){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger[_0x3cb3('0x29')](_0x3cb3('0x28'),_0x3cb3('0x33'),'skebby',util['inspect'](_0x2550dd['body'],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x89'):if(_0x1f6b0d==='1'){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger[_0x3cb3('0x29')](_0x3cb3('0x28'),'status',_0x3cb3('0x85'),util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x8a'):if(!_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0xd9')]&&_0x1f6b0d>=0xc8&&_0x1f6b0d<=0xce){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cb3('0x33'),'clicksend',util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x8d'):var _0x32018e=_0x2550dd[_0x3cb3('0x60')][_0x3cb3('0x8e')][0x0];if(_0x32018e[_0x3cb3('0x33')][_0x3cb3('0xd6')]===_0x3cb3('0xda')){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','infobip',util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0xd7'):if(_0x1f6b0d==_0x3cb3('0xdb')||_0x1f6b0d=='RECEIVED_BY_RECIPIENT'){return _0x32211a['update']({'read':!![]});}else{logger[_0x3cb3('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cb3('0x33'),_0x3cb3('0xd7'),util[_0x3cb3('0xd0')](_0x2550dd['body'],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x94'):if(_0x1f6b0d==_0x3cb3('0xdc')){return _0x32211a['update']({'read':!![]});}else{logger['error'](_0x3cb3('0x28'),_0x3cb3('0x33'),_0x3cb3('0x94'),util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;case _0x3cb3('0x95'):if(_0x1f6b0d==='DELIVRD'||_0x1f6b0d===_0x3cb3('0xdd')){return _0x32211a[_0x3cb3('0x39')]({'read':!![]});}else{logger[_0x3cb3('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cb3('0x33'),_0x3cb3('0x95'),util[_0x3cb3('0xd0')](_0x2550dd[_0x3cb3('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x32211a;}})[_0x3cb3('0x3a')](respondWithResult(_0x1e5ce4,null))['catch'](handleError(_0x1e5ce4,null));};exports[_0x3cb3('0xde')]=function(_0x3d235e,_0x11b025,_0x5d8d83){var _0x3b857a,_0x2e4cd0,_0x322d73;return db[_0x3cb3('0x43')][_0x3cb3('0x5e')]({'where':{'id':_0x3d235e[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x11b025,null))[_0x3cb3('0x3a')](function(_0x5e981e){if(_0x5e981e){_0x322d73=_0x5e981e;logger['debug'](_0x3cb3('0x28'),_0x3cb3('0x33'),'received\x20delivery\x20report\x20from',_0x5e981e[_0x3cb3('0x46')],util[_0x3cb3('0xd0')](_0x3d235e[_0x3cb3('0x49')],{'showHidden':![],'depth':null}));switch(_0x5e981e[_0x3cb3('0x46')]){case'csc':if(_0x3d235e[_0x3cb3('0x49')]['message-id']&&_0x3d235e[_0x3cb3('0x49')][_0x3cb3('0xdf')]){_0x2e4cd0=_0x3d235e[_0x3cb3('0x49')][_0x3cb3('0xdf')];return db[_0x3cb3('0xa9')][_0x3cb3('0x5e')]({'where':{'messageId':_0x3d235e[_0x3cb3('0x49')]['message-id']}});}break;}}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x11b025,null))['then'](function(_0x60d3cb){if(_0x60d3cb){_0x3b857a=_0x60d3cb;switch(_0x322d73['type']){case'csc':if(_0x2e4cd0==='2'||_0x2e4cd0==='6'){return _0x3b857a['update']({'read':!![]});}else{logger['error'](_0x3cb3('0x28'),_0x3cb3('0x33'),_0x3cb3('0xe0'),util[_0x3cb3('0xd0')](_0x3d235e[_0x3cb3('0x49')],{'showHidden':![],'depth':null}));};break;}return _0x3b857a;}})[_0x3cb3('0x3a')](respondWithResult(_0x11b025,null))[_0x3cb3('0x2d')](handleError(_0x11b025,null));};exports[_0x3cb3('0xe1')]=function(_0x590e94,_0x4b6b4b,_0x56e301){return db[_0x3cb3('0x43')]['find']({'where':{'id':_0x590e94[_0x3cb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4b6b4b,null))[_0x3cb3('0x3a')](function(_0x51a0ff){if(_0x51a0ff){return _0x51a0ff[_0x3cb3('0xe1')](_0x590e94[_0x3cb3('0x60')][_0x3cb3('0x6d')],_[_0x3cb3('0xe2')](_0x590e94[_0x3cb3('0x60')],['ids','id'])||{})[_0x3cb3('0xa2')](function(_0x92d785){for(var _0x395828=0x0;_0x395828<_0x590e94[_0x3cb3('0x60')]['ids'][_0x3cb3('0x4d')];_0x395828+=0x1){socket[_0x3cb3('0xe3')](_0x3cb3('0xe4'),{'UserId':Number(_0x590e94[_0x3cb3('0x60')][_0x3cb3('0x6d')][_0x395828]),'SmsAccountId':Number(_0x590e94[_0x3cb3('0x5a')]['id'])});}return _0x92d785;});}})[_0x3cb3('0x3a')](respondWithResult(_0x4b6b4b,null))['catch'](handleError(_0x4b6b4b,null));};exports[_0x3cb3('0xe5')]=function(_0x5cf4b3,_0xa23f19,_0x8e1c80){return db['SmsAccount']['find']({'where':{'id':_0x5cf4b3[_0x3cb3('0x5a')]['id']}})['then'](handleEntityNotFound(_0xa23f19,null))[_0x3cb3('0x3a')](function(_0x1ca95f){if(_0x1ca95f){return _0x1ca95f['removeAgents'](_0x5cf4b3[_0x3cb3('0x49')][_0x3cb3('0x6d')])[_0x3cb3('0x3a')](function(){if(_[_0x3cb3('0xe6')](_0x5cf4b3['query'][_0x3cb3('0x6d')])){for(var _0x21232c=0x0;_0x21232c<_0x5cf4b3[_0x3cb3('0x49')][_0x3cb3('0x6d')][_0x3cb3('0x4d')];_0x21232c+=0x1){socket[_0x3cb3('0xe3')](_0x3cb3('0xe7'),{'UserId':Number(_0x5cf4b3[_0x3cb3('0x49')][_0x3cb3('0x6d')][_0x21232c]),'SmsAccountId':Number(_0x5cf4b3[_0x3cb3('0x5a')]['id'])});}}else{socket[_0x3cb3('0xe3')](_0x3cb3('0xe7'),{'UserId':Number(_0x5cf4b3['query'][_0x3cb3('0x6d')]),'SmsAccountId':Number(_0x5cf4b3[_0x3cb3('0x5a')]['id'])});}});}})[_0x3cb3('0x3a')](respondWithStatusCode(_0xa23f19,null))['catch'](handleError(_0xa23f19,null));};exports[_0x3cb3('0xe8')]=function(_0x4157b7,_0x649d2a,_0x337753){var _0xbc9c81={};var _0xb000b9={};var _0x265f71;var _0x4a413d;return db[_0x3cb3('0x43')]['findOne']({'where':{'id':_0x4157b7[_0x3cb3('0x5a')]['id']}})[_0x3cb3('0x3a')](handleEntityNotFound(_0x649d2a,null))[_0x3cb3('0x3a')](function(_0x4188c6){if(_0x4188c6){_0x265f71=_0x4188c6;_0xb000b9[_0x3cb3('0x48')]=_[_0x3cb3('0x5c')](db[_0x3cb3('0xc3')][_0x3cb3('0x44')]);_0xb000b9[_0x3cb3('0x49')]=_['keys'](_0x4157b7['query']);_0xb000b9['filters']=_[_0x3cb3('0x4b')](_0xb000b9[_0x3cb3('0x48')],_0xb000b9[_0x3cb3('0x49')]);_0xbc9c81[_0x3cb3('0x4c')]=_['intersection'](_0xb000b9[_0x3cb3('0x48')],qs['fields'](_0x4157b7['query'][_0x3cb3('0x5d')]));_0xbc9c81[_0x3cb3('0x4c')]=_0xbc9c81[_0x3cb3('0x4c')]['length']?_0xbc9c81[_0x3cb3('0x4c')]:_0xb000b9['model'];_0xbc9c81['order']=qs['sort'](_0x4157b7[_0x3cb3('0x49')]['sort']);_0xbc9c81[_0x3cb3('0x53')]=qs['filters'](_['pick'](_0x4157b7[_0x3cb3('0x49')],_0xb000b9[_0x3cb3('0x4a')]));if(_0x4157b7['query'][_0x3cb3('0x54')]){_0xbc9c81[_0x3cb3('0x53')]=_[_0x3cb3('0x55')](_0xbc9c81['where'],{'$or':_[_0x3cb3('0x42')](_0xbc9c81['attributes'],function(_0x2e8126){var _0x47d358={};_0x47d358[_0x2e8126]={'$like':'%'+_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x54')]+'%'};return _0x47d358;})});}_0xbc9c81=_[_0x3cb3('0x55')]({},_0xbc9c81,_0x4157b7[_0x3cb3('0x56')]);return _0x265f71['getAgents'](_0xbc9c81);}})[_0x3cb3('0x3a')](function(_0x59ae61){if(_0x59ae61){_0x4a413d=_0x59ae61['length'];if(!_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x4e')](_0x3cb3('0x4f'))){_0xbc9c81['limit']=qs['limit'](_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x31')]);_0xbc9c81[_0x3cb3('0x50')]=qs[_0x3cb3('0x50')](_0x4157b7[_0x3cb3('0x49')][_0x3cb3('0x50')]);}return _0x265f71[_0x3cb3('0xe8')](_0xbc9c81);}})[_0x3cb3('0x3a')](function(_0x52a564){if(_0x52a564){return _0x52a564?{'count':_0x4a413d,'rows':_0x52a564}:null;}})[_0x3cb3('0x3a')](respondWithResult(_0x649d2a,null))[_0x3cb3('0x2d')](handleError(_0x649d2a,null));};
\ No newline at end of file
+var _0xa9ab=['../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','SmsAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','show','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','applications','Applications','priority','asc','account','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','clicksend','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','text','refid','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','CmContact','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','Transaction','ISOLATION_LEVELS','SmsApplication','findAndCountAll','finally','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','List','DESC','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','status_code','DELIVERED','groupName','bandwidth','intelepeer','redif','error_code','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xa9ab,0xca));var _0xba9a=function(_0x238cbc,_0x2157f1){_0x238cbc=_0x238cbc-0x0;var _0x9ec638=_0xa9ab[_0x238cbc];return _0x9ec638;};'use strict';var emlformat=require(_0xba9a('0x0'));var rimraf=require(_0xba9a('0x1'));var zipdir=require(_0xba9a('0x2'));var jsonpatch=require(_0xba9a('0x3'));var rp=require(_0xba9a('0x4'));var moment=require(_0xba9a('0x5'));var BPromise=require(_0xba9a('0x6'));var Mustache=require(_0xba9a('0x7'));var util=require(_0xba9a('0x8'));var path=require(_0xba9a('0x9'));var sox=require('sox');var csv=require(_0xba9a('0xa'));var ejs=require(_0xba9a('0xb'));var fs=require('fs');var fs_extra=require(_0xba9a('0xc'));var _=require('lodash');var squel=require(_0xba9a('0xd'));var crypto=require(_0xba9a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xba9a('0xf'));var toCsv=require(_0xba9a('0xa'));var querystring=require(_0xba9a('0x10'));var Papa=require(_0xba9a('0x11'));var Redis=require(_0xba9a('0x12'));var authService=require(_0xba9a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xba9a('0x14'));var hardwareService=require(_0xba9a('0x15'));var logger=require(_0xba9a('0x16'))(_0xba9a('0x17'));var utils=require(_0xba9a('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xba9a('0x19'));var db=require(_0xba9a('0x1a'))['db'];config['redis']=_[_0xba9a('0x1b')](config[_0xba9a('0x1c')],{'host':_0xba9a('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xba9a('0x1c')]));require('./smsAccount.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xba9a('0x1e')][_0xba9a('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x33f820,_0x55201f,_0x108fe3,_0x14e6e0){return new BPromise(function(_0x12b13e,_0x4353b3){var _0x414331=_0x14e6e0||client;return _0x414331[_0xba9a('0x20')](_0x33f820,_0x108fe3)[_0xba9a('0x21')](function(_0xc75d6d){logger[_0xba9a('0x22')](_0xba9a('0x23'),_0x55201f,_0xba9a('0x24'));logger['debug'](_0xba9a('0x25'),_0x55201f,_0xba9a('0x24'),JSON[_0xba9a('0x26')](_0xc75d6d));if(_0xc75d6d[_0xba9a('0x27')]){if(_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x28')]===0x1f4){logger[_0xba9a('0x27')](_0xba9a('0x23'),_0x55201f,_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x29')]);return _0x4353b3(_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x29')]);}logger[_0xba9a('0x27')](_0xba9a('0x23'),_0x55201f,_0xc75d6d['error'][_0xba9a('0x29')]);return _0x12b13e(_0xc75d6d[_0xba9a('0x27')][_0xba9a('0x29')]);}else{logger[_0xba9a('0x22')](_0xba9a('0x23'),_0x55201f,_0xba9a('0x24'));_0x12b13e(_0xc75d6d[_0xba9a('0x2a')]['message']);}})[_0xba9a('0x2b')](function(_0x5d8264){logger['error']('SmsAccount,\x20%s,\x20%s',_0x55201f,_0x5d8264);_0x4353b3(_0x5d8264);});});}function respondWithStatusCode(_0x6a7d74,_0x3234e0){_0x3234e0=_0x3234e0||0xcc;return function(_0x5a6734){if(_0x5a6734){return _0x6a7d74[_0xba9a('0x2c')](_0x3234e0);}return _0x6a7d74[_0xba9a('0x2d')](_0x3234e0)[_0xba9a('0x2e')]();};}function respondWithResult(_0x52b964,_0x41fd98){_0x41fd98=_0x41fd98||0xc8;return function(_0x23e0d6){if(_0x23e0d6){return _0x52b964[_0xba9a('0x2d')](_0x41fd98)[_0xba9a('0x2f')](_0x23e0d6);}};}function respondWithFilteredResult(_0x537f3d,_0x238e19){return function(_0x3f358d){if(_0x3f358d){var _0x638793=typeof _0x238e19[_0xba9a('0x30')]===_0xba9a('0x31')&&typeof _0x238e19[_0xba9a('0x32')]==='undefined';var _0x30c7c0=_0x3f358d['count'];var _0x3d67fc=_0x638793?0x0:_0x238e19[_0xba9a('0x30')];var _0x3f0ba3=_0x638793?_0x3f358d[_0xba9a('0x33')]:_0x238e19[_0xba9a('0x30')]+_0x238e19[_0xba9a('0x32')];var _0x1785f4;if(_0x3f0ba3>=_0x30c7c0){_0x3f0ba3=_0x30c7c0;_0x1785f4=0xc8;}else{_0x1785f4=0xce;}_0x537f3d[_0xba9a('0x2d')](_0x1785f4);return _0x537f3d[_0xba9a('0x34')](_0xba9a('0x35'),_0x3d67fc+'-'+_0x3f0ba3+'/'+_0x30c7c0)[_0xba9a('0x2f')](_0x3f358d);}return null;};}function patchUpdates(_0x336028){return function(_0x5821a1){try{jsonpatch[_0xba9a('0x36')](_0x5821a1,_0x336028,!![]);}catch(_0x23ac8e){return BPromise['reject'](_0x23ac8e);}return _0x5821a1[_0xba9a('0x37')]();};}function saveUpdates(_0x109560,_0x645dce){return function(_0x57800c){if(_0x57800c){return _0x57800c[_0xba9a('0x38')](_0x109560)['then'](function(_0x36f1e9){return _0x36f1e9;});}return null;};}function removeEntity(_0x377680,_0x3cd745){return function(_0x478ba1){if(_0x478ba1){return _0x478ba1[_0xba9a('0x39')]()[_0xba9a('0x21')](function(){var _0x5da8dc=_0x478ba1['get']({'plain':!![]});var _0x5c2c61=_0xba9a('0x3a');return db['UserProfileResource'][_0xba9a('0x39')]({'where':{'type':_0x5c2c61,'resourceId':_0x5da8dc['id']}})[_0xba9a('0x21')](function(){return _0x478ba1;});})[_0xba9a('0x21')](function(){_0x377680[_0xba9a('0x2d')](0xcc)[_0xba9a('0x2e')]();});}};}function handleEntityNotFound(_0x398b70,_0x2f661d){return function(_0x1d0632){if(!_0x1d0632){_0x398b70[_0xba9a('0x2c')](0x194);}return _0x1d0632;};}function handleError(_0xce4dc4,_0x3788cc){_0x3788cc=_0x3788cc||0x1f4;return function(_0x32f7f7){logger[_0xba9a('0x27')](_0x32f7f7[_0xba9a('0x3b')]);if(_0x32f7f7[_0xba9a('0x3c')]){delete _0x32f7f7['name'];}_0xce4dc4[_0xba9a('0x2d')](_0x3788cc)[_0xba9a('0x3d')](_0x32f7f7);};}exports['index']=function(_0x38417c,_0x222622){var _0x1a5e26={'include':[{'model':db[_0xba9a('0x3e')],'as':_0xba9a('0x3f')}]},_0x5749a3={},_0x2fbb9c={'count':0x0,'rows':[]};var _0x2de228=_[_0xba9a('0x40')](db[_0xba9a('0x41')][_0xba9a('0x42')],function(_0x562ee8){return{'name':_0x562ee8[_0xba9a('0x43')],'type':_0x562ee8[_0xba9a('0x44')][_0xba9a('0x45')]};});_0x5749a3[_0xba9a('0x46')]=_[_0xba9a('0x40')](_0x2de228,_0xba9a('0x3c'));_0x5749a3[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x38417c[_0xba9a('0x47')]);_0x5749a3['filters']=_['intersection'](_0x5749a3[_0xba9a('0x46')],_0x5749a3[_0xba9a('0x47')]);_0x1a5e26[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x5749a3[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x38417c['query'][_0xba9a('0x4b')]));_0x1a5e26['attributes']=_0x1a5e26[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x1a5e26['attributes']:_0x5749a3['model'];if(!_0x38417c['query'][_0xba9a('0x4d')](_0xba9a('0x4e'))){_0x1a5e26[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x38417c['query'][_0xba9a('0x32')]);_0x1a5e26[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x38417c['query'][_0xba9a('0x30')]);}_0x1a5e26[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x38417c[_0xba9a('0x47')][_0xba9a('0x50')]);_0x1a5e26[_0xba9a('0x51')]=qs['filters'](_[_0xba9a('0x52')](_0x38417c[_0xba9a('0x47')],_0x5749a3[_0xba9a('0x53')]),_0x2de228);if(_0x38417c[_0xba9a('0x47')][_0xba9a('0x54')]){_0x1a5e26[_0xba9a('0x51')]=_['merge'](_0x1a5e26[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x2de228,function(_0x30ef30){if(_0x30ef30['type']!=='VIRTUAL'){var _0x70be31={};_0x70be31[_0x30ef30[_0xba9a('0x3c')]]={'$like':'%'+_0x38417c['query'][_0xba9a('0x54')]+'%'};return _0x70be31;}})});}_0x1a5e26=_[_0xba9a('0x55')]({},_0x1a5e26,_0x38417c[_0xba9a('0x56')]);var _0x5188d6={'where':_0x1a5e26[_0xba9a('0x51')]};return db['SmsAccount'][_0xba9a('0x33')](_0x5188d6)['then'](function(_0x4f4dcc){_0x2fbb9c[_0xba9a('0x33')]=_0x4f4dcc;if(_0x38417c[_0xba9a('0x47')]['includeAll']){_0x1a5e26[_0xba9a('0x57')]=[{'all':!![]}];}return db[_0xba9a('0x41')][_0xba9a('0x58')](_0x1a5e26);})[_0xba9a('0x21')](function(_0x3e1326){_0x2fbb9c[_0xba9a('0x59')]=_0x3e1326;return _0x2fbb9c;})[_0xba9a('0x21')](respondWithFilteredResult(_0x222622,_0x1a5e26))['catch'](handleError(_0x222622,null));};exports[_0xba9a('0x5a')]=function(_0x204d85,_0x52db08){var _0x2f258a={'raw':![],'where':{'id':_0x204d85['params']['id']},'include':[{'model':db[_0xba9a('0x3e')],'as':'mandatoryDispositionPause'}]},_0x2891f0={};_0x2891f0['model']=_['keys'](db[_0xba9a('0x41')][_0xba9a('0x42')]);_0x2891f0[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x204d85[_0xba9a('0x47')]);_0x2891f0[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x2891f0[_0xba9a('0x46')],_0x2891f0[_0xba9a('0x47')]);_0x2f258a[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x2891f0[_0xba9a('0x46')],qs['fields'](_0x204d85[_0xba9a('0x47')]['fields']));_0x2f258a['attributes']=_0x2f258a['attributes'][_0xba9a('0x4c')]?_0x2f258a[_0xba9a('0x49')]:_0x2891f0[_0xba9a('0x46')];if(_0x204d85[_0xba9a('0x47')][_0xba9a('0x5b')]){_0x2f258a[_0xba9a('0x57')]=[{'all':!![]}];}_0x2f258a=_['merge']({},_0x2f258a,_0x204d85['options']);return db[_0xba9a('0x41')][_0xba9a('0x5c')](_0x2f258a)[_0xba9a('0x21')](handleEntityNotFound(_0x52db08,null))[_0xba9a('0x21')](respondWithResult(_0x52db08,null))[_0xba9a('0x2b')](handleError(_0x52db08,null));};exports[_0xba9a('0x5d')]=function(_0x35f30d,_0x13136b){return db[_0xba9a('0x41')]['create'](_0x35f30d['body'],{})[_0xba9a('0x21')](function(_0x40dce8){var _0x229147=_0x35f30d['user'][_0xba9a('0x5e')]({'plain':!![]});if(!_0x229147)throw new Error(_0xba9a('0x5f'));if(_0x229147[_0xba9a('0x60')]===_0xba9a('0x61')){var _0x361744=_0x40dce8[_0xba9a('0x5e')]({'plain':!![]});var _0x546db2=_0xba9a('0x3a');return db['UserProfileSection'][_0xba9a('0x5c')]({'where':{'name':_0x546db2,'userProfileId':_0x229147[_0xba9a('0x62')]},'raw':!![]})[_0xba9a('0x21')](function(_0x18a01d){if(_0x18a01d&&_0x18a01d['autoAssociation']===0x0){return db['UserProfileResource'][_0xba9a('0x5d')]({'name':_0x361744[_0xba9a('0x3c')],'resourceId':_0x361744['id'],'type':_0x18a01d[_0xba9a('0x3c')],'sectionId':_0x18a01d['id']},{})[_0xba9a('0x21')](function(){return _0x40dce8;});}else{return _0x40dce8;}})[_0xba9a('0x2b')](function(_0x214967){logger[_0xba9a('0x27')](_0xba9a('0x63'),_0x214967);throw _0x214967;});}return _0x40dce8;})[_0xba9a('0x21')](respondWithResult(_0x13136b,0xc9))[_0xba9a('0x2b')](handleError(_0x13136b,null));};exports[_0xba9a('0x38')]=function(_0x57eac2,_0x39cee3){if(_0x57eac2['body']['id']){delete _0x57eac2[_0xba9a('0x64')]['id'];}return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x57eac2[_0xba9a('0x65')]['id']},'include':[{'model':db[_0xba9a('0x3e')],'as':_0xba9a('0x3f')}]})[_0xba9a('0x21')](handleEntityNotFound(_0x39cee3,null))['then'](saveUpdates(_0x57eac2[_0xba9a('0x64')],null))[_0xba9a('0x21')](respondWithResult(_0x39cee3,null))['catch'](handleError(_0x39cee3,null));};exports[_0xba9a('0x39')]=function(_0x3f4586,_0x259955){return db['SmsAccount'][_0xba9a('0x5c')]({'where':{'id':_0x3f4586['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x259955,null))[_0xba9a('0x21')](removeEntity(_0x259955,null))[_0xba9a('0x2b')](handleError(_0x259955,null));};exports[_0xba9a('0x66')]=function(_0xe10a77,_0x377b50){return db[_0xba9a('0x41')][_0xba9a('0x66')]()[_0xba9a('0x21')](respondWithResult(_0x377b50,null))['catch'](handleError(_0x377b50,null));};exports[_0xba9a('0x67')]=function(_0x2ab83c,_0x1a9ebb,_0x24e1db){if(_0x2ab83c[_0xba9a('0x64')]['id']){delete _0x2ab83c[_0xba9a('0x64')]['id'];}return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x2ab83c[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x1a9ebb,null))[_0xba9a('0x21')](function(_0x24b98c){if(_0x24b98c){_0x2ab83c[_0xba9a('0x64')][_0xba9a('0x68')]=_0x24b98c['id'];return db[_0xba9a('0x69')]['create'](_0x2ab83c[_0xba9a('0x64')]);}})[_0xba9a('0x21')](respondWithResult(_0x1a9ebb,null))['catch'](handleError(_0x1a9ebb,null));};exports[_0xba9a('0x6a')]=function(_0x37b513,_0x451cc5,_0x428198){var _0x4e0620={'raw':![],'where':{}};var _0x205f08={};var _0x31ffd3={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x37b513[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x451cc5,null))[_0xba9a('0x21')](function(_0x1c4b97){if(_0x1c4b97){_0x205f08[_0xba9a('0x46')]=_['keys'](db[_0xba9a('0x69')][_0xba9a('0x42')]);_0x205f08['query']=_[_0xba9a('0x48')](_0x37b513[_0xba9a('0x47')]);_0x205f08[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x205f08['model'],_0x205f08[_0xba9a('0x47')]);_0x4e0620[_0xba9a('0x49')]=_['intersection'](_0x205f08[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x37b513[_0xba9a('0x47')][_0xba9a('0x4b')]));_0x4e0620['attributes']=_0x4e0620['attributes']['length']?_0x4e0620[_0xba9a('0x49')]:_0x205f08['model'];if(!_0x37b513[_0xba9a('0x47')]['hasOwnProperty']('nolimit')){_0x4e0620[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x37b513[_0xba9a('0x47')]['limit']);_0x4e0620[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x37b513[_0xba9a('0x47')][_0xba9a('0x30')]);}_0x4e0620[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x37b513[_0xba9a('0x47')]['sort']);_0x4e0620[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x37b513[_0xba9a('0x47')],_0x205f08[_0xba9a('0x53')]));_0x4e0620['where'][_0xba9a('0x68')]=_0x1c4b97['id'];if(_0x37b513[_0xba9a('0x47')][_0xba9a('0x54')]){_0x4e0620[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x4e0620[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x4e0620[_0xba9a('0x49')],function(_0x364d4a){var _0x4489e5={};_0x4489e5[_0x364d4a]={'$like':'%'+_0x37b513['query']['filter']+'%'};return _0x4489e5;})});}_0x4e0620=_['merge']({},_0x4e0620,_0x37b513[_0xba9a('0x56')]);return db[_0xba9a('0x69')]['count']({'where':_0x4e0620[_0xba9a('0x51')]})['then'](function(_0x3709b8){_0x31ffd3[_0xba9a('0x33')]=_0x3709b8;if(_0x37b513[_0xba9a('0x47')][_0xba9a('0x5b')]){_0x4e0620[_0xba9a('0x57')]=[{'all':!![]}];}return db[_0xba9a('0x69')][_0xba9a('0x58')](_0x4e0620);})[_0xba9a('0x21')](function(_0x5723ff){_0x31ffd3[_0xba9a('0x59')]=_0x5723ff;return _0x31ffd3;});}})[_0xba9a('0x21')](respondWithFilteredResult(_0x451cc5,_0x4e0620))[_0xba9a('0x2b')](handleError(_0x451cc5,null));};exports[_0xba9a('0x6b')]=function(_0x162f60,_0x470fd3,_0x1bcbb3){return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x162f60[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x470fd3,null))[_0xba9a('0x21')](function(_0x222fb8){if(_0x222fb8){return _0x222fb8[_0xba9a('0x6b')](_0x162f60['query'][_0xba9a('0x6c')]);}})[_0xba9a('0x21')](respondWithStatusCode(_0x470fd3,null))[_0xba9a('0x2b')](handleError(_0x470fd3,null));};exports[_0xba9a('0x6d')]=function(_0x529bb8,_0x189142,_0x15c0f6){if(_0x529bb8['body']['id']){delete _0x529bb8[_0xba9a('0x64')]['id'];}return db[_0xba9a('0x41')]['find']({'where':{'id':_0x529bb8['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x189142,null))[_0xba9a('0x21')](function(_0xef5ec4){if(_0xef5ec4){_0x529bb8[_0xba9a('0x64')][_0xba9a('0x68')]=_0xef5ec4['id'];return db[_0xba9a('0x6e')][_0xba9a('0x5d')](_0x529bb8[_0xba9a('0x64')]);}})[_0xba9a('0x21')](respondWithResult(_0x189142,null))[_0xba9a('0x2b')](handleError(_0x189142,null));};exports[_0xba9a('0x6f')]=function(_0x26d0c2,_0x58e6e0,_0x4e7d44){var _0x5d8cb0={'raw':![],'where':{}};var _0x45ebcd={};var _0x2dc3b9={'count':0x0,'rows':[]};return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x26d0c2[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x58e6e0,null))['then'](function(_0x5357d6){if(_0x5357d6){_0x45ebcd[_0xba9a('0x46')]=_['keys'](db[_0xba9a('0x6e')]['rawAttributes']);_0x45ebcd['query']=_[_0xba9a('0x48')](_0x26d0c2['query']);_0x45ebcd[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x45ebcd[_0xba9a('0x46')],_0x45ebcd['query']);_0x5d8cb0['attributes']=_[_0xba9a('0x4a')](_0x45ebcd[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x4b')]));_0x5d8cb0[_0xba9a('0x49')]=_0x5d8cb0[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x5d8cb0[_0xba9a('0x49')]:_0x45ebcd[_0xba9a('0x46')];if(!_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x4d')](_0xba9a('0x4e'))){_0x5d8cb0[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x32')]);_0x5d8cb0[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x30')]);}_0x5d8cb0[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x50')]);_0x5d8cb0[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x26d0c2['query'],_0x45ebcd[_0xba9a('0x53')]));_0x5d8cb0[_0xba9a('0x51')]['SmsAccountId']=_0x5357d6['id'];if(_0x26d0c2[_0xba9a('0x47')][_0xba9a('0x54')]){_0x5d8cb0['where']=_[_0xba9a('0x55')](_0x5d8cb0[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x5d8cb0[_0xba9a('0x49')],function(_0x3f7d1e){var _0xa24c9e={};_0xa24c9e[_0x3f7d1e]={'$like':'%'+_0x26d0c2[_0xba9a('0x47')]['filter']+'%'};return _0xa24c9e;})});}_0x5d8cb0=_[_0xba9a('0x55')]({},_0x5d8cb0,_0x26d0c2[_0xba9a('0x56')]);return db['CannedAnswer'][_0xba9a('0x33')]({'where':_0x5d8cb0[_0xba9a('0x51')]})[_0xba9a('0x21')](function(_0x531fad){_0x2dc3b9[_0xba9a('0x33')]=_0x531fad;if(_0x26d0c2['query'][_0xba9a('0x5b')]){_0x5d8cb0[_0xba9a('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0xba9a('0x58')](_0x5d8cb0);})['then'](function(_0x296a81){_0x2dc3b9[_0xba9a('0x59')]=_0x296a81;return _0x2dc3b9;});}})[_0xba9a('0x21')](respondWithFilteredResult(_0x58e6e0,_0x5d8cb0))[_0xba9a('0x2b')](handleError(_0x58e6e0,null));};exports[_0xba9a('0x71')]=function(_0x8310cf,_0x46b1cf,_0x3ae881){return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x8310cf['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x46b1cf,null))[_0xba9a('0x21')](function(_0x5d5355){if(_0x5d5355){return _0x5d5355[_0xba9a('0x71')](_0x8310cf[_0xba9a('0x47')][_0xba9a('0x6c')]);}})[_0xba9a('0x21')](respondWithStatusCode(_0x46b1cf,null))['catch'](handleError(_0x46b1cf,null));};exports[_0xba9a('0x72')]=function(_0x456c24,_0x157842,_0x33ff9f){var _0x2d26a2={'channel':_0xba9a('0x73')};var _0x32b730=[];var _0x5dd6b6=[];var _0x251f33={};return db[_0xba9a('0x41')]['find']({'where':{'id':_0x456c24[_0xba9a('0x65')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0xba9a('0x21')](handleEntityNotFound(_0x157842,null))[_0xba9a('0x21')](function(_0x105071){_0x2d26a2['account']=_0x105071;_0x2d26a2[_0xba9a('0x74')]=_['orderBy'](_0x105071[_0xba9a('0x75')],[_0xba9a('0x76')],[_0xba9a('0x77')]);if(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x75')]){delete _0x2d26a2['account']['Applications'];}return db['CmContact'][_0xba9a('0x66')]();})[_0xba9a('0x21')](function(_0x3c5427){if(!_0x3c5427){throw new db[(_0xba9a('0x79'))]['ValidationError'](_0xba9a('0x7a'));}_0x32b730=_[_0xba9a('0x7b')](_[_0xba9a('0x48')](_0x3c5427),[_0xba9a('0x7c'),_0xba9a('0x7d')]);_0x5dd6b6=_[_0xba9a('0x7b')](_[_0xba9a('0x48')](_0x3c5427),['createdAt',_0xba9a('0x7d'),'CompanyId',_0xba9a('0x7e')]);_0x2d26a2[_0xba9a('0x64')]={'mapKey':_0xba9a('0x7f')};if(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x44')]){switch(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x44')]){case _0xba9a('0x80'):_0x2d26a2['body'][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x82')];_0x2d26a2[_0xba9a('0x64')]['body']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x83')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x85')];break;case _0xba9a('0x86'):_0x2d26a2[_0xba9a('0x64')]['from']='+'+_0x456c24[_0xba9a('0x64')][_0xba9a('0x87')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')]['text'];break;case'connectel':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24['body'][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24['body'][_0xba9a('0x29')];break;case _0xba9a('0x88'):_0x2d26a2['body'][_0xba9a('0x81')]=_0x456c24['body'][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')]['body'];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x89')];break;case'plivo':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x82')];_0x2d26a2['body'][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x8a')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x8b')];break;case _0xba9a('0x8c'):_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]='+'+_0x456c24['body']['results'][0x0][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')]['body']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x8d')][0x0]['text'];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')]['results'][0x0][_0xba9a('0x84')];break;case _0xba9a('0x8e'):_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24['body'][_0xba9a('0x8f')];_0x2d26a2[_0xba9a('0x64')]['body']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x90')][_0xba9a('0x29')];break;case _0xba9a('0x91'):_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x92')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')]['text'];_0x2d26a2['body']['messageId']=_0x456c24[_0xba9a('0x64')][_0xba9a('0x93')];break;case'bandwidth':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][0x0]['message']['id'];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')]=_0x456c24[_0xba9a('0x64')][0x0][_0xba9a('0x29')][_0xba9a('0x81')];_0x2d26a2['body'][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')][0x0][_0xba9a('0x29')][_0xba9a('0x94')];break;case'intelepeer':_0x2d26a2[_0xba9a('0x64')]['from']=_0x456c24['body'][_0xba9a('0x81')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x64')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x29')];_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x84')]=_0x456c24[_0xba9a('0x64')][_0xba9a('0x95')];break;}}if(_0x2d26a2[_0xba9a('0x64')]['id']){delete _0x2d26a2[_0xba9a('0x64')]['id'];}if(_[_0xba9a('0x96')](_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')])){throw new db[(_0xba9a('0x79'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xba9a('0x96')](_0x2d26a2[_0xba9a('0x64')]['body'])||_0x2d26a2['body'][_0xba9a('0x64')]===''){throw new db['Sequelize'][(_0xba9a('0x97'))](_0xba9a('0x98'));}if(_[_0xba9a('0x96')](_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x99')])){throw new db[(_0xba9a('0x79'))][(_0xba9a('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dd6b6);}if(!_[_0xba9a('0x9a')](_0x5dd6b6,_0x2d26a2['body'][_0xba9a('0x99')])){throw new db[(_0xba9a('0x79'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5dd6b6);}_0x251f33[_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x99')]]=_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')];return db[_0xba9a('0x9b')]['find']({'where':{'id':_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x7e')]},'include':[{'model':db[_0xba9a('0x9c')],'as':_0xba9a('0x9d'),'where':_0x251f33,'limit':0x1,'order':[[_0xba9a('0x7d'),'DESC']]}]});})[_0xba9a('0x21')](handleEntityNotFound(_0x157842,null))[_0xba9a('0x21')](function(_0x4ff122){if(_0x4ff122){_0x2d26a2[_0xba9a('0x9e')]=_[_0xba9a('0x9f')](_0x4ff122,[_0xba9a('0x9d')]);if(_0x4ff122[_0xba9a('0x9d')]['length']){return _0x4ff122[_0xba9a('0x9d')][0x0];}var _0x180e12=_[_0xba9a('0x1b')](_0x2d26a2[_0xba9a('0x64')],{'firstName':_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x81')],'ListId':_0x4ff122['id']});_0x180e12[_0x2d26a2[_0xba9a('0x64')][_0xba9a('0x99')]]=_0x2d26a2[_0xba9a('0x64')]['from'];return db['CmContact'][_0xba9a('0x5d')](_0x180e12,{'fields':_0x32b730,'raw':!![]});}})[_0xba9a('0x21')](handleEntityNotFound(_0x157842,null))[_0xba9a('0x21')](function(_0x200a9e){if(_0x200a9e){_0x2d26a2['contact']=_0x200a9e;var _0xf26a73={'ContactId':_0x200a9e['id'],'phone':_0x2d26a2[_0xba9a('0x64')]['from'],'SmsAccountId':_0x456c24[_0xba9a('0x65')]['id']};var _0x45186f={'ContactId':_0x200a9e['id'],'SmsAccountId':_0x456c24[_0xba9a('0x65')]['id'],'closed':![]};return db[_0xba9a('0xa0')][_0xba9a('0x5c')]({'where':_0x45186f})[_0xba9a('0x21')](function(_0x2707ed){if(_0x2707ed){return[_0x2707ed,![]];}return db[_0xba9a('0xa0')]['create'](_0xf26a73)[_0xba9a('0x21')](function(_0x5eb76b){return[_0x5eb76b,!![]];});});}})[_0xba9a('0xa1')](function(_0x2fe51e,_0x21c59a){_0x2d26a2['interaction']=_0x2fe51e['get']({'plain':!![]});_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa3')]=![];if(_0x21c59a){if(_0x2d26a2['account'][_0xba9a('0xa4')]){_0x2d26a2['applications'][_0xba9a('0xa5')]({'id':0x0,'priority':_0x2d26a2[_0xba9a('0x74')]['length']+0x1,'app':_0xba9a('0xa6'),'appdata':'unmanaged','interval':_0xba9a('0xa7')});}_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa3')]=!![];}return db[_0xba9a('0xa8')][_0xba9a('0x5d')]({'phone':_0x2d26a2[_0xba9a('0x64')]['from'],'messageId':_0x2d26a2['body'][_0xba9a('0x84')],'body':_0x2d26a2['body'][_0xba9a('0x64')],'SmsAccountId':_0x456c24[_0xba9a('0x65')]['id'],'SmsInteractionId':_0x2fe51e['id'],'direction':'in','ContactId':_0x2fe51e['ContactId'],'AttachmentId':_0x2d26a2[_0xba9a('0x64')]['AttachmentId']});})['then'](function(_0x4205e1){_0x2d26a2[_0xba9a('0x29')]=_0x4205e1;if(_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa9')]){return db[_0xba9a('0xaa')]['find']({'attributes':['id',_0xba9a('0x3c')],'where':{'id':_0x2d26a2[_0xba9a('0xa2')][_0xba9a('0xa9')]}})['then'](function(_0x4e3e8a){if(_0x4e3e8a){_0x2d26a2[_0xba9a('0x74')][_0xba9a('0xab')]({'id':0x0,'priority':0x0,'app':_0xba9a('0xac'),'appdata':_0x4e3e8a[_0xba9a('0x3c')]+','+(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0xad')]||0xa),'interval':_0xba9a('0xa7')});}return respondWithRpcPromise('Start','startRouting',_0x2d26a2);});}return respondWithRpcPromise(_0xba9a('0xae'),_0xba9a('0xaf'),_0x2d26a2);})[_0xba9a('0x21')](function(_0x306398){if(_0x306398){var _0x312920=0xc8;var _0x3953f7=_0xba9a('0xb0');logger['info'](_0xba9a('0x25'),_0x3953f7,_0x312920,'entity\x20found');logger[_0xba9a('0xb1')](_0xba9a('0xb2'),_0x3953f7,_0x312920,_0xba9a('0xb3'),JSON[_0xba9a('0x26')](_0x306398));if(_0x2d26a2[_0xba9a('0x78')][_0xba9a('0x44')]===_0xba9a('0x80')){return _0x157842[_0xba9a('0x2d')](_0x312920)['set'](_0xba9a('0xb4'),_0xba9a('0xb5'))[_0xba9a('0x3d')](_0xba9a('0xb6'));}else{return _0x157842[_0xba9a('0x2d')](_0x312920)[_0xba9a('0x2f')](_0x306398);}}})[_0xba9a('0x2b')](handleError(_0x157842,null));};exports[_0xba9a('0xb7')]=function(_0x5188ca,_0x1d3e36){var _0x288da9=_0x5188ca[_0xba9a('0x65')]['id'];var _0x5c7128=_0x5188ca['body'];var _0x51e79a=0xc8;var _0x5e4574=null;return db[_0xba9a('0xb8')]['transaction']({'isolationLevel':db['sequelize'][_0xba9a('0xb9')][_0xba9a('0xba')]['READ_COMMITTED']},function(_0x1ccc32){return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x288da9},'transaction':_0x1ccc32})['then'](function(_0xe59787){if(_0xe59787){return db[_0xba9a('0xbb')][_0xba9a('0x39')]({'where':{'SmsAccountId':_0x288da9},'transaction':_0x1ccc32})[_0xba9a('0x21')](function(){var _0x4f073a=_[_0xba9a('0x40')](_0x5c7128,function(_0x2c2e0b){_0x2c2e0b[_0xba9a('0x68')]=_0x288da9;return _0x2c2e0b;});return db['SmsApplication']['bulkCreate'](_0x4f073a,{'transaction':_0x1ccc32});});}else{_0x51e79a=0x194;_0x5e4574=[];}});})[_0xba9a('0x21')](function(){if(_0x51e79a!==0x194){return db[_0xba9a('0xbb')][_0xba9a('0xbc')]({'where':{'SmsAccountId':_0x288da9},'order':_0xba9a('0x76')})[_0xba9a('0x21')](function(_0x2c1a7e){_0x5e4574=_0x2c1a7e;});}})['catch'](function(_0x1ad91e){_0x51e79a=0x1f4;logger[_0xba9a('0x27')](_0x1ad91e[_0xba9a('0x3b')]);if(_0x1ad91e[_0xba9a('0x3c')]){delete _0x1ad91e[_0xba9a('0x3c')];}_0x5e4574=_0x1ad91e;})[_0xba9a('0xbd')](function(){if(_0x5e4574===null){_0x1d3e36[_0xba9a('0x2c')](_0x51e79a);}else{if(_0x51e79a===0x1f4){_0x1d3e36[_0xba9a('0x2d')](_0x51e79a)['send'](_0x5e4574);}else{_0x1d3e36[_0xba9a('0x2d')](_0x51e79a)['json'](_0x5e4574);}}});};exports[_0xba9a('0xbe')]=function(_0x3d0767,_0x5191af,_0x2aa2ec){var _0x58f071={};var _0x36174b={};var _0x4e691a;var _0x3a48e8;return db[_0xba9a('0x41')]['findOne']({'where':{'id':_0x3d0767[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x5191af,null))[_0xba9a('0x21')](function(_0x3e3024){if(_0x3e3024){_0x4e691a=_0x3e3024;_0x36174b[_0xba9a('0x46')]=_[_0xba9a('0x48')](db[_0xba9a('0xbb')][_0xba9a('0x42')]);_0x36174b['query']=_[_0xba9a('0x48')](_0x3d0767[_0xba9a('0x47')]);_0x36174b[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x36174b[_0xba9a('0x46')],_0x36174b[_0xba9a('0x47')]);_0x58f071[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x36174b[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x3d0767['query'][_0xba9a('0x4b')]));_0x58f071[_0xba9a('0x49')]=_0x58f071[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x58f071[_0xba9a('0x49')]:_0x36174b[_0xba9a('0x46')];_0x58f071[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x3d0767['query'][_0xba9a('0x50')]);_0x58f071[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x3d0767[_0xba9a('0x47')],_0x36174b[_0xba9a('0x53')]));if(_0x3d0767[_0xba9a('0x47')][_0xba9a('0x54')]){_0x58f071[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x58f071[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x58f071[_0xba9a('0x49')],function(_0x252789){var _0x1c9137={};_0x1c9137[_0x252789]={'$like':'%'+_0x3d0767['query'][_0xba9a('0x54')]+'%'};return _0x1c9137;})});}_0x58f071=_[_0xba9a('0x55')]({},_0x58f071,_0x3d0767[_0xba9a('0x56')]);return _0x4e691a[_0xba9a('0xbe')](_0x58f071);}})[_0xba9a('0x21')](function(_0x41433f){if(_0x41433f){_0x3a48e8=_0x41433f[_0xba9a('0x4c')];if(!_0x3d0767['query'][_0xba9a('0x4d')]('nolimit')){_0x58f071[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x3d0767[_0xba9a('0x47')][_0xba9a('0x32')]);_0x58f071[_0xba9a('0x30')]=qs['offset'](_0x3d0767['query'][_0xba9a('0x30')]);}return _0x4e691a[_0xba9a('0xbe')](_0x58f071);}})['then'](function(_0x44c26c){if(_0x44c26c){return _0x44c26c?{'count':_0x3a48e8,'rows':_0x44c26c}:null;}})[_0xba9a('0x21')](respondWithResult(_0x5191af,null))[_0xba9a('0x2b')](handleError(_0x5191af,null));};exports[_0xba9a('0xbf')]=function(_0x583ff8,_0x4eeb7e,_0x5973ff){var _0x193359={'raw':![],'where':{}};var _0x1cc0bb={};var _0x1de338={'count':0x0,'rows':[]};return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x583ff8[_0xba9a('0x65')]['id']}})['then'](handleEntityNotFound(_0x4eeb7e,null))[_0xba9a('0x21')](function(_0x50d42b){if(_0x50d42b){_0x1cc0bb[_0xba9a('0x46')]=_['keys'](db['SmsInteraction'][_0xba9a('0x42')]);_0x1cc0bb[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x583ff8[_0xba9a('0x47')]);_0x1cc0bb[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x1cc0bb[_0xba9a('0x46')],_0x1cc0bb[_0xba9a('0x47')]);_0x193359[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x1cc0bb[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x583ff8[_0xba9a('0x47')][_0xba9a('0x4b')]));_0x193359[_0xba9a('0x49')]=_0x193359[_0xba9a('0x49')][_0xba9a('0x4c')]?_0x193359[_0xba9a('0x49')]:_0x1cc0bb[_0xba9a('0x46')];if(!_0x583ff8[_0xba9a('0x47')]['hasOwnProperty'](_0xba9a('0x4e'))){_0x193359[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x583ff8['query'][_0xba9a('0x32')]);_0x193359['offset']=qs[_0xba9a('0x30')](_0x583ff8[_0xba9a('0x47')][_0xba9a('0x30')]);}_0x193359['order']=qs[_0xba9a('0x50')](_0x583ff8[_0xba9a('0x47')]['sort']);_0x193359[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x583ff8[_0xba9a('0x47')],_0x1cc0bb[_0xba9a('0x53')]));_0x193359[_0xba9a('0x51')][_0xba9a('0x68')]=_0x50d42b['id'];if(_0x583ff8['query'][_0xba9a('0x54')]){_0x193359[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x193359[_0xba9a('0x51')],{'$or':_[_0xba9a('0x40')](_0x193359[_0xba9a('0x49')],function(_0x29b373){var _0x3692c4={};_0x3692c4[_0x29b373]={'$like':'%'+_0x583ff8[_0xba9a('0x47')]['filter']+'%'};return _0x3692c4;})});}_0x193359=_[_0xba9a('0x55')]({},_0x193359,_0x583ff8[_0xba9a('0x56')]);return db['SmsInteraction']['count']({'where':_0x193359['where']})['then'](function(_0x1a2fea){_0x1de338[_0xba9a('0x33')]=_0x1a2fea;if(_0x583ff8[_0xba9a('0x47')]['includeAll']){_0x193359[_0xba9a('0x57')]=[{'model':db['CmContact'],'as':_0xba9a('0xc0'),'required':![]},{'model':db[_0xba9a('0xaa')],'as':_0xba9a('0xc1'),'attributes':[_0xba9a('0x3c'),'fullname',_0xba9a('0xc2')],'required':![]},{'model':db[_0xba9a('0xc3')],'as':_0xba9a('0xc4'),'attributes':['id','name','color'],'where':_0x583ff8[_0xba9a('0x47')]['tag']?{'id':_0x583ff8[_0xba9a('0x47')]['tag']}:undefined,'required':_0x583ff8[_0xba9a('0x47')][_0xba9a('0xc5')]?!![]:![]}];}return db['SmsInteraction'][_0xba9a('0x58')](_0x193359);})['then'](function(_0x563322){_0x1de338[_0xba9a('0x59')]=_0x563322;return _0x1de338;});}})[_0xba9a('0x21')](respondWithFilteredResult(_0x4eeb7e,_0x193359))[_0xba9a('0x2b')](handleError(_0x4eeb7e,null));};exports[_0xba9a('0x3d')]=function(_0x1a1c22,_0x46e4d4,_0x2291be){var _0x275aac,_0x1e198a,_0x43df43;if(_[_0xba9a('0x96')](_0x1a1c22[_0xba9a('0x64')][_0xba9a('0x64')])||_0x1a1c22[_0xba9a('0x64')][_0xba9a('0x64')]===''){throw new db[(_0xba9a('0x79'))][(_0xba9a('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1a1c22[_0xba9a('0x64')]['to'])){throw new db[(_0xba9a('0x79'))]['ValidationError']('to\x20is\x20mandatory');}_0x275aac=_0x1a1c22['body']['to'];return db[_0xba9a('0x41')]['find']({'where':{'id':_0x1a1c22[_0xba9a('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0xba9a('0xc6'),'include':[{'model':db[_0xba9a('0x9c')],'as':_0xba9a('0x9d'),'where':{'mobile':_0x275aac},'limit':0x1,'order':[[_0xba9a('0x7d'),_0xba9a('0xc7')]]}]}]})[_0xba9a('0x21')](handleEntityNotFound(_0x46e4d4,null))[_0xba9a('0x21')](function(_0x53e7b5){if(_0x53e7b5&&_0x53e7b5['List']){_0x1e198a=_0x53e7b5[_0xba9a('0x5e')]({'plain':!![]});if(_0x1e198a[_0xba9a('0xc6')]&&_0x1e198a[_0xba9a('0xc6')][_0xba9a('0x9d')][_0xba9a('0x4c')]){return _0x1e198a['List']['Contacts'][0x0];}return db[_0xba9a('0x9c')][_0xba9a('0x5d')](_[_0xba9a('0x1b')](_0x1a1c22['body'],{'firstName':_0x275aac,'mobile':_0x275aac,'phone':_0x275aac,'ListId':_0x1e198a[_0xba9a('0x7e')]}));}})[_0xba9a('0x21')](handleEntityNotFound(_0x46e4d4,null))[_0xba9a('0x21')](function(_0x21aa38){if(_0x21aa38){_0x43df43=_0x21aa38;return db[_0xba9a('0xa0')][_0xba9a('0x5c')]({'where':{'ContactId':_0x43df43['id'],'closed':![],'SmsAccountId':_0x1e198a['id']}})[_0xba9a('0x21')](function(_0x2f7a86){if(_0x2f7a86){return[_0x2f7a86,![]];}return db[_0xba9a('0xa0')][_0xba9a('0x5d')]({'UserId':_0x1a1c22[_0xba9a('0x61')]['id'],'ContactId':_0x43df43['id'],'SmsAccountId':_0x1e198a['id'],'phone':_0x275aac,'firstMsgDirection':'out','Messages':[_[_0xba9a('0x55')](_0x1a1c22['body'],{'read':![],'body':_0x1a1c22['body'][_0xba9a('0x64')],'phone':_0x275aac,'SmsAccountId':_0x1e198a['id'],'UserId':_0x1a1c22['user']['id'],'ContactId':_0x43df43['id']})]},{'include':[{'model':db[_0xba9a('0xa8')],'as':_0xba9a('0xc8')}]})['then'](function(_0x54706e){return[_0x54706e,!![]];});});}})[_0xba9a('0xa1')](function(_0x53e8ef,_0x5a92a0){if(_0x5a92a0){return _0x53e8ef;}return db[_0xba9a('0xa8')][_0xba9a('0x5d')](_['merge'](_0x1a1c22[_0xba9a('0x64')],{'read':![],'body':_0x1a1c22[_0xba9a('0x64')]['body'],'phone':_0x275aac,'SmsAccountId':_0x1e198a['id'],'SmsInteractionId':_0x53e8ef['id'],'UserId':_0x1a1c22[_0xba9a('0x61')]['id'],'ContactId':_0x43df43['id']}))[_0xba9a('0x21')](function(_0x19c3d8){_0x53e8ef[_0xba9a('0xc9')][_0xba9a('0xc8')]=[];_0x53e8ef['dataValues'][_0xba9a('0xc8')]['push'](_0x19c3d8['dataValues']);return _0x53e8ef;});})[_0xba9a('0x21')](respondWithResult(_0x46e4d4,null))[_0xba9a('0x2b')](handleError(_0x46e4d4,null));};exports[_0xba9a('0x2d')]=function(_0xb0297c,_0x5713de,_0x70ea29){if(_0xb0297c[_0xba9a('0x64')]['id']){delete _0xb0297c[_0xba9a('0x64')]['id'];}var _0xb1c4d3,_0x3b3367,_0x359a9d;return db['SmsAccount'][_0xba9a('0x5c')]({'where':{'id':_0xb0297c[_0xba9a('0x65')]['id']}})['then'](handleEntityNotFound(_0x5713de,null))[_0xba9a('0x21')](function(_0x5bfb35){if(_0x5bfb35){_0x359a9d=_0x5bfb35;logger['debug'](_0xba9a('0x25'),'status',_0xba9a('0xca'),_0x5bfb35['type'],util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));switch(_0x5bfb35[_0xba9a('0x44')]){case _0xba9a('0x86'):if(_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcc')]&&_0xb0297c['body'][_0xba9a('0x2d')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x2d')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcc')]}});}break;case _0xba9a('0xcd'):if(_0xb0297c[_0xba9a('0x64')][_0xba9a('0xce')]&&_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcf')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0xcf')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')][_0xba9a('0xce')]}});}break;case _0xba9a('0x88'):if(_0xb0297c['body']['message_id']&&_0xb0297c[_0xba9a('0x64')]['status_code']){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0xd0')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')][_0xba9a('0x89')]}});}break;case _0xba9a('0x8c'):var _0xf2dd5c=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x8d')][0x0];if(_0xf2dd5c[_0xba9a('0x84')]&&_0xf2dd5c[_0xba9a('0x2d')]['groupName']===_0xba9a('0xd1')){_0x3b3367=_0xf2dd5c['status'][_0xba9a('0xd2')];return db[_0xba9a('0xa8')]['find']({'where':{'messageId':_0xf2dd5c['messageId']}});}break;case _0xba9a('0x91'):if(_0xb0297c[_0xba9a('0x64')][_0xba9a('0x84')]&&_0xb0297c[_0xba9a('0x64')][_0xba9a('0x2d')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x2d')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c['body'][_0xba9a('0x84')]}});}break;case _0xba9a('0xd3'):if(_0xb0297c[_0xba9a('0x64')][0x0][_0xba9a('0x29')]['id']){_0x3b3367=_0xb0297c['body'][0x0][_0xba9a('0x44')];return db[_0xba9a('0xa8')]['find']({'where':{'messageId':_0xb0297c['body'][0x0][_0xba9a('0x29')]['id']}});}break;case _0xba9a('0xd4'):if(_0xb0297c['body'][_0xba9a('0xd5')]&&_0xb0297c['body'][_0xba9a('0x2d')]){_0x3b3367=_0xb0297c[_0xba9a('0x64')]['status'];return db['SmsMessage'][_0xba9a('0x5c')]({'where':{'messageId':_0xb0297c[_0xba9a('0x64')]['redif']}});}break;}}})[_0xba9a('0x21')](handleEntityNotFound(_0x5713de,null))[_0xba9a('0x21')](function(_0x12c420){if(_0x12c420){_0xb1c4d3=_0x12c420;switch(_0x359a9d[_0xba9a('0x44')]){case'skebby':if(_0x3b3367==='DELIVERED'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),'status','skebby',util[_0xba9a('0xcb')](_0xb0297c['body'],{'showHidden':![],'depth':null}));}break;case _0xba9a('0xcd'):if(_0x3b3367==='1'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0x86'),util['inspect'](_0xb0297c['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0xb0297c[_0xba9a('0x64')][_0xba9a('0xd6')]&&_0x3b3367>=0xc8&&_0x3b3367<=0xce){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error'](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0x88'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case _0xba9a('0x8c'):var _0x52add8=_0xb0297c[_0xba9a('0x64')][_0xba9a('0x8d')][0x0];if(_0x52add8[_0xba9a('0x2d')][_0xba9a('0xd2')]==='DELIVERED'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0x8c'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case _0xba9a('0x91'):if(_0x3b3367=='DELIVERED_TO_GATEWAY'||_0x3b3367==_0xba9a('0xd7')){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xba9a('0x91'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3b3367=='message-delivered'){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error'](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0xd3'),util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3b3367==='DELIVRD'||_0x3b3367===_0xba9a('0xd8')){return _0xb1c4d3[_0xba9a('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util[_0xba9a('0xcb')](_0xb0297c[_0xba9a('0x64')],{'showHidden':![],'depth':null}));}break;}return _0xb1c4d3;}})['then'](respondWithResult(_0x5713de,null))['catch'](handleError(_0x5713de,null));};exports[_0xba9a('0xd9')]=function(_0x210495,_0xecb5c1,_0x21e267){var _0x19c1be,_0x2882f3,_0x21ae15;return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x210495[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0xecb5c1,null))[_0xba9a('0x21')](function(_0x103837){if(_0x103837){_0x21ae15=_0x103837;logger[_0xba9a('0xb1')](_0xba9a('0x25'),_0xba9a('0x2d'),_0xba9a('0xca'),_0x103837[_0xba9a('0x44')],util[_0xba9a('0xcb')](_0x210495[_0xba9a('0x47')],{'showHidden':![],'depth':null}));switch(_0x103837['type']){case'csc':if(_0x210495[_0xba9a('0x47')]['message-id']&&_0x210495['query'][_0xba9a('0xda')]){_0x2882f3=_0x210495[_0xba9a('0x47')][_0xba9a('0xda')];return db[_0xba9a('0xa8')][_0xba9a('0x5c')]({'where':{'messageId':_0x210495[_0xba9a('0x47')][_0xba9a('0xdb')]}});}break;}}})[_0xba9a('0x21')](handleEntityNotFound(_0xecb5c1,null))['then'](function(_0x12af54){if(_0x12af54){_0x19c1be=_0x12af54;switch(_0x21ae15[_0xba9a('0x44')]){case'csc':if(_0x2882f3==='2'||_0x2882f3==='6'){return _0x19c1be[_0xba9a('0x38')]({'read':!![]});}else{logger[_0xba9a('0x27')](_0xba9a('0x25'),'status',_0xba9a('0x8e'),util['inspect'](_0x210495[_0xba9a('0x47')],{'showHidden':![],'depth':null}));};break;}return _0x19c1be;}})[_0xba9a('0x21')](respondWithResult(_0xecb5c1,null))[_0xba9a('0x2b')](handleError(_0xecb5c1,null));};exports[_0xba9a('0xdc')]=function(_0x205868,_0x64a758,_0x4fecc0){return db['SmsAccount'][_0xba9a('0x5c')]({'where':{'id':_0x205868[_0xba9a('0x65')]['id']}})['then'](handleEntityNotFound(_0x64a758,null))['then'](function(_0x4e52c9){if(_0x4e52c9){return _0x4e52c9[_0xba9a('0xdc')](_0x205868['body']['ids'],_[_0xba9a('0x9f')](_0x205868['body'],[_0xba9a('0x6c'),'id'])||{})['spread'](function(_0x1a4ce6){for(var _0x1367a6=0x0;_0x1367a6<_0x205868[_0xba9a('0x64')]['ids'][_0xba9a('0x4c')];_0x1367a6+=0x1){socket[_0xba9a('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x205868[_0xba9a('0x64')]['ids'][_0x1367a6]),'SmsAccountId':Number(_0x205868[_0xba9a('0x65')]['id'])});}return _0x1a4ce6;});}})[_0xba9a('0x21')](respondWithResult(_0x64a758,null))[_0xba9a('0x2b')](handleError(_0x64a758,null));};exports['removeAgents']=function(_0x459940,_0x5b5d1a,_0x1798fc){return db[_0xba9a('0x41')][_0xba9a('0x5c')]({'where':{'id':_0x459940[_0xba9a('0x65')]['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x5b5d1a,null))[_0xba9a('0x21')](function(_0x5295b8){if(_0x5295b8){return _0x5295b8[_0xba9a('0xde')](_0x459940[_0xba9a('0x47')][_0xba9a('0x6c')])['then'](function(){if(_[_0xba9a('0xdf')](_0x459940[_0xba9a('0x47')][_0xba9a('0x6c')])){for(var _0x183297=0x0;_0x183297<_0x459940['query'][_0xba9a('0x6c')]['length'];_0x183297+=0x1){socket[_0xba9a('0xdd')]('userSmsAccount:remove',{'UserId':Number(_0x459940['query'][_0xba9a('0x6c')][_0x183297]),'SmsAccountId':Number(_0x459940[_0xba9a('0x65')]['id'])});}}else{socket[_0xba9a('0xdd')](_0xba9a('0xe0'),{'UserId':Number(_0x459940[_0xba9a('0x47')][_0xba9a('0x6c')]),'SmsAccountId':Number(_0x459940[_0xba9a('0x65')]['id'])});}});}})[_0xba9a('0x21')](respondWithStatusCode(_0x5b5d1a,null))['catch'](handleError(_0x5b5d1a,null));};exports[_0xba9a('0xe1')]=function(_0x5aa2ba,_0x262cfb,_0x3c8cf2){var _0x4f972c={};var _0x522e80={};var _0x2b5c2b;var _0x4f2335;return db[_0xba9a('0x41')][_0xba9a('0x70')]({'where':{'id':_0x5aa2ba['params']['id']}})[_0xba9a('0x21')](handleEntityNotFound(_0x262cfb,null))['then'](function(_0x56d383){if(_0x56d383){_0x2b5c2b=_0x56d383;_0x522e80[_0xba9a('0x46')]=_[_0xba9a('0x48')](db['User']['rawAttributes']);_0x522e80[_0xba9a('0x47')]=_[_0xba9a('0x48')](_0x5aa2ba[_0xba9a('0x47')]);_0x522e80[_0xba9a('0x53')]=_[_0xba9a('0x4a')](_0x522e80['model'],_0x522e80['query']);_0x4f972c[_0xba9a('0x49')]=_[_0xba9a('0x4a')](_0x522e80[_0xba9a('0x46')],qs[_0xba9a('0x4b')](_0x5aa2ba[_0xba9a('0x47')]['fields']));_0x4f972c['attributes']=_0x4f972c[_0xba9a('0x49')]['length']?_0x4f972c[_0xba9a('0x49')]:_0x522e80[_0xba9a('0x46')];_0x4f972c[_0xba9a('0x4f')]=qs[_0xba9a('0x50')](_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x50')]);_0x4f972c[_0xba9a('0x51')]=qs[_0xba9a('0x53')](_[_0xba9a('0x52')](_0x5aa2ba[_0xba9a('0x47')],_0x522e80[_0xba9a('0x53')]));if(_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x54')]){_0x4f972c[_0xba9a('0x51')]=_[_0xba9a('0x55')](_0x4f972c['where'],{'$or':_[_0xba9a('0x40')](_0x4f972c[_0xba9a('0x49')],function(_0xdd3471){var _0x2fea25={};_0x2fea25[_0xdd3471]={'$like':'%'+_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x54')]+'%'};return _0x2fea25;})});}_0x4f972c=_[_0xba9a('0x55')]({},_0x4f972c,_0x5aa2ba[_0xba9a('0x56')]);return _0x2b5c2b[_0xba9a('0xe1')](_0x4f972c);}})[_0xba9a('0x21')](function(_0x36efee){if(_0x36efee){_0x4f2335=_0x36efee[_0xba9a('0x4c')];if(!_0x5aa2ba[_0xba9a('0x47')][_0xba9a('0x4d')](_0xba9a('0x4e'))){_0x4f972c[_0xba9a('0x32')]=qs[_0xba9a('0x32')](_0x5aa2ba[_0xba9a('0x47')]['limit']);_0x4f972c[_0xba9a('0x30')]=qs[_0xba9a('0x30')](_0x5aa2ba['query'][_0xba9a('0x30')]);}return _0x2b5c2b['getAgents'](_0x4f972c);}})[_0xba9a('0x21')](function(_0x2628d0){if(_0x2628d0){return _0x2628d0?{'count':_0x4f2335,'rows':_0x2628d0}:null;}})['then'](respondWithResult(_0x262cfb,null))[_0xba9a('0x2b')](handleError(_0x262cfb,null));};
\ No newline at end of file
index 1afd820..b7c5b5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf50=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdf50,0x14a));var _0x0df5=function(_0x4fa291,_0x56e289){_0x4fa291=_0x4fa291-0x0;var _0x506d9b=_0xdf50[_0x4fa291];return _0x506d9b;};'use strict';var EventEmitter=require(_0x0df5('0x0'));var SmsAccount=require(_0x0df5('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x0df5('0x2')](0x0);var events={'afterCreate':_0x0df5('0x3'),'afterUpdate':'update','afterDestroy':_0x0df5('0x4')};function emitEvent(_0x335066){return function(_0x11171b,_0x6bd121,_0x556068){SmsAccountEvents[_0x0df5('0x5')](_0x335066+':'+_0x11171b['id'],_0x11171b);SmsAccountEvents['emit'](_0x335066,_0x11171b);_0x556068(null);};}for(var e in events){if(events[_0x0df5('0x6')](e)){var event=events[e];SmsAccount[_0x0df5('0x7')](e,emitEvent(event));}}module[_0x0df5('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x2c12=['emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','update','remove'];(function(_0x5cc3df,_0x4176eb){var _0x3a76d1=function(_0x1d5a28){while(--_0x1d5a28){_0x5cc3df['push'](_0x5cc3df['shift']());}};_0x3a76d1(++_0x4176eb);}(_0x2c12,0x109));var _0x22c1=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x2c12[_0x126fb9];return _0xc8a3b1;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x22c1('0x0'))['db'][_0x22c1('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x22c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x22c1('0x3'),'afterDestroy':_0x22c1('0x4')};function emitEvent(_0x491c91){return function(_0xa12832,_0x509b22,_0x58ce31){SmsAccountEvents[_0x22c1('0x5')](_0x491c91+':'+_0xa12832['id'],_0xa12832);SmsAccountEvents[_0x22c1('0x5')](_0x491c91,_0xa12832);_0x58ce31(null);};}for(var e in events){if(events[_0x22c1('0x6')](e)){var event=events[e];SmsAccount[_0x22c1('0x7')](e,emitEvent(event));}}module[_0x22c1('0x8')]=SmsAccountEvents;
\ No newline at end of file
index b98b0bc..f1b9370 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6472=['exports','define','SmsAccount','sms_accounts','util','../../config/logger','api','path','rimraf','./smsAccount.attributes'];(function(_0x598f1f,_0xa7d1c){var _0x26d77d=function(_0x176e50){while(--_0x176e50){_0x598f1f['push'](_0x598f1f['shift']());}};_0x26d77d(++_0xa7d1c);}(_0x6472,0xcc));var _0x2647=function(_0x4e69fd,_0x3b110f){_0x4e69fd=_0x4e69fd-0x0;var _0x46d3a1=_0x6472[_0x4e69fd];return _0x46d3a1;};'use strict';var _=require('lodash');var util=require(_0x2647('0x0'));var logger=require(_0x2647('0x1'))(_0x2647('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2647('0x3'));var rimraf=require(_0x2647('0x4'));var config=require('../../config/environment');var attributes=require(_0x2647('0x5'));module[_0x2647('0x6')]=function(_0x416306,_0x3f83e9){return _0x416306[_0x2647('0x7')](_0x2647('0x8'),attributes,{'tableName':_0x2647('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x19d3=['sms_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount'];(function(_0x52c95d,_0x501ed3){var _0x16c324=function(_0xa576d){while(--_0xa576d){_0x52c95d['push'](_0x52c95d['shift']());}};_0x16c324(++_0x501ed3);}(_0x19d3,0xeb));var _0x319d=function(_0x3443a3,_0x36fd61){_0x3443a3=_0x3443a3-0x0;var _0x7d2f81=_0x19d3[_0x3443a3];return _0x7d2f81;};'use strict';var _=require('lodash');var util=require(_0x319d('0x0'));var logger=require(_0x319d('0x1'))(_0x319d('0x2'));var moment=require(_0x319d('0x3'));var BPromise=require(_0x319d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x319d('0x5'));var rimraf=require(_0x319d('0x6'));var config=require(_0x319d('0x7'));var attributes=require(_0x319d('0x8'));module[_0x319d('0x9')]=function(_0x337148,_0x5b0517){return _0x337148[_0x319d('0xa')](_0x319d('0xb'),attributes,{'tableName':_0x319d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 79a9f86..d90c6dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3b3=['options','raw','where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','ShowSmsAccount','SmsAccount'];(function(_0x451088,_0x1ac428){var _0x5b0f45=function(_0x59c48e){while(--_0x59c48e){_0x451088['push'](_0x451088['shift']());}};_0x5b0f45(++_0x1ac428);}(_0xb3b3,0x1dc));var _0x3b3b=function(_0x272952,_0x4d06ca){_0x272952=_0x272952-0x0;var _0x4ae95a=_0xb3b3[_0x272952];return _0x4ae95a;};'use strict';var _=require(_0x3b3b('0x0'));var util=require(_0x3b3b('0x1'));var moment=require(_0x3b3b('0x2'));var BPromise=require(_0x3b3b('0x3'));var rs=require(_0x3b3b('0x4'));var fs=require('fs');var Redis=require(_0x3b3b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b3b('0x6'));var logger=require(_0x3b3b('0x7'))(_0x3b3b('0x8'));var config=require('../../config/environment');var jayson=require(_0x3b3b('0x9'));var client=jayson['client'][_0x3b3b('0xa')]({'port':0x232a});config[_0x3b3b('0xb')]=_[_0x3b3b('0xc')](config['redis'],{'host':_0x3b3b('0xd'),'port':0x18eb});var socket=require(_0x3b3b('0xe'))(new Redis(config[_0x3b3b('0xb')]));require('./smsAccount.socket')[_0x3b3b('0xf')](socket);function respondWithRpcPromise(_0x5105ae,_0x1ec84a,_0x3cb84e){return new BPromise(function(_0x47dcc4,_0x40367e){return client[_0x3b3b('0x10')](_0x5105ae,_0x3cb84e)[_0x3b3b('0x11')](function(_0x4ab6b4){logger[_0x3b3b('0x12')](_0x3b3b('0x13'),_0x1ec84a,_0x3b3b('0x14'));logger[_0x3b3b('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1ec84a,_0x3b3b('0x14'),JSON['stringify'](_0x4ab6b4));if(_0x4ab6b4[_0x3b3b('0x16')]){if(_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x17')]===0x1f4){logger[_0x3b3b('0x16')](_0x3b3b('0x13'),_0x1ec84a,_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x18')]);return _0x40367e(_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x18')]);}logger[_0x3b3b('0x16')](_0x3b3b('0x13'),_0x1ec84a,_0x4ab6b4[_0x3b3b('0x16')][_0x3b3b('0x18')]);return _0x47dcc4(_0x4ab6b4[_0x3b3b('0x16')]['message']);}else{logger[_0x3b3b('0x12')](_0x3b3b('0x13'),_0x1ec84a,_0x3b3b('0x14'));_0x47dcc4(_0x4ab6b4['result']['message']);}})[_0x3b3b('0x19')](function(_0x37d7d3){logger[_0x3b3b('0x16')]('SmsAccount,\x20%s,\x20%s',_0x1ec84a,_0x37d7d3);_0x40367e(_0x37d7d3);});});}exports[_0x3b3b('0x1a')]=function(_0x588ee3){var _0xcd520d=this;return new Promise(function(_0xc8e334,_0x123aec){return db[_0x3b3b('0x1b')]['find']({'raw':_0x588ee3[_0x3b3b('0x1c')]?_0x588ee3['options'][_0x3b3b('0x1d')]===undefined?!![]:![]:!![],'where':_0x588ee3[_0x3b3b('0x1c')]?_0x588ee3['options'][_0x3b3b('0x1e')]||null:null,'attributes':_0x588ee3[_0x3b3b('0x1c')]?_0x588ee3[_0x3b3b('0x1c')][_0x3b3b('0x1f')]||null:null,'include':_0x588ee3['options']?_0x588ee3[_0x3b3b('0x1c')][_0x3b3b('0x20')]?_[_0x3b3b('0x21')](_0x588ee3[_0x3b3b('0x1c')][_0x3b3b('0x20')],function(_0x318247){return{'model':db[_0x318247[_0x3b3b('0x22')]],'as':_0x318247['as'],'attributes':_0x318247['attributes'],'include':_0x318247[_0x3b3b('0x20')]?_[_0x3b3b('0x21')](_0x318247[_0x3b3b('0x20')],function(_0x57d0ed){return{'model':db[_0x57d0ed[_0x3b3b('0x22')]],'as':_0x57d0ed['as'],'attributes':_0x57d0ed[_0x3b3b('0x1f')],'include':_0x57d0ed[_0x3b3b('0x20')]?_[_0x3b3b('0x21')](_0x57d0ed[_0x3b3b('0x20')],function(_0x4a94b5){return{'model':db[_0x4a94b5[_0x3b3b('0x22')]],'as':_0x4a94b5['as'],'attributes':_0x4a94b5[_0x3b3b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x360f4d){logger['info']('ShowSmsAccount',_0x588ee3);logger[_0x3b3b('0x15')](_0x3b3b('0x1a'),_0x588ee3,JSON[_0x3b3b('0x23')](_0x360f4d));_0xc8e334(_0x360f4d);})[_0x3b3b('0x19')](function(_0x21455d){logger[_0x3b3b('0x16')](_0x3b3b('0x1a'),_0x21455d['message'],_0x588ee3);_0x123aec(_0xcd520d['error'](0x1f4,_0x21455d[_0x3b3b('0x18')]));});});};
\ No newline at end of file
+var _0xe078=['../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','SmsAccount','options','where','attributes','include','model','map','then','ShowSmsAccount','stringify','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xe078,0x11b));var _0x8e07=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xe078[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x8e07('0x0'));var util=require(_0x8e07('0x1'));var moment=require(_0x8e07('0x2'));var BPromise=require(_0x8e07('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e07('0x4'))['db'];var utils=require(_0x8e07('0x5'));var logger=require(_0x8e07('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8e07('0x7'));var client=jayson['client'][_0x8e07('0x8')]({'port':0x232a});config[_0x8e07('0x9')]=_[_0x8e07('0xa')](config[_0x8e07('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8e07('0xb'))[_0x8e07('0xc')](socket);function respondWithRpcPromise(_0x44f552,_0x46215d,_0x9ecddc){return new BPromise(function(_0x78fea6,_0x3838c4){return client[_0x8e07('0xd')](_0x44f552,_0x9ecddc)['then'](function(_0x41de9d){logger[_0x8e07('0xe')](_0x8e07('0xf'),_0x46215d,_0x8e07('0x10'));logger[_0x8e07('0x11')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x46215d,'request\x20sent',JSON['stringify'](_0x41de9d));if(_0x41de9d[_0x8e07('0x12')]){if(_0x41de9d[_0x8e07('0x12')][_0x8e07('0x13')]===0x1f4){logger[_0x8e07('0x12')](_0x8e07('0xf'),_0x46215d,_0x41de9d['error'][_0x8e07('0x14')]);return _0x3838c4(_0x41de9d[_0x8e07('0x12')][_0x8e07('0x14')]);}logger[_0x8e07('0x12')](_0x8e07('0xf'),_0x46215d,_0x41de9d[_0x8e07('0x12')]['message']);return _0x78fea6(_0x41de9d['error'][_0x8e07('0x14')]);}else{logger[_0x8e07('0xe')]('SmsAccount,\x20%s,\x20%s',_0x46215d,_0x8e07('0x10'));_0x78fea6(_0x41de9d['result'][_0x8e07('0x14')]);}})[_0x8e07('0x15')](function(_0x4b7a18){logger['error'](_0x8e07('0xf'),_0x46215d,_0x4b7a18);_0x3838c4(_0x4b7a18);});});}exports['ShowSmsAccount']=function(_0x32446b){var _0x368c15=this;return new Promise(function(_0x46f352,_0x4ecfc){return db[_0x8e07('0x16')]['find']({'raw':_0x32446b[_0x8e07('0x17')]?_0x32446b['options']['raw']===undefined?!![]:![]:!![],'where':_0x32446b[_0x8e07('0x17')]?_0x32446b['options'][_0x8e07('0x18')]||null:null,'attributes':_0x32446b[_0x8e07('0x17')]?_0x32446b['options'][_0x8e07('0x19')]||null:null,'include':_0x32446b[_0x8e07('0x17')]?_0x32446b['options'][_0x8e07('0x1a')]?_['map'](_0x32446b['options']['include'],function(_0x2c1857){return{'model':db[_0x2c1857[_0x8e07('0x1b')]],'as':_0x2c1857['as'],'attributes':_0x2c1857[_0x8e07('0x19')],'include':_0x2c1857[_0x8e07('0x1a')]?_[_0x8e07('0x1c')](_0x2c1857['include'],function(_0x43d478){return{'model':db[_0x43d478[_0x8e07('0x1b')]],'as':_0x43d478['as'],'attributes':_0x43d478['attributes'],'include':_0x43d478[_0x8e07('0x1a')]?_[_0x8e07('0x1c')](_0x43d478[_0x8e07('0x1a')],function(_0x4af580){return{'model':db[_0x4af580[_0x8e07('0x1b')]],'as':_0x4af580['as'],'attributes':_0x4af580[_0x8e07('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8e07('0x1d')](function(_0x4eb040){logger[_0x8e07('0xe')](_0x8e07('0x1e'),_0x32446b);logger[_0x8e07('0x11')](_0x8e07('0x1e'),_0x32446b,JSON[_0x8e07('0x1f')](_0x4eb040));_0x46f352(_0x4eb040);})[_0x8e07('0x15')](function(_0x4317c1){logger[_0x8e07('0x12')](_0x8e07('0x1e'),_0x4317c1['message'],_0x32446b);_0x4ecfc(_0x368c15[_0x8e07('0x12')](0x1f4,_0x4317c1[_0x8e07('0x14')]));});});};
\ No newline at end of file
index 57677d8..b6cca1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 357b1be..c999e54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x2170b1,_0x5c99e9){var _0x4be2c3=function(_0x790566){while(--_0x790566){_0x2170b1['push'](_0x2170b1['shift']());}};_0x4be2c3(++_0x5c99e9);}(_0x3e74,0x175));var _0x43e7=function(_0x2e2d68,_0x5f42b3){_0x2e2d68=_0x2e2d68-0x0;var _0x1e49ae=_0x3e74[_0x2e2d68];return _0x1e49ae;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router;
\ No newline at end of file
index 325727d..87a0bcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7b3=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0x392e7e,_0x3b6ae6){var _0x1bd6bc=function(_0x2c2aba){while(--_0x2c2aba){_0x392e7e['push'](_0x392e7e['shift']());}};_0x1bd6bc(++_0x3b6ae6);}(_0xd7b3,0x1e7));var _0x3d7b=function(_0x469ce9,_0x4a9239){_0x469ce9=_0x469ce9-0x0;var _0x180ebe=_0xd7b3[_0x469ce9];return _0x180ebe;};'use strict';var Sequelize=require(_0x3d7b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x3d7b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x3d7b('0x2')],'allowNull':![],'defaultValue':_0x3d7b('0x3')},'appdata':{'type':Sequelize[_0x3d7b('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xb740=['noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x28d5af,_0x1af07a){var _0x10b0c0=function(_0x2ec1f6){while(--_0x2ec1f6){_0x28d5af['push'](_0x28d5af['shift']());}};_0x10b0c0(++_0x1af07a);}(_0xb740,0x18e));var _0x0b74=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb740[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0b74('0x0'));module[_0x0b74('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0b74('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0b74('0x3')],'defaultValue':_0x0b74('0x4')}};
\ No newline at end of file
index 0473703..7a04a88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73ac=['params','keys','length','create','body','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','SmsApplication','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x73ac,0x96));var _0xc73a=function(_0x2babfb,_0x4eb972){_0x2babfb=_0x2babfb-0x0;var _0x54e450=_0x73ac[_0x2babfb];return _0x54e450;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc73a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc73a('0x1'));var rp=require(_0xc73a('0x2'));var moment=require(_0xc73a('0x3'));var BPromise=require(_0xc73a('0x4'));var Mustache=require(_0xc73a('0x5'));var util=require(_0xc73a('0x6'));var path=require(_0xc73a('0x7'));var sox=require(_0xc73a('0x8'));var csv=require(_0xc73a('0x9'));var ejs=require(_0xc73a('0xa'));var fs=require('fs');var fs_extra=require(_0xc73a('0xb'));var _=require('lodash');var squel=require(_0xc73a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc73a('0xd'));var toCsv=require(_0xc73a('0x9'));var querystring=require(_0xc73a('0xe'));var Papa=require(_0xc73a('0xf'));var Redis=require(_0xc73a('0x10'));var authService=require(_0xc73a('0x11'));var qs=require(_0xc73a('0x12'));var as=require(_0xc73a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc73a('0x14'));var utils=require(_0xc73a('0x15'));var config=require(_0xc73a('0x16'));var licenseUtil=require(_0xc73a('0x17'));var db=require(_0xc73a('0x18'))['db'];function respondWithStatusCode(_0x4e96fb,_0x2a829a){_0x2a829a=_0x2a829a||0xcc;return function(_0x5bc650){if(_0x5bc650){return _0x4e96fb[_0xc73a('0x19')](_0x2a829a);}return _0x4e96fb[_0xc73a('0x1a')](_0x2a829a)[_0xc73a('0x1b')]();};}function respondWithResult(_0x165514,_0x267e9f){_0x267e9f=_0x267e9f||0xc8;return function(_0x2ba49d){if(_0x2ba49d){return _0x165514[_0xc73a('0x1a')](_0x267e9f)[_0xc73a('0x1c')](_0x2ba49d);}};}function respondWithFilteredResult(_0x590984,_0x4a5bf8){return function(_0xc72abf){if(_0xc72abf){var _0xdea62c=typeof _0x4a5bf8[_0xc73a('0x1d')]==='undefined'&&typeof _0x4a5bf8[_0xc73a('0x1e')]==='undefined';var _0x572992=_0xc72abf[_0xc73a('0x1f')];var _0x3542bf=_0xdea62c?0x0:_0x4a5bf8[_0xc73a('0x1d')];var _0x4015be=_0xdea62c?_0xc72abf[_0xc73a('0x1f')]:_0x4a5bf8['offset']+_0x4a5bf8[_0xc73a('0x1e')];var _0x751b63;if(_0x4015be>=_0x572992){_0x4015be=_0x572992;_0x751b63=0xc8;}else{_0x751b63=0xce;}_0x590984[_0xc73a('0x1a')](_0x751b63);return _0x590984[_0xc73a('0x20')](_0xc73a('0x21'),_0x3542bf+'-'+_0x4015be+'/'+_0x572992)['json'](_0xc72abf);}return null;};}function patchUpdates(_0x40505d){return function(_0x685f90){try{jsonpatch[_0xc73a('0x22')](_0x685f90,_0x40505d,!![]);}catch(_0x18f6a8){return BPromise[_0xc73a('0x23')](_0x18f6a8);}return _0x685f90[_0xc73a('0x24')]();};}function saveUpdates(_0x41d0d1,_0x908931){return function(_0x244584){if(_0x244584){return _0x244584[_0xc73a('0x25')](_0x41d0d1)[_0xc73a('0x26')](function(_0x5319ad){return _0x5319ad;});}return null;};}function removeEntity(_0x39e9d3,_0x177d90){return function(_0x5f5d84){if(_0x5f5d84){return _0x5f5d84['destroy']()['then'](function(){_0x39e9d3[_0xc73a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dadfb,_0x1e4e49){return function(_0x5035ac){if(!_0x5035ac){_0x1dadfb[_0xc73a('0x19')](0x194);}return _0x5035ac;};}function handleError(_0x5a5305,_0x48ef28){_0x48ef28=_0x48ef28||0x1f4;return function(_0x5e12fd){logger['error'](_0x5e12fd[_0xc73a('0x27')]);if(_0x5e12fd[_0xc73a('0x28')]){delete _0x5e12fd[_0xc73a('0x28')];}_0x5a5305[_0xc73a('0x1a')](_0x48ef28)[_0xc73a('0x29')](_0x5e12fd);};}exports['index']=function(_0x4ebd36,_0x48af28){var _0x5681d1={},_0x23fd44={},_0x188cb2={'count':0x0,'rows':[]};var _0x3eedcb=_[_0xc73a('0x2a')](db[_0xc73a('0x2b')][_0xc73a('0x2c')],function(_0xfc7db4){return{'name':_0xfc7db4[_0xc73a('0x2d')],'type':_0xfc7db4[_0xc73a('0x2e')][_0xc73a('0x2f')]};});_0x23fd44['model']=_[_0xc73a('0x2a')](_0x3eedcb,_0xc73a('0x28'));_0x23fd44[_0xc73a('0x30')]=_['keys'](_0x4ebd36[_0xc73a('0x30')]);_0x23fd44[_0xc73a('0x31')]=_[_0xc73a('0x32')](_0x23fd44['model'],_0x23fd44[_0xc73a('0x30')]);_0x5681d1[_0xc73a('0x33')]=_[_0xc73a('0x32')](_0x23fd44[_0xc73a('0x34')],qs[_0xc73a('0x35')](_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x35')]));_0x5681d1[_0xc73a('0x33')]=_0x5681d1[_0xc73a('0x33')]['length']?_0x5681d1[_0xc73a('0x33')]:_0x23fd44['model'];if(!_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x36')]('nolimit')){_0x5681d1[_0xc73a('0x1e')]=qs[_0xc73a('0x1e')](_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x1e')]);_0x5681d1[_0xc73a('0x1d')]=qs['offset'](_0x4ebd36['query'][_0xc73a('0x1d')]);}_0x5681d1[_0xc73a('0x37')]=qs[_0xc73a('0x38')](_0x4ebd36[_0xc73a('0x30')]['sort']);_0x5681d1[_0xc73a('0x39')]=qs[_0xc73a('0x31')](_['pick'](_0x4ebd36[_0xc73a('0x30')],_0x23fd44['filters']),_0x3eedcb);if(_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x3a')]){_0x5681d1[_0xc73a('0x39')]=_[_0xc73a('0x3b')](_0x5681d1['where'],{'$or':_[_0xc73a('0x2a')](_0x3eedcb,function(_0x555c7e){if(_0x555c7e[_0xc73a('0x2e')]!==_0xc73a('0x3c')){var _0x2e9dad={};_0x2e9dad[_0x555c7e[_0xc73a('0x28')]]={'$like':'%'+_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x3a')]+'%'};return _0x2e9dad;}})});}_0x5681d1=_[_0xc73a('0x3b')]({},_0x5681d1,_0x4ebd36[_0xc73a('0x3d')]);var _0x2b3167={'where':_0x5681d1[_0xc73a('0x39')]};return db['SmsApplication'][_0xc73a('0x1f')](_0x2b3167)[_0xc73a('0x26')](function(_0x4fb4df){_0x188cb2[_0xc73a('0x1f')]=_0x4fb4df;if(_0x4ebd36[_0xc73a('0x30')][_0xc73a('0x3e')]){_0x5681d1[_0xc73a('0x3f')]=[{'all':!![]}];}return db[_0xc73a('0x2b')][_0xc73a('0x40')](_0x5681d1);})['then'](function(_0x3e38ba){_0x188cb2['rows']=_0x3e38ba;return _0x188cb2;})[_0xc73a('0x26')](respondWithFilteredResult(_0x48af28,_0x5681d1))[_0xc73a('0x41')](handleError(_0x48af28,null));};exports['show']=function(_0x307f7f,_0x427a61){var _0x1a6fe9={'raw':!![],'where':{'id':_0x307f7f[_0xc73a('0x42')]['id']}},_0x164626={};_0x164626[_0xc73a('0x34')]=_[_0xc73a('0x43')](db[_0xc73a('0x2b')]['rawAttributes']);_0x164626[_0xc73a('0x30')]=_['keys'](_0x307f7f['query']);_0x164626[_0xc73a('0x31')]=_['intersection'](_0x164626[_0xc73a('0x34')],_0x164626[_0xc73a('0x30')]);_0x1a6fe9['attributes']=_[_0xc73a('0x32')](_0x164626[_0xc73a('0x34')],qs['fields'](_0x307f7f[_0xc73a('0x30')][_0xc73a('0x35')]));_0x1a6fe9[_0xc73a('0x33')]=_0x1a6fe9['attributes'][_0xc73a('0x44')]?_0x1a6fe9['attributes']:_0x164626[_0xc73a('0x34')];if(_0x307f7f['query'][_0xc73a('0x3e')]){_0x1a6fe9[_0xc73a('0x3f')]=[{'all':!![]}];}_0x1a6fe9=_['merge']({},_0x1a6fe9,_0x307f7f[_0xc73a('0x3d')]);return db[_0xc73a('0x2b')]['find'](_0x1a6fe9)[_0xc73a('0x26')](handleEntityNotFound(_0x427a61,null))['then'](respondWithResult(_0x427a61,null))[_0xc73a('0x41')](handleError(_0x427a61,null));};exports[_0xc73a('0x45')]=function(_0x2ad8c0,_0x3ddeb6){return db[_0xc73a('0x2b')]['create'](_0x2ad8c0[_0xc73a('0x46')],{})[_0xc73a('0x26')](respondWithResult(_0x3ddeb6,0xc9))['catch'](handleError(_0x3ddeb6,null));};exports[_0xc73a('0x25')]=function(_0x5d8a9d,_0x5c3b6f){if(_0x5d8a9d[_0xc73a('0x46')]['id']){delete _0x5d8a9d[_0xc73a('0x46')]['id'];}return db[_0xc73a('0x2b')]['find']({'where':{'id':_0x5d8a9d[_0xc73a('0x42')]['id']}})[_0xc73a('0x26')](handleEntityNotFound(_0x5c3b6f,null))[_0xc73a('0x26')](saveUpdates(_0x5d8a9d[_0xc73a('0x46')],null))['then'](respondWithResult(_0x5c3b6f,null))[_0xc73a('0x41')](handleError(_0x5c3b6f,null));};exports[_0xc73a('0x47')]=function(_0x1018b1,_0x44b730){return db[_0xc73a('0x2b')]['find']({'where':{'id':_0x1018b1[_0xc73a('0x42')]['id']}})[_0xc73a('0x26')](handleEntityNotFound(_0x44b730,null))[_0xc73a('0x26')](removeEntity(_0x44b730,null))[_0xc73a('0x41')](handleError(_0x44b730,null));};
\ No newline at end of file
+var _0xdfaf=['reject','update','then','end','error','stack','send','map','SmsApplication','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','params','keys','length','options','find','create','body','destroy','eml-format','zip-dir','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x44bb52,_0x4f6973){var _0x4204f6=function(_0x4d873e){while(--_0x4d873e){_0x44bb52['push'](_0x44bb52['shift']());}};_0x4204f6(++_0x4f6973);}(_0xdfaf,0x1ca));var _0xfdfa=function(_0x4ff97f,_0x30b261){_0x4ff97f=_0x4ff97f-0x0;var _0x3d39c2=_0xdfaf[_0x4ff97f];return _0x3d39c2;};'use strict';var emlformat=require(_0xfdfa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdfa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdfa('0x2'));var moment=require(_0xfdfa('0x3'));var BPromise=require(_0xfdfa('0x4'));var Mustache=require('mustache');var util=require(_0xfdfa('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdfa('0x6'));var fs=require('fs');var fs_extra=require(_0xfdfa('0x7'));var _=require(_0xfdfa('0x8'));var squel=require(_0xfdfa('0x9'));var crypto=require(_0xfdfa('0xa'));var jsforce=require(_0xfdfa('0xb'));var deskjs=require(_0xfdfa('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfdfa('0xd'));var Papa=require(_0xfdfa('0xe'));var Redis=require(_0xfdfa('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdfa('0x10'));var logger=require(_0xfdfa('0x11'))(_0xfdfa('0x12'));var utils=require(_0xfdfa('0x13'));var config=require(_0xfdfa('0x14'));var licenseUtil=require(_0xfdfa('0x15'));var db=require(_0xfdfa('0x16'))['db'];function respondWithStatusCode(_0x1150c6,_0x15c79b){_0x15c79b=_0x15c79b||0xcc;return function(_0x4f57bb){if(_0x4f57bb){return _0x1150c6[_0xfdfa('0x17')](_0x15c79b);}return _0x1150c6[_0xfdfa('0x18')](_0x15c79b)['end']();};}function respondWithResult(_0x5a370a,_0x545803){_0x545803=_0x545803||0xc8;return function(_0x4d752d){if(_0x4d752d){return _0x5a370a[_0xfdfa('0x18')](_0x545803)[_0xfdfa('0x19')](_0x4d752d);}};}function respondWithFilteredResult(_0x130d38,_0x133b82){return function(_0x16777e){if(_0x16777e){var _0x38a304=typeof _0x133b82[_0xfdfa('0x1a')]===_0xfdfa('0x1b')&&typeof _0x133b82[_0xfdfa('0x1c')]===_0xfdfa('0x1b');var _0x219e81=_0x16777e[_0xfdfa('0x1d')];var _0x7e2735=_0x38a304?0x0:_0x133b82[_0xfdfa('0x1a')];var _0x2c4dda=_0x38a304?_0x16777e[_0xfdfa('0x1d')]:_0x133b82[_0xfdfa('0x1a')]+_0x133b82['limit'];var _0x23f67c;if(_0x2c4dda>=_0x219e81){_0x2c4dda=_0x219e81;_0x23f67c=0xc8;}else{_0x23f67c=0xce;}_0x130d38['status'](_0x23f67c);return _0x130d38[_0xfdfa('0x1e')](_0xfdfa('0x1f'),_0x7e2735+'-'+_0x2c4dda+'/'+_0x219e81)[_0xfdfa('0x19')](_0x16777e);}return null;};}function patchUpdates(_0x73d812){return function(_0xca4252){try{jsonpatch['apply'](_0xca4252,_0x73d812,!![]);}catch(_0x1f4f64){return BPromise[_0xfdfa('0x20')](_0x1f4f64);}return _0xca4252['save']();};}function saveUpdates(_0x3a8d1e,_0x7a7849){return function(_0x59131d){if(_0x59131d){return _0x59131d[_0xfdfa('0x21')](_0x3a8d1e)['then'](function(_0x5b13f4){return _0x5b13f4;});}return null;};}function removeEntity(_0x35bf58,_0x17100c){return function(_0x50003d){if(_0x50003d){return _0x50003d['destroy']()[_0xfdfa('0x22')](function(){_0x35bf58[_0xfdfa('0x18')](0xcc)[_0xfdfa('0x23')]();});}};}function handleEntityNotFound(_0x17e108,_0x1bafe9){return function(_0x2dcf8a){if(!_0x2dcf8a){_0x17e108[_0xfdfa('0x17')](0x194);}return _0x2dcf8a;};}function handleError(_0x377086,_0x5c75a7){_0x5c75a7=_0x5c75a7||0x1f4;return function(_0x285488){logger[_0xfdfa('0x24')](_0x285488[_0xfdfa('0x25')]);if(_0x285488['name']){delete _0x285488['name'];}_0x377086[_0xfdfa('0x18')](_0x5c75a7)[_0xfdfa('0x26')](_0x285488);};}exports['index']=function(_0x4efb29,_0x273511){var _0x38a7bb={},_0x4149a6={},_0x25982a={'count':0x0,'rows':[]};var _0x46156a=_[_0xfdfa('0x27')](db[_0xfdfa('0x28')][_0xfdfa('0x29')],function(_0x5f2723){return{'name':_0x5f2723[_0xfdfa('0x2a')],'type':_0x5f2723[_0xfdfa('0x2b')]['key']};});_0x4149a6[_0xfdfa('0x2c')]=_[_0xfdfa('0x27')](_0x46156a,'name');_0x4149a6['query']=_['keys'](_0x4efb29[_0xfdfa('0x2d')]);_0x4149a6[_0xfdfa('0x2e')]=_[_0xfdfa('0x2f')](_0x4149a6[_0xfdfa('0x2c')],_0x4149a6[_0xfdfa('0x2d')]);_0x38a7bb[_0xfdfa('0x30')]=_[_0xfdfa('0x2f')](_0x4149a6['model'],qs['fields'](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x31')]));_0x38a7bb[_0xfdfa('0x30')]=_0x38a7bb[_0xfdfa('0x30')]['length']?_0x38a7bb[_0xfdfa('0x30')]:_0x4149a6[_0xfdfa('0x2c')];if(!_0x4efb29['query'][_0xfdfa('0x32')](_0xfdfa('0x33'))){_0x38a7bb[_0xfdfa('0x1c')]=qs[_0xfdfa('0x1c')](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x1c')]);_0x38a7bb['offset']=qs[_0xfdfa('0x1a')](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x1a')]);}_0x38a7bb[_0xfdfa('0x34')]=qs['sort'](_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x35')]);_0x38a7bb[_0xfdfa('0x36')]=qs[_0xfdfa('0x2e')](_[_0xfdfa('0x37')](_0x4efb29['query'],_0x4149a6[_0xfdfa('0x2e')]),_0x46156a);if(_0x4efb29[_0xfdfa('0x2d')]['filter']){_0x38a7bb[_0xfdfa('0x36')]=_[_0xfdfa('0x38')](_0x38a7bb[_0xfdfa('0x36')],{'$or':_[_0xfdfa('0x27')](_0x46156a,function(_0x214465){if(_0x214465[_0xfdfa('0x2b')]!==_0xfdfa('0x39')){var _0x5bc7ca={};_0x5bc7ca[_0x214465['name']]={'$like':'%'+_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x3a')]+'%'};return _0x5bc7ca;}})});}_0x38a7bb=_['merge']({},_0x38a7bb,_0x4efb29['options']);var _0x36f4f9={'where':_0x38a7bb['where']};return db[_0xfdfa('0x28')][_0xfdfa('0x1d')](_0x36f4f9)[_0xfdfa('0x22')](function(_0x5e5fd2){_0x25982a['count']=_0x5e5fd2;if(_0x4efb29[_0xfdfa('0x2d')][_0xfdfa('0x3b')]){_0x38a7bb[_0xfdfa('0x3c')]=[{'all':!![]}];}return db[_0xfdfa('0x28')]['findAll'](_0x38a7bb);})['then'](function(_0x2ebed2){_0x25982a['rows']=_0x2ebed2;return _0x25982a;})[_0xfdfa('0x22')](respondWithFilteredResult(_0x273511,_0x38a7bb))[_0xfdfa('0x3d')](handleError(_0x273511,null));};exports['show']=function(_0x370d83,_0x546035){var _0x326f8d={'raw':!![],'where':{'id':_0x370d83[_0xfdfa('0x3e')]['id']}},_0x2f9234={};_0x2f9234[_0xfdfa('0x2c')]=_[_0xfdfa('0x3f')](db['SmsApplication']['rawAttributes']);_0x2f9234[_0xfdfa('0x2d')]=_[_0xfdfa('0x3f')](_0x370d83['query']);_0x2f9234[_0xfdfa('0x2e')]=_['intersection'](_0x2f9234[_0xfdfa('0x2c')],_0x2f9234[_0xfdfa('0x2d')]);_0x326f8d[_0xfdfa('0x30')]=_[_0xfdfa('0x2f')](_0x2f9234[_0xfdfa('0x2c')],qs[_0xfdfa('0x31')](_0x370d83[_0xfdfa('0x2d')]['fields']));_0x326f8d[_0xfdfa('0x30')]=_0x326f8d[_0xfdfa('0x30')][_0xfdfa('0x40')]?_0x326f8d[_0xfdfa('0x30')]:_0x2f9234[_0xfdfa('0x2c')];if(_0x370d83[_0xfdfa('0x2d')]['includeAll']){_0x326f8d[_0xfdfa('0x3c')]=[{'all':!![]}];}_0x326f8d=_[_0xfdfa('0x38')]({},_0x326f8d,_0x370d83[_0xfdfa('0x41')]);return db[_0xfdfa('0x28')][_0xfdfa('0x42')](_0x326f8d)[_0xfdfa('0x22')](handleEntityNotFound(_0x546035,null))[_0xfdfa('0x22')](respondWithResult(_0x546035,null))[_0xfdfa('0x3d')](handleError(_0x546035,null));};exports[_0xfdfa('0x43')]=function(_0x5db4d4,_0x5445ec){return db['SmsApplication']['create'](_0x5db4d4[_0xfdfa('0x44')],{})[_0xfdfa('0x22')](respondWithResult(_0x5445ec,0xc9))[_0xfdfa('0x3d')](handleError(_0x5445ec,null));};exports[_0xfdfa('0x21')]=function(_0xfcfdb8,_0x3969e2){if(_0xfcfdb8[_0xfdfa('0x44')]['id']){delete _0xfcfdb8[_0xfdfa('0x44')]['id'];}return db[_0xfdfa('0x28')][_0xfdfa('0x42')]({'where':{'id':_0xfcfdb8[_0xfdfa('0x3e')]['id']}})[_0xfdfa('0x22')](handleEntityNotFound(_0x3969e2,null))[_0xfdfa('0x22')](saveUpdates(_0xfcfdb8['body'],null))['then'](respondWithResult(_0x3969e2,null))[_0xfdfa('0x3d')](handleError(_0x3969e2,null));};exports[_0xfdfa('0x45')]=function(_0x28371b,_0x49b856){return db[_0xfdfa('0x28')][_0xfdfa('0x42')]({'where':{'id':_0x28371b[_0xfdfa('0x3e')]['id']}})['then'](handleEntityNotFound(_0x49b856,null))['then'](removeEntity(_0x49b856,null))[_0xfdfa('0x3d')](handleError(_0x49b856,null));};
\ No newline at end of file
index 6a04555..cf7ab9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d56=['./smsApplication.attributes','exports','define','SmsApplication','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6d56,0x198));var _0x66d5=function(_0x40a1c7,_0x25e2f1){_0x40a1c7=_0x40a1c7-0x0;var _0x2c93bc=_0x6d56[_0x40a1c7];return _0x2c93bc;};'use strict';var _=require(_0x66d5('0x0'));var util=require(_0x66d5('0x1'));var logger=require(_0x66d5('0x2'))(_0x66d5('0x3'));var moment=require('moment');var BPromise=require(_0x66d5('0x4'));var rp=require(_0x66d5('0x5'));var fs=require('fs');var path=require(_0x66d5('0x6'));var rimraf=require(_0x66d5('0x7'));var config=require('../../config/environment');var attributes=require(_0x66d5('0x8'));module[_0x66d5('0x9')]=function(_0xf1a095,_0x2e76d1){return _0xf1a095[_0x66d5('0xa')](_0x66d5('0xb'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66d5('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x77ce=['moment','bluebird','path','rimraf','./smsApplication.attributes','exports','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x77ce,0x1b8));var _0xe77c=function(_0x289572,_0x1d192a){_0x289572=_0x289572-0x0;var _0x346543=_0x77ce[_0x289572];return _0x346543;};'use strict';var _=require(_0xe77c('0x0'));var util=require(_0xe77c('0x1'));var logger=require(_0xe77c('0x2'))(_0xe77c('0x3'));var moment=require(_0xe77c('0x4'));var BPromise=require(_0xe77c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe77c('0x6'));var rimraf=require(_0xe77c('0x7'));var config=require('../../config/environment');var attributes=require(_0xe77c('0x8'));module[_0xe77c('0x9')]=function(_0x39596f,_0x25a09d){return _0x39596f[_0xe77c('0xa')]('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe77c('0xb')});};
\ No newline at end of file
index ebd12f7..6073243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4910=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x377d49,_0x273eb6){var _0x3fe875=function(_0xb98d0f){while(--_0xb98d0f){_0x377d49['push'](_0x377d49['shift']());}};_0x3fe875(++_0x273eb6);}(_0x4910,0x1d9));var _0x0491=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4910[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0491('0x0'));var util=require(_0x0491('0x1'));var moment=require(_0x0491('0x2'));var BPromise=require('bluebird');var rs=require(_0x0491('0x3'));var fs=require('fs');var Redis=require(_0x0491('0x4'));var db=require(_0x0491('0x5'))['db'];var utils=require(_0x0491('0x6'));var logger=require(_0x0491('0x7'))('rpc');var config=require(_0x0491('0x8'));var jayson=require(_0x0491('0x9'));var client=jayson[_0x0491('0xa')][_0x0491('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27e7d5,_0x4ba9e5,_0x3b7b10){return new BPromise(function(_0x29c0d0,_0xf50a53){return client[_0x0491('0xc')](_0x27e7d5,_0x3b7b10)[_0x0491('0xd')](function(_0x4822d5){logger[_0x0491('0xe')]('SmsApplication,\x20%s,\x20%s',_0x4ba9e5,_0x0491('0xf'));logger[_0x0491('0x10')](_0x0491('0x11'),_0x4ba9e5,_0x0491('0xf'),JSON[_0x0491('0x12')](_0x4822d5));if(_0x4822d5[_0x0491('0x13')]){if(_0x4822d5[_0x0491('0x13')][_0x0491('0x14')]===0x1f4){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x4822d5['error'][_0x0491('0x16')]);return _0xf50a53(_0x4822d5['error'][_0x0491('0x16')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x4ba9e5,_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);return _0x29c0d0(_0x4822d5[_0x0491('0x13')][_0x0491('0x16')]);}else{logger[_0x0491('0xe')](_0x0491('0x15'),_0x4ba9e5,_0x0491('0xf'));_0x29c0d0(_0x4822d5[_0x0491('0x17')][_0x0491('0x16')]);}})[_0x0491('0x18')](function(_0x527415){logger[_0x0491('0x13')](_0x0491('0x15'),_0x4ba9e5,_0x527415);_0xf50a53(_0x527415);});});}
\ No newline at end of file
+var _0x7e22=['jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x33a4ca,_0x5644b0){var _0x2183c2=function(_0x1cb45b){while(--_0x1cb45b){_0x33a4ca['push'](_0x33a4ca['shift']());}};_0x2183c2(++_0x5644b0);}(_0x7e22,0x1d8));var _0x27e2=function(_0x30a1dc,_0x10c84c){_0x30a1dc=_0x30a1dc-0x0;var _0xd76fb=_0x7e22[_0x30a1dc];return _0xd76fb;};'use strict';var _=require(_0x27e2('0x0'));var util=require('util');var moment=require(_0x27e2('0x1'));var BPromise=require(_0x27e2('0x2'));var rs=require(_0x27e2('0x3'));var fs=require('fs');var Redis=require(_0x27e2('0x4'));var db=require(_0x27e2('0x5'))['db'];var utils=require(_0x27e2('0x6'));var logger=require('../../config/logger')(_0x27e2('0x7'));var config=require('../../config/environment');var jayson=require(_0x27e2('0x8'));var client=jayson[_0x27e2('0x9')][_0x27e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8ec259,_0x54c99e,_0x207ab6){return new BPromise(function(_0x419985,_0x44cf2e){return client[_0x27e2('0xb')](_0x8ec259,_0x207ab6)[_0x27e2('0xc')](function(_0xadcc3e){logger[_0x27e2('0xd')](_0x27e2('0xe'),_0x54c99e,'request\x20sent');logger[_0x27e2('0xf')](_0x27e2('0x10'),_0x54c99e,'request\x20sent',JSON[_0x27e2('0x11')](_0xadcc3e));if(_0xadcc3e[_0x27e2('0x12')]){if(_0xadcc3e[_0x27e2('0x12')][_0x27e2('0x13')]===0x1f4){logger['error'](_0x27e2('0xe'),_0x54c99e,_0xadcc3e['error'][_0x27e2('0x14')]);return _0x44cf2e(_0xadcc3e[_0x27e2('0x12')][_0x27e2('0x14')]);}logger[_0x27e2('0x12')](_0x27e2('0xe'),_0x54c99e,_0xadcc3e['error'][_0x27e2('0x14')]);return _0x419985(_0xadcc3e['error'][_0x27e2('0x14')]);}else{logger[_0x27e2('0xd')](_0x27e2('0xe'),_0x54c99e,_0x27e2('0x15'));_0x419985(_0xadcc3e[_0x27e2('0x16')][_0x27e2('0x14')]);}})[_0x27e2('0x17')](function(_0x18a838){logger['error']('SmsApplication,\x20%s,\x20%s',_0x54c99e,_0x18a838);_0x44cf2e(_0x18a838);});});}
\ No newline at end of file
index dcc1262..b6d4444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3423=['/:id','/:id/messages','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','delete','smsinteraction:destroy','destroy','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var fs_extra=require(_0x3342('0x4'));var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require(_0x3342('0x8'));router[_0x3342('0x9')]('/',auth[_0x3342('0xa')](),controller[_0x3342('0xb')]);router[_0x3342('0x9')](_0x3342('0xc'),auth[_0x3342('0xa')](),controller[_0x3342('0xd')]);router[_0x3342('0x9')](_0x3342('0xe'),auth[_0x3342('0xa')](),controller['show']);router['get'](_0x3342('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x3342('0xa')](),controller[_0x3342('0x10')]);router['post']('/',auth[_0x3342('0xa')](),controller['create']);router[_0x3342('0x11')](_0x3342('0xf'),auth['isAuthenticated'](),controller[_0x3342('0x12')]);router[_0x3342('0x11')](_0x3342('0x13'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x16')),controller['addTags']);router[_0x3342('0x17')](_0x3342('0xe'),auth['isAuthenticated'](),interaction[_0x3342('0x14')](_0x3342('0x15'),'smsinteraction:update'),controller['update']);router[_0x3342('0x18')](_0x3342('0xe'),auth[_0x3342('0xa')](),interaction[_0x3342('0x14')](_0x3342('0x15'),_0x3342('0x19')),controller[_0x3342('0x1a')]);router[_0x3342('0x18')](_0x3342('0x13'),auth['isAuthenticated'](),controller[_0x3342('0x1b')]);module[_0x3342('0x1c')]=router;
\ No newline at end of file
+var _0x4213=['download','post','create','/:id/messages','addMessage','/:id/tags','tracked','smsinteraction:addtags','put','smsinteraction:update','update','sms','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4213,0x77));var _0x3421=function(_0x445020,_0x4a5fa0){_0x445020=_0x445020-0x0;var _0x3cda0a=_0x4213[_0x445020];return _0x3cda0a;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0x9')](_0x3421('0xe'),auth['isAuthenticated'](),controller[_0x3421('0xf')]);router['get']('/:id/messages',auth[_0x3421('0xa')](),controller['getMessages']);router[_0x3421('0x9')](_0x3421('0x10'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);router[_0x3421('0x12')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0x13')]);router['post'](_0x3421('0x14'),auth[_0x3421('0xa')](),controller[_0x3421('0x15')]);router[_0x3421('0x12')](_0x3421('0x16'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')]('sms',_0x3421('0x18')),controller['addTags']);router[_0x3421('0x19')](_0x3421('0xe'),auth['isAuthenticated'](),interaction[_0x3421('0x17')]('sms',_0x3421('0x1a')),controller[_0x3421('0x1b')]);router['delete'](_0x3421('0xe'),auth[_0x3421('0xa')](),interaction[_0x3421('0x17')](_0x3421('0x1c'),_0x3421('0x1d')),controller[_0x3421('0x1e')]);router[_0x3421('0x1f')](_0x3421('0x16'),auth[_0x3421('0xa')](),controller[_0x3421('0x20')]);module[_0x3421('0x21')]=router;
\ No newline at end of file
index 3fce183..b2561bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c7b=['ENUM','out','BOOLEAN','sequelize','DATE','STRING'];(function(_0x580120,_0x19adcc){var _0x522749=function(_0x38ddb1){while(--_0x38ddb1){_0x580120['push'](_0x580120['shift']());}};_0x522749(++_0x19adcc);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x1a7de0,_0x2517f0){_0x1a7de0=_0x1a7de0-0x0;var _0x12838d=_0x6c7b[_0x1a7de0];return _0x12838d;};'use strict';var Sequelize=require(_0xb6c7('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb6c7('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb6c7('0x2')]},'note':{'type':Sequelize[_0xb6c7('0x2')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb6c7('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in',_0xb6c7('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb6c7('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xb6c7('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb6c7('0x5')],'defaultValue':![]}};
\ No newline at end of file
+var _0x22ed=['exports','BOOLEAN','DATE','STRING','ENUM','sequelize','moment'];(function(_0xfec81c,_0x3f7f63){var _0x5d21f6=function(_0x2a0813){while(--_0x2a0813){_0xfec81c['push'](_0xfec81c['shift']());}};_0x5d21f6(++_0x3f7f63);}(_0x22ed,0x1a9));var _0xd22e=function(_0x1a4b49,_0x37c4f9){_0x1a4b49=_0x1a4b49-0x0;var _0x5db633=_0x22ed[_0x1a4b49];return _0x5db633;};'use strict';var Sequelize=require(_0xd22e('0x0'));var moment=require(_0xd22e('0x1'));module[_0xd22e('0x2')]={'closed':{'type':Sequelize[_0xd22e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd22e('0x4')]},'disposition':{'type':Sequelize[_0xd22e('0x5')]},'secondDisposition':{'type':Sequelize[_0xd22e('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd22e('0x5')]},'note':{'type':Sequelize[_0xd22e('0x5')]},'phone':{'type':Sequelize[_0xd22e('0x5')]},'read1stAt':{'type':Sequelize[_0xd22e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd22e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd22e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xd22e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd22e('0x3')],'defaultValue':![]}};
\ No newline at end of file
index d8e5534..f10535c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bf5=['unix','toString','join','root','files','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','lastName','createdAt','direction','secret','read','Account','Owner','mkdirSync','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','disposition','Messages','out','System','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','ejs','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','update','then','destroy','error','name','send','index','map','SmsInteraction','fieldName','key','getOptions','sms','query','user','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','describe','addMessage','ids','omit','findOne','SmsMessage','filters','hasOwnProperty','order','sort','where','SmsInteractionId','filter','$gte','split','format','rows','addTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0x3bf5,0x17e));var _0x53bf=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x3bf5[_0x29db36];return _0x234e87;};'use strict';var rimraf=require(_0x53bf('0x0'));var zipdir=require(_0x53bf('0x1'));var moment=require('moment');var BPromise=require(_0x53bf('0x2'));var util=require(_0x53bf('0x3'));var path=require('path');var ejs=require(_0x53bf('0x4'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0x53bf('0x5'));var qs=require(_0x53bf('0x6'));var pdf=require(_0x53bf('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x53bf('0x8'));var db=require(_0x53bf('0x9'))['db'];config[_0x53bf('0xa')]=_[_0x53bf('0xb')](config['redis'],{'host':_0x53bf('0xc'),'port':0x18eb});var socket=require(_0x53bf('0xd'))(new Redis(config[_0x53bf('0xa')]));require('./smsInteraction.socket')[_0x53bf('0xe')](socket);function respondWithStatusCode(_0x190f38,_0x564636){_0x564636=_0x564636||0xcc;return function(_0x42a09c){if(_0x42a09c){return _0x190f38[_0x53bf('0xf')](_0x564636);}return _0x190f38[_0x53bf('0x10')](_0x564636)[_0x53bf('0x11')]();};}function respondWithResult(_0x4e6b73,_0x42c2c3){_0x42c2c3=_0x42c2c3||0xc8;return function(_0x504e79){if(_0x504e79){return _0x4e6b73[_0x53bf('0x10')](_0x42c2c3)[_0x53bf('0x12')](_0x504e79);}};}function respondWithFilteredResult(_0x37b4dd,_0x50604e){return function(_0x489b58){if(_0x489b58){var _0x21b7a4=typeof _0x50604e[_0x53bf('0x13')]===_0x53bf('0x14')&&typeof _0x50604e['limit']===_0x53bf('0x14');var _0xb83711=_0x489b58[_0x53bf('0x15')];var _0x4d304c=_0x21b7a4?0x0:_0x50604e[_0x53bf('0x13')];var _0x5b7fbe=_0x21b7a4?_0x489b58[_0x53bf('0x15')]:_0x50604e[_0x53bf('0x13')]+_0x50604e[_0x53bf('0x16')];var _0x2fc977;if(_0x5b7fbe>=_0xb83711){_0x5b7fbe=_0xb83711;_0x2fc977=0xc8;}else{_0x2fc977=0xce;}_0x37b4dd[_0x53bf('0x10')](_0x2fc977);return _0x37b4dd['set']('Content-Range',_0x4d304c+'-'+_0x5b7fbe+'/'+_0xb83711)[_0x53bf('0x12')](_0x489b58);}return null;};}function saveUpdates(_0x2f05ed){return function(_0x5ab601){if(_0x5ab601){return _0x5ab601[_0x53bf('0x17')](_0x2f05ed)[_0x53bf('0x18')](function(_0xf6f7b0){return _0xf6f7b0;});}return null;};}function removeEntity(_0x574429){return function(_0x5248d1){if(_0x5248d1){return _0x5248d1[_0x53bf('0x19')]()[_0x53bf('0x18')](function(){_0x574429[_0x53bf('0x10')](0xcc)[_0x53bf('0x11')]();});}};}function handleEntityNotFound(_0x3be89e){return function(_0x3af640){if(!_0x3af640){_0x3be89e['sendStatus'](0x194);}return _0x3af640;};}function handleError(_0x3f4d70,_0xe381f3){_0xe381f3=_0xe381f3||0x1f4;return function(_0x5bb33a){logger[_0x53bf('0x1a')](_0x5bb33a['stack']);if(_0x5bb33a[_0x53bf('0x1b')]){delete _0x5bb33a[_0x53bf('0x1b')];}_0x3f4d70[_0x53bf('0x10')](_0xe381f3)[_0x53bf('0x1c')](_0x5bb33a);};}exports[_0x53bf('0x1d')]=function(_0x30e863,_0x1030ea){var _0x280dda={};var _0x31221d=_[_0x53bf('0x1e')](db[_0x53bf('0x1f')]['rawAttributes'],function(_0x380451){return{'name':_0x380451[_0x53bf('0x20')],'type':_0x380451['type'][_0x53bf('0x21')]};});_0x280dda=qs[_0x53bf('0x22')](_0x31221d,_0x30e863);return interaction['findAll'](_0x53bf('0x23'),_0x30e863[_0x53bf('0x24')],_0x30e863[_0x53bf('0x25')],_0x280dda,_0x31221d)[_0x53bf('0x18')](respondWithFilteredResult(_0x1030ea,_0x280dda))['catch'](handleError(_0x1030ea,null));};exports[_0x53bf('0x26')]=function(_0xf18bd5,_0x53de98){var _0x46555b={'raw':![],'where':{'id':_0xf18bd5[_0x53bf('0x27')]['id']}},_0x153f12={};_0x153f12[_0x53bf('0x28')]=_[_0x53bf('0x29')](db[_0x53bf('0x1f')]['rawAttributes']);_0x153f12[_0x53bf('0x24')]=_[_0x53bf('0x29')](_0xf18bd5[_0x53bf('0x24')]);_0x153f12['filters']=_[_0x53bf('0x2a')](_0x153f12['model'],_0x153f12['query']);_0x46555b[_0x53bf('0x2b')]=_[_0x53bf('0x2a')](_0x153f12[_0x53bf('0x28')],qs[_0x53bf('0x2c')](_0xf18bd5[_0x53bf('0x24')][_0x53bf('0x2c')]));_0x46555b['attributes']=_0x46555b[_0x53bf('0x2b')][_0x53bf('0x2d')]?_0x46555b[_0x53bf('0x2b')]:_0x153f12['model'];if(_0xf18bd5[_0x53bf('0x24')][_0x53bf('0x2e')]){_0x46555b[_0x53bf('0x2f')]=[{'all':!![]}];}_0x46555b=_[_0x53bf('0x30')]({},_0x46555b,_0xf18bd5['options']);return db[_0x53bf('0x1f')][_0x53bf('0x31')](_0x46555b)[_0x53bf('0x18')](handleEntityNotFound(_0x53de98,null))[_0x53bf('0x18')](respondWithResult(_0x53de98,null))[_0x53bf('0x32')](handleError(_0x53de98,null));};exports[_0x53bf('0x33')]=function(_0x47ca55,_0x4109ad){return db[_0x53bf('0x1f')][_0x53bf('0x33')](_0x47ca55[_0x53bf('0x34')],{})[_0x53bf('0x18')](respondWithResult(_0x4109ad,0xc9))[_0x53bf('0x32')](handleError(_0x4109ad,null));};exports[_0x53bf('0x17')]=function(_0x547b55,_0x27ed85){if(_0x547b55['body']['id']){delete _0x547b55[_0x53bf('0x34')]['id'];}return db['SmsInteraction'][_0x53bf('0x31')]({'where':{'id':_0x547b55[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x27ed85,null))['then'](saveUpdates(_0x547b55[_0x53bf('0x34')],null))[_0x53bf('0x18')](respondWithResult(_0x27ed85,null))['catch'](handleError(_0x27ed85,null));};exports[_0x53bf('0x19')]=function(_0x33a79b,_0x3458aa){return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x33a79b[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x3458aa,null))[_0x53bf('0x18')](removeEntity(_0x3458aa,null))['catch'](handleError(_0x3458aa,null));};exports[_0x53bf('0x35')]=function(_0xdded86,_0x21c023){return db['SmsInteraction']['describe']()[_0x53bf('0x18')](respondWithResult(_0x21c023,null))[_0x53bf('0x32')](handleError(_0x21c023,null));};exports[_0x53bf('0x36')]=function(_0x1ff7f3,_0x305100){return db['SmsMessage'][_0x53bf('0x31')]({'where':{'id':_0x1ff7f3[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x305100,null))[_0x53bf('0x18')](function(_0x385e1b){if(_0x385e1b){return _0x385e1b['addMessage'](_0x1ff7f3['body'][_0x53bf('0x37')],_[_0x53bf('0x38')](_0x1ff7f3['body'],[_0x53bf('0x37'),'id'])||{});}})['then'](respondWithResult(_0x305100,null))['catch'](handleError(_0x305100,null));};exports['getMessages']=function(_0x3a0602,_0x3d98d2){var _0x50a6d9={'raw':![],'where':{}};var _0x1a2367={};var _0x5c199b={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x53bf('0x39')]({'where':{'id':_0x3a0602[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x3d98d2,null))['then'](function(_0x4f4678){if(_0x4f4678){_0x1a2367['model']=_['keys'](db[_0x53bf('0x3a')]['rawAttributes']);_0x1a2367[_0x53bf('0x24')]=_[_0x53bf('0x29')](_0x3a0602[_0x53bf('0x24')]);_0x1a2367[_0x53bf('0x3b')]=_[_0x53bf('0x2a')](_0x1a2367[_0x53bf('0x28')],_0x1a2367['query']);_0x50a6d9['attributes']=_['intersection'](_0x1a2367[_0x53bf('0x28')],qs['fields'](_0x3a0602[_0x53bf('0x24')][_0x53bf('0x2c')]));_0x50a6d9['attributes']=_0x50a6d9[_0x53bf('0x2b')][_0x53bf('0x2d')]?_0x50a6d9['attributes']:_0x1a2367[_0x53bf('0x28')];if(!_0x3a0602['query'][_0x53bf('0x3c')]('nolimit')){_0x50a6d9[_0x53bf('0x16')]=qs[_0x53bf('0x16')](_0x3a0602['query'][_0x53bf('0x16')]);_0x50a6d9[_0x53bf('0x13')]=qs[_0x53bf('0x13')](_0x3a0602[_0x53bf('0x24')][_0x53bf('0x13')]);}_0x50a6d9[_0x53bf('0x3d')]=qs[_0x53bf('0x3e')](_0x3a0602[_0x53bf('0x24')][_0x53bf('0x3e')]);_0x50a6d9[_0x53bf('0x3f')]=qs[_0x53bf('0x3b')](_['pick'](_0x3a0602[_0x53bf('0x24')],_0x1a2367[_0x53bf('0x3b')]));_0x50a6d9['where'][_0x53bf('0x40')]=_0x4f4678['id'];if(_0x3a0602[_0x53bf('0x24')][_0x53bf('0x41')]){_0x50a6d9['where']=_[_0x53bf('0x30')](_0x50a6d9[_0x53bf('0x3f')],{'$or':_[_0x53bf('0x1e')](_0x50a6d9[_0x53bf('0x2b')],function(_0x411856){var _0x827a82={};_0x827a82[_0x411856]={'$like':'%'+_0x3a0602[_0x53bf('0x24')][_0x53bf('0x41')]+'%'};return _0x827a82;})});}if(_0x3a0602['query']['$gte']){var _0x477b48=_0x3a0602[_0x53bf('0x24')][_0x53bf('0x42')][_0x53bf('0x43')](',');var _0x249614={};_0x249614[_0x477b48[0x0]]={'$gte':moment(_0x477b48[0x1])[_0x53bf('0x44')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50a6d9[_0x53bf('0x3f')]=_[_0x53bf('0x30')](_0x50a6d9['where'],_0x249614);}_0x50a6d9=_[_0x53bf('0x30')]({},_0x50a6d9,_0x3a0602['options']);return db[_0x53bf('0x3a')][_0x53bf('0x15')]({'where':_0x50a6d9[_0x53bf('0x3f')]})[_0x53bf('0x18')](function(_0x38cd4a){_0x5c199b[_0x53bf('0x15')]=_0x38cd4a;if(_0x3a0602[_0x53bf('0x24')][_0x53bf('0x2e')]){_0x50a6d9[_0x53bf('0x2f')]=[{'all':!![]}];}return db[_0x53bf('0x3a')]['findAll'](_0x50a6d9);})[_0x53bf('0x18')](function(_0x4127da){_0x5c199b[_0x53bf('0x45')]=_0x4127da;return _0x5c199b;});}})[_0x53bf('0x18')](respondWithFilteredResult(_0x3d98d2,_0x50a6d9))[_0x53bf('0x32')](handleError(_0x3d98d2,null));};exports[_0x53bf('0x46')]=function(_0x4d144e,_0x59d864){return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x4d144e[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x59d864,null))[_0x53bf('0x18')](function(_0x4ae3ae){if(_0x4ae3ae){return _0x4ae3ae['setTags'](_0x4d144e[_0x53bf('0x34')][_0x53bf('0x37')],_[_0x53bf('0x38')](_0x4d144e[_0x53bf('0x34')],[_0x53bf('0x37'),'id'])||{})[_0x53bf('0x47')](function(){return db[_0x53bf('0x48')]['findAll']({'attributes':['id','name',_0x53bf('0x49')],'where':{'id':_0x4d144e[_0x53bf('0x34')][_0x53bf('0x37')]}});})[_0x53bf('0x18')](function(_0x5b0823){socket[_0x53bf('0x4a')](_0x53bf('0x4b'),{'id':Number(_0x4d144e[_0x53bf('0x27')]['id']),'tags':_0x5b0823||[]});return{'id':Number(_0x4d144e[_0x53bf('0x27')]['id']),'tags':_0x5b0823||[]};});}})['then'](respondWithResult(_0x59d864,null))['catch'](handleError(_0x59d864,null));};exports['removeTags']=function(_0x50aafc,_0x7bb73){return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x50aafc[_0x53bf('0x27')]['id']}})[_0x53bf('0x18')](handleEntityNotFound(_0x7bb73,null))['then'](function(_0x29af85){if(_0x29af85){return _0x29af85[_0x53bf('0x4c')](_0x50aafc[_0x53bf('0x24')][_0x53bf('0x37')]);}})[_0x53bf('0x18')](respondWithStatusCode(_0x7bb73,null))[_0x53bf('0x32')](handleError(_0x7bb73,null));};exports[_0x53bf('0x4d')]=function(_0x196ef1,_0x2f91bc){var _0xd56760=moment()[_0x53bf('0x4e')]()[_0x53bf('0x4f')]();var _0x43a787=path[_0x53bf('0x50')](config[_0x53bf('0x51')],'server',_0x53bf('0x52'),'tmp');var _0x7ca19b=path['join'](_0x43a787,_0xd56760);var _0x45c27e=util[_0x53bf('0x44')](_0x53bf('0x53'),_0x196ef1[_0x53bf('0x27')]['id'],_0xd56760);var _0x523e2b=path[_0x53bf('0x50')](_0x43a787,_0x45c27e);var _0x1bed6e=[];_0x1bed6e[_0x53bf('0x54')]({'model':db[_0x53bf('0x55')],'as':_0x53bf('0x55'),'attributes':['id','fullname'],'raw':!![]});_0x1bed6e[_0x53bf('0x54')]({'model':db[_0x53bf('0x56')],'as':_0x53bf('0x57'),'attributes':['id',_0x53bf('0x58'),_0x53bf('0x59')],'raw':!![]});var _0xbdc28e=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x53bf('0x34'),_0x53bf('0x5a'),_0x53bf('0x5b'),_0x53bf('0x5c'),_0x53bf('0x5d')],'include':_0x1bed6e}];_0xbdc28e[_0x53bf('0x54')]({'model':db['SmsAccount'],'as':_0x53bf('0x5e'),'attributes':['id',_0x53bf('0x1b')]});_0xbdc28e[_0x53bf('0x54')]({'model':db[_0x53bf('0x55')],'as':_0x53bf('0x5f'),'attributes':['id','fullname']});return db[_0x53bf('0x1f')][_0x53bf('0x31')]({'where':{'id':_0x196ef1[_0x53bf('0x27')]['id']},'include':_0xbdc28e})[_0x53bf('0x18')](handleEntityNotFound(_0x2f91bc,null))[_0x53bf('0x18')](function(_0x4e7e41){if(_0x4e7e41){var _0x979ae3=_0x4e7e41['get']({'plain':!![]});fs[_0x53bf('0x60')](_0x7ca19b);var _0x58a82a={'channel':_0x53bf('0x61'),'account':_0x979ae3[_0x53bf('0x5e')]['name'],'agent':_0x979ae3[_0x53bf('0x5f')]?_0x979ae3[_0x53bf('0x5f')]['fullname']:_0x53bf('0x62'),'createdAt':moment(_0x979ae3[_0x53bf('0x5a')])[_0x53bf('0x44')](_0x53bf('0x63'))[_0x53bf('0x4f')](),'closedAt':_0x979ae3[_0x53bf('0x64')]?moment(_0x979ae3['closedAt'])[_0x53bf('0x44')](_0x53bf('0x63'))[_0x53bf('0x4f')]():'','disposition':_0x979ae3[_0x53bf('0x65')],'messages':_(_0x979ae3[_0x53bf('0x66')])[_0x53bf('0x41')]({'secret':![]})['map'](function(_0x2cb640){return{'date':moment(_0x2cb640[_0x53bf('0x5a')])[_0x53bf('0x44')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2cb640[_0x53bf('0x5b')]===_0x53bf('0x67')?_0x2cb640[_0x53bf('0x55')]?_0x2cb640[_0x53bf('0x55')]['fullname']:_0x53bf('0x68'):_0x2cb640[_0x53bf('0x57')][_0x53bf('0x58')]+(_0x2cb640['Contact']['lastName']?'\x20'+_0x2cb640['Contact'][_0x53bf('0x59')]:''),'body':_0x2cb640[_0x53bf('0x34')],'direction':_0x2cb640[_0x53bf('0x5b')]==='out'?'A':'C','secret':_0x2cb640['secret'],'read':_0x2cb640[_0x53bf('0x5d')]};})[_0x53bf('0x69')]()};return ejs[_0x53bf('0x6a')](path[_0x53bf('0x50')](config[_0x53bf('0x51')],'server',_0x53bf('0x6b'),_0x53bf('0x6c')),{'interaction':_0x58a82a})[_0x53bf('0x18')](function(_0x38d82a){var _0x590d3e=path['join'](_0x7ca19b,_0x53bf('0x6d')+_0x979ae3['id']+'-'+_0xd56760+_0x53bf('0x6e'));var _0x52616b={'path':_0x590d3e,'channel':_0x53bf('0x61'),'interactionId':_0x979ae3['id']};return pdf[_0x53bf('0x6f')](_0x38d82a,_0x52616b);})[_0x53bf('0x18')](function(){return new BPromise(function(_0x29b500,_0x381a7f){zipdir(_0x7ca19b,{'saveTo':_0x523e2b},function(_0x253808,_0x3d8b35){if(_0x253808)return _0x381a7f(_0x253808);return _0x29b500(_0x3d8b35);});})[_0x53bf('0x18')](function(){return new BPromise(function(_0x578262,_0x4ae296){rimraf(_0x7ca19b,function(_0x2af1e4){if(_0x2af1e4)_0x4ae296(_0x2af1e4);return _0x578262();});});})[_0x53bf('0x18')](function(){return _0x2f91bc[_0x53bf('0x4d')](_0x523e2b,_0x45c27e,function(_0x4ee6f8){if(_0x4ee6f8){console[_0x53bf('0x70')](_0x53bf('0x71'),_0x4ee6f8);}else{fs[_0x53bf('0x72')](_0x523e2b);}});});});}else{return _0x2f91bc['sendStatus'](0xc8);}})[_0x53bf('0x32')](handleError(_0x2f91bc,null));};
\ No newline at end of file
+var _0xd4bd=['User','fullname','CmContact','Contact','lastName','Messages','createdAt','secret','read','SmsAccount','Owner','mkdirSync','Sms','Account','N.A.','closed','format','toString','disposition','out','System','firstName','direction','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','name','send','index','map','SmsInteraction','fieldName','type','key','getOptions','findAll','sms','query','user','show','params','model','keys','rawAttributes','intersection','fields','attributes','includeAll','include','merge','options','find','create','catch','body','describe','addMessage','SmsMessage','ids','getMessages','findOne','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','SmsInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','push'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd4bd,0x1a3));var _0xdd4b=function(_0x32665e,_0x12740e){_0x32665e=_0x32665e-0x0;var _0x10be45=_0xd4bd[_0x32665e];return _0x10be45;};'use strict';var rimraf=require(_0xdd4b('0x0'));var zipdir=require(_0xdd4b('0x1'));var moment=require(_0xdd4b('0x2'));var BPromise=require('bluebird');var util=require(_0xdd4b('0x3'));var path=require(_0xdd4b('0x4'));var ejs=require(_0xdd4b('0x5'));var fs=require('fs');var _=require(_0xdd4b('0x6'));var Redis=require(_0xdd4b('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0xdd4b('0x8'));var pdf=require(_0xdd4b('0x9'));var logger=require(_0xdd4b('0xa'))('api');var config=require(_0xdd4b('0xb'));var db=require(_0xdd4b('0xc'))['db'];config[_0xdd4b('0xd')]=_[_0xdd4b('0xe')](config[_0xdd4b('0xd')],{'host':_0xdd4b('0xf'),'port':0x18eb});var socket=require(_0xdd4b('0x10'))(new Redis(config[_0xdd4b('0xd')]));require(_0xdd4b('0x11'))[_0xdd4b('0x12')](socket);function respondWithStatusCode(_0x2796b6,_0x3d5735){_0x3d5735=_0x3d5735||0xcc;return function(_0x1052ff){if(_0x1052ff){return _0x2796b6[_0xdd4b('0x13')](_0x3d5735);}return _0x2796b6['status'](_0x3d5735)[_0xdd4b('0x14')]();};}function respondWithResult(_0x464bb7,_0x3b518a){_0x3b518a=_0x3b518a||0xc8;return function(_0x562a98){if(_0x562a98){return _0x464bb7[_0xdd4b('0x15')](_0x3b518a)[_0xdd4b('0x16')](_0x562a98);}};}function respondWithFilteredResult(_0x137b08,_0x534f0b){return function(_0x15f5b3){if(_0x15f5b3){var _0x351374=typeof _0x534f0b[_0xdd4b('0x17')]==='undefined'&&typeof _0x534f0b[_0xdd4b('0x18')]===_0xdd4b('0x19');var _0x35625d=_0x15f5b3[_0xdd4b('0x1a')];var _0x971ce7=_0x351374?0x0:_0x534f0b['offset'];var _0x35b067=_0x351374?_0x15f5b3[_0xdd4b('0x1a')]:_0x534f0b[_0xdd4b('0x17')]+_0x534f0b[_0xdd4b('0x18')];var _0x484327;if(_0x35b067>=_0x35625d){_0x35b067=_0x35625d;_0x484327=0xc8;}else{_0x484327=0xce;}_0x137b08[_0xdd4b('0x15')](_0x484327);return _0x137b08[_0xdd4b('0x1b')](_0xdd4b('0x1c'),_0x971ce7+'-'+_0x35b067+'/'+_0x35625d)[_0xdd4b('0x16')](_0x15f5b3);}return null;};}function saveUpdates(_0xdd9229){return function(_0x3d2c91){if(_0x3d2c91){return _0x3d2c91[_0xdd4b('0x1d')](_0xdd9229)[_0xdd4b('0x1e')](function(_0x1d7045){return _0x1d7045;});}return null;};}function removeEntity(_0x2f2942){return function(_0x72aa7e){if(_0x72aa7e){return _0x72aa7e[_0xdd4b('0x1f')]()['then'](function(){_0x2f2942['status'](0xcc)[_0xdd4b('0x14')]();});}};}function handleEntityNotFound(_0x233d16){return function(_0x252b5a){if(!_0x252b5a){_0x233d16[_0xdd4b('0x13')](0x194);}return _0x252b5a;};}function handleError(_0x3ff131,_0x35f334){_0x35f334=_0x35f334||0x1f4;return function(_0x39d542){logger[_0xdd4b('0x20')](_0x39d542['stack']);if(_0x39d542[_0xdd4b('0x21')]){delete _0x39d542[_0xdd4b('0x21')];}_0x3ff131['status'](_0x35f334)[_0xdd4b('0x22')](_0x39d542);};}exports[_0xdd4b('0x23')]=function(_0x268612,_0x3b2b47){var _0x4f26ff={};var _0x23b8dd=_[_0xdd4b('0x24')](db[_0xdd4b('0x25')]['rawAttributes'],function(_0x33e631){return{'name':_0x33e631[_0xdd4b('0x26')],'type':_0x33e631[_0xdd4b('0x27')][_0xdd4b('0x28')]};});_0x4f26ff=qs[_0xdd4b('0x29')](_0x23b8dd,_0x268612);return interaction[_0xdd4b('0x2a')](_0xdd4b('0x2b'),_0x268612[_0xdd4b('0x2c')],_0x268612[_0xdd4b('0x2d')],_0x4f26ff,_0x23b8dd)[_0xdd4b('0x1e')](respondWithFilteredResult(_0x3b2b47,_0x4f26ff))['catch'](handleError(_0x3b2b47,null));};exports[_0xdd4b('0x2e')]=function(_0x4017a2,_0x41bee3){var _0x3fc4f1={'raw':![],'where':{'id':_0x4017a2[_0xdd4b('0x2f')]['id']}},_0x42f306={};_0x42f306[_0xdd4b('0x30')]=_[_0xdd4b('0x31')](db['SmsInteraction'][_0xdd4b('0x32')]);_0x42f306['query']=_['keys'](_0x4017a2[_0xdd4b('0x2c')]);_0x42f306['filters']=_[_0xdd4b('0x33')](_0x42f306[_0xdd4b('0x30')],_0x42f306['query']);_0x3fc4f1['attributes']=_[_0xdd4b('0x33')](_0x42f306['model'],qs[_0xdd4b('0x34')](_0x4017a2[_0xdd4b('0x2c')]['fields']));_0x3fc4f1[_0xdd4b('0x35')]=_0x3fc4f1['attributes']['length']?_0x3fc4f1[_0xdd4b('0x35')]:_0x42f306[_0xdd4b('0x30')];if(_0x4017a2[_0xdd4b('0x2c')][_0xdd4b('0x36')]){_0x3fc4f1[_0xdd4b('0x37')]=[{'all':!![]}];}_0x3fc4f1=_[_0xdd4b('0x38')]({},_0x3fc4f1,_0x4017a2[_0xdd4b('0x39')]);return db[_0xdd4b('0x25')][_0xdd4b('0x3a')](_0x3fc4f1)[_0xdd4b('0x1e')](handleEntityNotFound(_0x41bee3,null))['then'](respondWithResult(_0x41bee3,null))['catch'](handleError(_0x41bee3,null));};exports[_0xdd4b('0x3b')]=function(_0x298e1f,_0x368ad6){return db[_0xdd4b('0x25')]['create'](_0x298e1f['body'],{})[_0xdd4b('0x1e')](respondWithResult(_0x368ad6,0xc9))[_0xdd4b('0x3c')](handleError(_0x368ad6,null));};exports['update']=function(_0x4d75bc,_0x5cf2da){if(_0x4d75bc[_0xdd4b('0x3d')]['id']){delete _0x4d75bc[_0xdd4b('0x3d')]['id'];}return db[_0xdd4b('0x25')][_0xdd4b('0x3a')]({'where':{'id':_0x4d75bc['params']['id']}})['then'](handleEntityNotFound(_0x5cf2da,null))['then'](saveUpdates(_0x4d75bc['body'],null))['then'](respondWithResult(_0x5cf2da,null))['catch'](handleError(_0x5cf2da,null));};exports[_0xdd4b('0x1f')]=function(_0x237e4c,_0x248e6b){return db[_0xdd4b('0x25')]['find']({'where':{'id':_0x237e4c[_0xdd4b('0x2f')]['id']}})['then'](handleEntityNotFound(_0x248e6b,null))[_0xdd4b('0x1e')](removeEntity(_0x248e6b,null))[_0xdd4b('0x3c')](handleError(_0x248e6b,null));};exports['describe']=function(_0x157eca,_0xa8adb0){return db[_0xdd4b('0x25')][_0xdd4b('0x3e')]()[_0xdd4b('0x1e')](respondWithResult(_0xa8adb0,null))['catch'](handleError(_0xa8adb0,null));};exports[_0xdd4b('0x3f')]=function(_0x142b6c,_0x1a1a1d){return db[_0xdd4b('0x40')][_0xdd4b('0x3a')]({'where':{'id':_0x142b6c[_0xdd4b('0x2f')]['id']}})[_0xdd4b('0x1e')](handleEntityNotFound(_0x1a1a1d,null))[_0xdd4b('0x1e')](function(_0x4ac0d7){if(_0x4ac0d7){return _0x4ac0d7[_0xdd4b('0x3f')](_0x142b6c['body'][_0xdd4b('0x41')],_['omit'](_0x142b6c[_0xdd4b('0x3d')],[_0xdd4b('0x41'),'id'])||{});}})[_0xdd4b('0x1e')](respondWithResult(_0x1a1a1d,null))[_0xdd4b('0x3c')](handleError(_0x1a1a1d,null));};exports[_0xdd4b('0x42')]=function(_0x145f17,_0x9a3eba){var _0x1f5680={'raw':![],'where':{}};var _0x292286={};var _0x475c19={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xdd4b('0x43')]({'where':{'id':_0x145f17[_0xdd4b('0x2f')]['id']}})['then'](handleEntityNotFound(_0x9a3eba,null))[_0xdd4b('0x1e')](function(_0x21e6bb){if(_0x21e6bb){_0x292286[_0xdd4b('0x30')]=_['keys'](db[_0xdd4b('0x40')][_0xdd4b('0x32')]);_0x292286[_0xdd4b('0x2c')]=_[_0xdd4b('0x31')](_0x145f17[_0xdd4b('0x2c')]);_0x292286['filters']=_[_0xdd4b('0x33')](_0x292286[_0xdd4b('0x30')],_0x292286[_0xdd4b('0x2c')]);_0x1f5680[_0xdd4b('0x35')]=_['intersection'](_0x292286[_0xdd4b('0x30')],qs[_0xdd4b('0x34')](_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x34')]));_0x1f5680['attributes']=_0x1f5680[_0xdd4b('0x35')][_0xdd4b('0x44')]?_0x1f5680['attributes']:_0x292286[_0xdd4b('0x30')];if(!_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x45')](_0xdd4b('0x46'))){_0x1f5680[_0xdd4b('0x18')]=qs[_0xdd4b('0x18')](_0x145f17[_0xdd4b('0x2c')]['limit']);_0x1f5680[_0xdd4b('0x17')]=qs[_0xdd4b('0x17')](_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x17')]);}_0x1f5680[_0xdd4b('0x47')]=qs[_0xdd4b('0x48')](_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x48')]);_0x1f5680[_0xdd4b('0x49')]=qs[_0xdd4b('0x4a')](_[_0xdd4b('0x4b')](_0x145f17[_0xdd4b('0x2c')],_0x292286[_0xdd4b('0x4a')]));_0x1f5680[_0xdd4b('0x49')][_0xdd4b('0x4c')]=_0x21e6bb['id'];if(_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x4d')]){_0x1f5680[_0xdd4b('0x49')]=_['merge'](_0x1f5680[_0xdd4b('0x49')],{'$or':_[_0xdd4b('0x24')](_0x1f5680['attributes'],function(_0x2f7768){var _0xb5eae5={};_0xb5eae5[_0x2f7768]={'$like':'%'+_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x4d')]+'%'};return _0xb5eae5;})});}if(_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x4e')]){var _0x40c396=_0x145f17['query'][_0xdd4b('0x4e')][_0xdd4b('0x4f')](',');var _0x3a6d4f={};_0x3a6d4f[_0x40c396[0x0]]={'$gte':moment(_0x40c396[0x1])['format'](_0xdd4b('0x50'))};_0x1f5680[_0xdd4b('0x49')]=_[_0xdd4b('0x38')](_0x1f5680['where'],_0x3a6d4f);}_0x1f5680=_[_0xdd4b('0x38')]({},_0x1f5680,_0x145f17[_0xdd4b('0x39')]);return db[_0xdd4b('0x40')][_0xdd4b('0x1a')]({'where':_0x1f5680[_0xdd4b('0x49')]})[_0xdd4b('0x1e')](function(_0x4cf925){_0x475c19[_0xdd4b('0x1a')]=_0x4cf925;if(_0x145f17[_0xdd4b('0x2c')][_0xdd4b('0x36')]){_0x1f5680['include']=[{'all':!![]}];}return db['SmsMessage'][_0xdd4b('0x2a')](_0x1f5680);})[_0xdd4b('0x1e')](function(_0x291845){_0x475c19['rows']=_0x291845;return _0x475c19;});}})[_0xdd4b('0x1e')](respondWithFilteredResult(_0x9a3eba,_0x1f5680))[_0xdd4b('0x3c')](handleError(_0x9a3eba,null));};exports[_0xdd4b('0x51')]=function(_0x37f487,_0x5c6e98){return db[_0xdd4b('0x25')]['find']({'where':{'id':_0x37f487['params']['id']}})['then'](handleEntityNotFound(_0x5c6e98,null))[_0xdd4b('0x1e')](function(_0x2e65c1){if(_0x2e65c1){return _0x2e65c1[_0xdd4b('0x52')](_0x37f487['body'][_0xdd4b('0x41')],_['omit'](_0x37f487['body'],[_0xdd4b('0x41'),'id'])||{})[_0xdd4b('0x53')](function(){return db[_0xdd4b('0x54')][_0xdd4b('0x2a')]({'attributes':['id','name',_0xdd4b('0x55')],'where':{'id':_0x37f487[_0xdd4b('0x3d')][_0xdd4b('0x41')]}});})[_0xdd4b('0x1e')](function(_0x3fa219){socket[_0xdd4b('0x56')](_0xdd4b('0x57'),{'id':Number(_0x37f487[_0xdd4b('0x2f')]['id']),'tags':_0x3fa219||[]});return{'id':Number(_0x37f487[_0xdd4b('0x2f')]['id']),'tags':_0x3fa219||[]};});}})[_0xdd4b('0x1e')](respondWithResult(_0x5c6e98,null))[_0xdd4b('0x3c')](handleError(_0x5c6e98,null));};exports[_0xdd4b('0x58')]=function(_0x2f4507,_0x588b9a){return db[_0xdd4b('0x25')][_0xdd4b('0x3a')]({'where':{'id':_0x2f4507[_0xdd4b('0x2f')]['id']}})[_0xdd4b('0x1e')](handleEntityNotFound(_0x588b9a,null))[_0xdd4b('0x1e')](function(_0x4498e8){if(_0x4498e8){return _0x4498e8[_0xdd4b('0x58')](_0x2f4507['query']['ids']);}})['then'](respondWithStatusCode(_0x588b9a,null))['catch'](handleError(_0x588b9a,null));};exports[_0xdd4b('0x59')]=function(_0x594363,_0x213abd){var _0x2734a4=moment()[_0xdd4b('0x5a')]()['toString']();var _0x42a393=path[_0xdd4b('0x5b')](config[_0xdd4b('0x5c')],_0xdd4b('0x5d'),_0xdd4b('0x5e'),_0xdd4b('0x5f'));var _0x9c7e8=path[_0xdd4b('0x5b')](_0x42a393,_0x2734a4);var _0x5808f7=util['format']('transcript-%d-%s.zip',_0x594363['params']['id'],_0x2734a4);var _0x397fe7=path[_0xdd4b('0x5b')](_0x42a393,_0x5808f7);var _0xc13df3=[];_0xc13df3[_0xdd4b('0x60')]({'model':db[_0xdd4b('0x61')],'as':'User','attributes':['id',_0xdd4b('0x62')],'raw':!![]});_0xc13df3['push']({'model':db[_0xdd4b('0x63')],'as':_0xdd4b('0x64'),'attributes':['id','firstName',_0xdd4b('0x65')],'raw':!![]});var _0x26f1dd=[{'model':db[_0xdd4b('0x40')],'as':_0xdd4b('0x66'),'attributes':['id',_0xdd4b('0x3d'),_0xdd4b('0x67'),'direction',_0xdd4b('0x68'),_0xdd4b('0x69')],'include':_0xc13df3}];_0x26f1dd['push']({'model':db[_0xdd4b('0x6a')],'as':'Account','attributes':['id',_0xdd4b('0x21')]});_0x26f1dd[_0xdd4b('0x60')]({'model':db[_0xdd4b('0x61')],'as':_0xdd4b('0x6b'),'attributes':['id',_0xdd4b('0x62')]});return db['SmsInteraction'][_0xdd4b('0x3a')]({'where':{'id':_0x594363[_0xdd4b('0x2f')]['id']},'include':_0x26f1dd})[_0xdd4b('0x1e')](handleEntityNotFound(_0x213abd,null))['then'](function(_0xafac08){if(_0xafac08){var _0x298be5=_0xafac08['get']({'plain':!![]});fs[_0xdd4b('0x6c')](_0x9c7e8);var _0x1ae638={'channel':_0xdd4b('0x6d'),'account':_0x298be5[_0xdd4b('0x6e')][_0xdd4b('0x21')],'agent':_0x298be5[_0xdd4b('0x6b')]?_0x298be5[_0xdd4b('0x6b')]['fullname']:_0xdd4b('0x6f'),'createdAt':moment(_0x298be5[_0xdd4b('0x67')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x298be5[_0xdd4b('0x70')]?moment(_0x298be5['closedAt'])[_0xdd4b('0x71')](_0xdd4b('0x50'))[_0xdd4b('0x72')]():'','disposition':_0x298be5[_0xdd4b('0x73')],'messages':_(_0x298be5[_0xdd4b('0x66')])['filter']({'secret':![]})[_0xdd4b('0x24')](function(_0x37c959){return{'date':moment(_0x37c959['createdAt'])[_0xdd4b('0x71')](_0xdd4b('0x50'))[_0xdd4b('0x72')](),'sender':_0x37c959['direction']===_0xdd4b('0x74')?_0x37c959[_0xdd4b('0x61')]?_0x37c959['User'][_0xdd4b('0x62')]:_0xdd4b('0x75'):_0x37c959[_0xdd4b('0x64')][_0xdd4b('0x76')]+(_0x37c959['Contact']['lastName']?'\x20'+_0x37c959['Contact'][_0xdd4b('0x65')]:''),'body':_0x37c959['body'],'direction':_0x37c959[_0xdd4b('0x77')]===_0xdd4b('0x74')?'A':'C','secret':_0x37c959['secret'],'read':_0x37c959[_0xdd4b('0x69')]};})[_0xdd4b('0x78')]()};return ejs[_0xdd4b('0x79')](path[_0xdd4b('0x5b')](config['root'],_0xdd4b('0x5d'),_0xdd4b('0x7a'),_0xdd4b('0x7b')),{'interaction':_0x1ae638})[_0xdd4b('0x1e')](function(_0x724ce2){var _0x322ac3=path[_0xdd4b('0x5b')](_0x9c7e8,_0xdd4b('0x7c')+_0x298be5['id']+'-'+_0x2734a4+_0xdd4b('0x7d'));var _0x4dcd02={'path':_0x322ac3,'channel':'Sms','interactionId':_0x298be5['id']};return pdf[_0xdd4b('0x7e')](_0x724ce2,_0x4dcd02);})[_0xdd4b('0x1e')](function(){return new BPromise(function(_0x49e6e2,_0x5159b7){zipdir(_0x9c7e8,{'saveTo':_0x397fe7},function(_0x17fecd,_0x22c5aa){if(_0x17fecd)return _0x5159b7(_0x17fecd);return _0x49e6e2(_0x22c5aa);});})['then'](function(){return new BPromise(function(_0x1862aa,_0x1d2cae){rimraf(_0x9c7e8,function(_0x4eb5ac){if(_0x4eb5ac)_0x1d2cae(_0x4eb5ac);return _0x1862aa();});});})[_0xdd4b('0x1e')](function(){return _0x213abd[_0xdd4b('0x59')](_0x397fe7,_0x5808f7,function(_0x41d993){if(_0x41d993){console['log'](_0xdd4b('0x7f'),_0x41d993);}else{fs[_0xdd4b('0x80')](_0x397fe7);}});});});}else{return _0x213abd[_0xdd4b('0x13')](0xc8);}})[_0xdd4b('0x3c')](handleError(_0x213abd,null));};
\ No newline at end of file
index a958be3..f365bb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf2f=['setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2838ee,_0x5eb6db){_0x2838ee=_0x2838ee-0x0;var _0x400a83=_0xcf2f[_0x2838ee];return _0x400a83;};'use strict';var EventEmitter=require(_0xfcf2('0x0'));var SmsInteraction=require(_0xfcf2('0x1'))['db'][_0xfcf2('0x2')];var SmsMessage=require(_0xfcf2('0x1'))['db'][_0xfcf2('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfcf2('0x4'),'afterUpdate':_0xfcf2('0x5'),'afterDestroy':_0xfcf2('0x6')};function emitEvent(_0x34bcaf){return function(_0x179e60,_0x167a77,_0x1e6d99){_0x179e60[_0xfcf2('0x7')]({'attributes':['id'],'raw':!![]})[_0xfcf2('0x8')](function(_0x157f48){_0x179e60[_0xfcf2('0x9')](_0xfcf2('0xa'),_0x157f48[_0xfcf2('0xb')](function(_0x13ce18){return{'id':_0x13ce18['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x179e60['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4d6fc9){_0x179e60[_0xfcf2('0x9')](_0xfcf2('0xc'),_0x4d6fc9['length']);SmsInteractionEvents[_0xfcf2('0xd')](_0x34bcaf+':'+_0x179e60['id'],_0x179e60);SmsInteractionEvents[_0xfcf2('0xd')](_0x34bcaf,_0x179e60);_0x1e6d99(null);})[_0xfcf2('0xe')](_0x1e6d99(null));};}for(var e in events){if(events[_0xfcf2('0xf')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
+var _0x93e9=['getUsers','then','setDataValue','map','findAll','unreadMessages','emit','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save'];(function(_0x129517,_0x5863c9){var _0xa5090d=function(_0x52acce){while(--_0x52acce){_0x129517['push'](_0x129517['shift']());}};_0xa5090d(++_0x5863c9);}(_0x93e9,0xcc));var _0x993e=function(_0x29e4c0,_0xf8b14d){_0x29e4c0=_0x29e4c0-0x0;var _0x15b64b=_0x93e9[_0x29e4c0];return _0x15b64b;};'use strict';var EventEmitter=require(_0x993e('0x0'));var SmsInteraction=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var SmsMessage=require(_0x993e('0x1'))['db'][_0x993e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x993e('0x4')](0x0);var events={'afterCreate':_0x993e('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1b762e){return function(_0x255045,_0x15ce9b,_0x45f52e){_0x255045[_0x993e('0x6')]({'attributes':['id'],'raw':!![]})[_0x993e('0x7')](function(_0x12ac94){_0x255045[_0x993e('0x8')]('Users',_0x12ac94[_0x993e('0x9')](function(_0x69ff1){return{'id':_0x69ff1['id']};}));return SmsMessage[_0x993e('0xa')]({'where':{'SmsInteractionId':_0x255045['id'],'direction':'in','read':![]},'raw':!![]});})[_0x993e('0x7')](function(_0x2cd389){_0x255045[_0x993e('0x8')](_0x993e('0xb'),_0x2cd389['length']);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e+':'+_0x255045['id'],_0x255045);SmsInteractionEvents[_0x993e('0xc')](_0x1b762e,_0x255045);_0x45f52e(null);})['catch'](_0x45f52e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x993e('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents;
\ No newline at end of file
index 1601441..4c4fa6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6055=['sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction'];(function(_0x437cc3,_0x3d2627){var _0x4da099=function(_0x1def1f){while(--_0x1def1f){_0x437cc3['push'](_0x437cc3['shift']());}};_0x4da099(++_0x3d2627);}(_0x6055,0x6c));var _0x5605=function(_0x50e071,_0x5945d5){_0x50e071=_0x50e071-0x0;var _0x4d13d0=_0x6055[_0x50e071];return _0x4d13d0;};'use strict';var _=require(_0x5605('0x0'));var util=require(_0x5605('0x1'));var logger=require(_0x5605('0x2'))(_0x5605('0x3'));var moment=require(_0x5605('0x4'));var BPromise=require('bluebird');var rp=require(_0x5605('0x5'));var fs=require('fs');var path=require(_0x5605('0x6'));var rimraf=require(_0x5605('0x7'));var config=require(_0x5605('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x5605('0x9')]=function(_0x4c193b,_0x479aca){return _0x4c193b['define'](_0x5605('0xa'),attributes,{'tableName':_0x5605('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x253da3,_0x4c982c,_0x2aba7d){if(_0x253da3[_0x5605('0xc')](_0x5605('0xd'))){_0x253da3[_0x5605('0xe')]=moment()[_0x5605('0xf')](_0x5605('0x10'));}_0x2aba7d(null,_0x253da3);}}});};
\ No newline at end of file
+var _0xfe95=['exports','define','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes'];(function(_0x299e7b,_0x473781){var _0x27b1b0=function(_0x2dc637){while(--_0x2dc637){_0x299e7b['push'](_0x299e7b['shift']());}};_0x27b1b0(++_0x473781);}(_0xfe95,0x6f));var _0x5fe9=function(_0x8cb592,_0x1d250d){_0x8cb592=_0x8cb592-0x0;var _0x108d23=_0xfe95[_0x8cb592];return _0x108d23;};'use strict';var _=require(_0x5fe9('0x0'));var util=require(_0x5fe9('0x1'));var logger=require(_0x5fe9('0x2'))(_0x5fe9('0x3'));var moment=require(_0x5fe9('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fe9('0x5'));var fs=require('fs');var path=require(_0x5fe9('0x6'));var rimraf=require('rimraf');var config=require(_0x5fe9('0x7'));var attributes=require(_0x5fe9('0x8'));module[_0x5fe9('0x9')]=function(_0x568649,_0xcf525){return _0x568649[_0x5fe9('0xa')]('SmsInteraction',attributes,{'tableName':_0x5fe9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2fed78,_0x2a6699,_0x49eb8e){if(_0x2fed78['changed'](_0x5fe9('0xc'))){_0x2fed78['closedAt']=moment()[_0x5fe9('0xd')](_0x5fe9('0xe'));}_0x49eb8e(null,_0x2fed78);}}});};
\ No newline at end of file
index 91bf278..26a2958 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xced8=['info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','where','attributes','stringify','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./smsInteraction.socket','request','then'];(function(_0x2de4d7,_0x481696){var _0x38be2a=function(_0x21ba6d){while(--_0x21ba6d){_0x2de4d7['push'](_0x2de4d7['shift']());}};_0x38be2a(++_0x481696);}(_0xced8,0xae));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x8ced('0x0'));var moment=require(_0x8ced('0x1'));var BPromise=require(_0x8ced('0x2'));var rs=require(_0x8ced('0x3'));var fs=require('fs');var Redis=require(_0x8ced('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8ced('0x5'));var logger=require(_0x8ced('0x6'))(_0x8ced('0x7'));var config=require(_0x8ced('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8ced('0x9')][_0x8ced('0xa')]({'port':0x232a});config[_0x8ced('0xb')]=_['defaults'](config[_0x8ced('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ced('0xc'))(new Redis(config[_0x8ced('0xb')]));require(_0x8ced('0xd'))['register'](socket);function respondWithRpcPromise(_0x424eed,_0x348522,_0x5b2969){return new BPromise(function(_0x20e064,_0x5b3480){return client[_0x8ced('0xe')](_0x424eed,_0x5b2969)[_0x8ced('0xf')](function(_0x2db798){logger[_0x8ced('0x10')](_0x8ced('0x11'),_0x348522,_0x8ced('0x12'));logger[_0x8ced('0x13')](_0x8ced('0x14'),_0x348522,_0x8ced('0x12'),JSON['stringify'](_0x2db798));if(_0x2db798[_0x8ced('0x15')]){if(_0x2db798[_0x8ced('0x15')]['code']===0x1f4){logger['error'](_0x8ced('0x11'),_0x348522,_0x2db798[_0x8ced('0x15')][_0x8ced('0x16')]);return _0x5b3480(_0x2db798['error'][_0x8ced('0x16')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x348522,_0x2db798[_0x8ced('0x15')][_0x8ced('0x16')]);return _0x20e064(_0x2db798[_0x8ced('0x15')][_0x8ced('0x16')]);}else{logger[_0x8ced('0x10')]('SmsInteraction,\x20%s,\x20%s',_0x348522,'request\x20sent');_0x20e064(_0x2db798[_0x8ced('0x17')][_0x8ced('0x16')]);}})[_0x8ced('0x18')](function(_0x202a7c){logger[_0x8ced('0x15')](_0x8ced('0x11'),_0x348522,_0x202a7c);_0x5b3480(_0x202a7c);});});}exports[_0x8ced('0x19')]=function(_0x37aa0e){var _0x3d82d9=this;return new Promise(function(_0x3bc21d,_0x3f666e){return db[_0x8ced('0x1a')]['update'](_0x37aa0e[_0x8ced('0x1b')],{'raw':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e[_0x8ced('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e['options'][_0x8ced('0x1d')]||null:null,'attributes':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e[_0x8ced('0x1c')][_0x8ced('0x1e')]||null:null,'limit':_0x37aa0e[_0x8ced('0x1c')]?_0x37aa0e[_0x8ced('0x1c')]['limit']||null:null})[_0x8ced('0xf')](function(_0x1585f6){logger['info'](_0x8ced('0x19'),_0x37aa0e);logger[_0x8ced('0x13')]('UpdateSmsInteraction',_0x37aa0e,JSON[_0x8ced('0x1f')](_0x1585f6));_0x3bc21d(_0x1585f6);})['catch'](function(_0x5c8a0c){logger[_0x8ced('0x15')](_0x8ced('0x19'),_0x5c8a0c[_0x8ced('0x16')],_0x37aa0e);_0x3f666e(_0x3d82d9['error'](0x1f4,_0x5c8a0c['message']));});});};exports[_0x8ced('0x20')]=function(_0x1cf6e0){return new Promise(function(_0x575a17,_0x35e53d){return db[_0x8ced('0x1a')][_0x8ced('0x21')]({'where':_0x1cf6e0[_0x8ced('0x1c')]?_0x1cf6e0[_0x8ced('0x1c')][_0x8ced('0x1d')]||null:null})[_0x8ced('0xf')](function(_0x1ed073){if(_0x1ed073){return _0x1ed073[_0x8ced('0x22')](_0x1cf6e0[_0x8ced('0x1b')][_0x8ced('0x23')],_[_0x8ced('0x24')](_0x1cf6e0[_0x8ced('0x1b')],[_0x8ced('0x23'),'id'])||{});}})['spread'](function(_0x288633){logger['info'](_0x8ced('0x25'),_0x1cf6e0);logger[_0x8ced('0x13')](_0x8ced('0x25'),_0x1cf6e0,JSON[_0x8ced('0x1f')](_0x288633));_0x575a17(_0x288633);})[_0x8ced('0x18')](function(_0x182ee7){logger[_0x8ced('0x15')](_0x8ced('0x25'),_0x182ee7[_0x8ced('0x16')],_0x1cf6e0);_0x35e53d(_this[_0x8ced('0x15')](0x1f4,_0x182ee7['message']));});});};
\ No newline at end of file
+var _0xf677=['catch','AddTagsToSmsInteraction','find','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','stringify'];(function(_0x4ab7a9,_0x423b0e){var _0x2f0af4=function(_0x250361){while(--_0x250361){_0x4ab7a9['push'](_0x4ab7a9['shift']());}};_0x2f0af4(++_0x423b0e);}(_0xf677,0x7b));var _0x7f67=function(_0x15681d,_0x40d775){_0x15681d=_0x15681d-0x0;var _0x21f3df=_0xf677[_0x15681d];return _0x21f3df;};'use strict';var _=require(_0x7f67('0x0'));var util=require('util');var moment=require(_0x7f67('0x1'));var BPromise=require(_0x7f67('0x2'));var rs=require(_0x7f67('0x3'));var fs=require('fs');var Redis=require(_0x7f67('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f67('0x5'));var logger=require(_0x7f67('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7f67('0x7'));var client=jayson[_0x7f67('0x8')]['http']({'port':0x232a});config[_0x7f67('0x9')]=_[_0x7f67('0xa')](config[_0x7f67('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7f67('0xb'))(new Redis(config[_0x7f67('0x9')]));require(_0x7f67('0xc'))[_0x7f67('0xd')](socket);function respondWithRpcPromise(_0xc897cb,_0x4f7f1e,_0x1279dc){return new BPromise(function(_0x4cd4d7,_0x39e148){return client['request'](_0xc897cb,_0x1279dc)[_0x7f67('0xe')](function(_0x4bae7b){logger[_0x7f67('0xf')](_0x7f67('0x10'),_0x4f7f1e,_0x7f67('0x11'));logger[_0x7f67('0x12')](_0x7f67('0x13'),_0x4f7f1e,_0x7f67('0x11'),JSON['stringify'](_0x4bae7b));if(_0x4bae7b[_0x7f67('0x14')]){if(_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x15')]===0x1f4){logger['error'](_0x7f67('0x10'),_0x4f7f1e,_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x16')]);return _0x39e148(_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x16')]);}logger[_0x7f67('0x14')](_0x7f67('0x10'),_0x4f7f1e,_0x4bae7b[_0x7f67('0x14')][_0x7f67('0x16')]);return _0x4cd4d7(_0x4bae7b['error'][_0x7f67('0x16')]);}else{logger[_0x7f67('0xf')](_0x7f67('0x10'),_0x4f7f1e,_0x7f67('0x11'));_0x4cd4d7(_0x4bae7b['result'][_0x7f67('0x16')]);}})['catch'](function(_0x56c53b){logger[_0x7f67('0x14')](_0x7f67('0x10'),_0x4f7f1e,_0x56c53b);_0x39e148(_0x56c53b);});});}exports[_0x7f67('0x17')]=function(_0x48eae9){var _0x226d71=this;return new Promise(function(_0x5422cf,_0x34d698){return db[_0x7f67('0x18')][_0x7f67('0x19')](_0x48eae9[_0x7f67('0x1a')],{'raw':_0x48eae9[_0x7f67('0x1b')]?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48eae9[_0x7f67('0x1b')]?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1d')]||null:null,'attributes':_0x48eae9['options']?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1e')]||null:null,'limit':_0x48eae9[_0x7f67('0x1b')]?_0x48eae9[_0x7f67('0x1b')][_0x7f67('0x1f')]||null:null})[_0x7f67('0xe')](function(_0x32603c){logger['info'](_0x7f67('0x17'),_0x48eae9);logger['debug']('UpdateSmsInteraction',_0x48eae9,JSON[_0x7f67('0x20')](_0x32603c));_0x5422cf(_0x32603c);})[_0x7f67('0x21')](function(_0x5ec404){logger[_0x7f67('0x14')](_0x7f67('0x17'),_0x5ec404['message'],_0x48eae9);_0x34d698(_0x226d71[_0x7f67('0x14')](0x1f4,_0x5ec404[_0x7f67('0x16')]));});});};exports[_0x7f67('0x22')]=function(_0x1682bb){return new Promise(function(_0xbe9a2f,_0x34829c){return db[_0x7f67('0x18')][_0x7f67('0x23')]({'where':_0x1682bb['options']?_0x1682bb[_0x7f67('0x1b')][_0x7f67('0x1d')]||null:null})[_0x7f67('0xe')](function(_0x8f558e){if(_0x8f558e){return _0x8f558e['addTags'](_0x1682bb[_0x7f67('0x1a')]['ids'],_[_0x7f67('0x24')](_0x1682bb[_0x7f67('0x1a')],[_0x7f67('0x25'),'id'])||{});}})['spread'](function(_0x5b6d53){logger[_0x7f67('0xf')]('AddTags',_0x1682bb);logger[_0x7f67('0x12')](_0x7f67('0x26'),_0x1682bb,JSON[_0x7f67('0x20')](_0x5b6d53));_0xbe9a2f(_0x5b6d53);})[_0x7f67('0x21')](function(_0x4ecdf4){logger['error']('AddTags',_0x4ecdf4[_0x7f67('0x16')],_0x1682bb);_0x34829c(_this[_0x7f67('0x14')](0x1f4,_0x4ecdf4[_0x7f67('0x16')]));});});};
\ No newline at end of file
index 9ef2804..bff721a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x613c=['length','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x5730f3,_0x8cf6ac){var _0xf3a5da=function(_0x24d78b){while(--_0x24d78b){_0x5730f3['push'](_0x5730f3['shift']());}};_0xf3a5da(++_0x8cf6ac);}(_0x613c,0x141));var _0xc613=function(_0x1be7d1,_0x4ac868){_0x1be7d1=_0x1be7d1-0x0;var _0x2bf9b2=_0x613c[_0x1be7d1];return _0x2bf9b2;};'use strict';var SmsInteractionEvents=require(_0xc613('0x0'));var events=[_0xc613('0x1'),_0xc613('0x2'),_0xc613('0x3')];function createListener(_0x468752,_0x3a63f4){return function(_0x3a9f81){_0x3a63f4[_0xc613('0x4')](_0x468752,_0x3a9f81);};}function removeListener(_0x1482be,_0x46ae70){return function(){SmsInteractionEvents[_0xc613('0x5')](_0x1482be,_0x46ae70);};}exports[_0xc613('0x6')]=function(_0x179761){for(var _0x944a53=0x0,_0x4164cd=events[_0xc613('0x7')];_0x944a53<_0x4164cd;_0x944a53++){var _0x2b6708=events[_0x944a53];var _0x3fb483=createListener('smsInteraction:'+_0x2b6708,_0x179761);SmsInteractionEvents['on'](_0x2b6708,_0x3fb483);}};
\ No newline at end of file
+var _0x3d9a=['smsInteraction:','save','remove','emit','removeListener','register','length'];(function(_0x445c98,_0x3d0002){var _0x4768fb=function(_0x22ecc6){while(--_0x22ecc6){_0x445c98['push'](_0x445c98['shift']());}};_0x4768fb(++_0x3d0002);}(_0x3d9a,0x1ac));var _0xa3d9=function(_0x407e72,_0x16e547){_0x407e72=_0x407e72-0x0;var _0xc6f0fa=_0x3d9a[_0x407e72];return _0xc6f0fa;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa3d9('0x0'),_0xa3d9('0x1'),'update'];function createListener(_0x18935f,_0x471aa4){return function(_0x3edcb7){_0x471aa4[_0xa3d9('0x2')](_0x18935f,_0x3edcb7);};}function removeListener(_0x5f1ef5,_0x4e6e07){return function(){SmsInteractionEvents[_0xa3d9('0x3')](_0x5f1ef5,_0x4e6e07);};}exports[_0xa3d9('0x4')]=function(_0x2b752b){for(var _0x38ff85=0x0,_0x3c302c=events[_0xa3d9('0x5')];_0x38ff85<_0x3c302c;_0x38ff85++){var _0x47ee56=events[_0x38ff85];var _0x8d1d17=createListener(_0xa3d9('0x6')+_0x47ee56,_0x2b752b);SmsInteractionEvents['on'](_0x47ee56,_0x8d1d17);}};
\ No newline at end of file
index 9a772ae..e881263 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1399=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','index','get','/describe','describe','isAuthenticated','show','tracked','create','post','/:id/status','status','put','accept','/:id/reject','reject','destroy','exports'];(function(_0x3b63bd,_0x34e3b1){var _0x26053c=function(_0x5e3022){while(--_0x5e3022){_0x3b63bd['push'](_0x3b63bd['shift']());}};_0x26053c(++_0x34e3b1);}(_0x1399,0x16c));var _0x9139=function(_0x1fddd6,_0x35c1c8){_0x1fddd6=_0x1fddd6-0x0;var _0xdd2ba2=_0x1399[_0x1fddd6];return _0xdd2ba2;};'use strict';var multer=require(_0x9139('0x0'));var util=require(_0x9139('0x1'));var path=require('path');var timeout=require(_0x9139('0x2'));var express=require('express');var router=express[_0x9139('0x3')]();var fs_extra=require(_0x9139('0x4'));var auth=require(_0x9139('0x5'));var interaction=require(_0x9139('0x6'));var config=require(_0x9139('0x7'));var controller=require(_0x9139('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9139('0x9')]);router[_0x9139('0xa')](_0x9139('0xb'),auth['isAuthenticated'](),controller[_0x9139('0xc')]);router['get']('/:id',auth[_0x9139('0xd')](),controller[_0x9139('0xe')]);router['post']('/',auth[_0x9139('0xd')](),interaction[_0x9139('0xf')]('sms','smsmessage:create'),controller[_0x9139('0x10')]);router[_0x9139('0x11')](_0x9139('0x12'),controller[_0x9139('0x13')]);router[_0x9139('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9139('0x14')]('/:id/accept',auth[_0x9139('0xd')](),controller[_0x9139('0x15')]);router[_0x9139('0x14')](_0x9139('0x16'),auth['isAuthenticated'](),controller[_0x9139('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9139('0x18')]);module[_0x9139('0x19')]=router;
\ No newline at end of file
+var _0xcfa5=['smsmessage:create','post','/:id/status','status','put','/:id','update','/:id/accept','reject','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','show','tracked','sms'];(function(_0x13862a,_0x2fa0cd){var _0xb47015=function(_0x27bf35){while(--_0x27bf35){_0x13862a['push'](_0x13862a['shift']());}};_0xb47015(++_0x2fa0cd);}(_0xcfa5,0xbb));var _0x5cfa=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xcfa5[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x5cfa('0x0'));var util=require(_0x5cfa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5cfa('0x2'));var interaction=require(_0x5cfa('0x3'));var config=require(_0x5cfa('0x4'));var controller=require(_0x5cfa('0x5'));router[_0x5cfa('0x6')]('/',auth['isAuthenticated'](),controller[_0x5cfa('0x7')]);router['get'](_0x5cfa('0x8'),auth[_0x5cfa('0x9')](),controller['describe']);router[_0x5cfa('0x6')]('/:id',auth[_0x5cfa('0x9')](),controller[_0x5cfa('0xa')]);router['post']('/',auth[_0x5cfa('0x9')](),interaction[_0x5cfa('0xb')](_0x5cfa('0xc'),_0x5cfa('0xd')),controller['create']);router[_0x5cfa('0xe')](_0x5cfa('0xf'),controller[_0x5cfa('0x10')]);router[_0x5cfa('0x11')](_0x5cfa('0x12'),auth['isAuthenticated'](),controller[_0x5cfa('0x13')]);router[_0x5cfa('0x11')](_0x5cfa('0x14'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth[_0x5cfa('0x9')](),controller[_0x5cfa('0x15')]);router[_0x5cfa('0x16')](_0x5cfa('0x12'),auth[_0x5cfa('0x9')](),controller[_0x5cfa('0x17')]);module[_0x5cfa('0x18')]=router;
\ No newline at end of file
index a702fda..3a8bb7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2303=['out','STRING','DATE','BOOLEAN','TEXT','sequelize','exports'];(function(_0x155c64,_0x26ff95){var _0x1f154a=function(_0xbc46e4){while(--_0xbc46e4){_0x155c64['push'](_0x155c64['shift']());}};_0x1f154a(++_0x26ff95);}(_0x2303,0x75));var _0x3230=function(_0x47d18a,_0xd53074){_0x47d18a=_0x47d18a-0x0;var _0x130c43=_0x2303[_0x47d18a];return _0x130c43;};'use strict';var Sequelize=require(_0x3230('0x0'));module[_0x3230('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3230('0x2')),'defaultValue':_0x3230('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3230('0x3')](0xbe)},'phone':{'type':Sequelize[_0x3230('0x3')]},'readAt':{'type':Sequelize[_0x3230('0x4')]},'secret':{'type':Sequelize[_0x3230('0x5')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3230('0x3')]},'providerResponse':{'type':Sequelize[_0x3230('0x6')]}};
\ No newline at end of file
+var _0x5aa7=['TEXT','sequelize','exports','out','STRING','DATE'];(function(_0x3998bd,_0x29c296){var _0x26071a=function(_0x403ac9){while(--_0x403ac9){_0x3998bd['push'](_0x3998bd['shift']());}};_0x26071a(++_0x29c296);}(_0x5aa7,0x151));var _0x75aa=function(_0x38be75,_0x5cbe73){_0x38be75=_0x38be75-0x0;var _0x5e7598=_0x5aa7[_0x38be75];return _0x5e7598;};'use strict';var Sequelize=require(_0x75aa('0x0'));module[_0x75aa('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x75aa('0x2')),'defaultValue':_0x75aa('0x2'),'allowNull':![]},'messageId':{'type':Sequelize[_0x75aa('0x3')](0xbe)},'phone':{'type':Sequelize[_0x75aa('0x3')]},'readAt':{'type':Sequelize[_0x75aa('0x4')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x75aa('0x3')]},'providerResponse':{'type':Sequelize[_0x75aa('0x5')]}};
\ No newline at end of file
index 14b28ee..fa46ccf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88c7=['info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','options','SmsMessage','findAll','rows','catch','params','includeAll','include','find','create','body','describe','sms-interactions','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','fullname','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','reject','get','SmsInteractionId','null','RejectMessage','sequelize','SELECT','contact','email','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x88c7,0x6f));var _0x788c=function(_0x371108,_0x5e74cd){_0x371108=_0x371108-0x0;var _0x4ee008=_0x88c7[_0x371108];return _0x4ee008;};'use strict';var emlformat=require(_0x788c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x788c('0x1'));var rp=require(_0x788c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x788c('0x3'));var util=require(_0x788c('0x4'));var path=require('path');var sox=require(_0x788c('0x5'));var csv=require(_0x788c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x788c('0x7'));var _=require(_0x788c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x788c('0x9'));var deskjs=require(_0x788c('0xa'));var toCsv=require(_0x788c('0x6'));var querystring=require(_0x788c('0xb'));var Papa=require(_0x788c('0xc'));var Redis=require('ioredis');var authService=require(_0x788c('0xd'));var qs=require(_0x788c('0xe'));var as=require(_0x788c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x788c('0x10'))(_0x788c('0x11'));var utils=require(_0x788c('0x12'));var config=require(_0x788c('0x13'));var licenseUtil=require(_0x788c('0x14'));var db=require(_0x788c('0x15'))['db'];config['redis']=_[_0x788c('0x16')](config['redis'],{'host':_0x788c('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x788c('0x18')]));require(_0x788c('0x19'))[_0x788c('0x1a')](socket);var jayson=require(_0x788c('0x1b'));var client=jayson[_0x788c('0x1c')][_0x788c('0x1d')]({'port':0x232c});var client9002=jayson[_0x788c('0x1c')][_0x788c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2b6e32,_0x41d920,_0x67dc6c,_0xa118b5){return new BPromise(function(_0x2c57c3,_0x5c942e){var _0x2f3b41=_0xa118b5||client;return _0x2f3b41[_0x788c('0x1e')](_0x2b6e32,_0x67dc6c)[_0x788c('0x1f')](function(_0x2988df){logger[_0x788c('0x20')](_0x788c('0x21'),_0x41d920,_0x788c('0x22'));logger[_0x788c('0x23')](_0x788c('0x24'),_0x41d920,_0x788c('0x22'),JSON['stringify'](_0x2988df));if(_0x2988df[_0x788c('0x25')]){if(_0x2988df[_0x788c('0x25')][_0x788c('0x26')]===0x1f4){logger[_0x788c('0x25')](_0x788c('0x21'),_0x41d920,_0x2988df[_0x788c('0x25')][_0x788c('0x27')]);return _0x5c942e(_0x2988df[_0x788c('0x25')]['message']);}logger[_0x788c('0x25')](_0x788c('0x21'),_0x41d920,_0x2988df[_0x788c('0x25')][_0x788c('0x27')]);return _0x2c57c3(_0x2988df[_0x788c('0x25')][_0x788c('0x27')]);}else{logger[_0x788c('0x20')](_0x788c('0x21'),_0x41d920,'request\x20sent');_0x2c57c3(_0x2988df[_0x788c('0x28')][_0x788c('0x27')]);}})['catch'](function(_0x14e2f1){logger[_0x788c('0x25')](_0x788c('0x21'),_0x41d920,_0x14e2f1);_0x5c942e(_0x14e2f1);});});}function respondWithStatusCode(_0x5cc1b7,_0x29e4f3){_0x29e4f3=_0x29e4f3||0xcc;return function(_0xfa09c8){if(_0xfa09c8){return _0x5cc1b7[_0x788c('0x29')](_0x29e4f3);}return _0x5cc1b7[_0x788c('0x2a')](_0x29e4f3)[_0x788c('0x2b')]();};}function respondWithResult(_0x2ea11c,_0x271218){_0x271218=_0x271218||0xc8;return function(_0x12fdbc){if(_0x12fdbc){return _0x2ea11c[_0x788c('0x2a')](_0x271218)['json'](_0x12fdbc);}};}function respondWithFilteredResult(_0x4380f4,_0x57966d){return function(_0x297ea6){if(_0x297ea6){var _0x18b271=typeof _0x57966d[_0x788c('0x2c')]===_0x788c('0x2d')&&typeof _0x57966d[_0x788c('0x2e')]===_0x788c('0x2d');var _0x3fcc37=_0x297ea6[_0x788c('0x2f')];var _0x4d41ac=_0x18b271?0x0:_0x57966d[_0x788c('0x2c')];var _0x4e9b20=_0x18b271?_0x297ea6[_0x788c('0x2f')]:_0x57966d[_0x788c('0x2c')]+_0x57966d[_0x788c('0x2e')];var _0x3a0de3;if(_0x4e9b20>=_0x3fcc37){_0x4e9b20=_0x3fcc37;_0x3a0de3=0xc8;}else{_0x3a0de3=0xce;}_0x4380f4[_0x788c('0x2a')](_0x3a0de3);return _0x4380f4[_0x788c('0x30')]('Content-Range',_0x4d41ac+'-'+_0x4e9b20+'/'+_0x3fcc37)[_0x788c('0x31')](_0x297ea6);}return null;};}function patchUpdates(_0x5e4378){return function(_0x46999f){try{jsonpatch['apply'](_0x46999f,_0x5e4378,!![]);}catch(_0x4245ce){return BPromise['reject'](_0x4245ce);}return _0x46999f[_0x788c('0x32')]();};}function saveUpdates(_0x54d0bf,_0x50b8f1){return function(_0xafbbc4){if(_0xafbbc4){return _0xafbbc4[_0x788c('0x33')](_0x54d0bf)['then'](function(_0x40b93d){return _0x40b93d;});}return null;};}function removeEntity(_0x45a0d4,_0x52921a){return function(_0x1a4ce8){if(_0x1a4ce8){return _0x1a4ce8['destroy']()['then'](function(){_0x45a0d4[_0x788c('0x2a')](0xcc)[_0x788c('0x2b')]();});}};}function handleEntityNotFound(_0x3caa2e,_0x581a67){return function(_0x4bf35c){if(!_0x4bf35c){_0x3caa2e[_0x788c('0x29')](0x194);}return _0x4bf35c;};}function handleError(_0x412717,_0x4ab290){_0x4ab290=_0x4ab290||0x1f4;return function(_0x4d31c1){logger['error'](_0x4d31c1[_0x788c('0x34')]);if(_0x4d31c1['name']){delete _0x4d31c1[_0x788c('0x35')];}_0x412717[_0x788c('0x2a')](_0x4ab290)[_0x788c('0x36')](_0x4d31c1);};}exports[_0x788c('0x37')]=function(_0x9a0da7,_0x46549){var _0x583ede={},_0x3aaf49={},_0x4709bf={'count':0x0,'rows':[]};var _0x162715=_['map'](db['SmsMessage'][_0x788c('0x38')],function(_0x58f4db){return{'name':_0x58f4db['fieldName'],'type':_0x58f4db[_0x788c('0x39')][_0x788c('0x3a')]};});_0x3aaf49[_0x788c('0x3b')]=_[_0x788c('0x3c')](_0x162715,_0x788c('0x35'));_0x3aaf49[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x9a0da7['query']);_0x3aaf49['filters']=_[_0x788c('0x3f')](_0x3aaf49[_0x788c('0x3b')],_0x3aaf49['query']);_0x583ede[_0x788c('0x40')]=_[_0x788c('0x3f')](_0x3aaf49[_0x788c('0x3b')],qs['fields'](_0x9a0da7[_0x788c('0x3d')][_0x788c('0x41')]));_0x583ede[_0x788c('0x40')]=_0x583ede[_0x788c('0x40')][_0x788c('0x42')]?_0x583ede[_0x788c('0x40')]:_0x3aaf49[_0x788c('0x3b')];if(!_0x9a0da7[_0x788c('0x3d')][_0x788c('0x43')](_0x788c('0x44'))){_0x583ede[_0x788c('0x2e')]=qs[_0x788c('0x2e')](_0x9a0da7[_0x788c('0x3d')]['limit']);_0x583ede[_0x788c('0x2c')]=qs[_0x788c('0x2c')](_0x9a0da7[_0x788c('0x3d')]['offset']);}_0x583ede['order']=qs[_0x788c('0x45')](_0x9a0da7[_0x788c('0x3d')]['sort']);_0x583ede[_0x788c('0x46')]=qs[_0x788c('0x47')](_[_0x788c('0x48')](_0x9a0da7[_0x788c('0x3d')],_0x3aaf49[_0x788c('0x47')]),_0x162715);if(_0x9a0da7['query']['filter']){_0x583ede[_0x788c('0x46')]=_['merge'](_0x583ede[_0x788c('0x46')],{'$or':_[_0x788c('0x3c')](_0x162715,function(_0x243b70){if(_0x243b70[_0x788c('0x39')]!=='VIRTUAL'){var _0x3d012b={};_0x3d012b[_0x243b70[_0x788c('0x35')]]={'$like':'%'+_0x9a0da7[_0x788c('0x3d')]['filter']+'%'};return _0x3d012b;}})});}_0x583ede=_[_0x788c('0x49')]({},_0x583ede,_0x9a0da7[_0x788c('0x4a')]);var _0x275d1c={'where':_0x583ede[_0x788c('0x46')]};return db[_0x788c('0x4b')][_0x788c('0x2f')](_0x275d1c)[_0x788c('0x1f')](function(_0x1fe905){_0x4709bf['count']=_0x1fe905;if(_0x9a0da7['query']['includeAll']){_0x583ede['include']=[{'all':!![]}];}return db['SmsMessage'][_0x788c('0x4c')](_0x583ede);})['then'](function(_0xe947f2){_0x4709bf[_0x788c('0x4d')]=_0xe947f2;return _0x4709bf;})[_0x788c('0x1f')](respondWithFilteredResult(_0x46549,_0x583ede))[_0x788c('0x4e')](handleError(_0x46549,null));};exports['show']=function(_0x41307c,_0x17e84c){var _0x2a67b0={'raw':!![],'where':{'id':_0x41307c[_0x788c('0x4f')]['id']}},_0x28cfb5={};_0x28cfb5[_0x788c('0x3b')]=_[_0x788c('0x3e')](db[_0x788c('0x4b')][_0x788c('0x38')]);_0x28cfb5[_0x788c('0x3d')]=_[_0x788c('0x3e')](_0x41307c['query']);_0x28cfb5['filters']=_[_0x788c('0x3f')](_0x28cfb5[_0x788c('0x3b')],_0x28cfb5[_0x788c('0x3d')]);_0x2a67b0['attributes']=_['intersection'](_0x28cfb5[_0x788c('0x3b')],qs[_0x788c('0x41')](_0x41307c[_0x788c('0x3d')][_0x788c('0x41')]));_0x2a67b0['attributes']=_0x2a67b0['attributes']['length']?_0x2a67b0[_0x788c('0x40')]:_0x28cfb5[_0x788c('0x3b')];if(_0x41307c[_0x788c('0x3d')][_0x788c('0x50')]){_0x2a67b0[_0x788c('0x51')]=[{'all':!![]}];}_0x2a67b0=_['merge']({},_0x2a67b0,_0x41307c[_0x788c('0x4a')]);return db[_0x788c('0x4b')][_0x788c('0x52')](_0x2a67b0)[_0x788c('0x1f')](handleEntityNotFound(_0x17e84c,null))[_0x788c('0x1f')](respondWithResult(_0x17e84c,null))[_0x788c('0x4e')](handleError(_0x17e84c,null));};exports[_0x788c('0x53')]=function(_0xa71323,_0x206424){return db['SmsMessage'][_0x788c('0x53')](_0xa71323[_0x788c('0x54')],{})['then'](respondWithResult(_0x206424,0xc9))[_0x788c('0x4e')](handleError(_0x206424,null));};exports[_0x788c('0x33')]=function(_0x40e0f0,_0x5f3583){if(_0x40e0f0[_0x788c('0x54')]['id']){delete _0x40e0f0['body']['id'];}return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x40e0f0[_0x788c('0x4f')]['id']}})[_0x788c('0x1f')](handleEntityNotFound(_0x5f3583,null))[_0x788c('0x1f')](saveUpdates(_0x40e0f0[_0x788c('0x54')],null))[_0x788c('0x1f')](respondWithResult(_0x5f3583,null))['catch'](handleError(_0x5f3583,null));};exports['destroy']=function(_0x1b492a,_0x4a7ca8){return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x1b492a[_0x788c('0x4f')]['id']}})[_0x788c('0x1f')](handleEntityNotFound(_0x4a7ca8,null))[_0x788c('0x1f')](removeEntity(_0x4a7ca8,null))[_0x788c('0x4e')](handleError(_0x4a7ca8,null));};exports[_0x788c('0x55')]=function(_0x484998,_0x131ff8){return db[_0x788c('0x4b')]['describe']()['then'](respondWithResult(_0x131ff8,null))[_0x788c('0x4e')](handleError(_0x131ff8,null));};var interaction_log=require(_0x788c('0x10'))(_0x788c('0x56'));exports['accept']=function(_0x439e29,_0x8497cb,_0x4b6e8d){var _0x2734d5={'agent':{},'channel':_0x788c('0x57')};if(_0x439e29[_0x788c('0x54')]['id']){delete _0x439e29[_0x788c('0x54')]['id'];}_0x439e29['body']['read']=!![];_0x439e29[_0x788c('0x54')][_0x788c('0x58')]=moment()[_0x788c('0x59')](_0x788c('0x5a'));_0x439e29['body'][_0x788c('0x5b')]=_0x439e29[_0x788c('0x54')][_0x788c('0x5b')]||_0x439e29[_0x788c('0x5c')]['id'];_0x2734d5[_0x788c('0x5d')]['id']=_0x439e29[_0x788c('0x54')][_0x788c('0x5b')];return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x439e29['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x8497cb,null))[_0x788c('0x1f')](saveUpdates(_0x439e29[_0x788c('0x54')],null))[_0x788c('0x1f')](function(_0x3fd07a){if(_0x3fd07a){_0x2734d5[_0x788c('0x27')]=_0x3fd07a['get']({'plain':!![]});return db[_0x788c('0x5e')][_0x788c('0x52')]({'where':{'id':_0x3fd07a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x8497cb,null))['then'](function(_0x54487b){if(_0x54487b){return _0x54487b[_0x788c('0x33')]({'UserId':_0x439e29['body'][_0x788c('0x5b')],'read1stAt':_['isNil'](_0x54487b['read1stAt'])?moment()['format'](_0x788c('0x5a')):undefined});}return null;})[_0x788c('0x1f')](function(_0x1d62e7){if(_0x1d62e7){_0x2734d5[_0x788c('0x5f')]=_0x1d62e7['get']({'plain':!![]});interaction_log[_0x788c('0x20')](_0x788c('0x60'),_0x439e29[_0x788c('0x5c')]['id'],_0x439e29['user'][_0x788c('0x35')],_0x439e29[_0x788c('0x5c')][_0x788c('0x61')],_0x2734d5['interaction']['id'],_0x439e29[_0x788c('0x54')]?JSON[_0x788c('0x62')](_0x439e29[_0x788c('0x54')]):'null');return respondWithRpcPromise(_0x788c('0x63'),_0x788c('0x64'),_0x2734d5);}return null;})[_0x788c('0x1f')](function(_0x5a3906){var _0x201d45=_0x788c('0x65')+_0x5a3906[_0x788c('0x27')][_0x788c('0x66')];return db['sequelize'][_0x788c('0x3d')](_0x201d45,{'type':db[_0x788c('0x67')][_0x788c('0x68')]['SELECT'],'raw':!![]})[_0x788c('0x1f')](function(_0x5b5192){return _0x5b5192;});})['then'](function(_0x2d4a5d){if(_0x2d4a5d){_0x2734d5[_0x788c('0x27')]['contact']=_0x2d4a5d[0x0];if(!_0x439e29[_0x788c('0x54')][_0x788c('0x5b')])return;return db[_0x788c('0x69')]['find']({'where':{'id':_0x439e29[_0x788c('0x54')][_0x788c('0x5b')],'role':'agent'},'attributes':['id',_0x788c('0x35'),_0x788c('0x6a'),'email',_0x788c('0x6b')],'raw':!![]});}return null;})[_0x788c('0x1f')](function(_0x484bf2){if(!_0x484bf2)return null;_0x2734d5[_0x788c('0x27')][_0x788c('0x5d')]=_0x484bf2;return _0x2734d5;})[_0x788c('0x1f')](function(_0x2370a9){if(_0x2370a9){if(_0x439e29[_0x788c('0x54')][_0x788c('0x6c')]){_0x2734d5[_0x788c('0x27')][_0x788c('0x6d')]=util[_0x788c('0x59')]('SIP/%s',_0x439e29['user'][_0x788c('0x35')]);_0x2734d5[_0x788c('0x27')]['channel']=_0x2734d5[_0x788c('0x6e')];_0x2734d5[_0x788c('0x27')][_0x788c('0x6f')]=_0x2734d5['channel'];_0x2734d5[_0x788c('0x27')][_0x788c('0x70')]=_0x788c('0x71');return respondWithRpcPromise(_0x788c('0x72'),_0x788c('0x72'),{'event':_0x788c('0x73'),'message':_0x2734d5[_0x788c('0x27')]},client9002)[_0x788c('0x1f')](function(){return _0x2734d5;});}return _0x2734d5;}return null;})['then'](respondWithResult(_0x8497cb,null))[_0x788c('0x4e')](handleError(_0x8497cb,null));};var interaction_log=require('../../config/logger')(_0x788c('0x56'));exports[_0x788c('0x74')]=function(_0x4e286a,_0x4687fe,_0x563b13){var _0x13b901={'agent':{},'channel':_0x788c('0x57')};if(_0x4e286a[_0x788c('0x54')]['id']){delete _0x4e286a[_0x788c('0x54')]['id'];}_0x4e286a[_0x788c('0x54')][_0x788c('0x5b')]=_0x4e286a[_0x788c('0x54')][_0x788c('0x5b')]||_0x4e286a[_0x788c('0x5c')]['id'];_0x13b901['agent']['id']=_0x4e286a['body']['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x4e286a[_0x788c('0x4f')]['id'],'UserId':null}})[_0x788c('0x1f')](handleEntityNotFound(_0x4687fe,null))[_0x788c('0x1f')](function(_0x4cad59){if(_0x4cad59){_0x13b901[_0x788c('0x27')]=_0x4cad59[_0x788c('0x75')]({'plain':!![]});return db[_0x788c('0x5e')][_0x788c('0x52')]({'where':{'id':_0x4cad59[_0x788c('0x76')]}});}return null;})[_0x788c('0x1f')](handleEntityNotFound(_0x4687fe,null))[_0x788c('0x1f')](function(_0x45f761){if(_0x45f761){_0x13b901[_0x788c('0x5f')]=_0x45f761[_0x788c('0x75')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e286a[_0x788c('0x5c')]['id'],_0x4e286a[_0x788c('0x5c')][_0x788c('0x35')],_0x4e286a[_0x788c('0x5c')][_0x788c('0x61')],_0x13b901[_0x788c('0x5f')]['id'],_0x4e286a[_0x788c('0x54')]?JSON[_0x788c('0x62')](_0x4e286a[_0x788c('0x54')]):_0x788c('0x77'));return respondWithRpcPromise(_0x788c('0x78'),'rejectMessage',_0x13b901);}return null;})[_0x788c('0x1f')](function(_0x365d69){var _0x403ea9=_0x788c('0x65')+_0x365d69[_0x788c('0x27')][_0x788c('0x66')];return db[_0x788c('0x79')][_0x788c('0x3d')](_0x403ea9,{'type':db[_0x788c('0x67')][_0x788c('0x68')][_0x788c('0x7a')],'raw':!![]})['then'](function(_0x2487c9){return _0x2487c9;});})[_0x788c('0x1f')](function(_0x2cb153){if(_0x2cb153){_0x13b901['message'][_0x788c('0x7b')]=_0x2cb153[0x0];if(!_0x4e286a['body'][_0x788c('0x5b')])return;return db['User'][_0x788c('0x52')]({'where':{'id':_0x4e286a['body'][_0x788c('0x5b')],'role':_0x788c('0x5d')},'attributes':['id',_0x788c('0x35'),_0x788c('0x6a'),_0x788c('0x7c'),'internal'],'raw':!![]});}return null;})[_0x788c('0x1f')](function(_0x8c6d17){if(!_0x8c6d17)return null;_0x13b901['message'][_0x788c('0x5d')]=_0x8c6d17;return _0x13b901;})[_0x788c('0x1f')](function(_0x425fdd){if(_0x425fdd){_0x425fdd['message']['interface']=util[_0x788c('0x59')](_0x788c('0x7d'),_0x4e286a['user']['name']);_0x425fdd[_0x788c('0x27')][_0x788c('0x6e')]=_0x13b901[_0x788c('0x6e')];_0x425fdd[_0x788c('0x27')][_0x788c('0x6f')]=_0x13b901[_0x788c('0x6e')];_0x425fdd[_0x788c('0x27')][_0x788c('0x70')]=_0x788c('0x74');respondWithRpcPromise(_0x788c('0x72'),_0x788c('0x72'),{'event':_0x788c('0x7e'),'message':_0x425fdd[_0x788c('0x27')]},client9002);return _0x13b901;}return null;})[_0x788c('0x1f')](respondWithResult(_0x4687fe,null))[_0x788c('0x4e')](handleError(_0x4687fe,null));};exports[_0x788c('0x2a')]=function(_0x248995,_0x55da35,_0x2e271f){if(_0x248995['body']['id']){delete _0x248995['body']['id'];}var _0x136dc6;return db[_0x788c('0x4b')][_0x788c('0x52')]({'where':{'id':_0x248995[_0x788c('0x4f')]['id']}})[_0x788c('0x1f')](handleEntityNotFound(_0x55da35,null))['then'](function(_0xb656a3){if(_0xb656a3){_0x136dc6=_0xb656a3;return db[_0x788c('0x7f')]['find']({'where':{'id':_0xb656a3[_0x788c('0x80')]}});}})[_0x788c('0x1f')](handleEntityNotFound(_0x55da35,null))[_0x788c('0x1f')](function(_0x3be8a3){if(_0x3be8a3){logger[_0x788c('0x23')](_0x788c('0x24'),_0x788c('0x2a'),_0x788c('0x81'),_0x3be8a3[_0x788c('0x39')],util[_0x788c('0x82')](_0x248995['body'],{'showHidden':![],'depth':null}));switch(_0x3be8a3[_0x788c('0x39')]){case _0x788c('0x83'):if(_0x248995[_0x788c('0x54')]['MessageSid']&&_0x248995[_0x788c('0x54')]['MessageSid']===_0x136dc6[_0x788c('0x84')]){return _0x136dc6[_0x788c('0x33')]({'read':!![]});}else{logger['error'](_0x788c('0x85'),_0x788c('0x2a'),'twilio',util[_0x788c('0x82')](_0x248995[_0x788c('0x54')],{'showHidden':![],'depth':null}));}break;case _0x788c('0x86'):if(_0x248995[_0x788c('0x54')]['MessageUUID']&&_0x248995['body']['MessageUUID']===_0x136dc6[_0x788c('0x84')]&&_['indexOf']([_0x788c('0x87'),_0x788c('0x88')],_0x248995[_0x788c('0x54')][_0x788c('0x89')])>=0x0){return _0x136dc6[_0x788c('0x33')]({'read':!![]});}else{logger[_0x788c('0x25')](_0x788c('0x85'),_0x788c('0x2a'),_0x788c('0x8a'),util['inspect'](_0x248995['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x13fff3=_0x248995[_0x788c('0x54')][_0x788c('0x8b')][0x0];if(_0x13fff3[_0x788c('0x2a')][_0x788c('0x8c')]===_0x788c('0x8d')){return _0x136dc6[_0x788c('0x33')]({'read':!![]});}else{logger[_0x788c('0x25')](_0x788c('0x85'),'status',_0x788c('0x8e'),util[_0x788c('0x82')](_0x248995[_0x788c('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x136dc6;}})[_0x788c('0x1f')](respondWithResult(_0x55da35,null))['catch'](handleError(_0x55da35,null));};
\ No newline at end of file
+var _0xe635=['groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','register','jayson/promise','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','sendStatus','stack','name','send','SmsMessage','rawAttributes','fieldName','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','keys','create','body','destroy','describe','../../config/logger','sms-interactions','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','find','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','acceptmessage','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','MessageUUID','indexOf','delivered','Status','plivio','infobip','results'];(function(_0x23e9d4,_0x1063fd){var _0x4ab2b0=function(_0x3ff3e3){while(--_0x3ff3e3){_0x23e9d4['push'](_0x23e9d4['shift']());}};_0x4ab2b0(++_0x1063fd);}(_0xe635,0x1be));var _0x5e63=function(_0x3b9479,_0x59da7b){_0x3b9479=_0x3b9479-0x0;var _0x33ab54=_0xe635[_0x3b9479];return _0x33ab54;};'use strict';var emlformat=require(_0x5e63('0x0'));var rimraf=require(_0x5e63('0x1'));var zipdir=require(_0x5e63('0x2'));var jsonpatch=require(_0x5e63('0x3'));var rp=require(_0x5e63('0x4'));var moment=require(_0x5e63('0x5'));var BPromise=require(_0x5e63('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5e63('0x7'));var sox=require(_0x5e63('0x8'));var csv=require(_0x5e63('0x9'));var ejs=require(_0x5e63('0xa'));var fs=require('fs');var fs_extra=require(_0x5e63('0xb'));var _=require(_0x5e63('0xc'));var squel=require(_0x5e63('0xd'));var crypto=require(_0x5e63('0xe'));var jsforce=require(_0x5e63('0xf'));var deskjs=require(_0x5e63('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5e63('0x11'));var Papa=require(_0x5e63('0x12'));var Redis=require(_0x5e63('0x13'));var authService=require(_0x5e63('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5e63('0x15'));var hardwareService=require(_0x5e63('0x16'));var logger=require('../../config/logger')(_0x5e63('0x17'));var utils=require(_0x5e63('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5e63('0x19'));var db=require('../../mysqldb')['db'];config[_0x5e63('0x1a')]=_[_0x5e63('0x1b')](config[_0x5e63('0x1a')],{'host':_0x5e63('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsMessage.socket')[_0x5e63('0x1d')](socket);var jayson=require(_0x5e63('0x1e'));var client=jayson['client'][_0x5e63('0x1f')]({'port':0x232c});var client9002=jayson[_0x5e63('0x20')][_0x5e63('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x491e27,_0x42a714,_0xe0b567,_0x4715f9){return new BPromise(function(_0x357f40,_0x3d7dc3){var _0x578c68=_0x4715f9||client;return _0x578c68[_0x5e63('0x21')](_0x491e27,_0xe0b567)[_0x5e63('0x22')](function(_0x264aca){logger[_0x5e63('0x23')](_0x5e63('0x24'),_0x42a714,'request\x20sent');logger[_0x5e63('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42a714,'request\x20sent',JSON[_0x5e63('0x26')](_0x264aca));if(_0x264aca[_0x5e63('0x27')]){if(_0x264aca[_0x5e63('0x27')][_0x5e63('0x28')]===0x1f4){logger[_0x5e63('0x27')](_0x5e63('0x24'),_0x42a714,_0x264aca[_0x5e63('0x27')][_0x5e63('0x29')]);return _0x3d7dc3(_0x264aca[_0x5e63('0x27')][_0x5e63('0x29')]);}logger['error'](_0x5e63('0x24'),_0x42a714,_0x264aca['error']['message']);return _0x357f40(_0x264aca[_0x5e63('0x27')][_0x5e63('0x29')]);}else{logger[_0x5e63('0x23')](_0x5e63('0x24'),_0x42a714,_0x5e63('0x2a'));_0x357f40(_0x264aca[_0x5e63('0x2b')][_0x5e63('0x29')]);}})['catch'](function(_0x275715){logger['error'](_0x5e63('0x24'),_0x42a714,_0x275715);_0x3d7dc3(_0x275715);});});}function respondWithStatusCode(_0x398e47,_0x5b468d){_0x5b468d=_0x5b468d||0xcc;return function(_0x3f9440){if(_0x3f9440){return _0x398e47['sendStatus'](_0x5b468d);}return _0x398e47[_0x5e63('0x2c')](_0x5b468d)[_0x5e63('0x2d')]();};}function respondWithResult(_0x548718,_0x4e0a86){_0x4e0a86=_0x4e0a86||0xc8;return function(_0x1f2eff){if(_0x1f2eff){return _0x548718[_0x5e63('0x2c')](_0x4e0a86)[_0x5e63('0x2e')](_0x1f2eff);}};}function respondWithFilteredResult(_0x395bb2,_0x38da60){return function(_0x25c635){if(_0x25c635){var _0x4b3e42=typeof _0x38da60[_0x5e63('0x2f')]==='undefined'&&typeof _0x38da60[_0x5e63('0x30')]===_0x5e63('0x31');var _0x3b9ce0=_0x25c635[_0x5e63('0x32')];var _0xfc4a65=_0x4b3e42?0x0:_0x38da60[_0x5e63('0x2f')];var _0x5db415=_0x4b3e42?_0x25c635[_0x5e63('0x32')]:_0x38da60[_0x5e63('0x2f')]+_0x38da60[_0x5e63('0x30')];var _0x57ecc6;if(_0x5db415>=_0x3b9ce0){_0x5db415=_0x3b9ce0;_0x57ecc6=0xc8;}else{_0x57ecc6=0xce;}_0x395bb2[_0x5e63('0x2c')](_0x57ecc6);return _0x395bb2[_0x5e63('0x33')](_0x5e63('0x34'),_0xfc4a65+'-'+_0x5db415+'/'+_0x3b9ce0)[_0x5e63('0x2e')](_0x25c635);}return null;};}function patchUpdates(_0x565ac9){return function(_0x5c3b88){try{jsonpatch['apply'](_0x5c3b88,_0x565ac9,!![]);}catch(_0x581c9e){return BPromise[_0x5e63('0x35')](_0x581c9e);}return _0x5c3b88[_0x5e63('0x36')]();};}function saveUpdates(_0x44000f,_0x4ed710){return function(_0x327f43){if(_0x327f43){return _0x327f43[_0x5e63('0x37')](_0x44000f)['then'](function(_0x298ae3){return _0x298ae3;});}return null;};}function removeEntity(_0x25aa6a,_0x311618){return function(_0x195146){if(_0x195146){return _0x195146['destroy']()[_0x5e63('0x22')](function(){_0x25aa6a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3de99f,_0x1a9ef5){return function(_0x3328df){if(!_0x3328df){_0x3de99f[_0x5e63('0x38')](0x194);}return _0x3328df;};}function handleError(_0x51e7ca,_0x1812cd){_0x1812cd=_0x1812cd||0x1f4;return function(_0x39e4b5){logger[_0x5e63('0x27')](_0x39e4b5[_0x5e63('0x39')]);if(_0x39e4b5[_0x5e63('0x3a')]){delete _0x39e4b5[_0x5e63('0x3a')];}_0x51e7ca[_0x5e63('0x2c')](_0x1812cd)[_0x5e63('0x3b')](_0x39e4b5);};}exports['index']=function(_0x1929d5,_0x582e25){var _0x115d26={},_0x5c063b={},_0x115359={'count':0x0,'rows':[]};var _0x106574=_['map'](db[_0x5e63('0x3c')][_0x5e63('0x3d')],function(_0x14a660){return{'name':_0x14a660[_0x5e63('0x3e')],'type':_0x14a660['type']['key']};});_0x5c063b[_0x5e63('0x3f')]=_[_0x5e63('0x40')](_0x106574,_0x5e63('0x3a'));_0x5c063b[_0x5e63('0x41')]=_['keys'](_0x1929d5['query']);_0x5c063b['filters']=_[_0x5e63('0x42')](_0x5c063b[_0x5e63('0x3f')],_0x5c063b[_0x5e63('0x41')]);_0x115d26[_0x5e63('0x43')]=_[_0x5e63('0x42')](_0x5c063b['model'],qs[_0x5e63('0x44')](_0x1929d5[_0x5e63('0x41')]['fields']));_0x115d26[_0x5e63('0x43')]=_0x115d26['attributes'][_0x5e63('0x45')]?_0x115d26['attributes']:_0x5c063b[_0x5e63('0x3f')];if(!_0x1929d5[_0x5e63('0x41')][_0x5e63('0x46')]('nolimit')){_0x115d26[_0x5e63('0x30')]=qs[_0x5e63('0x30')](_0x1929d5[_0x5e63('0x41')][_0x5e63('0x30')]);_0x115d26[_0x5e63('0x2f')]=qs[_0x5e63('0x2f')](_0x1929d5['query'][_0x5e63('0x2f')]);}_0x115d26[_0x5e63('0x47')]=qs[_0x5e63('0x48')](_0x1929d5[_0x5e63('0x41')][_0x5e63('0x48')]);_0x115d26['where']=qs[_0x5e63('0x49')](_[_0x5e63('0x4a')](_0x1929d5['query'],_0x5c063b['filters']),_0x106574);if(_0x1929d5[_0x5e63('0x41')]['filter']){_0x115d26[_0x5e63('0x4b')]=_['merge'](_0x115d26['where'],{'$or':_[_0x5e63('0x40')](_0x106574,function(_0x13c11e){if(_0x13c11e[_0x5e63('0x4c')]!==_0x5e63('0x4d')){var _0x7ba429={};_0x7ba429[_0x13c11e[_0x5e63('0x3a')]]={'$like':'%'+_0x1929d5[_0x5e63('0x41')][_0x5e63('0x4e')]+'%'};return _0x7ba429;}})});}_0x115d26=_[_0x5e63('0x4f')]({},_0x115d26,_0x1929d5[_0x5e63('0x50')]);var _0x2372e4={'where':_0x115d26[_0x5e63('0x4b')]};return db[_0x5e63('0x3c')]['count'](_0x2372e4)[_0x5e63('0x22')](function(_0x20b80d){_0x115359[_0x5e63('0x32')]=_0x20b80d;if(_0x1929d5[_0x5e63('0x41')][_0x5e63('0x51')]){_0x115d26[_0x5e63('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0x5e63('0x53')](_0x115d26);})['then'](function(_0x25c857){_0x115359['rows']=_0x25c857;return _0x115359;})[_0x5e63('0x22')](respondWithFilteredResult(_0x582e25,_0x115d26))[_0x5e63('0x54')](handleError(_0x582e25,null));};exports['show']=function(_0x5102c8,_0x5b6568){var _0x1507ef={'raw':!![],'where':{'id':_0x5102c8[_0x5e63('0x55')]['id']}},_0x54ecc9={};_0x54ecc9['model']=_[_0x5e63('0x56')](db[_0x5e63('0x3c')][_0x5e63('0x3d')]);_0x54ecc9['query']=_['keys'](_0x5102c8[_0x5e63('0x41')]);_0x54ecc9['filters']=_[_0x5e63('0x42')](_0x54ecc9[_0x5e63('0x3f')],_0x54ecc9[_0x5e63('0x41')]);_0x1507ef['attributes']=_[_0x5e63('0x42')](_0x54ecc9['model'],qs[_0x5e63('0x44')](_0x5102c8['query'][_0x5e63('0x44')]));_0x1507ef[_0x5e63('0x43')]=_0x1507ef[_0x5e63('0x43')][_0x5e63('0x45')]?_0x1507ef[_0x5e63('0x43')]:_0x54ecc9[_0x5e63('0x3f')];if(_0x5102c8[_0x5e63('0x41')][_0x5e63('0x51')]){_0x1507ef[_0x5e63('0x52')]=[{'all':!![]}];}_0x1507ef=_[_0x5e63('0x4f')]({},_0x1507ef,_0x5102c8[_0x5e63('0x50')]);return db[_0x5e63('0x3c')]['find'](_0x1507ef)[_0x5e63('0x22')](handleEntityNotFound(_0x5b6568,null))[_0x5e63('0x22')](respondWithResult(_0x5b6568,null))[_0x5e63('0x54')](handleError(_0x5b6568,null));};exports[_0x5e63('0x57')]=function(_0x18a1a4,_0x4bf624){return db[_0x5e63('0x3c')][_0x5e63('0x57')](_0x18a1a4['body'],{})['then'](respondWithResult(_0x4bf624,0xc9))['catch'](handleError(_0x4bf624,null));};exports['update']=function(_0x45ff6d,_0xbf67f){if(_0x45ff6d['body']['id']){delete _0x45ff6d['body']['id'];}return db[_0x5e63('0x3c')]['find']({'where':{'id':_0x45ff6d[_0x5e63('0x55')]['id']}})[_0x5e63('0x22')](handleEntityNotFound(_0xbf67f,null))[_0x5e63('0x22')](saveUpdates(_0x45ff6d[_0x5e63('0x58')],null))[_0x5e63('0x22')](respondWithResult(_0xbf67f,null))['catch'](handleError(_0xbf67f,null));};exports[_0x5e63('0x59')]=function(_0x4ee15a,_0x5483ac){return db['SmsMessage']['find']({'where':{'id':_0x4ee15a[_0x5e63('0x55')]['id']}})[_0x5e63('0x22')](handleEntityNotFound(_0x5483ac,null))['then'](removeEntity(_0x5483ac,null))[_0x5e63('0x54')](handleError(_0x5483ac,null));};exports['describe']=function(_0x5afb98,_0x2c8c8f){return db[_0x5e63('0x3c')][_0x5e63('0x5a')]()[_0x5e63('0x22')](respondWithResult(_0x2c8c8f,null))['catch'](handleError(_0x2c8c8f,null));};var interaction_log=require(_0x5e63('0x5b'))(_0x5e63('0x5c'));exports['accept']=function(_0x23d4d2,_0x2b6cc6,_0x5e57b4){var _0x287122={'agent':{},'channel':_0x5e63('0x5d')};if(_0x23d4d2[_0x5e63('0x58')]['id']){delete _0x23d4d2[_0x5e63('0x58')]['id'];}_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x5e')]=!![];_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x5f')]=moment()[_0x5e63('0x60')](_0x5e63('0x61'));_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')]=_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')]||_0x23d4d2[_0x5e63('0x63')]['id'];_0x287122[_0x5e63('0x64')]['id']=_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')];return db['SmsMessage'][_0x5e63('0x65')]({'where':{'id':_0x23d4d2[_0x5e63('0x55')]['id'],'UserId':null}})[_0x5e63('0x22')](handleEntityNotFound(_0x2b6cc6,null))['then'](saveUpdates(_0x23d4d2[_0x5e63('0x58')],null))['then'](function(_0x2e1369){if(_0x2e1369){_0x287122[_0x5e63('0x29')]=_0x2e1369[_0x5e63('0x66')]({'plain':!![]});return db[_0x5e63('0x67')][_0x5e63('0x65')]({'where':{'id':_0x2e1369[_0x5e63('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x2b6cc6,null))[_0x5e63('0x22')](function(_0x348917){if(_0x348917){return _0x348917[_0x5e63('0x37')]({'UserId':_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')],'read1stAt':_[_0x5e63('0x69')](_0x348917['read1stAt'])?moment()['format'](_0x5e63('0x61')):undefined});}return null;})[_0x5e63('0x22')](function(_0x5dc906){if(_0x5dc906){_0x287122[_0x5e63('0x6a')]=_0x5dc906[_0x5e63('0x66')]({'plain':!![]});interaction_log[_0x5e63('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x23d4d2[_0x5e63('0x63')]['id'],_0x23d4d2[_0x5e63('0x63')][_0x5e63('0x3a')],_0x23d4d2[_0x5e63('0x63')][_0x5e63('0x6b')],_0x287122['interaction']['id'],_0x23d4d2[_0x5e63('0x58')]?JSON[_0x5e63('0x26')](_0x23d4d2['body']):_0x5e63('0x6c'));return respondWithRpcPromise(_0x5e63('0x6d'),'acceptMessage',_0x287122);}return null;})[_0x5e63('0x22')](function(_0x1c1036){var _0x2205e2=_0x5e63('0x6e')+_0x1c1036[_0x5e63('0x29')][_0x5e63('0x6f')];return db['sequelize'][_0x5e63('0x41')](_0x2205e2,{'type':db[_0x5e63('0x70')][_0x5e63('0x71')][_0x5e63('0x72')],'raw':!![]})['then'](function(_0xe801dd){return _0xe801dd;});})[_0x5e63('0x22')](function(_0x4d6327){if(_0x4d6327){_0x287122[_0x5e63('0x29')][_0x5e63('0x73')]=_0x4d6327[0x0];if(!_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')])return;return db[_0x5e63('0x74')][_0x5e63('0x65')]({'where':{'id':_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x62')],'role':_0x5e63('0x64')},'attributes':['id','name',_0x5e63('0x75'),_0x5e63('0x76'),_0x5e63('0x77')],'raw':!![]});}return null;})[_0x5e63('0x22')](function(_0x374873){if(!_0x374873)return null;_0x287122[_0x5e63('0x29')][_0x5e63('0x64')]=_0x374873;return _0x287122;})[_0x5e63('0x22')](function(_0x5d0500){if(_0x5d0500){if(_0x23d4d2[_0x5e63('0x58')][_0x5e63('0x78')]){_0x287122[_0x5e63('0x29')][_0x5e63('0x79')]=util[_0x5e63('0x60')](_0x5e63('0x7a'),_0x23d4d2[_0x5e63('0x63')]['name']);_0x287122[_0x5e63('0x29')][_0x5e63('0x7b')]=_0x287122[_0x5e63('0x7b')];_0x287122[_0x5e63('0x29')][_0x5e63('0x7c')]=_0x287122[_0x5e63('0x7b')];_0x287122[_0x5e63('0x29')]['event']=_0x5e63('0x7d');return respondWithRpcPromise(_0x5e63('0x7e'),'EventManager',{'event':_0x5e63('0x7f'),'message':_0x287122[_0x5e63('0x29')]},client9002)[_0x5e63('0x22')](function(){return _0x287122;});}return _0x287122;}return null;})[_0x5e63('0x22')](respondWithResult(_0x2b6cc6,null))['catch'](handleError(_0x2b6cc6,null));};var interaction_log=require(_0x5e63('0x5b'))(_0x5e63('0x5c'));exports['reject']=function(_0x575c6f,_0x386448,_0x263b85){var _0x34bfa2={'agent':{},'channel':_0x5e63('0x5d')};if(_0x575c6f[_0x5e63('0x58')]['id']){delete _0x575c6f['body']['id'];}_0x575c6f[_0x5e63('0x58')][_0x5e63('0x62')]=_0x575c6f['body'][_0x5e63('0x62')]||_0x575c6f[_0x5e63('0x63')]['id'];_0x34bfa2[_0x5e63('0x64')]['id']=_0x575c6f['body'][_0x5e63('0x62')];return db['SmsMessage'][_0x5e63('0x65')]({'where':{'id':_0x575c6f['params']['id'],'UserId':null}})[_0x5e63('0x22')](handleEntityNotFound(_0x386448,null))[_0x5e63('0x22')](function(_0x4d59c8){if(_0x4d59c8){_0x34bfa2[_0x5e63('0x29')]=_0x4d59c8[_0x5e63('0x66')]({'plain':!![]});return db[_0x5e63('0x67')][_0x5e63('0x65')]({'where':{'id':_0x4d59c8[_0x5e63('0x68')]}});}return null;})[_0x5e63('0x22')](handleEntityNotFound(_0x386448,null))[_0x5e63('0x22')](function(_0x191af6){if(_0x191af6){_0x34bfa2[_0x5e63('0x6a')]=_0x191af6['get']({'plain':!![]});interaction_log[_0x5e63('0x23')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x575c6f[_0x5e63('0x63')]['id'],_0x575c6f[_0x5e63('0x63')][_0x5e63('0x3a')],_0x575c6f['user'][_0x5e63('0x6b')],_0x34bfa2[_0x5e63('0x6a')]['id'],_0x575c6f[_0x5e63('0x58')]?JSON['stringify'](_0x575c6f[_0x5e63('0x58')]):_0x5e63('0x6c'));return respondWithRpcPromise(_0x5e63('0x80'),_0x5e63('0x81'),_0x34bfa2);}return null;})[_0x5e63('0x22')](function(_0x3551af){var _0x218124=_0x5e63('0x6e')+_0x3551af[_0x5e63('0x29')]['ContactId'];return db['sequelize']['query'](_0x218124,{'type':db['Sequelize'][_0x5e63('0x71')][_0x5e63('0x72')],'raw':!![]})[_0x5e63('0x22')](function(_0xa6c091){return _0xa6c091;});})[_0x5e63('0x22')](function(_0x62d64a){if(_0x62d64a){_0x34bfa2[_0x5e63('0x29')]['contact']=_0x62d64a[0x0];if(!_0x575c6f[_0x5e63('0x58')][_0x5e63('0x62')])return;return db[_0x5e63('0x74')][_0x5e63('0x65')]({'where':{'id':_0x575c6f[_0x5e63('0x58')][_0x5e63('0x62')],'role':_0x5e63('0x64')},'attributes':['id','name',_0x5e63('0x75'),_0x5e63('0x76'),_0x5e63('0x77')],'raw':!![]});}return null;})[_0x5e63('0x22')](function(_0x179fdd){if(!_0x179fdd)return null;_0x34bfa2['message'][_0x5e63('0x64')]=_0x179fdd;return _0x34bfa2;})['then'](function(_0x2faadb){if(_0x2faadb){_0x2faadb['message'][_0x5e63('0x79')]=util[_0x5e63('0x60')]('SIP/%s',_0x575c6f[_0x5e63('0x63')][_0x5e63('0x3a')]);_0x2faadb[_0x5e63('0x29')][_0x5e63('0x7b')]=_0x34bfa2[_0x5e63('0x7b')];_0x2faadb[_0x5e63('0x29')][_0x5e63('0x7c')]=_0x34bfa2[_0x5e63('0x7b')];_0x2faadb[_0x5e63('0x29')][_0x5e63('0x82')]=_0x5e63('0x35');respondWithRpcPromise(_0x5e63('0x7e'),_0x5e63('0x7e'),{'event':_0x5e63('0x83'),'message':_0x2faadb[_0x5e63('0x29')]},client9002);return _0x34bfa2;}return null;})['then'](respondWithResult(_0x386448,null))['catch'](handleError(_0x386448,null));};exports['status']=function(_0x245c32,_0x50e157,_0x1005cf){if(_0x245c32[_0x5e63('0x58')]['id']){delete _0x245c32[_0x5e63('0x58')]['id'];}var _0x2c341f;return db[_0x5e63('0x3c')][_0x5e63('0x65')]({'where':{'id':_0x245c32[_0x5e63('0x55')]['id']}})[_0x5e63('0x22')](handleEntityNotFound(_0x50e157,null))[_0x5e63('0x22')](function(_0x53cee8){if(_0x53cee8){_0x2c341f=_0x53cee8;return db['SmsAccount'][_0x5e63('0x65')]({'where':{'id':_0x53cee8[_0x5e63('0x84')]}});}})[_0x5e63('0x22')](handleEntityNotFound(_0x50e157,null))[_0x5e63('0x22')](function(_0x5b0b9f){if(_0x5b0b9f){logger[_0x5e63('0x25')](_0x5e63('0x85'),_0x5e63('0x2c'),'received\x20delivery\x20report\x20from',_0x5b0b9f['type'],util['inspect'](_0x245c32[_0x5e63('0x58')],{'showHidden':![],'depth':null}));switch(_0x5b0b9f[_0x5e63('0x4c')]){case'twilio':if(_0x245c32[_0x5e63('0x58')]['MessageSid']&&_0x245c32[_0x5e63('0x58')][_0x5e63('0x86')]===_0x2c341f[_0x5e63('0x87')]){return _0x2c341f[_0x5e63('0x37')]({'read':!![]});}else{logger[_0x5e63('0x27')](_0x5e63('0x88'),_0x5e63('0x2c'),_0x5e63('0x89'),util[_0x5e63('0x8a')](_0x245c32[_0x5e63('0x58')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x245c32[_0x5e63('0x58')][_0x5e63('0x8b')]&&_0x245c32[_0x5e63('0x58')][_0x5e63('0x8b')]===_0x2c341f['messageId']&&_[_0x5e63('0x8c')](['sent',_0x5e63('0x8d')],_0x245c32[_0x5e63('0x58')][_0x5e63('0x8e')])>=0x0){return _0x2c341f[_0x5e63('0x37')]({'read':!![]});}else{logger[_0x5e63('0x27')](_0x5e63('0x88'),_0x5e63('0x2c'),_0x5e63('0x8f'),util['inspect'](_0x245c32[_0x5e63('0x58')],{'showHidden':![],'depth':null}));}break;case _0x5e63('0x90'):var _0x5a95dc=_0x245c32[_0x5e63('0x58')][_0x5e63('0x91')][0x0];if(_0x5a95dc['status'][_0x5e63('0x92')]===_0x5e63('0x93')){return _0x2c341f['update']({'read':!![]});}else{logger[_0x5e63('0x27')](_0x5e63('0x88'),_0x5e63('0x2c'),_0x5e63('0x90'),util[_0x5e63('0x8a')](_0x245c32['body'],{'showHidden':![],'depth':null}));}break;}return _0x2c341f;}})[_0x5e63('0x22')](respondWithResult(_0x50e157,null))[_0x5e63('0x54')](handleError(_0x50e157,null));};
\ No newline at end of file
index c0e9c25..2f5300c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5818=['events','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0x4de1b1,_0x18c64c){var _0x639f27=function(_0x635e03){while(--_0x635e03){_0x4de1b1['push'](_0x4de1b1['shift']());}};_0x639f27(++_0x18c64c);}(_0x5818,0xa8));var _0x8581=function(_0x369a3a,_0x32dae9){_0x369a3a=_0x369a3a-0x0;var _0x3cbf33=_0x5818[_0x369a3a];return _0x3cbf33;};'use strict';var EventEmitter=require(_0x8581('0x0'));var SmsMessage=require(_0x8581('0x1'))['db'][_0x8581('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x8581('0x3')](0x0);var events={'afterCreate':_0x8581('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x145fbd){return function(_0x2acb8f,_0x181139,_0x342027){SmsMessageEvents[_0x8581('0x5')](_0x145fbd+':'+_0x2acb8f['id'],_0x2acb8f);SmsMessageEvents[_0x8581('0x5')](_0x145fbd,_0x2acb8f);_0x342027(null);};}for(var e in events){if(events[_0x8581('0x6')](e)){var event=events[e];SmsMessage[_0x8581('0x7')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
+var _0x64cc=['../../mysqldb','update','emit','hasOwnProperty','hook','events'];(function(_0x328069,_0x9bf0e){var _0x1ed57b=function(_0x2303f5){while(--_0x2303f5){_0x328069['push'](_0x328069['shift']());}};_0x1ed57b(++_0x9bf0e);}(_0x64cc,0x107));var _0xc64c=function(_0x4298d3,_0x22fe96){_0x4298d3=_0x4298d3-0x0;var _0x351a5c=_0x64cc[_0x4298d3];return _0x351a5c;};'use strict';var EventEmitter=require(_0xc64c('0x0'));var SmsMessage=require(_0xc64c('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc64c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x8dacac){return function(_0x14e583,_0x13e846,_0x8aa7b){SmsMessageEvents[_0xc64c('0x3')](_0x8dacac+':'+_0x14e583['id'],_0x14e583);SmsMessageEvents['emit'](_0x8dacac,_0x14e583);_0x8aa7b(null);};}for(var e in events){if(events[_0xc64c('0x4')](e)){var event=events[e];SmsMessage[_0xc64c('0x5')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
index afecd35..a5f6a42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x487c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','SmsInteractionId','findOne','update','createdAt','catch','error','out','find','then','type','twilio','accountSid','authToken','phone','messages','/api/sms/messages/','token','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','session_key','total_sent','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','message_id','clickSend','plivo','authId','remote','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util'];(function(_0x8a917c,_0x19c5f6){var _0x2c704e=function(_0x342f3a){while(--_0x342f3a){_0x8a917c['push'](_0x8a917c['shift']());}};_0x2c704e(++_0x19c5f6);}(_0x487c,0x1d6));var _0xc487=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x487c[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0xc487('0x0'));var util=require(_0xc487('0x1'));var logger=require(_0xc487('0x2'))(_0xc487('0x3'));var moment=require(_0xc487('0x4'));var BPromise=require('bluebird');var rp=require(_0xc487('0x5'));var fs=require('fs');var path=require(_0xc487('0x6'));var rimraf=require(_0xc487('0x7'));var config=require(_0xc487('0x8'));var attributes=require('./smsMessage.attributes');module[_0xc487('0x9')]=function(_0x4fd09d,_0x52a4e7){return _0x4fd09d[_0xc487('0xa')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xc487('0xb'),'fields':[_0xc487('0xb')]},{'name':_0xc487('0xc'),'fields':[_0xc487('0xd')],'type':_0xc487('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x271ee7,_0x5ab020,_0x322ff9){var _0x2e3477=_0x4fd09d['models'];var _0x28625a=_0x271ee7[_0xc487('0xf')]({'plain':!![]});if(_0x28625a[_0xc487('0x10')][_0xc487('0x11')]()==='in'||_0x28625a[_0xc487('0x10')]['toLowerCase']()==='out'&&!_0x28625a[_0xc487('0x12')]&&!_[_0xc487('0x13')](_0x28625a['UserId'])&&!_[_0xc487('0x13')](_0x28625a[_0xc487('0x14')])){_0x2e3477['SmsInteraction'][_0xc487('0x15')]({'where':{'id':_0x28625a[_0xc487('0x14')]}})['then'](function(_0x519286){if(_0x519286){_0x519286[_0xc487('0x16')]({'lastMsgAt':_0x28625a[_0xc487('0x17')],'lastMsgDirection':_0x28625a[_0xc487('0x10')][_0xc487('0x11')]()});}})[_0xc487('0x18')](function(_0x55aab2){console[_0xc487('0x19')](_0x55aab2);});}if(_0x28625a['direction']===_0xc487('0x1a')&&!_0x28625a[_0xc487('0x12')]){var _0x2777fa;_0x2e3477['SmsAccount'][_0xc487('0x1b')]({'where':{'id':_0x28625a['SmsAccountId']},'raw':!![]})[_0xc487('0x1c')](function(_0x259783){_0x2777fa=_0x259783;if(_0x2777fa&&_0x2777fa[_0xc487('0x1d')]){switch(_0x2777fa[_0xc487('0x1d')]){case'twilio':var _0x439f96=require(_0xc487('0x1e'));if(_0x2777fa[_0xc487('0x1f')]&&_0x2777fa[_0xc487('0x20')]&&_0x2777fa[_0xc487('0x21')]){var _0x1d7fcf=new _0x439f96(_0x2777fa[_0xc487('0x1f')],_0x2777fa[_0xc487('0x20')]);_0x1d7fcf[_0xc487('0x22')]['create']({'body':_0x28625a[_0xc487('0xd')],'to':_0x28625a[_0xc487('0x21')],'from':_0x2777fa['phone'],'statusCallback':_0x2777fa['remote']+_0xc487('0x23')+_0x28625a['id']+'/status?token='+_0x2777fa[_0xc487('0x24')]})['then'](function(_0x3a584e){if(_0x3a584e['sid']){return _0x271ee7[_0xc487('0x16')]({'messageId':_0x3a584e['sid']});}})[_0xc487('0x18')](function(_0x1b7e60){logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),'twilio',util['inspect'](_0x1b7e60,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x1e'),_0xc487('0x27'));}break;case _0xc487('0x28'):var _0x8bc364=_0xc487('0x29');if(_0x2777fa[_0xc487('0x2a')]&&_0x2777fa[_0xc487('0x2b')]){var _0x3e3cf1={'recipient':[_0x28625a[_0xc487('0x21')]],'message':_0x28625a[_0xc487('0xd')],'message_type':_0x2777fa['smsMethod']};if(_0x2777fa[_0xc487('0x2c')]&&_0x2777fa['smsMethod']!=='SI'){_0x3e3cf1[_0xc487('0x2d')]=_0x2777fa['phone'];}var _0x860e6f={'url':_0x8bc364+_0xc487('0x2e')+_0x2777fa[_0xc487('0x2a')]+_0xc487('0x2f')+_0x2777fa[_0xc487('0x2b')],'method':'GET'};rp(_0x860e6f)[_0xc487('0x1c')](function(_0x12c19e){var _0x289013=_0x12c19e[_0xc487('0x30')](';');var _0x1c0963={'user_key':_0x289013[0x0],'session_key':_0x289013[0x1]};_0x860e6f={'url':_0x8bc364+_0xc487('0x31'),'method':_0xc487('0x32'),'headers':{'user_key':_0x1c0963['user_key'],'Session_key':_0x1c0963[_0xc487('0x33')]},'json':!![],'body':_0x3e3cf1};return rp(_0x860e6f);})['then'](function(_0x529f09){if(_0x529f09[_0xc487('0x34')]>=0x1){var _0x3efd66={'messageId':_0x529f09['internal_order_id']};if(_0x2777fa[_0xc487('0x2c')]!=='GP'||!_0x2777fa[_0xc487('0x35')]){_0x3efd66[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x3efd66);}else{return logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x28'),util[_0xc487('0x37')](_0x529f09,{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x230c3e){return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x28'),util[_0xc487('0x37')](_0x230c3e,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x28'),_0xc487('0x38'));}break;case'connectel':if(_0x2777fa['authToken']){var _0x27f29b={'recipient':_0x28625a['phone'],'message':_0x28625a['body'],'sender':_0x2777fa[_0xc487('0x39')]||_0x2777fa[_0xc487('0x21')],'authorization':_0x2777fa[_0xc487('0x20')]};var _0x5ab020={'method':'POST','uri':_0xc487('0x3a'),'body':_0x27f29b,'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x4a9f72){var _0x364f27={'messageId':_0x4a9f72[_0xc487('0x3b')]};if(!_0x2777fa[_0xc487('0x35')]){_0x364f27['read']=!![];}return _0x271ee7[_0xc487('0x16')](_0x364f27);})[_0xc487('0x18')](function(_0x3a01ae){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x3c'),util['inspect'](_0x3a01ae,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0xc487('0x3d'):if(_0x2777fa['username']&&_0x2777fa[_0xc487('0x2b')]){var _0x27f29b={'messages':[{'source':_0xc487('0x3e'),'to':_0x28625a[_0xc487('0x21')],'body':_0x28625a[_0xc487('0xd')],'from':_0x2777fa['senderString']||_0x2777fa[_0xc487('0x21')]}]};var _0x55f498=util[_0xc487('0x3f')](_0xc487('0x40'),_0x2777fa[_0xc487('0x2a')],_0x2777fa['password']);var _0x5ab020={'method':'POST','uri':'https://rest.clicksend.com/v3/sms/send','body':_0x27f29b,'headers':{'Authorization':util[_0xc487('0x3f')](_0xc487('0x41'),new Buffer(_0x55f498)['toString'](_0xc487('0x42')))},'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x46982b){if(_0x46982b[_0xc487('0x43')]>=0xc8&&_0x46982b[_0xc487('0x43')]<=0xce){if(_0x46982b[_0xc487('0x44')]&&_0x46982b[_0xc487('0x44')][_0xc487('0x45')]>0x0){var _0x49c37e=_['head'](_0x46982b[_0xc487('0x44')][_0xc487('0x22')]);var _0x15e5e0={'messageId':_0x49c37e[_0xc487('0x46')]};if(!_0x2777fa['deliveryReport']){_0x15e5e0[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x15e5e0);}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x47'),util['inspect'](_0x46982b,{'showHidden':![],'depth':null}));}}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x47'),util[_0xc487('0x37')](_0x46982b,{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x155e3f){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x47'),util[_0xc487('0x37')](_0x155e3f,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xc487('0x48'):if(_0x2777fa[_0xc487('0x49')]&&_0x2777fa['authToken']){var _0x27f29b={'dst':_0x28625a[_0xc487('0x21')],'text':_0x28625a['body'],'src':_0x2777fa[_0xc487('0x39')]||_0x2777fa['phone'],'url':_0x2777fa[_0xc487('0x4a')]+_0xc487('0x23')+_0x28625a['id']+_0xc487('0x4b')+_0x2777fa[_0xc487('0x24')]};var _0x55f498=util['format'](_0xc487('0x40'),_0x2777fa['authId'],_0x2777fa[_0xc487('0x20')]);var _0x5ab020={'method':'POST','uri':util[_0xc487('0x3f')](_0xc487('0x4c'),_0x2777fa[_0xc487('0x49')]),'body':_0x27f29b,'headers':{'Authorization':util[_0xc487('0x3f')](_0xc487('0x41'),new Buffer(_0x55f498)['toString'](_0xc487('0x42')))},'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x2dd0e6){var _0x452aa4={'messageId':_0x2dd0e6[_0xc487('0x4d')][0x0]};return _0x271ee7['update'](_0x452aa4);})[_0xc487('0x18')](function(_0x2f44a1){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x48'),util[_0xc487('0x37')](_0x2f44a1,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x48'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc487('0x4e'):if(_0x2777fa['username']&&_0x2777fa[_0xc487('0x2b')]){if(_0x2777fa[_0xc487('0x4f')]){var _0xb9d4c3={'method':_0xc487('0x32'),'uri':_0x2777fa[_0xc487('0x4f')]+_0xc487('0x50'),'body':{'username':_0x2777fa[_0xc487('0x2a')],'password':_0x2777fa[_0xc487('0x2b')]},'json':!![]};return rp(_0xb9d4c3)[_0xc487('0x1c')](function(_0x339742){var _0x2258ec={'method':'POST','uri':_0x2777fa['baseUrl']+_0xc487('0x51'),'body':{'messages':[{'from':_0x2777fa[_0xc487('0x21')],'destinations':[{'to':_0x28625a[_0xc487('0x21')]}],'text':_0x28625a[_0xc487('0xd')],'notifyUrl':_0x2777fa[_0xc487('0x4a')]+'/api/sms/messages/'+_0x28625a['id']+'/status?token='+_0x2777fa[_0xc487('0x24')],'notifyContentType':_0xc487('0x52'),'callbackData':_0x2777fa[_0xc487('0x21')]+';'+_0x28625a[_0xc487('0xd')]}]},'headers':{'Authorization':_0xc487('0x53')+_0x339742[_0xc487('0x24')]},'json':!![]};return rp(_0x2258ec)['then'](function(_0x39a405){if(_0x39a405[_0xc487('0x22')]){var _0xc03e9={'messageId':_0x39a405[_0xc487('0x22')][0x0][_0xc487('0xb')]};if(!_0x2777fa[_0xc487('0x35')]){_0xc03e9[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0xc03e9);}else{return logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x4e'),util['inspect'](_0x39a405,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x497f65){return logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x4e'),util[_0xc487('0x37')](_0x497f65,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x4e'),_0xc487('0x54'));}}else{logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x4e'),_0xc487('0x38'));}break;case _0xc487('0x55'):var _0x32465c=require('crypto');if(_0x2777fa[_0xc487('0x56')]){var _0x5327f7={};_0x5327f7[_0xc487('0x57')]=_0x2777fa[_0xc487('0x2a')];_0x5327f7[_0xc487('0x21')]=_0x28625a[_0xc487('0x21')];_0x5327f7['sender']=_0x2777fa[_0xc487('0x21')];_0x5327f7[_0xc487('0x58')]=_0x28625a['body'];_0x5327f7[_0xc487('0x59')]=+new Date();var _0x3233d7='';var _0x364879='';var _0xaf7b46=Object[_0xc487('0x5a')](_0x5327f7);_0xaf7b46['sort']();for(var _0x33efcb=0x0;_0x33efcb<_0xaf7b46[_0xc487('0x5b')];_0x33efcb++){if(_0x3233d7!=''){_0x3233d7+='&';}_0x3233d7+=_0xaf7b46[_0x33efcb]+'='+encodeURIComponent(_0x5327f7[_0xaf7b46[_0x33efcb]]);_0x364879+=_0x5327f7[_0xaf7b46[_0x33efcb]];}_0x364879+=_0x2777fa[_0xc487('0x56')];_0x364879=_0x32465c[_0xc487('0x5c')](_0xc487('0x5d'))[_0xc487('0x16')](_0x364879)[_0xc487('0x5e')](_0xc487('0x5f'));if(_0x3233d7!==''){_0x3233d7+='&';}_0x3233d7+=_0xc487('0x60')+_0x364879;var _0x860e6f={'method':_0xc487('0x61'),'uri':_0x2777fa[_0xc487('0x4f')]+_0xc487('0x62')+_0x3233d7,'json':!![]};return rp(_0x860e6f)['then'](function(_0x91726c){var _0x19bd6f=Object['keys'](_0x91726c);if(_0x91726c[_0x19bd6f[0x0]][_0xc487('0x19')]&&parseInt(_0x91726c[_0x19bd6f[0x0]]['error'])===0x0){var _0x355b50={'messageId':_0x91726c[_0x19bd6f[0x0]][_0xc487('0x63')]};if(!_0x2777fa[_0xc487('0x35')]){_0x355b50[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x355b50);}else{return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate','csc',util[_0xc487('0x37')](_0x91726c[_0xc487('0x19')],{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x117b77){return logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x55'),util[_0xc487('0x37')](_0x117b77,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x55'),_0xc487('0x64'));}break;case'clickatell':if(_0x2777fa[_0xc487('0x56')]){var _0x3365a5={'method':_0xc487('0x32'),'uri':_0xc487('0x65'),'headers':{'Authorization':_0x2777fa['apiKey']},'body':{'content':_0x28625a['body'],'to':[_0x28625a[_0xc487('0x21')]],'from':_0x2777fa[_0xc487('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xc487('0x66')},'json':!![]};rp(_0x3365a5)[_0xc487('0x1c')](function(_0x3e3052){if(!_0x3e3052[_0xc487('0x19')]){var _0x30133b={'messageId':_0x3e3052[_0xc487('0x22')][0x0]['apiMessageId']};if(!_0x2777fa[_0xc487('0x35')]){_0x30133b[_0xc487('0x36')]=!![];}return _0x271ee7[_0xc487('0x16')](_0x30133b);}else{return logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x67'),util[_0xc487('0x37')](_0x3e3052['error'],{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0x320404){return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate',_0xc487('0x67'),util[_0xc487('0x37')](_0x320404,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x67'),_0xc487('0x64'));}break;case _0xc487('0x68'):if(_0x2777fa[_0xc487('0x2a')]&&_0x2777fa[_0xc487('0x2b')]){var _0x55f498=util[_0xc487('0x3f')]('%s:%s',_0x2777fa['username'],_0x2777fa[_0xc487('0x2b')]);var _0x5ab020={'method':_0xc487('0x32'),'uri':_0xc487('0x69')+_0x2777fa[_0xc487('0x6a')]+_0xc487('0x6b'),'body':{'to':[_0x28625a[_0xc487('0x21')]],'text':_0x28625a['body'],'from':_0x2777fa[_0xc487('0x21')],'applicationId':_0x2777fa['applicationId']},'headers':{'Authorization':util[_0xc487('0x3f')](_0xc487('0x41'),new Buffer(_0x55f498)['toString'](_0xc487('0x42')))},'json':!![]};rp(_0x5ab020)[_0xc487('0x1c')](function(_0x214856){if(_0x214856['id']){var _0x1ae642={'messageId':_0x214856['id']};return _0x271ee7[_0xc487('0x16')](_0x1ae642);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc487('0x25'),_0xc487('0x68'),util['inspect'](_0x214856,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2af077){logger[_0xc487('0x19')](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x68'),util[_0xc487('0x37')](_0x2af077,{'showHidden':![],'depth':null}));});}else{logger[_0xc487('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','bandwidth','Missing\x20parameters:\x20username,\x20password');}break;case _0xc487('0x6c'):if(_0x2777fa[_0xc487('0x56')]){var _0x6c3a2b={};var _0x860e6f={'method':'POST','uri':_0xc487('0x6d'),'headers':{'Authorization':_0xc487('0x6e')+_0x2777fa[_0xc487('0x56')],'Content-Type':_0xc487('0x52')},'body':{'from':_0x2777fa[_0xc487('0x21')],'to':_0x28625a[_0xc487('0x21')],'text':_0x28625a[_0xc487('0xd')]},'json':!![]};return rp(_0x860e6f)[_0xc487('0x1c')](function(_0x39c16c){if(_0x39c16c['code']==0xca){_0x6c3a2b[_0xc487('0x6f')]=_0x39c16c;var _0x2b0f99={'method':_0xc487('0x32'),'uri':_0xc487('0x70'),'headers':{'Authorization':_0xc487('0x6e')+_0x2777fa[_0xc487('0x56')],'Content-Type':_0xc487('0x52')},'body':{'refid':_0x6c3a2b[_0xc487('0x6f')][_0xc487('0x71')]},'json':!![]};return rp(_0x2b0f99)[_0xc487('0x1c')](function(_0x5da46b){_0x6c3a2b[_0xc487('0x72')]=_0x5da46b;var _0x4ee566={'messageId':_0x6c3a2b[_0xc487('0x6f')][_0xc487('0x71')],'read':!![]};return _0x271ee7['update'](_0x4ee566);});}else{return logger['error'](_0xc487('0x26'),_0xc487('0x25'),_0xc487('0x6c'),util[_0xc487('0x37')](_0x39c16c,{'showHidden':![],'depth':null}));}})[_0xc487('0x18')](function(_0xc22f8d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc487('0x6c'),util['inspect'](_0xc22f8d,{'showHidden':![],'depth':null}));});}else{return logger[_0xc487('0x19')](_0xc487('0x26'),'afterCreate','intelepeer',_0xc487('0x73'));}break;}}})[_0xc487('0x74')](function(){_0x322ff9();});}else{_0x322ff9();}}},'charset':_0xc487('0x75'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6fbe=['format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','clickSend','Missing\x20parameters:\x20username,\x20password','senderString','/status?token=','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','plivo','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','apiKey','login','sender','text','timestamp','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','util','../../config/logger','api','moment','path','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','sms','session_key','total_sent','internal_order_id','POST','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','connectel','Missing\x20parameters:\x20authToken','clicksend','%s:%s'];(function(_0x436f7c,_0x260e89){var _0x2554e3=function(_0x21f5aa){while(--_0x21f5aa){_0x436f7c['push'](_0x436f7c['shift']());}};_0x2554e3(++_0x260e89);}(_0x6fbe,0x1a3));var _0xe6fb=function(_0x150122,_0x2f7e52){_0x150122=_0x150122-0x0;var _0x274f91=_0x6fbe[_0x150122];return _0x274f91;};'use strict';var _=require('lodash');var util=require(_0xe6fb('0x0'));var logger=require(_0xe6fb('0x1'))(_0xe6fb('0x2'));var moment=require(_0xe6fb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe6fb('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe6fb('0x5'));module[_0xe6fb('0x6')]=function(_0x15345e,_0x1c889a){return _0x15345e[_0xe6fb('0x7')](_0xe6fb('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xe6fb('0x9'),'fields':[_0xe6fb('0x9')]},{'name':_0xe6fb('0xa'),'fields':[_0xe6fb('0xb')],'type':_0xe6fb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x8d28af,_0x1e2f31,_0x31a9a3){var _0x3a406a=_0x15345e[_0xe6fb('0xd')];var _0x24d90d=_0x8d28af[_0xe6fb('0xe')]({'plain':!![]});if(_0x24d90d[_0xe6fb('0xf')][_0xe6fb('0x10')]()==='in'||_0x24d90d[_0xe6fb('0xf')][_0xe6fb('0x10')]()===_0xe6fb('0x11')&&!_0x24d90d[_0xe6fb('0x12')]&&!_[_0xe6fb('0x13')](_0x24d90d[_0xe6fb('0x14')])&&!_['isNil'](_0x24d90d[_0xe6fb('0x15')])){_0x3a406a['SmsInteraction']['findOne']({'where':{'id':_0x24d90d['SmsInteractionId']}})['then'](function(_0x24f08a){if(_0x24f08a){_0x24f08a[_0xe6fb('0x16')]({'lastMsgAt':_0x24d90d[_0xe6fb('0x17')],'lastMsgDirection':_0x24d90d['direction'][_0xe6fb('0x10')]()});}})[_0xe6fb('0x18')](function(_0x223968){console[_0xe6fb('0x19')](_0x223968);});}if(_0x24d90d[_0xe6fb('0xf')]===_0xe6fb('0x11')&&!_0x24d90d[_0xe6fb('0x12')]){var _0x53e5aa;_0x3a406a[_0xe6fb('0x1a')][_0xe6fb('0x1b')]({'where':{'id':_0x24d90d[_0xe6fb('0x1c')]},'raw':!![]})[_0xe6fb('0x1d')](function(_0x36ce25){_0x53e5aa=_0x36ce25;if(_0x53e5aa&&_0x53e5aa[_0xe6fb('0x1e')]){switch(_0x53e5aa[_0xe6fb('0x1e')]){case _0xe6fb('0x1f'):var _0x272b5c=require(_0xe6fb('0x1f'));if(_0x53e5aa[_0xe6fb('0x20')]&&_0x53e5aa[_0xe6fb('0x21')]&&_0x53e5aa[_0xe6fb('0x22')]){var _0x5a1fbf=new _0x272b5c(_0x53e5aa['accountSid'],_0x53e5aa['authToken']);_0x5a1fbf[_0xe6fb('0x23')][_0xe6fb('0x24')]({'body':_0x24d90d[_0xe6fb('0xb')],'to':_0x24d90d[_0xe6fb('0x22')],'from':_0x53e5aa[_0xe6fb('0x22')],'statusCallback':_0x53e5aa[_0xe6fb('0x25')]+_0xe6fb('0x26')+_0x24d90d['id']+'/status?token='+_0x53e5aa[_0xe6fb('0x27')]})[_0xe6fb('0x1d')](function(_0x3f804e){if(_0x3f804e[_0xe6fb('0x28')]){return _0x8d28af['update']({'messageId':_0x3f804e[_0xe6fb('0x28')]});}})[_0xe6fb('0x18')](function(_0x4f39b5){logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x1f'),util[_0xe6fb('0x2b')](_0x4f39b5,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x1f'),_0xe6fb('0x2c'));}break;case _0xe6fb('0x2d'):var _0x3ea8aa='https://api.skebby.it/API/v1.0/REST/';if(_0x53e5aa[_0xe6fb('0x2e')]&&_0x53e5aa[_0xe6fb('0x2f')]){var _0x4a644a={'recipient':[_0x24d90d['phone']],'message':_0x24d90d[_0xe6fb('0xb')],'message_type':_0x53e5aa[_0xe6fb('0x30')]};if(_0x53e5aa['smsMethod']&&_0x53e5aa['smsMethod']!=='SI'){_0x4a644a['sender']=_0x53e5aa[_0xe6fb('0x22')];}var _0x4b9865={'url':_0x3ea8aa+_0xe6fb('0x31')+_0x53e5aa['username']+_0xe6fb('0x32')+_0x53e5aa[_0xe6fb('0x2f')],'method':_0xe6fb('0x33')};rp(_0x4b9865)[_0xe6fb('0x1d')](function(_0x5a89ed){var _0x1a5c83=_0x5a89ed['split'](';');var _0xe1d8ba={'user_key':_0x1a5c83[0x0],'session_key':_0x1a5c83[0x1]};_0x4b9865={'url':_0x3ea8aa+_0xe6fb('0x34'),'method':'POST','headers':{'user_key':_0xe1d8ba['user_key'],'Session_key':_0xe1d8ba[_0xe6fb('0x35')]},'json':!![],'body':_0x4a644a};return rp(_0x4b9865);})[_0xe6fb('0x1d')](function(_0xc9164f){if(_0xc9164f[_0xe6fb('0x36')]>=0x1){var _0x4735d2={'messageId':_0xc9164f[_0xe6fb('0x37')]};if(_0x53e5aa[_0xe6fb('0x30')]!=='GP'||!_0x53e5aa['deliveryReport']){_0x4735d2['read']=!![];}return _0x8d28af['update'](_0x4735d2);}else{return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x2d'),util[_0xe6fb('0x2b')](_0xc9164f,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x54abdb){return logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),_0xe6fb('0x2d'),util['inspect'](_0x54abdb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0x53e5aa['authToken']){var _0x23d5ed={'recipient':_0x24d90d['phone'],'message':_0x24d90d['body'],'sender':_0x53e5aa['senderString']||_0x53e5aa[_0xe6fb('0x22')],'authorization':_0x53e5aa['authToken']};var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x39'),'body':_0x23d5ed,'json':!![]};rp(_0x1e2f31)[_0xe6fb('0x1d')](function(_0x424e57){var _0x11f095={'messageId':_0x424e57[_0xe6fb('0x3a')]};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x11f095[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x11f095);})['catch'](function(_0x290b96){logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x3d'),util[_0xe6fb('0x2b')](_0x290b96,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x3d'),_0xe6fb('0x3e'));}break;case _0xe6fb('0x3f'):if(_0x53e5aa[_0xe6fb('0x2e')]&&_0x53e5aa['password']){var _0x23d5ed={'messages':[{'source':'xCALLY\x20Motion','to':_0x24d90d[_0xe6fb('0x22')],'body':_0x24d90d[_0xe6fb('0xb')],'from':_0x53e5aa['senderString']||_0x53e5aa['phone']}]};var _0x5ab03b=util['format'](_0xe6fb('0x40'),_0x53e5aa[_0xe6fb('0x2e')],_0x53e5aa[_0xe6fb('0x2f')]);var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x23d5ed,'headers':{'Authorization':util[_0xe6fb('0x41')](_0xe6fb('0x42'),new Buffer(_0x5ab03b)[_0xe6fb('0x43')](_0xe6fb('0x44')))},'json':!![]};rp(_0x1e2f31)[_0xe6fb('0x1d')](function(_0x3500cc){if(_0x3500cc['http_code']>=0xc8&&_0x3500cc[_0xe6fb('0x45')]<=0xce){if(_0x3500cc['data']&&_0x3500cc[_0xe6fb('0x46')][_0xe6fb('0x47')]>0x0){var _0x4e2267=_[_0xe6fb('0x48')](_0x3500cc['data'][_0xe6fb('0x23')]);var _0x47c45f={'messageId':_0x4e2267['message_id']};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x47c45f['read']=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x47c45f);}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'clickSend',util[_0xe6fb('0x2b')](_0x3500cc,{'showHidden':![],'depth':null}));}}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x49'),util[_0xe6fb('0x2b')](_0x3500cc,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x52927d){logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'clickSend',util[_0xe6fb('0x2b')](_0x52927d,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x49'),_0xe6fb('0x4a'));}break;case'plivo':if(_0x53e5aa['authId']&&_0x53e5aa['authToken']){var _0x23d5ed={'dst':_0x24d90d[_0xe6fb('0x22')],'text':_0x24d90d[_0xe6fb('0xb')],'src':_0x53e5aa[_0xe6fb('0x4b')]||_0x53e5aa[_0xe6fb('0x22')],'url':_0x53e5aa[_0xe6fb('0x25')]+_0xe6fb('0x26')+_0x24d90d['id']+_0xe6fb('0x4c')+_0x53e5aa[_0xe6fb('0x27')]};var _0x5ab03b=util[_0xe6fb('0x41')]('%s:%s',_0x53e5aa[_0xe6fb('0x4d')],_0x53e5aa[_0xe6fb('0x21')]);var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':util['format'](_0xe6fb('0x4e'),_0x53e5aa[_0xe6fb('0x4d')]),'body':_0x23d5ed,'headers':{'Authorization':util[_0xe6fb('0x41')]('Basic\x20%s',new Buffer(_0x5ab03b)[_0xe6fb('0x43')]('base64'))},'json':!![]};rp(_0x1e2f31)['then'](function(_0x198e87){var _0x3447e2={'messageId':_0x198e87[_0xe6fb('0x4f')][0x0]};return _0x8d28af['update'](_0x3447e2);})[_0xe6fb('0x18')](function(_0x3eff30){logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x50'),util['inspect'](_0x3eff30,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x50'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case'infobip':if(_0x53e5aa[_0xe6fb('0x2e')]&&_0x53e5aa[_0xe6fb('0x2f')]){if(_0x53e5aa[_0xe6fb('0x51')]){var _0x3c9c0e={'method':_0xe6fb('0x38'),'uri':_0x53e5aa[_0xe6fb('0x51')]+_0xe6fb('0x52'),'body':{'username':_0x53e5aa[_0xe6fb('0x2e')],'password':_0x53e5aa[_0xe6fb('0x2f')]},'json':!![]};return rp(_0x3c9c0e)[_0xe6fb('0x1d')](function(_0x26088f){var _0xd719ce={'method':_0xe6fb('0x38'),'uri':_0x53e5aa[_0xe6fb('0x51')]+_0xe6fb('0x53'),'body':{'messages':[{'from':_0x53e5aa[_0xe6fb('0x22')],'destinations':[{'to':_0x24d90d[_0xe6fb('0x22')]}],'text':_0x24d90d[_0xe6fb('0xb')],'notifyUrl':_0x53e5aa[_0xe6fb('0x25')]+_0xe6fb('0x26')+_0x24d90d['id']+_0xe6fb('0x4c')+_0x53e5aa[_0xe6fb('0x27')],'notifyContentType':_0xe6fb('0x54'),'callbackData':_0x53e5aa[_0xe6fb('0x22')]+';'+_0x24d90d['body']}]},'headers':{'Authorization':_0xe6fb('0x55')+_0x26088f[_0xe6fb('0x27')]},'json':!![]};return rp(_0xd719ce)[_0xe6fb('0x1d')](function(_0x2ebd58){if(_0x2ebd58[_0xe6fb('0x23')]){var _0x487345={'messageId':_0x2ebd58[_0xe6fb('0x23')][0x0][_0xe6fb('0x9')]};if(!_0x53e5aa['deliveryReport']){_0x487345[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x487345);}else{return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x56'),util['inspect'](_0x2ebd58,{'showHidden':![],'depth':null}));}});})[_0xe6fb('0x18')](function(_0x3750ef){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x56'),util[_0xe6fb('0x2b')](_0x3750ef,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x56'),_0xe6fb('0x57'));}}else{logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),_0xe6fb('0x56'),_0xe6fb('0x4a'));}break;case'csc':var _0x23d487=require('crypto');if(_0x53e5aa[_0xe6fb('0x58')]){var _0x512ffa={};_0x512ffa[_0xe6fb('0x59')]=_0x53e5aa['username'];_0x512ffa['phone']=_0x24d90d[_0xe6fb('0x22')];_0x512ffa[_0xe6fb('0x5a')]=_0x53e5aa[_0xe6fb('0x22')];_0x512ffa[_0xe6fb('0x5b')]=_0x24d90d[_0xe6fb('0xb')];_0x512ffa[_0xe6fb('0x5c')]=+new Date();var _0x5f4d28='';var _0xf775c4='';var _0x48939c=Object['keys'](_0x512ffa);_0x48939c[_0xe6fb('0x5d')]();for(var _0x11d600=0x0;_0x11d600<_0x48939c[_0xe6fb('0x5e')];_0x11d600++){if(_0x5f4d28!=''){_0x5f4d28+='&';}_0x5f4d28+=_0x48939c[_0x11d600]+'='+encodeURIComponent(_0x512ffa[_0x48939c[_0x11d600]]);_0xf775c4+=_0x512ffa[_0x48939c[_0x11d600]];}_0xf775c4+=_0x53e5aa[_0xe6fb('0x58')];_0xf775c4=_0x23d487[_0xe6fb('0x5f')](_0xe6fb('0x60'))['update'](_0xf775c4)[_0xe6fb('0x61')](_0xe6fb('0x62'));if(_0x5f4d28!==''){_0x5f4d28+='&';}_0x5f4d28+=_0xe6fb('0x63')+_0xf775c4;var _0x4b9865={'method':_0xe6fb('0x33'),'uri':_0x53e5aa['baseUrl']+_0xe6fb('0x64')+_0x5f4d28,'json':!![]};return rp(_0x4b9865)[_0xe6fb('0x1d')](function(_0x579f64){var _0x4b2504=Object['keys'](_0x579f64);if(_0x579f64[_0x4b2504[0x0]]['error']&&parseInt(_0x579f64[_0x4b2504[0x0]][_0xe6fb('0x19')])===0x0){var _0x55b322={'messageId':_0x579f64[_0x4b2504[0x0]][_0xe6fb('0x65')]};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x55b322[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x55b322);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe6fb('0x66'),util[_0xe6fb('0x2b')](_0x579f64[_0xe6fb('0x19')],{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x599bdd){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x66'),util[_0xe6fb('0x2b')](_0x599bdd,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),'csc',_0xe6fb('0x67'));}break;case _0xe6fb('0x68'):if(_0x53e5aa['apiKey']){var _0x487b3d={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x69'),'headers':{'Authorization':_0x53e5aa['apiKey']},'body':{'content':_0x24d90d['body'],'to':[_0x24d90d[_0xe6fb('0x22')]],'from':_0x53e5aa[_0xe6fb('0x22')],'binary':![],'clientMessageId':_0xe6fb('0x6a'),'charset':_0xe6fb('0x6b')},'json':!![]};rp(_0x487b3d)[_0xe6fb('0x1d')](function(_0x449e9f){if(!_0x449e9f[_0xe6fb('0x19')]){var _0x5bfb9e={'messageId':_0x449e9f[_0xe6fb('0x23')][0x0]['apiMessageId']};if(!_0x53e5aa[_0xe6fb('0x3b')]){_0x5bfb9e[_0xe6fb('0x3c')]=!![];}return _0x8d28af[_0xe6fb('0x16')](_0x5bfb9e);}else{return logger[_0xe6fb('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe6fb('0x2a'),_0xe6fb('0x68'),util[_0xe6fb('0x2b')](_0x449e9f[_0xe6fb('0x19')],{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x558cb8){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x68'),util[_0xe6fb('0x2b')](_0x558cb8,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'clickatell',_0xe6fb('0x67'));}break;case _0xe6fb('0x6c'):if(_0x53e5aa['username']&&_0x53e5aa[_0xe6fb('0x2f')]){var _0x5ab03b=util['format'](_0xe6fb('0x40'),_0x53e5aa[_0xe6fb('0x2e')],_0x53e5aa['password']);var _0x1e2f31={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x6d')+_0x53e5aa[_0xe6fb('0x6e')]+_0xe6fb('0x6f'),'body':{'to':[_0x24d90d[_0xe6fb('0x22')]],'text':_0x24d90d[_0xe6fb('0xb')],'from':_0x53e5aa[_0xe6fb('0x22')],'applicationId':_0x53e5aa['applicationId']},'headers':{'Authorization':util[_0xe6fb('0x41')](_0xe6fb('0x42'),new Buffer(_0x5ab03b)['toString'](_0xe6fb('0x44')))},'json':!![]};rp(_0x1e2f31)[_0xe6fb('0x1d')](function(_0x57af0){if(_0x57af0['id']){var _0x41b22f={'messageId':_0x57af0['id']};return _0x8d28af['update'](_0x41b22f);}else{logger['error'](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x6c'),util['inspect'](_0x57af0,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x18a215){logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x6c'),util[_0xe6fb('0x2b')](_0x18a215,{'showHidden':![],'depth':null}));});}else{logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),_0xe6fb('0x6c'),_0xe6fb('0x4a'));}break;case _0xe6fb('0x70'):if(_0x53e5aa[_0xe6fb('0x58')]){var _0xea73a9={};var _0x4b9865={'method':'POST','uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xe6fb('0x71')+_0x53e5aa[_0xe6fb('0x58')],'Content-Type':_0xe6fb('0x54')},'body':{'from':_0x53e5aa[_0xe6fb('0x22')],'to':_0x24d90d[_0xe6fb('0x22')],'text':_0x24d90d['body']},'json':!![]};return rp(_0x4b9865)[_0xe6fb('0x1d')](function(_0xdf156e){if(_0xdf156e[_0xe6fb('0x72')]==0xca){_0xea73a9[_0xe6fb('0x73')]=_0xdf156e;var _0x430530={'method':_0xe6fb('0x38'),'uri':_0xe6fb('0x74'),'headers':{'Authorization':_0xe6fb('0x71')+_0x53e5aa[_0xe6fb('0x58')],'Content-Type':_0xe6fb('0x54')},'body':{'refid':_0xea73a9[_0xe6fb('0x73')]['refid']},'json':!![]};return rp(_0x430530)[_0xe6fb('0x1d')](function(_0x496fd9){_0xea73a9[_0xe6fb('0x75')]=_0x496fd9;var _0x33bcde={'messageId':_0xea73a9[_0xe6fb('0x73')][_0xe6fb('0x76')],'read':!![]};return _0x8d28af[_0xe6fb('0x16')](_0x33bcde);});}else{return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),'afterCreate',_0xe6fb('0x70'),util[_0xe6fb('0x2b')](_0xdf156e,{'showHidden':![],'depth':null}));}})[_0xe6fb('0x18')](function(_0x306e80){return logger[_0xe6fb('0x19')](_0xe6fb('0x29'),_0xe6fb('0x2a'),'intelepeer',util[_0xe6fb('0x2b')](_0x306e80,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xe6fb('0x29'),_0xe6fb('0x2a'),'intelepeer',_0xe6fb('0x77'));}break;}}})[_0xe6fb('0x78')](function(){_0x31a9a3();});}else{_0x31a9a3();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index ad7cd89..181c40d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb92f=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsMessage','create','options','raw','then','CreateSmsMessage','debug','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x32729c,_0xf5afd8){var _0x482cfd=function(_0x231471){while(--_0x231471){_0x32729c['push'](_0x32729c['shift']());}};_0x482cfd(++_0xf5afd8);}(_0xb92f,0x158));var _0xfb92=function(_0x3e8618,_0x2010c7){_0x3e8618=_0x3e8618-0x0;var _0x4882ff=_0xb92f[_0x3e8618];return _0x4882ff;};'use strict';var _=require('lodash');var util=require(_0xfb92('0x0'));var moment=require(_0xfb92('0x1'));var BPromise=require('bluebird');var rs=require(_0xfb92('0x2'));var fs=require('fs');var Redis=require(_0xfb92('0x3'));var db=require(_0xfb92('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb92('0x5'))(_0xfb92('0x6'));var config=require(_0xfb92('0x7'));var jayson=require(_0xfb92('0x8'));var client=jayson[_0xfb92('0x9')]['http']({'port':0x232a});config[_0xfb92('0xa')]=_[_0xfb92('0xb')](config[_0xfb92('0xa')],{'host':_0xfb92('0xc'),'port':0x18eb});var socket=require(_0xfb92('0xd'))(new Redis(config[_0xfb92('0xa')]));require(_0xfb92('0xe'))['register'](socket);function respondWithRpcPromise(_0x8edf2b,_0x5a27a8,_0x359855){return new BPromise(function(_0x8b4330,_0x345fc0){return client[_0xfb92('0xf')](_0x8edf2b,_0x359855)['then'](function(_0x467a33){logger[_0xfb92('0x10')](_0xfb92('0x11'),_0x5a27a8,'request\x20sent');logger['debug'](_0xfb92('0x12'),_0x5a27a8,_0xfb92('0x13'),JSON[_0xfb92('0x14')](_0x467a33));if(_0x467a33[_0xfb92('0x15')]){if(_0x467a33[_0xfb92('0x15')][_0xfb92('0x16')]===0x1f4){logger['error'](_0xfb92('0x11'),_0x5a27a8,_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);return _0x345fc0(_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);}logger[_0xfb92('0x15')](_0xfb92('0x11'),_0x5a27a8,_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);return _0x8b4330(_0x467a33[_0xfb92('0x15')][_0xfb92('0x17')]);}else{logger[_0xfb92('0x10')](_0xfb92('0x11'),_0x5a27a8,'request\x20sent');_0x8b4330(_0x467a33['result']['message']);}})[_0xfb92('0x18')](function(_0x39ef5d){logger['error'](_0xfb92('0x11'),_0x5a27a8,_0x39ef5d);_0x345fc0(_0x39ef5d);});});}exports['CreateSmsMessage']=function(_0x5ad00b){var _0xa047f6=this;return new Promise(function(_0x1e2860,_0x24d46e){return db[_0xfb92('0x19')][_0xfb92('0x1a')](_0x5ad00b['body'],{'raw':_0x5ad00b[_0xfb92('0x1b')]?_0x5ad00b['options'][_0xfb92('0x1c')]===undefined?!![]:![]:!![]})[_0xfb92('0x1d')](function(_0x279c70){logger[_0xfb92('0x10')](_0xfb92('0x1e'),_0x5ad00b);logger[_0xfb92('0x1f')](_0xfb92('0x1e'),_0x5ad00b,JSON[_0xfb92('0x14')](_0x279c70));_0x1e2860(_0x279c70);})[_0xfb92('0x18')](function(_0x17b77d){logger['error']('CreateSmsMessage',_0x17b77d[_0xfb92('0x17')],_0x5ad00b);_0x24d46e(_0xa047f6[_0xfb92('0x15')](0x1f4,_0x17b77d[_0xfb92('0x17')]));});});};
\ No newline at end of file
+var _0x5150=['client','http','redis','socket.io-emitter','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage','create','body','options','CreateSmsMessage','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4dd64b,_0x3b6289){var _0x1af70d=function(_0x25d945){while(--_0x25d945){_0x4dd64b['push'](_0x4dd64b['shift']());}};_0x1af70d(++_0x3b6289);}(_0x5150,0x1c8));var _0x0515=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0x5150[_0x1a809b];return _0x5d90e6;};'use strict';var _=require(_0x0515('0x0'));var util=require(_0x0515('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0515('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0515('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0515('0x4'))(_0x0515('0x5'));var config=require(_0x0515('0x6'));var jayson=require(_0x0515('0x7'));var client=jayson[_0x0515('0x8')][_0x0515('0x9')]({'port':0x232a});config[_0x0515('0xa')]=_['defaults'](config[_0x0515('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0515('0xb'))(new Redis(config[_0x0515('0xa')]));require('./smsMessage.socket')['register'](socket);function respondWithRpcPromise(_0xb7ef54,_0x23ba3f,_0xd96dce){return new BPromise(function(_0xfa0551,_0x5e4527){return client[_0x0515('0xc')](_0xb7ef54,_0xd96dce)[_0x0515('0xd')](function(_0x918644){logger[_0x0515('0xe')](_0x0515('0xf'),_0x23ba3f,_0x0515('0x10'));logger[_0x0515('0x11')](_0x0515('0x12'),_0x23ba3f,'request\x20sent',JSON[_0x0515('0x13')](_0x918644));if(_0x918644[_0x0515('0x14')]){if(_0x918644[_0x0515('0x14')][_0x0515('0x15')]===0x1f4){logger['error'](_0x0515('0xf'),_0x23ba3f,_0x918644[_0x0515('0x14')][_0x0515('0x16')]);return _0x5e4527(_0x918644[_0x0515('0x14')][_0x0515('0x16')]);}logger[_0x0515('0x14')](_0x0515('0xf'),_0x23ba3f,_0x918644[_0x0515('0x14')]['message']);return _0xfa0551(_0x918644['error']['message']);}else{logger[_0x0515('0xe')]('SmsMessage,\x20%s,\x20%s',_0x23ba3f,'request\x20sent');_0xfa0551(_0x918644['result'][_0x0515('0x16')]);}})['catch'](function(_0x4d2099){logger[_0x0515('0x14')]('SmsMessage,\x20%s,\x20%s',_0x23ba3f,_0x4d2099);_0x5e4527(_0x4d2099);});});}exports['CreateSmsMessage']=function(_0x355f77){var _0x451f2e=this;return new Promise(function(_0x44dc4d,_0x4a3d89){return db[_0x0515('0x17')][_0x0515('0x18')](_0x355f77[_0x0515('0x19')],{'raw':_0x355f77['options']?_0x355f77[_0x0515('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0515('0xd')](function(_0x8c7fa0){logger['info'](_0x0515('0x1b'),_0x355f77);logger[_0x0515('0x11')](_0x0515('0x1b'),_0x355f77,JSON[_0x0515('0x13')](_0x8c7fa0));_0x44dc4d(_0x8c7fa0);})[_0x0515('0x1c')](function(_0x890adb){logger[_0x0515('0x14')](_0x0515('0x1b'),_0x890adb[_0x0515('0x16')],_0x355f77);_0x4a3d89(_0x451f2e[_0x0515('0x14')](0x1f4,_0x890adb['message']));});});};
\ No newline at end of file
index 73471dd..4e2204a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e27=['save','remove','update','emit','removeListener','register','length','smsMessage:'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0x0e27,0x160));var _0x70e2=function(_0x4940f7,_0xeef48b){_0x4940f7=_0x4940f7-0x0;var _0x1e2e08=_0x0e27[_0x4940f7];return _0x1e2e08;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x70e2('0x0'),_0x70e2('0x1'),_0x70e2('0x2')];function createListener(_0x4ba4ff,_0x491e97){return function(_0xe2547a){_0x491e97[_0x70e2('0x3')](_0x4ba4ff,_0xe2547a);};}function removeListener(_0x2320ed,_0x3424eb){return function(){SmsMessageEvents[_0x70e2('0x4')](_0x2320ed,_0x3424eb);};}exports[_0x70e2('0x5')]=function(_0x5e139d){for(var _0x35bdc6=0x0,_0x4284f1=events[_0x70e2('0x6')];_0x35bdc6<_0x4284f1;_0x35bdc6++){var _0x15651f=events[_0x35bdc6];var _0x4fd080=createListener(_0x70e2('0x7')+_0x15651f,_0x5e139d);SmsMessageEvents['on'](_0x15651f,_0x4fd080);}};
\ No newline at end of file
+var _0x44d9=['remove','update','emit','removeListener','register','smsMessage:','save'];(function(_0x2fd873,_0x51262f){var _0x23e544=function(_0x107c74){while(--_0x107c74){_0x2fd873['push'](_0x2fd873['shift']());}};_0x23e544(++_0x51262f);}(_0x44d9,0x164));var _0x944d=function(_0x543cf9,_0x5875e4){_0x543cf9=_0x543cf9-0x0;var _0x38adb8=_0x44d9[_0x543cf9];return _0x38adb8;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x944d('0x0'),_0x944d('0x1'),_0x944d('0x2')];function createListener(_0x451d4d,_0x3373e5){return function(_0x5cdfc0){_0x3373e5[_0x944d('0x3')](_0x451d4d,_0x5cdfc0);};}function removeListener(_0x2249f7,_0x3d37ef){return function(){SmsMessageEvents[_0x944d('0x4')](_0x2249f7,_0x3d37ef);};}exports[_0x944d('0x5')]=function(_0x59bdc1){for(var _0x313d1f=0x0,_0x28b051=events['length'];_0x313d1f<_0x28b051;_0x313d1f++){var _0x399c31=events[_0x313d1f];var _0x3aea56=createListener(_0x944d('0x6')+_0x399c31,_0x59bdc1);SmsMessageEvents['on'](_0x399c31,_0x3aea56);}};
\ No newline at end of file
index 789bf6c..fd2904d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf795=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/members','getMembers','/:id/teams'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0xf795,0x15b));var _0x5f79=function(_0x2fb8d3,_0x2ec153){_0x2fb8d3=_0x2fb8d3-0x0;var _0x278bec=_0xf795[_0x2fb8d3];return _0x278bec;};'use strict';var multer=require(_0x5f79('0x0'));var util=require('util');var path=require(_0x5f79('0x1'));var timeout=require(_0x5f79('0x2'));var express=require(_0x5f79('0x3'));var router=express['Router']();var fs_extra=require(_0x5f79('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f79('0x5'));var config=require(_0x5f79('0x6'));var controller=require(_0x5f79('0x7'));router['get']('/',auth[_0x5f79('0x8')](),controller[_0x5f79('0x9')]);router['get'](_0x5f79('0xa'),auth['isAuthenticated'](),controller[_0x5f79('0xb')]);router[_0x5f79('0xc')](_0x5f79('0xd'),auth[_0x5f79('0x8')](),controller['show']);router[_0x5f79('0xc')](_0x5f79('0xe'),auth[_0x5f79('0x8')](),controller[_0x5f79('0xf')]);router[_0x5f79('0xc')](_0x5f79('0x10'),auth['isAuthenticated'](),controller[_0x5f79('0x11')]);router['get'](_0x5f79('0x12'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x13')]);router[_0x5f79('0x14')]('/',auth[_0x5f79('0x8')](),controller[_0x5f79('0x15')]);router[_0x5f79('0x14')](_0x5f79('0x10'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x16')]);router['post'](_0x5f79('0x12'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x17')]);router['put'](_0x5f79('0xd'),auth[_0x5f79('0x8')](),controller[_0x5f79('0x18')]);router['delete'](_0x5f79('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x5f79('0x19')](_0x5f79('0x10'),auth[_0x5f79('0x8')](),controller['removeTeams']);router[_0x5f79('0x19')]('/:id/users',auth[_0x5f79('0x8')](),controller[_0x5f79('0x1a')]);module[_0x5f79('0x1b')]=router;
\ No newline at end of file
+var _0xfeb3=['/:id','show','/:id/teams','getTeams','getAgents','create','addTeams','/:id/users','addAgents','put','destroy','delete','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','describe'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xfeb3,0x11c));var _0x3feb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfeb3[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3feb('0x0'));var timeout=require(_0x3feb('0x1'));var express=require(_0x3feb('0x2'));var router=express[_0x3feb('0x3')]();var fs_extra=require(_0x3feb('0x4'));var auth=require(_0x3feb('0x5'));var interaction=require(_0x3feb('0x6'));var config=require(_0x3feb('0x7'));var controller=require(_0x3feb('0x8'));router[_0x3feb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3feb('0x9')](_0x3feb('0xa'),auth[_0x3feb('0xb')](),controller[_0x3feb('0xc')]);router['get'](_0x3feb('0xd'),auth[_0x3feb('0xb')](),controller[_0x3feb('0xe')]);router[_0x3feb('0x9')]('/:id/members',auth[_0x3feb('0xb')](),controller['getMembers']);router[_0x3feb('0x9')](_0x3feb('0xf'),auth[_0x3feb('0xb')](),controller[_0x3feb('0x10')]);router[_0x3feb('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x3feb('0x11')]);router['post']('/',auth[_0x3feb('0xb')](),controller[_0x3feb('0x12')]);router['post'](_0x3feb('0xf'),auth[_0x3feb('0xb')](),controller[_0x3feb('0x13')]);router['post'](_0x3feb('0x14'),auth['isAuthenticated'](),controller[_0x3feb('0x15')]);router[_0x3feb('0x16')]('/:id',auth[_0x3feb('0xb')](),controller['update']);router['delete'](_0x3feb('0xd'),auth[_0x3feb('0xb')](),controller[_0x3feb('0x17')]);router[_0x3feb('0x18')]('/:id/teams',auth[_0x3feb('0xb')](),controller[_0x3feb('0x19')]);router[_0x3feb('0x18')](_0x3feb('0x14'),auth['isAuthenticated'](),controller[_0x3feb('0x1a')]);module['exports']=router;
\ No newline at end of file
index 057fbfa..d5c0de1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe132=['exports','ENUM','rrmemory','beepall'];(function(_0x18fb16,_0x45edbc){var _0x147b0d=function(_0x5b1b00){while(--_0x5b1b00){_0x18fb16['push'](_0x18fb16['shift']());}};_0x147b0d(++_0x45edbc);}(_0xe132,0x13c));var _0x2e13=function(_0x275d16,_0x1d42a6){_0x275d16=_0x275d16-0x0;var _0x2a4873=_0xe132[_0x275d16];return _0x2a4873;};'use strict';var Sequelize=require('sequelize');module[_0x2e13('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2e13('0x1')](_0x2e13('0x2'),_0x2e13('0x3'),'roundrobin')}};
\ No newline at end of file
+var _0xc375=['STRING','INTEGER','ENUM','sequelize','name'];(function(_0x378666,_0x287b36){var _0x5ed40a=function(_0x39d845){while(--_0x39d845){_0x378666['push'](_0x378666['shift']());}};_0x5ed40a(++_0x287b36);}(_0xc375,0x198));var _0x5c37=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0xc375[_0x5c9307];return _0x373e29;};'use strict';var Sequelize=require(_0x5c37('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5c37('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5c37('0x2')]},'timeout':{'type':Sequelize[_0x5c37('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5c37('0x4')]('rrmemory','beepall','roundrobin')}};
\ No newline at end of file
index 5f93d3d..4bc2ae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc6f=['count','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','end','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','rows','params','keys','attributes','fields','include','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','UserId','smsPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','emit','userSmsQueue:save','select','field','tq.TeamId','from','team_has_sms_queues','join','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','forEach','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','offset','undefined','limit'];(function(_0x312b37,_0x19f474){var _0x2e5f91=function(_0x19473d){while(--_0x19473d){_0x312b37['push'](_0x312b37['shift']());}};_0x2e5f91(++_0x19f474);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x284b22,_0x1e0f2c){_0x284b22=_0x284b22-0x0;var _0x261e08=_0xdc6f[_0x284b22];return _0x261e08;};'use strict';var emlformat=require(_0xfdc6('0x0'));var rimraf=require(_0xfdc6('0x1'));var zipdir=require(_0xfdc6('0x2'));var jsonpatch=require(_0xfdc6('0x3'));var rp=require(_0xfdc6('0x4'));var moment=require(_0xfdc6('0x5'));var BPromise=require(_0xfdc6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfdc6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdc6('0x8'));var fs=require('fs');var fs_extra=require(_0xfdc6('0x9'));var _=require(_0xfdc6('0xa'));var squel=require('squel');var crypto=require(_0xfdc6('0xb'));var jsforce=require(_0xfdc6('0xc'));var deskjs=require(_0xfdc6('0xd'));var toCsv=require(_0xfdc6('0xe'));var querystring=require(_0xfdc6('0xf'));var Papa=require(_0xfdc6('0x10'));var Redis=require(_0xfdc6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdc6('0x12'));var logger=require(_0xfdc6('0x13'))(_0xfdc6('0x14'));var utils=require(_0xfdc6('0x15'));var config=require(_0xfdc6('0x16'));var licenseUtil=require(_0xfdc6('0x17'));var db=require(_0xfdc6('0x18'))['db'];config[_0xfdc6('0x19')]=_['defaults'](config['redis'],{'host':_0xfdc6('0x1a'),'port':0x18eb});var socket=require(_0xfdc6('0x1b'))(new Redis(config['redis']));require(_0xfdc6('0x1c'))[_0xfdc6('0x1d')](socket);function respondWithStatusCode(_0x1bc93b,_0x108b96){_0x108b96=_0x108b96||0xcc;return function(_0x2d65fa){if(_0x2d65fa){return _0x1bc93b[_0xfdc6('0x1e')](_0x108b96);}return _0x1bc93b['status'](_0x108b96)['end']();};}function respondWithResult(_0x30d29f,_0x54242f){_0x54242f=_0x54242f||0xc8;return function(_0x2d1096){if(_0x2d1096){return _0x30d29f[_0xfdc6('0x1f')](_0x54242f)[_0xfdc6('0x20')](_0x2d1096);}};}function respondWithFilteredResult(_0x27f792,_0x1aab92){return function(_0x8edff2){if(_0x8edff2){var _0x162f4c=typeof _0x1aab92[_0xfdc6('0x21')]===_0xfdc6('0x22')&&typeof _0x1aab92[_0xfdc6('0x23')]===_0xfdc6('0x22');var _0x5162f0=_0x8edff2['count'];var _0x2c153e=_0x162f4c?0x0:_0x1aab92[_0xfdc6('0x21')];var _0x3ee545=_0x162f4c?_0x8edff2[_0xfdc6('0x24')]:_0x1aab92[_0xfdc6('0x21')]+_0x1aab92['limit'];var _0x2c47f9;if(_0x3ee545>=_0x5162f0){_0x3ee545=_0x5162f0;_0x2c47f9=0xc8;}else{_0x2c47f9=0xce;}_0x27f792[_0xfdc6('0x1f')](_0x2c47f9);return _0x27f792['set'](_0xfdc6('0x25'),_0x2c153e+'-'+_0x3ee545+'/'+_0x5162f0)[_0xfdc6('0x20')](_0x8edff2);}return null;};}function patchUpdates(_0xc99016){return function(_0xa3b96){try{jsonpatch[_0xfdc6('0x26')](_0xa3b96,_0xc99016,!![]);}catch(_0x4c0c17){return BPromise[_0xfdc6('0x27')](_0x4c0c17);}return _0xa3b96[_0xfdc6('0x28')]();};}function saveUpdates(_0x8a370d,_0x5e1d9e){return function(_0x2e3144){if(_0x2e3144){return _0x2e3144[_0xfdc6('0x29')](_0x8a370d)[_0xfdc6('0x2a')](function(_0x4af107){return _0x4af107;});}return null;};}function removeEntity(_0x40906b,_0x4854dd){return function(_0x3bc238){if(_0x3bc238){return _0x3bc238[_0xfdc6('0x2b')]()[_0xfdc6('0x2a')](function(){var _0x7c0a84=_0x3bc238[_0xfdc6('0x2c')]({'plain':!![]});var _0x3ed8ac=_0xfdc6('0x2d');return db[_0xfdc6('0x2e')][_0xfdc6('0x2b')]({'where':{'type':_0x3ed8ac,'resourceId':_0x7c0a84['id']}})[_0xfdc6('0x2a')](function(){return _0x3bc238;});})['then'](function(){_0x40906b['status'](0xcc)[_0xfdc6('0x2f')]();});}};}function handleEntityNotFound(_0x4fbfe6,_0x5678e7){return function(_0x381a12){if(!_0x381a12){_0x4fbfe6[_0xfdc6('0x1e')](0x194);}return _0x381a12;};}function handleError(_0x3d87a7,_0x1a099b){_0x1a099b=_0x1a099b||0x1f4;return function(_0x55cdc0){logger[_0xfdc6('0x30')](_0x55cdc0['stack']);if(_0x55cdc0[_0xfdc6('0x31')]){delete _0x55cdc0[_0xfdc6('0x31')];}_0x3d87a7[_0xfdc6('0x1f')](_0x1a099b)[_0xfdc6('0x32')](_0x55cdc0);};}exports[_0xfdc6('0x33')]=function(_0x3171f7,_0x2062cd){var _0x17d5d0={},_0x31bb01={},_0x348559={'count':0x0,'rows':[]};var _0x1f000b=_[_0xfdc6('0x34')](db[_0xfdc6('0x35')][_0xfdc6('0x36')],function(_0x37883c){return{'name':_0x37883c[_0xfdc6('0x37')],'type':_0x37883c[_0xfdc6('0x38')][_0xfdc6('0x39')]};});_0x31bb01[_0xfdc6('0x3a')]=_[_0xfdc6('0x34')](_0x1f000b,_0xfdc6('0x31'));_0x31bb01[_0xfdc6('0x3b')]=_['keys'](_0x3171f7[_0xfdc6('0x3b')]);_0x31bb01[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0x31bb01['model'],_0x31bb01[_0xfdc6('0x3b')]);_0x17d5d0['attributes']=_[_0xfdc6('0x3d')](_0x31bb01['model'],qs['fields'](_0x3171f7['query']['fields']));_0x17d5d0['attributes']=_0x17d5d0['attributes'][_0xfdc6('0x3e')]?_0x17d5d0['attributes']:_0x31bb01['model'];if(!_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x3f')](_0xfdc6('0x40'))){_0x17d5d0[_0xfdc6('0x23')]=qs[_0xfdc6('0x23')](_0x3171f7['query'][_0xfdc6('0x23')]);_0x17d5d0[_0xfdc6('0x21')]=qs['offset'](_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x21')]);}_0x17d5d0[_0xfdc6('0x41')]=qs[_0xfdc6('0x42')](_0x3171f7['query'][_0xfdc6('0x42')]);_0x17d5d0['where']=qs[_0xfdc6('0x3c')](_[_0xfdc6('0x43')](_0x3171f7[_0xfdc6('0x3b')],_0x31bb01['filters']),_0x1f000b);if(_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x44')]){_0x17d5d0[_0xfdc6('0x45')]=_['merge'](_0x17d5d0[_0xfdc6('0x45')],{'$or':_[_0xfdc6('0x34')](_0x1f000b,function(_0x54cec2){if(_0x54cec2[_0xfdc6('0x38')]!==_0xfdc6('0x46')){var _0x50ae7c={};_0x50ae7c[_0x54cec2['name']]={'$like':'%'+_0x3171f7['query'][_0xfdc6('0x44')]+'%'};return _0x50ae7c;}})});}_0x17d5d0=_[_0xfdc6('0x47')]({},_0x17d5d0,_0x3171f7['options']);var _0x2cc0ae={'where':_0x17d5d0[_0xfdc6('0x45')]};return db[_0xfdc6('0x35')][_0xfdc6('0x24')](_0x2cc0ae)['then'](function(_0x140ece){_0x348559[_0xfdc6('0x24')]=_0x140ece;if(_0x3171f7[_0xfdc6('0x3b')][_0xfdc6('0x48')]){_0x17d5d0['include']=[{'all':!![]}];}return db['SmsQueue'][_0xfdc6('0x49')](_0x17d5d0);})[_0xfdc6('0x2a')](function(_0x207bac){_0x348559[_0xfdc6('0x4a')]=_0x207bac;return _0x348559;})[_0xfdc6('0x2a')](respondWithFilteredResult(_0x2062cd,_0x17d5d0))['catch'](handleError(_0x2062cd,null));};exports['show']=function(_0x3d84af,_0xd83fb8){var _0x35ac4f={'raw':!![],'where':{'id':_0x3d84af[_0xfdc6('0x4b')]['id']}},_0x151100={};_0x151100[_0xfdc6('0x3a')]=_['keys'](db[_0xfdc6('0x35')][_0xfdc6('0x36')]);_0x151100[_0xfdc6('0x3b')]=_[_0xfdc6('0x4c')](_0x3d84af[_0xfdc6('0x3b')]);_0x151100[_0xfdc6('0x3c')]=_['intersection'](_0x151100[_0xfdc6('0x3a')],_0x151100[_0xfdc6('0x3b')]);_0x35ac4f[_0xfdc6('0x4d')]=_['intersection'](_0x151100[_0xfdc6('0x3a')],qs[_0xfdc6('0x4e')](_0x3d84af[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x35ac4f['attributes']=_0x35ac4f[_0xfdc6('0x4d')][_0xfdc6('0x3e')]?_0x35ac4f[_0xfdc6('0x4d')]:_0x151100[_0xfdc6('0x3a')];if(_0x3d84af[_0xfdc6('0x3b')][_0xfdc6('0x48')]){_0x35ac4f[_0xfdc6('0x4f')]=[{'all':!![]}];}_0x35ac4f=_[_0xfdc6('0x47')]({},_0x35ac4f,_0x3d84af[_0xfdc6('0x50')]);return db['SmsQueue']['find'](_0x35ac4f)[_0xfdc6('0x2a')](handleEntityNotFound(_0xd83fb8,null))[_0xfdc6('0x2a')](respondWithResult(_0xd83fb8,null))[_0xfdc6('0x51')](handleError(_0xd83fb8,null));};exports[_0xfdc6('0x52')]=function(_0x232cca,_0x5b7aca){return db['SmsQueue'][_0xfdc6('0x52')](_0x232cca[_0xfdc6('0x53')],{})[_0xfdc6('0x2a')](function(_0x336c6b){var _0xd80c8a=_0x232cca['user'][_0xfdc6('0x2c')]({'plain':!![]});if(!_0xd80c8a)throw new Error(_0xfdc6('0x54'));if(_0xd80c8a[_0xfdc6('0x55')]==='user'){var _0x442b22=_0x336c6b[_0xfdc6('0x2c')]({'plain':!![]});var _0x342a51='SmsQueues';return db[_0xfdc6('0x56')]['find']({'where':{'name':_0x342a51,'userProfileId':_0xd80c8a[_0xfdc6('0x57')]},'raw':!![]})['then'](function(_0x72960e){if(_0x72960e&&_0x72960e['autoAssociation']===0x0){return db['UserProfileResource'][_0xfdc6('0x52')]({'name':_0x442b22[_0xfdc6('0x31')],'resourceId':_0x442b22['id'],'type':_0x72960e[_0xfdc6('0x31')],'sectionId':_0x72960e['id']},{})[_0xfdc6('0x2a')](function(){return _0x336c6b;});}else{return _0x336c6b;}})[_0xfdc6('0x51')](function(_0x19f566){logger[_0xfdc6('0x30')](_0xfdc6('0x58'),_0x19f566);throw _0x19f566;});}return _0x336c6b;})['then'](respondWithResult(_0x5b7aca,0xc9))['catch'](handleError(_0x5b7aca,null));};exports[_0xfdc6('0x29')]=function(_0x39ce70,_0x348f66){if(_0x39ce70[_0xfdc6('0x53')]['id']){delete _0x39ce70[_0xfdc6('0x53')]['id'];}return db['SmsQueue'][_0xfdc6('0x59')]({'where':{'id':_0x39ce70[_0xfdc6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x348f66,null))[_0xfdc6('0x2a')](saveUpdates(_0x39ce70[_0xfdc6('0x53')],null))['then'](respondWithResult(_0x348f66,null))[_0xfdc6('0x51')](handleError(_0x348f66,null));};exports[_0xfdc6('0x2b')]=function(_0x37dcbf,_0x4efa35){return db[_0xfdc6('0x35')][_0xfdc6('0x59')]({'where':{'id':_0x37dcbf[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x4efa35,null))[_0xfdc6('0x2a')](removeEntity(_0x4efa35,null))[_0xfdc6('0x51')](handleError(_0x4efa35,null));};exports['describe']=function(_0x426524,_0x4b4817){return db[_0xfdc6('0x35')][_0xfdc6('0x5a')]()[_0xfdc6('0x2a')](respondWithResult(_0x4b4817,null))['catch'](handleError(_0x4b4817,null));};exports[_0xfdc6('0x5b')]=function(_0x549236,_0x3279b5,_0x5701ba){var _0x299d7a={'raw':!![],'where':{}},_0x4744d1={},_0x3524cc;return db[_0xfdc6('0x35')][_0xfdc6('0x5c')]({'where':{'id':_0x549236[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x3279b5,null))[_0xfdc6('0x2a')](function(_0x5480f2){if(_0x5480f2){_0x3524cc=_0x5480f2[_0xfdc6('0x2c')]({'plain':!![]});_0x4744d1[_0xfdc6('0x3a')]=_[_0xfdc6('0x4c')](db[_0xfdc6('0x5d')][_0xfdc6('0x36')]);_0x4744d1[_0xfdc6('0x3b')]=_[_0xfdc6('0x4c')](_0x549236['query']);_0x4744d1[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0x4744d1[_0xfdc6('0x3a')],_0x4744d1[_0xfdc6('0x3b')]);_0x299d7a[_0xfdc6('0x4d')]=_['intersection'](_0x4744d1[_0xfdc6('0x3a')],qs[_0xfdc6('0x4e')](_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x299d7a[_0xfdc6('0x4d')]=_0x299d7a['attributes'][_0xfdc6('0x3e')]?_0x299d7a[_0xfdc6('0x4d')]:_0x4744d1[_0xfdc6('0x3a')];if(!_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x3f')](_0xfdc6('0x40'))){_0x299d7a[_0xfdc6('0x23')]=qs['limit'](_0x549236['query'][_0xfdc6('0x23')]);_0x299d7a[_0xfdc6('0x21')]=qs['offset'](_0x549236['query'][_0xfdc6('0x21')]);}_0x299d7a['order']=qs[_0xfdc6('0x42')](_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x42')]);_0x299d7a['where']=qs[_0xfdc6('0x3c')](_[_0xfdc6('0x43')](_0x549236[_0xfdc6('0x3b')],_0x4744d1[_0xfdc6('0x3c')]));_0x299d7a[_0xfdc6('0x45')][_0xfdc6('0x5e')]=_0x5480f2['id'];if(_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x44')]){_0x299d7a[_0xfdc6('0x45')]=_[_0xfdc6('0x47')](_0x299d7a['where'],{'$or':_['map'](_0x299d7a[_0xfdc6('0x4d')],function(_0x25630f){var _0x178e07={};_0x178e07[_0x25630f]={'$like':'%'+_0x549236[_0xfdc6('0x3b')][_0xfdc6('0x44')]+'%'};return _0x178e07;})});}_0x299d7a=_[_0xfdc6('0x47')]({},_0x299d7a,_0x549236[_0xfdc6('0x50')]);return db[_0xfdc6('0x5d')][_0xfdc6('0x49')](_0x299d7a);}})[_0xfdc6('0x2a')](function(_0x483952){if(_0x483952){return db[_0xfdc6('0x5f')][_0xfdc6('0x60')]({'where':{'id':_[_0xfdc6('0x34')](_0x483952,_0xfdc6('0x61')),'role':'agent'},'attributes':['id',_0xfdc6('0x31'),_0xfdc6('0x62'),'updatedAt',_0xfdc6('0x63')]});}})[_0xfdc6('0x2a')](function(_0x44742b){if(_0x44742b){return{'count':_0x44742b[_0xfdc6('0x24')],'rows':_['map'](_0x44742b[_0xfdc6('0x4a')],function(_0x197cf0){return{'membername':_0x197cf0[_0xfdc6('0x31')],'UserId':_0x197cf0['id'],'queue_name':_0x3524cc[_0xfdc6('0x31')],'SmsQueueId':_0x3524cc['id'],'interface':util['format'](_0xfdc6('0x64'),_0xfdc6('0x65'),_0x197cf0[_0xfdc6('0x31')]),'penalty':0x0,'paused':_0x197cf0[_0xfdc6('0x62')],'createdAt':_0x197cf0[_0xfdc6('0x63')],'updatedAt':_0x197cf0[_0xfdc6('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfdc6('0x2a')](respondWithFilteredResult(_0x3279b5,_0x299d7a))[_0xfdc6('0x51')](handleError(_0x3279b5,null));};exports[_0xfdc6('0x67')]=function(_0x233676,_0x57fe20,_0x11528d){var _0x44e188={};var _0x1199a0={};var _0x40ac51;var _0x2ee02a;return db[_0xfdc6('0x35')]['findOne']({'where':{'id':_0x233676[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x57fe20,null))[_0xfdc6('0x2a')](function(_0x44dc7f){if(_0x44dc7f){_0x40ac51=_0x44dc7f;_0x1199a0['model']=_[_0xfdc6('0x4c')](db[_0xfdc6('0x68')]['rawAttributes']);_0x1199a0['query']=_[_0xfdc6('0x4c')](_0x233676[_0xfdc6('0x3b')]);_0x1199a0[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0x1199a0['model'],_0x1199a0['query']);_0x44e188[_0xfdc6('0x4d')]=_[_0xfdc6('0x3d')](_0x1199a0[_0xfdc6('0x3a')],qs['fields'](_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x44e188['attributes']=_0x44e188[_0xfdc6('0x4d')][_0xfdc6('0x3e')]?_0x44e188[_0xfdc6('0x4d')]:_0x1199a0[_0xfdc6('0x3a')];_0x44e188[_0xfdc6('0x41')]=qs[_0xfdc6('0x42')](_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x42')]);_0x44e188['where']=qs['filters'](_['pick'](_0x233676[_0xfdc6('0x3b')],_0x1199a0['filters']));if(_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x44')]){_0x44e188[_0xfdc6('0x45')]=_[_0xfdc6('0x47')](_0x44e188[_0xfdc6('0x45')],{'$or':_[_0xfdc6('0x34')](_0x44e188[_0xfdc6('0x4d')],function(_0xe696c7){var _0x94ca1a={};_0x94ca1a[_0xe696c7]={'$like':'%'+_0x233676[_0xfdc6('0x3b')]['filter']+'%'};return _0x94ca1a;})});}_0x44e188=_[_0xfdc6('0x47')]({},_0x44e188,_0x233676['options']);return _0x40ac51[_0xfdc6('0x67')](_0x44e188);}})[_0xfdc6('0x2a')](function(_0x501484){if(_0x501484){_0x2ee02a=_0x501484[_0xfdc6('0x3e')];if(!_0x233676['query'][_0xfdc6('0x3f')](_0xfdc6('0x40'))){_0x44e188[_0xfdc6('0x23')]=qs[_0xfdc6('0x23')](_0x233676[_0xfdc6('0x3b')][_0xfdc6('0x23')]);_0x44e188[_0xfdc6('0x21')]=qs[_0xfdc6('0x21')](_0x233676[_0xfdc6('0x3b')]['offset']);}return _0x40ac51[_0xfdc6('0x67')](_0x44e188);}})[_0xfdc6('0x2a')](function(_0x257ea7){if(_0x257ea7){return _0x257ea7?{'count':_0x2ee02a,'rows':_0x257ea7}:null;}})[_0xfdc6('0x2a')](respondWithResult(_0x57fe20,null))[_0xfdc6('0x51')](handleError(_0x57fe20,null));};exports[_0xfdc6('0x69')]=function(_0x3afb42,_0x4e73ea,_0x32d17d){var _0x37d7af=_0x3afb42['body'][_0xfdc6('0x6a')];return db[_0xfdc6('0x68')][_0xfdc6('0x49')]({'where':{'id':_0x37d7af},'attributes':['id'],'include':[{'model':db[_0xfdc6('0x5f')],'as':_0xfdc6('0x6b'),'attributes':['id','name',_0xfdc6('0x6c'),_0xfdc6('0x6d'),'interface'],'raw':!![]}]})[_0xfdc6('0x2a')](function(_0x3a20e0){if(_0x3a20e0){var _0x597b67=_[_0xfdc6('0x6e')](_0x3a20e0,function(_0x558e37){var _0x5f52d4=_0x558e37['get']({'plain':!![]});return _0x5f52d4['Agents'];});return db['SmsQueue'][_0xfdc6('0x59')]({'where':{'id':_0x3afb42[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](function(_0x570b46){return db[_0xfdc6('0x6f')]['transaction'](function(_0x1a4992){return _0x570b46[_0xfdc6('0x69')](_0x37d7af,{'transaction':_0x1a4992})[_0xfdc6('0x2a')](function(){return BPromise[_0xfdc6('0x70')](_0x597b67,function(_0x3c94be){return db[_0xfdc6('0x5d')][_0xfdc6('0x71')]({'where':{'UserId':_0x3c94be['id'],'SmsQueueId':_0x3afb42[_0xfdc6('0x4b')]['id']},'transaction':_0x1a4992});});})['then'](function(){_0x597b67['forEach'](function(_0x3ee182){socket[_0xfdc6('0x72')](_0xfdc6('0x73'),{'UserId':_0x3ee182['id'],'SmsQueueId':_0x570b46['id']});});});});});}})[_0xfdc6('0x2a')](respondWithStatusCode(_0x4e73ea,null))[_0xfdc6('0x51')](handleError(_0x4e73ea,null));};exports['removeTeams']=function(_0x4421b2,_0x3d29a9,_0xb6cdb7){return db['Team'][_0xfdc6('0x49')]({'where':{'id':_0x4421b2[_0xfdc6('0x3b')][_0xfdc6('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xfdc6('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfdc6('0x2a')](handleEntityNotFound(_0x3d29a9,null))[_0xfdc6('0x2a')](function(_0x4cca4d){var _0x299f59=_['map'](_0x4cca4d,'id');var _0x32799e=[];var _0x1ce533=[];var _0x527ef2=squel[_0xfdc6('0x74')]();_0x527ef2[_0xfdc6('0x75')](_0xfdc6('0x76'))[_0xfdc6('0x77')](_0xfdc6('0x78'),'tq')[_0xfdc6('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfdc6('0x45')](_0xfdc6('0x7a'),_0x4421b2['params']['id']);for(var _0x1241cd=0x0;_0x1241cd<_0x4cca4d[_0xfdc6('0x3e')];_0x1241cd+=0x1){let _0x2ccfc1=_0x4cca4d[_0x1241cd];for(var _0x3cbda7=0x0;_0x3cbda7<_0x2ccfc1['Agents'][_0xfdc6('0x3e')];_0x3cbda7+=0x1){let _0x5cc301=_0x2ccfc1[_0xfdc6('0x6b')][_0x3cbda7];var _0x6fbfde=_0x527ef2[_0xfdc6('0x7b')]();_0x6fbfde['where'](_0xfdc6('0x7c'),_0x5cc301['id']);_0x1ce533[_0xfdc6('0x7d')](db[_0xfdc6('0x6f')][_0xfdc6('0x3b')](_0x6fbfde[_0xfdc6('0x7e')](),{'type':db['sequelize'][_0xfdc6('0x7f')][_0xfdc6('0x80')]})['then'](function(_0x1750a6){if(_0x1750a6[_0xfdc6('0x3e')]===0x1){return _0x5cc301['id'];}else{var _0x337dcb=_['every'](_['map'](_0x1750a6,_0xfdc6('0x81')),function(_0x9d5f55){return _[_0xfdc6('0x82')](_0x299f59,_0x9d5f55);});if(_0x337dcb){return _0x5cc301['id'];}}}));}}return BPromise[_0xfdc6('0x83')](_0x1ce533)['then'](function(_0x447295){_0x32799e=_(_0x32799e)[_0xfdc6('0x84')](_0x447295)[_0xfdc6('0x85')]()[_0xfdc6('0x86')]();return db[_0xfdc6('0x35')]['find']({'where':{'id':_0x4421b2[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](function(_0x14a93b){return db[_0xfdc6('0x6f')]['transaction'](function(_0x50387f){return _0x14a93b[_0xfdc6('0x87')](_0x4421b2[_0xfdc6('0x3b')][_0xfdc6('0x6a')],{'transaction':_0x50387f})[_0xfdc6('0x2a')](function(){if(!_[_0xfdc6('0x88')](_0x32799e)){return _0x14a93b['removeAgents'](_0x32799e,{'transaction':_0x50387f});}})[_0xfdc6('0x2a')](function(){_0x32799e[_0xfdc6('0x89')](function(_0x17e58c){socket['emit'](_0xfdc6('0x8a'),{'UserId':_0x17e58c,'SmsQueueId':_0x14a93b['id']});});});});});});})[_0xfdc6('0x2a')](respondWithStatusCode(_0x3d29a9,null))[_0xfdc6('0x51')](handleError(_0x3d29a9,null));};exports[_0xfdc6('0x8b')]=function(_0x78d41e,_0x3534e7,_0x2b68db){return db[_0xfdc6('0x35')]['find']({'where':{'id':_0x78d41e[_0xfdc6('0x4b')]['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x3534e7,null))[_0xfdc6('0x2a')](function(_0x3eafa0){if(_0x3eafa0){return _0x3eafa0[_0xfdc6('0x8b')](_0x78d41e[_0xfdc6('0x53')][_0xfdc6('0x6a')],_[_0xfdc6('0x8c')](_0x78d41e[_0xfdc6('0x53')],[_0xfdc6('0x6a'),'id'])||{})[_0xfdc6('0x8d')](function(_0x57e24b){for(var _0xed3c5f=0x0;_0xed3c5f<_0x78d41e[_0xfdc6('0x53')][_0xfdc6('0x6a')][_0xfdc6('0x3e')];_0xed3c5f+=0x1){socket['emit'](_0xfdc6('0x73'),{'UserId':Number(_0x78d41e['body'][_0xfdc6('0x6a')][_0xed3c5f]),'SmsQueueId':Number(_0x78d41e[_0xfdc6('0x4b')]['id'])});}return _0x57e24b;});}})['then'](respondWithResult(_0x3534e7,null))[_0xfdc6('0x51')](handleError(_0x3534e7,null));};exports[_0xfdc6('0x8e')]=function(_0x5b23ef,_0x46a275,_0x3bb3e2){return db[_0xfdc6('0x35')][_0xfdc6('0x59')]({'where':{'id':_0x5b23ef[_0xfdc6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46a275,null))[_0xfdc6('0x2a')](function(_0xe008f6){if(_0xe008f6){return _0xe008f6['removeAgents'](_0x5b23ef[_0xfdc6('0x3b')][_0xfdc6('0x6a')])[_0xfdc6('0x2a')](function(){if(_[_0xfdc6('0x8f')](_0x5b23ef[_0xfdc6('0x3b')]['ids'])){for(var _0x4da025=0x0;_0x4da025<_0x5b23ef[_0xfdc6('0x3b')][_0xfdc6('0x6a')][_0xfdc6('0x3e')];_0x4da025+=0x1){socket[_0xfdc6('0x72')](_0xfdc6('0x8a'),{'UserId':Number(_0x5b23ef['query']['ids'][_0x4da025]),'SmsQueueId':Number(_0x5b23ef['params']['id'])});}}else{socket['emit'](_0xfdc6('0x8a'),{'UserId':Number(_0x5b23ef[_0xfdc6('0x3b')][_0xfdc6('0x6a')]),'SmsQueueId':Number(_0x5b23ef[_0xfdc6('0x4b')]['id'])});}});}})[_0xfdc6('0x2a')](respondWithStatusCode(_0x46a275,null))[_0xfdc6('0x51')](handleError(_0x46a275,null));};exports['getAgents']=function(_0x3662c3,_0x4e86ac,_0xf7b1a8){var _0x2566c3={};var _0xa50260={};var _0x4bddae;var _0x1aa670;return db[_0xfdc6('0x35')][_0xfdc6('0x5c')]({'where':{'id':_0x3662c3['params']['id']}})[_0xfdc6('0x2a')](handleEntityNotFound(_0x4e86ac,null))[_0xfdc6('0x2a')](function(_0x30b29c){if(_0x30b29c){_0x4bddae=_0x30b29c;_0xa50260[_0xfdc6('0x3a')]=_[_0xfdc6('0x4c')](db[_0xfdc6('0x5f')][_0xfdc6('0x36')]);_0xa50260['query']=_[_0xfdc6('0x4c')](_0x3662c3['query']);_0xa50260[_0xfdc6('0x3c')]=_[_0xfdc6('0x3d')](_0xa50260[_0xfdc6('0x3a')],_0xa50260[_0xfdc6('0x3b')]);_0x2566c3[_0xfdc6('0x4d')]=_[_0xfdc6('0x3d')](_0xa50260['model'],qs[_0xfdc6('0x4e')](_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x4e')]));_0x2566c3[_0xfdc6('0x4d')]=_0x2566c3[_0xfdc6('0x4d')][_0xfdc6('0x3e')]?_0x2566c3[_0xfdc6('0x4d')]:_0xa50260['model'];_0x2566c3[_0xfdc6('0x41')]=qs[_0xfdc6('0x42')](_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x42')]);_0x2566c3[_0xfdc6('0x45')]=qs[_0xfdc6('0x3c')](_[_0xfdc6('0x43')](_0x3662c3[_0xfdc6('0x3b')],_0xa50260['filters']));if(_0x3662c3['query']['filter']){_0x2566c3['where']=_[_0xfdc6('0x47')](_0x2566c3[_0xfdc6('0x45')],{'$or':_[_0xfdc6('0x34')](_0x2566c3[_0xfdc6('0x4d')],function(_0x28e25b){var _0x21f20e={};_0x21f20e[_0x28e25b]={'$like':'%'+_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x44')]+'%'};return _0x21f20e;})});}_0x2566c3=_['merge']({},_0x2566c3,_0x3662c3['options']);return _0x4bddae[_0xfdc6('0x90')](_0x2566c3);}})['then'](function(_0x180aab){if(_0x180aab){_0x1aa670=_0x180aab['length'];if(!_0x3662c3[_0xfdc6('0x3b')]['hasOwnProperty'](_0xfdc6('0x40'))){_0x2566c3[_0xfdc6('0x23')]=qs[_0xfdc6('0x23')](_0x3662c3[_0xfdc6('0x3b')][_0xfdc6('0x23')]);_0x2566c3[_0xfdc6('0x21')]=qs[_0xfdc6('0x21')](_0x3662c3['query'][_0xfdc6('0x21')]);}return _0x4bddae[_0xfdc6('0x90')](_0x2566c3);}})[_0xfdc6('0x2a')](function(_0x4a1360){if(_0x4a1360){return _0x4a1360?{'count':_0x1aa670,'rows':_0x4a1360}:null;}})[_0xfdc6('0x2a')](respondWithResult(_0x4e86ac,null))[_0xfdc6('0x51')](handleError(_0x4e86ac,null));};
\ No newline at end of file
+var _0x014c=['save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','params','keys','includeAll','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','ids','findAll','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','SELECT','every','includes','all','compact','value','isEmpty','removeAgents','addAgents','omit','spread','userSmsQueue:save','isArray','userSmsQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject'];(function(_0x5b06fb,_0x1190f4){var _0x53a53a=function(_0x52adb4){while(--_0x52adb4){_0x5b06fb['push'](_0x5b06fb['shift']());}};_0x53a53a(++_0x1190f4);}(_0x014c,0x17b));var _0xc014=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0x014c[_0x10d0f0];return _0x93e308;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];config[_0xc014('0x15')]=_[_0xc014('0x16')](config[_0xc014('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc014('0x17'))(new Redis(config[_0xc014('0x15')]));require(_0xc014('0x18'))['register'](socket);function respondWithStatusCode(_0x36b26e,_0x4fe97e){_0x4fe97e=_0x4fe97e||0xcc;return function(_0x458195){if(_0x458195){return _0x36b26e[_0xc014('0x19')](_0x4fe97e);}return _0x36b26e[_0xc014('0x1a')](_0x4fe97e)[_0xc014('0x1b')]();};}function respondWithResult(_0x9f6a26,_0x9791b9){_0x9791b9=_0x9791b9||0xc8;return function(_0x4aa669){if(_0x4aa669){return _0x9f6a26[_0xc014('0x1a')](_0x9791b9)[_0xc014('0x1c')](_0x4aa669);}};}function respondWithFilteredResult(_0x263ad0,_0x1b2f1b){return function(_0x5a2be0){if(_0x5a2be0){var _0x4d29bb=typeof _0x1b2f1b[_0xc014('0x1d')]==='undefined'&&typeof _0x1b2f1b['limit']===_0xc014('0x1e');var _0x4287fe=_0x5a2be0['count'];var _0x9442cc=_0x4d29bb?0x0:_0x1b2f1b[_0xc014('0x1d')];var _0x391a07=_0x4d29bb?_0x5a2be0[_0xc014('0x1f')]:_0x1b2f1b[_0xc014('0x1d')]+_0x1b2f1b['limit'];var _0xc8b0fb;if(_0x391a07>=_0x4287fe){_0x391a07=_0x4287fe;_0xc8b0fb=0xc8;}else{_0xc8b0fb=0xce;}_0x263ad0[_0xc014('0x1a')](_0xc8b0fb);return _0x263ad0[_0xc014('0x20')](_0xc014('0x21'),_0x9442cc+'-'+_0x391a07+'/'+_0x4287fe)[_0xc014('0x1c')](_0x5a2be0);}return null;};}function patchUpdates(_0x3f28b6){return function(_0x380fca){try{jsonpatch['apply'](_0x380fca,_0x3f28b6,!![]);}catch(_0x1089c6){return BPromise[_0xc014('0x22')](_0x1089c6);}return _0x380fca[_0xc014('0x23')]();};}function saveUpdates(_0x174b46,_0xb0e94e){return function(_0x144e11){if(_0x144e11){return _0x144e11[_0xc014('0x24')](_0x174b46)[_0xc014('0x25')](function(_0xe4c68){return _0xe4c68;});}return null;};}function removeEntity(_0x2e5c30,_0x4850bb){return function(_0x1d6020){if(_0x1d6020){return _0x1d6020[_0xc014('0x26')]()[_0xc014('0x25')](function(){var _0x7f47ef=_0x1d6020[_0xc014('0x27')]({'plain':!![]});var _0x5676a3=_0xc014('0x28');return db[_0xc014('0x29')][_0xc014('0x26')]({'where':{'type':_0x5676a3,'resourceId':_0x7f47ef['id']}})[_0xc014('0x25')](function(){return _0x1d6020;});})['then'](function(){_0x2e5c30[_0xc014('0x1a')](0xcc)[_0xc014('0x1b')]();});}};}function handleEntityNotFound(_0x151705,_0x30e97a){return function(_0x21cd81){if(!_0x21cd81){_0x151705[_0xc014('0x19')](0x194);}return _0x21cd81;};}function handleError(_0x106a33,_0x6d69b){_0x6d69b=_0x6d69b||0x1f4;return function(_0x93186){logger[_0xc014('0x2a')](_0x93186[_0xc014('0x2b')]);if(_0x93186['name']){delete _0x93186[_0xc014('0x2c')];}_0x106a33['status'](_0x6d69b)['send'](_0x93186);};}exports['index']=function(_0x40fae2,_0x2c041f){var _0x5aeb3b={},_0x32b089={},_0x2b7379={'count':0x0,'rows':[]};var _0x2d1859=_[_0xc014('0x2d')](db[_0xc014('0x2e')][_0xc014('0x2f')],function(_0x3e6c54){return{'name':_0x3e6c54[_0xc014('0x30')],'type':_0x3e6c54[_0xc014('0x31')][_0xc014('0x32')]};});_0x32b089[_0xc014('0x33')]=_[_0xc014('0x2d')](_0x2d1859,'name');_0x32b089[_0xc014('0x34')]=_['keys'](_0x40fae2[_0xc014('0x34')]);_0x32b089[_0xc014('0x35')]=_[_0xc014('0x36')](_0x32b089[_0xc014('0x33')],_0x32b089[_0xc014('0x34')]);_0x5aeb3b[_0xc014('0x37')]=_[_0xc014('0x36')](_0x32b089['model'],qs[_0xc014('0x38')](_0x40fae2['query'][_0xc014('0x38')]));_0x5aeb3b[_0xc014('0x37')]=_0x5aeb3b[_0xc014('0x37')][_0xc014('0x39')]?_0x5aeb3b[_0xc014('0x37')]:_0x32b089[_0xc014('0x33')];if(!_0x40fae2[_0xc014('0x34')]['hasOwnProperty'](_0xc014('0x3a'))){_0x5aeb3b[_0xc014('0x3b')]=qs[_0xc014('0x3b')](_0x40fae2['query'][_0xc014('0x3b')]);_0x5aeb3b[_0xc014('0x1d')]=qs[_0xc014('0x1d')](_0x40fae2['query'][_0xc014('0x1d')]);}_0x5aeb3b['order']=qs[_0xc014('0x3c')](_0x40fae2[_0xc014('0x34')][_0xc014('0x3c')]);_0x5aeb3b[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x40fae2[_0xc014('0x34')],_0x32b089[_0xc014('0x35')]),_0x2d1859);if(_0x40fae2[_0xc014('0x34')][_0xc014('0x3f')]){_0x5aeb3b[_0xc014('0x3d')]=_[_0xc014('0x40')](_0x5aeb3b['where'],{'$or':_[_0xc014('0x2d')](_0x2d1859,function(_0x368dd6){if(_0x368dd6[_0xc014('0x31')]!==_0xc014('0x41')){var _0x4dc56f={};_0x4dc56f[_0x368dd6[_0xc014('0x2c')]]={'$like':'%'+_0x40fae2['query'][_0xc014('0x3f')]+'%'};return _0x4dc56f;}})});}_0x5aeb3b=_[_0xc014('0x40')]({},_0x5aeb3b,_0x40fae2[_0xc014('0x42')]);var _0x3aa2bc={'where':_0x5aeb3b[_0xc014('0x3d')]};return db[_0xc014('0x2e')][_0xc014('0x1f')](_0x3aa2bc)[_0xc014('0x25')](function(_0x84720d){_0x2b7379[_0xc014('0x1f')]=_0x84720d;if(_0x40fae2[_0xc014('0x34')]['includeAll']){_0x5aeb3b[_0xc014('0x43')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x5aeb3b);})[_0xc014('0x25')](function(_0x8da85e){_0x2b7379[_0xc014('0x44')]=_0x8da85e;return _0x2b7379;})[_0xc014('0x25')](respondWithFilteredResult(_0x2c041f,_0x5aeb3b))[_0xc014('0x45')](handleError(_0x2c041f,null));};exports['show']=function(_0x317897,_0x328956){var _0x501a3e={'raw':!![],'where':{'id':_0x317897[_0xc014('0x46')]['id']}},_0x1b145f={};_0x1b145f[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x2e')][_0xc014('0x2f')]);_0x1b145f[_0xc014('0x34')]=_[_0xc014('0x47')](_0x317897[_0xc014('0x34')]);_0x1b145f['filters']=_[_0xc014('0x36')](_0x1b145f[_0xc014('0x33')],_0x1b145f[_0xc014('0x34')]);_0x501a3e[_0xc014('0x37')]=_[_0xc014('0x36')](_0x1b145f[_0xc014('0x33')],qs[_0xc014('0x38')](_0x317897[_0xc014('0x34')][_0xc014('0x38')]));_0x501a3e['attributes']=_0x501a3e[_0xc014('0x37')]['length']?_0x501a3e['attributes']:_0x1b145f[_0xc014('0x33')];if(_0x317897['query'][_0xc014('0x48')]){_0x501a3e[_0xc014('0x43')]=[{'all':!![]}];}_0x501a3e=_['merge']({},_0x501a3e,_0x317897[_0xc014('0x42')]);return db[_0xc014('0x2e')][_0xc014('0x49')](_0x501a3e)[_0xc014('0x25')](handleEntityNotFound(_0x328956,null))[_0xc014('0x25')](respondWithResult(_0x328956,null))[_0xc014('0x45')](handleError(_0x328956,null));};exports['create']=function(_0x1b0738,_0x1d85d1){return db[_0xc014('0x2e')][_0xc014('0x4a')](_0x1b0738[_0xc014('0x4b')],{})[_0xc014('0x25')](function(_0x255a3b){var _0x14af79=_0x1b0738[_0xc014('0x4c')][_0xc014('0x27')]({'plain':!![]});if(!_0x14af79)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14af79[_0xc014('0x4d')]===_0xc014('0x4c')){var _0x2b60f8=_0x255a3b[_0xc014('0x27')]({'plain':!![]});var _0x53676a=_0xc014('0x28');return db[_0xc014('0x4e')][_0xc014('0x49')]({'where':{'name':_0x53676a,'userProfileId':_0x14af79[_0xc014('0x4f')]},'raw':!![]})[_0xc014('0x25')](function(_0x2dfb69){if(_0x2dfb69&&_0x2dfb69[_0xc014('0x50')]===0x0){return db[_0xc014('0x29')][_0xc014('0x4a')]({'name':_0x2b60f8[_0xc014('0x2c')],'resourceId':_0x2b60f8['id'],'type':_0x2dfb69[_0xc014('0x2c')],'sectionId':_0x2dfb69['id']},{})[_0xc014('0x25')](function(){return _0x255a3b;});}else{return _0x255a3b;}})[_0xc014('0x45')](function(_0xc58284){logger[_0xc014('0x2a')](_0xc014('0x51'),_0xc58284);throw _0xc58284;});}return _0x255a3b;})['then'](respondWithResult(_0x1d85d1,0xc9))[_0xc014('0x45')](handleError(_0x1d85d1,null));};exports['update']=function(_0x1a97a4,_0x4541ba){if(_0x1a97a4['body']['id']){delete _0x1a97a4[_0xc014('0x4b')]['id'];}return db[_0xc014('0x2e')]['find']({'where':{'id':_0x1a97a4['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x4541ba,null))[_0xc014('0x25')](saveUpdates(_0x1a97a4['body'],null))[_0xc014('0x25')](respondWithResult(_0x4541ba,null))['catch'](handleError(_0x4541ba,null));};exports[_0xc014('0x26')]=function(_0x22f6c2,_0xadc160){return db['SmsQueue'][_0xc014('0x49')]({'where':{'id':_0x22f6c2['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0xadc160,null))[_0xc014('0x25')](removeEntity(_0xadc160,null))['catch'](handleError(_0xadc160,null));};exports['describe']=function(_0x3dbfb,_0x153929){return db['SmsQueue'][_0xc014('0x52')]()['then'](respondWithResult(_0x153929,null))['catch'](handleError(_0x153929,null));};exports[_0xc014('0x53')]=function(_0x40b2a8,_0x1d0376,_0x224da8){var _0x4c9e8f={'raw':!![],'where':{}},_0x47fe6d={},_0x161aa8;return db[_0xc014('0x2e')][_0xc014('0x54')]({'where':{'id':_0x40b2a8[_0xc014('0x46')]['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x1d0376,null))[_0xc014('0x25')](function(_0x386ef9){if(_0x386ef9){_0x161aa8=_0x386ef9[_0xc014('0x27')]({'plain':!![]});_0x47fe6d[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x55')][_0xc014('0x2f')]);_0x47fe6d[_0xc014('0x34')]=_['keys'](_0x40b2a8[_0xc014('0x34')]);_0x47fe6d['filters']=_[_0xc014('0x36')](_0x47fe6d[_0xc014('0x33')],_0x47fe6d[_0xc014('0x34')]);_0x4c9e8f[_0xc014('0x37')]=_[_0xc014('0x36')](_0x47fe6d[_0xc014('0x33')],qs[_0xc014('0x38')](_0x40b2a8['query'][_0xc014('0x38')]));_0x4c9e8f[_0xc014('0x37')]=_0x4c9e8f[_0xc014('0x37')]['length']?_0x4c9e8f[_0xc014('0x37')]:_0x47fe6d[_0xc014('0x33')];if(!_0x40b2a8[_0xc014('0x34')][_0xc014('0x56')](_0xc014('0x3a'))){_0x4c9e8f[_0xc014('0x3b')]=qs[_0xc014('0x3b')](_0x40b2a8[_0xc014('0x34')][_0xc014('0x3b')]);_0x4c9e8f['offset']=qs[_0xc014('0x1d')](_0x40b2a8[_0xc014('0x34')][_0xc014('0x1d')]);}_0x4c9e8f['order']=qs[_0xc014('0x3c')](_0x40b2a8[_0xc014('0x34')][_0xc014('0x3c')]);_0x4c9e8f[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x40b2a8[_0xc014('0x34')],_0x47fe6d[_0xc014('0x35')]));_0x4c9e8f[_0xc014('0x3d')][_0xc014('0x57')]=_0x386ef9['id'];if(_0x40b2a8['query'][_0xc014('0x3f')]){_0x4c9e8f['where']=_['merge'](_0x4c9e8f[_0xc014('0x3d')],{'$or':_[_0xc014('0x2d')](_0x4c9e8f[_0xc014('0x37')],function(_0x422ab6){var _0x2e9a64={};_0x2e9a64[_0x422ab6]={'$like':'%'+_0x40b2a8[_0xc014('0x34')][_0xc014('0x3f')]+'%'};return _0x2e9a64;})});}_0x4c9e8f=_['merge']({},_0x4c9e8f,_0x40b2a8[_0xc014('0x42')]);return db['UserSmsQueue']['findAll'](_0x4c9e8f);}})[_0xc014('0x25')](function(_0x48cb9f){if(_0x48cb9f){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x48cb9f,_0xc014('0x58')),'role':_0xc014('0x59')},'attributes':['id',_0xc014('0x2c'),_0xc014('0x5a'),_0xc014('0x5b'),_0xc014('0x5c')]});}})[_0xc014('0x25')](function(_0x1fcd84){if(_0x1fcd84){return{'count':_0x1fcd84['count'],'rows':_[_0xc014('0x2d')](_0x1fcd84['rows'],function(_0x4b57f9){return{'membername':_0x4b57f9['name'],'UserId':_0x4b57f9['id'],'queue_name':_0x161aa8[_0xc014('0x2c')],'SmsQueueId':_0x161aa8['id'],'interface':util[_0xc014('0x5d')](_0xc014('0x5e'),_0xc014('0x5f'),_0x4b57f9[_0xc014('0x2c')]),'penalty':0x0,'paused':_0x4b57f9[_0xc014('0x5a')],'createdAt':_0x4b57f9[_0xc014('0x5c')],'updatedAt':_0x4b57f9[_0xc014('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d0376,_0x4c9e8f))[_0xc014('0x45')](handleError(_0x1d0376,null));};exports[_0xc014('0x60')]=function(_0x20e9e3,_0x56dad4,_0x594ec9){var _0x57b586={};var _0x1309ca={};var _0x591a17;var _0x1484f3;return db[_0xc014('0x2e')][_0xc014('0x54')]({'where':{'id':_0x20e9e3[_0xc014('0x46')]['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x56dad4,null))[_0xc014('0x25')](function(_0x1ac336){if(_0x1ac336){_0x591a17=_0x1ac336;_0x1309ca[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x61')][_0xc014('0x2f')]);_0x1309ca[_0xc014('0x34')]=_[_0xc014('0x47')](_0x20e9e3[_0xc014('0x34')]);_0x1309ca[_0xc014('0x35')]=_[_0xc014('0x36')](_0x1309ca[_0xc014('0x33')],_0x1309ca['query']);_0x57b586[_0xc014('0x37')]=_[_0xc014('0x36')](_0x1309ca[_0xc014('0x33')],qs[_0xc014('0x38')](_0x20e9e3[_0xc014('0x34')][_0xc014('0x38')]));_0x57b586[_0xc014('0x37')]=_0x57b586[_0xc014('0x37')]['length']?_0x57b586['attributes']:_0x1309ca['model'];_0x57b586[_0xc014('0x62')]=qs[_0xc014('0x3c')](_0x20e9e3[_0xc014('0x34')][_0xc014('0x3c')]);_0x57b586[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x20e9e3[_0xc014('0x34')],_0x1309ca[_0xc014('0x35')]));if(_0x20e9e3[_0xc014('0x34')][_0xc014('0x3f')]){_0x57b586[_0xc014('0x3d')]=_['merge'](_0x57b586[_0xc014('0x3d')],{'$or':_[_0xc014('0x2d')](_0x57b586[_0xc014('0x37')],function(_0x2cdefc){var _0xdf1e3b={};_0xdf1e3b[_0x2cdefc]={'$like':'%'+_0x20e9e3[_0xc014('0x34')][_0xc014('0x3f')]+'%'};return _0xdf1e3b;})});}_0x57b586=_[_0xc014('0x40')]({},_0x57b586,_0x20e9e3['options']);return _0x591a17[_0xc014('0x60')](_0x57b586);}})[_0xc014('0x25')](function(_0x19f271){if(_0x19f271){_0x1484f3=_0x19f271[_0xc014('0x39')];if(!_0x20e9e3[_0xc014('0x34')]['hasOwnProperty'](_0xc014('0x3a'))){_0x57b586[_0xc014('0x3b')]=qs['limit'](_0x20e9e3['query'][_0xc014('0x3b')]);_0x57b586[_0xc014('0x1d')]=qs['offset'](_0x20e9e3['query'][_0xc014('0x1d')]);}return _0x591a17[_0xc014('0x60')](_0x57b586);}})[_0xc014('0x25')](function(_0x5bbd6c){if(_0x5bbd6c){return _0x5bbd6c?{'count':_0x1484f3,'rows':_0x5bbd6c}:null;}})[_0xc014('0x25')](respondWithResult(_0x56dad4,null))[_0xc014('0x45')](handleError(_0x56dad4,null));};exports['addTeams']=function(_0x10c73f,_0x3cfc71,_0x3ac982){var _0x5a7ddb=_0x10c73f['body'][_0xc014('0x63')];return db[_0xc014('0x61')][_0xc014('0x64')]({'where':{'id':_0x5a7ddb},'attributes':['id'],'include':[{'model':db[_0xc014('0x65')],'as':_0xc014('0x66'),'attributes':['id',_0xc014('0x2c'),_0xc014('0x67'),_0xc014('0x68'),_0xc014('0x69')],'raw':!![]}]})[_0xc014('0x25')](function(_0x2ea7d6){if(_0x2ea7d6){var _0x209fbe=_[_0xc014('0x6a')](_0x2ea7d6,function(_0x1ff504){var _0x5748f7=_0x1ff504[_0xc014('0x27')]({'plain':!![]});return _0x5748f7['Agents'];});return db[_0xc014('0x2e')][_0xc014('0x49')]({'where':{'id':_0x10c73f[_0xc014('0x46')]['id']}})['then'](function(_0xc021c){return db[_0xc014('0x6b')][_0xc014('0x6c')](function(_0x3e7e69){return _0xc021c[_0xc014('0x6d')](_0x5a7ddb,{'transaction':_0x3e7e69})['then'](function(){return BPromise[_0xc014('0x6e')](_0x209fbe,function(_0x186d9b){return db[_0xc014('0x55')][_0xc014('0x6f')]({'where':{'UserId':_0x186d9b['id'],'SmsQueueId':_0x10c73f[_0xc014('0x46')]['id']},'transaction':_0x3e7e69});});})['then'](function(){_0x209fbe[_0xc014('0x70')](function(_0x4b1850){socket[_0xc014('0x71')]('userSmsQueue:save',{'UserId':_0x4b1850['id'],'SmsQueueId':_0xc021c['id']});});});});});}})[_0xc014('0x25')](respondWithStatusCode(_0x3cfc71,null))[_0xc014('0x45')](handleError(_0x3cfc71,null));};exports[_0xc014('0x72')]=function(_0x4c5e3e,_0x39dd7d,_0x4be189){return db['Team']['findAll']({'where':{'id':_0x4c5e3e[_0xc014('0x34')][_0xc014('0x63')]},'attributes':['id'],'include':[{'model':db[_0xc014('0x65')],'as':_0xc014('0x66'),'attributes':['id'],'raw':!![]}]})[_0xc014('0x25')](handleEntityNotFound(_0x39dd7d,null))['then'](function(_0x570a2e){var _0x5ca23c=_[_0xc014('0x2d')](_0x570a2e,'id');var _0x3e9132=[];var _0x966c27=[];var _0x57b349=squel[_0xc014('0x73')]();_0x57b349[_0xc014('0x74')]('tq.TeamId')[_0xc014('0x75')](_0xc014('0x76'),'tq')['join']('user_has_teams','ut',_0xc014('0x77'))[_0xc014('0x3d')]('SmsQueueId\x20=\x20?',_0x4c5e3e['params']['id']);for(var _0x4f6553=0x0;_0x4f6553<_0x570a2e[_0xc014('0x39')];_0x4f6553+=0x1){let _0x59a0ca=_0x570a2e[_0x4f6553];for(var _0x1b758a=0x0;_0x1b758a<_0x59a0ca['Agents'][_0xc014('0x39')];_0x1b758a+=0x1){let _0x5435d5=_0x59a0ca[_0xc014('0x66')][_0x1b758a];var _0x411c3f=_0x57b349['clone']();_0x411c3f[_0xc014('0x3d')]('ut.UserId\x20=\x20?',_0x5435d5['id']);_0x966c27[_0xc014('0x78')](db['sequelize'][_0xc014('0x34')](_0x411c3f[_0xc014('0x79')](),{'type':db[_0xc014('0x6b')][_0xc014('0x7a')][_0xc014('0x7b')]})[_0xc014('0x25')](function(_0x58d87a){if(_0x58d87a[_0xc014('0x39')]===0x1){return _0x5435d5['id'];}else{var _0x25b6ea=_[_0xc014('0x7c')](_[_0xc014('0x2d')](_0x58d87a,'TeamId'),function(_0x316811){return _[_0xc014('0x7d')](_0x5ca23c,_0x316811);});if(_0x25b6ea){return _0x5435d5['id'];}}}));}}return BPromise[_0xc014('0x7e')](_0x966c27)['then'](function(_0x434f25){_0x3e9132=_(_0x3e9132)['union'](_0x434f25)[_0xc014('0x7f')]()[_0xc014('0x80')]();return db[_0xc014('0x2e')]['find']({'where':{'id':_0x4c5e3e[_0xc014('0x46')]['id']}})[_0xc014('0x25')](function(_0x2482da){return db['sequelize'][_0xc014('0x6c')](function(_0x1f2983){return _0x2482da['removeTeams'](_0x4c5e3e[_0xc014('0x34')][_0xc014('0x63')],{'transaction':_0x1f2983})[_0xc014('0x25')](function(){if(!_[_0xc014('0x81')](_0x3e9132)){return _0x2482da[_0xc014('0x82')](_0x3e9132,{'transaction':_0x1f2983});}})['then'](function(){_0x3e9132['forEach'](function(_0x1b5cd5){socket[_0xc014('0x71')]('userSmsQueue:remove',{'UserId':_0x1b5cd5,'SmsQueueId':_0x2482da['id']});});});});});});})[_0xc014('0x25')](respondWithStatusCode(_0x39dd7d,null))[_0xc014('0x45')](handleError(_0x39dd7d,null));};exports[_0xc014('0x83')]=function(_0x2322f8,_0x424b91,_0x485a58){return db['SmsQueue']['find']({'where':{'id':_0x2322f8['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x424b91,null))[_0xc014('0x25')](function(_0x284868){if(_0x284868){return _0x284868[_0xc014('0x83')](_0x2322f8[_0xc014('0x4b')][_0xc014('0x63')],_[_0xc014('0x84')](_0x2322f8['body'],[_0xc014('0x63'),'id'])||{})[_0xc014('0x85')](function(_0x39e53e){for(var _0x35ed70=0x0;_0x35ed70<_0x2322f8['body']['ids'][_0xc014('0x39')];_0x35ed70+=0x1){socket[_0xc014('0x71')](_0xc014('0x86'),{'UserId':Number(_0x2322f8[_0xc014('0x4b')][_0xc014('0x63')][_0x35ed70]),'SmsQueueId':Number(_0x2322f8[_0xc014('0x46')]['id'])});}return _0x39e53e;});}})[_0xc014('0x25')](respondWithResult(_0x424b91,null))[_0xc014('0x45')](handleError(_0x424b91,null));};exports[_0xc014('0x82')]=function(_0xc9353f,_0x1f3243,_0x456879){return db['SmsQueue'][_0xc014('0x49')]({'where':{'id':_0xc9353f[_0xc014('0x46')]['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x1f3243,null))[_0xc014('0x25')](function(_0x63eb99){if(_0x63eb99){return _0x63eb99[_0xc014('0x82')](_0xc9353f[_0xc014('0x34')][_0xc014('0x63')])[_0xc014('0x25')](function(){if(_[_0xc014('0x87')](_0xc9353f['query'][_0xc014('0x63')])){for(var _0x16a22f=0x0;_0x16a22f<_0xc9353f['query'][_0xc014('0x63')][_0xc014('0x39')];_0x16a22f+=0x1){socket[_0xc014('0x71')](_0xc014('0x88'),{'UserId':Number(_0xc9353f[_0xc014('0x34')][_0xc014('0x63')][_0x16a22f]),'SmsQueueId':Number(_0xc9353f[_0xc014('0x46')]['id'])});}}else{socket['emit']('userSmsQueue:remove',{'UserId':Number(_0xc9353f[_0xc014('0x34')]['ids']),'SmsQueueId':Number(_0xc9353f[_0xc014('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x1f3243,null))['catch'](handleError(_0x1f3243,null));};exports[_0xc014('0x89')]=function(_0x26b22d,_0x5942fb,_0x2fbf5c){var _0x122eea={};var _0x323b31={};var _0x2bb4d3;var _0x1f7c22;return db[_0xc014('0x2e')][_0xc014('0x54')]({'where':{'id':_0x26b22d['params']['id']}})[_0xc014('0x25')](handleEntityNotFound(_0x5942fb,null))[_0xc014('0x25')](function(_0x3f231c){if(_0x3f231c){_0x2bb4d3=_0x3f231c;_0x323b31[_0xc014('0x33')]=_[_0xc014('0x47')](db[_0xc014('0x65')]['rawAttributes']);_0x323b31[_0xc014('0x34')]=_[_0xc014('0x47')](_0x26b22d[_0xc014('0x34')]);_0x323b31[_0xc014('0x35')]=_['intersection'](_0x323b31['model'],_0x323b31[_0xc014('0x34')]);_0x122eea[_0xc014('0x37')]=_[_0xc014('0x36')](_0x323b31[_0xc014('0x33')],qs[_0xc014('0x38')](_0x26b22d['query'][_0xc014('0x38')]));_0x122eea[_0xc014('0x37')]=_0x122eea[_0xc014('0x37')]['length']?_0x122eea[_0xc014('0x37')]:_0x323b31[_0xc014('0x33')];_0x122eea[_0xc014('0x62')]=qs[_0xc014('0x3c')](_0x26b22d[_0xc014('0x34')][_0xc014('0x3c')]);_0x122eea[_0xc014('0x3d')]=qs[_0xc014('0x35')](_[_0xc014('0x3e')](_0x26b22d[_0xc014('0x34')],_0x323b31[_0xc014('0x35')]));if(_0x26b22d[_0xc014('0x34')]['filter']){_0x122eea['where']=_[_0xc014('0x40')](_0x122eea[_0xc014('0x3d')],{'$or':_[_0xc014('0x2d')](_0x122eea[_0xc014('0x37')],function(_0x38e7a5){var _0x1b3d4a={};_0x1b3d4a[_0x38e7a5]={'$like':'%'+_0x26b22d[_0xc014('0x34')][_0xc014('0x3f')]+'%'};return _0x1b3d4a;})});}_0x122eea=_[_0xc014('0x40')]({},_0x122eea,_0x26b22d[_0xc014('0x42')]);return _0x2bb4d3[_0xc014('0x89')](_0x122eea);}})[_0xc014('0x25')](function(_0x418855){if(_0x418855){_0x1f7c22=_0x418855[_0xc014('0x39')];if(!_0x26b22d[_0xc014('0x34')]['hasOwnProperty'](_0xc014('0x3a'))){_0x122eea[_0xc014('0x3b')]=qs[_0xc014('0x3b')](_0x26b22d['query']['limit']);_0x122eea['offset']=qs[_0xc014('0x1d')](_0x26b22d['query'][_0xc014('0x1d')]);}return _0x2bb4d3[_0xc014('0x89')](_0x122eea);}})['then'](function(_0x322af8){if(_0x322af8){return _0x322af8?{'count':_0x1f7c22,'rows':_0x322af8}:null;}})[_0xc014('0x25')](respondWithResult(_0x5942fb,null))[_0xc014('0x45')](handleError(_0x5942fb,null));};
\ No newline at end of file
index abb879b..55cf380 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x707d=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x1732a4,_0x596d24){var _0x4687de=function(_0x363e01){while(--_0x363e01){_0x1732a4['push'](_0x1732a4['shift']());}};_0x4687de(++_0x596d24);}(_0x707d,0xfa));var _0xd707=function(_0x2ba59f,_0x529f75){_0x2ba59f=_0x2ba59f-0x0;var _0x18a3d7=_0x707d[_0x2ba59f];return _0x18a3d7;};'use strict';var EventEmitter=require(_0xd707('0x0'));var SmsQueue=require(_0xd707('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd707('0x2')](0x0);var events={'afterCreate':_0xd707('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x406eac){return function(_0x21a030,_0x2e11ca,_0x38f26c){SmsQueueEvents[_0xd707('0x4')](_0x406eac+':'+_0x21a030['id'],_0x21a030);SmsQueueEvents[_0xd707('0x4')](_0x406eac,_0x21a030);_0x38f26c(null);};}for(var e in events){if(events[_0xd707('0x5')](e)){var event=events[e];SmsQueue[_0xd707('0x6')](e,emitEvent(event));}}module[_0xd707('0x7')]=SmsQueueEvents;
\ No newline at end of file
+var _0x2522=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5d77cb,_0x27de2a){var _0x52b1f5=function(_0x4798b1){while(--_0x4798b1){_0x5d77cb['push'](_0x5d77cb['shift']());}};_0x52b1f5(++_0x27de2a);}(_0x2522,0x1e3));var _0x2252=function(_0x3de6d7,_0x5d02f2){_0x3de6d7=_0x3de6d7-0x0;var _0x230a9e=_0x2522[_0x3de6d7];return _0x230a9e;};'use strict';var EventEmitter=require(_0x2252('0x0'));var SmsQueue=require(_0x2252('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2252('0x2')](0x0);var events={'afterCreate':_0x2252('0x3'),'afterUpdate':_0x2252('0x4'),'afterDestroy':_0x2252('0x5')};function emitEvent(_0x46e49c){return function(_0x447525,_0x27fa38,_0x2facea){SmsQueueEvents[_0x2252('0x6')](_0x46e49c+':'+_0x447525['id'],_0x447525);SmsQueueEvents[_0x2252('0x6')](_0x46e49c,_0x447525);_0x2facea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x2252('0x7')](e,emitEvent(event));}}module[_0x2252('0x8')]=SmsQueueEvents;
\ No newline at end of file
index 7f31f27..d33eb9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ab9=['sms_queues','lodash','../../config/logger','api','moment','bluebird','exports','define','SmsQueue'];(function(_0x367e5b,_0x5721e4){var _0x4b909e=function(_0x22c6a4){while(--_0x22c6a4){_0x367e5b['push'](_0x367e5b['shift']());}};_0x4b909e(++_0x5721e4);}(_0x2ab9,0x64));var _0x92ab=function(_0x53cb13,_0x250d12){_0x53cb13=_0x53cb13-0x0;var _0x2c08ca=_0x2ab9[_0x53cb13];return _0x2c08ca;};'use strict';var _=require(_0x92ab('0x0'));var util=require('util');var logger=require(_0x92ab('0x1'))(_0x92ab('0x2'));var moment=require(_0x92ab('0x3'));var BPromise=require(_0x92ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x92ab('0x5')]=function(_0x1c2a15,_0x76b54f){return _0x1c2a15[_0x92ab('0x6')](_0x92ab('0x7'),attributes,{'tableName':_0x92ab('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce54=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xa74357,_0x50ce37){var _0x2ee075=function(_0x104061){while(--_0x104061){_0xa74357['push'](_0xa74357['shift']());}};_0x2ee075(++_0x50ce37);}(_0xce54,0x77));var _0x4ce5=function(_0x5e2bcd,_0x33f00e){_0x5e2bcd=_0x5e2bcd-0x0;var _0x1f4d06=_0xce54[_0x5e2bcd];return _0x1f4d06;};'use strict';var _=require(_0x4ce5('0x0'));var util=require(_0x4ce5('0x1'));var logger=require(_0x4ce5('0x2'))(_0x4ce5('0x3'));var moment=require('moment');var BPromise=require(_0x4ce5('0x4'));var rp=require(_0x4ce5('0x5'));var fs=require('fs');var path=require(_0x4ce5('0x6'));var rimraf=require(_0x4ce5('0x7'));var config=require(_0x4ce5('0x8'));var attributes=require('./smsQueue.attributes');module[_0x4ce5('0x9')]=function(_0x1595e8,_0x36d2d7){return _0x1595e8[_0x4ce5('0xa')](_0x4ce5('0xb'),attributes,{'tableName':_0x4ce5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f0cfc2e..ad45c99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc404=['message','result','GetSmsQueue','findAll','options','attributes','limit','include','map','model','raw','where','ShowSmsQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5a7521,_0x2d1d5e){var _0x3d6e6a=function(_0x1ea2b8){while(--_0x1ea2b8){_0x5a7521['push'](_0x5a7521['shift']());}};_0x3d6e6a(++_0x2d1d5e);}(_0xc404,0x1ee));var _0x4c40=function(_0x1dceff,_0x2737f6){_0x1dceff=_0x1dceff-0x0;var _0x4057da=_0xc404[_0x1dceff];return _0x4057da;};'use strict';var _=require(_0x4c40('0x0'));var util=require(_0x4c40('0x1'));var moment=require(_0x4c40('0x2'));var BPromise=require('bluebird');var rs=require(_0x4c40('0x3'));var fs=require('fs');var Redis=require(_0x4c40('0x4'));var db=require(_0x4c40('0x5'))['db'];var utils=require(_0x4c40('0x6'));var logger=require(_0x4c40('0x7'))(_0x4c40('0x8'));var config=require(_0x4c40('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4c40('0xa')]['http']({'port':0x232a});config['redis']=_[_0x4c40('0xb')](config[_0x4c40('0xc')],{'host':_0x4c40('0xd'),'port':0x18eb});var socket=require(_0x4c40('0xe'))(new Redis(config[_0x4c40('0xc')]));require(_0x4c40('0xf'))['register'](socket);function respondWithRpcPromise(_0x113aa9,_0x361340,_0x7866a8){return new BPromise(function(_0x162bc4,_0x42ab74){return client['request'](_0x113aa9,_0x7866a8)[_0x4c40('0x10')](function(_0x30f8e5){logger[_0x4c40('0x11')](_0x4c40('0x12'),_0x361340,_0x4c40('0x13'));logger[_0x4c40('0x14')](_0x4c40('0x15'),_0x361340,_0x4c40('0x13'),JSON[_0x4c40('0x16')](_0x30f8e5));if(_0x30f8e5['error']){if(_0x30f8e5[_0x4c40('0x17')]['code']===0x1f4){logger[_0x4c40('0x17')](_0x4c40('0x12'),_0x361340,_0x30f8e5['error'][_0x4c40('0x18')]);return _0x42ab74(_0x30f8e5[_0x4c40('0x17')][_0x4c40('0x18')]);}logger[_0x4c40('0x17')](_0x4c40('0x12'),_0x361340,_0x30f8e5[_0x4c40('0x17')]['message']);return _0x162bc4(_0x30f8e5[_0x4c40('0x17')][_0x4c40('0x18')]);}else{logger[_0x4c40('0x11')](_0x4c40('0x12'),_0x361340,_0x4c40('0x13'));_0x162bc4(_0x30f8e5[_0x4c40('0x19')][_0x4c40('0x18')]);}})['catch'](function(_0x3af627){logger[_0x4c40('0x17')](_0x4c40('0x12'),_0x361340,_0x3af627);_0x42ab74(_0x3af627);});});}exports[_0x4c40('0x1a')]=function(_0x29188b){var _0x1cd22b=this;return new Promise(function(_0x58aef4,_0x5097ec){return db['SmsQueue'][_0x4c40('0x1b')]({'raw':_0x29188b[_0x4c40('0x1c')]?_0x29188b[_0x4c40('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x29188b[_0x4c40('0x1c')]?_0x29188b[_0x4c40('0x1c')]['where']||null:null,'attributes':_0x29188b[_0x4c40('0x1c')]?_0x29188b['options'][_0x4c40('0x1d')]||null:null,'limit':_0x29188b['options']?_0x29188b[_0x4c40('0x1c')][_0x4c40('0x1e')]||null:null,'include':_0x29188b[_0x4c40('0x1c')]?_0x29188b[_0x4c40('0x1c')][_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x29188b[_0x4c40('0x1c')][_0x4c40('0x1f')],function(_0x4e0b73){return{'model':db[_0x4e0b73[_0x4c40('0x21')]],'as':_0x4e0b73['as'],'attributes':_0x4e0b73['attributes'],'include':_0x4e0b73[_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x4e0b73[_0x4c40('0x1f')],function(_0x46b095){return{'model':db[_0x46b095[_0x4c40('0x21')]],'as':_0x46b095['as'],'attributes':_0x46b095[_0x4c40('0x1d')],'include':_0x46b095['include']?_['map'](_0x46b095[_0x4c40('0x1f')],function(_0xf86af2){return{'model':db[_0xf86af2[_0x4c40('0x21')]],'as':_0xf86af2['as'],'attributes':_0xf86af2[_0x4c40('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19a9f9){logger['info'](_0x4c40('0x1a'),_0x29188b);logger[_0x4c40('0x14')](_0x4c40('0x1a'),_0x29188b,JSON[_0x4c40('0x16')](_0x19a9f9));_0x58aef4(_0x19a9f9);})['catch'](function(_0x3fc1d5){logger[_0x4c40('0x17')](_0x4c40('0x1a'),_0x3fc1d5[_0x4c40('0x18')],_0x29188b);_0x5097ec(_0x1cd22b[_0x4c40('0x17')](0x1f4,_0x3fc1d5[_0x4c40('0x18')]));});});};exports['ShowSmsQueue']=function(_0x3e54c4){var _0x862b01=this;return new Promise(function(_0x25f049,_0x6220d9){return db['SmsQueue']['find']({'raw':_0x3e54c4['options']?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x22')]===undefined?!![]:![]:!![],'where':_0x3e54c4[_0x4c40('0x1c')]?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x23')]||null:null,'attributes':_0x3e54c4[_0x4c40('0x1c')]?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x1d')]||null:null,'include':_0x3e54c4['options']?_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x3e54c4[_0x4c40('0x1c')][_0x4c40('0x1f')],function(_0x2ab95f){return{'model':db[_0x2ab95f[_0x4c40('0x21')]],'as':_0x2ab95f['as'],'attributes':_0x2ab95f[_0x4c40('0x1d')],'include':_0x2ab95f[_0x4c40('0x1f')]?_[_0x4c40('0x20')](_0x2ab95f[_0x4c40('0x1f')],function(_0x3c8311){return{'model':db[_0x3c8311['model']],'as':_0x3c8311['as'],'attributes':_0x3c8311[_0x4c40('0x1d')],'include':_0x3c8311['include']?_[_0x4c40('0x20')](_0x3c8311[_0x4c40('0x1f')],function(_0x512ef3){return{'model':db[_0x512ef3[_0x4c40('0x21')]],'as':_0x512ef3['as'],'attributes':_0x512ef3[_0x4c40('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4c40('0x10')](function(_0xbd71de){logger[_0x4c40('0x11')]('ShowSmsQueue',_0x3e54c4);logger[_0x4c40('0x14')](_0x4c40('0x24'),_0x3e54c4,JSON['stringify'](_0xbd71de));_0x25f049(_0xbd71de);})['catch'](function(_0xe55202){logger['error']('ShowSmsQueue',_0xe55202['message'],_0x3e54c4);_0x6220d9(_0x862b01[_0x4c40('0x17')](0x1f4,_0xe55202[_0x4c40('0x18')]));});});};
\ No newline at end of file
+var _0xb7f4=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','include','model','map','debug','raw','ShowSmsQueue','lodash','util','moment','bluebird'];(function(_0x37d4ac,_0x372800){var _0x3b8b45=function(_0x2d0d59){while(--_0x2d0d59){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x3b8b45(++_0x372800);}(_0xb7f4,0x164));var _0x4b7f=function(_0x324f45,_0x1f558a){_0x324f45=_0x324f45-0x0;var _0x2130ab=_0xb7f4[_0x324f45];return _0x2130ab;};'use strict';var _=require(_0x4b7f('0x0'));var util=require(_0x4b7f('0x1'));var moment=require(_0x4b7f('0x2'));var BPromise=require(_0x4b7f('0x3'));var rs=require(_0x4b7f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4b7f('0x5'));var logger=require(_0x4b7f('0x6'))(_0x4b7f('0x7'));var config=require(_0x4b7f('0x8'));var jayson=require(_0x4b7f('0x9'));var client=jayson['client'][_0x4b7f('0xa')]({'port':0x232a});config['redis']=_[_0x4b7f('0xb')](config[_0x4b7f('0xc')],{'host':_0x4b7f('0xd'),'port':0x18eb});var socket=require(_0x4b7f('0xe'))(new Redis(config[_0x4b7f('0xc')]));require('./smsQueue.socket')[_0x4b7f('0xf')](socket);function respondWithRpcPromise(_0x3242f2,_0x90921f,_0x5d9bcc){return new BPromise(function(_0x5bc9ad,_0x2969cf){return client[_0x4b7f('0x10')](_0x3242f2,_0x5d9bcc)[_0x4b7f('0x11')](function(_0x2883f4){logger[_0x4b7f('0x12')](_0x4b7f('0x13'),_0x90921f,_0x4b7f('0x14'));logger['debug'](_0x4b7f('0x15'),_0x90921f,_0x4b7f('0x14'),JSON[_0x4b7f('0x16')](_0x2883f4));if(_0x2883f4[_0x4b7f('0x17')]){if(_0x2883f4[_0x4b7f('0x17')][_0x4b7f('0x18')]===0x1f4){logger[_0x4b7f('0x17')]('SmsQueue,\x20%s,\x20%s',_0x90921f,_0x2883f4[_0x4b7f('0x17')][_0x4b7f('0x19')]);return _0x2969cf(_0x2883f4[_0x4b7f('0x17')][_0x4b7f('0x19')]);}logger[_0x4b7f('0x17')]('SmsQueue,\x20%s,\x20%s',_0x90921f,_0x2883f4['error']['message']);return _0x5bc9ad(_0x2883f4['error'][_0x4b7f('0x19')]);}else{logger[_0x4b7f('0x12')](_0x4b7f('0x13'),_0x90921f,_0x4b7f('0x14'));_0x5bc9ad(_0x2883f4[_0x4b7f('0x1a')]['message']);}})[_0x4b7f('0x1b')](function(_0x26ae41){logger[_0x4b7f('0x17')](_0x4b7f('0x13'),_0x90921f,_0x26ae41);_0x2969cf(_0x26ae41);});});}exports[_0x4b7f('0x1c')]=function(_0x5609b1){var _0x2be320=this;return new Promise(function(_0x1bed20,_0x32b8cc){return db[_0x4b7f('0x1d')][_0x4b7f('0x1e')]({'raw':_0x5609b1['options']?_0x5609b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1['options'][_0x4b7f('0x20')]||null:null,'attributes':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1[_0x4b7f('0x1f')][_0x4b7f('0x21')]||null:null,'limit':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1[_0x4b7f('0x1f')]['limit']||null:null,'include':_0x5609b1[_0x4b7f('0x1f')]?_0x5609b1['options'][_0x4b7f('0x22')]?_['map'](_0x5609b1[_0x4b7f('0x1f')]['include'],function(_0xe0eb09){return{'model':db[_0xe0eb09[_0x4b7f('0x23')]],'as':_0xe0eb09['as'],'attributes':_0xe0eb09['attributes'],'include':_0xe0eb09[_0x4b7f('0x22')]?_[_0x4b7f('0x24')](_0xe0eb09[_0x4b7f('0x22')],function(_0x41720e){return{'model':db[_0x41720e[_0x4b7f('0x23')]],'as':_0x41720e['as'],'attributes':_0x41720e[_0x4b7f('0x21')],'include':_0x41720e[_0x4b7f('0x22')]?_[_0x4b7f('0x24')](_0x41720e[_0x4b7f('0x22')],function(_0x1895fe){return{'model':db[_0x1895fe['model']],'as':_0x1895fe['as'],'attributes':_0x1895fe[_0x4b7f('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48333e){logger['info'](_0x4b7f('0x1c'),_0x5609b1);logger[_0x4b7f('0x25')](_0x4b7f('0x1c'),_0x5609b1,JSON[_0x4b7f('0x16')](_0x48333e));_0x1bed20(_0x48333e);})[_0x4b7f('0x1b')](function(_0x2282b1){logger[_0x4b7f('0x17')](_0x4b7f('0x1c'),_0x2282b1[_0x4b7f('0x19')],_0x5609b1);_0x32b8cc(_0x2be320[_0x4b7f('0x17')](0x1f4,_0x2282b1[_0x4b7f('0x19')]));});});};exports['ShowSmsQueue']=function(_0x275bc3){var _0x447507=this;return new Promise(function(_0x504e4a,_0x4e7aab){return db[_0x4b7f('0x1d')]['find']({'raw':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x26')]===undefined?!![]:![]:!![],'where':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x20')]||null:null,'attributes':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x21')]||null:null,'include':_0x275bc3[_0x4b7f('0x1f')]?_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x22')]?_['map'](_0x275bc3[_0x4b7f('0x1f')][_0x4b7f('0x22')],function(_0xb4adb5){return{'model':db[_0xb4adb5[_0x4b7f('0x23')]],'as':_0xb4adb5['as'],'attributes':_0xb4adb5[_0x4b7f('0x21')],'include':_0xb4adb5[_0x4b7f('0x22')]?_['map'](_0xb4adb5[_0x4b7f('0x22')],function(_0x258b52){return{'model':db[_0x258b52[_0x4b7f('0x23')]],'as':_0x258b52['as'],'attributes':_0x258b52['attributes'],'include':_0x258b52['include']?_[_0x4b7f('0x24')](_0x258b52[_0x4b7f('0x22')],function(_0x35f114){return{'model':db[_0x35f114[_0x4b7f('0x23')]],'as':_0x35f114['as'],'attributes':_0x35f114[_0x4b7f('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4b7f('0x11')](function(_0x3fc6bb){logger[_0x4b7f('0x12')]('ShowSmsQueue',_0x275bc3);logger[_0x4b7f('0x25')](_0x4b7f('0x27'),_0x275bc3,JSON['stringify'](_0x3fc6bb));_0x504e4a(_0x3fc6bb);})[_0x4b7f('0x1b')](function(_0x1fb449){logger[_0x4b7f('0x17')](_0x4b7f('0x27'),_0x1fb449[_0x4b7f('0x19')],_0x275bc3);_0x4e7aab(_0x447507[_0x4b7f('0x17')](0x1f4,_0x1fb449['message']));});});};
\ No newline at end of file
index 3cc1210..50f131d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe8c=['remove','update','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbe8c,0x7e));var _0xcbe8=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbe8c[_0x167cc1];return _0x10bc4b;};'use strict';var SmsQueueEvents=require(_0xcbe8('0x0'));var events=[_0xcbe8('0x1'),_0xcbe8('0x2'),_0xcbe8('0x3')];function createListener(_0xb1a270,_0x4e1e9f){return function(_0x9a6615){_0x4e1e9f['emit'](_0xb1a270,_0x9a6615);};}function removeListener(_0x2079c6,_0x57a790){return function(){SmsQueueEvents[_0xcbe8('0x4')](_0x2079c6,_0x57a790);};}exports[_0xcbe8('0x5')]=function(_0x441ee5){for(var _0x40864e=0x0,_0x5a28a0=events[_0xcbe8('0x6')];_0x40864e<_0x5a28a0;_0x40864e++){var _0x3dcb44=events[_0x40864e];var _0x54eb84=createListener(_0xcbe8('0x7')+_0x3dcb44,_0x441ee5);SmsQueueEvents['on'](_0x3dcb44,_0x54eb84);}};
\ No newline at end of file
+var _0xcb78=['removeListener','length','smsQueue:','save','remove','update'];(function(_0x18fae7,_0x1a9ef1){var _0x5e86e9=function(_0x3a519f){while(--_0x3a519f){_0x18fae7['push'](_0x18fae7['shift']());}};_0x5e86e9(++_0x1a9ef1);}(_0xcb78,0x1dd));var _0x8cb7=function(_0x406746,_0x39da38){_0x406746=_0x406746-0x0;var _0x877ba=_0xcb78[_0x406746];return _0x877ba;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x8cb7('0x0'),_0x8cb7('0x1'),_0x8cb7('0x2')];function createListener(_0x5979e1,_0x276493){return function(_0x1b516f){_0x276493['emit'](_0x5979e1,_0x1b516f);};}function removeListener(_0xdeacde,_0x12458f){return function(){SmsQueueEvents[_0x8cb7('0x3')](_0xdeacde,_0x12458f);};}exports['register']=function(_0x29e727){for(var _0x30b8e3=0x0,_0x28eee1=events[_0x8cb7('0x4')];_0x30b8e3<_0x28eee1;_0x30b8e3++){var _0x2a1f92=events[_0x30b8e3];var _0x476296=createListener(_0x8cb7('0x5')+_0x2a1f92,_0x29e727);SmsQueueEvents['on'](_0x2a1f92,_0x476296);}};
\ No newline at end of file
index 816de19..ec022c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43e8=['/describe','describe','show','post','create','put','/:id','update','delete','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x542bcd,_0x3ab9f2){var _0x2fba28=function(_0x23b419){while(--_0x23b419){_0x542bcd['push'](_0x542bcd['shift']());}};_0x2fba28(++_0x3ab9f2);}(_0x43e8,0x81));var _0x843e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x43e8[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x843e('0x0'));var util=require(_0x843e('0x1'));var path=require(_0x843e('0x2'));var timeout=require('connect-timeout');var express=require(_0x843e('0x3'));var router=express[_0x843e('0x4')]();var fs_extra=require(_0x843e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x843e('0x6'));var config=require(_0x843e('0x7'));var controller=require('./smsQueueReport.controller');router[_0x843e('0x8')]('/',auth[_0x843e('0x9')](),controller[_0x843e('0xa')]);router[_0x843e('0x8')](_0x843e('0xb'),auth[_0x843e('0x9')](),controller[_0x843e('0xc')]);router['get']('/:id',auth[_0x843e('0x9')](),controller[_0x843e('0xd')]);router[_0x843e('0xe')]('/',auth['isAuthenticated'](),controller[_0x843e('0xf')]);router[_0x843e('0x10')](_0x843e('0x11'),auth[_0x843e('0x9')](),controller[_0x843e('0x12')]);router[_0x843e('0x13')](_0x843e('0x11'),auth[_0x843e('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf77f=['describe','show','post','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe'];(function(_0x4ff40c,_0x50bddf){var _0x3074a3=function(_0x52d7c6){while(--_0x52d7c6){_0x4ff40c['push'](_0x4ff40c['shift']());}};_0x3074a3(++_0x50bddf);}(_0xf77f,0x134));var _0xff77=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xf77f[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0xff77('0x0'));var util=require('util');var path=require(_0xff77('0x1'));var timeout=require(_0xff77('0x2'));var express=require(_0xff77('0x3'));var router=express[_0xff77('0x4')]();var fs_extra=require(_0xff77('0x5'));var auth=require(_0xff77('0x6'));var interaction=require(_0xff77('0x7'));var config=require(_0xff77('0x8'));var controller=require('./smsQueueReport.controller');router[_0xff77('0x9')]('/',auth[_0xff77('0xa')](),controller['index']);router['get'](_0xff77('0xb'),auth[_0xff77('0xa')](),controller[_0xff77('0xc')]);router[_0xff77('0x9')]('/:id',auth[_0xff77('0xa')](),controller[_0xff77('0xd')]);router[_0xff77('0xe')]('/',auth[_0xff77('0xa')](),controller[_0xff77('0xf')]);router[_0xff77('0x10')](_0xff77('0x11'),auth['isAuthenticated'](),controller[_0xff77('0x12')]);router[_0xff77('0x13')](_0xff77('0x11'),auth[_0xff77('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index b44e54f..2884edd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x416d=['sequelize','STRING','DATE','moment'];(function(_0x276046,_0x45655f){var _0xa92e4c=function(_0x48b60e){while(--_0x48b60e){_0x276046['push'](_0x276046['shift']());}};_0xa92e4c(++_0x45655f);}(_0x416d,0x1b7));var _0xd416=function(_0x3b69e3,_0x40bb88){_0x3b69e3=_0x3b69e3-0x0;var _0x1f5b5e=_0x416d[_0x3b69e3];return _0x1f5b5e;};'use strict';var moment=require(_0xd416('0x0'));var Sequelize=require(_0xd416('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd416('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd416('0x2')]},'joinAt':{'type':Sequelize[_0xd416('0x3')]},'leaveAt':{'type':Sequelize[_0xd416('0x3')]},'acceptAt':{'type':Sequelize[_0xd416('0x3')]},'exitAt':{'type':Sequelize[_0xd416('0x3')]},'reason':{'type':Sequelize[_0xd416('0x2')]}};
\ No newline at end of file
+var _0x98af=['DATE','moment','exports','STRING'];(function(_0x127c7b,_0x1f65e7){var _0x1708eb=function(_0x2033e5){while(--_0x2033e5){_0x127c7b['push'](_0x127c7b['shift']());}};_0x1708eb(++_0x1f65e7);}(_0x98af,0x131));var _0xf98a=function(_0x503ea4,_0x562c0a){_0x503ea4=_0x503ea4-0x0;var _0x22f2fb=_0x98af[_0x503ea4];return _0x22f2fb;};'use strict';var moment=require(_0xf98a('0x0'));var Sequelize=require('sequelize');module[_0xf98a('0x1')]={'uniqueid':{'type':Sequelize[_0xf98a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf98a('0x2')]},'joinAt':{'type':Sequelize[_0xf98a('0x3')]},'leaveAt':{'type':Sequelize[_0xf98a('0x3')]},'acceptAt':{'type':Sequelize[_0xf98a('0x3')]},'exitAt':{'type':Sequelize[_0xf98a('0x3')]},'reason':{'type':Sequelize[_0xf98a('0x2')]}};
\ No newline at end of file
index b72890d..a6d0771 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bd8=['includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','apply','save','update','then','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','type','VIRTUAL','filter','merge','options'];(function(_0x36e10d,_0x21bef5){var _0xc713a2=function(_0x1661d1){while(--_0x1661d1){_0x36e10d['push'](_0x36e10d['shift']());}};_0xc713a2(++_0x21bef5);}(_0x0bd8,0xe0));var _0x80bd=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x0bd8[_0x1778e1];return _0x2bc4c6;};'use strict';var emlformat=require(_0x80bd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x80bd('0x1'));var rp=require(_0x80bd('0x2'));var moment=require(_0x80bd('0x3'));var BPromise=require(_0x80bd('0x4'));var Mustache=require('mustache');var util=require(_0x80bd('0x5'));var path=require(_0x80bd('0x6'));var sox=require('sox');var csv=require(_0x80bd('0x7'));var ejs=require(_0x80bd('0x8'));var fs=require('fs');var fs_extra=require(_0x80bd('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x80bd('0xa'));var jsforce=require(_0x80bd('0xb'));var deskjs=require(_0x80bd('0xc'));var toCsv=require(_0x80bd('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x80bd('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x80bd('0xe'));var as=require(_0x80bd('0xf'));var hardwareService=require(_0x80bd('0x10'));var logger=require(_0x80bd('0x11'))(_0x80bd('0x12'));var utils=require(_0x80bd('0x13'));var config=require(_0x80bd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x80bd('0x15'))['db'];function respondWithStatusCode(_0x54c335,_0x15175a){_0x15175a=_0x15175a||0xcc;return function(_0x363c21){if(_0x363c21){return _0x54c335[_0x80bd('0x16')](_0x15175a);}return _0x54c335[_0x80bd('0x17')](_0x15175a)[_0x80bd('0x18')]();};}function respondWithResult(_0x4aba69,_0x17470e){_0x17470e=_0x17470e||0xc8;return function(_0x27e8ef){if(_0x27e8ef){return _0x4aba69[_0x80bd('0x17')](_0x17470e)['json'](_0x27e8ef);}};}function respondWithFilteredResult(_0x2248fc,_0x1ce543){return function(_0x124166){if(_0x124166){var _0x102df9=typeof _0x1ce543[_0x80bd('0x19')]==='undefined'&&typeof _0x1ce543[_0x80bd('0x1a')]===_0x80bd('0x1b');var _0x3994c3=_0x124166[_0x80bd('0x1c')];var _0x3c34bf=_0x102df9?0x0:_0x1ce543[_0x80bd('0x19')];var _0x230711=_0x102df9?_0x124166[_0x80bd('0x1c')]:_0x1ce543[_0x80bd('0x19')]+_0x1ce543['limit'];var _0x1f26a2;if(_0x230711>=_0x3994c3){_0x230711=_0x3994c3;_0x1f26a2=0xc8;}else{_0x1f26a2=0xce;}_0x2248fc[_0x80bd('0x17')](_0x1f26a2);return _0x2248fc[_0x80bd('0x1d')]('Content-Range',_0x3c34bf+'-'+_0x230711+'/'+_0x3994c3)['json'](_0x124166);}return null;};}function patchUpdates(_0x17987b){return function(_0x535389){try{jsonpatch[_0x80bd('0x1e')](_0x535389,_0x17987b,!![]);}catch(_0x3955fe){return BPromise['reject'](_0x3955fe);}return _0x535389[_0x80bd('0x1f')]();};}function saveUpdates(_0x1bad33,_0x4627dd){return function(_0x1c8d5b){if(_0x1c8d5b){return _0x1c8d5b[_0x80bd('0x20')](_0x1bad33)[_0x80bd('0x21')](function(_0x44441e){return _0x44441e;});}return null;};}function removeEntity(_0x274cb9,_0x13b71d){return function(_0x91fc18){if(_0x91fc18){return _0x91fc18['destroy']()['then'](function(){_0x274cb9[_0x80bd('0x17')](0xcc)[_0x80bd('0x18')]();});}};}function handleEntityNotFound(_0xfdadb1,_0x2ff227){return function(_0x1746d7){if(!_0x1746d7){_0xfdadb1['sendStatus'](0x194);}return _0x1746d7;};}function handleError(_0x137b45,_0x53a354){_0x53a354=_0x53a354||0x1f4;return function(_0x343828){logger['error'](_0x343828[_0x80bd('0x22')]);if(_0x343828[_0x80bd('0x23')]){delete _0x343828[_0x80bd('0x23')];}_0x137b45[_0x80bd('0x17')](_0x53a354)[_0x80bd('0x24')](_0x343828);};}exports[_0x80bd('0x25')]=function(_0x4bc1fc,_0x10c56b){var _0x20eb41={},_0x569d3b={},_0x4ced77={'count':0x0,'rows':[]};var _0x5cef0f=_[_0x80bd('0x26')](db[_0x80bd('0x27')][_0x80bd('0x28')],function(_0x4a8088){return{'name':_0x4a8088['fieldName'],'type':_0x4a8088['type'][_0x80bd('0x29')]};});_0x569d3b[_0x80bd('0x2a')]=_[_0x80bd('0x26')](_0x5cef0f,'name');_0x569d3b[_0x80bd('0x2b')]=_[_0x80bd('0x2c')](_0x4bc1fc[_0x80bd('0x2b')]);_0x569d3b[_0x80bd('0x2d')]=_[_0x80bd('0x2e')](_0x569d3b['model'],_0x569d3b[_0x80bd('0x2b')]);_0x20eb41[_0x80bd('0x2f')]=_[_0x80bd('0x2e')](_0x569d3b[_0x80bd('0x2a')],qs[_0x80bd('0x30')](_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x30')]));_0x20eb41[_0x80bd('0x2f')]=_0x20eb41['attributes'][_0x80bd('0x31')]?_0x20eb41[_0x80bd('0x2f')]:_0x569d3b[_0x80bd('0x2a')];if(!_0x4bc1fc['query'][_0x80bd('0x32')](_0x80bd('0x33'))){_0x20eb41[_0x80bd('0x1a')]=qs[_0x80bd('0x1a')](_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x1a')]);_0x20eb41['offset']=qs['offset'](_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x19')]);}_0x20eb41[_0x80bd('0x34')]=qs['sort'](_0x4bc1fc[_0x80bd('0x2b')]['sort']);_0x20eb41[_0x80bd('0x35')]=qs['filters'](_[_0x80bd('0x36')](_0x4bc1fc[_0x80bd('0x2b')],_0x569d3b['filters']),_0x5cef0f);if(_0x4bc1fc[_0x80bd('0x2b')]['filter']){_0x20eb41[_0x80bd('0x35')]=_['merge'](_0x20eb41[_0x80bd('0x35')],{'$or':_['map'](_0x5cef0f,function(_0xd6c2f7){if(_0xd6c2f7[_0x80bd('0x37')]!==_0x80bd('0x38')){var _0x515c22={};_0x515c22[_0xd6c2f7[_0x80bd('0x23')]]={'$like':'%'+_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x39')]+'%'};return _0x515c22;}})});}_0x20eb41=_[_0x80bd('0x3a')]({},_0x20eb41,_0x4bc1fc[_0x80bd('0x3b')]);var _0x2f87f5={'where':_0x20eb41[_0x80bd('0x35')]};return db[_0x80bd('0x27')][_0x80bd('0x1c')](_0x2f87f5)[_0x80bd('0x21')](function(_0x280071){_0x4ced77['count']=_0x280071;if(_0x4bc1fc[_0x80bd('0x2b')][_0x80bd('0x3c')]){_0x20eb41['include']=[{'all':!![]}];}return db[_0x80bd('0x27')][_0x80bd('0x3d')](_0x20eb41);})[_0x80bd('0x21')](function(_0x3429ad){_0x4ced77[_0x80bd('0x3e')]=_0x3429ad;return _0x4ced77;})[_0x80bd('0x21')](respondWithFilteredResult(_0x10c56b,_0x20eb41))[_0x80bd('0x3f')](handleError(_0x10c56b,null));};exports[_0x80bd('0x40')]=function(_0x50ad68,_0x565318){var _0x1acb72={'raw':!![],'where':{'id':_0x50ad68[_0x80bd('0x41')]['id']}},_0x645b81={};_0x645b81[_0x80bd('0x2a')]=_[_0x80bd('0x2c')](db[_0x80bd('0x27')]['rawAttributes']);_0x645b81[_0x80bd('0x2b')]=_[_0x80bd('0x2c')](_0x50ad68[_0x80bd('0x2b')]);_0x645b81[_0x80bd('0x2d')]=_[_0x80bd('0x2e')](_0x645b81['model'],_0x645b81[_0x80bd('0x2b')]);_0x1acb72[_0x80bd('0x2f')]=_[_0x80bd('0x2e')](_0x645b81[_0x80bd('0x2a')],qs[_0x80bd('0x30')](_0x50ad68[_0x80bd('0x2b')][_0x80bd('0x30')]));_0x1acb72['attributes']=_0x1acb72[_0x80bd('0x2f')][_0x80bd('0x31')]?_0x1acb72[_0x80bd('0x2f')]:_0x645b81[_0x80bd('0x2a')];if(_0x50ad68['query'][_0x80bd('0x3c')]){_0x1acb72[_0x80bd('0x42')]=[{'all':!![]}];}_0x1acb72=_[_0x80bd('0x3a')]({},_0x1acb72,_0x50ad68['options']);return db[_0x80bd('0x27')][_0x80bd('0x43')](_0x1acb72)[_0x80bd('0x21')](handleEntityNotFound(_0x565318,null))['then'](respondWithResult(_0x565318,null))[_0x80bd('0x3f')](handleError(_0x565318,null));};exports[_0x80bd('0x44')]=function(_0x59d403,_0x4529ee){return db[_0x80bd('0x27')][_0x80bd('0x44')](_0x59d403[_0x80bd('0x45')],{})[_0x80bd('0x21')](respondWithResult(_0x4529ee,0xc9))[_0x80bd('0x3f')](handleError(_0x4529ee,null));};exports[_0x80bd('0x20')]=function(_0x58691a,_0x16fb62){if(_0x58691a[_0x80bd('0x45')]['id']){delete _0x58691a[_0x80bd('0x45')]['id'];}return db[_0x80bd('0x27')][_0x80bd('0x43')]({'where':{'id':_0x58691a[_0x80bd('0x41')]['id']}})[_0x80bd('0x21')](handleEntityNotFound(_0x16fb62,null))['then'](saveUpdates(_0x58691a[_0x80bd('0x45')],null))[_0x80bd('0x21')](respondWithResult(_0x16fb62,null))[_0x80bd('0x3f')](handleError(_0x16fb62,null));};exports['destroy']=function(_0x3b1b26,_0x9b8d20){return db[_0x80bd('0x27')][_0x80bd('0x43')]({'where':{'id':_0x3b1b26[_0x80bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x9b8d20,null))[_0x80bd('0x21')](removeEntity(_0x9b8d20,null))[_0x80bd('0x3f')](handleError(_0x9b8d20,null));};exports[_0x80bd('0x46')]=function(_0xd566be,_0x1acd9c){return db['SmsQueueReport']['describe']()['then'](respondWithResult(_0x1acd9c,null))[_0x80bd('0x3f')](handleError(_0x1acd9c,null));};
\ No newline at end of file
+var _0xcc2e=['SmsQueueReport','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map'];(function(_0x7dafb7,_0x88e2dc){var _0x17f97b=function(_0x55d3f2){while(--_0x55d3f2){_0x7dafb7['push'](_0x7dafb7['shift']());}};_0x17f97b(++_0x88e2dc);}(_0xcc2e,0x191));var _0xecc2=function(_0x51e171,_0x347d9a){_0x51e171=_0x51e171-0x0;var _0x314206=_0xcc2e[_0x51e171];return _0x314206;};'use strict';var emlformat=require(_0xecc2('0x0'));var rimraf=require(_0xecc2('0x1'));var zipdir=require(_0xecc2('0x2'));var jsonpatch=require(_0xecc2('0x3'));var rp=require(_0xecc2('0x4'));var moment=require(_0xecc2('0x5'));var BPromise=require(_0xecc2('0x6'));var Mustache=require(_0xecc2('0x7'));var util=require('util');var path=require(_0xecc2('0x8'));var sox=require(_0xecc2('0x9'));var csv=require(_0xecc2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecc2('0xb'));var _=require(_0xecc2('0xc'));var squel=require(_0xecc2('0xd'));var crypto=require(_0xecc2('0xe'));var jsforce=require(_0xecc2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xecc2('0x10'));var authService=require(_0xecc2('0x11'));var qs=require(_0xecc2('0x12'));var as=require(_0xecc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xecc2('0x14'));var utils=require(_0xecc2('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xecc2('0x16'))['db'];function respondWithStatusCode(_0x5ee0be,_0xaec417){_0xaec417=_0xaec417||0xcc;return function(_0x13b274){if(_0x13b274){return _0x5ee0be[_0xecc2('0x17')](_0xaec417);}return _0x5ee0be[_0xecc2('0x18')](_0xaec417)[_0xecc2('0x19')]();};}function respondWithResult(_0x5e04ce,_0x258b18){_0x258b18=_0x258b18||0xc8;return function(_0x356283){if(_0x356283){return _0x5e04ce['status'](_0x258b18)['json'](_0x356283);}};}function respondWithFilteredResult(_0x2f742b,_0x5e0424){return function(_0x3b4785){if(_0x3b4785){var _0x4fa84c=typeof _0x5e0424[_0xecc2('0x1a')]===_0xecc2('0x1b')&&typeof _0x5e0424[_0xecc2('0x1c')]===_0xecc2('0x1b');var _0x39e6c8=_0x3b4785[_0xecc2('0x1d')];var _0x1b1dad=_0x4fa84c?0x0:_0x5e0424[_0xecc2('0x1a')];var _0x2c6339=_0x4fa84c?_0x3b4785['count']:_0x5e0424[_0xecc2('0x1a')]+_0x5e0424[_0xecc2('0x1c')];var _0xc40767;if(_0x2c6339>=_0x39e6c8){_0x2c6339=_0x39e6c8;_0xc40767=0xc8;}else{_0xc40767=0xce;}_0x2f742b['status'](_0xc40767);return _0x2f742b[_0xecc2('0x1e')](_0xecc2('0x1f'),_0x1b1dad+'-'+_0x2c6339+'/'+_0x39e6c8)[_0xecc2('0x20')](_0x3b4785);}return null;};}function patchUpdates(_0x5ec22e){return function(_0x17ca2b){try{jsonpatch[_0xecc2('0x21')](_0x17ca2b,_0x5ec22e,!![]);}catch(_0x13cd0d){return BPromise[_0xecc2('0x22')](_0x13cd0d);}return _0x17ca2b['save']();};}function saveUpdates(_0x4bb5cf,_0x2e421f){return function(_0x266618){if(_0x266618){return _0x266618[_0xecc2('0x23')](_0x4bb5cf)[_0xecc2('0x24')](function(_0xfa0b65){return _0xfa0b65;});}return null;};}function removeEntity(_0x18eb6b,_0x5734e8){return function(_0x40d199){if(_0x40d199){return _0x40d199[_0xecc2('0x25')]()[_0xecc2('0x24')](function(){_0x18eb6b[_0xecc2('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e90a2,_0x5d8786){return function(_0x409c3b){if(!_0x409c3b){_0x2e90a2[_0xecc2('0x17')](0x194);}return _0x409c3b;};}function handleError(_0xe56acf,_0x2b4f3a){_0x2b4f3a=_0x2b4f3a||0x1f4;return function(_0x1a210f){logger[_0xecc2('0x26')](_0x1a210f['stack']);if(_0x1a210f[_0xecc2('0x27')]){delete _0x1a210f[_0xecc2('0x27')];}_0xe56acf[_0xecc2('0x18')](_0x2b4f3a)[_0xecc2('0x28')](_0x1a210f);};}exports[_0xecc2('0x29')]=function(_0x42e8e8,_0x748b51){var _0x710868={},_0x2c290c={},_0x5b7994={'count':0x0,'rows':[]};var _0x50ebd0=_[_0xecc2('0x2a')](db[_0xecc2('0x2b')]['rawAttributes'],function(_0x5a5508){return{'name':_0x5a5508[_0xecc2('0x2c')],'type':_0x5a5508[_0xecc2('0x2d')]['key']};});_0x2c290c['model']=_[_0xecc2('0x2a')](_0x50ebd0,'name');_0x2c290c['query']=_['keys'](_0x42e8e8[_0xecc2('0x2e')]);_0x2c290c[_0xecc2('0x2f')]=_[_0xecc2('0x30')](_0x2c290c[_0xecc2('0x31')],_0x2c290c['query']);_0x710868[_0xecc2('0x32')]=_[_0xecc2('0x30')](_0x2c290c['model'],qs[_0xecc2('0x33')](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x33')]));_0x710868['attributes']=_0x710868[_0xecc2('0x32')][_0xecc2('0x34')]?_0x710868[_0xecc2('0x32')]:_0x2c290c[_0xecc2('0x31')];if(!_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x35')](_0xecc2('0x36'))){_0x710868[_0xecc2('0x1c')]=qs[_0xecc2('0x1c')](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x1c')]);_0x710868[_0xecc2('0x1a')]=qs['offset'](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x1a')]);}_0x710868[_0xecc2('0x37')]=qs['sort'](_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x38')]);_0x710868[_0xecc2('0x39')]=qs[_0xecc2('0x2f')](_[_0xecc2('0x3a')](_0x42e8e8[_0xecc2('0x2e')],_0x2c290c[_0xecc2('0x2f')]),_0x50ebd0);if(_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x3b')]){_0x710868[_0xecc2('0x39')]=_[_0xecc2('0x3c')](_0x710868[_0xecc2('0x39')],{'$or':_[_0xecc2('0x2a')](_0x50ebd0,function(_0x5cb139){if(_0x5cb139['type']!==_0xecc2('0x3d')){var _0x2c676d={};_0x2c676d[_0x5cb139[_0xecc2('0x27')]]={'$like':'%'+_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x3b')]+'%'};return _0x2c676d;}})});}_0x710868=_[_0xecc2('0x3c')]({},_0x710868,_0x42e8e8[_0xecc2('0x3e')]);var _0x351414={'where':_0x710868['where']};return db[_0xecc2('0x2b')]['count'](_0x351414)[_0xecc2('0x24')](function(_0x5c4a8f){_0x5b7994['count']=_0x5c4a8f;if(_0x42e8e8[_0xecc2('0x2e')][_0xecc2('0x3f')]){_0x710868[_0xecc2('0x40')]=[{'all':!![]}];}return db[_0xecc2('0x2b')][_0xecc2('0x41')](_0x710868);})[_0xecc2('0x24')](function(_0x20503b){_0x5b7994[_0xecc2('0x42')]=_0x20503b;return _0x5b7994;})[_0xecc2('0x24')](respondWithFilteredResult(_0x748b51,_0x710868))[_0xecc2('0x43')](handleError(_0x748b51,null));};exports[_0xecc2('0x44')]=function(_0x87652c,_0x5365dd){var _0x4662be={'raw':!![],'where':{'id':_0x87652c[_0xecc2('0x45')]['id']}},_0xb1f1a3={};_0xb1f1a3[_0xecc2('0x31')]=_['keys'](db[_0xecc2('0x2b')][_0xecc2('0x46')]);_0xb1f1a3[_0xecc2('0x2e')]=_['keys'](_0x87652c[_0xecc2('0x2e')]);_0xb1f1a3['filters']=_['intersection'](_0xb1f1a3[_0xecc2('0x31')],_0xb1f1a3[_0xecc2('0x2e')]);_0x4662be[_0xecc2('0x32')]=_[_0xecc2('0x30')](_0xb1f1a3[_0xecc2('0x31')],qs[_0xecc2('0x33')](_0x87652c[_0xecc2('0x2e')][_0xecc2('0x33')]));_0x4662be[_0xecc2('0x32')]=_0x4662be[_0xecc2('0x32')][_0xecc2('0x34')]?_0x4662be['attributes']:_0xb1f1a3['model'];if(_0x87652c[_0xecc2('0x2e')]['includeAll']){_0x4662be[_0xecc2('0x40')]=[{'all':!![]}];}_0x4662be=_['merge']({},_0x4662be,_0x87652c[_0xecc2('0x3e')]);return db['SmsQueueReport'][_0xecc2('0x47')](_0x4662be)[_0xecc2('0x24')](handleEntityNotFound(_0x5365dd,null))['then'](respondWithResult(_0x5365dd,null))[_0xecc2('0x43')](handleError(_0x5365dd,null));};exports[_0xecc2('0x48')]=function(_0x29e273,_0x29f8ce){return db['SmsQueueReport'][_0xecc2('0x48')](_0x29e273['body'],{})[_0xecc2('0x24')](respondWithResult(_0x29f8ce,0xc9))[_0xecc2('0x43')](handleError(_0x29f8ce,null));};exports['update']=function(_0x328ac7,_0x2c8274){if(_0x328ac7[_0xecc2('0x49')]['id']){delete _0x328ac7[_0xecc2('0x49')]['id'];}return db['SmsQueueReport'][_0xecc2('0x47')]({'where':{'id':_0x328ac7['params']['id']}})[_0xecc2('0x24')](handleEntityNotFound(_0x2c8274,null))[_0xecc2('0x24')](saveUpdates(_0x328ac7[_0xecc2('0x49')],null))[_0xecc2('0x24')](respondWithResult(_0x2c8274,null))[_0xecc2('0x43')](handleError(_0x2c8274,null));};exports[_0xecc2('0x25')]=function(_0x1783d3,_0x37efe0){return db[_0xecc2('0x2b')][_0xecc2('0x47')]({'where':{'id':_0x1783d3[_0xecc2('0x45')]['id']}})[_0xecc2('0x24')](handleEntityNotFound(_0x37efe0,null))['then'](removeEntity(_0x37efe0,null))[_0xecc2('0x43')](handleError(_0x37efe0,null));};exports['describe']=function(_0x7bdcde,_0x4c7843){return db[_0xecc2('0x2b')]['describe']()['then'](respondWithResult(_0x4c7843,null))[_0xecc2('0x43')](handleError(_0x4c7843,null));};
\ No newline at end of file
index 6423d08..79fcf87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index f864ec8..cbd9967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e67=['SmsQueueReport','create','body','options','raw','then','CreateSmsQueueReport','stringify','UpdateSmsQueueReport','update','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x486e40,_0x1e58a0){var _0x48f516=function(_0x374993){while(--_0x374993){_0x486e40['push'](_0x486e40['shift']());}};_0x48f516(++_0x1e58a0);}(_0x9e67,0x1db));var _0x79e6=function(_0xe3ffe9,_0x86ddef){_0xe3ffe9=_0xe3ffe9-0x0;var _0x53c321=_0x9e67[_0xe3ffe9];return _0x53c321;};'use strict';var _=require(_0x79e6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x79e6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79e6('0x2'));var db=require(_0x79e6('0x3'))['db'];var utils=require(_0x79e6('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x79e6('0x5'));var jayson=require(_0x79e6('0x6'));var client=jayson[_0x79e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3777,_0xc08c3e,_0x3d10fe){return new BPromise(function(_0xa3977c,_0x921274){return client[_0x79e6('0x8')](_0x5f3777,_0x3d10fe)['then'](function(_0x400771){logger[_0x79e6('0x9')](_0x79e6('0xa'),_0xc08c3e,_0x79e6('0xb'));logger[_0x79e6('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0xc08c3e,_0x79e6('0xb'),JSON['stringify'](_0x400771));if(_0x400771[_0x79e6('0xd')]){if(_0x400771['error'][_0x79e6('0xe')]===0x1f4){logger['error'](_0x79e6('0xa'),_0xc08c3e,_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);return _0x921274(_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);}logger['error'](_0x79e6('0xa'),_0xc08c3e,_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);return _0xa3977c(_0x400771[_0x79e6('0xd')][_0x79e6('0xf')]);}else{logger[_0x79e6('0x9')](_0x79e6('0xa'),_0xc08c3e,_0x79e6('0xb'));_0xa3977c(_0x400771[_0x79e6('0x10')][_0x79e6('0xf')]);}})[_0x79e6('0x11')](function(_0x429626){logger[_0x79e6('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0xc08c3e,_0x429626);_0x921274(_0x429626);});});}exports['CreateSmsQueueReport']=function(_0x5dfc06){var _0x5b9014=this;return new Promise(function(_0x30f1e5,_0x347679){return db[_0x79e6('0x12')][_0x79e6('0x13')](_0x5dfc06[_0x79e6('0x14')],{'raw':_0x5dfc06[_0x79e6('0x15')]?_0x5dfc06[_0x79e6('0x15')][_0x79e6('0x16')]===undefined?!![]:![]:!![]})[_0x79e6('0x17')](function(_0x295169){logger['info'](_0x79e6('0x18'),_0x5dfc06);logger[_0x79e6('0xc')](_0x79e6('0x18'),_0x5dfc06,JSON[_0x79e6('0x19')](_0x295169));_0x30f1e5(_0x295169);})['catch'](function(_0x3e0eae){logger[_0x79e6('0xd')]('CreateSmsQueueReport',_0x3e0eae['message'],_0x5dfc06);_0x347679(_0x5b9014[_0x79e6('0xd')](0x1f4,_0x3e0eae[_0x79e6('0xf')]));});});};exports[_0x79e6('0x1a')]=function(_0x34492b){var _0x2d7107=this;return new Promise(function(_0x24ef74,_0x24f421){return db[_0x79e6('0x12')][_0x79e6('0x1b')](_0x34492b[_0x79e6('0x14')],{'raw':_0x34492b[_0x79e6('0x15')]?_0x34492b[_0x79e6('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34492b[_0x79e6('0x15')]?_0x34492b[_0x79e6('0x15')]['where']||null:null,'attributes':_0x34492b[_0x79e6('0x15')]?_0x34492b[_0x79e6('0x15')]['attributes']||null:null,'limit':_0x34492b['options']?_0x34492b[_0x79e6('0x15')][_0x79e6('0x1c')]||null:null})[_0x79e6('0x17')](function(_0x3f3b76){logger[_0x79e6('0x9')](_0x79e6('0x1a'),_0x34492b);logger[_0x79e6('0xc')](_0x79e6('0x1a'),_0x34492b,JSON[_0x79e6('0x19')](_0x3f3b76));_0x24ef74(_0x3f3b76);})[_0x79e6('0x11')](function(_0x1ec8e6){logger[_0x79e6('0xd')](_0x79e6('0x1a'),_0x1ec8e6['message'],_0x34492b);_0x24f421(_0x2d7107[_0x79e6('0xd')](0x1f4,_0x1ec8e6[_0x79e6('0xf')]));});});};
\ No newline at end of file
+var _0xaba4=['request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSmsQueueReport','create','options','raw','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsQueueReport,\x20%s,\x20%s'];(function(_0x66adbd,_0xa70710){var _0xcf294f=function(_0x58f374){while(--_0x58f374){_0x66adbd['push'](_0x66adbd['shift']());}};_0xcf294f(++_0xa70710);}(_0xaba4,0xc5));var _0x4aba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaba4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4aba('0x0'));var moment=require(_0x4aba('0x1'));var BPromise=require(_0x4aba('0x2'));var rs=require(_0x4aba('0x3'));var fs=require('fs');var Redis=require(_0x4aba('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4aba('0x5'))(_0x4aba('0x6'));var config=require('../../config/environment');var jayson=require(_0x4aba('0x7'));var client=jayson[_0x4aba('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5249b4,_0x232967,_0x935729){return new BPromise(function(_0x2bbe2a,_0x5af1b5){return client[_0x4aba('0x9')](_0x5249b4,_0x935729)[_0x4aba('0xa')](function(_0x12ea83){logger[_0x4aba('0xb')](_0x4aba('0xc'),_0x232967,_0x4aba('0xd'));logger[_0x4aba('0xe')](_0x4aba('0xf'),_0x232967,_0x4aba('0xd'),JSON['stringify'](_0x12ea83));if(_0x12ea83[_0x4aba('0x10')]){if(_0x12ea83[_0x4aba('0x10')][_0x4aba('0x11')]===0x1f4){logger[_0x4aba('0x10')](_0x4aba('0xc'),_0x232967,_0x12ea83['error'][_0x4aba('0x12')]);return _0x5af1b5(_0x12ea83[_0x4aba('0x10')][_0x4aba('0x12')]);}logger[_0x4aba('0x10')](_0x4aba('0xc'),_0x232967,_0x12ea83[_0x4aba('0x10')][_0x4aba('0x12')]);return _0x2bbe2a(_0x12ea83[_0x4aba('0x10')]['message']);}else{logger[_0x4aba('0xb')](_0x4aba('0xc'),_0x232967,'request\x20sent');_0x2bbe2a(_0x12ea83['result'][_0x4aba('0x12')]);}})[_0x4aba('0x13')](function(_0x107a24){logger[_0x4aba('0x10')](_0x4aba('0xc'),_0x232967,_0x107a24);_0x5af1b5(_0x107a24);});});}exports[_0x4aba('0x14')]=function(_0x3a43fe){var _0x36c45c=this;return new Promise(function(_0x26bcc4,_0x4e82fa){return db['SmsQueueReport'][_0x4aba('0x15')](_0x3a43fe['body'],{'raw':_0x3a43fe[_0x4aba('0x16')]?_0x3a43fe[_0x4aba('0x16')][_0x4aba('0x17')]===undefined?!![]:![]:!![]})[_0x4aba('0xa')](function(_0x433b9f){logger['info'](_0x4aba('0x14'),_0x3a43fe);logger[_0x4aba('0xe')](_0x4aba('0x14'),_0x3a43fe,JSON[_0x4aba('0x18')](_0x433b9f));_0x26bcc4(_0x433b9f);})[_0x4aba('0x13')](function(_0x3a597a){logger[_0x4aba('0x10')](_0x4aba('0x14'),_0x3a597a['message'],_0x3a43fe);_0x4e82fa(_0x36c45c[_0x4aba('0x10')](0x1f4,_0x3a597a['message']));});});};exports[_0x4aba('0x19')]=function(_0x40c352){var _0x1408da=this;return new Promise(function(_0x3120c3,_0x51a623){return db[_0x4aba('0x1a')][_0x4aba('0x1b')](_0x40c352['body'],{'raw':_0x40c352[_0x4aba('0x16')]?_0x40c352['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c352[_0x4aba('0x16')]?_0x40c352[_0x4aba('0x16')][_0x4aba('0x1c')]||null:null,'attributes':_0x40c352[_0x4aba('0x16')]?_0x40c352[_0x4aba('0x16')]['attributes']||null:null,'limit':_0x40c352[_0x4aba('0x16')]?_0x40c352[_0x4aba('0x16')][_0x4aba('0x1d')]||null:null})['then'](function(_0xf70f92){logger[_0x4aba('0xb')](_0x4aba('0x19'),_0x40c352);logger[_0x4aba('0xe')](_0x4aba('0x19'),_0x40c352,JSON[_0x4aba('0x18')](_0xf70f92));_0x3120c3(_0xf70f92);})['catch'](function(_0x58f108){logger[_0x4aba('0x10')](_0x4aba('0x19'),_0x58f108['message'],_0x40c352);_0x51a623(_0x1408da[_0x4aba('0x10')](0x1f4,_0x58f108['message']));});});};
\ No newline at end of file
index 92f4788..b68ab07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ad3=['isAuthenticated','index','describe','create','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0xf17ab9,_0x487d77){var _0x4d0bd8=function(_0x3b213a){while(--_0x3b213a){_0xf17ab9['push'](_0xf17ab9['shift']());}};_0x4d0bd8(++_0x487d77);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x5ad3[_0x585133];return _0x18254a;};'use strict';var multer=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var path=require(_0x35ad('0x2'));var timeout=require(_0x35ad('0x3'));var express=require('express');var router=express[_0x35ad('0x4')]();var fs_extra=require(_0x35ad('0x5'));var auth=require(_0x35ad('0x6'));var interaction=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var controller=require(_0x35ad('0x9'));router[_0x35ad('0xa')]('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xc')]);router[_0x35ad('0xa')]('/describe',auth[_0x35ad('0xb')](),controller[_0x35ad('0xd')]);router[_0x35ad('0xa')]('/:id',auth[_0x35ad('0xb')](),controller['show']);router['post']('/',auth[_0x35ad('0xb')](),controller[_0x35ad('0xe')]);router['put'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['update']);router['delete'](_0x35ad('0xf'),auth[_0x35ad('0xb')](),controller['destroy']);module[_0x35ad('0x10')]=router;
\ No newline at end of file
+var _0xb4c7=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x1f8a01,_0x4ac0b7){var _0x59346f=function(_0x53c828){while(--_0x53c828){_0x1f8a01['push'](_0x1f8a01['shift']());}};_0x59346f(++_0x4ac0b7);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x50918e,_0x2ef21d){_0x50918e=_0x50918e-0x0;var _0x194586=_0xb4c7[_0x50918e];return _0x194586;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get']('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xb')]);router[_0x7b4c('0xc')]('/describe',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xd')]);router['get'](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0xf')]);router[_0x7b4c('0x10')]('/',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x11')]);router[_0x7b4c('0x12')](_0x7b4c('0xe'),auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x13')]);router['delete']('/:id',auth[_0x7b4c('0xa')](),controller[_0x7b4c('0x14')]);module[_0x7b4c('0x15')]=router;
\ No newline at end of file
index f85075a..a389bdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xeb67cb,_0x3facda){var _0xc8fe96=function(_0x4074a2){while(--_0x4074a2){_0xeb67cb['push'](_0xeb67cb['shift']());}};_0xc8fe96(++_0x3facda);}(_0x54ef,0x112));var _0xf54e=function(_0x1c670a,_0x4d9930){_0x1c670a=_0x1c670a-0x0;var _0xf6cb06=_0x54ef[_0x1c670a];return _0xf6cb06;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3aad23,_0x37d3c1){var _0x3377cd=function(_0x552a1d){while(--_0x552a1d){_0x3aad23['push'](_0x3aad23['shift']());}};_0x3377cd(++_0x37d3c1);}(_0x70e0,0x17b));var _0x070e=function(_0x2898a6,_0x310f12){_0x2898a6=_0x2898a6-0x0;var _0x57563b=_0x70e0[_0x2898a6];return _0x57563b;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index e26c792..792e0c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b1c=['undefined','limit','count','json','apply','reject','save','then','destroy','end','error','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','sendStatus','status','offset'];(function(_0x281757,_0xbea91c){var _0x5a3214=function(_0x1e81e4){while(--_0x1e81e4){_0x281757['push'](_0x281757['shift']());}};_0x5a3214(++_0xbea91c);}(_0x1b1c,0xbd));var _0xc1b1=function(_0x1a9504,_0x3c5149){_0x1a9504=_0x1a9504-0x0;var _0x6a8ed4=_0x1b1c[_0x1a9504];return _0x6a8ed4;};'use strict';var emlformat=require(_0xc1b1('0x0'));var rimraf=require(_0xc1b1('0x1'));var zipdir=require(_0xc1b1('0x2'));var jsonpatch=require(_0xc1b1('0x3'));var rp=require(_0xc1b1('0x4'));var moment=require(_0xc1b1('0x5'));var BPromise=require(_0xc1b1('0x6'));var Mustache=require(_0xc1b1('0x7'));var util=require(_0xc1b1('0x8'));var path=require(_0xc1b1('0x9'));var sox=require(_0xc1b1('0xa'));var csv=require(_0xc1b1('0xb'));var ejs=require(_0xc1b1('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1b1('0xd'));var squel=require(_0xc1b1('0xe'));var crypto=require(_0xc1b1('0xf'));var jsforce=require(_0xc1b1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc1b1('0x11'));var Redis=require(_0xc1b1('0x12'));var authService=require(_0xc1b1('0x13'));var qs=require(_0xc1b1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc1b1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc1b1('0x16'));var db=require(_0xc1b1('0x17'))['db'];function respondWithStatusCode(_0x3fd85a,_0x141b15){_0x141b15=_0x141b15||0xcc;return function(_0x8c0dc0){if(_0x8c0dc0){return _0x3fd85a[_0xc1b1('0x18')](_0x141b15);}return _0x3fd85a['status'](_0x141b15)['end']();};}function respondWithResult(_0x5258de,_0x5a74ec){_0x5a74ec=_0x5a74ec||0xc8;return function(_0x4ef934){if(_0x4ef934){return _0x5258de[_0xc1b1('0x19')](_0x5a74ec)['json'](_0x4ef934);}};}function respondWithFilteredResult(_0x5d99bd,_0x36fc73){return function(_0x413bd9){if(_0x413bd9){var _0x134fc9=typeof _0x36fc73[_0xc1b1('0x1a')]===_0xc1b1('0x1b')&&typeof _0x36fc73[_0xc1b1('0x1c')]===_0xc1b1('0x1b');var _0xc5a66d=_0x413bd9[_0xc1b1('0x1d')];var _0x2c6a0f=_0x134fc9?0x0:_0x36fc73[_0xc1b1('0x1a')];var _0x12c5b2=_0x134fc9?_0x413bd9[_0xc1b1('0x1d')]:_0x36fc73['offset']+_0x36fc73[_0xc1b1('0x1c')];var _0x405ba1;if(_0x12c5b2>=_0xc5a66d){_0x12c5b2=_0xc5a66d;_0x405ba1=0xc8;}else{_0x405ba1=0xce;}_0x5d99bd[_0xc1b1('0x19')](_0x405ba1);return _0x5d99bd['set']('Content-Range',_0x2c6a0f+'-'+_0x12c5b2+'/'+_0xc5a66d)[_0xc1b1('0x1e')](_0x413bd9);}return null;};}function patchUpdates(_0x4750f7){return function(_0x3ab6bc){try{jsonpatch[_0xc1b1('0x1f')](_0x3ab6bc,_0x4750f7,!![]);}catch(_0x1d510f){return BPromise[_0xc1b1('0x20')](_0x1d510f);}return _0x3ab6bc[_0xc1b1('0x21')]();};}function saveUpdates(_0x1b1009,_0x5521e1){return function(_0x4291da){if(_0x4291da){return _0x4291da['update'](_0x1b1009)[_0xc1b1('0x22')](function(_0x57d0fc){return _0x57d0fc;});}return null;};}function removeEntity(_0x419670,_0x43056f){return function(_0x512fd5){if(_0x512fd5){return _0x512fd5[_0xc1b1('0x23')]()['then'](function(){_0x419670['status'](0xcc)[_0xc1b1('0x24')]();});}};}function handleEntityNotFound(_0x44e881,_0x2e6dda){return function(_0x345bcb){if(!_0x345bcb){_0x44e881[_0xc1b1('0x18')](0x194);}return _0x345bcb;};}function handleError(_0x98d092,_0x63e388){_0x63e388=_0x63e388||0x1f4;return function(_0x172267){logger[_0xc1b1('0x25')](_0x172267['stack']);if(_0x172267[_0xc1b1('0x26')]){delete _0x172267[_0xc1b1('0x26')];}_0x98d092['status'](_0x63e388)[_0xc1b1('0x27')](_0x172267);};}exports['index']=function(_0x53af8a,_0x2c280e){var _0x2dd4da={},_0x119c69={},_0x138939={'count':0x0,'rows':[]};var _0x36d594=_[_0xc1b1('0x28')](db[_0xc1b1('0x29')][_0xc1b1('0x2a')],function(_0x39c64a){return{'name':_0x39c64a[_0xc1b1('0x2b')],'type':_0x39c64a[_0xc1b1('0x2c')][_0xc1b1('0x2d')]};});_0x119c69[_0xc1b1('0x2e')]=_['map'](_0x36d594,_0xc1b1('0x26'));_0x119c69[_0xc1b1('0x2f')]=_[_0xc1b1('0x30')](_0x53af8a['query']);_0x119c69[_0xc1b1('0x31')]=_[_0xc1b1('0x32')](_0x119c69[_0xc1b1('0x2e')],_0x119c69[_0xc1b1('0x2f')]);_0x2dd4da[_0xc1b1('0x33')]=_['intersection'](_0x119c69[_0xc1b1('0x2e')],qs[_0xc1b1('0x34')](_0x53af8a[_0xc1b1('0x2f')]['fields']));_0x2dd4da[_0xc1b1('0x33')]=_0x2dd4da[_0xc1b1('0x33')][_0xc1b1('0x35')]?_0x2dd4da[_0xc1b1('0x33')]:_0x119c69[_0xc1b1('0x2e')];if(!_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x36')](_0xc1b1('0x37'))){_0x2dd4da[_0xc1b1('0x1c')]=qs[_0xc1b1('0x1c')](_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x1c')]);_0x2dd4da[_0xc1b1('0x1a')]=qs['offset'](_0x53af8a['query'][_0xc1b1('0x1a')]);}_0x2dd4da['order']=qs[_0xc1b1('0x38')](_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x38')]);_0x2dd4da[_0xc1b1('0x39')]=qs[_0xc1b1('0x31')](_[_0xc1b1('0x3a')](_0x53af8a[_0xc1b1('0x2f')],_0x119c69[_0xc1b1('0x31')]),_0x36d594);if(_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x3b')]){_0x2dd4da[_0xc1b1('0x39')]=_[_0xc1b1('0x3c')](_0x2dd4da['where'],{'$or':_['map'](_0x36d594,function(_0x231aa3){if(_0x231aa3[_0xc1b1('0x2c')]!==_0xc1b1('0x3d')){var _0x3bc46e={};_0x3bc46e[_0x231aa3[_0xc1b1('0x26')]]={'$like':'%'+_0x53af8a[_0xc1b1('0x2f')]['filter']+'%'};return _0x3bc46e;}})});}_0x2dd4da=_['merge']({},_0x2dd4da,_0x53af8a['options']);var _0x55d4c6={'where':_0x2dd4da[_0xc1b1('0x39')]};return db['SmsTransferReport'][_0xc1b1('0x1d')](_0x55d4c6)[_0xc1b1('0x22')](function(_0x1bf933){_0x138939[_0xc1b1('0x1d')]=_0x1bf933;if(_0x53af8a[_0xc1b1('0x2f')][_0xc1b1('0x3e')]){_0x2dd4da[_0xc1b1('0x3f')]=[{'all':!![]}];}return db[_0xc1b1('0x29')]['findAll'](_0x2dd4da);})[_0xc1b1('0x22')](function(_0x14a744){_0x138939[_0xc1b1('0x40')]=_0x14a744;return _0x138939;})['then'](respondWithFilteredResult(_0x2c280e,_0x2dd4da))[_0xc1b1('0x41')](handleError(_0x2c280e,null));};exports['show']=function(_0x27d16f,_0x44097e){var _0x427d70={'raw':!![],'where':{'id':_0x27d16f[_0xc1b1('0x42')]['id']}},_0x19df90={};_0x19df90[_0xc1b1('0x2e')]=_['keys'](db[_0xc1b1('0x29')][_0xc1b1('0x2a')]);_0x19df90['query']=_['keys'](_0x27d16f[_0xc1b1('0x2f')]);_0x19df90[_0xc1b1('0x31')]=_[_0xc1b1('0x32')](_0x19df90[_0xc1b1('0x2e')],_0x19df90[_0xc1b1('0x2f')]);_0x427d70[_0xc1b1('0x33')]=_['intersection'](_0x19df90[_0xc1b1('0x2e')],qs[_0xc1b1('0x34')](_0x27d16f[_0xc1b1('0x2f')][_0xc1b1('0x34')]));_0x427d70[_0xc1b1('0x33')]=_0x427d70[_0xc1b1('0x33')]['length']?_0x427d70[_0xc1b1('0x33')]:_0x19df90[_0xc1b1('0x2e')];if(_0x27d16f['query'][_0xc1b1('0x3e')]){_0x427d70[_0xc1b1('0x3f')]=[{'all':!![]}];}_0x427d70=_[_0xc1b1('0x3c')]({},_0x427d70,_0x27d16f[_0xc1b1('0x43')]);return db[_0xc1b1('0x29')][_0xc1b1('0x44')](_0x427d70)[_0xc1b1('0x22')](handleEntityNotFound(_0x44097e,null))['then'](respondWithResult(_0x44097e,null))['catch'](handleError(_0x44097e,null));};exports[_0xc1b1('0x45')]=function(_0x3e404a,_0x2a6a6f){return db[_0xc1b1('0x29')][_0xc1b1('0x45')](_0x3e404a[_0xc1b1('0x46')],{})[_0xc1b1('0x22')](respondWithResult(_0x2a6a6f,0xc9))[_0xc1b1('0x41')](handleError(_0x2a6a6f,null));};exports[_0xc1b1('0x47')]=function(_0x396699,_0x28345d){if(_0x396699[_0xc1b1('0x46')]['id']){delete _0x396699[_0xc1b1('0x46')]['id'];}return db['SmsTransferReport'][_0xc1b1('0x44')]({'where':{'id':_0x396699[_0xc1b1('0x42')]['id']}})[_0xc1b1('0x22')](handleEntityNotFound(_0x28345d,null))[_0xc1b1('0x22')](saveUpdates(_0x396699['body'],null))[_0xc1b1('0x22')](respondWithResult(_0x28345d,null))[_0xc1b1('0x41')](handleError(_0x28345d,null));};exports[_0xc1b1('0x23')]=function(_0x2bb3f2,_0x5398c6){return db['SmsTransferReport'][_0xc1b1('0x44')]({'where':{'id':_0x2bb3f2[_0xc1b1('0x42')]['id']}})[_0xc1b1('0x22')](handleEntityNotFound(_0x5398c6,null))[_0xc1b1('0x22')](removeEntity(_0x5398c6,null))[_0xc1b1('0x41')](handleError(_0x5398c6,null));};exports['describe']=function(_0x4e6275,_0x3bc487){return db[_0xc1b1('0x29')]['describe']()[_0xc1b1('0x22')](respondWithResult(_0x3bc487,null))['catch'](handleError(_0x3bc487,null));};
\ No newline at end of file
+var _0xc8cd=['fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','params','includeAll','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','reject','save','update','then','destroy','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection'];(function(_0x9cf14e,_0x57d04f){var _0x14877a=function(_0x35e94f){while(--_0x35e94f){_0x9cf14e['push'](_0x9cf14e['shift']());}};_0x14877a(++_0x57d04f);}(_0xc8cd,0x1cc));var _0xdc8c=function(_0x2830a1,_0x361c7e){_0x2830a1=_0x2830a1-0x0;var _0xf94d31=_0xc8cd[_0x2830a1];return _0xf94d31;};'use strict';var emlformat=require(_0xdc8c('0x0'));var rimraf=require(_0xdc8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc8c('0x2'));var moment=require(_0xdc8c('0x3'));var BPromise=require(_0xdc8c('0x4'));var Mustache=require('mustache');var util=require(_0xdc8c('0x5'));var path=require('path');var sox=require(_0xdc8c('0x6'));var csv=require(_0xdc8c('0x7'));var ejs=require(_0xdc8c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc8c('0x9'));var squel=require(_0xdc8c('0xa'));var crypto=require(_0xdc8c('0xb'));var jsforce=require(_0xdc8c('0xc'));var deskjs=require(_0xdc8c('0xd'));var toCsv=require(_0xdc8c('0x7'));var querystring=require(_0xdc8c('0xe'));var Papa=require(_0xdc8c('0xf'));var Redis=require(_0xdc8c('0x10'));var authService=require(_0xdc8c('0x11'));var qs=require(_0xdc8c('0x12'));var as=require(_0xdc8c('0x13'));var hardwareService=require(_0xdc8c('0x14'));var logger=require(_0xdc8c('0x15'))('api');var utils=require(_0xdc8c('0x16'));var config=require(_0xdc8c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdc8c('0x18'))['db'];function respondWithStatusCode(_0x2f4f11,_0x8e4ae4){_0x8e4ae4=_0x8e4ae4||0xcc;return function(_0x32a2d6){if(_0x32a2d6){return _0x2f4f11[_0xdc8c('0x19')](_0x8e4ae4);}return _0x2f4f11[_0xdc8c('0x1a')](_0x8e4ae4)[_0xdc8c('0x1b')]();};}function respondWithResult(_0x41e706,_0x45f689){_0x45f689=_0x45f689||0xc8;return function(_0x115c67){if(_0x115c67){return _0x41e706[_0xdc8c('0x1a')](_0x45f689)[_0xdc8c('0x1c')](_0x115c67);}};}function respondWithFilteredResult(_0x345fbd,_0x41502e){return function(_0x283ad7){if(_0x283ad7){var _0x404657=typeof _0x41502e['offset']===_0xdc8c('0x1d')&&typeof _0x41502e[_0xdc8c('0x1e')]===_0xdc8c('0x1d');var _0x56e0ef=_0x283ad7['count'];var _0x5177c8=_0x404657?0x0:_0x41502e[_0xdc8c('0x1f')];var _0x2f2492=_0x404657?_0x283ad7[_0xdc8c('0x20')]:_0x41502e[_0xdc8c('0x1f')]+_0x41502e[_0xdc8c('0x1e')];var _0x2de295;if(_0x2f2492>=_0x56e0ef){_0x2f2492=_0x56e0ef;_0x2de295=0xc8;}else{_0x2de295=0xce;}_0x345fbd[_0xdc8c('0x1a')](_0x2de295);return _0x345fbd[_0xdc8c('0x21')]('Content-Range',_0x5177c8+'-'+_0x2f2492+'/'+_0x56e0ef)[_0xdc8c('0x1c')](_0x283ad7);}return null;};}function patchUpdates(_0xa9d90e){return function(_0x38155a){try{jsonpatch['apply'](_0x38155a,_0xa9d90e,!![]);}catch(_0x4c6a18){return BPromise[_0xdc8c('0x22')](_0x4c6a18);}return _0x38155a[_0xdc8c('0x23')]();};}function saveUpdates(_0xc1a285,_0x5d3159){return function(_0xa54f2d){if(_0xa54f2d){return _0xa54f2d[_0xdc8c('0x24')](_0xc1a285)[_0xdc8c('0x25')](function(_0x33fa4a){return _0x33fa4a;});}return null;};}function removeEntity(_0x5a2cc3,_0x1ee0fe){return function(_0x431d07){if(_0x431d07){return _0x431d07[_0xdc8c('0x26')]()[_0xdc8c('0x25')](function(){_0x5a2cc3[_0xdc8c('0x1a')](0xcc)[_0xdc8c('0x1b')]();});}};}function handleEntityNotFound(_0xa7d346,_0x1dd393){return function(_0x31cc1a){if(!_0x31cc1a){_0xa7d346['sendStatus'](0x194);}return _0x31cc1a;};}function handleError(_0x1dc8f8,_0x288e76){_0x288e76=_0x288e76||0x1f4;return function(_0x1bc4c1){logger['error'](_0x1bc4c1[_0xdc8c('0x27')]);if(_0x1bc4c1[_0xdc8c('0x28')]){delete _0x1bc4c1[_0xdc8c('0x28')];}_0x1dc8f8[_0xdc8c('0x1a')](_0x288e76)['send'](_0x1bc4c1);};}exports[_0xdc8c('0x29')]=function(_0x2ba465,_0x274f72){var _0x2530f1={},_0x46b35e={},_0x2a52fa={'count':0x0,'rows':[]};var _0x5c8cdc=_[_0xdc8c('0x2a')](db[_0xdc8c('0x2b')][_0xdc8c('0x2c')],function(_0x448cc8){return{'name':_0x448cc8[_0xdc8c('0x2d')],'type':_0x448cc8['type'][_0xdc8c('0x2e')]};});_0x46b35e[_0xdc8c('0x2f')]=_[_0xdc8c('0x2a')](_0x5c8cdc,_0xdc8c('0x28'));_0x46b35e[_0xdc8c('0x30')]=_[_0xdc8c('0x31')](_0x2ba465['query']);_0x46b35e['filters']=_[_0xdc8c('0x32')](_0x46b35e[_0xdc8c('0x2f')],_0x46b35e[_0xdc8c('0x30')]);_0x2530f1['attributes']=_[_0xdc8c('0x32')](_0x46b35e[_0xdc8c('0x2f')],qs[_0xdc8c('0x33')](_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x33')]));_0x2530f1['attributes']=_0x2530f1[_0xdc8c('0x34')][_0xdc8c('0x35')]?_0x2530f1[_0xdc8c('0x34')]:_0x46b35e[_0xdc8c('0x2f')];if(!_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x36')](_0xdc8c('0x37'))){_0x2530f1['limit']=qs[_0xdc8c('0x1e')](_0x2ba465[_0xdc8c('0x30')]['limit']);_0x2530f1[_0xdc8c('0x1f')]=qs[_0xdc8c('0x1f')](_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x1f')]);}_0x2530f1[_0xdc8c('0x38')]=qs[_0xdc8c('0x39')](_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x39')]);_0x2530f1[_0xdc8c('0x3a')]=qs[_0xdc8c('0x3b')](_['pick'](_0x2ba465[_0xdc8c('0x30')],_0x46b35e['filters']),_0x5c8cdc);if(_0x2ba465[_0xdc8c('0x30')][_0xdc8c('0x3c')]){_0x2530f1[_0xdc8c('0x3a')]=_['merge'](_0x2530f1[_0xdc8c('0x3a')],{'$or':_[_0xdc8c('0x2a')](_0x5c8cdc,function(_0x1fa88a){if(_0x1fa88a['type']!=='VIRTUAL'){var _0x23005c={};_0x23005c[_0x1fa88a['name']]={'$like':'%'+_0x2ba465[_0xdc8c('0x30')]['filter']+'%'};return _0x23005c;}})});}_0x2530f1=_[_0xdc8c('0x3d')]({},_0x2530f1,_0x2ba465[_0xdc8c('0x3e')]);var _0x1a2104={'where':_0x2530f1[_0xdc8c('0x3a')]};return db[_0xdc8c('0x2b')]['count'](_0x1a2104)['then'](function(_0x34d949){_0x2a52fa['count']=_0x34d949;if(_0x2ba465['query']['includeAll']){_0x2530f1[_0xdc8c('0x3f')]=[{'all':!![]}];}return db[_0xdc8c('0x2b')][_0xdc8c('0x40')](_0x2530f1);})[_0xdc8c('0x25')](function(_0x3e88d1){_0x2a52fa[_0xdc8c('0x41')]=_0x3e88d1;return _0x2a52fa;})[_0xdc8c('0x25')](respondWithFilteredResult(_0x274f72,_0x2530f1))[_0xdc8c('0x42')](handleError(_0x274f72,null));};exports['show']=function(_0xd91225,_0x2834f0){var _0x17db1b={'raw':!![],'where':{'id':_0xd91225[_0xdc8c('0x43')]['id']}},_0x1dcdc5={};_0x1dcdc5[_0xdc8c('0x2f')]=_[_0xdc8c('0x31')](db[_0xdc8c('0x2b')][_0xdc8c('0x2c')]);_0x1dcdc5['query']=_[_0xdc8c('0x31')](_0xd91225['query']);_0x1dcdc5[_0xdc8c('0x3b')]=_['intersection'](_0x1dcdc5[_0xdc8c('0x2f')],_0x1dcdc5[_0xdc8c('0x30')]);_0x17db1b['attributes']=_[_0xdc8c('0x32')](_0x1dcdc5[_0xdc8c('0x2f')],qs[_0xdc8c('0x33')](_0xd91225[_0xdc8c('0x30')][_0xdc8c('0x33')]));_0x17db1b[_0xdc8c('0x34')]=_0x17db1b['attributes'][_0xdc8c('0x35')]?_0x17db1b[_0xdc8c('0x34')]:_0x1dcdc5['model'];if(_0xd91225['query'][_0xdc8c('0x44')]){_0x17db1b[_0xdc8c('0x3f')]=[{'all':!![]}];}_0x17db1b=_['merge']({},_0x17db1b,_0xd91225[_0xdc8c('0x3e')]);return db['SmsTransferReport']['find'](_0x17db1b)[_0xdc8c('0x25')](handleEntityNotFound(_0x2834f0,null))['then'](respondWithResult(_0x2834f0,null))[_0xdc8c('0x42')](handleError(_0x2834f0,null));};exports['create']=function(_0x7a248d,_0x304414){return db['SmsTransferReport'][_0xdc8c('0x45')](_0x7a248d['body'],{})[_0xdc8c('0x25')](respondWithResult(_0x304414,0xc9))[_0xdc8c('0x42')](handleError(_0x304414,null));};exports[_0xdc8c('0x24')]=function(_0x1cae97,_0x449f06){if(_0x1cae97[_0xdc8c('0x46')]['id']){delete _0x1cae97[_0xdc8c('0x46')]['id'];}return db[_0xdc8c('0x2b')]['find']({'where':{'id':_0x1cae97[_0xdc8c('0x43')]['id']}})[_0xdc8c('0x25')](handleEntityNotFound(_0x449f06,null))[_0xdc8c('0x25')](saveUpdates(_0x1cae97['body'],null))[_0xdc8c('0x25')](respondWithResult(_0x449f06,null))[_0xdc8c('0x42')](handleError(_0x449f06,null));};exports['destroy']=function(_0x9e99f8,_0x286590){return db[_0xdc8c('0x2b')][_0xdc8c('0x47')]({'where':{'id':_0x9e99f8[_0xdc8c('0x43')]['id']}})[_0xdc8c('0x25')](handleEntityNotFound(_0x286590,null))[_0xdc8c('0x25')](removeEntity(_0x286590,null))[_0xdc8c('0x42')](handleError(_0x286590,null));};exports[_0xdc8c('0x48')]=function(_0x484928,_0x21e314){return db[_0xdc8c('0x2b')]['describe']()['then'](respondWithResult(_0x21e314,null))[_0xdc8c('0x42')](handleError(_0x21e314,null));};
\ No newline at end of file
index 1f93d95..d08f377 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b68=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','report_sms_transfer','uniqueid','lodash','util'];(function(_0x39dc44,_0x3ef280){var _0x1e7404=function(_0x12121f){while(--_0x12121f){_0x39dc44['push'](_0x39dc44['shift']());}};_0x1e7404(++_0x3ef280);}(_0x4b68,0x129));var _0x84b6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x4b68[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x84b6('0x0'));var util=require(_0x84b6('0x1'));var logger=require(_0x84b6('0x2'))(_0x84b6('0x3'));var moment=require(_0x84b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x84b6('0x5'));var fs=require('fs');var path=require(_0x84b6('0x6'));var rimraf=require(_0x84b6('0x7'));var config=require(_0x84b6('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x84b6('0x9')]=function(_0x2a0007,_0x539956){return _0x2a0007[_0x84b6('0xa')]('SmsTransferReport',attributes,{'tableName':_0x84b6('0xb'),'paranoid':![],'indexes':[{'name':_0x84b6('0xc'),'fields':[_0x84b6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf987=['define','SmsTransferReport','report_sms_transfer','uniqueid','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports'];(function(_0x599d71,_0x86b3b7){var _0x582c85=function(_0x1b2206){while(--_0x1b2206){_0x599d71['push'](_0x599d71['shift']());}};_0x582c85(++_0x86b3b7);}(_0xf987,0x18a));var _0x7f98=function(_0x24bf0f,_0xf1d4ec){_0x24bf0f=_0x24bf0f-0x0;var _0x42ce95=_0xf987[_0x24bf0f];return _0x42ce95;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f98('0x0'))(_0x7f98('0x1'));var moment=require('moment');var BPromise=require(_0x7f98('0x2'));var rp=require(_0x7f98('0x3'));var fs=require('fs');var path=require(_0x7f98('0x4'));var rimraf=require(_0x7f98('0x5'));var config=require(_0x7f98('0x6'));var attributes=require(_0x7f98('0x7'));module[_0x7f98('0x8')]=function(_0x3b5abb,_0x3fb8e2){return _0x3b5abb[_0x7f98('0x9')](_0x7f98('0xa'),attributes,{'tableName':_0x7f98('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7f98('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0da7888..52f0b1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd13e=['SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x399381,_0x51ccc4){var _0x324d90=function(_0x4aba7d){while(--_0x4aba7d){_0x399381['push'](_0x399381['shift']());}};_0x324d90(++_0x51ccc4);}(_0xd13e,0x193));var _0xed13=function(_0x1773a6,_0x5252ec){_0x1773a6=_0x1773a6-0x0;var _0x5efa0f=_0xd13e[_0x1773a6];return _0x5efa0f;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});}
\ No newline at end of file
+var _0x6c84=['../../config/logger','jayson/promise','client','http','then','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x3a931c,_0x328d3d){var _0x38497d=function(_0x2c5524){while(--_0x2c5524){_0x3a931c['push'](_0x3a931c['shift']());}};_0x38497d(++_0x328d3d);}(_0x6c84,0x112));var _0x46c8=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x6c84[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var moment=require(_0x46c8('0x2'));var BPromise=require(_0x46c8('0x3'));var rs=require(_0x46c8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46c8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x46c8('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x46c8('0x7'));var client=jayson[_0x46c8('0x8')][_0x46c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d239a,_0x13bf93,_0x3c1e2a){return new BPromise(function(_0xfe26c8,_0x1727f4){return client['request'](_0x2d239a,_0x3c1e2a)[_0x46c8('0xa')](function(_0x561c61){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x13bf93,_0x46c8('0xb'));logger['debug'](_0x46c8('0xc'),_0x13bf93,_0x46c8('0xb'),JSON[_0x46c8('0xd')](_0x561c61));if(_0x561c61[_0x46c8('0xe')]){if(_0x561c61[_0x46c8('0xe')][_0x46c8('0xf')]===0x1f4){logger[_0x46c8('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x13bf93,_0x561c61['error']['message']);return _0x1727f4(_0x561c61[_0x46c8('0xe')]['message']);}logger[_0x46c8('0xe')](_0x46c8('0x10'),_0x13bf93,_0x561c61[_0x46c8('0xe')][_0x46c8('0x11')]);return _0xfe26c8(_0x561c61[_0x46c8('0xe')]['message']);}else{logger[_0x46c8('0x12')](_0x46c8('0x10'),_0x13bf93,'request\x20sent');_0xfe26c8(_0x561c61[_0x46c8('0x13')][_0x46c8('0x11')]);}})['catch'](function(_0x488eb5){logger[_0x46c8('0xe')](_0x46c8('0x10'),_0x13bf93,_0x488eb5);_0x1727f4(_0x488eb5);});});}
\ No newline at end of file
index 7fc37f7..5849bf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8e2=['../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','/:id','show','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','now','post','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x39c0df,_0x1c2556){var _0x1f216e=function(_0x59b89f){while(--_0x59b89f){_0x39c0df['push'](_0x39c0df['shift']());}};_0x1f216e(++_0x1c2556);}(_0xb8e2,0x9e));var _0x2b8e=function(_0x113a6c,_0x10df30){_0x113a6c=_0x113a6c-0x0;var _0x1ac632=_0xb8e2[_0x113a6c];return _0x1ac632;};'use strict';var multer=require(_0x2b8e('0x0'));var util=require(_0x2b8e('0x1'));var path=require(_0x2b8e('0x2'));var timeout=require(_0x2b8e('0x3'));var express=require(_0x2b8e('0x4'));var router=express[_0x2b8e('0x5')]();var fs_extra=require(_0x2b8e('0x6'));var auth=require(_0x2b8e('0x7'));var interaction=require(_0x2b8e('0x8'));var config=require('../../config/environment');var controller=require(_0x2b8e('0x9'));router[_0x2b8e('0xa')]('/',auth[_0x2b8e('0xb')](),controller['index']);router['get'](_0x2b8e('0xc'),auth[_0x2b8e('0xb')](),controller[_0x2b8e('0xd')]);router[_0x2b8e('0xa')]('/:id/download',auth[_0x2b8e('0xb')](),controller[_0x2b8e('0xe')]);var upload=multer({'storage':multer[_0x2b8e('0xf')]({'destination':function(_0x268166,_0x2aedf6,_0x45c98a){_0x45c98a(null,path[_0x2b8e('0x10')](config[_0x2b8e('0x11')],_0x2b8e('0x12')));},'filename':function(_0x33d31e,_0x4d4c76,_0x565ea6){_0x4d4c76[_0x2b8e('0x13')]=_0x4d4c76[_0x2b8e('0x13')][_0x2b8e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x565ea6(null,util[_0x2b8e('0x15')](_0x2b8e('0x16'),path[_0x2b8e('0x17')](_0x4d4c76[_0x2b8e('0x13')],path['extname'](_0x4d4c76[_0x2b8e('0x13')])),Date[_0x2b8e('0x18')](),path['extname'](_0x4d4c76['originalname'])));}})});router[_0x2b8e('0x19')]('/',upload[_0x2b8e('0x1a')](_0x2b8e('0x1b')),controller[_0x2b8e('0x1c')]);router[_0x2b8e('0x1d')](_0x2b8e('0xc'),auth['isAuthenticated'](),controller[_0x2b8e('0x1e')]);router[_0x2b8e('0x1f')](_0x2b8e('0xc'),auth[_0x2b8e('0xb')](),controller[_0x2b8e('0x1f')]);module[_0x2b8e('0x20')]=router;
\ No newline at end of file
+var _0x662a=['file','create','put','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single'];(function(_0x58c594,_0x2fb1f7){var _0x4b0096=function(_0xd27733){while(--_0xd27733){_0x58c594['push'](_0x58c594['shift']());}};_0x4b0096(++_0x2fb1f7);}(_0x662a,0x12e));var _0xa662=function(_0x4dcfd4,_0xc2f4c3){_0x4dcfd4=_0x4dcfd4-0x0;var _0x55a84e=_0x662a[_0x4dcfd4];return _0x55a84e;};'use strict';var multer=require(_0xa662('0x0'));var util=require(_0xa662('0x1'));var path=require(_0xa662('0x2'));var timeout=require(_0xa662('0x3'));var express=require(_0xa662('0x4'));var router=express['Router']();var fs_extra=require(_0xa662('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa662('0x6'));var config=require(_0xa662('0x7'));var controller=require('./sound.controller');router[_0xa662('0x8')]('/',auth[_0xa662('0x9')](),controller[_0xa662('0xa')]);router['get'](_0xa662('0xb'),auth[_0xa662('0x9')](),controller[_0xa662('0xc')]);router['get'](_0xa662('0xd'),auth[_0xa662('0x9')](),controller[_0xa662('0xe')]);var upload=multer({'storage':multer[_0xa662('0xf')]({'destination':function(_0x3e16eb,_0x3affc6,_0x5e77ec){_0x5e77ec(null,path[_0xa662('0x10')](config[_0xa662('0x11')],_0xa662('0x12')));},'filename':function(_0x1f9524,_0x45aa73,_0x5a859c){_0x45aa73[_0xa662('0x13')]=_0x45aa73[_0xa662('0x13')][_0xa662('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5a859c(null,util[_0xa662('0x15')](_0xa662('0x16'),path[_0xa662('0x17')](_0x45aa73[_0xa662('0x13')],path[_0xa662('0x18')](_0x45aa73[_0xa662('0x13')])),Date[_0xa662('0x19')](),path[_0xa662('0x18')](_0x45aa73[_0xa662('0x13')])));}})});router[_0xa662('0x1a')]('/',upload[_0xa662('0x1b')](_0xa662('0x1c')),controller[_0xa662('0x1d')]);router[_0xa662('0x1e')](_0xa662('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa662('0x1f')](_0xa662('0xb'),auth[_0xa662('0x9')](),controller['delete']);module[_0xa662('0x20')]=router;
\ No newline at end of file
index 868f248..d4770e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf37=['BIGINT','exports','STRING','name','FLOAT','INTEGER'];(function(_0x4d0698,_0x130f98){var _0x3c81ef=function(_0x2b3332){while(--_0x2b3332){_0x4d0698['push'](_0x4d0698['shift']());}};_0x3c81ef(++_0x130f98);}(_0xdf37,0xfd));var _0x7df3=function(_0x50dd33,_0x4c3ed9){_0x50dd33=_0x50dd33-0x0;var _0x31d32b=_0xdf37[_0x50dd33];return _0x31d32b;};'use strict';var Sequelize=require('sequelize');module[_0x7df3('0x0')]={'name':{'type':Sequelize[_0x7df3('0x1')],'unique':_0x7df3('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7df3('0x1')]},'display_name':{'type':Sequelize[_0x7df3('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x7df3('0x1')]},'original_format':{'type':Sequelize[_0x7df3('0x1')]},'original_duration':{'type':Sequelize[_0x7df3('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x7df3('0x4')]},'original_bitRate':{'type':Sequelize[_0x7df3('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x7df3('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x7df3('0x5')]},'converted_channelCount':{'type':Sequelize[_0x7df3('0x4')]},'converted_bitRate':{'type':Sequelize[_0x7df3('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x7df3('0x4')]}};
\ No newline at end of file
+var _0x0892=['INTEGER','sequelize','exports','name','STRING','BIGINT'];(function(_0x35f0d1,_0x45d762){var _0x56a167=function(_0x2223b9){while(--_0x2223b9){_0x35f0d1['push'](_0x35f0d1['shift']());}};_0x56a167(++_0x45d762);}(_0x0892,0x79));var _0x2089=function(_0x42e07b,_0x1ff692){_0x42e07b=_0x42e07b-0x0;var _0x159786=_0x0892[_0x42e07b];return _0x159786;};'use strict';var Sequelize=require(_0x2089('0x0'));module[_0x2089('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2089('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x2089('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x2089('0x3')]},'original_format':{'type':Sequelize[_0x2089('0x3')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x2089('0x4')]},'original_channelCount':{'type':Sequelize[_0x2089('0x5')]},'original_bitRate':{'type':Sequelize[_0x2089('0x4')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0x2089('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x2089('0x4')]},'converted_channelCount':{'type':Sequelize[_0x2089('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x2089('0x5')]}};
\ No newline at end of file
index eed747b..57d621d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f32=['zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','Sound','rows','catch','params','find','download','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','originalname','file','filename','extname','wav','server/files/sounds/original','basename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','unlinkSync','send','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','start','pick','description','original_format','eml-format','rimraf'];(function(_0x304207,_0x3ba39d){var _0x6b7cbf=function(_0x28e460){while(--_0x28e460){_0x304207['push'](_0x304207['shift']());}};_0x6b7cbf(++_0x3ba39d);}(_0x8f32,0xfa));var _0x28f3=function(_0x5c2b1e,_0x310ba2){_0x5c2b1e=_0x5c2b1e-0x0;var _0x5ea165=_0x8f32[_0x5c2b1e];return _0x5ea165;};'use strict';var emlformat=require(_0x28f3('0x0'));var rimraf=require(_0x28f3('0x1'));var zipdir=require(_0x28f3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x28f3('0x3'));var moment=require(_0x28f3('0x4'));var BPromise=require(_0x28f3('0x5'));var Mustache=require(_0x28f3('0x6'));var util=require(_0x28f3('0x7'));var path=require(_0x28f3('0x8'));var sox=require(_0x28f3('0x9'));var csv=require(_0x28f3('0xa'));var ejs=require(_0x28f3('0xb'));var fs=require('fs');var fs_extra=require(_0x28f3('0xc'));var _=require(_0x28f3('0xd'));var squel=require(_0x28f3('0xe'));var crypto=require(_0x28f3('0xf'));var jsforce=require(_0x28f3('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x28f3('0x11'));var Papa=require(_0x28f3('0x12'));var Redis=require(_0x28f3('0x13'));var authService=require(_0x28f3('0x14'));var qs=require(_0x28f3('0x15'));var as=require(_0x28f3('0x16'));var hardwareService=require(_0x28f3('0x17'));var logger=require(_0x28f3('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x28f3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x28f3('0x1a'))['db'];function respondWithStatusCode(_0x19e621,_0x48e172){_0x48e172=_0x48e172||0xcc;return function(_0x4ed6ea){if(_0x4ed6ea){return _0x19e621[_0x28f3('0x1b')](_0x48e172);}return _0x19e621[_0x28f3('0x1c')](_0x48e172)[_0x28f3('0x1d')]();};}function respondWithResult(_0x59c50c,_0x388a9f){_0x388a9f=_0x388a9f||0xc8;return function(_0x5735af){if(_0x5735af){return _0x59c50c[_0x28f3('0x1c')](_0x388a9f)[_0x28f3('0x1e')](_0x5735af);}};}function respondWithFilteredResult(_0x508b0a,_0x5649e8){return function(_0x2be275){if(_0x2be275){var _0x2399ea=typeof _0x5649e8[_0x28f3('0x1f')]===_0x28f3('0x20')&&typeof _0x5649e8['limit']==='undefined';var _0xe6574f=_0x2be275[_0x28f3('0x21')];var _0x5673b2=_0x2399ea?0x0:_0x5649e8[_0x28f3('0x1f')];var _0x118ad6=_0x2399ea?_0x2be275[_0x28f3('0x21')]:_0x5649e8['offset']+_0x5649e8[_0x28f3('0x22')];var _0x422d4b;if(_0x118ad6>=_0xe6574f){_0x118ad6=_0xe6574f;_0x422d4b=0xc8;}else{_0x422d4b=0xce;}_0x508b0a['status'](_0x422d4b);return _0x508b0a[_0x28f3('0x23')](_0x28f3('0x24'),_0x5673b2+'-'+_0x118ad6+'/'+_0xe6574f)[_0x28f3('0x1e')](_0x2be275);}return null;};}function patchUpdates(_0x160c25){return function(_0x377960){try{jsonpatch[_0x28f3('0x25')](_0x377960,_0x160c25,!![]);}catch(_0x4dce6f){return BPromise[_0x28f3('0x26')](_0x4dce6f);}return _0x377960['save']();};}function saveUpdates(_0x466d02,_0x23f4ef){return function(_0x45e3cc){if(_0x45e3cc){return _0x45e3cc[_0x28f3('0x27')](_0x466d02)[_0x28f3('0x28')](function(_0x189c76){return _0x189c76;});}return null;};}function removeEntity(_0x206bdb,_0x47969f){return function(_0x54302d){if(_0x54302d){return _0x54302d[_0x28f3('0x29')]()[_0x28f3('0x28')](function(){var _0x2fd26a=_0x54302d[_0x28f3('0x2a')]({'plain':!![]});var _0x2fd553=_0x28f3('0x2b');return db[_0x28f3('0x2c')][_0x28f3('0x29')]({'where':{'type':_0x2fd553,'resourceId':_0x2fd26a['id']}})[_0x28f3('0x28')](function(){return _0x54302d;});})[_0x28f3('0x28')](function(){_0x206bdb[_0x28f3('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x188bc0,_0x2dfab0){return function(_0x3d4662){if(!_0x3d4662){_0x188bc0[_0x28f3('0x1b')](0x194);}return _0x3d4662;};}function handleError(_0x3b788e,_0x5738a4){_0x5738a4=_0x5738a4||0x1f4;return function(_0x152f8b){logger[_0x28f3('0x2d')](_0x152f8b[_0x28f3('0x2e')]);if(_0x152f8b[_0x28f3('0x2f')]){delete _0x152f8b[_0x28f3('0x2f')];}_0x3b788e[_0x28f3('0x1c')](_0x5738a4)['send'](_0x152f8b);};}exports[_0x28f3('0x30')]=function(_0x3aa6b2,_0xb20a60){var _0x55f254={},_0x739b90={},_0x2a0a41={'count':0x0,'rows':[]};var _0x1c97b1=_[_0x28f3('0x31')](db['Sound'][_0x28f3('0x32')],function(_0x47c8d7){return{'name':_0x47c8d7['fieldName'],'type':_0x47c8d7[_0x28f3('0x33')][_0x28f3('0x34')]};});_0x739b90[_0x28f3('0x35')]=_['map'](_0x1c97b1,_0x28f3('0x2f'));_0x739b90[_0x28f3('0x36')]=_[_0x28f3('0x37')](_0x3aa6b2[_0x28f3('0x36')]);_0x739b90[_0x28f3('0x38')]=_[_0x28f3('0x39')](_0x739b90[_0x28f3('0x35')],_0x739b90['query']);_0x55f254[_0x28f3('0x3a')]=_[_0x28f3('0x39')](_0x739b90['model'],qs[_0x28f3('0x3b')](_0x3aa6b2['query'][_0x28f3('0x3b')]));_0x55f254['attributes']=_0x55f254[_0x28f3('0x3a')][_0x28f3('0x3c')]?_0x55f254[_0x28f3('0x3a')]:_0x739b90[_0x28f3('0x35')];if(!_0x3aa6b2['query'][_0x28f3('0x3d')]('nolimit')){_0x55f254['limit']=qs[_0x28f3('0x22')](_0x3aa6b2[_0x28f3('0x36')][_0x28f3('0x22')]);_0x55f254[_0x28f3('0x1f')]=qs[_0x28f3('0x1f')](_0x3aa6b2['query']['offset']);}_0x55f254[_0x28f3('0x3e')]=qs[_0x28f3('0x3f')](_0x3aa6b2[_0x28f3('0x36')][_0x28f3('0x3f')]);_0x55f254[_0x28f3('0x40')]=qs[_0x28f3('0x38')](_['pick'](_0x3aa6b2['query'],_0x739b90[_0x28f3('0x38')]),_0x1c97b1);if(_0x3aa6b2[_0x28f3('0x36')]['filter']){_0x55f254[_0x28f3('0x40')]=_[_0x28f3('0x41')](_0x55f254[_0x28f3('0x40')],{'$or':_[_0x28f3('0x31')](_0x1c97b1,function(_0x4c3421){if(_0x4c3421[_0x28f3('0x33')]!==_0x28f3('0x42')){var _0xd1be17={};_0xd1be17[_0x4c3421['name']]={'$like':'%'+_0x3aa6b2['query']['filter']+'%'};return _0xd1be17;}})});}_0x55f254=_[_0x28f3('0x41')]({},_0x55f254,_0x3aa6b2[_0x28f3('0x43')]);var _0x275be1={'where':_0x55f254['where']};return db['Sound'][_0x28f3('0x21')](_0x275be1)[_0x28f3('0x28')](function(_0x5a4942){_0x2a0a41[_0x28f3('0x21')]=_0x5a4942;if(_0x3aa6b2[_0x28f3('0x36')][_0x28f3('0x44')]){_0x55f254[_0x28f3('0x45')]=[{'all':!![]}];}return db[_0x28f3('0x46')]['findAll'](_0x55f254);})['then'](function(_0x480a9c){_0x2a0a41[_0x28f3('0x47')]=_0x480a9c;return _0x2a0a41;})['then'](respondWithFilteredResult(_0xb20a60,_0x55f254))[_0x28f3('0x48')](handleError(_0xb20a60,null));};exports['show']=function(_0x153275,_0x5268ee){var _0xc64a37={'raw':!![],'where':{'id':_0x153275[_0x28f3('0x49')]['id']}},_0x2be482={};_0x2be482[_0x28f3('0x35')]=_[_0x28f3('0x37')](db['Sound'][_0x28f3('0x32')]);_0x2be482['query']=_['keys'](_0x153275['query']);_0x2be482[_0x28f3('0x38')]=_['intersection'](_0x2be482[_0x28f3('0x35')],_0x2be482[_0x28f3('0x36')]);_0xc64a37[_0x28f3('0x3a')]=_[_0x28f3('0x39')](_0x2be482['model'],qs['fields'](_0x153275[_0x28f3('0x36')]['fields']));_0xc64a37['attributes']=_0xc64a37[_0x28f3('0x3a')]['length']?_0xc64a37['attributes']:_0x2be482['model'];if(_0x153275[_0x28f3('0x36')][_0x28f3('0x44')]){_0xc64a37['include']=[{'all':!![]}];}_0xc64a37=_[_0x28f3('0x41')]({},_0xc64a37,_0x153275['options']);return db[_0x28f3('0x46')][_0x28f3('0x4a')](_0xc64a37)[_0x28f3('0x28')](handleEntityNotFound(_0x5268ee,null))[_0x28f3('0x28')](respondWithResult(_0x5268ee,null))[_0x28f3('0x48')](handleError(_0x5268ee,null));};exports[_0x28f3('0x4b')]=function(_0x1d0265,_0x2ef0b0,_0x3b70f8){return db[_0x28f3('0x46')][_0x28f3('0x4a')]({'where':{'id':_0x1d0265['params']['id']},'attributes':[_0x28f3('0x2f'),'save_name',_0x28f3('0x4c')],'raw':!![]})[_0x28f3('0x28')](handleEntityNotFound(_0x2ef0b0,null))[_0x28f3('0x28')](function(_0x580fa3){if(_0x580fa3){if(!fs[_0x28f3('0x4d')](path[_0x28f3('0x4e')](config[_0x28f3('0x4f')],_0x28f3('0x50'),_0x580fa3[_0x28f3('0x51')]+'.'+_0x580fa3[_0x28f3('0x4c')]))){throw new db[(_0x28f3('0x52'))][(_0x28f3('0x53'))](_0x28f3('0x54'));}return _0x2ef0b0['download'](path[_0x28f3('0x4e')](config['root'],'server/files/sounds/converted',util[_0x28f3('0x55')]('%s.%s',_0x580fa3['save_name'],_0x580fa3[_0x28f3('0x4c')])),util['format'](_0x28f3('0x56'),_0x580fa3[_0x28f3('0x2f')],_0x580fa3[_0x28f3('0x4c')]));}return null;})[_0x28f3('0x48')](handleError(_0x2ef0b0,null));};exports['create']=function(_0x15ae27,_0x1522ef,_0xb41b2c){var _0x1268ad={'name':path['basename'](_0x15ae27['file'][_0x28f3('0x57')],path['extname'](_0x15ae27['file'][_0x28f3('0x57')])),'save_name':path['basename'](_0x15ae27[_0x28f3('0x58')][_0x28f3('0x59')],path[_0x28f3('0x5a')](_0x15ae27['file']['filename'])),'original_format':path[_0x28f3('0x5a')](_0x15ae27[_0x28f3('0x58')][_0x28f3('0x57')])['substring'](0x1),'converted_format':_0x28f3('0x5b')};var _0x1440c1=path['join'](config[_0x28f3('0x4f')],_0x28f3('0x5c'),_0x15ae27[_0x28f3('0x58')][_0x28f3('0x59')]);var _0x5932f3=path[_0x28f3('0x4e')](config[_0x28f3('0x4f')],_0x28f3('0x50'),util['format']('%s.%s',path[_0x28f3('0x5d')](_0x15ae27[_0x28f3('0x58')]['filename'],path[_0x28f3('0x5a')](_0x15ae27[_0x28f3('0x58')][_0x28f3('0x59')])),_0x1268ad[_0x28f3('0x4c')]));logger[_0x28f3('0x5e')]('Sound\x20upload\x20filepath:\x20%s',_0x1440c1);logger[_0x28f3('0x5e')](_0x28f3('0x5f'),_0x5932f3);try{fs[_0x28f3('0x60')](_0x1440c1,parseInt(_0x28f3('0x61'),0x8));var _0x85b0b4=sox['transcode'](_0x1440c1,_0x5932f3,{'sampleRate':0x1f40,'format':_0x28f3('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x85b0b4['on'](_0x28f3('0x2d'),function(_0x323cf8){fs[_0x28f3('0x62')](_0x1440c1);_0x1522ef[_0x28f3('0x1c')](0x1f4)[_0x28f3('0x63')](_0x323cf8);});_0x85b0b4['on'](_0x28f3('0x64'),function(_0xeb01c3){_0x1268ad[_0x28f3('0x65')]=isNaN(_0xeb01c3[_0x28f3('0x66')])?null:_0xeb01c3[_0x28f3('0x66')]*0x3e8;_0x1268ad['original_sampleCount']=isNaN(_0xeb01c3[_0x28f3('0x67')])?null:_0xeb01c3[_0x28f3('0x67')];_0x1268ad[_0x28f3('0x68')]=isNaN(_0xeb01c3['channelCount'])?null:_0xeb01c3[_0x28f3('0x69')];_0x1268ad['original_bitRate']=isNaN(_0xeb01c3[_0x28f3('0x6a')])?null:_0xeb01c3[_0x28f3('0x6a')];_0x1268ad['original_sampleRate']=isNaN(_0xeb01c3['sampleRate'])?null:_0xeb01c3[_0x28f3('0x6b')];});_0x85b0b4['on'](_0x28f3('0x6c'),function(_0x567f33){_0x1268ad[_0x28f3('0x6d')]=isNaN(_0x567f33['duration'])?null:_0x567f33[_0x28f3('0x66')]*0x3e8;_0x1268ad[_0x28f3('0x6e')]=isNaN(_0x567f33[_0x28f3('0x67')])?null:_0x567f33[_0x28f3('0x67')];_0x1268ad[_0x28f3('0x6f')]=isNaN(_0x567f33[_0x28f3('0x69')])?null:_0x567f33[_0x28f3('0x69')];_0x1268ad[_0x28f3('0x70')]=isNaN(_0x567f33['bitRate'])?null:_0x567f33['bitRate'];_0x1268ad[_0x28f3('0x71')]=isNaN(_0x567f33[_0x28f3('0x6b')])?null:_0x567f33[_0x28f3('0x6b')];});_0x85b0b4['on'](_0x28f3('0x1d'),function(){fs[_0x28f3('0x60')](_0x5932f3,parseInt(_0x28f3('0x61'),0x8));return db[_0x28f3('0x46')][_0x28f3('0x72')](_0x1268ad)[_0x28f3('0x28')](function(_0xbd142b){var _0xf3fe95={'role':_0x15ae27['body']['role'],'userProfileId':_0x15ae27[_0x28f3('0x73')][_0x28f3('0x74')]};if(!_0xf3fe95)throw new Error(_0x28f3('0x75'));if(_0xf3fe95[_0x28f3('0x76')]===_0x28f3('0x77')){var _0x3f47a8=_0xbd142b['get']({'plain':!![]});return db[_0x28f3('0x78')][_0x28f3('0x4a')]({'where':{'name':_0x28f3('0x2b'),'userProfileId':_0xf3fe95['userProfileId']},'raw':!![]})['then'](function(_0x4f9cd4){if(_0x4f9cd4&&_0x4f9cd4[_0x28f3('0x79')]===0x0){return db[_0x28f3('0x2c')]['create']({'name':_0x3f47a8[_0x28f3('0x2f')],'resourceId':_0x3f47a8['id'],'type':_0x4f9cd4[_0x28f3('0x2f')],'sectionId':_0x4f9cd4['id']},{})[_0x28f3('0x28')](function(){return _0xbd142b;});}else{return _0xbd142b;}})[_0x28f3('0x48')](function(_0x2af646){logger[_0x28f3('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2af646);throw _0x2af646;});}return _0xbd142b;})[_0x28f3('0x28')](respondWithResult(_0x1522ef,null))[_0x28f3('0x48')](handleError(_0x1522ef,null));});_0x85b0b4[_0x28f3('0x7a')]();}catch(_0x567ec0){_0x1522ef[_0x28f3('0x1c')](0x1f4)[_0x28f3('0x63')](_0x567ec0);}};exports['update']=function(_0x19971d,_0x4e8e1c,_0x15d173){return db[_0x28f3('0x46')]['find']({'where':{'id':_0x19971d[_0x28f3('0x49')]['id']}})[_0x28f3('0x28')](handleEntityNotFound(_0x4e8e1c,null))[_0x28f3('0x28')](saveUpdates(_[_0x28f3('0x7b')](_0x19971d[_0x28f3('0x73')],['name',_0x28f3('0x7c')]),null))[_0x28f3('0x28')](respondWithResult(_0x4e8e1c,null))[_0x28f3('0x48')](handleError(_0x4e8e1c,null));};exports['delete']=function(_0x55af59,_0x428fa9,_0x239155){return db[_0x28f3('0x46')][_0x28f3('0x4a')]({'where':{'id':_0x55af59[_0x28f3('0x49')]['id']}})[_0x28f3('0x28')](function(_0xdba4fb){if(_0xdba4fb){return _0xdba4fb[_0x28f3('0x29')]();}})[_0x28f3('0x28')](function(_0x173d91){var _0x2283c3=path[_0x28f3('0x4e')](config['root'],'server/files/sounds/original',util[_0x28f3('0x55')]('%s.%s',_0x173d91[_0x28f3('0x51')],_0x173d91[_0x28f3('0x7d')]));var _0x5f5518=path['join'](config[_0x28f3('0x4f')],_0x28f3('0x50'),util[_0x28f3('0x55')](_0x28f3('0x56'),_0x173d91[_0x28f3('0x51')],_0x173d91[_0x28f3('0x4c')]));fs[_0x28f3('0x62')](_0x2283c3);fs[_0x28f3('0x62')](_0x5f5518);return _0x173d91;})[_0x28f3('0x28')](function(_0x4e5e40){if(_0x4e5e40){return _0x428fa9[_0x28f3('0x1c')](0xcc)['end']();}})['then'](handleEntityNotFound(_0x428fa9,null))[_0x28f3('0x48')](handleError(_0x428fa9,null));};
\ No newline at end of file
+var _0x7612=['limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','map','Sound','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined'];(function(_0x4fc3d5,_0x546ee5){var _0x6e3676=function(_0x5a642a){while(--_0x5a642a){_0x4fc3d5['push'](_0x4fc3d5['shift']());}};_0x6e3676(++_0x546ee5);}(_0x7612,0x1ce));var _0x2761=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x7612[_0x1d9163];return _0xb42197;};'use strict';var emlformat=require(_0x2761('0x0'));var rimraf=require(_0x2761('0x1'));var zipdir=require(_0x2761('0x2'));var jsonpatch=require(_0x2761('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2761('0x4'));var Mustache=require('mustache');var util=require(_0x2761('0x5'));var path=require(_0x2761('0x6'));var sox=require('sox');var csv=require(_0x2761('0x7'));var ejs=require(_0x2761('0x8'));var fs=require('fs');var fs_extra=require(_0x2761('0x9'));var _=require(_0x2761('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2761('0xb'));var deskjs=require(_0x2761('0xc'));var toCsv=require(_0x2761('0x7'));var querystring=require('querystring');var Papa=require(_0x2761('0xd'));var Redis=require('ioredis');var authService=require(_0x2761('0xe'));var qs=require(_0x2761('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2761('0x10'));var logger=require(_0x2761('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x2761('0x12'));var licenseUtil=require(_0x2761('0x13'));var db=require(_0x2761('0x14'))['db'];function respondWithStatusCode(_0x30aed4,_0x2b87c2){_0x2b87c2=_0x2b87c2||0xcc;return function(_0x47a054){if(_0x47a054){return _0x30aed4['sendStatus'](_0x2b87c2);}return _0x30aed4[_0x2761('0x15')](_0x2b87c2)[_0x2761('0x16')]();};}function respondWithResult(_0x4cbc2b,_0x3b0382){_0x3b0382=_0x3b0382||0xc8;return function(_0x4d656e){if(_0x4d656e){return _0x4cbc2b[_0x2761('0x15')](_0x3b0382)[_0x2761('0x17')](_0x4d656e);}};}function respondWithFilteredResult(_0x564f01,_0x4ea379){return function(_0x509aa6){if(_0x509aa6){var _0x318cf9=typeof _0x4ea379[_0x2761('0x18')]===_0x2761('0x19')&&typeof _0x4ea379[_0x2761('0x1a')]===_0x2761('0x19');var _0x52fdd5=_0x509aa6[_0x2761('0x1b')];var _0x325d29=_0x318cf9?0x0:_0x4ea379['offset'];var _0xd5c5ad=_0x318cf9?_0x509aa6['count']:_0x4ea379[_0x2761('0x18')]+_0x4ea379[_0x2761('0x1a')];var _0x3337b1;if(_0xd5c5ad>=_0x52fdd5){_0xd5c5ad=_0x52fdd5;_0x3337b1=0xc8;}else{_0x3337b1=0xce;}_0x564f01[_0x2761('0x15')](_0x3337b1);return _0x564f01[_0x2761('0x1c')](_0x2761('0x1d'),_0x325d29+'-'+_0xd5c5ad+'/'+_0x52fdd5)['json'](_0x509aa6);}return null;};}function patchUpdates(_0x868fc8){return function(_0x2187de){try{jsonpatch[_0x2761('0x1e')](_0x2187de,_0x868fc8,!![]);}catch(_0x3bf5d7){return BPromise[_0x2761('0x1f')](_0x3bf5d7);}return _0x2187de['save']();};}function saveUpdates(_0x4e39b4,_0xb0dabe){return function(_0x5eb83b){if(_0x5eb83b){return _0x5eb83b[_0x2761('0x20')](_0x4e39b4)[_0x2761('0x21')](function(_0x3e9373){return _0x3e9373;});}return null;};}function removeEntity(_0x58bb71,_0x23f32d){return function(_0x176445){if(_0x176445){return _0x176445[_0x2761('0x22')]()[_0x2761('0x21')](function(){var _0x20e8e9=_0x176445[_0x2761('0x23')]({'plain':!![]});var _0x252157=_0x2761('0x24');return db[_0x2761('0x25')][_0x2761('0x22')]({'where':{'type':_0x252157,'resourceId':_0x20e8e9['id']}})[_0x2761('0x21')](function(){return _0x176445;});})[_0x2761('0x21')](function(){_0x58bb71['status'](0xcc)[_0x2761('0x16')]();});}};}function handleEntityNotFound(_0x3ff358,_0x36a03c){return function(_0x5d32c8){if(!_0x5d32c8){_0x3ff358[_0x2761('0x26')](0x194);}return _0x5d32c8;};}function handleError(_0x3b7ba4,_0x477b94){_0x477b94=_0x477b94||0x1f4;return function(_0x140383){logger[_0x2761('0x27')](_0x140383[_0x2761('0x28')]);if(_0x140383['name']){delete _0x140383[_0x2761('0x29')];}_0x3b7ba4[_0x2761('0x15')](_0x477b94)[_0x2761('0x2a')](_0x140383);};}exports['index']=function(_0x5bdb6f,_0x443831){var _0x583249={},_0x4d124={},_0x16ccc4={'count':0x0,'rows':[]};var _0x342b49=_[_0x2761('0x2b')](db[_0x2761('0x2c')][_0x2761('0x2d')],function(_0x1eb13f){return{'name':_0x1eb13f[_0x2761('0x2e')],'type':_0x1eb13f[_0x2761('0x2f')][_0x2761('0x30')]};});_0x4d124[_0x2761('0x31')]=_[_0x2761('0x2b')](_0x342b49,'name');_0x4d124[_0x2761('0x32')]=_['keys'](_0x5bdb6f[_0x2761('0x32')]);_0x4d124['filters']=_['intersection'](_0x4d124[_0x2761('0x31')],_0x4d124[_0x2761('0x32')]);_0x583249[_0x2761('0x33')]=_[_0x2761('0x34')](_0x4d124[_0x2761('0x31')],qs[_0x2761('0x35')](_0x5bdb6f['query'][_0x2761('0x35')]));_0x583249[_0x2761('0x33')]=_0x583249[_0x2761('0x33')]['length']?_0x583249[_0x2761('0x33')]:_0x4d124[_0x2761('0x31')];if(!_0x5bdb6f[_0x2761('0x32')][_0x2761('0x36')]('nolimit')){_0x583249[_0x2761('0x1a')]=qs[_0x2761('0x1a')](_0x5bdb6f[_0x2761('0x32')][_0x2761('0x1a')]);_0x583249[_0x2761('0x18')]=qs[_0x2761('0x18')](_0x5bdb6f['query'][_0x2761('0x18')]);}_0x583249[_0x2761('0x37')]=qs[_0x2761('0x38')](_0x5bdb6f['query'][_0x2761('0x38')]);_0x583249['where']=qs[_0x2761('0x39')](_[_0x2761('0x3a')](_0x5bdb6f[_0x2761('0x32')],_0x4d124[_0x2761('0x39')]),_0x342b49);if(_0x5bdb6f['query'][_0x2761('0x3b')]){_0x583249['where']=_[_0x2761('0x3c')](_0x583249[_0x2761('0x3d')],{'$or':_['map'](_0x342b49,function(_0x1978b9){if(_0x1978b9['type']!==_0x2761('0x3e')){var _0x156110={};_0x156110[_0x1978b9[_0x2761('0x29')]]={'$like':'%'+_0x5bdb6f['query'][_0x2761('0x3b')]+'%'};return _0x156110;}})});}_0x583249=_[_0x2761('0x3c')]({},_0x583249,_0x5bdb6f[_0x2761('0x3f')]);var _0x5007ed={'where':_0x583249[_0x2761('0x3d')]};return db[_0x2761('0x2c')][_0x2761('0x1b')](_0x5007ed)[_0x2761('0x21')](function(_0x36cdd9){_0x16ccc4['count']=_0x36cdd9;if(_0x5bdb6f['query'][_0x2761('0x40')]){_0x583249[_0x2761('0x41')]=[{'all':!![]}];}return db[_0x2761('0x2c')][_0x2761('0x42')](_0x583249);})[_0x2761('0x21')](function(_0x1bfa4d){_0x16ccc4[_0x2761('0x43')]=_0x1bfa4d;return _0x16ccc4;})['then'](respondWithFilteredResult(_0x443831,_0x583249))[_0x2761('0x44')](handleError(_0x443831,null));};exports[_0x2761('0x45')]=function(_0xfd8118,_0x3892ba){var _0x2f4599={'raw':!![],'where':{'id':_0xfd8118[_0x2761('0x46')]['id']}},_0x5e840e={};_0x5e840e[_0x2761('0x31')]=_[_0x2761('0x47')](db[_0x2761('0x2c')]['rawAttributes']);_0x5e840e['query']=_[_0x2761('0x47')](_0xfd8118['query']);_0x5e840e[_0x2761('0x39')]=_[_0x2761('0x34')](_0x5e840e[_0x2761('0x31')],_0x5e840e[_0x2761('0x32')]);_0x2f4599[_0x2761('0x33')]=_[_0x2761('0x34')](_0x5e840e[_0x2761('0x31')],qs[_0x2761('0x35')](_0xfd8118[_0x2761('0x32')][_0x2761('0x35')]));_0x2f4599[_0x2761('0x33')]=_0x2f4599[_0x2761('0x33')][_0x2761('0x48')]?_0x2f4599[_0x2761('0x33')]:_0x5e840e[_0x2761('0x31')];if(_0xfd8118[_0x2761('0x32')][_0x2761('0x40')]){_0x2f4599['include']=[{'all':!![]}];}_0x2f4599=_['merge']({},_0x2f4599,_0xfd8118[_0x2761('0x3f')]);return db['Sound'][_0x2761('0x49')](_0x2f4599)[_0x2761('0x21')](handleEntityNotFound(_0x3892ba,null))[_0x2761('0x21')](respondWithResult(_0x3892ba,null))[_0x2761('0x44')](handleError(_0x3892ba,null));};exports[_0x2761('0x4a')]=function(_0x4f8588,_0xc4b71a,_0x525454){return db[_0x2761('0x2c')][_0x2761('0x49')]({'where':{'id':_0x4f8588[_0x2761('0x46')]['id']},'attributes':[_0x2761('0x29'),_0x2761('0x4b'),_0x2761('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0xc4b71a,null))[_0x2761('0x21')](function(_0x21c5c6){if(_0x21c5c6){if(!fs['existsSync'](path[_0x2761('0x4d')](config[_0x2761('0x4e')],_0x2761('0x4f'),_0x21c5c6['save_name']+'.'+_0x21c5c6[_0x2761('0x4c')]))){throw new db[(_0x2761('0x50'))]['ValidationError'](_0x2761('0x51'));}return _0xc4b71a[_0x2761('0x4a')](path[_0x2761('0x4d')](config['root'],'server/files/sounds/converted',util[_0x2761('0x52')](_0x2761('0x53'),_0x21c5c6[_0x2761('0x4b')],_0x21c5c6[_0x2761('0x4c')])),util[_0x2761('0x52')]('%s.%s',_0x21c5c6[_0x2761('0x29')],_0x21c5c6[_0x2761('0x4c')]));}return null;})[_0x2761('0x44')](handleError(_0xc4b71a,null));};exports[_0x2761('0x54')]=function(_0x389073,_0x13ef79,_0x343dcc){var _0x400c74={'name':path[_0x2761('0x55')](_0x389073['file']['originalname'],path[_0x2761('0x56')](_0x389073[_0x2761('0x57')][_0x2761('0x58')])),'save_name':path[_0x2761('0x55')](_0x389073['file'][_0x2761('0x59')],path[_0x2761('0x56')](_0x389073['file'][_0x2761('0x59')])),'original_format':path[_0x2761('0x56')](_0x389073[_0x2761('0x57')][_0x2761('0x58')])[_0x2761('0x5a')](0x1),'converted_format':_0x2761('0x5b')};var _0x21272f=path['join'](config[_0x2761('0x4e')],_0x2761('0x5c'),_0x389073[_0x2761('0x57')][_0x2761('0x59')]);var _0x2c6262=path[_0x2761('0x4d')](config['root'],_0x2761('0x4f'),util[_0x2761('0x52')](_0x2761('0x53'),path['basename'](_0x389073[_0x2761('0x57')][_0x2761('0x59')],path['extname'](_0x389073[_0x2761('0x57')]['filename'])),_0x400c74[_0x2761('0x4c')]));logger[_0x2761('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0x21272f);logger[_0x2761('0x5d')](_0x2761('0x5e'),_0x2c6262);try{fs[_0x2761('0x5f')](_0x21272f,parseInt(_0x2761('0x60'),0x8));var _0x4825ae=sox[_0x2761('0x61')](_0x21272f,_0x2c6262,{'sampleRate':0x1f40,'format':_0x2761('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4825ae['on'](_0x2761('0x27'),function(_0x3a6d4d){fs[_0x2761('0x62')](_0x21272f);_0x13ef79[_0x2761('0x15')](0x1f4)['send'](_0x3a6d4d);});_0x4825ae['on']('src',function(_0x33ef8d){_0x400c74[_0x2761('0x63')]=isNaN(_0x33ef8d[_0x2761('0x64')])?null:_0x33ef8d[_0x2761('0x64')]*0x3e8;_0x400c74['original_sampleCount']=isNaN(_0x33ef8d[_0x2761('0x65')])?null:_0x33ef8d[_0x2761('0x65')];_0x400c74['original_channelCount']=isNaN(_0x33ef8d['channelCount'])?null:_0x33ef8d[_0x2761('0x66')];_0x400c74['original_bitRate']=isNaN(_0x33ef8d[_0x2761('0x67')])?null:_0x33ef8d['bitRate'];_0x400c74[_0x2761('0x68')]=isNaN(_0x33ef8d[_0x2761('0x69')])?null:_0x33ef8d[_0x2761('0x69')];});_0x4825ae['on'](_0x2761('0x6a'),function(_0x505415){_0x400c74[_0x2761('0x6b')]=isNaN(_0x505415[_0x2761('0x64')])?null:_0x505415['duration']*0x3e8;_0x400c74[_0x2761('0x6c')]=isNaN(_0x505415[_0x2761('0x65')])?null:_0x505415[_0x2761('0x65')];_0x400c74[_0x2761('0x6d')]=isNaN(_0x505415[_0x2761('0x66')])?null:_0x505415['channelCount'];_0x400c74[_0x2761('0x6e')]=isNaN(_0x505415[_0x2761('0x67')])?null:_0x505415[_0x2761('0x67')];_0x400c74[_0x2761('0x6f')]=isNaN(_0x505415[_0x2761('0x69')])?null:_0x505415['sampleRate'];});_0x4825ae['on'](_0x2761('0x16'),function(){fs[_0x2761('0x5f')](_0x2c6262,parseInt(_0x2761('0x60'),0x8));return db[_0x2761('0x2c')][_0x2761('0x54')](_0x400c74)[_0x2761('0x21')](function(_0x4f0442){var _0xe2d73e={'role':_0x389073['body'][_0x2761('0x70')],'userProfileId':_0x389073[_0x2761('0x71')][_0x2761('0x72')]};if(!_0xe2d73e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe2d73e[_0x2761('0x70')]===_0x2761('0x73')){var _0x5dd721=_0x4f0442[_0x2761('0x23')]({'plain':!![]});return db[_0x2761('0x74')][_0x2761('0x49')]({'where':{'name':_0x2761('0x24'),'userProfileId':_0xe2d73e[_0x2761('0x72')]},'raw':!![]})[_0x2761('0x21')](function(_0x341288){if(_0x341288&&_0x341288[_0x2761('0x75')]===0x0){return db[_0x2761('0x25')]['create']({'name':_0x5dd721['name'],'resourceId':_0x5dd721['id'],'type':_0x341288[_0x2761('0x29')],'sectionId':_0x341288['id']},{})[_0x2761('0x21')](function(){return _0x4f0442;});}else{return _0x4f0442;}})[_0x2761('0x44')](function(_0x3fbd1f){logger['error'](_0x2761('0x76'),_0x3fbd1f);throw _0x3fbd1f;});}return _0x4f0442;})[_0x2761('0x21')](respondWithResult(_0x13ef79,null))[_0x2761('0x44')](handleError(_0x13ef79,null));});_0x4825ae[_0x2761('0x77')]();}catch(_0x3c261d){_0x13ef79[_0x2761('0x15')](0x1f4)[_0x2761('0x2a')](_0x3c261d);}};exports['update']=function(_0x12bb36,_0x5e49e2,_0x5df222){return db[_0x2761('0x2c')][_0x2761('0x49')]({'where':{'id':_0x12bb36[_0x2761('0x46')]['id']}})[_0x2761('0x21')](handleEntityNotFound(_0x5e49e2,null))[_0x2761('0x21')](saveUpdates(_[_0x2761('0x3a')](_0x12bb36['body'],[_0x2761('0x29'),_0x2761('0x78')]),null))[_0x2761('0x21')](respondWithResult(_0x5e49e2,null))[_0x2761('0x44')](handleError(_0x5e49e2,null));};exports[_0x2761('0x79')]=function(_0x3a9b69,_0x1e6a1e,_0x32bfd2){return db[_0x2761('0x2c')]['find']({'where':{'id':_0x3a9b69['params']['id']}})[_0x2761('0x21')](function(_0x1241ae){if(_0x1241ae){return _0x1241ae['destroy']();}})[_0x2761('0x21')](function(_0x8ffaaa){var _0x3b480c=path[_0x2761('0x4d')](config[_0x2761('0x4e')],_0x2761('0x5c'),util['format']('%s.%s',_0x8ffaaa['save_name'],_0x8ffaaa['original_format']));var _0x4f91d6=path[_0x2761('0x4d')](config[_0x2761('0x4e')],_0x2761('0x4f'),util[_0x2761('0x52')]('%s.%s',_0x8ffaaa['save_name'],_0x8ffaaa[_0x2761('0x4c')]));fs['unlinkSync'](_0x3b480c);fs['unlinkSync'](_0x4f91d6);return _0x8ffaaa;})[_0x2761('0x21')](function(_0x3bef5a){if(_0x3bef5a){return _0x1e6a1e['status'](0xcc)[_0x2761('0x16')]();}})[_0x2761('0x21')](handleEntityNotFound(_0x1e6a1e,null))[_0x2761('0x44')](handleError(_0x1e6a1e,null));};
\ No newline at end of file
index b51013d..11133b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd9d=['../../config/logger','api','moment','bluebird','path','exports','define','Sound','tools_sounds','lodash','util'];(function(_0x5b166e,_0xb1c1cd){var _0x2805b1=function(_0x34f8d8){while(--_0x34f8d8){_0x5b166e['push'](_0x5b166e['shift']());}};_0x2805b1(++_0xb1c1cd);}(_0xfd9d,0xa3));var _0xdfd9=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0xfd9d[_0x3fe393];return _0x534d14;};'use strict';var _=require(_0xdfd9('0x0'));var util=require(_0xdfd9('0x1'));var logger=require(_0xdfd9('0x2'))(_0xdfd9('0x3'));var moment=require(_0xdfd9('0x4'));var BPromise=require(_0xdfd9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfd9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0xdfd9('0x7')]=function(_0xd4432a,_0x1f4cbb){return _0xd4432a[_0xdfd9('0x8')](_0xdfd9('0x9'),attributes,{'tableName':_0xdfd9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x528a=['Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define'];(function(_0x275080,_0x38d7ef){var _0x4defa7=function(_0x264aca){while(--_0x264aca){_0x275080['push'](_0x275080['shift']());}};_0x4defa7(++_0x38d7ef);}(_0x528a,0xc5));var _0xa528=function(_0x54e380,_0x21d2f4){_0x54e380=_0x54e380-0x0;var _0x1c9e5d=_0x528a[_0x54e380];return _0x1c9e5d;};'use strict';var _=require(_0xa528('0x0'));var util=require(_0xa528('0x1'));var logger=require(_0xa528('0x2'))(_0xa528('0x3'));var moment=require(_0xa528('0x4'));var BPromise=require(_0xa528('0x5'));var rp=require(_0xa528('0x6'));var fs=require('fs');var path=require(_0xa528('0x7'));var rimraf=require(_0xa528('0x8'));var config=require(_0xa528('0x9'));var attributes=require(_0xa528('0xa'));module[_0xa528('0xb')]=function(_0x528d87,_0x3a2865){return _0x528d87[_0xa528('0xc')](_0xa528('0xd'),attributes,{'tableName':_0xa528('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 51b2d22..1f21d73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5daf=['attributes','include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','ShowSound','Sound','find','options','raw','where'];(function(_0x4ef504,_0x5265c9){var _0xd73102=function(_0x6d9780){while(--_0x6d9780){_0x4ef504['push'](_0x4ef504['shift']());}};_0xd73102(++_0x5265c9);}(_0x5daf,0x1e5));var _0xf5da=function(_0x3eb2e2,_0x3351c6){_0x3eb2e2=_0x3eb2e2-0x0;var _0x105148=_0x5daf[_0x3eb2e2];return _0x105148;};'use strict';var _=require(_0xf5da('0x0'));var util=require('util');var moment=require(_0xf5da('0x1'));var BPromise=require(_0xf5da('0x2'));var rs=require(_0xf5da('0x3'));var fs=require('fs');var Redis=require(_0xf5da('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf5da('0x5'))(_0xf5da('0x6'));var config=require(_0xf5da('0x7'));var jayson=require(_0xf5da('0x8'));var client=jayson[_0xf5da('0x9')][_0xf5da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x180513,_0x5c4c63,_0x142c0e){return new BPromise(function(_0x7c7299,_0x18b285){return client[_0xf5da('0xb')](_0x180513,_0x142c0e)['then'](function(_0xa96f3a){logger[_0xf5da('0xc')](_0xf5da('0xd'),_0x5c4c63,'request\x20sent');logger[_0xf5da('0xe')](_0xf5da('0xf'),_0x5c4c63,_0xf5da('0x10'),JSON[_0xf5da('0x11')](_0xa96f3a));if(_0xa96f3a[_0xf5da('0x12')]){if(_0xa96f3a[_0xf5da('0x12')]['code']===0x1f4){logger[_0xf5da('0x12')](_0xf5da('0xd'),_0x5c4c63,_0xa96f3a[_0xf5da('0x12')][_0xf5da('0x13')]);return _0x18b285(_0xa96f3a['error']['message']);}logger[_0xf5da('0x12')](_0xf5da('0xd'),_0x5c4c63,_0xa96f3a[_0xf5da('0x12')][_0xf5da('0x13')]);return _0x7c7299(_0xa96f3a[_0xf5da('0x12')]['message']);}else{logger[_0xf5da('0xc')](_0xf5da('0xd'),_0x5c4c63,'request\x20sent');_0x7c7299(_0xa96f3a['result']['message']);}})[_0xf5da('0x14')](function(_0x247804){logger['error'](_0xf5da('0xd'),_0x5c4c63,_0x247804);_0x18b285(_0x247804);});});}exports[_0xf5da('0x15')]=function(_0x3dd8e8){var _0x411aed=this;return new Promise(function(_0x73f276,_0x2e1160){return db[_0xf5da('0x16')][_0xf5da('0x17')]({'raw':_0x3dd8e8['options']?_0x3dd8e8[_0xf5da('0x18')][_0xf5da('0x19')]===undefined?!![]:![]:!![],'where':_0x3dd8e8[_0xf5da('0x18')]?_0x3dd8e8[_0xf5da('0x18')][_0xf5da('0x1a')]||null:null,'attributes':_0x3dd8e8[_0xf5da('0x18')]?_0x3dd8e8['options'][_0xf5da('0x1b')]||null:null,'include':_0x3dd8e8['options']?_0x3dd8e8['options'][_0xf5da('0x1c')]?_['map'](_0x3dd8e8[_0xf5da('0x18')][_0xf5da('0x1c')],function(_0x1df806){return{'model':db[_0x1df806['model']],'as':_0x1df806['as'],'attributes':_0x1df806[_0xf5da('0x1b')],'include':_0x1df806[_0xf5da('0x1c')]?_[_0xf5da('0x1d')](_0x1df806[_0xf5da('0x1c')],function(_0x11389b){return{'model':db[_0x11389b[_0xf5da('0x1e')]],'as':_0x11389b['as'],'attributes':_0x11389b['attributes'],'include':_0x11389b[_0xf5da('0x1c')]?_['map'](_0x11389b[_0xf5da('0x1c')],function(_0x177567){return{'model':db[_0x177567[_0xf5da('0x1e')]],'as':_0x177567['as'],'attributes':_0x177567[_0xf5da('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf5da('0x1f')](function(_0x13ccd2){logger[_0xf5da('0xc')](_0xf5da('0x15'),_0x3dd8e8);logger[_0xf5da('0xe')](_0xf5da('0x15'),_0x3dd8e8,JSON[_0xf5da('0x11')](_0x13ccd2));_0x73f276(_0x13ccd2);})[_0xf5da('0x14')](function(_0x50b1a8){logger[_0xf5da('0x12')](_0xf5da('0x15'),_0x50b1a8[_0xf5da('0x13')],_0x3dd8e8);_0x2e1160(_0x411aed[_0xf5da('0x12')](0x1f4,_0x50b1a8[_0xf5da('0x13')]));});});};
\ No newline at end of file
+var _0xeb3e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','debug','lodash','util'];(function(_0x1e9d12,_0x419045){var _0x508e1a=function(_0x1ec76e){while(--_0x1ec76e){_0x1e9d12['push'](_0x1e9d12['shift']());}};_0x508e1a(++_0x419045);}(_0xeb3e,0x174));var _0xeeb3=function(_0x49bce8,_0x236695){_0x49bce8=_0x49bce8-0x0;var _0x253728=_0xeb3e[_0x49bce8];return _0x253728;};'use strict';var _=require(_0xeeb3('0x0'));var util=require(_0xeeb3('0x1'));var moment=require(_0xeeb3('0x2'));var BPromise=require(_0xeeb3('0x3'));var rs=require(_0xeeb3('0x4'));var fs=require('fs');var Redis=require(_0xeeb3('0x5'));var db=require(_0xeeb3('0x6'))['db'];var utils=require(_0xeeb3('0x7'));var logger=require(_0xeeb3('0x8'))('rpc');var config=require(_0xeeb3('0x9'));var jayson=require(_0xeeb3('0xa'));var client=jayson[_0xeeb3('0xb')][_0xeeb3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ba8a0,_0x2915ca,_0xc572b1){return new BPromise(function(_0x17112d,_0x2d169b){return client[_0xeeb3('0xd')](_0x1ba8a0,_0xc572b1)[_0xeeb3('0xe')](function(_0x472e12){logger[_0xeeb3('0xf')](_0xeeb3('0x10'),_0x2915ca,_0xeeb3('0x11'));logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x2915ca,_0xeeb3('0x11'),JSON[_0xeeb3('0x12')](_0x472e12));if(_0x472e12[_0xeeb3('0x13')]){if(_0x472e12[_0xeeb3('0x13')][_0xeeb3('0x14')]===0x1f4){logger[_0xeeb3('0x13')](_0xeeb3('0x10'),_0x2915ca,_0x472e12['error'][_0xeeb3('0x15')]);return _0x2d169b(_0x472e12[_0xeeb3('0x13')][_0xeeb3('0x15')]);}logger['error'](_0xeeb3('0x10'),_0x2915ca,_0x472e12['error'][_0xeeb3('0x15')]);return _0x17112d(_0x472e12[_0xeeb3('0x13')][_0xeeb3('0x15')]);}else{logger[_0xeeb3('0xf')](_0xeeb3('0x10'),_0x2915ca,'request\x20sent');_0x17112d(_0x472e12[_0xeeb3('0x16')][_0xeeb3('0x15')]);}})[_0xeeb3('0x17')](function(_0x1f9e4d){logger['error'](_0xeeb3('0x10'),_0x2915ca,_0x1f9e4d);_0x2d169b(_0x1f9e4d);});});}exports[_0xeeb3('0x18')]=function(_0x59baa2){var _0x2ec1d3=this;return new Promise(function(_0x4a1030,_0x166741){return db['Sound'][_0xeeb3('0x19')]({'raw':_0x59baa2[_0xeeb3('0x1a')]?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1b')]===undefined?!![]:![]:!![],'where':_0x59baa2[_0xeeb3('0x1a')]?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1c')]||null:null,'attributes':_0x59baa2['options']?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1d')]||null:null,'include':_0x59baa2[_0xeeb3('0x1a')]?_0x59baa2[_0xeeb3('0x1a')][_0xeeb3('0x1e')]?_[_0xeeb3('0x1f')](_0x59baa2['options'][_0xeeb3('0x1e')],function(_0x40adbc){return{'model':db[_0x40adbc['model']],'as':_0x40adbc['as'],'attributes':_0x40adbc[_0xeeb3('0x1d')],'include':_0x40adbc['include']?_[_0xeeb3('0x1f')](_0x40adbc[_0xeeb3('0x1e')],function(_0x5d0c09){return{'model':db[_0x5d0c09[_0xeeb3('0x20')]],'as':_0x5d0c09['as'],'attributes':_0x5d0c09['attributes'],'include':_0x5d0c09[_0xeeb3('0x1e')]?_[_0xeeb3('0x1f')](_0x5d0c09['include'],function(_0x241d58){return{'model':db[_0x241d58['model']],'as':_0x241d58['as'],'attributes':_0x241d58[_0xeeb3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeeb3('0xe')](function(_0x378c47){logger[_0xeeb3('0xf')](_0xeeb3('0x18'),_0x59baa2);logger[_0xeeb3('0x21')](_0xeeb3('0x18'),_0x59baa2,JSON['stringify'](_0x378c47));_0x4a1030(_0x378c47);})['catch'](function(_0x11b478){logger[_0xeeb3('0x13')](_0xeeb3('0x18'),_0x11b478[_0xeeb3('0x15')],_0x59baa2);_0x166741(_0x2ec1d3[_0xeeb3('0x13')](0x1f4,_0x11b478[_0xeeb3('0x15')]));});});};
\ No newline at end of file
index 385be89..485d99c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xa7879c,_0x4dc1d9){var _0x576d61=function(_0x54d9f0){while(--_0x54d9f0){_0xa7879c['push'](_0xa7879c['shift']());}};_0x576d61(++_0x4dc1d9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x39e283,_0x247e6b){_0x39e283=_0x39e283-0x0;var _0x7de89f=_0x0b0e[_0x39e283];return _0x7de89f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router;
\ No newline at end of file
+var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x8603,0x190));var _0x3860=function(_0x29d0d7,_0xc8a6ce){_0x29d0d7=_0x29d0d7-0x0;var _0x54fac3=_0x8603[_0x29d0d7];return _0x54fac3;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
index 06b95fd..a40a845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6249=['sequelize','exports','STRING','medium','out'];(function(_0x29830b,_0x5e641b){var _0x2273db=function(_0xdfbe35){while(--_0xdfbe35){_0x29830b['push'](_0x29830b['shift']());}};_0x2273db(++_0x5e641b);}(_0x6249,0x8c));var _0x9624=function(_0x440845,_0x3b1852){_0x440845=_0x440845-0x0;var _0x105a87=_0x6249[_0x440845];return _0x105a87;};'use strict';var Sequelize=require(_0x9624('0x0'));module[_0x9624('0x1')]={'uniqueid':{'type':Sequelize[_0x9624('0x2')]},'body':{'type':Sequelize['TEXT'](_0x9624('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9624('0x4')),'defaultValue':_0x9624('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9624('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x72b0=['ENUM','sequelize','STRING','TEXT'];(function(_0x9d1e6b,_0x3bdc22){var _0x2b3070=function(_0x4c4ced){while(--_0x4c4ced){_0x9d1e6b['push'](_0x9d1e6b['shift']());}};_0x2b3070(++_0x3bdc22);}(_0x72b0,0x12d));var _0x072b=function(_0x4585ee,_0x436efa){_0x4585ee=_0x4585ee-0x0;var _0x5bd642=_0x72b0[_0x4585ee];return _0x5bd642;};'use strict';var Sequelize=require(_0x072b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x072b('0x1')]},'body':{'type':Sequelize[_0x072b('0x2')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x072b('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x072b('0x2')]}};
\ No newline at end of file
index 7ba795f..b44b5cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3d5=['ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','send','map','SquareMessage','rawAttributes','fieldName','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x538e5c,_0x485e0a){var _0x36b805=function(_0xf0e3a1){while(--_0xf0e3a1){_0x538e5c['push'](_0x538e5c['shift']());}};_0x36b805(++_0x485e0a);}(_0xa3d5,0xc7));var _0x5a3d=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0xa3d5[_0x412342];return _0x3e62cb;};'use strict';var emlformat=require(_0x5a3d('0x0'));var rimraf=require(_0x5a3d('0x1'));var zipdir=require(_0x5a3d('0x2'));var jsonpatch=require(_0x5a3d('0x3'));var rp=require('request-promise');var moment=require(_0x5a3d('0x4'));var BPromise=require(_0x5a3d('0x5'));var Mustache=require(_0x5a3d('0x6'));var util=require(_0x5a3d('0x7'));var path=require(_0x5a3d('0x8'));var sox=require(_0x5a3d('0x9'));var csv=require(_0x5a3d('0xa'));var ejs=require(_0x5a3d('0xb'));var fs=require('fs');var fs_extra=require(_0x5a3d('0xc'));var _=require(_0x5a3d('0xd'));var squel=require(_0x5a3d('0xe'));var crypto=require(_0x5a3d('0xf'));var jsforce=require(_0x5a3d('0x10'));var deskjs=require(_0x5a3d('0x11'));var toCsv=require(_0x5a3d('0xa'));var querystring=require(_0x5a3d('0x12'));var Papa=require(_0x5a3d('0x13'));var Redis=require(_0x5a3d('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5a3d('0x15'));var hardwareService=require(_0x5a3d('0x16'));var logger=require(_0x5a3d('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x5a3d('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x429ec0,_0x36d8f0){_0x36d8f0=_0x36d8f0||0xcc;return function(_0x49e402){if(_0x49e402){return _0x429ec0[_0x5a3d('0x19')](_0x36d8f0);}return _0x429ec0[_0x5a3d('0x1a')](_0x36d8f0)[_0x5a3d('0x1b')]();};}function respondWithResult(_0x320c10,_0x5768d9){_0x5768d9=_0x5768d9||0xc8;return function(_0x2d98af){if(_0x2d98af){return _0x320c10[_0x5a3d('0x1a')](_0x5768d9)['json'](_0x2d98af);}};}function respondWithFilteredResult(_0x5969e6,_0x4a50ec){return function(_0x57d983){if(_0x57d983){var _0x1c0c8c=typeof _0x4a50ec['offset']===_0x5a3d('0x1c')&&typeof _0x4a50ec['limit']===_0x5a3d('0x1c');var _0x94f958=_0x57d983[_0x5a3d('0x1d')];var _0x8089b3=_0x1c0c8c?0x0:_0x4a50ec[_0x5a3d('0x1e')];var _0x5abd56=_0x1c0c8c?_0x57d983['count']:_0x4a50ec['offset']+_0x4a50ec[_0x5a3d('0x1f')];var _0x554340;if(_0x5abd56>=_0x94f958){_0x5abd56=_0x94f958;_0x554340=0xc8;}else{_0x554340=0xce;}_0x5969e6[_0x5a3d('0x1a')](_0x554340);return _0x5969e6['set'](_0x5a3d('0x20'),_0x8089b3+'-'+_0x5abd56+'/'+_0x94f958)['json'](_0x57d983);}return null;};}function patchUpdates(_0xd20643){return function(_0x3a0c16){try{jsonpatch[_0x5a3d('0x21')](_0x3a0c16,_0xd20643,!![]);}catch(_0x1692c9){return BPromise[_0x5a3d('0x22')](_0x1692c9);}return _0x3a0c16[_0x5a3d('0x23')]();};}function saveUpdates(_0x3dec8f,_0x2df983){return function(_0x5805b3){if(_0x5805b3){return _0x5805b3[_0x5a3d('0x24')](_0x3dec8f)[_0x5a3d('0x25')](function(_0x3de7a9){return _0x3de7a9;});}return null;};}function removeEntity(_0x299cdc,_0x52678f){return function(_0x519a04){if(_0x519a04){return _0x519a04[_0x5a3d('0x26')]()[_0x5a3d('0x25')](function(){_0x299cdc['status'](0xcc)[_0x5a3d('0x1b')]();});}};}function handleEntityNotFound(_0x1d1c99,_0x16bc13){return function(_0x593280){if(!_0x593280){_0x1d1c99[_0x5a3d('0x19')](0x194);}return _0x593280;};}function handleError(_0x52f391,_0x2aa64d){_0x2aa64d=_0x2aa64d||0x1f4;return function(_0x5e6c1e){logger['error'](_0x5e6c1e[_0x5a3d('0x27')]);if(_0x5e6c1e['name']){delete _0x5e6c1e['name'];}_0x52f391['status'](_0x2aa64d)[_0x5a3d('0x28')](_0x5e6c1e);};}exports['index']=function(_0x3f504b,_0x9fbd47){var _0xa45266={},_0x274a2d={},_0x1e7237={'count':0x0,'rows':[]};var _0x4f6392=_[_0x5a3d('0x29')](db[_0x5a3d('0x2a')][_0x5a3d('0x2b')],function(_0x4a3f2e){return{'name':_0x4a3f2e[_0x5a3d('0x2c')],'type':_0x4a3f2e['type']['key']};});_0x274a2d[_0x5a3d('0x2d')]=_[_0x5a3d('0x29')](_0x4f6392,_0x5a3d('0x2e'));_0x274a2d[_0x5a3d('0x2f')]=_['keys'](_0x3f504b[_0x5a3d('0x2f')]);_0x274a2d[_0x5a3d('0x30')]=_[_0x5a3d('0x31')](_0x274a2d[_0x5a3d('0x2d')],_0x274a2d[_0x5a3d('0x2f')]);_0xa45266['attributes']=_[_0x5a3d('0x31')](_0x274a2d[_0x5a3d('0x2d')],qs[_0x5a3d('0x32')](_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x32')]));_0xa45266[_0x5a3d('0x33')]=_0xa45266[_0x5a3d('0x33')][_0x5a3d('0x34')]?_0xa45266['attributes']:_0x274a2d[_0x5a3d('0x2d')];if(!_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x35')]('nolimit')){_0xa45266[_0x5a3d('0x1f')]=qs[_0x5a3d('0x1f')](_0x3f504b[_0x5a3d('0x2f')]['limit']);_0xa45266[_0x5a3d('0x1e')]=qs['offset'](_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x1e')]);}_0xa45266[_0x5a3d('0x36')]=qs['sort'](_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x37')]);_0xa45266[_0x5a3d('0x38')]=qs[_0x5a3d('0x30')](_[_0x5a3d('0x39')](_0x3f504b[_0x5a3d('0x2f')],_0x274a2d['filters']),_0x4f6392);if(_0x3f504b[_0x5a3d('0x2f')][_0x5a3d('0x3a')]){_0xa45266[_0x5a3d('0x38')]=_[_0x5a3d('0x3b')](_0xa45266[_0x5a3d('0x38')],{'$or':_[_0x5a3d('0x29')](_0x4f6392,function(_0x41bf1a){if(_0x41bf1a[_0x5a3d('0x3c')]!=='VIRTUAL'){var _0x459005={};_0x459005[_0x41bf1a[_0x5a3d('0x2e')]]={'$like':'%'+_0x3f504b['query']['filter']+'%'};return _0x459005;}})});}_0xa45266=_[_0x5a3d('0x3b')]({},_0xa45266,_0x3f504b[_0x5a3d('0x3d')]);var _0x51e578={'where':_0xa45266[_0x5a3d('0x38')]};return db[_0x5a3d('0x2a')][_0x5a3d('0x1d')](_0x51e578)[_0x5a3d('0x25')](function(_0x268556){_0x1e7237[_0x5a3d('0x1d')]=_0x268556;if(_0x3f504b['query'][_0x5a3d('0x3e')]){_0xa45266[_0x5a3d('0x3f')]=[{'all':!![]}];}return db[_0x5a3d('0x2a')][_0x5a3d('0x40')](_0xa45266);})[_0x5a3d('0x25')](function(_0x293a58){_0x1e7237[_0x5a3d('0x41')]=_0x293a58;return _0x1e7237;})[_0x5a3d('0x25')](respondWithFilteredResult(_0x9fbd47,_0xa45266))['catch'](handleError(_0x9fbd47,null));};exports[_0x5a3d('0x42')]=function(_0x1c79fc,_0x3b392b){var _0xada0db={'raw':!![],'where':{'id':_0x1c79fc[_0x5a3d('0x43')]['id']}},_0x2d1033={};_0x2d1033[_0x5a3d('0x2d')]=_[_0x5a3d('0x44')](db[_0x5a3d('0x2a')]['rawAttributes']);_0x2d1033['query']=_[_0x5a3d('0x44')](_0x1c79fc[_0x5a3d('0x2f')]);_0x2d1033[_0x5a3d('0x30')]=_['intersection'](_0x2d1033[_0x5a3d('0x2d')],_0x2d1033['query']);_0xada0db['attributes']=_[_0x5a3d('0x31')](_0x2d1033['model'],qs['fields'](_0x1c79fc[_0x5a3d('0x2f')][_0x5a3d('0x32')]));_0xada0db['attributes']=_0xada0db['attributes'][_0x5a3d('0x34')]?_0xada0db[_0x5a3d('0x33')]:_0x2d1033[_0x5a3d('0x2d')];if(_0x1c79fc[_0x5a3d('0x2f')]['includeAll']){_0xada0db[_0x5a3d('0x3f')]=[{'all':!![]}];}_0xada0db=_[_0x5a3d('0x3b')]({},_0xada0db,_0x1c79fc['options']);return db[_0x5a3d('0x2a')][_0x5a3d('0x45')](_0xada0db)['then'](handleEntityNotFound(_0x3b392b,null))[_0x5a3d('0x25')](respondWithResult(_0x3b392b,null))['catch'](handleError(_0x3b392b,null));};exports[_0x5a3d('0x46')]=function(_0x553858,_0x44d456){return db['SquareMessage'][_0x5a3d('0x46')](_0x553858[_0x5a3d('0x47')],{})[_0x5a3d('0x25')](respondWithResult(_0x44d456,0xc9))[_0x5a3d('0x48')](handleError(_0x44d456,null));};exports[_0x5a3d('0x24')]=function(_0x2243ed,_0x21b995){if(_0x2243ed[_0x5a3d('0x47')]['id']){delete _0x2243ed[_0x5a3d('0x47')]['id'];}return db[_0x5a3d('0x2a')][_0x5a3d('0x45')]({'where':{'id':_0x2243ed[_0x5a3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x21b995,null))[_0x5a3d('0x25')](saveUpdates(_0x2243ed[_0x5a3d('0x47')],null))[_0x5a3d('0x25')](respondWithResult(_0x21b995,null))[_0x5a3d('0x48')](handleError(_0x21b995,null));};exports[_0x5a3d('0x26')]=function(_0x440c57,_0x33d1d7){return db[_0x5a3d('0x2a')]['find']({'where':{'id':_0x440c57[_0x5a3d('0x43')]['id']}})['then'](handleEntityNotFound(_0x33d1d7,null))[_0x5a3d('0x25')](removeEntity(_0x33d1d7,null))['catch'](handleError(_0x33d1d7,null));};
\ No newline at end of file
+var _0xecf5=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','SquareMessage','includeAll','findAll','rows','catch','show','options','find','create','body','update','params','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','save','destroy','then','error','stack','name','send'];(function(_0x28b12e,_0x59f4f5){var _0x2c3bd1=function(_0x1680c1){while(--_0x1680c1){_0x28b12e['push'](_0x28b12e['shift']());}};_0x2c3bd1(++_0x59f4f5);}(_0xecf5,0x1c5));var _0x5ecf=function(_0xfc95da,_0x487638){_0xfc95da=_0xfc95da-0x0;var _0x4c840d=_0xecf5[_0xfc95da];return _0x4c840d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ecf('0x0'));var zipdir=require(_0x5ecf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5ecf('0x2'));var moment=require(_0x5ecf('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5ecf('0x4'));var sox=require(_0x5ecf('0x5'));var csv=require(_0x5ecf('0x6'));var ejs=require(_0x5ecf('0x7'));var fs=require('fs');var fs_extra=require(_0x5ecf('0x8'));var _=require(_0x5ecf('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ecf('0xa'));var toCsv=require(_0x5ecf('0x6'));var querystring=require(_0x5ecf('0xb'));var Papa=require('papaparse');var Redis=require(_0x5ecf('0xc'));var authService=require(_0x5ecf('0xd'));var qs=require(_0x5ecf('0xe'));var as=require(_0x5ecf('0xf'));var hardwareService=require(_0x5ecf('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x5ecf('0x11'));var config=require(_0x5ecf('0x12'));var licenseUtil=require(_0x5ecf('0x13'));var db=require(_0x5ecf('0x14'))['db'];function respondWithStatusCode(_0x3d061c,_0x4a39f8){_0x4a39f8=_0x4a39f8||0xcc;return function(_0x5d576a){if(_0x5d576a){return _0x3d061c[_0x5ecf('0x15')](_0x4a39f8);}return _0x3d061c[_0x5ecf('0x16')](_0x4a39f8)[_0x5ecf('0x17')]();};}function respondWithResult(_0x5cb5db,_0x3f4692){_0x3f4692=_0x3f4692||0xc8;return function(_0x9ead61){if(_0x9ead61){return _0x5cb5db['status'](_0x3f4692)['json'](_0x9ead61);}};}function respondWithFilteredResult(_0x2c2472,_0x4bd1c3){return function(_0x13ddb6){if(_0x13ddb6){var _0x54c980=typeof _0x4bd1c3[_0x5ecf('0x18')]===_0x5ecf('0x19')&&typeof _0x4bd1c3[_0x5ecf('0x1a')]===_0x5ecf('0x19');var _0x4be5dc=_0x13ddb6[_0x5ecf('0x1b')];var _0x5723b7=_0x54c980?0x0:_0x4bd1c3['offset'];var _0x190f90=_0x54c980?_0x13ddb6[_0x5ecf('0x1b')]:_0x4bd1c3[_0x5ecf('0x18')]+_0x4bd1c3[_0x5ecf('0x1a')];var _0x2c0569;if(_0x190f90>=_0x4be5dc){_0x190f90=_0x4be5dc;_0x2c0569=0xc8;}else{_0x2c0569=0xce;}_0x2c2472[_0x5ecf('0x16')](_0x2c0569);return _0x2c2472[_0x5ecf('0x1c')]('Content-Range',_0x5723b7+'-'+_0x190f90+'/'+_0x4be5dc)['json'](_0x13ddb6);}return null;};}function patchUpdates(_0x35a74a){return function(_0x49fff9){try{jsonpatch[_0x5ecf('0x1d')](_0x49fff9,_0x35a74a,!![]);}catch(_0x22f032){return BPromise['reject'](_0x22f032);}return _0x49fff9[_0x5ecf('0x1e')]();};}function saveUpdates(_0xd8d34f,_0x3bdced){return function(_0x16cb5e){if(_0x16cb5e){return _0x16cb5e['update'](_0xd8d34f)['then'](function(_0x3feb4d){return _0x3feb4d;});}return null;};}function removeEntity(_0x4524a8,_0x16aa19){return function(_0x50fbeb){if(_0x50fbeb){return _0x50fbeb[_0x5ecf('0x1f')]()[_0x5ecf('0x20')](function(){_0x4524a8[_0x5ecf('0x16')](0xcc)[_0x5ecf('0x17')]();});}};}function handleEntityNotFound(_0x3b6390,_0x44f18d){return function(_0x15b163){if(!_0x15b163){_0x3b6390[_0x5ecf('0x15')](0x194);}return _0x15b163;};}function handleError(_0x11d12a,_0x15acbe){_0x15acbe=_0x15acbe||0x1f4;return function(_0x1786c7){logger[_0x5ecf('0x21')](_0x1786c7[_0x5ecf('0x22')]);if(_0x1786c7[_0x5ecf('0x23')]){delete _0x1786c7[_0x5ecf('0x23')];}_0x11d12a[_0x5ecf('0x16')](_0x15acbe)[_0x5ecf('0x24')](_0x1786c7);};}exports['index']=function(_0x1a2677,_0x5831f8){var _0x5d3cb9={},_0x4b752b={},_0x460bb2={'count':0x0,'rows':[]};var _0x41d9bf=_[_0x5ecf('0x25')](db['SquareMessage'][_0x5ecf('0x26')],function(_0x131531){return{'name':_0x131531[_0x5ecf('0x27')],'type':_0x131531[_0x5ecf('0x28')][_0x5ecf('0x29')]};});_0x4b752b[_0x5ecf('0x2a')]=_['map'](_0x41d9bf,_0x5ecf('0x23'));_0x4b752b[_0x5ecf('0x2b')]=_[_0x5ecf('0x2c')](_0x1a2677['query']);_0x4b752b[_0x5ecf('0x2d')]=_['intersection'](_0x4b752b['model'],_0x4b752b[_0x5ecf('0x2b')]);_0x5d3cb9[_0x5ecf('0x2e')]=_[_0x5ecf('0x2f')](_0x4b752b['model'],qs[_0x5ecf('0x30')](_0x1a2677[_0x5ecf('0x2b')]['fields']));_0x5d3cb9[_0x5ecf('0x2e')]=_0x5d3cb9[_0x5ecf('0x2e')][_0x5ecf('0x31')]?_0x5d3cb9[_0x5ecf('0x2e')]:_0x4b752b['model'];if(!_0x1a2677[_0x5ecf('0x2b')][_0x5ecf('0x32')]('nolimit')){_0x5d3cb9[_0x5ecf('0x1a')]=qs[_0x5ecf('0x1a')](_0x1a2677['query'][_0x5ecf('0x1a')]);_0x5d3cb9[_0x5ecf('0x18')]=qs['offset'](_0x1a2677[_0x5ecf('0x2b')]['offset']);}_0x5d3cb9[_0x5ecf('0x33')]=qs[_0x5ecf('0x34')](_0x1a2677['query'][_0x5ecf('0x34')]);_0x5d3cb9[_0x5ecf('0x35')]=qs[_0x5ecf('0x2d')](_[_0x5ecf('0x36')](_0x1a2677[_0x5ecf('0x2b')],_0x4b752b[_0x5ecf('0x2d')]),_0x41d9bf);if(_0x1a2677[_0x5ecf('0x2b')]['filter']){_0x5d3cb9[_0x5ecf('0x35')]=_['merge'](_0x5d3cb9[_0x5ecf('0x35')],{'$or':_[_0x5ecf('0x25')](_0x41d9bf,function(_0x12507c){if(_0x12507c[_0x5ecf('0x28')]!==_0x5ecf('0x37')){var _0x3907db={};_0x3907db[_0x12507c[_0x5ecf('0x23')]]={'$like':'%'+_0x1a2677[_0x5ecf('0x2b')][_0x5ecf('0x38')]+'%'};return _0x3907db;}})});}_0x5d3cb9=_[_0x5ecf('0x39')]({},_0x5d3cb9,_0x1a2677['options']);var _0x207f15={'where':_0x5d3cb9['where']};return db[_0x5ecf('0x3a')][_0x5ecf('0x1b')](_0x207f15)[_0x5ecf('0x20')](function(_0x5e25e8){_0x460bb2[_0x5ecf('0x1b')]=_0x5e25e8;if(_0x1a2677[_0x5ecf('0x2b')][_0x5ecf('0x3b')]){_0x5d3cb9['include']=[{'all':!![]}];}return db['SquareMessage'][_0x5ecf('0x3c')](_0x5d3cb9);})[_0x5ecf('0x20')](function(_0x2acd35){_0x460bb2[_0x5ecf('0x3d')]=_0x2acd35;return _0x460bb2;})['then'](respondWithFilteredResult(_0x5831f8,_0x5d3cb9))[_0x5ecf('0x3e')](handleError(_0x5831f8,null));};exports[_0x5ecf('0x3f')]=function(_0x1b2fe0,_0x465b65){var _0x4c4b9c={'raw':!![],'where':{'id':_0x1b2fe0['params']['id']}},_0x2c9712={};_0x2c9712['model']=_[_0x5ecf('0x2c')](db[_0x5ecf('0x3a')][_0x5ecf('0x26')]);_0x2c9712[_0x5ecf('0x2b')]=_[_0x5ecf('0x2c')](_0x1b2fe0['query']);_0x2c9712['filters']=_[_0x5ecf('0x2f')](_0x2c9712[_0x5ecf('0x2a')],_0x2c9712[_0x5ecf('0x2b')]);_0x4c4b9c[_0x5ecf('0x2e')]=_[_0x5ecf('0x2f')](_0x2c9712['model'],qs['fields'](_0x1b2fe0['query'][_0x5ecf('0x30')]));_0x4c4b9c[_0x5ecf('0x2e')]=_0x4c4b9c[_0x5ecf('0x2e')]['length']?_0x4c4b9c['attributes']:_0x2c9712[_0x5ecf('0x2a')];if(_0x1b2fe0['query'][_0x5ecf('0x3b')]){_0x4c4b9c['include']=[{'all':!![]}];}_0x4c4b9c=_[_0x5ecf('0x39')]({},_0x4c4b9c,_0x1b2fe0[_0x5ecf('0x40')]);return db[_0x5ecf('0x3a')][_0x5ecf('0x41')](_0x4c4b9c)[_0x5ecf('0x20')](handleEntityNotFound(_0x465b65,null))[_0x5ecf('0x20')](respondWithResult(_0x465b65,null))['catch'](handleError(_0x465b65,null));};exports[_0x5ecf('0x42')]=function(_0x1ecbb8,_0x23ce59){return db[_0x5ecf('0x3a')][_0x5ecf('0x42')](_0x1ecbb8[_0x5ecf('0x43')],{})[_0x5ecf('0x20')](respondWithResult(_0x23ce59,0xc9))['catch'](handleError(_0x23ce59,null));};exports[_0x5ecf('0x44')]=function(_0xef4473,_0x392179){if(_0xef4473[_0x5ecf('0x43')]['id']){delete _0xef4473[_0x5ecf('0x43')]['id'];}return db[_0x5ecf('0x3a')]['find']({'where':{'id':_0xef4473[_0x5ecf('0x45')]['id']}})['then'](handleEntityNotFound(_0x392179,null))[_0x5ecf('0x20')](saveUpdates(_0xef4473[_0x5ecf('0x43')],null))[_0x5ecf('0x20')](respondWithResult(_0x392179,null))['catch'](handleError(_0x392179,null));};exports[_0x5ecf('0x1f')]=function(_0x4c93c1,_0x692069){return db[_0x5ecf('0x3a')][_0x5ecf('0x41')]({'where':{'id':_0x4c93c1[_0x5ecf('0x45')]['id']}})['then'](handleEntityNotFound(_0x692069,null))[_0x5ecf('0x20')](removeEntity(_0x692069,null))[_0x5ecf('0x3e')](handleError(_0x692069,null));};
\ No newline at end of file
index 3925b37..360338a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3068=['square_messages','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./squareMessage.attributes','define'];(function(_0x3a056b,_0x5529be){var _0xb0d5cd=function(_0x49c464){while(--_0x49c464){_0x3a056b['push'](_0x3a056b['shift']());}};_0xb0d5cd(++_0x5529be);}(_0x3068,0x118));var _0x8306=function(_0x1186f8,_0x1e710e){_0x1186f8=_0x1186f8-0x0;var _0x1382f9=_0x3068[_0x1186f8];return _0x1382f9;};'use strict';var _=require('lodash');var util=require(_0x8306('0x0'));var logger=require(_0x8306('0x1'))(_0x8306('0x2'));var moment=require('moment');var BPromise=require(_0x8306('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8306('0x4'));var config=require(_0x8306('0x5'));var attributes=require(_0x8306('0x6'));module['exports']=function(_0x3da0ac,_0x2978e0){return _0x3da0ac[_0x8306('0x7')]('SquareMessage',attributes,{'tableName':_0x8306('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ed8=['../../config/environment','./squareMessage.attributes','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0x3ed8,0x1d9));var _0x83ed=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0x3ed8[_0x209ec9];return _0x129b1b;};'use strict';var _=require(_0x83ed('0x0'));var util=require('util');var logger=require(_0x83ed('0x1'))(_0x83ed('0x2'));var moment=require(_0x83ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x83ed('0x4'));var fs=require('fs');var path=require(_0x83ed('0x5'));var rimraf=require(_0x83ed('0x6'));var config=require(_0x83ed('0x7'));var attributes=require(_0x83ed('0x8'));module['exports']=function(_0x21172a,_0x5f2b32){return _0x21172a[_0x83ed('0x9')](_0x83ed('0xa'),attributes,{'tableName':_0x83ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 54144c7..0abeb5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x329f=['message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x329f,0x122));var _0xf329=function(_0x23dcfb,_0x3b6129){_0x23dcfb=_0x23dcfb-0x0;var _0x541939=_0x329f[_0x23dcfb];return _0x541939;};'use strict';var _=require(_0xf329('0x0'));var util=require('util');var moment=require(_0xf329('0x1'));var BPromise=require(_0xf329('0x2'));var rs=require(_0xf329('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf329('0x4'));var config=require(_0xf329('0x5'));var jayson=require(_0xf329('0x6'));var client=jayson[_0xf329('0x7')][_0xf329('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ab15c,_0x378ca8,_0x48e399){return new BPromise(function(_0x55c67a,_0x2a0e6c){return client[_0xf329('0x9')](_0x5ab15c,_0x48e399)[_0xf329('0xa')](function(_0x471f47){logger[_0xf329('0xb')]('SquareMessage,\x20%s,\x20%s',_0x378ca8,_0xf329('0xc'));logger['debug'](_0xf329('0xd'),_0x378ca8,_0xf329('0xc'),JSON[_0xf329('0xe')](_0x471f47));if(_0x471f47['error']){if(_0x471f47[_0xf329('0xf')][_0xf329('0x10')]===0x1f4){logger['error'](_0xf329('0x11'),_0x378ca8,_0x471f47['error'][_0xf329('0x12')]);return _0x2a0e6c(_0x471f47[_0xf329('0xf')]['message']);}logger[_0xf329('0xf')](_0xf329('0x11'),_0x378ca8,_0x471f47['error'][_0xf329('0x12')]);return _0x55c67a(_0x471f47[_0xf329('0xf')]['message']);}else{logger[_0xf329('0xb')]('SquareMessage,\x20%s,\x20%s',_0x378ca8,'request\x20sent');_0x55c67a(_0x471f47[_0xf329('0x13')][_0xf329('0x12')]);}})[_0xf329('0x14')](function(_0x32c682){logger[_0xf329('0xf')](_0xf329('0x11'),_0x378ca8,_0x32c682);_0x2a0e6c(_0x32c682);});});}exports[_0xf329('0x15')]=function(_0x2c0df3){var _0x900787=this;return new Promise(function(_0x4f7d35,_0x301351){return db[_0xf329('0x16')][_0xf329('0x17')](_0x2c0df3[_0xf329('0x18')],{'raw':_0x2c0df3[_0xf329('0x19')]?_0x2c0df3['options'][_0xf329('0x1a')]===undefined?!![]:![]:!![]})[_0xf329('0xa')](function(_0x51629d){logger[_0xf329('0xb')](_0xf329('0x15'),_0x2c0df3);logger[_0xf329('0x1b')](_0xf329('0x15'),_0x2c0df3,JSON[_0xf329('0xe')](_0x51629d));_0x4f7d35(_0x51629d);})[_0xf329('0x14')](function(_0x6f7dc3){logger['error'](_0xf329('0x15'),_0x6f7dc3['message'],_0x2c0df3);_0x301351(_0x900787[_0xf329('0xf')](0x1f4,_0x6f7dc3[_0xf329('0x12')]));});});};
\ No newline at end of file
+var _0x1fdc=['info','stringify','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','CreateSquareMessage','create','body','options','raw'];(function(_0x53b594,_0x559767){var _0x1e616f=function(_0x333eda){while(--_0x333eda){_0x53b594['push'](_0x53b594['shift']());}};_0x1e616f(++_0x559767);}(_0x1fdc,0x144));var _0xc1fd=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x1fdc[_0x571a17];return _0x3ef337;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc1fd('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1fd('0x1'));var db=require(_0xc1fd('0x2'))['db'];var utils=require(_0xc1fd('0x3'));var logger=require('../../config/logger')(_0xc1fd('0x4'));var config=require(_0xc1fd('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc1fd('0x6')][_0xc1fd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a8e19,_0x39cf43,_0x193dfb){return new BPromise(function(_0x677ad8,_0x15220d){return client[_0xc1fd('0x8')](_0x4a8e19,_0x193dfb)['then'](function(_0x3f15a3){logger['info'](_0xc1fd('0x9'),_0x39cf43,_0xc1fd('0xa'));logger[_0xc1fd('0xb')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x39cf43,_0xc1fd('0xa'),JSON['stringify'](_0x3f15a3));if(_0x3f15a3[_0xc1fd('0xc')]){if(_0x3f15a3[_0xc1fd('0xc')]['code']===0x1f4){logger[_0xc1fd('0xc')](_0xc1fd('0x9'),_0x39cf43,_0x3f15a3[_0xc1fd('0xc')][_0xc1fd('0xd')]);return _0x15220d(_0x3f15a3[_0xc1fd('0xc')]['message']);}logger[_0xc1fd('0xc')]('SquareMessage,\x20%s,\x20%s',_0x39cf43,_0x3f15a3[_0xc1fd('0xc')][_0xc1fd('0xd')]);return _0x677ad8(_0x3f15a3[_0xc1fd('0xc')]['message']);}else{logger['info'](_0xc1fd('0x9'),_0x39cf43,_0xc1fd('0xa'));_0x677ad8(_0x3f15a3[_0xc1fd('0xe')][_0xc1fd('0xd')]);}})[_0xc1fd('0xf')](function(_0x4a2963){logger[_0xc1fd('0xc')](_0xc1fd('0x9'),_0x39cf43,_0x4a2963);_0x15220d(_0x4a2963);});});}exports[_0xc1fd('0x10')]=function(_0x428813){var _0x4293cf=this;return new Promise(function(_0x346aae,_0x56e0f8){return db['SquareMessage'][_0xc1fd('0x11')](_0x428813[_0xc1fd('0x12')],{'raw':_0x428813['options']?_0x428813[_0xc1fd('0x13')][_0xc1fd('0x14')]===undefined?!![]:![]:!![]})['then'](function(_0x3e33b5){logger[_0xc1fd('0x15')](_0xc1fd('0x10'),_0x428813);logger['debug'](_0xc1fd('0x10'),_0x428813,JSON[_0xc1fd('0x16')](_0x3e33b5));_0x346aae(_0x3e33b5);})[_0xc1fd('0xf')](function(_0x57d5ec){logger[_0xc1fd('0xc')]('CreateSquareMessage',_0x57d5ec[_0xc1fd('0xd')],_0x428813);_0x56e0f8(_0x4293cf[_0xc1fd('0xc')](0x1f4,_0x57d5ec['message']));});});};
\ No newline at end of file
index 80c2c12..209b27f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a70=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','/:id/test','15s','test','create','put','/:id','destroy','util','path','connect-timeout','express'];(function(_0x4cf8d4,_0x5aee73){var _0x2c1beb=function(_0x39b0a4){while(--_0x39b0a4){_0x4cf8d4['push'](_0x4cf8d4['shift']());}};_0x2c1beb(++_0x5aee73);}(_0x1a70,0x18b));var _0x01a7=function(_0x57d5d7,_0x2a4ae0){_0x57d5d7=_0x57d5d7-0x0;var _0x2f598b=_0x1a70[_0x57d5d7];return _0x2f598b;};'use strict';var multer=require('multer');var util=require(_0x01a7('0x0'));var path=require(_0x01a7('0x1'));var timeout=require(_0x01a7('0x2'));var express=require(_0x01a7('0x3'));var router=express['Router']();var fs_extra=require(_0x01a7('0x4'));var auth=require(_0x01a7('0x5'));var interaction=require(_0x01a7('0x6'));var config=require(_0x01a7('0x7'));var controller=require('./squareOdbc.controller');router[_0x01a7('0x8')]('/',auth['isAuthenticated'](),controller[_0x01a7('0x9')]);router['get']('/:id',auth[_0x01a7('0xa')](),controller[_0x01a7('0xb')]);router[_0x01a7('0x8')](_0x01a7('0xc'),auth[_0x01a7('0xa')](),timeout(_0x01a7('0xd')),controller[_0x01a7('0xe')]);router['post']('/',auth[_0x01a7('0xa')](),controller[_0x01a7('0xf')]);router[_0x01a7('0x10')](_0x01a7('0x11'),auth[_0x01a7('0xa')](),controller['update']);router['delete'](_0x01a7('0x11'),auth[_0x01a7('0xa')](),controller[_0x01a7('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x73a8=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','15s','post','put','update','delete','destroy','exports'];(function(_0x24bb72,_0x5d94b4){var _0x238e47=function(_0x55e617){while(--_0x55e617){_0x24bb72['push'](_0x24bb72['shift']());}};_0x238e47(++_0x5d94b4);}(_0x73a8,0x165));var _0x873a=function(_0x1ac054,_0x17b072){_0x1ac054=_0x1ac054-0x0;var _0x1a6780=_0x73a8[_0x1ac054];return _0x1a6780;};'use strict';var multer=require('multer');var util=require(_0x873a('0x0'));var path=require(_0x873a('0x1'));var timeout=require(_0x873a('0x2'));var express=require('express');var router=express[_0x873a('0x3')]();var fs_extra=require(_0x873a('0x4'));var auth=require(_0x873a('0x5'));var interaction=require(_0x873a('0x6'));var config=require(_0x873a('0x7'));var controller=require(_0x873a('0x8'));router[_0x873a('0x9')]('/',auth[_0x873a('0xa')](),controller[_0x873a('0xb')]);router['get'](_0x873a('0xc'),auth[_0x873a('0xa')](),controller[_0x873a('0xd')]);router[_0x873a('0x9')]('/:id/test',auth[_0x873a('0xa')](),timeout(_0x873a('0xe')),controller['test']);router[_0x873a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x873a('0x10')](_0x873a('0xc'),auth['isAuthenticated'](),controller[_0x873a('0x11')]);router[_0x873a('0x12')]('/:id',auth[_0x873a('0xa')](),controller[_0x873a('0x13')]);module[_0x873a('0x14')]=router;
\ No newline at end of file
index 7c76dfd..2932ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d8=['name','exports','STRING'];(function(_0x55af86,_0x5c8ff6){var _0x58df3b=function(_0x2ddd94){while(--_0x2ddd94){_0x55af86['push'](_0x55af86['shift']());}};_0x58df3b(++_0x5c8ff6);}(_0x86d8,0x1d2));var _0x886d=function(_0x15fd33,_0x8a0623){_0x15fd33=_0x15fd33-0x0;var _0x113aca=_0x86d8[_0x15fd33];return _0x113aca;};'use strict';var Sequelize=require('sequelize');module[_0x886d('0x0')]={'name':{'type':Sequelize[_0x886d('0x1')],'unique':_0x886d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x886d('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4c6d=['name','STRING'];(function(_0x54f5cc,_0x4a9d2d){var _0x49e0c2=function(_0x72c458){while(--_0x72c458){_0x54f5cc['push'](_0x54f5cc['shift']());}};_0x49e0c2(++_0x4a9d2d);}(_0x4c6d,0x129));var _0xd4c6=function(_0xa85234,_0x582a56){_0xa85234=_0xa85234-0x0;var _0x19b52f=_0x4c6d[_0xa85234];return _0x19b52f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd4c6('0x0')],'unique':_0xd4c6('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xd4c6('0x0')]},'description':{'type':Sequelize[_0xd4c6('0x0')]}};
\ No newline at end of file
index d5a4ee9..d1fe2dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea9e=['then','destroy','get','UserProfileResource','error','stack','name','send','index','SquareOdbc','fieldName','type','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','params','keys','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update'];(function(_0x180fcb,_0x208b94){var _0x515f0d=function(_0x1be895){while(--_0x1be895){_0x180fcb['push'](_0x180fcb['shift']());}};_0x515f0d(++_0x208b94);}(_0xea9e,0x148));var _0xeea9=function(_0x194e17,_0x547543){_0x194e17=_0x194e17-0x0;var _0x2874f2=_0xea9e[_0x194e17];return _0x2874f2;};'use strict';var emlformat=require(_0xeea9('0x0'));var rimraf=require(_0xeea9('0x1'));var zipdir=require(_0xeea9('0x2'));var jsonpatch=require(_0xeea9('0x3'));var rp=require(_0xeea9('0x4'));var moment=require(_0xeea9('0x5'));var BPromise=require(_0xeea9('0x6'));var Mustache=require(_0xeea9('0x7'));var util=require('util');var path=require(_0xeea9('0x8'));var sox=require(_0xeea9('0x9'));var csv=require(_0xeea9('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeea9('0xb'));var _=require(_0xeea9('0xc'));var squel=require(_0xeea9('0xd'));var crypto=require(_0xeea9('0xe'));var jsforce=require(_0xeea9('0xf'));var deskjs=require(_0xeea9('0x10'));var toCsv=require(_0xeea9('0xa'));var querystring=require(_0xeea9('0x11'));var Papa=require(_0xeea9('0x12'));var Redis=require(_0xeea9('0x13'));var authService=require(_0xeea9('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xeea9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeea9('0x16'))(_0xeea9('0x17'));var utils=require('../../config/utils');var config=require(_0xeea9('0x18'));var licenseUtil=require(_0xeea9('0x19'));var db=require(_0xeea9('0x1a'))['db'];function respondWithStatusCode(_0x20f566,_0xce3587){_0xce3587=_0xce3587||0xcc;return function(_0x37e9a5){if(_0x37e9a5){return _0x20f566[_0xeea9('0x1b')](_0xce3587);}return _0x20f566[_0xeea9('0x1c')](_0xce3587)[_0xeea9('0x1d')]();};}function respondWithResult(_0x20a939,_0x42257a){_0x42257a=_0x42257a||0xc8;return function(_0x408044){if(_0x408044){return _0x20a939['status'](_0x42257a)[_0xeea9('0x1e')](_0x408044);}};}function respondWithFilteredResult(_0x3b780e,_0x4db20a){return function(_0x24d2ab){if(_0x24d2ab){var _0x11f62e=typeof _0x4db20a[_0xeea9('0x1f')]===_0xeea9('0x20')&&typeof _0x4db20a[_0xeea9('0x21')]===_0xeea9('0x20');var _0x1c938e=_0x24d2ab[_0xeea9('0x22')];var _0x5b88df=_0x11f62e?0x0:_0x4db20a[_0xeea9('0x1f')];var _0x289df2=_0x11f62e?_0x24d2ab[_0xeea9('0x22')]:_0x4db20a['offset']+_0x4db20a[_0xeea9('0x21')];var _0x39c64a;if(_0x289df2>=_0x1c938e){_0x289df2=_0x1c938e;_0x39c64a=0xc8;}else{_0x39c64a=0xce;}_0x3b780e[_0xeea9('0x1c')](_0x39c64a);return _0x3b780e[_0xeea9('0x23')](_0xeea9('0x24'),_0x5b88df+'-'+_0x289df2+'/'+_0x1c938e)[_0xeea9('0x1e')](_0x24d2ab);}return null;};}function patchUpdates(_0xfc8560){return function(_0x1d2ff0){try{jsonpatch[_0xeea9('0x25')](_0x1d2ff0,_0xfc8560,!![]);}catch(_0x3db975){return BPromise['reject'](_0x3db975);}return _0x1d2ff0[_0xeea9('0x26')]();};}function saveUpdates(_0x3ec681,_0x35e548){return function(_0x1bb0dc){if(_0x1bb0dc){return _0x1bb0dc[_0xeea9('0x27')](_0x3ec681)[_0xeea9('0x28')](function(_0x202cb0){return _0x202cb0;});}return null;};}function removeEntity(_0x275181,_0x267509){return function(_0xb3365){if(_0xb3365){return _0xb3365[_0xeea9('0x29')]()['then'](function(){var _0x27fa5e=_0xb3365[_0xeea9('0x2a')]({'plain':!![]});var _0x5041e7='ODBC';return db[_0xeea9('0x2b')][_0xeea9('0x29')]({'where':{'type':_0x5041e7,'resourceId':_0x27fa5e['id']}})[_0xeea9('0x28')](function(){return _0xb3365;});})[_0xeea9('0x28')](function(){_0x275181['status'](0xcc)[_0xeea9('0x1d')]();});}};}function handleEntityNotFound(_0x172023,_0x4248ca){return function(_0x2bcc19){if(!_0x2bcc19){_0x172023[_0xeea9('0x1b')](0x194);}return _0x2bcc19;};}function handleError(_0xa2f021,_0xdb8cfa){_0xdb8cfa=_0xdb8cfa||0x1f4;return function(_0x51eea1){logger[_0xeea9('0x2c')](_0x51eea1[_0xeea9('0x2d')]);if(_0x51eea1[_0xeea9('0x2e')]){delete _0x51eea1['name'];}_0xa2f021[_0xeea9('0x1c')](_0xdb8cfa)[_0xeea9('0x2f')](_0x51eea1);};}exports[_0xeea9('0x30')]=function(_0x4b6777,_0x1e8d3b){var _0x9ff4f3={},_0x3485aa={},_0x6d7dab={'count':0x0,'rows':[]};var _0x235c48=_['map'](db[_0xeea9('0x31')]['rawAttributes'],function(_0x2d68a8){return{'name':_0x2d68a8[_0xeea9('0x32')],'type':_0x2d68a8[_0xeea9('0x33')][_0xeea9('0x34')]};});_0x3485aa[_0xeea9('0x35')]=_[_0xeea9('0x36')](_0x235c48,_0xeea9('0x2e'));_0x3485aa[_0xeea9('0x37')]=_['keys'](_0x4b6777['query']);_0x3485aa['filters']=_['intersection'](_0x3485aa['model'],_0x3485aa[_0xeea9('0x37')]);_0x9ff4f3[_0xeea9('0x38')]=_[_0xeea9('0x39')](_0x3485aa['model'],qs[_0xeea9('0x3a')](_0x4b6777[_0xeea9('0x37')][_0xeea9('0x3a')]));_0x9ff4f3[_0xeea9('0x38')]=_0x9ff4f3[_0xeea9('0x38')][_0xeea9('0x3b')]?_0x9ff4f3[_0xeea9('0x38')]:_0x3485aa[_0xeea9('0x35')];if(!_0x4b6777[_0xeea9('0x37')][_0xeea9('0x3c')](_0xeea9('0x3d'))){_0x9ff4f3[_0xeea9('0x21')]=qs[_0xeea9('0x21')](_0x4b6777[_0xeea9('0x37')][_0xeea9('0x21')]);_0x9ff4f3[_0xeea9('0x1f')]=qs['offset'](_0x4b6777[_0xeea9('0x37')]['offset']);}_0x9ff4f3[_0xeea9('0x3e')]=qs[_0xeea9('0x3f')](_0x4b6777[_0xeea9('0x37')]['sort']);_0x9ff4f3[_0xeea9('0x40')]=qs['filters'](_[_0xeea9('0x41')](_0x4b6777[_0xeea9('0x37')],_0x3485aa[_0xeea9('0x42')]),_0x235c48);if(_0x4b6777['query'][_0xeea9('0x43')]){_0x9ff4f3['where']=_[_0xeea9('0x44')](_0x9ff4f3[_0xeea9('0x40')],{'$or':_['map'](_0x235c48,function(_0x28f2cc){if(_0x28f2cc[_0xeea9('0x33')]!=='VIRTUAL'){var _0x241a0a={};_0x241a0a[_0x28f2cc[_0xeea9('0x2e')]]={'$like':'%'+_0x4b6777[_0xeea9('0x37')][_0xeea9('0x43')]+'%'};return _0x241a0a;}})});}_0x9ff4f3=_['merge']({},_0x9ff4f3,_0x4b6777[_0xeea9('0x45')]);var _0x3098b4={'where':_0x9ff4f3[_0xeea9('0x40')]};return db['SquareOdbc'][_0xeea9('0x22')](_0x3098b4)[_0xeea9('0x28')](function(_0x5ebde6){_0x6d7dab[_0xeea9('0x22')]=_0x5ebde6;if(_0x4b6777[_0xeea9('0x37')][_0xeea9('0x46')]){_0x9ff4f3[_0xeea9('0x47')]=[{'all':!![]}];}return db['SquareOdbc'][_0xeea9('0x48')](_0x9ff4f3);})[_0xeea9('0x28')](function(_0x5ba5c1){_0x6d7dab[_0xeea9('0x49')]=_0x5ba5c1;return _0x6d7dab;})[_0xeea9('0x28')](respondWithFilteredResult(_0x1e8d3b,_0x9ff4f3))['catch'](handleError(_0x1e8d3b,null));};exports['show']=function(_0x4aecc4,_0x25ea26){var _0x25c761={'raw':!![],'where':{'id':_0x4aecc4[_0xeea9('0x4a')]['id']}},_0x5ab508={};_0x5ab508[_0xeea9('0x35')]=_[_0xeea9('0x4b')](db['SquareOdbc'][_0xeea9('0x4c')]);_0x5ab508[_0xeea9('0x37')]=_[_0xeea9('0x4b')](_0x4aecc4[_0xeea9('0x37')]);_0x5ab508[_0xeea9('0x42')]=_[_0xeea9('0x39')](_0x5ab508['model'],_0x5ab508['query']);_0x25c761[_0xeea9('0x38')]=_[_0xeea9('0x39')](_0x5ab508[_0xeea9('0x35')],qs[_0xeea9('0x3a')](_0x4aecc4[_0xeea9('0x37')][_0xeea9('0x3a')]));_0x25c761['attributes']=_0x25c761['attributes'][_0xeea9('0x3b')]?_0x25c761[_0xeea9('0x38')]:_0x5ab508[_0xeea9('0x35')];if(_0x4aecc4[_0xeea9('0x37')][_0xeea9('0x46')]){_0x25c761['include']=[{'all':!![]}];}_0x25c761=_[_0xeea9('0x44')]({},_0x25c761,_0x4aecc4[_0xeea9('0x45')]);return db[_0xeea9('0x31')][_0xeea9('0x4d')](_0x25c761)[_0xeea9('0x28')](handleEntityNotFound(_0x25ea26,null))[_0xeea9('0x28')](respondWithResult(_0x25ea26,null))[_0xeea9('0x4e')](handleError(_0x25ea26,null));};exports['create']=function(_0x81cc6f,_0x3b6281){return db[_0xeea9('0x31')][_0xeea9('0x4f')](_0x81cc6f[_0xeea9('0x50')],{})[_0xeea9('0x28')](function(_0x5d50f1){var _0x5ac6f5=_0x81cc6f['user'][_0xeea9('0x2a')]({'plain':!![]});if(!_0x5ac6f5)throw new Error(_0xeea9('0x51'));if(_0x5ac6f5[_0xeea9('0x52')]===_0xeea9('0x53')){var _0x2cbe10=_0x5d50f1[_0xeea9('0x2a')]({'plain':!![]});var _0x413ec8=_0xeea9('0x54');return db[_0xeea9('0x55')]['find']({'where':{'name':_0x413ec8,'userProfileId':_0x5ac6f5[_0xeea9('0x56')]},'raw':!![]})['then'](function(_0x397805){if(_0x397805&&_0x397805['autoAssociation']===0x0){return db[_0xeea9('0x2b')][_0xeea9('0x4f')]({'name':_0x2cbe10[_0xeea9('0x2e')],'resourceId':_0x2cbe10['id'],'type':_0x397805['name'],'sectionId':_0x397805['id']},{})[_0xeea9('0x28')](function(){return _0x5d50f1;});}else{return _0x5d50f1;}})['catch'](function(_0x3f29d8){logger[_0xeea9('0x2c')](_0xeea9('0x57'),_0x3f29d8);throw _0x3f29d8;});}return _0x5d50f1;})[_0xeea9('0x28')](respondWithResult(_0x3b6281,0xc9))['catch'](handleError(_0x3b6281,null));};exports[_0xeea9('0x27')]=function(_0x506898,_0x4bb64f){if(_0x506898['body']['id']){delete _0x506898[_0xeea9('0x50')]['id'];}return db[_0xeea9('0x31')][_0xeea9('0x4d')]({'where':{'id':_0x506898['params']['id']}})[_0xeea9('0x28')](handleEntityNotFound(_0x4bb64f,null))[_0xeea9('0x28')](saveUpdates(_0x506898[_0xeea9('0x50')],null))[_0xeea9('0x28')](respondWithResult(_0x4bb64f,null))['catch'](handleError(_0x4bb64f,null));};exports['destroy']=function(_0xb1a7dc,_0x543374){return db[_0xeea9('0x31')][_0xeea9('0x4d')]({'where':{'id':_0xb1a7dc['params']['id']}})[_0xeea9('0x28')](handleEntityNotFound(_0x543374,null))[_0xeea9('0x28')](removeEntity(_0x543374,null))[_0xeea9('0x4e')](handleError(_0x543374,null));};exports[_0xeea9('0x58')]=function(_0x119368,_0x32fcd4,_0x2ef644){var _0x22030a;return db[_0xeea9('0x31')][_0xeea9('0x4d')]({'where':{'id':_0x119368[_0xeea9('0x4a')]['id']},'attributes':['id',_0xeea9('0x59')]})['then'](handleEntityNotFound(_0x32fcd4,null))[_0xeea9('0x28')](function(_0x185b4c){if(_0x185b4c){var _0x71cbfe=require('odbc')();_0x71cbfe[_0xeea9('0x5a')](_0x185b4c['dsn']);_0x71cbfe[_0xeea9('0x5b')]();return _0x185b4c;}})[_0xeea9('0x28')](respondWithResult(_0x32fcd4,null))[_0xeea9('0x4e')](handleError(_0x32fcd4,null));};
\ No newline at end of file
+var _0x1c5b=['show','params','find','create','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','dsn','odbc','openSync','closeSync','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','destroy','then','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch'];(function(_0x22455b,_0x4cfb68){var _0x21d8ee=function(_0x44b4db){while(--_0x44b4db){_0x22455b['push'](_0x22455b['shift']());}};_0x21d8ee(++_0x4cfb68);}(_0x1c5b,0x67));var _0xb1c5=function(_0x13fb1e,_0x3ad860){_0x13fb1e=_0x13fb1e-0x0;var _0x221fd3=_0x1c5b[_0x13fb1e];return _0x221fd3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb1c5('0x0'));var rp=require(_0xb1c5('0x1'));var moment=require(_0xb1c5('0x2'));var BPromise=require(_0xb1c5('0x3'));var Mustache=require(_0xb1c5('0x4'));var util=require(_0xb1c5('0x5'));var path=require(_0xb1c5('0x6'));var sox=require(_0xb1c5('0x7'));var csv=require(_0xb1c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1c5('0x9'));var _=require(_0xb1c5('0xa'));var squel=require('squel');var crypto=require(_0xb1c5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb1c5('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb1c5('0xd'));var Redis=require('ioredis');var authService=require(_0xb1c5('0xe'));var qs=require(_0xb1c5('0xf'));var as=require(_0xb1c5('0x10'));var hardwareService=require(_0xb1c5('0x11'));var logger=require(_0xb1c5('0x12'))(_0xb1c5('0x13'));var utils=require(_0xb1c5('0x14'));var config=require(_0xb1c5('0x15'));var licenseUtil=require(_0xb1c5('0x16'));var db=require(_0xb1c5('0x17'))['db'];function respondWithStatusCode(_0x510edb,_0x2127b7){_0x2127b7=_0x2127b7||0xcc;return function(_0x66179c){if(_0x66179c){return _0x510edb[_0xb1c5('0x18')](_0x2127b7);}return _0x510edb[_0xb1c5('0x19')](_0x2127b7)[_0xb1c5('0x1a')]();};}function respondWithResult(_0x1ab85d,_0x54b4f2){_0x54b4f2=_0x54b4f2||0xc8;return function(_0x40fd15){if(_0x40fd15){return _0x1ab85d[_0xb1c5('0x19')](_0x54b4f2)[_0xb1c5('0x1b')](_0x40fd15);}};}function respondWithFilteredResult(_0x537fb3,_0x3fdb7b){return function(_0x32dbc3){if(_0x32dbc3){var _0x34222a=typeof _0x3fdb7b[_0xb1c5('0x1c')]===_0xb1c5('0x1d')&&typeof _0x3fdb7b['limit']===_0xb1c5('0x1d');var _0x3d12f9=_0x32dbc3['count'];var _0x4a00fc=_0x34222a?0x0:_0x3fdb7b[_0xb1c5('0x1c')];var _0x415d47=_0x34222a?_0x32dbc3[_0xb1c5('0x1e')]:_0x3fdb7b[_0xb1c5('0x1c')]+_0x3fdb7b[_0xb1c5('0x1f')];var _0x10dc69;if(_0x415d47>=_0x3d12f9){_0x415d47=_0x3d12f9;_0x10dc69=0xc8;}else{_0x10dc69=0xce;}_0x537fb3[_0xb1c5('0x19')](_0x10dc69);return _0x537fb3[_0xb1c5('0x20')]('Content-Range',_0x4a00fc+'-'+_0x415d47+'/'+_0x3d12f9)[_0xb1c5('0x1b')](_0x32dbc3);}return null;};}function patchUpdates(_0x562696){return function(_0x8ac10b){try{jsonpatch[_0xb1c5('0x21')](_0x8ac10b,_0x562696,!![]);}catch(_0xe45578){return BPromise['reject'](_0xe45578);}return _0x8ac10b[_0xb1c5('0x22')]();};}function saveUpdates(_0x4b0968,_0x27c117){return function(_0x167576){if(_0x167576){return _0x167576[_0xb1c5('0x23')](_0x4b0968)['then'](function(_0x491c0a){return _0x491c0a;});}return null;};}function removeEntity(_0x46fca1,_0x3bd26c){return function(_0x2be5c4){if(_0x2be5c4){return _0x2be5c4[_0xb1c5('0x24')]()[_0xb1c5('0x25')](function(){var _0x215912=_0x2be5c4[_0xb1c5('0x26')]({'plain':!![]});var _0x14dac5=_0xb1c5('0x27');return db[_0xb1c5('0x28')][_0xb1c5('0x24')]({'where':{'type':_0x14dac5,'resourceId':_0x215912['id']}})[_0xb1c5('0x25')](function(){return _0x2be5c4;});})[_0xb1c5('0x25')](function(){_0x46fca1['status'](0xcc)[_0xb1c5('0x1a')]();});}};}function handleEntityNotFound(_0x5b45fe,_0x22cdff){return function(_0x278f4c){if(!_0x278f4c){_0x5b45fe[_0xb1c5('0x18')](0x194);}return _0x278f4c;};}function handleError(_0x4d52bb,_0xe6aabd){_0xe6aabd=_0xe6aabd||0x1f4;return function(_0x53dd35){logger[_0xb1c5('0x29')](_0x53dd35[_0xb1c5('0x2a')]);if(_0x53dd35['name']){delete _0x53dd35[_0xb1c5('0x2b')];}_0x4d52bb[_0xb1c5('0x19')](_0xe6aabd)[_0xb1c5('0x2c')](_0x53dd35);};}exports[_0xb1c5('0x2d')]=function(_0x529cb5,_0x5a3977){var _0x485fd3={},_0x510064={},_0x34f5e4={'count':0x0,'rows':[]};var _0x3cb8ad=_[_0xb1c5('0x2e')](db[_0xb1c5('0x2f')][_0xb1c5('0x30')],function(_0x28b9c9){return{'name':_0x28b9c9['fieldName'],'type':_0x28b9c9[_0xb1c5('0x31')][_0xb1c5('0x32')]};});_0x510064[_0xb1c5('0x33')]=_[_0xb1c5('0x2e')](_0x3cb8ad,_0xb1c5('0x2b'));_0x510064[_0xb1c5('0x34')]=_[_0xb1c5('0x35')](_0x529cb5[_0xb1c5('0x34')]);_0x510064[_0xb1c5('0x36')]=_[_0xb1c5('0x37')](_0x510064[_0xb1c5('0x33')],_0x510064[_0xb1c5('0x34')]);_0x485fd3[_0xb1c5('0x38')]=_['intersection'](_0x510064[_0xb1c5('0x33')],qs['fields'](_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x39')]));_0x485fd3[_0xb1c5('0x38')]=_0x485fd3[_0xb1c5('0x38')][_0xb1c5('0x3a')]?_0x485fd3[_0xb1c5('0x38')]:_0x510064[_0xb1c5('0x33')];if(!_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x3b')](_0xb1c5('0x3c'))){_0x485fd3['limit']=qs['limit'](_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x1f')]);_0x485fd3[_0xb1c5('0x1c')]=qs[_0xb1c5('0x1c')](_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x1c')]);}_0x485fd3[_0xb1c5('0x3d')]=qs[_0xb1c5('0x3e')](_0x529cb5['query'][_0xb1c5('0x3e')]);_0x485fd3['where']=qs[_0xb1c5('0x36')](_[_0xb1c5('0x3f')](_0x529cb5[_0xb1c5('0x34')],_0x510064['filters']),_0x3cb8ad);if(_0x529cb5['query'][_0xb1c5('0x40')]){_0x485fd3[_0xb1c5('0x41')]=_[_0xb1c5('0x42')](_0x485fd3['where'],{'$or':_[_0xb1c5('0x2e')](_0x3cb8ad,function(_0x52984b){if(_0x52984b[_0xb1c5('0x31')]!==_0xb1c5('0x43')){var _0x5c768c={};_0x5c768c[_0x52984b[_0xb1c5('0x2b')]]={'$like':'%'+_0x529cb5['query'][_0xb1c5('0x40')]+'%'};return _0x5c768c;}})});}_0x485fd3=_['merge']({},_0x485fd3,_0x529cb5[_0xb1c5('0x44')]);var _0x178e6a={'where':_0x485fd3[_0xb1c5('0x41')]};return db[_0xb1c5('0x2f')][_0xb1c5('0x1e')](_0x178e6a)[_0xb1c5('0x25')](function(_0x2a451){_0x34f5e4[_0xb1c5('0x1e')]=_0x2a451;if(_0x529cb5[_0xb1c5('0x34')][_0xb1c5('0x45')]){_0x485fd3[_0xb1c5('0x46')]=[{'all':!![]}];}return db[_0xb1c5('0x2f')][_0xb1c5('0x47')](_0x485fd3);})[_0xb1c5('0x25')](function(_0x2f639c){_0x34f5e4['rows']=_0x2f639c;return _0x34f5e4;})['then'](respondWithFilteredResult(_0x5a3977,_0x485fd3))[_0xb1c5('0x48')](handleError(_0x5a3977,null));};exports[_0xb1c5('0x49')]=function(_0x1c02d4,_0x5086c3){var _0x2ab12d={'raw':!![],'where':{'id':_0x1c02d4[_0xb1c5('0x4a')]['id']}},_0x4d3872={};_0x4d3872[_0xb1c5('0x33')]=_[_0xb1c5('0x35')](db['SquareOdbc']['rawAttributes']);_0x4d3872[_0xb1c5('0x34')]=_['keys'](_0x1c02d4[_0xb1c5('0x34')]);_0x4d3872['filters']=_[_0xb1c5('0x37')](_0x4d3872[_0xb1c5('0x33')],_0x4d3872[_0xb1c5('0x34')]);_0x2ab12d['attributes']=_[_0xb1c5('0x37')](_0x4d3872['model'],qs['fields'](_0x1c02d4[_0xb1c5('0x34')][_0xb1c5('0x39')]));_0x2ab12d['attributes']=_0x2ab12d[_0xb1c5('0x38')]['length']?_0x2ab12d[_0xb1c5('0x38')]:_0x4d3872[_0xb1c5('0x33')];if(_0x1c02d4['query'][_0xb1c5('0x45')]){_0x2ab12d['include']=[{'all':!![]}];}_0x2ab12d=_['merge']({},_0x2ab12d,_0x1c02d4[_0xb1c5('0x44')]);return db[_0xb1c5('0x2f')][_0xb1c5('0x4b')](_0x2ab12d)[_0xb1c5('0x25')](handleEntityNotFound(_0x5086c3,null))[_0xb1c5('0x25')](respondWithResult(_0x5086c3,null))['catch'](handleError(_0x5086c3,null));};exports[_0xb1c5('0x4c')]=function(_0x5a0774,_0x245015){return db[_0xb1c5('0x2f')][_0xb1c5('0x4c')](_0x5a0774['body'],{})[_0xb1c5('0x25')](function(_0x2fcfdd){var _0x13a71f=_0x5a0774[_0xb1c5('0x4d')][_0xb1c5('0x26')]({'plain':!![]});if(!_0x13a71f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13a71f['role']===_0xb1c5('0x4d')){var _0x4b3f67=_0x2fcfdd[_0xb1c5('0x26')]({'plain':!![]});var _0x10d479=_0xb1c5('0x27');return db[_0xb1c5('0x4e')][_0xb1c5('0x4b')]({'where':{'name':_0x10d479,'userProfileId':_0x13a71f[_0xb1c5('0x4f')]},'raw':!![]})[_0xb1c5('0x25')](function(_0x462ab8){if(_0x462ab8&&_0x462ab8[_0xb1c5('0x50')]===0x0){return db['UserProfileResource'][_0xb1c5('0x4c')]({'name':_0x4b3f67['name'],'resourceId':_0x4b3f67['id'],'type':_0x462ab8[_0xb1c5('0x2b')],'sectionId':_0x462ab8['id']},{})['then'](function(){return _0x2fcfdd;});}else{return _0x2fcfdd;}})['catch'](function(_0x164e50){logger['error'](_0xb1c5('0x51'),_0x164e50);throw _0x164e50;});}return _0x2fcfdd;})[_0xb1c5('0x25')](respondWithResult(_0x245015,0xc9))[_0xb1c5('0x48')](handleError(_0x245015,null));};exports[_0xb1c5('0x23')]=function(_0x30213d,_0x492adf){if(_0x30213d[_0xb1c5('0x52')]['id']){delete _0x30213d['body']['id'];}return db[_0xb1c5('0x2f')][_0xb1c5('0x4b')]({'where':{'id':_0x30213d[_0xb1c5('0x4a')]['id']}})[_0xb1c5('0x25')](handleEntityNotFound(_0x492adf,null))[_0xb1c5('0x25')](saveUpdates(_0x30213d[_0xb1c5('0x52')],null))['then'](respondWithResult(_0x492adf,null))[_0xb1c5('0x48')](handleError(_0x492adf,null));};exports[_0xb1c5('0x24')]=function(_0x43c5cc,_0x2dd345){return db[_0xb1c5('0x2f')][_0xb1c5('0x4b')]({'where':{'id':_0x43c5cc['params']['id']}})[_0xb1c5('0x25')](handleEntityNotFound(_0x2dd345,null))['then'](removeEntity(_0x2dd345,null))[_0xb1c5('0x48')](handleError(_0x2dd345,null));};exports[_0xb1c5('0x53')]=function(_0x38b304,_0x80ace7,_0x20197e){var _0x2e09e4;return db['SquareOdbc'][_0xb1c5('0x4b')]({'where':{'id':_0x38b304[_0xb1c5('0x4a')]['id']},'attributes':['id',_0xb1c5('0x54')]})[_0xb1c5('0x25')](handleEntityNotFound(_0x80ace7,null))['then'](function(_0x2e3937){if(_0x2e3937){var _0x3b91c4=require(_0xb1c5('0x55'))();_0x3b91c4[_0xb1c5('0x56')](_0x2e3937[_0xb1c5('0x54')]);_0x3b91c4[_0xb1c5('0x57')]();return _0x2e3937;}})[_0xb1c5('0x25')](respondWithResult(_0x80ace7,null))[_0xb1c5('0x48')](handleError(_0x80ace7,null));};
\ No newline at end of file
index e42752c..32772b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c1=['api','moment','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xb8c1,0x76));var _0x1b8c=function(_0x46fbf2,_0x5fcdc9){_0x46fbf2=_0x46fbf2-0x0;var _0x29b223=_0xb8c1[_0x46fbf2];return _0x29b223;};'use strict';var _=require(_0x1b8c('0x0'));var util=require(_0x1b8c('0x1'));var logger=require('../../config/logger')(_0x1b8c('0x2'));var moment=require(_0x1b8c('0x3'));var BPromise=require('bluebird');var rp=require(_0x1b8c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b8c('0x5'));var config=require(_0x1b8c('0x6'));var attributes=require(_0x1b8c('0x7'));module[_0x1b8c('0x8')]=function(_0xdfba78,_0x39cb36){return _0xdfba78[_0x1b8c('0x9')](_0x1b8c('0xa'),attributes,{'tableName':_0x1b8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb506=['SquareOdbc','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x45adb4,_0x2abb06){var _0x137296=function(_0x552ec9){while(--_0x552ec9){_0x45adb4['push'](_0x45adb4['shift']());}};_0x137296(++_0x2abb06);}(_0xb506,0x18d));var _0x6b50=function(_0x473547,_0x423c77){_0x473547=_0x473547-0x0;var _0x14d75d=_0xb506[_0x473547];return _0x14d75d;};'use strict';var _=require(_0x6b50('0x0'));var util=require(_0x6b50('0x1'));var logger=require(_0x6b50('0x2'))(_0x6b50('0x3'));var moment=require(_0x6b50('0x4'));var BPromise=require(_0x6b50('0x5'));var rp=require(_0x6b50('0x6'));var fs=require('fs');var path=require(_0x6b50('0x7'));var rimraf=require(_0x6b50('0x8'));var config=require(_0x6b50('0x9'));var attributes=require('./squareOdbc.attributes');module[_0x6b50('0xa')]=function(_0x59a756,_0x3eb1a9){return _0x59a756['define'](_0x6b50('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 94158a8..ac4f1a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4ff=['ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','SquareOdbc,\x20%s,\x20%s','message','result','catch'];(function(_0x3245f7,_0x26bfad){var _0x472f77=function(_0x391589){while(--_0x391589){_0x3245f7['push'](_0x3245f7['shift']());}};_0x472f77(++_0x26bfad);}(_0xf4ff,0x69));var _0xff4f=function(_0x2ddd8b,_0x344f2c){_0x2ddd8b=_0x2ddd8b-0x0;var _0x5bc3a4=_0xf4ff[_0x2ddd8b];return _0x5bc3a4;};'use strict';var _=require('lodash');var util=require(_0xff4f('0x0'));var moment=require(_0xff4f('0x1'));var BPromise=require(_0xff4f('0x2'));var rs=require(_0xff4f('0x3'));var fs=require('fs');var Redis=require(_0xff4f('0x4'));var db=require(_0xff4f('0x5'))['db'];var utils=require(_0xff4f('0x6'));var logger=require(_0xff4f('0x7'))(_0xff4f('0x8'));var config=require(_0xff4f('0x9'));var jayson=require(_0xff4f('0xa'));var client=jayson[_0xff4f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48c48e,_0x412d3a,_0x231e41){return new BPromise(function(_0xe67e05,_0x1d6bac){return client[_0xff4f('0xc')](_0x48c48e,_0x231e41)[_0xff4f('0xd')](function(_0x49a98c){logger[_0xff4f('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x412d3a,_0xff4f('0xf'));logger[_0xff4f('0x10')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x412d3a,_0xff4f('0xf'),JSON[_0xff4f('0x11')](_0x49a98c));if(_0x49a98c[_0xff4f('0x12')]){if(_0x49a98c[_0xff4f('0x12')]['code']===0x1f4){logger[_0xff4f('0x12')](_0xff4f('0x13'),_0x412d3a,_0x49a98c[_0xff4f('0x12')][_0xff4f('0x14')]);return _0x1d6bac(_0x49a98c[_0xff4f('0x12')][_0xff4f('0x14')]);}logger[_0xff4f('0x12')](_0xff4f('0x13'),_0x412d3a,_0x49a98c[_0xff4f('0x12')]['message']);return _0xe67e05(_0x49a98c[_0xff4f('0x12')][_0xff4f('0x14')]);}else{logger['info'](_0xff4f('0x13'),_0x412d3a,_0xff4f('0xf'));_0xe67e05(_0x49a98c[_0xff4f('0x15')]['message']);}})[_0xff4f('0x16')](function(_0x56ce7a){logger['error'](_0xff4f('0x13'),_0x412d3a,_0x56ce7a);_0x1d6bac(_0x56ce7a);});});}exports[_0xff4f('0x17')]=function(_0x48a649){var _0x3a0ee4=this;return new Promise(function(_0x278096,_0x252e62){return db[_0xff4f('0x18')][_0xff4f('0x19')]({'raw':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1b')]===undefined?!![]:![]:!![],'where':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1c')]||null:null,'attributes':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1d')]||null:null,'include':_0x48a649[_0xff4f('0x1a')]?_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1e')]?_['map'](_0x48a649[_0xff4f('0x1a')][_0xff4f('0x1e')],function(_0x593ff1){return{'model':db[_0x593ff1[_0xff4f('0x1f')]],'as':_0x593ff1['as'],'attributes':_0x593ff1[_0xff4f('0x1d')],'include':_0x593ff1[_0xff4f('0x1e')]?_['map'](_0x593ff1[_0xff4f('0x1e')],function(_0x40e675){return{'model':db[_0x40e675[_0xff4f('0x1f')]],'as':_0x40e675['as'],'attributes':_0x40e675[_0xff4f('0x1d')],'include':_0x40e675[_0xff4f('0x1e')]?_['map'](_0x40e675[_0xff4f('0x1e')],function(_0x5e38e1){return{'model':db[_0x5e38e1[_0xff4f('0x1f')]],'as':_0x5e38e1['as'],'attributes':_0x5e38e1['attributes']};}):[]};}):[]};}):[]:[]})[_0xff4f('0xd')](function(_0x54343d){logger['info'](_0xff4f('0x17'),_0x48a649);logger[_0xff4f('0x10')]('ShowSquareOdbc',_0x48a649,JSON['stringify'](_0x54343d));_0x278096(_0x54343d);})[_0xff4f('0x16')](function(_0x423494){logger['error'](_0xff4f('0x17'),_0x423494['message'],_0x48a649);_0x252e62(_0x3a0ee4[_0xff4f('0x12')](0x1f4,_0x423494[_0xff4f('0x14')]));});});};
\ No newline at end of file
+var _0x0484=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','model','map','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x4229d8,_0x2c79a6){var _0x38a525=function(_0x8ebc8b){while(--_0x8ebc8b){_0x4229d8['push'](_0x4229d8['shift']());}};_0x38a525(++_0x2c79a6);}(_0x0484,0xd6));var _0x4048=function(_0x5d02fb,_0x518ec3){_0x5d02fb=_0x5d02fb-0x0;var _0x4c179e=_0x0484[_0x5d02fb];return _0x4c179e;};'use strict';var _=require(_0x4048('0x0'));var util=require('util');var moment=require(_0x4048('0x1'));var BPromise=require(_0x4048('0x2'));var rs=require(_0x4048('0x3'));var fs=require('fs');var Redis=require(_0x4048('0x4'));var db=require(_0x4048('0x5'))['db'];var utils=require(_0x4048('0x6'));var logger=require(_0x4048('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4048('0x8'));var client=jayson[_0x4048('0x9')][_0x4048('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb45620,_0x5327ee,_0x310499){return new BPromise(function(_0x35366c,_0x2c2eba){return client[_0x4048('0xb')](_0xb45620,_0x310499)['then'](function(_0x309f51){logger[_0x4048('0xc')](_0x4048('0xd'),_0x5327ee,_0x4048('0xe'));logger[_0x4048('0xf')](_0x4048('0x10'),_0x5327ee,_0x4048('0xe'),JSON[_0x4048('0x11')](_0x309f51));if(_0x309f51[_0x4048('0x12')]){if(_0x309f51['error'][_0x4048('0x13')]===0x1f4){logger[_0x4048('0x12')](_0x4048('0xd'),_0x5327ee,_0x309f51[_0x4048('0x12')][_0x4048('0x14')]);return _0x2c2eba(_0x309f51[_0x4048('0x12')][_0x4048('0x14')]);}logger[_0x4048('0x12')](_0x4048('0xd'),_0x5327ee,_0x309f51[_0x4048('0x12')]['message']);return _0x35366c(_0x309f51[_0x4048('0x12')][_0x4048('0x14')]);}else{logger[_0x4048('0xc')](_0x4048('0xd'),_0x5327ee,_0x4048('0xe'));_0x35366c(_0x309f51[_0x4048('0x15')][_0x4048('0x14')]);}})[_0x4048('0x16')](function(_0x174e13){logger[_0x4048('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x5327ee,_0x174e13);_0x2c2eba(_0x174e13);});});}exports[_0x4048('0x17')]=function(_0x5d86ee){var _0x361da5=this;return new Promise(function(_0x53cbc5,_0x8df463){return db['SquareOdbc'][_0x4048('0x18')]({'raw':_0x5d86ee[_0x4048('0x19')]?_0x5d86ee[_0x4048('0x19')][_0x4048('0x1a')]===undefined?!![]:![]:!![],'where':_0x5d86ee[_0x4048('0x19')]?_0x5d86ee['options'][_0x4048('0x1b')]||null:null,'attributes':_0x5d86ee['options']?_0x5d86ee[_0x4048('0x19')][_0x4048('0x1c')]||null:null,'include':_0x5d86ee[_0x4048('0x19')]?_0x5d86ee['options']['include']?_['map'](_0x5d86ee[_0x4048('0x19')][_0x4048('0x1d')],function(_0x4ef0e3){return{'model':db[_0x4ef0e3[_0x4048('0x1e')]],'as':_0x4ef0e3['as'],'attributes':_0x4ef0e3[_0x4048('0x1c')],'include':_0x4ef0e3[_0x4048('0x1d')]?_[_0x4048('0x1f')](_0x4ef0e3['include'],function(_0x2564e1){return{'model':db[_0x2564e1[_0x4048('0x1e')]],'as':_0x2564e1['as'],'attributes':_0x2564e1[_0x4048('0x1c')],'include':_0x2564e1[_0x4048('0x1d')]?_[_0x4048('0x1f')](_0x2564e1[_0x4048('0x1d')],function(_0x324001){return{'model':db[_0x324001[_0x4048('0x1e')]],'as':_0x324001['as'],'attributes':_0x324001[_0x4048('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4048('0x20')](function(_0x1e98c1){logger[_0x4048('0xc')](_0x4048('0x17'),_0x5d86ee);logger['debug'](_0x4048('0x17'),_0x5d86ee,JSON[_0x4048('0x11')](_0x1e98c1));_0x53cbc5(_0x1e98c1);})[_0x4048('0x16')](function(_0x1b1e60){logger[_0x4048('0x12')](_0x4048('0x17'),_0x1b1e60[_0x4048('0x14')],_0x5d86ee);_0x8df463(_0x361da5['error'](0x1f4,_0x1b1e60[_0x4048('0x14')]));});});};
\ No newline at end of file
index 19e127c..9ebabfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3564=['delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x45fe9c,_0x55e0d7){var _0x233d48=function(_0xa2ba2e){while(--_0xa2ba2e){_0x45fe9c['push'](_0x45fe9c['shift']());}};_0x233d48(++_0x55e0d7);}(_0x3564,0x87));var _0x4356=function(_0x15bb88,_0x566455){_0x15bb88=_0x15bb88-0x0;var _0x460e34=_0x3564[_0x15bb88];return _0x460e34;};'use strict';var multer=require(_0x4356('0x0'));var util=require(_0x4356('0x1'));var path=require(_0x4356('0x2'));var timeout=require(_0x4356('0x3'));var express=require(_0x4356('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4356('0x5'));var interaction=require(_0x4356('0x6'));var config=require(_0x4356('0x7'));var controller=require('./squareProject.controller');router[_0x4356('0x8')]('/',auth[_0x4356('0x9')](),controller[_0x4356('0xa')]);router['get']('/:id',auth[_0x4356('0x9')](),controller[_0x4356('0xb')]);router[_0x4356('0xc')]('/',auth[_0x4356('0x9')](),controller[_0x4356('0xd')]);router[_0x4356('0xe')](_0x4356('0xf'),auth[_0x4356('0x9')](),controller[_0x4356('0x10')]);router[_0x4356('0x11')](_0x4356('0xf'),auth[_0x4356('0x9')](),controller[_0x4356('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x71af=['isAuthenticated','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./squareProject.controller','get','show','post'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x71af,0x115));var _0xf71a=function(_0x116243,_0x5c6473){_0x116243=_0x116243-0x0;var _0x3a8bff=_0x71af[_0x116243];return _0x3a8bff;};'use strict';var multer=require(_0xf71a('0x0'));var util=require(_0xf71a('0x1'));var path=require(_0xf71a('0x2'));var timeout=require(_0xf71a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf71a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf71a('0x5'));var config=require(_0xf71a('0x6'));var controller=require(_0xf71a('0x7'));router[_0xf71a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf71a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xf71a('0x9')]);router[_0xf71a('0xa')]('/',auth[_0xf71a('0xb')](),controller[_0xf71a('0xc')]);router[_0xf71a('0xd')](_0xf71a('0xe'),auth[_0xf71a('0xb')](),controller[_0xf71a('0xf')]);router[_0xf71a('0x10')]('/:id',auth[_0xf71a('0xb')](),controller[_0xf71a('0x11')]);module['exports']=router;
\ No newline at end of file
index f70e2f0..ab361a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x973f=['getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x379109,_0x53e490){var _0xa78d6d=function(_0x554a53){while(--_0x554a53){_0x379109['push'](_0x379109['shift']());}};_0xa78d6d(++_0x53e490);}(_0x973f,0x18d));var _0xf973=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x973f[_0xc0a3d3];return _0x3386e8;};'use strict';var Sequelize=require(_0xf973('0x0'));module[_0xf973('0x1')]={'name':{'type':Sequelize[_0xf973('0x2')],'unique':_0xf973('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf973('0x2')]},'notes':{'type':Sequelize[_0xf973('0x4')]},'preproduction':{'type':Sequelize[_0xf973('0x5')]('long'),'get':function(){if(this[_0xf973('0x6')]('preproduction')){return this[_0xf973('0x6')](_0xf973('0x7'))[_0xf973('0x8')](_0xf973('0x9'));}}},'production':{'type':Sequelize['BLOB'](_0xf973('0xa')),'get':function(){if(this[_0xf973('0x6')](_0xf973('0xb'))){return this[_0xf973('0x6')](_0xf973('0xb'))['toString'](_0xf973('0x9'));}}},'savedAt':{'type':Sequelize[_0xf973('0xc')]},'publishedAt':{'type':Sequelize[_0xf973('0xc')]}};
\ No newline at end of file
+var _0x2539=['exports','BLOB','preproduction','getDataValue','toString','long','production','utf8','DATE'];(function(_0x1896d2,_0x38e977){var _0xd06e7=function(_0x2ef043){while(--_0x2ef043){_0x1896d2['push'](_0x1896d2['shift']());}};_0xd06e7(++_0x38e977);}(_0x2539,0x1e6));var _0x9253=function(_0x621d18,_0x52fd00){_0x621d18=_0x621d18-0x0;var _0x2a9400=_0x2539[_0x621d18];return _0x2a9400;};'use strict';var Sequelize=require('sequelize');module[_0x9253('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x9253('0x1')]('long'),'get':function(){if(this['getDataValue'](_0x9253('0x2'))){return this[_0x9253('0x3')](_0x9253('0x2'))[_0x9253('0x4')]('utf8');}}},'production':{'type':Sequelize[_0x9253('0x1')](_0x9253('0x5')),'get':function(){if(this[_0x9253('0x3')]('production')){return this[_0x9253('0x3')](_0x9253('0x6'))['toString'](_0x9253('0x7'));}}},'savedAt':{'type':Sequelize[_0x9253('0x8')]},'publishedAt':{'type':Sequelize[_0x9253('0x8')]}};
\ No newline at end of file
index f626f49..a6478bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39cf=['agi','pick','production','lodash','ioredis','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','register','status','offset','limit','undefined','count','set','Content-Range','then','destroy','get','SquareProjects','UserProfileResource','stringify','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','options','SquareProject','includeAll','findAll','rows','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','publish'];(function(_0x317ecb,_0x3650ec){var _0x4f0baf=function(_0x10b0ce){while(--_0x10b0ce){_0x317ecb['push'](_0x317ecb['shift']());}};_0x4f0baf(++_0x3650ec);}(_0x39cf,0x8b));var _0xf39c=function(_0x5805d7,_0x3d584a){_0x5805d7=_0x5805d7-0x0;var _0x170fe4=_0x39cf[_0x5805d7];return _0x170fe4;};'use strict';var _=require(_0xf39c('0x0'));var Redis=require(_0xf39c('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0xf39c('0x2'))('api');var config=require(_0xf39c('0x3'));var db=require(_0xf39c('0x4'))['db'];config['redis']=_[_0xf39c('0x5')](config[_0xf39c('0x6')],{'host':_0xf39c('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf39c('0x6')]));require('./squareProject.socket')[_0xf39c('0x8')](socket);function respondWithResult(_0x1fb96b,_0x4f04aa){_0x4f04aa=_0x4f04aa||0xc8;return function(_0x4c0647){if(_0x4c0647){return _0x1fb96b[_0xf39c('0x9')](_0x4f04aa)['json'](_0x4c0647);}};}function respondWithFilteredResult(_0x5f58f7,_0x64273c){return function(_0xdf6c49){if(_0xdf6c49){var _0x12c22a=typeof _0x64273c[_0xf39c('0xa')]==='undefined'&&typeof _0x64273c[_0xf39c('0xb')]===_0xf39c('0xc');var _0xfb9335=_0xdf6c49[_0xf39c('0xd')];var _0x487c0c=_0x12c22a?0x0:_0x64273c[_0xf39c('0xa')];var _0x13372b=_0x12c22a?_0xdf6c49[_0xf39c('0xd')]:_0x64273c[_0xf39c('0xa')]+_0x64273c[_0xf39c('0xb')];var _0x1dc900;if(_0x13372b>=_0xfb9335){_0x13372b=_0xfb9335;_0x1dc900=0xc8;}else{_0x1dc900=0xce;}_0x5f58f7[_0xf39c('0x9')](_0x1dc900);return _0x5f58f7[_0xf39c('0xe')](_0xf39c('0xf'),_0x487c0c+'-'+_0x13372b+'/'+_0xfb9335)['json'](_0xdf6c49);}return null;};}function saveUpdates(_0x4ef1e4){return function(_0x1f96f5){if(_0x1f96f5){return _0x1f96f5['update'](_0x4ef1e4)[_0xf39c('0x10')](function(_0x54f616){return _0x54f616;});}return null;};}function removeEntity(_0x1ed3c6){return function(_0x3b2c91){if(_0x3b2c91){return _0x3b2c91[_0xf39c('0x11')]()[_0xf39c('0x10')](function(){var _0xd7011f=_0x3b2c91[_0xf39c('0x12')]({'plain':!![]});var _0x890466=_0xf39c('0x13');return db[_0xf39c('0x14')]['destroy']({'where':{'type':_0x890466,'resourceId':_0xd7011f['id']}})[_0xf39c('0x10')](function(){return _0x3b2c91;});})[_0xf39c('0x10')](function(){var _0x152a14=new Redis(config['redis']);_0x152a14['publish']('agi',JSON[_0xf39c('0x15')]({'id':_0x3b2c91['id'],'deleted':!![]}));})['then'](function(){_0x1ed3c6[_0xf39c('0x9')](0xcc)[_0xf39c('0x16')]();});}};}function handleEntityNotFound(_0x4172f7){return function(_0x3e68d1){if(!_0x3e68d1){_0x4172f7['sendStatus'](0x194);}return _0x3e68d1;};}function handleError(_0x916b35,_0x13dd82){_0x13dd82=_0x13dd82||0x1f4;return function(_0x120c03){logger[_0xf39c('0x17')](_0x120c03[_0xf39c('0x18')]);if(_0x120c03[_0xf39c('0x19')]){delete _0x120c03[_0xf39c('0x19')];}_0x916b35['status'](_0x13dd82)[_0xf39c('0x1a')](_0x120c03);};}exports['index']=function(_0x2f15c1,_0x212013){var _0x10b098={},_0x11565d={},_0x3b0641={'count':0x0,'rows':[]};var _0xd624f9=_[_0xf39c('0x1b')](db['SquareProject'][_0xf39c('0x1c')],function(_0x16b707){return{'name':_0x16b707[_0xf39c('0x1d')],'type':_0x16b707['type'][_0xf39c('0x1e')]};});_0x11565d['model']=_[_0xf39c('0x1b')](_0xd624f9,'name');_0x11565d[_0xf39c('0x1f')]=_[_0xf39c('0x20')](_0x2f15c1['query']);_0x11565d[_0xf39c('0x21')]=_[_0xf39c('0x22')](_0x11565d[_0xf39c('0x23')],_0x11565d[_0xf39c('0x1f')]);_0x10b098[_0xf39c('0x24')]=_[_0xf39c('0x22')](_0x11565d[_0xf39c('0x23')],qs[_0xf39c('0x25')](_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0x25')]));_0x10b098[_0xf39c('0x24')]=_0x10b098[_0xf39c('0x24')][_0xf39c('0x26')]?_0x10b098[_0xf39c('0x24')]:_0x11565d[_0xf39c('0x23')];if(!_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0x27')](_0xf39c('0x28'))){_0x10b098['limit']=qs[_0xf39c('0xb')](_0x2f15c1[_0xf39c('0x1f')]['limit']);_0x10b098['offset']=qs[_0xf39c('0xa')](_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0xa')]);}_0x10b098[_0xf39c('0x29')]=qs[_0xf39c('0x2a')](_0x2f15c1['query'][_0xf39c('0x2a')]);_0x10b098[_0xf39c('0x2b')]=qs[_0xf39c('0x21')](_['pick'](_0x2f15c1['query'],_0x11565d[_0xf39c('0x21')]),_0xd624f9);if(_0x2f15c1['query']['filter']){_0x10b098[_0xf39c('0x2b')]=_[_0xf39c('0x2c')](_0x10b098[_0xf39c('0x2b')],{'$or':_[_0xf39c('0x1b')](_0xd624f9,function(_0x56314e){if(_0x56314e[_0xf39c('0x2d')]!=='VIRTUAL'){var _0x174233={};_0x174233[_0x56314e[_0xf39c('0x19')]]={'$like':'%'+_0x2f15c1[_0xf39c('0x1f')]['filter']+'%'};return _0x174233;}})});}_0x10b098=_[_0xf39c('0x2c')]({},_0x10b098,_0x2f15c1[_0xf39c('0x2e')]);var _0x4a4bb9={'where':_0x10b098[_0xf39c('0x2b')]};return db[_0xf39c('0x2f')][_0xf39c('0xd')](_0x4a4bb9)[_0xf39c('0x10')](function(_0x483487){_0x3b0641[_0xf39c('0xd')]=_0x483487;if(_0x2f15c1[_0xf39c('0x1f')][_0xf39c('0x30')]){_0x10b098['include']=[{'all':!![]}];}return db[_0xf39c('0x2f')][_0xf39c('0x31')](_0x10b098);})[_0xf39c('0x10')](function(_0x3f9ffa){_0x3b0641[_0xf39c('0x32')]=_0x3f9ffa;return _0x3b0641;})[_0xf39c('0x10')](respondWithFilteredResult(_0x212013,_0x10b098))[_0xf39c('0x33')](handleError(_0x212013,null));};exports[_0xf39c('0x34')]=function(_0x4ac72e,_0x5548a7){var _0x17351a={'raw':![],'where':{'id':_0x4ac72e[_0xf39c('0x35')]['id']}},_0x260cfd={};_0x260cfd[_0xf39c('0x23')]=_[_0xf39c('0x20')](db[_0xf39c('0x2f')][_0xf39c('0x1c')]);_0x260cfd[_0xf39c('0x1f')]=_['keys'](_0x4ac72e[_0xf39c('0x1f')]);_0x260cfd['filters']=_[_0xf39c('0x22')](_0x260cfd['model'],_0x260cfd[_0xf39c('0x1f')]);_0x17351a[_0xf39c('0x24')]=_[_0xf39c('0x22')](_0x260cfd[_0xf39c('0x23')],qs[_0xf39c('0x25')](_0x4ac72e[_0xf39c('0x1f')][_0xf39c('0x25')]));_0x17351a[_0xf39c('0x24')]=_0x17351a[_0xf39c('0x24')][_0xf39c('0x26')]?_0x17351a[_0xf39c('0x24')]:_0x260cfd['model'];if(_0x4ac72e[_0xf39c('0x1f')][_0xf39c('0x30')]){_0x17351a[_0xf39c('0x36')]=[{'all':!![]}];}_0x17351a=_[_0xf39c('0x2c')]({},_0x17351a,_0x4ac72e[_0xf39c('0x2e')]);return db[_0xf39c('0x2f')][_0xf39c('0x37')](_0x17351a)[_0xf39c('0x10')](handleEntityNotFound(_0x5548a7,null))[_0xf39c('0x10')](respondWithResult(_0x5548a7,null))[_0xf39c('0x33')](handleError(_0x5548a7,null));};exports[_0xf39c('0x38')]=function(_0x242f87,_0x3cd490){return db[_0xf39c('0x2f')]['create'](_0x242f87[_0xf39c('0x39')],{})['then'](function(_0x11657d){var _0x1f053e=_0x242f87['user'][_0xf39c('0x12')]({'plain':!![]});if(!_0x1f053e)throw new Error(_0xf39c('0x3a'));if(_0x1f053e[_0xf39c('0x3b')]===_0xf39c('0x3c')){var _0x1c4cf9=_0x11657d[_0xf39c('0x12')]({'plain':!![]});var _0x23fe76=_0xf39c('0x13');return db['UserProfileSection'][_0xf39c('0x37')]({'where':{'name':_0x23fe76,'userProfileId':_0x1f053e[_0xf39c('0x3d')]},'raw':!![]})[_0xf39c('0x10')](function(_0x2e3567){if(_0x2e3567&&_0x2e3567['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1c4cf9['name'],'resourceId':_0x1c4cf9['id'],'type':_0x2e3567[_0xf39c('0x19')],'sectionId':_0x2e3567['id']},{})['then'](function(){return _0x11657d;});}else{return _0x11657d;}})[_0xf39c('0x33')](function(_0x57fcb4){logger[_0xf39c('0x17')](_0xf39c('0x3e'),_0x57fcb4);throw _0x57fcb4;});}return _0x11657d;})[_0xf39c('0x10')](respondWithResult(_0x3cd490,0xc9))['catch'](handleError(_0x3cd490,null));};exports[_0xf39c('0x3f')]=function(_0x5029dd,_0x54d721){if(_0x5029dd['body']['id']){delete _0x5029dd[_0xf39c('0x39')]['id'];}return db[_0xf39c('0x2f')][_0xf39c('0x37')]({'where':{'id':_0x5029dd[_0xf39c('0x35')]['id']}})['then'](handleEntityNotFound(_0x54d721,null))[_0xf39c('0x10')](saveUpdates(_0x5029dd[_0xf39c('0x39')],null))[_0xf39c('0x10')](function(_0x4994ab){if(!_0x4994ab)return;var _0x1a6c6e=_0x4994ab[_0xf39c('0x12')]({'plain':!![]});return _0x1a6c6e;})[_0xf39c('0x10')](function(_0x5e4159){var _0x3e90c7=new Redis(config[_0xf39c('0x6')]);_0x3e90c7[_0xf39c('0x40')](_0xf39c('0x41'),JSON[_0xf39c('0x15')](_[_0xf39c('0x42')](_0x5e4159,['id',_0xf39c('0x19'),_0xf39c('0x43')])));return _0x5e4159;})[_0xf39c('0x10')](respondWithResult(_0x54d721,null))[_0xf39c('0x33')](handleError(_0x54d721,null));};exports[_0xf39c('0x11')]=function(_0x788573,_0x1a6303){return db['SquareProject'][_0xf39c('0x37')]({'where':{'id':_0x788573[_0xf39c('0x35')]['id']}})[_0xf39c('0x10')](handleEntityNotFound(_0x1a6303,null))['then'](removeEntity(_0x1a6303,null))[_0xf39c('0x33')](handleError(_0x1a6303,null));};
\ No newline at end of file
+var _0x82ba=['find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','stringify','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','end','sendStatus','error','stack','name','send','index','map','fieldName','type','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','SquareProject','includeAll','include','rows','catch','rawAttributes'];(function(_0x11720a,_0xb04a05){var _0x13cdd5=function(_0x47d14f){while(--_0x47d14f){_0x11720a['push'](_0x11720a['shift']());}};_0x13cdd5(++_0xb04a05);}(_0x82ba,0xea));var _0xa82b=function(_0x4211ac,_0x42ed02){_0x4211ac=_0x4211ac-0x0;var _0x2d3c64=_0x82ba[_0x4211ac];return _0x2d3c64;};'use strict';var _=require(_0xa82b('0x0'));var Redis=require(_0xa82b('0x1'));var qs=require(_0xa82b('0x2'));var logger=require(_0xa82b('0x3'))(_0xa82b('0x4'));var config=require(_0xa82b('0x5'));var db=require(_0xa82b('0x6'))['db'];config[_0xa82b('0x7')]=_[_0xa82b('0x8')](config['redis'],{'host':_0xa82b('0x9'),'port':0x18eb});var socket=require(_0xa82b('0xa'))(new Redis(config[_0xa82b('0x7')]));require(_0xa82b('0xb'))[_0xa82b('0xc')](socket);function respondWithResult(_0x1dfdef,_0x3d151a){_0x3d151a=_0x3d151a||0xc8;return function(_0x4d1fb8){if(_0x4d1fb8){return _0x1dfdef[_0xa82b('0xd')](_0x3d151a)[_0xa82b('0xe')](_0x4d1fb8);}};}function respondWithFilteredResult(_0x347ed4,_0x2dd22e){return function(_0x4ad31b){if(_0x4ad31b){var _0xf25e5c=typeof _0x2dd22e[_0xa82b('0xf')]===_0xa82b('0x10')&&typeof _0x2dd22e['limit']===_0xa82b('0x10');var _0xcdcab7=_0x4ad31b[_0xa82b('0x11')];var _0xd61cbf=_0xf25e5c?0x0:_0x2dd22e[_0xa82b('0xf')];var _0x1f1072=_0xf25e5c?_0x4ad31b[_0xa82b('0x11')]:_0x2dd22e[_0xa82b('0xf')]+_0x2dd22e[_0xa82b('0x12')];var _0x12f818;if(_0x1f1072>=_0xcdcab7){_0x1f1072=_0xcdcab7;_0x12f818=0xc8;}else{_0x12f818=0xce;}_0x347ed4['status'](_0x12f818);return _0x347ed4[_0xa82b('0x13')](_0xa82b('0x14'),_0xd61cbf+'-'+_0x1f1072+'/'+_0xcdcab7)[_0xa82b('0xe')](_0x4ad31b);}return null;};}function saveUpdates(_0x461a14){return function(_0x2ed5e7){if(_0x2ed5e7){return _0x2ed5e7[_0xa82b('0x15')](_0x461a14)[_0xa82b('0x16')](function(_0xbccd3c){return _0xbccd3c;});}return null;};}function removeEntity(_0x2ab762){return function(_0x4cf348){if(_0x4cf348){return _0x4cf348[_0xa82b('0x17')]()[_0xa82b('0x16')](function(){var _0x40d132=_0x4cf348[_0xa82b('0x18')]({'plain':!![]});var _0x1111b2=_0xa82b('0x19');return db[_0xa82b('0x1a')][_0xa82b('0x17')]({'where':{'type':_0x1111b2,'resourceId':_0x40d132['id']}})[_0xa82b('0x16')](function(){return _0x4cf348;});})['then'](function(){var _0x25a616=new Redis(config[_0xa82b('0x7')]);_0x25a616[_0xa82b('0x1b')](_0xa82b('0x1c'),JSON['stringify']({'id':_0x4cf348['id'],'deleted':!![]}));})[_0xa82b('0x16')](function(){_0x2ab762['status'](0xcc)[_0xa82b('0x1d')]();});}};}function handleEntityNotFound(_0x24c3a2){return function(_0x6ed59c){if(!_0x6ed59c){_0x24c3a2[_0xa82b('0x1e')](0x194);}return _0x6ed59c;};}function handleError(_0x1f03f4,_0x40f327){_0x40f327=_0x40f327||0x1f4;return function(_0x2c53e3){logger[_0xa82b('0x1f')](_0x2c53e3[_0xa82b('0x20')]);if(_0x2c53e3[_0xa82b('0x21')]){delete _0x2c53e3['name'];}_0x1f03f4[_0xa82b('0xd')](_0x40f327)[_0xa82b('0x22')](_0x2c53e3);};}exports[_0xa82b('0x23')]=function(_0x2166ec,_0x305c5a){var _0xbd9ee7={},_0xb904a5={},_0x169bd9={'count':0x0,'rows':[]};var _0x5646b0=_[_0xa82b('0x24')](db['SquareProject']['rawAttributes'],function(_0x46943d){return{'name':_0x46943d[_0xa82b('0x25')],'type':_0x46943d[_0xa82b('0x26')]['key']};});_0xb904a5['model']=_['map'](_0x5646b0,_0xa82b('0x21'));_0xb904a5[_0xa82b('0x27')]=_[_0xa82b('0x28')](_0x2166ec['query']);_0xb904a5['filters']=_[_0xa82b('0x29')](_0xb904a5[_0xa82b('0x2a')],_0xb904a5[_0xa82b('0x27')]);_0xbd9ee7[_0xa82b('0x2b')]=_[_0xa82b('0x29')](_0xb904a5['model'],qs[_0xa82b('0x2c')](_0x2166ec[_0xa82b('0x27')][_0xa82b('0x2c')]));_0xbd9ee7[_0xa82b('0x2b')]=_0xbd9ee7['attributes'][_0xa82b('0x2d')]?_0xbd9ee7[_0xa82b('0x2b')]:_0xb904a5[_0xa82b('0x2a')];if(!_0x2166ec['query']['hasOwnProperty'](_0xa82b('0x2e'))){_0xbd9ee7[_0xa82b('0x12')]=qs['limit'](_0x2166ec[_0xa82b('0x27')][_0xa82b('0x12')]);_0xbd9ee7[_0xa82b('0xf')]=qs['offset'](_0x2166ec[_0xa82b('0x27')]['offset']);}_0xbd9ee7[_0xa82b('0x2f')]=qs[_0xa82b('0x30')](_0x2166ec['query'][_0xa82b('0x30')]);_0xbd9ee7[_0xa82b('0x31')]=qs[_0xa82b('0x32')](_[_0xa82b('0x33')](_0x2166ec[_0xa82b('0x27')],_0xb904a5[_0xa82b('0x32')]),_0x5646b0);if(_0x2166ec[_0xa82b('0x27')][_0xa82b('0x34')]){_0xbd9ee7['where']=_['merge'](_0xbd9ee7['where'],{'$or':_[_0xa82b('0x24')](_0x5646b0,function(_0x437afa){if(_0x437afa[_0xa82b('0x26')]!==_0xa82b('0x35')){var _0x55562a={};_0x55562a[_0x437afa['name']]={'$like':'%'+_0x2166ec[_0xa82b('0x27')][_0xa82b('0x34')]+'%'};return _0x55562a;}})});}_0xbd9ee7=_[_0xa82b('0x36')]({},_0xbd9ee7,_0x2166ec[_0xa82b('0x37')]);var _0x1f5bb6={'where':_0xbd9ee7['where']};return db[_0xa82b('0x38')][_0xa82b('0x11')](_0x1f5bb6)['then'](function(_0x5d0e13){_0x169bd9[_0xa82b('0x11')]=_0x5d0e13;if(_0x2166ec[_0xa82b('0x27')][_0xa82b('0x39')]){_0xbd9ee7[_0xa82b('0x3a')]=[{'all':!![]}];}return db[_0xa82b('0x38')]['findAll'](_0xbd9ee7);})['then'](function(_0x5131df){_0x169bd9[_0xa82b('0x3b')]=_0x5131df;return _0x169bd9;})['then'](respondWithFilteredResult(_0x305c5a,_0xbd9ee7))[_0xa82b('0x3c')](handleError(_0x305c5a,null));};exports['show']=function(_0x32590c,_0x16eacf){var _0x533300={'raw':![],'where':{'id':_0x32590c['params']['id']}},_0x3dc72c={};_0x3dc72c[_0xa82b('0x2a')]=_[_0xa82b('0x28')](db[_0xa82b('0x38')][_0xa82b('0x3d')]);_0x3dc72c[_0xa82b('0x27')]=_[_0xa82b('0x28')](_0x32590c[_0xa82b('0x27')]);_0x3dc72c['filters']=_[_0xa82b('0x29')](_0x3dc72c[_0xa82b('0x2a')],_0x3dc72c[_0xa82b('0x27')]);_0x533300[_0xa82b('0x2b')]=_[_0xa82b('0x29')](_0x3dc72c[_0xa82b('0x2a')],qs['fields'](_0x32590c['query']['fields']));_0x533300[_0xa82b('0x2b')]=_0x533300[_0xa82b('0x2b')][_0xa82b('0x2d')]?_0x533300[_0xa82b('0x2b')]:_0x3dc72c[_0xa82b('0x2a')];if(_0x32590c[_0xa82b('0x27')]['includeAll']){_0x533300[_0xa82b('0x3a')]=[{'all':!![]}];}_0x533300=_[_0xa82b('0x36')]({},_0x533300,_0x32590c[_0xa82b('0x37')]);return db['SquareProject'][_0xa82b('0x3e')](_0x533300)[_0xa82b('0x16')](handleEntityNotFound(_0x16eacf,null))[_0xa82b('0x16')](respondWithResult(_0x16eacf,null))[_0xa82b('0x3c')](handleError(_0x16eacf,null));};exports[_0xa82b('0x3f')]=function(_0xf284b0,_0x4abd7a){return db[_0xa82b('0x38')][_0xa82b('0x3f')](_0xf284b0[_0xa82b('0x40')],{})['then'](function(_0x1d8dc4){var _0x3830d3=_0xf284b0['user'][_0xa82b('0x18')]({'plain':!![]});if(!_0x3830d3)throw new Error(_0xa82b('0x41'));if(_0x3830d3[_0xa82b('0x42')]===_0xa82b('0x43')){var _0x3f1d39=_0x1d8dc4[_0xa82b('0x18')]({'plain':!![]});var _0x1d4257=_0xa82b('0x19');return db[_0xa82b('0x44')]['find']({'where':{'name':_0x1d4257,'userProfileId':_0x3830d3[_0xa82b('0x45')]},'raw':!![]})[_0xa82b('0x16')](function(_0x17f329){if(_0x17f329&&_0x17f329[_0xa82b('0x46')]===0x0){return db[_0xa82b('0x1a')][_0xa82b('0x3f')]({'name':_0x3f1d39[_0xa82b('0x21')],'resourceId':_0x3f1d39['id'],'type':_0x17f329[_0xa82b('0x21')],'sectionId':_0x17f329['id']},{})['then'](function(){return _0x1d8dc4;});}else{return _0x1d8dc4;}})[_0xa82b('0x3c')](function(_0x17dd52){logger['error'](_0xa82b('0x47'),_0x17dd52);throw _0x17dd52;});}return _0x1d8dc4;})[_0xa82b('0x16')](respondWithResult(_0x4abd7a,0xc9))[_0xa82b('0x3c')](handleError(_0x4abd7a,null));};exports[_0xa82b('0x15')]=function(_0x4034ed,_0x515f9a){if(_0x4034ed[_0xa82b('0x40')]['id']){delete _0x4034ed[_0xa82b('0x40')]['id'];}return db[_0xa82b('0x38')][_0xa82b('0x3e')]({'where':{'id':_0x4034ed['params']['id']}})[_0xa82b('0x16')](handleEntityNotFound(_0x515f9a,null))[_0xa82b('0x16')](saveUpdates(_0x4034ed[_0xa82b('0x40')],null))['then'](function(_0x30f59f){if(!_0x30f59f)return;var _0x3cf7b2=_0x30f59f[_0xa82b('0x18')]({'plain':!![]});return _0x3cf7b2;})[_0xa82b('0x16')](function(_0x179f26){var _0xb9566b=new Redis(config['redis']);_0xb9566b[_0xa82b('0x1b')](_0xa82b('0x1c'),JSON[_0xa82b('0x48')](_[_0xa82b('0x33')](_0x179f26,['id',_0xa82b('0x21'),_0xa82b('0x49')])));return _0x179f26;})[_0xa82b('0x16')](respondWithResult(_0x515f9a,null))['catch'](handleError(_0x515f9a,null));};exports[_0xa82b('0x17')]=function(_0x524a45,_0x3d8f13){return db[_0xa82b('0x38')]['find']({'where':{'id':_0x524a45['params']['id']}})[_0xa82b('0x16')](handleEntityNotFound(_0x3d8f13,null))[_0xa82b('0x16')](removeEntity(_0x3d8f13,null))[_0xa82b('0x3c')](handleError(_0x3d8f13,null));};
\ No newline at end of file
index 8cb41cf..f59dfe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd00=['exports','events','../../mysqldb','setMaxListeners','save','update','emit','hook'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xbd00,0x1d1));var _0x0bd0=function(_0x48c9b3,_0x1fb678){_0x48c9b3=_0x48c9b3-0x0;var _0x4c782f=_0xbd00[_0x48c9b3];return _0x4c782f;};'use strict';var EventEmitter=require(_0x0bd0('0x0'));var SquareProject=require(_0x0bd0('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x0bd0('0x2')](0x0);var events={'afterCreate':_0x0bd0('0x3'),'afterUpdate':_0x0bd0('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1441e2){return function(_0x24477c,_0xb82fe8,_0xe88c48){SquareProjectEvents[_0x0bd0('0x5')](_0x1441e2+':'+_0x24477c['id'],_0x24477c);SquareProjectEvents[_0x0bd0('0x5')](_0x1441e2,_0x24477c);_0xe88c48(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x0bd0('0x6')](e,emitEvent(event));}}module[_0x0bd0('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0xc92d=['setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb','SquareProject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc92d,0xd5));var _0xdc92=function(_0x445b52,_0x1325fd){_0x445b52=_0x445b52-0x0;var _0x38a47c=_0xc92d[_0x445b52];return _0x38a47c;};'use strict';var EventEmitter=require(_0xdc92('0x0'));var SquareProject=require(_0xdc92('0x1'))['db'][_0xdc92('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xdc92('0x3')](0x0);var events={'afterCreate':_0xdc92('0x4'),'afterUpdate':_0xdc92('0x5'),'afterDestroy':_0xdc92('0x6')};function emitEvent(_0x5950ce){return function(_0x1fd9a9,_0x50fa86,_0x14e175){SquareProjectEvents[_0xdc92('0x7')](_0x5950ce+':'+_0x1fd9a9['id'],_0x1fd9a9);SquareProjectEvents[_0xdc92('0x7')](_0x5950ce,_0x1fd9a9);_0x14e175(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xdc92('0x8')]=SquareProjectEvents;
\ No newline at end of file
index 5c79d64..bdd1535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc55b=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc55b,0x132));var _0xbc55=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xc55b[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xbc55('0x0'));var util=require(_0xbc55('0x1'));var logger=require(_0xbc55('0x2'))(_0xbc55('0x3'));var moment=require(_0xbc55('0x4'));var BPromise=require(_0xbc55('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbc55('0x6'));var rimraf=require('rimraf');var config=require(_0xbc55('0x7'));var attributes=require(_0xbc55('0x8'));module[_0xbc55('0x9')]=function(_0x593efb,_0x168766){return _0x593efb[_0xbc55('0xa')](_0xbc55('0xb'),attributes,{'tableName':_0xbc55('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x404c1b,_0x2eb376,_0x298597){if(_0x404c1b['changed'](_0xbc55('0xd'))){_0x404c1b['savedAt']=moment()[_0xbc55('0xe')](_0xbc55('0xf'));}if(_0x404c1b['changed'](_0xbc55('0x10'))){_0x404c1b['publishedAt']=moment()[_0xbc55('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x298597(null,_0x404c1b);}}});};
\ No newline at end of file
+var _0x4197=['api','moment','bluebird','request-promise','path','define','SquareProject','square_projects','preproduction','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x54f7e4,_0x1561bd){var _0x14227c=function(_0x4c0b9c){while(--_0x4c0b9c){_0x54f7e4['push'](_0x54f7e4['shift']());}};_0x14227c(++_0x1561bd);}(_0x4197,0x138));var _0x7419=function(_0x2d8868,_0x24ef33){_0x2d8868=_0x2d8868-0x0;var _0x321438=_0x4197[_0x2d8868];return _0x321438;};'use strict';var _=require(_0x7419('0x0'));var util=require(_0x7419('0x1'));var logger=require(_0x7419('0x2'))(_0x7419('0x3'));var moment=require(_0x7419('0x4'));var BPromise=require(_0x7419('0x5'));var rp=require(_0x7419('0x6'));var fs=require('fs');var path=require(_0x7419('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x2cf616,_0xe06e23){return _0x2cf616[_0x7419('0x8')](_0x7419('0x9'),attributes,{'tableName':_0x7419('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x331274,_0x4b9e86,_0x36fc41){if(_0x331274['changed'](_0x7419('0xb'))){_0x331274['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x331274[_0x7419('0xc')]('production')){_0x331274['publishedAt']=moment()[_0x7419('0xd')](_0x7419('0xe'));}_0x36fc41(null,_0x331274);}}});};
\ No newline at end of file
index 0fcef37..70c8b9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66c7=['findAll','options','raw','where','attributes','limit','include','model','map','then','debug','catch','message','error','ShowSquareProject','find','info','stringify','lodash','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','socket.io-emitter','register','GetSquareProjects','SquareProject'];(function(_0x15402c,_0x5a11e6){var _0xe26a2c=function(_0x43e96c){while(--_0x43e96c){_0x15402c['push'](_0x15402c['shift']());}};_0xe26a2c(++_0x5a11e6);}(_0x66c7,0x1e2));var _0x766c=function(_0x14af66,_0x5b5fb3){_0x14af66=_0x14af66-0x0;var _0x4f219f=_0x66c7[_0x14af66];return _0x4f219f;};'use strict';var _=require(_0x766c('0x0'));var Redis=require(_0x766c('0x1'));var db=require(_0x766c('0x2'))['db'];var logger=require(_0x766c('0x3'))('rpc');var config=require(_0x766c('0x4'));config[_0x766c('0x5')]=_[_0x766c('0x6')](config[_0x766c('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x766c('0x7'))(new Redis(config['redis']));require('./squareProject.socket')[_0x766c('0x8')](socket);exports[_0x766c('0x9')]=function(_0x2af0ab){var _0x1d98bf=this;return new Promise(function(_0x80d037,_0x2f7345){return db[_0x766c('0xa')][_0x766c('0xb')]({'raw':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0xd')]===undefined?!![]:![]:!![],'where':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0xe')]||null:null,'attributes':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0xf')]||null:null,'limit':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab['options'][_0x766c('0x10')]||null:null,'include':_0x2af0ab[_0x766c('0xc')]?_0x2af0ab[_0x766c('0xc')][_0x766c('0x11')]?_['map'](_0x2af0ab[_0x766c('0xc')][_0x766c('0x11')],function(_0x499bc2){return{'model':db[_0x499bc2[_0x766c('0x12')]],'as':_0x499bc2['as'],'attributes':_0x499bc2[_0x766c('0xf')],'include':_0x499bc2[_0x766c('0x11')]?_[_0x766c('0x13')](_0x499bc2[_0x766c('0x11')],function(_0x3ff7b6){return{'model':db[_0x3ff7b6[_0x766c('0x12')]],'as':_0x3ff7b6['as'],'attributes':_0x3ff7b6[_0x766c('0xf')],'include':_0x3ff7b6['include']?_[_0x766c('0x13')](_0x3ff7b6['include'],function(_0x1ebd1d){return{'model':db[_0x1ebd1d[_0x766c('0x12')]],'as':_0x1ebd1d['as'],'attributes':_0x1ebd1d[_0x766c('0xf')]};}):[]};}):[]};}):[]:[]})[_0x766c('0x14')](function(_0xc34043){logger['info']('GetSquareProjects',_0x2af0ab);logger[_0x766c('0x15')](_0x766c('0x9'),_0x2af0ab,JSON['stringify'](_0xc34043));_0x80d037(_0xc34043);})[_0x766c('0x16')](function(_0x42ef77){logger['error'](_0x766c('0x9'),_0x42ef77[_0x766c('0x17')],_0x2af0ab);_0x2f7345(_0x1d98bf[_0x766c('0x18')](0x1f4,_0x42ef77[_0x766c('0x17')]));});});};exports[_0x766c('0x19')]=function(_0x1ac5de){var _0x39edea=this;return new Promise(function(_0x20d0bd,_0x1ed075){return db[_0x766c('0xa')][_0x766c('0x1a')]({'raw':_0x1ac5de[_0x766c('0xc')]?_0x1ac5de['options'][_0x766c('0xd')]===undefined?!![]:![]:!![],'where':_0x1ac5de[_0x766c('0xc')]?_0x1ac5de[_0x766c('0xc')][_0x766c('0xe')]||null:null,'attributes':_0x1ac5de['options']?_0x1ac5de[_0x766c('0xc')][_0x766c('0xf')]||null:null,'include':_0x1ac5de[_0x766c('0xc')]?_0x1ac5de[_0x766c('0xc')][_0x766c('0x11')]?_['map'](_0x1ac5de['options'][_0x766c('0x11')],function(_0x37e688){return{'model':db[_0x37e688[_0x766c('0x12')]],'as':_0x37e688['as'],'attributes':_0x37e688[_0x766c('0xf')],'include':_0x37e688[_0x766c('0x11')]?_[_0x766c('0x13')](_0x37e688[_0x766c('0x11')],function(_0x3e8d09){return{'model':db[_0x3e8d09[_0x766c('0x12')]],'as':_0x3e8d09['as'],'attributes':_0x3e8d09['attributes'],'include':_0x3e8d09[_0x766c('0x11')]?_['map'](_0x3e8d09['include'],function(_0x5df3a0){return{'model':db[_0x5df3a0[_0x766c('0x12')]],'as':_0x5df3a0['as'],'attributes':_0x5df3a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x766c('0x14')](function(_0x2f7741){logger[_0x766c('0x1b')](_0x766c('0x19'),_0x1ac5de);logger[_0x766c('0x15')](_0x766c('0x19'),_0x1ac5de,JSON[_0x766c('0x1c')](_0x2f7741));_0x20d0bd(_0x2f7741);})[_0x766c('0x16')](function(_0x4ec0b1){logger[_0x766c('0x18')](_0x766c('0x19'),_0x4ec0b1[_0x766c('0x17')],_0x1ac5de);_0x1ed075(_0x39edea['error'](0x1f4,_0x4ec0b1[_0x766c('0x17')]));});});};
\ No newline at end of file
+var _0xb3a2=['../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','model','map','then','info','stringify','catch','error','message','ShowSquareProject','find','debug','lodash','../../mysqldb'];(function(_0x3ddd5c,_0x31fff6){var _0xcdd6f9=function(_0x3e7b97){while(--_0x3e7b97){_0x3ddd5c['push'](_0x3ddd5c['shift']());}};_0xcdd6f9(++_0x31fff6);}(_0xb3a2,0x1a2));var _0x2b3a=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xb3a2[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0x2b3a('0x0'));var Redis=require('ioredis');var db=require(_0x2b3a('0x1'))['db'];var logger=require(_0x2b3a('0x2'))(_0x2b3a('0x3'));var config=require(_0x2b3a('0x4'));config[_0x2b3a('0x5')]=_['defaults'](config[_0x2b3a('0x5')],{'host':_0x2b3a('0x6'),'port':0x18eb});var socket=require(_0x2b3a('0x7'))(new Redis(config[_0x2b3a('0x5')]));require(_0x2b3a('0x8'))[_0x2b3a('0x9')](socket);exports[_0x2b3a('0xa')]=function(_0xd055a1){var _0x193a46=this;return new Promise(function(_0x18e361,_0x3bb95d){return db[_0x2b3a('0xb')][_0x2b3a('0xc')]({'raw':_0xd055a1['options']?_0xd055a1[_0x2b3a('0xd')][_0x2b3a('0xe')]===undefined?!![]:![]:!![],'where':_0xd055a1['options']?_0xd055a1[_0x2b3a('0xd')][_0x2b3a('0xf')]||null:null,'attributes':_0xd055a1[_0x2b3a('0xd')]?_0xd055a1[_0x2b3a('0xd')][_0x2b3a('0x10')]||null:null,'limit':_0xd055a1[_0x2b3a('0xd')]?_0xd055a1['options'][_0x2b3a('0x11')]||null:null,'include':_0xd055a1[_0x2b3a('0xd')]?_0xd055a1['options'][_0x2b3a('0x12')]?_['map'](_0xd055a1['options'][_0x2b3a('0x12')],function(_0x36678f){return{'model':db[_0x36678f[_0x2b3a('0x13')]],'as':_0x36678f['as'],'attributes':_0x36678f[_0x2b3a('0x10')],'include':_0x36678f[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0x36678f['include'],function(_0xb941d1){return{'model':db[_0xb941d1['model']],'as':_0xb941d1['as'],'attributes':_0xb941d1[_0x2b3a('0x10')],'include':_0xb941d1[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0xb941d1[_0x2b3a('0x12')],function(_0x340a8d){return{'model':db[_0x340a8d[_0x2b3a('0x13')]],'as':_0x340a8d['as'],'attributes':_0x340a8d[_0x2b3a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x2b3a('0x15')](function(_0x3823ae){logger[_0x2b3a('0x16')](_0x2b3a('0xa'),_0xd055a1);logger['debug']('GetSquareProjects',_0xd055a1,JSON[_0x2b3a('0x17')](_0x3823ae));_0x18e361(_0x3823ae);})[_0x2b3a('0x18')](function(_0x4ce4c3){logger[_0x2b3a('0x19')](_0x2b3a('0xa'),_0x4ce4c3[_0x2b3a('0x1a')],_0xd055a1);_0x3bb95d(_0x193a46['error'](0x1f4,_0x4ce4c3[_0x2b3a('0x1a')]));});});};exports[_0x2b3a('0x1b')]=function(_0x4b6ef8){var _0x13725c=this;return new Promise(function(_0xabe357,_0x5bd6ac){return db[_0x2b3a('0xb')][_0x2b3a('0x1c')]({'raw':_0x4b6ef8[_0x2b3a('0xd')]?_0x4b6ef8[_0x2b3a('0xd')]['raw']===undefined?!![]:![]:!![],'where':_0x4b6ef8[_0x2b3a('0xd')]?_0x4b6ef8['options']['where']||null:null,'attributes':_0x4b6ef8[_0x2b3a('0xd')]?_0x4b6ef8[_0x2b3a('0xd')][_0x2b3a('0x10')]||null:null,'include':_0x4b6ef8['options']?_0x4b6ef8[_0x2b3a('0xd')]['include']?_[_0x2b3a('0x14')](_0x4b6ef8['options'][_0x2b3a('0x12')],function(_0x130934){return{'model':db[_0x130934['model']],'as':_0x130934['as'],'attributes':_0x130934[_0x2b3a('0x10')],'include':_0x130934[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0x130934['include'],function(_0x2f3cac){return{'model':db[_0x2f3cac[_0x2b3a('0x13')]],'as':_0x2f3cac['as'],'attributes':_0x2f3cac[_0x2b3a('0x10')],'include':_0x2f3cac[_0x2b3a('0x12')]?_[_0x2b3a('0x14')](_0x2f3cac[_0x2b3a('0x12')],function(_0x28f397){return{'model':db[_0x28f397[_0x2b3a('0x13')]],'as':_0x28f397['as'],'attributes':_0x28f397[_0x2b3a('0x10')]};}):[]};}):[]};}):[]:[]})[_0x2b3a('0x15')](function(_0x33feb8){logger[_0x2b3a('0x16')](_0x2b3a('0x1b'),_0x4b6ef8);logger[_0x2b3a('0x1d')](_0x2b3a('0x1b'),_0x4b6ef8,JSON[_0x2b3a('0x17')](_0x33feb8));_0xabe357(_0x33feb8);})['catch'](function(_0x55e221){logger['error'](_0x2b3a('0x1b'),_0x55e221['message'],_0x4b6ef8);_0x5bd6ac(_0x13725c[_0x2b3a('0x19')](0x1f4,_0x55e221[_0x2b3a('0x1a')]));});});};
\ No newline at end of file
index 8733e95..fdeb9f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ebd=['squareProject:','./squareProject.events','save','remove','update','emit'];(function(_0x340c8e,_0x18f717){var _0x33d19c=function(_0x1a8299){while(--_0x1a8299){_0x340c8e['push'](_0x340c8e['shift']());}};_0x33d19c(++_0x18f717);}(_0x6ebd,0x169));var _0xd6eb=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6ebd[_0x2763f2];return _0x3ef471;};'use strict';var SquareProjectEvents=require(_0xd6eb('0x0'));var events=[_0xd6eb('0x1'),_0xd6eb('0x2'),_0xd6eb('0x3')];function createListener(_0x19f1fe,_0x3abca0){return function(_0x6997d3){_0x3abca0[_0xd6eb('0x4')](_0x19f1fe,_0x6997d3);};}function removeListener(_0x2e8cf2,_0x4d0ded){return function(){SquareProjectEvents['removeListener'](_0x2e8cf2,_0x4d0ded);};}exports['register']=function(_0x246cb0){for(var _0x5b2e55=0x0,_0x37a632=events['length'];_0x5b2e55<_0x37a632;_0x5b2e55++){var _0x1c25cd=events[_0x5b2e55];var _0x36f383=createListener(_0xd6eb('0x5')+_0x1c25cd,_0x246cb0);SquareProjectEvents['on'](_0x1c25cd,_0x36f383);}};
\ No newline at end of file
+var _0x3c17=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x3c17,0x7d));var _0x73c1=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x3c17[_0x397cfb];return _0x15fed9;};'use strict';var SquareProjectEvents=require(_0x73c1('0x0'));var events=[_0x73c1('0x1'),_0x73c1('0x2'),_0x73c1('0x3')];function createListener(_0x3aa9df,_0x584149){return function(_0x20c8a6){_0x584149[_0x73c1('0x4')](_0x3aa9df,_0x20c8a6);};}function removeListener(_0x13f9f1,_0x3e4d00){return function(){SquareProjectEvents[_0x73c1('0x5')](_0x13f9f1,_0x3e4d00);};}exports[_0x73c1('0x6')]=function(_0x5bb0d2){for(var _0x21ded1=0x0,_0x26c828=events[_0x73c1('0x7')];_0x21ded1<_0x26c828;_0x21ded1++){var _0x3a8200=events[_0x21ded1];var _0x3cf4c3=createListener(_0x73c1('0x8')+_0x3a8200,_0x5bb0d2);SquareProjectEvents['on'](_0x3a8200,_0x3cf4c3);}};
\ No newline at end of file
index cf88804..b4b5eaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x38a5c2,_0x432a75){var _0x15ce3b=function(_0x48b7a5){while(--_0x48b7a5){_0x38a5c2['push'](_0x38a5c2['shift']());}};_0x15ce3b(++_0x432a75);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x7fbe[_0x5bfa44];return _0x43815f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router;
\ No newline at end of file
+var _0x5fc3=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','/:id','multer','util','connect-timeout'];(function(_0x330fb9,_0x5ca0fd){var _0xa43ccc=function(_0x152fb1){while(--_0x152fb1){_0x330fb9['push'](_0x330fb9['shift']());}};_0xa43ccc(++_0x5ca0fd);}(_0x5fc3,0xa8));var _0x35fc=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x5fc3[_0xa9eaa0];return _0x30897a;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')]('/',auth['isAuthenticated'](),controller[_0x35fc('0xf')]);router[_0x35fc('0x10')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router['delete'](_0x35fc('0x12'),auth[_0x35fc('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5ed98d9..f5c06dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d17,0x17e));var _0x72d1=function(_0x2185af,_0x23874f){_0x2185af=_0x2185af-0x0;var _0x4fde62=_0x2d17[_0x2185af];return _0x4fde62;};'use strict';var Sequelize=require(_0x72d1('0x0'));module[_0x72d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x72d1('0x2')]},'calleridname':{'type':Sequelize[_0x72d1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x72d1('0x2')]},'priority':{'type':Sequelize[_0x72d1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x72d1('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x72d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x72d1('0x2')]},'format':{'type':Sequelize[_0x72d1('0x3')],'get':function(){var _0x5b40a9='';var _0x477264=this[_0x72d1('0x4')](_0x72d1('0x5'));if(_0x477264){_0x5b40a9=_0x477264['substring'](_0x477264[_0x72d1('0x6')]('.'));}return _0x5b40a9;}}};
\ No newline at end of file
+var _0x7c09=['exports','STRING','VIRTUAL','getDataValue','savePath','lastIndexOf'];(function(_0x3b8345,_0x59d181){var _0x47965d=function(_0x57223c){while(--_0x57223c){_0x3b8345['push'](_0x3b8345['shift']());}};_0x47965d(++_0x59d181);}(_0x7c09,0x102));var _0x97c0=function(_0x34cc52,_0xcc3d61){_0x34cc52=_0x34cc52-0x0;var _0x44c0b6=_0x7c09[_0x34cc52];return _0x44c0b6;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'uniqueid':{'type':Sequelize[_0x97c0('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97c0('0x1')]},'context':{'type':Sequelize[_0x97c0('0x1')]},'extension':{'type':Sequelize[_0x97c0('0x1')]},'priority':{'type':Sequelize[_0x97c0('0x1')]},'accountcode':{'type':Sequelize[_0x97c0('0x1')]},'dnid':{'type':Sequelize[_0x97c0('0x1')]},'projectName':{'type':Sequelize[_0x97c0('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x97c0('0x2')],'get':function(){var _0x42c6c7='';var _0x2c19fa=this[_0x97c0('0x3')](_0x97c0('0x4'));if(_0x2c19fa){_0x42c6c7=_0x2c19fa['substring'](_0x2c19fa[_0x97c0('0x5')]('.'));}return _0x42c6c7;}}};
\ No newline at end of file
index f62c7d7..4ad40e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5183=['SquareRecording','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','keys','include','find','catch','create','body','uniqueid','filename','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','SquareRecording\x20not\x20found','extname','unlink','download','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map'];(function(_0x43f9ce,_0x50786f){var _0x54e881=function(_0x16c6c4){while(--_0x16c6c4){_0x43f9ce['push'](_0x43f9ce['shift']());}};_0x54e881(++_0x50786f);}(_0x5183,0x1c0));var _0x3518=function(_0x5e47b9,_0x11878a){_0x5e47b9=_0x5e47b9-0x0;var _0x2a5834=_0x5183[_0x5e47b9];return _0x2a5834;};'use strict';var emlformat=require(_0x3518('0x0'));var rimraf=require(_0x3518('0x1'));var zipdir=require(_0x3518('0x2'));var jsonpatch=require(_0x3518('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3518('0x4'));var Mustache=require(_0x3518('0x5'));var util=require(_0x3518('0x6'));var path=require(_0x3518('0x7'));var sox=require(_0x3518('0x8'));var csv=require(_0x3518('0x9'));var ejs=require(_0x3518('0xa'));var fs=require('fs');var fs_extra=require(_0x3518('0xb'));var _=require(_0x3518('0xc'));var squel=require(_0x3518('0xd'));var crypto=require(_0x3518('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3518('0xf'));var toCsv=require(_0x3518('0x9'));var querystring=require(_0x3518('0x10'));var Papa=require(_0x3518('0x11'));var Redis=require(_0x3518('0x12'));var authService=require(_0x3518('0x13'));var qs=require(_0x3518('0x14'));var as=require(_0x3518('0x15'));var hardwareService=require(_0x3518('0x16'));var logger=require('../../config/logger')(_0x3518('0x17'));var utils=require('../../config/utils');var config=require(_0x3518('0x18'));var licenseUtil=require(_0x3518('0x19'));var db=require(_0x3518('0x1a'))['db'];function respondWithStatusCode(_0x8d98f,_0x34e752){_0x34e752=_0x34e752||0xcc;return function(_0x1f373b){if(_0x1f373b){return _0x8d98f[_0x3518('0x1b')](_0x34e752);}return _0x8d98f[_0x3518('0x1c')](_0x34e752)[_0x3518('0x1d')]();};}function respondWithResult(_0x2b10b1,_0x68d359){_0x68d359=_0x68d359||0xc8;return function(_0x438fb7){if(_0x438fb7){return _0x2b10b1[_0x3518('0x1c')](_0x68d359)[_0x3518('0x1e')](_0x438fb7);}};}function respondWithFilteredResult(_0x4c4b0d,_0x3a1752){return function(_0xfe2920){if(_0xfe2920){var _0x54974f=typeof _0x3a1752[_0x3518('0x1f')]==='undefined'&&typeof _0x3a1752[_0x3518('0x20')]===_0x3518('0x21');var _0x657190=_0xfe2920[_0x3518('0x22')];var _0x33933b=_0x54974f?0x0:_0x3a1752[_0x3518('0x1f')];var _0x36a05d=_0x54974f?_0xfe2920[_0x3518('0x22')]:_0x3a1752[_0x3518('0x1f')]+_0x3a1752[_0x3518('0x20')];var _0x34895f;if(_0x36a05d>=_0x657190){_0x36a05d=_0x657190;_0x34895f=0xc8;}else{_0x34895f=0xce;}_0x4c4b0d['status'](_0x34895f);return _0x4c4b0d['set'](_0x3518('0x23'),_0x33933b+'-'+_0x36a05d+'/'+_0x657190)['json'](_0xfe2920);}return null;};}function patchUpdates(_0x1c611d){return function(_0x334840){try{jsonpatch[_0x3518('0x24')](_0x334840,_0x1c611d,!![]);}catch(_0x4dfb65){return BPromise[_0x3518('0x25')](_0x4dfb65);}return _0x334840[_0x3518('0x26')]();};}function saveUpdates(_0x28c644,_0x2a1232){return function(_0x199068){if(_0x199068){return _0x199068[_0x3518('0x27')](_0x28c644)['then'](function(_0x40b060){return _0x40b060;});}return null;};}function removeEntity(_0x27a6eb,_0x472e92){return function(_0x23beb2){if(_0x23beb2){return _0x23beb2[_0x3518('0x28')]()[_0x3518('0x29')](function(){_0x27a6eb[_0x3518('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7afca0,_0x410f0e){return function(_0x3953ad){if(!_0x3953ad){_0x7afca0['sendStatus'](0x194);}return _0x3953ad;};}function handleError(_0x5ead1f,_0x3739c0){_0x3739c0=_0x3739c0||0x1f4;return function(_0x3753e5){logger[_0x3518('0x2a')](_0x3753e5[_0x3518('0x2b')]);if(_0x3753e5[_0x3518('0x2c')]){delete _0x3753e5[_0x3518('0x2c')];}_0x5ead1f[_0x3518('0x1c')](_0x3739c0)[_0x3518('0x2d')](_0x3753e5);};}exports['index']=function(_0x1e1924,_0x5f085d){var _0x3747ad={},_0x76e58={},_0x3017ef={'count':0x0,'rows':[]};var _0x2ce10b=_[_0x3518('0x2e')](db[_0x3518('0x2f')][_0x3518('0x30')],function(_0x3c1499){return{'name':_0x3c1499[_0x3518('0x31')],'type':_0x3c1499[_0x3518('0x32')]['key']};});_0x76e58['model']=_[_0x3518('0x2e')](_0x2ce10b,_0x3518('0x2c'));_0x76e58[_0x3518('0x33')]=_['keys'](_0x1e1924[_0x3518('0x33')]);_0x76e58[_0x3518('0x34')]=_[_0x3518('0x35')](_0x76e58[_0x3518('0x36')],_0x76e58[_0x3518('0x33')]);_0x3747ad[_0x3518('0x37')]=_['intersection'](_0x76e58[_0x3518('0x36')],qs['fields'](_0x1e1924[_0x3518('0x33')][_0x3518('0x38')]));_0x3747ad[_0x3518('0x37')]=_0x3747ad[_0x3518('0x37')][_0x3518('0x39')]?_0x3747ad[_0x3518('0x37')]:_0x76e58[_0x3518('0x36')];if(!_0x1e1924[_0x3518('0x33')]['hasOwnProperty'](_0x3518('0x3a'))){_0x3747ad['limit']=qs[_0x3518('0x20')](_0x1e1924[_0x3518('0x33')][_0x3518('0x20')]);_0x3747ad[_0x3518('0x1f')]=qs[_0x3518('0x1f')](_0x1e1924[_0x3518('0x33')]['offset']);}_0x3747ad[_0x3518('0x3b')]=qs[_0x3518('0x3c')](_0x1e1924[_0x3518('0x33')]['sort']);_0x3747ad[_0x3518('0x3d')]=qs['filters'](_[_0x3518('0x3e')](_0x1e1924['query'],_0x76e58[_0x3518('0x34')]),_0x2ce10b);if(_0x1e1924['query'][_0x3518('0x3f')]){_0x3747ad[_0x3518('0x3d')]=_[_0x3518('0x40')](_0x3747ad['where'],{'$or':_[_0x3518('0x2e')](_0x2ce10b,function(_0x49ec4a){if(_0x49ec4a['type']!==_0x3518('0x41')){var _0x33f578={};_0x33f578[_0x49ec4a[_0x3518('0x2c')]]={'$like':'%'+_0x1e1924[_0x3518('0x33')]['filter']+'%'};return _0x33f578;}})});}_0x3747ad=_['merge']({},_0x3747ad,_0x1e1924[_0x3518('0x42')]);var _0x247bf0={'where':_0x3747ad['where']};return db[_0x3518('0x2f')][_0x3518('0x22')](_0x247bf0)['then'](function(_0x1847df){_0x3017ef['count']=_0x1847df;if(_0x1e1924['query'][_0x3518('0x43')]){_0x3747ad['include']=[{'all':!![]}];}return db[_0x3518('0x2f')]['findAll'](_0x3747ad);})['then'](function(_0x56005e){_0x3017ef[_0x3518('0x44')]=_0x56005e;return _0x3017ef;})[_0x3518('0x29')](respondWithFilteredResult(_0x5f085d,_0x3747ad))['catch'](handleError(_0x5f085d,null));};exports[_0x3518('0x45')]=function(_0x2cd809,_0x41db01){var _0x116fd8={'raw':!![],'where':{'id':_0x2cd809[_0x3518('0x46')]['id']}},_0x167be6={};_0x167be6[_0x3518('0x36')]=_[_0x3518('0x47')](db[_0x3518('0x2f')][_0x3518('0x30')]);_0x167be6[_0x3518('0x33')]=_[_0x3518('0x47')](_0x2cd809['query']);_0x167be6[_0x3518('0x34')]=_[_0x3518('0x35')](_0x167be6['model'],_0x167be6[_0x3518('0x33')]);_0x116fd8['attributes']=_[_0x3518('0x35')](_0x167be6[_0x3518('0x36')],qs[_0x3518('0x38')](_0x2cd809[_0x3518('0x33')][_0x3518('0x38')]));_0x116fd8[_0x3518('0x37')]=_0x116fd8[_0x3518('0x37')][_0x3518('0x39')]?_0x116fd8[_0x3518('0x37')]:_0x167be6[_0x3518('0x36')];if(_0x2cd809[_0x3518('0x33')][_0x3518('0x43')]){_0x116fd8[_0x3518('0x48')]=[{'all':!![]}];}_0x116fd8=_['merge']({},_0x116fd8,_0x2cd809[_0x3518('0x42')]);return db[_0x3518('0x2f')][_0x3518('0x49')](_0x116fd8)[_0x3518('0x29')](handleEntityNotFound(_0x41db01,null))[_0x3518('0x29')](respondWithResult(_0x41db01,null))[_0x3518('0x4a')](handleError(_0x41db01,null));};exports[_0x3518('0x4b')]=function(_0x3475fe,_0x37596f){return db[_0x3518('0x2f')][_0x3518('0x4b')](_0x3475fe[_0x3518('0x4c')],{})[_0x3518('0x29')](respondWithResult(_0x37596f,0xc9))[_0x3518('0x4a')](handleError(_0x37596f,null));};exports[_0x3518('0x27')]=function(_0x2e66d0,_0x56f1f7){if(_0x2e66d0[_0x3518('0x4c')]['id']){delete _0x2e66d0[_0x3518('0x4c')]['id'];}return db[_0x3518('0x2f')]['find']({'where':{'id':_0x2e66d0['params']['id']}})[_0x3518('0x29')](handleEntityNotFound(_0x56f1f7,null))[_0x3518('0x29')](saveUpdates(_0x2e66d0[_0x3518('0x4c')],null))[_0x3518('0x29')](respondWithResult(_0x56f1f7,null))[_0x3518('0x4a')](handleError(_0x56f1f7,null));};exports['download']=function(_0x2cec23,_0x34bc41,_0x37a8b3){var _0x48358f=require('../../components/encryptor');var _0xc728af=![];var _0x889cc={};if(_0x2cec23[_0x3518('0x33')][_0x3518('0x32')]&&_0x2cec23[_0x3518('0x33')]['type']===_0x3518('0x4d')){_0x889cc[_0x3518('0x4d')]=_0x2cec23[_0x3518('0x46')]['id'];}else{_0x889cc['id']=_0x2cec23[_0x3518('0x46')]['id'];}return db[_0x3518('0x2f')][_0x3518('0x49')]({'where':_0x889cc,'attributes':['id','savePath',_0x3518('0x4e')],'raw':!![]})[_0x3518('0x29')](handleEntityNotFound(_0x34bc41,null))[_0x3518('0x29')](function(_0x5cf11f){if(_0x5cf11f){var _0x2fe041=_0x5cf11f['savePath'];var _0x23a4ee=util['format'](_0x3518('0x4f'),_0x2fe041);if(fs[_0x3518('0x50')](_0x23a4ee)){_0xc728af=!![];return _0x48358f[_0x3518('0x51')](_0x23a4ee,_0x2fe041,config[_0x3518('0x52')][_0x3518('0x53')])[_0x3518('0x29')](function(){return _0x5cf11f;});}return _0x5cf11f;}})[_0x3518('0x29')](function(_0x195d26){if(_0x195d26){var _0x2c87c3=_0x195d26[_0x3518('0x54')];if(!fs[_0x3518('0x50')](_0x2c87c3)){throw new db[(_0x3518('0x55'))]['ValidationError'](_0x3518('0x56'));}if(_0x195d26[_0x3518('0x4e')]){return _0x34bc41['download'](_0x2c87c3,_0x195d26[_0x3518('0x4e')]+path[_0x3518('0x57')](_0x2c87c3),function(){if(_0xc728af){fs[_0x3518('0x58')](_0x2c87c3);}});}else{return _0x34bc41[_0x3518('0x59')](_0x2c87c3,function(_0x3bcb8e){if(_0xc728af){fs[_0x3518('0x58')](_0x2c87c3);}});}}})['catch'](function(_0x3df0d1){if(_0x3df0d1[_0x3518('0x5a')]==='SquareRecording\x20not\x20found'){_0x34bc41['status'](0x194)[_0x3518('0x2d')](_0x3518('0x5b'));}else{return handleError(_0x34bc41,null);}});};exports['destroy']=function(_0x61f77,_0x3ce43c){return db[_0x3518('0x2f')][_0x3518('0x49')]({'where':{'id':_0x61f77[_0x3518('0x46')]['id']}})['then'](function(_0x4ea062){if(_[_0x3518('0x5c')](_0x4ea062)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ea062;})[_0x3518('0x29')](function(_0x36f0ff){var _0x16b39b=_0x36f0ff[_0x3518('0x54')];logger[_0x3518('0x5d')](_0x3518('0x5e'),_0x16b39b);if(!_[_0x3518('0x5c')](_0x36f0ff[_0x3518('0x54')])&&fs[_0x3518('0x50')](_0x16b39b)){logger[_0x3518('0x5d')](_0x3518('0x5f')+_0x16b39b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x16b39b);}_0x16b39b=_0x16b39b+_0x3518('0x60');if(!_[_0x3518('0x5c')](_0x36f0ff[_0x3518('0x54')])&&fs[_0x3518('0x50')](_0x16b39b)){logger[_0x3518('0x5d')]('File:\x20\x22'+_0x16b39b+_0x3518('0x61'));fs[_0x3518('0x62')](_0x16b39b);}return _0x36f0ff;})['then'](function(_0x389d92){if(!_0x389d92)throw new InternalError();return _0x389d92[_0x3518('0x28')]();})['then'](function(){_0x3ce43c[_0x3518('0x1c')](0xcc)[_0x3518('0x1d')]();})['catch'](handleError(_0x3ce43c,null));};
\ No newline at end of file
+var _0x8c0d=['order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0xa5db38,_0x189d0c){var _0x48dc06=function(_0x11086f){while(--_0x11086f){_0xa5db38['push'](_0xa5db38['shift']());}};_0x48dc06(++_0x189d0c);}(_0x8c0d,0xf0));var _0xd8c0=function(_0x1123bc,_0x18c217){_0x1123bc=_0x1123bc-0x0;var _0x5418a9=_0x8c0d[_0x1123bc];return _0x5418a9;};'use strict';var emlformat=require(_0xd8c0('0x0'));var rimraf=require(_0xd8c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8c0('0x2'));var rp=require(_0xd8c0('0x3'));var moment=require(_0xd8c0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd8c0('0x5'));var util=require(_0xd8c0('0x6'));var path=require('path');var sox=require(_0xd8c0('0x7'));var csv=require(_0xd8c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd8c0('0x9'));var squel=require(_0xd8c0('0xa'));var crypto=require(_0xd8c0('0xb'));var jsforce=require(_0xd8c0('0xc'));var deskjs=require(_0xd8c0('0xd'));var toCsv=require(_0xd8c0('0x8'));var querystring=require('querystring');var Papa=require(_0xd8c0('0xe'));var Redis=require(_0xd8c0('0xf'));var authService=require(_0xd8c0('0x10'));var qs=require(_0xd8c0('0x11'));var as=require(_0xd8c0('0x12'));var hardwareService=require(_0xd8c0('0x13'));var logger=require(_0xd8c0('0x14'))(_0xd8c0('0x15'));var utils=require(_0xd8c0('0x16'));var config=require(_0xd8c0('0x17'));var licenseUtil=require(_0xd8c0('0x18'));var db=require(_0xd8c0('0x19'))['db'];function respondWithStatusCode(_0x304733,_0x48b2cc){_0x48b2cc=_0x48b2cc||0xcc;return function(_0xca5d6e){if(_0xca5d6e){return _0x304733[_0xd8c0('0x1a')](_0x48b2cc);}return _0x304733[_0xd8c0('0x1b')](_0x48b2cc)[_0xd8c0('0x1c')]();};}function respondWithResult(_0x2ba58b,_0x35fa2e){_0x35fa2e=_0x35fa2e||0xc8;return function(_0x2bfda0){if(_0x2bfda0){return _0x2ba58b['status'](_0x35fa2e)[_0xd8c0('0x1d')](_0x2bfda0);}};}function respondWithFilteredResult(_0x58246f,_0x1136e8){return function(_0x2a8737){if(_0x2a8737){var _0x459b0d=typeof _0x1136e8['offset']==='undefined'&&typeof _0x1136e8[_0xd8c0('0x1e')]===_0xd8c0('0x1f');var _0x406677=_0x2a8737[_0xd8c0('0x20')];var _0x3fcc57=_0x459b0d?0x0:_0x1136e8[_0xd8c0('0x21')];var _0x45d7ec=_0x459b0d?_0x2a8737[_0xd8c0('0x20')]:_0x1136e8['offset']+_0x1136e8[_0xd8c0('0x1e')];var _0x4693c1;if(_0x45d7ec>=_0x406677){_0x45d7ec=_0x406677;_0x4693c1=0xc8;}else{_0x4693c1=0xce;}_0x58246f[_0xd8c0('0x1b')](_0x4693c1);return _0x58246f[_0xd8c0('0x22')](_0xd8c0('0x23'),_0x3fcc57+'-'+_0x45d7ec+'/'+_0x406677)['json'](_0x2a8737);}return null;};}function patchUpdates(_0x480173){return function(_0x4c78c4){try{jsonpatch['apply'](_0x4c78c4,_0x480173,!![]);}catch(_0x40fe41){return BPromise[_0xd8c0('0x24')](_0x40fe41);}return _0x4c78c4[_0xd8c0('0x25')]();};}function saveUpdates(_0x17a969,_0x479102){return function(_0x26e0ce){if(_0x26e0ce){return _0x26e0ce[_0xd8c0('0x26')](_0x17a969)['then'](function(_0x47c70d){return _0x47c70d;});}return null;};}function removeEntity(_0x414707,_0x88f1a8){return function(_0x479450){if(_0x479450){return _0x479450[_0xd8c0('0x27')]()[_0xd8c0('0x28')](function(){_0x414707['status'](0xcc)[_0xd8c0('0x1c')]();});}};}function handleEntityNotFound(_0x1344f8,_0x358d55){return function(_0x1eebf2){if(!_0x1eebf2){_0x1344f8['sendStatus'](0x194);}return _0x1eebf2;};}function handleError(_0x4768b4,_0xb302b){_0xb302b=_0xb302b||0x1f4;return function(_0x7fed42){logger['error'](_0x7fed42[_0xd8c0('0x29')]);if(_0x7fed42[_0xd8c0('0x2a')]){delete _0x7fed42['name'];}_0x4768b4[_0xd8c0('0x1b')](_0xb302b)['send'](_0x7fed42);};}exports[_0xd8c0('0x2b')]=function(_0x871dcd,_0x59d29c){var _0x1b4333={},_0x49d0b0={},_0x57649e={'count':0x0,'rows':[]};var _0x35fc0a=_[_0xd8c0('0x2c')](db[_0xd8c0('0x2d')][_0xd8c0('0x2e')],function(_0xdd05c2){return{'name':_0xdd05c2[_0xd8c0('0x2f')],'type':_0xdd05c2[_0xd8c0('0x30')][_0xd8c0('0x31')]};});_0x49d0b0[_0xd8c0('0x32')]=_[_0xd8c0('0x2c')](_0x35fc0a,_0xd8c0('0x2a'));_0x49d0b0[_0xd8c0('0x33')]=_[_0xd8c0('0x34')](_0x871dcd['query']);_0x49d0b0[_0xd8c0('0x35')]=_['intersection'](_0x49d0b0[_0xd8c0('0x32')],_0x49d0b0['query']);_0x1b4333[_0xd8c0('0x36')]=_[_0xd8c0('0x37')](_0x49d0b0[_0xd8c0('0x32')],qs[_0xd8c0('0x38')](_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x1b4333[_0xd8c0('0x36')]=_0x1b4333['attributes'][_0xd8c0('0x39')]?_0x1b4333['attributes']:_0x49d0b0['model'];if(!_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x3a')](_0xd8c0('0x3b'))){_0x1b4333[_0xd8c0('0x1e')]=qs[_0xd8c0('0x1e')](_0x871dcd[_0xd8c0('0x33')]['limit']);_0x1b4333[_0xd8c0('0x21')]=qs[_0xd8c0('0x21')](_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x21')]);}_0x1b4333[_0xd8c0('0x3c')]=qs[_0xd8c0('0x3d')](_0x871dcd[_0xd8c0('0x33')]['sort']);_0x1b4333[_0xd8c0('0x3e')]=qs[_0xd8c0('0x35')](_[_0xd8c0('0x3f')](_0x871dcd[_0xd8c0('0x33')],_0x49d0b0['filters']),_0x35fc0a);if(_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x40')]){_0x1b4333[_0xd8c0('0x3e')]=_['merge'](_0x1b4333[_0xd8c0('0x3e')],{'$or':_[_0xd8c0('0x2c')](_0x35fc0a,function(_0x5092a1){if(_0x5092a1[_0xd8c0('0x30')]!==_0xd8c0('0x41')){var _0x2a9a8c={};_0x2a9a8c[_0x5092a1[_0xd8c0('0x2a')]]={'$like':'%'+_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x40')]+'%'};return _0x2a9a8c;}})});}_0x1b4333=_[_0xd8c0('0x42')]({},_0x1b4333,_0x871dcd[_0xd8c0('0x43')]);var _0x549576={'where':_0x1b4333[_0xd8c0('0x3e')]};return db[_0xd8c0('0x2d')][_0xd8c0('0x20')](_0x549576)['then'](function(_0x372cbe){_0x57649e[_0xd8c0('0x20')]=_0x372cbe;if(_0x871dcd[_0xd8c0('0x33')][_0xd8c0('0x44')]){_0x1b4333[_0xd8c0('0x45')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x1b4333);})[_0xd8c0('0x28')](function(_0x5edf8f){_0x57649e[_0xd8c0('0x46')]=_0x5edf8f;return _0x57649e;})[_0xd8c0('0x28')](respondWithFilteredResult(_0x59d29c,_0x1b4333))[_0xd8c0('0x47')](handleError(_0x59d29c,null));};exports[_0xd8c0('0x48')]=function(_0x1d3188,_0x4099aa){var _0x2657e9={'raw':!![],'where':{'id':_0x1d3188[_0xd8c0('0x49')]['id']}},_0x1b2ecf={};_0x1b2ecf[_0xd8c0('0x32')]=_[_0xd8c0('0x34')](db[_0xd8c0('0x2d')][_0xd8c0('0x2e')]);_0x1b2ecf[_0xd8c0('0x33')]=_[_0xd8c0('0x34')](_0x1d3188[_0xd8c0('0x33')]);_0x1b2ecf['filters']=_[_0xd8c0('0x37')](_0x1b2ecf['model'],_0x1b2ecf[_0xd8c0('0x33')]);_0x2657e9[_0xd8c0('0x36')]=_[_0xd8c0('0x37')](_0x1b2ecf[_0xd8c0('0x32')],qs[_0xd8c0('0x38')](_0x1d3188[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x2657e9[_0xd8c0('0x36')]=_0x2657e9[_0xd8c0('0x36')]['length']?_0x2657e9[_0xd8c0('0x36')]:_0x1b2ecf[_0xd8c0('0x32')];if(_0x1d3188['query'][_0xd8c0('0x44')]){_0x2657e9[_0xd8c0('0x45')]=[{'all':!![]}];}_0x2657e9=_[_0xd8c0('0x42')]({},_0x2657e9,_0x1d3188['options']);return db[_0xd8c0('0x2d')][_0xd8c0('0x4a')](_0x2657e9)['then'](handleEntityNotFound(_0x4099aa,null))['then'](respondWithResult(_0x4099aa,null))['catch'](handleError(_0x4099aa,null));};exports[_0xd8c0('0x4b')]=function(_0x2a1bf8,_0x4fff95){return db['SquareRecording'][_0xd8c0('0x4b')](_0x2a1bf8[_0xd8c0('0x4c')],{})[_0xd8c0('0x28')](respondWithResult(_0x4fff95,0xc9))[_0xd8c0('0x47')](handleError(_0x4fff95,null));};exports[_0xd8c0('0x26')]=function(_0x26b2bc,_0x24cddd){if(_0x26b2bc[_0xd8c0('0x4c')]['id']){delete _0x26b2bc['body']['id'];}return db['SquareRecording'][_0xd8c0('0x4a')]({'where':{'id':_0x26b2bc[_0xd8c0('0x49')]['id']}})[_0xd8c0('0x28')](handleEntityNotFound(_0x24cddd,null))[_0xd8c0('0x28')](saveUpdates(_0x26b2bc[_0xd8c0('0x4c')],null))[_0xd8c0('0x28')](respondWithResult(_0x24cddd,null))[_0xd8c0('0x47')](handleError(_0x24cddd,null));};exports[_0xd8c0('0x4d')]=function(_0x3083e0,_0x1aae15,_0x9045c1){var _0x1b5643=require(_0xd8c0('0x4e'));var _0x1b5a8e=![];var _0x4e424e={};if(_0x3083e0[_0xd8c0('0x33')]['type']&&_0x3083e0[_0xd8c0('0x33')][_0xd8c0('0x30')]==='uniqueid'){_0x4e424e[_0xd8c0('0x4f')]=_0x3083e0[_0xd8c0('0x49')]['id'];}else{_0x4e424e['id']=_0x3083e0[_0xd8c0('0x49')]['id'];}return db[_0xd8c0('0x2d')][_0xd8c0('0x4a')]({'where':_0x4e424e,'attributes':['id',_0xd8c0('0x50'),_0xd8c0('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1aae15,null))[_0xd8c0('0x28')](function(_0x5e7295){if(_0x5e7295){var _0x31bfb6=_0x5e7295['savePath'];var _0x180d74=util[_0xd8c0('0x52')](_0xd8c0('0x53'),_0x31bfb6);if(fs[_0xd8c0('0x54')](_0x180d74)){_0x1b5a8e=!![];return _0x1b5643[_0xd8c0('0x55')](_0x180d74,_0x31bfb6,config[_0xd8c0('0x56')][_0xd8c0('0x57')])[_0xd8c0('0x28')](function(){return _0x5e7295;});}return _0x5e7295;}})[_0xd8c0('0x28')](function(_0x178876){if(_0x178876){var _0x32c249=_0x178876[_0xd8c0('0x50')];if(!fs[_0xd8c0('0x54')](_0x32c249)){throw new db[(_0xd8c0('0x58'))]['ValidationError'](_0xd8c0('0x59'));}if(_0x178876['filename']){return _0x1aae15['download'](_0x32c249,_0x178876[_0xd8c0('0x51')]+path['extname'](_0x32c249),function(){if(_0x1b5a8e){fs[_0xd8c0('0x5a')](_0x32c249);}});}else{return _0x1aae15[_0xd8c0('0x4d')](_0x32c249,function(_0x25ad66){if(_0x1b5a8e){fs[_0xd8c0('0x5a')](_0x32c249);}});}}})[_0xd8c0('0x47')](function(_0x3b5713){if(_0x3b5713[_0xd8c0('0x5b')]===_0xd8c0('0x59')){_0x1aae15[_0xd8c0('0x1b')](0x194)[_0xd8c0('0x5c')](_0xd8c0('0x5d'));}else{return handleError(_0x1aae15,null);}});};exports[_0xd8c0('0x27')]=function(_0x23607d,_0x2b3e45){return db[_0xd8c0('0x2d')]['find']({'where':{'id':_0x23607d[_0xd8c0('0x49')]['id']}})['then'](function(_0x5ce7b5){if(_['isNil'](_0x5ce7b5)){throw new ReferenceError(_0xd8c0('0x5e'));}return _0x5ce7b5;})[_0xd8c0('0x28')](function(_0x505b0c){var _0x399059=_0x505b0c[_0xd8c0('0x50')];logger[_0xd8c0('0x5f')](_0xd8c0('0x60'),_0x399059);if(!_[_0xd8c0('0x61')](_0x505b0c[_0xd8c0('0x50')])&&fs[_0xd8c0('0x54')](_0x399059)){logger[_0xd8c0('0x5f')](_0xd8c0('0x62')+_0x399059+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x399059);}_0x399059=_0x399059+_0xd8c0('0x63');if(!_[_0xd8c0('0x61')](_0x505b0c[_0xd8c0('0x50')])&&fs[_0xd8c0('0x54')](_0x399059)){logger[_0xd8c0('0x5f')](_0xd8c0('0x62')+_0x399059+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x399059);}return _0x505b0c;})['then'](function(_0x49073b){if(!_0x49073b)throw new InternalError();return _0x49073b[_0xd8c0('0x27')]();})[_0xd8c0('0x28')](function(){_0x2b3e45[_0xd8c0('0x1b')](0xcc)['end']();})['catch'](handleError(_0x2b3e45,null));};
\ No newline at end of file
index 4ff8d33..e28b6cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd663=['api','moment','bluebird','request-promise','path','../../config/environment','define','lodash','util'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xd663,0x1ed));var _0x3d66=function(_0x3f6ea5,_0x32095a){_0x3f6ea5=_0x3f6ea5-0x0;var _0x13b604=_0xd663[_0x3f6ea5];return _0x13b604;};'use strict';var _=require(_0x3d66('0x0'));var util=require(_0x3d66('0x1'));var logger=require('../../config/logger')(_0x3d66('0x2'));var moment=require(_0x3d66('0x3'));var BPromise=require(_0x3d66('0x4'));var rp=require(_0x3d66('0x5'));var fs=require('fs');var path=require(_0x3d66('0x6'));var rimraf=require('rimraf');var config=require(_0x3d66('0x7'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x5b7bf3,_0x4f2b7a){return _0x5b7bf3[_0x3d66('0x8')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e4d=['rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','../../config/logger','request-promise','path'];(function(_0x43d373,_0x430bcc){var _0x17e486=function(_0x2aed64){while(--_0x2aed64){_0x43d373['push'](_0x43d373['shift']());}};_0x17e486(++_0x430bcc);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x5d60ed,_0x38684f){_0x5d60ed=_0x5d60ed-0x0;var _0x3e7c34=_0x3e4d[_0x5d60ed];return _0x3e7c34;};'use strict';var _=require(_0xd3e4('0x0'));var util=require('util');var logger=require(_0xd3e4('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd3e4('0x2'));var fs=require('fs');var path=require(_0xd3e4('0x3'));var rimraf=require(_0xd3e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xd3e4('0x5'));module['exports']=function(_0x4b9a10,_0x7b42fe){return _0x4b9a10[_0xd3e4('0x6')](_0xd3e4('0x7'),attributes,{'tableName':_0xd3e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f573aa0..7399416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73cb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','error','code','message','SquareRecording,\x20%s,\x20%s','info','result','CreateSquareRecording','body','options','raw','debug','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x73cb,0x1d6));var _0xb73c=function(_0x55d679,_0x236d94){_0x55d679=_0x55d679-0x0;var _0x4c82e7=_0x73cb[_0x55d679];return _0x4c82e7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb73c('0x0'));var BPromise=require(_0xb73c('0x1'));var rs=require(_0xb73c('0x2'));var fs=require('fs');var Redis=require(_0xb73c('0x3'));var db=require(_0xb73c('0x4'))['db'];var utils=require(_0xb73c('0x5'));var logger=require(_0xb73c('0x6'))(_0xb73c('0x7'));var config=require(_0xb73c('0x8'));var jayson=require(_0xb73c('0x9'));var client=jayson['client'][_0xb73c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25d228,_0x47fe2f,_0x1e291a){return new BPromise(function(_0x3cdc66,_0x2cf304){return client[_0xb73c('0xb')](_0x25d228,_0x1e291a)['then'](function(_0x365a7a){logger['info']('SquareRecording,\x20%s,\x20%s',_0x47fe2f,_0xb73c('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x47fe2f,_0xb73c('0xc'),JSON['stringify'](_0x365a7a));if(_0x365a7a[_0xb73c('0xd')]){if(_0x365a7a[_0xb73c('0xd')][_0xb73c('0xe')]===0x1f4){logger[_0xb73c('0xd')]('SquareRecording,\x20%s,\x20%s',_0x47fe2f,_0x365a7a[_0xb73c('0xd')][_0xb73c('0xf')]);return _0x2cf304(_0x365a7a[_0xb73c('0xd')][_0xb73c('0xf')]);}logger[_0xb73c('0xd')](_0xb73c('0x10'),_0x47fe2f,_0x365a7a[_0xb73c('0xd')]['message']);return _0x3cdc66(_0x365a7a[_0xb73c('0xd')][_0xb73c('0xf')]);}else{logger[_0xb73c('0x11')](_0xb73c('0x10'),_0x47fe2f,'request\x20sent');_0x3cdc66(_0x365a7a[_0xb73c('0x12')][_0xb73c('0xf')]);}})['catch'](function(_0x30c872){logger[_0xb73c('0xd')](_0xb73c('0x10'),_0x47fe2f,_0x30c872);_0x2cf304(_0x30c872);});});}exports[_0xb73c('0x13')]=function(_0x3a376d){var _0xb9733d=this;return new Promise(function(_0x120bb3,_0x52f683){return db['SquareRecording']['create'](_0x3a376d[_0xb73c('0x14')],{'raw':_0x3a376d[_0xb73c('0x15')]?_0x3a376d[_0xb73c('0x15')][_0xb73c('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1889f4){logger['info'](_0xb73c('0x13'),_0x3a376d);logger[_0xb73c('0x17')](_0xb73c('0x13'),_0x3a376d,JSON[_0xb73c('0x18')](_0x1889f4));_0x120bb3(_0x1889f4);})['catch'](function(_0x5c09ee){logger['error'](_0xb73c('0x13'),_0x5c09ee[_0xb73c('0xf')],_0x3a376d);_0x52f683(_0xb9733d[_0xb73c('0xd')](0x1f4,_0x5c09ee[_0xb73c('0xf')]));});});};
\ No newline at end of file
+var _0x92cf=['../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','code','message','error','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3dc55d,_0xd07e93){var _0x3aa7f3=function(_0x506b46){while(--_0x506b46){_0x3dc55d['push'](_0x3dc55d['shift']());}};_0x3aa7f3(++_0xd07e93);}(_0x92cf,0x1c9));var _0xf92c=function(_0x527a53,_0x3265d6){_0x527a53=_0x527a53-0x0;var _0x2332f5=_0x92cf[_0x527a53];return _0x2332f5;};'use strict';var _=require('lodash');var util=require(_0xf92c('0x0'));var moment=require(_0xf92c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf92c('0x2'));var fs=require('fs');var Redis=require(_0xf92c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf92c('0x4'));var logger=require(_0xf92c('0x5'))(_0xf92c('0x6'));var config=require(_0xf92c('0x7'));var jayson=require(_0xf92c('0x8'));var client=jayson[_0xf92c('0x9')][_0xf92c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31e360,_0x267165,_0x30a0f1){return new BPromise(function(_0x403c39,_0x4199e4){return client[_0xf92c('0xb')](_0x31e360,_0x30a0f1)[_0xf92c('0xc')](function(_0x5adb7d){logger[_0xf92c('0xd')](_0xf92c('0xe'),_0x267165,_0xf92c('0xf'));logger[_0xf92c('0x10')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x267165,_0xf92c('0xf'),JSON[_0xf92c('0x11')](_0x5adb7d));if(_0x5adb7d['error']){if(_0x5adb7d['error'][_0xf92c('0x12')]===0x1f4){logger['error'](_0xf92c('0xe'),_0x267165,_0x5adb7d['error'][_0xf92c('0x13')]);return _0x4199e4(_0x5adb7d['error']['message']);}logger['error']('SquareRecording,\x20%s,\x20%s',_0x267165,_0x5adb7d[_0xf92c('0x14')][_0xf92c('0x13')]);return _0x403c39(_0x5adb7d[_0xf92c('0x14')][_0xf92c('0x13')]);}else{logger[_0xf92c('0xd')](_0xf92c('0xe'),_0x267165,_0xf92c('0xf'));_0x403c39(_0x5adb7d[_0xf92c('0x15')][_0xf92c('0x13')]);}})[_0xf92c('0x16')](function(_0x2e5b94){logger[_0xf92c('0x14')](_0xf92c('0xe'),_0x267165,_0x2e5b94);_0x4199e4(_0x2e5b94);});});}exports[_0xf92c('0x17')]=function(_0x54c1ea){var _0x289c0d=this;return new Promise(function(_0x5a1ee2,_0x3d06d6){return db[_0xf92c('0x18')][_0xf92c('0x19')](_0x54c1ea[_0xf92c('0x1a')],{'raw':_0x54c1ea[_0xf92c('0x1b')]?_0x54c1ea['options'][_0xf92c('0x1c')]===undefined?!![]:![]:!![]})[_0xf92c('0xc')](function(_0xa83806){logger['info']('CreateSquareRecording',_0x54c1ea);logger[_0xf92c('0x10')](_0xf92c('0x17'),_0x54c1ea,JSON[_0xf92c('0x11')](_0xa83806));_0x5a1ee2(_0xa83806);})[_0xf92c('0x16')](function(_0x39555){logger[_0xf92c('0x14')](_0xf92c('0x17'),_0x39555[_0xf92c('0x13')],_0x54c1ea);_0x3d06d6(_0x289c0d[_0xf92c('0x14')](0x1f4,_0x39555[_0xf92c('0x13')]));});});};
\ No newline at end of file
index 4907d8d..1244310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x21f0c4,_0xa82bf1){var _0x3ad0e0=function(_0x4cafe2){while(--_0x4cafe2){_0x21f0c4['push'](_0x21f0c4['shift']());}};_0x3ad0e0(++_0xa82bf1);}(_0xe706,0xa3));var _0x6e70=function(_0x4d525c,_0x277dac){_0x4d525c=_0x4d525c-0x0;var _0x3f0655=_0xe706[_0x4d525c];return _0x3f0655;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
+var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x42a721,_0x2098e5){var _0x300148=function(_0x585f3c){while(--_0x585f3c){_0x42a721['push'](_0x42a721['shift']());}};_0x300148(++_0x2098e5);}(_0xe706,0xa3));var _0x6e70=function(_0x3a3c3d,_0x3b8542){_0x3a3c3d=_0x3a3c3d-0x0;var _0xf3142f=_0xe706[_0x3a3c3d];return _0xf3142f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router;
\ No newline at end of file
index 6aecc93..a035f1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b3a=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0x0b3a,0x114));var _0xa0b3=function(_0x2e6c19,_0x131233){_0x2e6c19=_0x2e6c19-0x0;var _0x52885d=_0x0b3a[_0x2e6c19];return _0x52885d;};'use strict';var Sequelize=require(_0xa0b3('0x0'));module['exports']={'network':{'type':Sequelize[_0xa0b3('0x1')]},'network_script':{'type':Sequelize[_0xa0b3('0x1')]},'request':{'type':Sequelize[_0xa0b3('0x1')]},'channel':{'type':Sequelize[_0xa0b3('0x1')]},'language':{'type':Sequelize[_0xa0b3('0x1')]},'type':{'type':Sequelize[_0xa0b3('0x1')]},'uniqueid':{'type':Sequelize[_0xa0b3('0x1')]},'version':{'type':Sequelize[_0xa0b3('0x1')]},'callerid':{'type':Sequelize[_0xa0b3('0x1')]},'calleridname':{'type':Sequelize[_0xa0b3('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa0b3('0x1')]},'callington':{'type':Sequelize[_0xa0b3('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xa0b3('0x1')]},'rdnis':{'type':Sequelize[_0xa0b3('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa0b3('0x1')]},'priority':{'type':Sequelize[_0xa0b3('0x1')]},'enhanced':{'type':Sequelize[_0xa0b3('0x1')]},'accountcode':{'type':Sequelize[_0xa0b3('0x1')]},'threadid':{'type':Sequelize[_0xa0b3('0x1')]},'project_name':{'type':Sequelize[_0xa0b3('0x1')]},'joinAt':{'type':Sequelize[_0xa0b3('0x2')]},'leaveAt':{'type':Sequelize[_0xa0b3('0x2')]},'bot':{'type':Sequelize[_0xa0b3('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2c12=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0xf085c9,_0x47b098){var _0x45a63c=function(_0x15783b){while(--_0x15783b){_0xf085c9['push'](_0xf085c9['shift']());}};_0x45a63c(++_0x47b098);}(_0x2c12,0x1b4));var _0x22c1=function(_0x32b993,_0x1c5989){_0x32b993=_0x32b993-0x0;var _0x482780=_0x2c12[_0x32b993];return _0x482780;};'use strict';var Sequelize=require(_0x22c1('0x0'));module[_0x22c1('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x22c1('0x2')]},'channel':{'type':Sequelize[_0x22c1('0x2')]},'language':{'type':Sequelize[_0x22c1('0x2')]},'type':{'type':Sequelize[_0x22c1('0x2')]},'uniqueid':{'type':Sequelize[_0x22c1('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x22c1('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x22c1('0x2')]},'callington':{'type':Sequelize[_0x22c1('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x22c1('0x2')]},'context':{'type':Sequelize[_0x22c1('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x22c1('0x2')]},'enhanced':{'type':Sequelize[_0x22c1('0x2')]},'accountcode':{'type':Sequelize[_0x22c1('0x2')]},'threadid':{'type':Sequelize[_0x22c1('0x2')]},'project_name':{'type':Sequelize[_0x22c1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x22c1('0x3')]},'bot':{'type':Sequelize[_0x22c1('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 287898c..6b845db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae8f=['keys','length','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0xae8f,0xa6));var _0xfae8=function(_0x137f1a,_0x2887df){_0x137f1a=_0x137f1a-0x0;var _0x439923=_0xae8f[_0x137f1a];return _0x439923;};'use strict';var emlformat=require(_0xfae8('0x0'));var rimraf=require(_0xfae8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfae8('0x2'));var rp=require(_0xfae8('0x3'));var moment=require(_0xfae8('0x4'));var BPromise=require(_0xfae8('0x5'));var Mustache=require(_0xfae8('0x6'));var util=require('util');var path=require(_0xfae8('0x7'));var sox=require(_0xfae8('0x8'));var csv=require(_0xfae8('0x9'));var ejs=require(_0xfae8('0xa'));var fs=require('fs');var fs_extra=require(_0xfae8('0xb'));var _=require(_0xfae8('0xc'));var squel=require(_0xfae8('0xd'));var crypto=require(_0xfae8('0xe'));var jsforce=require(_0xfae8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfae8('0x10'));var Papa=require(_0xfae8('0x11'));var Redis=require(_0xfae8('0x12'));var authService=require(_0xfae8('0x13'));var qs=require(_0xfae8('0x14'));var as=require(_0xfae8('0x15'));var hardwareService=require(_0xfae8('0x16'));var logger=require(_0xfae8('0x17'))(_0xfae8('0x18'));var utils=require(_0xfae8('0x19'));var config=require(_0xfae8('0x1a'));var licenseUtil=require(_0xfae8('0x1b'));var db=require(_0xfae8('0x1c'))['db'];function respondWithStatusCode(_0x2e6541,_0x20a542){_0x20a542=_0x20a542||0xcc;return function(_0x205af1){if(_0x205af1){return _0x2e6541['sendStatus'](_0x20a542);}return _0x2e6541[_0xfae8('0x1d')](_0x20a542)['end']();};}function respondWithResult(_0x118f71,_0x20835e){_0x20835e=_0x20835e||0xc8;return function(_0x5c744d){if(_0x5c744d){return _0x118f71[_0xfae8('0x1d')](_0x20835e)['json'](_0x5c744d);}};}function respondWithFilteredResult(_0x53e47a,_0x4abbc2){return function(_0xa43a2b){if(_0xa43a2b){var _0x47adf3=typeof _0x4abbc2[_0xfae8('0x1e')]==='undefined'&&typeof _0x4abbc2[_0xfae8('0x1f')]==='undefined';var _0x146910=_0xa43a2b[_0xfae8('0x20')];var _0xfefeff=_0x47adf3?0x0:_0x4abbc2['offset'];var _0xd6ea28=_0x47adf3?_0xa43a2b['count']:_0x4abbc2[_0xfae8('0x1e')]+_0x4abbc2['limit'];var _0x1268e2;if(_0xd6ea28>=_0x146910){_0xd6ea28=_0x146910;_0x1268e2=0xc8;}else{_0x1268e2=0xce;}_0x53e47a[_0xfae8('0x1d')](_0x1268e2);return _0x53e47a[_0xfae8('0x21')](_0xfae8('0x22'),_0xfefeff+'-'+_0xd6ea28+'/'+_0x146910)[_0xfae8('0x23')](_0xa43a2b);}return null;};}function patchUpdates(_0x5abead){return function(_0x364e2c){try{jsonpatch['apply'](_0x364e2c,_0x5abead,!![]);}catch(_0x4f0ee6){return BPromise[_0xfae8('0x24')](_0x4f0ee6);}return _0x364e2c[_0xfae8('0x25')]();};}function saveUpdates(_0x405941,_0x38b7d4){return function(_0x281691){if(_0x281691){return _0x281691[_0xfae8('0x26')](_0x405941)[_0xfae8('0x27')](function(_0x1233bd){return _0x1233bd;});}return null;};}function removeEntity(_0x106d4a,_0x348ab3){return function(_0x16d237){if(_0x16d237){return _0x16d237['destroy']()['then'](function(){_0x106d4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x560c0a,_0x59e461){return function(_0x8fc30a){if(!_0x8fc30a){_0x560c0a['sendStatus'](0x194);}return _0x8fc30a;};}function handleError(_0xc4701e,_0x26ae7d){_0x26ae7d=_0x26ae7d||0x1f4;return function(_0x4ccfa0){logger[_0xfae8('0x28')](_0x4ccfa0[_0xfae8('0x29')]);if(_0x4ccfa0['name']){delete _0x4ccfa0[_0xfae8('0x2a')];}_0xc4701e[_0xfae8('0x1d')](_0x26ae7d)[_0xfae8('0x2b')](_0x4ccfa0);};}exports[_0xfae8('0x2c')]=function(_0x25418b,_0x483089){var _0x3cec43={},_0x2b2d18={},_0x4ecbcb={'count':0x0,'rows':[]};var _0x356393=_[_0xfae8('0x2d')](db[_0xfae8('0x2e')][_0xfae8('0x2f')],function(_0x3550af){return{'name':_0x3550af[_0xfae8('0x30')],'type':_0x3550af[_0xfae8('0x31')][_0xfae8('0x32')]};});_0x2b2d18[_0xfae8('0x33')]=_[_0xfae8('0x2d')](_0x356393,_0xfae8('0x2a'));_0x2b2d18['query']=_['keys'](_0x25418b[_0xfae8('0x34')]);_0x2b2d18[_0xfae8('0x35')]=_['intersection'](_0x2b2d18[_0xfae8('0x33')],_0x2b2d18['query']);_0x3cec43[_0xfae8('0x36')]=_[_0xfae8('0x37')](_0x2b2d18['model'],qs['fields'](_0x25418b[_0xfae8('0x34')][_0xfae8('0x38')]));_0x3cec43[_0xfae8('0x36')]=_0x3cec43[_0xfae8('0x36')]['length']?_0x3cec43[_0xfae8('0x36')]:_0x2b2d18[_0xfae8('0x33')];if(!_0x25418b['query'][_0xfae8('0x39')](_0xfae8('0x3a'))){_0x3cec43[_0xfae8('0x1f')]=qs['limit'](_0x25418b['query'][_0xfae8('0x1f')]);_0x3cec43['offset']=qs[_0xfae8('0x1e')](_0x25418b[_0xfae8('0x34')][_0xfae8('0x1e')]);}_0x3cec43[_0xfae8('0x3b')]=qs[_0xfae8('0x3c')](_0x25418b[_0xfae8('0x34')]['sort']);_0x3cec43['where']=qs[_0xfae8('0x35')](_['pick'](_0x25418b[_0xfae8('0x34')],_0x2b2d18[_0xfae8('0x35')]),_0x356393);if(_0x25418b[_0xfae8('0x34')][_0xfae8('0x3d')]){_0x3cec43[_0xfae8('0x3e')]=_[_0xfae8('0x3f')](_0x3cec43[_0xfae8('0x3e')],{'$or':_[_0xfae8('0x2d')](_0x356393,function(_0x79fe54){if(_0x79fe54[_0xfae8('0x31')]!==_0xfae8('0x40')){var _0x4d8aca={};_0x4d8aca[_0x79fe54[_0xfae8('0x2a')]]={'$like':'%'+_0x25418b[_0xfae8('0x34')]['filter']+'%'};return _0x4d8aca;}})});}_0x3cec43=_['merge']({},_0x3cec43,_0x25418b[_0xfae8('0x41')]);var _0xeb0283={'where':_0x3cec43[_0xfae8('0x3e')]};return db[_0xfae8('0x2e')][_0xfae8('0x20')](_0xeb0283)[_0xfae8('0x27')](function(_0x3b7550){_0x4ecbcb[_0xfae8('0x20')]=_0x3b7550;if(_0x25418b[_0xfae8('0x34')]['includeAll']){_0x3cec43[_0xfae8('0x42')]=[{'all':!![]}];}return db[_0xfae8('0x2e')][_0xfae8('0x43')](_0x3cec43);})[_0xfae8('0x27')](function(_0x3e161c){_0x4ecbcb['rows']=_0x3e161c;return _0x4ecbcb;})[_0xfae8('0x27')](respondWithFilteredResult(_0x483089,_0x3cec43))[_0xfae8('0x44')](handleError(_0x483089,null));};exports[_0xfae8('0x45')]=function(_0x27f727,_0x5d885e){var _0x21ac3b={'raw':!![],'where':{'id':_0x27f727[_0xfae8('0x46')]['id']}},_0x4e2356={};_0x4e2356['model']=_[_0xfae8('0x47')](db['SquareReport'][_0xfae8('0x2f')]);_0x4e2356['query']=_[_0xfae8('0x47')](_0x27f727[_0xfae8('0x34')]);_0x4e2356['filters']=_[_0xfae8('0x37')](_0x4e2356[_0xfae8('0x33')],_0x4e2356[_0xfae8('0x34')]);_0x21ac3b[_0xfae8('0x36')]=_[_0xfae8('0x37')](_0x4e2356[_0xfae8('0x33')],qs[_0xfae8('0x38')](_0x27f727[_0xfae8('0x34')][_0xfae8('0x38')]));_0x21ac3b[_0xfae8('0x36')]=_0x21ac3b['attributes'][_0xfae8('0x48')]?_0x21ac3b[_0xfae8('0x36')]:_0x4e2356[_0xfae8('0x33')];if(_0x27f727[_0xfae8('0x34')][_0xfae8('0x49')]){_0x21ac3b['include']=[{'all':!![]}];}_0x21ac3b=_['merge']({},_0x21ac3b,_0x27f727[_0xfae8('0x41')]);return db[_0xfae8('0x2e')][_0xfae8('0x4a')](_0x21ac3b)['then'](handleEntityNotFound(_0x5d885e,null))['then'](respondWithResult(_0x5d885e,null))['catch'](handleError(_0x5d885e,null));};exports[_0xfae8('0x4b')]=function(_0x3fc8a6,_0x59c8cd){return db[_0xfae8('0x2e')][_0xfae8('0x4b')](_0x3fc8a6[_0xfae8('0x4c')],{})[_0xfae8('0x27')](respondWithResult(_0x59c8cd,0xc9))[_0xfae8('0x44')](handleError(_0x59c8cd,null));};exports[_0xfae8('0x26')]=function(_0x506ee6,_0x4a4421){if(_0x506ee6[_0xfae8('0x4c')]['id']){delete _0x506ee6['body']['id'];}return db['SquareReport'][_0xfae8('0x4a')]({'where':{'id':_0x506ee6[_0xfae8('0x46')]['id']}})[_0xfae8('0x27')](handleEntityNotFound(_0x4a4421,null))[_0xfae8('0x27')](saveUpdates(_0x506ee6[_0xfae8('0x4c')],null))['then'](respondWithResult(_0x4a4421,null))[_0xfae8('0x44')](handleError(_0x4a4421,null));};exports[_0xfae8('0x4d')]=function(_0x443947,_0x3e2eb1){return db['SquareReport'][_0xfae8('0x4a')]({'where':{'id':_0x443947['params']['id']}})[_0xfae8('0x27')](handleEntityNotFound(_0x3e2eb1,null))[_0xfae8('0x27')](removeEntity(_0x3e2eb1,null))[_0xfae8('0x44')](handleError(_0x3e2eb1,null));};exports['describe']=function(_0x8fd38f,_0x21e459){return db[_0xfae8('0x2e')][_0xfae8('0x4e')]()[_0xfae8('0x27')](respondWithResult(_0x21e459,null))[_0xfae8('0x44')](handleError(_0x21e459,null));};
\ No newline at end of file
+var _0x3431=['undefined','limit','count','offset','set','reject','save','then','error','stack','name','send','index','map','SquareReport','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','show','params','rawAttributes','fields','includeAll','include','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json'];(function(_0x15d9b6,_0x4e0772){var _0xb44729=function(_0x4d9e0c){while(--_0x4d9e0c){_0x15d9b6['push'](_0x15d9b6['shift']());}};_0xb44729(++_0x4e0772);}(_0x3431,0xc0));var _0x1343=function(_0x2f48cd,_0x46a75a){_0x2f48cd=_0x2f48cd-0x0;var _0x193ae2=_0x3431[_0x2f48cd];return _0x193ae2;};'use strict';var emlformat=require(_0x1343('0x0'));var rimraf=require(_0x1343('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1343('0x2'));var rp=require(_0x1343('0x3'));var moment=require(_0x1343('0x4'));var BPromise=require(_0x1343('0x5'));var Mustache=require(_0x1343('0x6'));var util=require('util');var path=require(_0x1343('0x7'));var sox=require(_0x1343('0x8'));var csv=require(_0x1343('0x9'));var ejs=require(_0x1343('0xa'));var fs=require('fs');var fs_extra=require(_0x1343('0xb'));var _=require(_0x1343('0xc'));var squel=require(_0x1343('0xd'));var crypto=require(_0x1343('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1343('0xf'));var toCsv=require(_0x1343('0x9'));var querystring=require(_0x1343('0x10'));var Papa=require(_0x1343('0x11'));var Redis=require(_0x1343('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1343('0x13'));var as=require(_0x1343('0x14'));var hardwareService=require(_0x1343('0x15'));var logger=require(_0x1343('0x16'))(_0x1343('0x17'));var utils=require(_0x1343('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1343('0x19'))['db'];function respondWithStatusCode(_0x589c14,_0x21e379){_0x21e379=_0x21e379||0xcc;return function(_0x37662f){if(_0x37662f){return _0x589c14[_0x1343('0x1a')](_0x21e379);}return _0x589c14[_0x1343('0x1b')](_0x21e379)[_0x1343('0x1c')]();};}function respondWithResult(_0x4247bc,_0x53ca94){_0x53ca94=_0x53ca94||0xc8;return function(_0x46d99d){if(_0x46d99d){return _0x4247bc[_0x1343('0x1b')](_0x53ca94)[_0x1343('0x1d')](_0x46d99d);}};}function respondWithFilteredResult(_0x2706d9,_0x3794db){return function(_0x5c923e){if(_0x5c923e){var _0x4839de=typeof _0x3794db['offset']===_0x1343('0x1e')&&typeof _0x3794db[_0x1343('0x1f')]===_0x1343('0x1e');var _0x4230bf=_0x5c923e[_0x1343('0x20')];var _0x39b6d6=_0x4839de?0x0:_0x3794db[_0x1343('0x21')];var _0x402cc0=_0x4839de?_0x5c923e[_0x1343('0x20')]:_0x3794db[_0x1343('0x21')]+_0x3794db['limit'];var _0x2b61a0;if(_0x402cc0>=_0x4230bf){_0x402cc0=_0x4230bf;_0x2b61a0=0xc8;}else{_0x2b61a0=0xce;}_0x2706d9[_0x1343('0x1b')](_0x2b61a0);return _0x2706d9[_0x1343('0x22')]('Content-Range',_0x39b6d6+'-'+_0x402cc0+'/'+_0x4230bf)[_0x1343('0x1d')](_0x5c923e);}return null;};}function patchUpdates(_0x2488fe){return function(_0x333eef){try{jsonpatch['apply'](_0x333eef,_0x2488fe,!![]);}catch(_0x2c9efe){return BPromise[_0x1343('0x23')](_0x2c9efe);}return _0x333eef[_0x1343('0x24')]();};}function saveUpdates(_0xc1171a,_0x50d03f){return function(_0x1f64d9){if(_0x1f64d9){return _0x1f64d9['update'](_0xc1171a)[_0x1343('0x25')](function(_0x52a0a0){return _0x52a0a0;});}return null;};}function removeEntity(_0x433e82,_0x399205){return function(_0x3a757f){if(_0x3a757f){return _0x3a757f['destroy']()[_0x1343('0x25')](function(){_0x433e82[_0x1343('0x1b')](0xcc)[_0x1343('0x1c')]();});}};}function handleEntityNotFound(_0x24c940,_0x13e078){return function(_0x5c1f90){if(!_0x5c1f90){_0x24c940[_0x1343('0x1a')](0x194);}return _0x5c1f90;};}function handleError(_0x3091c0,_0x3b562e){_0x3b562e=_0x3b562e||0x1f4;return function(_0x2d79c9){logger[_0x1343('0x26')](_0x2d79c9[_0x1343('0x27')]);if(_0x2d79c9[_0x1343('0x28')]){delete _0x2d79c9[_0x1343('0x28')];}_0x3091c0['status'](_0x3b562e)[_0x1343('0x29')](_0x2d79c9);};}exports[_0x1343('0x2a')]=function(_0x5279d4,_0x193b23){var _0x1dac67={},_0x51d364={},_0x258bd8={'count':0x0,'rows':[]};var _0x71f6c=_[_0x1343('0x2b')](db[_0x1343('0x2c')]['rawAttributes'],function(_0xe9709f){return{'name':_0xe9709f['fieldName'],'type':_0xe9709f[_0x1343('0x2d')][_0x1343('0x2e')]};});_0x51d364[_0x1343('0x2f')]=_[_0x1343('0x2b')](_0x71f6c,_0x1343('0x28'));_0x51d364['query']=_[_0x1343('0x30')](_0x5279d4[_0x1343('0x31')]);_0x51d364[_0x1343('0x32')]=_[_0x1343('0x33')](_0x51d364[_0x1343('0x2f')],_0x51d364[_0x1343('0x31')]);_0x1dac67[_0x1343('0x34')]=_['intersection'](_0x51d364['model'],qs['fields'](_0x5279d4[_0x1343('0x31')]['fields']));_0x1dac67[_0x1343('0x34')]=_0x1dac67[_0x1343('0x34')][_0x1343('0x35')]?_0x1dac67[_0x1343('0x34')]:_0x51d364['model'];if(!_0x5279d4['query'][_0x1343('0x36')]('nolimit')){_0x1dac67['limit']=qs[_0x1343('0x1f')](_0x5279d4['query'][_0x1343('0x1f')]);_0x1dac67[_0x1343('0x21')]=qs[_0x1343('0x21')](_0x5279d4[_0x1343('0x31')]['offset']);}_0x1dac67[_0x1343('0x37')]=qs[_0x1343('0x38')](_0x5279d4[_0x1343('0x31')][_0x1343('0x38')]);_0x1dac67[_0x1343('0x39')]=qs['filters'](_[_0x1343('0x3a')](_0x5279d4['query'],_0x51d364['filters']),_0x71f6c);if(_0x5279d4[_0x1343('0x31')][_0x1343('0x3b')]){_0x1dac67[_0x1343('0x39')]=_[_0x1343('0x3c')](_0x1dac67[_0x1343('0x39')],{'$or':_[_0x1343('0x2b')](_0x71f6c,function(_0x35c00a){if(_0x35c00a[_0x1343('0x2d')]!==_0x1343('0x3d')){var _0x1eeb4b={};_0x1eeb4b[_0x35c00a[_0x1343('0x28')]]={'$like':'%'+_0x5279d4['query'][_0x1343('0x3b')]+'%'};return _0x1eeb4b;}})});}_0x1dac67=_['merge']({},_0x1dac67,_0x5279d4['options']);var _0x3ccb10={'where':_0x1dac67[_0x1343('0x39')]};return db[_0x1343('0x2c')][_0x1343('0x20')](_0x3ccb10)[_0x1343('0x25')](function(_0x40ad53){_0x258bd8[_0x1343('0x20')]=_0x40ad53;if(_0x5279d4[_0x1343('0x31')]['includeAll']){_0x1dac67['include']=[{'all':!![]}];}return db[_0x1343('0x2c')]['findAll'](_0x1dac67);})[_0x1343('0x25')](function(_0x2d423d){_0x258bd8['rows']=_0x2d423d;return _0x258bd8;})['then'](respondWithFilteredResult(_0x193b23,_0x1dac67))['catch'](handleError(_0x193b23,null));};exports[_0x1343('0x3e')]=function(_0x570fd0,_0x406690){var _0x23ae6e={'raw':!![],'where':{'id':_0x570fd0[_0x1343('0x3f')]['id']}},_0x2d4bae={};_0x2d4bae[_0x1343('0x2f')]=_[_0x1343('0x30')](db[_0x1343('0x2c')][_0x1343('0x40')]);_0x2d4bae[_0x1343('0x31')]=_[_0x1343('0x30')](_0x570fd0[_0x1343('0x31')]);_0x2d4bae['filters']=_[_0x1343('0x33')](_0x2d4bae[_0x1343('0x2f')],_0x2d4bae['query']);_0x23ae6e[_0x1343('0x34')]=_['intersection'](_0x2d4bae[_0x1343('0x2f')],qs['fields'](_0x570fd0[_0x1343('0x31')][_0x1343('0x41')]));_0x23ae6e[_0x1343('0x34')]=_0x23ae6e[_0x1343('0x34')][_0x1343('0x35')]?_0x23ae6e[_0x1343('0x34')]:_0x2d4bae[_0x1343('0x2f')];if(_0x570fd0[_0x1343('0x31')][_0x1343('0x42')]){_0x23ae6e[_0x1343('0x43')]=[{'all':!![]}];}_0x23ae6e=_[_0x1343('0x3c')]({},_0x23ae6e,_0x570fd0['options']);return db['SquareReport'][_0x1343('0x44')](_0x23ae6e)[_0x1343('0x25')](handleEntityNotFound(_0x406690,null))[_0x1343('0x25')](respondWithResult(_0x406690,null))[_0x1343('0x45')](handleError(_0x406690,null));};exports[_0x1343('0x46')]=function(_0x4b66ae,_0x100946){return db['SquareReport'][_0x1343('0x46')](_0x4b66ae[_0x1343('0x47')],{})[_0x1343('0x25')](respondWithResult(_0x100946,0xc9))[_0x1343('0x45')](handleError(_0x100946,null));};exports['update']=function(_0x5e79aa,_0x252bcd){if(_0x5e79aa[_0x1343('0x47')]['id']){delete _0x5e79aa['body']['id'];}return db[_0x1343('0x2c')][_0x1343('0x44')]({'where':{'id':_0x5e79aa[_0x1343('0x3f')]['id']}})[_0x1343('0x25')](handleEntityNotFound(_0x252bcd,null))[_0x1343('0x25')](saveUpdates(_0x5e79aa[_0x1343('0x47')],null))['then'](respondWithResult(_0x252bcd,null))['catch'](handleError(_0x252bcd,null));};exports[_0x1343('0x48')]=function(_0x26b257,_0x50d9e1){return db[_0x1343('0x2c')][_0x1343('0x44')]({'where':{'id':_0x26b257[_0x1343('0x3f')]['id']}})[_0x1343('0x25')](handleEntityNotFound(_0x50d9e1,null))[_0x1343('0x25')](removeEntity(_0x50d9e1,null))[_0x1343('0x45')](handleError(_0x50d9e1,null));};exports['describe']=function(_0x43be9a,_0x3fa909){return db[_0x1343('0x2c')][_0x1343('0x49')]()['then'](respondWithResult(_0x3fa909,null))['catch'](handleError(_0x3fa909,null));};
\ No newline at end of file
index a2cbab5..c0c2a6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42d5=['report_square','project_name','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define'];(function(_0x4b66f2,_0x5508c1){var _0x7095e3=function(_0x5e232b){while(--_0x5e232b){_0x4b66f2['push'](_0x4b66f2['shift']());}};_0x7095e3(++_0x5508c1);}(_0x42d5,0xb8));var _0x542d=function(_0x4b1064,_0x1424cf){_0x4b1064=_0x4b1064-0x0;var _0x25ce36=_0x42d5[_0x4b1064];return _0x25ce36;};'use strict';var _=require(_0x542d('0x0'));var util=require(_0x542d('0x1'));var logger=require(_0x542d('0x2'))(_0x542d('0x3'));var moment=require(_0x542d('0x4'));var BPromise=require(_0x542d('0x5'));var rp=require(_0x542d('0x6'));var fs=require('fs');var path=require(_0x542d('0x7'));var rimraf=require(_0x542d('0x8'));var config=require(_0x542d('0x9'));var attributes=require(_0x542d('0xa'));module['exports']=function(_0x1959f8,_0x5a261c){return _0x1959f8[_0x542d('0xb')]('SquareReport',attributes,{'tableName':_0x542d('0xc'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x542d('0xd')]},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc3e4=['report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports'];(function(_0x412c23,_0x53f8fb){var _0x3622df=function(_0x426330){while(--_0x426330){_0x412c23['push'](_0x412c23['shift']());}};_0x3622df(++_0x53f8fb);}(_0xc3e4,0x194));var _0x4c3e=function(_0x24d590,_0x3e4dee){_0x24d590=_0x24d590-0x0;var _0x2bdbe8=_0xc3e4[_0x24d590];return _0x2bdbe8;};'use strict';var _=require(_0x4c3e('0x0'));var util=require(_0x4c3e('0x1'));var logger=require(_0x4c3e('0x2'))(_0x4c3e('0x3'));var moment=require(_0x4c3e('0x4'));var BPromise=require(_0x4c3e('0x5'));var rp=require(_0x4c3e('0x6'));var fs=require('fs');var path=require(_0x4c3e('0x7'));var rimraf=require(_0x4c3e('0x8'));var config=require(_0x4c3e('0x9'));var attributes=require(_0x4c3e('0xa'));module[_0x4c3e('0xb')]=function(_0x2727bf,_0x2d0231){return _0x2727bf['define']('SquareReport',attributes,{'tableName':_0x4c3e('0xc'),'paranoid':![],'indexes':[{'name':_0x4c3e('0xd'),'fields':[_0x4c3e('0xe'),'project_name']},{'name':'leaveAt','fields':[_0x4c3e('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 2ed593b..1f7692a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba07=['debug','stringify','error','message','catch','CreateSquareReport','SquareReport','options','info','UpdateSquareReport','update','body','raw','where','limit','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x101134,_0x1ed1d3){var _0xc47acc=function(_0x7ea469){while(--_0x7ea469){_0x101134['push'](_0x101134['shift']());}};_0xc47acc(++_0x1ed1d3);}(_0xba07,0xff));var _0x7ba0=function(_0x3f9f40,_0x164231){_0x3f9f40=_0x3f9f40-0x0;var _0xc9f7cf=_0xba07[_0x3f9f40];return _0xc9f7cf;};'use strict';var _=require(_0x7ba0('0x0'));var util=require(_0x7ba0('0x1'));var moment=require(_0x7ba0('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ba0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ba0('0x4'));var logger=require(_0x7ba0('0x5'))(_0x7ba0('0x6'));var config=require(_0x7ba0('0x7'));var jayson=require(_0x7ba0('0x8'));var client=jayson[_0x7ba0('0x9')][_0x7ba0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc3db22,_0x533759,_0x58d0d3){return new BPromise(function(_0x4d6eb7,_0x37c29b){return client[_0x7ba0('0xb')](_0xc3db22,_0x58d0d3)[_0x7ba0('0xc')](function(_0x5c3566){logger['info'](_0x7ba0('0xd'),_0x533759,_0x7ba0('0xe'));logger[_0x7ba0('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x533759,_0x7ba0('0xe'),JSON[_0x7ba0('0x10')](_0x5c3566));if(_0x5c3566[_0x7ba0('0x11')]){if(_0x5c3566[_0x7ba0('0x11')]['code']===0x1f4){logger[_0x7ba0('0x11')](_0x7ba0('0xd'),_0x533759,_0x5c3566[_0x7ba0('0x11')][_0x7ba0('0x12')]);return _0x37c29b(_0x5c3566[_0x7ba0('0x11')][_0x7ba0('0x12')]);}logger[_0x7ba0('0x11')](_0x7ba0('0xd'),_0x533759,_0x5c3566[_0x7ba0('0x11')]['message']);return _0x4d6eb7(_0x5c3566[_0x7ba0('0x11')]['message']);}else{logger['info']('SquareReport,\x20%s,\x20%s',_0x533759,_0x7ba0('0xe'));_0x4d6eb7(_0x5c3566['result'][_0x7ba0('0x12')]);}})[_0x7ba0('0x13')](function(_0x41e3bd){logger[_0x7ba0('0x11')](_0x7ba0('0xd'),_0x533759,_0x41e3bd);_0x37c29b(_0x41e3bd);});});}exports[_0x7ba0('0x14')]=function(_0x7e13fa){var _0x474ffd=this;return new Promise(function(_0x53a412,_0x5ed9a9){return db[_0x7ba0('0x15')]['create'](_0x7e13fa['body'],{'raw':_0x7e13fa[_0x7ba0('0x16')]?_0x7e13fa[_0x7ba0('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x34d5ab){logger[_0x7ba0('0x17')]('CreateSquareReport',_0x7e13fa);logger['debug']('CreateSquareReport',_0x7e13fa,JSON[_0x7ba0('0x10')](_0x34d5ab));_0x53a412(_0x34d5ab);})[_0x7ba0('0x13')](function(_0xf0d6f0){logger[_0x7ba0('0x11')](_0x7ba0('0x14'),_0xf0d6f0[_0x7ba0('0x12')],_0x7e13fa);_0x5ed9a9(_0x474ffd[_0x7ba0('0x11')](0x1f4,_0xf0d6f0['message']));});});};exports[_0x7ba0('0x18')]=function(_0x2d39ea){var _0xac6588=this;return new Promise(function(_0x130d83,_0x29d44f){return db[_0x7ba0('0x15')][_0x7ba0('0x19')](_0x2d39ea[_0x7ba0('0x1a')],{'raw':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea[_0x7ba0('0x16')][_0x7ba0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea['options'][_0x7ba0('0x1c')]||null:null,'attributes':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea['options']['attributes']||null:null,'limit':_0x2d39ea[_0x7ba0('0x16')]?_0x2d39ea[_0x7ba0('0x16')][_0x7ba0('0x1d')]||null:null})['then'](function(_0x4d9665){logger[_0x7ba0('0x17')]('UpdateSquareReport',_0x2d39ea);logger[_0x7ba0('0xf')](_0x7ba0('0x18'),_0x2d39ea,JSON['stringify'](_0x4d9665));_0x130d83(_0x4d9665);})[_0x7ba0('0x13')](function(_0x16491f){logger[_0x7ba0('0x11')](_0x7ba0('0x18'),_0x16491f[_0x7ba0('0x12')],_0x2d39ea);_0x29d44f(_0xac6588['error'](0x1f4,_0x16491f[_0x7ba0('0x12')]));});});};
\ No newline at end of file
+var _0x3c76=['UpdateSquareReport','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','SquareReport','options','raw','then','update','body'];(function(_0x35c46e,_0x10deaa){var _0x3f926=function(_0x3a8584){while(--_0x3a8584){_0x35c46e['push'](_0x35c46e['shift']());}};_0x3f926(++_0x10deaa);}(_0x3c76,0x139));var _0x63c7=function(_0x1f3b31,_0x162586){_0x1f3b31=_0x1f3b31-0x0;var _0x58a27e=_0x3c76[_0x1f3b31];return _0x58a27e;};'use strict';var _=require(_0x63c7('0x0'));var util=require('util');var moment=require(_0x63c7('0x1'));var BPromise=require(_0x63c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63c7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x63c7('0x4'));var logger=require('../../config/logger')(_0x63c7('0x5'));var config=require(_0x63c7('0x6'));var jayson=require(_0x63c7('0x7'));var client=jayson[_0x63c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x197d99,_0x1ec142,_0x484fb2){return new BPromise(function(_0xb20944,_0x35b56c){return client['request'](_0x197d99,_0x484fb2)['then'](function(_0x1d1e42){logger[_0x63c7('0x9')](_0x63c7('0xa'),_0x1ec142,'request\x20sent');logger['debug'](_0x63c7('0xb'),_0x1ec142,_0x63c7('0xc'),JSON[_0x63c7('0xd')](_0x1d1e42));if(_0x1d1e42[_0x63c7('0xe')]){if(_0x1d1e42[_0x63c7('0xe')]['code']===0x1f4){logger[_0x63c7('0xe')]('SquareReport,\x20%s,\x20%s',_0x1ec142,_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);return _0x35b56c(_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);}logger['error'](_0x63c7('0xa'),_0x1ec142,_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);return _0xb20944(_0x1d1e42[_0x63c7('0xe')][_0x63c7('0xf')]);}else{logger[_0x63c7('0x9')](_0x63c7('0xa'),_0x1ec142,_0x63c7('0xc'));_0xb20944(_0x1d1e42[_0x63c7('0x10')]['message']);}})[_0x63c7('0x11')](function(_0x35df51){logger[_0x63c7('0xe')]('SquareReport,\x20%s,\x20%s',_0x1ec142,_0x35df51);_0x35b56c(_0x35df51);});});}exports[_0x63c7('0x12')]=function(_0x23cadb){var _0x4cb063=this;return new Promise(function(_0x211703,_0x53e1e5){return db[_0x63c7('0x13')]['create'](_0x23cadb['body'],{'raw':_0x23cadb[_0x63c7('0x14')]?_0x23cadb['options'][_0x63c7('0x15')]===undefined?!![]:![]:!![]})[_0x63c7('0x16')](function(_0x23649e){logger[_0x63c7('0x9')](_0x63c7('0x12'),_0x23cadb);logger['debug']('CreateSquareReport',_0x23cadb,JSON[_0x63c7('0xd')](_0x23649e));_0x211703(_0x23649e);})[_0x63c7('0x11')](function(_0x471b57){logger[_0x63c7('0xe')](_0x63c7('0x12'),_0x471b57[_0x63c7('0xf')],_0x23cadb);_0x53e1e5(_0x4cb063['error'](0x1f4,_0x471b57[_0x63c7('0xf')]));});});};exports['UpdateSquareReport']=function(_0x502165){var _0x23ebb6=this;return new Promise(function(_0x56306c,_0x3fa0cf){return db[_0x63c7('0x13')][_0x63c7('0x17')](_0x502165[_0x63c7('0x18')],{'raw':_0x502165[_0x63c7('0x14')]?_0x502165[_0x63c7('0x14')][_0x63c7('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x502165[_0x63c7('0x14')]?_0x502165[_0x63c7('0x14')]['where']||null:null,'attributes':_0x502165['options']?_0x502165[_0x63c7('0x14')]['attributes']||null:null,'limit':_0x502165['options']?_0x502165[_0x63c7('0x14')]['limit']||null:null})[_0x63c7('0x16')](function(_0x1fa62a){logger[_0x63c7('0x9')](_0x63c7('0x19'),_0x502165);logger['debug'](_0x63c7('0x19'),_0x502165,JSON['stringify'](_0x1fa62a));_0x56306c(_0x1fa62a);})[_0x63c7('0x11')](function(_0x1d3acf){logger[_0x63c7('0xe')]('UpdateSquareReport',_0x1d3acf['message'],_0x502165);_0x3fa0cf(_0x23ebb6[_0x63c7('0xe')](0x1f4,_0x1d3acf[_0x63c7('0xf')]));});});};
\ No newline at end of file
index 6d799d9..22cd815 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a87=['/:id','isAuthenticated','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get'];(function(_0x5b9a3f,_0x391c8a){var _0x46d78b=function(_0x244c64){while(--_0x244c64){_0x5b9a3f['push'](_0x5b9a3f['shift']());}};_0x46d78b(++_0x391c8a);}(_0x4a87,0xbb));var _0x74a8=function(_0xc1f457,_0x26114e){_0xc1f457=_0xc1f457-0x0;var _0x5165a5=_0x4a87[_0xc1f457];return _0x5165a5;};'use strict';var multer=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var path=require(_0x74a8('0x2'));var timeout=require(_0x74a8('0x3'));var express=require(_0x74a8('0x4'));var router=express[_0x74a8('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x74a8('0x6'));var interaction=require(_0x74a8('0x7'));var config=require(_0x74a8('0x8'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x74a8('0x9')]);router['get'](_0x74a8('0xa'),auth['isAuthenticated'](),controller[_0x74a8('0xb')]);router[_0x74a8('0xc')](_0x74a8('0xd'),auth[_0x74a8('0xe')](),controller[_0x74a8('0xf')]);router['post']('/',auth[_0x74a8('0xe')](),controller['create']);router['put'](_0x74a8('0xd'),auth[_0x74a8('0xe')](),controller[_0x74a8('0x10')]);router[_0x74a8('0x11')]('/:id',auth[_0x74a8('0xe')](),controller[_0x74a8('0x12')]);module[_0x74a8('0x13')]=router;
\ No newline at end of file
+var _0x04ca=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','create','put'];(function(_0x9356ea,_0x3b073c){var _0x23886e=function(_0xa4c385){while(--_0xa4c385){_0x9356ea['push'](_0x9356ea['shift']());}};_0x23886e(++_0x3b073c);}(_0x04ca,0x130));var _0xa04c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x04ca[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xa04c('0x0'));var util=require('util');var path=require(_0xa04c('0x1'));var timeout=require(_0xa04c('0x2'));var express=require(_0xa04c('0x3'));var router=express[_0xa04c('0x4')]();var fs_extra=require(_0xa04c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa04c('0x6'));var config=require('../../config/environment');var controller=require(_0xa04c('0x7'));router[_0xa04c('0x8')]('/',auth[_0xa04c('0x9')](),controller[_0xa04c('0xa')]);router[_0xa04c('0x8')](_0xa04c('0xb'),auth[_0xa04c('0x9')](),controller['describe']);router['get'](_0xa04c('0xc'),auth[_0xa04c('0x9')](),controller[_0xa04c('0xd')]);router['post']('/',auth[_0xa04c('0x9')](),controller[_0xa04c('0xe')]);router[_0xa04c('0xf')](_0xa04c('0xc'),auth[_0xa04c('0x9')](),controller[_0xa04c('0x10')]);router[_0xa04c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa04c('0x12')]);module[_0xa04c('0x13')]=router;
\ No newline at end of file
index e25eba4..827cf8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e0e=['STRING','TEXT','sequelize'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0x3e0e,0xb3));var _0xe3e0=function(_0x4ab8e2,_0x3754f9){_0x4ab8e2=_0x4ab8e2-0x0;var _0x2c4eed=_0x3e0e[_0x4ab8e2];return _0x2c4eed;};'use strict';var Sequelize=require(_0xe3e0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe3e0('0x1')]},'node':{'type':Sequelize[_0xe3e0('0x1')]},'application':{'type':Sequelize[_0xe3e0('0x1')]},'data':{'type':Sequelize[_0xe3e0('0x2')]},'project_name':{'type':Sequelize[_0xe3e0('0x1')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x437d=['TEXT','sequelize','exports','STRING'];(function(_0x199235,_0x5bc36a){var _0x53c9a1=function(_0x39392d){while(--_0x39392d){_0x199235['push'](_0x199235['shift']());}};_0x53c9a1(++_0x5bc36a);}(_0x437d,0x1c1));var _0xd437=function(_0x1e458e,_0x48b732){_0x1e458e=_0x1e458e-0x0;var _0x3cebcb=_0x437d[_0x1e458e];return _0x3cebcb;};'use strict';var Sequelize=require(_0xd437('0x0'));module[_0xd437('0x1')]={'uniqueid':{'type':Sequelize[_0xd437('0x2')]},'node':{'type':Sequelize[_0xd437('0x2')]},'application':{'type':Sequelize[_0xd437('0x2')]},'data':{'type':Sequelize[_0xd437('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4f66caa..0a1f47b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e70=['sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','findAll','rows','params','include','options','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order'];(function(_0x1a8dc7,_0x2835f1){var _0x306cf0=function(_0x18ac35){while(--_0x18ac35){_0x1a8dc7['push'](_0x1a8dc7['shift']());}};_0x306cf0(++_0x2835f1);}(_0x4e70,0x17a));var _0x04e7=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x4e70[_0x1da527];return _0x40fc7c;};'use strict';var emlformat=require(_0x04e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x04e7('0x1'));var jsonpatch=require(_0x04e7('0x2'));var rp=require(_0x04e7('0x3'));var moment=require(_0x04e7('0x4'));var BPromise=require(_0x04e7('0x5'));var Mustache=require(_0x04e7('0x6'));var util=require(_0x04e7('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x04e7('0x8'));var ejs=require(_0x04e7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x04e7('0xa'));var squel=require(_0x04e7('0xb'));var crypto=require(_0x04e7('0xc'));var jsforce=require(_0x04e7('0xd'));var deskjs=require(_0x04e7('0xe'));var toCsv=require(_0x04e7('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x04e7('0xf'));var qs=require(_0x04e7('0x10'));var as=require(_0x04e7('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x04e7('0x12'));var utils=require(_0x04e7('0x13'));var config=require(_0x04e7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x04e7('0x15'))['db'];function respondWithStatusCode(_0x17bb20,_0xe90c8){_0xe90c8=_0xe90c8||0xcc;return function(_0xcf2194){if(_0xcf2194){return _0x17bb20[_0x04e7('0x16')](_0xe90c8);}return _0x17bb20['status'](_0xe90c8)['end']();};}function respondWithResult(_0x56da86,_0x2284a8){_0x2284a8=_0x2284a8||0xc8;return function(_0xe5d793){if(_0xe5d793){return _0x56da86[_0x04e7('0x17')](_0x2284a8)[_0x04e7('0x18')](_0xe5d793);}};}function respondWithFilteredResult(_0x310a51,_0x2155a7){return function(_0x373a24){if(_0x373a24){var _0x465575=typeof _0x2155a7[_0x04e7('0x19')]==='undefined'&&typeof _0x2155a7['limit']===_0x04e7('0x1a');var _0x192831=_0x373a24['count'];var _0x2c0ec9=_0x465575?0x0:_0x2155a7[_0x04e7('0x19')];var _0xb119d2=_0x465575?_0x373a24[_0x04e7('0x1b')]:_0x2155a7['offset']+_0x2155a7[_0x04e7('0x1c')];var _0xd66f6a;if(_0xb119d2>=_0x192831){_0xb119d2=_0x192831;_0xd66f6a=0xc8;}else{_0xd66f6a=0xce;}_0x310a51[_0x04e7('0x17')](_0xd66f6a);return _0x310a51[_0x04e7('0x1d')](_0x04e7('0x1e'),_0x2c0ec9+'-'+_0xb119d2+'/'+_0x192831)[_0x04e7('0x18')](_0x373a24);}return null;};}function patchUpdates(_0x5bc920){return function(_0x2d1528){try{jsonpatch['apply'](_0x2d1528,_0x5bc920,!![]);}catch(_0x3b0f4b){return BPromise['reject'](_0x3b0f4b);}return _0x2d1528[_0x04e7('0x1f')]();};}function saveUpdates(_0x247d4d,_0x59ad2b){return function(_0x4dd605){if(_0x4dd605){return _0x4dd605[_0x04e7('0x20')](_0x247d4d)[_0x04e7('0x21')](function(_0x24e5fc){return _0x24e5fc;});}return null;};}function removeEntity(_0x5b66d4,_0x5a9652){return function(_0x588b85){if(_0x588b85){return _0x588b85[_0x04e7('0x22')]()[_0x04e7('0x21')](function(){_0x5b66d4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24589c,_0x562974){return function(_0x49b027){if(!_0x49b027){_0x24589c['sendStatus'](0x194);}return _0x49b027;};}function handleError(_0xed894e,_0x4c4c77){_0x4c4c77=_0x4c4c77||0x1f4;return function(_0x7c032a){logger[_0x04e7('0x23')](_0x7c032a[_0x04e7('0x24')]);if(_0x7c032a[_0x04e7('0x25')]){delete _0x7c032a[_0x04e7('0x25')];}_0xed894e['status'](_0x4c4c77)['send'](_0x7c032a);};}exports[_0x04e7('0x26')]=function(_0x131420,_0xd20d1c){var _0x4e3049={},_0x3b0088={},_0x4fe02b={'count':0x0,'rows':[]};var _0x2c441e=_[_0x04e7('0x27')](db[_0x04e7('0x28')][_0x04e7('0x29')],function(_0x29b780){return{'name':_0x29b780[_0x04e7('0x2a')],'type':_0x29b780[_0x04e7('0x2b')][_0x04e7('0x2c')]};});_0x3b0088[_0x04e7('0x2d')]=_[_0x04e7('0x27')](_0x2c441e,_0x04e7('0x25'));_0x3b0088[_0x04e7('0x2e')]=_[_0x04e7('0x2f')](_0x131420['query']);_0x3b0088['filters']=_[_0x04e7('0x30')](_0x3b0088[_0x04e7('0x2d')],_0x3b0088[_0x04e7('0x2e')]);_0x4e3049['attributes']=_['intersection'](_0x3b0088[_0x04e7('0x2d')],qs[_0x04e7('0x31')](_0x131420['query'][_0x04e7('0x31')]));_0x4e3049[_0x04e7('0x32')]=_0x4e3049[_0x04e7('0x32')][_0x04e7('0x33')]?_0x4e3049[_0x04e7('0x32')]:_0x3b0088[_0x04e7('0x2d')];if(!_0x131420['query']['hasOwnProperty'](_0x04e7('0x34'))){_0x4e3049[_0x04e7('0x1c')]=qs[_0x04e7('0x1c')](_0x131420[_0x04e7('0x2e')][_0x04e7('0x1c')]);_0x4e3049[_0x04e7('0x19')]=qs[_0x04e7('0x19')](_0x131420[_0x04e7('0x2e')][_0x04e7('0x19')]);}_0x4e3049[_0x04e7('0x35')]=qs[_0x04e7('0x36')](_0x131420['query']['sort']);_0x4e3049['where']=qs[_0x04e7('0x37')](_[_0x04e7('0x38')](_0x131420[_0x04e7('0x2e')],_0x3b0088[_0x04e7('0x37')]),_0x2c441e);if(_0x131420[_0x04e7('0x2e')][_0x04e7('0x39')]){_0x4e3049['where']=_[_0x04e7('0x3a')](_0x4e3049['where'],{'$or':_[_0x04e7('0x27')](_0x2c441e,function(_0x45a44a){if(_0x45a44a[_0x04e7('0x2b')]!==_0x04e7('0x3b')){var _0x37d685={};_0x37d685[_0x45a44a[_0x04e7('0x25')]]={'$like':'%'+_0x131420[_0x04e7('0x2e')][_0x04e7('0x39')]+'%'};return _0x37d685;}})});}_0x4e3049=_['merge']({},_0x4e3049,_0x131420['options']);var _0x10b532={'where':_0x4e3049[_0x04e7('0x3c')]};return db[_0x04e7('0x28')][_0x04e7('0x1b')](_0x10b532)[_0x04e7('0x21')](function(_0x1d29e5){_0x4fe02b['count']=_0x1d29e5;if(_0x131420[_0x04e7('0x2e')][_0x04e7('0x3d')]){_0x4e3049['include']=[{'all':!![]}];}return db[_0x04e7('0x28')][_0x04e7('0x3e')](_0x4e3049);})[_0x04e7('0x21')](function(_0x33c451){_0x4fe02b[_0x04e7('0x3f')]=_0x33c451;return _0x4fe02b;})[_0x04e7('0x21')](respondWithFilteredResult(_0xd20d1c,_0x4e3049))['catch'](handleError(_0xd20d1c,null));};exports['show']=function(_0x2f03f0,_0x18fdfc){var _0x5bbc36={'raw':!![],'where':{'id':_0x2f03f0[_0x04e7('0x40')]['id']}},_0x15358d={};_0x15358d[_0x04e7('0x2d')]=_['keys'](db[_0x04e7('0x28')]['rawAttributes']);_0x15358d[_0x04e7('0x2e')]=_[_0x04e7('0x2f')](_0x2f03f0[_0x04e7('0x2e')]);_0x15358d['filters']=_[_0x04e7('0x30')](_0x15358d[_0x04e7('0x2d')],_0x15358d[_0x04e7('0x2e')]);_0x5bbc36[_0x04e7('0x32')]=_[_0x04e7('0x30')](_0x15358d['model'],qs['fields'](_0x2f03f0[_0x04e7('0x2e')]['fields']));_0x5bbc36[_0x04e7('0x32')]=_0x5bbc36[_0x04e7('0x32')][_0x04e7('0x33')]?_0x5bbc36['attributes']:_0x15358d[_0x04e7('0x2d')];if(_0x2f03f0['query'][_0x04e7('0x3d')]){_0x5bbc36[_0x04e7('0x41')]=[{'all':!![]}];}_0x5bbc36=_[_0x04e7('0x3a')]({},_0x5bbc36,_0x2f03f0[_0x04e7('0x42')]);return db[_0x04e7('0x28')]['find'](_0x5bbc36)[_0x04e7('0x21')](handleEntityNotFound(_0x18fdfc,null))[_0x04e7('0x21')](respondWithResult(_0x18fdfc,null))[_0x04e7('0x43')](handleError(_0x18fdfc,null));};exports[_0x04e7('0x44')]=function(_0x3c6979,_0x2d4128){return db[_0x04e7('0x28')][_0x04e7('0x44')](_0x3c6979[_0x04e7('0x45')],{})['then'](respondWithResult(_0x2d4128,0xc9))['catch'](handleError(_0x2d4128,null));};exports[_0x04e7('0x20')]=function(_0x1e59bb,_0x57100f){if(_0x1e59bb['body']['id']){delete _0x1e59bb[_0x04e7('0x45')]['id'];}return db[_0x04e7('0x28')][_0x04e7('0x46')]({'where':{'id':_0x1e59bb['params']['id']}})['then'](handleEntityNotFound(_0x57100f,null))['then'](saveUpdates(_0x1e59bb[_0x04e7('0x45')],null))['then'](respondWithResult(_0x57100f,null))[_0x04e7('0x43')](handleError(_0x57100f,null));};exports[_0x04e7('0x22')]=function(_0x109b08,_0x2c80f8){return db[_0x04e7('0x28')][_0x04e7('0x46')]({'where':{'id':_0x109b08['params']['id']}})[_0x04e7('0x21')](handleEntityNotFound(_0x2c80f8,null))['then'](removeEntity(_0x2c80f8,null))[_0x04e7('0x43')](handleError(_0x2c80f8,null));};exports[_0x04e7('0x47')]=function(_0x19483b,_0x25d395){return db[_0x04e7('0x28')]['describe']()['then'](respondWithResult(_0x25d395,null))[_0x04e7('0x43')](handleError(_0x25d395,null));};
\ No newline at end of file
+var _0xf7dd=['rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','rows','includeAll','include','find','catch','create','body','params','describe'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xf7dd,0xd2));var _0xdf7d=function(_0x317943,_0x1a4079){_0x317943=_0x317943-0x0;var _0x5a578e=_0xf7dd[_0x317943];return _0x5a578e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf7d('0x0'));var zipdir=require(_0xdf7d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdf7d('0x2'));var moment=require(_0xdf7d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdf7d('0x4'));var util=require('util');var path=require(_0xdf7d('0x5'));var sox=require(_0xdf7d('0x6'));var csv=require(_0xdf7d('0x7'));var ejs=require(_0xdf7d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xdf7d('0x9'));var jsforce=require(_0xdf7d('0xa'));var deskjs=require(_0xdf7d('0xb'));var toCsv=require(_0xdf7d('0x7'));var querystring=require(_0xdf7d('0xc'));var Papa=require('papaparse');var Redis=require(_0xdf7d('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdf7d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf7d('0xf'))(_0xdf7d('0x10'));var utils=require(_0xdf7d('0x11'));var config=require(_0xdf7d('0x12'));var licenseUtil=require(_0xdf7d('0x13'));var db=require(_0xdf7d('0x14'))['db'];function respondWithStatusCode(_0x259e4c,_0x372696){_0x372696=_0x372696||0xcc;return function(_0x509b40){if(_0x509b40){return _0x259e4c['sendStatus'](_0x372696);}return _0x259e4c[_0xdf7d('0x15')](_0x372696)['end']();};}function respondWithResult(_0x15071f,_0x1faa0e){_0x1faa0e=_0x1faa0e||0xc8;return function(_0x1c84e6){if(_0x1c84e6){return _0x15071f['status'](_0x1faa0e)[_0xdf7d('0x16')](_0x1c84e6);}};}function respondWithFilteredResult(_0x458d5e,_0x56e451){return function(_0x273f12){if(_0x273f12){var _0x12ecf8=typeof _0x56e451[_0xdf7d('0x17')]==='undefined'&&typeof _0x56e451[_0xdf7d('0x18')]===_0xdf7d('0x19');var _0x195d93=_0x273f12['count'];var _0x34263d=_0x12ecf8?0x0:_0x56e451['offset'];var _0x332f64=_0x12ecf8?_0x273f12[_0xdf7d('0x1a')]:_0x56e451[_0xdf7d('0x17')]+_0x56e451[_0xdf7d('0x18')];var _0x1248ff;if(_0x332f64>=_0x195d93){_0x332f64=_0x195d93;_0x1248ff=0xc8;}else{_0x1248ff=0xce;}_0x458d5e[_0xdf7d('0x15')](_0x1248ff);return _0x458d5e[_0xdf7d('0x1b')]('Content-Range',_0x34263d+'-'+_0x332f64+'/'+_0x195d93)[_0xdf7d('0x16')](_0x273f12);}return null;};}function patchUpdates(_0x269c69){return function(_0x2808b7){try{jsonpatch[_0xdf7d('0x1c')](_0x2808b7,_0x269c69,!![]);}catch(_0x21a5c9){return BPromise[_0xdf7d('0x1d')](_0x21a5c9);}return _0x2808b7[_0xdf7d('0x1e')]();};}function saveUpdates(_0x5a4ca2,_0x39e459){return function(_0x1f0927){if(_0x1f0927){return _0x1f0927[_0xdf7d('0x1f')](_0x5a4ca2)[_0xdf7d('0x20')](function(_0x44f62a){return _0x44f62a;});}return null;};}function removeEntity(_0x47ed3c,_0x49b762){return function(_0x1524da){if(_0x1524da){return _0x1524da[_0xdf7d('0x21')]()[_0xdf7d('0x20')](function(){_0x47ed3c[_0xdf7d('0x15')](0xcc)[_0xdf7d('0x22')]();});}};}function handleEntityNotFound(_0x2b0b3e,_0x4e1f39){return function(_0x51ccad){if(!_0x51ccad){_0x2b0b3e[_0xdf7d('0x23')](0x194);}return _0x51ccad;};}function handleError(_0x8677e5,_0x158980){_0x158980=_0x158980||0x1f4;return function(_0x56cd43){logger[_0xdf7d('0x24')](_0x56cd43['stack']);if(_0x56cd43[_0xdf7d('0x25')]){delete _0x56cd43[_0xdf7d('0x25')];}_0x8677e5[_0xdf7d('0x15')](_0x158980)[_0xdf7d('0x26')](_0x56cd43);};}exports[_0xdf7d('0x27')]=function(_0x2fc0ff,_0x4bc799){var _0x5160fa={},_0xe22e14={},_0x2c6bc0={'count':0x0,'rows':[]};var _0x58f00e=_[_0xdf7d('0x28')](db[_0xdf7d('0x29')][_0xdf7d('0x2a')],function(_0x30cefd){return{'name':_0x30cefd[_0xdf7d('0x2b')],'type':_0x30cefd[_0xdf7d('0x2c')]['key']};});_0xe22e14[_0xdf7d('0x2d')]=_['map'](_0x58f00e,_0xdf7d('0x25'));_0xe22e14[_0xdf7d('0x2e')]=_[_0xdf7d('0x2f')](_0x2fc0ff[_0xdf7d('0x2e')]);_0xe22e14['filters']=_[_0xdf7d('0x30')](_0xe22e14['model'],_0xe22e14[_0xdf7d('0x2e')]);_0x5160fa[_0xdf7d('0x31')]=_['intersection'](_0xe22e14[_0xdf7d('0x2d')],qs[_0xdf7d('0x32')](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x32')]));_0x5160fa[_0xdf7d('0x31')]=_0x5160fa[_0xdf7d('0x31')][_0xdf7d('0x33')]?_0x5160fa['attributes']:_0xe22e14[_0xdf7d('0x2d')];if(!_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x34')]('nolimit')){_0x5160fa['limit']=qs[_0xdf7d('0x18')](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x18')]);_0x5160fa[_0xdf7d('0x17')]=qs[_0xdf7d('0x17')](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x17')]);}_0x5160fa[_0xdf7d('0x35')]=qs['sort'](_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x36')]);_0x5160fa[_0xdf7d('0x37')]=qs[_0xdf7d('0x38')](_['pick'](_0x2fc0ff['query'],_0xe22e14['filters']),_0x58f00e);if(_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x39')]){_0x5160fa[_0xdf7d('0x37')]=_[_0xdf7d('0x3a')](_0x5160fa['where'],{'$or':_[_0xdf7d('0x28')](_0x58f00e,function(_0xc30bbb){if(_0xc30bbb[_0xdf7d('0x2c')]!==_0xdf7d('0x3b')){var _0x11be66={};_0x11be66[_0xc30bbb[_0xdf7d('0x25')]]={'$like':'%'+_0x2fc0ff[_0xdf7d('0x2e')][_0xdf7d('0x39')]+'%'};return _0x11be66;}})});}_0x5160fa=_[_0xdf7d('0x3a')]({},_0x5160fa,_0x2fc0ff[_0xdf7d('0x3c')]);var _0x4c112e={'where':_0x5160fa[_0xdf7d('0x37')]};return db[_0xdf7d('0x29')]['count'](_0x4c112e)[_0xdf7d('0x20')](function(_0x33b23b){_0x2c6bc0[_0xdf7d('0x1a')]=_0x33b23b;if(_0x2fc0ff[_0xdf7d('0x2e')]['includeAll']){_0x5160fa['include']=[{'all':!![]}];}return db[_0xdf7d('0x29')]['findAll'](_0x5160fa);})[_0xdf7d('0x20')](function(_0x462fca){_0x2c6bc0[_0xdf7d('0x3d')]=_0x462fca;return _0x2c6bc0;})[_0xdf7d('0x20')](respondWithFilteredResult(_0x4bc799,_0x5160fa))['catch'](handleError(_0x4bc799,null));};exports['show']=function(_0x414396,_0x42ddff){var _0x4acaad={'raw':!![],'where':{'id':_0x414396['params']['id']}},_0x26aade={};_0x26aade[_0xdf7d('0x2d')]=_[_0xdf7d('0x2f')](db[_0xdf7d('0x29')][_0xdf7d('0x2a')]);_0x26aade[_0xdf7d('0x2e')]=_['keys'](_0x414396[_0xdf7d('0x2e')]);_0x26aade[_0xdf7d('0x38')]=_['intersection'](_0x26aade['model'],_0x26aade[_0xdf7d('0x2e')]);_0x4acaad['attributes']=_['intersection'](_0x26aade[_0xdf7d('0x2d')],qs['fields'](_0x414396[_0xdf7d('0x2e')]['fields']));_0x4acaad[_0xdf7d('0x31')]=_0x4acaad[_0xdf7d('0x31')][_0xdf7d('0x33')]?_0x4acaad['attributes']:_0x26aade[_0xdf7d('0x2d')];if(_0x414396[_0xdf7d('0x2e')][_0xdf7d('0x3e')]){_0x4acaad[_0xdf7d('0x3f')]=[{'all':!![]}];}_0x4acaad=_[_0xdf7d('0x3a')]({},_0x4acaad,_0x414396['options']);return db['SquareDetailsReport'][_0xdf7d('0x40')](_0x4acaad)[_0xdf7d('0x20')](handleEntityNotFound(_0x42ddff,null))[_0xdf7d('0x20')](respondWithResult(_0x42ddff,null))[_0xdf7d('0x41')](handleError(_0x42ddff,null));};exports['create']=function(_0x4a1888,_0x5babd7){return db[_0xdf7d('0x29')][_0xdf7d('0x42')](_0x4a1888[_0xdf7d('0x43')],{})[_0xdf7d('0x20')](respondWithResult(_0x5babd7,0xc9))[_0xdf7d('0x41')](handleError(_0x5babd7,null));};exports[_0xdf7d('0x1f')]=function(_0x1e1e49,_0x4c5f55){if(_0x1e1e49['body']['id']){delete _0x1e1e49[_0xdf7d('0x43')]['id'];}return db[_0xdf7d('0x29')]['find']({'where':{'id':_0x1e1e49['params']['id']}})[_0xdf7d('0x20')](handleEntityNotFound(_0x4c5f55,null))[_0xdf7d('0x20')](saveUpdates(_0x1e1e49[_0xdf7d('0x43')],null))[_0xdf7d('0x20')](respondWithResult(_0x4c5f55,null))[_0xdf7d('0x41')](handleError(_0x4c5f55,null));};exports['destroy']=function(_0x4a9dca,_0x2de96a){return db[_0xdf7d('0x29')][_0xdf7d('0x40')]({'where':{'id':_0x4a9dca[_0xdf7d('0x44')]['id']}})[_0xdf7d('0x20')](handleEntityNotFound(_0x2de96a,null))['then'](removeEntity(_0x2de96a,null))['catch'](handleError(_0x2de96a,null));};exports[_0xdf7d('0x45')]=function(_0x373797,_0x30f7ca){return db[_0xdf7d('0x29')][_0xdf7d('0x45')]()[_0xdf7d('0x20')](respondWithResult(_0x30f7ca,null))[_0xdf7d('0x41')](handleError(_0x30f7ca,null));};
\ No newline at end of file
index 00b582a..fccf5eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','util','api','moment'];(function(_0x8ea31d,_0x3605e2){var _0x41bb8f=function(_0x54a53c){while(--_0x54a53c){_0x8ea31d['push'](_0x8ea31d['shift']());}};_0x41bb8f(++_0x3605e2);}(_0x4975,0x147));var _0x5497=function(_0xaf919c,_0x2ebfc7){_0xaf919c=_0xaf919c-0x0;var _0x393204=_0x4975[_0xaf919c];return _0x393204;};'use strict';var _=require('lodash');var util=require(_0x5497('0x0'));var logger=require('../../config/logger')(_0x5497('0x1'));var moment=require(_0x5497('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5497('0x3'));var rimraf=require(_0x5497('0x4'));var config=require(_0x5497('0x5'));var attributes=require(_0x5497('0x6'));module[_0x5497('0x7')]=function(_0x57b019,_0x2bbe4b){return _0x57b019[_0x5497('0x8')](_0x5497('0x9'),attributes,{'tableName':_0x5497('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00c9=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','report_square_details','util','api'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0x00c9,0x198));var _0x900c=function(_0x50150f,_0x92b2ca){_0x50150f=_0x50150f-0x0;var _0x3f3764=_0x00c9[_0x50150f];return _0x3f3764;};'use strict';var _=require('lodash');var util=require(_0x900c('0x0'));var logger=require('../../config/logger')(_0x900c('0x1'));var moment=require(_0x900c('0x2'));var BPromise=require(_0x900c('0x3'));var rp=require(_0x900c('0x4'));var fs=require('fs');var path=require(_0x900c('0x5'));var rimraf=require(_0x900c('0x6'));var config=require(_0x900c('0x7'));var attributes=require('./squareReportDetail.attributes');module[_0x900c('0x8')]=function(_0x34aaa0,_0x34f908){return _0x34aaa0['define']('SquareDetailsReport',attributes,{'tableName':_0x900c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbba9b3..fdd1552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30e94e,_0x494fb1){var _0x23cded=function(_0x290f75){while(--_0x290f75){_0x30e94e['push'](_0x30e94e['shift']());}};_0x23cded(++_0x494fb1);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x18b7f0,_0x403e49){_0x18b7f0=_0x18b7f0-0x0;var _0x38a953=_0xf4f4[_0x18b7f0];return _0x38a953;};'use strict';var _=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var moment=require('moment');var BPromise=require(_0x4f4f('0x2'));var rs=require(_0x4f4f('0x3'));var fs=require('fs');var Redis=require(_0x4f4f('0x4'));var db=require(_0x4f4f('0x5'))['db'];var utils=require(_0x4f4f('0x6'));var logger=require('../../config/logger')(_0x4f4f('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f4f('0x8'));var client=jayson[_0x4f4f('0x9')][_0x4f4f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ff75a,_0x3c4877,_0x249f8a){return new BPromise(function(_0x2faba9,_0x3768d7){return client['request'](_0x1ff75a,_0x249f8a)[_0x4f4f('0xb')](function(_0x38d110){logger[_0x4f4f('0xc')](_0x4f4f('0xd'),_0x3c4877,_0x4f4f('0xe'));logger[_0x4f4f('0xf')](_0x4f4f('0x10'),_0x3c4877,_0x4f4f('0xe'),JSON['stringify'](_0x38d110));if(_0x38d110['error']){if(_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x12')]===0x1f4){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x3768d7(_0x38d110['error'][_0x4f4f('0x13')]);}logger['error'](_0x4f4f('0xd'),_0x3c4877,_0x38d110[_0x4f4f('0x11')][_0x4f4f('0x13')]);return _0x2faba9(_0x38d110[_0x4f4f('0x11')]['message']);}else{logger[_0x4f4f('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x3c4877,'request\x20sent');_0x2faba9(_0x38d110['result'][_0x4f4f('0x13')]);}})[_0x4f4f('0x14')](function(_0x2d21ed){logger[_0x4f4f('0x11')](_0x4f4f('0xd'),_0x3c4877,_0x2d21ed);_0x3768d7(_0x2d21ed);});});}exports[_0x4f4f('0x15')]=function(_0x1245c4){var _0x60ce2=this;return new Promise(function(_0x929a0b,_0x2f9397){return db[_0x4f4f('0x16')][_0x4f4f('0x17')](_0x1245c4['body'],{'raw':_0x1245c4[_0x4f4f('0x18')]?_0x1245c4[_0x4f4f('0x18')][_0x4f4f('0x19')]===undefined?!![]:![]:!![]})[_0x4f4f('0xb')](function(_0x302a79){logger[_0x4f4f('0xc')](_0x4f4f('0x15'),_0x1245c4);logger[_0x4f4f('0xf')](_0x4f4f('0x15'),_0x1245c4,JSON[_0x4f4f('0x1a')](_0x302a79));_0x929a0b(_0x302a79);})[_0x4f4f('0x14')](function(_0x17832f){logger[_0x4f4f('0x11')](_0x4f4f('0x15'),_0x17832f['message'],_0x1245c4);_0x2f9397(_0x60ce2['error'](0x1f4,_0x17832f['message']));});});};
\ No newline at end of file
+var _0x55f1=['SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x3708e6,_0x55e776){var _0x56fd59=function(_0x294cd5){while(--_0x294cd5){_0x3708e6['push'](_0x3708e6['shift']());}};_0x56fd59(++_0x55e776);}(_0x55f1,0x9b));var _0x155f=function(_0x5a5453,_0x137c44){_0x5a5453=_0x5a5453-0x0;var _0x13c561=_0x55f1[_0x5a5453];return _0x13c561;};'use strict';var _=require(_0x155f('0x0'));var util=require('util');var moment=require(_0x155f('0x1'));var BPromise=require(_0x155f('0x2'));var rs=require(_0x155f('0x3'));var fs=require('fs');var Redis=require(_0x155f('0x4'));var db=require(_0x155f('0x5'))['db'];var utils=require(_0x155f('0x6'));var logger=require(_0x155f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x155f('0x8'));var client=jayson['client'][_0x155f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22e07f,_0x39b14d,_0x1bcf84){return new BPromise(function(_0x2a0a02,_0x9fc06e){return client[_0x155f('0xa')](_0x22e07f,_0x1bcf84)[_0x155f('0xb')](function(_0x100e9a){logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,_0x155f('0xe'));logger[_0x155f('0xf')](_0x155f('0x10'),_0x39b14d,_0x155f('0xe'),JSON[_0x155f('0x11')](_0x100e9a));if(_0x100e9a[_0x155f('0x12')]){if(_0x100e9a['error'][_0x155f('0x13')]===0x1f4){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a['error']['message']);return _0x9fc06e(_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);}logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x100e9a[_0x155f('0x12')][_0x155f('0x14')]);return _0x2a0a02(_0x100e9a[_0x155f('0x12')]['message']);}else{logger[_0x155f('0xc')](_0x155f('0xd'),_0x39b14d,'request\x20sent');_0x2a0a02(_0x100e9a[_0x155f('0x15')][_0x155f('0x14')]);}})[_0x155f('0x16')](function(_0x7ad1c2){logger[_0x155f('0x12')](_0x155f('0xd'),_0x39b14d,_0x7ad1c2);_0x9fc06e(_0x7ad1c2);});});}exports[_0x155f('0x17')]=function(_0x343a1e){var _0x2f5b83=this;return new Promise(function(_0x407e26,_0x2e248d){return db[_0x155f('0x18')][_0x155f('0x19')](_0x343a1e[_0x155f('0x1a')],{'raw':_0x343a1e[_0x155f('0x1b')]?_0x343a1e[_0x155f('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x155f('0xb')](function(_0x26a322){logger[_0x155f('0xc')](_0x155f('0x17'),_0x343a1e);logger['debug']('CreateSquareDetailsReport',_0x343a1e,JSON['stringify'](_0x26a322));_0x407e26(_0x26a322);})[_0x155f('0x16')](function(_0x3a40b4){logger[_0x155f('0x12')](_0x155f('0x17'),_0x3a40b4[_0x155f('0x14')],_0x343a1e);_0x2e248d(_0x2f5b83['error'](0x1f4,_0x3a40b4[_0x155f('0x14')]));});});};
\ No newline at end of file
index 4535f56..967fd32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aca=['killProcess','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated','index'];(function(_0x5a7a11,_0x2fa00f){var _0x535ceb=function(_0x4b3ba9){while(--_0x4b3ba9){_0x5a7a11['push'](_0x5a7a11['shift']());}};_0x535ceb(++_0x2fa00f);}(_0x3aca,0x1ea));var _0xa3ac=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x3aca[_0x2aec52];return _0x3b8835;};'use strict';var express=require('express');var router=express[_0xa3ac('0x0')]();var auth=require(_0xa3ac('0x1'));var controller=require(_0xa3ac('0x2'));router[_0xa3ac('0x3')]('/',auth[_0xa3ac('0x4')](),controller[_0xa3ac('0x5')]);router[_0xa3ac('0x3')]('/process/:pid/kill',auth[_0xa3ac('0x4')](),controller[_0xa3ac('0x6')]);module[_0xa3ac('0x7')]=router;
\ No newline at end of file
+var _0x7a17=['get','/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','./system.controller','index'];(function(_0x3e612d,_0x2f0836){var _0xdd57f5=function(_0x2fdafb){while(--_0x2fdafb){_0x3e612d['push'](_0x3e612d['shift']());}};_0xdd57f5(++_0x2f0836);}(_0x7a17,0x17f));var _0x77a1=function(_0x35ffac,_0x5a4c69){_0x35ffac=_0x35ffac-0x0;var _0x202a54=_0x7a17[_0x35ffac];return _0x202a54;};'use strict';var express=require(_0x77a1('0x0'));var router=express[_0x77a1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x77a1('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x77a1('0x3')]);router[_0x77a1('0x4')](_0x77a1('0x5'),auth[_0x77a1('0x6')](),controller[_0x77a1('0x7')]);module[_0x77a1('0x8')]=router;
\ No newline at end of file
index 16ff726..974efad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1f3=['Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','pid','kill','SIGINT'];(function(_0x210cfd,_0xc1ed24){var _0x10f46e=function(_0x15112e){while(--_0x15112e){_0x210cfd['push'](_0x210cfd['shift']());}};_0x10f46e(++_0xc1ed24);}(_0xc1f3,0x76));var _0x3c1f=function(_0x3be2fe,_0xefbf7){_0x3be2fe=_0x3be2fe-0x0;var _0x2d23c3=_0xc1f3[_0x3be2fe];return _0x2d23c3;};'use strict';var info=require(_0x3c1f('0x0'));var exec=require(_0x3c1f('0x1'))['exec'];var logger=require(_0x3c1f('0x2'))(_0x3c1f('0x3'));var util=require(_0x3c1f('0x4'));var BPromise=require(_0x3c1f('0x5'));var _=require(_0x3c1f('0x6'));function handleError(_0x45da79,_0xb68b01,_0x46a21b){_0xb68b01=_0xb68b01||0x1f4;return function(_0x1b7b32){logger[_0x3c1f('0x7')](_0x3c1f('0x8'),_0x46a21b,_0xb68b01,util['inspect'](_0x1b7b32,{'showHidden':![],'depth':null}));delete _0x1b7b32[_0x3c1f('0x9')];_0x45da79[_0x3c1f('0xa')](_0xb68b01)[_0x3c1f('0xb')](_0x1b7b32);};}exports[_0x3c1f('0xc')]=function(_0x344930,_0xf5177b){return info[_0x3c1f('0xd')]()[_0x3c1f('0xe')](function(_0x4918f1){return _0xf5177b[_0x3c1f('0xa')](0xc8)[_0x3c1f('0xf')](_0x4918f1);})[_0x3c1f('0x10')](function(_0x4e21e7){return _0xf5177b[_0x3c1f('0xa')](0x1f4)[_0x3c1f('0xf')](_0x4e21e7);});};exports['killProcess']=function(_0xfe7c11,_0x87fdeb){var _0x28294a=[_0x3c1f('0x11')];return new BPromise(function(_0x4faf17,_0x2c6745){return exec(util[_0x3c1f('0x12')](_0x3c1f('0x13'),_0xfe7c11[_0x3c1f('0x14')]['pid']),function(_0x1c300,_0x58a500,_0xff16b2){if(_0x1c300){return _0x2c6745(_0x1c300);}return _0x4faf17(_0x58a500);});})['then'](function(_0x9f8d31){var _0x8ef869=![];var _0x2d1414=_0x9f8d31[_0x3c1f('0x15')](/\n/);for(var _0x24f86a=0x0,_0x1d5078=_0x28294a[_0x3c1f('0x16')];_0x24f86a<_0x1d5078,_0x8ef869===![];_0x24f86a+=0x1){if(_0x9f8d31[_0x3c1f('0x17')](_0x28294a[_0x24f86a])>=0x0){_0x8ef869=!![];}}if(!_0x8ef869){throw new Error(util[_0x3c1f('0x12')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xfe7c11['params'][_0x3c1f('0x18')]));}process[_0x3c1f('0x19')](_0xfe7c11['params'][_0x3c1f('0x18')],_0x3c1f('0x1a'));return _0x87fdeb[_0x3c1f('0xa')](0xc8)[_0x3c1f('0xf')]({'message':util[_0x3c1f('0x12')](_0x3c1f('0x1b'),_0xfe7c11[_0x3c1f('0x14')][_0x3c1f('0x18')])});})[_0x3c1f('0x10')](handleError(_0x87fdeb,null,_0x3c1f('0x1c')));};
\ No newline at end of file
+var _0x6c73=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec'];(function(_0x4bcb3c,_0x192122){var _0xfe09bb=function(_0xcd8ad2){while(--_0xcd8ad2){_0x4bcb3c['push'](_0x4bcb3c['shift']());}};_0xfe09bb(++_0x192122);}(_0x6c73,0x1be));var _0x36c7=function(_0x6dd3c1,_0x53cf52){_0x6dd3c1=_0x6dd3c1-0x0;var _0xdef05a=_0x6c73[_0x6dd3c1];return _0xdef05a;};'use strict';var info=require('systeminformation');var exec=require(_0x36c7('0x0'))[_0x36c7('0x1')];var logger=require('../../config/logger')(_0x36c7('0x2'));var util=require(_0x36c7('0x3'));var BPromise=require(_0x36c7('0x4'));var _=require(_0x36c7('0x5'));function handleError(_0x25dfac,_0x27809f,_0x30c2cb){_0x27809f=_0x27809f||0x1f4;return function(_0x3228ee){logger[_0x36c7('0x6')](_0x36c7('0x7'),_0x30c2cb,_0x27809f,util[_0x36c7('0x8')](_0x3228ee,{'showHidden':![],'depth':null}));delete _0x3228ee[_0x36c7('0x9')];_0x25dfac[_0x36c7('0xa')](_0x27809f)[_0x36c7('0xb')](_0x3228ee);};}exports[_0x36c7('0xc')]=function(_0x511a68,_0x5428a2){return info[_0x36c7('0xd')]()[_0x36c7('0xe')](function(_0x21b811){return _0x5428a2[_0x36c7('0xa')](0xc8)[_0x36c7('0xf')](_0x21b811);})['catch'](function(_0x3691ce){return _0x5428a2[_0x36c7('0xa')](0x1f4)[_0x36c7('0xf')](_0x3691ce);});};exports[_0x36c7('0x10')]=function(_0x305e6d,_0x1bc279){var _0x5179c8=[_0x36c7('0x11')];return new BPromise(function(_0x10d42a,_0x2b36c3){return exec(util['format'](_0x36c7('0x12'),_0x305e6d['params'][_0x36c7('0x13')]),function(_0x48162c,_0x57ef0f,_0x4b4473){if(_0x48162c){return _0x2b36c3(_0x48162c);}return _0x10d42a(_0x57ef0f);});})['then'](function(_0x41a1c4){var _0x546972=![];var _0x443970=_0x41a1c4[_0x36c7('0x14')](/\n/);for(var _0x2a7c3c=0x0,_0x14c776=_0x5179c8[_0x36c7('0x15')];_0x2a7c3c<_0x14c776,_0x546972===![];_0x2a7c3c+=0x1){if(_0x41a1c4[_0x36c7('0x16')](_0x5179c8[_0x2a7c3c])>=0x0){_0x546972=!![];}}if(!_0x546972){throw new Error(util[_0x36c7('0x17')](_0x36c7('0x18'),_0x305e6d[_0x36c7('0x19')][_0x36c7('0x13')]));}process[_0x36c7('0x1a')](_0x305e6d[_0x36c7('0x19')][_0x36c7('0x13')],'SIGINT');return _0x1bc279[_0x36c7('0xa')](0xc8)[_0x36c7('0xf')]({'message':util[_0x36c7('0x17')](_0x36c7('0x1b'),_0x305e6d['params'][_0x36c7('0x13')])});})['catch'](handleError(_0x1bc279,null,'killProcess'));};
\ No newline at end of file
index 535fd83..c8b1c7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1103=['express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','put','delete','exports','util','path','connect-timeout'];(function(_0x4e0b8c,_0x443f31){var _0x633ecc=function(_0x1f1f36){while(--_0x1f1f36){_0x4e0b8c['push'](_0x4e0b8c['shift']());}};_0x633ecc(++_0x443f31);}(_0x1103,0x97));var _0x3110=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1103[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x3110('0x0'));var path=require(_0x3110('0x1'));var timeout=require(_0x3110('0x2'));var express=require(_0x3110('0x3'));var router=express[_0x3110('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3110('0x5'));var interaction=require(_0x3110('0x6'));var config=require('../../config/environment');var controller=require('./tag.controller');router[_0x3110('0x7')]('/',auth[_0x3110('0x8')](),controller[_0x3110('0x9')]);router[_0x3110('0x7')](_0x3110('0xa'),auth[_0x3110('0x8')](),controller['show']);router['post']('/',auth[_0x3110('0x8')](),controller['create']);router[_0x3110('0xb')](_0x3110('0xa'),auth[_0x3110('0x8')](),controller['update']);router[_0x3110('0xc')](_0x3110('0xa'),auth[_0x3110('0x8')](),controller['destroy']);module[_0x3110('0xd')]=router;
\ No newline at end of file
+var _0x6802=['update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','put'];(function(_0xe44ec0,_0x249046){var _0x58bd7f=function(_0x3cd0ab){while(--_0x3cd0ab){_0xe44ec0['push'](_0xe44ec0['shift']());}};_0x58bd7f(++_0x249046);}(_0x6802,0x123));var _0x2680=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6802[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x2680('0x0'));var util=require(_0x2680('0x1'));var path=require(_0x2680('0x2'));var timeout=require('connect-timeout');var express=require(_0x2680('0x3'));var router=express[_0x2680('0x4')]();var fs_extra=require(_0x2680('0x5'));var auth=require(_0x2680('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2680('0x7'));var controller=require(_0x2680('0x8'));router[_0x2680('0x9')]('/',auth[_0x2680('0xa')](),controller['index']);router[_0x2680('0x9')](_0x2680('0xb'),auth[_0x2680('0xa')](),controller[_0x2680('0xc')]);router[_0x2680('0xd')]('/',auth[_0x2680('0xa')](),controller['create']);router[_0x2680('0xe')]('/:id',auth[_0x2680('0xa')](),controller[_0x2680('0xf')]);router[_0x2680('0x10')](_0x2680('0xb'),auth[_0x2680('0xa')](),controller[_0x2680('0x11')]);module['exports']=router;
\ No newline at end of file
index 7a5f244..abca8f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb74=['name','#0091EA','sequelize','exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xeb74,0xe3));var _0x4eb7=function(_0x27f55c,_0x3d6554){_0x27f55c=_0x27f55c-0x0;var _0x3733d1=_0xeb74[_0x27f55c];return _0x3733d1;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'name':{'type':Sequelize[_0x4eb7('0x2')],'unique':_0x4eb7('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':_0x4eb7('0x4')},'description':{'type':Sequelize[_0x4eb7('0x2')]}};
\ No newline at end of file
+var _0x7b37=['STRING','sequelize','exports','name'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x7b37,0xd9));var _0x77b3=function(_0x130c43,_0x4b4fa8){_0x130c43=_0x130c43-0x0;var _0x1951e0=_0x7b37[_0x130c43];return _0x1951e0;};'use strict';var Sequelize=require(_0x77b3('0x0'));module[_0x77b3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x77b3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x77b3('0x3')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x77b3('0x3')]}};
\ No newline at end of file
index 1c4b6aa..e779198 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc03=['Tag','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','catch','show','params','includeAll','include','create','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','stack','name','send','index','map'];(function(_0x802f28,_0x132262){var _0x35b5db=function(_0x59eb67){while(--_0x59eb67){_0x802f28['push'](_0x802f28['shift']());}};_0x35b5db(++_0x132262);}(_0xfc03,0x16f));var _0x3fc0=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xfc03[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0x3fc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fc0('0x1'));var jsonpatch=require(_0x3fc0('0x2'));var rp=require('request-promise');var moment=require(_0x3fc0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fc0('0x4'));var util=require(_0x3fc0('0x5'));var path=require(_0x3fc0('0x6'));var sox=require(_0x3fc0('0x7'));var csv=require(_0x3fc0('0x8'));var ejs=require(_0x3fc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3fc0('0xa'));var _=require(_0x3fc0('0xb'));var squel=require('squel');var crypto=require(_0x3fc0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3fc0('0xd'));var toCsv=require(_0x3fc0('0x8'));var querystring=require(_0x3fc0('0xe'));var Papa=require(_0x3fc0('0xf'));var Redis=require('ioredis');var authService=require(_0x3fc0('0x10'));var qs=require(_0x3fc0('0x11'));var as=require(_0x3fc0('0x12'));var hardwareService=require(_0x3fc0('0x13'));var logger=require(_0x3fc0('0x14'))('api');var utils=require(_0x3fc0('0x15'));var config=require(_0x3fc0('0x16'));var licenseUtil=require(_0x3fc0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1011b7,_0x582e22){_0x582e22=_0x582e22||0xcc;return function(_0x3a4cc0){if(_0x3a4cc0){return _0x1011b7[_0x3fc0('0x18')](_0x582e22);}return _0x1011b7['status'](_0x582e22)[_0x3fc0('0x19')]();};}function respondWithResult(_0x422926,_0x392c46){_0x392c46=_0x392c46||0xc8;return function(_0x4eb69a){if(_0x4eb69a){return _0x422926[_0x3fc0('0x1a')](_0x392c46)[_0x3fc0('0x1b')](_0x4eb69a);}};}function respondWithFilteredResult(_0x367ce1,_0x27619a){return function(_0x562ecc){if(_0x562ecc){var _0x277dbf=typeof _0x27619a[_0x3fc0('0x1c')]===_0x3fc0('0x1d')&&typeof _0x27619a['limit']===_0x3fc0('0x1d');var _0x491446=_0x562ecc[_0x3fc0('0x1e')];var _0x3c5026=_0x277dbf?0x0:_0x27619a['offset'];var _0x3bb388=_0x277dbf?_0x562ecc[_0x3fc0('0x1e')]:_0x27619a[_0x3fc0('0x1c')]+_0x27619a[_0x3fc0('0x1f')];var _0x1bd575;if(_0x3bb388>=_0x491446){_0x3bb388=_0x491446;_0x1bd575=0xc8;}else{_0x1bd575=0xce;}_0x367ce1[_0x3fc0('0x1a')](_0x1bd575);return _0x367ce1[_0x3fc0('0x20')](_0x3fc0('0x21'),_0x3c5026+'-'+_0x3bb388+'/'+_0x491446)[_0x3fc0('0x1b')](_0x562ecc);}return null;};}function patchUpdates(_0x5c859e){return function(_0xf13744){try{jsonpatch[_0x3fc0('0x22')](_0xf13744,_0x5c859e,!![]);}catch(_0x34ffa7){return BPromise[_0x3fc0('0x23')](_0x34ffa7);}return _0xf13744[_0x3fc0('0x24')]();};}function saveUpdates(_0x448293,_0x47c770){return function(_0x477674){if(_0x477674){return _0x477674[_0x3fc0('0x25')](_0x448293)[_0x3fc0('0x26')](function(_0x28fc65){return _0x28fc65;});}return null;};}function removeEntity(_0x46c213,_0x303dd2){return function(_0x2f423e){if(_0x2f423e){return _0x2f423e[_0x3fc0('0x27')]()[_0x3fc0('0x26')](function(){var _0x35a3e2=_0x2f423e[_0x3fc0('0x28')]({'plain':!![]});var _0x1abe10=_0x3fc0('0x29');return db[_0x3fc0('0x2a')][_0x3fc0('0x27')]({'where':{'type':_0x1abe10,'resourceId':_0x35a3e2['id']}})[_0x3fc0('0x26')](function(){return _0x2f423e;});})['then'](function(){_0x46c213[_0x3fc0('0x1a')](0xcc)[_0x3fc0('0x19')]();});}};}function handleEntityNotFound(_0x1d9932,_0x35c34c){return function(_0x5a9179){if(!_0x5a9179){_0x1d9932[_0x3fc0('0x18')](0x194);}return _0x5a9179;};}function handleError(_0x197dfa,_0x126515){_0x126515=_0x126515||0x1f4;return function(_0x2645b4){logger['error'](_0x2645b4[_0x3fc0('0x2b')]);if(_0x2645b4[_0x3fc0('0x2c')]){delete _0x2645b4[_0x3fc0('0x2c')];}_0x197dfa[_0x3fc0('0x1a')](_0x126515)[_0x3fc0('0x2d')](_0x2645b4);};}exports[_0x3fc0('0x2e')]=function(_0x485f0c,_0xd9ecae){var _0x2351c8={},_0x181948={},_0x21a074={'count':0x0,'rows':[]};var _0x3f1a75=_[_0x3fc0('0x2f')](db[_0x3fc0('0x30')][_0x3fc0('0x31')],function(_0x4d6551){return{'name':_0x4d6551['fieldName'],'type':_0x4d6551[_0x3fc0('0x32')]['key']};});_0x181948[_0x3fc0('0x33')]=_[_0x3fc0('0x2f')](_0x3f1a75,_0x3fc0('0x2c'));_0x181948[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x485f0c['query']);_0x181948['filters']=_[_0x3fc0('0x36')](_0x181948[_0x3fc0('0x33')],_0x181948[_0x3fc0('0x34')]);_0x2351c8[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x181948['model'],qs[_0x3fc0('0x38')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x38')]));_0x2351c8['attributes']=_0x2351c8[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x2351c8[_0x3fc0('0x37')]:_0x181948[_0x3fc0('0x33')];if(!_0x485f0c['query'][_0x3fc0('0x3a')](_0x3fc0('0x3b'))){_0x2351c8['limit']=qs[_0x3fc0('0x1f')](_0x485f0c['query'][_0x3fc0('0x1f')]);_0x2351c8[_0x3fc0('0x1c')]=qs[_0x3fc0('0x1c')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x1c')]);}_0x2351c8[_0x3fc0('0x3c')]=qs[_0x3fc0('0x3d')](_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x3d')]);_0x2351c8[_0x3fc0('0x3e')]=qs[_0x3fc0('0x3f')](_['pick'](_0x485f0c[_0x3fc0('0x34')],_0x181948[_0x3fc0('0x3f')]),_0x3f1a75);if(_0x485f0c[_0x3fc0('0x34')][_0x3fc0('0x40')]){_0x2351c8[_0x3fc0('0x3e')]=_[_0x3fc0('0x41')](_0x2351c8['where'],{'$or':_['map'](_0x3f1a75,function(_0x3af7ed){if(_0x3af7ed[_0x3fc0('0x32')]!==_0x3fc0('0x42')){var _0x3e285f={};_0x3e285f[_0x3af7ed[_0x3fc0('0x2c')]]={'$like':'%'+_0x485f0c['query']['filter']+'%'};return _0x3e285f;}})});}_0x2351c8=_['merge']({},_0x2351c8,_0x485f0c[_0x3fc0('0x43')]);var _0x39d65c={'where':_0x2351c8[_0x3fc0('0x3e')]};return db['Tag']['count'](_0x39d65c)[_0x3fc0('0x26')](function(_0x239dc5){_0x21a074[_0x3fc0('0x1e')]=_0x239dc5;if(_0x485f0c[_0x3fc0('0x34')]['includeAll']){_0x2351c8['include']=[{'all':!![]}];}return db[_0x3fc0('0x30')][_0x3fc0('0x44')](_0x2351c8);})['then'](function(_0x32768f){_0x21a074['rows']=_0x32768f;return _0x21a074;})[_0x3fc0('0x26')](respondWithFilteredResult(_0xd9ecae,_0x2351c8))[_0x3fc0('0x45')](handleError(_0xd9ecae,null));};exports[_0x3fc0('0x46')]=function(_0x90120f,_0x2d01e9){var _0x38e449={'raw':!![],'where':{'id':_0x90120f[_0x3fc0('0x47')]['id']}},_0x80dfee={};_0x80dfee['model']=_[_0x3fc0('0x35')](db['Tag'][_0x3fc0('0x31')]);_0x80dfee[_0x3fc0('0x34')]=_[_0x3fc0('0x35')](_0x90120f[_0x3fc0('0x34')]);_0x80dfee[_0x3fc0('0x3f')]=_['intersection'](_0x80dfee[_0x3fc0('0x33')],_0x80dfee[_0x3fc0('0x34')]);_0x38e449[_0x3fc0('0x37')]=_[_0x3fc0('0x36')](_0x80dfee['model'],qs[_0x3fc0('0x38')](_0x90120f['query'][_0x3fc0('0x38')]));_0x38e449[_0x3fc0('0x37')]=_0x38e449[_0x3fc0('0x37')][_0x3fc0('0x39')]?_0x38e449[_0x3fc0('0x37')]:_0x80dfee['model'];if(_0x90120f[_0x3fc0('0x34')][_0x3fc0('0x48')]){_0x38e449[_0x3fc0('0x49')]=[{'all':!![]}];}_0x38e449=_['merge']({},_0x38e449,_0x90120f[_0x3fc0('0x43')]);return db[_0x3fc0('0x30')]['find'](_0x38e449)[_0x3fc0('0x26')](handleEntityNotFound(_0x2d01e9,null))[_0x3fc0('0x26')](respondWithResult(_0x2d01e9,null))[_0x3fc0('0x45')](handleError(_0x2d01e9,null));};exports['create']=function(_0x5e5c73,_0x3a35ac){return db[_0x3fc0('0x30')][_0x3fc0('0x4a')](_0x5e5c73['body'],{})[_0x3fc0('0x26')](function(_0x527569){var _0x40dbf3=_0x5e5c73['user']['get']({'plain':!![]});if(!_0x40dbf3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40dbf3[_0x3fc0('0x4b')]===_0x3fc0('0x4c')){var _0x141b4c=_0x527569[_0x3fc0('0x28')]({'plain':!![]});var _0x1e0c43=_0x3fc0('0x29');return db['UserProfileSection'][_0x3fc0('0x4d')]({'where':{'name':_0x1e0c43,'userProfileId':_0x40dbf3[_0x3fc0('0x4e')]},'raw':!![]})['then'](function(_0x550463){if(_0x550463&&_0x550463[_0x3fc0('0x4f')]===0x0){return db[_0x3fc0('0x2a')][_0x3fc0('0x4a')]({'name':_0x141b4c[_0x3fc0('0x2c')],'resourceId':_0x141b4c['id'],'type':_0x550463[_0x3fc0('0x2c')],'sectionId':_0x550463['id']},{})[_0x3fc0('0x26')](function(){return _0x527569;});}else{return _0x527569;}})[_0x3fc0('0x45')](function(_0x2da185){logger[_0x3fc0('0x50')](_0x3fc0('0x51'),_0x2da185);throw _0x2da185;});}return _0x527569;})[_0x3fc0('0x26')](respondWithResult(_0x3a35ac,0xc9))[_0x3fc0('0x45')](handleError(_0x3a35ac,null));};exports['update']=function(_0x24be72,_0xda5d3e){if(_0x24be72[_0x3fc0('0x52')]['id']){delete _0x24be72[_0x3fc0('0x52')]['id'];}return db[_0x3fc0('0x30')]['find']({'where':{'id':_0x24be72[_0x3fc0('0x47')]['id']}})['then'](handleEntityNotFound(_0xda5d3e,null))[_0x3fc0('0x26')](saveUpdates(_0x24be72[_0x3fc0('0x52')],null))[_0x3fc0('0x26')](respondWithResult(_0xda5d3e,null))[_0x3fc0('0x45')](handleError(_0xda5d3e,null));};exports['destroy']=function(_0x1656c7,_0xd903e3){return db[_0x3fc0('0x30')][_0x3fc0('0x4d')]({'where':{'id':_0x1656c7[_0x3fc0('0x47')]['id']}})[_0x3fc0('0x26')](handleEntityNotFound(_0xd903e3,null))['then'](removeEntity(_0xd903e3,null))[_0x3fc0('0x45')](handleError(_0xd903e3,null));};
\ No newline at end of file
+var _0xe28e=['stack','name','send','index','map','Tag','fieldName','key','model','query','keys','attributes','intersection','fields','limit','order','sort','where','filters','pick','VIRTUAL','merge','include','catch','show','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','then','get','Tags','UserProfileResource','error'];(function(_0x83500f,_0x1b1f13){var _0x5c1481=function(_0x421fdd){while(--_0x421fdd){_0x83500f['push'](_0x83500f['shift']());}};_0x5c1481(++_0x1b1f13);}(_0xe28e,0x1ba));var _0xee28=function(_0x4cde49,_0x4c8aca){_0x4cde49=_0x4cde49-0x0;var _0x59d690=_0xe28e[_0x4cde49];return _0x59d690;};'use strict';var emlformat=require(_0xee28('0x0'));var rimraf=require(_0xee28('0x1'));var zipdir=require(_0xee28('0x2'));var jsonpatch=require(_0xee28('0x3'));var rp=require(_0xee28('0x4'));var moment=require(_0xee28('0x5'));var BPromise=require(_0xee28('0x6'));var Mustache=require(_0xee28('0x7'));var util=require(_0xee28('0x8'));var path=require(_0xee28('0x9'));var sox=require(_0xee28('0xa'));var csv=require(_0xee28('0xb'));var ejs=require(_0xee28('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee28('0xd'));var squel=require(_0xee28('0xe'));var crypto=require(_0xee28('0xf'));var jsforce=require(_0xee28('0x10'));var deskjs=require(_0xee28('0x11'));var toCsv=require(_0xee28('0xb'));var querystring=require(_0xee28('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xee28('0x13'));var as=require(_0xee28('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee28('0x15'))(_0xee28('0x16'));var utils=require('../../config/utils');var config=require(_0xee28('0x17'));var licenseUtil=require(_0xee28('0x18'));var db=require(_0xee28('0x19'))['db'];function respondWithStatusCode(_0x2488cf,_0x267031){_0x267031=_0x267031||0xcc;return function(_0x46e784){if(_0x46e784){return _0x2488cf[_0xee28('0x1a')](_0x267031);}return _0x2488cf['status'](_0x267031)[_0xee28('0x1b')]();};}function respondWithResult(_0x1df69a,_0x555b9c){_0x555b9c=_0x555b9c||0xc8;return function(_0x331b7c){if(_0x331b7c){return _0x1df69a[_0xee28('0x1c')](_0x555b9c)['json'](_0x331b7c);}};}function respondWithFilteredResult(_0x11ac93,_0x17c99a){return function(_0x3d3a5c){if(_0x3d3a5c){var _0x343358=typeof _0x17c99a[_0xee28('0x1d')]===_0xee28('0x1e')&&typeof _0x17c99a['limit']===_0xee28('0x1e');var _0x5de212=_0x3d3a5c[_0xee28('0x1f')];var _0x19472a=_0x343358?0x0:_0x17c99a['offset'];var _0x355b07=_0x343358?_0x3d3a5c['count']:_0x17c99a[_0xee28('0x1d')]+_0x17c99a['limit'];var _0x28da88;if(_0x355b07>=_0x5de212){_0x355b07=_0x5de212;_0x28da88=0xc8;}else{_0x28da88=0xce;}_0x11ac93['status'](_0x28da88);return _0x11ac93[_0xee28('0x20')]('Content-Range',_0x19472a+'-'+_0x355b07+'/'+_0x5de212)[_0xee28('0x21')](_0x3d3a5c);}return null;};}function patchUpdates(_0x2a01ff){return function(_0x96f5db){try{jsonpatch[_0xee28('0x22')](_0x96f5db,_0x2a01ff,!![]);}catch(_0x21ee24){return BPromise[_0xee28('0x23')](_0x21ee24);}return _0x96f5db[_0xee28('0x24')]();};}function saveUpdates(_0x4bda53,_0x342798){return function(_0x44d7ff){if(_0x44d7ff){return _0x44d7ff[_0xee28('0x25')](_0x4bda53)['then'](function(_0x5b500b){return _0x5b500b;});}return null;};}function removeEntity(_0x17d8e4,_0x4a524d){return function(_0x1519ae){if(_0x1519ae){return _0x1519ae[_0xee28('0x26')]()[_0xee28('0x27')](function(){var _0x3acfc9=_0x1519ae[_0xee28('0x28')]({'plain':!![]});var _0x95d917=_0xee28('0x29');return db[_0xee28('0x2a')][_0xee28('0x26')]({'where':{'type':_0x95d917,'resourceId':_0x3acfc9['id']}})['then'](function(){return _0x1519ae;});})[_0xee28('0x27')](function(){_0x17d8e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54528b,_0x587aac){return function(_0x51eae7){if(!_0x51eae7){_0x54528b[_0xee28('0x1a')](0x194);}return _0x51eae7;};}function handleError(_0x884e7d,_0x3b64ad){_0x3b64ad=_0x3b64ad||0x1f4;return function(_0x469889){logger[_0xee28('0x2b')](_0x469889[_0xee28('0x2c')]);if(_0x469889[_0xee28('0x2d')]){delete _0x469889['name'];}_0x884e7d[_0xee28('0x1c')](_0x3b64ad)[_0xee28('0x2e')](_0x469889);};}exports[_0xee28('0x2f')]=function(_0x49644a,_0x14f7c4){var _0x2890ad={},_0x213e45={},_0xf0b169={'count':0x0,'rows':[]};var _0x1421bc=_[_0xee28('0x30')](db[_0xee28('0x31')]['rawAttributes'],function(_0x15f294){return{'name':_0x15f294[_0xee28('0x32')],'type':_0x15f294['type'][_0xee28('0x33')]};});_0x213e45[_0xee28('0x34')]=_[_0xee28('0x30')](_0x1421bc,_0xee28('0x2d'));_0x213e45[_0xee28('0x35')]=_[_0xee28('0x36')](_0x49644a[_0xee28('0x35')]);_0x213e45['filters']=_['intersection'](_0x213e45['model'],_0x213e45[_0xee28('0x35')]);_0x2890ad[_0xee28('0x37')]=_[_0xee28('0x38')](_0x213e45[_0xee28('0x34')],qs[_0xee28('0x39')](_0x49644a[_0xee28('0x35')]['fields']));_0x2890ad[_0xee28('0x37')]=_0x2890ad[_0xee28('0x37')]['length']?_0x2890ad['attributes']:_0x213e45[_0xee28('0x34')];if(!_0x49644a[_0xee28('0x35')]['hasOwnProperty']('nolimit')){_0x2890ad[_0xee28('0x3a')]=qs[_0xee28('0x3a')](_0x49644a['query'][_0xee28('0x3a')]);_0x2890ad[_0xee28('0x1d')]=qs[_0xee28('0x1d')](_0x49644a[_0xee28('0x35')][_0xee28('0x1d')]);}_0x2890ad[_0xee28('0x3b')]=qs[_0xee28('0x3c')](_0x49644a[_0xee28('0x35')][_0xee28('0x3c')]);_0x2890ad[_0xee28('0x3d')]=qs[_0xee28('0x3e')](_[_0xee28('0x3f')](_0x49644a['query'],_0x213e45[_0xee28('0x3e')]),_0x1421bc);if(_0x49644a['query']['filter']){_0x2890ad[_0xee28('0x3d')]=_['merge'](_0x2890ad[_0xee28('0x3d')],{'$or':_['map'](_0x1421bc,function(_0x2b73d9){if(_0x2b73d9['type']!==_0xee28('0x40')){var _0x211345={};_0x211345[_0x2b73d9[_0xee28('0x2d')]]={'$like':'%'+_0x49644a[_0xee28('0x35')]['filter']+'%'};return _0x211345;}})});}_0x2890ad=_[_0xee28('0x41')]({},_0x2890ad,_0x49644a['options']);var _0x45ed94={'where':_0x2890ad[_0xee28('0x3d')]};return db[_0xee28('0x31')][_0xee28('0x1f')](_0x45ed94)[_0xee28('0x27')](function(_0x2e046e){_0xf0b169[_0xee28('0x1f')]=_0x2e046e;if(_0x49644a['query']['includeAll']){_0x2890ad[_0xee28('0x42')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x2890ad);})[_0xee28('0x27')](function(_0x14bd8d){_0xf0b169['rows']=_0x14bd8d;return _0xf0b169;})[_0xee28('0x27')](respondWithFilteredResult(_0x14f7c4,_0x2890ad))[_0xee28('0x43')](handleError(_0x14f7c4,null));};exports[_0xee28('0x44')]=function(_0x24cfaa,_0x460c61){var _0x2351f7={'raw':!![],'where':{'id':_0x24cfaa['params']['id']}},_0x1735a9={};_0x1735a9[_0xee28('0x34')]=_[_0xee28('0x36')](db[_0xee28('0x31')][_0xee28('0x45')]);_0x1735a9[_0xee28('0x35')]=_['keys'](_0x24cfaa[_0xee28('0x35')]);_0x1735a9[_0xee28('0x3e')]=_['intersection'](_0x1735a9[_0xee28('0x34')],_0x1735a9[_0xee28('0x35')]);_0x2351f7[_0xee28('0x37')]=_[_0xee28('0x38')](_0x1735a9[_0xee28('0x34')],qs[_0xee28('0x39')](_0x24cfaa['query'][_0xee28('0x39')]));_0x2351f7['attributes']=_0x2351f7['attributes'][_0xee28('0x46')]?_0x2351f7[_0xee28('0x37')]:_0x1735a9['model'];if(_0x24cfaa[_0xee28('0x35')][_0xee28('0x47')]){_0x2351f7[_0xee28('0x42')]=[{'all':!![]}];}_0x2351f7=_['merge']({},_0x2351f7,_0x24cfaa['options']);return db[_0xee28('0x31')][_0xee28('0x48')](_0x2351f7)[_0xee28('0x27')](handleEntityNotFound(_0x460c61,null))[_0xee28('0x27')](respondWithResult(_0x460c61,null))[_0xee28('0x43')](handleError(_0x460c61,null));};exports[_0xee28('0x49')]=function(_0x2574c5,_0x2b5f36){return db[_0xee28('0x31')][_0xee28('0x49')](_0x2574c5['body'],{})[_0xee28('0x27')](function(_0x5e174f){var _0x21a66a=_0x2574c5[_0xee28('0x4a')][_0xee28('0x28')]({'plain':!![]});if(!_0x21a66a)throw new Error(_0xee28('0x4b'));if(_0x21a66a[_0xee28('0x4c')]==='user'){var _0x5247fe=_0x5e174f['get']({'plain':!![]});var _0x1b15a4='Tags';return db['UserProfileSection'][_0xee28('0x48')]({'where':{'name':_0x1b15a4,'userProfileId':_0x21a66a['userProfileId']},'raw':!![]})[_0xee28('0x27')](function(_0x1f6754){if(_0x1f6754&&_0x1f6754[_0xee28('0x4d')]===0x0){return db[_0xee28('0x2a')][_0xee28('0x49')]({'name':_0x5247fe[_0xee28('0x2d')],'resourceId':_0x5247fe['id'],'type':_0x1f6754[_0xee28('0x2d')],'sectionId':_0x1f6754['id']},{})[_0xee28('0x27')](function(){return _0x5e174f;});}else{return _0x5e174f;}})[_0xee28('0x43')](function(_0x10d393){logger['error'](_0xee28('0x4e'),_0x10d393);throw _0x10d393;});}return _0x5e174f;})[_0xee28('0x27')](respondWithResult(_0x2b5f36,0xc9))[_0xee28('0x43')](handleError(_0x2b5f36,null));};exports['update']=function(_0x5b9ced,_0x57d865){if(_0x5b9ced['body']['id']){delete _0x5b9ced[_0xee28('0x4f')]['id'];}return db[_0xee28('0x31')][_0xee28('0x48')]({'where':{'id':_0x5b9ced['params']['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x57d865,null))[_0xee28('0x27')](saveUpdates(_0x5b9ced[_0xee28('0x4f')],null))[_0xee28('0x27')](respondWithResult(_0x57d865,null))[_0xee28('0x43')](handleError(_0x57d865,null));};exports['destroy']=function(_0x2a5da9,_0x1c6696){return db[_0xee28('0x31')]['find']({'where':{'id':_0x2a5da9[_0xee28('0x50')]['id']}})[_0xee28('0x27')](handleEntityNotFound(_0x1c6696,null))[_0xee28('0x27')](removeEntity(_0x1c6696,null))[_0xee28('0x43')](handleError(_0x1c6696,null));};
\ No newline at end of file
index 8abda5d..7dd72a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd071=['path','rimraf','../../config/environment','./tag.attributes','define','util','../../config/logger','bluebird','request-promise'];(function(_0x486f67,_0x31a5ba){var _0x51e075=function(_0x5aec97){while(--_0x5aec97){_0x486f67['push'](_0x486f67['shift']());}};_0x51e075(++_0x31a5ba);}(_0xd071,0x10a));var _0x1d07=function(_0x1643ce,_0x35fba8){_0x1643ce=_0x1643ce-0x0;var _0x188e65=_0xd071[_0x1643ce];return _0x188e65;};'use strict';var _=require('lodash');var util=require(_0x1d07('0x0'));var logger=require(_0x1d07('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1d07('0x2'));var rp=require(_0x1d07('0x3'));var fs=require('fs');var path=require(_0x1d07('0x4'));var rimraf=require(_0x1d07('0x5'));var config=require(_0x1d07('0x6'));var attributes=require(_0x1d07('0x7'));module['exports']=function(_0x5efd22,_0x76bda0){return _0x5efd22[_0x1d07('0x8')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ff3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x21c3ac,_0x2a46bb){var _0x3c45ad=function(_0xa506ae){while(--_0xa506ae){_0x21c3ac['push'](_0x21c3ac['shift']());}};_0x3c45ad(++_0x2a46bb);}(_0x4ff3,0x198));var _0x34ff=function(_0x1d649a,_0x3b7d14){_0x1d649a=_0x1d649a-0x0;var _0x2f5f7b=_0x4ff3[_0x1d649a];return _0x2f5f7b;};'use strict';var _=require('lodash');var util=require(_0x34ff('0x0'));var logger=require(_0x34ff('0x1'))(_0x34ff('0x2'));var moment=require(_0x34ff('0x3'));var BPromise=require(_0x34ff('0x4'));var rp=require(_0x34ff('0x5'));var fs=require('fs');var path=require(_0x34ff('0x6'));var rimraf=require(_0x34ff('0x7'));var config=require(_0x34ff('0x8'));var attributes=require(_0x34ff('0x9'));module[_0x34ff('0xa')]=function(_0x1abcd1,_0x17bec3){return _0x1abcd1[_0x34ff('0xb')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac19641..e695fd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6308=['stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6308,0x1f2));var _0x8630=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x6308[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0x8630('0x0'));var util=require('util');var moment=require(_0x8630('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8630('0x2'));var db=require(_0x8630('0x3'))['db'];var utils=require(_0x8630('0x4'));var logger=require(_0x8630('0x5'))(_0x8630('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8630('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x337086,_0x3d5a10,_0x1bcfea){return new BPromise(function(_0x2b87ea,_0x10cc17){return client[_0x8630('0x8')](_0x337086,_0x1bcfea)['then'](function(_0x8b3652){logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));logger[_0x8630('0xb')]('Tag,\x20%s,\x20%s,\x20%s',_0x3d5a10,_0x8630('0xa'),JSON[_0x8630('0xc')](_0x8b3652));if(_0x8b3652[_0x8630('0xd')]){if(_0x8b3652['error'][_0x8630('0xe')]===0x1f4){logger[_0x8630('0xd')]('Tag,\x20%s,\x20%s',_0x3d5a10,_0x8b3652['error'][_0x8630('0xf')]);return _0x10cc17(_0x8b3652[_0x8630('0xd')]['message']);}logger[_0x8630('0xd')]('Tag,\x20%s,\x20%s',_0x3d5a10,_0x8b3652[_0x8630('0xd')]['message']);return _0x2b87ea(_0x8b3652[_0x8630('0xd')]['message']);}else{logger['info'](_0x8630('0x9'),_0x3d5a10,_0x8630('0xa'));_0x2b87ea(_0x8b3652['result']['message']);}})[_0x8630('0x10')](function(_0x547667){logger[_0x8630('0xd')](_0x8630('0x9'),_0x3d5a10,_0x547667);_0x10cc17(_0x547667);});});}
\ No newline at end of file
+var _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x237312,_0x4dd4c0){var _0x93cdf0=function(_0x24c169){while(--_0x24c169){_0x237312['push'](_0x237312['shift']());}};_0x93cdf0(++_0x4dd4c0);}(_0xb821,0xa7));var _0x1b82=function(_0x547bd5,_0x1d113f){_0x547bd5=_0x547bd5-0x0;var _0x37984c=_0xb821[_0x547bd5];return _0x37984c;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('Tag,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});}
\ No newline at end of file
index 54317bd..07ff3ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
index a9fe6d5..5625f59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x4a66de,_0x2afc51){var _0x11029a=function(_0x1fe7c9){while(--_0x1fe7c9){_0x4a66de['push'](_0x4a66de['shift']());}};_0x11029a(++_0x2afc51);}(_0xb10b,0x12a));var _0xbb10=function(_0x29cd52,_0x88b52b){_0x29cd52=_0x29cd52-0x0;var _0x5218bc=_0xb10b[_0x29cd52];return _0x5218bc;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0x2032=['name','exports','STRING'];(function(_0x5db65f,_0x297030){var _0x4beb79=function(_0x5d1d73){while(--_0x5d1d73){_0x5db65f['push'](_0x5db65f['shift']());}};_0x4beb79(++_0x297030);}(_0x2032,0xd9));var _0x2203=function(_0x486baf,_0x182258){_0x486baf=_0x486baf-0x0;var _0xe2e36b=_0x2032[_0x486baf];return _0xe2e36b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 89ab84e..173ca8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x955a=['Queue:remove','getAgents','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','sendStatus','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','rawAttributes','pick','capitalize','Queues','addQueues','add','ids','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','findOrCreate','Queue:save','User','findAll','online','interface','UserVoiceQueueRt','upsert','format','SIP/%s','voicePause','all','UserVoicePrefix','addAgents','spread','removeAgents','emit'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x955a,0x1dc));var _0xa955=function(_0x53f9c2,_0x1ebee6){_0x53f9c2=_0x53f9c2-0x0;var _0x3c3177=_0x955a[_0x53f9c2];return _0x3c3177;};'use strict';var emlformat=require(_0xa955('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa955('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa955('0x2'));var Mustache=require(_0xa955('0x3'));var util=require(_0xa955('0x4'));var path=require(_0xa955('0x5'));var sox=require(_0xa955('0x6'));var csv=require(_0xa955('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa955('0x8'));var squel=require(_0xa955('0x9'));var crypto=require(_0xa955('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa955('0xb'));var toCsv=require(_0xa955('0x7'));var querystring=require(_0xa955('0xc'));var Papa=require(_0xa955('0xd'));var Redis=require(_0xa955('0xe'));var authService=require(_0xa955('0xf'));var qs=require(_0xa955('0x10'));var as=require(_0xa955('0x11'));var hardwareService=require(_0xa955('0x12'));var logger=require('../../config/logger')(_0xa955('0x13'));var utils=require(_0xa955('0x14'));var config=require(_0xa955('0x15'));var licenseUtil=require(_0xa955('0x16'));var db=require('../../mysqldb')['db'];config[_0xa955('0x17')]=_[_0xa955('0x18')](config[_0xa955('0x17')],{'host':_0xa955('0x19'),'port':0x18eb});var socket=require(_0xa955('0x1a'))(new Redis(config[_0xa955('0x17')]));require(_0xa955('0x1b'))[_0xa955('0x1c')](socket);function respondWithStatusCode(_0x36ef9f,_0x5b745f){_0x5b745f=_0x5b745f||0xcc;return function(_0x42753d){if(_0x42753d){return _0x36ef9f['sendStatus'](_0x5b745f);}return _0x36ef9f[_0xa955('0x1d')](_0x5b745f)[_0xa955('0x1e')]();};}function respondWithResult(_0xb07db2,_0x12197e){_0x12197e=_0x12197e||0xc8;return function(_0x5717b5){if(_0x5717b5){return _0xb07db2[_0xa955('0x1d')](_0x12197e)[_0xa955('0x1f')](_0x5717b5);}};}function respondWithFilteredResult(_0xdecc8f,_0x3b3d84){return function(_0x1fc4bd){if(_0x1fc4bd){var _0x19d664=typeof _0x3b3d84[_0xa955('0x20')]===_0xa955('0x21')&&typeof _0x3b3d84[_0xa955('0x22')]==='undefined';var _0x560fb9=_0x1fc4bd[_0xa955('0x23')];var _0x2013be=_0x19d664?0x0:_0x3b3d84['offset'];var _0x10670a=_0x19d664?_0x1fc4bd[_0xa955('0x23')]:_0x3b3d84[_0xa955('0x20')]+_0x3b3d84[_0xa955('0x22')];var _0x15816f;if(_0x10670a>=_0x560fb9){_0x10670a=_0x560fb9;_0x15816f=0xc8;}else{_0x15816f=0xce;}_0xdecc8f[_0xa955('0x1d')](_0x15816f);return _0xdecc8f['set'](_0xa955('0x24'),_0x2013be+'-'+_0x10670a+'/'+_0x560fb9)[_0xa955('0x1f')](_0x1fc4bd);}return null;};}function patchUpdates(_0x503147){return function(_0x24f038){try{jsonpatch[_0xa955('0x25')](_0x24f038,_0x503147,!![]);}catch(_0x70aa61){return BPromise[_0xa955('0x26')](_0x70aa61);}return _0x24f038[_0xa955('0x27')]();};}function saveUpdates(_0x555c44,_0xc821ee){return function(_0x139306){if(_0x139306){return _0x139306[_0xa955('0x28')](_0x555c44)[_0xa955('0x29')](function(_0x48b767){return _0x48b767;});}return null;};}function handleEntityNotFound(_0x188b26,_0x30543a){return function(_0x35b65f){if(!_0x35b65f){_0x188b26['sendStatus'](0x194);}return _0x35b65f;};}function handleError(_0x4262c5,_0x170505){_0x170505=_0x170505||0x1f4;return function(_0xe6b6b3){logger[_0xa955('0x2a')](_0xe6b6b3[_0xa955('0x2b')]);if(_0xe6b6b3['name']){delete _0xe6b6b3[_0xa955('0x2c')];}_0x4262c5[_0xa955('0x1d')](_0x170505)[_0xa955('0x2d')](_0xe6b6b3);};}exports[_0xa955('0x2e')]=function(_0x296bba,_0x54d297){var _0x20fc88={},_0x311949={},_0x38b345={'count':0x0,'rows':[]};var _0x53e1de=_[_0xa955('0x2f')](db[_0xa955('0x30')]['rawAttributes'],function(_0x359d8b){return{'name':_0x359d8b[_0xa955('0x31')],'type':_0x359d8b[_0xa955('0x32')][_0xa955('0x33')]};});_0x311949[_0xa955('0x34')]=_[_0xa955('0x2f')](_0x53e1de,'name');_0x311949[_0xa955('0x35')]=_[_0xa955('0x36')](_0x296bba[_0xa955('0x35')]);_0x311949[_0xa955('0x37')]=_['intersection'](_0x311949[_0xa955('0x34')],_0x311949[_0xa955('0x35')]);_0x20fc88[_0xa955('0x38')]=_['intersection'](_0x311949[_0xa955('0x34')],qs['fields'](_0x296bba[_0xa955('0x35')][_0xa955('0x39')]));_0x20fc88[_0xa955('0x38')]=_0x20fc88[_0xa955('0x38')][_0xa955('0x3a')]?_0x20fc88[_0xa955('0x38')]:_0x311949[_0xa955('0x34')];if(!_0x296bba['query']['hasOwnProperty'](_0xa955('0x3b'))){_0x20fc88[_0xa955('0x22')]=qs[_0xa955('0x22')](_0x296bba['query'][_0xa955('0x22')]);_0x20fc88['offset']=qs[_0xa955('0x20')](_0x296bba['query'][_0xa955('0x20')]);}_0x20fc88[_0xa955('0x3c')]=qs['sort'](_0x296bba[_0xa955('0x35')][_0xa955('0x3d')]);_0x20fc88[_0xa955('0x3e')]=qs['filters'](_['pick'](_0x296bba[_0xa955('0x35')],_0x311949[_0xa955('0x37')]),_0x53e1de);if(_0x296bba['query'][_0xa955('0x3f')]){_0x20fc88[_0xa955('0x3e')]=_['merge'](_0x20fc88[_0xa955('0x3e')],{'$or':_['map'](_0x53e1de,function(_0x9b4686){if(_0x9b4686[_0xa955('0x32')]!==_0xa955('0x40')){var _0x46cefe={};_0x46cefe[_0x9b4686[_0xa955('0x2c')]]={'$like':'%'+_0x296bba[_0xa955('0x35')][_0xa955('0x3f')]+'%'};return _0x46cefe;}})});}_0x20fc88=_['merge']({},_0x20fc88,_0x296bba[_0xa955('0x41')]);var _0x4fe2ff={'where':_0x20fc88[_0xa955('0x3e')]};return db['Team'][_0xa955('0x23')](_0x4fe2ff)[_0xa955('0x29')](function(_0x10f98c){_0x38b345[_0xa955('0x23')]=_0x10f98c;if(_0x296bba[_0xa955('0x35')][_0xa955('0x42')]){_0x20fc88[_0xa955('0x43')]=[{'all':!![]}];}return db['Team']['findAll'](_0x20fc88);})[_0xa955('0x29')](function(_0x557d3b){_0x38b345[_0xa955('0x44')]=_0x557d3b;return _0x38b345;})[_0xa955('0x29')](respondWithFilteredResult(_0x54d297,_0x20fc88))[_0xa955('0x45')](handleError(_0x54d297,null));};exports[_0xa955('0x46')]=function(_0x2902c8,_0xd031c0){var _0x51ce5f={'raw':![],'where':{'id':_0x2902c8[_0xa955('0x47')]['id']}},_0x30dd91={};_0x30dd91[_0xa955('0x34')]=_[_0xa955('0x36')](db['Team']['rawAttributes']);_0x30dd91[_0xa955('0x35')]=_[_0xa955('0x36')](_0x2902c8[_0xa955('0x35')]);_0x30dd91[_0xa955('0x37')]=_[_0xa955('0x48')](_0x30dd91[_0xa955('0x34')],_0x30dd91[_0xa955('0x35')]);_0x51ce5f[_0xa955('0x38')]=_[_0xa955('0x48')](_0x30dd91[_0xa955('0x34')],qs[_0xa955('0x39')](_0x2902c8[_0xa955('0x35')]['fields']));_0x51ce5f['attributes']=_0x51ce5f['attributes'][_0xa955('0x3a')]?_0x51ce5f['attributes']:_0x30dd91[_0xa955('0x34')];if(_0x2902c8[_0xa955('0x35')][_0xa955('0x42')]){_0x51ce5f['include']=[{'all':!![]}];}_0x51ce5f=_[_0xa955('0x49')]({},_0x51ce5f,_0x2902c8[_0xa955('0x41')]);return db['Team'][_0xa955('0x4a')](_0x51ce5f)[_0xa955('0x29')](handleEntityNotFound(_0xd031c0,null))[_0xa955('0x29')](respondWithResult(_0xd031c0,null))[_0xa955('0x45')](handleError(_0xd031c0,null));};exports[_0xa955('0x4b')]=function(_0x245b0c,_0x333669){return db[_0xa955('0x30')]['create'](_0x245b0c[_0xa955('0x4c')],{})[_0xa955('0x29')](function(_0x365e53){var _0x4983b6=_0x245b0c[_0xa955('0x4d')][_0xa955('0x4e')]({'plain':!![]});if(!_0x4983b6)throw new Error(_0xa955('0x4f'));if(_0x4983b6[_0xa955('0x50')]===_0xa955('0x4d')){var _0x468d4d=_0x365e53['get']({'plain':!![]});var _0x1c06a6=_0xa955('0x51');return db['UserProfileSection'][_0xa955('0x4a')]({'where':{'name':_0x1c06a6,'userProfileId':_0x4983b6['userProfileId']},'raw':!![]})[_0xa955('0x29')](function(_0x178828){if(_0x178828&&_0x178828[_0xa955('0x52')]===0x0){return db[_0xa955('0x53')]['create']({'name':_0x468d4d[_0xa955('0x2c')],'resourceId':_0x468d4d['id'],'type':_0x178828['name'],'sectionId':_0x178828['id']},{})[_0xa955('0x29')](function(){return _0x365e53;});}else{return _0x365e53;}})[_0xa955('0x45')](function(_0x2f1c22){logger[_0xa955('0x2a')](_0xa955('0x54'),_0x2f1c22);throw _0x2f1c22;});}return _0x365e53;})[_0xa955('0x29')](respondWithResult(_0x333669,0xc9))['catch'](handleError(_0x333669,null));};exports[_0xa955('0x28')]=function(_0x2d7025,_0x2a1b5a){if(_0x2d7025[_0xa955('0x4c')]['id']){delete _0x2d7025[_0xa955('0x4c')]['id'];}return db[_0xa955('0x30')]['find']({'where':{'id':_0x2d7025[_0xa955('0x47')]['id']}})[_0xa955('0x29')](handleEntityNotFound(_0x2a1b5a,null))[_0xa955('0x29')](saveUpdates(_0x2d7025[_0xa955('0x4c')],null))[_0xa955('0x29')](respondWithResult(_0x2a1b5a,null))[_0xa955('0x45')](handleError(_0x2a1b5a,null));};exports[_0xa955('0x55')]=function(_0x40411b,_0x5d90d3){var _0x4e301a=_0x40411b[_0xa955('0x47')]['id'];var _0x535067=[];return db[_0xa955('0x56')][_0xa955('0x57')](function(_0x404c80){var _0x386f0c=_0xa955('0x58')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x386f0c,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80})[_0xa955('0x29')](function(_0x5df83f){_0x535067=_[_0xa955('0x2f')](_0x5df83f,function(_0x1dc8c7){return Number(_0x1dc8c7['UserId']);});})['then'](function(){var _0x3e68b0='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4e301a;return db[_0xa955('0x56')]['query'](_0x3e68b0,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x286502){var _0x3b8dea=_[_0xa955('0x2f')](_0x286502,function(_0x1592dd){return Number(_0x1592dd[_0xa955('0x5c')]);});return db['UserVoiceQueue'][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'VoiceQueueId':{'$in':_0x3b8dea}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x1dddaa=_0xa955('0x5d')+_0x4e301a;return db['sequelize'][_0xa955('0x35')](_0x1dddaa,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x360b90){var _0x5d4587=_[_0xa955('0x2f')](_0x360b90,function(_0x44447d){return Number(_0x44447d[_0xa955('0x5e')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x535067},'MailQueueId':{'$in':_0x5d4587}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x1afef2=_0xa955('0x5f')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x1afef2,{'type':db[_0xa955('0x59')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x404c80});})['then'](function(_0x13e73f){var _0x126357=_[_0xa955('0x2f')](_0x13e73f,function(_0x2b7a9c){return Number(_0x2b7a9c[_0xa955('0x60')]);});return db['UserSmsQueue']['destroy']({'where':{'UserId':{'$in':_0x535067},'SmsQueueId':{'$in':_0x126357}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x2c57c6=_0xa955('0x61')+_0x4e301a;return db['sequelize'][_0xa955('0x35')](_0x2c57c6,{'type':db[_0xa955('0x59')]['QueryTypes'][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})['then'](function(_0x32c01b){var _0x30e574=_[_0xa955('0x2f')](_0x32c01b,function(_0x41f5fd){return Number(_0x41f5fd[_0xa955('0x62')]);});return db[_0xa955('0x63')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'ChatQueueId':{'$in':_0x30e574}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x39cb6e=_0xa955('0x64')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x39cb6e,{'type':db['Sequelize']['QueryTypes'][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x429663){var _0x1e1aa4=_['map'](_0x429663,function(_0x53c8ac){return Number(_0x53c8ac[_0xa955('0x65')]);});return db[_0xa955('0x66')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'FaxQueueId':{'$in':_0x1e1aa4}},'transaction':_0x404c80});})['then'](function(){var _0x51d9ad=_0xa955('0x67')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x51d9ad,{'type':db[_0xa955('0x59')][_0xa955('0x5a')][_0xa955('0x5b')],'raw':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x123ac6){var _0x566e0b=_['map'](_0x123ac6,function(_0x1d3ad0){return Number(_0x1d3ad0[_0xa955('0x68')]);});return db[_0xa955('0x69')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'OpenchannelQueueId':{'$in':_0x566e0b}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){var _0x17efee=_0xa955('0x6a')+_0x4e301a;return db[_0xa955('0x56')][_0xa955('0x35')](_0x17efee,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x404c80});})['then'](function(_0x4d28a1){var _0x42be4f=_[_0xa955('0x2f')](_0x4d28a1,function(_0x29ba1c){return Number(_0x29ba1c[_0xa955('0x6b')]);});return db[_0xa955('0x6c')][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'WhatsappQueueId':{'$in':_0x42be4f}},'transaction':_0x404c80});})[_0xa955('0x29')](function(){return db[_0xa955('0x6d')][_0xa955('0x4a')]({'where':{'TeamId':_0x4e301a}});})[_0xa955('0x29')](function(_0xf8baab){if(_0xf8baab===null){return;}return db['UserVoicePrefix'][_0xa955('0x55')]({'where':{'UserId':{'$in':_0x535067},'VoicePrefixId':_0xf8baab[_0xa955('0x6e')]},'transaction':_0x404c80});})[_0xa955('0x29')](function(){return db[_0xa955('0x30')][_0xa955('0x55')]({'where':{'id':_0x4e301a},'cascade':!![],'transaction':_0x404c80});})[_0xa955('0x29')](function(_0x6b075b){if(_0x6b075b===0x0){_0x5d90d3[_0xa955('0x6f')](0x194);}else{return db[_0xa955('0x53')][_0xa955('0x55')]({'where':{'type':_0xa955('0x51'),'resourceId':_0x4e301a},'cascade':!![],'transaction':_0x404c80})['then'](function(){_0x5d90d3[_0xa955('0x1d')](0xcc)['end']();});}})[_0xa955('0x45')](function(_0x28eb47){_0x5d90d3[_0xa955('0x1d')](0x1f4)[_0xa955('0x2d')](_0x28eb47);});});};exports[_0xa955('0x70')]=function(_0x3e35f2,_0x1eb0a2,_0x43d637){return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x3e35f2[_0xa955('0x47')]['id']}})[_0xa955('0x29')](handleEntityNotFound(_0x1eb0a2,null))['then'](function(_0x594ae4){if(!_0x3e35f2[_0xa955('0x35')]['channel']||!utils[_0xa955('0x72')](_0x3e35f2[_0xa955('0x35')][_0xa955('0x73')])){throw new db[(_0xa955('0x59'))][(_0xa955('0x74'))](_0xa955('0x75'));}var _0x2b67db={};var _0x25ac00={};_0x25ac00[_0xa955('0x34')]=_[_0xa955('0x36')](db[_['capitalize'](_0x3e35f2[_0xa955('0x35')]['channel'][_0xa955('0x76')]())+_0xa955('0x77')][_0xa955('0x78')]);_0x25ac00['query']=_[_0xa955('0x36')](_0x3e35f2[_0xa955('0x35')]);_0x25ac00[_0xa955('0x37')]=_['intersection'](_0x25ac00[_0xa955('0x34')],_0x25ac00[_0xa955('0x35')]);_0x2b67db[_0xa955('0x38')]=_[_0xa955('0x48')](_0x25ac00[_0xa955('0x34')],qs[_0xa955('0x39')](_0x3e35f2[_0xa955('0x35')][_0xa955('0x39')]));_0x2b67db[_0xa955('0x38')]=_0x2b67db[_0xa955('0x38')]['length']?_0x2b67db[_0xa955('0x38')]:_0x25ac00[_0xa955('0x34')];_0x2b67db[_0xa955('0x22')]=qs[_0xa955('0x22')](_0x3e35f2['query'][_0xa955('0x22')]);_0x2b67db[_0xa955('0x20')]=qs[_0xa955('0x20')](_0x3e35f2[_0xa955('0x35')]['offset']);_0x2b67db[_0xa955('0x3c')]=qs[_0xa955('0x3d')](_0x3e35f2[_0xa955('0x35')]['sort']);_0x2b67db['where']=qs[_0xa955('0x37')](_[_0xa955('0x79')](_0x3e35f2[_0xa955('0x35')],_0x25ac00[_0xa955('0x37')]));_0x2b67db=_[_0xa955('0x49')]({},_0x2b67db,_0x3e35f2[_0xa955('0x41')]);return _0x594ae4[_0xa955('0x4e')+_[_0xa955('0x7a')](_0x3e35f2[_0xa955('0x35')][_0xa955('0x73')][_0xa955('0x76')]())+_0xa955('0x7b')](_0x2b67db);})[_0xa955('0x29')](respondWithResult(_0x1eb0a2,null))[_0xa955('0x45')](handleError(_0x1eb0a2,null));};exports[_0xa955('0x7c')]=function(_0x343cc3,_0x5e0b53,_0x53b103){return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x343cc3[_0xa955('0x47')]['id']}})[_0xa955('0x29')](function(_0x35990d){if(_0x35990d){if(!_0x343cc3[_0xa955('0x4c')][_0xa955('0x73')]||!utils[_0xa955('0x72')](_0x343cc3['body']['channel'])){throw new db[(_0xa955('0x59'))][(_0xa955('0x74'))]('Unknown\x20channel');}return _0x35990d[_0xa955('0x7d')+_['capitalize'](_0x343cc3['body']['channel'][_0xa955('0x76')]())+_0xa955('0x7b')](_0x343cc3[_0xa955('0x4c')][_0xa955('0x7e')]);}return null;})[_0xa955('0x29')](handleEntityNotFound(_0x5e0b53,null))[_0xa955('0x29')](respondWithStatusCode(_0x5e0b53,null))[_0xa955('0x45')](handleError(_0x5e0b53,null));};exports['removeQueues']=function(_0x2b5914,_0x57b571,_0x5d3f3d){return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x2b5914[_0xa955('0x47')]['id']}})['then'](function(_0x106208){if(_0x106208){if(!_0x2b5914[_0xa955('0x35')]['channel']||!utils[_0xa955('0x72')](_0x2b5914[_0xa955('0x35')][_0xa955('0x73')])){throw new db[(_0xa955('0x59'))]['ValidationError'](_0xa955('0x75'));}return _0x106208['remove'+_[_0xa955('0x7a')](_0x2b5914[_0xa955('0x35')][_0xa955('0x73')][_0xa955('0x76')]())+_0xa955('0x7b')](_0x2b5914['query'][_0xa955('0x7e')]);}return null;})[_0xa955('0x29')](handleEntityNotFound(_0x57b571,null))[_0xa955('0x29')](respondWithStatusCode(_0x57b571,null))[_0xa955('0x45')](handleError(_0x57b571,null));};exports['addAgents']=function(_0x431dde,_0x42daa6){var _0x4a758b=_[_0xa955('0x7f')](_0x431dde[_0xa955('0x4c')]['ids'])?_0x431dde[_0xa955('0x4c')][_0xa955('0x7e')]:[_0x431dde[_0xa955('0x4c')][_0xa955('0x7e')]];var _0x448f06=_0x431dde['params']['id'];return db[_0xa955('0x30')][_0xa955('0x4a')]({'where':{'id':_0x448f06}})[_0xa955('0x29')](handleEntityNotFound(_0x42daa6,null))[_0xa955('0x29')](function(_0x1accf0){if(_0x1accf0){var _0x4e662c=[_0xa955('0x80'),_0xa955('0x81'),_0xa955('0x82'),_0xa955('0x83'),_0xa955('0x84'),_0xa955('0x85'),_0xa955('0x86')];return db['sequelize']['transaction'](function(_0x54cfd2){var _0x1dc453=_[_0xa955('0x2f')](_0x4e662c,function(_0x372ff1){var _0x51257d={'attributes':['id',_0xa955('0x2c')]};if(_0x372ff1===_0xa955('0x80')){_0x51257d[_0xa955('0x87')]={'attributes':[_0xa955('0x88')]};}return _0x1accf0[_0xa955('0x4e')+_0x372ff1+_0xa955('0x7b')](_0x51257d)[_0xa955('0x29')](function(_0x4a4fde){var _0x307973=_['map'](_0x4a4fde,function(_0xbdc661){var _0x9e4113=_[_0xa955('0x2f')](_0x4a758b,function(_0x4b1702){var _0x878fe7={'where':{'UserId':_0x4b1702,[_0x372ff1+_0xa955('0x89')]:_0xbdc661['id']},'transaction':_0x54cfd2};if(_0x372ff1===_0xa955('0x80')){_0x878fe7['defaults']={'penalty':_0xbdc661[_0xa955('0x8a')][_0xa955('0x88')]};}return db['User'+_0x372ff1+_0xa955('0x77')][_0xa955('0x8b')](_0x878fe7)[_0xa955('0x29')](function(){socket['emit']('user'+_0x372ff1+_0xa955('0x8c'),{'UserId':_0x4b1702,[_0x372ff1+_0xa955('0x89')]:_0xbdc661['id']});if(_0x372ff1!==_0xa955('0x80')){return;}return db[_0xa955('0x8d')][_0xa955('0x8e')]({'where':{'id':_0x4a758b,'online':0x1},'attributes':['id',_0xa955('0x2c'),_0xa955('0x8f'),'voicePause',_0xa955('0x90')],'raw':!![]})[_0xa955('0x29')](function(_0x5d8453){var _0x3027bf=_['map'](_0x5d8453,function(_0x49cb79){return db[_0xa955('0x91')][_0xa955('0x92')]({'membername':_0x49cb79['name'],'UserId':_0x49cb79['id'],'queue_name':_0xbdc661[_0xa955('0x2c')],'VoiceQueueId':_0xbdc661['id'],'interface':_['isNil'](_0x49cb79[_0xa955('0x90')])?util[_0xa955('0x93')](_0xa955('0x94'),_0x49cb79[_0xa955('0x2c')]):_0x49cb79[_0xa955('0x90')],'paused':_0x49cb79[_0xa955('0x95')]||![],'penalty':_0xbdc661[_0xa955('0x8a')][_0xa955('0x88')]},{'transaction':_0x54cfd2});});return Promise[_0xa955('0x96')](_0x3027bf);});});});return Promise[_0xa955('0x96')](_0x9e4113);});return Promise[_0xa955('0x96')](_0x307973);})['then'](function(){return db[_0xa955('0x6d')][_0xa955('0x71')]({'where':{'teamId':_0x448f06}})['then'](function(_0x3c04bf){if(_0x3c04bf){var _0x12eb57=_[_0xa955('0x2f')](_0x4a758b,function(_0x18112f){db[_0xa955('0x97')][_0xa955('0x92')]({'UserId':_0x18112f,'VoicePrefixId':_0x3c04bf[_0xa955('0x6e')]});});return Promise[_0xa955('0x96')](_0x12eb57);}});});});return Promise[_0xa955('0x96')](_0x1dc453)['then'](function(){return _0x1accf0[_0xa955('0x98')](_0x4a758b,{'transaction':_0x54cfd2})[_0xa955('0x99')](function(_0x4a9ad2){return _0x4a9ad2;});});});}})[_0xa955('0x29')](respondWithResult(_0x42daa6,null))['catch'](handleError(_0x42daa6,null));};exports['removeAgents']=function(_0x213d02,_0x5862bf){var _0x31cb8a=_['isArray'](_0x213d02[_0xa955('0x35')][_0xa955('0x7e')])?_0x213d02[_0xa955('0x35')][_0xa955('0x7e')]:[_0x213d02[_0xa955('0x35')][_0xa955('0x7e')]];var _0x1d8438=_0x213d02[_0xa955('0x47')]['id'];return db[_0xa955('0x30')][_0xa955('0x4a')]({'where':{'id':_0x1d8438}})[_0xa955('0x29')](handleEntityNotFound(_0x5862bf,null))['then'](function(_0x4571cd){if(_0x4571cd){var _0x46b94c=[_0xa955('0x80'),'Chat','Mail',_0xa955('0x83'),_0xa955('0x84'),_0xa955('0x85'),_0xa955('0x86')];return db[_0xa955('0x56')][_0xa955('0x57')](function(_0x4d1864){var _0x1e5fb3=_[_0xa955('0x2f')](_0x46b94c,function(_0x2bdf83){var _0x3207a8={'attributes':['id',_0xa955('0x2c')]};return _0x4571cd['get'+_0x2bdf83+'Queues'](_0x3207a8)[_0xa955('0x29')](function(_0x2efc1f){var _0x1aadbd=_['map'](_0x2efc1f,function(_0x18ff61){return _0x18ff61[_0xa955('0x9a')](_0x31cb8a,{'transaction':_0x4d1864})[_0xa955('0x29')](function(){var _0x12e51f=_[_0xa955('0x2f')](_0x31cb8a,function(_0x15a77e){socket[_0xa955('0x9b')](_0xa955('0x4d')+_0x2bdf83+_0xa955('0x9c'),{'UserId':Number(_0x15a77e),[_0x2bdf83+_0xa955('0x89')]:_0x18ff61['id']});if(_0x2bdf83!==_0xa955('0x80')){return;}return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x18ff61['id'],'UserId':_0x15a77e},'transaction':_0x4d1864});});return Promise[_0xa955('0x96')](_0x12e51f);});});return Promise[_0xa955('0x96')](_0x1aadbd);});});return Promise['all'](_0x1e5fb3)['then'](function(){return _0x4571cd[_0xa955('0x9a')](_0x31cb8a,{'transaction':_0x4d1864});})[_0xa955('0x29')](function(){return db[_0xa955('0x6d')][_0xa955('0x71')]({'where':{'teamId':_0x1d8438}})['then'](function(_0x57c508){if(_0x57c508){var _0x2341b5=_['map'](_0x31cb8a,function(_0x270c61){db[_0xa955('0x97')][_0xa955('0x55')]({'where':{'UserId':_0x270c61,'VoicePrefixId':_0x57c508[_0xa955('0x6e')]}});});return Promise[_0xa955('0x96')](_0x2341b5);}});});});}})[_0xa955('0x29')](respondWithStatusCode(_0x5862bf,null))[_0xa955('0x45')](handleError(_0x5862bf,null));};exports[_0xa955('0x9d')]=function(_0x954872,_0xfb25f8,_0xd6f1be){var _0x222427={};var _0x5d4d7a={};var _0x8e1f23;var _0x1d14ca;return db[_0xa955('0x30')][_0xa955('0x71')]({'where':{'id':_0x954872[_0xa955('0x47')]['id']}})[_0xa955('0x29')](handleEntityNotFound(_0xfb25f8,null))[_0xa955('0x29')](function(_0x101f56){if(_0x101f56){_0x8e1f23=_0x101f56;_0x5d4d7a['model']=_['keys'](db[_0xa955('0x8d')]['rawAttributes']);_0x5d4d7a[_0xa955('0x35')]=_[_0xa955('0x36')](_0x954872[_0xa955('0x35')]);_0x5d4d7a[_0xa955('0x37')]=_[_0xa955('0x48')](_0x5d4d7a[_0xa955('0x34')],_0x5d4d7a[_0xa955('0x35')]);_0x222427[_0xa955('0x38')]=_[_0xa955('0x48')](_0x5d4d7a[_0xa955('0x34')],qs[_0xa955('0x39')](_0x954872[_0xa955('0x35')][_0xa955('0x39')]));_0x222427['attributes']=_0x222427['attributes'][_0xa955('0x3a')]?_0x222427[_0xa955('0x38')]:_0x5d4d7a[_0xa955('0x34')];_0x222427['order']=qs['sort'](_0x954872[_0xa955('0x35')][_0xa955('0x3d')]);_0x222427['where']=qs[_0xa955('0x37')](_[_0xa955('0x79')](_0x954872['query'],_0x5d4d7a['filters']));if(_0x954872[_0xa955('0x35')][_0xa955('0x3f')]){_0x222427[_0xa955('0x3e')]=_[_0xa955('0x49')](_0x222427[_0xa955('0x3e')],{'$or':_[_0xa955('0x2f')](_0x222427[_0xa955('0x38')],function(_0x1c990d){var _0x1e3c4f={};_0x1e3c4f[_0x1c990d]={'$like':'%'+_0x954872['query']['filter']+'%'};return _0x1e3c4f;})});}_0x222427=_['merge']({},_0x222427,_0x954872[_0xa955('0x41')]);return _0x8e1f23[_0xa955('0x9d')](_0x222427);}})[_0xa955('0x29')](function(_0x570ebc){if(_0x570ebc){_0x1d14ca=_0x570ebc['length'];if(!_0x954872['query']['hasOwnProperty']('nolimit')){_0x222427[_0xa955('0x22')]=qs[_0xa955('0x22')](_0x954872[_0xa955('0x35')][_0xa955('0x22')]);_0x222427[_0xa955('0x20')]=qs[_0xa955('0x20')](_0x954872[_0xa955('0x35')][_0xa955('0x20')]);}return _0x8e1f23['getAgents'](_0x222427);}})[_0xa955('0x29')](function(_0x38259e){if(_0x38259e){return _0x38259e?{'count':_0x1d14ca,'rows':_0x38259e}:null;}})['then'](respondWithResult(_0xfb25f8,null))[_0xa955('0x45')](handleError(_0xfb25f8,null));};
\ No newline at end of file
+var _0x5f15=['count','offset','set','apply','reject','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','params','includeAll','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','sendStatus','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','Queue','Queues','addQueues','isValidChannel','add','removeQueues','remove','ids','addAgents','Voice','Mail','Fax','Openchannel','QueueId','TeamVoiceQueue','penalty','findOrCreate','emit','Queue:save','voicePause','interface','upsert','isNil','SIP/%s','all','VoicePrefixId','spread','removeAgents','Chat','Sms','Whatsapp','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','undefined','limit'];(function(_0x2998ec,_0x10f5cd){var _0x287909=function(_0x15d2ff){while(--_0x15d2ff){_0x2998ec['push'](_0x2998ec['shift']());}};_0x287909(++_0x10f5cd);}(_0x5f15,0x111));var _0x55f1=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5f15[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x55f1('0x0'));var rimraf=require(_0x55f1('0x1'));var zipdir=require(_0x55f1('0x2'));var jsonpatch=require(_0x55f1('0x3'));var rp=require(_0x55f1('0x4'));var moment=require(_0x55f1('0x5'));var BPromise=require(_0x55f1('0x6'));var Mustache=require(_0x55f1('0x7'));var util=require(_0x55f1('0x8'));var path=require('path');var sox=require(_0x55f1('0x9'));var csv=require(_0x55f1('0xa'));var ejs=require(_0x55f1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55f1('0xc'));var squel=require('squel');var crypto=require(_0x55f1('0xd'));var jsforce=require(_0x55f1('0xe'));var deskjs=require(_0x55f1('0xf'));var toCsv=require(_0x55f1('0xa'));var querystring=require(_0x55f1('0x10'));var Papa=require(_0x55f1('0x11'));var Redis=require(_0x55f1('0x12'));var authService=require(_0x55f1('0x13'));var qs=require(_0x55f1('0x14'));var as=require(_0x55f1('0x15'));var hardwareService=require(_0x55f1('0x16'));var logger=require(_0x55f1('0x17'))(_0x55f1('0x18'));var utils=require(_0x55f1('0x19'));var config=require(_0x55f1('0x1a'));var licenseUtil=require(_0x55f1('0x1b'));var db=require(_0x55f1('0x1c'))['db'];config[_0x55f1('0x1d')]=_['defaults'](config[_0x55f1('0x1d')],{'host':_0x55f1('0x1e'),'port':0x18eb});var socket=require(_0x55f1('0x1f'))(new Redis(config[_0x55f1('0x1d')]));require('./team.socket')[_0x55f1('0x20')](socket);function respondWithStatusCode(_0x49b7c1,_0xbdd80b){_0xbdd80b=_0xbdd80b||0xcc;return function(_0x36fda4){if(_0x36fda4){return _0x49b7c1['sendStatus'](_0xbdd80b);}return _0x49b7c1[_0x55f1('0x21')](_0xbdd80b)[_0x55f1('0x22')]();};}function respondWithResult(_0x2c5a4e,_0x1035e2){_0x1035e2=_0x1035e2||0xc8;return function(_0x23ab8f){if(_0x23ab8f){return _0x2c5a4e[_0x55f1('0x21')](_0x1035e2)['json'](_0x23ab8f);}};}function respondWithFilteredResult(_0xd717f7,_0x25f7a6){return function(_0x14cb0e){if(_0x14cb0e){var _0x1e6f76=typeof _0x25f7a6['offset']===_0x55f1('0x23')&&typeof _0x25f7a6[_0x55f1('0x24')]===_0x55f1('0x23');var _0x697a00=_0x14cb0e[_0x55f1('0x25')];var _0x1c7bd8=_0x1e6f76?0x0:_0x25f7a6[_0x55f1('0x26')];var _0x25b1b3=_0x1e6f76?_0x14cb0e[_0x55f1('0x25')]:_0x25f7a6[_0x55f1('0x26')]+_0x25f7a6[_0x55f1('0x24')];var _0x477bbe;if(_0x25b1b3>=_0x697a00){_0x25b1b3=_0x697a00;_0x477bbe=0xc8;}else{_0x477bbe=0xce;}_0xd717f7[_0x55f1('0x21')](_0x477bbe);return _0xd717f7[_0x55f1('0x27')]('Content-Range',_0x1c7bd8+'-'+_0x25b1b3+'/'+_0x697a00)['json'](_0x14cb0e);}return null;};}function patchUpdates(_0xf2e7a){return function(_0x305920){try{jsonpatch[_0x55f1('0x28')](_0x305920,_0xf2e7a,!![]);}catch(_0x2c3ddc){return BPromise[_0x55f1('0x29')](_0x2c3ddc);}return _0x305920['save']();};}function saveUpdates(_0x2b7f9c,_0x8fde55){return function(_0x5a139a){if(_0x5a139a){return _0x5a139a[_0x55f1('0x2a')](_0x2b7f9c)[_0x55f1('0x2b')](function(_0x27ac70){return _0x27ac70;});}return null;};}function handleEntityNotFound(_0x292e90,_0x64404d){return function(_0x4a991e){if(!_0x4a991e){_0x292e90['sendStatus'](0x194);}return _0x4a991e;};}function handleError(_0x2abd69,_0xa7f72e){_0xa7f72e=_0xa7f72e||0x1f4;return function(_0x56fee5){logger[_0x55f1('0x2c')](_0x56fee5[_0x55f1('0x2d')]);if(_0x56fee5['name']){delete _0x56fee5[_0x55f1('0x2e')];}_0x2abd69[_0x55f1('0x21')](_0xa7f72e)[_0x55f1('0x2f')](_0x56fee5);};}exports[_0x55f1('0x30')]=function(_0x5c3fb7,_0x4a3251){var _0x384969={},_0x2169f3={},_0x4a0c19={'count':0x0,'rows':[]};var _0x1961d0=_[_0x55f1('0x31')](db[_0x55f1('0x32')][_0x55f1('0x33')],function(_0x28ecb0){return{'name':_0x28ecb0[_0x55f1('0x34')],'type':_0x28ecb0['type'][_0x55f1('0x35')]};});_0x2169f3['model']=_[_0x55f1('0x31')](_0x1961d0,'name');_0x2169f3[_0x55f1('0x36')]=_[_0x55f1('0x37')](_0x5c3fb7['query']);_0x2169f3[_0x55f1('0x38')]=_[_0x55f1('0x39')](_0x2169f3[_0x55f1('0x3a')],_0x2169f3['query']);_0x384969[_0x55f1('0x3b')]=_[_0x55f1('0x39')](_0x2169f3[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x5c3fb7['query'][_0x55f1('0x3c')]));_0x384969[_0x55f1('0x3b')]=_0x384969[_0x55f1('0x3b')][_0x55f1('0x3d')]?_0x384969[_0x55f1('0x3b')]:_0x2169f3[_0x55f1('0x3a')];if(!_0x5c3fb7[_0x55f1('0x36')]['hasOwnProperty'](_0x55f1('0x3e'))){_0x384969[_0x55f1('0x24')]=qs['limit'](_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x24')]);_0x384969['offset']=qs[_0x55f1('0x26')](_0x5c3fb7[_0x55f1('0x36')]['offset']);}_0x384969[_0x55f1('0x3f')]=qs['sort'](_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x40')]);_0x384969[_0x55f1('0x41')]=qs['filters'](_[_0x55f1('0x42')](_0x5c3fb7['query'],_0x2169f3[_0x55f1('0x38')]),_0x1961d0);if(_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x43')]){_0x384969[_0x55f1('0x41')]=_['merge'](_0x384969[_0x55f1('0x41')],{'$or':_['map'](_0x1961d0,function(_0x4e1f60){if(_0x4e1f60['type']!=='VIRTUAL'){var _0xc3a43b={};_0xc3a43b[_0x4e1f60['name']]={'$like':'%'+_0x5c3fb7[_0x55f1('0x36')][_0x55f1('0x43')]+'%'};return _0xc3a43b;}})});}_0x384969=_[_0x55f1('0x44')]({},_0x384969,_0x5c3fb7[_0x55f1('0x45')]);var _0x559e63={'where':_0x384969[_0x55f1('0x41')]};return db[_0x55f1('0x32')]['count'](_0x559e63)[_0x55f1('0x2b')](function(_0x588dfc){_0x4a0c19[_0x55f1('0x25')]=_0x588dfc;if(_0x5c3fb7[_0x55f1('0x36')]['includeAll']){_0x384969['include']=[{'all':!![]}];}return db['Team'][_0x55f1('0x46')](_0x384969);})[_0x55f1('0x2b')](function(_0x81c52d){_0x4a0c19[_0x55f1('0x47')]=_0x81c52d;return _0x4a0c19;})['then'](respondWithFilteredResult(_0x4a3251,_0x384969))['catch'](handleError(_0x4a3251,null));};exports['show']=function(_0x52a6e0,_0x3c1463){var _0xb46442={'raw':![],'where':{'id':_0x52a6e0[_0x55f1('0x48')]['id']}},_0x542f88={};_0x542f88['model']=_[_0x55f1('0x37')](db['Team'][_0x55f1('0x33')]);_0x542f88['query']=_[_0x55f1('0x37')](_0x52a6e0[_0x55f1('0x36')]);_0x542f88[_0x55f1('0x38')]=_[_0x55f1('0x39')](_0x542f88[_0x55f1('0x3a')],_0x542f88['query']);_0xb46442[_0x55f1('0x3b')]=_[_0x55f1('0x39')](_0x542f88[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x52a6e0[_0x55f1('0x36')][_0x55f1('0x3c')]));_0xb46442[_0x55f1('0x3b')]=_0xb46442[_0x55f1('0x3b')][_0x55f1('0x3d')]?_0xb46442[_0x55f1('0x3b')]:_0x542f88[_0x55f1('0x3a')];if(_0x52a6e0['query'][_0x55f1('0x49')]){_0xb46442[_0x55f1('0x4a')]=[{'all':!![]}];}_0xb46442=_[_0x55f1('0x44')]({},_0xb46442,_0x52a6e0['options']);return db['Team'][_0x55f1('0x4b')](_0xb46442)[_0x55f1('0x2b')](handleEntityNotFound(_0x3c1463,null))[_0x55f1('0x2b')](respondWithResult(_0x3c1463,null))[_0x55f1('0x4c')](handleError(_0x3c1463,null));};exports[_0x55f1('0x4d')]=function(_0x45e220,_0x45f3fb){return db['Team'][_0x55f1('0x4d')](_0x45e220[_0x55f1('0x4e')],{})[_0x55f1('0x2b')](function(_0x4042a8){var _0xee0125=_0x45e220[_0x55f1('0x4f')][_0x55f1('0x50')]({'plain':!![]});if(!_0xee0125)throw new Error(_0x55f1('0x51'));if(_0xee0125[_0x55f1('0x52')]===_0x55f1('0x4f')){var _0x568c68=_0x4042a8[_0x55f1('0x50')]({'plain':!![]});var _0x15f354=_0x55f1('0x53');return db['UserProfileSection'][_0x55f1('0x4b')]({'where':{'name':_0x15f354,'userProfileId':_0xee0125[_0x55f1('0x54')]},'raw':!![]})[_0x55f1('0x2b')](function(_0x5df3a9){if(_0x5df3a9&&_0x5df3a9[_0x55f1('0x55')]===0x0){return db[_0x55f1('0x56')][_0x55f1('0x4d')]({'name':_0x568c68[_0x55f1('0x2e')],'resourceId':_0x568c68['id'],'type':_0x5df3a9[_0x55f1('0x2e')],'sectionId':_0x5df3a9['id']},{})[_0x55f1('0x2b')](function(){return _0x4042a8;});}else{return _0x4042a8;}})[_0x55f1('0x4c')](function(_0x43fc92){logger['error'](_0x55f1('0x57'),_0x43fc92);throw _0x43fc92;});}return _0x4042a8;})[_0x55f1('0x2b')](respondWithResult(_0x45f3fb,0xc9))[_0x55f1('0x4c')](handleError(_0x45f3fb,null));};exports[_0x55f1('0x2a')]=function(_0x2712a4,_0x133978){if(_0x2712a4['body']['id']){delete _0x2712a4[_0x55f1('0x4e')]['id'];}return db['Team']['find']({'where':{'id':_0x2712a4[_0x55f1('0x48')]['id']}})[_0x55f1('0x2b')](handleEntityNotFound(_0x133978,null))[_0x55f1('0x2b')](saveUpdates(_0x2712a4[_0x55f1('0x4e')],null))['then'](respondWithResult(_0x133978,null))[_0x55f1('0x4c')](handleError(_0x133978,null));};exports[_0x55f1('0x58')]=function(_0xc493e7,_0xcd00a1){var _0x12920d=_0xc493e7[_0x55f1('0x48')]['id'];var _0x551092=[];return db[_0x55f1('0x59')][_0x55f1('0x5a')](function(_0x55c813){var _0x311714='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x311714,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813})[_0x55f1('0x2b')](function(_0xe4e2f4){_0x551092=_[_0x55f1('0x31')](_0xe4e2f4,function(_0x232324){return Number(_0x232324[_0x55f1('0x5e')]);});})['then'](function(){var _0x4230a5='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x4230a5,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})['then'](function(_0x2f410e){var _0x114e4c=_[_0x55f1('0x31')](_0x2f410e,function(_0xc3ccc){return Number(_0xc3ccc['VoiceQueueId']);});return db[_0x55f1('0x5f')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'VoiceQueueId':{'$in':_0x114e4c}},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){var _0x5a34b0=_0x55f1('0x60')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x5a34b0,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x4c1848){var _0x2a12fe=_['map'](_0x4c1848,function(_0x334ac9){return Number(_0x334ac9[_0x55f1('0x61')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x551092},'MailQueueId':{'$in':_0x2a12fe}},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){var _0x3d28c9=_0x55f1('0x62')+_0x12920d;return db['sequelize'][_0x55f1('0x36')](_0x3d28c9,{'type':db['Sequelize'][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})['then'](function(_0xae4748){var _0x1ad6c8=_[_0x55f1('0x31')](_0xae4748,function(_0xc009c8){return Number(_0xc009c8[_0x55f1('0x63')]);});return db[_0x55f1('0x64')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'SmsQueueId':{'$in':_0x1ad6c8}},'transaction':_0x55c813});})['then'](function(){var _0x16ae9c=_0x55f1('0x65')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x16ae9c,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')]['SELECT'],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x43f6f3){var _0x213be3=_['map'](_0x43f6f3,function(_0x14842a){return Number(_0x14842a[_0x55f1('0x66')]);});return db[_0x55f1('0x67')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'ChatQueueId':{'$in':_0x213be3}},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){var _0x1dba56=_0x55f1('0x68')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x1dba56,{'type':db[_0x55f1('0x5b')][_0x55f1('0x5c')][_0x55f1('0x5d')],'raw':!![],'transaction':_0x55c813});})['then'](function(_0x407a57){var _0x4281a9=_[_0x55f1('0x31')](_0x407a57,function(_0x1c783f){return Number(_0x1c783f[_0x55f1('0x69')]);});return db['UserFaxQueue']['destroy']({'where':{'UserId':{'$in':_0x551092},'FaxQueueId':{'$in':_0x4281a9}},'transaction':_0x55c813});})['then'](function(){var _0x1ae3d9=_0x55f1('0x6a')+_0x12920d;return db[_0x55f1('0x59')][_0x55f1('0x36')](_0x1ae3d9,{'type':db['Sequelize'][_0x55f1('0x5c')]['SELECT'],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x1fd157){var _0x480672=_[_0x55f1('0x31')](_0x1fd157,function(_0x38e88b){return Number(_0x38e88b[_0x55f1('0x6b')]);});return db[_0x55f1('0x6c')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'OpenchannelQueueId':{'$in':_0x480672}},'transaction':_0x55c813});})['then'](function(){var _0x1ac623=_0x55f1('0x6d')+_0x12920d;return db['sequelize'][_0x55f1('0x36')](_0x1ac623,{'type':db[_0x55f1('0x5b')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x55c813});})[_0x55f1('0x2b')](function(_0x610b2f){var _0x279511=_[_0x55f1('0x31')](_0x610b2f,function(_0x152738){return Number(_0x152738[_0x55f1('0x6e')]);});return db[_0x55f1('0x6f')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'WhatsappQueueId':{'$in':_0x279511}},'transaction':_0x55c813});})['then'](function(){return db[_0x55f1('0x70')][_0x55f1('0x4b')]({'where':{'TeamId':_0x12920d}});})[_0x55f1('0x2b')](function(_0x37feb5){if(_0x37feb5===null){return;}return db[_0x55f1('0x71')][_0x55f1('0x58')]({'where':{'UserId':{'$in':_0x551092},'VoicePrefixId':_0x37feb5['VoicePrefixId']},'transaction':_0x55c813});})[_0x55f1('0x2b')](function(){return db['Team']['destroy']({'where':{'id':_0x12920d},'cascade':!![],'transaction':_0x55c813});})['then'](function(_0x4927ff){if(_0x4927ff===0x0){_0xcd00a1[_0x55f1('0x72')](0x194);}else{return db[_0x55f1('0x56')][_0x55f1('0x58')]({'where':{'type':_0x55f1('0x53'),'resourceId':_0x12920d},'cascade':!![],'transaction':_0x55c813})[_0x55f1('0x2b')](function(){_0xcd00a1['status'](0xcc)[_0x55f1('0x22')]();});}})[_0x55f1('0x4c')](function(_0x2ca755){_0xcd00a1[_0x55f1('0x21')](0x1f4)['send'](_0x2ca755);});});};exports[_0x55f1('0x73')]=function(_0x459a57,_0x3cf32a,_0x34462f){return db[_0x55f1('0x32')][_0x55f1('0x74')]({'where':{'id':_0x459a57[_0x55f1('0x48')]['id']}})['then'](handleEntityNotFound(_0x3cf32a,null))[_0x55f1('0x2b')](function(_0x1dcba){if(!_0x459a57[_0x55f1('0x36')][_0x55f1('0x75')]||!utils['isValidChannel'](_0x459a57[_0x55f1('0x36')]['channel'])){throw new db['Sequelize'][(_0x55f1('0x76'))](_0x55f1('0x77'));}var _0x29e64={};var _0x2ddef6={};_0x2ddef6[_0x55f1('0x3a')]=_['keys'](db[_[_0x55f1('0x78')](_0x459a57[_0x55f1('0x36')][_0x55f1('0x75')]['toLowerCase']())+_0x55f1('0x79')]['rawAttributes']);_0x2ddef6['query']=_[_0x55f1('0x37')](_0x459a57[_0x55f1('0x36')]);_0x2ddef6['filters']=_['intersection'](_0x2ddef6[_0x55f1('0x3a')],_0x2ddef6[_0x55f1('0x36')]);_0x29e64['attributes']=_['intersection'](_0x2ddef6[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x459a57['query'][_0x55f1('0x3c')]));_0x29e64[_0x55f1('0x3b')]=_0x29e64['attributes'][_0x55f1('0x3d')]?_0x29e64[_0x55f1('0x3b')]:_0x2ddef6[_0x55f1('0x3a')];_0x29e64[_0x55f1('0x24')]=qs[_0x55f1('0x24')](_0x459a57[_0x55f1('0x36')][_0x55f1('0x24')]);_0x29e64[_0x55f1('0x26')]=qs['offset'](_0x459a57[_0x55f1('0x36')][_0x55f1('0x26')]);_0x29e64[_0x55f1('0x3f')]=qs[_0x55f1('0x40')](_0x459a57['query']['sort']);_0x29e64[_0x55f1('0x41')]=qs[_0x55f1('0x38')](_['pick'](_0x459a57['query'],_0x2ddef6[_0x55f1('0x38')]));_0x29e64=_[_0x55f1('0x44')]({},_0x29e64,_0x459a57[_0x55f1('0x45')]);return _0x1dcba[_0x55f1('0x50')+_[_0x55f1('0x78')](_0x459a57[_0x55f1('0x36')]['channel']['toLowerCase']())+_0x55f1('0x7a')](_0x29e64);})[_0x55f1('0x2b')](respondWithResult(_0x3cf32a,null))[_0x55f1('0x4c')](handleError(_0x3cf32a,null));};exports[_0x55f1('0x7b')]=function(_0x31c8bb,_0x22cbd8,_0x209bc1){return db['Team'][_0x55f1('0x74')]({'where':{'id':_0x31c8bb[_0x55f1('0x48')]['id']}})['then'](function(_0x5a7a13){if(_0x5a7a13){if(!_0x31c8bb[_0x55f1('0x4e')]['channel']||!utils[_0x55f1('0x7c')](_0x31c8bb['body']['channel'])){throw new db[(_0x55f1('0x5b'))]['ValidationError'](_0x55f1('0x77'));}return _0x5a7a13[_0x55f1('0x7d')+_['capitalize'](_0x31c8bb['body'][_0x55f1('0x75')]['toLowerCase']())+_0x55f1('0x7a')](_0x31c8bb['body']['ids']);}return null;})[_0x55f1('0x2b')](handleEntityNotFound(_0x22cbd8,null))[_0x55f1('0x2b')](respondWithStatusCode(_0x22cbd8,null))[_0x55f1('0x4c')](handleError(_0x22cbd8,null));};exports[_0x55f1('0x7e')]=function(_0x1cea06,_0x4dbe63,_0x9a56e4){return db[_0x55f1('0x32')][_0x55f1('0x74')]({'where':{'id':_0x1cea06[_0x55f1('0x48')]['id']}})[_0x55f1('0x2b')](function(_0x3858e7){if(_0x3858e7){if(!_0x1cea06[_0x55f1('0x36')][_0x55f1('0x75')]||!utils['isValidChannel'](_0x1cea06[_0x55f1('0x36')][_0x55f1('0x75')])){throw new db[(_0x55f1('0x5b'))][(_0x55f1('0x76'))]('Unknown\x20channel');}return _0x3858e7[_0x55f1('0x7f')+_['capitalize'](_0x1cea06[_0x55f1('0x36')][_0x55f1('0x75')]['toLowerCase']())+'Queues'](_0x1cea06[_0x55f1('0x36')][_0x55f1('0x80')]);}return null;})[_0x55f1('0x2b')](handleEntityNotFound(_0x4dbe63,null))[_0x55f1('0x2b')](respondWithStatusCode(_0x4dbe63,null))[_0x55f1('0x4c')](handleError(_0x4dbe63,null));};exports[_0x55f1('0x81')]=function(_0xf946b9,_0x4f913e){var _0x4199b7=_['isArray'](_0xf946b9[_0x55f1('0x4e')][_0x55f1('0x80')])?_0xf946b9[_0x55f1('0x4e')][_0x55f1('0x80')]:[_0xf946b9[_0x55f1('0x4e')][_0x55f1('0x80')]];var _0x862368=_0xf946b9['params']['id'];return db[_0x55f1('0x32')][_0x55f1('0x4b')]({'where':{'id':_0x862368}})[_0x55f1('0x2b')](handleEntityNotFound(_0x4f913e,null))[_0x55f1('0x2b')](function(_0x154827){if(_0x154827){var _0x12d738=[_0x55f1('0x82'),'Chat',_0x55f1('0x83'),'Sms',_0x55f1('0x84'),_0x55f1('0x85'),'Whatsapp'];return db[_0x55f1('0x59')][_0x55f1('0x5a')](function(_0x4fc718){var _0x300d43=_[_0x55f1('0x31')](_0x12d738,function(_0x39abe0){var _0x5e8a39={'attributes':['id',_0x55f1('0x2e')]};if(_0x39abe0===_0x55f1('0x82')){_0x5e8a39['through']={'attributes':['penalty']};}return _0x154827[_0x55f1('0x50')+_0x39abe0+_0x55f1('0x7a')](_0x5e8a39)[_0x55f1('0x2b')](function(_0x98930e){var _0x47dfb0=_[_0x55f1('0x31')](_0x98930e,function(_0x10744f){var _0x47bebe=_[_0x55f1('0x31')](_0x4199b7,function(_0xeaae56){var _0x16b0c5={'where':{'UserId':_0xeaae56,[_0x39abe0+_0x55f1('0x86')]:_0x10744f['id']},'transaction':_0x4fc718};if(_0x39abe0===_0x55f1('0x82')){_0x16b0c5['defaults']={'penalty':_0x10744f[_0x55f1('0x87')][_0x55f1('0x88')]};}return db['User'+_0x39abe0+'Queue'][_0x55f1('0x89')](_0x16b0c5)[_0x55f1('0x2b')](function(){socket[_0x55f1('0x8a')](_0x55f1('0x4f')+_0x39abe0+_0x55f1('0x8b'),{'UserId':_0xeaae56,[_0x39abe0+_0x55f1('0x86')]:_0x10744f['id']});if(_0x39abe0!==_0x55f1('0x82')){return;}return db['User'][_0x55f1('0x46')]({'where':{'id':_0x4199b7,'online':0x1},'attributes':['id','name','online',_0x55f1('0x8c'),_0x55f1('0x8d')],'raw':!![]})['then'](function(_0x1905ca){var _0x5b56a0=_[_0x55f1('0x31')](_0x1905ca,function(_0x1c504c){return db['UserVoiceQueueRt'][_0x55f1('0x8e')]({'membername':_0x1c504c[_0x55f1('0x2e')],'UserId':_0x1c504c['id'],'queue_name':_0x10744f[_0x55f1('0x2e')],'VoiceQueueId':_0x10744f['id'],'interface':_[_0x55f1('0x8f')](_0x1c504c[_0x55f1('0x8d')])?util['format'](_0x55f1('0x90'),_0x1c504c[_0x55f1('0x2e')]):_0x1c504c['interface'],'paused':_0x1c504c[_0x55f1('0x8c')]||![],'penalty':_0x10744f[_0x55f1('0x87')][_0x55f1('0x88')]},{'transaction':_0x4fc718});});return Promise['all'](_0x5b56a0);});});});return Promise[_0x55f1('0x91')](_0x47bebe);});return Promise['all'](_0x47dfb0);})[_0x55f1('0x2b')](function(){return db[_0x55f1('0x70')][_0x55f1('0x74')]({'where':{'teamId':_0x862368}})['then'](function(_0x145097){if(_0x145097){var _0x7d5c0c=_['map'](_0x4199b7,function(_0xedef6c){db[_0x55f1('0x71')][_0x55f1('0x8e')]({'UserId':_0xedef6c,'VoicePrefixId':_0x145097[_0x55f1('0x92')]});});return Promise[_0x55f1('0x91')](_0x7d5c0c);}});});});return Promise['all'](_0x300d43)[_0x55f1('0x2b')](function(){return _0x154827['addAgents'](_0x4199b7,{'transaction':_0x4fc718})[_0x55f1('0x93')](function(_0x270f71){return _0x270f71;});});});}})[_0x55f1('0x2b')](respondWithResult(_0x4f913e,null))['catch'](handleError(_0x4f913e,null));};exports[_0x55f1('0x94')]=function(_0x4868e6,_0x716b49){var _0x59a5b3=_['isArray'](_0x4868e6[_0x55f1('0x36')][_0x55f1('0x80')])?_0x4868e6['query'][_0x55f1('0x80')]:[_0x4868e6['query'][_0x55f1('0x80')]];var _0x4d54ef=_0x4868e6[_0x55f1('0x48')]['id'];return db[_0x55f1('0x32')][_0x55f1('0x4b')]({'where':{'id':_0x4d54ef}})[_0x55f1('0x2b')](handleEntityNotFound(_0x716b49,null))[_0x55f1('0x2b')](function(_0x284c22){if(_0x284c22){var _0x372403=[_0x55f1('0x82'),_0x55f1('0x95'),_0x55f1('0x83'),_0x55f1('0x96'),_0x55f1('0x84'),_0x55f1('0x85'),_0x55f1('0x97')];return db[_0x55f1('0x59')]['transaction'](function(_0x293339){var _0x2c1a68=_[_0x55f1('0x31')](_0x372403,function(_0x5621d5){var _0x4ee6f7={'attributes':['id',_0x55f1('0x2e')]};return _0x284c22[_0x55f1('0x50')+_0x5621d5+_0x55f1('0x7a')](_0x4ee6f7)[_0x55f1('0x2b')](function(_0x520708){var _0x48c5df=_[_0x55f1('0x31')](_0x520708,function(_0x197c57){return _0x197c57[_0x55f1('0x94')](_0x59a5b3,{'transaction':_0x293339})[_0x55f1('0x2b')](function(){var _0x4b3aef=_[_0x55f1('0x31')](_0x59a5b3,function(_0x4ae1da){socket['emit']('user'+_0x5621d5+_0x55f1('0x98'),{'UserId':Number(_0x4ae1da),[_0x5621d5+_0x55f1('0x86')]:_0x197c57['id']});if(_0x5621d5!==_0x55f1('0x82')){return;}return db[_0x55f1('0x99')][_0x55f1('0x58')]({'where':{'VoiceQueueId':_0x197c57['id'],'UserId':_0x4ae1da},'transaction':_0x293339});});return Promise[_0x55f1('0x91')](_0x4b3aef);});});return Promise['all'](_0x48c5df);});});return Promise['all'](_0x2c1a68)[_0x55f1('0x2b')](function(){return _0x284c22[_0x55f1('0x94')](_0x59a5b3,{'transaction':_0x293339});})['then'](function(){return db[_0x55f1('0x70')][_0x55f1('0x74')]({'where':{'teamId':_0x4d54ef}})[_0x55f1('0x2b')](function(_0x1f4f4e){if(_0x1f4f4e){var _0x5a3db9=_[_0x55f1('0x31')](_0x59a5b3,function(_0x7a29b9){db[_0x55f1('0x71')][_0x55f1('0x58')]({'where':{'UserId':_0x7a29b9,'VoicePrefixId':_0x1f4f4e[_0x55f1('0x92')]}});});return Promise[_0x55f1('0x91')](_0x5a3db9);}});});});}})[_0x55f1('0x2b')](respondWithStatusCode(_0x716b49,null))[_0x55f1('0x4c')](handleError(_0x716b49,null));};exports[_0x55f1('0x9a')]=function(_0x393096,_0x46db33,_0x53188f){var _0x3532d0={};var _0x212d2a={};var _0x530ac1;var _0x152ea8;return db['Team'][_0x55f1('0x74')]({'where':{'id':_0x393096['params']['id']}})['then'](handleEntityNotFound(_0x46db33,null))[_0x55f1('0x2b')](function(_0x2edd12){if(_0x2edd12){_0x530ac1=_0x2edd12;_0x212d2a[_0x55f1('0x3a')]=_[_0x55f1('0x37')](db['User'][_0x55f1('0x33')]);_0x212d2a['query']=_[_0x55f1('0x37')](_0x393096[_0x55f1('0x36')]);_0x212d2a['filters']=_['intersection'](_0x212d2a[_0x55f1('0x3a')],_0x212d2a['query']);_0x3532d0[_0x55f1('0x3b')]=_[_0x55f1('0x39')](_0x212d2a[_0x55f1('0x3a')],qs[_0x55f1('0x3c')](_0x393096[_0x55f1('0x36')][_0x55f1('0x3c')]));_0x3532d0['attributes']=_0x3532d0[_0x55f1('0x3b')][_0x55f1('0x3d')]?_0x3532d0['attributes']:_0x212d2a['model'];_0x3532d0[_0x55f1('0x3f')]=qs[_0x55f1('0x40')](_0x393096[_0x55f1('0x36')]['sort']);_0x3532d0[_0x55f1('0x41')]=qs[_0x55f1('0x38')](_[_0x55f1('0x42')](_0x393096['query'],_0x212d2a['filters']));if(_0x393096[_0x55f1('0x36')][_0x55f1('0x43')]){_0x3532d0[_0x55f1('0x41')]=_[_0x55f1('0x44')](_0x3532d0['where'],{'$or':_['map'](_0x3532d0[_0x55f1('0x3b')],function(_0x156615){var _0x54c4d9={};_0x54c4d9[_0x156615]={'$like':'%'+_0x393096['query']['filter']+'%'};return _0x54c4d9;})});}_0x3532d0=_[_0x55f1('0x44')]({},_0x3532d0,_0x393096[_0x55f1('0x45')]);return _0x530ac1['getAgents'](_0x3532d0);}})['then'](function(_0x1546b0){if(_0x1546b0){_0x152ea8=_0x1546b0[_0x55f1('0x3d')];if(!_0x393096[_0x55f1('0x36')]['hasOwnProperty'](_0x55f1('0x3e'))){_0x3532d0[_0x55f1('0x24')]=qs['limit'](_0x393096[_0x55f1('0x36')][_0x55f1('0x24')]);_0x3532d0['offset']=qs[_0x55f1('0x26')](_0x393096[_0x55f1('0x36')][_0x55f1('0x26')]);}return _0x530ac1[_0x55f1('0x9a')](_0x3532d0);}})['then'](function(_0x47d839){if(_0x47d839){return _0x47d839?{'count':_0x152ea8,'rows':_0x47d839}:null;}})[_0x55f1('0x2b')](respondWithResult(_0x46db33,null))[_0x55f1('0x4c')](handleError(_0x46db33,null));};
\ No newline at end of file
index d860b82..a70e33f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf51a=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','Team','save'];(function(_0x278f93,_0x5d74c6){var _0x47d224=function(_0x3acef8){while(--_0x3acef8){_0x278f93['push'](_0x278f93['shift']());}};_0x47d224(++_0x5d74c6);}(_0xf51a,0x144));var _0xaf51=function(_0x8efc11,_0x596729){_0x8efc11=_0x8efc11-0x0;var _0x28224b=_0xf51a[_0x8efc11];return _0x28224b;};'use strict';var EventEmitter=require(_0xaf51('0x0'));var Team=require(_0xaf51('0x1'))['db'][_0xaf51('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf51('0x3'),'afterUpdate':'update','afterDestroy':_0xaf51('0x4')};function emitEvent(_0x35238b){return function(_0x3e8e57,_0x29267b,_0x4d1a1c){TeamEvents[_0xaf51('0x5')](_0x35238b+':'+_0x3e8e57['id'],_0x3e8e57);TeamEvents['emit'](_0x35238b,_0x3e8e57);_0x4d1a1c(null);};}for(var e in events){if(events[_0xaf51('0x6')](e)){var event=events[e];Team[_0xaf51('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0xb07d=['hook','events','Team','save','update','emit'];(function(_0x135f4,_0x1fc1b1){var _0x2cd050=function(_0xeb7b4e){while(--_0xeb7b4e){_0x135f4['push'](_0x135f4['shift']());}};_0x2cd050(++_0x1fc1b1);}(_0xb07d,0x16f));var _0xdb07=function(_0x31c41c,_0x21d103){_0x31c41c=_0x31c41c-0x0;var _0x95c257=_0xb07d[_0x31c41c];return _0x95c257;};'use strict';var EventEmitter=require(_0xdb07('0x0'));var Team=require('../../mysqldb')['db'][_0xdb07('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb07('0x2'),'afterUpdate':_0xdb07('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41c9e3){return function(_0x6216be,_0x5af902,_0x2f367d){TeamEvents['emit'](_0x41c9e3+':'+_0x6216be['id'],_0x6216be);TeamEvents[_0xdb07('0x4')](_0x41c9e3,_0x6216be);_0x2f367d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xdb07('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index 9ee96de..13d4a27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x721d=['Mail','Openchannel','Sms','Voice','Whatsapp','resolve','all','lodash','then','map','setDataValue','channel','exports','define','Team','teams','Chat','Fax'];(function(_0x24b897,_0x38df26){var _0x522698=function(_0x1757a3){while(--_0x1757a3){_0x24b897['push'](_0x24b897['shift']());}};_0x522698(++_0x38df26);}(_0x721d,0xa9));var _0xd721=function(_0xeb67d8,_0x14a337){_0xeb67d8=_0xeb67d8-0x0;var _0x4138f9=_0x721d[_0xeb67d8];return _0x4138f9;};'use strict';var _=require(_0xd721('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1833a4,_0x450840){var _0x133244='get'+_0x450840+'Queues';return _0x1833a4[_0x133244]()[_0xd721('0x1')](function(_0x2bbaa9){return _[_0xd721('0x2')](_0x2bbaa9,function(_0x37d538){_0x37d538[_0xd721('0x3')](_0xd721('0x4'),_0x450840);return _0x37d538;});})['catch'](function(_0x49c991){throw _0x49c991;});}module[_0xd721('0x5')]=function(_0x38a578){return _0x38a578[_0xd721('0x6')](_0xd721('0x7'),attributes,{'tableName':_0xd721('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x520f54=this;var _0x325532=[_0xd721('0x9'),_0xd721('0xa'),_0xd721('0xb'),_0xd721('0xc'),_0xd721('0xd'),_0xd721('0xe'),_0xd721('0xf')];return Promise[_0xd721('0x10')]()['then'](function(){var _0x32dfbb=_[_0xd721('0x2')](_0x325532,function(_0x3a6c85){return getQueuesByChannel(_0x520f54,_0x3a6c85);});return Promise[_0xd721('0x11')](_0x32dfbb);})['catch'](function(_0x4465b3){throw _0x4465b3;});}}});};
\ No newline at end of file
+var _0x64e8=['all','./team.attributes','get','then','setDataValue','channel','catch','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice'];(function(_0x2c732d,_0x4e683e){var _0xd4b603=function(_0xd593ca){while(--_0xd593ca){_0x2c732d['push'](_0x2c732d['shift']());}};_0xd4b603(++_0x4e683e);}(_0x64e8,0x1cc));var _0x864e=function(_0x36c6a1,_0x41edfc){_0x36c6a1=_0x36c6a1-0x0;var _0x292e0f=_0x64e8[_0x36c6a1];return _0x292e0f;};'use strict';var _=require('lodash');var attributes=require(_0x864e('0x0'));function getQueuesByChannel(_0x2c1106,_0x2f10e5){var _0x39e33d=_0x864e('0x1')+_0x2f10e5+'Queues';return _0x2c1106[_0x39e33d]()[_0x864e('0x2')](function(_0x1af9d4){return _['map'](_0x1af9d4,function(_0x3b0907){_0x3b0907[_0x864e('0x3')](_0x864e('0x4'),_0x2f10e5);return _0x3b0907;});})[_0x864e('0x5')](function(_0x217ee1){throw _0x217ee1;});}module[_0x864e('0x6')]=function(_0x5c216b){return _0x5c216b[_0x864e('0x7')](_0x864e('0x8'),attributes,{'tableName':_0x864e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x1a5356=this;var _0x2e0d0f=[_0x864e('0xa'),_0x864e('0xb'),_0x864e('0xc'),_0x864e('0xd'),_0x864e('0xe'),_0x864e('0xf'),'Whatsapp'];return Promise['resolve']()[_0x864e('0x2')](function(){var _0x26db01=_['map'](_0x2e0d0f,function(_0x5604ce){return getQueuesByChannel(_0x1a5356,_0x5604ce);});return Promise[_0x864e('0x10')](_0x26db01);})['catch'](function(_0x86938e){throw _0x86938e;});}}});};
\ No newline at end of file
index 60c9787..274b77d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d1=['stringify','error','code','Team,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','./team.socket','request','then','info','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x89d1,0x17c));var _0x189d=function(_0x24db76,_0x1ae615){_0x24db76=_0x24db76-0x0;var _0x3e24fb=_0x89d1[_0x24db76];return _0x3e24fb;};'use strict';var _=require(_0x189d('0x0'));var util=require('util');var moment=require(_0x189d('0x1'));var BPromise=require(_0x189d('0x2'));var rs=require(_0x189d('0x3'));var fs=require('fs');var Redis=require(_0x189d('0x4'));var db=require(_0x189d('0x5'))['db'];var utils=require(_0x189d('0x6'));var logger=require('../../config/logger')(_0x189d('0x7'));var config=require(_0x189d('0x8'));var jayson=require(_0x189d('0x9'));var client=jayson['client'][_0x189d('0xa')]({'port':0x232a});config[_0x189d('0xb')]=_['defaults'](config[_0x189d('0xb')],{'host':_0x189d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x189d('0xd'))['register'](socket);function respondWithRpcPromise(_0x171fc1,_0x3fdc0f,_0x34da15){return new BPromise(function(_0x173092,_0x2bf3a0){return client[_0x189d('0xe')](_0x171fc1,_0x34da15)[_0x189d('0xf')](function(_0x48c5c3){logger[_0x189d('0x10')]('Team,\x20%s,\x20%s',_0x3fdc0f,'request\x20sent');logger[_0x189d('0x11')](_0x189d('0x12'),_0x3fdc0f,_0x189d('0x13'),JSON[_0x189d('0x14')](_0x48c5c3));if(_0x48c5c3['error']){if(_0x48c5c3[_0x189d('0x15')][_0x189d('0x16')]===0x1f4){logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x48c5c3[_0x189d('0x15')]['message']);return _0x2bf3a0(_0x48c5c3[_0x189d('0x15')][_0x189d('0x18')]);}logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x48c5c3['error'][_0x189d('0x18')]);return _0x173092(_0x48c5c3['error'][_0x189d('0x18')]);}else{logger[_0x189d('0x10')](_0x189d('0x17'),_0x3fdc0f,_0x189d('0x13'));_0x173092(_0x48c5c3['result']['message']);}})['catch'](function(_0x37684c){logger[_0x189d('0x15')](_0x189d('0x17'),_0x3fdc0f,_0x37684c);_0x2bf3a0(_0x37684c);});});}
\ No newline at end of file
+var _0xd469=['debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./team.socket','register','info','Team,\x20%s,\x20%s','request\x20sent'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0xd469,0x181));var _0x9d46=function(_0x5ebac5,_0x39844b){_0x5ebac5=_0x5ebac5-0x0;var _0x5e407f=_0xd469[_0x5ebac5];return _0x5e407f;};'use strict';var _=require(_0x9d46('0x0'));var util=require(_0x9d46('0x1'));var moment=require(_0x9d46('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d46('0x3'));var fs=require('fs');var Redis=require(_0x9d46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d46('0x5'));var logger=require(_0x9d46('0x6'))(_0x9d46('0x7'));var config=require(_0x9d46('0x8'));var jayson=require(_0x9d46('0x9'));var client=jayson['client'][_0x9d46('0xa')]({'port':0x232a});config['redis']=_[_0x9d46('0xb')](config['redis'],{'host':_0x9d46('0xc'),'port':0x18eb});var socket=require(_0x9d46('0xd'))(new Redis(config[_0x9d46('0xe')]));require(_0x9d46('0xf'))[_0x9d46('0x10')](socket);function respondWithRpcPromise(_0x2225c3,_0x2e4d05,_0xfc072b){return new BPromise(function(_0x1a63e7,_0x2516b5){return client['request'](_0x2225c3,_0xfc072b)['then'](function(_0x55959f){logger[_0x9d46('0x11')](_0x9d46('0x12'),_0x2e4d05,_0x9d46('0x13'));logger[_0x9d46('0x14')](_0x9d46('0x15'),_0x2e4d05,'request\x20sent',JSON[_0x9d46('0x16')](_0x55959f));if(_0x55959f[_0x9d46('0x17')]){if(_0x55959f[_0x9d46('0x17')]['code']===0x1f4){logger[_0x9d46('0x17')](_0x9d46('0x12'),_0x2e4d05,_0x55959f[_0x9d46('0x17')]['message']);return _0x2516b5(_0x55959f[_0x9d46('0x17')][_0x9d46('0x18')]);}logger['error'](_0x9d46('0x12'),_0x2e4d05,_0x55959f[_0x9d46('0x17')][_0x9d46('0x18')]);return _0x1a63e7(_0x55959f['error'][_0x9d46('0x18')]);}else{logger[_0x9d46('0x11')](_0x9d46('0x12'),_0x2e4d05,'request\x20sent');_0x1a63e7(_0x55959f[_0x9d46('0x19')]['message']);}})[_0x9d46('0x1a')](function(_0x19e352){logger[_0x9d46('0x17')](_0x9d46('0x12'),_0x2e4d05,_0x19e352);_0x2516b5(_0x19e352);});});}
\ No newline at end of file
index ba5e4e0..cfec7a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11b7=['length','team:','./team.events','save','remove','update','emit','register'];(function(_0x4baa4e,_0x25f8eb){var _0x18de81=function(_0x5803fa){while(--_0x5803fa){_0x4baa4e['push'](_0x4baa4e['shift']());}};_0x18de81(++_0x25f8eb);}(_0x11b7,0x132));var _0x711b=function(_0x35b205,_0x24e696){_0x35b205=_0x35b205-0x0;var _0x20ecb2=_0x11b7[_0x35b205];return _0x20ecb2;};'use strict';var TeamEvents=require(_0x711b('0x0'));var events=[_0x711b('0x1'),_0x711b('0x2'),_0x711b('0x3')];function createListener(_0x3010c0,_0x15c524){return function(_0x4a9361){_0x15c524[_0x711b('0x4')](_0x3010c0,_0x4a9361);};}function removeListener(_0x10dc82,_0x443671){return function(){TeamEvents['removeListener'](_0x10dc82,_0x443671);};}exports[_0x711b('0x5')]=function(_0x644cb1){for(var _0x2d5a6a=0x0,_0x9ac64b=events[_0x711b('0x6')];_0x2d5a6a<_0x9ac64b;_0x2d5a6a++){var _0x33143d=events[_0x2d5a6a];var _0x193a4a=createListener(_0x711b('0x7')+_0x33143d,_0x644cb1);TeamEvents['on'](_0x33143d,_0x193a4a);}};
\ No newline at end of file
+var _0xbc48=['register','length','team:','save','remove','update','emit','removeListener'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_0xbc48,0x16b));var _0x8bc4=function(_0x541352,_0x29e495){_0x541352=_0x541352-0x0;var _0x27c954=_0xbc48[_0x541352];return _0x27c954;};'use strict';var TeamEvents=require('./team.events');var events=[_0x8bc4('0x0'),_0x8bc4('0x1'),_0x8bc4('0x2')];function createListener(_0x5b0d08,_0x46bbd8){return function(_0x51f087){_0x46bbd8[_0x8bc4('0x3')](_0x5b0d08,_0x51f087);};}function removeListener(_0xdd2942,_0x3271df){return function(){TeamEvents[_0x8bc4('0x4')](_0xdd2942,_0x3271df);};}exports[_0x8bc4('0x5')]=function(_0x20e04c){for(var _0x35ffbf=0x0,_0x2fe686=events[_0x8bc4('0x6')];_0x35ffbf<_0x2fe686;_0x35ffbf++){var _0x2f2372=events[_0x35ffbf];var _0x10c6c2=createListener(_0x8bc4('0x7')+_0x2f2372,_0x20e04c);TeamEvents['on'](_0x2f2372,_0x10c6c2);}};
\ No newline at end of file
index 28d8251..381da74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1fa=['INTEGER'];(function(_0x46f757,_0xd70bcb){var _0x2bd0af=function(_0x4a59cd){while(--_0x4a59cd){_0x46f757['push'](_0x46f757['shift']());}};_0x2bd0af(++_0xd70bcb);}(_0xc1fa,0xe5));var _0xac1f=function(_0x5be7aa,_0x5de661){_0x5be7aa=_0x5be7aa-0x0;var _0x215408=_0xc1fa[_0x5be7aa];return _0x215408;};'use strict';var Sequelize=require('sequelize');module['exports']={'TeamId':{'type':Sequelize[_0xac1f('0x0')]},'VoicePrefixId':{'type':Sequelize[_0xac1f('0x0')]}};
\ No newline at end of file
+var _0x10bd=['INTEGER','exports'];(function(_0x54782e,_0x364fe4){var _0x5ce508=function(_0x34caf0){while(--_0x34caf0){_0x54782e['push'](_0x54782e['shift']());}};_0x5ce508(++_0x364fe4);}(_0x10bd,0x97));var _0xd10b=function(_0x138e5b,_0x3864e9){_0x138e5b=_0x138e5b-0x0;var _0x4f4d86=_0x10bd[_0x138e5b];return _0x4f4d86;};'use strict';var Sequelize=require('sequelize');module[_0xd10b('0x0')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xd10b('0x1')]}};
\ No newline at end of file
index ae227f1..84f64dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b1a=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports'];(function(_0x20f5d8,_0x5cdf61){var _0x4105b0=function(_0x3c17e6){while(--_0x3c17e6){_0x20f5d8['push'](_0x20f5d8['shift']());}};_0x4105b0(++_0x5cdf61);}(_0x8b1a,0x152));var _0xa8b1=function(_0x27e7e5,_0x5c3a2b){_0x27e7e5=_0x27e7e5-0x0;var _0x1e1f2a=_0x8b1a[_0x27e7e5];return _0x1e1f2a;};'use strict';var _=require(_0xa8b1('0x0'));var util=require(_0xa8b1('0x1'));var logger=require(_0xa8b1('0x2'))('api');var moment=require(_0xa8b1('0x3'));var BPromise=require(_0xa8b1('0x4'));var rp=require(_0xa8b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8b1('0x6'));var config=require(_0xa8b1('0x7'));var attributes=require(_0xa8b1('0x8'));module[_0xa8b1('0x9')]=function(_0x493b8e,_0x90c588){return _0x493b8e['define'](_0xa8b1('0xa'),attributes,{'tableName':_0xa8b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdaa8=['api','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','lodash','util','../../config/logger'];(function(_0x593c1b,_0x35c524){var _0x4e0c07=function(_0x8c0aab){while(--_0x8c0aab){_0x593c1b['push'](_0x593c1b['shift']());}};_0x4e0c07(++_0x35c524);}(_0xdaa8,0xe4));var _0x8daa=function(_0x232328,_0x4c3439){_0x232328=_0x232328-0x0;var _0x39c46b=_0xdaa8[_0x232328];return _0x39c46b;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var logger=require(_0x8daa('0x2'))(_0x8daa('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8daa('0x4'));module[_0x8daa('0x5')]=function(_0x46f753,_0x4d2392){return _0x46f753['define'](_0x8daa('0x6'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dbc9d4f..bc64ace 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x220882,_0x42619b){var _0xbcf788=function(_0x28197c){while(--_0x28197c){_0x220882['push'](_0x220882['shift']());}};_0xbcf788(++_0x42619b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x223528,_0x435ddc){var _0x2d20a3=function(_0x40ac21){while(--_0x40ac21){_0x223528['push'](_0x223528['shift']());}};_0x2d20a3(++_0x435ddc);}(_0xedd9,0xfc));var _0x9edd=function(_0x379618,_0xc96b07){_0x379618=_0x379618-0x0;var _0x1dad0b=_0xedd9[_0x379618];return _0x1dad0b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 1b848f2..31ef412 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf15d=['exports','sequelize'];(function(_0x4a4def,_0x5eef27){var _0x5d8ae0=function(_0x4abc76){while(--_0x4abc76){_0x4a4def['push'](_0x4a4def['shift']());}};_0x5d8ae0(++_0x5eef27);}(_0xf15d,0x1a9));var _0xdf15=function(_0x221351,_0x322f34){_0x221351=_0x221351-0x0;var _0x399d50=_0xf15d[_0x221351];return _0x399d50;};'use strict';var Sequelize=require(_0xdf15('0x0'));module[_0xdf15('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xac95=['sequelize','exports','INTEGER'];(function(_0x1f3f4f,_0x2eb964){var _0x1f85ec=function(_0x13189e){while(--_0x13189e){_0x1f3f4f['push'](_0x1f3f4f['shift']());}};_0x1f85ec(++_0x2eb964);}(_0xac95,0xa8));var _0x5ac9=function(_0x21f72a,_0x21e4c5){_0x21f72a=_0x21f72a-0x0;var _0x2f35f4=_0xac95[_0x21f72a];return _0x2f35f4;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'penalty':{'type':Sequelize[_0x5ac9('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 83cd8c3..0e38f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe22=['../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x161f85,_0x1b1968){var _0x3f98ad=function(_0x44b3d5){while(--_0x44b3d5){_0x161f85['push'](_0x161f85['shift']());}};_0x3f98ad(++_0x1b1968);}(_0xbe22,0x1c1));var _0x2be2=function(_0x5181ae,_0x2e2953){_0x5181ae=_0x5181ae-0x0;var _0x605bf4=_0xbe22[_0x5181ae];return _0x605bf4;};'use strict';var _=require(_0x2be2('0x0'));var util=require(_0x2be2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2be2('0x2'));var BPromise=require(_0x2be2('0x3'));var rp=require(_0x2be2('0x4'));var fs=require('fs');var path=require(_0x2be2('0x5'));var rimraf=require(_0x2be2('0x6'));var config=require(_0x2be2('0x7'));var attributes=require(_0x2be2('0x8'));module[_0x2be2('0x9')]=function(_0x1b3bde,_0x3a4d77){return _0x1b3bde['define'](_0x2be2('0xa'),attributes,{'tableName':_0x2be2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5636=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0x3af806,_0x2b4c0d){var _0x45ff78=function(_0x554fd2){while(--_0x554fd2){_0x3af806['push'](_0x3af806['shift']());}};_0x45ff78(++_0x2b4c0d);}(_0x5636,0x102));var _0x6563=function(_0x23a884,_0x287c95){_0x23a884=_0x23a884-0x0;var _0x2b2a4a=_0x5636[_0x23a884];return _0x2b2a4a;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6563('0x2'));var rp=require(_0x6563('0x3'));var fs=require('fs');var path=require(_0x6563('0x4'));var rimraf=require('rimraf');var config=require(_0x6563('0x5'));var attributes=require(_0x6563('0x6'));module[_0x6563('0x7')]=function(_0x39792f,_0x29f687){return _0x39792f[_0x6563('0x8')](_0x6563('0x9'),attributes,{'tableName':_0x6563('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a68a20..6655ce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce3=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird'];(function(_0x4eb060,_0x479749){var _0x5548d4=function(_0x2d2d6b){while(--_0x2d2d6b){_0x4eb060['push'](_0x4eb060['shift']());}};_0x5548d4(++_0x479749);}(_0x8ce3,0xc3));var _0x38ce=function(_0x548003,_0x19cd0e){_0x548003=_0x548003-0x0;var _0x459a44=_0x8ce3[_0x548003];return _0x459a44;};'use strict';var _=require(_0x38ce('0x0'));var util=require(_0x38ce('0x1'));var moment=require('moment');var BPromise=require(_0x38ce('0x2'));var rs=require(_0x38ce('0x3'));var fs=require('fs');var Redis=require(_0x38ce('0x4'));var db=require(_0x38ce('0x5'))['db'];var utils=require(_0x38ce('0x6'));var logger=require(_0x38ce('0x7'))(_0x38ce('0x8'));var config=require(_0x38ce('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x38ce('0xa')][_0x38ce('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58074c,_0x262b13,_0xbe7332){return new BPromise(function(_0x3f8011,_0x482955){return client[_0x38ce('0xc')](_0x58074c,_0xbe7332)['then'](function(_0x725d27){logger['info'](_0x38ce('0xd'),_0x262b13,_0x38ce('0xe'));logger[_0x38ce('0xf')](_0x38ce('0x10'),_0x262b13,_0x38ce('0xe'),JSON[_0x38ce('0x11')](_0x725d27));if(_0x725d27[_0x38ce('0x12')]){if(_0x725d27[_0x38ce('0x12')][_0x38ce('0x13')]===0x1f4){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);return _0x482955(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}logger[_0x38ce('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x262b13,_0x725d27['error'][_0x38ce('0x14')]);return _0x3f8011(_0x725d27[_0x38ce('0x12')][_0x38ce('0x14')]);}else{logger['info'](_0x38ce('0xd'),_0x262b13,'request\x20sent');_0x3f8011(_0x725d27[_0x38ce('0x15')][_0x38ce('0x14')]);}})['catch'](function(_0x5fc115){logger[_0x38ce('0x12')](_0x38ce('0xd'),_0x262b13,_0x5fc115);_0x482955(_0x5fc115);});});}
\ No newline at end of file
+var _0x66fa=['../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xc6c40b,_0x460a61){var _0x28ab98=function(_0x1a6b3d){while(--_0x1a6b3d){_0xc6c40b['push'](_0xc6c40b['shift']());}};_0x28ab98(++_0x460a61);}(_0x66fa,0x168));var _0xa66f=function(_0x4b81b7,_0x45b1a0){_0x4b81b7=_0x4b81b7-0x0;var _0x296fbe=_0x66fa[_0x4b81b7];return _0x296fbe;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require(_0xa66f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66f('0x3'));var db=require(_0xa66f('0x4'))['db'];var utils=require(_0xa66f('0x5'));var logger=require(_0xa66f('0x6'))(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var jayson=require(_0xa66f('0x9'));var client=jayson[_0xa66f('0xa')][_0xa66f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33bd0d,_0x150f73,_0x5b7cf7){return new BPromise(function(_0x1cf624,_0x5ec156){return client[_0xa66f('0xc')](_0x33bd0d,_0x5b7cf7)[_0xa66f('0xd')](function(_0x5ad336){logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,_0xa66f('0x10'));logger[_0xa66f('0x11')](_0xa66f('0x12'),_0x150f73,_0xa66f('0x10'),JSON['stringify'](_0x5ad336));if(_0x5ad336['error']){if(_0x5ad336[_0xa66f('0x13')]['code']===0x1f4){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')]['message']);return _0x5ec156(_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);}logger['error'](_0xa66f('0xf'),_0x150f73,_0x5ad336[_0xa66f('0x13')][_0xa66f('0x14')]);return _0x1cf624(_0x5ad336[_0xa66f('0x13')]['message']);}else{logger[_0xa66f('0xe')](_0xa66f('0xf'),_0x150f73,'request\x20sent');_0x1cf624(_0x5ad336[_0xa66f('0x15')][_0xa66f('0x14')]);}})[_0xa66f('0x16')](function(_0x76af81){logger[_0xa66f('0x13')](_0xa66f('0xf'),_0x150f73,_0x76af81);_0x5ec156(_0x76af81);});});}
\ No newline at end of file
index c733256..1ccd497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5324=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','multer','util'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x5324,0x154));var _0x4532=function(_0x3279b2,_0x233887){_0x3279b2=_0x3279b2-0x0;var _0x3b8a6a=_0x5324[_0x3279b2];return _0x3b8a6a;};'use strict';var multer=require(_0x4532('0x0'));var util=require(_0x4532('0x1'));var path=require(_0x4532('0x2'));var timeout=require(_0x4532('0x3'));var express=require('express');var router=express[_0x4532('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4532('0x5'));var interaction=require(_0x4532('0x6'));var config=require(_0x4532('0x7'));var controller=require(_0x4532('0x8'));router[_0x4532('0x9')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xb')]);router[_0x4532('0x9')]('/:id',auth[_0x4532('0xa')](),controller[_0x4532('0xc')]);router[_0x4532('0xd')]('/',auth[_0x4532('0xa')](),controller[_0x4532('0xe')]);router[_0x4532('0xf')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller[_0x4532('0x11')]);router[_0x4532('0x12')](_0x4532('0x10'),auth[_0x4532('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xfef9=['../../components/interaction/service','./template.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x332193,_0x1070b1){var _0x418cc8=function(_0x118768){while(--_0x118768){_0x332193['push'](_0x332193['shift']());}};_0x418cc8(++_0x1070b1);}(_0xfef9,0xd3));var _0x9fef=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0xfef9[_0x1f44e4];return _0x591989;};'use strict';var multer=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var path=require('path');var timeout=require(_0x9fef('0x2'));var express=require(_0x9fef('0x3'));var router=express['Router']();var fs_extra=require(_0x9fef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9fef('0x5'));var config=require('../../config/environment');var controller=require(_0x9fef('0x6'));router[_0x9fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x9fef('0x8')]);router[_0x9fef('0x7')]('/:id',auth[_0x9fef('0x9')](),controller[_0x9fef('0xa')]);router[_0x9fef('0xb')]('/',auth['isAuthenticated'](),controller[_0x9fef('0xc')]);router[_0x9fef('0xd')](_0x9fef('0xe'),auth['isAuthenticated'](),controller[_0x9fef('0xf')]);router['delete'](_0x9fef('0xe'),auth[_0x9fef('0x9')](),controller[_0x9fef('0x10')]);module[_0x9fef('0x11')]=router;
\ No newline at end of file
index f3ce8ee..70e0a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe135=['TEXT','sequelize','exports'];(function(_0x34a554,_0x20a5b4){var _0x3fbf8a=function(_0x1371e9){while(--_0x1371e9){_0x34a554['push'](_0x34a554['shift']());}};_0x3fbf8a(++_0x20a5b4);}(_0xe135,0xf7));var _0x5e13=function(_0x256684,_0x529c1e){_0x256684=_0x256684-0x0;var _0x37a0c9=_0xe135[_0x256684];return _0x37a0c9;};'use strict';var Sequelize=require(_0x5e13('0x0'));module[_0x5e13('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x5e13('0x2')]}};
\ No newline at end of file
+var _0x0cb7=['exports','STRING','TEXT','sequelize'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x0cb7,0x1b3));var _0x70cb=function(_0x333965,_0x16e0f5){_0x333965=_0x333965-0x0;var _0x50290e=_0x0cb7[_0x333965];return _0x50290e;};'use strict';var Sequelize=require(_0x70cb('0x0'));module[_0x70cb('0x1')]={'name':{'type':Sequelize[_0x70cb('0x2')]},'description':{'type':Sequelize[_0x70cb('0x2')]},'html':{'type':Sequelize[_0x70cb('0x3')]}};
\ No newline at end of file
index 8718e40..2933e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe255=['querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','Template','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xe255,0xf2));var _0x5e25=function(_0x52c543,_0x301716){_0x52c543=_0x52c543-0x0;var _0xc93a8e=_0xe255[_0x52c543];return _0xc93a8e;};'use strict';var emlformat=require(_0x5e25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e25('0x1'));var jsonpatch=require(_0x5e25('0x2'));var rp=require(_0x5e25('0x3'));var moment=require(_0x5e25('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5e25('0x5'));var util=require(_0x5e25('0x6'));var path=require(_0x5e25('0x7'));var sox=require('sox');var csv=require(_0x5e25('0x8'));var ejs=require(_0x5e25('0x9'));var fs=require('fs');var fs_extra=require(_0x5e25('0xa'));var _=require(_0x5e25('0xb'));var squel=require(_0x5e25('0xc'));var crypto=require(_0x5e25('0xd'));var jsforce=require(_0x5e25('0xe'));var deskjs=require(_0x5e25('0xf'));var toCsv=require(_0x5e25('0x8'));var querystring=require(_0x5e25('0x10'));var Papa=require(_0x5e25('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e25('0x12'));var as=require(_0x5e25('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e25('0x14'))(_0x5e25('0x15'));var utils=require(_0x5e25('0x16'));var config=require(_0x5e25('0x17'));var licenseUtil=require(_0x5e25('0x18'));var db=require(_0x5e25('0x19'))['db'];function respondWithStatusCode(_0x5b7618,_0x5c490d){_0x5c490d=_0x5c490d||0xcc;return function(_0x275ea4){if(_0x275ea4){return _0x5b7618[_0x5e25('0x1a')](_0x5c490d);}return _0x5b7618[_0x5e25('0x1b')](_0x5c490d)[_0x5e25('0x1c')]();};}function respondWithResult(_0x3badca,_0xbcbcf4){_0xbcbcf4=_0xbcbcf4||0xc8;return function(_0x49c0af){if(_0x49c0af){return _0x3badca[_0x5e25('0x1b')](_0xbcbcf4)[_0x5e25('0x1d')](_0x49c0af);}};}function respondWithFilteredResult(_0x192a44,_0xac8d48){return function(_0x97f8c4){if(_0x97f8c4){var _0x40f44f=typeof _0xac8d48[_0x5e25('0x1e')]===_0x5e25('0x1f')&&typeof _0xac8d48[_0x5e25('0x20')]===_0x5e25('0x1f');var _0x2e263a=_0x97f8c4[_0x5e25('0x21')];var _0x4a84d9=_0x40f44f?0x0:_0xac8d48[_0x5e25('0x1e')];var _0x39f4f7=_0x40f44f?_0x97f8c4['count']:_0xac8d48['offset']+_0xac8d48['limit'];var _0x2065b5;if(_0x39f4f7>=_0x2e263a){_0x39f4f7=_0x2e263a;_0x2065b5=0xc8;}else{_0x2065b5=0xce;}_0x192a44[_0x5e25('0x1b')](_0x2065b5);return _0x192a44[_0x5e25('0x22')]('Content-Range',_0x4a84d9+'-'+_0x39f4f7+'/'+_0x2e263a)[_0x5e25('0x1d')](_0x97f8c4);}return null;};}function patchUpdates(_0x1be4b8){return function(_0x3a57c8){try{jsonpatch[_0x5e25('0x23')](_0x3a57c8,_0x1be4b8,!![]);}catch(_0x5ac7e1){return BPromise['reject'](_0x5ac7e1);}return _0x3a57c8[_0x5e25('0x24')]();};}function saveUpdates(_0x5d163c,_0x366030){return function(_0x29d6a0){if(_0x29d6a0){return _0x29d6a0[_0x5e25('0x25')](_0x5d163c)[_0x5e25('0x26')](function(_0x457898){return _0x457898;});}return null;};}function removeEntity(_0x38a41c,_0x2dbfe9){return function(_0x4304cd){if(_0x4304cd){return _0x4304cd[_0x5e25('0x27')]()[_0x5e25('0x26')](function(){var _0x16d0db=_0x4304cd[_0x5e25('0x28')]({'plain':!![]});var _0x282e73=_0x5e25('0x29');return db[_0x5e25('0x2a')][_0x5e25('0x27')]({'where':{'type':_0x282e73,'resourceId':_0x16d0db['id']}})[_0x5e25('0x26')](function(){return _0x4304cd;});})[_0x5e25('0x26')](function(){_0x38a41c[_0x5e25('0x1b')](0xcc)[_0x5e25('0x1c')]();});}};}function handleEntityNotFound(_0x468754,_0x7eeaa2){return function(_0x454bba){if(!_0x454bba){_0x468754[_0x5e25('0x1a')](0x194);}return _0x454bba;};}function handleError(_0xb1199c,_0x4ed584){_0x4ed584=_0x4ed584||0x1f4;return function(_0x368dcd){logger[_0x5e25('0x2b')](_0x368dcd[_0x5e25('0x2c')]);if(_0x368dcd[_0x5e25('0x2d')]){delete _0x368dcd[_0x5e25('0x2d')];}_0xb1199c[_0x5e25('0x1b')](_0x4ed584)[_0x5e25('0x2e')](_0x368dcd);};}exports[_0x5e25('0x2f')]=function(_0x890a7a,_0x103d4a){var _0x40fd57={},_0x12e367={},_0x43b63a={'count':0x0,'rows':[]};var _0x21dd57=_['map'](db['Template'][_0x5e25('0x30')],function(_0x15ed6c){return{'name':_0x15ed6c[_0x5e25('0x31')],'type':_0x15ed6c['type']['key']};});_0x12e367[_0x5e25('0x32')]=_[_0x5e25('0x33')](_0x21dd57,_0x5e25('0x2d'));_0x12e367[_0x5e25('0x34')]=_['keys'](_0x890a7a['query']);_0x12e367[_0x5e25('0x35')]=_[_0x5e25('0x36')](_0x12e367[_0x5e25('0x32')],_0x12e367[_0x5e25('0x34')]);_0x40fd57[_0x5e25('0x37')]=_[_0x5e25('0x36')](_0x12e367[_0x5e25('0x32')],qs['fields'](_0x890a7a[_0x5e25('0x34')][_0x5e25('0x38')]));_0x40fd57['attributes']=_0x40fd57[_0x5e25('0x37')][_0x5e25('0x39')]?_0x40fd57['attributes']:_0x12e367[_0x5e25('0x32')];if(!_0x890a7a[_0x5e25('0x34')][_0x5e25('0x3a')](_0x5e25('0x3b'))){_0x40fd57[_0x5e25('0x20')]=qs[_0x5e25('0x20')](_0x890a7a[_0x5e25('0x34')][_0x5e25('0x20')]);_0x40fd57['offset']=qs[_0x5e25('0x1e')](_0x890a7a['query'][_0x5e25('0x1e')]);}_0x40fd57[_0x5e25('0x3c')]=qs[_0x5e25('0x3d')](_0x890a7a[_0x5e25('0x34')]['sort']);_0x40fd57[_0x5e25('0x3e')]=qs[_0x5e25('0x35')](_['pick'](_0x890a7a[_0x5e25('0x34')],_0x12e367[_0x5e25('0x35')]),_0x21dd57);if(_0x890a7a['query'][_0x5e25('0x3f')]){_0x40fd57[_0x5e25('0x3e')]=_['merge'](_0x40fd57['where'],{'$or':_['map'](_0x21dd57,function(_0x10dd76){if(_0x10dd76[_0x5e25('0x40')]!==_0x5e25('0x41')){var _0x2678b1={};_0x2678b1[_0x10dd76[_0x5e25('0x2d')]]={'$like':'%'+_0x890a7a['query']['filter']+'%'};return _0x2678b1;}})});}_0x40fd57=_[_0x5e25('0x42')]({},_0x40fd57,_0x890a7a[_0x5e25('0x43')]);var _0x3ea0ef={'where':_0x40fd57[_0x5e25('0x3e')]};return db[_0x5e25('0x44')][_0x5e25('0x21')](_0x3ea0ef)[_0x5e25('0x26')](function(_0x4fa1f3){_0x43b63a[_0x5e25('0x21')]=_0x4fa1f3;if(_0x890a7a[_0x5e25('0x34')][_0x5e25('0x45')]){_0x40fd57['include']=[{'all':!![]}];}return db[_0x5e25('0x44')][_0x5e25('0x46')](_0x40fd57);})[_0x5e25('0x26')](function(_0x4013a5){_0x43b63a[_0x5e25('0x47')]=_0x4013a5;return _0x43b63a;})[_0x5e25('0x26')](respondWithFilteredResult(_0x103d4a,_0x40fd57))[_0x5e25('0x48')](handleError(_0x103d4a,null));};exports[_0x5e25('0x49')]=function(_0x545ab9,_0x574cfc){var _0xf7e90c={'raw':!![],'where':{'id':_0x545ab9[_0x5e25('0x4a')]['id']}},_0x1cbe8f={};_0x1cbe8f['model']=_[_0x5e25('0x4b')](db[_0x5e25('0x44')]['rawAttributes']);_0x1cbe8f[_0x5e25('0x34')]=_[_0x5e25('0x4b')](_0x545ab9[_0x5e25('0x34')]);_0x1cbe8f[_0x5e25('0x35')]=_[_0x5e25('0x36')](_0x1cbe8f['model'],_0x1cbe8f[_0x5e25('0x34')]);_0xf7e90c['attributes']=_[_0x5e25('0x36')](_0x1cbe8f[_0x5e25('0x32')],qs['fields'](_0x545ab9[_0x5e25('0x34')]['fields']));_0xf7e90c[_0x5e25('0x37')]=_0xf7e90c[_0x5e25('0x37')]['length']?_0xf7e90c[_0x5e25('0x37')]:_0x1cbe8f[_0x5e25('0x32')];if(_0x545ab9['query'][_0x5e25('0x45')]){_0xf7e90c[_0x5e25('0x4c')]=[{'all':!![]}];}_0xf7e90c=_[_0x5e25('0x42')]({},_0xf7e90c,_0x545ab9['options']);return db['Template']['find'](_0xf7e90c)[_0x5e25('0x26')](handleEntityNotFound(_0x574cfc,null))[_0x5e25('0x26')](respondWithResult(_0x574cfc,null))[_0x5e25('0x48')](handleError(_0x574cfc,null));};exports[_0x5e25('0x4d')]=function(_0x4d259b,_0x543414){return db[_0x5e25('0x44')][_0x5e25('0x4d')](_0x4d259b[_0x5e25('0x4e')],{})[_0x5e25('0x26')](function(_0x94d884){var _0x57577d=_0x4d259b[_0x5e25('0x4f')][_0x5e25('0x28')]({'plain':!![]});if(!_0x57577d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57577d[_0x5e25('0x50')]===_0x5e25('0x4f')){var _0x2babc9=_0x94d884[_0x5e25('0x28')]({'plain':!![]});var _0x2a9246=_0x5e25('0x29');return db[_0x5e25('0x51')]['find']({'where':{'name':_0x2a9246,'userProfileId':_0x57577d[_0x5e25('0x52')]},'raw':!![]})[_0x5e25('0x26')](function(_0x20119d){if(_0x20119d&&_0x20119d[_0x5e25('0x53')]===0x0){return db[_0x5e25('0x2a')][_0x5e25('0x4d')]({'name':_0x2babc9[_0x5e25('0x2d')],'resourceId':_0x2babc9['id'],'type':_0x20119d[_0x5e25('0x2d')],'sectionId':_0x20119d['id']},{})[_0x5e25('0x26')](function(){return _0x94d884;});}else{return _0x94d884;}})[_0x5e25('0x48')](function(_0x2e2a13){logger['error'](_0x5e25('0x54'),_0x2e2a13);throw _0x2e2a13;});}return _0x94d884;})['then'](respondWithResult(_0x543414,0xc9))[_0x5e25('0x48')](handleError(_0x543414,null));};exports[_0x5e25('0x25')]=function(_0x3d9329,_0x50ec8a){if(_0x3d9329['body']['id']){delete _0x3d9329['body']['id'];}return db[_0x5e25('0x44')][_0x5e25('0x55')]({'where':{'id':_0x3d9329[_0x5e25('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50ec8a,null))[_0x5e25('0x26')](saveUpdates(_0x3d9329[_0x5e25('0x4e')],null))['then'](respondWithResult(_0x50ec8a,null))[_0x5e25('0x48')](handleError(_0x50ec8a,null));};exports[_0x5e25('0x27')]=function(_0x2d219f,_0x3f99fc){return db[_0x5e25('0x44')][_0x5e25('0x55')]({'where':{'id':_0x2d219f['params']['id']}})[_0x5e25('0x26')](handleEntityNotFound(_0x3f99fc,null))[_0x5e25('0x26')](removeEntity(_0x3f99fc,null))[_0x5e25('0x48')](handleError(_0x3f99fc,null));};
\ No newline at end of file
+var _0x5ea5=['attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','options','count','includeAll','include','findAll','catch','show','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','get','destroy','error','name','send','index','Template','rawAttributes','fieldName','key','model','map','query','keys','intersection'];(function(_0x2498a4,_0x119be2){var _0xd2aa2b=function(_0xbac0b3){while(--_0xbac0b3){_0x2498a4['push'](_0x2498a4['shift']());}};_0xd2aa2b(++_0x119be2);}(_0x5ea5,0x1ef));var _0x55ea=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0x5ea5[_0xb7a459];return _0x104ab5;};'use strict';var emlformat=require(_0x55ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x55ea('0x1'));var jsonpatch=require(_0x55ea('0x2'));var rp=require(_0x55ea('0x3'));var moment=require(_0x55ea('0x4'));var BPromise=require(_0x55ea('0x5'));var Mustache=require(_0x55ea('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x55ea('0x7'));var squel=require('squel');var crypto=require(_0x55ea('0x8'));var jsforce=require(_0x55ea('0x9'));var deskjs=require(_0x55ea('0xa'));var toCsv=require(_0x55ea('0xb'));var querystring=require(_0x55ea('0xc'));var Papa=require(_0x55ea('0xd'));var Redis=require(_0x55ea('0xe'));var authService=require(_0x55ea('0xf'));var qs=require(_0x55ea('0x10'));var as=require(_0x55ea('0x11'));var hardwareService=require(_0x55ea('0x12'));var logger=require(_0x55ea('0x13'))(_0x55ea('0x14'));var utils=require('../../config/utils');var config=require(_0x55ea('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x55ea('0x16'))['db'];function respondWithStatusCode(_0xee2ef3,_0x4ec88b){_0x4ec88b=_0x4ec88b||0xcc;return function(_0x203484){if(_0x203484){return _0xee2ef3[_0x55ea('0x17')](_0x4ec88b);}return _0xee2ef3[_0x55ea('0x18')](_0x4ec88b)[_0x55ea('0x19')]();};}function respondWithResult(_0x165633,_0x33655d){_0x33655d=_0x33655d||0xc8;return function(_0x4c5545){if(_0x4c5545){return _0x165633[_0x55ea('0x18')](_0x33655d)[_0x55ea('0x1a')](_0x4c5545);}};}function respondWithFilteredResult(_0x67dc03,_0x552876){return function(_0x1ed55c){if(_0x1ed55c){var _0x3b48be=typeof _0x552876[_0x55ea('0x1b')]===_0x55ea('0x1c')&&typeof _0x552876[_0x55ea('0x1d')]===_0x55ea('0x1c');var _0x840c6=_0x1ed55c['count'];var _0x3a0491=_0x3b48be?0x0:_0x552876[_0x55ea('0x1b')];var _0x215ecf=_0x3b48be?_0x1ed55c['count']:_0x552876['offset']+_0x552876[_0x55ea('0x1d')];var _0x2c789b;if(_0x215ecf>=_0x840c6){_0x215ecf=_0x840c6;_0x2c789b=0xc8;}else{_0x2c789b=0xce;}_0x67dc03[_0x55ea('0x18')](_0x2c789b);return _0x67dc03['set'](_0x55ea('0x1e'),_0x3a0491+'-'+_0x215ecf+'/'+_0x840c6)['json'](_0x1ed55c);}return null;};}function patchUpdates(_0xe9329e){return function(_0x1bb507){try{jsonpatch[_0x55ea('0x1f')](_0x1bb507,_0xe9329e,!![]);}catch(_0x2add79){return BPromise[_0x55ea('0x20')](_0x2add79);}return _0x1bb507[_0x55ea('0x21')]();};}function saveUpdates(_0x5abe31,_0x4627a2){return function(_0x244e2b){if(_0x244e2b){return _0x244e2b[_0x55ea('0x22')](_0x5abe31)[_0x55ea('0x23')](function(_0x233d3e){return _0x233d3e;});}return null;};}function removeEntity(_0x2a0d08,_0x287189){return function(_0x40b199){if(_0x40b199){return _0x40b199['destroy']()[_0x55ea('0x23')](function(){var _0x561c24=_0x40b199[_0x55ea('0x24')]({'plain':!![]});var _0x253771='Templates';return db['UserProfileResource'][_0x55ea('0x25')]({'where':{'type':_0x253771,'resourceId':_0x561c24['id']}})[_0x55ea('0x23')](function(){return _0x40b199;});})['then'](function(){_0x2a0d08[_0x55ea('0x18')](0xcc)[_0x55ea('0x19')]();});}};}function handleEntityNotFound(_0x3d6a9f,_0x1cc053){return function(_0x8e5575){if(!_0x8e5575){_0x3d6a9f[_0x55ea('0x17')](0x194);}return _0x8e5575;};}function handleError(_0x318efe,_0x50ba42){_0x50ba42=_0x50ba42||0x1f4;return function(_0x55a49a){logger[_0x55ea('0x26')](_0x55a49a['stack']);if(_0x55a49a[_0x55ea('0x27')]){delete _0x55a49a[_0x55ea('0x27')];}_0x318efe[_0x55ea('0x18')](_0x50ba42)[_0x55ea('0x28')](_0x55a49a);};}exports[_0x55ea('0x29')]=function(_0x1805ba,_0x32ef97){var _0x7ab0e6={},_0x41530c={},_0x5eda45={'count':0x0,'rows':[]};var _0xbe23d2=_['map'](db[_0x55ea('0x2a')][_0x55ea('0x2b')],function(_0x3ea507){return{'name':_0x3ea507[_0x55ea('0x2c')],'type':_0x3ea507['type'][_0x55ea('0x2d')]};});_0x41530c[_0x55ea('0x2e')]=_[_0x55ea('0x2f')](_0xbe23d2,_0x55ea('0x27'));_0x41530c[_0x55ea('0x30')]=_[_0x55ea('0x31')](_0x1805ba[_0x55ea('0x30')]);_0x41530c['filters']=_[_0x55ea('0x32')](_0x41530c['model'],_0x41530c[_0x55ea('0x30')]);_0x7ab0e6[_0x55ea('0x33')]=_[_0x55ea('0x32')](_0x41530c[_0x55ea('0x2e')],qs[_0x55ea('0x34')](_0x1805ba[_0x55ea('0x30')][_0x55ea('0x34')]));_0x7ab0e6[_0x55ea('0x33')]=_0x7ab0e6[_0x55ea('0x33')]['length']?_0x7ab0e6[_0x55ea('0x33')]:_0x41530c[_0x55ea('0x2e')];if(!_0x1805ba[_0x55ea('0x30')][_0x55ea('0x35')]('nolimit')){_0x7ab0e6[_0x55ea('0x1d')]=qs[_0x55ea('0x1d')](_0x1805ba[_0x55ea('0x30')][_0x55ea('0x1d')]);_0x7ab0e6['offset']=qs[_0x55ea('0x1b')](_0x1805ba[_0x55ea('0x30')]['offset']);}_0x7ab0e6[_0x55ea('0x36')]=qs[_0x55ea('0x37')](_0x1805ba[_0x55ea('0x30')][_0x55ea('0x37')]);_0x7ab0e6[_0x55ea('0x38')]=qs[_0x55ea('0x39')](_['pick'](_0x1805ba[_0x55ea('0x30')],_0x41530c[_0x55ea('0x39')]),_0xbe23d2);if(_0x1805ba['query'][_0x55ea('0x3a')]){_0x7ab0e6[_0x55ea('0x38')]=_['merge'](_0x7ab0e6[_0x55ea('0x38')],{'$or':_['map'](_0xbe23d2,function(_0x471a10){if(_0x471a10['type']!=='VIRTUAL'){var _0x5f5130={};_0x5f5130[_0x471a10[_0x55ea('0x27')]]={'$like':'%'+_0x1805ba[_0x55ea('0x30')][_0x55ea('0x3a')]+'%'};return _0x5f5130;}})});}_0x7ab0e6=_[_0x55ea('0x3b')]({},_0x7ab0e6,_0x1805ba[_0x55ea('0x3c')]);var _0x21d310={'where':_0x7ab0e6[_0x55ea('0x38')]};return db[_0x55ea('0x2a')][_0x55ea('0x3d')](_0x21d310)[_0x55ea('0x23')](function(_0xa3fabf){_0x5eda45[_0x55ea('0x3d')]=_0xa3fabf;if(_0x1805ba['query'][_0x55ea('0x3e')]){_0x7ab0e6[_0x55ea('0x3f')]=[{'all':!![]}];}return db['Template'][_0x55ea('0x40')](_0x7ab0e6);})['then'](function(_0x5869e4){_0x5eda45['rows']=_0x5869e4;return _0x5eda45;})[_0x55ea('0x23')](respondWithFilteredResult(_0x32ef97,_0x7ab0e6))[_0x55ea('0x41')](handleError(_0x32ef97,null));};exports[_0x55ea('0x42')]=function(_0x24a937,_0x59d841){var _0x17d2ad={'raw':!![],'where':{'id':_0x24a937['params']['id']}},_0x578af0={};_0x578af0[_0x55ea('0x2e')]=_[_0x55ea('0x31')](db['Template']['rawAttributes']);_0x578af0[_0x55ea('0x30')]=_[_0x55ea('0x31')](_0x24a937[_0x55ea('0x30')]);_0x578af0['filters']=_['intersection'](_0x578af0[_0x55ea('0x2e')],_0x578af0[_0x55ea('0x30')]);_0x17d2ad[_0x55ea('0x33')]=_[_0x55ea('0x32')](_0x578af0[_0x55ea('0x2e')],qs[_0x55ea('0x34')](_0x24a937[_0x55ea('0x30')][_0x55ea('0x34')]));_0x17d2ad['attributes']=_0x17d2ad[_0x55ea('0x33')]['length']?_0x17d2ad[_0x55ea('0x33')]:_0x578af0['model'];if(_0x24a937[_0x55ea('0x30')]['includeAll']){_0x17d2ad['include']=[{'all':!![]}];}_0x17d2ad=_[_0x55ea('0x3b')]({},_0x17d2ad,_0x24a937[_0x55ea('0x3c')]);return db['Template']['find'](_0x17d2ad)[_0x55ea('0x23')](handleEntityNotFound(_0x59d841,null))[_0x55ea('0x23')](respondWithResult(_0x59d841,null))[_0x55ea('0x41')](handleError(_0x59d841,null));};exports['create']=function(_0x5b00ae,_0x5daaf1){return db['Template']['create'](_0x5b00ae[_0x55ea('0x43')],{})[_0x55ea('0x23')](function(_0x494f80){var _0x45b5ac=_0x5b00ae['user']['get']({'plain':!![]});if(!_0x45b5ac)throw new Error(_0x55ea('0x44'));if(_0x45b5ac[_0x55ea('0x45')]===_0x55ea('0x46')){var _0x33a56a=_0x494f80[_0x55ea('0x24')]({'plain':!![]});var _0x2afb63=_0x55ea('0x47');return db[_0x55ea('0x48')]['find']({'where':{'name':_0x2afb63,'userProfileId':_0x45b5ac[_0x55ea('0x49')]},'raw':!![]})[_0x55ea('0x23')](function(_0x1be59b){if(_0x1be59b&&_0x1be59b[_0x55ea('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x33a56a[_0x55ea('0x27')],'resourceId':_0x33a56a['id'],'type':_0x1be59b[_0x55ea('0x27')],'sectionId':_0x1be59b['id']},{})[_0x55ea('0x23')](function(){return _0x494f80;});}else{return _0x494f80;}})['catch'](function(_0x326ad8){logger[_0x55ea('0x26')](_0x55ea('0x4b'),_0x326ad8);throw _0x326ad8;});}return _0x494f80;})[_0x55ea('0x23')](respondWithResult(_0x5daaf1,0xc9))[_0x55ea('0x41')](handleError(_0x5daaf1,null));};exports[_0x55ea('0x22')]=function(_0x408760,_0x13bf03){if(_0x408760[_0x55ea('0x43')]['id']){delete _0x408760['body']['id'];}return db[_0x55ea('0x2a')][_0x55ea('0x4c')]({'where':{'id':_0x408760[_0x55ea('0x4d')]['id']}})[_0x55ea('0x23')](handleEntityNotFound(_0x13bf03,null))[_0x55ea('0x23')](saveUpdates(_0x408760[_0x55ea('0x43')],null))[_0x55ea('0x23')](respondWithResult(_0x13bf03,null))[_0x55ea('0x41')](handleError(_0x13bf03,null));};exports[_0x55ea('0x25')]=function(_0x50706c,_0x6e2bc9){return db[_0x55ea('0x2a')][_0x55ea('0x4c')]({'where':{'id':_0x50706c[_0x55ea('0x4d')]['id']}})[_0x55ea('0x23')](handleEntityNotFound(_0x6e2bc9,null))['then'](removeEntity(_0x6e2bc9,null))[_0x55ea('0x41')](handleError(_0x6e2bc9,null));};
\ No newline at end of file
index 1553198..53e324c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x493f=['exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes'];(function(_0x4beb42,_0x3066df){var _0x198c48=function(_0x4837fb){while(--_0x4837fb){_0x4beb42['push'](_0x4beb42['shift']());}};_0x198c48(++_0x3066df);}(_0x493f,0x1e2));var _0xf493=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x493f[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xf493('0x0'));var util=require(_0xf493('0x1'));var logger=require(_0xf493('0x2'))(_0xf493('0x3'));var moment=require(_0xf493('0x4'));var BPromise=require(_0xf493('0x5'));var rp=require(_0xf493('0x6'));var fs=require('fs');var path=require(_0xf493('0x7'));var rimraf=require('rimraf');var config=require(_0xf493('0x8'));var attributes=require(_0xf493('0x9'));module[_0xf493('0xa')]=function(_0x476527,_0x14f542){return _0x476527[_0xf493('0xb')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1895=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','define','lodash','util'];(function(_0x257289,_0x290d05){var _0x2f76f7=function(_0x1d4bad){while(--_0x1d4bad){_0x257289['push'](_0x257289['shift']());}};_0x2f76f7(++_0x290d05);}(_0x1895,0x198));var _0x5189=function(_0x344660,_0x1afb71){_0x344660=_0x344660-0x0;var _0x3a52de=_0x1895[_0x344660];return _0x3a52de;};'use strict';var _=require(_0x5189('0x0'));var util=require(_0x5189('0x1'));var logger=require(_0x5189('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5189('0x3'));var rp=require(_0x5189('0x4'));var fs=require('fs');var path=require(_0x5189('0x5'));var rimraf=require(_0x5189('0x6'));var config=require(_0x5189('0x7'));var attributes=require(_0x5189('0x8'));module['exports']=function(_0x4c4821,_0x5d0f9d){return _0x4c4821[_0x5189('0x9')]('Template',attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be0a365..dfbadf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90c4=['client','http','request','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','model','map','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x1a6970,_0xecaee2){var _0x21d9cd=function(_0x5c5794){while(--_0x5c5794){_0x1a6970['push'](_0x1a6970['shift']());}};_0x21d9cd(++_0xecaee2);}(_0x90c4,0x137));var _0x490c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x90c4[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x490c('0x0'));var util=require('util');var moment=require(_0x490c('0x1'));var BPromise=require(_0x490c('0x2'));var rs=require(_0x490c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x490c('0x4'))['db'];var utils=require(_0x490c('0x5'));var logger=require(_0x490c('0x6'))(_0x490c('0x7'));var config=require('../../config/environment');var jayson=require(_0x490c('0x8'));var client=jayson[_0x490c('0x9')][_0x490c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c52ba,_0x15deea,_0x8adca5){return new BPromise(function(_0x2768d0,_0x49bcac){return client[_0x490c('0xb')](_0x4c52ba,_0x8adca5)['then'](function(_0x5a1678){logger[_0x490c('0xc')](_0x490c('0xd'),_0x15deea,_0x490c('0xe'));logger['debug'](_0x490c('0xf'),_0x15deea,_0x490c('0xe'),JSON['stringify'](_0x5a1678));if(_0x5a1678[_0x490c('0x10')]){if(_0x5a1678['error'][_0x490c('0x11')]===0x1f4){logger[_0x490c('0x10')]('Template,\x20%s,\x20%s',_0x15deea,_0x5a1678[_0x490c('0x10')][_0x490c('0x12')]);return _0x49bcac(_0x5a1678[_0x490c('0x10')][_0x490c('0x12')]);}logger[_0x490c('0x10')](_0x490c('0xd'),_0x15deea,_0x5a1678['error'][_0x490c('0x12')]);return _0x2768d0(_0x5a1678[_0x490c('0x10')][_0x490c('0x12')]);}else{logger['info'](_0x490c('0xd'),_0x15deea,'request\x20sent');_0x2768d0(_0x5a1678['result'][_0x490c('0x12')]);}})[_0x490c('0x13')](function(_0x26cc83){logger[_0x490c('0x10')](_0x490c('0xd'),_0x15deea,_0x26cc83);_0x49bcac(_0x26cc83);});});}exports[_0x490c('0x14')]=function(_0x40738d){var _0x3f0401=this;return new Promise(function(_0x4193ef,_0x3940b7){return db[_0x490c('0x15')][_0x490c('0x16')]({'raw':_0x40738d[_0x490c('0x17')]?_0x40738d[_0x490c('0x17')][_0x490c('0x18')]===undefined?!![]:![]:!![],'where':_0x40738d['options']?_0x40738d[_0x490c('0x17')][_0x490c('0x19')]||null:null,'attributes':_0x40738d['options']?_0x40738d[_0x490c('0x17')][_0x490c('0x1a')]||null:null,'limit':_0x40738d[_0x490c('0x17')]?_0x40738d[_0x490c('0x17')][_0x490c('0x1b')]||null:null,'include':_0x40738d[_0x490c('0x17')]?_0x40738d[_0x490c('0x17')][_0x490c('0x1c')]?_['map'](_0x40738d['options'][_0x490c('0x1c')],function(_0x337223){return{'model':db[_0x337223[_0x490c('0x1d')]],'as':_0x337223['as'],'attributes':_0x337223[_0x490c('0x1a')],'include':_0x337223['include']?_[_0x490c('0x1e')](_0x337223['include'],function(_0x51e1a7){return{'model':db[_0x51e1a7[_0x490c('0x1d')]],'as':_0x51e1a7['as'],'attributes':_0x51e1a7[_0x490c('0x1a')],'include':_0x51e1a7[_0x490c('0x1c')]?_[_0x490c('0x1e')](_0x51e1a7[_0x490c('0x1c')],function(_0x28c030){return{'model':db[_0x28c030[_0x490c('0x1d')]],'as':_0x28c030['as'],'attributes':_0x28c030[_0x490c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x490c('0x1f')](function(_0x64798d){logger[_0x490c('0xc')](_0x490c('0x14'),_0x40738d);logger['debug'](_0x490c('0x14'),_0x40738d,JSON['stringify'](_0x64798d));_0x4193ef(_0x64798d);})[_0x490c('0x13')](function(_0x1571b2){logger['error']('GetTemplate',_0x1571b2[_0x490c('0x12')],_0x40738d);_0x3940b7(_0x3f0401['error'](0x1f4,_0x1571b2['message']));});});};
\ No newline at end of file
+var _0x7b9b=['http','request','then','info','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5ead88,_0x126fee){var _0x549603=function(_0x2b85cc){while(--_0x2b85cc){_0x5ead88['push'](_0x5ead88['shift']());}};_0x549603(++_0x126fee);}(_0x7b9b,0x97));var _0xb7b9=function(_0x4c2a73,_0x2835cd){_0x4c2a73=_0x4c2a73-0x0;var _0x121267=_0x7b9b[_0x4c2a73];return _0x121267;};'use strict';var _=require('lodash');var util=require(_0xb7b9('0x0'));var moment=require('moment');var BPromise=require(_0xb7b9('0x1'));var rs=require(_0xb7b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7b9('0x3'))['db'];var utils=require(_0xb7b9('0x4'));var logger=require(_0xb7b9('0x5'))('rpc');var config=require(_0xb7b9('0x6'));var jayson=require(_0xb7b9('0x7'));var client=jayson[_0xb7b9('0x8')][_0xb7b9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37679d,_0x169110,_0x37146e){return new BPromise(function(_0x3e8eae,_0x3a1a56){return client[_0xb7b9('0xa')](_0x37679d,_0x37146e)[_0xb7b9('0xb')](function(_0x3413de){logger[_0xb7b9('0xc')](_0xb7b9('0xd'),_0x169110,'request\x20sent');logger['debug'](_0xb7b9('0xe'),_0x169110,_0xb7b9('0xf'),JSON['stringify'](_0x3413de));if(_0x3413de[_0xb7b9('0x10')]){if(_0x3413de[_0xb7b9('0x10')][_0xb7b9('0x11')]===0x1f4){logger[_0xb7b9('0x10')](_0xb7b9('0xd'),_0x169110,_0x3413de['error'][_0xb7b9('0x12')]);return _0x3a1a56(_0x3413de['error'][_0xb7b9('0x12')]);}logger['error'](_0xb7b9('0xd'),_0x169110,_0x3413de['error']['message']);return _0x3e8eae(_0x3413de[_0xb7b9('0x10')][_0xb7b9('0x12')]);}else{logger[_0xb7b9('0xc')](_0xb7b9('0xd'),_0x169110,'request\x20sent');_0x3e8eae(_0x3413de[_0xb7b9('0x13')]['message']);}})['catch'](function(_0x347cf5){logger[_0xb7b9('0x10')]('Template,\x20%s,\x20%s',_0x169110,_0x347cf5);_0x3a1a56(_0x347cf5);});});}exports[_0xb7b9('0x14')]=function(_0xcde679){var _0x1def6b=this;return new Promise(function(_0x3da58e,_0x1b9dad){return db[_0xb7b9('0x15')][_0xb7b9('0x16')]({'raw':_0xcde679[_0xb7b9('0x17')]?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x18')]===undefined?!![]:![]:!![],'where':_0xcde679[_0xb7b9('0x17')]?_0xcde679['options'][_0xb7b9('0x19')]||null:null,'attributes':_0xcde679['options']?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x1a')]||null:null,'limit':_0xcde679['options']?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x1b')]||null:null,'include':_0xcde679[_0xb7b9('0x17')]?_0xcde679[_0xb7b9('0x17')][_0xb7b9('0x1c')]?_[_0xb7b9('0x1d')](_0xcde679['options'][_0xb7b9('0x1c')],function(_0x2c9b36){return{'model':db[_0x2c9b36[_0xb7b9('0x1e')]],'as':_0x2c9b36['as'],'attributes':_0x2c9b36[_0xb7b9('0x1a')],'include':_0x2c9b36[_0xb7b9('0x1c')]?_[_0xb7b9('0x1d')](_0x2c9b36[_0xb7b9('0x1c')],function(_0x59693a){return{'model':db[_0x59693a[_0xb7b9('0x1e')]],'as':_0x59693a['as'],'attributes':_0x59693a[_0xb7b9('0x1a')],'include':_0x59693a[_0xb7b9('0x1c')]?_['map'](_0x59693a['include'],function(_0x4b3160){return{'model':db[_0x4b3160[_0xb7b9('0x1e')]],'as':_0x4b3160['as'],'attributes':_0x4b3160['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7b9('0xb')](function(_0x2b0153){logger[_0xb7b9('0xc')](_0xb7b9('0x14'),_0xcde679);logger['debug'](_0xb7b9('0x14'),_0xcde679,JSON['stringify'](_0x2b0153));_0x3da58e(_0x2b0153);})[_0xb7b9('0x1f')](function(_0x74051){logger['error']('GetTemplate',_0x74051['message'],_0xcde679);_0x1b9dad(_0x1def6b[_0xb7b9('0x10')](0x1f4,_0x74051[_0xb7b9('0x12')]));});});};
\ No newline at end of file
index a897e8e..dda9e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8721=['post','create','addAllCondition','addAction','put','delete','exports','multer','util','path','Router','../../config/environment','./trigger.controller','get','/:id','isAuthenticated','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x12b7e4,_0x5cc8b3){var _0xce2ecc=function(_0x1df36f){while(--_0x1df36f){_0x12b7e4['push'](_0x12b7e4['shift']());}};_0xce2ecc(++_0x5cc8b3);}(_0x8721,0xd9));var _0x1872=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0x8721[_0x3b96cf];return _0x2e315a;};'use strict';var multer=require(_0x1872('0x0'));var util=require(_0x1872('0x1'));var path=require(_0x1872('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1872('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1872('0x4'));var controller=require(_0x1872('0x5'));router[_0x1872('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1872('0x6')](_0x1872('0x7'),auth[_0x1872('0x8')](),controller['show']);router[_0x1872('0x6')](_0x1872('0x9'),auth[_0x1872('0x8')](),controller[_0x1872('0xa')]);router[_0x1872('0x6')](_0x1872('0xb'),auth[_0x1872('0x8')](),controller[_0x1872('0xc')]);router[_0x1872('0x6')](_0x1872('0xd'),auth[_0x1872('0x8')](),controller['getActions']);router[_0x1872('0xe')]('/',auth[_0x1872('0x8')](),controller[_0x1872('0xf')]);router[_0x1872('0xe')]('/:id/all_conditions',auth[_0x1872('0x8')](),controller[_0x1872('0x10')]);router[_0x1872('0xe')](_0x1872('0xb'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x1872('0xe')](_0x1872('0xd'),auth[_0x1872('0x8')](),controller[_0x1872('0x11')]);router[_0x1872('0x12')](_0x1872('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x1872('0x13')](_0x1872('0x7'),auth[_0x1872('0x8')](),controller['destroy']);module[_0x1872('0x14')]=router;
\ No newline at end of file
+var _0x459c=['destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','show','get','/:id/all_conditions','getAllConditions','getAnyConditions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','/:id/actions','put','delete','/:id'];(function(_0x5d9e18,_0x1c9a53){var _0x3b8cdc=function(_0x512768){while(--_0x512768){_0x5d9e18['push'](_0x5d9e18['shift']());}};_0x3b8cdc(++_0x1c9a53);}(_0x459c,0x12b));var _0xc459=function(_0x3655f1,_0x1be3a1){_0x3655f1=_0x3655f1-0x0;var _0x314d45=_0x459c[_0x3655f1];return _0x314d45;};'use strict';var multer=require('multer');var util=require(_0xc459('0x0'));var path=require('path');var timeout=require(_0xc459('0x1'));var express=require(_0xc459('0x2'));var router=express[_0xc459('0x3')]();var fs_extra=require(_0xc459('0x4'));var auth=require(_0xc459('0x5'));var interaction=require(_0xc459('0x6'));var config=require(_0xc459('0x7'));var controller=require(_0xc459('0x8'));router['get']('/',auth[_0xc459('0x9')](),controller[_0xc459('0xa')]);router['get']('/:id',auth[_0xc459('0x9')](),controller[_0xc459('0xb')]);router[_0xc459('0xc')](_0xc459('0xd'),auth[_0xc459('0x9')](),controller[_0xc459('0xe')]);router[_0xc459('0xc')]('/:id/any_conditions',auth[_0xc459('0x9')](),controller[_0xc459('0xf')]);router[_0xc459('0xc')]('/:id/actions',auth[_0xc459('0x9')](),controller['getActions']);router[_0xc459('0x10')]('/',auth['isAuthenticated'](),controller[_0xc459('0x11')]);router[_0xc459('0x10')](_0xc459('0xd'),auth['isAuthenticated'](),controller[_0xc459('0x12')]);router['post'](_0xc459('0x13'),auth['isAuthenticated'](),controller[_0xc459('0x14')]);router[_0xc459('0x10')](_0xc459('0x15'),auth[_0xc459('0x9')](),controller['addAction']);router[_0xc459('0x16')]('/:id',auth[_0xc459('0x9')](),controller['update']);router[_0xc459('0x17')](_0xc459('0x18'),auth['isAuthenticated'](),controller[_0xc459('0x19')]);module[_0xc459('0x1a')]=router;
\ No newline at end of file
index fc8f280..519ae03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6733=['BOOLEAN','sequelize','STRING'];(function(_0x165995,_0xfcd4a6){var _0x43194d=function(_0x199527){while(--_0x199527){_0x165995['push'](_0x165995['shift']());}};_0x43194d(++_0xfcd4a6);}(_0x6733,0x1cc));var _0x3673=function(_0x368872,_0x149ebd){_0x368872=_0x368872-0x0;var _0x41e45f=_0x6733[_0x368872];return _0x41e45f;};'use strict';var Sequelize=require(_0x3673('0x0'));module['exports']={'name':{'type':Sequelize[_0x3673('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3673('0x1')]},'status':{'type':Sequelize[_0x3673('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x78f6=['STRING','BOOLEAN','sequelize','exports'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x78f6,0x1b6));var _0x678f=function(_0x3f2268,_0x56a740){_0x3f2268=_0x3f2268-0x0;var _0x440412=_0x78f6[_0x3f2268];return _0x440412;};'use strict';var Sequelize=require(_0x678f('0x0'));module[_0x678f('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x678f('0x2')]},'description':{'type':Sequelize[_0x678f('0x2')]},'status':{'type':Sequelize[_0x678f('0x3')],'defaultValue':![]}};
\ No newline at end of file
index dc6b020..54d7803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0017=['hasOwnProperty','getAnyConditions','addAction','Action','getActions','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','Triggers','UserProfileResource','end','error','stack','name','index','map','Trigger','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','update','addAllCondition','Condition','addAnyCondition','TriggerAnyId','findOne','pick','options'];(function(_0x1f0639,_0x1a8d55){var _0x342d8a=function(_0xdf211d){while(--_0xdf211d){_0x1f0639['push'](_0x1f0639['shift']());}};_0x342d8a(++_0x1a8d55);}(_0x0017,0x161));var _0x7001=function(_0x17371c,_0x1a1e9c){_0x17371c=_0x17371c-0x0;var _0x422265=_0x0017[_0x17371c];return _0x422265;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7001('0x0'));var rp=require('request-promise');var moment=require(_0x7001('0x1'));var BPromise=require(_0x7001('0x2'));var Mustache=require(_0x7001('0x3'));var util=require(_0x7001('0x4'));var path=require('path');var sox=require(_0x7001('0x5'));var csv=require(_0x7001('0x6'));var ejs=require(_0x7001('0x7'));var fs=require('fs');var fs_extra=require(_0x7001('0x8'));var _=require(_0x7001('0x9'));var squel=require(_0x7001('0xa'));var crypto=require('crypto');var jsforce=require(_0x7001('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7001('0x6'));var querystring=require('querystring');var Papa=require(_0x7001('0xc'));var Redis=require(_0x7001('0xd'));var authService=require(_0x7001('0xe'));var qs=require(_0x7001('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7001('0x10'));var utils=require('../../config/utils');var config=require(_0x7001('0x11'));var licenseUtil=require(_0x7001('0x12'));var db=require(_0x7001('0x13'))['db'];function respondWithStatusCode(_0x440f9d,_0x5a226d){_0x5a226d=_0x5a226d||0xcc;return function(_0x2b83e6){if(_0x2b83e6){return _0x440f9d[_0x7001('0x14')](_0x5a226d);}return _0x440f9d[_0x7001('0x15')](_0x5a226d)['end']();};}function respondWithResult(_0x182ac5,_0x28967d){_0x28967d=_0x28967d||0xc8;return function(_0x5f29a1){if(_0x5f29a1){return _0x182ac5[_0x7001('0x15')](_0x28967d)[_0x7001('0x16')](_0x5f29a1);}};}function respondWithFilteredResult(_0x2f6205,_0x5cb8f2){return function(_0x8d40e0){if(_0x8d40e0){var _0x180954=typeof _0x5cb8f2[_0x7001('0x17')]==='undefined'&&typeof _0x5cb8f2[_0x7001('0x18')]===_0x7001('0x19');var _0x1f268f=_0x8d40e0[_0x7001('0x1a')];var _0x8f7794=_0x180954?0x0:_0x5cb8f2[_0x7001('0x17')];var _0x5e154a=_0x180954?_0x8d40e0[_0x7001('0x1a')]:_0x5cb8f2['offset']+_0x5cb8f2['limit'];var _0x3db5ad;if(_0x5e154a>=_0x1f268f){_0x5e154a=_0x1f268f;_0x3db5ad=0xc8;}else{_0x3db5ad=0xce;}_0x2f6205[_0x7001('0x15')](_0x3db5ad);return _0x2f6205[_0x7001('0x1b')](_0x7001('0x1c'),_0x8f7794+'-'+_0x5e154a+'/'+_0x1f268f)['json'](_0x8d40e0);}return null;};}function patchUpdates(_0xa530a){return function(_0x115c16){try{jsonpatch['apply'](_0x115c16,_0xa530a,!![]);}catch(_0x32b4fa){return BPromise[_0x7001('0x1d')](_0x32b4fa);}return _0x115c16[_0x7001('0x1e')]();};}function saveUpdates(_0x1dc375,_0xdb039d){return function(_0xc4874f){if(_0xc4874f){return _0xc4874f['update'](_0x1dc375)[_0x7001('0x1f')](function(_0x2637b9){return _0x2637b9;});}return null;};}function removeEntity(_0xba7a85,_0x1e8bcc){return function(_0x3e3d58){if(_0x3e3d58){return _0x3e3d58[_0x7001('0x20')]()[_0x7001('0x1f')](function(){var _0x129519=_0x3e3d58['get']({'plain':!![]});var _0x356d7a=_0x7001('0x21');return db[_0x7001('0x22')][_0x7001('0x20')]({'where':{'type':_0x356d7a,'resourceId':_0x129519['id']}})[_0x7001('0x1f')](function(){return _0x3e3d58;});})[_0x7001('0x1f')](function(){_0xba7a85['status'](0xcc)[_0x7001('0x23')]();});}};}function handleEntityNotFound(_0x8d1872,_0x449d24){return function(_0x356919){if(!_0x356919){_0x8d1872[_0x7001('0x14')](0x194);}return _0x356919;};}function handleError(_0x4c6129,_0x2246fa){_0x2246fa=_0x2246fa||0x1f4;return function(_0x8d2503){logger[_0x7001('0x24')](_0x8d2503[_0x7001('0x25')]);if(_0x8d2503['name']){delete _0x8d2503[_0x7001('0x26')];}_0x4c6129['status'](_0x2246fa)['send'](_0x8d2503);};}exports[_0x7001('0x27')]=function(_0x59ae42,_0xbff795){var _0x531109={},_0x32e530={},_0x177a95={'count':0x0,'rows':[]};var _0x12a604=_[_0x7001('0x28')](db[_0x7001('0x29')][_0x7001('0x2a')],function(_0x3176ce){return{'name':_0x3176ce['fieldName'],'type':_0x3176ce['type'][_0x7001('0x2b')]};});_0x32e530['model']=_[_0x7001('0x28')](_0x12a604,_0x7001('0x26'));_0x32e530[_0x7001('0x2c')]=_[_0x7001('0x2d')](_0x59ae42[_0x7001('0x2c')]);_0x32e530[_0x7001('0x2e')]=_['intersection'](_0x32e530[_0x7001('0x2f')],_0x32e530[_0x7001('0x2c')]);_0x531109[_0x7001('0x30')]=_[_0x7001('0x31')](_0x32e530[_0x7001('0x2f')],qs[_0x7001('0x32')](_0x59ae42[_0x7001('0x2c')]['fields']));_0x531109['attributes']=_0x531109['attributes'][_0x7001('0x33')]?_0x531109['attributes']:_0x32e530[_0x7001('0x2f')];if(!_0x59ae42[_0x7001('0x2c')]['hasOwnProperty'](_0x7001('0x34'))){_0x531109[_0x7001('0x18')]=qs['limit'](_0x59ae42['query'][_0x7001('0x18')]);_0x531109[_0x7001('0x17')]=qs[_0x7001('0x17')](_0x59ae42['query'][_0x7001('0x17')]);}_0x531109[_0x7001('0x35')]=qs['sort'](_0x59ae42[_0x7001('0x2c')][_0x7001('0x36')]);_0x531109[_0x7001('0x37')]=qs['filters'](_['pick'](_0x59ae42[_0x7001('0x2c')],_0x32e530['filters']),_0x12a604);if(_0x59ae42[_0x7001('0x2c')][_0x7001('0x38')]){_0x531109[_0x7001('0x37')]=_[_0x7001('0x39')](_0x531109[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0x12a604,function(_0x191b32){if(_0x191b32[_0x7001('0x3a')]!==_0x7001('0x3b')){var _0x4a719b={};_0x4a719b[_0x191b32[_0x7001('0x26')]]={'$like':'%'+_0x59ae42['query'][_0x7001('0x38')]+'%'};return _0x4a719b;}})});}_0x531109=_['merge']({},_0x531109,_0x59ae42['options']);var _0x5b940b={'where':_0x531109['where']};return db[_0x7001('0x29')][_0x7001('0x1a')](_0x5b940b)[_0x7001('0x1f')](function(_0x5c81d6){_0x177a95[_0x7001('0x1a')]=_0x5c81d6;if(_0x59ae42[_0x7001('0x2c')][_0x7001('0x3c')]){_0x531109[_0x7001('0x3d')]=[{'all':!![]}];}return db[_0x7001('0x29')][_0x7001('0x3e')](_0x531109);})[_0x7001('0x1f')](function(_0x2be04e){_0x177a95['rows']=_0x2be04e;return _0x177a95;})['then'](respondWithFilteredResult(_0xbff795,_0x531109))[_0x7001('0x3f')](handleError(_0xbff795,null));};exports[_0x7001('0x40')]=function(_0x4c124c,_0x1075c8){var _0x392dcc={'raw':![],'where':{'id':_0x4c124c[_0x7001('0x41')]['id']}},_0x163e00={};_0x163e00[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x29')][_0x7001('0x2a')]);_0x163e00[_0x7001('0x2c')]=_[_0x7001('0x2d')](_0x4c124c[_0x7001('0x2c')]);_0x163e00[_0x7001('0x2e')]=_[_0x7001('0x31')](_0x163e00[_0x7001('0x2f')],_0x163e00[_0x7001('0x2c')]);_0x392dcc[_0x7001('0x30')]=_[_0x7001('0x31')](_0x163e00[_0x7001('0x2f')],qs['fields'](_0x4c124c[_0x7001('0x2c')][_0x7001('0x32')]));_0x392dcc[_0x7001('0x30')]=_0x392dcc[_0x7001('0x30')]['length']?_0x392dcc[_0x7001('0x30')]:_0x163e00[_0x7001('0x2f')];if(_0x4c124c[_0x7001('0x2c')][_0x7001('0x3c')]){_0x392dcc[_0x7001('0x3d')]=[{'all':!![]}];}_0x392dcc=_[_0x7001('0x39')]({},_0x392dcc,_0x4c124c['options']);return db['Trigger']['find'](_0x392dcc)[_0x7001('0x1f')](handleEntityNotFound(_0x1075c8,null))['then'](respondWithResult(_0x1075c8,null))['catch'](handleError(_0x1075c8,null));};exports[_0x7001('0x42')]=function(_0x1cd14a,_0x40d4c9){return db[_0x7001('0x29')][_0x7001('0x42')](_0x1cd14a[_0x7001('0x43')],{})[_0x7001('0x1f')](function(_0x5c0928){var _0x2de468=_0x1cd14a['user']['get']({'plain':!![]});if(!_0x2de468)throw new Error(_0x7001('0x44'));if(_0x2de468['role']==='user'){var _0xcfffb7=_0x5c0928[_0x7001('0x45')]({'plain':!![]});var _0x2f05cf=_0x7001('0x21');return db[_0x7001('0x46')][_0x7001('0x47')]({'where':{'name':_0x2f05cf,'userProfileId':_0x2de468[_0x7001('0x48')]},'raw':!![]})[_0x7001('0x1f')](function(_0x3a466e){if(_0x3a466e&&_0x3a466e[_0x7001('0x49')]===0x0){return db[_0x7001('0x22')][_0x7001('0x42')]({'name':_0xcfffb7[_0x7001('0x26')],'resourceId':_0xcfffb7['id'],'type':_0x3a466e[_0x7001('0x26')],'sectionId':_0x3a466e['id']},{})['then'](function(){return _0x5c0928;});}else{return _0x5c0928;}})['catch'](function(_0x556a5a){logger[_0x7001('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x556a5a);throw _0x556a5a;});}return _0x5c0928;})[_0x7001('0x1f')](respondWithResult(_0x40d4c9,0xc9))[_0x7001('0x3f')](handleError(_0x40d4c9,null));};exports[_0x7001('0x4a')]=function(_0x447005,_0x2b08b9){if(_0x447005[_0x7001('0x43')]['id']){delete _0x447005[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')][_0x7001('0x47')]({'where':{'id':_0x447005[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x2b08b9,null))['then'](saveUpdates(_0x447005['body'],null))[_0x7001('0x1f')](respondWithResult(_0x2b08b9,null))[_0x7001('0x3f')](handleError(_0x2b08b9,null));};exports[_0x7001('0x20')]=function(_0x141337,_0x5227af){return db[_0x7001('0x29')][_0x7001('0x47')]({'where':{'id':_0x141337[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x5227af,null))[_0x7001('0x1f')](removeEntity(_0x5227af,null))[_0x7001('0x3f')](handleError(_0x5227af,null));};exports[_0x7001('0x4b')]=function(_0x299346,_0x43ed0e,_0x1ca2cf){if(_0x299346[_0x7001('0x43')]['id']){delete _0x299346[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')]['find']({'where':{'id':_0x299346['params']['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x43ed0e,null))['then'](function(_0x280c03){if(_0x280c03){_0x299346['body']['TriggerAllId']=_0x280c03['id'];return db[_0x7001('0x4c')]['create'](_0x299346['body']);}})[_0x7001('0x1f')](respondWithResult(_0x43ed0e,null))[_0x7001('0x3f')](handleError(_0x43ed0e,null));};exports[_0x7001('0x4d')]=function(_0x33492f,_0x5a3999,_0x28e2ca){if(_0x33492f[_0x7001('0x43')]['id']){delete _0x33492f[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')][_0x7001('0x47')]({'where':{'id':_0x33492f['params']['id']}})['then'](handleEntityNotFound(_0x5a3999,null))['then'](function(_0x19bf96){if(_0x19bf96){_0x33492f[_0x7001('0x43')][_0x7001('0x4e')]=_0x19bf96['id'];return db[_0x7001('0x4c')][_0x7001('0x42')](_0x33492f['body']);}})['then'](respondWithResult(_0x5a3999,null))['catch'](handleError(_0x5a3999,null));};exports['getAllConditions']=function(_0xe97ce5,_0x2d572e,_0x558ca8){var _0x193475={};var _0x4bb75a={};var _0x77fe72;var _0x2f103b;return db[_0x7001('0x29')][_0x7001('0x4f')]({'where':{'id':_0xe97ce5[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x2d572e,null))[_0x7001('0x1f')](function(_0x3e3357){if(_0x3e3357){_0x77fe72=_0x3e3357;_0x4bb75a[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x4c')]['rawAttributes']);_0x4bb75a[_0x7001('0x2c')]=_[_0x7001('0x2d')](_0xe97ce5[_0x7001('0x2c')]);_0x4bb75a['filters']=_['intersection'](_0x4bb75a[_0x7001('0x2f')],_0x4bb75a[_0x7001('0x2c')]);_0x193475[_0x7001('0x30')]=_[_0x7001('0x31')](_0x4bb75a[_0x7001('0x2f')],qs['fields'](_0xe97ce5[_0x7001('0x2c')][_0x7001('0x32')]));_0x193475['attributes']=_0x193475[_0x7001('0x30')]['length']?_0x193475[_0x7001('0x30')]:_0x4bb75a[_0x7001('0x2f')];_0x193475['order']=qs[_0x7001('0x36')](_0xe97ce5['query'][_0x7001('0x36')]);_0x193475[_0x7001('0x37')]=qs['filters'](_[_0x7001('0x50')](_0xe97ce5[_0x7001('0x2c')],_0x4bb75a[_0x7001('0x2e')]));if(_0xe97ce5[_0x7001('0x2c')]['filter']){_0x193475[_0x7001('0x37')]=_[_0x7001('0x39')](_0x193475[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0x193475[_0x7001('0x30')],function(_0x5703d7){var _0x3563f1={};_0x3563f1[_0x5703d7]={'$like':'%'+_0xe97ce5[_0x7001('0x2c')][_0x7001('0x38')]+'%'};return _0x3563f1;})});}_0x193475=_[_0x7001('0x39')]({},_0x193475,_0xe97ce5[_0x7001('0x51')]);return _0x77fe72['getAllConditions'](_0x193475);}})['then'](function(_0x894af4){if(_0x894af4){_0x2f103b=_0x894af4[_0x7001('0x33')];if(!_0xe97ce5[_0x7001('0x2c')][_0x7001('0x52')]('nolimit')){_0x193475[_0x7001('0x18')]=qs[_0x7001('0x18')](_0xe97ce5[_0x7001('0x2c')][_0x7001('0x18')]);_0x193475[_0x7001('0x17')]=qs[_0x7001('0x17')](_0xe97ce5[_0x7001('0x2c')][_0x7001('0x17')]);}return _0x77fe72['getAllConditions'](_0x193475);}})[_0x7001('0x1f')](function(_0x2368da){if(_0x2368da){return _0x2368da?{'count':_0x2f103b,'rows':_0x2368da}:null;}})['then'](respondWithResult(_0x2d572e,null))[_0x7001('0x3f')](handleError(_0x2d572e,null));};exports[_0x7001('0x53')]=function(_0x3bf402,_0x162fc1,_0x12e669){var _0x2fa356={};var _0x439c87={};var _0x57e28e;var _0x20ca8e;return db[_0x7001('0x29')][_0x7001('0x4f')]({'where':{'id':_0x3bf402[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x162fc1,null))[_0x7001('0x1f')](function(_0x3bb0ce){if(_0x3bb0ce){_0x57e28e=_0x3bb0ce;_0x439c87[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x4c')][_0x7001('0x2a')]);_0x439c87[_0x7001('0x2c')]=_['keys'](_0x3bf402['query']);_0x439c87['filters']=_['intersection'](_0x439c87[_0x7001('0x2f')],_0x439c87[_0x7001('0x2c')]);_0x2fa356[_0x7001('0x30')]=_[_0x7001('0x31')](_0x439c87['model'],qs[_0x7001('0x32')](_0x3bf402[_0x7001('0x2c')][_0x7001('0x32')]));_0x2fa356[_0x7001('0x30')]=_0x2fa356['attributes'][_0x7001('0x33')]?_0x2fa356[_0x7001('0x30')]:_0x439c87[_0x7001('0x2f')];_0x2fa356[_0x7001('0x35')]=qs[_0x7001('0x36')](_0x3bf402[_0x7001('0x2c')]['sort']);_0x2fa356[_0x7001('0x37')]=qs[_0x7001('0x2e')](_['pick'](_0x3bf402[_0x7001('0x2c')],_0x439c87[_0x7001('0x2e')]));if(_0x3bf402[_0x7001('0x2c')][_0x7001('0x38')]){_0x2fa356[_0x7001('0x37')]=_['merge'](_0x2fa356[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0x2fa356[_0x7001('0x30')],function(_0xee39f1){var _0x5e06c4={};_0x5e06c4[_0xee39f1]={'$like':'%'+_0x3bf402[_0x7001('0x2c')][_0x7001('0x38')]+'%'};return _0x5e06c4;})});}_0x2fa356=_[_0x7001('0x39')]({},_0x2fa356,_0x3bf402['options']);return _0x57e28e[_0x7001('0x53')](_0x2fa356);}})['then'](function(_0xcc377e){if(_0xcc377e){_0x20ca8e=_0xcc377e['length'];if(!_0x3bf402[_0x7001('0x2c')][_0x7001('0x52')](_0x7001('0x34'))){_0x2fa356[_0x7001('0x18')]=qs[_0x7001('0x18')](_0x3bf402[_0x7001('0x2c')][_0x7001('0x18')]);_0x2fa356[_0x7001('0x17')]=qs[_0x7001('0x17')](_0x3bf402['query'][_0x7001('0x17')]);}return _0x57e28e[_0x7001('0x53')](_0x2fa356);}})['then'](function(_0x258c35){if(_0x258c35){return _0x258c35?{'count':_0x20ca8e,'rows':_0x258c35}:null;}})['then'](respondWithResult(_0x162fc1,null))[_0x7001('0x3f')](handleError(_0x162fc1,null));};exports[_0x7001('0x54')]=function(_0x35abe6,_0x29ddf2,_0x4344c5){if(_0x35abe6['body']['id']){delete _0x35abe6[_0x7001('0x43')]['id'];}return db[_0x7001('0x29')]['find']({'where':{'id':_0x35abe6['params']['id']}})['then'](handleEntityNotFound(_0x29ddf2,null))[_0x7001('0x1f')](function(_0x5ce50a){if(_0x5ce50a){_0x35abe6['body']['TriggerId']=_0x5ce50a['id'];return db[_0x7001('0x55')][_0x7001('0x42')](_0x35abe6['body']);}})[_0x7001('0x1f')](respondWithResult(_0x29ddf2,null))[_0x7001('0x3f')](handleError(_0x29ddf2,null));};exports[_0x7001('0x56')]=function(_0x41a297,_0x4d2410,_0x388a97){var _0xb692a8={};var _0x14ba56={};var _0x4ede06;var _0x4f1cfd;return db[_0x7001('0x29')][_0x7001('0x4f')]({'where':{'id':_0x41a297[_0x7001('0x41')]['id']}})[_0x7001('0x1f')](handleEntityNotFound(_0x4d2410,null))[_0x7001('0x1f')](function(_0x43c596){if(_0x43c596){_0x4ede06=_0x43c596;_0x14ba56[_0x7001('0x2f')]=_[_0x7001('0x2d')](db[_0x7001('0x55')]['rawAttributes']);_0x14ba56[_0x7001('0x2c')]=_['keys'](_0x41a297[_0x7001('0x2c')]);_0x14ba56['filters']=_['intersection'](_0x14ba56['model'],_0x14ba56['query']);_0xb692a8[_0x7001('0x30')]=_['intersection'](_0x14ba56[_0x7001('0x2f')],qs['fields'](_0x41a297[_0x7001('0x2c')]['fields']));_0xb692a8[_0x7001('0x30')]=_0xb692a8[_0x7001('0x30')][_0x7001('0x33')]?_0xb692a8[_0x7001('0x30')]:_0x14ba56[_0x7001('0x2f')];_0xb692a8['order']=qs[_0x7001('0x36')](_0x41a297[_0x7001('0x2c')][_0x7001('0x36')]);_0xb692a8[_0x7001('0x37')]=qs[_0x7001('0x2e')](_['pick'](_0x41a297[_0x7001('0x2c')],_0x14ba56['filters']));if(_0x41a297[_0x7001('0x2c')][_0x7001('0x38')]){_0xb692a8[_0x7001('0x37')]=_[_0x7001('0x39')](_0xb692a8[_0x7001('0x37')],{'$or':_[_0x7001('0x28')](_0xb692a8[_0x7001('0x30')],function(_0x59bff2){var _0x64e63e={};_0x64e63e[_0x59bff2]={'$like':'%'+_0x41a297['query']['filter']+'%'};return _0x64e63e;})});}_0xb692a8=_[_0x7001('0x39')]({},_0xb692a8,_0x41a297[_0x7001('0x51')]);return _0x4ede06[_0x7001('0x56')](_0xb692a8);}})[_0x7001('0x1f')](function(_0x27424b){if(_0x27424b){_0x4f1cfd=_0x27424b['length'];if(!_0x41a297[_0x7001('0x2c')][_0x7001('0x52')](_0x7001('0x34'))){_0xb692a8[_0x7001('0x18')]=qs[_0x7001('0x18')](_0x41a297[_0x7001('0x2c')][_0x7001('0x18')]);_0xb692a8[_0x7001('0x17')]=qs[_0x7001('0x17')](_0x41a297[_0x7001('0x2c')][_0x7001('0x17')]);}return _0x4ede06['getActions'](_0xb692a8);}})[_0x7001('0x1f')](function(_0x43a9b9){if(_0x43a9b9){return _0x43a9b9?{'count':_0x4f1cfd,'rows':_0x43a9b9}:null;}})[_0x7001('0x1f')](respondWithResult(_0x4d2410,null))[_0x7001('0x3f')](handleError(_0x4d2410,null));};
\ No newline at end of file
+var _0x82f0=['sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','keys','query','filters','attributes','model','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','catch','show','intersection','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','pick','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x4dd1d2,_0x368e7){var _0x4ca6fe=function(_0x3439ea){while(--_0x3439ea){_0x4dd1d2['push'](_0x4dd1d2['shift']());}};_0x4ca6fe(++_0x368e7);}(_0x82f0,0xae));var _0x082f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x82f0[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x082f('0x0'));var jsonpatch=require(_0x082f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x082f('0x2'));var Mustache=require(_0x082f('0x3'));var util=require(_0x082f('0x4'));var path=require(_0x082f('0x5'));var sox=require(_0x082f('0x6'));var csv=require(_0x082f('0x7'));var ejs=require(_0x082f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x082f('0x9'));var squel=require('squel');var crypto=require(_0x082f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x082f('0xb'));var toCsv=require(_0x082f('0x7'));var querystring=require(_0x082f('0xc'));var Papa=require(_0x082f('0xd'));var Redis=require(_0x082f('0xe'));var authService=require(_0x082f('0xf'));var qs=require(_0x082f('0x10'));var as=require(_0x082f('0x11'));var hardwareService=require(_0x082f('0x12'));var logger=require(_0x082f('0x13'))('api');var utils=require(_0x082f('0x14'));var config=require(_0x082f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x082f('0x16'))['db'];function respondWithStatusCode(_0x1f7daf,_0x264cab){_0x264cab=_0x264cab||0xcc;return function(_0x43aaab){if(_0x43aaab){return _0x1f7daf[_0x082f('0x17')](_0x264cab);}return _0x1f7daf['status'](_0x264cab)['end']();};}function respondWithResult(_0x35a152,_0x56d5af){_0x56d5af=_0x56d5af||0xc8;return function(_0x5080bd){if(_0x5080bd){return _0x35a152['status'](_0x56d5af)[_0x082f('0x18')](_0x5080bd);}};}function respondWithFilteredResult(_0x4d96d1,_0x52e8fa){return function(_0x42cc2d){if(_0x42cc2d){var _0x4e2293=typeof _0x52e8fa['offset']===_0x082f('0x19')&&typeof _0x52e8fa[_0x082f('0x1a')]===_0x082f('0x19');var _0x2d6882=_0x42cc2d[_0x082f('0x1b')];var _0x100ad1=_0x4e2293?0x0:_0x52e8fa[_0x082f('0x1c')];var _0x4a098c=_0x4e2293?_0x42cc2d['count']:_0x52e8fa[_0x082f('0x1c')]+_0x52e8fa['limit'];var _0x49c185;if(_0x4a098c>=_0x2d6882){_0x4a098c=_0x2d6882;_0x49c185=0xc8;}else{_0x49c185=0xce;}_0x4d96d1[_0x082f('0x1d')](_0x49c185);return _0x4d96d1[_0x082f('0x1e')](_0x082f('0x1f'),_0x100ad1+'-'+_0x4a098c+'/'+_0x2d6882)[_0x082f('0x18')](_0x42cc2d);}return null;};}function patchUpdates(_0x2df6f3){return function(_0x2274fa){try{jsonpatch[_0x082f('0x20')](_0x2274fa,_0x2df6f3,!![]);}catch(_0x30eb43){return BPromise[_0x082f('0x21')](_0x30eb43);}return _0x2274fa[_0x082f('0x22')]();};}function saveUpdates(_0x3179f7,_0x11d851){return function(_0xac8175){if(_0xac8175){return _0xac8175[_0x082f('0x23')](_0x3179f7)['then'](function(_0x5c0e4a){return _0x5c0e4a;});}return null;};}function removeEntity(_0x57f5bd,_0x54ad38){return function(_0x153bdd){if(_0x153bdd){return _0x153bdd[_0x082f('0x24')]()[_0x082f('0x25')](function(){var _0x86834e=_0x153bdd[_0x082f('0x26')]({'plain':!![]});var _0x117200='Triggers';return db[_0x082f('0x27')][_0x082f('0x24')]({'where':{'type':_0x117200,'resourceId':_0x86834e['id']}})[_0x082f('0x25')](function(){return _0x153bdd;});})[_0x082f('0x25')](function(){_0x57f5bd['status'](0xcc)[_0x082f('0x28')]();});}};}function handleEntityNotFound(_0x4080a7,_0x51c303){return function(_0x584930){if(!_0x584930){_0x4080a7[_0x082f('0x17')](0x194);}return _0x584930;};}function handleError(_0x389bca,_0x5959db){_0x5959db=_0x5959db||0x1f4;return function(_0x36d8c1){logger['error'](_0x36d8c1[_0x082f('0x29')]);if(_0x36d8c1[_0x082f('0x2a')]){delete _0x36d8c1[_0x082f('0x2a')];}_0x389bca[_0x082f('0x1d')](_0x5959db)[_0x082f('0x2b')](_0x36d8c1);};}exports[_0x082f('0x2c')]=function(_0x2a9c97,_0x34ee82){var _0xe8d0d1={},_0x17a46d={},_0xc8519a={'count':0x0,'rows':[]};var _0x2232ba=_[_0x082f('0x2d')](db[_0x082f('0x2e')][_0x082f('0x2f')],function(_0xcc575c){return{'name':_0xcc575c['fieldName'],'type':_0xcc575c['type']['key']};});_0x17a46d['model']=_[_0x082f('0x2d')](_0x2232ba,_0x082f('0x2a'));_0x17a46d['query']=_[_0x082f('0x30')](_0x2a9c97[_0x082f('0x31')]);_0x17a46d[_0x082f('0x32')]=_['intersection'](_0x17a46d['model'],_0x17a46d['query']);_0xe8d0d1[_0x082f('0x33')]=_['intersection'](_0x17a46d[_0x082f('0x34')],qs[_0x082f('0x35')](_0x2a9c97[_0x082f('0x31')][_0x082f('0x35')]));_0xe8d0d1['attributes']=_0xe8d0d1[_0x082f('0x33')][_0x082f('0x36')]?_0xe8d0d1[_0x082f('0x33')]:_0x17a46d[_0x082f('0x34')];if(!_0x2a9c97[_0x082f('0x31')]['hasOwnProperty'](_0x082f('0x37'))){_0xe8d0d1['limit']=qs['limit'](_0x2a9c97['query'][_0x082f('0x1a')]);_0xe8d0d1[_0x082f('0x1c')]=qs[_0x082f('0x1c')](_0x2a9c97[_0x082f('0x31')]['offset']);}_0xe8d0d1[_0x082f('0x38')]=qs[_0x082f('0x39')](_0x2a9c97[_0x082f('0x31')][_0x082f('0x39')]);_0xe8d0d1['where']=qs['filters'](_['pick'](_0x2a9c97[_0x082f('0x31')],_0x17a46d[_0x082f('0x32')]),_0x2232ba);if(_0x2a9c97[_0x082f('0x31')][_0x082f('0x3a')]){_0xe8d0d1[_0x082f('0x3b')]=_[_0x082f('0x3c')](_0xe8d0d1['where'],{'$or':_[_0x082f('0x2d')](_0x2232ba,function(_0x22a728){if(_0x22a728['type']!==_0x082f('0x3d')){var _0x39e9fa={};_0x39e9fa[_0x22a728[_0x082f('0x2a')]]={'$like':'%'+_0x2a9c97['query']['filter']+'%'};return _0x39e9fa;}})});}_0xe8d0d1=_[_0x082f('0x3c')]({},_0xe8d0d1,_0x2a9c97['options']);var _0x5c1f5d={'where':_0xe8d0d1[_0x082f('0x3b')]};return db[_0x082f('0x2e')][_0x082f('0x1b')](_0x5c1f5d)[_0x082f('0x25')](function(_0x404979){_0xc8519a[_0x082f('0x1b')]=_0x404979;if(_0x2a9c97[_0x082f('0x31')][_0x082f('0x3e')]){_0xe8d0d1['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0xe8d0d1);})['then'](function(_0x18d604){_0xc8519a['rows']=_0x18d604;return _0xc8519a;})[_0x082f('0x25')](respondWithFilteredResult(_0x34ee82,_0xe8d0d1))[_0x082f('0x3f')](handleError(_0x34ee82,null));};exports[_0x082f('0x40')]=function(_0x36712b,_0x1e8cc5){var _0x491f2d={'raw':![],'where':{'id':_0x36712b['params']['id']}},_0x4003ca={};_0x4003ca[_0x082f('0x34')]=_['keys'](db[_0x082f('0x2e')]['rawAttributes']);_0x4003ca[_0x082f('0x31')]=_[_0x082f('0x30')](_0x36712b[_0x082f('0x31')]);_0x4003ca[_0x082f('0x32')]=_[_0x082f('0x41')](_0x4003ca[_0x082f('0x34')],_0x4003ca[_0x082f('0x31')]);_0x491f2d[_0x082f('0x33')]=_[_0x082f('0x41')](_0x4003ca[_0x082f('0x34')],qs[_0x082f('0x35')](_0x36712b[_0x082f('0x31')][_0x082f('0x35')]));_0x491f2d['attributes']=_0x491f2d[_0x082f('0x33')][_0x082f('0x36')]?_0x491f2d[_0x082f('0x33')]:_0x4003ca[_0x082f('0x34')];if(_0x36712b[_0x082f('0x31')][_0x082f('0x3e')]){_0x491f2d[_0x082f('0x42')]=[{'all':!![]}];}_0x491f2d=_['merge']({},_0x491f2d,_0x36712b[_0x082f('0x43')]);return db[_0x082f('0x2e')][_0x082f('0x44')](_0x491f2d)[_0x082f('0x25')](handleEntityNotFound(_0x1e8cc5,null))[_0x082f('0x25')](respondWithResult(_0x1e8cc5,null))['catch'](handleError(_0x1e8cc5,null));};exports[_0x082f('0x45')]=function(_0x4c4f52,_0x49a60b){return db['Trigger'][_0x082f('0x45')](_0x4c4f52[_0x082f('0x46')],{})[_0x082f('0x25')](function(_0x41b4a8){var _0x51f462=_0x4c4f52[_0x082f('0x47')][_0x082f('0x26')]({'plain':!![]});if(!_0x51f462)throw new Error(_0x082f('0x48'));if(_0x51f462['role']===_0x082f('0x47')){var _0x35d644=_0x41b4a8[_0x082f('0x26')]({'plain':!![]});var _0x1aa9d3='Triggers';return db[_0x082f('0x49')]['find']({'where':{'name':_0x1aa9d3,'userProfileId':_0x51f462['userProfileId']},'raw':!![]})[_0x082f('0x25')](function(_0x5c54c1){if(_0x5c54c1&&_0x5c54c1['autoAssociation']===0x0){return db['UserProfileResource'][_0x082f('0x45')]({'name':_0x35d644[_0x082f('0x2a')],'resourceId':_0x35d644['id'],'type':_0x5c54c1['name'],'sectionId':_0x5c54c1['id']},{})['then'](function(){return _0x41b4a8;});}else{return _0x41b4a8;}})[_0x082f('0x3f')](function(_0x558df2){logger[_0x082f('0x4a')](_0x082f('0x4b'),_0x558df2);throw _0x558df2;});}return _0x41b4a8;})['then'](respondWithResult(_0x49a60b,0xc9))[_0x082f('0x3f')](handleError(_0x49a60b,null));};exports[_0x082f('0x23')]=function(_0x10acf4,_0x45d728){if(_0x10acf4[_0x082f('0x46')]['id']){delete _0x10acf4[_0x082f('0x46')]['id'];}return db[_0x082f('0x2e')][_0x082f('0x44')]({'where':{'id':_0x10acf4[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x45d728,null))[_0x082f('0x25')](saveUpdates(_0x10acf4['body'],null))[_0x082f('0x25')](respondWithResult(_0x45d728,null))[_0x082f('0x3f')](handleError(_0x45d728,null));};exports[_0x082f('0x24')]=function(_0x3f8f39,_0xddc327){return db[_0x082f('0x2e')]['find']({'where':{'id':_0x3f8f39[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0xddc327,null))[_0x082f('0x25')](removeEntity(_0xddc327,null))['catch'](handleError(_0xddc327,null));};exports[_0x082f('0x4d')]=function(_0x4e529a,_0x346508,_0x399886){if(_0x4e529a[_0x082f('0x46')]['id']){delete _0x4e529a[_0x082f('0x46')]['id'];}return db['Trigger'][_0x082f('0x44')]({'where':{'id':_0x4e529a[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x346508,null))[_0x082f('0x25')](function(_0x523cae){if(_0x523cae){_0x4e529a[_0x082f('0x46')][_0x082f('0x4e')]=_0x523cae['id'];return db[_0x082f('0x4f')][_0x082f('0x45')](_0x4e529a['body']);}})['then'](respondWithResult(_0x346508,null))[_0x082f('0x3f')](handleError(_0x346508,null));};exports['addAnyCondition']=function(_0x2b1285,_0x2f2caf,_0x5ee7fb){if(_0x2b1285['body']['id']){delete _0x2b1285['body']['id'];}return db[_0x082f('0x2e')][_0x082f('0x44')]({'where':{'id':_0x2b1285[_0x082f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2f2caf,null))['then'](function(_0x47262b){if(_0x47262b){_0x2b1285[_0x082f('0x46')][_0x082f('0x50')]=_0x47262b['id'];return db['Condition'][_0x082f('0x45')](_0x2b1285[_0x082f('0x46')]);}})[_0x082f('0x25')](respondWithResult(_0x2f2caf,null))['catch'](handleError(_0x2f2caf,null));};exports[_0x082f('0x51')]=function(_0x57e041,_0x11fbff,_0x2d366e){var _0x308b53={};var _0x46af1a={};var _0x3a97d9;var _0x581363;return db[_0x082f('0x2e')][_0x082f('0x52')]({'where':{'id':_0x57e041[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x11fbff,null))['then'](function(_0x2d3440){if(_0x2d3440){_0x3a97d9=_0x2d3440;_0x46af1a[_0x082f('0x34')]=_[_0x082f('0x30')](db['Condition'][_0x082f('0x2f')]);_0x46af1a[_0x082f('0x31')]=_['keys'](_0x57e041['query']);_0x46af1a['filters']=_[_0x082f('0x41')](_0x46af1a['model'],_0x46af1a[_0x082f('0x31')]);_0x308b53[_0x082f('0x33')]=_[_0x082f('0x41')](_0x46af1a[_0x082f('0x34')],qs[_0x082f('0x35')](_0x57e041['query'][_0x082f('0x35')]));_0x308b53[_0x082f('0x33')]=_0x308b53[_0x082f('0x33')][_0x082f('0x36')]?_0x308b53[_0x082f('0x33')]:_0x46af1a[_0x082f('0x34')];_0x308b53[_0x082f('0x38')]=qs[_0x082f('0x39')](_0x57e041['query']['sort']);_0x308b53[_0x082f('0x3b')]=qs[_0x082f('0x32')](_[_0x082f('0x53')](_0x57e041[_0x082f('0x31')],_0x46af1a[_0x082f('0x32')]));if(_0x57e041[_0x082f('0x31')][_0x082f('0x3a')]){_0x308b53[_0x082f('0x3b')]=_[_0x082f('0x3c')](_0x308b53[_0x082f('0x3b')],{'$or':_[_0x082f('0x2d')](_0x308b53[_0x082f('0x33')],function(_0x1cc20c){var _0x14b69b={};_0x14b69b[_0x1cc20c]={'$like':'%'+_0x57e041['query']['filter']+'%'};return _0x14b69b;})});}_0x308b53=_[_0x082f('0x3c')]({},_0x308b53,_0x57e041['options']);return _0x3a97d9['getAllConditions'](_0x308b53);}})[_0x082f('0x25')](function(_0x4abc96){if(_0x4abc96){_0x581363=_0x4abc96[_0x082f('0x36')];if(!_0x57e041[_0x082f('0x31')][_0x082f('0x54')](_0x082f('0x37'))){_0x308b53[_0x082f('0x1a')]=qs[_0x082f('0x1a')](_0x57e041[_0x082f('0x31')][_0x082f('0x1a')]);_0x308b53['offset']=qs[_0x082f('0x1c')](_0x57e041['query'][_0x082f('0x1c')]);}return _0x3a97d9[_0x082f('0x51')](_0x308b53);}})[_0x082f('0x25')](function(_0xd0d643){if(_0xd0d643){return _0xd0d643?{'count':_0x581363,'rows':_0xd0d643}:null;}})[_0x082f('0x25')](respondWithResult(_0x11fbff,null))[_0x082f('0x3f')](handleError(_0x11fbff,null));};exports[_0x082f('0x55')]=function(_0x373a67,_0x1b41a1,_0x1632b8){var _0x4f3fdb={};var _0x3cfdbc={};var _0x1afbea;var _0x4b4d40;return db[_0x082f('0x2e')]['findOne']({'where':{'id':_0x373a67[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x1b41a1,null))[_0x082f('0x25')](function(_0xef1fd0){if(_0xef1fd0){_0x1afbea=_0xef1fd0;_0x3cfdbc['model']=_[_0x082f('0x30')](db['Condition'][_0x082f('0x2f')]);_0x3cfdbc['query']=_['keys'](_0x373a67[_0x082f('0x31')]);_0x3cfdbc[_0x082f('0x32')]=_[_0x082f('0x41')](_0x3cfdbc[_0x082f('0x34')],_0x3cfdbc[_0x082f('0x31')]);_0x4f3fdb[_0x082f('0x33')]=_['intersection'](_0x3cfdbc[_0x082f('0x34')],qs[_0x082f('0x35')](_0x373a67[_0x082f('0x31')][_0x082f('0x35')]));_0x4f3fdb[_0x082f('0x33')]=_0x4f3fdb[_0x082f('0x33')][_0x082f('0x36')]?_0x4f3fdb['attributes']:_0x3cfdbc[_0x082f('0x34')];_0x4f3fdb[_0x082f('0x38')]=qs[_0x082f('0x39')](_0x373a67[_0x082f('0x31')][_0x082f('0x39')]);_0x4f3fdb[_0x082f('0x3b')]=qs['filters'](_[_0x082f('0x53')](_0x373a67['query'],_0x3cfdbc[_0x082f('0x32')]));if(_0x373a67[_0x082f('0x31')][_0x082f('0x3a')]){_0x4f3fdb[_0x082f('0x3b')]=_[_0x082f('0x3c')](_0x4f3fdb[_0x082f('0x3b')],{'$or':_[_0x082f('0x2d')](_0x4f3fdb['attributes'],function(_0x1cc6a1){var _0x3a6a75={};_0x3a6a75[_0x1cc6a1]={'$like':'%'+_0x373a67[_0x082f('0x31')][_0x082f('0x3a')]+'%'};return _0x3a6a75;})});}_0x4f3fdb=_[_0x082f('0x3c')]({},_0x4f3fdb,_0x373a67[_0x082f('0x43')]);return _0x1afbea[_0x082f('0x55')](_0x4f3fdb);}})[_0x082f('0x25')](function(_0x62cff2){if(_0x62cff2){_0x4b4d40=_0x62cff2[_0x082f('0x36')];if(!_0x373a67[_0x082f('0x31')]['hasOwnProperty'](_0x082f('0x37'))){_0x4f3fdb[_0x082f('0x1a')]=qs[_0x082f('0x1a')](_0x373a67[_0x082f('0x31')][_0x082f('0x1a')]);_0x4f3fdb['offset']=qs['offset'](_0x373a67['query'][_0x082f('0x1c')]);}return _0x1afbea[_0x082f('0x55')](_0x4f3fdb);}})['then'](function(_0x311bdc){if(_0x311bdc){return _0x311bdc?{'count':_0x4b4d40,'rows':_0x311bdc}:null;}})['then'](respondWithResult(_0x1b41a1,null))[_0x082f('0x3f')](handleError(_0x1b41a1,null));};exports[_0x082f('0x56')]=function(_0x2e5c51,_0x57ddcf,_0x24a67b){if(_0x2e5c51[_0x082f('0x46')]['id']){delete _0x2e5c51['body']['id'];}return db['Trigger'][_0x082f('0x44')]({'where':{'id':_0x2e5c51[_0x082f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x57ddcf,null))[_0x082f('0x25')](function(_0x3cda89){if(_0x3cda89){_0x2e5c51[_0x082f('0x46')][_0x082f('0x57')]=_0x3cda89['id'];return db[_0x082f('0x58')][_0x082f('0x45')](_0x2e5c51['body']);}})[_0x082f('0x25')](respondWithResult(_0x57ddcf,null))[_0x082f('0x3f')](handleError(_0x57ddcf,null));};exports[_0x082f('0x59')]=function(_0xd2eced,_0x3cd905,_0x3cf741){var _0xcfa64f={};var _0x5d7899={};var _0x5b8fb9;var _0x6a9873;return db['Trigger'][_0x082f('0x52')]({'where':{'id':_0xd2eced[_0x082f('0x4c')]['id']}})[_0x082f('0x25')](handleEntityNotFound(_0x3cd905,null))[_0x082f('0x25')](function(_0x1b0a22){if(_0x1b0a22){_0x5b8fb9=_0x1b0a22;_0x5d7899['model']=_[_0x082f('0x30')](db[_0x082f('0x58')]['rawAttributes']);_0x5d7899[_0x082f('0x31')]=_['keys'](_0xd2eced[_0x082f('0x31')]);_0x5d7899['filters']=_['intersection'](_0x5d7899[_0x082f('0x34')],_0x5d7899[_0x082f('0x31')]);_0xcfa64f['attributes']=_[_0x082f('0x41')](_0x5d7899[_0x082f('0x34')],qs['fields'](_0xd2eced[_0x082f('0x31')][_0x082f('0x35')]));_0xcfa64f[_0x082f('0x33')]=_0xcfa64f['attributes'][_0x082f('0x36')]?_0xcfa64f[_0x082f('0x33')]:_0x5d7899['model'];_0xcfa64f[_0x082f('0x38')]=qs[_0x082f('0x39')](_0xd2eced[_0x082f('0x31')][_0x082f('0x39')]);_0xcfa64f['where']=qs[_0x082f('0x32')](_['pick'](_0xd2eced['query'],_0x5d7899['filters']));if(_0xd2eced[_0x082f('0x31')]['filter']){_0xcfa64f[_0x082f('0x3b')]=_['merge'](_0xcfa64f[_0x082f('0x3b')],{'$or':_['map'](_0xcfa64f['attributes'],function(_0x11976c){var _0x1ed976={};_0x1ed976[_0x11976c]={'$like':'%'+_0xd2eced[_0x082f('0x31')][_0x082f('0x3a')]+'%'};return _0x1ed976;})});}_0xcfa64f=_[_0x082f('0x3c')]({},_0xcfa64f,_0xd2eced['options']);return _0x5b8fb9[_0x082f('0x59')](_0xcfa64f);}})['then'](function(_0xde63ff){if(_0xde63ff){_0x6a9873=_0xde63ff[_0x082f('0x36')];if(!_0xd2eced[_0x082f('0x31')][_0x082f('0x54')](_0x082f('0x37'))){_0xcfa64f[_0x082f('0x1a')]=qs[_0x082f('0x1a')](_0xd2eced['query'][_0x082f('0x1a')]);_0xcfa64f[_0x082f('0x1c')]=qs[_0x082f('0x1c')](_0xd2eced[_0x082f('0x31')][_0x082f('0x1c')]);}return _0x5b8fb9['getActions'](_0xcfa64f);}})[_0x082f('0x25')](function(_0x13f156){if(_0x13f156){return _0x13f156?{'count':_0x6a9873,'rows':_0x13f156}:null;}})[_0x082f('0x25')](respondWithResult(_0x3cd905,null))[_0x082f('0x3f')](handleError(_0x3cd905,null));};
\ No newline at end of file
index 2f10dc3..0e21100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8388=['path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x564b80,_0x1e201b){var _0x31b5d0=function(_0x35c09c){while(--_0x35c09c){_0x564b80['push'](_0x564b80['shift']());}};_0x31b5d0(++_0x1e201b);}(_0x8388,0x18d));var _0x8838=function(_0xb0fe92,_0x147e42){_0xb0fe92=_0xb0fe92-0x0;var _0x41787f=_0x8388[_0xb0fe92];return _0x41787f;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var logger=require(_0x8838('0x2'))(_0x8838('0x3'));var moment=require('moment');var BPromise=require(_0x8838('0x4'));var rp=require(_0x8838('0x5'));var fs=require('fs');var path=require(_0x8838('0x6'));var rimraf=require(_0x8838('0x7'));var config=require(_0x8838('0x8'));var attributes=require('./trigger.attributes');module[_0x8838('0x9')]=function(_0x471568,_0x49cac2){return _0x471568[_0x8838('0xa')](_0x8838('0xb'),attributes,{'tableName':_0x8838('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x861c=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x461628,_0x4d27c6){var _0x572414=function(_0x17d5a2){while(--_0x17d5a2){_0x461628['push'](_0x461628['shift']());}};_0x572414(++_0x4d27c6);}(_0x861c,0xdb));var _0xc861=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x861c[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xc861('0x0'));var util=require(_0xc861('0x1'));var logger=require(_0xc861('0x2'))(_0xc861('0x3'));var moment=require(_0xc861('0x4'));var BPromise=require(_0xc861('0x5'));var rp=require(_0xc861('0x6'));var fs=require('fs');var path=require(_0xc861('0x7'));var rimraf=require(_0xc861('0x8'));var config=require(_0xc861('0x9'));var attributes=require(_0xc861('0xa'));module[_0xc861('0xb')]=function(_0x562f12,_0xc3b5fd){return _0x562f12[_0xc861('0xc')](_0xc861('0xd'),attributes,{'tableName':_0xc861('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2393238..05fc2a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9319=['options','where','attributes','limit','include','map','model','stringify','ShowTrigger','find','catch','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','GetTrigger','Trigger'];(function(_0x39834d,_0x4fa4c8){var _0x336d1c=function(_0x5be459){while(--_0x5be459){_0x39834d['push'](_0x39834d['shift']());}};_0x336d1c(++_0x4fa4c8);}(_0x9319,0x87));var _0x9931=function(_0x52f729,_0x276346){_0x52f729=_0x52f729-0x0;var _0x10030b=_0x9319[_0x52f729];return _0x10030b;};'use strict';var _=require('lodash');var util=require(_0x9931('0x0'));var moment=require(_0x9931('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9931('0x2'));var db=require(_0x9931('0x3'))['db'];var utils=require(_0x9931('0x4'));var logger=require('../../config/logger')(_0x9931('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9931('0x6')][_0x9931('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23200b,_0x3a2881,_0x100b7a){return new BPromise(function(_0xe467f0,_0x147cb5){return client[_0x9931('0x8')](_0x23200b,_0x100b7a)[_0x9931('0x9')](function(_0x2a49db){logger[_0x9931('0xa')](_0x9931('0xb'),_0x3a2881,_0x9931('0xc'));logger[_0x9931('0xd')](_0x9931('0xe'),_0x3a2881,_0x9931('0xc'),JSON['stringify'](_0x2a49db));if(_0x2a49db[_0x9931('0xf')]){if(_0x2a49db[_0x9931('0xf')][_0x9931('0x10')]===0x1f4){logger['error'](_0x9931('0xb'),_0x3a2881,_0x2a49db[_0x9931('0xf')]['message']);return _0x147cb5(_0x2a49db['error'][_0x9931('0x11')]);}logger[_0x9931('0xf')](_0x9931('0xb'),_0x3a2881,_0x2a49db[_0x9931('0xf')]['message']);return _0xe467f0(_0x2a49db[_0x9931('0xf')]['message']);}else{logger[_0x9931('0xa')]('Trigger,\x20%s,\x20%s',_0x3a2881,_0x9931('0xc'));_0xe467f0(_0x2a49db['result']['message']);}})['catch'](function(_0x5ef5bb){logger[_0x9931('0xf')](_0x9931('0xb'),_0x3a2881,_0x5ef5bb);_0x147cb5(_0x5ef5bb);});});}exports[_0x9931('0x12')]=function(_0x5ca5c5){var _0x5061c8=this;return new Promise(function(_0x35db31,_0x21a936){return db[_0x9931('0x13')]['findAll']({'raw':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ca5c5['options']?_0x5ca5c5['options'][_0x9931('0x15')]||null:null,'attributes':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5['options'][_0x9931('0x16')]||null:null,'limit':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5[_0x9931('0x14')][_0x9931('0x17')]||null:null,'include':_0x5ca5c5[_0x9931('0x14')]?_0x5ca5c5[_0x9931('0x14')][_0x9931('0x18')]?_[_0x9931('0x19')](_0x5ca5c5[_0x9931('0x14')]['include'],function(_0x2e4f2b){return{'model':db[_0x2e4f2b[_0x9931('0x1a')]],'as':_0x2e4f2b['as'],'attributes':_0x2e4f2b['attributes'],'include':_0x2e4f2b['include']?_['map'](_0x2e4f2b[_0x9931('0x18')],function(_0x768db4){return{'model':db[_0x768db4[_0x9931('0x1a')]],'as':_0x768db4['as'],'attributes':_0x768db4[_0x9931('0x16')],'include':_0x768db4['include']?_[_0x9931('0x19')](_0x768db4['include'],function(_0x507b73){return{'model':db[_0x507b73[_0x9931('0x1a')]],'as':_0x507b73['as'],'attributes':_0x507b73[_0x9931('0x16')]};}):[]};}):[]};}):[]:[]})[_0x9931('0x9')](function(_0x4cd9a0){logger[_0x9931('0xa')](_0x9931('0x12'),_0x5ca5c5);logger[_0x9931('0xd')](_0x9931('0x12'),_0x5ca5c5,JSON[_0x9931('0x1b')](_0x4cd9a0));_0x35db31(_0x4cd9a0);})['catch'](function(_0x39d13a){logger[_0x9931('0xf')](_0x9931('0x12'),_0x39d13a[_0x9931('0x11')],_0x5ca5c5);_0x21a936(_0x5061c8['error'](0x1f4,_0x39d13a[_0x9931('0x11')]));});});};exports[_0x9931('0x1c')]=function(_0xfa3c30){var _0x34f8aa=this;return new Promise(function(_0x479228,_0x337557){return db['Trigger'][_0x9931('0x1d')]({'raw':_0xfa3c30[_0x9931('0x14')]?_0xfa3c30[_0x9931('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0xfa3c30['options']?_0xfa3c30['options'][_0x9931('0x15')]||null:null,'attributes':_0xfa3c30[_0x9931('0x14')]?_0xfa3c30[_0x9931('0x14')][_0x9931('0x16')]||null:null,'include':_0xfa3c30['options']?_0xfa3c30['options'][_0x9931('0x18')]?_[_0x9931('0x19')](_0xfa3c30[_0x9931('0x14')][_0x9931('0x18')],function(_0x11be44){return{'model':db[_0x11be44[_0x9931('0x1a')]],'as':_0x11be44['as'],'attributes':_0x11be44[_0x9931('0x16')],'include':_0x11be44['include']?_['map'](_0x11be44[_0x9931('0x18')],function(_0x108eea){return{'model':db[_0x108eea['model']],'as':_0x108eea['as'],'attributes':_0x108eea[_0x9931('0x16')],'include':_0x108eea[_0x9931('0x18')]?_[_0x9931('0x19')](_0x108eea[_0x9931('0x18')],function(_0x3536a0){return{'model':db[_0x3536a0[_0x9931('0x1a')]],'as':_0x3536a0['as'],'attributes':_0x3536a0['attributes']};}):[]};}):[]};}):[]:[]})[_0x9931('0x9')](function(_0x2104e7){logger['info'](_0x9931('0x1c'),_0xfa3c30);logger[_0x9931('0xd')]('ShowTrigger',_0xfa3c30,JSON[_0x9931('0x1b')](_0x2104e7));_0x479228(_0x2104e7);})[_0x9931('0x1e')](function(_0xf4798e){logger[_0x9931('0xf')](_0x9931('0x1c'),_0xf4798e[_0x9931('0x11')],_0xfa3c30);_0x337557(_0x34f8aa[_0x9931('0xf')](0x1f4,_0xf4798e[_0x9931('0x11')]));});});};
\ No newline at end of file
+var _0xc4ea=['find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowTrigger'];(function(_0x6d394d,_0x185b80){var _0x1f0621=function(_0x2e5c81){while(--_0x2e5c81){_0x6d394d['push'](_0x6d394d['shift']());}};_0x1f0621(++_0x185b80);}(_0xc4ea,0x15f));var _0xac4e=function(_0x230bd0,_0x504acc){_0x230bd0=_0x230bd0-0x0;var _0x7a46d9=_0xc4ea[_0x230bd0];return _0x7a46d9;};'use strict';var _=require(_0xac4e('0x0'));var util=require(_0xac4e('0x1'));var moment=require(_0xac4e('0x2'));var BPromise=require(_0xac4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac4e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xac4e('0x5'));var logger=require(_0xac4e('0x6'))(_0xac4e('0x7'));var config=require('../../config/environment');var jayson=require(_0xac4e('0x8'));var client=jayson[_0xac4e('0x9')][_0xac4e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ac755,_0x1c0f79,_0x47fc23){return new BPromise(function(_0x34fd7b,_0x1e421a){return client[_0xac4e('0xb')](_0x2ac755,_0x47fc23)[_0xac4e('0xc')](function(_0x10b858){logger[_0xac4e('0xd')](_0xac4e('0xe'),_0x1c0f79,_0xac4e('0xf'));logger[_0xac4e('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x1c0f79,_0xac4e('0xf'),JSON[_0xac4e('0x11')](_0x10b858));if(_0x10b858[_0xac4e('0x12')]){if(_0x10b858['error']['code']===0x1f4){logger['error'](_0xac4e('0xe'),_0x1c0f79,_0x10b858[_0xac4e('0x12')]['message']);return _0x1e421a(_0x10b858['error']['message']);}logger['error'](_0xac4e('0xe'),_0x1c0f79,_0x10b858['error'][_0xac4e('0x13')]);return _0x34fd7b(_0x10b858[_0xac4e('0x12')][_0xac4e('0x13')]);}else{logger[_0xac4e('0xd')](_0xac4e('0xe'),_0x1c0f79,_0xac4e('0xf'));_0x34fd7b(_0x10b858[_0xac4e('0x14')][_0xac4e('0x13')]);}})['catch'](function(_0x287955){logger[_0xac4e('0x12')]('Trigger,\x20%s,\x20%s',_0x1c0f79,_0x287955);_0x1e421a(_0x287955);});});}exports[_0xac4e('0x15')]=function(_0x26460f){var _0x75271=this;return new Promise(function(_0x4bcf84,_0x27d6b9){return db[_0xac4e('0x16')][_0xac4e('0x17')]({'raw':_0x26460f[_0xac4e('0x18')]?_0x26460f[_0xac4e('0x18')][_0xac4e('0x19')]===undefined?!![]:![]:!![],'where':_0x26460f[_0xac4e('0x18')]?_0x26460f[_0xac4e('0x18')][_0xac4e('0x1a')]||null:null,'attributes':_0x26460f['options']?_0x26460f['options'][_0xac4e('0x1b')]||null:null,'limit':_0x26460f['options']?_0x26460f[_0xac4e('0x18')][_0xac4e('0x1c')]||null:null,'include':_0x26460f[_0xac4e('0x18')]?_0x26460f[_0xac4e('0x18')][_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x26460f[_0xac4e('0x18')][_0xac4e('0x1d')],function(_0x5643fe){return{'model':db[_0x5643fe[_0xac4e('0x1f')]],'as':_0x5643fe['as'],'attributes':_0x5643fe[_0xac4e('0x1b')],'include':_0x5643fe[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x5643fe[_0xac4e('0x1d')],function(_0x5597ad){return{'model':db[_0x5597ad[_0xac4e('0x1f')]],'as':_0x5597ad['as'],'attributes':_0x5597ad['attributes'],'include':_0x5597ad[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x5597ad[_0xac4e('0x1d')],function(_0x283085){return{'model':db[_0x283085[_0xac4e('0x1f')]],'as':_0x283085['as'],'attributes':_0x283085[_0xac4e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac4e('0xc')](function(_0x5c42a9){logger['info'](_0xac4e('0x15'),_0x26460f);logger[_0xac4e('0x10')](_0xac4e('0x15'),_0x26460f,JSON[_0xac4e('0x11')](_0x5c42a9));_0x4bcf84(_0x5c42a9);})[_0xac4e('0x20')](function(_0x3d1b57){logger['error'](_0xac4e('0x15'),_0x3d1b57['message'],_0x26460f);_0x27d6b9(_0x75271[_0xac4e('0x12')](0x1f4,_0x3d1b57[_0xac4e('0x13')]));});});};exports[_0xac4e('0x21')]=function(_0x27fd81){var _0x8be96d=this;return new Promise(function(_0x41d57c,_0x10a966){return db['Trigger'][_0xac4e('0x22')]({'raw':_0x27fd81[_0xac4e('0x18')]?_0x27fd81['options']['raw']===undefined?!![]:![]:!![],'where':_0x27fd81['options']?_0x27fd81[_0xac4e('0x18')][_0xac4e('0x1a')]||null:null,'attributes':_0x27fd81[_0xac4e('0x18')]?_0x27fd81[_0xac4e('0x18')][_0xac4e('0x1b')]||null:null,'include':_0x27fd81[_0xac4e('0x18')]?_0x27fd81['options'][_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x27fd81['options'][_0xac4e('0x1d')],function(_0x5685f9){return{'model':db[_0x5685f9[_0xac4e('0x1f')]],'as':_0x5685f9['as'],'attributes':_0x5685f9[_0xac4e('0x1b')],'include':_0x5685f9[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x5685f9[_0xac4e('0x1d')],function(_0x3915f1){return{'model':db[_0x3915f1[_0xac4e('0x1f')]],'as':_0x3915f1['as'],'attributes':_0x3915f1[_0xac4e('0x1b')],'include':_0x3915f1[_0xac4e('0x1d')]?_[_0xac4e('0x1e')](_0x3915f1['include'],function(_0x2fb595){return{'model':db[_0x2fb595[_0xac4e('0x1f')]],'as':_0x2fb595['as'],'attributes':_0x2fb595[_0xac4e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xac4e('0xc')](function(_0xabae9a){logger[_0xac4e('0xd')](_0xac4e('0x21'),_0x27fd81);logger[_0xac4e('0x10')]('ShowTrigger',_0x27fd81,JSON[_0xac4e('0x11')](_0xabae9a));_0x41d57c(_0xabae9a);})[_0xac4e('0x20')](function(_0x1f8a37){logger[_0xac4e('0x12')]('ShowTrigger',_0x1f8a37[_0xac4e('0x13')],_0x27fd81);_0x10a966(_0x8be96d[_0xac4e('0x12')](0x1f4,_0x1f8a37[_0xac4e('0x13')]));});});};
\ No newline at end of file
index bd05a62..e0773f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0da4=['../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x6bc02f,_0x53a4ed){var _0xa3f53e=function(_0x199a79){while(--_0x199a79){_0x6bc02f['push'](_0x6bc02f['shift']());}};_0xa3f53e(++_0x53a4ed);}(_0x0da4,0x1d8));var _0x40da=function(_0x192aa7,_0x160e97){_0x192aa7=_0x192aa7-0x0;var _0x2bfe6e=_0x0da4[_0x192aa7];return _0x2bfe6e;};'use strict';var multer=require(_0x40da('0x0'));var util=require(_0x40da('0x1'));var path=require(_0x40da('0x2'));var timeout=require(_0x40da('0x3'));var express=require(_0x40da('0x4'));var router=express[_0x40da('0x5')]();var fs_extra=require(_0x40da('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x40da('0x7'));var config=require(_0x40da('0x8'));var controller=require(_0x40da('0x9'));router[_0x40da('0xa')]('/',auth[_0x40da('0xb')](),controller[_0x40da('0xc')]);router[_0x40da('0xa')](_0x40da('0xd'),auth[_0x40da('0xb')](),controller[_0x40da('0xe')]);router['post'](_0x40da('0xf'),auth[_0x40da('0xb')](),controller[_0x40da('0x10')]);router[_0x40da('0x11')]('/',auth[_0x40da('0xb')](),controller[_0x40da('0x12')]);router[_0x40da('0x13')](_0x40da('0xd'),auth['isAuthenticated'](),controller[_0x40da('0x14')]);router[_0x40da('0x15')](_0x40da('0xd'),auth['isAuthenticated'](),controller[_0x40da('0x16')]);module[_0x40da('0x17')]=router;
\ No newline at end of file
+var _0x806a=['util','path','connect-timeout','Router','fs-extra','isAuthenticated','index','get','/:id','show','post','clone','create','destroy','exports','multer'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x806a,0x1ef));var _0xa806=function(_0x3ff5b2,_0x215adb){_0x3ff5b2=_0x3ff5b2-0x0;var _0x558547=_0x806a[_0x3ff5b2];return _0x558547;};'use strict';var multer=require(_0xa806('0x0'));var util=require(_0xa806('0x1'));var path=require(_0xa806('0x2'));var timeout=require(_0xa806('0x3'));var express=require('express');var router=express[_0xa806('0x4')]();var fs_extra=require(_0xa806('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0xa806('0x6')](),controller[_0xa806('0x7')]);router[_0xa806('0x8')](_0xa806('0x9'),auth[_0xa806('0x6')](),controller[_0xa806('0xa')]);router[_0xa806('0xb')]('/:id/clone',auth[_0xa806('0x6')](),controller[_0xa806('0xc')]);router[_0xa806('0xb')]('/',auth['isAuthenticated'](),controller[_0xa806('0xd')]);router['put'](_0xa806('0x9'),auth[_0xa806('0x6')](),controller['update']);router['delete']('/:id',auth[_0xa806('0x6')](),controller[_0xa806('0xe')]);module[_0xa806('0xf')]=router;
\ No newline at end of file
index 263c84b..0c4fdb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7f0=['passive','actpass','update,nonat','exports','name','ENUM','user','peer','friend','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','pai','certificate','active'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xe7f0,0x147));var _0x0e7f=function(_0x928b87,_0x53480a){_0x928b87=_0x928b87-0x0;var _0x1e7638=_0xe7f0[_0x928b87];return _0x1e7638;};'use strict';var Sequelize=require('sequelize');module[_0x0e7f('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0e7f('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0e7f('0x2')]('friend',_0x0e7f('0x3'),_0x0e7f('0x4')),'allowNull':![],'defaultValue':_0x0e7f('0x5')},'context':{'type':Sequelize[_0x0e7f('0x6')],'allowNull':![],'defaultValue':_0x0e7f('0x7')},'callingpres':{'type':Sequelize['ENUM'](_0x0e7f('0x8'),_0x0e7f('0x9'),'ALLOWED_FAILED_SCREEN',_0x0e7f('0xa'),_0x0e7f('0xb'),_0x0e7f('0xc'),_0x0e7f('0xd'),_0x0e7f('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x0e7f('0x6')]},'secret':{'type':Sequelize[_0x0e7f('0x6')]},'md5secret':{'type':Sequelize[_0x0e7f('0x6')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':'udp','set':function(_0x1b248b){this[_0x0e7f('0xf')](_0x0e7f('0x10'),_0x1b248b?_0x1b248b[_0x0e7f('0x11')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x0e7f('0x12')]('transport')[_0x0e7f('0x13')](','):null;},'comment':_0x0e7f('0x14')},'dtmfmode':{'type':Sequelize[_0x0e7f('0x2')]('rfc2833',_0x0e7f('0x15'),_0x0e7f('0x16'),_0x0e7f('0x17'),_0x0e7f('0x18')),'defaultValue':_0x0e7f('0x19')},'directmedia':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no',_0x0e7f('0x1b'),_0x0e7f('0x1c'),_0x0e7f('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0e7f('0x6')]},'directmediadeny':{'type':Sequelize[_0x0e7f('0x6')]},'nat':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':_0x0e7f('0x1e'),'set':function(_0x3a527a){this[_0x0e7f('0xf')](_0x0e7f('0x1f'),_0x3a527a?_0x3a527a[_0x0e7f('0x11')](','):null);},'get':function(){return this[_0x0e7f('0x12')](_0x0e7f('0x1f'))?this[_0x0e7f('0x12')](_0x0e7f('0x1f'))['split'](','):null;},'comment':_0x0e7f('0x20')},'callgroup':{'type':Sequelize[_0x0e7f('0x6')]},'namedcallgroup':{'type':Sequelize[_0x0e7f('0x6')]},'pickupgroup':{'type':Sequelize[_0x0e7f('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x0e7f('0x6')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0e7f('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':_0x0e7f('0x21')},'allow':{'type':Sequelize[_0x0e7f('0x6')],'allowNull':![],'defaultValue':_0x0e7f('0x22'),'set':function(_0x229709){this[_0x0e7f('0xf')]('allow',_0x229709?_0x229709['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x0e7f('0x12')](_0x0e7f('0x23'))?this[_0x0e7f('0x12')](_0x0e7f('0x23'))[_0x0e7f('0x13')](';'):null;},'comment':_0x0e7f('0x24')},'autoframing':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0e7f('0x25'),'set':function(_0x1892e0){this[_0x0e7f('0xf')](_0x0e7f('0x26'),_0x1892e0?_0x1892e0[_0x0e7f('0x11')](','):null);},'get':function(){return this['getDataValue'](_0x0e7f('0x26'))?this[_0x0e7f('0x12')](_0x0e7f('0x26'))[_0x0e7f('0x13')](','):null;},'comment':_0x0e7f('0x27')},'trustrpid':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no','never')},'promiscredir':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'setvar':{'type':Sequelize[_0x0e7f('0x6')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x0e7f('0x29')},'amaflags':{'type':Sequelize[_0x0e7f('0x6')]},'callcounter':{'type':Sequelize[_0x0e7f('0x2')]('yes','no'),'defaultValue':_0x0e7f('0x1a')},'busylevel':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x0e7f('0x6')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no',_0x0e7f('0x2a')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x0e7f('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0x0e7f('0x2b'),_0x0e7f('0x2c'),_0x0e7f('0x2d'))},'session_expires':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'session_refresher':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x2e'),_0x0e7f('0x2f')),'defaultValue':_0x0e7f('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0x0e7f('0x6')]},'regexten':{'type':Sequelize[_0x0e7f('0x6')]},'fromdomain':{'type':Sequelize[_0x0e7f('0x6')]},'fromuser':{'type':Sequelize[_0x0e7f('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0e7f('0x6')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x0e7f('0x2')]('yes','no',_0x0e7f('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0e7f('0x6')]},'callbackextension':{'type':Sequelize[_0x0e7f('0x6')]},'timert1':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'timerb':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x0e7f('0x6')]},'contactdeny':{'type':Sequelize[_0x0e7f('0x6')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x0e7f('0x6')]},'use_q850_reason':{'type':Sequelize[_0x0e7f('0x6')]},'maxforwards':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'encryption':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'icesupport':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0e7f('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint',_0x0e7f('0x31'))},'dtlsrekey':{'type':Sequelize[_0x0e7f('0x28')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0e7f('0x6')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x0e7f('0x6')]},'dtlscafile':{'type':Sequelize[_0x0e7f('0x6')]},'dtlscapath':{'type':Sequelize[_0x0e7f('0x6')]},'dtlssetup':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x32'),_0x0e7f('0x33'),_0x0e7f('0x34')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0e7f('0x6')]},'usereqphone':{'type':Sequelize[_0x0e7f('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0e7f('0x6')]},'recordofffeature':{'type':Sequelize[_0x0e7f('0x6')]},'call_limit':{'type':Sequelize[_0x0e7f('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0e7f('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x0e7f('0x6')]},'mohinterpret':{'type':Sequelize[_0x0e7f('0x6')]},'mohsuggest':{'type':Sequelize[_0x0e7f('0x6')]},'parkinglot':{'type':Sequelize[_0x0e7f('0x6')]},'description':{'type':Sequelize[_0x0e7f('0x6')]},'host':{'type':Sequelize[_0x0e7f('0x6')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x0e7f('0x2')](_0x0e7f('0x1a'),'no','nonat',_0x0e7f('0x1c'),_0x0e7f('0x35')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0e7f('0x6')]},'otherFields':{'type':Sequelize[_0x0e7f('0x6')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0x33a1=['getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','inband','auto','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','INTEGER','uac','uas','pai','fingerprint','certificate','passive','actpass','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join'];(function(_0xcf0c57,_0x39510c){var _0x23a2ac=function(_0x125c99){while(--_0x125c99){_0xcf0c57['push'](_0xcf0c57['shift']());}};_0x23a2ac(++_0x39510c);}(_0x33a1,0xbb));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x133a('0x0'));module[_0x133a('0x1')]={'name':{'type':Sequelize[_0x133a('0x2')],'allowNull':![],'unique':_0x133a('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x133a('0x4')]('friend','user',_0x133a('0x5')),'allowNull':![],'defaultValue':_0x133a('0x6')},'context':{'type':Sequelize[_0x133a('0x2')],'allowNull':![],'defaultValue':_0x133a('0x7')},'callingpres':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x8'),_0x133a('0x9'),_0x133a('0xa'),'ALLOWED','PROHIB_NOT_SCREENED',_0x133a('0xb'),_0x133a('0xc'),_0x133a('0xd'))},'deny':{'type':Sequelize[_0x133a('0x2')]},'permit':{'type':Sequelize[_0x133a('0x2')]},'secret':{'type':Sequelize[_0x133a('0x2')]},'md5secret':{'type':Sequelize[_0x133a('0x2')]},'remotesecret':{'type':Sequelize[_0x133a('0x2')]},'transport':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0xe'),'set':function(_0x383e7a){this[_0x133a('0xf')]('transport',_0x383e7a?_0x383e7a[_0x133a('0x10')](','):null);},'get':function(){return this[_0x133a('0x11')]('transport')?this['getDataValue'](_0x133a('0x12'))[_0x133a('0x13')](','):null;},'comment':_0x133a('0x14')},'dtmfmode':{'type':Sequelize[_0x133a('0x4')]('rfc2833',_0x133a('0x15'),'shortinfo',_0x133a('0x16'),_0x133a('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no','nonat',_0x133a('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x133a('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x133a('0x2')]},'directmediadeny':{'type':Sequelize[_0x133a('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x133a('0x19'),'set':function(_0x47d5a5){this[_0x133a('0xf')](_0x133a('0x1a'),_0x47d5a5?_0x47d5a5[_0x133a('0x10')](','):null);},'get':function(){return this[_0x133a('0x11')]('nat')?this[_0x133a('0x11')](_0x133a('0x1a'))[_0x133a('0x13')](','):null;},'comment':_0x133a('0x1b')},'callgroup':{'type':Sequelize[_0x133a('0x2')]},'namedcallgroup':{'type':Sequelize[_0x133a('0x2')]},'pickupgroup':{'type':Sequelize[_0x133a('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x133a('0x2')]},'language':{'type':Sequelize[_0x133a('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x133a('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0x1c')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xef922e){this[_0x133a('0xf')]('allow',_0xef922e?_0xef922e[_0x133a('0x10')](';'):_0x133a('0x1d'));},'get':function(){return this['getDataValue'](_0x133a('0x1e'))?this[_0x133a('0x11')](_0x133a('0x1e'))[_0x133a('0x13')](';'):null;},'comment':_0x133a('0x1f')},'autoframing':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'insecure':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0x21'),'set':function(_0x32e324){this[_0x133a('0xf')](_0x133a('0x22'),_0x32e324?_0x32e324[_0x133a('0x10')](','):null);},'get':function(){return this[_0x133a('0x11')](_0x133a('0x22'))?this[_0x133a('0x11')](_0x133a('0x22'))[_0x133a('0x13')](','):null;},'comment':_0x133a('0x23')},'trustrpid':{'type':Sequelize[_0x133a('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no',_0x133a('0x24'))},'promiscredir':{'type':Sequelize[_0x133a('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x133a('0x2')]},'callerid':{'type':Sequelize[_0x133a('0x2')],'defaultValue':_0x133a('0x25')},'amaflags':{'type':Sequelize[_0x133a('0x2')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x133a('0x20')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x133a('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'allowtransfer':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'ignoresdpversion':{'type':Sequelize[_0x133a('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x133a('0x2')]},'videosupport':{'type':Sequelize['ENUM'](_0x133a('0x20'),'no',_0x133a('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'mailbox':{'type':Sequelize[_0x133a('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x133a('0x27'),'refuse',_0x133a('0x28'))},'session_expires':{'type':Sequelize[_0x133a('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x133a('0x29')](0xb)},'session_refresher':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x2a'),_0x133a('0x2b')),'defaultValue':_0x133a('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x133a('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x133a('0x2')]},'fromuser':{'type':Sequelize[_0x133a('0x2')]},'port':{'type':Sequelize[_0x133a('0x29')](0x5)},'qualify':{'type':Sequelize[_0x133a('0x4')]('yes','no'),'defaultValue':_0x133a('0x20')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x133a('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x133a('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x133a('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no',_0x133a('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x133a('0x2')]},'callbackextension':{'type':Sequelize[_0x133a('0x2')]},'timert1':{'type':Sequelize[_0x133a('0x29')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x133a('0x29')](0xb)},'contactpermit':{'type':Sequelize[_0x133a('0x2')]},'contactdeny':{'type':Sequelize[_0x133a('0x2')]},'contactacl':{'type':Sequelize[_0x133a('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x133a('0x2')]},'maxforwards':{'type':Sequelize[_0x133a('0x29')](0xb)},'encryption':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'force_avp':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'icesupport':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize[_0x133a('0x4')]('yes','no',_0x133a('0x2d'),_0x133a('0x2e'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x133a('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x133a('0x2')]},'dtlscipher':{'type':Sequelize[_0x133a('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x133a('0x4')]('active',_0x133a('0x2f'),_0x133a('0x30')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x133a('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x133a('0x20'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x133a('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x133a('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM']('yes','no')},'subscribemwi':{'type':Sequelize[_0x133a('0x4')](_0x133a('0x20'),'no')},'vmexten':{'type':Sequelize[_0x133a('0x2')]},'mohinterpret':{'type':Sequelize[_0x133a('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x133a('0x2')]},'description':{'type':Sequelize[_0x133a('0x2')]},'host':{'type':Sequelize[_0x133a('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize['ENUM']('yes','no','nonat',_0x133a('0x18'),_0x133a('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x133a('0x2')]},'otherFields':{'type':Sequelize[_0x133a('0x2')]},'active':{'type':Sequelize[_0x133a('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x133a('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index 44f21d3..54758a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x52246c,_0x32403f){var _0x3a690c=function(_0x182b60){while(--_0x182b60){_0x52246c['push'](_0x52246c['shift']());}};_0x3a690c(++_0x32403f);}(_0x24ca,0x1bc));var _0xa24c=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x24ca[_0x439d59];return _0x3670c7;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));};
\ No newline at end of file
+var _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0xc47dbb,_0x25cd85){var _0x152bb7=function(_0x2a21cd){while(--_0x2a21cd){_0xc47dbb['push'](_0xc47dbb['shift']());}};_0x152bb7(++_0x25cd85);}(_0x9a19,0x114));var _0x99a1=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x9a19[_0x1b5aea];return _0x51cae9;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));};
\ No newline at end of file
index 28fb468..8d75ad3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76bd=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x4764c6,_0x34f9ec){var _0x345475=function(_0x15f7fc){while(--_0x15f7fc){_0x4764c6['push'](_0x4764c6['shift']());}};_0x345475(++_0x34f9ec);}(_0x76bd,0x141));var _0xd76b=function(_0x2977a6,_0x551716){_0x2977a6=_0x2977a6-0x0;var _0x3322ee=_0x76bd[_0x2977a6];return _0x3322ee;};'use strict';var _=require(_0xd76b('0x0'));var util=require(_0xd76b('0x1'));var logger=require(_0xd76b('0x2'))(_0xd76b('0x3'));var moment=require(_0xd76b('0x4'));var BPromise=require(_0xd76b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd76b('0x6'));var rimraf=require(_0xd76b('0x7'));var config=require(_0xd76b('0x8'));var attributes=require(_0xd76b('0x9'));module[_0xd76b('0xa')]=function(_0x23a7c6,_0x328df6){return _0x23a7c6[_0xd76b('0xb')](_0xd76b('0xc'),attributes,{'tableName':_0xd76b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x745d=['moment','bluebird','path','rimraf','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x745d,0xb0));var _0xd745=function(_0x57e2ce,_0x255ad6){_0x57e2ce=_0x57e2ce-0x0;var _0x3617ad=_0x745d[_0x57e2ce];return _0x3617ad;};'use strict';var _=require(_0xd745('0x0'));var util=require(_0xd745('0x1'));var logger=require(_0xd745('0x2'))(_0xd745('0x3'));var moment=require(_0xd745('0x4'));var BPromise=require(_0xd745('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd745('0x6'));var rimraf=require(_0xd745('0x7'));var config=require('../../config/environment');var attributes=require(_0xd745('0x8'));module[_0xd745('0x9')]=function(_0x3c2f7b,_0x52dc11){return _0x3c2f7b[_0xd745('0xa')]('Trunk',attributes,{'tableName':_0xd745('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6d29afe..768a0e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd75e=['catch','GetTrunk','Trunk','findAll','options','where','limit','include','map','model','attributes','info','ShowTrunk','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x525574,_0x36b788){var _0x5b7de0=function(_0x5161b5){while(--_0x5161b5){_0x525574['push'](_0x525574['shift']());}};_0x5b7de0(++_0x36b788);}(_0xd75e,0x1c8));var _0xed75=function(_0x45d85b,_0x231899){_0x45d85b=_0x45d85b-0x0;var _0x48d02a=_0xd75e[_0x45d85b];return _0x48d02a;};'use strict';var _=require(_0xed75('0x0'));var util=require(_0xed75('0x1'));var moment=require(_0xed75('0x2'));var BPromise=require(_0xed75('0x3'));var rs=require(_0xed75('0x4'));var fs=require('fs');var Redis=require(_0xed75('0x5'));var db=require(_0xed75('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xed75('0x7'))(_0xed75('0x8'));var config=require('../../config/environment');var jayson=require(_0xed75('0x9'));var client=jayson[_0xed75('0xa')][_0xed75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x244d1b,_0xda6327,_0x3b480d){return new BPromise(function(_0x2765e3,_0x4c6a99){return client[_0xed75('0xc')](_0x244d1b,_0x3b480d)[_0xed75('0xd')](function(_0x1432e4){logger['info'](_0xed75('0xe'),_0xda6327,_0xed75('0xf'));logger[_0xed75('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0xda6327,_0xed75('0xf'),JSON[_0xed75('0x11')](_0x1432e4));if(_0x1432e4[_0xed75('0x12')]){if(_0x1432e4[_0xed75('0x12')]['code']===0x1f4){logger[_0xed75('0x12')](_0xed75('0xe'),_0xda6327,_0x1432e4[_0xed75('0x12')]['message']);return _0x4c6a99(_0x1432e4['error'][_0xed75('0x13')]);}logger[_0xed75('0x12')](_0xed75('0xe'),_0xda6327,_0x1432e4[_0xed75('0x12')][_0xed75('0x13')]);return _0x2765e3(_0x1432e4[_0xed75('0x12')][_0xed75('0x13')]);}else{logger['info'](_0xed75('0xe'),_0xda6327,_0xed75('0xf'));_0x2765e3(_0x1432e4['result'][_0xed75('0x13')]);}})[_0xed75('0x14')](function(_0x499b70){logger[_0xed75('0x12')](_0xed75('0xe'),_0xda6327,_0x499b70);_0x4c6a99(_0x499b70);});});}exports[_0xed75('0x15')]=function(_0x4bd1ec){var _0x167eb9=this;return new Promise(function(_0x3da1c1,_0x5e5b9d){return db[_0xed75('0x16')][_0xed75('0x17')]({'raw':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec['options']['raw']===undefined?!![]:![]:!![],'where':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')][_0xed75('0x19')]||null:null,'attributes':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')]['attributes']||null:null,'limit':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')][_0xed75('0x1a')]||null:null,'include':_0x4bd1ec[_0xed75('0x18')]?_0x4bd1ec[_0xed75('0x18')][_0xed75('0x1b')]?_[_0xed75('0x1c')](_0x4bd1ec[_0xed75('0x18')][_0xed75('0x1b')],function(_0x13b5c7){return{'model':db[_0x13b5c7[_0xed75('0x1d')]],'as':_0x13b5c7['as'],'attributes':_0x13b5c7[_0xed75('0x1e')],'include':_0x13b5c7['include']?_['map'](_0x13b5c7['include'],function(_0x1285b5){return{'model':db[_0x1285b5[_0xed75('0x1d')]],'as':_0x1285b5['as'],'attributes':_0x1285b5[_0xed75('0x1e')],'include':_0x1285b5[_0xed75('0x1b')]?_['map'](_0x1285b5['include'],function(_0x2df883){return{'model':db[_0x2df883[_0xed75('0x1d')]],'as':_0x2df883['as'],'attributes':_0x2df883[_0xed75('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19eb8e){logger[_0xed75('0x1f')]('GetTrunk',_0x4bd1ec);logger[_0xed75('0x10')](_0xed75('0x15'),_0x4bd1ec,JSON['stringify'](_0x19eb8e));_0x3da1c1(_0x19eb8e);})[_0xed75('0x14')](function(_0x3d13ef){logger['error'](_0xed75('0x15'),_0x3d13ef['message'],_0x4bd1ec);_0x5e5b9d(_0x167eb9[_0xed75('0x12')](0x1f4,_0x3d13ef['message']));});});};exports[_0xed75('0x20')]=function(_0x15f522){var _0x4c9fed=this;return new Promise(function(_0x1e2076,_0x24f247){return db[_0xed75('0x16')]['find']({'raw':_0x15f522['options']?_0x15f522[_0xed75('0x18')][_0xed75('0x21')]===undefined?!![]:![]:!![],'where':_0x15f522[_0xed75('0x18')]?_0x15f522['options'][_0xed75('0x19')]||null:null,'attributes':_0x15f522[_0xed75('0x18')]?_0x15f522[_0xed75('0x18')][_0xed75('0x1e')]||null:null,'include':_0x15f522['options']?_0x15f522['options'][_0xed75('0x1b')]?_['map'](_0x15f522[_0xed75('0x18')][_0xed75('0x1b')],function(_0x46aa95){return{'model':db[_0x46aa95[_0xed75('0x1d')]],'as':_0x46aa95['as'],'attributes':_0x46aa95['attributes'],'include':_0x46aa95['include']?_[_0xed75('0x1c')](_0x46aa95[_0xed75('0x1b')],function(_0x22a3bd){return{'model':db[_0x22a3bd[_0xed75('0x1d')]],'as':_0x22a3bd['as'],'attributes':_0x22a3bd[_0xed75('0x1e')],'include':_0x22a3bd[_0xed75('0x1b')]?_[_0xed75('0x1c')](_0x22a3bd[_0xed75('0x1b')],function(_0x3634ec){return{'model':db[_0x3634ec['model']],'as':_0x3634ec['as'],'attributes':_0x3634ec['attributes']};}):[]};}):[]};}):[]:[]})[_0xed75('0xd')](function(_0x45b297){logger[_0xed75('0x1f')]('ShowTrunk',_0x15f522);logger[_0xed75('0x10')](_0xed75('0x20'),_0x15f522,JSON[_0xed75('0x11')](_0x45b297));_0x1e2076(_0x45b297);})[_0xed75('0x14')](function(_0x1b0d37){logger[_0xed75('0x12')](_0xed75('0x20'),_0x1b0d37['message'],_0x15f522);_0x24f247(_0x4c9fed['error'](0x1f4,_0x1b0d37[_0xed75('0x13')]));});});};
\ No newline at end of file
+var _0x50e6=['message','result','catch','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','GetTrunk','ShowTrunk','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1a0c36,_0x1e0a97){var _0x1ffccb=function(_0x1a21cb){while(--_0x1a21cb){_0x1a0c36['push'](_0x1a0c36['shift']());}};_0x1ffccb(++_0x1e0a97);}(_0x50e6,0x1a8));var _0x650e=function(_0xb7c3d1,_0x203733){_0xb7c3d1=_0xb7c3d1-0x0;var _0x4a668b=_0x50e6[_0xb7c3d1];return _0x4a668b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x650e('0x0'));var BPromise=require(_0x650e('0x1'));var rs=require(_0x650e('0x2'));var fs=require('fs');var Redis=require(_0x650e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x650e('0x4'));var logger=require(_0x650e('0x5'))(_0x650e('0x6'));var config=require('../../config/environment');var jayson=require(_0x650e('0x7'));var client=jayson[_0x650e('0x8')][_0x650e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a0a56,_0x2cd0ab,_0xa75f37){return new BPromise(function(_0x1dd07e,_0x352252){return client['request'](_0x2a0a56,_0xa75f37)['then'](function(_0x273234){logger[_0x650e('0xa')](_0x650e('0xb'),_0x2cd0ab,'request\x20sent');logger[_0x650e('0xc')](_0x650e('0xd'),_0x2cd0ab,_0x650e('0xe'),JSON[_0x650e('0xf')](_0x273234));if(_0x273234[_0x650e('0x10')]){if(_0x273234[_0x650e('0x10')][_0x650e('0x11')]===0x1f4){logger[_0x650e('0x10')](_0x650e('0xb'),_0x2cd0ab,_0x273234[_0x650e('0x10')]['message']);return _0x352252(_0x273234[_0x650e('0x10')]['message']);}logger[_0x650e('0x10')](_0x650e('0xb'),_0x2cd0ab,_0x273234[_0x650e('0x10')][_0x650e('0x12')]);return _0x1dd07e(_0x273234[_0x650e('0x10')][_0x650e('0x12')]);}else{logger['info'](_0x650e('0xb'),_0x2cd0ab,'request\x20sent');_0x1dd07e(_0x273234[_0x650e('0x13')][_0x650e('0x12')]);}})[_0x650e('0x14')](function(_0x417d13){logger[_0x650e('0x10')](_0x650e('0xb'),_0x2cd0ab,_0x417d13);_0x352252(_0x417d13);});});}exports['GetTrunk']=function(_0x5aae02){var _0x297a76=this;return new Promise(function(_0x141bfd,_0x3fdb7a){return db[_0x650e('0x15')][_0x650e('0x16')]({'raw':_0x5aae02[_0x650e('0x17')]?_0x5aae02[_0x650e('0x17')][_0x650e('0x18')]===undefined?!![]:![]:!![],'where':_0x5aae02[_0x650e('0x17')]?_0x5aae02[_0x650e('0x17')][_0x650e('0x19')]||null:null,'attributes':_0x5aae02['options']?_0x5aae02[_0x650e('0x17')][_0x650e('0x1a')]||null:null,'limit':_0x5aae02[_0x650e('0x17')]?_0x5aae02[_0x650e('0x17')][_0x650e('0x1b')]||null:null,'include':_0x5aae02[_0x650e('0x17')]?_0x5aae02['options'][_0x650e('0x1c')]?_[_0x650e('0x1d')](_0x5aae02[_0x650e('0x17')]['include'],function(_0x5aac75){return{'model':db[_0x5aac75[_0x650e('0x1e')]],'as':_0x5aac75['as'],'attributes':_0x5aac75[_0x650e('0x1a')],'include':_0x5aac75[_0x650e('0x1c')]?_['map'](_0x5aac75[_0x650e('0x1c')],function(_0x46be29){return{'model':db[_0x46be29[_0x650e('0x1e')]],'as':_0x46be29['as'],'attributes':_0x46be29['attributes'],'include':_0x46be29['include']?_[_0x650e('0x1d')](_0x46be29['include'],function(_0x26a89b){return{'model':db[_0x26a89b['model']],'as':_0x26a89b['as'],'attributes':_0x26a89b[_0x650e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x650e('0x1f')](function(_0x43f908){logger[_0x650e('0xa')](_0x650e('0x20'),_0x5aae02);logger['debug']('GetTrunk',_0x5aae02,JSON[_0x650e('0xf')](_0x43f908));_0x141bfd(_0x43f908);})[_0x650e('0x14')](function(_0x32d4f5){logger[_0x650e('0x10')](_0x650e('0x20'),_0x32d4f5[_0x650e('0x12')],_0x5aae02);_0x3fdb7a(_0x297a76[_0x650e('0x10')](0x1f4,_0x32d4f5[_0x650e('0x12')]));});});};exports[_0x650e('0x21')]=function(_0x37c7c1){var _0x34662b=this;return new Promise(function(_0xf26995,_0x215ab6){return db[_0x650e('0x15')]['find']({'raw':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1[_0x650e('0x17')][_0x650e('0x18')]===undefined?!![]:![]:!![],'where':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1[_0x650e('0x17')][_0x650e('0x19')]||null:null,'attributes':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1['options'][_0x650e('0x1a')]||null:null,'include':_0x37c7c1[_0x650e('0x17')]?_0x37c7c1[_0x650e('0x17')][_0x650e('0x1c')]?_[_0x650e('0x1d')](_0x37c7c1['options'][_0x650e('0x1c')],function(_0x4bb932){return{'model':db[_0x4bb932['model']],'as':_0x4bb932['as'],'attributes':_0x4bb932[_0x650e('0x1a')],'include':_0x4bb932[_0x650e('0x1c')]?_['map'](_0x4bb932[_0x650e('0x1c')],function(_0x4368af){return{'model':db[_0x4368af['model']],'as':_0x4368af['as'],'attributes':_0x4368af['attributes'],'include':_0x4368af[_0x650e('0x1c')]?_[_0x650e('0x1d')](_0x4368af[_0x650e('0x1c')],function(_0x242cce){return{'model':db[_0x242cce[_0x650e('0x1e')]],'as':_0x242cce['as'],'attributes':_0x242cce[_0x650e('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x650e('0x1f')](function(_0x210d65){logger[_0x650e('0xa')](_0x650e('0x21'),_0x37c7c1);logger[_0x650e('0xc')]('ShowTrunk',_0x37c7c1,JSON['stringify'](_0x210d65));_0xf26995(_0x210d65);})[_0x650e('0x14')](function(_0x414862){logger[_0x650e('0x10')]('ShowTrunk',_0x414862[_0x650e('0x12')],_0x37c7c1);_0x215ab6(_0x34662b[_0x650e('0x10')](0x1f4,_0x414862[_0x650e('0x12')]));});});};
\ No newline at end of file
index 40a4e0e..966f907 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12f=['express','Router','./user-setting.controller','put','/:id','isAuthenticated','update','exports'];(function(_0x5dfb86,_0x224c29){var _0x2968f8=function(_0x1252cd){while(--_0x1252cd){_0x5dfb86['push'](_0x5dfb86['shift']());}};_0x2968f8(++_0x224c29);}(_0xc12f,0x168));var _0xfc12=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0xc12f[_0x5a6644];return _0x3a2a5d;};'use strict';var express=require(_0xfc12('0x0'));var router=express[_0xfc12('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xfc12('0x2'));router[_0xfc12('0x3')](_0xfc12('0x4'),auth[_0xfc12('0x5')](),controller[_0xfc12('0x6')]);module[_0xfc12('0x7')]=router;
\ No newline at end of file
+var _0x19c9=['update','Router','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x3f6ece,_0x530c18){var _0x3ecfa2=function(_0x55717e){while(--_0x55717e){_0x3f6ece['push'](_0x3f6ece['shift']());}};_0x3ecfa2(++_0x530c18);}(_0x19c9,0xf1));var _0x919c=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x19c9[_0x3c2a69];return _0x596bc8;};'use strict';var express=require('express');var router=express[_0x919c('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x919c('0x1'));router[_0x919c('0x2')](_0x919c('0x3'),auth[_0x919c('0x4')](),controller[_0x919c('0x5')]);module['exports']=router;
\ No newline at end of file
index 2234d5c..f5ef786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x776d=['error','warning','info','debug','exports','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize'];(function(_0x322e30,_0x4f89b1){var _0x3d9dc4=function(_0x1912fe){while(--_0x1912fe){_0x322e30['push'](_0x322e30['shift']());}};_0x3d9dc4(++_0x4f89b1);}(_0x776d,0x112));var _0xd776=function(_0x3b6e37,_0x497c0b){_0x3b6e37=_0x3b6e37-0x0;var _0x42875b=_0x776d[_0x3b6e37];return _0x42875b;};'use strict';var Sequelize=require(_0xd776('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xd776('0x1'),_0xd776('0x2'),_0xd776('0x3'),_0xd776('0x4')];module[_0xd776('0x5')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xd776('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xd776('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xd776('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xd776('0x9')],'unique':_0xd776('0xa')}};
\ No newline at end of file
+var _0xc43a=['INTEGER','UserId','sequelize','error','info','exports','ENUM','TEXT'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xc43a,0x13a));var _0xac43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc43a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac43('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xac43('0x1'),'warning',_0xac43('0x2'),'debug'];module[_0xac43('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0xac43('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xac43('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xac43('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xac43('0x6')],'unique':_0xac43('0x7')}};
\ No newline at end of file
index 565b113..6a10f6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0cc=['redis','defaults','update','sendStatus','stack','name','status','send','user','Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','then','catch','lodash','api','socket.io-emitter'];(function(_0x364b1c,_0x47a858){var _0x377538=function(_0x53e5fb){while(--_0x53e5fb){_0x364b1c['push'](_0x364b1c['shift']());}};_0x377538(++_0x47a858);}(_0xf0cc,0xa7));var _0xcf0c=function(_0x167381,_0x195040){_0x167381=_0x167381-0x0;var _0x175443=_0xf0cc[_0x167381];return _0x175443;};'use strict';var _=require(_0xcf0c('0x0'));var Redis=require('ioredis');var logger=require('../../config/logger')(_0xcf0c('0x1'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0xcf0c('0x2'))(new Redis(config[_0xcf0c('0x3')]));require('./user-setting.socket')['register'](socket);config[_0xcf0c('0x3')]=_[_0xcf0c('0x4')](config[_0xcf0c('0x3')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x346cb0,_0x1503f6){_0x1503f6=_0x1503f6||0xc8;return function(_0x2cb15a){if(_0x2cb15a){return _0x346cb0['status'](_0x1503f6)['json'](_0x2cb15a);}};}function saveUpdates(_0x3cf3cb){return function(_0x53a853){if(_0x53a853){return _0x53a853[_0xcf0c('0x5')](_0x3cf3cb)['then'](function(_0x291141){return _0x291141;});}return null;};}function handleEntityNotFound(_0x1a8e08){return function(_0x16190b){if(!_0x16190b){_0x1a8e08[_0xcf0c('0x6')](0x194);}return _0x16190b;};}function handleError(_0x3ba6ab,_0x817634){_0x817634=_0x817634||0x1f4;return function(_0x39375d){logger['error'](_0x39375d[_0xcf0c('0x7')]);if(_0x39375d[_0xcf0c('0x8')]){delete _0x39375d[_0xcf0c('0x8')];}_0x3ba6ab[_0xcf0c('0x9')](_0x817634)[_0xcf0c('0xa')](_0x39375d);};}exports['update']=function(_0x540eae,_0x395d90){if(_0x540eae[_0xcf0c('0xb')]['role']!=='admin')throw new Error(_0xcf0c('0xc'));if(isNaN(Number(_0x540eae['params']['id'])))throw new Error(_0xcf0c('0xd'));return db[_0xcf0c('0xe')]['find']({'where':{'id':_0x540eae['params']['id']}})['then'](handleEntityNotFound(_0x395d90,null))[_0xcf0c('0xf')](saveUpdates(_0x540eae['body'],null))[_0xcf0c('0xf')](respondWithResult(_0x395d90,null))[_0xcf0c('0x10')](handleError(_0x395d90,null));};
\ No newline at end of file
+var _0xd3d1=['Unauthorized','Invalid\x20user\x20setting\x20id','UserSetting','find','params','body','lodash','ioredis','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','then','sendStatus','error','stack','name','send','user','role'];(function(_0x4033e4,_0x469e1a){var _0x121a3a=function(_0x210a0b){while(--_0x210a0b){_0x4033e4['push'](_0x4033e4['shift']());}};_0x121a3a(++_0x469e1a);}(_0xd3d1,0x172));var _0x1d3d=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd3d1[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x1d3d('0x0'));var Redis=require(_0x1d3d('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x1d3d('0x2'));var db=require(_0x1d3d('0x3'))['db'];var socket=require(_0x1d3d('0x4'))(new Redis(config[_0x1d3d('0x5')]));require(_0x1d3d('0x6'))[_0x1d3d('0x7')](socket);config[_0x1d3d('0x5')]=_[_0x1d3d('0x8')](config[_0x1d3d('0x5')],{'host':_0x1d3d('0x9'),'port':0x18eb});function respondWithResult(_0x3831ce,_0xb1b3c6){_0xb1b3c6=_0xb1b3c6||0xc8;return function(_0xe10bca){if(_0xe10bca){return _0x3831ce[_0x1d3d('0xa')](_0xb1b3c6)[_0x1d3d('0xb')](_0xe10bca);}};}function saveUpdates(_0x2ba122){return function(_0x3683c9){if(_0x3683c9){return _0x3683c9['update'](_0x2ba122)[_0x1d3d('0xc')](function(_0x44d950){return _0x44d950;});}return null;};}function handleEntityNotFound(_0x32d5da){return function(_0x32742c){if(!_0x32742c){_0x32d5da[_0x1d3d('0xd')](0x194);}return _0x32742c;};}function handleError(_0x372ff2,_0x44b374){_0x44b374=_0x44b374||0x1f4;return function(_0x2fa11e){logger[_0x1d3d('0xe')](_0x2fa11e[_0x1d3d('0xf')]);if(_0x2fa11e[_0x1d3d('0x10')]){delete _0x2fa11e['name'];}_0x372ff2[_0x1d3d('0xa')](_0x44b374)[_0x1d3d('0x11')](_0x2fa11e);};}exports['update']=function(_0x4dd753,_0x12bd00){if(_0x4dd753[_0x1d3d('0x12')][_0x1d3d('0x13')]!=='admin')throw new Error(_0x1d3d('0x14'));if(isNaN(Number(_0x4dd753['params']['id'])))throw new Error(_0x1d3d('0x15'));return db[_0x1d3d('0x16')][_0x1d3d('0x17')]({'where':{'id':_0x4dd753[_0x1d3d('0x18')]['id']}})[_0x1d3d('0xc')](handleEntityNotFound(_0x12bd00,null))[_0x1d3d('0xc')](saveUpdates(_0x4dd753[_0x1d3d('0x19')],null))['then'](respondWithResult(_0x12bd00,null))['catch'](handleError(_0x12bd00,null));};
\ No newline at end of file
index 95b2380..fcbc21f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdf0=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','UserSetting'];(function(_0x65ff01,_0x5653e9){var _0xc346d3=function(_0x296ba6){while(--_0x296ba6){_0x65ff01['push'](_0x65ff01['shift']());}};_0xc346d3(++_0x5653e9);}(_0xbdf0,0xb6));var _0x0bdf=function(_0x4f8b2b,_0x1dc8dd){_0x4f8b2b=_0x4f8b2b-0x0;var _0x2f230a=_0xbdf0[_0x4f8b2b];return _0x2f230a;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x0bdf('0x0'))['db'][_0x0bdf('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0bdf('0x2'),'afterUpdate':_0x0bdf('0x3'),'afterDestroy':_0x0bdf('0x4')};function emitEvent(_0x278ba1){return function(_0x20e824,_0x46088f,_0x147f24){UserSettingEvents[_0x0bdf('0x5')](_0x278ba1+':'+_0x20e824['id'],_0x20e824);UserSettingEvents['emit'](_0x278ba1,_0x20e824);_0x147f24(null);};}for(var e in events){if(events[_0x0bdf('0x6')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x0bdf('0x7')]=UserSettingEvents;
\ No newline at end of file
+var _0xc963=['../../mysqldb','UserSetting','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5e2365,_0x32e377){var _0x127117=function(_0x4907db){while(--_0x4907db){_0x5e2365['push'](_0x5e2365['shift']());}};_0x127117(++_0x32e377);}(_0xc963,0x13b));var _0x3c96=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0xc963[_0x265aa2];return _0x447a3a;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x3c96('0x0'))['db'][_0x3c96('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x3c96('0x2')](0x0);var events={'afterCreate':_0x3c96('0x3'),'afterUpdate':_0x3c96('0x4'),'afterDestroy':_0x3c96('0x5')};function emitEvent(_0x172e1f){return function(_0x347ae3,_0x1506ae,_0x1bde0b){UserSettingEvents[_0x3c96('0x6')](_0x172e1f+':'+_0x347ae3['id'],_0x347ae3);UserSettingEvents[_0x3c96('0x6')](_0x172e1f,_0x347ae3);_0x1bde0b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x3c96('0x7')](e,emitEvent(event));}}module[_0x3c96('0x8')]=UserSettingEvents;
\ No newline at end of file
index d4bbf36..0dcc9c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x152f=['./user-setting.attributes','exports','define','UserSetting','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x11bc18,_0x212489){var _0x25cd9d=function(_0x299581){while(--_0x299581){_0x11bc18['push'](_0x11bc18['shift']());}};_0x25cd9d(++_0x212489);}(_0x152f,0x144));var _0xf152=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x152f[_0x37c22c];return _0x119d79;};'use strict';var attributes=require(_0xf152('0x0'));module[_0xf152('0x1')]=function(_0x3649e1){return _0x3649e1[_0xf152('0x2')](_0xf152('0x3'),attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d77c1){if(!_0x2d77c1[_0xf152('0x4')])_0x2d77c1[_0xf152('0x5')]=null;else if(_0x2d77c1[_0xf152('0x5')]===null)_0x2d77c1['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0x48bc=['./user-setting.attributes','exports','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x481868,_0x8b28aa){var _0x1c2e03=function(_0x4ce7cf){while(--_0x4ce7cf){_0x481868['push'](_0x481868['shift']());}};_0x1c2e03(++_0x8b28aa);}(_0x48bc,0x1b6));var _0xc48b=function(_0x4a6e26,_0x405004){_0x4a6e26=_0x4a6e26-0x0;var _0x932820=_0x48bc[_0x4a6e26];return _0x932820;};'use strict';var attributes=require(_0xc48b('0x0'));module[_0xc48b('0x1')]=function(_0x11f046){return _0x11f046['define'](_0xc48b('0x2'),attributes,{'tableName':_0xc48b('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15b642){if(!_0x15b642[_0xc48b('0x4')])_0x15b642[_0xc48b('0x5')]=null;else if(_0x15b642[_0xc48b('0x5')]===null)_0x15b642[_0xc48b('0x5')]=new Date();}}});};
\ No newline at end of file
index f2a8e40..3caa046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3226=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','update','emit','user-setting:update'];(function(_0x22eef7,_0x1a60c5){var _0x43a93f=function(_0x177d16){while(--_0x177d16){_0x22eef7['push'](_0x22eef7['shift']());}};_0x43a93f(++_0x1a60c5);}(_0x3226,0x87));var _0x6322=function(_0x51d0ca,_0x5af942){_0x51d0ca=_0x51d0ca-0x0;var _0x4f690a=_0x3226[_0x51d0ca];return _0x4f690a;};'use strict';var UserSettingEvents=require(_0x6322('0x0'));var events=[_0x6322('0x1'),'remove',_0x6322('0x2')];function createListener(_0x2c29f1,_0x536aa3){return function(_0x259cb0){_0x536aa3[_0x6322('0x3')](_0x2c29f1,_0x259cb0);if(_0x2c29f1===_0x6322('0x4')){_0x536aa3[_0x6322('0x3')](_0x6322('0x5')+_0x259cb0[_0x6322('0x6')],_0x259cb0);}};}exports[_0x6322('0x7')]=function(_0x463ac5){for(var _0x5da284=0x0,_0x11769d=events[_0x6322('0x8')];_0x5da284<_0x11769d;_0x5da284++){var _0x545e28=events[_0x5da284];var _0x17350a=createListener(_0x6322('0x9')+_0x545e28,_0x463ac5);UserSettingEvents['on'](_0x545e28,_0x17350a);}};
\ No newline at end of file
+var _0xb3b1=['./user-setting.events','remove','update','emit','UserId','register','length','user-setting:'];(function(_0x1e9f1e,_0x27224f){var _0x563620=function(_0x2b4fcc){while(--_0x2b4fcc){_0x1e9f1e['push'](_0x1e9f1e['shift']());}};_0x563620(++_0x27224f);}(_0xb3b1,0x160));var _0x1b3b=function(_0x3705df,_0x183575){_0x3705df=_0x3705df-0x0;var _0x4dc1a9=_0xb3b1[_0x3705df];return _0x4dc1a9;};'use strict';var UserSettingEvents=require(_0x1b3b('0x0'));var events=['save',_0x1b3b('0x1'),_0x1b3b('0x2')];function createListener(_0x3e4909,_0x4136b0){return function(_0x2e79c9){_0x4136b0[_0x1b3b('0x3')](_0x3e4909,_0x2e79c9);if(_0x3e4909==='user-setting:update'){_0x4136b0[_0x1b3b('0x3')]('user-setting:update:user-'+_0x2e79c9[_0x1b3b('0x4')],_0x2e79c9);}};}exports[_0x1b3b('0x5')]=function(_0x1546e5){for(var _0x5d752e=0x0,_0x1936f5=events[_0x1b3b('0x6')];_0x5d752e<_0x1936f5;_0x5d752e++){var _0xa33ec5=events[_0x5d752e];var _0x14a837=createListener(_0x1b3b('0x7')+_0xa33ec5,_0x1546e5);UserSettingEvents['on'](_0xa33ec5,_0x14a837);}};
\ No newline at end of file
index 3fa16a4..03d61da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84ae=['pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/openchannel_accounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/api_key','createApiKey','put','update','delete','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','/create_many','bulkCreate','addQueues','join','format','%s-%s','now','originalname','single','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause'];(function(_0x4541af,_0x64aa00){var _0x1408c3=function(_0x58a28b){while(--_0x58a28b){_0x4541af['push'](_0x4541af['shift']());}};_0x1408c3(++_0x64aa00);}(_0x84ae,0x101));var _0xe84a=function(_0x6afa2d,_0x8c0e0f){_0x6afa2d=_0x6afa2d-0x0;var _0x1698ee=_0x84ae[_0x6afa2d];return _0x1698ee;};'use strict';var multer=require(_0xe84a('0x0'));var util=require(_0xe84a('0x1'));var path=require(_0xe84a('0x2'));var timeout=require(_0xe84a('0x3'));var express=require(_0xe84a('0x4'));var router=express[_0xe84a('0x5')]();var fs_extra=require(_0xe84a('0x6'));var auth=require(_0xe84a('0x7'));var interaction=require(_0xe84a('0x8'));var config=require('../../config/environment');var controller=require('./user.controller');router['get']('/',auth[_0xe84a('0x9')](),controller['index']);router[_0xe84a('0xa')](_0xe84a('0xb'),auth[_0xe84a('0x9')](),controller[_0xe84a('0xc')]);router['get'](_0xe84a('0xd'),auth[_0xe84a('0x9')](),controller[_0xe84a('0xe')]);router['get'](_0xe84a('0xf'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x10')]);router[_0xe84a('0xa')](_0xe84a('0x11'),auth[_0xe84a('0x9')](),controller['show']);router[_0xe84a('0xa')](_0xe84a('0x12'),controller[_0xe84a('0x13')]);router[_0xe84a('0xa')](_0xe84a('0x14'),auth['isAuthenticated'](),controller['getOpenTabs']);router['get'](_0xe84a('0x15'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0xe84a('0x16'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x17')]);router[_0xe84a('0xa')](_0xe84a('0x18'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x19')]);router[_0xe84a('0xa')]('/:id/groups',auth[_0xe84a('0x9')](),controller[_0xe84a('0x1a')]);router[_0xe84a('0xa')](_0xe84a('0x1b'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x1c')]);router[_0xe84a('0xa')](_0xe84a('0x1d'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x1e')]);router['get']('/:id/chat/interactions',auth[_0xe84a('0x9')](),controller['getChatInteractions']);router['get'](_0xe84a('0x1f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x20')]);router[_0xe84a('0xa')](_0xe84a('0x21'),auth['isAuthenticated'](),controller[_0xe84a('0x22')]);router[_0xe84a('0xa')](_0xe84a('0x23'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x24')]);router[_0xe84a('0xa')](_0xe84a('0x25'),auth[_0xe84a('0x9')](),controller['getFaxInteractions']);router['get']('/:id/whatsapp/interactions',auth[_0xe84a('0x9')](),controller[_0xe84a('0x26')]);router[_0xe84a('0xa')]('/:id/teams',auth[_0xe84a('0x9')](),controller[_0xe84a('0x27')]);router[_0xe84a('0xa')](_0xe84a('0x28'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x29')]);router[_0xe84a('0xa')]('/:id/agents',auth[_0xe84a('0x9')](),controller['getAgents']);router[_0xe84a('0xa')](_0xe84a('0x2a'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x2b')]);router['get']('/:id/fax_accounts',auth[_0xe84a('0x9')](),controller[_0xe84a('0x2c')]);router[_0xe84a('0xa')](_0xe84a('0x2d'),auth['isAuthenticated'](),controller[_0xe84a('0x2e')]);router['get']('/:id/openchannel_accounts',auth[_0xe84a('0x9')](),controller['getOpenchannelAccounts']);router[_0xe84a('0xa')](_0xe84a('0x2f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x30')]);router[_0xe84a('0xa')]('/:id/chat_websites',auth[_0xe84a('0x9')](),controller['getChatWebsites']);router[_0xe84a('0xa')](_0xe84a('0x31'),auth[_0xe84a('0x9')](),controller['getWhatsappAccounts']);router[_0xe84a('0xa')](_0xe84a('0x32'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x33')]);router[_0xe84a('0xa')]('/:id/api_key',auth[_0xe84a('0x9')](),controller['getApiKey']);router[_0xe84a('0x34')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xe84a('0x35')]);router['post']('/',auth[_0xe84a('0x9')](),controller[_0xe84a('0x36')]);router[_0xe84a('0x34')](_0xe84a('0x37'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x38')]);router[_0xe84a('0x34')](_0xe84a('0x16'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x39')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4bea08,_0x190117,_0x1dd8dc){_0x1dd8dc(null,path[_0xe84a('0x3a')](config['root'],'server/files/images/'));},'filename':function(_0x1574d2,_0x4d89b6,_0x5b43b8){_0x5b43b8(null,util[_0xe84a('0x3b')](_0xe84a('0x3c'),Date[_0xe84a('0x3d')](),_0x4d89b6[_0xe84a('0x3e')]));}})});router[_0xe84a('0x34')]('/:id/avatar',upload[_0xe84a('0x3f')]('file'),controller[_0xe84a('0x40')]);router['post'](_0xe84a('0x41'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x42')]);router[_0xe84a('0x34')](_0xe84a('0x43'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x44')]);router['post'](_0xe84a('0x45'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x46')]);router[_0xe84a('0x34')](_0xe84a('0x47'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x48')]);router[_0xe84a('0x34')](_0xe84a('0x49'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x4a')]);router[_0xe84a('0x34')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xe84a('0x4b')]);router[_0xe84a('0x34')](_0xe84a('0x4c'),auth['isAuthenticated'](),controller[_0xe84a('0x4d')]);router[_0xe84a('0x34')](_0xe84a('0x4e'),auth[_0xe84a('0x9')](),controller['addFaxInteractions']);router[_0xe84a('0x34')](_0xe84a('0x4f'),auth['isAuthenticated'](),controller[_0xe84a('0x50')]);router[_0xe84a('0x34')](_0xe84a('0x51'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x52')]);router[_0xe84a('0x34')](_0xe84a('0x53'),auth['isAuthenticated'](),controller[_0xe84a('0x54')]);router[_0xe84a('0x34')]('/:id/fax_accounts',auth[_0xe84a('0x9')](),controller['addFaxAccounts']);router[_0xe84a('0x34')](_0xe84a('0x2d'),auth[_0xe84a('0x9')](),controller['addMailAccounts']);router[_0xe84a('0x34')](_0xe84a('0x55'),auth[_0xe84a('0x9')](),controller['addOpenchannelAccounts']);router[_0xe84a('0x34')](_0xe84a('0x2f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x56')]);router[_0xe84a('0x34')](_0xe84a('0x57'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x58')]);router[_0xe84a('0x34')](_0xe84a('0x31'),auth['isAuthenticated'](),controller[_0xe84a('0x59')]);router[_0xe84a('0x34')](_0xe84a('0x5a'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x5b')]);router[_0xe84a('0x5c')]('/:id',auth[_0xe84a('0x9')](),controller[_0xe84a('0x5d')]);router[_0xe84a('0x5c')]('/:id/password',auth['isAuthenticated'](),controller['changePassword']);router[_0xe84a('0x5e')](_0xe84a('0x16'),auth[_0xe84a('0x9')](),controller['removeQueues']);router[_0xe84a('0x5e')](_0xe84a('0x49'),auth[_0xe84a('0x9')](),controller['removeTeams']);router[_0xe84a('0x5e')](_0xe84a('0x11'),auth[_0xe84a('0x9')](),controller['destroy']);router[_0xe84a('0x5e')](_0xe84a('0x5f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x60')]);router['delete'](_0xe84a('0x4c'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x61')]);router[_0xe84a('0x5e')](_0xe84a('0x4e'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x62')]);router['delete'](_0xe84a('0x4f'),auth['isAuthenticated'](),controller[_0xe84a('0x63')]);router[_0xe84a('0x5e')](_0xe84a('0x51'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x64')]);router[_0xe84a('0x5e')](_0xe84a('0x53'),auth['isAuthenticated'](),controller[_0xe84a('0x65')]);router[_0xe84a('0x5e')](_0xe84a('0x66'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x67')]);router[_0xe84a('0x5e')](_0xe84a('0x2d'),auth[_0xe84a('0x9')](),controller['removeMailAccounts']);router[_0xe84a('0x5e')](_0xe84a('0x55'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x68')]);router[_0xe84a('0x5e')](_0xe84a('0x2f'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x69')]);router[_0xe84a('0x5e')](_0xe84a('0x57'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xe84a('0x5e')]('/:id/whatsapp_accounts',auth[_0xe84a('0x9')](),controller[_0xe84a('0x6a')]);router['delete'](_0xe84a('0x5a'),auth[_0xe84a('0x9')](),controller[_0xe84a('0x6b')]);module[_0xe84a('0x6c')]=router;
\ No newline at end of file
+var _0x7860=['destroy','/:id/chat_interactions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','removeOpenchannelAccounts','removeChatWebsites','removeApiKey','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','get','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','server/files/images/','format','%s-%s','originalname','single','addAvatar','/:id/login','login','/:id/pause','pause','unpause','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','changePassword','delete','removeQueues'];(function(_0x4c9e31,_0x13568b){var _0x386208=function(_0x492b47){while(--_0x492b47){_0x4c9e31['push'](_0x4c9e31['shift']());}};_0x386208(++_0x13568b);}(_0x7860,0xe4));var _0x0786=function(_0x5ccb19,_0x42f12b){_0x5ccb19=_0x5ccb19-0x0;var _0x34b533=_0x7860[_0x5ccb19];return _0x34b533;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0786('0x0'));var timeout=require(_0x0786('0x1'));var express=require('express');var router=express[_0x0786('0x2')]();var fs_extra=require(_0x0786('0x3'));var auth=require(_0x0786('0x4'));var interaction=require(_0x0786('0x5'));var config=require(_0x0786('0x6'));var controller=require(_0x0786('0x7'));router['get']('/',auth[_0x0786('0x8')](),controller['index']);router[_0x0786('0x9')]('/describe',auth[_0x0786('0x8')](),controller[_0x0786('0xa')]);router[_0x0786('0x9')](_0x0786('0xb'),auth[_0x0786('0x8')](),controller[_0x0786('0xc')]);router[_0x0786('0x9')](_0x0786('0xd'),auth[_0x0786('0x8')](),controller[_0x0786('0xe')]);router['get'](_0x0786('0xf'),auth[_0x0786('0x8')](),controller['show']);router[_0x0786('0x9')](_0x0786('0x10'),controller[_0x0786('0x11')]);router[_0x0786('0x9')](_0x0786('0x12'),auth[_0x0786('0x8')](),controller[_0x0786('0x13')]);router[_0x0786('0x9')](_0x0786('0x14'),auth[_0x0786('0x8')](),controller[_0x0786('0x15')]);router[_0x0786('0x9')](_0x0786('0x16'),auth[_0x0786('0x8')](),controller['getQueues']);router[_0x0786('0x9')](_0x0786('0x17'),auth[_0x0786('0x8')](),controller[_0x0786('0x18')]);router[_0x0786('0x9')](_0x0786('0x19'),auth[_0x0786('0x8')](),controller[_0x0786('0x1a')]);router[_0x0786('0x9')](_0x0786('0x1b'),auth[_0x0786('0x8')](),controller[_0x0786('0x1c')]);router['get']('/:id/screen_recordings',auth[_0x0786('0x8')](),controller[_0x0786('0x1d')]);router[_0x0786('0x9')](_0x0786('0x1e'),auth['isAuthenticated'](),controller['getChatInteractions']);router['get']('/:id/openchannel/interactions',auth['isAuthenticated'](),controller[_0x0786('0x1f')]);router[_0x0786('0x9')](_0x0786('0x20'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x0786('0x9')](_0x0786('0x21'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x0786('0x9')](_0x0786('0x22'),auth[_0x0786('0x8')](),controller['getFaxInteractions']);router[_0x0786('0x9')](_0x0786('0x23'),auth[_0x0786('0x8')](),controller[_0x0786('0x24')]);router['get'](_0x0786('0x25'),auth[_0x0786('0x8')](),controller[_0x0786('0x26')]);router[_0x0786('0x9')](_0x0786('0x27'),auth[_0x0786('0x8')](),controller[_0x0786('0x28')]);router['get'](_0x0786('0x29'),auth['isAuthenticated'](),controller[_0x0786('0x2a')]);router[_0x0786('0x9')]('/:id/prefixes',auth[_0x0786('0x8')](),controller[_0x0786('0x2b')]);router['get'](_0x0786('0x2c'),auth[_0x0786('0x8')](),controller[_0x0786('0x2d')]);router[_0x0786('0x9')]('/:id/mail_accounts',auth[_0x0786('0x8')](),controller[_0x0786('0x2e')]);router[_0x0786('0x9')](_0x0786('0x2f'),auth[_0x0786('0x8')](),controller[_0x0786('0x30')]);router['get'](_0x0786('0x31'),auth[_0x0786('0x8')](),controller[_0x0786('0x32')]);router[_0x0786('0x9')](_0x0786('0x33'),auth['isAuthenticated'](),controller[_0x0786('0x34')]);router[_0x0786('0x9')](_0x0786('0x35'),auth[_0x0786('0x8')](),controller[_0x0786('0x36')]);router[_0x0786('0x9')](_0x0786('0x37'),auth['isAuthenticated'](),controller[_0x0786('0x38')]);router[_0x0786('0x9')](_0x0786('0x39'),auth[_0x0786('0x8')](),controller[_0x0786('0x3a')]);router['post']('/:id/contacts',auth[_0x0786('0x8')](),controller[_0x0786('0x3b')]);router[_0x0786('0x3c')]('/',auth[_0x0786('0x8')](),controller['create']);router['post'](_0x0786('0x3d'),auth[_0x0786('0x8')](),controller[_0x0786('0x3e')]);router['post']('/:id/queues',auth['isAuthenticated'](),controller[_0x0786('0x3f')]);var upload=multer({'storage':multer[_0x0786('0x40')]({'destination':function(_0x1d0e36,_0x472bbb,_0x5efae8){_0x5efae8(null,path[_0x0786('0x41')](config['root'],_0x0786('0x42')));},'filename':function(_0x9eb867,_0x12fd7f,_0x195f83){_0x195f83(null,util[_0x0786('0x43')](_0x0786('0x44'),Date['now'](),_0x12fd7f[_0x0786('0x45')]));}})});router[_0x0786('0x3c')](_0x0786('0x10'),upload[_0x0786('0x46')]('file'),controller[_0x0786('0x47')]);router[_0x0786('0x3c')](_0x0786('0x48'),auth[_0x0786('0x8')](),controller[_0x0786('0x49')]);router['post']('/:id/logout',auth[_0x0786('0x8')](),controller['logout']);router['post'](_0x0786('0x4a'),auth[_0x0786('0x8')](),controller[_0x0786('0x4b')]);router['post']('/:id/unpause',auth['isAuthenticated'](),controller[_0x0786('0x4c')]);router[_0x0786('0x3c')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x0786('0x3c')]('/:id/chat_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x4d')]);router[_0x0786('0x3c')]('/:id/mail_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x4e')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x0786('0x4f')]);router[_0x0786('0x3c')](_0x0786('0x50'),auth[_0x0786('0x8')](),controller['addSmsInteractions']);router[_0x0786('0x3c')](_0x0786('0x51'),auth[_0x0786('0x8')](),controller[_0x0786('0x52')]);router[_0x0786('0x3c')]('/:id/whatsapp_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x53')]);router[_0x0786('0x3c')](_0x0786('0x2c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post'](_0x0786('0x54'),auth[_0x0786('0x8')](),controller[_0x0786('0x55')]);router[_0x0786('0x3c')]('/:id/openchannel_accounts',auth[_0x0786('0x8')](),controller[_0x0786('0x56')]);router[_0x0786('0x3c')](_0x0786('0x31'),auth[_0x0786('0x8')](),controller[_0x0786('0x57')]);router[_0x0786('0x3c')](_0x0786('0x33'),auth[_0x0786('0x8')](),controller[_0x0786('0x58')]);router[_0x0786('0x3c')](_0x0786('0x35'),auth[_0x0786('0x8')](),controller[_0x0786('0x59')]);router['post'](_0x0786('0x39'),auth['isAuthenticated'](),controller[_0x0786('0x5a')]);router['put'](_0x0786('0xf'),auth[_0x0786('0x8')](),controller['update']);router[_0x0786('0x5b')](_0x0786('0x5c'),auth[_0x0786('0x8')](),controller[_0x0786('0x5d')]);router[_0x0786('0x5e')]('/:id/queues',auth[_0x0786('0x8')](),controller[_0x0786('0x5f')]);router[_0x0786('0x5e')](_0x0786('0x25'),auth[_0x0786('0x8')](),controller['removeTeams']);router['delete'](_0x0786('0xf'),auth['isAuthenticated'](),controller[_0x0786('0x60')]);router[_0x0786('0x5e')](_0x0786('0x61'),auth[_0x0786('0x8')](),controller['removeChatInteractions']);router[_0x0786('0x5e')](_0x0786('0x62'),auth[_0x0786('0x8')](),controller[_0x0786('0x63')]);router['delete'](_0x0786('0x64'),auth[_0x0786('0x8')](),controller[_0x0786('0x65')]);router[_0x0786('0x5e')]('/:id/sms_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x66')]);router[_0x0786('0x5e')](_0x0786('0x51'),auth[_0x0786('0x8')](),controller['removeOpenchannelInteractions']);router[_0x0786('0x5e')]('/:id/whatsapp_interactions',auth[_0x0786('0x8')](),controller[_0x0786('0x67')]);router['delete']('/:id/fax_accounts',auth[_0x0786('0x8')](),controller['removeFaxAccounts']);router[_0x0786('0x5e')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x0786('0x5e')](_0x0786('0x2f'),auth[_0x0786('0x8')](),controller[_0x0786('0x68')]);router[_0x0786('0x5e')](_0x0786('0x31'),auth[_0x0786('0x8')](),controller['removeSmsAccounts']);router[_0x0786('0x5e')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x0786('0x69')]);router[_0x0786('0x5e')](_0x0786('0x35'),auth[_0x0786('0x8')](),controller['removeWhatsappAccounts']);router[_0x0786('0x5e')](_0x0786('0x39'),auth[_0x0786('0x8')](),controller[_0x0786('0x6a')]);module[_0x0786('0x6b')]=router;
\ No newline at end of file
index eca6039..d2159aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x484041,_0x2e3a0f){var _0x579bdc=function(_0x138b6d){while(--_0x138b6d){_0x484041['push'](_0x484041['shift']());}};_0x579bdc(++_0x2e3a0f);}(_0x70e0,0x17b));var _0x070e=function(_0x3ecb08,_0x56c860){_0x3ecb08=_0x3ecb08-0x0;var _0x535172=_0x70e0[_0x3ecb08];return _0x535172;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe706=['admin','user','agent','telephone','local','accountcode','BOOLEAN','DATE','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept','uac','uas','certificate','active','passive','actpass','update,nonat','showWebBar','get','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','wss','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','rtcp_mux','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','blocked','blockedAt','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM'];(function(_0x3e973b,_0x439ae2){var _0x5b98f0=function(_0x2e9d01){while(--_0x2e9d01){_0x3e973b['push'](_0x3e973b['shift']());}};_0x5b98f0(++_0x439ae2);}(_0xe706,0xa3));var _0x6e70=function(_0x2e1a2,_0x81aa1c){_0x2e1a2=_0x2e1a2-0x0;var _0x3df6c8=_0xe706[_0x2e1a2];return _0x3df6c8;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var _=require('lodash');module[_0x6e70('0x3')]={'name':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x7dfbc3){this[_0x6e70('0x6')](_0x6e70('0x5'),_0x7dfbc3);this[_0x6e70('0x6')](_0x6e70('0x7'),_0x7dfbc3);},'comment':_0x6e70('0x8')},'fullname':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'set':function(_0x36357b){this[_0x6e70('0x6')](_0x6e70('0x9'),_0x36357b);this[_0x6e70('0x6')](_0x6e70('0xa'),util[_0x6e70('0xb')](_0x6e70('0xc'),_0x36357b,this[_0x6e70('0xd')](_0x6e70('0xe'))));}},'alias':{'type':Sequelize[_0x6e70('0x4')]},'email':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'unique':_0x6e70('0xf'),'validate':{'isEmail':!![]},'set':function(_0x37b3e0){if(_0x37b3e0){this[_0x6e70('0x6')]('email',_0x37b3e0['toLowerCase']());}}},'role':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x11'),_0x6e70('0x12'),_0x6e70('0x13'),_0x6e70('0x14')),'allowNull':![]},'password':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':_0x6e70('0x15')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x48bc72){this[_0x6e70('0x6')]('internal',_0x48bc72);this['setDataValue'](_0x6e70('0x16'),_0x48bc72);this[_0x6e70('0x6')]('callerid',util[_0x6e70('0xb')]('\x22%s\x22\x20<%s>',this[_0x6e70('0xd')](_0x6e70('0x9')),_0x48bc72));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x6e70('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x6e70('0x4')]},'userpic':{'type':Sequelize[_0x6e70('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x6e70('0x18')]},'voicePause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x6e70('0x18')]},'chatCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x1a')},'ipaddr':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x6e70('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1b'),'user',_0x6e70('0x1c')),'allowNull':!![],'defaultValue':_0x6e70('0x1b')},'context':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x1d')},'callingpres':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x1e'),_0x6e70('0x1f'),_0x6e70('0x20'),_0x6e70('0x21'),_0x6e70('0x22'),'PROHIB_PASSED_SCREEN',_0x6e70('0x23'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x24'),'set':function(_0x42b094){this['setDataValue'](_0x6e70('0x25'),_0x42b094?_0x42b094[_0x6e70('0x26')](','):null);},'get':function(){return this['getDataValue'](_0x6e70('0x25'))?this[_0x6e70('0xd')](_0x6e70('0x25'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x28')},'dtmfmode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x29'),_0x6e70('0x2a'),_0x6e70('0x2b'),_0x6e70('0x2c'),'auto'),'allowNull':!![],'defaultValue':_0x6e70('0x29')},'directmedia':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no',_0x6e70('0x2e'),_0x6e70('0x2f'),_0x6e70('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'defaultValue':_0x6e70('0x31'),'set':function(_0x2a5444){this[_0x6e70('0x6')](_0x6e70('0x32'),_0x2a5444?_0x2a5444['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x6e70('0xd')](_0x6e70('0x32'))[_0x6e70('0x27')](','):null;},'comment':_0x6e70('0x33')},'callgroup':{'type':Sequelize[_0x6e70('0x4')]},'namedcallgroup':{'type':Sequelize[_0x6e70('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x6e70('0x4')]},'language':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x6e70('0x4')]},'disallow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x34')},'allow':{'type':Sequelize[_0x6e70('0x4')],'allowNull':![],'defaultValue':_0x6e70('0x35'),'set':function(_0x16fc7d){this['setDataValue'](_0x6e70('0x36'),_0x16fc7d?_0x16fc7d[_0x6e70('0x26')](';'):_0x6e70('0x35'));},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x36'))?this[_0x6e70('0xd')](_0x6e70('0x36'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![],'set':function(_0x83847b){this[_0x6e70('0x6')](_0x6e70('0x37'),_0x83847b?_0x83847b['join'](','):null);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x37'))?this[_0x6e70('0xd')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x6e70('0x38')},'amaflags':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x6e70('0x2d')},'busylevel':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x6e70('0x10')]('yes','no',_0x6e70('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3a'),'refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3b'),_0x6e70('0x3c')),'allowNull':!![],'defaultValue':_0x6e70('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','fingerprint',_0x6e70('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x3e'),_0x6e70('0x3f'),_0x6e70('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x6e70('0x19')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x6e70('0x10')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no','nonat',_0x6e70('0x2f'),_0x6e70('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x6e70('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x6e70('0x18')]},'passwordResetAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2f9be4){this[_0x6e70('0x6')](_0x6e70('0x42'),_0x2f9be4);var _0x41a861=this[_0x6e70('0x43')]({'plain':!![]});switch(_0x2f9be4){case 0x0:case 0x1:var _0x739946=_0x41a861[_0x6e70('0x25')]?_['isArray'](_0x41a861['transport'])?_0x41a861[_0x6e70('0x25')][_0x6e70('0x26')]():_0x41a861[_0x6e70('0x25')]:_0x6e70('0x24');if(_0x739946==='wss'){_0x739946='udp';}this[_0x6e70('0x6')](_0x6e70('0x25'),_0x739946);this['setDataValue']('encryption','no');this[_0x6e70('0x6')]('avpf',null);this[_0x6e70('0x6')](_0x6e70('0x44'),null);this[_0x6e70('0x6')](_0x6e70('0x45'),null);this[_0x6e70('0x6')](_0x6e70('0x46'),null);this[_0x6e70('0x6')](_0x6e70('0x47'),null);this['setDataValue'](_0x6e70('0x48'),null);this[_0x6e70('0x6')](_0x6e70('0x49'),null);this[_0x6e70('0x6')](_0x6e70('0x4a'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x6e70('0x25'),_0x6e70('0x4b'));this[_0x6e70('0x6')]('encryption','yes');this[_0x6e70('0x6')](_0x6e70('0x4c'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x44'),_0x6e70('0x2d'));this['setDataValue'](_0x6e70('0x45'),_0x6e70('0x2d'));this[_0x6e70('0x6')](_0x6e70('0x46'),'yes');this[_0x6e70('0x6')]('dtlsverify','no');this['setDataValue'](_0x6e70('0x48'),_0x6e70('0x40'));this[_0x6e70('0x6')](_0x6e70('0x49'),_0x41a861[_0x6e70('0x49')]||_0x6e70('0x4d'));this['setDataValue'](_0x6e70('0x4a'),_0x41a861[_0x6e70('0x4a')]||_0x6e70('0x4e'));this[_0x6e70('0x6')](_0x6e70('0x4f'),_0x6e70('0x2d'));break;default:}}},'permissions':{'type':Sequelize[_0x6e70('0x50')],'set':function(_0xd9b4a9){this[_0x6e70('0x6')](_0x6e70('0x51'),_0xd9b4a9?_0xd9b4a9['join'](','):[]);},'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x51'))?_[_0x6e70('0x52')](this['getDataValue']('permissions')[_0x6e70('0x27')](','),function(_0x18ecf0){return parseInt(_0x18ecf0,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x6e70('0x10')](_0x6e70('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x6e70('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x6e70('0x53')],'get':function(){return this[_0x6e70('0xd')](_0x6e70('0x54'))?this[_0x6e70('0xd')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x6e70('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x6e70('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x576069){if(typeof _0x576069===_0x6e70('0x55')){var _0x21e4c2=_0x576069==='1'?!![]:_0x576069==='0'?![]:_0x576069===_0x6e70('0x56')?!![]:_0x576069==='false'?![]:![];this['setDataValue']('screenrecording',_0x21e4c2);}else{this[_0x6e70('0x6')]('screenrecording',_0x576069);}}},'blocked':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![],'set':function(_0x34237d){this[_0x6e70('0x6')](_0x6e70('0x57'),_0x34237d);if(_0x34237d===!![]){this[_0x6e70('0x6')](_0x6e70('0x58'),moment());this[_0x6e70('0x6')]('loginAttempts',0x0);}else{this[_0x6e70('0x6')](_0x6e70('0x58'),null);}}},'blockedAt':{'type':Sequelize[_0x6e70('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x6e70('0x19')](0x5)[_0x6e70('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x6e70('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x6e70('0x19')],'defaultValue':0x0}};
\ No newline at end of file
index 543e9a5..a1e4791 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa999=['$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$any','firstName','lastName','CmContact','Contact','dialActive','getApiKey','retrieveApiKey','token','createApiKey','generateApiKey','iat','nonce','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','queues','teams','inbound','flatten','getAgents','lower','toString','asc','desc','substring','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','QueryTypes','SELECT','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','defaults','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','role','agent','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','Telephones','telephone','ignore','map','value','find','name','stack','send','index','fieldName','type','key','filter','includes','password','salt','getOptions','include','UserSetting','userSetting','attributes','push','User','findAll','rows','query','true','length','chat','dataValues','sms','all','show','keys','rawAttributes','filters','intersection','model','fields','merge','openTabs','openchannel','whatsapp','fax','mail','body','params','describe','addContacts','ids','internal','Setting','securePassword','isNil','min_internal','sequelize','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','105','106','107','108','109','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileResource','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','UserProfileSection','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','loginInPause','interface','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','Queue:save','voice','VoiceQueue','online','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','channel','isValidChannel','isArray','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','concat','getContacts','order','sort','where','pick','options','hasOwnProperty','includeAll','List','Tag','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','intrf','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','MemberReport','logout','QueuePause','pause','updateAttributes','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','unpause','getTeams','Team','addTeams','resolve','transaction','getAssociatedQueues','getDataValue','Voice','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','TeamVoicePrefix','VoicePrefixId','getLists','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte'];(function(_0x274027,_0x139eb9){var _0x4f0c14=function(_0x28c5ed){while(--_0x28c5ed){_0x274027['push'](_0x274027['shift']());}};_0x4f0c14(++_0x139eb9);}(_0xa999,0x1d9));var _0x9a99=function(_0x2da816,_0xaaa369){_0x2da816=_0x2da816-0x0;var _0x312c31=_0xa999[_0x2da816];return _0x312c31;};'use strict';var moment=require(_0x9a99('0x0'));var util=require(_0x9a99('0x1'));var path=require(_0x9a99('0x2'));var fs=require('fs');var _=require(_0x9a99('0x3'));var squel=require(_0x9a99('0x4'));var jayson=require(_0x9a99('0x5'));var Redis=require(_0x9a99('0x6'));var authService=require(_0x9a99('0x7'));var qs=require(_0x9a99('0x8'));var logger=require('../../config/logger')(_0x9a99('0x9'));var utils=require(_0x9a99('0xa'));var config=require(_0x9a99('0xb'));var licenseUtil=require(_0x9a99('0xc'));var APIBadRequestError=require(_0x9a99('0xd'))[_0x9a99('0xe')];var APINotFoundError=require(_0x9a99('0xd'))[_0x9a99('0xf')];var APIHandleError=require(_0x9a99('0xd'))[_0x9a99('0x10')];var db=require(_0x9a99('0x11'))['db'];var socket=require(_0x9a99('0x12'))(new Redis(config[_0x9a99('0x13')]));require(_0x9a99('0x14'))['register'](socket);config['redis']=_[_0x9a99('0x15')](config['redis'],{'host':_0x9a99('0x16'),'port':0x18eb});var amiClient=jayson[_0x9a99('0x17')][_0x9a99('0x18')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5972d1,_0x213102,_0x49e529,_0x2c664c){return new Promise(function(_0x14a5c5,_0x23d3df){var _0xfeda6a=_0x2c664c||amiClient;return _0xfeda6a[_0x9a99('0x19')](_0x5972d1,_0x49e529)[_0x9a99('0x1a')](function(_0x3b5d46){logger[_0x9a99('0x1b')](_0x9a99('0x1c'),_0x213102,_0x9a99('0x1d'));logger['debug'](_0x9a99('0x1e'),_0x213102,_0x9a99('0x1d'),JSON['stringify'](_0x3b5d46));if(_0x3b5d46['error']){if(_0x3b5d46[_0x9a99('0x1f')][_0x9a99('0x20')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x213102,_0x3b5d46[_0x9a99('0x1f')][_0x9a99('0x21')]);return _0x23d3df(_0x3b5d46[_0x9a99('0x1f')]['message']);}logger[_0x9a99('0x1f')](_0x9a99('0x1c'),_0x213102,_0x3b5d46[_0x9a99('0x1f')][_0x9a99('0x21')]);return _0x14a5c5(_0x3b5d46[_0x9a99('0x1f')][_0x9a99('0x21')]);}else{logger[_0x9a99('0x1b')](_0x9a99('0x1c'),_0x213102,_0x9a99('0x1d'));_0x14a5c5(_0x3b5d46[_0x9a99('0x22')][_0x9a99('0x21')]);}})[_0x9a99('0x23')](function(_0x2c5ce2){logger[_0x9a99('0x1f')](_0x9a99('0x1c'),_0x213102,_0x2c5ce2);_0x23d3df(_0x2c5ce2);});});}function respondWithStatusCode(_0x411795,_0x2bc242){_0x2bc242=_0x2bc242||0xcc;return function(_0x15fda5){if(_0x15fda5){return _0x411795[_0x9a99('0x24')](_0x2bc242);}return _0x411795[_0x9a99('0x25')](_0x2bc242)[_0x9a99('0x26')]();};}function respondWithResult(_0x2b1105,_0x1e8940){_0x1e8940=_0x1e8940||0xc8;return function(_0x410d28){if(_0x410d28){return _0x2b1105['status'](_0x1e8940)[_0x9a99('0x27')](_0x410d28);}};}function respondWithFilteredResult(_0x1fc7a1,_0x513268){return function(_0x40f01c){if(_0x40f01c){var _0x38881f=typeof _0x513268[_0x9a99('0x28')]==='undefined'&&typeof _0x513268[_0x9a99('0x29')]==='undefined';var _0x5bbfe0=_0x40f01c[_0x9a99('0x2a')];var _0x56c9b4=_0x38881f?0x0:_0x513268['offset'];var _0x4d80f3=_0x38881f?_0x40f01c['count']:_0x513268['offset']+_0x513268[_0x9a99('0x29')];var _0x11e563;if(_0x4d80f3>=_0x5bbfe0){_0x4d80f3=_0x5bbfe0;_0x11e563=0xc8;}else{_0x11e563=0xce;}_0x1fc7a1['status'](_0x11e563);return _0x1fc7a1[_0x9a99('0x2b')](_0x9a99('0x2c'),_0x56c9b4+'-'+_0x4d80f3+'/'+_0x5bbfe0)['json'](_0x40f01c);}return null;};}function saveUpdates(_0x51ac0e){return function(_0x5eae5e){if(_0x5eae5e){return _0x5eae5e[_0x9a99('0x2d')](_0x51ac0e)[_0x9a99('0x1a')](function(_0x2962af){if(_0x2962af[_0x9a99('0x2e')]===_0x9a99('0x2f')){socket[_0x9a99('0x30')](_0x9a99('0x31')+_0x2962af['id'],_0x2962af);}return _0x2962af;});}return null;};}function removeEntity(_0x597698){return function(_0x1e0c46){if(_0x1e0c46){return _0x1e0c46[_0x9a99('0x32')]()[_0x9a99('0x1a')](function(){var _0x5b73b9=_0x1e0c46[_0x9a99('0x33')]({'plain':!![]});if(_0x5b73b9[_0x9a99('0x2e')]===_0x9a99('0x34'))return;var _0x2f30d8=[{'name':_0x9a99('0x35'),'value':_0x9a99('0x36'),'ignore':!![]},{'name':_0x9a99('0x37'),'value':_0x9a99('0x2f'),'ignore':![]},{'name':_0x9a99('0x38'),'value':_0x9a99('0x39'),'ignore':![]}];var _0x484603=_(_0x2f30d8)['filter'](_0x9a99('0x3a'))[_0x9a99('0x3b')](_0x9a99('0x3c'))[_0x9a99('0x3c')]();if(_['includes'](_0x484603,_0x5b73b9[_0x9a99('0x2e')])){return;}var _0x2b1196=_[_0x9a99('0x3d')](_0x2f30d8,[_0x9a99('0x3c'),_0x5b73b9['role']])[_0x9a99('0x3e')];return db['UserProfileResource'][_0x9a99('0x32')]({'where':{'type':_0x2b1196,'resourceId':_0x5b73b9['id']}})[_0x9a99('0x1a')](function(){return _0x1e0c46;});})[_0x9a99('0x1a')](function(){_0x597698[_0x9a99('0x25')](0xcc)[_0x9a99('0x26')]();});}};}function handleEntityNotFound(_0x15b277){return function(_0x52b452){if(!_0x52b452){_0x15b277[_0x9a99('0x24')](0x194);}return _0x52b452;};}function handleError(_0x2d1ada,_0x5b651c){_0x5b651c=_0x5b651c||0x1f4;return function(_0x35564e){logger[_0x9a99('0x1f')](_0x35564e[_0x9a99('0x3f')]);if(_0x35564e[_0x9a99('0x3e')]){delete _0x35564e['name'];}_0x2d1ada[_0x9a99('0x25')](_0x5b651c)[_0x9a99('0x40')](_0x35564e);};}exports[_0x9a99('0x41')]=function(_0x28561c,_0x1a3674){var _0x195a85={},_0x5f05={'count':0x0,'rows':[]};var _0x2085e0=_(db['User']['rawAttributes'])[_0x9a99('0x3b')](function(_0xa9bb27){return{'name':_0xa9bb27[_0x9a99('0x42')],'type':_0xa9bb27[_0x9a99('0x43')][_0x9a99('0x44')]};})[_0x9a99('0x45')](function(_0x38ccf4){return!_[_0x9a99('0x46')]([_0x9a99('0x47'),_0x9a99('0x48')],_0x38ccf4[_0x9a99('0x3e')]);})['value']();_0x195a85=qs[_0x9a99('0x49')](_0x2085e0,_0x28561c);var _0x3d97bd={'where':_0x195a85['where']};return db['User']['count'](_0x3d97bd)[_0x9a99('0x1a')](function(_0x2db199){_0x5f05['count']=_0x2db199;if(_0x28561c['query']['includeAll']){_0x195a85[_0x9a99('0x4a')]=[{'all':!![]}];}if(_0x28561c['query']['userSetting']==='true'){_0x195a85['include']=[{'model':db[_0x9a99('0x4b')],'as':_0x9a99('0x4c')}];}if(!_[_0x9a99('0x46')](_0x195a85[_0x9a99('0x4d')],'id')){_0x195a85[_0x9a99('0x4d')][_0x9a99('0x4e')]('id');}return db[_0x9a99('0x4f')][_0x9a99('0x50')](_0x195a85);})['then'](function(_0x70c63b){_0x5f05[_0x9a99('0x51')]=_0x70c63b;if(_0x28561c[_0x9a99('0x52')]['openTabs']===_0x9a99('0x53')){var _0x1e8c12=[];for(var _0xb1558d=0x0;_0xb1558d<_0x5f05[_0x9a99('0x51')][_0x9a99('0x54')];_0xb1558d++){_0x1e8c12[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x55'),_0x5f05[_0x9a99('0x51')][_0xb1558d][_0x9a99('0x56')]));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x57'),_0x5f05['rows'][_0xb1558d]['dataValues']));_0x1e8c12['push'](get_open_tabs('fax',_0x5f05[_0x9a99('0x51')][_0xb1558d]['dataValues']));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs('mail',_0x5f05[_0x9a99('0x51')][_0xb1558d]['dataValues']));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs('openchannel',_0x5f05[_0x9a99('0x51')][_0xb1558d][_0x9a99('0x56')]));_0x1e8c12[_0x9a99('0x4e')](get_open_tabs('whatsapp',_0x5f05[_0x9a99('0x51')][_0xb1558d][_0x9a99('0x56')]));}return Promise[_0x9a99('0x58')](_0x1e8c12)[_0x9a99('0x1a')](function(){return _0x5f05;});}else{return _0x5f05;}})[_0x9a99('0x1a')](respondWithFilteredResult(_0x1a3674,_0x195a85))[_0x9a99('0x23')](handleError(_0x1a3674,null));};exports[_0x9a99('0x59')]=function(_0x4f114f,_0x27b081){var _0xcd573f={'raw':![],'where':{'id':_0x4f114f['params']['id']}},_0x4d2790={};_0x4d2790['model']=_['differenceBy'](_[_0x9a99('0x5a')](db[_0x9a99('0x4f')][_0x9a99('0x5b')]),[_0x9a99('0x47'),'salt']);_0x4d2790[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x4f114f[_0x9a99('0x52')]);_0x4d2790[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x4d2790[_0x9a99('0x5e')],_0x4d2790[_0x9a99('0x52')]);_0xcd573f[_0x9a99('0x4d')]=_['intersection'](_0x4d2790['model'],qs[_0x9a99('0x5f')](_0x4f114f[_0x9a99('0x52')]['fields']));_0xcd573f[_0x9a99('0x4d')]=_0xcd573f[_0x9a99('0x4d')]['length']?_0xcd573f[_0x9a99('0x4d')]:_0x4d2790[_0x9a99('0x5e')];if(_0x4f114f['query']['includeAll']){_0xcd573f[_0x9a99('0x4a')]=[{'all':!![]}];}if(_0x4f114f[_0x9a99('0x52')]['userSetting']==='true'){_0xcd573f[_0x9a99('0x4a')]=[{'model':db[_0x9a99('0x4b')],'as':_0x9a99('0x4c')}];}_0xcd573f=_[_0x9a99('0x60')]({},_0xcd573f,_0x4f114f['options']);if(!_[_0x9a99('0x46')](_0xcd573f[_0x9a99('0x4d')],'id')){_0xcd573f[_0x9a99('0x4d')][_0x9a99('0x4e')]('id');}return db['User'][_0x9a99('0x3d')](_0xcd573f)[_0x9a99('0x1a')](handleEntityNotFound(_0x27b081,null))['then'](function(_0x4dce96){var _0x312b2c=[];values=_0x4dce96;if(_0x4f114f['query'][_0x9a99('0x61')]===_0x9a99('0x53')){_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x55'),_0x4dce96['dataValues']));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x57'),_0x4dce96['dataValues']));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x62'),_0x4dce96[_0x9a99('0x56')]));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x63'),_0x4dce96[_0x9a99('0x56')]));_0x312b2c['push'](get_open_tabs(_0x9a99('0x64'),_0x4dce96[_0x9a99('0x56')]));_0x312b2c[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x65'),_0x4dce96['dataValues']));return Promise['all'](_0x312b2c);}else{return values;}})[_0x9a99('0x1a')](function(){return values;})[_0x9a99('0x1a')](respondWithResult(_0x27b081,null))[_0x9a99('0x23')](handleError(_0x27b081,null));};exports[_0x9a99('0x2d')]=function(_0x29a51e,_0x4a9e4d){if(_0x29a51e[_0x9a99('0x66')]['id']){delete _0x29a51e[_0x9a99('0x66')]['id'];}delete _0x29a51e[_0x9a99('0x66')][_0x9a99('0x2e')];return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x29a51e[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x4a9e4d,null))[_0x9a99('0x1a')](saveUpdates(_0x29a51e['body'],null))[_0x9a99('0x1a')](respondWithResult(_0x4a9e4d,null))[_0x9a99('0x23')](handleError(_0x4a9e4d,null));};exports[_0x9a99('0x68')]=function(_0x46d42a,_0x1d2e8a){return db[_0x9a99('0x4f')][_0x9a99('0x68')]()[_0x9a99('0x1a')](respondWithResult(_0x1d2e8a,null))[_0x9a99('0x23')](handleError(_0x1d2e8a,null));};exports[_0x9a99('0x69')]=function(_0x36934f,_0x3687f8){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x36934f[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3687f8,null))[_0x9a99('0x1a')](function(_0x4c67c9){if(_0x4c67c9){return _0x4c67c9[_0x9a99('0x69')](_0x36934f[_0x9a99('0x66')][_0x9a99('0x6a')],_['omit'](_0x36934f[_0x9a99('0x66')],[_0x9a99('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x3687f8,null))[_0x9a99('0x23')](handleError(_0x3687f8,null));};function validateUser(_0x4c0e99){return new Promise(function(_0x5510e4,_0x56d2a9){if(_0x4c0e99[_0x9a99('0x6b')])return _0x5510e4(_0x4c0e99);return db[_0x9a99('0x6c')]['findById'](0x1)[_0x9a99('0x1a')](function(_0x54c29f){if(_0x54c29f[_0x9a99('0x6d')])authService['validatePasswordPattern'](_0x4c0e99[_0x9a99('0x47')]);db[_0x9a99('0x4f')]['max']('internal')[_0x9a99('0x1a')](function(_0x1d7778){if(_[_0x9a99('0x6e')](_0x1d7778)){_0x4c0e99[_0x9a99('0x6b')]=_0x54c29f[_0x9a99('0x6f')]||0x1;return;}if(_[_0x9a99('0x6e')](_0x54c29f[_0x9a99('0x6f')])||_0x54c29f[_0x9a99('0x6f')]===_0x1d7778){_0x4c0e99[_0x9a99('0x6b')]=_0x1d7778+0x1;return;}if(_0x54c29f[_0x9a99('0x6f')]>_0x1d7778){_0x4c0e99[_0x9a99('0x6b')]=_0x54c29f[_0x9a99('0x6f')];return;}return db[_0x9a99('0x70')][_0x9a99('0x52')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x9a99('0x70')]['QueryTypes']['SELECT']})[_0x9a99('0x1a')](function(_0x428bab){if(_0x428bab&&_0x428bab['length']){for(var _0x3de28f=0x0,_0x4506a3=_0x428bab[_0x9a99('0x54')];_0x3de28f<_0x4506a3&&_[_0x9a99('0x6e')](_0x4c0e99[_0x9a99('0x6b')]);_0x3de28f++){if(_0x54c29f[_0x9a99('0x6f')]<=_0x428bab[_0x3de28f][_0x9a99('0x71')]){_0x4c0e99[_0x9a99('0x6b')]=_0x428bab[_0x3de28f]['from'];}else if(_0x54c29f[_0x9a99('0x6f')]>_0x428bab[_0x3de28f][_0x9a99('0x71')]&&_0x54c29f[_0x9a99('0x6f')]<=_0x428bab[_0x3de28f]['to']){_0x4c0e99['internal']=_0x54c29f[_0x9a99('0x6f')];}}}if(_[_0x9a99('0x6e')](_0x4c0e99['internal'])){_0x4c0e99[_0x9a99('0x6b')]=_0x1d7778+0x1;}return _0x5510e4(_0x4c0e99);});});})[_0x9a99('0x23')](function(_0x14016d){_0x56d2a9(_0x14016d);});});}function updateUser(_0x8aaf4f){return new Promise(function(_0x3cda5b,_0x55c6c7){try{if(_0x8aaf4f[_0x9a99('0x72')]){_0x8aaf4f[_0x9a99('0x73')]=_0x8aaf4f[_0x9a99('0x6b')];_0x8aaf4f[_0x9a99('0x74')]={'mailbox':_0x8aaf4f[_0x9a99('0x6b')],'password':_0x8aaf4f[_0x9a99('0x47')],'fullname':_0x8aaf4f[_0x9a99('0x75')],'email':_0x8aaf4f[_0x9a99('0x76')]};}if(_0x8aaf4f[_0x9a99('0x2e')]===_0x9a99('0x2f')){if(!_0x8aaf4f[_0x9a99('0x77')])_0x8aaf4f['permissions']=[_0x9a99('0x78'),_0x9a99('0x79'),_0x9a99('0x7a'),_0x9a99('0x7b'),_0x9a99('0x7c'),_0x9a99('0x7d'),_0x9a99('0x7e'),_0x9a99('0x7f'),_0x9a99('0x80'),_0x9a99('0x81'),_0x9a99('0x82'),'100',_0x9a99('0x83'),_0x9a99('0x84'),_0x9a99('0x85')];}_0x3cda5b(_0x8aaf4f);}catch(_0x2c750f){_0x55c6c7(_0x2c750f);}});}exports[_0x9a99('0x86')]=function(_0x23bb61,_0x5f2c83){if(_0x23bb61[_0x9a99('0x36')][_0x9a99('0x2e')]==='agent')throw new Error(_0x9a99('0x87'));if(_0x23bb61['body'][_0x9a99('0x2e')]===_0x9a99('0x36')&&_0x23bb61[_0x9a99('0x36')][_0x9a99('0x2e')]!=='admin'){throw new Error(_0x9a99('0x88'));}if(_0x23bb61[_0x9a99('0x66')][_0x9a99('0x2e')]==='admin'&&_0x23bb61[_0x9a99('0x36')][_0x9a99('0x2e')]!==_0x9a99('0x34')){throw new Error(_0x9a99('0x89'));}return licenseUtil[_0x9a99('0x8a')]([_0x23bb61[_0x9a99('0x66')]])['then'](function(){return validateUser(_0x23bb61[_0x9a99('0x66')]);})['then'](function(_0x16d67d){return updateUser(_0x16d67d)['then'](function(_0x2aa0a0){if(_0x2aa0a0[_0x9a99('0x2e')]==='admin'){_0x2aa0a0[_0x9a99('0x8b')]=_0x23bb61[_0x9a99('0x36')][_0x9a99('0x8b')];delete _0x2aa0a0[_0x9a99('0x8c')];}return _0x2aa0a0;});})[_0x9a99('0x1a')](function(_0x51c2c3){return db['User'][_0x9a99('0x86')](_0x51c2c3,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x9a99('0x1a')](function(_0x373e6f){if(_0x23bb61[_0x9a99('0x66')][_0x9a99('0x2e')]===_0x9a99('0x36'))return _0x373e6f;if(_0x23bb61['user'][_0x9a99('0x2e')]!==_0x9a99('0x36'))return _0x373e6f;return db['UserProfileSection'][_0x9a99('0x3d')]({'where':{'name':_0x373e6f[_0x9a99('0x2e')]==='agent'?_0x9a99('0x37'):_0x9a99('0x38'),'userProfileId':_0x23bb61[_0x9a99('0x36')][_0x9a99('0x8c')]},'raw':!![]})['then'](function(_0xa727ba){if(!_0xa727ba||_0xa727ba['autoAssociation']!=0x0)return _0x373e6f;return db[_0x9a99('0x8d')]['create']({'name':_0x373e6f[_0x9a99('0x3e')],'resourceId':_0x373e6f['id'],'type':_0xa727ba[_0x9a99('0x3e')],'sectionId':_0xa727ba['id']},{})['then'](function(){return _0x373e6f;});})[_0x9a99('0x23')](function(_0x29e230){logger[_0x9a99('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e230);throw _0x29e230;});})['then'](respondWithResult(_0x5f2c83,0xc9))[_0x9a99('0x23')](handleError(_0x5f2c83,null));};exports[_0x9a99('0x8e')]=function(_0x51c75a,_0x373ccc){var _0x2ddf37=_0x51c75a[_0x9a99('0x66')];var _0x21eebc=[];if(_0x51c75a['user']['role']===_0x9a99('0x2f'))throw new Error('Unauthorized');if(_[_0x9a99('0x8f')](_0x2ddf37,[_0x9a99('0x2e'),_0x9a99('0x36')])&&_0x51c75a[_0x9a99('0x36')]['role']!==_0x9a99('0x34')){throw new Error(_0x9a99('0x88'));}if(_['some'](_0x2ddf37,[_0x9a99('0x2e'),_0x9a99('0x34')])&&_0x51c75a[_0x9a99('0x36')]['role']!==_0x9a99('0x34')){throw new Error(_0x9a99('0x90'));}return licenseUtil[_0x9a99('0x8a')](_0x2ddf37)[_0x9a99('0x1a')](function(){return validateUser(_0x2ddf37[0x0]);})[_0x9a99('0x1a')](function(){for(var _0x34eb0d=0x1;_0x34eb0d<_0x2ddf37[_0x9a99('0x54')];_0x34eb0d++){var _0x330411=_0x2ddf37[_0x34eb0d-0x1][_0x9a99('0x6b')];if(!_0x2ddf37[_0x34eb0d][_0x9a99('0x6b')])_0x2ddf37[_0x34eb0d][_0x9a99('0x6b')]=_0x330411+0x1;_0x21eebc[_0x9a99('0x4e')](validateUser(_0x2ddf37[_0x34eb0d]));}return Promise[_0x9a99('0x58')](_0x21eebc);})[_0x9a99('0x1a')](function(){_0x21eebc=[];for(var _0x1ba562=0x0;_0x1ba562<_0x2ddf37[_0x9a99('0x54')];_0x1ba562++){_0x21eebc['push'](updateUser(_0x2ddf37[_0x1ba562]));}return Promise['all'](_0x21eebc);})[_0x9a99('0x1a')](function(){_0x21eebc=_0x2ddf37[_0x9a99('0x3b')](function(_0x14501b){return db[_0x9a99('0x4f')][_0x9a99('0x86')](_0x14501b,{'include':[{'model':db['VoiceMail'],'as':_0x9a99('0x74')}]})[_0x9a99('0x1a')](function(_0xe44a44){_0x14501b['id']=_0xe44a44['id'];return _0x14501b;});});return Promise[_0x9a99('0x58')](_0x21eebc);})[_0x9a99('0x1a')](function(_0x4f49b6){if(_0x51c75a['body'][_0x9a99('0x2e')]===_0x9a99('0x36'))return _0x4f49b6;if(_0x51c75a[_0x9a99('0x36')][_0x9a99('0x2e')]!==_0x9a99('0x36'))return _0x4f49b6;var _0x205052=_['some'](_0x4f49b6,function(_0x16a562){return _0x16a562['role']===_0x9a99('0x2f')||_0x16a562[_0x9a99('0x2e')]===_0x9a99('0x39');});if(!_0x205052)return _0x4f49b6;return db[_0x9a99('0x91')][_0x9a99('0x50')]({'where':{'name':{'$or':[_0x9a99('0x37'),'Telephones']},'userProfileId':_0x51c75a[_0x9a99('0x36')][_0x9a99('0x8c')]},'raw':!![]})['then'](function(_0x481db2){if(_[_0x9a99('0x92')](_0x481db2)||!_[_0x9a99('0x8f')](_0x481db2,[_0x9a99('0x93'),0x0]))return _0x4f49b6;_0x21eebc=[];var _0x40db3f=_(_0x481db2)[_0x9a99('0x3b')](function(_0x3e941b){if(_0x3e941b[_0x9a99('0x93')]===0x1)return;return _0x3e941b['name']===_0x9a99('0x37')?_0x9a99('0x2f'):_0x9a99('0x39');})[_0x9a99('0x94')]()[_0x9a99('0x3c')]();for(var _0x4d770f=0x0;_0x4d770f<_0x4f49b6[_0x9a99('0x54')];_0x4d770f++){if(!_['includes'](_0x40db3f,_0x4f49b6[_0x4d770f]['role']))return;var _0x36761e=_0x4f49b6[_0x4d770f]['role']==='agent'?_0x9a99('0x37'):_0x9a99('0x38');_0x21eebc['push'](db[_0x9a99('0x8d')]['create']({'name':_0x4f49b6[_0x4d770f]['name'],'resourceId':_0x4f49b6[_0x4d770f]['id'],'type':_0x36761e,'sectionId':_[_0x9a99('0x3d')](_0x481db2,[_0x9a99('0x3e'),_0x36761e])['id']},{}));}return Promise[_0x9a99('0x58')](_0x21eebc);});})['then'](respondWithResult(_0x373ccc,0xc9))[_0x9a99('0x23')](handleError(_0x373ccc,null));};exports[_0x9a99('0x95')]=function(_0x200e78,_0x2ea6e4){if(_0x200e78[_0x9a99('0x66')]['id']){delete _0x200e78['body']['id'];}return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x200e78[_0x9a99('0x67')]['id']}})['then'](function(_0x4c9211){if(!_0x4c9211)return null;if(_0x4c9211['id']===_0x200e78[_0x9a99('0x36')]['id']){if(!_0x200e78['body'][_0x9a99('0x96')]||!_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db['Sequelize'][(_0x9a99('0x98'))](_0x9a99('0x99'));}if(!_0x4c9211['authenticate'](_0x200e78['body'][_0x9a99('0x96')])){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0x9b'));}if(_0x200e78[_0x9a99('0x66')]['oldPassword']===_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0x9c'));}}else if(_0x200e78[_0x9a99('0x36')][_0x9a99('0x2e')]===_0x9a99('0x34')){if(!_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db[(_0x9a99('0x9a'))]['ValidationError'](_0x9a99('0x9d'));}}else if(_0x200e78['user'][_0x9a99('0x2e')]==='user'){if(!_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')]){throw new db[(_0x9a99('0x9a'))]['ValidationError'](_0x9a99('0x9d'));}if(_0x4c9211[_0x9a99('0x2e')]!==_0x9a99('0x2f')){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))]('Unauthorized');}}else{throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0x87'));}return _0x4c9211;})[_0x9a99('0x1a')](handleEntityNotFound(_0x2ea6e4,null))[_0x9a99('0x1a')](function(_0x243fee){return db['Setting'][_0x9a99('0x9e')]({'attributes':['id','securePassword','enforcePasswordHistory',_0x9a99('0x9f')]})[_0x9a99('0x1a')](function(_0x5cd869){if(_0x5cd869[_0x9a99('0x6d')])authService[_0x9a99('0xa0')](_0x200e78[_0x9a99('0x66')]['newPassword']);if(!_0x5cd869['enforcePasswordHistory']||!_0x243fee['previousPasswords'])return _0x243fee;authService[_0x9a99('0xa1')](_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')],_0x243fee[_0x9a99('0xa2')],_0x5cd869[_0x9a99('0x9f')]);return _0x243fee;})[_0x9a99('0x1a')](saveUpdates({'password':_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')],'passwordResetAt':_0x200e78['user']['id']==_0x200e78[_0x9a99('0x67')]['id']?moment():null,'previousPasswords':authService[_0x9a99('0xa3')](_0x200e78[_0x9a99('0x66')][_0x9a99('0x97')],_0x243fee[_0x9a99('0xa2')])},null));})[_0x9a99('0x1a')](respondWithResult(_0x2ea6e4,null))[_0x9a99('0x23')](handleError(_0x2ea6e4,null));};exports[_0x9a99('0xa4')]=function(_0x1169ee,_0x4a1b9b){var _0x451007=_0x1169ee['body']['channel'];return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x1169ee[_0x9a99('0x67')]['id']},'attributes':['id','name',_0x9a99('0x2e'),'online',_0x9a99('0xa5'),'voicePause',_0x9a99('0xa6')]})['then'](handleEntityNotFound(_0x4a1b9b,null))[_0x9a99('0x1a')](function(_0xa73ef6){if(_0xa73ef6){if(!utils['isValidChannel'](_0x451007)){throw new db[(_0x9a99('0x9a'))]['ValidationError'](_0x9a99('0xa7'));}return _0xa73ef6[_0x9a99('0xa8')+_[_0x9a99('0xa9')](_0x451007[_0x9a99('0xaa')]())+_0x9a99('0xab')](_0x1169ee[_0x9a99('0x66')]['ids'],{'penalty':_0x1169ee[_0x9a99('0x66')][_0x9a99('0xac')]||0x0})[_0x9a99('0xad')](function(_0x3f364d){for(var _0x5ec64e=0x0;_0x5ec64e<_0x1169ee[_0x9a99('0x66')][_0x9a99('0x6a')][_0x9a99('0x54')];_0x5ec64e+=0x1){var _0x2c6708={'UserId':Number(_0x1169ee[_0x9a99('0x67')]['id'])};_0x2c6708[_[_0x9a99('0xa9')](_0x451007[_0x9a99('0xaa')]())+_0x9a99('0xae')]=Number(_0x1169ee[_0x9a99('0x66')][_0x9a99('0x6a')][_0x5ec64e]);socket[_0x9a99('0x30')](_0x9a99('0x36')+_[_0x9a99('0xa9')](_0x451007[_0x9a99('0xaa')]())+_0x9a99('0xaf'),_0x2c6708);}return _0x3f364d;})[_0x9a99('0x1a')](function(){if(_0x451007===_0x9a99('0xb0')){return db[_0x9a99('0xb1')][_0x9a99('0x50')]({'where':{'id':_0x1169ee[_0x9a99('0x66')][_0x9a99('0x6a')]||[]},'raw':!![],'attributes':['id',_0x9a99('0x3e')]});}})[_0x9a99('0x1a')](function(_0x3a9531){var _0x34af3c=_0xa73ef6['get']({'plain':!![]});var _0x293e32=[];if(_0x451007===_0x9a99('0xb0')&&_0x34af3c[_0x9a99('0x2e')]==='agent'&&_0x34af3c[_0x9a99('0xb2')]){for(let _0x404a50=0x0;_0x404a50<_0x3a9531[_0x9a99('0x54')];_0x404a50+=0x1){_0x293e32[_0x9a99('0x4e')]({'membername':_0x34af3c['name'],'UserId':_0x34af3c['id'],'queue_name':_0x3a9531[_0x404a50][_0x9a99('0x3e')],'VoiceQueueId':_0x3a9531[_0x404a50]['id'],'interface':_[_0x9a99('0x6e')](_0x34af3c[_0x9a99('0xa6')])?util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0x34af3c[_0x9a99('0x3e')]):_0x34af3c[_0x9a99('0xa6')],'paused':_0x34af3c[_0x9a99('0xb5')]||![],'penalty':_0x1169ee[_0x9a99('0x66')][_0x9a99('0xac')]||0x0});}return Promise[_0x9a99('0x58')](_0x293e32[_0x9a99('0x3b')](function(_0x1d5ea5){return db[_0x9a99('0xb6')][_0x9a99('0xb7')](_0x1d5ea5);}));}return _0xa73ef6;});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x4a1b9b,null))[_0x9a99('0x23')](handleError(_0x4a1b9b,null));};exports[_0x9a99('0xb8')]=function(_0x2209c3,_0x40785e){var _0x4514e2,_0x972391;return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x2209c3[_0x9a99('0x67')]['id']},'attributes':['id',_0x9a99('0x3e'),_0x9a99('0x2e')]})[_0x9a99('0x1a')](handleEntityNotFound(_0x40785e,null))[_0x9a99('0x1a')](function(_0x476c7a){if(_0x476c7a){_0x4514e2=_0x476c7a;if(!_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')]||!utils[_0x9a99('0xba')](_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')])){throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0xa7'));}return _0x476c7a['remove'+_[_0x9a99('0xa9')](_0x2209c3['query'][_0x9a99('0xb9')][_0x9a99('0xaa')]())+_0x9a99('0xab')](_0x2209c3[_0x9a99('0x52')][_0x9a99('0x6a')]);}})[_0x9a99('0x1a')](function(_0x51bf56){if(_[_0x9a99('0xbb')](_0x2209c3['query']['ids'])){for(var _0x69cd9d=0x0;_0x69cd9d<_0x2209c3['query']['ids'][_0x9a99('0x54')];_0x69cd9d+=0x1){_0x972391={'UserId':Number(_0x2209c3[_0x9a99('0x67')]['id'])};_0x972391[_[_0x9a99('0xa9')](_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')][_0x9a99('0xaa')]())+_0x9a99('0xae')]=Number(_0x2209c3[_0x9a99('0x52')][_0x9a99('0x6a')][_0x69cd9d]);socket['emit'](_0x9a99('0x36')+_['capitalize'](_0x2209c3[_0x9a99('0x52')]['channel'][_0x9a99('0xaa')]())+_0x9a99('0xbc'),_0x972391);}}else{_0x972391={'UserId':Number(_0x2209c3[_0x9a99('0x67')]['id'])};_0x972391[_[_0x9a99('0xa9')](_0x2209c3[_0x9a99('0x52')]['channel']['toLowerCase']())+_0x9a99('0xae')]=Number(_0x2209c3['query']['ids']);socket[_0x9a99('0x30')]('user'+_[_0x9a99('0xa9')](_0x2209c3['query']['channel'][_0x9a99('0xaa')]())+'Queue:remove',_0x972391);}return _0x51bf56;})[_0x9a99('0x1a')](function(){if(_0x2209c3[_0x9a99('0x52')][_0x9a99('0xb9')]===_0x9a99('0xb0')){return db[_0x9a99('0xb6')][_0x9a99('0x32')]({'where':{'UserId':_0x2209c3['params']['id'],'VoiceQueueId':_0x2209c3[_0x9a99('0x52')]['ids']},'individualHooks':!![]})[_0x9a99('0x1a')](function(){return _0x4514e2;});}return _0x4514e2;})[_0x9a99('0x1a')](respondWithStatusCode(_0x40785e,null))['catch'](handleError(_0x40785e,null));};exports[_0x9a99('0xbd')]=function(_0xb7f3ca,_0x30c278){_0xb7f3ca['body'][_0x9a99('0xbe')]=_0xb7f3ca[_0x9a99('0xbf')][_0x9a99('0xc0')];return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0xb7f3ca['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x30c278,null))[_0x9a99('0x1a')](saveUpdates(_0xb7f3ca[_0x9a99('0x66')],null))[_0x9a99('0x1a')](respondWithResult(_0x30c278,null))['catch'](handleError(_0x30c278,null));};exports[_0x9a99('0xc1')]=function(_0x4c81e0,_0x52641e){var _0x21490d=path[_0x9a99('0xc2')](config[_0x9a99('0xc3')],_0x9a99('0xc4'));return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x4c81e0[_0x9a99('0x67')]['id']},'attributes':['id',_0x9a99('0xbe')],'raw':!![]})[_0x9a99('0x1a')](handleEntityNotFound(_0x52641e,null))[_0x9a99('0x1a')](function(_0x32098d){if(_0x32098d){if(_[_0x9a99('0x6e')](_0x32098d['userpic'])){return _0x52641e[_0x9a99('0xc5')](_0x21490d);}else{if(!fs[_0x9a99('0xc6')](path[_0x9a99('0xc2')](config[_0x9a99('0xc3')],'server/files/images/',_0x32098d[_0x9a99('0xbe')]))){return _0x52641e[_0x9a99('0xc5')](_0x21490d);}return _0x52641e[_0x9a99('0xc5')](path[_0x9a99('0xc2')](config['root'],_0x9a99('0xc7'),_0x32098d[_0x9a99('0xbe')]));}}})['catch'](handleError(_0x52641e,null));};exports[_0x9a99('0xc8')]=function(_0x10f3d1,_0x33937e){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x10f3d1[_0x9a99('0x67')]['id']},'attributes':['id']})[_0x9a99('0x1a')](handleEntityNotFound(_0x33937e,null))['then'](function(_0x30fe33){var _0x534b24=[];values=_0x30fe33[_0x9a99('0x56')];_0x534b24[_0x9a99('0x4e')](get_open_tabs('chat',_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs('sms',_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x62'),_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x63'),_0x30fe33[_0x9a99('0x56')]));_0x534b24[_0x9a99('0x4e')](get_open_tabs(_0x9a99('0x64'),_0x30fe33[_0x9a99('0x56')]));_0x534b24['push'](get_open_tabs(_0x9a99('0x65'),_0x30fe33['dataValues']));return Promise[_0x9a99('0x58')](_0x534b24);})[_0x9a99('0x1a')](function(_0x596223){if(_0x596223){var _0x3da294=_[_0x9a99('0x3b')](values[_0x9a99('0xc9')],function(_0x5772a5){return{'channel':'CHAT','id':_0x5772a5['id'],'createdAt':_0x5772a5[_0x9a99('0xca')]};});var _0x5a47ba=_[_0x9a99('0x3b')](values[_0x9a99('0xcb')],function(_0x5ef35f){return{'channel':_0x9a99('0xcc'),'id':_0x5ef35f['id'],'createdAt':_0x5ef35f[_0x9a99('0xca')]};});var _0x4997ba=_['map'](values['OpenchannelOpenTabs'],function(_0x80eff){return{'channel':_0x9a99('0xcd'),'id':_0x80eff['id'],'createdAt':_0x80eff[_0x9a99('0xca')]};});var _0x4be8a9=_[_0x9a99('0x3b')](values[_0x9a99('0xce')],function(_0x2345d1){return{'channel':_0x9a99('0xcf'),'id':_0x2345d1['id'],'createdAt':_0x2345d1['createdAt']};});var _0xd9d5b3=_[_0x9a99('0x3b')](values[_0x9a99('0xd0')],function(_0xc54e9){return{'channel':_0x9a99('0xd1'),'id':_0xc54e9['id'],'createdAt':_0xc54e9[_0x9a99('0xca')]};});var _0x484f2b=_[_0x9a99('0x3b')](values['WhatsappOpenTabs'],function(_0x53f3ac){return{'channel':'WHATSAPP','id':_0x53f3ac['id'],'createdAt':_0x53f3ac[_0x9a99('0xca')]};});var _0x21088b=_[_0x9a99('0xd2')](_0x3da294,_0x5a47ba,_0x4997ba,_0x4be8a9,_0xd9d5b3,_0x484f2b);var _0x22a6fd={'count':_0x21088b[_0x9a99('0x54')],'rows':_0x21088b};return _0x22a6fd;}else return null;})[_0x9a99('0x1a')](respondWithResult(_0x33937e,null))['catch'](handleError(_0x33937e,null));};exports[_0x9a99('0xd3')]=function(_0x2fdcf2,_0x540905){var _0x302676={};var _0xba8f03={};var _0x5ca857;var _0x5147d8;return db['User'][_0x9a99('0x9e')]({'where':{'id':_0x2fdcf2[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x540905,null))['then'](function(_0x2b3a2f){if(_0x2b3a2f){_0x5ca857=_0x2b3a2f;_0xba8f03[_0x9a99('0x5e')]=_['keys'](db['CmContact'][_0x9a99('0x5b')]);_0xba8f03[_0x9a99('0x52')]=_['keys'](_0x2fdcf2[_0x9a99('0x52')]);_0xba8f03[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0xba8f03[_0x9a99('0x5e')],_0xba8f03[_0x9a99('0x52')]);_0x302676['attributes']=_[_0x9a99('0x5d')](_0xba8f03[_0x9a99('0x5e')],qs['fields'](_0x2fdcf2[_0x9a99('0x52')]['fields']));_0x302676[_0x9a99('0x4d')]=_0x302676[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x302676['attributes']:_0xba8f03[_0x9a99('0x5e')];_0x302676[_0x9a99('0xd4')]=qs['sort'](_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x302676[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x2fdcf2[_0x9a99('0x52')],_0xba8f03[_0x9a99('0x5c')]));if(_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0x45')]){_0x302676['where']=_[_0x9a99('0x60')](_0x302676[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x302676[_0x9a99('0x4d')],function(_0x11cac9){var _0x2b69c9={};_0x2b69c9[_0x11cac9]={'$like':'%'+_0x2fdcf2[_0x9a99('0x52')]['filter']+'%'};return _0x2b69c9;})});}_0x302676=_['merge']({},_0x302676,_0x2fdcf2[_0x9a99('0xd8')]);return _0x5ca857[_0x9a99('0xd3')](_0x302676);}})[_0x9a99('0x1a')](function(_0x198eee){if(_0x198eee){_0x5147d8=_0x198eee[_0x9a99('0x54')];if(_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xda'))){_0x302676[_0x9a99('0x4a')]=[{'model':db['CmList'],'as':_0x9a99('0xdb'),'required':![]},{'model':db[_0x9a99('0xdc')],'as':'Tags','attributes':['id',_0x9a99('0x3e'),'color'],'where':_0x2fdcf2[_0x9a99('0x52')]['tag']?{'id':_0x2fdcf2['query']['tag']}:undefined,'required':_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0xdd')]?!![]:![]}];}if(!_0x2fdcf2['query']['hasOwnProperty'](_0x9a99('0xde'))){_0x302676[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0x29')]);_0x302676[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x2fdcf2[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x5ca857[_0x9a99('0xd3')](_0x302676);}})[_0x9a99('0x1a')](function(_0x1b8e0e){if(_0x1b8e0e){return _0x1b8e0e?{'count':_0x5147d8,'rows':_0x1b8e0e}:null;}})['then'](respondWithResult(_0x540905,null))[_0x9a99('0x23')](handleError(_0x540905,null));};exports[_0x9a99('0xdf')]=function(_0x406bff,_0x4ade61){var _0x12be65;var _0x2f0f2d={};var _0xf3b18d;return db['User']['findOne']({'where':{'id':_0x406bff[_0x9a99('0x67')]['id']},'attributes':['id',_0x9a99('0x3e'),'role']})[_0x9a99('0x1a')](handleEntityNotFound(_0x4ade61,null))['then'](function(_0x33e97d){if(!utils[_0x9a99('0xba')](_0x406bff['query']['channel'])){throw new db['Sequelize'][(_0x9a99('0x98'))]('Unknown\x20channel');}_0x12be65=_0x33e97d;var _0x458579={};_0x458579['model']=_[_0x9a99('0x5a')](db[_[_0x9a99('0xa9')](_0x406bff[_0x9a99('0x52')][_0x9a99('0xb9')])+'Queue'][_0x9a99('0x5b')]);_0x458579['query']=_['keys'](_0x406bff[_0x9a99('0x52')]);_0x458579[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x458579[_0x9a99('0x5e')],_0x458579[_0x9a99('0x52')]);_0x2f0f2d[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x458579[_0x9a99('0x5e')],qs['fields'](_0x406bff[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x2f0f2d[_0x9a99('0x4d')]=_0x2f0f2d[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x2f0f2d['attributes']:_0x458579[_0x9a99('0x5e')];_0x2f0f2d[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x406bff[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x2f0f2d[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x406bff[_0x9a99('0x52')],_0x458579[_0x9a99('0x5c')]));if(_0x406bff[_0x9a99('0x52')][_0x9a99('0x45')]){_0x2f0f2d['where']=_[_0x9a99('0x60')](_0x2f0f2d[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x2f0f2d[_0x9a99('0x4d')],function(_0x4c9649){var _0x5efb54={};_0x5efb54[_0x4c9649]={'$like':'%'+_0x406bff[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x5efb54;})});}_0x2f0f2d=_[_0x9a99('0x60')]({},_0x2f0f2d,_0x406bff[_0x9a99('0xd8')]);switch(_0x12be65['role']){case _0x9a99('0x34'):return db[_[_0x9a99('0xa9')](_0x406bff[_0x9a99('0x52')][_0x9a99('0xb9')])+_0x9a99('0xe0')][_0x9a99('0x50')](_0x2f0f2d);case _0x9a99('0x36'):case _0x9a99('0x2f'):return _0x12be65[_0x9a99('0x33')+_[_0x9a99('0xa9')](_0x406bff['query']['channel'])+_0x9a99('0xab')](_0x2f0f2d);default:throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0xe1'));}})[_0x9a99('0x1a')](function(_0x467670){_0xf3b18d=_0x467670['length'];if(!_0x406bff[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x2f0f2d[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x406bff[_0x9a99('0x52')][_0x9a99('0x29')]);_0x2f0f2d['offset']=qs[_0x9a99('0x28')](_0x406bff[_0x9a99('0x52')][_0x9a99('0x28')]);}switch(_0x12be65[_0x9a99('0x2e')]){case'admin':return db[_[_0x9a99('0xa9')](_0x406bff[_0x9a99('0x52')]['channel'])+'Queue'][_0x9a99('0x50')](_0x2f0f2d);case _0x9a99('0x36'):case _0x9a99('0x2f'):return _0x12be65[_0x9a99('0x33')+_[_0x9a99('0xa9')](_0x406bff['query'][_0x9a99('0xb9')])+_0x9a99('0xab')](_0x2f0f2d);}})['then'](function(_0x2ba483){return{'count':_0xf3b18d,'rows':_0x2ba483};})[_0x9a99('0x1a')](respondWithResult(_0x4ade61,null))[_0x9a99('0x23')](handleError(_0x4ade61,null));};exports[_0x9a99('0xe2')]=function(_0x49629e,_0x4e2cf3){var _0xab5fca={};var _0x4e3d42={};var _0x2452bf;var _0x51cce9;return db['User'][_0x9a99('0x9e')]({'where':{'id':_0x49629e['params']['id']}})['then'](handleEntityNotFound(_0x4e2cf3,null))[_0x9a99('0x1a')](function(_0x2bd9aa){if(_0x2bd9aa){_0x2452bf=_0x2bd9aa;_0x4e3d42[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['UserVoiceQueueRt'][_0x9a99('0x5b')]);_0x4e3d42['query']=_[_0x9a99('0x5a')](_0x49629e[_0x9a99('0x52')]);_0x4e3d42[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x4e3d42[_0x9a99('0x5e')],_0x4e3d42['query']);_0xab5fca[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x4e3d42[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x49629e['query'][_0x9a99('0x5f')]));_0xab5fca[_0x9a99('0x4d')]=_0xab5fca[_0x9a99('0x4d')][_0x9a99('0x54')]?_0xab5fca[_0x9a99('0x4d')]:_0x4e3d42[_0x9a99('0x5e')];_0xab5fca[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x49629e['query'][_0x9a99('0xd5')]);_0xab5fca[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x49629e[_0x9a99('0x52')],_0x4e3d42[_0x9a99('0x5c')]));if(_0x49629e[_0x9a99('0x52')]['filter']){_0xab5fca[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0xab5fca[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0xab5fca[_0x9a99('0x4d')],function(_0x16bf5d){var _0x4b0a77={};_0x4b0a77[_0x16bf5d]={'$like':'%'+_0x49629e[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x4b0a77;})});}_0xab5fca=_['merge']({},_0xab5fca,_0x49629e['options']);return _0x2452bf['getVoiceQueuesRt'](_0xab5fca);}})['then'](function(_0x493a85){if(_0x493a85){_0x51cce9=_0x493a85[_0x9a99('0x54')];if(!_0x49629e['query'][_0x9a99('0xd9')](_0x9a99('0xde'))){_0xab5fca['limit']=qs[_0x9a99('0x29')](_0x49629e[_0x9a99('0x52')][_0x9a99('0x29')]);_0xab5fca[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x49629e[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x2452bf['getVoiceQueuesRt'](_0xab5fca);}})[_0x9a99('0x1a')](function(_0x27302a){if(_0x27302a){return _0x27302a?{'count':_0x51cce9,'rows':_0x27302a}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x4e2cf3,null))[_0x9a99('0x23')](handleError(_0x4e2cf3,null));};exports[_0x9a99('0xe3')]=function(_0x31ae30,_0x3de746){var _0x104e8a={};var _0x21105a={};var _0x2cf793;var _0x17f211;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x31ae30['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3de746,null))[_0x9a99('0x1a')](function(_0x407ba9){if(_0x407ba9){_0x2cf793=_0x407ba9;_0x21105a['model']=_['keys'](db[_0x9a99('0xe4')][_0x9a99('0x5b')]);_0x21105a['query']=_[_0x9a99('0x5a')](_0x31ae30['query']);_0x21105a[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x21105a[_0x9a99('0x5e')],_0x21105a[_0x9a99('0x52')]);_0x104e8a['attributes']=_['intersection'](_0x21105a[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x31ae30[_0x9a99('0x52')]['fields']));_0x104e8a[_0x9a99('0x4d')]=_0x104e8a['attributes']['length']?_0x104e8a[_0x9a99('0x4d')]:_0x21105a[_0x9a99('0x5e')];_0x104e8a[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x31ae30[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x104e8a[_0x9a99('0xd6')]=qs['filters'](_['pick'](_0x31ae30[_0x9a99('0x52')],_0x21105a[_0x9a99('0x5c')]));if(_0x31ae30[_0x9a99('0x52')]['filter']){_0x104e8a['where']=_[_0x9a99('0x60')](_0x104e8a['where'],{'$or':_['map'](_0x104e8a[_0x9a99('0x4d')],function(_0x3fc505){var _0x496302={};_0x496302[_0x3fc505]={'$like':'%'+_0x31ae30[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x496302;})});}_0x104e8a=_[_0x9a99('0x60')]({},_0x104e8a,_0x31ae30[_0x9a99('0xd8')]);return _0x2cf793[_0x9a99('0xe3')](_0x104e8a);}})[_0x9a99('0x1a')](function(_0x5a2e93){if(_0x5a2e93){_0x17f211=_0x5a2e93[_0x9a99('0x54')];if(!_0x31ae30[_0x9a99('0x52')]['hasOwnProperty'](_0x9a99('0xde'))){_0x104e8a[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x31ae30[_0x9a99('0x52')][_0x9a99('0x29')]);_0x104e8a['offset']=qs[_0x9a99('0x28')](_0x31ae30['query'][_0x9a99('0x28')]);}return _0x2cf793[_0x9a99('0xe3')](_0x104e8a);}})[_0x9a99('0x1a')](function(_0x3968cb){if(_0x3968cb){return _0x3968cb?{'count':_0x17f211,'rows':_0x3968cb}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x3de746,null))[_0x9a99('0x23')](handleError(_0x3de746,null));};exports[_0x9a99('0xe5')]=function(_0x10e089,_0x44cd67){var _0x67640e={'raw':!![],'where':{}};var _0x17d823={};var _0xd04ad={'count':0x0,'rows':[]};return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x10e089[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x44cd67,null))[_0x9a99('0x1a')](function(_0x547ed6){if(_0x547ed6){_0x17d823[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['VoiceRecording'][_0x9a99('0x5b')]);_0x17d823[_0x9a99('0x52')]=_['keys'](_0x10e089[_0x9a99('0x52')]);_0x17d823[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x17d823[_0x9a99('0x5e')],_0x17d823[_0x9a99('0x52')]);_0x67640e[_0x9a99('0x4d')]=_['intersection'](_0x17d823[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x10e089['query'][_0x9a99('0x5f')]));_0x67640e[_0x9a99('0x4d')]=_0x67640e['attributes']['length']?_0x67640e[_0x9a99('0x4d')]:_0x17d823[_0x9a99('0x5e')];if(!_0x10e089[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x67640e[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x10e089[_0x9a99('0x52')][_0x9a99('0x29')]);_0x67640e['offset']=qs[_0x9a99('0x28')](_0x10e089['query'][_0x9a99('0x28')]);}_0x67640e[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x10e089[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x67640e[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x10e089['query'],_0x17d823[_0x9a99('0x5c')]));_0x67640e['where'][_0x9a99('0xe6')]=_0x547ed6['id'];if(_0x10e089[_0x9a99('0x52')]['filter']){_0x67640e['where']=_[_0x9a99('0x60')](_0x67640e[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x67640e[_0x9a99('0x4d')],function(_0x35c6cb){var _0x5dea36={};_0x5dea36[_0x35c6cb]={'$like':'%'+_0x10e089[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x5dea36;})});}_0x67640e=_[_0x9a99('0x60')]({},_0x67640e,_0x10e089[_0x9a99('0xd8')]);return db[_0x9a99('0xe7')][_0x9a99('0x2a')]({'where':_0x67640e[_0x9a99('0xd6')]})[_0x9a99('0x1a')](function(_0x371714){_0xd04ad['count']=_0x371714;if(_0x10e089[_0x9a99('0x52')][_0x9a99('0xda')]){_0x67640e['include']=[{'all':!![]}];}return db[_0x9a99('0xe7')][_0x9a99('0x50')](_0x67640e);})[_0x9a99('0x1a')](function(_0x1ada5){_0xd04ad[_0x9a99('0x51')]=_0x1ada5;return _0xd04ad;});}})[_0x9a99('0x1a')](respondWithFilteredResult(_0x44cd67,_0x67640e))[_0x9a99('0x23')](handleError(_0x44cd67,null));};exports[_0x9a99('0xe8')]=function(_0x12284e,_0x53dc63){var _0x5cdf76={'raw':!![],'where':{}};var _0x1dd668={};var _0x13657a={'count':0x0,'rows':[]};return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x12284e[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x53dc63,null))['then'](function(_0x279cee){if(_0x279cee){_0x1dd668['model']=_[_0x9a99('0x5a')](db[_0x9a99('0xe9')][_0x9a99('0x5b')]);_0x1dd668[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x12284e['query']);_0x1dd668[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x1dd668[_0x9a99('0x5e')],_0x1dd668[_0x9a99('0x52')]);_0x5cdf76['attributes']=_[_0x9a99('0x5d')](_0x1dd668[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x12284e[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5cdf76[_0x9a99('0x4d')]=_0x5cdf76['attributes']['length']?_0x5cdf76['attributes']:_0x1dd668['model'];if(!_0x12284e[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x5cdf76[_0x9a99('0x29')]=qs['limit'](_0x12284e[_0x9a99('0x52')]['limit']);_0x5cdf76[_0x9a99('0x28')]=qs['offset'](_0x12284e['query'][_0x9a99('0x28')]);}_0x5cdf76['order']=qs['sort'](_0x12284e[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x5cdf76[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x12284e[_0x9a99('0x52')],_0x1dd668[_0x9a99('0x5c')]));_0x5cdf76['where']['UserId']=_0x279cee['id'];if(_0x12284e[_0x9a99('0x52')][_0x9a99('0x45')]){_0x5cdf76[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x5cdf76[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5cdf76[_0x9a99('0x4d')],function(_0x486187){var _0x2c7877={};_0x2c7877[_0x486187]={'$like':'%'+_0x12284e['query'][_0x9a99('0x45')]+'%'};return _0x2c7877;})});}_0x5cdf76=_[_0x9a99('0x60')]({},_0x5cdf76,_0x12284e['options']);return db[_0x9a99('0xe9')]['count']({'where':_0x5cdf76['where']})['then'](function(_0x295b52){_0x13657a[_0x9a99('0x2a')]=_0x295b52;if(_0x12284e[_0x9a99('0x52')][_0x9a99('0xda')]){_0x5cdf76[_0x9a99('0x4a')]=[{'all':!![]}];}return db[_0x9a99('0xe9')][_0x9a99('0x50')](_0x5cdf76);})[_0x9a99('0x1a')](function(_0x4dc25c){_0x13657a['rows']=_0x4dc25c;return _0x13657a;});}})[_0x9a99('0x1a')](respondWithFilteredResult(_0x53dc63,_0x5cdf76))[_0x9a99('0x23')](handleError(_0x53dc63,null));};exports[_0x9a99('0xea')]=function(_0x5d91da,_0xf7adc8){var _0x56e1e5={};var _0x2afaa8={};var _0x2eeb94;var _0x458095;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x5d91da[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0xf7adc8,null))[_0x9a99('0x1a')](function(_0x51990d){if(_0x51990d){_0x2eeb94=_0x51990d;_0x2afaa8['model']=_['keys'](db['ChatInteraction'][_0x9a99('0x5b')]);_0x2afaa8[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x5d91da[_0x9a99('0x52')]);_0x2afaa8[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x2afaa8[_0x9a99('0x5e')],_0x2afaa8[_0x9a99('0x52')]);_0x56e1e5[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x2afaa8['model'],qs[_0x9a99('0x5f')](_0x5d91da[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x56e1e5[_0x9a99('0x4d')]=_0x56e1e5[_0x9a99('0x4d')]['length']?_0x56e1e5[_0x9a99('0x4d')]:_0x2afaa8[_0x9a99('0x5e')];_0x56e1e5[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x5d91da['query'][_0x9a99('0xd5')]);_0x56e1e5[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x5d91da[_0x9a99('0x52')],_0x2afaa8[_0x9a99('0x5c')]));if(_0x5d91da['query'][_0x9a99('0x45')]){_0x56e1e5[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x56e1e5[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x56e1e5[_0x9a99('0x4d')],function(_0x3f23c1){var _0x573e64={};_0x573e64[_0x3f23c1]={'$like':'%'+_0x5d91da['query'][_0x9a99('0x45')]+'%'};return _0x573e64;})});}_0x56e1e5=_[_0x9a99('0x60')]({},_0x56e1e5,_0x5d91da[_0x9a99('0xd8')]);return _0x2eeb94[_0x9a99('0xea')](_0x56e1e5);}})[_0x9a99('0x1a')](function(_0x5309b1){if(_0x5309b1){_0x458095=_0x5309b1[_0x9a99('0x54')];if(!_0x5d91da[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x56e1e5[_0x9a99('0x29')]=qs['limit'](_0x5d91da[_0x9a99('0x52')][_0x9a99('0x29')]);_0x56e1e5[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x5d91da['query']['offset']);}return _0x2eeb94[_0x9a99('0xea')](_0x56e1e5);}})[_0x9a99('0x1a')](function(_0x4f7dd5){if(_0x4f7dd5){return _0x4f7dd5?{'count':_0x458095,'rows':_0x4f7dd5}:null;}})[_0x9a99('0x1a')](respondWithResult(_0xf7adc8,null))['catch'](handleError(_0xf7adc8,null));};exports[_0x9a99('0xeb')]=function(_0x3c9e25,_0x1c976d){var _0x5e5852={};var _0x4fc12f={};var _0x41dd1a;var _0x3c4c58;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x3c9e25[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x1c976d,null))[_0x9a99('0x1a')](function(_0x399c02){if(_0x399c02){_0x41dd1a=_0x399c02;_0x4fc12f[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['OpenchannelInteraction'][_0x9a99('0x5b')]);_0x4fc12f[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x3c9e25['query']);_0x4fc12f['filters']=_['intersection'](_0x4fc12f[_0x9a99('0x5e')],_0x4fc12f[_0x9a99('0x52')]);_0x5e5852[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x4fc12f['model'],qs[_0x9a99('0x5f')](_0x3c9e25[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5e5852['attributes']=_0x5e5852[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x5e5852[_0x9a99('0x4d')]:_0x4fc12f['model'];_0x5e5852['order']=qs['sort'](_0x3c9e25[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x5e5852[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x3c9e25[_0x9a99('0x52')],_0x4fc12f[_0x9a99('0x5c')]));if(_0x3c9e25['query'][_0x9a99('0x45')]){_0x5e5852[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x5e5852[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5e5852[_0x9a99('0x4d')],function(_0x7e82c3){var _0x4b89d7={};_0x4b89d7[_0x7e82c3]={'$like':'%'+_0x3c9e25[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x4b89d7;})});}_0x5e5852=_[_0x9a99('0x60')]({},_0x5e5852,_0x3c9e25[_0x9a99('0xd8')]);return _0x41dd1a[_0x9a99('0xeb')](_0x5e5852);}})[_0x9a99('0x1a')](function(_0x46d228){if(_0x46d228){_0x3c4c58=_0x46d228['length'];if(!_0x3c9e25[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x5e5852[_0x9a99('0x29')]=qs['limit'](_0x3c9e25['query'][_0x9a99('0x29')]);_0x5e5852[_0x9a99('0x28')]=qs['offset'](_0x3c9e25[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x41dd1a['getOpenchannelInteractions'](_0x5e5852);}})[_0x9a99('0x1a')](function(_0x30e8dc){if(_0x30e8dc){return _0x30e8dc?{'count':_0x3c4c58,'rows':_0x30e8dc}:null;}})['then'](respondWithResult(_0x1c976d,null))[_0x9a99('0x23')](handleError(_0x1c976d,null));};exports[_0x9a99('0xec')]=function(_0x7a8d1c,_0xb80dd1){var _0x30a29c={'raw':!![],'where':{}};var _0x33092a={};var _0x25d155={'count':0x0,'rows':[]};return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x7a8d1c[_0x9a99('0x67')]['id']}})['then'](handleEntityNotFound(_0xb80dd1,null))[_0x9a99('0x1a')](function(_0x3719a9){if(_0x3719a9){_0x33092a[_0x9a99('0x5e')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x33092a['query']=_[_0x9a99('0x5a')](_0x7a8d1c[_0x9a99('0x52')]);_0x33092a['filters']=_[_0x9a99('0x5d')](_0x33092a[_0x9a99('0x5e')],_0x33092a['query']);_0x30a29c['attributes']=_['intersection'](_0x33092a[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x30a29c[_0x9a99('0x4d')]=_0x30a29c['attributes'][_0x9a99('0x54')]?_0x30a29c[_0x9a99('0x4d')]:_0x33092a[_0x9a99('0x5e')];if(!_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x30a29c[_0x9a99('0x29')]=qs['limit'](_0x7a8d1c[_0x9a99('0x52')]['limit']);_0x30a29c[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0x28')]);}_0x30a29c[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x7a8d1c[_0x9a99('0x52')]['sort']);_0x30a29c[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x7a8d1c[_0x9a99('0x52')],_0x33092a[_0x9a99('0x5c')]));_0x30a29c[_0x9a99('0xd6')]['UserId']=_0x3719a9['id'];if(_0x7a8d1c['query']['filter']){_0x30a29c[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x30a29c[_0x9a99('0xd6')],{'$or':_['map'](_0x30a29c[_0x9a99('0x4d')],function(_0x5094f9){var _0x2172a5={};_0x2172a5[_0x5094f9]={'$like':'%'+_0x7a8d1c[_0x9a99('0x52')]['filter']+'%'};return _0x2172a5;})});}_0x30a29c=_[_0x9a99('0x60')]({},_0x30a29c,_0x7a8d1c[_0x9a99('0xd8')]);return db[_0x9a99('0xed')][_0x9a99('0x2a')]({'where':_0x30a29c[_0x9a99('0xd6')]})[_0x9a99('0x1a')](function(_0x109018){_0x25d155[_0x9a99('0x2a')]=_0x109018;if(_0x7a8d1c[_0x9a99('0x52')][_0x9a99('0xda')]){_0x30a29c[_0x9a99('0x4a')]=[{'all':!![]}];}return db[_0x9a99('0xed')]['findAll'](_0x30a29c);})['then'](function(_0x3b15c2){_0x25d155['rows']=_0x3b15c2;return _0x25d155;});}})[_0x9a99('0x1a')](respondWithFilteredResult(_0xb80dd1,_0x30a29c))[_0x9a99('0x23')](handleError(_0xb80dd1,null));};exports[_0x9a99('0xee')]=function(_0x54be22,_0x568857){var _0x1a9a36={};var _0x45a23e={};var _0x25f9dd;var _0x5e2fe9;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x54be22[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x568857,null))[_0x9a99('0x1a')](function(_0x4d520f){if(_0x4d520f){_0x25f9dd=_0x4d520f;_0x45a23e[_0x9a99('0x5e')]=_['keys'](db[_0x9a99('0xef')]['rawAttributes']);_0x45a23e[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x54be22[_0x9a99('0x52')]);_0x45a23e[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x45a23e[_0x9a99('0x5e')],_0x45a23e['query']);_0x1a9a36[_0x9a99('0x4d')]=_['intersection'](_0x45a23e[_0x9a99('0x5e')],qs['fields'](_0x54be22['query']['fields']));_0x1a9a36[_0x9a99('0x4d')]=_0x1a9a36[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x1a9a36[_0x9a99('0x4d')]:_0x45a23e[_0x9a99('0x5e')];_0x1a9a36[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x54be22[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x1a9a36['where']=qs[_0x9a99('0x5c')](_['pick'](_0x54be22['query'],_0x45a23e['filters']));if(_0x54be22[_0x9a99('0x52')]['filter']){_0x1a9a36[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x1a9a36[_0x9a99('0xd6')],{'$or':_['map'](_0x1a9a36[_0x9a99('0x4d')],function(_0x503cc4){var _0x1b92ad={};_0x1b92ad[_0x503cc4]={'$like':'%'+_0x54be22[_0x9a99('0x52')]['filter']+'%'};return _0x1b92ad;})});}_0x1a9a36=_[_0x9a99('0x60')]({},_0x1a9a36,_0x54be22[_0x9a99('0xd8')]);return _0x25f9dd[_0x9a99('0xee')](_0x1a9a36);}})[_0x9a99('0x1a')](function(_0x470f4c){if(_0x470f4c){_0x5e2fe9=_0x470f4c[_0x9a99('0x54')];if(!_0x54be22[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x1a9a36[_0x9a99('0x29')]=qs['limit'](_0x54be22['query'][_0x9a99('0x29')]);_0x1a9a36[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x54be22[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x25f9dd[_0x9a99('0xee')](_0x1a9a36);}})['then'](function(_0x18855a){if(_0x18855a){return _0x18855a?{'count':_0x5e2fe9,'rows':_0x18855a}:null;}})['then'](respondWithResult(_0x568857,null))[_0x9a99('0x23')](handleError(_0x568857,null));};exports[_0x9a99('0xf0')]=function(_0x29ce58,_0x494ebb){var _0x526e38={};var _0x453289={};var _0xf3c5a8;var _0x3f28df;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x29ce58[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x494ebb,null))['then'](function(_0x534d0c){if(_0x534d0c){_0xf3c5a8=_0x534d0c;_0x453289[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0xf1')][_0x9a99('0x5b')]);_0x453289['query']=_['keys'](_0x29ce58[_0x9a99('0x52')]);_0x453289[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x453289[_0x9a99('0x5e')],_0x453289[_0x9a99('0x52')]);_0x526e38[_0x9a99('0x4d')]=_['intersection'](_0x453289[_0x9a99('0x5e')],qs['fields'](_0x29ce58[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x526e38[_0x9a99('0x4d')]=_0x526e38[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x526e38['attributes']:_0x453289[_0x9a99('0x5e')];_0x526e38['order']=qs['sort'](_0x29ce58[_0x9a99('0x52')]['sort']);_0x526e38[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x29ce58[_0x9a99('0x52')],_0x453289[_0x9a99('0x5c')]));if(_0x29ce58[_0x9a99('0x52')][_0x9a99('0x45')]){_0x526e38['where']=_[_0x9a99('0x60')](_0x526e38[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x526e38[_0x9a99('0x4d')],function(_0x1b0d26){var _0x326c70={};_0x326c70[_0x1b0d26]={'$like':'%'+_0x29ce58['query'][_0x9a99('0x45')]+'%'};return _0x326c70;})});}_0x526e38=_[_0x9a99('0x60')]({},_0x526e38,_0x29ce58[_0x9a99('0xd8')]);return _0xf3c5a8['getFaxInteractions'](_0x526e38);}})[_0x9a99('0x1a')](function(_0x5b0f8f){if(_0x5b0f8f){_0x3f28df=_0x5b0f8f[_0x9a99('0x54')];if(!_0x29ce58[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x526e38[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x29ce58[_0x9a99('0x52')][_0x9a99('0x29')]);_0x526e38[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x29ce58[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0xf3c5a8[_0x9a99('0xf0')](_0x526e38);}})['then'](function(_0x457e91){if(_0x457e91){return _0x457e91?{'count':_0x3f28df,'rows':_0x457e91}:null;}})['then'](respondWithResult(_0x494ebb,null))['catch'](handleError(_0x494ebb,null));};exports[_0x9a99('0xf2')]=function(_0x35f0f5,_0x39ae6c){var _0x1ec31c={};var _0x4a1152={};var _0x185947;var _0x2b00df;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x35f0f5[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x39ae6c,null))[_0x9a99('0x1a')](function(_0x153084){if(_0x153084){_0x185947=_0x153084;_0x4a1152[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0xf3')][_0x9a99('0x5b')]);_0x4a1152[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x35f0f5[_0x9a99('0x52')]);_0x4a1152[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x4a1152[_0x9a99('0x5e')],_0x4a1152[_0x9a99('0x52')]);_0x1ec31c[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x4a1152[_0x9a99('0x5e')],qs['fields'](_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x1ec31c[_0x9a99('0x4d')]=_0x1ec31c[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x1ec31c[_0x9a99('0x4d')]:_0x4a1152[_0x9a99('0x5e')];_0x1ec31c[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x35f0f5[_0x9a99('0x52')]['sort']);_0x1ec31c[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x35f0f5['query'],_0x4a1152[_0x9a99('0x5c')]));if(_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x45')]){_0x1ec31c[_0x9a99('0xd6')]=_['merge'](_0x1ec31c[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x1ec31c[_0x9a99('0x4d')],function(_0x16fa3e){var _0x13a428={};_0x13a428[_0x16fa3e]={'$like':'%'+_0x35f0f5[_0x9a99('0x52')]['filter']+'%'};return _0x13a428;})});}_0x1ec31c=_[_0x9a99('0x60')]({},_0x1ec31c,_0x35f0f5[_0x9a99('0xd8')]);return _0x185947['getWhatsappInteractions'](_0x1ec31c);}})[_0x9a99('0x1a')](function(_0x4578d9){if(_0x4578d9){_0x2b00df=_0x4578d9[_0x9a99('0x54')];if(!_0x35f0f5[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x1ec31c['limit']=qs['limit'](_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x29')]);_0x1ec31c[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x35f0f5[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x185947[_0x9a99('0xf2')](_0x1ec31c);}})[_0x9a99('0x1a')](function(_0xaa3ac6){if(_0xaa3ac6){return _0xaa3ac6?{'count':_0x2b00df,'rows':_0xaa3ac6}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x39ae6c,null))['catch'](handleError(_0x39ae6c,null));};exports[_0x9a99('0xf4')]=function(_0x38b194,_0x36b7e8,_0x2ded5a){var _0xadf8e3;var _0x21de34;var _0x5777a7;var _0x164801=!_['isNil'](_0x38b194[_0x9a99('0x67')]['id'])?_0x38b194[_0x9a99('0x67')]['id']:!_[_0x9a99('0x6e')](_0x38b194[_0x9a99('0x36')]['id'])?_0x38b194[_0x9a99('0x36')]['id']:null;return db['User']['find']({'where':{'id':_0x164801,'role':{'$or':[_0x9a99('0x34'),'user','agent']}},'attributes':['id',_0x9a99('0x3e'),_0x9a99('0xf5'),_0x9a99('0xf6'),_0x9a99('0x2e'),'internal',_0x9a99('0xa5')]})[_0x9a99('0x1a')](function(_0x36574f){if(_0x36574f){if(_0x36574f[_0x9a99('0x2e')]===_0x9a99('0x2f')){_0xadf8e3=_0x36574f;if(_0x38b194[_0x9a99('0x66')]['interface']){_0x5777a7=util['format']('LOCAL/%s@from-sip/n',_0xadf8e3[_0x38b194[_0x9a99('0x66')][_0x9a99('0xa6')]]);}else if(_0x38b194[_0x9a99('0x66')][_0x9a99('0xf7')]){_0x5777a7=util[_0x9a99('0xb3')]('SIP/%s',_0x38b194[_0x9a99('0x66')]['intrf']);}else{_0x5777a7=util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0xadf8e3[_0x9a99('0x3e')]);}socket['to'](util[_0x9a99('0xb3')]('user:%s',_0xadf8e3[_0x9a99('0x3e')]))[_0x9a99('0x30')]('user:forcelogout',{'user':{'id':_0xadf8e3['id'],'name':_0xadf8e3[_0x9a99('0x3e')]},'ip':_0x38b194[_0x9a99('0xf8')][_0x9a99('0xf9')]||_0x38b194[_0x9a99('0xfa')][_0x9a99('0xfb')]||_0x38b194[_0x9a99('0xfc')][_0x9a99('0xfb')]||_0x38b194['connection'][_0x9a99('0xfc')][_0x9a99('0xfb')]});return db[_0x9a99('0xb6')][_0x9a99('0x32')]({'where':{'membername':_0xadf8e3[_0x9a99('0x3e')]},'individualHooks':!![]});}}else{throw new db[(_0x9a99('0x9a'))][(_0x9a99('0x98'))](_0x9a99('0xfd'));}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){return _0xadf8e3['getVoiceQueues']({'raw':!![]});}})[_0x9a99('0x1a')](function(_0x196acd){if(_0xadf8e3){if(_0x196acd){_0x21de34=_0x196acd;if(_0x21de34[_0x9a99('0x54')]){var _0x190048=_0x21de34[_0x9a99('0x3b')](function(_0x47ef6d){var _0x26bd4b={'membername':_0xadf8e3['name'],'UserId':_0xadf8e3['id'],'queue_name':_0x47ef6d['name'],'VoiceQueueId':_0x47ef6d['id'],'interface':_0x5777a7,'paused':_0xadf8e3[_0x9a99('0xa5')]||![],'penalty':_0x47ef6d[_0x9a99('0xfe')]||0x0};return db[_0x9a99('0xb6')][_0x9a99('0xb7')](_0x26bd4b);});return Promise['all'](_0x190048);}}}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){return db['MemberReport'][_0x9a99('0x50')]({'where':{'membername':_0xadf8e3[_0x9a99('0x3e')],'exitAt':null}});}})['then'](function(_0x1cc66b){if(_0xadf8e3){var _0x99d9a6=[];_0x1cc66b[_0x9a99('0xff')](function(_0x115de9){_0x99d9a6[_0x9a99('0x4e')](_0x115de9[_0x9a99('0x2d')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x9a99('0x58')](_0x99d9a6);}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){var _0xec7149=[];var _0xbb9c15=[];var _0x151640=utils[_0x9a99('0x100')]();var _0x5c974b={'membername':_0xadf8e3['name'],'interface':_0x5777a7,'enterAt':moment()['format'](_0x9a99('0x101')),'role':_0xadf8e3[_0x9a99('0x2e')],'internal':_0xadf8e3[_0x9a99('0x6b')]};_0x151640[_0x9a99('0xff')](function(_0x4f2223){_0xec7149[_0x9a99('0x4e')](_[_0x9a99('0x60')]({'channel':_0x4f2223,'type':_0x9a99('0x102'),'data1':_0x38b194[_0x9a99('0x66')]['device'],'data2':_0x5777a7},_0x5c974b));if(_0xadf8e3[_0x9a99('0xa5')]){_0xbb9c15['push'](_[_0x9a99('0x60')]({'channel':_0x4f2223,'type':_0x9a99('0x103'),'data1':_0x9a99('0x104')},_0x5c974b));}});return db[_0x9a99('0x105')][_0x9a99('0x8e')](_0xec7149[_0x9a99('0xd2')](_0xbb9c15),{'individualHooks':!![]});}})[_0x9a99('0x1a')](function(){if(_0xadf8e3){return _0xadf8e3[_0x9a99('0x2d')]({'online':!![],'lastLoginAt':moment()['format'](_0x9a99('0x101')),'voicePause':_0xadf8e3[_0x9a99('0xa5')]||![],'mailPause':_0xadf8e3[_0x9a99('0xa5')]||![],'chatPause':_0xadf8e3[_0x9a99('0xa5')]||![],'faxPause':_0xadf8e3[_0x9a99('0xa5')]||![],'smsPause':_0xadf8e3[_0x9a99('0xa5')]||![],'openchannelPause':_0xadf8e3[_0x9a99('0xa5')]||![],'whatsappPause':_0xadf8e3[_0x9a99('0xa5')]||![],'pauseType':_0xadf8e3[_0x9a99('0xa5')]?_0x9a99('0x104'):null,'interface':_0x5777a7,'lastPauseAt':moment()['format'](_0x9a99('0x101'))});}})[_0x9a99('0x1a')](function(_0x3a6a6f){if(_0x38b194['isMiddleware']){return _0x2ded5a();}else{return Promise['resolve'](_0x3a6a6f)[_0x9a99('0x1a')](respondWithResult(_0x36b7e8,null));}})[_0x9a99('0x23')](handleError(_0x36b7e8,null));};exports[_0x9a99('0x106')]=function(_0xf32499,_0x451da0){var _0x128487;return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0xf32499[_0x9a99('0x67')]['id'],'role':_0x9a99('0x2f')},'attributes':['id',_0x9a99('0x3e'),_0x9a99('0x2e')]})['then'](handleEntityNotFound(_0x451da0,null))[_0x9a99('0x1a')](function(_0x502db8){if(_0x502db8){_0x128487=_0x502db8;return db[_0x9a99('0xb6')][_0x9a99('0x32')]({'where':{'membername':_0x128487[_0x9a99('0x3e')]},'individualHooks':!![]});}})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x105')][_0x9a99('0x50')]({'where':{'membername':_0x128487['name'],'exitAt':null}});})[_0x9a99('0x1a')](function(_0x1f4391){var _0x251a29=[];_0x1f4391[_0x9a99('0xff')](function(_0x42f98c){_0x251a29['push'](_0x42f98c['update']({'exitAt':moment()[_0x9a99('0xb3')](_0x9a99('0x101'))}));});return Promise[_0x9a99('0x58')](_0x251a29);})['then'](function(){return _0x128487[_0x9a99('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9a99('0x1a')](respondWithResult(_0x451da0,null))[_0x9a99('0x23')](handleError(_0x451da0,null));};exports['pause']=function(_0x19c968,_0x1cb263){var _0x426094;return db[_0x9a99('0xb6')][_0x9a99('0x2d')]({'paused':0x1},{'where':{'UserId':_0x19c968[_0x9a99('0x67')]['id']},'individualHooks':!![]})[_0x9a99('0x1a')](function(){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x19c968[_0x9a99('0x67')]['id'],'role':_0x9a99('0x2f')},'attributes':['id','name','role',_0x9a99('0x6b'),_0x9a99('0xa6'),_0x9a99('0xb2')]});})[_0x9a99('0x1a')](handleEntityNotFound(_0x1cb263,null))[_0x9a99('0x1a')](function(_0x1e183c){if(_0x1e183c){_0x426094=_0x1e183c;return respondWithRpcPromise(_0x9a99('0x107'),_0x9a99('0x108'),{'id':_0x426094['id'],'name':_0x426094[_0x9a99('0x3e')],'pause':!![]});}})[_0x9a99('0x1a')](function(){if(_0x426094){return db[_0x9a99('0x105')][_0x9a99('0x50')]({'where':{'membername':_0x426094[_0x9a99('0x3e')],'type':_0x9a99('0x103'),'exitAt':null}});}})[_0x9a99('0x1a')](function(_0x10cf24){if(_0x10cf24[_0x9a99('0x54')]){var _0x1dc5c9=moment()[_0x9a99('0xb3')](_0x9a99('0x101'));for(var _0x466754=0x0,_0x20b673=_0x10cf24[_0x9a99('0x54')];_0x466754<_0x20b673;_0x466754++){_0x10cf24[_0x466754][_0x9a99('0x109')]({'exitAt':_0x1dc5c9});}}})[_0x9a99('0x1a')](function(){var _0x166a9f=[];var _0x178373=utils[_0x9a99('0x100')]();_0x178373[_0x9a99('0xff')](function(_0x571871){_0x166a9f['push']({'channel':_0x571871,'membername':_0x426094[_0x9a99('0x3e')],'interface':_['isNil'](_0x426094[_0x9a99('0xa6')])?util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0x426094[_0x9a99('0x3e')]):_0x426094[_0x9a99('0xa6')],'type':_0x9a99('0x103'),'enterAt':moment()[_0x9a99('0xb3')](_0x9a99('0x101')),'data1':_0x19c968[_0x9a99('0x66')]['type']||_0x9a99('0x10a'),'role':_0x426094[_0x9a99('0x2e')],'internal':_0x426094[_0x9a99('0x6b')]});});return db[_0x9a99('0x105')][_0x9a99('0x8e')](_0x166a9f,{'individualHooks':!![]});})[_0x9a99('0x1a')](function(){return _0x426094[_0x9a99('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x19c968[_0x9a99('0x66')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x9a99('0x101'))});})[_0x9a99('0x1a')](respondWithResult(_0x1cb263,null))['catch'](handleError(_0x1cb263,null));};exports['unpause']=function(_0x2e5f49,_0x550a29){if(_0x2e5f49[_0x9a99('0x66')]['channel']&&!utils['isValidChannel'](_0x2e5f49[_0x9a99('0x66')][_0x9a99('0xb9')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x2e5f49[_0x9a99('0x66')][_0x9a99('0xb9')]));}return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x2e5f49['params']['id']},'attributes':['id','name',_0x9a99('0x2e'),_0x9a99('0x6b'),_0x9a99('0xa6'),_0x9a99('0xb2'),'voicePause','mailPause',_0x9a99('0x10b'),_0x9a99('0x10c'),_0x9a99('0x10d'),_0x9a99('0x10e'),_0x9a99('0x10f'),'pauseType',_0x9a99('0x110')]})['then'](function(_0x5653dd){if(!_0x5653dd){throw new APINotFoundError(util['format'](_0x9a99('0x111'),_0x2e5f49[_0x9a99('0x67')]['id']));}return _0x5653dd[_0x9a99('0x112')](_0x2e5f49[_0x9a99('0x66')]['channel']);})[_0x9a99('0x1a')](respondWithResult(_0x550a29,null))['catch'](APIHandleError(_0x550a29));};exports[_0x9a99('0x113')]=function(_0x4e961c,_0x25804a){var _0x35d757={};var _0x15d787={};var _0x23f0fc;var _0x2c5e55;return db['User']['findOne']({'where':{'id':_0x4e961c[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x25804a,null))[_0x9a99('0x1a')](function(_0x52dd10){if(_0x52dd10){_0x23f0fc=_0x52dd10;_0x15d787['model']=_[_0x9a99('0x5a')](db[_0x9a99('0x114')][_0x9a99('0x5b')]);_0x15d787['query']=_[_0x9a99('0x5a')](_0x4e961c[_0x9a99('0x52')]);_0x15d787['filters']=_[_0x9a99('0x5d')](_0x15d787[_0x9a99('0x5e')],_0x15d787['query']);_0x35d757[_0x9a99('0x4d')]=_['intersection'](_0x15d787[_0x9a99('0x5e')],qs['fields'](_0x4e961c[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x35d757[_0x9a99('0x4d')]=_0x35d757['attributes']['length']?_0x35d757[_0x9a99('0x4d')]:_0x15d787[_0x9a99('0x5e')];_0x35d757['order']=qs[_0x9a99('0xd5')](_0x4e961c[_0x9a99('0x52')]['sort']);_0x35d757[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x4e961c[_0x9a99('0x52')],_0x15d787[_0x9a99('0x5c')]));if(_0x4e961c[_0x9a99('0x52')][_0x9a99('0x45')]){_0x35d757[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x35d757['where'],{'$or':_[_0x9a99('0x3b')](_0x35d757[_0x9a99('0x4d')],function(_0xfbb0ee){var _0x3193da={};_0x3193da[_0xfbb0ee]={'$like':'%'+_0x4e961c[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x3193da;})});}_0x35d757=_['merge']({},_0x35d757,_0x4e961c[_0x9a99('0xd8')]);return _0x23f0fc[_0x9a99('0x113')](_0x35d757);}})[_0x9a99('0x1a')](function(_0x54ea61){if(_0x54ea61){_0x2c5e55=_0x54ea61[_0x9a99('0x54')];if(!_0x4e961c[_0x9a99('0x52')]['hasOwnProperty'](_0x9a99('0xde'))){_0x35d757[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x4e961c[_0x9a99('0x52')][_0x9a99('0x29')]);_0x35d757[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x4e961c[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x23f0fc[_0x9a99('0x113')](_0x35d757);}})[_0x9a99('0x1a')](function(_0x475ec5){if(_0x475ec5){return _0x475ec5?{'count':_0x2c5e55,'rows':_0x475ec5}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x25804a,null))[_0x9a99('0x23')](handleError(_0x25804a,null));};exports[_0x9a99('0x115')]=function(_0x3c4561,_0x238907){var _0x56b0ee=_0x3c4561[_0x9a99('0x67')]['id'];var _0xaa8e20=_0x3c4561[_0x9a99('0x66')]?_0x3c4561[_0x9a99('0x66')]['ids']:null;var _0x5e3a22=[];return Promise[_0x9a99('0x116')]()[_0x9a99('0x1a')](function(){if(!_0xaa8e20)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x56b0ee}});})[_0x9a99('0x1a')](function(_0x437961){if(!_0x437961)throw new APINotFoundError(util['format'](_0x9a99('0x111'),_0x3c4561[_0x9a99('0x67')]['id']));return db[_0x9a99('0x70')][_0x9a99('0x117')](function(_0x3bd929){return _0x437961[_0x9a99('0x115')](_0xaa8e20,{'transaction':_0x3bd929})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x114')]['findAll']({'where':{'id':{'$in':_0xaa8e20}}});})[_0x9a99('0x1a')](function(_0x5c2e52){var _0x1a87f9=_[_0x9a99('0x3b')](_0x5c2e52,function(_0x23f690){return _0x23f690[_0x9a99('0x118')]();});return Promise['all'](_0x1a87f9);})[_0x9a99('0x1a')](function(_0x23bc51){_0x5e3a22=_['flattenDeep'](_0x23bc51);var _0x38ed2d=_[_0x9a99('0x3b')](_0x5e3a22,function(_0x3211eb){return _0x3211eb['addAgent'](_0x437961['id'],{'transaction':_0x3bd929});});return Promise['all'](_0x38ed2d);})[_0x9a99('0x1a')](function(){if(!_0x437961[_0x9a99('0xb2')])return;var _0x39641c=_['filter'](_0x5e3a22,function(_0x27ff58){return _0x27ff58[_0x9a99('0x119')](_0x9a99('0xb9'))===_0x9a99('0x11a');});var _0x25712b=_[_0x9a99('0x3b')](_0x39641c,function(_0x43b0e2){return db['UserVoiceQueueRt']['upsert']({'membername':_0x437961[_0x9a99('0x3e')],'UserId':_0x437961['id'],'queue_name':_0x43b0e2[_0x9a99('0x3e')],'VoiceQueueId':_0x43b0e2['id'],'interface':_[_0x9a99('0x6e')](_0x437961[_0x9a99('0xa6')])?util[_0x9a99('0xb3')](_0x9a99('0xb4'),_0x437961['name']):_0x437961[_0x9a99('0xa6')],'paused':_0x437961[_0x9a99('0xb5')]||![],'penalty':_0x437961[_0x9a99('0xac')]},{'transaction':_0x3bd929});});return Promise[_0x9a99('0x58')](_0x25712b);})[_0x9a99('0x1a')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0xaa8e20}}});})['then'](function(_0x19d953){var _0x449f2b=_[_0x9a99('0x3b')](_0x19d953,function(_0x2483c0){return db[_0x9a99('0x11b')]['create']({'UserId':_0x437961['id'],'VoicePrefixId':_0x2483c0['VoicePrefixId']},{'transaction':_0x3bd929});});return Promise[_0x9a99('0x58')](_0x449f2b);});});})[_0x9a99('0x1a')](function(){for(var _0x59a679=0x0;_0x59a679<_0x5e3a22[_0x9a99('0x54')];_0x59a679++){var _0x297385=_0x5e3a22[_0x59a679][_0x9a99('0x119')]('channel');var _0x5dd838=_0x297385+_0x9a99('0xae');socket['emit']('user'+_0x297385+_0x9a99('0xaf'),{'UserId':_0x56b0ee,['queueField']:_0x5e3a22[_0x59a679]['id']});}})['then'](respondWithStatusCode(_0x238907,null))[_0x9a99('0x23')](APIHandleError(_0x238907));};exports[_0x9a99('0x11c')]=function(_0x548d67,_0x46110f){var _0x5d8f9e=_0x548d67[_0x9a99('0x67')]['id'];var _0x7b19c2=null;if(_0x548d67[_0x9a99('0x52')][_0x9a99('0x6a')]){_0x7b19c2=_[_0x9a99('0xbb')](_0x548d67['query'][_0x9a99('0x6a')])?_0x548d67[_0x9a99('0x52')][_0x9a99('0x6a')]:[_0x548d67[_0x9a99('0x52')][_0x9a99('0x6a')]];}var _0x9ac584=[];return Promise[_0x9a99('0x116')]()[_0x9a99('0x1a')](function(){if(!_0x7b19c2)throw new APIBadRequestError(_0x9a99('0x11d'));})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x5d8f9e}});})[_0x9a99('0x1a')](function(_0x321bb5){if(!_0x321bb5)throw new APINotFoundError(util[_0x9a99('0xb3')](_0x9a99('0x111'),_0x548d67[_0x9a99('0x67')]['id']));return db['sequelize'][_0x9a99('0x117')](function(_0x28e2c7){return _0x321bb5[_0x9a99('0x11c')](_0x7b19c2,{'transaction':_0x28e2c7})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x114')][_0x9a99('0x50')]({'where':{'id':{'$in':_0x7b19c2}}});})[_0x9a99('0x1a')](function(_0x1083aa){var _0x8d5512=_[_0x9a99('0x3b')](_0x1083aa,function(_0x5e741f){return _0x5e741f[_0x9a99('0x118')]();});return Promise['all'](_0x8d5512);})[_0x9a99('0x1a')](function(_0x5ecca3){_0x9ac584=_['flattenDeep'](_0x5ecca3);var _0x4c2118=_[_0x9a99('0x3b')](_0x9ac584,function(_0x157a5b){return _0x157a5b[_0x9a99('0x11e')](_0x321bb5['id'],{'transaction':_0x28e2c7});});return Promise['all'](_0x4c2118);})[_0x9a99('0x1a')](function(){if(!_0x321bb5[_0x9a99('0xb2')])return;var _0x21a680=_['filter'](_0x9ac584,function(_0x1b29ac){return _0x1b29ac[_0x9a99('0x119')](_0x9a99('0xb9'))===_0x9a99('0x11a');});var _0x242bf8=_['map'](_0x21a680,function(_0x4a270c){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x4a270c['id'],'UserId':_0x321bb5['id']},'transaction':_0x28e2c7});});return Promise[_0x9a99('0x58')](_0x242bf8);})[_0x9a99('0x1a')](function(){return db[_0x9a99('0x11f')]['findAll']({'where':{'teamId':{'$in':_0x7b19c2}}});})[_0x9a99('0x1a')](function(_0x4b26fb){var _0x438c80=_[_0x9a99('0x3b')](_0x4b26fb,function(_0x3880f3){return db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x321bb5['id'],'VoicePrefixId':_0x3880f3[_0x9a99('0x120')]}},{'transaction':_0x28e2c7});});return Promise[_0x9a99('0x58')](_0x438c80);});});})[_0x9a99('0x1a')](function(){for(var _0x1fe9ba=0x0;_0x1fe9ba<_0x9ac584[_0x9a99('0x54')];_0x1fe9ba++){var _0x464d3a=_0x9ac584[_0x1fe9ba]['getDataValue']('channel');var _0x48adf0=_0x464d3a+_0x9a99('0xae');socket[_0x9a99('0x30')](_0x9a99('0x36')+_0x464d3a+_0x9a99('0xbc'),{'UserId':_0x5d8f9e,['queueField']:_0x9ac584[_0x1fe9ba]['id']});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x46110f,null))[_0x9a99('0x23')](APIHandleError(_0x46110f));};exports[_0x9a99('0x121')]=function(_0x4edc2b,_0x13e570){var _0x5f5157={};var _0x14db75={};var _0x54b1da;var _0xe37957;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x4edc2b[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x13e570,null))[_0x9a99('0x1a')](function(_0x21a92f){if(_0x21a92f){_0x54b1da=_0x21a92f;_0x14db75[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db['CmList'][_0x9a99('0x5b')]);_0x14db75[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x4edc2b[_0x9a99('0x52')]);_0x14db75[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x14db75[_0x9a99('0x5e')],_0x14db75[_0x9a99('0x52')]);_0x5f5157[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x14db75[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5f5157[_0x9a99('0x4d')]=_0x5f5157['attributes']['length']?_0x5f5157[_0x9a99('0x4d')]:_0x14db75[_0x9a99('0x5e')];_0x5f5157[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x4edc2b['query'][_0x9a99('0xd5')]);_0x5f5157[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_['pick'](_0x4edc2b[_0x9a99('0x52')],_0x14db75[_0x9a99('0x5c')]));if(_0x4edc2b['query']['filter']){_0x5f5157['where']=_[_0x9a99('0x60')](_0x5f5157[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5f5157[_0x9a99('0x4d')],function(_0x3fadba){var _0x1bd986={};_0x1bd986[_0x3fadba]={'$like':'%'+_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x1bd986;})});}_0x5f5157=_['merge']({},_0x5f5157,_0x4edc2b[_0x9a99('0xd8')]);return _0x54b1da[_0x9a99('0x121')](_0x5f5157);}})['then'](function(_0x32f187){if(_0x32f187){_0xe37957=_0x32f187[_0x9a99('0x54')];if(!_0x4edc2b[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x5f5157[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x29')]);_0x5f5157['offset']=qs[_0x9a99('0x28')](_0x4edc2b[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x54b1da['getLists'](_0x5f5157);}})['then'](function(_0x105302){if(_0x105302){return _0x105302?{'count':_0xe37957,'rows':_0x105302}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x13e570,null))[_0x9a99('0x23')](handleError(_0x13e570,null));};exports['getAgents']=function(_0x3d9223,_0x2b1e74){var _0x5554b8={};var _0x2b0254={};var _0xe4e17a;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x3d9223['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x2b1e74,null))[_0x9a99('0x1a')](function(_0xaa3a3b){if(_0xaa3a3b){_0xe4e17a=_0xaa3a3b;_0x2b0254[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0x4f')][_0x9a99('0x5b')]);_0x2b0254[_0x9a99('0x52')]=_['keys'](_0x3d9223[_0x9a99('0x52')]);_0x2b0254['filters']=_[_0x9a99('0x5d')](_0x2b0254[_0x9a99('0x5e')],_0x2b0254[_0x9a99('0x52')]);_0x5554b8[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x2b0254[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x3d9223[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5554b8['attributes']=_0x5554b8['attributes'][_0x9a99('0x54')]?_0x5554b8['attributes']:_0x2b0254['model'];_0x5554b8[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x3d9223[_0x9a99('0x52')]['sort']);_0x5554b8[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x3d9223[_0x9a99('0x52')],_0x2b0254[_0x9a99('0x5c')]));if(_0x3d9223['query'][_0x9a99('0x45')]){_0x5554b8[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x5554b8[_0x9a99('0xd6')],{'$or':_['map'](_0x5554b8[_0x9a99('0x4d')],function(_0x1047ad){var _0xc87f31={};_0xc87f31[_0x1047ad]={'$like':'%'+_0x3d9223[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0xc87f31;})});}_0x5554b8['model']=db[_0x9a99('0x4f')];_0x5554b8['as']=_0x9a99('0x37');_0x5554b8=_[_0x9a99('0x60')]({},_0x5554b8,_0x3d9223['options']);return _0xe4e17a['getVoiceQueues']({'include':[_0x5554b8]});}})[_0x9a99('0x1a')](function(_0x19c490){if(_0x19c490){var _0x3b49c9={},_0x207ee0=[];for(var _0x23eff3=0x0;_0x23eff3<_0x19c490['length'];_0x23eff3+=0x1){for(var _0x37c400=0x0,_0x1487ac;_0x37c400<_0x19c490[_0x23eff3][_0x9a99('0x37')][_0x9a99('0x54')];_0x37c400+=0x1){_0x1487ac=_0x19c490[_0x23eff3]['Agents'][_0x37c400][_0x9a99('0x33')]({'plain':!![]});_0x3b49c9[_0x1487ac['id']]=_0x1487ac;}}_0x3b49c9=_[_0x9a99('0x122')](_0x3b49c9);for(var _0x586e4b=qs[_0x9a99('0x28')](_0x3d9223[_0x9a99('0x52')][_0x9a99('0x28')]);_0x586e4b<_0x3b49c9[_0x9a99('0x54')]&&_0x207ee0[_0x9a99('0x54')]<qs[_0x9a99('0x29')](_0x3d9223[_0x9a99('0x52')][_0x9a99('0x29')]);_0x586e4b+=0x1){if(_0x3b49c9[_0x586e4b]){_0x207ee0['push'](_0x3b49c9[_0x586e4b]);}}return{'count':_0x3b49c9[_0x9a99('0x54')],'rows':_0x207ee0};}})['then'](respondWithResult(_0x2b1e74,null))[_0x9a99('0x23')](handleError(_0x2b1e74,null));};exports[_0x9a99('0x32')]=function(_0x15eab4,_0x470256){if(_0x15eab4[_0x9a99('0x36')]['id']==_0x15eab4[_0x9a99('0x67')]['id']){return _0x470256[_0x9a99('0x25')](0x1f4)[_0x9a99('0x40')]({'message':_0x9a99('0x123')});}return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x15eab4['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x470256,null))[_0x9a99('0x1a')](removeEntity(_0x470256,null))[_0x9a99('0x23')](handleError(_0x470256,null));};exports[_0x9a99('0x124')]=function(_0x1f502a,_0x1f7ee1){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x1f502a['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x1f7ee1,null))[_0x9a99('0x1a')](function(_0x427add){if(_0x427add){return _0x427add['addChatInteractions'](_0x1f502a[_0x9a99('0x66')][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x1f502a[_0x9a99('0x66')],[_0x9a99('0x6a'),'id'])||{})[_0x9a99('0xad')](function(){for(var _0x4f4c29=0x0;_0x4f4c29<_0x1f502a[_0x9a99('0x66')][_0x9a99('0x6a')][_0x9a99('0x54')];_0x4f4c29+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x126'),{'ChatInteractionId':Number(_0x1f502a[_0x9a99('0x66')][_0x9a99('0x6a')][_0x4f4c29]),'UserId':Number(_0x1f502a[_0x9a99('0x67')]['id'])});}return _0x1f502a[_0x9a99('0x66')][_0x9a99('0x6a')];});}})[_0x9a99('0x1a')](respondWithResult(_0x1f7ee1,null))['catch'](handleError(_0x1f7ee1,null));};exports[_0x9a99('0x127')]=function(_0x18454a,_0x436d87){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x18454a[_0x9a99('0x67')]['id']}})['then'](handleEntityNotFound(_0x436d87,null))[_0x9a99('0x1a')](function(_0x4e94fe){if(_0x4e94fe){return _0x4e94fe[_0x9a99('0x127')](_0x18454a['query'][_0x9a99('0x6a')])[_0x9a99('0x1a')](function(){if(_[_0x9a99('0xbb')](_0x18454a[_0x9a99('0x52')][_0x9a99('0x6a')])){for(var _0x4b08b4=0x0;_0x4b08b4<_0x18454a[_0x9a99('0x52')]['ids'][_0x9a99('0x54')];_0x4b08b4+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x128'),{'ChatInteractionId':Number(_0x18454a[_0x9a99('0x52')][_0x9a99('0x6a')][_0x4b08b4]),'UserId':Number(_0x18454a[_0x9a99('0x67')]['id'])});}}else{socket[_0x9a99('0x30')](_0x9a99('0x128'),{'ChatInteractionId':Number(_0x18454a[_0x9a99('0x52')][_0x9a99('0x6a')]),'UserId':Number(_0x18454a[_0x9a99('0x67')]['id'])});}});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x436d87,null))['catch'](handleError(_0x436d87,null));};exports[_0x9a99('0x129')]=function(_0x4cac88,_0x36935f){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x4cac88[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x36935f,null))[_0x9a99('0x1a')](function(_0x5a6a89){if(_0x5a6a89){return _0x5a6a89[_0x9a99('0x129')](_0x4cac88['body'][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x4cac88['body'],[_0x9a99('0x6a'),'id'])||{})[_0x9a99('0xad')](function(){for(var _0x1f7bc7=0x0;_0x1f7bc7<_0x4cac88['body'][_0x9a99('0x6a')][_0x9a99('0x54')];_0x1f7bc7+=0x1){socket[_0x9a99('0x30')]('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x4cac88[_0x9a99('0x66')]['ids'][_0x1f7bc7]),'UserId':Number(_0x4cac88[_0x9a99('0x67')]['id'])});}return _0x4cac88[_0x9a99('0x66')]['ids'];});}})[_0x9a99('0x1a')](respondWithResult(_0x36935f,null))[_0x9a99('0x23')](handleError(_0x36935f,null));};exports[_0x9a99('0x12a')]=function(_0x36afde,_0x3c582f){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x36afde[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3c582f,null))[_0x9a99('0x1a')](function(_0x981ccb){if(_0x981ccb){return _0x981ccb[_0x9a99('0x12a')](_0x36afde[_0x9a99('0x52')][_0x9a99('0x6a')])['then'](function(){if(_[_0x9a99('0xbb')](_0x36afde[_0x9a99('0x52')][_0x9a99('0x6a')])){for(var _0x402e14=0x0;_0x402e14<_0x36afde[_0x9a99('0x52')][_0x9a99('0x6a')][_0x9a99('0x54')];_0x402e14+=0x1){socket['emit'](_0x9a99('0x12b'),{'MailInteractionId':Number(_0x36afde[_0x9a99('0x52')]['ids'][_0x402e14]),'UserId':Number(_0x36afde[_0x9a99('0x67')]['id'])});}}else{socket[_0x9a99('0x30')](_0x9a99('0x12b'),{'MailInteractionId':Number(_0x36afde['query'][_0x9a99('0x6a')]),'UserId':Number(_0x36afde[_0x9a99('0x67')]['id'])});}});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x3c582f,null))['catch'](handleError(_0x3c582f,null));};exports[_0x9a99('0x12c')]=function(_0x33f35c,_0x14d19e){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x33f35c['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x14d19e,null))[_0x9a99('0x1a')](function(_0x4a250d){if(_0x4a250d){return _0x4a250d[_0x9a99('0x12c')](_0x33f35c[_0x9a99('0x66')][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x33f35c['body'],['ids','id'])||{})[_0x9a99('0xad')](function(){for(var _0xd42cfb=0x0;_0xd42cfb<_0x33f35c[_0x9a99('0x66')]['ids'][_0x9a99('0x54')];_0xd42cfb+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x12d'),{'FaxInteractionId':Number(_0x33f35c['body'][_0x9a99('0x6a')][_0xd42cfb]),'UserId':Number(_0x33f35c['params']['id'])});}return _0x33f35c[_0x9a99('0x66')][_0x9a99('0x6a')];});}})['then'](respondWithResult(_0x14d19e,null))[_0x9a99('0x23')](handleError(_0x14d19e,null));};exports[_0x9a99('0x12e')]=function(_0x339648,_0x5cd7bc){return db[_0x9a99('0x4f')]['find']({'where':{'id':_0x339648[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x5cd7bc,null))[_0x9a99('0x1a')](function(_0x1c7d2c){if(_0x1c7d2c){return _0x1c7d2c[_0x9a99('0x12e')](_0x339648[_0x9a99('0x52')]['ids'])['then'](function(){if(_[_0x9a99('0xbb')](_0x339648[_0x9a99('0x52')][_0x9a99('0x6a')])){for(var _0x36bf88=0x0;_0x36bf88<_0x339648[_0x9a99('0x52')][_0x9a99('0x6a')]['length'];_0x36bf88+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x12f'),{'FaxInteractionId':Number(_0x339648[_0x9a99('0x52')]['ids'][_0x36bf88]),'UserId':Number(_0x339648[_0x9a99('0x67')]['id'])});}}else{socket[_0x9a99('0x30')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x339648[_0x9a99('0x52')][_0x9a99('0x6a')]),'UserId':Number(_0x339648['params']['id'])});}});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x5cd7bc,null))[_0x9a99('0x23')](handleError(_0x5cd7bc,null));};exports[_0x9a99('0x130')]=function(_0xcb19bf,_0x267e82){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0xcb19bf[_0x9a99('0x67')]['id']}})['then'](handleEntityNotFound(_0x267e82,null))[_0x9a99('0x1a')](function(_0x2e5ad4){if(_0x2e5ad4){return _0x2e5ad4['addSmsInteractions'](_0xcb19bf[_0x9a99('0x66')][_0x9a99('0x6a')],_['omit'](_0xcb19bf[_0x9a99('0x66')],['ids','id'])||{})[_0x9a99('0xad')](function(){for(var _0xdff480=0x0;_0xdff480<_0xcb19bf['body'][_0x9a99('0x6a')]['length'];_0xdff480+=0x1){socket[_0x9a99('0x30')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0xcb19bf[_0x9a99('0x66')][_0x9a99('0x6a')][_0xdff480]),'UserId':Number(_0xcb19bf[_0x9a99('0x67')]['id'])});}return _0xcb19bf[_0x9a99('0x66')][_0x9a99('0x6a')];});}})['then'](respondWithResult(_0x267e82,null))[_0x9a99('0x23')](handleError(_0x267e82,null));};exports['removeSmsInteractions']=function(_0x32e03e,_0x14c98e){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x32e03e['params']['id']}})['then'](handleEntityNotFound(_0x14c98e,null))[_0x9a99('0x1a')](function(_0x325508){if(_0x325508){return _0x325508[_0x9a99('0x131')](_0x32e03e[_0x9a99('0x52')][_0x9a99('0x6a')])['then'](function(){if(_[_0x9a99('0xbb')](_0x32e03e[_0x9a99('0x52')][_0x9a99('0x6a')])){for(var _0x4e4e19=0x0;_0x4e4e19<_0x32e03e[_0x9a99('0x52')][_0x9a99('0x6a')][_0x9a99('0x54')];_0x4e4e19+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x132'),{'SmsInteractionId':Number(_0x32e03e[_0x9a99('0x52')][_0x9a99('0x6a')][_0x4e4e19]),'UserId':Number(_0x32e03e['params']['id'])});}}else{socket[_0x9a99('0x30')](_0x9a99('0x132'),{'SmsInteractionId':Number(_0x32e03e[_0x9a99('0x52')][_0x9a99('0x6a')]),'UserId':Number(_0x32e03e[_0x9a99('0x67')]['id'])});}});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x14c98e,null))[_0x9a99('0x23')](handleError(_0x14c98e,null));};exports[_0x9a99('0x133')]=function(_0x2e1ef6,_0x123f6b){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x2e1ef6['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x123f6b,null))[_0x9a99('0x1a')](function(_0x31fd5a){if(_0x31fd5a){return _0x31fd5a[_0x9a99('0x133')](_0x2e1ef6[_0x9a99('0x66')][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x2e1ef6[_0x9a99('0x66')],[_0x9a99('0x6a'),'id'])||{})[_0x9a99('0xad')](function(){for(var _0x4bcb6b=0x0;_0x4bcb6b<_0x2e1ef6[_0x9a99('0x66')]['ids'][_0x9a99('0x54')];_0x4bcb6b+=0x1){socket[_0x9a99('0x30')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x2e1ef6[_0x9a99('0x66')][_0x9a99('0x6a')][_0x4bcb6b]),'UserId':Number(_0x2e1ef6[_0x9a99('0x67')]['id'])});}return _0x2e1ef6['body'][_0x9a99('0x6a')];});}})['then'](respondWithResult(_0x123f6b,null))[_0x9a99('0x23')](handleError(_0x123f6b,null));};exports[_0x9a99('0x134')]=function(_0xa7bd73,_0x93148c){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0xa7bd73[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x93148c,null))[_0x9a99('0x1a')](function(_0xe1a959){if(_0xe1a959){return _0xe1a959['removeOpenchannelInteractions'](_0xa7bd73[_0x9a99('0x52')][_0x9a99('0x6a')])[_0x9a99('0x1a')](function(){if(_[_0x9a99('0xbb')](_0xa7bd73[_0x9a99('0x52')][_0x9a99('0x6a')])){for(var _0x32ab0a=0x0;_0x32ab0a<_0xa7bd73[_0x9a99('0x52')][_0x9a99('0x6a')][_0x9a99('0x54')];_0x32ab0a+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x135'),{'OpenchannelInteractionId':Number(_0xa7bd73[_0x9a99('0x52')][_0x9a99('0x6a')][_0x32ab0a]),'UserId':Number(_0xa7bd73[_0x9a99('0x67')]['id'])});}}else{socket[_0x9a99('0x30')](_0x9a99('0x135'),{'OpenchannelInteractionId':Number(_0xa7bd73['query'][_0x9a99('0x6a')]),'UserId':Number(_0xa7bd73[_0x9a99('0x67')]['id'])});}});}})[_0x9a99('0x1a')](respondWithStatusCode(_0x93148c,null))['catch'](handleError(_0x93148c,null));};exports['addWhatsappInteractions']=function(_0x15af84,_0x2902dc){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x15af84[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x2902dc,null))[_0x9a99('0x1a')](function(_0x5a0cec){if(_0x5a0cec){return _0x5a0cec['addWhatsappInteractions'](_0x15af84[_0x9a99('0x66')][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x15af84[_0x9a99('0x66')],['ids','id'])||{})[_0x9a99('0xad')](function(){for(var _0x3d15ae=0x0;_0x3d15ae<_0x15af84[_0x9a99('0x66')][_0x9a99('0x6a')]['length'];_0x3d15ae+=0x1){socket[_0x9a99('0x30')](_0x9a99('0x136'),{'WhatsappInteractionId':Number(_0x15af84[_0x9a99('0x66')]['ids'][_0x3d15ae]),'UserId':Number(_0x15af84['params']['id'])});}return _0x15af84[_0x9a99('0x66')][_0x9a99('0x6a')];});}})[_0x9a99('0x1a')](respondWithResult(_0x2902dc,null))[_0x9a99('0x23')](handleError(_0x2902dc,null));};exports[_0x9a99('0x137')]=function(_0x2a6636,_0x82dac7){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x2a6636['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x82dac7,null))[_0x9a99('0x1a')](function(_0x18bd8c){if(_0x18bd8c){return _0x18bd8c[_0x9a99('0x137')](_0x2a6636[_0x9a99('0x52')][_0x9a99('0x6a')]);}})[_0x9a99('0x1a')](respondWithStatusCode(_0x82dac7,null))[_0x9a99('0x23')](handleError(_0x82dac7,null));};exports[_0x9a99('0x138')]=function(_0x32d799,_0x1e9770){var _0x432864={};var _0x10f7df={};var _0x58ec1b;var _0xfd327b;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x32d799[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x1e9770,null))[_0x9a99('0x1a')](function(_0x552ab2){if(_0x552ab2){_0x58ec1b=_0x552ab2;_0x10f7df[_0x9a99('0x5e')]=_['keys'](db[_0x9a99('0x139')][_0x9a99('0x5b')]);_0x10f7df['query']=_[_0x9a99('0x5a')](_0x32d799[_0x9a99('0x52')]);_0x10f7df['filters']=_['intersection'](_0x10f7df[_0x9a99('0x5e')],_0x10f7df['query']);_0x432864[_0x9a99('0x4d')]=_['intersection'](_0x10f7df[_0x9a99('0x5e')],qs['fields'](_0x32d799[_0x9a99('0x52')]['fields']));_0x432864['attributes']=_0x432864[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x432864[_0x9a99('0x4d')]:_0x10f7df[_0x9a99('0x5e')];_0x432864[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x32d799[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x432864[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x32d799['query'],_0x10f7df[_0x9a99('0x5c')]));if(_0x32d799['query'][_0x9a99('0x45')]){_0x432864[_0x9a99('0xd6')]=_['merge'](_0x432864['where'],{'$or':_['map'](_0x432864[_0x9a99('0x4d')],function(_0x23d8d2){var _0x51d843={};_0x51d843[_0x23d8d2]={'$like':'%'+_0x32d799[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x51d843;})});}_0x432864=_['merge']({},_0x432864,_0x32d799[_0x9a99('0xd8')]);return _0x58ec1b[_0x9a99('0x138')](_0x432864);}})[_0x9a99('0x1a')](function(_0xd06f41){if(_0xd06f41){_0xfd327b=_0xd06f41[_0x9a99('0x54')];if(!_0x32d799[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x432864['limit']=qs[_0x9a99('0x29')](_0x32d799[_0x9a99('0x52')]['limit']);_0x432864['offset']=qs['offset'](_0x32d799[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x58ec1b[_0x9a99('0x138')](_0x432864);}})[_0x9a99('0x1a')](function(_0x1a92ae){if(_0x1a92ae){return _0x1a92ae?{'count':_0xfd327b,'rows':_0x1a92ae}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x1e9770,null))[_0x9a99('0x23')](handleError(_0x1e9770,null));};exports['getFaxAccounts']=function(_0x5a48dd,_0x28cd1f){var _0x3c4001={};var _0x5e3c79={};var _0x2ed3b3;var _0x49e940;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x5a48dd[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x28cd1f,null))[_0x9a99('0x1a')](function(_0x217f8c){if(_0x217f8c){_0x2ed3b3=_0x217f8c;_0x5e3c79[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0x13a')]['rawAttributes']);_0x5e3c79['query']=_[_0x9a99('0x5a')](_0x5a48dd[_0x9a99('0x52')]);_0x5e3c79['filters']=_['intersection'](_0x5e3c79[_0x9a99('0x5e')],_0x5e3c79[_0x9a99('0x52')]);_0x3c4001[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x5e3c79[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x5a48dd[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x3c4001['attributes']=_0x3c4001[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x3c4001['attributes']:_0x5e3c79[_0x9a99('0x5e')];_0x3c4001[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x5a48dd[_0x9a99('0x52')]['sort']);_0x3c4001[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x5a48dd['query'],_0x5e3c79['filters']));if(_0x5a48dd['query'][_0x9a99('0x45')]){_0x3c4001[_0x9a99('0xd6')]=_['merge'](_0x3c4001['where'],{'$or':_[_0x9a99('0x3b')](_0x3c4001[_0x9a99('0x4d')],function(_0x4bf45f){var _0x461c63={};_0x461c63[_0x4bf45f]={'$like':'%'+_0x5a48dd['query'][_0x9a99('0x45')]+'%'};return _0x461c63;})});}_0x3c4001=_['merge']({},_0x3c4001,_0x5a48dd[_0x9a99('0xd8')]);return _0x2ed3b3[_0x9a99('0x13b')](_0x3c4001);}})['then'](function(_0xc38d9d){if(_0xc38d9d){_0x49e940=_0xc38d9d[_0x9a99('0x54')];if(!_0x5a48dd[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x3c4001[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x5a48dd[_0x9a99('0x52')][_0x9a99('0x29')]);_0x3c4001[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x5a48dd[_0x9a99('0x52')]['offset']);}return _0x2ed3b3['getFaxAccounts'](_0x3c4001);}})[_0x9a99('0x1a')](function(_0x308b75){if(_0x308b75){return _0x308b75?{'count':_0x49e940,'rows':_0x308b75}:null;}})['then'](respondWithResult(_0x28cd1f,null))[_0x9a99('0x23')](handleError(_0x28cd1f,null));};exports[_0x9a99('0x13c')]=function(_0x564961,_0x1beba1){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x564961['params']['id']}})['then'](handleEntityNotFound(_0x1beba1,null))['then'](function(_0xdc6927){if(_0xdc6927){return _0xdc6927[_0x9a99('0x13c')](_0x564961[_0x9a99('0x66')][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x564961[_0x9a99('0x66')],['ids','id'])||{});}})['then'](respondWithResult(_0x1beba1,null))['catch'](handleError(_0x1beba1,null));};exports[_0x9a99('0x13d')]=function(_0x1be447,_0x2b3b8c){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x1be447[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x2b3b8c,null))[_0x9a99('0x1a')](function(_0x2bd506){if(_0x2bd506){return _0x2bd506[_0x9a99('0x13d')](_0x1be447[_0x9a99('0x52')][_0x9a99('0x6a')]);}})[_0x9a99('0x1a')](respondWithStatusCode(_0x2b3b8c,null))[_0x9a99('0x23')](handleError(_0x2b3b8c,null));};exports['getMailAccounts']=function(_0x240ca8,_0x2d1a30){var _0x2b83b2={};var _0xd409d2={};var _0x491a64;var _0x10ecf4;return db['User'][_0x9a99('0x9e')]({'where':{'id':_0x240ca8['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x2d1a30,null))['then'](function(_0x1c6b20){if(_0x1c6b20){_0x491a64=_0x1c6b20;_0xd409d2[_0x9a99('0x5e')]=_['keys'](db[_0x9a99('0x13e')][_0x9a99('0x5b')]);_0xd409d2[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x240ca8[_0x9a99('0x52')]);_0xd409d2[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0xd409d2[_0x9a99('0x5e')],_0xd409d2['query']);_0x2b83b2[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0xd409d2[_0x9a99('0x5e')],qs['fields'](_0x240ca8[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x2b83b2[_0x9a99('0x4d')]=_0x2b83b2['attributes']['length']?_0x2b83b2[_0x9a99('0x4d')]:_0xd409d2[_0x9a99('0x5e')];_0x2b83b2[_0x9a99('0xd4')]=qs['sort'](_0x240ca8[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x2b83b2[_0x9a99('0xd6')]=qs['filters'](_['pick'](_0x240ca8[_0x9a99('0x52')],_0xd409d2[_0x9a99('0x5c')]));if(_0x240ca8[_0x9a99('0x52')][_0x9a99('0x45')]){_0x2b83b2[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x2b83b2[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x2b83b2['attributes'],function(_0x2ce257){var _0x590a19={};_0x590a19[_0x2ce257]={'$like':'%'+_0x240ca8['query'][_0x9a99('0x45')]+'%'};return _0x590a19;})});}_0x2b83b2=_[_0x9a99('0x60')]({},_0x2b83b2,_0x240ca8[_0x9a99('0xd8')]);return _0x491a64['getMailAccounts'](_0x2b83b2);}})[_0x9a99('0x1a')](function(_0x52eb38){if(_0x52eb38){_0x10ecf4=_0x52eb38['length'];if(!_0x240ca8[_0x9a99('0x52')]['hasOwnProperty'](_0x9a99('0xde'))){_0x2b83b2[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x240ca8[_0x9a99('0x52')][_0x9a99('0x29')]);_0x2b83b2[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x240ca8['query'][_0x9a99('0x28')]);}return _0x491a64[_0x9a99('0x13f')](_0x2b83b2);}})['then'](function(_0x4d2960){if(_0x4d2960){return _0x4d2960?{'count':_0x10ecf4,'rows':_0x4d2960}:null;}})['then'](respondWithResult(_0x2d1a30,null))[_0x9a99('0x23')](handleError(_0x2d1a30,null));};exports[_0x9a99('0x140')]=function(_0x4859d5,_0xd891f){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x4859d5[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0xd891f,null))[_0x9a99('0x1a')](function(_0x42c480){if(_0x42c480){return _0x42c480[_0x9a99('0x140')](_0x4859d5['body'][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x4859d5['body'],['ids','id'])||{});}})[_0x9a99('0x1a')](respondWithResult(_0xd891f,null))[_0x9a99('0x23')](handleError(_0xd891f,null));};exports['removeMailAccounts']=function(_0x2a0ea8,_0xb32d56){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x2a0ea8['params']['id']}})['then'](handleEntityNotFound(_0xb32d56,null))[_0x9a99('0x1a')](function(_0x5ca32a){if(_0x5ca32a){return _0x5ca32a[_0x9a99('0x141')](_0x2a0ea8[_0x9a99('0x52')][_0x9a99('0x6a')]);}})['then'](respondWithStatusCode(_0xb32d56,null))[_0x9a99('0x23')](handleError(_0xb32d56,null));};exports[_0x9a99('0x142')]=function(_0x2e5cde,_0x577aab){var _0x4e31ee={};var _0x5700b6={};var _0x3eb9c1;var _0x426788;return db['User'][_0x9a99('0x9e')]({'where':{'id':_0x2e5cde['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x577aab,null))[_0x9a99('0x1a')](function(_0x4906bb){if(_0x4906bb){_0x3eb9c1=_0x4906bb;_0x5700b6['model']=_[_0x9a99('0x5a')](db['OpenchannelAccount'][_0x9a99('0x5b')]);_0x5700b6[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x2e5cde['query']);_0x5700b6[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x5700b6['model'],_0x5700b6['query']);_0x4e31ee[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x5700b6[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x2e5cde[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x4e31ee['attributes']=_0x4e31ee[_0x9a99('0x4d')]['length']?_0x4e31ee[_0x9a99('0x4d')]:_0x5700b6['model'];_0x4e31ee[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x2e5cde[_0x9a99('0x52')]['sort']);_0x4e31ee['where']=qs[_0x9a99('0x5c')](_['pick'](_0x2e5cde['query'],_0x5700b6['filters']));if(_0x2e5cde[_0x9a99('0x52')][_0x9a99('0x45')]){_0x4e31ee[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x4e31ee['where'],{'$or':_[_0x9a99('0x3b')](_0x4e31ee['attributes'],function(_0x538de6){var _0x516d81={};_0x516d81[_0x538de6]={'$like':'%'+_0x2e5cde[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x516d81;})});}_0x4e31ee=_['merge']({},_0x4e31ee,_0x2e5cde[_0x9a99('0xd8')]);return _0x3eb9c1[_0x9a99('0x142')](_0x4e31ee);}})[_0x9a99('0x1a')](function(_0x54987f){if(_0x54987f){_0x426788=_0x54987f[_0x9a99('0x54')];if(!_0x2e5cde[_0x9a99('0x52')][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x4e31ee['limit']=qs[_0x9a99('0x29')](_0x2e5cde[_0x9a99('0x52')]['limit']);_0x4e31ee[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x2e5cde[_0x9a99('0x52')]['offset']);}return _0x3eb9c1[_0x9a99('0x142')](_0x4e31ee);}})['then'](function(_0x280bcf){if(_0x280bcf){return _0x280bcf?{'count':_0x426788,'rows':_0x280bcf}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x577aab,null))[_0x9a99('0x23')](handleError(_0x577aab,null));};exports[_0x9a99('0x143')]=function(_0x104c14,_0x439b61){return db[_0x9a99('0x4f')]['find']({'where':{'id':_0x104c14[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x439b61,null))['then'](function(_0x286eb9){if(_0x286eb9){return _0x286eb9[_0x9a99('0x143')](_0x104c14['body'][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x104c14[_0x9a99('0x66')],[_0x9a99('0x6a'),'id'])||{});}})[_0x9a99('0x1a')](respondWithResult(_0x439b61,null))[_0x9a99('0x23')](handleError(_0x439b61,null));};exports['removeOpenchannelAccounts']=function(_0x411866,_0x9c4d8){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x411866['params']['id']}})['then'](handleEntityNotFound(_0x9c4d8,null))[_0x9a99('0x1a')](function(_0x422367){if(_0x422367){return _0x422367[_0x9a99('0x144')](_0x411866[_0x9a99('0x52')]['ids']);}})[_0x9a99('0x1a')](respondWithStatusCode(_0x9c4d8,null))[_0x9a99('0x23')](handleError(_0x9c4d8,null));};exports['getSmsAccounts']=function(_0x1a1f8d,_0x5bd2d1){var _0x21caeb={};var _0x3d76f2={};var _0x5552b5;var _0x373b39;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x1a1f8d[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x5bd2d1,null))[_0x9a99('0x1a')](function(_0x3911f4){if(_0x3911f4){_0x5552b5=_0x3911f4;_0x3d76f2[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0x145')][_0x9a99('0x5b')]);_0x3d76f2[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x1a1f8d[_0x9a99('0x52')]);_0x3d76f2[_0x9a99('0x5c')]=_['intersection'](_0x3d76f2['model'],_0x3d76f2[_0x9a99('0x52')]);_0x21caeb[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x3d76f2[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x1a1f8d[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x21caeb[_0x9a99('0x4d')]=_0x21caeb[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x21caeb[_0x9a99('0x4d')]:_0x3d76f2[_0x9a99('0x5e')];_0x21caeb['order']=qs['sort'](_0x1a1f8d[_0x9a99('0x52')]['sort']);_0x21caeb[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x1a1f8d[_0x9a99('0x52')],_0x3d76f2[_0x9a99('0x5c')]));if(_0x1a1f8d[_0x9a99('0x52')][_0x9a99('0x45')]){_0x21caeb[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x21caeb['where'],{'$or':_['map'](_0x21caeb[_0x9a99('0x4d')],function(_0x35d3de){var _0x26b433={};_0x26b433[_0x35d3de]={'$like':'%'+_0x1a1f8d[_0x9a99('0x52')]['filter']+'%'};return _0x26b433;})});}_0x21caeb=_[_0x9a99('0x60')]({},_0x21caeb,_0x1a1f8d[_0x9a99('0xd8')]);return _0x5552b5[_0x9a99('0x146')](_0x21caeb);}})[_0x9a99('0x1a')](function(_0x3d7862){if(_0x3d7862){_0x373b39=_0x3d7862[_0x9a99('0x54')];if(!_0x1a1f8d[_0x9a99('0x52')][_0x9a99('0xd9')]('nolimit')){_0x21caeb['limit']=qs[_0x9a99('0x29')](_0x1a1f8d['query'][_0x9a99('0x29')]);_0x21caeb[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x1a1f8d[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x5552b5[_0x9a99('0x146')](_0x21caeb);}})[_0x9a99('0x1a')](function(_0x4801ab){if(_0x4801ab){return _0x4801ab?{'count':_0x373b39,'rows':_0x4801ab}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x5bd2d1,null))['catch'](handleError(_0x5bd2d1,null));};exports[_0x9a99('0x147')]=function(_0x58ae90,_0x16a970){return db[_0x9a99('0x4f')]['find']({'where':{'id':_0x58ae90[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x16a970,null))['then'](function(_0x15f72b){if(_0x15f72b){return _0x15f72b['addSmsAccounts'](_0x58ae90[_0x9a99('0x66')][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x58ae90[_0x9a99('0x66')],['ids','id'])||{});}})[_0x9a99('0x1a')](respondWithResult(_0x16a970,null))[_0x9a99('0x23')](handleError(_0x16a970,null));};exports[_0x9a99('0x148')]=function(_0x113c87,_0x2e57ed){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x113c87[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x2e57ed,null))[_0x9a99('0x1a')](function(_0x59c650){if(_0x59c650){return _0x59c650[_0x9a99('0x148')](_0x113c87[_0x9a99('0x52')][_0x9a99('0x6a')]);}})[_0x9a99('0x1a')](respondWithStatusCode(_0x2e57ed,null))[_0x9a99('0x23')](handleError(_0x2e57ed,null));};exports[_0x9a99('0x149')]=function(_0x5d7cc3,_0x4560a4){var _0x1a5353={};var _0x43cdeb={};var _0x281f1b;var _0x43086a;return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x5d7cc3[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x4560a4,null))[_0x9a99('0x1a')](function(_0xfd2762){if(_0xfd2762){_0x281f1b=_0xfd2762;_0x43cdeb[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0x14a')]['rawAttributes']);_0x43cdeb[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x5d7cc3[_0x9a99('0x52')]);_0x43cdeb[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x43cdeb[_0x9a99('0x5e')],_0x43cdeb[_0x9a99('0x52')]);_0x1a5353[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x43cdeb[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x5d7cc3['query'][_0x9a99('0x5f')]));_0x1a5353['attributes']=_0x1a5353[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x1a5353['attributes']:_0x43cdeb['model'];_0x1a5353[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x5d7cc3[_0x9a99('0x52')][_0x9a99('0xd5')]);_0x1a5353[_0x9a99('0xd6')]=qs['filters'](_[_0x9a99('0xd7')](_0x5d7cc3[_0x9a99('0x52')],_0x43cdeb[_0x9a99('0x5c')]));if(_0x5d7cc3[_0x9a99('0x52')]['filter']){_0x1a5353[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x1a5353[_0x9a99('0xd6')],{'$or':_['map'](_0x1a5353[_0x9a99('0x4d')],function(_0x465082){var _0x381630={};_0x381630[_0x465082]={'$like':'%'+_0x5d7cc3[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x381630;})});}_0x1a5353=_['merge']({},_0x1a5353,_0x5d7cc3[_0x9a99('0xd8')]);return _0x281f1b['getChatWebsites'](_0x1a5353);}})[_0x9a99('0x1a')](function(_0x5886d5){if(_0x5886d5){_0x43086a=_0x5886d5[_0x9a99('0x54')];if(!_0x5d7cc3[_0x9a99('0x52')]['hasOwnProperty'](_0x9a99('0xde'))){_0x1a5353[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x5d7cc3[_0x9a99('0x52')][_0x9a99('0x29')]);_0x1a5353[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x5d7cc3['query'][_0x9a99('0x28')]);}return _0x281f1b[_0x9a99('0x149')](_0x1a5353);}})[_0x9a99('0x1a')](function(_0x3a45db){if(_0x3a45db){return _0x3a45db?{'count':_0x43086a,'rows':_0x3a45db}:null;}})[_0x9a99('0x1a')](respondWithResult(_0x4560a4,null))[_0x9a99('0x23')](handleError(_0x4560a4,null));};exports['addChatWebsites']=function(_0x282b8b,_0x321336){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x282b8b['params']['id']}})['then'](handleEntityNotFound(_0x321336,null))[_0x9a99('0x1a')](function(_0x4c0fd4){if(_0x4c0fd4){return _0x4c0fd4[_0x9a99('0x14b')](_0x282b8b['body'][_0x9a99('0x6a')],_[_0x9a99('0x125')](_0x282b8b['body'],[_0x9a99('0x6a'),'id'])||{});}})[_0x9a99('0x1a')](respondWithResult(_0x321336,null))['catch'](handleError(_0x321336,null));};exports[_0x9a99('0x14c')]=function(_0x257f3e,_0x4d5e99){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x257f3e[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x4d5e99,null))[_0x9a99('0x1a')](function(_0x51ea12){if(_0x51ea12){return _0x51ea12[_0x9a99('0x14c')](_0x257f3e[_0x9a99('0x52')][_0x9a99('0x6a')]);}})[_0x9a99('0x1a')](respondWithStatusCode(_0x4d5e99,null))[_0x9a99('0x23')](handleError(_0x4d5e99,null));};exports[_0x9a99('0x14d')]=function(_0x2e5ff5,_0x6475ab){var _0x9ee7f4={};var _0x10a7e0={};var _0x568f94;var _0x388e22;return db[_0x9a99('0x4f')][_0x9a99('0x9e')]({'where':{'id':_0x2e5ff5[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x6475ab,null))['then'](function(_0x3cc542){if(_0x3cc542){_0x568f94=_0x3cc542;_0x10a7e0[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](db[_0x9a99('0x14e')]['rawAttributes']);_0x10a7e0[_0x9a99('0x52')]=_[_0x9a99('0x5a')](_0x2e5ff5[_0x9a99('0x52')]);_0x10a7e0[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x10a7e0['model'],_0x10a7e0[_0x9a99('0x52')]);_0x9ee7f4[_0x9a99('0x4d')]=_[_0x9a99('0x5d')](_0x10a7e0[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x2e5ff5[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x9ee7f4['attributes']=_0x9ee7f4[_0x9a99('0x4d')]['length']?_0x9ee7f4[_0x9a99('0x4d')]:_0x10a7e0[_0x9a99('0x5e')];_0x9ee7f4[_0x9a99('0xd4')]=qs[_0x9a99('0xd5')](_0x2e5ff5[_0x9a99('0x52')]['sort']);_0x9ee7f4[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x2e5ff5[_0x9a99('0x52')],_0x10a7e0[_0x9a99('0x5c')]));if(_0x2e5ff5['query'][_0x9a99('0x45')]){_0x9ee7f4[_0x9a99('0xd6')]=_[_0x9a99('0x60')](_0x9ee7f4[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x9ee7f4[_0x9a99('0x4d')],function(_0x43303d){var _0x5dd142={};_0x5dd142[_0x43303d]={'$like':'%'+_0x2e5ff5[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x5dd142;})});}_0x9ee7f4=_[_0x9a99('0x60')]({},_0x9ee7f4,_0x2e5ff5[_0x9a99('0xd8')]);return _0x568f94[_0x9a99('0x14d')](_0x9ee7f4);}})[_0x9a99('0x1a')](function(_0x18ffde){if(_0x18ffde){_0x388e22=_0x18ffde[_0x9a99('0x54')];if(!_0x2e5ff5['query'][_0x9a99('0xd9')](_0x9a99('0xde'))){_0x9ee7f4[_0x9a99('0x29')]=qs[_0x9a99('0x29')](_0x2e5ff5[_0x9a99('0x52')][_0x9a99('0x29')]);_0x9ee7f4['offset']=qs[_0x9a99('0x28')](_0x2e5ff5[_0x9a99('0x52')][_0x9a99('0x28')]);}return _0x568f94[_0x9a99('0x14d')](_0x9ee7f4);}})[_0x9a99('0x1a')](function(_0x4d66ce){if(_0x4d66ce){return _0x4d66ce?{'count':_0x388e22,'rows':_0x4d66ce}:null;}})['then'](respondWithResult(_0x6475ab,null))[_0x9a99('0x23')](handleError(_0x6475ab,null));};exports[_0x9a99('0x14f')]=function(_0x1afb67,_0x3fd7f5){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x1afb67['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3fd7f5,null))['then'](function(_0x47748a){if(_0x47748a){return _0x47748a['addWhatsappAccounts'](_0x1afb67['body'][_0x9a99('0x6a')],_['omit'](_0x1afb67[_0x9a99('0x66')],[_0x9a99('0x6a'),'id'])||{});}})[_0x9a99('0x1a')](respondWithResult(_0x3fd7f5,null))[_0x9a99('0x23')](handleError(_0x3fd7f5,null));};exports[_0x9a99('0x150')]=function(_0x2ee70e,_0x3891c3){return db[_0x9a99('0x4f')][_0x9a99('0x3d')]({'where':{'id':_0x2ee70e['params']['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x3891c3,null))[_0x9a99('0x1a')](function(_0x251263){if(_0x251263){return _0x251263[_0x9a99('0x150')](_0x2ee70e['query']['ids']);}})[_0x9a99('0x1a')](respondWithStatusCode(_0x3891c3,null))[_0x9a99('0x23')](handleError(_0x3891c3,null));};exports[_0x9a99('0x151')]=function(_0x2a7cc9,_0x54a929){var _0x5f24a4={},_0x3c09ed={},_0x50e319={'count':0x0,'rows':[]};var _0x3295e8=db[_0x9a99('0x152')][_0x9a99('0x5b')];_0x3c09ed[_0x9a99('0x5e')]=_[_0x9a99('0x5a')](_0x3295e8);_0x3c09ed['query']=_['keys'](_0x2a7cc9[_0x9a99('0x52')]);_0x3c09ed[_0x9a99('0x5c')]=_[_0x9a99('0x5d')](_0x3c09ed[_0x9a99('0x5e')],_0x3c09ed[_0x9a99('0x52')]);_0x3c09ed['filters']=_[_0x9a99('0xd2')](_0x3c09ed[_0x9a99('0x5c')],[_0x9a99('0x153'),_0x9a99('0x154'),_0x9a99('0x155'),_0x9a99('0x156'),'$lt',_0x9a99('0x157'),_0x9a99('0x158'),_0x9a99('0x159'),_0x9a99('0x15a'),_0x9a99('0x15b'),_0x9a99('0x15c'),_0x9a99('0x15d'),_0x9a99('0x15e'),_0x9a99('0x15f'),'$notLike',_0x9a99('0x160'),_0x9a99('0x161'),_0x9a99('0x15f'),_0x9a99('0x162'),'$contains','$contained',_0x9a99('0x163')]);_0x5f24a4[_0x9a99('0x4d')]=_['intersection'](_0x3c09ed[_0x9a99('0x5e')],qs[_0x9a99('0x5f')](_0x2a7cc9[_0x9a99('0x52')][_0x9a99('0x5f')]));_0x5f24a4['attributes']=_0x5f24a4[_0x9a99('0x4d')][_0x9a99('0x54')]?_0x5f24a4[_0x9a99('0x4d')]:_0x3c09ed[_0x9a99('0x5e')];if(!_0x2a7cc9['query'][_0x9a99('0xd9')]('nolimit')){_0x5f24a4[_0x9a99('0x29')]=qs['limit'](_0x2a7cc9[_0x9a99('0x52')][_0x9a99('0x29')]);_0x5f24a4[_0x9a99('0x28')]=qs[_0x9a99('0x28')](_0x2a7cc9[_0x9a99('0x52')]['offset']);}_0x5f24a4['order']=qs[_0x9a99('0xd5')](_0x2a7cc9[_0x9a99('0x52')]['sort']);_0x5f24a4[_0x9a99('0xd6')]=qs[_0x9a99('0x5c')](_[_0x9a99('0xd7')](_0x2a7cc9['query'],_0x3c09ed[_0x9a99('0x5c')]));if(_0x2a7cc9['query']['filter']){_0x5f24a4['where']=_[_0x9a99('0x60')](_0x5f24a4[_0x9a99('0xd6')],{'$or':_[_0x9a99('0x3b')](_0x5f24a4[_0x9a99('0x4d')],function(_0x16c21d){var _0x4a71f1={};_0x4a71f1[_0x16c21d]={'$like':'%'+_0x2a7cc9[_0x9a99('0x52')][_0x9a99('0x45')]+'%'};return _0x4a71f1;})});}_0x5f24a4[_0x9a99('0xd6')]={'$and':[_0x5f24a4[_0x9a99('0xd6')],{'$or':[{'UserId':_0x2a7cc9[_0x9a99('0x67')]['id']},{'OwnerId':_0x2a7cc9[_0x9a99('0x67')]['id']}]}]};_0x5f24a4=_[_0x9a99('0x60')]({},_0x5f24a4,_0x2a7cc9[_0x9a99('0xd8')]);var _0xd98ed1={'where':_0x5f24a4[_0x9a99('0xd6')]};return db[_0x9a99('0x152')][_0x9a99('0x2a')](_0xd98ed1)['then'](function(_0x2e0589){_0x50e319[_0x9a99('0x2a')]=_0x2e0589;if(_0x2a7cc9[_0x9a99('0x52')]['includeAll']){_0x5f24a4[_0x9a99('0x4a')]=[{'attributes':['id',_0x9a99('0x164'),_0x9a99('0x165'),_0x9a99('0xf5')],'model':db[_0x9a99('0x166')],'as':_0x9a99('0x167')},{'attributes':['id',_0x9a99('0x3e'),_0x9a99('0x168')],'model':db[_0x9a99('0xb1')],'as':_0x9a99('0xe0')}];}return db['CmHopper'][_0x9a99('0x50')](_0x5f24a4);})[_0x9a99('0x1a')](function(_0x330b6f){_0x50e319['rows']=_0x330b6f;return _0x50e319;})[_0x9a99('0x1a')](respondWithFilteredResult(_0x54a929,_0x5f24a4))['catch'](handleError(_0x54a929,null));};exports[_0x9a99('0x169')]=function(_0x4973ef,_0x3db7e4){if(!_[_0x9a99('0x6e')](_0x4973ef[_0x9a99('0x36')]['id'])&&(_0x4973ef[_0x9a99('0x36')][_0x9a99('0x2e')]==_0x9a99('0x34')||_0x4973ef[_0x9a99('0x36')]['role']==_0x9a99('0x36'))){return db[_0x9a99('0x4f')]['findOne']({'where':{'id':_0x4973ef[_0x9a99('0x67')]['id']},'raw':!![]})[_0x9a99('0x1a')](function(_0x5f1007){return authService[_0x9a99('0x16a')](_0x5f1007);})[_0x9a99('0x1a')](function(_0x2bbe10){if(_0x2bbe10){return _0x3db7e4['status'](0xc8)['json']({'api_key':_0x2bbe10[_0x9a99('0x16b')]});}else{return _0x3db7e4[_0x9a99('0x25')](0xcc)[_0x9a99('0x27')]({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x3db7e4,0x193));}else{return _0x3db7e4[_0x9a99('0x25')](0x191)[_0x9a99('0x27')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x9a99('0x16c')]=function(_0x2e4dc0,_0x315276){if(!_['isNil'](_0x2e4dc0[_0x9a99('0x36')]['id'])&&(_0x2e4dc0[_0x9a99('0x36')]['role']==_0x9a99('0x34')||_0x2e4dc0[_0x9a99('0x36')][_0x9a99('0x2e')]==_0x9a99('0x36'))){return db['User'][_0x9a99('0x3d')]({'where':{'id':_0x2e4dc0[_0x9a99('0x67')]['id']}})['then'](function(_0x51f51d){return authService[_0x9a99('0x16d')](_0x51f51d);})[_0x9a99('0x1a')](function(_0x2cdda6){return db['User'][_0x9a99('0x2d')]({'apiKeyIat':_0x2cdda6[_0x9a99('0x16e')],'apiKeyNonce':_0x2cdda6[_0x9a99('0x16f')]},{'where':{'id':_0x2e4dc0[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](function(){return _0x315276[_0x9a99('0x25')](0xc8)['json']({'api_key':_0x2cdda6[_0x9a99('0x16b')]});});})[_0x9a99('0x23')](handleError(_0x315276,0x193));}else{return _0x315276['status'](0x191)[_0x9a99('0x27')]({'message':_0x9a99('0x170')});}};exports[_0x9a99('0x171')]=function(_0xd21dbd,_0x5dc9a1){if(!_[_0x9a99('0x6e')](_0xd21dbd[_0x9a99('0x36')]['id'])&&(_0xd21dbd[_0x9a99('0x36')][_0x9a99('0x2e')]=='admin'||_0xd21dbd[_0x9a99('0x36')][_0x9a99('0x2e')]==_0x9a99('0x36'))){return db[_0x9a99('0x4f')]['find']({'where':{'id':_0xd21dbd[_0x9a99('0x67')]['id']}})[_0x9a99('0x1a')](handleEntityNotFound(_0x5dc9a1,null))[_0x9a99('0x1a')](function(_0x1f5255){if(_0x1f5255&&_0x1f5255[_0x9a99('0x172')]&&_0x1f5255[_0x9a99('0x173')])return _0x1f5255;else throw{'message':_0x9a99('0x174')};})[_0x9a99('0x1a')](function(){return db['User'][_0x9a99('0x2d')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0xd21dbd[_0x9a99('0x67')]['id']}});})[_0x9a99('0x1a')](respondWithStatusCode(_0x5dc9a1,0xc8))[_0x9a99('0x23')](handleError(_0x5dc9a1,0x193));}else{return _0x5dc9a1[_0x9a99('0x25')](0x191)[_0x9a99('0x27')]({'message':_0x9a99('0x170')});}};exports[_0x9a99('0x175')]=function(_0x3fe1e9,_0x5a8c27){var _0x1207a6=_0x3fe1e9['user'][_0x9a99('0x33')]({'plain':!![]});if(!_0x1207a6){return _0x5a8c27[_0x9a99('0x25')](0x191)[_0x9a99('0x40')](_0x9a99('0x176'));}else{Promise[_0x9a99('0x116')]()[_0x9a99('0x1a')](function(){if(_0x3fe1e9[_0x9a99('0x52')][_0x9a99('0x4c')]!==_0x9a99('0x53'))return;return _0x3fe1e9[_0x9a99('0x36')]['getUserSetting']();})[_0x9a99('0x1a')](function(_0x200a83){if(!_0x200a83)return;return _0x200a83[_0x9a99('0x33')]({'plain':!![]});})[_0x9a99('0x1a')](function(_0x509074){_0x1207a6['userSetting']=_0x509074;return _0x5a8c27[_0x9a99('0x25')](0xc8)['json'](_0x1207a6);});}};exports[_0x9a99('0x177')]=function(_0x39c4de,_0x5c0ed8){var _0x1edcca={'offset':0x0},_0x5e0984={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(!_0x39c4de[_0x9a99('0x52')][_0x9a99('0x45')]&&!_0x39c4de[_0x9a99('0x52')]['teams']&&!_0x39c4de[_0x9a99('0x52')][_0x9a99('0x178')])return[];return Promise[_0x9a99('0x116')]()[_0x9a99('0x1a')](function(){var _0x4377b9=[];if(!_[_0x9a99('0x92')](_0x39c4de[_0x9a99('0x52')][_0x9a99('0x179')])){_0x4377b9[_0x9a99('0x4e')](db[_0x9a99('0x114')][_0x9a99('0x50')]({'attributes':['id','name'],'where':{'id':_0x39c4de['query'][_0x9a99('0x179')]}}));}if(!_['isEmpty'](_0x39c4de[_0x9a99('0x52')][_0x9a99('0x178')])){_0x4377b9['push'](db[_0x9a99('0xb1')]['findAll']({'attributes':['id',_0x9a99('0x3e')],'type':_0x9a99('0x17a'),'where':{'id':_0x39c4de[_0x9a99('0x52')][_0x9a99('0x178')]}}));}return Promise[_0x9a99('0x58')](_0x4377b9);})[_0x9a99('0x1a')](function(_0x42dea3){var _0x313b27=_[_0x9a99('0x17b')](_0x42dea3)[_0x9a99('0x3b')](function(_0x27ff51){return _0x27ff51[_0x9a99('0x17c')]({'attributes':['id',_0x9a99('0x3e'),_0x9a99('0x6b'),_0x9a99('0xb2')],'raw':!![]});});return Promise[_0x9a99('0x58')](_0x313b27);})[_0x9a99('0x1a')](function(_0x1e82ec){var _0xa52988=_['flatten'](_0x1e82ec);if(!_0x39c4de[_0x9a99('0x52')][_0x9a99('0x45')])return _0xa52988;if(_[_0x9a99('0x92')](_0xa52988)){return db[_0x9a99('0x4f')][_0x9a99('0x50')]({'attributes':['id','name','internal','online'],'where':{'role':'agent','$or':[db[_0x9a99('0x70')][_0x9a99('0xd6')](db['sequelize']['fn'](_0x9a99('0x17d'),db[_0x9a99('0x70')]['col'](_0x9a99('0x3e'))),{'$like':'%'+_0x39c4de[_0x9a99('0x52')][_0x9a99('0x45')][_0x9a99('0xaa')]()+'%'}),{'internal':{'$like':'%'+_0x39c4de[_0x9a99('0x52')][_0x9a99('0x45')]+'%'}}]},'raw':!![]});}else{return _(_0xa52988)[_0x9a99('0x17b')]()[_0x9a99('0x45')](function(_0x3ec12d){return _0x3ec12d['name']['toLowerCase']()[_0x9a99('0x46')](_0x39c4de['query']['filter'][_0x9a99('0xaa')]())||_0x3ec12d[_0x9a99('0x6b')][_0x9a99('0x17e')]()['includes'](_0x39c4de['query'][_0x9a99('0x45')]);})['value']();}})['then'](function(_0x47f0ca){var _0x44f2bb=_0x9a99('0x3e');var _0x5a81b1=_0x9a99('0x17f');if(_0x39c4de[_0x9a99('0x52')][_0x9a99('0xd5')]){_0x5a81b1=_0x39c4de[_0x9a99('0x52')][_0x9a99('0xd5')][0x0]==='-'?_0x9a99('0x180'):'asc';_0x44f2bb=_0x5a81b1===_0x9a99('0x17f')?_0x39c4de['query'][_0x9a99('0xd5')]:_0x39c4de['query'][_0x9a99('0xd5')][_0x9a99('0x181')](0x1);}return _(_0x47f0ca)['uniqBy']('id')[_0x9a99('0x182')]([function(_0x3c9d34){return _0x44f2bb==='name'?_0x3c9d34[_0x44f2bb][_0x9a99('0xaa')]():_0x3c9d34[_0x44f2bb];}],[_0x5a81b1])[_0x9a99('0x3b')](function(_0x5b487c){return _[_0x9a99('0xd7')](_0x5b487c,['id',_0x9a99('0x3e'),_0x9a99('0x6b'),_0x9a99('0xb2')]);})[_0x9a99('0x3c')]();})['then'](function(_0x2a864e){return amiClient[_0x9a99('0x19')](_0x9a99('0x37'),_0x39c4de)[_0x9a99('0x1a')](function(_0x58df41){if(_0x58df41[_0x9a99('0x1f')])throw new Error(_0x9a99('0x183'));var _0x2b4932=_0x58df41['result'];var _0x1f2a19=jayson[_0x9a99('0x17')][_0x9a99('0x18')]({'port':0x232c});return _0x1f2a19[_0x9a99('0x19')](_0x9a99('0x37'),_0x39c4de)['then'](function(_0x37ff08){if(_0x37ff08[_0x9a99('0x1f')])throw new Error(_0x9a99('0x184'));var _0x208fbb=_0x37ff08[_0x9a99('0x22')];return _[_0x9a99('0x60')]({},_0x208fbb,_0x2b4932);});})[_0x9a99('0x1a')](function(_0x1caa8e){return _['map'](_0x2a864e,function(_0x48bbbe){var _0x181523=_[_0x9a99('0x3d')](_0x1caa8e[_0x9a99('0x51')],['id',_0x48bbbe['id']]);if(!_0x181523||!_0x48bbbe[_0x9a99('0xb2')]){_0x48bbbe[_0x9a99('0x25')]=_0x9a99('0x185');}else if(_0x181523['voicePause']){_0x48bbbe[_0x9a99('0x25')]=_0x9a99('0x108');}else{_0x48bbbe[_0x9a99('0x25')]=_[_0x9a99('0x46')]([_0x9a99('0x186'),_0x9a99('0x187'),_0x9a99('0x188'),'ringing',null,undefined],_0x181523[_0x9a99('0x189')])?'online':_0x9a99('0x18a');}return _0x48bbbe;});});});})[_0x9a99('0x1a')](function(_0xb1a00e){if(!_0x39c4de['query']['hasOwnProperty'](_0x9a99('0xde'))){_0x1edcca[_0x9a99('0x29')]=qs['limit'](_0x39c4de[_0x9a99('0x52')][_0x9a99('0x29')]||0xa);_0x1edcca['offset']=qs[_0x9a99('0x28')](_0x39c4de[_0x9a99('0x52')][_0x9a99('0x28')]);}_0x5e0984[_0x9a99('0x2a')]=_0xb1a00e[_0x9a99('0x54')];_0x5e0984[_0x9a99('0x51')]=_0x1edcca[_0x9a99('0x29')]?_0xb1a00e['slice'](_0x1edcca[_0x9a99('0x28')],_0x1edcca[_0x9a99('0x28')]+_0x1edcca['limit']):_0xb1a00e;return _0x5e0984;})[_0x9a99('0x1a')](respondWithFilteredResult(_0x5c0ed8,_0x1edcca))[_0x9a99('0x23')](handleError(_0x5c0ed8,null));};function get_open_tabs(_0x435519,_0x4bbc0a){var _0x159892=_0x435519[_0x9a99('0x18b')](0x0)[_0x9a99('0x18c')]()+_0x435519[_0x9a99('0x18d')](0x1);var _0x5445ef={'type':db['Sequelize'][_0x9a99('0x18e')][_0x9a99('0x18f')],'raw':!![]};return new Promise(function(_0x26dd78,_0x30bc93){var _0x1c9ea6=squel['select']()[_0x9a99('0x190')](_0x9a99('0x191')+_0x159892+_0x9a99('0x192'),'id')[_0x9a99('0x190')](_0x9a99('0x193'))[_0x9a99('0x71')](_0x9a99('0x194')+_0x435519+_0x9a99('0x195'),'ui')[_0x9a99('0xd6')](_0x9a99('0x196'),_0x4bbc0a['id']);return db[_0x9a99('0x70')][_0x9a99('0x52')](_0x1c9ea6['toString'](),_0x5445ef)[_0x9a99('0x1a')](function(_0x3a9138){_0x4bbc0a[_0x159892+_0x9a99('0x197')]=_0x3a9138;_0x26dd78(_0x3a9138);})[_0x9a99('0x23')](function(_0xa62010){_0x30bc93(_0xa62010);});});}
\ No newline at end of file
+var _0x92ab=['interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','emit','Queue:save','VoiceQueue','voice','SIP/%s','penalty','upsert','removeQueues','channel','remove','isArray','Queue:remove','UserVoiceQueueRt','addAvatar','file','filename','getAvatar','server/files/images/logos/default_profile.png','userpic','existsSync','root','server/files/images/','download','ChatOpenTabs','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','findOne','CmContact','order','sort','pick','options','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','Queue','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','UserId','VoiceRecording','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','format','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','bulkCreate','LOGININPAUSE','isMiddleware','resolve','logout','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','flattenDeep','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','Voice','getLists','getAgents','getVoiceQueues','values','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$gt','$gte','$lt','$ne','$eq','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','queues','teams','inbound','flatten','lower','col','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','busy','slice','select','field','InteractionId','ui.createdAt','user_has_','_interactions','moment','util','path','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','localhost','client','http','info','User,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','role','destroy','get','admin','Users','user','Agents','agent','Telephones','telephone','filter','ignore','map','find','value','name','UserProfileResource','stack','send','index','User','type','key','includes','password','where','query','includeAll','UserSetting','userSetting','push','findAll','rows','openTabs','true','length','chat','dataValues','fax','mail','openchannel','all','show','params','model','differenceBy','keys','rawAttributes','filters','intersection','attributes','fields','include','merge','sms','whatsapp','update','body','describe','addContacts','ids','omit','internal','Setting','securePassword','validatePasswordPattern','max','min_internal','sequelize','QueryTypes','SELECT','from','isNil','voicemail','VoiceMail','fullname','email','permissions','101','103','113','110','104','105','107','108','109','100','111','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','isEmpty','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause'];(function(_0x405fcf,_0x755feb){var _0x25cf68=function(_0x5257bd){while(--_0x5257bd){_0x405fcf['push'](_0x405fcf['shift']());}};_0x25cf68(++_0x755feb);}(_0x92ab,0xed));var _0xb92a=function(_0x4896ad,_0x4a0648){_0x4896ad=_0x4896ad-0x0;var _0x2295d8=_0x92ab[_0x4896ad];return _0x2295d8;};'use strict';var moment=require(_0xb92a('0x0'));var util=require(_0xb92a('0x1'));var path=require(_0xb92a('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb92a('0x3'));var jayson=require('jayson/promise');var Redis=require(_0xb92a('0x4'));var authService=require(_0xb92a('0x5'));var qs=require(_0xb92a('0x6'));var logger=require(_0xb92a('0x7'))(_0xb92a('0x8'));var utils=require(_0xb92a('0x9'));var config=require('../../config/environment');var licenseUtil=require(_0xb92a('0xa'));var APIBadRequestError=require(_0xb92a('0xb'))[_0xb92a('0xc')];var APINotFoundError=require(_0xb92a('0xb'))[_0xb92a('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require(_0xb92a('0xe'))['db'];var socket=require(_0xb92a('0xf'))(new Redis(config['redis']));require('./user.socket')['register'](socket);config[_0xb92a('0x10')]=_['defaults'](config[_0xb92a('0x10')],{'host':_0xb92a('0x11'),'port':0x18eb});var amiClient=jayson[_0xb92a('0x12')][_0xb92a('0x13')]({'port':0x232a});var values;function respondWithRpcPromise(_0x46e392,_0x3dcbe1,_0x50c785,_0x2105f9){return new Promise(function(_0x5404df,_0x140927){var _0x6b5f47=_0x2105f9||amiClient;return _0x6b5f47['request'](_0x46e392,_0x50c785)['then'](function(_0x15c295){logger[_0xb92a('0x14')](_0xb92a('0x15'),_0x3dcbe1,'request\x20sent');logger[_0xb92a('0x16')]('User,\x20%s,\x20%s,\x20%s',_0x3dcbe1,'request\x20sent',JSON[_0xb92a('0x17')](_0x15c295));if(_0x15c295[_0xb92a('0x18')]){if(_0x15c295[_0xb92a('0x18')]['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x3dcbe1,_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);return _0x140927(_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);}logger[_0xb92a('0x18')](_0xb92a('0x15'),_0x3dcbe1,_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);return _0x5404df(_0x15c295[_0xb92a('0x18')][_0xb92a('0x19')]);}else{logger['info'](_0xb92a('0x15'),_0x3dcbe1,_0xb92a('0x1a'));_0x5404df(_0x15c295[_0xb92a('0x1b')][_0xb92a('0x19')]);}})[_0xb92a('0x1c')](function(_0x5847a2){logger[_0xb92a('0x18')](_0xb92a('0x15'),_0x3dcbe1,_0x5847a2);_0x140927(_0x5847a2);});});}function respondWithStatusCode(_0x43edb5,_0xce27fd){_0xce27fd=_0xce27fd||0xcc;return function(_0x26d6b1){if(_0x26d6b1){return _0x43edb5[_0xb92a('0x1d')](_0xce27fd);}return _0x43edb5[_0xb92a('0x1e')](_0xce27fd)[_0xb92a('0x1f')]();};}function respondWithResult(_0x290723,_0x37af0b){_0x37af0b=_0x37af0b||0xc8;return function(_0x1432c1){if(_0x1432c1){return _0x290723[_0xb92a('0x1e')](_0x37af0b)[_0xb92a('0x20')](_0x1432c1);}};}function respondWithFilteredResult(_0x374db9,_0x35c9a6){return function(_0x4e0c50){if(_0x4e0c50){var _0x375a51=typeof _0x35c9a6[_0xb92a('0x21')]===_0xb92a('0x22')&&typeof _0x35c9a6[_0xb92a('0x23')]===_0xb92a('0x22');var _0x4906e5=_0x4e0c50[_0xb92a('0x24')];var _0x206860=_0x375a51?0x0:_0x35c9a6[_0xb92a('0x21')];var _0x4eb963=_0x375a51?_0x4e0c50['count']:_0x35c9a6[_0xb92a('0x21')]+_0x35c9a6[_0xb92a('0x23')];var _0x1acc6b;if(_0x4eb963>=_0x4906e5){_0x4eb963=_0x4906e5;_0x1acc6b=0xc8;}else{_0x1acc6b=0xce;}_0x374db9[_0xb92a('0x1e')](_0x1acc6b);return _0x374db9[_0xb92a('0x25')](_0xb92a('0x26'),_0x206860+'-'+_0x4eb963+'/'+_0x4906e5)[_0xb92a('0x20')](_0x4e0c50);}return null;};}function saveUpdates(_0x5ac69c){return function(_0x763c7c){if(_0x763c7c){return _0x763c7c['update'](_0x5ac69c)[_0xb92a('0x27')](function(_0x2e7e03){if(_0x2e7e03[_0xb92a('0x28')]==='agent'){socket['emit']('userNotification:recalc:'+_0x2e7e03['id'],_0x2e7e03);}return _0x2e7e03;});}return null;};}function removeEntity(_0x4f4393){return function(_0x493cf5){if(_0x493cf5){return _0x493cf5[_0xb92a('0x29')]()[_0xb92a('0x27')](function(){var _0x426446=_0x493cf5[_0xb92a('0x2a')]({'plain':!![]});if(_0x426446[_0xb92a('0x28')]===_0xb92a('0x2b'))return;var _0x28123f=[{'name':_0xb92a('0x2c'),'value':_0xb92a('0x2d'),'ignore':!![]},{'name':_0xb92a('0x2e'),'value':_0xb92a('0x2f'),'ignore':![]},{'name':_0xb92a('0x30'),'value':_0xb92a('0x31'),'ignore':![]}];var _0x5cb2a8=_(_0x28123f)[_0xb92a('0x32')](_0xb92a('0x33'))[_0xb92a('0x34')]('value')['value']();if(_['includes'](_0x5cb2a8,_0x426446[_0xb92a('0x28')])){return;}var _0x3ad65c=_[_0xb92a('0x35')](_0x28123f,[_0xb92a('0x36'),_0x426446[_0xb92a('0x28')]])[_0xb92a('0x37')];return db[_0xb92a('0x38')]['destroy']({'where':{'type':_0x3ad65c,'resourceId':_0x426446['id']}})[_0xb92a('0x27')](function(){return _0x493cf5;});})[_0xb92a('0x27')](function(){_0x4f4393[_0xb92a('0x1e')](0xcc)[_0xb92a('0x1f')]();});}};}function handleEntityNotFound(_0xb0321a){return function(_0x5cdaae){if(!_0x5cdaae){_0xb0321a[_0xb92a('0x1d')](0x194);}return _0x5cdaae;};}function handleError(_0x3428d2,_0x1b17f4){_0x1b17f4=_0x1b17f4||0x1f4;return function(_0x418aff){logger[_0xb92a('0x18')](_0x418aff[_0xb92a('0x39')]);if(_0x418aff[_0xb92a('0x37')]){delete _0x418aff[_0xb92a('0x37')];}_0x3428d2[_0xb92a('0x1e')](_0x1b17f4)[_0xb92a('0x3a')](_0x418aff);};}exports[_0xb92a('0x3b')]=function(_0x1a6d89,_0x8b3671){var _0x3d3015={},_0x339696={'count':0x0,'rows':[]};var _0x5c8d58=_(db[_0xb92a('0x3c')]['rawAttributes'])[_0xb92a('0x34')](function(_0x178558){return{'name':_0x178558['fieldName'],'type':_0x178558[_0xb92a('0x3d')][_0xb92a('0x3e')]};})[_0xb92a('0x32')](function(_0x2c5d55){return!_[_0xb92a('0x3f')]([_0xb92a('0x40'),'salt'],_0x2c5d55[_0xb92a('0x37')]);})[_0xb92a('0x36')]();_0x3d3015=qs['getOptions'](_0x5c8d58,_0x1a6d89);var _0x92eed6={'where':_0x3d3015[_0xb92a('0x41')]};return db[_0xb92a('0x3c')]['count'](_0x92eed6)[_0xb92a('0x27')](function(_0x570a6a){_0x339696[_0xb92a('0x24')]=_0x570a6a;if(_0x1a6d89[_0xb92a('0x42')][_0xb92a('0x43')]){_0x3d3015['include']=[{'all':!![]}];}if(_0x1a6d89[_0xb92a('0x42')]['userSetting']==='true'){_0x3d3015['include']=[{'model':db[_0xb92a('0x44')],'as':_0xb92a('0x45')}];}if(!_[_0xb92a('0x3f')](_0x3d3015['attributes'],'id')){_0x3d3015['attributes'][_0xb92a('0x46')]('id');}return db['User'][_0xb92a('0x47')](_0x3d3015);})[_0xb92a('0x27')](function(_0x346350){_0x339696[_0xb92a('0x48')]=_0x346350;if(_0x1a6d89[_0xb92a('0x42')][_0xb92a('0x49')]===_0xb92a('0x4a')){var _0x22a6d8=[];for(var _0x4e65=0x0;_0x4e65<_0x339696[_0xb92a('0x48')][_0xb92a('0x4b')];_0x4e65++){_0x22a6d8[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x4c'),_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs('sms',_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x4e'),_0x339696['rows'][_0x4e65]['dataValues']));_0x22a6d8['push'](get_open_tabs(_0xb92a('0x4f'),_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x50'),_0x339696['rows'][_0x4e65][_0xb92a('0x4d')]));_0x22a6d8[_0xb92a('0x46')](get_open_tabs('whatsapp',_0x339696[_0xb92a('0x48')][_0x4e65][_0xb92a('0x4d')]));}return Promise[_0xb92a('0x51')](_0x22a6d8)[_0xb92a('0x27')](function(){return _0x339696;});}else{return _0x339696;}})[_0xb92a('0x27')](respondWithFilteredResult(_0x8b3671,_0x3d3015))[_0xb92a('0x1c')](handleError(_0x8b3671,null));};exports[_0xb92a('0x52')]=function(_0x5c8489,_0x25f5a7){var _0x3b8128={'raw':![],'where':{'id':_0x5c8489[_0xb92a('0x53')]['id']}},_0x21be09={};_0x21be09[_0xb92a('0x54')]=_[_0xb92a('0x55')](_[_0xb92a('0x56')](db['User'][_0xb92a('0x57')]),[_0xb92a('0x40'),'salt']);_0x21be09[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x5c8489[_0xb92a('0x42')]);_0x21be09[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x21be09[_0xb92a('0x54')],_0x21be09[_0xb92a('0x42')]);_0x3b8128[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x21be09[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x5c8489[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x3b8128[_0xb92a('0x5a')]=_0x3b8128['attributes'][_0xb92a('0x4b')]?_0x3b8128[_0xb92a('0x5a')]:_0x21be09[_0xb92a('0x54')];if(_0x5c8489['query']['includeAll']){_0x3b8128['include']=[{'all':!![]}];}if(_0x5c8489[_0xb92a('0x42')][_0xb92a('0x45')]===_0xb92a('0x4a')){_0x3b8128[_0xb92a('0x5c')]=[{'model':db[_0xb92a('0x44')],'as':'userSetting'}];}_0x3b8128=_[_0xb92a('0x5d')]({},_0x3b8128,_0x5c8489['options']);if(!_[_0xb92a('0x3f')](_0x3b8128['attributes'],'id')){_0x3b8128[_0xb92a('0x5a')]['push']('id');}return db[_0xb92a('0x3c')][_0xb92a('0x35')](_0x3b8128)[_0xb92a('0x27')](handleEntityNotFound(_0x25f5a7,null))[_0xb92a('0x27')](function(_0x481587){var _0x3830db=[];values=_0x481587;if(_0x5c8489[_0xb92a('0x42')]['openTabs']==='true'){_0x3830db['push'](get_open_tabs(_0xb92a('0x4c'),_0x481587[_0xb92a('0x4d')]));_0x3830db[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5e'),_0x481587[_0xb92a('0x4d')]));_0x3830db['push'](get_open_tabs(_0xb92a('0x50'),_0x481587[_0xb92a('0x4d')]));_0x3830db[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5f'),_0x481587[_0xb92a('0x4d')]));_0x3830db['push'](get_open_tabs('fax',_0x481587[_0xb92a('0x4d')]));_0x3830db['push'](get_open_tabs(_0xb92a('0x4f'),_0x481587[_0xb92a('0x4d')]));return Promise[_0xb92a('0x51')](_0x3830db);}else{return values;}})[_0xb92a('0x27')](function(){return values;})[_0xb92a('0x27')](respondWithResult(_0x25f5a7,null))[_0xb92a('0x1c')](handleError(_0x25f5a7,null));};exports[_0xb92a('0x60')]=function(_0x5784f8,_0x4aee7b){if(_0x5784f8[_0xb92a('0x61')]['id']){delete _0x5784f8[_0xb92a('0x61')]['id'];}delete _0x5784f8[_0xb92a('0x61')][_0xb92a('0x28')];return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5784f8['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x4aee7b,null))['then'](saveUpdates(_0x5784f8[_0xb92a('0x61')],null))[_0xb92a('0x27')](respondWithResult(_0x4aee7b,null))[_0xb92a('0x1c')](handleError(_0x4aee7b,null));};exports['describe']=function(_0x537c07,_0x2b178f){return db[_0xb92a('0x3c')][_0xb92a('0x62')]()[_0xb92a('0x27')](respondWithResult(_0x2b178f,null))[_0xb92a('0x1c')](handleError(_0x2b178f,null));};exports['addContacts']=function(_0x441d0c,_0x14fffb){return db['User']['find']({'where':{'id':_0x441d0c[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x14fffb,null))['then'](function(_0x122d7b){if(_0x122d7b){return _0x122d7b[_0xb92a('0x63')](_0x441d0c[_0xb92a('0x61')][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x441d0c['body'],[_0xb92a('0x64'),'id'])||{});}})[_0xb92a('0x27')](respondWithResult(_0x14fffb,null))[_0xb92a('0x1c')](handleError(_0x14fffb,null));};function validateUser(_0x524254){return new Promise(function(_0x3f18d1,_0x101068){if(_0x524254[_0xb92a('0x66')])return _0x3f18d1(_0x524254);return db[_0xb92a('0x67')]['findById'](0x1)[_0xb92a('0x27')](function(_0x295281){if(_0x295281[_0xb92a('0x68')])authService[_0xb92a('0x69')](_0x524254['password']);db[_0xb92a('0x3c')][_0xb92a('0x6a')](_0xb92a('0x66'))[_0xb92a('0x27')](function(_0x5e65be){if(_['isNil'](_0x5e65be)){_0x524254[_0xb92a('0x66')]=_0x295281[_0xb92a('0x6b')]||0x1;return;}if(_['isNil'](_0x295281['min_internal'])||_0x295281[_0xb92a('0x6b')]===_0x5e65be){_0x524254[_0xb92a('0x66')]=_0x5e65be+0x1;return;}if(_0x295281[_0xb92a('0x6b')]>_0x5e65be){_0x524254[_0xb92a('0x66')]=_0x295281[_0xb92a('0x6b')];return;}return db[_0xb92a('0x6c')]['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xb92a('0x6c')][_0xb92a('0x6d')][_0xb92a('0x6e')]})[_0xb92a('0x27')](function(_0x4ff345){if(_0x4ff345&&_0x4ff345[_0xb92a('0x4b')]){for(var _0x157590=0x0,_0x32057d=_0x4ff345[_0xb92a('0x4b')];_0x157590<_0x32057d&&_['isNil'](_0x524254[_0xb92a('0x66')]);_0x157590++){if(_0x295281['min_internal']<=_0x4ff345[_0x157590][_0xb92a('0x6f')]){_0x524254[_0xb92a('0x66')]=_0x4ff345[_0x157590][_0xb92a('0x6f')];}else if(_0x295281[_0xb92a('0x6b')]>_0x4ff345[_0x157590][_0xb92a('0x6f')]&&_0x295281['min_internal']<=_0x4ff345[_0x157590]['to']){_0x524254[_0xb92a('0x66')]=_0x295281['min_internal'];}}}if(_[_0xb92a('0x70')](_0x524254[_0xb92a('0x66')])){_0x524254[_0xb92a('0x66')]=_0x5e65be+0x1;}return _0x3f18d1(_0x524254);});});})[_0xb92a('0x1c')](function(_0xbd9773){_0x101068(_0xbd9773);});});}function updateUser(_0x18845c){return new Promise(function(_0x354123,_0xb8a155){try{if(_0x18845c[_0xb92a('0x71')]){_0x18845c['mailbox']=_0x18845c[_0xb92a('0x66')];_0x18845c[_0xb92a('0x72')]={'mailbox':_0x18845c[_0xb92a('0x66')],'password':_0x18845c['password'],'fullname':_0x18845c[_0xb92a('0x73')],'email':_0x18845c[_0xb92a('0x74')]};}if(_0x18845c[_0xb92a('0x28')]===_0xb92a('0x2f')){if(!_0x18845c[_0xb92a('0x75')])_0x18845c['permissions']=[_0xb92a('0x76'),'102',_0xb92a('0x77'),_0xb92a('0x78'),_0xb92a('0x79'),_0xb92a('0x7a'),_0xb92a('0x7b'),'106',_0xb92a('0x7c'),_0xb92a('0x7d'),_0xb92a('0x7e'),_0xb92a('0x7f'),_0xb92a('0x80'),_0xb92a('0x81'),_0xb92a('0x82')];}_0x354123(_0x18845c);}catch(_0x5a972a){_0xb8a155(_0x5a972a);}});}exports[_0xb92a('0x83')]=function(_0x35febc,_0x15acc7){if(_0x35febc[_0xb92a('0x2d')][_0xb92a('0x28')]===_0xb92a('0x2f'))throw new Error(_0xb92a('0x84'));if(_0x35febc[_0xb92a('0x61')][_0xb92a('0x28')]===_0xb92a('0x2d')&&_0x35febc['user'][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error(_0xb92a('0x85'));}if(_0x35febc[_0xb92a('0x61')][_0xb92a('0x28')]===_0xb92a('0x2b')&&_0x35febc[_0xb92a('0x2d')][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error(_0xb92a('0x86'));}return licenseUtil['checkUserLimits']([_0x35febc['body']])[_0xb92a('0x27')](function(){return validateUser(_0x35febc[_0xb92a('0x61')]);})[_0xb92a('0x27')](function(_0x45ef85){return updateUser(_0x45ef85)[_0xb92a('0x27')](function(_0x1666b1){if(_0x1666b1[_0xb92a('0x28')]==='admin'){_0x1666b1[_0xb92a('0x87')]=_0x35febc[_0xb92a('0x2d')][_0xb92a('0x87')];delete _0x1666b1[_0xb92a('0x88')];}return _0x1666b1;});})[_0xb92a('0x27')](function(_0x55f478){return db[_0xb92a('0x3c')][_0xb92a('0x83')](_0x55f478,{'include':[{'model':db[_0xb92a('0x72')],'as':_0xb92a('0x72')}]});})['then'](function(_0x275dbd){if(_0x35febc[_0xb92a('0x61')][_0xb92a('0x28')]==='user')return _0x275dbd;if(_0x35febc['user'][_0xb92a('0x28')]!=='user')return _0x275dbd;return db[_0xb92a('0x89')][_0xb92a('0x35')]({'where':{'name':_0x275dbd[_0xb92a('0x28')]===_0xb92a('0x2f')?_0xb92a('0x2e'):_0xb92a('0x30'),'userProfileId':_0x35febc[_0xb92a('0x2d')][_0xb92a('0x88')]},'raw':!![]})[_0xb92a('0x27')](function(_0x428a57){if(!_0x428a57||_0x428a57[_0xb92a('0x8a')]!=0x0)return _0x275dbd;return db[_0xb92a('0x38')][_0xb92a('0x83')]({'name':_0x275dbd[_0xb92a('0x37')],'resourceId':_0x275dbd['id'],'type':_0x428a57[_0xb92a('0x37')],'sectionId':_0x428a57['id']},{})[_0xb92a('0x27')](function(){return _0x275dbd;});})[_0xb92a('0x1c')](function(_0x7d8314){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x7d8314);throw _0x7d8314;});})[_0xb92a('0x27')](respondWithResult(_0x15acc7,0xc9))[_0xb92a('0x1c')](handleError(_0x15acc7,null));};exports['bulkCreate']=function(_0x58902f,_0x1a2e57){var _0x558c45=_0x58902f[_0xb92a('0x61')];var _0x54a85d=[];if(_0x58902f[_0xb92a('0x2d')][_0xb92a('0x28')]===_0xb92a('0x2f'))throw new Error(_0xb92a('0x84'));if(_[_0xb92a('0x8b')](_0x558c45,[_0xb92a('0x28'),_0xb92a('0x2d')])&&_0x58902f[_0xb92a('0x2d')][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xb92a('0x8b')](_0x558c45,[_0xb92a('0x28'),_0xb92a('0x2b')])&&_0x58902f['user'][_0xb92a('0x28')]!==_0xb92a('0x2b')){throw new Error(_0xb92a('0x8c'));}return licenseUtil[_0xb92a('0x8d')](_0x558c45)['then'](function(){return validateUser(_0x558c45[0x0]);})[_0xb92a('0x27')](function(){for(var _0x1f1a88=0x1;_0x1f1a88<_0x558c45[_0xb92a('0x4b')];_0x1f1a88++){var _0x37330b=_0x558c45[_0x1f1a88-0x1]['internal'];if(!_0x558c45[_0x1f1a88][_0xb92a('0x66')])_0x558c45[_0x1f1a88][_0xb92a('0x66')]=_0x37330b+0x1;_0x54a85d['push'](validateUser(_0x558c45[_0x1f1a88]));}return Promise[_0xb92a('0x51')](_0x54a85d);})[_0xb92a('0x27')](function(){_0x54a85d=[];for(var _0x14bac2=0x0;_0x14bac2<_0x558c45['length'];_0x14bac2++){_0x54a85d[_0xb92a('0x46')](updateUser(_0x558c45[_0x14bac2]));}return Promise[_0xb92a('0x51')](_0x54a85d);})['then'](function(){_0x54a85d=_0x558c45[_0xb92a('0x34')](function(_0x2a8a3d){return db[_0xb92a('0x3c')]['create'](_0x2a8a3d,{'include':[{'model':db['VoiceMail'],'as':_0xb92a('0x72')}]})[_0xb92a('0x27')](function(_0x31f717){_0x2a8a3d['id']=_0x31f717['id'];return _0x2a8a3d;});});return Promise['all'](_0x54a85d);})[_0xb92a('0x27')](function(_0xf4bbd3){if(_0x58902f[_0xb92a('0x61')][_0xb92a('0x28')]===_0xb92a('0x2d'))return _0xf4bbd3;if(_0x58902f[_0xb92a('0x2d')]['role']!==_0xb92a('0x2d'))return _0xf4bbd3;var _0x3e0299=_['some'](_0xf4bbd3,function(_0x2908c2){return _0x2908c2[_0xb92a('0x28')]===_0xb92a('0x2f')||_0x2908c2[_0xb92a('0x28')]===_0xb92a('0x31');});if(!_0x3e0299)return _0xf4bbd3;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xb92a('0x2e'),_0xb92a('0x30')]},'userProfileId':_0x58902f[_0xb92a('0x2d')][_0xb92a('0x88')]},'raw':!![]})[_0xb92a('0x27')](function(_0x3042bc){if(_[_0xb92a('0x8e')](_0x3042bc)||!_[_0xb92a('0x8b')](_0x3042bc,[_0xb92a('0x8a'),0x0]))return _0xf4bbd3;_0x54a85d=[];var _0x5005a9=_(_0x3042bc)[_0xb92a('0x34')](function(_0xfd9085){if(_0xfd9085[_0xb92a('0x8a')]===0x1)return;return _0xfd9085['name']===_0xb92a('0x2e')?_0xb92a('0x2f'):_0xb92a('0x31');})[_0xb92a('0x8f')]()[_0xb92a('0x36')]();for(var _0x1fe381=0x0;_0x1fe381<_0xf4bbd3[_0xb92a('0x4b')];_0x1fe381++){if(!_[_0xb92a('0x3f')](_0x5005a9,_0xf4bbd3[_0x1fe381]['role']))return;var _0x3b2fdf=_0xf4bbd3[_0x1fe381]['role']===_0xb92a('0x2f')?_0xb92a('0x2e'):_0xb92a('0x30');_0x54a85d[_0xb92a('0x46')](db[_0xb92a('0x38')][_0xb92a('0x83')]({'name':_0xf4bbd3[_0x1fe381][_0xb92a('0x37')],'resourceId':_0xf4bbd3[_0x1fe381]['id'],'type':_0x3b2fdf,'sectionId':_['find'](_0x3042bc,['name',_0x3b2fdf])['id']},{}));}return Promise[_0xb92a('0x51')](_0x54a85d);});})[_0xb92a('0x27')](respondWithResult(_0x1a2e57,0xc9))['catch'](handleError(_0x1a2e57,null));};exports[_0xb92a('0x90')]=function(_0x479083,_0x554a03){if(_0x479083[_0xb92a('0x61')]['id']){delete _0x479083['body']['id'];}return db['User'][_0xb92a('0x35')]({'where':{'id':_0x479083[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](function(_0x38360c){if(!_0x38360c)return null;if(_0x38360c['id']===_0x479083['user']['id']){if(!_0x479083['body'][_0xb92a('0x91')]||!_0x479083['body']['newPassword']){throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0x94'));}if(!_0x38360c[_0xb92a('0x95')](_0x479083[_0xb92a('0x61')][_0xb92a('0x91')])){throw new db[(_0xb92a('0x92'))]['ValidationError']('Wrong\x20credentials');}if(_0x479083[_0xb92a('0x61')][_0xb92a('0x91')]===_0x479083[_0xb92a('0x61')]['newPassword']){throw new db['Sequelize'][(_0xb92a('0x93'))](_0xb92a('0x96'));}}else if(_0x479083[_0xb92a('0x2d')][_0xb92a('0x28')]===_0xb92a('0x2b')){if(!_0x479083[_0xb92a('0x61')][_0xb92a('0x97')]){throw new db[(_0xb92a('0x92'))]['ValidationError'](_0xb92a('0x98'));}}else if(_0x479083['user']['role']===_0xb92a('0x2d')){if(!_0x479083[_0xb92a('0x61')][_0xb92a('0x97')]){throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0x98'));}if(_0x38360c[_0xb92a('0x28')]!==_0xb92a('0x2f')){throw new db[(_0xb92a('0x92'))]['ValidationError'](_0xb92a('0x84'));}}else{throw new db['Sequelize'][(_0xb92a('0x93'))](_0xb92a('0x84'));}return _0x38360c;})[_0xb92a('0x27')](handleEntityNotFound(_0x554a03,null))[_0xb92a('0x27')](function(_0x4a203b){return db[_0xb92a('0x67')]['findOne']({'attributes':['id',_0xb92a('0x68'),_0xb92a('0x99'),_0xb92a('0x9a')]})[_0xb92a('0x27')](function(_0x3b4a7a){if(_0x3b4a7a['securePassword'])authService['validatePasswordPattern'](_0x479083[_0xb92a('0x61')][_0xb92a('0x97')]);if(!_0x3b4a7a[_0xb92a('0x99')]||!_0x4a203b['previousPasswords'])return _0x4a203b;authService[_0xb92a('0x9b')](_0x479083[_0xb92a('0x61')][_0xb92a('0x97')],_0x4a203b[_0xb92a('0x9c')],_0x3b4a7a[_0xb92a('0x9a')]);return _0x4a203b;})[_0xb92a('0x27')](saveUpdates({'password':_0x479083[_0xb92a('0x61')]['newPassword'],'passwordResetAt':_0x479083[_0xb92a('0x2d')]['id']==_0x479083[_0xb92a('0x53')]['id']?moment():null,'previousPasswords':authService[_0xb92a('0x9d')](_0x479083[_0xb92a('0x61')][_0xb92a('0x97')],_0x4a203b['previousPasswords'])},null));})['then'](respondWithResult(_0x554a03,null))[_0xb92a('0x1c')](handleError(_0x554a03,null));};exports[_0xb92a('0x9e')]=function(_0x35b2ec,_0x33705b){var _0x3d4cb6=_0x35b2ec[_0xb92a('0x61')]['channel'];return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x35b2ec[_0xb92a('0x53')]['id']},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28'),_0xb92a('0x9f'),_0xb92a('0xa0'),_0xb92a('0xa1'),_0xb92a('0xa2')]})[_0xb92a('0x27')](handleEntityNotFound(_0x33705b,null))['then'](function(_0x20fa2f){if(_0x20fa2f){if(!utils[_0xb92a('0xa3')](_0x3d4cb6)){throw new db['Sequelize'][(_0xb92a('0x93'))](_0xb92a('0xa4'));}return _0x20fa2f[_0xb92a('0xa5')+_[_0xb92a('0xa6')](_0x3d4cb6[_0xb92a('0xa7')]())+_0xb92a('0xa8')](_0x35b2ec[_0xb92a('0x61')][_0xb92a('0x64')],{'penalty':_0x35b2ec['body']['penalty']||0x0})['spread'](function(_0x5e380b){for(var _0xe6eda0=0x0;_0xe6eda0<_0x35b2ec['body'][_0xb92a('0x64')]['length'];_0xe6eda0+=0x1){var _0x299caa={'UserId':Number(_0x35b2ec[_0xb92a('0x53')]['id'])};_0x299caa[_[_0xb92a('0xa6')](_0x3d4cb6[_0xb92a('0xa7')]())+_0xb92a('0xa9')]=Number(_0x35b2ec['body'][_0xb92a('0x64')][_0xe6eda0]);socket[_0xb92a('0xaa')]('user'+_[_0xb92a('0xa6')](_0x3d4cb6['toLowerCase']())+_0xb92a('0xab'),_0x299caa);}return _0x5e380b;})[_0xb92a('0x27')](function(){if(_0x3d4cb6==='voice'){return db[_0xb92a('0xac')][_0xb92a('0x47')]({'where':{'id':_0x35b2ec[_0xb92a('0x61')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x19d5fd){var _0xb4e46c=_0x20fa2f[_0xb92a('0x2a')]({'plain':!![]});var _0x3a0dcd=[];if(_0x3d4cb6===_0xb92a('0xad')&&_0xb4e46c['role']===_0xb92a('0x2f')&&_0xb4e46c[_0xb92a('0x9f')]){for(let _0x3a9348=0x0;_0x3a9348<_0x19d5fd['length'];_0x3a9348+=0x1){_0x3a0dcd[_0xb92a('0x46')]({'membername':_0xb4e46c[_0xb92a('0x37')],'UserId':_0xb4e46c['id'],'queue_name':_0x19d5fd[_0x3a9348][_0xb92a('0x37')],'VoiceQueueId':_0x19d5fd[_0x3a9348]['id'],'interface':_['isNil'](_0xb4e46c[_0xb92a('0xa2')])?util['format'](_0xb92a('0xae'),_0xb4e46c['name']):_0xb4e46c[_0xb92a('0xa2')],'paused':_0xb4e46c['voicePause']||![],'penalty':_0x35b2ec[_0xb92a('0x61')][_0xb92a('0xaf')]||0x0});}return Promise['all'](_0x3a0dcd['map'](function(_0x346a8e){return db['UserVoiceQueueRt'][_0xb92a('0xb0')](_0x346a8e);}));}return _0x20fa2f;});}})[_0xb92a('0x27')](respondWithStatusCode(_0x33705b,null))[_0xb92a('0x1c')](handleError(_0x33705b,null));};exports[_0xb92a('0xb1')]=function(_0x1714ef,_0x41539b){var _0x2db52f,_0x581068;return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x1714ef[_0xb92a('0x53')]['id']},'attributes':['id','name',_0xb92a('0x28')]})[_0xb92a('0x27')](handleEntityNotFound(_0x41539b,null))[_0xb92a('0x27')](function(_0x256098){if(_0x256098){_0x2db52f=_0x256098;if(!_0x1714ef['query'][_0xb92a('0xb2')]||!utils['isValidChannel'](_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')])){throw new db[(_0xb92a('0x92'))]['ValidationError'](_0xb92a('0xa4'));}return _0x256098[_0xb92a('0xb3')+_[_0xb92a('0xa6')](_0x1714ef[_0xb92a('0x42')]['channel']['toLowerCase']())+_0xb92a('0xa8')](_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')]);}})['then'](function(_0x3bfd9a){if(_[_0xb92a('0xb4')](_0x1714ef[_0xb92a('0x42')]['ids'])){for(var _0x3e81bd=0x0;_0x3e81bd<_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x3e81bd+=0x1){_0x581068={'UserId':Number(_0x1714ef[_0xb92a('0x53')]['id'])};_0x581068[_['capitalize'](_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')][_0xb92a('0xa7')]())+_0xb92a('0xa9')]=Number(_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')][_0x3e81bd]);socket['emit'](_0xb92a('0x2d')+_[_0xb92a('0xa6')](_0x1714ef['query']['channel'][_0xb92a('0xa7')]())+_0xb92a('0xb5'),_0x581068);}}else{_0x581068={'UserId':Number(_0x1714ef[_0xb92a('0x53')]['id'])};_0x581068[_[_0xb92a('0xa6')](_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')][_0xb92a('0xa7')]())+'QueueId']=Number(_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')]);socket[_0xb92a('0xaa')](_0xb92a('0x2d')+_['capitalize'](_0x1714ef['query'][_0xb92a('0xb2')]['toLowerCase']())+'Queue:remove',_0x581068);}return _0x3bfd9a;})[_0xb92a('0x27')](function(){if(_0x1714ef[_0xb92a('0x42')][_0xb92a('0xb2')]==='voice'){return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'UserId':_0x1714ef[_0xb92a('0x53')]['id'],'VoiceQueueId':_0x1714ef[_0xb92a('0x42')][_0xb92a('0x64')]},'individualHooks':!![]})['then'](function(){return _0x2db52f;});}return _0x2db52f;})['then'](respondWithStatusCode(_0x41539b,null))[_0xb92a('0x1c')](handleError(_0x41539b,null));};exports[_0xb92a('0xb7')]=function(_0x517ea7,_0x4a6a51){_0x517ea7['body']['userpic']=_0x517ea7[_0xb92a('0xb8')][_0xb92a('0xb9')];return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x517ea7['params']['id']}})['then'](handleEntityNotFound(_0x4a6a51,null))['then'](saveUpdates(_0x517ea7[_0xb92a('0x61')],null))[_0xb92a('0x27')](respondWithResult(_0x4a6a51,null))[_0xb92a('0x1c')](handleError(_0x4a6a51,null));};exports[_0xb92a('0xba')]=function(_0x5cdf47,_0x81ef06){var _0x457afa=path['join'](config['root'],_0xb92a('0xbb'));return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5cdf47[_0xb92a('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xb92a('0x27')](handleEntityNotFound(_0x81ef06,null))['then'](function(_0x2326be){if(_0x2326be){if(_[_0xb92a('0x70')](_0x2326be[_0xb92a('0xbc')])){return _0x81ef06['download'](_0x457afa);}else{if(!fs[_0xb92a('0xbd')](path['join'](config[_0xb92a('0xbe')],_0xb92a('0xbf'),_0x2326be[_0xb92a('0xbc')]))){return _0x81ef06['download'](_0x457afa);}return _0x81ef06[_0xb92a('0xc0')](path['join'](config['root'],_0xb92a('0xbf'),_0x2326be[_0xb92a('0xbc')]));}}})[_0xb92a('0x1c')](handleError(_0x81ef06,null));};exports['getOpenTabs']=function(_0x4f21e2,_0x19b7cb){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x4f21e2[_0xb92a('0x53')]['id']},'attributes':['id']})[_0xb92a('0x27')](handleEntityNotFound(_0x19b7cb,null))[_0xb92a('0x27')](function(_0x3165a4){var _0x52a554=[];values=_0x3165a4['dataValues'];_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x4c'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5e'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x50'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554[_0xb92a('0x46')](get_open_tabs(_0xb92a('0x5f'),_0x3165a4[_0xb92a('0x4d')]));_0x52a554['push'](get_open_tabs('fax',_0x3165a4[_0xb92a('0x4d')]));_0x52a554['push'](get_open_tabs(_0xb92a('0x4f'),_0x3165a4[_0xb92a('0x4d')]));return Promise[_0xb92a('0x51')](_0x52a554);})[_0xb92a('0x27')](function(_0x4b069f){if(_0x4b069f){var _0x462add=_[_0xb92a('0x34')](values[_0xb92a('0xc1')],function(_0x12e482){return{'channel':'CHAT','id':_0x12e482['id'],'createdAt':_0x12e482[_0xb92a('0xc2')]};});var _0x1a680c=_['map'](values[_0xb92a('0xc3')],function(_0x35df63){return{'channel':_0xb92a('0xc4'),'id':_0x35df63['id'],'createdAt':_0x35df63[_0xb92a('0xc2')]};});var _0x2ad5e2=_[_0xb92a('0x34')](values[_0xb92a('0xc5')],function(_0x2653bb){return{'channel':_0xb92a('0xc6'),'id':_0x2653bb['id'],'createdAt':_0x2653bb[_0xb92a('0xc2')]};});var _0x5a4743=_['map'](values[_0xb92a('0xc7')],function(_0x14d7cc){return{'channel':_0xb92a('0xc8'),'id':_0x14d7cc['id'],'createdAt':_0x14d7cc['createdAt']};});var _0x50fbbc=_['map'](values[_0xb92a('0xc9')],function(_0x2928f9){return{'channel':_0xb92a('0xca'),'id':_0x2928f9['id'],'createdAt':_0x2928f9[_0xb92a('0xc2')]};});var _0x26ded4=_[_0xb92a('0x34')](values[_0xb92a('0xcb')],function(_0x4d1a01){return{'channel':_0xb92a('0xcc'),'id':_0x4d1a01['id'],'createdAt':_0x4d1a01[_0xb92a('0xc2')]};});var _0xf0c098=_[_0xb92a('0xcd')](_0x462add,_0x1a680c,_0x2ad5e2,_0x5a4743,_0x50fbbc,_0x26ded4);var _0x42bbf5={'count':_0xf0c098['length'],'rows':_0xf0c098};return _0x42bbf5;}else return null;})['then'](respondWithResult(_0x19b7cb,null))[_0xb92a('0x1c')](handleError(_0x19b7cb,null));};exports[_0xb92a('0xce')]=function(_0x592f6c,_0x15e378){var _0x5c7ed4={};var _0x4f482d={};var _0x5ac3e4;var _0x16603a;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x592f6c['params']['id']}})['then'](handleEntityNotFound(_0x15e378,null))['then'](function(_0x3b87e6){if(_0x3b87e6){_0x5ac3e4=_0x3b87e6;_0x4f482d[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xd0')][_0xb92a('0x57')]);_0x4f482d['query']=_[_0xb92a('0x56')](_0x592f6c[_0xb92a('0x42')]);_0x4f482d[_0xb92a('0x58')]=_['intersection'](_0x4f482d[_0xb92a('0x54')],_0x4f482d[_0xb92a('0x42')]);_0x5c7ed4['attributes']=_[_0xb92a('0x59')](_0x4f482d[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x592f6c['query'][_0xb92a('0x5b')]));_0x5c7ed4[_0xb92a('0x5a')]=_0x5c7ed4['attributes'][_0xb92a('0x4b')]?_0x5c7ed4['attributes']:_0x4f482d[_0xb92a('0x54')];_0x5c7ed4[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x592f6c[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x5c7ed4[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x592f6c[_0xb92a('0x42')],_0x4f482d[_0xb92a('0x58')]));if(_0x592f6c[_0xb92a('0x42')][_0xb92a('0x32')]){_0x5c7ed4[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x5c7ed4['where'],{'$or':_[_0xb92a('0x34')](_0x5c7ed4[_0xb92a('0x5a')],function(_0x7eba57){var _0x5c4b89={};_0x5c4b89[_0x7eba57]={'$like':'%'+_0x592f6c[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x5c4b89;})});}_0x5c7ed4=_[_0xb92a('0x5d')]({},_0x5c7ed4,_0x592f6c[_0xb92a('0xd4')]);return _0x5ac3e4[_0xb92a('0xce')](_0x5c7ed4);}})[_0xb92a('0x27')](function(_0x5778e7){if(_0x5778e7){_0x16603a=_0x5778e7['length'];if(_0x592f6c[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0x43'))){_0x5c7ed4['include']=[{'model':db['CmList'],'as':_0xb92a('0xd6'),'required':![]},{'model':db[_0xb92a('0xd7')],'as':_0xb92a('0xd8'),'attributes':['id','name',_0xb92a('0xd9')],'where':_0x592f6c[_0xb92a('0x42')][_0xb92a('0xda')]?{'id':_0x592f6c[_0xb92a('0x42')][_0xb92a('0xda')]}:undefined,'required':_0x592f6c[_0xb92a('0x42')]['tag']?!![]:![]}];}if(!_0x592f6c[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x5c7ed4[_0xb92a('0x23')]=qs['limit'](_0x592f6c[_0xb92a('0x42')][_0xb92a('0x23')]);_0x5c7ed4[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x592f6c['query']['offset']);}return _0x5ac3e4[_0xb92a('0xce')](_0x5c7ed4);}})[_0xb92a('0x27')](function(_0x4be730){if(_0x4be730){return _0x4be730?{'count':_0x16603a,'rows':_0x4be730}:null;}})['then'](respondWithResult(_0x15e378,null))['catch'](handleError(_0x15e378,null));};exports['getQueues']=function(_0x45a8b2,_0x40feb2){var _0x77f6a5;var _0x11657a={};var _0x1aba13;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x45a8b2['params']['id']},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28')]})[_0xb92a('0x27')](handleEntityNotFound(_0x40feb2,null))[_0xb92a('0x27')](function(_0x383247){if(!utils[_0xb92a('0xa3')](_0x45a8b2[_0xb92a('0x42')]['channel'])){throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0xa4'));}_0x77f6a5=_0x383247;var _0xededaf={};_0xededaf[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_[_0xb92a('0xa6')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xb2')])+'Queue'][_0xb92a('0x57')]);_0xededaf['query']=_[_0xb92a('0x56')](_0x45a8b2[_0xb92a('0x42')]);_0xededaf[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0xededaf['model'],_0xededaf[_0xb92a('0x42')]);_0x11657a['attributes']=_[_0xb92a('0x59')](_0xededaf[_0xb92a('0x54')],qs['fields'](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x11657a[_0xb92a('0x5a')]=_0x11657a[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x11657a[_0xb92a('0x5a')]:_0xededaf['model'];_0x11657a[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x11657a[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x45a8b2[_0xb92a('0x42')],_0xededaf[_0xb92a('0x58')]));if(_0x45a8b2['query']['filter']){_0x11657a['where']=_[_0xb92a('0x5d')](_0x11657a[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x11657a[_0xb92a('0x5a')],function(_0x3a3a62){var _0x38fed1={};_0x38fed1[_0x3a3a62]={'$like':'%'+_0x45a8b2[_0xb92a('0x42')]['filter']+'%'};return _0x38fed1;})});}_0x11657a=_[_0xb92a('0x5d')]({},_0x11657a,_0x45a8b2['options']);switch(_0x77f6a5[_0xb92a('0x28')]){case _0xb92a('0x2b'):return db[_[_0xb92a('0xa6')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xb2')])+_0xb92a('0xdc')]['findAll'](_0x11657a);case _0xb92a('0x2d'):case'agent':return _0x77f6a5[_0xb92a('0x2a')+_[_0xb92a('0xa6')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0xb2')])+_0xb92a('0xa8')](_0x11657a);default:throw new db['Sequelize']['ValidationError'](_0xb92a('0xdd'));}})[_0xb92a('0x27')](function(_0x1f90fa){_0x1aba13=_0x1f90fa['length'];if(!_0x45a8b2['query']['hasOwnProperty']('nolimit')){_0x11657a['limit']=qs[_0xb92a('0x23')](_0x45a8b2[_0xb92a('0x42')][_0xb92a('0x23')]);_0x11657a[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x45a8b2[_0xb92a('0x42')]['offset']);}switch(_0x77f6a5[_0xb92a('0x28')]){case _0xb92a('0x2b'):return db[_[_0xb92a('0xa6')](_0x45a8b2['query']['channel'])+_0xb92a('0xdc')][_0xb92a('0x47')](_0x11657a);case'user':case _0xb92a('0x2f'):return _0x77f6a5[_0xb92a('0x2a')+_['capitalize'](_0x45a8b2[_0xb92a('0x42')]['channel'])+_0xb92a('0xa8')](_0x11657a);}})[_0xb92a('0x27')](function(_0x345b9e){return{'count':_0x1aba13,'rows':_0x345b9e};})[_0xb92a('0x27')](respondWithResult(_0x40feb2,null))[_0xb92a('0x1c')](handleError(_0x40feb2,null));};exports['getVoiceQueuesRt']=function(_0x5b942d,_0xd59bc){var _0x5dd2cc={};var _0x2fc9c3={};var _0x2fb0db;var _0xe24781;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x5b942d[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0xd59bc,null))[_0xb92a('0x27')](function(_0xaa38de){if(_0xaa38de){_0x2fb0db=_0xaa38de;_0x2fc9c3[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xb6')]['rawAttributes']);_0x2fc9c3[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x5b942d[_0xb92a('0x42')]);_0x2fc9c3['filters']=_['intersection'](_0x2fc9c3[_0xb92a('0x54')],_0x2fc9c3[_0xb92a('0x42')]);_0x5dd2cc['attributes']=_[_0xb92a('0x59')](_0x2fc9c3[_0xb92a('0x54')],qs['fields'](_0x5b942d['query'][_0xb92a('0x5b')]));_0x5dd2cc[_0xb92a('0x5a')]=_0x5dd2cc[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x5dd2cc[_0xb92a('0x5a')]:_0x2fc9c3[_0xb92a('0x54')];_0x5dd2cc[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x5b942d[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x5dd2cc[_0xb92a('0x41')]=qs['filters'](_[_0xb92a('0xd3')](_0x5b942d[_0xb92a('0x42')],_0x2fc9c3['filters']));if(_0x5b942d[_0xb92a('0x42')]['filter']){_0x5dd2cc['where']=_[_0xb92a('0x5d')](_0x5dd2cc[_0xb92a('0x41')],{'$or':_['map'](_0x5dd2cc['attributes'],function(_0x46c053){var _0x548459={};_0x548459[_0x46c053]={'$like':'%'+_0x5b942d[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x548459;})});}_0x5dd2cc=_['merge']({},_0x5dd2cc,_0x5b942d[_0xb92a('0xd4')]);return _0x2fb0db['getVoiceQueuesRt'](_0x5dd2cc);}})[_0xb92a('0x27')](function(_0xc1030f){if(_0xc1030f){_0xe24781=_0xc1030f[_0xb92a('0x4b')];if(!_0x5b942d[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x5dd2cc[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x5b942d[_0xb92a('0x42')]['limit']);_0x5dd2cc['offset']=qs[_0xb92a('0x21')](_0x5b942d[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x2fb0db[_0xb92a('0xde')](_0x5dd2cc);}})[_0xb92a('0x27')](function(_0x4e8cb8){if(_0x4e8cb8){return _0x4e8cb8?{'count':_0xe24781,'rows':_0x4e8cb8}:null;}})['then'](respondWithResult(_0xd59bc,null))[_0xb92a('0x1c')](handleError(_0xd59bc,null));};exports['getGroups']=function(_0x47c7b8,_0x68a1c5){var _0x30f10a={};var _0x1dfc4b={};var _0x374463;var _0x4a516b;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x47c7b8[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x68a1c5,null))[_0xb92a('0x27')](function(_0x3adaa0){if(_0x3adaa0){_0x374463=_0x3adaa0;_0x1dfc4b['model']=_[_0xb92a('0x56')](db[_0xb92a('0xdf')][_0xb92a('0x57')]);_0x1dfc4b[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x47c7b8['query']);_0x1dfc4b[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x1dfc4b[_0xb92a('0x54')],_0x1dfc4b[_0xb92a('0x42')]);_0x30f10a[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x1dfc4b[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x47c7b8['query'][_0xb92a('0x5b')]));_0x30f10a[_0xb92a('0x5a')]=_0x30f10a[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x30f10a['attributes']:_0x1dfc4b[_0xb92a('0x54')];_0x30f10a[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x47c7b8[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x30f10a['where']=qs[_0xb92a('0x58')](_['pick'](_0x47c7b8['query'],_0x1dfc4b[_0xb92a('0x58')]));if(_0x47c7b8[_0xb92a('0x42')][_0xb92a('0x32')]){_0x30f10a[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x30f10a[_0xb92a('0x41')],{'$or':_['map'](_0x30f10a['attributes'],function(_0xc58f5d){var _0x336f75={};_0x336f75[_0xc58f5d]={'$like':'%'+_0x47c7b8[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x336f75;})});}_0x30f10a=_['merge']({},_0x30f10a,_0x47c7b8[_0xb92a('0xd4')]);return _0x374463['getGroups'](_0x30f10a);}})['then'](function(_0x3f22a5){if(_0x3f22a5){_0x4a516b=_0x3f22a5[_0xb92a('0x4b')];if(!_0x47c7b8[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x30f10a['limit']=qs[_0xb92a('0x23')](_0x47c7b8['query']['limit']);_0x30f10a[_0xb92a('0x21')]=qs['offset'](_0x47c7b8[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x374463[_0xb92a('0xe0')](_0x30f10a);}})['then'](function(_0x1b76b1){if(_0x1b76b1){return _0x1b76b1?{'count':_0x4a516b,'rows':_0x1b76b1}:null;}})[_0xb92a('0x27')](respondWithResult(_0x68a1c5,null))[_0xb92a('0x1c')](handleError(_0x68a1c5,null));};exports['getRecordings']=function(_0x15cbee,_0x347e87){var _0x475eec={'raw':!![],'where':{}};var _0xad4f1a={};var _0x2482c9={'count':0x0,'rows':[]};return db['User'][_0xb92a('0xcf')]({'where':{'id':_0x15cbee[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x347e87,null))[_0xb92a('0x27')](function(_0x3ef04c){if(_0x3ef04c){_0xad4f1a[_0xb92a('0x54')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0xad4f1a[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x15cbee[_0xb92a('0x42')]);_0xad4f1a['filters']=_['intersection'](_0xad4f1a[_0xb92a('0x54')],_0xad4f1a[_0xb92a('0x42')]);_0x475eec[_0xb92a('0x5a')]=_['intersection'](_0xad4f1a['model'],qs[_0xb92a('0x5b')](_0x15cbee[_0xb92a('0x42')]['fields']));_0x475eec[_0xb92a('0x5a')]=_0x475eec[_0xb92a('0x5a')]['length']?_0x475eec[_0xb92a('0x5a')]:_0xad4f1a[_0xb92a('0x54')];if(!_0x15cbee[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x475eec['limit']=qs[_0xb92a('0x23')](_0x15cbee[_0xb92a('0x42')][_0xb92a('0x23')]);_0x475eec[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x15cbee[_0xb92a('0x42')][_0xb92a('0x21')]);}_0x475eec['order']=qs['sort'](_0x15cbee[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x475eec[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x15cbee[_0xb92a('0x42')],_0xad4f1a[_0xb92a('0x58')]));_0x475eec['where'][_0xb92a('0xe1')]=_0x3ef04c['id'];if(_0x15cbee[_0xb92a('0x42')][_0xb92a('0x32')]){_0x475eec['where']=_[_0xb92a('0x5d')](_0x475eec[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x475eec[_0xb92a('0x5a')],function(_0xcf6242){var _0xe4470c={};_0xe4470c[_0xcf6242]={'$like':'%'+_0x15cbee['query'][_0xb92a('0x32')]+'%'};return _0xe4470c;})});}_0x475eec=_[_0xb92a('0x5d')]({},_0x475eec,_0x15cbee[_0xb92a('0xd4')]);return db[_0xb92a('0xe2')][_0xb92a('0x24')]({'where':_0x475eec[_0xb92a('0x41')]})[_0xb92a('0x27')](function(_0x450f3b){_0x2482c9[_0xb92a('0x24')]=_0x450f3b;if(_0x15cbee['query'][_0xb92a('0x43')]){_0x475eec[_0xb92a('0x5c')]=[{'all':!![]}];}return db[_0xb92a('0xe2')][_0xb92a('0x47')](_0x475eec);})['then'](function(_0x44448a){_0x2482c9[_0xb92a('0x48')]=_0x44448a;return _0x2482c9;});}})[_0xb92a('0x27')](respondWithFilteredResult(_0x347e87,_0x475eec))[_0xb92a('0x1c')](handleError(_0x347e87,null));};exports['getScreenRecordings']=function(_0x3a7f55,_0x1bda30){var _0x591fbb={'raw':!![],'where':{}};var _0x417785={};var _0x3fa612={'count':0x0,'rows':[]};return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x3a7f55[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bda30,null))[_0xb92a('0x27')](function(_0x4aa105){if(_0x4aa105){_0x417785['model']=_[_0xb92a('0x56')](db[_0xb92a('0xe3')]['rawAttributes']);_0x417785[_0xb92a('0x42')]=_['keys'](_0x3a7f55[_0xb92a('0x42')]);_0x417785[_0xb92a('0x58')]=_['intersection'](_0x417785[_0xb92a('0x54')],_0x417785[_0xb92a('0x42')]);_0x591fbb[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x417785[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x591fbb['attributes']=_0x591fbb[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x591fbb[_0xb92a('0x5a')]:_0x417785[_0xb92a('0x54')];if(!_0x3a7f55[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x591fbb['limit']=qs[_0xb92a('0x23')](_0x3a7f55[_0xb92a('0x42')]['limit']);_0x591fbb[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x21')]);}_0x591fbb[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x3a7f55[_0xb92a('0x42')]['sort']);_0x591fbb['where']=qs['filters'](_[_0xb92a('0xd3')](_0x3a7f55['query'],_0x417785[_0xb92a('0x58')]));_0x591fbb[_0xb92a('0x41')][_0xb92a('0xe1')]=_0x4aa105['id'];if(_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x32')]){_0x591fbb[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x591fbb['where'],{'$or':_[_0xb92a('0x34')](_0x591fbb['attributes'],function(_0x1ab306){var _0x3e0c0d={};_0x3e0c0d[_0x1ab306]={'$like':'%'+_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x3e0c0d;})});}_0x591fbb=_[_0xb92a('0x5d')]({},_0x591fbb,_0x3a7f55[_0xb92a('0xd4')]);return db[_0xb92a('0xe3')][_0xb92a('0x24')]({'where':_0x591fbb[_0xb92a('0x41')]})[_0xb92a('0x27')](function(_0x58a040){_0x3fa612['count']=_0x58a040;if(_0x3a7f55[_0xb92a('0x42')][_0xb92a('0x43')]){_0x591fbb[_0xb92a('0x5c')]=[{'all':!![]}];}return db[_0xb92a('0xe3')][_0xb92a('0x47')](_0x591fbb);})[_0xb92a('0x27')](function(_0x5ebcbf){_0x3fa612[_0xb92a('0x48')]=_0x5ebcbf;return _0x3fa612;});}})['then'](respondWithFilteredResult(_0x1bda30,_0x591fbb))[_0xb92a('0x1c')](handleError(_0x1bda30,null));};exports['getChatInteractions']=function(_0x25365b,_0x4ca326){var _0x31516c={};var _0x36a4fc={};var _0x1f9957;var _0x69ef70;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x25365b[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x4ca326,null))[_0xb92a('0x27')](function(_0x24b087){if(_0x24b087){_0x1f9957=_0x24b087;_0x36a4fc[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['ChatInteraction']['rawAttributes']);_0x36a4fc[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x25365b[_0xb92a('0x42')]);_0x36a4fc[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x36a4fc[_0xb92a('0x54')],_0x36a4fc[_0xb92a('0x42')]);_0x31516c[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x36a4fc[_0xb92a('0x54')],qs['fields'](_0x25365b['query'][_0xb92a('0x5b')]));_0x31516c['attributes']=_0x31516c[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x31516c[_0xb92a('0x5a')]:_0x36a4fc['model'];_0x31516c['order']=qs[_0xb92a('0xd2')](_0x25365b['query'][_0xb92a('0xd2')]);_0x31516c[_0xb92a('0x41')]=qs['filters'](_['pick'](_0x25365b['query'],_0x36a4fc[_0xb92a('0x58')]));if(_0x25365b[_0xb92a('0x42')][_0xb92a('0x32')]){_0x31516c[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x31516c[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x31516c[_0xb92a('0x5a')],function(_0x2dce56){var _0x4dd115={};_0x4dd115[_0x2dce56]={'$like':'%'+_0x25365b[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x4dd115;})});}_0x31516c=_[_0xb92a('0x5d')]({},_0x31516c,_0x25365b['options']);return _0x1f9957[_0xb92a('0xe4')](_0x31516c);}})['then'](function(_0x14356a){if(_0x14356a){_0x69ef70=_0x14356a[_0xb92a('0x4b')];if(!_0x25365b[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x31516c[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x25365b[_0xb92a('0x42')][_0xb92a('0x23')]);_0x31516c[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x25365b[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x1f9957[_0xb92a('0xe4')](_0x31516c);}})[_0xb92a('0x27')](function(_0x10c470){if(_0x10c470){return _0x10c470?{'count':_0x69ef70,'rows':_0x10c470}:null;}})[_0xb92a('0x27')](respondWithResult(_0x4ca326,null))[_0xb92a('0x1c')](handleError(_0x4ca326,null));};exports[_0xb92a('0xe5')]=function(_0x2f5091,_0x577d4){var _0x3fb457={};var _0x3d9de0={};var _0x5bf345;var _0x1c73b8;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x2f5091[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x577d4,null))['then'](function(_0x12a471){if(_0x12a471){_0x5bf345=_0x12a471;_0x3d9de0[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0xe6')][_0xb92a('0x57')]);_0x3d9de0[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x2f5091[_0xb92a('0x42')]);_0x3d9de0['filters']=_['intersection'](_0x3d9de0[_0xb92a('0x54')],_0x3d9de0[_0xb92a('0x42')]);_0x3fb457[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x3d9de0['model'],qs[_0xb92a('0x5b')](_0x2f5091['query'][_0xb92a('0x5b')]));_0x3fb457[_0xb92a('0x5a')]=_0x3fb457[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x3fb457[_0xb92a('0x5a')]:_0x3d9de0[_0xb92a('0x54')];_0x3fb457[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x2f5091[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x3fb457[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x2f5091[_0xb92a('0x42')],_0x3d9de0[_0xb92a('0x58')]));if(_0x2f5091[_0xb92a('0x42')][_0xb92a('0x32')]){_0x3fb457[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x3fb457[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x3fb457[_0xb92a('0x5a')],function(_0x37b566){var _0x11408f={};_0x11408f[_0x37b566]={'$like':'%'+_0x2f5091['query'][_0xb92a('0x32')]+'%'};return _0x11408f;})});}_0x3fb457=_[_0xb92a('0x5d')]({},_0x3fb457,_0x2f5091[_0xb92a('0xd4')]);return _0x5bf345[_0xb92a('0xe5')](_0x3fb457);}})[_0xb92a('0x27')](function(_0x1ac627){if(_0x1ac627){_0x1c73b8=_0x1ac627[_0xb92a('0x4b')];if(!_0x2f5091[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x3fb457[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x2f5091['query'][_0xb92a('0x23')]);_0x3fb457['offset']=qs[_0xb92a('0x21')](_0x2f5091[_0xb92a('0x42')]['offset']);}return _0x5bf345[_0xb92a('0xe5')](_0x3fb457);}})[_0xb92a('0x27')](function(_0x473e85){if(_0x473e85){return _0x473e85?{'count':_0x1c73b8,'rows':_0x473e85}:null;}})['then'](respondWithResult(_0x577d4,null))[_0xb92a('0x1c')](handleError(_0x577d4,null));};exports[_0xb92a('0xe7')]=function(_0x3d19ce,_0xc2752a){var _0x21c151={'raw':!![],'where':{}};var _0x384afb={};var _0x313ba7={'count':0x0,'rows':[]};return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x3d19ce['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0xc2752a,null))['then'](function(_0x107c5){if(_0x107c5){_0x384afb['model']=_[_0xb92a('0x56')](db['MailInteraction'][_0xb92a('0x57')]);_0x384afb[_0xb92a('0x42')]=_['keys'](_0x3d19ce['query']);_0x384afb[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x384afb[_0xb92a('0x54')],_0x384afb[_0xb92a('0x42')]);_0x21c151[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x384afb[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x3d19ce[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x21c151[_0xb92a('0x5a')]=_0x21c151[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x21c151[_0xb92a('0x5a')]:_0x384afb['model'];if(!_0x3d19ce['query'][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x21c151[_0xb92a('0x23')]=qs['limit'](_0x3d19ce[_0xb92a('0x42')][_0xb92a('0x23')]);_0x21c151['offset']=qs[_0xb92a('0x21')](_0x3d19ce[_0xb92a('0x42')]['offset']);}_0x21c151[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x3d19ce['query'][_0xb92a('0xd2')]);_0x21c151[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x3d19ce[_0xb92a('0x42')],_0x384afb[_0xb92a('0x58')]));_0x21c151[_0xb92a('0x41')][_0xb92a('0xe1')]=_0x107c5['id'];if(_0x3d19ce[_0xb92a('0x42')]['filter']){_0x21c151[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x21c151[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x21c151[_0xb92a('0x5a')],function(_0x1f41d0){var _0x46417b={};_0x46417b[_0x1f41d0]={'$like':'%'+_0x3d19ce[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x46417b;})});}_0x21c151=_[_0xb92a('0x5d')]({},_0x21c151,_0x3d19ce[_0xb92a('0xd4')]);return db[_0xb92a('0xe8')][_0xb92a('0x24')]({'where':_0x21c151[_0xb92a('0x41')]})[_0xb92a('0x27')](function(_0x285637){_0x313ba7['count']=_0x285637;if(_0x3d19ce[_0xb92a('0x42')]['includeAll']){_0x21c151['include']=[{'all':!![]}];}return db[_0xb92a('0xe8')][_0xb92a('0x47')](_0x21c151);})[_0xb92a('0x27')](function(_0x202982){_0x313ba7[_0xb92a('0x48')]=_0x202982;return _0x313ba7;});}})[_0xb92a('0x27')](respondWithFilteredResult(_0xc2752a,_0x21c151))['catch'](handleError(_0xc2752a,null));};exports[_0xb92a('0xe9')]=function(_0x1cb850,_0x168903){var _0x3af44a={};var _0x403165={};var _0x22f392;var _0x180729;return db['User'][_0xb92a('0xcf')]({'where':{'id':_0x1cb850[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x168903,null))[_0xb92a('0x27')](function(_0xa3edfe){if(_0xa3edfe){_0x22f392=_0xa3edfe;_0x403165[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0xea')][_0xb92a('0x57')]);_0x403165[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x1cb850['query']);_0x403165[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x403165[_0xb92a('0x54')],_0x403165[_0xb92a('0x42')]);_0x3af44a[_0xb92a('0x5a')]=_['intersection'](_0x403165[_0xb92a('0x54')],qs['fields'](_0x1cb850[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x3af44a[_0xb92a('0x5a')]=_0x3af44a[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x3af44a[_0xb92a('0x5a')]:_0x403165[_0xb92a('0x54')];_0x3af44a[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x1cb850[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x3af44a[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_['pick'](_0x1cb850[_0xb92a('0x42')],_0x403165[_0xb92a('0x58')]));if(_0x1cb850[_0xb92a('0x42')][_0xb92a('0x32')]){_0x3af44a[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x3af44a[_0xb92a('0x41')],{'$or':_['map'](_0x3af44a['attributes'],function(_0x4c496f){var _0x2f0618={};_0x2f0618[_0x4c496f]={'$like':'%'+_0x1cb850[_0xb92a('0x42')]['filter']+'%'};return _0x2f0618;})});}_0x3af44a=_['merge']({},_0x3af44a,_0x1cb850[_0xb92a('0xd4')]);return _0x22f392['getSmsInteractions'](_0x3af44a);}})[_0xb92a('0x27')](function(_0x3017fd){if(_0x3017fd){_0x180729=_0x3017fd[_0xb92a('0x4b')];if(!_0x1cb850[_0xb92a('0x42')]['hasOwnProperty'](_0xb92a('0xdb'))){_0x3af44a[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x1cb850[_0xb92a('0x42')]['limit']);_0x3af44a[_0xb92a('0x21')]=qs['offset'](_0x1cb850[_0xb92a('0x42')]['offset']);}return _0x22f392[_0xb92a('0xe9')](_0x3af44a);}})[_0xb92a('0x27')](function(_0x5b9b3a){if(_0x5b9b3a){return _0x5b9b3a?{'count':_0x180729,'rows':_0x5b9b3a}:null;}})[_0xb92a('0x27')](respondWithResult(_0x168903,null))[_0xb92a('0x1c')](handleError(_0x168903,null));};exports[_0xb92a('0xeb')]=function(_0x56f38a,_0x1ce53a){var _0x272078={};var _0x21572c={};var _0x3cfe84;var _0x4cd46d;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x56f38a[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x1ce53a,null))[_0xb92a('0x27')](function(_0x4994e7){if(_0x4994e7){_0x3cfe84=_0x4994e7;_0x21572c[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xec')]['rawAttributes']);_0x21572c[_0xb92a('0x42')]=_['keys'](_0x56f38a[_0xb92a('0x42')]);_0x21572c[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x21572c['model'],_0x21572c['query']);_0x272078['attributes']=_[_0xb92a('0x59')](_0x21572c[_0xb92a('0x54')],qs['fields'](_0x56f38a[_0xb92a('0x42')]['fields']));_0x272078['attributes']=_0x272078['attributes'][_0xb92a('0x4b')]?_0x272078[_0xb92a('0x5a')]:_0x21572c['model'];_0x272078[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x56f38a[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x272078['where']=qs['filters'](_[_0xb92a('0xd3')](_0x56f38a[_0xb92a('0x42')],_0x21572c[_0xb92a('0x58')]));if(_0x56f38a['query']['filter']){_0x272078[_0xb92a('0x41')]=_['merge'](_0x272078[_0xb92a('0x41')],{'$or':_['map'](_0x272078['attributes'],function(_0x314955){var _0xd77241={};_0xd77241[_0x314955]={'$like':'%'+_0x56f38a[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0xd77241;})});}_0x272078=_[_0xb92a('0x5d')]({},_0x272078,_0x56f38a[_0xb92a('0xd4')]);return _0x3cfe84[_0xb92a('0xeb')](_0x272078);}})[_0xb92a('0x27')](function(_0x388d41){if(_0x388d41){_0x4cd46d=_0x388d41[_0xb92a('0x4b')];if(!_0x56f38a[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x272078['limit']=qs[_0xb92a('0x23')](_0x56f38a['query'][_0xb92a('0x23')]);_0x272078['offset']=qs[_0xb92a('0x21')](_0x56f38a[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x3cfe84[_0xb92a('0xeb')](_0x272078);}})[_0xb92a('0x27')](function(_0x292542){if(_0x292542){return _0x292542?{'count':_0x4cd46d,'rows':_0x292542}:null;}})['then'](respondWithResult(_0x1ce53a,null))[_0xb92a('0x1c')](handleError(_0x1ce53a,null));};exports[_0xb92a('0xed')]=function(_0x197bfd,_0x4f6592){var _0x23a29d={};var _0x26afe7={};var _0xc79704;var _0xede2c9;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x197bfd[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f6592,null))[_0xb92a('0x27')](function(_0x41319f){if(_0x41319f){_0xc79704=_0x41319f;_0x26afe7[_0xb92a('0x54')]=_['keys'](db[_0xb92a('0xee')]['rawAttributes']);_0x26afe7[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x197bfd[_0xb92a('0x42')]);_0x26afe7[_0xb92a('0x58')]=_['intersection'](_0x26afe7[_0xb92a('0x54')],_0x26afe7['query']);_0x23a29d[_0xb92a('0x5a')]=_['intersection'](_0x26afe7[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x197bfd['query'][_0xb92a('0x5b')]));_0x23a29d[_0xb92a('0x5a')]=_0x23a29d[_0xb92a('0x5a')]['length']?_0x23a29d[_0xb92a('0x5a')]:_0x26afe7['model'];_0x23a29d[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x197bfd['query']['sort']);_0x23a29d[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x197bfd[_0xb92a('0x42')],_0x26afe7[_0xb92a('0x58')]));if(_0x197bfd[_0xb92a('0x42')]['filter']){_0x23a29d['where']=_['merge'](_0x23a29d['where'],{'$or':_[_0xb92a('0x34')](_0x23a29d[_0xb92a('0x5a')],function(_0x455828){var _0x596038={};_0x596038[_0x455828]={'$like':'%'+_0x197bfd['query'][_0xb92a('0x32')]+'%'};return _0x596038;})});}_0x23a29d=_[_0xb92a('0x5d')]({},_0x23a29d,_0x197bfd[_0xb92a('0xd4')]);return _0xc79704[_0xb92a('0xed')](_0x23a29d);}})[_0xb92a('0x27')](function(_0x1694d3){if(_0x1694d3){_0xede2c9=_0x1694d3[_0xb92a('0x4b')];if(!_0x197bfd[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x23a29d['limit']=qs[_0xb92a('0x23')](_0x197bfd[_0xb92a('0x42')][_0xb92a('0x23')]);_0x23a29d[_0xb92a('0x21')]=qs['offset'](_0x197bfd['query']['offset']);}return _0xc79704[_0xb92a('0xed')](_0x23a29d);}})['then'](function(_0x53c68f){if(_0x53c68f){return _0x53c68f?{'count':_0xede2c9,'rows':_0x53c68f}:null;}})['then'](respondWithResult(_0x4f6592,null))['catch'](handleError(_0x4f6592,null));};exports[_0xb92a('0xef')]=function(_0xf1c44b,_0x228ffe,_0x44ab02){var _0x4d231f;var _0xa099af;var _0x39830e;var _0x3e87d7=!_['isNil'](_0xf1c44b[_0xb92a('0x53')]['id'])?_0xf1c44b['params']['id']:!_['isNil'](_0xf1c44b['user']['id'])?_0xf1c44b[_0xb92a('0x2d')]['id']:null;return db['User'][_0xb92a('0x35')]({'where':{'id':_0x3e87d7,'role':{'$or':[_0xb92a('0x2b'),'user',_0xb92a('0x2f')]}},'attributes':['id',_0xb92a('0x37'),_0xb92a('0xf0'),_0xb92a('0xf1'),_0xb92a('0x28'),_0xb92a('0x66'),_0xb92a('0xa0')]})[_0xb92a('0x27')](function(_0x254b48){if(_0x254b48){if(_0x254b48[_0xb92a('0x28')]===_0xb92a('0x2f')){_0x4d231f=_0x254b48;if(_0xf1c44b[_0xb92a('0x61')][_0xb92a('0xa2')]){_0x39830e=util['format'](_0xb92a('0xf2'),_0x4d231f[_0xf1c44b['body']['interface']]);}else if(_0xf1c44b[_0xb92a('0x61')][_0xb92a('0xf3')]){_0x39830e=util['format'](_0xb92a('0xae'),_0xf1c44b[_0xb92a('0x61')]['intrf']);}else{_0x39830e=util['format'](_0xb92a('0xae'),_0x4d231f[_0xb92a('0x37')]);}socket['to'](util[_0xb92a('0xf4')](_0xb92a('0xf5'),_0x4d231f[_0xb92a('0x37')]))[_0xb92a('0xaa')](_0xb92a('0xf6'),{'user':{'id':_0x4d231f['id'],'name':_0x4d231f['name']},'ip':_0xf1c44b[_0xb92a('0xf7')][_0xb92a('0xf8')]||_0xf1c44b[_0xb92a('0xf9')][_0xb92a('0xfa')]||_0xf1c44b[_0xb92a('0xfb')][_0xb92a('0xfa')]||_0xf1c44b[_0xb92a('0xf9')][_0xb92a('0xfb')][_0xb92a('0xfa')]});return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'membername':_0x4d231f[_0xb92a('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xb92a('0x92'))][(_0xb92a('0x93'))](_0xb92a('0xfc'));}})[_0xb92a('0x27')](function(){if(_0x4d231f){return _0x4d231f['getVoiceQueues']({'raw':!![]});}})[_0xb92a('0x27')](function(_0x4ac225){if(_0x4d231f){if(_0x4ac225){_0xa099af=_0x4ac225;if(_0xa099af[_0xb92a('0x4b')]){var _0x446af3=_0xa099af['map'](function(_0x3a6815){var _0x5ee886={'membername':_0x4d231f['name'],'UserId':_0x4d231f['id'],'queue_name':_0x3a6815['name'],'VoiceQueueId':_0x3a6815['id'],'interface':_0x39830e,'paused':_0x4d231f[_0xb92a('0xa0')]||![],'penalty':_0x3a6815[_0xb92a('0xfd')]||0x0};return db[_0xb92a('0xb6')][_0xb92a('0xb0')](_0x5ee886);});return Promise[_0xb92a('0x51')](_0x446af3);}}}})[_0xb92a('0x27')](function(){if(_0x4d231f){return db[_0xb92a('0xfe')][_0xb92a('0x47')]({'where':{'membername':_0x4d231f[_0xb92a('0x37')],'exitAt':null}});}})[_0xb92a('0x27')](function(_0x2847d0){if(_0x4d231f){var _0x553bf4=[];_0x2847d0[_0xb92a('0xff')](function(_0x56703c){_0x553bf4[_0xb92a('0x46')](_0x56703c['update']({'exitAt':moment()[_0xb92a('0xf4')](_0xb92a('0x100'))}));});return Promise[_0xb92a('0x51')](_0x553bf4);}})[_0xb92a('0x27')](function(){if(_0x4d231f){var _0x256811=[];var _0x1478c8=[];var _0x40bf45=utils[_0xb92a('0x101')]();var _0x35bbb4={'membername':_0x4d231f[_0xb92a('0x37')],'interface':_0x39830e,'enterAt':moment()['format'](_0xb92a('0x100')),'role':_0x4d231f[_0xb92a('0x28')],'internal':_0x4d231f[_0xb92a('0x66')]};_0x40bf45[_0xb92a('0xff')](function(_0x4911ca){_0x256811[_0xb92a('0x46')](_[_0xb92a('0x5d')]({'channel':_0x4911ca,'type':_0xb92a('0x102'),'data1':_0xf1c44b[_0xb92a('0x61')][_0xb92a('0x103')],'data2':_0x39830e},_0x35bbb4));if(_0x4d231f['loginInPause']){_0x1478c8['push'](_[_0xb92a('0x5d')]({'channel':_0x4911ca,'type':_0xb92a('0x104'),'data1':'LOGININPAUSE'},_0x35bbb4));}});return db[_0xb92a('0xfe')][_0xb92a('0x105')](_0x256811[_0xb92a('0xcd')](_0x1478c8),{'individualHooks':!![]});}})[_0xb92a('0x27')](function(){if(_0x4d231f){return _0x4d231f[_0xb92a('0x60')]({'online':!![],'lastLoginAt':moment()[_0xb92a('0xf4')](_0xb92a('0x100')),'voicePause':_0x4d231f[_0xb92a('0xa0')]||![],'mailPause':_0x4d231f[_0xb92a('0xa0')]||![],'chatPause':_0x4d231f[_0xb92a('0xa0')]||![],'faxPause':_0x4d231f[_0xb92a('0xa0')]||![],'smsPause':_0x4d231f[_0xb92a('0xa0')]||![],'openchannelPause':_0x4d231f['loginInPause']||![],'whatsappPause':_0x4d231f['loginInPause']||![],'pauseType':_0x4d231f[_0xb92a('0xa0')]?_0xb92a('0x106'):null,'interface':_0x39830e,'lastPauseAt':moment()['format'](_0xb92a('0x100'))});}})[_0xb92a('0x27')](function(_0x113bc8){if(_0xf1c44b[_0xb92a('0x107')]){return _0x44ab02();}else{return Promise[_0xb92a('0x108')](_0x113bc8)[_0xb92a('0x27')](respondWithResult(_0x228ffe,null));}})[_0xb92a('0x1c')](handleError(_0x228ffe,null));};exports[_0xb92a('0x109')]=function(_0x23887a,_0x468ab3){var _0x21eb1b;return db['User'][_0xb92a('0x35')]({'where':{'id':_0x23887a[_0xb92a('0x53')]['id'],'role':_0xb92a('0x2f')},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28')]})[_0xb92a('0x27')](handleEntityNotFound(_0x468ab3,null))[_0xb92a('0x27')](function(_0x31fc9b){if(_0x31fc9b){_0x21eb1b=_0x31fc9b;return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'membername':_0x21eb1b[_0xb92a('0x37')]},'individualHooks':!![]});}})['then'](function(){return db[_0xb92a('0xfe')]['findAll']({'where':{'membername':_0x21eb1b[_0xb92a('0x37')],'exitAt':null}});})[_0xb92a('0x27')](function(_0x53a9d2){var _0x214f78=[];_0x53a9d2[_0xb92a('0xff')](function(_0x2fcf17){_0x214f78[_0xb92a('0x46')](_0x2fcf17[_0xb92a('0x60')]({'exitAt':moment()[_0xb92a('0xf4')](_0xb92a('0x100'))}));});return Promise[_0xb92a('0x51')](_0x214f78);})['then'](function(){return _0x21eb1b[_0xb92a('0x60')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x468ab3,null))[_0xb92a('0x1c')](handleError(_0x468ab3,null));};exports[_0xb92a('0x10a')]=function(_0x4c62b1,_0x5bbdea){var _0x3a59b9;return db[_0xb92a('0xb6')][_0xb92a('0x60')]({'paused':0x1},{'where':{'UserId':_0x4c62b1[_0xb92a('0x53')]['id']},'individualHooks':!![]})[_0xb92a('0x27')](function(){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x4c62b1[_0xb92a('0x53')]['id'],'role':_0xb92a('0x2f')},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28'),_0xb92a('0x66'),_0xb92a('0xa2'),'online']});})[_0xb92a('0x27')](handleEntityNotFound(_0x5bbdea,null))['then'](function(_0x4080bd){if(_0x4080bd){_0x3a59b9=_0x4080bd;return respondWithRpcPromise('QueuePause',_0xb92a('0x10a'),{'id':_0x3a59b9['id'],'name':_0x3a59b9[_0xb92a('0x37')],'pause':!![]});}})[_0xb92a('0x27')](function(){if(_0x3a59b9){return db['MemberReport'][_0xb92a('0x47')]({'where':{'membername':_0x3a59b9[_0xb92a('0x37')],'type':_0xb92a('0x104'),'exitAt':null}});}})[_0xb92a('0x27')](function(_0x484a8e){if(_0x484a8e[_0xb92a('0x4b')]){var _0x8eea3a=moment()[_0xb92a('0xf4')](_0xb92a('0x100'));for(var _0x3ed23a=0x0,_0x4ff03e=_0x484a8e[_0xb92a('0x4b')];_0x3ed23a<_0x4ff03e;_0x3ed23a++){_0x484a8e[_0x3ed23a][_0xb92a('0x10b')]({'exitAt':_0x8eea3a});}}})[_0xb92a('0x27')](function(){var _0x266e34=[];var _0x3c8e29=utils[_0xb92a('0x101')]();_0x3c8e29[_0xb92a('0xff')](function(_0x1bc80e){_0x266e34[_0xb92a('0x46')]({'channel':_0x1bc80e,'membername':_0x3a59b9[_0xb92a('0x37')],'interface':_[_0xb92a('0x70')](_0x3a59b9[_0xb92a('0xa2')])?util[_0xb92a('0xf4')](_0xb92a('0xae'),_0x3a59b9[_0xb92a('0x37')]):_0x3a59b9['interface'],'type':_0xb92a('0x104'),'enterAt':moment()['format'](_0xb92a('0x100')),'data1':_0x4c62b1[_0xb92a('0x61')][_0xb92a('0x3d')]||'DEFAULT\x20PAUSE','role':_0x3a59b9['role'],'internal':_0x3a59b9[_0xb92a('0x66')]});});return db[_0xb92a('0xfe')][_0xb92a('0x105')](_0x266e34,{'individualHooks':!![]});})[_0xb92a('0x27')](function(){return _0x3a59b9[_0xb92a('0x60')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4c62b1[_0xb92a('0x61')]['type']||_0xb92a('0x10c'),'lastPauseAt':moment()[_0xb92a('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb92a('0x27')](respondWithResult(_0x5bbdea,null))[_0xb92a('0x1c')](handleError(_0x5bbdea,null));};exports[_0xb92a('0x10d')]=function(_0x5119f3,_0x294f18){if(_0x5119f3[_0xb92a('0x61')]['channel']&&!utils[_0xb92a('0xa3')](_0x5119f3[_0xb92a('0x61')][_0xb92a('0xb2')])){throw new APIBadRequestError(util[_0xb92a('0xf4')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x5119f3['body']['channel']));}return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5119f3[_0xb92a('0x53')]['id']},'attributes':['id',_0xb92a('0x37'),_0xb92a('0x28'),_0xb92a('0x66'),_0xb92a('0xa2'),'online','voicePause',_0xb92a('0x10e'),'chatPause',_0xb92a('0x10f'),_0xb92a('0x110'),_0xb92a('0x111'),_0xb92a('0x112'),_0xb92a('0x113'),_0xb92a('0x114')]})[_0xb92a('0x27')](function(_0x319f81){if(!_0x319f81){throw new APINotFoundError(util[_0xb92a('0xf4')](_0xb92a('0x115'),_0x5119f3[_0xb92a('0x53')]['id']));}return _0x319f81['unpause'](_0x5119f3[_0xb92a('0x61')][_0xb92a('0xb2')]);})[_0xb92a('0x27')](respondWithResult(_0x294f18,null))['catch'](APIHandleError(_0x294f18));};exports[_0xb92a('0x116')]=function(_0x4e2c5a,_0x15387f){var _0x1d3b0c={};var _0x5c2771={};var _0x156fba;var _0x1a98f0;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x4e2c5a[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x15387f,null))[_0xb92a('0x27')](function(_0x275cfc){if(_0x275cfc){_0x156fba=_0x275cfc;_0x5c2771['model']=_[_0xb92a('0x56')](db[_0xb92a('0x117')][_0xb92a('0x57')]);_0x5c2771['query']=_['keys'](_0x4e2c5a[_0xb92a('0x42')]);_0x5c2771['filters']=_[_0xb92a('0x59')](_0x5c2771[_0xb92a('0x54')],_0x5c2771['query']);_0x1d3b0c[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x5c2771[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x4e2c5a[_0xb92a('0x42')]['fields']));_0x1d3b0c[_0xb92a('0x5a')]=_0x1d3b0c[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x1d3b0c['attributes']:_0x5c2771['model'];_0x1d3b0c[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x4e2c5a[_0xb92a('0x42')]['sort']);_0x1d3b0c['where']=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x4e2c5a['query'],_0x5c2771[_0xb92a('0x58')]));if(_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0x32')]){_0x1d3b0c['where']=_[_0xb92a('0x5d')](_0x1d3b0c['where'],{'$or':_[_0xb92a('0x34')](_0x1d3b0c['attributes'],function(_0x4a18f9){var _0x2033a3={};_0x2033a3[_0x4a18f9]={'$like':'%'+_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x2033a3;})});}_0x1d3b0c=_[_0xb92a('0x5d')]({},_0x1d3b0c,_0x4e2c5a[_0xb92a('0xd4')]);return _0x156fba[_0xb92a('0x116')](_0x1d3b0c);}})['then'](function(_0xfa7624){if(_0xfa7624){_0x1a98f0=_0xfa7624[_0xb92a('0x4b')];if(!_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x1d3b0c['limit']=qs[_0xb92a('0x23')](_0x4e2c5a['query'][_0xb92a('0x23')]);_0x1d3b0c['offset']=qs[_0xb92a('0x21')](_0x4e2c5a[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x156fba[_0xb92a('0x116')](_0x1d3b0c);}})[_0xb92a('0x27')](function(_0x5ef3e4){if(_0x5ef3e4){return _0x5ef3e4?{'count':_0x1a98f0,'rows':_0x5ef3e4}:null;}})[_0xb92a('0x27')](respondWithResult(_0x15387f,null))[_0xb92a('0x1c')](handleError(_0x15387f,null));};exports[_0xb92a('0x118')]=function(_0x464c3e,_0x51850c){var _0x11dd86=_0x464c3e['params']['id'];var _0x35812e=_0x464c3e[_0xb92a('0x61')]?_0x464c3e[_0xb92a('0x61')][_0xb92a('0x64')]:null;var _0x148361=[];return Promise[_0xb92a('0x108')]()[_0xb92a('0x27')](function(){if(!_0x35812e)throw new APIBadRequestError(_0xb92a('0x119'));})['then'](function(){return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x11dd86}});})[_0xb92a('0x27')](function(_0x27080d){if(!_0x27080d)throw new APINotFoundError(util['format'](_0xb92a('0x115'),_0x464c3e[_0xb92a('0x53')]['id']));return db[_0xb92a('0x6c')]['transaction'](function(_0x530cc7){return _0x27080d['addTeams'](_0x35812e,{'transaction':_0x530cc7})[_0xb92a('0x27')](function(){return db[_0xb92a('0x117')][_0xb92a('0x47')]({'where':{'id':{'$in':_0x35812e}}});})[_0xb92a('0x27')](function(_0x261412){var _0x5ddcc7=_['map'](_0x261412,function(_0x1d550f){return _0x1d550f[_0xb92a('0x11a')]();});return Promise[_0xb92a('0x51')](_0x5ddcc7);})['then'](function(_0x51aaf8){_0x148361=_[_0xb92a('0x11b')](_0x51aaf8);var _0xf17817=_[_0xb92a('0x34')](_0x148361,function(_0x2148a4){return _0x2148a4[_0xb92a('0x11c')](_0x27080d['id'],{'transaction':_0x530cc7});});return Promise[_0xb92a('0x51')](_0xf17817);})['then'](function(){if(!_0x27080d['online'])return;var _0x17e12d=_[_0xb92a('0x32')](_0x148361,function(_0x3efae6){return _0x3efae6[_0xb92a('0x11d')](_0xb92a('0xb2'))==='Voice';});var _0x454472=_[_0xb92a('0x34')](_0x17e12d,function(_0x3438a4){return db[_0xb92a('0xb6')][_0xb92a('0xb0')]({'membername':_0x27080d['name'],'UserId':_0x27080d['id'],'queue_name':_0x3438a4[_0xb92a('0x37')],'VoiceQueueId':_0x3438a4['id'],'interface':_[_0xb92a('0x70')](_0x27080d[_0xb92a('0xa2')])?util['format'](_0xb92a('0xae'),_0x27080d[_0xb92a('0x37')]):_0x27080d[_0xb92a('0xa2')],'paused':_0x27080d['voicePause']||![],'penalty':_0x27080d['penalty']},{'transaction':_0x530cc7});});return Promise[_0xb92a('0x51')](_0x454472);})[_0xb92a('0x27')](function(){return db[_0xb92a('0x11e')][_0xb92a('0x47')]({'where':{'teamId':{'$in':_0x35812e}}});})[_0xb92a('0x27')](function(_0x3e08ea){var _0x54b35e=_[_0xb92a('0x34')](_0x3e08ea,function(_0x27c785){return db[_0xb92a('0x11f')][_0xb92a('0x83')]({'UserId':_0x27080d['id'],'VoicePrefixId':_0x27c785[_0xb92a('0x120')]},{'transaction':_0x530cc7});});return Promise[_0xb92a('0x51')](_0x54b35e);});});})['then'](function(){for(var _0x2f499a=0x0;_0x2f499a<_0x148361[_0xb92a('0x4b')];_0x2f499a++){var _0x2ccd0e=_0x148361[_0x2f499a][_0xb92a('0x11d')](_0xb92a('0xb2'));var _0xfd9bf8=_0x2ccd0e+_0xb92a('0xa9');socket[_0xb92a('0xaa')]('user'+_0x2ccd0e+_0xb92a('0xab'),{'UserId':_0x11dd86,['queueField']:_0x148361[_0x2f499a]['id']});}})[_0xb92a('0x27')](respondWithStatusCode(_0x51850c,null))[_0xb92a('0x1c')](APIHandleError(_0x51850c));};exports[_0xb92a('0x121')]=function(_0x5ca426,_0x3c0c0e){var _0x1eca35=_0x5ca426['params']['id'];var _0x543d33=null;if(_0x5ca426[_0xb92a('0x42')][_0xb92a('0x64')]){_0x543d33=_[_0xb92a('0xb4')](_0x5ca426['query']['ids'])?_0x5ca426['query'][_0xb92a('0x64')]:[_0x5ca426[_0xb92a('0x42')][_0xb92a('0x64')]];}var _0x561ee3=[];return Promise[_0xb92a('0x108')]()['then'](function(){if(!_0x543d33)throw new APIBadRequestError(_0xb92a('0x122'));})['then'](function(){return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x1eca35}});})[_0xb92a('0x27')](function(_0x31adfb){if(!_0x31adfb)throw new APINotFoundError(util['format'](_0xb92a('0x115'),_0x5ca426[_0xb92a('0x53')]['id']));return db[_0xb92a('0x6c')][_0xb92a('0x123')](function(_0x2905ae){return _0x31adfb[_0xb92a('0x121')](_0x543d33,{'transaction':_0x2905ae})[_0xb92a('0x27')](function(){return db[_0xb92a('0x117')]['findAll']({'where':{'id':{'$in':_0x543d33}}});})['then'](function(_0x1424ad){var _0x3d0a03=_[_0xb92a('0x34')](_0x1424ad,function(_0x2d3c39){return _0x2d3c39[_0xb92a('0x11a')]();});return Promise[_0xb92a('0x51')](_0x3d0a03);})[_0xb92a('0x27')](function(_0x1b9f67){_0x561ee3=_[_0xb92a('0x11b')](_0x1b9f67);var _0x32cf00=_[_0xb92a('0x34')](_0x561ee3,function(_0x28f5de){return _0x28f5de['removeAgent'](_0x31adfb['id'],{'transaction':_0x2905ae});});return Promise['all'](_0x32cf00);})[_0xb92a('0x27')](function(){if(!_0x31adfb['online'])return;var _0x57beb5=_[_0xb92a('0x32')](_0x561ee3,function(_0x75f6c9){return _0x75f6c9[_0xb92a('0x11d')](_0xb92a('0xb2'))===_0xb92a('0x124');});var _0x50b3de=_['map'](_0x57beb5,function(_0x532b52){return db[_0xb92a('0xb6')][_0xb92a('0x29')]({'where':{'VoiceQueueId':_0x532b52['id'],'UserId':_0x31adfb['id']},'transaction':_0x2905ae});});return Promise[_0xb92a('0x51')](_0x50b3de);})[_0xb92a('0x27')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x543d33}}});})['then'](function(_0x28bc97){var _0x3f5c9e=_[_0xb92a('0x34')](_0x28bc97,function(_0x506287){return db[_0xb92a('0x11f')][_0xb92a('0x29')]({'where':{'UserId':_0x31adfb['id'],'VoicePrefixId':_0x506287[_0xb92a('0x120')]}},{'transaction':_0x2905ae});});return Promise[_0xb92a('0x51')](_0x3f5c9e);});});})[_0xb92a('0x27')](function(){for(var _0x4ae91c=0x0;_0x4ae91c<_0x561ee3['length'];_0x4ae91c++){var _0x33e151=_0x561ee3[_0x4ae91c][_0xb92a('0x11d')](_0xb92a('0xb2'));var _0x271fc7=_0x33e151+'QueueId';socket[_0xb92a('0xaa')](_0xb92a('0x2d')+_0x33e151+_0xb92a('0xb5'),{'UserId':_0x1eca35,['queueField']:_0x561ee3[_0x4ae91c]['id']});}})['then'](respondWithStatusCode(_0x3c0c0e,null))[_0xb92a('0x1c')](APIHandleError(_0x3c0c0e));};exports[_0xb92a('0x125')]=function(_0x18fd89,_0x20b69c){var _0x1cdc3f={};var _0x121582={};var _0x2ea67f;var _0x4b2f96;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x18fd89[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x20b69c,null))[_0xb92a('0x27')](function(_0x584bdf){if(_0x584bdf){_0x2ea67f=_0x584bdf;_0x121582[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['CmList'][_0xb92a('0x57')]);_0x121582[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x18fd89[_0xb92a('0x42')]);_0x121582[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x121582[_0xb92a('0x54')],_0x121582[_0xb92a('0x42')]);_0x1cdc3f[_0xb92a('0x5a')]=_['intersection'](_0x121582[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x18fd89[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x1cdc3f[_0xb92a('0x5a')]=_0x1cdc3f['attributes'][_0xb92a('0x4b')]?_0x1cdc3f[_0xb92a('0x5a')]:_0x121582['model'];_0x1cdc3f[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x18fd89['query']['sort']);_0x1cdc3f[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x18fd89[_0xb92a('0x42')],_0x121582[_0xb92a('0x58')]));if(_0x18fd89['query'][_0xb92a('0x32')]){_0x1cdc3f['where']=_[_0xb92a('0x5d')](_0x1cdc3f[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x1cdc3f[_0xb92a('0x5a')],function(_0x5c4bcb){var _0x1dd1f3={};_0x1dd1f3[_0x5c4bcb]={'$like':'%'+_0x18fd89[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x1dd1f3;})});}_0x1cdc3f=_[_0xb92a('0x5d')]({},_0x1cdc3f,_0x18fd89[_0xb92a('0xd4')]);return _0x2ea67f[_0xb92a('0x125')](_0x1cdc3f);}})[_0xb92a('0x27')](function(_0x4c11b1){if(_0x4c11b1){_0x4b2f96=_0x4c11b1[_0xb92a('0x4b')];if(!_0x18fd89[_0xb92a('0x42')]['hasOwnProperty'](_0xb92a('0xdb'))){_0x1cdc3f[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x18fd89[_0xb92a('0x42')][_0xb92a('0x23')]);_0x1cdc3f[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x18fd89['query'][_0xb92a('0x21')]);}return _0x2ea67f[_0xb92a('0x125')](_0x1cdc3f);}})[_0xb92a('0x27')](function(_0x36b976){if(_0x36b976){return _0x36b976?{'count':_0x4b2f96,'rows':_0x36b976}:null;}})[_0xb92a('0x27')](respondWithResult(_0x20b69c,null))[_0xb92a('0x1c')](handleError(_0x20b69c,null));};exports[_0xb92a('0x126')]=function(_0x457391,_0x243923){var _0x4d522d={};var _0x5451c7={};var _0x10f797;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x457391['params']['id']}})['then'](handleEntityNotFound(_0x243923,null))[_0xb92a('0x27')](function(_0x58e70b){if(_0x58e70b){_0x10f797=_0x58e70b;_0x5451c7['model']=_['keys'](db['User']['rawAttributes']);_0x5451c7[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x457391[_0xb92a('0x42')]);_0x5451c7[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x5451c7[_0xb92a('0x54')],_0x5451c7[_0xb92a('0x42')]);_0x4d522d[_0xb92a('0x5a')]=_['intersection'](_0x5451c7[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x457391['query']['fields']));_0x4d522d[_0xb92a('0x5a')]=_0x4d522d['attributes'][_0xb92a('0x4b')]?_0x4d522d[_0xb92a('0x5a')]:_0x5451c7['model'];_0x4d522d[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x457391['query'][_0xb92a('0xd2')]);_0x4d522d[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x457391['query'],_0x5451c7['filters']));if(_0x457391['query'][_0xb92a('0x32')]){_0x4d522d[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x4d522d[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x4d522d['attributes'],function(_0x3bdedf){var _0x5e0fde={};_0x5e0fde[_0x3bdedf]={'$like':'%'+_0x457391[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x5e0fde;})});}_0x4d522d[_0xb92a('0x54')]=db[_0xb92a('0x3c')];_0x4d522d['as']=_0xb92a('0x2e');_0x4d522d=_[_0xb92a('0x5d')]({},_0x4d522d,_0x457391[_0xb92a('0xd4')]);return _0x10f797[_0xb92a('0x127')]({'include':[_0x4d522d]});}})[_0xb92a('0x27')](function(_0x307505){if(_0x307505){var _0x4c3de4={},_0x2ed6e0=[];for(var _0x472c89=0x0;_0x472c89<_0x307505['length'];_0x472c89+=0x1){for(var _0x486ee1=0x0,_0x128a91;_0x486ee1<_0x307505[_0x472c89][_0xb92a('0x2e')][_0xb92a('0x4b')];_0x486ee1+=0x1){_0x128a91=_0x307505[_0x472c89][_0xb92a('0x2e')][_0x486ee1]['get']({'plain':!![]});_0x4c3de4[_0x128a91['id']]=_0x128a91;}}_0x4c3de4=_[_0xb92a('0x128')](_0x4c3de4);for(var _0x1d9167=qs[_0xb92a('0x21')](_0x457391[_0xb92a('0x42')]['offset']);_0x1d9167<_0x4c3de4[_0xb92a('0x4b')]&&_0x2ed6e0[_0xb92a('0x4b')]<qs[_0xb92a('0x23')](_0x457391['query'][_0xb92a('0x23')]);_0x1d9167+=0x1){if(_0x4c3de4[_0x1d9167]){_0x2ed6e0[_0xb92a('0x46')](_0x4c3de4[_0x1d9167]);}}return{'count':_0x4c3de4[_0xb92a('0x4b')],'rows':_0x2ed6e0};}})[_0xb92a('0x27')](respondWithResult(_0x243923,null))['catch'](handleError(_0x243923,null));};exports[_0xb92a('0x29')]=function(_0x1b399f,_0x59dc98){if(_0x1b399f['user']['id']==_0x1b399f[_0xb92a('0x53')]['id']){return _0x59dc98[_0xb92a('0x1e')](0x1f4)[_0xb92a('0x3a')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x1b399f[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x59dc98,null))[_0xb92a('0x27')](removeEntity(_0x59dc98,null))[_0xb92a('0x1c')](handleError(_0x59dc98,null));};exports[_0xb92a('0x129')]=function(_0x10619a,_0x4c6299){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x10619a[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4c6299,null))['then'](function(_0x1cb2e5){if(_0x1cb2e5){return _0x1cb2e5['addChatInteractions'](_0x10619a['body'][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x10619a[_0xb92a('0x61')],[_0xb92a('0x64'),'id'])||{})[_0xb92a('0x12a')](function(){for(var _0x12eb91=0x0;_0x12eb91<_0x10619a[_0xb92a('0x61')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x12eb91+=0x1){socket['emit'](_0xb92a('0x12b'),{'ChatInteractionId':Number(_0x10619a[_0xb92a('0x61')]['ids'][_0x12eb91]),'UserId':Number(_0x10619a['params']['id'])});}return _0x10619a[_0xb92a('0x61')][_0xb92a('0x64')];});}})[_0xb92a('0x27')](respondWithResult(_0x4c6299,null))['catch'](handleError(_0x4c6299,null));};exports[_0xb92a('0x12c')]=function(_0x48d4a9,_0x3446ea){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x48d4a9[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x3446ea,null))['then'](function(_0x534509){if(_0x534509){return _0x534509[_0xb92a('0x12c')](_0x48d4a9[_0xb92a('0x42')][_0xb92a('0x64')])[_0xb92a('0x27')](function(){if(_[_0xb92a('0xb4')](_0x48d4a9[_0xb92a('0x42')][_0xb92a('0x64')])){for(var _0x1261b8=0x0;_0x1261b8<_0x48d4a9['query']['ids'][_0xb92a('0x4b')];_0x1261b8+=0x1){socket['emit'](_0xb92a('0x12d'),{'ChatInteractionId':Number(_0x48d4a9[_0xb92a('0x42')][_0xb92a('0x64')][_0x1261b8]),'UserId':Number(_0x48d4a9['params']['id'])});}}else{socket[_0xb92a('0xaa')](_0xb92a('0x12d'),{'ChatInteractionId':Number(_0x48d4a9['query'][_0xb92a('0x64')]),'UserId':Number(_0x48d4a9['params']['id'])});}});}})[_0xb92a('0x27')](respondWithStatusCode(_0x3446ea,null))['catch'](handleError(_0x3446ea,null));};exports[_0xb92a('0x12e')]=function(_0x595048,_0x40456e){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x595048[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x40456e,null))[_0xb92a('0x27')](function(_0x188f6f){if(_0x188f6f){return _0x188f6f[_0xb92a('0x12e')](_0x595048[_0xb92a('0x61')][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x595048[_0xb92a('0x61')],['ids','id'])||{})[_0xb92a('0x12a')](function(){for(var _0x5a465c=0x0;_0x5a465c<_0x595048[_0xb92a('0x61')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x5a465c+=0x1){socket['emit']('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x595048[_0xb92a('0x61')][_0xb92a('0x64')][_0x5a465c]),'UserId':Number(_0x595048['params']['id'])});}return _0x595048[_0xb92a('0x61')]['ids'];});}})[_0xb92a('0x27')](respondWithResult(_0x40456e,null))[_0xb92a('0x1c')](handleError(_0x40456e,null));};exports[_0xb92a('0x12f')]=function(_0x15ffdb,_0x1274ff){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x15ffdb['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x1274ff,null))['then'](function(_0x58a059){if(_0x58a059){return _0x58a059[_0xb92a('0x12f')](_0x15ffdb[_0xb92a('0x42')]['ids'])[_0xb92a('0x27')](function(){if(_[_0xb92a('0xb4')](_0x15ffdb[_0xb92a('0x42')][_0xb92a('0x64')])){for(var _0x1c3f61=0x0;_0x1c3f61<_0x15ffdb[_0xb92a('0x42')][_0xb92a('0x64')]['length'];_0x1c3f61+=0x1){socket[_0xb92a('0xaa')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x15ffdb[_0xb92a('0x42')][_0xb92a('0x64')][_0x1c3f61]),'UserId':Number(_0x15ffdb[_0xb92a('0x53')]['id'])});}}else{socket['emit'](_0xb92a('0x130'),{'MailInteractionId':Number(_0x15ffdb[_0xb92a('0x42')][_0xb92a('0x64')]),'UserId':Number(_0x15ffdb[_0xb92a('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x1274ff,null))[_0xb92a('0x1c')](handleError(_0x1274ff,null));};exports[_0xb92a('0x131')]=function(_0x31ec1e,_0x5038eb){return db['User']['find']({'where':{'id':_0x31ec1e[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x5038eb,null))[_0xb92a('0x27')](function(_0x2c898c){if(_0x2c898c){return _0x2c898c[_0xb92a('0x131')](_0x31ec1e[_0xb92a('0x61')]['ids'],_['omit'](_0x31ec1e['body'],[_0xb92a('0x64'),'id'])||{})[_0xb92a('0x12a')](function(){for(var _0x296b00=0x0;_0x296b00<_0x31ec1e[_0xb92a('0x61')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x296b00+=0x1){socket[_0xb92a('0xaa')](_0xb92a('0x132'),{'FaxInteractionId':Number(_0x31ec1e[_0xb92a('0x61')]['ids'][_0x296b00]),'UserId':Number(_0x31ec1e[_0xb92a('0x53')]['id'])});}return _0x31ec1e['body'][_0xb92a('0x64')];});}})[_0xb92a('0x27')](respondWithResult(_0x5038eb,null))['catch'](handleError(_0x5038eb,null));};exports[_0xb92a('0x133')]=function(_0x361cb4,_0x11034e){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x361cb4[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x11034e,null))[_0xb92a('0x27')](function(_0xfc0299){if(_0xfc0299){return _0xfc0299[_0xb92a('0x133')](_0x361cb4[_0xb92a('0x42')][_0xb92a('0x64')])[_0xb92a('0x27')](function(){if(_[_0xb92a('0xb4')](_0x361cb4[_0xb92a('0x42')][_0xb92a('0x64')])){for(var _0x3cbc5f=0x0;_0x3cbc5f<_0x361cb4[_0xb92a('0x42')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x3cbc5f+=0x1){socket['emit'](_0xb92a('0x134'),{'FaxInteractionId':Number(_0x361cb4[_0xb92a('0x42')][_0xb92a('0x64')][_0x3cbc5f]),'UserId':Number(_0x361cb4[_0xb92a('0x53')]['id'])});}}else{socket[_0xb92a('0xaa')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x361cb4[_0xb92a('0x42')][_0xb92a('0x64')]),'UserId':Number(_0x361cb4[_0xb92a('0x53')]['id'])});}});}})[_0xb92a('0x27')](respondWithStatusCode(_0x11034e,null))[_0xb92a('0x1c')](handleError(_0x11034e,null));};exports[_0xb92a('0x135')]=function(_0x515e11,_0x259ccc){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x515e11[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x259ccc,null))[_0xb92a('0x27')](function(_0x3ad569){if(_0x3ad569){return _0x3ad569[_0xb92a('0x135')](_0x515e11[_0xb92a('0x61')][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x515e11[_0xb92a('0x61')],['ids','id'])||{})[_0xb92a('0x12a')](function(){for(var _0x585c90=0x0;_0x585c90<_0x515e11[_0xb92a('0x61')]['ids'][_0xb92a('0x4b')];_0x585c90+=0x1){socket[_0xb92a('0xaa')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x515e11[_0xb92a('0x61')]['ids'][_0x585c90]),'UserId':Number(_0x515e11[_0xb92a('0x53')]['id'])});}return _0x515e11[_0xb92a('0x61')]['ids'];});}})['then'](respondWithResult(_0x259ccc,null))['catch'](handleError(_0x259ccc,null));};exports[_0xb92a('0x136')]=function(_0x560038,_0xe9842c){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x560038[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0xe9842c,null))['then'](function(_0x7519d6){if(_0x7519d6){return _0x7519d6[_0xb92a('0x136')](_0x560038[_0xb92a('0x42')]['ids'])[_0xb92a('0x27')](function(){if(_['isArray'](_0x560038[_0xb92a('0x42')][_0xb92a('0x64')])){for(var _0x4f87f0=0x0;_0x4f87f0<_0x560038[_0xb92a('0x42')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x4f87f0+=0x1){socket[_0xb92a('0xaa')](_0xb92a('0x137'),{'SmsInteractionId':Number(_0x560038[_0xb92a('0x42')][_0xb92a('0x64')][_0x4f87f0]),'UserId':Number(_0x560038['params']['id'])});}}else{socket[_0xb92a('0xaa')](_0xb92a('0x137'),{'SmsInteractionId':Number(_0x560038['query'][_0xb92a('0x64')]),'UserId':Number(_0x560038[_0xb92a('0x53')]['id'])});}});}})[_0xb92a('0x27')](respondWithStatusCode(_0xe9842c,null))[_0xb92a('0x1c')](handleError(_0xe9842c,null));};exports['addOpenchannelInteractions']=function(_0x32922d,_0x51a3ce){return db['User']['find']({'where':{'id':_0x32922d['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x51a3ce,null))['then'](function(_0x29754c){if(_0x29754c){return _0x29754c[_0xb92a('0x138')](_0x32922d[_0xb92a('0x61')][_0xb92a('0x64')],_['omit'](_0x32922d[_0xb92a('0x61')],[_0xb92a('0x64'),'id'])||{})[_0xb92a('0x12a')](function(){for(var _0x8b6bdd=0x0;_0x8b6bdd<_0x32922d[_0xb92a('0x61')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x8b6bdd+=0x1){socket[_0xb92a('0xaa')](_0xb92a('0x139'),{'OpenchannelInteractionId':Number(_0x32922d['body']['ids'][_0x8b6bdd]),'UserId':Number(_0x32922d[_0xb92a('0x53')]['id'])});}return _0x32922d[_0xb92a('0x61')][_0xb92a('0x64')];});}})['then'](respondWithResult(_0x51a3ce,null))[_0xb92a('0x1c')](handleError(_0x51a3ce,null));};exports[_0xb92a('0x13a')]=function(_0x7301d5,_0x541967){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x7301d5['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x541967,null))[_0xb92a('0x27')](function(_0x419170){if(_0x419170){return _0x419170['removeOpenchannelInteractions'](_0x7301d5['query']['ids'])['then'](function(){if(_[_0xb92a('0xb4')](_0x7301d5[_0xb92a('0x42')][_0xb92a('0x64')])){for(var _0x1eddb4=0x0;_0x1eddb4<_0x7301d5['query'][_0xb92a('0x64')][_0xb92a('0x4b')];_0x1eddb4+=0x1){socket[_0xb92a('0xaa')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x7301d5['query'][_0xb92a('0x64')][_0x1eddb4]),'UserId':Number(_0x7301d5[_0xb92a('0x53')]['id'])});}}else{socket[_0xb92a('0xaa')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x7301d5[_0xb92a('0x42')][_0xb92a('0x64')]),'UserId':Number(_0x7301d5[_0xb92a('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x541967,null))['catch'](handleError(_0x541967,null));};exports['addWhatsappInteractions']=function(_0x575a88,_0x5ac257){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x575a88[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x5ac257,null))[_0xb92a('0x27')](function(_0x48c583){if(_0x48c583){return _0x48c583['addWhatsappInteractions'](_0x575a88[_0xb92a('0x61')][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x575a88['body'],['ids','id'])||{})[_0xb92a('0x12a')](function(){for(var _0x2a3755=0x0;_0x2a3755<_0x575a88[_0xb92a('0x61')][_0xb92a('0x64')][_0xb92a('0x4b')];_0x2a3755+=0x1){socket[_0xb92a('0xaa')](_0xb92a('0x13b'),{'WhatsappInteractionId':Number(_0x575a88[_0xb92a('0x61')][_0xb92a('0x64')][_0x2a3755]),'UserId':Number(_0x575a88[_0xb92a('0x53')]['id'])});}return _0x575a88[_0xb92a('0x61')][_0xb92a('0x64')];});}})[_0xb92a('0x27')](respondWithResult(_0x5ac257,null))[_0xb92a('0x1c')](handleError(_0x5ac257,null));};exports[_0xb92a('0x13c')]=function(_0x3af747,_0x2aaa47){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x3af747[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x2aaa47,null))[_0xb92a('0x27')](function(_0x3b5b5b){if(_0x3b5b5b){return _0x3b5b5b[_0xb92a('0x13c')](_0x3af747[_0xb92a('0x42')][_0xb92a('0x64')]);}})[_0xb92a('0x27')](respondWithStatusCode(_0x2aaa47,null))[_0xb92a('0x1c')](handleError(_0x2aaa47,null));};exports['getVoicePrefixes']=function(_0x21d117,_0x3170d7){var _0x2731d1={};var _0x105f14={};var _0x3f3d94;var _0x55ebbc;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x21d117[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x3170d7,null))['then'](function(_0x3403ec){if(_0x3403ec){_0x3f3d94=_0x3403ec;_0x105f14[_0xb92a('0x54')]=_['keys'](db['VoicePrefix']['rawAttributes']);_0x105f14['query']=_['keys'](_0x21d117[_0xb92a('0x42')]);_0x105f14[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x105f14[_0xb92a('0x54')],_0x105f14[_0xb92a('0x42')]);_0x2731d1[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x105f14[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x21d117[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x2731d1[_0xb92a('0x5a')]=_0x2731d1[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x2731d1['attributes']:_0x105f14[_0xb92a('0x54')];_0x2731d1[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x21d117['query']['sort']);_0x2731d1[_0xb92a('0x41')]=qs['filters'](_['pick'](_0x21d117[_0xb92a('0x42')],_0x105f14[_0xb92a('0x58')]));if(_0x21d117[_0xb92a('0x42')][_0xb92a('0x32')]){_0x2731d1['where']=_[_0xb92a('0x5d')](_0x2731d1[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x2731d1[_0xb92a('0x5a')],function(_0x3c7d2f){var _0x4ccaee={};_0x4ccaee[_0x3c7d2f]={'$like':'%'+_0x21d117[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x4ccaee;})});}_0x2731d1=_[_0xb92a('0x5d')]({},_0x2731d1,_0x21d117['options']);return _0x3f3d94['getVoicePrefixes'](_0x2731d1);}})['then'](function(_0x1c2b59){if(_0x1c2b59){_0x55ebbc=_0x1c2b59['length'];if(!_0x21d117['query'][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x2731d1['limit']=qs['limit'](_0x21d117[_0xb92a('0x42')][_0xb92a('0x23')]);_0x2731d1['offset']=qs[_0xb92a('0x21')](_0x21d117['query'][_0xb92a('0x21')]);}return _0x3f3d94[_0xb92a('0x13d')](_0x2731d1);}})[_0xb92a('0x27')](function(_0x2b6fa7){if(_0x2b6fa7){return _0x2b6fa7?{'count':_0x55ebbc,'rows':_0x2b6fa7}:null;}})[_0xb92a('0x27')](respondWithResult(_0x3170d7,null))[_0xb92a('0x1c')](handleError(_0x3170d7,null));};exports[_0xb92a('0x13e')]=function(_0x12d4f4,_0x4e9e1b){var _0x18f046={};var _0x419715={};var _0x10797a;var _0x3912b9;return db['User'][_0xb92a('0xcf')]({'where':{'id':_0x12d4f4[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e9e1b,null))[_0xb92a('0x27')](function(_0x213d0b){if(_0x213d0b){_0x10797a=_0x213d0b;_0x419715[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['FaxAccount'][_0xb92a('0x57')]);_0x419715[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x12d4f4[_0xb92a('0x42')]);_0x419715[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x419715['model'],_0x419715[_0xb92a('0x42')]);_0x18f046[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x419715['model'],qs[_0xb92a('0x5b')](_0x12d4f4[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x18f046[_0xb92a('0x5a')]=_0x18f046[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x18f046[_0xb92a('0x5a')]:_0x419715[_0xb92a('0x54')];_0x18f046[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x12d4f4['query'][_0xb92a('0xd2')]);_0x18f046['where']=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x12d4f4[_0xb92a('0x42')],_0x419715[_0xb92a('0x58')]));if(_0x12d4f4['query'][_0xb92a('0x32')]){_0x18f046[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x18f046[_0xb92a('0x41')],{'$or':_['map'](_0x18f046[_0xb92a('0x5a')],function(_0xbad9ce){var _0x425420={};_0x425420[_0xbad9ce]={'$like':'%'+_0x12d4f4['query'][_0xb92a('0x32')]+'%'};return _0x425420;})});}_0x18f046=_['merge']({},_0x18f046,_0x12d4f4[_0xb92a('0xd4')]);return _0x10797a[_0xb92a('0x13e')](_0x18f046);}})[_0xb92a('0x27')](function(_0x3b8bde){if(_0x3b8bde){_0x3912b9=_0x3b8bde['length'];if(!_0x12d4f4[_0xb92a('0x42')]['hasOwnProperty'](_0xb92a('0xdb'))){_0x18f046['limit']=qs[_0xb92a('0x23')](_0x12d4f4[_0xb92a('0x42')][_0xb92a('0x23')]);_0x18f046[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x12d4f4['query'][_0xb92a('0x21')]);}return _0x10797a['getFaxAccounts'](_0x18f046);}})['then'](function(_0x3ae2e8){if(_0x3ae2e8){return _0x3ae2e8?{'count':_0x3912b9,'rows':_0x3ae2e8}:null;}})[_0xb92a('0x27')](respondWithResult(_0x4e9e1b,null))[_0xb92a('0x1c')](handleError(_0x4e9e1b,null));};exports[_0xb92a('0x13f')]=function(_0x3b1ea8,_0x3baab6){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x3b1ea8[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x3baab6,null))[_0xb92a('0x27')](function(_0x35c5d4){if(_0x35c5d4){return _0x35c5d4[_0xb92a('0x13f')](_0x3b1ea8[_0xb92a('0x61')][_0xb92a('0x64')],_['omit'](_0x3b1ea8[_0xb92a('0x61')],['ids','id'])||{});}})[_0xb92a('0x27')](respondWithResult(_0x3baab6,null))['catch'](handleError(_0x3baab6,null));};exports[_0xb92a('0x140')]=function(_0x3cff61,_0x487bfb){return db['User']['find']({'where':{'id':_0x3cff61['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x487bfb,null))[_0xb92a('0x27')](function(_0x1dfbbe){if(_0x1dfbbe){return _0x1dfbbe[_0xb92a('0x140')](_0x3cff61['query'][_0xb92a('0x64')]);}})['then'](respondWithStatusCode(_0x487bfb,null))['catch'](handleError(_0x487bfb,null));};exports[_0xb92a('0x141')]=function(_0x269cfc,_0x583de6){var _0x3b4499={};var _0x21ff81={};var _0x56bf09;var _0x3bc03a;return db['User']['findOne']({'where':{'id':_0x269cfc[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x583de6,null))[_0xb92a('0x27')](function(_0x48b207){if(_0x48b207){_0x56bf09=_0x48b207;_0x21ff81[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['MailAccount'][_0xb92a('0x57')]);_0x21ff81[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x269cfc[_0xb92a('0x42')]);_0x21ff81['filters']=_['intersection'](_0x21ff81['model'],_0x21ff81['query']);_0x3b4499[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x21ff81[_0xb92a('0x54')],qs['fields'](_0x269cfc[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x3b4499[_0xb92a('0x5a')]=_0x3b4499[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x3b4499[_0xb92a('0x5a')]:_0x21ff81[_0xb92a('0x54')];_0x3b4499[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x269cfc['query']['sort']);_0x3b4499[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_['pick'](_0x269cfc[_0xb92a('0x42')],_0x21ff81[_0xb92a('0x58')]));if(_0x269cfc[_0xb92a('0x42')][_0xb92a('0x32')]){_0x3b4499[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x3b4499[_0xb92a('0x41')],{'$or':_['map'](_0x3b4499[_0xb92a('0x5a')],function(_0x24a8cd){var _0x43e8e7={};_0x43e8e7[_0x24a8cd]={'$like':'%'+_0x269cfc[_0xb92a('0x42')]['filter']+'%'};return _0x43e8e7;})});}_0x3b4499=_[_0xb92a('0x5d')]({},_0x3b4499,_0x269cfc[_0xb92a('0xd4')]);return _0x56bf09['getMailAccounts'](_0x3b4499);}})[_0xb92a('0x27')](function(_0x16b4f4){if(_0x16b4f4){_0x3bc03a=_0x16b4f4['length'];if(!_0x269cfc[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x3b4499[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x269cfc[_0xb92a('0x42')][_0xb92a('0x23')]);_0x3b4499[_0xb92a('0x21')]=qs['offset'](_0x269cfc[_0xb92a('0x42')]['offset']);}return _0x56bf09[_0xb92a('0x141')](_0x3b4499);}})[_0xb92a('0x27')](function(_0x5634ab){if(_0x5634ab){return _0x5634ab?{'count':_0x3bc03a,'rows':_0x5634ab}:null;}})[_0xb92a('0x27')](respondWithResult(_0x583de6,null))[_0xb92a('0x1c')](handleError(_0x583de6,null));};exports['addMailAccounts']=function(_0x421601,_0x23e3be){return db['User'][_0xb92a('0x35')]({'where':{'id':_0x421601[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x23e3be,null))[_0xb92a('0x27')](function(_0x3e8a97){if(_0x3e8a97){return _0x3e8a97[_0xb92a('0x142')](_0x421601[_0xb92a('0x61')][_0xb92a('0x64')],_[_0xb92a('0x65')](_0x421601[_0xb92a('0x61')],[_0xb92a('0x64'),'id'])||{});}})['then'](respondWithResult(_0x23e3be,null))[_0xb92a('0x1c')](handleError(_0x23e3be,null));};exports['removeMailAccounts']=function(_0x234c00,_0x23fe57){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x234c00['params']['id']}})['then'](handleEntityNotFound(_0x23fe57,null))['then'](function(_0x418037){if(_0x418037){return _0x418037[_0xb92a('0x143')](_0x234c00[_0xb92a('0x42')][_0xb92a('0x64')]);}})['then'](respondWithStatusCode(_0x23fe57,null))['catch'](handleError(_0x23fe57,null));};exports[_0xb92a('0x144')]=function(_0x79f68f,_0x250b58){var _0x863ab0={};var _0x41299b={};var _0x4abf17;var _0x1a289f;return db['User']['findOne']({'where':{'id':_0x79f68f['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x250b58,null))[_0xb92a('0x27')](function(_0x28afa3){if(_0x28afa3){_0x4abf17=_0x28afa3;_0x41299b[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0x145')]['rawAttributes']);_0x41299b[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x79f68f[_0xb92a('0x42')]);_0x41299b[_0xb92a('0x58')]=_['intersection'](_0x41299b['model'],_0x41299b[_0xb92a('0x42')]);_0x863ab0[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x41299b[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x79f68f['query'][_0xb92a('0x5b')]));_0x863ab0[_0xb92a('0x5a')]=_0x863ab0[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x863ab0[_0xb92a('0x5a')]:_0x41299b['model'];_0x863ab0[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x79f68f[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x863ab0[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x79f68f[_0xb92a('0x42')],_0x41299b[_0xb92a('0x58')]));if(_0x79f68f[_0xb92a('0x42')][_0xb92a('0x32')]){_0x863ab0[_0xb92a('0x41')]=_['merge'](_0x863ab0['where'],{'$or':_['map'](_0x863ab0[_0xb92a('0x5a')],function(_0x4f6458){var _0x57624f={};_0x57624f[_0x4f6458]={'$like':'%'+_0x79f68f[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x57624f;})});}_0x863ab0=_[_0xb92a('0x5d')]({},_0x863ab0,_0x79f68f['options']);return _0x4abf17[_0xb92a('0x144')](_0x863ab0);}})[_0xb92a('0x27')](function(_0x2a979d){if(_0x2a979d){_0x1a289f=_0x2a979d[_0xb92a('0x4b')];if(!_0x79f68f[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x863ab0['limit']=qs['limit'](_0x79f68f[_0xb92a('0x42')][_0xb92a('0x23')]);_0x863ab0[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x79f68f[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x4abf17['getOpenchannelAccounts'](_0x863ab0);}})[_0xb92a('0x27')](function(_0x53b739){if(_0x53b739){return _0x53b739?{'count':_0x1a289f,'rows':_0x53b739}:null;}})[_0xb92a('0x27')](respondWithResult(_0x250b58,null))[_0xb92a('0x1c')](handleError(_0x250b58,null));};exports['addOpenchannelAccounts']=function(_0x1b2dc7,_0x5d2089){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x1b2dc7['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x5d2089,null))['then'](function(_0x32f968){if(_0x32f968){return _0x32f968[_0xb92a('0x146')](_0x1b2dc7[_0xb92a('0x61')]['ids'],_[_0xb92a('0x65')](_0x1b2dc7['body'],[_0xb92a('0x64'),'id'])||{});}})['then'](respondWithResult(_0x5d2089,null))[_0xb92a('0x1c')](handleError(_0x5d2089,null));};exports[_0xb92a('0x147')]=function(_0x2cec26,_0x386b72){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x2cec26[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x386b72,null))[_0xb92a('0x27')](function(_0xc77cd2){if(_0xc77cd2){return _0xc77cd2['removeOpenchannelAccounts'](_0x2cec26[_0xb92a('0x42')][_0xb92a('0x64')]);}})[_0xb92a('0x27')](respondWithStatusCode(_0x386b72,null))[_0xb92a('0x1c')](handleError(_0x386b72,null));};exports[_0xb92a('0x148')]=function(_0xfc2e3,_0x2b8d22){var _0x49c906={};var _0x57f4a2={};var _0x358cf7;var _0x2a30d9;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0xfc2e3[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b8d22,null))['then'](function(_0x4b4301){if(_0x4b4301){_0x358cf7=_0x4b4301;_0x57f4a2[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0x149')][_0xb92a('0x57')]);_0x57f4a2['query']=_[_0xb92a('0x56')](_0xfc2e3['query']);_0x57f4a2[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x57f4a2[_0xb92a('0x54')],_0x57f4a2['query']);_0x49c906[_0xb92a('0x5a')]=_['intersection'](_0x57f4a2['model'],qs['fields'](_0xfc2e3[_0xb92a('0x42')]['fields']));_0x49c906[_0xb92a('0x5a')]=_0x49c906[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x49c906[_0xb92a('0x5a')]:_0x57f4a2[_0xb92a('0x54')];_0x49c906[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0xfc2e3[_0xb92a('0x42')][_0xb92a('0xd2')]);_0x49c906[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0xfc2e3[_0xb92a('0x42')],_0x57f4a2[_0xb92a('0x58')]));if(_0xfc2e3[_0xb92a('0x42')][_0xb92a('0x32')]){_0x49c906[_0xb92a('0x41')]=_[_0xb92a('0x5d')](_0x49c906[_0xb92a('0x41')],{'$or':_[_0xb92a('0x34')](_0x49c906[_0xb92a('0x5a')],function(_0x3308ba){var _0x3ac075={};_0x3ac075[_0x3308ba]={'$like':'%'+_0xfc2e3[_0xb92a('0x42')]['filter']+'%'};return _0x3ac075;})});}_0x49c906=_[_0xb92a('0x5d')]({},_0x49c906,_0xfc2e3[_0xb92a('0xd4')]);return _0x358cf7[_0xb92a('0x148')](_0x49c906);}})[_0xb92a('0x27')](function(_0x35e2b6){if(_0x35e2b6){_0x2a30d9=_0x35e2b6[_0xb92a('0x4b')];if(!_0xfc2e3[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x49c906['limit']=qs[_0xb92a('0x23')](_0xfc2e3[_0xb92a('0x42')][_0xb92a('0x23')]);_0x49c906[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0xfc2e3[_0xb92a('0x42')][_0xb92a('0x21')]);}return _0x358cf7[_0xb92a('0x148')](_0x49c906);}})[_0xb92a('0x27')](function(_0x13cdf8){if(_0x13cdf8){return _0x13cdf8?{'count':_0x2a30d9,'rows':_0x13cdf8}:null;}})[_0xb92a('0x27')](respondWithResult(_0x2b8d22,null))[_0xb92a('0x1c')](handleError(_0x2b8d22,null));};exports['addSmsAccounts']=function(_0x5428d3,_0x146bfd){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x5428d3['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x146bfd,null))['then'](function(_0x7b1642){if(_0x7b1642){return _0x7b1642[_0xb92a('0x14a')](_0x5428d3[_0xb92a('0x61')]['ids'],_['omit'](_0x5428d3[_0xb92a('0x61')],[_0xb92a('0x64'),'id'])||{});}})[_0xb92a('0x27')](respondWithResult(_0x146bfd,null))[_0xb92a('0x1c')](handleError(_0x146bfd,null));};exports[_0xb92a('0x14b')]=function(_0x15e2f3,_0x4cd77f){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x15e2f3['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x4cd77f,null))[_0xb92a('0x27')](function(_0x47995c){if(_0x47995c){return _0x47995c[_0xb92a('0x14b')](_0x15e2f3[_0xb92a('0x42')][_0xb92a('0x64')]);}})[_0xb92a('0x27')](respondWithStatusCode(_0x4cd77f,null))[_0xb92a('0x1c')](handleError(_0x4cd77f,null));};exports[_0xb92a('0x14c')]=function(_0x2bc07e,_0x3fac82){var _0x4cc456={};var _0x52faec={};var _0x28fbb7;var _0x5b0cf9;return db[_0xb92a('0x3c')]['findOne']({'where':{'id':_0x2bc07e[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x3fac82,null))[_0xb92a('0x27')](function(_0x55138e){if(_0x55138e){_0x28fbb7=_0x55138e;_0x52faec[_0xb92a('0x54')]=_[_0xb92a('0x56')](db['ChatWebsite'][_0xb92a('0x57')]);_0x52faec[_0xb92a('0x42')]=_['keys'](_0x2bc07e[_0xb92a('0x42')]);_0x52faec[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x52faec[_0xb92a('0x54')],_0x52faec[_0xb92a('0x42')]);_0x4cc456[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x52faec['model'],qs['fields'](_0x2bc07e[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x4cc456[_0xb92a('0x5a')]=_0x4cc456[_0xb92a('0x5a')]['length']?_0x4cc456['attributes']:_0x52faec[_0xb92a('0x54')];_0x4cc456[_0xb92a('0xd1')]=qs['sort'](_0x2bc07e['query'][_0xb92a('0xd2')]);_0x4cc456['where']=qs[_0xb92a('0x58')](_['pick'](_0x2bc07e[_0xb92a('0x42')],_0x52faec['filters']));if(_0x2bc07e['query'][_0xb92a('0x32')]){_0x4cc456['where']=_[_0xb92a('0x5d')](_0x4cc456[_0xb92a('0x41')],{'$or':_['map'](_0x4cc456[_0xb92a('0x5a')],function(_0x20897c){var _0x356cee={};_0x356cee[_0x20897c]={'$like':'%'+_0x2bc07e[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x356cee;})});}_0x4cc456=_[_0xb92a('0x5d')]({},_0x4cc456,_0x2bc07e['options']);return _0x28fbb7[_0xb92a('0x14c')](_0x4cc456);}})['then'](function(_0x1597a4){if(_0x1597a4){_0x5b0cf9=_0x1597a4[_0xb92a('0x4b')];if(!_0x2bc07e[_0xb92a('0x42')]['hasOwnProperty'](_0xb92a('0xdb'))){_0x4cc456[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x2bc07e['query'][_0xb92a('0x23')]);_0x4cc456[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x2bc07e[_0xb92a('0x42')]['offset']);}return _0x28fbb7[_0xb92a('0x14c')](_0x4cc456);}})['then'](function(_0x3c411c){if(_0x3c411c){return _0x3c411c?{'count':_0x5b0cf9,'rows':_0x3c411c}:null;}})[_0xb92a('0x27')](respondWithResult(_0x3fac82,null))[_0xb92a('0x1c')](handleError(_0x3fac82,null));};exports['addChatWebsites']=function(_0x307c98,_0x10f4e6){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x307c98[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x10f4e6,null))[_0xb92a('0x27')](function(_0x1cd43c){if(_0x1cd43c){return _0x1cd43c['addChatWebsites'](_0x307c98[_0xb92a('0x61')][_0xb92a('0x64')],_['omit'](_0x307c98[_0xb92a('0x61')],[_0xb92a('0x64'),'id'])||{});}})[_0xb92a('0x27')](respondWithResult(_0x10f4e6,null))[_0xb92a('0x1c')](handleError(_0x10f4e6,null));};exports[_0xb92a('0x14d')]=function(_0x4a3954,_0x540d81){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x4a3954['params']['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x540d81,null))[_0xb92a('0x27')](function(_0x4d93e8){if(_0x4d93e8){return _0x4d93e8[_0xb92a('0x14d')](_0x4a3954[_0xb92a('0x42')][_0xb92a('0x64')]);}})['then'](respondWithStatusCode(_0x540d81,null))['catch'](handleError(_0x540d81,null));};exports['getWhatsappAccounts']=function(_0x1442db,_0x26dc56){var _0x5b5500={};var _0x434d56={};var _0x1d31db;var _0x277651;return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x1442db[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x26dc56,null))[_0xb92a('0x27')](function(_0x2dc6e0){if(_0x2dc6e0){_0x1d31db=_0x2dc6e0;_0x434d56[_0xb92a('0x54')]=_[_0xb92a('0x56')](db[_0xb92a('0x14e')]['rawAttributes']);_0x434d56['query']=_[_0xb92a('0x56')](_0x1442db[_0xb92a('0x42')]);_0x434d56[_0xb92a('0x58')]=_[_0xb92a('0x59')](_0x434d56[_0xb92a('0x54')],_0x434d56[_0xb92a('0x42')]);_0x5b5500[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x434d56[_0xb92a('0x54')],qs['fields'](_0x1442db[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x5b5500[_0xb92a('0x5a')]=_0x5b5500[_0xb92a('0x5a')][_0xb92a('0x4b')]?_0x5b5500[_0xb92a('0x5a')]:_0x434d56['model'];_0x5b5500[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x1442db['query'][_0xb92a('0xd2')]);_0x5b5500[_0xb92a('0x41')]=qs[_0xb92a('0x58')](_[_0xb92a('0xd3')](_0x1442db[_0xb92a('0x42')],_0x434d56['filters']));if(_0x1442db[_0xb92a('0x42')][_0xb92a('0x32')]){_0x5b5500['where']=_[_0xb92a('0x5d')](_0x5b5500[_0xb92a('0x41')],{'$or':_['map'](_0x5b5500[_0xb92a('0x5a')],function(_0x45ad4a){var _0x449620={};_0x449620[_0x45ad4a]={'$like':'%'+_0x1442db['query'][_0xb92a('0x32')]+'%'};return _0x449620;})});}_0x5b5500=_[_0xb92a('0x5d')]({},_0x5b5500,_0x1442db[_0xb92a('0xd4')]);return _0x1d31db['getWhatsappAccounts'](_0x5b5500);}})[_0xb92a('0x27')](function(_0x12a3e8){if(_0x12a3e8){_0x277651=_0x12a3e8[_0xb92a('0x4b')];if(!_0x1442db[_0xb92a('0x42')][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x5b5500[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x1442db[_0xb92a('0x42')][_0xb92a('0x23')]);_0x5b5500[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x1442db[_0xb92a('0x42')]['offset']);}return _0x1d31db[_0xb92a('0x14f')](_0x5b5500);}})[_0xb92a('0x27')](function(_0x199468){if(_0x199468){return _0x199468?{'count':_0x277651,'rows':_0x199468}:null;}})[_0xb92a('0x27')](respondWithResult(_0x26dc56,null))[_0xb92a('0x1c')](handleError(_0x26dc56,null));};exports[_0xb92a('0x150')]=function(_0x369b0f,_0x17e8bb){return db['User'][_0xb92a('0x35')]({'where':{'id':_0x369b0f[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x17e8bb,null))['then'](function(_0x534912){if(_0x534912){return _0x534912['addWhatsappAccounts'](_0x369b0f[_0xb92a('0x61')]['ids'],_[_0xb92a('0x65')](_0x369b0f['body'],[_0xb92a('0x64'),'id'])||{});}})[_0xb92a('0x27')](respondWithResult(_0x17e8bb,null))[_0xb92a('0x1c')](handleError(_0x17e8bb,null));};exports[_0xb92a('0x151')]=function(_0x52de3a,_0x467fa6){return db[_0xb92a('0x3c')]['find']({'where':{'id':_0x52de3a[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](handleEntityNotFound(_0x467fa6,null))[_0xb92a('0x27')](function(_0x1761b8){if(_0x1761b8){return _0x1761b8[_0xb92a('0x151')](_0x52de3a['query'][_0xb92a('0x64')]);}})[_0xb92a('0x27')](respondWithStatusCode(_0x467fa6,null))['catch'](handleError(_0x467fa6,null));};exports[_0xb92a('0x152')]=function(_0x270c84,_0x23867c){var _0x1ad135={},_0x1059b2={},_0x1409eb={'count':0x0,'rows':[]};var _0x14491e=db[_0xb92a('0x153')][_0xb92a('0x57')];_0x1059b2['model']=_[_0xb92a('0x56')](_0x14491e);_0x1059b2[_0xb92a('0x42')]=_[_0xb92a('0x56')](_0x270c84[_0xb92a('0x42')]);_0x1059b2['filters']=_[_0xb92a('0x59')](_0x1059b2['model'],_0x1059b2['query']);_0x1059b2[_0xb92a('0x58')]=_[_0xb92a('0xcd')](_0x1059b2['filters'],[_0xb92a('0x154'),'$or',_0xb92a('0x155'),_0xb92a('0x156'),_0xb92a('0x157'),'$lte',_0xb92a('0x158'),_0xb92a('0x159'),'$not','$between','$notBetween',_0xb92a('0x15a'),_0xb92a('0x15b'),_0xb92a('0x15c'),_0xb92a('0x15d'),'$iLike',_0xb92a('0x15e'),_0xb92a('0x15c'),_0xb92a('0x15f'),_0xb92a('0x160'),_0xb92a('0x161'),_0xb92a('0x162')]);_0x1ad135[_0xb92a('0x5a')]=_[_0xb92a('0x59')](_0x1059b2[_0xb92a('0x54')],qs[_0xb92a('0x5b')](_0x270c84[_0xb92a('0x42')][_0xb92a('0x5b')]));_0x1ad135[_0xb92a('0x5a')]=_0x1ad135[_0xb92a('0x5a')]['length']?_0x1ad135[_0xb92a('0x5a')]:_0x1059b2[_0xb92a('0x54')];if(!_0x270c84[_0xb92a('0x42')][_0xb92a('0xd5')]('nolimit')){_0x1ad135[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0x270c84[_0xb92a('0x42')][_0xb92a('0x23')]);_0x1ad135[_0xb92a('0x21')]=qs[_0xb92a('0x21')](_0x270c84[_0xb92a('0x42')][_0xb92a('0x21')]);}_0x1ad135[_0xb92a('0xd1')]=qs[_0xb92a('0xd2')](_0x270c84[_0xb92a('0x42')]['sort']);_0x1ad135[_0xb92a('0x41')]=qs['filters'](_[_0xb92a('0xd3')](_0x270c84['query'],_0x1059b2['filters']));if(_0x270c84[_0xb92a('0x42')]['filter']){_0x1ad135['where']=_['merge'](_0x1ad135[_0xb92a('0x41')],{'$or':_['map'](_0x1ad135['attributes'],function(_0x4b7159){var _0x10ed95={};_0x10ed95[_0x4b7159]={'$like':'%'+_0x270c84[_0xb92a('0x42')][_0xb92a('0x32')]+'%'};return _0x10ed95;})});}_0x1ad135[_0xb92a('0x41')]={'$and':[_0x1ad135[_0xb92a('0x41')],{'$or':[{'UserId':_0x270c84[_0xb92a('0x53')]['id']},{'OwnerId':_0x270c84[_0xb92a('0x53')]['id']}]}]};_0x1ad135=_[_0xb92a('0x5d')]({},_0x1ad135,_0x270c84[_0xb92a('0xd4')]);var _0x3d38ee={'where':_0x1ad135['where']};return db[_0xb92a('0x153')][_0xb92a('0x24')](_0x3d38ee)['then'](function(_0x1d4bff){_0x1409eb[_0xb92a('0x24')]=_0x1d4bff;if(_0x270c84[_0xb92a('0x42')][_0xb92a('0x43')]){_0x1ad135[_0xb92a('0x5c')]=[{'attributes':['id',_0xb92a('0x163'),_0xb92a('0x164'),_0xb92a('0xf0')],'model':db[_0xb92a('0xd0')],'as':_0xb92a('0x165')},{'attributes':['id','name',_0xb92a('0x166')],'model':db[_0xb92a('0xac')],'as':_0xb92a('0xdc')}];}return db[_0xb92a('0x153')][_0xb92a('0x47')](_0x1ad135);})[_0xb92a('0x27')](function(_0x4cc4e9){_0x1409eb[_0xb92a('0x48')]=_0x4cc4e9;return _0x1409eb;})[_0xb92a('0x27')](respondWithFilteredResult(_0x23867c,_0x1ad135))['catch'](handleError(_0x23867c,null));};exports[_0xb92a('0x167')]=function(_0x1c882c,_0x4b7bbe){if(!_[_0xb92a('0x70')](_0x1c882c[_0xb92a('0x2d')]['id'])&&(_0x1c882c[_0xb92a('0x2d')][_0xb92a('0x28')]==_0xb92a('0x2b')||_0x1c882c['user'][_0xb92a('0x28')]==_0xb92a('0x2d'))){return db[_0xb92a('0x3c')][_0xb92a('0xcf')]({'where':{'id':_0x1c882c[_0xb92a('0x53')]['id']},'raw':!![]})[_0xb92a('0x27')](function(_0x2edd29){return authService[_0xb92a('0x168')](_0x2edd29);})[_0xb92a('0x27')](function(_0x3e6af1){if(_0x3e6af1){return _0x4b7bbe[_0xb92a('0x1e')](0xc8)[_0xb92a('0x20')]({'api_key':_0x3e6af1['token']});}else{return _0x4b7bbe[_0xb92a('0x1e')](0xcc)[_0xb92a('0x20')]({'message':_0xb92a('0x169')});}})['catch'](handleError(_0x4b7bbe,0x193));}else{return _0x4b7bbe['status'](0x191)[_0xb92a('0x20')]({'message':_0xb92a('0x16a')});}};exports[_0xb92a('0x16b')]=function(_0x3c16ba,_0x2dc01c){if(!_[_0xb92a('0x70')](_0x3c16ba['user']['id'])&&(_0x3c16ba[_0xb92a('0x2d')][_0xb92a('0x28')]==_0xb92a('0x2b')||_0x3c16ba[_0xb92a('0x2d')][_0xb92a('0x28')]==_0xb92a('0x2d'))){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x3c16ba[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](function(_0xa7b104){return authService[_0xb92a('0x16c')](_0xa7b104);})[_0xb92a('0x27')](function(_0x1293d9){return db[_0xb92a('0x3c')][_0xb92a('0x60')]({'apiKeyIat':_0x1293d9['iat'],'apiKeyNonce':_0x1293d9[_0xb92a('0x16d')]},{'where':{'id':_0x3c16ba[_0xb92a('0x53')]['id']}})[_0xb92a('0x27')](function(){return _0x2dc01c[_0xb92a('0x1e')](0xc8)[_0xb92a('0x20')]({'api_key':_0x1293d9['token']});});})[_0xb92a('0x1c')](handleError(_0x2dc01c,0x193));}else{return _0x2dc01c[_0xb92a('0x1e')](0x191)[_0xb92a('0x20')]({'message':_0xb92a('0x16a')});}};exports[_0xb92a('0x16e')]=function(_0x348c9b,_0x485a3d){if(!_['isNil'](_0x348c9b[_0xb92a('0x2d')]['id'])&&(_0x348c9b[_0xb92a('0x2d')]['role']==_0xb92a('0x2b')||_0x348c9b[_0xb92a('0x2d')]['role']==_0xb92a('0x2d'))){return db[_0xb92a('0x3c')][_0xb92a('0x35')]({'where':{'id':_0x348c9b[_0xb92a('0x53')]['id']}})['then'](handleEntityNotFound(_0x485a3d,null))[_0xb92a('0x27')](function(_0xafc566){if(_0xafc566&&_0xafc566['apiKeyNonce']&&_0xafc566[_0xb92a('0x16f')])return _0xafc566;else throw{'message':_0xb92a('0x170')};})[_0xb92a('0x27')](function(){return db[_0xb92a('0x3c')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x348c9b[_0xb92a('0x53')]['id']}});})[_0xb92a('0x27')](respondWithStatusCode(_0x485a3d,0xc8))[_0xb92a('0x1c')](handleError(_0x485a3d,0x193));}else{return _0x485a3d[_0xb92a('0x1e')](0x191)[_0xb92a('0x20')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xb92a('0x171')]=function(_0x191614,_0x4dfa1e){var _0x1ceb72=_0x191614[_0xb92a('0x2d')][_0xb92a('0x2a')]({'plain':!![]});if(!_0x1ceb72){return _0x4dfa1e[_0xb92a('0x1e')](0x191)['send'](_0xb92a('0x172'));}else{Promise[_0xb92a('0x108')]()[_0xb92a('0x27')](function(){if(_0x191614['query'][_0xb92a('0x45')]!=='true')return;return _0x191614[_0xb92a('0x2d')][_0xb92a('0x173')]();})[_0xb92a('0x27')](function(_0xff8f8){if(!_0xff8f8)return;return _0xff8f8[_0xb92a('0x2a')]({'plain':!![]});})[_0xb92a('0x27')](function(_0xd01ac9){_0x1ceb72[_0xb92a('0x45')]=_0xd01ac9;return _0x4dfa1e[_0xb92a('0x1e')](0xc8)[_0xb92a('0x20')](_0x1ceb72);});}};exports['getPresence']=function(_0xabc7a,_0x5b52a6){var _0x5b0d33={'offset':0x0},_0x51a4db={'count':0x0,'rows':[]};Promise[_0xb92a('0x108')]()[_0xb92a('0x27')](function(){if(!_0xabc7a[_0xb92a('0x42')][_0xb92a('0x32')]&&!_0xabc7a['query']['teams']&&!_0xabc7a[_0xb92a('0x42')][_0xb92a('0x174')])return[];return Promise['resolve']()['then'](function(){var _0xb83610=[];if(!_[_0xb92a('0x8e')](_0xabc7a['query'][_0xb92a('0x175')])){_0xb83610[_0xb92a('0x46')](db[_0xb92a('0x117')][_0xb92a('0x47')]({'attributes':['id',_0xb92a('0x37')],'where':{'id':_0xabc7a[_0xb92a('0x42')]['teams']}}));}if(!_[_0xb92a('0x8e')](_0xabc7a[_0xb92a('0x42')][_0xb92a('0x174')])){_0xb83610['push'](db[_0xb92a('0xac')][_0xb92a('0x47')]({'attributes':['id',_0xb92a('0x37')],'type':_0xb92a('0x176'),'where':{'id':_0xabc7a[_0xb92a('0x42')][_0xb92a('0x174')]}}));}return Promise[_0xb92a('0x51')](_0xb83610);})[_0xb92a('0x27')](function(_0x14a027){var _0x409d88=_[_0xb92a('0x177')](_0x14a027)[_0xb92a('0x34')](function(_0x3e2fd1){return _0x3e2fd1['getAgents']({'attributes':['id',_0xb92a('0x37'),_0xb92a('0x66'),_0xb92a('0x9f')],'raw':!![]});});return Promise[_0xb92a('0x51')](_0x409d88);})['then'](function(_0x24f8e6){var _0x115e96=_[_0xb92a('0x177')](_0x24f8e6);if(!_0xabc7a[_0xb92a('0x42')][_0xb92a('0x32')])return _0x115e96;if(_['isEmpty'](_0x115e96)){return db['User']['findAll']({'attributes':['id',_0xb92a('0x37'),_0xb92a('0x66'),_0xb92a('0x9f')],'where':{'role':_0xb92a('0x2f'),'$or':[db[_0xb92a('0x6c')][_0xb92a('0x41')](db[_0xb92a('0x6c')]['fn'](_0xb92a('0x178'),db[_0xb92a('0x6c')][_0xb92a('0x179')](_0xb92a('0x37'))),{'$like':'%'+_0xabc7a[_0xb92a('0x42')][_0xb92a('0x32')][_0xb92a('0xa7')]()+'%'}),{'internal':{'$like':'%'+_0xabc7a['query']['filter']+'%'}}]},'raw':!![]});}else{return _(_0x115e96)[_0xb92a('0x177')]()[_0xb92a('0x32')](function(_0x435efc){return _0x435efc[_0xb92a('0x37')]['toLowerCase']()[_0xb92a('0x3f')](_0xabc7a['query'][_0xb92a('0x32')]['toLowerCase']())||_0x435efc[_0xb92a('0x66')][_0xb92a('0x17a')]()[_0xb92a('0x3f')](_0xabc7a[_0xb92a('0x42')][_0xb92a('0x32')]);})['value']();}})[_0xb92a('0x27')](function(_0x162514){var _0xa2bd92=_0xb92a('0x37');var _0x22d957=_0xb92a('0x17b');if(_0xabc7a[_0xb92a('0x42')][_0xb92a('0xd2')]){_0x22d957=_0xabc7a[_0xb92a('0x42')]['sort'][0x0]==='-'?_0xb92a('0x17c'):_0xb92a('0x17b');_0xa2bd92=_0x22d957===_0xb92a('0x17b')?_0xabc7a[_0xb92a('0x42')][_0xb92a('0xd2')]:_0xabc7a[_0xb92a('0x42')][_0xb92a('0xd2')][_0xb92a('0x17d')](0x1);}return _(_0x162514)[_0xb92a('0x17e')]('id')[_0xb92a('0x17f')]([function(_0x40ef85){return _0xa2bd92===_0xb92a('0x37')?_0x40ef85[_0xa2bd92][_0xb92a('0xa7')]():_0x40ef85[_0xa2bd92];}],[_0x22d957])[_0xb92a('0x34')](function(_0x1fa94a){return _['pick'](_0x1fa94a,['id',_0xb92a('0x37'),_0xb92a('0x66'),_0xb92a('0x9f')]);})[_0xb92a('0x36')]();})[_0xb92a('0x27')](function(_0x5a4a4a){return amiClient[_0xb92a('0x180')](_0xb92a('0x2e'),_0xabc7a)[_0xb92a('0x27')](function(_0x200813){if(_0x200813['error'])throw new Error(_0xb92a('0x181'));var _0x2f6e8b=_0x200813['result'];var _0x1163e7=jayson[_0xb92a('0x12')]['http']({'port':0x232c});return _0x1163e7['request'](_0xb92a('0x2e'),_0xabc7a)['then'](function(_0x2f2b60){if(_0x2f2b60['error'])throw new Error(_0xb92a('0x182'));var _0x1d3dba=_0x2f2b60[_0xb92a('0x1b')];return _[_0xb92a('0x5d')]({},_0x1d3dba,_0x2f6e8b);});})['then'](function(_0x1422ba){return _[_0xb92a('0x34')](_0x5a4a4a,function(_0x2183ab){var _0x29f14f=_[_0xb92a('0x35')](_0x1422ba[_0xb92a('0x48')],['id',_0x2183ab['id']]);if(!_0x29f14f||!_0x2183ab[_0xb92a('0x9f')]){_0x2183ab[_0xb92a('0x1e')]=_0xb92a('0x183');}else if(_0x29f14f['voicePause']){_0x2183ab[_0xb92a('0x1e')]='pause';}else{_0x2183ab['status']=_['includes']([_0xb92a('0x184'),_0xb92a('0x185'),_0xb92a('0x186'),'ringing',null,undefined],_0x29f14f['voiceStatus'])?'online':_0xb92a('0x187');}return _0x2183ab;});});});})[_0xb92a('0x27')](function(_0x1f531d){if(!_0xabc7a['query'][_0xb92a('0xd5')](_0xb92a('0xdb'))){_0x5b0d33[_0xb92a('0x23')]=qs[_0xb92a('0x23')](_0xabc7a[_0xb92a('0x42')][_0xb92a('0x23')]||0xa);_0x5b0d33[_0xb92a('0x21')]=qs['offset'](_0xabc7a[_0xb92a('0x42')][_0xb92a('0x21')]);}_0x51a4db[_0xb92a('0x24')]=_0x1f531d[_0xb92a('0x4b')];_0x51a4db[_0xb92a('0x48')]=_0x5b0d33['limit']?_0x1f531d[_0xb92a('0x188')](_0x5b0d33[_0xb92a('0x21')],_0x5b0d33['offset']+_0x5b0d33[_0xb92a('0x23')]):_0x1f531d;return _0x51a4db;})[_0xb92a('0x27')](respondWithFilteredResult(_0x5b52a6,_0x5b0d33))[_0xb92a('0x1c')](handleError(_0x5b52a6,null));};function get_open_tabs(_0x55b1a6,_0x26d672){var _0x27f086=_0x55b1a6['charAt'](0x0)['toUpperCase']()+_0x55b1a6[_0xb92a('0x188')](0x1);var _0x55ad61={'type':db['Sequelize'][_0xb92a('0x6d')][_0xb92a('0x6e')],'raw':!![]};return new Promise(function(_0x4960f3,_0x1782c7){var _0x21193a=squel[_0xb92a('0x189')]()[_0xb92a('0x18a')]('ui.'+_0x27f086+_0xb92a('0x18b'),'id')[_0xb92a('0x18a')](_0xb92a('0x18c'))[_0xb92a('0x6f')](_0xb92a('0x18d')+_0x55b1a6+_0xb92a('0x18e'),'ui')['where']('ui.UserId\x20=\x20?',_0x26d672['id']);return db[_0xb92a('0x6c')][_0xb92a('0x42')](_0x21193a['toString'](),_0x55ad61)['then'](function(_0x285953){_0x26d672[_0x27f086+'OpenTabs']=_0x285953;_0x4960f3(_0x285953);})['catch'](function(_0x26af44){_0x1782c7(_0x26af44);});});}
\ No newline at end of file
index 4a47443..f3b0e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x939a=['save','update','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x3a1475,_0x287000){var _0x32e375=function(_0xc5ea2d){while(--_0xc5ea2d){_0x3a1475['push'](_0x3a1475['shift']());}};_0x32e375(++_0x287000);}(_0x939a,0x1a9));var _0xa939=function(_0x3ae9d9,_0x3d7829){_0x3ae9d9=_0x3ae9d9-0x0;var _0x54bb92=_0x939a[_0x3ae9d9];return _0x54bb92;};'use strict';var EventEmitter=require(_0xa939('0x0'));var User=require('../../mysqldb')['db']['User'];var UserEvents=new EventEmitter();UserEvents[_0xa939('0x1')](0x0);var events={'afterCreate':_0xa939('0x2'),'afterUpdate':_0xa939('0x3'),'afterDestroy':'remove'};function emitEvent(_0x39a507){return function(_0x4919b0,_0x2a60dd,_0xfece6b){UserEvents[_0xa939('0x4')](_0x39a507+':'+_0x4919b0['id'],_0x4919b0);UserEvents[_0xa939('0x4')](_0x39a507,_0x4919b0);_0xfece6b(null);};}for(var e in events){if(events[_0xa939('0x5')](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0xa939('0x6')]=UserEvents;
\ No newline at end of file
+var _0x49da=['../../mysqldb','User','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1c3be5,_0x43a6ae){var _0x57b3a5=function(_0x5e5f3d){while(--_0x5e5f3d){_0x1c3be5['push'](_0x1c3be5['shift']());}};_0x57b3a5(++_0x43a6ae);}(_0x49da,0x1b7));var _0xa49d=function(_0x48e0c9,_0xed9d7f){_0x48e0c9=_0x48e0c9-0x0;var _0x1fd1af=_0x49da[_0x48e0c9];return _0x1fd1af;};'use strict';var EventEmitter=require(_0xa49d('0x0'));var User=require(_0xa49d('0x1'))['db'][_0xa49d('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xa49d('0x3')](0x0);var events={'afterCreate':_0xa49d('0x4'),'afterUpdate':'update','afterDestroy':_0xa49d('0x5')};function emitEvent(_0x5110b4){return function(_0x226052,_0x2ef90b,_0x2838c8){UserEvents['emit'](_0x5110b4+':'+_0x226052['id'],_0x226052);UserEvents[_0xa49d('0x6')](_0x5110b4,_0x226052);_0x2838c8(null);};}for(var e in events){if(events[_0xa49d('0x7')](e)){var event=events[e];User[_0xa49d('0x8')](e,emitEvent(event));}}module[_0xa49d('0x9')]=UserEvents;
\ No newline at end of file
index d58b659..8fd1794 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x758e=['update','PAUSE','channel','MemberReport','isArray','map','YYYY-MM-DD\x20HH:mm:ss','all','voicePause','mailPause','chatPause','smsPause','whatsappPause','Pause','../../config/utils','getChannels','forEach','Status','setDataValue','bluebird','md5','moment','lodash','google','length','context','format','%s%s','prefix','merge','CDR(type)=%s','chanspy','push','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','join','record','StopMixMonitor','wav','WAV','gsm','Set','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','SIP/%s,,tTxXU(xcally-mixmonitor-context)','priority','defaults','VoiceChanSpy','then','internal','concat','exports','models','users','utf8_bin','undefined','resolve','find','userProfileId','privacyEnabled','updateMd5Password','updatePassword','catch','UserProfile','changed','userSetting','createUserSetting','VoiceExtension','bulkCreate','destroy','system','encryptPassword','function','randomBytes','toString','base64','salt','from','pbkdf2Sync','sha1','indexOf','makeSalt',':asterisk:','md5secret','http','client','Agents','error','result','request','manual','voice','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','message','UserVoiceQueueRt'];(function(_0x1bf288,_0x67803e){var _0x257f24=function(_0x3e81fe){while(--_0x3e81fe){_0x1bf288['push'](_0x1bf288['shift']());}};_0x257f24(++_0x67803e);}(_0x758e,0x1af));var _0xe758=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x758e[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0xe758('0x0'));var crypto=require('crypto');var util=require('util');var md5=require(_0xe758('0x1'));var moment=require(_0xe758('0x2'));var _=require(_0xe758('0x3'));var jayson=require('jayson/promise');var attributes=require('./user.attributes');var authTypes=[_0xe758('0x4')];var validatePresenceOf=function(_0x232ca8){return _0x232ca8&&_0x232ca8[_0xe758('0x5')];};var getChanSpyApplications=function(_0x2d60f4,_0x5a2226,_0x2cdf89){var _0x21e792={'context':_0x2d60f4[_0xe758('0x6')]||'from-sip','type':'system','isApp':![],'UserId':_0x2d60f4['id']};var _0x454ee0=[];for(var _0x55601a=0x0,_0x53f8b9=0x1;_0x55601a<_0x2cdf89['length'];_0x55601a++,_0x53f8b9=0x1){var _0x556f54={'exten':util[_0xe758('0x7')](_0xe758('0x8'),_0x2cdf89[_0x55601a][_0xe758('0x9')],_0x5a2226),'ChanSpyId':_0x2cdf89[_0x55601a]['id']};_0x454ee0['push'](_[_0xe758('0xa')]({'app':'Set','appdata':util[_0xe758('0x7')](_0xe758('0xb'),_0xe758('0xc')),'priority':_0x53f8b9++},_0x21e792,_0x556f54));if(_0x2cdf89[_0x55601a]['record']){_0x454ee0[_0xe758('0xd')](_['merge']({'app':_0xe758('0xe'),'appdata':util[_0xe758('0x7')](_0xe758('0xf'),_0x2cdf89[_0x55601a][_0xe758('0x10')]),'priority':_0x53f8b9++},_0x21e792,_0x556f54));}if(_0x2cdf89[_0x55601a][_0xe758('0x11')]){_0x454ee0[_0xe758('0xd')](_[_0xe758('0xa')]({'app':_0xe758('0x12'),'appdata':_0x2cdf89[_0x55601a][_0xe758('0x13')],'priority':_0x53f8b9++},_0x21e792,_0x556f54));}_0x454ee0['push'](_[_0xe758('0xa')]({'app':'ChanSpy','appdata':util['format'](_0xe758('0x14'),_0x2d60f4[_0xe758('0x15')],_0x2cdf89[_0x55601a]['options']?_0x2cdf89[_0x55601a]['options'][_0xe758('0x16')](''):''),'priority':_0x53f8b9++},_0x21e792,_0x556f54));if(_0x2cdf89[_0x55601a][_0xe758('0x17')]){_0x454ee0[_0xe758('0xd')](_[_0xe758('0xa')]({'app':_0xe758('0x18'),'priority':_0x53f8b9++},_0x21e792,_0x556f54));}}return _0x454ee0;};var getUserApplications=function(_0x3ee871,_0x5a5674){var _0x5aaea2=[_0xe758('0x19'),_0xe758('0x1a'),_0xe758('0x1b')];var _0x1dc8fc={'context':_0x3ee871[_0xe758('0x6')]||'from-sip','exten':_0x5a5674,'type':'system','isApp':![],'UserId':_0x3ee871['id']};var _0x2a490f=[{'app':_0xe758('0x1c'),'appdata':_0xe758('0x1d')}];if(_0x3ee871[_0xe758('0x1e')]&&_['includes'](_0x5aaea2,_0x3ee871[_0xe758('0x1e')])){_0x2a490f[_0xe758('0xd')]({'app':_0xe758('0x1c'),'appdata':_0xe758('0x1f')});_0x2a490f[_0xe758('0xd')]({'app':_0xe758('0x1c'),'appdata':util[_0xe758('0x7')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x3ee871['extensionMonitor'])});_0x2a490f['push']({'app':'Dial','appdata':util[_0xe758('0x7')](_0xe758('0x20'),_0x3ee871[_0xe758('0x15')])});}else{_0x2a490f[_0xe758('0xd')]({'app':'Dial','appdata':util[_0xe758('0x7')]('SIP/%s,,tTxX',_0x3ee871[_0xe758('0x15')])});}_0x2a490f['push']({'app':'Hangup'});for(var _0x34c40f=0x0;_0x34c40f<_0x2a490f[_0xe758('0x5')];_0x34c40f++){_0x2a490f[_0x34c40f][_0xe758('0x21')]=_0x34c40f+0x1;_0x2a490f[_0x34c40f]=_[_0xe758('0x22')](_0x2a490f[_0x34c40f],_0x1dc8fc);}return _0x2a490f;};var getChanSpyPromise=function(_0x5d557b,_0xf00ed6){return new BPromise(function(_0x32c693,_0x258d5f){return _0x5d557b[_0xe758('0x23')]['findAll']()[_0xe758('0x24')](function(_0x596835){if(_0x596835){var _0x3e8e9b=getChanSpyApplications(_0xf00ed6,_0xf00ed6[_0xe758('0x25')],_0x596835);if(_0xf00ed6[_0xe758('0x25')]!=_0xf00ed6[_0xe758('0x15')]){_0x3e8e9b=_0x3e8e9b[_0xe758('0x26')](getChanSpyApplications(_0xf00ed6,_0xf00ed6['name'],_0x596835));}return _0x32c693(_0x3e8e9b);}return _0x32c693([]);})['catch'](function(_0x4a7d52){_0x258d5f(_0x4a7d52);});});};module[_0xe758('0x27')]=function(_0x53a413){var _0x44f767=_0x53a413[_0xe758('0x28')];return _0x53a413['define']('User',attributes,{'tableName':_0xe758('0x29'),'charset':'utf8','collate':_0xe758('0x2a'),'hooks':{'beforeCreate':function(_0x1d853c,_0x11cb74,_0x5941cf){var _0x308872=typeof _0x1d853c['userProfileId']===_0xe758('0x2b')?BPromise[_0xe758('0x2c')](null):_0x44f767['UserProfile'][_0xe758('0x2d')]({'where':{'id':_0x1d853c[_0xe758('0x2e')]}});_0x308872[_0xe758('0x24')](function(_0x56c8ff){if(_0x56c8ff){_0x1d853c['privacyEnabled']=_0x56c8ff[_0xe758('0x2f')];}})['then'](function(){_0x1d853c[_0xe758('0x30')]();_0x1d853c[_0xe758('0x31')](_0x5941cf);})[_0xe758('0x32')](function(_0x218e6f){_0x5941cf(_0x218e6f);});},'beforeUpdate':function(_0x8dbad6,_0x3218b8,_0x59454d){Promise[_0xe758('0x2c')]()['then'](function(){if(_0x8dbad6['changed'](_0xe758('0x2e'))===![])return;return _0x44f767[_0xe758('0x33')]['find']({'where':{'id':_0x8dbad6[_0xe758('0x2e')]}})[_0xe758('0x24')](function(_0x473711){if(_0x473711)_0x8dbad6['privacyEnabled']=_0x473711[_0xe758('0x2f')];return;});})[_0xe758('0x24')](function(){if(_0x8dbad6[_0xe758('0x34')](_0xe758('0x13'))){_0x8dbad6['updateMd5Password']();return _0x8dbad6[_0xe758('0x31')](_0x59454d);}_0x59454d();})[_0xe758('0x32')](function(_0xfb2038){_0x59454d(_0xfb2038);});},'afterCreate':function(_0x390b80,_0x587862,_0x392e1a){var _0x528b68=getUserApplications(_0x390b80,_0x390b80['internal']);if(_0x390b80[_0xe758('0x25')]!=_0x390b80[_0xe758('0x15')]){_0x528b68=_0x528b68[_0xe758('0x26')](getUserApplications(_0x390b80,_0x390b80['name']));}return Promise[_0xe758('0x2c')]()[_0xe758('0x24')](function(){if(!_0x390b80[_0xe758('0x35')]){return _0x390b80[_0xe758('0x36')]({'clientSideLoggingLevel':'error','clientSideLoggingEnabled':![]});}})[_0xe758('0x24')](function(){return _0x44f767[_0xe758('0x37')][_0xe758('0x38')](_0x528b68);})[_0xe758('0x24')](function(){if(_0x390b80['chanspy']){return getChanSpyPromise(_0x44f767,_0x390b80);}})[_0xe758('0x24')](function(_0x4d5e7f){if(_0x4d5e7f&&_0x4d5e7f[_0xe758('0x5')]){return _0x44f767[_0xe758('0x37')]['bulkCreate'](_0x4d5e7f);}})[_0xe758('0x24')](function(){_0x392e1a();})[_0xe758('0x32')](function(_0x4c2855){_0x392e1a(_0x4c2855);});},'afterUpdate':function(_0x42469a,_0xc505be,_0x3f3787){return BPromise[_0xe758('0x2c')]()[_0xe758('0x24')](function(){if(_0x42469a[_0xe758('0x34')](_0xe758('0xc'))||_0x42469a[_0xe758('0x34')](_0xe758('0x6'))){return _0x44f767['VoiceExtension']['destroy']({'where':{'UserId':_0x42469a['id'],'type':'system','ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x42469a[_0xe758('0xc')]){return getChanSpyPromise(_0x44f767,_0x42469a)[_0xe758('0x24')](function(_0x4edf6e){if(_0x4edf6e&&_0x4edf6e[_0xe758('0x5')]){return _0x44f767[_0xe758('0x37')][_0xe758('0x38')](_0x4edf6e);}});}});}})['then'](function(){if(_0x42469a[_0xe758('0x34')](_0xe758('0x1e'))||_0x42469a['changed']('context')){return _0x44f767[_0xe758('0x37')][_0xe758('0x39')]({'where':{'UserId':_0x42469a['id'],'type':_0xe758('0x3a'),'ChanSpyId':null}})[_0xe758('0x24')](function(){var _0x4abe65=getUserApplications(_0x42469a,_0x42469a[_0xe758('0x25')]);if(_0x42469a[_0xe758('0x25')]!=_0x42469a[_0xe758('0x15')]){_0x4abe65=_0x4abe65['concat'](getUserApplications(_0x42469a,_0x42469a['name']));}return _0x44f767[_0xe758('0x37')][_0xe758('0x38')](_0x4abe65);});}})[_0xe758('0x24')](function(){_0x3f3787();})[_0xe758('0x32')](function(_0x283600){_0x3f3787(_0x283600);});},'afterDestroy':function(_0x53093e){return _0x44f767[_0xe758('0x37')][_0xe758('0x39')]({'where':{'UserId':_0x53093e['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x4ab7c6,_0x2f6c69){if(!_0x2f6c69){return this[_0xe758('0x13')]===this['encryptPassword'](_0x4ab7c6);}var _0x1864bb=this;this[_0xe758('0x3b')](_0x4ab7c6,function(_0x3899ef,_0x4afbc9){if(_0x3899ef){_0x2f6c69(_0x3899ef);}if(_0x1864bb[_0xe758('0x13')]===_0x4afbc9){_0x2f6c69(null,!![]);}else{_0x2f6c69(null,![]);}});},'makeSalt':function(_0x3a5984,_0x5d76c7){var _0x19d5a4=0x10;if(typeof arguments[0x0]===_0xe758('0x3c')){_0x5d76c7=arguments[0x0];_0x3a5984=_0x19d5a4;}else if(typeof arguments[0x1]==='function'){_0x5d76c7=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x3a5984){_0x3a5984=_0x19d5a4;}return crypto[_0xe758('0x3d')](_0x3a5984,function(_0x3077ef,_0x16bf26){if(_0x3077ef){_0x5d76c7(_0x3077ef);}return _0x5d76c7(null,_0x16bf26[_0xe758('0x3e')](_0xe758('0x3f')));});},'encryptPassword':function(_0x29bc4e,_0x158fb3){if(!_0x29bc4e||!this[_0xe758('0x40')]){return _0x158fb3?_0x158fb3(null):null;}var _0x5a0348=0x2710;var _0xb02e52=0x40;var _0x457b5d=Buffer[_0xe758('0x41')](this['salt'],'base64');if(!_0x158fb3){return crypto[_0xe758('0x42')](_0x29bc4e,_0x457b5d,_0x5a0348,_0xb02e52,'sha1')[_0xe758('0x3e')](_0xe758('0x3f'));}return crypto['pbkdf2'](_0x29bc4e,_0x457b5d,_0x5a0348,_0xb02e52,_0xe758('0x43'),function(_0xbd8d26,_0x423441){if(_0xbd8d26){_0x158fb3(_0xbd8d26);}return _0x158fb3(null,_0x423441[_0xe758('0x3e')]('base64'));});},'updatePassword':function(_0x3c97a3){if(!this[_0xe758('0x13')]){return _0x3c97a3(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0xe758('0x44')](this['provider'])===-0x1){_0x3c97a3(new Error('Invalid\x20password'));}var _0x3dade0=this;this[_0xe758('0x45')](function(_0x147424,_0x74ffb8){if(_0x147424){return _0x3c97a3(_0x147424);}_0x3dade0[_0xe758('0x40')]=_0x74ffb8;_0x3dade0[_0xe758('0x3b')](_0x3dade0['password'],function(_0x2cb9af,_0x587cdc){if(_0x2cb9af){_0x3c97a3(_0x2cb9af);}_0x3dade0[_0xe758('0x13')]=_0x587cdc;_0x3c97a3(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0xe758('0x15')]+_0xe758('0x46')+this[_0xe758('0x13')]);return this[_0xe758('0x47')];},'getRealtimeData':function(){var _0x5650bb={'id':this['id']};var _0x170363=jayson['client'][_0xe758('0x48')]({'port':0x232a});var _0x4af0b9=jayson[_0xe758('0x49')][_0xe758('0x48')]({'port':0x232c});var _0x4c16cb={};var _0x26a16d={};return _0x170363['request'](_0xe758('0x4a'),_0x5650bb)[_0xe758('0x24')](function(_0x5f331a){if(_0x5f331a[_0xe758('0x4b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)');}_0x4c16cb=_0x5f331a[_0xe758('0x4c')];return _0x4af0b9[_0xe758('0x4d')](_0xe758('0x4a'),_0x5650bb);})[_0xe758('0x24')](function(_0x56fe8e){if(_0x56fe8e[_0xe758('0x4b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)');}_0x26a16d=_0x56fe8e[_0xe758('0x4c')];var _0x1113a1=_[_0xe758('0xa')]({},_0x4c16cb,_0x26a16d);return _0x1113a1;})[_0xe758('0x32')](function(_0x1f967f){throw _0x1f967f;});},'unpause':function(_0x59fd17,_0x305838=_0xe758('0x4e')){var _0x374034=this;var _0x5d1e68={};return Promise[_0xe758('0x2c')]()['then'](function(){if(!_0x59fd17||_0x59fd17===_0xe758('0x4f')&&_0x305838===_0xe758('0x4e')){var _0x111cb5=jayson['client'][_0xe758('0x48')]({'port':0x232a});return _0x111cb5['request'](_0xe758('0x50'),{'id':_0x374034['id'],'name':_0x374034[_0xe758('0x15')],'pause':![]})[_0xe758('0x24')](function(_0x12f00c){if(_0x12f00c[_0xe758('0x4b')]){throw new Error(util[_0xe758('0x7')](_0xe758('0x51'),_0x374034['id'],_0x374034[_0xe758('0x15')]));}return _0x12f00c[_0xe758('0x4c')][_0xe758('0x52')];});}})[_0xe758('0x24')](function(){if(!_0x59fd17||_0x59fd17===_0xe758('0x4f')){return _0x44f767[_0xe758('0x53')][_0xe758('0x54')]({'paused':0x0},{'where':{'UserId':_0x374034['id']},'individualHooks':!![]});}})[_0xe758('0x24')](function(){var _0x135bf3=!_0x59fd17?'findAll':'findOne';var _0x5f50ee={'membername':_0x374034[_0xe758('0x15')],'type':_0xe758('0x55'),'exitAt':null};if(_0x59fd17){_0x5f50ee[_0xe758('0x56')]=_0x59fd17;}return _0x44f767[_0xe758('0x57')][_0x135bf3]({'where':_0x5f50ee});})[_0xe758('0x24')](function(_0xe48fce){if(_0xe48fce){var _0x688798=Array[_0xe758('0x58')](_0xe48fce)?_0xe48fce:[_0xe48fce];var _0x2ac608=_0x688798[_0xe758('0x59')](function(_0x57720f){return _0x57720f[_0xe758('0x54')]({'exitAt':moment()[_0xe758('0x7')](_0xe758('0x5a')),'data2':_0x305838});});return Promise[_0xe758('0x5b')](_0x2ac608);}})[_0xe758('0x24')](function(){if(!_0x59fd17){_0x5d1e68[_0xe758('0x5c')]=![];_0x5d1e68[_0xe758('0x5d')]=![];_0x5d1e68[_0xe758('0x5e')]=![];_0x5d1e68['faxPause']=![];_0x5d1e68[_0xe758('0x5f')]=![];_0x5d1e68[_0xe758('0x60')]=![];_0x5d1e68['openchannelPause']=![];}else{_0x5d1e68[_0x59fd17+_0xe758('0x61')]=![];}return _0x374034['getRealtimeData']();})[_0xe758('0x24')](function(_0x486dee){var _0x12954e=require(_0xe758('0x62'));var _0x1d05ee=_0x12954e[_0xe758('0x63')]();_0x1d05ee[_0xe758('0x64')](function(_0x1268b4){var _0x4e61e5=_0x1268b4+_0xe758('0x65');_0x374034[_0xe758('0x66')]([_0x4e61e5],_0x486dee[_0x4e61e5]);});return _0x374034[_0xe758('0x54')](_0x5d1e68);})[_0xe758('0x32')](function(_0x41b668){throw _0x41b668;});}}});};
\ No newline at end of file
+var _0x1ef3=['getChannels','Status','setDataValue','bluebird','crypto','md5','moment','lodash','./user.attributes','google','length','context','system','%s%s','Set','format','CDR(type)=%s','chanspy','${UNIQUEID}.%s,a','auth','push','Authenticate','password','merge','ChanSpy','options','join','record','StopMixMonitor','wav','WAV','from-sip','CDR(type)=internal','extensionMonitor','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','SIP/%s,,tTxXU(xcally-mixmonitor-context)','Dial','SIP/%s,,tTxX','Hangup','priority','defaults','findAll','then','internal','name','concat','catch','exports','models','define','users','userProfileId','undefined','find','privacyEnabled','updateMd5Password','updatePassword','changed','UserProfile','resolve','userSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','from','pbkdf2Sync','sha1','indexOf','Invalid\x20password','makeSalt','http','request','Agents','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)','manual','client','QueuePause','Unable\x20to\x20unpause\x20agent\x20%s:$s','voice','update','findOne','PAUSE','channel','MemberReport','isArray','map','YYYY-MM-DD\x20HH:mm:ss','all','faxPause','openchannelPause','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ef3,0x69));var _0x31ef=function(_0x1fa54a,_0x2b0d44){_0x1fa54a=_0x1fa54a-0x0;var _0x76b6bc=_0x1ef3[_0x1fa54a];return _0x76b6bc;};'use strict';var BPromise=require(_0x31ef('0x0'));var crypto=require(_0x31ef('0x1'));var util=require('util');var md5=require(_0x31ef('0x2'));var moment=require(_0x31ef('0x3'));var _=require(_0x31ef('0x4'));var jayson=require('jayson/promise');var attributes=require(_0x31ef('0x5'));var authTypes=[_0x31ef('0x6')];var validatePresenceOf=function(_0x49ce87){return _0x49ce87&&_0x49ce87[_0x31ef('0x7')];};var getChanSpyApplications=function(_0x28b51b,_0x81db4,_0x454b60){var _0x185f8c={'context':_0x28b51b[_0x31ef('0x8')]||'from-sip','type':_0x31ef('0x9'),'isApp':![],'UserId':_0x28b51b['id']};var _0x41c8bf=[];for(var _0x129662=0x0,_0xb027a3=0x1;_0x129662<_0x454b60['length'];_0x129662++,_0xb027a3=0x1){var _0x1497c4={'exten':util['format'](_0x31ef('0xa'),_0x454b60[_0x129662]['prefix'],_0x81db4),'ChanSpyId':_0x454b60[_0x129662]['id']};_0x41c8bf['push'](_['merge']({'app':_0x31ef('0xb'),'appdata':util[_0x31ef('0xc')](_0x31ef('0xd'),_0x31ef('0xe')),'priority':_0xb027a3++},_0x185f8c,_0x1497c4));if(_0x454b60[_0x129662]['record']){_0x41c8bf['push'](_['merge']({'app':'MixMonitor','appdata':util['format'](_0x31ef('0xf'),_0x454b60[_0x129662]['recordingFormat']),'priority':_0xb027a3++},_0x185f8c,_0x1497c4));}if(_0x454b60[_0x129662][_0x31ef('0x10')]){_0x41c8bf[_0x31ef('0x11')](_['merge']({'app':_0x31ef('0x12'),'appdata':_0x454b60[_0x129662][_0x31ef('0x13')],'priority':_0xb027a3++},_0x185f8c,_0x1497c4));}_0x41c8bf[_0x31ef('0x11')](_[_0x31ef('0x14')]({'app':_0x31ef('0x15'),'appdata':util[_0x31ef('0xc')]('SIP/%s,%s',_0x28b51b['name'],_0x454b60[_0x129662][_0x31ef('0x16')]?_0x454b60[_0x129662]['options'][_0x31ef('0x17')](''):''),'priority':_0xb027a3++},_0x185f8c,_0x1497c4));if(_0x454b60[_0x129662][_0x31ef('0x18')]){_0x41c8bf[_0x31ef('0x11')](_[_0x31ef('0x14')]({'app':_0x31ef('0x19'),'priority':_0xb027a3++},_0x185f8c,_0x1497c4));}}return _0x41c8bf;};var getUserApplications=function(_0x5d3d17,_0x256be4){var _0x44339d=[_0x31ef('0x1a'),_0x31ef('0x1b'),'gsm'];var _0x5b9505={'context':_0x5d3d17[_0x31ef('0x8')]||_0x31ef('0x1c'),'exten':_0x256be4,'type':_0x31ef('0x9'),'isApp':![],'UserId':_0x5d3d17['id']};var _0x1dee07=[{'app':'Set','appdata':_0x31ef('0x1d')}];if(_0x5d3d17[_0x31ef('0x1e')]&&_['includes'](_0x44339d,_0x5d3d17[_0x31ef('0x1e')])){_0x1dee07[_0x31ef('0x11')]({'app':_0x31ef('0xb'),'appdata':_0x31ef('0x1f')});_0x1dee07[_0x31ef('0x11')]({'app':_0x31ef('0xb'),'appdata':util[_0x31ef('0xc')](_0x31ef('0x20'),_0x5d3d17[_0x31ef('0x1e')])});_0x1dee07[_0x31ef('0x11')]({'app':'Dial','appdata':util['format'](_0x31ef('0x21'),_0x5d3d17['name'])});}else{_0x1dee07[_0x31ef('0x11')]({'app':_0x31ef('0x22'),'appdata':util['format'](_0x31ef('0x23'),_0x5d3d17['name'])});}_0x1dee07[_0x31ef('0x11')]({'app':_0x31ef('0x24')});for(var _0x3ab05f=0x0;_0x3ab05f<_0x1dee07[_0x31ef('0x7')];_0x3ab05f++){_0x1dee07[_0x3ab05f][_0x31ef('0x25')]=_0x3ab05f+0x1;_0x1dee07[_0x3ab05f]=_[_0x31ef('0x26')](_0x1dee07[_0x3ab05f],_0x5b9505);}return _0x1dee07;};var getChanSpyPromise=function(_0x4c4f47,_0x13704a){return new BPromise(function(_0x6ee55c,_0x489ff6){return _0x4c4f47['VoiceChanSpy'][_0x31ef('0x27')]()[_0x31ef('0x28')](function(_0x4399dc){if(_0x4399dc){var _0x6d4fa1=getChanSpyApplications(_0x13704a,_0x13704a[_0x31ef('0x29')],_0x4399dc);if(_0x13704a[_0x31ef('0x29')]!=_0x13704a[_0x31ef('0x2a')]){_0x6d4fa1=_0x6d4fa1[_0x31ef('0x2b')](getChanSpyApplications(_0x13704a,_0x13704a[_0x31ef('0x2a')],_0x4399dc));}return _0x6ee55c(_0x6d4fa1);}return _0x6ee55c([]);})[_0x31ef('0x2c')](function(_0x4dbb4c){_0x489ff6(_0x4dbb4c);});});};module[_0x31ef('0x2d')]=function(_0x5e0119){var _0xb82460=_0x5e0119[_0x31ef('0x2e')];return _0x5e0119[_0x31ef('0x2f')]('User',attributes,{'tableName':_0x31ef('0x30'),'charset':'utf8','collate':'utf8_bin','hooks':{'beforeCreate':function(_0x257275,_0x80a560,_0x1d09b2){var _0x44f6d6=typeof _0x257275[_0x31ef('0x31')]===_0x31ef('0x32')?BPromise['resolve'](null):_0xb82460['UserProfile'][_0x31ef('0x33')]({'where':{'id':_0x257275[_0x31ef('0x31')]}});_0x44f6d6[_0x31ef('0x28')](function(_0x4f4604){if(_0x4f4604){_0x257275[_0x31ef('0x34')]=_0x4f4604['privacyEnabled'];}})[_0x31ef('0x28')](function(){_0x257275[_0x31ef('0x35')]();_0x257275[_0x31ef('0x36')](_0x1d09b2);})[_0x31ef('0x2c')](function(_0x29271d){_0x1d09b2(_0x29271d);});},'beforeUpdate':function(_0x30989b,_0x2753cd,_0x1316f4){Promise['resolve']()[_0x31ef('0x28')](function(){if(_0x30989b[_0x31ef('0x37')](_0x31ef('0x31'))===![])return;return _0xb82460[_0x31ef('0x38')][_0x31ef('0x33')]({'where':{'id':_0x30989b[_0x31ef('0x31')]}})[_0x31ef('0x28')](function(_0x554d21){if(_0x554d21)_0x30989b['privacyEnabled']=_0x554d21[_0x31ef('0x34')];return;});})[_0x31ef('0x28')](function(){if(_0x30989b['changed'](_0x31ef('0x13'))){_0x30989b[_0x31ef('0x35')]();return _0x30989b['updatePassword'](_0x1316f4);}_0x1316f4();})[_0x31ef('0x2c')](function(_0x34aa02){_0x1316f4(_0x34aa02);});},'afterCreate':function(_0x2eb8b2,_0x1ad910,_0x102736){var _0x593f85=getUserApplications(_0x2eb8b2,_0x2eb8b2[_0x31ef('0x29')]);if(_0x2eb8b2[_0x31ef('0x29')]!=_0x2eb8b2[_0x31ef('0x2a')]){_0x593f85=_0x593f85[_0x31ef('0x2b')](getUserApplications(_0x2eb8b2,_0x2eb8b2[_0x31ef('0x2a')]));}return Promise[_0x31ef('0x39')]()[_0x31ef('0x28')](function(){if(!_0x2eb8b2[_0x31ef('0x3a')]){return _0x2eb8b2['createUserSetting']({'clientSideLoggingLevel':_0x31ef('0x3b'),'clientSideLoggingEnabled':![]});}})[_0x31ef('0x28')](function(){return _0xb82460[_0x31ef('0x3c')][_0x31ef('0x3d')](_0x593f85);})['then'](function(){if(_0x2eb8b2['chanspy']){return getChanSpyPromise(_0xb82460,_0x2eb8b2);}})[_0x31ef('0x28')](function(_0x2bb51d){if(_0x2bb51d&&_0x2bb51d[_0x31ef('0x7')]){return _0xb82460[_0x31ef('0x3c')][_0x31ef('0x3d')](_0x2bb51d);}})['then'](function(){_0x102736();})[_0x31ef('0x2c')](function(_0x3e1293){_0x102736(_0x3e1293);});},'afterUpdate':function(_0x36437c,_0x5f0665,_0x34047e){return BPromise['resolve']()[_0x31ef('0x28')](function(){if(_0x36437c[_0x31ef('0x37')](_0x31ef('0xe'))||_0x36437c['changed'](_0x31ef('0x8'))){return _0xb82460[_0x31ef('0x3c')][_0x31ef('0x3e')]({'where':{'UserId':_0x36437c['id'],'type':_0x31ef('0x9'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x36437c[_0x31ef('0xe')]){return getChanSpyPromise(_0xb82460,_0x36437c)[_0x31ef('0x28')](function(_0x8602ce){if(_0x8602ce&&_0x8602ce[_0x31ef('0x7')]){return _0xb82460['VoiceExtension']['bulkCreate'](_0x8602ce);}});}});}})[_0x31ef('0x28')](function(){if(_0x36437c[_0x31ef('0x37')](_0x31ef('0x1e'))||_0x36437c[_0x31ef('0x37')]('context')){return _0xb82460[_0x31ef('0x3c')][_0x31ef('0x3e')]({'where':{'UserId':_0x36437c['id'],'type':_0x31ef('0x9'),'ChanSpyId':null}})[_0x31ef('0x28')](function(){var _0x1ecb2b=getUserApplications(_0x36437c,_0x36437c[_0x31ef('0x29')]);if(_0x36437c['internal']!=_0x36437c['name']){_0x1ecb2b=_0x1ecb2b[_0x31ef('0x2b')](getUserApplications(_0x36437c,_0x36437c[_0x31ef('0x2a')]));}return _0xb82460['VoiceExtension'][_0x31ef('0x3d')](_0x1ecb2b);});}})[_0x31ef('0x28')](function(){_0x34047e();})[_0x31ef('0x2c')](function(_0x57cd43){_0x34047e(_0x57cd43);});},'afterDestroy':function(_0x196ac1){return _0xb82460[_0x31ef('0x3c')]['destroy']({'where':{'UserId':_0x196ac1['id'],'type':_0x31ef('0x9')}});}},'instanceMethods':{'authenticate':function(_0x21ceee,_0x421506){if(!_0x421506){return this['password']===this[_0x31ef('0x3f')](_0x21ceee);}var _0x3463bf=this;this['encryptPassword'](_0x21ceee,function(_0x4e1563,_0x1305bc){if(_0x4e1563){_0x421506(_0x4e1563);}if(_0x3463bf[_0x31ef('0x13')]===_0x1305bc){_0x421506(null,!![]);}else{_0x421506(null,![]);}});},'makeSalt':function(_0x34ca1a,_0x1a6bd0){var _0x48421c=0x10;if(typeof arguments[0x0]===_0x31ef('0x40')){_0x1a6bd0=arguments[0x0];_0x34ca1a=_0x48421c;}else if(typeof arguments[0x1]===_0x31ef('0x40')){_0x1a6bd0=arguments[0x1];}else{throw new Error(_0x31ef('0x41'));}if(!_0x34ca1a){_0x34ca1a=_0x48421c;}return crypto[_0x31ef('0x42')](_0x34ca1a,function(_0x1501e4,_0x81cb44){if(_0x1501e4){_0x1a6bd0(_0x1501e4);}return _0x1a6bd0(null,_0x81cb44[_0x31ef('0x43')](_0x31ef('0x44')));});},'encryptPassword':function(_0x544a22,_0x18405d){if(!_0x544a22||!this[_0x31ef('0x45')]){return _0x18405d?_0x18405d(null):null;}var _0xcc556f=0x2710;var _0x53fc33=0x40;var _0x320f5a=Buffer[_0x31ef('0x46')](this[_0x31ef('0x45')],'base64');if(!_0x18405d){return crypto[_0x31ef('0x47')](_0x544a22,_0x320f5a,_0xcc556f,_0x53fc33,_0x31ef('0x48'))[_0x31ef('0x43')](_0x31ef('0x44'));}return crypto['pbkdf2'](_0x544a22,_0x320f5a,_0xcc556f,_0x53fc33,_0x31ef('0x48'),function(_0x56db1d,_0x24fbfc){if(_0x56db1d){_0x18405d(_0x56db1d);}return _0x18405d(null,_0x24fbfc[_0x31ef('0x43')](_0x31ef('0x44')));});},'updatePassword':function(_0x205bb0){if(!this[_0x31ef('0x13')]){return _0x205bb0(null);}if(!validatePresenceOf(this[_0x31ef('0x13')])&&authTypes[_0x31ef('0x49')](this['provider'])===-0x1){_0x205bb0(new Error(_0x31ef('0x4a')));}var _0x302280=this;this[_0x31ef('0x4b')](function(_0x6656f8,_0x2766ca){if(_0x6656f8){return _0x205bb0(_0x6656f8);}_0x302280[_0x31ef('0x45')]=_0x2766ca;_0x302280['encryptPassword'](_0x302280[_0x31ef('0x13')],function(_0x106eab,_0xc3b0){if(_0x106eab){_0x205bb0(_0x106eab);}_0x302280['password']=_0xc3b0;_0x205bb0(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x31ef('0x2a')]+':asterisk:'+this[_0x31ef('0x13')]);return this['md5secret'];},'getRealtimeData':function(){var _0x5bfc81={'id':this['id']};var _0x3c9f53=jayson['client'][_0x31ef('0x4c')]({'port':0x232a});var _0x133247=jayson['client']['http']({'port':0x232c});var _0x49c358={};var _0x139709={};return _0x3c9f53[_0x31ef('0x4d')](_0x31ef('0x4e'),_0x5bfc81)[_0x31ef('0x28')](function(_0x3222e1){if(_0x3222e1['error']){throw new Error(_0x31ef('0x4f'));}_0x49c358=_0x3222e1[_0x31ef('0x50')];return _0x133247[_0x31ef('0x4d')](_0x31ef('0x4e'),_0x5bfc81);})[_0x31ef('0x28')](function(_0x4b64ef){if(_0x4b64ef['error']){throw new Error(_0x31ef('0x51'));}_0x139709=_0x4b64ef[_0x31ef('0x50')];var _0x341c96=_[_0x31ef('0x14')]({},_0x49c358,_0x139709);return _0x341c96;})['catch'](function(_0x3686ff){throw _0x3686ff;});},'unpause':function(_0x1de064,_0x21accd=_0x31ef('0x52')){var _0x4a0791=this;var _0x32b685={};return Promise[_0x31ef('0x39')]()[_0x31ef('0x28')](function(){if(!_0x1de064||_0x1de064==='voice'&&_0x21accd==='manual'){var _0x28869a=jayson[_0x31ef('0x53')][_0x31ef('0x4c')]({'port':0x232a});return _0x28869a[_0x31ef('0x4d')](_0x31ef('0x54'),{'id':_0x4a0791['id'],'name':_0x4a0791['name'],'pause':![]})[_0x31ef('0x28')](function(_0x5a23ed){if(_0x5a23ed['error']){throw new Error(util['format'](_0x31ef('0x55'),_0x4a0791['id'],_0x4a0791[_0x31ef('0x2a')]));}return _0x5a23ed['result']['message'];});}})['then'](function(){if(!_0x1de064||_0x1de064===_0x31ef('0x56')){return _0xb82460['UserVoiceQueueRt'][_0x31ef('0x57')]({'paused':0x0},{'where':{'UserId':_0x4a0791['id']},'individualHooks':!![]});}})[_0x31ef('0x28')](function(){var _0xab43b6=!_0x1de064?'findAll':_0x31ef('0x58');var _0x22dd78={'membername':_0x4a0791[_0x31ef('0x2a')],'type':_0x31ef('0x59'),'exitAt':null};if(_0x1de064){_0x22dd78[_0x31ef('0x5a')]=_0x1de064;}return _0xb82460[_0x31ef('0x5b')][_0xab43b6]({'where':_0x22dd78});})[_0x31ef('0x28')](function(_0x548120){if(_0x548120){var _0x49a766=Array[_0x31ef('0x5c')](_0x548120)?_0x548120:[_0x548120];var _0x618f52=_0x49a766[_0x31ef('0x5d')](function(_0x55bc49){return _0x55bc49[_0x31ef('0x57')]({'exitAt':moment()[_0x31ef('0xc')](_0x31ef('0x5e')),'data2':_0x21accd});});return Promise[_0x31ef('0x5f')](_0x618f52);}})[_0x31ef('0x28')](function(){if(!_0x1de064){_0x32b685['voicePause']=![];_0x32b685['mailPause']=![];_0x32b685['chatPause']=![];_0x32b685[_0x31ef('0x60')]=![];_0x32b685['smsPause']=![];_0x32b685['whatsappPause']=![];_0x32b685[_0x31ef('0x61')]=![];}else{_0x32b685[_0x1de064+'Pause']=![];}return _0x4a0791['getRealtimeData']();})[_0x31ef('0x28')](function(_0x49821f){var _0xc4001a=require(_0x31ef('0x62'));var _0x38d888=_0xc4001a[_0x31ef('0x63')]();_0x38d888['forEach'](function(_0x48f292){var _0x296eed=_0x48f292+_0x31ef('0x64');_0x4a0791[_0x31ef('0x65')]([_0x296eed],_0x49821f[_0x296eed]);});return _0x4a0791[_0x31ef('0x57')](_0x32b685);})[_0x31ef('0x2c')](function(_0x538fcb){throw _0x538fcb;});}}});};
\ No newline at end of file
index ac77989..e8d8e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdaf=['User\x20with\x20id\x20%s\x20not\x20found','unpause','destroy','all','LoginUser','mobile','phone','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','loginInPause','UserVoiceQueue.penalty','merge','callysquare','concat','LOGININPAUSE','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','register','GetUser','User','findAll','options','raw','where','limit','include','map','model','attributes','then','info','debug','stringify','catch','error','message','ShowUser','find','name','format','params','UserVoiceQueueRt','update','MemberReport','length','updateAttributes','forEach','push','isNil','interface','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','type','internal','body','uniqueid','bulkCreate','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','role','online','voicePause','mailPause','openchannelPause','smsPause','pauseType'];(function(_0x32cc94,_0x3f60e4){var _0x541a62=function(_0x252377){while(--_0x252377){_0x32cc94['push'](_0x32cc94['shift']());}};_0x541a62(++_0x3f60e4);}(_0xfdaf,0x112));var _0xffda=function(_0x2a6b54,_0x5a167f){_0x2a6b54=_0x2a6b54-0x0;var _0x642aed=_0xfdaf[_0x2a6b54];return _0x642aed;};'use strict';var _=require('lodash');var util=require(_0xffda('0x0'));var moment=require(_0xffda('0x1'));var BPromise=require('bluebird');var Redis=require('ioredis');var db=require(_0xffda('0x2'))['db'];var utils=require(_0xffda('0x3'));var logger=require(_0xffda('0x4'))(_0xffda('0x5'));var config=require(_0xffda('0x6'));config[_0xffda('0x7')]=_[_0xffda('0x8')](config[_0xffda('0x7')],{'host':_0xffda('0x9'),'port':0x18eb});var socket=require(_0xffda('0xa'))(new Redis(config['redis']));require(_0xffda('0xb'))[_0xffda('0xc')](socket);exports[_0xffda('0xd')]=function(_0x5c64a7){var _0x5a97ec=this;return new Promise(function(_0x1653c2,_0x595f6b){return db[_0xffda('0xe')][_0xffda('0xf')]({'raw':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7['options'][_0xffda('0x11')]===undefined?!![]:![]:!![],'where':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7[_0xffda('0x10')][_0xffda('0x12')]||null:null,'attributes':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7[_0xffda('0x10')]['attributes']||null:null,'limit':_0x5c64a7[_0xffda('0x10')]?_0x5c64a7['options'][_0xffda('0x13')]||null:null,'include':_0x5c64a7['options']?_0x5c64a7['options'][_0xffda('0x14')]?_[_0xffda('0x15')](_0x5c64a7[_0xffda('0x10')][_0xffda('0x14')],function(_0x282aa6){return{'model':db[_0x282aa6['model']],'as':_0x282aa6['as'],'attributes':_0x282aa6['attributes'],'include':_0x282aa6['include']?_[_0xffda('0x15')](_0x282aa6[_0xffda('0x14')],function(_0x4a40c8){return{'model':db[_0x4a40c8[_0xffda('0x16')]],'as':_0x4a40c8['as'],'attributes':_0x4a40c8[_0xffda('0x17')],'include':_0x4a40c8[_0xffda('0x14')]?_[_0xffda('0x15')](_0x4a40c8[_0xffda('0x14')],function(_0x4cb6da){return{'model':db[_0x4cb6da[_0xffda('0x16')]],'as':_0x4cb6da['as'],'attributes':_0x4cb6da[_0xffda('0x17')]};}):[]};}):[]};}):[]:[]})[_0xffda('0x18')](function(_0x434a08){logger[_0xffda('0x19')]('GetUser',_0x5c64a7);logger[_0xffda('0x1a')](_0xffda('0xd'),_0x5c64a7,JSON[_0xffda('0x1b')](_0x434a08));_0x1653c2(_0x434a08);})[_0xffda('0x1c')](function(_0x13d95d){logger[_0xffda('0x1d')](_0xffda('0xd'),_0x13d95d[_0xffda('0x1e')],_0x5c64a7);_0x595f6b(_0x5a97ec[_0xffda('0x1d')](0x1f4,_0x13d95d['message']));});});};exports[_0xffda('0x1f')]=function(_0x59dc36){var _0x313563=this;return new Promise(function(_0x4eb183,_0x3abda2){return db[_0xffda('0xe')]['find']({'raw':_0x59dc36[_0xffda('0x10')]?_0x59dc36['options']['raw']===undefined?!![]:![]:!![],'where':_0x59dc36[_0xffda('0x10')]?_0x59dc36[_0xffda('0x10')]['where']||null:null,'attributes':_0x59dc36[_0xffda('0x10')]?_0x59dc36[_0xffda('0x10')][_0xffda('0x17')]||null:null,'include':_0x59dc36['options']?_0x59dc36[_0xffda('0x10')][_0xffda('0x14')]?_[_0xffda('0x15')](_0x59dc36['options']['include'],function(_0x475930){return{'model':db[_0x475930['model']],'as':_0x475930['as'],'attributes':_0x475930['attributes'],'include':_0x475930[_0xffda('0x14')]?_['map'](_0x475930[_0xffda('0x14')],function(_0x2d7956){return{'model':db[_0x2d7956[_0xffda('0x16')]],'as':_0x2d7956['as'],'attributes':_0x2d7956[_0xffda('0x17')],'include':_0x2d7956[_0xffda('0x14')]?_['map'](_0x2d7956[_0xffda('0x14')],function(_0x3b0a50){return{'model':db[_0x3b0a50[_0xffda('0x16')]],'as':_0x3b0a50['as'],'attributes':_0x3b0a50['attributes']};}):[]};}):[]};}):[]:[]})[_0xffda('0x18')](function(_0xdea9f){logger[_0xffda('0x19')](_0xffda('0x1f'),_0x59dc36);logger[_0xffda('0x1a')](_0xffda('0x1f'),_0x59dc36,JSON['stringify'](_0xdea9f));_0x4eb183(_0xdea9f);})[_0xffda('0x1c')](function(_0x1a0499){logger[_0xffda('0x1d')](_0xffda('0x1f'),_0x1a0499[_0xffda('0x1e')],_0x59dc36);_0x3abda2(_0x313563['error'](0x1f4,_0x1a0499[_0xffda('0x1e')]));});});};exports['PauseUser']=function(_0x155e6b){var _0x43e990;return db[_0xffda('0xe')][_0xffda('0x20')]({'where':_0x155e6b[_0xffda('0x10')]['where']||{},'attributes':['id',_0xffda('0x21'),'role','internal','interface']})[_0xffda('0x18')](function(_0x49ee09){if(!_0x49ee09){throw new Error(util[_0xffda('0x22')]('User\x20with\x20id\x20%s\x20not\x20found',_0x155e6b[_0xffda('0x23')]['id']));}_0x43e990=_0x49ee09;return db[_0xffda('0x24')][_0xffda('0x25')]({'paused':0x1},{'where':{'UserId':_0x43e990['id']},'individualHooks':!![]});})[_0xffda('0x18')](function(){return db[_0xffda('0x26')][_0xffda('0xf')]({'where':{'membername':_0x43e990[_0xffda('0x21')],'type':'PAUSE','exitAt':null}});})[_0xffda('0x18')](function(_0x594942){if(_0x594942&&_0x594942[_0xffda('0x27')]){var _0x131584=moment()[_0xffda('0x22')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x5e334e=0x0,_0x5bc5af=_0x594942[_0xffda('0x27')];_0x5e334e<_0x5bc5af;_0x5e334e++){_0x594942[_0x5e334e][_0xffda('0x28')]({'exitAt':_0x131584});}}})['then'](function(){var _0x7c19d1=[];var _0x4744e7=utils['getChannels']();_0x4744e7[_0xffda('0x29')](function(_0x4ef4bd){_0x7c19d1[_0xffda('0x2a')]({'channel':_0x4ef4bd,'membername':_0x43e990['name'],'interface':_[_0xffda('0x2b')](_0x43e990[_0xffda('0x2c')])?util['format'](_0xffda('0x2d'),_0x43e990['name']):_0x43e990[_0xffda('0x2c')],'type':_0xffda('0x2e'),'enterAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'data1':_0x155e6b['body'][_0xffda('0x30')]||'DEFAULT\x20PAUSE','role':_0x43e990['role'],'internal':_0x43e990[_0xffda('0x31')],'uniqueid':_0x155e6b[_0xffda('0x32')][_0xffda('0x33')]||null});});return db[_0xffda('0x26')][_0xffda('0x34')](_0x7c19d1,{'individualHooks':!![]});})[_0xffda('0x18')](function(){return _0x43e990[_0xffda('0x25')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x155e6b[_0xffda('0x32')][_0xffda('0x30')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0xffda('0x2f'))});})[_0xffda('0x1c')](function(_0x5a7776){throw _0x5a7776;});};exports[_0xffda('0x35')]=function(_0x15defb){return Promise[_0xffda('0x36')]()[_0xffda('0x18')](function(){if(_0x15defb[_0xffda('0x32')][_0xffda('0x37')]&&!utils[_0xffda('0x38')](_0x15defb[_0xffda('0x32')][_0xffda('0x37')])){throw new Error(util[_0xffda('0x22')](_0xffda('0x39'),_0x15defb[_0xffda('0x32')]['channel']));}return db[_0xffda('0xe')][_0xffda('0x3a')]({'where':_0x15defb[_0xffda('0x10')][_0xffda('0x12')]||{},'attributes':['id','name',_0xffda('0x3b'),_0xffda('0x31'),_0xffda('0x2c'),_0xffda('0x3c'),_0xffda('0x3d'),_0xffda('0x3e'),'chatPause','faxPause',_0xffda('0x3f'),_0xffda('0x40'),'whatsappPause',_0xffda('0x41'),'lastPauseAt']});})[_0xffda('0x18')](function(_0x33b2d5){if(!_0x33b2d5){throw new Error(util[_0xffda('0x22')](_0xffda('0x42'),_0x15defb[_0xffda('0x23')]['id']));}return _0x33b2d5[_0xffda('0x43')](_0x15defb['body'][_0xffda('0x37')],'system');})[_0xffda('0x1c')](function(_0x3fbf71){throw _0x3fbf71;});};exports['LogoutUser']=function(_0x52ea38){var _0x2578db=this;return new Promise(function(_0x4a971a,_0x2f1d23){var _0xdbeba5;return db[_0xffda('0xe')][_0xffda('0x3a')]({'where':_0x52ea38['options']['where']||{},'attributes':['id',_0xffda('0x21')]})[_0xffda('0x18')](function(_0x508b37){if(_0x508b37){_0xdbeba5=_0x508b37;return db['UserVoiceQueueRt'][_0xffda('0x44')]({'where':{'membername':_0xdbeba5[_0xffda('0x21')]},'individualHooks':!![]});}})[_0xffda('0x18')](function(){if(_0xdbeba5){return db[_0xffda('0x26')][_0xffda('0xf')]({'where':{'membername':_0xdbeba5[_0xffda('0x21')],'exitAt':null}});}})[_0xffda('0x18')](function(_0x53bedf){if(_0xdbeba5){if(_0x53bedf&&_0x53bedf[_0xffda('0x27')]){var _0x6ab9a9=[];_0x53bedf[_0xffda('0x29')](function(_0x5ab025){_0x6ab9a9[_0xffda('0x2a')](_0x5ab025[_0xffda('0x25')]({'exitAt':moment()[_0xffda('0x22')](_0xffda('0x2f'))}));});return BPromise[_0xffda('0x45')](_0x6ab9a9);}}})[_0xffda('0x18')](function(){if(_0xdbeba5){return _0xdbeba5[_0xffda('0x25')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xffda('0x18')](function(_0x38a697){_0x4a971a(_0x38a697);})[_0xffda('0x1c')](function(_0x3b6911){_0x2f1d23(_0x2578db['error'](0x1f4,_0x3b6911[_0xffda('0x1e')]));});});};exports[_0xffda('0x46')]=function(_0x3d99ac){var _0x4b3716=this;return new Promise(function(_0x880c75,_0x1f6548){var _0x279204;var _0x3491a1;var _0x5b18c9;var _0x3358f9;return db[_0xffda('0xe')][_0xffda('0x3a')]({'where':_0x3d99ac[_0xffda('0x10')][_0xffda('0x12')]||{},'attributes':['id',_0xffda('0x21'),'role',_0xffda('0x47'),_0xffda('0x48'),_0xffda('0x31'),'loginInPause',_0xffda('0x2c')]})[_0xffda('0x18')](function(_0x2eaf71){if(_0x2eaf71){_0x279204=_0x2eaf71;_0x3358f9=_0x3d99ac[_0xffda('0x32')][_0xffda('0x2c')]?_0x3d99ac[_0xffda('0x32')][_0xffda('0x2c')]:util[_0xffda('0x22')](_0xffda('0x2d'),_0x279204[_0xffda('0x21')]);return db[_0xffda('0xe')]['count']({'where':{'role':_0xffda('0x49'),'online':!![],'id':{'$ne':_0x279204['id']}}});}})[_0xffda('0x18')](function(_0x36e174){if(_0x36e174){_0x5b18c9=_0x36e174;return require(_0xffda('0x4a'))['getLicense']();}})['then'](function(_0x57aca0){if(_0x57aca0&&_0x57aca0['agents']&&_0x5b18c9>=_0x57aca0[_0xffda('0x4b')]){throw new Error(_0xffda('0x4c'));}})[_0xffda('0x18')](function(){if(_0x279204){return db[_0xffda('0x24')]['destroy']({'where':{'membername':_0x279204[_0xffda('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x279204){return _0x279204[_0xffda('0x4d')]({'raw':!![]});}})[_0xffda('0x18')](function(_0x3ae588){if(_0x279204){if(_0x3ae588){var _0x5ef9a6=[];_0x3491a1=_0x3ae588;if(_0x3491a1[_0xffda('0x27')]){for(var _0x19ccb3=0x0;_0x19ccb3<_0x3491a1[_0xffda('0x27')];_0x19ccb3++){_0x5ef9a6[_0xffda('0x2a')](db[_0xffda('0x24')][_0xffda('0x4e')]({'membername':_0x279204[_0xffda('0x21')],'UserId':_0x279204['id'],'queue_name':_0x3491a1[_0x19ccb3][_0xffda('0x21')],'VoiceQueueId':_0x3491a1[_0x19ccb3]['id'],'interface':_0x3358f9,'paused':_0x279204[_0xffda('0x4f')]||![],'penalty':_0x3491a1[_0x19ccb3][_0xffda('0x50')]||0x0}));}return BPromise['all'](_0x5ef9a6);}}}})[_0xffda('0x18')](function(){if(_0x279204){return db[_0xffda('0x26')]['findAll']({'where':{'membername':_0x279204[_0xffda('0x21')],'exitAt':null}});}})[_0xffda('0x18')](function(_0x1b1914){if(_0x279204){if(_0x1b1914&&_0x1b1914['length']){var _0x5b740e=[];_0x1b1914['forEach'](function(_0x106385){_0x5b740e[_0xffda('0x2a')](_0x106385[_0xffda('0x25')]({'exitAt':moment()[_0xffda('0x22')](_0xffda('0x2f'))}));});return BPromise[_0xffda('0x45')](_0x5b740e);}}})[_0xffda('0x18')](function(){if(_0x279204){var _0x556d2f=[];var _0xd8fe6=[];var _0x20320c=utils['getChannels']();var _0x139ba2={'membername':_0x279204[_0xffda('0x21')],'interface':_0x3358f9,'enterAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'role':_0x279204[_0xffda('0x3b')],'internal':_0x279204[_0xffda('0x31')]};_0x20320c[_0xffda('0x29')](function(_0x54d2f1){_0x556d2f['push'](_[_0xffda('0x51')]({'channel':_0x54d2f1,'type':'LOGIN','data1':_0xffda('0x52'),'data2':_0x3358f9},_0x139ba2));if(_0x279204[_0xffda('0x4f')]){_0xd8fe6['push'](_[_0xffda('0x51')]({'channel':_0x54d2f1,'type':_0xffda('0x2e'),'data1':'LOGININPAUSE'},_0x139ba2));}});return db[_0xffda('0x26')][_0xffda('0x34')](_0x556d2f[_0xffda('0x53')](_0xd8fe6),{'individualHooks':!![]});}})[_0xffda('0x18')](function(){if(_0x279204){return _0x279204[_0xffda('0x25')]({'online':!![],'lastLoginAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'voicePause':_0x279204[_0xffda('0x4f')]||![],'mailPause':_0x279204['loginInPause']||![],'chatPause':_0x279204[_0xffda('0x4f')]||![],'faxPause':_0x279204['loginInPause']||![],'smsPause':_0x279204[_0xffda('0x4f')]||![],'openchannelPause':_0x279204['loginInPause']||![],'pauseType':_0x279204['loginInPause']?_0xffda('0x54'):null,'lastPauseAt':moment()[_0xffda('0x22')](_0xffda('0x2f')),'interface':_0x3358f9});}})[_0xffda('0x18')](function(_0x5908e9){_0x880c75(_0x5908e9);})[_0xffda('0x1c')](function(_0x2df15a){_0x1f6548(_0x4b3716['error'](0x1f4,_0x2df15a['message']));});});};
\ No newline at end of file
+var _0xf0ae=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','register','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','message','error','ShowUser','find','then','info','catch','PauseUser','format','User\x20with\x20id\x20%s\x20not\x20found','UserVoiceQueueRt','update','name','PAUSE','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','push','isNil','interface','body','type','DEFAULT\x20PAUSE','role','internal','uniqueid','bulkCreate','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','params','unpause','system','LogoutUser','destroy','length','forEach','all','LoginUser','loginInPause','agent','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','MemberReport','concat','LOGININPAUSE','lodash'];(function(_0x4cacf1,_0x5b28cf){var _0x109869=function(_0x1fe47f){while(--_0x1fe47f){_0x4cacf1['push'](_0x4cacf1['shift']());}};_0x109869(++_0x5b28cf);}(_0xf0ae,0x19e));var _0xef0a=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xf0ae[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xef0a('0x0'));var util=require(_0xef0a('0x1'));var moment=require(_0xef0a('0x2'));var BPromise=require(_0xef0a('0x3'));var Redis=require(_0xef0a('0x4'));var db=require(_0xef0a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xef0a('0x6'))(_0xef0a('0x7'));var config=require(_0xef0a('0x8'));config['redis']=_['defaults'](config[_0xef0a('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef0a('0x9')]));require('./user.socket')[_0xef0a('0xa')](socket);exports[_0xef0a('0xb')]=function(_0xd652e3){var _0x486480=this;return new Promise(function(_0x108f56,_0x2a579a){return db[_0xef0a('0xc')][_0xef0a('0xd')]({'raw':_0xd652e3[_0xef0a('0xe')]?_0xd652e3[_0xef0a('0xe')][_0xef0a('0xf')]===undefined?!![]:![]:!![],'where':_0xd652e3[_0xef0a('0xe')]?_0xd652e3[_0xef0a('0xe')][_0xef0a('0x10')]||null:null,'attributes':_0xd652e3['options']?_0xd652e3['options'][_0xef0a('0x11')]||null:null,'limit':_0xd652e3['options']?_0xd652e3['options'][_0xef0a('0x12')]||null:null,'include':_0xd652e3[_0xef0a('0xe')]?_0xd652e3[_0xef0a('0xe')][_0xef0a('0x13')]?_[_0xef0a('0x14')](_0xd652e3[_0xef0a('0xe')]['include'],function(_0x432b01){return{'model':db[_0x432b01[_0xef0a('0x15')]],'as':_0x432b01['as'],'attributes':_0x432b01[_0xef0a('0x11')],'include':_0x432b01[_0xef0a('0x13')]?_[_0xef0a('0x14')](_0x432b01['include'],function(_0x361163){return{'model':db[_0x361163['model']],'as':_0x361163['as'],'attributes':_0x361163['attributes'],'include':_0x361163[_0xef0a('0x13')]?_[_0xef0a('0x14')](_0x361163[_0xef0a('0x13')],function(_0x27ecce){return{'model':db[_0x27ecce[_0xef0a('0x15')]],'as':_0x27ecce['as'],'attributes':_0x27ecce[_0xef0a('0x11')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ee564){logger['info'](_0xef0a('0xb'),_0xd652e3);logger[_0xef0a('0x16')](_0xef0a('0xb'),_0xd652e3,JSON[_0xef0a('0x17')](_0x5ee564));_0x108f56(_0x5ee564);})['catch'](function(_0x5f51b6){logger['error']('GetUser',_0x5f51b6[_0xef0a('0x18')],_0xd652e3);_0x2a579a(_0x486480[_0xef0a('0x19')](0x1f4,_0x5f51b6['message']));});});};exports[_0xef0a('0x1a')]=function(_0x582316){var _0x2f7cc0=this;return new Promise(function(_0x5a3bd8,_0x52ef56){return db[_0xef0a('0xc')][_0xef0a('0x1b')]({'raw':_0x582316['options']?_0x582316['options'][_0xef0a('0xf')]===undefined?!![]:![]:!![],'where':_0x582316[_0xef0a('0xe')]?_0x582316[_0xef0a('0xe')][_0xef0a('0x10')]||null:null,'attributes':_0x582316['options']?_0x582316[_0xef0a('0xe')][_0xef0a('0x11')]||null:null,'include':_0x582316[_0xef0a('0xe')]?_0x582316[_0xef0a('0xe')][_0xef0a('0x13')]?_[_0xef0a('0x14')](_0x582316[_0xef0a('0xe')][_0xef0a('0x13')],function(_0x294e96){return{'model':db[_0x294e96['model']],'as':_0x294e96['as'],'attributes':_0x294e96['attributes'],'include':_0x294e96['include']?_[_0xef0a('0x14')](_0x294e96['include'],function(_0x325395){return{'model':db[_0x325395[_0xef0a('0x15')]],'as':_0x325395['as'],'attributes':_0x325395[_0xef0a('0x11')],'include':_0x325395[_0xef0a('0x13')]?_[_0xef0a('0x14')](_0x325395[_0xef0a('0x13')],function(_0x529c3f){return{'model':db[_0x529c3f[_0xef0a('0x15')]],'as':_0x529c3f['as'],'attributes':_0x529c3f[_0xef0a('0x11')]};}):[]};}):[]};}):[]:[]})[_0xef0a('0x1c')](function(_0x2e2a61){logger[_0xef0a('0x1d')]('ShowUser',_0x582316);logger[_0xef0a('0x16')](_0xef0a('0x1a'),_0x582316,JSON[_0xef0a('0x17')](_0x2e2a61));_0x5a3bd8(_0x2e2a61);})[_0xef0a('0x1e')](function(_0x209d14){logger[_0xef0a('0x19')](_0xef0a('0x1a'),_0x209d14[_0xef0a('0x18')],_0x582316);_0x52ef56(_0x2f7cc0[_0xef0a('0x19')](0x1f4,_0x209d14[_0xef0a('0x18')]));});});};exports[_0xef0a('0x1f')]=function(_0x15086d){var _0x15d4f6;return db[_0xef0a('0xc')][_0xef0a('0x1b')]({'where':_0x15086d[_0xef0a('0xe')][_0xef0a('0x10')]||{},'attributes':['id','name','role','internal','interface']})['then'](function(_0x237454){if(!_0x237454){throw new Error(util[_0xef0a('0x20')](_0xef0a('0x21'),_0x15086d['params']['id']));}_0x15d4f6=_0x237454;return db[_0xef0a('0x22')][_0xef0a('0x23')]({'paused':0x1},{'where':{'UserId':_0x15d4f6['id']},'individualHooks':!![]});})[_0xef0a('0x1c')](function(){return db['MemberReport'][_0xef0a('0xd')]({'where':{'membername':_0x15d4f6[_0xef0a('0x24')],'type':_0xef0a('0x25'),'exitAt':null}});})[_0xef0a('0x1c')](function(_0x483752){if(_0x483752&&_0x483752['length']){var _0x563aed=moment()[_0xef0a('0x20')](_0xef0a('0x26'));for(var _0xd19f1d=0x0,_0x30a2f2=_0x483752['length'];_0xd19f1d<_0x30a2f2;_0xd19f1d++){_0x483752[_0xd19f1d][_0xef0a('0x27')]({'exitAt':_0x563aed});}}})['then'](function(){var _0x41d81f=[];var _0x5ac684=utils['getChannels']();_0x5ac684['forEach'](function(_0x27c61c){_0x41d81f[_0xef0a('0x28')]({'channel':_0x27c61c,'membername':_0x15d4f6[_0xef0a('0x24')],'interface':_[_0xef0a('0x29')](_0x15d4f6[_0xef0a('0x2a')])?util[_0xef0a('0x20')]('SIP/%s',_0x15d4f6['name']):_0x15d4f6[_0xef0a('0x2a')],'type':_0xef0a('0x25'),'enterAt':moment()[_0xef0a('0x20')](_0xef0a('0x26')),'data1':_0x15086d[_0xef0a('0x2b')][_0xef0a('0x2c')]||_0xef0a('0x2d'),'role':_0x15d4f6[_0xef0a('0x2e')],'internal':_0x15d4f6[_0xef0a('0x2f')],'uniqueid':_0x15086d[_0xef0a('0x2b')][_0xef0a('0x30')]||null});});return db['MemberReport'][_0xef0a('0x31')](_0x41d81f,{'individualHooks':!![]});})[_0xef0a('0x1c')](function(){return _0x15d4f6['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x15086d[_0xef0a('0x2b')][_0xef0a('0x2c')]||_0xef0a('0x2d'),'lastPauseAt':moment()[_0xef0a('0x20')](_0xef0a('0x26'))});})[_0xef0a('0x1e')](function(_0x4325cc){throw _0x4325cc;});};exports[_0xef0a('0x32')]=function(_0x3b65b2){return Promise['resolve']()[_0xef0a('0x1c')](function(){if(_0x3b65b2[_0xef0a('0x2b')][_0xef0a('0x33')]&&!utils[_0xef0a('0x34')](_0x3b65b2[_0xef0a('0x2b')][_0xef0a('0x33')])){throw new Error(util['format'](_0xef0a('0x35'),_0x3b65b2[_0xef0a('0x2b')][_0xef0a('0x33')]));}return db['User'][_0xef0a('0x36')]({'where':_0x3b65b2[_0xef0a('0xe')][_0xef0a('0x10')]||{},'attributes':['id',_0xef0a('0x24'),'role',_0xef0a('0x2f'),'interface','online','voicePause',_0xef0a('0x37'),'chatPause',_0xef0a('0x38'),_0xef0a('0x39'),_0xef0a('0x3a'),_0xef0a('0x3b'),'pauseType',_0xef0a('0x3c')]});})[_0xef0a('0x1c')](function(_0x31b591){if(!_0x31b591){throw new Error(util[_0xef0a('0x20')]('User\x20with\x20id\x20%s\x20not\x20found',_0x3b65b2[_0xef0a('0x3d')]['id']));}return _0x31b591[_0xef0a('0x3e')](_0x3b65b2[_0xef0a('0x2b')][_0xef0a('0x33')],_0xef0a('0x3f'));})[_0xef0a('0x1e')](function(_0x1ed66c){throw _0x1ed66c;});};exports[_0xef0a('0x40')]=function(_0x55e73c){var _0x582a16=this;return new Promise(function(_0x42bd93,_0x13d929){var _0x59429a;return db[_0xef0a('0xc')][_0xef0a('0x36')]({'where':_0x55e73c[_0xef0a('0xe')][_0xef0a('0x10')]||{},'attributes':['id','name']})[_0xef0a('0x1c')](function(_0x24e63e){if(_0x24e63e){_0x59429a=_0x24e63e;return db[_0xef0a('0x22')][_0xef0a('0x41')]({'where':{'membername':_0x59429a[_0xef0a('0x24')]},'individualHooks':!![]});}})[_0xef0a('0x1c')](function(){if(_0x59429a){return db['MemberReport'][_0xef0a('0xd')]({'where':{'membername':_0x59429a[_0xef0a('0x24')],'exitAt':null}});}})[_0xef0a('0x1c')](function(_0x50f0fc){if(_0x59429a){if(_0x50f0fc&&_0x50f0fc[_0xef0a('0x42')]){var _0x382cc5=[];_0x50f0fc[_0xef0a('0x43')](function(_0x1f16ef){_0x382cc5[_0xef0a('0x28')](_0x1f16ef[_0xef0a('0x23')]({'exitAt':moment()[_0xef0a('0x20')](_0xef0a('0x26'))}));});return BPromise[_0xef0a('0x44')](_0x382cc5);}}})[_0xef0a('0x1c')](function(){if(_0x59429a){return _0x59429a[_0xef0a('0x23')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xef0a('0x1c')](function(_0x8a26ba){_0x42bd93(_0x8a26ba);})[_0xef0a('0x1e')](function(_0x254b00){_0x13d929(_0x582a16[_0xef0a('0x19')](0x1f4,_0x254b00[_0xef0a('0x18')]));});});};exports[_0xef0a('0x45')]=function(_0x2771c4){var _0x5920f1=this;return new Promise(function(_0x52ee2f,_0x299071){var _0x1b8475;var _0x50df27;var _0x47c419;var _0x56ecc4;return db[_0xef0a('0xc')][_0xef0a('0x36')]({'where':_0x2771c4['options'][_0xef0a('0x10')]||{},'attributes':['id',_0xef0a('0x24'),'role','mobile','phone','internal',_0xef0a('0x46'),_0xef0a('0x2a')]})[_0xef0a('0x1c')](function(_0x42ec38){if(_0x42ec38){_0x1b8475=_0x42ec38;_0x56ecc4=_0x2771c4['body'][_0xef0a('0x2a')]?_0x2771c4[_0xef0a('0x2b')][_0xef0a('0x2a')]:util[_0xef0a('0x20')]('SIP/%s',_0x1b8475[_0xef0a('0x24')]);return db['User']['count']({'where':{'role':_0xef0a('0x47'),'online':!![],'id':{'$ne':_0x1b8475['id']}}});}})[_0xef0a('0x1c')](function(_0x326cbd){if(_0x326cbd){_0x47c419=_0x326cbd;return require('../../config/license/util')[_0xef0a('0x48')]();}})['then'](function(_0x1402cc){if(_0x1402cc&&_0x1402cc[_0xef0a('0x49')]&&_0x47c419>=_0x1402cc[_0xef0a('0x49')]){throw new Error(_0xef0a('0x4a'));}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return db['UserVoiceQueueRt'][_0xef0a('0x41')]({'where':{'membername':_0x1b8475[_0xef0a('0x24')]},'individualHooks':!![]});}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return _0x1b8475[_0xef0a('0x4b')]({'raw':!![]});}})[_0xef0a('0x1c')](function(_0x322c39){if(_0x1b8475){if(_0x322c39){var _0x4a4838=[];_0x50df27=_0x322c39;if(_0x50df27['length']){for(var _0x342dbc=0x0;_0x342dbc<_0x50df27[_0xef0a('0x42')];_0x342dbc++){_0x4a4838[_0xef0a('0x28')](db[_0xef0a('0x22')][_0xef0a('0x4c')]({'membername':_0x1b8475['name'],'UserId':_0x1b8475['id'],'queue_name':_0x50df27[_0x342dbc]['name'],'VoiceQueueId':_0x50df27[_0x342dbc]['id'],'interface':_0x56ecc4,'paused':_0x1b8475[_0xef0a('0x46')]||![],'penalty':_0x50df27[_0x342dbc][_0xef0a('0x4d')]||0x0}));}return BPromise['all'](_0x4a4838);}}}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return db['MemberReport'][_0xef0a('0xd')]({'where':{'membername':_0x1b8475[_0xef0a('0x24')],'exitAt':null}});}})[_0xef0a('0x1c')](function(_0x1197de){if(_0x1b8475){if(_0x1197de&&_0x1197de['length']){var _0x2a5a5c=[];_0x1197de[_0xef0a('0x43')](function(_0x275054){_0x2a5a5c['push'](_0x275054[_0xef0a('0x23')]({'exitAt':moment()['format'](_0xef0a('0x26'))}));});return BPromise[_0xef0a('0x44')](_0x2a5a5c);}}})[_0xef0a('0x1c')](function(){if(_0x1b8475){var _0x5580ba=[];var _0x3c4eb4=[];var _0x171879=utils['getChannels']();var _0x4c155f={'membername':_0x1b8475[_0xef0a('0x24')],'interface':_0x56ecc4,'enterAt':moment()['format'](_0xef0a('0x26')),'role':_0x1b8475['role'],'internal':_0x1b8475[_0xef0a('0x2f')]};_0x171879[_0xef0a('0x43')](function(_0x4ec713){_0x5580ba[_0xef0a('0x28')](_[_0xef0a('0x4e')]({'channel':_0x4ec713,'type':_0xef0a('0x4f'),'data1':'callysquare','data2':_0x56ecc4},_0x4c155f));if(_0x1b8475[_0xef0a('0x46')]){_0x3c4eb4[_0xef0a('0x28')](_['merge']({'channel':_0x4ec713,'type':_0xef0a('0x25'),'data1':'LOGININPAUSE'},_0x4c155f));}});return db[_0xef0a('0x50')][_0xef0a('0x31')](_0x5580ba[_0xef0a('0x51')](_0x3c4eb4),{'individualHooks':!![]});}})[_0xef0a('0x1c')](function(){if(_0x1b8475){return _0x1b8475[_0xef0a('0x23')]({'online':!![],'lastLoginAt':moment()[_0xef0a('0x20')](_0xef0a('0x26')),'voicePause':_0x1b8475[_0xef0a('0x46')]||![],'mailPause':_0x1b8475[_0xef0a('0x46')]||![],'chatPause':_0x1b8475['loginInPause']||![],'faxPause':_0x1b8475['loginInPause']||![],'smsPause':_0x1b8475[_0xef0a('0x46')]||![],'openchannelPause':_0x1b8475['loginInPause']||![],'pauseType':_0x1b8475[_0xef0a('0x46')]?_0xef0a('0x52'):null,'lastPauseAt':moment()[_0xef0a('0x20')](_0xef0a('0x26')),'interface':_0x56ecc4});}})[_0xef0a('0x1c')](function(_0x25a87a){_0x52ee2f(_0x25a87a);})[_0xef0a('0x1e')](function(_0x40ab3b){_0x299071(_0x5920f1[_0xef0a('0x19')](0x1f4,_0x40ab3b[_0xef0a('0x18')]));});});};
\ No newline at end of file
index f026460..5c7de37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f52=['emit','register','length','user:','./user.events','save','remove','update'];(function(_0x40ec09,_0x50ebbb){var _0x519192=function(_0x1b4ef7){while(--_0x1b4ef7){_0x40ec09['push'](_0x40ec09['shift']());}};_0x519192(++_0x50ebbb);}(_0x9f52,0x134));var _0x29f5=function(_0x26941c,_0x34162a){_0x26941c=_0x26941c-0x0;var _0x2fcfc3=_0x9f52[_0x26941c];return _0x2fcfc3;};'use strict';var UserEvents=require(_0x29f5('0x0'));var events=[_0x29f5('0x1'),_0x29f5('0x2'),_0x29f5('0x3')];function createListener(_0x559d52,_0x59fc63){return function(_0x9cac3f){_0x59fc63[_0x29f5('0x4')](_0x559d52,_0x9cac3f);};}function removeListener(_0x1b5fe3,_0x2562cf){return function(){UserEvents['removeListener'](_0x1b5fe3,_0x2562cf);};}exports[_0x29f5('0x5')]=function(_0x170dd9){for(var _0x54abbc=0x0,_0x46adf3=events[_0x29f5('0x6')];_0x54abbc<_0x46adf3;_0x54abbc++){var _0x55a66a=events[_0x54abbc];var _0x6f3379=createListener(_0x29f5('0x7')+_0x55a66a,_0x170dd9);UserEvents['on'](_0x55a66a,_0x6f3379);}};
\ No newline at end of file
+var _0xb500=['removeListener','register','user:','save','remove','update','emit'];(function(_0x5a3324,_0x132fb1){var _0x5d3ab6=function(_0x1823e0){while(--_0x1823e0){_0x5a3324['push'](_0x5a3324['shift']());}};_0x5d3ab6(++_0x132fb1);}(_0xb500,0xff));var _0x0b50=function(_0x2e2636,_0x58b3cd){_0x2e2636=_0x2e2636-0x0;var _0x5805a6=_0xb500[_0x2e2636];return _0x5805a6;};'use strict';var UserEvents=require('./user.events');var events=[_0x0b50('0x0'),_0x0b50('0x1'),_0x0b50('0x2')];function createListener(_0x4f9f01,_0x429885){return function(_0x335ead){_0x429885[_0x0b50('0x3')](_0x4f9f01,_0x335ead);};}function removeListener(_0x1efefc,_0x371eb1){return function(){UserEvents[_0x0b50('0x4')](_0x1efefc,_0x371eb1);};}exports[_0x0b50('0x5')]=function(_0x54c838){for(var _0x18ee7a=0x0,_0x3fc73a=events['length'];_0x18ee7a<_0x3fc73a;_0x18ee7a++){var _0x2cbbc4=events[_0x18ee7a];var _0x17f7dc=createListener(_0x0b50('0x6')+_0x2cbbc4,_0x54c838);UserEvents['on'](_0x2cbbc4,_0x17f7dc);}};
\ No newline at end of file
index 78d96e9..718122b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5da6ae,_0x530614){var _0x2ca91b=function(_0x5ec14c){while(--_0x5ec14c){_0x5da6ae['push'](_0x5da6ae['shift']());}};_0x2ca91b(++_0x530614);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x25712d,_0x5cf614){var _0x2cc1f0=function(_0x3381f3){while(--_0x3381f3){_0x25712d['push'](_0x25712d['shift']());}};_0x2cc1f0(++_0x5cf614);}(_0xedd9,0xfc));var _0x9edd=function(_0x377b26,_0xa98089){_0x377b26=_0x377b26-0x0;var _0x5b79f3=_0xedd9[_0x377b26];return _0x5b79f3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 0fe0fd1..9b99aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2e6=['INTEGER','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd2e6,0x195));var _0x6d2e=function(_0x5da949,_0x1b37ac){_0x5da949=_0x5da949-0x0;var _0x16d6de=_0xd2e6[_0x5da949];return _0x16d6de;};'use strict';var Sequelize=require(_0x6d2e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6d2e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xee73=['INTEGER','sequelize','exports'];(function(_0x511d82,_0x53f0a4){var _0x224903=function(_0x58c059){while(--_0x58c059){_0x511d82['push'](_0x511d82['shift']());}};_0x224903(++_0x53f0a4);}(_0xee73,0x196));var _0x3ee7=function(_0x2492dc,_0x3284a7){_0x2492dc=_0x2492dc-0x0;var _0x310431=_0xee73[_0x2492dc];return _0x310431;};'use strict';var Sequelize=require(_0x3ee7('0x0'));module[_0x3ee7('0x1')]={'penalty':{'type':Sequelize[_0x3ee7('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 4867c2d..de38c66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2360=['../../config/environment','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2c24df,_0x2e46a3){var _0x309b15=function(_0x5d525b){while(--_0x5d525b){_0x2c24df['push'](_0x2c24df['shift']());}};_0x309b15(++_0x2e46a3);}(_0x2360,0xad));var _0x0236=function(_0x4ce2b0,_0xcd1337){_0x4ce2b0=_0x4ce2b0-0x0;var _0x2a059f=_0x2360[_0x4ce2b0];return _0x2a059f;};'use strict';var _=require(_0x0236('0x0'));var util=require(_0x0236('0x1'));var logger=require(_0x0236('0x2'))(_0x0236('0x3'));var moment=require(_0x0236('0x4'));var BPromise=require(_0x0236('0x5'));var rp=require(_0x0236('0x6'));var fs=require('fs');var path=require(_0x0236('0x7'));var rimraf=require(_0x0236('0x8'));var config=require(_0x0236('0x9'));var attributes=require('./userChatQueue.attributes');module[_0x0236('0xa')]=function(_0x42f1e9,_0x189587){return _0x42f1e9[_0x0236('0xb')](_0x0236('0xc'),attributes,{'tableName':_0x0236('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x88ce=['rimraf','../../config/environment','define','UserChatQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x52c3b8,_0x1c47e4){var _0x1c81d7=function(_0x2f3c49){while(--_0x2f3c49){_0x52c3b8['push'](_0x52c3b8['shift']());}};_0x1c81d7(++_0x1c47e4);}(_0x88ce,0x9e));var _0xe88c=function(_0x5ce961,_0x32151e){_0x5ce961=_0x5ce961-0x0;var _0x291b0f=_0x88ce[_0x5ce961];return _0x291b0f;};'use strict';var _=require(_0xe88c('0x0'));var util=require(_0xe88c('0x1'));var logger=require(_0xe88c('0x2'))(_0xe88c('0x3'));var moment=require('moment');var BPromise=require(_0xe88c('0x4'));var rp=require(_0xe88c('0x5'));var fs=require('fs');var path=require(_0xe88c('0x6'));var rimraf=require(_0xe88c('0x7'));var config=require(_0xe88c('0x8'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x12662b,_0x32553e){return _0x12662b[_0xe88c('0x9')](_0xe88c('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6dcba2d..986479d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbeb=['UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0xfbeb,0x118));var _0xbfbe=function(_0x36f641,_0x1a3063){_0x36f641=_0x36f641-0x0;var _0x39b299=_0xfbeb[_0x36f641];return _0x39b299;};'use strict';var _=require('lodash');var util=require(_0xbfbe('0x0'));var moment=require(_0xbfbe('0x1'));var BPromise=require(_0xbfbe('0x2'));var rs=require(_0xbfbe('0x3'));var fs=require('fs');var Redis=require(_0xbfbe('0x4'));var db=require(_0xbfbe('0x5'))['db'];var utils=require(_0xbfbe('0x6'));var logger=require(_0xbfbe('0x7'))(_0xbfbe('0x8'));var config=require('../../config/environment');var jayson=require(_0xbfbe('0x9'));var client=jayson[_0xbfbe('0xa')][_0xbfbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x59fd34,_0x40ec4e,_0x1d6bea){return new BPromise(function(_0x4cb386,_0x2e3ce5){return client[_0xbfbe('0xc')](_0x59fd34,_0x1d6bea)['then'](function(_0x3f49a6){logger[_0xbfbe('0xd')](_0xbfbe('0xe'),_0x40ec4e,_0xbfbe('0xf'));logger[_0xbfbe('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x40ec4e,'request\x20sent',JSON[_0xbfbe('0x11')](_0x3f49a6));if(_0x3f49a6[_0xbfbe('0x12')]){if(_0x3f49a6[_0xbfbe('0x12')]['code']===0x1f4){logger['error'](_0xbfbe('0xe'),_0x40ec4e,_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);return _0x2e3ce5(_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);}logger[_0xbfbe('0x12')](_0xbfbe('0xe'),_0x40ec4e,_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);return _0x4cb386(_0x3f49a6[_0xbfbe('0x12')][_0xbfbe('0x13')]);}else{logger[_0xbfbe('0xd')](_0xbfbe('0xe'),_0x40ec4e,_0xbfbe('0xf'));_0x4cb386(_0x3f49a6[_0xbfbe('0x14')][_0xbfbe('0x13')]);}})['catch'](function(_0x5e19ba){logger[_0xbfbe('0x12')](_0xbfbe('0xe'),_0x40ec4e,_0x5e19ba);_0x2e3ce5(_0x5e19ba);});});}
\ No newline at end of file
+var _0xf31c=['debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','request\x20sent'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xf31c,0x168));var _0xcf31=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xf31c[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xcf31('0x0'));var util=require(_0xcf31('0x1'));var moment=require(_0xcf31('0x2'));var BPromise=require(_0xcf31('0x3'));var rs=require(_0xcf31('0x4'));var fs=require('fs');var Redis=require(_0xcf31('0x5'));var db=require(_0xcf31('0x6'))['db'];var utils=require(_0xcf31('0x7'));var logger=require(_0xcf31('0x8'))(_0xcf31('0x9'));var config=require('../../config/environment');var jayson=require(_0xcf31('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x16a302,_0x381e53,_0x254350){return new BPromise(function(_0x1f49d2,_0x36f574){return client[_0xcf31('0xb')](_0x16a302,_0x254350)['then'](function(_0x2eb715){logger[_0xcf31('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x381e53,_0xcf31('0xd'));logger[_0xcf31('0xe')](_0xcf31('0xf'),_0x381e53,'request\x20sent',JSON[_0xcf31('0x10')](_0x2eb715));if(_0x2eb715[_0xcf31('0x11')]){if(_0x2eb715[_0xcf31('0x11')][_0xcf31('0x12')]===0x1f4){logger['error'](_0xcf31('0x13'),_0x381e53,_0x2eb715[_0xcf31('0x11')][_0xcf31('0x14')]);return _0x36f574(_0x2eb715[_0xcf31('0x11')][_0xcf31('0x14')]);}logger['error'](_0xcf31('0x13'),_0x381e53,_0x2eb715[_0xcf31('0x11')]['message']);return _0x1f49d2(_0x2eb715[_0xcf31('0x11')]['message']);}else{logger[_0xcf31('0xc')](_0xcf31('0x13'),_0x381e53,_0xcf31('0xd'));_0x1f49d2(_0x2eb715[_0xcf31('0x15')][_0xcf31('0x14')]);}})['catch'](function(_0x523385){logger[_0xcf31('0x11')](_0xcf31('0x13'),_0x381e53,_0x523385);_0x36f574(_0x523385);});});}
\ No newline at end of file
index 3f49711..e3be2e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x109f15,_0x1cc0dc){var _0x34f08e=function(_0x42c683){while(--_0x42c683){_0x109f15['push'](_0x109f15['shift']());}};_0x34f08e(++_0x1cc0dc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0xcb91[_0x4b91c4];return _0x25cb80;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x2ee96a,_0x4e4cf1){var _0x5e62aa=function(_0x37f60f){while(--_0x37f60f){_0x2ee96a['push'](_0x2ee96a['shift']());}};_0x5e62aa(++_0x4e4cf1);}(_0xedd9,0xfc));var _0x9edd=function(_0x14406e,_0x2502b2){_0x14406e=_0x14406e-0x0;var _0x1474e9=_0xedd9[_0x14406e];return _0x1474e9;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 2c8e07b..5ef7278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8428=['sequelize','exports','INTEGER','STRING'];(function(_0x58d98a,_0x3040c3){var _0x4274ba=function(_0x3573db){while(--_0x3573db){_0x58d98a['push'](_0x58d98a['shift']());}};_0x4274ba(++_0x3040c3);}(_0x8428,0xcc));var _0x8842=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8428[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8842('0x0'));module[_0x8842('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8842('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x8842('0x3')]}};
\ No newline at end of file
+var _0xbd3a=['STRING','sequelize','exports','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbd3a,0x13d));var _0xabd3=function(_0x4979f4,_0x415768){_0x4979f4=_0x4979f4-0x0;var _0x3cce90=_0xbd3a[_0x4979f4];return _0x3cce90;};'use strict';var Sequelize=require(_0xabd3('0x0'));module[_0xabd3('0x1')]={'penalty':{'type':Sequelize[_0xabd3('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xabd3('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xabd3('0x3')]}};
\ No newline at end of file
index e73d184..b475123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b85=['../../config/logger','moment','bluebird','path','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','util'];(function(_0x21b57f,_0x9ba5fb){var _0x3dac6f=function(_0x449042){while(--_0x449042){_0x21b57f['push'](_0x21b57f['shift']());}};_0x3dac6f(++_0x9ba5fb);}(_0x1b85,0x143));var _0x51b8=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x1b85[_0x2a0824];return _0x1a78f7;};'use strict';var _=require('lodash');var util=require(_0x51b8('0x0'));var logger=require(_0x51b8('0x1'))('api');var moment=require(_0x51b8('0x2'));var BPromise=require(_0x51b8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51b8('0x4'));var rimraf=require('rimraf');var config=require(_0x51b8('0x5'));var attributes=require(_0x51b8('0x6'));module['exports']=function(_0x2efbc6,_0x16ce26){return _0x2efbc6[_0x51b8('0x7')](_0x51b8('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x399e=['../../config/logger','moment','bluebird','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','lodash','util'];(function(_0x44989b,_0x1824e8){var _0x1c771c=function(_0xbbfbac){while(--_0xbbfbac){_0x44989b['push'](_0x44989b['shift']());}};_0x1c771c(++_0x1824e8);}(_0x399e,0x94));var _0xe399=function(_0x26dfc5,_0x138166){_0x26dfc5=_0x26dfc5-0x0;var _0x566350=_0x399e[_0x26dfc5];return _0x566350;};'use strict';var _=require(_0xe399('0x0'));var util=require(_0xe399('0x1'));var logger=require(_0xe399('0x2'))('api');var moment=require(_0xe399('0x3'));var BPromise=require(_0xe399('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe399('0x5'));var attributes=require(_0xe399('0x6'));module['exports']=function(_0x274ca1,_0x282dc9){return _0x274ca1[_0xe399('0x7')](_0xe399('0x8'),attributes,{'tableName':_0xe399('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d768098..3c65683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a02=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x9a02,0x7b));var _0x29a0=function(_0x2c7659,_0x24fa6a){_0x2c7659=_0x2c7659-0x0;var _0x2c7fb=_0x9a02[_0x2c7659];return _0x2c7fb;};'use strict';var _=require(_0x29a0('0x0'));var util=require(_0x29a0('0x1'));var moment=require(_0x29a0('0x2'));var BPromise=require(_0x29a0('0x3'));var rs=require(_0x29a0('0x4'));var fs=require('fs');var Redis=require(_0x29a0('0x5'));var db=require(_0x29a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x29a0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x29a0('0x8'));var client=jayson[_0x29a0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x384402,_0x428da1,_0x43431d){return new BPromise(function(_0x265a1c,_0x1c1ed2){return client[_0x29a0('0xa')](_0x384402,_0x43431d)[_0x29a0('0xb')](function(_0xfb317c){logger[_0x29a0('0xc')](_0x29a0('0xd'),_0x428da1,'request\x20sent');logger[_0x29a0('0xe')](_0x29a0('0xf'),_0x428da1,'request\x20sent',JSON[_0x29a0('0x10')](_0xfb317c));if(_0xfb317c[_0x29a0('0x11')]){if(_0xfb317c[_0x29a0('0x11')][_0x29a0('0x12')]===0x1f4){logger[_0x29a0('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x428da1,_0xfb317c[_0x29a0('0x11')][_0x29a0('0x13')]);return _0x1c1ed2(_0xfb317c['error'][_0x29a0('0x13')]);}logger[_0x29a0('0x11')](_0x29a0('0xd'),_0x428da1,_0xfb317c[_0x29a0('0x11')]['message']);return _0x265a1c(_0xfb317c['error']['message']);}else{logger[_0x29a0('0xc')](_0x29a0('0xd'),_0x428da1,'request\x20sent');_0x265a1c(_0xfb317c[_0x29a0('0x14')]['message']);}})['catch'](function(_0x124f1c){logger['error'](_0x29a0('0xd'),_0x428da1,_0x124f1c);_0x1c1ed2(_0x124f1c);});});}
\ No newline at end of file
+var _0xda64=['message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0xda64,0x144));var _0x4da6=function(_0x5a8d7c,_0x4b20a6){_0x5a8d7c=_0x5a8d7c-0x0;var _0x444a75=_0xda64[_0x5a8d7c];return _0x444a75;};'use strict';var _=require(_0x4da6('0x0'));var util=require(_0x4da6('0x1'));var moment=require(_0x4da6('0x2'));var BPromise=require(_0x4da6('0x3'));var rs=require(_0x4da6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4da6('0x5'))['db'];var utils=require(_0x4da6('0x6'));var logger=require('../../config/logger')(_0x4da6('0x7'));var config=require('../../config/environment');var jayson=require(_0x4da6('0x8'));var client=jayson[_0x4da6('0x9')][_0x4da6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51cc6f,_0x155d4a,_0x184639){return new BPromise(function(_0x57655e,_0x5ad4ab){return client[_0x4da6('0xb')](_0x51cc6f,_0x184639)[_0x4da6('0xc')](function(_0x53aec7){logger[_0x4da6('0xd')](_0x4da6('0xe'),_0x155d4a,_0x4da6('0xf'));logger[_0x4da6('0x10')](_0x4da6('0x11'),_0x155d4a,_0x4da6('0xf'),JSON[_0x4da6('0x12')](_0x53aec7));if(_0x53aec7[_0x4da6('0x13')]){if(_0x53aec7[_0x4da6('0x13')][_0x4da6('0x14')]===0x1f4){logger[_0x4da6('0x13')](_0x4da6('0xe'),_0x155d4a,_0x53aec7[_0x4da6('0x13')][_0x4da6('0x15')]);return _0x5ad4ab(_0x53aec7['error']['message']);}logger[_0x4da6('0x13')](_0x4da6('0xe'),_0x155d4a,_0x53aec7[_0x4da6('0x13')][_0x4da6('0x15')]);return _0x57655e(_0x53aec7[_0x4da6('0x13')][_0x4da6('0x15')]);}else{logger[_0x4da6('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x155d4a,_0x4da6('0xf'));_0x57655e(_0x53aec7['result']['message']);}})[_0x4da6('0x16')](function(_0x29c1d5){logger[_0x4da6('0x13')](_0x4da6('0xe'),_0x155d4a,_0x29c1d5);_0x5ad4ab(_0x29c1d5);});});}
\ No newline at end of file
index dc257b4..ec12af2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x573dbd,_0x17cc62){var _0xb58003=function(_0x214e5c){while(--_0x214e5c){_0x573dbd['push'](_0x573dbd['shift']());}};_0xb58003(++_0x17cc62);}(_0xe706,0xa3));var _0x6e70=function(_0x236e77,_0x388743){_0x236e77=_0x236e77-0x0;var _0x59e31f=_0xe706[_0x236e77];return _0x59e31f;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x126420,_0x476f16){var _0x4e6517=function(_0x24134b){while(--_0x24134b){_0x126420['push'](_0x126420['shift']());}};_0x4e6517(++_0x476f16);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 4b47b89..b20edb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdffe=['exports'];(function(_0x55aae7,_0x3862e4){var _0x3172e0=function(_0x1c8cc6){while(--_0x1c8cc6){_0x55aae7['push'](_0x55aae7['shift']());}};_0x3172e0(++_0x3862e4);}(_0xdffe,0x1d2));var _0xedff=function(_0x506f64,_0x395f5a){_0x506f64=_0x506f64-0x0;var _0x389fdb=_0xdffe[_0x506f64];return _0x389fdb;};'use strict';var Sequelize=require('sequelize');module[_0xedff('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8d30=['exports','INTEGER','sequelize'];(function(_0x22e1c1,_0x331397){var _0x5d5f4d=function(_0x4aa203){while(--_0x4aa203){_0x22e1c1['push'](_0x22e1c1['shift']());}};_0x5d5f4d(++_0x331397);}(_0x8d30,0x128));var _0x08d3=function(_0x5161fc,_0x37c5f6){_0x5161fc=_0x5161fc-0x0;var _0x38490b=_0x8d30[_0x5161fc];return _0x38490b;};'use strict';var Sequelize=require(_0x08d3('0x0'));module[_0x08d3('0x1')]={'penalty':{'type':Sequelize[_0x08d3('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 98f36e4..bdfcee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe0a=['moment','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash','util','api'];(function(_0x484ad6,_0x4efaee){var _0x4950d0=function(_0x11afec){while(--_0x11afec){_0x484ad6['push'](_0x484ad6['shift']());}};_0x4950d0(++_0x4efaee);}(_0xbe0a,0x105));var _0xabe0=function(_0x22530e,_0x2c4b1e){_0x22530e=_0x22530e-0x0;var _0x5b94dc=_0xbe0a[_0x22530e];return _0x5b94dc;};'use strict';var _=require(_0xabe0('0x0'));var util=require(_0xabe0('0x1'));var logger=require('../../config/logger')(_0xabe0('0x2'));var moment=require(_0xabe0('0x3'));var BPromise=require('bluebird');var rp=require(_0xabe0('0x4'));var fs=require('fs');var path=require(_0xabe0('0x5'));var rimraf=require(_0xabe0('0x6'));var config=require(_0xabe0('0x7'));var attributes=require(_0xabe0('0x8'));module[_0xabe0('0x9')]=function(_0x46b889,_0x4bb74e){return _0x46b889['define'](_0xabe0('0xa'),attributes,{'tableName':_0xabe0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe916=['rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','lodash','util','moment','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe916,0x7e));var _0x6e91=function(_0x231f0f,_0x5a609f){_0x231f0f=_0x231f0f-0x0;var _0x19a94e=_0xe916[_0x231f0f];return _0x19a94e;};'use strict';var _=require(_0x6e91('0x0'));var util=require(_0x6e91('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6e91('0x2'));var BPromise=require(_0x6e91('0x3'));var rp=require(_0x6e91('0x4'));var fs=require('fs');var path=require(_0x6e91('0x5'));var rimraf=require(_0x6e91('0x6'));var config=require(_0x6e91('0x7'));var attributes=require(_0x6e91('0x8'));module['exports']=function(_0x3ea934,_0x315c21){return _0x3ea934[_0x6e91('0x9')](_0x6e91('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dd8a6f0..022c55e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b1cab,_0x5e5ce7){var _0x140f08=function(_0x137915){while(--_0x137915){_0x3b1cab['push'](_0x3b1cab['shift']());}};_0x140f08(++_0x5e5ce7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
+var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x50af06,_0x42816d){var _0x920e66=function(_0x37e033){while(--_0x37e033){_0x50af06['push'](_0x50af06['shift']());}};_0x920e66(++_0x42816d);}(_0x55ca,0x126));var _0xa55c=function(_0x46c8fb,_0x253501){_0x46c8fb=_0x46c8fb-0x0;var _0x48f9eb=_0x55ca[_0x46c8fb];return _0x48f9eb;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}
\ No newline at end of file
index cd93acb..7851640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf395=['util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer'];(function(_0x1bafe3,_0x2a22aa){var _0x15c0d3=function(_0x548bda){while(--_0x548bda){_0x1bafe3['push'](_0x1bafe3['shift']());}};_0x15c0d3(++_0x2a22aa);}(_0xf395,0xa7));var _0x5f39=function(_0x2b69d3,_0x4d7ace){_0x2b69d3=_0x2b69d3-0x0;var _0x10e7ad=_0xf395[_0x2b69d3];return _0x10e7ad;};'use strict';var multer=require(_0x5f39('0x0'));var util=require(_0x5f39('0x1'));var path=require('path');var timeout=require(_0x5f39('0x2'));var express=require('express');var router=express[_0x5f39('0x3')]();var fs_extra=require(_0x5f39('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5f39('0x5'));var config=require(_0x5f39('0x6'));var controller=require(_0x5f39('0x7'));router[_0x5f39('0x8')]('/',auth[_0x5f39('0x9')](),controller[_0x5f39('0xa')]);module[_0x5f39('0xb')]=router;
\ No newline at end of file
+var _0x85c1=['Router','fs-extra','../../config/environment','./userNotification.controller','post','isAuthenticated','exports','multer','util','path','connect-timeout','express'];(function(_0x46c23f,_0x209300){var _0xda89c9=function(_0x2548e8){while(--_0x2548e8){_0x46c23f['push'](_0x46c23f['shift']());}};_0xda89c9(++_0x209300);}(_0x85c1,0x127));var _0x185c=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x85c1[_0x3eb630];return _0x1b840d;};'use strict';var multer=require(_0x185c('0x0'));var util=require(_0x185c('0x1'));var path=require(_0x185c('0x2'));var timeout=require(_0x185c('0x3'));var express=require(_0x185c('0x4'));var router=express[_0x185c('0x5')]();var fs_extra=require(_0x185c('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x185c('0x7'));var controller=require(_0x185c('0x8'));router[_0x185c('0x9')]('/',auth[_0x185c('0xa')](),controller['sendUserNotification']);module[_0x185c('0xb')]=router;
\ No newline at end of file
index 87edfe3..98631cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ad9=['STRING','exports','TEXT'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x4ad9,0x1c9));var _0x94ad=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4ad9[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0x94ad('0x0')]={'body':{'type':Sequelize[_0x94ad('0x1')]},'senderName':{'type':Sequelize[_0x94ad('0x2')]},'recipientsId':{'type':Sequelize[_0x94ad('0x1')]},'recipientsDescription':{'type':Sequelize[_0x94ad('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
+var _0x2058=['exports','TEXT','STRING','BOOLEAN'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2058,0xe0));var _0x8205=function(_0x5b47d9,_0x1327ce){_0x5b47d9=_0x5b47d9-0x0;var _0x4151f0=_0x2058[_0x5b47d9];return _0x4151f0;};'use strict';var Sequelize=require('sequelize');module[_0x8205('0x0')]={'body':{'type':Sequelize[_0x8205('0x1')]},'senderName':{'type':Sequelize[_0x8205('0x2')]},'recipientsId':{'type':Sequelize[_0x8205('0x1')]},'recipientsDescription':{'type':Sequelize[_0x8205('0x2')]},'beep':{'type':Sequelize[_0x8205('0x3')]}};
\ No newline at end of file
index c9c6ca2..6f91b97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2acc=['recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','some','model','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sequelize','transaction','forEach','recipient','emit','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','includes','replace','Queue','push','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send','body','Sequelize','ValidationError','hasOwnProperty','Missing\x20\x27view\x27\x20parameter'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2acc,0xed));var _0xc2ac=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2acc[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc2ac('0x0'));var zipdir=require(_0xc2ac('0x1'));var jsonpatch=require(_0xc2ac('0x2'));var rp=require(_0xc2ac('0x3'));var moment=require(_0xc2ac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc2ac('0x5'));var util=require(_0xc2ac('0x6'));var path=require(_0xc2ac('0x7'));var sox=require(_0xc2ac('0x8'));var csv=require(_0xc2ac('0x9'));var ejs=require(_0xc2ac('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2ac('0xb'));var squel=require(_0xc2ac('0xc'));var crypto=require(_0xc2ac('0xd'));var jsforce=require(_0xc2ac('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc2ac('0x9'));var querystring=require(_0xc2ac('0xf'));var Papa=require(_0xc2ac('0x10'));var Redis=require(_0xc2ac('0x11'));var authService=require(_0xc2ac('0x12'));var qs=require(_0xc2ac('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc2ac('0x14'));var licenseUtil=require(_0xc2ac('0x15'));var db=require(_0xc2ac('0x16'))['db'];config[_0xc2ac('0x17')]=_[_0xc2ac('0x18')](config[_0xc2ac('0x17')],{'host':_0xc2ac('0x19'),'port':0x18eb});var socket=require(_0xc2ac('0x1a'))(new Redis(config[_0xc2ac('0x17')]));require(_0xc2ac('0x1b'))[_0xc2ac('0x1c')](socket);function respondWithStatusCode(_0xa851b1,_0xa1f399){_0xa1f399=_0xa1f399||0xcc;return function(_0x236aad){if(_0x236aad){return _0xa851b1[_0xc2ac('0x1d')](_0xa1f399);}return _0xa851b1['status'](_0xa1f399)[_0xc2ac('0x1e')]();};}function respondWithResult(_0x581bfb,_0x1ce06a){_0x1ce06a=_0x1ce06a||0xc8;return function(_0x53482c){if(_0x53482c){return _0x581bfb[_0xc2ac('0x1f')](_0x1ce06a)[_0xc2ac('0x20')](_0x53482c);}};}function respondWithFilteredResult(_0x3efe4c,_0x27ad05){return function(_0x23f6f9){if(_0x23f6f9){var _0x4e2704=typeof _0x27ad05[_0xc2ac('0x21')]===_0xc2ac('0x22')&&typeof _0x27ad05[_0xc2ac('0x23')]===_0xc2ac('0x22');var _0x4b3700=_0x23f6f9['count'];var _0x30ad8c=_0x4e2704?0x0:_0x27ad05[_0xc2ac('0x21')];var _0x53a39d=_0x4e2704?_0x23f6f9[_0xc2ac('0x24')]:_0x27ad05[_0xc2ac('0x21')]+_0x27ad05[_0xc2ac('0x23')];var _0x2995cb;if(_0x53a39d>=_0x4b3700){_0x53a39d=_0x4b3700;_0x2995cb=0xc8;}else{_0x2995cb=0xce;}_0x3efe4c[_0xc2ac('0x1f')](_0x2995cb);return _0x3efe4c[_0xc2ac('0x25')](_0xc2ac('0x26'),_0x30ad8c+'-'+_0x53a39d+'/'+_0x4b3700)[_0xc2ac('0x20')](_0x23f6f9);}return null;};}function patchUpdates(_0x43c714){return function(_0x28fd1f){try{jsonpatch[_0xc2ac('0x27')](_0x28fd1f,_0x43c714,!![]);}catch(_0x28edc3){return BPromise['reject'](_0x28edc3);}return _0x28fd1f[_0xc2ac('0x28')]();};}function saveUpdates(_0x2a66c9,_0x2f3db3){return function(_0x4fabcb){if(_0x4fabcb){return _0x4fabcb[_0xc2ac('0x29')](_0x2a66c9)[_0xc2ac('0x2a')](function(_0x306740){return _0x306740;});}return null;};}function removeEntity(_0x3bcb42,_0xe3210){return function(_0x1a943d){if(_0x1a943d){return _0x1a943d['destroy']()[_0xc2ac('0x2a')](function(){_0x3bcb42['status'](0xcc)[_0xc2ac('0x1e')]();});}};}function handleEntityNotFound(_0x1d9ffb,_0x4901a7){return function(_0x3bec7c){if(!_0x3bec7c){_0x1d9ffb[_0xc2ac('0x1d')](0x194);}return _0x3bec7c;};}function handleError(_0x531875,_0x33597e){_0x33597e=_0x33597e||0x1f4;return function(_0x5410a2){logger['error'](_0x5410a2[_0xc2ac('0x2b')]);if(_0x5410a2[_0xc2ac('0x2c')]){delete _0x5410a2['name'];}_0x531875[_0xc2ac('0x1f')](_0x33597e)[_0xc2ac('0x2d')](_0x5410a2);};}exports['sendUserNotification']=function(_0x59033d,_0x3555dc,_0x4b1c8c){if(!_0x59033d[_0xc2ac('0x2e')]['hasOwnProperty']('text')&&!_0x59033d[_0xc2ac('0x2e')]['hasOwnProperty']('TemplateId')){throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')]('TemplateId')&&!_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')]('view')){throw new db['Sequelize'][(_0xc2ac('0x30'))](_0xc2ac('0x32'));}if(!_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')](_0xc2ac('0x33'))){throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))](_0xc2ac('0x34'));}else{try{var _0x1419ef=JSON[_0xc2ac('0x35')](_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x33')]);}catch(_0x4bc98f){logger[_0xc2ac('0x36')](_0x4bc98f);throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))](_0xc2ac('0x37'));}var _0xc9e351=[_0xc2ac('0x38'),_0xc2ac('0x39'),_0xc2ac('0x3a'),_0xc2ac('0x3b'),_0xc2ac('0x3c'),_0xc2ac('0x3d'),_0xc2ac('0x3e'),'team','user'];if(_[_0xc2ac('0x3f')](_0x1419ef,function(_0x29fbe6){return!_['includes'](_0xc9e351,_0x29fbe6[_0xc2ac('0x40')]['toLowerCase']());})){throw new db[(_0xc2ac('0x2f'))][(_0xc2ac('0x30'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x15c424={};_0x15c424[_0xc2ac('0x41')]=_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x31')](_0xc2ac('0x41'))?_0x59033d['body'][_0xc2ac('0x41')]:_0x59033d[_0xc2ac('0x42')][_0xc2ac('0x43')];_0x15c424[_0xc2ac('0x44')]=_['isEmpty'](_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x44')])?null:_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x44')];_0x15c424[_0xc2ac('0x45')]=_0x59033d[_0xc2ac('0x2e')][_0xc2ac('0x45')]||![];_0x15c424[_0xc2ac('0x46')]=_0x59033d[_0xc2ac('0x42')]['id'];return getContent(_0x59033d['body'])[_0xc2ac('0x2a')](function(_0x153d15){_0x15c424[_0xc2ac('0x2e')]=_0x153d15;return getRecipients(_0x1419ef);})[_0xc2ac('0x2a')](function(_0x1b8cb3){_0x15c424[_0xc2ac('0x47')]=_['sortBy'](_0x1b8cb3)['join'](',');return db[_0xc2ac('0x48')][_0xc2ac('0x49')](function(_0x399870){return db['UserNotification']['create'](_0x15c424,{'raw':!![],'transaction':_0x399870})['then'](function(_0x558e7f){var _0x4c7dcf={'sender':_0x15c424[_0xc2ac('0x41')],'description':_0x15c424['recipientsDescription'],'content':_0x15c424[_0xc2ac('0x2e')],'beep':_0x15c424[_0xc2ac('0x45')]};_0x1b8cb3[_0xc2ac('0x4a')](function(_0x2ad589){_0x4c7dcf[_0xc2ac('0x4b')]=_0x2ad589;socket[_0xc2ac('0x4c')](_0xc2ac('0x4d'),_0x4c7dcf);});return _0x558e7f;});});})[_0xc2ac('0x2a')](respondWithResult(_0x3555dc,0xc9))[_0xc2ac('0x4e')](handleError(_0x3555dc,null));};function getContent(_0x87aadd){return new BPromise(function(_0x392c3e,_0x4c8819){if(_0x87aadd['text']){_0x392c3e(_0x87aadd[_0xc2ac('0x4f')]);return;}return db[_0xc2ac('0x50')][_0xc2ac('0x51')]({'attributes':[_0xc2ac('0x52')],'where':{'id':_0x87aadd['TemplateId']},'raw':!![]})[_0xc2ac('0x2a')](function(_0x1e3e2d){if(!_0x1e3e2d)throw new db[(_0xc2ac('0x2f'))]['ValidationError'](_0xc2ac('0x53'));var _0x5ea8a3=Mustache[_0xc2ac('0x54')](_0x1e3e2d[_0xc2ac('0x52')],_0x87aadd['view']);_0x392c3e(_0x5ea8a3);})[_0xc2ac('0x4e')](function(_0x5c37ac){_0x4c8819(_0x5c37ac);});});}function getRecipients(_0x2c8ead){return new BPromise(function(_0x5baddd,_0xf43fef){var _0x253d32=[];var _0x2e6d66=[];_0x2c8ead[_0xc2ac('0x4a')](function(_0x213adc){var _0x10beaa=_[_0xc2ac('0x55')](_0x213adc[_0xc2ac('0x40')]['toLowerCase']());if(_0x10beaa===_0xc2ac('0x56')){_0x253d32=_[_0xc2ac('0x57')](_0x253d32,_0x213adc[_0xc2ac('0x58')]);}else{if(_[_0xc2ac('0x59')](_0x10beaa,'queue'))_0x10beaa=_0x10beaa[_0xc2ac('0x5a')]('queue',_0xc2ac('0x5b'));_0x213adc['ids'][_0xc2ac('0x4a')](function(_0x2d4af4){_0x2e6d66[_0xc2ac('0x5c')](getAgents(_0x10beaa,_0x2d4af4));});}});return BPromise['all'](_0x2e6d66)[_0xc2ac('0x2a')](function(_0x5040c5){_0x253d32=_[_0xc2ac('0x57')](_0x253d32,_[_0xc2ac('0x5d')](_0x5040c5));_0x5baddd(_0x253d32);})[_0xc2ac('0x4e')](function(_0x3afcff){_0xf43fef(_0x3afcff);});});}function getAgents(_0x12fd0c,_0x435b89){return new BPromise(function(_0x2b2cf8,_0x1b115f){return db[_0x12fd0c]['findOne']({'where':{'id':_0x435b89}})[_0xc2ac('0x2a')](function(_0x228ba0){return _0x228ba0[_0xc2ac('0x5e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x54cbb1){var _0x200856=_[_0xc2ac('0x5f')](_0x54cbb1,'id');_0x2b2cf8(_0x200856);});})[_0xc2ac('0x4e')](function(_0x440832){_0x1b115f(_0x440832);});});}
\ No newline at end of file
+var _0xc085=['union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','rimraf','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./userNotification.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','sendUserNotification','text','body','TemplateId','Sequelize','ValidationError','hasOwnProperty','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','voicequeue','whatsappqueue','team','user','some','model','senderName','fullname','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','create','emit','userNotification:send','catch','render','html','forEach','startCase','toLowerCase','User'];(function(_0x5a2add,_0x4acfdc){var _0x2a644b=function(_0x54f4d4){while(--_0x54f4d4){_0x5a2add['push'](_0x5a2add['shift']());}};_0x2a644b(++_0x4acfdc);}(_0xc085,0x1ea));var _0x5c08=function(_0x4676a0,_0x5e96e8){_0x4676a0=_0x4676a0-0x0;var _0x5a81b8=_0xc085[_0x4676a0];return _0x5a81b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5c08('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5c08('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c08('0x2'));var path=require(_0x5c08('0x3'));var sox=require(_0x5c08('0x4'));var csv=require(_0x5c08('0x5'));var ejs=require(_0x5c08('0x6'));var fs=require('fs');var fs_extra=require(_0x5c08('0x7'));var _=require(_0x5c08('0x8'));var squel=require(_0x5c08('0x9'));var crypto=require(_0x5c08('0xa'));var jsforce=require(_0x5c08('0xb'));var deskjs=require(_0x5c08('0xc'));var toCsv=require(_0x5c08('0x5'));var querystring=require(_0x5c08('0xd'));var Papa=require(_0x5c08('0xe'));var Redis=require('ioredis');var authService=require(_0x5c08('0xf'));var qs=require(_0x5c08('0x10'));var as=require(_0x5c08('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c08('0x12'))(_0x5c08('0x13'));var utils=require(_0x5c08('0x14'));var config=require(_0x5c08('0x15'));var licenseUtil=require(_0x5c08('0x16'));var db=require('../../mysqldb')['db'];config[_0x5c08('0x17')]=_[_0x5c08('0x18')](config[_0x5c08('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c08('0x19'))(new Redis(config[_0x5c08('0x17')]));require(_0x5c08('0x1a'))['register'](socket);function respondWithStatusCode(_0x1d59e8,_0x2e8f94){_0x2e8f94=_0x2e8f94||0xcc;return function(_0x3723c4){if(_0x3723c4){return _0x1d59e8[_0x5c08('0x1b')](_0x2e8f94);}return _0x1d59e8[_0x5c08('0x1c')](_0x2e8f94)['end']();};}function respondWithResult(_0x316a2e,_0x302e26){_0x302e26=_0x302e26||0xc8;return function(_0x4b03d1){if(_0x4b03d1){return _0x316a2e[_0x5c08('0x1c')](_0x302e26)[_0x5c08('0x1d')](_0x4b03d1);}};}function respondWithFilteredResult(_0x2666ec,_0x214cb3){return function(_0x4373e9){if(_0x4373e9){var _0x23b377=typeof _0x214cb3[_0x5c08('0x1e')]===_0x5c08('0x1f')&&typeof _0x214cb3[_0x5c08('0x20')]==='undefined';var _0x191a61=_0x4373e9[_0x5c08('0x21')];var _0x2a2b08=_0x23b377?0x0:_0x214cb3['offset'];var _0x5442df=_0x23b377?_0x4373e9['count']:_0x214cb3[_0x5c08('0x1e')]+_0x214cb3[_0x5c08('0x20')];var _0x5ca0fc;if(_0x5442df>=_0x191a61){_0x5442df=_0x191a61;_0x5ca0fc=0xc8;}else{_0x5ca0fc=0xce;}_0x2666ec[_0x5c08('0x1c')](_0x5ca0fc);return _0x2666ec['set'](_0x5c08('0x22'),_0x2a2b08+'-'+_0x5442df+'/'+_0x191a61)[_0x5c08('0x1d')](_0x4373e9);}return null;};}function patchUpdates(_0x2c069f){return function(_0x394778){try{jsonpatch[_0x5c08('0x23')](_0x394778,_0x2c069f,!![]);}catch(_0x533990){return BPromise[_0x5c08('0x24')](_0x533990);}return _0x394778['save']();};}function saveUpdates(_0x3f5330,_0x5c6458){return function(_0x1401f7){if(_0x1401f7){return _0x1401f7[_0x5c08('0x25')](_0x3f5330)[_0x5c08('0x26')](function(_0x42b975){return _0x42b975;});}return null;};}function removeEntity(_0x1b3e47,_0x17a6db){return function(_0x12634c){if(_0x12634c){return _0x12634c[_0x5c08('0x27')]()[_0x5c08('0x26')](function(){_0x1b3e47[_0x5c08('0x1c')](0xcc)[_0x5c08('0x28')]();});}};}function handleEntityNotFound(_0x355a99,_0x4606c9){return function(_0x5babe0){if(!_0x5babe0){_0x355a99['sendStatus'](0x194);}return _0x5babe0;};}function handleError(_0x47dbdb,_0x26f7c8){_0x26f7c8=_0x26f7c8||0x1f4;return function(_0x12300d){logger['error'](_0x12300d[_0x5c08('0x29')]);if(_0x12300d[_0x5c08('0x2a')]){delete _0x12300d[_0x5c08('0x2a')];}_0x47dbdb[_0x5c08('0x1c')](_0x26f7c8)[_0x5c08('0x2b')](_0x12300d);};}exports[_0x5c08('0x2c')]=function(_0x20036b,_0x2c5cd0,_0x2882a1){if(!_0x20036b['body']['hasOwnProperty'](_0x5c08('0x2d'))&&!_0x20036b[_0x5c08('0x2e')]['hasOwnProperty'](_0x5c08('0x2f'))){throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x20036b['body'][_0x5c08('0x32')](_0x5c08('0x2f'))&&!_0x20036b[_0x5c08('0x2e')][_0x5c08('0x32')](_0x5c08('0x33'))){throw new db['Sequelize'][(_0x5c08('0x31'))](_0x5c08('0x34'));}if(!_0x20036b[_0x5c08('0x2e')][_0x5c08('0x32')](_0x5c08('0x35'))){throw new db['Sequelize'][(_0x5c08('0x31'))](_0x5c08('0x36'));}else{try{var _0x42c41e=JSON[_0x5c08('0x37')](_0x20036b[_0x5c08('0x2e')][_0x5c08('0x35')]);}catch(_0x161337){logger[_0x5c08('0x38')](_0x161337);throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))](_0x5c08('0x39'));}var _0x3b6669=[_0x5c08('0x3a'),'faxqueue',_0x5c08('0x3b'),'openchannelqueue','smsqueue',_0x5c08('0x3c'),_0x5c08('0x3d'),_0x5c08('0x3e'),_0x5c08('0x3f')];if(_[_0x5c08('0x40')](_0x42c41e,function(_0x43cf07){return!_['includes'](_0x3b6669,_0x43cf07[_0x5c08('0x41')]['toLowerCase']());})){throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4f54e5={};_0x4f54e5['senderName']=_0x20036b['body']['hasOwnProperty']('senderName')?_0x20036b[_0x5c08('0x2e')][_0x5c08('0x42')]:_0x20036b[_0x5c08('0x3f')][_0x5c08('0x43')];_0x4f54e5['recipientsDescription']=_[_0x5c08('0x44')](_0x20036b['body']['recipientsDescription'])?null:_0x20036b[_0x5c08('0x2e')][_0x5c08('0x45')];_0x4f54e5[_0x5c08('0x46')]=_0x20036b['body'][_0x5c08('0x46')]||![];_0x4f54e5[_0x5c08('0x47')]=_0x20036b['user']['id'];return getContent(_0x20036b[_0x5c08('0x2e')])[_0x5c08('0x26')](function(_0x142271){_0x4f54e5['body']=_0x142271;return getRecipients(_0x42c41e);})[_0x5c08('0x26')](function(_0x2088f6){_0x4f54e5[_0x5c08('0x48')]=_[_0x5c08('0x49')](_0x2088f6)['join'](',');return db['sequelize'][_0x5c08('0x4a')](function(_0x25c77f){return db[_0x5c08('0x4b')][_0x5c08('0x4c')](_0x4f54e5,{'raw':!![],'transaction':_0x25c77f})[_0x5c08('0x26')](function(_0x157831){var _0x37280e={'sender':_0x4f54e5[_0x5c08('0x42')],'description':_0x4f54e5[_0x5c08('0x45')],'content':_0x4f54e5['body'],'beep':_0x4f54e5[_0x5c08('0x46')]};_0x2088f6['forEach'](function(_0xcc7383){_0x37280e['recipient']=_0xcc7383;socket[_0x5c08('0x4d')](_0x5c08('0x4e'),_0x37280e);});return _0x157831;});});})[_0x5c08('0x26')](respondWithResult(_0x2c5cd0,0xc9))[_0x5c08('0x4f')](handleError(_0x2c5cd0,null));};function getContent(_0x100332){return new BPromise(function(_0xb46615,_0x5b6a34){if(_0x100332[_0x5c08('0x2d')]){_0xb46615(_0x100332[_0x5c08('0x2d')]);return;}return db['Template']['findOne']({'attributes':['html'],'where':{'id':_0x100332[_0x5c08('0x2f')]},'raw':!![]})['then'](function(_0x45908d){if(!_0x45908d)throw new db[(_0x5c08('0x30'))][(_0x5c08('0x31'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x151627=Mustache[_0x5c08('0x50')](_0x45908d[_0x5c08('0x51')],_0x100332[_0x5c08('0x33')]);_0xb46615(_0x151627);})[_0x5c08('0x4f')](function(_0x2e061c){_0x5b6a34(_0x2e061c);});});}function getRecipients(_0x14ab49){return new BPromise(function(_0x11bddc,_0x504a2a){var _0x236f68=[];var _0x3baf44=[];_0x14ab49[_0x5c08('0x52')](function(_0x5667e9){var _0x5545c0=_[_0x5c08('0x53')](_0x5667e9['model'][_0x5c08('0x54')]());if(_0x5545c0===_0x5c08('0x55')){_0x236f68=_[_0x5c08('0x56')](_0x236f68,_0x5667e9[_0x5c08('0x57')]);}else{if(_['includes'](_0x5545c0,_0x5c08('0x58')))_0x5545c0=_0x5545c0[_0x5c08('0x59')](_0x5c08('0x58'),_0x5c08('0x5a'));_0x5667e9[_0x5c08('0x57')][_0x5c08('0x52')](function(_0x34299e){_0x3baf44[_0x5c08('0x5b')](getAgents(_0x5545c0,_0x34299e));});}});return BPromise[_0x5c08('0x5c')](_0x3baf44)[_0x5c08('0x26')](function(_0x22f756){_0x236f68=_['union'](_0x236f68,_[_0x5c08('0x5d')](_0x22f756));_0x11bddc(_0x236f68);})[_0x5c08('0x4f')](function(_0x58e5a8){_0x504a2a(_0x58e5a8);});});}function getAgents(_0x1ecaa6,_0x32eb91){return new BPromise(function(_0x3e8f0a,_0x3b571d){return db[_0x1ecaa6]['findOne']({'where':{'id':_0x32eb91}})[_0x5c08('0x26')](function(_0x563270){return _0x563270[_0x5c08('0x5e')]({'attributes':['id'],'raw':!![]})[_0x5c08('0x26')](function(_0x581063){var _0x10820a=_[_0x5c08('0x5f')](_0x581063,'id');_0x3e8f0a(_0x10820a);});})[_0x5c08('0x4f')](function(_0x3e0acd){_0x3b571d(_0x3e0acd);});});}
\ No newline at end of file
index 1e42b12..13292d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x464f=['hook','events','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2a773b,_0x21b8db){var _0x486133=function(_0x1051d9){while(--_0x1051d9){_0x2a773b['push'](_0x2a773b['shift']());}};_0x486133(++_0x21b8db);}(_0x464f,0xf9));var _0xf464=function(_0x5ecf0d,_0x17175b){_0x5ecf0d=_0x5ecf0d-0x0;var _0x322300=_0x464f[_0x5ecf0d];return _0x322300;};'use strict';var EventEmitter=require(_0xf464('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xf464('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xf464('0x2')](0x0);var events={'afterCreate':_0xf464('0x3'),'afterUpdate':_0xf464('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f5ce0){return function(_0x1140f5,_0x575490,_0x2dfe0d){UserNotificationEvents[_0xf464('0x5')](_0x5f5ce0+':'+_0x1140f5['id'],_0x1140f5);UserNotificationEvents[_0xf464('0x5')](_0x5f5ce0,_0x1140f5);_0x2dfe0d(null);};}for(var e in events){if(events[_0xf464('0x6')](e)){var event=events[e];UserNotification[_0xf464('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0xb0ea=['setMaxListeners','save','update','remove','emit','hook','exports','events','UserNotification'];(function(_0x3c3996,_0x5df990){var _0x51aaac=function(_0x3c2d21){while(--_0x3c2d21){_0x3c3996['push'](_0x3c3996['shift']());}};_0x51aaac(++_0x5df990);}(_0xb0ea,0x16f));var _0xab0e=function(_0x26a351,_0x5dd04c){_0x26a351=_0x26a351-0x0;var _0x1ef7fe=_0xb0ea[_0x26a351];return _0x1ef7fe;};'use strict';var EventEmitter=require(_0xab0e('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xab0e('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xab0e('0x2')](0x0);var events={'afterCreate':_0xab0e('0x3'),'afterUpdate':_0xab0e('0x4'),'afterDestroy':_0xab0e('0x5')};function emitEvent(_0xe653ce){return function(_0x4a6732,_0x10f7e0,_0x5cf1e0){UserNotificationEvents[_0xab0e('0x6')](_0xe653ce+':'+_0x4a6732['id'],_0x4a6732);UserNotificationEvents[_0xab0e('0x6')](_0xe653ce,_0x4a6732);_0x5cf1e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xab0e('0x7')](e,emitEvent(event));}}module[_0xab0e('0x8')]=UserNotificationEvents;
\ No newline at end of file
index b3fd9c3..cb23381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1d7=['../../config/logger','request-promise','rimraf','../../config/environment','./userNotification.attributes','UserNotification','userNotifications','utf8mb4','lodash','util'];(function(_0x54a4f6,_0x551ef9){var _0x554ed0=function(_0x30e77e){while(--_0x30e77e){_0x54a4f6['push'](_0x54a4f6['shift']());}};_0x554ed0(++_0x551ef9);}(_0xc1d7,0x10c));var _0x7c1d=function(_0x456a84,_0x46bc0b){_0x456a84=_0x456a84-0x0;var _0x1117d6=_0xc1d7[_0x456a84];return _0x1117d6;};'use strict';var _=require(_0x7c1d('0x0'));var util=require(_0x7c1d('0x1'));var logger=require(_0x7c1d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7c1d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c1d('0x4'));var config=require(_0x7c1d('0x5'));var attributes=require(_0x7c1d('0x6'));module['exports']=function(_0x3c9901,_0xdc451d){return _0x3c9901['define'](_0x7c1d('0x7'),attributes,{'tableName':_0x7c1d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7c1d('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x11c1=['bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x3b1ebe,_0x271afa){var _0x2d9c47=function(_0x4b290a){while(--_0x4b290a){_0x3b1ebe['push'](_0x3b1ebe['shift']());}};_0x2d9c47(++_0x271afa);}(_0x11c1,0x119));var _0x111c=function(_0x99d4d7,_0x1a79ea){_0x99d4d7=_0x99d4d7-0x0;var _0x6af61f=_0x11c1[_0x99d4d7];return _0x6af61f;};'use strict';var _=require('lodash');var util=require(_0x111c('0x0'));var logger=require(_0x111c('0x1'))(_0x111c('0x2'));var moment=require(_0x111c('0x3'));var BPromise=require(_0x111c('0x4'));var rp=require(_0x111c('0x5'));var fs=require('fs');var path=require(_0x111c('0x6'));var rimraf=require(_0x111c('0x7'));var config=require(_0x111c('0x8'));var attributes=require(_0x111c('0x9'));module[_0x111c('0xa')]=function(_0x3d3bfd,_0x2841f0){return _0x3d3bfd[_0x111c('0xb')]('UserNotification',attributes,{'tableName':_0x111c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x111c('0xd'),'collate':_0x111c('0xe')});};
\ No newline at end of file
index b0e4744..bb25db7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45df=['redis','defaults','socket.io-emitter','request','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x2eb7af,_0x5ee68c){var _0x131719=function(_0x23c0dd){while(--_0x23c0dd){_0x2eb7af['push'](_0x2eb7af['shift']());}};_0x131719(++_0x5ee68c);}(_0x45df,0x81));var _0xf45d=function(_0x5014de,_0x2e5b19){_0x5014de=_0x5014de-0x0;var _0x19a5c4=_0x45df[_0x5014de];return _0x19a5c4;};'use strict';var _=require(_0xf45d('0x0'));var util=require(_0xf45d('0x1'));var moment=require('moment');var BPromise=require(_0xf45d('0x2'));var rs=require(_0xf45d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf45d('0x4'));var logger=require(_0xf45d('0x5'))('rpc');var config=require(_0xf45d('0x6'));var jayson=require(_0xf45d('0x7'));var client=jayson[_0xf45d('0x8')]['http']({'port':0x232a});config[_0xf45d('0x9')]=_[_0xf45d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf45d('0xb'))(new Redis(config[_0xf45d('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x164fab,_0x1fc6f1,_0x5bcea6){return new BPromise(function(_0x4129ec,_0x535846){return client[_0xf45d('0xc')](_0x164fab,_0x5bcea6)['then'](function(_0x23bb9a){logger[_0xf45d('0xd')]('UserNotification,\x20%s,\x20%s',_0x1fc6f1,_0xf45d('0xe'));logger['debug'](_0xf45d('0xf'),_0x1fc6f1,_0xf45d('0xe'),JSON[_0xf45d('0x10')](_0x23bb9a));if(_0x23bb9a[_0xf45d('0x11')]){if(_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x12')]===0x1f4){logger[_0xf45d('0x11')](_0xf45d('0x13'),_0x1fc6f1,_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x14')]);return _0x535846(_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x14')]);}logger[_0xf45d('0x11')]('UserNotification,\x20%s,\x20%s',_0x1fc6f1,_0x23bb9a[_0xf45d('0x11')][_0xf45d('0x14')]);return _0x4129ec(_0x23bb9a['error'][_0xf45d('0x14')]);}else{logger[_0xf45d('0xd')](_0xf45d('0x13'),_0x1fc6f1,'request\x20sent');_0x4129ec(_0x23bb9a[_0xf45d('0x15')][_0xf45d('0x14')]);}})[_0xf45d('0x16')](function(_0x1b57df){logger['error']('UserNotification,\x20%s,\x20%s',_0x1fc6f1,_0x1b57df);_0x535846(_0x1b57df);});});}
\ No newline at end of file
+var _0xbac2=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x46bcae,_0x5d0f07){var _0x1a13cf=function(_0x3afe3a){while(--_0x3afe3a){_0x46bcae['push'](_0x46bcae['shift']());}};_0x1a13cf(++_0x5d0f07);}(_0xbac2,0x1ba));var _0x2bac=function(_0x2211ed,_0x1bca0b){_0x2211ed=_0x2211ed-0x0;var _0x4d78cc=_0xbac2[_0x2211ed];return _0x4d78cc;};'use strict';var _=require(_0x2bac('0x0'));var util=require(_0x2bac('0x1'));var moment=require(_0x2bac('0x2'));var BPromise=require(_0x2bac('0x3'));var rs=require(_0x2bac('0x4'));var fs=require('fs');var Redis=require(_0x2bac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2bac('0x6'));var logger=require(_0x2bac('0x7'))('rpc');var config=require(_0x2bac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2bac('0x9')][_0x2bac('0xa')]({'port':0x232a});config[_0x2bac('0xb')]=_[_0x2bac('0xc')](config['redis'],{'host':_0x2bac('0xd'),'port':0x18eb});var socket=require(_0x2bac('0xe'))(new Redis(config[_0x2bac('0xb')]));require('./userNotification.socket')[_0x2bac('0xf')](socket);function respondWithRpcPromise(_0x5e7ea3,_0x411787,_0x245731){return new BPromise(function(_0x2648eb,_0x32a6ce){return client[_0x2bac('0x10')](_0x5e7ea3,_0x245731)[_0x2bac('0x11')](function(_0x209c31){logger[_0x2bac('0x12')]('UserNotification,\x20%s,\x20%s',_0x411787,_0x2bac('0x13'));logger['debug'](_0x2bac('0x14'),_0x411787,_0x2bac('0x13'),JSON[_0x2bac('0x15')](_0x209c31));if(_0x209c31['error']){if(_0x209c31['error'][_0x2bac('0x16')]===0x1f4){logger[_0x2bac('0x17')](_0x2bac('0x18'),_0x411787,_0x209c31['error'][_0x2bac('0x19')]);return _0x32a6ce(_0x209c31['error'][_0x2bac('0x19')]);}logger[_0x2bac('0x17')](_0x2bac('0x18'),_0x411787,_0x209c31[_0x2bac('0x17')]['message']);return _0x2648eb(_0x209c31[_0x2bac('0x17')][_0x2bac('0x19')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x411787,_0x2bac('0x13'));_0x2648eb(_0x209c31[_0x2bac('0x1a')][_0x2bac('0x19')]);}})[_0x2bac('0x1b')](function(_0x47b3a0){logger[_0x2bac('0x17')](_0x2bac('0x18'),_0x411787,_0x47b3a0);_0x32a6ce(_0x47b3a0);});});}
\ No newline at end of file
index 2670625..9f94fba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf835=['update','emit','length','./userNotification.events','remove'];(function(_0x1a49fc,_0x527071){var _0x5589fc=function(_0x1bf972){while(--_0x1bf972){_0x1a49fc['push'](_0x1a49fc['shift']());}};_0x5589fc(++_0x527071);}(_0xf835,0x1bb));var _0x5f83=function(_0xcfaf79,_0x374941){_0xcfaf79=_0xcfaf79-0x0;var _0x5b8c1b=_0xf835[_0xcfaf79];return _0x5b8c1b;};'use strict';var UserNotificationEvents=require(_0x5f83('0x0'));var events=['save',_0x5f83('0x1'),_0x5f83('0x2')];function createListener(_0x35abbe,_0x1ee907){return function(_0x1c7233){_0x1ee907[_0x5f83('0x3')](_0x35abbe,_0x1c7233);};}function removeListener(_0x51d36a,_0xbd6db5){return function(){UserNotificationEvents['removeListener'](_0x51d36a,_0xbd6db5);};}exports['register']=function(_0x2f977e){for(var _0x31fd0e=0x0,_0x336a8a=events[_0x5f83('0x4')];_0x31fd0e<_0x336a8a;_0x31fd0e++){var _0x718255=events[_0x31fd0e];var _0x15c894=createListener('userNotification:'+_0x718255,_0x2f977e);UserNotificationEvents['on'](_0x718255,_0x15c894);}};
\ No newline at end of file
+var _0xdfa9=['userNotification:','./userNotification.events','remove','update','removeListener','length'];(function(_0x36a6b2,_0x50f305){var _0x1c5818=function(_0x1ac1a7){while(--_0x1ac1a7){_0x36a6b2['push'](_0x36a6b2['shift']());}};_0x1c5818(++_0x50f305);}(_0xdfa9,0x9d));var _0x9dfa=function(_0x50e4df,_0x3a41ea){_0x50e4df=_0x50e4df-0x0;var _0x4d25b0=_0xdfa9[_0x50e4df];return _0x4d25b0;};'use strict';var UserNotificationEvents=require(_0x9dfa('0x0'));var events=['save',_0x9dfa('0x1'),_0x9dfa('0x2')];function createListener(_0x569c81,_0x446659){return function(_0x57f925){_0x446659['emit'](_0x569c81,_0x57f925);};}function removeListener(_0x1532bf,_0x306fc4){return function(){UserNotificationEvents[_0x9dfa('0x3')](_0x1532bf,_0x306fc4);};}exports['register']=function(_0x378905){for(var _0x339613=0x0,_0xf35ca1=events[_0x9dfa('0x4')];_0x339613<_0xf35ca1;_0x339613++){var _0x2f3664=events[_0x339613];var _0x3639eb=createListener(_0x9dfa('0x5')+_0x2f3664,_0x378905);UserNotificationEvents['on'](_0x2f3664,_0x3639eb);}};
\ No newline at end of file
index bb5ae22..fc9818f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x385b71,_0x2ae587){var _0x72ac1d=function(_0x5308f0){while(--_0x5308f0){_0x385b71['push'](_0x385b71['shift']());}};_0x72ac1d(++_0x2ae587);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x226a9b,_0x4ec9c5){var _0x3347f4=function(_0x26b1a0){while(--_0x26b1a0){_0x226a9b['push'](_0x226a9b['shift']());}};_0x3347f4(++_0x4ec9c5);}(_0x70e0,0x17b));var _0x070e=function(_0x36949d,_0x53c391){_0x36949d=_0x36949d-0x0;var _0xe3c78f=_0x70e0[_0x36949d];return _0xe3c78f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 810e0cb..f1a3e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1159=['sequelize'];(function(_0x21058f,_0x342d79){var _0x31255f=function(_0x28b998){while(--_0x28b998){_0x21058f['push'](_0x21058f['shift']());}};_0x31255f(++_0x342d79);}(_0x1159,0xf3));var _0x9115=function(_0x2d1dc4,_0x46a6ba){_0x2d1dc4=_0x2d1dc4-0x0;var _0x352581=_0x1159[_0x2d1dc4];return _0x352581;};'use strict';var Sequelize=require(_0x9115('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x266d=['INTEGER'];(function(_0x2e99b2,_0x364efc){var _0x8b1a67=function(_0x11212f){while(--_0x11212f){_0x2e99b2['push'](_0x2e99b2['shift']());}};_0x8b1a67(++_0x364efc);}(_0x266d,0x152));var _0xd266=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x266d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xd266('0x0')],'defaultValue':0x0}};
\ No newline at end of file
index 36dd880..c7f1743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76d2=['exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes'];(function(_0x33f16a,_0x594322){var _0x22a6e0=function(_0x59efc3){while(--_0x59efc3){_0x33f16a['push'](_0x33f16a['shift']());}};_0x22a6e0(++_0x594322);}(_0x76d2,0x7c));var _0x276d=function(_0x1c08f3,_0x12beb3){_0x1c08f3=_0x1c08f3-0x0;var _0x5edb1c=_0x76d2[_0x1c08f3];return _0x5edb1c;};'use strict';var _=require(_0x276d('0x0'));var util=require(_0x276d('0x1'));var logger=require(_0x276d('0x2'))(_0x276d('0x3'));var moment=require(_0x276d('0x4'));var BPromise=require(_0x276d('0x5'));var rp=require(_0x276d('0x6'));var fs=require('fs');var path=require(_0x276d('0x7'));var rimraf=require(_0x276d('0x8'));var config=require(_0x276d('0x9'));var attributes=require(_0x276d('0xa'));module[_0x276d('0xb')]=function(_0x44b05f,_0x23f1f3){return _0x44b05f[_0x276d('0xc')](_0x276d('0xd'),attributes,{'tableName':_0x276d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe467=['user_has_openchannel_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x4d5d28,_0x26bd9b){var _0x2026b1=function(_0x1fe42c){while(--_0x1fe42c){_0x4d5d28['push'](_0x4d5d28['shift']());}};_0x2026b1(++_0x26bd9b);}(_0xe467,0x1c9));var _0x7e46=function(_0x1e3c2a,_0x33acf3){_0x1e3c2a=_0x1e3c2a-0x0;var _0x10fa0c=_0xe467[_0x1e3c2a];return _0x10fa0c;};'use strict';var _=require(_0x7e46('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7e46('0x1'));var moment=require(_0x7e46('0x2'));var BPromise=require(_0x7e46('0x3'));var rp=require(_0x7e46('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7e46('0x5'));var config=require(_0x7e46('0x6'));var attributes=require(_0x7e46('0x7'));module[_0x7e46('0x8')]=function(_0x3b4401,_0x553c89){return _0x3b4401[_0x7e46('0x9')](_0x7e46('0xa'),attributes,{'tableName':_0x7e46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 52daf57..f2f06e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe269=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird','randomstring','ioredis'];(function(_0x4ac67b,_0x474dc1){var _0x1a8490=function(_0x383a16){while(--_0x383a16){_0x4ac67b['push'](_0x4ac67b['shift']());}};_0x1a8490(++_0x474dc1);}(_0xe269,0xb9));var _0x9e26=function(_0x1a4071,_0x1b49b8){_0x1a4071=_0x1a4071-0x0;var _0x17e620=_0xe269[_0x1a4071];return _0x17e620;};'use strict';var _=require('lodash');var util=require(_0x9e26('0x0'));var moment=require('moment');var BPromise=require(_0x9e26('0x1'));var rs=require(_0x9e26('0x2'));var fs=require('fs');var Redis=require(_0x9e26('0x3'));var db=require(_0x9e26('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e26('0x5'))(_0x9e26('0x6'));var config=require(_0x9e26('0x7'));var jayson=require(_0x9e26('0x8'));var client=jayson[_0x9e26('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57abd5,_0x2cb314,_0x125b5d){return new BPromise(function(_0x5b2b3b,_0x53ba28){return client[_0x9e26('0xa')](_0x57abd5,_0x125b5d)['then'](function(_0x4601d7){logger[_0x9e26('0xb')](_0x9e26('0xc'),_0x2cb314,_0x9e26('0xd'));logger[_0x9e26('0xe')](_0x9e26('0xf'),_0x2cb314,_0x9e26('0xd'),JSON[_0x9e26('0x10')](_0x4601d7));if(_0x4601d7['error']){if(_0x4601d7[_0x9e26('0x11')][_0x9e26('0x12')]===0x1f4){logger['error'](_0x9e26('0xc'),_0x2cb314,_0x4601d7[_0x9e26('0x11')]['message']);return _0x53ba28(_0x4601d7[_0x9e26('0x11')][_0x9e26('0x13')]);}logger[_0x9e26('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2cb314,_0x4601d7['error']['message']);return _0x5b2b3b(_0x4601d7[_0x9e26('0x11')]['message']);}else{logger[_0x9e26('0xb')](_0x9e26('0xc'),_0x2cb314,_0x9e26('0xd'));_0x5b2b3b(_0x4601d7[_0x9e26('0x14')][_0x9e26('0x13')]);}})['catch'](function(_0xf9ac60){logger[_0x9e26('0x11')](_0x9e26('0xc'),_0x2cb314,_0xf9ac60);_0x53ba28(_0xf9ac60);});});}
\ No newline at end of file
+var _0xd287=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x477b42,_0x1c141f){var _0x13998e=function(_0x24f3c6){while(--_0x24f3c6){_0x477b42['push'](_0x477b42['shift']());}};_0x13998e(++_0x1c141f);}(_0xd287,0x97));var _0x7d28=function(_0x327897,_0x1f07b4){_0x327897=_0x327897-0x0;var _0x538200=_0xd287[_0x327897];return _0x538200;};'use strict';var _=require(_0x7d28('0x0'));var util=require(_0x7d28('0x1'));var moment=require(_0x7d28('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d28('0x3'));var db=require(_0x7d28('0x4'))['db'];var utils=require(_0x7d28('0x5'));var logger=require(_0x7d28('0x6'))('rpc');var config=require(_0x7d28('0x7'));var jayson=require(_0x7d28('0x8'));var client=jayson[_0x7d28('0x9')][_0x7d28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a6fcb,_0x3e5a01,_0x17bf0a){return new BPromise(function(_0x16aae3,_0x2f8077){return client[_0x7d28('0xb')](_0x1a6fcb,_0x17bf0a)[_0x7d28('0xc')](function(_0x56e3da){logger[_0x7d28('0xd')](_0x7d28('0xe'),_0x3e5a01,'request\x20sent');logger['debug'](_0x7d28('0xf'),_0x3e5a01,_0x7d28('0x10'),JSON[_0x7d28('0x11')](_0x56e3da));if(_0x56e3da['error']){if(_0x56e3da[_0x7d28('0x12')]['code']===0x1f4){logger[_0x7d28('0x12')](_0x7d28('0xe'),_0x3e5a01,_0x56e3da[_0x7d28('0x12')][_0x7d28('0x13')]);return _0x2f8077(_0x56e3da['error']['message']);}logger[_0x7d28('0x12')](_0x7d28('0xe'),_0x3e5a01,_0x56e3da[_0x7d28('0x12')]['message']);return _0x16aae3(_0x56e3da[_0x7d28('0x12')][_0x7d28('0x13')]);}else{logger[_0x7d28('0xd')](_0x7d28('0xe'),_0x3e5a01,_0x7d28('0x10'));_0x16aae3(_0x56e3da[_0x7d28('0x14')][_0x7d28('0x13')]);}})[_0x7d28('0x15')](function(_0x4485ba){logger[_0x7d28('0x12')](_0x7d28('0xe'),_0x3e5a01,_0x4485ba);_0x2f8077(_0x4485ba);});});}
\ No newline at end of file
index 6fca111..627257c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5057=['/:id','show','/:id/sections','/:id/resources','getResources','post','create','put','delete','destroy','removeSections','removeResources','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe'];(function(_0xc0bde9,_0x355373){var _0x3483f9=function(_0x5820a2){while(--_0x5820a2){_0xc0bde9['push'](_0xc0bde9['shift']());}};_0x3483f9(++_0x355373);}(_0x5057,0x151));var _0x7505=function(_0x38dcb0,_0x8d5af7){_0x38dcb0=_0x38dcb0-0x0;var _0xe5fa1b=_0x5057[_0x38dcb0];return _0xe5fa1b;};'use strict';var multer=require(_0x7505('0x0'));var util=require(_0x7505('0x1'));var path=require(_0x7505('0x2'));var timeout=require('connect-timeout');var express=require(_0x7505('0x3'));var router=express[_0x7505('0x4')]();var fs_extra=require(_0x7505('0x5'));var auth=require(_0x7505('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7505('0x7'));var controller=require(_0x7505('0x8'));router['get']('/',auth[_0x7505('0x9')](),controller[_0x7505('0xa')]);router[_0x7505('0xb')](_0x7505('0xc'),auth[_0x7505('0x9')](),controller[_0x7505('0xd')]);router['get'](_0x7505('0xe'),auth['isAuthenticated'](),controller[_0x7505('0xf')]);router[_0x7505('0xb')](_0x7505('0x10'),auth['isAuthenticated'](),controller['getSections']);router[_0x7505('0xb')](_0x7505('0x11'),auth[_0x7505('0x9')](),controller[_0x7505('0x12')]);router[_0x7505('0x13')]('/',auth['isAuthenticated'](),controller[_0x7505('0x14')]);router[_0x7505('0x13')]('/:id/clone',auth[_0x7505('0x9')](),controller['clone']);router[_0x7505('0x13')](_0x7505('0x10'),auth[_0x7505('0x9')](),controller['addSections']);router[_0x7505('0x13')]('/:id/resources',auth[_0x7505('0x9')](),controller['addResources']);router[_0x7505('0x15')]('/:id',auth[_0x7505('0x9')](),controller['update']);router[_0x7505('0x16')](_0x7505('0xe'),auth[_0x7505('0x9')](),controller[_0x7505('0x17')]);router[_0x7505('0x16')]('/:id/sections',auth[_0x7505('0x9')](),controller[_0x7505('0x18')]);router[_0x7505('0x16')](_0x7505('0x11'),auth[_0x7505('0x9')](),controller[_0x7505('0x19')]);module[_0x7505('0x1a')]=router;
\ No newline at end of file
+var _0x1629=['index','get','/describe','describe','show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','addResources','put','update','delete','/:id','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x444184,_0x3b8fc9){var _0xddd83b=function(_0x93330a){while(--_0x93330a){_0x444184['push'](_0x444184['shift']());}};_0xddd83b(++_0x3b8fc9);}(_0x1629,0x1d8));var _0x9162=function(_0xa48664,_0x18067d){_0xa48664=_0xa48664-0x0;var _0x3b28eb=_0x1629[_0xa48664];return _0x3b28eb;};'use strict';var multer=require(_0x9162('0x0'));var util=require(_0x9162('0x1'));var path=require(_0x9162('0x2'));var timeout=require(_0x9162('0x3'));var express=require('express');var router=express[_0x9162('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9162('0x5'));var config=require(_0x9162('0x6'));var controller=require('./userProfile.controller');router['get']('/',auth[_0x9162('0x7')](),controller[_0x9162('0x8')]);router[_0x9162('0x9')](_0x9162('0xa'),auth[_0x9162('0x7')](),controller[_0x9162('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9162('0xc')]);router[_0x9162('0x9')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller['getSections']);router[_0x9162('0x9')](_0x9162('0xe'),auth['isAuthenticated'](),controller[_0x9162('0xf')]);router[_0x9162('0x10')]('/',auth['isAuthenticated'](),controller[_0x9162('0x11')]);router[_0x9162('0x10')](_0x9162('0x12'),auth[_0x9162('0x7')](),controller[_0x9162('0x13')]);router[_0x9162('0x10')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller[_0x9162('0x14')]);router[_0x9162('0x10')](_0x9162('0xe'),auth['isAuthenticated'](),controller[_0x9162('0x15')]);router[_0x9162('0x16')]('/:id',auth[_0x9162('0x7')](),controller[_0x9162('0x17')]);router[_0x9162('0x18')](_0x9162('0x19'),auth[_0x9162('0x7')](),controller[_0x9162('0x1a')]);router[_0x9162('0x18')](_0x9162('0xd'),auth[_0x9162('0x7')](),controller[_0x9162('0x1b')]);router['delete']('/:id/resources',auth[_0x9162('0x7')](),controller[_0x9162('0x1c')]);module[_0x9162('0x1d')]=router;
\ No newline at end of file
index f680f0c..ffc9e00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe450=['join','getDataValue','split','BOOLEAN','sequelize','STRING','setDataValue','crudPermissions'];(function(_0x1877e8,_0x7439ce){var _0x15ef19=function(_0x5cca65){while(--_0x5cca65){_0x1877e8['push'](_0x1877e8['shift']());}};_0x15ef19(++_0x7439ce);}(_0xe450,0xbc));var _0x0e45=function(_0x47c156,_0x5b35e1){_0x47c156=_0x47c156-0x0;var _0x29d767=_0xe450[_0x47c156];return _0x29d767;};'use strict';var Sequelize=require(_0x0e45('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e45('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3dd767){this[_0x0e45('0x2')](_0x0e45('0x3'),_0x3dd767?_0x3dd767[_0x0e45('0x4')](''):[]);},'get':function(){return this[_0x0e45('0x5')](_0x0e45('0x3'))?this['getDataValue'](_0x0e45('0x3'))[_0x0e45('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0e45('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x0e45('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1fef=['exports','STRING','name','crudPermissions','getDataValue','split','BOOLEAN'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x1fef,0xaf));var _0xf1fe=function(_0x32db7c,_0x340068){_0x32db7c=_0x32db7c-0x0;var _0x4adde2=_0x1fef[_0x32db7c];return _0x4adde2;};'use strict';var Sequelize=require('sequelize');module[_0xf1fe('0x0')]={'name':{'type':Sequelize[_0xf1fe('0x1')],'allowNull':![],'unique':_0xf1fe('0x2')},'crudPermissions':{'type':Sequelize[_0xf1fe('0x1')],'set':function(_0x22aabd){this['setDataValue'](_0xf1fe('0x3'),_0x22aabd?_0x22aabd['join'](''):[]);},'get':function(){return this[_0xf1fe('0x4')](_0xf1fe('0x3'))?this['getDataValue'](_0xf1fe('0x3'))[_0xf1fe('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf1fe('0x6')],'defaultValue':!![]}};
\ No newline at end of file
index c10ff27..b585db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc86c=['register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','map','VIRTUAL','merge','UserProfile','include','rows','show','params','includeAll','find','catch','create','body','clone','get','omit','createdAt','crudPermissions','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','updatedAt','sectionId','userProfileId','Resources','describe','addSections','sequelize','transaction','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','findOne','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','fs-extra','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x39035a,_0x584f29){var _0x3bbba0=function(_0x2cfa3d){while(--_0x2cfa3d){_0x39035a['push'](_0x39035a['shift']());}};_0x3bbba0(++_0x584f29);}(_0xc86c,0x138));var _0xcc86=function(_0xa032a7,_0x151608){_0xa032a7=_0xa032a7-0x0;var _0xde3d9d=_0xc86c[_0xa032a7];return _0xde3d9d;};'use strict';var emlformat=require(_0xcc86('0x0'));var rimraf=require(_0xcc86('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcc86('0x2'));var moment=require(_0xcc86('0x3'));var BPromise=require(_0xcc86('0x4'));var Mustache=require(_0xcc86('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcc86('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcc86('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc86('0x8'));var jsforce=require(_0xcc86('0x9'));var deskjs=require(_0xcc86('0xa'));var toCsv=require(_0xcc86('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcc86('0xc'));var authService=require(_0xcc86('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcc86('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc86('0xf'))(_0xcc86('0x10'));var utils=require('../../config/utils');var config=require(_0xcc86('0x11'));var licenseUtil=require(_0xcc86('0x12'));var db=require('../../mysqldb')['db'];config[_0xcc86('0x13')]=_[_0xcc86('0x14')](config['redis'],{'host':_0xcc86('0x15'),'port':0x18eb});var socket=require(_0xcc86('0x16'))(new Redis(config['redis']));require(_0xcc86('0x17'))[_0xcc86('0x18')](socket);function respondWithStatusCode(_0x5cd93e,_0x53e760){_0x53e760=_0x53e760||0xcc;return function(_0x443d23){if(_0x443d23){return _0x5cd93e[_0xcc86('0x19')](_0x53e760);}return _0x5cd93e[_0xcc86('0x1a')](_0x53e760)[_0xcc86('0x1b')]();};}function respondWithResult(_0x5ad280,_0x3b5cd2){_0x3b5cd2=_0x3b5cd2||0xc8;return function(_0x313cf4){if(_0x313cf4){return _0x5ad280[_0xcc86('0x1a')](_0x3b5cd2)[_0xcc86('0x1c')](_0x313cf4);}};}function respondWithFilteredResult(_0x4fae1a,_0x579768){return function(_0x4d17b5){if(_0x4d17b5){var _0xa2d9e8=typeof _0x579768['offset']===_0xcc86('0x1d')&&typeof _0x579768[_0xcc86('0x1e')]==='undefined';var _0x8f4fb3=_0x4d17b5[_0xcc86('0x1f')];var _0x4be30c=_0xa2d9e8?0x0:_0x579768[_0xcc86('0x20')];var _0xd6d881=_0xa2d9e8?_0x4d17b5[_0xcc86('0x1f')]:_0x579768[_0xcc86('0x20')]+_0x579768[_0xcc86('0x1e')];var _0x4ac4a7;if(_0xd6d881>=_0x8f4fb3){_0xd6d881=_0x8f4fb3;_0x4ac4a7=0xc8;}else{_0x4ac4a7=0xce;}_0x4fae1a[_0xcc86('0x1a')](_0x4ac4a7);return _0x4fae1a[_0xcc86('0x21')](_0xcc86('0x22'),_0x4be30c+'-'+_0xd6d881+'/'+_0x8f4fb3)[_0xcc86('0x1c')](_0x4d17b5);}return null;};}function patchUpdates(_0x3b3354){return function(_0x1faf8f){try{jsonpatch[_0xcc86('0x23')](_0x1faf8f,_0x3b3354,!![]);}catch(_0x37dfdf){return BPromise[_0xcc86('0x24')](_0x37dfdf);}return _0x1faf8f['save']();};}function saveUpdates(_0x15c695,_0x396ce8){return function(_0x1577f6){if(_0x1577f6){return _0x1577f6[_0xcc86('0x25')](_0x15c695)[_0xcc86('0x26')](function(_0x5c54bd){return _0x5c54bd;});}return null;};}function removeEntity(_0x1dbe96,_0x5cec28){return function(_0x36ad40){if(_0x36ad40){return _0x36ad40[_0xcc86('0x27')]()[_0xcc86('0x26')](function(){_0x1dbe96['status'](0xcc)[_0xcc86('0x1b')]();});}};}function handleEntityNotFound(_0x510c71,_0x1d1dfd){return function(_0x2c8bd7){if(!_0x2c8bd7){_0x510c71['sendStatus'](0x194);}return _0x2c8bd7;};}function handleError(_0x9238f0,_0x3bd6d8){_0x3bd6d8=_0x3bd6d8||0x1f4;return function(_0x44cabc){logger[_0xcc86('0x28')](_0x44cabc[_0xcc86('0x29')]);if(_0x44cabc[_0xcc86('0x2a')]){delete _0x44cabc['name'];}_0x9238f0[_0xcc86('0x1a')](_0x3bd6d8)[_0xcc86('0x2b')](_0x44cabc);};}exports[_0xcc86('0x2c')]=function(_0x2cfca0,_0x19bfc9){var _0x365f1f={},_0x1d4ce9={},_0xfd75ac={'count':0x0,'rows':[]};var _0x54ac84=_['map'](db['UserProfile'][_0xcc86('0x2d')],function(_0x28f102){return{'name':_0x28f102[_0xcc86('0x2e')],'type':_0x28f102[_0xcc86('0x2f')][_0xcc86('0x30')]};});_0x1d4ce9[_0xcc86('0x31')]=_['map'](_0x54ac84,_0xcc86('0x2a'));_0x1d4ce9['query']=_[_0xcc86('0x32')](_0x2cfca0[_0xcc86('0x33')]);_0x1d4ce9['filters']=_['intersection'](_0x1d4ce9[_0xcc86('0x31')],_0x1d4ce9[_0xcc86('0x33')]);_0x365f1f[_0xcc86('0x34')]=_[_0xcc86('0x35')](_0x1d4ce9[_0xcc86('0x31')],qs['fields'](_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x36')]));_0x365f1f[_0xcc86('0x34')]=_0x365f1f[_0xcc86('0x34')][_0xcc86('0x37')]?_0x365f1f[_0xcc86('0x34')]:_0x1d4ce9['model'];if(!_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x38')]('nolimit')){_0x365f1f[_0xcc86('0x1e')]=qs[_0xcc86('0x1e')](_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x1e')]);_0x365f1f[_0xcc86('0x20')]=qs[_0xcc86('0x20')](_0x2cfca0[_0xcc86('0x33')]['offset']);}_0x365f1f['order']=qs[_0xcc86('0x39')](_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x39')]);_0x365f1f[_0xcc86('0x3a')]=qs[_0xcc86('0x3b')](_[_0xcc86('0x3c')](_0x2cfca0[_0xcc86('0x33')],_0x1d4ce9[_0xcc86('0x3b')]),_0x54ac84);if(_0x2cfca0['query'][_0xcc86('0x3d')]){_0x365f1f[_0xcc86('0x3a')]=_['merge'](_0x365f1f[_0xcc86('0x3a')],{'$or':_[_0xcc86('0x3e')](_0x54ac84,function(_0x1ee9e2){if(_0x1ee9e2[_0xcc86('0x2f')]!==_0xcc86('0x3f')){var _0x3c7aac={};_0x3c7aac[_0x1ee9e2['name']]={'$like':'%'+_0x2cfca0[_0xcc86('0x33')][_0xcc86('0x3d')]+'%'};return _0x3c7aac;}})});}_0x365f1f=_[_0xcc86('0x40')]({},_0x365f1f,_0x2cfca0['options']);var _0x4197f6={'where':_0x365f1f['where']};return db[_0xcc86('0x41')][_0xcc86('0x1f')](_0x4197f6)['then'](function(_0x26c4d8){_0xfd75ac[_0xcc86('0x1f')]=_0x26c4d8;if(_0x2cfca0[_0xcc86('0x33')]['includeAll']){_0x365f1f[_0xcc86('0x42')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x365f1f);})['then'](function(_0x4737c6){_0xfd75ac[_0xcc86('0x43')]=_0x4737c6;return _0xfd75ac;})['then'](respondWithFilteredResult(_0x19bfc9,_0x365f1f))['catch'](handleError(_0x19bfc9,null));};exports[_0xcc86('0x44')]=function(_0x154a79,_0x419f75){var _0x4a693e={'raw':![],'where':{'id':_0x154a79[_0xcc86('0x45')]['id']}},_0x125cae={};_0x125cae['model']=_[_0xcc86('0x32')](db[_0xcc86('0x41')][_0xcc86('0x2d')]);_0x125cae[_0xcc86('0x33')]=_[_0xcc86('0x32')](_0x154a79[_0xcc86('0x33')]);_0x125cae[_0xcc86('0x3b')]=_[_0xcc86('0x35')](_0x125cae[_0xcc86('0x31')],_0x125cae[_0xcc86('0x33')]);_0x4a693e[_0xcc86('0x34')]=_[_0xcc86('0x35')](_0x125cae['model'],qs['fields'](_0x154a79[_0xcc86('0x33')][_0xcc86('0x36')]));_0x4a693e[_0xcc86('0x34')]=_0x4a693e['attributes'][_0xcc86('0x37')]?_0x4a693e[_0xcc86('0x34')]:_0x125cae[_0xcc86('0x31')];if(_0x154a79[_0xcc86('0x33')][_0xcc86('0x46')]){_0x4a693e[_0xcc86('0x42')]=[{'all':!![]}];}_0x4a693e=_[_0xcc86('0x40')]({},_0x4a693e,_0x154a79['options']);return db[_0xcc86('0x41')][_0xcc86('0x47')](_0x4a693e)[_0xcc86('0x26')](handleEntityNotFound(_0x419f75,null))[_0xcc86('0x26')](respondWithResult(_0x419f75,null))[_0xcc86('0x48')](handleError(_0x419f75,null));};exports[_0xcc86('0x49')]=function(_0xaea323,_0x23558c){return db[_0xcc86('0x41')]['create'](_0xaea323[_0xcc86('0x4a')],{})['then'](respondWithResult(_0x23558c,0xc9))['catch'](handleError(_0x23558c,null));};exports[_0xcc86('0x4b')]=function(_0x13440f,_0x1466ce){var _0x1e7f86={'where':{'id':_0x13440f[_0xcc86('0x45')]['id']}},_0x1a0e0c={};_0x1a0e0c[_0xcc86('0x31')]=_[_0xcc86('0x32')](db[_0xcc86('0x41')]['rawAttributes']);_0x1e7f86[_0xcc86('0x34')]=_[_0xcc86('0x35')](_0x1a0e0c['model'],qs[_0xcc86('0x36')](_0x13440f[_0xcc86('0x33')][_0xcc86('0x36')]));_0x1e7f86[_0xcc86('0x34')]=_0x1e7f86[_0xcc86('0x34')][_0xcc86('0x37')]?_0x1e7f86[_0xcc86('0x34')]:_0x1a0e0c[_0xcc86('0x31')];if(_0x13440f[_0xcc86('0x33')]['includeAll']){_0x1e7f86[_0xcc86('0x42')]=[{'all':!![]}];}_0x1e7f86=_['merge']({},_0x1e7f86,_0x13440f['options']);return db['UserProfile'][_0xcc86('0x47')](_0x1e7f86)[_0xcc86('0x26')](handleEntityNotFound(_0x1466ce,null))[_0xcc86('0x26')](function(_0x2f5547){if(_0x2f5547){var _0x7d6acc=_0x2f5547[_0xcc86('0x4c')]({'plain':!![]});_0x7d6acc=qs[_0xcc86('0x4d')](_0x7d6acc,['id',_0xcc86('0x4e'),'updatedAt',_0xcc86('0x4f')]);_0x13440f[_0xcc86('0x4a')]=_['omit'](_0x13440f[_0xcc86('0x4a')],['id','createdAt','updatedAt']);return db['sequelize']['transaction'](function(_0xc403d2){return db[_0xcc86('0x41')][_0xcc86('0x49')](_[_0xcc86('0x40')](_0x7d6acc,_0x13440f[_0xcc86('0x4a')]),{'include':_0x13440f[_0xcc86('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xc403d2})[_0xcc86('0x26')](function(_0x82ea4a){var _0x240cb9=_0x82ea4a['get']({'plain':!![]});return db[_0xcc86('0x50')][_0xcc86('0x51')]({'where':{'userProfileId':_0x13440f[_0xcc86('0x45')]['id']},'raw':!![]})['then'](function(_0x478843){if(_0x478843){return BPromise[_0xcc86('0x52')](_0x478843,function(_0x55417e){return new BPromise(function(_0x3a6a83,_0x21b9f3){if(_0x55417e[_0xcc86('0x53')]===null||_0x55417e['autoAssociation']===0x1)_0x3a6a83(null);return db[_0xcc86('0x54')][_0xcc86('0x51')]({'where':{'sectionId':_0x55417e['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x16d4e5){var _0x4c54a5=_[_0xcc86('0x3e')](_0x16d4e5,function(_0x2d00df){return qs[_0xcc86('0x4d')](_0x2d00df,['id',_0xcc86('0x4e'),_0xcc86('0x55'),_0xcc86('0x56')]);});_0x3a6a83(_0x4c54a5);})['catch'](function(_0x12b1dd){_0x21b9f3(_0x12b1dd);});})['then'](function(_0x5cd4a2){var _0x36a7bf=qs[_0xcc86('0x4d')](_0x55417e,['id',_0xcc86('0x4e'),_0xcc86('0x55')]);_0x36a7bf[_0xcc86('0x57')]=_0x240cb9['id'];if(_0x5cd4a2)_0x36a7bf[_0xcc86('0x58')]=_0x5cd4a2;return _0x36a7bf;})[_0xcc86('0x26')](function(_0x280132){return db[_0xcc86('0x50')][_0xcc86('0x49')](_0x280132,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0xc403d2});});})[_0xcc86('0x26')](function(){return _0x240cb9;});}});});});}})[_0xcc86('0x26')](respondWithResult(_0x1466ce,0xc9))['catch'](handleError(_0x1466ce,null));};exports[_0xcc86('0x25')]=function(_0x54136f,_0x4af1cb){if(_0x54136f[_0xcc86('0x4a')]['id']){delete _0x54136f['body']['id'];}return db[_0xcc86('0x41')][_0xcc86('0x47')]({'where':{'id':_0x54136f[_0xcc86('0x45')]['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x4af1cb,null))[_0xcc86('0x26')](saveUpdates(_0x54136f[_0xcc86('0x4a')],null))['then'](respondWithResult(_0x4af1cb,null))['catch'](handleError(_0x4af1cb,null));};exports[_0xcc86('0x27')]=function(_0x45764e,_0x54404d){return db['UserProfile'][_0xcc86('0x47')]({'where':{'id':_0x45764e['params']['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x54404d,null))['then'](removeEntity(_0x54404d,null))[_0xcc86('0x48')](handleError(_0x54404d,null));};exports[_0xcc86('0x59')]=function(_0x452c8d,_0x42f0de){return db[_0xcc86('0x41')]['describe']()[_0xcc86('0x26')](respondWithResult(_0x42f0de,null))[_0xcc86('0x48')](handleError(_0x42f0de,null));};exports[_0xcc86('0x5a')]=function(_0x5c1dea,_0x27a327){var _0x31b921=_0x5c1dea[_0xcc86('0x4a')];return db[_0xcc86('0x41')][_0xcc86('0x47')]({'where':{'id':_0x5c1dea[_0xcc86('0x45')]['id']}})['then'](handleEntityNotFound(_0x27a327,null))[_0xcc86('0x26')](function(_0x375482){if(_0x375482){return db[_0xcc86('0x5b')][_0xcc86('0x5c')](function(_0x436689){return db[_0xcc86('0x50')][_0xcc86('0x27')]({'where':{'userProfileId':_0x5c1dea[_0xcc86('0x45')]['id'],'sectionId':_[_0xcc86('0x3e')](_0x31b921,function(_0x19abc5){return _0x19abc5[_0xcc86('0x56')];})},'transaction':_0x436689})['then'](function(){var _0x34bcdc=_[_0xcc86('0x3e')](_0x31b921,function(_0x38aaf5){_0x38aaf5[_0xcc86('0x57')]=_0x5c1dea[_0xcc86('0x45')]['id'];return _0x38aaf5;});var _0x3375a9=[];return BPromise[_0xcc86('0x52')](_0x34bcdc,function(_0x7a60eb){return db['UserProfileSection']['create'](_0x7a60eb,{'include':[{'model':db[_0xcc86('0x54')],'as':_0xcc86('0x58')}],'raw':!![],'transaction':_0x436689})['then'](function(_0x497fac){_0x3375a9[_0xcc86('0x5d')](_0x497fac[_0xcc86('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x3375a9;});});});}})[_0xcc86('0x26')](function(_0x1552c0){return _0x1552c0;})[_0xcc86('0x26')](respondWithResult(_0x27a327,null))[_0xcc86('0x48')](handleError(_0x27a327,null));};exports[_0xcc86('0x5e')]=function(_0x29a783,_0x20001a){var _0x25a1cd;return db['UserProfile']['find']({'where':{'id':_0x29a783[_0xcc86('0x45')]['id']},'attributes':['id',_0xcc86('0x2a')]})[_0xcc86('0x26')](handleEntityNotFound(_0x20001a,null))[_0xcc86('0x26')](function(_0x2033bf){if(_0x2033bf){_0x25a1cd=_0x2033bf;return db['UserProfileSection'][_0xcc86('0x27')]({'where':{'userProfileId':_0x29a783[_0xcc86('0x45')]['id'],'sectionId':_0x29a783[_0xcc86('0x33')][_0xcc86('0x5f')]}});}})[_0xcc86('0x26')](function(){return _0x25a1cd;})[_0xcc86('0x26')](respondWithStatusCode(_0x20001a,null))[_0xcc86('0x48')](handleError(_0x20001a,null));};exports[_0xcc86('0x60')]=function(_0x528a67,_0x10572c){var _0x350404=[];var _0x11ace0=[];return db[_0xcc86('0x50')][_0xcc86('0x51')]({'where':{'userProfileId':_0x528a67[_0xcc86('0x45')]['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x20590e){_0x350404=_[_0xcc86('0x3d')](_0x20590e,function(_0x57eb7f){return _0x57eb7f[_0xcc86('0x61')]===0x1||_[_0xcc86('0x62')]([0x3eb,0x709],_0x57eb7f[_0xcc86('0x56')]);});if(!_[_0xcc86('0x63')](_0x350404)){return _[_0xcc86('0x3e')](_0x350404,function(_0x4165d4){return _0x4165d4[_0xcc86('0x56')];});}else{return;}})[_0xcc86('0x26')](function(_0x4fba7c){if(_0x4fba7c)_0x11ace0=_0x4fba7c;if(_[_0xcc86('0x62')](_0x11ace0,0x64)){var _0xd20de=_[_0xcc86('0x47')](_0x350404,{'sectionId':0x64});return hasDefaultDashboard(_0xd20de)['then'](function(_0x2cda84){return _[_0xcc86('0x3e')](_0x350404,function(_0x390e05){if(_0x390e05['sectionId']===0x64){_0x390e05['subsections']=_0x2cda84;}return _0x390e05;});});}else{return;}})[_0xcc86('0x26')](function(_0x3e291e){if(_0x3e291e)_0x350404=_0x3e291e;if(_['includes'](_0x11ace0,0x3eb)){var _0x1c4e89=_[_0xcc86('0x47')](_0x350404,{'sectionId':0x3eb});return getCustomDashboards(_0x1c4e89)[_0xcc86('0x26')](function(_0x380476){return _['map'](_0x350404,function(_0x2676c5){if(_0x1c4e89[_0xcc86('0x61')]){if(_0x2676c5[_0xcc86('0x56')]===0x3eb){_0x2676c5['subsections']=_0x380476;}}else{if(_0x2676c5[_0xcc86('0x56')]===0x64){if(!_0x2676c5[_0xcc86('0x64')]){_0x2676c5[_0xcc86('0x64')]=[];}_0x2676c5['subsections']=_0x2676c5[_0xcc86('0x64')][_0xcc86('0x65')](_0x380476);}}return _0x2676c5;});});}else{return;}})[_0xcc86('0x26')](function(_0x41475c){if(_0x41475c)_0x350404=_0x41475c;if(_[_0xcc86('0x62')](_0x11ace0,0x709)){var _0x3fe5e6=_[_0xcc86('0x47')](_0x350404,{'sectionId':0x709});return getPlugins(_0x3fe5e6)[_0xcc86('0x26')](function(_0x27b069){if(_0x3fe5e6[_0xcc86('0x61')]){return _[_0xcc86('0x3e')](_0x350404,function(_0x16d55f){if(_0x16d55f[_0xcc86('0x56')]===0x709){_0x16d55f[_0xcc86('0x64')]=_0x27b069;}return _0x16d55f;});}else{var _0x42cf48={'sectionId':0x76c,'enabled':0x1,'subsections':_0x27b069};var _0x4716b5=_[_0xcc86('0x3e')](_0x350404);_0x4716b5[_0xcc86('0x5d')](_0x42cf48);return _0x4716b5;}});}else{return;}})[_0xcc86('0x26')](function(_0x1d4e49){if(_0x1d4e49)_0x350404=_0x1d4e49;return _[_0xcc86('0x3d')](_0x350404,['enabled',0x1]);})[_0xcc86('0x26')](respondWithResult(_0x10572c,null))[_0xcc86('0x48')](handleError(_0x10572c,null));};function hasDefaultDashboard(_0x5561e0){var _0x11c68c=[0x65];return new BPromise(function(_0x10b414,_0x117fa6){try{if(_0x5561e0[_0xcc86('0x53')]){_0x10b414(_0x11c68c);}else{return db[_0xcc86('0x54')][_0xcc86('0x66')]({'where':{'sectionId':_0x5561e0['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x3fb903){_0x3fb903?_0x10b414(_0x11c68c):_0x10b414();});}}catch(_0x28288b){_0x117fa6(_0x28288b);}});}function getCustomDashboards(_0x2ddc1b){var _0x4cbf42=[];return new BPromise(function(_0x86b386,_0x249187){try{if(_0x2ddc1b['autoAssociation']){return db['Dashboard'][_0xcc86('0x51')]({'raw':!![]})['then'](function(_0x2f987c){_0x2f987c[_0xcc86('0x67')](function(_0x24e87c){_0x4cbf42[_0xcc86('0x5d')](_0x24e87c['id']+0x1869f);});_0x86b386(_0x4cbf42);});}else{return db[_0xcc86('0x54')][_0xcc86('0x51')]({'where':{'sectionId':_0x2ddc1b['id']},'raw':!![]})['then'](function(_0x2e6e3a){_0x2e6e3a[_0xcc86('0x67')](function(_0x6ee707){_0x4cbf42[_0xcc86('0x5d')](_0x6ee707[_0xcc86('0x68')]+0x1869f);});_0x86b386(_0x4cbf42);});}}catch(_0x3d7c8c){_0x249187(_0x3d7c8c);}});}function getPlugins(_0x233cd8){var _0x54c3af=[];return new BPromise(function(_0xfe85c4,_0x52b02a){try{if(_0x233cd8['autoAssociation']){return db['Plugin'][_0xcc86('0x51')]({'raw':!![]})['then'](function(_0x4930dd){_0x4930dd[_0xcc86('0x67')](function(_0x557326){_0x54c3af[_0xcc86('0x5d')](_0x557326['id']+0x15b38);});_0xfe85c4(_0x54c3af);});}else{return db['UserProfileResource'][_0xcc86('0x51')]({'where':{'sectionId':_0x233cd8['id']},'raw':!![]})[_0xcc86('0x26')](function(_0x196302){_0x196302[_0xcc86('0x67')](function(_0x2da7bf){_0x54c3af[_0xcc86('0x5d')](_0x2da7bf[_0xcc86('0x68')]+0x15b38);});_0xfe85c4(_0x54c3af);});}}catch(_0x471a73){_0x52b02a(_0x471a73);}});}exports[_0xcc86('0x69')]=function(_0x374adf,_0x17c618){return db['UserProfile'][_0xcc86('0x47')]({'where':{'id':_0x374adf[_0xcc86('0x45')]['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x17c618,null))[_0xcc86('0x26')](function(_0x5798bc){if(_0x5798bc){return db[_0xcc86('0x5b')][_0xcc86('0x5c')](function(_0x2932e5){return db[_0xcc86('0x50')]['findAll']({'where':{'userProfileId':_0x374adf['params']['id']},'attributes':['id'],'raw':!![]})[_0xcc86('0x26')](function(_0x51b911){if(_0x51b911){return db['UserProfileSection'][_0xcc86('0x27')]({'where':{'userProfileId':_0x374adf[_0xcc86('0x45')]['id'],'id':_['map'](_0x51b911,function(_0x3f2285){return _0x3f2285['id'];})},'transaction':_0x2932e5});}})[_0xcc86('0x26')](function(_0x4d8826){var _0x55c70e=_[_0xcc86('0x3e')](_0x374adf['body'],function(_0x1bbe7b){_0x1bbe7b[_0xcc86('0x57')]=_0x374adf[_0xcc86('0x45')]['id'];return _0x1bbe7b;});return db[_0xcc86('0x50')][_0xcc86('0x6a')](_0x55c70e,{'raw':!![],'transaction':_0x2932e5});})[_0xcc86('0x26')](function(_0x41f057){var _0x4d748e=_[_0xcc86('0x3d')](_['map'](_0x41f057,function(_0x801724){return _0x801724[_0xcc86('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x4d748e){return db[_0xcc86('0x50')][_0xcc86('0x51')]({'where':{'userProfileId':_0x374adf[_0xcc86('0x45')]['id'],'sectionId':_[_0xcc86('0x3e')](_0x4d748e,function(_0x202e9b){return _0x202e9b[_0xcc86('0x56')];})},'attributes':['id',_0xcc86('0x56')],'raw':!![]})[_0xcc86('0x26')](function(_0xfbefa5){var _0x47c0b9=_[_0xcc86('0x3e')](_0x374adf[_0xcc86('0x4a')],function(_0x56627e){_0x56627e[_0xcc86('0x57')]=_0x374adf['params']['id'];return _0x56627e;});return db[_0xcc86('0x54')][_0xcc86('0x6a')](_0x47c0b9,{'raw':!![],'transaction':_0x2932e5});});}})['catch'](handleError(_0x17c618,null));});}})[_0xcc86('0x26')](function(_0x2bb960){var _0x54346e=_['map'](_0x2bb960,function(_0x5b2ab4){return _0x5b2ab4[_0xcc86('0x4c')]({'plain':!![]});});})[_0xcc86('0x26')](respondWithResult(_0x17c618,null))[_0xcc86('0x48')](handleError(_0x17c618,null));};exports[_0xcc86('0x6b')]=function(_0x4645f9,_0x54be67,_0x361d16){return db['UserProfile']['find']({'where':{'id':_0x4645f9[_0xcc86('0x45')]['id']}})[_0xcc86('0x26')](handleEntityNotFound(_0x54be67,null))[_0xcc86('0x26')](function(_0x508299){if(_0x508299){return _0x508299[_0xcc86('0x6b')](_0x4645f9[_0xcc86('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x54be67,null))[_0xcc86('0x48')](handleError(_0x54be67,null));};exports[_0xcc86('0x6c')]=function(_0x29ee2a,_0x1e8589){var _0x2a080c={};if(!_0x29ee2a['query']['section'])throw new Error(_0xcc86('0x6d'));if(!_0x29ee2a['query'][_0xcc86('0x38')](_0xcc86('0x6e'))){_0x2a080c[_0xcc86('0x1e')]=qs[_0xcc86('0x1e')](_0x29ee2a[_0xcc86('0x33')]['limit']);_0x2a080c['offset']=qs[_0xcc86('0x20')](_0x29ee2a[_0xcc86('0x33')][_0xcc86('0x20')]);}return db[_0xcc86('0x41')][_0xcc86('0x47')]({'where':{'id':_0x29ee2a['params']['id']}})[_0xcc86('0x26')](function(_0x39d9c6){if(!_0x39d9c6)throw new Error(_0xcc86('0x6f')+_0x29ee2a[_0xcc86('0x45')]['id']);return db['UserProfile'][_0xcc86('0x6c')](_0x29ee2a);})['then'](respondWithFilteredResult(_0x1e8589,_0x2a080c))['catch'](handleError(_0x1e8589,null));};
\ No newline at end of file
+var _0x6441=['userProfileId','Resources','update','describe','sequelize','push','getSections','enabled','includes','isEmpty','subsections','concat','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','offset','undefined','limit','count','apply','reject','save','then','destroy','end','stack','name','send','index','UserProfile','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','type','filter','options','includeAll','include','rows','show','find','catch','create','body','clone','params','length','get','omit','createdAt','updatedAt','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','findAll','sectionId'];(function(_0x28bf7c,_0x4ed463){var _0x39f246=function(_0x59311f){while(--_0x59311f){_0x28bf7c['push'](_0x28bf7c['shift']());}};_0x39f246(++_0x4ed463);}(_0x6441,0x16a));var _0x1644=function(_0x13c598,_0x30a951){_0x13c598=_0x13c598-0x0;var _0x351bfc=_0x6441[_0x13c598];return _0x351bfc;};'use strict';var emlformat=require(_0x1644('0x0'));var rimraf=require(_0x1644('0x1'));var zipdir=require(_0x1644('0x2'));var jsonpatch=require(_0x1644('0x3'));var rp=require(_0x1644('0x4'));var moment=require(_0x1644('0x5'));var BPromise=require(_0x1644('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1644('0x7'));var sox=require('sox');var csv=require(_0x1644('0x8'));var ejs=require(_0x1644('0x9'));var fs=require('fs');var fs_extra=require(_0x1644('0xa'));var _=require(_0x1644('0xb'));var squel=require('squel');var crypto=require(_0x1644('0xc'));var jsforce=require(_0x1644('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1644('0x8'));var querystring=require(_0x1644('0xe'));var Papa=require('papaparse');var Redis=require(_0x1644('0xf'));var authService=require(_0x1644('0x10'));var qs=require(_0x1644('0x11'));var as=require(_0x1644('0x12'));var hardwareService=require(_0x1644('0x13'));var logger=require(_0x1644('0x14'))(_0x1644('0x15'));var utils=require(_0x1644('0x16'));var config=require(_0x1644('0x17'));var licenseUtil=require(_0x1644('0x18'));var db=require('../../mysqldb')['db'];config[_0x1644('0x19')]=_[_0x1644('0x1a')](config[_0x1644('0x19')],{'host':_0x1644('0x1b'),'port':0x18eb});var socket=require(_0x1644('0x1c'))(new Redis(config['redis']));require(_0x1644('0x1d'))[_0x1644('0x1e')](socket);function respondWithStatusCode(_0xed0e4b,_0x506557){_0x506557=_0x506557||0xcc;return function(_0x79cccf){if(_0x79cccf){return _0xed0e4b[_0x1644('0x1f')](_0x506557);}return _0xed0e4b[_0x1644('0x20')](_0x506557)['end']();};}function respondWithResult(_0x42fbfe,_0x5d7562){_0x5d7562=_0x5d7562||0xc8;return function(_0x1ea887){if(_0x1ea887){return _0x42fbfe[_0x1644('0x20')](_0x5d7562)[_0x1644('0x21')](_0x1ea887);}};}function respondWithFilteredResult(_0x720959,_0x2be1d5){return function(_0x4b58db){if(_0x4b58db){var _0x145fc8=typeof _0x2be1d5[_0x1644('0x22')]===_0x1644('0x23')&&typeof _0x2be1d5[_0x1644('0x24')]===_0x1644('0x23');var _0x27d4b7=_0x4b58db[_0x1644('0x25')];var _0x424d04=_0x145fc8?0x0:_0x2be1d5['offset'];var _0x2f8436=_0x145fc8?_0x4b58db['count']:_0x2be1d5['offset']+_0x2be1d5[_0x1644('0x24')];var _0x21ed0d;if(_0x2f8436>=_0x27d4b7){_0x2f8436=_0x27d4b7;_0x21ed0d=0xc8;}else{_0x21ed0d=0xce;}_0x720959[_0x1644('0x20')](_0x21ed0d);return _0x720959['set']('Content-Range',_0x424d04+'-'+_0x2f8436+'/'+_0x27d4b7)[_0x1644('0x21')](_0x4b58db);}return null;};}function patchUpdates(_0x42bbf6){return function(_0x5c27dd){try{jsonpatch[_0x1644('0x26')](_0x5c27dd,_0x42bbf6,!![]);}catch(_0x2f3aaa){return BPromise[_0x1644('0x27')](_0x2f3aaa);}return _0x5c27dd[_0x1644('0x28')]();};}function saveUpdates(_0xf34514,_0x2cbab3){return function(_0x86752c){if(_0x86752c){return _0x86752c['update'](_0xf34514)[_0x1644('0x29')](function(_0x1cc471){return _0x1cc471;});}return null;};}function removeEntity(_0x243c93,_0x2f5ad6){return function(_0x2e9924){if(_0x2e9924){return _0x2e9924[_0x1644('0x2a')]()['then'](function(){_0x243c93[_0x1644('0x20')](0xcc)[_0x1644('0x2b')]();});}};}function handleEntityNotFound(_0x358f00,_0x5276b6){return function(_0xbd0965){if(!_0xbd0965){_0x358f00['sendStatus'](0x194);}return _0xbd0965;};}function handleError(_0x5859b7,_0x398fe0){_0x398fe0=_0x398fe0||0x1f4;return function(_0x5376cf){logger['error'](_0x5376cf[_0x1644('0x2c')]);if(_0x5376cf[_0x1644('0x2d')]){delete _0x5376cf[_0x1644('0x2d')];}_0x5859b7[_0x1644('0x20')](_0x398fe0)[_0x1644('0x2e')](_0x5376cf);};}exports[_0x1644('0x2f')]=function(_0x206524,_0x8b5af4){var _0x2a6167={},_0x3ff831={},_0x1e7ffd={'count':0x0,'rows':[]};var _0x34fec4=_['map'](db[_0x1644('0x30')][_0x1644('0x31')],function(_0x439f1){return{'name':_0x439f1[_0x1644('0x32')],'type':_0x439f1['type'][_0x1644('0x33')]};});_0x3ff831[_0x1644('0x34')]=_[_0x1644('0x35')](_0x34fec4,_0x1644('0x2d'));_0x3ff831[_0x1644('0x36')]=_[_0x1644('0x37')](_0x206524[_0x1644('0x36')]);_0x3ff831[_0x1644('0x38')]=_[_0x1644('0x39')](_0x3ff831[_0x1644('0x34')],_0x3ff831[_0x1644('0x36')]);_0x2a6167[_0x1644('0x3a')]=_[_0x1644('0x39')](_0x3ff831[_0x1644('0x34')],qs['fields'](_0x206524[_0x1644('0x36')][_0x1644('0x3b')]));_0x2a6167['attributes']=_0x2a6167['attributes']['length']?_0x2a6167[_0x1644('0x3a')]:_0x3ff831['model'];if(!_0x206524[_0x1644('0x36')]['hasOwnProperty'](_0x1644('0x3c'))){_0x2a6167[_0x1644('0x24')]=qs[_0x1644('0x24')](_0x206524[_0x1644('0x36')]['limit']);_0x2a6167[_0x1644('0x22')]=qs[_0x1644('0x22')](_0x206524[_0x1644('0x36')]['offset']);}_0x2a6167[_0x1644('0x3d')]=qs[_0x1644('0x3e')](_0x206524['query'][_0x1644('0x3e')]);_0x2a6167[_0x1644('0x3f')]=qs['filters'](_['pick'](_0x206524[_0x1644('0x36')],_0x3ff831[_0x1644('0x38')]),_0x34fec4);if(_0x206524['query']['filter']){_0x2a6167[_0x1644('0x3f')]=_[_0x1644('0x40')](_0x2a6167['where'],{'$or':_[_0x1644('0x35')](_0x34fec4,function(_0x2bf922){if(_0x2bf922[_0x1644('0x41')]!=='VIRTUAL'){var _0x788fae={};_0x788fae[_0x2bf922[_0x1644('0x2d')]]={'$like':'%'+_0x206524[_0x1644('0x36')][_0x1644('0x42')]+'%'};return _0x788fae;}})});}_0x2a6167=_[_0x1644('0x40')]({},_0x2a6167,_0x206524[_0x1644('0x43')]);var _0x2abe07={'where':_0x2a6167['where']};return db[_0x1644('0x30')][_0x1644('0x25')](_0x2abe07)['then'](function(_0x3091a8){_0x1e7ffd[_0x1644('0x25')]=_0x3091a8;if(_0x206524['query'][_0x1644('0x44')]){_0x2a6167[_0x1644('0x45')]=[{'all':!![]}];}return db[_0x1644('0x30')]['findAll'](_0x2a6167);})[_0x1644('0x29')](function(_0xf31700){_0x1e7ffd[_0x1644('0x46')]=_0xf31700;return _0x1e7ffd;})[_0x1644('0x29')](respondWithFilteredResult(_0x8b5af4,_0x2a6167))['catch'](handleError(_0x8b5af4,null));};exports[_0x1644('0x47')]=function(_0x1329e1,_0x143a89){var _0x142618={'raw':![],'where':{'id':_0x1329e1['params']['id']}},_0x36ce0c={};_0x36ce0c[_0x1644('0x34')]=_[_0x1644('0x37')](db[_0x1644('0x30')][_0x1644('0x31')]);_0x36ce0c[_0x1644('0x36')]=_['keys'](_0x1329e1[_0x1644('0x36')]);_0x36ce0c[_0x1644('0x38')]=_[_0x1644('0x39')](_0x36ce0c[_0x1644('0x34')],_0x36ce0c[_0x1644('0x36')]);_0x142618[_0x1644('0x3a')]=_[_0x1644('0x39')](_0x36ce0c['model'],qs[_0x1644('0x3b')](_0x1329e1[_0x1644('0x36')][_0x1644('0x3b')]));_0x142618[_0x1644('0x3a')]=_0x142618[_0x1644('0x3a')]['length']?_0x142618['attributes']:_0x36ce0c[_0x1644('0x34')];if(_0x1329e1[_0x1644('0x36')][_0x1644('0x44')]){_0x142618[_0x1644('0x45')]=[{'all':!![]}];}_0x142618=_['merge']({},_0x142618,_0x1329e1[_0x1644('0x43')]);return db[_0x1644('0x30')][_0x1644('0x48')](_0x142618)['then'](handleEntityNotFound(_0x143a89,null))[_0x1644('0x29')](respondWithResult(_0x143a89,null))[_0x1644('0x49')](handleError(_0x143a89,null));};exports[_0x1644('0x4a')]=function(_0x51d37c,_0x2fce62){return db['UserProfile'][_0x1644('0x4a')](_0x51d37c[_0x1644('0x4b')],{})[_0x1644('0x29')](respondWithResult(_0x2fce62,0xc9))['catch'](handleError(_0x2fce62,null));};exports[_0x1644('0x4c')]=function(_0x3c0094,_0x52c63b){var _0xab9930={'where':{'id':_0x3c0094[_0x1644('0x4d')]['id']}},_0x1cae33={};_0x1cae33[_0x1644('0x34')]=_[_0x1644('0x37')](db[_0x1644('0x30')][_0x1644('0x31')]);_0xab9930[_0x1644('0x3a')]=_['intersection'](_0x1cae33['model'],qs[_0x1644('0x3b')](_0x3c0094[_0x1644('0x36')][_0x1644('0x3b')]));_0xab9930['attributes']=_0xab9930[_0x1644('0x3a')][_0x1644('0x4e')]?_0xab9930['attributes']:_0x1cae33[_0x1644('0x34')];if(_0x3c0094[_0x1644('0x36')][_0x1644('0x44')]){_0xab9930[_0x1644('0x45')]=[{'all':!![]}];}_0xab9930=_['merge']({},_0xab9930,_0x3c0094[_0x1644('0x43')]);return db[_0x1644('0x30')]['find'](_0xab9930)[_0x1644('0x29')](handleEntityNotFound(_0x52c63b,null))[_0x1644('0x29')](function(_0x52568e){if(_0x52568e){var _0x18d758=_0x52568e[_0x1644('0x4f')]({'plain':!![]});_0x18d758=qs[_0x1644('0x50')](_0x18d758,['id','createdAt','updatedAt','crudPermissions']);_0x3c0094[_0x1644('0x4b')]=_['omit'](_0x3c0094[_0x1644('0x4b')],['id',_0x1644('0x51'),_0x1644('0x52')]);return db['sequelize'][_0x1644('0x53')](function(_0x7c4cef){return db[_0x1644('0x30')][_0x1644('0x4a')](_[_0x1644('0x40')](_0x18d758,_0x3c0094[_0x1644('0x4b')]),{'include':_0x3c0094['query']['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x7c4cef})[_0x1644('0x29')](function(_0x334fa8){var _0x2c1184=_0x334fa8[_0x1644('0x4f')]({'plain':!![]});return db[_0x1644('0x54')]['findAll']({'where':{'userProfileId':_0x3c0094['params']['id']},'raw':!![]})[_0x1644('0x29')](function(_0x31106e){if(_0x31106e){return BPromise[_0x1644('0x55')](_0x31106e,function(_0x4af7f9){return new BPromise(function(_0xee1d52,_0x202950){if(_0x4af7f9[_0x1644('0x56')]===null||_0x4af7f9[_0x1644('0x56')]===0x1)_0xee1d52(null);return db[_0x1644('0x57')][_0x1644('0x58')]({'where':{'sectionId':_0x4af7f9['id']},'raw':!![]})['then'](function(_0x4385e6){var _0x92a458=_[_0x1644('0x35')](_0x4385e6,function(_0x2b7c73){return qs[_0x1644('0x50')](_0x2b7c73,['id','createdAt',_0x1644('0x52'),_0x1644('0x59')]);});_0xee1d52(_0x92a458);})[_0x1644('0x49')](function(_0x308914){_0x202950(_0x308914);});})[_0x1644('0x29')](function(_0x505f37){var _0x20222d=qs[_0x1644('0x50')](_0x4af7f9,['id',_0x1644('0x51'),_0x1644('0x52')]);_0x20222d[_0x1644('0x5a')]=_0x2c1184['id'];if(_0x505f37)_0x20222d[_0x1644('0x5b')]=_0x505f37;return _0x20222d;})[_0x1644('0x29')](function(_0x1299f6){return db['UserProfileSection'][_0x1644('0x4a')](_0x1299f6,{'include':[{'model':db[_0x1644('0x57')],'as':_0x1644('0x5b')}],'raw':!![],'transaction':_0x7c4cef});});})[_0x1644('0x29')](function(){return _0x2c1184;});}});});});}})['then'](respondWithResult(_0x52c63b,0xc9))['catch'](handleError(_0x52c63b,null));};exports[_0x1644('0x5c')]=function(_0x3d1681,_0x302c79){if(_0x3d1681[_0x1644('0x4b')]['id']){delete _0x3d1681['body']['id'];}return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x3d1681[_0x1644('0x4d')]['id']}})['then'](handleEntityNotFound(_0x302c79,null))[_0x1644('0x29')](saveUpdates(_0x3d1681[_0x1644('0x4b')],null))['then'](respondWithResult(_0x302c79,null))[_0x1644('0x49')](handleError(_0x302c79,null));};exports[_0x1644('0x2a')]=function(_0x25b665,_0x4f2fa3){return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x25b665[_0x1644('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f2fa3,null))[_0x1644('0x29')](removeEntity(_0x4f2fa3,null))[_0x1644('0x49')](handleError(_0x4f2fa3,null));};exports[_0x1644('0x5d')]=function(_0x2b6ab6,_0x3bb14b){return db[_0x1644('0x30')][_0x1644('0x5d')]()[_0x1644('0x29')](respondWithResult(_0x3bb14b,null))['catch'](handleError(_0x3bb14b,null));};exports['addSections']=function(_0x29a76d,_0x3ef83c){var _0x7eba93=_0x29a76d[_0x1644('0x4b')];return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x29a76d['params']['id']}})[_0x1644('0x29')](handleEntityNotFound(_0x3ef83c,null))[_0x1644('0x29')](function(_0x2bd689){if(_0x2bd689){return db[_0x1644('0x5e')]['transaction'](function(_0x4dfe0a){return db[_0x1644('0x54')][_0x1644('0x2a')]({'where':{'userProfileId':_0x29a76d[_0x1644('0x4d')]['id'],'sectionId':_[_0x1644('0x35')](_0x7eba93,function(_0x3062fc){return _0x3062fc[_0x1644('0x59')];})},'transaction':_0x4dfe0a})[_0x1644('0x29')](function(){var _0x5c39a3=_['map'](_0x7eba93,function(_0x4eea18){_0x4eea18[_0x1644('0x5a')]=_0x29a76d[_0x1644('0x4d')]['id'];return _0x4eea18;});var _0x4a81f1=[];return BPromise[_0x1644('0x55')](_0x5c39a3,function(_0x2143c6){return db[_0x1644('0x54')][_0x1644('0x4a')](_0x2143c6,{'include':[{'model':db[_0x1644('0x57')],'as':_0x1644('0x5b')}],'raw':!![],'transaction':_0x4dfe0a})[_0x1644('0x29')](function(_0x472377){_0x4a81f1[_0x1644('0x5f')](_0x472377[_0x1644('0x4f')]({'plain':!![]}));});})[_0x1644('0x29')](function(){return _0x4a81f1;});});});}})[_0x1644('0x29')](function(_0x5d27c6){return _0x5d27c6;})[_0x1644('0x29')](respondWithResult(_0x3ef83c,null))['catch'](handleError(_0x3ef83c,null));};exports['removeSections']=function(_0x3d14c6,_0x4539ea){var _0x3e53df;return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x3d14c6[_0x1644('0x4d')]['id']},'attributes':['id',_0x1644('0x2d')]})['then'](handleEntityNotFound(_0x4539ea,null))[_0x1644('0x29')](function(_0x26bb62){if(_0x26bb62){_0x3e53df=_0x26bb62;return db[_0x1644('0x54')][_0x1644('0x2a')]({'where':{'userProfileId':_0x3d14c6[_0x1644('0x4d')]['id'],'sectionId':_0x3d14c6[_0x1644('0x36')]['ids']}});}})[_0x1644('0x29')](function(){return _0x3e53df;})['then'](respondWithStatusCode(_0x4539ea,null))[_0x1644('0x49')](handleError(_0x4539ea,null));};exports[_0x1644('0x60')]=function(_0x193342,_0x17716c){var _0x5c522d=[];var _0xf2ad24=[];return db['UserProfileSection'][_0x1644('0x58')]({'where':{'userProfileId':_0x193342['params']['id']},'raw':!![]})['then'](function(_0x2d82d2){_0x5c522d=_[_0x1644('0x42')](_0x2d82d2,function(_0x51020){return _0x51020[_0x1644('0x61')]===0x1||_[_0x1644('0x62')]([0x3eb,0x709],_0x51020[_0x1644('0x59')]);});if(!_[_0x1644('0x63')](_0x5c522d)){return _[_0x1644('0x35')](_0x5c522d,function(_0x1f021a){return _0x1f021a[_0x1644('0x59')];});}else{return;}})[_0x1644('0x29')](function(_0x10dfff){if(_0x10dfff)_0xf2ad24=_0x10dfff;if(_[_0x1644('0x62')](_0xf2ad24,0x64)){var _0x2a9e9c=_['find'](_0x5c522d,{'sectionId':0x64});return hasDefaultDashboard(_0x2a9e9c)[_0x1644('0x29')](function(_0x87d5b0){return _[_0x1644('0x35')](_0x5c522d,function(_0xdd509d){if(_0xdd509d[_0x1644('0x59')]===0x64){_0xdd509d['subsections']=_0x87d5b0;}return _0xdd509d;});});}else{return;}})[_0x1644('0x29')](function(_0x1771b9){if(_0x1771b9)_0x5c522d=_0x1771b9;if(_[_0x1644('0x62')](_0xf2ad24,0x3eb)){var _0x3c028f=_[_0x1644('0x48')](_0x5c522d,{'sectionId':0x3eb});return getCustomDashboards(_0x3c028f)[_0x1644('0x29')](function(_0x3bd9a5){return _[_0x1644('0x35')](_0x5c522d,function(_0x4cf45e){if(_0x3c028f[_0x1644('0x61')]){if(_0x4cf45e[_0x1644('0x59')]===0x3eb){_0x4cf45e[_0x1644('0x64')]=_0x3bd9a5;}}else{if(_0x4cf45e[_0x1644('0x59')]===0x64){if(!_0x4cf45e[_0x1644('0x64')]){_0x4cf45e[_0x1644('0x64')]=[];}_0x4cf45e[_0x1644('0x64')]=_0x4cf45e[_0x1644('0x64')][_0x1644('0x65')](_0x3bd9a5);}}return _0x4cf45e;});});}else{return;}})['then'](function(_0x4d061e){if(_0x4d061e)_0x5c522d=_0x4d061e;if(_[_0x1644('0x62')](_0xf2ad24,0x709)){var _0x3e9a98=_[_0x1644('0x48')](_0x5c522d,{'sectionId':0x709});return getPlugins(_0x3e9a98)[_0x1644('0x29')](function(_0x5a33af){if(_0x3e9a98[_0x1644('0x61')]){return _['map'](_0x5c522d,function(_0x23329c){if(_0x23329c['sectionId']===0x709){_0x23329c['subsections']=_0x5a33af;}return _0x23329c;});}else{var _0xc2aef1={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5a33af};var _0x4175f0=_[_0x1644('0x35')](_0x5c522d);_0x4175f0['push'](_0xc2aef1);return _0x4175f0;}});}else{return;}})['then'](function(_0x13949b){if(_0x13949b)_0x5c522d=_0x13949b;return _[_0x1644('0x42')](_0x5c522d,['enabled',0x1]);})[_0x1644('0x29')](respondWithResult(_0x17716c,null))['catch'](handleError(_0x17716c,null));};function hasDefaultDashboard(_0x29ed68){var _0x50b67b=[0x65];return new BPromise(function(_0x14456c,_0x34a78b){try{if(_0x29ed68[_0x1644('0x56')]){_0x14456c(_0x50b67b);}else{return db[_0x1644('0x57')]['findOne']({'where':{'sectionId':_0x29ed68['id']},'raw':!![]})[_0x1644('0x29')](function(_0x228d95){_0x228d95?_0x14456c(_0x50b67b):_0x14456c();});}}catch(_0x2e078d){_0x34a78b(_0x2e078d);}});}function getCustomDashboards(_0x1a0174){var _0x32481c=[];return new BPromise(function(_0xd0c483,_0x920556){try{if(_0x1a0174[_0x1644('0x56')]){return db[_0x1644('0x66')][_0x1644('0x58')]({'raw':!![]})[_0x1644('0x29')](function(_0x14b3a7){_0x14b3a7[_0x1644('0x67')](function(_0x552467){_0x32481c[_0x1644('0x5f')](_0x552467['id']+0x1869f);});_0xd0c483(_0x32481c);});}else{return db[_0x1644('0x57')]['findAll']({'where':{'sectionId':_0x1a0174['id']},'raw':!![]})[_0x1644('0x29')](function(_0x315731){_0x315731[_0x1644('0x67')](function(_0x24053b){_0x32481c[_0x1644('0x5f')](_0x24053b[_0x1644('0x68')]+0x1869f);});_0xd0c483(_0x32481c);});}}catch(_0x12abd6){_0x920556(_0x12abd6);}});}function getPlugins(_0xe7ec50){var _0xce1372=[];return new BPromise(function(_0x34e40,_0x2e10b1){try{if(_0xe7ec50[_0x1644('0x56')]){return db['Plugin']['findAll']({'raw':!![]})[_0x1644('0x29')](function(_0x3daabc){_0x3daabc[_0x1644('0x67')](function(_0x2a1709){_0xce1372[_0x1644('0x5f')](_0x2a1709['id']+0x15b38);});_0x34e40(_0xce1372);});}else{return db[_0x1644('0x57')]['findAll']({'where':{'sectionId':_0xe7ec50['id']},'raw':!![]})['then'](function(_0x29d17b){_0x29d17b[_0x1644('0x67')](function(_0x450f73){_0xce1372[_0x1644('0x5f')](_0x450f73[_0x1644('0x68')]+0x15b38);});_0x34e40(_0xce1372);});}}catch(_0x250f6d){_0x2e10b1(_0x250f6d);}});}exports[_0x1644('0x69')]=function(_0x125f23,_0x2361ca){return db[_0x1644('0x30')][_0x1644('0x48')]({'where':{'id':_0x125f23[_0x1644('0x4d')]['id']}})[_0x1644('0x29')](handleEntityNotFound(_0x2361ca,null))[_0x1644('0x29')](function(_0x2c029a){if(_0x2c029a){return db['sequelize'][_0x1644('0x53')](function(_0x1f637f){return db['UserProfileSection'][_0x1644('0x58')]({'where':{'userProfileId':_0x125f23[_0x1644('0x4d')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4657be){if(_0x4657be){return db[_0x1644('0x54')][_0x1644('0x2a')]({'where':{'userProfileId':_0x125f23[_0x1644('0x4d')]['id'],'id':_[_0x1644('0x35')](_0x4657be,function(_0x53a746){return _0x53a746['id'];})},'transaction':_0x1f637f});}})['then'](function(_0x2f0b87){var _0x2a5b27=_['map'](_0x125f23[_0x1644('0x4b')],function(_0x5abe6e){_0x5abe6e[_0x1644('0x5a')]=_0x125f23[_0x1644('0x4d')]['id'];return _0x5abe6e;});return db[_0x1644('0x54')][_0x1644('0x6a')](_0x2a5b27,{'raw':!![],'transaction':_0x1f637f});})[_0x1644('0x29')](function(_0x3bb3bc){var _0x518006=_[_0x1644('0x42')](_['map'](_0x3bb3bc,function(_0x549009){return _0x549009[_0x1644('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x518006){return db[_0x1644('0x54')]['findAll']({'where':{'userProfileId':_0x125f23['params']['id'],'sectionId':_[_0x1644('0x35')](_0x518006,function(_0x544ddc){return _0x544ddc[_0x1644('0x59')];})},'attributes':['id',_0x1644('0x59')],'raw':!![]})[_0x1644('0x29')](function(_0x53bee5){var _0x48d289=_[_0x1644('0x35')](_0x125f23[_0x1644('0x4b')],function(_0x384c9f){_0x384c9f[_0x1644('0x5a')]=_0x125f23[_0x1644('0x4d')]['id'];return _0x384c9f;});return db['UserProfileResource']['bulkCreate'](_0x48d289,{'raw':!![],'transaction':_0x1f637f});});}})['catch'](handleError(_0x2361ca,null));});}})['then'](function(_0x32c043){var _0x15eee0=_[_0x1644('0x35')](_0x32c043,function(_0x246fd7){return _0x246fd7['get']({'plain':!![]});});})['then'](respondWithResult(_0x2361ca,null))[_0x1644('0x49')](handleError(_0x2361ca,null));};exports[_0x1644('0x6b')]=function(_0x36d85b,_0x33b2aa,_0x387389){return db[_0x1644('0x30')]['find']({'where':{'id':_0x36d85b[_0x1644('0x4d')]['id']}})[_0x1644('0x29')](handleEntityNotFound(_0x33b2aa,null))['then'](function(_0x57f9c1){if(_0x57f9c1){return _0x57f9c1[_0x1644('0x6b')](_0x36d85b[_0x1644('0x36')]['ids']);}})[_0x1644('0x29')](respondWithStatusCode(_0x33b2aa,null))[_0x1644('0x49')](handleError(_0x33b2aa,null));};exports['getResources']=function(_0x2c9f4a,_0x441bc8){var _0x3f22e1={};if(!_0x2c9f4a[_0x1644('0x36')][_0x1644('0x6c')])throw new Error(_0x1644('0x6d'));if(!_0x2c9f4a[_0x1644('0x36')][_0x1644('0x6e')](_0x1644('0x3c'))){_0x3f22e1[_0x1644('0x24')]=qs[_0x1644('0x24')](_0x2c9f4a['query'][_0x1644('0x24')]);_0x3f22e1[_0x1644('0x22')]=qs[_0x1644('0x22')](_0x2c9f4a['query'][_0x1644('0x22')]);}return db[_0x1644('0x30')]['find']({'where':{'id':_0x2c9f4a[_0x1644('0x4d')]['id']}})['then'](function(_0x2b63b2){if(!_0x2b63b2)throw new Error(_0x1644('0x6f')+_0x2c9f4a['params']['id']);return db['UserProfile'][_0x1644('0x70')](_0x2c9f4a);})[_0x1644('0x29')](respondWithFilteredResult(_0x441bc8,_0x3f22e1))['catch'](handleError(_0x441bc8,null));};
\ No newline at end of file
index fd22131..f387fa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1298=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x1298,0x19e));var _0x8129=function(_0x1e76a1,_0x300c05){_0x1e76a1=_0x1e76a1-0x0;var _0x4a3307=_0x1298[_0x1e76a1];return _0x4a3307;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x8129('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x8129('0x1')](0x0);var events={'afterCreate':_0x8129('0x2'),'afterUpdate':_0x8129('0x3'),'afterDestroy':_0x8129('0x4')};function emitEvent(_0x6031b2){return function(_0x31d02a,_0x39e214,_0x4fbaf9){UserProfileEvents[_0x8129('0x5')](_0x6031b2+':'+_0x31d02a['id'],_0x31d02a);UserProfileEvents[_0x8129('0x5')](_0x6031b2,_0x31d02a);_0x4fbaf9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x8129('0x6')]=UserProfileEvents;
\ No newline at end of file
+var _0x96fd=['setMaxListeners','save','remove','emit','hook','exports','../../mysqldb'];(function(_0xf4601d,_0x4bb96b){var _0x2f240f=function(_0xb1549f){while(--_0xb1549f){_0xf4601d['push'](_0xf4601d['shift']());}};_0x2f240f(++_0x4bb96b);}(_0x96fd,0x1e9));var _0xd96f=function(_0x3d6303,_0x5c65f8){_0x3d6303=_0x3d6303-0x0;var _0x4da744=_0x96fd[_0x3d6303];return _0x4da744;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd96f('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd96f('0x1')](0x0);var events={'afterCreate':_0xd96f('0x2'),'afterUpdate':'update','afterDestroy':_0xd96f('0x3')};function emitEvent(_0x110958){return function(_0x44f63c,_0x22b39b,_0x5d8681){UserProfileEvents[_0xd96f('0x4')](_0x110958+':'+_0x44f63c['id'],_0x44f63c);UserProfileEvents[_0xd96f('0x4')](_0x110958,_0x44f63c);_0x5d8681(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xd96f('0x5')](e,emitEvent(event));}}module[_0xd96f('0x6')]=UserProfileEvents;
\ No newline at end of file
index 2eac0dd..651ae21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f6c=['SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','dispositions','Disposition','customdashboards','Dashboard','pauses','Pause','sounds','Tag','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','slice','QueryTypes','SELECT','select','InteractionId','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','ignore','union','autoAssociation','rawAttributes','model','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','pick','key','VIRTUAL','foreignKey','forEach','options','includeAll','reportType','default','DefaultReports','CustomReports','count','rows','ids','customSorting','merge','extraQueryConditions','CmContact','include','Tags','color','tag','ThroughTags','sms','dataValues','fax','mail','openchannel','whatsapp','all','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','catch','map','resolve','UserProfileResource','associatedResources','AnalyticExtractedReport','resourceId','type','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','name','projectName','projects','JscriptyProject','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts'];(function(_0x2be96e,_0x2da449){var _0xea13a=function(_0x289326){while(--_0x289326){_0x2be96e['push'](_0x2be96e['shift']());}};_0xea13a(++_0x2da449);}(_0x3f6c,0x70));var _0xc3f6=function(_0x56d8df,_0x3b748e){_0x56d8df=_0x56d8df-0x0;var _0x2876a7=_0x3f6c[_0x56d8df];return _0x2876a7;};'use strict';var _=require(_0xc3f6('0x0'));var attributes=require(_0xc3f6('0x1'));var qs=require(_0xc3f6('0x2'));var squel=require(_0xc3f6('0x3'));module[_0xc3f6('0x4')]=function(_0x292d91){var _0x5545a6=_0x292d91[_0xc3f6('0x5')];function _0x2dbb70(_0x8a73fd,_0x176f21){return new Promise(function(_0x46be22,_0x340978){if(!_0x176f21)return _0x46be22(null);var _0x1884e2=_0x176f21[_0xc3f6('0x6')]?{[_0x176f21['filter'][_0xc3f6('0x7')]]:_0x176f21[_0xc3f6('0x6')][_0xc3f6('0x8')]}:undefined;return _0x5545a6[_0x8a73fd][_0xc3f6('0x9')]({'where':_0x1884e2,'raw':!![]})[_0xc3f6('0xa')](function(_0x480f83){_0x176f21['associatedResources']=_['map'](_0x480f83,'id');_0x46be22(_0x176f21);})[_0xc3f6('0xb')](function(_0x4110c6){_0x340978(_0x4110c6);});});}function _0x5f54af(_0x5c17ef,_0x3a82d3){return new Promise(function(_0x3626c1,_0x7d3964){var _0x2b9486=_0x5c17ef[_0xc3f6('0x6')]?{[_0x5c17ef[_0xc3f6('0x6')]['field']]:_0x5c17ef[_0xc3f6('0x6')][_0xc3f6('0x8')]}:undefined;return _0x5545a6[_0x5c17ef['model']][_0xc3f6('0x9')]({'where':_0x2b9486,'raw':!![]})['then'](function(_0x56c052){_0x3a82d3['associatedResources']=_[_0xc3f6('0xc')](_0x56c052,function(_0x593d4a){return _0x593d4a['name'];});_0x3626c1(_0x3a82d3);})[_0xc3f6('0xb')](function(_0x4364c8){_0x7d3964(_0x4364c8);});});}function _0x424348(_0xeda05c,_0x26162a,_0x190298){if(!_0x26162a)return Promise[_0xc3f6('0xd')](null);return new Promise(function(_0x30ecca,_0x22a304){return _0x5545a6[_0xc3f6('0xe')][_0xc3f6('0x9')]({'where':{'sectionId':_0x26162a['id']},'raw':!![]})[_0xc3f6('0xa')](function(_0x43cbfe){if(_0xeda05c[_0xc3f6('0x7')]&&_0xeda05c[_0xc3f6('0x7')]!=='id'){_0x26162a[_0xc3f6('0xf')]=_[_0xc3f6('0xc')](_0x43cbfe,function(_0x1d477e){return _0x1d477e[_0xeda05c[_0xc3f6('0x7')]];});}else{if(_0x190298===_0xc3f6('0x10')){_0x26162a['associatedResources']=_['map'](_0x43cbfe,function(_0x21ffbe){return{'id':_0x21ffbe[_0xc3f6('0x11')],'type':_0x21ffbe[_0xc3f6('0x12')]};});}else{_0x26162a['associatedResources']=_[_0xc3f6('0xc')](_0x43cbfe,function(_0x9590e7){return _0x9590e7[_0xc3f6('0x11')];});}}_0x30ecca(_0x26162a);})[_0xc3f6('0xb')](function(_0x52b90a){_0x22a304(_0x52b90a);});});}function _0x4cad00(_0x46c2d9,_0x1cc6de){var _0x4084e3={'parentSections':[]};switch(_0x46c2d9['toLowerCase']()){case _0xc3f6('0x13'):_0x4084e3[_0xc3f6('0x14')]='SquareProject';break;case'odbc':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x15');break;case _0xc3f6('0x16'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x17');_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x19'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x1b')}];break;case _0xc3f6('0x1c'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x1d');break;case'contacts':_0x4084e3[_0xc3f6('0x14')]='CmContact';_0x4084e3[_0xc3f6('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0xc3f6('0x1e')}];break;case _0xc3f6('0x1f'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x20');break;case _0xc3f6('0x21'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x22');break;case'globalcustomfields':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x23');break;case _0xc3f6('0x24'):_0x4084e3['childModel']=_0xc3f6('0x25');break;case _0xc3f6('0x26'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x27');break;case _0xc3f6('0x28'):_0x4084e3[_0xc3f6('0x14')]='FaxQueue';break;case _0xc3f6('0x29'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x2a');break;case _0xc3f6('0x2b'):case _0xc3f6('0x2c'):case _0xc3f6('0x2d'):_0x4084e3[_0xc3f6('0x14')]='VoiceExtension';break;case _0xc3f6('0x2e'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x2f');break;case'voicemails':_0x4084e3[_0xc3f6('0x14')]='VoiceMail';break;case _0xc3f6('0x30'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x31');_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x32'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x33'),'model':'User','filter':{'field':_0xc3f6('0x34'),'value':[_0xc3f6('0x35')]}},{'name':_0xc3f6('0x36'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x33'),'model':_0xc3f6('0x37'),'filter':{'field':_0xc3f6('0x34'),'value':['telephone']}},{'name':_0xc3f6('0x38'),'field':_0xc3f6('0x1a'),'foreignKey':'queue','model':_0xc3f6('0x39'),'filter':{'field':'type','value':[_0xc3f6('0x3a')]}},{'name':_0xc3f6('0x3b'),'field':_0xc3f6('0x1a'),'foreignKey':_0xc3f6('0x3c'),'model':_0xc3f6('0x39'),'filter':{'field':_0xc3f6('0x12'),'value':[_0xc3f6('0x3d')]}}];break;case'musiconholds':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x3e');break;case _0xc3f6('0x3f'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x40');break;case'voiceprefixes':_0x4084e3[_0xc3f6('0x14')]='VoicePrefix';break;case _0xc3f6('0x41'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x42');break;case _0xc3f6('0x43'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x44');break;case _0xc3f6('0x45'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x46');break;case _0xc3f6('0x47'):_0x4084e3[_0xc3f6('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x48');break;case _0xc3f6('0x49'):_0x4084e3[_0xc3f6('0x14')]='OpenchannelAccount';break;case'smsqueues':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x4a');break;case _0xc3f6('0x4b'):_0x4084e3['childModel']=_0xc3f6('0x4c');break;case _0xc3f6('0x4d'):_0x4084e3[_0xc3f6('0x14')]='WhatsappQueue';break;case _0xc3f6('0x4e'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x4f');break;case _0xc3f6('0x50'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x51');break;case _0xc3f6('0x52'):case _0xc3f6('0x53'):_0x4084e3[_0xc3f6('0x14')]='VoiceQueue';if(_0x1cc6de){_0x4084e3[_0xc3f6('0x18')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xc3f6('0x54'):case _0xc3f6('0x55'):case'telephones':_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x37');if(_0x1cc6de){_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x56'),'filter':{'field':_0xc3f6('0x34'),'value':[_0xc3f6('0x57'),'user']},'ignore':!![]},{'name':_0xc3f6('0x32')},{'name':_0xc3f6('0x36')}];}break;case _0xc3f6('0x58'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x59');break;case _0xc3f6('0x5a'):_0x4084e3['childModel']=_0xc3f6('0x5b');break;case'freshdeskaccounts':_0x4084e3[_0xc3f6('0x14')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x4084e3['childModel']=_0xc3f6('0x5c');break;case'deskaccounts':_0x4084e3['childModel']=_0xc3f6('0x5d');break;case _0xc3f6('0x5e'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x5f');break;case _0xc3f6('0x60'):_0x4084e3['childModel']=_0xc3f6('0x37');break;case'cannedanswers':_0x4084e3[_0xc3f6('0x14')]='CannedAnswer';break;case _0xc3f6('0x61'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x62');break;case _0xc3f6('0x63'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x64');break;case'intervals':_0x4084e3[_0xc3f6('0x14')]='Interval';break;case _0xc3f6('0x65'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x66');break;case'scheduler':_0x4084e3[_0xc3f6('0x14')]='Schedule';break;case _0xc3f6('0x67'):_0x4084e3[_0xc3f6('0x14')]='Sound';break;case'tags':_0x4084e3['childModel']=_0xc3f6('0x68');break;case _0xc3f6('0x69'):_0x4084e3['childModel']=_0xc3f6('0x6a');break;case _0xc3f6('0x6b'):_0x4084e3['childModel']='Trigger';break;case _0xc3f6('0x6c'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x6d');break;case _0xc3f6('0x6e'):_0x4084e3['childModel']=_0xc3f6('0x6f');break;case _0xc3f6('0x70'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x71');break;case _0xc3f6('0x72'):_0x4084e3[_0xc3f6('0x14')]=_0xc3f6('0x10');_0x4084e3[_0xc3f6('0x18')]=[{'name':_0xc3f6('0x73'),'field':'id','foreignKey':_0xc3f6('0x74')}];break;case _0xc3f6('0x75'):_0x4084e3['childModel']=_0xc3f6('0x76');break;}return _0x4084e3;}function _0x609e7c(_0x2d07b5,_0x2d9fb5){var _0x52b14f=_0x2d07b5[_0xc3f6('0x77')](0x0)['toUpperCase']()+_0x2d07b5[_0xc3f6('0x78')](0x1);var _0x240468={'type':_0x5545a6['Sequelize'][_0xc3f6('0x79')][_0xc3f6('0x7a')],'raw':!![]};return new Promise(function(_0x38c7af,_0x4cc98c){var _0x10dba4=squel[_0xc3f6('0x7b')]()[_0xc3f6('0x7')]('ui.'+_0x52b14f+_0xc3f6('0x7c'),'id')[_0xc3f6('0x7')]('ui.createdAt')[_0xc3f6('0x7d')](_0xc3f6('0x7e')+_0x2d07b5+_0xc3f6('0x7f'),'ui')[_0xc3f6('0x80')](_0xc3f6('0x81'),_0x2d9fb5['id']);return _0x5545a6['sequelize'][_0xc3f6('0x82')](_0x10dba4[_0xc3f6('0x83')](),_0x240468)['then'](function(_0x185902){_0x2d9fb5[_0x52b14f+_0xc3f6('0x84')]=_0x185902;_0x38c7af(_0x185902);})['catch'](function(_0x341ad0){_0x4cc98c(_0x341ad0);});});}return _0x292d91[_0xc3f6('0x85')](_0xc3f6('0x86'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x49d2e0){var _0x4e8ac4={'raw':_0x49d2e0[_0xc3f6('0x82')]['raw'],'where':{}};var _0x566d53={};var _0xebea22={'count':0x0,'rows':[]};var _0x22b319=_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x87')];var _0x30cc33=_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x88')]||![];var _0x31b9df=_0x4cad00(_0x22b319,_0x30cc33);if(!_0x31b9df[_0xc3f6('0x14')])throw new Error(_0xc3f6('0x89')+_0x22b319+'\x27');var _0x3dd07b=[{'name':_0x22b319}];if(!_[_0xc3f6('0x8a')](_0x31b9df[_0xc3f6('0x18')]))_0x3dd07b=_0x31b9df['parentSections'];var _0x343069=[];for(var _0x2f6238=0x0;_0x2f6238<_0x3dd07b[_0xc3f6('0x8b')];_0x2f6238++){_0x343069[_0xc3f6('0x8c')](_0x5545a6[_0xc3f6('0x8d')][_0xc3f6('0x8e')]({'where':{'userProfileId':_0x49d2e0['params']['id'],'name':_0x3dd07b[_0x2f6238][_0xc3f6('0x1a')]},'raw':!![]}));}return Promise['all'](_0x343069)[_0xc3f6('0xa')](function(_0x35e59b){var _0x59800d=_[_0xc3f6('0x6')](_0x35e59b,function(_0x138df5){return _0x138df5?_0x138df5:undefined;});var _0x3151f6=_[_0xc3f6('0x6')](_0x3dd07b,[_0xc3f6('0x8f'),!![]]);var _0x5155b8=_[_0xc3f6('0x8a')](_0x59800d)&&_[_0xc3f6('0x8a')](_0x3151f6)?null:_[_0xc3f6('0x90')](_0x3151f6,_0x59800d);if(!_0x5155b8)return null;var _0x1d650f=[];for(var _0x234cdb=0x0;_0x234cdb<_0x5155b8[_0xc3f6('0x8b')];_0x234cdb++){var _0x3ac2e0=_[_0xc3f6('0x8e')](_0x3dd07b,function(_0x1b480c){return _0x5155b8[_0x234cdb]?_0x1b480c[_0xc3f6('0x1a')]===_0x5155b8[_0x234cdb]['name']:null;});if(_0x3ac2e0){if(_0x5155b8[_0x234cdb][_0xc3f6('0x8f')]){_0x1d650f[_0xc3f6('0x8c')](_0x2dbb70(_0x31b9df[_0xc3f6('0x14')],_0x5155b8[_0x234cdb]));}else{if(!_0x5155b8[_0x234cdb][_0xc3f6('0x91')]){_0x1d650f[_0xc3f6('0x8c')](_0x424348(_0x3ac2e0,_0x5155b8[_0x234cdb],_0x31b9df[_0xc3f6('0x14')]));}else{if(_0x3ac2e0['model']){_0x1d650f[_0xc3f6('0x8c')](_0x5f54af(_0x3ac2e0,_0x5155b8[_0x234cdb]));}}}}}return Promise['all'](_0x1d650f);})[_0xc3f6('0xa')](function(_0x3a10f1){var _0x3b4f3e=_0x3a10f1;var _0x33be51=null;if(_0x3b4f3e){_0x33be51=_0x3b4f3e[_0xc3f6('0x8b')]===0x1?_0x3b4f3e[0x0]:null;}if(!_0x33be51&&!_0x3b4f3e)return _0xebea22;var _0xba24a=_0x5545a6[_0x31b9df['childModel']][_0xc3f6('0x92')];_0x566d53[_0xc3f6('0x93')]=_[_0xc3f6('0x94')](_0xba24a);_0x566d53[_0xc3f6('0x82')]=_[_0xc3f6('0x94')](_0x49d2e0[_0xc3f6('0x82')]);_0x566d53[_0xc3f6('0x95')]=_[_0xc3f6('0x96')](_0x566d53[_0xc3f6('0x93')],_0x566d53[_0xc3f6('0x82')]);_0x4e8ac4[_0xc3f6('0x97')]=_[_0xc3f6('0x96')](_0x566d53[_0xc3f6('0x93')],qs['fields'](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x98')]));_0x4e8ac4[_0xc3f6('0x97')]=_0x4e8ac4[_0xc3f6('0x97')]['length']?_0x4e8ac4[_0xc3f6('0x97')]:_0x566d53[_0xc3f6('0x93')];if(!_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x99')](_0xc3f6('0x9a'))){_0x4e8ac4['limit']=qs[_0xc3f6('0x9b')](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x9b')]);_0x4e8ac4['offset']=qs[_0xc3f6('0x9c')](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x9c')]);}_0x4e8ac4[_0xc3f6('0x9d')]=qs['sort'](_0x49d2e0[_0xc3f6('0x82')]['sort']);_0x4e8ac4['where']=qs[_0xc3f6('0x95')](_[_0xc3f6('0x9e')](_0x49d2e0[_0xc3f6('0x82')],_0x566d53['filters']));if(_0x49d2e0[_0xc3f6('0x82')]['filter']){_0x4e8ac4[_0xc3f6('0x80')]=_['merge'](_0x4e8ac4[_0xc3f6('0x80')],{'$or':_[_0xc3f6('0xc')](_0xba24a,function(_0x428831){if(_0x428831[_0xc3f6('0x12')][_0xc3f6('0x9f')]!==_0xc3f6('0xa0')){var _0x23ef2b={};_0x23ef2b[_0x428831[_0xc3f6('0x7')]]={'$like':'%'+_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0x6')]+'%'};return _0x23ef2b;}})});}var _0x30b28e=[];var _0x41914e=null;var _0x47c336={};if(_0x33be51){_0x41914e=_['find'](_0x3dd07b,['name',_0x33be51[_0xc3f6('0x1a')]]);if(_0x41914e[_0xc3f6('0x7')]){_0x47c336={};if(_0x31b9df[_0xc3f6('0x14')]===_0xc3f6('0x10')){_0x47c336[_0x41914e[_0xc3f6('0xa1')]]=_[_0xc3f6('0xc')](_0x33be51[_0xc3f6('0xf')],'id');}else{_0x47c336[_0x41914e[_0xc3f6('0xa1')]]=_0x33be51[_0xc3f6('0xf')];}_0x30b28e[_0xc3f6('0x8c')](_0x47c336);}else{_0x4e8ac4[_0xc3f6('0x80')]['id']=_0x33be51[_0xc3f6('0xf')];}}else{for(var _0x158deb=0x0;_0x158deb<_0x3b4f3e[_0xc3f6('0x8b')];_0x158deb++){_0x41914e=_['find'](_0x3dd07b,[_0xc3f6('0x1a'),_0x3b4f3e[_0x158deb][_0xc3f6('0x1a')]]);if(_0x41914e[_0xc3f6('0x7')]){_0x47c336={};_0x47c336[_0x41914e[_0xc3f6('0xa1')]]=_0x3b4f3e[_0x158deb][_0xc3f6('0xf')];_0x30b28e[_0xc3f6('0x8c')](_0x47c336);}else{if(!_0x4e8ac4[_0xc3f6('0x80')]['id'])_0x4e8ac4[_0xc3f6('0x80')]['id']=[];_0x3b4f3e[_0x158deb][_0xc3f6('0xf')][_0xc3f6('0xa2')](function(_0x26c00b){_0x4e8ac4['where']['id'][_0xc3f6('0x8c')](_0x26c00b);});}}}if(!_[_0xc3f6('0x8a')](_0x30b28e)){_0x4e8ac4[_0xc3f6('0x80')]=_['merge'](_0x4e8ac4['where'],{'$and':{'$or':_0x30b28e}});}_0x4e8ac4=_['merge']({},_0x4e8ac4,_0x49d2e0[_0xc3f6('0xa3')]);if(_0x33be51&&!_0x33be51[_0xc3f6('0x91')]&&_0x31b9df[_0xc3f6('0x14')]===_0xc3f6('0x10')){if(_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xa4')]){_0x4e8ac4['include']=[{'all':!![]}];}return _0x5545a6[_0x31b9df['childModel']]['findAll'](_0x4e8ac4)['then'](function(_0x2b0a97){var _0x511410=[];_0x2b0a97[_0xc3f6('0xa2')](function(_0x481db7){var _0x1b5690;switch(_0x481db7[_0xc3f6('0xa5')]){case _0xc3f6('0xa6'):_0x1b5690=_['find'](_0x33be51[_0xc3f6('0xf')],function(_0x36e3a5){return _0x36e3a5['id']===_0x481db7[_0xc3f6('0x74')]&&_0x36e3a5[_0xc3f6('0x12')]===_0xc3f6('0xa7');});break;case'custom':_0x1b5690=_[_0xc3f6('0x8e')](_0x33be51['associatedResources'],function(_0x198b95){return _0x198b95['id']===_0x481db7[_0xc3f6('0x74')]&&_0x198b95['type']===_0xc3f6('0xa8');});break;}if(_0x1b5690)_0x511410[_0xc3f6('0x8c')](_0x481db7);});_0xebea22[_0xc3f6('0xa9')]=_0x511410[_0xc3f6('0x8b')];_0xebea22[_0xc3f6('0xaa')]=_0x511410;return _0xebea22;});}else{if(!_[_0xc3f6('0x8a')](_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xab')])){_0x4e8ac4['where']['id']=_0x4e8ac4['where']['id']?_['intersection'](_0x4e8ac4[_0xc3f6('0x80')]['id'],_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xab')]):_0x49d2e0[_0xc3f6('0x82')]['ids'];if(_0x49d2e0[_0xc3f6('0x82')]['customSorting']){_0x4e8ac4[_0xc3f6('0x9d')]=_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xac')];}}if(_0x49d2e0[_0xc3f6('0x82')]['extraQueryConditions']){_0x4e8ac4['where']=_[_0xc3f6('0xad')](_0x4e8ac4[_0xc3f6('0x80')],{'$and':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xae')]});}return _0x5545a6[_0x31b9df['childModel']][_0xc3f6('0xa9')]({'where':_0x4e8ac4[_0xc3f6('0x80')]})[_0xc3f6('0xa')](function(_0x4d4769){_0xebea22[_0xc3f6('0xa9')]=_0x4d4769;if(_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xa4')]){if(_0x31b9df[_0xc3f6('0x14')]===_0xc3f6('0xaf')){_0x4e8ac4[_0xc3f6('0xb0')]=[{'model':_0x5545a6[_0xc3f6('0x68')],'as':_0xc3f6('0xb1'),'attributes':['id',_0xc3f6('0x1a'),_0xc3f6('0xb2')],'required':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xb3')]?!![]:![]},{'model':_0x5545a6[_0xc3f6('0x68')],'as':_0xc3f6('0xb4'),'attributes':['id',_0xc3f6('0x1a'),_0xc3f6('0xb2')],'through':_0x49d2e0['query']['tag']?{'attributes':[],'where':{'TagId':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xb3')]||undefined}}:{},'required':_0x49d2e0[_0xc3f6('0x82')][_0xc3f6('0xb3')]?!![]:![]}];}else{_0x4e8ac4[_0xc3f6('0xb0')]=[{'all':!![]}];}}return _0x5545a6[_0x31b9df[_0xc3f6('0x14')]][_0xc3f6('0x9')](_0x4e8ac4);})[_0xc3f6('0xa')](function(_0x1ad6f3){_0xebea22[_0xc3f6('0xaa')]=_0x1ad6f3;if(_0x22b319===_0xc3f6('0x32')&&_0x49d2e0[_0xc3f6('0x82')]['openTabs']==='true'){var _0x534d71=[];for(var _0x5041a1=0x0;_0x5041a1<_0xebea22[_0xc3f6('0xaa')][_0xc3f6('0x8b')];_0x5041a1++){_0x534d71[_0xc3f6('0x8c')](_0x609e7c('chat',_0xebea22[_0xc3f6('0xaa')][_0x5041a1]['dataValues']));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb5'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb7'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb8'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1]['dataValues']));_0x534d71[_0xc3f6('0x8c')](_0x609e7c(_0xc3f6('0xb9'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));_0x534d71['push'](_0x609e7c(_0xc3f6('0xba'),_0xebea22[_0xc3f6('0xaa')][_0x5041a1][_0xc3f6('0xb6')]));}return Promise[_0xc3f6('0xbb')](_0x534d71)[_0xc3f6('0xa')](function(){return _0xebea22;});}return _0xebea22;});}});}}});};
\ No newline at end of file
+var _0xfb64=['dataValues','sms','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','name','UserProfileResource','AnalyticExtractedReport','type','resourceId','squareprojects','childModel','SquareProject','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','whatsappaccounts','WhatsappAccount','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','Reports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','InteractionId','from','ui.UserId\x20=\x20?','sequelize','toString','define','UserProfile','user_profiles','query','raw','mergeResources','isEmpty','length','push','UserProfileSection','find','ignore','union','model','all','intersection','attributes','fields','nolimit','limit','offset','filters','where','merge','key','foreignKey','forEach','options','include','reportType','default','DefaultReports','custom','reportId','count','rows','ids','customSorting','order','extraQueryConditions','includeAll','Tags','color','tag','ThroughTags','openTabs','true','chat'];(function(_0x5d52e2,_0xf8b97e){var _0x3d2554=function(_0x53ddb0){while(--_0x53ddb0){_0x5d52e2['push'](_0x5d52e2['shift']());}};_0x3d2554(++_0xf8b97e);}(_0xfb64,0xc3));var _0x4fb6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb64[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4fb6('0x0'));var attributes=require(_0x4fb6('0x1'));var qs=require(_0x4fb6('0x2'));var squel=require(_0x4fb6('0x3'));module[_0x4fb6('0x4')]=function(_0x280190){var _0xc68515=_0x280190[_0x4fb6('0x5')];function _0x52ca1a(_0x1d5851,_0x10703){return new Promise(function(_0x3cb9b5,_0x2e1dfe){if(!_0x10703)return _0x3cb9b5(null);var _0x1af4d2=_0x10703[_0x4fb6('0x6')]?{[_0x10703[_0x4fb6('0x6')][_0x4fb6('0x7')]]:_0x10703[_0x4fb6('0x6')][_0x4fb6('0x8')]}:undefined;return _0xc68515[_0x1d5851][_0x4fb6('0x9')]({'where':_0x1af4d2,'raw':!![]})[_0x4fb6('0xa')](function(_0x1f0ba0){_0x10703[_0x4fb6('0xb')]=_[_0x4fb6('0xc')](_0x1f0ba0,'id');_0x3cb9b5(_0x10703);})[_0x4fb6('0xd')](function(_0x53cd6a){_0x2e1dfe(_0x53cd6a);});});}function _0x180132(_0x4d02b4,_0x406dd7){return new Promise(function(_0x1341d7,_0xfae96f){var _0x1a31dc=_0x4d02b4['filter']?{[_0x4d02b4[_0x4fb6('0x6')][_0x4fb6('0x7')]]:_0x4d02b4[_0x4fb6('0x6')][_0x4fb6('0x8')]}:undefined;return _0xc68515[_0x4d02b4['model']][_0x4fb6('0x9')]({'where':_0x1a31dc,'raw':!![]})[_0x4fb6('0xa')](function(_0x170357){_0x406dd7[_0x4fb6('0xb')]=_[_0x4fb6('0xc')](_0x170357,function(_0x25fa24){return _0x25fa24[_0x4fb6('0xe')];});_0x1341d7(_0x406dd7);})[_0x4fb6('0xd')](function(_0x38d040){_0xfae96f(_0x38d040);});});}function _0x511c9c(_0xd2f726,_0x44cdae,_0x3fcee7){if(!_0x44cdae)return Promise['resolve'](null);return new Promise(function(_0x12d89f,_0x26bfff){return _0xc68515[_0x4fb6('0xf')][_0x4fb6('0x9')]({'where':{'sectionId':_0x44cdae['id']},'raw':!![]})[_0x4fb6('0xa')](function(_0x460912){if(_0xd2f726[_0x4fb6('0x7')]&&_0xd2f726[_0x4fb6('0x7')]!=='id'){_0x44cdae[_0x4fb6('0xb')]=_[_0x4fb6('0xc')](_0x460912,function(_0x2100e1){return _0x2100e1[_0xd2f726[_0x4fb6('0x7')]];});}else{if(_0x3fcee7===_0x4fb6('0x10')){_0x44cdae['associatedResources']=_[_0x4fb6('0xc')](_0x460912,function(_0x358bd9){return{'id':_0x358bd9['resourceId'],'type':_0x358bd9[_0x4fb6('0x11')]};});}else{_0x44cdae['associatedResources']=_[_0x4fb6('0xc')](_0x460912,function(_0x41cb59){return _0x41cb59[_0x4fb6('0x12')];});}}_0x12d89f(_0x44cdae);})['catch'](function(_0x28d8ed){_0x26bfff(_0x28d8ed);});});}function _0x27846e(_0x18cab5,_0x31081e){var _0x719487={'parentSections':[]};switch(_0x18cab5['toLowerCase']()){case _0x4fb6('0x13'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x15');break;case'odbc':_0x719487['childModel']=_0x4fb6('0x16');break;case _0x4fb6('0x17'):_0x719487['childModel']=_0x4fb6('0x18');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x1a'),'field':_0x4fb6('0xe'),'foreignKey':'projectName'}];break;case _0x4fb6('0x1b'):_0x719487[_0x4fb6('0x14')]='JscriptyProject';break;case _0x4fb6('0x1c'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x1d');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x1e'),'field':'id','foreignKey':_0x4fb6('0x1f')}];break;case _0x4fb6('0x20'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x21');break;case _0x4fb6('0x22'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x23');break;case _0x4fb6('0x24'):_0x719487[_0x4fb6('0x14')]='CmCustomField';break;case'chatqueues':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x25');break;case _0x4fb6('0x26'):_0x719487[_0x4fb6('0x14')]='ChatWebsite';break;case _0x4fb6('0x27'):_0x719487['childModel']=_0x4fb6('0x28');break;case _0x4fb6('0x29'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x2a');break;case _0x4fb6('0x2b'):case _0x4fb6('0x2c'):case'outboundroutes':_0x719487[_0x4fb6('0x14')]='VoiceExtension';break;case'contexts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x2d');break;case _0x4fb6('0x2e'):_0x719487['childModel']=_0x4fb6('0x2f');break;case _0x4fb6('0x30'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x31');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x32'),'field':_0x4fb6('0xe'),'foreignKey':_0x4fb6('0x33'),'model':'User','filter':{'field':_0x4fb6('0x34'),'value':[_0x4fb6('0x35')]}},{'name':_0x4fb6('0x36'),'field':_0x4fb6('0xe'),'foreignKey':_0x4fb6('0x33'),'model':_0x4fb6('0x37'),'filter':{'field':_0x4fb6('0x34'),'value':[_0x4fb6('0x38')]}},{'name':_0x4fb6('0x39'),'field':'name','foreignKey':_0x4fb6('0x3a'),'model':_0x4fb6('0x3b'),'filter':{'field':_0x4fb6('0x11'),'value':[_0x4fb6('0x3c')]}},{'name':_0x4fb6('0x3d'),'field':'name','foreignKey':'queue','model':_0x4fb6('0x3b'),'filter':{'field':'type','value':['outbound']}}];break;case _0x4fb6('0x3e'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x3f');break;case _0x4fb6('0x40'):_0x719487[_0x4fb6('0x14')]='VoiceChanSpy';break;case _0x4fb6('0x41'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x42');break;case _0x4fb6('0x43'):_0x719487[_0x4fb6('0x14')]='Campaign';break;case'mailqueues':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x44');break;case'mailaccounts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x45');break;case _0x4fb6('0x46'):_0x719487[_0x4fb6('0x14')]='MailSubstatus';break;case _0x4fb6('0x47'):_0x719487['childModel']=_0x4fb6('0x48');break;case _0x4fb6('0x49'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x4a');break;case _0x4fb6('0x4b'):_0x719487['childModel']='SmsQueue';break;case _0x4fb6('0x4c'):_0x719487[_0x4fb6('0x14')]='SmsAccount';break;case _0x4fb6('0x4d'):_0x719487[_0x4fb6('0x14')]='WhatsappQueue';break;case _0x4fb6('0x4e'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x4f');break;case'teams':_0x719487['childModel']=_0x4fb6('0x50');break;case _0x4fb6('0x51'):case _0x4fb6('0x52'):_0x719487[_0x4fb6('0x14')]='VoiceQueue';if(_0x31081e){_0x719487[_0x4fb6('0x19')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x4fb6('0x53'):case'agents':case _0x4fb6('0x54'):_0x719487['childModel']=_0x4fb6('0x37');if(_0x31081e){_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x55'),'filter':{'field':_0x4fb6('0x34'),'value':[_0x4fb6('0x56'),_0x4fb6('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':_0x4fb6('0x36')}];}break;case _0x4fb6('0x58'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x59');break;case _0x4fb6('0x5a'):_0x719487['childModel']=_0x4fb6('0x5b');break;case'freshdeskaccounts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x5c');break;case'sugarcrmaccounts':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x5d');break;case _0x4fb6('0x5e'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x5f');break;case _0x4fb6('0x60'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x61');break;case _0x4fb6('0x62'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x37');break;case _0x4fb6('0x63'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x64');break;case _0x4fb6('0x65'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x66');break;case _0x4fb6('0x67'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x68');break;case _0x4fb6('0x69'):_0x719487['childModel']=_0x4fb6('0x6a');break;case'pauses':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x6b');break;case _0x4fb6('0x6c'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x6d');break;case _0x4fb6('0x6e'):_0x719487['childModel']=_0x4fb6('0x6f');break;case _0x4fb6('0x70'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x71');break;case _0x4fb6('0x72'):_0x719487[_0x4fb6('0x14')]='Template';break;case _0x4fb6('0x73'):_0x719487['childModel']=_0x4fb6('0x74');break;case _0x4fb6('0x75'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x76');break;case _0x4fb6('0x77'):_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x78');break;case'plugins':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x79');break;case'extractedreports':_0x719487[_0x4fb6('0x14')]=_0x4fb6('0x10');_0x719487[_0x4fb6('0x19')]=[{'name':_0x4fb6('0x7a'),'field':'id','foreignKey':'reportId'}];break;case _0x4fb6('0x7b'):_0x719487['childModel']=_0x4fb6('0x7c');break;}return _0x719487;}function _0x3a5437(_0x27b8f5,_0x423afd){var _0x3a4b08=_0x27b8f5[_0x4fb6('0x7d')](0x0)[_0x4fb6('0x7e')]()+_0x27b8f5[_0x4fb6('0x7f')](0x1);var _0x5ce53c={'type':_0xc68515[_0x4fb6('0x80')][_0x4fb6('0x81')][_0x4fb6('0x82')],'raw':!![]};return new Promise(function(_0x2db5e3,_0x32bb0c){var _0xd33c81=squel[_0x4fb6('0x83')]()[_0x4fb6('0x7')]('ui.'+_0x3a4b08+_0x4fb6('0x84'),'id')[_0x4fb6('0x7')]('ui.createdAt')[_0x4fb6('0x85')]('user_has_'+_0x27b8f5+'_interactions','ui')['where'](_0x4fb6('0x86'),_0x423afd['id']);return _0xc68515[_0x4fb6('0x87')]['query'](_0xd33c81[_0x4fb6('0x88')](),_0x5ce53c)['then'](function(_0x3a3610){_0x423afd[_0x3a4b08+'OpenTabs']=_0x3a3610;_0x2db5e3(_0x3a3610);})[_0x4fb6('0xd')](function(_0x5ab619){_0x32bb0c(_0x5ab619);});});}return _0x280190[_0x4fb6('0x89')](_0x4fb6('0x8a'),attributes,{'tableName':_0x4fb6('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x87c131){var _0x5572c1={'raw':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0x8d')],'where':{}};var _0x59d78a={};var _0x5aea39={'count':0x0,'rows':[]};var _0x5a305b=_0x87c131['query']['section'];var _0x4f138c=_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0x8e')]||![];var _0x5aceac=_0x27846e(_0x5a305b,_0x4f138c);if(!_0x5aceac[_0x4fb6('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x5a305b+'\x27');var _0x227fb6=[{'name':_0x5a305b}];if(!_[_0x4fb6('0x8f')](_0x5aceac['parentSections']))_0x227fb6=_0x5aceac['parentSections'];var _0x35b14f=[];for(var _0x412976=0x0;_0x412976<_0x227fb6[_0x4fb6('0x90')];_0x412976++){_0x35b14f[_0x4fb6('0x91')](_0xc68515[_0x4fb6('0x92')][_0x4fb6('0x93')]({'where':{'userProfileId':_0x87c131['params']['id'],'name':_0x227fb6[_0x412976][_0x4fb6('0xe')]},'raw':!![]}));}return Promise['all'](_0x35b14f)[_0x4fb6('0xa')](function(_0x5ae23d){var _0x40fee9=_[_0x4fb6('0x6')](_0x5ae23d,function(_0x4fa542){return _0x4fa542?_0x4fa542:undefined;});var _0x383482=_[_0x4fb6('0x6')](_0x227fb6,[_0x4fb6('0x94'),!![]]);var _0x15da2c=_['isEmpty'](_0x40fee9)&&_[_0x4fb6('0x8f')](_0x383482)?null:_[_0x4fb6('0x95')](_0x383482,_0x40fee9);if(!_0x15da2c)return null;var _0x5d6bf4=[];for(var _0x20f058=0x0;_0x20f058<_0x15da2c['length'];_0x20f058++){var _0x33dedd=_['find'](_0x227fb6,function(_0x46003e){return _0x15da2c[_0x20f058]?_0x46003e['name']===_0x15da2c[_0x20f058][_0x4fb6('0xe')]:null;});if(_0x33dedd){if(_0x15da2c[_0x20f058][_0x4fb6('0x94')]){_0x5d6bf4[_0x4fb6('0x91')](_0x52ca1a(_0x5aceac[_0x4fb6('0x14')],_0x15da2c[_0x20f058]));}else{if(!_0x15da2c[_0x20f058]['autoAssociation']){_0x5d6bf4[_0x4fb6('0x91')](_0x511c9c(_0x33dedd,_0x15da2c[_0x20f058],_0x5aceac[_0x4fb6('0x14')]));}else{if(_0x33dedd[_0x4fb6('0x96')]){_0x5d6bf4['push'](_0x180132(_0x33dedd,_0x15da2c[_0x20f058]));}}}}}return Promise[_0x4fb6('0x97')](_0x5d6bf4);})['then'](function(_0x518099){var _0x4b608d=_0x518099;var _0x39979f=null;if(_0x4b608d){_0x39979f=_0x4b608d[_0x4fb6('0x90')]===0x1?_0x4b608d[0x0]:null;}if(!_0x39979f&&!_0x4b608d)return _0x5aea39;var _0x4b794a=_0xc68515[_0x5aceac[_0x4fb6('0x14')]]['rawAttributes'];_0x59d78a[_0x4fb6('0x96')]=_['keys'](_0x4b794a);_0x59d78a[_0x4fb6('0x8c')]=_['keys'](_0x87c131[_0x4fb6('0x8c')]);_0x59d78a['filters']=_[_0x4fb6('0x98')](_0x59d78a[_0x4fb6('0x96')],_0x59d78a[_0x4fb6('0x8c')]);_0x5572c1[_0x4fb6('0x99')]=_[_0x4fb6('0x98')](_0x59d78a[_0x4fb6('0x96')],qs[_0x4fb6('0x9a')](_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0x9a')]));_0x5572c1[_0x4fb6('0x99')]=_0x5572c1[_0x4fb6('0x99')][_0x4fb6('0x90')]?_0x5572c1[_0x4fb6('0x99')]:_0x59d78a[_0x4fb6('0x96')];if(!_0x87c131[_0x4fb6('0x8c')]['hasOwnProperty'](_0x4fb6('0x9b'))){_0x5572c1[_0x4fb6('0x9c')]=qs[_0x4fb6('0x9c')](_0x87c131['query']['limit']);_0x5572c1[_0x4fb6('0x9d')]=qs[_0x4fb6('0x9d')](_0x87c131[_0x4fb6('0x8c')]['offset']);}_0x5572c1['order']=qs['sort'](_0x87c131[_0x4fb6('0x8c')]['sort']);_0x5572c1['where']=qs[_0x4fb6('0x9e')](_['pick'](_0x87c131[_0x4fb6('0x8c')],_0x59d78a[_0x4fb6('0x9e')]));if(_0x87c131['query'][_0x4fb6('0x6')]){_0x5572c1[_0x4fb6('0x9f')]=_[_0x4fb6('0xa0')](_0x5572c1[_0x4fb6('0x9f')],{'$or':_[_0x4fb6('0xc')](_0x4b794a,function(_0x410092){if(_0x410092[_0x4fb6('0x11')][_0x4fb6('0xa1')]!=='VIRTUAL'){var _0x28edd8={};_0x28edd8[_0x410092[_0x4fb6('0x7')]]={'$like':'%'+_0x87c131['query'][_0x4fb6('0x6')]+'%'};return _0x28edd8;}})});}var _0x261eec=[];var _0x181aae=null;var _0x327db8={};if(_0x39979f){_0x181aae=_['find'](_0x227fb6,[_0x4fb6('0xe'),_0x39979f['name']]);if(_0x181aae[_0x4fb6('0x7')]){_0x327db8={};if(_0x5aceac[_0x4fb6('0x14')]===_0x4fb6('0x10')){_0x327db8[_0x181aae[_0x4fb6('0xa2')]]=_['map'](_0x39979f[_0x4fb6('0xb')],'id');}else{_0x327db8[_0x181aae[_0x4fb6('0xa2')]]=_0x39979f['associatedResources'];}_0x261eec[_0x4fb6('0x91')](_0x327db8);}else{_0x5572c1[_0x4fb6('0x9f')]['id']=_0x39979f['associatedResources'];}}else{for(var _0x2d9902=0x0;_0x2d9902<_0x4b608d['length'];_0x2d9902++){_0x181aae=_[_0x4fb6('0x93')](_0x227fb6,[_0x4fb6('0xe'),_0x4b608d[_0x2d9902]['name']]);if(_0x181aae['field']){_0x327db8={};_0x327db8[_0x181aae['foreignKey']]=_0x4b608d[_0x2d9902][_0x4fb6('0xb')];_0x261eec[_0x4fb6('0x91')](_0x327db8);}else{if(!_0x5572c1[_0x4fb6('0x9f')]['id'])_0x5572c1[_0x4fb6('0x9f')]['id']=[];_0x4b608d[_0x2d9902]['associatedResources'][_0x4fb6('0xa3')](function(_0xa730b1){_0x5572c1[_0x4fb6('0x9f')]['id'][_0x4fb6('0x91')](_0xa730b1);});}}}if(!_[_0x4fb6('0x8f')](_0x261eec)){_0x5572c1['where']=_[_0x4fb6('0xa0')](_0x5572c1[_0x4fb6('0x9f')],{'$and':{'$or':_0x261eec}});}_0x5572c1=_[_0x4fb6('0xa0')]({},_0x5572c1,_0x87c131[_0x4fb6('0xa4')]);if(_0x39979f&&!_0x39979f['autoAssociation']&&_0x5aceac[_0x4fb6('0x14')]===_0x4fb6('0x10')){if(_0x87c131[_0x4fb6('0x8c')]['includeAll']){_0x5572c1[_0x4fb6('0xa5')]=[{'all':!![]}];}return _0xc68515[_0x5aceac[_0x4fb6('0x14')]][_0x4fb6('0x9')](_0x5572c1)[_0x4fb6('0xa')](function(_0x294e61){var _0xf30829=[];_0x294e61[_0x4fb6('0xa3')](function(_0x43ba66){var _0x28ac7c;switch(_0x43ba66[_0x4fb6('0xa6')]){case _0x4fb6('0xa7'):_0x28ac7c=_[_0x4fb6('0x93')](_0x39979f[_0x4fb6('0xb')],function(_0x346c78){return _0x346c78['id']===_0x43ba66['reportId']&&_0x346c78[_0x4fb6('0x11')]===_0x4fb6('0xa8');});break;case _0x4fb6('0xa9'):_0x28ac7c=_[_0x4fb6('0x93')](_0x39979f['associatedResources'],function(_0x5b45f3){return _0x5b45f3['id']===_0x43ba66[_0x4fb6('0xaa')]&&_0x5b45f3[_0x4fb6('0x11')]==='CustomReports';});break;}if(_0x28ac7c)_0xf30829[_0x4fb6('0x91')](_0x43ba66);});_0x5aea39[_0x4fb6('0xab')]=_0xf30829[_0x4fb6('0x90')];_0x5aea39[_0x4fb6('0xac')]=_0xf30829;return _0x5aea39;});}else{if(!_['isEmpty'](_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xad')])){_0x5572c1[_0x4fb6('0x9f')]['id']=_0x5572c1[_0x4fb6('0x9f')]['id']?_['intersection'](_0x5572c1[_0x4fb6('0x9f')]['id'],_0x87c131['query']['ids']):_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xad')];if(_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xae')]){_0x5572c1[_0x4fb6('0xaf')]=_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xae')];}}if(_0x87c131['query']['extraQueryConditions']){_0x5572c1['where']=_[_0x4fb6('0xa0')](_0x5572c1[_0x4fb6('0x9f')],{'$and':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb0')]});}return _0xc68515[_0x5aceac[_0x4fb6('0x14')]][_0x4fb6('0xab')]({'where':_0x5572c1['where']})['then'](function(_0x4fcb89){_0x5aea39['count']=_0x4fcb89;if(_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb1')]){if(_0x5aceac[_0x4fb6('0x14')]==='CmContact'){_0x5572c1['include']=[{'model':_0xc68515[_0x4fb6('0x71')],'as':_0x4fb6('0xb2'),'attributes':['id',_0x4fb6('0xe'),_0x4fb6('0xb3')],'required':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]?!![]:![]},{'model':_0xc68515[_0x4fb6('0x71')],'as':_0x4fb6('0xb5'),'attributes':['id',_0x4fb6('0xe'),'color'],'through':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]?{'attributes':[],'where':{'TagId':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]||undefined}}:{},'required':_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb4')]?!![]:![]}];}else{_0x5572c1['include']=[{'all':!![]}];}}return _0xc68515[_0x5aceac['childModel']][_0x4fb6('0x9')](_0x5572c1);})[_0x4fb6('0xa')](function(_0x59e745){_0x5aea39[_0x4fb6('0xac')]=_0x59e745;if(_0x5a305b==='Agents'&&_0x87c131[_0x4fb6('0x8c')][_0x4fb6('0xb6')]===_0x4fb6('0xb7')){var _0x5e5715=[];for(var _0x5c924c=0x0;_0x5c924c<_0x5aea39[_0x4fb6('0xac')][_0x4fb6('0x90')];_0x5c924c++){_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xb8'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xba'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c]['dataValues']));_0x5e5715[_0x4fb6('0x91')](_0x3a5437('fax',_0x5aea39[_0x4fb6('0xac')][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xbb'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xbc'),_0x5aea39['rows'][_0x5c924c][_0x4fb6('0xb9')]));_0x5e5715[_0x4fb6('0x91')](_0x3a5437(_0x4fb6('0xbd'),_0x5aea39[_0x4fb6('0xac')][_0x5c924c]['dataValues']));}return Promise[_0x4fb6('0x97')](_0x5e5715)['then'](function(){return _0x5aea39;});}return _0x5aea39;});}});}}});};
\ No newline at end of file
index 42eda3d..b58aa8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef4d=['then','info','request\x20sent','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request'];(function(_0x5c0349,_0xab2591){var _0x41ebcf=function(_0x2ba8d6){while(--_0x2ba8d6){_0x5c0349['push'](_0x5c0349['shift']());}};_0x41ebcf(++_0xab2591);}(_0xef4d,0x165));var _0xdef4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef4d[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var moment=require(_0xdef4('0x2'));var BPromise=require(_0xdef4('0x3'));var rs=require(_0xdef4('0x4'));var fs=require('fs');var Redis=require(_0xdef4('0x5'));var db=require(_0xdef4('0x6'))['db'];var utils=require(_0xdef4('0x7'));var logger=require(_0xdef4('0x8'))(_0xdef4('0x9'));var config=require(_0xdef4('0xa'));var jayson=require(_0xdef4('0xb'));var client=jayson[_0xdef4('0xc')]['http']({'port':0x232a});config[_0xdef4('0xd')]=_[_0xdef4('0xe')](config[_0xdef4('0xd')],{'host':_0xdef4('0xf'),'port':0x18eb});var socket=require(_0xdef4('0x10'))(new Redis(config[_0xdef4('0xd')]));require(_0xdef4('0x11'))[_0xdef4('0x12')](socket);function respondWithRpcPromise(_0x3bec91,_0x537ca7,_0xde54d0){return new BPromise(function(_0x1a209a,_0x35c826){return client[_0xdef4('0x13')](_0x3bec91,_0xde54d0)[_0xdef4('0x14')](function(_0x26a9ac){logger[_0xdef4('0x15')]('UserProfile,\x20%s,\x20%s',_0x537ca7,_0xdef4('0x16'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x537ca7,_0xdef4('0x16'),JSON['stringify'](_0x26a9ac));if(_0x26a9ac[_0xdef4('0x17')]){if(_0x26a9ac['error'][_0xdef4('0x18')]===0x1f4){logger[_0xdef4('0x17')](_0xdef4('0x19'),_0x537ca7,_0x26a9ac[_0xdef4('0x17')]['message']);return _0x35c826(_0x26a9ac[_0xdef4('0x17')]['message']);}logger[_0xdef4('0x17')](_0xdef4('0x19'),_0x537ca7,_0x26a9ac['error'][_0xdef4('0x1a')]);return _0x1a209a(_0x26a9ac[_0xdef4('0x17')][_0xdef4('0x1a')]);}else{logger[_0xdef4('0x15')]('UserProfile,\x20%s,\x20%s',_0x537ca7,_0xdef4('0x16'));_0x1a209a(_0x26a9ac[_0xdef4('0x1b')][_0xdef4('0x1a')]);}})[_0xdef4('0x1c')](function(_0x246fc5){logger['error'](_0xdef4('0x19'),_0x537ca7,_0x246fc5);_0x35c826(_0x246fc5);});});}
\ No newline at end of file
+var _0xa6ce=['register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa6ce,0x15e));var _0xea6c=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0xa6ce[_0x13ac10];return _0x28eda2;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var moment=require(_0xea6c('0x1'));var BPromise=require(_0xea6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6c('0x3'));var db=require(_0xea6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea6c('0x5'));var config=require(_0xea6c('0x6'));var jayson=require(_0xea6c('0x7'));var client=jayson[_0xea6c('0x8')][_0xea6c('0x9')]({'port':0x232a});config[_0xea6c('0xa')]=_['defaults'](config[_0xea6c('0xa')],{'host':_0xea6c('0xb'),'port':0x18eb});var socket=require(_0xea6c('0xc'))(new Redis(config[_0xea6c('0xa')]));require(_0xea6c('0xd'))[_0xea6c('0xe')](socket);function respondWithRpcPromise(_0x3bf4d2,_0x44a1ba,_0x2c414a){return new BPromise(function(_0x3b70a4,_0x2def55){return client[_0xea6c('0xf')](_0x3bf4d2,_0x2c414a)[_0xea6c('0x10')](function(_0x3c0992){logger['info'](_0xea6c('0x11'),_0x44a1ba,_0xea6c('0x12'));logger[_0xea6c('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x44a1ba,_0xea6c('0x12'),JSON[_0xea6c('0x14')](_0x3c0992));if(_0x3c0992['error']){if(_0x3c0992[_0xea6c('0x15')][_0xea6c('0x16')]===0x1f4){logger[_0xea6c('0x15')](_0xea6c('0x11'),_0x44a1ba,_0x3c0992[_0xea6c('0x15')][_0xea6c('0x17')]);return _0x2def55(_0x3c0992['error'][_0xea6c('0x17')]);}logger['error'](_0xea6c('0x11'),_0x44a1ba,_0x3c0992[_0xea6c('0x15')][_0xea6c('0x17')]);return _0x3b70a4(_0x3c0992[_0xea6c('0x15')][_0xea6c('0x17')]);}else{logger['info'](_0xea6c('0x11'),_0x44a1ba,_0xea6c('0x12'));_0x3b70a4(_0x3c0992[_0xea6c('0x18')][_0xea6c('0x17')]);}})[_0xea6c('0x19')](function(_0x257707){logger[_0xea6c('0x15')](_0xea6c('0x11'),_0x44a1ba,_0x257707);_0x2def55(_0x257707);});});}
\ No newline at end of file
index 2b89393..7f04cad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f13=['update','emit','removeListener','length','userProfile:','./userProfile.events','remove'];(function(_0x58ef68,_0x3e1c69){var _0x3f275c=function(_0x4218c5){while(--_0x4218c5){_0x58ef68['push'](_0x58ef68['shift']());}};_0x3f275c(++_0x3e1c69);}(_0x5f13,0x67));var _0x35f1=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x5f13[_0x29b609];return _0x54c952;};'use strict';var UserProfileEvents=require(_0x35f1('0x0'));var events=['save',_0x35f1('0x1'),_0x35f1('0x2')];function createListener(_0x51b08d,_0x58b8f7){return function(_0x27b743){_0x58b8f7[_0x35f1('0x3')](_0x51b08d,_0x27b743);};}function removeListener(_0x90b38b,_0x379e39){return function(){UserProfileEvents[_0x35f1('0x4')](_0x90b38b,_0x379e39);};}exports['register']=function(_0x5bfb27){for(var _0x327d59=0x0,_0x12dc4f=events[_0x35f1('0x5')];_0x327d59<_0x12dc4f;_0x327d59++){var _0x2a0390=events[_0x327d59];var _0x748208=createListener(_0x35f1('0x6')+_0x2a0390,_0x5bfb27);UserProfileEvents['on'](_0x2a0390,_0x748208);}};
\ No newline at end of file
+var _0x4ae5=['remove','update','emit','removeListener','register','length','userProfile:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ae5,0xdf));var _0x54ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4ae5[_0x3dd15e];return _0x231fd0;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x54ae('0x0'),_0x54ae('0x1'),_0x54ae('0x2')];function createListener(_0x3adfed,_0x479aac){return function(_0x122d41){_0x479aac[_0x54ae('0x3')](_0x3adfed,_0x122d41);};}function removeListener(_0x20efb4,_0x52fb69){return function(){UserProfileEvents[_0x54ae('0x4')](_0x20efb4,_0x52fb69);};}exports[_0x54ae('0x5')]=function(_0x1b0873){for(var _0xe0504d=0x0,_0x53d432=events[_0x54ae('0x6')];_0xe0504d<_0x53d432;_0xe0504d++){var _0x26bcd5=events[_0xe0504d];var _0x2973e7=createListener(_0x54ae('0x7')+_0x26bcd5,_0x1b0873);UserProfileEvents['on'](_0x26bcd5,_0x2973e7);}};
\ No newline at end of file
index 779b153..57ffac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee65=['../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','describe','/:id','post','create','put','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x123cd1,_0x48cb5a){var _0x4c13ee=function(_0x1204cb){while(--_0x1204cb){_0x123cd1['push'](_0x123cd1['shift']());}};_0x4c13ee(++_0x48cb5a);}(_0xee65,0x189));var _0x5ee6=function(_0x8843e2,_0x285e51){_0x8843e2=_0x8843e2-0x0;var _0x282649=_0xee65[_0x8843e2];return _0x282649;};'use strict';var multer=require(_0x5ee6('0x0'));var util=require(_0x5ee6('0x1'));var path=require(_0x5ee6('0x2'));var timeout=require(_0x5ee6('0x3'));var express=require(_0x5ee6('0x4'));var router=express[_0x5ee6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5ee6('0x6'));var interaction=require(_0x5ee6('0x7'));var config=require(_0x5ee6('0x8'));var controller=require(_0x5ee6('0x9'));router['get']('/',auth[_0x5ee6('0xa')](),controller[_0x5ee6('0xb')]);router[_0x5ee6('0xc')]('/describe',auth[_0x5ee6('0xa')](),controller[_0x5ee6('0xd')]);router['get'](_0x5ee6('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5ee6('0xf')]('/',auth[_0x5ee6('0xa')](),controller[_0x5ee6('0x10')]);router[_0x5ee6('0x11')](_0x5ee6('0xe'),auth[_0x5ee6('0xa')](),controller['update']);router['delete'](_0x5ee6('0xe'),auth[_0x5ee6('0xa')](),controller[_0x5ee6('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xa1c4=['express','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa1c4,0x6e));var _0x4a1c=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0xa1c4[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0x4a1c('0x0'));var util=require(_0x4a1c('0x1'));var path=require(_0x4a1c('0x2'));var timeout=require(_0x4a1c('0x3'));var express=require(_0x4a1c('0x4'));var router=express['Router']();var fs_extra=require(_0x4a1c('0x5'));var auth=require(_0x4a1c('0x6'));var interaction=require(_0x4a1c('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4a1c('0x8')]);router[_0x4a1c('0x9')]('/describe',auth[_0x4a1c('0xa')](),controller[_0x4a1c('0xb')]);router[_0x4a1c('0x9')](_0x4a1c('0xc'),auth['isAuthenticated'](),controller[_0x4a1c('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4a1c('0xe')]);router[_0x4a1c('0xf')](_0x4a1c('0xc'),auth[_0x4a1c('0xa')](),controller[_0x4a1c('0x10')]);router[_0x4a1c('0x11')](_0x4a1c('0xc'),auth[_0x4a1c('0xa')](),controller[_0x4a1c('0x12')]);module['exports']=router;
\ No newline at end of file
index 11884a7..ac84fca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf372=['INTEGER','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf372,0x142));var _0x2f37=function(_0x363559,_0x37b6a3){_0x363559=_0x363559-0x0;var _0x2a8fad=_0xf372[_0x363559];return _0x2a8fad;};'use strict';var Sequelize=require('sequelize');module[_0x2f37('0x0')]={'name':{'type':Sequelize[_0x2f37('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2f37('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xa9bd=['exports','INTEGER','sequelize'];(function(_0x2b0bc2,_0x4331f5){var _0x56e5b9=function(_0x4c1b06){while(--_0x4c1b06){_0x2b0bc2['push'](_0x2b0bc2['shift']());}};_0x56e5b9(++_0x4331f5);}(_0xa9bd,0xe0));var _0xda9b=function(_0x592929,_0x389ab9){_0x592929=_0x592929-0x0;var _0x25a98b=_0xa9bd[_0x592929];return _0x25a98b;};'use strict';var Sequelize=require(_0xda9b('0x0'));module[_0xda9b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0xda9b('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 13e6ac2..22dc7a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','update','find','body','describe','eml-format','rimraf','request-promise','bluebird','mustache'];(function(_0x2ef4ba,_0x3871eb){var _0x1f61ee=function(_0x228bed){while(--_0x228bed){_0x2ef4ba['push'](_0x2ef4ba['shift']());}};_0x1f61ee(++_0x3871eb);}(_0xb016,0x159));var _0x6b01=function(_0x495a1b,_0x1e1304){_0x495a1b=_0x495a1b-0x0;var _0x282322=_0xb016[_0x495a1b];return _0x282322;};'use strict';var emlformat=require(_0x6b01('0x0'));var rimraf=require(_0x6b01('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b01('0x2'));var moment=require('moment');var BPromise=require(_0x6b01('0x3'));var Mustache=require(_0x6b01('0x4'));var util=require(_0x6b01('0x5'));var path=require(_0x6b01('0x6'));var sox=require('sox');var csv=require(_0x6b01('0x7'));var ejs=require(_0x6b01('0x8'));var fs=require('fs');var fs_extra=require(_0x6b01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b01('0x11'))(_0x6b01('0x12'));var utils=require(_0x6b01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6b01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51f976,_0x26f2a0){_0x26f2a0=_0x26f2a0||0xcc;return function(_0x4fa826){if(_0x4fa826){return _0x51f976[_0x6b01('0x15')](_0x26f2a0);}return _0x51f976[_0x6b01('0x16')](_0x26f2a0)['end']();};}function respondWithResult(_0x2c305e,_0x4ea5fa){_0x4ea5fa=_0x4ea5fa||0xc8;return function(_0x50d778){if(_0x50d778){return _0x2c305e['status'](_0x4ea5fa)[_0x6b01('0x17')](_0x50d778);}};}function respondWithFilteredResult(_0x4cbd38,_0x5b2f60){return function(_0x3a259f){if(_0x3a259f){var _0x327e86=typeof _0x5b2f60[_0x6b01('0x18')]===_0x6b01('0x19')&&typeof _0x5b2f60[_0x6b01('0x1a')]===_0x6b01('0x19');var _0x122769=_0x3a259f[_0x6b01('0x1b')];var _0x9c6571=_0x327e86?0x0:_0x5b2f60[_0x6b01('0x18')];var _0x18f336=_0x327e86?_0x3a259f['count']:_0x5b2f60[_0x6b01('0x18')]+_0x5b2f60[_0x6b01('0x1a')];var _0x3b0bab;if(_0x18f336>=_0x122769){_0x18f336=_0x122769;_0x3b0bab=0xc8;}else{_0x3b0bab=0xce;}_0x4cbd38[_0x6b01('0x16')](_0x3b0bab);return _0x4cbd38[_0x6b01('0x1c')](_0x6b01('0x1d'),_0x9c6571+'-'+_0x18f336+'/'+_0x122769)[_0x6b01('0x17')](_0x3a259f);}return null;};}function patchUpdates(_0x3c0573){return function(_0x54a942){try{jsonpatch[_0x6b01('0x1e')](_0x54a942,_0x3c0573,!![]);}catch(_0xc1f453){return BPromise[_0x6b01('0x1f')](_0xc1f453);}return _0x54a942[_0x6b01('0x20')]();};}function saveUpdates(_0x1fced4,_0x181b09){return function(_0x2cea6e){if(_0x2cea6e){return _0x2cea6e['update'](_0x1fced4)[_0x6b01('0x21')](function(_0xcf9200){return _0xcf9200;});}return null;};}function removeEntity(_0x42c990,_0x51243c){return function(_0x399808){if(_0x399808){return _0x399808[_0x6b01('0x22')]()[_0x6b01('0x21')](function(){_0x42c990[_0x6b01('0x16')](0xcc)[_0x6b01('0x23')]();});}};}function handleEntityNotFound(_0x2456e9,_0x1b46fb){return function(_0x136452){if(!_0x136452){_0x2456e9[_0x6b01('0x15')](0x194);}return _0x136452;};}function handleError(_0x152dda,_0x3c0607){_0x3c0607=_0x3c0607||0x1f4;return function(_0xa846d8){logger[_0x6b01('0x24')](_0xa846d8['stack']);if(_0xa846d8[_0x6b01('0x25')]){delete _0xa846d8[_0x6b01('0x25')];}_0x152dda[_0x6b01('0x16')](_0x3c0607)[_0x6b01('0x26')](_0xa846d8);};}exports[_0x6b01('0x27')]=function(_0x528cbd,_0x54f030){var _0x3fae61={},_0x3df3d4={},_0xc574c={'count':0x0,'rows':[]};var _0x8883d1=_[_0x6b01('0x28')](db[_0x6b01('0x29')]['rawAttributes'],function(_0x39f193){return{'name':_0x39f193['fieldName'],'type':_0x39f193[_0x6b01('0x2a')]['key']};});_0x3df3d4[_0x6b01('0x2b')]=_[_0x6b01('0x28')](_0x8883d1,_0x6b01('0x25'));_0x3df3d4[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x528cbd['query']);_0x3df3d4[_0x6b01('0x2e')]=_[_0x6b01('0x2f')](_0x3df3d4[_0x6b01('0x2b')],_0x3df3d4['query']);_0x3fae61['attributes']=_[_0x6b01('0x2f')](_0x3df3d4['model'],qs[_0x6b01('0x30')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x30')]));_0x3fae61['attributes']=_0x3fae61[_0x6b01('0x31')][_0x6b01('0x32')]?_0x3fae61[_0x6b01('0x31')]:_0x3df3d4['model'];if(!_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x33')](_0x6b01('0x34'))){_0x3fae61[_0x6b01('0x1a')]=qs[_0x6b01('0x1a')](_0x528cbd['query'][_0x6b01('0x1a')]);_0x3fae61[_0x6b01('0x18')]=qs[_0x6b01('0x18')](_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x18')]);}_0x3fae61[_0x6b01('0x35')]=qs[_0x6b01('0x36')](_0x528cbd[_0x6b01('0x2c')]['sort']);_0x3fae61[_0x6b01('0x37')]=qs['filters'](_[_0x6b01('0x38')](_0x528cbd[_0x6b01('0x2c')],_0x3df3d4[_0x6b01('0x2e')]),_0x8883d1);if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]){_0x3fae61[_0x6b01('0x37')]=_[_0x6b01('0x3a')](_0x3fae61['where'],{'$or':_[_0x6b01('0x28')](_0x8883d1,function(_0x15f274){if(_0x15f274[_0x6b01('0x2a')]!==_0x6b01('0x3b')){var _0x1ca3aa={};_0x1ca3aa[_0x15f274[_0x6b01('0x25')]]={'$like':'%'+_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x39')]+'%'};return _0x1ca3aa;}})});}_0x3fae61=_['merge']({},_0x3fae61,_0x528cbd[_0x6b01('0x3c')]);var _0x55907f={'where':_0x3fae61[_0x6b01('0x37')]};return db[_0x6b01('0x29')]['count'](_0x55907f)[_0x6b01('0x21')](function(_0x2e661b){_0xc574c[_0x6b01('0x1b')]=_0x2e661b;if(_0x528cbd[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0x3fae61[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x29')][_0x6b01('0x3f')](_0x3fae61);})[_0x6b01('0x21')](function(_0x17f335){_0xc574c['rows']=_0x17f335;return _0xc574c;})[_0x6b01('0x21')](respondWithFilteredResult(_0x54f030,_0x3fae61))[_0x6b01('0x40')](handleError(_0x54f030,null));};exports['show']=function(_0x52cec0,_0x32b9ec){var _0xd11195={'raw':![],'where':{'id':_0x52cec0[_0x6b01('0x41')]['id']}},_0x558ec1={};_0x558ec1[_0x6b01('0x2b')]=_['keys'](db[_0x6b01('0x29')]['rawAttributes']);_0x558ec1[_0x6b01('0x2c')]=_[_0x6b01('0x2d')](_0x52cec0[_0x6b01('0x2c')]);_0x558ec1['filters']=_[_0x6b01('0x2f')](_0x558ec1[_0x6b01('0x2b')],_0x558ec1['query']);_0xd11195['attributes']=_['intersection'](_0x558ec1[_0x6b01('0x2b')],qs[_0x6b01('0x30')](_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x30')]));_0xd11195[_0x6b01('0x31')]=_0xd11195[_0x6b01('0x31')]['length']?_0xd11195[_0x6b01('0x31')]:_0x558ec1[_0x6b01('0x2b')];if(_0x52cec0[_0x6b01('0x2c')][_0x6b01('0x3d')]){_0xd11195[_0x6b01('0x3e')]=[{'all':!![]}];}_0xd11195=_[_0x6b01('0x3a')]({},_0xd11195,_0x52cec0['options']);return db[_0x6b01('0x29')]['find'](_0xd11195)['then'](handleEntityNotFound(_0x32b9ec,null))[_0x6b01('0x21')](respondWithResult(_0x32b9ec,null))[_0x6b01('0x40')](handleError(_0x32b9ec,null));};exports['create']=function(_0x408bb0,_0x27442e){return db[_0x6b01('0x29')]['create'](_0x408bb0['body'],{})['then'](respondWithResult(_0x27442e,0xc9))[_0x6b01('0x40')](handleError(_0x27442e,null));};exports[_0x6b01('0x42')]=function(_0x518d94,_0x34cef6){if(_0x518d94['body']['id']){delete _0x518d94['body']['id'];}return db['UserProfileResource'][_0x6b01('0x43')]({'where':{'id':_0x518d94[_0x6b01('0x41')]['id']}})['then'](handleEntityNotFound(_0x34cef6,null))['then'](saveUpdates(_0x518d94[_0x6b01('0x44')],null))['then'](respondWithResult(_0x34cef6,null))[_0x6b01('0x40')](handleError(_0x34cef6,null));};exports[_0x6b01('0x22')]=function(_0x32d446,_0x172a56){return db[_0x6b01('0x29')]['find']({'where':{'id':_0x32d446[_0x6b01('0x41')]['id']}})[_0x6b01('0x21')](handleEntityNotFound(_0x172a56,null))[_0x6b01('0x21')](removeEntity(_0x172a56,null))['catch'](handleError(_0x172a56,null));};exports[_0x6b01('0x45')]=function(_0x13ab4f,_0x5617d7){return db[_0x6b01('0x29')][_0x6b01('0x45')]()[_0x6b01('0x21')](respondWithResult(_0x5617d7,null))[_0x6b01('0x40')](handleError(_0x5617d7,null));};
\ No newline at end of file
+var _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','UserProfileResource','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x5d7f29,_0x56c670){var _0xa872c6=function(_0x3619ad){while(--_0x3619ad){_0x5d7f29['push'](_0x5d7f29['shift']());}};_0xa872c6(++_0x56c670);}(_0x2ef3,0xba));var _0x32ef=function(_0x292ae0,_0x36ef97){_0x292ae0=_0x292ae0-0x0;var _0x2007b7=_0x2ef3[_0x292ae0];return _0x2007b7;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['UserProfileResource'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['UserProfileResource'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['UserProfileResource']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));};
\ No newline at end of file
index d348043..453318e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e7b=['rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4320a7,_0x239a92){var _0x3700bf=function(_0x2c3db0){while(--_0x2c3db0){_0x4320a7['push'](_0x4320a7['shift']());}};_0x3700bf(++_0x239a92);}(_0x7e7b,0x159));var _0xb7e7=function(_0x43547f,_0x3bcdf5){_0x43547f=_0x43547f-0x0;var _0x926d88=_0x7e7b[_0x43547f];return _0x926d88;};'use strict';var _=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var logger=require(_0xb7e7('0x2'))(_0xb7e7('0x3'));var moment=require(_0xb7e7('0x4'));var BPromise=require(_0xb7e7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7e7('0x6'));var rimraf=require(_0xb7e7('0x7'));var config=require(_0xb7e7('0x8'));var attributes=require(_0xb7e7('0x9'));module[_0xb7e7('0xa')]=function(_0x5334ef,_0x2b2ed8){return _0x5334ef['define'](_0xb7e7('0xb'),attributes,{'tableName':_0xb7e7('0xc'),'paranoid':![],'indexes':[{'name':_0xb7e7('0xd'),'fields':[_0xb7e7('0xe'),_0xb7e7('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1ba1=['user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userProfileResource.attributes','define','UserProfileResource'];(function(_0x1561a1,_0x3f0b3c){var _0x4172be=function(_0x9da9e9){while(--_0x9da9e9){_0x1561a1['push'](_0x1561a1['shift']());}};_0x4172be(++_0x3f0b3c);}(_0x1ba1,0x1a8));var _0x11ba=function(_0x26423c,_0x2cfa2a){_0x26423c=_0x26423c-0x0;var _0x12f616=_0x1ba1[_0x26423c];return _0x12f616;};'use strict';var _=require(_0x11ba('0x0'));var util=require(_0x11ba('0x1'));var logger=require(_0x11ba('0x2'))(_0x11ba('0x3'));var moment=require(_0x11ba('0x4'));var BPromise=require('bluebird');var rp=require(_0x11ba('0x5'));var fs=require('fs');var path=require(_0x11ba('0x6'));var rimraf=require('rimraf');var config=require(_0x11ba('0x7'));var attributes=require(_0x11ba('0x8'));module['exports']=function(_0x292f7c,_0x5845d3){return _0x292f7c[_0x11ba('0x9')](_0x11ba('0xa'),attributes,{'tableName':_0x11ba('0xb'),'paranoid':![],'indexes':[{'name':_0x11ba('0xc'),'fields':[_0x11ba('0xd'),_0x11ba('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index b41bfce..638efdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x171262,_0x16bfae){var _0x1649f9=function(_0x1077e9){while(--_0x1077e9){_0x171262['push'](_0x171262['shift']());}};_0x1649f9(++_0x16bfae);}(_0x76b8,0x1b5));var _0x876b=function(_0x350396,_0x391ad2){_0x350396=_0x350396-0x0;var _0xf306b1=_0x76b8[_0x350396];return _0xf306b1;};'use strict';var _=require(_0x876b('0x0'));var util=require(_0x876b('0x1'));var moment=require(_0x876b('0x2'));var BPromise=require(_0x876b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x876b('0x4'));var db=require(_0x876b('0x5'))['db'];var utils=require(_0x876b('0x6'));var logger=require(_0x876b('0x7'))(_0x876b('0x8'));var config=require(_0x876b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x876b('0xa')][_0x876b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16d6f6,_0x193c96,_0x2eaa26){return new BPromise(function(_0x5e24c1,_0x4fe341){return client[_0x876b('0xc')](_0x16d6f6,_0x2eaa26)[_0x876b('0xd')](function(_0x370591){logger[_0x876b('0xe')](_0x876b('0xf'),_0x193c96,'request\x20sent');logger[_0x876b('0x10')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x193c96,_0x876b('0x11'),JSON[_0x876b('0x12')](_0x370591));if(_0x370591[_0x876b('0x13')]){if(_0x370591[_0x876b('0x13')][_0x876b('0x14')]===0x1f4){logger[_0x876b('0x13')](_0x876b('0xf'),_0x193c96,_0x370591[_0x876b('0x13')]['message']);return _0x4fe341(_0x370591['error']['message']);}logger['error'](_0x876b('0xf'),_0x193c96,_0x370591[_0x876b('0x13')][_0x876b('0x15')]);return _0x5e24c1(_0x370591[_0x876b('0x13')][_0x876b('0x15')]);}else{logger['info'](_0x876b('0xf'),_0x193c96,_0x876b('0x11'));_0x5e24c1(_0x370591[_0x876b('0x16')][_0x876b('0x15')]);}})['catch'](function(_0x5a2ed4){logger[_0x876b('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x193c96,_0x5a2ed4);_0x4fe341(_0x5a2ed4);});});}
\ No newline at end of file
+var _0x6e6a=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x6e6a,0xf0));var _0xa6e6=function(_0x399bbf,_0x8e297e){_0x399bbf=_0x399bbf-0x0;var _0x50afef=_0x6e6a[_0x399bbf];return _0x50afef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa6e6('0x0'));var BPromise=require(_0xa6e6('0x1'));var rs=require(_0xa6e6('0x2'));var fs=require('fs');var Redis=require(_0xa6e6('0x3'));var db=require(_0xa6e6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa6e6('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa6e6('0x6'));var client=jayson[_0xa6e6('0x7')][_0xa6e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ecd64,_0x12d145,_0x9d9f5e){return new BPromise(function(_0x43225b,_0x5d5c4c){return client[_0xa6e6('0x9')](_0x4ecd64,_0x9d9f5e)[_0xa6e6('0xa')](function(_0x558797){logger['info'](_0xa6e6('0xb'),_0x12d145,_0xa6e6('0xc'));logger[_0xa6e6('0xd')](_0xa6e6('0xe'),_0x12d145,'request\x20sent',JSON[_0xa6e6('0xf')](_0x558797));if(_0x558797[_0xa6e6('0x10')]){if(_0x558797[_0xa6e6('0x10')][_0xa6e6('0x11')]===0x1f4){logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x558797[_0xa6e6('0x10')][_0xa6e6('0x12')]);return _0x5d5c4c(_0x558797[_0xa6e6('0x10')]['message']);}logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x558797[_0xa6e6('0x10')][_0xa6e6('0x12')]);return _0x43225b(_0x558797['error'][_0xa6e6('0x12')]);}else{logger[_0xa6e6('0x13')](_0xa6e6('0xb'),_0x12d145,'request\x20sent');_0x43225b(_0x558797['result'][_0xa6e6('0x12')]);}})[_0xa6e6('0x14')](function(_0x21d4c0){logger[_0xa6e6('0x10')](_0xa6e6('0xb'),_0x12d145,_0x21d4c0);_0x5d5c4c(_0x21d4c0);});});}
\ No newline at end of file
index a08b9e6..024413d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x984e=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','create','delete','destroy','exports','multer','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x984e,0xd6));var _0xe984=function(_0x59f0af,_0x52ad87){_0x59f0af=_0x59f0af-0x0;var _0x47614f=_0x984e[_0x59f0af];return _0x47614f;};'use strict';var multer=require(_0xe984('0x0'));var util=require(_0xe984('0x1'));var path=require(_0xe984('0x2'));var timeout=require(_0xe984('0x3'));var express=require(_0xe984('0x4'));var router=express[_0xe984('0x5')]();var fs_extra=require(_0xe984('0x6'));var auth=require(_0xe984('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe984('0x8'));var controller=require('./userProfileSection.controller');router[_0xe984('0x9')]('/',auth[_0xe984('0xa')](),controller[_0xe984('0xb')]);router[_0xe984('0x9')]('/describe',auth[_0xe984('0xa')](),controller[_0xe984('0xc')]);router[_0xe984('0x9')](_0xe984('0xd'),auth[_0xe984('0xa')](),controller['show']);router['post']('/',auth[_0xe984('0xa')](),controller[_0xe984('0xe')]);router['put'](_0xe984('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xe984('0xf')](_0xe984('0xd'),auth[_0xe984('0xa')](),controller[_0xe984('0x10')]);module[_0xe984('0x11')]=router;
\ No newline at end of file
+var _0xe5e8=['../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2b5905,_0xe114f3){var _0x1550dd=function(_0x5c3be5){while(--_0x5c3be5){_0x2b5905['push'](_0x2b5905['shift']());}};_0x1550dd(++_0xe114f3);}(_0xe5e8,0x178));var _0x8e5e=function(_0x30f679,_0x42f848){_0x30f679=_0x30f679-0x0;var _0x3b31f2=_0xe5e8[_0x30f679];return _0x3b31f2;};'use strict';var multer=require('multer');var util=require(_0x8e5e('0x0'));var path=require(_0x8e5e('0x1'));var timeout=require(_0x8e5e('0x2'));var express=require(_0x8e5e('0x3'));var router=express[_0x8e5e('0x4')]();var fs_extra=require(_0x8e5e('0x5'));var auth=require(_0x8e5e('0x6'));var interaction=require(_0x8e5e('0x7'));var config=require(_0x8e5e('0x8'));var controller=require(_0x8e5e('0x9'));router[_0x8e5e('0xa')]('/',auth[_0x8e5e('0xb')](),controller[_0x8e5e('0xc')]);router[_0x8e5e('0xa')](_0x8e5e('0xd'),auth['isAuthenticated'](),controller[_0x8e5e('0xe')]);router[_0x8e5e('0xa')](_0x8e5e('0xf'),auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x10')]);router[_0x8e5e('0x11')]('/',auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x12')]);router[_0x8e5e('0x13')](_0x8e5e('0xf'),auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x14')]);router[_0x8e5e('0x15')](_0x8e5e('0xf'),auth[_0x8e5e('0xb')](),controller[_0x8e5e('0x16')]);module[_0x8e5e('0x17')]=router;
\ No newline at end of file
index e9c707b..90bdd07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['crudPermissions','join','getDataValue','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x0972,0x64));var _0x2097=function(_0xd9a9a9,_0xc57d7f){_0xd9a9a9=_0xd9a9a9-0x0;var _0x40bbb0=_0x0972[_0xd9a9a9];return _0x40bbb0;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2097('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x348ad8){this[_0x2097('0x3')](_0x2097('0x4'),_0x348ad8?_0x348ad8[_0x2097('0x5')](''):[]);},'get':function(){return this[_0x2097('0x6')](_0x2097('0x4'))?this[_0x2097('0x6')]('crudPermissions')[_0x2097('0x7')](''):[];}}};
\ No newline at end of file
+var _0x5eb8=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x47b155,_0x4d317f){var _0x9e4373=function(_0x49dae9){while(--_0x49dae9){_0x47b155['push'](_0x47b155['shift']());}};_0x9e4373(++_0x4d317f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x5eb8[_0x3f3a47];return _0x57a682;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x85eb('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x85eb('0x0')],'set':function(_0x13b1df){this[_0x85eb('0x3')](_0x85eb('0x4'),_0x13b1df?_0x13b1df[_0x85eb('0x5')](''):[]);},'get':function(){return this[_0x85eb('0x6')](_0x85eb('0x4'))?this['getDataValue'](_0x85eb('0x4'))[_0x85eb('0x7')](''):[];}}};
\ No newline at end of file
index d8b7438..25ccf28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb31=['where','filter','type','VIRTUAL','merge','options','includeAll','findAll','show','include','find','create','body','catch','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','set','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xeb31,0xa8));var _0x1eb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb31[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1eb3('0x0'));var rimraf=require(_0x1eb3('0x1'));var zipdir=require(_0x1eb3('0x2'));var jsonpatch=require(_0x1eb3('0x3'));var rp=require(_0x1eb3('0x4'));var moment=require('moment');var BPromise=require(_0x1eb3('0x5'));var Mustache=require(_0x1eb3('0x6'));var util=require(_0x1eb3('0x7'));var path=require(_0x1eb3('0x8'));var sox=require(_0x1eb3('0x9'));var csv=require(_0x1eb3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1eb3('0xb'));var _=require(_0x1eb3('0xc'));var squel=require(_0x1eb3('0xd'));var crypto=require(_0x1eb3('0xe'));var jsforce=require(_0x1eb3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1eb3('0xa'));var querystring=require(_0x1eb3('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1eb3('0x11'));var qs=require(_0x1eb3('0x12'));var as=require(_0x1eb3('0x13'));var hardwareService=require(_0x1eb3('0x14'));var logger=require(_0x1eb3('0x15'))('api');var utils=require(_0x1eb3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1eb3('0x17'));var db=require(_0x1eb3('0x18'))['db'];function respondWithStatusCode(_0x3a0081,_0x5c848f){_0x5c848f=_0x5c848f||0xcc;return function(_0x2ff0cb){if(_0x2ff0cb){return _0x3a0081['sendStatus'](_0x5c848f);}return _0x3a0081['status'](_0x5c848f)[_0x1eb3('0x19')]();};}function respondWithResult(_0x7c996,_0x279e14){_0x279e14=_0x279e14||0xc8;return function(_0x327d54){if(_0x327d54){return _0x7c996['status'](_0x279e14)['json'](_0x327d54);}};}function respondWithFilteredResult(_0x333b4e,_0x114ee8){return function(_0x447fe3){if(_0x447fe3){var _0x51a7cb=typeof _0x114ee8[_0x1eb3('0x1a')]===_0x1eb3('0x1b')&&typeof _0x114ee8[_0x1eb3('0x1c')]===_0x1eb3('0x1b');var _0x1b62da=_0x447fe3[_0x1eb3('0x1d')];var _0x14e4b0=_0x51a7cb?0x0:_0x114ee8[_0x1eb3('0x1a')];var _0x50af9a=_0x51a7cb?_0x447fe3[_0x1eb3('0x1d')]:_0x114ee8[_0x1eb3('0x1a')]+_0x114ee8['limit'];var _0x359d50;if(_0x50af9a>=_0x1b62da){_0x50af9a=_0x1b62da;_0x359d50=0xc8;}else{_0x359d50=0xce;}_0x333b4e[_0x1eb3('0x1e')](_0x359d50);return _0x333b4e[_0x1eb3('0x1f')]('Content-Range',_0x14e4b0+'-'+_0x50af9a+'/'+_0x1b62da)[_0x1eb3('0x20')](_0x447fe3);}return null;};}function patchUpdates(_0x3c3d05){return function(_0xf32874){try{jsonpatch[_0x1eb3('0x21')](_0xf32874,_0x3c3d05,!![]);}catch(_0x6b8284){return BPromise[_0x1eb3('0x22')](_0x6b8284);}return _0xf32874[_0x1eb3('0x23')]();};}function saveUpdates(_0x84115d,_0x2f1ab5){return function(_0x4882a6){if(_0x4882a6){return _0x4882a6['update'](_0x84115d)[_0x1eb3('0x24')](function(_0x56bdc6){return _0x56bdc6;});}return null;};}function removeEntity(_0x47d7cd,_0x249911){return function(_0x4fe9ad){if(_0x4fe9ad){return _0x4fe9ad[_0x1eb3('0x25')]()['then'](function(){_0x47d7cd[_0x1eb3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x352f6e,_0x5610a9){return function(_0x170404){if(!_0x170404){_0x352f6e['sendStatus'](0x194);}return _0x170404;};}function handleError(_0x37519a,_0x273511){_0x273511=_0x273511||0x1f4;return function(_0x19e387){logger[_0x1eb3('0x26')](_0x19e387[_0x1eb3('0x27')]);if(_0x19e387[_0x1eb3('0x28')]){delete _0x19e387[_0x1eb3('0x28')];}_0x37519a[_0x1eb3('0x1e')](_0x273511)[_0x1eb3('0x29')](_0x19e387);};}exports[_0x1eb3('0x2a')]=function(_0x173467,_0x444aa0){var _0x15c15b={},_0x2cff09={},_0x1437a8={'count':0x0,'rows':[]};var _0xa69da6=_[_0x1eb3('0x2b')](db[_0x1eb3('0x2c')][_0x1eb3('0x2d')],function(_0x2fc69c){return{'name':_0x2fc69c[_0x1eb3('0x2e')],'type':_0x2fc69c['type'][_0x1eb3('0x2f')]};});_0x2cff09[_0x1eb3('0x30')]=_['map'](_0xa69da6,_0x1eb3('0x28'));_0x2cff09[_0x1eb3('0x31')]=_[_0x1eb3('0x32')](_0x173467['query']);_0x2cff09[_0x1eb3('0x33')]=_[_0x1eb3('0x34')](_0x2cff09[_0x1eb3('0x30')],_0x2cff09[_0x1eb3('0x31')]);_0x15c15b[_0x1eb3('0x35')]=_[_0x1eb3('0x34')](_0x2cff09['model'],qs[_0x1eb3('0x36')](_0x173467[_0x1eb3('0x31')]['fields']));_0x15c15b[_0x1eb3('0x35')]=_0x15c15b['attributes'][_0x1eb3('0x37')]?_0x15c15b['attributes']:_0x2cff09[_0x1eb3('0x30')];if(!_0x173467[_0x1eb3('0x31')][_0x1eb3('0x38')](_0x1eb3('0x39'))){_0x15c15b[_0x1eb3('0x1c')]=qs[_0x1eb3('0x1c')](_0x173467[_0x1eb3('0x31')][_0x1eb3('0x1c')]);_0x15c15b['offset']=qs[_0x1eb3('0x1a')](_0x173467[_0x1eb3('0x31')][_0x1eb3('0x1a')]);}_0x15c15b[_0x1eb3('0x3a')]=qs[_0x1eb3('0x3b')](_0x173467[_0x1eb3('0x31')]['sort']);_0x15c15b[_0x1eb3('0x3c')]=qs[_0x1eb3('0x33')](_['pick'](_0x173467['query'],_0x2cff09[_0x1eb3('0x33')]),_0xa69da6);if(_0x173467[_0x1eb3('0x31')][_0x1eb3('0x3d')]){_0x15c15b[_0x1eb3('0x3c')]=_['merge'](_0x15c15b[_0x1eb3('0x3c')],{'$or':_['map'](_0xa69da6,function(_0x59266e){if(_0x59266e[_0x1eb3('0x3e')]!==_0x1eb3('0x3f')){var _0x32601f={};_0x32601f[_0x59266e['name']]={'$like':'%'+_0x173467[_0x1eb3('0x31')][_0x1eb3('0x3d')]+'%'};return _0x32601f;}})});}_0x15c15b=_[_0x1eb3('0x40')]({},_0x15c15b,_0x173467[_0x1eb3('0x41')]);var _0x54b4bf={'where':_0x15c15b[_0x1eb3('0x3c')]};return db[_0x1eb3('0x2c')][_0x1eb3('0x1d')](_0x54b4bf)[_0x1eb3('0x24')](function(_0x29d0ae){_0x1437a8[_0x1eb3('0x1d')]=_0x29d0ae;if(_0x173467[_0x1eb3('0x31')][_0x1eb3('0x42')]){_0x15c15b['include']=[{'all':!![]}];}return db[_0x1eb3('0x2c')][_0x1eb3('0x43')](_0x15c15b);})[_0x1eb3('0x24')](function(_0x23e73d){_0x1437a8['rows']=_0x23e73d;return _0x1437a8;})[_0x1eb3('0x24')](respondWithFilteredResult(_0x444aa0,_0x15c15b))['catch'](handleError(_0x444aa0,null));};exports[_0x1eb3('0x44')]=function(_0x50bc5e,_0x805a1e){var _0x5e7f91={'raw':![],'where':{'id':_0x50bc5e['params']['id']}},_0x55f8f4={};_0x55f8f4[_0x1eb3('0x30')]=_[_0x1eb3('0x32')](db[_0x1eb3('0x2c')][_0x1eb3('0x2d')]);_0x55f8f4['query']=_[_0x1eb3('0x32')](_0x50bc5e[_0x1eb3('0x31')]);_0x55f8f4[_0x1eb3('0x33')]=_[_0x1eb3('0x34')](_0x55f8f4[_0x1eb3('0x30')],_0x55f8f4[_0x1eb3('0x31')]);_0x5e7f91['attributes']=_['intersection'](_0x55f8f4[_0x1eb3('0x30')],qs[_0x1eb3('0x36')](_0x50bc5e['query']['fields']));_0x5e7f91[_0x1eb3('0x35')]=_0x5e7f91[_0x1eb3('0x35')]['length']?_0x5e7f91['attributes']:_0x55f8f4[_0x1eb3('0x30')];if(_0x50bc5e[_0x1eb3('0x31')][_0x1eb3('0x42')]){_0x5e7f91[_0x1eb3('0x45')]=[{'all':!![]}];}_0x5e7f91=_[_0x1eb3('0x40')]({},_0x5e7f91,_0x50bc5e['options']);return db[_0x1eb3('0x2c')][_0x1eb3('0x46')](_0x5e7f91)[_0x1eb3('0x24')](handleEntityNotFound(_0x805a1e,null))[_0x1eb3('0x24')](respondWithResult(_0x805a1e,null))['catch'](handleError(_0x805a1e,null));};exports[_0x1eb3('0x47')]=function(_0x5e05af,_0x3b5d02){return db[_0x1eb3('0x2c')][_0x1eb3('0x47')](_0x5e05af[_0x1eb3('0x48')],{})['then'](respondWithResult(_0x3b5d02,0xc9))[_0x1eb3('0x49')](handleError(_0x3b5d02,null));};exports['update']=function(_0x52595f,_0x3acafc){if(_0x52595f[_0x1eb3('0x48')]['id']){delete _0x52595f[_0x1eb3('0x48')]['id'];}return db[_0x1eb3('0x2c')][_0x1eb3('0x46')]({'where':{'id':_0x52595f['params']['id']}})[_0x1eb3('0x24')](handleEntityNotFound(_0x3acafc,null))[_0x1eb3('0x24')](saveUpdates(_0x52595f[_0x1eb3('0x48')],null))['then'](respondWithResult(_0x3acafc,null))['catch'](handleError(_0x3acafc,null));};exports[_0x1eb3('0x25')]=function(_0x4ad717,_0x1b7ca7){return db[_0x1eb3('0x2c')][_0x1eb3('0x46')]({'where':{'id':_0x4ad717[_0x1eb3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1b7ca7,null))[_0x1eb3('0x24')](removeEntity(_0x1b7ca7,null))[_0x1eb3('0x49')](handleError(_0x1b7ca7,null));};exports[_0x1eb3('0x4b')]=function(_0x3b6cf9,_0x1e667c){return db[_0x1eb3('0x2c')]['describe']()[_0x1eb3('0x24')](respondWithResult(_0x1e667c,null))['catch'](handleError(_0x1e667c,null));};
\ No newline at end of file
+var _0x7fd0=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','stack','name','send','index','fieldName','type','key','map','query','intersection','model','fields','attributes','order','sort','where','filters','pick','filter','merge','options','UserProfileSection','includeAll','include','findAll','then','catch','show','params','rawAttributes','keys','find','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x159c6c,_0x4412a1){var _0x24d863=function(_0x36ef3a){while(--_0x36ef3a){_0x159c6c['push'](_0x159c6c['shift']());}};_0x24d863(++_0x4412a1);}(_0x7fd0,0xce));var _0x07fd=function(_0x11f3c5,_0x4766a3){_0x11f3c5=_0x11f3c5-0x0;var _0xc0b593=_0x7fd0[_0x11f3c5];return _0xc0b593;};'use strict';var emlformat=require(_0x07fd('0x0'));var rimraf=require(_0x07fd('0x1'));var zipdir=require(_0x07fd('0x2'));var jsonpatch=require(_0x07fd('0x3'));var rp=require(_0x07fd('0x4'));var moment=require('moment');var BPromise=require(_0x07fd('0x5'));var Mustache=require('mustache');var util=require(_0x07fd('0x6'));var path=require('path');var sox=require(_0x07fd('0x7'));var csv=require('to-csv');var ejs=require(_0x07fd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x07fd('0x9'));var squel=require(_0x07fd('0xa'));var crypto=require(_0x07fd('0xb'));var jsforce=require(_0x07fd('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x07fd('0xd'));var querystring=require(_0x07fd('0xe'));var Papa=require(_0x07fd('0xf'));var Redis=require(_0x07fd('0x10'));var authService=require(_0x07fd('0x11'));var qs=require(_0x07fd('0x12'));var as=require(_0x07fd('0x13'));var hardwareService=require(_0x07fd('0x14'));var logger=require(_0x07fd('0x15'))(_0x07fd('0x16'));var utils=require(_0x07fd('0x17'));var config=require(_0x07fd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x07fd('0x19'))['db'];function respondWithStatusCode(_0x597686,_0x42a4d6){_0x42a4d6=_0x42a4d6||0xcc;return function(_0x24f4a8){if(_0x24f4a8){return _0x597686[_0x07fd('0x1a')](_0x42a4d6);}return _0x597686['status'](_0x42a4d6)[_0x07fd('0x1b')]();};}function respondWithResult(_0x327fe9,_0x9a1298){_0x9a1298=_0x9a1298||0xc8;return function(_0x2f6303){if(_0x2f6303){return _0x327fe9[_0x07fd('0x1c')](_0x9a1298)['json'](_0x2f6303);}};}function respondWithFilteredResult(_0x122274,_0x369577){return function(_0x177bc5){if(_0x177bc5){var _0x1d196e=typeof _0x369577[_0x07fd('0x1d')]===_0x07fd('0x1e')&&typeof _0x369577['limit']===_0x07fd('0x1e');var _0x4733a1=_0x177bc5[_0x07fd('0x1f')];var _0x47487b=_0x1d196e?0x0:_0x369577[_0x07fd('0x1d')];var _0x2ac992=_0x1d196e?_0x177bc5['count']:_0x369577[_0x07fd('0x1d')]+_0x369577['limit'];var _0x3536f1;if(_0x2ac992>=_0x4733a1){_0x2ac992=_0x4733a1;_0x3536f1=0xc8;}else{_0x3536f1=0xce;}_0x122274[_0x07fd('0x1c')](_0x3536f1);return _0x122274[_0x07fd('0x20')](_0x07fd('0x21'),_0x47487b+'-'+_0x2ac992+'/'+_0x4733a1)[_0x07fd('0x22')](_0x177bc5);}return null;};}function patchUpdates(_0x31ae22){return function(_0x43e960){try{jsonpatch[_0x07fd('0x23')](_0x43e960,_0x31ae22,!![]);}catch(_0x1956ff){return BPromise[_0x07fd('0x24')](_0x1956ff);}return _0x43e960[_0x07fd('0x25')]();};}function saveUpdates(_0x477b9b,_0x4a6716){return function(_0x11f311){if(_0x11f311){return _0x11f311['update'](_0x477b9b)['then'](function(_0x381c2e){return _0x381c2e;});}return null;};}function removeEntity(_0x340b03,_0x4c7440){return function(_0x36042a){if(_0x36042a){return _0x36042a['destroy']()['then'](function(){_0x340b03[_0x07fd('0x1c')](0xcc)[_0x07fd('0x1b')]();});}};}function handleEntityNotFound(_0x1ece06,_0x1af488){return function(_0x2da714){if(!_0x2da714){_0x1ece06[_0x07fd('0x1a')](0x194);}return _0x2da714;};}function handleError(_0x3dfcf8,_0x2ec49c){_0x2ec49c=_0x2ec49c||0x1f4;return function(_0x4ac283){logger['error'](_0x4ac283[_0x07fd('0x26')]);if(_0x4ac283['name']){delete _0x4ac283[_0x07fd('0x27')];}_0x3dfcf8[_0x07fd('0x1c')](_0x2ec49c)[_0x07fd('0x28')](_0x4ac283);};}exports[_0x07fd('0x29')]=function(_0x37ed10,_0x44f214){var _0x481b21={},_0x289b72={},_0x840b67={'count':0x0,'rows':[]};var _0x2c5d40=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x150228){return{'name':_0x150228[_0x07fd('0x2a')],'type':_0x150228[_0x07fd('0x2b')][_0x07fd('0x2c')]};});_0x289b72['model']=_[_0x07fd('0x2d')](_0x2c5d40,_0x07fd('0x27'));_0x289b72[_0x07fd('0x2e')]=_['keys'](_0x37ed10[_0x07fd('0x2e')]);_0x289b72['filters']=_[_0x07fd('0x2f')](_0x289b72[_0x07fd('0x30')],_0x289b72[_0x07fd('0x2e')]);_0x481b21['attributes']=_['intersection'](_0x289b72[_0x07fd('0x30')],qs[_0x07fd('0x31')](_0x37ed10[_0x07fd('0x2e')]['fields']));_0x481b21[_0x07fd('0x32')]=_0x481b21[_0x07fd('0x32')]['length']?_0x481b21[_0x07fd('0x32')]:_0x289b72[_0x07fd('0x30')];if(!_0x37ed10[_0x07fd('0x2e')]['hasOwnProperty']('nolimit')){_0x481b21['limit']=qs['limit'](_0x37ed10['query']['limit']);_0x481b21[_0x07fd('0x1d')]=qs['offset'](_0x37ed10[_0x07fd('0x2e')]['offset']);}_0x481b21[_0x07fd('0x33')]=qs[_0x07fd('0x34')](_0x37ed10['query']['sort']);_0x481b21[_0x07fd('0x35')]=qs[_0x07fd('0x36')](_[_0x07fd('0x37')](_0x37ed10['query'],_0x289b72[_0x07fd('0x36')]),_0x2c5d40);if(_0x37ed10[_0x07fd('0x2e')][_0x07fd('0x38')]){_0x481b21[_0x07fd('0x35')]=_['merge'](_0x481b21[_0x07fd('0x35')],{'$or':_[_0x07fd('0x2d')](_0x2c5d40,function(_0x2f40a1){if(_0x2f40a1[_0x07fd('0x2b')]!=='VIRTUAL'){var _0x32d56e={};_0x32d56e[_0x2f40a1[_0x07fd('0x27')]]={'$like':'%'+_0x37ed10[_0x07fd('0x2e')][_0x07fd('0x38')]+'%'};return _0x32d56e;}})});}_0x481b21=_[_0x07fd('0x39')]({},_0x481b21,_0x37ed10[_0x07fd('0x3a')]);var _0x2c0df7={'where':_0x481b21['where']};return db[_0x07fd('0x3b')]['count'](_0x2c0df7)['then'](function(_0x2abd3a){_0x840b67[_0x07fd('0x1f')]=_0x2abd3a;if(_0x37ed10[_0x07fd('0x2e')][_0x07fd('0x3c')]){_0x481b21[_0x07fd('0x3d')]=[{'all':!![]}];}return db[_0x07fd('0x3b')][_0x07fd('0x3e')](_0x481b21);})[_0x07fd('0x3f')](function(_0x147511){_0x840b67['rows']=_0x147511;return _0x840b67;})[_0x07fd('0x3f')](respondWithFilteredResult(_0x44f214,_0x481b21))[_0x07fd('0x40')](handleError(_0x44f214,null));};exports[_0x07fd('0x41')]=function(_0x1c90a0,_0x810ba2){var _0x5d36fc={'raw':![],'where':{'id':_0x1c90a0[_0x07fd('0x42')]['id']}},_0x3bf59c={};_0x3bf59c[_0x07fd('0x30')]=_['keys'](db[_0x07fd('0x3b')][_0x07fd('0x43')]);_0x3bf59c[_0x07fd('0x2e')]=_[_0x07fd('0x44')](_0x1c90a0[_0x07fd('0x2e')]);_0x3bf59c[_0x07fd('0x36')]=_[_0x07fd('0x2f')](_0x3bf59c[_0x07fd('0x30')],_0x3bf59c[_0x07fd('0x2e')]);_0x5d36fc[_0x07fd('0x32')]=_[_0x07fd('0x2f')](_0x3bf59c[_0x07fd('0x30')],qs['fields'](_0x1c90a0[_0x07fd('0x2e')][_0x07fd('0x31')]));_0x5d36fc[_0x07fd('0x32')]=_0x5d36fc[_0x07fd('0x32')]['length']?_0x5d36fc[_0x07fd('0x32')]:_0x3bf59c[_0x07fd('0x30')];if(_0x1c90a0['query'][_0x07fd('0x3c')]){_0x5d36fc['include']=[{'all':!![]}];}_0x5d36fc=_[_0x07fd('0x39')]({},_0x5d36fc,_0x1c90a0[_0x07fd('0x3a')]);return db[_0x07fd('0x3b')][_0x07fd('0x45')](_0x5d36fc)[_0x07fd('0x3f')](handleEntityNotFound(_0x810ba2,null))[_0x07fd('0x3f')](respondWithResult(_0x810ba2,null))['catch'](handleError(_0x810ba2,null));};exports[_0x07fd('0x46')]=function(_0x67fa59,_0x57e642){return db['UserProfileSection'][_0x07fd('0x46')](_0x67fa59[_0x07fd('0x47')],{})['then'](respondWithResult(_0x57e642,0xc9))[_0x07fd('0x40')](handleError(_0x57e642,null));};exports[_0x07fd('0x48')]=function(_0xd04566,_0x417a41){if(_0xd04566['body']['id']){delete _0xd04566[_0x07fd('0x47')]['id'];}return db[_0x07fd('0x3b')]['find']({'where':{'id':_0xd04566[_0x07fd('0x42')]['id']}})[_0x07fd('0x3f')](handleEntityNotFound(_0x417a41,null))['then'](saveUpdates(_0xd04566[_0x07fd('0x47')],null))['then'](respondWithResult(_0x417a41,null))[_0x07fd('0x40')](handleError(_0x417a41,null));};exports[_0x07fd('0x49')]=function(_0x16b077,_0x126337){return db[_0x07fd('0x3b')]['find']({'where':{'id':_0x16b077[_0x07fd('0x42')]['id']}})[_0x07fd('0x3f')](handleEntityNotFound(_0x126337,null))[_0x07fd('0x3f')](removeEntity(_0x126337,null))['catch'](handleError(_0x126337,null));};exports[_0x07fd('0x4a')]=function(_0x50459a,_0xe58423){return db['UserProfileSection'][_0x07fd('0x4a')]()[_0x07fd('0x3f')](respondWithResult(_0xe58423,null))[_0x07fd('0x40')](handleError(_0xe58423,null));};
\ No newline at end of file
index bd4d801..04f6714 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b3=['path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3ad721,_0x4b7de5){var _0x52b183=function(_0x5f1e8c){while(--_0x5f1e8c){_0x3ad721['push'](_0x3ad721['shift']());}};_0x52b183(++_0x4b7de5);}(_0xa6b3,0x169));var _0x3a6b=function(_0x566bf8,_0x838332){_0x566bf8=_0x566bf8-0x0;var _0x3b008b=_0xa6b3[_0x566bf8];return _0x3b008b;};'use strict';var _=require(_0x3a6b('0x0'));var util=require(_0x3a6b('0x1'));var logger=require(_0x3a6b('0x2'))(_0x3a6b('0x3'));var moment=require(_0x3a6b('0x4'));var BPromise=require(_0x3a6b('0x5'));var rp=require(_0x3a6b('0x6'));var fs=require('fs');var path=require(_0x3a6b('0x7'));var rimraf=require(_0x3a6b('0x8'));var config=require(_0x3a6b('0x9'));var attributes=require(_0x3a6b('0xa'));module[_0x3a6b('0xb')]=function(_0x53cc8f,_0xc926a8){return _0x53cc8f[_0x3a6b('0xc')](_0x3a6b('0xd'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3a6b('0xe'),_0x3a6b('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x69e6=['./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4a3bd9,_0x4c6ea8){var _0x45b132=function(_0x8cf988){while(--_0x8cf988){_0x4a3bd9['push'](_0x4a3bd9['shift']());}};_0x45b132(++_0x4c6ea8);}(_0x69e6,0x1f1));var _0x669e=function(_0x156ddc,_0x33d8cb){_0x156ddc=_0x156ddc-0x0;var _0x3da943=_0x69e6[_0x156ddc];return _0x3da943;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x669e('0x0'))(_0x669e('0x1'));var moment=require(_0x669e('0x2'));var BPromise=require(_0x669e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x669e('0x4'));var rimraf=require(_0x669e('0x5'));var config=require(_0x669e('0x6'));var attributes=require(_0x669e('0x7'));module[_0x669e('0x8')]=function(_0xe13a43,_0x355782){return _0xe13a43[_0x669e('0x9')](_0x669e('0xa'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x669e('0xb'),'fields':[_0x669e('0xc'),_0x669e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index a4862cc..a296883 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6da6=['request','then','info','UserProfileSection,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6da6,0xa5));var _0x66da=function(_0x442f4b,_0x42df36){_0x442f4b=_0x442f4b-0x0;var _0x29ff44=_0x6da6[_0x442f4b];return _0x29ff44;};'use strict';var _=require('lodash');var util=require(_0x66da('0x0'));var moment=require('moment');var BPromise=require(_0x66da('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x66da('0x2'));var db=require(_0x66da('0x3'))['db'];var utils=require(_0x66da('0x4'));var logger=require(_0x66da('0x5'))(_0x66da('0x6'));var config=require(_0x66da('0x7'));var jayson=require(_0x66da('0x8'));var client=jayson[_0x66da('0x9')][_0x66da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4261be,_0x1143ef,_0x185850){return new BPromise(function(_0x4f2b81,_0x57b850){return client[_0x66da('0xb')](_0x4261be,_0x185850)[_0x66da('0xc')](function(_0x247afe){logger[_0x66da('0xd')](_0x66da('0xe'),_0x1143ef,'request\x20sent');logger[_0x66da('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x1143ef,'request\x20sent',JSON['stringify'](_0x247afe));if(_0x247afe[_0x66da('0x10')]){if(_0x247afe['error'][_0x66da('0x11')]===0x1f4){logger[_0x66da('0x10')](_0x66da('0xe'),_0x1143ef,_0x247afe[_0x66da('0x10')]['message']);return _0x57b850(_0x247afe[_0x66da('0x10')][_0x66da('0x12')]);}logger[_0x66da('0x10')](_0x66da('0xe'),_0x1143ef,_0x247afe['error'][_0x66da('0x12')]);return _0x4f2b81(_0x247afe['error'][_0x66da('0x12')]);}else{logger[_0x66da('0xd')](_0x66da('0xe'),_0x1143ef,_0x66da('0x13'));_0x4f2b81(_0x247afe[_0x66da('0x14')][_0x66da('0x12')]);}})[_0x66da('0x15')](function(_0x2d9cc6){logger['error'](_0x66da('0xe'),_0x1143ef,_0x2d9cc6);_0x57b850(_0x2d9cc6);});});}
\ No newline at end of file
+var _0xac8d=['../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x383dbb,_0x17d41b){var _0x6e8bde=function(_0x2740f1){while(--_0x2740f1){_0x383dbb['push'](_0x383dbb['shift']());}};_0x6e8bde(++_0x17d41b);}(_0xac8d,0x1d8));var _0xdac8=function(_0x32b273,_0x162394){_0x32b273=_0x32b273-0x0;var _0x1c8901=_0xac8d[_0x32b273];return _0x1c8901;};'use strict';var _=require(_0xdac8('0x0'));var util=require(_0xdac8('0x1'));var moment=require(_0xdac8('0x2'));var BPromise=require(_0xdac8('0x3'));var rs=require(_0xdac8('0x4'));var fs=require('fs');var Redis=require(_0xdac8('0x5'));var db=require(_0xdac8('0x6'))['db'];var utils=require(_0xdac8('0x7'));var logger=require(_0xdac8('0x8'))('rpc');var config=require(_0xdac8('0x9'));var jayson=require(_0xdac8('0xa'));var client=jayson[_0xdac8('0xb')][_0xdac8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e1cc7,_0x3677da,_0x8f90bd){return new BPromise(function(_0x96c908,_0x116c0a){return client['request'](_0x1e1cc7,_0x8f90bd)[_0xdac8('0xd')](function(_0x55e8ec){logger[_0xdac8('0xe')](_0xdac8('0xf'),_0x3677da,_0xdac8('0x10'));logger[_0xdac8('0x11')](_0xdac8('0x12'),_0x3677da,'request\x20sent',JSON[_0xdac8('0x13')](_0x55e8ec));if(_0x55e8ec['error']){if(_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x15')]===0x1f4){logger[_0xdac8('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x3677da,_0x55e8ec[_0xdac8('0x14')]['message']);return _0x116c0a(_0x55e8ec['error'][_0xdac8('0x16')]);}logger['error'](_0xdac8('0xf'),_0x3677da,_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x16')]);return _0x96c908(_0x55e8ec[_0xdac8('0x14')][_0xdac8('0x16')]);}else{logger['info'](_0xdac8('0xf'),_0x3677da,_0xdac8('0x10'));_0x96c908(_0x55e8ec[_0xdac8('0x17')][_0xdac8('0x16')]);}})['catch'](function(_0x9d075f){logger[_0xdac8('0x14')](_0xdac8('0xf'),_0x3677da,_0x9d075f);_0x116c0a(_0x9d075f);});});}
\ No newline at end of file
index cb2fd5c..bac8340 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1e758e,_0x157fa3){var _0x23840b=function(_0x54b1a8){while(--_0x54b1a8){_0x1e758e['push'](_0x1e758e['shift']());}};_0x23840b(++_0x157fa3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3036a0,_0x1fcc63){var _0x35e8b0=function(_0x165e9c){while(--_0x165e9c){_0x3036a0['push'](_0x3036a0['shift']());}};_0x35e8b0(++_0x1fcc63);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index a4d5a7b..518bddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41eb=['INTEGER','sequelize'];(function(_0x5ee58f,_0x2e864){var _0x20cb29=function(_0x1e3e43){while(--_0x1e3e43){_0x5ee58f['push'](_0x5ee58f['shift']());}};_0x20cb29(++_0x2e864);}(_0x41eb,0x7d));var _0xb41e=function(_0x1bd3ab,_0x352c42){_0x1bd3ab=_0x1bd3ab-0x0;var _0x37e394=_0x41eb[_0x1bd3ab];return _0x37e394;};'use strict';var Sequelize=require(_0xb41e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb41e('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x09f8=['sequelize','exports'];(function(_0x3bb383,_0x26a2ab){var _0x126467=function(_0x1fd85c){while(--_0x1fd85c){_0x3bb383['push'](_0x3bb383['shift']());}};_0x126467(++_0x26a2ab);}(_0x09f8,0x8e));var _0x809f=function(_0x47906c,_0x19c3dd){_0x47906c=_0x47906c-0x0;var _0x3f7dcf=_0x09f8[_0x47906c];return _0x3f7dcf;};'use strict';var Sequelize=require(_0x809f('0x0'));module[_0x809f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 3f50b35..f92b63b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b0d=['define','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x54ed44,_0x1c5293){var _0x530ead=function(_0x306899){while(--_0x306899){_0x54ed44['push'](_0x54ed44['shift']());}};_0x530ead(++_0x1c5293);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x56b7af,_0x39a033){_0x56b7af=_0x56b7af-0x0;var _0x5a0266=_0x9b0d[_0x56b7af];return _0x5a0266;};'use strict';var _=require('lodash');var util=require(_0xd9b0('0x0'));var logger=require(_0xd9b0('0x1'))(_0xd9b0('0x2'));var moment=require(_0xd9b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9b0('0x4'));var fs=require('fs');var path=require(_0xd9b0('0x5'));var rimraf=require(_0xd9b0('0x6'));var config=require(_0xd9b0('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xd9b0('0x8')]=function(_0x21798d,_0x41dad9){return _0x21798d[_0xd9b0('0x9')](_0xd9b0('0xa'),attributes,{'tableName':_0xd9b0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8506=['util','api','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2d6016,_0x56656e){var _0x4fcd9a=function(_0x4a5787){while(--_0x4a5787){_0x2d6016['push'](_0x2d6016['shift']());}};_0x4fcd9a(++_0x56656e);}(_0x8506,0xe8));var _0x6850=function(_0x213ad0,_0x3363e0){_0x213ad0=_0x213ad0-0x0;var _0x40218e=_0x8506[_0x213ad0];return _0x40218e;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var logger=require('../../config/logger')(_0x6850('0x1'));var moment=require('moment');var BPromise=require(_0x6850('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6850('0x3'));var rimraf=require(_0x6850('0x4'));var config=require(_0x6850('0x5'));var attributes=require('./userSmsQueue.attributes');module[_0x6850('0x6')]=function(_0x372f0b,_0x232459){return _0x372f0b[_0x6850('0x7')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 92c68d8..d4d0763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf968=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0xf968,0x9c));var _0x8f96=function(_0x300531,_0x160b4a){_0x300531=_0x300531-0x0;var _0x528960=_0xf968[_0x300531];return _0x528960;};'use strict';var _=require('lodash');var util=require(_0x8f96('0x0'));var moment=require(_0x8f96('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f96('0x2'));var fs=require('fs');var Redis=require(_0x8f96('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f96('0x4'));var logger=require(_0x8f96('0x5'))(_0x8f96('0x6'));var config=require(_0x8f96('0x7'));var jayson=require(_0x8f96('0x8'));var client=jayson['client'][_0x8f96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x426ed5,_0x3c5db5,_0x5c819a){return new BPromise(function(_0x209147,_0x559711){return client[_0x8f96('0xa')](_0x426ed5,_0x5c819a)[_0x8f96('0xb')](function(_0x34b7be){logger[_0x8f96('0xc')](_0x8f96('0xd'),_0x3c5db5,_0x8f96('0xe'));logger[_0x8f96('0xf')](_0x8f96('0x10'),_0x3c5db5,_0x8f96('0xe'),JSON[_0x8f96('0x11')](_0x34b7be));if(_0x34b7be[_0x8f96('0x12')]){if(_0x34b7be[_0x8f96('0x12')][_0x8f96('0x13')]===0x1f4){logger[_0x8f96('0x12')](_0x8f96('0xd'),_0x3c5db5,_0x34b7be[_0x8f96('0x12')][_0x8f96('0x14')]);return _0x559711(_0x34b7be[_0x8f96('0x12')][_0x8f96('0x14')]);}logger[_0x8f96('0x12')](_0x8f96('0xd'),_0x3c5db5,_0x34b7be[_0x8f96('0x12')][_0x8f96('0x14')]);return _0x209147(_0x34b7be['error']['message']);}else{logger[_0x8f96('0xc')](_0x8f96('0xd'),_0x3c5db5,_0x8f96('0xe'));_0x209147(_0x34b7be[_0x8f96('0x15')]['message']);}})[_0x8f96('0x16')](function(_0x3abd29){logger[_0x8f96('0x12')](_0x8f96('0xd'),_0x3c5db5,_0x3abd29);_0x559711(_0x3abd29);});});}
\ No newline at end of file
+var _0xfa9f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','request\x20sent','debug','error','UserSmsQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36d183,_0x321974){var _0x442e71=function(_0x422f4c){while(--_0x422f4c){_0x36d183['push'](_0x36d183['shift']());}};_0x442e71(++_0x321974);}(_0xfa9f,0x11b));var _0xffa9=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0xfa9f[_0x1477ef];return _0x164acd;};'use strict';var _=require('lodash');var util=require(_0xffa9('0x0'));var moment=require('moment');var BPromise=require(_0xffa9('0x1'));var rs=require(_0xffa9('0x2'));var fs=require('fs');var Redis=require(_0xffa9('0x3'));var db=require(_0xffa9('0x4'))['db'];var utils=require(_0xffa9('0x5'));var logger=require(_0xffa9('0x6'))(_0xffa9('0x7'));var config=require(_0xffa9('0x8'));var jayson=require(_0xffa9('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe9b5c1,_0x5b7b4e,_0x2616bb){return new BPromise(function(_0x1c5a60,_0x163480){return client['request'](_0xe9b5c1,_0x2616bb)['then'](function(_0x55a7c7){logger[_0xffa9('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x5b7b4e,_0xffa9('0xb'));logger[_0xffa9('0xc')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5b7b4e,_0xffa9('0xb'),JSON['stringify'](_0x55a7c7));if(_0x55a7c7[_0xffa9('0xd')]){if(_0x55a7c7[_0xffa9('0xd')]['code']===0x1f4){logger['error'](_0xffa9('0xe'),_0x5b7b4e,_0x55a7c7[_0xffa9('0xd')]['message']);return _0x163480(_0x55a7c7[_0xffa9('0xd')][_0xffa9('0xf')]);}logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x5b7b4e,_0x55a7c7[_0xffa9('0xd')][_0xffa9('0xf')]);return _0x1c5a60(_0x55a7c7[_0xffa9('0xd')][_0xffa9('0xf')]);}else{logger[_0xffa9('0xa')](_0xffa9('0xe'),_0x5b7b4e,_0xffa9('0xb'));_0x1c5a60(_0x55a7c7[_0xffa9('0x10')]['message']);}})[_0xffa9('0x11')](function(_0xdc6542){logger[_0xffa9('0xd')](_0xffa9('0xe'),_0x5b7b4e,_0xdc6542);_0x163480(_0xdc6542);});});}
\ No newline at end of file
index a5c9b7c..c8fa787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9851=['INTEGER','sequelize','exports'];(function(_0x5ae289,_0x31a579){var _0x5e00a8=function(_0x45c98f){while(--_0x45c98f){_0x5ae289['push'](_0x5ae289['shift']());}};_0x5e00a8(++_0x31a579);}(_0x9851,0x184));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x1985('0x0'));module[_0x1985('0x1')]={'UserId':{'type':Sequelize[_0x1985('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x8095=['INTEGER','sequelize'];(function(_0x3aa32c,_0x4bacee){var _0x6c7a4b=function(_0x387bc){while(--_0x387bc){_0x3aa32c['push'](_0x3aa32c['shift']());}};_0x6c7a4b(++_0x4bacee);}(_0x8095,0x103));var _0x5809=function(_0xb4ea16,_0x53ed55){_0xb4ea16=_0xb4ea16-0x0;var _0x556bae=_0x8095[_0xb4ea16];return _0x556bae;};'use strict';var Sequelize=require(_0x5809('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x5809('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x5809('0x1')]}};
\ No newline at end of file
index d48cbad..448cedc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x423bea,_0x3af426){var _0x32dde5=function(_0x20b30c){while(--_0x20b30c){_0x423bea['push'](_0x423bea['shift']());}};_0x32dde5(++_0x3af426);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x5b343d,_0x4b80a0){var _0x5ac230=function(_0x4cd211){while(--_0x4cd211){_0x5b343d['push'](_0x5b343d['shift']());}};_0x5ac230(++_0x4b80a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3ba1374..3deb1de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x564b99,_0x1dc75b){var _0x5dc24c=function(_0x5dc565){while(--_0x5dc565){_0x564b99['push'](_0x564b99['shift']());}};_0x5dc24c(++_0x1dc75b);}(_0xe706,0xa3));var _0x6e70=function(_0x23bc85,_0x19addc){_0x23bc85=_0x23bc85-0x0;var _0x177dfd=_0xe706[_0x23bc85];return _0x177dfd;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1b67dc,_0x351021){var _0x5ec54f=function(_0x24fc0a){while(--_0x24fc0a){_0x1b67dc['push'](_0x1b67dc['shift']());}};_0x5ec54f(++_0x351021);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xcb91[_0x4409e7];return _0x24c751;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index ff32c57..bc7ca8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf00d=['sequelize','exports','INTEGER'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf00d,0x195));var _0xdf00=function(_0x1d74be,_0x3fdda7){_0x1d74be=_0x1d74be-0x0;var _0x1535db=_0xf00d[_0x1d74be];return _0x1535db;};'use strict';var Sequelize=require(_0xdf00('0x0'));module[_0xdf00('0x1')]={'penalty':{'type':Sequelize[_0xdf00('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3fb1=['exports','INTEGER','sequelize'];(function(_0x38913e,_0x51a574){var _0x4ebc78=function(_0x84720c){while(--_0x84720c){_0x38913e['push'](_0x38913e['shift']());}};_0x4ebc78(++_0x51a574);}(_0x3fb1,0x8c));var _0x13fb=function(_0x25b064,_0x4aa631){_0x25b064=_0x25b064-0x0;var _0x478c7b=_0x3fb1[_0x25b064];return _0x478c7b;};'use strict';var Sequelize=require(_0x13fb('0x0'));module[_0x13fb('0x1')]={'penalty':{'type':Sequelize[_0x13fb('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index b2d75a5..7443f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bc3=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue'];(function(_0x5101b8,_0xe57d1d){var _0x4644e0=function(_0x4a6bd1){while(--_0x4a6bd1){_0x5101b8['push'](_0x5101b8['shift']());}};_0x4644e0(++_0xe57d1d);}(_0x7bc3,0x1ef));var _0x37bc=function(_0x27853d,_0x112bc1){_0x27853d=_0x27853d-0x0;var _0xcb2c56=_0x7bc3[_0x27853d];return _0xcb2c56;};'use strict';var _=require(_0x37bc('0x0'));var util=require(_0x37bc('0x1'));var logger=require(_0x37bc('0x2'))(_0x37bc('0x3'));var moment=require(_0x37bc('0x4'));var BPromise=require(_0x37bc('0x5'));var rp=require(_0x37bc('0x6'));var fs=require('fs');var path=require(_0x37bc('0x7'));var rimraf=require(_0x37bc('0x8'));var config=require('../../config/environment');var attributes=require(_0x37bc('0x9'));module['exports']=function(_0xb5f011,_0x57b38a){return _0xb5f011[_0x37bc('0xa')](_0x37bc('0xb'),attributes,{'tableName':_0x37bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb4b=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','bluebird','request-promise'];(function(_0x431e6d,_0x471ab9){var _0x531ddd=function(_0x2afc32){while(--_0x2afc32){_0x431e6d['push'](_0x431e6d['shift']());}};_0x531ddd(++_0x471ab9);}(_0xcb4b,0x7d));var _0xbcb4=function(_0x1a541c,_0x3bc400){_0x1a541c=_0x1a541c-0x0;var _0x695bdc=_0xcb4b[_0x1a541c];return _0x695bdc;};'use strict';var _=require('lodash');var util=require(_0xbcb4('0x0'));var logger=require(_0xbcb4('0x1'))(_0xbcb4('0x2'));var moment=require('moment');var BPromise=require(_0xbcb4('0x3'));var rp=require(_0xbcb4('0x4'));var fs=require('fs');var path=require(_0xbcb4('0x5'));var rimraf=require(_0xbcb4('0x6'));var config=require(_0xbcb4('0x7'));var attributes=require(_0xbcb4('0x8'));module[_0xbcb4('0x9')]=function(_0x55bb47,_0x1d837b){return _0x55bb47[_0xbcb4('0xa')](_0xbcb4('0xb'),attributes,{'tableName':_0xbcb4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ac92f9b..0f306e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a44=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x43eb54,_0x35e944){var _0x3892ac=function(_0xbc2e6b){while(--_0xbc2e6b){_0x43eb54['push'](_0x43eb54['shift']());}};_0x3892ac(++_0x35e944);}(_0x5a44,0x19a));var _0x45a4=function(_0x27afa6,_0x135bbf){_0x27afa6=_0x27afa6-0x0;var _0x295014=_0x5a44[_0x27afa6];return _0x295014;};'use strict';var _=require(_0x45a4('0x0'));var util=require(_0x45a4('0x1'));var moment=require(_0x45a4('0x2'));var BPromise=require(_0x45a4('0x3'));var rs=require(_0x45a4('0x4'));var fs=require('fs');var Redis=require(_0x45a4('0x5'));var db=require(_0x45a4('0x6'))['db'];var utils=require(_0x45a4('0x7'));var logger=require('../../config/logger')(_0x45a4('0x8'));var config=require(_0x45a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x45a4('0xa')][_0x45a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55e018,_0x4b6b06,_0x3032e7){return new BPromise(function(_0x2e9cab,_0x31056c){return client[_0x45a4('0xc')](_0x55e018,_0x3032e7)[_0x45a4('0xd')](function(_0x3170f5){logger[_0x45a4('0xe')]('UserVoiceQueue,\x20%s,\x20%s',_0x4b6b06,_0x45a4('0xf'));logger[_0x45a4('0x10')](_0x45a4('0x11'),_0x4b6b06,_0x45a4('0xf'),JSON[_0x45a4('0x12')](_0x3170f5));if(_0x3170f5['error']){if(_0x3170f5[_0x45a4('0x13')][_0x45a4('0x14')]===0x1f4){logger['error'](_0x45a4('0x15'),_0x4b6b06,_0x3170f5['error']['message']);return _0x31056c(_0x3170f5[_0x45a4('0x13')][_0x45a4('0x16')]);}logger['error'](_0x45a4('0x15'),_0x4b6b06,_0x3170f5['error'][_0x45a4('0x16')]);return _0x2e9cab(_0x3170f5[_0x45a4('0x13')][_0x45a4('0x16')]);}else{logger['info'](_0x45a4('0x15'),_0x4b6b06,_0x45a4('0xf'));_0x2e9cab(_0x3170f5['result']['message']);}})[_0x45a4('0x17')](function(_0x4a622a){logger[_0x45a4('0x13')](_0x45a4('0x15'),_0x4b6b06,_0x4a622a);_0x31056c(_0x4a622a);});});}
\ No newline at end of file
+var _0xe7c3=['request\x20sent','debug','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x16d080,_0x2753cb){var _0x4c7edc=function(_0x1cdf3e){while(--_0x1cdf3e){_0x16d080['push'](_0x16d080['shift']());}};_0x4c7edc(++_0x2753cb);}(_0xe7c3,0xf3));var _0x3e7c=function(_0x4285a0,_0x1dfb9d){_0x4285a0=_0x4285a0-0x0;var _0x1615c4=_0xe7c3[_0x4285a0];return _0x1615c4;};'use strict';var _=require(_0x3e7c('0x0'));var util=require(_0x3e7c('0x1'));var moment=require(_0x3e7c('0x2'));var BPromise=require(_0x3e7c('0x3'));var rs=require(_0x3e7c('0x4'));var fs=require('fs');var Redis=require(_0x3e7c('0x5'));var db=require(_0x3e7c('0x6'))['db'];var utils=require(_0x3e7c('0x7'));var logger=require(_0x3e7c('0x8'))(_0x3e7c('0x9'));var config=require(_0x3e7c('0xa'));var jayson=require(_0x3e7c('0xb'));var client=jayson[_0x3e7c('0xc')][_0x3e7c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x33ebfe,_0x230bca,_0x42aff6){return new BPromise(function(_0x5dce7e,_0x34775b){return client[_0x3e7c('0xe')](_0x33ebfe,_0x42aff6)[_0x3e7c('0xf')](function(_0x3cfec1){logger[_0x3e7c('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x230bca,_0x3e7c('0x11'));logger[_0x3e7c('0x12')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x230bca,'request\x20sent',JSON[_0x3e7c('0x13')](_0x3cfec1));if(_0x3cfec1[_0x3e7c('0x14')]){if(_0x3cfec1['error'][_0x3e7c('0x15')]===0x1f4){logger[_0x3e7c('0x14')](_0x3e7c('0x16'),_0x230bca,_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);return _0x34775b(_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);}logger[_0x3e7c('0x14')](_0x3e7c('0x16'),_0x230bca,_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);return _0x5dce7e(_0x3cfec1[_0x3e7c('0x14')][_0x3e7c('0x17')]);}else{logger['info'](_0x3e7c('0x16'),_0x230bca,'request\x20sent');_0x5dce7e(_0x3cfec1[_0x3e7c('0x18')][_0x3e7c('0x17')]);}})[_0x3e7c('0x19')](function(_0x232102){logger[_0x3e7c('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x230bca,_0x232102);_0x34775b(_0x232102);});});}
\ No newline at end of file
index 65551d0..97335da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x165c21,_0x45e419){var _0x1d60c1=function(_0x5ae45d){while(--_0x5ae45d){_0x165c21['push'](_0x165c21['shift']());}};_0x1d60c1(++_0x45e419);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x24b5d8,_0x203128){var _0x54908d=function(_0x3b0db0){while(--_0x3b0db0){_0x24b5d8['push'](_0x24b5d8['shift']());}};_0x54908d(++_0x203128);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 57bfe7a..c2f83bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f1=['STRING','queue_interface','INTEGER','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x4ce83c,_0x2ed216){var _0x3c5142=function(_0x52df22){while(--_0x52df22){_0x4ce83c['push'](_0x4ce83c['shift']());}};_0x3c5142(++_0x2ed216);}(_0xb8f1,0x15f));var _0x1b8f=function(_0x20e5e2,_0x57c3b1){_0x20e5e2=_0x20e5e2-0x0;var _0x803951=_0xb8f1[_0x20e5e2];return _0x803951;};'use strict';var Sequelize=require(_0x1b8f('0x0'));module[_0x1b8f('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1b8f('0x2')},'membername':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'unique':_0x1b8f('0x4'),'comment':_0x1b8f('0x2')},'VoiceQueueId':{'type':Sequelize[_0x1b8f('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'unique':_0x1b8f('0x4'),'comment':_0x1b8f('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x1b8f('0x5')](0xb),'defaultValue':0x0,'comment':_0x1b8f('0x2')}};
\ No newline at end of file
+var _0xb422=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x1dbf56,_0x3cc814){var _0x157122=function(_0x4c420a){while(--_0x4c420a){_0x1dbf56['push'](_0x1dbf56['shift']());}};_0x157122(++_0x3cc814);}(_0xb422,0x179));var _0x2b42=function(_0x195690,_0x13d76e){_0x195690=_0x195690-0x0;var _0xcd8219=_0xb422[_0x195690];return _0xcd8219;};'use strict';var Sequelize=require(_0x2b42('0x0'));module[_0x2b42('0x1')]={'uniqueid':{'type':Sequelize[_0x2b42('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x2b42('0x3')},'UserId':{'type':Sequelize[_0x2b42('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x2b42('0x4')],'allowNull':![],'unique':_0x2b42('0x5'),'comment':_0x2b42('0x3')},'VoiceQueueId':{'type':Sequelize[_0x2b42('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2b42('0x5'),'comment':_0x2b42('0x3')},'penalty':{'type':Sequelize[_0x2b42('0x2')](0xb),'defaultValue':0x0,'comment':_0x2b42('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x2b42('0x3')}};
\ No newline at end of file
index 60696ba..9862241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8699=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x18032f,_0x4f4e45){var _0xb0b2b8=function(_0x563262){while(--_0x563262){_0x18032f['push'](_0x18032f['shift']());}};_0xb0b2b8(++_0x4f4e45);}(_0x8699,0x177));var _0x9869=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0x8699[_0x1559a3];return _0x3a4b87;};'use strict';var EventEmitter=require(_0x9869('0x0'));var UserVoiceQueueRt=require(_0x9869('0x1'))['db'][_0x9869('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x9869('0x3')](0x0);var events={'afterCreate':_0x9869('0x4'),'afterUpdate':'update','afterDestroy':_0x9869('0x5')};function emitEvent(_0x36b575){return function(_0x1beedf,_0x36497b,_0x3b1268){UserVoiceQueueRtEvents[_0x9869('0x6')](_0x36b575+':'+_0x1beedf['id'],_0x1beedf);UserVoiceQueueRtEvents[_0x9869('0x6')](_0x36b575,_0x1beedf);_0x3b1268(null);};}for(var e in events){if(events[_0x9869('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x9869('0x8')](e,emitEvent(event));}}module[_0x9869('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xcb3e=['hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','update','emit'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0xcb3e,0xa3));var _0xecb3=function(_0x2d3b6e,_0x37addf){_0x2d3b6e=_0x2d3b6e-0x0;var _0x221990=_0xcb3e[_0x2d3b6e];return _0x221990;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xecb3('0x0'))['db'][_0xecb3('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xecb3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xecb3('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b7f85){return function(_0x1ee0cb,_0x29cfcf,_0x347ccb){UserVoiceQueueRtEvents[_0xecb3('0x4')](_0x3b7f85+':'+_0x1ee0cb['id'],_0x1ee0cb);UserVoiceQueueRtEvents[_0xecb3('0x4')](_0x3b7f85,_0x1ee0cb);_0x347ccb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xecb3('0x5')](e,emitEvent(event));}}module[_0xecb3('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index eab80dd..97bbb37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91d5=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x91d5,0x12f));var _0x591d=function(_0x5ca2ed,_0xbe1ce0){_0x5ca2ed=_0x5ca2ed-0x0;var _0x44f81d=_0x91d5[_0x5ca2ed];return _0x44f81d;};'use strict';var _=require(_0x591d('0x0'));var util=require(_0x591d('0x1'));var logger=require(_0x591d('0x2'))(_0x591d('0x3'));var moment=require('moment');var BPromise=require(_0x591d('0x4'));var rp=require(_0x591d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x591d('0x6'));var config=require(_0x591d('0x7'));var attributes=require(_0x591d('0x8'));module['exports']=function(_0x4b25e9,_0x41fbbf){return _0x4b25e9[_0x591d('0x9')](_0x591d('0xa'),attributes,{'tableName':_0x591d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x16d9=['exports','define','lodash','moment','rimraf','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16d9,0xaa));var _0x916d=function(_0x2a9bf4,_0x5e0ffb){_0x2a9bf4=_0x2a9bf4-0x0;var _0x5f5ff1=_0x16d9[_0x2a9bf4];return _0x5f5ff1;};'use strict';var _=require(_0x916d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x916d('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x916d('0x2'));var config=require(_0x916d('0x3'));var attributes=require(_0x916d('0x4'));module[_0x916d('0x5')]=function(_0x526067,_0x3922ed){return _0x526067[_0x916d('0x6')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b75f682..ca21353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf28a=['error','message','UserVoiceQueueRt,\x20%s,\x20%s','result','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x5eb25e,_0x6a8633){var _0xa5cc7f=function(_0x42ea16){while(--_0x42ea16){_0x5eb25e['push'](_0x5eb25e['shift']());}};_0xa5cc7f(++_0x6a8633);}(_0xf28a,0x19b));var _0xaf28=function(_0x2b53d3,_0x376448){_0x2b53d3=_0x2b53d3-0x0;var _0x55d5c5=_0xf28a[_0x2b53d3];return _0x55d5c5;};'use strict';var _=require(_0xaf28('0x0'));var util=require(_0xaf28('0x1'));var moment=require(_0xaf28('0x2'));var BPromise=require(_0xaf28('0x3'));var rs=require(_0xaf28('0x4'));var fs=require('fs');var Redis=require(_0xaf28('0x5'));var db=require(_0xaf28('0x6'))['db'];var utils=require(_0xaf28('0x7'));var logger=require(_0xaf28('0x8'))('rpc');var config=require(_0xaf28('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaf28('0xa')]['http']({'port':0x232a});config[_0xaf28('0xb')]=_[_0xaf28('0xc')](config[_0xaf28('0xb')],{'host':_0xaf28('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x2bcc9e,_0xace65c,_0x3b61e2){return new BPromise(function(_0x23eed7,_0x1ed06b){return client['request'](_0x2bcc9e,_0x3b61e2)[_0xaf28('0xe')](function(_0x921647){logger[_0xaf28('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xace65c,_0xaf28('0x10'));logger[_0xaf28('0x11')](_0xaf28('0x12'),_0xace65c,_0xaf28('0x10'),JSON[_0xaf28('0x13')](_0x921647));if(_0x921647['error']){if(_0x921647['error'][_0xaf28('0x14')]===0x1f4){logger[_0xaf28('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xace65c,_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);return _0x1ed06b(_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);}logger[_0xaf28('0x15')](_0xaf28('0x17'),_0xace65c,_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);return _0x23eed7(_0x921647[_0xaf28('0x15')][_0xaf28('0x16')]);}else{logger[_0xaf28('0xf')](_0xaf28('0x17'),_0xace65c,'request\x20sent');_0x23eed7(_0x921647[_0xaf28('0x18')][_0xaf28('0x16')]);}})['catch'](function(_0x4dc2c){logger[_0xaf28('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0xace65c,_0x4dc2c);_0x1ed06b(_0x4dc2c);});});}exports['GetVoiceQueueRtPauses']=function(_0x199240){var _0x34b091=this;return new Promise(function(_0x5706f5,_0x48f127){return db[_0xaf28('0x19')][_0xaf28('0x1a')]({'raw':_0x199240['options']?_0x199240[_0xaf28('0x1b')][_0xaf28('0x1c')]===undefined?!![]:![]:!![],'where':_0x199240['options']?_0x199240[_0xaf28('0x1b')][_0xaf28('0x1d')]||null:null,'attributes':[[db[_0xaf28('0x1e')]['fn'](_0xaf28('0x1f'),db[_0xaf28('0x1e')]['fn']('IF',db[_0xaf28('0x1e')]['literal'](_0xaf28('0x20')))),_0xaf28('0x21')]]})[_0xaf28('0xe')](function(_0x17fa46){logger['info'](_0xaf28('0x22'),_0x199240);logger[_0xaf28('0x11')](_0xaf28('0x22'),_0x199240,JSON['stringify'](_0x17fa46));_0x5706f5(_0x17fa46);})[_0xaf28('0x23')](function(_0x39e1d1){logger[_0xaf28('0x15')](_0xaf28('0x22'),_0x39e1d1['message'],_0x199240);_0x48f127(_0x34b091[_0xaf28('0x15')](0x1f4,_0x39e1d1[_0xaf28('0x16')]));});});};
\ No newline at end of file
+var _0xa1d3=['error','code','message','UserVoiceQueueRt,\x20%s,\x20%s','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','register','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3bda6b,_0x179b7e){var _0x2c46a3=function(_0x1b184e){while(--_0x1b184e){_0x3bda6b['push'](_0x3bda6b['shift']());}};_0x2c46a3(++_0x179b7e);}(_0xa1d3,0x129));var _0x3a1d=function(_0xc036bb,_0x5cab81){_0xc036bb=_0xc036bb-0x0;var _0x523ab9=_0xa1d3[_0xc036bb];return _0x523ab9;};'use strict';var _=require(_0x3a1d('0x0'));var util=require(_0x3a1d('0x1'));var moment=require(_0x3a1d('0x2'));var BPromise=require(_0x3a1d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a1d('0x4'));var db=require(_0x3a1d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a1d('0x6'))(_0x3a1d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3a1d('0x8')][_0x3a1d('0x9')]({'port':0x232a});config[_0x3a1d('0xa')]=_['defaults'](config[_0x3a1d('0xa')],{'host':_0x3a1d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3a1d('0xa')]));require('./userVoiceQueueRt.socket')[_0x3a1d('0xc')](socket);function respondWithRpcPromise(_0x5e574e,_0x4310f7,_0x535534){return new BPromise(function(_0x1b484b,_0x5d550a){return client['request'](_0x5e574e,_0x535534)[_0x3a1d('0xd')](function(_0x3b190b){logger[_0x3a1d('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4310f7,_0x3a1d('0xf'));logger['debug'](_0x3a1d('0x10'),_0x4310f7,'request\x20sent',JSON[_0x3a1d('0x11')](_0x3b190b));if(_0x3b190b['error']){if(_0x3b190b[_0x3a1d('0x12')][_0x3a1d('0x13')]===0x1f4){logger[_0x3a1d('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4310f7,_0x3b190b[_0x3a1d('0x12')]['message']);return _0x5d550a(_0x3b190b['error'][_0x3a1d('0x14')]);}logger[_0x3a1d('0x12')](_0x3a1d('0x15'),_0x4310f7,_0x3b190b[_0x3a1d('0x12')]['message']);return _0x1b484b(_0x3b190b['error'][_0x3a1d('0x14')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4310f7,'request\x20sent');_0x1b484b(_0x3b190b[_0x3a1d('0x16')][_0x3a1d('0x14')]);}})[_0x3a1d('0x17')](function(_0x455d58){logger['error'](_0x3a1d('0x15'),_0x4310f7,_0x455d58);_0x5d550a(_0x455d58);});});}exports[_0x3a1d('0x18')]=function(_0x494e84){var _0x3e02f2=this;return new Promise(function(_0xdede05,_0x411230){return db[_0x3a1d('0x19')][_0x3a1d('0x1a')]({'raw':_0x494e84[_0x3a1d('0x1b')]?_0x494e84['options'][_0x3a1d('0x1c')]===undefined?!![]:![]:!![],'where':_0x494e84['options']?_0x494e84[_0x3a1d('0x1b')][_0x3a1d('0x1d')]||null:null,'attributes':[[db[_0x3a1d('0x1e')]['fn'](_0x3a1d('0x1f'),db[_0x3a1d('0x1e')]['fn']('IF',db[_0x3a1d('0x1e')][_0x3a1d('0x20')]('`paused`\x20=\x201,\x201,\x20null'))),_0x3a1d('0x21')]]})[_0x3a1d('0xd')](function(_0x3962ac){logger[_0x3a1d('0xe')](_0x3a1d('0x18'),_0x494e84);logger[_0x3a1d('0x22')]('GetVoiceQueueRtPauses',_0x494e84,JSON[_0x3a1d('0x11')](_0x3962ac));_0xdede05(_0x3962ac);})[_0x3a1d('0x17')](function(_0x64da9f){logger[_0x3a1d('0x12')](_0x3a1d('0x18'),_0x64da9f['message'],_0x494e84);_0x411230(_0x3e02f2[_0x3a1d('0x12')](0x1f4,_0x64da9f[_0x3a1d('0x14')]));});});};
\ No newline at end of file
index ceb1bef..25aaa33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37cc=['update','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x37cc,0x185));var _0xc37c=function(_0x1d37fc,_0x4db492){_0x1d37fc=_0x1d37fc-0x0;var _0x652aa6=_0x37cc[_0x1d37fc];return _0x652aa6;};'use strict';var UserVoiceQueueRtEvents=require(_0xc37c('0x0'));var events=[_0xc37c('0x1'),_0xc37c('0x2'),_0xc37c('0x3')];function createListener(_0x198089,_0x2bc194){return function(_0x48bba7){_0x2bc194['emit'](_0x198089,_0x48bba7);};}function removeListener(_0x334d3c,_0x946e3b){return function(){UserVoiceQueueRtEvents[_0xc37c('0x4')](_0x334d3c,_0x946e3b);};}exports[_0xc37c('0x5')]=function(_0x4c9dcd){for(var _0x582100=0x0,_0xd8f098=events[_0xc37c('0x6')];_0x582100<_0xd8f098;_0x582100++){var _0x3c5c63=events[_0x582100];var _0x483c8d=createListener(_0xc37c('0x7')+_0x3c5c63,_0x4c9dcd);UserVoiceQueueRtEvents['on'](_0x3c5c63,_0x483c8d);}};
\ No newline at end of file
+var _0x9f5a=['update','emit','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x40c8d0,_0x3a0fcc){var _0x20db54=function(_0x31afd4){while(--_0x31afd4){_0x40c8d0['push'](_0x40c8d0['shift']());}};_0x20db54(++_0x3a0fcc);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x2fdbd1,_0x4a2124){_0x2fdbd1=_0x2fdbd1-0x0;var _0x2e2c39=_0x9f5a[_0x2fdbd1];return _0x2e2c39;};'use strict';var UserVoiceQueueRtEvents=require(_0xa9f5('0x0'));var events=[_0xa9f5('0x1'),_0xa9f5('0x2'),_0xa9f5('0x3')];function createListener(_0x546306,_0x4268b0){return function(_0x45e3f5){_0x4268b0[_0xa9f5('0x4')](_0x546306,_0x45e3f5);};}function removeListener(_0x4eeedd,_0x20f51f){return function(){UserVoiceQueueRtEvents['removeListener'](_0x4eeedd,_0x20f51f);};}exports[_0xa9f5('0x5')]=function(_0x219e89){for(var _0x49e337=0x0,_0x6c040d=events[_0xa9f5('0x6')];_0x49e337<_0x6c040d;_0x49e337++){var _0x3f644f=events[_0x49e337];var _0x1f6c78=createListener(_0xa9f5('0x7')+_0x3f644f,_0x219e89);UserVoiceQueueRtEvents['on'](_0x3f644f,_0x1f6c78);}};
\ No newline at end of file
index 0b17bc6..6a8bd4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x9fdd0c,_0x59b230){var _0x224beb=function(_0x4a606e){while(--_0x4a606e){_0x9fdd0c['push'](_0x9fdd0c['shift']());}};_0x224beb(++_0x59b230);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x13ed4f,_0x59898b){var _0x2e7107=function(_0x552c8d){while(--_0x552c8d){_0x13ed4f['push'](_0x13ed4f['shift']());}};_0x2e7107(++_0x59898b);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 409990a..424c3e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa249=['exports','INTEGER','sequelize'];(function(_0x549b27,_0x20c0a4){var _0x5588a6=function(_0x47927b){while(--_0x47927b){_0x549b27['push'](_0x549b27['shift']());}};_0x5588a6(++_0x20c0a4);}(_0xa249,0x1ee));var _0x9a24=function(_0x278400,_0x1e0e75){_0x278400=_0x278400-0x0;var _0x62e989=_0xa249[_0x278400];return _0x62e989;};'use strict';var Sequelize=require(_0x9a24('0x0'));module[_0x9a24('0x1')]={'penalty':{'type':Sequelize[_0x9a24('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcbbf=['exports','sequelize'];(function(_0x15389f,_0x4dfdc0){var _0x2011ac=function(_0x6a00df){while(--_0x6a00df){_0x15389f['push'](_0x15389f['shift']());}};_0x2011ac(++_0x4dfdc0);}(_0xcbbf,0xdd));var _0xfcbb=function(_0x4371d1,_0x3238fd){_0x4371d1=_0x4371d1-0x0;var _0x57c13f=_0xcbbf[_0x4371d1];return _0x57c13f;};'use strict';var Sequelize=require(_0xfcbb('0x0'));module[_0xfcbb('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cc1675e..55266ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8cb=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util'];(function(_0x4d4cc5,_0x3da22a){var _0x2443c2=function(_0x105b76){while(--_0x105b76){_0x4d4cc5['push'](_0x4d4cc5['shift']());}};_0x2443c2(++_0x3da22a);}(_0xa8cb,0x172));var _0xba8c=function(_0x2292a1,_0x597a02){_0x2292a1=_0x2292a1-0x0;var _0x46fddf=_0xa8cb[_0x2292a1];return _0x46fddf;};'use strict';var _=require(_0xba8c('0x0'));var util=require(_0xba8c('0x1'));var logger=require('../../config/logger')(_0xba8c('0x2'));var moment=require('moment');var BPromise=require(_0xba8c('0x3'));var rp=require(_0xba8c('0x4'));var fs=require('fs');var path=require(_0xba8c('0x5'));var rimraf=require(_0xba8c('0x6'));var config=require(_0xba8c('0x7'));var attributes=require(_0xba8c('0x8'));module[_0xba8c('0x9')]=function(_0x59a8af,_0x17279b){return _0x59a8af[_0xba8c('0xa')](_0xba8c('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6ec=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x1feac8,_0x5a211f){var _0x498465=function(_0x12a6c0){while(--_0x12a6c0){_0x1feac8['push'](_0x1feac8['shift']());}};_0x498465(++_0x5a211f);}(_0xc6ec,0x151));var _0xcc6e=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xc6ec[_0x1bc0ae];return _0x501104;};'use strict';var _=require(_0xcc6e('0x0'));var util=require(_0xcc6e('0x1'));var logger=require(_0xcc6e('0x2'))(_0xcc6e('0x3'));var moment=require(_0xcc6e('0x4'));var BPromise=require(_0xcc6e('0x5'));var rp=require(_0xcc6e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcc6e('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc6e('0x8'));module[_0xcc6e('0x9')]=function(_0x51c5fe,_0x4f290c){return _0x51c5fe[_0xcc6e('0xa')](_0xcc6e('0xb'),attributes,{'tableName':_0xcc6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9609325..4221c0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x748c=['client','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','message','UserWhatsappQueue,\x20%s,\x20%s','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x56741c,_0x3c1c62){var _0x348f1a=function(_0x1a029c){while(--_0x1a029c){_0x56741c['push'](_0x56741c['shift']());}};_0x348f1a(++_0x3c1c62);}(_0x748c,0x115));var _0xc748=function(_0x1c6893,_0x2597cb){_0x1c6893=_0x1c6893-0x0;var _0x3f12ee=_0x748c[_0x1c6893];return _0x3f12ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc748('0x0'));var BPromise=require(_0xc748('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc748('0x2'));var db=require(_0xc748('0x3'))['db'];var utils=require(_0xc748('0x4'));var logger=require('../../config/logger')(_0xc748('0x5'));var config=require(_0xc748('0x6'));var jayson=require(_0xc748('0x7'));var client=jayson[_0xc748('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44c175,_0x1767d3,_0x1d80f0){return new BPromise(function(_0x591efe,_0x73fde8){return client[_0xc748('0x9')](_0x44c175,_0x1d80f0)[_0xc748('0xa')](function(_0x1a97e9){logger[_0xc748('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1767d3,_0xc748('0xc'));logger[_0xc748('0xd')](_0xc748('0xe'),_0x1767d3,'request\x20sent',JSON['stringify'](_0x1a97e9));if(_0x1a97e9[_0xc748('0xf')]){if(_0x1a97e9[_0xc748('0xf')]['code']===0x1f4){logger[_0xc748('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1767d3,_0x1a97e9['error']['message']);return _0x73fde8(_0x1a97e9[_0xc748('0xf')][_0xc748('0x10')]);}logger[_0xc748('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1767d3,_0x1a97e9['error'][_0xc748('0x10')]);return _0x591efe(_0x1a97e9['error'][_0xc748('0x10')]);}else{logger[_0xc748('0xb')](_0xc748('0x11'),_0x1767d3,_0xc748('0xc'));_0x591efe(_0x1a97e9['result'][_0xc748('0x10')]);}})[_0xc748('0x12')](function(_0x38b5a0){logger[_0xc748('0xf')](_0xc748('0x11'),_0x1767d3,_0x38b5a0);_0x73fde8(_0x38b5a0);});});}
\ No newline at end of file
+var _0x6c2d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring'];(function(_0x27d555,_0x475983){var _0xa1fe87=function(_0x2f0f41){while(--_0x2f0f41){_0x27d555['push'](_0x27d555['shift']());}};_0xa1fe87(++_0x475983);}(_0x6c2d,0xba));var _0xd6c2=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0x6c2d[_0x4d0662];return _0x6eea6d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6c2('0x0'));var BPromise=require(_0xd6c2('0x1'));var rs=require(_0xd6c2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6c2('0x3'))['db'];var utils=require(_0xd6c2('0x4'));var logger=require(_0xd6c2('0x5'))(_0xd6c2('0x6'));var config=require(_0xd6c2('0x7'));var jayson=require(_0xd6c2('0x8'));var client=jayson[_0xd6c2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b95b1,_0x37b20f,_0x34f640){return new BPromise(function(_0xcc59be,_0x358f4f){return client[_0xd6c2('0xa')](_0x3b95b1,_0x34f640)[_0xd6c2('0xb')](function(_0x5d84ee){logger[_0xd6c2('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x37b20f,'request\x20sent');logger['debug'](_0xd6c2('0xd'),_0x37b20f,_0xd6c2('0xe'),JSON['stringify'](_0x5d84ee));if(_0x5d84ee[_0xd6c2('0xf')]){if(_0x5d84ee['error'][_0xd6c2('0x10')]===0x1f4){logger[_0xd6c2('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x37b20f,_0x5d84ee[_0xd6c2('0xf')]['message']);return _0x358f4f(_0x5d84ee[_0xd6c2('0xf')][_0xd6c2('0x11')]);}logger[_0xd6c2('0xf')](_0xd6c2('0x12'),_0x37b20f,_0x5d84ee[_0xd6c2('0xf')][_0xd6c2('0x11')]);return _0xcc59be(_0x5d84ee[_0xd6c2('0xf')][_0xd6c2('0x11')]);}else{logger[_0xd6c2('0xc')](_0xd6c2('0x12'),_0x37b20f,_0xd6c2('0xe'));_0xcc59be(_0x5d84ee[_0xd6c2('0x13')][_0xd6c2('0x11')]);}})[_0xd6c2('0x14')](function(_0x5b623b){logger['error'](_0xd6c2('0x12'),_0x37b20f,_0x5b623b);_0x358f4f(_0x5b623b);});});}
\ No newline at end of file
index 8fb376e..79ce044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9099=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x57a88e,_0x37e892){var _0x4a56ca=function(_0x315954){while(--_0x315954){_0x57a88e['push'](_0x57a88e['shift']());}};_0x4a56ca(++_0x37e892);}(_0x9099,0x1ac));var _0x9909=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9099[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x9909('0x0'));var util=require('util');var path=require(_0x9909('0x1'));var timeout=require(_0x9909('0x2'));var express=require(_0x9909('0x3'));var router=express[_0x9909('0x4')]();var fs_extra=require(_0x9909('0x5'));var auth=require(_0x9909('0x6'));var interaction=require(_0x9909('0x7'));var config=require(_0x9909('0x8'));var controller=require(_0x9909('0x9'));router[_0x9909('0xa')]('/',auth[_0x9909('0xb')](),controller[_0x9909('0xc')]);router[_0x9909('0xa')](_0x9909('0xd'),auth['isAuthenticated'](),controller[_0x9909('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9909('0xd'),auth['isAuthenticated'](),controller[_0x9909('0xf')]);router[_0x9909('0x10')](_0x9909('0xd'),auth['isAuthenticated'](),controller[_0x9909('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xc17f=['put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x2d319b,_0x11c797){var _0xc850a1=function(_0x5a6e7c){while(--_0x5a6e7c){_0x2d319b['push'](_0x2d319b['shift']());}};_0xc850a1(++_0x11c797);}(_0xc17f,0xb8));var _0xfc17=function(_0x466ed8,_0x40a3eb){_0x466ed8=_0x466ed8-0x0;var _0x4fa2d4=_0xc17f[_0x466ed8];return _0x4fa2d4;};'use strict';var multer=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var path=require(_0xfc17('0x2'));var timeout=require(_0xfc17('0x3'));var express=require(_0xfc17('0x4'));var router=express[_0xfc17('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfc17('0x6'));var interaction=require(_0xfc17('0x7'));var config=require(_0xfc17('0x8'));var controller=require(_0xfc17('0x9'));router['get']('/',auth[_0xfc17('0xa')](),controller[_0xfc17('0xb')]);router[_0xfc17('0xc')](_0xfc17('0xd'),auth[_0xfc17('0xa')](),controller[_0xfc17('0xe')]);router[_0xfc17('0xf')]('/',auth[_0xfc17('0xa')](),controller['create']);router[_0xfc17('0x10')](_0xfc17('0xd'),auth[_0xfc17('0xa')](),controller[_0xfc17('0x11')]);router['delete']('/:id',auth[_0xfc17('0xa')](),controller[_0xfc17('0x12')]);module[_0xfc17('0x13')]=router;
\ No newline at end of file
index ebe5d49..c37ff8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa9=['sequelize','exports','STRING','name'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0x2fa9,0x144));var _0x92fa=function(_0x6ca07c,_0x5cc954){_0x6ca07c=_0x6ca07c-0x0;var _0x32f9b7=_0x2fa9[_0x6ca07c];return _0x32f9b7;};'use strict';var Sequelize=require(_0x92fa('0x0'));module[_0x92fa('0x1')]={'name':{'type':Sequelize[_0x92fa('0x2')],'unique':_0x92fa('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x92fa('0x2')]}};
\ No newline at end of file
+var _0x8838=['exports','STRING','name','sequelize'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x8838,0xeb));var _0x8883=function(_0x3fb97b,_0x27964c){_0x3fb97b=_0x3fb97b-0x0;var _0x51ddbd=_0x8838[_0x3fb97b];return _0x51ddbd;};'use strict';var Sequelize=require(_0x8883('0x0'));module[_0x8883('0x1')]={'name':{'type':Sequelize[_0x8883('0x2')],'unique':_0x8883('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8883('0x2')]}};
\ No newline at end of file
index dbc1149..69b8a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2cc=['userProfileId','autoAssociation','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','set','apply','reject','update','then','Variables','UserProfileResource','destroy','error','stack','name','send','Variable','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','length','includeAll','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x4d0ba7,_0x5342c9){var _0x1a9b6e=function(_0x365dc4){while(--_0x365dc4){_0x4d0ba7['push'](_0x4d0ba7['shift']());}};_0x1a9b6e(++_0x5342c9);}(_0xf2cc,0xe8));var _0xcf2c=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xf2cc[_0x2b10c6];return _0x3789d2;};'use strict';var emlformat=require(_0xcf2c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf2c('0x2'));var moment=require(_0xcf2c('0x3'));var BPromise=require(_0xcf2c('0x4'));var Mustache=require(_0xcf2c('0x5'));var util=require(_0xcf2c('0x6'));var path=require(_0xcf2c('0x7'));var sox=require('sox');var csv=require(_0xcf2c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf2c('0x9'));var _=require('lodash');var squel=require(_0xcf2c('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf2c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcf2c('0x8'));var querystring=require(_0xcf2c('0xc'));var Papa=require('papaparse');var Redis=require(_0xcf2c('0xd'));var authService=require(_0xcf2c('0xe'));var qs=require(_0xcf2c('0xf'));var as=require(_0xcf2c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcf2c('0x11'));var db=require(_0xcf2c('0x12'))['db'];function respondWithStatusCode(_0x4d117f,_0x11403c){_0x11403c=_0x11403c||0xcc;return function(_0x48c923){if(_0x48c923){return _0x4d117f['sendStatus'](_0x11403c);}return _0x4d117f['status'](_0x11403c)['end']();};}function respondWithResult(_0x1db334,_0x36739e){_0x36739e=_0x36739e||0xc8;return function(_0x21843e){if(_0x21843e){return _0x1db334[_0xcf2c('0x13')](_0x36739e)[_0xcf2c('0x14')](_0x21843e);}};}function respondWithFilteredResult(_0x2c2df5,_0x43b1d9){return function(_0xc1b714){if(_0xc1b714){var _0x3d4e65=typeof _0x43b1d9[_0xcf2c('0x15')]===_0xcf2c('0x16')&&typeof _0x43b1d9['limit']===_0xcf2c('0x16');var _0x3312c0=_0xc1b714['count'];var _0x40de98=_0x3d4e65?0x0:_0x43b1d9[_0xcf2c('0x15')];var _0x3b6973=_0x3d4e65?_0xc1b714['count']:_0x43b1d9[_0xcf2c('0x15')]+_0x43b1d9[_0xcf2c('0x17')];var _0x21c95c;if(_0x3b6973>=_0x3312c0){_0x3b6973=_0x3312c0;_0x21c95c=0xc8;}else{_0x21c95c=0xce;}_0x2c2df5[_0xcf2c('0x13')](_0x21c95c);return _0x2c2df5[_0xcf2c('0x18')]('Content-Range',_0x40de98+'-'+_0x3b6973+'/'+_0x3312c0)[_0xcf2c('0x14')](_0xc1b714);}return null;};}function patchUpdates(_0x5399e4){return function(_0x271a0c){try{jsonpatch[_0xcf2c('0x19')](_0x271a0c,_0x5399e4,!![]);}catch(_0x4d4c0e){return BPromise[_0xcf2c('0x1a')](_0x4d4c0e);}return _0x271a0c['save']();};}function saveUpdates(_0x416b0c,_0x3c317b){return function(_0xcb48a){if(_0xcb48a){return _0xcb48a[_0xcf2c('0x1b')](_0x416b0c)['then'](function(_0x38da81){return _0x38da81;});}return null;};}function removeEntity(_0x5bb679,_0x49043f){return function(_0x3253e7){if(_0x3253e7){return _0x3253e7['destroy']()[_0xcf2c('0x1c')](function(){var _0x57bdf1=_0x3253e7['get']({'plain':!![]});var _0x3dfea0=_0xcf2c('0x1d');return db[_0xcf2c('0x1e')][_0xcf2c('0x1f')]({'where':{'type':_0x3dfea0,'resourceId':_0x57bdf1['id']}})[_0xcf2c('0x1c')](function(){return _0x3253e7;});})[_0xcf2c('0x1c')](function(){_0x5bb679[_0xcf2c('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df230,_0x5307f5){return function(_0x45cc34){if(!_0x45cc34){_0x1df230['sendStatus'](0x194);}return _0x45cc34;};}function handleError(_0x30fef0,_0x418032){_0x418032=_0x418032||0x1f4;return function(_0x27ed95){logger[_0xcf2c('0x20')](_0x27ed95[_0xcf2c('0x21')]);if(_0x27ed95[_0xcf2c('0x22')]){delete _0x27ed95[_0xcf2c('0x22')];}_0x30fef0['status'](_0x418032)[_0xcf2c('0x23')](_0x27ed95);};}exports['index']=function(_0x7a3d35,_0x345498){var _0x280cfb={},_0x35c9af={},_0x245cdb={'count':0x0,'rows':[]};var _0x1f1d3f=_['map'](db[_0xcf2c('0x24')][_0xcf2c('0x25')],function(_0x2e6ed4){return{'name':_0x2e6ed4[_0xcf2c('0x26')],'type':_0x2e6ed4[_0xcf2c('0x27')][_0xcf2c('0x28')]};});_0x35c9af[_0xcf2c('0x29')]=_[_0xcf2c('0x2a')](_0x1f1d3f,_0xcf2c('0x22'));_0x35c9af[_0xcf2c('0x2b')]=_[_0xcf2c('0x2c')](_0x7a3d35[_0xcf2c('0x2b')]);_0x35c9af[_0xcf2c('0x2d')]=_[_0xcf2c('0x2e')](_0x35c9af['model'],_0x35c9af[_0xcf2c('0x2b')]);_0x280cfb[_0xcf2c('0x2f')]=_[_0xcf2c('0x2e')](_0x35c9af['model'],qs[_0xcf2c('0x30')](_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x30')]));_0x280cfb['attributes']=_0x280cfb[_0xcf2c('0x2f')]['length']?_0x280cfb[_0xcf2c('0x2f')]:_0x35c9af[_0xcf2c('0x29')];if(!_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x31')]('nolimit')){_0x280cfb['limit']=qs[_0xcf2c('0x17')](_0x7a3d35[_0xcf2c('0x2b')]['limit']);_0x280cfb[_0xcf2c('0x15')]=qs[_0xcf2c('0x15')](_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x15')]);}_0x280cfb[_0xcf2c('0x32')]=qs[_0xcf2c('0x33')](_0x7a3d35['query'][_0xcf2c('0x33')]);_0x280cfb[_0xcf2c('0x34')]=qs[_0xcf2c('0x2d')](_['pick'](_0x7a3d35['query'],_0x35c9af[_0xcf2c('0x2d')]),_0x1f1d3f);if(_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x35')]){_0x280cfb[_0xcf2c('0x34')]=_[_0xcf2c('0x36')](_0x280cfb['where'],{'$or':_['map'](_0x1f1d3f,function(_0x463752){if(_0x463752[_0xcf2c('0x27')]!==_0xcf2c('0x37')){var _0x513021={};_0x513021[_0x463752[_0xcf2c('0x22')]]={'$like':'%'+_0x7a3d35[_0xcf2c('0x2b')][_0xcf2c('0x35')]+'%'};return _0x513021;}})});}_0x280cfb=_[_0xcf2c('0x36')]({},_0x280cfb,_0x7a3d35[_0xcf2c('0x38')]);var _0x4d4a60={'where':_0x280cfb[_0xcf2c('0x34')]};return db[_0xcf2c('0x24')][_0xcf2c('0x39')](_0x4d4a60)[_0xcf2c('0x1c')](function(_0x37bdb9){_0x245cdb['count']=_0x37bdb9;if(_0x7a3d35[_0xcf2c('0x2b')]['includeAll']){_0x280cfb['include']=[{'all':!![]}];}return db[_0xcf2c('0x24')][_0xcf2c('0x3a')](_0x280cfb);})['then'](function(_0x5be8be){_0x245cdb[_0xcf2c('0x3b')]=_0x5be8be;return _0x245cdb;})['then'](respondWithFilteredResult(_0x345498,_0x280cfb))[_0xcf2c('0x3c')](handleError(_0x345498,null));};exports[_0xcf2c('0x3d')]=function(_0x2ab50d,_0x23234d){var _0x18e51c={'raw':!![],'where':{'id':_0x2ab50d['params']['id']}},_0x438d6f={};_0x438d6f['model']=_[_0xcf2c('0x2c')](db['Variable']['rawAttributes']);_0x438d6f[_0xcf2c('0x2b')]=_['keys'](_0x2ab50d[_0xcf2c('0x2b')]);_0x438d6f[_0xcf2c('0x2d')]=_[_0xcf2c('0x2e')](_0x438d6f[_0xcf2c('0x29')],_0x438d6f[_0xcf2c('0x2b')]);_0x18e51c[_0xcf2c('0x2f')]=_[_0xcf2c('0x2e')](_0x438d6f[_0xcf2c('0x29')],qs['fields'](_0x2ab50d['query'][_0xcf2c('0x30')]));_0x18e51c[_0xcf2c('0x2f')]=_0x18e51c[_0xcf2c('0x2f')][_0xcf2c('0x3e')]?_0x18e51c['attributes']:_0x438d6f[_0xcf2c('0x29')];if(_0x2ab50d[_0xcf2c('0x2b')][_0xcf2c('0x3f')]){_0x18e51c[_0xcf2c('0x40')]=[{'all':!![]}];}_0x18e51c=_['merge']({},_0x18e51c,_0x2ab50d[_0xcf2c('0x38')]);return db[_0xcf2c('0x24')][_0xcf2c('0x41')](_0x18e51c)['then'](handleEntityNotFound(_0x23234d,null))['then'](respondWithResult(_0x23234d,null))['catch'](handleError(_0x23234d,null));};exports[_0xcf2c('0x42')]=function(_0x4f5b89,_0x311089){return db[_0xcf2c('0x24')][_0xcf2c('0x42')](_0x4f5b89['body'],{})[_0xcf2c('0x1c')](function(_0x7084db){var _0x301fe9=_0x4f5b89[_0xcf2c('0x43')][_0xcf2c('0x44')]({'plain':!![]});if(!_0x301fe9)throw new Error(_0xcf2c('0x45'));if(_0x301fe9[_0xcf2c('0x46')]==='user'){var _0x316139=_0x7084db[_0xcf2c('0x44')]({'plain':!![]});var _0x5d253e=_0xcf2c('0x1d');return db[_0xcf2c('0x47')][_0xcf2c('0x41')]({'where':{'name':_0x5d253e,'userProfileId':_0x301fe9[_0xcf2c('0x48')]},'raw':!![]})[_0xcf2c('0x1c')](function(_0x34084d){if(_0x34084d&&_0x34084d[_0xcf2c('0x49')]===0x0){return db[_0xcf2c('0x1e')][_0xcf2c('0x42')]({'name':_0x316139['name'],'resourceId':_0x316139['id'],'type':_0x34084d[_0xcf2c('0x22')],'sectionId':_0x34084d['id']},{})['then'](function(){return _0x7084db;});}else{return _0x7084db;}})[_0xcf2c('0x3c')](function(_0x5c1b70){logger[_0xcf2c('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c1b70);throw _0x5c1b70;});}return _0x7084db;})[_0xcf2c('0x1c')](respondWithResult(_0x311089,0xc9))[_0xcf2c('0x3c')](handleError(_0x311089,null));};exports['update']=function(_0x39989f,_0x956a05){if(_0x39989f[_0xcf2c('0x4a')]['id']){delete _0x39989f['body']['id'];}return db[_0xcf2c('0x24')][_0xcf2c('0x41')]({'where':{'id':_0x39989f['params']['id']}})[_0xcf2c('0x1c')](handleEntityNotFound(_0x956a05,null))[_0xcf2c('0x1c')](saveUpdates(_0x39989f['body'],null))[_0xcf2c('0x1c')](respondWithResult(_0x956a05,null))[_0xcf2c('0x3c')](handleError(_0x956a05,null));};exports[_0xcf2c('0x1f')]=function(_0xe46830,_0x46bb37){return db[_0xcf2c('0x24')]['find']({'where':{'id':_0xe46830[_0xcf2c('0x4b')]['id']}})[_0xcf2c('0x1c')](handleEntityNotFound(_0x46bb37,null))[_0xcf2c('0x1c')](removeEntity(_0x46bb37,null))[_0xcf2c('0x3c')](handleError(_0x46bb37,null));};
\ No newline at end of file
+var _0xa8ef=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','offset','undefined','count','limit','json','apply','reject','save','then','get','Variables','UserProfileResource','destroy','sendStatus','send','index','map','Variable','rawAttributes','type','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1d57f2,_0x11cd04){var _0x25b058=function(_0x10ab91){while(--_0x10ab91){_0x1d57f2['push'](_0x1d57f2['shift']());}};_0x25b058(++_0x11cd04);}(_0xa8ef,0x183));var _0xfa8e=function(_0x4aee91,_0x1c7b11){_0x4aee91=_0x4aee91-0x0;var _0x1fbc74=_0xa8ef[_0x4aee91];return _0x1fbc74;};'use strict';var emlformat=require(_0xfa8e('0x0'));var rimraf=require(_0xfa8e('0x1'));var zipdir=require(_0xfa8e('0x2'));var jsonpatch=require(_0xfa8e('0x3'));var rp=require(_0xfa8e('0x4'));var moment=require(_0xfa8e('0x5'));var BPromise=require(_0xfa8e('0x6'));var Mustache=require('mustache');var util=require(_0xfa8e('0x7'));var path=require(_0xfa8e('0x8'));var sox=require(_0xfa8e('0x9'));var csv=require(_0xfa8e('0xa'));var ejs=require(_0xfa8e('0xb'));var fs=require('fs');var fs_extra=require(_0xfa8e('0xc'));var _=require(_0xfa8e('0xd'));var squel=require(_0xfa8e('0xe'));var crypto=require(_0xfa8e('0xf'));var jsforce=require(_0xfa8e('0x10'));var deskjs=require(_0xfa8e('0x11'));var toCsv=require(_0xfa8e('0xa'));var querystring=require('querystring');var Papa=require(_0xfa8e('0x12'));var Redis=require('ioredis');var authService=require(_0xfa8e('0x13'));var qs=require(_0xfa8e('0x14'));var as=require(_0xfa8e('0x15'));var hardwareService=require(_0xfa8e('0x16'));var logger=require(_0xfa8e('0x17'))(_0xfa8e('0x18'));var utils=require(_0xfa8e('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d0e9,_0x2cf622){_0x2cf622=_0x2cf622||0xcc;return function(_0x4db7b7){if(_0x4db7b7){return _0x13d0e9['sendStatus'](_0x2cf622);}return _0x13d0e9['status'](_0x2cf622)[_0xfa8e('0x1a')]();};}function respondWithResult(_0x3cfeb9,_0x3ac889){_0x3ac889=_0x3ac889||0xc8;return function(_0x5c3c91){if(_0x5c3c91){return _0x3cfeb9[_0xfa8e('0x1b')](_0x3ac889)['json'](_0x5c3c91);}};}function respondWithFilteredResult(_0x446e73,_0x230a6e){return function(_0x27e114){if(_0x27e114){var _0x5725ef=typeof _0x230a6e[_0xfa8e('0x1c')]===_0xfa8e('0x1d')&&typeof _0x230a6e['limit']===_0xfa8e('0x1d');var _0x4c542c=_0x27e114[_0xfa8e('0x1e')];var _0x24e642=_0x5725ef?0x0:_0x230a6e[_0xfa8e('0x1c')];var _0x178661=_0x5725ef?_0x27e114[_0xfa8e('0x1e')]:_0x230a6e[_0xfa8e('0x1c')]+_0x230a6e[_0xfa8e('0x1f')];var _0x9881d8;if(_0x178661>=_0x4c542c){_0x178661=_0x4c542c;_0x9881d8=0xc8;}else{_0x9881d8=0xce;}_0x446e73[_0xfa8e('0x1b')](_0x9881d8);return _0x446e73['set']('Content-Range',_0x24e642+'-'+_0x178661+'/'+_0x4c542c)[_0xfa8e('0x20')](_0x27e114);}return null;};}function patchUpdates(_0x529076){return function(_0x38cdd5){try{jsonpatch[_0xfa8e('0x21')](_0x38cdd5,_0x529076,!![]);}catch(_0xac5bee){return BPromise[_0xfa8e('0x22')](_0xac5bee);}return _0x38cdd5[_0xfa8e('0x23')]();};}function saveUpdates(_0x3e0435,_0x4255f2){return function(_0x8bd412){if(_0x8bd412){return _0x8bd412['update'](_0x3e0435)[_0xfa8e('0x24')](function(_0x1db51b){return _0x1db51b;});}return null;};}function removeEntity(_0x692b90,_0x451c8e){return function(_0x527a7e){if(_0x527a7e){return _0x527a7e['destroy']()['then'](function(){var _0x57bd25=_0x527a7e[_0xfa8e('0x25')]({'plain':!![]});var _0x439268=_0xfa8e('0x26');return db[_0xfa8e('0x27')][_0xfa8e('0x28')]({'where':{'type':_0x439268,'resourceId':_0x57bd25['id']}})[_0xfa8e('0x24')](function(){return _0x527a7e;});})[_0xfa8e('0x24')](function(){_0x692b90[_0xfa8e('0x1b')](0xcc)[_0xfa8e('0x1a')]();});}};}function handleEntityNotFound(_0x11f239,_0x38e2e2){return function(_0x247c9c){if(!_0x247c9c){_0x11f239[_0xfa8e('0x29')](0x194);}return _0x247c9c;};}function handleError(_0x40bb0a,_0x1eba00){_0x1eba00=_0x1eba00||0x1f4;return function(_0x2402ad){logger['error'](_0x2402ad['stack']);if(_0x2402ad['name']){delete _0x2402ad['name'];}_0x40bb0a[_0xfa8e('0x1b')](_0x1eba00)[_0xfa8e('0x2a')](_0x2402ad);};}exports[_0xfa8e('0x2b')]=function(_0x2e7d9a,_0x8df51){var _0x24e49e={},_0x341f0b={},_0x53d0ab={'count':0x0,'rows':[]};var _0xe62334=_[_0xfa8e('0x2c')](db[_0xfa8e('0x2d')][_0xfa8e('0x2e')],function(_0x3e7769){return{'name':_0x3e7769['fieldName'],'type':_0x3e7769[_0xfa8e('0x2f')]['key']};});_0x341f0b['model']=_[_0xfa8e('0x2c')](_0xe62334,_0xfa8e('0x30'));_0x341f0b[_0xfa8e('0x31')]=_['keys'](_0x2e7d9a[_0xfa8e('0x31')]);_0x341f0b[_0xfa8e('0x32')]=_[_0xfa8e('0x33')](_0x341f0b[_0xfa8e('0x34')],_0x341f0b[_0xfa8e('0x31')]);_0x24e49e[_0xfa8e('0x35')]=_[_0xfa8e('0x33')](_0x341f0b[_0xfa8e('0x34')],qs[_0xfa8e('0x36')](_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x36')]));_0x24e49e['attributes']=_0x24e49e[_0xfa8e('0x35')]['length']?_0x24e49e[_0xfa8e('0x35')]:_0x341f0b['model'];if(!_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x37')](_0xfa8e('0x38'))){_0x24e49e[_0xfa8e('0x1f')]=qs[_0xfa8e('0x1f')](_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x1f')]);_0x24e49e[_0xfa8e('0x1c')]=qs['offset'](_0x2e7d9a['query'][_0xfa8e('0x1c')]);}_0x24e49e['order']=qs[_0xfa8e('0x39')](_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x39')]);_0x24e49e[_0xfa8e('0x3a')]=qs[_0xfa8e('0x32')](_[_0xfa8e('0x3b')](_0x2e7d9a[_0xfa8e('0x31')],_0x341f0b[_0xfa8e('0x32')]),_0xe62334);if(_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x3c')]){_0x24e49e[_0xfa8e('0x3a')]=_[_0xfa8e('0x3d')](_0x24e49e[_0xfa8e('0x3a')],{'$or':_[_0xfa8e('0x2c')](_0xe62334,function(_0x39f089){if(_0x39f089[_0xfa8e('0x2f')]!=='VIRTUAL'){var _0x5e9cea={};_0x5e9cea[_0x39f089[_0xfa8e('0x30')]]={'$like':'%'+_0x2e7d9a['query']['filter']+'%'};return _0x5e9cea;}})});}_0x24e49e=_['merge']({},_0x24e49e,_0x2e7d9a[_0xfa8e('0x3e')]);var _0x495d1f={'where':_0x24e49e[_0xfa8e('0x3a')]};return db[_0xfa8e('0x2d')]['count'](_0x495d1f)[_0xfa8e('0x24')](function(_0x4f0ea1){_0x53d0ab[_0xfa8e('0x1e')]=_0x4f0ea1;if(_0x2e7d9a[_0xfa8e('0x31')][_0xfa8e('0x3f')]){_0x24e49e[_0xfa8e('0x40')]=[{'all':!![]}];}return db[_0xfa8e('0x2d')][_0xfa8e('0x41')](_0x24e49e);})[_0xfa8e('0x24')](function(_0x536f9d){_0x53d0ab[_0xfa8e('0x42')]=_0x536f9d;return _0x53d0ab;})[_0xfa8e('0x24')](respondWithFilteredResult(_0x8df51,_0x24e49e))[_0xfa8e('0x43')](handleError(_0x8df51,null));};exports['show']=function(_0x4062a6,_0x5d2f9d){var _0xf187e1={'raw':!![],'where':{'id':_0x4062a6[_0xfa8e('0x44')]['id']}},_0x576d3b={};_0x576d3b[_0xfa8e('0x34')]=_[_0xfa8e('0x45')](db['Variable'][_0xfa8e('0x2e')]);_0x576d3b[_0xfa8e('0x31')]=_['keys'](_0x4062a6[_0xfa8e('0x31')]);_0x576d3b[_0xfa8e('0x32')]=_[_0xfa8e('0x33')](_0x576d3b['model'],_0x576d3b['query']);_0xf187e1['attributes']=_[_0xfa8e('0x33')](_0x576d3b[_0xfa8e('0x34')],qs[_0xfa8e('0x36')](_0x4062a6[_0xfa8e('0x31')]['fields']));_0xf187e1[_0xfa8e('0x35')]=_0xf187e1[_0xfa8e('0x35')][_0xfa8e('0x46')]?_0xf187e1[_0xfa8e('0x35')]:_0x576d3b[_0xfa8e('0x34')];if(_0x4062a6[_0xfa8e('0x31')][_0xfa8e('0x3f')]){_0xf187e1[_0xfa8e('0x40')]=[{'all':!![]}];}_0xf187e1=_[_0xfa8e('0x3d')]({},_0xf187e1,_0x4062a6[_0xfa8e('0x3e')]);return db[_0xfa8e('0x2d')][_0xfa8e('0x47')](_0xf187e1)[_0xfa8e('0x24')](handleEntityNotFound(_0x5d2f9d,null))[_0xfa8e('0x24')](respondWithResult(_0x5d2f9d,null))[_0xfa8e('0x43')](handleError(_0x5d2f9d,null));};exports['create']=function(_0x2ce942,_0x1ced51){return db['Variable'][_0xfa8e('0x48')](_0x2ce942['body'],{})[_0xfa8e('0x24')](function(_0x32246d){var _0x3f23be=_0x2ce942[_0xfa8e('0x49')][_0xfa8e('0x25')]({'plain':!![]});if(!_0x3f23be)throw new Error(_0xfa8e('0x4a'));if(_0x3f23be[_0xfa8e('0x4b')]===_0xfa8e('0x49')){var _0x32a183=_0x32246d['get']({'plain':!![]});var _0x590bf5=_0xfa8e('0x26');return db[_0xfa8e('0x4c')]['find']({'where':{'name':_0x590bf5,'userProfileId':_0x3f23be[_0xfa8e('0x4d')]},'raw':!![]})[_0xfa8e('0x24')](function(_0x7a6403){if(_0x7a6403&&_0x7a6403['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a183[_0xfa8e('0x30')],'resourceId':_0x32a183['id'],'type':_0x7a6403[_0xfa8e('0x30')],'sectionId':_0x7a6403['id']},{})[_0xfa8e('0x24')](function(){return _0x32246d;});}else{return _0x32246d;}})[_0xfa8e('0x43')](function(_0x2057a3){logger[_0xfa8e('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2057a3);throw _0x2057a3;});}return _0x32246d;})[_0xfa8e('0x24')](respondWithResult(_0x1ced51,0xc9))[_0xfa8e('0x43')](handleError(_0x1ced51,null));};exports[_0xfa8e('0x4f')]=function(_0x25969a,_0x486597){if(_0x25969a[_0xfa8e('0x50')]['id']){delete _0x25969a[_0xfa8e('0x50')]['id'];}return db[_0xfa8e('0x2d')]['find']({'where':{'id':_0x25969a[_0xfa8e('0x44')]['id']}})[_0xfa8e('0x24')](handleEntityNotFound(_0x486597,null))[_0xfa8e('0x24')](saveUpdates(_0x25969a[_0xfa8e('0x50')],null))[_0xfa8e('0x24')](respondWithResult(_0x486597,null))[_0xfa8e('0x43')](handleError(_0x486597,null));};exports[_0xfa8e('0x28')]=function(_0x243166,_0x4a759a){return db[_0xfa8e('0x2d')]['find']({'where':{'id':_0x243166[_0xfa8e('0x44')]['id']}})[_0xfa8e('0x24')](handleEntityNotFound(_0x4a759a,null))[_0xfa8e('0x24')](removeEntity(_0x4a759a,null))['catch'](handleError(_0x4a759a,null));};
\ No newline at end of file
index 93867b1..9544d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8486=['moment','request-promise','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','util','../../config/logger','api'];(function(_0x22593a,_0x58ddca){var _0x3a0488=function(_0x392a7e){while(--_0x392a7e){_0x22593a['push'](_0x22593a['shift']());}};_0x3a0488(++_0x58ddca);}(_0x8486,0x1b4));var _0x6848=function(_0x3f2ee0,_0x5959c7){_0x3f2ee0=_0x3f2ee0-0x0;var _0x5bf957=_0x8486[_0x3f2ee0];return _0x5bf957;};'use strict';var _=require(_0x6848('0x0'));var util=require(_0x6848('0x1'));var logger=require(_0x6848('0x2'))(_0x6848('0x3'));var moment=require(_0x6848('0x4'));var BPromise=require('bluebird');var rp=require(_0x6848('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6848('0x6'));var config=require(_0x6848('0x7'));var attributes=require('./variable.attributes');module[_0x6848('0x8')]=function(_0x30421a,_0x360f78){return _0x30421a['define'](_0x6848('0x9'),attributes,{'tableName':_0x6848('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbfff=['Variable','lodash','../../config/logger','api','bluebird','request-promise','path','./variable.attributes','define'];(function(_0x566039,_0x58b5b5){var _0x36e743=function(_0x3baa89){while(--_0x3baa89){_0x566039['push'](_0x566039['shift']());}};_0x36e743(++_0x58b5b5);}(_0xbfff,0xb5));var _0xfbff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbfff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfbff('0x0'));var util=require('util');var logger=require(_0xfbff('0x1'))(_0xfbff('0x2'));var moment=require('moment');var BPromise=require(_0xfbff('0x3'));var rp=require(_0xfbff('0x4'));var fs=require('fs');var path=require(_0xfbff('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfbff('0x6'));module['exports']=function(_0x5e9794,_0x2a4056){return _0x5e9794[_0xfbff('0x7')](_0xfbff('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b035a53..b4a5022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x1f0aa9,_0x3852ff){var _0x23cda4=function(_0x4a3ed8){while(--_0x4a3ed8){_0x1f0aa9['push'](_0x1f0aa9['shift']());}};_0x23cda4(++_0x3852ff);}(_0x6aa7,0x178));var _0x76aa=function(_0x33bf5a,_0x416617){_0x33bf5a=_0x33bf5a-0x0;var _0x1d486e=_0x6aa7[_0x33bf5a];return _0x1d486e;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});};
\ No newline at end of file
+var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x892bb7,_0x5c8b52){var _0x542698=function(_0x22a8c8){while(--_0x22a8c8){_0x892bb7['push'](_0x892bb7['shift']());}};_0x542698(++_0x5c8b52);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});};
\ No newline at end of file
index 8517f36..e11b4fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8658=['get','/reset','reset','pull','restart','/migrations','Router','../../components/auth/service','./version.controller','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x157fea,_0x1a86fd){var _0x5c508b=function(_0x3a5663){while(--_0x3a5663){_0x157fea['push'](_0x157fea['shift']());}};_0x5c508b(++_0x1a86fd);}(_0x8658,0x124));var _0x8865=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8658[_0x21a9d9];return _0x46adce;};'use strict';var express=require('express');var router=express[_0x8865('0x0')]();var auth=require(_0x8865('0x1'));var controller=require(_0x8865('0x2'));router['get']('/',controller['index']);router['get'](_0x8865('0x3'),auth[_0x8865('0x4')](),auth[_0x8865('0x5')](),controller[_0x8865('0x6')]);router[_0x8865('0x7')](_0x8865('0x8'),auth['isAuthenticated'](),auth[_0x8865('0x5')](),controller[_0x8865('0x9')]);router[_0x8865('0x7')]('/pull',auth[_0x8865('0x4')](),auth['canUpdate'](),controller[_0x8865('0xa')]);router[_0x8865('0x7')]('/restart',auth[_0x8865('0x4')](),controller[_0x8865('0xb')]);router[_0x8865('0x7')](_0x8865('0xc'),controller['migrations']);module['exports']=router;
\ No newline at end of file
+var _0x0fa7=['migrations','exports','express','./version.controller','get','index','isAuthenticated','fetch','canUpdate','reset','pull','/restart','restart','/migrations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0fa7,0x18a));var _0x70fa=function(_0xa72a90,_0x3d2ff5){_0xa72a90=_0xa72a90-0x0;var _0x264a45=_0x0fa7[_0xa72a90];return _0x264a45;};'use strict';var express=require(_0x70fa('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x70fa('0x1'));router[_0x70fa('0x2')]('/',controller[_0x70fa('0x3')]);router['get']('/fetch',auth[_0x70fa('0x4')](),auth['canUpdate'](),controller[_0x70fa('0x5')]);router[_0x70fa('0x2')]('/reset',auth[_0x70fa('0x4')](),auth[_0x70fa('0x6')](),controller[_0x70fa('0x7')]);router[_0x70fa('0x2')]('/pull',auth['isAuthenticated'](),auth[_0x70fa('0x6')](),controller[_0x70fa('0x8')]);router[_0x70fa('0x2')](_0x70fa('0x9'),auth[_0x70fa('0x4')](),controller[_0x70fa('0xa')]);router['get'](_0x70fa('0xb'),controller[_0x70fa('0xc')]);module[_0x70fa('0xd')]=router;
\ No newline at end of file
index 4adf832..5006e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff21=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','child_process','exec','../../config/environment','../../config/logger','simple-git','root','index','exports','version','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','migrations','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface'];(function(_0x496436,_0xd549cc){var _0x24ff50=function(_0xd76a68){while(--_0xd76a68){_0x496436['push'](_0x496436['shift']());}};_0x24ff50(++_0xd549cc);}(_0xff21,0xda));var _0x1ff2=function(_0x5e0664,_0x4307dc){_0x5e0664=_0x5e0664-0x0;var _0x51ed02=_0xff21[_0x5e0664];return _0x51ed02;};'use strict';var Umzug=require(_0x1ff2('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x1ff2('0x1'));var pkginfo=require(_0x1ff2('0x2'))(module,'version');var compareVersions=require('compare-versions');var exec=require(_0x1ff2('0x3'))[_0x1ff2('0x4')];var db=require('../../mysqldb')['db'];var config=require(_0x1ff2('0x5'));var pm2=require('../../config/pm2');var logger=require(_0x1ff2('0x6'))('update');var git=require(_0x1ff2('0x7'))(config[_0x1ff2('0x8')]);exports[_0x1ff2('0x9')]=function(_0x517fcb,_0x5cde43){var _0x18d0c3={'current':module[_0x1ff2('0xa')][_0x1ff2('0xb')],'phonebar':0x2};if(_0x517fcb[_0x1ff2('0xc')]&&_0x517fcb[_0x1ff2('0xc')][_0x1ff2('0xd')]){return git[_0x1ff2('0xe')]()[_0x1ff2('0xf')](function(_0x220b84,_0x1355c5){_0x18d0c3['latest']=(_0x220b84?module[_0x1ff2('0xa')][_0x1ff2('0xb')]:_0x1355c5['latest'])||_0x1ff2('0x10');return _0x5cde43['status'](0xc8)[_0x1ff2('0x11')](_0x18d0c3);});}else{return _0x5cde43[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')](_0x18d0c3);}};exports[_0x1ff2('0xe')]=function(_0x1b3c83,_0x23ef1c){return git[_0x1ff2('0xe')]([_0x1ff2('0x13'),_0x1ff2('0x14')],function(_0x32efb2){if(_0x32efb2){logger[_0x1ff2('0x15')](_0x32efb2);return _0x23ef1c['status'](0x1f4)['json'](_0x32efb2);}logger[_0x1ff2('0x16')]('git\x20fetch');return _0x23ef1c[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x17')});});};exports['reset']=function(_0x3ad2d8,_0x2f70f8){return git[_0x1ff2('0x18')]([_0x1ff2('0x19'),_0x1ff2('0x1a')],function(_0x543b5c){if(_0x543b5c){logger[_0x1ff2('0x15')](_0x543b5c);return _0x2f70f8['status'](0x1f4)[_0x1ff2('0x11')](_0x543b5c);}logger[_0x1ff2('0x16')](_0x1ff2('0x1b'));return _0x2f70f8[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x1c')});});};exports[_0x1ff2('0x1d')]=function(_0x26edb9,_0x287a65){exec(_0x1ff2('0x1e'),function(_0x313ea9,_0xfd0cad,_0x5152b6){logger[_0x1ff2('0x16')](_0xfd0cad);logger[_0x1ff2('0x16')](_0x5152b6);if(_0x313ea9){logger['error'](_0x313ea9);return _0x287a65['status'](0x1f4)['json'](_0x313ea9);}return _0x287a65[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0xfd0cad});});};exports[_0x1ff2('0x1f')]=function(_0x2ea1bd,_0x501d74){return pm2[_0x1ff2('0x1f')](_0x1ff2('0x20'))[_0x1ff2('0x21')](function(_0x14c398){logger[_0x1ff2('0x16')]('pm2\x20restart\x20motion\x20%s',_0x14c398);return _0x501d74[_0x1ff2('0x12')](0xc8)['json']({'output':_0x1ff2('0x22')});})[_0x1ff2('0x23')](function(_0x26ea92){logger['error'](_0x26ea92);return _0x501d74['status'](0x1f4)[_0x1ff2('0x11')](_0x26ea92);});};exports['migrations']=function(_0x34fbf3,_0x1c1249){var _0x1b9afd=fs[_0x1ff2('0x24')](path[_0x1ff2('0x25')](config[_0x1ff2('0x8')],'server',_0x1ff2('0x26')));var _0x26b6ef=[];for(var _0x1c854e=0x0;_0x1c854e<_0x1b9afd['length'];_0x1c854e++){var _0x38ac52=_0x1b9afd[_0x1c854e][_0x1ff2('0x27')](_0x1ff2('0x28'),'');if(compareVersions(module[_0x1ff2('0xa')][_0x1ff2('0xb')],_0x38ac52)===-0x1){_0x26b6ef[_0x1ff2('0x29')](_0x38ac52);}}if(_0x26b6ef[_0x1ff2('0x2a')]){var _0x297b9a=_0x26b6ef[_0x1ff2('0x2b')](compareVersions);var _0x1631c4=new Umzug({'storage':_0x1ff2('0x2c'),'storageOptions':{'model':db[_0x1ff2('0x2d')],'modelName':_0x1ff2('0x2d'),'columnName':'version'},'migrations':{'params':[db[_0x1ff2('0x2c')][_0x1ff2('0x2e')](),db[_0x1ff2('0x2c')][_0x1ff2('0x2f')],function(){throw new Error(_0x1ff2('0x30'));}],'path':path[_0x1ff2('0x25')](config['root'],'server',_0x1ff2('0x26')),'pattern':/\.js$/}});_0x1631c4['up']({'migrations':_[_0x1ff2('0x31')](_0x297b9a,function(_0x3ec84b){return _0x3ec84b+_0x1ff2('0x28');})})[_0x1ff2('0x21')](function(){return _0x1c1249['status'](0xc8)[_0x1ff2('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x1ff2('0xa')][_0x1ff2('0xb')]+_0x1ff2('0x32')+_['last'](_0x297b9a),'migrations':_['join'](_0x297b9a)});})[_0x1ff2('0x23')](function(_0x21f509){if(_0x21f509 instanceof db[_0x1ff2('0x2c')][_0x1ff2('0x33')]){return _0x1c1249[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x34')});}else{return _0x1c1249[_0x1ff2('0x12')](0x1f4)[_0x1ff2('0x11')](_0x21f509);}});}else{return _0x1c1249[_0x1ff2('0x12')](0xc8)[_0x1ff2('0x11')]({'output':_0x1ff2('0x34')});}};
\ No newline at end of file
+var _0x7816=['migrations','readdirSync','join','server','length','push','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','exports','query','latest','fetch','2.0.0','status','json','origin','git\x20fetch','git\x20fetch\x20origin\x20master','reset','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch'];(function(_0x31db02,_0x330986){var _0x1b2e55=function(_0x121a87){while(--_0x121a87){_0x31db02['push'](_0x31db02['shift']());}};_0x1b2e55(++_0x330986);}(_0x7816,0x1db));var _0x6781=function(_0x11dcf0,_0x4eb137){_0x11dcf0=_0x11dcf0-0x0;var _0x4f9831=_0x7816[_0x11dcf0];return _0x4f9831;};'use strict';var Umzug=require(_0x6781('0x0'));var path=require(_0x6781('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require('pkginfo')(module,_0x6781('0x2'));var compareVersions=require('compare-versions');var exec=require(_0x6781('0x3'))['exec'];var db=require(_0x6781('0x4'))['db'];var config=require(_0x6781('0x5'));var pm2=require(_0x6781('0x6'));var logger=require(_0x6781('0x7'))('update');var git=require(_0x6781('0x8'))(config[_0x6781('0x9')]);exports['index']=function(_0x4bb3ff,_0x4e3b68){var _0xf8fda7={'current':module[_0x6781('0xa')][_0x6781('0x2')],'phonebar':0x2};if(_0x4bb3ff[_0x6781('0xb')]&&_0x4bb3ff[_0x6781('0xb')][_0x6781('0xc')]){return git[_0x6781('0xd')]()['tags'](function(_0x2bf3f6,_0x393892){_0xf8fda7['latest']=(_0x2bf3f6?module[_0x6781('0xa')]['version']:_0x393892[_0x6781('0xc')])||_0x6781('0xe');return _0x4e3b68[_0x6781('0xf')](0xc8)[_0x6781('0x10')](_0xf8fda7);});}else{return _0x4e3b68[_0x6781('0xf')](0xc8)['json'](_0xf8fda7);}};exports[_0x6781('0xd')]=function(_0x509045,_0x2ae3d0){return git[_0x6781('0xd')]([_0x6781('0x11'),'master'],function(_0x19e337){if(_0x19e337){logger['error'](_0x19e337);return _0x2ae3d0['status'](0x1f4)[_0x6781('0x10')](_0x19e337);}logger['info'](_0x6781('0x12'));return _0x2ae3d0[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':_0x6781('0x13')});});};exports[_0x6781('0x14')]=function(_0x2217a1,_0x51a5b0){return git[_0x6781('0x14')](['--hard','FETCH_HEAD'],function(_0x27805c){if(_0x27805c){logger[_0x6781('0x15')](_0x27805c);return _0x51a5b0[_0x6781('0xf')](0x1f4)[_0x6781('0x10')](_0x27805c);}logger[_0x6781('0x16')](_0x6781('0x17'));return _0x51a5b0[_0x6781('0xf')](0xc8)['json']({'output':_0x6781('0x18')});});};exports[_0x6781('0x19')]=function(_0x55aaf2,_0x1b7847){exec(_0x6781('0x1a'),function(_0x4ffb45,_0x1f257c,_0x2f08e5){logger[_0x6781('0x16')](_0x1f257c);logger['info'](_0x2f08e5);if(_0x4ffb45){logger[_0x6781('0x15')](_0x4ffb45);return _0x1b7847['status'](0x1f4)['json'](_0x4ffb45);}return _0x1b7847['status'](0xc8)[_0x6781('0x10')]({'output':_0x1f257c});});};exports['restart']=function(_0x25da56,_0x2b4ad3){return pm2[_0x6781('0x1b')]('motion2')[_0x6781('0x1c')](function(_0x54af9b){logger[_0x6781('0x16')]('pm2\x20restart\x20motion\x20%s',_0x54af9b);return _0x2b4ad3[_0x6781('0xf')](0xc8)['json']({'output':_0x6781('0x1d')});})[_0x6781('0x1e')](function(_0x27d9e0){logger['error'](_0x27d9e0);return _0x2b4ad3[_0x6781('0xf')](0x1f4)[_0x6781('0x10')](_0x27d9e0);});};exports[_0x6781('0x1f')]=function(_0xb58a45,_0x205002){var _0x1ff49c=fs[_0x6781('0x20')](path[_0x6781('0x21')](config['root'],_0x6781('0x22'),_0x6781('0x1f')));var _0x50a58d=[];for(var _0x27bdca=0x0;_0x27bdca<_0x1ff49c[_0x6781('0x23')];_0x27bdca++){var _0x24170f=_0x1ff49c[_0x27bdca]['replace']('.js','');if(compareVersions(module[_0x6781('0xa')][_0x6781('0x2')],_0x24170f)===-0x1){_0x50a58d[_0x6781('0x24')](_0x24170f);}}if(_0x50a58d[_0x6781('0x23')]){var _0x108e54=_0x50a58d['sort'](compareVersions);var _0x366f14=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x6781('0x25')],'modelName':_0x6781('0x25'),'columnName':_0x6781('0x2')},'migrations':{'params':[db[_0x6781('0x26')][_0x6781('0x27')](),db[_0x6781('0x26')][_0x6781('0x28')],function(){throw new Error(_0x6781('0x29'));}],'path':path[_0x6781('0x21')](config[_0x6781('0x9')],_0x6781('0x22'),'migrations'),'pattern':/\.js$/}});_0x366f14['up']({'migrations':_['map'](_0x108e54,function(_0x391a48){return _0x391a48+'.js';})})[_0x6781('0x1c')](function(){return _0x205002[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x6781('0xa')][_0x6781('0x2')]+_0x6781('0x2a')+_[_0x6781('0x2b')](_0x108e54),'migrations':_['join'](_0x108e54)});})[_0x6781('0x1e')](function(_0x1ec686){if(_0x1ec686 instanceof db['sequelize'][_0x6781('0x2c')]){return _0x205002[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x205002[_0x6781('0xf')](0x1f4)['json'](_0x1ec686);}});}else{return _0x205002[_0x6781('0xf')](0xc8)[_0x6781('0x10')]({'output':_0x6781('0x2d')});}};
\ No newline at end of file
index b424bb7..bf11f78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf420=['../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','/describe','describe','show','post','create','put','/:id','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xf420,0x118));var _0x0f42=function(_0x3c340e,_0x33c8bc){_0x3c340e=_0x3c340e-0x0;var _0x2c82b6=_0xf420[_0x3c340e];return _0x2c82b6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0f42('0x0'));var express=require(_0x0f42('0x1'));var router=express[_0x0f42('0x2')]();var fs_extra=require(_0x0f42('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0f42('0x4'));var config=require(_0x0f42('0x5'));var controller=require(_0x0f42('0x6'));router['get']('/',auth[_0x0f42('0x7')](),controller['index']);router[_0x0f42('0x8')](_0x0f42('0x9'),auth[_0x0f42('0x7')](),controller[_0x0f42('0xa')]);router[_0x0f42('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0f42('0xb')]);router[_0x0f42('0xc')]('/',auth[_0x0f42('0x7')](),controller[_0x0f42('0xd')]);router[_0x0f42('0xe')](_0x0f42('0xf'),auth[_0x0f42('0x7')](),controller['update']);router[_0x0f42('0x10')](_0x0f42('0xf'),auth[_0x0f42('0x7')](),controller[_0x0f42('0x11')]);module[_0x0f42('0x12')]=router;
\ No newline at end of file
+var _0x5d1d=['create','put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','post'];(function(_0x8261bb,_0x48e718){var _0x530867=function(_0x4b2b4e){while(--_0x4b2b4e){_0x8261bb['push'](_0x8261bb['shift']());}};_0x530867(++_0x48e718);}(_0x5d1d,0xb0));var _0xd5d1=function(_0xf62a8,_0x50dfa2){_0xf62a8=_0xf62a8-0x0;var _0xee7fca=_0x5d1d[_0xf62a8];return _0xee7fca;};'use strict';var multer=require(_0xd5d1('0x0'));var util=require(_0xd5d1('0x1'));var path=require(_0xd5d1('0x2'));var timeout=require(_0xd5d1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd5d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd5d1('0x5'));var config=require(_0xd5d1('0x6'));var controller=require('./voiceAgentReport.controller');router[_0xd5d1('0x7')]('/',auth['isAuthenticated'](),controller[_0xd5d1('0x8')]);router[_0xd5d1('0x7')]('/describe',auth[_0xd5d1('0x9')](),controller[_0xd5d1('0xa')]);router[_0xd5d1('0x7')](_0xd5d1('0xb'),auth[_0xd5d1('0x9')](),controller[_0xd5d1('0xc')]);router[_0xd5d1('0xd')]('/',auth[_0xd5d1('0x9')](),controller[_0xd5d1('0xe')]);router[_0xd5d1('0xf')]('/:id',auth[_0xd5d1('0x9')](),controller[_0xd5d1('0x10')]);router[_0xd5d1('0x11')](_0xd5d1('0xb'),auth[_0xd5d1('0x9')](),controller[_0xd5d1('0x12')]);module['exports']=router;
\ No newline at end of file
index 1533c80..8c38297 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5c8=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x2b012b,_0x463e28){var _0x32c4cf=function(_0x5871f2){while(--_0x5871f2){_0x2b012b['push'](_0x2b012b['shift']());}};_0x32c4cf(++_0x463e28);}(_0xd5c8,0x166));var _0x8d5c=function(_0x209ec9,_0x30378c){_0x209ec9=_0x209ec9-0x0;var _0x129b1b=_0xd5c8[_0x209ec9];return _0x129b1b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8d5c('0x0')]},'uniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'calleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'calleridname':{'type':Sequelize[_0x8d5c('0x0')]},'queue':{'type':Sequelize[_0x8d5c('0x0')]},'interface':{'type':Sequelize[_0x8d5c('0x0')]},'membername':{'type':Sequelize[_0x8d5c('0x0')]},'agentcalledAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentconnectAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8d5c('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8d5c('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8d5c('0x0')]},'channelstate':{'type':Sequelize[_0x8d5c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'language':{'type':Sequelize[_0x8d5c('0x0')]},'accountcode':{'type':Sequelize[_0x8d5c('0x0')]},'context':{'type':Sequelize[_0x8d5c('0x0')]},'exten':{'type':Sequelize[_0x8d5c('0x0')]},'priority':{'type':Sequelize[_0x8d5c('0x0')]},'destchannel':{'type':Sequelize[_0x8d5c('0x0')]},'destchannelstate':{'type':Sequelize[_0x8d5c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'destcalleridname':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'destlanguage':{'type':Sequelize[_0x8d5c('0x0')]},'destaccountcode':{'type':Sequelize[_0x8d5c('0x0')]},'destcontext':{'type':Sequelize[_0x8d5c('0x0')]},'destexten':{'type':Sequelize[_0x8d5c('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d5c('0x0')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8d5c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x36ee=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','STRING','DATE','INTEGER'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x36ee,0xe8));var _0xe36e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x36ee[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xe36e('0x0')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe36e('0x0')]},'calleridname':{'type':Sequelize[_0xe36e('0x0')]},'queue':{'type':Sequelize[_0xe36e('0x0')]},'interface':{'type':Sequelize[_0xe36e('0x0')]},'membername':{'type':Sequelize[_0xe36e('0x0')]},'agentcalledAt':{'type':Sequelize[_0xe36e('0x1')]},'agentconnectAt':{'type':Sequelize[_0xe36e('0x1')]},'agentcompleteAt':{'type':Sequelize[_0xe36e('0x1')]},'agentringnoanswerAt':{'type':Sequelize[_0xe36e('0x1')]},'agentdumpAt':{'type':Sequelize[_0xe36e('0x1')]},'holdtime':{'type':Sequelize[_0xe36e('0x2')]},'agentcomplete':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe36e('0x2')]},'reason':{'type':Sequelize[_0xe36e('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe36e('0x0')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinenum':{'type':Sequelize[_0xe36e('0x0')]},'connectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'language':{'type':Sequelize[_0xe36e('0x0')]},'accountcode':{'type':Sequelize[_0xe36e('0x0')]},'context':{'type':Sequelize[_0xe36e('0x0')]},'exten':{'type':Sequelize[_0xe36e('0x0')]},'priority':{'type':Sequelize[_0xe36e('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe36e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridnum':{'type':Sequelize[_0xe36e('0x0')]},'destcalleridname':{'type':Sequelize[_0xe36e('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xe36e('0x0')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xe36e('0x0')]},'destexten':{'type':Sequelize[_0xe36e('0x0')]},'destpriority':{'type':Sequelize[_0xe36e('0x0')]},'destuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xe36e('0x0')]},'answeredelsewheremembername':{'type':Sequelize[_0xe36e('0x0')]},'transfer':{'type':Sequelize[_0xe36e('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xe36e('0x0')],'comment':_0xe36e('0x4')},'transferexten':{'type':Sequelize[_0xe36e('0x0')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xe36e('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index c512724..86a30a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index c12a0b8..e7d4cfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0618=['util','api','moment','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x292688,_0x4ed5d4){var _0x12f117=function(_0x528959){while(--_0x528959){_0x292688['push'](_0x292688['shift']());}};_0x12f117(++_0x4ed5d4);}(_0x0618,0x1c6));var _0x8061=function(_0x269cdd,_0xed07f7){_0x269cdd=_0x269cdd-0x0;var _0x40c5c9=_0x0618[_0x269cdd];return _0x40c5c9;};'use strict';var _=require(_0x8061('0x0'));var util=require(_0x8061('0x1'));var logger=require('../../config/logger')(_0x8061('0x2'));var moment=require(_0x8061('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8061('0x4'));var rimraf=require(_0x8061('0x5'));var config=require(_0x8061('0x6'));var attributes=require(_0x8061('0x7'));module[_0x8061('0x8')]=function(_0x2c47b6,_0x1cca7f){return _0x2c47b6[_0x8061('0x9')](_0x8061('0xa'),attributes,{'tableName':_0x8061('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8061('0xc'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x81bd=['../../config/environment','./voiceAgentReport.attributes','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x33f74b,_0x5e8e40){var _0x5e468c=function(_0x243580){while(--_0x243580){_0x33f74b['push'](_0x33f74b['shift']());}};_0x5e468c(++_0x5e8e40);}(_0x81bd,0x7c));var _0xd81b=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x81bd[_0x1e500e];return _0x10dc5e;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xd81b('0xb'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index fe4130c..b8086d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2d2=['VoiceAgentReport','create','body','options','raw','info','debug','UpdateVoiceAgentReport','update','where','limit','then','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd2d2,0xdf));var _0x2d2d=function(_0x479e55,_0x39cbf9){_0x479e55=_0x479e55-0x0;var _0x41d779=_0xd2d2[_0x479e55];return _0x41d779;};'use strict';var _=require(_0x2d2d('0x0'));var util=require('util');var moment=require(_0x2d2d('0x1'));var BPromise=require(_0x2d2d('0x2'));var rs=require(_0x2d2d('0x3'));var fs=require('fs');var Redis=require(_0x2d2d('0x4'));var db=require(_0x2d2d('0x5'))['db'];var utils=require(_0x2d2d('0x6'));var logger=require(_0x2d2d('0x7'))(_0x2d2d('0x8'));var config=require(_0x2d2d('0x9'));var jayson=require(_0x2d2d('0xa'));var client=jayson[_0x2d2d('0xb')][_0x2d2d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b6351,_0xfa21ae,_0x421d01){return new BPromise(function(_0x2e2ef5,_0x3c1869){return client['request'](_0x5b6351,_0x421d01)['then'](function(_0x3d02bb){logger['info'](_0x2d2d('0xd'),_0xfa21ae,_0x2d2d('0xe'));logger['debug'](_0x2d2d('0xf'),_0xfa21ae,_0x2d2d('0xe'),JSON[_0x2d2d('0x10')](_0x3d02bb));if(_0x3d02bb[_0x2d2d('0x11')]){if(_0x3d02bb[_0x2d2d('0x11')][_0x2d2d('0x12')]===0x1f4){logger[_0x2d2d('0x11')](_0x2d2d('0xd'),_0xfa21ae,_0x3d02bb['error'][_0x2d2d('0x13')]);return _0x3c1869(_0x3d02bb[_0x2d2d('0x11')][_0x2d2d('0x13')]);}logger[_0x2d2d('0x11')](_0x2d2d('0xd'),_0xfa21ae,_0x3d02bb[_0x2d2d('0x11')]['message']);return _0x2e2ef5(_0x3d02bb['error'][_0x2d2d('0x13')]);}else{logger['info'](_0x2d2d('0xd'),_0xfa21ae,_0x2d2d('0xe'));_0x2e2ef5(_0x3d02bb[_0x2d2d('0x14')][_0x2d2d('0x13')]);}})['catch'](function(_0x3f5163){logger[_0x2d2d('0x11')](_0x2d2d('0xd'),_0xfa21ae,_0x3f5163);_0x3c1869(_0x3f5163);});});}exports[_0x2d2d('0x15')]=function(_0x220383){var _0x5e0cb7=this;return new Promise(function(_0x25190e,_0x3d27de){return db[_0x2d2d('0x16')][_0x2d2d('0x17')](_0x220383[_0x2d2d('0x18')],{'raw':_0x220383[_0x2d2d('0x19')]?_0x220383[_0x2d2d('0x19')][_0x2d2d('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xd63281){logger[_0x2d2d('0x1b')]('CreateVoiceAgentReport',_0x220383);logger[_0x2d2d('0x1c')](_0x2d2d('0x15'),_0x220383,JSON[_0x2d2d('0x10')](_0xd63281));_0x25190e(_0xd63281);})['catch'](function(_0x1f0e7c){logger[_0x2d2d('0x11')](_0x2d2d('0x15'),_0x1f0e7c[_0x2d2d('0x13')],_0x220383);_0x3d27de(_0x5e0cb7[_0x2d2d('0x11')](0x1f4,_0x1f0e7c[_0x2d2d('0x13')]));});});};exports[_0x2d2d('0x1d')]=function(_0x2ed79f){var _0x2d04d5=this;return new Promise(function(_0x36a580,_0x1cd08c){return db[_0x2d2d('0x16')][_0x2d2d('0x1e')](_0x2ed79f[_0x2d2d('0x18')],{'raw':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f[_0x2d2d('0x19')][_0x2d2d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f[_0x2d2d('0x19')][_0x2d2d('0x1f')]||null:null,'attributes':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f[_0x2d2d('0x19')]['attributes']||null:null,'limit':_0x2ed79f[_0x2d2d('0x19')]?_0x2ed79f['options'][_0x2d2d('0x20')]||null:null})[_0x2d2d('0x21')](function(_0x3dbbb8){logger[_0x2d2d('0x1b')](_0x2d2d('0x1d'),_0x2ed79f);logger['debug'](_0x2d2d('0x1d'),_0x2ed79f,JSON[_0x2d2d('0x10')](_0x3dbbb8));_0x36a580(_0x3dbbb8);})[_0x2d2d('0x22')](function(_0x554490){logger[_0x2d2d('0x11')](_0x2d2d('0x1d'),_0x554490[_0x2d2d('0x13')],_0x2ed79f);_0x1cd08c(_0x2d04d5['error'](0x1f4,_0x554490[_0x2d2d('0x13')]));});});};
\ No newline at end of file
+var _0x3617=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','debug','UpdateVoiceAgentReport','update','where','attributes'];(function(_0x3a6fd8,_0x2fa124){var _0x50d351=function(_0x1befeb){while(--_0x1befeb){_0x3a6fd8['push'](_0x3a6fd8['shift']());}};_0x50d351(++_0x2fa124);}(_0x3617,0x132));var _0x7361=function(_0x316cba,_0xc56f5f){_0x316cba=_0x316cba-0x0;var _0x33a8e2=_0x3617[_0x316cba];return _0x33a8e2;};'use strict';var _=require(_0x7361('0x0'));var util=require(_0x7361('0x1'));var moment=require(_0x7361('0x2'));var BPromise=require(_0x7361('0x3'));var rs=require(_0x7361('0x4'));var fs=require('fs');var Redis=require(_0x7361('0x5'));var db=require(_0x7361('0x6'))['db'];var utils=require(_0x7361('0x7'));var logger=require(_0x7361('0x8'))(_0x7361('0x9'));var config=require('../../config/environment');var jayson=require(_0x7361('0xa'));var client=jayson['client'][_0x7361('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b4984,_0x218562,_0x9f2602){return new BPromise(function(_0x180c30,_0x338054){return client[_0x7361('0xc')](_0x1b4984,_0x9f2602)[_0x7361('0xd')](function(_0x282094){logger[_0x7361('0xe')](_0x7361('0xf'),_0x218562,'request\x20sent');logger['debug'](_0x7361('0x10'),_0x218562,'request\x20sent',JSON[_0x7361('0x11')](_0x282094));if(_0x282094[_0x7361('0x12')]){if(_0x282094[_0x7361('0x12')]['code']===0x1f4){logger[_0x7361('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x218562,_0x282094['error'][_0x7361('0x13')]);return _0x338054(_0x282094[_0x7361('0x12')][_0x7361('0x13')]);}logger[_0x7361('0x12')](_0x7361('0xf'),_0x218562,_0x282094[_0x7361('0x12')][_0x7361('0x13')]);return _0x180c30(_0x282094[_0x7361('0x12')][_0x7361('0x13')]);}else{logger['info'](_0x7361('0xf'),_0x218562,_0x7361('0x14'));_0x180c30(_0x282094[_0x7361('0x15')][_0x7361('0x13')]);}})[_0x7361('0x16')](function(_0x289509){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x218562,_0x289509);_0x338054(_0x289509);});});}exports[_0x7361('0x17')]=function(_0x3959c4){var _0x470a5b=this;return new Promise(function(_0x5b93f2,_0x1dc510){return db[_0x7361('0x18')][_0x7361('0x19')](_0x3959c4[_0x7361('0x1a')],{'raw':_0x3959c4[_0x7361('0x1b')]?_0x3959c4['options'][_0x7361('0x1c')]===undefined?!![]:![]:!![]})[_0x7361('0xd')](function(_0x50d7e5){logger[_0x7361('0xe')](_0x7361('0x17'),_0x3959c4);logger[_0x7361('0x1d')](_0x7361('0x17'),_0x3959c4,JSON[_0x7361('0x11')](_0x50d7e5));_0x5b93f2(_0x50d7e5);})[_0x7361('0x16')](function(_0x4f3940){logger[_0x7361('0x12')](_0x7361('0x17'),_0x4f3940['message'],_0x3959c4);_0x1dc510(_0x470a5b[_0x7361('0x12')](0x1f4,_0x4f3940[_0x7361('0x13')]));});});};exports[_0x7361('0x1e')]=function(_0x3ac0fa){var _0x424d38=this;return new Promise(function(_0xbb9cb7,_0x4e4e4e){return db['VoiceAgentReport'][_0x7361('0x1f')](_0x3ac0fa[_0x7361('0x1a')],{'raw':_0x3ac0fa[_0x7361('0x1b')]?_0x3ac0fa[_0x7361('0x1b')][_0x7361('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ac0fa['options']?_0x3ac0fa['options'][_0x7361('0x20')]||null:null,'attributes':_0x3ac0fa[_0x7361('0x1b')]?_0x3ac0fa[_0x7361('0x1b')][_0x7361('0x21')]||null:null,'limit':_0x3ac0fa[_0x7361('0x1b')]?_0x3ac0fa[_0x7361('0x1b')]['limit']||null:null})[_0x7361('0xd')](function(_0x360049){logger['info'](_0x7361('0x1e'),_0x3ac0fa);logger[_0x7361('0x1d')](_0x7361('0x1e'),_0x3ac0fa,JSON[_0x7361('0x11')](_0x360049));_0xbb9cb7(_0x360049);})['catch'](function(_0x281815){logger[_0x7361('0x12')](_0x7361('0x1e'),_0x281815[_0x7361('0x13')],_0x3ac0fa);_0x4e4e4e(_0x424d38[_0x7361('0x12')](0x1f4,_0x281815[_0x7361('0x13')]));});});};
\ No newline at end of file
index d88d90b..0e6e8ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post'];(function(_0x92958f,_0x44430b){var _0x1e406d=function(_0x42699d){while(--_0x42699d){_0x92958f['push'](_0x92958f['shift']());}};_0x1e406d(++_0x44430b);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2361fe,_0x227bc6){_0x2361fe=_0x2361fe-0x0;var _0x36e4d4=_0xd6d6[_0x2361fe];return _0x36e4d4;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),auth[_0x6d6d('0xd')](),controller[_0x6d6d('0xe')]);router[_0x6d6d('0xa')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xd')](),controller[_0x6d6d('0x11')]);router[_0x6d6d('0x12')](_0x6d6d('0xf'),auth['isAuthenticated'](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6d6d('0x15')]);module[_0x6d6d('0x16')]=router;
\ No newline at end of file
+var _0x9c5a=['fs-extra','../../components/interaction/service','../../config/environment','get','index','describe','isAuthenticated','show','create','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x14f6e9,_0x42c524){_0x14f6e9=_0x14f6e9-0x0;var _0x52169d=_0x9c5a[_0x14f6e9];return _0x52169d;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./voiceCallReport.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['post']('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xd')]);router['put']('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xe')]);router[_0xa9c5('0xf')](_0xa9c5('0x10'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);module[_0xa9c5('0x12')]=router;
\ No newline at end of file
index 25e847f..b7a58db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a97=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','dialer'];(function(_0x3c7797,_0x46f8e9){var _0x1464e8=function(_0x11592a){while(--_0x11592a){_0x3c7797['push'](_0x3c7797['shift']());}};_0x1464e8(++_0x46f8e9);}(_0x0a97,0x1a7));var _0x70a9=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x0a97[_0x20ef64];return _0x3707d8;};'use strict';var Sequelize=require(_0x70a9('0x0'));module[_0x70a9('0x1')]={'uniqueid':{'type':Sequelize[_0x70a9('0x2')]},'type':{'type':Sequelize[_0x70a9('0x3')](_0x70a9('0x4'),_0x70a9('0x5'),_0x70a9('0x6'),_0x70a9('0x7'),'outbound-fax',_0x70a9('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x70a9('0x2')]},'destinationcontext':{'type':Sequelize[_0x70a9('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x70a9('0x2')]},'destinationchannel':{'type':Sequelize[_0x70a9('0x2')]},'lastapplication':{'type':Sequelize[_0x70a9('0x2')]},'lastdata':{'type':Sequelize[_0x70a9('0x9')]},'starttime':{'type':Sequelize[_0x70a9('0xa')]},'systemanswertime':{'type':Sequelize[_0x70a9('0xa')]},'answertime':{'type':Sequelize[_0x70a9('0xa')]},'endtime':{'type':Sequelize[_0x70a9('0xa')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x70a9('0xb')]},'mohtime':{'type':Sequelize[_0x70a9('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x70a9('0x2')]},'amaflags':{'type':Sequelize[_0x70a9('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x70a9('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x70a9('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x70a9('0x2')]}};
\ No newline at end of file
+var _0x832e=['ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','TEXT','DATE','INTEGER','STRING'];(function(_0x1902ef,_0x35f15a){var _0x1f21a1=function(_0x176df6){while(--_0x176df6){_0x1902ef['push'](_0x1902ef['shift']());}};_0x1f21a1(++_0x35f15a);}(_0x832e,0x17b));var _0xe832=function(_0xe940fc,_0x587243){_0xe940fc=_0xe940fc-0x0;var _0x51bc42=_0x832e[_0xe940fc];return _0x51bc42;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe832('0x0')]},'type':{'type':Sequelize[_0xe832('0x1')](_0xe832('0x2'),_0xe832('0x3'),_0xe832('0x4'),_0xe832('0x5'),_0xe832('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe832('0x0')]},'source':{'type':Sequelize[_0xe832('0x0')]},'destination':{'type':Sequelize[_0xe832('0x0')]},'destinationcontext':{'type':Sequelize[_0xe832('0x0')]},'callerid':{'type':Sequelize[_0xe832('0x0')]},'channel':{'type':Sequelize[_0xe832('0x0')]},'destinationchannel':{'type':Sequelize[_0xe832('0x0')]},'lastapplication':{'type':Sequelize[_0xe832('0x0')]},'lastdata':{'type':Sequelize[_0xe832('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0xe832('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe832('0x8')]},'duration':{'type':Sequelize[_0xe832('0x9')]},'billableseconds':{'type':Sequelize[_0xe832('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe832('0x0')]},'amaflags':{'type':Sequelize[_0xe832('0x0')]},'userfield':{'type':Sequelize[_0xe832('0x0')]},'userDisposition':{'type':Sequelize[_0xe832('0x0')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe832('0x0')]},'note':{'type':Sequelize[_0xe832('0x0')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xe832('0x9')]},'sipcallid':{'type':Sequelize[_0xe832('0x0')]}};
\ No newline at end of file
index 9205e3e..5df0289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x1c3d9f,_0x106d3b){var _0x5ca9f5=function(_0x31073c){while(--_0x31073c){_0x1c3d9f['push'](_0x1c3d9f['shift']());}};_0x5ca9f5(++_0x106d3b);}(_0xdb28,0x106));var _0x8db2=function(_0x1918e4,_0x2c0aa7){_0x1918e4=_0x1918e4-0x0;var _0x288caf=_0xdb28[_0x1918e4];return _0x288caf;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));};
\ No newline at end of file
+var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x155b44,_0x35789b){var _0x554bae=function(_0x290b1a){while(--_0x290b1a){_0x155b44['push'](_0x155b44['shift']());}};_0x554bae(++_0x35789b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x39cd3c,_0xa21102){_0x39cd3c=_0x39cd3c-0x0;var _0x47a0ae=_0x0b0e[_0x39cd3c];return _0x47a0ae;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));};
\ No newline at end of file
index 5f264b6..ff8140e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x107a=['api','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','uniqueid','lodash','util','../../config/logger'];(function(_0x3e2ac1,_0x3f1e45){var _0x54d5b4=function(_0xacb848){while(--_0xacb848){_0x3e2ac1['push'](_0x3e2ac1['shift']());}};_0x54d5b4(++_0x3f1e45);}(_0x107a,0x1dd));var _0xa107=function(_0xc77373,_0x216c24){_0xc77373=_0xc77373-0x0;var _0x32ed6b=_0x107a[_0xc77373];return _0x32ed6b;};'use strict';var _=require(_0xa107('0x0'));var util=require(_0xa107('0x1'));var logger=require(_0xa107('0x2'))(_0xa107('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa107('0x4'));var rimraf=require(_0xa107('0x5'));var config=require(_0xa107('0x6'));var attributes=require(_0xa107('0x7'));module[_0xa107('0x8')]=function(_0x1693cb,_0x4bff82){return _0x1693cb[_0xa107('0x9')](_0xa107('0xa'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xa107('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x98ea=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceCallReport.attributes','define','report_call','uniqueid'];(function(_0x47777f,_0x27460c){var _0x3f2835=function(_0xe6ba22){while(--_0xe6ba22){_0x47777f['push'](_0x47777f['shift']());}};_0x3f2835(++_0x27460c);}(_0x98ea,0x1ce));var _0xa98e=function(_0x196b65,_0x1f4ba4){_0x196b65=_0x196b65-0x0;var _0x3ef4d8=_0x98ea[_0x196b65];return _0x3ef4d8;};'use strict';var _=require(_0xa98e('0x0'));var util=require('util');var logger=require(_0xa98e('0x1'))('api');var moment=require(_0xa98e('0x2'));var BPromise=require(_0xa98e('0x3'));var rp=require(_0xa98e('0x4'));var fs=require('fs');var path=require(_0xa98e('0x5'));var rimraf=require(_0xa98e('0x6'));var config=require('../../config/environment');var attributes=require(_0xa98e('0x7'));module['exports']=function(_0x4517b4,_0x3c7612){return _0x4517b4[_0xa98e('0x8')]('VoiceCallReport',attributes,{'tableName':_0xa98e('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa98e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 095af80..859c353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f0=['then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','catch','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','util','moment','../../mysqldb','../../config/logger','rpc','client','request'];(function(_0x40e114,_0x278b52){var _0x2e9542=function(_0x36b70){while(--_0x36b70){_0x40e114['push'](_0x40e114['shift']());}};_0x2e9542(++_0x278b52);}(_0x62f0,0x156));var _0x062f=function(_0x3b20c2,_0x888661){_0x3b20c2=_0x3b20c2-0x0;var _0x5b4482=_0x62f0[_0x3b20c2];return _0x5b4482;};'use strict';var _=require(_0x062f('0x0'));var util=require(_0x062f('0x1'));var moment=require(_0x062f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x062f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x062f('0x4'))(_0x062f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x062f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44f4f2,_0x32b2b0,_0x2b9e64){return new BPromise(function(_0x31df56,_0x4b8f89){return client[_0x062f('0x7')](_0x44f4f2,_0x2b9e64)[_0x062f('0x8')](function(_0x406db7){logger[_0x062f('0x9')](_0x062f('0xa'),_0x32b2b0,_0x062f('0xb'));logger[_0x062f('0xc')](_0x062f('0xd'),_0x32b2b0,_0x062f('0xb'),JSON[_0x062f('0xe')](_0x406db7));if(_0x406db7[_0x062f('0xf')]){if(_0x406db7[_0x062f('0xf')]['code']===0x1f4){logger[_0x062f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x32b2b0,_0x406db7['error'][_0x062f('0x10')]);return _0x4b8f89(_0x406db7[_0x062f('0xf')][_0x062f('0x10')]);}logger['error'](_0x062f('0xa'),_0x32b2b0,_0x406db7[_0x062f('0xf')]['message']);return _0x31df56(_0x406db7[_0x062f('0xf')]['message']);}else{logger[_0x062f('0x9')](_0x062f('0xa'),_0x32b2b0,_0x062f('0xb'));_0x31df56(_0x406db7[_0x062f('0x11')][_0x062f('0x10')]);}})['catch'](function(_0x328f13){logger[_0x062f('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x32b2b0,_0x328f13);_0x4b8f89(_0x328f13);});});}exports[_0x062f('0x12')]=function(_0x2d6f4f){var _0x4af764=this;return new Promise(function(_0xec7da4,_0x58d998){return db[_0x062f('0x13')][_0x062f('0x14')]({'raw':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f[_0x062f('0x15')][_0x062f('0x16')]===undefined?!![]:![]:!![],'where':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f['options'][_0x062f('0x17')]||null:null,'attributes':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f[_0x062f('0x15')][_0x062f('0x18')]||null:null,'limit':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f[_0x062f('0x15')]['limit']||null:null,'include':_0x2d6f4f[_0x062f('0x15')]?_0x2d6f4f['options'][_0x062f('0x19')]?_[_0x062f('0x1a')](_0x2d6f4f[_0x062f('0x15')][_0x062f('0x19')],function(_0x199802){return{'model':db[_0x199802[_0x062f('0x1b')]],'as':_0x199802['as'],'attributes':_0x199802['attributes'],'include':_0x199802[_0x062f('0x19')]?_[_0x062f('0x1a')](_0x199802[_0x062f('0x19')],function(_0x37dbfe){return{'model':db[_0x37dbfe[_0x062f('0x1b')]],'as':_0x37dbfe['as'],'attributes':_0x37dbfe[_0x062f('0x18')],'include':_0x37dbfe['include']?_[_0x062f('0x1a')](_0x37dbfe[_0x062f('0x19')],function(_0x8224b8){return{'model':db[_0x8224b8[_0x062f('0x1b')]],'as':_0x8224b8['as'],'attributes':_0x8224b8[_0x062f('0x18')]};}):[]};}):[]};}):[]:[]})[_0x062f('0x8')](function(_0x1a5523){logger[_0x062f('0x9')]('GetVoiceCallReport',_0x2d6f4f);logger[_0x062f('0xc')](_0x062f('0x12'),_0x2d6f4f,JSON['stringify'](_0x1a5523));_0xec7da4(_0x1a5523);})[_0x062f('0x1c')](function(_0x2197a6){logger[_0x062f('0xf')](_0x062f('0x12'),_0x2197a6[_0x062f('0x10')],_0x2d6f4f);_0x58d998(_0x4af764['error'](0x1f4,_0x2197a6['message']));});});};exports['CreateVoiceCallReport']=function(_0x2e7854){var _0x3905da=this;return new Promise(function(_0x443944,_0x5d824b){return db['VoiceCallReport'][_0x062f('0x1d')](_0x2e7854[_0x062f('0x1e')],{'raw':_0x2e7854[_0x062f('0x15')]?_0x2e7854[_0x062f('0x15')][_0x062f('0x16')]===undefined?!![]:![]:!![]})[_0x062f('0x8')](function(_0x36248d){logger[_0x062f('0x9')](_0x062f('0x1f'),_0x2e7854);logger[_0x062f('0xc')](_0x062f('0x1f'),_0x2e7854,JSON[_0x062f('0xe')](_0x36248d));_0x443944(_0x36248d);})[_0x062f('0x1c')](function(_0xeb4255){logger['error'](_0x062f('0x1f'),_0xeb4255[_0x062f('0x10')],_0x2e7854);_0x5d824b(_0x3905da[_0x062f('0xf')](0x1f4,_0xeb4255['message']));});});};exports[_0x062f('0x20')]=function(_0xc9c4b){var _0x262f2e=this;return new Promise(function(_0xb12d93,_0x327bb9){return db['VoiceCallReport'][_0x062f('0x21')](_0xc9c4b[_0x062f('0x1e')],{'raw':_0xc9c4b[_0x062f('0x15')]?_0xc9c4b[_0x062f('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9c4b[_0x062f('0x15')]?_0xc9c4b[_0x062f('0x15')][_0x062f('0x17')]||null:null,'attributes':_0xc9c4b['options']?_0xc9c4b[_0x062f('0x15')][_0x062f('0x18')]||null:null,'limit':_0xc9c4b['options']?_0xc9c4b[_0x062f('0x15')][_0x062f('0x22')]||null:null})[_0x062f('0x8')](function(_0x96bccc){logger[_0x062f('0x9')]('UpdateVoiceCallReport',_0xc9c4b);logger[_0x062f('0xc')]('UpdateVoiceCallReport',_0xc9c4b,JSON[_0x062f('0xe')](_0x96bccc));_0xb12d93(_0x96bccc);})['catch'](function(_0x12c1d6){logger[_0x062f('0xf')](_0x062f('0x20'),_0x12c1d6[_0x062f('0x10')],_0xc9c4b);_0x327bb9(_0x262f2e[_0x062f('0xf')](0x1f4,_0x12c1d6[_0x062f('0x10')]));});});};
\ No newline at end of file
+var _0x0b36=['options','raw','where','attributes','include','map','model','debug','stringify','CreateVoiceCallReport','create','body','update','limit','UpdateVoiceCallReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','VoiceCallReport,\x20%s,\x20%s','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','GetVoiceCallReport','VoiceCallReport','findAll'];(function(_0x279996,_0x4d2c41){var _0x14db97=function(_0x26490c){while(--_0x26490c){_0x279996['push'](_0x279996['shift']());}};_0x14db97(++_0x4d2c41);}(_0x0b36,0x16e));var _0x60b3=function(_0x125b80,_0x41db3b){_0x125b80=_0x125b80-0x0;var _0x414ba8=_0x0b36[_0x125b80];return _0x414ba8;};'use strict';var _=require(_0x60b3('0x0'));var util=require('util');var moment=require(_0x60b3('0x1'));var BPromise=require(_0x60b3('0x2'));var rs=require(_0x60b3('0x3'));var fs=require('fs');var Redis=require(_0x60b3('0x4'));var db=require(_0x60b3('0x5'))['db'];var utils=require(_0x60b3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x60b3('0x7'));var jayson=require(_0x60b3('0x8'));var client=jayson[_0x60b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f54a8,_0x56a758,_0x2e7f3c){return new BPromise(function(_0xa94acb,_0x4c5227){return client[_0x60b3('0xa')](_0x1f54a8,_0x2e7f3c)[_0x60b3('0xb')](function(_0x20584e){logger['info'](_0x60b3('0xc'),_0x56a758,'request\x20sent');logger['debug'](_0x60b3('0xd'),_0x56a758,'request\x20sent',JSON['stringify'](_0x20584e));if(_0x20584e[_0x60b3('0xe')]){if(_0x20584e[_0x60b3('0xe')][_0x60b3('0xf')]===0x1f4){logger[_0x60b3('0xe')](_0x60b3('0xc'),_0x56a758,_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);return _0x4c5227(_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);}logger[_0x60b3('0xe')](_0x60b3('0xc'),_0x56a758,_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);return _0xa94acb(_0x20584e[_0x60b3('0xe')][_0x60b3('0x10')]);}else{logger[_0x60b3('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x56a758,_0x60b3('0x12'));_0xa94acb(_0x20584e[_0x60b3('0x13')][_0x60b3('0x10')]);}})[_0x60b3('0x14')](function(_0x674054){logger[_0x60b3('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x56a758,_0x674054);_0x4c5227(_0x674054);});});}exports[_0x60b3('0x15')]=function(_0x23d437){var _0x3316f1=this;return new Promise(function(_0x2e9015,_0x15b542){return db[_0x60b3('0x16')][_0x60b3('0x17')]({'raw':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')][_0x60b3('0x19')]===undefined?!![]:![]:!![],'where':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')][_0x60b3('0x1a')]||null:null,'attributes':_0x23d437['options']?_0x23d437[_0x60b3('0x18')][_0x60b3('0x1b')]||null:null,'limit':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')]['limit']||null:null,'include':_0x23d437[_0x60b3('0x18')]?_0x23d437[_0x60b3('0x18')][_0x60b3('0x1c')]?_[_0x60b3('0x1d')](_0x23d437['options'][_0x60b3('0x1c')],function(_0xe5aea4){return{'model':db[_0xe5aea4[_0x60b3('0x1e')]],'as':_0xe5aea4['as'],'attributes':_0xe5aea4[_0x60b3('0x1b')],'include':_0xe5aea4[_0x60b3('0x1c')]?_['map'](_0xe5aea4[_0x60b3('0x1c')],function(_0x405f83){return{'model':db[_0x405f83['model']],'as':_0x405f83['as'],'attributes':_0x405f83[_0x60b3('0x1b')],'include':_0x405f83[_0x60b3('0x1c')]?_[_0x60b3('0x1d')](_0x405f83[_0x60b3('0x1c')],function(_0x15295c){return{'model':db[_0x15295c[_0x60b3('0x1e')]],'as':_0x15295c['as'],'attributes':_0x15295c[_0x60b3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x60b3('0xb')](function(_0x16bba8){logger[_0x60b3('0x11')](_0x60b3('0x15'),_0x23d437);logger[_0x60b3('0x1f')](_0x60b3('0x15'),_0x23d437,JSON[_0x60b3('0x20')](_0x16bba8));_0x2e9015(_0x16bba8);})['catch'](function(_0x384e41){logger[_0x60b3('0xe')]('GetVoiceCallReport',_0x384e41[_0x60b3('0x10')],_0x23d437);_0x15b542(_0x3316f1[_0x60b3('0xe')](0x1f4,_0x384e41[_0x60b3('0x10')]));});});};exports[_0x60b3('0x21')]=function(_0xb873a9){var _0x271bcd=this;return new Promise(function(_0x268eb2,_0x3c2dc2){return db['VoiceCallReport'][_0x60b3('0x22')](_0xb873a9[_0x60b3('0x23')],{'raw':_0xb873a9[_0x60b3('0x18')]?_0xb873a9['options'][_0x60b3('0x19')]===undefined?!![]:![]:!![]})[_0x60b3('0xb')](function(_0x37f34e){logger['info'](_0x60b3('0x21'),_0xb873a9);logger[_0x60b3('0x1f')](_0x60b3('0x21'),_0xb873a9,JSON[_0x60b3('0x20')](_0x37f34e));_0x268eb2(_0x37f34e);})['catch'](function(_0x161b2a){logger[_0x60b3('0xe')](_0x60b3('0x21'),_0x161b2a[_0x60b3('0x10')],_0xb873a9);_0x3c2dc2(_0x271bcd[_0x60b3('0xe')](0x1f4,_0x161b2a[_0x60b3('0x10')]));});});};exports['UpdateVoiceCallReport']=function(_0x4f1f72){var _0x4a3e5e=this;return new Promise(function(_0x319c0e,_0x1cecfa){return db['VoiceCallReport'][_0x60b3('0x24')](_0x4f1f72['body'],{'raw':_0x4f1f72[_0x60b3('0x18')]?_0x4f1f72[_0x60b3('0x18')][_0x60b3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f1f72['options']?_0x4f1f72[_0x60b3('0x18')][_0x60b3('0x1a')]||null:null,'attributes':_0x4f1f72[_0x60b3('0x18')]?_0x4f1f72['options'][_0x60b3('0x1b')]||null:null,'limit':_0x4f1f72[_0x60b3('0x18')]?_0x4f1f72[_0x60b3('0x18')][_0x60b3('0x25')]||null:null})['then'](function(_0x56c8b7){logger['info'](_0x60b3('0x26'),_0x4f1f72);logger[_0x60b3('0x1f')](_0x60b3('0x26'),_0x4f1f72,JSON['stringify'](_0x56c8b7));_0x319c0e(_0x56c8b7);})[_0x60b3('0x14')](function(_0x37c017){logger[_0x60b3('0xe')](_0x60b3('0x26'),_0x37c017[_0x60b3('0x10')],_0x4f1f72);_0x1cecfa(_0x4a3e5e['error'](0x1f4,_0x37c017[_0x60b3('0x10')]));});});};
\ No newline at end of file
index c13d075..7bca988 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c8f=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x5a20d5,_0x33a069){var _0x104307=function(_0x35606a){while(--_0x35606a){_0x5a20d5['push'](_0x5a20d5['shift']());}};_0x104307(++_0x33a069);}(_0x7c8f,0x160));var _0xf7c8=function(_0x7d7c9b,_0x52c32f){_0x7d7c9b=_0x7d7c9b-0x0;var _0x211a81=_0x7c8f[_0x7d7c9b];return _0x211a81;};'use strict';var multer=require(_0xf7c8('0x0'));var util=require(_0xf7c8('0x1'));var path=require(_0xf7c8('0x2'));var timeout=require(_0xf7c8('0x3'));var express=require(_0xf7c8('0x4'));var router=express[_0xf7c8('0x5')]();var fs_extra=require(_0xf7c8('0x6'));var auth=require(_0xf7c8('0x7'));var interaction=require(_0xf7c8('0x8'));var config=require(_0xf7c8('0x9'));var controller=require(_0xf7c8('0xa'));router[_0xf7c8('0xb')]('/',auth[_0xf7c8('0xc')](),controller[_0xf7c8('0xd')]);router[_0xf7c8('0xb')](_0xf7c8('0xe'),auth[_0xf7c8('0xc')](),controller[_0xf7c8('0xf')]);router['post']('/',auth[_0xf7c8('0xc')](),controller[_0xf7c8('0x10')]);router[_0xf7c8('0x11')]('/:id',auth[_0xf7c8('0xc')](),controller[_0xf7c8('0x12')]);router[_0xf7c8('0x13')](_0xf7c8('0xe'),auth[_0xf7c8('0xc')](),controller['destroy']);module[_0xf7c8('0x14')]=router;
\ No newline at end of file
+var _0x2f68=['/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated','index','show','post','put'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x2f68,0x15a));var _0x82f6=function(_0x170e9a,_0x482cbd){_0x170e9a=_0x170e9a-0x0;var _0x1cdf0b=_0x2f68[_0x170e9a];return _0x1cdf0b;};'use strict';var multer=require(_0x82f6('0x0'));var util=require(_0x82f6('0x1'));var path=require('path');var timeout=require(_0x82f6('0x2'));var express=require(_0x82f6('0x3'));var router=express[_0x82f6('0x4')]();var fs_extra=require(_0x82f6('0x5'));var auth=require(_0x82f6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x82f6('0x7'));router[_0x82f6('0x8')]('/',auth[_0x82f6('0x9')](),controller[_0x82f6('0xa')]);router[_0x82f6('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x82f6('0xb')]);router[_0x82f6('0xc')]('/',auth[_0x82f6('0x9')](),controller['create']);router[_0x82f6('0xd')](_0x82f6('0xe'),auth['isAuthenticated'](),controller[_0x82f6('0xf')]);router[_0x82f6('0x10')](_0x82f6('0xe'),auth[_0x82f6('0x9')](),controller['destroy']);module[_0x82f6('0x11')]=router;
\ No newline at end of file
index 6aa2c84..0fce88d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c1c=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','join','getDataValue'];(function(_0x273265,_0x1d51f8){var _0x538939=function(_0x4efbdf){while(--_0x4efbdf){_0x273265['push'](_0x273265['shift']());}};_0x538939(++_0x1d51f8);}(_0x5c1c,0x10f));var _0xc5c1=function(_0x2c0c8,_0x8b3e09){_0x2c0c8=_0x2c0c8-0x0;var _0x49328c=_0x5c1c[_0x2c0c8];return _0x49328c;};'use strict';var Sequelize=require(_0xc5c1('0x0'));module[_0xc5c1('0x1')]={'name':{'type':Sequelize[_0xc5c1('0x2')]},'prefix':{'type':Sequelize[_0xc5c1('0x2')],'unique':_0xc5c1('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xc5c1('0x2')],'set':function(_0x32d75c){this[_0xc5c1('0x4')](_0xc5c1('0x5'),_0x32d75c?_0x32d75c[_0xc5c1('0x6')](''):[]);},'get':function(){return this[_0xc5c1('0x7')](_0xc5c1('0x5'))?this['getDataValue'](_0xc5c1('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0xc5c1('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xc5c1('0x2')]},'record':{'type':Sequelize[_0xc5c1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc5c1('0x2')]},'description':{'type':Sequelize[_0xc5c1('0x2')]}};
\ No newline at end of file
+var _0x37d5=['options','getDataValue','split','BOOLEAN','sequelize','STRING','name'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0x37d5,0x14d));var _0x537d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x37d5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x537d('0x0'));module['exports']={'name':{'type':Sequelize[_0x537d('0x1')]},'prefix':{'type':Sequelize[_0x537d('0x1')],'unique':_0x537d('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x537d('0x1')],'set':function(_0x519ac1){this['setDataValue'](_0x537d('0x3'),_0x519ac1?_0x519ac1['join'](''):[]);},'get':function(){return this[_0x537d('0x4')](_0x537d('0x3'))?this['getDataValue']('options')[_0x537d('0x5')](''):[];}},'auth':{'type':Sequelize[_0x537d('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x537d('0x1')]},'description':{'type':Sequelize[_0x537d('0x1')]}};
\ No newline at end of file
index 9a6ba62..d90e07c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6599=['rows','catch','show','params','rawAttributes','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','name','index','map','VoiceChanSpy','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x1e2671,_0x4cf90a){var _0x492489=function(_0x1440b6){while(--_0x1440b6){_0x1e2671['push'](_0x1e2671['shift']());}};_0x492489(++_0x4cf90a);}(_0x6599,0xb0));var _0x9659=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x6599[_0x5538d5];return _0x323b1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9659('0x0'));var zipdir=require(_0x9659('0x1'));var jsonpatch=require(_0x9659('0x2'));var rp=require(_0x9659('0x3'));var moment=require(_0x9659('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9659('0x5'));var util=require('util');var path=require(_0x9659('0x6'));var sox=require('sox');var csv=require(_0x9659('0x7'));var ejs=require(_0x9659('0x8'));var fs=require('fs');var fs_extra=require(_0x9659('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9659('0xa'));var jsforce=require(_0x9659('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9659('0x7'));var querystring=require('querystring');var Papa=require(_0x9659('0xc'));var Redis=require(_0x9659('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x9659('0xe'));var as=require(_0x9659('0xf'));var hardwareService=require(_0x9659('0x10'));var logger=require('../../config/logger')(_0x9659('0x11'));var utils=require('../../config/utils');var config=require(_0x9659('0x12'));var licenseUtil=require(_0x9659('0x13'));var db=require(_0x9659('0x14'))['db'];function respondWithStatusCode(_0x567463,_0x1f4884){_0x1f4884=_0x1f4884||0xcc;return function(_0x414542){if(_0x414542){return _0x567463[_0x9659('0x15')](_0x1f4884);}return _0x567463[_0x9659('0x16')](_0x1f4884)[_0x9659('0x17')]();};}function respondWithResult(_0x38a89e,_0x805d8c){_0x805d8c=_0x805d8c||0xc8;return function(_0x3a3b18){if(_0x3a3b18){return _0x38a89e[_0x9659('0x16')](_0x805d8c)[_0x9659('0x18')](_0x3a3b18);}};}function respondWithFilteredResult(_0x323c10,_0x122fe4){return function(_0x23e514){if(_0x23e514){var _0x23098d=typeof _0x122fe4['offset']===_0x9659('0x19')&&typeof _0x122fe4[_0x9659('0x1a')]===_0x9659('0x19');var _0x3948c5=_0x23e514[_0x9659('0x1b')];var _0x434249=_0x23098d?0x0:_0x122fe4[_0x9659('0x1c')];var _0x266721=_0x23098d?_0x23e514[_0x9659('0x1b')]:_0x122fe4['offset']+_0x122fe4[_0x9659('0x1a')];var _0xaa8560;if(_0x266721>=_0x3948c5){_0x266721=_0x3948c5;_0xaa8560=0xc8;}else{_0xaa8560=0xce;}_0x323c10[_0x9659('0x16')](_0xaa8560);return _0x323c10['set'](_0x9659('0x1d'),_0x434249+'-'+_0x266721+'/'+_0x3948c5)['json'](_0x23e514);}return null;};}function patchUpdates(_0x301c36){return function(_0x3c4a1e){try{jsonpatch[_0x9659('0x1e')](_0x3c4a1e,_0x301c36,!![]);}catch(_0x245cf4){return BPromise[_0x9659('0x1f')](_0x245cf4);}return _0x3c4a1e[_0x9659('0x20')]();};}function saveUpdates(_0x5d4eb5,_0x31a3c9){return function(_0x34e36f){if(_0x34e36f){return _0x34e36f['update'](_0x5d4eb5)[_0x9659('0x21')](function(_0x44055f){return _0x44055f;});}return null;};}function removeEntity(_0x170837,_0x54a727){return function(_0x34cff7){if(_0x34cff7){return _0x34cff7[_0x9659('0x22')]()[_0x9659('0x21')](function(){var _0x46f3c6=_0x34cff7[_0x9659('0x23')]({'plain':!![]});var _0x581c68=_0x9659('0x24');return db[_0x9659('0x25')][_0x9659('0x22')]({'where':{'type':_0x581c68,'resourceId':_0x46f3c6['id']}})[_0x9659('0x21')](function(){return _0x34cff7;});})['then'](function(){_0x170837[_0x9659('0x16')](0xcc)[_0x9659('0x17')]();});}};}function handleEntityNotFound(_0x46ca50,_0x12093a){return function(_0x49389b){if(!_0x49389b){_0x46ca50[_0x9659('0x15')](0x194);}return _0x49389b;};}function handleError(_0x4795d1,_0x326e47){_0x326e47=_0x326e47||0x1f4;return function(_0x5bf928){logger[_0x9659('0x26')](_0x5bf928['stack']);if(_0x5bf928['name']){delete _0x5bf928[_0x9659('0x27')];}_0x4795d1[_0x9659('0x16')](_0x326e47)['send'](_0x5bf928);};}exports[_0x9659('0x28')]=function(_0x4d1b05,_0x87a153){var _0x8a399d={},_0x8e0005={},_0x2a24d0={'count':0x0,'rows':[]};var _0x3aae90=_[_0x9659('0x29')](db[_0x9659('0x2a')]['rawAttributes'],function(_0x28e92f){return{'name':_0x28e92f[_0x9659('0x2b')],'type':_0x28e92f[_0x9659('0x2c')]['key']};});_0x8e0005[_0x9659('0x2d')]=_[_0x9659('0x29')](_0x3aae90,'name');_0x8e0005[_0x9659('0x2e')]=_[_0x9659('0x2f')](_0x4d1b05['query']);_0x8e0005[_0x9659('0x30')]=_[_0x9659('0x31')](_0x8e0005['model'],_0x8e0005[_0x9659('0x2e')]);_0x8a399d[_0x9659('0x32')]=_[_0x9659('0x31')](_0x8e0005[_0x9659('0x2d')],qs[_0x9659('0x33')](_0x4d1b05[_0x9659('0x2e')][_0x9659('0x33')]));_0x8a399d[_0x9659('0x32')]=_0x8a399d[_0x9659('0x32')][_0x9659('0x34')]?_0x8a399d[_0x9659('0x32')]:_0x8e0005[_0x9659('0x2d')];if(!_0x4d1b05[_0x9659('0x2e')][_0x9659('0x35')](_0x9659('0x36'))){_0x8a399d['limit']=qs[_0x9659('0x1a')](_0x4d1b05[_0x9659('0x2e')]['limit']);_0x8a399d[_0x9659('0x1c')]=qs[_0x9659('0x1c')](_0x4d1b05[_0x9659('0x2e')][_0x9659('0x1c')]);}_0x8a399d[_0x9659('0x37')]=qs[_0x9659('0x38')](_0x4d1b05[_0x9659('0x2e')][_0x9659('0x38')]);_0x8a399d[_0x9659('0x39')]=qs[_0x9659('0x30')](_['pick'](_0x4d1b05[_0x9659('0x2e')],_0x8e0005[_0x9659('0x30')]),_0x3aae90);if(_0x4d1b05[_0x9659('0x2e')][_0x9659('0x3a')]){_0x8a399d[_0x9659('0x39')]=_[_0x9659('0x3b')](_0x8a399d[_0x9659('0x39')],{'$or':_[_0x9659('0x29')](_0x3aae90,function(_0x422aa6){if(_0x422aa6[_0x9659('0x2c')]!==_0x9659('0x3c')){var _0x8b0139={};_0x8b0139[_0x422aa6[_0x9659('0x27')]]={'$like':'%'+_0x4d1b05['query'][_0x9659('0x3a')]+'%'};return _0x8b0139;}})});}_0x8a399d=_[_0x9659('0x3b')]({},_0x8a399d,_0x4d1b05[_0x9659('0x3d')]);var _0x579515={'where':_0x8a399d[_0x9659('0x39')]};return db[_0x9659('0x2a')][_0x9659('0x1b')](_0x579515)[_0x9659('0x21')](function(_0x260ecc){_0x2a24d0[_0x9659('0x1b')]=_0x260ecc;if(_0x4d1b05[_0x9659('0x2e')][_0x9659('0x3e')]){_0x8a399d['include']=[{'all':!![]}];}return db[_0x9659('0x2a')][_0x9659('0x3f')](_0x8a399d);})[_0x9659('0x21')](function(_0x4cf009){_0x2a24d0[_0x9659('0x40')]=_0x4cf009;return _0x2a24d0;})[_0x9659('0x21')](respondWithFilteredResult(_0x87a153,_0x8a399d))[_0x9659('0x41')](handleError(_0x87a153,null));};exports[_0x9659('0x42')]=function(_0x1597f8,_0x72d45e){var _0x3b0d77={'raw':![],'where':{'id':_0x1597f8[_0x9659('0x43')]['id']}},_0x316de6={};_0x316de6['model']=_[_0x9659('0x2f')](db[_0x9659('0x2a')][_0x9659('0x44')]);_0x316de6[_0x9659('0x2e')]=_[_0x9659('0x2f')](_0x1597f8[_0x9659('0x2e')]);_0x316de6[_0x9659('0x30')]=_[_0x9659('0x31')](_0x316de6['model'],_0x316de6[_0x9659('0x2e')]);_0x3b0d77[_0x9659('0x32')]=_['intersection'](_0x316de6['model'],qs[_0x9659('0x33')](_0x1597f8[_0x9659('0x2e')]['fields']));_0x3b0d77['attributes']=_0x3b0d77['attributes'][_0x9659('0x34')]?_0x3b0d77[_0x9659('0x32')]:_0x316de6[_0x9659('0x2d')];if(_0x1597f8['query']['includeAll']){_0x3b0d77[_0x9659('0x45')]=[{'all':!![]}];}_0x3b0d77=_[_0x9659('0x3b')]({},_0x3b0d77,_0x1597f8[_0x9659('0x3d')]);return db[_0x9659('0x2a')]['find'](_0x3b0d77)[_0x9659('0x21')](handleEntityNotFound(_0x72d45e,null))[_0x9659('0x21')](respondWithResult(_0x72d45e,null))[_0x9659('0x41')](handleError(_0x72d45e,null));};exports['create']=function(_0x3b590e,_0x2dc821){return db[_0x9659('0x2a')][_0x9659('0x46')](_0x3b590e[_0x9659('0x47')],{})[_0x9659('0x21')](function(_0x16f6f2){var _0x49940e=_0x3b590e[_0x9659('0x48')][_0x9659('0x23')]({'plain':!![]});if(!_0x49940e)throw new Error(_0x9659('0x49'));if(_0x49940e[_0x9659('0x4a')]===_0x9659('0x48')){var _0x19c1e4=_0x16f6f2[_0x9659('0x23')]({'plain':!![]});var _0x3e93b9=_0x9659('0x24');return db['UserProfileSection'][_0x9659('0x4b')]({'where':{'name':_0x3e93b9,'userProfileId':_0x49940e[_0x9659('0x4c')]},'raw':!![]})['then'](function(_0x19582c){if(_0x19582c&&_0x19582c[_0x9659('0x4d')]===0x0){return db[_0x9659('0x25')][_0x9659('0x46')]({'name':_0x19c1e4[_0x9659('0x27')],'resourceId':_0x19c1e4['id'],'type':_0x19582c[_0x9659('0x27')],'sectionId':_0x19582c['id']},{})[_0x9659('0x21')](function(){return _0x16f6f2;});}else{return _0x16f6f2;}})[_0x9659('0x41')](function(_0x2d8803){logger['error'](_0x9659('0x4e'),_0x2d8803);throw _0x2d8803;});}return _0x16f6f2;})[_0x9659('0x21')](respondWithResult(_0x2dc821,0xc9))[_0x9659('0x41')](handleError(_0x2dc821,null));};exports[_0x9659('0x4f')]=function(_0x39b842,_0x210edb){if(_0x39b842['body']['id']){delete _0x39b842[_0x9659('0x47')]['id'];}return db[_0x9659('0x2a')][_0x9659('0x4b')]({'where':{'id':_0x39b842[_0x9659('0x43')]['id']}})[_0x9659('0x21')](handleEntityNotFound(_0x210edb,null))[_0x9659('0x21')](saveUpdates(_0x39b842[_0x9659('0x47')],null))[_0x9659('0x21')](respondWithResult(_0x210edb,null))[_0x9659('0x41')](handleError(_0x210edb,null));};exports[_0x9659('0x22')]=function(_0x2465f9,_0xdca12e){return db['VoiceChanSpy'][_0x9659('0x4b')]({'where':{'id':_0x2465f9[_0x9659('0x43')]['id']}})[_0x9659('0x21')](handleEntityNotFound(_0xdca12e,null))[_0x9659('0x21')](removeEntity(_0xdca12e,null))[_0x9659('0x41')](handleError(_0xdca12e,null));};
\ No newline at end of file
+var _0x7333=['include','keys','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','params','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1a9798,_0x2c033b){var _0x343a05=function(_0x5a29a8){while(--_0x5a29a8){_0x1a9798['push'](_0x1a9798['shift']());}};_0x343a05(++_0x2c033b);}(_0x7333,0xfc));var _0x3733=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7333[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3733('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3733('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3733('0x2'));var moment=require(_0x3733('0x3'));var BPromise=require(_0x3733('0x4'));var Mustache=require('mustache');var util=require(_0x3733('0x5'));var path=require(_0x3733('0x6'));var sox=require(_0x3733('0x7'));var csv=require('to-csv');var ejs=require(_0x3733('0x8'));var fs=require('fs');var fs_extra=require(_0x3733('0x9'));var _=require(_0x3733('0xa'));var squel=require(_0x3733('0xb'));var crypto=require('crypto');var jsforce=require(_0x3733('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3733('0xd'));var querystring=require(_0x3733('0xe'));var Papa=require(_0x3733('0xf'));var Redis=require(_0x3733('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3733('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3733('0x12'));var logger=require(_0x3733('0x13'))(_0x3733('0x14'));var utils=require(_0x3733('0x15'));var config=require(_0x3733('0x16'));var licenseUtil=require(_0x3733('0x17'));var db=require(_0x3733('0x18'))['db'];function respondWithStatusCode(_0x1402f8,_0x331f5d){_0x331f5d=_0x331f5d||0xcc;return function(_0x1fa139){if(_0x1fa139){return _0x1402f8[_0x3733('0x19')](_0x331f5d);}return _0x1402f8['status'](_0x331f5d)['end']();};}function respondWithResult(_0x387268,_0x2de05f){_0x2de05f=_0x2de05f||0xc8;return function(_0x402489){if(_0x402489){return _0x387268[_0x3733('0x1a')](_0x2de05f)[_0x3733('0x1b')](_0x402489);}};}function respondWithFilteredResult(_0x46a03e,_0x520008){return function(_0x1fd598){if(_0x1fd598){var _0x607186=typeof _0x520008[_0x3733('0x1c')]===_0x3733('0x1d')&&typeof _0x520008['limit']===_0x3733('0x1d');var _0x79ae75=_0x1fd598[_0x3733('0x1e')];var _0xd0f743=_0x607186?0x0:_0x520008['offset'];var _0x24a91e=_0x607186?_0x1fd598[_0x3733('0x1e')]:_0x520008[_0x3733('0x1c')]+_0x520008[_0x3733('0x1f')];var _0x981f37;if(_0x24a91e>=_0x79ae75){_0x24a91e=_0x79ae75;_0x981f37=0xc8;}else{_0x981f37=0xce;}_0x46a03e[_0x3733('0x1a')](_0x981f37);return _0x46a03e[_0x3733('0x20')](_0x3733('0x21'),_0xd0f743+'-'+_0x24a91e+'/'+_0x79ae75)[_0x3733('0x1b')](_0x1fd598);}return null;};}function patchUpdates(_0x48e182){return function(_0x92539){try{jsonpatch[_0x3733('0x22')](_0x92539,_0x48e182,!![]);}catch(_0x168fb5){return BPromise['reject'](_0x168fb5);}return _0x92539[_0x3733('0x23')]();};}function saveUpdates(_0x2fee60,_0x425495){return function(_0xab24eb){if(_0xab24eb){return _0xab24eb[_0x3733('0x24')](_0x2fee60)[_0x3733('0x25')](function(_0x81016){return _0x81016;});}return null;};}function removeEntity(_0x48826c,_0x3187a3){return function(_0x483904){if(_0x483904){return _0x483904[_0x3733('0x26')]()[_0x3733('0x25')](function(){var _0x24512a=_0x483904[_0x3733('0x27')]({'plain':!![]});var _0x3f77d0=_0x3733('0x28');return db[_0x3733('0x29')][_0x3733('0x26')]({'where':{'type':_0x3f77d0,'resourceId':_0x24512a['id']}})[_0x3733('0x25')](function(){return _0x483904;});})['then'](function(){_0x48826c[_0x3733('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x512a98,_0x46ee12){return function(_0x12169e){if(!_0x12169e){_0x512a98[_0x3733('0x19')](0x194);}return _0x12169e;};}function handleError(_0x4a2801,_0xe68681){_0xe68681=_0xe68681||0x1f4;return function(_0x375dc2){logger[_0x3733('0x2a')](_0x375dc2[_0x3733('0x2b')]);if(_0x375dc2[_0x3733('0x2c')]){delete _0x375dc2[_0x3733('0x2c')];}_0x4a2801[_0x3733('0x1a')](_0xe68681)['send'](_0x375dc2);};}exports[_0x3733('0x2d')]=function(_0x15cf54,_0x414f69){var _0x934ddc={},_0x4794fd={},_0x5ce0e6={'count':0x0,'rows':[]};var _0x2fef61=_['map'](db[_0x3733('0x2e')]['rawAttributes'],function(_0x10ac22){return{'name':_0x10ac22[_0x3733('0x2f')],'type':_0x10ac22[_0x3733('0x30')][_0x3733('0x31')]};});_0x4794fd[_0x3733('0x32')]=_[_0x3733('0x33')](_0x2fef61,_0x3733('0x2c'));_0x4794fd[_0x3733('0x34')]=_['keys'](_0x15cf54[_0x3733('0x34')]);_0x4794fd[_0x3733('0x35')]=_[_0x3733('0x36')](_0x4794fd[_0x3733('0x32')],_0x4794fd[_0x3733('0x34')]);_0x934ddc[_0x3733('0x37')]=_[_0x3733('0x36')](_0x4794fd[_0x3733('0x32')],qs[_0x3733('0x38')](_0x15cf54[_0x3733('0x34')][_0x3733('0x38')]));_0x934ddc[_0x3733('0x37')]=_0x934ddc[_0x3733('0x37')][_0x3733('0x39')]?_0x934ddc[_0x3733('0x37')]:_0x4794fd['model'];if(!_0x15cf54[_0x3733('0x34')][_0x3733('0x3a')](_0x3733('0x3b'))){_0x934ddc[_0x3733('0x1f')]=qs[_0x3733('0x1f')](_0x15cf54['query'][_0x3733('0x1f')]);_0x934ddc['offset']=qs[_0x3733('0x1c')](_0x15cf54[_0x3733('0x34')][_0x3733('0x1c')]);}_0x934ddc['order']=qs[_0x3733('0x3c')](_0x15cf54['query'][_0x3733('0x3c')]);_0x934ddc[_0x3733('0x3d')]=qs['filters'](_[_0x3733('0x3e')](_0x15cf54[_0x3733('0x34')],_0x4794fd[_0x3733('0x35')]),_0x2fef61);if(_0x15cf54['query'][_0x3733('0x3f')]){_0x934ddc[_0x3733('0x3d')]=_[_0x3733('0x40')](_0x934ddc[_0x3733('0x3d')],{'$or':_[_0x3733('0x33')](_0x2fef61,function(_0x81b214){if(_0x81b214['type']!==_0x3733('0x41')){var _0x499519={};_0x499519[_0x81b214['name']]={'$like':'%'+_0x15cf54[_0x3733('0x34')][_0x3733('0x3f')]+'%'};return _0x499519;}})});}_0x934ddc=_[_0x3733('0x40')]({},_0x934ddc,_0x15cf54[_0x3733('0x42')]);var _0x1b310f={'where':_0x934ddc['where']};return db[_0x3733('0x2e')]['count'](_0x1b310f)['then'](function(_0x358263){_0x5ce0e6[_0x3733('0x1e')]=_0x358263;if(_0x15cf54[_0x3733('0x34')][_0x3733('0x43')]){_0x934ddc[_0x3733('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x934ddc);})[_0x3733('0x25')](function(_0x3b0f86){_0x5ce0e6['rows']=_0x3b0f86;return _0x5ce0e6;})['then'](respondWithFilteredResult(_0x414f69,_0x934ddc))['catch'](handleError(_0x414f69,null));};exports['show']=function(_0x4d1f81,_0x2d0cfd){var _0x5c6846={'raw':![],'where':{'id':_0x4d1f81['params']['id']}},_0x5032ae={};_0x5032ae['model']=_[_0x3733('0x45')](db[_0x3733('0x2e')][_0x3733('0x46')]);_0x5032ae['query']=_[_0x3733('0x45')](_0x4d1f81[_0x3733('0x34')]);_0x5032ae[_0x3733('0x35')]=_['intersection'](_0x5032ae[_0x3733('0x32')],_0x5032ae[_0x3733('0x34')]);_0x5c6846[_0x3733('0x37')]=_[_0x3733('0x36')](_0x5032ae['model'],qs[_0x3733('0x38')](_0x4d1f81[_0x3733('0x34')]['fields']));_0x5c6846['attributes']=_0x5c6846['attributes'][_0x3733('0x39')]?_0x5c6846[_0x3733('0x37')]:_0x5032ae[_0x3733('0x32')];if(_0x4d1f81[_0x3733('0x34')][_0x3733('0x43')]){_0x5c6846['include']=[{'all':!![]}];}_0x5c6846=_[_0x3733('0x40')]({},_0x5c6846,_0x4d1f81[_0x3733('0x42')]);return db['VoiceChanSpy']['find'](_0x5c6846)[_0x3733('0x25')](handleEntityNotFound(_0x2d0cfd,null))['then'](respondWithResult(_0x2d0cfd,null))[_0x3733('0x47')](handleError(_0x2d0cfd,null));};exports[_0x3733('0x48')]=function(_0x10bdd9,_0xff007b){return db['VoiceChanSpy']['create'](_0x10bdd9[_0x3733('0x49')],{})['then'](function(_0x4014d8){var _0x4ade13=_0x10bdd9[_0x3733('0x4a')]['get']({'plain':!![]});if(!_0x4ade13)throw new Error(_0x3733('0x4b'));if(_0x4ade13['role']===_0x3733('0x4a')){var _0x4924c2=_0x4014d8[_0x3733('0x27')]({'plain':!![]});var _0x525d63=_0x3733('0x28');return db[_0x3733('0x4c')][_0x3733('0x4d')]({'where':{'name':_0x525d63,'userProfileId':_0x4ade13[_0x3733('0x4e')]},'raw':!![]})[_0x3733('0x25')](function(_0x18fde2){if(_0x18fde2&&_0x18fde2['autoAssociation']===0x0){return db[_0x3733('0x29')][_0x3733('0x48')]({'name':_0x4924c2[_0x3733('0x2c')],'resourceId':_0x4924c2['id'],'type':_0x18fde2[_0x3733('0x2c')],'sectionId':_0x18fde2['id']},{})[_0x3733('0x25')](function(){return _0x4014d8;});}else{return _0x4014d8;}})[_0x3733('0x47')](function(_0x3f0e22){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f0e22);throw _0x3f0e22;});}return _0x4014d8;})[_0x3733('0x25')](respondWithResult(_0xff007b,0xc9))['catch'](handleError(_0xff007b,null));};exports[_0x3733('0x24')]=function(_0x459df8,_0xc44dad){if(_0x459df8[_0x3733('0x49')]['id']){delete _0x459df8['body']['id'];}return db[_0x3733('0x2e')][_0x3733('0x4d')]({'where':{'id':_0x459df8[_0x3733('0x4f')]['id']}})[_0x3733('0x25')](handleEntityNotFound(_0xc44dad,null))['then'](saveUpdates(_0x459df8[_0x3733('0x49')],null))[_0x3733('0x25')](respondWithResult(_0xc44dad,null))[_0x3733('0x47')](handleError(_0xc44dad,null));};exports[_0x3733('0x26')]=function(_0x2a47c3,_0x2617d1){return db[_0x3733('0x2e')][_0x3733('0x4d')]({'where':{'id':_0x2a47c3[_0x3733('0x4f')]['id']}})[_0x3733('0x25')](handleEntityNotFound(_0x2617d1,null))[_0x3733('0x25')](removeEntity(_0x2617d1,null))['catch'](handleError(_0x2617d1,null));};
\ No newline at end of file
index ff34c88..af5d74f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf422=['voice_chanspy','length','VoiceExtension','bulkCreate','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','prefix','push','format','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','concat','internal','name','then','catch','models','define','VoiceChanSpy'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xf422,0x10d));var _0x2f42=function(_0x5d87c8,_0x1a943f){_0x5d87c8=_0x5d87c8-0x0;var _0xba3816=_0xf422[_0x5d87c8];return _0xba3816;};'use strict';var _=require('lodash');var util=require(_0x2f42('0x0'));var BPromise=require(_0x2f42('0x1'));var attributes=require(_0x2f42('0x2'));var getUserApplications=function(_0x460b08,_0x597bdf,_0xd45144){var _0x4f72e7=0x1;var _0x58685d=[];var _0x22d907={'context':_0x597bdf[_0x2f42('0x3')]||_0x2f42('0x4'),'exten':util['format']('%s%s',_0x460b08[_0x2f42('0x5')],_0xd45144),'type':'system','isApp':![],'ChanSpyId':_0x460b08['id'],'UserId':_0x597bdf['id']};_0x58685d[_0x2f42('0x6')](_['merge']({'app':'Set','appdata':util[_0x2f42('0x7')](_0x2f42('0x8'),_0x2f42('0x9')),'priority':_0x4f72e7++},_0x22d907));if(_0x460b08[_0x2f42('0xa')]){_0x58685d['push'](_[_0x2f42('0xb')]({'app':_0x2f42('0xc'),'appdata':util[_0x2f42('0x7')](_0x2f42('0xd'),_0x460b08['recordingFormat']),'priority':_0x4f72e7++},_0x22d907));}if(_0x460b08['auth']){_0x58685d['push'](_[_0x2f42('0xb')]({'app':_0x2f42('0xe'),'appdata':_0x460b08[_0x2f42('0xf')],'priority':_0x4f72e7++},_0x22d907));}_0x58685d[_0x2f42('0x6')](_[_0x2f42('0xb')]({'app':_0x2f42('0x10'),'appdata':util[_0x2f42('0x7')](_0x2f42('0x11'),_0x597bdf['name'],_0x460b08['options']?_0x460b08[_0x2f42('0x12')][_0x2f42('0x13')](''):''),'priority':_0x4f72e7++},_0x22d907));if(_0x460b08['record']){_0x58685d[_0x2f42('0x6')](_[_0x2f42('0xb')]({'app':'StopMixMonitor','priority':_0x4f72e7++},_0x22d907));}return _0x58685d;};var getChanSpyApplications=function(_0x271c0f,_0x4d0b15){var _0x259363=[];for(var _0x5dd056=0x0,_0x4163bf=0x1;_0x5dd056<_0x4d0b15['length'];_0x5dd056++,_0x4163bf=0x1){_0x259363=_0x259363[_0x2f42('0x14')](getUserApplications(_0x271c0f,_0x4d0b15[_0x5dd056],_0x4d0b15[_0x5dd056][_0x2f42('0x15')]));if(_0x4d0b15[_0x5dd056]['internal']!=_0x4d0b15[_0x5dd056][_0x2f42('0x16')]){_0x259363=_0x259363[_0x2f42('0x14')](getUserApplications(_0x271c0f,_0x4d0b15[_0x5dd056],_0x4d0b15[_0x5dd056]['name']));}}return _0x259363;};var getChanSpyPromise=function(_0x39a276,_0xee2bfb){return new BPromise(function(_0x39b91f,_0x705034){return _0x39a276['User']['findAll']({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x2f42('0x17')](function(_0x3d0fe6){if(_0x3d0fe6){return _0x39b91f(getChanSpyApplications(_0xee2bfb,_0x3d0fe6));}return _0x39b91f([]);})[_0x2f42('0x18')](function(_0x30b6a1){_0x705034(_0x30b6a1);});});};module['exports']=function(_0x16554c,_0x980a3){var _0x3408e4=_0x16554c[_0x2f42('0x19')];return _0x16554c[_0x2f42('0x1a')](_0x2f42('0x1b'),attributes,{'tableName':_0x2f42('0x1c'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x48efe4,_0x44117e,_0x33b0dd){return getChanSpyPromise(_0x3408e4,_0x48efe4)[_0x2f42('0x17')](function(_0x1985bf){if(_0x1985bf&&_0x1985bf[_0x2f42('0x1d')]){return _0x3408e4[_0x2f42('0x1e')][_0x2f42('0x1f')](_0x1985bf);}})['then'](function(){_0x33b0dd();})[_0x2f42('0x18')](function(_0xd412fd){_0x33b0dd(_0xd412fd);});},'afterUpdate':function(_0x4f902b,_0x3a8a1c,_0x3ee3d1){return _0x3408e4[_0x2f42('0x1e')][_0x2f42('0x20')]({'where':{'ChanSpyId':_0x4f902b['id']}})[_0x2f42('0x17')](function(){return getChanSpyPromise(_0x3408e4,_0x4f902b);})['then'](function(_0x1c8614){if(_0x1c8614&&_0x1c8614[_0x2f42('0x1d')]){return _0x3408e4[_0x2f42('0x1e')]['bulkCreate'](_0x1c8614);}})[_0x2f42('0x17')](function(){_0x3ee3d1();})[_0x2f42('0x18')](function(_0x36af0c){_0x3ee3d1(_0x36af0c);});},'afterDestroy':function(_0x450b1c,_0x18b9c2,_0x42e963){return _0x3408e4[_0x2f42('0x1e')][_0x2f42('0x20')]({'where':{'ChanSpyId':_0x450b1c['id']}})[_0x2f42('0x17')](function(){_0x42e963();})[_0x2f42('0x18')](function(_0x2f6441){_0x42e963(_0x2f6441);});}}});};
\ No newline at end of file
+var _0xcbb6=['record','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xcbb6,0x15a));var _0x6cbb=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xcbb6[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x6cbb('0x0'));var util=require('util');var BPromise=require(_0x6cbb('0x1'));var attributes=require(_0x6cbb('0x2'));var getUserApplications=function(_0x5d6383,_0x25919a,_0x18d5f9){var _0x18a6b6=0x1;var _0x288c01=[];var _0x35a758={'context':_0x25919a[_0x6cbb('0x3')]||_0x6cbb('0x4'),'exten':util[_0x6cbb('0x5')](_0x6cbb('0x6'),_0x5d6383[_0x6cbb('0x7')],_0x18d5f9),'type':_0x6cbb('0x8'),'isApp':![],'ChanSpyId':_0x5d6383['id'],'UserId':_0x25919a['id']};_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0xb'),'appdata':util[_0x6cbb('0x5')](_0x6cbb('0xc'),_0x6cbb('0xd')),'priority':_0x18a6b6++},_0x35a758));if(_0x5d6383[_0x6cbb('0xe')]){_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0xf'),'appdata':util[_0x6cbb('0x5')]('${UNIQUEID}.%s,a',_0x5d6383[_0x6cbb('0x10')]),'priority':_0x18a6b6++},_0x35a758));}if(_0x5d6383[_0x6cbb('0x11')]){_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0x12'),'appdata':_0x5d6383['password'],'priority':_0x18a6b6++},_0x35a758));}_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0x13'),'appdata':util['format'](_0x6cbb('0x14'),_0x25919a['name'],_0x5d6383[_0x6cbb('0x15')]?_0x5d6383[_0x6cbb('0x15')][_0x6cbb('0x16')](''):''),'priority':_0x18a6b6++},_0x35a758));if(_0x5d6383['record']){_0x288c01[_0x6cbb('0x9')](_[_0x6cbb('0xa')]({'app':_0x6cbb('0x17'),'priority':_0x18a6b6++},_0x35a758));}return _0x288c01;};var getChanSpyApplications=function(_0x36fd10,_0x55a37c){var _0x145059=[];for(var _0x52aaba=0x0,_0x48fc6b=0x1;_0x52aaba<_0x55a37c[_0x6cbb('0x18')];_0x52aaba++,_0x48fc6b=0x1){_0x145059=_0x145059[_0x6cbb('0x19')](getUserApplications(_0x36fd10,_0x55a37c[_0x52aaba],_0x55a37c[_0x52aaba][_0x6cbb('0x1a')]));if(_0x55a37c[_0x52aaba][_0x6cbb('0x1a')]!=_0x55a37c[_0x52aaba][_0x6cbb('0x1b')]){_0x145059=_0x145059['concat'](getUserApplications(_0x36fd10,_0x55a37c[_0x52aaba],_0x55a37c[_0x52aaba]['name']));}}return _0x145059;};var getChanSpyPromise=function(_0xa3dbff,_0x2de68b){return new BPromise(function(_0x49c137,_0x3ab551){return _0xa3dbff['User'][_0x6cbb('0x1c')]({'attributes':['id',_0x6cbb('0x1b'),_0x6cbb('0x1a')],'where':{'role':_0x6cbb('0x1d'),'chanspy':!![]},'raw':!![]})[_0x6cbb('0x1e')](function(_0x392154){if(_0x392154){return _0x49c137(getChanSpyApplications(_0x2de68b,_0x392154));}return _0x49c137([]);})[_0x6cbb('0x1f')](function(_0x222345){_0x3ab551(_0x222345);});});};module[_0x6cbb('0x20')]=function(_0x13842e,_0x249670){var _0xb642f7=_0x13842e[_0x6cbb('0x21')];return _0x13842e[_0x6cbb('0x22')](_0x6cbb('0x23'),attributes,{'tableName':_0x6cbb('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x332e3e,_0x4e6a80,_0x18f68a){return getChanSpyPromise(_0xb642f7,_0x332e3e)['then'](function(_0x1ce543){if(_0x1ce543&&_0x1ce543[_0x6cbb('0x18')]){return _0xb642f7[_0x6cbb('0x25')]['bulkCreate'](_0x1ce543);}})[_0x6cbb('0x1e')](function(){_0x18f68a();})['catch'](function(_0x98931c){_0x18f68a(_0x98931c);});},'afterUpdate':function(_0x3bb82f,_0x36f78e,_0x470fed){return _0xb642f7['VoiceExtension'][_0x6cbb('0x26')]({'where':{'ChanSpyId':_0x3bb82f['id']}})['then'](function(){return getChanSpyPromise(_0xb642f7,_0x3bb82f);})[_0x6cbb('0x1e')](function(_0x40acd8){if(_0x40acd8&&_0x40acd8[_0x6cbb('0x18')]){return _0xb642f7[_0x6cbb('0x25')][_0x6cbb('0x27')](_0x40acd8);}})[_0x6cbb('0x1e')](function(){_0x470fed();})[_0x6cbb('0x1f')](function(_0x12a179){_0x470fed(_0x12a179);});},'afterDestroy':function(_0x3421fe,_0x2bced1,_0x1a4fa1){return _0xb642f7['VoiceExtension'][_0x6cbb('0x26')]({'where':{'ChanSpyId':_0x3421fe['id']}})['then'](function(){_0x1a4fa1();})[_0x6cbb('0x1f')](function(_0x15c873){_0x1a4fa1(_0x15c873);});}}});};
\ No newline at end of file
index da42649..a306095 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc901=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','lodash'];(function(_0x209bb2,_0x3950e6){var _0xdbedfe=function(_0x1617a9){while(--_0x1617a9){_0x209bb2['push'](_0x209bb2['shift']());}};_0xdbedfe(++_0x3950e6);}(_0xc901,0x142));var _0x1c90=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc901[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x1c90('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c90('0x1'));var db=require(_0x1c90('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c90('0x3'))(_0x1c90('0x4'));var config=require(_0x1c90('0x5'));var jayson=require(_0x1c90('0x6'));var client=jayson[_0x1c90('0x7')][_0x1c90('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x912860,_0x12c07d,_0x423cfb){return new BPromise(function(_0x19196f,_0x514386){return client[_0x1c90('0x9')](_0x912860,_0x423cfb)[_0x1c90('0xa')](function(_0x38cd18){logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));logger[_0x1c90('0xe')](_0x1c90('0xf'),_0x12c07d,'request\x20sent',JSON['stringify'](_0x38cd18));if(_0x38cd18[_0x1c90('0x10')]){if(_0x38cd18[_0x1c90('0x10')][_0x1c90('0x11')]===0x1f4){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x38cd18[_0x1c90('0x10')][_0x1c90('0x12')]);return _0x514386(_0x38cd18['error'][_0x1c90('0x12')]);}logger[_0x1c90('0x10')](_0x1c90('0xc'),_0x12c07d,_0x38cd18['error'][_0x1c90('0x12')]);return _0x19196f(_0x38cd18['error'][_0x1c90('0x12')]);}else{logger[_0x1c90('0xb')](_0x1c90('0xc'),_0x12c07d,_0x1c90('0xd'));_0x19196f(_0x38cd18['result'][_0x1c90('0x12')]);}})['catch'](function(_0x2d3c90){logger[_0x1c90('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x12c07d,_0x2d3c90);_0x514386(_0x2d3c90);});});}
\ No newline at end of file
+var _0xcffe=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3c28c0,_0x1cb29d){var _0x12cc9f=function(_0x33d0f7){while(--_0x33d0f7){_0x3c28c0['push'](_0x3c28c0['shift']());}};_0x12cc9f(++_0x1cb29d);}(_0xcffe,0x1a1));var _0xecff=function(_0x7aaac8,_0x3a4233){_0x7aaac8=_0x7aaac8-0x0;var _0x4a8013=_0xcffe[_0x7aaac8];return _0x4a8013;};'use strict';var _=require(_0xecff('0x0'));var util=require(_0xecff('0x1'));var moment=require(_0xecff('0x2'));var BPromise=require(_0xecff('0x3'));var rs=require(_0xecff('0x4'));var fs=require('fs');var Redis=require(_0xecff('0x5'));var db=require(_0xecff('0x6'))['db'];var utils=require(_0xecff('0x7'));var logger=require(_0xecff('0x8'))(_0xecff('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xecff('0xa')][_0xecff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e2fa9,_0x38a8f6,_0x50c98b){return new BPromise(function(_0x298c19,_0x1f7386){return client['request'](_0x2e2fa9,_0x50c98b)[_0xecff('0xc')](function(_0x3eefb9){logger[_0xecff('0xd')](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));logger['debug'](_0xecff('0x10'),_0x38a8f6,_0xecff('0xf'),JSON[_0xecff('0x11')](_0x3eefb9));if(_0x3eefb9[_0xecff('0x12')]){if(_0x3eefb9[_0xecff('0x12')][_0xecff('0x13')]===0x1f4){logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);return _0x1f7386(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}logger[_0xecff('0x12')](_0xecff('0xe'),_0x38a8f6,_0x3eefb9['error']['message']);return _0x298c19(_0x3eefb9[_0xecff('0x12')][_0xecff('0x14')]);}else{logger['info'](_0xecff('0xe'),_0x38a8f6,_0xecff('0xf'));_0x298c19(_0x3eefb9[_0xecff('0x15')]['message']);}})['catch'](function(_0x24abef){logger[_0xecff('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x38a8f6,_0x24abef);_0x1f7386(_0x24abef);});});}
\ No newline at end of file
index cb8c61a..f6c8e43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a38=['../../components/auth/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','exports','path','connect-timeout','fs-extra'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0x7a38,0x1ad));var _0x87a3=function(_0x5ad795,_0x2b6cd3){_0x5ad795=_0x5ad795-0x0;var _0x7d7f42=_0x7a38[_0x5ad795];return _0x7d7f42;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x87a3('0x0'));var timeout=require(_0x87a3('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x87a3('0x2'));var auth=require(_0x87a3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x87a3('0x4'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x87a3('0x5')]);router[_0x87a3('0x6')](_0x87a3('0x7'),auth[_0x87a3('0x8')](),controller[_0x87a3('0x9')]);router[_0x87a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x87a3('0xb')]);router[_0x87a3('0xc')](_0x87a3('0x7'),auth[_0x87a3('0x8')](),controller[_0x87a3('0xd')]);router[_0x87a3('0xe')](_0x87a3('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x87a3('0xf')]=router;
\ No newline at end of file
+var _0x6766=['index','get','/:id','post','put','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x41d952,_0x16e3c5){var _0x14b0d8=function(_0x54a567){while(--_0x54a567){_0x41d952['push'](_0x41d952['shift']());}};_0x14b0d8(++_0x16e3c5);}(_0x6766,0x197));var _0x6676=function(_0x568a61,_0x2124f8){_0x568a61=_0x568a61-0x0;var _0x334c3b=_0x6766[_0x568a61];return _0x334c3b;};'use strict';var multer=require(_0x6676('0x0'));var util=require(_0x6676('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6676('0x2'));var router=express[_0x6676('0x3')]();var fs_extra=require(_0x6676('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6676('0x5'));var config=require(_0x6676('0x6'));var controller=require(_0x6676('0x7'));router['get']('/',auth[_0x6676('0x8')](),controller[_0x6676('0x9')]);router[_0x6676('0xa')](_0x6676('0xb'),auth[_0x6676('0x8')](),controller['show']);router[_0x6676('0xc')]('/',auth[_0x6676('0x8')](),controller['create']);router[_0x6676('0xd')](_0x6676('0xb'),auth[_0x6676('0x8')](),controller['update']);router[_0x6676('0xe')](_0x6676('0xb'),auth[_0x6676('0x8')](),controller['destroy']);module[_0x6676('0xf')]=router;
\ No newline at end of file
index 5abde99..aaa9cc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8354=['STRING','BOOLEAN','sequelize'];(function(_0x17bbbe,_0x5d7ac2){var _0x129365=function(_0x542797){while(--_0x542797){_0x17bbbe['push'](_0x17bbbe['shift']());}};_0x129365(++_0x5d7ac2);}(_0x8354,0xa4));var _0x4835=function(_0x51da59,_0x5d9bda){_0x51da59=_0x51da59-0x0;var _0xc4c8f0=_0x8354[_0x51da59];return _0xc4c8f0;};'use strict';var Sequelize=require(_0x4835('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x4835('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4835('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdcb8=['BOOLEAN','name'];(function(_0x44a571,_0x45b4e8){var _0x536c00=function(_0x275714){while(--_0x275714){_0x44a571['push'](_0x44a571['shift']());}};_0x536c00(++_0x45b4e8);}(_0xdcb8,0x145));var _0x8dcb=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xdcb8[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8dcb('0x0')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8dcb('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index e988370..c40d3e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaebd=['undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','Contexts','stack','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end'];(function(_0x4608f1,_0xfc9a4c){var _0x2c4bf9=function(_0x46a2cd){while(--_0x46a2cd){_0x4608f1['push'](_0x4608f1['shift']());}};_0x2c4bf9(++_0xfc9a4c);}(_0xaebd,0x167));var _0xdaeb=function(_0x1f2c25,_0x11135f){_0x1f2c25=_0x1f2c25-0x0;var _0x167330=_0xaebd[_0x1f2c25];return _0x167330;};'use strict';var emlformat=require(_0xdaeb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdaeb('0x1'));var jsonpatch=require(_0xdaeb('0x2'));var rp=require('request-promise');var moment=require(_0xdaeb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdaeb('0x4'));var util=require(_0xdaeb('0x5'));var path=require(_0xdaeb('0x6'));var sox=require(_0xdaeb('0x7'));var csv=require(_0xdaeb('0x8'));var ejs=require(_0xdaeb('0x9'));var fs=require('fs');var fs_extra=require(_0xdaeb('0xa'));var _=require(_0xdaeb('0xb'));var squel=require('squel');var crypto=require(_0xdaeb('0xc'));var jsforce=require(_0xdaeb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdaeb('0x8'));var querystring=require(_0xdaeb('0xe'));var Papa=require(_0xdaeb('0xf'));var Redis=require(_0xdaeb('0x10'));var authService=require(_0xdaeb('0x11'));var qs=require(_0xdaeb('0x12'));var as=require(_0xdaeb('0x13'));var hardwareService=require(_0xdaeb('0x14'));var logger=require(_0xdaeb('0x15'))(_0xdaeb('0x16'));var utils=require(_0xdaeb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdaeb('0x18'));var db=require(_0xdaeb('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xdaeb('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x10d372,_0x379615,_0x31961c,_0x8710e8){return new BPromise(function(_0x59e396,_0xe8e566){var _0x1264c7=_0x8710e8||client;return _0x1264c7[_0xdaeb('0x1b')](_0x10d372,_0x31961c)[_0xdaeb('0x1c')](function(_0x431ced){logger[_0xdaeb('0x1d')](_0xdaeb('0x1e'),_0x379615,_0xdaeb('0x1f'));logger['debug'](_0xdaeb('0x20'),_0x379615,_0xdaeb('0x1f'),JSON[_0xdaeb('0x21')](_0x431ced));if(_0x431ced[_0xdaeb('0x22')]){if(_0x431ced['error']['code']===0x1f4){logger[_0xdaeb('0x22')](_0xdaeb('0x1e'),_0x379615,_0x431ced['error'][_0xdaeb('0x23')]);return _0xe8e566(_0x431ced[_0xdaeb('0x22')][_0xdaeb('0x23')]);}logger[_0xdaeb('0x22')](_0xdaeb('0x1e'),_0x379615,_0x431ced[_0xdaeb('0x22')][_0xdaeb('0x23')]);return _0x59e396(_0x431ced[_0xdaeb('0x22')][_0xdaeb('0x23')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x379615,_0xdaeb('0x1f'));_0x59e396(_0x431ced[_0xdaeb('0x24')][_0xdaeb('0x23')]);}})[_0xdaeb('0x25')](function(_0x4a0bc9){logger['error'](_0xdaeb('0x1e'),_0x379615,_0x4a0bc9);_0xe8e566(_0x4a0bc9);});});}function respondWithStatusCode(_0x4e006c,_0x37fa47){_0x37fa47=_0x37fa47||0xcc;return function(_0x808160){if(_0x808160){return _0x4e006c[_0xdaeb('0x26')](_0x37fa47);}return _0x4e006c[_0xdaeb('0x27')](_0x37fa47)[_0xdaeb('0x28')]();};}function respondWithResult(_0x3154d1,_0x2d1b4f){_0x2d1b4f=_0x2d1b4f||0xc8;return function(_0x383ab4){if(_0x383ab4){return _0x3154d1[_0xdaeb('0x27')](_0x2d1b4f)['json'](_0x383ab4);}};}function respondWithFilteredResult(_0x44119c,_0x569260){return function(_0x54dc47){if(_0x54dc47){var _0x45afd6=typeof _0x569260['offset']===_0xdaeb('0x29')&&typeof _0x569260[_0xdaeb('0x2a')]===_0xdaeb('0x29');var _0x1b0af4=_0x54dc47[_0xdaeb('0x2b')];var _0x3f2212=_0x45afd6?0x0:_0x569260['offset'];var _0x295c57=_0x45afd6?_0x54dc47[_0xdaeb('0x2b')]:_0x569260[_0xdaeb('0x2c')]+_0x569260[_0xdaeb('0x2a')];var _0xab59a1;if(_0x295c57>=_0x1b0af4){_0x295c57=_0x1b0af4;_0xab59a1=0xc8;}else{_0xab59a1=0xce;}_0x44119c[_0xdaeb('0x27')](_0xab59a1);return _0x44119c[_0xdaeb('0x2d')](_0xdaeb('0x2e'),_0x3f2212+'-'+_0x295c57+'/'+_0x1b0af4)['json'](_0x54dc47);}return null;};}function patchUpdates(_0x226ff1){return function(_0x27f2ba){try{jsonpatch['apply'](_0x27f2ba,_0x226ff1,!![]);}catch(_0x27c288){return BPromise[_0xdaeb('0x2f')](_0x27c288);}return _0x27f2ba[_0xdaeb('0x30')]();};}function saveUpdates(_0xeff249,_0xd0e978){return function(_0x2ebe1e){if(_0x2ebe1e){return _0x2ebe1e[_0xdaeb('0x31')](_0xeff249)[_0xdaeb('0x1c')](function(_0x203ac3){return _0x203ac3;});}return null;};}function removeEntity(_0x149d68,_0xdd572c){return function(_0x5de819){if(_0x5de819){return _0x5de819[_0xdaeb('0x32')]()[_0xdaeb('0x1c')](function(){var _0x3fb615=_0x5de819['get']({'plain':!![]});var _0x46b8dd=_0xdaeb('0x33');return db['UserProfileResource'][_0xdaeb('0x32')]({'where':{'type':_0x46b8dd,'resourceId':_0x3fb615['id']}})['then'](function(){return _0x5de819;});})['then'](function(){_0x149d68[_0xdaeb('0x27')](0xcc)[_0xdaeb('0x28')]();});}};}function handleEntityNotFound(_0x1b97b9,_0xbf36b6){return function(_0x5e4d2d){if(!_0x5e4d2d){_0x1b97b9[_0xdaeb('0x26')](0x194);}return _0x5e4d2d;};}function handleError(_0xbc1569,_0x5d0360){_0x5d0360=_0x5d0360||0x1f4;return function(_0x258793){logger[_0xdaeb('0x22')](_0x258793[_0xdaeb('0x34')]);if(_0x258793[_0xdaeb('0x35')]){delete _0x258793['name'];}_0xbc1569[_0xdaeb('0x27')](_0x5d0360)[_0xdaeb('0x36')](_0x258793);};}exports[_0xdaeb('0x37')]=function(_0x2d61a5,_0x249630){var _0x25f63d={},_0x48562c={},_0x1029e5={'count':0x0,'rows':[]};var _0x3c2021=_[_0xdaeb('0x38')](db[_0xdaeb('0x39')]['rawAttributes'],function(_0xadae55){return{'name':_0xadae55[_0xdaeb('0x3a')],'type':_0xadae55[_0xdaeb('0x3b')][_0xdaeb('0x3c')]};});_0x48562c[_0xdaeb('0x3d')]=_[_0xdaeb('0x38')](_0x3c2021,_0xdaeb('0x35'));_0x48562c[_0xdaeb('0x3e')]=_[_0xdaeb('0x3f')](_0x2d61a5[_0xdaeb('0x3e')]);_0x48562c['filters']=_[_0xdaeb('0x40')](_0x48562c[_0xdaeb('0x3d')],_0x48562c[_0xdaeb('0x3e')]);_0x25f63d[_0xdaeb('0x41')]=_[_0xdaeb('0x40')](_0x48562c['model'],qs[_0xdaeb('0x42')](_0x2d61a5['query'][_0xdaeb('0x42')]));_0x25f63d[_0xdaeb('0x41')]=_0x25f63d[_0xdaeb('0x41')]['length']?_0x25f63d[_0xdaeb('0x41')]:_0x48562c[_0xdaeb('0x3d')];if(!_0x2d61a5[_0xdaeb('0x3e')]['hasOwnProperty'](_0xdaeb('0x43'))){_0x25f63d[_0xdaeb('0x2a')]=qs[_0xdaeb('0x2a')](_0x2d61a5[_0xdaeb('0x3e')]['limit']);_0x25f63d[_0xdaeb('0x2c')]=qs[_0xdaeb('0x2c')](_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x2c')]);}_0x25f63d[_0xdaeb('0x44')]=qs['sort'](_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x45')]);_0x25f63d[_0xdaeb('0x46')]=qs[_0xdaeb('0x47')](_['pick'](_0x2d61a5[_0xdaeb('0x3e')],_0x48562c[_0xdaeb('0x47')]),_0x3c2021);if(_0x2d61a5[_0xdaeb('0x3e')]['filter']){_0x25f63d[_0xdaeb('0x46')]=_[_0xdaeb('0x48')](_0x25f63d[_0xdaeb('0x46')],{'$or':_[_0xdaeb('0x38')](_0x3c2021,function(_0x2f35a6){if(_0x2f35a6[_0xdaeb('0x3b')]!==_0xdaeb('0x49')){var _0x2134ad={};_0x2134ad[_0x2f35a6[_0xdaeb('0x35')]]={'$like':'%'+_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x4a')]+'%'};return _0x2134ad;}})});}_0x25f63d=_[_0xdaeb('0x48')]({},_0x25f63d,_0x2d61a5[_0xdaeb('0x4b')]);var _0x44470c={'where':_0x25f63d[_0xdaeb('0x46')]};return db[_0xdaeb('0x39')][_0xdaeb('0x2b')](_0x44470c)[_0xdaeb('0x1c')](function(_0x45533a){_0x1029e5[_0xdaeb('0x2b')]=_0x45533a;if(_0x2d61a5[_0xdaeb('0x3e')][_0xdaeb('0x4c')]){_0x25f63d[_0xdaeb('0x4d')]=[{'all':!![]}];}return db[_0xdaeb('0x39')][_0xdaeb('0x4e')](_0x25f63d);})['then'](function(_0x5016bc){_0x1029e5[_0xdaeb('0x4f')]=_0x5016bc;return _0x1029e5;})[_0xdaeb('0x1c')](respondWithFilteredResult(_0x249630,_0x25f63d))['catch'](handleError(_0x249630,null));};exports[_0xdaeb('0x50')]=function(_0x48ed0a,_0x499967){var _0x3a534f={'raw':![],'where':{'id':_0x48ed0a[_0xdaeb('0x51')]['id']}},_0x857727={};_0x857727['model']=_[_0xdaeb('0x3f')](db[_0xdaeb('0x39')]['rawAttributes']);_0x857727['query']=_[_0xdaeb('0x3f')](_0x48ed0a[_0xdaeb('0x3e')]);_0x857727[_0xdaeb('0x47')]=_[_0xdaeb('0x40')](_0x857727['model'],_0x857727['query']);_0x3a534f['attributes']=_[_0xdaeb('0x40')](_0x857727[_0xdaeb('0x3d')],qs[_0xdaeb('0x42')](_0x48ed0a[_0xdaeb('0x3e')][_0xdaeb('0x42')]));_0x3a534f[_0xdaeb('0x41')]=_0x3a534f[_0xdaeb('0x41')]['length']?_0x3a534f['attributes']:_0x857727[_0xdaeb('0x3d')];if(_0x48ed0a[_0xdaeb('0x3e')][_0xdaeb('0x4c')]){_0x3a534f[_0xdaeb('0x4d')]=[{'all':!![]}];}_0x3a534f=_[_0xdaeb('0x48')]({},_0x3a534f,_0x48ed0a[_0xdaeb('0x4b')]);return db['VoiceContext']['find'](_0x3a534f)[_0xdaeb('0x1c')](handleEntityNotFound(_0x499967,null))[_0xdaeb('0x1c')](respondWithResult(_0x499967,null))['catch'](handleError(_0x499967,null));};exports['create']=function(_0x865a69,_0x16ba82,_0x5b501e){var _0x3124e5;return db[_0xdaeb('0x39')]['create'](_0x865a69[_0xdaeb('0x52')],{'raw':!![]})[_0xdaeb('0x1c')](function(_0x38f095){_0x3124e5=_0x38f095;return db[_0xdaeb('0x39')][_0xdaeb('0x4e')]({'raw':!![]});})[_0xdaeb('0x1c')](function(_0x52801d){var _0x37c44b=fs[_0xdaeb('0x53')](path[_0xdaeb('0x54')](config[_0xdaeb('0x55')],_0xdaeb('0x56')),_0xdaeb('0x57'));var _0x558812=ejs[_0xdaeb('0x58')](_0x37c44b,{'contexts':_0x52801d||[]});fs[_0xdaeb('0x59')](_0xdaeb('0x5a'),_0x558812);})[_0xdaeb('0x1c')](function(){return respondWithRpcPromise(_0xdaeb('0x5b'),_0xdaeb('0x5c'),{'module':_0xdaeb('0x5d')});})[_0xdaeb('0x1c')](function(){var _0x40d1aa=_0x865a69[_0xdaeb('0x5e')]['get']({'plain':!![]});if(!_0x40d1aa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40d1aa[_0xdaeb('0x5f')]===_0xdaeb('0x5e')){var _0xc455ed=_0x3124e5['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Contexts','userProfileId':_0x40d1aa[_0xdaeb('0x60')]},'raw':!![]})[_0xdaeb('0x1c')](function(_0x240353){if(_0x240353&&_0x240353['autoAssociation']===0x0){return db[_0xdaeb('0x61')][_0xdaeb('0x5c')]({'name':_0xc455ed[_0xdaeb('0x35')],'resourceId':_0xc455ed['id'],'type':_0x240353['name'],'sectionId':_0x240353['id']},{})['then'](function(){return _0x3124e5;});}else{return _0x3124e5;}})[_0xdaeb('0x25')](function(_0x4c49d6){logger[_0xdaeb('0x22')](_0xdaeb('0x62'),_0x4c49d6);throw _0x4c49d6;});}return _0x3124e5;})[_0xdaeb('0x1c')](respondWithResult(_0x16ba82,0xc9))[_0xdaeb('0x25')](handleError(_0x16ba82,null));};exports[_0xdaeb('0x31')]=function(_0xfacc8a,_0x228686,_0xff3364){var _0x32b925;return db[_0xdaeb('0x39')][_0xdaeb('0x63')]({'where':{'id':_0xfacc8a[_0xdaeb('0x51')]['id']}})[_0xdaeb('0x1c')](handleEntityNotFound(_0x228686,null))[_0xdaeb('0x1c')](saveUpdates(_0xfacc8a['body'],null))[_0xdaeb('0x1c')](function(_0x203f1f){if(_0x203f1f){_0x32b925=_0x203f1f;return db[_0xdaeb('0x39')][_0xdaeb('0x4e')]({'raw':!![]});}})[_0xdaeb('0x1c')](function(_0x29a3da){var _0x5aa70d=fs[_0xdaeb('0x53')](path['join'](config['root'],_0xdaeb('0x56')),'utf8');var _0x2114ae=ejs['render'](_0x5aa70d,{'contexts':_0x29a3da||[]});fs[_0xdaeb('0x59')](_0xdaeb('0x5a'),_0x2114ae);})[_0xdaeb('0x1c')](function(){return respondWithRpcPromise('Reload',_0xdaeb('0x31'),{'module':_0xdaeb('0x5d')});})[_0xdaeb('0x1c')](function(){return _0x32b925;})[_0xdaeb('0x1c')](respondWithResult(_0x228686,null))['catch'](handleError(_0x228686,null));};exports[_0xdaeb('0x32')]=function(_0x826b80,_0x41cc44,_0x2a4b5d){var _0x1efb4b;return db['VoiceContext']['find']({'where':{'id':_0x826b80[_0xdaeb('0x51')]['id']}})[_0xdaeb('0x1c')](handleEntityNotFound(_0x41cc44,null))[_0xdaeb('0x1c')](removeEntity(_0x41cc44,null))[_0xdaeb('0x1c')](function(){return db[_0xdaeb('0x39')][_0xdaeb('0x4e')]({'raw':!![]});})[_0xdaeb('0x1c')](function(_0x465356){var _0x842769=fs[_0xdaeb('0x53')](path[_0xdaeb('0x54')](config[_0xdaeb('0x55')],'server/files/templates/context.ejs'),'utf8');var _0x595eb8=ejs[_0xdaeb('0x58')](_0x842769,{'contexts':_0x465356});fs['writeFileSync'](_0xdaeb('0x5a'),_0x595eb8);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0xdaeb('0x25')](handleError(_0x41cc44,null));};
\ No newline at end of file
+var _0xc72f=['writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','chan_sip.so','render','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Contexts','stack','name','map','VoiceContext','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','findAll','show','params','includeAll','include','find','create','body','readFileSync','root','server/files/templates/context.ejs','utf8'];(function(_0x43da23,_0x38d7c4){var _0x42a792=function(_0x16af1e){while(--_0x16af1e){_0x43da23['push'](_0x43da23['shift']());}};_0x42a792(++_0x38d7c4);}(_0xc72f,0x1a6));var _0xfc72=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xc72f[_0x486f4a];return _0x135d99;};'use strict';var emlformat=require(_0xfc72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc72('0x1'));var rp=require(_0xfc72('0x2'));var moment=require(_0xfc72('0x3'));var BPromise=require(_0xfc72('0x4'));var Mustache=require(_0xfc72('0x5'));var util=require(_0xfc72('0x6'));var path=require(_0xfc72('0x7'));var sox=require('sox');var csv=require(_0xfc72('0x8'));var ejs=require(_0xfc72('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfc72('0xa'));var crypto=require(_0xfc72('0xb'));var jsforce=require(_0xfc72('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfc72('0xd'));var Papa=require(_0xfc72('0xe'));var Redis=require(_0xfc72('0xf'));var authService=require(_0xfc72('0x10'));var qs=require(_0xfc72('0x11'));var as=require(_0xfc72('0x12'));var hardwareService=require(_0xfc72('0x13'));var logger=require(_0xfc72('0x14'))('api');var utils=require(_0xfc72('0x15'));var config=require(_0xfc72('0x16'));var licenseUtil=require(_0xfc72('0x17'));var db=require(_0xfc72('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xfc72('0x19')][_0xfc72('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x42e188,_0x3d035e,_0x492be7,_0x195641){return new BPromise(function(_0x51194d,_0x5e9166){var _0x3a8c77=_0x195641||client;return _0x3a8c77[_0xfc72('0x1b')](_0x42e188,_0x492be7)[_0xfc72('0x1c')](function(_0x56ed8f){logger[_0xfc72('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0xfc72('0x1e'));logger['debug'](_0xfc72('0x1f'),_0x3d035e,'request\x20sent',JSON['stringify'](_0x56ed8f));if(_0x56ed8f[_0xfc72('0x20')]){if(_0x56ed8f['error'][_0xfc72('0x21')]===0x1f4){logger[_0xfc72('0x20')](_0xfc72('0x22'),_0x3d035e,_0x56ed8f[_0xfc72('0x20')][_0xfc72('0x23')]);return _0x5e9166(_0x56ed8f[_0xfc72('0x20')][_0xfc72('0x23')]);}logger[_0xfc72('0x20')]('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0x56ed8f[_0xfc72('0x20')]['message']);return _0x51194d(_0x56ed8f['error'][_0xfc72('0x23')]);}else{logger[_0xfc72('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0xfc72('0x1e'));_0x51194d(_0x56ed8f[_0xfc72('0x24')][_0xfc72('0x23')]);}})[_0xfc72('0x25')](function(_0x2be274){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3d035e,_0x2be274);_0x5e9166(_0x2be274);});});}function respondWithStatusCode(_0x1521f3,_0x1ff411){_0x1ff411=_0x1ff411||0xcc;return function(_0x365ff7){if(_0x365ff7){return _0x1521f3[_0xfc72('0x26')](_0x1ff411);}return _0x1521f3['status'](_0x1ff411)[_0xfc72('0x27')]();};}function respondWithResult(_0x21f9d0,_0x59159b){_0x59159b=_0x59159b||0xc8;return function(_0x48305b){if(_0x48305b){return _0x21f9d0[_0xfc72('0x28')](_0x59159b)[_0xfc72('0x29')](_0x48305b);}};}function respondWithFilteredResult(_0x322d9c,_0x58e265){return function(_0x556310){if(_0x556310){var _0x87cf7a=typeof _0x58e265[_0xfc72('0x2a')]===_0xfc72('0x2b')&&typeof _0x58e265[_0xfc72('0x2c')]===_0xfc72('0x2b');var _0x574b5d=_0x556310[_0xfc72('0x2d')];var _0x3d5429=_0x87cf7a?0x0:_0x58e265[_0xfc72('0x2a')];var _0x1c958f=_0x87cf7a?_0x556310[_0xfc72('0x2d')]:_0x58e265['offset']+_0x58e265[_0xfc72('0x2c')];var _0x3590b6;if(_0x1c958f>=_0x574b5d){_0x1c958f=_0x574b5d;_0x3590b6=0xc8;}else{_0x3590b6=0xce;}_0x322d9c[_0xfc72('0x28')](_0x3590b6);return _0x322d9c[_0xfc72('0x2e')](_0xfc72('0x2f'),_0x3d5429+'-'+_0x1c958f+'/'+_0x574b5d)[_0xfc72('0x29')](_0x556310);}return null;};}function patchUpdates(_0x4c3886){return function(_0xb2633e){try{jsonpatch[_0xfc72('0x30')](_0xb2633e,_0x4c3886,!![]);}catch(_0x1a3d10){return BPromise[_0xfc72('0x31')](_0x1a3d10);}return _0xb2633e[_0xfc72('0x32')]();};}function saveUpdates(_0x2b6dec,_0x1a62a6){return function(_0x2d8c84){if(_0x2d8c84){return _0x2d8c84[_0xfc72('0x33')](_0x2b6dec)[_0xfc72('0x1c')](function(_0x43ac43){return _0x43ac43;});}return null;};}function removeEntity(_0x43cc80,_0x31e388){return function(_0x305eb0){if(_0x305eb0){return _0x305eb0[_0xfc72('0x34')]()[_0xfc72('0x1c')](function(){var _0x1b454e=_0x305eb0['get']({'plain':!![]});var _0x3704c7=_0xfc72('0x35');return db['UserProfileResource']['destroy']({'where':{'type':_0x3704c7,'resourceId':_0x1b454e['id']}})[_0xfc72('0x1c')](function(){return _0x305eb0;});})['then'](function(){_0x43cc80['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb715b6,_0x3c1d39){return function(_0xeebf13){if(!_0xeebf13){_0xb715b6['sendStatus'](0x194);}return _0xeebf13;};}function handleError(_0x45915a,_0x330e3c){_0x330e3c=_0x330e3c||0x1f4;return function(_0x5c1097){logger['error'](_0x5c1097[_0xfc72('0x36')]);if(_0x5c1097[_0xfc72('0x37')]){delete _0x5c1097[_0xfc72('0x37')];}_0x45915a[_0xfc72('0x28')](_0x330e3c)['send'](_0x5c1097);};}exports['index']=function(_0x8cf0a6,_0x4ecfe8){var _0x32e54c={},_0x5b82f4={},_0x507708={'count':0x0,'rows':[]};var _0x13b114=_[_0xfc72('0x38')](db[_0xfc72('0x39')][_0xfc72('0x3a')],function(_0xedbb26){return{'name':_0xedbb26[_0xfc72('0x3b')],'type':_0xedbb26[_0xfc72('0x3c')]['key']};});_0x5b82f4['model']=_[_0xfc72('0x38')](_0x13b114,'name');_0x5b82f4[_0xfc72('0x3d')]=_[_0xfc72('0x3e')](_0x8cf0a6[_0xfc72('0x3d')]);_0x5b82f4[_0xfc72('0x3f')]=_[_0xfc72('0x40')](_0x5b82f4[_0xfc72('0x41')],_0x5b82f4['query']);_0x32e54c[_0xfc72('0x42')]=_['intersection'](_0x5b82f4[_0xfc72('0x41')],qs[_0xfc72('0x43')](_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x43')]));_0x32e54c[_0xfc72('0x42')]=_0x32e54c[_0xfc72('0x42')][_0xfc72('0x44')]?_0x32e54c[_0xfc72('0x42')]:_0x5b82f4['model'];if(!_0x8cf0a6[_0xfc72('0x3d')]['hasOwnProperty']('nolimit')){_0x32e54c[_0xfc72('0x2c')]=qs[_0xfc72('0x2c')](_0x8cf0a6['query']['limit']);_0x32e54c['offset']=qs[_0xfc72('0x2a')](_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x2a')]);}_0x32e54c[_0xfc72('0x45')]=qs[_0xfc72('0x46')](_0x8cf0a6[_0xfc72('0x3d')]['sort']);_0x32e54c[_0xfc72('0x47')]=qs['filters'](_['pick'](_0x8cf0a6[_0xfc72('0x3d')],_0x5b82f4[_0xfc72('0x3f')]),_0x13b114);if(_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x48')]){_0x32e54c[_0xfc72('0x47')]=_[_0xfc72('0x49')](_0x32e54c[_0xfc72('0x47')],{'$or':_[_0xfc72('0x38')](_0x13b114,function(_0xdcddd9){if(_0xdcddd9['type']!==_0xfc72('0x4a')){var _0x1bc95d={};_0x1bc95d[_0xdcddd9[_0xfc72('0x37')]]={'$like':'%'+_0x8cf0a6[_0xfc72('0x3d')][_0xfc72('0x48')]+'%'};return _0x1bc95d;}})});}_0x32e54c=_['merge']({},_0x32e54c,_0x8cf0a6[_0xfc72('0x4b')]);var _0x3f6c96={'where':_0x32e54c['where']};return db[_0xfc72('0x39')][_0xfc72('0x2d')](_0x3f6c96)['then'](function(_0x5c5967){_0x507708[_0xfc72('0x2d')]=_0x5c5967;if(_0x8cf0a6[_0xfc72('0x3d')]['includeAll']){_0x32e54c['include']=[{'all':!![]}];}return db[_0xfc72('0x39')][_0xfc72('0x4c')](_0x32e54c);})[_0xfc72('0x1c')](function(_0x7ad03b){_0x507708['rows']=_0x7ad03b;return _0x507708;})[_0xfc72('0x1c')](respondWithFilteredResult(_0x4ecfe8,_0x32e54c))[_0xfc72('0x25')](handleError(_0x4ecfe8,null));};exports[_0xfc72('0x4d')]=function(_0x147479,_0x441d7f){var _0x307372={'raw':![],'where':{'id':_0x147479[_0xfc72('0x4e')]['id']}},_0x26a057={};_0x26a057[_0xfc72('0x41')]=_[_0xfc72('0x3e')](db[_0xfc72('0x39')]['rawAttributes']);_0x26a057[_0xfc72('0x3d')]=_['keys'](_0x147479['query']);_0x26a057[_0xfc72('0x3f')]=_[_0xfc72('0x40')](_0x26a057['model'],_0x26a057['query']);_0x307372[_0xfc72('0x42')]=_['intersection'](_0x26a057[_0xfc72('0x41')],qs[_0xfc72('0x43')](_0x147479[_0xfc72('0x3d')][_0xfc72('0x43')]));_0x307372[_0xfc72('0x42')]=_0x307372['attributes'][_0xfc72('0x44')]?_0x307372[_0xfc72('0x42')]:_0x26a057[_0xfc72('0x41')];if(_0x147479[_0xfc72('0x3d')][_0xfc72('0x4f')]){_0x307372[_0xfc72('0x50')]=[{'all':!![]}];}_0x307372=_[_0xfc72('0x49')]({},_0x307372,_0x147479[_0xfc72('0x4b')]);return db[_0xfc72('0x39')][_0xfc72('0x51')](_0x307372)['then'](handleEntityNotFound(_0x441d7f,null))[_0xfc72('0x1c')](respondWithResult(_0x441d7f,null))[_0xfc72('0x25')](handleError(_0x441d7f,null));};exports[_0xfc72('0x52')]=function(_0x5b6ae9,_0x578f9b,_0x3324da){var _0x33ee9a;return db['VoiceContext'][_0xfc72('0x52')](_0x5b6ae9[_0xfc72('0x53')],{'raw':!![]})[_0xfc72('0x1c')](function(_0x14d81b){_0x33ee9a=_0x14d81b;return db['VoiceContext'][_0xfc72('0x4c')]({'raw':!![]});})[_0xfc72('0x1c')](function(_0x5e5771){var _0x3a3f60=fs[_0xfc72('0x54')](path['join'](config[_0xfc72('0x55')],_0xfc72('0x56')),_0xfc72('0x57'));var _0x261958=ejs['render'](_0x3a3f60,{'contexts':_0x5e5771||[]});fs[_0xfc72('0x58')](_0xfc72('0x59'),_0x261958);})[_0xfc72('0x1c')](function(){return respondWithRpcPromise(_0xfc72('0x5a'),_0xfc72('0x52'),{'module':'chan_sip.so'});})[_0xfc72('0x1c')](function(){var _0x5a0149=_0x5b6ae9[_0xfc72('0x5b')][_0xfc72('0x5c')]({'plain':!![]});if(!_0x5a0149)throw new Error(_0xfc72('0x5d'));if(_0x5a0149['role']===_0xfc72('0x5b')){var _0xf32100=_0x33ee9a[_0xfc72('0x5c')]({'plain':!![]});return db[_0xfc72('0x5e')][_0xfc72('0x51')]({'where':{'name':_0xfc72('0x35'),'userProfileId':_0x5a0149[_0xfc72('0x5f')]},'raw':!![]})[_0xfc72('0x1c')](function(_0x338a68){if(_0x338a68&&_0x338a68[_0xfc72('0x60')]===0x0){return db[_0xfc72('0x61')][_0xfc72('0x52')]({'name':_0xf32100[_0xfc72('0x37')],'resourceId':_0xf32100['id'],'type':_0x338a68[_0xfc72('0x37')],'sectionId':_0x338a68['id']},{})[_0xfc72('0x1c')](function(){return _0x33ee9a;});}else{return _0x33ee9a;}})['catch'](function(_0x535d7a){logger[_0xfc72('0x20')](_0xfc72('0x62'),_0x535d7a);throw _0x535d7a;});}return _0x33ee9a;})[_0xfc72('0x1c')](respondWithResult(_0x578f9b,0xc9))[_0xfc72('0x25')](handleError(_0x578f9b,null));};exports[_0xfc72('0x33')]=function(_0x36e135,_0x32db4d,_0xba0dc2){var _0x29fd8a;return db[_0xfc72('0x39')][_0xfc72('0x51')]({'where':{'id':_0x36e135['params']['id']}})[_0xfc72('0x1c')](handleEntityNotFound(_0x32db4d,null))[_0xfc72('0x1c')](saveUpdates(_0x36e135[_0xfc72('0x53')],null))[_0xfc72('0x1c')](function(_0x30d33b){if(_0x30d33b){_0x29fd8a=_0x30d33b;return db['VoiceContext'][_0xfc72('0x4c')]({'raw':!![]});}})['then'](function(_0x19a3cb){var _0x27b22e=fs['readFileSync'](path[_0xfc72('0x63')](config[_0xfc72('0x55')],_0xfc72('0x56')),_0xfc72('0x57'));var _0x50402f=ejs['render'](_0x27b22e,{'contexts':_0x19a3cb||[]});fs[_0xfc72('0x58')](_0xfc72('0x59'),_0x50402f);})[_0xfc72('0x1c')](function(){return respondWithRpcPromise('Reload',_0xfc72('0x33'),{'module':_0xfc72('0x64')});})[_0xfc72('0x1c')](function(){return _0x29fd8a;})[_0xfc72('0x1c')](respondWithResult(_0x32db4d,null))['catch'](handleError(_0x32db4d,null));};exports[_0xfc72('0x34')]=function(_0x2e7d00,_0x42c5ea,_0x3d32da){var _0x1abb6b;return db[_0xfc72('0x39')][_0xfc72('0x51')]({'where':{'id':_0x2e7d00[_0xfc72('0x4e')]['id']}})[_0xfc72('0x1c')](handleEntityNotFound(_0x42c5ea,null))[_0xfc72('0x1c')](removeEntity(_0x42c5ea,null))[_0xfc72('0x1c')](function(){return db[_0xfc72('0x39')]['findAll']({'raw':!![]});})[_0xfc72('0x1c')](function(_0x34b1e9){var _0xa2887f=fs[_0xfc72('0x54')](path[_0xfc72('0x63')](config[_0xfc72('0x55')],'server/files/templates/context.ejs'),_0xfc72('0x57'));var _0x5cd5de=ejs[_0xfc72('0x65')](_0xa2887f,{'contexts':_0x34b1e9});fs['writeFileSync'](_0xfc72('0x59'),_0x5cd5de);return respondWithRpcPromise(_0xfc72('0x5a'),'destroy',{'module':'chan_sip.so'});})[_0xfc72('0x25')](handleError(_0x42c5ea,null));};
\ No newline at end of file
index 0381cb0..f6fa484 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc20=['bluebird','request-promise','path','rimraf','./voiceContext.attributes','define','lodash','util','moment'];(function(_0x4be125,_0x5c8307){var _0x227c82=function(_0x3b778a){while(--_0x3b778a){_0x4be125['push'](_0x4be125['shift']());}};_0x227c82(++_0x5c8307);}(_0xfc20,0xd5));var _0x0fc2=function(_0x38026f,_0x50f8bb){_0x38026f=_0x38026f-0x0;var _0xfcaa5e=_0xfc20[_0x38026f];return _0xfcaa5e;};'use strict';var _=require(_0x0fc2('0x0'));var util=require(_0x0fc2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0fc2('0x2'));var BPromise=require(_0x0fc2('0x3'));var rp=require(_0x0fc2('0x4'));var fs=require('fs');var path=require(_0x0fc2('0x5'));var rimraf=require(_0x0fc2('0x6'));var config=require('../../config/environment');var attributes=require(_0x0fc2('0x7'));module['exports']=function(_0x53a40d,_0x2202da){return _0x53a40d[_0x0fc2('0x8')]('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4110=['request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','voice_contexts','lodash','util','../../config/logger','api'];(function(_0x46cdf7,_0x5c6b42){var _0x58898c=function(_0xdd9531){while(--_0xdd9531){_0x46cdf7['push'](_0x46cdf7['shift']());}};_0x58898c(++_0x5c6b42);}(_0x4110,0xac));var _0x0411=function(_0x437fea,_0x39fee6){_0x437fea=_0x437fea-0x0;var _0xa46ed1=_0x4110[_0x437fea];return _0xa46ed1;};'use strict';var _=require(_0x0411('0x0'));var util=require(_0x0411('0x1'));var logger=require(_0x0411('0x2'))(_0x0411('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0411('0x4'));var fs=require('fs');var path=require(_0x0411('0x5'));var rimraf=require(_0x0411('0x6'));var config=require(_0x0411('0x7'));var attributes=require(_0x0411('0x8'));module[_0x0411('0x9')]=function(_0x4ec07b,_0x2714f0){return _0x4ec07b['define']('VoiceContext',attributes,{'tableName':_0x0411('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d1ab3f6..3c44ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9189=['request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','result','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x137a46,_0x164a93){var _0x4f0320=function(_0x15dbf9){while(--_0x15dbf9){_0x137a46['push'](_0x137a46['shift']());}};_0x4f0320(++_0x164a93);}(_0x9189,0x1b0));var _0x9918=function(_0xc3204d,_0x52bef5){_0xc3204d=_0xc3204d-0x0;var _0x2896a2=_0x9189[_0xc3204d];return _0x2896a2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9918('0x0'));var BPromise=require(_0x9918('0x1'));var rs=require(_0x9918('0x2'));var fs=require('fs');var Redis=require(_0x9918('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9918('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9918('0x5'));var jayson=require(_0x9918('0x6'));var client=jayson['client'][_0x9918('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3cb556,_0x7b8770,_0x5c926e){return new BPromise(function(_0x5a0552,_0x50a534){return client[_0x9918('0x8')](_0x3cb556,_0x5c926e)[_0x9918('0x9')](function(_0x553c75){logger[_0x9918('0xa')]('VoiceContext,\x20%s,\x20%s',_0x7b8770,_0x9918('0xb'));logger[_0x9918('0xc')](_0x9918('0xd'),_0x7b8770,_0x9918('0xb'),JSON[_0x9918('0xe')](_0x553c75));if(_0x553c75[_0x9918('0xf')]){if(_0x553c75[_0x9918('0xf')]['code']===0x1f4){logger[_0x9918('0xf')](_0x9918('0x10'),_0x7b8770,_0x553c75['error']['message']);return _0x50a534(_0x553c75[_0x9918('0xf')]['message']);}logger['error'](_0x9918('0x10'),_0x7b8770,_0x553c75[_0x9918('0xf')]['message']);return _0x5a0552(_0x553c75[_0x9918('0xf')]['message']);}else{logger[_0x9918('0xa')](_0x9918('0x10'),_0x7b8770,_0x9918('0xb'));_0x5a0552(_0x553c75[_0x9918('0x11')][_0x9918('0x12')]);}})[_0x9918('0x13')](function(_0x1a676f){logger[_0x9918('0xf')](_0x9918('0x10'),_0x7b8770,_0x1a676f);_0x50a534(_0x1a676f);});});}
\ No newline at end of file
+var _0x5eb8=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x368463,_0x14137d){var _0x481f7e=function(_0x5943f0){while(--_0x5943f0){_0x368463['push'](_0x368463['shift']());}};_0x481f7e(++_0x14137d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x5eb8[_0x1b95a1];return _0x57aef1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('VoiceContext,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('VoiceContext,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('VoiceContext,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}
\ No newline at end of file
index 3add302..a743d0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04c7=['Router','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x393687,_0x2e5f70){var _0x32af9a=function(_0x5aa533){while(--_0x5aa533){_0x393687['push'](_0x393687['shift']());}};_0x32af9a(++_0x2e5f70);}(_0x04c7,0x8b));var _0x704c=function(_0x49ed67,_0x290989){_0x49ed67=_0x49ed67-0x0;var _0x1523d5=_0x04c7[_0x49ed67];return _0x1523d5;};'use strict';var multer=require(_0x704c('0x0'));var util=require(_0x704c('0x1'));var path=require(_0x704c('0x2'));var timeout=require(_0x704c('0x3'));var express=require(_0x704c('0x4'));var router=express[_0x704c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x704c('0x6'));var controller=require(_0x704c('0x7'));router[_0x704c('0x8')]('/',auth[_0x704c('0x9')](),controller[_0x704c('0xa')]);router[_0x704c('0x8')](_0x704c('0xb'),auth[_0x704c('0x9')](),controller[_0x704c('0xc')]);router[_0x704c('0x8')](_0x704c('0xd'),auth[_0x704c('0x9')](),controller['show']);router[_0x704c('0xe')]('/',auth[_0x704c('0x9')](),controller['create']);router[_0x704c('0xf')](_0x704c('0xd'),auth[_0x704c('0x9')](),controller['update']);router[_0x704c('0x10')](_0x704c('0xd'),auth[_0x704c('0x9')](),controller[_0x704c('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x3dc0=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x149bd3,_0x35df7c){var _0x18d477=function(_0x489587){while(--_0x489587){_0x149bd3['push'](_0x149bd3['shift']());}};_0x18d477(++_0x35df7c);}(_0x3dc0,0xad));var _0x03dc=function(_0x494533,_0x554567){_0x494533=_0x494533-0x0;var _0x5a9ff3=_0x3dc0[_0x494533];return _0x5a9ff3;};'use strict';var multer=require(_0x03dc('0x0'));var util=require(_0x03dc('0x1'));var path=require(_0x03dc('0x2'));var timeout=require(_0x03dc('0x3'));var express=require(_0x03dc('0x4'));var router=express[_0x03dc('0x5')]();var fs_extra=require(_0x03dc('0x6'));var auth=require(_0x03dc('0x7'));var interaction=require(_0x03dc('0x8'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x03dc('0x9')]('/',auth[_0x03dc('0xa')](),controller[_0x03dc('0xb')]);router['get'](_0x03dc('0xc'),auth[_0x03dc('0xa')](),controller['describe']);router[_0x03dc('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x03dc('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x03dc('0xe')](_0x03dc('0xf'),auth[_0x03dc('0xa')](),controller[_0x03dc('0x10')]);router[_0x03dc('0x11')](_0x03dc('0xf'),auth[_0x03dc('0xa')](),controller[_0x03dc('0x12')]);module[_0x03dc('0x13')]=router;
\ No newline at end of file
index 6defc91..6f9db7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x4abb10,_0x26897f){var _0x2494fe=function(_0x44c085){while(--_0x44c085){_0x4abb10['push'](_0x4abb10['shift']());}};_0x2494fe(++_0x26897f);}(_0x81bd,0x7c));var _0xd81b=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0x81bd[_0x53174f];return _0x1cbd1c;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}};
\ No newline at end of file
+var _0xb821=['DATE','called,connect,complete','exports','STRING','INTEGER'];(function(_0x2bd630,_0x494f0a){var _0x34d159=function(_0x540cfd){while(--_0x540cfd){_0x2bd630['push'](_0x2bd630['shift']());}};_0x34d159(++_0x494f0a);}(_0xb821,0xa7));var _0x1b82=function(_0x9cbab1,_0x145e67){_0x9cbab1=_0x9cbab1-0x0;var _0x53ea8a=_0xb821[_0x9cbab1];return _0x53ea8a;};'use strict';var Sequelize=require('sequelize');module[_0x1b82('0x0')]={'privilege':{'type':Sequelize[_0x1b82('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x1b82('0x1')]},'connectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'language':{'type':Sequelize[_0x1b82('0x1')]},'accountcode':{'type':Sequelize[_0x1b82('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1b82('0x1')]},'priority':{'type':Sequelize[_0x1b82('0x2')]},'uniqueid':{'type':Sequelize[_0x1b82('0x1')]},'linkedid':{'type':Sequelize[_0x1b82('0x1')]},'destchannel':{'type':Sequelize[_0x1b82('0x1')]},'destchannelstate':{'type':Sequelize[_0x1b82('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridnum':{'type':Sequelize[_0x1b82('0x1')]},'destcalleridname':{'type':Sequelize[_0x1b82('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x1b82('0x1')]},'destlanguage':{'type':Sequelize[_0x1b82('0x1')]},'destaccountcode':{'type':Sequelize[_0x1b82('0x1')]},'destcontext':{'type':Sequelize[_0x1b82('0x1')]},'destexten':{'type':Sequelize[_0x1b82('0x1')]},'destpriority':{'type':Sequelize[_0x1b82('0x2')]},'destuniqueid':{'type':Sequelize[_0x1b82('0x1')]},'destlinkedid':{'type':Sequelize[_0x1b82('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x1b82('0x1')]},'starttime':{'type':Sequelize[_0x1b82('0x3')]},'answertime':{'type':Sequelize[_0x1b82('0x3')]},'endtime':{'type':Sequelize[_0x1b82('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x1b82('0x4')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x1b82('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index d53d75c..a9bfc1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae1d=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x2eb249,_0x21f1e1){var _0x4204a9=function(_0x3602b9){while(--_0x3602b9){_0x2eb249['push'](_0x2eb249['shift']());}};_0x4204a9(++_0x21f1e1);}(_0xae1d,0x1b3));var _0xdae1=function(_0x1a61c1,_0x2f064d){_0x1a61c1=_0x1a61c1-0x0;var _0x2240bf=_0xae1d[_0x1a61c1];return _0x2240bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdae1('0x0'));var zipdir=require(_0xdae1('0x1'));var jsonpatch=require(_0xdae1('0x2'));var rp=require(_0xdae1('0x3'));var moment=require(_0xdae1('0x4'));var BPromise=require(_0xdae1('0x5'));var Mustache=require(_0xdae1('0x6'));var util=require(_0xdae1('0x7'));var path=require(_0xdae1('0x8'));var sox=require(_0xdae1('0x9'));var csv=require(_0xdae1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdae1('0xb'));var squel=require(_0xdae1('0xc'));var crypto=require(_0xdae1('0xd'));var jsforce=require(_0xdae1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdae1('0xf'));var Papa=require(_0xdae1('0x10'));var Redis=require(_0xdae1('0x11'));var authService=require(_0xdae1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdae1('0x13'));var hardwareService=require(_0xdae1('0x14'));var logger=require(_0xdae1('0x15'))(_0xdae1('0x16'));var utils=require(_0xdae1('0x17'));var config=require(_0xdae1('0x18'));var licenseUtil=require(_0xdae1('0x19'));var db=require(_0xdae1('0x1a'))['db'];function respondWithStatusCode(_0x4941db,_0x31ee54){_0x31ee54=_0x31ee54||0xcc;return function(_0x43cd94){if(_0x43cd94){return _0x4941db['sendStatus'](_0x31ee54);}return _0x4941db[_0xdae1('0x1b')](_0x31ee54)['end']();};}function respondWithResult(_0x123891,_0x280f89){_0x280f89=_0x280f89||0xc8;return function(_0x1117f9){if(_0x1117f9){return _0x123891[_0xdae1('0x1b')](_0x280f89)[_0xdae1('0x1c')](_0x1117f9);}};}function respondWithFilteredResult(_0x21320b,_0x39a6d7){return function(_0x354ed2){if(_0x354ed2){var _0x20b95a=typeof _0x39a6d7[_0xdae1('0x1d')]===_0xdae1('0x1e')&&typeof _0x39a6d7[_0xdae1('0x1f')]===_0xdae1('0x1e');var _0x4cd068=_0x354ed2[_0xdae1('0x20')];var _0x1e387d=_0x20b95a?0x0:_0x39a6d7[_0xdae1('0x1d')];var _0x5bded5=_0x20b95a?_0x354ed2['count']:_0x39a6d7['offset']+_0x39a6d7[_0xdae1('0x1f')];var _0x34b456;if(_0x5bded5>=_0x4cd068){_0x5bded5=_0x4cd068;_0x34b456=0xc8;}else{_0x34b456=0xce;}_0x21320b[_0xdae1('0x1b')](_0x34b456);return _0x21320b[_0xdae1('0x21')](_0xdae1('0x22'),_0x1e387d+'-'+_0x5bded5+'/'+_0x4cd068)[_0xdae1('0x1c')](_0x354ed2);}return null;};}function patchUpdates(_0x118885){return function(_0x2ad236){try{jsonpatch['apply'](_0x2ad236,_0x118885,!![]);}catch(_0x2e90ec){return BPromise[_0xdae1('0x23')](_0x2e90ec);}return _0x2ad236[_0xdae1('0x24')]();};}function saveUpdates(_0x1b5fb6,_0x21692b){return function(_0x2aab95){if(_0x2aab95){return _0x2aab95[_0xdae1('0x25')](_0x1b5fb6)[_0xdae1('0x26')](function(_0x47f9b3){return _0x47f9b3;});}return null;};}function removeEntity(_0x403c1a,_0x4a02ee){return function(_0x39b406){if(_0x39b406){return _0x39b406[_0xdae1('0x27')]()[_0xdae1('0x26')](function(){_0x403c1a[_0xdae1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb59ea,_0x310627){return function(_0xbc3682){if(!_0xbc3682){_0xcb59ea['sendStatus'](0x194);}return _0xbc3682;};}function handleError(_0x4c2ae1,_0x2febc8){_0x2febc8=_0x2febc8||0x1f4;return function(_0x4c0363){logger[_0xdae1('0x28')](_0x4c0363['stack']);if(_0x4c0363[_0xdae1('0x29')]){delete _0x4c0363[_0xdae1('0x29')];}_0x4c2ae1[_0xdae1('0x1b')](_0x2febc8)[_0xdae1('0x2a')](_0x4c0363);};}exports[_0xdae1('0x2b')]=function(_0x44b461,_0x18b8eb){var _0x1c76cd={},_0x481b23={},_0x215e66={'count':0x0,'rows':[]};var _0x1b101b=_[_0xdae1('0x2c')](db[_0xdae1('0x2d')][_0xdae1('0x2e')],function(_0x139333){return{'name':_0x139333['fieldName'],'type':_0x139333['type'][_0xdae1('0x2f')]};});_0x481b23[_0xdae1('0x30')]=_[_0xdae1('0x2c')](_0x1b101b,'name');_0x481b23[_0xdae1('0x31')]=_[_0xdae1('0x32')](_0x44b461[_0xdae1('0x31')]);_0x481b23[_0xdae1('0x33')]=_[_0xdae1('0x34')](_0x481b23['model'],_0x481b23[_0xdae1('0x31')]);_0x1c76cd[_0xdae1('0x35')]=_[_0xdae1('0x34')](_0x481b23[_0xdae1('0x30')],qs[_0xdae1('0x36')](_0x44b461[_0xdae1('0x31')][_0xdae1('0x36')]));_0x1c76cd['attributes']=_0x1c76cd[_0xdae1('0x35')]['length']?_0x1c76cd[_0xdae1('0x35')]:_0x481b23[_0xdae1('0x30')];if(!_0x44b461[_0xdae1('0x31')][_0xdae1('0x37')](_0xdae1('0x38'))){_0x1c76cd[_0xdae1('0x1f')]=qs[_0xdae1('0x1f')](_0x44b461[_0xdae1('0x31')]['limit']);_0x1c76cd[_0xdae1('0x1d')]=qs[_0xdae1('0x1d')](_0x44b461[_0xdae1('0x31')][_0xdae1('0x1d')]);}_0x1c76cd[_0xdae1('0x39')]=qs['sort'](_0x44b461[_0xdae1('0x31')][_0xdae1('0x3a')]);_0x1c76cd[_0xdae1('0x3b')]=qs['filters'](_[_0xdae1('0x3c')](_0x44b461['query'],_0x481b23['filters']),_0x1b101b);if(_0x44b461[_0xdae1('0x31')][_0xdae1('0x3d')]){_0x1c76cd['where']=_[_0xdae1('0x3e')](_0x1c76cd['where'],{'$or':_[_0xdae1('0x2c')](_0x1b101b,function(_0x1318ab){if(_0x1318ab[_0xdae1('0x3f')]!==_0xdae1('0x40')){var _0x543611={};_0x543611[_0x1318ab[_0xdae1('0x29')]]={'$like':'%'+_0x44b461[_0xdae1('0x31')][_0xdae1('0x3d')]+'%'};return _0x543611;}})});}_0x1c76cd=_[_0xdae1('0x3e')]({},_0x1c76cd,_0x44b461[_0xdae1('0x41')]);var _0x13677d={'where':_0x1c76cd[_0xdae1('0x3b')]};return db[_0xdae1('0x2d')][_0xdae1('0x20')](_0x13677d)['then'](function(_0x4ffc74){_0x215e66['count']=_0x4ffc74;if(_0x44b461['query'][_0xdae1('0x42')]){_0x1c76cd[_0xdae1('0x43')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x1c76cd);})['then'](function(_0x1ac14e){_0x215e66[_0xdae1('0x44')]=_0x1ac14e;return _0x215e66;})[_0xdae1('0x26')](respondWithFilteredResult(_0x18b8eb,_0x1c76cd))[_0xdae1('0x45')](handleError(_0x18b8eb,null));};exports[_0xdae1('0x46')]=function(_0x2eec25,_0x4ec435){var _0x25ac78={'raw':!![],'where':{'id':_0x2eec25[_0xdae1('0x47')]['id']}},_0x1af059={};_0x1af059[_0xdae1('0x30')]=_['keys'](db[_0xdae1('0x2d')][_0xdae1('0x2e')]);_0x1af059[_0xdae1('0x31')]=_[_0xdae1('0x32')](_0x2eec25['query']);_0x1af059[_0xdae1('0x33')]=_[_0xdae1('0x34')](_0x1af059[_0xdae1('0x30')],_0x1af059[_0xdae1('0x31')]);_0x25ac78['attributes']=_['intersection'](_0x1af059['model'],qs[_0xdae1('0x36')](_0x2eec25[_0xdae1('0x31')][_0xdae1('0x36')]));_0x25ac78[_0xdae1('0x35')]=_0x25ac78[_0xdae1('0x35')]['length']?_0x25ac78['attributes']:_0x1af059[_0xdae1('0x30')];if(_0x2eec25[_0xdae1('0x31')][_0xdae1('0x42')]){_0x25ac78[_0xdae1('0x43')]=[{'all':!![]}];}_0x25ac78=_[_0xdae1('0x3e')]({},_0x25ac78,_0x2eec25[_0xdae1('0x41')]);return db[_0xdae1('0x2d')]['find'](_0x25ac78)[_0xdae1('0x26')](handleEntityNotFound(_0x4ec435,null))[_0xdae1('0x26')](respondWithResult(_0x4ec435,null))[_0xdae1('0x45')](handleError(_0x4ec435,null));};exports[_0xdae1('0x48')]=function(_0x4024d1,_0x1201ca){return db[_0xdae1('0x2d')][_0xdae1('0x48')](_0x4024d1[_0xdae1('0x49')],{})['then'](respondWithResult(_0x1201ca,0xc9))[_0xdae1('0x45')](handleError(_0x1201ca,null));};exports[_0xdae1('0x25')]=function(_0x520bb7,_0x5e0840){if(_0x520bb7['body']['id']){delete _0x520bb7[_0xdae1('0x49')]['id'];}return db[_0xdae1('0x2d')]['find']({'where':{'id':_0x520bb7['params']['id']}})[_0xdae1('0x26')](handleEntityNotFound(_0x5e0840,null))['then'](saveUpdates(_0x520bb7[_0xdae1('0x49')],null))[_0xdae1('0x26')](respondWithResult(_0x5e0840,null))[_0xdae1('0x45')](handleError(_0x5e0840,null));};exports[_0xdae1('0x27')]=function(_0x130971,_0x4bb2bf){return db[_0xdae1('0x2d')][_0xdae1('0x4a')]({'where':{'id':_0x130971[_0xdae1('0x47')]['id']}})[_0xdae1('0x26')](handleEntityNotFound(_0x4bb2bf,null))['then'](removeEntity(_0x4bb2bf,null))[_0xdae1('0x45')](handleError(_0x4bb2bf,null));};exports[_0xdae1('0x4b')]=function(_0x40f4a7,_0x20f6f3){return db[_0xdae1('0x2d')][_0xdae1('0x4b')]()['then'](respondWithResult(_0x20f6f3,null))[_0xdae1('0x45')](handleError(_0x20f6f3,null));};
\ No newline at end of file
+var _0x5b3f=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','save','then','destroy','error','stack','name','send','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','filter','merge','where','VIRTUAL','VoiceDialReport','include','findAll','catch','show','params','fields','options','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x362046,_0x5cf93f){var _0x419ffe=function(_0x18cb42){while(--_0x18cb42){_0x362046['push'](_0x362046['shift']());}};_0x419ffe(++_0x5cf93f);}(_0x5b3f,0x16d));var _0xf5b3=function(_0x246653,_0x1a9186){_0x246653=_0x246653-0x0;var _0x373293=_0x5b3f[_0x246653];return _0x373293;};'use strict';var emlformat=require(_0xf5b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5b3('0x1'));var jsonpatch=require(_0xf5b3('0x2'));var rp=require(_0xf5b3('0x3'));var moment=require(_0xf5b3('0x4'));var BPromise=require(_0xf5b3('0x5'));var Mustache=require(_0xf5b3('0x6'));var util=require(_0xf5b3('0x7'));var path=require(_0xf5b3('0x8'));var sox=require(_0xf5b3('0x9'));var csv=require(_0xf5b3('0xa'));var ejs=require(_0xf5b3('0xb'));var fs=require('fs');var fs_extra=require(_0xf5b3('0xc'));var _=require(_0xf5b3('0xd'));var squel=require(_0xf5b3('0xe'));var crypto=require(_0xf5b3('0xf'));var jsforce=require(_0xf5b3('0x10'));var deskjs=require(_0xf5b3('0x11'));var toCsv=require(_0xf5b3('0xa'));var querystring=require(_0xf5b3('0x12'));var Papa=require(_0xf5b3('0x13'));var Redis=require('ioredis');var authService=require(_0xf5b3('0x14'));var qs=require(_0xf5b3('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf5b3('0x16'));var logger=require(_0xf5b3('0x17'))('api');var utils=require(_0xf5b3('0x18'));var config=require(_0xf5b3('0x19'));var licenseUtil=require(_0xf5b3('0x1a'));var db=require(_0xf5b3('0x1b'))['db'];function respondWithStatusCode(_0x5696a5,_0x1aaee0){_0x1aaee0=_0x1aaee0||0xcc;return function(_0x2e2dbc){if(_0x2e2dbc){return _0x5696a5[_0xf5b3('0x1c')](_0x1aaee0);}return _0x5696a5[_0xf5b3('0x1d')](_0x1aaee0)[_0xf5b3('0x1e')]();};}function respondWithResult(_0xc566a6,_0x36c4bb){_0x36c4bb=_0x36c4bb||0xc8;return function(_0x3a319e){if(_0x3a319e){return _0xc566a6[_0xf5b3('0x1d')](_0x36c4bb)[_0xf5b3('0x1f')](_0x3a319e);}};}function respondWithFilteredResult(_0x25701e,_0x147b58){return function(_0x165553){if(_0x165553){var _0x1c9404=typeof _0x147b58[_0xf5b3('0x20')]===_0xf5b3('0x21')&&typeof _0x147b58['limit']===_0xf5b3('0x21');var _0x44cb2f=_0x165553['count'];var _0x47f1e4=_0x1c9404?0x0:_0x147b58[_0xf5b3('0x20')];var _0x2bb740=_0x1c9404?_0x165553[_0xf5b3('0x22')]:_0x147b58[_0xf5b3('0x20')]+_0x147b58['limit'];var _0x1e0179;if(_0x2bb740>=_0x44cb2f){_0x2bb740=_0x44cb2f;_0x1e0179=0xc8;}else{_0x1e0179=0xce;}_0x25701e[_0xf5b3('0x1d')](_0x1e0179);return _0x25701e[_0xf5b3('0x23')]('Content-Range',_0x47f1e4+'-'+_0x2bb740+'/'+_0x44cb2f)[_0xf5b3('0x1f')](_0x165553);}return null;};}function patchUpdates(_0x2df9ff){return function(_0x5db0ad){try{jsonpatch['apply'](_0x5db0ad,_0x2df9ff,!![]);}catch(_0x58ce48){return BPromise['reject'](_0x58ce48);}return _0x5db0ad[_0xf5b3('0x24')]();};}function saveUpdates(_0x715373,_0x571113){return function(_0x40a7d9){if(_0x40a7d9){return _0x40a7d9['update'](_0x715373)[_0xf5b3('0x25')](function(_0x473853){return _0x473853;});}return null;};}function removeEntity(_0x1f1fbd,_0x188484){return function(_0x225ccf){if(_0x225ccf){return _0x225ccf[_0xf5b3('0x26')]()[_0xf5b3('0x25')](function(){_0x1f1fbd['status'](0xcc)[_0xf5b3('0x1e')]();});}};}function handleEntityNotFound(_0x60d516,_0x51674c){return function(_0x3f0f2d){if(!_0x3f0f2d){_0x60d516[_0xf5b3('0x1c')](0x194);}return _0x3f0f2d;};}function handleError(_0x43d4f9,_0x1143ee){_0x1143ee=_0x1143ee||0x1f4;return function(_0x10bd76){logger[_0xf5b3('0x27')](_0x10bd76[_0xf5b3('0x28')]);if(_0x10bd76[_0xf5b3('0x29')]){delete _0x10bd76['name'];}_0x43d4f9[_0xf5b3('0x1d')](_0x1143ee)[_0xf5b3('0x2a')](_0x10bd76);};}exports['index']=function(_0x5bc053,_0x4a0ec9){var _0x2c2ed5={},_0x2e87d5={},_0x4e4fd7={'count':0x0,'rows':[]};var _0x42faed=_['map'](db['VoiceDialReport'][_0xf5b3('0x2b')],function(_0x57bae5){return{'name':_0x57bae5['fieldName'],'type':_0x57bae5[_0xf5b3('0x2c')][_0xf5b3('0x2d')]};});_0x2e87d5[_0xf5b3('0x2e')]=_['map'](_0x42faed,_0xf5b3('0x29'));_0x2e87d5[_0xf5b3('0x2f')]=_[_0xf5b3('0x30')](_0x5bc053['query']);_0x2e87d5[_0xf5b3('0x31')]=_[_0xf5b3('0x32')](_0x2e87d5[_0xf5b3('0x2e')],_0x2e87d5[_0xf5b3('0x2f')]);_0x2c2ed5[_0xf5b3('0x33')]=_[_0xf5b3('0x32')](_0x2e87d5[_0xf5b3('0x2e')],qs['fields'](_0x5bc053[_0xf5b3('0x2f')]['fields']));_0x2c2ed5[_0xf5b3('0x33')]=_0x2c2ed5['attributes'][_0xf5b3('0x34')]?_0x2c2ed5['attributes']:_0x2e87d5[_0xf5b3('0x2e')];if(!_0x5bc053['query']['hasOwnProperty'](_0xf5b3('0x35'))){_0x2c2ed5['limit']=qs[_0xf5b3('0x36')](_0x5bc053['query'][_0xf5b3('0x36')]);_0x2c2ed5['offset']=qs[_0xf5b3('0x20')](_0x5bc053[_0xf5b3('0x2f')][_0xf5b3('0x20')]);}_0x2c2ed5[_0xf5b3('0x37')]=qs[_0xf5b3('0x38')](_0x5bc053[_0xf5b3('0x2f')]['sort']);_0x2c2ed5['where']=qs[_0xf5b3('0x31')](_['pick'](_0x5bc053[_0xf5b3('0x2f')],_0x2e87d5[_0xf5b3('0x31')]),_0x42faed);if(_0x5bc053[_0xf5b3('0x2f')][_0xf5b3('0x39')]){_0x2c2ed5['where']=_[_0xf5b3('0x3a')](_0x2c2ed5[_0xf5b3('0x3b')],{'$or':_['map'](_0x42faed,function(_0x231f0c){if(_0x231f0c['type']!==_0xf5b3('0x3c')){var _0xa5de2f={};_0xa5de2f[_0x231f0c[_0xf5b3('0x29')]]={'$like':'%'+_0x5bc053[_0xf5b3('0x2f')][_0xf5b3('0x39')]+'%'};return _0xa5de2f;}})});}_0x2c2ed5=_['merge']({},_0x2c2ed5,_0x5bc053['options']);var _0x15d9b6={'where':_0x2c2ed5['where']};return db[_0xf5b3('0x3d')]['count'](_0x15d9b6)[_0xf5b3('0x25')](function(_0x55e64b){_0x4e4fd7[_0xf5b3('0x22')]=_0x55e64b;if(_0x5bc053[_0xf5b3('0x2f')]['includeAll']){_0x2c2ed5[_0xf5b3('0x3e')]=[{'all':!![]}];}return db[_0xf5b3('0x3d')][_0xf5b3('0x3f')](_0x2c2ed5);})['then'](function(_0x5e6870){_0x4e4fd7['rows']=_0x5e6870;return _0x4e4fd7;})[_0xf5b3('0x25')](respondWithFilteredResult(_0x4a0ec9,_0x2c2ed5))[_0xf5b3('0x40')](handleError(_0x4a0ec9,null));};exports[_0xf5b3('0x41')]=function(_0x1841dd,_0x1e5964){var _0x216f1d={'raw':!![],'where':{'id':_0x1841dd[_0xf5b3('0x42')]['id']}},_0x3ebaee={};_0x3ebaee['model']=_[_0xf5b3('0x30')](db['VoiceDialReport']['rawAttributes']);_0x3ebaee[_0xf5b3('0x2f')]=_[_0xf5b3('0x30')](_0x1841dd[_0xf5b3('0x2f')]);_0x3ebaee[_0xf5b3('0x31')]=_[_0xf5b3('0x32')](_0x3ebaee[_0xf5b3('0x2e')],_0x3ebaee[_0xf5b3('0x2f')]);_0x216f1d[_0xf5b3('0x33')]=_['intersection'](_0x3ebaee[_0xf5b3('0x2e')],qs['fields'](_0x1841dd[_0xf5b3('0x2f')][_0xf5b3('0x43')]));_0x216f1d[_0xf5b3('0x33')]=_0x216f1d['attributes'][_0xf5b3('0x34')]?_0x216f1d[_0xf5b3('0x33')]:_0x3ebaee['model'];if(_0x1841dd[_0xf5b3('0x2f')]['includeAll']){_0x216f1d[_0xf5b3('0x3e')]=[{'all':!![]}];}_0x216f1d=_['merge']({},_0x216f1d,_0x1841dd[_0xf5b3('0x44')]);return db['VoiceDialReport'][_0xf5b3('0x45')](_0x216f1d)['then'](handleEntityNotFound(_0x1e5964,null))[_0xf5b3('0x25')](respondWithResult(_0x1e5964,null))[_0xf5b3('0x40')](handleError(_0x1e5964,null));};exports['create']=function(_0x1d234d,_0xe600f5){return db[_0xf5b3('0x3d')][_0xf5b3('0x46')](_0x1d234d[_0xf5b3('0x47')],{})['then'](respondWithResult(_0xe600f5,0xc9))[_0xf5b3('0x40')](handleError(_0xe600f5,null));};exports[_0xf5b3('0x48')]=function(_0x1c957a,_0x39320f){if(_0x1c957a[_0xf5b3('0x47')]['id']){delete _0x1c957a['body']['id'];}return db[_0xf5b3('0x3d')][_0xf5b3('0x45')]({'where':{'id':_0x1c957a[_0xf5b3('0x42')]['id']}})[_0xf5b3('0x25')](handleEntityNotFound(_0x39320f,null))[_0xf5b3('0x25')](saveUpdates(_0x1c957a['body'],null))[_0xf5b3('0x25')](respondWithResult(_0x39320f,null))[_0xf5b3('0x40')](handleError(_0x39320f,null));};exports[_0xf5b3('0x26')]=function(_0x1fd644,_0x261f46){return db[_0xf5b3('0x3d')][_0xf5b3('0x45')]({'where':{'id':_0x1fd644[_0xf5b3('0x42')]['id']}})['then'](handleEntityNotFound(_0x261f46,null))[_0xf5b3('0x25')](removeEntity(_0x261f46,null))[_0xf5b3('0x40')](handleError(_0x261f46,null));};exports[_0xf5b3('0x49')]=function(_0x3ce1d1,_0xd0d4cb){return db[_0xf5b3('0x3d')][_0xf5b3('0x49')]()[_0xf5b3('0x25')](respondWithResult(_0xd0d4cb,null))[_0xf5b3('0x40')](handleError(_0xd0d4cb,null));};
\ No newline at end of file
index f3bc53f..273ac4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1b3=['report_dial','uniqueid','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport'];(function(_0x5d2e72,_0x17c283){var _0x51ea73=function(_0x153853){while(--_0x153853){_0x5d2e72['push'](_0x5d2e72['shift']());}};_0x51ea73(++_0x17c283);}(_0xd1b3,0xec));var _0x3d1b=function(_0x11d197,_0x2dd9f1){_0x11d197=_0x11d197-0x0;var _0x20f02b=_0xd1b3[_0x11d197];return _0x20f02b;};'use strict';var _=require(_0x3d1b('0x0'));var util=require(_0x3d1b('0x1'));var logger=require(_0x3d1b('0x2'))(_0x3d1b('0x3'));var moment=require(_0x3d1b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3d1b('0x5'));var config=require(_0x3d1b('0x6'));var attributes=require(_0x3d1b('0x7'));module[_0x3d1b('0x8')]=function(_0x1c409e,_0x45bd2b){return _0x1c409e[_0x3d1b('0x9')](_0x3d1b('0xa'),attributes,{'tableName':_0x3d1b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x3d1b('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x496a=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36aca2,_0x575247){var _0x16f16d=function(_0x1c0c15){while(--_0x1c0c15){_0x36aca2['push'](_0x36aca2['shift']());}};_0x16f16d(++_0x575247);}(_0x496a,0xe6));var _0xa496=function(_0x1b5464,_0x2a0b25){_0x1b5464=_0x1b5464-0x0;var _0x231b79=_0x496a[_0x1b5464];return _0x231b79;};'use strict';var _=require(_0xa496('0x0'));var util=require(_0xa496('0x1'));var logger=require(_0xa496('0x2'))(_0xa496('0x3'));var moment=require(_0xa496('0x4'));var BPromise=require(_0xa496('0x5'));var rp=require(_0xa496('0x6'));var fs=require('fs');var path=require(_0xa496('0x7'));var rimraf=require(_0xa496('0x8'));var config=require(_0xa496('0x9'));var attributes=require(_0xa496('0xa'));module[_0xa496('0xb')]=function(_0x2491bf,_0x32b8b0){return _0x2491bf['define'](_0xa496('0xc'),attributes,{'tableName':_0xa496('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index b306c48..0d408fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebc3=['attributes','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','result','CreateVoiceDialReport','VoiceDialReport','create','body','options','stringify','catch','UpdateVoiceDialReport','update','raw','where'];(function(_0x20cfff,_0x5865f1){var _0x4d64b1=function(_0x3770d4){while(--_0x3770d4){_0x20cfff['push'](_0x20cfff['shift']());}};_0x4d64b1(++_0x5865f1);}(_0xebc3,0x12a));var _0x3ebc=function(_0x526f40,_0x1593a1){_0x526f40=_0x526f40-0x0;var _0x2475bc=_0xebc3[_0x526f40];return _0x2475bc;};'use strict';var _=require('lodash');var util=require(_0x3ebc('0x0'));var moment=require(_0x3ebc('0x1'));var BPromise=require(_0x3ebc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ebc('0x3'));var db=require(_0x3ebc('0x4'))['db'];var utils=require(_0x3ebc('0x5'));var logger=require(_0x3ebc('0x6'))(_0x3ebc('0x7'));var config=require(_0x3ebc('0x8'));var jayson=require(_0x3ebc('0x9'));var client=jayson['client'][_0x3ebc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e9b06,_0x33eb25,_0x4a78a4){return new BPromise(function(_0x1cadb5,_0x115018){return client[_0x3ebc('0xb')](_0x4e9b06,_0x4a78a4)[_0x3ebc('0xc')](function(_0x5a582b){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x33eb25,_0x3ebc('0xd'));logger[_0x3ebc('0xe')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x33eb25,_0x3ebc('0xd'),JSON['stringify'](_0x5a582b));if(_0x5a582b[_0x3ebc('0xf')]){if(_0x5a582b['error'][_0x3ebc('0x10')]===0x1f4){logger['error'](_0x3ebc('0x11'),_0x33eb25,_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);return _0x115018(_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);}logger[_0x3ebc('0xf')](_0x3ebc('0x11'),_0x33eb25,_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);return _0x1cadb5(_0x5a582b[_0x3ebc('0xf')][_0x3ebc('0x12')]);}else{logger[_0x3ebc('0x13')](_0x3ebc('0x11'),_0x33eb25,_0x3ebc('0xd'));_0x1cadb5(_0x5a582b[_0x3ebc('0x14')][_0x3ebc('0x12')]);}})['catch'](function(_0x1a61a1){logger[_0x3ebc('0xf')](_0x3ebc('0x11'),_0x33eb25,_0x1a61a1);_0x115018(_0x1a61a1);});});}exports[_0x3ebc('0x15')]=function(_0x4e3833){var _0x252fbb=this;return new Promise(function(_0x11815d,_0xc1686e){return db[_0x3ebc('0x16')][_0x3ebc('0x17')](_0x4e3833[_0x3ebc('0x18')],{'raw':_0x4e3833[_0x3ebc('0x19')]?_0x4e3833[_0x3ebc('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x3ebc('0xc')](function(_0x55ee85){logger[_0x3ebc('0x13')]('CreateVoiceDialReport',_0x4e3833);logger[_0x3ebc('0xe')](_0x3ebc('0x15'),_0x4e3833,JSON[_0x3ebc('0x1a')](_0x55ee85));_0x11815d(_0x55ee85);})[_0x3ebc('0x1b')](function(_0x61c606){logger[_0x3ebc('0xf')](_0x3ebc('0x15'),_0x61c606[_0x3ebc('0x12')],_0x4e3833);_0xc1686e(_0x252fbb[_0x3ebc('0xf')](0x1f4,_0x61c606[_0x3ebc('0x12')]));});});};exports[_0x3ebc('0x1c')]=function(_0x309c82){var _0x1e9198=this;return new Promise(function(_0x2e58c6,_0x1f6ee7){return db[_0x3ebc('0x16')][_0x3ebc('0x1d')](_0x309c82[_0x3ebc('0x18')],{'raw':_0x309c82[_0x3ebc('0x19')]?_0x309c82['options'][_0x3ebc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309c82[_0x3ebc('0x19')]?_0x309c82['options'][_0x3ebc('0x1f')]||null:null,'attributes':_0x309c82[_0x3ebc('0x19')]?_0x309c82[_0x3ebc('0x19')][_0x3ebc('0x20')]||null:null,'limit':_0x309c82[_0x3ebc('0x19')]?_0x309c82[_0x3ebc('0x19')]['limit']||null:null})[_0x3ebc('0xc')](function(_0x59108a){logger[_0x3ebc('0x13')](_0x3ebc('0x1c'),_0x309c82);logger['debug'](_0x3ebc('0x1c'),_0x309c82,JSON[_0x3ebc('0x1a')](_0x59108a));_0x2e58c6(_0x59108a);})[_0x3ebc('0x1b')](function(_0x47d0e2){logger[_0x3ebc('0xf')](_0x3ebc('0x1c'),_0x47d0e2[_0x3ebc('0x12')],_0x309c82);_0x1f6ee7(_0x1e9198[_0x3ebc('0xf')](0x1f4,_0x47d0e2[_0x3ebc('0x12')]));});});};
\ No newline at end of file
+var _0x6db6=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','options','raw','then','catch','UpdateVoiceDialReport','update','where','attributes','limit'];(function(_0x1af633,_0x2672a7){var _0x11e69c=function(_0x5c6a0d){while(--_0x5c6a0d){_0x1af633['push'](_0x1af633['shift']());}};_0x11e69c(++_0x2672a7);}(_0x6db6,0x140));var _0x66db=function(_0x5b1ff2,_0x1e8b1a){_0x5b1ff2=_0x5b1ff2-0x0;var _0x32d526=_0x6db6[_0x5b1ff2];return _0x32d526;};'use strict';var _=require(_0x66db('0x0'));var util=require(_0x66db('0x1'));var moment=require(_0x66db('0x2'));var BPromise=require(_0x66db('0x3'));var rs=require(_0x66db('0x4'));var fs=require('fs');var Redis=require(_0x66db('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66db('0x6'))(_0x66db('0x7'));var config=require(_0x66db('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x66db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x42f0cf,_0x2af085,_0x164d80){return new BPromise(function(_0x371a34,_0x32150f){return client[_0x66db('0xa')](_0x42f0cf,_0x164d80)['then'](function(_0x591d60){logger[_0x66db('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x2af085,_0x66db('0xc'));logger[_0x66db('0xd')](_0x66db('0xe'),_0x2af085,_0x66db('0xc'),JSON[_0x66db('0xf')](_0x591d60));if(_0x591d60[_0x66db('0x10')]){if(_0x591d60[_0x66db('0x10')][_0x66db('0x11')]===0x1f4){logger[_0x66db('0x10')](_0x66db('0x12'),_0x2af085,_0x591d60[_0x66db('0x10')][_0x66db('0x13')]);return _0x32150f(_0x591d60[_0x66db('0x10')][_0x66db('0x13')]);}logger['error'](_0x66db('0x12'),_0x2af085,_0x591d60['error']['message']);return _0x371a34(_0x591d60[_0x66db('0x10')][_0x66db('0x13')]);}else{logger[_0x66db('0xb')](_0x66db('0x12'),_0x2af085,'request\x20sent');_0x371a34(_0x591d60[_0x66db('0x14')][_0x66db('0x13')]);}})['catch'](function(_0x327859){logger[_0x66db('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x2af085,_0x327859);_0x32150f(_0x327859);});});}exports[_0x66db('0x15')]=function(_0x28d5e4){var _0x2b1c0a=this;return new Promise(function(_0x51d7b8,_0x25f960){return db[_0x66db('0x16')]['create'](_0x28d5e4['body'],{'raw':_0x28d5e4[_0x66db('0x17')]?_0x28d5e4[_0x66db('0x17')][_0x66db('0x18')]===undefined?!![]:![]:!![]})[_0x66db('0x19')](function(_0x3c1636){logger['info'](_0x66db('0x15'),_0x28d5e4);logger['debug']('CreateVoiceDialReport',_0x28d5e4,JSON['stringify'](_0x3c1636));_0x51d7b8(_0x3c1636);})[_0x66db('0x1a')](function(_0x29eed6){logger['error'](_0x66db('0x15'),_0x29eed6[_0x66db('0x13')],_0x28d5e4);_0x25f960(_0x2b1c0a[_0x66db('0x10')](0x1f4,_0x29eed6['message']));});});};exports[_0x66db('0x1b')]=function(_0x1b6b00){var _0x1a236b=this;return new Promise(function(_0x5aa96c,_0xb385e4){return db[_0x66db('0x16')][_0x66db('0x1c')](_0x1b6b00['body'],{'raw':_0x1b6b00[_0x66db('0x17')]?_0x1b6b00['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b6b00[_0x66db('0x17')]?_0x1b6b00[_0x66db('0x17')][_0x66db('0x1d')]||null:null,'attributes':_0x1b6b00['options']?_0x1b6b00[_0x66db('0x17')][_0x66db('0x1e')]||null:null,'limit':_0x1b6b00[_0x66db('0x17')]?_0x1b6b00[_0x66db('0x17')][_0x66db('0x1f')]||null:null})['then'](function(_0x51b5eb){logger[_0x66db('0xb')]('UpdateVoiceDialReport',_0x1b6b00);logger['debug'](_0x66db('0x1b'),_0x1b6b00,JSON['stringify'](_0x51b5eb));_0x5aa96c(_0x51b5eb);})[_0x66db('0x1a')](function(_0x49bab7){logger['error']('UpdateVoiceDialReport',_0x49bab7['message'],_0x1b6b00);_0xb385e4(_0x1a236b[_0x66db('0x10')](0x1f4,_0x49bab7['message']));});});};
\ No newline at end of file
index 9127ad4..413daab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3892=['addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','create','post','/:id/applications'];(function(_0xe6702b,_0x2c8440){var _0x742bf3=function(_0x2b5017){while(--_0x2b5017){_0xe6702b['push'](_0xe6702b['shift']());}};_0x742bf3(++_0x2c8440);}(_0x3892,0x16b));var _0x2389=function(_0x262241,_0x2357d){_0x262241=_0x262241-0x0;var _0x410fe2=_0x3892[_0x262241];return _0x410fe2;};'use strict';var multer=require(_0x2389('0x0'));var util=require(_0x2389('0x1'));var path=require(_0x2389('0x2'));var timeout=require('connect-timeout');var express=require(_0x2389('0x3'));var router=express[_0x2389('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2389('0x5'));var config=require('../../config/environment');var controller=require(_0x2389('0x6'));router['get']('/',auth[_0x2389('0x7')](),controller[_0x2389('0x8')]);router[_0x2389('0x9')](_0x2389('0xa'),auth[_0x2389('0x7')](),controller[_0x2389('0xb')]);router['post']('/',auth[_0x2389('0x7')](),controller[_0x2389('0xc')]);router[_0x2389('0xd')](_0x2389('0xe'),auth[_0x2389('0x7')](),controller[_0x2389('0xf')]);router[_0x2389('0x10')]('/:id',auth[_0x2389('0x7')](),controller[_0x2389('0x11')]);router[_0x2389('0x12')]('/:id',auth[_0x2389('0x7')](),controller[_0x2389('0x13')]);module[_0x2389('0x14')]=router;
\ No newline at end of file
+var _0xff6a=['post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceExtension.controller','isAuthenticated','get','show'];(function(_0x2d78a4,_0x362f5){var _0x38d29a=function(_0x314265){while(--_0x314265){_0x2d78a4['push'](_0x2d78a4['shift']());}};_0x38d29a(++_0x362f5);}(_0xff6a,0x1ed));var _0xaff6=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xff6a[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0xaff6('0x0'));var util=require('util');var path=require(_0xaff6('0x1'));var timeout=require(_0xaff6('0x2'));var express=require(_0xaff6('0x3'));var router=express[_0xaff6('0x4')]();var fs_extra=require(_0xaff6('0x5'));var auth=require(_0xaff6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaff6('0x7'));router['get']('/',auth[_0xaff6('0x8')](),controller['index']);router[_0xaff6('0x9')]('/:id',auth[_0xaff6('0x8')](),controller[_0xaff6('0xa')]);router[_0xaff6('0xb')]('/',auth[_0xaff6('0x8')](),controller['create']);router[_0xaff6('0xb')]('/:id/applications',auth[_0xaff6('0x8')](),controller['addApplications']);router[_0xaff6('0xc')](_0xaff6('0xd'),auth[_0xaff6('0x8')](),controller[_0xaff6('0xe')]);router[_0xaff6('0xf')]('/:id',auth[_0xaff6('0x8')](),controller[_0xaff6('0x10')]);module[_0xaff6('0x11')]=router;
\ No newline at end of file
index 93b7e96..7f38005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95bf=['getDataValue','exports','STRING','compositeIndex','NoOp','outbound','inbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav'];(function(_0x499292,_0x10aa11){var _0x3fae20=function(_0x3f15bb){while(--_0x3f15bb){_0x499292['push'](_0x499292['shift']());}};_0x3fae20(++_0x10aa11);}(_0x95bf,0x17a));var _0xf95b=function(_0x8b9bbf,_0x1e0a20){_0x8b9bbf=_0x8b9bbf-0x0;var _0x129170=_0x95bf[_0x8b9bbf];return _0x129170;};'use strict';var Sequelize=require('sequelize');module[_0xf95b('0x0')]={'context':{'type':Sequelize[_0xf95b('0x1')],'allowNull':![],'unique':_0xf95b('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf95b('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xf95b('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xf95b('0x1')],'allowNull':![],'defaultValue':_0xf95b('0x3')},'appdata':{'type':Sequelize[_0xf95b('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xf95b('0x4'),'internal',_0xf95b('0x5'),'outbound-fax',_0xf95b('0x6'),_0xf95b('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0xf95b('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf95b('0x8')},'IntervalId':{'type':Sequelize[_0xf95b('0x9')]},'isApp':{'type':Sequelize[_0xf95b('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf95b('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf95b('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xf95b('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf95b('0x9')]},'recordingFormat':{'type':Sequelize[_0xf95b('0x1')],'defaultValue':_0xf95b('0xb')},'answer':{'type':Sequelize[_0xf95b('0xa')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5d58f5){return this[_0xf95b('0xc')]('exten');}},'alias':{'type':Sequelize[_0xf95b('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x6b6c=['INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*'];(function(_0x540deb,_0x1e537d){var _0x445c96=function(_0x1b9b18){while(--_0x1b9b18){_0x540deb['push'](_0x540deb['shift']());}};_0x445c96(++_0x1e537d);}(_0x6b6c,0x127));var _0xc6b6=function(_0x46c215,_0x37d19c){_0x46c215=_0x46c215-0x0;var _0x14c353=_0x6b6c[_0x46c215];return _0x14c353;};'use strict';var Sequelize=require(_0xc6b6('0x0'));module[_0xc6b6('0x1')]={'context':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'unique':_0xc6b6('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'unique':_0xc6b6('0x3')},'priority':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xc6b6('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc6b6('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xc6b6('0x5'),'internal',_0xc6b6('0x6'),_0xc6b6('0x7'),_0xc6b6('0x8'),_0xc6b6('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':![],'defaultValue':_0xc6b6('0xa')},'IntervalId':{'type':Sequelize[_0xc6b6('0xb')]},'isApp':{'type':Sequelize[_0xc6b6('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xc6b6('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xc6b6('0xb')]},'recordingFormat':{'type':Sequelize[_0xc6b6('0x2')],'defaultValue':_0xc6b6('0xd')},'answer':{'type':Sequelize[_0xc6b6('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc6b6('0xe')],'get':function(_0x303334){return this[_0xc6b6('0xf')](_0xc6b6('0x10'));}},'alias':{'type':Sequelize[_0xc6b6('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 3b24231..ae2f04e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x862e=['value','includes','type','find','name','UserProfileResource','stack','send','index','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','VoiceExtension','includeAll','findAll','then','show','params','include','options','catch','body','outbound','exten','concat','create','user','role','inbound','internal','UserProfileSection','error','update','context','cutdigits','mandatoryDisposition','alias','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','get','InboundRoutes','OutboundRoutes','InternalRoutes','filter','map'];(function(_0x387050,_0x4b754c){var _0x13765b=function(_0x3e119d){while(--_0x3e119d){_0x387050['push'](_0x387050['shift']());}};_0x13765b(++_0x4b754c);}(_0x862e,0x19e));var _0xe862=function(_0x16e30c,_0x5f5d17){_0x16e30c=_0x16e30c-0x0;var _0x244709=_0x862e[_0x16e30c];return _0x244709;};'use strict';var _=require('lodash');var Redis=require(_0xe862('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xe862('0x1'))(_0xe862('0x2'));var config=require(_0xe862('0x3'));var db=require(_0xe862('0x4'))['db'];config[_0xe862('0x5')]=_['defaults'](config[_0xe862('0x5')],{'host':_0xe862('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe862('0x5')]));require(_0xe862('0x7'))[_0xe862('0x8')](socket);function respondWithStatusCode(_0x3027a4,_0x57a86d){_0x57a86d=_0x57a86d||0xcc;return function(_0x328f6a){if(_0x328f6a){return _0x3027a4[_0xe862('0x9')](_0x57a86d);}return _0x3027a4[_0xe862('0xa')](_0x57a86d)[_0xe862('0xb')]();};}function respondWithResult(_0xfebb6e,_0x4d6fdd){_0x4d6fdd=_0x4d6fdd||0xc8;return function(_0x5e0156){if(_0x5e0156){return _0xfebb6e['status'](_0x4d6fdd)[_0xe862('0xc')](_0x5e0156);}};}function respondWithFilteredResult(_0x51d2da,_0x3cd522){return function(_0x385399){if(_0x385399){var _0x5a1423=typeof _0x3cd522[_0xe862('0xd')]===_0xe862('0xe')&&typeof _0x3cd522[_0xe862('0xf')]===_0xe862('0xe');var _0x1924a5=_0x385399[_0xe862('0x10')];var _0xe3c143=_0x5a1423?0x0:_0x3cd522[_0xe862('0xd')];var _0x1e61b0=_0x5a1423?_0x385399[_0xe862('0x10')]:_0x3cd522[_0xe862('0xd')]+_0x3cd522[_0xe862('0xf')];var _0x86968f;if(_0x1e61b0>=_0x1924a5){_0x1e61b0=_0x1924a5;_0x86968f=0xc8;}else{_0x86968f=0xce;}_0x51d2da['status'](_0x86968f);return _0x51d2da[_0xe862('0x11')](_0xe862('0x12'),_0xe3c143+'-'+_0x1e61b0+'/'+_0x1924a5)[_0xe862('0xc')](_0x385399);}return null;};}function removeEntity(_0x90bbee){return function(_0x385b40){if(_0x385b40){return _0x385b40[_0xe862('0x13')]()['then'](function(){var _0x278303=_0x385b40[_0xe862('0x14')]({'plain':!![]});var _0x48d113=[{'name':_0xe862('0x15'),'value':'inbound','ignore':![]},{'name':_0xe862('0x16'),'value':'outbound','ignore':![]},{'name':_0xe862('0x17'),'value':'internal','ignore':![]}];var _0x49c5b4=_(_0x48d113)[_0xe862('0x18')]('ignore')[_0xe862('0x19')](_0xe862('0x1a'))[_0xe862('0x1a')]();if(_[_0xe862('0x1b')](_0x49c5b4,_0x278303[_0xe862('0x1c')])){return;}var _0x21c24c=_[_0xe862('0x1d')](_0x48d113,[_0xe862('0x1a'),_0x278303[_0xe862('0x1c')]])[_0xe862('0x1e')];return db[_0xe862('0x1f')][_0xe862('0x13')]({'where':{'type':_0x21c24c,'resourceId':_0x278303['id']}})['then'](function(){return _0x385b40;});})['then'](function(){_0x90bbee[_0xe862('0xa')](0xcc)[_0xe862('0xb')]();});}};}function handleEntityNotFound(_0x90cb9e){return function(_0x39ba4d){if(!_0x39ba4d){_0x90cb9e[_0xe862('0x9')](0x194);}return _0x39ba4d;};}function handleError(_0x24c794,_0x5a077a){_0x5a077a=_0x5a077a||0x1f4;return function(_0xcecb43){logger['error'](_0xcecb43[_0xe862('0x20')]);if(_0xcecb43['name']){delete _0xcecb43[_0xe862('0x1e')];}_0x24c794['status'](_0x5a077a)[_0xe862('0x21')](_0xcecb43);};}exports[_0xe862('0x22')]=function(_0x1ff6ed,_0x34d9fb){var _0x3a3b70={},_0xffceea={},_0x3f7a72={'count':0x0,'rows':[]};var _0x3246f0=_['map'](db['VoiceExtension']['rawAttributes'],function(_0x568ad6){return{'name':_0x568ad6[_0xe862('0x23')],'type':_0x568ad6[_0xe862('0x1c')]['key']};});_0xffceea[_0xe862('0x24')]=_[_0xe862('0x19')](_0x3246f0,_0xe862('0x1e'));_0xffceea[_0xe862('0x25')]=_[_0xe862('0x26')](_0x1ff6ed[_0xe862('0x25')]);_0xffceea[_0xe862('0x27')]=_[_0xe862('0x28')](_0xffceea[_0xe862('0x24')],_0xffceea[_0xe862('0x25')]);_0x3a3b70[_0xe862('0x29')]=_['intersection'](_0xffceea[_0xe862('0x24')],qs[_0xe862('0x2a')](_0x1ff6ed['query']['fields']));_0x3a3b70[_0xe862('0x29')]=_0x3a3b70[_0xe862('0x29')][_0xe862('0x2b')]?_0x3a3b70[_0xe862('0x29')]:_0xffceea['model'];if(!_0x1ff6ed[_0xe862('0x25')][_0xe862('0x2c')](_0xe862('0x2d'))){_0x3a3b70[_0xe862('0xf')]=qs[_0xe862('0xf')](_0x1ff6ed['query'][_0xe862('0xf')]);_0x3a3b70[_0xe862('0xd')]=qs[_0xe862('0xd')](_0x1ff6ed['query'][_0xe862('0xd')]);}_0x3a3b70[_0xe862('0x2e')]=qs[_0xe862('0x2f')](_0x1ff6ed[_0xe862('0x25')][_0xe862('0x2f')]);_0x3a3b70[_0xe862('0x30')]=qs[_0xe862('0x27')](_['pick'](_0x1ff6ed['query'],_0xffceea[_0xe862('0x27')]),_0x3246f0);if(_0x1ff6ed[_0xe862('0x25')][_0xe862('0x18')]){_0x3a3b70[_0xe862('0x30')]=_[_0xe862('0x31')](_0x3a3b70[_0xe862('0x30')],{'$or':_['map'](_0x3246f0,function(_0x59b2e4){if(_0x59b2e4[_0xe862('0x1c')]!==_0xe862('0x32')){var _0x485805={};_0x485805[_0x59b2e4['name']]={'$like':'%'+_0x1ff6ed['query']['filter']+'%'};return _0x485805;}})});}_0x3a3b70=_[_0xe862('0x31')]({},_0x3a3b70,_0x1ff6ed['options']);var _0x5cf0f2={'where':_0x3a3b70['where']};return db[_0xe862('0x33')][_0xe862('0x10')](_0x5cf0f2)['then'](function(_0x12c4f7){_0x3f7a72['count']=_0x12c4f7;if(_0x1ff6ed[_0xe862('0x25')][_0xe862('0x34')]){_0x3a3b70['include']=[{'all':!![]}];}return db[_0xe862('0x33')][_0xe862('0x35')](_0x3a3b70);})['then'](function(_0x3a544d){_0x3f7a72['rows']=_0x3a544d;return _0x3f7a72;})[_0xe862('0x36')](respondWithFilteredResult(_0x34d9fb,_0x3a3b70))['catch'](handleError(_0x34d9fb,null));};exports[_0xe862('0x37')]=function(_0x1f7faf,_0x520352){var _0x278fef={'raw':![],'where':{'id':_0x1f7faf[_0xe862('0x38')]['id']}},_0x28075a={};_0x28075a[_0xe862('0x24')]=_[_0xe862('0x26')](db[_0xe862('0x33')]['rawAttributes']);_0x28075a['query']=_[_0xe862('0x26')](_0x1f7faf[_0xe862('0x25')]);_0x28075a['filters']=_['intersection'](_0x28075a[_0xe862('0x24')],_0x28075a['query']);_0x278fef[_0xe862('0x29')]=_[_0xe862('0x28')](_0x28075a[_0xe862('0x24')],qs['fields'](_0x1f7faf[_0xe862('0x25')]['fields']));_0x278fef[_0xe862('0x29')]=_0x278fef[_0xe862('0x29')][_0xe862('0x2b')]?_0x278fef[_0xe862('0x29')]:_0x28075a['model'];if(_0x1f7faf[_0xe862('0x25')]['includeAll']){_0x278fef[_0xe862('0x39')]=[{'all':!![]}];}_0x278fef=_['merge']({},_0x278fef,_0x1f7faf[_0xe862('0x3a')]);return db[_0xe862('0x33')][_0xe862('0x1d')](_0x278fef)[_0xe862('0x36')](handleEntityNotFound(_0x520352,null))[_0xe862('0x36')](respondWithResult(_0x520352,null))[_0xe862('0x3b')](handleError(_0x520352,null));};exports[_0xe862('0x13')]=function(_0x410a1d,_0x5aef4d){return db['VoiceExtension'][_0xe862('0x1d')]({'where':{'id':_0x410a1d[_0xe862('0x38')]['id']}})[_0xe862('0x36')](handleEntityNotFound(_0x5aef4d,null))[_0xe862('0x36')](removeEntity(_0x5aef4d,null))[_0xe862('0x3b')](handleError(_0x5aef4d,null));};exports['create']=function(_0x45ac5b,_0x4f1334){if(_0x45ac5b[_0xe862('0x3c')][_0xe862('0x1c')]===_0xe862('0x3d')&&!_['startsWith'](_0x45ac5b['body'][_0xe862('0x3e')],'_')){_0x45ac5b[_0xe862('0x3c')]['exten']='_'[_0xe862('0x3f')](_0x45ac5b[_0xe862('0x3c')]['exten']);}return db[_0xe862('0x33')][_0xe862('0x40')](_0x45ac5b[_0xe862('0x3c')],{'raw':![]})[_0xe862('0x36')](function(_0x42e08b){var _0x293aad=_0x45ac5b[_0xe862('0x41')][_0xe862('0x14')]({'plain':!![]});if(!_0x293aad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x293aad[_0xe862('0x42')]===_0xe862('0x41')){var _0x21303c=_0x42e08b[_0xe862('0x14')]({'plain':!![]});var _0x52cd0d=[{'name':_0xe862('0x15'),'value':_0xe862('0x43')},{'name':_0xe862('0x16'),'value':_0xe862('0x3d')},{'name':_0xe862('0x17'),'value':_0xe862('0x44')}];var _0xb9d0cf=_['find'](_0x52cd0d,[_0xe862('0x1a'),_0x21303c['type']])[_0xe862('0x1e')];return db[_0xe862('0x45')][_0xe862('0x1d')]({'where':{'name':_0xb9d0cf,'userProfileId':_0x293aad['userProfileId']},'raw':!![]})[_0xe862('0x36')](function(_0x3307fc){if(_0x3307fc&&_0x3307fc['autoAssociation']===0x0){return db['UserProfileResource'][_0xe862('0x40')]({'name':_0x21303c['name'],'resourceId':_0x21303c['id'],'type':_0x3307fc[_0xe862('0x1e')],'sectionId':_0x3307fc['id']},{})['then'](function(){return _0x42e08b;});}else{return _0x42e08b;}})[_0xe862('0x3b')](function(_0x34b620){logger[_0xe862('0x46')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x34b620);throw _0x34b620;});}return _0x42e08b;})['then'](respondWithResult(_0x4f1334,0xc9))[_0xe862('0x3b')](handleError(_0x4f1334,null));};exports[_0xe862('0x47')]=function(_0xf5f115,_0x51fc0b){if(_0xf5f115[_0xe862('0x3c')]['id']){delete _0xf5f115[_0xe862('0x3c')]['id'];}return db[_0xe862('0x33')][_0xe862('0x1d')]({'where':{'id':_0xf5f115[_0xe862('0x38')]['id']}})[_0xe862('0x36')](handleEntityNotFound(_0x51fc0b,null))[_0xe862('0x36')](function(_0x28c273){if(_0x28c273){return db[_0xe862('0x33')][_0xe862('0x47')](_['pick'](_0xf5f115[_0xe862('0x3c')],['exten',_0xe862('0x48'),'description','recordingFormat',_0xe862('0x49'),_0xe862('0x4a'),_0xe862('0x4b')]),{'where':{'context':_0x28c273[_0xe862('0x48')],'exten':_0x28c273[_0xe862('0x3e')]},'individualHooks':!![]})['then'](function(_0x1512b5){return _0x1512b5;});}return null;})['then'](respondWithStatusCode(_0x51fc0b,null))[_0xe862('0x3b')](handleError(_0x51fc0b,null));};exports[_0xe862('0x4c')]=function(_0x9d50bf,_0x353e6d){var _0x1b077c=_0x9d50bf['params']['id'];var _0x1fd863=_0x9d50bf[_0xe862('0x3c')];var _0x3d570a=0xc8;var _0x502f48=null;return db['sequelize'][_0xe862('0x4d')]({'isolationLevel':db[_0xe862('0x4e')][_0xe862('0x4f')][_0xe862('0x50')][_0xe862('0x51')]},function(_0x6c4dee){return db[_0xe862('0x33')][_0xe862('0x52')]({'where':{'id':_0x1b077c},'transaction':_0x6c4dee})[_0xe862('0x36')](function(_0x2ab2b5){if(_0x2ab2b5){return db[_0xe862('0x33')]['destroy']({'where':{'VoiceExtensionId':_0x1b077c},'transaction':_0x6c4dee})[_0xe862('0x36')](function(){var _0x5ea2cd=_['map'](_0x1fd863,function(_0x1e6293){_0x1e6293['VoiceExtensionId']=_0x1b077c;_0x1e6293[_0xe862('0x53')]=!![];return _0x1e6293;});return _0x2ab2b5[_0xe862('0x54')](_0x5ea2cd);})[_0xe862('0x36')](function(_0x32e91d){return db[_0xe862('0x33')][_0xe862('0x55')](_0x32e91d,{'transaction':_0x6c4dee});});}else{_0x3d570a=0x194;_0x502f48=[];}});})['then'](function(){if(_0x3d570a!==0x194){return db[_0xe862('0x33')][_0xe862('0x56')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1b077c},'order':_0xe862('0x57')})[_0xe862('0x36')](function(_0x26a1b5){_0x502f48=_0x26a1b5;});}})[_0xe862('0x3b')](function(_0x37ba50){_0x3d570a=0x1f4;logger[_0xe862('0x46')](_0x37ba50[_0xe862('0x20')]);if(_0x37ba50[_0xe862('0x1e')]){delete _0x37ba50[_0xe862('0x1e')];}_0x502f48=_0x37ba50;})['finally'](function(){if(_0x502f48===null){_0x353e6d[_0xe862('0x9')](_0x3d570a);}else{if(_0x3d570a===0x1f4){_0x353e6d[_0xe862('0xa')](_0x3d570a)[_0xe862('0x21')](_0x502f48);}else{_0x353e6d[_0xe862('0xa')](_0x3d570a)[_0xe862('0xc')](_0x502f48);}}});};
\ No newline at end of file
+var _0xed1d=['exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','finally','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','undefined','count','offset','Content-Range','json','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','type','find','name','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body'];(function(_0x539145,_0xb2f4c2){var _0x59e7ef=function(_0x515df8){while(--_0x515df8){_0x539145['push'](_0x539145['shift']());}};_0x59e7ef(++_0xb2f4c2);}(_0xed1d,0x12a));var _0xded1=function(_0x5c5634,_0x5ed129){_0x5c5634=_0x5c5634-0x0;var _0xbb74aa=_0xed1d[_0x5c5634];return _0xbb74aa;};'use strict';var _=require(_0xded1('0x0'));var Redis=require(_0xded1('0x1'));var qs=require(_0xded1('0x2'));var logger=require('../../config/logger')(_0xded1('0x3'));var config=require(_0xded1('0x4'));var db=require(_0xded1('0x5'))['db'];config[_0xded1('0x6')]=_[_0xded1('0x7')](config['redis'],{'host':_0xded1('0x8'),'port':0x18eb});var socket=require(_0xded1('0x9'))(new Redis(config['redis']));require(_0xded1('0xa'))[_0xded1('0xb')](socket);function respondWithStatusCode(_0x5565da,_0x3f180e){_0x3f180e=_0x3f180e||0xcc;return function(_0x483c95){if(_0x483c95){return _0x5565da['sendStatus'](_0x3f180e);}return _0x5565da[_0xded1('0xc')](_0x3f180e)[_0xded1('0xd')]();};}function respondWithResult(_0x28145c,_0xa4302c){_0xa4302c=_0xa4302c||0xc8;return function(_0x3b4dbd){if(_0x3b4dbd){return _0x28145c[_0xded1('0xc')](_0xa4302c)['json'](_0x3b4dbd);}};}function respondWithFilteredResult(_0x1db889,_0x3532f1){return function(_0x1c9572){if(_0x1c9572){var _0x7156a0=typeof _0x3532f1['offset']===_0xded1('0xe')&&typeof _0x3532f1['limit']===_0xded1('0xe');var _0x56f9d1=_0x1c9572[_0xded1('0xf')];var _0x127704=_0x7156a0?0x0:_0x3532f1[_0xded1('0x10')];var _0x4bdbc8=_0x7156a0?_0x1c9572['count']:_0x3532f1[_0xded1('0x10')]+_0x3532f1['limit'];var _0x48317a;if(_0x4bdbc8>=_0x56f9d1){_0x4bdbc8=_0x56f9d1;_0x48317a=0xc8;}else{_0x48317a=0xce;}_0x1db889[_0xded1('0xc')](_0x48317a);return _0x1db889['set'](_0xded1('0x11'),_0x127704+'-'+_0x4bdbc8+'/'+_0x56f9d1)[_0xded1('0x12')](_0x1c9572);}return null;};}function removeEntity(_0x3fcda8){return function(_0x4637b9){if(_0x4637b9){return _0x4637b9[_0xded1('0x13')]()[_0xded1('0x14')](function(){var _0x34c380=_0x4637b9[_0xded1('0x15')]({'plain':!![]});var _0x153bc2=[{'name':_0xded1('0x16'),'value':_0xded1('0x17'),'ignore':![]},{'name':_0xded1('0x18'),'value':_0xded1('0x19'),'ignore':![]},{'name':_0xded1('0x1a'),'value':_0xded1('0x1b'),'ignore':![]}];var _0x30004a=_(_0x153bc2)[_0xded1('0x1c')](_0xded1('0x1d'))[_0xded1('0x1e')](_0xded1('0x1f'))[_0xded1('0x1f')]();if(_['includes'](_0x30004a,_0x34c380[_0xded1('0x20')])){return;}var _0x37aade=_[_0xded1('0x21')](_0x153bc2,[_0xded1('0x1f'),_0x34c380[_0xded1('0x20')]])[_0xded1('0x22')];return db['UserProfileResource'][_0xded1('0x13')]({'where':{'type':_0x37aade,'resourceId':_0x34c380['id']}})[_0xded1('0x14')](function(){return _0x4637b9;});})[_0xded1('0x14')](function(){_0x3fcda8['status'](0xcc)[_0xded1('0xd')]();});}};}function handleEntityNotFound(_0x558c79){return function(_0x23be1b){if(!_0x23be1b){_0x558c79[_0xded1('0x23')](0x194);}return _0x23be1b;};}function handleError(_0x10edf7,_0x327311){_0x327311=_0x327311||0x1f4;return function(_0x22cce4){logger[_0xded1('0x24')](_0x22cce4[_0xded1('0x25')]);if(_0x22cce4['name']){delete _0x22cce4[_0xded1('0x22')];}_0x10edf7['status'](_0x327311)[_0xded1('0x26')](_0x22cce4);};}exports[_0xded1('0x27')]=function(_0xd9a27b,_0x5ae4a6){var _0x129c6f={},_0x188584={},_0xf12bfe={'count':0x0,'rows':[]};var _0x5a1dc2=_[_0xded1('0x1e')](db[_0xded1('0x28')][_0xded1('0x29')],function(_0x19584f){return{'name':_0x19584f[_0xded1('0x2a')],'type':_0x19584f[_0xded1('0x20')][_0xded1('0x2b')]};});_0x188584[_0xded1('0x2c')]=_[_0xded1('0x1e')](_0x5a1dc2,_0xded1('0x22'));_0x188584[_0xded1('0x2d')]=_['keys'](_0xd9a27b[_0xded1('0x2d')]);_0x188584['filters']=_[_0xded1('0x2e')](_0x188584['model'],_0x188584[_0xded1('0x2d')]);_0x129c6f['attributes']=_[_0xded1('0x2e')](_0x188584[_0xded1('0x2c')],qs[_0xded1('0x2f')](_0xd9a27b[_0xded1('0x2d')]['fields']));_0x129c6f[_0xded1('0x30')]=_0x129c6f[_0xded1('0x30')][_0xded1('0x31')]?_0x129c6f[_0xded1('0x30')]:_0x188584[_0xded1('0x2c')];if(!_0xd9a27b[_0xded1('0x2d')][_0xded1('0x32')](_0xded1('0x33'))){_0x129c6f[_0xded1('0x34')]=qs[_0xded1('0x34')](_0xd9a27b[_0xded1('0x2d')][_0xded1('0x34')]);_0x129c6f[_0xded1('0x10')]=qs[_0xded1('0x10')](_0xd9a27b[_0xded1('0x2d')][_0xded1('0x10')]);}_0x129c6f[_0xded1('0x35')]=qs['sort'](_0xd9a27b[_0xded1('0x2d')][_0xded1('0x36')]);_0x129c6f[_0xded1('0x37')]=qs[_0xded1('0x38')](_[_0xded1('0x39')](_0xd9a27b[_0xded1('0x2d')],_0x188584[_0xded1('0x38')]),_0x5a1dc2);if(_0xd9a27b[_0xded1('0x2d')][_0xded1('0x1c')]){_0x129c6f[_0xded1('0x37')]=_['merge'](_0x129c6f[_0xded1('0x37')],{'$or':_[_0xded1('0x1e')](_0x5a1dc2,function(_0x46d900){if(_0x46d900[_0xded1('0x20')]!==_0xded1('0x3a')){var _0x3656f4={};_0x3656f4[_0x46d900[_0xded1('0x22')]]={'$like':'%'+_0xd9a27b[_0xded1('0x2d')]['filter']+'%'};return _0x3656f4;}})});}_0x129c6f=_['merge']({},_0x129c6f,_0xd9a27b['options']);var _0x297215={'where':_0x129c6f[_0xded1('0x37')]};return db['VoiceExtension'][_0xded1('0xf')](_0x297215)[_0xded1('0x14')](function(_0x33e05b){_0xf12bfe[_0xded1('0xf')]=_0x33e05b;if(_0xd9a27b[_0xded1('0x2d')]['includeAll']){_0x129c6f[_0xded1('0x3b')]=[{'all':!![]}];}return db[_0xded1('0x28')][_0xded1('0x3c')](_0x129c6f);})[_0xded1('0x14')](function(_0x284c4e){_0xf12bfe[_0xded1('0x3d')]=_0x284c4e;return _0xf12bfe;})[_0xded1('0x14')](respondWithFilteredResult(_0x5ae4a6,_0x129c6f))[_0xded1('0x3e')](handleError(_0x5ae4a6,null));};exports[_0xded1('0x3f')]=function(_0x1d4e10,_0x4206da){var _0x4988f4={'raw':![],'where':{'id':_0x1d4e10[_0xded1('0x40')]['id']}},_0xab61a7={};_0xab61a7['model']=_[_0xded1('0x41')](db[_0xded1('0x28')][_0xded1('0x29')]);_0xab61a7[_0xded1('0x2d')]=_[_0xded1('0x41')](_0x1d4e10['query']);_0xab61a7[_0xded1('0x38')]=_[_0xded1('0x2e')](_0xab61a7[_0xded1('0x2c')],_0xab61a7[_0xded1('0x2d')]);_0x4988f4['attributes']=_[_0xded1('0x2e')](_0xab61a7[_0xded1('0x2c')],qs[_0xded1('0x2f')](_0x1d4e10[_0xded1('0x2d')][_0xded1('0x2f')]));_0x4988f4['attributes']=_0x4988f4[_0xded1('0x30')]['length']?_0x4988f4[_0xded1('0x30')]:_0xab61a7[_0xded1('0x2c')];if(_0x1d4e10['query'][_0xded1('0x42')]){_0x4988f4[_0xded1('0x3b')]=[{'all':!![]}];}_0x4988f4=_['merge']({},_0x4988f4,_0x1d4e10[_0xded1('0x43')]);return db[_0xded1('0x28')]['find'](_0x4988f4)[_0xded1('0x14')](handleEntityNotFound(_0x4206da,null))['then'](respondWithResult(_0x4206da,null))['catch'](handleError(_0x4206da,null));};exports[_0xded1('0x13')]=function(_0x338347,_0x54213f){return db['VoiceExtension']['find']({'where':{'id':_0x338347[_0xded1('0x40')]['id']}})[_0xded1('0x14')](handleEntityNotFound(_0x54213f,null))[_0xded1('0x14')](removeEntity(_0x54213f,null))['catch'](handleError(_0x54213f,null));};exports[_0xded1('0x44')]=function(_0x557b07,_0x5e5e6e){if(_0x557b07['body'][_0xded1('0x20')]===_0xded1('0x19')&&!_['startsWith'](_0x557b07[_0xded1('0x45')]['exten'],'_')){_0x557b07[_0xded1('0x45')][_0xded1('0x46')]='_'['concat'](_0x557b07[_0xded1('0x45')][_0xded1('0x46')]);}return db[_0xded1('0x28')][_0xded1('0x44')](_0x557b07[_0xded1('0x45')],{'raw':![]})[_0xded1('0x14')](function(_0x3ac94f){var _0x8e899a=_0x557b07[_0xded1('0x47')][_0xded1('0x15')]({'plain':!![]});if(!_0x8e899a)throw new Error(_0xded1('0x48'));if(_0x8e899a[_0xded1('0x49')]===_0xded1('0x47')){var _0x2b2b4c=_0x3ac94f[_0xded1('0x15')]({'plain':!![]});var _0x628409=[{'name':_0xded1('0x16'),'value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xded1('0x1a'),'value':_0xded1('0x1b')}];var _0x20d708=_[_0xded1('0x21')](_0x628409,['value',_0x2b2b4c['type']])['name'];return db['UserProfileSection'][_0xded1('0x21')]({'where':{'name':_0x20d708,'userProfileId':_0x8e899a[_0xded1('0x4a')]},'raw':!![]})[_0xded1('0x14')](function(_0x17ea09){if(_0x17ea09&&_0x17ea09['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2b2b4c[_0xded1('0x22')],'resourceId':_0x2b2b4c['id'],'type':_0x17ea09[_0xded1('0x22')],'sectionId':_0x17ea09['id']},{})[_0xded1('0x14')](function(){return _0x3ac94f;});}else{return _0x3ac94f;}})[_0xded1('0x3e')](function(_0x541c5d){logger[_0xded1('0x24')](_0xded1('0x4b'),_0x541c5d);throw _0x541c5d;});}return _0x3ac94f;})[_0xded1('0x14')](respondWithResult(_0x5e5e6e,0xc9))[_0xded1('0x3e')](handleError(_0x5e5e6e,null));};exports['update']=function(_0x377512,_0x37e7c1){if(_0x377512[_0xded1('0x45')]['id']){delete _0x377512[_0xded1('0x45')]['id'];}return db[_0xded1('0x28')][_0xded1('0x21')]({'where':{'id':_0x377512[_0xded1('0x40')]['id']}})[_0xded1('0x14')](handleEntityNotFound(_0x37e7c1,null))['then'](function(_0x38ba58){if(_0x38ba58){return db[_0xded1('0x28')][_0xded1('0x4c')](_[_0xded1('0x39')](_0x377512['body'],[_0xded1('0x46'),'context',_0xded1('0x4d'),_0xded1('0x4e'),_0xded1('0x4f'),'mandatoryDisposition',_0xded1('0x50')]),{'where':{'context':_0x38ba58['context'],'exten':_0x38ba58['exten']},'individualHooks':!![]})[_0xded1('0x14')](function(_0x3edd07){return _0x3edd07;});}return null;})[_0xded1('0x14')](respondWithStatusCode(_0x37e7c1,null))[_0xded1('0x3e')](handleError(_0x37e7c1,null));};exports[_0xded1('0x51')]=function(_0x290d37,_0x349cdc){var _0x4f10fe=_0x290d37[_0xded1('0x40')]['id'];var _0x19ea72=_0x290d37[_0xded1('0x45')];var _0x303246=0xc8;var _0x53828c=null;return db[_0xded1('0x52')]['transaction']({'isolationLevel':db[_0xded1('0x52')][_0xded1('0x53')][_0xded1('0x54')][_0xded1('0x55')]},function(_0x2cfc0a){return db[_0xded1('0x28')][_0xded1('0x56')]({'where':{'id':_0x4f10fe},'transaction':_0x2cfc0a})[_0xded1('0x14')](function(_0x420ce7){if(_0x420ce7){return db[_0xded1('0x28')]['destroy']({'where':{'VoiceExtensionId':_0x4f10fe},'transaction':_0x2cfc0a})[_0xded1('0x14')](function(){var _0x10c204=_[_0xded1('0x1e')](_0x19ea72,function(_0x59718d){_0x59718d[_0xded1('0x57')]=_0x4f10fe;_0x59718d[_0xded1('0x58')]=!![];return _0x59718d;});return _0x420ce7[_0xded1('0x59')](_0x10c204);})['then'](function(_0x710e26){return db[_0xded1('0x28')][_0xded1('0x5a')](_0x710e26,{'transaction':_0x2cfc0a});});}else{_0x303246=0x194;_0x53828c=[];}});})[_0xded1('0x14')](function(){if(_0x303246!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4f10fe},'order':'cast(priority\x20as\x20unsigned)'})['then'](function(_0x4991bd){_0x53828c=_0x4991bd;});}})[_0xded1('0x3e')](function(_0x3843c3){_0x303246=0x1f4;logger['error'](_0x3843c3[_0xded1('0x25')]);if(_0x3843c3[_0xded1('0x22')]){delete _0x3843c3[_0xded1('0x22')];}_0x53828c=_0x3843c3;})[_0xded1('0x5b')](function(){if(_0x53828c===null){_0x349cdc[_0xded1('0x23')](_0x303246);}else{if(_0x303246===0x1f4){_0x349cdc[_0xded1('0xc')](_0x303246)[_0xded1('0x26')](_0x53828c);}else{_0x349cdc[_0xded1('0xc')](_0x303246)[_0xded1('0x12')](_0x53828c);}}});};
\ No newline at end of file
index 762e278..4aef943 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39ab=['../../mysqldb','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x5ed54b,_0x3a2827){var _0x4b58c7=function(_0x19d3b6){while(--_0x19d3b6){_0x5ed54b['push'](_0x5ed54b['shift']());}};_0x4b58c7(++_0x3a2827);}(_0x39ab,0x10d));var _0xb39a=function(_0x4bb1c3,_0x1dd695){_0x4bb1c3=_0x4bb1c3-0x0;var _0x3b516a=_0x39ab[_0x4bb1c3];return _0x3b516a;};'use strict';var EventEmitter=require(_0xb39a('0x0'));var VoiceExtension=require(_0xb39a('0x1'))['db'][_0xb39a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb39a('0x3')](0x0);var events={'afterCreate':_0xb39a('0x4'),'afterUpdate':'update','afterDestroy':_0xb39a('0x5')};function emitEvent(_0xb67f8f){return function(_0xd45f84,_0x19a091,_0x175a83){VoiceExtensionEvents[_0xb39a('0x6')](_0xb67f8f+':'+_0xd45f84['id'],_0xd45f84);VoiceExtensionEvents[_0xb39a('0x6')](_0xb67f8f,_0xd45f84);_0x175a83(null);};}for(var e in events){if(events[_0xb39a('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xb39a('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x10a7=['VoiceExtension','save','update','remove','emit','hook','exports','events'];(function(_0x1c30ce,_0xf6ca28){var _0x402610=function(_0x4df743){while(--_0x4df743){_0x1c30ce['push'](_0x1c30ce['shift']());}};_0x402610(++_0xf6ca28);}(_0x10a7,0xdf));var _0x710a=function(_0x1705fe,_0x42708c){_0x1705fe=_0x1705fe-0x0;var _0xae9e03=_0x10a7[_0x1705fe];return _0xae9e03;};'use strict';var EventEmitter=require(_0x710a('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x710a('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x710a('0x2'),'afterUpdate':_0x710a('0x3'),'afterDestroy':_0x710a('0x4')};function emitEvent(_0x5c36e9){return function(_0x4e9430,_0x3b2f78,_0x9c4dc0){VoiceExtensionEvents[_0x710a('0x5')](_0x5c36e9+':'+_0x4e9430['id'],_0x4e9430);VoiceExtensionEvents[_0x710a('0x5')](_0x5c36e9,_0x4e9430);_0x9c4dc0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x710a('0x6')](e,emitEvent(event));}}module[_0x710a('0x7')]=VoiceExtensionEvents;
\ No newline at end of file
index 6b2e359..2fb1cd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f7a=['VoiceExtension','voice_extensions','concat','Hangup','lodash','./voiceExtension.attributes','exports','models','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','exten','outbound','CDR(type)=outbound','cutdigits','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','url','name','param','phone','split','prefix','${EXTEN}','SIP','options','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','toLowerCase','hasOwnProperty','tag','CDR(tag)=','ExecIf','callerID','Set(CALLERID(all)=','answer','queue','includes','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','last','priority','catch','define'];(function(_0xfe33d1,_0x4490ab){var _0x5606a6=function(_0x409d81){while(--_0x409d81){_0xfe33d1['push'](_0xfe33d1['shift']());}};_0x5606a6(++_0x4490ab);}(_0x9f7a,0xf1));var _0xa9f7=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x9f7a[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0xa9f7('0x0'));var attributes=require(_0xa9f7('0x1'));module[_0xa9f7('0x2')]=function(_0x23e78b){var _0x4af524=_0x23e78b[_0xa9f7('0x3')];function _0x4c0346(_0x4d188f){var _0x59823f=0x2;var _0x22dbdd=[{'type':_0x4d188f[_0xa9f7('0x4')],'app':'Set','appdata':'CDR(type)='+_0x4d188f[_0xa9f7('0x4')],'context':_0x4d188f['context'],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']},{'type':_0x4d188f['type'],'app':_0x4d188f[_0xa9f7('0x5')]?'Set':_0xa9f7('0x6'),'appdata':_0x4d188f[_0xa9f7('0x5')]?_0xa9f7('0x7')+_0x4d188f['alias']:_0xa9f7('0x8'),'context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']}];if(_0x4d188f[_0xa9f7('0x4')]===_0xa9f7('0xa')){_0x22dbdd[_0xa9f7('0xb')]({'type':_0xa9f7('0xa'),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0xd')+_0x4d188f['id'],'context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']});}_0x22dbdd[_0xa9f7('0xb')]({'type':_0x4d188f['type'],'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0xe'),'context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f['exten'],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']},{'type':_0x4d188f['type'],'app':_0xa9f7('0xc'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4d188f['context'],'exten':_0x4d188f[_0xa9f7('0xf')],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']},{'type':_0x4d188f[_0xa9f7('0x4')],'app':_0xa9f7('0xc'),'appdata':'MONITOR_OPTIONS=ab','context':_0x4d188f[_0xa9f7('0x9')],'exten':_0x4d188f[_0xa9f7('0xf')],'priority':_0x59823f++,'VoiceExtensionId':_0x4d188f['id']});return _0x22dbdd;}function _0x2aeadd(_0x48315a){var _0x310009=0x2;var _0x1a1a13=[{'type':_0xa9f7('0x10'),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x11'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':_0x48315a[_0xa9f7('0x5')]?'Set':_0xa9f7('0x6'),'appdata':_0x48315a[_0xa9f7('0x5')]?_0xa9f7('0x7')+_0x48315a[_0xa9f7('0x5')]:_0xa9f7('0x8'),'context':_0x48315a['context'],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':'Set','appdata':'CDR(destination)='+(_0x48315a[_0xa9f7('0x12')]?'${EXTEN:'+_0x48315a[_0xa9f7('0x12')]+'}':'${EXTEN}'),'context':_0x48315a['context'],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':'Set','appdata':'CDR(routeid)='+_0x48315a['id'],'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':'ExecIf','appdata':_0xa9f7('0x13')+(_0x310009+0x2)+_0xa9f7('0x14')+(_0x310009+0x1)+')','context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':'Set','appdata':_0x48315a[_0xa9f7('0x12')]?'CDR(prefix)=${EXTEN:0:'+_0x48315a[_0xa9f7('0x12')]+'}':_0xa9f7('0x15'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':_0xa9f7('0xc'),'appdata':_0xa9f7('0xe'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x16'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':'outbound','app':'Set','appdata':_0xa9f7('0x17'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':'Set','appdata':'outboundrouteid='+_0x48315a['id'],'context':_0x48315a['context'],'exten':_0x48315a[_0xa9f7('0xf')],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']}];if(_0x48315a['hasOwnProperty'](_0xa9f7('0x18'))&&_0x48315a[_0xa9f7('0x18')]!==_0xa9f7('0x19')){_0x1a1a13[_0xa9f7('0xb')]({'type':_0xa9f7('0x10'),'app':'Set','appdata':_0xa9f7('0x1a'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']},{'type':_0xa9f7('0x10'),'app':_0xa9f7('0xc'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x48315a[_0xa9f7('0x18')]||_0xa9f7('0x1b'),'context':_0x48315a[_0xa9f7('0x9')],'exten':_0x48315a['exten'],'priority':_0x310009++,'VoiceExtensionId':_0x48315a['id']});}return _0x1a1a13;}function _0x58f401(_0x28283c,_0x3c79b2){var _0x2f384d=[{'name':_0xa9f7('0x1c'),'param':0x0},{'name':_0xa9f7('0x1d'),'param':0x1},{'name':'options','param':0x2},{'name':_0xa9f7('0x1e'),'param':0x3}];var _0x324341={};var _0x3be76e=_0x3c79b2['split'](',');var _0x563619=[];for(var _0xeffbb4=0x0;_0xeffbb4<_0x2f384d['length'];_0xeffbb4++){switch(_0x2f384d[_0xeffbb4][_0xa9f7('0x1f')]){case _0xa9f7('0x1c'):_0x324341[_0xa9f7('0x1c')]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]]['split']('/')[0x1];_0x324341[_0xa9f7('0x21')]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]][_0xa9f7('0x22')]('/')[0x2];_0x324341[_0xa9f7('0x23')]=_0x324341[_0xa9f7('0x21')]?_0x324341[_0xa9f7('0x21')][_0xa9f7('0x22')]('$')[0x0]:undefined;_0x324341['phone']=_0x28283c[_0xa9f7('0x12')]?(_0x324341[_0xa9f7('0x23')]||'')+'${EXTEN:'+_0x28283c[_0xa9f7('0x12')]+'}':(_0x324341[_0xa9f7('0x23')]||'')+_0xa9f7('0x24');_0x563619[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]]=[_0xa9f7('0x25'),_0x324341[_0xa9f7('0x1c')],_0x324341[_0xa9f7('0x21')]]['join']('/');break;case _0xa9f7('0x26'):_0x324341[_0xa9f7('0x26')]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]];if(_0x28283c['recordingFormat']!==_0xa9f7('0x19')){if(_0x324341['options'][_0xa9f7('0x27')](_0xa9f7('0x28'))<0x0){_0x324341['options']+=_0xa9f7('0x28');}}else{_0x324341[_0xa9f7('0x26')]=_0x324341[_0xa9f7('0x26')][_0xa9f7('0x29')](_0xa9f7('0x28'),'');}_0x563619[_0x2f384d[_0xeffbb4]['param']]=_0x324341[_0xa9f7('0x26')];break;default:_0x563619[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]]=_0x3be76e[_0x2f384d[_0xeffbb4][_0xa9f7('0x20')]];}}return _0x563619[_0xa9f7('0x2a')](',');}function _0x1706ea(_0x2d86f3,_0x6fb9cf,_0x2c7912){return new Promise(function(_0x2bfaa2,_0x440880){var _0x108c60=[];if(_[_0xa9f7('0x2b')](_0x6fb9cf))return _0x2bfaa2(_0x108c60);_0x4af524['Interval']['findAll']({'attributes':['id',_0xa9f7('0x2c'),_0xa9f7('0x2d')],'raw':!![]})[_0xa9f7('0x2e')](function(_0x3563a1){for(var _0x226279=0x0,_0x26a61d=0x0;_0x226279<_0x6fb9cf[_0xa9f7('0x2f')];_0x226279++,_0x26a61d=0x0){var _0x284f9d=_0x6fb9cf[_0x226279];var _0x4ea565=[];var _0x28eb60=[];delete _0x284f9d['id'];if(_0x284f9d[_0xa9f7('0x2c')]!==_0xa9f7('0x30')){_0x284f9d['intervals']=[_0x284f9d['interval']];}else{_0x284f9d[_0xa9f7('0x31')]=_0x284f9d['IntervalId']?_[_0xa9f7('0x32')](_[_0xa9f7('0x33')](_0x3563a1,{'IntervalId':_0x284f9d[_0xa9f7('0x2d')]}),_0xa9f7('0x2c')):[];}_0x284f9d['context']=_0x2d86f3[_0xa9f7('0x9')];_0x284f9d['exten']=_0x2d86f3[_0xa9f7('0xf')];if(_0x284f9d[_0xa9f7('0x4')])_0x284f9d[_0xa9f7('0x4')]=_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')]();if(_0x2d86f3[_0xa9f7('0x4')]===_0xa9f7('0x10')){if(_0x284f9d[_0xa9f7('0x35')](_0xa9f7('0x36'))&&_0x284f9d['tag']&&_0x284f9d[_0xa9f7('0x36')]!=='--'){_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')]['toLowerCase'](),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x37')+_0x284f9d[_0xa9f7('0x36')],'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0x38'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x284f9d[_0xa9f7('0x39')]?_0xa9f7('0x3a')+_0x284f9d[_0xa9f7('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}else{if(_0x284f9d[_0xa9f7('0x35')](_0xa9f7('0x3b'))){if([_0xa9f7('0x3c'),'playback'][_0xa9f7('0x3d')](_0x284f9d[_0xa9f7('0x3e')][_0xa9f7('0x34')]())&&_0x284f9d[_0xa9f7('0x3f')]!=='custom'){if(_0x284f9d['answer']){_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')]['toLowerCase'](),'app':_0xa9f7('0x38'),'appdata':_0xa9f7('0x40'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});_0x4ea565['push']({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x41'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d['intervals']['length']+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}else{_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0x38'),'appdata':_0xa9f7('0x42'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d['intervals'][_0xa9f7('0x2f')]+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});_0x4ea565[_0xa9f7('0xb')]({'type':_0x284f9d[_0xa9f7('0x4')][_0xa9f7('0x34')](),'app':_0xa9f7('0xc'),'appdata':_0xa9f7('0x43'),'context':_0x2d86f3[_0xa9f7('0x9')],'exten':_0x2d86f3[_0xa9f7('0xf')],'priority':_0x284f9d[_0xa9f7('0x31')]['length']+_0x2c7912+_0x26a61d++,'VoiceExtensionId':_0x2d86f3['id']});}}}}for(var _0x123201=0x0;_0x123201<_0x284f9d['intervals'][_0xa9f7('0x2f')];_0x123201++){var _0x504af9=_0x2c7912+_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')];var _0x66c433=_0x123201===_0x284f9d[_0xa9f7('0x31')][_0xa9f7('0x2f')]-0x1?_0x2c7912+_0x4ea565['length']+_0x28eb60[_0xa9f7('0x2f')]+0x2:_0x2c7912+_0x123201+0x1;_0x4ea565[_0xa9f7('0x44')](_0x123201,0x0,{'type':_0x2d86f3[_0xa9f7('0x4')],'app':'GotoIfTime','appdata':_0x284f9d[_0xa9f7('0x31')][_0x123201]+'?'+_0x2d86f3['context']+_0xa9f7('0x45')+_0x504af9+':'+_0x2d86f3[_0xa9f7('0x9')]+_0xa9f7('0x45')+_0x66c433,'exten':_0x2d86f3['exten'],'context':_0x2d86f3[_0xa9f7('0x9')],'priority':_0x2c7912+_0x123201,'VoiceExtensionId':_0x2d86f3['id']});}if(_0x284f9d[_0xa9f7('0x3f')]===_0xa9f7('0x46'))_0x284f9d['appdata']=_0x58f401(_0x2d86f3,_0x284f9d['appdata']);_0x284f9d['priority']=_0x4ea565[_0xa9f7('0x2f')]?_[_0xa9f7('0x47')](_0x4ea565)[_0xa9f7('0x48')]+0x1:_0x2c7912;_0x108c60=_['concat'](_0x108c60,_0x4ea565,[_0x284f9d],_0x28eb60);_0x2c7912=_[_0xa9f7('0x47')](_0x108c60)[_0xa9f7('0x48')]+0x1;}return _0x2bfaa2(_0x108c60);})[_0xa9f7('0x49')](function(_0x2fb930){_0x440880(_0x2fb930);});});}return _0x23e78b[_0xa9f7('0x4a')](_0xa9f7('0x4b'),attributes,{'tableName':_0xa9f7('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x228212){var _0x416954=this['get']({'plain':!![]});var _0x176640=_0x416954[_0xa9f7('0x4')]===_0xa9f7('0x10')?_0x2aeadd(_0x416954):_0x4c0346(_0x416954);return _0x1706ea(_0x416954,_0x228212,_[_0xa9f7('0x47')](_0x176640)[_0xa9f7('0x48')]+0x1)['then'](function(_0x4d1097){var _0x11cb60=_[_0xa9f7('0x4d')](_0x176640,_0x4d1097);_0x11cb60[_0xa9f7('0xb')]({'type':_0x416954[_0xa9f7('0x4')],'app':_0xa9f7('0x4e'),'exten':_0x416954[_0xa9f7('0xf')],'context':_0x416954[_0xa9f7('0x9')],'priority':_[_0xa9f7('0x47')](_0x11cb60)[_0xa9f7('0x48')]+0x1,'VoiceExtensionId':_0x416954['id']});return _0x11cb60;});}}});};
\ No newline at end of file
+var _0xb51e=['wav','timeout','url','split','trunk','param','prefix','phone','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','interval','IntervalId','then','length','*,*,*,*','intervals','map','filter','hasOwnProperty','tag','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','alias','NoOp','No\x20alias\x20set','inbound','push','exten','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x24a45c,_0x14338e){var _0x4746a5=function(_0x2d070c){while(--_0x2d070c){_0x24a45c['push'](_0x24a45c['shift']());}};_0x4746a5(++_0x14338e);}(_0xb51e,0x12f));var _0xeb51=function(_0x448375,_0x50636f){_0x448375=_0x448375-0x0;var _0x3962e6=_0xb51e[_0x448375];return _0x3962e6;};'use strict';var _=require(_0xeb51('0x0'));var attributes=require(_0xeb51('0x1'));module['exports']=function(_0x4e844b){var _0x11110e=_0x4e844b[_0xeb51('0x2')];function _0x41170d(_0x3a5503){var _0x29c8be=0x2;var _0x299960=[{'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0x5')+_0x3a5503['type'],'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503['exten'],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']},{'type':_0x3a5503[_0xeb51('0x3')],'app':_0x3a5503[_0xeb51('0x7')]?_0xeb51('0x4'):_0xeb51('0x8'),'appdata':_0x3a5503[_0xeb51('0x7')]?'CDR(routeAlias)='+_0x3a5503[_0xeb51('0x7')]:_0xeb51('0x9'),'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503['exten'],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']}];if(_0x3a5503[_0xeb51('0x3')]===_0xeb51('0xa')){_0x299960[_0xeb51('0xb')]({'type':_0xeb51('0xa'),'app':_0xeb51('0x4'),'appdata':'CDR(routeid)='+_0x3a5503['id'],'context':_0x3a5503['context'],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']});}_0x299960[_0xeb51('0xb')]({'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0xd'),'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']},{'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0xe'),'context':_0x3a5503['context'],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']},{'type':_0x3a5503[_0xeb51('0x3')],'app':_0xeb51('0x4'),'appdata':_0xeb51('0xf'),'context':_0x3a5503[_0xeb51('0x6')],'exten':_0x3a5503[_0xeb51('0xc')],'priority':_0x29c8be++,'VoiceExtensionId':_0x3a5503['id']});return _0x299960;}function _0xa19fea(_0x2f09a8){var _0x412a9e=0x2;var _0x50948f=[{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x11'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':'outbound','app':_0x2f09a8['alias']?'Set':_0xeb51('0x8'),'appdata':_0x2f09a8[_0xeb51('0x7')]?_0xeb51('0x12')+_0x2f09a8[_0xeb51('0x7')]:_0xeb51('0x9'),'context':_0x2f09a8['context'],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x13')+(_0x2f09a8[_0xeb51('0x14')]?_0xeb51('0x15')+_0x2f09a8[_0xeb51('0x14')]+'}':_0xeb51('0x16')),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':'Set','appdata':_0xeb51('0x17')+_0x2f09a8['id'],'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8['exten'],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x18'),'appdata':_0xeb51('0x19')+(_0x412a9e+0x2)+_0xeb51('0x1a')+(_0x412a9e+0x1)+')','context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0x2f09a8[_0xeb51('0x14')]?'CDR(prefix)=${EXTEN:0:'+_0x2f09a8[_0xeb51('0x14')]+'}':_0xeb51('0x1b'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0xd'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0xf'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x1c')+_0x2f09a8['id'],'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']}];if(_0x2f09a8['hasOwnProperty'](_0xeb51('0x1d'))&&_0x2f09a8[_0xeb51('0x1d')]!==_0xeb51('0x1e')){_0x50948f['push']({'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x1f'),'context':_0x2f09a8['context'],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']},{'type':_0xeb51('0x10'),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x20')+_0x2f09a8[_0xeb51('0x1d')]||_0xeb51('0x21'),'context':_0x2f09a8[_0xeb51('0x6')],'exten':_0x2f09a8[_0xeb51('0xc')],'priority':_0x412a9e++,'VoiceExtensionId':_0x2f09a8['id']});}return _0x50948f;}function _0x57afff(_0x9531a3,_0x17b2bc){var _0x576778=[{'name':'trunk','param':0x0},{'name':_0xeb51('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':_0xeb51('0x23'),'param':0x3}];var _0x865ee5={};var _0x1a72fc=_0x17b2bc[_0xeb51('0x24')](',');var _0x295e93=[];for(var _0x8a1489=0x0;_0x8a1489<_0x576778['length'];_0x8a1489++){switch(_0x576778[_0x8a1489]['name']){case _0xeb51('0x25'):_0x865ee5[_0xeb51('0x25')]=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]]['split']('/')[0x1];_0x865ee5['phone']=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]][_0xeb51('0x24')]('/')[0x2];_0x865ee5[_0xeb51('0x27')]=_0x865ee5[_0xeb51('0x28')]?_0x865ee5[_0xeb51('0x28')][_0xeb51('0x24')]('$')[0x0]:undefined;_0x865ee5[_0xeb51('0x28')]=_0x9531a3[_0xeb51('0x14')]?(_0x865ee5[_0xeb51('0x27')]||'')+_0xeb51('0x15')+_0x9531a3['cutdigits']+'}':(_0x865ee5[_0xeb51('0x27')]||'')+'${EXTEN}';_0x295e93[_0x576778[_0x8a1489][_0xeb51('0x26')]]=[_0xeb51('0x29'),_0x865ee5[_0xeb51('0x25')],_0x865ee5[_0xeb51('0x28')]][_0xeb51('0x2a')]('/');break;case _0xeb51('0x2b'):_0x865ee5['options']=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]];if(_0x9531a3['recordingFormat']!==_0xeb51('0x1e')){if(_0x865ee5[_0xeb51('0x2b')][_0xeb51('0x2c')](_0xeb51('0x2d'))<0x0){_0x865ee5[_0xeb51('0x2b')]+=_0xeb51('0x2d');}}else{_0x865ee5['options']=_0x865ee5[_0xeb51('0x2b')][_0xeb51('0x2e')](_0xeb51('0x2d'),'');}_0x295e93[_0x576778[_0x8a1489][_0xeb51('0x26')]]=_0x865ee5[_0xeb51('0x2b')];break;default:_0x295e93[_0x576778[_0x8a1489]['param']]=_0x1a72fc[_0x576778[_0x8a1489][_0xeb51('0x26')]];}}return _0x295e93[_0xeb51('0x2a')](',');}function _0x3aac13(_0x5153eb,_0x26469d,_0x2be2be){return new Promise(function(_0x157648,_0x5ac168){var _0x2084ed=[];if(_['isEmpty'](_0x26469d))return _0x157648(_0x2084ed);_0x11110e[_0xeb51('0x2f')]['findAll']({'attributes':['id',_0xeb51('0x30'),_0xeb51('0x31')],'raw':!![]})[_0xeb51('0x32')](function(_0x3eb9be){for(var _0x285493=0x0,_0x2449b5=0x0;_0x285493<_0x26469d[_0xeb51('0x33')];_0x285493++,_0x2449b5=0x0){var _0x1950eb=_0x26469d[_0x285493];var _0xf2da20=[];var _0x153055=[];delete _0x1950eb['id'];if(_0x1950eb['interval']!==_0xeb51('0x34')){_0x1950eb[_0xeb51('0x35')]=[_0x1950eb[_0xeb51('0x30')]];}else{_0x1950eb[_0xeb51('0x35')]=_0x1950eb['IntervalId']?_[_0xeb51('0x36')](_[_0xeb51('0x37')](_0x3eb9be,{'IntervalId':_0x1950eb[_0xeb51('0x31')]}),_0xeb51('0x30')):[];}_0x1950eb[_0xeb51('0x6')]=_0x5153eb[_0xeb51('0x6')];_0x1950eb['exten']=_0x5153eb[_0xeb51('0xc')];if(_0x1950eb[_0xeb51('0x3')])_0x1950eb[_0xeb51('0x3')]=_0x1950eb[_0xeb51('0x3')]['toLowerCase']();if(_0x5153eb[_0xeb51('0x3')]===_0xeb51('0x10')){if(_0x1950eb[_0xeb51('0x38')]('tag')&&_0x1950eb[_0xeb51('0x39')]&&_0x1950eb[_0xeb51('0x39')]!=='--'){_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb[_0xeb51('0x3')][_0xeb51('0x3a')](),'app':_0xeb51('0x4'),'appdata':_0xeb51('0x3b')+_0x1950eb['tag'],'context':_0x5153eb['context'],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb['intervals']['length']+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb['type'][_0xeb51('0x3a')](),'app':_0xeb51('0x18'),'appdata':_0xeb51('0x3c')+(_0x1950eb[_0xeb51('0x3d')]?'Set(CALLERID(all)='+_0x1950eb[_0xeb51('0x3d')]+')':_0xeb51('0x3e')),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb['intervals'][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}else{if(_0x1950eb[_0xeb51('0x38')]('answer')){if(['queue',_0xeb51('0x3f')][_0xeb51('0x40')](_0x1950eb[_0xeb51('0x41')][_0xeb51('0x3a')]())&&_0x1950eb['appType']!==_0xeb51('0x42')){if(_0x1950eb['answer']){_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb[_0xeb51('0x3')]['toLowerCase'](),'app':_0xeb51('0x18'),'appdata':_0xeb51('0x43'),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb['type']['toLowerCase'](),'app':_0xeb51('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}else{_0xf2da20[_0xeb51('0xb')]({'type':_0x1950eb[_0xeb51('0x3')][_0xeb51('0x3a')](),'app':'ExecIf','appdata':_0xeb51('0x44'),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')]+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});_0xf2da20['push']({'type':_0x1950eb[_0xeb51('0x3')][_0xeb51('0x3a')](),'app':'Set','appdata':_0xeb51('0x45'),'context':_0x5153eb[_0xeb51('0x6')],'exten':_0x5153eb[_0xeb51('0xc')],'priority':_0x1950eb['intervals']['length']+_0x2be2be+_0x2449b5++,'VoiceExtensionId':_0x5153eb['id']});}}}}for(var _0x1f3c9b=0x0;_0x1f3c9b<_0x1950eb['intervals'][_0xeb51('0x33')];_0x1f3c9b++){var _0x42e106=_0x2be2be+_0x1950eb[_0xeb51('0x35')][_0xeb51('0x33')];var _0x4bb88a=_0x1f3c9b===_0x1950eb[_0xeb51('0x35')]['length']-0x1?_0x2be2be+_0xf2da20[_0xeb51('0x33')]+_0x153055['length']+0x2:_0x2be2be+_0x1f3c9b+0x1;_0xf2da20[_0xeb51('0x46')](_0x1f3c9b,0x0,{'type':_0x5153eb[_0xeb51('0x3')],'app':'GotoIfTime','appdata':_0x1950eb[_0xeb51('0x35')][_0x1f3c9b]+'?'+_0x5153eb[_0xeb51('0x6')]+_0xeb51('0x47')+_0x42e106+':'+_0x5153eb[_0xeb51('0x6')]+',${EXTEN},'+_0x4bb88a,'exten':_0x5153eb[_0xeb51('0xc')],'context':_0x5153eb[_0xeb51('0x6')],'priority':_0x2be2be+_0x1f3c9b,'VoiceExtensionId':_0x5153eb['id']});}if(_0x1950eb[_0xeb51('0x48')]===_0xeb51('0x49'))_0x1950eb[_0xeb51('0x4a')]=_0x57afff(_0x5153eb,_0x1950eb['appdata']);_0x1950eb[_0xeb51('0x4b')]=_0xf2da20[_0xeb51('0x33')]?_[_0xeb51('0x4c')](_0xf2da20)['priority']+0x1:_0x2be2be;_0x2084ed=_[_0xeb51('0x4d')](_0x2084ed,_0xf2da20,[_0x1950eb],_0x153055);_0x2be2be=_[_0xeb51('0x4c')](_0x2084ed)['priority']+0x1;}return _0x157648(_0x2084ed);})[_0xeb51('0x4e')](function(_0x39301a){_0x5ac168(_0x39301a);});});}return _0x4e844b[_0xeb51('0x4f')](_0xeb51('0x50'),attributes,{'tableName':_0xeb51('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3a4768){var _0x251df1=this[_0xeb51('0x52')]({'plain':!![]});var _0x5f1c8d=_0x251df1['type']===_0xeb51('0x10')?_0xa19fea(_0x251df1):_0x41170d(_0x251df1);return _0x3aac13(_0x251df1,_0x3a4768,_[_0xeb51('0x4c')](_0x5f1c8d)[_0xeb51('0x4b')]+0x1)['then'](function(_0x176366){var _0x4a8208=_[_0xeb51('0x4d')](_0x5f1c8d,_0x176366);_0x4a8208[_0xeb51('0xb')]({'type':_0x251df1[_0xeb51('0x3')],'app':_0xeb51('0x53'),'exten':_0x251df1[_0xeb51('0xc')],'context':_0x251df1[_0xeb51('0x6')],'priority':_[_0xeb51('0x4c')](_0x4a8208)['priority']+0x1,'VoiceExtensionId':_0x251df1['id']});return _0x4a8208;});}}});};
\ No newline at end of file
index c137f41..3302e5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99fb=['map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis','./voiceExtension.socket','request','then','info','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceExtension,\x20%s,\x20%s','result','message','catch','GetVoiceExtension','options','raw','where','attributes','include'];(function(_0x45096c,_0x3d97b0){var _0x42e2ad=function(_0x2373e8){while(--_0x2373e8){_0x45096c['push'](_0x45096c['shift']());}};_0x42e2ad(++_0x3d97b0);}(_0x99fb,0x92));var _0xb99f=function(_0x65d0d3,_0x126ca3){_0x65d0d3=_0x65d0d3-0x0;var _0x107487=_0x99fb[_0x65d0d3];return _0x107487;};'use strict';var _=require(_0xb99f('0x0'));var util=require('util');var moment=require(_0xb99f('0x1'));var BPromise=require(_0xb99f('0x2'));var rs=require(_0xb99f('0x3'));var fs=require('fs');var Redis=require(_0xb99f('0x4'));var db=require(_0xb99f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb99f('0x6'))(_0xb99f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb99f('0x8'));var client=jayson[_0xb99f('0x9')][_0xb99f('0xa')]({'port':0x232a});config['redis']=_[_0xb99f('0xb')](config['redis'],{'host':_0xb99f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb99f('0xd')]));require(_0xb99f('0xe'))['register'](socket);function respondWithRpcPromise(_0x29d5de,_0x18e0b1,_0x21848d){return new BPromise(function(_0x2dd1b4,_0x2cc8c4){return client[_0xb99f('0xf')](_0x29d5de,_0x21848d)[_0xb99f('0x10')](function(_0x562214){logger[_0xb99f('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x18e0b1,'request\x20sent');logger[_0xb99f('0x12')](_0xb99f('0x13'),_0x18e0b1,_0xb99f('0x14'),JSON[_0xb99f('0x15')](_0x562214));if(_0x562214[_0xb99f('0x16')]){if(_0x562214['error'][_0xb99f('0x17')]===0x1f4){logger['error'](_0xb99f('0x18'),_0x18e0b1,_0x562214[_0xb99f('0x16')]['message']);return _0x2cc8c4(_0x562214[_0xb99f('0x16')]['message']);}logger[_0xb99f('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x18e0b1,_0x562214[_0xb99f('0x16')]['message']);return _0x2dd1b4(_0x562214[_0xb99f('0x16')]['message']);}else{logger[_0xb99f('0x11')](_0xb99f('0x18'),_0x18e0b1,_0xb99f('0x14'));_0x2dd1b4(_0x562214[_0xb99f('0x19')][_0xb99f('0x1a')]);}})[_0xb99f('0x1b')](function(_0x118b54){logger[_0xb99f('0x16')](_0xb99f('0x18'),_0x18e0b1,_0x118b54);_0x2cc8c4(_0x118b54);});});}exports[_0xb99f('0x1c')]=function(_0x46a283){var _0x33627f=this;return new Promise(function(_0xe04602,_0x3273f6){return db['VoiceExtension']['findAll']({'raw':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x1e')]===undefined?!![]:![]:!![],'where':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x1f')]||null:null,'attributes':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x20')]||null:null,'limit':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')]['limit']||null:null,'include':_0x46a283[_0xb99f('0x1d')]?_0x46a283[_0xb99f('0x1d')][_0xb99f('0x21')]?_[_0xb99f('0x22')](_0x46a283['options']['include'],function(_0x5c2b1a){return{'model':db[_0x5c2b1a[_0xb99f('0x23')]],'as':_0x5c2b1a['as'],'attributes':_0x5c2b1a['attributes'],'include':_0x5c2b1a[_0xb99f('0x21')]?_[_0xb99f('0x22')](_0x5c2b1a[_0xb99f('0x21')],function(_0x3c4f27){return{'model':db[_0x3c4f27[_0xb99f('0x23')]],'as':_0x3c4f27['as'],'attributes':_0x3c4f27[_0xb99f('0x20')],'include':_0x3c4f27[_0xb99f('0x21')]?_[_0xb99f('0x22')](_0x3c4f27['include'],function(_0x342cb0){return{'model':db[_0x342cb0['model']],'as':_0x342cb0['as'],'attributes':_0x342cb0[_0xb99f('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb99f('0x10')](function(_0x29c96c){logger[_0xb99f('0x11')](_0xb99f('0x1c'),_0x46a283);logger[_0xb99f('0x12')](_0xb99f('0x1c'),_0x46a283,JSON[_0xb99f('0x15')](_0x29c96c));_0xe04602(_0x29c96c);})['catch'](function(_0x4d447b){logger[_0xb99f('0x16')](_0xb99f('0x1c'),_0x4d447b[_0xb99f('0x1a')],_0x46a283);_0x3273f6(_0x33627f[_0xb99f('0x16')](0x1f4,_0x4d447b['message']));});});};
\ No newline at end of file
+var _0x1224=['request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1224,0x10d));var _0x4122=function(_0x4ead23,_0x537fec){_0x4ead23=_0x4ead23-0x0;var _0x36bcae=_0x1224[_0x4ead23];return _0x36bcae;};'use strict';var _=require(_0x4122('0x0'));var util=require(_0x4122('0x1'));var moment=require(_0x4122('0x2'));var BPromise=require(_0x4122('0x3'));var rs=require(_0x4122('0x4'));var fs=require('fs');var Redis=require(_0x4122('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4122('0x6'));var logger=require(_0x4122('0x7'))(_0x4122('0x8'));var config=require('../../config/environment');var jayson=require(_0x4122('0x9'));var client=jayson[_0x4122('0xa')][_0x4122('0xb')]({'port':0x232a});config[_0x4122('0xc')]=_[_0x4122('0xd')](config[_0x4122('0xc')],{'host':_0x4122('0xe'),'port':0x18eb});var socket=require(_0x4122('0xf'))(new Redis(config[_0x4122('0xc')]));require(_0x4122('0x10'))[_0x4122('0x11')](socket);function respondWithRpcPromise(_0x4779e2,_0x251ade,_0x35160c){return new BPromise(function(_0x1d229f,_0x201538){return client[_0x4122('0x12')](_0x4779e2,_0x35160c)[_0x4122('0x13')](function(_0x476ed2){logger[_0x4122('0x14')](_0x4122('0x15'),_0x251ade,_0x4122('0x16'));logger[_0x4122('0x17')](_0x4122('0x18'),_0x251ade,_0x4122('0x16'),JSON[_0x4122('0x19')](_0x476ed2));if(_0x476ed2[_0x4122('0x1a')]){if(_0x476ed2[_0x4122('0x1a')][_0x4122('0x1b')]===0x1f4){logger[_0x4122('0x1a')](_0x4122('0x15'),_0x251ade,_0x476ed2['error'][_0x4122('0x1c')]);return _0x201538(_0x476ed2[_0x4122('0x1a')][_0x4122('0x1c')]);}logger[_0x4122('0x1a')]('VoiceExtension,\x20%s,\x20%s',_0x251ade,_0x476ed2[_0x4122('0x1a')][_0x4122('0x1c')]);return _0x1d229f(_0x476ed2['error'][_0x4122('0x1c')]);}else{logger[_0x4122('0x14')](_0x4122('0x15'),_0x251ade,_0x4122('0x16'));_0x1d229f(_0x476ed2[_0x4122('0x1d')][_0x4122('0x1c')]);}})[_0x4122('0x1e')](function(_0x5a4fe6){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x251ade,_0x5a4fe6);_0x201538(_0x5a4fe6);});});}exports[_0x4122('0x1f')]=function(_0x2d95e8){var _0x23033a=this;return new Promise(function(_0x1dde85,_0xef6995){return db[_0x4122('0x20')][_0x4122('0x21')]({'raw':_0x2d95e8[_0x4122('0x22')]?_0x2d95e8['options'][_0x4122('0x23')]===undefined?!![]:![]:!![],'where':_0x2d95e8['options']?_0x2d95e8['options']['where']||null:null,'attributes':_0x2d95e8[_0x4122('0x22')]?_0x2d95e8[_0x4122('0x22')][_0x4122('0x24')]||null:null,'limit':_0x2d95e8['options']?_0x2d95e8[_0x4122('0x22')][_0x4122('0x25')]||null:null,'include':_0x2d95e8['options']?_0x2d95e8['options'][_0x4122('0x26')]?_['map'](_0x2d95e8['options']['include'],function(_0x1b449b){return{'model':db[_0x1b449b[_0x4122('0x27')]],'as':_0x1b449b['as'],'attributes':_0x1b449b[_0x4122('0x24')],'include':_0x1b449b[_0x4122('0x26')]?_[_0x4122('0x28')](_0x1b449b[_0x4122('0x26')],function(_0x26768b){return{'model':db[_0x26768b[_0x4122('0x27')]],'as':_0x26768b['as'],'attributes':_0x26768b[_0x4122('0x24')],'include':_0x26768b[_0x4122('0x26')]?_[_0x4122('0x28')](_0x26768b[_0x4122('0x26')],function(_0xfefaf6){return{'model':db[_0xfefaf6['model']],'as':_0xfefaf6['as'],'attributes':_0xfefaf6[_0x4122('0x24')]};}):[]};}):[]};}):[]:[]})[_0x4122('0x13')](function(_0x79c85){logger[_0x4122('0x14')]('GetVoiceExtension',_0x2d95e8);logger[_0x4122('0x17')]('GetVoiceExtension',_0x2d95e8,JSON[_0x4122('0x19')](_0x79c85));_0x1dde85(_0x79c85);})[_0x4122('0x1e')](function(_0x3a9633){logger[_0x4122('0x1a')](_0x4122('0x1f'),_0x3a9633[_0x4122('0x1c')],_0x2d95e8);_0xef6995(_0x23033a[_0x4122('0x1a')](0x1f4,_0x3a9633[_0x4122('0x1c')]));});});};
\ No newline at end of file
index 66419c0..b56239f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['save','remove','emit','removeListener','register','voiceExtension:','./voiceExtension.events'];(function(_0x376c8c,_0x5ee8a2){var _0x1d30b1=function(_0x37d968){while(--_0x37d968){_0x376c8c['push'](_0x376c8c['shift']());}};_0x1d30b1(++_0x5ee8a2);}(_0xf494,0x1c6));var _0x4f49=function(_0x3d0e4f,_0xf1beac){_0x3d0e4f=_0x3d0e4f-0x0;var _0x8d2638=_0xf494[_0x3d0e4f];return _0x8d2638;};'use strict';var VoiceExtensionEvents=require(_0x4f49('0x0'));var events=[_0x4f49('0x1'),_0x4f49('0x2'),'update'];function createListener(_0x3aeeb8,_0x1d54cc){return function(_0x423b25){_0x1d54cc[_0x4f49('0x3')](_0x3aeeb8,_0x423b25);};}function removeListener(_0x20c0d7,_0x2a15fb){return function(){VoiceExtensionEvents[_0x4f49('0x4')](_0x20c0d7,_0x2a15fb);};}exports[_0x4f49('0x5')]=function(_0xc5e778){for(var _0x413530=0x0,_0x42b0e8=events['length'];_0x413530<_0x42b0e8;_0x413530++){var _0x58e9a0=events[_0x413530];var _0x169c95=createListener(_0x4f49('0x6')+_0x58e9a0,_0xc5e778);VoiceExtensionEvents['on'](_0x58e9a0,_0x169c95);}};
\ No newline at end of file
+var _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0xdddfad,_0x10ae21){var _0x1d5c15=function(_0x3db485){while(--_0x3db485){_0xdddfad['push'](_0xdddfad['shift']());}};_0x1d5c15(++_0x10ae21);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xc4aa[_0x4d613c];return _0x301fe3;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}};
\ No newline at end of file
index fde53fe..ea4883f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x533d5c,_0x3f6b7d){var _0x30d8ec=function(_0x361af2){while(--_0x361af2){_0x533d5c['push'](_0x533d5c['shift']());}};_0x30d8ec(++_0x3f6b7d);}(_0xeda8,0x104));var _0x8eda=function(_0x3fae2c,_0x5f05ba){_0x3fae2c=_0x3fae2c-0x0;var _0x293ca4=_0xeda8[_0x3fae2c];return _0x293ca4;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router;
\ No newline at end of file
+var _0x3e24=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','create','destroy','exports','multer'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0x3e24,0x167));var _0x43e2=function(_0x425b10,_0xe4cbbe){_0x425b10=_0x425b10-0x0;var _0x1eecfe=_0x3e24[_0x425b10];return _0x1eecfe;};'use strict';var multer=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var path=require(_0x43e2('0x2'));var timeout=require(_0x43e2('0x3'));var express=require(_0x43e2('0x4'));var router=express['Router']();var fs_extra=require(_0x43e2('0x5'));var auth=require(_0x43e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x43e2('0x7'));var controller=require(_0x43e2('0x8'));router[_0x43e2('0x9')]('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xb')]);router[_0x43e2('0x9')](_0x43e2('0xc'),auth['isAuthenticated'](),controller[_0x43e2('0xd')]);router[_0x43e2('0x9')]('/:id/messages',auth[_0x43e2('0xa')](),controller[_0x43e2('0xe')]);router['post']('/',auth[_0x43e2('0xa')](),controller[_0x43e2('0xf')]);router['put'](_0x43e2('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x43e2('0xc'),auth[_0x43e2('0xa')](),controller[_0x43e2('0x10')]);module[_0x43e2('0x11')]=router;
\ No newline at end of file
index 2dbd53c..361b184 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1281=['email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue'];(function(_0xce6f11,_0x3c3137){var _0x35b709=function(_0x1755c6){while(--_0x1755c6){_0xce6f11['push'](_0xce6f11['shift']());}};_0x35b709(++_0x3c3137);}(_0x1281,0x11b));var _0x1128=function(_0x1a691a,_0x349066){_0x1a691a=_0x1a691a-0x0;var _0x539f77=_0x1281[_0x1a691a];return _0x539f77;};'use strict';var Sequelize=require('sequelize');module[_0x1128('0x0')]={'customer_id':{'type':Sequelize[_0x1128('0x1')]},'context':{'type':Sequelize[_0x1128('0x1')],'defaultValue':_0x1128('0x2'),'unique':_0x1128('0x3')},'mailbox':{'type':Sequelize[_0x1128('0x1')],'defaultValue':'','allowNull':![],'unique':_0x1128('0x3')},'password':{'type':Sequelize[_0x1128('0x1')]},'fullname':{'type':Sequelize[_0x1128('0x1')]},'email':{'type':Sequelize[_0x1128('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4af57b){this[_0x1128('0x4')](_0x1128('0x5'),typeof _0x4af57b==='string'&&_0x4af57b['trim']()?_0x4af57b[_0x1128('0x6')]():null);}},'pager':{'type':Sequelize[_0x1128('0x1')]},'tz':{'type':Sequelize[_0x1128('0x1')],'defaultValue':_0x1128('0x7')},'attach':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':_0x1128('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1128('0x1')]},'callback':{'type':Sequelize[_0x1128('0x1')]},'review':{'type':Sequelize['ENUM'](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x1128('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1128('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x1128('0x8')](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x1128('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1128('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x1128('0xb')},'emailsubject':{'type':Sequelize[_0x1128('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x1128('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1128('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1128('0xd')],'get':function(){return this[_0x1128('0xe')](_0x1128('0xf'))+_0x1128('0x10')+this[_0x1128('0xe')](_0x1128('0x11'));}}};
\ No newline at end of file
+var _0x1804=['getDataValue','fullname','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x56daff,_0xadca9a){var _0x132c82=function(_0x19e0d7){while(--_0x19e0d7){_0x56daff['push'](_0x56daff['shift']());}};_0x132c82(++_0xadca9a);}(_0x1804,0x1a2));var _0x4180=function(_0x441460,_0x1cb275){_0x441460=_0x441460-0x0;var _0x20e15b=_0x1804[_0x441460];return _0x20e15b;};'use strict';var Sequelize=require('sequelize');module[_0x4180('0x0')]={'customer_id':{'type':Sequelize[_0x4180('0x1')]},'context':{'type':Sequelize[_0x4180('0x1')],'defaultValue':_0x4180('0x2'),'unique':_0x4180('0x3')},'mailbox':{'type':Sequelize[_0x4180('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x4180('0x1')]},'fullname':{'type':Sequelize[_0x4180('0x1')]},'email':{'type':Sequelize[_0x4180('0x1')],'validate':{'isEmail':!![]},'set':function(_0x2ded3a){this[_0x4180('0x4')](_0x4180('0x5'),typeof _0x2ded3a===_0x4180('0x6')&&_0x2ded3a[_0x4180('0x7')]()?_0x2ded3a[_0x4180('0x7')]():null);}},'pager':{'type':Sequelize[_0x4180('0x1')]},'tz':{'type':Sequelize[_0x4180('0x1')],'defaultValue':_0x4180('0x8')},'attach':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4180('0x1')]},'callback':{'type':Sequelize[_0x4180('0x1')]},'review':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4180('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4180('0x9')](_0x4180('0xa'),'no'),'defaultValue':_0x4180('0xa'),'allowNull':![]},'stamp':{'type':_0x4180('0xc')},'emailsubject':{'type':Sequelize[_0x4180('0x1')]},'emailbody':{'type':Sequelize[_0x4180('0x1')]},'maxsecs':{'type':Sequelize[_0x4180('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4180('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4180('0xe')](_0x4180('0xf'))+'\x20-\x20'+this[_0x4180('0xe')]('mailbox');}}};
\ No newline at end of file
index 484a434..34906a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76dc=['desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','VoiceMail','fieldName','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','catch','show','params','intersection','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','rawAttributes','sort','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0x76dc,0x1f2));var _0xc76d=function(_0x427a39,_0x52d1fa){_0x427a39=_0x427a39-0x0;var _0x228119=_0x76dc[_0x427a39];return _0x228119;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){var _0x637d68=_0x11b42f[_0xc76d('0x26')]({'plain':!![]});var _0x55ca79=_0xc76d('0x27');return db[_0xc76d('0x28')][_0xc76d('0x25')]({'where':{'type':_0x55ca79,'resourceId':_0x637d68['id']}})[_0xc76d('0x24')](function(){return _0x11b42f;});})[_0xc76d('0x24')](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x59ebd1,_0x59dabf){return function(_0x285430){if(!_0x285430){_0x59ebd1[_0xc76d('0x17')](0x194);}return _0x285430;};}function handleError(_0x5069ea,_0x31501a){_0x31501a=_0x31501a||0x1f4;return function(_0x52a79a){logger[_0xc76d('0x29')](_0x52a79a['stack']);if(_0x52a79a[_0xc76d('0x2a')]){delete _0x52a79a['name'];}_0x5069ea[_0xc76d('0x18')](_0x31501a)[_0xc76d('0x2b')](_0x52a79a);};}exports['index']=function(_0x3d4076,_0x1c68f3){var _0x9ab96c={},_0x2cf501={},_0x4feeda={'count':0x0,'rows':[]};var _0x283e16=_['map'](db[_0xc76d('0x2c')]['rawAttributes'],function(_0x30769f){return{'name':_0x30769f[_0xc76d('0x2d')],'type':_0x30769f['type']['key']};});_0x2cf501['model']=_['map'](_0x283e16,_0xc76d('0x2a'));_0x2cf501[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x3d4076[_0xc76d('0x2e')]);_0x2cf501[_0xc76d('0x30')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],_0x2cf501['query']);_0x9ab96c[_0xc76d('0x32')]=_['intersection'](_0x2cf501[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x33')]));_0x9ab96c[_0xc76d('0x32')]=_0x9ab96c['attributes'][_0xc76d('0x34')]?_0x9ab96c[_0xc76d('0x32')]:_0x2cf501[_0xc76d('0x31')];if(!_0x3d4076['query'][_0xc76d('0x35')](_0xc76d('0x36'))){_0x9ab96c[_0xc76d('0x1d')]=qs['limit'](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1d')]);_0x9ab96c[_0xc76d('0x1c')]=qs[_0xc76d('0x1c')](_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x9ab96c['order']=qs['sort'](_0x3d4076[_0xc76d('0x2e')]['sort']);_0x9ab96c[_0xc76d('0x37')]=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x3d4076[_0xc76d('0x2e')],_0x2cf501['filters']),_0x283e16);if(_0x3d4076['query'][_0xc76d('0x39')]){_0x9ab96c[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x9ab96c[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x283e16,function(_0x58c724){if(_0x58c724[_0xc76d('0x3c')]!==_0xc76d('0x3d')){var _0x321989={};_0x321989[_0x58c724[_0xc76d('0x2a')]]={'$like':'%'+_0x3d4076[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x321989;}})});}_0x9ab96c=_[_0xc76d('0x3a')]({},_0x9ab96c,_0x3d4076[_0xc76d('0x3e')]);var _0x305f7d={'where':_0x9ab96c[_0xc76d('0x37')]};return db['VoiceMail']['count'](_0x305f7d)[_0xc76d('0x24')](function(_0x2a0759){_0x4feeda[_0xc76d('0x1b')]=_0x2a0759;if(_0x3d4076[_0xc76d('0x2e')]['includeAll']){_0x9ab96c['include']=[{'all':!![]}];}return db[_0xc76d('0x2c')][_0xc76d('0x3f')](_0x9ab96c);})[_0xc76d('0x24')](function(_0x15eb42){_0x4feeda[_0xc76d('0x40')]=_0x15eb42;return _0x4feeda;})[_0xc76d('0x24')](respondWithFilteredResult(_0x1c68f3,_0x9ab96c))[_0xc76d('0x41')](handleError(_0x1c68f3,null));};exports[_0xc76d('0x42')]=function(_0x50e922,_0x7bf0){var _0x95193f={'raw':!![],'where':{'id':_0x50e922[_0xc76d('0x43')]['id']}},_0x1bf8a0={};_0x1bf8a0['model']=_['keys'](db['VoiceMail']['rawAttributes']);_0x1bf8a0['query']=_['keys'](_0x50e922['query']);_0x1bf8a0[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],_0x1bf8a0[_0xc76d('0x2e')]);_0x95193f[_0xc76d('0x32')]=_[_0xc76d('0x44')](_0x1bf8a0[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x50e922['query'][_0xc76d('0x33')]));_0x95193f[_0xc76d('0x32')]=_0x95193f[_0xc76d('0x32')][_0xc76d('0x34')]?_0x95193f[_0xc76d('0x32')]:_0x1bf8a0[_0xc76d('0x31')];if(_0x50e922[_0xc76d('0x2e')][_0xc76d('0x45')]){_0x95193f[_0xc76d('0x46')]=[{'all':!![]}];}_0x95193f=_['merge']({},_0x95193f,_0x50e922['options']);return db[_0xc76d('0x2c')][_0xc76d('0x47')](_0x95193f)[_0xc76d('0x24')](handleEntityNotFound(_0x7bf0,null))[_0xc76d('0x24')](respondWithResult(_0x7bf0,null))[_0xc76d('0x41')](handleError(_0x7bf0,null));};exports['create']=function(_0x25fc9d,_0x1ede13){return db['VoiceMail']['create'](_0x25fc9d[_0xc76d('0x48')],{})[_0xc76d('0x24')](function(_0x48cad0){var _0xe44a25=_0x25fc9d[_0xc76d('0x49')][_0xc76d('0x26')]({'plain':!![]});if(!_0xe44a25)throw new Error(_0xc76d('0x4a'));if(_0xe44a25[_0xc76d('0x4b')]===_0xc76d('0x49')){var _0x25a549=_0x48cad0[_0xc76d('0x26')]({'plain':!![]});var _0x4452a8=_0xc76d('0x27');return db['UserProfileSection'][_0xc76d('0x47')]({'where':{'name':_0x4452a8,'userProfileId':_0xe44a25[_0xc76d('0x4c')]},'raw':!![]})[_0xc76d('0x24')](function(_0x55e3af){if(_0x55e3af&&_0x55e3af[_0xc76d('0x4d')]===0x0){return db[_0xc76d('0x28')]['create']({'name':_0x25a549[_0xc76d('0x2a')],'resourceId':_0x25a549['id'],'type':_0x55e3af['name'],'sectionId':_0x55e3af['id']},{})[_0xc76d('0x24')](function(){return _0x48cad0;});}else{return _0x48cad0;}})[_0xc76d('0x41')](function(_0x316978){logger[_0xc76d('0x29')](_0xc76d('0x4e'),_0x316978);throw _0x316978;});}return _0x48cad0;})['then'](respondWithResult(_0x1ede13,0xc9))['catch'](handleError(_0x1ede13,null));};exports['update']=function(_0x320483,_0x746759){if(_0x320483[_0xc76d('0x48')]['id']){delete _0x320483[_0xc76d('0x48')]['id'];}return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x320483['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x746759,null))[_0xc76d('0x24')](saveUpdates(_0x320483[_0xc76d('0x48')],null))[_0xc76d('0x24')](respondWithResult(_0x746759,null))[_0xc76d('0x41')](handleError(_0x746759,null));};exports['destroy']=function(_0x275dfd,_0x463cbe){return db[_0xc76d('0x2c')][_0xc76d('0x47')]({'where':{'id':_0x275dfd[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x463cbe,null))['then'](removeEntity(_0x463cbe,null))[_0xc76d('0x41')](handleError(_0x463cbe,null));};exports[_0xc76d('0x4f')]=function(_0x49105d,_0x5f3973,_0x1e9461){return db['VoiceMail'][_0xc76d('0x50')]({'where':{'id':_0x49105d[_0xc76d('0x43')]['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x5f3973,null))[_0xc76d('0x24')](function(_0x254128){var _0x4746a5;var _0x106c85={},_0x1db7bc={};_0x1db7bc[_0xc76d('0x31')]=_[_0xc76d('0x2f')](db[_0xc76d('0x51')][_0xc76d('0x52')]);_0x1db7bc[_0xc76d('0x2e')]=_[_0xc76d('0x2f')](_0x49105d['query']);_0x1db7bc[_0xc76d('0x30')]=_[_0xc76d('0x44')](_0x1db7bc[_0xc76d('0x31')],_0x1db7bc[_0xc76d('0x2e')]);_0x106c85[_0xc76d('0x32')]=_['intersection'](_0x1db7bc[_0xc76d('0x31')],qs[_0xc76d('0x33')](_0x49105d['query']['fields']));_0x106c85['attributes']=_0x106c85[_0xc76d('0x32')][_0xc76d('0x34')]?_0x106c85[_0xc76d('0x32')]:_0x1db7bc[_0xc76d('0x31')];if(!_0x49105d[_0xc76d('0x2e')][_0xc76d('0x35')](_0xc76d('0x36'))){_0x106c85[_0xc76d('0x1d')]=qs['limit'](_0x49105d[_0xc76d('0x2e')]['limit']);_0x106c85['offset']=qs[_0xc76d('0x1c')](_0x49105d[_0xc76d('0x2e')][_0xc76d('0x1c')]);}_0x106c85['order']=qs[_0xc76d('0x53')](_0x49105d['query']['sort']);_0x106c85['where']=qs[_0xc76d('0x30')](_[_0xc76d('0x38')](_0x49105d['query'],_0x1db7bc[_0xc76d('0x30')]));if(_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]){_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'$or':_[_0xc76d('0x3b')](_0x106c85['attributes'],function(_0x5035fd){var _0x4c523f={};_0x4c523f[_0x5035fd]={'$like':'%'+_0x49105d[_0xc76d('0x2e')][_0xc76d('0x39')]+'%'};return _0x4c523f;})});}_0x106c85[_0xc76d('0x37')]=_[_0xc76d('0x3a')](_0x106c85[_0xc76d('0x37')],{'mailboxuser':_0x254128['mailbox']});_0x106c85=_[_0xc76d('0x3a')]({},_0x106c85,_0x49105d[_0xc76d('0x3e')]);return db[_0xc76d('0x51')][_0xc76d('0x54')](_0x106c85)[_0xc76d('0x24')](respondWithFilteredResult(_0x5f3973,_0x106c85));})[_0xc76d('0x41')](handleError(_0x5f3973,null));};
\ No newline at end of file
+var _0x16d2=['sort','pick','filter','where','merge','options','findAll','rows','show','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','userProfileId','UserProfileResource','catch','update','destroy','params','getMessages','findOne','VoiceMailMessage','nolimit','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','get','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order'];(function(_0xc71093,_0x3f31e0){var _0x3ee32a=function(_0x433a2a){while(--_0x433a2a){_0xc71093['push'](_0xc71093['shift']());}};_0x3ee32a(++_0x3f31e0);}(_0x16d2,0x123));var _0x216d=function(_0x170b30,_0xfbeb58){_0x170b30=_0x170b30-0x0;var _0x49f408=_0x16d2[_0x170b30];return _0x49f408;};'use strict';var emlformat=require(_0x216d('0x0'));var rimraf=require(_0x216d('0x1'));var zipdir=require(_0x216d('0x2'));var jsonpatch=require(_0x216d('0x3'));var rp=require(_0x216d('0x4'));var moment=require(_0x216d('0x5'));var BPromise=require(_0x216d('0x6'));var Mustache=require(_0x216d('0x7'));var util=require(_0x216d('0x8'));var path=require('path');var sox=require(_0x216d('0x9'));var csv=require(_0x216d('0xa'));var ejs=require(_0x216d('0xb'));var fs=require('fs');var fs_extra=require(_0x216d('0xc'));var _=require(_0x216d('0xd'));var squel=require(_0x216d('0xe'));var crypto=require(_0x216d('0xf'));var jsforce=require(_0x216d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x216d('0xa'));var querystring=require(_0x216d('0x11'));var Papa=require(_0x216d('0x12'));var Redis=require(_0x216d('0x13'));var authService=require(_0x216d('0x14'));var qs=require(_0x216d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x216d('0x16'));var logger=require('../../config/logger')(_0x216d('0x17'));var utils=require(_0x216d('0x18'));var config=require(_0x216d('0x19'));var licenseUtil=require(_0x216d('0x1a'));var db=require(_0x216d('0x1b'))['db'];function respondWithStatusCode(_0x23ecf9,_0x4c92d9){_0x4c92d9=_0x4c92d9||0xcc;return function(_0xb36a43){if(_0xb36a43){return _0x23ecf9['sendStatus'](_0x4c92d9);}return _0x23ecf9[_0x216d('0x1c')](_0x4c92d9)[_0x216d('0x1d')]();};}function respondWithResult(_0x4dc2a2,_0x165c19){_0x165c19=_0x165c19||0xc8;return function(_0x322e4b){if(_0x322e4b){return _0x4dc2a2['status'](_0x165c19)[_0x216d('0x1e')](_0x322e4b);}};}function respondWithFilteredResult(_0x494e92,_0x448c0d){return function(_0xf571a4){if(_0xf571a4){var _0x4631b0=typeof _0x448c0d[_0x216d('0x1f')]===_0x216d('0x20')&&typeof _0x448c0d[_0x216d('0x21')]===_0x216d('0x20');var _0x1496fe=_0xf571a4[_0x216d('0x22')];var _0x53d464=_0x4631b0?0x0:_0x448c0d[_0x216d('0x1f')];var _0x5124ab=_0x4631b0?_0xf571a4['count']:_0x448c0d[_0x216d('0x1f')]+_0x448c0d[_0x216d('0x21')];var _0x574758;if(_0x5124ab>=_0x1496fe){_0x5124ab=_0x1496fe;_0x574758=0xc8;}else{_0x574758=0xce;}_0x494e92[_0x216d('0x1c')](_0x574758);return _0x494e92[_0x216d('0x23')]('Content-Range',_0x53d464+'-'+_0x5124ab+'/'+_0x1496fe)[_0x216d('0x1e')](_0xf571a4);}return null;};}function patchUpdates(_0x13b8e0){return function(_0x430e81){try{jsonpatch[_0x216d('0x24')](_0x430e81,_0x13b8e0,!![]);}catch(_0x5c3e03){return BPromise[_0x216d('0x25')](_0x5c3e03);}return _0x430e81[_0x216d('0x26')]();};}function saveUpdates(_0x10f299,_0x438981){return function(_0x206782){if(_0x206782){return _0x206782['update'](_0x10f299)[_0x216d('0x27')](function(_0x1bd4db){return _0x1bd4db;});}return null;};}function removeEntity(_0x188494,_0x2880c6){return function(_0x6fa4b3){if(_0x6fa4b3){return _0x6fa4b3['destroy']()[_0x216d('0x27')](function(){var _0xab672=_0x6fa4b3[_0x216d('0x28')]({'plain':!![]});var _0x5998a1='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5998a1,'resourceId':_0xab672['id']}})['then'](function(){return _0x6fa4b3;});})[_0x216d('0x27')](function(){_0x188494[_0x216d('0x1c')](0xcc)[_0x216d('0x1d')]();});}};}function handleEntityNotFound(_0x73b509,_0x46d0ef){return function(_0x47fa6d){if(!_0x47fa6d){_0x73b509['sendStatus'](0x194);}return _0x47fa6d;};}function handleError(_0xa7624a,_0x51b2bd){_0x51b2bd=_0x51b2bd||0x1f4;return function(_0x23d1c3){logger[_0x216d('0x29')](_0x23d1c3[_0x216d('0x2a')]);if(_0x23d1c3[_0x216d('0x2b')]){delete _0x23d1c3[_0x216d('0x2b')];}_0xa7624a[_0x216d('0x1c')](_0x51b2bd)[_0x216d('0x2c')](_0x23d1c3);};}exports[_0x216d('0x2d')]=function(_0x169cfa,_0x28f56a){var _0x11be90={},_0x260134={},_0x4537fd={'count':0x0,'rows':[]};var _0x483324=_[_0x216d('0x2e')](db[_0x216d('0x2f')][_0x216d('0x30')],function(_0x510ad9){return{'name':_0x510ad9[_0x216d('0x31')],'type':_0x510ad9[_0x216d('0x32')][_0x216d('0x33')]};});_0x260134[_0x216d('0x34')]=_['map'](_0x483324,_0x216d('0x2b'));_0x260134[_0x216d('0x35')]=_[_0x216d('0x36')](_0x169cfa[_0x216d('0x35')]);_0x260134[_0x216d('0x37')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],_0x260134[_0x216d('0x35')]);_0x11be90[_0x216d('0x39')]=_[_0x216d('0x38')](_0x260134[_0x216d('0x34')],qs['fields'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3a')]));_0x11be90[_0x216d('0x39')]=_0x11be90['attributes'][_0x216d('0x3b')]?_0x11be90[_0x216d('0x39')]:_0x260134['model'];if(!_0x169cfa[_0x216d('0x35')]['hasOwnProperty']('nolimit')){_0x11be90[_0x216d('0x21')]=qs[_0x216d('0x21')](_0x169cfa[_0x216d('0x35')][_0x216d('0x21')]);_0x11be90['offset']=qs['offset'](_0x169cfa['query'][_0x216d('0x1f')]);}_0x11be90[_0x216d('0x3c')]=qs['sort'](_0x169cfa[_0x216d('0x35')][_0x216d('0x3d')]);_0x11be90['where']=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x169cfa[_0x216d('0x35')],_0x260134[_0x216d('0x37')]),_0x483324);if(_0x169cfa[_0x216d('0x35')][_0x216d('0x3f')]){_0x11be90[_0x216d('0x40')]=_[_0x216d('0x41')](_0x11be90['where'],{'$or':_['map'](_0x483324,function(_0x281a88){if(_0x281a88[_0x216d('0x32')]!=='VIRTUAL'){var _0xf33f9c={};_0xf33f9c[_0x281a88[_0x216d('0x2b')]]={'$like':'%'+_0x169cfa[_0x216d('0x35')]['filter']+'%'};return _0xf33f9c;}})});}_0x11be90=_[_0x216d('0x41')]({},_0x11be90,_0x169cfa[_0x216d('0x42')]);var _0x13d787={'where':_0x11be90[_0x216d('0x40')]};return db['VoiceMail'][_0x216d('0x22')](_0x13d787)[_0x216d('0x27')](function(_0x5665d7){_0x4537fd[_0x216d('0x22')]=_0x5665d7;if(_0x169cfa[_0x216d('0x35')]['includeAll']){_0x11be90['include']=[{'all':!![]}];}return db[_0x216d('0x2f')][_0x216d('0x43')](_0x11be90);})[_0x216d('0x27')](function(_0x498efe){_0x4537fd[_0x216d('0x44')]=_0x498efe;return _0x4537fd;})['then'](respondWithFilteredResult(_0x28f56a,_0x11be90))['catch'](handleError(_0x28f56a,null));};exports[_0x216d('0x45')]=function(_0x43336e,_0xac81f){var _0x5ddaeb={'raw':!![],'where':{'id':_0x43336e['params']['id']}},_0xaccf45={};_0xaccf45[_0x216d('0x34')]=_[_0x216d('0x36')](db[_0x216d('0x2f')]['rawAttributes']);_0xaccf45[_0x216d('0x35')]=_[_0x216d('0x36')](_0x43336e[_0x216d('0x35')]);_0xaccf45[_0x216d('0x37')]=_['intersection'](_0xaccf45['model'],_0xaccf45['query']);_0x5ddaeb[_0x216d('0x39')]=_[_0x216d('0x38')](_0xaccf45[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x43336e[_0x216d('0x35')][_0x216d('0x3a')]));_0x5ddaeb[_0x216d('0x39')]=_0x5ddaeb[_0x216d('0x39')]['length']?_0x5ddaeb[_0x216d('0x39')]:_0xaccf45[_0x216d('0x34')];if(_0x43336e[_0x216d('0x35')][_0x216d('0x46')]){_0x5ddaeb['include']=[{'all':!![]}];}_0x5ddaeb=_[_0x216d('0x41')]({},_0x5ddaeb,_0x43336e['options']);return db[_0x216d('0x2f')][_0x216d('0x47')](_0x5ddaeb)[_0x216d('0x27')](handleEntityNotFound(_0xac81f,null))['then'](respondWithResult(_0xac81f,null))['catch'](handleError(_0xac81f,null));};exports[_0x216d('0x48')]=function(_0x32d499,_0x3932a3){return db[_0x216d('0x2f')][_0x216d('0x48')](_0x32d499[_0x216d('0x49')],{})['then'](function(_0x4f9274){var _0x26209c=_0x32d499['user'][_0x216d('0x28')]({'plain':!![]});if(!_0x26209c)throw new Error(_0x216d('0x4a'));if(_0x26209c['role']==='user'){var _0x5f37e3=_0x4f9274['get']({'plain':!![]});var _0x1ae9b7=_0x216d('0x4b');return db[_0x216d('0x4c')][_0x216d('0x47')]({'where':{'name':_0x1ae9b7,'userProfileId':_0x26209c[_0x216d('0x4d')]},'raw':!![]})[_0x216d('0x27')](function(_0x29efa8){if(_0x29efa8&&_0x29efa8['autoAssociation']===0x0){return db[_0x216d('0x4e')][_0x216d('0x48')]({'name':_0x5f37e3[_0x216d('0x2b')],'resourceId':_0x5f37e3['id'],'type':_0x29efa8['name'],'sectionId':_0x29efa8['id']},{})[_0x216d('0x27')](function(){return _0x4f9274;});}else{return _0x4f9274;}})[_0x216d('0x4f')](function(_0x2c7c67){logger[_0x216d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c7c67);throw _0x2c7c67;});}return _0x4f9274;})[_0x216d('0x27')](respondWithResult(_0x3932a3,0xc9))[_0x216d('0x4f')](handleError(_0x3932a3,null));};exports[_0x216d('0x50')]=function(_0x1a4761,_0x4d7705){if(_0x1a4761[_0x216d('0x49')]['id']){delete _0x1a4761[_0x216d('0x49')]['id'];}return db['VoiceMail'][_0x216d('0x47')]({'where':{'id':_0x1a4761['params']['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4d7705,null))[_0x216d('0x27')](saveUpdates(_0x1a4761[_0x216d('0x49')],null))[_0x216d('0x27')](respondWithResult(_0x4d7705,null))[_0x216d('0x4f')](handleError(_0x4d7705,null));};exports[_0x216d('0x51')]=function(_0x24297f,_0x2c6cb6){return db[_0x216d('0x2f')]['find']({'where':{'id':_0x24297f[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x2c6cb6,null))['then'](removeEntity(_0x2c6cb6,null))[_0x216d('0x4f')](handleError(_0x2c6cb6,null));};exports[_0x216d('0x53')]=function(_0x59fa28,_0x4edf77,_0x3a0ee7){return db['VoiceMail'][_0x216d('0x54')]({'where':{'id':_0x59fa28[_0x216d('0x52')]['id']}})[_0x216d('0x27')](handleEntityNotFound(_0x4edf77,null))['then'](function(_0x3acd4b){var _0x5112ea;var _0x5d96b3={},_0x462225={};_0x462225[_0x216d('0x34')]=_['keys'](db[_0x216d('0x55')][_0x216d('0x30')]);_0x462225[_0x216d('0x35')]=_[_0x216d('0x36')](_0x59fa28[_0x216d('0x35')]);_0x462225[_0x216d('0x37')]=_['intersection'](_0x462225['model'],_0x462225[_0x216d('0x35')]);_0x5d96b3[_0x216d('0x39')]=_[_0x216d('0x38')](_0x462225[_0x216d('0x34')],qs[_0x216d('0x3a')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3a')]));_0x5d96b3[_0x216d('0x39')]=_0x5d96b3[_0x216d('0x39')][_0x216d('0x3b')]?_0x5d96b3[_0x216d('0x39')]:_0x462225[_0x216d('0x34')];if(!_0x59fa28['query']['hasOwnProperty'](_0x216d('0x56'))){_0x5d96b3[_0x216d('0x21')]=qs['limit'](_0x59fa28[_0x216d('0x35')]['limit']);_0x5d96b3['offset']=qs[_0x216d('0x1f')](_0x59fa28[_0x216d('0x35')][_0x216d('0x1f')]);}_0x5d96b3[_0x216d('0x3c')]=qs[_0x216d('0x3d')](_0x59fa28[_0x216d('0x35')][_0x216d('0x3d')]);_0x5d96b3[_0x216d('0x40')]=qs[_0x216d('0x37')](_[_0x216d('0x3e')](_0x59fa28[_0x216d('0x35')],_0x462225[_0x216d('0x37')]));if(_0x59fa28[_0x216d('0x35')][_0x216d('0x3f')]){_0x5d96b3[_0x216d('0x40')]=_[_0x216d('0x41')](_0x5d96b3[_0x216d('0x40')],{'$or':_[_0x216d('0x2e')](_0x5d96b3[_0x216d('0x39')],function(_0x34540e){var _0xb9302={};_0xb9302[_0x34540e]={'$like':'%'+_0x59fa28[_0x216d('0x35')]['filter']+'%'};return _0xb9302;})});}_0x5d96b3[_0x216d('0x40')]=_['merge'](_0x5d96b3[_0x216d('0x40')],{'mailboxuser':_0x3acd4b['mailbox']});_0x5d96b3=_[_0x216d('0x41')]({},_0x5d96b3,_0x59fa28[_0x216d('0x42')]);return db['VoiceMailMessage'][_0x216d('0x57')](_0x5d96b3)[_0x216d('0x27')](respondWithFilteredResult(_0x4edf77,_0x5d96b3));})[_0x216d('0x4f')](handleError(_0x4edf77,null));};
\ No newline at end of file
index a9de36b..5230472 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89a9=['./voiceMail.attributes','define','voice_voicemail','mailbox_context','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x9f0dea,_0x5df611){var _0x102e5a=function(_0x4688c4){while(--_0x4688c4){_0x9f0dea['push'](_0x9f0dea['shift']());}};_0x102e5a(++_0x5df611);}(_0x89a9,0x130));var _0x989a=function(_0x3b5a1e,_0x310331){_0x3b5a1e=_0x3b5a1e-0x0;var _0x57c551=_0x89a9[_0x3b5a1e];return _0x57c551;};'use strict';var _=require(_0x989a('0x0'));var util=require(_0x989a('0x1'));var logger=require(_0x989a('0x2'))('api');var moment=require(_0x989a('0x3'));var BPromise=require(_0x989a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x989a('0x5'));var rimraf=require(_0x989a('0x6'));var config=require(_0x989a('0x7'));var attributes=require(_0x989a('0x8'));module['exports']=function(_0x3cefd4,_0x14d846){return _0x3cefd4[_0x989a('0x9')]('VoiceMail',attributes,{'tableName':_0x989a('0xa'),'paranoid':![],'indexes':[{'name':_0x989a('0xb'),'fields':['mailbox','context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdda3=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','VoiceMail','voice_voicemail','mailbox','context','util'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdda3,0x15b));var _0x3dda=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0xdda3[_0x22205c];return _0x3f5efe;};'use strict';var _=require('lodash');var util=require(_0x3dda('0x0'));var logger=require('../../config/logger')(_0x3dda('0x1'));var moment=require(_0x3dda('0x2'));var BPromise=require(_0x3dda('0x3'));var rp=require(_0x3dda('0x4'));var fs=require('fs');var path=require(_0x3dda('0x5'));var rimraf=require(_0x3dda('0x6'));var config=require(_0x3dda('0x7'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x3dd051,_0x4e0d95){return _0x3dd051['define'](_0x3dda('0x8'),attributes,{'tableName':_0x3dda('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x3dda('0xa'),_0x3dda('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 5b65741..90091f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d2=['error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x469cc6,_0x1df7ea){var _0x3f37c2=function(_0x4ada32){while(--_0x4ada32){_0x469cc6['push'](_0x469cc6['shift']());}};_0x3f37c2(++_0x1df7ea);}(_0x61d2,0x89));var _0x261d=function(_0x3b291a,_0x4e4263){_0x3b291a=_0x3b291a-0x0;var _0x25d794=_0x61d2[_0x3b291a];return _0x25d794;};'use strict';var _=require(_0x261d('0x0'));var util=require(_0x261d('0x1'));var moment=require(_0x261d('0x2'));var BPromise=require(_0x261d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x261d('0x4'));var db=require(_0x261d('0x5'))['db'];var utils=require(_0x261d('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x261d('0x7')][_0x261d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f81a,_0x55984f,_0x315876){return new BPromise(function(_0x386b02,_0x4afea5){return client[_0x261d('0x9')](_0x39f81a,_0x315876)[_0x261d('0xa')](function(_0x2d778a){logger['info'](_0x261d('0xb'),_0x55984f,_0x261d('0xc'));logger[_0x261d('0xd')](_0x261d('0xe'),_0x55984f,_0x261d('0xc'),JSON['stringify'](_0x2d778a));if(_0x2d778a[_0x261d('0xf')]){if(_0x2d778a[_0x261d('0xf')]['code']===0x1f4){logger[_0x261d('0xf')]('VoiceMail,\x20%s,\x20%s',_0x55984f,_0x2d778a[_0x261d('0xf')][_0x261d('0x10')]);return _0x4afea5(_0x2d778a['error'][_0x261d('0x10')]);}logger['error'](_0x261d('0xb'),_0x55984f,_0x2d778a[_0x261d('0xf')][_0x261d('0x10')]);return _0x386b02(_0x2d778a[_0x261d('0xf')][_0x261d('0x10')]);}else{logger['info'](_0x261d('0xb'),_0x55984f,_0x261d('0xc'));_0x386b02(_0x2d778a[_0x261d('0x11')][_0x261d('0x10')]);}})[_0x261d('0x12')](function(_0x545cc7){logger[_0x261d('0xf')]('VoiceMail,\x20%s,\x20%s',_0x55984f,_0x545cc7);_0x4afea5(_0x545cc7);});});}
\ No newline at end of file
+var _0xadc2=['VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','VoiceMail,\x20%s,\x20%s','info','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0xf3fed3,_0x2a3897){var _0x5d0ca6=function(_0x2e7eda){while(--_0x2e7eda){_0xf3fed3['push'](_0xf3fed3['shift']());}};_0x5d0ca6(++_0x2a3897);}(_0xadc2,0xef));var _0x2adc=function(_0x5c0c77,_0x506e0f){_0x5c0c77=_0x5c0c77-0x0;var _0x3e7ef5=_0xadc2[_0x5c0c77];return _0x3e7ef5;};'use strict';var _=require(_0x2adc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2adc('0x1'));var rs=require(_0x2adc('0x2'));var fs=require('fs');var Redis=require(_0x2adc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2adc('0x4'));var logger=require(_0x2adc('0x5'))(_0x2adc('0x6'));var config=require(_0x2adc('0x7'));var jayson=require(_0x2adc('0x8'));var client=jayson[_0x2adc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x255b72,_0x49b839,_0x148590){return new BPromise(function(_0x528a99,_0x416b0e){return client[_0x2adc('0xa')](_0x255b72,_0x148590)[_0x2adc('0xb')](function(_0x23f3b9){logger['info']('VoiceMail,\x20%s,\x20%s',_0x49b839,_0x2adc('0xc'));logger['debug'](_0x2adc('0xd'),_0x49b839,_0x2adc('0xc'),JSON['stringify'](_0x23f3b9));if(_0x23f3b9['error']){if(_0x23f3b9[_0x2adc('0xe')][_0x2adc('0xf')]===0x1f4){logger[_0x2adc('0xe')]('VoiceMail,\x20%s,\x20%s',_0x49b839,_0x23f3b9['error'][_0x2adc('0x10')]);return _0x416b0e(_0x23f3b9[_0x2adc('0xe')][_0x2adc('0x10')]);}logger[_0x2adc('0xe')](_0x2adc('0x11'),_0x49b839,_0x23f3b9[_0x2adc('0xe')]['message']);return _0x528a99(_0x23f3b9['error']['message']);}else{logger[_0x2adc('0x12')](_0x2adc('0x11'),_0x49b839,_0x2adc('0xc'));_0x528a99(_0x23f3b9[_0x2adc('0x13')]['message']);}})[_0x2adc('0x14')](function(_0x1b865b){logger[_0x2adc('0xe')](_0x2adc('0x11'),_0x49b839,_0x1b865b);_0x416b0e(_0x1b865b);});});}
\ No newline at end of file
index 4b8cf36..9d70b5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0de=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','create','put'];(function(_0x190c15,_0x38da10){var _0x40d695=function(_0x460f7a){while(--_0x460f7a){_0x190c15['push'](_0x190c15['shift']());}};_0x40d695(++_0x38da10);}(_0xe0de,0x148));var _0xee0d=function(_0x2a568d,_0x46a24f){_0x2a568d=_0x2a568d-0x0;var _0xcb43ab=_0xe0de[_0x2a568d];return _0xcb43ab;};'use strict';var multer=require(_0xee0d('0x0'));var util=require('util');var path=require(_0xee0d('0x1'));var timeout=require(_0xee0d('0x2'));var express=require(_0xee0d('0x3'));var router=express[_0xee0d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee0d('0x5'));var controller=require('./voiceMailMessage.controller');router[_0xee0d('0x6')]('/',auth[_0xee0d('0x7')](),controller[_0xee0d('0x8')]);router['get'](_0xee0d('0x9'),auth['isAuthenticated'](),controller[_0xee0d('0xa')]);router[_0xee0d('0x6')](_0xee0d('0xb'),auth[_0xee0d('0x7')](),controller['download']);router['post']('/',auth[_0xee0d('0x7')](),controller[_0xee0d('0xc')]);router[_0xee0d('0xd')](_0xee0d('0x9'),auth[_0xee0d('0x7')](),controller[_0xee0d('0xe')]);router[_0xee0d('0xf')](_0xee0d('0x9'),auth[_0xee0d('0x7')](),controller[_0xee0d('0x10')]);module[_0xee0d('0x11')]=router;
\ No newline at end of file
+var _0xd562=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/download','download','create','put','update','delete','/:id','exports','multer','path','connect-timeout','express'];(function(_0x492883,_0x2af036){var _0x1fab8b=function(_0x3adb0a){while(--_0x3adb0a){_0x492883['push'](_0x492883['shift']());}};_0x1fab8b(++_0x2af036);}(_0xd562,0x19e));var _0x2d56=function(_0x3be236,_0x3f4eb7){_0x3be236=_0x3be236-0x0;var _0x157d24=_0xd562[_0x3be236];return _0x157d24;};'use strict';var multer=require(_0x2d56('0x0'));var util=require('util');var path=require(_0x2d56('0x1'));var timeout=require(_0x2d56('0x2'));var express=require(_0x2d56('0x3'));var router=express[_0x2d56('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d56('0x5'));var interaction=require(_0x2d56('0x6'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x2d56('0x7')]('/',auth[_0x2d56('0x8')](),controller[_0x2d56('0x9')]);router[_0x2d56('0x7')]('/:id',auth[_0x2d56('0x8')](),controller[_0x2d56('0xa')]);router[_0x2d56('0x7')](_0x2d56('0xb'),auth['isAuthenticated'](),controller[_0x2d56('0xc')]);router['post']('/',auth[_0x2d56('0x8')](),controller[_0x2d56('0xd')]);router[_0x2d56('0xe')]('/:id',auth[_0x2d56('0x8')](),controller[_0x2d56('0xf')]);router[_0x2d56('0x10')](_0x2d56('0x11'),auth[_0x2d56('0x8')](),controller['destroy']);module[_0x2d56('0x12')]=router;
\ No newline at end of file
index 8e56134..83c6193 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ae=['VIRTUAL','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports'];(function(_0x3762d0,_0x3aecd0){var _0x50b20a=function(_0x47c5fc){while(--_0x47c5fc){_0x3762d0['push'](_0x3762d0['shift']());}};_0x50b20a(++_0x3aecd0);}(_0xe9ae,0x136));var _0xee9a=function(_0x27a883,_0x43680f){_0x27a883=_0x27a883-0x0;var _0x432e29=_0xe9ae[_0x27a883];return _0x432e29;};'use strict';var Sequelize=require(_0xee9a('0x0'));module[_0xee9a('0x1')]={'name':{'type':Sequelize[_0xee9a('0x2')],'get':function(_0x494b7e){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0xee9a('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xee9a('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xee9a('0x5'),'defaultValue':Sequelize[_0xee9a('0x6')](_0xee9a('0x7'))}};
\ No newline at end of file
+var _0xb1f5=['BLOB','long','TIMESTAMP','literal','sequelize','exports','VIRTUAL','INTEGER','STRING'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0xb1f5,0xca));var _0x5b1f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb1f5[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5b1f('0x0'));module[_0x5b1f('0x1')]={'name':{'type':Sequelize[_0x5b1f('0x2')],'get':function(_0x5a9a68){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x5b1f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x5b1f('0x5')](_0x5b1f('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x5b1f('0x4')],'defaultValue':''},'stamp':{'type':_0x5b1f('0x7'),'defaultValue':Sequelize[_0x5b1f('0x8')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 6bf5c4e..fb5ebfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c4=['ejs','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','keys','length','find','create','body','params','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','.wav\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x13ae89,_0x832c38){var _0x1744a0=function(_0x4c406a){while(--_0x4c406a){_0x13ae89['push'](_0x13ae89['shift']());}};_0x1744a0(++_0x832c38);}(_0x73c4,0x97));var _0x473c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x73c4[_0x3635ce];return _0x97ecd0;};'use strict';var emlformat=require(_0x473c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x473c('0x1'));var jsonpatch=require(_0x473c('0x2'));var rp=require(_0x473c('0x3'));var moment=require(_0x473c('0x4'));var BPromise=require(_0x473c('0x5'));var Mustache=require(_0x473c('0x6'));var util=require(_0x473c('0x7'));var path=require(_0x473c('0x8'));var sox=require(_0x473c('0x9'));var csv=require(_0x473c('0xa'));var ejs=require(_0x473c('0xb'));var fs=require('fs');var fs_extra=require(_0x473c('0xc'));var _=require(_0x473c('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x473c('0xe'));var toCsv=require(_0x473c('0xa'));var querystring=require('querystring');var Papa=require(_0x473c('0xf'));var Redis=require(_0x473c('0x10'));var authService=require(_0x473c('0x11'));var qs=require(_0x473c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x473c('0x13'));var logger=require(_0x473c('0x14'))(_0x473c('0x15'));var utils=require(_0x473c('0x16'));var config=require(_0x473c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x473c('0x18'))['db'];function respondWithStatusCode(_0x41eebc,_0x66acba){_0x66acba=_0x66acba||0xcc;return function(_0x17c8f7){if(_0x17c8f7){return _0x41eebc[_0x473c('0x19')](_0x66acba);}return _0x41eebc[_0x473c('0x1a')](_0x66acba)[_0x473c('0x1b')]();};}function respondWithResult(_0x56aaa0,_0x53dd32){_0x53dd32=_0x53dd32||0xc8;return function(_0x5ccf43){if(_0x5ccf43){return _0x56aaa0[_0x473c('0x1a')](_0x53dd32)[_0x473c('0x1c')](_0x5ccf43);}};}function respondWithFilteredResult(_0x3d0362,_0x1be25c){return function(_0x5df075){if(_0x5df075){var _0x387337=typeof _0x1be25c[_0x473c('0x1d')]===_0x473c('0x1e')&&typeof _0x1be25c[_0x473c('0x1f')]===_0x473c('0x1e');var _0x467962=_0x5df075['count'];var _0x1fb4ca=_0x387337?0x0:_0x1be25c[_0x473c('0x1d')];var _0x24c97e=_0x387337?_0x5df075[_0x473c('0x20')]:_0x1be25c[_0x473c('0x1d')]+_0x1be25c['limit'];var _0x52af1b;if(_0x24c97e>=_0x467962){_0x24c97e=_0x467962;_0x52af1b=0xc8;}else{_0x52af1b=0xce;}_0x3d0362[_0x473c('0x1a')](_0x52af1b);return _0x3d0362['set'](_0x473c('0x21'),_0x1fb4ca+'-'+_0x24c97e+'/'+_0x467962)['json'](_0x5df075);}return null;};}function patchUpdates(_0x464e4f){return function(_0x1e0367){try{jsonpatch[_0x473c('0x22')](_0x1e0367,_0x464e4f,!![]);}catch(_0x4b6371){return BPromise[_0x473c('0x23')](_0x4b6371);}return _0x1e0367[_0x473c('0x24')]();};}function saveUpdates(_0x4e1a55,_0xdc3b10){return function(_0x545c2f){if(_0x545c2f){return _0x545c2f[_0x473c('0x25')](_0x4e1a55)[_0x473c('0x26')](function(_0x44528d){return _0x44528d;});}return null;};}function removeEntity(_0x46eaff,_0x16b0dc){return function(_0x2d24b7){if(_0x2d24b7){return _0x2d24b7['destroy']()[_0x473c('0x26')](function(){_0x46eaff[_0x473c('0x1a')](0xcc)[_0x473c('0x1b')]();});}};}function handleEntityNotFound(_0x386b40,_0x410e35){return function(_0x2405ad){if(!_0x2405ad){_0x386b40['sendStatus'](0x194);}return _0x2405ad;};}function handleError(_0x397a48,_0x5c47ed){_0x5c47ed=_0x5c47ed||0x1f4;return function(_0x27d8f9){logger[_0x473c('0x27')](_0x27d8f9['stack']);if(_0x27d8f9[_0x473c('0x28')]){delete _0x27d8f9[_0x473c('0x28')];}_0x397a48[_0x473c('0x1a')](_0x5c47ed)[_0x473c('0x29')](_0x27d8f9);};}exports[_0x473c('0x2a')]=function(_0x32ded9,_0x3e9951){var _0x3cf064={},_0x56dbad={},_0x14edcf={'count':0x0,'rows':[]};var _0x5206e3=_['map'](db[_0x473c('0x2b')][_0x473c('0x2c')],function(_0x2e981c){return{'name':_0x2e981c[_0x473c('0x2d')],'type':_0x2e981c[_0x473c('0x2e')][_0x473c('0x2f')]};});_0x56dbad[_0x473c('0x30')]=_['differenceBy'](_['map'](_0x5206e3,_0x473c('0x28')),['name']);_0x56dbad[_0x473c('0x31')]=_['keys'](_0x32ded9[_0x473c('0x31')]);_0x56dbad[_0x473c('0x32')]=_['intersection'](_0x56dbad[_0x473c('0x30')],_0x56dbad[_0x473c('0x31')]);_0x3cf064[_0x473c('0x33')]=_[_0x473c('0x34')](_0x56dbad[_0x473c('0x30')],qs[_0x473c('0x35')](_0x32ded9[_0x473c('0x31')][_0x473c('0x35')]));_0x3cf064['attributes']=_0x3cf064[_0x473c('0x33')]['length']?_0x3cf064[_0x473c('0x33')]:_0x56dbad[_0x473c('0x30')];if(!_0x32ded9[_0x473c('0x31')]['hasOwnProperty']('nolimit')){_0x3cf064['limit']=qs['limit'](_0x32ded9[_0x473c('0x31')][_0x473c('0x1f')]);_0x3cf064[_0x473c('0x1d')]=qs[_0x473c('0x1d')](_0x32ded9[_0x473c('0x31')][_0x473c('0x1d')]);}_0x3cf064[_0x473c('0x36')]=qs['sort'](_0x32ded9['query'][_0x473c('0x37')]);_0x3cf064['where']=qs[_0x473c('0x32')](_['pick'](_0x32ded9[_0x473c('0x31')],_0x56dbad[_0x473c('0x32')]),_0x5206e3);if(_0x32ded9[_0x473c('0x31')][_0x473c('0x38')]){_0x3cf064[_0x473c('0x39')]=_[_0x473c('0x3a')](_0x3cf064[_0x473c('0x39')],{'$or':_['map'](_0x5206e3,function(_0x452fca){if(_0x452fca[_0x473c('0x2e')]!==_0x473c('0x3b')){var _0x157ede={};_0x157ede[_0x452fca['name']]={'$like':'%'+_0x32ded9['query'][_0x473c('0x38')]+'%'};return _0x157ede;}})});}_0x3cf064=_['merge']({},_0x3cf064,_0x32ded9[_0x473c('0x3c')]);var _0x524807={'where':_0x3cf064['where']};return db[_0x473c('0x2b')][_0x473c('0x20')](_0x524807)[_0x473c('0x26')](function(_0x522bcd){_0x14edcf[_0x473c('0x20')]=_0x522bcd;if(_0x32ded9[_0x473c('0x31')][_0x473c('0x3d')]){_0x3cf064[_0x473c('0x3e')]=[{'all':!![]}];}return db[_0x473c('0x2b')][_0x473c('0x3f')](_0x3cf064);})['then'](function(_0x278ee1){_0x14edcf['rows']=_0x278ee1;return _0x14edcf;})[_0x473c('0x26')](respondWithFilteredResult(_0x3e9951,_0x3cf064))[_0x473c('0x40')](handleError(_0x3e9951,null));};exports['show']=function(_0x592afa,_0x3582a5){var _0x5d977a={'raw':!![],'where':{'id':_0x592afa['params']['id']}},_0x28d667={};_0x28d667[_0x473c('0x30')]=_[_0x473c('0x41')](db['VoiceMailMessage']['rawAttributes']);_0x28d667[_0x473c('0x31')]=_[_0x473c('0x41')](_0x592afa[_0x473c('0x31')]);_0x28d667[_0x473c('0x32')]=_['intersection'](_0x28d667[_0x473c('0x30')],_0x28d667[_0x473c('0x31')]);_0x5d977a[_0x473c('0x33')]=_[_0x473c('0x34')](_0x28d667[_0x473c('0x30')],qs['fields'](_0x592afa[_0x473c('0x31')][_0x473c('0x35')]));_0x5d977a['attributes']=_0x5d977a['attributes'][_0x473c('0x42')]?_0x5d977a['attributes']:_0x28d667[_0x473c('0x30')];if(_0x592afa[_0x473c('0x31')][_0x473c('0x3d')]){_0x5d977a['include']=[{'all':!![]}];}_0x5d977a=_[_0x473c('0x3a')]({},_0x5d977a,_0x592afa[_0x473c('0x3c')]);return db['VoiceMailMessage'][_0x473c('0x43')](_0x5d977a)[_0x473c('0x26')](handleEntityNotFound(_0x3582a5,null))[_0x473c('0x26')](respondWithResult(_0x3582a5,null))[_0x473c('0x40')](handleError(_0x3582a5,null));};exports[_0x473c('0x44')]=function(_0x560c8e,_0x31863b){return db['VoiceMailMessage'][_0x473c('0x44')](_0x560c8e['body'],{})[_0x473c('0x26')](respondWithResult(_0x31863b,0xc9))[_0x473c('0x40')](handleError(_0x31863b,null));};exports[_0x473c('0x25')]=function(_0x1e2ecf,_0x937b6b){if(_0x1e2ecf[_0x473c('0x45')]['id']){delete _0x1e2ecf['body']['id'];}return db[_0x473c('0x2b')][_0x473c('0x43')]({'where':{'id':_0x1e2ecf[_0x473c('0x46')]['id']}})[_0x473c('0x26')](handleEntityNotFound(_0x937b6b,null))[_0x473c('0x26')](saveUpdates(_0x1e2ecf[_0x473c('0x45')],null))[_0x473c('0x26')](respondWithResult(_0x937b6b,null))['catch'](handleError(_0x937b6b,null));};exports[_0x473c('0x47')]=function(_0x201a12,_0x15a591){return db[_0x473c('0x2b')]['find']({'where':{'id':_0x201a12[_0x473c('0x46')]['id']}})[_0x473c('0x26')](handleEntityNotFound(_0x15a591,null))['then'](removeEntity(_0x15a591,null))[_0x473c('0x40')](handleError(_0x15a591,null));};exports[_0x473c('0x48')]=function(_0x12c9ae,_0xb2b274,_0x5ebdb2){return db[_0x473c('0x2b')]['find']({'where':{'id':_0x12c9ae[_0x473c('0x46')]['id']},'attributes':['id',_0x473c('0x49'),_0x473c('0x4a')]})['then'](handleEntityNotFound(_0xb2b274,null))[_0x473c('0x26')](function(_0x4b82d5){if(_0x4b82d5){if(!_0x4b82d5[_0x473c('0x49')]){throw new db[(_0x473c('0x4b'))][(_0x473c('0x4c'))](_0x473c('0x4d'));}var _0x537c54={'Content-Type':_0x473c('0x4e'),'Content-Disposition':'attachment'};if(_0x4b82d5[_0x473c('0x4a')]){_0x537c54['Content-Disposition']=_0x473c('0x4f')+_0x4b82d5[_0x473c('0x4a')]+_0x473c('0x50');}_0xb2b274['set'](_0x537c54);return _0xb2b274[_0x473c('0x29')](new Buffer(_0x4b82d5['recording']));}})['catch'](handleError(_0xb2b274,null));};
\ No newline at end of file
+var _0xa4a3=['intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','rawAttributes','length','find','create','body','params','destroy','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','then','stack','name','index','map','VoiceMailMessage','fieldName','model','differenceBy','keys','query','filters'];(function(_0x227c9b,_0x34d983){var _0x37f247=function(_0x1adc5a){while(--_0x1adc5a){_0x227c9b['push'](_0x227c9b['shift']());}};_0x37f247(++_0x34d983);}(_0xa4a3,0x165));var _0x3a4a=function(_0x2c50b7,_0x7604fb){_0x2c50b7=_0x2c50b7-0x0;var _0x46b5a9=_0xa4a3[_0x2c50b7];return _0x46b5a9;};'use strict';var emlformat=require(_0x3a4a('0x0'));var rimraf=require(_0x3a4a('0x1'));var zipdir=require(_0x3a4a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a4a('0x3'));var moment=require(_0x3a4a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a4a('0x5'));var util=require('util');var path=require(_0x3a4a('0x6'));var sox=require(_0x3a4a('0x7'));var csv=require(_0x3a4a('0x8'));var ejs=require(_0x3a4a('0x9'));var fs=require('fs');var fs_extra=require(_0x3a4a('0xa'));var _=require(_0x3a4a('0xb'));var squel=require('squel');var crypto=require(_0x3a4a('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3a4a('0x8'));var querystring=require(_0x3a4a('0xd'));var Papa=require(_0x3a4a('0xe'));var Redis=require(_0x3a4a('0xf'));var authService=require(_0x3a4a('0x10'));var qs=require(_0x3a4a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a4a('0x12'));var logger=require(_0x3a4a('0x13'))(_0x3a4a('0x14'));var utils=require(_0x3a4a('0x15'));var config=require(_0x3a4a('0x16'));var licenseUtil=require(_0x3a4a('0x17'));var db=require(_0x3a4a('0x18'))['db'];function respondWithStatusCode(_0x53bb3a,_0x20f476){_0x20f476=_0x20f476||0xcc;return function(_0x116007){if(_0x116007){return _0x53bb3a[_0x3a4a('0x19')](_0x20f476);}return _0x53bb3a[_0x3a4a('0x1a')](_0x20f476)[_0x3a4a('0x1b')]();};}function respondWithResult(_0x218fd9,_0xb24b01){_0xb24b01=_0xb24b01||0xc8;return function(_0x295d56){if(_0x295d56){return _0x218fd9[_0x3a4a('0x1a')](_0xb24b01)['json'](_0x295d56);}};}function respondWithFilteredResult(_0xf384a0,_0x43079e){return function(_0xee48e){if(_0xee48e){var _0x51de36=typeof _0x43079e['offset']===_0x3a4a('0x1c')&&typeof _0x43079e[_0x3a4a('0x1d')]===_0x3a4a('0x1c');var _0x57cb4e=_0xee48e[_0x3a4a('0x1e')];var _0x51fbab=_0x51de36?0x0:_0x43079e[_0x3a4a('0x1f')];var _0x4317d5=_0x51de36?_0xee48e[_0x3a4a('0x1e')]:_0x43079e[_0x3a4a('0x1f')]+_0x43079e[_0x3a4a('0x1d')];var _0x319ab2;if(_0x4317d5>=_0x57cb4e){_0x4317d5=_0x57cb4e;_0x319ab2=0xc8;}else{_0x319ab2=0xce;}_0xf384a0[_0x3a4a('0x1a')](_0x319ab2);return _0xf384a0['set'](_0x3a4a('0x20'),_0x51fbab+'-'+_0x4317d5+'/'+_0x57cb4e)[_0x3a4a('0x21')](_0xee48e);}return null;};}function patchUpdates(_0x55c6d7){return function(_0xa0c237){try{jsonpatch['apply'](_0xa0c237,_0x55c6d7,!![]);}catch(_0x52dca1){return BPromise[_0x3a4a('0x22')](_0x52dca1);}return _0xa0c237[_0x3a4a('0x23')]();};}function saveUpdates(_0x34e76a,_0x20f7f4){return function(_0xdd3380){if(_0xdd3380){return _0xdd3380['update'](_0x34e76a)['then'](function(_0x1d8d0c){return _0x1d8d0c;});}return null;};}function removeEntity(_0x2de0fe,_0x4c4a7e){return function(_0x44406c){if(_0x44406c){return _0x44406c['destroy']()[_0x3a4a('0x24')](function(){_0x2de0fe[_0x3a4a('0x1a')](0xcc)[_0x3a4a('0x1b')]();});}};}function handleEntityNotFound(_0x2ab50b,_0x1ab0b7){return function(_0x500e2d){if(!_0x500e2d){_0x2ab50b[_0x3a4a('0x19')](0x194);}return _0x500e2d;};}function handleError(_0x182cde,_0x4dc99f){_0x4dc99f=_0x4dc99f||0x1f4;return function(_0x196967){logger['error'](_0x196967[_0x3a4a('0x25')]);if(_0x196967[_0x3a4a('0x26')]){delete _0x196967[_0x3a4a('0x26')];}_0x182cde['status'](_0x4dc99f)['send'](_0x196967);};}exports[_0x3a4a('0x27')]=function(_0x1084fb,_0x34586f){var _0x578e49={},_0x5716ca={},_0x56895b={'count':0x0,'rows':[]};var _0x728f53=_[_0x3a4a('0x28')](db[_0x3a4a('0x29')]['rawAttributes'],function(_0x4605f0){return{'name':_0x4605f0[_0x3a4a('0x2a')],'type':_0x4605f0['type']['key']};});_0x5716ca[_0x3a4a('0x2b')]=_[_0x3a4a('0x2c')](_[_0x3a4a('0x28')](_0x728f53,_0x3a4a('0x26')),[_0x3a4a('0x26')]);_0x5716ca['query']=_[_0x3a4a('0x2d')](_0x1084fb[_0x3a4a('0x2e')]);_0x5716ca[_0x3a4a('0x2f')]=_[_0x3a4a('0x30')](_0x5716ca[_0x3a4a('0x2b')],_0x5716ca[_0x3a4a('0x2e')]);_0x578e49[_0x3a4a('0x31')]=_[_0x3a4a('0x30')](_0x5716ca[_0x3a4a('0x2b')],qs[_0x3a4a('0x32')](_0x1084fb[_0x3a4a('0x2e')]['fields']));_0x578e49[_0x3a4a('0x31')]=_0x578e49[_0x3a4a('0x31')]['length']?_0x578e49[_0x3a4a('0x31')]:_0x5716ca['model'];if(!_0x1084fb['query'][_0x3a4a('0x33')]('nolimit')){_0x578e49[_0x3a4a('0x1d')]=qs[_0x3a4a('0x1d')](_0x1084fb['query'][_0x3a4a('0x1d')]);_0x578e49[_0x3a4a('0x1f')]=qs['offset'](_0x1084fb[_0x3a4a('0x2e')]['offset']);}_0x578e49['order']=qs[_0x3a4a('0x34')](_0x1084fb[_0x3a4a('0x2e')][_0x3a4a('0x34')]);_0x578e49[_0x3a4a('0x35')]=qs[_0x3a4a('0x2f')](_[_0x3a4a('0x36')](_0x1084fb[_0x3a4a('0x2e')],_0x5716ca[_0x3a4a('0x2f')]),_0x728f53);if(_0x1084fb[_0x3a4a('0x2e')][_0x3a4a('0x37')]){_0x578e49['where']=_[_0x3a4a('0x38')](_0x578e49[_0x3a4a('0x35')],{'$or':_[_0x3a4a('0x28')](_0x728f53,function(_0x3d77c1){if(_0x3d77c1['type']!=='VIRTUAL'){var _0x3e1242={};_0x3e1242[_0x3d77c1[_0x3a4a('0x26')]]={'$like':'%'+_0x1084fb[_0x3a4a('0x2e')]['filter']+'%'};return _0x3e1242;}})});}_0x578e49=_[_0x3a4a('0x38')]({},_0x578e49,_0x1084fb[_0x3a4a('0x39')]);var _0x2d1f88={'where':_0x578e49[_0x3a4a('0x35')]};return db['VoiceMailMessage']['count'](_0x2d1f88)[_0x3a4a('0x24')](function(_0x334005){_0x56895b[_0x3a4a('0x1e')]=_0x334005;if(_0x1084fb[_0x3a4a('0x2e')][_0x3a4a('0x3a')]){_0x578e49[_0x3a4a('0x3b')]=[{'all':!![]}];}return db[_0x3a4a('0x29')][_0x3a4a('0x3c')](_0x578e49);})['then'](function(_0x5b6437){_0x56895b['rows']=_0x5b6437;return _0x56895b;})['then'](respondWithFilteredResult(_0x34586f,_0x578e49))[_0x3a4a('0x3d')](handleError(_0x34586f,null));};exports[_0x3a4a('0x3e')]=function(_0x22f63b,_0x46db25){var _0x2232d0={'raw':!![],'where':{'id':_0x22f63b['params']['id']}},_0x115500={};_0x115500['model']=_['keys'](db[_0x3a4a('0x29')][_0x3a4a('0x3f')]);_0x115500[_0x3a4a('0x2e')]=_[_0x3a4a('0x2d')](_0x22f63b['query']);_0x115500[_0x3a4a('0x2f')]=_[_0x3a4a('0x30')](_0x115500[_0x3a4a('0x2b')],_0x115500[_0x3a4a('0x2e')]);_0x2232d0[_0x3a4a('0x31')]=_[_0x3a4a('0x30')](_0x115500[_0x3a4a('0x2b')],qs[_0x3a4a('0x32')](_0x22f63b[_0x3a4a('0x2e')][_0x3a4a('0x32')]));_0x2232d0['attributes']=_0x2232d0[_0x3a4a('0x31')][_0x3a4a('0x40')]?_0x2232d0[_0x3a4a('0x31')]:_0x115500[_0x3a4a('0x2b')];if(_0x22f63b[_0x3a4a('0x2e')][_0x3a4a('0x3a')]){_0x2232d0[_0x3a4a('0x3b')]=[{'all':!![]}];}_0x2232d0=_[_0x3a4a('0x38')]({},_0x2232d0,_0x22f63b[_0x3a4a('0x39')]);return db['VoiceMailMessage'][_0x3a4a('0x41')](_0x2232d0)[_0x3a4a('0x24')](handleEntityNotFound(_0x46db25,null))[_0x3a4a('0x24')](respondWithResult(_0x46db25,null))[_0x3a4a('0x3d')](handleError(_0x46db25,null));};exports[_0x3a4a('0x42')]=function(_0xd9c031,_0x5cb867){return db[_0x3a4a('0x29')][_0x3a4a('0x42')](_0xd9c031[_0x3a4a('0x43')],{})[_0x3a4a('0x24')](respondWithResult(_0x5cb867,0xc9))[_0x3a4a('0x3d')](handleError(_0x5cb867,null));};exports['update']=function(_0x302537,_0x286bfa){if(_0x302537[_0x3a4a('0x43')]['id']){delete _0x302537[_0x3a4a('0x43')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x302537[_0x3a4a('0x44')]['id']}})[_0x3a4a('0x24')](handleEntityNotFound(_0x286bfa,null))[_0x3a4a('0x24')](saveUpdates(_0x302537[_0x3a4a('0x43')],null))['then'](respondWithResult(_0x286bfa,null))[_0x3a4a('0x3d')](handleError(_0x286bfa,null));};exports[_0x3a4a('0x45')]=function(_0x261ed9,_0x7aa62d){return db[_0x3a4a('0x29')]['find']({'where':{'id':_0x261ed9[_0x3a4a('0x44')]['id']}})[_0x3a4a('0x24')](handleEntityNotFound(_0x7aa62d,null))[_0x3a4a('0x24')](removeEntity(_0x7aa62d,null))['catch'](handleError(_0x7aa62d,null));};exports[_0x3a4a('0x46')]=function(_0x1ba2d8,_0x363b2d,_0x319e0e){return db[_0x3a4a('0x29')]['find']({'where':{'id':_0x1ba2d8['params']['id']},'attributes':['id',_0x3a4a('0x47'),_0x3a4a('0x48')]})[_0x3a4a('0x24')](handleEntityNotFound(_0x363b2d,null))[_0x3a4a('0x24')](function(_0x3ec458){if(_0x3ec458){if(!_0x3ec458[_0x3a4a('0x47')]){throw new db[(_0x3a4a('0x49'))][(_0x3a4a('0x4a'))](_0x3a4a('0x4b'));}var _0x21ea51={'Content-Type':_0x3a4a('0x4c'),'Content-Disposition':_0x3a4a('0x4d')};if(_0x3ec458['msg_id']){_0x21ea51[_0x3a4a('0x4e')]='attachment;\x20filename=\x22'+_0x3ec458[_0x3a4a('0x48')]+_0x3a4a('0x4f');}_0x363b2d[_0x3a4a('0x50')](_0x21ea51);return _0x363b2d['send'](new Buffer(_0x3ec458[_0x3a4a('0x47')]));}})[_0x3a4a('0x3d')](handleError(_0x363b2d,null));};
\ No newline at end of file
index ba06fdc..31f6975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36d8=['request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','dir','lodash','util','api','moment','bluebird'];(function(_0xf41df4,_0x2bf29a){var _0x32dea7=function(_0x3493db){while(--_0x3493db){_0xf41df4['push'](_0xf41df4['shift']());}};_0x32dea7(++_0x2bf29a);}(_0x36d8,0x16d));var _0x836d=function(_0x8dc4e7,_0x2b6ffa){_0x8dc4e7=_0x8dc4e7-0x0;var _0x222920=_0x36d8[_0x8dc4e7];return _0x222920;};'use strict';var _=require(_0x836d('0x0'));var util=require(_0x836d('0x1'));var logger=require('../../config/logger')(_0x836d('0x2'));var moment=require(_0x836d('0x3'));var BPromise=require(_0x836d('0x4'));var rp=require(_0x836d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x836d('0x6'));var config=require(_0x836d('0x7'));var attributes=require(_0x836d('0x8'));module['exports']=function(_0x358ea2,_0x5296aa){return _0x358ea2['define']('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x836d('0x9'),'fields':[_0x836d('0x9')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xfee8=['voice_voicemail_messages','dir','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xfee8,0xe8));var _0x8fee=function(_0x4635e5,_0x5590a9){_0x4635e5=_0x4635e5-0x0;var _0x5a187b=_0xfee8[_0x4635e5];return _0x5a187b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8fee('0x0'));var rp=require(_0x8fee('0x1'));var fs=require('fs');var path=require(_0x8fee('0x2'));var rimraf=require(_0x8fee('0x3'));var config=require(_0x8fee('0x4'));var attributes=require(_0x8fee('0x5'));module[_0x8fee('0x6')]=function(_0x4353b7,_0x171335){return _0x4353b7[_0x8fee('0x7')]('VoiceMailMessage',attributes,{'tableName':_0x8fee('0x8'),'paranoid':![],'indexes':[{'name':_0x8fee('0x9'),'fields':[_0x8fee('0x9')]}],'timestamps':![]});};
\ No newline at end of file
index b96433c..97d0946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7147=['debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x3c8aa3,_0x394522){var _0x495d1e=function(_0x2d7d8f){while(--_0x2d7d8f){_0x3c8aa3['push'](_0x3c8aa3['shift']());}};_0x495d1e(++_0x394522);}(_0x7147,0x128));var _0x7714=function(_0x5f584a,_0x47f064){_0x5f584a=_0x5f584a-0x0;var _0x3788d9=_0x7147[_0x5f584a];return _0x3788d9;};'use strict';var _=require('lodash');var util=require(_0x7714('0x0'));var moment=require(_0x7714('0x1'));var BPromise=require(_0x7714('0x2'));var rs=require(_0x7714('0x3'));var fs=require('fs');var Redis=require(_0x7714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7714('0x5'));var logger=require(_0x7714('0x6'))(_0x7714('0x7'));var config=require(_0x7714('0x8'));var jayson=require(_0x7714('0x9'));var client=jayson[_0x7714('0xa')][_0x7714('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3876d1,_0x23d4da,_0x264889){return new BPromise(function(_0x442b2d,_0x257c44){return client[_0x7714('0xc')](_0x3876d1,_0x264889)['then'](function(_0x5515c2){logger[_0x7714('0xd')](_0x7714('0xe'),_0x23d4da,_0x7714('0xf'));logger[_0x7714('0x10')](_0x7714('0x11'),_0x23d4da,_0x7714('0xf'),JSON[_0x7714('0x12')](_0x5515c2));if(_0x5515c2['error']){if(_0x5515c2['error'][_0x7714('0x13')]===0x1f4){logger[_0x7714('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x23d4da,_0x5515c2[_0x7714('0x14')][_0x7714('0x15')]);return _0x257c44(_0x5515c2[_0x7714('0x14')]['message']);}logger[_0x7714('0x14')](_0x7714('0xe'),_0x23d4da,_0x5515c2[_0x7714('0x14')][_0x7714('0x15')]);return _0x442b2d(_0x5515c2[_0x7714('0x14')][_0x7714('0x15')]);}else{logger[_0x7714('0xd')](_0x7714('0xe'),_0x23d4da,_0x7714('0xf'));_0x442b2d(_0x5515c2[_0x7714('0x16')]['message']);}})[_0x7714('0x17')](function(_0x25adf7){logger[_0x7714('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x23d4da,_0x25adf7);_0x257c44(_0x25adf7);});});}
\ No newline at end of file
+var _0x9939=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x527847,_0x5e9fb4){var _0x1742a6=function(_0x4efe94){while(--_0x4efe94){_0x527847['push'](_0x527847['shift']());}};_0x1742a6(++_0x5e9fb4);}(_0x9939,0x1a1));var _0x9993=function(_0x5b339b,_0x51fdbe){_0x5b339b=_0x5b339b-0x0;var _0x5b8380=_0x9939[_0x5b339b];return _0x5b8380;};'use strict';var _=require('lodash');var util=require(_0x9993('0x0'));var moment=require(_0x9993('0x1'));var BPromise=require(_0x9993('0x2'));var rs=require(_0x9993('0x3'));var fs=require('fs');var Redis=require(_0x9993('0x4'));var db=require(_0x9993('0x5'))['db'];var utils=require(_0x9993('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9993('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9993('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47cf4a,_0x310b15,_0xa6ad28){return new BPromise(function(_0x5d63a8,_0x3df139){return client['request'](_0x47cf4a,_0xa6ad28)[_0x9993('0x9')](function(_0x27bccb){logger[_0x9993('0xa')](_0x9993('0xb'),_0x310b15,_0x9993('0xc'));logger[_0x9993('0xd')](_0x9993('0xe'),_0x310b15,_0x9993('0xc'),JSON[_0x9993('0xf')](_0x27bccb));if(_0x27bccb['error']){if(_0x27bccb[_0x9993('0x10')][_0x9993('0x11')]===0x1f4){logger[_0x9993('0x10')](_0x9993('0xb'),_0x310b15,_0x27bccb['error'][_0x9993('0x12')]);return _0x3df139(_0x27bccb[_0x9993('0x10')][_0x9993('0x12')]);}logger['error'](_0x9993('0xb'),_0x310b15,_0x27bccb['error'][_0x9993('0x12')]);return _0x5d63a8(_0x27bccb[_0x9993('0x10')][_0x9993('0x12')]);}else{logger[_0x9993('0xa')](_0x9993('0xb'),_0x310b15,_0x9993('0xc'));_0x5d63a8(_0x27bccb['result'][_0x9993('0x12')]);}})[_0x9993('0x13')](function(_0x4bfd2d){logger[_0x9993('0x10')](_0x9993('0xb'),_0x310b15,_0x4bfd2d);_0x3df139(_0x4bfd2d);});});}
\ No newline at end of file
index 8756159..06422fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda07=['../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','/:id/sounds','getSounds','post','put','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','express','Router','fs-extra'];(function(_0x33d301,_0xd98e84){var _0x2406aa=function(_0x474013){while(--_0x474013){_0x33d301['push'](_0x33d301['shift']());}};_0x2406aa(++_0xd98e84);}(_0xda07,0x10c));var _0x7da0=function(_0x47626f,_0x2e89fa){_0x47626f=_0x47626f-0x0;var _0x50a705=_0xda07[_0x47626f];return _0x50a705;};'use strict';var multer=require(_0x7da0('0x0'));var util=require(_0x7da0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7da0('0x2'));var router=express[_0x7da0('0x3')]();var fs_extra=require(_0x7da0('0x4'));var auth=require(_0x7da0('0x5'));var interaction=require(_0x7da0('0x6'));var config=require('../../config/environment');var controller=require(_0x7da0('0x7'));router[_0x7da0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x7da0('0x9')](),controller['show']);router['get'](_0x7da0('0xa'),auth[_0x7da0('0x9')](),controller[_0x7da0('0xb')]);router[_0x7da0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7da0('0xa'),auth[_0x7da0('0x9')](),controller['addSound']);router[_0x7da0('0xd')](_0x7da0('0xe'),auth[_0x7da0('0x9')](),controller[_0x7da0('0xf')]);router[_0x7da0('0x10')](_0x7da0('0xe'),auth[_0x7da0('0x9')](),controller[_0x7da0('0x11')]);router[_0x7da0('0x10')](_0x7da0('0x12'),auth[_0x7da0('0x9')](),controller[_0x7da0('0x13')]);module[_0x7da0('0x14')]=router;
\ No newline at end of file
+var _0x26fa=['/:id','show','create','post','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','Router','./voiceMusicOnHold.controller','isAuthenticated','index','get'];(function(_0x24a7c9,_0x157c78){var _0x451a81=function(_0x4bdc76){while(--_0x4bdc76){_0x24a7c9['push'](_0x24a7c9['shift']());}};_0x451a81(++_0x157c78);}(_0x26fa,0x90));var _0xa26f=function(_0x3268c8,_0x9c1403){_0x3268c8=_0x3268c8-0x0;var _0x203a8c=_0x26fa[_0x3268c8];return _0x203a8c;};'use strict';var multer=require(_0xa26f('0x0'));var util=require('util');var path=require(_0xa26f('0x1'));var timeout=require(_0xa26f('0x2'));var express=require('express');var router=express[_0xa26f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa26f('0x4'));router['get']('/',auth[_0xa26f('0x5')](),controller[_0xa26f('0x6')]);router[_0xa26f('0x7')](_0xa26f('0x8'),auth['isAuthenticated'](),controller[_0xa26f('0x9')]);router[_0xa26f('0x7')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0xa26f('0x5')](),controller[_0xa26f('0xa')]);router[_0xa26f('0xb')]('/:id/sounds',auth[_0xa26f('0x5')](),controller[_0xa26f('0xc')]);router[_0xa26f('0xd')]('/:id',auth[_0xa26f('0x5')](),controller['update']);router[_0xa26f('0xe')](_0xa26f('0x8'),auth[_0xa26f('0x5')](),controller[_0xa26f('0xf')]);router[_0xa26f('0xe')](_0xa26f('0x10'),auth[_0xa26f('0x5')](),controller[_0xa26f('0x11')]);module[_0xa26f('0x12')]=router;
\ No newline at end of file
index f51d450..9be6266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffbe=['files','mp3nb','quietmp3nb','quietmp3','mp3','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x39b8f6,_0x79bb06){var _0x355b23=function(_0x40e9c4){while(--_0x40e9c4){_0x39b8f6['push'](_0x39b8f6['shift']());}};_0x355b23(++_0x79bb06);}(_0xffbe,0x1c9));var _0xeffb=function(_0x56fa63,_0x4e5bae){_0x56fa63=_0x56fa63-0x0;var _0x4c7bd8=_0xffbe[_0x56fa63];return _0x4c7bd8;};'use strict';var Sequelize=require(_0xeffb('0x0'));module[_0xeffb('0x1')]={'name':{'type':Sequelize[_0xeffb('0x2')],'allowNull':![],'unique':_0xeffb('0x3')},'mode':{'type':Sequelize[_0xeffb('0x4')]('custom',_0xeffb('0x5'),_0xeffb('0x6'),_0xeffb('0x7'),_0xeffb('0x8'),_0xeffb('0x9')),'allowNull':!![],'defaultValue':_0xeffb('0x5')},'directory':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xeffb('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xeffb('0xa')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xbfd2=['custom','mp3nb','quietmp3','mp3','files','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x114748,_0x2a7e15){var _0x173357=function(_0xd7b840){while(--_0xd7b840){_0x114748['push'](_0x114748['shift']());}};_0x173357(++_0x2a7e15);}(_0xbfd2,0x14b));var _0x2bfd=function(_0x905fcb,_0x15216d){_0x905fcb=_0x905fcb-0x0;var _0x4c24a7=_0xbfd2[_0x905fcb];return _0x4c24a7;};'use strict';var Sequelize=require(_0x2bfd('0x0'));module[_0x2bfd('0x1')]={'name':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':![],'unique':_0x2bfd('0x3')},'mode':{'type':Sequelize[_0x2bfd('0x4')](_0x2bfd('0x5'),'files',_0x2bfd('0x6'),'quietmp3nb',_0x2bfd('0x7'),_0x2bfd('0x8')),'allowNull':!![],'defaultValue':_0x2bfd('0x9')},'directory':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x2bfd('0x2')],'allowNull':!![]},'stamp':{'type':_0x2bfd('0xa')},'defaultEntry':{'type':Sequelize[_0x2bfd('0xb')],'defaultValue':0x0}};
\ No newline at end of file
index 5dbc759..af4675d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53a6=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','VoiceMusicOnHold','findAll','params','options','find','body','catch','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','removeSound','id2','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x53a6,0x1c0));var _0x653a=function(_0x40fbf6,_0x456761){_0x40fbf6=_0x40fbf6-0x0;var _0x2e175b=_0x53a6[_0x40fbf6];return _0x2e175b;};'use strict';var emlformat=require(_0x653a('0x0'));var rimraf=require(_0x653a('0x1'));var zipdir=require(_0x653a('0x2'));var jsonpatch=require(_0x653a('0x3'));var rp=require(_0x653a('0x4'));var moment=require(_0x653a('0x5'));var BPromise=require(_0x653a('0x6'));var Mustache=require(_0x653a('0x7'));var util=require(_0x653a('0x8'));var path=require(_0x653a('0x9'));var sox=require(_0x653a('0xa'));var csv=require('to-csv');var ejs=require(_0x653a('0xb'));var fs=require('fs');var fs_extra=require(_0x653a('0xc'));var _=require(_0x653a('0xd'));var squel=require(_0x653a('0xe'));var crypto=require('crypto');var jsforce=require(_0x653a('0xf'));var deskjs=require(_0x653a('0x10'));var toCsv=require(_0x653a('0x11'));var querystring=require('querystring');var Papa=require(_0x653a('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x653a('0x13'));var as=require(_0x653a('0x14'));var hardwareService=require(_0x653a('0x15'));var logger=require(_0x653a('0x16'))(_0x653a('0x17'));var utils=require('../../config/utils');var config=require(_0x653a('0x18'));var licenseUtil=require(_0x653a('0x19'));var db=require(_0x653a('0x1a'))['db'];function respondWithStatusCode(_0x80b64b,_0x20afd8){_0x20afd8=_0x20afd8||0xcc;return function(_0x44ea49){if(_0x44ea49){return _0x80b64b[_0x653a('0x1b')](_0x20afd8);}return _0x80b64b[_0x653a('0x1c')](_0x20afd8)['end']();};}function respondWithResult(_0x2e7a98,_0x7785e1){_0x7785e1=_0x7785e1||0xc8;return function(_0x4135d5){if(_0x4135d5){return _0x2e7a98[_0x653a('0x1c')](_0x7785e1)[_0x653a('0x1d')](_0x4135d5);}};}function respondWithFilteredResult(_0x38b0b6,_0x1eea59){return function(_0x549c){if(_0x549c){var _0x101694=typeof _0x1eea59[_0x653a('0x1e')]==='undefined'&&typeof _0x1eea59[_0x653a('0x1f')]===_0x653a('0x20');var _0x53c778=_0x549c[_0x653a('0x21')];var _0x2199c5=_0x101694?0x0:_0x1eea59['offset'];var _0x55d8c3=_0x101694?_0x549c[_0x653a('0x21')]:_0x1eea59[_0x653a('0x1e')]+_0x1eea59['limit'];var _0x314d4b;if(_0x55d8c3>=_0x53c778){_0x55d8c3=_0x53c778;_0x314d4b=0xc8;}else{_0x314d4b=0xce;}_0x38b0b6[_0x653a('0x1c')](_0x314d4b);return _0x38b0b6[_0x653a('0x22')]('Content-Range',_0x2199c5+'-'+_0x55d8c3+'/'+_0x53c778)[_0x653a('0x1d')](_0x549c);}return null;};}function patchUpdates(_0xb21f81){return function(_0x37006c){try{jsonpatch[_0x653a('0x23')](_0x37006c,_0xb21f81,!![]);}catch(_0x1340c6){return BPromise['reject'](_0x1340c6);}return _0x37006c[_0x653a('0x24')]();};}function saveUpdates(_0x32f610,_0x42b737){return function(_0x1e8890){if(_0x1e8890){return _0x1e8890[_0x653a('0x25')](_0x32f610)[_0x653a('0x26')](function(_0x23ba91){return _0x23ba91;});}return null;};}function removeEntity(_0x241598,_0x3be726){return function(_0xef5fbb){if(_0xef5fbb){return _0xef5fbb[_0x653a('0x27')]()[_0x653a('0x26')](function(){var _0x713705=_0xef5fbb[_0x653a('0x28')]({'plain':!![]});var _0x128a77=_0x653a('0x29');return db[_0x653a('0x2a')]['destroy']({'where':{'type':_0x128a77,'resourceId':_0x713705['id']}})[_0x653a('0x26')](function(){return _0xef5fbb;});})[_0x653a('0x26')](function(){_0x241598['status'](0xcc)[_0x653a('0x2b')]();});}};}function handleEntityNotFound(_0x1c1195,_0x99c7a5){return function(_0x21ddab){if(!_0x21ddab){_0x1c1195[_0x653a('0x1b')](0x194);}return _0x21ddab;};}function handleError(_0x1f9ace,_0x12b9e1){_0x12b9e1=_0x12b9e1||0x1f4;return function(_0x38f50b){logger[_0x653a('0x2c')](_0x38f50b[_0x653a('0x2d')]);if(_0x38f50b[_0x653a('0x2e')]){delete _0x38f50b[_0x653a('0x2e')];}_0x1f9ace[_0x653a('0x1c')](_0x12b9e1)['send'](_0x38f50b);};}exports[_0x653a('0x2f')]=function(_0x265a25,_0x343db0){var _0x52217a={},_0x2e4a9d={},_0x49a582={'count':0x0,'rows':[]};var _0x3f54c5=_[_0x653a('0x30')](db['VoiceMusicOnHold'][_0x653a('0x31')],function(_0x256747){return{'name':_0x256747[_0x653a('0x32')],'type':_0x256747[_0x653a('0x33')][_0x653a('0x34')]};});_0x2e4a9d['model']=_[_0x653a('0x30')](_0x3f54c5,'name');_0x2e4a9d[_0x653a('0x35')]=_[_0x653a('0x36')](_0x265a25['query']);_0x2e4a9d[_0x653a('0x37')]=_[_0x653a('0x38')](_0x2e4a9d[_0x653a('0x39')],_0x2e4a9d[_0x653a('0x35')]);_0x52217a[_0x653a('0x3a')]=_[_0x653a('0x38')](_0x2e4a9d[_0x653a('0x39')],qs['fields'](_0x265a25[_0x653a('0x35')][_0x653a('0x3b')]));_0x52217a[_0x653a('0x3a')]=_0x52217a['attributes'][_0x653a('0x3c')]?_0x52217a['attributes']:_0x2e4a9d['model'];if(!_0x265a25[_0x653a('0x35')][_0x653a('0x3d')](_0x653a('0x3e'))){_0x52217a[_0x653a('0x1f')]=qs[_0x653a('0x1f')](_0x265a25['query'][_0x653a('0x1f')]);_0x52217a['offset']=qs[_0x653a('0x1e')](_0x265a25[_0x653a('0x35')][_0x653a('0x1e')]);}_0x52217a[_0x653a('0x3f')]=qs[_0x653a('0x40')](_0x265a25[_0x653a('0x35')][_0x653a('0x40')]);delete _0x265a25[_0x653a('0x35')][_0x653a('0x40')];_0x52217a[_0x653a('0x41')]=qs['filters'](_['pick'](_0x265a25[_0x653a('0x35')],_0x2e4a9d[_0x653a('0x37')]),_0x3f54c5);if(_0x265a25[_0x653a('0x35')][_0x653a('0x42')]){_0x52217a[_0x653a('0x41')]=_[_0x653a('0x43')](_0x52217a[_0x653a('0x41')],{'$or':_[_0x653a('0x30')](_0x3f54c5,function(_0x511782){if(_0x511782[_0x653a('0x33')]!==_0x653a('0x44')){var _0x1a6397={};_0x1a6397[_0x511782[_0x653a('0x2e')]]={'$like':'%'+_0x265a25[_0x653a('0x35')][_0x653a('0x42')]+'%'};return _0x1a6397;}})});}_0x52217a=_[_0x653a('0x43')]({},_0x52217a,_0x265a25['options']);var _0x564a8f={'where':_0x52217a['where']};return db['VoiceMusicOnHold'][_0x653a('0x21')](_0x564a8f)['then'](function(_0x1cd235){_0x49a582[_0x653a('0x21')]=_0x1cd235;if(_0x265a25[_0x653a('0x35')][_0x653a('0x45')]){_0x52217a[_0x653a('0x46')]=[{'all':!![]}];}return db[_0x653a('0x47')][_0x653a('0x48')](_0x52217a);})[_0x653a('0x26')](function(_0x203e3f){_0x49a582['rows']=_0x203e3f;return _0x49a582;})['then'](respondWithFilteredResult(_0x343db0,_0x52217a))['catch'](handleError(_0x343db0,null));};exports['show']=function(_0x5d2e5a,_0x447d36){var _0x4d2003={'raw':![],'where':{'id':_0x5d2e5a[_0x653a('0x49')]['id']}},_0x2a9967={};_0x2a9967[_0x653a('0x39')]=_[_0x653a('0x36')](db[_0x653a('0x47')][_0x653a('0x31')]);_0x2a9967[_0x653a('0x35')]=_['keys'](_0x5d2e5a[_0x653a('0x35')]);_0x2a9967['filters']=_['intersection'](_0x2a9967[_0x653a('0x39')],_0x2a9967['query']);_0x4d2003[_0x653a('0x3a')]=_[_0x653a('0x38')](_0x2a9967[_0x653a('0x39')],qs[_0x653a('0x3b')](_0x5d2e5a[_0x653a('0x35')][_0x653a('0x3b')]));_0x4d2003['attributes']=_0x4d2003[_0x653a('0x3a')][_0x653a('0x3c')]?_0x4d2003['attributes']:_0x2a9967['model'];if(_0x5d2e5a['query'][_0x653a('0x45')]){_0x4d2003[_0x653a('0x46')]=[{'all':!![]}];}_0x4d2003=_['merge']({},_0x4d2003,_0x5d2e5a[_0x653a('0x4a')]);return db[_0x653a('0x47')][_0x653a('0x4b')](_0x4d2003)[_0x653a('0x26')](handleEntityNotFound(_0x447d36,null))[_0x653a('0x26')](respondWithResult(_0x447d36,null))['catch'](handleError(_0x447d36,null));};exports['update']=function(_0x32a74b,_0x852a2c){if(_0x32a74b[_0x653a('0x4c')]['id']){delete _0x32a74b[_0x653a('0x4c')]['id'];}return db[_0x653a('0x47')][_0x653a('0x4b')]({'where':{'id':_0x32a74b[_0x653a('0x49')]['id']}})[_0x653a('0x26')](handleEntityNotFound(_0x852a2c,null))[_0x653a('0x26')](saveUpdates(_0x32a74b[_0x653a('0x4c')],null))[_0x653a('0x26')](respondWithResult(_0x852a2c,null))[_0x653a('0x4d')](handleError(_0x852a2c,null));};exports[_0x653a('0x4e')]=function(_0x16801b,_0x266bc0,_0x545619){return db['sequelize'][_0x653a('0x4f')](function(_0x4ca6ae){if(_0x16801b[_0x653a('0x4c')][_0x653a('0x50')]===_0x653a('0x51')){_0x16801b[_0x653a('0x4c')][_0x653a('0x52')]=path[_0x653a('0x53')](config[_0x653a('0x54')],_0x653a('0x55'),_0x16801b[_0x653a('0x4c')][_0x653a('0x2e')]);}return db[_0x653a('0x47')][_0x653a('0x4e')](_0x16801b['body'],{'transaction':_0x4ca6ae})[_0x653a('0x26')](function(_0x49517e){if(_0x16801b[_0x653a('0x4c')]['mode']===_0x653a('0x51')){fs[_0x653a('0x56')](_0x49517e['directory'],parseInt(_0x653a('0x57'),0x8));}var _0x271037=_0x16801b['user'][_0x653a('0x28')]({'plain':!![]});if(!_0x271037)throw new Error(_0x653a('0x58'));if(_0x271037[_0x653a('0x59')]==='user'){var _0x2bf8f9=_0x49517e[_0x653a('0x28')]({'plain':!![]});return db[_0x653a('0x5a')][_0x653a('0x4b')]({'where':{'name':'MusicOnHolds','userProfileId':_0x271037[_0x653a('0x5b')]},'raw':!![]})[_0x653a('0x26')](function(_0x324ae0){if(_0x324ae0&&_0x324ae0[_0x653a('0x5c')]===0x0){return db[_0x653a('0x2a')][_0x653a('0x4e')]({'name':_0x2bf8f9[_0x653a('0x2e')],'resourceId':_0x2bf8f9['id'],'type':_0x324ae0['name'],'sectionId':_0x324ae0['id']},{})[_0x653a('0x26')](function(){return _0x49517e;});}else{return _0x49517e;}})[_0x653a('0x4d')](function(_0x2f33fb){logger[_0x653a('0x2c')](_0x653a('0x5d'),_0x2f33fb);});}return _0x49517e;});})[_0x653a('0x26')](respondWithResult(_0x266bc0,0xc9))['catch'](handleError(_0x266bc0,null));};exports['destroy']=function(_0x3ca740,_0x3092e2,_0x575020){var _0x41d76e;return db['VoiceMusicOnHold'][_0x653a('0x4b')]({'where':{'id':_0x3ca740[_0x653a('0x49')]['id']}})[_0x653a('0x26')](function(_0x3a2f35){if(_0x3a2f35){return db['sequelize']['transaction'](function(_0x2179a1){return _0x3a2f35[_0x653a('0x27')]({'transaction':_0x2179a1,'raw':!![]})[_0x653a('0x26')](function(_0x5f47f0){if(_0x5f47f0[_0x653a('0x52')]){fs[_0x653a('0x5e')](_0x5f47f0[_0x653a('0x52')])['forEach'](function(_0x4d723b){fs[_0x653a('0x5f')](path[_0x653a('0x53')](_0x5f47f0['directory'],_0x4d723b));});fs[_0x653a('0x60')](_0x5f47f0[_0x653a('0x52')]);}return _0x5f47f0;});})[_0x653a('0x4d')](function(_0x5a2f90){throw new db[(_0x653a('0x61'))][(_0x653a('0x62'))](_0x5a2f90[_0x653a('0x63')]);});}})[_0x653a('0x26')](handleEntityNotFound(_0x3092e2,null))['then'](removeEntity(_0x3092e2,null))[_0x653a('0x4d')](handleError(_0x3092e2,null));};exports[_0x653a('0x64')]=function(_0x151a58,_0x2c250e,_0xe6a601){return db[_0x653a('0x65')][_0x653a('0x4f')](function(_0x2984bb){var _0x14c1f3;return db[_0x653a('0x47')][_0x653a('0x4b')]({'where':{'id':_0x151a58[_0x653a('0x49')]['id']}})['then'](function(_0x86583a){if(_0x86583a){_0x14c1f3=_0x86583a;return _0x86583a[_0x653a('0x64')](_0x151a58['body']['id'],{'transaction':_0x2984bb});}})[_0x653a('0x26')](function(_0x36099e){if(_0x36099e){return db[_0x653a('0x66')][_0x653a('0x67')]({'where':{'id':_0x151a58[_0x653a('0x4c')]['id']},'attributes':['id',_0x653a('0x2e'),_0x653a('0x68'),_0x653a('0x69'),_0x653a('0x6a')],'raw':!![]});}})['then'](function(_0x3d6406){if(_0x3d6406){var _0x255ac6=path[_0x653a('0x53')](config[_0x653a('0x54')],_0x653a('0x6b'),util['format'](_0x653a('0x6c'),path[_0x653a('0x6d')](_0x3d6406[_0x653a('0x68')],path[_0x653a('0x6e')](_0x3d6406[_0x653a('0x68')])),_0x3d6406['converted_format']));var _0x2cf0ca=path[_0x653a('0x53')](config[_0x653a('0x54')],'server/files/moh',_0x14c1f3[_0x653a('0x2e')],util[_0x653a('0x6f')](_0x653a('0x6c'),_0x3d6406[_0x653a('0x2e')],_0x3d6406['converted_format']));fs[_0x653a('0x70')](_0x255ac6,_0x2cf0ca);return _0x3d6406;}})[_0x653a('0x4d')](function(_0x22dabb){throw new db[(_0x653a('0x61'))][(_0x653a('0x62'))](_0x22dabb['message']);});})[_0x653a('0x26')](handleEntityNotFound(_0x2c250e,null))[_0x653a('0x26')](respondWithResult(_0x2c250e,0xc9))['catch'](handleError(_0x2c250e,null));};exports[_0x653a('0x71')]=function(_0x120d64,_0x448036,_0x5b39ba){return db['sequelize'][_0x653a('0x4f')](function(_0x3934b1){var _0x102b89;return db['VoiceMusicOnHold'][_0x653a('0x67')]({'where':{'id':_0x120d64[_0x653a('0x49')]['id']}})[_0x653a('0x26')](handleEntityNotFound(_0x448036,null))[_0x653a('0x26')](function(_0x4fbe80){if(_0x4fbe80){_0x102b89=_0x4fbe80;return _0x4fbe80[_0x653a('0x71')](_0x120d64[_0x653a('0x49')][_0x653a('0x72')]);}})['then'](function(_0x1c855b){if(_0x1c855b){return db[_0x653a('0x66')][_0x653a('0x67')]({'where':{'id':_0x120d64[_0x653a('0x49')][_0x653a('0x72')]},'attributes':['id',_0x653a('0x2e'),'save_name',_0x653a('0x69'),_0x653a('0x6a')],'raw':!![]});}})['then'](function(_0x2f1f33){if(_0x2f1f33){fs['unlinkSync'](path[_0x653a('0x53')](_0x102b89[_0x653a('0x52')],util['format'](_0x653a('0x6c'),_0x2f1f33[_0x653a('0x2e')],_0x2f1f33[_0x653a('0x69')])));return _0x2f1f33;}})[_0x653a('0x4d')](function(_0x1a3e0d){throw new db[(_0x653a('0x61'))][(_0x653a('0x62'))](_0x1a3e0d[_0x653a('0x63')]);});})['then'](handleEntityNotFound(_0x448036,null))[_0x653a('0x26')](respondWithStatusCode(_0x448036,0xcc))[_0x653a('0x4d')](handleError(_0x448036,null));};exports[_0x653a('0x73')]=function(_0x1c9e21,_0x3fbcea,_0x1a0497){var _0x1f7e04={};var _0x4b1e4e={};var _0x49f728;var _0x4e8400;return db[_0x653a('0x47')][_0x653a('0x67')]({'where':{'id':_0x1c9e21[_0x653a('0x49')]['id']}})[_0x653a('0x26')](handleEntityNotFound(_0x3fbcea,null))['then'](function(_0x19a93e){if(_0x19a93e){_0x49f728=_0x19a93e;_0x4b1e4e[_0x653a('0x39')]=_[_0x653a('0x36')](db[_0x653a('0x66')][_0x653a('0x31')]);_0x4b1e4e['query']=_[_0x653a('0x36')](_0x1c9e21[_0x653a('0x35')]);_0x4b1e4e[_0x653a('0x37')]=_['intersection'](_0x4b1e4e[_0x653a('0x39')],_0x4b1e4e['query']);_0x1f7e04[_0x653a('0x3a')]=_['intersection'](_0x4b1e4e['model'],qs[_0x653a('0x3b')](_0x1c9e21[_0x653a('0x35')]['fields']));_0x1f7e04[_0x653a('0x3a')]=_0x1f7e04['attributes'][_0x653a('0x3c')]?_0x1f7e04[_0x653a('0x3a')]:_0x4b1e4e[_0x653a('0x39')];_0x1f7e04[_0x653a('0x3f')]=qs['sort'](_0x1c9e21['query']['sort']);_0x1f7e04[_0x653a('0x41')]=qs[_0x653a('0x37')](_[_0x653a('0x74')](_0x1c9e21['query'],_0x4b1e4e['filters']));if(_0x1c9e21[_0x653a('0x35')][_0x653a('0x42')]){_0x1f7e04[_0x653a('0x41')]=_[_0x653a('0x43')](_0x1f7e04[_0x653a('0x41')],{'$or':_[_0x653a('0x30')](_0x1f7e04[_0x653a('0x3a')],function(_0x3aa470){var _0x1e025d={};_0x1e025d[_0x3aa470]={'$like':'%'+_0x1c9e21[_0x653a('0x35')]['filter']+'%'};return _0x1e025d;})});}_0x1f7e04=_[_0x653a('0x43')]({},_0x1f7e04,_0x1c9e21[_0x653a('0x4a')]);return _0x49f728[_0x653a('0x73')](_0x1f7e04);}})['then'](function(_0x1c01af){if(_0x1c01af){_0x4e8400=_0x1c01af[_0x653a('0x3c')];if(!_0x1c9e21[_0x653a('0x35')][_0x653a('0x3d')]('nolimit')){_0x1f7e04[_0x653a('0x1f')]=qs[_0x653a('0x1f')](_0x1c9e21['query'][_0x653a('0x1f')]);_0x1f7e04['offset']=qs['offset'](_0x1c9e21[_0x653a('0x35')][_0x653a('0x1e')]);}return _0x49f728['getSounds'](_0x1f7e04);}})[_0x653a('0x26')](function(_0x10e0f3){if(_0x10e0f3){return _0x10e0f3?{'count':_0x4e8400,'rows':_0x10e0f3}:null;}})['then'](respondWithResult(_0x3fbcea,null))[_0x653a('0x4d')](handleError(_0x3fbcea,null));};
\ No newline at end of file
+var _0xe6ba=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','destroy','then','UserProfileResource','error','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','find','body','create','sequelize','transaction','mode','files','directory','root','mkdirSync','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','message','addSound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','extname','server/files/moh','symlinkSync','Sequelize','removeSound','id2','createdAt','ValidationError','getSounds','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x15f012,_0x4cce15){var _0x3d1adf=function(_0x3363f9){while(--_0x3363f9){_0x15f012['push'](_0x15f012['shift']());}};_0x3d1adf(++_0x4cce15);}(_0xe6ba,0x1b3));var _0xae6b=function(_0x3b7994,_0x2f01e1){_0x3b7994=_0x3b7994-0x0;var _0x49bd13=_0xe6ba[_0x3b7994];return _0x49bd13;};'use strict';var emlformat=require(_0xae6b('0x0'));var rimraf=require(_0xae6b('0x1'));var zipdir=require(_0xae6b('0x2'));var jsonpatch=require(_0xae6b('0x3'));var rp=require(_0xae6b('0x4'));var moment=require(_0xae6b('0x5'));var BPromise=require(_0xae6b('0x6'));var Mustache=require(_0xae6b('0x7'));var util=require(_0xae6b('0x8'));var path=require(_0xae6b('0x9'));var sox=require(_0xae6b('0xa'));var csv=require(_0xae6b('0xb'));var ejs=require(_0xae6b('0xc'));var fs=require('fs');var fs_extra=require(_0xae6b('0xd'));var _=require('lodash');var squel=require(_0xae6b('0xe'));var crypto=require(_0xae6b('0xf'));var jsforce=require(_0xae6b('0x10'));var deskjs=require(_0xae6b('0x11'));var toCsv=require('to-csv');var querystring=require(_0xae6b('0x12'));var Papa=require(_0xae6b('0x13'));var Redis=require(_0xae6b('0x14'));var authService=require(_0xae6b('0x15'));var qs=require(_0xae6b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae6b('0x17'));var logger=require(_0xae6b('0x18'))(_0xae6b('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xae6b('0x1a'));var db=require(_0xae6b('0x1b'))['db'];function respondWithStatusCode(_0x24fe40,_0x4033d1){_0x4033d1=_0x4033d1||0xcc;return function(_0x3b44a7){if(_0x3b44a7){return _0x24fe40[_0xae6b('0x1c')](_0x4033d1);}return _0x24fe40[_0xae6b('0x1d')](_0x4033d1)[_0xae6b('0x1e')]();};}function respondWithResult(_0x509ccb,_0x2326e5){_0x2326e5=_0x2326e5||0xc8;return function(_0x186e09){if(_0x186e09){return _0x509ccb[_0xae6b('0x1d')](_0x2326e5)[_0xae6b('0x1f')](_0x186e09);}};}function respondWithFilteredResult(_0x311838,_0x19761d){return function(_0x20a423){if(_0x20a423){var _0x1eb392=typeof _0x19761d['offset']===_0xae6b('0x20')&&typeof _0x19761d[_0xae6b('0x21')]===_0xae6b('0x20');var _0x895ed3=_0x20a423['count'];var _0x131a7e=_0x1eb392?0x0:_0x19761d[_0xae6b('0x22')];var _0x4b0763=_0x1eb392?_0x20a423[_0xae6b('0x23')]:_0x19761d[_0xae6b('0x22')]+_0x19761d[_0xae6b('0x21')];var _0x46557d;if(_0x4b0763>=_0x895ed3){_0x4b0763=_0x895ed3;_0x46557d=0xc8;}else{_0x46557d=0xce;}_0x311838[_0xae6b('0x1d')](_0x46557d);return _0x311838[_0xae6b('0x24')](_0xae6b('0x25'),_0x131a7e+'-'+_0x4b0763+'/'+_0x895ed3)[_0xae6b('0x1f')](_0x20a423);}return null;};}function patchUpdates(_0x3a8c09){return function(_0x56ca93){try{jsonpatch['apply'](_0x56ca93,_0x3a8c09,!![]);}catch(_0x30c972){return BPromise[_0xae6b('0x26')](_0x30c972);}return _0x56ca93['save']();};}function saveUpdates(_0x4736e8,_0x2fe3ec){return function(_0x5a12b7){if(_0x5a12b7){return _0x5a12b7[_0xae6b('0x27')](_0x4736e8)['then'](function(_0x5dd2a7){return _0x5dd2a7;});}return null;};}function removeEntity(_0xccf6b0,_0x1badad){return function(_0x36dadd){if(_0x36dadd){return _0x36dadd[_0xae6b('0x28')]()[_0xae6b('0x29')](function(){var _0x2c0766=_0x36dadd['get']({'plain':!![]});var _0x3bf66e='MusicOnHolds';return db[_0xae6b('0x2a')]['destroy']({'where':{'type':_0x3bf66e,'resourceId':_0x2c0766['id']}})[_0xae6b('0x29')](function(){return _0x36dadd;});})[_0xae6b('0x29')](function(){_0xccf6b0[_0xae6b('0x1d')](0xcc)[_0xae6b('0x1e')]();});}};}function handleEntityNotFound(_0x55184f,_0x5e75cd){return function(_0x406328){if(!_0x406328){_0x55184f[_0xae6b('0x1c')](0x194);}return _0x406328;};}function handleError(_0x2aaede,_0x24ad6f){_0x24ad6f=_0x24ad6f||0x1f4;return function(_0x220f3d){logger[_0xae6b('0x2b')](_0x220f3d['stack']);if(_0x220f3d[_0xae6b('0x2c')]){delete _0x220f3d[_0xae6b('0x2c')];}_0x2aaede['status'](_0x24ad6f)['send'](_0x220f3d);};}exports[_0xae6b('0x2d')]=function(_0x4d3419,_0x54616d){var _0x4043ce={},_0x1b1518={},_0x136117={'count':0x0,'rows':[]};var _0x5155d7=_[_0xae6b('0x2e')](db[_0xae6b('0x2f')][_0xae6b('0x30')],function(_0xf001e){return{'name':_0xf001e[_0xae6b('0x31')],'type':_0xf001e[_0xae6b('0x32')][_0xae6b('0x33')]};});_0x1b1518[_0xae6b('0x34')]=_[_0xae6b('0x2e')](_0x5155d7,_0xae6b('0x2c'));_0x1b1518[_0xae6b('0x35')]=_['keys'](_0x4d3419[_0xae6b('0x35')]);_0x1b1518[_0xae6b('0x36')]=_[_0xae6b('0x37')](_0x1b1518['model'],_0x1b1518['query']);_0x4043ce['attributes']=_[_0xae6b('0x37')](_0x1b1518['model'],qs['fields'](_0x4d3419['query'][_0xae6b('0x38')]));_0x4043ce[_0xae6b('0x39')]=_0x4043ce['attributes'][_0xae6b('0x3a')]?_0x4043ce[_0xae6b('0x39')]:_0x1b1518['model'];if(!_0x4d3419[_0xae6b('0x35')][_0xae6b('0x3b')](_0xae6b('0x3c'))){_0x4043ce[_0xae6b('0x21')]=qs['limit'](_0x4d3419[_0xae6b('0x35')]['limit']);_0x4043ce[_0xae6b('0x22')]=qs[_0xae6b('0x22')](_0x4d3419[_0xae6b('0x35')]['offset']);}_0x4043ce[_0xae6b('0x3d')]=qs['sort'](_0x4d3419[_0xae6b('0x35')]['sort']);delete _0x4d3419[_0xae6b('0x35')][_0xae6b('0x3e')];_0x4043ce['where']=qs[_0xae6b('0x36')](_['pick'](_0x4d3419[_0xae6b('0x35')],_0x1b1518['filters']),_0x5155d7);if(_0x4d3419[_0xae6b('0x35')]['filter']){_0x4043ce[_0xae6b('0x3f')]=_[_0xae6b('0x40')](_0x4043ce[_0xae6b('0x3f')],{'$or':_[_0xae6b('0x2e')](_0x5155d7,function(_0xaaf209){if(_0xaaf209[_0xae6b('0x32')]!==_0xae6b('0x41')){var _0x17b9a9={};_0x17b9a9[_0xaaf209[_0xae6b('0x2c')]]={'$like':'%'+_0x4d3419[_0xae6b('0x35')][_0xae6b('0x42')]+'%'};return _0x17b9a9;}})});}_0x4043ce=_[_0xae6b('0x40')]({},_0x4043ce,_0x4d3419[_0xae6b('0x43')]);var _0x164a6a={'where':_0x4043ce[_0xae6b('0x3f')]};return db[_0xae6b('0x2f')]['count'](_0x164a6a)[_0xae6b('0x29')](function(_0x4c8d5c){_0x136117[_0xae6b('0x23')]=_0x4c8d5c;if(_0x4d3419['query']['includeAll']){_0x4043ce[_0xae6b('0x44')]=[{'all':!![]}];}return db[_0xae6b('0x2f')]['findAll'](_0x4043ce);})[_0xae6b('0x29')](function(_0x508c39){_0x136117[_0xae6b('0x45')]=_0x508c39;return _0x136117;})['then'](respondWithFilteredResult(_0x54616d,_0x4043ce))[_0xae6b('0x46')](handleError(_0x54616d,null));};exports[_0xae6b('0x47')]=function(_0x567a86,_0x5315da){var _0x4ecddc={'raw':![],'where':{'id':_0x567a86[_0xae6b('0x48')]['id']}},_0x165b91={};_0x165b91[_0xae6b('0x34')]=_[_0xae6b('0x49')](db[_0xae6b('0x2f')][_0xae6b('0x30')]);_0x165b91[_0xae6b('0x35')]=_['keys'](_0x567a86[_0xae6b('0x35')]);_0x165b91[_0xae6b('0x36')]=_[_0xae6b('0x37')](_0x165b91[_0xae6b('0x34')],_0x165b91['query']);_0x4ecddc[_0xae6b('0x39')]=_[_0xae6b('0x37')](_0x165b91[_0xae6b('0x34')],qs[_0xae6b('0x38')](_0x567a86['query'][_0xae6b('0x38')]));_0x4ecddc[_0xae6b('0x39')]=_0x4ecddc[_0xae6b('0x39')][_0xae6b('0x3a')]?_0x4ecddc['attributes']:_0x165b91[_0xae6b('0x34')];if(_0x567a86['query']['includeAll']){_0x4ecddc[_0xae6b('0x44')]=[{'all':!![]}];}_0x4ecddc=_[_0xae6b('0x40')]({},_0x4ecddc,_0x567a86['options']);return db[_0xae6b('0x2f')][_0xae6b('0x4a')](_0x4ecddc)['then'](handleEntityNotFound(_0x5315da,null))[_0xae6b('0x29')](respondWithResult(_0x5315da,null))['catch'](handleError(_0x5315da,null));};exports[_0xae6b('0x27')]=function(_0x26e555,_0x3380c2){if(_0x26e555[_0xae6b('0x4b')]['id']){delete _0x26e555[_0xae6b('0x4b')]['id'];}return db['VoiceMusicOnHold'][_0xae6b('0x4a')]({'where':{'id':_0x26e555[_0xae6b('0x48')]['id']}})['then'](handleEntityNotFound(_0x3380c2,null))[_0xae6b('0x29')](saveUpdates(_0x26e555['body'],null))[_0xae6b('0x29')](respondWithResult(_0x3380c2,null))[_0xae6b('0x46')](handleError(_0x3380c2,null));};exports[_0xae6b('0x4c')]=function(_0x5a6f1f,_0x126ae7,_0x5169b5){return db[_0xae6b('0x4d')][_0xae6b('0x4e')](function(_0x15393){if(_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x4f')]===_0xae6b('0x50')){_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x51')]=path['join'](config[_0xae6b('0x52')],'server/files/moh',_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x2c')]);}return db[_0xae6b('0x2f')][_0xae6b('0x4c')](_0x5a6f1f[_0xae6b('0x4b')],{'transaction':_0x15393})[_0xae6b('0x29')](function(_0x1a355a){if(_0x5a6f1f[_0xae6b('0x4b')][_0xae6b('0x4f')]===_0xae6b('0x50')){fs[_0xae6b('0x53')](_0x1a355a[_0xae6b('0x51')],parseInt(_0xae6b('0x54'),0x8));}var _0x1b4b65=_0x5a6f1f['user'][_0xae6b('0x55')]({'plain':!![]});if(!_0x1b4b65)throw new Error(_0xae6b('0x56'));if(_0x1b4b65['role']===_0xae6b('0x57')){var _0x90b798=_0x1a355a['get']({'plain':!![]});return db[_0xae6b('0x58')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x1b4b65[_0xae6b('0x59')]},'raw':!![]})[_0xae6b('0x29')](function(_0x8736ae){if(_0x8736ae&&_0x8736ae['autoAssociation']===0x0){return db[_0xae6b('0x2a')][_0xae6b('0x4c')]({'name':_0x90b798[_0xae6b('0x2c')],'resourceId':_0x90b798['id'],'type':_0x8736ae[_0xae6b('0x2c')],'sectionId':_0x8736ae['id']},{})[_0xae6b('0x29')](function(){return _0x1a355a;});}else{return _0x1a355a;}})[_0xae6b('0x46')](function(_0x400957){logger[_0xae6b('0x2b')](_0xae6b('0x5a'),_0x400957);});}return _0x1a355a;});})[_0xae6b('0x29')](respondWithResult(_0x126ae7,0xc9))[_0xae6b('0x46')](handleError(_0x126ae7,null));};exports[_0xae6b('0x28')]=function(_0x396d20,_0x5c2982,_0x3d6003){var _0x5168fe;return db[_0xae6b('0x2f')][_0xae6b('0x4a')]({'where':{'id':_0x396d20[_0xae6b('0x48')]['id']}})[_0xae6b('0x29')](function(_0x3d23d3){if(_0x3d23d3){return db['sequelize']['transaction'](function(_0x566bcc){return _0x3d23d3['destroy']({'transaction':_0x566bcc,'raw':!![]})[_0xae6b('0x29')](function(_0x1f8a13){if(_0x1f8a13[_0xae6b('0x51')]){fs['readdirSync'](_0x1f8a13['directory'])['forEach'](function(_0x49a6ab){fs['unlinkSync'](path[_0xae6b('0x5b')](_0x1f8a13[_0xae6b('0x51')],_0x49a6ab));});fs['rmdirSync'](_0x1f8a13[_0xae6b('0x51')]);}return _0x1f8a13;});})[_0xae6b('0x46')](function(_0xbf4482){throw new db['Sequelize']['ValidationError'](_0xbf4482[_0xae6b('0x5c')]);});}})[_0xae6b('0x29')](handleEntityNotFound(_0x5c2982,null))[_0xae6b('0x29')](removeEntity(_0x5c2982,null))[_0xae6b('0x46')](handleError(_0x5c2982,null));};exports['addSound']=function(_0x5a7464,_0x4aee2c,_0x16ce64){return db[_0xae6b('0x4d')][_0xae6b('0x4e')](function(_0x2fc1e9){var _0x1a527b;return db[_0xae6b('0x2f')][_0xae6b('0x4a')]({'where':{'id':_0x5a7464['params']['id']}})[_0xae6b('0x29')](function(_0x1cce8d){if(_0x1cce8d){_0x1a527b=_0x1cce8d;return _0x1cce8d[_0xae6b('0x5d')](_0x5a7464[_0xae6b('0x4b')]['id'],{'transaction':_0x2fc1e9});}})[_0xae6b('0x29')](function(_0x1a80b1){if(_0x1a80b1){return db['Sound'][_0xae6b('0x5e')]({'where':{'id':_0x5a7464['body']['id']},'attributes':['id','name',_0xae6b('0x5f'),_0xae6b('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0x1518a5){if(_0x1518a5){var _0x21eb57=path[_0xae6b('0x5b')](config[_0xae6b('0x52')],_0xae6b('0x61'),util[_0xae6b('0x62')](_0xae6b('0x63'),path['basename'](_0x1518a5[_0xae6b('0x5f')],path[_0xae6b('0x64')](_0x1518a5[_0xae6b('0x5f')])),_0x1518a5[_0xae6b('0x60')]));var _0x4ff2c8=path[_0xae6b('0x5b')](config['root'],_0xae6b('0x65'),_0x1a527b[_0xae6b('0x2c')],util[_0xae6b('0x62')](_0xae6b('0x63'),_0x1518a5['name'],_0x1518a5[_0xae6b('0x60')]));fs[_0xae6b('0x66')](_0x21eb57,_0x4ff2c8);return _0x1518a5;}})['catch'](function(_0x5f14c0){throw new db[(_0xae6b('0x67'))]['ValidationError'](_0x5f14c0[_0xae6b('0x5c')]);});})[_0xae6b('0x29')](handleEntityNotFound(_0x4aee2c,null))[_0xae6b('0x29')](respondWithResult(_0x4aee2c,0xc9))[_0xae6b('0x46')](handleError(_0x4aee2c,null));};exports['removeSound']=function(_0x23808f,_0x3a3660,_0xe2342d){return db[_0xae6b('0x4d')][_0xae6b('0x4e')](function(_0x132950){var _0x1baca1;return db[_0xae6b('0x2f')][_0xae6b('0x5e')]({'where':{'id':_0x23808f[_0xae6b('0x48')]['id']}})[_0xae6b('0x29')](handleEntityNotFound(_0x3a3660,null))['then'](function(_0x4619ff){if(_0x4619ff){_0x1baca1=_0x4619ff;return _0x4619ff[_0xae6b('0x68')](_0x23808f[_0xae6b('0x48')][_0xae6b('0x69')]);}})['then'](function(_0x5b0b5d){if(_0x5b0b5d){return db['Sound']['findOne']({'where':{'id':_0x23808f['params']['id2']},'attributes':['id',_0xae6b('0x2c'),_0xae6b('0x5f'),_0xae6b('0x60'),_0xae6b('0x6a')],'raw':!![]});}})[_0xae6b('0x29')](function(_0x48415a){if(_0x48415a){fs['unlinkSync'](path[_0xae6b('0x5b')](_0x1baca1[_0xae6b('0x51')],util[_0xae6b('0x62')]('%s.%s',_0x48415a[_0xae6b('0x2c')],_0x48415a['converted_format'])));return _0x48415a;}})[_0xae6b('0x46')](function(_0x3e9af9){throw new db['Sequelize'][(_0xae6b('0x6b'))](_0x3e9af9[_0xae6b('0x5c')]);});})[_0xae6b('0x29')](handleEntityNotFound(_0x3a3660,null))[_0xae6b('0x29')](respondWithStatusCode(_0x3a3660,0xcc))['catch'](handleError(_0x3a3660,null));};exports[_0xae6b('0x6c')]=function(_0x523f11,_0x5d0fe3,_0x204c8e){var _0x48be5b={};var _0x3190fc={};var _0x8a6c6b;var _0x3df269;return db[_0xae6b('0x2f')]['findOne']({'where':{'id':_0x523f11['params']['id']}})[_0xae6b('0x29')](handleEntityNotFound(_0x5d0fe3,null))[_0xae6b('0x29')](function(_0x184322){if(_0x184322){_0x8a6c6b=_0x184322;_0x3190fc['model']=_[_0xae6b('0x49')](db['Sound'][_0xae6b('0x30')]);_0x3190fc['query']=_[_0xae6b('0x49')](_0x523f11['query']);_0x3190fc['filters']=_[_0xae6b('0x37')](_0x3190fc[_0xae6b('0x34')],_0x3190fc[_0xae6b('0x35')]);_0x48be5b[_0xae6b('0x39')]=_[_0xae6b('0x37')](_0x3190fc['model'],qs['fields'](_0x523f11['query'][_0xae6b('0x38')]));_0x48be5b[_0xae6b('0x39')]=_0x48be5b[_0xae6b('0x39')][_0xae6b('0x3a')]?_0x48be5b['attributes']:_0x3190fc[_0xae6b('0x34')];_0x48be5b[_0xae6b('0x3d')]=qs[_0xae6b('0x3e')](_0x523f11[_0xae6b('0x35')][_0xae6b('0x3e')]);_0x48be5b['where']=qs[_0xae6b('0x36')](_[_0xae6b('0x6d')](_0x523f11[_0xae6b('0x35')],_0x3190fc[_0xae6b('0x36')]));if(_0x523f11[_0xae6b('0x35')][_0xae6b('0x42')]){_0x48be5b[_0xae6b('0x3f')]=_[_0xae6b('0x40')](_0x48be5b[_0xae6b('0x3f')],{'$or':_[_0xae6b('0x2e')](_0x48be5b[_0xae6b('0x39')],function(_0x5be2e2){var _0xc82add={};_0xc82add[_0x5be2e2]={'$like':'%'+_0x523f11[_0xae6b('0x35')]['filter']+'%'};return _0xc82add;})});}_0x48be5b=_[_0xae6b('0x40')]({},_0x48be5b,_0x523f11[_0xae6b('0x43')]);return _0x8a6c6b[_0xae6b('0x6c')](_0x48be5b);}})[_0xae6b('0x29')](function(_0x1d87ab){if(_0x1d87ab){_0x3df269=_0x1d87ab[_0xae6b('0x3a')];if(!_0x523f11['query'][_0xae6b('0x3b')](_0xae6b('0x3c'))){_0x48be5b['limit']=qs['limit'](_0x523f11['query'][_0xae6b('0x21')]);_0x48be5b[_0xae6b('0x22')]=qs['offset'](_0x523f11[_0xae6b('0x35')]['offset']);}return _0x8a6c6b[_0xae6b('0x6c')](_0x48be5b);}})[_0xae6b('0x29')](function(_0x5e395e){if(_0x5e395e){return _0x5e395e?{'count':_0x3df269,'rows':_0x5e395e}:null;}})[_0xae6b('0x29')](respondWithResult(_0x5d0fe3,null))[_0xae6b('0x46')](handleError(_0x5d0fe3,null));};
\ No newline at end of file
index bbd2526..fc78c49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7503=['define','VoiceMusicOnHold','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7503,0x157));var _0x3750=function(_0x317725,_0x1bd734){_0x317725=_0x317725-0x0;var _0x1e08cb=_0x7503[_0x317725];return _0x1e08cb;};'use strict';var _=require('lodash');var util=require(_0x3750('0x0'));var logger=require(_0x3750('0x1'))(_0x3750('0x2'));var moment=require(_0x3750('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3750('0x4'));var rimraf=require(_0x3750('0x5'));var config=require(_0x3750('0x6'));var attributes=require(_0x3750('0x7'));module[_0x3750('0x8')]=function(_0x45df91,_0x417559){return _0x45df91[_0x3750('0x9')](_0x3750('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6907=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util','api'];(function(_0x4a3e2e,_0x46ad17){var _0x4a56c7=function(_0x5531ce){while(--_0x5531ce){_0x4a3e2e['push'](_0x4a3e2e['shift']());}};_0x4a56c7(++_0x46ad17);}(_0x6907,0x171));var _0x7690=function(_0x49d4f0,_0x3f590c){_0x49d4f0=_0x49d4f0-0x0;var _0x4ec315=_0x6907[_0x49d4f0];return _0x4ec315;};'use strict';var _=require(_0x7690('0x0'));var util=require(_0x7690('0x1'));var logger=require('../../config/logger')(_0x7690('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7690('0x3'));var fs=require('fs');var path=require(_0x7690('0x4'));var rimraf=require(_0x7690('0x5'));var config=require(_0x7690('0x6'));var attributes=require(_0x7690('0x7'));module[_0x7690('0x8')]=function(_0x8fb8c2,_0x182d8){return _0x8fb8c2[_0x7690('0x9')](_0x7690('0xa'),attributes,{'tableName':_0x7690('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e29c9b..cb1ceb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x4a1111,_0x23cb82){var _0x15c9ee=function(_0x2b3953){while(--_0x2b3953){_0x4a1111['push'](_0x4a1111['shift']());}};_0x15c9ee(++_0x23cb82);}(_0xedd9,0xfc));var _0x9edd=function(_0x220c91,_0x1f00d3){_0x220c91=_0x220c91-0x0;var _0x2dcef=_0xedd9[_0x220c91];return _0x2dcef;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
+var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0x497b9b,_0x1a4a31){var _0x2f766c=function(_0x15ddf0){while(--_0x15ddf0){_0x497b9b['push'](_0x497b9b['shift']());}};_0x2f766c(++_0x1a4a31);}(_0xedd9,0xfc));var _0x9edd=function(_0x34d8f2,_0x57f54d){_0x34d8f2=_0x34d8f2-0x0;var _0x361f7c=_0xedd9[_0x34d8f2];return _0x361f7c;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});}
\ No newline at end of file
index 2a4d6fb..beda3c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e9d=['express','Router','fs-extra','../../components/interaction/service','get','/describe','isAuthenticated','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout'];(function(_0x2928c8,_0x1d11d5){var _0x1562bd=function(_0x2b3c9a){while(--_0x2b3c9a){_0x2928c8['push'](_0x2928c8['shift']());}};_0x1562bd(++_0x1d11d5);}(_0x1e9d,0x1dd));var _0xd1e9=function(_0x5389f6,_0x286ff3){_0x5389f6=_0x5389f6-0x0;var _0xcc48de=_0x1e9d[_0x5389f6];return _0xcc48de;};'use strict';var multer=require(_0xd1e9('0x0'));var util=require('util');var path=require(_0xd1e9('0x1'));var timeout=require(_0xd1e9('0x2'));var express=require(_0xd1e9('0x3'));var router=express[_0xd1e9('0x4')]();var fs_extra=require(_0xd1e9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd1e9('0x6'));var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd1e9('0x7')](_0xd1e9('0x8'),auth[_0xd1e9('0x9')](),controller['describe']);router[_0xd1e9('0x7')]('/:id',auth[_0xd1e9('0x9')](),controller[_0xd1e9('0xa')]);router[_0xd1e9('0x7')](_0xd1e9('0xb'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0xc')]);router[_0xd1e9('0x7')](_0xd1e9('0xd'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0xe')]);router[_0xd1e9('0xf')]('/',auth['isAuthenticated'](),controller[_0xd1e9('0x10')]);router[_0xd1e9('0xf')](_0xd1e9('0xb'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x11')]);router['post'](_0xd1e9('0xd'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x12')]);router[_0xd1e9('0x13')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd1e9('0x14')]('/:id',auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x15')]);router[_0xd1e9('0x14')](_0xd1e9('0xb'),auth[_0xd1e9('0x9')](),controller[_0xd1e9('0x16')]);router[_0xd1e9('0x14')](_0xd1e9('0xd'),auth['isAuthenticated'](),controller['removeTeams']);module[_0xd1e9('0x17')]=router;
\ No newline at end of file
+var _0x02ef=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/users','/:id/teams','create','post','addAgents','put','update','delete','removeAgents','removeTeams','exports','multer','path','express','Router'];(function(_0x1b82bb,_0xd2669c){var _0x25d568=function(_0x124098){while(--_0x124098){_0x1b82bb['push'](_0x1b82bb['shift']());}};_0x25d568(++_0xd2669c);}(_0x02ef,0x11a));var _0xf02e=function(_0x2a83af,_0x4fa9ed){_0x2a83af=_0x2a83af-0x0;var _0x2e1648=_0x02ef[_0x2a83af];return _0x2e1648;};'use strict';var multer=require(_0xf02e('0x0'));var util=require('util');var path=require(_0xf02e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf02e('0x2'));var router=express[_0xf02e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf02e('0x4'));var interaction=require(_0xf02e('0x5'));var config=require(_0xf02e('0x6'));var controller=require(_0xf02e('0x7'));router[_0xf02e('0x8')]('/',auth['isAuthenticated'](),controller[_0xf02e('0x9')]);router[_0xf02e('0x8')](_0xf02e('0xa'),auth[_0xf02e('0xb')](),controller[_0xf02e('0xc')]);router[_0xf02e('0x8')](_0xf02e('0xd'),auth[_0xf02e('0xb')](),controller[_0xf02e('0xe')]);router[_0xf02e('0x8')](_0xf02e('0xf'),auth[_0xf02e('0xb')](),controller['getAgents']);router['get'](_0xf02e('0x10'),auth[_0xf02e('0xb')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller[_0xf02e('0x11')]);router[_0xf02e('0x12')](_0xf02e('0xf'),auth[_0xf02e('0xb')](),controller[_0xf02e('0x13')]);router[_0xf02e('0x12')]('/:id/teams',auth[_0xf02e('0xb')](),controller['addTeams']);router[_0xf02e('0x14')](_0xf02e('0xd'),auth['isAuthenticated'](),controller[_0xf02e('0x15')]);router[_0xf02e('0x16')]('/:id',auth[_0xf02e('0xb')](),controller['destroy']);router[_0xf02e('0x16')](_0xf02e('0xf'),auth[_0xf02e('0xb')](),controller[_0xf02e('0x17')]);router[_0xf02e('0x16')]('/:id/teams',auth[_0xf02e('0xb')](),controller[_0xf02e('0x18')]);module[_0xf02e('0x19')]=router;
\ No newline at end of file
index 58e6b99..21728c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82ab=['INTEGER','name','VIRTUAL','getDataValue','STRING'];(function(_0x5690a4,_0x572d64){var _0x170f91=function(_0x5458c1){while(--_0x5458c1){_0x5690a4['push'](_0x5690a4['shift']());}};_0x170f91(++_0x572d64);}(_0x82ab,0x128));var _0xb82a=function(_0x3ba748,_0x4b8fb9){_0x3ba748=_0x3ba748-0x0;var _0x5b04e2=_0x82ab[_0x3ba748];return _0x5b04e2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb82a('0x0')},'prefix':{'type':Sequelize[_0xb82a('0x1')],'get':function(_0xc872ae){return'system-'+this[_0xb82a('0x2')](_0xb82a('0x0'))+'-';}},'description':{'type':Sequelize[_0xb82a('0x3')]},'callerIdAll':{'type':Sequelize[_0xb82a('0x3')]},'VoiceExtensionId':{'type':Sequelize[_0xb82a('0x4')]}};
\ No newline at end of file
+var _0x06b7=['STRING','VIRTUAL','system-'];(function(_0x49e0ca,_0x511b18){var _0x3c7e51=function(_0x3c2e8e){while(--_0x3c2e8e){_0x49e0ca['push'](_0x49e0ca['shift']());}};_0x3c7e51(++_0x511b18);}(_0x06b7,0x7b));var _0x706b=function(_0x49cb92,_0x3c31a6){_0x49cb92=_0x49cb92-0x0;var _0x16ee5a=_0x06b7[_0x49cb92];return _0x16ee5a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x706b('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x706b('0x1')],'get':function(_0x280c46){return _0x706b('0x2')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0x706b('0x0')]},'callerIdAll':{'type':Sequelize[_0x706b('0x0')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 4c21da1..01da666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','keys','include','find','create','sequelize','transaction','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','exten','system','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','get','Extensions\x20creation\x20failed','prefix','push','callerIdAll','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','length','charAt','system-','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','getTeams','addTeams','Team','findAll','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','query'];(function(_0x16e73e,_0x4f70c5){var _0x37068d=function(_0x4d8815){while(--_0x4d8815){_0x16e73e['push'](_0x16e73e['shift']());}};_0x37068d(++_0x4f70c5);}(_0x0972,0x64));var _0x2097=function(_0x39e62e,_0x4aed50){_0x39e62e=_0x39e62e-0x0;var _0x3d09e7=_0x0972[_0x39e62e];return _0x3d09e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2097('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2097('0x1'));var rp=require('request-promise');var moment=require(_0x2097('0x2'));var BPromise=require(_0x2097('0x3'));var Mustache=require('mustache');var util=require(_0x2097('0x4'));var path=require(_0x2097('0x5'));var sox=require(_0x2097('0x6'));var csv=require(_0x2097('0x7'));var ejs=require(_0x2097('0x8'));var fs=require('fs');var fs_extra=require(_0x2097('0x9'));var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x7'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var licenseUtil=require(_0x2097('0x18'));var db=require(_0x2097('0x19'))['db'];config[_0x2097('0x1a')]=_[_0x2097('0x1b')](config[_0x2097('0x1a')],{'host':_0x2097('0x1c'),'port':0x18eb});var socket=require(_0x2097('0x1d'))(new Redis(config[_0x2097('0x1a')]));require(_0x2097('0x1e'))[_0x2097('0x1f')](socket);function respondWithStatusCode(_0x354387,_0x5d0a43){_0x5d0a43=_0x5d0a43||0xcc;return function(_0x639c14){if(_0x639c14){return _0x354387[_0x2097('0x20')](_0x5d0a43);}return _0x354387['status'](_0x5d0a43)['end']();};}function respondWithResult(_0x4fc8c5,_0x409deb){_0x409deb=_0x409deb||0xc8;return function(_0x588396){if(_0x588396){return _0x4fc8c5[_0x2097('0x21')](_0x409deb)[_0x2097('0x22')](_0x588396);}};}function respondWithFilteredResult(_0x43fec9,_0x1347e4){return function(_0x44c584){if(_0x44c584){var _0x53e2b4=typeof _0x1347e4[_0x2097('0x23')]===_0x2097('0x24')&&typeof _0x1347e4[_0x2097('0x25')]===_0x2097('0x24');var _0x1d3804=_0x44c584[_0x2097('0x26')];var _0x253f5d=_0x53e2b4?0x0:_0x1347e4[_0x2097('0x23')];var _0x5d8b9e=_0x53e2b4?_0x44c584['count']:_0x1347e4[_0x2097('0x23')]+_0x1347e4['limit'];var _0x227c00;if(_0x5d8b9e>=_0x1d3804){_0x5d8b9e=_0x1d3804;_0x227c00=0xc8;}else{_0x227c00=0xce;}_0x43fec9[_0x2097('0x21')](_0x227c00);return _0x43fec9['set'](_0x2097('0x27'),_0x253f5d+'-'+_0x5d8b9e+'/'+_0x1d3804)['json'](_0x44c584);}return null;};}function patchUpdates(_0x2e17c8){return function(_0xf32d3f){try{jsonpatch[_0x2097('0x28')](_0xf32d3f,_0x2e17c8,!![]);}catch(_0x20b93a){return BPromise[_0x2097('0x29')](_0x20b93a);}return _0xf32d3f[_0x2097('0x2a')]();};}function saveUpdates(_0x56390a,_0xae5f9){return function(_0x500234){if(_0x500234){return _0x500234[_0x2097('0x2b')](_0x56390a)[_0x2097('0x2c')](function(_0x345875){return _0x345875;});}return null;};}function removeEntity(_0x9f59bc,_0x499988){return function(_0x2d683a){if(_0x2d683a){return _0x2d683a[_0x2097('0x2d')]()['then'](function(){var _0x1229fc=_0x2d683a['get']({'plain':!![]});var _0x29b879='VoicePrefixes';return db[_0x2097('0x2e')][_0x2097('0x2d')]({'where':{'type':_0x29b879,'resourceId':_0x1229fc['id']}})[_0x2097('0x2c')](function(){return _0x2d683a;});})[_0x2097('0x2c')](function(){_0x9f59bc[_0x2097('0x21')](0xcc)[_0x2097('0x2f')]();});}};}function handleEntityNotFound(_0x450e0b,_0x4b443d){return function(_0x11242f){if(!_0x11242f){_0x450e0b[_0x2097('0x20')](0x194);}return _0x11242f;};}function handleError(_0x5cce55,_0x1398d0){_0x1398d0=_0x1398d0||0x1f4;return function(_0x41487d){logger['error'](_0x41487d['stack']);if(_0x41487d[_0x2097('0x30')]){delete _0x41487d[_0x2097('0x30')];}_0x5cce55[_0x2097('0x21')](_0x1398d0)[_0x2097('0x31')](_0x41487d);};}exports[_0x2097('0x32')]=function(_0x180654,_0x56c538){var _0xe1a381={},_0x56bb42={},_0x193160={'count':0x0,'rows':[]};var _0x3c36d3=_[_0x2097('0x33')](db[_0x2097('0x34')][_0x2097('0x35')],function(_0x395d9f){return{'name':_0x395d9f[_0x2097('0x36')],'type':_0x395d9f[_0x2097('0x37')][_0x2097('0x38')]};});_0x56bb42['model']=_[_0x2097('0x33')](_0x3c36d3,_0x2097('0x30'));_0x56bb42[_0x2097('0x39')]=_['keys'](_0x180654[_0x2097('0x39')]);_0x56bb42[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x56bb42[_0x2097('0x3c')],_0x56bb42['query']);_0xe1a381['attributes']=_['intersection'](_0x56bb42[_0x2097('0x3c')],qs[_0x2097('0x3d')](_0x180654[_0x2097('0x39')][_0x2097('0x3d')]));_0xe1a381[_0x2097('0x3e')]=_0xe1a381[_0x2097('0x3e')]['length']?_0xe1a381[_0x2097('0x3e')]:_0x56bb42[_0x2097('0x3c')];if(!_0x180654[_0x2097('0x39')][_0x2097('0x3f')](_0x2097('0x40'))){_0xe1a381[_0x2097('0x25')]=qs['limit'](_0x180654[_0x2097('0x39')][_0x2097('0x25')]);_0xe1a381[_0x2097('0x23')]=qs['offset'](_0x180654['query'][_0x2097('0x23')]);}_0xe1a381[_0x2097('0x41')]=qs[_0x2097('0x42')](_0x180654[_0x2097('0x39')][_0x2097('0x42')]);_0xe1a381[_0x2097('0x43')]=qs[_0x2097('0x3a')](_[_0x2097('0x44')](_0x180654[_0x2097('0x39')],_0x56bb42[_0x2097('0x3a')]),_0x3c36d3);if(_0x180654[_0x2097('0x39')][_0x2097('0x45')]){_0xe1a381['where']=_[_0x2097('0x46')](_0xe1a381[_0x2097('0x43')],{'$or':_[_0x2097('0x33')](_0x3c36d3,function(_0x483900){if(_0x483900[_0x2097('0x37')]!==_0x2097('0x47')){var _0x26d448={};_0x26d448[_0x483900[_0x2097('0x30')]]={'$like':'%'+_0x180654[_0x2097('0x39')][_0x2097('0x45')]+'%'};return _0x26d448;}})});}_0xe1a381=_[_0x2097('0x46')]({},_0xe1a381,_0x180654[_0x2097('0x48')]);var _0x5ab893={'where':_0xe1a381[_0x2097('0x43')]};return db[_0x2097('0x34')][_0x2097('0x26')](_0x5ab893)[_0x2097('0x2c')](function(_0x12e0e2){_0x193160[_0x2097('0x26')]=_0x12e0e2;if(_0x180654[_0x2097('0x39')][_0x2097('0x49')]){_0xe1a381['include']=[{'all':!![]}];}return db[_0x2097('0x34')]['findAll'](_0xe1a381);})[_0x2097('0x2c')](function(_0x298e49){_0x193160[_0x2097('0x4a')]=_0x298e49;return _0x193160;})[_0x2097('0x2c')](respondWithFilteredResult(_0x56c538,_0xe1a381))[_0x2097('0x4b')](handleError(_0x56c538,null));};exports['show']=function(_0x2cf34e,_0x46ccbb){var _0x113c3b={'raw':![],'where':{'id':_0x2cf34e[_0x2097('0x4c')]['id']}},_0x39e0a4={};_0x39e0a4['model']=_[_0x2097('0x4d')](db[_0x2097('0x34')][_0x2097('0x35')]);_0x39e0a4[_0x2097('0x39')]=_[_0x2097('0x4d')](_0x2cf34e[_0x2097('0x39')]);_0x39e0a4[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x39e0a4['model'],_0x39e0a4[_0x2097('0x39')]);_0x113c3b[_0x2097('0x3e')]=_[_0x2097('0x3b')](_0x39e0a4[_0x2097('0x3c')],qs['fields'](_0x2cf34e['query']['fields']));_0x113c3b[_0x2097('0x3e')]=_0x113c3b[_0x2097('0x3e')]['length']?_0x113c3b[_0x2097('0x3e')]:_0x39e0a4[_0x2097('0x3c')];if(_0x2cf34e['query']['includeAll']){_0x113c3b[_0x2097('0x4e')]=[{'all':!![]}];}_0x113c3b=_[_0x2097('0x46')]({},_0x113c3b,_0x2cf34e[_0x2097('0x48')]);return db['VoicePrefix'][_0x2097('0x4f')](_0x113c3b)[_0x2097('0x2c')](handleEntityNotFound(_0x46ccbb,null))['then'](respondWithResult(_0x46ccbb,null))[_0x2097('0x4b')](handleError(_0x46ccbb,null));};exports[_0x2097('0x2d')]=function(_0xdfea21,_0xba6ef0){return db[_0x2097('0x34')]['find']({'where':{'id':_0xdfea21['params']['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0xba6ef0,null))[_0x2097('0x2c')](removeEntity(_0xba6ef0,null))[_0x2097('0x4b')](handleError(_0xba6ef0,null));};exports['describe']=function(_0x5c1739,_0x144719){return db[_0x2097('0x34')]['describe']()[_0x2097('0x2c')](respondWithResult(_0x144719,null))[_0x2097('0x4b')](handleError(_0x144719,null));};exports[_0x2097('0x50')]=function(_0x33490e,_0x390a52){var _0x4a709a;return db[_0x2097('0x51')][_0x2097('0x52')](function(_0x190859){return db['VoicePrefix'][_0x2097('0x50')](_0x33490e[_0x2097('0x53')],{'transaction':_0x190859})['then'](function(_0x12ba76){_0x4a709a=_0x12ba76['get']({'plain':!![]});return db[_0x2097('0x54')]['find']({'where':{'id':_0x4a709a['VoiceExtensionId']},'raw':!![]})['then'](function(_0x40cbe1){return createVoicePrefixExtensions(_0x4a709a,_0x40cbe1,_0x190859);});});})['then'](function(){var _0x54bea1=_0x33490e[_0x2097('0x55')]['get']({'plain':!![]});if(!_0x54bea1)throw new Error(_0x2097('0x56'));if(_0x54bea1[_0x2097('0x57')]==='user'){var _0x3e799f=_0x4a709a;return db[_0x2097('0x58')][_0x2097('0x4f')]({'where':{'name':_0x2097('0x59'),'userProfileId':_0x54bea1[_0x2097('0x5a')]},'raw':!![]})['then'](function(_0x2117e3){if(_0x2117e3&&_0x2117e3['autoAssociation']===0x0){return db[_0x2097('0x2e')][_0x2097('0x50')]({'name':_0x3e799f[_0x2097('0x30')],'resourceId':_0x3e799f['id'],'type':_0x2117e3['name'],'sectionId':_0x2117e3['id']},{})[_0x2097('0x2c')](function(){return _0x4a709a;});}else{return _0x4a709a;}})[_0x2097('0x4b')](function(_0x2f5016){logger[_0x2097('0x5b')](_0x2097('0x5c'),_0x2f5016);throw _0x2f5016;});}return _0x4a709a;})['then'](respondWithResult(_0x390a52,null))['catch'](handleError(_0x390a52,null));};function Extension(_0x265eac,_0x275578,_0x4cc782,_0x4ddb4b){this['context']='from-sip';this[_0x2097('0x5d')]=_0x265eac;this['app']=_0x4cc782;this[_0x2097('0x37')]=_0x2097('0x5e');this['description']=_0x2097('0x5f');this[_0x2097('0x60')]=_0x275578;this[_0x2097('0x61')]=_0x4ddb4b;}function createVoicePrefixExtensions(_0x103756,_0x2a2673,_0x60332a){return new BPromise(function(_0x15aa91,_0x8f7aaa){var _0x2ec365=new Extension(formatPrefixName(_0x103756['prefix']),0x1,_0x2097('0x62'),_0x2097('0x63'));_0x2ec365[_0x2097('0x64')]=_0x103756['id'];return db[_0x2097('0x54')][_0x2097('0x50')](_0x2ec365,{'transaction':_0x60332a})[_0x2097('0x2c')](function(_0x4befa9){var _0x43071d=_0x4befa9[_0x2097('0x65')]({'plain':!![]});var _0xcabda7=_[_0x2097('0x33')](addVoicePrefixExtensions(_0x103756,_0x2a2673),function(_0x1c4156){_0x1c4156['VoiceExtensionId']=_0x43071d['id'];_0x1c4156[_0x2097('0x64')]=_0x103756['id'];return _0x1c4156;});return db[_0x2097('0x54')]['bulkCreate'](_0xcabda7,{'transaction':_0x60332a})['then'](function(_0x580c1e){if(!_0x580c1e){return _0x8f7aaa(_0x2097('0x66'));}else{return _0x15aa91(_0x580c1e);}})[_0x2097('0x4b')](function(_0x319d3b){return _0x8f7aaa(_0x319d3b);});});;});};function addVoicePrefixExtensions(_0x3edb3e,_0x168703){var _0x18d90a=[];var _0x2e287b=formatPrefixName(_0x3edb3e[_0x2097('0x67')]);_0x18d90a[_0x2097('0x68')](new Extension(_0x2e287b,0x2,'Set','CDR(prefix)='+_0x3edb3e[_0x2097('0x30')]));if(_0x3edb3e[_0x2097('0x69')]){_0x18d90a[_0x2097('0x68')](new Extension(_0x2e287b,0x3,_0x2097('0x6a'),_0x2097('0x6b')+_0x3edb3e[_0x2097('0x69')]));}else{_0x18d90a['push'](new Extension(_0x2e287b,0x3,_0x2097('0x62'),_0x2097('0x6c')));}_0x18d90a[_0x2097('0x68')](new Extension(_0x2e287b,0x4,_0x2097('0x6d'),_0x168703['context']+','+'${EXTEN:'+(0x8+_0x3edb3e[_0x2097('0x30')][_0x2097('0x6e')])+'}'+','+0x1));return _0x18d90a;}function formatPrefixName(_0x487f1f){var _0x3707da='_';for(var _0x426290=0x0;_0x426290<_0x487f1f[_0x2097('0x6e')];_0x426290++){if(_0x487f1f[_0x2097('0x6f')](_0x426290)=='-'){_0x3707da+=_0x487f1f[_0x2097('0x6f')](_0x426290);}else{_0x3707da+='['+_0x487f1f[_0x2097('0x6f')](_0x426290)+']';}}_0x3707da+='.';return _0x3707da;}exports[_0x2097('0x2b')]=function(_0x2c6f24,_0x54159e,_0x4533fd){var _0x283e2b=_0x2c6f24['body'];_0x283e2b[_0x2097('0x67')]=_0x2097('0x70')+_0x283e2b[_0x2097('0x30')]+'-';return db[_0x2097('0x51')][_0x2097('0x52')](function(_0x46d6b5){return db[_0x2097('0x34')][_0x2097('0x2b')](_0x283e2b,{'where':{'id':_0x283e2b['id']},'transaction':_0x46d6b5})[_0x2097('0x2c')](function(){return db[_0x2097('0x54')][_0x2097('0x2d')]({'where':{'VoicePrefixId':_0x283e2b['id']},'transaction':_0x46d6b5})['then'](function(){return db[_0x2097('0x54')][_0x2097('0x4f')]({'where':{'id':_0x283e2b[_0x2097('0x71')]},'raw':!![]})[_0x2097('0x2c')](function(_0x3c9e03){return createVoicePrefixExtensions(_0x283e2b,_0x3c9e03,_0x46d6b5);});});});})['then'](function(){return db[_0x2097('0x34')][_0x2097('0x72')](_0x283e2b['id']);})[_0x2097('0x2c')](respondWithResult(_0x54159e,null))['catch'](handleError(_0x54159e,null));};exports[_0x2097('0x73')]=function(_0x545cd9,_0x364d3a,_0x4dcd9c){return db[_0x2097('0x34')]['find']({'where':{'id':_0x545cd9[_0x2097('0x4c')]['id']}})['then'](handleEntityNotFound(_0x364d3a,null))[_0x2097('0x2c')](function(_0x3dba80){if(_0x3dba80){return _0x3dba80[_0x2097('0x73')](_0x545cd9[_0x2097('0x53')][_0x2097('0x74')],_['omit'](_0x545cd9[_0x2097('0x53')],[_0x2097('0x74'),'id'])||{})[_0x2097('0x75')](function(_0x1f733c){for(var _0xa8416a=0x0;_0xa8416a<_0x545cd9[_0x2097('0x53')][_0x2097('0x74')][_0x2097('0x6e')];_0xa8416a+=0x1){socket[_0x2097('0x76')](_0x2097('0x77'),{'UserId':Number(_0x545cd9[_0x2097('0x53')][_0x2097('0x74')][_0xa8416a]),'VoicePrefixId':Number(_0x545cd9[_0x2097('0x4c')]['id'])});}return _0x1f733c;});}})[_0x2097('0x2c')](respondWithResult(_0x364d3a,null))[_0x2097('0x4b')](handleError(_0x364d3a,null));};exports[_0x2097('0x78')]=function(_0x57a31e,_0x1a81de,_0x4bd44d){return db['VoicePrefix'][_0x2097('0x4f')]({'where':{'id':_0x57a31e[_0x2097('0x4c')]['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0x1a81de,null))['then'](function(_0x34b687){if(_0x34b687){return _0x34b687[_0x2097('0x78')](_0x57a31e[_0x2097('0x39')][_0x2097('0x74')])['then'](function(){if(_[_0x2097('0x79')](_0x57a31e['query'][_0x2097('0x74')])){for(var _0x385551=0x0;_0x385551<_0x57a31e[_0x2097('0x39')][_0x2097('0x74')]['length'];_0x385551+=0x1){socket[_0x2097('0x76')](_0x2097('0x7a'),{'UserId':Number(_0x57a31e[_0x2097('0x39')]['ids'][_0x385551]),'VoicePrefixId':Number(_0x57a31e[_0x2097('0x4c')]['id'])});}}else{socket[_0x2097('0x76')](_0x2097('0x7a'),{'UserId':Number(_0x57a31e['query'][_0x2097('0x74')]),'VoicePrefixId':Number(_0x57a31e[_0x2097('0x4c')]['id'])});}});}})[_0x2097('0x2c')](respondWithStatusCode(_0x1a81de,null))[_0x2097('0x4b')](handleError(_0x1a81de,null));};exports[_0x2097('0x7b')]=function(_0x5efe1e,_0x5d181f,_0x56d4c0){var _0xc7481d={};var _0x3f510d={};var _0x4213d0;var _0x16451c;return db[_0x2097('0x34')][_0x2097('0x7c')]({'where':{'id':_0x5efe1e['params']['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0x5d181f,null))[_0x2097('0x2c')](function(_0x164ad3){if(_0x164ad3){_0x4213d0=_0x164ad3;_0x3f510d[_0x2097('0x3c')]=_[_0x2097('0x4d')](db[_0x2097('0x7d')][_0x2097('0x35')]);_0x3f510d['query']=_[_0x2097('0x4d')](_0x5efe1e[_0x2097('0x39')]);_0x3f510d[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x3f510d[_0x2097('0x3c')],_0x3f510d[_0x2097('0x39')]);_0xc7481d['attributes']=_['intersection'](_0x3f510d[_0x2097('0x3c')],qs['fields'](_0x5efe1e['query'][_0x2097('0x3d')]));_0xc7481d[_0x2097('0x3e')]=_0xc7481d[_0x2097('0x3e')][_0x2097('0x6e')]?_0xc7481d[_0x2097('0x3e')]:_0x3f510d[_0x2097('0x3c')];_0xc7481d[_0x2097('0x41')]=qs[_0x2097('0x42')](_0x5efe1e['query'][_0x2097('0x42')]);_0xc7481d[_0x2097('0x43')]=qs[_0x2097('0x3a')](_[_0x2097('0x44')](_0x5efe1e[_0x2097('0x39')],_0x3f510d['filters']));if(_0x5efe1e[_0x2097('0x39')][_0x2097('0x45')]){_0xc7481d[_0x2097('0x43')]=_[_0x2097('0x46')](_0xc7481d[_0x2097('0x43')],{'$or':_[_0x2097('0x33')](_0xc7481d['attributes'],function(_0x33b0c0){var _0x79f858={};_0x79f858[_0x33b0c0]={'$like':'%'+_0x5efe1e['query']['filter']+'%'};return _0x79f858;})});}_0xc7481d=_['merge']({},_0xc7481d,_0x5efe1e['options']);return _0x4213d0[_0x2097('0x7b')](_0xc7481d);}})[_0x2097('0x2c')](function(_0x3fe29e){if(_0x3fe29e){_0x16451c=_0x3fe29e[_0x2097('0x6e')];if(!_0x5efe1e[_0x2097('0x39')]['hasOwnProperty'](_0x2097('0x40'))){_0xc7481d[_0x2097('0x25')]=qs[_0x2097('0x25')](_0x5efe1e[_0x2097('0x39')][_0x2097('0x25')]);_0xc7481d[_0x2097('0x23')]=qs['offset'](_0x5efe1e[_0x2097('0x39')][_0x2097('0x23')]);}return _0x4213d0['getAgents'](_0xc7481d);}})[_0x2097('0x2c')](function(_0x358bc3){if(_0x358bc3){return _0x358bc3?{'count':_0x16451c,'rows':_0x358bc3}:null;}})[_0x2097('0x2c')](respondWithResult(_0x5d181f,null))[_0x2097('0x4b')](handleError(_0x5d181f,null));};exports[_0x2097('0x7e')]=function(_0x498a91,_0x3a7959,_0x35570d){var _0x86f89={};var _0x26a3e5={};var _0x25bb03;var _0x429c9e;return db[_0x2097('0x34')][_0x2097('0x7c')]({'where':{'id':_0x498a91[_0x2097('0x4c')]['id']}})[_0x2097('0x2c')](handleEntityNotFound(_0x3a7959,null))[_0x2097('0x2c')](function(_0x299a3e){if(_0x299a3e){_0x25bb03=_0x299a3e;_0x26a3e5[_0x2097('0x3c')]=_['keys'](db['Team'][_0x2097('0x35')]);_0x26a3e5['query']=_['keys'](_0x498a91[_0x2097('0x39')]);_0x26a3e5[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x26a3e5[_0x2097('0x3c')],_0x26a3e5[_0x2097('0x39')]);_0x86f89['attributes']=_['intersection'](_0x26a3e5[_0x2097('0x3c')],qs['fields'](_0x498a91[_0x2097('0x39')]['fields']));_0x86f89['attributes']=_0x86f89['attributes']['length']?_0x86f89['attributes']:_0x26a3e5[_0x2097('0x3c')];_0x86f89[_0x2097('0x41')]=qs[_0x2097('0x42')](_0x498a91[_0x2097('0x39')][_0x2097('0x42')]);_0x86f89[_0x2097('0x43')]=qs[_0x2097('0x3a')](_[_0x2097('0x44')](_0x498a91[_0x2097('0x39')],_0x26a3e5[_0x2097('0x3a')]));if(_0x498a91[_0x2097('0x39')][_0x2097('0x45')]){_0x86f89[_0x2097('0x43')]=_[_0x2097('0x46')](_0x86f89[_0x2097('0x43')],{'$or':_[_0x2097('0x33')](_0x86f89[_0x2097('0x3e')],function(_0x5e49bc){var _0x1e30c5={};_0x1e30c5[_0x5e49bc]={'$like':'%'+_0x498a91[_0x2097('0x39')][_0x2097('0x45')]+'%'};return _0x1e30c5;})});}_0x86f89=_[_0x2097('0x46')]({},_0x86f89,_0x498a91[_0x2097('0x48')]);return _0x25bb03[_0x2097('0x7e')](_0x86f89);}})[_0x2097('0x2c')](function(_0x1c5ec7){if(_0x1c5ec7){_0x429c9e=_0x1c5ec7[_0x2097('0x6e')];if(!_0x498a91[_0x2097('0x39')][_0x2097('0x3f')]('nolimit')){_0x86f89[_0x2097('0x25')]=qs[_0x2097('0x25')](_0x498a91[_0x2097('0x39')][_0x2097('0x25')]);_0x86f89[_0x2097('0x23')]=qs[_0x2097('0x23')](_0x498a91['query']['offset']);}return _0x25bb03[_0x2097('0x7e')](_0x86f89);}})[_0x2097('0x2c')](function(_0x2beb7a){if(_0x2beb7a){return _0x2beb7a?{'count':_0x429c9e,'rows':_0x2beb7a}:null;}})['then'](respondWithResult(_0x3a7959,null))[_0x2097('0x4b')](handleError(_0x3a7959,null));};exports[_0x2097('0x7f')]=function(_0x4eeac1,_0x459585,_0x436533){var _0x16405f=_0x4eeac1[_0x2097('0x53')][_0x2097('0x74')];var _0x41f718;return db[_0x2097('0x80')][_0x2097('0x81')]({'where':{'id':_0x16405f},'attributes':['id'],'include':[{'model':db[_0x2097('0x7d')],'as':_0x2097('0x82'),'attributes':['id',_0x2097('0x30'),_0x2097('0x83'),_0x2097('0x84'),_0x2097('0x85')],'raw':!![]}]})[_0x2097('0x2c')](function(_0x44661a){if(_0x44661a){_0x41f718=_0x44661a;var _0x39e21f=_['flatMap'](_0x44661a,function(_0x2d211b){var _0x1ab39a=_0x2d211b[_0x2097('0x65')]({'plain':!![]});return _0x1ab39a[_0x2097('0x82')];});return db[_0x2097('0x34')][_0x2097('0x4f')]({'where':{'id':_0x4eeac1[_0x2097('0x4c')]['id']}})[_0x2097('0x2c')](function(_0xecd4fc){return db[_0x2097('0x51')]['transaction'](function(_0x2fb539){return _0xecd4fc[_0x2097('0x7f')](_0x16405f,{'transaction':_0x2fb539})[_0x2097('0x2c')](function(){return BPromise[_0x2097('0x86')](_0x41f718,function(_0x17c494){return db[_0x2097('0x87')][_0x2097('0x88')]({'TeamId':_0x17c494['id'],'VoicePrefixId':_0x4eeac1[_0x2097('0x4c')]['id']},{'transaction':_0x2fb539});});})['then'](function(){return BPromise[_0x2097('0x86')](_0x39e21f,function(_0x239570){return db[_0x2097('0x89')][_0x2097('0x8a')]({'where':{'UserId':_0x239570['id'],'VoicePrefixId':_0x4eeac1[_0x2097('0x4c')]['id']},'transaction':_0x2fb539});});})[_0x2097('0x2c')](function(){_0x39e21f[_0x2097('0x8b')](function(_0x51bb2f){socket[_0x2097('0x76')](_0x2097('0x77'),{'UserId':_0x51bb2f['id'],'VoicePrefixId':_0xecd4fc['id']});});});});});}})['then'](respondWithStatusCode(_0x459585,null))[_0x2097('0x4b')](handleError(_0x459585,null));};exports[_0x2097('0x8c')]=function(_0x568de5,_0x473a54,_0x53a5ed){return db[_0x2097('0x80')][_0x2097('0x81')]({'where':{'id':_0x568de5['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x2097('0x7d')],'as':_0x2097('0x82'),'attributes':['id'],'raw':!![]}]})[_0x2097('0x2c')](handleEntityNotFound(_0x473a54,null))[_0x2097('0x2c')](function(_0x1909d8){var _0x2de4=_[_0x2097('0x33')](_0x1909d8,'id');var _0x43a1f8=[];var _0xb53629=[];var _0x516ed6=squel[_0x2097('0x8d')]();_0x516ed6[_0x2097('0x8e')]('tq.TeamId')['from'](_0x2097('0x8f'),'tq')[_0x2097('0x90')](_0x2097('0x91'),'ut',_0x2097('0x92'))[_0x2097('0x43')](_0x2097('0x93'),_0x568de5[_0x2097('0x4c')]['id']);for(var _0x5626f0=0x0;_0x5626f0<_0x1909d8[_0x2097('0x6e')];_0x5626f0+=0x1){let _0x45bbca=_0x1909d8[_0x5626f0];for(var _0x46fc92=0x0;_0x46fc92<_0x45bbca[_0x2097('0x82')][_0x2097('0x6e')];_0x46fc92+=0x1){let _0x357a5b=_0x45bbca[_0x2097('0x82')][_0x46fc92];var _0x3fcedc=_0x516ed6[_0x2097('0x94')]();_0x3fcedc[_0x2097('0x43')](_0x2097('0x95'),_0x357a5b['id']);_0xb53629['push'](db[_0x2097('0x51')][_0x2097('0x39')](_0x3fcedc['toString'](),{'type':db[_0x2097('0x51')][_0x2097('0x96')]['SELECT']})[_0x2097('0x2c')](function(_0xbe052f){if(_0xbe052f['length']===0x1){return _0x357a5b['id'];}else{var _0x32c5f1=_[_0x2097('0x97')](_[_0x2097('0x33')](_0xbe052f,_0x2097('0x98')),function(_0x456633){return _[_0x2097('0x99')](_0x2de4,_0x456633);});if(_0x32c5f1){return _0x357a5b['id'];}}}));}}return BPromise[_0x2097('0x9a')](_0xb53629)[_0x2097('0x2c')](function(_0x124d8f){_0x43a1f8=_(_0x43a1f8)[_0x2097('0x9b')](_0x124d8f)['compact']()[_0x2097('0x9c')]();return db[_0x2097('0x34')][_0x2097('0x4f')]({'where':{'id':_0x568de5[_0x2097('0x4c')]['id']}})['then'](function(_0x1b555e){return db['sequelize'][_0x2097('0x52')](function(_0x1ab515){return _0x1b555e[_0x2097('0x8c')](_0x568de5[_0x2097('0x39')][_0x2097('0x74')],{'transaction':_0x1ab515})[_0x2097('0x2c')](function(){if(!_[_0x2097('0x9d')](_0x43a1f8)){return _0x1b555e[_0x2097('0x78')](_0x43a1f8,{'transaction':_0x1ab515});}})[_0x2097('0x2c')](function(){_0x43a1f8['forEach'](function(_0x22fa5d){socket['emit']('userVoicePrefix:remove',{'UserId':_0x22fa5d,'VoicePrefixId':_0x1b555e['id']});});});});});});})['then'](respondWithStatusCode(_0x473a54,null))['catch'](handleError(_0x473a54,null));};
\ No newline at end of file
+var _0x8603=['send','map','VoicePrefix','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','NoOp','goto','charAt','update','system-','findById','addAgents','omit','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','each','upsert','findOrCreate','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','clone','toString','QueryTypes','every','includes','all','union','compact','forEach','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8603,0x190));var _0x3860=function(_0x8ad473,_0x4e40db){_0x8ad473=_0x8ad473-0x0;var _0x5ca4b9=_0x8603[_0x8ad473];return _0x5ca4b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];config[_0x3860('0x15')]=_[_0x3860('0x16')](config[_0x3860('0x15')],{'host':_0x3860('0x17'),'port':0x18eb});var socket=require(_0x3860('0x18'))(new Redis(config[_0x3860('0x15')]));require(_0x3860('0x19'))[_0x3860('0x1a')](socket);function respondWithStatusCode(_0x46264d,_0x54dbc3){_0x54dbc3=_0x54dbc3||0xcc;return function(_0x3d861d){if(_0x3d861d){return _0x46264d[_0x3860('0x1b')](_0x54dbc3);}return _0x46264d[_0x3860('0x1c')](_0x54dbc3)[_0x3860('0x1d')]();};}function respondWithResult(_0x1055b3,_0xfa0c9a){_0xfa0c9a=_0xfa0c9a||0xc8;return function(_0x2d8a3a){if(_0x2d8a3a){return _0x1055b3[_0x3860('0x1c')](_0xfa0c9a)[_0x3860('0x1e')](_0x2d8a3a);}};}function respondWithFilteredResult(_0x3c0d91,_0x3e51b4){return function(_0x45b799){if(_0x45b799){var _0x4b6b15=typeof _0x3e51b4['offset']===_0x3860('0x1f')&&typeof _0x3e51b4[_0x3860('0x20')]===_0x3860('0x1f');var _0x53fc63=_0x45b799[_0x3860('0x21')];var _0x145b26=_0x4b6b15?0x0:_0x3e51b4[_0x3860('0x22')];var _0x3af33a=_0x4b6b15?_0x45b799[_0x3860('0x21')]:_0x3e51b4[_0x3860('0x22')]+_0x3e51b4[_0x3860('0x20')];var _0x1f8891;if(_0x3af33a>=_0x53fc63){_0x3af33a=_0x53fc63;_0x1f8891=0xc8;}else{_0x1f8891=0xce;}_0x3c0d91[_0x3860('0x1c')](_0x1f8891);return _0x3c0d91[_0x3860('0x23')](_0x3860('0x24'),_0x145b26+'-'+_0x3af33a+'/'+_0x53fc63)[_0x3860('0x1e')](_0x45b799);}return null;};}function patchUpdates(_0x280ea9){return function(_0x9eaaa1){try{jsonpatch[_0x3860('0x25')](_0x9eaaa1,_0x280ea9,!![]);}catch(_0x564efd){return BPromise[_0x3860('0x26')](_0x564efd);}return _0x9eaaa1[_0x3860('0x27')]();};}function saveUpdates(_0x2b91f2,_0x301e03){return function(_0x20bb1e){if(_0x20bb1e){return _0x20bb1e['update'](_0x2b91f2)[_0x3860('0x28')](function(_0x568515){return _0x568515;});}return null;};}function removeEntity(_0x577750,_0xfa9705){return function(_0x1c4bbc){if(_0x1c4bbc){return _0x1c4bbc['destroy']()['then'](function(){var _0x5f42d5=_0x1c4bbc[_0x3860('0x29')]({'plain':!![]});var _0x3ebc5b=_0x3860('0x2a');return db[_0x3860('0x2b')][_0x3860('0x2c')]({'where':{'type':_0x3ebc5b,'resourceId':_0x5f42d5['id']}})[_0x3860('0x28')](function(){return _0x1c4bbc;});})['then'](function(){_0x577750['status'](0xcc)[_0x3860('0x1d')]();});}};}function handleEntityNotFound(_0x1f1809,_0x5a9af2){return function(_0x2551f4){if(!_0x2551f4){_0x1f1809[_0x3860('0x1b')](0x194);}return _0x2551f4;};}function handleError(_0x10d9e4,_0x426e6c){_0x426e6c=_0x426e6c||0x1f4;return function(_0x3628f7){logger['error'](_0x3628f7[_0x3860('0x2d')]);if(_0x3628f7[_0x3860('0x2e')]){delete _0x3628f7[_0x3860('0x2e')];}_0x10d9e4['status'](_0x426e6c)[_0x3860('0x2f')](_0x3628f7);};}exports['index']=function(_0x294b3a,_0x4825f0){var _0x1c498c={},_0x2e542a={},_0x24cf39={'count':0x0,'rows':[]};var _0x47e350=_[_0x3860('0x30')](db[_0x3860('0x31')]['rawAttributes'],function(_0x1c94cc){return{'name':_0x1c94cc['fieldName'],'type':_0x1c94cc[_0x3860('0x32')][_0x3860('0x33')]};});_0x2e542a[_0x3860('0x34')]=_[_0x3860('0x30')](_0x47e350,_0x3860('0x2e'));_0x2e542a[_0x3860('0x35')]=_[_0x3860('0x36')](_0x294b3a['query']);_0x2e542a[_0x3860('0x37')]=_[_0x3860('0x38')](_0x2e542a['model'],_0x2e542a[_0x3860('0x35')]);_0x1c498c[_0x3860('0x39')]=_[_0x3860('0x38')](_0x2e542a['model'],qs['fields'](_0x294b3a[_0x3860('0x35')][_0x3860('0x3a')]));_0x1c498c[_0x3860('0x39')]=_0x1c498c[_0x3860('0x39')]['length']?_0x1c498c['attributes']:_0x2e542a[_0x3860('0x34')];if(!_0x294b3a[_0x3860('0x35')][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1c498c[_0x3860('0x20')]=qs['limit'](_0x294b3a[_0x3860('0x35')][_0x3860('0x20')]);_0x1c498c['offset']=qs['offset'](_0x294b3a[_0x3860('0x35')][_0x3860('0x22')]);}_0x1c498c[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x294b3a[_0x3860('0x35')]['sort']);_0x1c498c[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x294b3a[_0x3860('0x35')],_0x2e542a['filters']),_0x47e350);if(_0x294b3a[_0x3860('0x35')][_0x3860('0x41')]){_0x1c498c['where']=_[_0x3860('0x42')](_0x1c498c[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x47e350,function(_0xf346e){if(_0xf346e['type']!==_0x3860('0x43')){var _0x47141b={};_0x47141b[_0xf346e[_0x3860('0x2e')]]={'$like':'%'+_0x294b3a['query'][_0x3860('0x41')]+'%'};return _0x47141b;}})});}_0x1c498c=_['merge']({},_0x1c498c,_0x294b3a[_0x3860('0x44')]);var _0x424801={'where':_0x1c498c[_0x3860('0x3f')]};return db[_0x3860('0x31')][_0x3860('0x21')](_0x424801)[_0x3860('0x28')](function(_0x4e0a44){_0x24cf39[_0x3860('0x21')]=_0x4e0a44;if(_0x294b3a[_0x3860('0x35')]['includeAll']){_0x1c498c['include']=[{'all':!![]}];}return db[_0x3860('0x31')][_0x3860('0x45')](_0x1c498c);})['then'](function(_0x164a77){_0x24cf39[_0x3860('0x46')]=_0x164a77;return _0x24cf39;})['then'](respondWithFilteredResult(_0x4825f0,_0x1c498c))[_0x3860('0x47')](handleError(_0x4825f0,null));};exports[_0x3860('0x48')]=function(_0x392dc3,_0x37e5c3){var _0x14f5b2={'raw':![],'where':{'id':_0x392dc3[_0x3860('0x49')]['id']}},_0x3fa282={};_0x3fa282[_0x3860('0x34')]=_[_0x3860('0x36')](db[_0x3860('0x31')][_0x3860('0x4a')]);_0x3fa282[_0x3860('0x35')]=_[_0x3860('0x36')](_0x392dc3['query']);_0x3fa282[_0x3860('0x37')]=_['intersection'](_0x3fa282[_0x3860('0x34')],_0x3fa282[_0x3860('0x35')]);_0x14f5b2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x3fa282[_0x3860('0x34')],qs[_0x3860('0x3a')](_0x392dc3[_0x3860('0x35')][_0x3860('0x3a')]));_0x14f5b2['attributes']=_0x14f5b2[_0x3860('0x39')][_0x3860('0x4b')]?_0x14f5b2[_0x3860('0x39')]:_0x3fa282['model'];if(_0x392dc3[_0x3860('0x35')][_0x3860('0x4c')]){_0x14f5b2[_0x3860('0x4d')]=[{'all':!![]}];}_0x14f5b2=_[_0x3860('0x42')]({},_0x14f5b2,_0x392dc3['options']);return db['VoicePrefix'][_0x3860('0x4e')](_0x14f5b2)['then'](handleEntityNotFound(_0x37e5c3,null))[_0x3860('0x28')](respondWithResult(_0x37e5c3,null))[_0x3860('0x47')](handleError(_0x37e5c3,null));};exports[_0x3860('0x2c')]=function(_0x52456e,_0x29c52d){return db['VoicePrefix'][_0x3860('0x4e')]({'where':{'id':_0x52456e['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x29c52d,null))[_0x3860('0x28')](removeEntity(_0x29c52d,null))[_0x3860('0x47')](handleError(_0x29c52d,null));};exports['describe']=function(_0x4876ab,_0x4408b5){return db[_0x3860('0x31')]['describe']()[_0x3860('0x28')](respondWithResult(_0x4408b5,null))['catch'](handleError(_0x4408b5,null));};exports[_0x3860('0x4f')]=function(_0x1267e1,_0x254631){var _0x233eee;return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x3fad85){return db['VoicePrefix'][_0x3860('0x4f')](_0x1267e1[_0x3860('0x52')],{'transaction':_0x3fad85})[_0x3860('0x28')](function(_0x137789){_0x233eee=_0x137789[_0x3860('0x29')]({'plain':!![]});return db[_0x3860('0x53')]['find']({'where':{'id':_0x233eee[_0x3860('0x54')]},'raw':!![]})[_0x3860('0x28')](function(_0x19a26d){return createVoicePrefixExtensions(_0x233eee,_0x19a26d,_0x3fad85);});});})[_0x3860('0x28')](function(){var _0x3a55e7=_0x1267e1[_0x3860('0x55')][_0x3860('0x29')]({'plain':!![]});if(!_0x3a55e7)throw new Error(_0x3860('0x56'));if(_0x3a55e7['role']===_0x3860('0x55')){var _0x2ff0bf=_0x233eee;return db['UserProfileSection'][_0x3860('0x4e')]({'where':{'name':_0x3860('0x2a'),'userProfileId':_0x3a55e7[_0x3860('0x57')]},'raw':!![]})['then'](function(_0x17d2df){if(_0x17d2df&&_0x17d2df['autoAssociation']===0x0){return db[_0x3860('0x2b')][_0x3860('0x4f')]({'name':_0x2ff0bf[_0x3860('0x2e')],'resourceId':_0x2ff0bf['id'],'type':_0x17d2df[_0x3860('0x2e')],'sectionId':_0x17d2df['id']},{})[_0x3860('0x28')](function(){return _0x233eee;});}else{return _0x233eee;}})[_0x3860('0x47')](function(_0x1a4f58){logger[_0x3860('0x58')](_0x3860('0x59'),_0x1a4f58);throw _0x1a4f58;});}return _0x233eee;})[_0x3860('0x28')](respondWithResult(_0x254631,null))[_0x3860('0x47')](handleError(_0x254631,null));};function Extension(_0x2bac24,_0x58147d,_0x5ce9a4,_0x5111e0){this[_0x3860('0x5a')]='from-sip';this['exten']=_0x2bac24;this[_0x3860('0x5b')]=_0x5ce9a4;this[_0x3860('0x32')]=_0x3860('0x5c');this[_0x3860('0x5d')]=_0x3860('0x5e');this[_0x3860('0x5f')]=_0x58147d;this['appdata']=_0x5111e0;}function createVoicePrefixExtensions(_0x49ec68,_0x4df47b,_0x1d6c70){return new BPromise(function(_0x1c1da4,_0x2d1646){var _0x5ec169=new Extension(formatPrefixName(_0x49ec68[_0x3860('0x60')]),0x1,'NoOp',_0x3860('0x61'));_0x5ec169[_0x3860('0x62')]=_0x49ec68['id'];return db['VoiceExtension'][_0x3860('0x4f')](_0x5ec169,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0xfe45d8){var _0x27f817=_0xfe45d8['get']({'plain':!![]});var _0x18cc37=_[_0x3860('0x30')](addVoicePrefixExtensions(_0x49ec68,_0x4df47b),function(_0x17f248){_0x17f248['VoiceExtensionId']=_0x27f817['id'];_0x17f248['VoicePrefixId']=_0x49ec68['id'];return _0x17f248;});return db[_0x3860('0x53')][_0x3860('0x63')](_0x18cc37,{'transaction':_0x1d6c70})[_0x3860('0x28')](function(_0x1ca0e7){if(!_0x1ca0e7){return _0x2d1646(_0x3860('0x64'));}else{return _0x1c1da4(_0x1ca0e7);}})[_0x3860('0x47')](function(_0x5d0210){return _0x2d1646(_0x5d0210);});});;});};function addVoicePrefixExtensions(_0x2d916a,_0x4fe4e8){var _0x5db8f9=[];var _0x15fa2d=formatPrefixName(_0x2d916a[_0x3860('0x60')]);_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x2,_0x3860('0x66'),_0x3860('0x67')+_0x2d916a[_0x3860('0x2e')]));if(_0x2d916a['callerIdAll']){_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x66'),_0x3860('0x68')+_0x2d916a[_0x3860('0x69')]));}else{_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x3,_0x3860('0x6a'),'No\x20callerid\x20available'));}_0x5db8f9[_0x3860('0x65')](new Extension(_0x15fa2d,0x4,_0x3860('0x6b'),_0x4fe4e8[_0x3860('0x5a')]+','+'${EXTEN:'+(0x8+_0x2d916a['name'][_0x3860('0x4b')])+'}'+','+0x1));return _0x5db8f9;}function formatPrefixName(_0x2d425d){var _0x11c2c8='_';for(var _0x3b7a76=0x0;_0x3b7a76<_0x2d425d[_0x3860('0x4b')];_0x3b7a76++){if(_0x2d425d['charAt'](_0x3b7a76)=='-'){_0x11c2c8+=_0x2d425d['charAt'](_0x3b7a76);}else{_0x11c2c8+='['+_0x2d425d[_0x3860('0x6c')](_0x3b7a76)+']';}}_0x11c2c8+='.';return _0x11c2c8;}exports[_0x3860('0x6d')]=function(_0x47e144,_0x5d9416,_0x2fd2ec){var _0x38ad4e=_0x47e144['body'];_0x38ad4e[_0x3860('0x60')]=_0x3860('0x6e')+_0x38ad4e[_0x3860('0x2e')]+'-';return db[_0x3860('0x50')]['transaction'](function(_0x1e8c5c){return db[_0x3860('0x31')]['update'](_0x38ad4e,{'where':{'id':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')][_0x3860('0x2c')]({'where':{'VoicePrefixId':_0x38ad4e['id']},'transaction':_0x1e8c5c})['then'](function(){return db[_0x3860('0x53')]['find']({'where':{'id':_0x38ad4e[_0x3860('0x54')]},'raw':!![]})['then'](function(_0x543574){return createVoicePrefixExtensions(_0x38ad4e,_0x543574,_0x1e8c5c);});});});})[_0x3860('0x28')](function(){return db['VoicePrefix'][_0x3860('0x6f')](_0x38ad4e['id']);})[_0x3860('0x28')](respondWithResult(_0x5d9416,null))[_0x3860('0x47')](handleError(_0x5d9416,null));};exports[_0x3860('0x70')]=function(_0x19f717,_0x43c5a1,_0x4b3447){return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x19f717[_0x3860('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c5a1,null))[_0x3860('0x28')](function(_0x55661a){if(_0x55661a){return _0x55661a[_0x3860('0x70')](_0x19f717[_0x3860('0x52')]['ids'],_[_0x3860('0x71')](_0x19f717[_0x3860('0x52')],[_0x3860('0x72'),'id'])||{})['spread'](function(_0x572707){for(var _0x5a282a=0x0;_0x5a282a<_0x19f717['body'][_0x3860('0x72')][_0x3860('0x4b')];_0x5a282a+=0x1){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':Number(_0x19f717['body']['ids'][_0x5a282a]),'VoicePrefixId':Number(_0x19f717[_0x3860('0x49')]['id'])});}return _0x572707;});}})[_0x3860('0x28')](respondWithResult(_0x43c5a1,null))[_0x3860('0x47')](handleError(_0x43c5a1,null));};exports[_0x3860('0x75')]=function(_0x4b0652,_0x3a7c0c,_0x306560){return db['VoicePrefix']['find']({'where':{'id':_0x4b0652[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x3a7c0c,null))[_0x3860('0x28')](function(_0x27894f){if(_0x27894f){return _0x27894f['removeAgents'](_0x4b0652['query'][_0x3860('0x72')])['then'](function(){if(_[_0x3860('0x76')](_0x4b0652[_0x3860('0x35')]['ids'])){for(var _0x4e7713=0x0;_0x4e7713<_0x4b0652['query'][_0x3860('0x72')][_0x3860('0x4b')];_0x4e7713+=0x1){socket['emit'](_0x3860('0x77'),{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')][_0x4e7713]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}}else{socket[_0x3860('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x4b0652[_0x3860('0x35')][_0x3860('0x72')]),'VoicePrefixId':Number(_0x4b0652[_0x3860('0x49')]['id'])});}});}})[_0x3860('0x28')](respondWithStatusCode(_0x3a7c0c,null))[_0x3860('0x47')](handleError(_0x3a7c0c,null));};exports['getAgents']=function(_0x313366,_0xf57e80,_0x2f3759){var _0x41ee6f={};var _0x28fcb6={};var _0x543c98;var _0x532370;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x313366[_0x3860('0x49')]['id']}})[_0x3860('0x28')](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x28')](function(_0x293c60){if(_0x293c60){_0x543c98=_0x293c60;_0x28fcb6[_0x3860('0x34')]=_['keys'](db[_0x3860('0x79')][_0x3860('0x4a')]);_0x28fcb6['query']=_[_0x3860('0x36')](_0x313366[_0x3860('0x35')]);_0x28fcb6[_0x3860('0x37')]=_['intersection'](_0x28fcb6[_0x3860('0x34')],_0x28fcb6[_0x3860('0x35')]);_0x41ee6f['attributes']=_[_0x3860('0x38')](_0x28fcb6['model'],qs[_0x3860('0x3a')](_0x313366[_0x3860('0x35')]['fields']));_0x41ee6f[_0x3860('0x39')]=_0x41ee6f[_0x3860('0x39')][_0x3860('0x4b')]?_0x41ee6f[_0x3860('0x39')]:_0x28fcb6[_0x3860('0x34')];_0x41ee6f['order']=qs[_0x3860('0x3e')](_0x313366[_0x3860('0x35')][_0x3860('0x3e')]);_0x41ee6f[_0x3860('0x3f')]=qs[_0x3860('0x37')](_['pick'](_0x313366['query'],_0x28fcb6[_0x3860('0x37')]));if(_0x313366[_0x3860('0x35')]['filter']){_0x41ee6f[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x41ee6f[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x41ee6f['attributes'],function(_0x3a0719){var _0x5a2f99={};_0x5a2f99[_0x3a0719]={'$like':'%'+_0x313366[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x5a2f99;})});}_0x41ee6f=_[_0x3860('0x42')]({},_0x41ee6f,_0x313366[_0x3860('0x44')]);return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})[_0x3860('0x28')](function(_0x467b1b){if(_0x467b1b){_0x532370=_0x467b1b['length'];if(!_0x313366[_0x3860('0x35')][_0x3860('0x3b')]('nolimit')){_0x41ee6f['limit']=qs['limit'](_0x313366['query'][_0x3860('0x20')]);_0x41ee6f[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x313366[_0x3860('0x35')][_0x3860('0x22')]);}return _0x543c98[_0x3860('0x7a')](_0x41ee6f);}})['then'](function(_0x204da6){if(_0x204da6){return _0x204da6?{'count':_0x532370,'rows':_0x204da6}:null;}})['then'](respondWithResult(_0xf57e80,null))[_0x3860('0x47')](handleError(_0xf57e80,null));};exports[_0x3860('0x7b')]=function(_0x897ea0,_0x221229,_0x459b6c){var _0x1108d2={};var _0x23d7f0={};var _0x52987a;var _0xcd4bd3;return db[_0x3860('0x31')][_0x3860('0x78')]({'where':{'id':_0x897ea0['params']['id']}})[_0x3860('0x28')](handleEntityNotFound(_0x221229,null))[_0x3860('0x28')](function(_0x1c87bd){if(_0x1c87bd){_0x52987a=_0x1c87bd;_0x23d7f0['model']=_[_0x3860('0x36')](db[_0x3860('0x7c')][_0x3860('0x4a')]);_0x23d7f0[_0x3860('0x35')]=_['keys'](_0x897ea0[_0x3860('0x35')]);_0x23d7f0[_0x3860('0x37')]=_[_0x3860('0x38')](_0x23d7f0['model'],_0x23d7f0[_0x3860('0x35')]);_0x1108d2[_0x3860('0x39')]=_[_0x3860('0x38')](_0x23d7f0['model'],qs[_0x3860('0x3a')](_0x897ea0[_0x3860('0x35')][_0x3860('0x3a')]));_0x1108d2['attributes']=_0x1108d2[_0x3860('0x39')][_0x3860('0x4b')]?_0x1108d2[_0x3860('0x39')]:_0x23d7f0['model'];_0x1108d2[_0x3860('0x3d')]=qs[_0x3860('0x3e')](_0x897ea0[_0x3860('0x35')]['sort']);_0x1108d2[_0x3860('0x3f')]=qs['filters'](_[_0x3860('0x40')](_0x897ea0['query'],_0x23d7f0[_0x3860('0x37')]));if(_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]){_0x1108d2[_0x3860('0x3f')]=_[_0x3860('0x42')](_0x1108d2[_0x3860('0x3f')],{'$or':_[_0x3860('0x30')](_0x1108d2[_0x3860('0x39')],function(_0x3f808c){var _0x1de607={};_0x1de607[_0x3f808c]={'$like':'%'+_0x897ea0[_0x3860('0x35')][_0x3860('0x41')]+'%'};return _0x1de607;})});}_0x1108d2=_[_0x3860('0x42')]({},_0x1108d2,_0x897ea0[_0x3860('0x44')]);return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})[_0x3860('0x28')](function(_0x46661f){if(_0x46661f){_0xcd4bd3=_0x46661f[_0x3860('0x4b')];if(!_0x897ea0['query'][_0x3860('0x3b')](_0x3860('0x3c'))){_0x1108d2[_0x3860('0x20')]=qs[_0x3860('0x20')](_0x897ea0[_0x3860('0x35')][_0x3860('0x20')]);_0x1108d2[_0x3860('0x22')]=qs[_0x3860('0x22')](_0x897ea0[_0x3860('0x35')][_0x3860('0x22')]);}return _0x52987a[_0x3860('0x7b')](_0x1108d2);}})['then'](function(_0x252c19){if(_0x252c19){return _0x252c19?{'count':_0xcd4bd3,'rows':_0x252c19}:null;}})[_0x3860('0x28')](respondWithResult(_0x221229,null))[_0x3860('0x47')](handleError(_0x221229,null));};exports[_0x3860('0x7d')]=function(_0x4a929e,_0x1a1994,_0x2ece36){var _0x2fcf2c=_0x4a929e[_0x3860('0x52')]['ids'];var _0x280747;return db['Team']['findAll']({'where':{'id':_0x2fcf2c},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id',_0x3860('0x2e'),_0x3860('0x7f'),_0x3860('0x80'),_0x3860('0x81')],'raw':!![]}]})[_0x3860('0x28')](function(_0x273fed){if(_0x273fed){_0x280747=_0x273fed;var _0x3e4a88=_[_0x3860('0x82')](_0x273fed,function(_0x4677b0){var _0x559c=_0x4677b0[_0x3860('0x29')]({'plain':!![]});return _0x559c['Agents'];});return db[_0x3860('0x31')]['find']({'where':{'id':_0x4a929e[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x5891d8){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0x1a9158){return _0x5891d8[_0x3860('0x7d')](_0x2fcf2c,{'transaction':_0x1a9158})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x280747,function(_0x12296a){return db['TeamVoicePrefix'][_0x3860('0x84')]({'TeamId':_0x12296a['id'],'VoicePrefixId':_0x4a929e[_0x3860('0x49')]['id']},{'transaction':_0x1a9158});});})[_0x3860('0x28')](function(){return BPromise[_0x3860('0x83')](_0x3e4a88,function(_0x469ae6){return db['UserVoicePrefix'][_0x3860('0x85')]({'where':{'UserId':_0x469ae6['id'],'VoicePrefixId':_0x4a929e['params']['id']},'transaction':_0x1a9158});});})['then'](function(){_0x3e4a88['forEach'](function(_0x1059a4){socket[_0x3860('0x73')](_0x3860('0x74'),{'UserId':_0x1059a4['id'],'VoicePrefixId':_0x5891d8['id']});});});});});}})[_0x3860('0x28')](respondWithStatusCode(_0x1a1994,null))[_0x3860('0x47')](handleError(_0x1a1994,null));};exports[_0x3860('0x86')]=function(_0x270ca1,_0xe24a1d,_0x59c203){return db[_0x3860('0x7c')][_0x3860('0x45')]({'where':{'id':_0x270ca1['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3860('0x79')],'as':_0x3860('0x7e'),'attributes':['id'],'raw':!![]}]})[_0x3860('0x28')](handleEntityNotFound(_0xe24a1d,null))['then'](function(_0x1fe2d8){var _0x4f07f3=_[_0x3860('0x30')](_0x1fe2d8,'id');var _0x5c196e=[];var _0x41fd53=[];var _0xf91fc2=squel['select']();_0xf91fc2[_0x3860('0x87')](_0x3860('0x88'))['from'](_0x3860('0x89'),'tq')[_0x3860('0x8a')](_0x3860('0x8b'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3860('0x3f')]('VoicePrefixId\x20=\x20?',_0x270ca1[_0x3860('0x49')]['id']);for(var _0x18b845=0x0;_0x18b845<_0x1fe2d8['length'];_0x18b845+=0x1){let _0x20edc7=_0x1fe2d8[_0x18b845];for(var _0x2d8581=0x0;_0x2d8581<_0x20edc7[_0x3860('0x7e')][_0x3860('0x4b')];_0x2d8581+=0x1){let _0x2d4744=_0x20edc7['Agents'][_0x2d8581];var _0x410bf4=_0xf91fc2[_0x3860('0x8c')]();_0x410bf4['where']('ut.UserId\x20=\x20?',_0x2d4744['id']);_0x41fd53[_0x3860('0x65')](db['sequelize'][_0x3860('0x35')](_0x410bf4[_0x3860('0x8d')](),{'type':db['sequelize'][_0x3860('0x8e')]['SELECT']})[_0x3860('0x28')](function(_0x4b8128){if(_0x4b8128[_0x3860('0x4b')]===0x1){return _0x2d4744['id'];}else{var _0x24788d=_[_0x3860('0x8f')](_[_0x3860('0x30')](_0x4b8128,'TeamId'),function(_0x25a8f7){return _[_0x3860('0x90')](_0x4f07f3,_0x25a8f7);});if(_0x24788d){return _0x2d4744['id'];}}}));}}return BPromise[_0x3860('0x91')](_0x41fd53)[_0x3860('0x28')](function(_0x4b7f2a){_0x5c196e=_(_0x5c196e)[_0x3860('0x92')](_0x4b7f2a)[_0x3860('0x93')]()['value']();return db[_0x3860('0x31')][_0x3860('0x4e')]({'where':{'id':_0x270ca1[_0x3860('0x49')]['id']}})[_0x3860('0x28')](function(_0x514374){return db[_0x3860('0x50')][_0x3860('0x51')](function(_0xd2167f){return _0x514374[_0x3860('0x86')](_0x270ca1['query'][_0x3860('0x72')],{'transaction':_0xd2167f})['then'](function(){if(!_['isEmpty'](_0x5c196e)){return _0x514374['removeAgents'](_0x5c196e,{'transaction':_0xd2167f});}})[_0x3860('0x28')](function(){_0x5c196e[_0x3860('0x94')](function(_0x1a6929){socket['emit'](_0x3860('0x77'),{'UserId':_0x1a6929,'VoicePrefixId':_0x514374['id']});});});});});});})['then'](respondWithStatusCode(_0xe24a1d,null))[_0x3860('0x47')](handleError(_0xe24a1d,null));};
\ No newline at end of file
index b1d13f0..677e4bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf979=['emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove'];(function(_0x55017a,_0x1f3275){var _0x42d4d8=function(_0x3aea54){while(--_0x3aea54){_0x55017a['push'](_0x55017a['shift']());}};_0x42d4d8(++_0x1f3275);}(_0xf979,0xad));var _0x9f97=function(_0x28d4a0,_0x2f5bf){_0x28d4a0=_0x28d4a0-0x0;var _0x980753=_0xf979[_0x28d4a0];return _0x980753;};'use strict';var EventEmitter=require(_0x9f97('0x0'));var VoicePrefix=require(_0x9f97('0x1'))['db'][_0x9f97('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9f97('0x3')](0x0);var events={'afterCreate':_0x9f97('0x4'),'afterUpdate':_0x9f97('0x5'),'afterDestroy':_0x9f97('0x6')};function emitEvent(_0x2a9c59){return function(_0x34845d,_0xe36a45,_0x131ff7){VoicePrefixEvents[_0x9f97('0x7')](_0x2a9c59+':'+_0x34845d['id'],_0x34845d);VoicePrefixEvents['emit'](_0x2a9c59,_0x34845d);_0x131ff7(null);};}for(var e in events){if(events[_0x9f97('0x8')](e)){var event=events[e];VoicePrefix[_0x9f97('0x9')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0x63d9=['VoicePrefix','save','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5e515a,_0x5d40e7){var _0x350bcd=function(_0x196cdf){while(--_0x196cdf){_0x5e515a['push'](_0x5e515a['shift']());}};_0x350bcd(++_0x5d40e7);}(_0x63d9,0xc9));var _0x963d=function(_0x18d143,_0x47a1a0){_0x18d143=_0x18d143-0x0;var _0x622498=_0x63d9[_0x18d143];return _0x622498;};'use strict';var EventEmitter=require(_0x963d('0x0'));var VoicePrefix=require(_0x963d('0x1'))['db'][_0x963d('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x963d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e1300){return function(_0x1deb65,_0x18d636,_0x1fe2e2){VoicePrefixEvents[_0x963d('0x4')](_0x1e1300+':'+_0x1deb65['id'],_0x1deb65);VoicePrefixEvents[_0x963d('0x4')](_0x1e1300,_0x1deb65);_0x1fe2e2(null);};}for(var e in events){if(events[_0x963d('0x5')](e)){var event=events[e];VoicePrefix[_0x963d('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index 910b688..a388afb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3516=['define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x498f93,_0x255d50){var _0x4a2395=function(_0x4c3ece){while(--_0x4c3ece){_0x498f93['push'](_0x498f93['shift']());}};_0x4a2395(++_0x255d50);}(_0x3516,0x16e));var _0x6351=function(_0x103911,_0x2ace3c){_0x103911=_0x103911-0x0;var _0x192996=_0x3516[_0x103911];return _0x192996;};'use strict';var _=require(_0x6351('0x0'));var util=require(_0x6351('0x1'));var logger=require(_0x6351('0x2'))(_0x6351('0x3'));var moment=require(_0x6351('0x4'));var BPromise=require(_0x6351('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6351('0x6'));var rimraf=require(_0x6351('0x7'));var config=require('../../config/environment');var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x1cfaf9,_0x363304){return _0x1cfaf9[_0x6351('0x8')](_0x6351('0x9'),attributes,{'tableName':_0x6351('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4fca=['request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f1248,_0x158a90){var _0x3a8eee=function(_0x4998be){while(--_0x4998be){_0x3f1248['push'](_0x3f1248['shift']());}};_0x3a8eee(++_0x158a90);}(_0x4fca,0x166));var _0xa4fc=function(_0x61be6,_0x120537){_0x61be6=_0x61be6-0x0;var _0x10e994=_0x4fca[_0x61be6];return _0x10e994;};'use strict';var _=require(_0xa4fc('0x0'));var util=require(_0xa4fc('0x1'));var logger=require(_0xa4fc('0x2'))(_0xa4fc('0x3'));var moment=require(_0xa4fc('0x4'));var BPromise=require(_0xa4fc('0x5'));var rp=require(_0xa4fc('0x6'));var fs=require('fs');var path=require(_0xa4fc('0x7'));var rimraf=require(_0xa4fc('0x8'));var config=require(_0xa4fc('0x9'));var attributes=require(_0xa4fc('0xa'));module[_0xa4fc('0xb')]=function(_0x110628,_0x43c88f){return _0x110628[_0xa4fc('0xc')](_0xa4fc('0xd'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 60b1b08..3c3a4ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x870d=['defaults','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x242271,_0x50896e){var _0x40ff9c=function(_0x42e123){while(--_0x42e123){_0x242271['push'](_0x242271['shift']());}};_0x40ff9c(++_0x50896e);}(_0x870d,0xde));var _0xd870=function(_0x4a01e4,_0xfb2e97){_0x4a01e4=_0x4a01e4-0x0;var _0x594325=_0x870d[_0x4a01e4];return _0x594325;};'use strict';var _=require('lodash');var util=require(_0xd870('0x0'));var moment=require(_0xd870('0x1'));var BPromise=require(_0xd870('0x2'));var rs=require(_0xd870('0x3'));var fs=require('fs');var Redis=require(_0xd870('0x4'));var db=require(_0xd870('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd870('0x6'))(_0xd870('0x7'));var config=require(_0xd870('0x8'));var jayson=require(_0xd870('0x9'));var client=jayson[_0xd870('0xa')]['http']({'port':0x232a});config[_0xd870('0xb')]=_[_0xd870('0xc')](config[_0xd870('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd870('0xb')]));require(_0xd870('0xd'))[_0xd870('0xe')](socket);function respondWithRpcPromise(_0x5aaee8,_0x2269e8,_0x123bbf){return new BPromise(function(_0x4e9745,_0x4f1952){return client[_0xd870('0xf')](_0x5aaee8,_0x123bbf)[_0xd870('0x10')](function(_0x434450){logger['info'](_0xd870('0x11'),_0x2269e8,_0xd870('0x12'));logger['debug'](_0xd870('0x13'),_0x2269e8,_0xd870('0x12'),JSON['stringify'](_0x434450));if(_0x434450[_0xd870('0x14')]){if(_0x434450['error'][_0xd870('0x15')]===0x1f4){logger[_0xd870('0x14')](_0xd870('0x11'),_0x2269e8,_0x434450[_0xd870('0x14')]['message']);return _0x4f1952(_0x434450[_0xd870('0x14')][_0xd870('0x16')]);}logger['error'](_0xd870('0x11'),_0x2269e8,_0x434450[_0xd870('0x14')][_0xd870('0x16')]);return _0x4e9745(_0x434450['error'][_0xd870('0x16')]);}else{logger[_0xd870('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x2269e8,_0xd870('0x12'));_0x4e9745(_0x434450[_0xd870('0x18')]['message']);}})[_0xd870('0x19')](function(_0x28fd22){logger['error'](_0xd870('0x11'),_0x2269e8,_0x28fd22);_0x4f1952(_0x28fd22);});});}
\ No newline at end of file
+var _0xbb8d=['./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x2eafe2,_0x2f3aba){var _0x259112=function(_0xc2f396){while(--_0xc2f396){_0x2eafe2['push'](_0x2eafe2['shift']());}};_0x259112(++_0x2f3aba);}(_0xbb8d,0x146));var _0xdbb8=function(_0x3f6a27,_0x171508){_0x3f6a27=_0x3f6a27-0x0;var _0x496be8=_0xbb8d[_0x3f6a27];return _0x496be8;};'use strict';var _=require(_0xdbb8('0x0'));var util=require('util');var moment=require(_0xdbb8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdbb8('0x2'))['db'];var utils=require(_0xdbb8('0x3'));var logger=require(_0xdbb8('0x4'))(_0xdbb8('0x5'));var config=require(_0xdbb8('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdbb8('0x7')][_0xdbb8('0x8')]({'port':0x232a});config[_0xdbb8('0x9')]=_[_0xdbb8('0xa')](config['redis'],{'host':_0xdbb8('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdbb8('0x9')]));require(_0xdbb8('0xc'))['register'](socket);function respondWithRpcPromise(_0x419cf4,_0x3e0aa5,_0x45c7af){return new BPromise(function(_0x3113b8,_0x2eb417){return client[_0xdbb8('0xd')](_0x419cf4,_0x45c7af)[_0xdbb8('0xe')](function(_0x2b2be9){logger[_0xdbb8('0xf')](_0xdbb8('0x10'),_0x3e0aa5,'request\x20sent');logger[_0xdbb8('0x11')](_0xdbb8('0x12'),_0x3e0aa5,_0xdbb8('0x13'),JSON[_0xdbb8('0x14')](_0x2b2be9));if(_0x2b2be9[_0xdbb8('0x15')]){if(_0x2b2be9[_0xdbb8('0x15')][_0xdbb8('0x16')]===0x1f4){logger[_0xdbb8('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x3e0aa5,_0x2b2be9[_0xdbb8('0x15')]['message']);return _0x2eb417(_0x2b2be9[_0xdbb8('0x15')][_0xdbb8('0x17')]);}logger[_0xdbb8('0x15')](_0xdbb8('0x10'),_0x3e0aa5,_0x2b2be9[_0xdbb8('0x15')]['message']);return _0x3113b8(_0x2b2be9[_0xdbb8('0x15')]['message']);}else{logger['info'](_0xdbb8('0x10'),_0x3e0aa5,'request\x20sent');_0x3113b8(_0x2b2be9[_0xdbb8('0x18')][_0xdbb8('0x17')]);}})[_0xdbb8('0x19')](function(_0xbfba8a){logger[_0xdbb8('0x15')](_0xdbb8('0x10'),_0x3e0aa5,_0xbfba8a);_0x2eb417(_0xbfba8a);});});}
\ No newline at end of file
index 24c68c0..7b7745e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x402f=['register','length','voicePrefix:','./voicePrefix.events','remove','emit'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x402f,0x6f));var _0xf402=function(_0xd396ee,_0x4688c4){_0xd396ee=_0xd396ee-0x0;var _0x4304a6=_0x402f[_0xd396ee];return _0x4304a6;};'use strict';var VoicePrefixEvents=require(_0xf402('0x0'));var events=['save',_0xf402('0x1'),'update'];function createListener(_0x588b83,_0x3ccbce){return function(_0xe1847c){_0x3ccbce[_0xf402('0x2')](_0x588b83,_0xe1847c);};}function removeListener(_0x4a52b8,_0x246c5f){return function(){VoicePrefixEvents['removeListener'](_0x4a52b8,_0x246c5f);};}exports[_0xf402('0x3')]=function(_0x270766){for(var _0x3a1d11=0x0,_0x2a8774=events[_0xf402('0x4')];_0x3a1d11<_0x2a8774;_0x3a1d11++){var _0x55c515=events[_0x3a1d11];var _0x4d1771=createListener(_0xf402('0x5')+_0x55c515,_0x270766);VoicePrefixEvents['on'](_0x55c515,_0x4d1771);}};
\ No newline at end of file
+var _0xc698=['update','emit','register','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x5948dd,_0x1f6ac8){var _0xb1f8be=function(_0x31a8d2){while(--_0x31a8d2){_0x5948dd['push'](_0x5948dd['shift']());}};_0xb1f8be(++_0x1f6ac8);}(_0xc698,0x85));var _0x8c69=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xc698[_0x3ce3c];return _0x55a2c9;};'use strict';var VoicePrefixEvents=require(_0x8c69('0x0'));var events=[_0x8c69('0x1'),_0x8c69('0x2'),_0x8c69('0x3')];function createListener(_0x3ecc28,_0x4ed5d2){return function(_0x5d804c){_0x4ed5d2[_0x8c69('0x4')](_0x3ecc28,_0x5d804c);};}function removeListener(_0x55386c,_0x1b1dae){return function(){VoicePrefixEvents['removeListener'](_0x55386c,_0x1b1dae);};}exports[_0x8c69('0x5')]=function(_0x5e8069){for(var _0x5c0109=0x0,_0x350620=events[_0x8c69('0x6')];_0x5c0109<_0x350620;_0x5c0109++){var _0x434e14=events[_0x5c0109];var _0x20a688=createListener(_0x8c69('0x7')+_0x434e14,_0x5e8069);VoicePrefixEvents['on'](_0x434e14,_0x20a688);}};
\ No newline at end of file
index 0a78c3b..d8dd76e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0xb10b,0x12a));var _0xbb10=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xb10b[_0x409682];return _0x1ee901;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
+var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x250ce7,_0x502ad3){var _0x416428=function(_0x46564d){while(--_0x46564d){_0x250ce7['push'](_0x250ce7['shift']());}};_0x416428(++_0x502ad3);}(_0xb10b,0x12a));var _0xbb10=function(_0x29b2d0,_0x73bf4b){_0x29b2d0=_0x29b2d0-0x0;var _0x4af937=_0xb10b[_0x29b2d0];return _0x4af937;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
index db2615f..752cdad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9113=['exports','name','inbound','outbound','STRING','default','ENUM','ringall','leastrecent','fewestcalls','linear','rrordered','setDataValue','rrmemory','getDataValue','type','strategy','preview','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize'];(function(_0x2284c4,_0xf1f627){var _0x5ea6fe=function(_0x209e1e){while(--_0x209e1e){_0x2284c4['push'](_0x2284c4['shift']());}};_0x5ea6fe(++_0xf1f627);}(_0x9113,0x13f));var _0x3911=function(_0xebe190,_0x271328){_0xebe190=_0xebe190-0x0;var _0x362b94=_0x9113[_0xebe190];return _0x362b94;};'use strict';var Sequelize=require(_0x3911('0x0'));module[_0x3911('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3911('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x3911('0x3'),_0x3911('0x4')),'allowNull':![],'defaultValue':_0x3911('0x3')},'musiconhold':{'type':Sequelize[_0x3911('0x5')],'defaultValue':_0x3911('0x6')},'announce':{'type':Sequelize[_0x3911('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3911('0x7')]('rr',_0x3911('0x8'),_0x3911('0x9'),_0x3911('0xa'),'random','rrmemory',_0x3911('0xb'),'wrandom',_0x3911('0xc')),'allowNull':![],'defaultValue':_0x3911('0x8'),'set':function(_0x4050a6){this[_0x3911('0xd')]('strategy',_0x4050a6?_0x4050a6:_0x3911('0xe'));},'get':function(){var _0x28d2b8=this[_0x3911('0xf')](_0x3911('0x10'));var _0x1075b8=this[_0x3911('0xf')]('dialMethod');var _0x2f6e39=this['getDataValue'](_0x3911('0x11'));if(_0x28d2b8==='outbound'){if(_0x1075b8===_0x3911('0x12')){return null;}if(_0x1075b8===_0x3911('0x13')&&!['rrmemory',_0x3911('0x14')][_0x3911('0x15')](_0x2f6e39)){this[_0x3911('0xd')](_0x3911('0x11'),_0x3911('0xe'));}}return _0x2f6e39;}},'servicelevel':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3911('0x16')](0xb)},'timeout':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3911('0x5')]},'weight':{'type':Sequelize[_0x3911('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no',_0x3911('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3911('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3911('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no',_0x3911('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3911('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3911('0x7')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x3911('0x5')]},'queue_youarenext':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3911('0x5')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x3911('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x3911('0x5')]},'queue_less_than':{'type':Sequelize[_0x3911('0x5')]},'periodic_announce':{'type':Sequelize[_0x3911('0x1a')],'set':function(_0x20ed2b){this[_0x3911('0xd')]('periodic_announce',_0x20ed2b?_0x20ed2b[_0x3911('0x1b')](','):[]);},'get':function(){return this[_0x3911('0xf')](_0x3911('0x1c'))?this[_0x3911('0xf')](_0x3911('0x1c'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x3911('0x5')],'defaultValue':'yes','set':function(_0x4602fa){this['setDataValue']('joinempty',_0x4602fa?_0x4602fa[_0x3911('0x1b')](','):undefined);},'get':function(){return this[_0x3911('0xf')]('joinempty')?this[_0x3911('0xf')](_0x3911('0x1d'))[_0x3911('0x1e')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x3911('0x5')],'defaultValue':'no','set':function(_0x3c9b61){this['setDataValue'](_0x3911('0x1f'),_0x3c9b61?_0x3c9b61[_0x3911('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x3911('0x1f'))?this[_0x3911('0xf')](_0x3911('0x1f'))[_0x3911('0x1e')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3911('0x7')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3911('0x5')]},'description':{'type':Sequelize[_0x3911('0x5')]},'acw':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'set':function(_0x3c9f2c){this[_0x3911('0xd')](_0x3911('0x21'),_0x3c9f2c);if(_0x3c9f2c){if(this[_0x3911('0xf')](_0x3911('0x22'))<0x2){this[_0x3911('0xd')](_0x3911('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3911('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x3911('0x7')]('preview',_0x3911('0x23'),_0x3911('0x24'),_0x3911('0x25'),'booked'),'defaultValue':_0x3911('0x23'),'comment':_0x3911('0x26')},'dialLimitChannel':{'type':Sequelize[_0x3911('0x16')](0x4)[_0x3911('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x3911('0x16')](0x4)[_0x3911('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3911('0x28')},'dialPowerLevel':{'type':Sequelize[_0x3911('0x29')](0x2)[_0x3911('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3911('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x3911('0x7')](_0x3911('0x2b'),'dropRate'),'defaultValue':_0x3911('0x2c'),'comment':_0x3911('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3911('0x29')](0x2)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x3911('0x27')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3911('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3911('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3911('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x3911('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x30')},'dialQueueProject':{'type':Sequelize[_0x3911('0x5')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3911('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3911('0x5')],'defaultValue':_0x3911('0x36')},'dialPrefix':{'type':Sequelize[_0x3911('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3911('0x37'),'never',_0x3911('0x38')),'defaultValue':_0x3911('0x37')},'dialAMDActive':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'comment':_0x3911('0x39')},'dialAMDInitialSilence':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3911('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3911('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3911('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3911('0x3d')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3911('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3911('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3911('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3911('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3911('0x16')](0x9)[_0x3911('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3911('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3911('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x3911('0x20')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x3911('0x7')]('DESC',_0x3911('0x43')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3911('0x44')},'dialCutDigit':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x3911('0x16')](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3911('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3911('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3911('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3911('0x16')],'allowNull':!![],'comment':_0x3911('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x3911('0x20')],'defaultValue':![],'comment':_0x3911('0x4f'),'set':function(_0xacfe84){if(!_0xacfe84)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0xacfe84);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3911('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x3911('0x16')](0x3)[_0x3911('0x27')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xbc95=['tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','ringall','leastrecent','random','linear','wrandom','setDataValue','strategy','rrmemory','type','getDataValue','dialMethod','outbound','roundrobin','includes','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','power','predictive','booked','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x311e99,_0x40ff5e){var _0x19a1a6=function(_0x3b5eb0){while(--_0x3b5eb0){_0x311e99['push'](_0x311e99['shift']());}};_0x19a1a6(++_0x40ff5e);}(_0xbc95,0xc4));var _0x5bc9=function(_0x327199,_0x1283db){_0x327199=_0x327199-0x0;var _0x5a7cf0=_0xbc95[_0x327199];return _0x5a7cf0;};'use strict';var Sequelize=require(_0x5bc9('0x0'));module[_0x5bc9('0x1')]={'name':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':![],'unique':_0x5bc9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x5bc9('0x5')},'musiconhold':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x5bc9('0x4')]('rr',_0x5bc9('0x6'),_0x5bc9('0x7'),'fewestcalls',_0x5bc9('0x8'),'rrmemory',_0x5bc9('0x9'),_0x5bc9('0xa'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x48d763){this[_0x5bc9('0xb')](_0x5bc9('0xc'),_0x48d763?_0x48d763:_0x5bc9('0xd'));},'get':function(){var _0x48ae56=this['getDataValue'](_0x5bc9('0xe'));var _0x2c64c3=this[_0x5bc9('0xf')](_0x5bc9('0x10'));var _0xc0a15e=this['getDataValue'](_0x5bc9('0xc'));if(_0x48ae56===_0x5bc9('0x11')){if(_0x2c64c3==='preview'){return null;}if(_0x2c64c3==='booked'&&![_0x5bc9('0xd'),_0x5bc9('0x12')][_0x5bc9('0x13')](_0xc0a15e)){this[_0x5bc9('0xb')](_0x5bc9('0xc'),'rrmemory');}}return _0xc0a15e;}},'servicelevel':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x5bc9('0x14')](0xb)},'timeout':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x5bc9('0x2')]},'weight':{'type':Sequelize[_0x5bc9('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':_0x5bc9('0x15')},'autopause':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no',_0x5bc9('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x5bc9('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x5bc9('0x4')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no',_0x5bc9('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x5bc9('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x5bc9('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x5bc9('0x2')]},'queue_youarenext':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x5bc9('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x5bc9('0x2')]},'queue_quantity1':{'type':Sequelize[_0x5bc9('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x5bc9('0x2')]},'periodic_announce':{'type':Sequelize[_0x5bc9('0x18')],'set':function(_0x37b8cd){this['setDataValue'](_0x5bc9('0x19'),_0x37b8cd?_0x37b8cd[_0x5bc9('0x1a')](','):[]);},'get':function(){return this['getDataValue'](_0x5bc9('0x19'))?this[_0x5bc9('0xf')](_0x5bc9('0x19'))[_0x5bc9('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':_0x5bc9('0x15'),'set':function(_0x37a40a){this[_0x5bc9('0xb')]('joinempty',_0x37a40a?_0x37a40a['join'](','):undefined);},'get':function(){return this[_0x5bc9('0xf')]('joinempty')?this['getDataValue']('joinempty')[_0x5bc9('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':'no','set':function(_0x2e7772){this['setDataValue']('leavewhenempty',_0x2e7772?_0x2e7772[_0x5bc9('0x1a')](','):undefined);},'get':function(){return this[_0x5bc9('0xf')](_0x5bc9('0x1c'))?this[_0x5bc9('0xf')]('leavewhenempty')[_0x5bc9('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x5bc9('0x2')]},'description':{'type':Sequelize[_0x5bc9('0x2')]},'acw':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':0x0,'set':function(_0x1498b5){this['setDataValue'](_0x5bc9('0x1e'),_0x1498b5);if(_0x1498b5){if(this[_0x5bc9('0xf')](_0x5bc9('0x1f'))<0x2){this[_0x5bc9('0xb')](_0x5bc9('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x5bc9('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':0x0,'comment':_0x5bc9('0x20')},'dialMethod':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x21'),_0x5bc9('0x22'),_0x5bc9('0x23'),_0x5bc9('0x24'),_0x5bc9('0x25')),'defaultValue':_0x5bc9('0x22'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x5bc9('0x14')](0x4)[_0x5bc9('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x5bc9('0x27')},'dialLimitQueue':{'type':Sequelize[_0x5bc9('0x14')](0x4)[_0x5bc9('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x5bc9('0x28')](0x2)[_0x5bc9('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x5bc9('0x29'),'dropRate'),'defaultValue':'dropRate','comment':_0x5bc9('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x5bc9('0x28')](0x2)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x5bc9('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x5bc9('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5bc9('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':_0x5bc9('0x2c'),'comment':_0x5bc9('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x5bc9('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x30')},'dialBusyMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'comment':_0x5bc9('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x34')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5bc9('0x35')},'dialTimezone':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x5bc9('0x36')},'dialPrefix':{'type':Sequelize[_0x5bc9('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x5bc9('0x4')](_0x5bc9('0x37'),_0x5bc9('0x38'),_0x5bc9('0x39')),'defaultValue':_0x5bc9('0x37')},'dialAMDActive':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':0x0,'comment':_0x5bc9('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x5bc9('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x5bc9('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5bc9('0x14')](0x9)[_0x5bc9('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5bc9('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5bc9('0x14')](0x9)[_0x5bc9('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5bc9('0x3c')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x5bc9('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5bc9('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5bc9('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5bc9('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5bc9('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5bc9('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5bc9('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5bc9('0x41')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x5bc9('0x42')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5bc9('0x43')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x5bc9('0x44'),_0x5bc9('0x45')),'defaultValue':_0x5bc9('0x44')},'dialQueueProject2':{'type':Sequelize[_0x5bc9('0x2')],'comment':_0x5bc9('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5bc9('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5bc9('0x46')},'dialCutDigit':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5bc9('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5bc9('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5bc9('0x14')](0x5)[_0x5bc9('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5bc9('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5bc9('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':![],'comment':_0x5bc9('0x4e'),'set':function(_0x306df0){if(!_0x306df0)this[_0x5bc9('0xb')]('mandatoryDispositionPauseId',null);this[_0x5bc9('0xb')](_0x5bc9('0x4f'),_0x306df0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x5bc9('0x1d')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x5bc9('0x14')](0x3)[_0x5bc9('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 86c440e..54db0da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe829=['CmListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','insert','into','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBy+1','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','VoiceQueues','inbound','QueueCampaigns','outbound','map','value','find','type','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','omit','createdAt','updatedAt','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','CmHopper','VoiceQueueId','count','findOne','CmHopperHistory','hasOwnProperty','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','TeamId','includes','all','union','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','fromQuery','scheduledAt','ContactId','ListId','phone'];(function(_0x92cf25,_0x314e80){var _0x9ac78c=function(_0x118881){while(--_0x118881){_0x92cf25['push'](_0x92cf25['shift']());}};_0x9ac78c(++_0x314e80);}(_0xe829,0xde));var _0x9e82=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xe829[_0x46d0c9];return _0x174506;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e82('0x0'));var zipdir=require(_0x9e82('0x1'));var jsonpatch=require(_0x9e82('0x2'));var rp=require(_0x9e82('0x3'));var moment=require(_0x9e82('0x4'));var BPromise=require(_0x9e82('0x5'));var Mustache=require('mustache');var util=require(_0x9e82('0x6'));var path=require(_0x9e82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9e82('0x8'));var _=require(_0x9e82('0x9'));var squel=require(_0x9e82('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e82('0xb'));var deskjs=require(_0x9e82('0xc'));var toCsv=require(_0x9e82('0xd'));var querystring=require(_0x9e82('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e82('0xf'));var authService=require(_0x9e82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9e82('0x11'));var hardwareService=require(_0x9e82('0x12'));var logger=require('../../config/logger')(_0x9e82('0x13'));var utils=require(_0x9e82('0x14'));var config=require(_0x9e82('0x15'));var licenseUtil=require(_0x9e82('0x16'));var db=require(_0x9e82('0x17'))['db'];config['redis']=_[_0x9e82('0x18')](config[_0x9e82('0x19')],{'host':_0x9e82('0x1a'),'port':0x18eb});var socket=require(_0x9e82('0x1b'))(new Redis(config['redis']));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x4aaa5f,_0x5909a6){_0x5909a6=_0x5909a6||0xcc;return function(_0xa4bd12){if(_0xa4bd12){return _0x4aaa5f['sendStatus'](_0x5909a6);}return _0x4aaa5f[_0x9e82('0x1c')](_0x5909a6)[_0x9e82('0x1d')]();};}function respondWithResult(_0x1bdf3f,_0x37cea0){_0x37cea0=_0x37cea0||0xc8;return function(_0x4fa628){if(_0x4fa628){return _0x1bdf3f[_0x9e82('0x1c')](_0x37cea0)[_0x9e82('0x1e')](_0x4fa628);}};}function respondWithFilteredResult(_0x4e5203,_0x495af4){return function(_0x2a0afd){if(_0x2a0afd){var _0x1554b5=typeof _0x495af4[_0x9e82('0x1f')]===_0x9e82('0x20')&&typeof _0x495af4[_0x9e82('0x21')]===_0x9e82('0x20');var _0xaeaa71=_0x2a0afd['count'];var _0x243a46=_0x1554b5?0x0:_0x495af4[_0x9e82('0x1f')];var _0x3463e6=_0x1554b5?_0x2a0afd['count']:_0x495af4[_0x9e82('0x1f')]+_0x495af4['limit'];var _0x2e8cec;if(_0x3463e6>=_0xaeaa71){_0x3463e6=_0xaeaa71;_0x2e8cec=0xc8;}else{_0x2e8cec=0xce;}_0x4e5203[_0x9e82('0x1c')](_0x2e8cec);return _0x4e5203[_0x9e82('0x22')](_0x9e82('0x23'),_0x243a46+'-'+_0x3463e6+'/'+_0xaeaa71)[_0x9e82('0x1e')](_0x2a0afd);}return null;};}function patchUpdates(_0x4d23ed){return function(_0x8eabaa){try{jsonpatch[_0x9e82('0x24')](_0x8eabaa,_0x4d23ed,!![]);}catch(_0x221969){return BPromise[_0x9e82('0x25')](_0x221969);}return _0x8eabaa['save']();};}function saveUpdates(_0x551f4d,_0x2f7d3f){return function(_0x16e006){if(_0x16e006){return _0x16e006[_0x9e82('0x26')](_0x551f4d)[_0x9e82('0x27')](function(_0x1840ae){return _0x1840ae;});}return null;};}function removeEntity(_0x10628d,_0x54ffa4){return function(_0x18c645){if(_0x18c645){return _0x18c645['destroy']()['then'](function(){var _0x2cb910=_0x18c645['get']({'plain':!![]});var _0x5a5a4e=[{'name':_0x9e82('0x28'),'value':_0x9e82('0x29'),'ignore':![]},{'name':_0x9e82('0x2a'),'value':_0x9e82('0x2b'),'ignore':![]}];var _0x19491d=_(_0x5a5a4e)['filter']('ignore')[_0x9e82('0x2c')](_0x9e82('0x2d'))[_0x9e82('0x2d')]();if(_['includes'](_0x19491d,_0x2cb910['type'])){return;}var _0x3a2acf=_[_0x9e82('0x2e')](_0x5a5a4e,[_0x9e82('0x2d'),_0x2cb910[_0x9e82('0x2f')]])[_0x9e82('0x30')];return db[_0x9e82('0x31')]['destroy']({'where':{'type':_0x3a2acf,'resourceId':_0x2cb910['id']}})['then'](function(){return _0x18c645;});})['then'](function(){_0x10628d['status'](0xcc)[_0x9e82('0x1d')]();});}};}function handleEntityNotFound(_0x2a9fbf,_0x369ffc){return function(_0x4bcedd){if(!_0x4bcedd){_0x2a9fbf[_0x9e82('0x32')](0x194);}return _0x4bcedd;};}function handleError(_0x4398c7,_0x5f08fc){_0x5f08fc=_0x5f08fc||0x1f4;return function(_0x38be79){logger[_0x9e82('0x33')](_0x38be79[_0x9e82('0x34')]);if(_0x38be79[_0x9e82('0x30')]){delete _0x38be79[_0x9e82('0x30')];}_0x4398c7[_0x9e82('0x1c')](_0x5f08fc)[_0x9e82('0x35')](_0x38be79);};}exports[_0x9e82('0x36')]=function(_0x440b32,_0x454130){var _0xb3f1d1={},_0xfe2faa={},_0x17bf99={'count':0x0,'rows':[]};var _0x1f5028=_[_0x9e82('0x2c')](db[_0x9e82('0x37')][_0x9e82('0x38')],function(_0x386c4a){return{'name':_0x386c4a[_0x9e82('0x39')],'type':_0x386c4a[_0x9e82('0x2f')][_0x9e82('0x3a')]};});_0xfe2faa[_0x9e82('0x3b')]=_[_0x9e82('0x2c')](_0x1f5028,_0x9e82('0x30'));_0xfe2faa[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x440b32[_0x9e82('0x3c')]);_0xfe2faa['filters']=_['intersection'](_0xfe2faa['model'],_0xfe2faa['query']);_0xb3f1d1[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0xfe2faa[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x440b32[_0x9e82('0x3c')][_0x9e82('0x40')]));_0xb3f1d1[_0x9e82('0x3e')]=_0xb3f1d1[_0x9e82('0x3e')][_0x9e82('0x41')]?_0xb3f1d1[_0x9e82('0x3e')]:_0xfe2faa[_0x9e82('0x3b')];if(!_0x440b32[_0x9e82('0x3c')]['hasOwnProperty'](_0x9e82('0x42'))){_0xb3f1d1[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x440b32['query'][_0x9e82('0x21')]);_0xb3f1d1[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x440b32['query'][_0x9e82('0x1f')]);}_0xb3f1d1[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x440b32[_0x9e82('0x3c')][_0x9e82('0x44')]);_0xb3f1d1[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x440b32[_0x9e82('0x3c')],_0xfe2faa[_0x9e82('0x46')]),_0x1f5028);if(_0x440b32[_0x9e82('0x3c')]['filter']){_0xb3f1d1[_0x9e82('0x45')]=_[_0x9e82('0x48')](_0xb3f1d1[_0x9e82('0x45')],{'$or':_['map'](_0x1f5028,function(_0x5c1542){if(_0x5c1542['type']!==_0x9e82('0x49')){var _0x17df58={};_0x17df58[_0x5c1542[_0x9e82('0x30')]]={'$like':'%'+_0x440b32['query'][_0x9e82('0x4a')]+'%'};return _0x17df58;}})});}_0xb3f1d1=_[_0x9e82('0x48')]({},_0xb3f1d1,_0x440b32[_0x9e82('0x4b')]);var _0x6b23bf={'where':_0xb3f1d1[_0x9e82('0x45')]};return db[_0x9e82('0x37')]['count'](_0x6b23bf)[_0x9e82('0x27')](function(_0x5a54be){_0x17bf99['count']=_0x5a54be;if(_0x440b32[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0xb3f1d1[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x37')][_0x9e82('0x4e')](_0xb3f1d1);})[_0x9e82('0x27')](function(_0x3780b0){_0x17bf99[_0x9e82('0x4f')]=_0x3780b0;return _0x17bf99;})['then'](respondWithFilteredResult(_0x454130,_0xb3f1d1))[_0x9e82('0x50')](handleError(_0x454130,null));};exports['show']=function(_0x26137e,_0x2ccaa3){var _0x800eff={'raw':![],'where':{'id':_0x26137e[_0x9e82('0x51')]['id']}},_0x3b5641={};_0x3b5641[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x37')][_0x9e82('0x38')]);_0x3b5641['query']=_[_0x9e82('0x3d')](_0x26137e[_0x9e82('0x3c')]);_0x3b5641[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x3b5641[_0x9e82('0x3b')],_0x3b5641[_0x9e82('0x3c')]);_0x800eff[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x3b5641[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x26137e[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x800eff[_0x9e82('0x3e')]=_0x800eff[_0x9e82('0x3e')]['length']?_0x800eff[_0x9e82('0x3e')]:_0x3b5641[_0x9e82('0x3b')];if(_0x26137e[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x800eff[_0x9e82('0x4d')]=[{'all':!![]}];}_0x800eff=_[_0x9e82('0x48')]({},_0x800eff,_0x26137e[_0x9e82('0x4b')]);return db[_0x9e82('0x37')][_0x9e82('0x2e')](_0x800eff)[_0x9e82('0x27')](handleEntityNotFound(_0x2ccaa3,null))[_0x9e82('0x27')](respondWithResult(_0x2ccaa3,null))[_0x9e82('0x50')](handleError(_0x2ccaa3,null));};exports[_0x9e82('0x52')]=function(_0x30414c,_0x862b8f){return db['VoiceQueue'][_0x9e82('0x52')](_0x30414c[_0x9e82('0x53')],{})[_0x9e82('0x27')](function(_0x55f4e4){var _0x3cdc48=_0x30414c[_0x9e82('0x54')][_0x9e82('0x55')]({'plain':!![]});if(!_0x3cdc48)throw new Error(_0x9e82('0x56'));if(_0x3cdc48['role']===_0x9e82('0x54')){var _0x2c943c=_0x55f4e4[_0x9e82('0x55')]({'plain':!![]});var _0x4081b1=[{'name':'VoiceQueues','value':_0x9e82('0x29')},{'name':_0x9e82('0x2a'),'value':'outbound'}];var _0x4ce858=_[_0x9e82('0x2e')](_0x4081b1,[_0x9e82('0x2d'),_0x2c943c[_0x9e82('0x2f')]])[_0x9e82('0x30')];return db[_0x9e82('0x57')]['find']({'where':{'name':_0x4ce858,'userProfileId':_0x3cdc48[_0x9e82('0x58')]},'raw':!![]})['then'](function(_0x10fb8a){if(_0x10fb8a&&_0x10fb8a[_0x9e82('0x59')]===0x0){return db[_0x9e82('0x31')][_0x9e82('0x52')]({'name':_0x2c943c[_0x9e82('0x30')],'resourceId':_0x2c943c['id'],'type':_0x10fb8a[_0x9e82('0x30')],'sectionId':_0x10fb8a['id']},{})[_0x9e82('0x27')](function(){return _0x55f4e4;});}else{return _0x55f4e4;}})['catch'](function(_0x2c782d){logger[_0x9e82('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c782d);throw _0x2c782d;});}return _0x55f4e4;})['then'](respondWithResult(_0x862b8f,0xc9))['catch'](handleError(_0x862b8f,null));};exports['clone']=function(_0x432351,_0x4051d5){var _0x8e32c8={'where':{'id':_0x432351[_0x9e82('0x51')]['id']}},_0xa83d85={};_0xa83d85['model']=_[_0x9e82('0x3d')](db[_0x9e82('0x37')][_0x9e82('0x38')]);_0x8e32c8[_0x9e82('0x3e')]=_['intersection'](_0xa83d85['model'],qs['fields'](_0x432351[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x8e32c8[_0x9e82('0x3e')]=_0x8e32c8[_0x9e82('0x3e')]['length']?_0x8e32c8[_0x9e82('0x3e')]:_0xa83d85[_0x9e82('0x3b')];if(_0x432351[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x8e32c8[_0x9e82('0x4d')]=[{'all':!![]}];}_0x8e32c8=_[_0x9e82('0x48')]({},_0x8e32c8,_0x432351[_0x9e82('0x4b')]);return db[_0x9e82('0x37')][_0x9e82('0x2e')](_0x8e32c8)[_0x9e82('0x27')](handleEntityNotFound(_0x4051d5,null))[_0x9e82('0x27')](function(_0x1fa68e){if(_0x1fa68e){var _0x2f3dbb=_0x1fa68e[_0x9e82('0x55')]({'plain':!![]});_0x2f3dbb=qs[_0x9e82('0x5a')](_0x2f3dbb,['id',_0x9e82('0x5b'),_0x9e82('0x5c')]);_0x432351['body']=_['omit'](_0x432351['body'],['id',_0x9e82('0x5b'),_0x9e82('0x5c')]);return db[_0x9e82('0x37')]['create'](_[_0x9e82('0x48')](_0x2f3dbb,_0x432351[_0x9e82('0x53')]),{'include':_0x432351['query'][_0x9e82('0x4c')]?[{'all':!![]}]:undefined})[_0x9e82('0x27')](function(_0x3dc13a){var _0x1acc06=_0x432351[_0x9e82('0x54')][_0x9e82('0x55')]({'plain':!![]});if(!_0x1acc06)throw new Error(_0x9e82('0x56'));if(_0x1acc06[_0x9e82('0x5d')]==='user'){var _0x429651=_0x3dc13a[_0x9e82('0x55')]({'plain':!![]});var _0x1ba149=[{'name':_0x9e82('0x28'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x9e82('0x2b')}];var _0x388e4f=_[_0x9e82('0x2e')](_0x1ba149,[_0x9e82('0x2d'),_0x429651[_0x9e82('0x2f')]])[_0x9e82('0x30')];return db[_0x9e82('0x57')][_0x9e82('0x2e')]({'where':{'name':_0x388e4f,'userProfileId':_0x1acc06[_0x9e82('0x58')]},'raw':!![]})['then'](function(_0x3c86b9){if(_0x3c86b9&&_0x3c86b9[_0x9e82('0x59')]===0x0){return db[_0x9e82('0x31')]['create']({'name':_0x429651[_0x9e82('0x30')],'resourceId':_0x429651['id'],'type':_0x3c86b9['name'],'sectionId':_0x3c86b9['id']},{})[_0x9e82('0x27')](function(){return _0x3dc13a;});}else{return _0x3dc13a;}})[_0x9e82('0x50')](function(_0x2941ea){logger[_0x9e82('0x33')](_0x9e82('0x5e'),_0x2941ea);throw _0x2941ea;});}return _0x3dc13a;});}})[_0x9e82('0x27')](respondWithResult(_0x4051d5,0xc9))['catch'](handleError(_0x4051d5,null));};exports[_0x9e82('0x26')]=function(_0x482d28,_0x37d21d){if(_0x482d28['body']['id']){delete _0x482d28['body']['id'];}return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x482d28['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x37d21d,null))[_0x9e82('0x27')](saveUpdates(_0x482d28[_0x9e82('0x53')],null))['then'](respondWithResult(_0x37d21d,null))[_0x9e82('0x50')](handleError(_0x37d21d,null));};exports[_0x9e82('0x5f')]=function(_0x150277,_0x3de159){return db['VoiceQueue'][_0x9e82('0x2e')]({'where':{'id':_0x150277[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x3de159,null))[_0x9e82('0x27')](removeEntity(_0x3de159,null))[_0x9e82('0x50')](handleError(_0x3de159,null));};exports[_0x9e82('0x60')]=function(_0x276e91,_0x1dbed9,_0x264d51){var _0x2b113c={'raw':![],'where':{}};var _0x38b1a1={};var _0x15eb8e={'count':0x0,'rows':[]};return db[_0x9e82('0x37')]['findOne']({'where':{'id':_0x276e91[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x1dbed9,null))['then'](function(_0x164d25){if(_0x164d25){_0x38b1a1[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x61')]['rawAttributes']);_0x38b1a1[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x276e91[_0x9e82('0x3c')]);_0x38b1a1[_0x9e82('0x46')]=_['intersection'](_0x38b1a1[_0x9e82('0x3b')],_0x38b1a1['query']);_0x2b113c[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x38b1a1[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x276e91[_0x9e82('0x3c')]['fields']));_0x2b113c[_0x9e82('0x3e')]=_0x2b113c['attributes'][_0x9e82('0x41')]?_0x2b113c[_0x9e82('0x3e')]:_0x38b1a1[_0x9e82('0x3b')];if(!_0x276e91['query']['hasOwnProperty']('nolimit')){_0x2b113c['limit']=qs[_0x9e82('0x21')](_0x276e91[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x2b113c[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x276e91[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x2b113c[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x276e91[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x2b113c[_0x9e82('0x45')]=qs['filters'](_[_0x9e82('0x47')](_0x276e91[_0x9e82('0x3c')],_0x38b1a1[_0x9e82('0x46')]));_0x2b113c[_0x9e82('0x45')][_0x9e82('0x62')]=_0x164d25['id'];if(_0x276e91[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x2b113c['where']=_[_0x9e82('0x48')](_0x2b113c[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x2b113c[_0x9e82('0x3e')],function(_0x4ec174){var _0x360de8={};_0x360de8[_0x4ec174]={'$like':'%'+_0x276e91['query'][_0x9e82('0x4a')]+'%'};return _0x360de8;})});}_0x2b113c=_[_0x9e82('0x48')]({},_0x2b113c,_0x276e91[_0x9e82('0x4b')]);return db[_0x9e82('0x61')][_0x9e82('0x63')]({'where':_0x2b113c[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0x1544e8){_0x15eb8e['count']=_0x1544e8;if(_0x276e91[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x2b113c['include']=[{'all':!![]}];}return db[_0x9e82('0x61')][_0x9e82('0x4e')](_0x2b113c);})[_0x9e82('0x27')](function(_0x46dfbb){_0x15eb8e['rows']=_0x46dfbb;return _0x15eb8e;});}})[_0x9e82('0x27')](respondWithFilteredResult(_0x1dbed9,_0x2b113c))[_0x9e82('0x50')](handleError(_0x1dbed9,null));};exports['getHopperHistories']=function(_0x2b72d7,_0x23dade,_0x2fc049){var _0x5332e5={'raw':!![],'where':{}};var _0x180893={};var _0x32be55={'count':0x0,'rows':[]};return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x2b72d7[_0x9e82('0x51')]['id']}})['then'](handleEntityNotFound(_0x23dade,null))[_0x9e82('0x27')](function(_0x440ad1){if(_0x440ad1){_0x180893[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x65')][_0x9e82('0x38')]);_0x180893[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x2b72d7[_0x9e82('0x3c')]);_0x180893[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x180893['model'],_0x180893['query']);_0x5332e5['attributes']=_['intersection'](_0x180893['model'],qs[_0x9e82('0x40')](_0x2b72d7['query'][_0x9e82('0x40')]));_0x5332e5[_0x9e82('0x3e')]=_0x5332e5['attributes'][_0x9e82('0x41')]?_0x5332e5[_0x9e82('0x3e')]:_0x180893[_0x9e82('0x3b')];if(!_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x5332e5[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x5332e5['offset']=qs[_0x9e82('0x1f')](_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x5332e5[_0x9e82('0x43')]=qs['sort'](_0x2b72d7['query'][_0x9e82('0x44')]);_0x5332e5[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x2b72d7[_0x9e82('0x3c')],_0x180893['filters']));_0x5332e5[_0x9e82('0x45')]['VoiceQueueId']=_0x440ad1['id'];if(_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x5332e5[_0x9e82('0x45')]=_['merge'](_0x5332e5[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x5332e5[_0x9e82('0x3e')],function(_0x428db3){var _0x17f74b={};_0x17f74b[_0x428db3]={'$like':'%'+_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x17f74b;})});}_0x5332e5=_[_0x9e82('0x48')]({},_0x5332e5,_0x2b72d7[_0x9e82('0x4b')]);return db['CmHopperHistory'][_0x9e82('0x63')]({'where':_0x5332e5[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0x3005d7){_0x32be55[_0x9e82('0x63')]=_0x3005d7;if(_0x2b72d7[_0x9e82('0x3c')][_0x9e82('0x4c')]){_0x5332e5[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x65')]['findAll'](_0x5332e5);})[_0x9e82('0x27')](function(_0x189c1b){_0x32be55[_0x9e82('0x4f')]=_0x189c1b;return _0x32be55;});}})[_0x9e82('0x27')](respondWithFilteredResult(_0x23dade,_0x5332e5))[_0x9e82('0x50')](handleError(_0x23dade,null));};exports[_0x9e82('0x67')]=function(_0x455c96,_0x369984,_0x14f557){var _0x1c8688={'raw':!![],'where':{}};var _0x1b6cfe={};var _0x643263={'count':0x0,'rows':[]};return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x455c96[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x369984,null))[_0x9e82('0x27')](function(_0x4d2ce2){if(_0x4d2ce2){_0x1b6cfe[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x68')]['rawAttributes']);_0x1b6cfe[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x455c96[_0x9e82('0x3c')]);_0x1b6cfe[_0x9e82('0x46')]=_['intersection'](_0x1b6cfe['model'],_0x1b6cfe[_0x9e82('0x3c')]);_0x1c8688[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x1b6cfe[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x455c96[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x1c8688[_0x9e82('0x3e')]=_0x1c8688['attributes']['length']?_0x1c8688[_0x9e82('0x3e')]:_0x1b6cfe[_0x9e82('0x3b')];if(!_0x455c96['query']['hasOwnProperty'](_0x9e82('0x42'))){_0x1c8688['limit']=qs[_0x9e82('0x21')](_0x455c96['query'][_0x9e82('0x21')]);_0x1c8688[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x455c96[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x1c8688[_0x9e82('0x43')]=qs['sort'](_0x455c96[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x1c8688[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x455c96[_0x9e82('0x3c')],_0x1b6cfe[_0x9e82('0x46')]));_0x1c8688[_0x9e82('0x45')][_0x9e82('0x62')]=_0x4d2ce2['id'];if(_0x455c96[_0x9e82('0x3c')]['filter']){_0x1c8688[_0x9e82('0x45')]=_['merge'](_0x1c8688['where'],{'$or':_[_0x9e82('0x2c')](_0x1c8688[_0x9e82('0x3e')],function(_0x4f3f2e){var _0x48d66b={};_0x48d66b[_0x4f3f2e]={'$like':'%'+_0x455c96[_0x9e82('0x3c')]['filter']+'%'};return _0x48d66b;})});}_0x1c8688=_[_0x9e82('0x48')]({},_0x1c8688,_0x455c96['options']);return db[_0x9e82('0x68')][_0x9e82('0x63')]({'where':_0x1c8688[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0x3df288){_0x643263[_0x9e82('0x63')]=_0x3df288;if(_0x455c96['query'][_0x9e82('0x4c')]){_0x1c8688[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x68')][_0x9e82('0x4e')](_0x1c8688);})[_0x9e82('0x27')](function(_0x1805f3){_0x643263[_0x9e82('0x4f')]=_0x1805f3;return _0x643263;});}})['then'](respondWithFilteredResult(_0x369984,_0x1c8688))['catch'](handleError(_0x369984,null));};exports[_0x9e82('0x69')]=function(_0x41b4e0,_0x199766,_0x53bec3){var _0x2bbc35={'raw':!![],'where':{}};var _0x52e24d={};var _0x123c58={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9e82('0x64')]({'where':{'id':_0x41b4e0['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x199766,null))[_0x9e82('0x27')](function(_0x21cf0a){if(_0x21cf0a){_0x52e24d[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x6a')][_0x9e82('0x38')]);_0x52e24d[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x41b4e0['query']);_0x52e24d[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x52e24d[_0x9e82('0x3b')],_0x52e24d['query']);_0x2bbc35[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x52e24d[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x2bbc35[_0x9e82('0x3e')]=_0x2bbc35[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x2bbc35[_0x9e82('0x3e')]:_0x52e24d[_0x9e82('0x3b')];if(!_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x2bbc35[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x2bbc35[_0x9e82('0x1f')]=qs['offset'](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x1f')]);}_0x2bbc35['order']=qs['sort'](_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x2bbc35[_0x9e82('0x45')]=qs['filters'](_[_0x9e82('0x47')](_0x41b4e0[_0x9e82('0x3c')],_0x52e24d[_0x9e82('0x46')]));_0x2bbc35[_0x9e82('0x45')][_0x9e82('0x62')]=_0x21cf0a['id'];if(_0x41b4e0['query'][_0x9e82('0x4a')]){_0x2bbc35['where']=_[_0x9e82('0x48')](_0x2bbc35[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x2bbc35[_0x9e82('0x3e')],function(_0x411f9d){var _0x28cdb4={};_0x28cdb4[_0x411f9d]={'$like':'%'+_0x41b4e0[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x28cdb4;})});}_0x2bbc35=_[_0x9e82('0x48')]({},_0x2bbc35,_0x41b4e0[_0x9e82('0x4b')]);return db['CmHopperBlack'][_0x9e82('0x63')]({'where':_0x2bbc35[_0x9e82('0x45')]})[_0x9e82('0x27')](function(_0xd9a81c){_0x123c58[_0x9e82('0x63')]=_0xd9a81c;if(_0x41b4e0['query']['includeAll']){_0x2bbc35[_0x9e82('0x4d')]=[{'all':!![]}];}return db[_0x9e82('0x6a')][_0x9e82('0x4e')](_0x2bbc35);})[_0x9e82('0x27')](function(_0x412797){_0x123c58[_0x9e82('0x4f')]=_0x412797;return _0x123c58;});}})[_0x9e82('0x27')](respondWithFilteredResult(_0x199766,_0x2bbc35))[_0x9e82('0x50')](handleError(_0x199766,null));};exports[_0x9e82('0x6b')]=function(_0x5b0b69,_0x279d35,_0x19c8f4){var _0x3a36ff={};var _0x5ac1ae={};var _0xec0b3a;var _0x1fe1f4;return db[_0x9e82('0x37')]['findOne']({'where':{'id':_0x5b0b69[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x279d35,null))['then'](function(_0x23879e){if(_0x23879e){_0xec0b3a=_0x23879e;_0x5ac1ae[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x6c')][_0x9e82('0x38')]);_0x5ac1ae[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x5b0b69['query']);_0x5ac1ae[_0x9e82('0x46')]=_['intersection'](_0x5ac1ae['model'],_0x5ac1ae[_0x9e82('0x3c')]);_0x3a36ff[_0x9e82('0x3e')]=_['intersection'](_0x5ac1ae[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x3a36ff[_0x9e82('0x3e')]=_0x3a36ff[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x3a36ff[_0x9e82('0x3e')]:_0x5ac1ae[_0x9e82('0x3b')];_0x3a36ff[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x3a36ff[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x5b0b69[_0x9e82('0x3c')],_0x5ac1ae[_0x9e82('0x46')]));if(_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x3a36ff['where']=_[_0x9e82('0x48')](_0x3a36ff[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x3a36ff[_0x9e82('0x3e')],function(_0x1f38d4){var _0x7a1897={};_0x7a1897[_0x1f38d4]={'$like':'%'+_0x5b0b69[_0x9e82('0x3c')]['filter']+'%'};return _0x7a1897;})});}_0x3a36ff=_[_0x9e82('0x48')]({},_0x3a36ff,_0x5b0b69[_0x9e82('0x4b')]);return _0xec0b3a[_0x9e82('0x6b')](_0x3a36ff);}})[_0x9e82('0x27')](function(_0x567f60){if(_0x567f60){_0x1fe1f4=_0x567f60[_0x9e82('0x41')];if(!_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x3a36ff[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x3a36ff[_0x9e82('0x1f')]=qs['offset'](_0x5b0b69[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0xec0b3a['getTeams'](_0x3a36ff);}})['then'](function(_0x437844){if(_0x437844){return _0x437844?{'count':_0x1fe1f4,'rows':_0x437844}:null;}})[_0x9e82('0x27')](respondWithResult(_0x279d35,null))[_0x9e82('0x50')](handleError(_0x279d35,null));};exports[_0x9e82('0x6d')]=function(_0x5584ac,_0x149549,_0x34926e){var _0x4f53d4=_0x5584ac[_0x9e82('0x53')][_0x9e82('0x6e')];var _0x70183f=_[_0x9e82('0x2c')](_0x4f53d4,'id');return db[_0x9e82('0x6c')][_0x9e82('0x4e')]({'where':{'id':_0x70183f},'attributes':['id'],'include':[{'model':db[_0x9e82('0x6f')],'as':_0x9e82('0x70'),'attributes':['id',_0x9e82('0x30'),_0x9e82('0x71'),'voicePause',_0x9e82('0x72')],'raw':!![]}]})['then'](function(_0x299c44){if(_0x299c44){var _0x22c241=_[_0x9e82('0x73')](_0x299c44,function(_0x322cd3){var _0x2bca75=_0x322cd3[_0x9e82('0x55')]({'plain':!![]});_0x2bca75[_0x9e82('0x70')][_0x9e82('0x74')](function(_0x433db1){_0x433db1[_0x9e82('0x75')]=_['find'](_0x4f53d4,{'id':_0x2bca75['id']})[_0x9e82('0x75')];});return _0x2bca75['Agents'];});return db[_0x9e82('0x37')]['find']({'where':{'id':_0x5584ac[_0x9e82('0x51')]['id']}})['then'](function(_0x37d1bd){return db[_0x9e82('0x76')][_0x9e82('0x77')](function(_0x6f4370){return _0x37d1bd[_0x9e82('0x6d')](_0x70183f,{'transaction':_0x6f4370})[_0x9e82('0x27')](function(){return BPromise[_0x9e82('0x78')](_0x4f53d4,function(_0x2000d5){return db[_0x9e82('0x79')][_0x9e82('0x7a')]({'TeamId':_0x2000d5['id'],'VoiceQueueId':_0x5584ac['params']['id'],'penalty':_0x2000d5[_0x9e82('0x75')]},{'transaction':_0x6f4370});});})[_0x9e82('0x27')](function(){return BPromise['each'](_0x22c241,function(_0x39530f){return db[_0x9e82('0x7b')]['findOrCreate']({'where':{'UserId':_0x39530f['id'],'VoiceQueueId':_0x5584ac[_0x9e82('0x51')]['id']},'defaults':{'penalty':_0x39530f['penalty']},'transaction':_0x6f4370});});})[_0x9e82('0x27')](function(){return BPromise['each'](_[_0x9e82('0x4a')](_0x22c241,{'online':!![]}),function(_0x3efb51){return db[_0x9e82('0x7c')][_0x9e82('0x7a')]({'membername':_0x3efb51[_0x9e82('0x30')],'UserId':_0x3efb51['id'],'queue_name':_0x37d1bd['name'],'VoiceQueueId':_0x37d1bd['id'],'interface':_[_0x9e82('0x7d')](_0x3efb51['interface'])?util[_0x9e82('0x7e')](_0x9e82('0x7f'),_0x3efb51[_0x9e82('0x30')]):_0x3efb51[_0x9e82('0x72')],'paused':_0x3efb51[_0x9e82('0x80')]||![],'penalty':_0x3efb51[_0x9e82('0x75')]},{'transaction':_0x6f4370});});})['then'](function(){_0x22c241[_0x9e82('0x74')](function(_0x46a977){socket[_0x9e82('0x81')](_0x9e82('0x82'),{'UserId':_0x46a977['id'],'VoiceQueueId':_0x37d1bd['id']});});});});});}})[_0x9e82('0x27')](respondWithStatusCode(_0x149549,null))[_0x9e82('0x50')](handleError(_0x149549,null));};exports[_0x9e82('0x83')]=function(_0x3b75b4,_0x263715,_0x4e6e16){return db[_0x9e82('0x6c')][_0x9e82('0x4e')]({'where':{'id':_0x3b75b4[_0x9e82('0x3c')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9e82('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x263715,null))['then'](function(_0xae75d6){var _0xfe6bd6=_[_0x9e82('0x2c')](_0xae75d6,'id');var _0x1321fc=[];var _0x2d1b6a=[];var _0x43cfcb=squel[_0x9e82('0x84')]();_0x43cfcb[_0x9e82('0x85')](_0x9e82('0x86'))['from'](_0x9e82('0x87'),'tq')[_0x9e82('0x88')](_0x9e82('0x89'),'ut',_0x9e82('0x8a'))['where']('VoiceQueueId\x20=\x20?',_0x3b75b4[_0x9e82('0x51')]['id']);for(var _0x3d04a0=0x0;_0x3d04a0<_0xae75d6[_0x9e82('0x41')];_0x3d04a0+=0x1){let _0x21ae02=_0xae75d6[_0x3d04a0];for(var _0x15ab98=0x0;_0x15ab98<_0x21ae02['Agents']['length'];_0x15ab98+=0x1){let _0x5f5a5b=_0x21ae02[_0x9e82('0x70')][_0x15ab98];var _0x1b5a41=_0x43cfcb[_0x9e82('0x8b')]();_0x1b5a41['where']('ut.UserId\x20=\x20?',_0x5f5a5b['id']);_0x2d1b6a[_0x9e82('0x8c')](db[_0x9e82('0x76')]['query'](_0x1b5a41[_0x9e82('0x8d')](),{'type':db[_0x9e82('0x76')][_0x9e82('0x8e')]['SELECT']})[_0x9e82('0x27')](function(_0x35bd76){if(_0x35bd76[_0x9e82('0x41')]===0x1){return _0x5f5a5b['id'];}else{var _0x307640=_['every'](_[_0x9e82('0x2c')](_0x35bd76,_0x9e82('0x8f')),function(_0x50c68e){return _[_0x9e82('0x90')](_0xfe6bd6,_0x50c68e);});if(_0x307640){return _0x5f5a5b['id'];}}}));}}return BPromise[_0x9e82('0x91')](_0x2d1b6a)[_0x9e82('0x27')](function(_0x344b44){_0x1321fc=_(_0x1321fc)[_0x9e82('0x92')](_0x344b44)[_0x9e82('0x93')]()[_0x9e82('0x2d')]();return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x3b75b4[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](function(_0x11effa){return db[_0x9e82('0x76')][_0x9e82('0x77')](function(_0x3541e7){return _0x11effa['removeTeams'](_0x3b75b4[_0x9e82('0x3c')][_0x9e82('0x94')],{'transaction':_0x3541e7})[_0x9e82('0x27')](function(){if(!_[_0x9e82('0x95')](_0x1321fc)){return _0x11effa[_0x9e82('0x96')](_0x1321fc,{'transaction':_0x3541e7})[_0x9e82('0x27')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3b75b4[_0x9e82('0x51')]['id'],'UserId':_0x1321fc},'transaction':_0x3541e7});});}})[_0x9e82('0x27')](function(){_0x1321fc['forEach'](function(_0x513add){socket[_0x9e82('0x81')](_0x9e82('0x97'),{'UserId':_0x513add,'VoiceQueueId':_0x11effa['id']});});});});});});})[_0x9e82('0x27')](respondWithStatusCode(_0x263715,null))[_0x9e82('0x50')](handleError(_0x263715,null));};exports[_0x9e82('0x98')]=function(_0x4f1bb5,_0x5ce293,_0x53bc7a){var _0x123ead,_0x543eed;return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x4f1bb5['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x5ce293,null))[_0x9e82('0x27')](function(_0x1bad06){if(_0x1bad06){_0x543eed=_0x1bad06;return _0x1bad06[_0x9e82('0x98')](_0x4f1bb5['body']['ids'],_[_0x9e82('0x5a')](_0x4f1bb5[_0x9e82('0x53')],[_0x9e82('0x94'),'id'])||{})[_0x9e82('0x99')](function(_0x952192){for(var _0x417d36=0x0;_0x417d36<_0x4f1bb5['body'][_0x9e82('0x94')][_0x9e82('0x41')];_0x417d36+=0x1){socket[_0x9e82('0x81')](_0x9e82('0x82'),{'UserId':Number(_0x4f1bb5[_0x9e82('0x53')][_0x9e82('0x94')][_0x417d36]),'VoiceQueueId':Number(_0x4f1bb5[_0x9e82('0x51')]['id'])});}return _0x952192;});}})[_0x9e82('0x27')](function(_0x1101d0){_0x123ead=_0x1101d0||[];if(_0x543eed){return db['User'][_0x9e82('0x4e')]({'where':{'id':_0x4f1bb5[_0x9e82('0x53')]['ids']},'attributes':['id','name',_0x9e82('0x71'),'voicePause','interface'],'raw':!![]});}})['then'](function(_0x561192){if(!_['isEmpty'](_0x561192)){var _0x3895fe=[];for(var _0x4b4091=0x0;_0x4b4091<_0x561192[_0x9e82('0x41')];_0x4b4091++){if(_0x561192[_0x4b4091]['online']){_0x3895fe[_0x9e82('0x8c')](db[_0x9e82('0x7c')]['upsert']({'membername':_0x561192[_0x4b4091][_0x9e82('0x30')],'UserId':_0x561192[_0x4b4091]['id'],'queue_name':_0x543eed[_0x9e82('0x30')],'VoiceQueueId':_0x543eed['id'],'interface':_['isNil'](_0x561192[_0x4b4091][_0x9e82('0x72')])?util[_0x9e82('0x7e')](_0x9e82('0x7f'),_0x561192[_0x4b4091]['name']):_0x561192[_0x4b4091]['interface'],'paused':_0x561192[_0x4b4091]['voicePause']||![],'penalty':_0x4f1bb5[_0x9e82('0x53')][_0x9e82('0x75')]||0x0}));}}return BPromise[_0x9e82('0x91')](_0x3895fe);}})['then'](function(){return _0x123ead;})[_0x9e82('0x27')](respondWithResult(_0x5ce293,null))['catch'](handleError(_0x5ce293,null));};exports[_0x9e82('0x96')]=function(_0x44e9d1,_0x198720,_0x3426e1){return db[_0x9e82('0x37')]['find']({'where':{'id':_0x44e9d1[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x198720,null))[_0x9e82('0x27')](function(_0x25a340){if(_0x25a340){return _0x25a340[_0x9e82('0x96')](_0x44e9d1[_0x9e82('0x3c')][_0x9e82('0x94')])['then'](function(){if(_[_0x9e82('0x9a')](_0x44e9d1[_0x9e82('0x3c')][_0x9e82('0x94')])){for(var _0x303206=0x0;_0x303206<_0x44e9d1[_0x9e82('0x3c')]['ids']['length'];_0x303206+=0x1){socket['emit'](_0x9e82('0x97'),{'UserId':Number(_0x44e9d1['query'][_0x9e82('0x94')][_0x303206]),'VoiceQueueId':Number(_0x44e9d1[_0x9e82('0x51')]['id'])});}}else{socket[_0x9e82('0x81')](_0x9e82('0x97'),{'UserId':Number(_0x44e9d1[_0x9e82('0x3c')][_0x9e82('0x94')]),'VoiceQueueId':Number(_0x44e9d1[_0x9e82('0x51')]['id'])});}});}})['then'](function(_0x1d0e06){return db[_0x9e82('0x7c')][_0x9e82('0x5f')]({'where':{'VoiceQueueId':_0x44e9d1[_0x9e82('0x51')]['id'],'UserId':_0x44e9d1['query'][_0x9e82('0x94')]}})[_0x9e82('0x27')](function(){return _0x1d0e06;});})['then'](respondWithStatusCode(_0x198720,null))[_0x9e82('0x50')](handleError(_0x198720,null));};exports[_0x9e82('0x9b')]=function(_0x98cc80,_0x2a9af7,_0x219675){var _0x4f9148={};var _0x43ca72={};var _0x2afc87;var _0x51024a;return db['VoiceQueue'][_0x9e82('0x64')]({'where':{'id':_0x98cc80[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x2a9af7,null))[_0x9e82('0x27')](function(_0x318b0e){if(_0x318b0e){_0x2afc87=_0x318b0e;_0x43ca72[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db['User']['rawAttributes']);_0x43ca72[_0x9e82('0x3c')]=_['keys'](_0x98cc80[_0x9e82('0x3c')]);_0x43ca72['filters']=_[_0x9e82('0x3f')](_0x43ca72[_0x9e82('0x3b')],_0x43ca72[_0x9e82('0x3c')]);_0x4f9148[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x43ca72[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x98cc80['query'][_0x9e82('0x40')]));_0x4f9148[_0x9e82('0x3e')]=_0x4f9148[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x4f9148['attributes']:_0x43ca72['model'];_0x4f9148['order']=qs['sort'](_0x98cc80['query'][_0x9e82('0x44')]);_0x4f9148[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x98cc80['query'],_0x43ca72[_0x9e82('0x46')]));if(_0x98cc80[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x4f9148[_0x9e82('0x45')]=_['merge'](_0x4f9148[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x4f9148['attributes'],function(_0x44606d){var _0x4b4b0a={};_0x4b4b0a[_0x44606d]={'$like':'%'+_0x98cc80[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x4b4b0a;})});}_0x4f9148=_[_0x9e82('0x48')]({},_0x4f9148,_0x98cc80[_0x9e82('0x4b')]);return _0x2afc87[_0x9e82('0x9b')](_0x4f9148);}})[_0x9e82('0x27')](function(_0x59927f){if(_0x59927f){_0x51024a=_0x59927f['length'];if(!_0x98cc80[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x4f9148[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x98cc80[_0x9e82('0x3c')]['limit']);_0x4f9148[_0x9e82('0x1f')]=qs[_0x9e82('0x1f')](_0x98cc80['query'][_0x9e82('0x1f')]);}return _0x2afc87['getAgents'](_0x4f9148);}})['then'](function(_0x417e85){if(_0x417e85){return _0x417e85?{'count':_0x51024a,'rows':_0x417e85}:null;}})[_0x9e82('0x27')](respondWithResult(_0x2a9af7,null))[_0x9e82('0x50')](handleError(_0x2a9af7,null));};exports[_0x9e82('0x9c')]=function(_0x4894d5,_0x46f73,_0x437ece){var _0x3569dd={};var _0x1227ac={};var _0x45677d;var _0x5f53e6;return db['VoiceQueue'][_0x9e82('0x64')]({'where':{'id':_0x4894d5[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x46f73,null))[_0x9e82('0x27')](function(_0x3c95df){if(_0x3c95df){_0x45677d=_0x3c95df;_0x1227ac[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x7c')]['rawAttributes']);_0x1227ac[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x4894d5[_0x9e82('0x3c')]);_0x1227ac[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x1227ac[_0x9e82('0x3b')],_0x1227ac[_0x9e82('0x3c')]);_0x3569dd['attributes']=_['intersection'](_0x1227ac[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x3569dd['attributes']=_0x3569dd[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x3569dd[_0x9e82('0x3e')]:_0x1227ac[_0x9e82('0x3b')];_0x3569dd['order']=qs['sort'](_0x4894d5['query'][_0x9e82('0x44')]);_0x3569dd[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_['pick'](_0x4894d5[_0x9e82('0x3c')],_0x1227ac[_0x9e82('0x46')]));if(_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x3569dd['where']=_['merge'](_0x3569dd[_0x9e82('0x45')],{'$or':_[_0x9e82('0x2c')](_0x3569dd[_0x9e82('0x3e')],function(_0x1fa727){var _0x281f41={};_0x281f41[_0x1fa727]={'$like':'%'+_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x281f41;})});}_0x3569dd=_[_0x9e82('0x48')]({},_0x3569dd,_0x4894d5[_0x9e82('0x4b')]);return _0x45677d[_0x9e82('0x9c')](_0x3569dd);}})[_0x9e82('0x27')](function(_0x6a0ae3){if(_0x6a0ae3){_0x5f53e6=_0x6a0ae3[_0x9e82('0x41')];if(!_0x4894d5['query'][_0x9e82('0x66')](_0x9e82('0x42'))){_0x3569dd[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x4894d5['query'][_0x9e82('0x21')]);_0x3569dd['offset']=qs[_0x9e82('0x1f')](_0x4894d5[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0x45677d['getMembers'](_0x3569dd);}})[_0x9e82('0x27')](function(_0x5cdf5c){return _0x5cdf5c?{'count':_0x5f53e6,'rows':_0x5cdf5c}:null;})[_0x9e82('0x27')](respondWithResult(_0x46f73,null))[_0x9e82('0x50')](handleError(_0x46f73,null));};exports['getLists']=function(_0x2456ea,_0x181b08,_0x15be46){var _0x1a548b={};var _0x4ebf04={};var _0x5dde8b;var _0xd08a16;return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x2456ea[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x181b08,null))[_0x9e82('0x27')](function(_0x329d31){if(_0x329d31){_0x5dde8b=_0x329d31;_0x4ebf04[_0x9e82('0x3b')]=_[_0x9e82('0x3d')](db[_0x9e82('0x9d')]['rawAttributes']);_0x4ebf04[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x2456ea[_0x9e82('0x3c')]);_0x4ebf04[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x4ebf04[_0x9e82('0x3b')],_0x4ebf04['query']);_0x1a548b[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x4ebf04[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x2456ea['query']['fields']));_0x1a548b[_0x9e82('0x3e')]=_0x1a548b[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x1a548b['attributes']:_0x4ebf04[_0x9e82('0x3b')];_0x1a548b[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x44')]);_0x1a548b[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x2456ea[_0x9e82('0x3c')],_0x4ebf04[_0x9e82('0x46')]));if(_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x4a')]){_0x1a548b[_0x9e82('0x45')]=_[_0x9e82('0x48')](_0x1a548b[_0x9e82('0x45')],{'$or':_['map'](_0x1a548b[_0x9e82('0x3e')],function(_0x6d0e4c){var _0x2ea9bb={};_0x2ea9bb[_0x6d0e4c]={'$like':'%'+_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x4a')]+'%'};return _0x2ea9bb;})});}_0x1a548b=_[_0x9e82('0x48')]({},_0x1a548b,_0x2456ea[_0x9e82('0x4b')]);return _0x5dde8b[_0x9e82('0x9e')](_0x1a548b);}})[_0x9e82('0x27')](function(_0x26fc27){if(_0x26fc27){_0xd08a16=_0x26fc27['length'];if(!_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x66')]('nolimit')){_0x1a548b[_0x9e82('0x21')]=qs[_0x9e82('0x21')](_0x2456ea[_0x9e82('0x3c')]['limit']);_0x1a548b[_0x9e82('0x1f')]=qs['offset'](_0x2456ea[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0x5dde8b['getLists'](_0x1a548b);}})[_0x9e82('0x27')](function(_0xe4c5f){if(_0xe4c5f){return _0xe4c5f?{'count':_0xd08a16,'rows':_0xe4c5f}:null;}})[_0x9e82('0x27')](respondWithResult(_0x181b08,null))[_0x9e82('0x50')](handleError(_0x181b08,null));};exports[_0x9e82('0x9f')]=function(_0x29072d,_0xcddd8e,_0x148b50){var _0x5b9644=moment()[_0x9e82('0x7e')](_0x9e82('0xa0'));var _0x36de69,_0x9be4be;return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x29072d['params']['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0xcddd8e,null))[_0x9e82('0x27')](function(_0x3f6e47){if(_0x3f6e47){_0x9be4be=_0x3f6e47;return _0x3f6e47['addLists'](_0x29072d['body'][_0x9e82('0x94')],_[_0x9e82('0x5a')](_0x29072d[_0x9e82('0x53')],[_0x9e82('0x94'),'id'])||{});}return null;})[_0x9e82('0x99')](function(_0x3910c1){var _0x33a523;_0x36de69=_0x3910c1||[];var _0x18a1b1=[];if(_0x3910c1){for(var _0x2df87e=0x0;_0x2df87e<_0x3910c1['length'];_0x2df87e+=0x1){var _0x3d89f6=_0x3910c1[_0x2df87e][_0x9e82('0x55')]({'plain':!![]});_0x9be4be['dialCheckDuplicateType']=_0x29072d[_0x9e82('0x53')][_0x9e82('0xa1')]?_0x29072d[_0x9e82('0x53')][_0x9e82('0xa1')]:_0x9be4be[_0x9e82('0xa1')];switch(_0x9be4be[_0x9e82('0xa1')]){case _0x9e82('0xa2'):_0x33a523=squel['insert']()['into']('cm_hopper')[_0x9e82('0xa3')](['phone',_0x9e82('0xa4'),_0x9e82('0xa5'),_0x9e82('0xa6'),_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')](_0x9e82('0xa7'),_0x9e82('0xa7'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0xa4'))[_0x9e82('0x85')]('id',_0x9e82('0xa5'))['field'](_0x3d89f6[_0x9e82('0xa8')]['toString'](),'ListId')['field'](_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')](),_0x9e82('0x62'))['field']('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))['field']('\x27'+_0x5b9644+'\x27',_0x9e82('0x5c'))[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0x9e82('0xab'),_0x3d89f6[_0x9e82('0xa8')][_0x9e82('0x8d')]())[_0x9e82('0x45')](_0x9e82('0xac'))[_0x9e82('0x45')](_0x9e82('0xad'),squel[_0x9e82('0x84')]()[_0x9e82('0x85')](_0x9e82('0xae'))['from'](_0x9e82('0xaf'))[_0x9e82('0x45')](_0x9e82('0xb0'),_0x29072d['params']['id']['toString']()))[_0x9e82('0x45')](_0x9e82('0xad'),squel['select']()[_0x9e82('0x85')](_0x9e82('0xb1'))['from'](_0x9e82('0xb2'))[_0x9e82('0x45')](_0x9e82('0xb0'),_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')]())))[_0x9e82('0x8d')]();break;case'onlyIfOpen':_0x33a523=squel[_0x9e82('0xb3')]()[_0x9e82('0xb4')]('cm_hopper')[_0x9e82('0xa3')]([_0x9e82('0xa7'),_0x9e82('0xa4'),_0x9e82('0xa5'),'ListId',_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')]('phone',_0x9e82('0xa7'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0xa4'))['field']('id',_0x9e82('0xa5'))['field'](_0x3d89f6['CmListId'][_0x9e82('0x8d')](),'ListId')[_0x9e82('0x85')](_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')](),'VoiceQueueId')['field']('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27','updatedAt')[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')](_0x9e82('0xb5'))['where'](_0x9e82('0xab'),_0x3d89f6[_0x9e82('0xa8')]['toString']())[_0x9e82('0x45')](_0x9e82('0xac'))[_0x9e82('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x9e82('0x84')]()['field']('COALESCE(phone,\x27\x27)')[_0x9e82('0xa9')](_0x9e82('0xb2'))[_0x9e82('0x45')](_0x9e82('0xb0'),_0x29072d[_0x9e82('0x51')]['id'][_0x9e82('0x8d')]())))[_0x9e82('0x8d')]();break;default:_0x33a523=squel[_0x9e82('0xb3')]()['into'](_0x9e82('0xb2'))[_0x9e82('0xa3')]([_0x9e82('0xa7'),_0x9e82('0xa4'),_0x9e82('0xa5'),_0x9e82('0xa6'),_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')](_0x9e82('0xa7'),_0x9e82('0xa7'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0xa4'))[_0x9e82('0x85')]('id','ContactId')[_0x9e82('0x85')](_0x3d89f6[_0x9e82('0xa8')][_0x9e82('0x8d')](),_0x9e82('0xa6'))['field'](_0x29072d['params']['id'][_0x9e82('0x8d')](),_0x9e82('0x62'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5c'))[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')](_0x9e82('0xb5'))[_0x9e82('0x45')](_0x9e82('0xab'),_0x3d89f6['CmListId']['toString']())[_0x9e82('0x45')](_0x9e82('0xac')))[_0x9e82('0x8d')]();}_0x18a1b1['push'](db[_0x9e82('0x76')][_0x9e82('0x3c')](_0x33a523));}return BPromise[_0x9e82('0x91')](_0x18a1b1);}})['then'](function(){var _0x3bac7a=[];var _0x33927e=squel[_0x9e82('0xb3')]()[_0x9e82('0xb4')](_0x9e82('0xb6'))['fromQuery'](['CmHopperId',_0x9e82('0xa7'),_0x9e82('0xb7'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()['field'](_0x9e82('0xb8'))[_0x9e82('0x85')](_0x9e82('0xb9'))['field'](_0x9e82('0xba'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5b'))[_0x9e82('0x85')]('\x27'+_0x5b9644+'\x27',_0x9e82('0x5c'))[_0x9e82('0xa9')]('cm_contact_has_items','ci')[_0x9e82('0x88')](_0x9e82('0xb2'),'h','h.ContactId=ci.CmContactId')['where'](_0x9e82('0xbb'),_0x5b9644)[_0x9e82('0x45')](_0x9e82('0xbc'),_0x9e82('0xbd')))[_0x9e82('0x8d')]();_0x3bac7a[_0x9e82('0x8c')](db[_0x9e82('0x76')][_0x9e82('0x3c')](_0x33927e));return BPromise['all'](_0x3bac7a);})[_0x9e82('0x27')](function(){return _0x36de69;})['then'](respondWithResult(_0xcddd8e,null))[_0x9e82('0x50')](handleError(_0xcddd8e,null));};exports[_0x9e82('0xbe')]=function(_0x44c877,_0x4f10d0,_0x1cf157){return db['VoiceQueue'][_0x9e82('0x2e')]({'where':{'id':_0x44c877[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x4f10d0,null))['then'](function(_0x5a374f){if(_0x5a374f){return _0x5a374f[_0x9e82('0xbe')](_0x44c877[_0x9e82('0x3c')][_0x9e82('0x94')]);}})['then'](function(_0x4339de){if(_0x4339de){return db['CmHopper'][_0x9e82('0x5f')]({'where':{'ListId':_0x44c877[_0x9e82('0x3c')][_0x9e82('0x94')],'VoiceQueueId':_0x44c877['params']['id']}})[_0x9e82('0x27')](function(){return _0x4339de;});}})[_0x9e82('0x27')](respondWithStatusCode(_0x4f10d0,null))['catch'](handleError(_0x4f10d0,null));};exports['getBlackLists']=function(_0x141c6a,_0x279efa,_0x1d9d3d){var _0x3a37f1={};var _0x22c64d={};var _0x35f6b9;var _0x2eb3d5;return db[_0x9e82('0x37')][_0x9e82('0x64')]({'where':{'id':_0x141c6a[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x279efa,null))[_0x9e82('0x27')](function(_0x5b8419){if(_0x5b8419){_0x35f6b9=_0x5b8419;_0x22c64d[_0x9e82('0x3b')]=_['keys'](db[_0x9e82('0x9d')][_0x9e82('0x38')]);_0x22c64d[_0x9e82('0x3c')]=_[_0x9e82('0x3d')](_0x141c6a[_0x9e82('0x3c')]);_0x22c64d[_0x9e82('0x46')]=_[_0x9e82('0x3f')](_0x22c64d[_0x9e82('0x3b')],_0x22c64d[_0x9e82('0x3c')]);_0x3a37f1[_0x9e82('0x3e')]=_[_0x9e82('0x3f')](_0x22c64d[_0x9e82('0x3b')],qs[_0x9e82('0x40')](_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x40')]));_0x3a37f1[_0x9e82('0x3e')]=_0x3a37f1[_0x9e82('0x3e')][_0x9e82('0x41')]?_0x3a37f1[_0x9e82('0x3e')]:_0x22c64d['model'];_0x3a37f1[_0x9e82('0x43')]=qs[_0x9e82('0x44')](_0x141c6a['query'][_0x9e82('0x44')]);_0x3a37f1[_0x9e82('0x45')]=qs[_0x9e82('0x46')](_[_0x9e82('0x47')](_0x141c6a[_0x9e82('0x3c')],_0x22c64d[_0x9e82('0x46')]));if(_0x141c6a[_0x9e82('0x3c')]['filter']){_0x3a37f1['where']=_[_0x9e82('0x48')](_0x3a37f1['where'],{'$or':_[_0x9e82('0x2c')](_0x3a37f1[_0x9e82('0x3e')],function(_0x19db1b){var _0x552234={};_0x552234[_0x19db1b]={'$like':'%'+_0x141c6a[_0x9e82('0x3c')]['filter']+'%'};return _0x552234;})});}_0x3a37f1=_[_0x9e82('0x48')]({},_0x3a37f1,_0x141c6a['options']);return _0x35f6b9[_0x9e82('0xbf')](_0x3a37f1);}})[_0x9e82('0x27')](function(_0x9d0f7){if(_0x9d0f7){_0x2eb3d5=_0x9d0f7['length'];if(!_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x66')](_0x9e82('0x42'))){_0x3a37f1[_0x9e82('0x21')]=qs['limit'](_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x21')]);_0x3a37f1['offset']=qs[_0x9e82('0x1f')](_0x141c6a[_0x9e82('0x3c')][_0x9e82('0x1f')]);}return _0x35f6b9[_0x9e82('0xbf')](_0x3a37f1);}})[_0x9e82('0x27')](function(_0x2a3214){if(_0x2a3214){return _0x2a3214?{'count':_0x2eb3d5,'rows':_0x2a3214}:null;}})['then'](respondWithResult(_0x279efa,null))[_0x9e82('0x50')](handleError(_0x279efa,null));};exports[_0x9e82('0xc0')]=function(_0x207ae5,_0x52ba10,_0x163827){var _0x4b9505,_0x4454a0;return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x207ae5[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x52ba10,null))['then'](function(_0x96780a){if(_0x96780a){_0x4454a0=_0x96780a;return _0x96780a[_0x9e82('0xc0')](_0x207ae5['body'][_0x9e82('0x94')],_[_0x9e82('0x5a')](_0x207ae5[_0x9e82('0x53')],[_0x9e82('0x94'),'id'])||{});}return null;})[_0x9e82('0x99')](function(_0x321339){var _0x3fbd69;_0x4b9505=_0x321339||[];var _0x9de57=[];if(_0x321339){for(var _0x389583=0x0;_0x389583<_0x321339[_0x9e82('0x41')];_0x389583+=0x1){var _0x51e288=_0x321339[_0x389583]['get']({'plain':!![]});_0x3fbd69=squel[_0x9e82('0xb3')]()[_0x9e82('0xb4')](_0x9e82('0xc1'))[_0x9e82('0xa3')](['phone',_0x9e82('0xa5'),_0x9e82('0xa6'),_0x9e82('0x62'),_0x9e82('0x5b'),_0x9e82('0x5c')],squel[_0x9e82('0x84')]()[_0x9e82('0x85')]('phone',_0x9e82('0xa7'))[_0x9e82('0x85')]('id',_0x9e82('0xa5'))[_0x9e82('0x85')](_0x51e288[_0x9e82('0xa8')][_0x9e82('0x8d')](),_0x9e82('0xa6'))[_0x9e82('0x85')](_0x207ae5[_0x9e82('0x51')]['id'][_0x9e82('0x8d')](),'VoiceQueueId')[_0x9e82('0x85')]('NOW()','createdAt')[_0x9e82('0x85')]('NOW()',_0x9e82('0x5c'))[_0x9e82('0xa9')](_0x9e82('0xaa'))[_0x9e82('0x45')](_0x9e82('0xb5'))['where']('ListId\x20=\x20?',_0x51e288[_0x9e82('0xa8')][_0x9e82('0x8d')]())['where'](_0x9e82('0xac')))['toString']();_0x9de57[_0x9e82('0x8c')](db[_0x9e82('0x76')][_0x9e82('0x3c')](_0x3fbd69));}return BPromise[_0x9e82('0x91')](_0x9de57);}})['then'](function(){return _0x4b9505;})[_0x9e82('0x27')](respondWithResult(_0x52ba10,null))['catch'](handleError(_0x52ba10,null));};exports[_0x9e82('0xc2')]=function(_0x5eb8d9,_0x441ba2,_0x5896bf){return db[_0x9e82('0x37')][_0x9e82('0x2e')]({'where':{'id':_0x5eb8d9[_0x9e82('0x51')]['id']}})[_0x9e82('0x27')](handleEntityNotFound(_0x441ba2,null))[_0x9e82('0x27')](function(_0x532f18){if(_0x532f18){return _0x532f18[_0x9e82('0xc2')](_0x5eb8d9[_0x9e82('0x3c')][_0x9e82('0x94')]);}})['then'](function(_0x3d1407){if(_0x3d1407){return db[_0x9e82('0x6a')][_0x9e82('0x5f')]({'where':{'ListId':_0x5eb8d9[_0x9e82('0x3c')]['ids'],'VoiceQueueId':_0x5eb8d9['params']['id']}})[_0x9e82('0x27')](function(){return _0x3d1407;});}})[_0x9e82('0x27')](respondWithStatusCode(_0x441ba2,null))[_0x9e82('0x50')](handleError(_0x441ba2,null));};
\ No newline at end of file
+var _0x326f=['VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','ListId\x20=\x20?','cm_hopper_additional_phones','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','set','reject','save','destroy','then','VoiceQueues','inbound','outbound','ignore','map','value','includes','type','find','name','UserProfileResource','error','send','index','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','VoiceQueue','findAll','rows','catch','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','userProfileId','clone','options','omit','updatedAt','UserProfileSection','update','getHoppers','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','UserVoiceQueueRt','isNil','all','isArray','getAgents','getMembers','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','createdAt','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','COALESCE(calleridnum,\x27\x27)','cm_hopper_final'];(function(_0x42d489,_0x10f9d1){var _0x5ddf43=function(_0x5071b8){while(--_0x5071b8){_0x42d489['push'](_0x42d489['shift']());}};_0x5ddf43(++_0x10f9d1);}(_0x326f,0xd1));var _0xf326=function(_0x281973,_0x1ed20b){_0x281973=_0x281973-0x0;var _0xf5241e=_0x326f[_0x281973];return _0xf5241e;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];config[_0xf326('0x17')]=_[_0xf326('0x18')](config['redis'],{'host':_0xf326('0x19'),'port':0x18eb});var socket=require(_0xf326('0x1a'))(new Redis(config[_0xf326('0x17')]));require(_0xf326('0x1b'))['register'](socket);function respondWithStatusCode(_0x45c1b6,_0x5204ee){_0x5204ee=_0x5204ee||0xcc;return function(_0x54bd1a){if(_0x54bd1a){return _0x45c1b6[_0xf326('0x1c')](_0x5204ee);}return _0x45c1b6[_0xf326('0x1d')](_0x5204ee)[_0xf326('0x1e')]();};}function respondWithResult(_0xa63d1a,_0x292f4b){_0x292f4b=_0x292f4b||0xc8;return function(_0x287a2a){if(_0x287a2a){return _0xa63d1a[_0xf326('0x1d')](_0x292f4b)[_0xf326('0x1f')](_0x287a2a);}};}function respondWithFilteredResult(_0x5a682a,_0x3ad7da){return function(_0x453100){if(_0x453100){var _0x18bee3=typeof _0x3ad7da[_0xf326('0x20')]===_0xf326('0x21')&&typeof _0x3ad7da[_0xf326('0x22')]==='undefined';var _0x4a5b6c=_0x453100['count'];var _0x16e605=_0x18bee3?0x0:_0x3ad7da[_0xf326('0x20')];var _0x484cbe=_0x18bee3?_0x453100['count']:_0x3ad7da[_0xf326('0x20')]+_0x3ad7da['limit'];var _0x5b6d3c;if(_0x484cbe>=_0x4a5b6c){_0x484cbe=_0x4a5b6c;_0x5b6d3c=0xc8;}else{_0x5b6d3c=0xce;}_0x5a682a[_0xf326('0x1d')](_0x5b6d3c);return _0x5a682a[_0xf326('0x23')]('Content-Range',_0x16e605+'-'+_0x484cbe+'/'+_0x4a5b6c)['json'](_0x453100);}return null;};}function patchUpdates(_0x19b8ba){return function(_0xb1efcf){try{jsonpatch['apply'](_0xb1efcf,_0x19b8ba,!![]);}catch(_0x337ed5){return BPromise[_0xf326('0x24')](_0x337ed5);}return _0xb1efcf[_0xf326('0x25')]();};}function saveUpdates(_0x295752,_0x17c157){return function(_0x2049ec){if(_0x2049ec){return _0x2049ec['update'](_0x295752)['then'](function(_0x4f31f6){return _0x4f31f6;});}return null;};}function removeEntity(_0x520d85,_0x1a2c4e){return function(_0x2cd45a){if(_0x2cd45a){return _0x2cd45a[_0xf326('0x26')]()[_0xf326('0x27')](function(){var _0x410237=_0x2cd45a['get']({'plain':!![]});var _0x201d28=[{'name':_0xf326('0x28'),'value':_0xf326('0x29'),'ignore':![]},{'name':'QueueCampaigns','value':_0xf326('0x2a'),'ignore':![]}];var _0x55ad0f=_(_0x201d28)['filter'](_0xf326('0x2b'))[_0xf326('0x2c')](_0xf326('0x2d'))['value']();if(_[_0xf326('0x2e')](_0x55ad0f,_0x410237[_0xf326('0x2f')])){return;}var _0x55790d=_[_0xf326('0x30')](_0x201d28,[_0xf326('0x2d'),_0x410237[_0xf326('0x2f')]])[_0xf326('0x31')];return db[_0xf326('0x32')][_0xf326('0x26')]({'where':{'type':_0x55790d,'resourceId':_0x410237['id']}})[_0xf326('0x27')](function(){return _0x2cd45a;});})[_0xf326('0x27')](function(){_0x520d85[_0xf326('0x1d')](0xcc)[_0xf326('0x1e')]();});}};}function handleEntityNotFound(_0x4b52f2,_0x1035ed){return function(_0x424104){if(!_0x424104){_0x4b52f2[_0xf326('0x1c')](0x194);}return _0x424104;};}function handleError(_0x4792d2,_0x2c0cac){_0x2c0cac=_0x2c0cac||0x1f4;return function(_0x1721fd){logger[_0xf326('0x33')](_0x1721fd['stack']);if(_0x1721fd['name']){delete _0x1721fd[_0xf326('0x31')];}_0x4792d2[_0xf326('0x1d')](_0x2c0cac)[_0xf326('0x34')](_0x1721fd);};}exports[_0xf326('0x35')]=function(_0x30694f,_0x2e8a64){var _0x62585a={},_0x2d5f20={},_0x580374={'count':0x0,'rows':[]};var _0x461e93=_[_0xf326('0x2c')](db['VoiceQueue'][_0xf326('0x36')],function(_0x4e5d7c){return{'name':_0x4e5d7c[_0xf326('0x37')],'type':_0x4e5d7c['type']['key']};});_0x2d5f20[_0xf326('0x38')]=_['map'](_0x461e93,_0xf326('0x31'));_0x2d5f20['query']=_[_0xf326('0x39')](_0x30694f[_0xf326('0x3a')]);_0x2d5f20[_0xf326('0x3b')]=_['intersection'](_0x2d5f20[_0xf326('0x38')],_0x2d5f20[_0xf326('0x3a')]);_0x62585a['attributes']=_[_0xf326('0x3c')](_0x2d5f20[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x30694f[_0xf326('0x3a')]['fields']));_0x62585a[_0xf326('0x3e')]=_0x62585a[_0xf326('0x3e')][_0xf326('0x3f')]?_0x62585a[_0xf326('0x3e')]:_0x2d5f20[_0xf326('0x38')];if(!_0x30694f['query'][_0xf326('0x40')](_0xf326('0x41'))){_0x62585a['limit']=qs['limit'](_0x30694f[_0xf326('0x3a')]['limit']);_0x62585a['offset']=qs[_0xf326('0x20')](_0x30694f['query'][_0xf326('0x20')]);}_0x62585a[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x30694f[_0xf326('0x3a')]['sort']);_0x62585a[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x30694f[_0xf326('0x3a')],_0x2d5f20[_0xf326('0x3b')]),_0x461e93);if(_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]){_0x62585a[_0xf326('0x44')]=_[_0xf326('0x47')](_0x62585a[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x461e93,function(_0x2bab13){if(_0x2bab13['type']!==_0xf326('0x48')){var _0x1637dc={};_0x1637dc[_0x2bab13[_0xf326('0x31')]]={'$like':'%'+_0x30694f[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1637dc;}})});}_0x62585a=_[_0xf326('0x47')]({},_0x62585a,_0x30694f['options']);var _0x28e2d3={'where':_0x62585a[_0xf326('0x44')]};return db['VoiceQueue'][_0xf326('0x49')](_0x28e2d3)[_0xf326('0x27')](function(_0x130c56){_0x580374[_0xf326('0x49')]=_0x130c56;if(_0x30694f[_0xf326('0x3a')]['includeAll']){_0x62585a['include']=[{'all':!![]}];}return db[_0xf326('0x4a')][_0xf326('0x4b')](_0x62585a);})['then'](function(_0x4bd865){_0x580374[_0xf326('0x4c')]=_0x4bd865;return _0x580374;})[_0xf326('0x27')](respondWithFilteredResult(_0x2e8a64,_0x62585a))[_0xf326('0x4d')](handleError(_0x2e8a64,null));};exports['show']=function(_0x301e65,_0xe96e1e){var _0x2180d6={'raw':![],'where':{'id':_0x301e65[_0xf326('0x4e')]['id']}},_0xc43507={};_0xc43507[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xc43507[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x301e65[_0xf326('0x3a')]);_0xc43507[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],_0xc43507['query']);_0x2180d6[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0xc43507[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x301e65['query'][_0xf326('0x3d')]));_0x2180d6[_0xf326('0x3e')]=_0x2180d6[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2180d6['attributes']:_0xc43507[_0xf326('0x38')];if(_0x301e65[_0xf326('0x3a')][_0xf326('0x4f')]){_0x2180d6[_0xf326('0x50')]=[{'all':!![]}];}_0x2180d6=_[_0xf326('0x47')]({},_0x2180d6,_0x301e65['options']);return db['VoiceQueue'][_0xf326('0x30')](_0x2180d6)[_0xf326('0x27')](handleEntityNotFound(_0xe96e1e,null))[_0xf326('0x27')](respondWithResult(_0xe96e1e,null))['catch'](handleError(_0xe96e1e,null));};exports[_0xf326('0x51')]=function(_0x4650db,_0x44eab7){return db['VoiceQueue']['create'](_0x4650db[_0xf326('0x52')],{})['then'](function(_0x1cf58f){var _0x554277=_0x4650db[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x554277)throw new Error(_0xf326('0x55'));if(_0x554277[_0xf326('0x56')]===_0xf326('0x53')){var _0x35d3c8=_0x1cf58f[_0xf326('0x54')]({'plain':!![]});var _0x495a16=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':'outbound'}];var _0x208ba4=_[_0xf326('0x30')](_0x495a16,[_0xf326('0x2d'),_0x35d3c8[_0xf326('0x2f')]])[_0xf326('0x31')];return db['UserProfileSection'][_0xf326('0x30')]({'where':{'name':_0x208ba4,'userProfileId':_0x554277[_0xf326('0x58')]},'raw':!![]})[_0xf326('0x27')](function(_0x46a21f){if(_0x46a21f&&_0x46a21f['autoAssociation']===0x0){return db[_0xf326('0x32')][_0xf326('0x51')]({'name':_0x35d3c8[_0xf326('0x31')],'resourceId':_0x35d3c8['id'],'type':_0x46a21f[_0xf326('0x31')],'sectionId':_0x46a21f['id']},{})['then'](function(){return _0x1cf58f;});}else{return _0x1cf58f;}})['catch'](function(_0x18b46e){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x18b46e);throw _0x18b46e;});}return _0x1cf58f;})[_0xf326('0x27')](respondWithResult(_0x44eab7,0xc9))[_0xf326('0x4d')](handleError(_0x44eab7,null));};exports[_0xf326('0x59')]=function(_0x1258d1,_0x5765b0){var _0xb1c18c={'where':{'id':_0x1258d1['params']['id']}},_0x5657b7={};_0x5657b7[_0xf326('0x38')]=_['keys'](db[_0xf326('0x4a')][_0xf326('0x36')]);_0xb1c18c[_0xf326('0x3e')]=_['intersection'](_0x5657b7['model'],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x3a')][_0xf326('0x3d')]));_0xb1c18c['attributes']=_0xb1c18c[_0xf326('0x3e')]['length']?_0xb1c18c[_0xf326('0x3e')]:_0x5657b7[_0xf326('0x38')];if(_0x1258d1[_0xf326('0x3a')][_0xf326('0x4f')]){_0xb1c18c[_0xf326('0x50')]=[{'all':!![]}];}_0xb1c18c=_[_0xf326('0x47')]({},_0xb1c18c,_0x1258d1[_0xf326('0x5a')]);return db[_0xf326('0x4a')][_0xf326('0x30')](_0xb1c18c)[_0xf326('0x27')](handleEntityNotFound(_0x5765b0,null))[_0xf326('0x27')](function(_0x1e56fb){if(_0x1e56fb){var _0x40f7cb=_0x1e56fb['get']({'plain':!![]});_0x40f7cb=qs[_0xf326('0x5b')](_0x40f7cb,['id','createdAt',_0xf326('0x5c')]);_0x1258d1[_0xf326('0x52')]=_['omit'](_0x1258d1[_0xf326('0x52')],['id','createdAt',_0xf326('0x5c')]);return db[_0xf326('0x4a')][_0xf326('0x51')](_[_0xf326('0x47')](_0x40f7cb,_0x1258d1[_0xf326('0x52')]),{'include':_0x1258d1['query']['includeAll']?[{'all':!![]}]:undefined})[_0xf326('0x27')](function(_0x32fe3a){var _0x15a538=_0x1258d1[_0xf326('0x53')][_0xf326('0x54')]({'plain':!![]});if(!_0x15a538)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15a538[_0xf326('0x56')]===_0xf326('0x53')){var _0x4aadc9=_0x32fe3a['get']({'plain':!![]});var _0x5b25ca=[{'name':_0xf326('0x28'),'value':_0xf326('0x29')},{'name':_0xf326('0x57'),'value':_0xf326('0x2a')}];var _0x240ce5=_[_0xf326('0x30')](_0x5b25ca,[_0xf326('0x2d'),_0x4aadc9['type']])[_0xf326('0x31')];return db[_0xf326('0x5d')][_0xf326('0x30')]({'where':{'name':_0x240ce5,'userProfileId':_0x15a538[_0xf326('0x58')]},'raw':!![]})['then'](function(_0x3717fe){if(_0x3717fe&&_0x3717fe['autoAssociation']===0x0){return db['UserProfileResource'][_0xf326('0x51')]({'name':_0x4aadc9['name'],'resourceId':_0x4aadc9['id'],'type':_0x3717fe[_0xf326('0x31')],'sectionId':_0x3717fe['id']},{})[_0xf326('0x27')](function(){return _0x32fe3a;});}else{return _0x32fe3a;}})[_0xf326('0x4d')](function(_0x2ea5a2){logger[_0xf326('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea5a2);throw _0x2ea5a2;});}return _0x32fe3a;});}})['then'](respondWithResult(_0x5765b0,0xc9))['catch'](handleError(_0x5765b0,null));};exports[_0xf326('0x5e')]=function(_0x307441,_0x229a34){if(_0x307441[_0xf326('0x52')]['id']){delete _0x307441[_0xf326('0x52')]['id'];}return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x307441[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x229a34,null))['then'](saveUpdates(_0x307441['body'],null))[_0xf326('0x27')](respondWithResult(_0x229a34,null))[_0xf326('0x4d')](handleError(_0x229a34,null));};exports['destroy']=function(_0x4bf1bf,_0x2497fd){return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x4bf1bf['params']['id']}})['then'](handleEntityNotFound(_0x2497fd,null))['then'](removeEntity(_0x2497fd,null))[_0xf326('0x4d')](handleError(_0x2497fd,null));};exports[_0xf326('0x5f')]=function(_0xd44071,_0x4838d5,_0x1cf9a8){var _0xdeceb9={'raw':![],'where':{}};var _0x35e34d={};var _0x457f3d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0xd44071[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4838d5,null))[_0xf326('0x27')](function(_0x5290da){if(_0x5290da){_0x35e34d[_0xf326('0x38')]=_['keys'](db[_0xf326('0x61')][_0xf326('0x36')]);_0x35e34d[_0xf326('0x3a')]=_['keys'](_0xd44071[_0xf326('0x3a')]);_0x35e34d[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x35e34d['model'],_0x35e34d[_0xf326('0x3a')]);_0xdeceb9[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x35e34d[_0xf326('0x38')],qs['fields'](_0xd44071[_0xf326('0x3a')]['fields']));_0xdeceb9['attributes']=_0xdeceb9[_0xf326('0x3e')][_0xf326('0x3f')]?_0xdeceb9['attributes']:_0x35e34d['model'];if(!_0xd44071['query'][_0xf326('0x40')]('nolimit')){_0xdeceb9[_0xf326('0x22')]=qs[_0xf326('0x22')](_0xd44071[_0xf326('0x3a')][_0xf326('0x22')]);_0xdeceb9[_0xf326('0x20')]=qs[_0xf326('0x20')](_0xd44071['query'][_0xf326('0x20')]);}_0xdeceb9[_0xf326('0x42')]=qs['sort'](_0xd44071['query'][_0xf326('0x43')]);_0xdeceb9['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0xd44071[_0xf326('0x3a')],_0x35e34d[_0xf326('0x3b')]));_0xdeceb9[_0xf326('0x44')][_0xf326('0x62')]=_0x5290da['id'];if(_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]){_0xdeceb9[_0xf326('0x44')]=_['merge'](_0xdeceb9[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xdeceb9['attributes'],function(_0x3c82cf){var _0x5b0f2d={};_0x5b0f2d[_0x3c82cf]={'$like':'%'+_0xd44071[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5b0f2d;})});}_0xdeceb9=_[_0xf326('0x47')]({},_0xdeceb9,_0xd44071['options']);return db[_0xf326('0x61')][_0xf326('0x49')]({'where':_0xdeceb9[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x30e096){_0x457f3d[_0xf326('0x49')]=_0x30e096;if(_0xd44071[_0xf326('0x3a')][_0xf326('0x4f')]){_0xdeceb9[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x61')][_0xf326('0x4b')](_0xdeceb9);})[_0xf326('0x27')](function(_0x452e28){_0x457f3d[_0xf326('0x4c')]=_0x452e28;return _0x457f3d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4838d5,_0xdeceb9))['catch'](handleError(_0x4838d5,null));};exports[_0xf326('0x63')]=function(_0x24aaca,_0x4829ae,_0x438daa){var _0x424be4={'raw':!![],'where':{}};var _0x5c1686={};var _0x80fce5={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x24aaca[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x4829ae,null))[_0xf326('0x27')](function(_0x1bb7cc){if(_0x1bb7cc){_0x5c1686['model']=_[_0xf326('0x39')](db[_0xf326('0x64')][_0xf326('0x36')]);_0x5c1686[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x24aaca[_0xf326('0x3a')]);_0x5c1686[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5c1686['model'],_0x5c1686[_0xf326('0x3a')]);_0x424be4[_0xf326('0x3e')]=_['intersection'](_0x5c1686[_0xf326('0x38')],qs['fields'](_0x24aaca[_0xf326('0x3a')][_0xf326('0x3d')]));_0x424be4[_0xf326('0x3e')]=_0x424be4[_0xf326('0x3e')][_0xf326('0x3f')]?_0x424be4[_0xf326('0x3e')]:_0x5c1686[_0xf326('0x38')];if(!_0x24aaca[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x424be4[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x22')]);_0x424be4['offset']=qs[_0xf326('0x20')](_0x24aaca[_0xf326('0x3a')][_0xf326('0x20')]);}_0x424be4[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x24aaca['query'][_0xf326('0x43')]);_0x424be4[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x24aaca[_0xf326('0x3a')],_0x5c1686['filters']));_0x424be4['where'][_0xf326('0x62')]=_0x1bb7cc['id'];if(_0x24aaca['query'][_0xf326('0x46')]){_0x424be4[_0xf326('0x44')]=_[_0xf326('0x47')](_0x424be4['where'],{'$or':_['map'](_0x424be4[_0xf326('0x3e')],function(_0x2d92e4){var _0x167ac9={};_0x167ac9[_0x2d92e4]={'$like':'%'+_0x24aaca[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x167ac9;})});}_0x424be4=_['merge']({},_0x424be4,_0x24aaca[_0xf326('0x5a')]);return db[_0xf326('0x64')][_0xf326('0x49')]({'where':_0x424be4['where']})['then'](function(_0x47a35b){_0x80fce5[_0xf326('0x49')]=_0x47a35b;if(_0x24aaca[_0xf326('0x3a')][_0xf326('0x4f')]){_0x424be4[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x64')][_0xf326('0x4b')](_0x424be4);})[_0xf326('0x27')](function(_0x598a93){_0x80fce5['rows']=_0x598a93;return _0x80fce5;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x4829ae,_0x424be4))[_0xf326('0x4d')](handleError(_0x4829ae,null));};exports[_0xf326('0x65')]=function(_0x571b8c,_0xd85b34,_0x39bdde){var _0x1746af={'raw':!![],'where':{}};var _0x597005={};var _0x39d16d={'count':0x0,'rows':[]};return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x571b8c[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd85b34,null))['then'](function(_0x5a7af3){if(_0x5a7af3){_0x597005[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x66')]['rawAttributes']);_0x597005[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x571b8c[_0xf326('0x3a')]);_0x597005['filters']=_[_0xf326('0x3c')](_0x597005[_0xf326('0x38')],_0x597005[_0xf326('0x3a')]);_0x1746af[_0xf326('0x3e')]=_['intersection'](_0x597005[_0xf326('0x38')],qs['fields'](_0x571b8c[_0xf326('0x3a')][_0xf326('0x3d')]));_0x1746af[_0xf326('0x3e')]=_0x1746af[_0xf326('0x3e')]['length']?_0x1746af[_0xf326('0x3e')]:_0x597005['model'];if(!_0x571b8c[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x1746af[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x571b8c['query']['limit']);_0x1746af[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x571b8c[_0xf326('0x3a')][_0xf326('0x20')]);}_0x1746af['order']=qs[_0xf326('0x43')](_0x571b8c['query'][_0xf326('0x43')]);_0x1746af[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x571b8c[_0xf326('0x3a')],_0x597005[_0xf326('0x3b')]));_0x1746af[_0xf326('0x44')][_0xf326('0x62')]=_0x5a7af3['id'];if(_0x571b8c[_0xf326('0x3a')]['filter']){_0x1746af[_0xf326('0x44')]=_[_0xf326('0x47')](_0x1746af['where'],{'$or':_[_0xf326('0x2c')](_0x1746af[_0xf326('0x3e')],function(_0x306fc9){var _0x6dad26={};_0x6dad26[_0x306fc9]={'$like':'%'+_0x571b8c['query']['filter']+'%'};return _0x6dad26;})});}_0x1746af=_[_0xf326('0x47')]({},_0x1746af,_0x571b8c[_0xf326('0x5a')]);return db['CmHopperFinal'][_0xf326('0x49')]({'where':_0x1746af['where']})['then'](function(_0x4cad0){_0x39d16d[_0xf326('0x49')]=_0x4cad0;if(_0x571b8c[_0xf326('0x3a')][_0xf326('0x4f')]){_0x1746af[_0xf326('0x50')]=[{'all':!![]}];}return db[_0xf326('0x66')][_0xf326('0x4b')](_0x1746af);})[_0xf326('0x27')](function(_0xc9dead){_0x39d16d['rows']=_0xc9dead;return _0x39d16d;});}})[_0xf326('0x27')](respondWithFilteredResult(_0xd85b34,_0x1746af))[_0xf326('0x4d')](handleError(_0xd85b34,null));};exports[_0xf326('0x67')]=function(_0x1c7f81,_0x59d894,_0x3e6a5d){var _0x20020c={'raw':!![],'where':{}};var _0xc94723={};var _0x750d55={'count':0x0,'rows':[]};return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1c7f81[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x59d894,null))[_0xf326('0x27')](function(_0x14d255){if(_0x14d255){_0xc94723[_0xf326('0x38')]=_[_0xf326('0x39')](db['CmHopperBlack'][_0xf326('0x36')]);_0xc94723[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x1c7f81['query']);_0xc94723[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],_0xc94723[_0xf326('0x3a')]);_0x20020c['attributes']=_[_0xf326('0x3c')](_0xc94723[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1c7f81[_0xf326('0x3a')]['fields']));_0x20020c[_0xf326('0x3e')]=_0x20020c[_0xf326('0x3e')][_0xf326('0x3f')]?_0x20020c['attributes']:_0xc94723[_0xf326('0x38')];if(!_0x1c7f81[_0xf326('0x3a')]['hasOwnProperty'](_0xf326('0x41'))){_0x20020c[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x22')]);_0x20020c[_0xf326('0x20')]=qs['offset'](_0x1c7f81['query'][_0xf326('0x20')]);}_0x20020c[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x1c7f81[_0xf326('0x3a')][_0xf326('0x43')]);_0x20020c[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1c7f81[_0xf326('0x3a')],_0xc94723[_0xf326('0x3b')]));_0x20020c[_0xf326('0x44')][_0xf326('0x62')]=_0x14d255['id'];if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x46')]){_0x20020c[_0xf326('0x44')]=_[_0xf326('0x47')](_0x20020c['where'],{'$or':_[_0xf326('0x2c')](_0x20020c['attributes'],function(_0x590dc0){var _0x32fc6e={};_0x32fc6e[_0x590dc0]={'$like':'%'+_0x1c7f81['query'][_0xf326('0x46')]+'%'};return _0x32fc6e;})});}_0x20020c=_[_0xf326('0x47')]({},_0x20020c,_0x1c7f81[_0xf326('0x5a')]);return db[_0xf326('0x68')][_0xf326('0x49')]({'where':_0x20020c[_0xf326('0x44')]})[_0xf326('0x27')](function(_0x18b3cc){_0x750d55[_0xf326('0x49')]=_0x18b3cc;if(_0x1c7f81[_0xf326('0x3a')][_0xf326('0x4f')]){_0x20020c[_0xf326('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xf326('0x4b')](_0x20020c);})[_0xf326('0x27')](function(_0x5657){_0x750d55[_0xf326('0x4c')]=_0x5657;return _0x750d55;});}})[_0xf326('0x27')](respondWithFilteredResult(_0x59d894,_0x20020c))[_0xf326('0x4d')](handleError(_0x59d894,null));};exports[_0xf326('0x69')]=function(_0x5429a2,_0x448d10,_0x15f799){var _0x320ab3={};var _0x316877={};var _0x79faa1;var _0x14259b;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x5429a2[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x448d10,null))[_0xf326('0x27')](function(_0x9a0455){if(_0x9a0455){_0x79faa1=_0x9a0455;_0x316877[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x6a')][_0xf326('0x36')]);_0x316877[_0xf326('0x3a')]=_[_0xf326('0x39')](_0x5429a2[_0xf326('0x3a')]);_0x316877[_0xf326('0x3b')]=_['intersection'](_0x316877[_0xf326('0x38')],_0x316877[_0xf326('0x3a')]);_0x320ab3[_0xf326('0x3e')]=_['intersection'](_0x316877['model'],qs[_0xf326('0x3d')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x3d')]));_0x320ab3[_0xf326('0x3e')]=_0x320ab3['attributes'][_0xf326('0x3f')]?_0x320ab3[_0xf326('0x3e')]:_0x316877[_0xf326('0x38')];_0x320ab3['order']=qs['sort'](_0x5429a2['query'][_0xf326('0x43')]);_0x320ab3[_0xf326('0x44')]=qs[_0xf326('0x3b')](_['pick'](_0x5429a2[_0xf326('0x3a')],_0x316877['filters']));if(_0x5429a2[_0xf326('0x3a')]['filter']){_0x320ab3[_0xf326('0x44')]=_[_0xf326('0x47')](_0x320ab3[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x320ab3[_0xf326('0x3e')],function(_0x3dcaf9){var _0x1f05a2={};_0x1f05a2[_0x3dcaf9]={'$like':'%'+_0x5429a2[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x1f05a2;})});}_0x320ab3=_[_0xf326('0x47')]({},_0x320ab3,_0x5429a2[_0xf326('0x5a')]);return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})[_0xf326('0x27')](function(_0x3dc3c5){if(_0x3dc3c5){_0x14259b=_0x3dc3c5['length'];if(!_0x5429a2[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x320ab3['limit']=qs['limit'](_0x5429a2['query'][_0xf326('0x22')]);_0x320ab3[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x5429a2[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x79faa1[_0xf326('0x69')](_0x320ab3);}})['then'](function(_0x1aeaf9){if(_0x1aeaf9){return _0x1aeaf9?{'count':_0x14259b,'rows':_0x1aeaf9}:null;}})[_0xf326('0x27')](respondWithResult(_0x448d10,null))[_0xf326('0x4d')](handleError(_0x448d10,null));};exports[_0xf326('0x6b')]=function(_0x71e344,_0x5cac48,_0x10f5cb){var _0x44c4bb=_0x71e344[_0xf326('0x52')][_0xf326('0x6c')];var _0x350d76=_['map'](_0x44c4bb,'id');return db['Team'][_0xf326('0x4b')]({'where':{'id':_0x350d76},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xf326('0x31'),_0xf326('0x6d'),_0xf326('0x6e'),_0xf326('0x6f')],'raw':!![]}]})[_0xf326('0x27')](function(_0x5aa1ca){if(_0x5aa1ca){var _0x51bfee=_[_0xf326('0x70')](_0x5aa1ca,function(_0x2eaf15){var _0x182080=_0x2eaf15['get']({'plain':!![]});_0x182080[_0xf326('0x71')]['forEach'](function(_0x4df691){_0x4df691['penalty']=_[_0xf326('0x30')](_0x44c4bb,{'id':_0x182080['id']})[_0xf326('0x72')];});return _0x182080[_0xf326('0x71')];});return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x71e344[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](function(_0x3833f9){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0xb4b180){return _0x3833f9['addTeams'](_0x350d76,{'transaction':_0xb4b180})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x44c4bb,function(_0x2a17bf){return db[_0xf326('0x76')][_0xf326('0x77')]({'TeamId':_0x2a17bf['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id'],'penalty':_0x2a17bf[_0xf326('0x72')]},{'transaction':_0xb4b180});});})[_0xf326('0x27')](function(){return BPromise[_0xf326('0x75')](_0x51bfee,function(_0x4d5f64){return db[_0xf326('0x78')][_0xf326('0x79')]({'where':{'UserId':_0x4d5f64['id'],'VoiceQueueId':_0x71e344[_0xf326('0x4e')]['id']},'defaults':{'penalty':_0x4d5f64['penalty']},'transaction':_0xb4b180});});})['then'](function(){return BPromise[_0xf326('0x75')](_[_0xf326('0x46')](_0x51bfee,{'online':!![]}),function(_0x5efac6){return db['UserVoiceQueueRt'][_0xf326('0x77')]({'membername':_0x5efac6['name'],'UserId':_0x5efac6['id'],'queue_name':_0x3833f9[_0xf326('0x31')],'VoiceQueueId':_0x3833f9['id'],'interface':_['isNil'](_0x5efac6[_0xf326('0x6f')])?util[_0xf326('0x7a')](_0xf326('0x7b'),_0x5efac6[_0xf326('0x31')]):_0x5efac6[_0xf326('0x6f')],'paused':_0x5efac6['voicePause']||![],'penalty':_0x5efac6[_0xf326('0x72')]},{'transaction':_0xb4b180});});})['then'](function(){_0x51bfee[_0xf326('0x7c')](function(_0x3fe546){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':_0x3fe546['id'],'VoiceQueueId':_0x3833f9['id']});});});});});}})[_0xf326('0x27')](respondWithStatusCode(_0x5cac48,null))['catch'](handleError(_0x5cac48,null));};exports['removeTeams']=function(_0x1ad0df,_0x5c913c,_0x53421f){return db['Team']['findAll']({'where':{'id':_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')]},'attributes':['id'],'include':[{'model':db[_0xf326('0x80')],'as':_0xf326('0x71'),'attributes':['id'],'raw':!![]}]})[_0xf326('0x27')](handleEntityNotFound(_0x5c913c,null))[_0xf326('0x27')](function(_0xc5d45e){var _0x4feb3e=_[_0xf326('0x2c')](_0xc5d45e,'id');var _0x3e0bf4=[];var _0x72c3ed=[];var _0x4abe8a=squel[_0xf326('0x81')]();_0x4abe8a[_0xf326('0x82')](_0xf326('0x83'))[_0xf326('0x84')](_0xf326('0x85'),'tq')[_0xf326('0x86')](_0xf326('0x87'),'ut',_0xf326('0x88'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1ad0df[_0xf326('0x4e')]['id']);for(var _0x5e9650=0x0;_0x5e9650<_0xc5d45e[_0xf326('0x3f')];_0x5e9650+=0x1){let _0x500780=_0xc5d45e[_0x5e9650];for(var _0x4b537a=0x0;_0x4b537a<_0x500780[_0xf326('0x71')]['length'];_0x4b537a+=0x1){let _0x3edec1=_0x500780[_0xf326('0x71')][_0x4b537a];var _0x3dfa46=_0x4abe8a[_0xf326('0x59')]();_0x3dfa46['where'](_0xf326('0x89'),_0x3edec1['id']);_0x72c3ed[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x3dfa46['toString'](),{'type':db['sequelize'][_0xf326('0x8b')][_0xf326('0x8c')]})[_0xf326('0x27')](function(_0x160086){if(_0x160086[_0xf326('0x3f')]===0x1){return _0x3edec1['id'];}else{var _0x1acd3b=_[_0xf326('0x8d')](_[_0xf326('0x2c')](_0x160086,_0xf326('0x8e')),function(_0xa5963a){return _[_0xf326('0x2e')](_0x4feb3e,_0xa5963a);});if(_0x1acd3b){return _0x3edec1['id'];}}}));}}return BPromise['all'](_0x72c3ed)[_0xf326('0x27')](function(_0x303b42){_0x3e0bf4=_(_0x3e0bf4)[_0xf326('0x8f')](_0x303b42)['compact']()[_0xf326('0x2d')]();return db['VoiceQueue'][_0xf326('0x30')]({'where':{'id':_0x1ad0df[_0xf326('0x4e')]['id']}})['then'](function(_0x1b6d24){return db[_0xf326('0x73')][_0xf326('0x74')](function(_0x2d861a){return _0x1b6d24['removeTeams'](_0x1ad0df[_0xf326('0x3a')][_0xf326('0x7f')],{'transaction':_0x2d861a})[_0xf326('0x27')](function(){if(!_[_0xf326('0x90')](_0x3e0bf4)){return _0x1b6d24[_0xf326('0x91')](_0x3e0bf4,{'transaction':_0x2d861a})['then'](function(){return db['UserVoiceQueueRt'][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x1ad0df[_0xf326('0x4e')]['id'],'UserId':_0x3e0bf4},'transaction':_0x2d861a});});}})[_0xf326('0x27')](function(){_0x3e0bf4[_0xf326('0x7c')](function(_0x42c8de){socket[_0xf326('0x7d')](_0xf326('0x92'),{'UserId':_0x42c8de,'VoiceQueueId':_0x1b6d24['id']});});});});});});})[_0xf326('0x27')](respondWithStatusCode(_0x5c913c,null))[_0xf326('0x4d')](handleError(_0x5c913c,null));};exports[_0xf326('0x93')]=function(_0x55d67f,_0x550bda,_0x4f14ff){var _0x8fccef,_0x190d3c;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x55d67f[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x550bda,null))[_0xf326('0x27')](function(_0xc94f1e){if(_0xc94f1e){_0x190d3c=_0xc94f1e;return _0xc94f1e[_0xf326('0x93')](_0x55d67f[_0xf326('0x52')]['ids'],_[_0xf326('0x5b')](_0x55d67f['body'],['ids','id'])||{})[_0xf326('0x94')](function(_0x2a9fd1){for(var _0x4086fa=0x0;_0x4086fa<_0x55d67f[_0xf326('0x52')][_0xf326('0x7f')]['length'];_0x4086fa+=0x1){socket[_0xf326('0x7d')](_0xf326('0x7e'),{'UserId':Number(_0x55d67f[_0xf326('0x52')]['ids'][_0x4086fa]),'VoiceQueueId':Number(_0x55d67f[_0xf326('0x4e')]['id'])});}return _0x2a9fd1;});}})[_0xf326('0x27')](function(_0x38dbf3){_0x8fccef=_0x38dbf3||[];if(_0x190d3c){return db[_0xf326('0x80')]['findAll']({'where':{'id':_0x55d67f[_0xf326('0x52')]['ids']},'attributes':['id','name',_0xf326('0x6d'),'voicePause','interface'],'raw':!![]});}})[_0xf326('0x27')](function(_0xbd7671){if(!_[_0xf326('0x90')](_0xbd7671)){var _0x1d2611=[];for(var _0x497d2e=0x0;_0x497d2e<_0xbd7671['length'];_0x497d2e++){if(_0xbd7671[_0x497d2e][_0xf326('0x6d')]){_0x1d2611[_0xf326('0x8a')](db[_0xf326('0x95')][_0xf326('0x77')]({'membername':_0xbd7671[_0x497d2e][_0xf326('0x31')],'UserId':_0xbd7671[_0x497d2e]['id'],'queue_name':_0x190d3c[_0xf326('0x31')],'VoiceQueueId':_0x190d3c['id'],'interface':_[_0xf326('0x96')](_0xbd7671[_0x497d2e][_0xf326('0x6f')])?util[_0xf326('0x7a')]('SIP/%s',_0xbd7671[_0x497d2e][_0xf326('0x31')]):_0xbd7671[_0x497d2e][_0xf326('0x6f')],'paused':_0xbd7671[_0x497d2e][_0xf326('0x6e')]||![],'penalty':_0x55d67f['body']['penalty']||0x0}));}}return BPromise[_0xf326('0x97')](_0x1d2611);}})[_0xf326('0x27')](function(){return _0x8fccef;})[_0xf326('0x27')](respondWithResult(_0x550bda,null))[_0xf326('0x4d')](handleError(_0x550bda,null));};exports['removeAgents']=function(_0x4f96aa,_0x5ea5d4,_0x45aae6){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x4f96aa['params']['id']}})['then'](handleEntityNotFound(_0x5ea5d4,null))[_0xf326('0x27')](function(_0x15c66f){if(_0x15c66f){return _0x15c66f[_0xf326('0x91')](_0x4f96aa['query']['ids'])['then'](function(){if(_[_0xf326('0x98')](_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')])){for(var _0x1791dd=0x0;_0x1791dd<_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')][_0xf326('0x3f')];_0x1791dd+=0x1){socket[_0xf326('0x7d')]('userVoiceQueue:remove',{'UserId':Number(_0x4f96aa['query'][_0xf326('0x7f')][_0x1791dd]),'VoiceQueueId':Number(_0x4f96aa['params']['id'])});}}else{socket['emit'](_0xf326('0x92'),{'UserId':Number(_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]),'VoiceQueueId':Number(_0x4f96aa[_0xf326('0x4e')]['id'])});}});}})[_0xf326('0x27')](function(_0x1307a4){return db[_0xf326('0x95')][_0xf326('0x26')]({'where':{'VoiceQueueId':_0x4f96aa[_0xf326('0x4e')]['id'],'UserId':_0x4f96aa[_0xf326('0x3a')][_0xf326('0x7f')]}})[_0xf326('0x27')](function(){return _0x1307a4;});})['then'](respondWithStatusCode(_0x5ea5d4,null))[_0xf326('0x4d')](handleError(_0x5ea5d4,null));};exports[_0xf326('0x99')]=function(_0x2b6585,_0x3d77af,_0x55e867){var _0x15e405={};var _0x27074a={};var _0x173ea9;var _0x130cbb;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x2b6585[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x3d77af,null))[_0xf326('0x27')](function(_0x28d251){if(_0x28d251){_0x173ea9=_0x28d251;_0x27074a[_0xf326('0x38')]=_['keys'](db['User'][_0xf326('0x36')]);_0x27074a[_0xf326('0x3a')]=_['keys'](_0x2b6585[_0xf326('0x3a')]);_0x27074a[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x27074a[_0xf326('0x38')],_0x27074a['query']);_0x15e405[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x27074a['model'],qs[_0xf326('0x3d')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x3d')]));_0x15e405[_0xf326('0x3e')]=_0x15e405[_0xf326('0x3e')][_0xf326('0x3f')]?_0x15e405[_0xf326('0x3e')]:_0x27074a[_0xf326('0x38')];_0x15e405[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x2b6585[_0xf326('0x3a')]['sort']);_0x15e405[_0xf326('0x44')]=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x2b6585[_0xf326('0x3a')],_0x27074a[_0xf326('0x3b')]));if(_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]){_0x15e405[_0xf326('0x44')]=_['merge'](_0x15e405[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0x15e405[_0xf326('0x3e')],function(_0x12cc1d){var _0x5ae8c7={};_0x5ae8c7[_0x12cc1d]={'$like':'%'+_0x2b6585[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5ae8c7;})});}_0x15e405=_[_0xf326('0x47')]({},_0x15e405,_0x2b6585['options']);return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x5a0c11){if(_0x5a0c11){_0x130cbb=_0x5a0c11['length'];if(!_0x2b6585[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x15e405[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x22')]);_0x15e405[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x2b6585[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x173ea9[_0xf326('0x99')](_0x15e405);}})[_0xf326('0x27')](function(_0x4a0a44){if(_0x4a0a44){return _0x4a0a44?{'count':_0x130cbb,'rows':_0x4a0a44}:null;}})['then'](respondWithResult(_0x3d77af,null))[_0xf326('0x4d')](handleError(_0x3d77af,null));};exports['getMembers']=function(_0x4ab9c0,_0x531d31,_0x878991){var _0xc4aa47={};var _0x4fa6f9={};var _0x17f967;var _0x1639f2;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x4ab9c0[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x531d31,null))['then'](function(_0x38ff4d){if(_0x38ff4d){_0x17f967=_0x38ff4d;_0x4fa6f9[_0xf326('0x38')]=_['keys'](db[_0xf326('0x95')][_0xf326('0x36')]);_0x4fa6f9[_0xf326('0x3a')]=_['keys'](_0x4ab9c0[_0xf326('0x3a')]);_0x4fa6f9[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],_0x4fa6f9[_0xf326('0x3a')]);_0xc4aa47['attributes']=_[_0xf326('0x3c')](_0x4fa6f9[_0xf326('0x38')],qs['fields'](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x3d')]));_0xc4aa47[_0xf326('0x3e')]=_0xc4aa47['attributes']['length']?_0xc4aa47[_0xf326('0x3e')]:_0x4fa6f9[_0xf326('0x38')];_0xc4aa47['order']=qs[_0xf326('0x43')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x43')]);_0xc4aa47[_0xf326('0x44')]=qs['filters'](_['pick'](_0x4ab9c0[_0xf326('0x3a')],_0x4fa6f9[_0xf326('0x3b')]));if(_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]){_0xc4aa47[_0xf326('0x44')]=_[_0xf326('0x47')](_0xc4aa47[_0xf326('0x44')],{'$or':_[_0xf326('0x2c')](_0xc4aa47['attributes'],function(_0x511e66){var _0x5d719a={};_0x5d719a[_0x511e66]={'$like':'%'+_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x5d719a;})});}_0xc4aa47=_[_0xf326('0x47')]({},_0xc4aa47,_0x4ab9c0['options']);return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})[_0xf326('0x27')](function(_0x30247a){if(_0x30247a){_0x1639f2=_0x30247a[_0xf326('0x3f')];if(!_0x4ab9c0['query']['hasOwnProperty'](_0xf326('0x41'))){_0xc4aa47[_0xf326('0x22')]=qs['limit'](_0x4ab9c0['query'][_0xf326('0x22')]);_0xc4aa47[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x4ab9c0[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x17f967[_0xf326('0x9a')](_0xc4aa47);}})['then'](function(_0xb17fae){return _0xb17fae?{'count':_0x1639f2,'rows':_0xb17fae}:null;})[_0xf326('0x27')](respondWithResult(_0x531d31,null))['catch'](handleError(_0x531d31,null));};exports['getLists']=function(_0x371e52,_0x6a202f,_0x250682){var _0x4069bb={};var _0x1ea2be={};var _0x663019;var _0x2549ab;return db[_0xf326('0x4a')][_0xf326('0x60')]({'where':{'id':_0x371e52[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x6a202f,null))[_0xf326('0x27')](function(_0x58fdca){if(_0x58fdca){_0x663019=_0x58fdca;_0x1ea2be[_0xf326('0x38')]=_[_0xf326('0x39')](db[_0xf326('0x9b')][_0xf326('0x36')]);_0x1ea2be['query']=_['keys'](_0x371e52[_0xf326('0x3a')]);_0x1ea2be['filters']=_[_0xf326('0x3c')](_0x1ea2be[_0xf326('0x38')],_0x1ea2be[_0xf326('0x3a')]);_0x4069bb['attributes']=_[_0xf326('0x3c')](_0x1ea2be['model'],qs['fields'](_0x371e52['query'][_0xf326('0x3d')]));_0x4069bb['attributes']=_0x4069bb[_0xf326('0x3e')][_0xf326('0x3f')]?_0x4069bb[_0xf326('0x3e')]:_0x1ea2be[_0xf326('0x38')];_0x4069bb[_0xf326('0x42')]=qs[_0xf326('0x43')](_0x371e52[_0xf326('0x3a')]['sort']);_0x4069bb['where']=qs[_0xf326('0x3b')](_[_0xf326('0x45')](_0x371e52[_0xf326('0x3a')],_0x1ea2be[_0xf326('0x3b')]));if(_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]){_0x4069bb['where']=_[_0xf326('0x47')](_0x4069bb['where'],{'$or':_[_0xf326('0x2c')](_0x4069bb[_0xf326('0x3e')],function(_0x5ba7ef){var _0x2671d5={};_0x2671d5[_0x5ba7ef]={'$like':'%'+_0x371e52[_0xf326('0x3a')][_0xf326('0x46')]+'%'};return _0x2671d5;})});}_0x4069bb=_[_0xf326('0x47')]({},_0x4069bb,_0x371e52[_0xf326('0x5a')]);return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x55d9bd){if(_0x55d9bd){_0x2549ab=_0x55d9bd['length'];if(!_0x371e52[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x4069bb[_0xf326('0x22')]=qs[_0xf326('0x22')](_0x371e52[_0xf326('0x3a')][_0xf326('0x22')]);_0x4069bb[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x371e52[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x663019[_0xf326('0x9c')](_0x4069bb);}})[_0xf326('0x27')](function(_0x4c88c2){if(_0x4c88c2){return _0x4c88c2?{'count':_0x2549ab,'rows':_0x4c88c2}:null;}})['then'](respondWithResult(_0x6a202f,null))['catch'](handleError(_0x6a202f,null));};exports[_0xf326('0x9d')]=function(_0x1af709,_0x3fdfc5,_0xf7df13){var _0x45afd7=moment()['format'](_0xf326('0x9e'));var _0x233857,_0xbc39f5;return db[_0xf326('0x4a')]['find']({'where':{'id':_0x1af709[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3fdfc5,null))[_0xf326('0x27')](function(_0xfa7c63){if(_0xfa7c63){_0xbc39f5=_0xfa7c63;return _0xfa7c63['addLists'](_0x1af709[_0xf326('0x52')][_0xf326('0x7f')],_['omit'](_0x1af709[_0xf326('0x52')],['ids','id'])||{});}return null;})[_0xf326('0x94')](function(_0x24dd16){var _0x4515c1;_0x233857=_0x24dd16||[];var _0x5100ec=[];if(_0x24dd16){for(var _0x293c16=0x0;_0x293c16<_0x24dd16[_0xf326('0x3f')];_0x293c16+=0x1){var _0x28ba7c=_0x24dd16[_0x293c16][_0xf326('0x54')]({'plain':!![]});_0xbc39f5['dialCheckDuplicateType']=_0x1af709[_0xf326('0x52')][_0xf326('0x9f')]?_0x1af709['body'][_0xf326('0x9f')]:_0xbc39f5['dialCheckDuplicateType'];switch(_0xbc39f5['dialCheckDuplicateType']){case _0xf326('0xa0'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),'phone')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c['CmListId'][_0xf326('0xa8')](),_0xf326('0xa9'))['field'](_0x1af709['params']['id'][_0xf326('0xa8')](),_0xf326('0x62'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','updatedAt')[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')]('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0xf326('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xf326('0x82')](_0xf326('0xad'))[_0xf326('0x84')](_0xf326('0xae'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709['params']['id'][_0xf326('0xa8')]()))[_0xf326('0x44')](_0xf326('0xb0'),squel[_0xf326('0x81')]()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')](_0xf326('0xaf'),_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;case _0xf326('0xb2'):_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')]('cm_hopper')[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')](_0xf326('0xa4'),_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','scheduledAt')[_0xf326('0x82')]('id',_0xf326('0xa6'))[_0xf326('0x82')](_0x28ba7c[_0xf326('0xac')]['toString'](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),_0xf326('0x62'))['field']('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))['where'](_0xf326('0xab'))['where']('ListId\x20=\x20?',_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3'))[_0xf326('0x44')](_0xf326('0xb0'),squel['select']()[_0xf326('0x82')]('COALESCE(phone,\x27\x27)')[_0xf326('0x84')](_0xf326('0xb1'))[_0xf326('0x44')]('VoiceQueueId\x20=\x20?',_0x1af709['params']['id'][_0xf326('0xa8')]())))[_0xf326('0xa8')]();break;default:_0x4515c1=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb1'))[_0xf326('0xa3')]([_0xf326('0xa4'),_0xf326('0xa5'),_0xf326('0xa6'),'ListId',_0xf326('0x62'),_0xf326('0xa7'),_0xf326('0x5c')],squel[_0xf326('0x81')]()[_0xf326('0x82')]('phone',_0xf326('0xa4'))[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0xa5'))[_0xf326('0x82')]('id',_0xf326('0xa6'))['field'](_0x28ba7c[_0xf326('0xac')][_0xf326('0xa8')](),_0xf326('0xa9'))[_0xf326('0x82')](_0x1af709[_0xf326('0x4e')]['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))['where'](_0xf326('0xb4'),_0x28ba7c[_0xf326('0xac')]['toString']())[_0xf326('0x44')](_0xf326('0xb3')))[_0xf326('0xa8')]();}_0x5100ec[_0xf326('0x8a')](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4515c1));}return BPromise[_0xf326('0x97')](_0x5100ec);}})[_0xf326('0x27')](function(){var _0x122dfe=[];var _0x39a5f8=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xb5'))[_0xf326('0xa3')](['CmHopperId',_0xf326('0xa4'),'OrderBy',_0xf326('0xa7'),'updatedAt'],squel[_0xf326('0x81')]()['field'](_0xf326('0xb6'))['field'](_0xf326('0xb7'))['field']('ci.OrderBy+1')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27','createdAt')[_0xf326('0x82')]('\x27'+_0x45afd7+'\x27',_0xf326('0x5c'))[_0xf326('0x84')](_0xf326('0xb8'),'ci')[_0xf326('0x86')](_0xf326('0xb1'),'h',_0xf326('0xb9'))['where']('h.scheduledat=?',_0x45afd7)[_0xf326('0x44')]('ci.ItemClass=?','PHONE'))['toString']();_0x122dfe[_0xf326('0x8a')](db['sequelize']['query'](_0x39a5f8));return BPromise[_0xf326('0x97')](_0x122dfe);})[_0xf326('0x27')](function(){return _0x233857;})['then'](respondWithResult(_0x3fdfc5,null))[_0xf326('0x4d')](handleError(_0x3fdfc5,null));};exports[_0xf326('0xba')]=function(_0x38ee2f,_0x1ea221,_0x4136f9){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1ea221,null))[_0xf326('0x27')](function(_0x424360){if(_0x424360){return _0x424360[_0xf326('0xba')](_0x38ee2f[_0xf326('0x3a')][_0xf326('0x7f')]);}})[_0xf326('0x27')](function(_0x35ff4d){if(_0x35ff4d){return db['CmHopper']['destroy']({'where':{'ListId':_0x38ee2f['query'][_0xf326('0x7f')],'VoiceQueueId':_0x38ee2f[_0xf326('0x4e')]['id']}})['then'](function(){return _0x35ff4d;});}})['then'](respondWithStatusCode(_0x1ea221,null))['catch'](handleError(_0x1ea221,null));};exports[_0xf326('0xbb')]=function(_0x1d05b3,_0x36d7c2,_0x1afa71){var _0x2a7789={};var _0x5b1d58={};var _0x5785c9;var _0x4ff3b8;return db[_0xf326('0x4a')]['findOne']({'where':{'id':_0x1d05b3['params']['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x36d7c2,null))[_0xf326('0x27')](function(_0x55e8e6){if(_0x55e8e6){_0x5785c9=_0x55e8e6;_0x5b1d58[_0xf326('0x38')]=_['keys'](db[_0xf326('0x9b')]['rawAttributes']);_0x5b1d58[_0xf326('0x3a')]=_['keys'](_0x1d05b3['query']);_0x5b1d58[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5b1d58['model'],_0x5b1d58[_0xf326('0x3a')]);_0x2a7789[_0xf326('0x3e')]=_[_0xf326('0x3c')](_0x5b1d58[_0xf326('0x38')],qs[_0xf326('0x3d')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x3d')]));_0x2a7789[_0xf326('0x3e')]=_0x2a7789[_0xf326('0x3e')][_0xf326('0x3f')]?_0x2a7789['attributes']:_0x5b1d58[_0xf326('0x38')];_0x2a7789['order']=qs[_0xf326('0x43')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x43')]);_0x2a7789[_0xf326('0x44')]=qs['filters'](_[_0xf326('0x45')](_0x1d05b3[_0xf326('0x3a')],_0x5b1d58[_0xf326('0x3b')]));if(_0x1d05b3[_0xf326('0x3a')][_0xf326('0x46')]){_0x2a7789['where']=_['merge'](_0x2a7789['where'],{'$or':_[_0xf326('0x2c')](_0x2a7789['attributes'],function(_0x173bea){var _0x94eaa1={};_0x94eaa1[_0x173bea]={'$like':'%'+_0x1d05b3[_0xf326('0x3a')]['filter']+'%'};return _0x94eaa1;})});}_0x2a7789=_[_0xf326('0x47')]({},_0x2a7789,_0x1d05b3[_0xf326('0x5a')]);return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})['then'](function(_0x5387af){if(_0x5387af){_0x4ff3b8=_0x5387af[_0xf326('0x3f')];if(!_0x1d05b3[_0xf326('0x3a')][_0xf326('0x40')](_0xf326('0x41'))){_0x2a7789['limit']=qs[_0xf326('0x22')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x22')]);_0x2a7789[_0xf326('0x20')]=qs[_0xf326('0x20')](_0x1d05b3[_0xf326('0x3a')][_0xf326('0x20')]);}return _0x5785c9[_0xf326('0xbb')](_0x2a7789);}})[_0xf326('0x27')](function(_0x595e28){if(_0x595e28){return _0x595e28?{'count':_0x4ff3b8,'rows':_0x595e28}:null;}})['then'](respondWithResult(_0x36d7c2,null))[_0xf326('0x4d')](handleError(_0x36d7c2,null));};exports['addBlackLists']=function(_0x130b92,_0x1e7099,_0x47b04b){var _0x470e90,_0x5d9653;return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x130b92[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x1e7099,null))[_0xf326('0x27')](function(_0x13ba1a){if(_0x13ba1a){_0x5d9653=_0x13ba1a;return _0x13ba1a[_0xf326('0xbc')](_0x130b92['body'][_0xf326('0x7f')],_['omit'](_0x130b92['body'],['ids','id'])||{});}return null;})['spread'](function(_0xb6e17c){var _0x4d19ed;_0x470e90=_0xb6e17c||[];var _0x7c6644=[];if(_0xb6e17c){for(var _0x4eb5d3=0x0;_0x4eb5d3<_0xb6e17c[_0xf326('0x3f')];_0x4eb5d3+=0x1){var _0x4e2160=_0xb6e17c[_0x4eb5d3]['get']({'plain':!![]});_0x4d19ed=squel[_0xf326('0xa1')]()[_0xf326('0xa2')](_0xf326('0xbd'))[_0xf326('0xa3')](['phone',_0xf326('0xa6'),_0xf326('0xa9'),_0xf326('0x62'),_0xf326('0xa7'),'updatedAt'],squel['select']()['field']('phone',_0xf326('0xa4'))['field']('id','ContactId')[_0xf326('0x82')](_0x4e2160['CmListId']['toString'](),'ListId')[_0xf326('0x82')](_0x130b92['params']['id'][_0xf326('0xa8')](),'VoiceQueueId')[_0xf326('0x82')]('NOW()',_0xf326('0xa7'))[_0xf326('0x82')](_0xf326('0xbe'),_0xf326('0x5c'))['from'](_0xf326('0xaa'))[_0xf326('0x44')](_0xf326('0xab'))[_0xf326('0x44')](_0xf326('0xb4'),_0x4e2160[_0xf326('0xac')][_0xf326('0xa8')]())[_0xf326('0x44')](_0xf326('0xb3')))['toString']();_0x7c6644['push'](db[_0xf326('0x73')][_0xf326('0x3a')](_0x4d19ed));}return BPromise[_0xf326('0x97')](_0x7c6644);}})[_0xf326('0x27')](function(){return _0x470e90;})[_0xf326('0x27')](respondWithResult(_0x1e7099,null))['catch'](handleError(_0x1e7099,null));};exports[_0xf326('0xbf')]=function(_0x3e715a,_0x5d2dfa,_0x4fa725){return db[_0xf326('0x4a')][_0xf326('0x30')]({'where':{'id':_0x3e715a[_0xf326('0x4e')]['id']}})[_0xf326('0x27')](handleEntityNotFound(_0x5d2dfa,null))[_0xf326('0x27')](function(_0x4c3be5){if(_0x4c3be5){return _0x4c3be5['removeBlackLists'](_0x3e715a[_0xf326('0x3a')][_0xf326('0x7f')]);}})['then'](function(_0x53beb9){if(_0x53beb9){return db[_0xf326('0x68')]['destroy']({'where':{'ListId':_0x3e715a[_0xf326('0x3a')]['ids'],'VoiceQueueId':_0x3e715a[_0xf326('0x4e')]['id']}})['then'](function(){return _0x53beb9;});}})[_0xf326('0x27')](respondWithStatusCode(_0x5d2dfa,null))[_0xf326('0x4d')](handleError(_0x5d2dfa,null));};
\ No newline at end of file
index d1f6b38..7708ec3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdeb2=['VoiceQueue','setMaxListeners','save','emit','hasOwnProperty','events'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdeb2,0x14f));var _0x2deb=function(_0x2db45e,_0x3c3b37){_0x2db45e=_0x2db45e-0x0;var _0x200a5=_0xdeb2[_0x2db45e];return _0x200a5;};'use strict';var EventEmitter=require(_0x2deb('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x2deb('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2deb('0x2')](0x0);var events={'afterCreate':_0x2deb('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4e0372){return function(_0x3b225a,_0x5b555b,_0x92027){VoiceQueueEvents['emit'](_0x4e0372+':'+_0x3b225a['id'],_0x3b225a);VoiceQueueEvents[_0x2deb('0x4')](_0x4e0372,_0x3b225a);_0x92027(null);};}for(var e in events){if(events[_0x2deb('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xc493=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x5459f5,_0x2b208c){var _0x12253c=function(_0x203790){while(--_0x203790){_0x5459f5['push'](_0x5459f5['shift']());}};_0x12253c(++_0x2b208c);}(_0xc493,0xb1));var _0x3c49=function(_0x24b6e6,_0x3b7e13){_0x24b6e6=_0x24b6e6-0x0;var _0x56fceb=_0xc493[_0x24b6e6];return _0x56fceb;};'use strict';var EventEmitter=require(_0x3c49('0x0'));var VoiceQueue=require(_0x3c49('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x3c49('0x2')](0x0);var events={'afterCreate':_0x3c49('0x3'),'afterUpdate':_0x3c49('0x4'),'afterDestroy':_0x3c49('0x5')};function emitEvent(_0x5b9c74){return function(_0x541ba5,_0x1e8ba7,_0x4921c3){VoiceQueueEvents[_0x3c49('0x6')](_0x5b9c74+':'+_0x541ba5['id'],_0x541ba5);VoiceQueueEvents[_0x3c49('0x6')](_0x5b9c74,_0x541ba5);_0x4921c3(null);};}for(var e in events){if(events[_0x3c49('0x7')](e)){var event=events[e];VoiceQueue[_0x3c49('0x8')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index e538e43..46f1100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0x3e74,0x175));var _0x43e7=function(_0x43a251,_0x30e9db){_0x43a251=_0x43a251-0x0;var _0x2f8ddf=_0x3e74[_0x43a251];return _0x2f8ddf;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1124d3,_0x59d506){var _0x8a1853=function(_0x5eced2){while(--_0x5eced2){_0x1124d3['push'](_0x1124d3['shift']());}};_0x8a1853(++_0x59d506);}(_0x70e0,0x17b));var _0x070e=function(_0x98d352,_0x367316){_0x98d352=_0x98d352-0x0;var _0x477e82=_0x70e0[_0x98d352];return _0x477e82;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index faa4c55..5debaa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb6b=['stringify','error','message','info','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','map','include','model','ShowVoiceQueue','find','where','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x195547,_0x375530){var _0x181f56=function(_0x536ea5){while(--_0x536ea5){_0x195547['push'](_0x195547['shift']());}};_0x181f56(++_0x375530);}(_0xfb6b,0x1da));var _0xbfb6=function(_0x25399d,_0x436f0e){_0x25399d=_0x25399d-0x0;var _0x232046=_0xfb6b[_0x25399d];return _0x232046;};'use strict';var _=require(_0xbfb6('0x0'));var util=require('util');var moment=require(_0xbfb6('0x1'));var BPromise=require(_0xbfb6('0x2'));var rs=require(_0xbfb6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbfb6('0x4'));var logger=require(_0xbfb6('0x5'))(_0xbfb6('0x6'));var config=require(_0xbfb6('0x7'));var jayson=require(_0xbfb6('0x8'));var client=jayson[_0xbfb6('0x9')][_0xbfb6('0xa')]({'port':0x232a});config[_0xbfb6('0xb')]=_['defaults'](config[_0xbfb6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbfb6('0xc'))(new Redis(config[_0xbfb6('0xb')]));require('./voiceQueue.socket')[_0xbfb6('0xd')](socket);function respondWithRpcPromise(_0x262cbe,_0x45d5ce,_0x4ab0c6){return new BPromise(function(_0x3a6e17,_0x365a73){return client[_0xbfb6('0xe')](_0x262cbe,_0x4ab0c6)[_0xbfb6('0xf')](function(_0x4cab5d){logger['info'](_0xbfb6('0x10'),_0x45d5ce,_0xbfb6('0x11'));logger[_0xbfb6('0x12')](_0xbfb6('0x13'),_0x45d5ce,_0xbfb6('0x11'),JSON[_0xbfb6('0x14')](_0x4cab5d));if(_0x4cab5d['error']){if(_0x4cab5d[_0xbfb6('0x15')]['code']===0x1f4){logger[_0xbfb6('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x45d5ce,_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);return _0x365a73(_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);}logger[_0xbfb6('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x45d5ce,_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);return _0x3a6e17(_0x4cab5d[_0xbfb6('0x15')][_0xbfb6('0x16')]);}else{logger[_0xbfb6('0x17')](_0xbfb6('0x10'),_0x45d5ce,'request\x20sent');_0x3a6e17(_0x4cab5d['result'][_0xbfb6('0x16')]);}})[_0xbfb6('0x18')](function(_0x176988){logger[_0xbfb6('0x15')]('VoiceQueue,\x20%s,\x20%s',_0x45d5ce,_0x176988);_0x365a73(_0x176988);});});}exports[_0xbfb6('0x19')]=function(_0x5a261d){var _0x25223c=this;return new Promise(function(_0x2a0b80,_0x3c7055){return db[_0xbfb6('0x1a')][_0xbfb6('0x1b')]({'raw':_0x5a261d['options']?_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a261d[_0xbfb6('0x1c')]?_0x5a261d['options']['where']||null:null,'attributes':_0x5a261d['options']?_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x1e')]||null:null,'limit':_0x5a261d[_0xbfb6('0x1c')]?_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x1f')]||null:null,'include':_0x5a261d['options']?_0x5a261d[_0xbfb6('0x1c')]['include']?_[_0xbfb6('0x20')](_0x5a261d[_0xbfb6('0x1c')][_0xbfb6('0x21')],function(_0x7057fb){return{'model':db[_0x7057fb[_0xbfb6('0x22')]],'as':_0x7057fb['as'],'attributes':_0x7057fb['attributes'],'include':_0x7057fb[_0xbfb6('0x21')]?_['map'](_0x7057fb[_0xbfb6('0x21')],function(_0x457521){return{'model':db[_0x457521['model']],'as':_0x457521['as'],'attributes':_0x457521[_0xbfb6('0x1e')],'include':_0x457521[_0xbfb6('0x21')]?_[_0xbfb6('0x20')](_0x457521[_0xbfb6('0x21')],function(_0xf8e29){return{'model':db[_0xf8e29[_0xbfb6('0x22')]],'as':_0xf8e29['as'],'attributes':_0xf8e29[_0xbfb6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f6df5){logger[_0xbfb6('0x17')]('GetVoiceQueue',_0x5a261d);logger['debug'](_0xbfb6('0x19'),_0x5a261d,JSON[_0xbfb6('0x14')](_0x4f6df5));_0x2a0b80(_0x4f6df5);})[_0xbfb6('0x18')](function(_0xac1a3e){logger[_0xbfb6('0x15')](_0xbfb6('0x19'),_0xac1a3e[_0xbfb6('0x16')],_0x5a261d);_0x3c7055(_0x25223c[_0xbfb6('0x15')](0x1f4,_0xac1a3e['message']));});});};exports[_0xbfb6('0x23')]=function(_0x5d0571){var _0x22df31=this;return new Promise(function(_0x403834,_0x1b57c1){return db[_0xbfb6('0x1a')][_0xbfb6('0x24')]({'raw':_0x5d0571['options']?_0x5d0571[_0xbfb6('0x1c')][_0xbfb6('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d0571['options']?_0x5d0571['options'][_0xbfb6('0x25')]||null:null,'attributes':_0x5d0571[_0xbfb6('0x1c')]?_0x5d0571['options'][_0xbfb6('0x1e')]||null:null,'include':_0x5d0571[_0xbfb6('0x1c')]?_0x5d0571[_0xbfb6('0x1c')][_0xbfb6('0x21')]?_['map'](_0x5d0571[_0xbfb6('0x1c')][_0xbfb6('0x21')],function(_0x3dd9e6){return{'model':db[_0x3dd9e6[_0xbfb6('0x22')]],'as':_0x3dd9e6['as'],'attributes':_0x3dd9e6['attributes'],'include':_0x3dd9e6[_0xbfb6('0x21')]?_[_0xbfb6('0x20')](_0x3dd9e6[_0xbfb6('0x21')],function(_0x1682a){return{'model':db[_0x1682a['model']],'as':_0x1682a['as'],'attributes':_0x1682a[_0xbfb6('0x1e')],'include':_0x1682a[_0xbfb6('0x21')]?_[_0xbfb6('0x20')](_0x1682a['include'],function(_0x204328){return{'model':db[_0x204328[_0xbfb6('0x22')]],'as':_0x204328['as'],'attributes':_0x204328[_0xbfb6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbfb6('0xf')](function(_0x3d11a3){logger[_0xbfb6('0x17')]('ShowVoiceQueue',_0x5d0571);logger[_0xbfb6('0x12')](_0xbfb6('0x23'),_0x5d0571,JSON[_0xbfb6('0x14')](_0x3d11a3));_0x403834(_0x3d11a3);})[_0xbfb6('0x18')](function(_0x294812){logger[_0xbfb6('0x15')]('ShowVoiceQueue',_0x294812['message'],_0x5d0571);_0x1b57c1(_0x22df31[_0xbfb6('0x15')](0x1f4,_0x294812['message']));});});};
\ No newline at end of file
+var _0x0022=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','include','map','model','ShowVoiceQueue','find','attributes','lodash','util','moment'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x0022,0xe7));var _0x2002=function(_0x55ac2a,_0x231b87){_0x55ac2a=_0x55ac2a-0x0;var _0xe4a21d=_0x0022[_0x55ac2a];return _0xe4a21d;};'use strict';var _=require(_0x2002('0x0'));var util=require(_0x2002('0x1'));var moment=require(_0x2002('0x2'));var BPromise=require(_0x2002('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2002('0x4'));var db=require(_0x2002('0x5'))['db'];var utils=require(_0x2002('0x6'));var logger=require(_0x2002('0x7'))('rpc');var config=require(_0x2002('0x8'));var jayson=require(_0x2002('0x9'));var client=jayson[_0x2002('0xa')][_0x2002('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2002('0xc')],{'host':_0x2002('0xd'),'port':0x18eb});var socket=require(_0x2002('0xe'))(new Redis(config[_0x2002('0xc')]));require(_0x2002('0xf'))[_0x2002('0x10')](socket);function respondWithRpcPromise(_0x48d99b,_0xbb0552,_0x28ff61){return new BPromise(function(_0x145340,_0x15ba3a){return client[_0x2002('0x11')](_0x48d99b,_0x28ff61)[_0x2002('0x12')](function(_0x34dbca){logger[_0x2002('0x13')](_0x2002('0x14'),_0xbb0552,'request\x20sent');logger[_0x2002('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0xbb0552,_0x2002('0x16'),JSON[_0x2002('0x17')](_0x34dbca));if(_0x34dbca[_0x2002('0x18')]){if(_0x34dbca['error'][_0x2002('0x19')]===0x1f4){logger[_0x2002('0x18')](_0x2002('0x14'),_0xbb0552,_0x34dbca[_0x2002('0x18')][_0x2002('0x1a')]);return _0x15ba3a(_0x34dbca[_0x2002('0x18')][_0x2002('0x1a')]);}logger[_0x2002('0x18')](_0x2002('0x14'),_0xbb0552,_0x34dbca[_0x2002('0x18')][_0x2002('0x1a')]);return _0x145340(_0x34dbca[_0x2002('0x18')]['message']);}else{logger[_0x2002('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xbb0552,_0x2002('0x16'));_0x145340(_0x34dbca['result'][_0x2002('0x1a')]);}})[_0x2002('0x1b')](function(_0x5e0cc3){logger[_0x2002('0x18')](_0x2002('0x14'),_0xbb0552,_0x5e0cc3);_0x15ba3a(_0x5e0cc3);});});}exports[_0x2002('0x1c')]=function(_0x593e28){var _0x15d834=this;return new Promise(function(_0x139ab7,_0x18b32b){return db[_0x2002('0x1d')][_0x2002('0x1e')]({'raw':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x593e28['options']?_0x593e28[_0x2002('0x1f')][_0x2002('0x20')]||null:null,'attributes':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')]['attributes']||null:null,'limit':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')]['limit']||null:null,'include':_0x593e28[_0x2002('0x1f')]?_0x593e28[_0x2002('0x1f')][_0x2002('0x21')]?_[_0x2002('0x22')](_0x593e28[_0x2002('0x1f')][_0x2002('0x21')],function(_0x3b7df6){return{'model':db[_0x3b7df6[_0x2002('0x23')]],'as':_0x3b7df6['as'],'attributes':_0x3b7df6['attributes'],'include':_0x3b7df6[_0x2002('0x21')]?_[_0x2002('0x22')](_0x3b7df6[_0x2002('0x21')],function(_0x98822c){return{'model':db[_0x98822c[_0x2002('0x23')]],'as':_0x98822c['as'],'attributes':_0x98822c['attributes'],'include':_0x98822c[_0x2002('0x21')]?_[_0x2002('0x22')](_0x98822c[_0x2002('0x21')],function(_0x9c0ce7){return{'model':db[_0x9c0ce7['model']],'as':_0x9c0ce7['as'],'attributes':_0x9c0ce7['attributes']};}):[]};}):[]};}):[]:[]})[_0x2002('0x12')](function(_0x451f19){logger[_0x2002('0x13')](_0x2002('0x1c'),_0x593e28);logger[_0x2002('0x15')](_0x2002('0x1c'),_0x593e28,JSON[_0x2002('0x17')](_0x451f19));_0x139ab7(_0x451f19);})[_0x2002('0x1b')](function(_0x221428){logger['error']('GetVoiceQueue',_0x221428[_0x2002('0x1a')],_0x593e28);_0x18b32b(_0x15d834[_0x2002('0x18')](0x1f4,_0x221428[_0x2002('0x1a')]));});});};exports[_0x2002('0x24')]=function(_0x4d5590){var _0x326a30=this;return new Promise(function(_0xa2a545,_0x38e84b){return db[_0x2002('0x1d')][_0x2002('0x25')]({'raw':_0x4d5590[_0x2002('0x1f')]?_0x4d5590[_0x2002('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x4d5590['options']?_0x4d5590[_0x2002('0x1f')][_0x2002('0x20')]||null:null,'attributes':_0x4d5590[_0x2002('0x1f')]?_0x4d5590[_0x2002('0x1f')][_0x2002('0x26')]||null:null,'include':_0x4d5590['options']?_0x4d5590['options'][_0x2002('0x21')]?_['map'](_0x4d5590[_0x2002('0x1f')][_0x2002('0x21')],function(_0x1689a0){return{'model':db[_0x1689a0['model']],'as':_0x1689a0['as'],'attributes':_0x1689a0[_0x2002('0x26')],'include':_0x1689a0[_0x2002('0x21')]?_[_0x2002('0x22')](_0x1689a0['include'],function(_0x3f4349){return{'model':db[_0x3f4349['model']],'as':_0x3f4349['as'],'attributes':_0x3f4349[_0x2002('0x26')],'include':_0x3f4349[_0x2002('0x21')]?_[_0x2002('0x22')](_0x3f4349[_0x2002('0x21')],function(_0x397bb2){return{'model':db[_0x397bb2[_0x2002('0x23')]],'as':_0x397bb2['as'],'attributes':_0x397bb2['attributes']};}):[]};}):[]};}):[]:[]})[_0x2002('0x12')](function(_0x4f5281){logger[_0x2002('0x13')](_0x2002('0x24'),_0x4d5590);logger[_0x2002('0x15')](_0x2002('0x24'),_0x4d5590,JSON[_0x2002('0x17')](_0x4f5281));_0xa2a545(_0x4f5281);})[_0x2002('0x1b')](function(_0x35ce7b){logger[_0x2002('0x18')](_0x2002('0x24'),_0x35ce7b[_0x2002('0x1a')],_0x4d5590);_0x38e84b(_0x326a30[_0x2002('0x18')](0x1f4,_0x35ce7b[_0x2002('0x1a')]));});});};
\ No newline at end of file
index ed93b1a..7583339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1aab=['remove','update','emit','removeListener','length','voiceQueue:','save'];(function(_0x101933,_0x2ac242){var _0x25103b=function(_0x3a2cd5){while(--_0x3a2cd5){_0x101933['push'](_0x101933['shift']());}};_0x25103b(++_0x2ac242);}(_0x1aab,0x109));var _0xb1aa=function(_0x472ca8,_0x2c8c37){_0x472ca8=_0x472ca8-0x0;var _0x14c783=_0x1aab[_0x472ca8];return _0x14c783;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb1aa('0x0'),_0xb1aa('0x1'),_0xb1aa('0x2')];function createListener(_0x2ad353,_0x1c0708){return function(_0x433939){_0x1c0708[_0xb1aa('0x3')](_0x2ad353,_0x433939);};}function removeListener(_0x1a4d00,_0x1e1516){return function(){VoiceQueueEvents[_0xb1aa('0x4')](_0x1a4d00,_0x1e1516);};}exports['register']=function(_0xeeb088){for(var _0x435f19=0x0,_0x223172=events[_0xb1aa('0x5')];_0x435f19<_0x223172;_0x435f19++){var _0x33e318=events[_0x435f19];var _0x3b66e8=createListener(_0xb1aa('0x6')+_0x33e318,_0xeeb088);VoiceQueueEvents['on'](_0x33e318,_0x3b66e8);}};
\ No newline at end of file
+var _0x51ac=['voiceQueue:','remove','update','removeListener','length'];(function(_0x290fb7,_0x12cb99){var _0x36ab45=function(_0x26c138){while(--_0x26c138){_0x290fb7['push'](_0x290fb7['shift']());}};_0x36ab45(++_0x12cb99);}(_0x51ac,0xec));var _0xc51a=function(_0x56d507,_0x395a9f){_0x56d507=_0x56d507-0x0;var _0x1fc0d9=_0x51ac[_0x56d507];return _0x1fc0d9;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=['save',_0xc51a('0x0'),_0xc51a('0x1')];function createListener(_0x4c8de7,_0x6022d8){return function(_0x769aef){_0x6022d8['emit'](_0x4c8de7,_0x769aef);};}function removeListener(_0x100176,_0x1327b4){return function(){VoiceQueueEvents[_0xc51a('0x2')](_0x100176,_0x1327b4);};}exports['register']=function(_0x36cd22){for(var _0x30dfec=0x0,_0x2b9006=events[_0xc51a('0x3')];_0x30dfec<_0x2b9006;_0x30dfec++){var _0x281e73=events[_0x30dfec];var _0xd1b7f0=createListener(_0xc51a('0x4')+_0x281e73,_0x36cd22);VoiceQueueEvents['on'](_0x281e73,_0xd1b7f0);}};
\ No newline at end of file
index ed1c3b9..44202c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3b6=['create','put','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','getVoiceQueuesReport','/:id','show','post'];(function(_0x5a7dd3,_0x26b7cf){var _0x2f4d07=function(_0x280510){while(--_0x280510){_0x5a7dd3['push'](_0x5a7dd3['shift']());}};_0x2f4d07(++_0x26b7cf);}(_0xe3b6,0x1e4));var _0x6e3b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe3b6[_0x55e08b];return _0xd1a7ff;};'use strict';var multer=require(_0x6e3b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6e3b('0x1'));var express=require('express');var router=express[_0x6e3b('0x2')]();var fs_extra=require(_0x6e3b('0x3'));var auth=require(_0x6e3b('0x4'));var interaction=require(_0x6e3b('0x5'));var config=require(_0x6e3b('0x6'));var controller=require(_0x6e3b('0x7'));router[_0x6e3b('0x8')]('/',auth[_0x6e3b('0x9')](),controller['index']);router[_0x6e3b('0x8')](_0x6e3b('0xa'),auth['isAuthenticated'](),controller[_0x6e3b('0xb')]);router[_0x6e3b('0x8')]('/index',auth[_0x6e3b('0x9')](),controller[_0x6e3b('0xc')]);router['get'](_0x6e3b('0xd'),auth['isAuthenticated'](),controller[_0x6e3b('0xe')]);router[_0x6e3b('0xf')]('/',auth[_0x6e3b('0x9')](),controller[_0x6e3b('0x10')]);router[_0x6e3b('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6e3b('0x12')](_0x6e3b('0xd'),auth[_0x6e3b('0x9')](),controller[_0x6e3b('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x60cb=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','getVoiceQueuesReport','/:id','post','put','update','delete','exports'];(function(_0x3b4693,_0x3f3be3){var _0x10492b=function(_0x9795c){while(--_0x9795c){_0x3b4693['push'](_0x3b4693['shift']());}};_0x10492b(++_0x3f3be3);}(_0x60cb,0x121));var _0xb60c=function(_0x4d8a96,_0x4c1b83){_0x4d8a96=_0x4d8a96-0x0;var _0x2b8ff6=_0x60cb[_0x4d8a96];return _0x2b8ff6;};'use strict';var multer=require('multer');var util=require(_0xb60c('0x0'));var path=require(_0xb60c('0x1'));var timeout=require(_0xb60c('0x2'));var express=require(_0xb60c('0x3'));var router=express['Router']();var fs_extra=require(_0xb60c('0x4'));var auth=require(_0xb60c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb60c('0x6'));var controller=require(_0xb60c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb60c('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/index',auth[_0xb60c('0x9')](),controller[_0xb60c('0xa')]);router['get'](_0xb60c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb60c('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb60c('0xd')](_0xb60c('0xb'),auth[_0xb60c('0x9')](),controller[_0xb60c('0xe')]);router[_0xb60c('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb60c('0x10')]=router;
\ No newline at end of file
index 4f2ac60..380ffbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd01=['format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x3d78cb,_0x829397){var _0x33cc9c=function(_0x193231){while(--_0x193231){_0x3d78cb['push'](_0x3d78cb['shift']());}};_0x33cc9c(++_0x829397);}(_0xbd01,0xf9));var _0x1bd0=function(_0x16d753,_0x197285){_0x16d753=_0x16d753-0x0;var _0x17a385=_0xbd01[_0x16d753];return _0x17a385;};'use strict';var Sequelize=require(_0x1bd0('0x0'));var moment=require(_0x1bd0('0x1'));module[_0x1bd0('0x2')]={'type':{'type':Sequelize[_0x1bd0('0x3')]},'uniqueid':{'type':Sequelize[_0x1bd0('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x1bd0('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x1bd0('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x1bd0('0x4')],'set':function(_0x4ff426){var _0xbdd9d6=moment(_0x4ff426);var _0x1207fe=moment(this[_0x1bd0('0x5')](_0x1bd0('0x6')))[_0x1bd0('0x7')](_0x1bd0('0x8'));var _0x130ed0=_0xbdd9d6['diff'](_0x1207fe,_0x1bd0('0x9'));this[_0x1bd0('0xa')](_0x1bd0('0xb'),_0x4ff426);this['setDataValue'](_0x1bd0('0xc'),_0x130ed0||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x1bd0('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1bd0('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1bd0('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x1bd0('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x1bd0('0xd')]},'channel':{'type':Sequelize[_0x1bd0('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x1bd0('0x3')]},'accountcode':{'type':Sequelize[_0x1bd0('0x3')]},'context':{'type':Sequelize[_0x1bd0('0x3')]},'exten':{'type':Sequelize[_0x1bd0('0x3')]},'priority':{'type':Sequelize[_0x1bd0('0x3')]},'holdtime':{'type':Sequelize[_0x1bd0('0xd')]},'mohtime':{'type':Sequelize[_0x1bd0('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1bd0('0x3')]},'transfer':{'type':Sequelize[_0x1bd0('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1bd0('0x3')],'comment':_0x1bd0('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x1bd0('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1bd0('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1bd0('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x1bd0('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x1bd0('0x3')]}};
\ No newline at end of file
+var _0x9c43=['BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER'];(function(_0x164334,_0x2c9b1f){var _0x5ad15b=function(_0x5cca4f){while(--_0x5cca4f){_0x164334['push'](_0x164334['shift']());}};_0x5ad15b(++_0x2c9b1f);}(_0x9c43,0x1a3));var _0x39c4=function(_0x2f4f25,_0x592d31){_0x2f4f25=_0x2f4f25-0x0;var _0x6a112a=_0x9c43[_0x2f4f25];return _0x6a112a;};'use strict';var Sequelize=require(_0x39c4('0x0'));var moment=require(_0x39c4('0x1'));module[_0x39c4('0x2')]={'type':{'type':Sequelize[_0x39c4('0x3')]},'uniqueid':{'type':Sequelize[_0x39c4('0x3')]},'calleridnum':{'type':Sequelize[_0x39c4('0x3')]},'calleridname':{'type':Sequelize[_0x39c4('0x3')]},'queue':{'type':Sequelize[_0x39c4('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x4de853){var _0x320b86=moment(_0x4de853);var _0x593909=moment(this[_0x39c4('0x4')](_0x39c4('0x5')))[_0x39c4('0x6')](_0x39c4('0x7'));var _0x943054=_0x320b86[_0x39c4('0x8')](_0x593909,_0x39c4('0x9'));this[_0x39c4('0xa')]('queuecallerleaveAt',_0x4de853);this[_0x39c4('0xa')](_0x39c4('0xb'),_0x943054||null);}},'position':{'type':Sequelize[_0x39c4('0xc')]},'count':{'type':Sequelize[_0x39c4('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x39c4('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x39c4('0xe')]},'queuecallercomplete':{'type':Sequelize[_0x39c4('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x39c4('0xe')]},'queuecallerexit':{'type':Sequelize[_0x39c4('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x39c4('0xe')]},'queuecallerexitreason':{'type':Sequelize[_0x39c4('0x3')],'comment':_0x39c4('0xf')},'originalposition':{'type':Sequelize[_0x39c4('0xc')]},'channel':{'type':Sequelize[_0x39c4('0x3')]},'connectedlinenum':{'type':Sequelize[_0x39c4('0x3')]},'connectedlinename':{'type':Sequelize[_0x39c4('0x3')]},'accountcode':{'type':Sequelize[_0x39c4('0x3')]},'context':{'type':Sequelize[_0x39c4('0x3')]},'exten':{'type':Sequelize[_0x39c4('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x39c4('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x39c4('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x39c4('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x39c4('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x39c4('0x3')]},'secondDisposition':{'type':Sequelize[_0x39c4('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'note':{'type':Sequelize[_0x39c4('0x3')]}};
\ No newline at end of file
index b2c12b4..bf03532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb96c=['stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','describe','getVoiceQueuesReport','pick','rows','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','update','then','destroy','error'];(function(_0x55ad2a,_0x5ed7d9){var _0x5a90c8=function(_0x520326){while(--_0x520326){_0x55ad2a['push'](_0x55ad2a['shift']());}};_0x5a90c8(++_0x5ed7d9);}(_0xb96c,0x166));var _0xcb96=function(_0x1fa6a0,_0x26671e){_0x1fa6a0=_0x1fa6a0-0x0;var _0x2cafe6=_0xb96c[_0x1fa6a0];return _0x2cafe6;};'use strict';var emlformat=require(_0xcb96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcb96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb96('0x2'));var moment=require(_0xcb96('0x3'));var BPromise=require(_0xcb96('0x4'));var Mustache=require(_0xcb96('0x5'));var util=require(_0xcb96('0x6'));var path=require(_0xcb96('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xcb96('0x8'));var fs=require('fs');var fs_extra=require(_0xcb96('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcb96('0xa'));var jsforce=require(_0xcb96('0xb'));var deskjs=require(_0xcb96('0xc'));var toCsv=require('to-csv');var querystring=require(_0xcb96('0xd'));var Papa=require(_0xcb96('0xe'));var Redis=require(_0xcb96('0xf'));var authService=require(_0xcb96('0x10'));var qs=require(_0xcb96('0x11'));var as=require(_0xcb96('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb96('0x13'))(_0xcb96('0x14'));var utils=require(_0xcb96('0x15'));var config=require(_0xcb96('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb96('0x17'))['db'];config[_0xcb96('0x18')]=_[_0xcb96('0x19')](config[_0xcb96('0x18')],{'host':_0xcb96('0x1a'),'port':0x18eb});var socket=require(_0xcb96('0x1b'))(new Redis(config[_0xcb96('0x18')]));require('./voiceQueueReport.socket')[_0xcb96('0x1c')](socket);function respondWithStatusCode(_0x3f4a1a,_0x3590cb){_0x3590cb=_0x3590cb||0xcc;return function(_0x317589){if(_0x317589){return _0x3f4a1a[_0xcb96('0x1d')](_0x3590cb);}return _0x3f4a1a[_0xcb96('0x1e')](_0x3590cb)[_0xcb96('0x1f')]();};}function respondWithResult(_0xc41bcd,_0x24b812){_0x24b812=_0x24b812||0xc8;return function(_0x5e89bb){if(_0x5e89bb){return _0xc41bcd['status'](_0x24b812)[_0xcb96('0x20')](_0x5e89bb);}};}function respondWithFilteredResult(_0x2ffc5e,_0x4ea902){return function(_0xabe03b){if(_0xabe03b){var _0x4dd6d6=typeof _0x4ea902[_0xcb96('0x21')]==='undefined'&&typeof _0x4ea902['limit']===_0xcb96('0x22');var _0x33cc86=_0xabe03b[_0xcb96('0x23')];var _0x586ad8=_0x4dd6d6?0x0:_0x4ea902[_0xcb96('0x21')];var _0x49b8a1=_0x4dd6d6?_0xabe03b[_0xcb96('0x23')]:_0x4ea902[_0xcb96('0x21')]+_0x4ea902[_0xcb96('0x24')];var _0x2b89e4;if(_0x49b8a1>=_0x33cc86){_0x49b8a1=_0x33cc86;_0x2b89e4=0xc8;}else{_0x2b89e4=0xce;}_0x2ffc5e['status'](_0x2b89e4);return _0x2ffc5e['set']('Content-Range',_0x586ad8+'-'+_0x49b8a1+'/'+_0x33cc86)[_0xcb96('0x20')](_0xabe03b);}return null;};}function patchUpdates(_0x2fdca4){return function(_0x336a9a){try{jsonpatch[_0xcb96('0x25')](_0x336a9a,_0x2fdca4,!![]);}catch(_0x1bafea){return BPromise['reject'](_0x1bafea);}return _0x336a9a['save']();};}function saveUpdates(_0x52fb57,_0x3c8850){return function(_0x2ead60){if(_0x2ead60){return _0x2ead60[_0xcb96('0x26')](_0x52fb57)[_0xcb96('0x27')](function(_0x391426){return _0x391426;});}return null;};}function removeEntity(_0x17fb26,_0x1e4d8c){return function(_0x516123){if(_0x516123){return _0x516123[_0xcb96('0x28')]()[_0xcb96('0x27')](function(){_0x17fb26[_0xcb96('0x1e')](0xcc)[_0xcb96('0x1f')]();});}};}function handleEntityNotFound(_0x58f9eb,_0x3ccd5c){return function(_0x278da2){if(!_0x278da2){_0x58f9eb[_0xcb96('0x1d')](0x194);}return _0x278da2;};}function handleError(_0x288dc7,_0x3efdb1){_0x3efdb1=_0x3efdb1||0x1f4;return function(_0x53bf81){logger[_0xcb96('0x29')](_0x53bf81[_0xcb96('0x2a')]);if(_0x53bf81['name']){delete _0x53bf81[_0xcb96('0x2b')];}_0x288dc7[_0xcb96('0x1e')](_0x3efdb1)[_0xcb96('0x2c')](_0x53bf81);};}exports[_0xcb96('0x2d')]=function(_0x1cc435,_0x1cb33a){var _0x98e802={},_0x3e9273={},_0x1c36e6={'count':0x0,'rows':[]};var _0x39ff7f=_[_0xcb96('0x2e')](db[_0xcb96('0x2f')][_0xcb96('0x30')],function(_0x51af1a){return{'name':_0x51af1a[_0xcb96('0x31')],'type':_0x51af1a[_0xcb96('0x32')]['key']};});_0x3e9273[_0xcb96('0x33')]=_[_0xcb96('0x2e')](_0x39ff7f,_0xcb96('0x2b'));_0x3e9273['query']=_['keys'](_0x1cc435[_0xcb96('0x34')]);_0x3e9273['filters']=_['intersection'](_0x3e9273['model'],_0x3e9273[_0xcb96('0x34')]);_0x98e802[_0xcb96('0x35')]=_[_0xcb96('0x36')](_0x3e9273[_0xcb96('0x33')],qs[_0xcb96('0x37')](_0x1cc435['query'][_0xcb96('0x37')]));_0x98e802[_0xcb96('0x35')]=_0x98e802[_0xcb96('0x35')][_0xcb96('0x38')]?_0x98e802[_0xcb96('0x35')]:_0x3e9273[_0xcb96('0x33')];if(!_0x1cc435[_0xcb96('0x34')][_0xcb96('0x39')](_0xcb96('0x3a'))){_0x98e802[_0xcb96('0x24')]=qs[_0xcb96('0x24')](_0x1cc435[_0xcb96('0x34')]['limit']);_0x98e802[_0xcb96('0x21')]=qs[_0xcb96('0x21')](_0x1cc435[_0xcb96('0x34')]['offset']);}_0x98e802[_0xcb96('0x3b')]=qs[_0xcb96('0x3c')](_0x1cc435[_0xcb96('0x34')][_0xcb96('0x3c')]);_0x98e802[_0xcb96('0x3d')]=qs['filters'](_['pick'](_0x1cc435[_0xcb96('0x34')],_0x3e9273[_0xcb96('0x3e')]),_0x39ff7f);if(_0x1cc435[_0xcb96('0x34')][_0xcb96('0x3f')]){_0x98e802[_0xcb96('0x3d')]=_['merge'](_0x98e802['where'],{'$or':_[_0xcb96('0x2e')](_0x39ff7f,function(_0x5e3907){if(_0x5e3907[_0xcb96('0x32')]!=='VIRTUAL'){var _0x3d30ef={};_0x3d30ef[_0x5e3907['name']]={'$like':'%'+_0x1cc435[_0xcb96('0x34')][_0xcb96('0x3f')]+'%'};return _0x3d30ef;}})});}_0x98e802=_[_0xcb96('0x40')]({},_0x98e802,_0x1cc435[_0xcb96('0x41')]);var _0x2b228d={'where':_0x98e802[_0xcb96('0x3d')]};return db[_0xcb96('0x2f')]['count'](_0x2b228d)[_0xcb96('0x27')](function(_0x4c8b9a){_0x1c36e6[_0xcb96('0x23')]=_0x4c8b9a;if(_0x1cc435[_0xcb96('0x34')][_0xcb96('0x42')]){_0x98e802['include']=[{'all':!![]}];}return db[_0xcb96('0x2f')][_0xcb96('0x43')](_0x98e802);})['then'](function(_0x8b5f4b){_0x1c36e6['rows']=_0x8b5f4b;return _0x1c36e6;})[_0xcb96('0x27')](respondWithFilteredResult(_0x1cb33a,_0x98e802))[_0xcb96('0x44')](handleError(_0x1cb33a,null));};exports[_0xcb96('0x45')]=function(_0xc02a8c,_0xd8ec00){var _0x578009={'raw':![],'where':{'id':_0xc02a8c[_0xcb96('0x46')]['id']}},_0x1be0e3={};_0x1be0e3[_0xcb96('0x33')]=_['keys'](db[_0xcb96('0x2f')][_0xcb96('0x30')]);_0x1be0e3['query']=_[_0xcb96('0x47')](_0xc02a8c[_0xcb96('0x34')]);_0x1be0e3[_0xcb96('0x3e')]=_[_0xcb96('0x36')](_0x1be0e3[_0xcb96('0x33')],_0x1be0e3[_0xcb96('0x34')]);_0x578009['attributes']=_['intersection'](_0x1be0e3[_0xcb96('0x33')],qs[_0xcb96('0x37')](_0xc02a8c[_0xcb96('0x34')]['fields']));_0x578009[_0xcb96('0x35')]=_0x578009[_0xcb96('0x35')][_0xcb96('0x38')]?_0x578009['attributes']:_0x1be0e3['model'];if(_0xc02a8c['query'][_0xcb96('0x42')]){_0x578009[_0xcb96('0x48')]=[{'all':!![]}];}_0x578009=_[_0xcb96('0x40')]({},_0x578009,_0xc02a8c[_0xcb96('0x41')]);return db[_0xcb96('0x2f')][_0xcb96('0x49')](_0x578009)['then'](handleEntityNotFound(_0xd8ec00,null))['then'](respondWithResult(_0xd8ec00,null))['catch'](handleError(_0xd8ec00,null));};exports[_0xcb96('0x4a')]=function(_0x2cfa2c,_0x3a55c6){return db[_0xcb96('0x2f')][_0xcb96('0x4a')](_0x2cfa2c[_0xcb96('0x4b')],{})[_0xcb96('0x27')](respondWithResult(_0x3a55c6,0xc9))[_0xcb96('0x44')](handleError(_0x3a55c6,null));};exports['update']=function(_0x1ba3d2,_0x16f4d2){if(_0x1ba3d2[_0xcb96('0x4b')]['id']){delete _0x1ba3d2[_0xcb96('0x4b')]['id'];}return db[_0xcb96('0x2f')][_0xcb96('0x49')]({'where':{'id':_0x1ba3d2['params']['id']}})[_0xcb96('0x27')](handleEntityNotFound(_0x16f4d2,null))[_0xcb96('0x27')](saveUpdates(_0x1ba3d2['body'],null))[_0xcb96('0x27')](respondWithResult(_0x16f4d2,null))[_0xcb96('0x44')](handleError(_0x16f4d2,null));};exports[_0xcb96('0x28')]=function(_0x4a19ac,_0x29d63b){return db['VoiceQueueReport'][_0xcb96('0x49')]({'where':{'id':_0x4a19ac['params']['id']}})['then'](handleEntityNotFound(_0x29d63b,null))['then'](removeEntity(_0x29d63b,null))['catch'](handleError(_0x29d63b,null));};exports[_0xcb96('0x4c')]=function(_0x1c5be8,_0x449fca){return db[_0xcb96('0x2f')][_0xcb96('0x4c')]()['then'](respondWithResult(_0x449fca,null))['catch'](handleError(_0x449fca,null));};exports[_0xcb96('0x4d')]=function(_0x1f9ec3,_0x565536){var _0x2304dd={},_0x590193={},_0x5148a1={'count':0x0,'rows':[]};_0x590193[_0xcb96('0x33')]=_[_0xcb96('0x47')](db[_0xcb96('0x2f')][_0xcb96('0x30')]);_0x590193[_0xcb96('0x34')]=_['keys'](_0x1f9ec3[_0xcb96('0x34')]);_0x590193[_0xcb96('0x3e')]=_[_0xcb96('0x36')](_0x590193['model'],_0x590193['query']);_0x2304dd[_0xcb96('0x35')]=_[_0xcb96('0x36')](_0x590193[_0xcb96('0x33')],qs[_0xcb96('0x37')](_0x1f9ec3[_0xcb96('0x34')]['fields']));_0x2304dd[_0xcb96('0x35')]=_0x2304dd[_0xcb96('0x35')][_0xcb96('0x38')]?_0x2304dd[_0xcb96('0x35')]:_0x590193[_0xcb96('0x33')];if(!_0x1f9ec3['query'][_0xcb96('0x39')](_0xcb96('0x3a'))){_0x2304dd[_0xcb96('0x24')]=qs['limit'](_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x24')]);_0x2304dd['offset']=qs['offset'](_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x21')]);}_0x2304dd['order']=qs[_0xcb96('0x3c')](_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x3c')]);_0x2304dd[_0xcb96('0x3d')]=qs[_0xcb96('0x3e')](_[_0xcb96('0x4e')](_0x1f9ec3[_0xcb96('0x34')],_0x590193[_0xcb96('0x3e')]));if(_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x3f')]){_0x2304dd[_0xcb96('0x3d')]=_[_0xcb96('0x40')](_0x2304dd['where'],{'$or':_['map'](_0x2304dd[_0xcb96('0x35')],function(_0x1e7693){var _0x58a0f0={};_0x58a0f0[_0x1e7693]={'$like':'%'+_0x1f9ec3[_0xcb96('0x34')]['filter']+'%'};return _0x58a0f0;})});}_0x2304dd=_[_0xcb96('0x40')]({},_0x2304dd,_0x1f9ec3[_0xcb96('0x41')]);var _0x33ba94={'where':_0x2304dd[_0xcb96('0x3d')]};return db[_0xcb96('0x2f')][_0xcb96('0x23')](_0x33ba94)[_0xcb96('0x27')](function(_0x2ee124){_0x5148a1['count']=_0x2ee124;if(_0x1f9ec3[_0xcb96('0x34')][_0xcb96('0x42')]){_0x2304dd['include']=[{'all':!![]}];}return db[_0xcb96('0x2f')][_0xcb96('0x43')](_0x2304dd);})[_0xcb96('0x27')](function(_0x409046){_0x5148a1[_0xcb96('0x4f')]=_0x409046;return _0x5148a1;})[_0xcb96('0x27')](respondWithFilteredResult(_0x565536,_0x2304dd,_0xcb96('0x4d')))[_0xcb96('0x44')](handleError(_0x565536,null,_0xcb96('0x4d')));};
\ No newline at end of file
+var _0xc862=['sort','where','pick','filter','VIRTUAL','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x2fe15c,_0x48713a){var _0x26ec58=function(_0x3e475a){while(--_0x3e475a){_0x2fe15c['push'](_0x2fe15c['shift']());}};_0x26ec58(++_0x48713a);}(_0xc862,0xb6));var _0x2c86=function(_0x18bb4d,_0x5a5d17){_0x18bb4d=_0x18bb4d-0x0;var _0xd1fa04=_0xc862[_0x18bb4d];return _0xd1fa04;};'use strict';var emlformat=require(_0x2c86('0x0'));var rimraf=require(_0x2c86('0x1'));var zipdir=require(_0x2c86('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2c86('0x3'));var Mustache=require(_0x2c86('0x4'));var util=require(_0x2c86('0x5'));var path=require(_0x2c86('0x6'));var sox=require(_0x2c86('0x7'));var csv=require(_0x2c86('0x8'));var ejs=require(_0x2c86('0x9'));var fs=require('fs');var fs_extra=require(_0x2c86('0xa'));var _=require(_0x2c86('0xb'));var squel=require(_0x2c86('0xc'));var crypto=require('crypto');var jsforce=require(_0x2c86('0xd'));var deskjs=require(_0x2c86('0xe'));var toCsv=require(_0x2c86('0x8'));var querystring=require('querystring');var Papa=require(_0x2c86('0xf'));var Redis=require(_0x2c86('0x10'));var authService=require(_0x2c86('0x11'));var qs=require(_0x2c86('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c86('0x13'));var logger=require(_0x2c86('0x14'))('api');var utils=require(_0x2c86('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2c86('0x16'));var db=require(_0x2c86('0x17'))['db'];config[_0x2c86('0x18')]=_['defaults'](config[_0x2c86('0x18')],{'host':_0x2c86('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c86('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x524e3d,_0x29add5){_0x29add5=_0x29add5||0xcc;return function(_0x111fec){if(_0x111fec){return _0x524e3d[_0x2c86('0x1a')](_0x29add5);}return _0x524e3d[_0x2c86('0x1b')](_0x29add5)[_0x2c86('0x1c')]();};}function respondWithResult(_0x763e95,_0x316bc9){_0x316bc9=_0x316bc9||0xc8;return function(_0x5d4b4b){if(_0x5d4b4b){return _0x763e95[_0x2c86('0x1b')](_0x316bc9)[_0x2c86('0x1d')](_0x5d4b4b);}};}function respondWithFilteredResult(_0x26723c,_0x43aee4){return function(_0xe63e1c){if(_0xe63e1c){var _0x1b7dd7=typeof _0x43aee4[_0x2c86('0x1e')]==='undefined'&&typeof _0x43aee4[_0x2c86('0x1f')]===_0x2c86('0x20');var _0x21144e=_0xe63e1c[_0x2c86('0x21')];var _0x51e9d8=_0x1b7dd7?0x0:_0x43aee4[_0x2c86('0x1e')];var _0x30e4dd=_0x1b7dd7?_0xe63e1c['count']:_0x43aee4[_0x2c86('0x1e')]+_0x43aee4['limit'];var _0x4ae9e4;if(_0x30e4dd>=_0x21144e){_0x30e4dd=_0x21144e;_0x4ae9e4=0xc8;}else{_0x4ae9e4=0xce;}_0x26723c[_0x2c86('0x1b')](_0x4ae9e4);return _0x26723c[_0x2c86('0x22')](_0x2c86('0x23'),_0x51e9d8+'-'+_0x30e4dd+'/'+_0x21144e)[_0x2c86('0x1d')](_0xe63e1c);}return null;};}function patchUpdates(_0x74bfdc){return function(_0x9c04f3){try{jsonpatch[_0x2c86('0x24')](_0x9c04f3,_0x74bfdc,!![]);}catch(_0x55aa38){return BPromise[_0x2c86('0x25')](_0x55aa38);}return _0x9c04f3[_0x2c86('0x26')]();};}function saveUpdates(_0x1adc46,_0x2c33d5){return function(_0xdb547f){if(_0xdb547f){return _0xdb547f[_0x2c86('0x27')](_0x1adc46)[_0x2c86('0x28')](function(_0x3965ef){return _0x3965ef;});}return null;};}function removeEntity(_0x536473,_0x4f04e0){return function(_0x1952cb){if(_0x1952cb){return _0x1952cb[_0x2c86('0x29')]()[_0x2c86('0x28')](function(){_0x536473['status'](0xcc)[_0x2c86('0x1c')]();});}};}function handleEntityNotFound(_0x56a83b,_0x427029){return function(_0x36b0e6){if(!_0x36b0e6){_0x56a83b[_0x2c86('0x1a')](0x194);}return _0x36b0e6;};}function handleError(_0x217c14,_0x32a908){_0x32a908=_0x32a908||0x1f4;return function(_0x507075){logger[_0x2c86('0x2a')](_0x507075[_0x2c86('0x2b')]);if(_0x507075[_0x2c86('0x2c')]){delete _0x507075[_0x2c86('0x2c')];}_0x217c14[_0x2c86('0x1b')](_0x32a908)[_0x2c86('0x2d')](_0x507075);};}exports['index']=function(_0x290bc1,_0xe058b2){var _0x3c9d17={},_0x104334={},_0x73a511={'count':0x0,'rows':[]};var _0x169f7c=_[_0x2c86('0x2e')](db['VoiceQueueReport'][_0x2c86('0x2f')],function(_0x4238ea){return{'name':_0x4238ea['fieldName'],'type':_0x4238ea[_0x2c86('0x30')][_0x2c86('0x31')]};});_0x104334[_0x2c86('0x32')]=_[_0x2c86('0x2e')](_0x169f7c,'name');_0x104334[_0x2c86('0x33')]=_[_0x2c86('0x34')](_0x290bc1['query']);_0x104334[_0x2c86('0x35')]=_[_0x2c86('0x36')](_0x104334[_0x2c86('0x32')],_0x104334[_0x2c86('0x33')]);_0x3c9d17[_0x2c86('0x37')]=_['intersection'](_0x104334[_0x2c86('0x32')],qs[_0x2c86('0x38')](_0x290bc1[_0x2c86('0x33')][_0x2c86('0x38')]));_0x3c9d17[_0x2c86('0x37')]=_0x3c9d17[_0x2c86('0x37')][_0x2c86('0x39')]?_0x3c9d17['attributes']:_0x104334[_0x2c86('0x32')];if(!_0x290bc1[_0x2c86('0x33')][_0x2c86('0x3a')](_0x2c86('0x3b'))){_0x3c9d17['limit']=qs[_0x2c86('0x1f')](_0x290bc1[_0x2c86('0x33')][_0x2c86('0x1f')]);_0x3c9d17['offset']=qs['offset'](_0x290bc1['query']['offset']);}_0x3c9d17[_0x2c86('0x3c')]=qs[_0x2c86('0x3d')](_0x290bc1[_0x2c86('0x33')][_0x2c86('0x3d')]);_0x3c9d17[_0x2c86('0x3e')]=qs[_0x2c86('0x35')](_[_0x2c86('0x3f')](_0x290bc1['query'],_0x104334['filters']),_0x169f7c);if(_0x290bc1[_0x2c86('0x33')][_0x2c86('0x40')]){_0x3c9d17[_0x2c86('0x3e')]=_['merge'](_0x3c9d17[_0x2c86('0x3e')],{'$or':_['map'](_0x169f7c,function(_0x2f4bbc){if(_0x2f4bbc[_0x2c86('0x30')]!==_0x2c86('0x41')){var _0x57f424={};_0x57f424[_0x2f4bbc[_0x2c86('0x2c')]]={'$like':'%'+_0x290bc1[_0x2c86('0x33')][_0x2c86('0x40')]+'%'};return _0x57f424;}})});}_0x3c9d17=_['merge']({},_0x3c9d17,_0x290bc1[_0x2c86('0x42')]);var _0x6d5297={'where':_0x3c9d17[_0x2c86('0x3e')]};return db[_0x2c86('0x43')][_0x2c86('0x21')](_0x6d5297)[_0x2c86('0x28')](function(_0x1585e3){_0x73a511['count']=_0x1585e3;if(_0x290bc1[_0x2c86('0x33')][_0x2c86('0x44')]){_0x3c9d17[_0x2c86('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2c86('0x46')](_0x3c9d17);})[_0x2c86('0x28')](function(_0x3b530f){_0x73a511[_0x2c86('0x47')]=_0x3b530f;return _0x73a511;})['then'](respondWithFilteredResult(_0xe058b2,_0x3c9d17))[_0x2c86('0x48')](handleError(_0xe058b2,null));};exports[_0x2c86('0x49')]=function(_0x20f34a,_0x186a03){var _0x321439={'raw':![],'where':{'id':_0x20f34a[_0x2c86('0x4a')]['id']}},_0x10a5cf={};_0x10a5cf[_0x2c86('0x32')]=_['keys'](db[_0x2c86('0x43')][_0x2c86('0x2f')]);_0x10a5cf[_0x2c86('0x33')]=_['keys'](_0x20f34a['query']);_0x10a5cf[_0x2c86('0x35')]=_[_0x2c86('0x36')](_0x10a5cf[_0x2c86('0x32')],_0x10a5cf[_0x2c86('0x33')]);_0x321439[_0x2c86('0x37')]=_[_0x2c86('0x36')](_0x10a5cf[_0x2c86('0x32')],qs[_0x2c86('0x38')](_0x20f34a[_0x2c86('0x33')][_0x2c86('0x38')]));_0x321439[_0x2c86('0x37')]=_0x321439[_0x2c86('0x37')][_0x2c86('0x39')]?_0x321439[_0x2c86('0x37')]:_0x10a5cf['model'];if(_0x20f34a[_0x2c86('0x33')][_0x2c86('0x44')]){_0x321439[_0x2c86('0x45')]=[{'all':!![]}];}_0x321439=_[_0x2c86('0x4b')]({},_0x321439,_0x20f34a[_0x2c86('0x42')]);return db[_0x2c86('0x43')][_0x2c86('0x4c')](_0x321439)[_0x2c86('0x28')](handleEntityNotFound(_0x186a03,null))[_0x2c86('0x28')](respondWithResult(_0x186a03,null))['catch'](handleError(_0x186a03,null));};exports['create']=function(_0x103ed0,_0x7e14cb){return db[_0x2c86('0x43')][_0x2c86('0x4d')](_0x103ed0[_0x2c86('0x4e')],{})[_0x2c86('0x28')](respondWithResult(_0x7e14cb,0xc9))[_0x2c86('0x48')](handleError(_0x7e14cb,null));};exports[_0x2c86('0x27')]=function(_0x29de84,_0x2fa44f){if(_0x29de84[_0x2c86('0x4e')]['id']){delete _0x29de84[_0x2c86('0x4e')]['id'];}return db[_0x2c86('0x43')]['find']({'where':{'id':_0x29de84['params']['id']}})[_0x2c86('0x28')](handleEntityNotFound(_0x2fa44f,null))[_0x2c86('0x28')](saveUpdates(_0x29de84[_0x2c86('0x4e')],null))[_0x2c86('0x28')](respondWithResult(_0x2fa44f,null))[_0x2c86('0x48')](handleError(_0x2fa44f,null));};exports[_0x2c86('0x29')]=function(_0x1eeb0e,_0x397e85){return db[_0x2c86('0x43')][_0x2c86('0x4c')]({'where':{'id':_0x1eeb0e['params']['id']}})[_0x2c86('0x28')](handleEntityNotFound(_0x397e85,null))['then'](removeEntity(_0x397e85,null))[_0x2c86('0x48')](handleError(_0x397e85,null));};exports[_0x2c86('0x4f')]=function(_0x1e73c8,_0x2dded3){return db['VoiceQueueReport'][_0x2c86('0x4f')]()[_0x2c86('0x28')](respondWithResult(_0x2dded3,null))[_0x2c86('0x48')](handleError(_0x2dded3,null));};exports[_0x2c86('0x50')]=function(_0x55effd,_0x39c6f6){var _0x535808={},_0x216c5f={},_0x49d984={'count':0x0,'rows':[]};_0x216c5f[_0x2c86('0x32')]=_['keys'](db[_0x2c86('0x43')]['rawAttributes']);_0x216c5f['query']=_[_0x2c86('0x34')](_0x55effd[_0x2c86('0x33')]);_0x216c5f[_0x2c86('0x35')]=_[_0x2c86('0x36')](_0x216c5f[_0x2c86('0x32')],_0x216c5f[_0x2c86('0x33')]);_0x535808[_0x2c86('0x37')]=_['intersection'](_0x216c5f['model'],qs['fields'](_0x55effd[_0x2c86('0x33')]['fields']));_0x535808['attributes']=_0x535808['attributes']['length']?_0x535808['attributes']:_0x216c5f[_0x2c86('0x32')];if(!_0x55effd[_0x2c86('0x33')]['hasOwnProperty'](_0x2c86('0x3b'))){_0x535808['limit']=qs[_0x2c86('0x1f')](_0x55effd['query'][_0x2c86('0x1f')]);_0x535808[_0x2c86('0x1e')]=qs['offset'](_0x55effd[_0x2c86('0x33')][_0x2c86('0x1e')]);}_0x535808[_0x2c86('0x3c')]=qs[_0x2c86('0x3d')](_0x55effd[_0x2c86('0x33')][_0x2c86('0x3d')]);_0x535808[_0x2c86('0x3e')]=qs[_0x2c86('0x35')](_[_0x2c86('0x3f')](_0x55effd['query'],_0x216c5f[_0x2c86('0x35')]));if(_0x55effd[_0x2c86('0x33')][_0x2c86('0x40')]){_0x535808[_0x2c86('0x3e')]=_[_0x2c86('0x4b')](_0x535808['where'],{'$or':_[_0x2c86('0x2e')](_0x535808[_0x2c86('0x37')],function(_0x268e5c){var _0x31ba4a={};_0x31ba4a[_0x268e5c]={'$like':'%'+_0x55effd['query'][_0x2c86('0x40')]+'%'};return _0x31ba4a;})});}_0x535808=_[_0x2c86('0x4b')]({},_0x535808,_0x55effd['options']);var _0x314edb={'where':_0x535808['where']};return db[_0x2c86('0x43')][_0x2c86('0x21')](_0x314edb)[_0x2c86('0x28')](function(_0x50424a){_0x49d984[_0x2c86('0x21')]=_0x50424a;if(_0x55effd[_0x2c86('0x33')]['includeAll']){_0x535808[_0x2c86('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2c86('0x46')](_0x535808);})[_0x2c86('0x28')](function(_0x37f2f0){_0x49d984[_0x2c86('0x47')]=_0x37f2f0;return _0x49d984;})['then'](respondWithFilteredResult(_0x39c6f6,_0x535808,_0x2c86('0x50')))[_0x2c86('0x48')](handleError(_0x39c6f6,null,_0x2c86('0x50')));};
\ No newline at end of file
index bc1c9f1..64fa7e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff6e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','VoiceQueueReport'];(function(_0x14fa0b,_0x254650){var _0x2593b3=function(_0x4866e3){while(--_0x4866e3){_0x14fa0b['push'](_0x14fa0b['shift']());}};_0x2593b3(++_0x254650);}(_0xff6e,0xde));var _0xeff6=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xff6e[_0x58dc25];return _0x21b0a7;};'use strict';var EventEmitter=require(_0xeff6('0x0'));var VoiceQueueReport=require(_0xeff6('0x1'))['db'][_0xeff6('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xeff6('0x3')](0x0);var events={'afterCreate':_0xeff6('0x4'),'afterUpdate':_0xeff6('0x5'),'afterDestroy':_0xeff6('0x6')};function emitEvent(_0x332969){return function(_0x4b26d8,_0x3fcd96,_0x5950eb){VoiceQueueReportEvents[_0xeff6('0x7')](_0x332969+':'+_0x4b26d8['id'],_0x4b26d8);VoiceQueueReportEvents[_0xeff6('0x7')](_0x332969,_0x4b26d8);_0x5950eb(null);};}for(var e in events){if(events[_0xeff6('0x8')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xbd8e=['update','remove','emit','../../mysqldb','VoiceQueueReport','save'];(function(_0x2f3209,_0x3e8421){var _0x4564eb=function(_0xe0e2b){while(--_0xe0e2b){_0x2f3209['push'](_0x2f3209['shift']());}};_0x4564eb(++_0x3e8421);}(_0xbd8e,0x13b));var _0xebd8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbd8e[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xebd8('0x0'))['db'][_0xebd8('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xebd8('0x2'),'afterUpdate':_0xebd8('0x3'),'afterDestroy':_0xebd8('0x4')};function emitEvent(_0x4f7d31){return function(_0x20807b,_0x77c304,_0x1ede10){VoiceQueueReportEvents[_0xebd8('0x5')](_0x4f7d31+':'+_0x20807b['id'],_0x20807b);VoiceQueueReportEvents[_0xebd8('0x5')](_0x4f7d31,_0x20807b);_0x1ede10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 645a5e0..f043055 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ee4=['api','bluebird','request-promise','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x2096cf,_0x2ce113){var _0x21eb97=function(_0xb69193){while(--_0xb69193){_0x2096cf['push'](_0x2096cf['shift']());}};_0x21eb97(++_0x2ce113);}(_0x9ee4,0x17d));var _0x49ee=function(_0x1f9fee,_0x3f9486){_0x1f9fee=_0x1f9fee-0x0;var _0x237393=_0x9ee4[_0x1f9fee];return _0x237393;};'use strict';var _=require(_0x49ee('0x0'));var util=require(_0x49ee('0x1'));var logger=require(_0x49ee('0x2'))(_0x49ee('0x3'));var moment=require('moment');var BPromise=require(_0x49ee('0x4'));var rp=require(_0x49ee('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49ee('0x6'));module['exports']=function(_0x304653,_0x5bc347){return _0x304653[_0x49ee('0x7')](_0x49ee('0x8'),attributes,{'tableName':_0x49ee('0x9'),'paranoid':![],'indexes':[{'fields':[_0x49ee('0xa')]},{'fields':[_0x49ee('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fb3=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5fb3,0x138));var _0x35fb=function(_0x5e9da3,_0x86e482){_0x5e9da3=_0x5e9da3-0x0;var _0x567a27=_0x5fb3[_0x5e9da3];return _0x567a27;};'use strict';var _=require(_0x35fb('0x0'));var util=require(_0x35fb('0x1'));var logger=require(_0x35fb('0x2'))(_0x35fb('0x3'));var moment=require(_0x35fb('0x4'));var BPromise=require(_0x35fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35fb('0x6'));var rimraf=require(_0x35fb('0x7'));var config=require(_0x35fb('0x8'));var attributes=require(_0x35fb('0x9'));module['exports']=function(_0x436fd4,_0x5c660e){return _0x436fd4[_0x35fb('0xa')](_0x35fb('0xb'),attributes,{'tableName':_0x35fb('0xc'),'paranoid':![],'indexes':[{'fields':[_0x35fb('0xd')]},{'fields':[_0x35fb('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 723c17f..8da7325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896c=['result','message','catch','VoiceQueueReport','findAll','options','raw','where','attributes','limit','map','include','model','debug','GetVoiceQueueReport','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x10cbda,_0x331fd9){var _0x10e5d8=function(_0x468805){while(--_0x468805){_0x10cbda['push'](_0x10cbda['shift']());}};_0x10e5d8(++_0x331fd9);}(_0x896c,0x10f));var _0xc896=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x896c[_0x335271];return _0xa9fff8;};'use strict';var _=require(_0xc896('0x0'));var util=require(_0xc896('0x1'));var moment=require('moment');var BPromise=require(_0xc896('0x2'));var rs=require(_0xc896('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc896('0x4'))['db'];var utils=require(_0xc896('0x5'));var logger=require('../../config/logger')(_0xc896('0x6'));var config=require(_0xc896('0x7'));var jayson=require(_0xc896('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xc896('0x9')]=_[_0xc896('0xa')](config[_0xc896('0x9')],{'host':_0xc896('0xb'),'port':0x18eb});var socket=require(_0xc896('0xc'))(new Redis(config[_0xc896('0x9')]));require(_0xc896('0xd'))[_0xc896('0xe')](socket);function respondWithRpcPromise(_0x102d77,_0x587689,_0x2c084b){return new BPromise(function(_0x67dff9,_0x5cff07){return client[_0xc896('0xf')](_0x102d77,_0x2c084b)[_0xc896('0x10')](function(_0x593c0e){logger[_0xc896('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x587689,_0xc896('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x587689,_0xc896('0x12'),JSON[_0xc896('0x13')](_0x593c0e));if(_0x593c0e[_0xc896('0x14')]){if(_0x593c0e[_0xc896('0x14')][_0xc896('0x15')]===0x1f4){logger[_0xc896('0x14')](_0xc896('0x16'),_0x587689,_0x593c0e[_0xc896('0x14')]['message']);return _0x5cff07(_0x593c0e[_0xc896('0x14')]['message']);}logger[_0xc896('0x14')](_0xc896('0x16'),_0x587689,_0x593c0e[_0xc896('0x14')]['message']);return _0x67dff9(_0x593c0e[_0xc896('0x14')]['message']);}else{logger[_0xc896('0x11')](_0xc896('0x16'),_0x587689,_0xc896('0x12'));_0x67dff9(_0x593c0e[_0xc896('0x17')][_0xc896('0x18')]);}})[_0xc896('0x19')](function(_0x898c20){logger['error'](_0xc896('0x16'),_0x587689,_0x898c20);_0x5cff07(_0x898c20);});});}exports['GetVoiceQueueReport']=function(_0x21a90d){var _0x23924f=this;return new Promise(function(_0x3e405a,_0x3ec867){return db[_0xc896('0x1a')][_0xc896('0x1b')]({'raw':_0x21a90d[_0xc896('0x1c')]?_0x21a90d[_0xc896('0x1c')][_0xc896('0x1d')]===undefined?!![]:![]:!![],'where':_0x21a90d[_0xc896('0x1c')]?_0x21a90d[_0xc896('0x1c')][_0xc896('0x1e')]||null:null,'attributes':_0x21a90d[_0xc896('0x1c')]?_0x21a90d['options'][_0xc896('0x1f')]||null:null,'limit':_0x21a90d['options']?_0x21a90d[_0xc896('0x1c')][_0xc896('0x20')]||null:null,'include':_0x21a90d[_0xc896('0x1c')]?_0x21a90d['options']['include']?_[_0xc896('0x21')](_0x21a90d[_0xc896('0x1c')][_0xc896('0x22')],function(_0x186f33){return{'model':db[_0x186f33[_0xc896('0x23')]],'as':_0x186f33['as'],'attributes':_0x186f33[_0xc896('0x1f')],'include':_0x186f33[_0xc896('0x22')]?_[_0xc896('0x21')](_0x186f33[_0xc896('0x22')],function(_0x4bdf77){return{'model':db[_0x4bdf77[_0xc896('0x23')]],'as':_0x4bdf77['as'],'attributes':_0x4bdf77[_0xc896('0x1f')],'include':_0x4bdf77[_0xc896('0x22')]?_['map'](_0x4bdf77['include'],function(_0x39f902){return{'model':db[_0x39f902[_0xc896('0x23')]],'as':_0x39f902['as'],'attributes':_0x39f902[_0xc896('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc896('0x10')](function(_0x4b22e4){logger[_0xc896('0x11')]('GetVoiceQueueReport',_0x21a90d);logger[_0xc896('0x24')]('GetVoiceQueueReport',_0x21a90d,JSON[_0xc896('0x13')](_0x4b22e4));_0x3e405a(_0x4b22e4);})[_0xc896('0x19')](function(_0x4352ed){logger[_0xc896('0x14')](_0xc896('0x25'),_0x4352ed['message'],_0x21a90d);_0x3ec867(_0x23924f['error'](0x1f4,_0x4352ed['message']));});});};exports[_0xc896('0x26')]=function(_0x586ccf){var _0x1b5859=this;return new Promise(function(_0x1e5038,_0x1acc3d){return db[_0xc896('0x1a')][_0xc896('0x27')](_0x586ccf['body'],{'raw':_0x586ccf[_0xc896('0x1c')]?_0x586ccf[_0xc896('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21a653){logger[_0xc896('0x11')](_0xc896('0x26'),_0x586ccf);logger[_0xc896('0x24')]('CreateVoiceQueueReport',_0x586ccf,JSON[_0xc896('0x13')](_0x21a653));_0x1e5038(_0x21a653);})['catch'](function(_0xc3cc){logger[_0xc896('0x14')]('CreateVoiceQueueReport',_0xc3cc[_0xc896('0x18')],_0x586ccf);_0x1acc3d(_0x1b5859['error'](0x1f4,_0xc3cc[_0xc896('0x18')]));});});};exports[_0xc896('0x28')]=function(_0x14d560){var _0x1e8d82=this;return new Promise(function(_0x3c0c01,_0x4b95f3){return db[_0xc896('0x1a')][_0xc896('0x29')](_0x14d560['body'],{'raw':_0x14d560['options']?_0x14d560[_0xc896('0x1c')][_0xc896('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d560[_0xc896('0x1c')]?_0x14d560['options'][_0xc896('0x1e')]||null:null,'attributes':_0x14d560[_0xc896('0x1c')]?_0x14d560['options'][_0xc896('0x1f')]||null:null,'limit':_0x14d560[_0xc896('0x1c')]?_0x14d560[_0xc896('0x1c')][_0xc896('0x20')]||null:null})[_0xc896('0x10')](function(_0x1fe099){logger['info'](_0xc896('0x28'),_0x14d560);logger[_0xc896('0x24')](_0xc896('0x28'),_0x14d560,JSON[_0xc896('0x13')](_0x1fe099));_0x3c0c01(_0x1fe099);})[_0xc896('0x19')](function(_0x36f043){logger['error'](_0xc896('0x28'),_0x36f043[_0xc896('0x18')],_0x14d560);_0x4b95f3(_0x1e8d82[_0xc896('0x14')](0x1f4,_0x36f043['message']));});});};
\ No newline at end of file
+var _0x4c5a=['client','redis','defaults','localhost','./voiceQueueReport.socket','register','then','info','request\x20sent','debug','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','map','include','model','attributes','catch','CreateVoiceQueueReport','create','body','limit','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1a8bbc,_0x17a086){var _0x212fc2=function(_0x55c718){while(--_0x55c718){_0x1a8bbc['push'](_0x1a8bbc['shift']());}};_0x212fc2(++_0x17a086);}(_0x4c5a,0x13e));var _0xa4c5=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x4c5a[_0x4fdc46];return _0x2c178a;};'use strict';var _=require(_0xa4c5('0x0'));var util=require(_0xa4c5('0x1'));var moment=require(_0xa4c5('0x2'));var BPromise=require(_0xa4c5('0x3'));var rs=require(_0xa4c5('0x4'));var fs=require('fs');var Redis=require(_0xa4c5('0x5'));var db=require(_0xa4c5('0x6'))['db'];var utils=require(_0xa4c5('0x7'));var logger=require('../../config/logger')(_0xa4c5('0x8'));var config=require(_0xa4c5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa4c5('0xa')]['http']({'port':0x232a});config[_0xa4c5('0xb')]=_[_0xa4c5('0xc')](config[_0xa4c5('0xb')],{'host':_0xa4c5('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4c5('0xb')]));require(_0xa4c5('0xe'))[_0xa4c5('0xf')](socket);function respondWithRpcPromise(_0x9812b1,_0x2d68d2,_0x1f17e6){return new BPromise(function(_0x41ef46,_0x55091d){return client['request'](_0x9812b1,_0x1f17e6)[_0xa4c5('0x10')](function(_0x54b76d){logger[_0xa4c5('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x2d68d2,_0xa4c5('0x12'));logger[_0xa4c5('0x13')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x2d68d2,'request\x20sent',JSON[_0xa4c5('0x14')](_0x54b76d));if(_0x54b76d[_0xa4c5('0x15')]){if(_0x54b76d[_0xa4c5('0x15')][_0xa4c5('0x16')]===0x1f4){logger[_0xa4c5('0x15')](_0xa4c5('0x17'),_0x2d68d2,_0x54b76d[_0xa4c5('0x15')]['message']);return _0x55091d(_0x54b76d[_0xa4c5('0x15')][_0xa4c5('0x18')]);}logger[_0xa4c5('0x15')](_0xa4c5('0x17'),_0x2d68d2,_0x54b76d['error'][_0xa4c5('0x18')]);return _0x41ef46(_0x54b76d[_0xa4c5('0x15')]['message']);}else{logger[_0xa4c5('0x11')](_0xa4c5('0x17'),_0x2d68d2,'request\x20sent');_0x41ef46(_0x54b76d[_0xa4c5('0x19')]['message']);}})['catch'](function(_0xceb18){logger[_0xa4c5('0x15')](_0xa4c5('0x17'),_0x2d68d2,_0xceb18);_0x55091d(_0xceb18);});});}exports[_0xa4c5('0x1a')]=function(_0x1bb4ec){var _0x331640=this;return new Promise(function(_0x81d265,_0x512912){return db[_0xa4c5('0x1b')][_0xa4c5('0x1c')]({'raw':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec[_0xa4c5('0x1d')][_0xa4c5('0x1e')]===undefined?!![]:![]:!![],'where':_0x1bb4ec['options']?_0x1bb4ec[_0xa4c5('0x1d')]['where']||null:null,'attributes':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec[_0xa4c5('0x1d')]['attributes']||null:null,'limit':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec[_0xa4c5('0x1d')]['limit']||null:null,'include':_0x1bb4ec[_0xa4c5('0x1d')]?_0x1bb4ec['options']['include']?_[_0xa4c5('0x1f')](_0x1bb4ec[_0xa4c5('0x1d')][_0xa4c5('0x20')],function(_0x3fbefb){return{'model':db[_0x3fbefb[_0xa4c5('0x21')]],'as':_0x3fbefb['as'],'attributes':_0x3fbefb[_0xa4c5('0x22')],'include':_0x3fbefb['include']?_[_0xa4c5('0x1f')](_0x3fbefb[_0xa4c5('0x20')],function(_0x3ff7f1){return{'model':db[_0x3ff7f1[_0xa4c5('0x21')]],'as':_0x3ff7f1['as'],'attributes':_0x3ff7f1[_0xa4c5('0x22')],'include':_0x3ff7f1[_0xa4c5('0x20')]?_['map'](_0x3ff7f1[_0xa4c5('0x20')],function(_0x71430b){return{'model':db[_0x71430b[_0xa4c5('0x21')]],'as':_0x71430b['as'],'attributes':_0x71430b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa4c5('0x10')](function(_0x43c40f){logger['info']('GetVoiceQueueReport',_0x1bb4ec);logger[_0xa4c5('0x13')](_0xa4c5('0x1a'),_0x1bb4ec,JSON[_0xa4c5('0x14')](_0x43c40f));_0x81d265(_0x43c40f);})[_0xa4c5('0x23')](function(_0x329e20){logger[_0xa4c5('0x15')](_0xa4c5('0x1a'),_0x329e20['message'],_0x1bb4ec);_0x512912(_0x331640['error'](0x1f4,_0x329e20[_0xa4c5('0x18')]));});});};exports[_0xa4c5('0x24')]=function(_0x2299fa){var _0x15fa87=this;return new Promise(function(_0x21e100,_0x40c54b){return db[_0xa4c5('0x1b')][_0xa4c5('0x25')](_0x2299fa[_0xa4c5('0x26')],{'raw':_0x2299fa['options']?_0x2299fa[_0xa4c5('0x1d')][_0xa4c5('0x1e')]===undefined?!![]:![]:!![]})[_0xa4c5('0x10')](function(_0x24b73c){logger[_0xa4c5('0x11')](_0xa4c5('0x24'),_0x2299fa);logger['debug'](_0xa4c5('0x24'),_0x2299fa,JSON['stringify'](_0x24b73c));_0x21e100(_0x24b73c);})['catch'](function(_0x5c4032){logger['error'](_0xa4c5('0x24'),_0x5c4032['message'],_0x2299fa);_0x40c54b(_0x15fa87['error'](0x1f4,_0x5c4032['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x5addda){var _0x81e0d7=this;return new Promise(function(_0x49f2d1,_0x2d0834){return db[_0xa4c5('0x1b')]['update'](_0x5addda[_0xa4c5('0x26')],{'raw':_0x5addda[_0xa4c5('0x1d')]?_0x5addda[_0xa4c5('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5addda[_0xa4c5('0x1d')]?_0x5addda['options']['where']||null:null,'attributes':_0x5addda[_0xa4c5('0x1d')]?_0x5addda[_0xa4c5('0x1d')][_0xa4c5('0x22')]||null:null,'limit':_0x5addda[_0xa4c5('0x1d')]?_0x5addda[_0xa4c5('0x1d')][_0xa4c5('0x27')]||null:null})['then'](function(_0x3c2387){logger[_0xa4c5('0x11')](_0xa4c5('0x28'),_0x5addda);logger[_0xa4c5('0x13')](_0xa4c5('0x28'),_0x5addda,JSON[_0xa4c5('0x14')](_0x3c2387));_0x49f2d1(_0x3c2387);})[_0xa4c5('0x23')](function(_0x2f86e9){logger[_0xa4c5('0x15')]('UpdateVoiceQueueReport',_0x2f86e9['message'],_0x5addda);_0x2d0834(_0x81e0d7['error'](0x1f4,_0x2f86e9[_0xa4c5('0x18')]));});});};
\ No newline at end of file
index c76172b..217d99c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ab2=['length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener','register'];(function(_0x42f37d,_0x2d8aeb){var _0x5383a1=function(_0x1e0fe7){while(--_0x1e0fe7){_0x42f37d['push'](_0x42f37d['shift']());}};_0x5383a1(++_0x2d8aeb);}(_0x0ab2,0x9a));var _0x20ab=function(_0x3401ce,_0x5d1579){_0x3401ce=_0x3401ce-0x0;var _0x1bb79d=_0x0ab2[_0x3401ce];return _0x1bb79d;};'use strict';var VoiceQueueReportEvents=require(_0x20ab('0x0'));var events=[_0x20ab('0x1'),_0x20ab('0x2'),_0x20ab('0x3')];function createListener(_0x217637,_0x1520c9){return function(_0x4cc8cc){_0x1520c9['emit'](_0x217637,_0x4cc8cc);};}function removeListener(_0x435fc9,_0x2c4d43){return function(){VoiceQueueReportEvents[_0x20ab('0x4')](_0x435fc9,_0x2c4d43);};}exports[_0x20ab('0x5')]=function(_0x35fdb5){for(var _0x362d27=0x0,_0x16d3fc=events[_0x20ab('0x6')];_0x362d27<_0x16d3fc;_0x362d27++){var _0x458cd9=events[_0x362d27];var _0x547349=createListener(_0x20ab('0x7')+_0x458cd9,_0x35fdb5);VoiceQueueReportEvents['on'](_0x458cd9,_0x547349);}};
\ No newline at end of file
+var _0x6379=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6379,0x84));var _0x9637=function(_0x142026,_0x49dda6){_0x142026=_0x142026-0x0;var _0x5e199f=_0x6379[_0x142026];return _0x5e199f;};'use strict';var VoiceQueueReportEvents=require(_0x9637('0x0'));var events=[_0x9637('0x1'),_0x9637('0x2'),_0x9637('0x3')];function createListener(_0x19949a,_0x52d27e){return function(_0x44a9ae){_0x52d27e[_0x9637('0x4')](_0x19949a,_0x44a9ae);};}function removeListener(_0x5f1058,_0x5f50c5){return function(){VoiceQueueReportEvents[_0x9637('0x5')](_0x5f1058,_0x5f50c5);};}exports[_0x9637('0x6')]=function(_0x19f7d0){for(var _0x25087c=0x0,_0xf0db9f=events['length'];_0x25087c<_0xf0db9f;_0x25087c++){var _0x515a84=events[_0x25087c];var _0x21d91b=createListener(_0x9637('0x7')+_0x515a84,_0x19f7d0);VoiceQueueReportEvents['on'](_0x515a84,_0x21d91b);}};
\ No newline at end of file
index bce198a..11d25e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6505=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','get'];(function(_0x24303d,_0x3ab9f1){var _0x5116d3=function(_0x29876f){while(--_0x29876f){_0x24303d['push'](_0x24303d['shift']());}};_0x5116d3(++_0x3ab9f1);}(_0x6505,0x8c));var _0x5650=function(_0x408b42,_0x2edc27){_0x408b42=_0x408b42-0x0;var _0x1ea8bf=_0x6505[_0x408b42];return _0x1ea8bf;};'use strict';var multer=require(_0x5650('0x0'));var util=require(_0x5650('0x1'));var path=require(_0x5650('0x2'));var timeout=require(_0x5650('0x3'));var express=require(_0x5650('0x4'));var router=express[_0x5650('0x5')]();var fs_extra=require(_0x5650('0x6'));var auth=require(_0x5650('0x7'));var interaction=require(_0x5650('0x8'));var config=require(_0x5650('0x9'));var controller=require(_0x5650('0xa'));router['get']('/',auth[_0x5650('0xb')](),controller[_0x5650('0xc')]);router[_0x5650('0xd')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0xf')]);router[_0x5650('0x10')]('/',auth['isAuthenticated'](),controller[_0x5650('0x11')]);router['put'](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x12')]);router[_0x5650('0x13')](_0x5650('0xe'),auth[_0x5650('0xb')](),controller[_0x5650('0x14')]);module[_0x5650('0x15')]=router;
\ No newline at end of file
+var _0x8e6a=['/:id','post','create','put','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x8e6a,0x105));var _0xa8e6=function(_0x441a68,_0x3140b1){_0x441a68=_0x441a68-0x0;var _0x5644d3=_0x8e6a[_0x441a68];return _0x5644d3;};'use strict';var multer=require(_0xa8e6('0x0'));var util=require(_0xa8e6('0x1'));var path=require('path');var timeout=require(_0xa8e6('0x2'));var express=require(_0xa8e6('0x3'));var router=express[_0xa8e6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8e6('0x5'));var interaction=require(_0xa8e6('0x6'));var config=require('../../config/environment');var controller=require(_0xa8e6('0x7'));router[_0xa8e6('0x8')]('/',auth[_0xa8e6('0x9')](),controller[_0xa8e6('0xa')]);router[_0xa8e6('0x8')](_0xa8e6('0xb'),auth[_0xa8e6('0x9')](),controller['show']);router[_0xa8e6('0xc')]('/',auth['isAuthenticated'](),controller[_0xa8e6('0xd')]);router[_0xa8e6('0xe')](_0xa8e6('0xb'),auth[_0xa8e6('0x9')](),controller['update']);router[_0xa8e6('0xf')](_0xa8e6('0xb'),auth[_0xa8e6('0x9')](),controller[_0xa8e6('0x10')]);module['exports']=router;
\ No newline at end of file
index dac0928..8735e6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x837e=['moment','STRING','DATE','sequelize'];(function(_0x29fd83,_0x207db0){var _0x1028de=function(_0x2486a1){while(--_0x2486a1){_0x29fd83['push'](_0x29fd83['shift']());}};_0x1028de(++_0x207db0);}(_0x837e,0x1b7));var _0xe837=function(_0x4ba93c,_0x52963a){_0x4ba93c=_0x4ba93c-0x0;var _0x47ea3e=_0x837e[_0x4ba93c];return _0x47ea3e;};'use strict';var Sequelize=require(_0xe837('0x0'));var moment=require(_0xe837('0x1'));module['exports']={'time':{'type':Sequelize[_0xe837('0x2')]},'callid':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe837('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe837('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
+var _0xb84b=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment','STRING','DATE','literal'];(function(_0xeeb156,_0x5392f4){var _0x4b7c74=function(_0x5705bb){while(--_0x5705bb){_0xeeb156['push'](_0xeeb156['shift']());}};_0x4b7c74(++_0x5392f4);}(_0xb84b,0x18c));var _0xbb84=function(_0x36cc6d,_0x49b08f){_0x36cc6d=_0x36cc6d-0x0;var _0x564476=_0xb84b[_0x36cc6d];return _0x564476;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbb84('0x0'));module['exports']={'time':{'type':Sequelize[_0xbb84('0x1')]},'callid':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xbb84('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xbb84('0x2')],'allowNull':![],'defaultValue':Sequelize[_0xbb84('0x3')](_0xbb84('0x4'))}};
\ No newline at end of file
index 5d868d4..f10a1bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdea3=['filters','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','rawAttributes','includeAll','include','create','body','find','params','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','save','update','destroy','then','error','stack','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where'];(function(_0x4f9a37,_0x30e084){var _0x148238=function(_0x4e706a){while(--_0x4e706a){_0x4f9a37['push'](_0x4f9a37['shift']());}};_0x148238(++_0x30e084);}(_0xdea3,0xa4));var _0x3dea=function(_0x41492e,_0x5985c2){_0x41492e=_0x41492e-0x0;var _0x276311=_0xdea3[_0x41492e];return _0x276311;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3dea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3dea('0x1'));var rp=require('request-promise');var moment=require(_0x3dea('0x2'));var BPromise=require(_0x3dea('0x3'));var Mustache=require('mustache');var util=require(_0x3dea('0x4'));var path=require(_0x3dea('0x5'));var sox=require(_0x3dea('0x6'));var csv=require(_0x3dea('0x7'));var ejs=require(_0x3dea('0x8'));var fs=require('fs');var fs_extra=require(_0x3dea('0x9'));var _=require(_0x3dea('0xa'));var squel=require('squel');var crypto=require(_0x3dea('0xb'));var jsforce=require(_0x3dea('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dea('0x7'));var querystring=require(_0x3dea('0xd'));var Papa=require(_0x3dea('0xe'));var Redis=require(_0x3dea('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3dea('0x10'));var as=require(_0x3dea('0x11'));var hardwareService=require(_0x3dea('0x12'));var logger=require(_0x3dea('0x13'))(_0x3dea('0x14'));var utils=require('../../config/utils');var config=require(_0x3dea('0x15'));var licenseUtil=require(_0x3dea('0x16'));var db=require(_0x3dea('0x17'))['db'];function respondWithStatusCode(_0x37d2f4,_0x2840e2){_0x2840e2=_0x2840e2||0xcc;return function(_0x3ad491){if(_0x3ad491){return _0x37d2f4[_0x3dea('0x18')](_0x2840e2);}return _0x37d2f4[_0x3dea('0x19')](_0x2840e2)[_0x3dea('0x1a')]();};}function respondWithResult(_0x5c1ce9,_0x44ec1d){_0x44ec1d=_0x44ec1d||0xc8;return function(_0x36e623){if(_0x36e623){return _0x5c1ce9[_0x3dea('0x19')](_0x44ec1d)['json'](_0x36e623);}};}function respondWithFilteredResult(_0x435843,_0x3e39f1){return function(_0xb543f6){if(_0xb543f6){var _0x584559=typeof _0x3e39f1[_0x3dea('0x1b')]===_0x3dea('0x1c')&&typeof _0x3e39f1[_0x3dea('0x1d')]===_0x3dea('0x1c');var _0x58ad5a=_0xb543f6[_0x3dea('0x1e')];var _0x346ffb=_0x584559?0x0:_0x3e39f1[_0x3dea('0x1b')];var _0x4d8834=_0x584559?_0xb543f6['count']:_0x3e39f1[_0x3dea('0x1b')]+_0x3e39f1[_0x3dea('0x1d')];var _0x4a0f60;if(_0x4d8834>=_0x58ad5a){_0x4d8834=_0x58ad5a;_0x4a0f60=0xc8;}else{_0x4a0f60=0xce;}_0x435843[_0x3dea('0x19')](_0x4a0f60);return _0x435843[_0x3dea('0x1f')]('Content-Range',_0x346ffb+'-'+_0x4d8834+'/'+_0x58ad5a)[_0x3dea('0x20')](_0xb543f6);}return null;};}function patchUpdates(_0x29508c){return function(_0x39df58){try{jsonpatch['apply'](_0x39df58,_0x29508c,!![]);}catch(_0x534cac){return BPromise[_0x3dea('0x21')](_0x534cac);}return _0x39df58[_0x3dea('0x22')]();};}function saveUpdates(_0x3341a1,_0xfc75a2){return function(_0x481aff){if(_0x481aff){return _0x481aff[_0x3dea('0x23')](_0x3341a1)['then'](function(_0x47fca2){return _0x47fca2;});}return null;};}function removeEntity(_0x18ea51,_0x39848a){return function(_0x330294){if(_0x330294){return _0x330294[_0x3dea('0x24')]()[_0x3dea('0x25')](function(){_0x18ea51[_0x3dea('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x86c36a,_0x4386fc){return function(_0x20bd19){if(!_0x20bd19){_0x86c36a[_0x3dea('0x18')](0x194);}return _0x20bd19;};}function handleError(_0x558d73,_0x557e5c){_0x557e5c=_0x557e5c||0x1f4;return function(_0x4c4e5a){logger[_0x3dea('0x26')](_0x4c4e5a[_0x3dea('0x27')]);if(_0x4c4e5a[_0x3dea('0x28')]){delete _0x4c4e5a['name'];}_0x558d73[_0x3dea('0x19')](_0x557e5c)[_0x3dea('0x29')](_0x4c4e5a);};}exports['index']=function(_0x4efd25,_0x1b77c8){var _0x593fc3={},_0x5997bc={},_0xfcf10a={'count':0x0,'rows':[]};var _0x55d636=_[_0x3dea('0x2a')](db[_0x3dea('0x2b')]['rawAttributes'],function(_0x12a6fd){return{'name':_0x12a6fd[_0x3dea('0x2c')],'type':_0x12a6fd[_0x3dea('0x2d')][_0x3dea('0x2e')]};});_0x5997bc[_0x3dea('0x2f')]=_['map'](_0x55d636,'name');_0x5997bc[_0x3dea('0x30')]=_[_0x3dea('0x31')](_0x4efd25[_0x3dea('0x30')]);_0x5997bc['filters']=_[_0x3dea('0x32')](_0x5997bc[_0x3dea('0x2f')],_0x5997bc[_0x3dea('0x30')]);_0x593fc3[_0x3dea('0x33')]=_[_0x3dea('0x32')](_0x5997bc[_0x3dea('0x2f')],qs[_0x3dea('0x34')](_0x4efd25[_0x3dea('0x30')][_0x3dea('0x34')]));_0x593fc3[_0x3dea('0x33')]=_0x593fc3[_0x3dea('0x33')][_0x3dea('0x35')]?_0x593fc3[_0x3dea('0x33')]:_0x5997bc[_0x3dea('0x2f')];if(!_0x4efd25['query']['hasOwnProperty'](_0x3dea('0x36'))){_0x593fc3[_0x3dea('0x1d')]=qs[_0x3dea('0x1d')](_0x4efd25['query'][_0x3dea('0x1d')]);_0x593fc3[_0x3dea('0x1b')]=qs[_0x3dea('0x1b')](_0x4efd25['query'][_0x3dea('0x1b')]);}_0x593fc3[_0x3dea('0x37')]=qs['sort'](_0x4efd25['query'][_0x3dea('0x38')]);_0x593fc3[_0x3dea('0x39')]=qs[_0x3dea('0x3a')](_[_0x3dea('0x3b')](_0x4efd25['query'],_0x5997bc['filters']),_0x55d636);if(_0x4efd25['query']['filter']){_0x593fc3[_0x3dea('0x39')]=_[_0x3dea('0x3c')](_0x593fc3[_0x3dea('0x39')],{'$or':_['map'](_0x55d636,function(_0xd1652e){if(_0xd1652e[_0x3dea('0x2d')]!==_0x3dea('0x3d')){var _0x46067e={};_0x46067e[_0xd1652e[_0x3dea('0x28')]]={'$like':'%'+_0x4efd25[_0x3dea('0x30')][_0x3dea('0x3e')]+'%'};return _0x46067e;}})});}_0x593fc3=_[_0x3dea('0x3c')]({},_0x593fc3,_0x4efd25['options']);var _0x499f8d={'where':_0x593fc3[_0x3dea('0x39')]};return db[_0x3dea('0x2b')][_0x3dea('0x1e')](_0x499f8d)[_0x3dea('0x25')](function(_0x406b5b){_0xfcf10a[_0x3dea('0x1e')]=_0x406b5b;if(_0x4efd25['query']['includeAll']){_0x593fc3['include']=[{'all':!![]}];}return db[_0x3dea('0x2b')][_0x3dea('0x3f')](_0x593fc3);})[_0x3dea('0x25')](function(_0x51784d){_0xfcf10a[_0x3dea('0x40')]=_0x51784d;return _0xfcf10a;})[_0x3dea('0x25')](respondWithFilteredResult(_0x1b77c8,_0x593fc3))[_0x3dea('0x41')](handleError(_0x1b77c8,null));};exports[_0x3dea('0x42')]=function(_0x21c787,_0xb575a4){var _0x1f6c06={'raw':!![],'where':{'id':_0x21c787['params']['id']}},_0x58da38={};_0x58da38['model']=_[_0x3dea('0x31')](db[_0x3dea('0x2b')][_0x3dea('0x43')]);_0x58da38[_0x3dea('0x30')]=_['keys'](_0x21c787[_0x3dea('0x30')]);_0x58da38[_0x3dea('0x3a')]=_[_0x3dea('0x32')](_0x58da38[_0x3dea('0x2f')],_0x58da38[_0x3dea('0x30')]);_0x1f6c06[_0x3dea('0x33')]=_[_0x3dea('0x32')](_0x58da38['model'],qs[_0x3dea('0x34')](_0x21c787[_0x3dea('0x30')]['fields']));_0x1f6c06['attributes']=_0x1f6c06['attributes'][_0x3dea('0x35')]?_0x1f6c06[_0x3dea('0x33')]:_0x58da38[_0x3dea('0x2f')];if(_0x21c787[_0x3dea('0x30')][_0x3dea('0x44')]){_0x1f6c06[_0x3dea('0x45')]=[{'all':!![]}];}_0x1f6c06=_['merge']({},_0x1f6c06,_0x21c787['options']);return db[_0x3dea('0x2b')]['find'](_0x1f6c06)[_0x3dea('0x25')](handleEntityNotFound(_0xb575a4,null))['then'](respondWithResult(_0xb575a4,null))[_0x3dea('0x41')](handleError(_0xb575a4,null));};exports[_0x3dea('0x46')]=function(_0x3f6824,_0x14ff92){return db['VoiceQueuesLog'][_0x3dea('0x46')](_0x3f6824[_0x3dea('0x47')],{})[_0x3dea('0x25')](respondWithResult(_0x14ff92,0xc9))['catch'](handleError(_0x14ff92,null));};exports['update']=function(_0x30e86e,_0x30c536){if(_0x30e86e['body']['id']){delete _0x30e86e[_0x3dea('0x47')]['id'];}return db[_0x3dea('0x2b')][_0x3dea('0x48')]({'where':{'id':_0x30e86e[_0x3dea('0x49')]['id']}})[_0x3dea('0x25')](handleEntityNotFound(_0x30c536,null))[_0x3dea('0x25')](saveUpdates(_0x30e86e[_0x3dea('0x47')],null))[_0x3dea('0x25')](respondWithResult(_0x30c536,null))['catch'](handleError(_0x30c536,null));};exports[_0x3dea('0x24')]=function(_0x2e2786,_0x537b58){return db[_0x3dea('0x2b')][_0x3dea('0x48')]({'where':{'id':_0x2e2786['params']['id']}})['then'](handleEntityNotFound(_0x537b58,null))[_0x3dea('0x25')](removeEntity(_0x537b58,null))[_0x3dea('0x41')](handleError(_0x537b58,null));};
\ No newline at end of file
+var _0xff79=['querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','desk.js'];(function(_0x5b0a60,_0x506853){var _0x4ff501=function(_0x43d91a){while(--_0x43d91a){_0x5b0a60['push'](_0x5b0a60['shift']());}};_0x4ff501(++_0x506853);}(_0xff79,0x156));var _0x9ff7=function(_0x25ba5d,_0x50fb62){_0x25ba5d=_0x25ba5d-0x0;var _0x2d39c0=_0xff79[_0x25ba5d];return _0x2d39c0;};'use strict';var emlformat=require(_0x9ff7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9ff7('0x1'));var jsonpatch=require(_0x9ff7('0x2'));var rp=require(_0x9ff7('0x3'));var moment=require(_0x9ff7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ff7('0x5'));var util=require(_0x9ff7('0x6'));var path=require(_0x9ff7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9ff7('0x8'));var fs=require('fs');var fs_extra=require(_0x9ff7('0x9'));var _=require('lodash');var squel=require(_0x9ff7('0xa'));var crypto=require(_0x9ff7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9ff7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9ff7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9ff7('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x9ff7('0xf'));var hardwareService=require(_0x9ff7('0x10'));var logger=require(_0x9ff7('0x11'))('api');var utils=require(_0x9ff7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x9ff7('0x13'));var db=require(_0x9ff7('0x14'))['db'];function respondWithStatusCode(_0x47e2ce,_0x3d7c52){_0x3d7c52=_0x3d7c52||0xcc;return function(_0x438c07){if(_0x438c07){return _0x47e2ce[_0x9ff7('0x15')](_0x3d7c52);}return _0x47e2ce[_0x9ff7('0x16')](_0x3d7c52)[_0x9ff7('0x17')]();};}function respondWithResult(_0x348904,_0x3cff94){_0x3cff94=_0x3cff94||0xc8;return function(_0x1e8861){if(_0x1e8861){return _0x348904['status'](_0x3cff94)[_0x9ff7('0x18')](_0x1e8861);}};}function respondWithFilteredResult(_0xa4f305,_0x4d119e){return function(_0xa21379){if(_0xa21379){var _0x5eb4ed=typeof _0x4d119e[_0x9ff7('0x19')]==='undefined'&&typeof _0x4d119e['limit']===_0x9ff7('0x1a');var _0x33364d=_0xa21379['count'];var _0x4980b9=_0x5eb4ed?0x0:_0x4d119e['offset'];var _0x3ed298=_0x5eb4ed?_0xa21379[_0x9ff7('0x1b')]:_0x4d119e['offset']+_0x4d119e[_0x9ff7('0x1c')];var _0x29e5e5;if(_0x3ed298>=_0x33364d){_0x3ed298=_0x33364d;_0x29e5e5=0xc8;}else{_0x29e5e5=0xce;}_0xa4f305[_0x9ff7('0x16')](_0x29e5e5);return _0xa4f305[_0x9ff7('0x1d')](_0x9ff7('0x1e'),_0x4980b9+'-'+_0x3ed298+'/'+_0x33364d)[_0x9ff7('0x18')](_0xa21379);}return null;};}function patchUpdates(_0x556d39){return function(_0x3fdfda){try{jsonpatch[_0x9ff7('0x1f')](_0x3fdfda,_0x556d39,!![]);}catch(_0x578a4f){return BPromise[_0x9ff7('0x20')](_0x578a4f);}return _0x3fdfda[_0x9ff7('0x21')]();};}function saveUpdates(_0x3a3e10,_0x3ca11d){return function(_0x1d6423){if(_0x1d6423){return _0x1d6423[_0x9ff7('0x22')](_0x3a3e10)['then'](function(_0x5656a9){return _0x5656a9;});}return null;};}function removeEntity(_0x165301,_0x334153){return function(_0x4f9b57){if(_0x4f9b57){return _0x4f9b57[_0x9ff7('0x23')]()[_0x9ff7('0x24')](function(){_0x165301[_0x9ff7('0x16')](0xcc)[_0x9ff7('0x17')]();});}};}function handleEntityNotFound(_0x5f4cb2,_0xf6c0bb){return function(_0x2174ae){if(!_0x2174ae){_0x5f4cb2[_0x9ff7('0x15')](0x194);}return _0x2174ae;};}function handleError(_0x3f44cc,_0x156afc){_0x156afc=_0x156afc||0x1f4;return function(_0x20d2fa){logger[_0x9ff7('0x25')](_0x20d2fa[_0x9ff7('0x26')]);if(_0x20d2fa['name']){delete _0x20d2fa[_0x9ff7('0x27')];}_0x3f44cc[_0x9ff7('0x16')](_0x156afc)['send'](_0x20d2fa);};}exports['index']=function(_0x1cd25e,_0x48459b){var _0x52eeef={},_0x26b800={},_0xc827cf={'count':0x0,'rows':[]};var _0x344269=_[_0x9ff7('0x28')](db[_0x9ff7('0x29')][_0x9ff7('0x2a')],function(_0x1c86eb){return{'name':_0x1c86eb[_0x9ff7('0x2b')],'type':_0x1c86eb['type'][_0x9ff7('0x2c')]};});_0x26b800['model']=_[_0x9ff7('0x28')](_0x344269,_0x9ff7('0x27'));_0x26b800[_0x9ff7('0x2d')]=_[_0x9ff7('0x2e')](_0x1cd25e['query']);_0x26b800[_0x9ff7('0x2f')]=_[_0x9ff7('0x30')](_0x26b800['model'],_0x26b800[_0x9ff7('0x2d')]);_0x52eeef['attributes']=_[_0x9ff7('0x30')](_0x26b800[_0x9ff7('0x31')],qs['fields'](_0x1cd25e['query'][_0x9ff7('0x32')]));_0x52eeef[_0x9ff7('0x33')]=_0x52eeef[_0x9ff7('0x33')][_0x9ff7('0x34')]?_0x52eeef[_0x9ff7('0x33')]:_0x26b800['model'];if(!_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x35')](_0x9ff7('0x36'))){_0x52eeef['limit']=qs[_0x9ff7('0x1c')](_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x1c')]);_0x52eeef[_0x9ff7('0x19')]=qs[_0x9ff7('0x19')](_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x19')]);}_0x52eeef[_0x9ff7('0x37')]=qs[_0x9ff7('0x38')](_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x38')]);_0x52eeef[_0x9ff7('0x39')]=qs[_0x9ff7('0x2f')](_[_0x9ff7('0x3a')](_0x1cd25e[_0x9ff7('0x2d')],_0x26b800['filters']),_0x344269);if(_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x3b')]){_0x52eeef['where']=_[_0x9ff7('0x3c')](_0x52eeef[_0x9ff7('0x39')],{'$or':_[_0x9ff7('0x28')](_0x344269,function(_0x299a35){if(_0x299a35['type']!==_0x9ff7('0x3d')){var _0x3a497e={};_0x3a497e[_0x299a35['name']]={'$like':'%'+_0x1cd25e[_0x9ff7('0x2d')]['filter']+'%'};return _0x3a497e;}})});}_0x52eeef=_[_0x9ff7('0x3c')]({},_0x52eeef,_0x1cd25e['options']);var _0x58a89d={'where':_0x52eeef[_0x9ff7('0x39')]};return db[_0x9ff7('0x29')][_0x9ff7('0x1b')](_0x58a89d)[_0x9ff7('0x24')](function(_0xd2ddf2){_0xc827cf['count']=_0xd2ddf2;if(_0x1cd25e[_0x9ff7('0x2d')][_0x9ff7('0x3e')]){_0x52eeef[_0x9ff7('0x3f')]=[{'all':!![]}];}return db[_0x9ff7('0x29')][_0x9ff7('0x40')](_0x52eeef);})[_0x9ff7('0x24')](function(_0x15f0a3){_0xc827cf['rows']=_0x15f0a3;return _0xc827cf;})[_0x9ff7('0x24')](respondWithFilteredResult(_0x48459b,_0x52eeef))[_0x9ff7('0x41')](handleError(_0x48459b,null));};exports[_0x9ff7('0x42')]=function(_0x495225,_0x4dff36){var _0x15d4ab={'raw':!![],'where':{'id':_0x495225[_0x9ff7('0x43')]['id']}},_0x3975b1={};_0x3975b1[_0x9ff7('0x31')]=_[_0x9ff7('0x2e')](db[_0x9ff7('0x29')][_0x9ff7('0x2a')]);_0x3975b1[_0x9ff7('0x2d')]=_[_0x9ff7('0x2e')](_0x495225[_0x9ff7('0x2d')]);_0x3975b1[_0x9ff7('0x2f')]=_['intersection'](_0x3975b1['model'],_0x3975b1[_0x9ff7('0x2d')]);_0x15d4ab[_0x9ff7('0x33')]=_['intersection'](_0x3975b1[_0x9ff7('0x31')],qs[_0x9ff7('0x32')](_0x495225[_0x9ff7('0x2d')][_0x9ff7('0x32')]));_0x15d4ab[_0x9ff7('0x33')]=_0x15d4ab[_0x9ff7('0x33')][_0x9ff7('0x34')]?_0x15d4ab[_0x9ff7('0x33')]:_0x3975b1['model'];if(_0x495225[_0x9ff7('0x2d')][_0x9ff7('0x3e')]){_0x15d4ab[_0x9ff7('0x3f')]=[{'all':!![]}];}_0x15d4ab=_[_0x9ff7('0x3c')]({},_0x15d4ab,_0x495225['options']);return db[_0x9ff7('0x29')][_0x9ff7('0x44')](_0x15d4ab)['then'](handleEntityNotFound(_0x4dff36,null))['then'](respondWithResult(_0x4dff36,null))[_0x9ff7('0x41')](handleError(_0x4dff36,null));};exports[_0x9ff7('0x45')]=function(_0x28a0e6,_0x34b944){return db['VoiceQueuesLog'][_0x9ff7('0x45')](_0x28a0e6[_0x9ff7('0x46')],{})['then'](respondWithResult(_0x34b944,0xc9))[_0x9ff7('0x41')](handleError(_0x34b944,null));};exports[_0x9ff7('0x22')]=function(_0x5da5a4,_0x13e3b1){if(_0x5da5a4[_0x9ff7('0x46')]['id']){delete _0x5da5a4[_0x9ff7('0x46')]['id'];}return db[_0x9ff7('0x29')][_0x9ff7('0x44')]({'where':{'id':_0x5da5a4[_0x9ff7('0x43')]['id']}})[_0x9ff7('0x24')](handleEntityNotFound(_0x13e3b1,null))[_0x9ff7('0x24')](saveUpdates(_0x5da5a4[_0x9ff7('0x46')],null))[_0x9ff7('0x24')](respondWithResult(_0x13e3b1,null))[_0x9ff7('0x41')](handleError(_0x13e3b1,null));};exports[_0x9ff7('0x23')]=function(_0x6b34c9,_0x25b391){return db[_0x9ff7('0x29')][_0x9ff7('0x44')]({'where':{'id':_0x6b34c9[_0x9ff7('0x43')]['id']}})[_0x9ff7('0x24')](handleEntityNotFound(_0x25b391,null))[_0x9ff7('0x24')](removeEntity(_0x25b391,null))[_0x9ff7('0x41')](handleError(_0x25b391,null));};
\ No newline at end of file
index 0e3651b..2cc3a0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab4d=['dtm','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','define','VoiceQueuesLog','voice_queues_log','event_dtm','event'];(function(_0x53aba7,_0x209f73){var _0x13e4a6=function(_0x3726c6){while(--_0x3726c6){_0x53aba7['push'](_0x53aba7['shift']());}};_0x13e4a6(++_0x209f73);}(_0xab4d,0x1ae));var _0xdab4=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xab4d[_0x5c4f6b];return _0x104c4e;};'use strict';var _=require(_0xdab4('0x0'));var util=require(_0xdab4('0x1'));var logger=require(_0xdab4('0x2'))(_0xdab4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdab4('0x4'));var fs=require('fs');var path=require(_0xdab4('0x5'));var rimraf=require('rimraf');var config=require(_0xdab4('0x6'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0xbf240,_0x3694a9){return _0xbf240[_0xdab4('0x7')](_0xdab4('0x8'),attributes,{'tableName':_0xdab4('0x9'),'paranoid':![],'indexes':[{'name':_0xdab4('0xa'),'fields':[_0xdab4('0xb'),_0xdab4('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xda11=['exports','define','voice_queues_log','dtm','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueuesLog.attributes'];(function(_0x5ecc17,_0x489e46){var _0x4f4917=function(_0x36a0ee){while(--_0x36a0ee){_0x5ecc17['push'](_0x5ecc17['shift']());}};_0x4f4917(++_0x489e46);}(_0xda11,0x185));var _0x1da1=function(_0x415357,_0x4f15ae){_0x415357=_0x415357-0x0;var _0x1b862c=_0xda11[_0x415357];return _0x1b862c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1da1('0x0'))(_0x1da1('0x1'));var moment=require(_0x1da1('0x2'));var BPromise=require(_0x1da1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1da1('0x4'));var rimraf=require(_0x1da1('0x5'));var config=require('../../config/environment');var attributes=require(_0x1da1('0x6'));module[_0x1da1('0x7')]=function(_0x23e9ff,_0xb68641){return _0x23e9ff[_0x1da1('0x8')]('VoiceQueuesLog',attributes,{'tableName':_0x1da1('0x9'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x1da1('0xa')]}],'timestamps':![]});};
\ No newline at end of file
index 5155069..e9a7ad8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8be2=['VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x8be2,0xcd));var _0x28be=function(_0x3d8ba1,_0x5ba1fd){_0x3d8ba1=_0x3d8ba1-0x0;var _0x87804e=_0x8be2[_0x3d8ba1];return _0x87804e;};'use strict';var _=require(_0x28be('0x0'));var util=require(_0x28be('0x1'));var moment=require(_0x28be('0x2'));var BPromise=require(_0x28be('0x3'));var rs=require(_0x28be('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x28be('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x28be('0x6'))(_0x28be('0x7'));var config=require(_0x28be('0x8'));var jayson=require(_0x28be('0x9'));var client=jayson['client'][_0x28be('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f6282,_0x59710c,_0x3b7baa){return new BPromise(function(_0x2b9654,_0x3e457){return client[_0x28be('0xb')](_0x2f6282,_0x3b7baa)[_0x28be('0xc')](function(_0x4d30cd){logger[_0x28be('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x59710c,_0x28be('0xe'));logger['debug'](_0x28be('0xf'),_0x59710c,_0x28be('0xe'),JSON[_0x28be('0x10')](_0x4d30cd));if(_0x4d30cd[_0x28be('0x11')]){if(_0x4d30cd[_0x28be('0x11')][_0x28be('0x12')]===0x1f4){logger['error'](_0x28be('0x13'),_0x59710c,_0x4d30cd[_0x28be('0x11')][_0x28be('0x14')]);return _0x3e457(_0x4d30cd[_0x28be('0x11')]['message']);}logger[_0x28be('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x59710c,_0x4d30cd[_0x28be('0x11')][_0x28be('0x14')]);return _0x2b9654(_0x4d30cd[_0x28be('0x11')][_0x28be('0x14')]);}else{logger['info'](_0x28be('0x13'),_0x59710c,_0x28be('0xe'));_0x2b9654(_0x4d30cd[_0x28be('0x15')]['message']);}})['catch'](function(_0x1fd477){logger[_0x28be('0x11')](_0x28be('0x13'),_0x59710c,_0x1fd477);_0x3e457(_0x1fd477);});});}
\ No newline at end of file
+var _0x9b69=['request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x9b69,0x196));var _0x99b6=function(_0x245ad2,_0x5496a0){_0x245ad2=_0x245ad2-0x0;var _0x12d7db=_0x9b69[_0x245ad2];return _0x12d7db;};'use strict';var _=require(_0x99b6('0x0'));var util=require('util');var moment=require(_0x99b6('0x1'));var BPromise=require(_0x99b6('0x2'));var rs=require(_0x99b6('0x3'));var fs=require('fs');var Redis=require(_0x99b6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x99b6('0x5'));var logger=require('../../config/logger')(_0x99b6('0x6'));var config=require(_0x99b6('0x7'));var jayson=require(_0x99b6('0x8'));var client=jayson[_0x99b6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55a5ad,_0x5d0ca6,_0x49d176){return new BPromise(function(_0x38c76a,_0x2d14a8){return client[_0x99b6('0xa')](_0x55a5ad,_0x49d176)[_0x99b6('0xb')](function(_0xaf4c11){logger[_0x99b6('0xc')](_0x99b6('0xd'),_0x5d0ca6,_0x99b6('0xe'));logger['debug'](_0x99b6('0xf'),_0x5d0ca6,'request\x20sent',JSON['stringify'](_0xaf4c11));if(_0xaf4c11[_0x99b6('0x10')]){if(_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x11')]===0x1f4){logger[_0x99b6('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5d0ca6,_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x12')]);return _0x2d14a8(_0xaf4c11['error']['message']);}logger['error'](_0x99b6('0xd'),_0x5d0ca6,_0xaf4c11[_0x99b6('0x10')][_0x99b6('0x12')]);return _0x38c76a(_0xaf4c11['error']['message']);}else{logger[_0x99b6('0xc')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5d0ca6,_0x99b6('0xe'));_0x38c76a(_0xaf4c11[_0x99b6('0x13')][_0x99b6('0x12')]);}})[_0x99b6('0x14')](function(_0x389ded){logger[_0x99b6('0x10')](_0x99b6('0xd'),_0x5d0ca6,_0x389ded);_0x2d14a8(_0x389ded);});});}
\ No newline at end of file
index 65e1ece..ccad401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x471f=['update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','create','runTranscribe','put'];(function(_0x588555,_0x7e8762){var _0x34611b=function(_0x42b6c9){while(--_0x42b6c9){_0x588555['push'](_0x588555['shift']());}};_0x34611b(++_0x7e8762);}(_0x471f,0x147));var _0xf471=function(_0x55adec,_0x27468c){_0x55adec=_0x55adec-0x0;var _0x2e379b=_0x471f[_0x55adec];return _0x2e379b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf471('0x0'));var timeout=require(_0xf471('0x1'));var express=require(_0xf471('0x2'));var router=express[_0xf471('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf471('0x4'));var interaction=require(_0xf471('0x5'));var config=require(_0xf471('0x6'));var controller=require(_0xf471('0x7'));router[_0xf471('0x8')]('/',auth[_0xf471('0x9')](),controller[_0xf471('0xa')]);router['get'](_0xf471('0xb'),auth[_0xf471('0x9')](),controller[_0xf471('0xc')]);router[_0xf471('0x8')](_0xf471('0xd'),auth[_0xf471('0x9')](),controller[_0xf471('0xe')]);router[_0xf471('0x8')](_0xf471('0xf'),auth[_0xf471('0x9')](),controller[_0xf471('0x10')]);router[_0xf471('0x8')](_0xf471('0x11'),controller[_0xf471('0x12')]);router['get'](_0xf471('0x13'),auth[_0xf471('0x9')](),controller[_0xf471('0x14')]);router['post']('/',auth[_0xf471('0x9')](),controller[_0xf471('0x15')]);router['post'](_0xf471('0x13'),auth['isAuthenticated'](),controller[_0xf471('0x16')]);router[_0xf471('0x17')](_0xf471('0xd'),auth[_0xf471('0x9')](),controller[_0xf471('0x18')]);router['delete']('/:id',auth[_0xf471('0x9')](),controller[_0xf471('0x19')]);module[_0xf471('0x1a')]=router;
\ No newline at end of file
+var _0x9442=['index','isAuthenticated','get','/:id','/:id/download','download','downloads','/:id/transcribe','post','create','runTranscribe','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2250da,_0xdb9fe6){var _0x573dc5=function(_0x3f397a){while(--_0x3f397a){_0x2250da['push'](_0x2250da['shift']());}};_0x573dc5(++_0xdb9fe6);}(_0x9442,0xa8));var _0x2944=function(_0x49316a,_0xb14307){_0x49316a=_0x49316a-0x0;var _0xaf2fa9=_0x9442[_0x49316a];return _0xaf2fa9;};'use strict';var multer=require(_0x2944('0x0'));var util=require('util');var path=require(_0x2944('0x1'));var timeout=require(_0x2944('0x2'));var express=require(_0x2944('0x3'));var router=express[_0x2944('0x4')]();var fs_extra=require(_0x2944('0x5'));var auth=require(_0x2944('0x6'));var interaction=require(_0x2944('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2944('0x8')]);router['get']('/describe',auth[_0x2944('0x9')](),controller['describe']);router[_0x2944('0xa')](_0x2944('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2944('0xa')](_0x2944('0xc'),auth[_0x2944('0x9')](),controller[_0x2944('0xd')]);router[_0x2944('0xa')]('/:id/downloads',controller[_0x2944('0xe')]);router['get'](_0x2944('0xf'),auth[_0x2944('0x9')](),controller['downloadTranscribe']);router[_0x2944('0x10')]('/',auth[_0x2944('0x9')](),controller[_0x2944('0x11')]);router['post'](_0x2944('0xf'),auth[_0x2944('0x9')](),controller[_0x2944('0x12')]);router['put'](_0x2944('0xb'),auth[_0x2944('0x9')](),controller['update']);router[_0x2944('0x13')](_0x2944('0xb'),auth[_0x2944('0x9')](),controller[_0x2944('0x14')]);module[_0x2944('0x15')]=router;
\ No newline at end of file
index e986573..9eadf90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index 5c631cc..2920427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95d7=['merge','filter','includeAll','findAll','catch','params','rawAttributes','include','options','create','body','find','describe','download','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','../../components/encryptor','sequelize','MD5','token','$and','push','filename','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','TranscribeService','startTranscriptionJob','basename','readFileSync','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','VoiceRecording','fieldName','type','key','differenceBy','map','format','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where'];(function(_0x3bb120,_0x581ad9){var _0x3732e2=function(_0x20d8eb){while(--_0x20d8eb){_0x3bb120['push'](_0x3bb120['shift']());}};_0x3732e2(++_0x581ad9);}(_0x95d7,0xf8));var _0x795d=function(_0x59772d,_0x52ad7e){_0x59772d=_0x59772d-0x0;var _0x34c035=_0x95d7[_0x59772d];return _0x34c035;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x795d('0x0'));var zipdir=require(_0x795d('0x1'));var jsonpatch=require(_0x795d('0x2'));var rp=require(_0x795d('0x3'));var moment=require(_0x795d('0x4'));var BPromise=require(_0x795d('0x5'));var Mustache=require(_0x795d('0x6'));var util=require(_0x795d('0x7'));var path=require(_0x795d('0x8'));var sox=require('sox');var csv=require(_0x795d('0x9'));var ejs=require(_0x795d('0xa'));var fs=require('fs');var fs_extra=require(_0x795d('0xb'));var _=require(_0x795d('0xc'));var squel=require(_0x795d('0xd'));var crypto=require(_0x795d('0xe'));var jsforce=require(_0x795d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x795d('0x9'));var querystring=require(_0x795d('0x10'));var Papa=require(_0x795d('0x11'));var AWS=require('aws-sdk');var uuidv4=require(_0x795d('0x12'));var Redis=require(_0x795d('0x13'));var authService=require(_0x795d('0x14'));var qs=require(_0x795d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x795d('0x16'));var logger=require(_0x795d('0x17'))(_0x795d('0x18'));var utils=require(_0x795d('0x19'));var config=require(_0x795d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x795d('0x1b'))['db'];function respondWithStatusCode(_0x340df8,_0x2bf441){_0x2bf441=_0x2bf441||0xcc;return function(_0x1e37bd){if(_0x1e37bd){return _0x340df8[_0x795d('0x1c')](_0x2bf441);}return _0x340df8[_0x795d('0x1d')](_0x2bf441)[_0x795d('0x1e')]();};}function respondWithResult(_0xb99009,_0x4c4c7f){_0x4c4c7f=_0x4c4c7f||0xc8;return function(_0x54ee73){if(_0x54ee73){return _0xb99009[_0x795d('0x1d')](_0x4c4c7f)[_0x795d('0x1f')](_0x54ee73);}};}function respondWithFilteredResult(_0x32b448,_0x2857f1){return function(_0x58e064){if(_0x58e064){var _0x218077=typeof _0x2857f1[_0x795d('0x20')]===_0x795d('0x21')&&typeof _0x2857f1[_0x795d('0x22')]===_0x795d('0x21');var _0x56ec6a=_0x58e064[_0x795d('0x23')];var _0x4c2f3a=_0x218077?0x0:_0x2857f1['offset'];var _0x536446=_0x218077?_0x58e064[_0x795d('0x23')]:_0x2857f1['offset']+_0x2857f1[_0x795d('0x22')];var _0x418272;if(_0x536446>=_0x56ec6a){_0x536446=_0x56ec6a;_0x418272=0xc8;}else{_0x418272=0xce;}_0x32b448[_0x795d('0x1d')](_0x418272);return _0x32b448[_0x795d('0x24')](_0x795d('0x25'),_0x4c2f3a+'-'+_0x536446+'/'+_0x56ec6a)[_0x795d('0x1f')](_0x58e064);}return null;};}function patchUpdates(_0x2612d7){return function(_0xeb4050){try{jsonpatch[_0x795d('0x26')](_0xeb4050,_0x2612d7,!![]);}catch(_0x2c663e){return BPromise[_0x795d('0x27')](_0x2c663e);}return _0xeb4050[_0x795d('0x28')]();};}function saveUpdates(_0x6ab64b,_0x2703c9){return function(_0x1b3d5b){if(_0x1b3d5b){return _0x1b3d5b[_0x795d('0x29')](_0x6ab64b)[_0x795d('0x2a')](function(_0x30cda1){return _0x30cda1;});}return null;};}function removeEntity(_0x2bc218,_0x22f5d1){return function(_0x27bd5a){if(_0x27bd5a){return _0x27bd5a[_0x795d('0x2b')]()[_0x795d('0x2a')](function(){_0x2bc218['status'](0xcc)[_0x795d('0x1e')]();});}};}function handleEntityNotFound(_0x34e524,_0x5ad91b){return function(_0x1dcab3){if(!_0x1dcab3){_0x34e524['sendStatus'](0x194);}return _0x1dcab3;};}function handleError(_0x307108,_0x21694f){_0x21694f=_0x21694f||0x1f4;return function(_0x43a212){logger['error'](_0x43a212[_0x795d('0x2c')]);if(_0x43a212[_0x795d('0x2d')]){delete _0x43a212[_0x795d('0x2d')];}_0x307108[_0x795d('0x1d')](_0x21694f)[_0x795d('0x2e')](_0x43a212);};}exports['index']=function(_0x24b04d,_0x49daa1){var _0x4fc760={},_0x463ead={},_0x34aa1={'count':0x0,'rows':[]};var _0xc5d4bd=_['map'](db[_0x795d('0x2f')]['rawAttributes'],function(_0x302201){return{'name':_0x302201[_0x795d('0x30')],'type':_0x302201[_0x795d('0x31')][_0x795d('0x32')]};});_0x463ead['model']=_[_0x795d('0x33')](_[_0x795d('0x34')](_0xc5d4bd,_0x795d('0x2d')),[_0x795d('0x35')]);_0x463ead[_0x795d('0x36')]=_[_0x795d('0x37')](_0x24b04d['query']);_0x463ead[_0x795d('0x38')]=_[_0x795d('0x39')](_0x463ead[_0x795d('0x3a')],_0x463ead[_0x795d('0x36')]);_0x4fc760['attributes']=_[_0x795d('0x39')](_0x463ead[_0x795d('0x3a')],qs[_0x795d('0x3b')](_0x24b04d[_0x795d('0x36')][_0x795d('0x3b')]));_0x4fc760[_0x795d('0x3c')]=_0x4fc760['attributes'][_0x795d('0x3d')]?_0x4fc760[_0x795d('0x3c')]:_0x463ead[_0x795d('0x3a')];if(!_0x24b04d[_0x795d('0x36')][_0x795d('0x3e')](_0x795d('0x3f'))){_0x4fc760['limit']=qs['limit'](_0x24b04d[_0x795d('0x36')][_0x795d('0x22')]);_0x4fc760[_0x795d('0x20')]=qs[_0x795d('0x20')](_0x24b04d[_0x795d('0x36')][_0x795d('0x20')]);}_0x4fc760[_0x795d('0x40')]=qs[_0x795d('0x41')](_0x24b04d[_0x795d('0x36')][_0x795d('0x41')]);_0x4fc760['where']=qs[_0x795d('0x38')](_[_0x795d('0x42')](_0x24b04d[_0x795d('0x36')],_0x463ead['filters']),_0xc5d4bd);if(_0x24b04d[_0x795d('0x36')]['filter']){_0x4fc760[_0x795d('0x43')]=_[_0x795d('0x44')](_0x4fc760[_0x795d('0x43')],{'$or':_[_0x795d('0x34')](_0xc5d4bd,function(_0x4a7a57){if(_0x4a7a57[_0x795d('0x31')]!=='VIRTUAL'){var _0x1e78b6={};_0x1e78b6[_0x4a7a57[_0x795d('0x2d')]]={'$like':'%'+_0x24b04d[_0x795d('0x36')][_0x795d('0x45')]+'%'};return _0x1e78b6;}})});}_0x4fc760=_[_0x795d('0x44')]({},_0x4fc760,_0x24b04d['options']);var _0x30fd32={'where':_0x4fc760['where']};return db[_0x795d('0x2f')][_0x795d('0x23')](_0x30fd32)[_0x795d('0x2a')](function(_0x26fdc1){_0x34aa1[_0x795d('0x23')]=_0x26fdc1;if(_0x24b04d[_0x795d('0x36')][_0x795d('0x46')]){_0x4fc760['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x795d('0x47')](_0x4fc760);})[_0x795d('0x2a')](function(_0x5ba037){_0x34aa1['rows']=_0x5ba037;return _0x34aa1;})[_0x795d('0x2a')](respondWithFilteredResult(_0x49daa1,_0x4fc760))[_0x795d('0x48')](handleError(_0x49daa1,null));};exports['show']=function(_0x343708,_0x4a6fc2){var _0x5686fb={'raw':![],'where':{'id':_0x343708[_0x795d('0x49')]['id']}},_0x586a36={};_0x586a36[_0x795d('0x3a')]=_[_0x795d('0x37')](db[_0x795d('0x2f')][_0x795d('0x4a')]);_0x586a36[_0x795d('0x36')]=_[_0x795d('0x37')](_0x343708['query']);_0x586a36[_0x795d('0x38')]=_[_0x795d('0x39')](_0x586a36['model'],_0x586a36[_0x795d('0x36')]);_0x5686fb[_0x795d('0x3c')]=_[_0x795d('0x39')](_0x586a36['model'],qs[_0x795d('0x3b')](_0x343708[_0x795d('0x36')]['fields']));_0x5686fb[_0x795d('0x3c')]=_0x5686fb[_0x795d('0x3c')][_0x795d('0x3d')]?_0x5686fb['attributes']:_0x586a36[_0x795d('0x3a')];if(_0x343708[_0x795d('0x36')][_0x795d('0x46')]){_0x5686fb[_0x795d('0x4b')]=[{'all':!![]}];}_0x5686fb=_['merge']({},_0x5686fb,_0x343708[_0x795d('0x4c')]);return db[_0x795d('0x2f')]['find'](_0x5686fb)[_0x795d('0x2a')](handleEntityNotFound(_0x4a6fc2,null))['then'](respondWithResult(_0x4a6fc2,null))['catch'](handleError(_0x4a6fc2,null));};exports['create']=function(_0x262fa0,_0x52f014){return db['VoiceRecording'][_0x795d('0x4d')](_0x262fa0[_0x795d('0x4e')],{})[_0x795d('0x2a')](respondWithResult(_0x52f014,0xc9))['catch'](handleError(_0x52f014,null));};exports['update']=function(_0x2937e1,_0x5159eb){if(_0x2937e1[_0x795d('0x4e')]['id']){delete _0x2937e1[_0x795d('0x4e')]['id'];}return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':{'id':_0x2937e1[_0x795d('0x49')]['id']}})['then'](handleEntityNotFound(_0x5159eb,null))[_0x795d('0x2a')](saveUpdates(_0x2937e1[_0x795d('0x4e')],null))[_0x795d('0x2a')](respondWithResult(_0x5159eb,null))['catch'](handleError(_0x5159eb,null));};exports[_0x795d('0x50')]=function(_0x59e352,_0x5a12d5){return db[_0x795d('0x2f')]['describe']()[_0x795d('0x2a')](respondWithResult(_0x5a12d5,null))[_0x795d('0x48')](handleError(_0x5a12d5,null));};exports[_0x795d('0x51')]=function(_0xf01033,_0x1f10b8,_0x48918c){var _0x5383cb=require('../../components/encryptor');var _0x543d2e=![];var _0x19be83={};if(_0xf01033[_0x795d('0x36')]['type']&&_0xf01033['query'][_0x795d('0x31')]===_0x795d('0x52')){_0x19be83['uniqueid']=_0xf01033[_0x795d('0x49')]['id'];}else{_0x19be83['id']=_0xf01033[_0x795d('0x49')]['id'];}return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':_0x19be83,'attributes':['id',_0x795d('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x1f10b8,null))[_0x795d('0x2a')](function(_0x1e23f2){if(_0x1e23f2){var _0x344fdf=_0x1e23f2[_0x795d('0x53')];var _0x1756ae=util['format']('%s.cypher',_0x344fdf);if(fs[_0x795d('0x54')](_0x1756ae)){_0x543d2e=!![];return _0x5383cb[_0x795d('0x55')](_0x1756ae,_0x344fdf,config[_0x795d('0x56')][_0x795d('0x57')])[_0x795d('0x2a')](function(){return _0x1e23f2;});}return _0x1e23f2;}})[_0x795d('0x2a')](function(_0x38be74){if(_0x38be74){var _0xaae14c=_0x38be74[_0x795d('0x53')];if(!fs['existsSync'](_0xaae14c)){throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))]('VoiceRecording\x20not\x20found');}if(_0x38be74['filename']){return _0x1f10b8[_0x795d('0x51')](_0xaae14c,_0x38be74['filename']+path[_0x795d('0x5a')](_0xaae14c),function(){if(_0x543d2e){fs[_0x795d('0x5b')](_0xaae14c);}});}else{return _0x1f10b8['download'](_0xaae14c,function(_0x569d8d){if(_0x543d2e){fs[_0x795d('0x5b')](_0xaae14c);}});}}})['catch'](function(_0x4cc1bd){if(_0x4cc1bd[_0x795d('0x5c')]===_0x795d('0x5d')){_0x1f10b8[_0x795d('0x1d')](0x194)[_0x795d('0x2e')](_0x795d('0x5e'));}else{return handleError(_0x1f10b8,null);}});};exports['downloads']=function(_0x17019d,_0xaa26b5,_0x18a4c0){var _0x5a8019=require(_0x795d('0x5f'));var _0xf3643a=![];var _0x42fa7b={'$and':[db[_0x795d('0x60')][_0x795d('0x43')](db[_0x795d('0x60')]['fn'](_0x795d('0x61'),db[_0x795d('0x60')]['col'](_0x795d('0x52'))),_0x17019d[_0x795d('0x36')][_0x795d('0x62')])]};if(_0x17019d[_0x795d('0x36')]['type']&&_0x17019d[_0x795d('0x36')][_0x795d('0x31')]==='uniqueid'){_0x42fa7b[_0x795d('0x63')][_0x795d('0x64')]({'uniqueid':_0x17019d[_0x795d('0x49')]['id']});}else{_0x42fa7b['$and'][_0x795d('0x64')]({'id':_0x17019d[_0x795d('0x49')]['id']});}return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':_0x42fa7b,'attributes':['id','value'],'raw':!![]})[_0x795d('0x2a')](handleEntityNotFound(_0xaa26b5,null))[_0x795d('0x2a')](function(_0x172552){if(_0x172552){var _0xebcb2f=util['format']('%s.cypher',_0x172552['value']);if(fs[_0x795d('0x54')](_0xebcb2f)){_0xf3643a=!![];return _0x5a8019[_0x795d('0x55')](_0xebcb2f,_0x172552[_0x795d('0x53')],config['secrets'][_0x795d('0x57')])[_0x795d('0x2a')](function(){return _0x172552;});}return _0x172552;}})[_0x795d('0x2a')](function(_0x7f6013){if(_0x7f6013){if(!fs[_0x795d('0x54')](_0x7f6013[_0x795d('0x53')])){throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))](_0x795d('0x5d'));}if(_0x7f6013[_0x795d('0x65')]){return _0xaa26b5[_0x795d('0x51')](_0x7f6013[_0x795d('0x53')],_0x7f6013[_0x795d('0x65')]+path['extname'](_0x7f6013[_0x795d('0x53')]),function(){if(_0xf3643a){fs[_0x795d('0x5b')](_0x7f6013['value']);}});}else{return _0xaa26b5[_0x795d('0x51')](_0x7f6013['value'],function(_0x184480){if(_0xf3643a){fs['unlink'](_0x7f6013['value']);}});}}})['catch'](handleError(_0xaa26b5,null));};exports['destroy']=function(_0x42f0b8,_0xd8ec5e){return db[_0x795d('0x2f')][_0x795d('0x4f')]({'where':{'id':_0x42f0b8[_0x795d('0x49')]['id']}})[_0x795d('0x2a')](function(_0x5ba5e7){if(_[_0x795d('0x66')](_0x5ba5e7)){throw new ReferenceError('Entity\x20not\x20found');}return _0x5ba5e7;})[_0x795d('0x2a')](function(_0x1a2d65){var _0x316164=_0x1a2d65[_0x795d('0x53')];logger[_0x795d('0x67')](_0x795d('0x68'),_0x316164);if(!_['isNil'](_0x1a2d65[_0x795d('0x53')])&&fs[_0x795d('0x54')](_0x316164)){logger[_0x795d('0x67')](_0x795d('0x69')+_0x316164+_0x795d('0x6a'));fs['unlinkSync'](_0x316164);}_0x316164=_0x316164+_0x795d('0x6b');if(!_[_0x795d('0x66')](_0x1a2d65['value'])&&fs[_0x795d('0x54')](_0x316164)){logger[_0x795d('0x67')]('File:\x20\x22'+_0x316164+_0x795d('0x6a'));fs[_0x795d('0x6c')](_0x316164);}return _0x1a2d65;})['then'](function(_0x816338){if(!_0x816338)throw new InternalError();return _0x816338[_0x795d('0x2b')]();})[_0x795d('0x2a')](function(){_0xd8ec5e[_0x795d('0x1d')](0xcc)[_0x795d('0x1e')]();})[_0x795d('0x48')](handleError(_0xd8ec5e,null));};function getBucketslist(_0x3120f4,_0xfb5c27,_0x12ebae){return new Promise(function(_0x438238,_0x542a50){var _0x277e4b=new AWS['S3']({'accessKeyId':_0xfb5c27,'secretAccessKey':_0x3120f4,'region':_0x12ebae});_0x277e4b[_0x795d('0x6d')]({},function(_0x4f94b5,_0x10738a){if(_0x4f94b5){return _0x542a50(_0x4f94b5);}else{return _0x438238(_0x10738a);}});});}function createBucket(_0x1fa5f7,_0x44ae0f,_0x2ccc41,_0x140be3){return new Promise(function(_0x3cdc4d,_0x6a535){var _0x2d4780=new AWS['S3']({'accessKeyId':_0x44ae0f,'secretAccessKey':_0x1fa5f7,'region':_0x2ccc41});_0x2d4780['createBucket']({'Bucket':_0x140be3},function(_0x5bcda3,_0x4775ab){if(_0x5bcda3){return _0x6a535(_0x5bcda3);}else{return _0x3cdc4d(_0x4775ab);}});});}function uploadFile(_0x110d30,_0x22f9b1,_0x2fd373,_0x5eb956,_0x50d64a,_0x5402ed){return new Promise(function(_0x9981e1,_0xfd4459){var _0x10c2af=new AWS['S3']({'accessKeyId':_0x22f9b1,'secretAccessKey':_0x110d30,'region':_0x2fd373});_0x10c2af['upload']({'Bucket':_0x5eb956,'Key':_0x50d64a,'Body':_0x5402ed},function(_0x5d1d35,_0x4a5a4e){if(_0x5d1d35){return _0xfd4459(_0x5d1d35);}else{return _0x9981e1(_0x4a5a4e);}});});}function startTranscribe(_0x447823,_0x6d9b42,_0x43fd3e,_0x40eb71,_0x4e8dc9,_0x27446b){return new Promise(function(_0x46a98c,_0x55635d){var _0x2fdcd1=new AWS[(_0x795d('0x6e'))]({'accessKeyId':_0x6d9b42,'secretAccessKey':_0x447823,'region':_0x43fd3e});_0x2fdcd1[_0x795d('0x6f')]({'TranscriptionJobName':_0x40eb71,'LanguageCode':_0x4e8dc9,'Media':{'MediaFileUri':_0x27446b}},function(_0x3c2a02,_0x45a48e){if(_0x3c2a02){return _0x55635d(_0x3c2a02);}else{return _0x46a98c(_0x45a48e);}});});}function transcribe(_0x380dfd,_0x41559d,_0x57d2f4,_0x509fb3,_0xd39250,_0xdb92ea,_0x3e31d6){return new Promise(function(_0x16939d,_0x3d256f){var _0x43aa28={};logger['info'](util[_0x795d('0x35')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x380dfd,_0xd39250));return uploadFile(_0x41559d,_0x57d2f4,_0x509fb3,_0xd39250,path[_0x795d('0x70')](_0xdb92ea),fs[_0x795d('0x71')](_0xdb92ea))[_0x795d('0x2a')](function(_0x22bd68){logger[_0x795d('0x67')](util[_0x795d('0x35')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x380dfd,_0xd39250,_0x22bd68['Location']));_0x43aa28[_0x795d('0x72')]=_0x22bd68[_0x795d('0x73')];_0x43aa28[_0x795d('0x74')]=_0x22bd68[_0x795d('0x75')];logger[_0x795d('0x67')](util['format'](_0x795d('0x76'),_0x380dfd));return startTranscribe(_0x41559d,_0x57d2f4,_0x509fb3,uuidv4(),_0x3e31d6,_0x22bd68[_0x795d('0x75')]);})[_0x795d('0x2a')](function(_0x559575){logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x77'),_0x380dfd,_0x559575[_0x795d('0x78')][_0x795d('0x79')]));_0x43aa28[_0x795d('0x7a')]=_0x559575[_0x795d('0x78')]['TranscriptionJobName'];_0x43aa28[_0x795d('0x7b')]=_0x559575[_0x795d('0x78')][_0x795d('0x7c')];return _0x16939d(_0x43aa28);})['catch'](function(_0x17068a){return _0x3d256f(_0x17068a);});});}exports[_0x795d('0x7d')]=function(_0x3cb9bc,_0x3c1077,_0xc98bb5){var _0xfb1b85;var _0x2d57c8;var _0x5d13ee;var _0x5c95f2=require(_0x795d('0x5f'));return db[_0x795d('0x2f')][_0x795d('0x7e')]({'where':{'id':_0x3cb9bc[_0x795d('0x49')]['id']}})[_0x795d('0x2a')](function(_0x311fca){if(_0x311fca){var _0x2df3a0=util[_0x795d('0x35')]('%s.cypher',_0x311fca[_0x795d('0x53')]);if(fs[_0x795d('0x54')](_0x2df3a0)){cypher=!![];return _0x5c95f2[_0x795d('0x55')](_0x2df3a0,_0x311fca['value'],config[_0x795d('0x56')]['recording'])[_0x795d('0x2a')](function(){return _0x311fca;});}return _0x311fca;}})[_0x795d('0x2a')](function(_0x27febe){if(!_0x27febe){throw new db[(_0x795d('0x58'))]['ValidationError'](_0x795d('0x7f'));}_0x2d57c8=_0x27febe;return db[_0x795d('0x80')]['findOne']({'where':{'id':0x1}});})[_0x795d('0x2a')](handleEntityNotFound(_0x3c1077,null))[_0x795d('0x2a')](function(_0x33234e){if(_0x33234e){_0xfb1b85=_0x33234e;if(!_0xfb1b85[_0x795d('0x81')]||!_0xfb1b85[_0x795d('0x82')]||!_0xfb1b85[_0x795d('0x83')]||!_0xfb1b85[_0x795d('0x84')]||!_0xfb1b85[_0x795d('0x72')]){throw new db['Sequelize']['ValidationError'](_0x795d('0x85'));}if(_0x3cb9bc[_0x795d('0x4e')]['runSentiment']&&(!_0xfb1b85[_0x795d('0x86')]||!_0xfb1b85[_0x795d('0x87')]||!_0xfb1b85[_0x795d('0x88')]||!_0xfb1b85[_0x795d('0x84')]||!_0xfb1b85[_0x795d('0x72')])){throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))](_0x795d('0x89'));}return db[_0x795d('0x8a')][_0x795d('0x7e')]({'where':{'id':_0xfb1b85[_0x795d('0x82')]}});}})[_0x795d('0x2a')](function(_0x1adca8){if(!_0x1adca8){throw new db[(_0x795d('0x58'))]['ValidationError'](_0x795d('0x8b'));}if(!_0x1adca8[_0x795d('0x8c')]||!_0x1adca8[_0x795d('0x8d')]){throw new db[(_0x795d('0x58'))]['ValidationError'](_0x795d('0x8e'));}_0x5d13ee=_0x1adca8;return getBucketslist(_0x5d13ee[_0x795d('0x8c')],_0x5d13ee[_0x795d('0x8d')],_0xfb1b85[_0x795d('0x83')]);})[_0x795d('0x2a')](function(_0x5e8aab){if(_0x5e8aab&&_0x5e8aab[_0x795d('0x8f')]){var _0x2ba3b7=_[_0x795d('0x4f')](_0x5e8aab['Buckets'],function(_0x69a237){return _0x69a237[_0x795d('0x90')]===_0xfb1b85[_0x795d('0x72')];});if(!_0x2ba3b7){logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x91'),_0x3cb9bc[_0x795d('0x49')]['id'],_0xfb1b85[_0x795d('0x72')]));return createBucket(_0x5d13ee[_0x795d('0x8c')],_0x5d13ee[_0x795d('0x8d')],_0xfb1b85['transcribeRegion'],_0xfb1b85['bucket']);}logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x92'),_0x3cb9bc[_0x795d('0x49')]['id'],_0xfb1b85[_0x795d('0x72')]));return;}})['then'](function(_0x3018e3){if(_0x2d57c8[_0x795d('0x7b')]===_0x795d('0x93')){return transcribe(_0x3cb9bc[_0x795d('0x49')]['id'],_0x5d13ee['data1'],_0x5d13ee['data2'],_0xfb1b85[_0x795d('0x83')],_0xfb1b85[_0x795d('0x72')],_0x2d57c8[_0x795d('0x53')],_0xfb1b85[_0x795d('0x84')]);}else{logger[_0x795d('0x67')](util[_0x795d('0x35')](_0x795d('0x94'),_0x3cb9bc['params']['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x795d('0x2a')](function(_0x4cf610){if(_0x4cf610){_0x4cf610['tempSentiment']=_0x3cb9bc['body'][_0x795d('0x95')];return _0x2d57c8[_0x795d('0x96')](_0x4cf610);}})[_0x795d('0x2a')](respondWithResult(_0x3c1077,null))[_0x795d('0x48')](handleError(_0x3c1077,null));};function writeFile(_0x12cee7,_0x105513){return new Promise(function(_0x2e2874,_0x15568d){fs[_0x795d('0x97')](_0x105513,_0x12cee7,function(_0x468b12,_0x14067c){if(_0x468b12){return _0x15568d(_0x468b12);}else{return _0x2e2874(_0x14067c);}});});}exports[_0x795d('0x98')]=function(_0x4d1bb9,_0x4bb8e8,_0x2a2361){return db[_0x795d('0x2f')][_0x795d('0x7e')]({'where':{'id':_0x4d1bb9[_0x795d('0x49')]['id']}})[_0x795d('0x2a')](handleEntityNotFound(_0x4bb8e8))['then'](function(_0x29075f){if(_0x29075f&&_0x29075f[_0x795d('0x99')]){var _0x2006e0=_0x29075f['fileText'];var _0x393aaa=config[_0x795d('0x9a')]+_0x795d('0x9b')+_0x29075f['id']+_0x795d('0x9c');if(fs[_0x795d('0x54')](_0x393aaa)){return _0x393aaa;}return writeFile(_0x2006e0,_0x393aaa)[_0x795d('0x2a')](function(){return _0x393aaa;});}else{throw new db[(_0x795d('0x58'))][(_0x795d('0x59'))](_0x795d('0x9d'));}})[_0x795d('0x2a')](function(_0x309344){return _0x4bb8e8[_0x795d('0x51')](_0x309344);})[_0x795d('0x48')](handleError(_0x4bb8e8));};
\ No newline at end of file
+var _0xbda7=['catch','show','params','rawAttributes','create','body','find','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','listBuckets','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','uuid/v4','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','map','VoiceRecording','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x4b577e,_0x1f42a6){var _0x3b0493=function(_0x4e3aeb){while(--_0x4e3aeb){_0x4b577e['push'](_0x4b577e['shift']());}};_0x3b0493(++_0x1f42a6);}(_0xbda7,0xe7));var _0x7bda=function(_0x368be2,_0x6ca033){_0x368be2=_0x368be2-0x0;var _0x460a2e=_0xbda7[_0x368be2];return _0x460a2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7bda('0x0'));var zipdir=require(_0x7bda('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7bda('0x2'));var moment=require('moment');var BPromise=require(_0x7bda('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7bda('0x4'));var sox=require(_0x7bda('0x5'));var csv=require('to-csv');var ejs=require(_0x7bda('0x6'));var fs=require('fs');var fs_extra=require(_0x7bda('0x7'));var _=require('lodash');var squel=require(_0x7bda('0x8'));var crypto=require(_0x7bda('0x9'));var jsforce=require(_0x7bda('0xa'));var deskjs=require(_0x7bda('0xb'));var toCsv=require(_0x7bda('0xc'));var querystring=require(_0x7bda('0xd'));var Papa=require(_0x7bda('0xe'));var AWS=require('aws-sdk');var uuidv4=require(_0x7bda('0xf'));var Redis=require(_0x7bda('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7bda('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bda('0x12'))(_0x7bda('0x13'));var utils=require(_0x7bda('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7bda('0x15'));var db=require(_0x7bda('0x16'))['db'];function respondWithStatusCode(_0x1a6864,_0x60dd9f){_0x60dd9f=_0x60dd9f||0xcc;return function(_0x231cad){if(_0x231cad){return _0x1a6864['sendStatus'](_0x60dd9f);}return _0x1a6864[_0x7bda('0x17')](_0x60dd9f)['end']();};}function respondWithResult(_0x5fe6b0,_0x34b9f9){_0x34b9f9=_0x34b9f9||0xc8;return function(_0x4fc11a){if(_0x4fc11a){return _0x5fe6b0[_0x7bda('0x17')](_0x34b9f9)[_0x7bda('0x18')](_0x4fc11a);}};}function respondWithFilteredResult(_0x10b5f6,_0x1503f3){return function(_0x488478){if(_0x488478){var _0x4cee6f=typeof _0x1503f3[_0x7bda('0x19')]===_0x7bda('0x1a')&&typeof _0x1503f3['limit']===_0x7bda('0x1a');var _0x3ac1b7=_0x488478[_0x7bda('0x1b')];var _0x593fc7=_0x4cee6f?0x0:_0x1503f3[_0x7bda('0x19')];var _0x2eec82=_0x4cee6f?_0x488478['count']:_0x1503f3[_0x7bda('0x19')]+_0x1503f3['limit'];var _0x3ebd01;if(_0x2eec82>=_0x3ac1b7){_0x2eec82=_0x3ac1b7;_0x3ebd01=0xc8;}else{_0x3ebd01=0xce;}_0x10b5f6['status'](_0x3ebd01);return _0x10b5f6[_0x7bda('0x1c')](_0x7bda('0x1d'),_0x593fc7+'-'+_0x2eec82+'/'+_0x3ac1b7)[_0x7bda('0x18')](_0x488478);}return null;};}function patchUpdates(_0x24ca2b){return function(_0x3bfe9a){try{jsonpatch[_0x7bda('0x1e')](_0x3bfe9a,_0x24ca2b,!![]);}catch(_0x399d7a){return BPromise[_0x7bda('0x1f')](_0x399d7a);}return _0x3bfe9a[_0x7bda('0x20')]();};}function saveUpdates(_0x4c5128,_0x379c90){return function(_0x35b9ce){if(_0x35b9ce){return _0x35b9ce[_0x7bda('0x21')](_0x4c5128)[_0x7bda('0x22')](function(_0x33f28e){return _0x33f28e;});}return null;};}function removeEntity(_0x362db7,_0x577b6c){return function(_0x5d7b8a){if(_0x5d7b8a){return _0x5d7b8a['destroy']()[_0x7bda('0x22')](function(){_0x362db7[_0x7bda('0x17')](0xcc)[_0x7bda('0x23')]();});}};}function handleEntityNotFound(_0xcc0fd,_0x2b84a1){return function(_0xa1fd9){if(!_0xa1fd9){_0xcc0fd[_0x7bda('0x24')](0x194);}return _0xa1fd9;};}function handleError(_0x4af699,_0x3dd4b7){_0x3dd4b7=_0x3dd4b7||0x1f4;return function(_0x514e45){logger[_0x7bda('0x25')](_0x514e45[_0x7bda('0x26')]);if(_0x514e45[_0x7bda('0x27')]){delete _0x514e45[_0x7bda('0x27')];}_0x4af699[_0x7bda('0x17')](_0x3dd4b7)[_0x7bda('0x28')](_0x514e45);};}exports['index']=function(_0x182577,_0x3877b8){var _0x315b14={},_0x2528a9={},_0x4b5fcf={'count':0x0,'rows':[]};var _0x21793d=_[_0x7bda('0x29')](db[_0x7bda('0x2a')]['rawAttributes'],function(_0x1c90d2){return{'name':_0x1c90d2[_0x7bda('0x2b')],'type':_0x1c90d2[_0x7bda('0x2c')][_0x7bda('0x2d')]};});_0x2528a9[_0x7bda('0x2e')]=_['differenceBy'](_[_0x7bda('0x29')](_0x21793d,_0x7bda('0x27')),['format']);_0x2528a9[_0x7bda('0x2f')]=_[_0x7bda('0x30')](_0x182577['query']);_0x2528a9['filters']=_[_0x7bda('0x31')](_0x2528a9['model'],_0x2528a9[_0x7bda('0x2f')]);_0x315b14['attributes']=_[_0x7bda('0x31')](_0x2528a9[_0x7bda('0x2e')],qs[_0x7bda('0x32')](_0x182577[_0x7bda('0x2f')][_0x7bda('0x32')]));_0x315b14[_0x7bda('0x33')]=_0x315b14[_0x7bda('0x33')][_0x7bda('0x34')]?_0x315b14[_0x7bda('0x33')]:_0x2528a9[_0x7bda('0x2e')];if(!_0x182577[_0x7bda('0x2f')][_0x7bda('0x35')](_0x7bda('0x36'))){_0x315b14[_0x7bda('0x37')]=qs[_0x7bda('0x37')](_0x182577[_0x7bda('0x2f')][_0x7bda('0x37')]);_0x315b14[_0x7bda('0x19')]=qs['offset'](_0x182577[_0x7bda('0x2f')][_0x7bda('0x19')]);}_0x315b14[_0x7bda('0x38')]=qs['sort'](_0x182577[_0x7bda('0x2f')][_0x7bda('0x39')]);_0x315b14[_0x7bda('0x3a')]=qs[_0x7bda('0x3b')](_[_0x7bda('0x3c')](_0x182577['query'],_0x2528a9['filters']),_0x21793d);if(_0x182577['query'][_0x7bda('0x3d')]){_0x315b14[_0x7bda('0x3a')]=_[_0x7bda('0x3e')](_0x315b14[_0x7bda('0x3a')],{'$or':_[_0x7bda('0x29')](_0x21793d,function(_0x3a8ba6){if(_0x3a8ba6['type']!==_0x7bda('0x3f')){var _0x268e8d={};_0x268e8d[_0x3a8ba6[_0x7bda('0x27')]]={'$like':'%'+_0x182577['query'][_0x7bda('0x3d')]+'%'};return _0x268e8d;}})});}_0x315b14=_['merge']({},_0x315b14,_0x182577[_0x7bda('0x40')]);var _0x4fd058={'where':_0x315b14[_0x7bda('0x3a')]};return db[_0x7bda('0x2a')][_0x7bda('0x1b')](_0x4fd058)[_0x7bda('0x22')](function(_0x41897b){_0x4b5fcf[_0x7bda('0x1b')]=_0x41897b;if(_0x182577['query'][_0x7bda('0x41')]){_0x315b14[_0x7bda('0x42')]=[{'all':!![]}];}return db[_0x7bda('0x2a')][_0x7bda('0x43')](_0x315b14);})['then'](function(_0x58decf){_0x4b5fcf[_0x7bda('0x44')]=_0x58decf;return _0x4b5fcf;})[_0x7bda('0x22')](respondWithFilteredResult(_0x3877b8,_0x315b14))[_0x7bda('0x45')](handleError(_0x3877b8,null));};exports[_0x7bda('0x46')]=function(_0x3b7fae,_0x2d2f4b){var _0xcae58={'raw':![],'where':{'id':_0x3b7fae[_0x7bda('0x47')]['id']}},_0xc6c9af={};_0xc6c9af[_0x7bda('0x2e')]=_[_0x7bda('0x30')](db[_0x7bda('0x2a')][_0x7bda('0x48')]);_0xc6c9af[_0x7bda('0x2f')]=_[_0x7bda('0x30')](_0x3b7fae[_0x7bda('0x2f')]);_0xc6c9af[_0x7bda('0x3b')]=_[_0x7bda('0x31')](_0xc6c9af[_0x7bda('0x2e')],_0xc6c9af[_0x7bda('0x2f')]);_0xcae58['attributes']=_[_0x7bda('0x31')](_0xc6c9af[_0x7bda('0x2e')],qs['fields'](_0x3b7fae['query']['fields']));_0xcae58['attributes']=_0xcae58[_0x7bda('0x33')][_0x7bda('0x34')]?_0xcae58['attributes']:_0xc6c9af['model'];if(_0x3b7fae['query'][_0x7bda('0x41')]){_0xcae58[_0x7bda('0x42')]=[{'all':!![]}];}_0xcae58=_[_0x7bda('0x3e')]({},_0xcae58,_0x3b7fae[_0x7bda('0x40')]);return db[_0x7bda('0x2a')]['find'](_0xcae58)[_0x7bda('0x22')](handleEntityNotFound(_0x2d2f4b,null))[_0x7bda('0x22')](respondWithResult(_0x2d2f4b,null))[_0x7bda('0x45')](handleError(_0x2d2f4b,null));};exports[_0x7bda('0x49')]=function(_0x53b3c6,_0x3f309d){return db['VoiceRecording'][_0x7bda('0x49')](_0x53b3c6[_0x7bda('0x4a')],{})[_0x7bda('0x22')](respondWithResult(_0x3f309d,0xc9))['catch'](handleError(_0x3f309d,null));};exports[_0x7bda('0x21')]=function(_0x2c8cc1,_0x3e4823){if(_0x2c8cc1[_0x7bda('0x4a')]['id']){delete _0x2c8cc1[_0x7bda('0x4a')]['id'];}return db['VoiceRecording'][_0x7bda('0x4b')]({'where':{'id':_0x2c8cc1['params']['id']}})[_0x7bda('0x22')](handleEntityNotFound(_0x3e4823,null))[_0x7bda('0x22')](saveUpdates(_0x2c8cc1[_0x7bda('0x4a')],null))['then'](respondWithResult(_0x3e4823,null))[_0x7bda('0x45')](handleError(_0x3e4823,null));};exports['describe']=function(_0x2b06d3,_0x58d2e5){return db[_0x7bda('0x2a')][_0x7bda('0x4c')]()[_0x7bda('0x22')](respondWithResult(_0x58d2e5,null))['catch'](handleError(_0x58d2e5,null));};exports[_0x7bda('0x4d')]=function(_0x362e36,_0x145ec3,_0xd85c33){var _0x5b296c=require(_0x7bda('0x4e'));var _0x32d597=![];var _0x5d6fa1={};if(_0x362e36[_0x7bda('0x2f')][_0x7bda('0x2c')]&&_0x362e36['query'][_0x7bda('0x2c')]===_0x7bda('0x4f')){_0x5d6fa1['uniqueid']=_0x362e36['params']['id'];}else{_0x5d6fa1['id']=_0x362e36[_0x7bda('0x47')]['id'];}return db[_0x7bda('0x2a')]['find']({'where':_0x5d6fa1,'attributes':['id',_0x7bda('0x50')],'raw':!![]})[_0x7bda('0x22')](handleEntityNotFound(_0x145ec3,null))[_0x7bda('0x22')](function(_0x2b47a3){if(_0x2b47a3){var _0xbf388e=_0x2b47a3['value'];var _0x4137e3=util[_0x7bda('0x51')](_0x7bda('0x52'),_0xbf388e);if(fs[_0x7bda('0x53')](_0x4137e3)){_0x32d597=!![];return _0x5b296c[_0x7bda('0x54')](_0x4137e3,_0xbf388e,config[_0x7bda('0x55')][_0x7bda('0x56')])[_0x7bda('0x22')](function(){return _0x2b47a3;});}return _0x2b47a3;}})[_0x7bda('0x22')](function(_0x7c04c1){if(_0x7c04c1){var _0x47182d=_0x7c04c1['value'];if(!fs['existsSync'](_0x47182d)){throw new db[(_0x7bda('0x57'))][(_0x7bda('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x7c04c1['filename']){return _0x145ec3['download'](_0x47182d,_0x7c04c1[_0x7bda('0x59')]+path[_0x7bda('0x5a')](_0x47182d),function(){if(_0x32d597){fs[_0x7bda('0x5b')](_0x47182d);}});}else{return _0x145ec3[_0x7bda('0x4d')](_0x47182d,function(_0x3854a0){if(_0x32d597){fs[_0x7bda('0x5b')](_0x47182d);}});}}})[_0x7bda('0x45')](function(_0x15929b){if(_0x15929b[_0x7bda('0x5c')]===_0x7bda('0x5d')){_0x145ec3[_0x7bda('0x17')](0x194)[_0x7bda('0x28')](_0x7bda('0x5e'));}else{return handleError(_0x145ec3,null);}});};exports[_0x7bda('0x5f')]=function(_0x5093fc,_0x5b24d3,_0x253845){var _0x10bbba=require('../../components/encryptor');var _0x4e2af5=![];var _0x2c6a25={'$and':[db[_0x7bda('0x60')][_0x7bda('0x3a')](db[_0x7bda('0x60')]['fn'](_0x7bda('0x61'),db['sequelize'][_0x7bda('0x62')](_0x7bda('0x4f'))),_0x5093fc[_0x7bda('0x2f')][_0x7bda('0x63')])]};if(_0x5093fc[_0x7bda('0x2f')][_0x7bda('0x2c')]&&_0x5093fc[_0x7bda('0x2f')][_0x7bda('0x2c')]===_0x7bda('0x4f')){_0x2c6a25[_0x7bda('0x64')]['push']({'uniqueid':_0x5093fc[_0x7bda('0x47')]['id']});}else{_0x2c6a25[_0x7bda('0x64')][_0x7bda('0x65')]({'id':_0x5093fc[_0x7bda('0x47')]['id']});}return db[_0x7bda('0x2a')][_0x7bda('0x4b')]({'where':_0x2c6a25,'attributes':['id',_0x7bda('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x5b24d3,null))[_0x7bda('0x22')](function(_0x400d9d){if(_0x400d9d){var _0x2a77e3=util[_0x7bda('0x51')](_0x7bda('0x52'),_0x400d9d['value']);if(fs['existsSync'](_0x2a77e3)){_0x4e2af5=!![];return _0x10bbba[_0x7bda('0x54')](_0x2a77e3,_0x400d9d[_0x7bda('0x50')],config[_0x7bda('0x55')][_0x7bda('0x56')])[_0x7bda('0x22')](function(){return _0x400d9d;});}return _0x400d9d;}})[_0x7bda('0x22')](function(_0x40b24b){if(_0x40b24b){if(!fs[_0x7bda('0x53')](_0x40b24b[_0x7bda('0x50')])){throw new db[(_0x7bda('0x57'))][(_0x7bda('0x58'))]('VoiceRecording\x20not\x20found');}if(_0x40b24b['filename']){return _0x5b24d3[_0x7bda('0x4d')](_0x40b24b['value'],_0x40b24b[_0x7bda('0x59')]+path[_0x7bda('0x5a')](_0x40b24b[_0x7bda('0x50')]),function(){if(_0x4e2af5){fs[_0x7bda('0x5b')](_0x40b24b[_0x7bda('0x50')]);}});}else{return _0x5b24d3[_0x7bda('0x4d')](_0x40b24b[_0x7bda('0x50')],function(_0x1276b7){if(_0x4e2af5){fs[_0x7bda('0x5b')](_0x40b24b[_0x7bda('0x50')]);}});}}})['catch'](handleError(_0x5b24d3,null));};exports['destroy']=function(_0x3e5e82,_0xd4d491){return db[_0x7bda('0x2a')][_0x7bda('0x4b')]({'where':{'id':_0x3e5e82['params']['id']}})[_0x7bda('0x22')](function(_0xc21917){if(_[_0x7bda('0x66')](_0xc21917)){throw new ReferenceError('Entity\x20not\x20found');}return _0xc21917;})[_0x7bda('0x22')](function(_0x5c8d22){var _0x1d6e50=_0x5c8d22[_0x7bda('0x50')];logger[_0x7bda('0x67')]('cancellazione\x20fisica\x20documento\x20%s',_0x1d6e50);if(!_['isNil'](_0x5c8d22[_0x7bda('0x50')])&&fs[_0x7bda('0x53')](_0x1d6e50)){logger['info'](_0x7bda('0x68')+_0x1d6e50+_0x7bda('0x69'));fs['unlinkSync'](_0x1d6e50);}_0x1d6e50=_0x1d6e50+_0x7bda('0x6a');if(!_['isNil'](_0x5c8d22[_0x7bda('0x50')])&&fs[_0x7bda('0x53')](_0x1d6e50)){logger[_0x7bda('0x67')](_0x7bda('0x68')+_0x1d6e50+_0x7bda('0x69'));fs[_0x7bda('0x6b')](_0x1d6e50);}return _0x5c8d22;})[_0x7bda('0x22')](function(_0x4b36ba){if(!_0x4b36ba)throw new InternalError();return _0x4b36ba[_0x7bda('0x6c')]();})[_0x7bda('0x22')](function(){_0xd4d491['status'](0xcc)[_0x7bda('0x23')]();})['catch'](handleError(_0xd4d491,null));};function getBucketslist(_0x4c9c0c,_0x3b40a9,_0x562dc7){return new Promise(function(_0x124e33,_0x455024){var _0x162b0f=new AWS['S3']({'accessKeyId':_0x3b40a9,'secretAccessKey':_0x4c9c0c,'region':_0x562dc7});_0x162b0f[_0x7bda('0x6d')]({},function(_0x489bf9,_0x5575c1){if(_0x489bf9){return _0x455024(_0x489bf9);}else{return _0x124e33(_0x5575c1);}});});}function createBucket(_0x2b19e5,_0x52f332,_0x1e9b15,_0x58cfd9){return new Promise(function(_0x417a89,_0x321992){var _0x54ea0d=new AWS['S3']({'accessKeyId':_0x52f332,'secretAccessKey':_0x2b19e5,'region':_0x1e9b15});_0x54ea0d['createBucket']({'Bucket':_0x58cfd9},function(_0x48e625,_0x3be874){if(_0x48e625){return _0x321992(_0x48e625);}else{return _0x417a89(_0x3be874);}});});}function uploadFile(_0x418dd7,_0x1b8bcc,_0x24ab36,_0xd640ad,_0x42f263,_0x4f4c79){return new Promise(function(_0x3249f1,_0x128347){var _0x4694d4=new AWS['S3']({'accessKeyId':_0x1b8bcc,'secretAccessKey':_0x418dd7,'region':_0x24ab36});_0x4694d4['upload']({'Bucket':_0xd640ad,'Key':_0x42f263,'Body':_0x4f4c79},function(_0x270a44,_0xf50405){if(_0x270a44){return _0x128347(_0x270a44);}else{return _0x3249f1(_0xf50405);}});});}function startTranscribe(_0x40528b,_0x2796df,_0x1df100,_0x4dfaed,_0xbd6655,_0x2a5b30){return new Promise(function(_0x2fcb22,_0x20dad8){var _0x5234e4=new AWS[(_0x7bda('0x6e'))]({'accessKeyId':_0x2796df,'secretAccessKey':_0x40528b,'region':_0x1df100});_0x5234e4[_0x7bda('0x6f')]({'TranscriptionJobName':_0x4dfaed,'LanguageCode':_0xbd6655,'Media':{'MediaFileUri':_0x2a5b30}},function(_0x395fe4,_0x182cc2){if(_0x395fe4){return _0x20dad8(_0x395fe4);}else{return _0x2fcb22(_0x182cc2);}});});}function transcribe(_0x2cd7d2,_0x5972c9,_0x2554c8,_0xa20176,_0x21636c,_0x2dc347,_0x5cfa4b){return new Promise(function(_0x239713,_0x5065b4){var _0x2369f5={};logger['info'](util[_0x7bda('0x51')](_0x7bda('0x70'),_0x2cd7d2,_0x21636c));return uploadFile(_0x5972c9,_0x2554c8,_0xa20176,_0x21636c,path[_0x7bda('0x71')](_0x2dc347),fs['readFileSync'](_0x2dc347))[_0x7bda('0x22')](function(_0x411914){logger[_0x7bda('0x67')](util[_0x7bda('0x51')](_0x7bda('0x72'),_0x2cd7d2,_0x21636c,_0x411914['Location']));_0x2369f5[_0x7bda('0x73')]=_0x411914[_0x7bda('0x74')];_0x2369f5[_0x7bda('0x75')]=_0x411914['Location'];logger['info'](util[_0x7bda('0x51')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x2cd7d2));return startTranscribe(_0x5972c9,_0x2554c8,_0xa20176,uuidv4(),_0x5cfa4b,_0x411914['Location']);})[_0x7bda('0x22')](function(_0x499961){logger[_0x7bda('0x67')](util[_0x7bda('0x51')](_0x7bda('0x76'),_0x2cd7d2,_0x499961[_0x7bda('0x77')][_0x7bda('0x78')]));_0x2369f5[_0x7bda('0x79')]=_0x499961[_0x7bda('0x77')]['TranscriptionJobName'];_0x2369f5[_0x7bda('0x7a')]=_0x499961[_0x7bda('0x77')][_0x7bda('0x7b')];return _0x239713(_0x2369f5);})['catch'](function(_0x34ccb2){return _0x5065b4(_0x34ccb2);});});}exports['runTranscribe']=function(_0x189b0d,_0x2e5e82,_0x59fcc9){var _0x29d1a8;var _0x16612d;var _0x1614df;var _0x3c49de=require(_0x7bda('0x4e'));return db[_0x7bda('0x2a')][_0x7bda('0x7c')]({'where':{'id':_0x189b0d[_0x7bda('0x47')]['id']}})['then'](function(_0x278a01){if(_0x278a01){var _0x3c871f=util['format'](_0x7bda('0x52'),_0x278a01[_0x7bda('0x50')]);if(fs[_0x7bda('0x53')](_0x3c871f)){cypher=!![];return _0x3c49de['decryptFile'](_0x3c871f,_0x278a01[_0x7bda('0x50')],config[_0x7bda('0x55')][_0x7bda('0x56')])[_0x7bda('0x22')](function(){return _0x278a01;});}return _0x278a01;}})[_0x7bda('0x22')](function(_0x2f8527){if(!_0x2f8527){throw new db[(_0x7bda('0x57'))][(_0x7bda('0x58'))](_0x7bda('0x7d'));}_0x16612d=_0x2f8527;return db[_0x7bda('0x7e')][_0x7bda('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2e5e82,null))[_0x7bda('0x22')](function(_0x4820fa){if(_0x4820fa){_0x29d1a8=_0x4820fa;if(!_0x29d1a8['transcribe']||!_0x29d1a8['transcribeAccountId']||!_0x29d1a8[_0x7bda('0x7f')]||!_0x29d1a8[_0x7bda('0x80')]||!_0x29d1a8[_0x7bda('0x73')]){throw new db['Sequelize'][(_0x7bda('0x58'))](_0x7bda('0x81'));}if(_0x189b0d['body'][_0x7bda('0x82')]&&(!_0x29d1a8[_0x7bda('0x83')]||!_0x29d1a8[_0x7bda('0x84')]||!_0x29d1a8[_0x7bda('0x85')]||!_0x29d1a8[_0x7bda('0x80')]||!_0x29d1a8[_0x7bda('0x73')])){throw new db[(_0x7bda('0x57'))]['ValidationError'](_0x7bda('0x86'));}return db[_0x7bda('0x87')]['findOne']({'where':{'id':_0x29d1a8[_0x7bda('0x88')]}});}})['then'](function(_0x4fcb7d){if(!_0x4fcb7d){throw new db[(_0x7bda('0x57'))]['ValidationError'](_0x7bda('0x89'));}if(!_0x4fcb7d[_0x7bda('0x8a')]||!_0x4fcb7d[_0x7bda('0x8b')]){throw new db['Sequelize'][(_0x7bda('0x58'))]('Cloud\x20Provider\x20not\x20configured');}_0x1614df=_0x4fcb7d;return getBucketslist(_0x1614df[_0x7bda('0x8a')],_0x1614df[_0x7bda('0x8b')],_0x29d1a8['transcribeRegion']);})[_0x7bda('0x22')](function(_0x49d795){if(_0x49d795&&_0x49d795['Buckets']){var _0x236dd4=_['find'](_0x49d795[_0x7bda('0x8c')],function(_0x3c445d){return _0x3c445d[_0x7bda('0x8d')]===_0x29d1a8['bucket'];});if(!_0x236dd4){logger[_0x7bda('0x67')](util[_0x7bda('0x51')](_0x7bda('0x8e'),_0x189b0d[_0x7bda('0x47')]['id'],_0x29d1a8[_0x7bda('0x73')]));return createBucket(_0x1614df[_0x7bda('0x8a')],_0x1614df['data2'],_0x29d1a8['transcribeRegion'],_0x29d1a8[_0x7bda('0x73')]);}logger[_0x7bda('0x67')](util[_0x7bda('0x51')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x189b0d['params']['id'],_0x29d1a8[_0x7bda('0x73')]));return;}})[_0x7bda('0x22')](function(_0x4a80c7){if(_0x16612d[_0x7bda('0x7a')]==='NEW'){return transcribe(_0x189b0d[_0x7bda('0x47')]['id'],_0x1614df[_0x7bda('0x8a')],_0x1614df[_0x7bda('0x8b')],_0x29d1a8[_0x7bda('0x7f')],_0x29d1a8[_0x7bda('0x73')],_0x16612d[_0x7bda('0x50')],_0x29d1a8[_0x7bda('0x80')]);}else{logger[_0x7bda('0x67')](util['format'](_0x7bda('0x8f'),_0x189b0d[_0x7bda('0x47')]['id']));return{'transcribeStatus':_0x7bda('0x90')};}})[_0x7bda('0x22')](function(_0x3ba375){if(_0x3ba375){_0x3ba375[_0x7bda('0x91')]=_0x189b0d[_0x7bda('0x4a')]['runSentiment'];return _0x16612d['updateAttributes'](_0x3ba375);}})[_0x7bda('0x22')](respondWithResult(_0x2e5e82,null))[_0x7bda('0x45')](handleError(_0x2e5e82,null));};function writeFile(_0x3a8975,_0x2af4c0){return new Promise(function(_0x113c6d,_0x21f70c){fs['writeFile'](_0x2af4c0,_0x3a8975,function(_0x7718ca,_0x17e4fa){if(_0x7718ca){return _0x21f70c(_0x7718ca);}else{return _0x113c6d(_0x17e4fa);}});});}exports['downloadTranscribe']=function(_0x4ed235,_0x4ebae6,_0x35efd0){return db[_0x7bda('0x2a')][_0x7bda('0x7c')]({'where':{'id':_0x4ed235[_0x7bda('0x47')]['id']}})[_0x7bda('0x22')](handleEntityNotFound(_0x4ebae6))['then'](function(_0x426374){if(_0x426374&&_0x426374['fileText']){var _0x543b42=_0x426374['fileText'];var _0x5bcbc7=config[_0x7bda('0x92')]+_0x7bda('0x93')+_0x426374['id']+_0x7bda('0x94');if(fs[_0x7bda('0x53')](_0x5bcbc7)){return _0x5bcbc7;}return writeFile(_0x543b42,_0x5bcbc7)[_0x7bda('0x22')](function(){return _0x5bcbc7;});}else{throw new db['Sequelize'][(_0x7bda('0x58'))](_0x7bda('0x95'));}})[_0x7bda('0x22')](function(_0x42aceb){return _0x4ebae6[_0x7bda('0x4d')](_0x42aceb);})[_0x7bda('0x45')](handleError(_0x4ebae6));};
\ No newline at end of file
index 14ec1b6..47f058b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ef1=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x4fc79a,_0x1fd4e2){var _0x216ba5=function(_0x18848c){while(--_0x18848c){_0x4fc79a['push'](_0x4fc79a['shift']());}};_0x216ba5(++_0x1fd4e2);}(_0x4ef1,0xeb));var _0x14ef=function(_0x17e2ac,_0x51a8c5){_0x17e2ac=_0x17e2ac-0x0;var _0x44d3e9=_0x4ef1[_0x17e2ac];return _0x44d3e9;};'use strict';var attributes=require(_0x14ef('0x0'));module[_0x14ef('0x1')]=function(_0x52e89c,_0x4136b4){return _0x52e89c[_0x14ef('0x2')](_0x14ef('0x3'),attributes,{'tableName':_0x14ef('0x4'),'paranoid':![],'indexes':[{'name':_0x14ef('0x5'),'fields':[_0x14ef('0x5')]},{'name':_0x14ef('0x6'),'fields':[_0x14ef('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8d97=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','exports','define'];(function(_0x2f7e15,_0x6e0949){var _0xbf1bf1=function(_0x538ea3){while(--_0x538ea3){_0x2f7e15['push'](_0x2f7e15['shift']());}};_0xbf1bf1(++_0x6e0949);}(_0x8d97,0x82));var _0x78d9=function(_0x1d042f,_0x883c50){_0x1d042f=_0x1d042f-0x0;var _0x1fa617=_0x8d97[_0x1d042f];return _0x1fa617;};'use strict';var attributes=require('./voiceRecording.attributes');module[_0x78d9('0x0')]=function(_0x288fbe,_0x54c125){return _0x288fbe[_0x78d9('0x1')](_0x78d9('0x2'),attributes,{'tableName':_0x78d9('0x3'),'paranoid':![],'indexes':[{'name':_0x78d9('0x4'),'fields':[_0x78d9('0x4')]},{'name':'transcribeStatus','fields':[_0x78d9('0x5')]}],'timestamps':!![]});};
\ No newline at end of file
index 674ddc5..1c5d6b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd824=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','then','debug','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','CreateVoiceRecording\x20file\x20encrypted','lodash'];(function(_0x1617ac,_0x23a705){var _0x4a2c62=function(_0x5f584f){while(--_0x5f584f){_0x1617ac['push'](_0x1617ac['shift']());}};_0x4a2c62(++_0x23a705);}(_0xd824,0xc2));var _0x4d82=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd824[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b842f,_0x464caf,_0xb54db2){return new BPromise(function(_0x13d624,_0x5cccb6){return client[_0x4d82('0x9')](_0x4b842f,_0xb54db2)['then'](function(_0x5356cd){logger[_0x4d82('0xa')](_0x4d82('0xb'),_0x464caf,_0x4d82('0xc'));logger['debug'](_0x4d82('0xd'),_0x464caf,'request\x20sent',JSON[_0x4d82('0xe')](_0x5356cd));if(_0x5356cd[_0x4d82('0xf')]){if(_0x5356cd[_0x4d82('0xf')]['code']===0x1f4){logger['error'](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')][_0x4d82('0x10')]);return _0x5cccb6(_0x5356cd[_0x4d82('0xf')]['message']);}logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x5356cd[_0x4d82('0xf')]['message']);return _0x13d624(_0x5356cd[_0x4d82('0xf')]['message']);}else{logger[_0x4d82('0xa')]('VoiceRecording,\x20%s,\x20%s',_0x464caf,_0x4d82('0xc'));_0x13d624(_0x5356cd['result'][_0x4d82('0x10')]);}})[_0x4d82('0x11')](function(_0x461476){logger[_0x4d82('0xf')](_0x4d82('0xb'),_0x464caf,_0x461476);_0x5cccb6(_0x461476);});});}exports[_0x4d82('0x12')]=function(_0x258c59){var _0x217b72=this;return new Promise(function(_0x2f2127,_0x5ef783){return db[_0x4d82('0x13')][_0x4d82('0x14')](_0x258c59[_0x4d82('0x15')],{'raw':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')][_0x4d82('0x18')]||null:null,'attributes':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['attributes']||null:null,'limit':_0x258c59[_0x4d82('0x16')]?_0x258c59[_0x4d82('0x16')]['limit']||null:null})[_0x4d82('0x19')](function(_0x41f194){logger[_0x4d82('0xa')](_0x4d82('0x12'),_0x258c59);logger[_0x4d82('0x1a')](_0x4d82('0x12'),_0x258c59,JSON[_0x4d82('0xe')](_0x41f194));_0x2f2127(_0x41f194);})[_0x4d82('0x11')](function(_0x12feab){logger[_0x4d82('0xf')](_0x4d82('0x12'),_0x12feab[_0x4d82('0x10')],_0x258c59);_0x5ef783(_0x217b72[_0x4d82('0xf')](0x1f4,_0x12feab[_0x4d82('0x10')]));});});};exports[_0x4d82('0x1b')]=function(_0x4af6da){var _0x5e0b03=this;return new Promise(function(_0x3dcb0f,_0x2548de){var _0x2a0572=require(_0x4d82('0x1c'));var _0x5cbd7e;return db[_0x4d82('0x1d')][_0x4d82('0x1e')]({'attributes':['id',_0x4d82('0x1f')],'where':{'id':0x1},'raw':!![]})[_0x4d82('0x19')](function(_0x5ce98b){_0x5cbd7e=_0x5ce98b;return db[_0x4d82('0x13')]['create'](_0x4af6da['body']);})['then'](function(_0x52533b){if(_0x5cbd7e[_0x4d82('0x1f')]&&fs[_0x4d82('0x20')](_0x52533b[_0x4d82('0x21')])){var _0x52e320=util[_0x4d82('0x22')](_0x4d82('0x23'),_0x52533b['value']);return _0x2a0572['encryptFile'](_0x52533b[_0x4d82('0x21')],_0x52e320,config[_0x4d82('0x24')][_0x4d82('0x25')])[_0x4d82('0x19')](function(){fs['unlink'](_0x52533b[_0x4d82('0x21')]);logger['info'](_0x4d82('0x26'));return _0x52533b;});}return _0x52533b;})[_0x4d82('0x19')](function(_0x4a2a45){logger['info'](_0x4d82('0x1b'),_0x4af6da);logger[_0x4d82('0x1a')](_0x4d82('0x1b'),_0x4af6da,JSON[_0x4d82('0xe')](_0x4a2a45));_0x3dcb0f(_0x4a2a45);})[_0x4d82('0x11')](function(_0x420b28){logger[_0x4d82('0xf')](_0x4d82('0x1b'),_0x420b28[_0x4d82('0x10')],_0x4af6da);_0x2548de(_0x5e0b03[_0x4d82('0xf')](0x1f4,_0x420b28['message']));});});};
\ No newline at end of file
+var _0xbff5=['catch','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','%s.cypher','encryptFile','value','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','update','options','raw','where','attributes','then','UpdateVoiceRecording','debug'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0xbff5,0x1bc));var _0x5bff=function(_0x3771eb,_0x2ee089){_0x3771eb=_0x3771eb-0x0;var _0x1c562d=_0xbff5[_0x3771eb];return _0x1c562d;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var moment=require(_0x5bff('0x2'));var BPromise=require(_0x5bff('0x3'));var rs=require(_0x5bff('0x4'));var fs=require('fs');var Redis=require(_0x5bff('0x5'));var db=require(_0x5bff('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bff('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5bff('0x8'));var client=jayson[_0x5bff('0x9')][_0x5bff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa54c57,_0x43605a,_0xd4b9dc){return new BPromise(function(_0x1acb49,_0x139c99){return client[_0x5bff('0xb')](_0xa54c57,_0xd4b9dc)['then'](function(_0x20e26f){logger['info'](_0x5bff('0xc'),_0x43605a,_0x5bff('0xd'));logger['debug'](_0x5bff('0xe'),_0x43605a,'request\x20sent',JSON[_0x5bff('0xf')](_0x20e26f));if(_0x20e26f['error']){if(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x11')]===0x1f4){logger['error'](_0x5bff('0xc'),_0x43605a,_0x20e26f['error'][_0x5bff('0x12')]);return _0x139c99(_0x20e26f[_0x5bff('0x10')]['message']);}logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x20e26f['error']['message']);return _0x1acb49(_0x20e26f[_0x5bff('0x10')][_0x5bff('0x12')]);}else{logger[_0x5bff('0x13')]('VoiceRecording,\x20%s,\x20%s',_0x43605a,_0x5bff('0xd'));_0x1acb49(_0x20e26f[_0x5bff('0x14')][_0x5bff('0x12')]);}})['catch'](function(_0x3ffbbc){logger[_0x5bff('0x10')](_0x5bff('0xc'),_0x43605a,_0x3ffbbc);_0x139c99(_0x3ffbbc);});});}exports['UpdateVoiceRecording']=function(_0xc9fbc3){var _0x279c22=this;return new Promise(function(_0x36653b,_0x32cf60){return db['VoiceRecording'][_0x5bff('0x15')](_0xc9fbc3['body'],{'raw':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3['options'][_0x5bff('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x18')]||null:null,'attributes':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')][_0x5bff('0x19')]||null:null,'limit':_0xc9fbc3[_0x5bff('0x16')]?_0xc9fbc3[_0x5bff('0x16')]['limit']||null:null})[_0x5bff('0x1a')](function(_0x263cf5){logger[_0x5bff('0x13')](_0x5bff('0x1b'),_0xc9fbc3);logger[_0x5bff('0x1c')](_0x5bff('0x1b'),_0xc9fbc3,JSON[_0x5bff('0xf')](_0x263cf5));_0x36653b(_0x263cf5);})[_0x5bff('0x1d')](function(_0x5e2ae8){logger['error'](_0x5bff('0x1b'),_0x5e2ae8['message'],_0xc9fbc3);_0x32cf60(_0x279c22[_0x5bff('0x10')](0x1f4,_0x5e2ae8[_0x5bff('0x12')]));});});};exports[_0x5bff('0x1e')]=function(_0x6f18f1){var _0xfa361d=this;return new Promise(function(_0x1140eb,_0x271f3c){var _0xedba9d=require('../../components/encryptor');var _0x4df57a;return db[_0x5bff('0x1f')][_0x5bff('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x5bff('0x1a')](function(_0x588078){_0x4df57a=_0x588078;return db['VoiceRecording'][_0x5bff('0x21')](_0x6f18f1['body']);})[_0x5bff('0x1a')](function(_0x64e22){if(_0x4df57a[_0x5bff('0x22')]&&fs[_0x5bff('0x23')](_0x64e22['value'])){var _0x71783=util['format'](_0x5bff('0x24'),_0x64e22['value']);return _0xedba9d[_0x5bff('0x25')](_0x64e22[_0x5bff('0x26')],_0x71783,config[_0x5bff('0x27')][_0x5bff('0x28')])[_0x5bff('0x1a')](function(){fs[_0x5bff('0x29')](_0x64e22['value']);logger[_0x5bff('0x13')](_0x5bff('0x2a'));return _0x64e22;});}return _0x64e22;})[_0x5bff('0x1a')](function(_0x42fe4a){logger[_0x5bff('0x13')](_0x5bff('0x1e'),_0x6f18f1);logger[_0x5bff('0x1c')](_0x5bff('0x1e'),_0x6f18f1,JSON['stringify'](_0x42fe4a));_0x1140eb(_0x42fe4a);})[_0x5bff('0x1d')](function(_0x16042d){logger[_0x5bff('0x10')](_0x5bff('0x1e'),_0x16042d['message'],_0x6f18f1);_0x271f3c(_0xfa361d[_0x5bff('0x10')](0x1f4,_0x16042d[_0x5bff('0x12')]));});});};
\ No newline at end of file
index f88c3d8..63be0ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x546480,_0x39ec7c){var _0x2a8525=function(_0x2de2f8){while(--_0x2de2f8){_0x546480['push'](_0x546480['shift']());}};_0x2a8525(++_0x39ec7c);}(_0x1ae9,0x85));var _0x91ae=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x1ae9[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0x91ae('0x0'));var util=require(_0x91ae('0x1'));var path=require(_0x91ae('0x2'));var timeout=require(_0x91ae('0x3'));var express=require(_0x91ae('0x4'));var router=express[_0x91ae('0x5')]();var fs_extra=require(_0x91ae('0x6'));var auth=require(_0x91ae('0x7'));var interaction=require(_0x91ae('0x8'));var config=require(_0x91ae('0x9'));var controller=require(_0x91ae('0xa'));router['get']('/',auth[_0x91ae('0xb')](),controller[_0x91ae('0xc')]);router[_0x91ae('0xd')](_0x91ae('0xe'),auth[_0x91ae('0xb')](),controller[_0x91ae('0xf')]);router['get']('/:id',auth[_0x91ae('0xb')](),controller['show']);router[_0x91ae('0x10')]('/',auth[_0x91ae('0xb')](),controller[_0x91ae('0x11')]);router[_0x91ae('0x12')](_0x91ae('0x13'),auth['isAuthenticated'](),controller[_0x91ae('0x14')]);router[_0x91ae('0x15')]('/:id',auth[_0x91ae('0xb')](),controller[_0x91ae('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xd602=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xd602,0x126));var _0x2d60=function(_0x5baa46,_0xee7c7f){_0x5baa46=_0x5baa46-0x0;var _0x137bf7=_0xd602[_0x5baa46];return _0x137bf7;};'use strict';var multer=require(_0x2d60('0x0'));var util=require(_0x2d60('0x1'));var path=require(_0x2d60('0x2'));var timeout=require(_0x2d60('0x3'));var express=require(_0x2d60('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2d60('0x5'));var interaction=require(_0x2d60('0x6'));var config=require(_0x2d60('0x7'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2d60('0x8')]);router[_0x2d60('0x9')](_0x2d60('0xa'),auth[_0x2d60('0xb')](),controller[_0x2d60('0xc')]);router['get'](_0x2d60('0xd'),auth[_0x2d60('0xb')](),controller[_0x2d60('0xe')]);router['post']('/',auth[_0x2d60('0xb')](),controller[_0x2d60('0xf')]);router[_0x2d60('0x10')](_0x2d60('0xd'),auth[_0x2d60('0xb')](),controller[_0x2d60('0x11')]);router[_0x2d60('0x12')]('/:id',auth[_0x2d60('0xb')](),controller['destroy']);module[_0x2d60('0x13')]=router;
\ No newline at end of file
index f734eeb..7e51f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6df4=['STRING','Yes','sequelize','exports','ENUM','blind'];(function(_0x456e8e,_0x1977b3){var _0x56312f=function(_0x338ff2){while(--_0x338ff2){_0x456e8e['push'](_0x456e8e['shift']());}};_0x56312f(++_0x1977b3);}(_0x6df4,0x17c));var _0x46df=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x6df4[_0x1ebe90];return _0x447c82;};'use strict';var Sequelize=require(_0x46df('0x0'));var moment=require('moment');module[_0x46df('0x1')]={'type':{'type':Sequelize[_0x46df('0x2')](_0x46df('0x3'),'attended')},'result':{'type':Sequelize[_0x46df('0x4')]},'transfererchannel':{'type':Sequelize[_0x46df('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x46df('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x46df('0x4')]},'transfererexten':{'type':Sequelize[_0x46df('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x46df('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize[_0x46df('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x46df('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x46df('0x4')]},'isexternal':{'type':Sequelize[_0x46df('0x2')](_0x46df('0x5'),'No')},'context':{'type':Sequelize[_0x46df('0x4')]},'extension':{'type':Sequelize[_0x46df('0x4')]}};
\ No newline at end of file
+var _0x2a7e=['attended','STRING','moment','exports','ENUM','blind'];(function(_0x4a8c64,_0x4b2df3){var _0x570e8b=function(_0x4dc5ae){while(--_0x4dc5ae){_0x4a8c64['push'](_0x4a8c64['shift']());}};_0x570e8b(++_0x4b2df3);}(_0x2a7e,0x1d6));var _0xe2a7=function(_0x2b5d75,_0x12888c){_0x2b5d75=_0x2b5d75-0x0;var _0x446bb2=_0x2a7e[_0x2b5d75];return _0x446bb2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe2a7('0x0'));module[_0xe2a7('0x1')]={'type':{'type':Sequelize[_0xe2a7('0x2')](_0xe2a7('0x3'),_0xe2a7('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xe2a7('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xe2a7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xe2a7('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0xe2a7('0x5')]},'transfereraccountcode':{'type':Sequelize[_0xe2a7('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xe2a7('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xe2a7('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xe2a7('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xe2a7('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xe2a7('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xe2a7('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xe2a7('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe2a7('0x5')]}};
\ No newline at end of file
index e7b9d34..d92f8dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4e0=['stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','undefined','count','offset','Content-Range','json','reject','save','update','then','destroy','error'];(function(_0x7432bf,_0x404eed){var _0x13c79e=function(_0x55676c){while(--_0x55676c){_0x7432bf['push'](_0x7432bf['shift']());}};_0x13c79e(++_0x404eed);}(_0xf4e0,0x158));var _0x0f4e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf4e0[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x0f4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0f4e('0x1'));var jsonpatch=require(_0x0f4e('0x2'));var rp=require(_0x0f4e('0x3'));var moment=require(_0x0f4e('0x4'));var BPromise=require(_0x0f4e('0x5'));var Mustache=require(_0x0f4e('0x6'));var util=require(_0x0f4e('0x7'));var path=require(_0x0f4e('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f4e('0x9'));var squel=require(_0x0f4e('0xa'));var crypto=require(_0x0f4e('0xb'));var jsforce=require(_0x0f4e('0xc'));var deskjs=require(_0x0f4e('0xd'));var toCsv=require(_0x0f4e('0xe'));var querystring=require(_0x0f4e('0xf'));var Papa=require(_0x0f4e('0x10'));var Redis=require(_0x0f4e('0x11'));var authService=require(_0x0f4e('0x12'));var qs=require(_0x0f4e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f4e('0x14'));var logger=require(_0x0f4e('0x15'))(_0x0f4e('0x16'));var utils=require(_0x0f4e('0x17'));var config=require(_0x0f4e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f4e('0x19'))['db'];function respondWithStatusCode(_0x2e7c5a,_0x6d41e7){_0x6d41e7=_0x6d41e7||0xcc;return function(_0x211d1b){if(_0x211d1b){return _0x2e7c5a[_0x0f4e('0x1a')](_0x6d41e7);}return _0x2e7c5a['status'](_0x6d41e7)[_0x0f4e('0x1b')]();};}function respondWithResult(_0x33e55f,_0x367d03){_0x367d03=_0x367d03||0xc8;return function(_0x1dcf74){if(_0x1dcf74){return _0x33e55f[_0x0f4e('0x1c')](_0x367d03)['json'](_0x1dcf74);}};}function respondWithFilteredResult(_0x483815,_0x489f89){return function(_0x1c4af7){if(_0x1c4af7){var _0x3f6ae8=typeof _0x489f89['offset']==='undefined'&&typeof _0x489f89[_0x0f4e('0x1d')]===_0x0f4e('0x1e');var _0x15c0d1=_0x1c4af7[_0x0f4e('0x1f')];var _0x1b32d0=_0x3f6ae8?0x0:_0x489f89[_0x0f4e('0x20')];var _0x475227=_0x3f6ae8?_0x1c4af7[_0x0f4e('0x1f')]:_0x489f89[_0x0f4e('0x20')]+_0x489f89[_0x0f4e('0x1d')];var _0x4d4305;if(_0x475227>=_0x15c0d1){_0x475227=_0x15c0d1;_0x4d4305=0xc8;}else{_0x4d4305=0xce;}_0x483815['status'](_0x4d4305);return _0x483815['set'](_0x0f4e('0x21'),_0x1b32d0+'-'+_0x475227+'/'+_0x15c0d1)[_0x0f4e('0x22')](_0x1c4af7);}return null;};}function patchUpdates(_0x315a02){return function(_0x4e57f6){try{jsonpatch['apply'](_0x4e57f6,_0x315a02,!![]);}catch(_0x20b84e){return BPromise[_0x0f4e('0x23')](_0x20b84e);}return _0x4e57f6[_0x0f4e('0x24')]();};}function saveUpdates(_0x3654bc,_0x2e4b99){return function(_0x198cf7){if(_0x198cf7){return _0x198cf7[_0x0f4e('0x25')](_0x3654bc)[_0x0f4e('0x26')](function(_0x29f69e){return _0x29f69e;});}return null;};}function removeEntity(_0x263ff4,_0x36fd40){return function(_0x195337){if(_0x195337){return _0x195337[_0x0f4e('0x27')]()[_0x0f4e('0x26')](function(){_0x263ff4['status'](0xcc)[_0x0f4e('0x1b')]();});}};}function handleEntityNotFound(_0x1abf59,_0x4e3531){return function(_0xca3c54){if(!_0xca3c54){_0x1abf59[_0x0f4e('0x1a')](0x194);}return _0xca3c54;};}function handleError(_0x3b9dc8,_0x1a5d97){_0x1a5d97=_0x1a5d97||0x1f4;return function(_0x3c125d){logger[_0x0f4e('0x28')](_0x3c125d[_0x0f4e('0x29')]);if(_0x3c125d[_0x0f4e('0x2a')]){delete _0x3c125d['name'];}_0x3b9dc8[_0x0f4e('0x1c')](_0x1a5d97)[_0x0f4e('0x2b')](_0x3c125d);};}exports[_0x0f4e('0x2c')]=function(_0x5759a3,_0x3f3939){var _0x48e8cf={},_0x27b288={},_0x599f18={'count':0x0,'rows':[]};var _0x1c2686=_[_0x0f4e('0x2d')](db[_0x0f4e('0x2e')][_0x0f4e('0x2f')],function(_0x4ccf21){return{'name':_0x4ccf21[_0x0f4e('0x30')],'type':_0x4ccf21[_0x0f4e('0x31')][_0x0f4e('0x32')]};});_0x27b288[_0x0f4e('0x33')]=_[_0x0f4e('0x2d')](_0x1c2686,_0x0f4e('0x2a'));_0x27b288['query']=_[_0x0f4e('0x34')](_0x5759a3[_0x0f4e('0x35')]);_0x27b288[_0x0f4e('0x36')]=_[_0x0f4e('0x37')](_0x27b288[_0x0f4e('0x33')],_0x27b288[_0x0f4e('0x35')]);_0x48e8cf[_0x0f4e('0x38')]=_[_0x0f4e('0x37')](_0x27b288['model'],qs['fields'](_0x5759a3[_0x0f4e('0x35')]['fields']));_0x48e8cf[_0x0f4e('0x38')]=_0x48e8cf[_0x0f4e('0x38')][_0x0f4e('0x39')]?_0x48e8cf[_0x0f4e('0x38')]:_0x27b288['model'];if(!_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x3a')](_0x0f4e('0x3b'))){_0x48e8cf[_0x0f4e('0x1d')]=qs[_0x0f4e('0x1d')](_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x1d')]);_0x48e8cf[_0x0f4e('0x20')]=qs['offset'](_0x5759a3['query'][_0x0f4e('0x20')]);}_0x48e8cf['order']=qs[_0x0f4e('0x3c')](_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x3c')]);_0x48e8cf[_0x0f4e('0x3d')]=qs[_0x0f4e('0x36')](_[_0x0f4e('0x3e')](_0x5759a3[_0x0f4e('0x35')],_0x27b288[_0x0f4e('0x36')]),_0x1c2686);if(_0x5759a3['query']['filter']){_0x48e8cf[_0x0f4e('0x3d')]=_[_0x0f4e('0x3f')](_0x48e8cf['where'],{'$or':_[_0x0f4e('0x2d')](_0x1c2686,function(_0x55c634){if(_0x55c634['type']!=='VIRTUAL'){var _0x3b28c0={};_0x3b28c0[_0x55c634[_0x0f4e('0x2a')]]={'$like':'%'+_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x40')]+'%'};return _0x3b28c0;}})});}_0x48e8cf=_[_0x0f4e('0x3f')]({},_0x48e8cf,_0x5759a3[_0x0f4e('0x41')]);var _0x59c90e={'where':_0x48e8cf['where']};return db[_0x0f4e('0x2e')][_0x0f4e('0x1f')](_0x59c90e)[_0x0f4e('0x26')](function(_0x1f9b5a){_0x599f18[_0x0f4e('0x1f')]=_0x1f9b5a;if(_0x5759a3[_0x0f4e('0x35')][_0x0f4e('0x42')]){_0x48e8cf[_0x0f4e('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x0f4e('0x44')](_0x48e8cf);})[_0x0f4e('0x26')](function(_0x3f38d6){_0x599f18['rows']=_0x3f38d6;return _0x599f18;})[_0x0f4e('0x26')](respondWithFilteredResult(_0x3f3939,_0x48e8cf))[_0x0f4e('0x45')](handleError(_0x3f3939,null));};exports[_0x0f4e('0x46')]=function(_0x4ba7b9,_0x27fc65){var _0x332d02={'raw':!![],'where':{'id':_0x4ba7b9[_0x0f4e('0x47')]['id']}},_0x268748={};_0x268748[_0x0f4e('0x33')]=_[_0x0f4e('0x34')](db['VoiceTransferReport'][_0x0f4e('0x2f')]);_0x268748[_0x0f4e('0x35')]=_[_0x0f4e('0x34')](_0x4ba7b9[_0x0f4e('0x35')]);_0x268748['filters']=_[_0x0f4e('0x37')](_0x268748[_0x0f4e('0x33')],_0x268748[_0x0f4e('0x35')]);_0x332d02['attributes']=_[_0x0f4e('0x37')](_0x268748[_0x0f4e('0x33')],qs[_0x0f4e('0x48')](_0x4ba7b9[_0x0f4e('0x35')][_0x0f4e('0x48')]));_0x332d02['attributes']=_0x332d02['attributes'][_0x0f4e('0x39')]?_0x332d02['attributes']:_0x268748['model'];if(_0x4ba7b9[_0x0f4e('0x35')][_0x0f4e('0x42')]){_0x332d02[_0x0f4e('0x43')]=[{'all':!![]}];}_0x332d02=_['merge']({},_0x332d02,_0x4ba7b9['options']);return db[_0x0f4e('0x2e')][_0x0f4e('0x49')](_0x332d02)['then'](handleEntityNotFound(_0x27fc65,null))[_0x0f4e('0x26')](respondWithResult(_0x27fc65,null))[_0x0f4e('0x45')](handleError(_0x27fc65,null));};exports[_0x0f4e('0x4a')]=function(_0x390de0,_0xfef3fb){return db[_0x0f4e('0x2e')]['create'](_0x390de0['body'],{})[_0x0f4e('0x26')](respondWithResult(_0xfef3fb,0xc9))[_0x0f4e('0x45')](handleError(_0xfef3fb,null));};exports[_0x0f4e('0x25')]=function(_0x1d1f2a,_0x58b19e){if(_0x1d1f2a[_0x0f4e('0x4b')]['id']){delete _0x1d1f2a[_0x0f4e('0x4b')]['id'];}return db['VoiceTransferReport'][_0x0f4e('0x49')]({'where':{'id':_0x1d1f2a[_0x0f4e('0x47')]['id']}})[_0x0f4e('0x26')](handleEntityNotFound(_0x58b19e,null))[_0x0f4e('0x26')](saveUpdates(_0x1d1f2a['body'],null))[_0x0f4e('0x26')](respondWithResult(_0x58b19e,null))[_0x0f4e('0x45')](handleError(_0x58b19e,null));};exports['destroy']=function(_0x30bca1,_0x734068){return db[_0x0f4e('0x2e')][_0x0f4e('0x49')]({'where':{'id':_0x30bca1['params']['id']}})[_0x0f4e('0x26')](handleEntityNotFound(_0x734068,null))[_0x0f4e('0x26')](removeEntity(_0x734068,null))[_0x0f4e('0x45')](handleError(_0x734068,null));};exports[_0x0f4e('0x4c')]=function(_0x5afb,_0x433832){return db[_0x0f4e('0x2e')][_0x0f4e('0x4c')]()[_0x0f4e('0x26')](respondWithResult(_0x433832,null))[_0x0f4e('0x45')](handleError(_0x433832,null));};
\ No newline at end of file
+var _0x6c1e=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceTransferReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','params','rawAttributes','options','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c1e,0x194));var _0xe6c1=function(_0x1f323d,_0x358c4a){_0x1f323d=_0x1f323d-0x0;var _0x251789=_0x6c1e[_0x1f323d];return _0x251789;};'use strict';var emlformat=require(_0xe6c1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe6c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6c1('0x2'));var moment=require(_0xe6c1('0x3'));var BPromise=require(_0xe6c1('0x4'));var Mustache=require(_0xe6c1('0x5'));var util=require('util');var path=require(_0xe6c1('0x6'));var sox=require('sox');var csv=require(_0xe6c1('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe6c1('0x8'));var _=require(_0xe6c1('0x9'));var squel=require(_0xe6c1('0xa'));var crypto=require(_0xe6c1('0xb'));var jsforce=require(_0xe6c1('0xc'));var deskjs=require(_0xe6c1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe6c1('0xe'));var Papa=require(_0xe6c1('0xf'));var Redis=require(_0xe6c1('0x10'));var authService=require(_0xe6c1('0x11'));var qs=require(_0xe6c1('0x12'));var as=require(_0xe6c1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe6c1('0x14'));var config=require(_0xe6c1('0x15'));var licenseUtil=require(_0xe6c1('0x16'));var db=require(_0xe6c1('0x17'))['db'];function respondWithStatusCode(_0x15ead3,_0x13ad4f){_0x13ad4f=_0x13ad4f||0xcc;return function(_0x4ad0a4){if(_0x4ad0a4){return _0x15ead3[_0xe6c1('0x18')](_0x13ad4f);}return _0x15ead3['status'](_0x13ad4f)[_0xe6c1('0x19')]();};}function respondWithResult(_0x55ebb6,_0x2d57db){_0x2d57db=_0x2d57db||0xc8;return function(_0xfef60e){if(_0xfef60e){return _0x55ebb6[_0xe6c1('0x1a')](_0x2d57db)[_0xe6c1('0x1b')](_0xfef60e);}};}function respondWithFilteredResult(_0x3dd259,_0x1130d1){return function(_0x4f3220){if(_0x4f3220){var _0x294a67=typeof _0x1130d1[_0xe6c1('0x1c')]==='undefined'&&typeof _0x1130d1['limit']==='undefined';var _0x2f31a4=_0x4f3220['count'];var _0x231a33=_0x294a67?0x0:_0x1130d1['offset'];var _0x2c7fe5=_0x294a67?_0x4f3220['count']:_0x1130d1[_0xe6c1('0x1c')]+_0x1130d1[_0xe6c1('0x1d')];var _0xa1ed23;if(_0x2c7fe5>=_0x2f31a4){_0x2c7fe5=_0x2f31a4;_0xa1ed23=0xc8;}else{_0xa1ed23=0xce;}_0x3dd259[_0xe6c1('0x1a')](_0xa1ed23);return _0x3dd259[_0xe6c1('0x1e')](_0xe6c1('0x1f'),_0x231a33+'-'+_0x2c7fe5+'/'+_0x2f31a4)['json'](_0x4f3220);}return null;};}function patchUpdates(_0x1a3773){return function(_0x3ec221){try{jsonpatch[_0xe6c1('0x20')](_0x3ec221,_0x1a3773,!![]);}catch(_0x21dae1){return BPromise[_0xe6c1('0x21')](_0x21dae1);}return _0x3ec221[_0xe6c1('0x22')]();};}function saveUpdates(_0x23172e,_0x59522c){return function(_0x5db3a0){if(_0x5db3a0){return _0x5db3a0[_0xe6c1('0x23')](_0x23172e)[_0xe6c1('0x24')](function(_0xc75e26){return _0xc75e26;});}return null;};}function removeEntity(_0x3576e3,_0x540bbe){return function(_0x26f592){if(_0x26f592){return _0x26f592[_0xe6c1('0x25')]()[_0xe6c1('0x24')](function(){_0x3576e3[_0xe6c1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x598802,_0x29d74e){return function(_0x4de383){if(!_0x4de383){_0x598802[_0xe6c1('0x18')](0x194);}return _0x4de383;};}function handleError(_0x5c04dd,_0xf3b5aa){_0xf3b5aa=_0xf3b5aa||0x1f4;return function(_0x7bdcd9){logger[_0xe6c1('0x26')](_0x7bdcd9[_0xe6c1('0x27')]);if(_0x7bdcd9[_0xe6c1('0x28')]){delete _0x7bdcd9['name'];}_0x5c04dd[_0xe6c1('0x1a')](_0xf3b5aa)[_0xe6c1('0x29')](_0x7bdcd9);};}exports['index']=function(_0x2ccc06,_0x170b41){var _0x52d90f={},_0x197d3a={},_0x3505ef={'count':0x0,'rows':[]};var _0x4043ea=_['map'](db[_0xe6c1('0x2a')]['rawAttributes'],function(_0x499370){return{'name':_0x499370[_0xe6c1('0x2b')],'type':_0x499370[_0xe6c1('0x2c')]['key']};});_0x197d3a[_0xe6c1('0x2d')]=_[_0xe6c1('0x2e')](_0x4043ea,_0xe6c1('0x28'));_0x197d3a[_0xe6c1('0x2f')]=_[_0xe6c1('0x30')](_0x2ccc06['query']);_0x197d3a[_0xe6c1('0x31')]=_[_0xe6c1('0x32')](_0x197d3a[_0xe6c1('0x2d')],_0x197d3a[_0xe6c1('0x2f')]);_0x52d90f[_0xe6c1('0x33')]=_[_0xe6c1('0x32')](_0x197d3a['model'],qs[_0xe6c1('0x34')](_0x2ccc06['query'][_0xe6c1('0x34')]));_0x52d90f[_0xe6c1('0x33')]=_0x52d90f['attributes'][_0xe6c1('0x35')]?_0x52d90f[_0xe6c1('0x33')]:_0x197d3a[_0xe6c1('0x2d')];if(!_0x2ccc06['query'][_0xe6c1('0x36')]('nolimit')){_0x52d90f[_0xe6c1('0x1d')]=qs[_0xe6c1('0x1d')](_0x2ccc06[_0xe6c1('0x2f')][_0xe6c1('0x1d')]);_0x52d90f[_0xe6c1('0x1c')]=qs[_0xe6c1('0x1c')](_0x2ccc06[_0xe6c1('0x2f')]['offset']);}_0x52d90f['order']=qs[_0xe6c1('0x37')](_0x2ccc06[_0xe6c1('0x2f')]['sort']);_0x52d90f[_0xe6c1('0x38')]=qs[_0xe6c1('0x31')](_['pick'](_0x2ccc06[_0xe6c1('0x2f')],_0x197d3a['filters']),_0x4043ea);if(_0x2ccc06[_0xe6c1('0x2f')]['filter']){_0x52d90f['where']=_[_0xe6c1('0x39')](_0x52d90f[_0xe6c1('0x38')],{'$or':_[_0xe6c1('0x2e')](_0x4043ea,function(_0x14a2be){if(_0x14a2be[_0xe6c1('0x2c')]!==_0xe6c1('0x3a')){var _0x38cbf6={};_0x38cbf6[_0x14a2be['name']]={'$like':'%'+_0x2ccc06['query'][_0xe6c1('0x3b')]+'%'};return _0x38cbf6;}})});}_0x52d90f=_[_0xe6c1('0x39')]({},_0x52d90f,_0x2ccc06['options']);var _0x15b155={'where':_0x52d90f['where']};return db['VoiceTransferReport'][_0xe6c1('0x3c')](_0x15b155)[_0xe6c1('0x24')](function(_0xbc3263){_0x3505ef[_0xe6c1('0x3c')]=_0xbc3263;if(_0x2ccc06['query'][_0xe6c1('0x3d')]){_0x52d90f[_0xe6c1('0x3e')]=[{'all':!![]}];}return db[_0xe6c1('0x2a')][_0xe6c1('0x3f')](_0x52d90f);})[_0xe6c1('0x24')](function(_0x19235a){_0x3505ef[_0xe6c1('0x40')]=_0x19235a;return _0x3505ef;})[_0xe6c1('0x24')](respondWithFilteredResult(_0x170b41,_0x52d90f))[_0xe6c1('0x41')](handleError(_0x170b41,null));};exports['show']=function(_0x46a3c2,_0x4b1f6c){var _0x466342={'raw':!![],'where':{'id':_0x46a3c2[_0xe6c1('0x42')]['id']}},_0x48938a={};_0x48938a['model']=_['keys'](db[_0xe6c1('0x2a')][_0xe6c1('0x43')]);_0x48938a['query']=_['keys'](_0x46a3c2[_0xe6c1('0x2f')]);_0x48938a[_0xe6c1('0x31')]=_['intersection'](_0x48938a['model'],_0x48938a[_0xe6c1('0x2f')]);_0x466342[_0xe6c1('0x33')]=_['intersection'](_0x48938a[_0xe6c1('0x2d')],qs[_0xe6c1('0x34')](_0x46a3c2[_0xe6c1('0x2f')][_0xe6c1('0x34')]));_0x466342[_0xe6c1('0x33')]=_0x466342[_0xe6c1('0x33')]['length']?_0x466342['attributes']:_0x48938a['model'];if(_0x46a3c2[_0xe6c1('0x2f')][_0xe6c1('0x3d')]){_0x466342[_0xe6c1('0x3e')]=[{'all':!![]}];}_0x466342=_['merge']({},_0x466342,_0x46a3c2[_0xe6c1('0x44')]);return db[_0xe6c1('0x2a')]['find'](_0x466342)[_0xe6c1('0x24')](handleEntityNotFound(_0x4b1f6c,null))[_0xe6c1('0x24')](respondWithResult(_0x4b1f6c,null))['catch'](handleError(_0x4b1f6c,null));};exports[_0xe6c1('0x45')]=function(_0x16b0de,_0x472546){return db[_0xe6c1('0x2a')][_0xe6c1('0x45')](_0x16b0de['body'],{})[_0xe6c1('0x24')](respondWithResult(_0x472546,0xc9))[_0xe6c1('0x41')](handleError(_0x472546,null));};exports['update']=function(_0x1b761a,_0x5c14de){if(_0x1b761a[_0xe6c1('0x46')]['id']){delete _0x1b761a[_0xe6c1('0x46')]['id'];}return db[_0xe6c1('0x2a')][_0xe6c1('0x47')]({'where':{'id':_0x1b761a[_0xe6c1('0x42')]['id']}})[_0xe6c1('0x24')](handleEntityNotFound(_0x5c14de,null))[_0xe6c1('0x24')](saveUpdates(_0x1b761a['body'],null))[_0xe6c1('0x24')](respondWithResult(_0x5c14de,null))[_0xe6c1('0x41')](handleError(_0x5c14de,null));};exports['destroy']=function(_0x15b4aa,_0x281c19){return db[_0xe6c1('0x2a')][_0xe6c1('0x47')]({'where':{'id':_0x15b4aa[_0xe6c1('0x42')]['id']}})['then'](handleEntityNotFound(_0x281c19,null))[_0xe6c1('0x24')](removeEntity(_0x281c19,null))['catch'](handleError(_0x281c19,null));};exports['describe']=function(_0x293031,_0x42d2fe){return db[_0xe6c1('0x2a')]['describe']()[_0xe6c1('0x24')](respondWithResult(_0x42d2fe,null))[_0xe6c1('0x41')](handleError(_0x42d2fe,null));};
\ No newline at end of file
index ca2d1ba..7badf39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74a2=['report_call_transfer','lodash','api','moment','request-promise','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0x5279df,_0x18007f){var _0x4a3e8d=function(_0x5697c6){while(--_0x5697c6){_0x5279df['push'](_0x5279df['shift']());}};_0x4a3e8d(++_0x18007f);}(_0x74a2,0x15f));var _0x274a=function(_0x217c2e,_0x358f06){_0x217c2e=_0x217c2e-0x0;var _0x22b7d8=_0x74a2[_0x217c2e];return _0x22b7d8;};'use strict';var _=require(_0x274a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x274a('0x1'));var moment=require(_0x274a('0x2'));var BPromise=require('bluebird');var rp=require(_0x274a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x274a('0x4'));var attributes=require(_0x274a('0x5'));module[_0x274a('0x6')]=function(_0x1bf94a,_0x526d25){return _0x1bf94a[_0x274a('0x7')](_0x274a('0x8'),attributes,{'tableName':_0x274a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xffd9=['define','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voiceTransferReport.attributes','exports'];(function(_0x3ffc23,_0x49befe){var _0x220254=function(_0xe8264e){while(--_0xe8264e){_0x3ffc23['push'](_0x3ffc23['shift']());}};_0x220254(++_0x49befe);}(_0xffd9,0x146));var _0x9ffd=function(_0x120582,_0x276e78){_0x120582=_0x120582-0x0;var _0x3169b4=_0xffd9[_0x120582];return _0x3169b4;};'use strict';var _=require(_0x9ffd('0x0'));var util=require(_0x9ffd('0x1'));var logger=require(_0x9ffd('0x2'))(_0x9ffd('0x3'));var moment=require(_0x9ffd('0x4'));var BPromise=require(_0x9ffd('0x5'));var rp=require(_0x9ffd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ffd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ffd('0x8'));module[_0x9ffd('0x9')]=function(_0x526e1c,_0x32de7a){return _0x526e1c[_0x9ffd('0xa')]('VoiceTransferReport',attributes,{'tableName':_0x9ffd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b9c2f08..9a5cbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f0=['result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xb8f0,0x120));var _0x0b8f=function(_0x230556,_0x18232c){_0x230556=_0x230556-0x0;var _0x2a8768=_0xb8f0[_0x230556];return _0x2a8768;};'use strict';var _=require(_0x0b8f('0x0'));var util=require(_0x0b8f('0x1'));var moment=require(_0x0b8f('0x2'));var BPromise=require(_0x0b8f('0x3'));var rs=require(_0x0b8f('0x4'));var fs=require('fs');var Redis=require(_0x0b8f('0x5'));var db=require(_0x0b8f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b8f('0x7'));var config=require(_0x0b8f('0x8'));var jayson=require(_0x0b8f('0x9'));var client=jayson[_0x0b8f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38cf18,_0x148d71,_0x44d99c){return new BPromise(function(_0x5a04e6,_0x286553){return client[_0x0b8f('0xb')](_0x38cf18,_0x44d99c)[_0x0b8f('0xc')](function(_0x2769fe){logger['info'](_0x0b8f('0xd'),_0x148d71,_0x0b8f('0xe'));logger['debug'](_0x0b8f('0xf'),_0x148d71,_0x0b8f('0xe'),JSON[_0x0b8f('0x10')](_0x2769fe));if(_0x2769fe[_0x0b8f('0x11')]){if(_0x2769fe[_0x0b8f('0x11')]['code']===0x1f4){logger[_0x0b8f('0x11')](_0x0b8f('0xd'),_0x148d71,_0x2769fe['error']['message']);return _0x286553(_0x2769fe[_0x0b8f('0x11')]['message']);}logger[_0x0b8f('0x11')](_0x0b8f('0xd'),_0x148d71,_0x2769fe[_0x0b8f('0x11')][_0x0b8f('0x12')]);return _0x5a04e6(_0x2769fe['error']['message']);}else{logger[_0x0b8f('0x13')](_0x0b8f('0xd'),_0x148d71,_0x0b8f('0xe'));_0x5a04e6(_0x2769fe[_0x0b8f('0x14')][_0x0b8f('0x12')]);}})[_0x0b8f('0x15')](function(_0x1958cf){logger['error'](_0x0b8f('0xd'),_0x148d71,_0x1958cf);_0x286553(_0x1958cf);});});}exports[_0x0b8f('0x16')]=function(_0x44ab5e){var _0x8e2181=this;return new Promise(function(_0x3a278c,_0x36ac36){return db[_0x0b8f('0x17')][_0x0b8f('0x18')](_0x44ab5e[_0x0b8f('0x19')],{'raw':_0x44ab5e[_0x0b8f('0x1a')]?_0x44ab5e['options']['raw']===undefined?!![]:![]:!![]})[_0x0b8f('0xc')](function(_0x45ec4c){logger[_0x0b8f('0x13')](_0x0b8f('0x16'),_0x44ab5e);logger[_0x0b8f('0x1b')](_0x0b8f('0x16'),_0x44ab5e,JSON[_0x0b8f('0x10')](_0x45ec4c));_0x3a278c(_0x45ec4c);})[_0x0b8f('0x15')](function(_0x3a92ba){logger[_0x0b8f('0x11')](_0x0b8f('0x16'),_0x3a92ba['message'],_0x44ab5e);_0x36ac36(_0x8e2181[_0x0b8f('0x11')](0x1f4,_0x3a92ba['message']));});});};
\ No newline at end of file
+var _0x8d90=['then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateVoiceTransferReport','create','options','stringify','util','randomstring','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x3c2182,_0x7cb572){var _0x4eb804=function(_0x4138bc){while(--_0x4138bc){_0x3c2182['push'](_0x3c2182['shift']());}};_0x4eb804(++_0x7cb572);}(_0x8d90,0x134));var _0x08d9=function(_0x10e97a,_0x1c563d){_0x10e97a=_0x10e97a-0x0;var _0x20da73=_0x8d90[_0x10e97a];return _0x20da73;};'use strict';var _=require('lodash');var util=require(_0x08d9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x08d9('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x08d9('0x2'));var logger=require('../../config/logger')(_0x08d9('0x3'));var config=require('../../config/environment');var jayson=require(_0x08d9('0x4'));var client=jayson[_0x08d9('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x585229,_0x28f800,_0xbbd229){return new BPromise(function(_0x9e3d33,_0x51a4b0){return client[_0x08d9('0x6')](_0x585229,_0xbbd229)[_0x08d9('0x7')](function(_0x384b79){logger[_0x08d9('0x8')](_0x08d9('0x9'),_0x28f800,'request\x20sent');logger[_0x08d9('0xa')](_0x08d9('0xb'),_0x28f800,_0x08d9('0xc'),JSON['stringify'](_0x384b79));if(_0x384b79[_0x08d9('0xd')]){if(_0x384b79[_0x08d9('0xd')]['code']===0x1f4){logger[_0x08d9('0xd')](_0x08d9('0x9'),_0x28f800,_0x384b79['error']['message']);return _0x51a4b0(_0x384b79[_0x08d9('0xd')][_0x08d9('0xe')]);}logger['error'](_0x08d9('0x9'),_0x28f800,_0x384b79['error'][_0x08d9('0xe')]);return _0x9e3d33(_0x384b79['error'][_0x08d9('0xe')]);}else{logger['info'](_0x08d9('0x9'),_0x28f800,'request\x20sent');_0x9e3d33(_0x384b79[_0x08d9('0xf')][_0x08d9('0xe')]);}})[_0x08d9('0x10')](function(_0x5474c9){logger['error'](_0x08d9('0x9'),_0x28f800,_0x5474c9);_0x51a4b0(_0x5474c9);});});}exports[_0x08d9('0x11')]=function(_0x544bd6){var _0x42c7f2=this;return new Promise(function(_0x39ef5e,_0x2ed638){return db['VoiceTransferReport'][_0x08d9('0x12')](_0x544bd6['body'],{'raw':_0x544bd6[_0x08d9('0x13')]?_0x544bd6[_0x08d9('0x13')]['raw']===undefined?!![]:![]:!![]})[_0x08d9('0x7')](function(_0x26912d){logger[_0x08d9('0x8')](_0x08d9('0x11'),_0x544bd6);logger['debug'](_0x08d9('0x11'),_0x544bd6,JSON[_0x08d9('0x14')](_0x26912d));_0x39ef5e(_0x26912d);})[_0x08d9('0x10')](function(_0x1e223a){logger['error'](_0x08d9('0x11'),_0x1e223a[_0x08d9('0xe')],_0x544bd6);_0x2ed638(_0x42c7f2[_0x08d9('0xd')](0x1f4,_0x1e223a[_0x08d9('0xe')]));});});};
\ No newline at end of file
index ccfcb47..b429214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['unhold','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','isAuthenticated','isWebrtcLicence','originate','hangup','/answer','/hold','/unhold'];(function(_0x3f0872,_0x3bb275){var _0x54142a=function(_0x385441){while(--_0x385441){_0x3f0872['push'](_0x3f0872['shift']());}};_0x54142a(++_0x3bb275);}(_0xdace,0xc5));var _0xedac=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xdace[_0x376b45];return _0x2341b3;};'use strict';var express=require(_0xedac('0x0'));var router=express['Router']();var auth=require(_0xedac('0x1'));var controller=require(_0xedac('0x2'));router[_0xedac('0x3')]('/originate',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x6')]);router[_0xedac('0x3')]('/hangup',auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0x7')]);router['post'](_0xedac('0x8'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller['answer']);router[_0xedac('0x3')](_0xedac('0x9'),auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0xedac('0x3')](_0xedac('0xa'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xedac('0xb')]);router[_0xedac('0x3')]('/calls',auth[_0xedac('0x4')](),auth['isWebrtcLicence'](),controller[_0xedac('0xc')]);router[_0xedac('0x3')](_0xedac('0xd'),auth[_0xedac('0x4')](),auth[_0xedac('0x5')](),controller[_0xedac('0xe')]);module[_0xedac('0xf')]=router;
\ No newline at end of file
+var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x388679,_0x502313){var _0x3392fa=function(_0x39dfda){while(--_0x39dfda){_0x388679['push'](_0x388679['shift']());}};_0x3392fa(++_0x502313);}(_0xe14d,0x1ee));var _0xde14=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xe14d[_0x173d7e];return _0x2220d6;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router;
\ No newline at end of file
index 5a9b41c..3990293 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','hangup\x20executed!','answer','answer\x20fired:','validate','webbar:answer','answer\x20executed!','hold','entityFound:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../config/environment','util','bluebird','http','../../config/logger','webbarapi','ioredis','defaults','redis','localhost','socket.io-emitter','callNumber\x20is\x20required','string','userId\x20is\x20required','transferNumber\x20is\x20required','number','info','stringify','log','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','User','findOne','agent','then','VoiceChannels','all','filter','rows','UserId','sessionId','length','originate','originate\x20fired:','body','json','userId','callNumber','callerId','format'];(function(_0x736a72,_0x574f49){var _0x3741ad=function(_0x412a42){while(--_0x412a42){_0x736a72['push'](_0x736a72['shift']());}};_0x3741ad(++_0x574f49);}(_0x9f62,0x154));var _0x29f6=function(_0x43358c,_0x305ae0){_0x43358c=_0x43358c-0x0;var _0x2d3074=_0x9f62[_0x43358c];return _0x2d3074;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x29f6('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x29f6('0x1'));var util=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var jayson=require('jayson/promise');var amiClient=jayson['client'][_0x29f6('0x4')]({'port':0x232a});var logger=require(_0x29f6('0x5'))(_0x29f6('0x6'));var Redis=require(_0x29f6('0x7'));config['redis']=_[_0x29f6('0x8')](config[_0x29f6('0x9')],{'host':_0x29f6('0xa'),'port':0x18eb});var io=require(_0x29f6('0xb'))(new Redis(config[_0x29f6('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0x29f6('0xc')]},'callerId':{'type':_0x29f6('0xd')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x29f6('0xd'),'required':[!![],_0x29f6('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]},'sessionId':{'type':_0x29f6('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0x29f6('0x10'),'required':[!![],_0x29f6('0xe')]}});function emit(_0x1dde97,_0x3a75d0,_0x25e5a2){logger[_0x29f6('0x11')](_0x1dde97,_0x3a75d0,JSON[_0x29f6('0x12')](_0x25e5a2));io['to'](_0x1dde97)['emit'](_0x3a75d0,_0x25e5a2);}function handleError(_0x51c92f){return function(_0x2e66d3){console[_0x29f6('0x13')](_0x29f6('0x14'),_0x2e66d3,_0x2e66d3 instanceof RangeError);logger['error'](_0x2e66d3[_0x29f6('0x15')]);if(_0x2e66d3 instanceof RangeError){if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3['name'];}_0x51c92f[_0x29f6('0x17')](0x194)[_0x29f6('0x18')](_0x2e66d3);}else{if(_0x2e66d3[_0x29f6('0x16')]){delete _0x2e66d3[_0x29f6('0x16')];}_0x51c92f[_0x29f6('0x17')](0x1f4)[_0x29f6('0x18')](_0x2e66d3);}};}function checkError(){return function(_0x5673c8){if(!_0x5673c8){throw new RangeError(_0x29f6('0x19'));}return _0x5673c8;};}function respondWithRpcPromise(_0x59def4,_0x4acb15){return new BPromise(function(_0x470019,_0x1fa159){var _0x39c6b3=amiClient;return _0x39c6b3[_0x29f6('0x1a')](_0x59def4,_0x4acb15)['then'](function(_0x2c672e){if(_0x2c672e['error']){if(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1c')]===0x1f4){return _0x1fa159(_0x2c672e[_0x29f6('0x1b')][_0x29f6('0x1d')]);}return _0x470019(_0x2c672e['error'][_0x29f6('0x1d')]);}else{_0x470019(_0x2c672e[_0x29f6('0x1e')]);}})['catch'](function(_0x1401fb){_0x1fa159(_0x1401fb);});});}function getAgent(_0x45f792){return db[_0x29f6('0x1f')][_0x29f6('0x20')]({'where':{'id':_0x45f792,'role':_0x29f6('0x21')}})[_0x29f6('0x22')](checkError());}function getAgentCheckSession(_0x23c630,_0x50cdd2){return new BPromise(function(_0x2183b7,_0x454a4a){var _0x1ab8d8=respondWithRpcPromise(_0x29f6('0x23'));var _0xda0a63=getAgent(_0x23c630);Promise[_0x29f6('0x24')]([_0x1ab8d8,_0xda0a63])[_0x29f6('0x22')](function(_0x17b2f2){var _0x3d88db=_0x17b2f2[0x0];var _0x13a3a2=_0x17b2f2[0x1];var _0x2915bc=_[_0x29f6('0x25')](_0x3d88db[_0x29f6('0x26')],function(_0x304c28){return _0x304c28[_0x29f6('0x27')]==_0x13a3a2['id']&&_0x304c28[_0x29f6('0x28')]==_0x50cdd2;});if(_0x2915bc[_0x29f6('0x29')]==0x1){_0x2183b7(_0x13a3a2);}else{_0x454a4a(new RangeError('sessionId\x20'+_0x50cdd2+'\x20not\x20found!'));}});});}exports[_0x29f6('0x2a')]=function(_0x489897,_0x341071){logger[_0x29f6('0x11')](_0x29f6('0x2b'),_0x489897[_0x29f6('0x2c')]);var _0x5e5d89=originateValidation['validate'](_0x489897[_0x29f6('0x2c')]);if(_0x5e5d89[_0x29f6('0x29')]>0x0){return _0x341071[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e5d89);}var _0x3a223b=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x1c3f0f=_0x489897[_0x29f6('0x2c')][_0x29f6('0x2f')];var _0x46d0d0=_0x489897[_0x29f6('0x2c')][_0x29f6('0x30')];var _0x23ad1a=_0x489897['body']['callbackUrl'];return getAgent(_0x3a223b)[_0x29f6('0x22')](function(_0x44cf19){logger[_0x29f6('0x11')]('entityFound:',_0x44cf19[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x44cf19[_0x29f6('0x16')]),_0x29f6('0x33'),{'callNumber':_0x1c3f0f,'callerId':_0x46d0d0,'callbackUrl':_0x23ad1a});return _0x341071['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x34')});})[_0x29f6('0x35')](handleError(_0x341071));};exports[_0x29f6('0x36')]=function(_0x4f5fe1,_0x30d747){logger[_0x29f6('0x11')](_0x29f6('0x37'),_0x4f5fe1[_0x29f6('0x2c')]);var _0x5ddc09=hangupValidation['validate'](_0x4f5fe1[_0x29f6('0x2c')]);if(_0x5ddc09['length']>0x0){return _0x30d747[_0x29f6('0x17')](0x190)['json'](_0x5ddc09);}var _0x3a1a75=_0x4f5fe1['body'][_0x29f6('0x2e')];var _0x11fb2d=_0x4f5fe1['body'][_0x29f6('0x28')];return getAgent(_0x3a1a75)['then'](function(_0x3f3475){logger[_0x29f6('0x11')]('entityFound:',_0x3f3475[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x3f3475[_0x29f6('0x16')]),'webbar:hangup',{'sessionId':_0x11fb2d});return _0x30d747[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x38')});})[_0x29f6('0x35')](handleError(_0x30d747));};exports[_0x29f6('0x39')]=function(_0x4d4189,_0xb5f2b1){logger['info'](_0x29f6('0x3a'),_0x4d4189['body']);var _0xbfe671=answerValidation[_0x29f6('0x3b')](_0x4d4189['body']);if(_0xbfe671[_0x29f6('0x29')]>0x0){return _0xb5f2b1[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0xbfe671);}var _0x27d655=_0x4d4189['body'][_0x29f6('0x2e')];var _0x2a83b7=_0x4d4189[_0x29f6('0x2c')]['sessionId'];return getAgent(_0x27d655)[_0x29f6('0x22')](function(_0x4a5f35){logger[_0x29f6('0x11')]('entityFound:',_0x4a5f35['name']);emit(util['format'](_0x29f6('0x32'),_0x4a5f35[_0x29f6('0x16')]),_0x29f6('0x3c'),{'sessionId':_0x2a83b7});return _0xb5f2b1[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x3d')});})[_0x29f6('0x35')](handleError(_0xb5f2b1));};exports[_0x29f6('0x3e')]=function(_0x352119,_0x1bde93){logger['info']('hold\x20fired:',_0x352119[_0x29f6('0x2c')]);var _0x450e76=holdValidation[_0x29f6('0x3b')](_0x352119[_0x29f6('0x2c')]);if(_0x450e76['length']>0x0){return _0x1bde93[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x450e76);}var _0x532df5=_0x352119[_0x29f6('0x2c')][_0x29f6('0x2e')];var _0x123e2f=_0x352119[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x532df5)[_0x29f6('0x22')](function(_0x320b5e){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x320b5e[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x320b5e['name']),_0x29f6('0x40'),{'sessionId':_0x123e2f});return _0x1bde93[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x41')});})[_0x29f6('0x35')](handleError(_0x1bde93));};exports['unhold']=function(_0x2e29e3,_0x52be22){logger['info'](_0x29f6('0x42'),_0x2e29e3[_0x29f6('0x2c')]);var _0x3194fa=unholdValidation[_0x29f6('0x3b')](_0x2e29e3[_0x29f6('0x2c')]);if(_0x3194fa['length']>0x0){return _0x52be22[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3194fa);}var _0x5f42f3=_0x2e29e3[_0x29f6('0x2c')]['userId'];var _0x288cf2=_0x2e29e3[_0x29f6('0x2c')][_0x29f6('0x28')];return getAgent(_0x5f42f3)[_0x29f6('0x22')](function(_0x5c9113){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5c9113[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5c9113[_0x29f6('0x16')]),_0x29f6('0x43'),{'sessionId':_0x288cf2});return _0x52be22['status'](0xc8)[_0x29f6('0x2d')]({'error':![],'message':_0x29f6('0x44')});})[_0x29f6('0x35')](handleError(_0x52be22));};exports[_0x29f6('0x45')]=function(_0x36e52c,_0x1ac20d){logger[_0x29f6('0x11')](_0x29f6('0x46'),_0x1ac20d[_0x29f6('0x2c')]);var _0x3dbd19=callsValidation['validate'](_0x36e52c['body']);if(_0x3dbd19[_0x29f6('0x29')]>0x0){return _0x1ac20d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x3dbd19);}var _0x5ab84e=_0x36e52c[_0x29f6('0x2c')]['userId'];var _0x550190=respondWithRpcPromise(_0x29f6('0x23'));var _0x234d30=getAgent(_0x5ab84e);return Promise['all']([_0x550190,_0x234d30])['then'](function(_0x3e22f8){var _0x46998c=_0x3e22f8[0x0];var _0x439c0b=_0x3e22f8[0x1];var _0x58694e=_[_0x29f6('0x25')](_0x46998c[_0x29f6('0x26')],function(_0x4284fd){return _0x4284fd[_0x29f6('0x27')]==_0x439c0b['id'];});return _0x1ac20d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'count':_0x58694e[_0x29f6('0x29')],'rows':_0x58694e});})[_0x29f6('0x35')](handleError(_0x1ac20d));};exports[_0x29f6('0x47')]=function(_0x192525,_0x2d4c8d){logger[_0x29f6('0x11')](_0x29f6('0x48'),_0x192525['body']);var _0x5e25c0=conferenceValidation[_0x29f6('0x3b')](_0x192525['body']);if(_0x5e25c0[_0x29f6('0x29')]>0x0){return _0x2d4c8d[_0x29f6('0x17')](0x190)[_0x29f6('0x2d')](_0x5e25c0);}var _0x40b4d7=_0x192525[_0x29f6('0x2c')]['userId'];return getAgent(_0x40b4d7)[_0x29f6('0x22')](function(_0x38d684){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x38d684[_0x29f6('0x16')]);emit(util['format'](_0x29f6('0x32'),_0x38d684['name']),'webbar:conference');return _0x2d4c8d[_0x29f6('0x17')](0xc8)[_0x29f6('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0x29f6('0x35')](handleError(_0x2d4c8d));};exports[_0x29f6('0x49')]=function(_0x58bdf4,_0x44b3ee){logger[_0x29f6('0x11')](_0x29f6('0x4a'),_0x58bdf4[_0x29f6('0x2c')]);var _0xf3c5f1=transferValidation[_0x29f6('0x3b')](_0x58bdf4[_0x29f6('0x2c')]);if(_0xf3c5f1['length']>0x0){return _0x44b3ee[_0x29f6('0x17')](0x190)['json'](_0xf3c5f1);}var _0x37162d=_0x58bdf4['body']['userId'];var _0x1a3357=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x28')];var _0x536b0c=_0x58bdf4[_0x29f6('0x2c')][_0x29f6('0x4b')];return getAgent(_0x37162d)[_0x29f6('0x22')](function(_0x5625b1){logger[_0x29f6('0x11')](_0x29f6('0x3f'),_0x5625b1[_0x29f6('0x16')]);emit(util[_0x29f6('0x31')](_0x29f6('0x32'),_0x5625b1[_0x29f6('0x16')]),_0x29f6('0x4c'),{'sessionId':_0x1a3357,'transferNumber':_0x536b0c});return _0x44b3ee[_0x29f6('0x17')](0xc8)['json']({'error':![],'message':_0x29f6('0x4d')});})[_0x29f6('0x35')](handleError(_0x44b3ee));};
\ No newline at end of file
+var _0xa75b=['handleError:','error','stack','name','status','send','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','sessionId','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','length','json','userId','callerId','callbackUrl','entityFound:','format','webbar:originate','originate\x20executed!','hangup','user:%s','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','UserId','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','string','number','userId\x20is\x20required','sessionId\x20is\x20required','info','stringify','emit','log'];(function(_0x165887,_0xfdfe8f){var _0x2a0108=function(_0x4e253f){while(--_0x4e253f){_0x165887['push'](_0x165887['shift']());}};_0x2a0108(++_0xfdfe8f);}(_0xa75b,0x170));var _0xba75=function(_0x42657d,_0x465f4a){_0x42657d=_0x42657d-0x0;var _0xcdf566=_0xa75b[_0x42657d];return _0xcdf566;};'use strict';var path=require(_0xba75('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0xba75('0x1'));var util=require(_0xba75('0x2'));var BPromise=require(_0xba75('0x3'));var jayson=require(_0xba75('0x4'));var amiClient=jayson[_0xba75('0x5')][_0xba75('0x6')]({'port':0x232a});var logger=require(_0xba75('0x7'))(_0xba75('0x8'));var Redis=require(_0xba75('0x9'));config[_0xba75('0xa')]=_[_0xba75('0xb')](config[_0xba75('0xa')],{'host':_0xba75('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xba75('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xba75('0xe'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xba75('0xe')},'callbackUrl':{'type':_0xba75('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':[!![],_0xba75('0x11')]},'transferNumber':{'type':'string','required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]},'sessionId':{'type':_0xba75('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xba75('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xba75('0xf'),'required':[!![],_0xba75('0x10')]}});function emit(_0x4028f9,_0x41c9e5,_0x51112b){logger[_0xba75('0x12')](_0x4028f9,_0x41c9e5,JSON[_0xba75('0x13')](_0x51112b));io['to'](_0x4028f9)[_0xba75('0x14')](_0x41c9e5,_0x51112b);}function handleError(_0x47be93){return function(_0x2822af){console[_0xba75('0x15')](_0xba75('0x16'),_0x2822af,_0x2822af instanceof RangeError);logger[_0xba75('0x17')](_0x2822af[_0xba75('0x18')]);if(_0x2822af instanceof RangeError){if(_0x2822af[_0xba75('0x19')]){delete _0x2822af['name'];}_0x47be93[_0xba75('0x1a')](0x194)[_0xba75('0x1b')](_0x2822af);}else{if(_0x2822af['name']){delete _0x2822af['name'];}_0x47be93[_0xba75('0x1a')](0x1f4)[_0xba75('0x1b')](_0x2822af);}};}function checkError(){return function(_0x496cfc){if(!_0x496cfc){throw new RangeError('NotFound');}return _0x496cfc;};}function respondWithRpcPromise(_0x30f482,_0x4e79a9){return new BPromise(function(_0x1b8a36,_0x2ece41){var _0x19b2d7=amiClient;return _0x19b2d7['request'](_0x30f482,_0x4e79a9)[_0xba75('0x1c')](function(_0x221d5e){if(_0x221d5e[_0xba75('0x17')]){if(_0x221d5e[_0xba75('0x17')][_0xba75('0x1d')]===0x1f4){return _0x2ece41(_0x221d5e[_0xba75('0x17')]['message']);}return _0x1b8a36(_0x221d5e[_0xba75('0x17')][_0xba75('0x1e')]);}else{_0x1b8a36(_0x221d5e[_0xba75('0x1f')]);}})[_0xba75('0x20')](function(_0x1caa6){_0x2ece41(_0x1caa6);});});}function getAgent(_0x44b1d4){return db[_0xba75('0x21')][_0xba75('0x22')]({'where':{'id':_0x44b1d4,'role':_0xba75('0x23')}})[_0xba75('0x1c')](checkError());}function getAgentCheckSession(_0x47ddff,_0x4c8d02){return new BPromise(function(_0x4e1987,_0x240522){var _0x4856be=respondWithRpcPromise(_0xba75('0x24'));var _0x58ea2d=getAgent(_0x47ddff);Promise[_0xba75('0x25')]([_0x4856be,_0x58ea2d])[_0xba75('0x1c')](function(_0x20ac78){var _0x4edc2e=_0x20ac78[0x0];var _0x3a1fd3=_0x20ac78[0x1];var _0x62cf49=_[_0xba75('0x26')](_0x4edc2e[_0xba75('0x27')],function(_0x5d9f78){return _0x5d9f78['UserId']==_0x3a1fd3['id']&&_0x5d9f78[_0xba75('0x28')]==_0x4c8d02;});if(_0x62cf49['length']==0x1){_0x4e1987(_0x3a1fd3);}else{_0x240522(new RangeError(_0xba75('0x29')+_0x4c8d02+_0xba75('0x2a')));}});});}exports[_0xba75('0x2b')]=function(_0x32166a,_0x4b4d69){logger[_0xba75('0x12')](_0xba75('0x2c'),_0x32166a['body']);var _0x33a732=originateValidation[_0xba75('0xd')](_0x32166a[_0xba75('0x2d')]);if(_0x33a732[_0xba75('0x2e')]>0x0){return _0x4b4d69['status'](0x190)[_0xba75('0x2f')](_0x33a732);}var _0x3a1610=_0x32166a['body'][_0xba75('0x30')];var _0x6ea4fc=_0x32166a[_0xba75('0x2d')]['callNumber'];var _0x29334a=_0x32166a[_0xba75('0x2d')][_0xba75('0x31')];var _0x381cb=_0x32166a[_0xba75('0x2d')][_0xba75('0x32')];return getAgent(_0x3a1610)[_0xba75('0x1c')](function(_0x4c9fb2){logger['info'](_0xba75('0x33'),_0x4c9fb2[_0xba75('0x19')]);emit(util[_0xba75('0x34')]('user:%s',_0x4c9fb2[_0xba75('0x19')]),_0xba75('0x35'),{'callNumber':_0x6ea4fc,'callerId':_0x29334a,'callbackUrl':_0x381cb});return _0x4b4d69['status'](0xc8)['json']({'error':![],'message':_0xba75('0x36')});})[_0xba75('0x20')](handleError(_0x4b4d69));};exports[_0xba75('0x37')]=function(_0x1243e8,_0x92882d){logger['info']('hangup\x20fired:',_0x1243e8[_0xba75('0x2d')]);var _0x22b335=hangupValidation[_0xba75('0xd')](_0x1243e8[_0xba75('0x2d')]);if(_0x22b335[_0xba75('0x2e')]>0x0){return _0x92882d[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x22b335);}var _0x5dad31=_0x1243e8[_0xba75('0x2d')][_0xba75('0x30')];var _0x5bec5f=_0x1243e8[_0xba75('0x2d')][_0xba75('0x28')];return getAgent(_0x5dad31)[_0xba75('0x1c')](function(_0x45d8cd){logger[_0xba75('0x12')](_0xba75('0x33'),_0x45d8cd[_0xba75('0x19')]);emit(util['format'](_0xba75('0x38'),_0x45d8cd['name']),_0xba75('0x39'),{'sessionId':_0x5bec5f});return _0x92882d['status'](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x3a')});})[_0xba75('0x20')](handleError(_0x92882d));};exports[_0xba75('0x3b')]=function(_0x24d80b,_0x30338c){logger[_0xba75('0x12')](_0xba75('0x3c'),_0x24d80b[_0xba75('0x2d')]);var _0x5c7c7f=answerValidation[_0xba75('0xd')](_0x24d80b[_0xba75('0x2d')]);if(_0x5c7c7f['length']>0x0){return _0x30338c[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x5c7c7f);}var _0x1130ac=_0x24d80b['body']['userId'];var _0x5c6491=_0x24d80b['body'][_0xba75('0x28')];return getAgent(_0x1130ac)['then'](function(_0x46e9b9){logger[_0xba75('0x12')](_0xba75('0x33'),_0x46e9b9[_0xba75('0x19')]);emit(util[_0xba75('0x34')]('user:%s',_0x46e9b9['name']),_0xba75('0x3d'),{'sessionId':_0x5c6491});return _0x30338c['status'](0xc8)[_0xba75('0x2f')]({'error':![],'message':'answer\x20executed!'});})[_0xba75('0x20')](handleError(_0x30338c));};exports[_0xba75('0x3e')]=function(_0x22e5b4,_0x3983dc){logger['info'](_0xba75('0x3f'),_0x22e5b4[_0xba75('0x2d')]);var _0x254dc7=holdValidation[_0xba75('0xd')](_0x22e5b4[_0xba75('0x2d')]);if(_0x254dc7[_0xba75('0x2e')]>0x0){return _0x3983dc[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x254dc7);}var _0x51cd22=_0x22e5b4[_0xba75('0x2d')][_0xba75('0x30')];var _0x7c297b=_0x22e5b4[_0xba75('0x2d')][_0xba75('0x28')];return getAgent(_0x51cd22)['then'](function(_0x2a1f84){logger[_0xba75('0x12')](_0xba75('0x33'),_0x2a1f84[_0xba75('0x19')]);emit(util[_0xba75('0x34')](_0xba75('0x38'),_0x2a1f84[_0xba75('0x19')]),'webbar:hold',{'sessionId':_0x7c297b});return _0x3983dc[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x40')});})['catch'](handleError(_0x3983dc));};exports[_0xba75('0x41')]=function(_0x29b4fc,_0x559f6f){logger['info'](_0xba75('0x42'),_0x29b4fc['body']);var _0x49a4df=unholdValidation[_0xba75('0xd')](_0x29b4fc['body']);if(_0x49a4df[_0xba75('0x2e')]>0x0){return _0x559f6f[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x49a4df);}var _0x70474=_0x29b4fc[_0xba75('0x2d')]['userId'];var _0xfa79e6=_0x29b4fc[_0xba75('0x2d')]['sessionId'];return getAgent(_0x70474)[_0xba75('0x1c')](function(_0x19a08f){logger[_0xba75('0x12')](_0xba75('0x33'),_0x19a08f[_0xba75('0x19')]);emit(util['format'](_0xba75('0x38'),_0x19a08f[_0xba75('0x19')]),'webbar:unhold',{'sessionId':_0xfa79e6});return _0x559f6f[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x43')});})[_0xba75('0x20')](handleError(_0x559f6f));};exports[_0xba75('0x44')]=function(_0x3b6490,_0x49fb61){logger[_0xba75('0x12')](_0xba75('0x45'),_0x49fb61[_0xba75('0x2d')]);var _0x429e26=callsValidation[_0xba75('0xd')](_0x3b6490[_0xba75('0x2d')]);if(_0x429e26['length']>0x0){return _0x49fb61['status'](0x190)['json'](_0x429e26);}var _0x4cda26=_0x3b6490[_0xba75('0x2d')][_0xba75('0x30')];var _0x2991e5=respondWithRpcPromise(_0xba75('0x24'));var _0x3716c6=getAgent(_0x4cda26);return Promise[_0xba75('0x25')]([_0x2991e5,_0x3716c6])[_0xba75('0x1c')](function(_0x5cfedd){var _0x1c4707=_0x5cfedd[0x0];var _0x1e7500=_0x5cfedd[0x1];var _0x287f30=_[_0xba75('0x26')](_0x1c4707['rows'],function(_0xb7b3a4){return _0xb7b3a4[_0xba75('0x46')]==_0x1e7500['id'];});return _0x49fb61['status'](0xc8)[_0xba75('0x2f')]({'count':_0x287f30['length'],'rows':_0x287f30});})[_0xba75('0x20')](handleError(_0x49fb61));};exports[_0xba75('0x47')]=function(_0x57eceb,_0x276757){logger[_0xba75('0x12')]('conference\x20fired:',_0x57eceb['body']);var _0x3d9420=conferenceValidation['validate'](_0x57eceb[_0xba75('0x2d')]);if(_0x3d9420['length']>0x0){return _0x276757[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x3d9420);}var _0x46c43c=_0x57eceb[_0xba75('0x2d')][_0xba75('0x30')];return getAgent(_0x46c43c)['then'](function(_0xf02890){logger[_0xba75('0x12')]('entityFound:',_0xf02890[_0xba75('0x19')]);emit(util[_0xba75('0x34')](_0xba75('0x38'),_0xf02890[_0xba75('0x19')]),_0xba75('0x48'));return _0x276757[_0xba75('0x1a')](0xc8)[_0xba75('0x2f')]({'error':![],'message':_0xba75('0x49')});})[_0xba75('0x20')](handleError(_0x276757));};exports[_0xba75('0x4a')]=function(_0xa0a92,_0x9da35c){logger['info']('transfer\x20fired:',_0xa0a92[_0xba75('0x2d')]);var _0x31e3b6=transferValidation[_0xba75('0xd')](_0xa0a92[_0xba75('0x2d')]);if(_0x31e3b6[_0xba75('0x2e')]>0x0){return _0x9da35c[_0xba75('0x1a')](0x190)[_0xba75('0x2f')](_0x31e3b6);}var _0x115798=_0xa0a92[_0xba75('0x2d')][_0xba75('0x30')];var _0x2b686e=_0xa0a92['body'][_0xba75('0x28')];var _0x5c1e1d=_0xa0a92[_0xba75('0x2d')][_0xba75('0x4b')];return getAgent(_0x115798)[_0xba75('0x1c')](function(_0x43b73b){logger[_0xba75('0x12')](_0xba75('0x33'),_0x43b73b['name']);emit(util[_0xba75('0x34')]('user:%s',_0x43b73b[_0xba75('0x19')]),_0xba75('0x4c'),{'sessionId':_0x2b686e,'transferNumber':_0x5c1e1d});return _0x9da35c['status'](0xc8)['json']({'error':![],'message':_0xba75('0x4d')});})[_0xba75('0x20')](handleError(_0x9da35c));};
\ No newline at end of file
index 76ed6f1..b48b73b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['addDisposition','addAnswer','addApplications','/:id/notify','notify','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','/:id/dispositions'];(function(_0x216e3f,_0x1ee9e1){var _0x32f8dc=function(_0x291d0e){while(--_0x291d0e){_0x216e3f['push'](_0x216e3f['shift']());}};_0x32f8dc(++_0x1ee9e1);}(_0x57ca,0x108));var _0xa57c=function(_0x29881c,_0x458fa2){_0x29881c=_0x29881c-0x0;var _0x918f30=_0x57ca[_0x29881c];return _0x918f30;};'use strict';var multer=require('multer');var util=require(_0xa57c('0x0'));var path=require(_0xa57c('0x1'));var timeout=require('connect-timeout');var express=require(_0xa57c('0x2'));var router=express[_0xa57c('0x3')]();var fs_extra=require(_0xa57c('0x4'));var auth=require(_0xa57c('0x5'));var interaction=require(_0xa57c('0x6'));var config=require('../../config/environment');var controller=require(_0xa57c('0x7'));router[_0xa57c('0x8')]('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0xa')]);router[_0xa57c('0x8')](_0xa57c('0xb'),auth[_0xa57c('0x9')](),controller[_0xa57c('0xc')]);router['get'](_0xa57c('0xd'),auth['isAuthenticated'](),controller[_0xa57c('0xe')]);router[_0xa57c('0x8')]('/:id/dispositions',auth[_0xa57c('0x9')](),controller['getDispositions']);router[_0xa57c('0x8')](_0xa57c('0xf'),auth['isAuthenticated'](),controller[_0xa57c('0x10')]);router['get'](_0xa57c('0x11'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x12')]);router[_0xa57c('0x8')](_0xa57c('0x13'),auth['isAuthenticated'](),controller[_0xa57c('0x14')]);router['post']('/',auth[_0xa57c('0x9')](),controller[_0xa57c('0x15')]);router[_0xa57c('0x16')](_0xa57c('0x17'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x18')]);router[_0xa57c('0x16')]('/:id/canned_answers',auth[_0xa57c('0x9')](),controller[_0xa57c('0x19')]);router[_0xa57c('0x16')]('/:id/users',auth[_0xa57c('0x9')](),controller['addAgents']);router[_0xa57c('0x16')](_0xa57c('0x13'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x1a')]);router[_0xa57c('0x16')](_0xa57c('0x1b'),controller[_0xa57c('0x1c')]);router[_0xa57c('0x16')]('/:id/send',auth[_0xa57c('0x9')](),controller['send']);router['put'](_0xa57c('0xd'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x1d')]);router[_0xa57c('0x1e')]('/:id',auth[_0xa57c('0x9')](),controller[_0xa57c('0x1f')]);router[_0xa57c('0x1e')](_0xa57c('0x17'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x20')]);router[_0xa57c('0x1e')](_0xa57c('0xf'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x21')]);router[_0xa57c('0x1e')](_0xa57c('0x11'),auth[_0xa57c('0x9')](),controller[_0xa57c('0x22')]);module[_0xa57c('0x23')]=router;
\ No newline at end of file
+var _0x955f=['addApplications','notify','/:id/send','send','update','destroy','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getAnswers','getApplications','post','create','addDisposition','/:id/users','addAgents'];(function(_0x2d3a2a,_0x77d432){var _0x3e60fb=function(_0x162aab){while(--_0x162aab){_0x2d3a2a['push'](_0x2d3a2a['shift']());}};_0x3e60fb(++_0x77d432);}(_0x955f,0x1eb));var _0xf955=function(_0x3b5768,_0x42f70c){_0x3b5768=_0x3b5768-0x0;var _0xe5965b=_0x955f[_0x3b5768];return _0xe5965b;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./whatsappAccount.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getDispositions']);router[_0xf955('0x7')]('/:id/canned_answers',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0x7')]('/:id/users',auth[_0xf955('0x8')](),controller['getAgents']);router[_0xf955('0x7')]('/:id/applications',auth[_0xf955('0x8')](),controller[_0xf955('0xf')]);router[_0xf955('0x10')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x11')]);router[_0xf955('0x10')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller[_0xf955('0x12')]);router[_0xf955('0x10')]('/:id/canned_answers',auth[_0xf955('0x8')](),controller['addAnswer']);router[_0xf955('0x10')](_0xf955('0x13'),auth[_0xf955('0x8')](),controller[_0xf955('0x14')]);router['post']('/:id/applications',auth[_0xf955('0x8')](),controller[_0xf955('0x15')]);router[_0xf955('0x10')]('/:id/notify',controller[_0xf955('0x16')]);router[_0xf955('0x10')](_0xf955('0x17'),auth[_0xf955('0x8')](),controller[_0xf955('0x18')]);router['put'](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0x19')]);router['delete'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x1a')]);router[_0xf955('0x1b')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x1d'),auth[_0xf955('0x8')](),controller[_0xf955('0x1e')]);router[_0xf955('0x1b')](_0xf955('0x13'),auth[_0xf955('0x8')](),controller[_0xf955('0x1f')]);module['exports']=router;
\ No newline at end of file
index a1cc0d2..5488c96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeab9=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x36fabd,_0x30a9e1){var _0x45c13f=function(_0x44afa4){while(--_0x44afa4){_0x36fabd['push'](_0x36fabd['shift']());}};_0x45c13f(++_0x30a9e1);}(_0xeab9,0xd1));var _0x9eab=function(_0x3f1403,_0x2cfd1a){_0x3f1403=_0x3f1403-0x0;var _0xb8103d=_0xeab9[_0x3f1403];return _0xb8103d;};'use strict';var Sequelize=require(_0x9eab('0x0'));var rs=require(_0x9eab('0x1'));module[_0x9eab('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x9eab('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x9eab('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x9eab('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9eab('0x5')]();}},'phone':{'type':Sequelize[_0x9eab('0x4')]},'type':{'type':Sequelize[_0x9eab('0x6')](_0x9eab('0x7'),_0x9eab('0x8'))},'accountSid':{'type':Sequelize[_0x9eab('0x4')]},'baseUrl':{'type':Sequelize[_0x9eab('0x4')]},'authToken':{'type':Sequelize[_0x9eab('0x4')]},'notificationTemplate':{'type':Sequelize[_0x9eab('0x9')],'defaultValue':function(){return _0x9eab('0xa');}},'notificationSound':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9eab('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9eab('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9eab('0xc')],'comment':_0x9eab('0xd')},'mandatoryDisposition':{'type':Sequelize[_0x9eab('0xb')],'defaultValue':![],'comment':_0x9eab('0xe'),'set':function(_0x518b9a){if(!_0x518b9a){this['setDataValue'](_0x9eab('0xf'),null);}this[_0x9eab('0x10')]('mandatoryDisposition',_0x518b9a);}},'description':{'type':Sequelize[_0x9eab('0x4')]}};
\ No newline at end of file
+var _0x467e=['twilio','sinch','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x4dcb2f,_0x428551){var _0x4bb638=function(_0x501f3c){while(--_0x501f3c){_0x4dcb2f['push'](_0x4dcb2f['shift']());}};_0x4bb638(++_0x428551);}(_0x467e,0x130));var _0xe467=function(_0xea4633,_0x595928){_0xea4633=_0xea4633-0x0;var _0x2e7e83=_0x467e[_0xea4633];return _0x2e7e83;};'use strict';var Sequelize=require(_0xe467('0x0'));var rs=require(_0xe467('0x1'));module[_0xe467('0x2')]={'name':{'type':Sequelize[_0xe467('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xe467('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xe467('0x3')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xe467('0x4'),_0xe467('0x5'))},'accountSid':{'type':Sequelize[_0xe467('0x3')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe467('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe467('0x6');}},'notificationSound':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe467('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe467('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe467('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe467('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe467('0xa'),'set':function(_0x124312){if(!_0x124312){this[_0xe467('0xb')](_0xe467('0xc'),null);}this['setDataValue'](_0xe467('0xd'),_0x124312);}},'description':{'type':Sequelize[_0xe467('0x3')]}};
\ No newline at end of file
index a613ddc..6d82978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a53=['messageId','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','CmList','List','user','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','then','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','get','WhatsappAccounts','UserProfileResource','end','stack','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','type','filter','options','where','include','findAll','rows','params','keys','rawAttributes','intersection','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','WhatsappAccountId','Disposition','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','Applications','account','statuses','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','twilio','from','From','whatsapp:'];(function(_0x10dc64,_0x11bb29){var _0x9cf98d=function(_0x558d71){while(--_0x558d71){_0x10dc64['push'](_0x10dc64['shift']());}};_0x9cf98d(++_0x11bb29);}(_0x0a53,0x1a2));var _0x30a5=function(_0x3f146c,_0x42e0dc){_0x3f146c=_0x3f146c-0x0;var _0x407f72=_0x0a53[_0x3f146c];return _0x407f72;};'use strict';var emlformat=require(_0x30a5('0x0'));var rimraf=require(_0x30a5('0x1'));var zipdir=require(_0x30a5('0x2'));var jsonpatch=require(_0x30a5('0x3'));var rp=require('request-promise');var moment=require(_0x30a5('0x4'));var BPromise=require(_0x30a5('0x5'));var Mustache=require('mustache');var util=require(_0x30a5('0x6'));var path=require('path');var sox=require(_0x30a5('0x7'));var csv=require(_0x30a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x30a5('0x9'));var _=require('lodash');var squel=require(_0x30a5('0xa'));var crypto=require('crypto');var jsforce=require(_0x30a5('0xb'));var deskjs=require(_0x30a5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x30a5('0xd'));var Papa=require(_0x30a5('0xe'));var Redis=require(_0x30a5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x30a5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x30a5('0x11'));var logger=require('../../config/logger')(_0x30a5('0x12'));var utils=require(_0x30a5('0x13'));var config=require(_0x30a5('0x14'));var licenseUtil=require(_0x30a5('0x15'));var db=require(_0x30a5('0x16'))['db'];config[_0x30a5('0x17')]=_[_0x30a5('0x18')](config[_0x30a5('0x17')],{'host':_0x30a5('0x19'),'port':0x18eb});var socket=require(_0x30a5('0x1a'))(new Redis(config[_0x30a5('0x17')]));require(_0x30a5('0x1b'))['register'](socket);var jayson=require(_0x30a5('0x1c'));var client=jayson[_0x30a5('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2ddfa9,_0x36db76,_0x179445,_0x21e02c){return new BPromise(function(_0x99879e,_0x4d71ab){var _0x18c539=_0x21e02c||client;return _0x18c539[_0x30a5('0x1e')](_0x2ddfa9,_0x179445)[_0x30a5('0x1f')](function(_0x4a2ac9){logger['info'](_0x30a5('0x20'),_0x36db76,'request\x20sent');logger[_0x30a5('0x21')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x36db76,_0x30a5('0x22'),JSON[_0x30a5('0x23')](_0x4a2ac9));if(_0x4a2ac9['error']){if(_0x4a2ac9[_0x30a5('0x24')]['code']===0x1f4){logger['error'](_0x30a5('0x20'),_0x36db76,_0x4a2ac9['error'][_0x30a5('0x25')]);return _0x4d71ab(_0x4a2ac9[_0x30a5('0x24')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x36db76,_0x4a2ac9['error']['message']);return _0x99879e(_0x4a2ac9[_0x30a5('0x24')][_0x30a5('0x25')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x36db76,_0x30a5('0x22'));_0x99879e(_0x4a2ac9[_0x30a5('0x26')]['message']);}})[_0x30a5('0x27')](function(_0x13d804){logger[_0x30a5('0x24')](_0x30a5('0x20'),_0x36db76,_0x13d804);_0x4d71ab(_0x13d804);});});}function respondWithStatusCode(_0x4f06b7,_0x41447b){_0x41447b=_0x41447b||0xcc;return function(_0x3781d8){if(_0x3781d8){return _0x4f06b7[_0x30a5('0x28')](_0x41447b);}return _0x4f06b7[_0x30a5('0x29')](_0x41447b)['end']();};}function respondWithResult(_0x394399,_0x2fdfa5){_0x2fdfa5=_0x2fdfa5||0xc8;return function(_0x48ff02){if(_0x48ff02){return _0x394399[_0x30a5('0x29')](_0x2fdfa5)[_0x30a5('0x2a')](_0x48ff02);}};}function respondWithFilteredResult(_0xa33a7e,_0x1d5dc6){return function(_0x2af9db){if(_0x2af9db){var _0x5e9b73=typeof _0x1d5dc6[_0x30a5('0x2b')]===_0x30a5('0x2c')&&typeof _0x1d5dc6[_0x30a5('0x2d')]===_0x30a5('0x2c');var _0x3e6285=_0x2af9db['count'];var _0x145191=_0x5e9b73?0x0:_0x1d5dc6[_0x30a5('0x2b')];var _0x8319d9=_0x5e9b73?_0x2af9db[_0x30a5('0x2e')]:_0x1d5dc6[_0x30a5('0x2b')]+_0x1d5dc6[_0x30a5('0x2d')];var _0x4f24d5;if(_0x8319d9>=_0x3e6285){_0x8319d9=_0x3e6285;_0x4f24d5=0xc8;}else{_0x4f24d5=0xce;}_0xa33a7e[_0x30a5('0x29')](_0x4f24d5);return _0xa33a7e['set'](_0x30a5('0x2f'),_0x145191+'-'+_0x8319d9+'/'+_0x3e6285)[_0x30a5('0x2a')](_0x2af9db);}return null;};}function patchUpdates(_0x3eb78a){return function(_0x3f92e1){try{jsonpatch[_0x30a5('0x30')](_0x3f92e1,_0x3eb78a,!![]);}catch(_0x4ae30b){return BPromise[_0x30a5('0x31')](_0x4ae30b);}return _0x3f92e1['save']();};}function saveUpdates(_0x50a8d1,_0x30767e){return function(_0x9ac34d){if(_0x9ac34d){return _0x9ac34d[_0x30a5('0x32')](_0x50a8d1)[_0x30a5('0x1f')](function(_0x103609){return _0x103609;});}return null;};}function removeEntity(_0x4ebb1e,_0x328e7e){return function(_0x23f488){if(_0x23f488){return _0x23f488[_0x30a5('0x33')]()['then'](function(){var _0x545edf=_0x23f488[_0x30a5('0x34')]({'plain':!![]});var _0x434854=_0x30a5('0x35');return db[_0x30a5('0x36')][_0x30a5('0x33')]({'where':{'type':_0x434854,'resourceId':_0x545edf['id']}})[_0x30a5('0x1f')](function(){return _0x23f488;});})[_0x30a5('0x1f')](function(){_0x4ebb1e[_0x30a5('0x29')](0xcc)[_0x30a5('0x37')]();});}};}function handleEntityNotFound(_0x3a3093,_0x6942e0){return function(_0x18d2cf){if(!_0x18d2cf){_0x3a3093['sendStatus'](0x194);}return _0x18d2cf;};}function handleError(_0x10038b,_0x13d5e5){_0x13d5e5=_0x13d5e5||0x1f4;return function(_0x54efa6){logger[_0x30a5('0x24')](_0x54efa6[_0x30a5('0x38')]);if(_0x54efa6[_0x30a5('0x39')]){delete _0x54efa6['name'];}_0x10038b[_0x30a5('0x29')](_0x13d5e5)[_0x30a5('0x3a')](_0x54efa6);};}exports['index']=function(_0x1ca975,_0x11ce38){var _0x45661a={'include':[{'model':db[_0x30a5('0x3b')],'as':_0x30a5('0x3c')}]},_0x219cfc={},_0x3cc2ae={'count':0x0,'rows':[]};var _0x482366=_[_0x30a5('0x3d')](db[_0x30a5('0x3e')]['rawAttributes'],function(_0x1067d0){return{'name':_0x1067d0['fieldName'],'type':_0x1067d0['type'][_0x30a5('0x3f')]};});_0x219cfc['model']=_[_0x30a5('0x3d')](_0x482366,'name');_0x219cfc[_0x30a5('0x40')]=_['keys'](_0x1ca975['query']);_0x219cfc[_0x30a5('0x41')]=_['intersection'](_0x219cfc[_0x30a5('0x42')],_0x219cfc['query']);_0x45661a[_0x30a5('0x43')]=_['intersection'](_0x219cfc[_0x30a5('0x42')],qs[_0x30a5('0x44')](_0x1ca975['query']['fields']));_0x45661a[_0x30a5('0x43')]=_0x45661a['attributes'][_0x30a5('0x45')]?_0x45661a[_0x30a5('0x43')]:_0x219cfc['model'];if(!_0x1ca975[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x45661a[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x1ca975['query'][_0x30a5('0x2d')]);_0x45661a[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x1ca975[_0x30a5('0x40')][_0x30a5('0x2b')]);}_0x45661a[_0x30a5('0x48')]=qs[_0x30a5('0x49')](_0x1ca975[_0x30a5('0x40')]['sort']);_0x45661a['where']=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x1ca975['query'],_0x219cfc['filters']),_0x482366);if(_0x1ca975[_0x30a5('0x40')]['filter']){_0x45661a['where']=_[_0x30a5('0x4b')](_0x45661a['where'],{'$or':_[_0x30a5('0x3d')](_0x482366,function(_0x37b030){if(_0x37b030[_0x30a5('0x4c')]!=='VIRTUAL'){var _0x53c46d={};_0x53c46d[_0x37b030[_0x30a5('0x39')]]={'$like':'%'+_0x1ca975[_0x30a5('0x40')][_0x30a5('0x4d')]+'%'};return _0x53c46d;}})});}_0x45661a=_['merge']({},_0x45661a,_0x1ca975[_0x30a5('0x4e')]);var _0xa54377={'where':_0x45661a[_0x30a5('0x4f')]};return db[_0x30a5('0x3e')][_0x30a5('0x2e')](_0xa54377)['then'](function(_0x570bc4){_0x3cc2ae[_0x30a5('0x2e')]=_0x570bc4;if(_0x1ca975[_0x30a5('0x40')]['includeAll']){_0x45661a[_0x30a5('0x50')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x30a5('0x51')](_0x45661a);})[_0x30a5('0x1f')](function(_0x249a12){_0x3cc2ae[_0x30a5('0x52')]=_0x249a12;return _0x3cc2ae;})[_0x30a5('0x1f')](respondWithFilteredResult(_0x11ce38,_0x45661a))[_0x30a5('0x27')](handleError(_0x11ce38,null));};exports['show']=function(_0x41919d,_0x1aadc1){var _0x129a74={'raw':![],'where':{'id':_0x41919d[_0x30a5('0x53')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x5ad9c8={};_0x5ad9c8['model']=_[_0x30a5('0x54')](db[_0x30a5('0x3e')][_0x30a5('0x55')]);_0x5ad9c8['query']=_[_0x30a5('0x54')](_0x41919d['query']);_0x5ad9c8[_0x30a5('0x41')]=_[_0x30a5('0x56')](_0x5ad9c8[_0x30a5('0x42')],_0x5ad9c8[_0x30a5('0x40')]);_0x129a74[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x5ad9c8[_0x30a5('0x42')],qs['fields'](_0x41919d[_0x30a5('0x40')]['fields']));_0x129a74[_0x30a5('0x43')]=_0x129a74['attributes'][_0x30a5('0x45')]?_0x129a74[_0x30a5('0x43')]:_0x5ad9c8[_0x30a5('0x42')];if(_0x41919d[_0x30a5('0x40')][_0x30a5('0x57')]){_0x129a74[_0x30a5('0x50')]=[{'all':!![]}];}_0x129a74=_[_0x30a5('0x4b')]({},_0x129a74,_0x41919d[_0x30a5('0x4e')]);return db[_0x30a5('0x3e')][_0x30a5('0x58')](_0x129a74)['then'](handleEntityNotFound(_0x1aadc1,null))[_0x30a5('0x1f')](respondWithResult(_0x1aadc1,null))['catch'](handleError(_0x1aadc1,null));};exports['create']=function(_0x2ef39d,_0x48468c){return db['WhatsappAccount'][_0x30a5('0x59')](_0x2ef39d['body'],{})[_0x30a5('0x1f')](function(_0x4be4a2){var _0x2f860a=_0x2ef39d['user'][_0x30a5('0x34')]({'plain':!![]});if(!_0x2f860a)throw new Error(_0x30a5('0x5a'));if(_0x2f860a[_0x30a5('0x5b')]==='user'){var _0x1afca3=_0x4be4a2[_0x30a5('0x34')]({'plain':!![]});var _0x3f9627=_0x30a5('0x35');return db[_0x30a5('0x5c')][_0x30a5('0x58')]({'where':{'name':_0x3f9627,'userProfileId':_0x2f860a['userProfileId']},'raw':!![]})[_0x30a5('0x1f')](function(_0x30c6d7){if(_0x30c6d7&&_0x30c6d7[_0x30a5('0x5d')]===0x0){return db['UserProfileResource'][_0x30a5('0x59')]({'name':_0x1afca3['name'],'resourceId':_0x1afca3['id'],'type':_0x30c6d7[_0x30a5('0x39')],'sectionId':_0x30c6d7['id']},{})[_0x30a5('0x1f')](function(){return _0x4be4a2;});}else{return _0x4be4a2;}})[_0x30a5('0x27')](function(_0x2ef3b2){logger['error'](_0x30a5('0x5e'),_0x2ef3b2);throw _0x2ef3b2;});}return _0x4be4a2;})[_0x30a5('0x1f')](respondWithResult(_0x48468c,0xc9))[_0x30a5('0x27')](handleError(_0x48468c,null));};exports['update']=function(_0x477a02,_0x36902d){if(_0x477a02['body']['id']){delete _0x477a02[_0x30a5('0x5f')]['id'];}return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x477a02['params']['id']},'include':[{'model':db[_0x30a5('0x3b')],'as':_0x30a5('0x3c')}]})['then'](handleEntityNotFound(_0x36902d,null))[_0x30a5('0x1f')](saveUpdates(_0x477a02[_0x30a5('0x5f')],null))['then'](respondWithResult(_0x36902d,null))[_0x30a5('0x27')](handleError(_0x36902d,null));};exports['destroy']=function(_0x4b6235,_0x1346bb){return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x4b6235[_0x30a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x1346bb,null))['then'](removeEntity(_0x1346bb,null))[_0x30a5('0x27')](handleError(_0x1346bb,null));};exports[_0x30a5('0x60')]=function(_0x6c89e7,_0x6afc1a){return db[_0x30a5('0x3e')][_0x30a5('0x60')]()[_0x30a5('0x1f')](respondWithResult(_0x6afc1a,null))[_0x30a5('0x27')](handleError(_0x6afc1a,null));};exports['addDisposition']=function(_0x4f5a37,_0x18e8e8,_0x43eb00){if(_0x4f5a37['body']['id']){delete _0x4f5a37[_0x30a5('0x5f')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x4f5a37[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x18e8e8,null))[_0x30a5('0x1f')](function(_0xa0241){if(_0xa0241){_0x4f5a37[_0x30a5('0x5f')][_0x30a5('0x61')]=_0xa0241['id'];return db[_0x30a5('0x62')]['create'](_0x4f5a37[_0x30a5('0x5f')]);}})[_0x30a5('0x1f')](respondWithResult(_0x18e8e8,null))[_0x30a5('0x27')](handleError(_0x18e8e8,null));};exports['getDispositions']=function(_0x123d05,_0x58ea30,_0xec3f84){var _0x3ea338={'raw':![],'where':{}};var _0x35c092={};var _0x5c7e87={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x123d05['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x58ea30,null))['then'](function(_0x310e35){if(_0x310e35){_0x35c092[_0x30a5('0x42')]=_[_0x30a5('0x54')](db['Disposition'][_0x30a5('0x55')]);_0x35c092[_0x30a5('0x40')]=_[_0x30a5('0x54')](_0x123d05[_0x30a5('0x40')]);_0x35c092[_0x30a5('0x41')]=_[_0x30a5('0x56')](_0x35c092[_0x30a5('0x42')],_0x35c092[_0x30a5('0x40')]);_0x3ea338['attributes']=_[_0x30a5('0x56')](_0x35c092['model'],qs[_0x30a5('0x44')](_0x123d05[_0x30a5('0x40')][_0x30a5('0x44')]));_0x3ea338[_0x30a5('0x43')]=_0x3ea338[_0x30a5('0x43')]['length']?_0x3ea338[_0x30a5('0x43')]:_0x35c092[_0x30a5('0x42')];if(!_0x123d05[_0x30a5('0x40')]['hasOwnProperty'](_0x30a5('0x47'))){_0x3ea338[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x123d05['query']['limit']);_0x3ea338[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x123d05[_0x30a5('0x40')][_0x30a5('0x2b')]);}_0x3ea338[_0x30a5('0x48')]=qs[_0x30a5('0x49')](_0x123d05[_0x30a5('0x40')][_0x30a5('0x49')]);_0x3ea338[_0x30a5('0x4f')]=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x123d05[_0x30a5('0x40')],_0x35c092[_0x30a5('0x41')]));_0x3ea338[_0x30a5('0x4f')]['WhatsappAccountId']=_0x310e35['id'];if(_0x123d05[_0x30a5('0x40')][_0x30a5('0x4d')]){_0x3ea338[_0x30a5('0x4f')]=_[_0x30a5('0x4b')](_0x3ea338[_0x30a5('0x4f')],{'$or':_[_0x30a5('0x3d')](_0x3ea338[_0x30a5('0x43')],function(_0x22004e){var _0x470436={};_0x470436[_0x22004e]={'$like':'%'+_0x123d05['query'][_0x30a5('0x4d')]+'%'};return _0x470436;})});}_0x3ea338=_[_0x30a5('0x4b')]({},_0x3ea338,_0x123d05['options']);return db[_0x30a5('0x62')][_0x30a5('0x2e')]({'where':_0x3ea338['where']})[_0x30a5('0x1f')](function(_0x5d8df9){_0x5c7e87['count']=_0x5d8df9;if(_0x123d05[_0x30a5('0x40')][_0x30a5('0x57')]){_0x3ea338[_0x30a5('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x30a5('0x51')](_0x3ea338);})[_0x30a5('0x1f')](function(_0xa3e896){_0x5c7e87['rows']=_0xa3e896;return _0x5c7e87;});}})[_0x30a5('0x1f')](respondWithFilteredResult(_0x58ea30,_0x3ea338))[_0x30a5('0x27')](handleError(_0x58ea30,null));};exports[_0x30a5('0x63')]=function(_0x4e6fc1,_0x44fd65,_0xfa265c){return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x4e6fc1[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x44fd65,null))[_0x30a5('0x1f')](function(_0x2be790){if(_0x2be790){return _0x2be790[_0x30a5('0x63')](_0x4e6fc1[_0x30a5('0x40')][_0x30a5('0x64')]);}})[_0x30a5('0x1f')](respondWithStatusCode(_0x44fd65,null))['catch'](handleError(_0x44fd65,null));};exports[_0x30a5('0x65')]=function(_0xab9a23,_0x3c83d4,_0x13239f){if(_0xab9a23[_0x30a5('0x5f')]['id']){delete _0xab9a23[_0x30a5('0x5f')]['id'];}return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0xab9a23[_0x30a5('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c83d4,null))[_0x30a5('0x1f')](function(_0x59e422){if(_0x59e422){_0xab9a23[_0x30a5('0x5f')][_0x30a5('0x61')]=_0x59e422['id'];return db['CannedAnswer'][_0x30a5('0x59')](_0xab9a23['body']);}})['then'](respondWithResult(_0x3c83d4,null))[_0x30a5('0x27')](handleError(_0x3c83d4,null));};exports[_0x30a5('0x66')]=function(_0x18f69c,_0x2f83b3,_0x29c6d2){var _0x43871c={'raw':![],'where':{}};var _0x4e11dd={};var _0x3ac736={'count':0x0,'rows':[]};return db[_0x30a5('0x3e')][_0x30a5('0x67')]({'where':{'id':_0x18f69c['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x2f83b3,null))[_0x30a5('0x1f')](function(_0x1c4353){if(_0x1c4353){_0x4e11dd[_0x30a5('0x42')]=_[_0x30a5('0x54')](db[_0x30a5('0x68')][_0x30a5('0x55')]);_0x4e11dd[_0x30a5('0x40')]=_[_0x30a5('0x54')](_0x18f69c[_0x30a5('0x40')]);_0x4e11dd[_0x30a5('0x41')]=_[_0x30a5('0x56')](_0x4e11dd[_0x30a5('0x42')],_0x4e11dd['query']);_0x43871c[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x4e11dd[_0x30a5('0x42')],qs[_0x30a5('0x44')](_0x18f69c[_0x30a5('0x40')]['fields']));_0x43871c[_0x30a5('0x43')]=_0x43871c['attributes'][_0x30a5('0x45')]?_0x43871c[_0x30a5('0x43')]:_0x4e11dd['model'];if(!_0x18f69c[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x43871c[_0x30a5('0x2d')]=qs['limit'](_0x18f69c[_0x30a5('0x40')][_0x30a5('0x2d')]);_0x43871c[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x18f69c[_0x30a5('0x40')]['offset']);}_0x43871c[_0x30a5('0x48')]=qs[_0x30a5('0x49')](_0x18f69c[_0x30a5('0x40')][_0x30a5('0x49')]);_0x43871c[_0x30a5('0x4f')]=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x18f69c[_0x30a5('0x40')],_0x4e11dd[_0x30a5('0x41')]));_0x43871c['where'][_0x30a5('0x61')]=_0x1c4353['id'];if(_0x18f69c['query'][_0x30a5('0x4d')]){_0x43871c['where']=_[_0x30a5('0x4b')](_0x43871c['where'],{'$or':_['map'](_0x43871c['attributes'],function(_0x2d9311){var _0x5840d1={};_0x5840d1[_0x2d9311]={'$like':'%'+_0x18f69c['query']['filter']+'%'};return _0x5840d1;})});}_0x43871c=_[_0x30a5('0x4b')]({},_0x43871c,_0x18f69c[_0x30a5('0x4e')]);return db[_0x30a5('0x68')][_0x30a5('0x2e')]({'where':_0x43871c[_0x30a5('0x4f')]})[_0x30a5('0x1f')](function(_0xdeaa80){_0x3ac736[_0x30a5('0x2e')]=_0xdeaa80;if(_0x18f69c['query']['includeAll']){_0x43871c[_0x30a5('0x50')]=[{'all':!![]}];}return db[_0x30a5('0x68')][_0x30a5('0x51')](_0x43871c);})[_0x30a5('0x1f')](function(_0x39c107){_0x3ac736['rows']=_0x39c107;return _0x3ac736;});}})[_0x30a5('0x1f')](respondWithFilteredResult(_0x2f83b3,_0x43871c))['catch'](handleError(_0x2f83b3,null));};exports[_0x30a5('0x69')]=function(_0x20238c,_0x44b42f,_0x76a43a){return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x20238c[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x44b42f,null))[_0x30a5('0x1f')](function(_0x3d2288){if(_0x3d2288){return _0x3d2288[_0x30a5('0x69')](_0x20238c[_0x30a5('0x40')][_0x30a5('0x64')]);}})[_0x30a5('0x1f')](respondWithStatusCode(_0x44b42f,null))[_0x30a5('0x27')](handleError(_0x44b42f,null));};exports[_0x30a5('0x6a')]=function(_0x5a3f47,_0x136337,_0x23ce1c){return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x5a3f47[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x136337,null))['then'](function(_0x49e870){if(_0x49e870){return _0x49e870['addAgents'](_0x5a3f47['body'][_0x30a5('0x64')],_[_0x30a5('0x6b')](_0x5a3f47[_0x30a5('0x5f')],[_0x30a5('0x64'),'id'])||{})[_0x30a5('0x6c')](function(_0x3393fc){for(var _0x3315c3=0x0;_0x3315c3<_0x5a3f47[_0x30a5('0x5f')][_0x30a5('0x64')][_0x30a5('0x45')];_0x3315c3+=0x1){socket[_0x30a5('0x6d')]('userWhatsappAccount:save',{'UserId':Number(_0x5a3f47['body'][_0x30a5('0x64')][_0x3315c3]),'WhatsappAccountId':Number(_0x5a3f47[_0x30a5('0x53')]['id'])});}return _0x3393fc;});}})[_0x30a5('0x1f')](respondWithResult(_0x136337,null))[_0x30a5('0x27')](handleError(_0x136337,null));};exports[_0x30a5('0x6e')]=function(_0x16090c,_0x30c6b8,_0x9f876d){return db['WhatsappAccount'][_0x30a5('0x58')]({'where':{'id':_0x16090c[_0x30a5('0x53')]['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x30c6b8,null))[_0x30a5('0x1f')](function(_0x240d11){if(_0x240d11){return _0x240d11[_0x30a5('0x6e')](_0x16090c[_0x30a5('0x40')]['ids'])[_0x30a5('0x1f')](function(){if(_['isArray'](_0x16090c[_0x30a5('0x40')][_0x30a5('0x64')])){for(var _0x513a54=0x0;_0x513a54<_0x16090c[_0x30a5('0x40')][_0x30a5('0x64')][_0x30a5('0x45')];_0x513a54+=0x1){socket[_0x30a5('0x6d')](_0x30a5('0x6f'),{'UserId':Number(_0x16090c['query'][_0x30a5('0x64')][_0x513a54]),'WhatsappAccountId':Number(_0x16090c[_0x30a5('0x53')]['id'])});}}else{socket[_0x30a5('0x6d')](_0x30a5('0x6f'),{'UserId':Number(_0x16090c[_0x30a5('0x40')][_0x30a5('0x64')]),'WhatsappAccountId':Number(_0x16090c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x30c6b8,null))[_0x30a5('0x27')](handleError(_0x30c6b8,null));};exports[_0x30a5('0x70')]=function(_0x514b74,_0x1eabfb,_0x3c5b37){var _0x39833d={};var _0x590414={};var _0xef8dca;var _0x366b3d;return db[_0x30a5('0x3e')][_0x30a5('0x67')]({'where':{'id':_0x514b74['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x1eabfb,null))[_0x30a5('0x1f')](function(_0x259716){if(_0x259716){_0xef8dca=_0x259716;_0x590414[_0x30a5('0x42')]=_[_0x30a5('0x54')](db[_0x30a5('0x71')][_0x30a5('0x55')]);_0x590414['query']=_[_0x30a5('0x54')](_0x514b74[_0x30a5('0x40')]);_0x590414[_0x30a5('0x41')]=_['intersection'](_0x590414[_0x30a5('0x42')],_0x590414[_0x30a5('0x40')]);_0x39833d[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x590414[_0x30a5('0x42')],qs[_0x30a5('0x44')](_0x514b74[_0x30a5('0x40')]['fields']));_0x39833d[_0x30a5('0x43')]=_0x39833d['attributes']['length']?_0x39833d[_0x30a5('0x43')]:_0x590414[_0x30a5('0x42')];_0x39833d[_0x30a5('0x48')]=qs['sort'](_0x514b74[_0x30a5('0x40')]['sort']);_0x39833d['where']=qs[_0x30a5('0x41')](_[_0x30a5('0x4a')](_0x514b74['query'],_0x590414[_0x30a5('0x41')]));if(_0x514b74[_0x30a5('0x40')][_0x30a5('0x4d')]){_0x39833d[_0x30a5('0x4f')]=_['merge'](_0x39833d[_0x30a5('0x4f')],{'$or':_['map'](_0x39833d[_0x30a5('0x43')],function(_0x558aef){var _0x4cc683={};_0x4cc683[_0x558aef]={'$like':'%'+_0x514b74['query'][_0x30a5('0x4d')]+'%'};return _0x4cc683;})});}_0x39833d=_['merge']({},_0x39833d,_0x514b74[_0x30a5('0x4e')]);return _0xef8dca['getAgents'](_0x39833d);}})['then'](function(_0x69aaf5){if(_0x69aaf5){_0x366b3d=_0x69aaf5[_0x30a5('0x45')];if(!_0x514b74[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x39833d[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x514b74[_0x30a5('0x40')]['limit']);_0x39833d['offset']=qs['offset'](_0x514b74[_0x30a5('0x40')][_0x30a5('0x2b')]);}return _0xef8dca[_0x30a5('0x70')](_0x39833d);}})['then'](function(_0x54429e){if(_0x54429e){return _0x54429e?{'count':_0x366b3d,'rows':_0x54429e}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x1eabfb,null))[_0x30a5('0x27')](handleError(_0x1eabfb,null));};exports['addApplications']=function(_0x3d1f14,_0xb1d572){var _0x1f7ef7=_0x3d1f14['params']['id'];var _0x32e2f9=_0x3d1f14[_0x30a5('0x5f')];var _0x5e435b=0xc8;var _0x1ea0f2=null;return db[_0x30a5('0x72')][_0x30a5('0x73')]({'isolationLevel':db[_0x30a5('0x72')][_0x30a5('0x74')][_0x30a5('0x75')]['READ_COMMITTED']},function(_0x9c4a97){return db['WhatsappAccount']['findOne']({'where':{'id':_0x1f7ef7},'transaction':_0x9c4a97})['then'](function(_0x4e8583){if(_0x4e8583){return db[_0x30a5('0x76')][_0x30a5('0x33')]({'where':{'WhatsappAccountId':_0x1f7ef7},'transaction':_0x9c4a97})[_0x30a5('0x1f')](function(){var _0x4423c6=_['map'](_0x32e2f9,function(_0x16f029){_0x16f029[_0x30a5('0x61')]=_0x1f7ef7;return _0x16f029;});return db[_0x30a5('0x76')][_0x30a5('0x77')](_0x4423c6,{'transaction':_0x9c4a97});});}else{_0x5e435b=0x194;_0x1ea0f2=[];}});})[_0x30a5('0x1f')](function(){if(_0x5e435b!==0x194){return db['WhatsappApplication'][_0x30a5('0x78')]({'where':{'WhatsappAccountId':_0x1f7ef7},'order':_0x30a5('0x79')})['then'](function(_0x53be9e){_0x1ea0f2=_0x53be9e;});}})['catch'](function(_0x3ba9f8){_0x5e435b=0x1f4;logger['error'](_0x3ba9f8[_0x30a5('0x38')]);if(_0x3ba9f8[_0x30a5('0x39')]){delete _0x3ba9f8[_0x30a5('0x39')];}_0x1ea0f2=_0x3ba9f8;})[_0x30a5('0x7a')](function(){if(_0x1ea0f2===null){_0xb1d572['sendStatus'](_0x5e435b);}else{if(_0x5e435b===0x1f4){_0xb1d572[_0x30a5('0x29')](_0x5e435b)['send'](_0x1ea0f2);}else{_0xb1d572[_0x30a5('0x29')](_0x5e435b)[_0x30a5('0x2a')](_0x1ea0f2);}}});};exports[_0x30a5('0x7b')]=function(_0x3f43be,_0x4f95c7,_0x5cdde2){var _0x3830f2={};var _0x235c24={};var _0x1666ad;var _0x10f873;return db[_0x30a5('0x3e')][_0x30a5('0x67')]({'where':{'id':_0x3f43be['params']['id']}})[_0x30a5('0x1f')](handleEntityNotFound(_0x4f95c7,null))[_0x30a5('0x1f')](function(_0x43b943){if(_0x43b943){_0x1666ad=_0x43b943;_0x235c24[_0x30a5('0x42')]=_[_0x30a5('0x54')](db['WhatsappApplication']['rawAttributes']);_0x235c24[_0x30a5('0x40')]=_['keys'](_0x3f43be[_0x30a5('0x40')]);_0x235c24[_0x30a5('0x41')]=_['intersection'](_0x235c24[_0x30a5('0x42')],_0x235c24[_0x30a5('0x40')]);_0x3830f2[_0x30a5('0x43')]=_[_0x30a5('0x56')](_0x235c24['model'],qs[_0x30a5('0x44')](_0x3f43be['query'][_0x30a5('0x44')]));_0x3830f2[_0x30a5('0x43')]=_0x3830f2[_0x30a5('0x43')][_0x30a5('0x45')]?_0x3830f2['attributes']:_0x235c24['model'];_0x3830f2[_0x30a5('0x48')]=qs['sort'](_0x3f43be[_0x30a5('0x40')][_0x30a5('0x49')]);_0x3830f2[_0x30a5('0x4f')]=qs[_0x30a5('0x41')](_['pick'](_0x3f43be['query'],_0x235c24['filters']));if(_0x3f43be[_0x30a5('0x40')]['filter']){_0x3830f2[_0x30a5('0x4f')]=_['merge'](_0x3830f2['where'],{'$or':_[_0x30a5('0x3d')](_0x3830f2['attributes'],function(_0x484f5c){var _0xb09e24={};_0xb09e24[_0x484f5c]={'$like':'%'+_0x3f43be['query'][_0x30a5('0x4d')]+'%'};return _0xb09e24;})});}_0x3830f2=_[_0x30a5('0x4b')]({},_0x3830f2,_0x3f43be['options']);return _0x1666ad[_0x30a5('0x7b')](_0x3830f2);}})['then'](function(_0xdce962){if(_0xdce962){_0x10f873=_0xdce962[_0x30a5('0x45')];if(!_0x3f43be[_0x30a5('0x40')][_0x30a5('0x46')](_0x30a5('0x47'))){_0x3830f2[_0x30a5('0x2d')]=qs[_0x30a5('0x2d')](_0x3f43be['query']['limit']);_0x3830f2[_0x30a5('0x2b')]=qs[_0x30a5('0x2b')](_0x3f43be[_0x30a5('0x40')]['offset']);}return _0x1666ad[_0x30a5('0x7b')](_0x3830f2);}})['then'](function(_0xff4641){if(_0xff4641){return _0xff4641?{'count':_0x10f873,'rows':_0xff4641}:null;}})[_0x30a5('0x1f')](respondWithResult(_0x4f95c7,null))[_0x30a5('0x27')](handleError(_0x4f95c7,null));};exports[_0x30a5('0x7c')]=function(_0x388c34,_0x4bead1,_0x133e43){var _0x481ee0={'channel':_0x30a5('0x7d')};var _0x5d1acd=[];var _0x67372c=[];var _0x159b99={};return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x388c34[_0x30a5('0x53')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x30a5('0x7e')}]})[_0x30a5('0x1f')](handleEntityNotFound(_0x4bead1,null))[_0x30a5('0x1f')](function(_0x3021c5){_0x481ee0[_0x30a5('0x7f')]=_0x3021c5;if(_0x481ee0[_0x30a5('0x7f')]&&_0x481ee0['account']['type']==='sinch'&&_0x388c34[_0x30a5('0x5f')][_0x30a5('0x80')]){if(_0x388c34[_0x30a5('0x5f')][_0x30a5('0x80')][_0x30a5('0x45')]===0x0)return;if(_0x388c34['body'][_0x30a5('0x80')][0x0]['state']!=='read')return;return db[_0x30a5('0x81')][_0x30a5('0x32')]({'read':!![],'readAt':_0x388c34['body'][_0x30a5('0x80')][0x0][_0x30a5('0x82')]},{'where':{'messageId':_0x388c34['body'][_0x30a5('0x80')][0x0][_0x30a5('0x83')]},'individualHooks':!![]})[_0x30a5('0x1f')](function(_0x43849b){return _0x4bead1['status'](0xc8)[_0x30a5('0x2a')](_0x43849b);});}_0x481ee0[_0x30a5('0x84')]=_[_0x30a5('0x85')](_0x3021c5[_0x30a5('0x7e')],[_0x30a5('0x79')],[_0x30a5('0x86')]);if(_0x481ee0[_0x30a5('0x7f')][_0x30a5('0x7e')]){delete _0x481ee0[_0x30a5('0x7f')][_0x30a5('0x7e')];}return db['CmContact'][_0x30a5('0x60')]()[_0x30a5('0x1f')](function(_0x4dd1f0){if(!_0x4dd1f0){throw new db[(_0x30a5('0x87'))][(_0x30a5('0x88'))](_0x30a5('0x89'));}_0x5d1acd=_['difference'](_[_0x30a5('0x54')](_0x4dd1f0),['createdAt',_0x30a5('0x8a')]);_0x67372c=_[_0x30a5('0x8b')](_[_0x30a5('0x54')](_0x4dd1f0),[_0x30a5('0x8c'),_0x30a5('0x8a'),_0x30a5('0x8d'),'ListId']);_0x481ee0[_0x30a5('0x5f')]={'mapKey':'mobile'};if(_0x481ee0[_0x30a5('0x7f')]&&_0x481ee0[_0x30a5('0x7f')][_0x30a5('0x4c')]===_0x30a5('0x8e')){_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')]=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x90')]['replace'](_0x30a5('0x91'),'');_0x481ee0[_0x30a5('0x5f')]['body']=_0x388c34['body']['Body'];_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x92')]=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x93')];}if(_0x481ee0['account']&&_0x481ee0[_0x30a5('0x7f')]['type']===_0x30a5('0x94')){_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')]=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x95')][0x0]['from'];_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')]=_0x388c34['body']['notifications'][0x0][_0x30a5('0x25')][_0x30a5('0x5f')];_0x481ee0[_0x30a5('0x5f')]['messageId']=_0x388c34[_0x30a5('0x5f')][_0x30a5('0x95')][0x0][_0x30a5('0x83')];}if(_0x481ee0[_0x30a5('0x5f')]['id']){delete _0x481ee0[_0x30a5('0x5f')]['id'];}if(_[_0x30a5('0x96')](_0x481ee0[_0x30a5('0x5f')]['from'])){throw new db[(_0x30a5('0x87'))]['ValidationError'](_0x30a5('0x97'));}if(_['isNil'](_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')])||_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')]===''){throw new db[(_0x30a5('0x87'))][(_0x30a5('0x88'))](_0x30a5('0x98'));}if(_['isNil'](_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x99')])){throw new db['Sequelize'][(_0x30a5('0x88'))](_0x30a5('0x9a')+_0x67372c);}if(!_[_0x30a5('0x9b')](_0x67372c,_0x481ee0[_0x30a5('0x5f')]['mapKey'])){throw new db[(_0x30a5('0x87'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x67372c);}_0x159b99[_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x99')]]=_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')];return db['CmList'][_0x30a5('0x58')]({'where':{'id':_0x481ee0['account']['ListId']},'include':[{'model':db[_0x30a5('0x9c')],'as':_0x30a5('0x9d'),'where':_0x159b99,'limit':0x1,'order':[[_0x30a5('0x8a'),_0x30a5('0x9e')]]}]});})[_0x30a5('0x1f')](handleEntityNotFound(_0x4bead1,null))[_0x30a5('0x1f')](function(_0x36b45b){if(_0x36b45b){_0x481ee0[_0x30a5('0x9f')]=_[_0x30a5('0x6b')](_0x36b45b,[_0x30a5('0x9d')]);if(_0x36b45b[_0x30a5('0x9d')]['length']){return _0x36b45b[_0x30a5('0x9d')][0x0];}var _0x10ecc5=_[_0x30a5('0x18')](_0x481ee0[_0x30a5('0x5f')],{'firstName':_0x481ee0[_0x30a5('0x5f')]['from'],'ListId':_0x36b45b['id']});_0x10ecc5[_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x99')]]=_0x481ee0['body'][_0x30a5('0x8f')];return db[_0x30a5('0x9c')]['create'](_0x10ecc5,{'fields':_0x5d1acd,'raw':!![]});}})[_0x30a5('0x1f')](handleEntityNotFound(_0x4bead1,null))[_0x30a5('0x1f')](function(_0x1b8b9e){if(_0x1b8b9e){_0x481ee0[_0x30a5('0xa0')]=_0x1b8b9e;var _0x31761c={'ContactId':_0x1b8b9e['id'],'phone':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')],'WhatsappAccountId':_0x388c34[_0x30a5('0x53')]['id']};var _0x1ec54f={'ContactId':_0x1b8b9e['id'],'WhatsappAccountId':_0x388c34['params']['id'],'closed':![]};return db[_0x30a5('0xa1')][_0x30a5('0x58')]({'where':_0x1ec54f})[_0x30a5('0x1f')](function(_0x260449){if(_0x260449){return[_0x260449,![]];}return db[_0x30a5('0xa1')][_0x30a5('0x59')](_0x31761c)[_0x30a5('0x1f')](function(_0x3942e0){return[_0x3942e0,!![]];});});}})['spread'](function(_0xe39052,_0x15bd20){_0x481ee0[_0x30a5('0xa2')]=_0xe39052[_0x30a5('0x34')]({'plain':!![]});_0x481ee0[_0x30a5('0xa2')][_0x30a5('0xa3')]=![];if(_0x15bd20){if(_0x481ee0['account']['autoclose']){_0x481ee0[_0x30a5('0x84')]['push']({'id':0x0,'priority':_0x481ee0[_0x30a5('0x84')][_0x30a5('0x45')]+0x1,'app':_0x30a5('0xa4'),'appdata':_0x30a5('0xa5'),'interval':_0x30a5('0xa6')});}_0x481ee0['interaction']['created']=!![];}return db[_0x30a5('0x81')][_0x30a5('0x59')]({'phone':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x8f')],'messageId':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x92')],'body':_0x481ee0[_0x30a5('0x5f')][_0x30a5('0x5f')],'WhatsappAccountId':_0x388c34[_0x30a5('0x53')]['id'],'WhatsappInteractionId':_0xe39052['id'],'direction':'in','ContactId':_0xe39052[_0x30a5('0xa7')],'AttachmentId':_0x481ee0['body'][_0x30a5('0xa8')]});})['then'](function(_0x311401){_0x481ee0[_0x30a5('0x25')]=_0x311401;if(_0x481ee0[_0x30a5('0xa2')][_0x30a5('0xa9')]){return db[_0x30a5('0x71')][_0x30a5('0x58')]({'attributes':['id',_0x30a5('0x39')],'where':{'id':_0x481ee0[_0x30a5('0xa2')][_0x30a5('0xa9')]}})[_0x30a5('0x1f')](function(_0x19c6cb){if(_0x19c6cb){_0x481ee0[_0x30a5('0x84')][_0x30a5('0xaa')]({'id':0x0,'priority':0x0,'app':_0x30a5('0xab'),'appdata':_0x19c6cb[_0x30a5('0x39')]+','+(_0x481ee0['account'][_0x30a5('0xac')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x30a5('0xad'),_0x30a5('0xae'),_0x481ee0);});}return respondWithRpcPromise(_0x30a5('0xad'),_0x30a5('0xae'),_0x481ee0);})[_0x30a5('0x1f')](function(_0x30b783){if(_0x30b783){var _0x2e2e29=0xc8;var _0x3c93dc=_0x30a5('0xaf');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3c93dc,_0x2e2e29,_0x30a5('0xb0'));logger[_0x30a5('0x21')](_0x30a5('0xb1'),_0x3c93dc,_0x2e2e29,_0x30a5('0xb0'),JSON[_0x30a5('0x23')](_0x30b783));if(_0x481ee0[_0x30a5('0x7f')]['type']===_0x30a5('0x8e')){return _0x4bead1['status'](_0x2e2e29)[_0x30a5('0xb2')](_0x30a5('0xb3'),_0x30a5('0xb4'))['send'](_0x30a5('0xb5'));}else{return _0x4bead1[_0x30a5('0x29')](_0x2e2e29)[_0x30a5('0x2a')](_0x30b783);}}});})[_0x30a5('0x27')](handleError(_0x4bead1,null));};exports[_0x30a5('0x3a')]=function(_0x1ab4c3,_0x10ba32,_0x839c31){var _0x42980d,_0x4172d7,_0x8631d2;if(_[_0x30a5('0x96')](_0x1ab4c3[_0x30a5('0x5f')][_0x30a5('0x5f')])||_0x1ab4c3['body'][_0x30a5('0x5f')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x30a5('0x96')](_0x1ab4c3[_0x30a5('0x5f')]['to'])){throw new db[(_0x30a5('0x87'))][(_0x30a5('0x88'))]('to\x20is\x20mandatory');}_0x42980d=_0x1ab4c3['body']['to'];return db[_0x30a5('0x3e')][_0x30a5('0x58')]({'where':{'id':_0x1ab4c3[_0x30a5('0x53')]['id']},'include':[{'model':db[_0x30a5('0xb6')],'as':'List','include':[{'model':db[_0x30a5('0x9c')],'as':'Contacts','where':{'mobile':_0x42980d},'limit':0x1,'order':[[_0x30a5('0x8a'),_0x30a5('0x9e')]]}]}]})[_0x30a5('0x1f')](handleEntityNotFound(_0x10ba32,null))[_0x30a5('0x1f')](function(_0x9066c7){if(_0x9066c7&&_0x9066c7[_0x30a5('0xb7')]){_0x4172d7=_0x9066c7['get']({'plain':!![]});if(_0x4172d7[_0x30a5('0xb7')]&&_0x4172d7['List']['Contacts'][_0x30a5('0x45')]){return _0x4172d7[_0x30a5('0xb7')]['Contacts'][0x0];}return db[_0x30a5('0x9c')]['create'](_[_0x30a5('0x18')](_0x1ab4c3[_0x30a5('0x5f')],{'firstName':_0x42980d,'mobile':_0x42980d,'phone':_0x42980d,'ListId':_0x4172d7['ListId']}));}})[_0x30a5('0x1f')](handleEntityNotFound(_0x10ba32,null))[_0x30a5('0x1f')](function(_0x5c9ca9){if(_0x5c9ca9){_0x8631d2=_0x5c9ca9;return db[_0x30a5('0xa1')][_0x30a5('0x58')]({'where':{'ContactId':_0x8631d2['id'],'closed':![],'WhatsappAccountId':_0x4172d7['id']}})[_0x30a5('0x1f')](function(_0x57f828){if(_0x57f828){return[_0x57f828,![]];}return db[_0x30a5('0xa1')][_0x30a5('0x59')]({'UserId':_0x1ab4c3[_0x30a5('0xb8')]['id'],'ContactId':_0x8631d2['id'],'WhatsappAccountId':_0x4172d7['id'],'phone':_0x42980d,'firstMsgDirection':'out','Messages':[_[_0x30a5('0x4b')](_0x1ab4c3[_0x30a5('0x5f')],{'read':![],'body':_0x1ab4c3[_0x30a5('0x5f')][_0x30a5('0x5f')],'phone':_0x42980d,'WhatsappAccountId':_0x4172d7['id'],'UserId':_0x1ab4c3[_0x30a5('0xb8')]['id'],'ContactId':_0x8631d2['id']})]},{'include':[{'model':db[_0x30a5('0x81')],'as':'Messages'}]})['then'](function(_0x91a4d4){return[_0x91a4d4,!![]];});});}})['spread'](function(_0x1c8351,_0x484602){if(_0x484602){return _0x1c8351;}return db[_0x30a5('0x81')][_0x30a5('0x59')](_['merge'](_0x1ab4c3[_0x30a5('0x5f')],{'read':![],'body':_0x1ab4c3[_0x30a5('0x5f')][_0x30a5('0x5f')],'phone':_0x42980d,'WhatsappAccountId':_0x4172d7['id'],'WhatsappInteractionId':_0x1c8351['id'],'UserId':_0x1ab4c3[_0x30a5('0xb8')]['id'],'ContactId':_0x8631d2['id']}))[_0x30a5('0x1f')](function(_0x3cfaba){_0x1c8351[_0x30a5('0xb9')][_0x30a5('0xba')]=[];_0x1c8351[_0x30a5('0xb9')][_0x30a5('0xba')][_0x30a5('0xbb')](_0x3cfaba[_0x30a5('0xb9')]);return _0x1c8351;});})[_0x30a5('0x1f')](respondWithResult(_0x10ba32,null))['catch'](handleError(_0x10ba32,null));};
\ No newline at end of file
+var _0x36e0=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappAccount.socket','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','json','limit','undefined','count','offset','Content-Range','save','destroy','get','WhatsappAccounts','status','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','rows','removeDispositions','addAnswer','CannedAnswer','findOne','rawAttributes','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','sequelize','transaction','bulkCreate','WhatsappApplication','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','update','timestamp','message_id','applications','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','replace','whatsapp:','Body','MessageSid','notifications','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','Contacts','defaults','contact','WhatsappInteraction','interaction','created','push','close','*,*,*,*','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','set','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x36e0,0xbc));var _0x036e=function(_0x3e083f,_0x137323){_0x3e083f=_0x3e083f-0x0;var _0x1cd914=_0x36e0[_0x3e083f];return _0x1cd914;};'use strict';var emlformat=require(_0x036e('0x0'));var rimraf=require(_0x036e('0x1'));var zipdir=require(_0x036e('0x2'));var jsonpatch=require(_0x036e('0x3'));var rp=require(_0x036e('0x4'));var moment=require(_0x036e('0x5'));var BPromise=require(_0x036e('0x6'));var Mustache=require(_0x036e('0x7'));var util=require(_0x036e('0x8'));var path=require(_0x036e('0x9'));var sox=require('sox');var csv=require(_0x036e('0xa'));var ejs=require(_0x036e('0xb'));var fs=require('fs');var fs_extra=require(_0x036e('0xc'));var _=require(_0x036e('0xd'));var squel=require(_0x036e('0xe'));var crypto=require(_0x036e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x036e('0x10'));var toCsv=require(_0x036e('0xa'));var querystring=require(_0x036e('0x11'));var Papa=require(_0x036e('0x12'));var Redis=require('ioredis');var authService=require(_0x036e('0x13'));var qs=require(_0x036e('0x14'));var as=require(_0x036e('0x15'));var hardwareService=require(_0x036e('0x16'));var logger=require('../../config/logger')(_0x036e('0x17'));var utils=require(_0x036e('0x18'));var config=require(_0x036e('0x19'));var licenseUtil=require(_0x036e('0x1a'));var db=require(_0x036e('0x1b'))['db'];config[_0x036e('0x1c')]=_['defaults'](config[_0x036e('0x1c')],{'host':_0x036e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x036e('0x1c')]));require(_0x036e('0x1e'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x036e('0x1f')][_0x036e('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x5e6451,_0x25c280,_0x17aac5,_0x271574){return new BPromise(function(_0x15c4df,_0x16121d){var _0x374fc7=_0x271574||client;return _0x374fc7[_0x036e('0x21')](_0x5e6451,_0x17aac5)[_0x036e('0x22')](function(_0x56fc89){logger[_0x036e('0x23')](_0x036e('0x24'),_0x25c280,_0x036e('0x25'));logger[_0x036e('0x26')](_0x036e('0x27'),_0x25c280,_0x036e('0x25'),JSON['stringify'](_0x56fc89));if(_0x56fc89[_0x036e('0x28')]){if(_0x56fc89[_0x036e('0x28')][_0x036e('0x29')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x25c280,_0x56fc89[_0x036e('0x28')][_0x036e('0x2a')]);return _0x16121d(_0x56fc89[_0x036e('0x28')][_0x036e('0x2a')]);}logger[_0x036e('0x28')](_0x036e('0x24'),_0x25c280,_0x56fc89['error'][_0x036e('0x2a')]);return _0x15c4df(_0x56fc89[_0x036e('0x28')][_0x036e('0x2a')]);}else{logger['info'](_0x036e('0x24'),_0x25c280,_0x036e('0x25'));_0x15c4df(_0x56fc89[_0x036e('0x2b')][_0x036e('0x2a')]);}})[_0x036e('0x2c')](function(_0x49e6e1){logger[_0x036e('0x28')](_0x036e('0x24'),_0x25c280,_0x49e6e1);_0x16121d(_0x49e6e1);});});}function respondWithStatusCode(_0x3500b9,_0x1d42f3){_0x1d42f3=_0x1d42f3||0xcc;return function(_0x583383){if(_0x583383){return _0x3500b9[_0x036e('0x2d')](_0x1d42f3);}return _0x3500b9['status'](_0x1d42f3)['end']();};}function respondWithResult(_0x151681,_0x8598fa){_0x8598fa=_0x8598fa||0xc8;return function(_0x373304){if(_0x373304){return _0x151681['status'](_0x8598fa)[_0x036e('0x2e')](_0x373304);}};}function respondWithFilteredResult(_0x24c525,_0x122b12){return function(_0x3c43d2){if(_0x3c43d2){var _0x442f2e=typeof _0x122b12['offset']==='undefined'&&typeof _0x122b12[_0x036e('0x2f')]===_0x036e('0x30');var _0x17573f=_0x3c43d2[_0x036e('0x31')];var _0x4a4a86=_0x442f2e?0x0:_0x122b12[_0x036e('0x32')];var _0x570344=_0x442f2e?_0x3c43d2[_0x036e('0x31')]:_0x122b12['offset']+_0x122b12['limit'];var _0x40e069;if(_0x570344>=_0x17573f){_0x570344=_0x17573f;_0x40e069=0xc8;}else{_0x40e069=0xce;}_0x24c525['status'](_0x40e069);return _0x24c525['set'](_0x036e('0x33'),_0x4a4a86+'-'+_0x570344+'/'+_0x17573f)[_0x036e('0x2e')](_0x3c43d2);}return null;};}function patchUpdates(_0x72835c){return function(_0x9d9739){try{jsonpatch['apply'](_0x9d9739,_0x72835c,!![]);}catch(_0x33429e){return BPromise['reject'](_0x33429e);}return _0x9d9739[_0x036e('0x34')]();};}function saveUpdates(_0x3302e3,_0x25329a){return function(_0x5e894e){if(_0x5e894e){return _0x5e894e['update'](_0x3302e3)[_0x036e('0x22')](function(_0xdb3f3d){return _0xdb3f3d;});}return null;};}function removeEntity(_0x590595,_0x29db9b){return function(_0x1f261c){if(_0x1f261c){return _0x1f261c[_0x036e('0x35')]()['then'](function(){var _0x180d54=_0x1f261c[_0x036e('0x36')]({'plain':!![]});var _0x28400a=_0x036e('0x37');return db['UserProfileResource'][_0x036e('0x35')]({'where':{'type':_0x28400a,'resourceId':_0x180d54['id']}})['then'](function(){return _0x1f261c;});})['then'](function(){_0x590595[_0x036e('0x38')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dc64c,_0x137988){return function(_0x4d809c){if(!_0x4d809c){_0x3dc64c[_0x036e('0x2d')](0x194);}return _0x4d809c;};}function handleError(_0x17b7b9,_0x52d590){_0x52d590=_0x52d590||0x1f4;return function(_0x48cba4){logger[_0x036e('0x28')](_0x48cba4[_0x036e('0x39')]);if(_0x48cba4[_0x036e('0x3a')]){delete _0x48cba4[_0x036e('0x3a')];}_0x17b7b9['status'](_0x52d590)[_0x036e('0x3b')](_0x48cba4);};}exports[_0x036e('0x3c')]=function(_0xbcfa13,_0x18be49){var _0xb1914f={'include':[{'model':db[_0x036e('0x3d')],'as':_0x036e('0x3e')}]},_0x4aa3b3={},_0x1ad3d5={'count':0x0,'rows':[]};var _0x3b020f=_[_0x036e('0x3f')](db[_0x036e('0x40')]['rawAttributes'],function(_0x20d9c0){return{'name':_0x20d9c0[_0x036e('0x41')],'type':_0x20d9c0[_0x036e('0x42')][_0x036e('0x43')]};});_0x4aa3b3['model']=_[_0x036e('0x3f')](_0x3b020f,'name');_0x4aa3b3[_0x036e('0x44')]=_[_0x036e('0x45')](_0xbcfa13[_0x036e('0x44')]);_0x4aa3b3[_0x036e('0x46')]=_[_0x036e('0x47')](_0x4aa3b3['model'],_0x4aa3b3['query']);_0xb1914f[_0x036e('0x48')]=_['intersection'](_0x4aa3b3[_0x036e('0x49')],qs['fields'](_0xbcfa13[_0x036e('0x44')][_0x036e('0x4a')]));_0xb1914f['attributes']=_0xb1914f[_0x036e('0x48')][_0x036e('0x4b')]?_0xb1914f[_0x036e('0x48')]:_0x4aa3b3[_0x036e('0x49')];if(!_0xbcfa13['query'][_0x036e('0x4c')](_0x036e('0x4d'))){_0xb1914f[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0xbcfa13[_0x036e('0x44')][_0x036e('0x2f')]);_0xb1914f[_0x036e('0x32')]=qs[_0x036e('0x32')](_0xbcfa13['query'][_0x036e('0x32')]);}_0xb1914f[_0x036e('0x4e')]=qs['sort'](_0xbcfa13[_0x036e('0x44')][_0x036e('0x4f')]);_0xb1914f[_0x036e('0x50')]=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0xbcfa13['query'],_0x4aa3b3[_0x036e('0x46')]),_0x3b020f);if(_0xbcfa13[_0x036e('0x44')][_0x036e('0x52')]){_0xb1914f[_0x036e('0x50')]=_[_0x036e('0x53')](_0xb1914f[_0x036e('0x50')],{'$or':_[_0x036e('0x3f')](_0x3b020f,function(_0x408293){if(_0x408293[_0x036e('0x42')]!=='VIRTUAL'){var _0x31ab41={};_0x31ab41[_0x408293[_0x036e('0x3a')]]={'$like':'%'+_0xbcfa13[_0x036e('0x44')]['filter']+'%'};return _0x31ab41;}})});}_0xb1914f=_[_0x036e('0x53')]({},_0xb1914f,_0xbcfa13[_0x036e('0x54')]);var _0x48d77a={'where':_0xb1914f[_0x036e('0x50')]};return db[_0x036e('0x40')]['count'](_0x48d77a)['then'](function(_0x6222f7){_0x1ad3d5[_0x036e('0x31')]=_0x6222f7;if(_0xbcfa13['query'][_0x036e('0x55')]){_0xb1914f[_0x036e('0x56')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x036e('0x57')](_0xb1914f);})[_0x036e('0x22')](function(_0xac5886){_0x1ad3d5['rows']=_0xac5886;return _0x1ad3d5;})['then'](respondWithFilteredResult(_0x18be49,_0xb1914f))[_0x036e('0x2c')](handleError(_0x18be49,null));};exports[_0x036e('0x58')]=function(_0xc11a74,_0x3108e9){var _0x5caec6={'raw':![],'where':{'id':_0xc11a74['params']['id']},'include':[{'model':db[_0x036e('0x3d')],'as':_0x036e('0x3e')}]},_0x59f0fd={};_0x59f0fd['model']=_['keys'](db[_0x036e('0x40')]['rawAttributes']);_0x59f0fd[_0x036e('0x44')]=_[_0x036e('0x45')](_0xc11a74[_0x036e('0x44')]);_0x59f0fd[_0x036e('0x46')]=_[_0x036e('0x47')](_0x59f0fd['model'],_0x59f0fd[_0x036e('0x44')]);_0x5caec6[_0x036e('0x48')]=_[_0x036e('0x47')](_0x59f0fd[_0x036e('0x49')],qs[_0x036e('0x4a')](_0xc11a74[_0x036e('0x44')][_0x036e('0x4a')]));_0x5caec6[_0x036e('0x48')]=_0x5caec6[_0x036e('0x48')][_0x036e('0x4b')]?_0x5caec6[_0x036e('0x48')]:_0x59f0fd[_0x036e('0x49')];if(_0xc11a74[_0x036e('0x44')][_0x036e('0x55')]){_0x5caec6[_0x036e('0x56')]=[{'all':!![]}];}_0x5caec6=_[_0x036e('0x53')]({},_0x5caec6,_0xc11a74['options']);return db['WhatsappAccount']['find'](_0x5caec6)['then'](handleEntityNotFound(_0x3108e9,null))[_0x036e('0x22')](respondWithResult(_0x3108e9,null))[_0x036e('0x2c')](handleError(_0x3108e9,null));};exports[_0x036e('0x59')]=function(_0x11df05,_0x353aee){return db[_0x036e('0x40')]['create'](_0x11df05[_0x036e('0x5a')],{})['then'](function(_0x5890a4){var _0x11f7e0=_0x11df05[_0x036e('0x5b')][_0x036e('0x36')]({'plain':!![]});if(!_0x11f7e0)throw new Error(_0x036e('0x5c'));if(_0x11f7e0['role']===_0x036e('0x5b')){var _0x75ecf5=_0x5890a4[_0x036e('0x36')]({'plain':!![]});var _0x2ec370=_0x036e('0x37');return db[_0x036e('0x5d')][_0x036e('0x5e')]({'where':{'name':_0x2ec370,'userProfileId':_0x11f7e0[_0x036e('0x5f')]},'raw':!![]})[_0x036e('0x22')](function(_0x47c84e){if(_0x47c84e&&_0x47c84e[_0x036e('0x60')]===0x0){return db[_0x036e('0x61')]['create']({'name':_0x75ecf5['name'],'resourceId':_0x75ecf5['id'],'type':_0x47c84e[_0x036e('0x3a')],'sectionId':_0x47c84e['id']},{})[_0x036e('0x22')](function(){return _0x5890a4;});}else{return _0x5890a4;}})['catch'](function(_0x5277f7){logger['error'](_0x036e('0x62'),_0x5277f7);throw _0x5277f7;});}return _0x5890a4;})['then'](respondWithResult(_0x353aee,0xc9))[_0x036e('0x2c')](handleError(_0x353aee,null));};exports['update']=function(_0x5c60ef,_0x28e3a8){if(_0x5c60ef[_0x036e('0x5a')]['id']){delete _0x5c60ef[_0x036e('0x5a')]['id'];}return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x5c60ef[_0x036e('0x63')]['id']},'include':[{'model':db[_0x036e('0x3d')],'as':_0x036e('0x3e')}]})[_0x036e('0x22')](handleEntityNotFound(_0x28e3a8,null))[_0x036e('0x22')](saveUpdates(_0x5c60ef[_0x036e('0x5a')],null))['then'](respondWithResult(_0x28e3a8,null))[_0x036e('0x2c')](handleError(_0x28e3a8,null));};exports[_0x036e('0x35')]=function(_0x4735a3,_0x1f48f5){return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x4735a3['params']['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x1f48f5,null))[_0x036e('0x22')](removeEntity(_0x1f48f5,null))['catch'](handleError(_0x1f48f5,null));};exports[_0x036e('0x64')]=function(_0x1eeaa1,_0x1d8cc6){return db[_0x036e('0x40')][_0x036e('0x64')]()[_0x036e('0x22')](respondWithResult(_0x1d8cc6,null))[_0x036e('0x2c')](handleError(_0x1d8cc6,null));};exports[_0x036e('0x65')]=function(_0x4a21e8,_0x2d7caa,_0x1b3bd6){if(_0x4a21e8[_0x036e('0x5a')]['id']){delete _0x4a21e8[_0x036e('0x5a')]['id'];}return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0x4a21e8[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x2d7caa,null))[_0x036e('0x22')](function(_0x660d4a){if(_0x660d4a){_0x4a21e8[_0x036e('0x5a')][_0x036e('0x66')]=_0x660d4a['id'];return db[_0x036e('0x67')][_0x036e('0x59')](_0x4a21e8[_0x036e('0x5a')]);}})[_0x036e('0x22')](respondWithResult(_0x2d7caa,null))['catch'](handleError(_0x2d7caa,null));};exports[_0x036e('0x68')]=function(_0x3a7c45,_0x108966,_0xa644e7){var _0x1cbfa8={'raw':![],'where':{}};var _0xfe864={};var _0xe52e15={'count':0x0,'rows':[]};return db[_0x036e('0x40')]['findOne']({'where':{'id':_0x3a7c45[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x108966,null))['then'](function(_0x17cd89){if(_0x17cd89){_0xfe864[_0x036e('0x49')]=_[_0x036e('0x45')](db[_0x036e('0x67')]['rawAttributes']);_0xfe864[_0x036e('0x44')]=_[_0x036e('0x45')](_0x3a7c45['query']);_0xfe864[_0x036e('0x46')]=_[_0x036e('0x47')](_0xfe864[_0x036e('0x49')],_0xfe864[_0x036e('0x44')]);_0x1cbfa8[_0x036e('0x48')]=_[_0x036e('0x47')](_0xfe864['model'],qs[_0x036e('0x4a')](_0x3a7c45[_0x036e('0x44')]['fields']));_0x1cbfa8[_0x036e('0x48')]=_0x1cbfa8[_0x036e('0x48')]['length']?_0x1cbfa8[_0x036e('0x48')]:_0xfe864['model'];if(!_0x3a7c45['query'][_0x036e('0x4c')](_0x036e('0x4d'))){_0x1cbfa8[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0x3a7c45[_0x036e('0x44')][_0x036e('0x2f')]);_0x1cbfa8[_0x036e('0x32')]=qs['offset'](_0x3a7c45[_0x036e('0x44')]['offset']);}_0x1cbfa8[_0x036e('0x4e')]=qs[_0x036e('0x4f')](_0x3a7c45['query'][_0x036e('0x4f')]);_0x1cbfa8[_0x036e('0x50')]=qs[_0x036e('0x46')](_['pick'](_0x3a7c45[_0x036e('0x44')],_0xfe864[_0x036e('0x46')]));_0x1cbfa8[_0x036e('0x50')][_0x036e('0x66')]=_0x17cd89['id'];if(_0x3a7c45[_0x036e('0x44')][_0x036e('0x52')]){_0x1cbfa8['where']=_[_0x036e('0x53')](_0x1cbfa8[_0x036e('0x50')],{'$or':_[_0x036e('0x3f')](_0x1cbfa8['attributes'],function(_0x14a4d9){var _0x5e1d19={};_0x5e1d19[_0x14a4d9]={'$like':'%'+_0x3a7c45[_0x036e('0x44')][_0x036e('0x52')]+'%'};return _0x5e1d19;})});}_0x1cbfa8=_['merge']({},_0x1cbfa8,_0x3a7c45[_0x036e('0x54')]);return db[_0x036e('0x67')][_0x036e('0x31')]({'where':_0x1cbfa8['where']})[_0x036e('0x22')](function(_0x2cb983){_0xe52e15['count']=_0x2cb983;if(_0x3a7c45[_0x036e('0x44')][_0x036e('0x55')]){_0x1cbfa8[_0x036e('0x56')]=[{'all':!![]}];}return db[_0x036e('0x67')][_0x036e('0x57')](_0x1cbfa8);})[_0x036e('0x22')](function(_0x2db778){_0xe52e15[_0x036e('0x69')]=_0x2db778;return _0xe52e15;});}})['then'](respondWithFilteredResult(_0x108966,_0x1cbfa8))['catch'](handleError(_0x108966,null));};exports[_0x036e('0x6a')]=function(_0x49f416,_0x589045,_0x1d2e8b){return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x49f416[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x589045,null))[_0x036e('0x22')](function(_0x3d248f){if(_0x3d248f){return _0x3d248f[_0x036e('0x6a')](_0x49f416[_0x036e('0x44')]['ids']);}})[_0x036e('0x22')](respondWithStatusCode(_0x589045,null))[_0x036e('0x2c')](handleError(_0x589045,null));};exports[_0x036e('0x6b')]=function(_0x5cb640,_0x36ae2a,_0x4bb973){if(_0x5cb640[_0x036e('0x5a')]['id']){delete _0x5cb640[_0x036e('0x5a')]['id'];}return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0x5cb640[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x36ae2a,null))['then'](function(_0x14136b){if(_0x14136b){_0x5cb640[_0x036e('0x5a')][_0x036e('0x66')]=_0x14136b['id'];return db[_0x036e('0x6c')][_0x036e('0x59')](_0x5cb640[_0x036e('0x5a')]);}})[_0x036e('0x22')](respondWithResult(_0x36ae2a,null))['catch'](handleError(_0x36ae2a,null));};exports['getAnswers']=function(_0x546c56,_0x46fd8e,_0x1bc773){var _0x541319={'raw':![],'where':{}};var _0x41529d={};var _0x9887be={'count':0x0,'rows':[]};return db[_0x036e('0x40')][_0x036e('0x6d')]({'where':{'id':_0x546c56[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x46fd8e,null))['then'](function(_0x1d11bf){if(_0x1d11bf){_0x41529d['model']=_[_0x036e('0x45')](db[_0x036e('0x6c')][_0x036e('0x6e')]);_0x41529d['query']=_['keys'](_0x546c56[_0x036e('0x44')]);_0x41529d[_0x036e('0x46')]=_[_0x036e('0x47')](_0x41529d[_0x036e('0x49')],_0x41529d[_0x036e('0x44')]);_0x541319[_0x036e('0x48')]=_['intersection'](_0x41529d[_0x036e('0x49')],qs[_0x036e('0x4a')](_0x546c56[_0x036e('0x44')][_0x036e('0x4a')]));_0x541319[_0x036e('0x48')]=_0x541319[_0x036e('0x48')][_0x036e('0x4b')]?_0x541319[_0x036e('0x48')]:_0x41529d['model'];if(!_0x546c56[_0x036e('0x44')][_0x036e('0x4c')]('nolimit')){_0x541319['limit']=qs[_0x036e('0x2f')](_0x546c56['query'][_0x036e('0x2f')]);_0x541319[_0x036e('0x32')]=qs['offset'](_0x546c56[_0x036e('0x44')][_0x036e('0x32')]);}_0x541319[_0x036e('0x4e')]=qs[_0x036e('0x4f')](_0x546c56[_0x036e('0x44')][_0x036e('0x4f')]);_0x541319[_0x036e('0x50')]=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0x546c56['query'],_0x41529d[_0x036e('0x46')]));_0x541319[_0x036e('0x50')][_0x036e('0x66')]=_0x1d11bf['id'];if(_0x546c56['query'][_0x036e('0x52')]){_0x541319[_0x036e('0x50')]=_[_0x036e('0x53')](_0x541319[_0x036e('0x50')],{'$or':_[_0x036e('0x3f')](_0x541319[_0x036e('0x48')],function(_0x3106f6){var _0x42d500={};_0x42d500[_0x3106f6]={'$like':'%'+_0x546c56['query']['filter']+'%'};return _0x42d500;})});}_0x541319=_[_0x036e('0x53')]({},_0x541319,_0x546c56[_0x036e('0x54')]);return db[_0x036e('0x6c')][_0x036e('0x31')]({'where':_0x541319[_0x036e('0x50')]})[_0x036e('0x22')](function(_0x1dddcd){_0x9887be['count']=_0x1dddcd;if(_0x546c56['query'][_0x036e('0x55')]){_0x541319['include']=[{'all':!![]}];}return db[_0x036e('0x6c')][_0x036e('0x57')](_0x541319);})[_0x036e('0x22')](function(_0x323309){_0x9887be[_0x036e('0x69')]=_0x323309;return _0x9887be;});}})[_0x036e('0x22')](respondWithFilteredResult(_0x46fd8e,_0x541319))['catch'](handleError(_0x46fd8e,null));};exports['removeAnswers']=function(_0x38d589,_0x8aeadb,_0x4a752e){return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x38d589[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x8aeadb,null))[_0x036e('0x22')](function(_0x377073){if(_0x377073){return _0x377073[_0x036e('0x6f')](_0x38d589['query'][_0x036e('0x70')]);}})['then'](respondWithStatusCode(_0x8aeadb,null))[_0x036e('0x2c')](handleError(_0x8aeadb,null));};exports[_0x036e('0x71')]=function(_0x48b68e,_0x13aeda,_0x50c708){return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0x48b68e[_0x036e('0x63')]['id']}})['then'](handleEntityNotFound(_0x13aeda,null))[_0x036e('0x22')](function(_0x5d1b4f){if(_0x5d1b4f){return _0x5d1b4f['addAgents'](_0x48b68e[_0x036e('0x5a')]['ids'],_[_0x036e('0x72')](_0x48b68e[_0x036e('0x5a')],['ids','id'])||{})[_0x036e('0x73')](function(_0x16d80f){for(var _0x3f8627=0x0;_0x3f8627<_0x48b68e[_0x036e('0x5a')][_0x036e('0x70')][_0x036e('0x4b')];_0x3f8627+=0x1){socket[_0x036e('0x74')](_0x036e('0x75'),{'UserId':Number(_0x48b68e[_0x036e('0x5a')][_0x036e('0x70')][_0x3f8627]),'WhatsappAccountId':Number(_0x48b68e[_0x036e('0x63')]['id'])});}return _0x16d80f;});}})[_0x036e('0x22')](respondWithResult(_0x13aeda,null))[_0x036e('0x2c')](handleError(_0x13aeda,null));};exports['removeAgents']=function(_0xa9dd88,_0x12db4f,_0x51711d){return db['WhatsappAccount'][_0x036e('0x5e')]({'where':{'id':_0xa9dd88[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x12db4f,null))['then'](function(_0x539176){if(_0x539176){return _0x539176[_0x036e('0x76')](_0xa9dd88[_0x036e('0x44')]['ids'])['then'](function(){if(_['isArray'](_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')])){for(var _0x476365=0x0;_0x476365<_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')][_0x036e('0x4b')];_0x476365+=0x1){socket[_0x036e('0x74')](_0x036e('0x77'),{'UserId':Number(_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')][_0x476365]),'WhatsappAccountId':Number(_0xa9dd88[_0x036e('0x63')]['id'])});}}else{socket[_0x036e('0x74')](_0x036e('0x77'),{'UserId':Number(_0xa9dd88[_0x036e('0x44')][_0x036e('0x70')]),'WhatsappAccountId':Number(_0xa9dd88[_0x036e('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x12db4f,null))[_0x036e('0x2c')](handleError(_0x12db4f,null));};exports['getAgents']=function(_0x47e1bb,_0x28f3c6,_0x157590){var _0x27d93f={};var _0x367a5b={};var _0x4ee618;var _0x28554b;return db[_0x036e('0x40')][_0x036e('0x6d')]({'where':{'id':_0x47e1bb[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x28f3c6,null))['then'](function(_0x51a235){if(_0x51a235){_0x4ee618=_0x51a235;_0x367a5b[_0x036e('0x49')]=_[_0x036e('0x45')](db['User'][_0x036e('0x6e')]);_0x367a5b[_0x036e('0x44')]=_['keys'](_0x47e1bb[_0x036e('0x44')]);_0x367a5b[_0x036e('0x46')]=_[_0x036e('0x47')](_0x367a5b[_0x036e('0x49')],_0x367a5b['query']);_0x27d93f[_0x036e('0x48')]=_[_0x036e('0x47')](_0x367a5b[_0x036e('0x49')],qs[_0x036e('0x4a')](_0x47e1bb['query'][_0x036e('0x4a')]));_0x27d93f[_0x036e('0x48')]=_0x27d93f['attributes'][_0x036e('0x4b')]?_0x27d93f[_0x036e('0x48')]:_0x367a5b[_0x036e('0x49')];_0x27d93f[_0x036e('0x4e')]=qs['sort'](_0x47e1bb[_0x036e('0x44')][_0x036e('0x4f')]);_0x27d93f['where']=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0x47e1bb[_0x036e('0x44')],_0x367a5b[_0x036e('0x46')]));if(_0x47e1bb[_0x036e('0x44')]['filter']){_0x27d93f[_0x036e('0x50')]=_[_0x036e('0x53')](_0x27d93f['where'],{'$or':_[_0x036e('0x3f')](_0x27d93f[_0x036e('0x48')],function(_0x1cfccd){var _0x35359c={};_0x35359c[_0x1cfccd]={'$like':'%'+_0x47e1bb[_0x036e('0x44')][_0x036e('0x52')]+'%'};return _0x35359c;})});}_0x27d93f=_['merge']({},_0x27d93f,_0x47e1bb['options']);return _0x4ee618[_0x036e('0x78')](_0x27d93f);}})[_0x036e('0x22')](function(_0x1b5c71){if(_0x1b5c71){_0x28554b=_0x1b5c71[_0x036e('0x4b')];if(!_0x47e1bb['query'][_0x036e('0x4c')](_0x036e('0x4d'))){_0x27d93f[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0x47e1bb[_0x036e('0x44')][_0x036e('0x2f')]);_0x27d93f[_0x036e('0x32')]=qs[_0x036e('0x32')](_0x47e1bb[_0x036e('0x44')][_0x036e('0x32')]);}return _0x4ee618[_0x036e('0x78')](_0x27d93f);}})['then'](function(_0x594874){if(_0x594874){return _0x594874?{'count':_0x28554b,'rows':_0x594874}:null;}})['then'](respondWithResult(_0x28f3c6,null))[_0x036e('0x2c')](handleError(_0x28f3c6,null));};exports['addApplications']=function(_0x2f9586,_0x12d228){var _0x3267f9=_0x2f9586['params']['id'];var _0x431617=_0x2f9586[_0x036e('0x5a')];var _0x20372b=0xc8;var _0x3bb9fa=null;return db[_0x036e('0x79')][_0x036e('0x7a')]({'isolationLevel':db['sequelize']['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x467543){return db['WhatsappAccount'][_0x036e('0x6d')]({'where':{'id':_0x3267f9},'transaction':_0x467543})[_0x036e('0x22')](function(_0x2c8853){if(_0x2c8853){return db['WhatsappApplication'][_0x036e('0x35')]({'where':{'WhatsappAccountId':_0x3267f9},'transaction':_0x467543})['then'](function(){var _0x1c331a=_[_0x036e('0x3f')](_0x431617,function(_0x2d5510){_0x2d5510[_0x036e('0x66')]=_0x3267f9;return _0x2d5510;});return db['WhatsappApplication'][_0x036e('0x7b')](_0x1c331a,{'transaction':_0x467543});});}else{_0x20372b=0x194;_0x3bb9fa=[];}});})[_0x036e('0x22')](function(){if(_0x20372b!==0x194){return db[_0x036e('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x3267f9},'order':'priority'})[_0x036e('0x22')](function(_0x30ebdd){_0x3bb9fa=_0x30ebdd;});}})[_0x036e('0x2c')](function(_0x589cc3){_0x20372b=0x1f4;logger[_0x036e('0x28')](_0x589cc3[_0x036e('0x39')]);if(_0x589cc3[_0x036e('0x3a')]){delete _0x589cc3[_0x036e('0x3a')];}_0x3bb9fa=_0x589cc3;})[_0x036e('0x7d')](function(){if(_0x3bb9fa===null){_0x12d228[_0x036e('0x2d')](_0x20372b);}else{if(_0x20372b===0x1f4){_0x12d228[_0x036e('0x38')](_0x20372b)[_0x036e('0x3b')](_0x3bb9fa);}else{_0x12d228['status'](_0x20372b)[_0x036e('0x2e')](_0x3bb9fa);}}});};exports[_0x036e('0x7e')]=function(_0x5b16a4,_0x538644,_0x14d577){var _0x1b9719={};var _0x588f03={};var _0x931e40;var _0x211f8f;return db[_0x036e('0x40')][_0x036e('0x6d')]({'where':{'id':_0x5b16a4[_0x036e('0x63')]['id']}})[_0x036e('0x22')](handleEntityNotFound(_0x538644,null))[_0x036e('0x22')](function(_0x14308d){if(_0x14308d){_0x931e40=_0x14308d;_0x588f03['model']=_[_0x036e('0x45')](db[_0x036e('0x7c')][_0x036e('0x6e')]);_0x588f03[_0x036e('0x44')]=_[_0x036e('0x45')](_0x5b16a4['query']);_0x588f03['filters']=_[_0x036e('0x47')](_0x588f03[_0x036e('0x49')],_0x588f03['query']);_0x1b9719['attributes']=_['intersection'](_0x588f03['model'],qs['fields'](_0x5b16a4[_0x036e('0x44')][_0x036e('0x4a')]));_0x1b9719[_0x036e('0x48')]=_0x1b9719[_0x036e('0x48')][_0x036e('0x4b')]?_0x1b9719[_0x036e('0x48')]:_0x588f03[_0x036e('0x49')];_0x1b9719[_0x036e('0x4e')]=qs['sort'](_0x5b16a4['query'][_0x036e('0x4f')]);_0x1b9719[_0x036e('0x50')]=qs[_0x036e('0x46')](_[_0x036e('0x51')](_0x5b16a4[_0x036e('0x44')],_0x588f03[_0x036e('0x46')]));if(_0x5b16a4['query'][_0x036e('0x52')]){_0x1b9719[_0x036e('0x50')]=_[_0x036e('0x53')](_0x1b9719['where'],{'$or':_['map'](_0x1b9719[_0x036e('0x48')],function(_0x430f1d){var _0x58ed65={};_0x58ed65[_0x430f1d]={'$like':'%'+_0x5b16a4[_0x036e('0x44')][_0x036e('0x52')]+'%'};return _0x58ed65;})});}_0x1b9719=_[_0x036e('0x53')]({},_0x1b9719,_0x5b16a4['options']);return _0x931e40[_0x036e('0x7e')](_0x1b9719);}})[_0x036e('0x22')](function(_0x4dcc50){if(_0x4dcc50){_0x211f8f=_0x4dcc50[_0x036e('0x4b')];if(!_0x5b16a4[_0x036e('0x44')]['hasOwnProperty'](_0x036e('0x4d'))){_0x1b9719[_0x036e('0x2f')]=qs[_0x036e('0x2f')](_0x5b16a4[_0x036e('0x44')][_0x036e('0x2f')]);_0x1b9719['offset']=qs[_0x036e('0x32')](_0x5b16a4[_0x036e('0x44')][_0x036e('0x32')]);}return _0x931e40[_0x036e('0x7e')](_0x1b9719);}})[_0x036e('0x22')](function(_0x4d2a55){if(_0x4d2a55){return _0x4d2a55?{'count':_0x211f8f,'rows':_0x4d2a55}:null;}})[_0x036e('0x22')](respondWithResult(_0x538644,null))['catch'](handleError(_0x538644,null));};exports[_0x036e('0x7f')]=function(_0x5abd6a,_0x20db0b,_0xe61dfc){var _0x4646f5={'channel':_0x036e('0x80')};var _0x490453=[];var _0x3aa051=[];var _0x38b970={};return db[_0x036e('0x40')][_0x036e('0x5e')]({'where':{'id':_0x5abd6a[_0x036e('0x63')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x036e('0x81')}]})[_0x036e('0x22')](handleEntityNotFound(_0x20db0b,null))[_0x036e('0x22')](function(_0x546727){_0x4646f5[_0x036e('0x82')]=_0x546727;if(_0x4646f5[_0x036e('0x82')]&&_0x4646f5[_0x036e('0x82')][_0x036e('0x42')]===_0x036e('0x83')&&_0x5abd6a['body']['statuses']){if(_0x5abd6a[_0x036e('0x5a')][_0x036e('0x84')][_0x036e('0x4b')]===0x0)return;if(_0x5abd6a['body']['statuses'][0x0][_0x036e('0x85')]!=='read')return;return db['WhatsappMessage'][_0x036e('0x86')]({'read':!![],'readAt':_0x5abd6a[_0x036e('0x5a')][_0x036e('0x84')][0x0][_0x036e('0x87')]},{'where':{'messageId':_0x5abd6a[_0x036e('0x5a')][_0x036e('0x84')][0x0][_0x036e('0x88')]},'individualHooks':!![]})[_0x036e('0x22')](function(_0x33e49d){return _0x20db0b[_0x036e('0x38')](0xc8)[_0x036e('0x2e')](_0x33e49d);});}_0x4646f5[_0x036e('0x89')]=_[_0x036e('0x8a')](_0x546727[_0x036e('0x81')],[_0x036e('0x8b')],[_0x036e('0x8c')]);if(_0x4646f5[_0x036e('0x82')][_0x036e('0x81')]){delete _0x4646f5[_0x036e('0x82')][_0x036e('0x81')];}return db[_0x036e('0x8d')]['describe']()['then'](function(_0x2eb8fb){if(!_0x2eb8fb){throw new db['Sequelize'][(_0x036e('0x8e'))](_0x036e('0x8f'));}_0x490453=_[_0x036e('0x90')](_[_0x036e('0x45')](_0x2eb8fb),['createdAt',_0x036e('0x91')]);_0x3aa051=_[_0x036e('0x90')](_[_0x036e('0x45')](_0x2eb8fb),[_0x036e('0x92'),_0x036e('0x91'),_0x036e('0x93'),_0x036e('0x94')]);_0x4646f5[_0x036e('0x5a')]={'mapKey':_0x036e('0x95')};if(_0x4646f5[_0x036e('0x82')]&&_0x4646f5[_0x036e('0x82')][_0x036e('0x42')]===_0x036e('0x96')){_0x4646f5['body'][_0x036e('0x97')]=_0x5abd6a['body']['From'][_0x036e('0x98')](_0x036e('0x99'),'');_0x4646f5[_0x036e('0x5a')]['body']=_0x5abd6a['body'][_0x036e('0x9a')];_0x4646f5['body']['messageId']=_0x5abd6a[_0x036e('0x5a')][_0x036e('0x9b')];}if(_0x4646f5[_0x036e('0x82')]&&_0x4646f5[_0x036e('0x82')][_0x036e('0x42')]===_0x036e('0x83')){_0x4646f5[_0x036e('0x5a')]['from']=_0x5abd6a[_0x036e('0x5a')][_0x036e('0x9c')][0x0]['from'];_0x4646f5[_0x036e('0x5a')]['body']=_0x5abd6a['body'][_0x036e('0x9c')][0x0][_0x036e('0x2a')][_0x036e('0x5a')];_0x4646f5[_0x036e('0x5a')]['messageId']=_0x5abd6a[_0x036e('0x5a')][_0x036e('0x9c')][0x0]['message_id'];}if(_0x4646f5[_0x036e('0x5a')]['id']){delete _0x4646f5[_0x036e('0x5a')]['id'];}if(_[_0x036e('0x9d')](_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')])){throw new db['Sequelize'][(_0x036e('0x8e'))]('from\x20is\x20mandatory');}if(_[_0x036e('0x9d')](_0x4646f5['body'][_0x036e('0x5a')])||_0x4646f5[_0x036e('0x5a')][_0x036e('0x5a')]===''){throw new db[(_0x036e('0x9e'))]['ValidationError'](_0x036e('0x9f'));}if(_[_0x036e('0x9d')](_0x4646f5['body'][_0x036e('0xa0')])){throw new db[(_0x036e('0x9e'))]['ValidationError'](_0x036e('0xa1')+_0x3aa051);}if(!_['includes'](_0x3aa051,_0x4646f5[_0x036e('0x5a')]['mapKey'])){throw new db[(_0x036e('0x9e'))][(_0x036e('0x8e'))](_0x036e('0xa2')+_0x3aa051);}_0x38b970[_0x4646f5[_0x036e('0x5a')]['mapKey']]=_0x4646f5['body'][_0x036e('0x97')];return db[_0x036e('0xa3')]['find']({'where':{'id':_0x4646f5['account'][_0x036e('0x94')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x38b970,'limit':0x1,'order':[[_0x036e('0x91'),_0x036e('0xa4')]]}]});})['then'](handleEntityNotFound(_0x20db0b,null))[_0x036e('0x22')](function(_0x4bf066){if(_0x4bf066){_0x4646f5['list']=_[_0x036e('0x72')](_0x4bf066,[_0x036e('0xa5')]);if(_0x4bf066[_0x036e('0xa5')][_0x036e('0x4b')]){return _0x4bf066[_0x036e('0xa5')][0x0];}var _0x4180f1=_[_0x036e('0xa6')](_0x4646f5[_0x036e('0x5a')],{'firstName':_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')],'ListId':_0x4bf066['id']});_0x4180f1[_0x4646f5[_0x036e('0x5a')]['mapKey']]=_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')];return db['CmContact']['create'](_0x4180f1,{'fields':_0x490453,'raw':!![]});}})[_0x036e('0x22')](handleEntityNotFound(_0x20db0b,null))[_0x036e('0x22')](function(_0x3cfae5){if(_0x3cfae5){_0x4646f5[_0x036e('0xa7')]=_0x3cfae5;var _0x20f2a2={'ContactId':_0x3cfae5['id'],'phone':_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')],'WhatsappAccountId':_0x5abd6a[_0x036e('0x63')]['id']};var _0x143306={'ContactId':_0x3cfae5['id'],'WhatsappAccountId':_0x5abd6a['params']['id'],'closed':![]};return db[_0x036e('0xa8')][_0x036e('0x5e')]({'where':_0x143306})[_0x036e('0x22')](function(_0xee524c){if(_0xee524c){return[_0xee524c,![]];}return db[_0x036e('0xa8')][_0x036e('0x59')](_0x20f2a2)[_0x036e('0x22')](function(_0x32ef96){return[_0x32ef96,!![]];});});}})[_0x036e('0x73')](function(_0x2892e5,_0x1be68c){_0x4646f5[_0x036e('0xa9')]=_0x2892e5['get']({'plain':!![]});_0x4646f5['interaction'][_0x036e('0xaa')]=![];if(_0x1be68c){if(_0x4646f5[_0x036e('0x82')]['autoclose']){_0x4646f5[_0x036e('0x89')][_0x036e('0xab')]({'id':0x0,'priority':_0x4646f5[_0x036e('0x89')]['length']+0x1,'app':_0x036e('0xac'),'appdata':'unmanaged','interval':_0x036e('0xad')});}_0x4646f5[_0x036e('0xa9')]['created']=!![];}return db[_0x036e('0xae')][_0x036e('0x59')]({'phone':_0x4646f5[_0x036e('0x5a')][_0x036e('0x97')],'messageId':_0x4646f5['body'][_0x036e('0xaf')],'body':_0x4646f5['body']['body'],'WhatsappAccountId':_0x5abd6a['params']['id'],'WhatsappInteractionId':_0x2892e5['id'],'direction':'in','ContactId':_0x2892e5[_0x036e('0xb0')],'AttachmentId':_0x4646f5[_0x036e('0x5a')][_0x036e('0xb1')]});})[_0x036e('0x22')](function(_0xf6c6fb){_0x4646f5['message']=_0xf6c6fb;if(_0x4646f5['interaction'][_0x036e('0xb2')]){return db[_0x036e('0xb3')][_0x036e('0x5e')]({'attributes':['id',_0x036e('0x3a')],'where':{'id':_0x4646f5['interaction'][_0x036e('0xb2')]}})['then'](function(_0x296088){if(_0x296088){_0x4646f5[_0x036e('0x89')][_0x036e('0xb4')]({'id':0x0,'priority':0x0,'app':_0x036e('0xb5'),'appdata':_0x296088[_0x036e('0x3a')]+','+(_0x4646f5[_0x036e('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0x036e('0xad')});}return respondWithRpcPromise(_0x036e('0xb6'),_0x036e('0xb7'),_0x4646f5);});}return respondWithRpcPromise('Start',_0x036e('0xb7'),_0x4646f5);})[_0x036e('0x22')](function(_0x1730e9){if(_0x1730e9){var _0x854977=0xc8;var _0x4bfc2f=_0x036e('0xb8');logger[_0x036e('0x23')](_0x036e('0x27'),_0x4bfc2f,_0x854977,'entity\x20found');logger[_0x036e('0x26')](_0x036e('0xb9'),_0x4bfc2f,_0x854977,_0x036e('0xba'),JSON[_0x036e('0xbb')](_0x1730e9));if(_0x4646f5['account'][_0x036e('0x42')]===_0x036e('0x96')){return _0x20db0b['status'](_0x854977)[_0x036e('0xbc')]('Content-Type',_0x036e('0xbd'))['send'](_0x036e('0xbe'));}else{return _0x20db0b[_0x036e('0x38')](_0x854977)[_0x036e('0x2e')](_0x1730e9);}}});})[_0x036e('0x2c')](handleError(_0x20db0b,null));};exports[_0x036e('0x3b')]=function(_0x12389a,_0x15f644,_0x25161f){var _0x4ac909,_0x209a90,_0x412d57;if(_[_0x036e('0x9d')](_0x12389a[_0x036e('0x5a')]['body'])||_0x12389a[_0x036e('0x5a')][_0x036e('0x5a')]===''){throw new db['Sequelize']['ValidationError'](_0x036e('0x9f'));}if(_[_0x036e('0x9d')](_0x12389a[_0x036e('0x5a')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x4ac909=_0x12389a[_0x036e('0x5a')]['to'];return db[_0x036e('0x40')]['find']({'where':{'id':_0x12389a[_0x036e('0x63')]['id']},'include':[{'model':db[_0x036e('0xa3')],'as':_0x036e('0xbf'),'include':[{'model':db[_0x036e('0x8d')],'as':_0x036e('0xa5'),'where':{'mobile':_0x4ac909},'limit':0x1,'order':[[_0x036e('0x91'),'DESC']]}]}]})[_0x036e('0x22')](handleEntityNotFound(_0x15f644,null))['then'](function(_0xd5f362){if(_0xd5f362&&_0xd5f362[_0x036e('0xbf')]){_0x209a90=_0xd5f362[_0x036e('0x36')]({'plain':!![]});if(_0x209a90[_0x036e('0xbf')]&&_0x209a90[_0x036e('0xbf')]['Contacts'][_0x036e('0x4b')]){return _0x209a90[_0x036e('0xbf')][_0x036e('0xa5')][0x0];}return db[_0x036e('0x8d')][_0x036e('0x59')](_['defaults'](_0x12389a[_0x036e('0x5a')],{'firstName':_0x4ac909,'mobile':_0x4ac909,'phone':_0x4ac909,'ListId':_0x209a90['ListId']}));}})['then'](handleEntityNotFound(_0x15f644,null))[_0x036e('0x22')](function(_0x4eed17){if(_0x4eed17){_0x412d57=_0x4eed17;return db[_0x036e('0xa8')]['find']({'where':{'ContactId':_0x412d57['id'],'closed':![],'WhatsappAccountId':_0x209a90['id']}})[_0x036e('0x22')](function(_0x2ea87b){if(_0x2ea87b){return[_0x2ea87b,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x12389a['user']['id'],'ContactId':_0x412d57['id'],'WhatsappAccountId':_0x209a90['id'],'phone':_0x4ac909,'firstMsgDirection':_0x036e('0xc0'),'Messages':[_['merge'](_0x12389a[_0x036e('0x5a')],{'read':![],'body':_0x12389a[_0x036e('0x5a')]['body'],'phone':_0x4ac909,'WhatsappAccountId':_0x209a90['id'],'UserId':_0x12389a['user']['id'],'ContactId':_0x412d57['id']})]},{'include':[{'model':db[_0x036e('0xae')],'as':_0x036e('0xc1')}]})['then'](function(_0x2168dd){return[_0x2168dd,!![]];});});}})[_0x036e('0x73')](function(_0x1e5081,_0x5e8c3f){if(_0x5e8c3f){return _0x1e5081;}return db[_0x036e('0xae')][_0x036e('0x59')](_[_0x036e('0x53')](_0x12389a[_0x036e('0x5a')],{'read':![],'body':_0x12389a[_0x036e('0x5a')]['body'],'phone':_0x4ac909,'WhatsappAccountId':_0x209a90['id'],'WhatsappInteractionId':_0x1e5081['id'],'UserId':_0x12389a[_0x036e('0x5b')]['id'],'ContactId':_0x412d57['id']}))[_0x036e('0x22')](function(_0x3513c3){_0x1e5081['dataValues']['Messages']=[];_0x1e5081['dataValues'][_0x036e('0xc1')]['push'](_0x3513c3[_0x036e('0xc2')]);return _0x1e5081;});})[_0x036e('0x22')](respondWithResult(_0x15f644,null))[_0x036e('0x2c')](handleError(_0x15f644,null));};
\ No newline at end of file
index 2ce5c71..444df88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b0c=['exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8b0c,0x18d));var _0xc8b0=function(_0x34ce1d,_0xe737ef){_0x34ce1d=_0x34ce1d-0x0;var _0x1b589b=_0x8b0c[_0x34ce1d];return _0x1b589b;};'use strict';var EventEmitter=require(_0xc8b0('0x0'));var WhatsappAccount=require(_0xc8b0('0x1'))['db'][_0xc8b0('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xc8b0('0x3')](0x0);var events={'afterCreate':_0xc8b0('0x4'),'afterUpdate':'update','afterDestroy':_0xc8b0('0x5')};function emitEvent(_0x4bf2ff){return function(_0x122d06,_0x30bdb1,_0x1f38ee){WhatsappAccountEvents[_0xc8b0('0x6')](_0x4bf2ff+':'+_0x122d06['id'],_0x122d06);WhatsappAccountEvents['emit'](_0x4bf2ff,_0x122d06);_0x1f38ee(null);};}for(var e in events){if(events[_0xc8b0('0x7')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0xc8b0('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xe009=['events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ab353,_0x5d5283){var _0x1e2285=function(_0x55804f){while(--_0x55804f){_0x3ab353['push'](_0x3ab353['shift']());}};_0x1e2285(++_0x5d5283);}(_0xe009,0x1b8));var _0x9e00=function(_0x335a47,_0x1f9381){_0x335a47=_0x335a47-0x0;var _0x27cecf=_0xe009[_0x335a47];return _0x27cecf;};'use strict';var EventEmitter=require(_0x9e00('0x0'));var WhatsappAccount=require(_0x9e00('0x1'))['db'][_0x9e00('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x9e00('0x3')](0x0);var events={'afterCreate':_0x9e00('0x4'),'afterUpdate':_0x9e00('0x5'),'afterDestroy':_0x9e00('0x6')};function emitEvent(_0x3cbe68){return function(_0x480bb0,_0x2234ff,_0x1c859c){WhatsappAccountEvents['emit'](_0x3cbe68+':'+_0x480bb0['id'],_0x480bb0);WhatsappAccountEvents[_0x9e00('0x7')](_0x3cbe68,_0x480bb0);_0x1c859c(null);};}for(var e in events){if(events[_0x9e00('0x8')](e)){var event=events[e];WhatsappAccount[_0x9e00('0x9')](e,emitEvent(event));}}module[_0x9e00('0xa')]=WhatsappAccountEvents;
\ No newline at end of file
index 8a0135e..dc16deb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x922b=['moment','bluebird','request-promise','rimraf','./whatsappAccount.attributes','lodash','util','../../config/logger'];(function(_0x439f24,_0x4ff170){var _0x419767=function(_0x3bb508){while(--_0x3bb508){_0x439f24['push'](_0x439f24['shift']());}};_0x419767(++_0x4ff170);}(_0x922b,0x1ad));var _0xb922=function(_0x1baa98,_0x3a327d){_0x1baa98=_0x1baa98-0x0;var _0x17625b=_0x922b[_0x1baa98];return _0x17625b;};'use strict';var _=require(_0xb922('0x0'));var util=require(_0xb922('0x1'));var logger=require(_0xb922('0x2'))('api');var moment=require(_0xb922('0x3'));var BPromise=require(_0xb922('0x4'));var rp=require(_0xb922('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb922('0x6'));var config=require('../../config/environment');var attributes=require(_0xb922('0x7'));module['exports']=function(_0xf67a44,_0x3a529f){return _0xf67a44['define']('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2bc4=['whatsapp_accounts','lodash','util','api','moment','path','../../config/environment','exports'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x2bc4,0x1b9));var _0x42bc=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2bc4[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x42bc('0x0'));var util=require(_0x42bc('0x1'));var logger=require('../../config/logger')(_0x42bc('0x2'));var moment=require(_0x42bc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x42bc('0x4'));var rimraf=require('rimraf');var config=require(_0x42bc('0x5'));var attributes=require('./whatsappAccount.attributes');module[_0x42bc('0x6')]=function(_0x18915f,_0x4ee5b2){return _0x18915f['define']('WhatsappAccount',attributes,{'tableName':_0x42bc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b01f40a..577116c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1516=['WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map','model','include','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','info'];(function(_0xabe145,_0x2ef96d){var _0x433e19=function(_0x3eca1a){while(--_0x3eca1a){_0xabe145['push'](_0xabe145['shift']());}};_0x433e19(++_0x2ef96d);}(_0x1516,0xb0));var _0x6151=function(_0x4a47ba,_0x3860ab){_0x4a47ba=_0x4a47ba-0x0;var _0x4ffaf=_0x1516[_0x4a47ba];return _0x4ffaf;};'use strict';var _=require(_0x6151('0x0'));var util=require(_0x6151('0x1'));var moment=require(_0x6151('0x2'));var BPromise=require('bluebird');var rs=require(_0x6151('0x3'));var fs=require('fs');var Redis=require(_0x6151('0x4'));var db=require(_0x6151('0x5'))['db'];var utils=require(_0x6151('0x6'));var logger=require(_0x6151('0x7'))('rpc');var config=require(_0x6151('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6151('0x9')][_0x6151('0xa')]({'port':0x232a});config[_0x6151('0xb')]=_[_0x6151('0xc')](config[_0x6151('0xb')],{'host':_0x6151('0xd'),'port':0x18eb});var socket=require(_0x6151('0xe'))(new Redis(config[_0x6151('0xb')]));require(_0x6151('0xf'))['register'](socket);function respondWithRpcPromise(_0x5d2278,_0x13c0a8,_0x22ff2d){return new BPromise(function(_0xb9019b,_0x469a87){return client[_0x6151('0x10')](_0x5d2278,_0x22ff2d)[_0x6151('0x11')](function(_0x3f82f4){logger[_0x6151('0x12')](_0x6151('0x13'),_0x13c0a8,'request\x20sent');logger['debug'](_0x6151('0x14'),_0x13c0a8,_0x6151('0x15'),JSON[_0x6151('0x16')](_0x3f82f4));if(_0x3f82f4['error']){if(_0x3f82f4[_0x6151('0x17')][_0x6151('0x18')]===0x1f4){logger[_0x6151('0x17')](_0x6151('0x13'),_0x13c0a8,_0x3f82f4['error'][_0x6151('0x19')]);return _0x469a87(_0x3f82f4['error'][_0x6151('0x19')]);}logger[_0x6151('0x17')](_0x6151('0x13'),_0x13c0a8,_0x3f82f4[_0x6151('0x17')][_0x6151('0x19')]);return _0xb9019b(_0x3f82f4[_0x6151('0x17')][_0x6151('0x19')]);}else{logger[_0x6151('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x13c0a8,_0x6151('0x15'));_0xb9019b(_0x3f82f4[_0x6151('0x1a')]['message']);}})[_0x6151('0x1b')](function(_0x24bfbd){logger[_0x6151('0x17')](_0x6151('0x13'),_0x13c0a8,_0x24bfbd);_0x469a87(_0x24bfbd);});});}exports[_0x6151('0x1c')]=function(_0x1c8ff6){var _0x38bcac=this;return new Promise(function(_0x3792b9,_0x18a908){return db[_0x6151('0x1d')][_0x6151('0x1e')]({'raw':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6[_0x6151('0x1f')][_0x6151('0x20')]===undefined?!![]:![]:!![],'where':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6['options'][_0x6151('0x21')]||null:null,'attributes':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6['options'][_0x6151('0x22')]||null:null,'include':_0x1c8ff6[_0x6151('0x1f')]?_0x1c8ff6[_0x6151('0x1f')]['include']?_[_0x6151('0x23')](_0x1c8ff6[_0x6151('0x1f')]['include'],function(_0x30f34b){return{'model':db[_0x30f34b[_0x6151('0x24')]],'as':_0x30f34b['as'],'attributes':_0x30f34b[_0x6151('0x22')],'include':_0x30f34b[_0x6151('0x25')]?_['map'](_0x30f34b[_0x6151('0x25')],function(_0x3e1739){return{'model':db[_0x3e1739[_0x6151('0x24')]],'as':_0x3e1739['as'],'attributes':_0x3e1739[_0x6151('0x22')],'include':_0x3e1739['include']?_[_0x6151('0x23')](_0x3e1739[_0x6151('0x25')],function(_0x99ea9f){return{'model':db[_0x99ea9f['model']],'as':_0x99ea9f['as'],'attributes':_0x99ea9f[_0x6151('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6151('0x11')](function(_0x5de929){logger[_0x6151('0x12')](_0x6151('0x1c'),_0x1c8ff6);logger[_0x6151('0x26')](_0x6151('0x1c'),_0x1c8ff6,JSON[_0x6151('0x16')](_0x5de929));_0x3792b9(_0x5de929);})[_0x6151('0x1b')](function(_0x33fb40){logger[_0x6151('0x17')](_0x6151('0x1c'),_0x33fb40[_0x6151('0x19')],_0x1c8ff6);_0x18a908(_0x38bcac[_0x6151('0x17')](0x1f4,_0x33fb40[_0x6151('0x19')]));});});};
\ No newline at end of file
+var _0x4b11=['socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','ShowWhatsappAccount','find','options','raw','where','include','map','model','attributes','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x34967a,_0x5409db){var _0xf08c5e=function(_0x223207){while(--_0x223207){_0x34967a['push'](_0x34967a['shift']());}};_0xf08c5e(++_0x5409db);}(_0x4b11,0xf4));var _0x14b1=function(_0x25cbf5,_0x5c315a){_0x25cbf5=_0x25cbf5-0x0;var _0x30ce03=_0x4b11[_0x25cbf5];return _0x30ce03;};'use strict';var _=require(_0x14b1('0x0'));var util=require(_0x14b1('0x1'));var moment=require(_0x14b1('0x2'));var BPromise=require(_0x14b1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14b1('0x4'));var db=require(_0x14b1('0x5'))['db'];var utils=require(_0x14b1('0x6'));var logger=require('../../config/logger')(_0x14b1('0x7'));var config=require(_0x14b1('0x8'));var jayson=require(_0x14b1('0x9'));var client=jayson[_0x14b1('0xa')][_0x14b1('0xb')]({'port':0x232a});config[_0x14b1('0xc')]=_[_0x14b1('0xd')](config[_0x14b1('0xc')],{'host':_0x14b1('0xe'),'port':0x18eb});var socket=require(_0x14b1('0xf'))(new Redis(config[_0x14b1('0xc')]));require(_0x14b1('0x10'))[_0x14b1('0x11')](socket);function respondWithRpcPromise(_0x104038,_0x31be73,_0x57bb9f){return new BPromise(function(_0x2c5978,_0x99ff66){return client['request'](_0x104038,_0x57bb9f)[_0x14b1('0x12')](function(_0x84c9dc){logger[_0x14b1('0x13')](_0x14b1('0x14'),_0x31be73,_0x14b1('0x15'));logger[_0x14b1('0x16')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x31be73,_0x14b1('0x15'),JSON['stringify'](_0x84c9dc));if(_0x84c9dc['error']){if(_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x18')]===0x1f4){logger[_0x14b1('0x17')](_0x14b1('0x14'),_0x31be73,_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x19')]);return _0x99ff66(_0x84c9dc['error'][_0x14b1('0x19')]);}logger[_0x14b1('0x17')](_0x14b1('0x14'),_0x31be73,_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x19')]);return _0x2c5978(_0x84c9dc[_0x14b1('0x17')][_0x14b1('0x19')]);}else{logger[_0x14b1('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x31be73,'request\x20sent');_0x2c5978(_0x84c9dc['result'][_0x14b1('0x19')]);}})[_0x14b1('0x1a')](function(_0x36a0d1){logger[_0x14b1('0x17')](_0x14b1('0x14'),_0x31be73,_0x36a0d1);_0x99ff66(_0x36a0d1);});});}exports[_0x14b1('0x1b')]=function(_0x36aca6){var _0x290d40=this;return new Promise(function(_0x4f4830,_0x1785ac){return db['WhatsappAccount'][_0x14b1('0x1c')]({'raw':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6['options'][_0x14b1('0x1e')]===undefined?!![]:![]:!![],'where':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6['options'][_0x14b1('0x1f')]||null:null,'attributes':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6[_0x14b1('0x1d')]['attributes']||null:null,'include':_0x36aca6[_0x14b1('0x1d')]?_0x36aca6['options'][_0x14b1('0x20')]?_[_0x14b1('0x21')](_0x36aca6[_0x14b1('0x1d')][_0x14b1('0x20')],function(_0x3eeb09){return{'model':db[_0x3eeb09[_0x14b1('0x22')]],'as':_0x3eeb09['as'],'attributes':_0x3eeb09[_0x14b1('0x23')],'include':_0x3eeb09[_0x14b1('0x20')]?_[_0x14b1('0x21')](_0x3eeb09['include'],function(_0x5e46e5){return{'model':db[_0x5e46e5[_0x14b1('0x22')]],'as':_0x5e46e5['as'],'attributes':_0x5e46e5[_0x14b1('0x23')],'include':_0x5e46e5['include']?_[_0x14b1('0x21')](_0x5e46e5[_0x14b1('0x20')],function(_0x551dbe){return{'model':db[_0x551dbe[_0x14b1('0x22')]],'as':_0x551dbe['as'],'attributes':_0x551dbe[_0x14b1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x14b1('0x12')](function(_0x357eb3){logger['info'](_0x14b1('0x1b'),_0x36aca6);logger[_0x14b1('0x16')](_0x14b1('0x1b'),_0x36aca6,JSON[_0x14b1('0x24')](_0x357eb3));_0x4f4830(_0x357eb3);})[_0x14b1('0x1a')](function(_0x1c9fd3){logger['error'](_0x14b1('0x1b'),_0x1c9fd3['message'],_0x36aca6);_0x1785ac(_0x290d40[_0x14b1('0x17')](0x1f4,_0x1c9fd3['message']));});});};
\ No newline at end of file
index 102a760..d651ea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed4d=['whatsappAccount:','./whatsappAccount.events','remove','update','emit','register','length'];(function(_0x4c0622,_0x5dacaf){var _0x1799d8=function(_0x2ba801){while(--_0x2ba801){_0x4c0622['push'](_0x4c0622['shift']());}};_0x1799d8(++_0x5dacaf);}(_0xed4d,0x15f));var _0xded4=function(_0x37a881,_0x467f2b){_0x37a881=_0x37a881-0x0;var _0x287ecf=_0xed4d[_0x37a881];return _0x287ecf;};'use strict';var WhatsappAccountEvents=require(_0xded4('0x0'));var events=['save',_0xded4('0x1'),_0xded4('0x2')];function createListener(_0x1bda95,_0x16a9cd){return function(_0x3d5b51){_0x16a9cd[_0xded4('0x3')](_0x1bda95,_0x3d5b51);};}function removeListener(_0x374328,_0x37e832){return function(){WhatsappAccountEvents['removeListener'](_0x374328,_0x37e832);};}exports[_0xded4('0x4')]=function(_0x3492f9){for(var _0x2f9da7=0x0,_0x1688c8=events[_0xded4('0x5')];_0x2f9da7<_0x1688c8;_0x2f9da7++){var _0x4fd64c=events[_0x2f9da7];var _0x558d81=createListener(_0xded4('0x6')+_0x4fd64c,_0x3492f9);WhatsappAccountEvents['on'](_0x4fd64c,_0x558d81);}};
\ No newline at end of file
+var _0x2885=['removeListener','register','whatsappAccount:','remove','update','emit'];(function(_0x4f29cb,_0x3f2946){var _0x13b478=function(_0x3bd4e6){while(--_0x3bd4e6){_0x4f29cb['push'](_0x4f29cb['shift']());}};_0x13b478(++_0x3f2946);}(_0x2885,0x1a1));var _0x5288=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x2885[_0x11005e];return _0x29338f;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x5288('0x0'),_0x5288('0x1')];function createListener(_0x15b44e,_0x42921b){return function(_0x3a7cf4){_0x42921b[_0x5288('0x2')](_0x15b44e,_0x3a7cf4);};}function removeListener(_0x224025,_0x396864){return function(){WhatsappAccountEvents[_0x5288('0x3')](_0x224025,_0x396864);};}exports[_0x5288('0x4')]=function(_0x5f54ac){for(var _0x58c1e7=0x0,_0x19a92f=events['length'];_0x58c1e7<_0x19a92f;_0x58c1e7++){var _0x3151c6=events[_0x58c1e7];var _0x21e4ef=createListener(_0x5288('0x5')+_0x3151c6,_0x5f54ac);WhatsappAccountEvents['on'](_0x3151c6,_0x21e4ef);}};
\ No newline at end of file
index 279aaa7..4d56787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7d1=['create','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7d1,0x113));var _0x1f7d=function(_0x3bba6d,_0x7927af){_0x3bba6d=_0x3bba6d-0x0;var _0xab7d67=_0xf7d1[_0x3bba6d];return _0xab7d67;};'use strict';var multer=require('multer');var util=require(_0x1f7d('0x0'));var path=require('path');var timeout=require(_0x1f7d('0x1'));var express=require('express');var router=express[_0x1f7d('0x2')]();var fs_extra=require(_0x1f7d('0x3'));var auth=require(_0x1f7d('0x4'));var interaction=require(_0x1f7d('0x5'));var config=require(_0x1f7d('0x6'));var controller=require(_0x1f7d('0x7'));router['get']('/',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0x9')]);router[_0x1f7d('0xa')](_0x1f7d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1f7d('0xc')]('/',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xd')]);router['put']('/:id',auth[_0x1f7d('0x8')](),controller[_0x1f7d('0xe')]);router[_0x1f7d('0xf')](_0x1f7d('0xb'),auth[_0x1f7d('0x8')](),controller[_0x1f7d('0x10')]);module[_0x1f7d('0x11')]=router;
\ No newline at end of file
+var _0x5614=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra'];(function(_0x485fa6,_0x4cfca0){var _0x20fe7c=function(_0x4bd47c){while(--_0x4bd47c){_0x485fa6['push'](_0x485fa6['shift']());}};_0x20fe7c(++_0x4cfca0);}(_0x5614,0x1b1));var _0x4561=function(_0x2ceb73,_0xdc2d0a){_0x2ceb73=_0x2ceb73-0x0;var _0x3be568=_0x5614[_0x2ceb73];return _0x3be568;};'use strict';var multer=require('multer');var util=require(_0x4561('0x0'));var path=require(_0x4561('0x1'));var timeout=require(_0x4561('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4561('0x3'));var auth=require(_0x4561('0x4'));var interaction=require(_0x4561('0x5'));var config=require(_0x4561('0x6'));var controller=require(_0x4561('0x7'));router[_0x4561('0x8')]('/',auth[_0x4561('0x9')](),controller[_0x4561('0xa')]);router[_0x4561('0x8')](_0x4561('0xb'),auth[_0x4561('0x9')](),controller['show']);router[_0x4561('0xc')]('/',auth[_0x4561('0x9')](),controller[_0x4561('0xd')]);router[_0x4561('0xe')](_0x4561('0xb'),auth['isAuthenticated'](),controller[_0x4561('0xf')]);router[_0x4561('0x10')](_0x4561('0xb'),auth[_0x4561('0x9')](),controller[_0x4561('0x11')]);module[_0x4561('0x12')]=router;
\ No newline at end of file
index d579fcd..a9e33fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cfd=['*,*,*,*','sequelize','exports','STRING'];(function(_0x49c959,_0x5c3943){var _0x38b0e8=function(_0x10546b){while(--_0x10546b){_0x49c959['push'](_0x49c959['shift']());}};_0x38b0e8(++_0x5c3943);}(_0x9cfd,0x129));var _0xd9cf=function(_0x5c2e16,_0x5bae00){_0x5c2e16=_0x5c2e16-0x0;var _0x57070d=_0x9cfd[_0x5c2e16];return _0x57070d;};'use strict';var Sequelize=require(_0xd9cf('0x0'));module[_0xd9cf('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xd9cf('0x2')]},'interval':{'type':Sequelize[_0xd9cf('0x2')],'defaultValue':_0xd9cf('0x3')}};
\ No newline at end of file
+var _0x0ebd=['INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x56e7f3,_0x546616){var _0x3e99e4=function(_0x4f16a3){while(--_0x4f16a3){_0x56e7f3['push'](_0x56e7f3['shift']());}};_0x3e99e4(++_0x546616);}(_0x0ebd,0xcd));var _0xd0eb=function(_0x3ccb3b,_0x11e879){_0x3ccb3b=_0x3ccb3b-0x0;var _0x2a10a0=_0x0ebd[_0x3ccb3b];return _0x2a10a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xd0eb('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd0eb('0x1')},'appdata':{'type':Sequelize[_0xd0eb('0x2')]()},'description':{'type':Sequelize[_0xd0eb('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd0eb('0x4')}};
\ No newline at end of file
index cbef254..f9a5d2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8768=['includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','WhatsappApplication','fieldName','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','length'];(function(_0x39be61,_0x3852b1){var _0x1f91c8=function(_0x3c9a6b){while(--_0x3c9a6b){_0x39be61['push'](_0x39be61['shift']());}};_0x1f91c8(++_0x3852b1);}(_0x8768,0xa1));var _0x8876=function(_0x4b433d,_0x8b4ddb){_0x4b433d=_0x4b433d-0x0;var _0x406ea7=_0x8768[_0x4b433d];return _0x406ea7;};'use strict';var emlformat=require(_0x8876('0x0'));var rimraf=require(_0x8876('0x1'));var zipdir=require(_0x8876('0x2'));var jsonpatch=require(_0x8876('0x3'));var rp=require(_0x8876('0x4'));var moment=require(_0x8876('0x5'));var BPromise=require(_0x8876('0x6'));var Mustache=require(_0x8876('0x7'));var util=require(_0x8876('0x8'));var path=require(_0x8876('0x9'));var sox=require(_0x8876('0xa'));var csv=require(_0x8876('0xb'));var ejs=require(_0x8876('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8876('0xd'));var squel=require(_0x8876('0xe'));var crypto=require(_0x8876('0xf'));var jsforce=require(_0x8876('0x10'));var deskjs=require(_0x8876('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8876('0x12'));var Redis=require(_0x8876('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8876('0x14'));var hardwareService=require(_0x8876('0x15'));var logger=require(_0x8876('0x16'))(_0x8876('0x17'));var utils=require(_0x8876('0x18'));var config=require(_0x8876('0x19'));var licenseUtil=require(_0x8876('0x1a'));var db=require(_0x8876('0x1b'))['db'];function respondWithStatusCode(_0x1415ad,_0x3c3c10){_0x3c3c10=_0x3c3c10||0xcc;return function(_0x5d2f75){if(_0x5d2f75){return _0x1415ad[_0x8876('0x1c')](_0x3c3c10);}return _0x1415ad[_0x8876('0x1d')](_0x3c3c10)[_0x8876('0x1e')]();};}function respondWithResult(_0x44de2a,_0xb502bf){_0xb502bf=_0xb502bf||0xc8;return function(_0x4b71cf){if(_0x4b71cf){return _0x44de2a[_0x8876('0x1d')](_0xb502bf)[_0x8876('0x1f')](_0x4b71cf);}};}function respondWithFilteredResult(_0x16f98b,_0xcdaa43){return function(_0x262058){if(_0x262058){var _0x2d50ad=typeof _0xcdaa43[_0x8876('0x20')]==='undefined'&&typeof _0xcdaa43[_0x8876('0x21')]===_0x8876('0x22');var _0xeea8f9=_0x262058[_0x8876('0x23')];var _0x146fdf=_0x2d50ad?0x0:_0xcdaa43['offset'];var _0x482899=_0x2d50ad?_0x262058[_0x8876('0x23')]:_0xcdaa43[_0x8876('0x20')]+_0xcdaa43[_0x8876('0x21')];var _0x56771b;if(_0x482899>=_0xeea8f9){_0x482899=_0xeea8f9;_0x56771b=0xc8;}else{_0x56771b=0xce;}_0x16f98b[_0x8876('0x1d')](_0x56771b);return _0x16f98b[_0x8876('0x24')]('Content-Range',_0x146fdf+'-'+_0x482899+'/'+_0xeea8f9)[_0x8876('0x1f')](_0x262058);}return null;};}function patchUpdates(_0xe3c6a1){return function(_0x26074f){try{jsonpatch[_0x8876('0x25')](_0x26074f,_0xe3c6a1,!![]);}catch(_0x2522d7){return BPromise[_0x8876('0x26')](_0x2522d7);}return _0x26074f[_0x8876('0x27')]();};}function saveUpdates(_0x4e6b3c,_0x3dd3f1){return function(_0x5cfbd9){if(_0x5cfbd9){return _0x5cfbd9[_0x8876('0x28')](_0x4e6b3c)[_0x8876('0x29')](function(_0x327d58){return _0x327d58;});}return null;};}function removeEntity(_0x474843,_0x168170){return function(_0x460240){if(_0x460240){return _0x460240[_0x8876('0x2a')]()[_0x8876('0x29')](function(){_0x474843[_0x8876('0x1d')](0xcc)[_0x8876('0x1e')]();});}};}function handleEntityNotFound(_0x166c18,_0x1e0f91){return function(_0xbd6621){if(!_0xbd6621){_0x166c18['sendStatus'](0x194);}return _0xbd6621;};}function handleError(_0x302b9f,_0x2a5662){_0x2a5662=_0x2a5662||0x1f4;return function(_0x1d1f9a){logger[_0x8876('0x2b')](_0x1d1f9a[_0x8876('0x2c')]);if(_0x1d1f9a[_0x8876('0x2d')]){delete _0x1d1f9a[_0x8876('0x2d')];}_0x302b9f['status'](_0x2a5662)[_0x8876('0x2e')](_0x1d1f9a);};}exports['index']=function(_0x5dbffd,_0x18203c){var _0x57ea22={},_0x49de2e={},_0x41312a={'count':0x0,'rows':[]};var _0x53e2fc=_['map'](db[_0x8876('0x2f')]['rawAttributes'],function(_0x18e580){return{'name':_0x18e580[_0x8876('0x30')],'type':_0x18e580['type'][_0x8876('0x31')]};});_0x49de2e['model']=_['map'](_0x53e2fc,_0x8876('0x2d'));_0x49de2e['query']=_[_0x8876('0x32')](_0x5dbffd[_0x8876('0x33')]);_0x49de2e[_0x8876('0x34')]=_['intersection'](_0x49de2e[_0x8876('0x35')],_0x49de2e[_0x8876('0x33')]);_0x57ea22[_0x8876('0x36')]=_[_0x8876('0x37')](_0x49de2e[_0x8876('0x35')],qs['fields'](_0x5dbffd['query'][_0x8876('0x38')]));_0x57ea22[_0x8876('0x36')]=_0x57ea22[_0x8876('0x36')]['length']?_0x57ea22[_0x8876('0x36')]:_0x49de2e[_0x8876('0x35')];if(!_0x5dbffd['query'][_0x8876('0x39')](_0x8876('0x3a'))){_0x57ea22[_0x8876('0x21')]=qs[_0x8876('0x21')](_0x5dbffd[_0x8876('0x33')][_0x8876('0x21')]);_0x57ea22[_0x8876('0x20')]=qs[_0x8876('0x20')](_0x5dbffd[_0x8876('0x33')][_0x8876('0x20')]);}_0x57ea22['order']=qs[_0x8876('0x3b')](_0x5dbffd['query'][_0x8876('0x3b')]);_0x57ea22[_0x8876('0x3c')]=qs['filters'](_[_0x8876('0x3d')](_0x5dbffd[_0x8876('0x33')],_0x49de2e['filters']),_0x53e2fc);if(_0x5dbffd[_0x8876('0x33')]['filter']){_0x57ea22[_0x8876('0x3c')]=_[_0x8876('0x3e')](_0x57ea22[_0x8876('0x3c')],{'$or':_[_0x8876('0x3f')](_0x53e2fc,function(_0x373e9c){if(_0x373e9c['type']!==_0x8876('0x40')){var _0xc5698c={};_0xc5698c[_0x373e9c[_0x8876('0x2d')]]={'$like':'%'+_0x5dbffd['query']['filter']+'%'};return _0xc5698c;}})});}_0x57ea22=_[_0x8876('0x3e')]({},_0x57ea22,_0x5dbffd[_0x8876('0x41')]);var _0x90687f={'where':_0x57ea22[_0x8876('0x3c')]};return db[_0x8876('0x2f')][_0x8876('0x23')](_0x90687f)[_0x8876('0x29')](function(_0x54b888){_0x41312a['count']=_0x54b888;if(_0x5dbffd[_0x8876('0x33')]['includeAll']){_0x57ea22[_0x8876('0x42')]=[{'all':!![]}];}return db[_0x8876('0x2f')][_0x8876('0x43')](_0x57ea22);})[_0x8876('0x29')](function(_0x21a023){_0x41312a[_0x8876('0x44')]=_0x21a023;return _0x41312a;})[_0x8876('0x29')](respondWithFilteredResult(_0x18203c,_0x57ea22))['catch'](handleError(_0x18203c,null));};exports[_0x8876('0x45')]=function(_0x22ae1b,_0x39e021){var _0x44078a={'raw':!![],'where':{'id':_0x22ae1b[_0x8876('0x46')]['id']}},_0x3670ea={};_0x3670ea[_0x8876('0x35')]=_['keys'](db['WhatsappApplication'][_0x8876('0x47')]);_0x3670ea[_0x8876('0x33')]=_[_0x8876('0x32')](_0x22ae1b[_0x8876('0x33')]);_0x3670ea[_0x8876('0x34')]=_[_0x8876('0x37')](_0x3670ea['model'],_0x3670ea['query']);_0x44078a[_0x8876('0x36')]=_['intersection'](_0x3670ea['model'],qs[_0x8876('0x38')](_0x22ae1b[_0x8876('0x33')][_0x8876('0x38')]));_0x44078a[_0x8876('0x36')]=_0x44078a['attributes'][_0x8876('0x48')]?_0x44078a['attributes']:_0x3670ea[_0x8876('0x35')];if(_0x22ae1b[_0x8876('0x33')][_0x8876('0x49')]){_0x44078a[_0x8876('0x42')]=[{'all':!![]}];}_0x44078a=_[_0x8876('0x3e')]({},_0x44078a,_0x22ae1b[_0x8876('0x41')]);return db[_0x8876('0x2f')][_0x8876('0x4a')](_0x44078a)[_0x8876('0x29')](handleEntityNotFound(_0x39e021,null))['then'](respondWithResult(_0x39e021,null))[_0x8876('0x4b')](handleError(_0x39e021,null));};exports[_0x8876('0x4c')]=function(_0x1b93e6,_0x1075cb){return db[_0x8876('0x2f')][_0x8876('0x4c')](_0x1b93e6[_0x8876('0x4d')],{})[_0x8876('0x29')](respondWithResult(_0x1075cb,0xc9))['catch'](handleError(_0x1075cb,null));};exports['update']=function(_0x5673bf,_0x113fbb){if(_0x5673bf[_0x8876('0x4d')]['id']){delete _0x5673bf[_0x8876('0x4d')]['id'];}return db['WhatsappApplication'][_0x8876('0x4a')]({'where':{'id':_0x5673bf[_0x8876('0x46')]['id']}})[_0x8876('0x29')](handleEntityNotFound(_0x113fbb,null))[_0x8876('0x29')](saveUpdates(_0x5673bf[_0x8876('0x4d')],null))[_0x8876('0x29')](respondWithResult(_0x113fbb,null))[_0x8876('0x4b')](handleError(_0x113fbb,null));};exports[_0x8876('0x2a')]=function(_0x4e1716,_0x3d121e){return db[_0x8876('0x2f')][_0x8876('0x4a')]({'where':{'id':_0x4e1716['params']['id']}})['then'](handleEntityNotFound(_0x3d121e,null))[_0x8876('0x29')](removeEntity(_0x3d121e,null))[_0x8876('0x4b')](handleError(_0x3d121e,null));};
\ No newline at end of file
+var _0xdeb3=['WhatsappApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index'];(function(_0x19595e,_0x4f2b8a){var _0x3f76fa=function(_0x4945c2){while(--_0x4945c2){_0x19595e['push'](_0x19595e['shift']());}};_0x3f76fa(++_0x4f2b8a);}(_0xdeb3,0xb7));var _0x3deb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdeb3[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3deb('0x0'));var zipdir=require(_0x3deb('0x1'));var jsonpatch=require(_0x3deb('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3deb('0x3'));var Mustache=require(_0x3deb('0x4'));var util=require(_0x3deb('0x5'));var path=require(_0x3deb('0x6'));var sox=require(_0x3deb('0x7'));var csv=require('to-csv');var ejs=require(_0x3deb('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3deb('0x9'));var squel=require('squel');var crypto=require(_0x3deb('0xa'));var jsforce=require(_0x3deb('0xb'));var deskjs=require(_0x3deb('0xc'));var toCsv=require(_0x3deb('0xd'));var querystring=require(_0x3deb('0xe'));var Papa=require(_0x3deb('0xf'));var Redis=require(_0x3deb('0x10'));var authService=require(_0x3deb('0x11'));var qs=require(_0x3deb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3deb('0x13'))(_0x3deb('0x14'));var utils=require(_0x3deb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3deb('0x16'));var db=require(_0x3deb('0x17'))['db'];function respondWithStatusCode(_0xc65b64,_0x106ead){_0x106ead=_0x106ead||0xcc;return function(_0x555a07){if(_0x555a07){return _0xc65b64['sendStatus'](_0x106ead);}return _0xc65b64['status'](_0x106ead)[_0x3deb('0x18')]();};}function respondWithResult(_0x1260a4,_0x39f5e0){_0x39f5e0=_0x39f5e0||0xc8;return function(_0x5336c7){if(_0x5336c7){return _0x1260a4[_0x3deb('0x19')](_0x39f5e0)[_0x3deb('0x1a')](_0x5336c7);}};}function respondWithFilteredResult(_0x55c13c,_0x24b516){return function(_0x3210e7){if(_0x3210e7){var _0x5ddc06=typeof _0x24b516[_0x3deb('0x1b')]==='undefined'&&typeof _0x24b516[_0x3deb('0x1c')]==='undefined';var _0x4cce09=_0x3210e7[_0x3deb('0x1d')];var _0x23c4b9=_0x5ddc06?0x0:_0x24b516[_0x3deb('0x1b')];var _0x9ba4f=_0x5ddc06?_0x3210e7[_0x3deb('0x1d')]:_0x24b516[_0x3deb('0x1b')]+_0x24b516['limit'];var _0x311a48;if(_0x9ba4f>=_0x4cce09){_0x9ba4f=_0x4cce09;_0x311a48=0xc8;}else{_0x311a48=0xce;}_0x55c13c[_0x3deb('0x19')](_0x311a48);return _0x55c13c['set'](_0x3deb('0x1e'),_0x23c4b9+'-'+_0x9ba4f+'/'+_0x4cce09)[_0x3deb('0x1a')](_0x3210e7);}return null;};}function patchUpdates(_0x1c8641){return function(_0xedc588){try{jsonpatch[_0x3deb('0x1f')](_0xedc588,_0x1c8641,!![]);}catch(_0x583dce){return BPromise[_0x3deb('0x20')](_0x583dce);}return _0xedc588[_0x3deb('0x21')]();};}function saveUpdates(_0x2705e5,_0x1b81ff){return function(_0x3327e0){if(_0x3327e0){return _0x3327e0[_0x3deb('0x22')](_0x2705e5)[_0x3deb('0x23')](function(_0x1f535e){return _0x1f535e;});}return null;};}function removeEntity(_0x42a8d5,_0x487283){return function(_0x1f6120){if(_0x1f6120){return _0x1f6120['destroy']()[_0x3deb('0x23')](function(){_0x42a8d5[_0x3deb('0x19')](0xcc)[_0x3deb('0x18')]();});}};}function handleEntityNotFound(_0x392fec,_0x9fad49){return function(_0x245544){if(!_0x245544){_0x392fec[_0x3deb('0x24')](0x194);}return _0x245544;};}function handleError(_0x255fa5,_0x38af26){_0x38af26=_0x38af26||0x1f4;return function(_0x2789cd){logger[_0x3deb('0x25')](_0x2789cd[_0x3deb('0x26')]);if(_0x2789cd[_0x3deb('0x27')]){delete _0x2789cd[_0x3deb('0x27')];}_0x255fa5[_0x3deb('0x19')](_0x38af26)[_0x3deb('0x28')](_0x2789cd);};}exports[_0x3deb('0x29')]=function(_0x16b44e,_0x1b6d93){var _0x3e8b62={},_0x4c72c7={},_0x2e10ca={'count':0x0,'rows':[]};var _0x438e65=_['map'](db[_0x3deb('0x2a')]['rawAttributes'],function(_0x349f1b){return{'name':_0x349f1b[_0x3deb('0x2b')],'type':_0x349f1b[_0x3deb('0x2c')][_0x3deb('0x2d')]};});_0x4c72c7[_0x3deb('0x2e')]=_[_0x3deb('0x2f')](_0x438e65,'name');_0x4c72c7[_0x3deb('0x30')]=_[_0x3deb('0x31')](_0x16b44e[_0x3deb('0x30')]);_0x4c72c7[_0x3deb('0x32')]=_[_0x3deb('0x33')](_0x4c72c7[_0x3deb('0x2e')],_0x4c72c7[_0x3deb('0x30')]);_0x3e8b62[_0x3deb('0x34')]=_['intersection'](_0x4c72c7[_0x3deb('0x2e')],qs[_0x3deb('0x35')](_0x16b44e[_0x3deb('0x30')][_0x3deb('0x35')]));_0x3e8b62[_0x3deb('0x34')]=_0x3e8b62[_0x3deb('0x34')][_0x3deb('0x36')]?_0x3e8b62[_0x3deb('0x34')]:_0x4c72c7[_0x3deb('0x2e')];if(!_0x16b44e[_0x3deb('0x30')][_0x3deb('0x37')](_0x3deb('0x38'))){_0x3e8b62[_0x3deb('0x1c')]=qs[_0x3deb('0x1c')](_0x16b44e[_0x3deb('0x30')][_0x3deb('0x1c')]);_0x3e8b62[_0x3deb('0x1b')]=qs[_0x3deb('0x1b')](_0x16b44e[_0x3deb('0x30')]['offset']);}_0x3e8b62[_0x3deb('0x39')]=qs[_0x3deb('0x3a')](_0x16b44e[_0x3deb('0x30')][_0x3deb('0x3a')]);_0x3e8b62['where']=qs[_0x3deb('0x32')](_[_0x3deb('0x3b')](_0x16b44e[_0x3deb('0x30')],_0x4c72c7[_0x3deb('0x32')]),_0x438e65);if(_0x16b44e[_0x3deb('0x30')]['filter']){_0x3e8b62['where']=_[_0x3deb('0x3c')](_0x3e8b62[_0x3deb('0x3d')],{'$or':_[_0x3deb('0x2f')](_0x438e65,function(_0x3412e1){if(_0x3412e1[_0x3deb('0x2c')]!==_0x3deb('0x3e')){var _0x27499b={};_0x27499b[_0x3412e1[_0x3deb('0x27')]]={'$like':'%'+_0x16b44e[_0x3deb('0x30')][_0x3deb('0x3f')]+'%'};return _0x27499b;}})});}_0x3e8b62=_[_0x3deb('0x3c')]({},_0x3e8b62,_0x16b44e['options']);var _0x597f89={'where':_0x3e8b62[_0x3deb('0x3d')]};return db[_0x3deb('0x2a')][_0x3deb('0x1d')](_0x597f89)[_0x3deb('0x23')](function(_0x3a4866){_0x2e10ca[_0x3deb('0x1d')]=_0x3a4866;if(_0x16b44e['query']['includeAll']){_0x3e8b62[_0x3deb('0x40')]=[{'all':!![]}];}return db[_0x3deb('0x2a')][_0x3deb('0x41')](_0x3e8b62);})[_0x3deb('0x23')](function(_0x4e6254){_0x2e10ca[_0x3deb('0x42')]=_0x4e6254;return _0x2e10ca;})[_0x3deb('0x23')](respondWithFilteredResult(_0x1b6d93,_0x3e8b62))[_0x3deb('0x43')](handleError(_0x1b6d93,null));};exports[_0x3deb('0x44')]=function(_0x4a81b2,_0x355594){var _0x5bd42c={'raw':!![],'where':{'id':_0x4a81b2[_0x3deb('0x45')]['id']}},_0x5e5763={};_0x5e5763[_0x3deb('0x2e')]=_['keys'](db[_0x3deb('0x2a')][_0x3deb('0x46')]);_0x5e5763[_0x3deb('0x30')]=_[_0x3deb('0x31')](_0x4a81b2[_0x3deb('0x30')]);_0x5e5763['filters']=_[_0x3deb('0x33')](_0x5e5763[_0x3deb('0x2e')],_0x5e5763['query']);_0x5bd42c['attributes']=_['intersection'](_0x5e5763[_0x3deb('0x2e')],qs[_0x3deb('0x35')](_0x4a81b2[_0x3deb('0x30')][_0x3deb('0x35')]));_0x5bd42c['attributes']=_0x5bd42c[_0x3deb('0x34')][_0x3deb('0x36')]?_0x5bd42c[_0x3deb('0x34')]:_0x5e5763[_0x3deb('0x2e')];if(_0x4a81b2['query']['includeAll']){_0x5bd42c[_0x3deb('0x40')]=[{'all':!![]}];}_0x5bd42c=_[_0x3deb('0x3c')]({},_0x5bd42c,_0x4a81b2['options']);return db['WhatsappApplication'][_0x3deb('0x47')](_0x5bd42c)['then'](handleEntityNotFound(_0x355594,null))[_0x3deb('0x23')](respondWithResult(_0x355594,null))[_0x3deb('0x43')](handleError(_0x355594,null));};exports['create']=function(_0x46fc80,_0x2fbdc3){return db[_0x3deb('0x2a')][_0x3deb('0x48')](_0x46fc80[_0x3deb('0x49')],{})[_0x3deb('0x23')](respondWithResult(_0x2fbdc3,0xc9))[_0x3deb('0x43')](handleError(_0x2fbdc3,null));};exports[_0x3deb('0x22')]=function(_0xcd0ba9,_0x24a040){if(_0xcd0ba9[_0x3deb('0x49')]['id']){delete _0xcd0ba9[_0x3deb('0x49')]['id'];}return db[_0x3deb('0x2a')]['find']({'where':{'id':_0xcd0ba9['params']['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x24a040,null))['then'](saveUpdates(_0xcd0ba9['body'],null))[_0x3deb('0x23')](respondWithResult(_0x24a040,null))[_0x3deb('0x43')](handleError(_0x24a040,null));};exports[_0x3deb('0x4a')]=function(_0x273054,_0x596ad4){return db[_0x3deb('0x2a')][_0x3deb('0x47')]({'where':{'id':_0x273054[_0x3deb('0x45')]['id']}})[_0x3deb('0x23')](handleEntityNotFound(_0x596ad4,null))['then'](removeEntity(_0x596ad4,null))[_0x3deb('0x43')](handleError(_0x596ad4,null));};
\ No newline at end of file
index 32006a8..b7f7373 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdad2=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdad2,0x14c));var _0x2dad=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdad2[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x2dad('0x0'));var logger=require(_0x2dad('0x1'))('api');var moment=require(_0x2dad('0x2'));var BPromise=require(_0x2dad('0x3'));var rp=require(_0x2dad('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2dad('0x5'));var config=require(_0x2dad('0x6'));var attributes=require('./whatsappApplication.attributes');module[_0x2dad('0x7')]=function(_0x36a054,_0x27ca04){return _0x36a054[_0x2dad('0x8')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2dad('0x9'),'collate':_0x2dad('0xa')});};
\ No newline at end of file
+var _0xc03e=['bluebird','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','lodash','api'];(function(_0x3cb587,_0x119c86){var _0x5ed07a=function(_0x397b7d){while(--_0x397b7d){_0x3cb587['push'](_0x3cb587['shift']());}};_0x5ed07a(++_0x119c86);}(_0xc03e,0x15a));var _0xec03=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0xc03e[_0xa30766];return _0x24e780;};'use strict';var _=require(_0xec03('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xec03('0x1'));var moment=require('moment');var BPromise=require(_0xec03('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec03('0x3'));var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1ce78a,_0x31db21){return _0x1ce78a[_0xec03('0x8')](_0xec03('0x9'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec03('0xa'),'collate':_0xec03('0xb')});};
\ No newline at end of file
index cefdc4f..95213ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['code','WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xc087bb,_0x3aa26a){var _0x46efd5=function(_0x5afd99){while(--_0x5afd99){_0xc087bb['push'](_0xc087bb['shift']());}};_0x46efd5(++_0x3aa26a);}(_0x70e0,0x17b));var _0x070e=function(_0x4b6e3e,_0x4bf14f){_0x4b6e3e=_0x4b6e3e-0x0;var _0x13a645=_0x70e0[_0x4b6e3e];return _0x13a645;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});}
\ No newline at end of file
+var _0x24ca=['request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x4d137f,_0x4cf4fa){var _0x308a9e=function(_0x2944dd){while(--_0x2944dd){_0x4d137f['push'](_0x4d137f['shift']());}};_0x308a9e(++_0x4cf4fa);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x24ca[_0x1df7b8];return _0x29d911;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require(_0xa24c('0x1'));var BPromise=require(_0xa24c('0x2'));var rs=require(_0xa24c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa24c('0x4'))['db'];var utils=require(_0xa24c('0x5'));var logger=require(_0xa24c('0x6'))(_0xa24c('0x7'));var config=require(_0xa24c('0x8'));var jayson=require(_0xa24c('0x9'));var client=jayson[_0xa24c('0xa')][_0xa24c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){return client[_0xa24c('0xc')](_0x2dd348,_0x9a5013)[_0xa24c('0xd')](function(_0x5eac78){logger[_0xa24c('0xe')](_0xa24c('0xf'),_0x257264,_0xa24c('0x10'));logger[_0xa24c('0x11')](_0xa24c('0x12'),_0x257264,_0xa24c('0x10'),JSON[_0xa24c('0x13')](_0x5eac78));if(_0x5eac78[_0xa24c('0x14')]){if(_0x5eac78[_0xa24c('0x14')]['code']===0x1f4){logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x42d89c(_0x5eac78['error'][_0xa24c('0x15')]);}logger[_0xa24c('0x14')](_0xa24c('0xf'),_0x257264,_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);return _0x481196(_0x5eac78[_0xa24c('0x14')][_0xa24c('0x15')]);}else{logger['info']('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0xa24c('0x10'));_0x481196(_0x5eac78[_0xa24c('0x16')]['message']);}})['catch'](function(_0x221d21){logger[_0xa24c('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x257264,_0x221d21);_0x42d89c(_0x221d21);});});}
\ No newline at end of file
index 2544d73..7405e02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6657=['/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','update','delete','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe'];(function(_0xc2d26f,_0x180ccf){var _0x50e707=function(_0x59d7c1){while(--_0x59d7c1){_0xc2d26f['push'](_0xc2d26f['shift']());}};_0x50e707(++_0x180ccf);}(_0x6657,0x17f));var _0x7665=function(_0x5076ae,_0x4d9525){_0x5076ae=_0x5076ae-0x0;var _0x1b936f=_0x6657[_0x5076ae];return _0x1b936f;};'use strict';var multer=require(_0x7665('0x0'));var util=require('util');var path=require(_0x7665('0x1'));var timeout=require(_0x7665('0x2'));var express=require(_0x7665('0x3'));var router=express[_0x7665('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7665('0x5'));var interaction=require(_0x7665('0x6'));var config=require(_0x7665('0x7'));var controller=require(_0x7665('0x8'));router[_0x7665('0x9')]('/',auth[_0x7665('0xa')](),controller[_0x7665('0xb')]);router[_0x7665('0x9')]('/describe',auth[_0x7665('0xa')](),controller[_0x7665('0xc')]);router[_0x7665('0x9')](_0x7665('0xd'),auth[_0x7665('0xa')](),controller[_0x7665('0xe')]);router[_0x7665('0x9')](_0x7665('0xf'),auth['isAuthenticated'](),controller[_0x7665('0x10')]);router[_0x7665('0x9')](_0x7665('0x11'),auth['isAuthenticated'](),controller[_0x7665('0x12')]);router['post']('/',auth[_0x7665('0xa')](),controller[_0x7665('0x13')]);router['post'](_0x7665('0xf'),auth[_0x7665('0xa')](),controller['addMessage']);router[_0x7665('0x14')](_0x7665('0x15'),auth['isAuthenticated'](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x18')),controller[_0x7665('0x19')]);router[_0x7665('0x1a')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),_0x7665('0x1b')),controller[_0x7665('0x1c')]);router[_0x7665('0x1d')](_0x7665('0xd'),auth[_0x7665('0xa')](),interaction[_0x7665('0x16')](_0x7665('0x17'),'whatsappinteraction:destroy'),controller[_0x7665('0x1e')]);router[_0x7665('0x1d')]('/:id/tags',auth[_0x7665('0xa')](),controller[_0x7665('0x1f')]);module[_0x7665('0x20')]=router;
\ No newline at end of file
+var _0xcd59=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags'];(function(_0x1829f6,_0x34df48){var _0x59ffff=function(_0x30230b){while(--_0x30230b){_0x1829f6['push'](_0x1829f6['shift']());}};_0x59ffff(++_0x34df48);}(_0xcd59,0x14b));var _0x9cd5=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xcd59[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var path=require(_0x9cd5('0x2'));var timeout=require(_0x9cd5('0x3'));var express=require(_0x9cd5('0x4'));var router=express[_0x9cd5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9cd5('0x6'));var interaction=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var controller=require(_0x9cd5('0x9'));router[_0x9cd5('0xa')]('/',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xc')]);router[_0x9cd5('0xa')](_0x9cd5('0xd'),auth[_0x9cd5('0xb')](),controller['describe']);router[_0x9cd5('0xa')](_0x9cd5('0xe'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0xf')]);router[_0x9cd5('0xa')](_0x9cd5('0x10'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x11')]);router['get'](_0x9cd5('0x12'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x13')]);router[_0x9cd5('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9cd5('0x14')](_0x9cd5('0x10'),auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x15')]);router[_0x9cd5('0x14')](_0x9cd5('0x16'),auth['isAuthenticated'](),interaction[_0x9cd5('0x17')](_0x9cd5('0x18'),_0x9cd5('0x19')),controller['addTags']);router['put']('/:id',auth[_0x9cd5('0xb')](),interaction[_0x9cd5('0x17')]('whatsapp',_0x9cd5('0x1a')),controller[_0x9cd5('0x1b')]);router[_0x9cd5('0x1c')]('/:id',auth[_0x9cd5('0xb')](),interaction[_0x9cd5('0x17')](_0x9cd5('0x18'),_0x9cd5('0x1d')),controller[_0x9cd5('0x1e')]);router[_0x9cd5('0x1c')]('/:id/tags',auth[_0x9cd5('0xb')](),controller[_0x9cd5('0x1f')]);module[_0x9cd5('0x20')]=router;
\ No newline at end of file
index ee5e38d..7b52600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6347=['ENUM','out','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x59d32c,_0x306b7a){var _0x26e818=function(_0x4c3ed4){while(--_0x4c3ed4){_0x59d32c['push'](_0x59d32c['shift']());}};_0x26e818(++_0x306b7a);}(_0x6347,0x1c9));var _0x7634=function(_0x257a98,_0x214a6e){_0x257a98=_0x257a98-0x0;var _0x5dd12c=_0x6347[_0x257a98];return _0x5dd12c;};'use strict';var Sequelize=require(_0x7634('0x0'));var moment=require(_0x7634('0x1'));module['exports']={'closed':{'type':Sequelize[_0x7634('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7634('0x3')]},'disposition':{'type':Sequelize[_0x7634('0x4')]},'secondDisposition':{'type':Sequelize[_0x7634('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7634('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7634('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7634('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7634('0x5')]('in',_0x7634('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7634('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x873a=['out','BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x21440c,_0x306995){var _0x3ba1f0=function(_0x108d0a){while(--_0x108d0a){_0x21440c['push'](_0x21440c['shift']());}};_0x3ba1f0(++_0x306995);}(_0x873a,0x1c2));var _0xa873=function(_0x142a68,_0xa69a83){_0x142a68=_0x142a68-0x0;var _0x10679d=_0x873a[_0x142a68];return _0x10679d;};'use strict';var Sequelize=require(_0xa873('0x0'));var moment=require(_0xa873('0x1'));module[_0xa873('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa873('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xa873('0x4')]},'note':{'type':Sequelize[_0xa873('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xa873('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa873('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa873('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa873('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xa873('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 6b35ea7..99852ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd959=['Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','Contact','firstName','lastName','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','then','destroy','end','error','stack','name','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','catch','show','params','model','keys','filters','attributes','intersection','fields','includeAll','options','create','body','update','find','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','length','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','merge','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Attachment','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','disposition'];(function(_0x5dca17,_0x43cdb8){var _0xcc7f0c=function(_0x3c0ca2){while(--_0x3c0ca2){_0x5dca17['push'](_0x5dca17['shift']());}};_0xcc7f0c(++_0x43cdb8);}(_0xd959,0x94));var _0x9d95=function(_0x197a53,_0x3ddfe2){_0x197a53=_0x197a53-0x0;var _0x570384=_0xd959[_0x197a53];return _0x570384;};'use strict';var rimraf=require(_0x9d95('0x0'));var zipdir=require(_0x9d95('0x1'));var moment=require(_0x9d95('0x2'));var BPromise=require('bluebird');var util=require(_0x9d95('0x3'));var path=require(_0x9d95('0x4'));var ejs=require(_0x9d95('0x5'));var fs=require('fs');var _=require(_0x9d95('0x6'));var Redis=require(_0x9d95('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x9d95('0x8'));var pdf=require(_0x9d95('0x9'));var logger=require(_0x9d95('0xa'))(_0x9d95('0xb'));var config=require('../../config/environment');var db=require(_0x9d95('0xc'))['db'];config[_0x9d95('0xd')]=_[_0x9d95('0xe')](config['redis'],{'host':_0x9d95('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d95('0xd')]));require(_0x9d95('0x10'))[_0x9d95('0x11')](socket);function respondWithStatusCode(_0x18e15f,_0x2d2e0a){_0x2d2e0a=_0x2d2e0a||0xcc;return function(_0x554f40){if(_0x554f40){return _0x18e15f[_0x9d95('0x12')](_0x2d2e0a);}return _0x18e15f[_0x9d95('0x13')](_0x2d2e0a)['end']();};}function respondWithResult(_0x3aa60a,_0x182a73){_0x182a73=_0x182a73||0xc8;return function(_0x510b67){if(_0x510b67){return _0x3aa60a[_0x9d95('0x13')](_0x182a73)[_0x9d95('0x14')](_0x510b67);}};}function respondWithFilteredResult(_0x40f5cf,_0x1ab7df){return function(_0x568622){if(_0x568622){var _0x1ff6a9=typeof _0x1ab7df[_0x9d95('0x15')]==='undefined'&&typeof _0x1ab7df[_0x9d95('0x16')]===_0x9d95('0x17');var _0xcd7ba8=_0x568622['count'];var _0x2d5ab2=_0x1ff6a9?0x0:_0x1ab7df['offset'];var _0x4cabfd=_0x1ff6a9?_0x568622[_0x9d95('0x18')]:_0x1ab7df[_0x9d95('0x15')]+_0x1ab7df['limit'];var _0x4f4310;if(_0x4cabfd>=_0xcd7ba8){_0x4cabfd=_0xcd7ba8;_0x4f4310=0xc8;}else{_0x4f4310=0xce;}_0x40f5cf['status'](_0x4f4310);return _0x40f5cf[_0x9d95('0x19')](_0x9d95('0x1a'),_0x2d5ab2+'-'+_0x4cabfd+'/'+_0xcd7ba8)[_0x9d95('0x14')](_0x568622);}return null;};}function saveUpdates(_0x453074){return function(_0x481fd6){if(_0x481fd6){return _0x481fd6['update'](_0x453074)[_0x9d95('0x1b')](function(_0x4ec46d){return _0x4ec46d;});}return null;};}function removeEntity(_0x40d5ff){return function(_0x33a809){if(_0x33a809){return _0x33a809[_0x9d95('0x1c')]()[_0x9d95('0x1b')](function(){_0x40d5ff[_0x9d95('0x13')](0xcc)[_0x9d95('0x1d')]();});}};}function handleEntityNotFound(_0x455415){return function(_0x3ac1a3){if(!_0x3ac1a3){_0x455415['sendStatus'](0x194);}return _0x3ac1a3;};}function handleError(_0x31e950,_0x5c8095){_0x5c8095=_0x5c8095||0x1f4;return function(_0x5d0a9a){logger[_0x9d95('0x1e')](_0x5d0a9a[_0x9d95('0x1f')]);if(_0x5d0a9a['name']){delete _0x5d0a9a[_0x9d95('0x20')];}_0x31e950[_0x9d95('0x13')](_0x5c8095)['send'](_0x5d0a9a);};}exports['index']=function(_0x2b1d01,_0x2f4684){var _0x41abf6={};var _0x43c94e=_['map'](db[_0x9d95('0x21')][_0x9d95('0x22')],function(_0x11a7b2){return{'name':_0x11a7b2[_0x9d95('0x23')],'type':_0x11a7b2[_0x9d95('0x24')][_0x9d95('0x25')]};});_0x41abf6=qs[_0x9d95('0x26')](_0x43c94e,_0x2b1d01);return interaction[_0x9d95('0x27')](_0x9d95('0x28'),_0x2b1d01[_0x9d95('0x29')],_0x2b1d01['user'],_0x41abf6,_0x43c94e)[_0x9d95('0x1b')](respondWithFilteredResult(_0x2f4684,_0x41abf6))[_0x9d95('0x2a')](handleError(_0x2f4684,null));};exports[_0x9d95('0x2b')]=function(_0x880530,_0x3510f9){var _0x1dc801={'raw':![],'where':{'id':_0x880530[_0x9d95('0x2c')]['id']}},_0x42e3b3={};_0x42e3b3[_0x9d95('0x2d')]=_[_0x9d95('0x2e')](db['WhatsappInteraction'][_0x9d95('0x22')]);_0x42e3b3[_0x9d95('0x29')]=_[_0x9d95('0x2e')](_0x880530[_0x9d95('0x29')]);_0x42e3b3[_0x9d95('0x2f')]=_['intersection'](_0x42e3b3[_0x9d95('0x2d')],_0x42e3b3[_0x9d95('0x29')]);_0x1dc801[_0x9d95('0x30')]=_[_0x9d95('0x31')](_0x42e3b3['model'],qs[_0x9d95('0x32')](_0x880530['query'][_0x9d95('0x32')]));_0x1dc801[_0x9d95('0x30')]=_0x1dc801[_0x9d95('0x30')]['length']?_0x1dc801[_0x9d95('0x30')]:_0x42e3b3['model'];if(_0x880530['query'][_0x9d95('0x33')]){_0x1dc801['include']=[{'all':!![]}];}_0x1dc801=_['merge']({},_0x1dc801,_0x880530[_0x9d95('0x34')]);return db['WhatsappInteraction']['find'](_0x1dc801)[_0x9d95('0x1b')](handleEntityNotFound(_0x3510f9,null))[_0x9d95('0x1b')](respondWithResult(_0x3510f9,null))[_0x9d95('0x2a')](handleError(_0x3510f9,null));};exports[_0x9d95('0x35')]=function(_0x5f461b,_0x38583f){return db[_0x9d95('0x21')][_0x9d95('0x35')](_0x5f461b[_0x9d95('0x36')],{})[_0x9d95('0x1b')](respondWithResult(_0x38583f,0xc9))[_0x9d95('0x2a')](handleError(_0x38583f,null));};exports[_0x9d95('0x37')]=function(_0x16406d,_0x955e6f){if(_0x16406d['body']['id']){delete _0x16406d['body']['id'];}return db[_0x9d95('0x21')][_0x9d95('0x38')]({'where':{'id':_0x16406d[_0x9d95('0x2c')]['id']}})['then'](handleEntityNotFound(_0x955e6f,null))[_0x9d95('0x1b')](saveUpdates(_0x16406d[_0x9d95('0x36')],null))[_0x9d95('0x1b')](respondWithResult(_0x955e6f,null))[_0x9d95('0x2a')](handleError(_0x955e6f,null));};exports['destroy']=function(_0x432005,_0x3fa74c){return db[_0x9d95('0x21')]['find']({'where':{'id':_0x432005[_0x9d95('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3fa74c,null))[_0x9d95('0x1b')](removeEntity(_0x3fa74c,null))[_0x9d95('0x2a')](handleError(_0x3fa74c,null));};exports['describe']=function(_0x563eb5,_0xc30875){return db['WhatsappInteraction'][_0x9d95('0x39')]()[_0x9d95('0x1b')](respondWithResult(_0xc30875,null))[_0x9d95('0x2a')](handleError(_0xc30875,null));};exports[_0x9d95('0x3a')]=function(_0x47ed55,_0x39dd27){return db['WhatsappMessage'][_0x9d95('0x38')]({'where':{'id':_0x47ed55[_0x9d95('0x2c')]['id']}})[_0x9d95('0x1b')](handleEntityNotFound(_0x39dd27,null))[_0x9d95('0x1b')](function(_0x582aa5){if(_0x582aa5){return _0x582aa5[_0x9d95('0x3a')](_0x47ed55[_0x9d95('0x36')][_0x9d95('0x3b')],_['omit'](_0x47ed55[_0x9d95('0x36')],[_0x9d95('0x3b'),'id'])||{});}})[_0x9d95('0x1b')](respondWithResult(_0x39dd27,null))[_0x9d95('0x2a')](handleError(_0x39dd27,null));};exports[_0x9d95('0x3c')]=function(_0x1c7a29,_0x168b61){var _0x1cd781={'raw':![],'where':{}};var _0x25f227={};var _0x477306={'count':0x0,'rows':[]};return db[_0x9d95('0x21')][_0x9d95('0x3d')]({'where':{'id':_0x1c7a29[_0x9d95('0x2c')]['id']}})[_0x9d95('0x1b')](handleEntityNotFound(_0x168b61,null))[_0x9d95('0x1b')](function(_0x1b55e4){if(_0x1b55e4){_0x25f227[_0x9d95('0x2d')]=_[_0x9d95('0x2e')](db[_0x9d95('0x3e')]['rawAttributes']);_0x25f227['query']=_[_0x9d95('0x2e')](_0x1c7a29[_0x9d95('0x29')]);_0x25f227[_0x9d95('0x2f')]=_[_0x9d95('0x31')](_0x25f227[_0x9d95('0x2d')],_0x25f227[_0x9d95('0x29')]);_0x1cd781[_0x9d95('0x30')]=_[_0x9d95('0x31')](_0x25f227['model'],qs['fields'](_0x1c7a29[_0x9d95('0x29')]['fields']));_0x1cd781[_0x9d95('0x30')]=_0x1cd781[_0x9d95('0x30')][_0x9d95('0x3f')]?_0x1cd781[_0x9d95('0x30')]:_0x25f227[_0x9d95('0x2d')];if(!_0x1c7a29['query'][_0x9d95('0x40')](_0x9d95('0x41'))){_0x1cd781[_0x9d95('0x16')]=qs['limit'](_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x16')]);_0x1cd781[_0x9d95('0x15')]=qs[_0x9d95('0x15')](_0x1c7a29[_0x9d95('0x29')]['offset']);}_0x1cd781[_0x9d95('0x42')]=qs['sort'](_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x43')]);_0x1cd781[_0x9d95('0x44')]=qs[_0x9d95('0x2f')](_[_0x9d95('0x45')](_0x1c7a29['query'],_0x25f227[_0x9d95('0x2f')]));_0x1cd781['where'][_0x9d95('0x46')]=_0x1b55e4['id'];if(_0x1c7a29['query'][_0x9d95('0x47')]){_0x1cd781[_0x9d95('0x44')]=_[_0x9d95('0x48')](_0x1cd781[_0x9d95('0x44')],{'$or':_[_0x9d95('0x49')](_0x1cd781[_0x9d95('0x30')],function(_0x346675){var _0x1ba6e5={};_0x1ba6e5[_0x346675]={'$like':'%'+_0x1c7a29['query']['filter']+'%'};return _0x1ba6e5;})});}if(_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x4a')]){var _0x5aa8b1=_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x4a')][_0x9d95('0x4b')](',');var _0x25b32a={};_0x25b32a[_0x5aa8b1[0x0]]={'$gte':moment(_0x5aa8b1[0x1])[_0x9d95('0x4c')](_0x9d95('0x4d'))};_0x1cd781[_0x9d95('0x44')]=_[_0x9d95('0x48')](_0x1cd781[_0x9d95('0x44')],_0x25b32a);}_0x1cd781=_['merge']({},_0x1cd781,_0x1c7a29[_0x9d95('0x34')]);return db[_0x9d95('0x3e')]['count']({'where':_0x1cd781[_0x9d95('0x44')]})[_0x9d95('0x1b')](function(_0x23559c){_0x477306[_0x9d95('0x18')]=_0x23559c;if(_0x1c7a29[_0x9d95('0x29')][_0x9d95('0x33')]){_0x1cd781[_0x9d95('0x4e')]=[{'all':!![]}];}return db[_0x9d95('0x3e')][_0x9d95('0x27')](_0x1cd781);})[_0x9d95('0x1b')](function(_0x2e5adf){_0x477306[_0x9d95('0x4f')]=_0x2e5adf;return _0x477306;});}})[_0x9d95('0x1b')](respondWithFilteredResult(_0x168b61,_0x1cd781))['catch'](handleError(_0x168b61,null));};exports[_0x9d95('0x50')]=function(_0x540458,_0x44f0cd){return db['WhatsappInteraction'][_0x9d95('0x38')]({'where':{'id':_0x540458[_0x9d95('0x2c')]['id']}})[_0x9d95('0x1b')](handleEntityNotFound(_0x44f0cd,null))[_0x9d95('0x1b')](function(_0x964dc2){if(_0x964dc2){return _0x964dc2['setTags'](_0x540458['body'][_0x9d95('0x3b')],_['omit'](_0x540458[_0x9d95('0x36')],[_0x9d95('0x3b'),'id'])||{})[_0x9d95('0x51')](function(){return db['Tag'][_0x9d95('0x27')]({'attributes':['id','name','color'],'where':{'id':_0x540458[_0x9d95('0x36')][_0x9d95('0x3b')]}});})[_0x9d95('0x1b')](function(_0x314ddb){socket[_0x9d95('0x52')](_0x9d95('0x53'),{'id':Number(_0x540458[_0x9d95('0x2c')]['id']),'tags':_0x314ddb||[]});return{'id':Number(_0x540458[_0x9d95('0x2c')]['id']),'tags':_0x314ddb||[]};});}})[_0x9d95('0x1b')](respondWithResult(_0x44f0cd,null))[_0x9d95('0x2a')](handleError(_0x44f0cd,null));};exports['removeTags']=function(_0x113690,_0x11a4c8){return db['WhatsappInteraction'][_0x9d95('0x38')]({'where':{'id':_0x113690[_0x9d95('0x2c')]['id']}})['then'](handleEntityNotFound(_0x11a4c8,null))[_0x9d95('0x1b')](function(_0x50dd25){if(_0x50dd25){return _0x50dd25[_0x9d95('0x54')](_0x113690[_0x9d95('0x29')]['ids']);}})['then'](respondWithStatusCode(_0x11a4c8,null))['catch'](handleError(_0x11a4c8,null));};exports[_0x9d95('0x55')]=function(_0x4f7263,_0x46fcc5){var _0x713b8d=moment()[_0x9d95('0x56')]()[_0x9d95('0x57')]();var _0x32de01=path[_0x9d95('0x58')](config[_0x9d95('0x59')],'server',_0x9d95('0x5a'),_0x9d95('0x5b'));var _0xde05c6=path['join'](config[_0x9d95('0x59')],_0x9d95('0x5c'),_0x9d95('0x5a'),_0x9d95('0x5d'));var _0x356057=path['join'](_0x32de01,_0x713b8d);var _0x257e73=util[_0x9d95('0x4c')](_0x9d95('0x5e'),_0x4f7263[_0x9d95('0x2c')]['id'],_0x713b8d);var _0x11cdd3=path[_0x9d95('0x58')](_0x32de01,_0x257e73);var _0x50b5a6=[];_0x50b5a6[_0x9d95('0x5f')]({'model':db[_0x9d95('0x60')],'as':_0x9d95('0x60'),'attributes':['id',_0x9d95('0x61')],'raw':!![]});_0x50b5a6[_0x9d95('0x5f')]({'model':db[_0x9d95('0x62')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x4f7263[_0x9d95('0x29')][_0x9d95('0x5d')]){_0x50b5a6[_0x9d95('0x5f')]({'model':db[_0x9d95('0x63')],'as':_0x9d95('0x63'),'raw':!![]});}var _0x489eb4=[{'model':db[_0x9d95('0x3e')],'as':'Messages','attributes':['id',_0x9d95('0x36'),_0x9d95('0x64'),_0x9d95('0x65'),_0x9d95('0x66'),_0x9d95('0x67')],'include':_0x50b5a6}];_0x489eb4['push']({'model':db[_0x9d95('0x68')],'as':_0x9d95('0x69'),'attributes':['id',_0x9d95('0x20')]});_0x489eb4[_0x9d95('0x5f')]({'model':db[_0x9d95('0x60')],'as':_0x9d95('0x6a'),'attributes':['id','fullname']});return db[_0x9d95('0x21')]['find']({'where':{'id':_0x4f7263[_0x9d95('0x2c')]['id']},'include':_0x489eb4})[_0x9d95('0x1b')](handleEntityNotFound(_0x46fcc5,null))[_0x9d95('0x1b')](function(_0x2e7ad6){if(_0x2e7ad6){var _0x21f35e=_0x2e7ad6[_0x9d95('0x6b')]({'plain':!![]});fs[_0x9d95('0x6c')](_0x356057);var _0x4b733e={'channel':_0x9d95('0x6d'),'account':_0x21f35e[_0x9d95('0x69')][_0x9d95('0x20')],'agent':_0x21f35e['Owner']?_0x21f35e[_0x9d95('0x6a')]['fullname']:_0x9d95('0x6e'),'createdAt':moment(_0x21f35e[_0x9d95('0x64')])['format'](_0x9d95('0x4d'))[_0x9d95('0x57')](),'closedAt':_0x21f35e[_0x9d95('0x6f')]?moment(_0x21f35e[_0x9d95('0x70')])[_0x9d95('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')[_0x9d95('0x57')]():'','disposition':_0x21f35e[_0x9d95('0x71')],'messages':_(_0x21f35e[_0x9d95('0x72')])[_0x9d95('0x47')]({'secret':![]})[_0x9d95('0x49')](function(_0x5403a6){if(_0x5403a6['Attachment']){var _0x49d20d=path[_0x9d95('0x58')](_0xde05c6,_0x5403a6['Attachment'][_0x9d95('0x73')]);if(fs[_0x9d95('0x74')](_0x49d20d)){fs[_0x9d95('0x75')](_0x49d20d)[_0x9d95('0x76')](fs[_0x9d95('0x77')](path[_0x9d95('0x58')](_0x356057,_0x5403a6[_0x9d95('0x63')][_0x9d95('0x73')])));}}return{'date':moment(_0x5403a6[_0x9d95('0x64')])[_0x9d95('0x4c')](_0x9d95('0x4d'))[_0x9d95('0x57')](),'sender':_0x5403a6['direction']===_0x9d95('0x78')?_0x5403a6[_0x9d95('0x60')]?_0x5403a6[_0x9d95('0x60')]['fullname']:_0x9d95('0x79'):_0x5403a6[_0x9d95('0x7a')][_0x9d95('0x7b')]+(_0x5403a6[_0x9d95('0x7a')][_0x9d95('0x7c')]?'\x20'+_0x5403a6[_0x9d95('0x7a')][_0x9d95('0x7c')]:''),'body':_0x5403a6[_0x9d95('0x63')]?_0x5403a6[_0x9d95('0x63')][_0x9d95('0x73')]:_0x5403a6['body'],'direction':_0x5403a6['direction']==='out'?'A':'C','secret':_0x5403a6['secret'],'read':_0x5403a6['read'],'attachment':_0x5403a6[_0x9d95('0x63')]};})['value']()};return ejs['renderFile'](path[_0x9d95('0x58')](config[_0x9d95('0x59')],'server','views',_0x9d95('0x7d')),{'interaction':_0x4b733e})['then'](function(_0x4d6f9d){var _0xc678a5=path[_0x9d95('0x58')](_0x356057,_0x9d95('0x7e')+_0x21f35e['id']+'-'+_0x713b8d+_0x9d95('0x7f'));var _0x27455a={'path':_0xc678a5,'channel':_0x9d95('0x6d'),'interactionId':_0x21f35e['id']};return pdf[_0x9d95('0x80')](_0x4d6f9d,_0x27455a);})[_0x9d95('0x1b')](function(){return new BPromise(function(_0x5ad68a,_0x40dc71){zipdir(_0x356057,{'saveTo':_0x11cdd3},function(_0x158613,_0x5156f9){if(_0x158613)return _0x40dc71(_0x158613);return _0x5ad68a(_0x5156f9);});})[_0x9d95('0x1b')](function(){return new BPromise(function(_0x55a5a7,_0x21473e){rimraf(_0x356057,function(_0x8da73e){if(_0x8da73e)_0x21473e(_0x8da73e);return _0x55a5a7();});});})[_0x9d95('0x1b')](function(){return _0x46fcc5[_0x9d95('0x55')](_0x11cdd3,_0x257e73,function(_0x4b72d7){if(_0x4b72d7){console[_0x9d95('0x81')](_0x9d95('0x82'),_0x4b72d7);}else{fs['unlinkSync'](_0x11cdd3);}});});});}else{return _0x46fcc5[_0x9d95('0x12')](0xc8);}})[_0x9d95('0x2a')](handleError(_0x46fcc5,null));};
\ No newline at end of file
+var _0xa724=['renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','unlinkSync','rimraf','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','destroy','then','stack','name','WhatsappInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','show','model','keys','intersection','fields','attributes','length','includeAll','include','options','find','catch','create','body','update','params','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','filters','hasOwnProperty','nolimit','order','sort','where','pick','WhatsappInteractionId','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','addTags','setTags','spread','color','whatsappInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','fullname','CmContact','Contact','lastName','Attachment','Messages','createdAt','secret','read','WhatsappAccount','Account','Owner','get','Whatsapp','toString','closed','closedAt','disposition','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','User','System','firstName','value'];(function(_0x5dbb84,_0x1bbce9){var _0x1d6eae=function(_0xd93967){while(--_0xd93967){_0x5dbb84['push'](_0x5dbb84['shift']());}};_0x1d6eae(++_0x1bbce9);}(_0xa724,0x185));var _0x4a72=function(_0xf164d9,_0x3799e6){_0xf164d9=_0xf164d9-0x0;var _0x367c3b=_0xa724[_0xf164d9];return _0x367c3b;};'use strict';var rimraf=require(_0x4a72('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x4a72('0x1'));var util=require('util');var path=require(_0x4a72('0x2'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4a72('0x3'));var Redis=require(_0x4a72('0x4'));var interaction=require(_0x4a72('0x5'));var qs=require(_0x4a72('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x4a72('0x7'))(_0x4a72('0x8'));var config=require(_0x4a72('0x9'));var db=require(_0x4a72('0xa'))['db'];config[_0x4a72('0xb')]=_['defaults'](config[_0x4a72('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a72('0xc'))(new Redis(config[_0x4a72('0xb')]));require(_0x4a72('0xd'))[_0x4a72('0xe')](socket);function respondWithStatusCode(_0x104cc2,_0xba5193){_0xba5193=_0xba5193||0xcc;return function(_0x4ad550){if(_0x4ad550){return _0x104cc2[_0x4a72('0xf')](_0xba5193);}return _0x104cc2[_0x4a72('0x10')](_0xba5193)[_0x4a72('0x11')]();};}function respondWithResult(_0x17c684,_0x3da21c){_0x3da21c=_0x3da21c||0xc8;return function(_0x4884f2){if(_0x4884f2){return _0x17c684[_0x4a72('0x10')](_0x3da21c)[_0x4a72('0x12')](_0x4884f2);}};}function respondWithFilteredResult(_0x5f0312,_0x354653){return function(_0x17af30){if(_0x17af30){var _0x11d135=typeof _0x354653[_0x4a72('0x13')]==='undefined'&&typeof _0x354653[_0x4a72('0x14')]===_0x4a72('0x15');var _0x5b24ca=_0x17af30[_0x4a72('0x16')];var _0x5148a5=_0x11d135?0x0:_0x354653[_0x4a72('0x13')];var _0x30541a=_0x11d135?_0x17af30[_0x4a72('0x16')]:_0x354653[_0x4a72('0x13')]+_0x354653['limit'];var _0x4b6866;if(_0x30541a>=_0x5b24ca){_0x30541a=_0x5b24ca;_0x4b6866=0xc8;}else{_0x4b6866=0xce;}_0x5f0312[_0x4a72('0x10')](_0x4b6866);return _0x5f0312['set'](_0x4a72('0x17'),_0x5148a5+'-'+_0x30541a+'/'+_0x5b24ca)[_0x4a72('0x12')](_0x17af30);}return null;};}function saveUpdates(_0x4f01da){return function(_0x8be444){if(_0x8be444){return _0x8be444['update'](_0x4f01da)['then'](function(_0x29b8a1){return _0x29b8a1;});}return null;};}function removeEntity(_0x133941){return function(_0x1b35bf){if(_0x1b35bf){return _0x1b35bf[_0x4a72('0x18')]()[_0x4a72('0x19')](function(){_0x133941[_0x4a72('0x10')](0xcc)[_0x4a72('0x11')]();});}};}function handleEntityNotFound(_0x5fe6a7){return function(_0x5d2f99){if(!_0x5d2f99){_0x5fe6a7[_0x4a72('0xf')](0x194);}return _0x5d2f99;};}function handleError(_0x504ee3,_0x4c1f8d){_0x4c1f8d=_0x4c1f8d||0x1f4;return function(_0x20b6a4){logger['error'](_0x20b6a4[_0x4a72('0x1a')]);if(_0x20b6a4[_0x4a72('0x1b')]){delete _0x20b6a4['name'];}_0x504ee3[_0x4a72('0x10')](_0x4c1f8d)['send'](_0x20b6a4);};}exports['index']=function(_0x5b1179,_0x1e61d5){var _0x5968c0={};var _0x3f0428=_['map'](db[_0x4a72('0x1c')][_0x4a72('0x1d')],function(_0x3a85c0){return{'name':_0x3a85c0[_0x4a72('0x1e')],'type':_0x3a85c0[_0x4a72('0x1f')][_0x4a72('0x20')]};});_0x5968c0=qs[_0x4a72('0x21')](_0x3f0428,_0x5b1179);return interaction[_0x4a72('0x22')](_0x4a72('0x23'),_0x5b1179[_0x4a72('0x24')],_0x5b1179['user'],_0x5968c0,_0x3f0428)[_0x4a72('0x19')](respondWithFilteredResult(_0x1e61d5,_0x5968c0))['catch'](handleError(_0x1e61d5,null));};exports[_0x4a72('0x25')]=function(_0xf00090,_0x251d56){var _0x1a452f={'raw':![],'where':{'id':_0xf00090['params']['id']}},_0x3d201e={};_0x3d201e[_0x4a72('0x26')]=_[_0x4a72('0x27')](db[_0x4a72('0x1c')][_0x4a72('0x1d')]);_0x3d201e[_0x4a72('0x24')]=_[_0x4a72('0x27')](_0xf00090['query']);_0x3d201e['filters']=_[_0x4a72('0x28')](_0x3d201e['model'],_0x3d201e['query']);_0x1a452f['attributes']=_[_0x4a72('0x28')](_0x3d201e[_0x4a72('0x26')],qs['fields'](_0xf00090[_0x4a72('0x24')][_0x4a72('0x29')]));_0x1a452f['attributes']=_0x1a452f[_0x4a72('0x2a')][_0x4a72('0x2b')]?_0x1a452f[_0x4a72('0x2a')]:_0x3d201e[_0x4a72('0x26')];if(_0xf00090['query'][_0x4a72('0x2c')]){_0x1a452f[_0x4a72('0x2d')]=[{'all':!![]}];}_0x1a452f=_['merge']({},_0x1a452f,_0xf00090[_0x4a72('0x2e')]);return db[_0x4a72('0x1c')][_0x4a72('0x2f')](_0x1a452f)[_0x4a72('0x19')](handleEntityNotFound(_0x251d56,null))[_0x4a72('0x19')](respondWithResult(_0x251d56,null))[_0x4a72('0x30')](handleError(_0x251d56,null));};exports['create']=function(_0xa70ec7,_0x5a98de){return db['WhatsappInteraction'][_0x4a72('0x31')](_0xa70ec7[_0x4a72('0x32')],{})['then'](respondWithResult(_0x5a98de,0xc9))['catch'](handleError(_0x5a98de,null));};exports[_0x4a72('0x33')]=function(_0x487c0d,_0x73338b){if(_0x487c0d[_0x4a72('0x32')]['id']){delete _0x487c0d[_0x4a72('0x32')]['id'];}return db[_0x4a72('0x1c')][_0x4a72('0x2f')]({'where':{'id':_0x487c0d[_0x4a72('0x34')]['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x73338b,null))[_0x4a72('0x19')](saveUpdates(_0x487c0d[_0x4a72('0x32')],null))[_0x4a72('0x19')](respondWithResult(_0x73338b,null))[_0x4a72('0x30')](handleError(_0x73338b,null));};exports[_0x4a72('0x18')]=function(_0x4491a9,_0x269064){return db['WhatsappInteraction'][_0x4a72('0x2f')]({'where':{'id':_0x4491a9[_0x4a72('0x34')]['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x269064,null))[_0x4a72('0x19')](removeEntity(_0x269064,null))[_0x4a72('0x30')](handleError(_0x269064,null));};exports[_0x4a72('0x35')]=function(_0x3ce4d2,_0x16e618){return db[_0x4a72('0x1c')][_0x4a72('0x35')]()['then'](respondWithResult(_0x16e618,null))[_0x4a72('0x30')](handleError(_0x16e618,null));};exports[_0x4a72('0x36')]=function(_0x52e7bb,_0x343263){return db[_0x4a72('0x37')]['find']({'where':{'id':_0x52e7bb['params']['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x343263,null))[_0x4a72('0x19')](function(_0x7d61c3){if(_0x7d61c3){return _0x7d61c3[_0x4a72('0x36')](_0x52e7bb['body'][_0x4a72('0x38')],_[_0x4a72('0x39')](_0x52e7bb[_0x4a72('0x32')],[_0x4a72('0x38'),'id'])||{});}})[_0x4a72('0x19')](respondWithResult(_0x343263,null))[_0x4a72('0x30')](handleError(_0x343263,null));};exports[_0x4a72('0x3a')]=function(_0x265586,_0x40c1a3){var _0x5e584c={'raw':![],'where':{}};var _0x475855={};var _0x292019={'count':0x0,'rows':[]};return db[_0x4a72('0x1c')][_0x4a72('0x3b')]({'where':{'id':_0x265586['params']['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x40c1a3,null))['then'](function(_0x346695){if(_0x346695){_0x475855[_0x4a72('0x26')]=_[_0x4a72('0x27')](db['WhatsappMessage'][_0x4a72('0x1d')]);_0x475855[_0x4a72('0x24')]=_[_0x4a72('0x27')](_0x265586[_0x4a72('0x24')]);_0x475855[_0x4a72('0x3c')]=_[_0x4a72('0x28')](_0x475855[_0x4a72('0x26')],_0x475855[_0x4a72('0x24')]);_0x5e584c[_0x4a72('0x2a')]=_['intersection'](_0x475855[_0x4a72('0x26')],qs[_0x4a72('0x29')](_0x265586[_0x4a72('0x24')]['fields']));_0x5e584c[_0x4a72('0x2a')]=_0x5e584c[_0x4a72('0x2a')][_0x4a72('0x2b')]?_0x5e584c[_0x4a72('0x2a')]:_0x475855['model'];if(!_0x265586[_0x4a72('0x24')][_0x4a72('0x3d')](_0x4a72('0x3e'))){_0x5e584c[_0x4a72('0x14')]=qs['limit'](_0x265586[_0x4a72('0x24')]['limit']);_0x5e584c[_0x4a72('0x13')]=qs[_0x4a72('0x13')](_0x265586[_0x4a72('0x24')][_0x4a72('0x13')]);}_0x5e584c[_0x4a72('0x3f')]=qs[_0x4a72('0x40')](_0x265586['query']['sort']);_0x5e584c[_0x4a72('0x41')]=qs['filters'](_[_0x4a72('0x42')](_0x265586[_0x4a72('0x24')],_0x475855[_0x4a72('0x3c')]));_0x5e584c[_0x4a72('0x41')][_0x4a72('0x43')]=_0x346695['id'];if(_0x265586[_0x4a72('0x24')][_0x4a72('0x44')]){_0x5e584c[_0x4a72('0x41')]=_['merge'](_0x5e584c['where'],{'$or':_[_0x4a72('0x45')](_0x5e584c[_0x4a72('0x2a')],function(_0x1811b7){var _0x3a12b9={};_0x3a12b9[_0x1811b7]={'$like':'%'+_0x265586[_0x4a72('0x24')][_0x4a72('0x44')]+'%'};return _0x3a12b9;})});}if(_0x265586[_0x4a72('0x24')][_0x4a72('0x46')]){var _0x2bc6a7=_0x265586[_0x4a72('0x24')]['$gte'][_0x4a72('0x47')](',');var _0x128db6={};_0x128db6[_0x2bc6a7[0x0]]={'$gte':moment(_0x2bc6a7[0x1])[_0x4a72('0x48')](_0x4a72('0x49'))};_0x5e584c[_0x4a72('0x41')]=_['merge'](_0x5e584c[_0x4a72('0x41')],_0x128db6);}_0x5e584c=_[_0x4a72('0x4a')]({},_0x5e584c,_0x265586[_0x4a72('0x2e')]);return db[_0x4a72('0x37')]['count']({'where':_0x5e584c[_0x4a72('0x41')]})[_0x4a72('0x19')](function(_0x5168ca){_0x292019[_0x4a72('0x16')]=_0x5168ca;if(_0x265586[_0x4a72('0x24')]['includeAll']){_0x5e584c[_0x4a72('0x2d')]=[{'all':!![]}];}return db['WhatsappMessage']['findAll'](_0x5e584c);})[_0x4a72('0x19')](function(_0x1d68c4){_0x292019['rows']=_0x1d68c4;return _0x292019;});}})[_0x4a72('0x19')](respondWithFilteredResult(_0x40c1a3,_0x5e584c))[_0x4a72('0x30')](handleError(_0x40c1a3,null));};exports[_0x4a72('0x4b')]=function(_0x2b2ed0,_0x27f818){return db['WhatsappInteraction'][_0x4a72('0x2f')]({'where':{'id':_0x2b2ed0[_0x4a72('0x34')]['id']}})[_0x4a72('0x19')](handleEntityNotFound(_0x27f818,null))[_0x4a72('0x19')](function(_0x2452e7){if(_0x2452e7){return _0x2452e7[_0x4a72('0x4c')](_0x2b2ed0[_0x4a72('0x32')][_0x4a72('0x38')],_['omit'](_0x2b2ed0[_0x4a72('0x32')],['ids','id'])||{})[_0x4a72('0x4d')](function(){return db['Tag'][_0x4a72('0x22')]({'attributes':['id',_0x4a72('0x1b'),_0x4a72('0x4e')],'where':{'id':_0x2b2ed0[_0x4a72('0x32')][_0x4a72('0x38')]}});})['then'](function(_0x844087){socket['emit'](_0x4a72('0x4f'),{'id':Number(_0x2b2ed0[_0x4a72('0x34')]['id']),'tags':_0x844087||[]});return{'id':Number(_0x2b2ed0[_0x4a72('0x34')]['id']),'tags':_0x844087||[]};});}})[_0x4a72('0x19')](respondWithResult(_0x27f818,null))[_0x4a72('0x30')](handleError(_0x27f818,null));};exports[_0x4a72('0x50')]=function(_0x460035,_0x37b75b){return db[_0x4a72('0x1c')][_0x4a72('0x2f')]({'where':{'id':_0x460035[_0x4a72('0x34')]['id']}})['then'](handleEntityNotFound(_0x37b75b,null))[_0x4a72('0x19')](function(_0x468323){if(_0x468323){return _0x468323[_0x4a72('0x50')](_0x460035[_0x4a72('0x24')][_0x4a72('0x38')]);}})[_0x4a72('0x19')](respondWithStatusCode(_0x37b75b,null))[_0x4a72('0x30')](handleError(_0x37b75b,null));};exports['download']=function(_0x27ccff,_0x3dba8d){var _0x2c56f0=moment()[_0x4a72('0x51')]()['toString']();var _0x1683be=path[_0x4a72('0x52')](config[_0x4a72('0x53')],'server',_0x4a72('0x54'),_0x4a72('0x55'));var _0x1031c3=path[_0x4a72('0x52')](config['root'],_0x4a72('0x56'),_0x4a72('0x54'),_0x4a72('0x57'));var _0x39c9d1=path['join'](_0x1683be,_0x2c56f0);var _0x192f2d=util[_0x4a72('0x48')](_0x4a72('0x58'),_0x27ccff[_0x4a72('0x34')]['id'],_0x2c56f0);var _0x138e9b=path[_0x4a72('0x52')](_0x1683be,_0x192f2d);var _0x45d06e=[];_0x45d06e[_0x4a72('0x59')]({'model':db['User'],'as':'User','attributes':['id',_0x4a72('0x5a')],'raw':!![]});_0x45d06e[_0x4a72('0x59')]({'model':db[_0x4a72('0x5b')],'as':_0x4a72('0x5c'),'attributes':['id','firstName',_0x4a72('0x5d')],'raw':!![]});if(_0x27ccff['query'][_0x4a72('0x57')]){_0x45d06e[_0x4a72('0x59')]({'model':db[_0x4a72('0x5e')],'as':_0x4a72('0x5e'),'raw':!![]});}var _0x3b4359=[{'model':db[_0x4a72('0x37')],'as':_0x4a72('0x5f'),'attributes':['id',_0x4a72('0x32'),_0x4a72('0x60'),'direction',_0x4a72('0x61'),_0x4a72('0x62')],'include':_0x45d06e}];_0x3b4359[_0x4a72('0x59')]({'model':db[_0x4a72('0x63')],'as':_0x4a72('0x64'),'attributes':['id',_0x4a72('0x1b')]});_0x3b4359[_0x4a72('0x59')]({'model':db['User'],'as':_0x4a72('0x65'),'attributes':['id',_0x4a72('0x5a')]});return db[_0x4a72('0x1c')]['find']({'where':{'id':_0x27ccff[_0x4a72('0x34')]['id']},'include':_0x3b4359})[_0x4a72('0x19')](handleEntityNotFound(_0x3dba8d,null))['then'](function(_0x370e79){if(_0x370e79){var _0x5b1493=_0x370e79[_0x4a72('0x66')]({'plain':!![]});fs['mkdirSync'](_0x39c9d1);var _0x3d52ae={'channel':_0x4a72('0x67'),'account':_0x5b1493[_0x4a72('0x64')][_0x4a72('0x1b')],'agent':_0x5b1493[_0x4a72('0x65')]?_0x5b1493['Owner']['fullname']:'N.A.','createdAt':moment(_0x5b1493[_0x4a72('0x60')])['format'](_0x4a72('0x49'))[_0x4a72('0x68')](),'closedAt':_0x5b1493[_0x4a72('0x69')]?moment(_0x5b1493[_0x4a72('0x6a')])['format'](_0x4a72('0x49'))['toString']():'','disposition':_0x5b1493[_0x4a72('0x6b')],'messages':_(_0x5b1493['Messages'])['filter']({'secret':![]})[_0x4a72('0x45')](function(_0x26dce2){if(_0x26dce2['Attachment']){var _0x126bae=path[_0x4a72('0x52')](_0x1031c3,_0x26dce2['Attachment'][_0x4a72('0x6c')]);if(fs[_0x4a72('0x6d')](_0x126bae)){fs[_0x4a72('0x6e')](_0x126bae)[_0x4a72('0x6f')](fs[_0x4a72('0x70')](path[_0x4a72('0x52')](_0x39c9d1,_0x26dce2[_0x4a72('0x5e')][_0x4a72('0x6c')])));}}return{'date':moment(_0x26dce2[_0x4a72('0x60')])[_0x4a72('0x48')](_0x4a72('0x49'))[_0x4a72('0x68')](),'sender':_0x26dce2[_0x4a72('0x71')]===_0x4a72('0x72')?_0x26dce2[_0x4a72('0x73')]?_0x26dce2[_0x4a72('0x73')][_0x4a72('0x5a')]:_0x4a72('0x74'):_0x26dce2[_0x4a72('0x5c')][_0x4a72('0x75')]+(_0x26dce2[_0x4a72('0x5c')][_0x4a72('0x5d')]?'\x20'+_0x26dce2[_0x4a72('0x5c')]['lastName']:''),'body':_0x26dce2[_0x4a72('0x5e')]?_0x26dce2[_0x4a72('0x5e')][_0x4a72('0x6c')]:_0x26dce2['body'],'direction':_0x26dce2[_0x4a72('0x71')]==='out'?'A':'C','secret':_0x26dce2[_0x4a72('0x61')],'read':_0x26dce2[_0x4a72('0x62')],'attachment':_0x26dce2[_0x4a72('0x5e')]};})[_0x4a72('0x76')]()};return ejs[_0x4a72('0x77')](path[_0x4a72('0x52')](config[_0x4a72('0x53')],'server',_0x4a72('0x78'),_0x4a72('0x79')),{'interaction':_0x3d52ae})[_0x4a72('0x19')](function(_0x29b4ee){var _0x4fc6e0=path[_0x4a72('0x52')](_0x39c9d1,'transcript-'+_0x5b1493['id']+'-'+_0x2c56f0+_0x4a72('0x7a'));var _0x1a1b8c={'path':_0x4fc6e0,'channel':_0x4a72('0x67'),'interactionId':_0x5b1493['id']};return pdf[_0x4a72('0x7b')](_0x29b4ee,_0x1a1b8c);})[_0x4a72('0x19')](function(){return new BPromise(function(_0x193ae7,_0x4ca87d){zipdir(_0x39c9d1,{'saveTo':_0x138e9b},function(_0x1ecf2f,_0x7a6e16){if(_0x1ecf2f)return _0x4ca87d(_0x1ecf2f);return _0x193ae7(_0x7a6e16);});})['then'](function(){return new BPromise(function(_0x254dd5,_0x47690a){rimraf(_0x39c9d1,function(_0x4c1885){if(_0x4c1885)_0x47690a(_0x4c1885);return _0x254dd5();});});})[_0x4a72('0x19')](function(){return _0x3dba8d[_0x4a72('0x7c')](_0x138e9b,_0x192f2d,function(_0xf4a8a8){if(_0xf4a8a8){console[_0x4a72('0x7d')]('err',_0xf4a8a8);}else{fs[_0x4a72('0x7e')](_0x138e9b);}});});});}else{return _0x3dba8d['sendStatus'](0xc8);}})[_0x4a72('0x30')](handleError(_0x3dba8d,null));};
\ No newline at end of file
index 6a4a2b3..c08dd0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90ae=['WhatsappMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','WhatsappInteraction'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0x90ae,0x195));var _0xe90a=function(_0x5d9d60,_0x163505){_0x5d9d60=_0x5d9d60-0x0;var _0x233cbd=_0x90ae[_0x5d9d60];return _0x233cbd;};'use strict';var EventEmitter=require(_0xe90a('0x0'));var WhatsappInteraction=require(_0xe90a('0x1'))['db'][_0xe90a('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xe90a('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe90a('0x4')](0x0);var events={'afterCreate':_0xe90a('0x5'),'afterUpdate':_0xe90a('0x6'),'afterDestroy':_0xe90a('0x7')};function emitEvent(_0x31d57b){return function(_0x32672a,_0x3062c0,_0x30cb7b){_0x32672a['getUsers']({'attributes':['id'],'raw':!![]})[_0xe90a('0x8')](function(_0x280721){_0x32672a[_0xe90a('0x9')](_0xe90a('0xa'),_0x280721[_0xe90a('0xb')](function(_0x2602fa){return{'id':_0x2602fa['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x32672a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe90a('0x8')](function(_0x241cef){_0x32672a[_0xe90a('0x9')](_0xe90a('0xc'),_0x241cef[_0xe90a('0xd')]);WhatsappInteractionEvents[_0xe90a('0xe')](_0x31d57b+':'+_0x32672a['id'],_0x32672a);WhatsappInteractionEvents[_0xe90a('0xe')](_0x31d57b,_0x32672a);_0x30cb7b(null);})['catch'](_0x30cb7b(null));};}for(var e in events){if(events[_0xe90a('0xf')](e)){var event=events[e];WhatsappInteraction[_0xe90a('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x453b=['../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x5e1b49,_0x49a243){var _0x119fd7=function(_0x197f1d){while(--_0x197f1d){_0x5e1b49['push'](_0x5e1b49['shift']());}};_0x119fd7(++_0x49a243);}(_0x453b,0x164));var _0xb453=function(_0x5cc3d4,_0xbcbf9b){_0x5cc3d4=_0x5cc3d4-0x0;var _0x17ca31=_0x453b[_0x5cc3d4];return _0x17ca31;};'use strict';var EventEmitter=require(_0xb453('0x0'));var WhatsappInteraction=require(_0xb453('0x1'))['db'][_0xb453('0x2')];var WhatsappMessage=require(_0xb453('0x1'))['db'][_0xb453('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xb453('0x4')](0x0);var events={'afterCreate':_0xb453('0x5'),'afterUpdate':_0xb453('0x6'),'afterDestroy':_0xb453('0x7')};function emitEvent(_0x1314f4){return function(_0x6ee7a0,_0x3cfd60,_0x434695){_0x6ee7a0[_0xb453('0x8')]({'attributes':['id'],'raw':!![]})[_0xb453('0x9')](function(_0x2436a7){_0x6ee7a0['setDataValue'](_0xb453('0xa'),_0x2436a7[_0xb453('0xb')](function(_0x55b2fa){return{'id':_0x55b2fa['id']};}));return WhatsappMessage[_0xb453('0xc')]({'where':{'WhatsappInteractionId':_0x6ee7a0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x894303){_0x6ee7a0[_0xb453('0xd')](_0xb453('0xe'),_0x894303[_0xb453('0xf')]);WhatsappInteractionEvents['emit'](_0x1314f4+':'+_0x6ee7a0['id'],_0x6ee7a0);WhatsappInteractionEvents[_0xb453('0x10')](_0x1314f4,_0x6ee7a0);_0x434695(null);})[_0xb453('0x11')](_0x434695(null));};}for(var e in events){if(events[_0xb453('0x12')](e)){var event=events[e];WhatsappInteraction[_0xb453('0x13')](e,emitEvent(event));}}module[_0xb453('0x14')]=WhatsappInteractionEvents;
\ No newline at end of file
index f66b9a6..66899ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4120=['moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x5c1243,_0x4b0890){var _0x4103cf=function(_0x6d46b6){while(--_0x6d46b6){_0x5c1243['push'](_0x5c1243['shift']());}};_0x4103cf(++_0x4b0890);}(_0x4120,0xcd));var _0x0412=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4120[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require(_0x0412('0x0'));var logger=require(_0x0412('0x1'))(_0x0412('0x2'));var moment=require(_0x0412('0x3'));var BPromise=require(_0x0412('0x4'));var rp=require(_0x0412('0x5'));var fs=require('fs');var path=require(_0x0412('0x6'));var rimraf=require(_0x0412('0x7'));var config=require(_0x0412('0x8'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x1a07a7,_0x458511){return _0x1a07a7['define'](_0x0412('0x9'),attributes,{'tableName':_0x0412('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x675df1,_0x2ae0f0,_0x2755a5){if(_0x675df1[_0x0412('0xb')](_0x0412('0xc'))){_0x675df1[_0x0412('0xd')]=moment()[_0x0412('0xe')](_0x0412('0xf'));}_0x2755a5(null,_0x675df1);}}});};
\ No newline at end of file
+var _0xde05=['WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x9cbfe0,_0x56aada){var _0x1f1534=function(_0x422947){while(--_0x422947){_0x9cbfe0['push'](_0x9cbfe0['shift']());}};_0x1f1534(++_0x56aada);}(_0xde05,0xf1));var _0x5de0=function(_0x146c5d,_0x1237ba){_0x146c5d=_0x146c5d-0x0;var _0x25c278=_0xde05[_0x146c5d];return _0x25c278;};'use strict';var _=require('lodash');var util=require(_0x5de0('0x0'));var logger=require(_0x5de0('0x1'))(_0x5de0('0x2'));var moment=require(_0x5de0('0x3'));var BPromise=require(_0x5de0('0x4'));var rp=require(_0x5de0('0x5'));var fs=require('fs');var path=require(_0x5de0('0x6'));var rimraf=require(_0x5de0('0x7'));var config=require(_0x5de0('0x8'));var attributes=require(_0x5de0('0x9'));module[_0x5de0('0xa')]=function(_0x27d7cf,_0x2b3da3){return _0x27d7cf['define'](_0x5de0('0xb'),attributes,{'tableName':_0x5de0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ec328,_0x15a815,_0x286129){if(_0x2ec328[_0x5de0('0xd')](_0x5de0('0xe'))){_0x2ec328[_0x5de0('0xf')]=moment()[_0x5de0('0x10')](_0x5de0('0x11'));}_0x286129(null,_0x2ec328);}}});};
\ No newline at end of file
index ac4610b..e9c1144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74d1=['find','ids','AddTags','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','WhatsappInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit','stringify','AddTagsToWhatsappInteraction'];(function(_0x17c48c,_0x2b3283){var _0x57c45c=function(_0x5a0a65){while(--_0x5a0a65){_0x17c48c['push'](_0x17c48c['shift']());}};_0x57c45c(++_0x2b3283);}(_0x74d1,0x106));var _0x174d=function(_0x2df6a4,_0x2c3d85){_0x2df6a4=_0x2df6a4-0x0;var _0x3ed5d5=_0x74d1[_0x2df6a4];return _0x3ed5d5;};'use strict';var _=require('lodash');var util=require(_0x174d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x174d('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x174d('0x2'))['db'];var utils=require(_0x174d('0x3'));var logger=require(_0x174d('0x4'))(_0x174d('0x5'));var config=require('../../config/environment');var jayson=require(_0x174d('0x6'));var client=jayson[_0x174d('0x7')]['http']({'port':0x232a});config[_0x174d('0x8')]=_['defaults'](config[_0x174d('0x8')],{'host':_0x174d('0x9'),'port':0x18eb});var socket=require(_0x174d('0xa'))(new Redis(config[_0x174d('0x8')]));require(_0x174d('0xb'))[_0x174d('0xc')](socket);function respondWithRpcPromise(_0x45a80d,_0x1a0b99,_0x21d073){return new BPromise(function(_0x50fdcd,_0x206ada){return client[_0x174d('0xd')](_0x45a80d,_0x21d073)[_0x174d('0xe')](function(_0xb1c4fc){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x1a0b99,'request\x20sent');logger[_0x174d('0xf')](_0x174d('0x10'),_0x1a0b99,_0x174d('0x11'),JSON['stringify'](_0xb1c4fc));if(_0xb1c4fc[_0x174d('0x12')]){if(_0xb1c4fc[_0x174d('0x12')]['code']===0x1f4){logger[_0x174d('0x12')](_0x174d('0x13'),_0x1a0b99,_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);return _0x206ada(_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);}logger['error'](_0x174d('0x13'),_0x1a0b99,_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);return _0x50fdcd(_0xb1c4fc[_0x174d('0x12')][_0x174d('0x14')]);}else{logger[_0x174d('0x15')](_0x174d('0x13'),_0x1a0b99,'request\x20sent');_0x50fdcd(_0xb1c4fc[_0x174d('0x16')][_0x174d('0x14')]);}})[_0x174d('0x17')](function(_0xbdec4a){logger['error'](_0x174d('0x13'),_0x1a0b99,_0xbdec4a);_0x206ada(_0xbdec4a);});});}exports[_0x174d('0x18')]=function(_0x16a2e9){var _0x35ccbf=this;return new Promise(function(_0x2b80a8,_0x2f5df7){return db[_0x174d('0x19')][_0x174d('0x1a')](_0x16a2e9[_0x174d('0x1b')],{'raw':_0x16a2e9[_0x174d('0x1c')]?_0x16a2e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a2e9['options']?_0x16a2e9[_0x174d('0x1c')][_0x174d('0x1d')]||null:null,'attributes':_0x16a2e9[_0x174d('0x1c')]?_0x16a2e9[_0x174d('0x1c')][_0x174d('0x1e')]||null:null,'limit':_0x16a2e9['options']?_0x16a2e9[_0x174d('0x1c')][_0x174d('0x1f')]||null:null})['then'](function(_0x3a9d2c){logger[_0x174d('0x15')](_0x174d('0x18'),_0x16a2e9);logger[_0x174d('0xf')](_0x174d('0x18'),_0x16a2e9,JSON[_0x174d('0x20')](_0x3a9d2c));_0x2b80a8(_0x3a9d2c);})[_0x174d('0x17')](function(_0x46b2fd){logger[_0x174d('0x12')](_0x174d('0x18'),_0x46b2fd[_0x174d('0x14')],_0x16a2e9);_0x2f5df7(_0x35ccbf[_0x174d('0x12')](0x1f4,_0x46b2fd[_0x174d('0x14')]));});});};exports[_0x174d('0x21')]=function(_0x2ea8ab){return new Promise(function(_0x3d3c89,_0x59b992){return db['WhatsappInteraction'][_0x174d('0x22')]({'where':_0x2ea8ab[_0x174d('0x1c')]?_0x2ea8ab['options'][_0x174d('0x1d')]||null:null})['then'](function(_0x238322){if(_0x238322){return _0x238322['addTags'](_0x2ea8ab[_0x174d('0x1b')][_0x174d('0x23')],_['omit'](_0x2ea8ab[_0x174d('0x1b')],['ids','id'])||{});}})['spread'](function(_0x123d60){logger['info'](_0x174d('0x24'),_0x2ea8ab);logger[_0x174d('0xf')](_0x174d('0x24'),_0x2ea8ab,JSON[_0x174d('0x20')](_0x123d60));_0x3d3c89(_0x123d60);})[_0x174d('0x17')](function(_0x57fecf){logger[_0x174d('0x12')](_0x174d('0x24'),_0x57fecf[_0x174d('0x14')],_0x2ea8ab);_0x59b992(_this['error'](0x1f4,_0x57fecf[_0x174d('0x14')]));});});};
\ No newline at end of file
+var _0xe962=['client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','then','catch','AddTagsToWhatsappInteraction','find','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe962,0x154));var _0x2e96=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe962[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2e96('0x0'));var util=require(_0x2e96('0x1'));var moment=require(_0x2e96('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e96('0x3'));var fs=require('fs');var Redis=require(_0x2e96('0x4'));var db=require(_0x2e96('0x5'))['db'];var utils=require(_0x2e96('0x6'));var logger=require(_0x2e96('0x7'))(_0x2e96('0x8'));var config=require(_0x2e96('0x9'));var jayson=require(_0x2e96('0xa'));var client=jayson[_0x2e96('0xb')][_0x2e96('0xc')]({'port':0x232a});config[_0x2e96('0xd')]=_[_0x2e96('0xe')](config[_0x2e96('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e96('0xf'))(new Redis(config[_0x2e96('0xd')]));require(_0x2e96('0x10'))['register'](socket);function respondWithRpcPromise(_0x37a186,_0x495e4c,_0x15cde9){return new BPromise(function(_0x59a221,_0x5acce3){return client[_0x2e96('0x11')](_0x37a186,_0x15cde9)['then'](function(_0x1034ff){logger['info'](_0x2e96('0x12'),_0x495e4c,_0x2e96('0x13'));logger[_0x2e96('0x14')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x495e4c,_0x2e96('0x13'),JSON[_0x2e96('0x15')](_0x1034ff));if(_0x1034ff['error']){if(_0x1034ff[_0x2e96('0x16')][_0x2e96('0x17')]===0x1f4){logger[_0x2e96('0x16')](_0x2e96('0x12'),_0x495e4c,_0x1034ff[_0x2e96('0x16')]['message']);return _0x5acce3(_0x1034ff[_0x2e96('0x16')][_0x2e96('0x18')]);}logger[_0x2e96('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x495e4c,_0x1034ff['error'][_0x2e96('0x18')]);return _0x59a221(_0x1034ff[_0x2e96('0x16')]['message']);}else{logger[_0x2e96('0x19')](_0x2e96('0x12'),_0x495e4c,_0x2e96('0x13'));_0x59a221(_0x1034ff['result']['message']);}})['catch'](function(_0x2b483a){logger['error'](_0x2e96('0x12'),_0x495e4c,_0x2b483a);_0x5acce3(_0x2b483a);});});}exports[_0x2e96('0x1a')]=function(_0x11234f){var _0x483543=this;return new Promise(function(_0x5f380c,_0x4634bf){return db[_0x2e96('0x1b')][_0x2e96('0x1c')](_0x11234f[_0x2e96('0x1d')],{'raw':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')][_0x2e96('0x1f')]||null:null,'attributes':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')]['attributes']||null:null,'limit':_0x11234f[_0x2e96('0x1e')]?_0x11234f[_0x2e96('0x1e')]['limit']||null:null})[_0x2e96('0x20')](function(_0x1b784e){logger[_0x2e96('0x19')](_0x2e96('0x1a'),_0x11234f);logger[_0x2e96('0x14')](_0x2e96('0x1a'),_0x11234f,JSON[_0x2e96('0x15')](_0x1b784e));_0x5f380c(_0x1b784e);})[_0x2e96('0x21')](function(_0xec661a){logger[_0x2e96('0x16')](_0x2e96('0x1a'),_0xec661a[_0x2e96('0x18')],_0x11234f);_0x4634bf(_0x483543[_0x2e96('0x16')](0x1f4,_0xec661a[_0x2e96('0x18')]));});});};exports[_0x2e96('0x22')]=function(_0x238fa3){return new Promise(function(_0x52fb28,_0x53f82b){return db[_0x2e96('0x1b')][_0x2e96('0x23')]({'where':_0x238fa3[_0x2e96('0x1e')]?_0x238fa3[_0x2e96('0x1e')][_0x2e96('0x1f')]||null:null})[_0x2e96('0x20')](function(_0x513be8){if(_0x513be8){return _0x513be8['addTags'](_0x238fa3[_0x2e96('0x1d')]['ids'],_[_0x2e96('0x24')](_0x238fa3[_0x2e96('0x1d')],['ids','id'])||{});}})[_0x2e96('0x25')](function(_0x585cda){logger[_0x2e96('0x19')]('AddTags',_0x238fa3);logger['debug'](_0x2e96('0x26'),_0x238fa3,JSON['stringify'](_0x585cda));_0x52fb28(_0x585cda);})[_0x2e96('0x21')](function(_0x466059){logger[_0x2e96('0x16')](_0x2e96('0x26'),_0x466059['message'],_0x238fa3);_0x53f82b(_this[_0x2e96('0x16')](0x1f4,_0x466059[_0x2e96('0x18')]));});});};
\ No newline at end of file
index b61db7d..079d012 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5801=['./whatsappInteraction.events','save','update','emit','removeListener','length','whatsappInteraction:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5801,0xd2));var _0x1580=function(_0x5a1c24,_0x54d7c1){_0x5a1c24=_0x5a1c24-0x0;var _0x1fa24d=_0x5801[_0x5a1c24];return _0x1fa24d;};'use strict';var WhatsappInteractionEvents=require(_0x1580('0x0'));var events=[_0x1580('0x1'),'remove',_0x1580('0x2')];function createListener(_0x3b7124,_0x20cc1b){return function(_0x3b2131){_0x20cc1b[_0x1580('0x3')](_0x3b7124,_0x3b2131);};}function removeListener(_0x524949,_0x4b7ac0){return function(){WhatsappInteractionEvents[_0x1580('0x4')](_0x524949,_0x4b7ac0);};}exports['register']=function(_0x1548cf){for(var _0x20b393=0x0,_0x482c67=events[_0x1580('0x5')];_0x20b393<_0x482c67;_0x20b393++){var _0x50ebfd=events[_0x20b393];var _0x5446ed=createListener(_0x1580('0x6')+_0x50ebfd,_0x1548cf);WhatsappInteractionEvents['on'](_0x50ebfd,_0x5446ed);}};
\ No newline at end of file
+var _0xc39e=['removeListener','register','length','./whatsappInteraction.events','save','remove','update'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xc39e,0x65));var _0xec39=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xc39e[_0x1147ab];return _0x55cb5a;};'use strict';var WhatsappInteractionEvents=require(_0xec39('0x0'));var events=[_0xec39('0x1'),_0xec39('0x2'),_0xec39('0x3')];function createListener(_0x37842e,_0xb691e5){return function(_0x2bc1f5){_0xb691e5['emit'](_0x37842e,_0x2bc1f5);};}function removeListener(_0x27e9e0,_0x2d1c1c){return function(){WhatsappInteractionEvents[_0xec39('0x4')](_0x27e9e0,_0x2d1c1c);};}exports[_0xec39('0x5')]=function(_0x504b38){for(var _0x1bada1=0x0,_0x2c687f=events[_0xec39('0x6')];_0x1bada1<_0x2c687f;_0x1bada1++){var _0x3bafc8=events[_0x1bada1];var _0x1eef0c=createListener('whatsappInteraction:'+_0x3bafc8,_0x504b38);WhatsappInteractionEvents['on'](_0x3bafc8,_0x1eef0c);}};
\ No newline at end of file
index f70fd6a..08346e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd544=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','/:id','isAuthenticated','post','tracked','whatsapp','create','/:id/status','status','put','update','accept','/:id/reject','reject','delete','exports','multer'];(function(_0x40def8,_0x2770c4){var _0x5af0ff=function(_0x132f7c){while(--_0x132f7c){_0x40def8['push'](_0x40def8['shift']());}};_0x5af0ff(++_0x2770c4);}(_0xd544,0x81));var _0x4d54=function(_0x526ba1,_0x199484){_0x526ba1=_0x526ba1-0x0;var _0x1b56cb=_0xd544[_0x526ba1];return _0x1b56cb;};'use strict';var multer=require(_0x4d54('0x0'));var util=require(_0x4d54('0x1'));var path=require(_0x4d54('0x2'));var timeout=require(_0x4d54('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4d54('0x4'));var auth=require(_0x4d54('0x5'));var interaction=require(_0x4d54('0x6'));var config=require(_0x4d54('0x7'));var controller=require('./whatsappMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4d54('0x8')]);router[_0x4d54('0x9')](_0x4d54('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x4d54('0x9')](_0x4d54('0xb'),auth[_0x4d54('0xc')](),controller['show']);router[_0x4d54('0xd')]('/',auth[_0x4d54('0xc')](),interaction[_0x4d54('0xe')](_0x4d54('0xf'),'whatsappmessage:create'),controller[_0x4d54('0x10')]);router[_0x4d54('0xd')](_0x4d54('0x11'),controller[_0x4d54('0x12')]);router[_0x4d54('0x13')](_0x4d54('0xb'),auth['isAuthenticated'](),controller[_0x4d54('0x14')]);router[_0x4d54('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0x4d54('0x15')]);router['put'](_0x4d54('0x16'),auth[_0x4d54('0xc')](),controller[_0x4d54('0x17')]);router[_0x4d54('0x18')](_0x4d54('0xb'),auth[_0x4d54('0xc')](),controller['destroy']);module[_0x4d54('0x19')]=router;
\ No newline at end of file
+var _0x4017=['isAuthenticated','get','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','/describe'];(function(_0x3b7b8a,_0x52c3b0){var _0x441206=function(_0x5d34d3){while(--_0x5d34d3){_0x3b7b8a['push'](_0x3b7b8a['shift']());}};_0x441206(++_0x52c3b0);}(_0x4017,0xde));var _0x7401=function(_0x346490,_0xaf0e1b){_0x346490=_0x346490-0x0;var _0x1c47ef=_0x4017[_0x346490];return _0x1c47ef;};'use strict';var multer=require(_0x7401('0x0'));var util=require('util');var path=require(_0x7401('0x1'));var timeout=require(_0x7401('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7401('0x3'));var auth=require(_0x7401('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7401('0x5'));var controller=require(_0x7401('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7401('0x7'),auth[_0x7401('0x8')](),controller['describe']);router[_0x7401('0x9')](_0x7401('0xa'),auth[_0x7401('0x8')](),controller[_0x7401('0xb')]);router[_0x7401('0xc')]('/',auth[_0x7401('0x8')](),interaction[_0x7401('0xd')](_0x7401('0xe'),_0x7401('0xf')),controller['create']);router[_0x7401('0xc')](_0x7401('0x10'),controller[_0x7401('0x11')]);router[_0x7401('0x12')](_0x7401('0xa'),auth[_0x7401('0x8')](),controller['update']);router[_0x7401('0x12')](_0x7401('0x13'),auth[_0x7401('0x8')](),controller[_0x7401('0x14')]);router[_0x7401('0x12')](_0x7401('0x15'),auth[_0x7401('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x7401('0x8')](),controller['destroy']);module[_0x7401('0x16')]=router;
\ No newline at end of file
index 896faf9..df56818 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1928=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1928,0x138));var _0x8192=function(_0x5c0024,_0x1e6fed){_0x5c0024=_0x5c0024-0x0;var _0x4b74a1=_0x1928[_0x5c0024];return _0x4b74a1;};'use strict';var Sequelize=require(_0x8192('0x0'));module[_0x8192('0x1')]={'body':{'type':Sequelize[_0x8192('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x8192('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8192('0x4')]('in',_0x8192('0x5')),'defaultValue':_0x8192('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8192('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8192('0x6')]},'readAt':{'type':Sequelize[_0x8192('0x7')]},'secret':{'type':Sequelize[_0x8192('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8192('0x6')]},'providerResponse':{'type':Sequelize[_0x8192('0x2')]}};
\ No newline at end of file
+var _0x4939=['BOOLEAN','TEXT','sequelize','exports','medium','ENUM','out','STRING','DATE'];(function(_0x11b124,_0x1a9c63){var _0x1c9406=function(_0x5e89cc){while(--_0x5e89cc){_0x11b124['push'](_0x11b124['shift']());}};_0x1c9406(++_0x1a9c63);}(_0x4939,0x1a9));var _0x9493=function(_0x71961,_0x5d7d59){_0x71961=_0x71961-0x0;var _0x5b591e=_0x4939[_0x71961];return _0x5b591e;};'use strict';var Sequelize=require(_0x9493('0x0'));module[_0x9493('0x1')]={'body':{'type':Sequelize['TEXT'](_0x9493('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9493('0x3')]('in',_0x9493('0x4')),'defaultValue':_0x9493('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9493('0x5')](0xbe)},'phone':{'type':Sequelize[_0x9493('0x5')]},'readAt':{'type':Sequelize[_0x9493('0x6')]},'secret':{'type':Sequelize[_0x9493('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9493('0x5')]},'providerResponse':{'type':Sequelize[_0x9493('0x8')]}};
\ No newline at end of file
index 5ae8bec..16b8dce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x823b=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','name','WhatsappMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','params','destroy','describe','accept','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp-interactions','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','email','internal','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','WhatsappMessage,\x20%s,\x20%s','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','status'];(function(_0x3081a4,_0x566599){var _0x28070f=function(_0x40fd62){while(--_0x40fd62){_0x3081a4['push'](_0x3081a4['shift']());}};_0x28070f(++_0x566599);}(_0x823b,0x17d));var _0xb823=function(_0x58366d,_0x38ad8c){_0x58366d=_0x58366d-0x0;var _0x14bb8e=_0x823b[_0x58366d];return _0x14bb8e;};'use strict';var emlformat=require(_0xb823('0x0'));var rimraf=require(_0xb823('0x1'));var zipdir=require(_0xb823('0x2'));var jsonpatch=require(_0xb823('0x3'));var rp=require(_0xb823('0x4'));var moment=require(_0xb823('0x5'));var BPromise=require(_0xb823('0x6'));var Mustache=require(_0xb823('0x7'));var util=require(_0xb823('0x8'));var path=require(_0xb823('0x9'));var sox=require(_0xb823('0xa'));var csv=require('to-csv');var ejs=require(_0xb823('0xb'));var fs=require('fs');var fs_extra=require(_0xb823('0xc'));var _=require(_0xb823('0xd'));var squel=require('squel');var crypto=require(_0xb823('0xe'));var jsforce=require(_0xb823('0xf'));var deskjs=require(_0xb823('0x10'));var toCsv=require(_0xb823('0x11'));var querystring=require(_0xb823('0x12'));var Papa=require(_0xb823('0x13'));var Redis=require(_0xb823('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xb823('0x15'));var as=require(_0xb823('0x16'));var hardwareService=require(_0xb823('0x17'));var logger=require(_0xb823('0x18'))(_0xb823('0x19'));var utils=require(_0xb823('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0xb823('0x1b'));var db=require(_0xb823('0x1c'))['db'];config[_0xb823('0x1d')]=_[_0xb823('0x1e')](config['redis'],{'host':_0xb823('0x1f'),'port':0x18eb});var socket=require(_0xb823('0x20'))(new Redis(config[_0xb823('0x1d')]));require('./whatsappMessage.socket')[_0xb823('0x21')](socket);var jayson=require(_0xb823('0x22'));var client=jayson[_0xb823('0x23')][_0xb823('0x24')]({'port':0x232c});var client9002=jayson['client'][_0xb823('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x406349,_0x2a1c8a,_0x295847,_0x56153a){return new BPromise(function(_0x418e2d,_0x2f7a2a){var _0x557b8d=_0x56153a||client;return _0x557b8d[_0xb823('0x25')](_0x406349,_0x295847)['then'](function(_0x485b6c){logger['info'](_0xb823('0x26'),_0x2a1c8a,'request\x20sent');logger['debug'](_0xb823('0x27'),_0x2a1c8a,_0xb823('0x28'),JSON[_0xb823('0x29')](_0x485b6c));if(_0x485b6c[_0xb823('0x2a')]){if(_0x485b6c['error']['code']===0x1f4){logger[_0xb823('0x2a')](_0xb823('0x26'),_0x2a1c8a,_0x485b6c[_0xb823('0x2a')][_0xb823('0x2b')]);return _0x2f7a2a(_0x485b6c[_0xb823('0x2a')]['message']);}logger[_0xb823('0x2a')](_0xb823('0x26'),_0x2a1c8a,_0x485b6c[_0xb823('0x2a')][_0xb823('0x2b')]);return _0x418e2d(_0x485b6c[_0xb823('0x2a')][_0xb823('0x2b')]);}else{logger[_0xb823('0x2c')](_0xb823('0x26'),_0x2a1c8a,_0xb823('0x28'));_0x418e2d(_0x485b6c[_0xb823('0x2d')][_0xb823('0x2b')]);}})[_0xb823('0x2e')](function(_0x375c0f){logger['error'](_0xb823('0x26'),_0x2a1c8a,_0x375c0f);_0x2f7a2a(_0x375c0f);});});}function respondWithStatusCode(_0x103dec,_0x43fcdb){_0x43fcdb=_0x43fcdb||0xcc;return function(_0x257fe8){if(_0x257fe8){return _0x103dec['sendStatus'](_0x43fcdb);}return _0x103dec[_0xb823('0x2f')](_0x43fcdb)['end']();};}function respondWithResult(_0x39ed04,_0x39ac04){_0x39ac04=_0x39ac04||0xc8;return function(_0x30c089){if(_0x30c089){return _0x39ed04[_0xb823('0x2f')](_0x39ac04)[_0xb823('0x30')](_0x30c089);}};}function respondWithFilteredResult(_0x5d52cc,_0x1a7e46){return function(_0x391ce2){if(_0x391ce2){var _0x3bcde2=typeof _0x1a7e46[_0xb823('0x31')]===_0xb823('0x32')&&typeof _0x1a7e46[_0xb823('0x33')]==='undefined';var _0x3ee686=_0x391ce2[_0xb823('0x34')];var _0x17c9d1=_0x3bcde2?0x0:_0x1a7e46[_0xb823('0x31')];var _0x1b1297=_0x3bcde2?_0x391ce2[_0xb823('0x34')]:_0x1a7e46[_0xb823('0x31')]+_0x1a7e46[_0xb823('0x33')];var _0x586f2c;if(_0x1b1297>=_0x3ee686){_0x1b1297=_0x3ee686;_0x586f2c=0xc8;}else{_0x586f2c=0xce;}_0x5d52cc[_0xb823('0x2f')](_0x586f2c);return _0x5d52cc[_0xb823('0x35')](_0xb823('0x36'),_0x17c9d1+'-'+_0x1b1297+'/'+_0x3ee686)[_0xb823('0x30')](_0x391ce2);}return null;};}function patchUpdates(_0x28ddce){return function(_0x2c11f4){try{jsonpatch[_0xb823('0x37')](_0x2c11f4,_0x28ddce,!![]);}catch(_0x587a14){return BPromise[_0xb823('0x38')](_0x587a14);}return _0x2c11f4[_0xb823('0x39')]();};}function saveUpdates(_0x12dd80,_0x5c2e40){return function(_0x1dc79b){if(_0x1dc79b){return _0x1dc79b[_0xb823('0x3a')](_0x12dd80)[_0xb823('0x3b')](function(_0x30f41c){return _0x30f41c;});}return null;};}function removeEntity(_0x545301,_0x5bc38f){return function(_0x31e6c0){if(_0x31e6c0){return _0x31e6c0['destroy']()[_0xb823('0x3b')](function(){_0x545301[_0xb823('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494bf5,_0x58bb7b){return function(_0x1f3ed4){if(!_0x1f3ed4){_0x494bf5[_0xb823('0x3c')](0x194);}return _0x1f3ed4;};}function handleError(_0x54b416,_0xc60e23){_0xc60e23=_0xc60e23||0x1f4;return function(_0x1f2a4e){logger[_0xb823('0x2a')](_0x1f2a4e['stack']);if(_0x1f2a4e[_0xb823('0x3d')]){delete _0x1f2a4e[_0xb823('0x3d')];}_0x54b416[_0xb823('0x2f')](_0xc60e23)['send'](_0x1f2a4e);};}exports['index']=function(_0x3e266e,_0x799f69){var _0x1e5e20={},_0x2432f7={},_0x4cc1ab={'count':0x0,'rows':[]};var _0x4f9707=_['map'](db[_0xb823('0x3e')][_0xb823('0x3f')],function(_0x39a67a){return{'name':_0x39a67a[_0xb823('0x40')],'type':_0x39a67a['type'][_0xb823('0x41')]};});_0x2432f7[_0xb823('0x42')]=_['map'](_0x4f9707,_0xb823('0x3d'));_0x2432f7[_0xb823('0x43')]=_[_0xb823('0x44')](_0x3e266e['query']);_0x2432f7[_0xb823('0x45')]=_[_0xb823('0x46')](_0x2432f7['model'],_0x2432f7[_0xb823('0x43')]);_0x1e5e20['attributes']=_[_0xb823('0x46')](_0x2432f7[_0xb823('0x42')],qs[_0xb823('0x47')](_0x3e266e[_0xb823('0x43')][_0xb823('0x47')]));_0x1e5e20[_0xb823('0x48')]=_0x1e5e20['attributes'][_0xb823('0x49')]?_0x1e5e20['attributes']:_0x2432f7[_0xb823('0x42')];if(!_0x3e266e[_0xb823('0x43')][_0xb823('0x4a')](_0xb823('0x4b'))){_0x1e5e20[_0xb823('0x33')]=qs['limit'](_0x3e266e[_0xb823('0x43')][_0xb823('0x33')]);_0x1e5e20[_0xb823('0x31')]=qs['offset'](_0x3e266e[_0xb823('0x43')][_0xb823('0x31')]);}_0x1e5e20[_0xb823('0x4c')]=qs['sort'](_0x3e266e[_0xb823('0x43')][_0xb823('0x4d')]);_0x1e5e20['where']=qs[_0xb823('0x45')](_[_0xb823('0x4e')](_0x3e266e[_0xb823('0x43')],_0x2432f7['filters']),_0x4f9707);if(_0x3e266e[_0xb823('0x43')][_0xb823('0x4f')]){_0x1e5e20['where']=_[_0xb823('0x50')](_0x1e5e20['where'],{'$or':_[_0xb823('0x51')](_0x4f9707,function(_0x36d5d6){if(_0x36d5d6[_0xb823('0x52')]!==_0xb823('0x53')){var _0x451172={};_0x451172[_0x36d5d6[_0xb823('0x3d')]]={'$like':'%'+_0x3e266e['query'][_0xb823('0x4f')]+'%'};return _0x451172;}})});}_0x1e5e20=_[_0xb823('0x50')]({},_0x1e5e20,_0x3e266e[_0xb823('0x54')]);var _0x39fcba={'where':_0x1e5e20['where']};return db[_0xb823('0x3e')][_0xb823('0x34')](_0x39fcba)['then'](function(_0x5cee3a){_0x4cc1ab[_0xb823('0x34')]=_0x5cee3a;if(_0x3e266e[_0xb823('0x43')][_0xb823('0x55')]){_0x1e5e20[_0xb823('0x56')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb823('0x57')](_0x1e5e20);})['then'](function(_0x26a2dd){_0x4cc1ab[_0xb823('0x58')]=_0x26a2dd;return _0x4cc1ab;})[_0xb823('0x3b')](respondWithFilteredResult(_0x799f69,_0x1e5e20))[_0xb823('0x2e')](handleError(_0x799f69,null));};exports['show']=function(_0x5149de,_0x39dd84){var _0x4bc885={'raw':!![],'where':{'id':_0x5149de['params']['id']}},_0x2a710a={};_0x2a710a[_0xb823('0x42')]=_[_0xb823('0x44')](db[_0xb823('0x3e')][_0xb823('0x3f')]);_0x2a710a[_0xb823('0x43')]=_[_0xb823('0x44')](_0x5149de[_0xb823('0x43')]);_0x2a710a['filters']=_[_0xb823('0x46')](_0x2a710a[_0xb823('0x42')],_0x2a710a[_0xb823('0x43')]);_0x4bc885[_0xb823('0x48')]=_['intersection'](_0x2a710a[_0xb823('0x42')],qs[_0xb823('0x47')](_0x5149de[_0xb823('0x43')][_0xb823('0x47')]));_0x4bc885[_0xb823('0x48')]=_0x4bc885[_0xb823('0x48')][_0xb823('0x49')]?_0x4bc885[_0xb823('0x48')]:_0x2a710a[_0xb823('0x42')];if(_0x5149de[_0xb823('0x43')][_0xb823('0x55')]){_0x4bc885[_0xb823('0x56')]=[{'all':!![]}];}_0x4bc885=_[_0xb823('0x50')]({},_0x4bc885,_0x5149de[_0xb823('0x54')]);return db['WhatsappMessage'][_0xb823('0x59')](_0x4bc885)[_0xb823('0x3b')](handleEntityNotFound(_0x39dd84,null))['then'](respondWithResult(_0x39dd84,null))['catch'](handleError(_0x39dd84,null));};exports['create']=function(_0xae011c,_0x48f874){return db[_0xb823('0x3e')][_0xb823('0x5a')](_0xae011c[_0xb823('0x5b')],{})[_0xb823('0x3b')](respondWithResult(_0x48f874,0xc9))['catch'](handleError(_0x48f874,null));};exports[_0xb823('0x3a')]=function(_0x404a3a,_0x53301e){if(_0x404a3a[_0xb823('0x5b')]['id']){delete _0x404a3a[_0xb823('0x5b')]['id'];}return db[_0xb823('0x3e')]['find']({'where':{'id':_0x404a3a[_0xb823('0x5c')]['id']}})[_0xb823('0x3b')](handleEntityNotFound(_0x53301e,null))[_0xb823('0x3b')](saveUpdates(_0x404a3a['body'],null))[_0xb823('0x3b')](respondWithResult(_0x53301e,null))[_0xb823('0x2e')](handleError(_0x53301e,null));};exports[_0xb823('0x5d')]=function(_0x570309,_0x162461){return db[_0xb823('0x3e')]['find']({'where':{'id':_0x570309[_0xb823('0x5c')]['id']}})[_0xb823('0x3b')](handleEntityNotFound(_0x162461,null))[_0xb823('0x3b')](removeEntity(_0x162461,null))['catch'](handleError(_0x162461,null));};exports[_0xb823('0x5e')]=function(_0x2ffc3b,_0x2ac0ff){return db[_0xb823('0x3e')]['describe']()['then'](respondWithResult(_0x2ac0ff,null))[_0xb823('0x2e')](handleError(_0x2ac0ff,null));};var interaction_log=require(_0xb823('0x18'))('whatsapp-interactions');exports[_0xb823('0x5f')]=function(_0x55b376,_0x53c492,_0x349df1){var _0x1e6b11={'agent':{},'channel':'whatsapp'};if(_0x55b376[_0xb823('0x5b')]['id']){delete _0x55b376[_0xb823('0x5b')]['id'];}_0x55b376[_0xb823('0x5b')]['read']=!![];_0x55b376[_0xb823('0x5b')]['readAt']=moment()[_0xb823('0x60')](_0xb823('0x61'));_0x55b376[_0xb823('0x5b')][_0xb823('0x62')]=_0x55b376[_0xb823('0x5b')]['UserId']||_0x55b376[_0xb823('0x63')]['id'];_0x1e6b11[_0xb823('0x64')]['id']=_0x55b376[_0xb823('0x5b')][_0xb823('0x62')];return db[_0xb823('0x3e')][_0xb823('0x59')]({'where':{'id':_0x55b376['params']['id'],'UserId':null}})[_0xb823('0x3b')](handleEntityNotFound(_0x53c492,null))[_0xb823('0x3b')](saveUpdates(_0x55b376['body'],null))[_0xb823('0x3b')](function(_0x457c85){if(_0x457c85){_0x1e6b11['message']=_0x457c85[_0xb823('0x65')]({'plain':!![]});return db[_0xb823('0x66')][_0xb823('0x59')]({'where':{'id':_0x457c85[_0xb823('0x67')]}});}return null;})[_0xb823('0x3b')](handleEntityNotFound(_0x53c492,null))['then'](function(_0x533843){if(_0x533843){return _0x533843[_0xb823('0x3a')]({'UserId':_0x55b376[_0xb823('0x5b')][_0xb823('0x62')],'read1stAt':_[_0xb823('0x68')](_0x533843[_0xb823('0x69')])?moment()[_0xb823('0x60')](_0xb823('0x61')):undefined});}return null;})[_0xb823('0x3b')](function(_0x34356f){if(_0x34356f){_0x1e6b11[_0xb823('0x6a')]=_0x34356f['get']({'plain':!![]});interaction_log[_0xb823('0x2c')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x55b376[_0xb823('0x63')]['id'],_0x55b376['user'][_0xb823('0x3d')],_0x55b376[_0xb823('0x63')]['role'],_0x1e6b11[_0xb823('0x6a')]['id'],_0x55b376[_0xb823('0x5b')]?JSON[_0xb823('0x29')](_0x55b376[_0xb823('0x5b')]):_0xb823('0x6b'));return respondWithRpcPromise(_0xb823('0x6c'),_0xb823('0x6d'),_0x1e6b11);}return null;})[_0xb823('0x3b')](function(_0x1b26b7){var _0x3e94ae=_0xb823('0x6e')+_0x1b26b7[_0xb823('0x2b')]['ContactId'];return db[_0xb823('0x6f')][_0xb823('0x43')](_0x3e94ae,{'type':db[_0xb823('0x70')][_0xb823('0x71')][_0xb823('0x72')],'raw':!![]})[_0xb823('0x3b')](function(_0x453cf0){return _0x453cf0;});})[_0xb823('0x3b')](function(_0x564ea5){if(_0x564ea5){_0x1e6b11[_0xb823('0x2b')][_0xb823('0x73')]=_0x564ea5[0x0];if(!_0x55b376[_0xb823('0x5b')]['UserId'])return;return db[_0xb823('0x74')]['find']({'where':{'id':_0x55b376[_0xb823('0x5b')][_0xb823('0x62')],'role':_0xb823('0x64')},'attributes':['id',_0xb823('0x3d'),'fullname','email','internal'],'raw':!![]});}return null;})[_0xb823('0x3b')](function(_0x4a4807){if(!_0x4a4807)return null;_0x1e6b11['message'][_0xb823('0x64')]=_0x4a4807;return _0x1e6b11;})[_0xb823('0x3b')](function(_0x49c5b8){if(_0x49c5b8){if(_0x55b376['body'][_0xb823('0x75')]){_0x1e6b11[_0xb823('0x2b')][_0xb823('0x76')]=util[_0xb823('0x60')](_0xb823('0x77'),_0x55b376[_0xb823('0x63')][_0xb823('0x3d')]);_0x1e6b11['message'][_0xb823('0x78')]=_0x1e6b11[_0xb823('0x78')];_0x1e6b11['message'][_0xb823('0x79')]=_0x1e6b11[_0xb823('0x78')];_0x1e6b11[_0xb823('0x2b')][_0xb823('0x7a')]=_0xb823('0x5f');return respondWithRpcPromise(_0xb823('0x7b'),_0xb823('0x7b'),{'event':_0xb823('0x7c'),'message':_0x1e6b11['message']},client9002)[_0xb823('0x3b')](function(){return _0x1e6b11;});}return _0x1e6b11;}return null;})[_0xb823('0x3b')](respondWithResult(_0x53c492,null))[_0xb823('0x2e')](handleError(_0x53c492,null));};var interaction_log=require(_0xb823('0x18'))(_0xb823('0x7d'));exports[_0xb823('0x38')]=function(_0x279b1,_0xbf59e1,_0xc82a33){var _0x2bbcd7={'agent':{},'channel':_0xb823('0x7e')};if(_0x279b1[_0xb823('0x5b')]['id']){delete _0x279b1[_0xb823('0x5b')]['id'];}_0x279b1[_0xb823('0x5b')][_0xb823('0x62')]=_0x279b1['body']['UserId']||_0x279b1[_0xb823('0x63')]['id'];_0x2bbcd7[_0xb823('0x64')]['id']=_0x279b1['body']['UserId'];return db['WhatsappMessage'][_0xb823('0x59')]({'where':{'id':_0x279b1['params']['id'],'UserId':null}})[_0xb823('0x3b')](handleEntityNotFound(_0xbf59e1,null))['then'](function(_0x1a80fb){if(_0x1a80fb){_0x2bbcd7['message']=_0x1a80fb['get']({'plain':!![]});return db['WhatsappInteraction'][_0xb823('0x59')]({'where':{'id':_0x1a80fb[_0xb823('0x67')]}});}return null;})['then'](handleEntityNotFound(_0xbf59e1,null))[_0xb823('0x3b')](function(_0x23a6e4){if(_0x23a6e4){_0x2bbcd7[_0xb823('0x6a')]=_0x23a6e4[_0xb823('0x65')]({'plain':!![]});interaction_log[_0xb823('0x2c')](_0xb823('0x7f'),_0x279b1[_0xb823('0x63')]['id'],_0x279b1[_0xb823('0x63')][_0xb823('0x3d')],_0x279b1[_0xb823('0x63')][_0xb823('0x80')],_0x2bbcd7[_0xb823('0x6a')]['id'],_0x279b1[_0xb823('0x5b')]?JSON[_0xb823('0x29')](_0x279b1[_0xb823('0x5b')]):_0xb823('0x6b'));return respondWithRpcPromise(_0xb823('0x81'),_0xb823('0x82'),_0x2bbcd7);}return null;})[_0xb823('0x3b')](function(_0x25ebd8){var _0x3499ee=_0xb823('0x6e')+_0x25ebd8[_0xb823('0x2b')][_0xb823('0x83')];return db[_0xb823('0x6f')][_0xb823('0x43')](_0x3499ee,{'type':db[_0xb823('0x70')][_0xb823('0x71')]['SELECT'],'raw':!![]})['then'](function(_0x28e017){return _0x28e017;});})[_0xb823('0x3b')](function(_0x4c78ef){if(_0x4c78ef){_0x2bbcd7[_0xb823('0x2b')][_0xb823('0x73')]=_0x4c78ef[0x0];if(!_0x279b1['body'][_0xb823('0x62')])return;return db[_0xb823('0x74')][_0xb823('0x59')]({'where':{'id':_0x279b1['body'][_0xb823('0x62')],'role':'agent'},'attributes':['id',_0xb823('0x3d'),'fullname',_0xb823('0x84'),_0xb823('0x85')],'raw':!![]});}return null;})[_0xb823('0x3b')](function(_0x5797c4){if(!_0x5797c4)return null;_0x2bbcd7[_0xb823('0x2b')][_0xb823('0x64')]=_0x5797c4;return _0x2bbcd7;})[_0xb823('0x3b')](function(_0x2e2d81){if(_0x2e2d81){_0x2e2d81[_0xb823('0x2b')][_0xb823('0x76')]=util[_0xb823('0x60')]('SIP/%s',_0x279b1[_0xb823('0x63')]['name']);_0x2e2d81[_0xb823('0x2b')][_0xb823('0x78')]=_0x2bbcd7['channel'];_0x2e2d81['message'][_0xb823('0x79')]=_0x2bbcd7['channel'];_0x2e2d81[_0xb823('0x2b')][_0xb823('0x7a')]=_0xb823('0x38');respondWithRpcPromise(_0xb823('0x7b'),_0xb823('0x7b'),{'event':'rejectmessage','message':_0x2e2d81[_0xb823('0x2b')]},client9002);return _0x2bbcd7;}return null;})[_0xb823('0x3b')](respondWithResult(_0xbf59e1,null))[_0xb823('0x2e')](handleError(_0xbf59e1,null));};exports[_0xb823('0x2f')]=function(_0x4b4dd3,_0x74b19f,_0x55c920){if(_0x4b4dd3[_0xb823('0x5b')]['id']){delete _0x4b4dd3['body']['id'];}var _0x26319d;return db[_0xb823('0x3e')][_0xb823('0x59')]({'where':{'id':_0x4b4dd3[_0xb823('0x5c')]['id']}})[_0xb823('0x3b')](handleEntityNotFound(_0x74b19f,null))[_0xb823('0x3b')](function(_0x228a55){if(_0x228a55){_0x26319d=_0x228a55;return db[_0xb823('0x86')][_0xb823('0x59')]({'where':{'id':_0x228a55[_0xb823('0x87')]}});}})[_0xb823('0x3b')](handleEntityNotFound(_0x74b19f,null))[_0xb823('0x3b')](function(_0x2c895b){if(_0x2c895b){logger['debug'](_0xb823('0x88'),_0xb823('0x2f'),'received\x20delivery\x20report\x20from',_0x2c895b[_0xb823('0x52')],util['inspect'](_0x4b4dd3[_0xb823('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2c895b['type']){case'twilio':if(_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x89')]&&_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x89')]===_0x26319d[_0xb823('0x8a')]&&_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x8b')]&&_0x4b4dd3[_0xb823('0x5b')][_0xb823('0x8b')]==='read'){return _0x26319d[_0xb823('0x3a')]({'read':!![]});}else{logger['error'](_0xb823('0x8c'),_0xb823('0x2f'),_0xb823('0x8d'),util[_0xb823('0x8e')](_0x4b4dd3[_0xb823('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x26319d;}})['then'](respondWithResult(_0x74b19f,null))[_0xb823('0x2e')](handleError(_0x74b19f,null));};
\ No newline at end of file
+var _0x66f0=['defaults','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','undefined','limit','set','apply','save','update','destroy','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','type','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','describe','whatsapp-interactions','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','whatsapp','role','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis'];(function(_0x654e84,_0x431ca2){var _0xc77c75=function(_0x5c6e48){while(--_0x5c6e48){_0x654e84['push'](_0x654e84['shift']());}};_0xc77c75(++_0x431ca2);}(_0x66f0,0x17b));var _0x066f=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x66f0[_0x44afa4];return _0xcad289;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x066f('0x0'));var zipdir=require(_0x066f('0x1'));var jsonpatch=require(_0x066f('0x2'));var rp=require(_0x066f('0x3'));var moment=require(_0x066f('0x4'));var BPromise=require(_0x066f('0x5'));var Mustache=require(_0x066f('0x6'));var util=require(_0x066f('0x7'));var path=require('path');var sox=require(_0x066f('0x8'));var csv=require('to-csv');var ejs=require(_0x066f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x066f('0xa'));var crypto=require(_0x066f('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x066f('0xc'));var Papa=require(_0x066f('0xd'));var Redis=require('ioredis');var authService=require(_0x066f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x066f('0xf'));var hardwareService=require(_0x066f('0x10'));var logger=require(_0x066f('0x11'))(_0x066f('0x12'));var utils=require(_0x066f('0x13'));var config=require(_0x066f('0x14'));var licenseUtil=require(_0x066f('0x15'));var db=require('../../mysqldb')['db'];config[_0x066f('0x16')]=_[_0x066f('0x17')](config[_0x066f('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x066f('0x18'))(new Redis(config[_0x066f('0x16')]));require(_0x066f('0x19'))[_0x066f('0x1a')](socket);var jayson=require(_0x066f('0x1b'));var client=jayson[_0x066f('0x1c')]['http']({'port':0x232c});var client9002=jayson['client'][_0x066f('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5362d6,_0x352f04,_0x213772,_0x10e498){return new BPromise(function(_0x50e0ab,_0x3fcc16){var _0xf1ac3=_0x10e498||client;return _0xf1ac3[_0x066f('0x1e')](_0x5362d6,_0x213772)[_0x066f('0x1f')](function(_0x2ad2ee){logger[_0x066f('0x20')](_0x066f('0x21'),_0x352f04,_0x066f('0x22'));logger[_0x066f('0x23')](_0x066f('0x24'),_0x352f04,_0x066f('0x22'),JSON[_0x066f('0x25')](_0x2ad2ee));if(_0x2ad2ee['error']){if(_0x2ad2ee[_0x066f('0x26')][_0x066f('0x27')]===0x1f4){logger[_0x066f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x2ad2ee[_0x066f('0x26')][_0x066f('0x28')]);return _0x3fcc16(_0x2ad2ee['error'][_0x066f('0x28')]);}logger[_0x066f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x2ad2ee[_0x066f('0x26')][_0x066f('0x28')]);return _0x50e0ab(_0x2ad2ee[_0x066f('0x26')][_0x066f('0x28')]);}else{logger[_0x066f('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x066f('0x22'));_0x50e0ab(_0x2ad2ee[_0x066f('0x29')][_0x066f('0x28')]);}})[_0x066f('0x2a')](function(_0x1e81c9){logger[_0x066f('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x352f04,_0x1e81c9);_0x3fcc16(_0x1e81c9);});});}function respondWithStatusCode(_0x160dec,_0x28f811){_0x28f811=_0x28f811||0xcc;return function(_0x2756c1){if(_0x2756c1){return _0x160dec['sendStatus'](_0x28f811);}return _0x160dec['status'](_0x28f811)[_0x066f('0x2b')]();};}function respondWithResult(_0x5e18f7,_0xc5f7b){_0xc5f7b=_0xc5f7b||0xc8;return function(_0x416fee){if(_0x416fee){return _0x5e18f7[_0x066f('0x2c')](_0xc5f7b)[_0x066f('0x2d')](_0x416fee);}};}function respondWithFilteredResult(_0x218cd9,_0x4ac5f2){return function(_0x317acf){if(_0x317acf){var _0x204312=typeof _0x4ac5f2[_0x066f('0x2e')]===_0x066f('0x2f')&&typeof _0x4ac5f2[_0x066f('0x30')]===_0x066f('0x2f');var _0x52e1a6=_0x317acf['count'];var _0x275e6b=_0x204312?0x0:_0x4ac5f2[_0x066f('0x2e')];var _0x578b60=_0x204312?_0x317acf['count']:_0x4ac5f2[_0x066f('0x2e')]+_0x4ac5f2[_0x066f('0x30')];var _0x396371;if(_0x578b60>=_0x52e1a6){_0x578b60=_0x52e1a6;_0x396371=0xc8;}else{_0x396371=0xce;}_0x218cd9[_0x066f('0x2c')](_0x396371);return _0x218cd9[_0x066f('0x31')]('Content-Range',_0x275e6b+'-'+_0x578b60+'/'+_0x52e1a6)[_0x066f('0x2d')](_0x317acf);}return null;};}function patchUpdates(_0x29ffe0){return function(_0x47893c){try{jsonpatch[_0x066f('0x32')](_0x47893c,_0x29ffe0,!![]);}catch(_0x53ca76){return BPromise['reject'](_0x53ca76);}return _0x47893c[_0x066f('0x33')]();};}function saveUpdates(_0x4d2171,_0x1d5a24){return function(_0xdaffd){if(_0xdaffd){return _0xdaffd[_0x066f('0x34')](_0x4d2171)[_0x066f('0x1f')](function(_0xd71478){return _0xd71478;});}return null;};}function removeEntity(_0x286472,_0x43f57b){return function(_0x163a19){if(_0x163a19){return _0x163a19[_0x066f('0x35')]()[_0x066f('0x1f')](function(){_0x286472['status'](0xcc)[_0x066f('0x2b')]();});}};}function handleEntityNotFound(_0xaaf39b,_0x1dd4b3){return function(_0x178572){if(!_0x178572){_0xaaf39b[_0x066f('0x36')](0x194);}return _0x178572;};}function handleError(_0x5d4036,_0x48159a){_0x48159a=_0x48159a||0x1f4;return function(_0x305198){logger[_0x066f('0x26')](_0x305198[_0x066f('0x37')]);if(_0x305198[_0x066f('0x38')]){delete _0x305198['name'];}_0x5d4036[_0x066f('0x2c')](_0x48159a)[_0x066f('0x39')](_0x305198);};}exports[_0x066f('0x3a')]=function(_0x39254e,_0x36b131){var _0x10eff8={},_0x3279c7={},_0x1bf6dc={'count':0x0,'rows':[]};var _0x4b12a6=_[_0x066f('0x3b')](db[_0x066f('0x3c')][_0x066f('0x3d')],function(_0x2b3798){return{'name':_0x2b3798[_0x066f('0x3e')],'type':_0x2b3798['type'][_0x066f('0x3f')]};});_0x3279c7[_0x066f('0x40')]=_[_0x066f('0x3b')](_0x4b12a6,_0x066f('0x38'));_0x3279c7[_0x066f('0x41')]=_['keys'](_0x39254e[_0x066f('0x41')]);_0x3279c7[_0x066f('0x42')]=_[_0x066f('0x43')](_0x3279c7[_0x066f('0x40')],_0x3279c7['query']);_0x10eff8[_0x066f('0x44')]=_[_0x066f('0x43')](_0x3279c7[_0x066f('0x40')],qs[_0x066f('0x45')](_0x39254e['query'][_0x066f('0x45')]));_0x10eff8[_0x066f('0x44')]=_0x10eff8[_0x066f('0x44')][_0x066f('0x46')]?_0x10eff8[_0x066f('0x44')]:_0x3279c7['model'];if(!_0x39254e[_0x066f('0x41')]['hasOwnProperty']('nolimit')){_0x10eff8[_0x066f('0x30')]=qs[_0x066f('0x30')](_0x39254e['query'][_0x066f('0x30')]);_0x10eff8['offset']=qs[_0x066f('0x2e')](_0x39254e[_0x066f('0x41')][_0x066f('0x2e')]);}_0x10eff8['order']=qs[_0x066f('0x47')](_0x39254e[_0x066f('0x41')][_0x066f('0x47')]);_0x10eff8[_0x066f('0x48')]=qs[_0x066f('0x42')](_[_0x066f('0x49')](_0x39254e['query'],_0x3279c7[_0x066f('0x42')]),_0x4b12a6);if(_0x39254e['query'][_0x066f('0x4a')]){_0x10eff8['where']=_[_0x066f('0x4b')](_0x10eff8['where'],{'$or':_[_0x066f('0x3b')](_0x4b12a6,function(_0x3313d6){if(_0x3313d6[_0x066f('0x4c')]!=='VIRTUAL'){var _0x54b8bf={};_0x54b8bf[_0x3313d6[_0x066f('0x38')]]={'$like':'%'+_0x39254e[_0x066f('0x41')][_0x066f('0x4a')]+'%'};return _0x54b8bf;}})});}_0x10eff8=_[_0x066f('0x4b')]({},_0x10eff8,_0x39254e['options']);var _0x1f514e={'where':_0x10eff8[_0x066f('0x48')]};return db['WhatsappMessage'][_0x066f('0x4d')](_0x1f514e)['then'](function(_0x365e27){_0x1bf6dc['count']=_0x365e27;if(_0x39254e['query'][_0x066f('0x4e')]){_0x10eff8[_0x066f('0x4f')]=[{'all':!![]}];}return db[_0x066f('0x3c')][_0x066f('0x50')](_0x10eff8);})[_0x066f('0x1f')](function(_0x30f79c){_0x1bf6dc[_0x066f('0x51')]=_0x30f79c;return _0x1bf6dc;})[_0x066f('0x1f')](respondWithFilteredResult(_0x36b131,_0x10eff8))[_0x066f('0x2a')](handleError(_0x36b131,null));};exports[_0x066f('0x52')]=function(_0x58281d,_0x941d92){var _0x54d9eb={'raw':!![],'where':{'id':_0x58281d[_0x066f('0x53')]['id']}},_0x1319dd={};_0x1319dd['model']=_[_0x066f('0x54')](db[_0x066f('0x3c')][_0x066f('0x3d')]);_0x1319dd[_0x066f('0x41')]=_[_0x066f('0x54')](_0x58281d[_0x066f('0x41')]);_0x1319dd['filters']=_['intersection'](_0x1319dd[_0x066f('0x40')],_0x1319dd['query']);_0x54d9eb[_0x066f('0x44')]=_[_0x066f('0x43')](_0x1319dd[_0x066f('0x40')],qs[_0x066f('0x45')](_0x58281d['query'][_0x066f('0x45')]));_0x54d9eb[_0x066f('0x44')]=_0x54d9eb['attributes'][_0x066f('0x46')]?_0x54d9eb[_0x066f('0x44')]:_0x1319dd[_0x066f('0x40')];if(_0x58281d[_0x066f('0x41')][_0x066f('0x4e')]){_0x54d9eb[_0x066f('0x4f')]=[{'all':!![]}];}_0x54d9eb=_['merge']({},_0x54d9eb,_0x58281d['options']);return db[_0x066f('0x3c')][_0x066f('0x55')](_0x54d9eb)['then'](handleEntityNotFound(_0x941d92,null))[_0x066f('0x1f')](respondWithResult(_0x941d92,null))[_0x066f('0x2a')](handleError(_0x941d92,null));};exports[_0x066f('0x56')]=function(_0x406d13,_0xceb149){return db[_0x066f('0x3c')][_0x066f('0x56')](_0x406d13['body'],{})['then'](respondWithResult(_0xceb149,0xc9))['catch'](handleError(_0xceb149,null));};exports[_0x066f('0x34')]=function(_0x405c1a,_0x3ff201){if(_0x405c1a[_0x066f('0x57')]['id']){delete _0x405c1a['body']['id'];}return db['WhatsappMessage'][_0x066f('0x55')]({'where':{'id':_0x405c1a[_0x066f('0x53')]['id']}})['then'](handleEntityNotFound(_0x3ff201,null))[_0x066f('0x1f')](saveUpdates(_0x405c1a[_0x066f('0x57')],null))[_0x066f('0x1f')](respondWithResult(_0x3ff201,null))[_0x066f('0x2a')](handleError(_0x3ff201,null));};exports[_0x066f('0x35')]=function(_0x26b5fe,_0x52b635){return db[_0x066f('0x3c')][_0x066f('0x55')]({'where':{'id':_0x26b5fe[_0x066f('0x53')]['id']}})['then'](handleEntityNotFound(_0x52b635,null))[_0x066f('0x1f')](removeEntity(_0x52b635,null))['catch'](handleError(_0x52b635,null));};exports[_0x066f('0x58')]=function(_0x1bcd25,_0x27d864){return db[_0x066f('0x3c')][_0x066f('0x58')]()[_0x066f('0x1f')](respondWithResult(_0x27d864,null))[_0x066f('0x2a')](handleError(_0x27d864,null));};var interaction_log=require(_0x066f('0x11'))(_0x066f('0x59'));exports['accept']=function(_0xe4cd40,_0x255429,_0x24c469){var _0x4829ac={'agent':{},'channel':'whatsapp'};if(_0xe4cd40[_0x066f('0x57')]['id']){delete _0xe4cd40[_0x066f('0x57')]['id'];}_0xe4cd40[_0x066f('0x57')][_0x066f('0x5a')]=!![];_0xe4cd40[_0x066f('0x57')][_0x066f('0x5b')]=moment()['format'](_0x066f('0x5c'));_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')]=_0xe4cd40['body'][_0x066f('0x5d')]||_0xe4cd40[_0x066f('0x5e')]['id'];_0x4829ac[_0x066f('0x5f')]['id']=_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')];return db[_0x066f('0x3c')][_0x066f('0x55')]({'where':{'id':_0xe4cd40[_0x066f('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x255429,null))[_0x066f('0x1f')](saveUpdates(_0xe4cd40['body'],null))[_0x066f('0x1f')](function(_0x4383e2){if(_0x4383e2){_0x4829ac[_0x066f('0x28')]=_0x4383e2[_0x066f('0x60')]({'plain':!![]});return db[_0x066f('0x61')][_0x066f('0x55')]({'where':{'id':_0x4383e2[_0x066f('0x62')]}});}return null;})[_0x066f('0x1f')](handleEntityNotFound(_0x255429,null))[_0x066f('0x1f')](function(_0x57cab7){if(_0x57cab7){return _0x57cab7['update']({'UserId':_0xe4cd40['body'][_0x066f('0x5d')],'read1stAt':_[_0x066f('0x63')](_0x57cab7[_0x066f('0x64')])?moment()[_0x066f('0x65')](_0x066f('0x5c')):undefined});}return null;})[_0x066f('0x1f')](function(_0x56f8a0){if(_0x56f8a0){_0x4829ac[_0x066f('0x66')]=_0x56f8a0['get']({'plain':!![]});interaction_log['info'](_0x066f('0x67'),_0xe4cd40['user']['id'],_0xe4cd40[_0x066f('0x5e')]['name'],_0xe4cd40[_0x066f('0x5e')]['role'],_0x4829ac[_0x066f('0x66')]['id'],_0xe4cd40[_0x066f('0x57')]?JSON['stringify'](_0xe4cd40[_0x066f('0x57')]):_0x066f('0x68'));return respondWithRpcPromise('AcceptMessage',_0x066f('0x69'),_0x4829ac);}return null;})[_0x066f('0x1f')](function(_0x123a70){var _0x226d54=_0x066f('0x6a')+_0x123a70[_0x066f('0x28')][_0x066f('0x6b')];return db['sequelize']['query'](_0x226d54,{'type':db[_0x066f('0x6c')][_0x066f('0x6d')][_0x066f('0x6e')],'raw':!![]})[_0x066f('0x1f')](function(_0x17107e){return _0x17107e;});})[_0x066f('0x1f')](function(_0x1fc87b){if(_0x1fc87b){_0x4829ac[_0x066f('0x28')][_0x066f('0x6f')]=_0x1fc87b[0x0];if(!_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')])return;return db[_0x066f('0x70')]['find']({'where':{'id':_0xe4cd40[_0x066f('0x57')][_0x066f('0x5d')],'role':_0x066f('0x5f')},'attributes':['id',_0x066f('0x38'),_0x066f('0x71'),_0x066f('0x72'),'internal'],'raw':!![]});}return null;})[_0x066f('0x1f')](function(_0x4ec083){if(!_0x4ec083)return null;_0x4829ac['message'][_0x066f('0x5f')]=_0x4ec083;return _0x4829ac;})[_0x066f('0x1f')](function(_0x4b3396){if(_0x4b3396){if(_0xe4cd40['body'][_0x066f('0x73')]){_0x4829ac[_0x066f('0x28')][_0x066f('0x74')]=util[_0x066f('0x65')](_0x066f('0x75'),_0xe4cd40['user']['name']);_0x4829ac[_0x066f('0x28')]['channel']=_0x4829ac[_0x066f('0x76')];_0x4829ac[_0x066f('0x28')][_0x066f('0x77')]=_0x4829ac[_0x066f('0x76')];_0x4829ac[_0x066f('0x28')][_0x066f('0x78')]=_0x066f('0x79');return respondWithRpcPromise('EventManager',_0x066f('0x7a'),{'event':'acceptmessage','message':_0x4829ac[_0x066f('0x28')]},client9002)[_0x066f('0x1f')](function(){return _0x4829ac;});}return _0x4829ac;}return null;})['then'](respondWithResult(_0x255429,null))['catch'](handleError(_0x255429,null));};var interaction_log=require(_0x066f('0x11'))('whatsapp-interactions');exports['reject']=function(_0x4d7193,_0x501500,_0x46c5fb){var _0x4f667f={'agent':{},'channel':_0x066f('0x7b')};if(_0x4d7193[_0x066f('0x57')]['id']){delete _0x4d7193['body']['id'];}_0x4d7193[_0x066f('0x57')]['UserId']=_0x4d7193[_0x066f('0x57')]['UserId']||_0x4d7193['user']['id'];_0x4f667f['agent']['id']=_0x4d7193[_0x066f('0x57')]['UserId'];return db['WhatsappMessage'][_0x066f('0x55')]({'where':{'id':_0x4d7193[_0x066f('0x53')]['id'],'UserId':null}})[_0x066f('0x1f')](handleEntityNotFound(_0x501500,null))['then'](function(_0x48cd4f){if(_0x48cd4f){_0x4f667f[_0x066f('0x28')]=_0x48cd4f[_0x066f('0x60')]({'plain':!![]});return db[_0x066f('0x61')]['find']({'where':{'id':_0x48cd4f['WhatsappInteractionId']}});}return null;})[_0x066f('0x1f')](handleEntityNotFound(_0x501500,null))[_0x066f('0x1f')](function(_0x2ee089){if(_0x2ee089){_0x4f667f[_0x066f('0x66')]=_0x2ee089[_0x066f('0x60')]({'plain':!![]});interaction_log[_0x066f('0x20')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4d7193[_0x066f('0x5e')]['id'],_0x4d7193[_0x066f('0x5e')][_0x066f('0x38')],_0x4d7193['user'][_0x066f('0x7c')],_0x4f667f[_0x066f('0x66')]['id'],_0x4d7193['body']?JSON[_0x066f('0x25')](_0x4d7193['body']):_0x066f('0x68'));return respondWithRpcPromise(_0x066f('0x7d'),_0x066f('0x7e'),_0x4f667f);}return null;})['then'](function(_0x441009){var _0x1f4579=_0x066f('0x6a')+_0x441009[_0x066f('0x28')][_0x066f('0x6b')];return db['sequelize'][_0x066f('0x41')](_0x1f4579,{'type':db[_0x066f('0x6c')]['QueryTypes']['SELECT'],'raw':!![]})[_0x066f('0x1f')](function(_0x216dec){return _0x216dec;});})['then'](function(_0x2155d4){if(_0x2155d4){_0x4f667f['message'][_0x066f('0x6f')]=_0x2155d4[0x0];if(!_0x4d7193[_0x066f('0x57')][_0x066f('0x5d')])return;return db[_0x066f('0x70')][_0x066f('0x55')]({'where':{'id':_0x4d7193[_0x066f('0x57')][_0x066f('0x5d')],'role':'agent'},'attributes':['id',_0x066f('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x066f('0x1f')](function(_0x4c4947){if(!_0x4c4947)return null;_0x4f667f[_0x066f('0x28')][_0x066f('0x5f')]=_0x4c4947;return _0x4f667f;})[_0x066f('0x1f')](function(_0x2eac17){if(_0x2eac17){_0x2eac17[_0x066f('0x28')][_0x066f('0x74')]=util[_0x066f('0x65')](_0x066f('0x75'),_0x4d7193[_0x066f('0x5e')][_0x066f('0x38')]);_0x2eac17['message'][_0x066f('0x76')]=_0x4f667f[_0x066f('0x76')];_0x2eac17[_0x066f('0x28')]['motionChannel']=_0x4f667f[_0x066f('0x76')];_0x2eac17[_0x066f('0x28')][_0x066f('0x78')]='reject';respondWithRpcPromise(_0x066f('0x7a'),_0x066f('0x7a'),{'event':_0x066f('0x7f'),'message':_0x2eac17[_0x066f('0x28')]},client9002);return _0x4f667f;}return null;})['then'](respondWithResult(_0x501500,null))[_0x066f('0x2a')](handleError(_0x501500,null));};exports[_0x066f('0x2c')]=function(_0x43f0f7,_0x553198,_0xcc55b2){if(_0x43f0f7[_0x066f('0x57')]['id']){delete _0x43f0f7['body']['id'];}var _0x56e995;return db['WhatsappMessage'][_0x066f('0x55')]({'where':{'id':_0x43f0f7[_0x066f('0x53')]['id']}})[_0x066f('0x1f')](handleEntityNotFound(_0x553198,null))[_0x066f('0x1f')](function(_0x26bc90){if(_0x26bc90){_0x56e995=_0x26bc90;return db[_0x066f('0x80')][_0x066f('0x55')]({'where':{'id':_0x26bc90['WhatsappAccountId']}});}})[_0x066f('0x1f')](handleEntityNotFound(_0x553198,null))[_0x066f('0x1f')](function(_0x136221){if(_0x136221){logger[_0x066f('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x066f('0x2c'),'received\x20delivery\x20report\x20from',_0x136221['type'],util['inspect'](_0x43f0f7[_0x066f('0x57')],{'showHidden':![],'depth':null}));switch(_0x136221[_0x066f('0x4c')]){case _0x066f('0x81'):if(_0x43f0f7['body'][_0x066f('0x82')]&&_0x43f0f7[_0x066f('0x57')]['MessageSid']===_0x56e995[_0x066f('0x83')]&&_0x43f0f7[_0x066f('0x57')][_0x066f('0x84')]&&_0x43f0f7['body'][_0x066f('0x84')]===_0x066f('0x5a')){return _0x56e995[_0x066f('0x34')]({'read':!![]});}else{logger['error'](_0x066f('0x85'),_0x066f('0x2c'),_0x066f('0x81'),util['inspect'](_0x43f0f7[_0x066f('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x56e995;}})[_0x066f('0x1f')](respondWithResult(_0x553198,null))[_0x066f('0x2a')](handleError(_0x553198,null));};
\ No newline at end of file
index e113db8..341bcc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb94=['remove','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb94,0xab));var _0x4db9=function(_0x449724,_0x4bd02d){_0x449724=_0x449724-0x0;var _0x10a457=_0xdb94[_0x449724];return _0x10a457;};'use strict';var EventEmitter=require(_0x4db9('0x0'));var WhatsappMessage=require(_0x4db9('0x1'))['db'][_0x4db9('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4db9('0x3')](0x0);var events={'afterCreate':_0x4db9('0x4'),'afterUpdate':'update','afterDestroy':_0x4db9('0x5')};function emitEvent(_0x16c55a){return function(_0x554bd5,_0x4ed80a,_0x209f80){WhatsappMessageEvents['emit'](_0x16c55a+':'+_0x554bd5['id'],_0x554bd5);WhatsappMessageEvents['emit'](_0x16c55a,_0x554bd5);_0x209f80(null);};}for(var e in events){if(events[_0x4db9('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x4db9('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x63a5=['WhatsappMessage','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x27551c,_0x184f9c){var _0x2f518d=function(_0x3c37c2){while(--_0x3c37c2){_0x27551c['push'](_0x27551c['shift']());}};_0x2f518d(++_0x184f9c);}(_0x63a5,0x18e));var _0x563a=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x63a5[_0x1f36bb];return _0xaf97fa;};'use strict';var EventEmitter=require(_0x563a('0x0'));var WhatsappMessage=require(_0x563a('0x1'))['db'][_0x563a('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x563a('0x3'),'afterUpdate':'update','afterDestroy':_0x563a('0x4')};function emitEvent(_0x13195e){return function(_0x386400,_0x37e617,_0x5c2a8d){WhatsappMessageEvents['emit'](_0x13195e+':'+_0x386400['id'],_0x386400);WhatsappMessageEvents[_0x563a('0x5')](_0x13195e,_0x386400);_0x5c2a8d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x563a('0x6')](e,emitEvent(event));}}module[_0x563a('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
index 8e038b5..b2c1bf5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00d9=['accountSid','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','message_id','statuses','WhatsappMessage,\x20%s','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','messageId','fti_whatsapp_messages','models','direction','toLowerCase','secret','UserId','WhatsappInteraction','then','update','catch','error','out','WhatsappAccount','find','WhatsappAccountId','twilio','phone','authToken','messages','create','body','whatsapp:','remote','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x00d9,0x1a2));var _0x900d=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x00d9[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x900d('0x0'));var util=require(_0x900d('0x1'));var logger=require(_0x900d('0x2'))(_0x900d('0x3'));var moment=require('moment');var BPromise=require(_0x900d('0x4'));var rp=require('request-promise');var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x900d('0x5'));var rimraf=require(_0x900d('0x6'));var config=require(_0x900d('0x7'));var attributes=require(_0x900d('0x8'));module['exports']=function(_0x1a8de0,_0x454f9b){return _0x1a8de0[_0x900d('0x9')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x900d('0xa')]},{'name':_0x900d('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x477227,_0x1ce9d5,_0xb45304){var _0x2d5e59=_0x1a8de0[_0x900d('0xc')];var _0x37a462=_0x477227['get']({'plain':!![]});if(_0x37a462[_0x900d('0xd')][_0x900d('0xe')]()==='in'||_0x37a462[_0x900d('0xd')][_0x900d('0xe')]()==='out'&&!_0x37a462[_0x900d('0xf')]&&!_['isNil'](_0x37a462[_0x900d('0x10')])){_0x2d5e59[_0x900d('0x11')]['findOne']({'where':{'id':_0x37a462['WhatsappInteractionId']}})[_0x900d('0x12')](function(_0x3ef9ab){if(_0x3ef9ab){_0x3ef9ab[_0x900d('0x13')]({'lastMsgAt':_0x37a462['createdAt'],'lastMsgDirection':_0x37a462[_0x900d('0xd')][_0x900d('0xe')]()});}})[_0x900d('0x14')](function(_0x210bff){console[_0x900d('0x15')](_0x210bff);});}if(_0x37a462[_0x900d('0xd')]===_0x900d('0x16')&&!_0x37a462[_0x900d('0xf')]){var _0x516dd8;_0x2d5e59[_0x900d('0x17')][_0x900d('0x18')]({'where':{'id':_0x37a462[_0x900d('0x19')]},'raw':!![]})[_0x900d('0x12')](function(_0x452614){_0x516dd8=_0x452614;if(_0x516dd8&&_0x516dd8['type']){switch(_0x516dd8['type']){case _0x900d('0x1a'):var _0x3fa06=require(_0x900d('0x1a'));if(_0x516dd8['accountSid']&&_0x516dd8['authToken']&&_0x516dd8[_0x900d('0x1b')]){var _0x189145=new _0x3fa06(_0x516dd8['accountSid'],_0x516dd8[_0x900d('0x1c')]);_0x189145[_0x900d('0x1d')][_0x900d('0x1e')]({'body':_0x37a462[_0x900d('0x1f')],'to':_0x900d('0x20')+_0x37a462[_0x900d('0x1b')],'from':_0x900d('0x20')+_0x516dd8['phone'],'statusCallback':_0x516dd8[_0x900d('0x21')]+'/api/whatsapp/messages/'+_0x37a462['id']+_0x900d('0x22')+_0x516dd8[_0x900d('0x23')]})[_0x900d('0x12')](function(_0x14d469){if(_0x14d469[_0x900d('0x24')]){return _0x477227[_0x900d('0x13')]({'messageId':_0x14d469[_0x900d('0x24')]});}})['catch'](function(_0x382cc6){logger[_0x900d('0x15')](_0x900d('0x25'),_0x900d('0x26'),_0x900d('0x1a'),util['inspect'](_0x382cc6,{'showHidden':![],'depth':null}));});}else{logger[_0x900d('0x15')](_0x900d('0x25'),_0x900d('0x26'),_0x900d('0x1a'),_0x900d('0x27'));}break;case _0x900d('0x28'):var _0x26e4a8=_0x516dd8[_0x900d('0x29')];var _0x4de643=_0x516dd8[_0x900d('0x1c')];var _0x5dd5ae=_0x516dd8[_0x900d('0x2a')]+_0x900d('0x2b')+_0x26e4a8+_0x900d('0x2c');var _0x1cb970={'to':[_0x37a462[_0x900d('0x1b')]],'message':{'type':_0x900d('0x2d'),'text':_0x37a462[_0x900d('0x1f')]}};var _0x192b84={'method':_0x900d('0x2e'),'uri':_0x5dd5ae,'headers':{'Authorization':_0x900d('0x2f')+_0x4de643,'Content-Type':'application/json'},'body':_0x1cb970,'json':!![]};rp(_0x192b84)[_0x900d('0x12')](function(_0xee5162){if(_0xee5162['statuses'][0x0][_0x900d('0x30')]){return _0x477227[_0x900d('0x13')]({'messageId':_0xee5162[_0x900d('0x31')][0x0][_0x900d('0x30')]});}})[_0x900d('0x14')](function(_0x71f55){logger['err'](_0x900d('0x32'),_0x71f55);});break;}}})['finally'](function(){_0xb45304();});}else{_0xb45304();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x43e7=['Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','lodash','../../config/logger','request-promise','path','rimraf','exports','messageId','fti_whatsapp_messages','body','models','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','phone','authToken','messages','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','/whatsapp/v1/','/messages/','text'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x43e7,0xda));var _0x743e=function(_0x235f49,_0x2992b4){_0x235f49=_0x235f49-0x0;var _0x551139=_0x43e7[_0x235f49];return _0x551139;};'use strict';var _=require(_0x743e('0x0'));var util=require('util');var logger=require(_0x743e('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x743e('0x2'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x743e('0x3'));var rimraf=require(_0x743e('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0x743e('0x5')]=function(_0x54a27d,_0x175a12){return _0x54a27d['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x743e('0x6')]},{'name':_0x743e('0x7'),'fields':[_0x743e('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b27f6,_0x3877de,_0x54e740){var _0x4421e5=_0x54a27d[_0x743e('0x9')];var _0x27b8b5=_0x4b27f6['get']({'plain':!![]});if(_0x27b8b5[_0x743e('0xa')]['toLowerCase']()==='in'||_0x27b8b5[_0x743e('0xa')][_0x743e('0xb')]()===_0x743e('0xc')&&!_0x27b8b5['secret']&&!_[_0x743e('0xd')](_0x27b8b5[_0x743e('0xe')])){_0x4421e5[_0x743e('0xf')][_0x743e('0x10')]({'where':{'id':_0x27b8b5[_0x743e('0x11')]}})['then'](function(_0x5780ba){if(_0x5780ba){_0x5780ba[_0x743e('0x12')]({'lastMsgAt':_0x27b8b5[_0x743e('0x13')],'lastMsgDirection':_0x27b8b5[_0x743e('0xa')][_0x743e('0xb')]()});}})[_0x743e('0x14')](function(_0x4f80b2){console[_0x743e('0x15')](_0x4f80b2);});}if(_0x27b8b5[_0x743e('0xa')]===_0x743e('0xc')&&!_0x27b8b5[_0x743e('0x16')]){var _0x3799e8;_0x4421e5[_0x743e('0x17')][_0x743e('0x18')]({'where':{'id':_0x27b8b5[_0x743e('0x19')]},'raw':!![]})[_0x743e('0x1a')](function(_0x3ea85b){_0x3799e8=_0x3ea85b;if(_0x3799e8&&_0x3799e8[_0x743e('0x1b')]){switch(_0x3799e8[_0x743e('0x1b')]){case _0x743e('0x1c'):var _0x27c3b5=require(_0x743e('0x1c'));if(_0x3799e8[_0x743e('0x1d')]&&_0x3799e8['authToken']&&_0x3799e8[_0x743e('0x1e')]){var _0x78993f=new _0x27c3b5(_0x3799e8[_0x743e('0x1d')],_0x3799e8[_0x743e('0x1f')]);_0x78993f[_0x743e('0x20')]['create']({'body':_0x27b8b5[_0x743e('0x8')],'to':_0x743e('0x21')+_0x27b8b5[_0x743e('0x1e')],'from':_0x743e('0x21')+_0x3799e8[_0x743e('0x1e')],'statusCallback':_0x3799e8[_0x743e('0x22')]+_0x743e('0x23')+_0x27b8b5['id']+_0x743e('0x24')+_0x3799e8[_0x743e('0x25')]})[_0x743e('0x1a')](function(_0x30cb8e){if(_0x30cb8e[_0x743e('0x26')]){return _0x4b27f6[_0x743e('0x12')]({'messageId':_0x30cb8e[_0x743e('0x26')]});}})['catch'](function(_0x4310cc){logger[_0x743e('0x15')](_0x743e('0x27'),_0x743e('0x28'),_0x743e('0x1c'),util[_0x743e('0x29')](_0x4310cc,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x743e('0x27'),'afterCreate','twilio',_0x743e('0x2a'));}break;case _0x743e('0x2b'):var _0x4936c1=_0x3799e8[_0x743e('0x1d')];var _0x1da709=_0x3799e8['authToken'];var _0x3f72df=_0x3799e8['baseUrl']+_0x743e('0x2c')+_0x4936c1+_0x743e('0x2d');var _0x4cd1f7={'to':[_0x27b8b5[_0x743e('0x1e')]],'message':{'type':_0x743e('0x2e'),'text':_0x27b8b5[_0x743e('0x8')]}};var _0x497cd1={'method':'POST','uri':_0x3f72df,'headers':{'Authorization':_0x743e('0x2f')+_0x1da709,'Content-Type':'application/json'},'body':_0x4cd1f7,'json':!![]};rp(_0x497cd1)[_0x743e('0x1a')](function(_0x5bbc26){if(_0x5bbc26[_0x743e('0x30')][0x0][_0x743e('0x31')]){return _0x4b27f6[_0x743e('0x12')]({'messageId':_0x5bbc26['statuses'][0x0][_0x743e('0x31')]});}})['catch'](function(_0x4bf3dc){logger[_0x743e('0x32')](_0x743e('0x33'),_0x4bf3dc);});break;}}})[_0x743e('0x34')](function(){_0x54e740();});}else{_0x54e740();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index b9bfc3a..ca235a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9183=['WhatsappMessage','options','raw','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','CreateWhatsappMessage'];(function(_0x2bf799,_0x3d81dc){var _0x220479=function(_0x3ca801){while(--_0x3ca801){_0x2bf799['push'](_0x2bf799['shift']());}};_0x220479(++_0x3d81dc);}(_0x9183,0x11b));var _0x3918=function(_0x4b9097,_0x15a9e2){_0x4b9097=_0x4b9097-0x0;var _0x3566f4=_0x9183[_0x4b9097];return _0x3566f4;};'use strict';var _=require(_0x3918('0x0'));var util=require('util');var moment=require(_0x3918('0x1'));var BPromise=require(_0x3918('0x2'));var rs=require(_0x3918('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3918('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3918('0x5'))(_0x3918('0x6'));var config=require('../../config/environment');var jayson=require(_0x3918('0x7'));var client=jayson['client'][_0x3918('0x8')]({'port':0x232a});config[_0x3918('0x9')]=_[_0x3918('0xa')](config[_0x3918('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x3918('0xb'))(new Redis(config[_0x3918('0x9')]));require(_0x3918('0xc'))[_0x3918('0xd')](socket);function respondWithRpcPromise(_0x1ed828,_0x511300,_0x3c571e){return new BPromise(function(_0x3244f6,_0x5d286f){return client[_0x3918('0xe')](_0x1ed828,_0x3c571e)[_0x3918('0xf')](function(_0x2c2305){logger[_0x3918('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x511300,'request\x20sent');logger['debug'](_0x3918('0x11'),_0x511300,_0x3918('0x12'),JSON[_0x3918('0x13')](_0x2c2305));if(_0x2c2305[_0x3918('0x14')]){if(_0x2c2305[_0x3918('0x14')][_0x3918('0x15')]===0x1f4){logger[_0x3918('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x511300,_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);return _0x5d286f(_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);}logger[_0x3918('0x14')](_0x3918('0x17'),_0x511300,_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);return _0x3244f6(_0x2c2305[_0x3918('0x14')][_0x3918('0x16')]);}else{logger['info'](_0x3918('0x17'),_0x511300,_0x3918('0x12'));_0x3244f6(_0x2c2305[_0x3918('0x18')]['message']);}})[_0x3918('0x19')](function(_0xf2df69){logger[_0x3918('0x14')](_0x3918('0x17'),_0x511300,_0xf2df69);_0x5d286f(_0xf2df69);});});}exports[_0x3918('0x1a')]=function(_0x19435e){var _0x4f20bc=this;return new Promise(function(_0x3ade9d,_0x50a153){return db[_0x3918('0x1b')]['create'](_0x19435e['body'],{'raw':_0x19435e[_0x3918('0x1c')]?_0x19435e[_0x3918('0x1c')][_0x3918('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x482ded){logger[_0x3918('0x10')]('CreateWhatsappMessage',_0x19435e);logger[_0x3918('0x1e')]('CreateWhatsappMessage',_0x19435e,JSON['stringify'](_0x482ded));_0x3ade9d(_0x482ded);})[_0x3918('0x19')](function(_0x1b08a9){logger['error']('CreateWhatsappMessage',_0x1b08a9[_0x3918('0x16')],_0x19435e);_0x50a153(_0x4f20bc[_0x3918('0x14')](0x1f4,_0x1b08a9[_0x3918('0x16')]));});});};
\ No newline at end of file
+var _0x8332=['CreateWhatsappMessage','WhatsappMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x2cc407,_0x184b1d){var _0x37d44d=function(_0x1db55f){while(--_0x1db55f){_0x2cc407['push'](_0x2cc407['shift']());}};_0x37d44d(++_0x184b1d);}(_0x8332,0x18b));var _0x2833=function(_0x515f91,_0x3c7964){_0x515f91=_0x515f91-0x0;var _0x1867ee=_0x8332[_0x515f91];return _0x1867ee;};'use strict';var _=require(_0x2833('0x0'));var util=require(_0x2833('0x1'));var moment=require(_0x2833('0x2'));var BPromise=require(_0x2833('0x3'));var rs=require(_0x2833('0x4'));var fs=require('fs');var Redis=require(_0x2833('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2833('0x6'))(_0x2833('0x7'));var config=require('../../config/environment');var jayson=require(_0x2833('0x8'));var client=jayson[_0x2833('0x9')][_0x2833('0xa')]({'port':0x232a});config[_0x2833('0xb')]=_[_0x2833('0xc')](config[_0x2833('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2833('0xd'))(new Redis(config[_0x2833('0xb')]));require('./whatsappMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2f2dfb,_0x18c22c,_0xdafd70){return new BPromise(function(_0x2d0579,_0x3c81c8){return client['request'](_0x2f2dfb,_0xdafd70)['then'](function(_0x5390ea){logger['info'](_0x2833('0xe'),_0x18c22c,_0x2833('0xf'));logger[_0x2833('0x10')](_0x2833('0x11'),_0x18c22c,_0x2833('0xf'),JSON[_0x2833('0x12')](_0x5390ea));if(_0x5390ea[_0x2833('0x13')]){if(_0x5390ea[_0x2833('0x13')][_0x2833('0x14')]===0x1f4){logger[_0x2833('0x13')](_0x2833('0xe'),_0x18c22c,_0x5390ea['error'][_0x2833('0x15')]);return _0x3c81c8(_0x5390ea[_0x2833('0x13')]['message']);}logger[_0x2833('0x13')](_0x2833('0xe'),_0x18c22c,_0x5390ea[_0x2833('0x13')][_0x2833('0x15')]);return _0x2d0579(_0x5390ea[_0x2833('0x13')][_0x2833('0x15')]);}else{logger[_0x2833('0x16')](_0x2833('0xe'),_0x18c22c,_0x2833('0xf'));_0x2d0579(_0x5390ea[_0x2833('0x17')][_0x2833('0x15')]);}})[_0x2833('0x18')](function(_0x9ac013){logger[_0x2833('0x13')](_0x2833('0xe'),_0x18c22c,_0x9ac013);_0x3c81c8(_0x9ac013);});});}exports[_0x2833('0x19')]=function(_0x211462){var _0x55c567=this;return new Promise(function(_0x111d09,_0x18ab04){return db[_0x2833('0x1a')][_0x2833('0x1b')](_0x211462[_0x2833('0x1c')],{'raw':_0x211462[_0x2833('0x1d')]?_0x211462['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4d1cb6){logger[_0x2833('0x16')](_0x2833('0x19'),_0x211462);logger[_0x2833('0x10')](_0x2833('0x19'),_0x211462,JSON[_0x2833('0x12')](_0x4d1cb6));_0x111d09(_0x4d1cb6);})[_0x2833('0x18')](function(_0xc9509f){logger[_0x2833('0x13')](_0x2833('0x19'),_0xc9509f['message'],_0x211462);_0x18ab04(_0x55c567[_0x2833('0x13')](0x1f4,_0xc9509f[_0x2833('0x15')]));});});};
\ No newline at end of file
index dccde38..671e562 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1709=['emit','removeListener','register','length','whatsappMessage:','save','remove'];(function(_0x609f92,_0x59c70f){var _0x33bf0f=function(_0x54317f){while(--_0x54317f){_0x609f92['push'](_0x609f92['shift']());}};_0x33bf0f(++_0x59c70f);}(_0x1709,0x155));var _0x9170=function(_0x160182,_0x4cf21a){_0x160182=_0x160182-0x0;var _0x1c1e78=_0x1709[_0x160182];return _0x1c1e78;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x9170('0x0'),_0x9170('0x1'),'update'];function createListener(_0x3ca9f7,_0x4760fb){return function(_0x44fc27){_0x4760fb[_0x9170('0x2')](_0x3ca9f7,_0x44fc27);};}function removeListener(_0x1e4bb9,_0x502799){return function(){WhatsappMessageEvents[_0x9170('0x3')](_0x1e4bb9,_0x502799);};}exports[_0x9170('0x4')]=function(_0x55e063){for(var _0x2d938c=0x0,_0x533d2d=events[_0x9170('0x5')];_0x2d938c<_0x533d2d;_0x2d938c++){var _0x506940=events[_0x2d938c];var _0x46acb0=createListener(_0x9170('0x6')+_0x506940,_0x55e063);WhatsappMessageEvents['on'](_0x506940,_0x46acb0);}};
\ No newline at end of file
+var _0xf3e6=['update','removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf3e6,0x1d2));var _0x6f3e=function(_0x771341,_0x22e7ca){_0x771341=_0x771341-0x0;var _0x2d66af=_0xf3e6[_0x771341];return _0x2d66af;};'use strict';var WhatsappMessageEvents=require(_0x6f3e('0x0'));var events=[_0x6f3e('0x1'),_0x6f3e('0x2'),_0x6f3e('0x3')];function createListener(_0x44b871,_0x269275){return function(_0x550aae){_0x269275['emit'](_0x44b871,_0x550aae);};}function removeListener(_0x450751,_0x47bb5c){return function(){WhatsappMessageEvents[_0x6f3e('0x4')](_0x450751,_0x47bb5c);};}exports['register']=function(_0x2aea30){for(var _0x1b344e=0x0,_0x28e9b1=events[_0x6f3e('0x5')];_0x1b344e<_0x28e9b1;_0x1b344e++){var _0x5410c3=events[_0x1b344e];var _0x5f22f8=createListener(_0x6f3e('0x6')+_0x5410c3,_0x2aea30);WhatsappMessageEvents['on'](_0x5410c3,_0x5f22f8);}};
\ No newline at end of file
index 1af3214..6b56261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b6=['removeTeams','delete','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','destroy'];(function(_0x47f733,_0x104342){var _0x480588=function(_0x50e534){while(--_0x50e534){_0x47f733['push'](_0x47f733['shift']());}};_0x480588(++_0x104342);}(_0x04b6,0x17d));var _0x604b=function(_0x5948dd,_0x1f6ac8){_0x5948dd=_0x5948dd-0x0;var _0xb1f8be=_0x04b6[_0x5948dd];return _0xb1f8be;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x604b('0x0'));var timeout=require('connect-timeout');var express=require(_0x604b('0x1'));var router=express[_0x604b('0x2')]();var fs_extra=require(_0x604b('0x3'));var auth=require(_0x604b('0x4'));var interaction=require(_0x604b('0x5'));var config=require(_0x604b('0x6'));var controller=require(_0x604b('0x7'));router[_0x604b('0x8')]('/',auth[_0x604b('0x9')](),controller['index']);router[_0x604b('0x8')]('/describe',auth[_0x604b('0x9')](),controller[_0x604b('0xa')]);router[_0x604b('0x8')](_0x604b('0xb'),auth[_0x604b('0x9')](),controller[_0x604b('0xc')]);router['get'](_0x604b('0xd'),auth[_0x604b('0x9')](),controller[_0x604b('0xe')]);router[_0x604b('0x8')](_0x604b('0xf'),auth[_0x604b('0x9')](),controller[_0x604b('0x10')]);router['get'](_0x604b('0x11'),auth[_0x604b('0x9')](),controller[_0x604b('0x12')]);router[_0x604b('0x13')]('/',auth['isAuthenticated'](),controller[_0x604b('0x14')]);router[_0x604b('0x13')](_0x604b('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post'](_0x604b('0x11'),auth['isAuthenticated'](),controller[_0x604b('0x15')]);router[_0x604b('0x16')](_0x604b('0xb'),auth[_0x604b('0x9')](),controller[_0x604b('0x17')]);router['delete'](_0x604b('0xb'),auth['isAuthenticated'](),controller[_0x604b('0x18')]);router['delete'](_0x604b('0xf'),auth[_0x604b('0x9')](),controller[_0x604b('0x19')]);router[_0x604b('0x1a')]('/:id/users',auth[_0x604b('0x9')](),controller[_0x604b('0x1b')]);module[_0x604b('0x1c')]=router;
\ No newline at end of file
+var _0x5498=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util'];(function(_0x10963b,_0x50d8a1){var _0x212696=function(_0x590622){while(--_0x590622){_0x10963b['push'](_0x10963b['shift']());}};_0x212696(++_0x50d8a1);}(_0x5498,0x11e));var _0x8549=function(_0xdbb511,_0x3cc4cf){_0xdbb511=_0xdbb511-0x0;var _0x1980aa=_0x5498[_0xdbb511];return _0x1980aa;};'use strict';var multer=require(_0x8549('0x0'));var util=require(_0x8549('0x1'));var path=require(_0x8549('0x2'));var timeout=require(_0x8549('0x3'));var express=require(_0x8549('0x4'));var router=express[_0x8549('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8549('0x6'));var interaction=require(_0x8549('0x7'));var config=require(_0x8549('0x8'));var controller=require(_0x8549('0x9'));router[_0x8549('0xa')]('/',auth['isAuthenticated'](),controller[_0x8549('0xb')]);router['get'](_0x8549('0xc'),auth[_0x8549('0xd')](),controller[_0x8549('0xe')]);router[_0x8549('0xa')](_0x8549('0xf'),auth[_0x8549('0xd')](),controller[_0x8549('0x10')]);router[_0x8549('0xa')](_0x8549('0x11'),auth[_0x8549('0xd')](),controller[_0x8549('0x12')]);router[_0x8549('0xa')](_0x8549('0x13'),auth[_0x8549('0xd')](),controller[_0x8549('0x14')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8549('0x15')]);router[_0x8549('0x16')]('/',auth[_0x8549('0xd')](),controller[_0x8549('0x17')]);router[_0x8549('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x8549('0x16')](_0x8549('0x18'),auth[_0x8549('0xd')](),controller[_0x8549('0x19')]);router[_0x8549('0x1a')](_0x8549('0xf'),auth['isAuthenticated'](),controller[_0x8549('0x1b')]);router['delete'](_0x8549('0xf'),auth[_0x8549('0xd')](),controller[_0x8549('0x1c')]);router['delete'](_0x8549('0x13'),auth[_0x8549('0xd')](),controller['removeTeams']);router[_0x8549('0x1d')](_0x8549('0x18'),auth[_0x8549('0xd')](),controller[_0x8549('0x1e')]);module[_0x8549('0x1f')]=router;
\ No newline at end of file
index 1fefc14..884c131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9755=['STRING','name','INTEGER','roundrobin','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9755,0x1c6));var _0x5975=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x9755[_0x2605dc];return _0x4568c9;};'use strict';var Sequelize=require(_0x5975('0x0'));module['exports']={'name':{'type':Sequelize[_0x5975('0x1')],'unique':_0x5975('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5975('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x5975('0x4'))},'description':{'type':Sequelize[_0x5975('0x1')]}};
\ No newline at end of file
+var _0xb945=['roundrobin','sequelize','STRING','INTEGER','beepall'];(function(_0x1cfdcb,_0x30bb6e){var _0x2cecd1=function(_0x2bfa1e){while(--_0x2bfa1e){_0x1cfdcb['push'](_0x1cfdcb['shift']());}};_0x2cecd1(++_0x30bb6e);}(_0xb945,0x97));var _0x5b94=function(_0x2f9226,_0x51ec7c){_0x2f9226=_0x2f9226-0x0;var _0x244843=_0xb945[_0x2f9226];return _0x244843;};'use strict';var Sequelize=require(_0x5b94('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b94('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5b94('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x5b94('0x3'),_0x5b94('0x4'))},'description':{'type':Sequelize[_0x5b94('0x1')]}};
\ No newline at end of file
index 77ef415..0e31553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e87=['undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','WhatsappQueues','error','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','rows','catch','params','filters','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','findAll','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','union','value','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','removeAgents','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','status','end','json','offset'];(function(_0x199b1f,_0x4ed849){var _0x267ac9=function(_0x184ac6){while(--_0x184ac6){_0x199b1f['push'](_0x199b1f['shift']());}};_0x267ac9(++_0x4ed849);}(_0x5e87,0x179));var _0x75e8=function(_0x4b624b,_0x39bd6b){_0x4b624b=_0x4b624b-0x0;var _0xa55bcc=_0x5e87[_0x4b624b];return _0xa55bcc;};'use strict';var emlformat=require(_0x75e8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x75e8('0x1'));var rp=require('request-promise');var moment=require(_0x75e8('0x2'));var BPromise=require(_0x75e8('0x3'));var Mustache=require(_0x75e8('0x4'));var util=require(_0x75e8('0x5'));var path=require('path');var sox=require(_0x75e8('0x6'));var csv=require(_0x75e8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x75e8('0x8'));var _=require(_0x75e8('0x9'));var squel=require('squel');var crypto=require(_0x75e8('0xa'));var jsforce=require(_0x75e8('0xb'));var deskjs=require(_0x75e8('0xc'));var toCsv=require(_0x75e8('0x7'));var querystring=require(_0x75e8('0xd'));var Papa=require(_0x75e8('0xe'));var Redis=require('ioredis');var authService=require(_0x75e8('0xf'));var qs=require(_0x75e8('0x10'));var as=require(_0x75e8('0x11'));var hardwareService=require(_0x75e8('0x12'));var logger=require('../../config/logger')(_0x75e8('0x13'));var utils=require(_0x75e8('0x14'));var config=require(_0x75e8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x75e8('0x16'))['db'];config[_0x75e8('0x17')]=_[_0x75e8('0x18')](config[_0x75e8('0x17')],{'host':_0x75e8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x75e8('0x1a'))['register'](socket);function respondWithStatusCode(_0x1ea7af,_0x402cd2){_0x402cd2=_0x402cd2||0xcc;return function(_0x1ebfd0){if(_0x1ebfd0){return _0x1ea7af['sendStatus'](_0x402cd2);}return _0x1ea7af[_0x75e8('0x1b')](_0x402cd2)[_0x75e8('0x1c')]();};}function respondWithResult(_0x35ce3e,_0x571cc5){_0x571cc5=_0x571cc5||0xc8;return function(_0x223768){if(_0x223768){return _0x35ce3e[_0x75e8('0x1b')](_0x571cc5)[_0x75e8('0x1d')](_0x223768);}};}function respondWithFilteredResult(_0x3c9e65,_0x11c071){return function(_0x24a75f){if(_0x24a75f){var _0x479438=typeof _0x11c071[_0x75e8('0x1e')]===_0x75e8('0x1f')&&typeof _0x11c071[_0x75e8('0x20')]===_0x75e8('0x1f');var _0x3e255e=_0x24a75f['count'];var _0x3d62e8=_0x479438?0x0:_0x11c071['offset'];var _0x15f216=_0x479438?_0x24a75f[_0x75e8('0x21')]:_0x11c071['offset']+_0x11c071[_0x75e8('0x20')];var _0x67d7c3;if(_0x15f216>=_0x3e255e){_0x15f216=_0x3e255e;_0x67d7c3=0xc8;}else{_0x67d7c3=0xce;}_0x3c9e65['status'](_0x67d7c3);return _0x3c9e65[_0x75e8('0x22')](_0x75e8('0x23'),_0x3d62e8+'-'+_0x15f216+'/'+_0x3e255e)[_0x75e8('0x1d')](_0x24a75f);}return null;};}function patchUpdates(_0x33c9f8){return function(_0x53e407){try{jsonpatch[_0x75e8('0x24')](_0x53e407,_0x33c9f8,!![]);}catch(_0x136d62){return BPromise['reject'](_0x136d62);}return _0x53e407['save']();};}function saveUpdates(_0x1ebdc9,_0x26bb6b){return function(_0x4e1128){if(_0x4e1128){return _0x4e1128[_0x75e8('0x25')](_0x1ebdc9)[_0x75e8('0x26')](function(_0x45c697){return _0x45c697;});}return null;};}function removeEntity(_0x2fac73,_0x322bd3){return function(_0x31cc63){if(_0x31cc63){return _0x31cc63[_0x75e8('0x27')]()['then'](function(){var _0x291008=_0x31cc63[_0x75e8('0x28')]({'plain':!![]});var _0x386456=_0x75e8('0x29');return db['UserProfileResource'][_0x75e8('0x27')]({'where':{'type':_0x386456,'resourceId':_0x291008['id']}})[_0x75e8('0x26')](function(){return _0x31cc63;});})[_0x75e8('0x26')](function(){_0x2fac73['status'](0xcc)[_0x75e8('0x1c')]();});}};}function handleEntityNotFound(_0x32f19f,_0x438b7f){return function(_0x242075){if(!_0x242075){_0x32f19f['sendStatus'](0x194);}return _0x242075;};}function handleError(_0x3fd47b,_0x7b68e6){_0x7b68e6=_0x7b68e6||0x1f4;return function(_0x101eac){logger[_0x75e8('0x2a')](_0x101eac[_0x75e8('0x2b')]);if(_0x101eac['name']){delete _0x101eac[_0x75e8('0x2c')];}_0x3fd47b['status'](_0x7b68e6)['send'](_0x101eac);};}exports[_0x75e8('0x2d')]=function(_0x479a89,_0x1ece63){var _0x2d97ed={},_0x1f171d={},_0x2e9318={'count':0x0,'rows':[]};var _0x246da6=_[_0x75e8('0x2e')](db[_0x75e8('0x2f')][_0x75e8('0x30')],function(_0x515314){return{'name':_0x515314[_0x75e8('0x31')],'type':_0x515314[_0x75e8('0x32')][_0x75e8('0x33')]};});_0x1f171d[_0x75e8('0x34')]=_['map'](_0x246da6,_0x75e8('0x2c'));_0x1f171d['query']=_[_0x75e8('0x35')](_0x479a89[_0x75e8('0x36')]);_0x1f171d['filters']=_[_0x75e8('0x37')](_0x1f171d[_0x75e8('0x34')],_0x1f171d['query']);_0x2d97ed[_0x75e8('0x38')]=_[_0x75e8('0x37')](_0x1f171d['model'],qs[_0x75e8('0x39')](_0x479a89[_0x75e8('0x36')][_0x75e8('0x39')]));_0x2d97ed[_0x75e8('0x38')]=_0x2d97ed[_0x75e8('0x38')][_0x75e8('0x3a')]?_0x2d97ed[_0x75e8('0x38')]:_0x1f171d[_0x75e8('0x34')];if(!_0x479a89[_0x75e8('0x36')][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x2d97ed[_0x75e8('0x20')]=qs[_0x75e8('0x20')](_0x479a89[_0x75e8('0x36')][_0x75e8('0x20')]);_0x2d97ed[_0x75e8('0x1e')]=qs['offset'](_0x479a89[_0x75e8('0x36')][_0x75e8('0x1e')]);}_0x2d97ed[_0x75e8('0x3d')]=qs[_0x75e8('0x3e')](_0x479a89[_0x75e8('0x36')]['sort']);_0x2d97ed['where']=qs['filters'](_[_0x75e8('0x3f')](_0x479a89[_0x75e8('0x36')],_0x1f171d['filters']),_0x246da6);if(_0x479a89[_0x75e8('0x36')]['filter']){_0x2d97ed[_0x75e8('0x40')]=_[_0x75e8('0x41')](_0x2d97ed[_0x75e8('0x40')],{'$or':_['map'](_0x246da6,function(_0x568e3a){if(_0x568e3a['type']!=='VIRTUAL'){var _0x21f3bd={};_0x21f3bd[_0x568e3a[_0x75e8('0x2c')]]={'$like':'%'+_0x479a89[_0x75e8('0x36')][_0x75e8('0x42')]+'%'};return _0x21f3bd;}})});}_0x2d97ed=_[_0x75e8('0x41')]({},_0x2d97ed,_0x479a89[_0x75e8('0x43')]);var _0x4b4f56={'where':_0x2d97ed[_0x75e8('0x40')]};return db[_0x75e8('0x2f')][_0x75e8('0x21')](_0x4b4f56)[_0x75e8('0x26')](function(_0x23ca0b){_0x2e9318['count']=_0x23ca0b;if(_0x479a89[_0x75e8('0x36')][_0x75e8('0x44')]){_0x2d97ed[_0x75e8('0x45')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x2d97ed);})['then'](function(_0x443278){_0x2e9318[_0x75e8('0x46')]=_0x443278;return _0x2e9318;})['then'](respondWithFilteredResult(_0x1ece63,_0x2d97ed))[_0x75e8('0x47')](handleError(_0x1ece63,null));};exports['show']=function(_0x4f1fc6,_0x295cc7){var _0x55f95f={'raw':!![],'where':{'id':_0x4f1fc6[_0x75e8('0x48')]['id']}},_0x47292b={};_0x47292b[_0x75e8('0x34')]=_[_0x75e8('0x35')](db[_0x75e8('0x2f')][_0x75e8('0x30')]);_0x47292b[_0x75e8('0x36')]=_[_0x75e8('0x35')](_0x4f1fc6[_0x75e8('0x36')]);_0x47292b[_0x75e8('0x49')]=_['intersection'](_0x47292b['model'],_0x47292b['query']);_0x55f95f[_0x75e8('0x38')]=_['intersection'](_0x47292b[_0x75e8('0x34')],qs[_0x75e8('0x39')](_0x4f1fc6[_0x75e8('0x36')][_0x75e8('0x39')]));_0x55f95f[_0x75e8('0x38')]=_0x55f95f[_0x75e8('0x38')][_0x75e8('0x3a')]?_0x55f95f[_0x75e8('0x38')]:_0x47292b[_0x75e8('0x34')];if(_0x4f1fc6['query']['includeAll']){_0x55f95f[_0x75e8('0x45')]=[{'all':!![]}];}_0x55f95f=_[_0x75e8('0x41')]({},_0x55f95f,_0x4f1fc6[_0x75e8('0x43')]);return db[_0x75e8('0x2f')][_0x75e8('0x4a')](_0x55f95f)['then'](handleEntityNotFound(_0x295cc7,null))[_0x75e8('0x26')](respondWithResult(_0x295cc7,null))['catch'](handleError(_0x295cc7,null));};exports[_0x75e8('0x4b')]=function(_0x4a7a1c,_0x42a3e8){return db[_0x75e8('0x2f')][_0x75e8('0x4b')](_0x4a7a1c[_0x75e8('0x4c')],{})['then'](function(_0x4249ba){var _0x4a42bb=_0x4a7a1c[_0x75e8('0x4d')][_0x75e8('0x28')]({'plain':!![]});if(!_0x4a42bb)throw new Error(_0x75e8('0x4e'));if(_0x4a42bb[_0x75e8('0x4f')]===_0x75e8('0x4d')){var _0x1594de=_0x4249ba[_0x75e8('0x28')]({'plain':!![]});var _0x5ed0f7=_0x75e8('0x29');return db[_0x75e8('0x50')]['find']({'where':{'name':_0x5ed0f7,'userProfileId':_0x4a42bb['userProfileId']},'raw':!![]})[_0x75e8('0x26')](function(_0x2f29ee){if(_0x2f29ee&&_0x2f29ee[_0x75e8('0x51')]===0x0){return db['UserProfileResource'][_0x75e8('0x4b')]({'name':_0x1594de[_0x75e8('0x2c')],'resourceId':_0x1594de['id'],'type':_0x2f29ee['name'],'sectionId':_0x2f29ee['id']},{})[_0x75e8('0x26')](function(){return _0x4249ba;});}else{return _0x4249ba;}})[_0x75e8('0x47')](function(_0x32659d){logger[_0x75e8('0x2a')](_0x75e8('0x52'),_0x32659d);throw _0x32659d;});}return _0x4249ba;})[_0x75e8('0x26')](respondWithResult(_0x42a3e8,0xc9))[_0x75e8('0x47')](handleError(_0x42a3e8,null));};exports[_0x75e8('0x25')]=function(_0x394999,_0x5c7a30){if(_0x394999['body']['id']){delete _0x394999[_0x75e8('0x4c')]['id'];}return db[_0x75e8('0x2f')]['find']({'where':{'id':_0x394999['params']['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0x5c7a30,null))['then'](saveUpdates(_0x394999['body'],null))[_0x75e8('0x26')](respondWithResult(_0x5c7a30,null))[_0x75e8('0x47')](handleError(_0x5c7a30,null));};exports['destroy']=function(_0x16c611,_0xae0fcc){return db[_0x75e8('0x2f')]['find']({'where':{'id':_0x16c611[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0xae0fcc,null))[_0x75e8('0x26')](removeEntity(_0xae0fcc,null))[_0x75e8('0x47')](handleError(_0xae0fcc,null));};exports[_0x75e8('0x53')]=function(_0x1406e8,_0x399d36){return db[_0x75e8('0x2f')][_0x75e8('0x53')]()[_0x75e8('0x26')](respondWithResult(_0x399d36,null))['catch'](handleError(_0x399d36,null));};exports[_0x75e8('0x54')]=function(_0x11876f,_0x545ae7,_0x57f8f2){var _0x114da9={'raw':!![],'where':{}},_0xa3432f={},_0x4d6bbf;return db[_0x75e8('0x2f')][_0x75e8('0x55')]({'where':{'id':_0x11876f[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0x545ae7,null))['then'](function(_0x112515){if(_0x112515){_0x4d6bbf=_0x112515[_0x75e8('0x28')]({'plain':!![]});_0xa3432f[_0x75e8('0x34')]=_[_0x75e8('0x35')](db[_0x75e8('0x56')]['rawAttributes']);_0xa3432f['query']=_['keys'](_0x11876f[_0x75e8('0x36')]);_0xa3432f[_0x75e8('0x49')]=_['intersection'](_0xa3432f['model'],_0xa3432f[_0x75e8('0x36')]);_0x114da9[_0x75e8('0x38')]=_[_0x75e8('0x37')](_0xa3432f['model'],qs['fields'](_0x11876f['query'][_0x75e8('0x39')]));_0x114da9[_0x75e8('0x38')]=_0x114da9['attributes'][_0x75e8('0x3a')]?_0x114da9[_0x75e8('0x38')]:_0xa3432f['model'];if(!_0x11876f['query'][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x114da9['limit']=qs[_0x75e8('0x20')](_0x11876f['query'][_0x75e8('0x20')]);_0x114da9['offset']=qs[_0x75e8('0x1e')](_0x11876f[_0x75e8('0x36')]['offset']);}_0x114da9['order']=qs[_0x75e8('0x3e')](_0x11876f[_0x75e8('0x36')]['sort']);_0x114da9['where']=qs[_0x75e8('0x49')](_[_0x75e8('0x3f')](_0x11876f['query'],_0xa3432f[_0x75e8('0x49')]));_0x114da9[_0x75e8('0x40')]['WhatsappQueueId']=_0x112515['id'];if(_0x11876f[_0x75e8('0x36')]['filter']){_0x114da9[_0x75e8('0x40')]=_[_0x75e8('0x41')](_0x114da9['where'],{'$or':_[_0x75e8('0x2e')](_0x114da9['attributes'],function(_0xab76e7){var _0x2fb5a0={};_0x2fb5a0[_0xab76e7]={'$like':'%'+_0x11876f[_0x75e8('0x36')][_0x75e8('0x42')]+'%'};return _0x2fb5a0;})});}_0x114da9=_[_0x75e8('0x41')]({},_0x114da9,_0x11876f[_0x75e8('0x43')]);return db[_0x75e8('0x56')][_0x75e8('0x57')](_0x114da9);}})[_0x75e8('0x26')](function(_0x44f967){if(_0x44f967){return db[_0x75e8('0x58')][_0x75e8('0x59')]({'where':{'id':_['map'](_0x44f967,_0x75e8('0x5a')),'role':'agent'},'attributes':['id',_0x75e8('0x2c'),_0x75e8('0x5b'),_0x75e8('0x5c'),_0x75e8('0x5d')]});}})['then'](function(_0x2137ac){if(_0x2137ac){return{'count':_0x2137ac[_0x75e8('0x21')],'rows':_[_0x75e8('0x2e')](_0x2137ac['rows'],function(_0x3181c6){return{'membername':_0x3181c6[_0x75e8('0x2c')],'UserId':_0x3181c6['id'],'queue_name':_0x4d6bbf[_0x75e8('0x2c')],'WhatsappQueueId':_0x4d6bbf['id'],'interface':util[_0x75e8('0x5e')](_0x75e8('0x5f'),_0x75e8('0x60'),_0x3181c6[_0x75e8('0x2c')]),'penalty':0x0,'paused':_0x3181c6[_0x75e8('0x5b')],'createdAt':_0x3181c6[_0x75e8('0x5d')],'updatedAt':_0x3181c6[_0x75e8('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x75e8('0x26')](respondWithFilteredResult(_0x545ae7,_0x114da9))[_0x75e8('0x47')](handleError(_0x545ae7,null));};exports[_0x75e8('0x61')]=function(_0x34d89b,_0x184caa,_0x367a6c){var _0x312ce8={};var _0x3820fa={};var _0x4d3ca8;var _0x341d60;return db[_0x75e8('0x2f')][_0x75e8('0x55')]({'where':{'id':_0x34d89b[_0x75e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x184caa,null))[_0x75e8('0x26')](function(_0x1fe780){if(_0x1fe780){_0x4d3ca8=_0x1fe780;_0x3820fa['model']=_[_0x75e8('0x35')](db[_0x75e8('0x62')][_0x75e8('0x30')]);_0x3820fa['query']=_[_0x75e8('0x35')](_0x34d89b[_0x75e8('0x36')]);_0x3820fa[_0x75e8('0x49')]=_[_0x75e8('0x37')](_0x3820fa['model'],_0x3820fa[_0x75e8('0x36')]);_0x312ce8['attributes']=_[_0x75e8('0x37')](_0x3820fa['model'],qs[_0x75e8('0x39')](_0x34d89b[_0x75e8('0x36')][_0x75e8('0x39')]));_0x312ce8[_0x75e8('0x38')]=_0x312ce8[_0x75e8('0x38')][_0x75e8('0x3a')]?_0x312ce8['attributes']:_0x3820fa[_0x75e8('0x34')];_0x312ce8[_0x75e8('0x3d')]=qs[_0x75e8('0x3e')](_0x34d89b[_0x75e8('0x36')][_0x75e8('0x3e')]);_0x312ce8[_0x75e8('0x40')]=qs[_0x75e8('0x49')](_[_0x75e8('0x3f')](_0x34d89b[_0x75e8('0x36')],_0x3820fa[_0x75e8('0x49')]));if(_0x34d89b['query'][_0x75e8('0x42')]){_0x312ce8['where']=_[_0x75e8('0x41')](_0x312ce8[_0x75e8('0x40')],{'$or':_['map'](_0x312ce8[_0x75e8('0x38')],function(_0x3ac8e7){var _0x8a21ad={};_0x8a21ad[_0x3ac8e7]={'$like':'%'+_0x34d89b['query'][_0x75e8('0x42')]+'%'};return _0x8a21ad;})});}_0x312ce8=_[_0x75e8('0x41')]({},_0x312ce8,_0x34d89b[_0x75e8('0x43')]);return _0x4d3ca8['getTeams'](_0x312ce8);}})['then'](function(_0x2719c8){if(_0x2719c8){_0x341d60=_0x2719c8['length'];if(!_0x34d89b['query'][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x312ce8[_0x75e8('0x20')]=qs[_0x75e8('0x20')](_0x34d89b[_0x75e8('0x36')]['limit']);_0x312ce8[_0x75e8('0x1e')]=qs['offset'](_0x34d89b[_0x75e8('0x36')]['offset']);}return _0x4d3ca8[_0x75e8('0x61')](_0x312ce8);}})[_0x75e8('0x26')](function(_0x4e4619){if(_0x4e4619){return _0x4e4619?{'count':_0x341d60,'rows':_0x4e4619}:null;}})[_0x75e8('0x26')](respondWithResult(_0x184caa,null))[_0x75e8('0x47')](handleError(_0x184caa,null));};exports[_0x75e8('0x63')]=function(_0x247b77,_0x489369,_0x591d33){var _0x38ad61=_0x247b77[_0x75e8('0x4c')][_0x75e8('0x64')];return db['Team'][_0x75e8('0x57')]({'where':{'id':_0x38ad61},'attributes':['id'],'include':[{'model':db[_0x75e8('0x58')],'as':_0x75e8('0x65'),'attributes':['id',_0x75e8('0x2c'),_0x75e8('0x66'),'voicePause',_0x75e8('0x67')],'raw':!![]}]})[_0x75e8('0x26')](function(_0x2e48d6){if(_0x2e48d6){var _0x501c10=_[_0x75e8('0x68')](_0x2e48d6,function(_0x3763b8){var _0x2804a8=_0x3763b8[_0x75e8('0x28')]({'plain':!![]});return _0x2804a8['Agents'];});return db[_0x75e8('0x2f')]['find']({'where':{'id':_0x247b77[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](function(_0x125bb1){return db['sequelize'][_0x75e8('0x69')](function(_0x17166a){return _0x125bb1[_0x75e8('0x63')](_0x38ad61,{'transaction':_0x17166a})[_0x75e8('0x26')](function(){return BPromise[_0x75e8('0x6a')](_0x501c10,function(_0x13c7e7){return db[_0x75e8('0x56')][_0x75e8('0x6b')]({'where':{'UserId':_0x13c7e7['id'],'WhatsappQueueId':_0x247b77[_0x75e8('0x48')]['id']},'transaction':_0x17166a});});})[_0x75e8('0x26')](function(){_0x501c10[_0x75e8('0x6c')](function(_0x571929){socket[_0x75e8('0x6d')]('userWhatsappQueue:save',{'UserId':_0x571929['id'],'WhatsappQueueId':_0x125bb1['id']});});});});});}})[_0x75e8('0x26')](respondWithStatusCode(_0x489369,null))['catch'](handleError(_0x489369,null));};exports[_0x75e8('0x6e')]=function(_0x478edc,_0x6b8bba,_0x4a3868){return db[_0x75e8('0x62')][_0x75e8('0x57')]({'where':{'id':_0x478edc[_0x75e8('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x75e8('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6b8bba,null))[_0x75e8('0x26')](function(_0x127e39){var _0x49836b=_['map'](_0x127e39,'id');var _0x5f1613=[];var _0x5ec4d1=[];var _0x49cb17=squel[_0x75e8('0x6f')]();_0x49cb17['field'](_0x75e8('0x70'))[_0x75e8('0x71')]('team_has_whatsapp_queues','tq')[_0x75e8('0x72')](_0x75e8('0x73'),'ut',_0x75e8('0x74'))[_0x75e8('0x40')](_0x75e8('0x75'),_0x478edc[_0x75e8('0x48')]['id']);for(var _0x3570fb=0x0;_0x3570fb<_0x127e39[_0x75e8('0x3a')];_0x3570fb+=0x1){let _0x122c42=_0x127e39[_0x3570fb];for(var _0x53a046=0x0;_0x53a046<_0x122c42[_0x75e8('0x65')][_0x75e8('0x3a')];_0x53a046+=0x1){let _0x342769=_0x122c42[_0x75e8('0x65')][_0x53a046];var _0x2e26a1=_0x49cb17[_0x75e8('0x76')]();_0x2e26a1[_0x75e8('0x40')](_0x75e8('0x77'),_0x342769['id']);_0x5ec4d1['push'](db[_0x75e8('0x78')][_0x75e8('0x36')](_0x2e26a1[_0x75e8('0x79')](),{'type':db['sequelize'][_0x75e8('0x7a')][_0x75e8('0x7b')]})[_0x75e8('0x26')](function(_0x3e343c){if(_0x3e343c[_0x75e8('0x3a')]===0x1){return _0x342769['id'];}else{var _0x35e8b0=_[_0x75e8('0x7c')](_[_0x75e8('0x2e')](_0x3e343c,'TeamId'),function(_0x1c6ac5){return _['includes'](_0x49836b,_0x1c6ac5);});if(_0x35e8b0){return _0x342769['id'];}}}));}}return BPromise['all'](_0x5ec4d1)[_0x75e8('0x26')](function(_0x498b5c){_0x5f1613=_(_0x5f1613)[_0x75e8('0x7d')](_0x498b5c)['compact']()[_0x75e8('0x7e')]();return db[_0x75e8('0x2f')][_0x75e8('0x4a')]({'where':{'id':_0x478edc[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](function(_0x39a224){return db['sequelize'][_0x75e8('0x69')](function(_0x4f8cc1){return _0x39a224[_0x75e8('0x6e')](_0x478edc[_0x75e8('0x36')]['ids'],{'transaction':_0x4f8cc1})[_0x75e8('0x26')](function(){if(!_[_0x75e8('0x7f')](_0x5f1613)){return _0x39a224['removeAgents'](_0x5f1613,{'transaction':_0x4f8cc1});}})[_0x75e8('0x26')](function(){_0x5f1613[_0x75e8('0x6c')](function(_0x13ad59){socket[_0x75e8('0x6d')](_0x75e8('0x80'),{'UserId':_0x13ad59,'WhatsappQueueId':_0x39a224['id']});});});});});});})['then'](respondWithStatusCode(_0x6b8bba,null))['catch'](handleError(_0x6b8bba,null));};exports[_0x75e8('0x81')]=function(_0x5f5afd,_0x5e1c30,_0x496691){return db[_0x75e8('0x2f')][_0x75e8('0x4a')]({'where':{'id':_0x5f5afd[_0x75e8('0x48')]['id']}})[_0x75e8('0x26')](handleEntityNotFound(_0x5e1c30,null))[_0x75e8('0x26')](function(_0x23051c){if(_0x23051c){return _0x23051c['addAgents'](_0x5f5afd[_0x75e8('0x4c')]['ids'],_[_0x75e8('0x82')](_0x5f5afd[_0x75e8('0x4c')],[_0x75e8('0x64'),'id'])||{})[_0x75e8('0x83')](function(_0x516d87){for(var _0x407915=0x0;_0x407915<_0x5f5afd['body'][_0x75e8('0x64')][_0x75e8('0x3a')];_0x407915+=0x1){socket[_0x75e8('0x6d')](_0x75e8('0x84'),{'UserId':Number(_0x5f5afd[_0x75e8('0x4c')][_0x75e8('0x64')][_0x407915]),'WhatsappQueueId':Number(_0x5f5afd[_0x75e8('0x48')]['id'])});}return _0x516d87;});}})[_0x75e8('0x26')](respondWithResult(_0x5e1c30,null))[_0x75e8('0x47')](handleError(_0x5e1c30,null));};exports[_0x75e8('0x85')]=function(_0x4f6407,_0x25a575,_0x4b6aa6){return db[_0x75e8('0x2f')][_0x75e8('0x4a')]({'where':{'id':_0x4f6407['params']['id']}})['then'](handleEntityNotFound(_0x25a575,null))['then'](function(_0x1cbced){if(_0x1cbced){return _0x1cbced[_0x75e8('0x85')](_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')])['then'](function(){if(_[_0x75e8('0x86')](_0x4f6407['query'][_0x75e8('0x64')])){for(var _0x2d5b03=0x0;_0x2d5b03<_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')][_0x75e8('0x3a')];_0x2d5b03+=0x1){socket[_0x75e8('0x6d')](_0x75e8('0x80'),{'UserId':Number(_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')][_0x2d5b03]),'WhatsappQueueId':Number(_0x4f6407[_0x75e8('0x48')]['id'])});}}else{socket['emit'](_0x75e8('0x80'),{'UserId':Number(_0x4f6407[_0x75e8('0x36')][_0x75e8('0x64')]),'WhatsappQueueId':Number(_0x4f6407['params']['id'])});}});}})['then'](respondWithStatusCode(_0x25a575,null))[_0x75e8('0x47')](handleError(_0x25a575,null));};exports[_0x75e8('0x87')]=function(_0x3d266b,_0x3f5e45,_0x4b1448){var _0x43485a={};var _0x50b5e2={};var _0x3f0e47;var _0x4c8754;return db[_0x75e8('0x2f')]['findOne']({'where':{'id':_0x3d266b[_0x75e8('0x48')]['id']}})['then'](handleEntityNotFound(_0x3f5e45,null))['then'](function(_0x4868ec){if(_0x4868ec){_0x3f0e47=_0x4868ec;_0x50b5e2[_0x75e8('0x34')]=_['keys'](db[_0x75e8('0x58')][_0x75e8('0x30')]);_0x50b5e2[_0x75e8('0x36')]=_['keys'](_0x3d266b[_0x75e8('0x36')]);_0x50b5e2[_0x75e8('0x49')]=_['intersection'](_0x50b5e2[_0x75e8('0x34')],_0x50b5e2['query']);_0x43485a[_0x75e8('0x38')]=_[_0x75e8('0x37')](_0x50b5e2['model'],qs[_0x75e8('0x39')](_0x3d266b[_0x75e8('0x36')]['fields']));_0x43485a[_0x75e8('0x38')]=_0x43485a[_0x75e8('0x38')]['length']?_0x43485a['attributes']:_0x50b5e2['model'];_0x43485a[_0x75e8('0x3d')]=qs[_0x75e8('0x3e')](_0x3d266b[_0x75e8('0x36')][_0x75e8('0x3e')]);_0x43485a[_0x75e8('0x40')]=qs[_0x75e8('0x49')](_['pick'](_0x3d266b['query'],_0x50b5e2[_0x75e8('0x49')]));if(_0x3d266b['query'][_0x75e8('0x42')]){_0x43485a['where']=_['merge'](_0x43485a[_0x75e8('0x40')],{'$or':_[_0x75e8('0x2e')](_0x43485a[_0x75e8('0x38')],function(_0x14cc25){var _0x43c9c4={};_0x43c9c4[_0x14cc25]={'$like':'%'+_0x3d266b[_0x75e8('0x36')][_0x75e8('0x42')]+'%'};return _0x43c9c4;})});}_0x43485a=_[_0x75e8('0x41')]({},_0x43485a,_0x3d266b['options']);return _0x3f0e47[_0x75e8('0x87')](_0x43485a);}})['then'](function(_0x397e29){if(_0x397e29){_0x4c8754=_0x397e29['length'];if(!_0x3d266b[_0x75e8('0x36')][_0x75e8('0x3b')](_0x75e8('0x3c'))){_0x43485a[_0x75e8('0x20')]=qs['limit'](_0x3d266b[_0x75e8('0x36')][_0x75e8('0x20')]);_0x43485a['offset']=qs[_0x75e8('0x1e')](_0x3d266b[_0x75e8('0x36')][_0x75e8('0x1e')]);}return _0x3f0e47[_0x75e8('0x87')](_0x43485a);}})[_0x75e8('0x26')](function(_0x4b9205){if(_0x4b9205){return _0x4b9205?{'count':_0x4c8754,'rows':_0x4b9205}:null;}})[_0x75e8('0x26')](respondWithResult(_0x3f5e45,null))[_0x75e8('0x47')](handleError(_0x3f5e45,null));};
\ No newline at end of file
+var _0x03c5=['../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','stack','name','send','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','order','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api'];(function(_0x1299ff,_0x132845){var _0x2d732a=function(_0x3b3d1b){while(--_0x3b3d1b){_0x1299ff['push'](_0x1299ff['shift']());}};_0x2d732a(++_0x132845);}(_0x03c5,0x76));var _0x503c=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x03c5[_0x3fba9f];return _0x192cf1;};'use strict';var emlformat=require(_0x503c('0x0'));var rimraf=require(_0x503c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x503c('0x2'));var rp=require(_0x503c('0x3'));var moment=require(_0x503c('0x4'));var BPromise=require(_0x503c('0x5'));var Mustache=require(_0x503c('0x6'));var util=require(_0x503c('0x7'));var path=require(_0x503c('0x8'));var sox=require(_0x503c('0x9'));var csv=require('to-csv');var ejs=require(_0x503c('0xa'));var fs=require('fs');var fs_extra=require(_0x503c('0xb'));var _=require('lodash');var squel=require(_0x503c('0xc'));var crypto=require(_0x503c('0xd'));var jsforce=require(_0x503c('0xe'));var deskjs=require(_0x503c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x503c('0x10'));var Redis=require(_0x503c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x503c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x503c('0x13'));var utils=require(_0x503c('0x14'));var config=require(_0x503c('0x15'));var licenseUtil=require(_0x503c('0x16'));var db=require('../../mysqldb')['db'];config[_0x503c('0x17')]=_[_0x503c('0x18')](config[_0x503c('0x17')],{'host':_0x503c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x503c('0x17')]));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x3758bd,_0x4105ad){_0x4105ad=_0x4105ad||0xcc;return function(_0x1cbbfd){if(_0x1cbbfd){return _0x3758bd[_0x503c('0x1a')](_0x4105ad);}return _0x3758bd[_0x503c('0x1b')](_0x4105ad)[_0x503c('0x1c')]();};}function respondWithResult(_0xefe127,_0x228d36){_0x228d36=_0x228d36||0xc8;return function(_0x380958){if(_0x380958){return _0xefe127[_0x503c('0x1b')](_0x228d36)[_0x503c('0x1d')](_0x380958);}};}function respondWithFilteredResult(_0x197fca,_0x36413a){return function(_0x5dc2ca){if(_0x5dc2ca){var _0x1b6f93=typeof _0x36413a[_0x503c('0x1e')]===_0x503c('0x1f')&&typeof _0x36413a[_0x503c('0x20')]==='undefined';var _0x49b73f=_0x5dc2ca[_0x503c('0x21')];var _0x38b309=_0x1b6f93?0x0:_0x36413a['offset'];var _0xe84f0c=_0x1b6f93?_0x5dc2ca['count']:_0x36413a[_0x503c('0x1e')]+_0x36413a['limit'];var _0x5460e0;if(_0xe84f0c>=_0x49b73f){_0xe84f0c=_0x49b73f;_0x5460e0=0xc8;}else{_0x5460e0=0xce;}_0x197fca['status'](_0x5460e0);return _0x197fca['set'](_0x503c('0x22'),_0x38b309+'-'+_0xe84f0c+'/'+_0x49b73f)['json'](_0x5dc2ca);}return null;};}function patchUpdates(_0x3d7742){return function(_0x5e6b7e){try{jsonpatch['apply'](_0x5e6b7e,_0x3d7742,!![]);}catch(_0x45a129){return BPromise['reject'](_0x45a129);}return _0x5e6b7e[_0x503c('0x23')]();};}function saveUpdates(_0x10dfe4,_0xeab30b){return function(_0x5a270d){if(_0x5a270d){return _0x5a270d[_0x503c('0x24')](_0x10dfe4)[_0x503c('0x25')](function(_0x38c351){return _0x38c351;});}return null;};}function removeEntity(_0x5b2647,_0x425cde){return function(_0x1ea809){if(_0x1ea809){return _0x1ea809[_0x503c('0x26')]()[_0x503c('0x25')](function(){var _0x91a20c=_0x1ea809[_0x503c('0x27')]({'plain':!![]});var _0x5eade1=_0x503c('0x28');return db[_0x503c('0x29')][_0x503c('0x26')]({'where':{'type':_0x5eade1,'resourceId':_0x91a20c['id']}})[_0x503c('0x25')](function(){return _0x1ea809;});})[_0x503c('0x25')](function(){_0x5b2647[_0x503c('0x1b')](0xcc)[_0x503c('0x1c')]();});}};}function handleEntityNotFound(_0x211156,_0xe0a4a4){return function(_0x5e64ec){if(!_0x5e64ec){_0x211156[_0x503c('0x1a')](0x194);}return _0x5e64ec;};}function handleError(_0x46b7d4,_0x13e416){_0x13e416=_0x13e416||0x1f4;return function(_0x76f4d6){logger['error'](_0x76f4d6[_0x503c('0x2a')]);if(_0x76f4d6['name']){delete _0x76f4d6[_0x503c('0x2b')];}_0x46b7d4['status'](_0x13e416)[_0x503c('0x2c')](_0x76f4d6);};}exports['index']=function(_0x1e264d,_0x584982){var _0xdc07d3={},_0x519628={},_0x14a6e4={'count':0x0,'rows':[]};var _0x113bef=_['map'](db[_0x503c('0x2d')][_0x503c('0x2e')],function(_0x553e77){return{'name':_0x553e77[_0x503c('0x2f')],'type':_0x553e77[_0x503c('0x30')][_0x503c('0x31')]};});_0x519628[_0x503c('0x32')]=_['map'](_0x113bef,'name');_0x519628[_0x503c('0x33')]=_[_0x503c('0x34')](_0x1e264d[_0x503c('0x33')]);_0x519628['filters']=_[_0x503c('0x35')](_0x519628[_0x503c('0x32')],_0x519628['query']);_0xdc07d3[_0x503c('0x36')]=_[_0x503c('0x35')](_0x519628[_0x503c('0x32')],qs[_0x503c('0x37')](_0x1e264d[_0x503c('0x33')]['fields']));_0xdc07d3[_0x503c('0x36')]=_0xdc07d3[_0x503c('0x36')][_0x503c('0x38')]?_0xdc07d3[_0x503c('0x36')]:_0x519628['model'];if(!_0x1e264d[_0x503c('0x33')][_0x503c('0x39')](_0x503c('0x3a'))){_0xdc07d3['limit']=qs[_0x503c('0x20')](_0x1e264d[_0x503c('0x33')]['limit']);_0xdc07d3[_0x503c('0x1e')]=qs[_0x503c('0x1e')](_0x1e264d['query']['offset']);}_0xdc07d3['order']=qs[_0x503c('0x3b')](_0x1e264d['query'][_0x503c('0x3b')]);_0xdc07d3[_0x503c('0x3c')]=qs['filters'](_[_0x503c('0x3d')](_0x1e264d[_0x503c('0x33')],_0x519628[_0x503c('0x3e')]),_0x113bef);if(_0x1e264d[_0x503c('0x33')][_0x503c('0x3f')]){_0xdc07d3[_0x503c('0x3c')]=_[_0x503c('0x40')](_0xdc07d3[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x113bef,function(_0x4885ea){if(_0x4885ea[_0x503c('0x30')]!==_0x503c('0x42')){var _0x5669c2={};_0x5669c2[_0x4885ea[_0x503c('0x2b')]]={'$like':'%'+_0x1e264d[_0x503c('0x33')][_0x503c('0x3f')]+'%'};return _0x5669c2;}})});}_0xdc07d3=_[_0x503c('0x40')]({},_0xdc07d3,_0x1e264d[_0x503c('0x43')]);var _0x2939f3={'where':_0xdc07d3['where']};return db[_0x503c('0x2d')][_0x503c('0x21')](_0x2939f3)['then'](function(_0x571133){_0x14a6e4[_0x503c('0x21')]=_0x571133;if(_0x1e264d[_0x503c('0x33')]['includeAll']){_0xdc07d3[_0x503c('0x44')]=[{'all':!![]}];}return db[_0x503c('0x2d')]['findAll'](_0xdc07d3);})[_0x503c('0x25')](function(_0x115427){_0x14a6e4[_0x503c('0x45')]=_0x115427;return _0x14a6e4;})[_0x503c('0x25')](respondWithFilteredResult(_0x584982,_0xdc07d3))[_0x503c('0x46')](handleError(_0x584982,null));};exports[_0x503c('0x47')]=function(_0x22e072,_0x1badfc){var _0x463690={'raw':!![],'where':{'id':_0x22e072[_0x503c('0x48')]['id']}},_0x130902={};_0x130902[_0x503c('0x32')]=_[_0x503c('0x34')](db[_0x503c('0x2d')]['rawAttributes']);_0x130902[_0x503c('0x33')]=_[_0x503c('0x34')](_0x22e072['query']);_0x130902['filters']=_['intersection'](_0x130902[_0x503c('0x32')],_0x130902[_0x503c('0x33')]);_0x463690[_0x503c('0x36')]=_[_0x503c('0x35')](_0x130902[_0x503c('0x32')],qs[_0x503c('0x37')](_0x22e072['query'][_0x503c('0x37')]));_0x463690[_0x503c('0x36')]=_0x463690[_0x503c('0x36')][_0x503c('0x38')]?_0x463690[_0x503c('0x36')]:_0x130902['model'];if(_0x22e072[_0x503c('0x33')][_0x503c('0x49')]){_0x463690[_0x503c('0x44')]=[{'all':!![]}];}_0x463690=_[_0x503c('0x40')]({},_0x463690,_0x22e072[_0x503c('0x43')]);return db[_0x503c('0x2d')]['find'](_0x463690)[_0x503c('0x25')](handleEntityNotFound(_0x1badfc,null))[_0x503c('0x25')](respondWithResult(_0x1badfc,null))[_0x503c('0x46')](handleError(_0x1badfc,null));};exports[_0x503c('0x4a')]=function(_0x5846a6,_0x46d1d3){return db[_0x503c('0x2d')][_0x503c('0x4a')](_0x5846a6[_0x503c('0x4b')],{})[_0x503c('0x25')](function(_0x218e1a){var _0x4fb29e=_0x5846a6['user'][_0x503c('0x27')]({'plain':!![]});if(!_0x4fb29e)throw new Error(_0x503c('0x4c'));if(_0x4fb29e['role']==='user'){var _0x4c7b2a=_0x218e1a[_0x503c('0x27')]({'plain':!![]});var _0x526922=_0x503c('0x28');return db[_0x503c('0x4d')][_0x503c('0x4e')]({'where':{'name':_0x526922,'userProfileId':_0x4fb29e[_0x503c('0x4f')]},'raw':!![]})[_0x503c('0x25')](function(_0x60dddb){if(_0x60dddb&&_0x60dddb['autoAssociation']===0x0){return db[_0x503c('0x29')][_0x503c('0x4a')]({'name':_0x4c7b2a[_0x503c('0x2b')],'resourceId':_0x4c7b2a['id'],'type':_0x60dddb['name'],'sectionId':_0x60dddb['id']},{})['then'](function(){return _0x218e1a;});}else{return _0x218e1a;}})[_0x503c('0x46')](function(_0x374345){logger['error'](_0x503c('0x50'),_0x374345);throw _0x374345;});}return _0x218e1a;})[_0x503c('0x25')](respondWithResult(_0x46d1d3,0xc9))['catch'](handleError(_0x46d1d3,null));};exports[_0x503c('0x24')]=function(_0x33740c,_0x70f14e){if(_0x33740c[_0x503c('0x4b')]['id']){delete _0x33740c[_0x503c('0x4b')]['id'];}return db['WhatsappQueue'][_0x503c('0x4e')]({'where':{'id':_0x33740c[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x70f14e,null))['then'](saveUpdates(_0x33740c[_0x503c('0x4b')],null))[_0x503c('0x25')](respondWithResult(_0x70f14e,null))['catch'](handleError(_0x70f14e,null));};exports['destroy']=function(_0x41517a,_0x2a17c4){return db['WhatsappQueue'][_0x503c('0x4e')]({'where':{'id':_0x41517a['params']['id']}})[_0x503c('0x25')](handleEntityNotFound(_0x2a17c4,null))['then'](removeEntity(_0x2a17c4,null))[_0x503c('0x46')](handleError(_0x2a17c4,null));};exports['describe']=function(_0x5b32d2,_0x2fde16){return db['WhatsappQueue'][_0x503c('0x51')]()[_0x503c('0x25')](respondWithResult(_0x2fde16,null))[_0x503c('0x46')](handleError(_0x2fde16,null));};exports[_0x503c('0x52')]=function(_0x5e0e16,_0x414637,_0x2fc296){var _0x4d96b3={'raw':!![],'where':{}},_0x293d28={},_0x416c65;return db[_0x503c('0x2d')]['findOne']({'where':{'id':_0x5e0e16[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x414637,null))[_0x503c('0x25')](function(_0x14b4e3){if(_0x14b4e3){_0x416c65=_0x14b4e3[_0x503c('0x27')]({'plain':!![]});_0x293d28['model']=_[_0x503c('0x34')](db[_0x503c('0x53')]['rawAttributes']);_0x293d28[_0x503c('0x33')]=_[_0x503c('0x34')](_0x5e0e16[_0x503c('0x33')]);_0x293d28[_0x503c('0x3e')]=_[_0x503c('0x35')](_0x293d28[_0x503c('0x32')],_0x293d28[_0x503c('0x33')]);_0x4d96b3['attributes']=_[_0x503c('0x35')](_0x293d28[_0x503c('0x32')],qs[_0x503c('0x37')](_0x5e0e16[_0x503c('0x33')][_0x503c('0x37')]));_0x4d96b3[_0x503c('0x36')]=_0x4d96b3['attributes']['length']?_0x4d96b3[_0x503c('0x36')]:_0x293d28['model'];if(!_0x5e0e16[_0x503c('0x33')]['hasOwnProperty']('nolimit')){_0x4d96b3['limit']=qs[_0x503c('0x20')](_0x5e0e16['query'][_0x503c('0x20')]);_0x4d96b3[_0x503c('0x1e')]=qs[_0x503c('0x1e')](_0x5e0e16['query'][_0x503c('0x1e')]);}_0x4d96b3[_0x503c('0x54')]=qs['sort'](_0x5e0e16['query']['sort']);_0x4d96b3[_0x503c('0x3c')]=qs['filters'](_['pick'](_0x5e0e16[_0x503c('0x33')],_0x293d28[_0x503c('0x3e')]));_0x4d96b3[_0x503c('0x3c')][_0x503c('0x55')]=_0x14b4e3['id'];if(_0x5e0e16[_0x503c('0x33')][_0x503c('0x3f')]){_0x4d96b3[_0x503c('0x3c')]=_[_0x503c('0x40')](_0x4d96b3[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x4d96b3[_0x503c('0x36')],function(_0x20972b){var _0x25848c={};_0x25848c[_0x20972b]={'$like':'%'+_0x5e0e16[_0x503c('0x33')][_0x503c('0x3f')]+'%'};return _0x25848c;})});}_0x4d96b3=_[_0x503c('0x40')]({},_0x4d96b3,_0x5e0e16[_0x503c('0x43')]);return db['UserWhatsappQueue']['findAll'](_0x4d96b3);}})[_0x503c('0x25')](function(_0x5bc0ff){if(_0x5bc0ff){return db[_0x503c('0x56')][_0x503c('0x57')]({'where':{'id':_[_0x503c('0x41')](_0x5bc0ff,_0x503c('0x58')),'role':_0x503c('0x59')},'attributes':['id','name',_0x503c('0x5a'),_0x503c('0x5b'),_0x503c('0x5c')]});}})[_0x503c('0x25')](function(_0x5898c9){if(_0x5898c9){return{'count':_0x5898c9[_0x503c('0x21')],'rows':_[_0x503c('0x41')](_0x5898c9[_0x503c('0x45')],function(_0x1a946d){return{'membername':_0x1a946d['name'],'UserId':_0x1a946d['id'],'queue_name':_0x416c65['name'],'WhatsappQueueId':_0x416c65['id'],'interface':util[_0x503c('0x5d')](_0x503c('0x5e'),_0x503c('0x5f'),_0x1a946d[_0x503c('0x2b')]),'penalty':0x0,'paused':_0x1a946d[_0x503c('0x5a')],'createdAt':_0x1a946d[_0x503c('0x5c')],'updatedAt':_0x1a946d[_0x503c('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x414637,_0x4d96b3))[_0x503c('0x46')](handleError(_0x414637,null));};exports['getTeams']=function(_0x1358d6,_0xddbed0,_0x31a58a){var _0x513a4b={};var _0x5f0efa={};var _0x4126fc;var _0x227e1e;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1358d6[_0x503c('0x48')]['id']}})[_0x503c('0x25')](handleEntityNotFound(_0xddbed0,null))[_0x503c('0x25')](function(_0x58d120){if(_0x58d120){_0x4126fc=_0x58d120;_0x5f0efa[_0x503c('0x32')]=_['keys'](db[_0x503c('0x60')][_0x503c('0x2e')]);_0x5f0efa[_0x503c('0x33')]=_[_0x503c('0x34')](_0x1358d6[_0x503c('0x33')]);_0x5f0efa[_0x503c('0x3e')]=_[_0x503c('0x35')](_0x5f0efa['model'],_0x5f0efa[_0x503c('0x33')]);_0x513a4b['attributes']=_[_0x503c('0x35')](_0x5f0efa[_0x503c('0x32')],qs[_0x503c('0x37')](_0x1358d6['query'][_0x503c('0x37')]));_0x513a4b[_0x503c('0x36')]=_0x513a4b[_0x503c('0x36')][_0x503c('0x38')]?_0x513a4b[_0x503c('0x36')]:_0x5f0efa[_0x503c('0x32')];_0x513a4b[_0x503c('0x54')]=qs[_0x503c('0x3b')](_0x1358d6['query']['sort']);_0x513a4b[_0x503c('0x3c')]=qs[_0x503c('0x3e')](_[_0x503c('0x3d')](_0x1358d6['query'],_0x5f0efa[_0x503c('0x3e')]));if(_0x1358d6['query'][_0x503c('0x3f')]){_0x513a4b['where']=_['merge'](_0x513a4b[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x513a4b[_0x503c('0x36')],function(_0x44c42e){var _0x4a96a6={};_0x4a96a6[_0x44c42e]={'$like':'%'+_0x1358d6['query'][_0x503c('0x3f')]+'%'};return _0x4a96a6;})});}_0x513a4b=_[_0x503c('0x40')]({},_0x513a4b,_0x1358d6['options']);return _0x4126fc[_0x503c('0x61')](_0x513a4b);}})[_0x503c('0x25')](function(_0x5f5baf){if(_0x5f5baf){_0x227e1e=_0x5f5baf[_0x503c('0x38')];if(!_0x1358d6['query']['hasOwnProperty'](_0x503c('0x3a'))){_0x513a4b['limit']=qs[_0x503c('0x20')](_0x1358d6[_0x503c('0x33')][_0x503c('0x20')]);_0x513a4b[_0x503c('0x1e')]=qs[_0x503c('0x1e')](_0x1358d6[_0x503c('0x33')][_0x503c('0x1e')]);}return _0x4126fc[_0x503c('0x61')](_0x513a4b);}})[_0x503c('0x25')](function(_0x336418){if(_0x336418){return _0x336418?{'count':_0x227e1e,'rows':_0x336418}:null;}})['then'](respondWithResult(_0xddbed0,null))[_0x503c('0x46')](handleError(_0xddbed0,null));};exports[_0x503c('0x62')]=function(_0x32b21a,_0x28b155,_0x194309){var _0xdfce53=_0x32b21a['body'][_0x503c('0x63')];return db[_0x503c('0x60')][_0x503c('0x64')]({'where':{'id':_0xdfce53},'attributes':['id'],'include':[{'model':db['User'],'as':_0x503c('0x65'),'attributes':['id',_0x503c('0x2b'),_0x503c('0x66'),_0x503c('0x67'),_0x503c('0x68')],'raw':!![]}]})[_0x503c('0x25')](function(_0x1e2924){if(_0x1e2924){var _0x8c7c2=_[_0x503c('0x69')](_0x1e2924,function(_0x19899d){var _0x30de93=_0x19899d[_0x503c('0x27')]({'plain':!![]});return _0x30de93[_0x503c('0x65')];});return db['WhatsappQueue'][_0x503c('0x4e')]({'where':{'id':_0x32b21a[_0x503c('0x48')]['id']}})[_0x503c('0x25')](function(_0x2733ae){return db[_0x503c('0x6a')][_0x503c('0x6b')](function(_0x848887){return _0x2733ae['addTeams'](_0xdfce53,{'transaction':_0x848887})[_0x503c('0x25')](function(){return BPromise[_0x503c('0x6c')](_0x8c7c2,function(_0x533b38){return db[_0x503c('0x53')][_0x503c('0x6d')]({'where':{'UserId':_0x533b38['id'],'WhatsappQueueId':_0x32b21a[_0x503c('0x48')]['id']},'transaction':_0x848887});});})[_0x503c('0x25')](function(){_0x8c7c2[_0x503c('0x6e')](function(_0x37703d){socket[_0x503c('0x6f')](_0x503c('0x70'),{'UserId':_0x37703d['id'],'WhatsappQueueId':_0x2733ae['id']});});});});});}})[_0x503c('0x25')](respondWithStatusCode(_0x28b155,null))[_0x503c('0x46')](handleError(_0x28b155,null));};exports[_0x503c('0x71')]=function(_0x2b1856,_0x1578e5,_0x5d2fc5){return db[_0x503c('0x60')][_0x503c('0x64')]({'where':{'id':_0x2b1856[_0x503c('0x33')][_0x503c('0x63')]},'attributes':['id'],'include':[{'model':db[_0x503c('0x56')],'as':_0x503c('0x65'),'attributes':['id'],'raw':!![]}]})[_0x503c('0x25')](handleEntityNotFound(_0x1578e5,null))[_0x503c('0x25')](function(_0x3b5445){var _0x3d382b=_[_0x503c('0x41')](_0x3b5445,'id');var _0x932723=[];var _0x5445ad=[];var _0x57164e=squel[_0x503c('0x72')]();_0x57164e[_0x503c('0x73')](_0x503c('0x74'))[_0x503c('0x75')]('team_has_whatsapp_queues','tq')[_0x503c('0x76')](_0x503c('0x77'),'ut',_0x503c('0x78'))[_0x503c('0x3c')](_0x503c('0x79'),_0x2b1856[_0x503c('0x48')]['id']);for(var _0x533493=0x0;_0x533493<_0x3b5445[_0x503c('0x38')];_0x533493+=0x1){let _0x2f7616=_0x3b5445[_0x533493];for(var _0x19c716=0x0;_0x19c716<_0x2f7616[_0x503c('0x65')]['length'];_0x19c716+=0x1){let _0x5861be=_0x2f7616[_0x503c('0x65')][_0x19c716];var _0x528b4f=_0x57164e['clone']();_0x528b4f['where'](_0x503c('0x7a'),_0x5861be['id']);_0x5445ad[_0x503c('0x7b')](db[_0x503c('0x6a')][_0x503c('0x33')](_0x528b4f[_0x503c('0x7c')](),{'type':db[_0x503c('0x6a')][_0x503c('0x7d')][_0x503c('0x7e')]})[_0x503c('0x25')](function(_0x5d670e){if(_0x5d670e['length']===0x1){return _0x5861be['id'];}else{var _0x4acdf5=_[_0x503c('0x7f')](_[_0x503c('0x41')](_0x5d670e,'TeamId'),function(_0xc238d9){return _['includes'](_0x3d382b,_0xc238d9);});if(_0x4acdf5){return _0x5861be['id'];}}}));}}return BPromise[_0x503c('0x80')](_0x5445ad)[_0x503c('0x25')](function(_0x58b3ee){_0x932723=_(_0x932723)[_0x503c('0x81')](_0x58b3ee)['compact']()['value']();return db[_0x503c('0x2d')][_0x503c('0x4e')]({'where':{'id':_0x2b1856['params']['id']}})[_0x503c('0x25')](function(_0xd17438){return db[_0x503c('0x6a')][_0x503c('0x6b')](function(_0x3e000f){return _0xd17438[_0x503c('0x71')](_0x2b1856[_0x503c('0x33')][_0x503c('0x63')],{'transaction':_0x3e000f})[_0x503c('0x25')](function(){if(!_['isEmpty'](_0x932723)){return _0xd17438[_0x503c('0x82')](_0x932723,{'transaction':_0x3e000f});}})[_0x503c('0x25')](function(){_0x932723[_0x503c('0x6e')](function(_0x4ca847){socket[_0x503c('0x6f')](_0x503c('0x83'),{'UserId':_0x4ca847,'WhatsappQueueId':_0xd17438['id']});});});});});});})[_0x503c('0x25')](respondWithStatusCode(_0x1578e5,null))[_0x503c('0x46')](handleError(_0x1578e5,null));};exports[_0x503c('0x84')]=function(_0x2fc153,_0x59a921,_0x1b5562){return db[_0x503c('0x2d')][_0x503c('0x4e')]({'where':{'id':_0x2fc153[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x59a921,null))[_0x503c('0x25')](function(_0x26ecf9){if(_0x26ecf9){return _0x26ecf9[_0x503c('0x84')](_0x2fc153[_0x503c('0x4b')]['ids'],_[_0x503c('0x85')](_0x2fc153['body'],[_0x503c('0x63'),'id'])||{})[_0x503c('0x86')](function(_0x3d4f82){for(var _0x4cb39d=0x0;_0x4cb39d<_0x2fc153['body'][_0x503c('0x63')][_0x503c('0x38')];_0x4cb39d+=0x1){socket[_0x503c('0x6f')](_0x503c('0x70'),{'UserId':Number(_0x2fc153[_0x503c('0x4b')][_0x503c('0x63')][_0x4cb39d]),'WhatsappQueueId':Number(_0x2fc153['params']['id'])});}return _0x3d4f82;});}})['then'](respondWithResult(_0x59a921,null))[_0x503c('0x46')](handleError(_0x59a921,null));};exports[_0x503c('0x82')]=function(_0x2366e1,_0x214e3e,_0x323c20){return db[_0x503c('0x2d')][_0x503c('0x4e')]({'where':{'id':_0x2366e1[_0x503c('0x48')]['id']}})[_0x503c('0x25')](handleEntityNotFound(_0x214e3e,null))[_0x503c('0x25')](function(_0x47a23e){if(_0x47a23e){return _0x47a23e[_0x503c('0x82')](_0x2366e1[_0x503c('0x33')][_0x503c('0x63')])['then'](function(){if(_[_0x503c('0x87')](_0x2366e1[_0x503c('0x33')][_0x503c('0x63')])){for(var _0x9ea1df=0x0;_0x9ea1df<_0x2366e1[_0x503c('0x33')][_0x503c('0x63')][_0x503c('0x38')];_0x9ea1df+=0x1){socket[_0x503c('0x6f')](_0x503c('0x83'),{'UserId':Number(_0x2366e1[_0x503c('0x33')][_0x503c('0x63')][_0x9ea1df]),'WhatsappQueueId':Number(_0x2366e1['params']['id'])});}}else{socket[_0x503c('0x6f')](_0x503c('0x83'),{'UserId':Number(_0x2366e1[_0x503c('0x33')][_0x503c('0x63')]),'WhatsappQueueId':Number(_0x2366e1[_0x503c('0x48')]['id'])});}});}})[_0x503c('0x25')](respondWithStatusCode(_0x214e3e,null))[_0x503c('0x46')](handleError(_0x214e3e,null));};exports[_0x503c('0x88')]=function(_0x5d2683,_0x225c48,_0x59acab){var _0x4a8db1={};var _0x45de2d={};var _0x15a484;var _0x289d13;return db[_0x503c('0x2d')][_0x503c('0x89')]({'where':{'id':_0x5d2683[_0x503c('0x48')]['id']}})['then'](handleEntityNotFound(_0x225c48,null))[_0x503c('0x25')](function(_0x1181ee){if(_0x1181ee){_0x15a484=_0x1181ee;_0x45de2d[_0x503c('0x32')]=_[_0x503c('0x34')](db[_0x503c('0x56')]['rawAttributes']);_0x45de2d[_0x503c('0x33')]=_[_0x503c('0x34')](_0x5d2683[_0x503c('0x33')]);_0x45de2d[_0x503c('0x3e')]=_[_0x503c('0x35')](_0x45de2d[_0x503c('0x32')],_0x45de2d[_0x503c('0x33')]);_0x4a8db1[_0x503c('0x36')]=_['intersection'](_0x45de2d[_0x503c('0x32')],qs[_0x503c('0x37')](_0x5d2683[_0x503c('0x33')]['fields']));_0x4a8db1['attributes']=_0x4a8db1['attributes'][_0x503c('0x38')]?_0x4a8db1[_0x503c('0x36')]:_0x45de2d[_0x503c('0x32')];_0x4a8db1[_0x503c('0x54')]=qs[_0x503c('0x3b')](_0x5d2683[_0x503c('0x33')][_0x503c('0x3b')]);_0x4a8db1[_0x503c('0x3c')]=qs[_0x503c('0x3e')](_[_0x503c('0x3d')](_0x5d2683[_0x503c('0x33')],_0x45de2d[_0x503c('0x3e')]));if(_0x5d2683[_0x503c('0x33')][_0x503c('0x3f')]){_0x4a8db1[_0x503c('0x3c')]=_['merge'](_0x4a8db1[_0x503c('0x3c')],{'$or':_[_0x503c('0x41')](_0x4a8db1[_0x503c('0x36')],function(_0x1f12d0){var _0x3c659d={};_0x3c659d[_0x1f12d0]={'$like':'%'+_0x5d2683[_0x503c('0x33')][_0x503c('0x3f')]+'%'};return _0x3c659d;})});}_0x4a8db1=_[_0x503c('0x40')]({},_0x4a8db1,_0x5d2683['options']);return _0x15a484[_0x503c('0x88')](_0x4a8db1);}})[_0x503c('0x25')](function(_0x14cc17){if(_0x14cc17){_0x289d13=_0x14cc17[_0x503c('0x38')];if(!_0x5d2683['query']['hasOwnProperty']('nolimit')){_0x4a8db1[_0x503c('0x20')]=qs[_0x503c('0x20')](_0x5d2683['query']['limit']);_0x4a8db1['offset']=qs[_0x503c('0x1e')](_0x5d2683[_0x503c('0x33')][_0x503c('0x1e')]);}return _0x15a484[_0x503c('0x88')](_0x4a8db1);}})[_0x503c('0x25')](function(_0x27e096){if(_0x27e096){return _0x27e096?{'count':_0x289d13,'rows':_0x27e096}:null;}})['then'](respondWithResult(_0x225c48,null))[_0x503c('0x46')](handleError(_0x225c48,null));};
\ No newline at end of file
index 030808d..de0484b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e61=['hasOwnProperty','hook','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x3e61,0x124));var _0x13e6=function(_0x5368e6,_0x26307d){_0x5368e6=_0x5368e6-0x0;var _0x4a3cc4=_0x3e61[_0x5368e6];return _0x4a3cc4;};'use strict';var EventEmitter=require(_0x13e6('0x0'));var WhatsappQueue=require(_0x13e6('0x1'))['db'][_0x13e6('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x13e6('0x3')](0x0);var events={'afterCreate':_0x13e6('0x4'),'afterUpdate':_0x13e6('0x5'),'afterDestroy':_0x13e6('0x6')};function emitEvent(_0x19218c){return function(_0x1e40a1,_0x1576c0,_0x3c5122){WhatsappQueueEvents[_0x13e6('0x7')](_0x19218c+':'+_0x1e40a1['id'],_0x1e40a1);WhatsappQueueEvents['emit'](_0x19218c,_0x1e40a1);_0x3c5122(null);};}for(var e in events){if(events[_0x13e6('0x8')](e)){var event=events[e];WhatsappQueue[_0x13e6('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
+var _0x04a8=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x453503,_0x216c0d){var _0x587f85=function(_0x9c1ab1){while(--_0x9c1ab1){_0x453503['push'](_0x453503['shift']());}};_0x587f85(++_0x216c0d);}(_0x04a8,0xa7));var _0x804a=function(_0x580e4e,_0x35ff54){_0x580e4e=_0x580e4e-0x0;var _0x42b6ed=_0x04a8[_0x580e4e];return _0x42b6ed;};'use strict';var EventEmitter=require(_0x804a('0x0'));var WhatsappQueue=require(_0x804a('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x804a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x804a('0x3'),'afterDestroy':_0x804a('0x4')};function emitEvent(_0x1025be){return function(_0x531e58,_0x85e444,_0x4f2d37){WhatsappQueueEvents[_0x804a('0x5')](_0x1025be+':'+_0x531e58['id'],_0x531e58);WhatsappQueueEvents[_0x804a('0x5')](_0x1025be,_0x531e58);_0x4f2d37(null);};}for(var e in events){if(events[_0x804a('0x6')](e)){var event=events[e];WhatsappQueue[_0x804a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
index c0f7eb1..08e24ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa38c=['moment','bluebird','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','api'];(function(_0x2d945f,_0x3820a0){var _0x12cc68=function(_0x545625){while(--_0x545625){_0x2d945f['push'](_0x2d945f['shift']());}};_0x12cc68(++_0x3820a0);}(_0xa38c,0x189));var _0xca38=function(_0x4c2537,_0x20afdf){_0x4c2537=_0x4c2537-0x0;var _0x94fb5c=_0xa38c[_0x4c2537];return _0x94fb5c;};'use strict';var _=require(_0xca38('0x0'));var util=require('util');var logger=require(_0xca38('0x1'))(_0xca38('0x2'));var moment=require(_0xca38('0x3'));var BPromise=require(_0xca38('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xca38('0x5'));var config=require('../../config/environment');var attributes=require(_0xca38('0x6'));module[_0xca38('0x7')]=function(_0x13e7ae,_0x5e4a1c){return _0x13e7ae[_0xca38('0x8')](_0xca38('0x9'),attributes,{'tableName':_0xca38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc8f9=['moment','bluebird','request-promise','../../config/environment','exports','define','WhatsappQueue','lodash','util','../../config/logger'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xc8f9,0x89));var _0x9c8f=function(_0x29028d,_0x3537b8){_0x29028d=_0x29028d-0x0;var _0x19ca96=_0xc8f9[_0x29028d];return _0x19ca96;};'use strict';var _=require(_0x9c8f('0x0'));var util=require(_0x9c8f('0x1'));var logger=require(_0x9c8f('0x2'))('api');var moment=require(_0x9c8f('0x3'));var BPromise=require(_0x9c8f('0x4'));var rp=require(_0x9c8f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9c8f('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0x9c8f('0x7')]=function(_0x77ecd0,_0x45afb8){return _0x77ecd0[_0x9c8f('0x8')](_0x9c8f('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a5b6ce..6ce7e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x197a=['result','catch','GetWhatsappQueue','findAll','options','attributes','include','map','model','stringify','ShowWhatsappQueue','find','raw','where','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x31619a,_0x421647){var _0x525439=function(_0x17cd03){while(--_0x17cd03){_0x31619a['push'](_0x31619a['shift']());}};_0x525439(++_0x421647);}(_0x197a,0x126));var _0xa197=function(_0x54c9dd,_0x233a86){_0x54c9dd=_0x54c9dd-0x0;var _0x855156=_0x197a[_0x54c9dd];return _0x855156;};'use strict';var _=require(_0xa197('0x0'));var util=require(_0xa197('0x1'));var moment=require(_0xa197('0x2'));var BPromise=require('bluebird');var rs=require(_0xa197('0x3'));var fs=require('fs');var Redis=require(_0xa197('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa197('0x5'));var logger=require(_0xa197('0x6'))(_0xa197('0x7'));var config=require(_0xa197('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa197('0x9')][_0xa197('0xa')]({'port':0x232a});config[_0xa197('0xb')]=_[_0xa197('0xc')](config[_0xa197('0xb')],{'host':_0xa197('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa197('0xb')]));require(_0xa197('0xe'))[_0xa197('0xf')](socket);function respondWithRpcPromise(_0x88b9f1,_0x4740a7,_0x3dadab){return new BPromise(function(_0x1b278c,_0x20fabd){return client[_0xa197('0x10')](_0x88b9f1,_0x3dadab)[_0xa197('0x11')](function(_0xedbe69){logger[_0xa197('0x12')](_0xa197('0x13'),_0x4740a7,_0xa197('0x14'));logger[_0xa197('0x15')](_0xa197('0x16'),_0x4740a7,_0xa197('0x14'),JSON['stringify'](_0xedbe69));if(_0xedbe69[_0xa197('0x17')]){if(_0xedbe69[_0xa197('0x17')][_0xa197('0x18')]===0x1f4){logger[_0xa197('0x17')](_0xa197('0x13'),_0x4740a7,_0xedbe69[_0xa197('0x17')][_0xa197('0x19')]);return _0x20fabd(_0xedbe69[_0xa197('0x17')][_0xa197('0x19')]);}logger[_0xa197('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x4740a7,_0xedbe69[_0xa197('0x17')][_0xa197('0x19')]);return _0x1b278c(_0xedbe69['error'][_0xa197('0x19')]);}else{logger[_0xa197('0x12')](_0xa197('0x13'),_0x4740a7,_0xa197('0x14'));_0x1b278c(_0xedbe69[_0xa197('0x1a')][_0xa197('0x19')]);}})[_0xa197('0x1b')](function(_0x1c6088){logger[_0xa197('0x17')](_0xa197('0x13'),_0x4740a7,_0x1c6088);_0x20fabd(_0x1c6088);});});}exports[_0xa197('0x1c')]=function(_0x2ee91c){var _0x262fd6=this;return new Promise(function(_0xecec7c,_0x1f15be){return db['WhatsappQueue'][_0xa197('0x1d')]({'raw':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c[_0xa197('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c['options']['where']||null:null,'attributes':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c['options'][_0xa197('0x1f')]||null:null,'limit':_0x2ee91c[_0xa197('0x1e')]?_0x2ee91c[_0xa197('0x1e')]['limit']||null:null,'include':_0x2ee91c['options']?_0x2ee91c[_0xa197('0x1e')][_0xa197('0x20')]?_[_0xa197('0x21')](_0x2ee91c[_0xa197('0x1e')][_0xa197('0x20')],function(_0x1cb2a2){return{'model':db[_0x1cb2a2[_0xa197('0x22')]],'as':_0x1cb2a2['as'],'attributes':_0x1cb2a2['attributes'],'include':_0x1cb2a2['include']?_[_0xa197('0x21')](_0x1cb2a2[_0xa197('0x20')],function(_0x8ba3e8){return{'model':db[_0x8ba3e8[_0xa197('0x22')]],'as':_0x8ba3e8['as'],'attributes':_0x8ba3e8[_0xa197('0x1f')],'include':_0x8ba3e8[_0xa197('0x20')]?_[_0xa197('0x21')](_0x8ba3e8[_0xa197('0x20')],function(_0xe6e6ee){return{'model':db[_0xe6e6ee[_0xa197('0x22')]],'as':_0xe6e6ee['as'],'attributes':_0xe6e6ee['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd686b5){logger[_0xa197('0x12')](_0xa197('0x1c'),_0x2ee91c);logger['debug']('GetWhatsappQueue',_0x2ee91c,JSON[_0xa197('0x23')](_0xd686b5));_0xecec7c(_0xd686b5);})['catch'](function(_0x14ac49){logger[_0xa197('0x17')](_0xa197('0x1c'),_0x14ac49[_0xa197('0x19')],_0x2ee91c);_0x1f15be(_0x262fd6[_0xa197('0x17')](0x1f4,_0x14ac49['message']));});});};exports[_0xa197('0x24')]=function(_0x52f4dc){var _0x37337a=this;return new Promise(function(_0x415f7b,_0x248ddd){return db['WhatsappQueue'][_0xa197('0x25')]({'raw':_0x52f4dc[_0xa197('0x1e')]?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x26')]===undefined?!![]:![]:!![],'where':_0x52f4dc[_0xa197('0x1e')]?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x27')]||null:null,'attributes':_0x52f4dc['options']?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x1f')]||null:null,'include':_0x52f4dc['options']?_0x52f4dc[_0xa197('0x1e')][_0xa197('0x20')]?_[_0xa197('0x21')](_0x52f4dc[_0xa197('0x1e')][_0xa197('0x20')],function(_0x1e8d7f){return{'model':db[_0x1e8d7f[_0xa197('0x22')]],'as':_0x1e8d7f['as'],'attributes':_0x1e8d7f[_0xa197('0x1f')],'include':_0x1e8d7f[_0xa197('0x20')]?_[_0xa197('0x21')](_0x1e8d7f[_0xa197('0x20')],function(_0xa33ad){return{'model':db[_0xa33ad[_0xa197('0x22')]],'as':_0xa33ad['as'],'attributes':_0xa33ad[_0xa197('0x1f')],'include':_0xa33ad[_0xa197('0x20')]?_['map'](_0xa33ad['include'],function(_0x1dcc0e){return{'model':db[_0x1dcc0e[_0xa197('0x22')]],'as':_0x1dcc0e['as'],'attributes':_0x1dcc0e[_0xa197('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa197('0x11')](function(_0x486ae5){logger[_0xa197('0x12')](_0xa197('0x24'),_0x52f4dc);logger['debug'](_0xa197('0x24'),_0x52f4dc,JSON['stringify'](_0x486ae5));_0x415f7b(_0x486ae5);})[_0xa197('0x1b')](function(_0x11a349){logger[_0xa197('0x17')](_0xa197('0x24'),_0x11a349['message'],_0x52f4dc);_0x248ddd(_0x37337a[_0xa197('0x17')](0x1f4,_0x11a349['message']));});});};
\ No newline at end of file
+var _0xf3a7=['then','find','ShowWhatsappQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetWhatsappQueue','options','raw','where','attributes','limit','include','map','model'];(function(_0x2644ec,_0x46eb68){var _0x21754a=function(_0x3dee25){while(--_0x3dee25){_0x2644ec['push'](_0x2644ec['shift']());}};_0x21754a(++_0x46eb68);}(_0xf3a7,0x10d));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x7f3a('0x0'));var util=require(_0x7f3a('0x1'));var moment=require(_0x7f3a('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f3a('0x3'));var fs=require('fs');var Redis=require(_0x7f3a('0x4'));var db=require(_0x7f3a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f3a('0x6'))(_0x7f3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f3a('0x8'));var client=jayson[_0x7f3a('0x9')][_0x7f3a('0xa')]({'port':0x232a});config[_0x7f3a('0xb')]=_[_0x7f3a('0xc')](config[_0x7f3a('0xb')],{'host':_0x7f3a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f3a('0xb')]));require(_0x7f3a('0xe'))[_0x7f3a('0xf')](socket);function respondWithRpcPromise(_0x5c34c4,_0x5e2cf2,_0x3f8736){return new BPromise(function(_0x258c93,_0x26fe5f){return client[_0x7f3a('0x10')](_0x5c34c4,_0x3f8736)['then'](function(_0x5c44a7){logger[_0x7f3a('0x11')](_0x7f3a('0x12'),_0x5e2cf2,_0x7f3a('0x13'));logger[_0x7f3a('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x5e2cf2,_0x7f3a('0x13'),JSON[_0x7f3a('0x15')](_0x5c44a7));if(_0x5c44a7['error']){if(_0x5c44a7['error'][_0x7f3a('0x16')]===0x1f4){logger[_0x7f3a('0x17')](_0x7f3a('0x12'),_0x5e2cf2,_0x5c44a7[_0x7f3a('0x17')][_0x7f3a('0x18')]);return _0x26fe5f(_0x5c44a7[_0x7f3a('0x17')][_0x7f3a('0x18')]);}logger[_0x7f3a('0x17')](_0x7f3a('0x12'),_0x5e2cf2,_0x5c44a7[_0x7f3a('0x17')][_0x7f3a('0x18')]);return _0x258c93(_0x5c44a7['error'][_0x7f3a('0x18')]);}else{logger[_0x7f3a('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x5e2cf2,_0x7f3a('0x13'));_0x258c93(_0x5c44a7['result'][_0x7f3a('0x18')]);}})[_0x7f3a('0x19')](function(_0x38094f){logger[_0x7f3a('0x17')](_0x7f3a('0x12'),_0x5e2cf2,_0x38094f);_0x26fe5f(_0x38094f);});});}exports[_0x7f3a('0x1a')]=function(_0x3e2b75){var _0x57af9a=this;return new Promise(function(_0x5d0bda,_0x3ee093){return db['WhatsappQueue']['findAll']({'raw':_0x3e2b75['options']?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1d')]||null:null,'attributes':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1e')]||null:null,'limit':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x1f')]||null:null,'include':_0x3e2b75[_0x7f3a('0x1b')]?_0x3e2b75[_0x7f3a('0x1b')][_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x3e2b75['options'][_0x7f3a('0x20')],function(_0x12fbcb){return{'model':db[_0x12fbcb[_0x7f3a('0x22')]],'as':_0x12fbcb['as'],'attributes':_0x12fbcb['attributes'],'include':_0x12fbcb[_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x12fbcb[_0x7f3a('0x20')],function(_0x4697d7){return{'model':db[_0x4697d7['model']],'as':_0x4697d7['as'],'attributes':_0x4697d7['attributes'],'include':_0x4697d7['include']?_['map'](_0x4697d7[_0x7f3a('0x20')],function(_0x4c2d8a){return{'model':db[_0x4c2d8a[_0x7f3a('0x22')]],'as':_0x4c2d8a['as'],'attributes':_0x4c2d8a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7f3a('0x23')](function(_0x3e8112){logger[_0x7f3a('0x11')]('GetWhatsappQueue',_0x3e2b75);logger['debug'](_0x7f3a('0x1a'),_0x3e2b75,JSON[_0x7f3a('0x15')](_0x3e8112));_0x5d0bda(_0x3e8112);})['catch'](function(_0x202b70){logger[_0x7f3a('0x17')](_0x7f3a('0x1a'),_0x202b70[_0x7f3a('0x18')],_0x3e2b75);_0x3ee093(_0x57af9a[_0x7f3a('0x17')](0x1f4,_0x202b70['message']));});});};exports['ShowWhatsappQueue']=function(_0x45f43f){var _0x2b9537=this;return new Promise(function(_0x1c61f8,_0x340229){return db['WhatsappQueue'][_0x7f3a('0x24')]({'raw':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x1c')]===undefined?!![]:![]:!![],'where':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')]['where']||null:null,'attributes':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x1e')]||null:null,'include':_0x45f43f[_0x7f3a('0x1b')]?_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x45f43f[_0x7f3a('0x1b')][_0x7f3a('0x20')],function(_0x47cf8a){return{'model':db[_0x47cf8a['model']],'as':_0x47cf8a['as'],'attributes':_0x47cf8a['attributes'],'include':_0x47cf8a[_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x47cf8a[_0x7f3a('0x20')],function(_0x5d1ba1){return{'model':db[_0x5d1ba1[_0x7f3a('0x22')]],'as':_0x5d1ba1['as'],'attributes':_0x5d1ba1[_0x7f3a('0x1e')],'include':_0x5d1ba1[_0x7f3a('0x20')]?_[_0x7f3a('0x21')](_0x5d1ba1[_0x7f3a('0x20')],function(_0x10ce58){return{'model':db[_0x10ce58[_0x7f3a('0x22')]],'as':_0x10ce58['as'],'attributes':_0x10ce58[_0x7f3a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7f3a('0x23')](function(_0x43e4a9){logger[_0x7f3a('0x11')](_0x7f3a('0x25'),_0x45f43f);logger[_0x7f3a('0x14')]('ShowWhatsappQueue',_0x45f43f,JSON[_0x7f3a('0x15')](_0x43e4a9));_0x1c61f8(_0x43e4a9);})['catch'](function(_0x122c24){logger[_0x7f3a('0x17')](_0x7f3a('0x25'),_0x122c24['message'],_0x45f43f);_0x340229(_0x2b9537[_0x7f3a('0x17')](0x1f4,_0x122c24[_0x7f3a('0x18')]));});});};
\ No newline at end of file
index 75b7a26..1edae3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a22=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x2fdf82,_0x322e7c){var _0x2382f5=function(_0x4d6951){while(--_0x4d6951){_0x2fdf82['push'](_0x2fdf82['shift']());}};_0x2382f5(++_0x322e7c);}(_0x7a22,0xee));var _0x27a2=function(_0x175ed2,_0x30b227){_0x175ed2=_0x175ed2-0x0;var _0x35853f=_0x7a22[_0x175ed2];return _0x35853f;};'use strict';var WhatsappQueueEvents=require(_0x27a2('0x0'));var events=[_0x27a2('0x1'),_0x27a2('0x2'),_0x27a2('0x3')];function createListener(_0x5c566b,_0x10a448){return function(_0x4f7cc0){_0x10a448[_0x27a2('0x4')](_0x5c566b,_0x4f7cc0);};}function removeListener(_0x25c644,_0x4fac1d){return function(){WhatsappQueueEvents[_0x27a2('0x5')](_0x25c644,_0x4fac1d);};}exports[_0x27a2('0x6')]=function(_0x33d015){for(var _0x554414=0x0,_0x207d7c=events[_0x27a2('0x7')];_0x554414<_0x207d7c;_0x554414++){var _0x37ae31=events[_0x554414];var _0x4d3d8d=createListener(_0x27a2('0x8')+_0x37ae31,_0x33d015);WhatsappQueueEvents['on'](_0x37ae31,_0x4d3d8d);}};
\ No newline at end of file
+var _0xd45d=['register','length','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x57cbfb,_0x2de760){var _0x4cb933=function(_0x33cf6a){while(--_0x33cf6a){_0x57cbfb['push'](_0x57cbfb['shift']());}};_0x4cb933(++_0x2de760);}(_0xd45d,0xb3));var _0xdd45=function(_0x1b7a5b,_0x4b19e2){_0x1b7a5b=_0x1b7a5b-0x0;var _0xf0a88a=_0xd45d[_0x1b7a5b];return _0xf0a88a;};'use strict';var WhatsappQueueEvents=require(_0xdd45('0x0'));var events=[_0xdd45('0x1'),_0xdd45('0x2'),_0xdd45('0x3')];function createListener(_0x2a59fe,_0x3720b1){return function(_0xd6433b){_0x3720b1[_0xdd45('0x4')](_0x2a59fe,_0xd6433b);};}function removeListener(_0x43cbe1,_0x16b1df){return function(){WhatsappQueueEvents['removeListener'](_0x43cbe1,_0x16b1df);};}exports[_0xdd45('0x5')]=function(_0x15a78a){for(var _0x48a204=0x0,_0x5243ee=events[_0xdd45('0x6')];_0x48a204<_0x5243ee;_0x48a204++){var _0x164c7e=events[_0x48a204];var _0x193126=createListener(_0xdd45('0x7')+_0x164c7e,_0x15a78a);WhatsappQueueEvents['on'](_0x164c7e,_0x193126);}};
\ No newline at end of file
index 5dce2f6..55e7da1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x547f=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','delete','destroy','exports'];(function(_0x2a4807,_0x5217f3){var _0x2e0cd9=function(_0x5277d5){while(--_0x5277d5){_0x2a4807['push'](_0x2a4807['shift']());}};_0x2e0cd9(++_0x5217f3);}(_0x547f,0x13b));var _0xf547=function(_0x54e3c0,_0x1077b4){_0x54e3c0=_0x54e3c0-0x0;var _0x278f45=_0x547f[_0x54e3c0];return _0x278f45;};'use strict';var multer=require(_0xf547('0x0'));var util=require(_0xf547('0x1'));var path=require(_0xf547('0x2'));var timeout=require('connect-timeout');var express=require(_0xf547('0x3'));var router=express[_0xf547('0x4')]();var fs_extra=require(_0xf547('0x5'));var auth=require(_0xf547('0x6'));var interaction=require(_0xf547('0x7'));var config=require(_0xf547('0x8'));var controller=require(_0xf547('0x9'));router['get']('/',auth[_0xf547('0xa')](),controller[_0xf547('0xb')]);router[_0xf547('0xc')](_0xf547('0xd'),auth[_0xf547('0xa')](),controller['describe']);router[_0xf547('0xc')](_0xf547('0xe'),auth[_0xf547('0xa')](),controller[_0xf547('0xf')]);router[_0xf547('0x10')]('/',auth[_0xf547('0xa')](),controller[_0xf547('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf547('0x12')]('/:id',auth[_0xf547('0xa')](),controller[_0xf547('0x13')]);module[_0xf547('0x14')]=router;
\ No newline at end of file
+var _0xe424=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get'];(function(_0x347b52,_0xfe591b){var _0x38bd34=function(_0x1be5e7){while(--_0x1be5e7){_0x347b52['push'](_0x347b52['shift']());}};_0x38bd34(++_0xfe591b);}(_0xe424,0x13f));var _0x4e42=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xe424[_0xefd519];return _0x4bb882;};'use strict';var multer=require(_0x4e42('0x0'));var util=require(_0x4e42('0x1'));var path=require(_0x4e42('0x2'));var timeout=require(_0x4e42('0x3'));var express=require(_0x4e42('0x4'));var router=express[_0x4e42('0x5')]();var fs_extra=require(_0x4e42('0x6'));var auth=require(_0x4e42('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4e42('0x8'));var controller=require(_0x4e42('0x9'));router[_0x4e42('0xa')]('/',auth[_0x4e42('0xb')](),controller['index']);router[_0x4e42('0xa')](_0x4e42('0xc'),auth['isAuthenticated'](),controller[_0x4e42('0xd')]);router[_0x4e42('0xa')](_0x4e42('0xe'),auth[_0x4e42('0xb')](),controller[_0x4e42('0xf')]);router[_0x4e42('0x10')]('/',auth[_0x4e42('0xb')](),controller['create']);router[_0x4e42('0x11')]('/:id',auth[_0x4e42('0xb')](),controller[_0x4e42('0x12')]);router[_0x4e42('0x13')](_0x4e42('0xe'),auth[_0x4e42('0xb')](),controller[_0x4e42('0x14')]);module[_0x4e42('0x15')]=router;
\ No newline at end of file
index 9d366e2..1f6dab0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x122f46,_0x4c22d5){var _0x590b10=function(_0x548428){while(--_0x548428){_0x122f46['push'](_0x122f46['shift']());}};_0x590b10(++_0x4c22d5);}(_0x7a54,0x106));var _0x47a5=function(_0x2d1603,_0x1e41cc){_0x2d1603=_0x2d1603-0x0;var _0x3be5de=_0x7a54[_0x2d1603];return _0x3be5de;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x25a74e,_0x3f40f4){var _0x235557=function(_0xd3ee2a){while(--_0xd3ee2a){_0x25a74e['push'](_0x25a74e['shift']());}};_0x235557(++_0x3f40f4);}(_0x7a54,0x106));var _0x47a5=function(_0x290220,_0x1b9ec7){_0x290220=_0x290220-0x0;var _0x30b69c=_0x7a54[_0x290220];return _0x30b69c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index 5d03676..c531766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1399=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','keys','find','catch','body','destroy','describe','eml-format'];(function(_0x39efe4,_0x28b498){var _0x5b7bb3=function(_0x18d043){while(--_0x18d043){_0x39efe4['push'](_0x39efe4['shift']());}};_0x5b7bb3(++_0x28b498);}(_0x1399,0x16c));var _0x9139=function(_0x1d8295,_0xeb509d){_0x1d8295=_0x1d8295-0x0;var _0x259513=_0x1399[_0x1d8295];return _0x259513;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b32d,_0x511ec9){_0x511ec9=_0x511ec9||0xcc;return function(_0x417637){if(_0x417637){return _0x52b32d['sendStatus'](_0x511ec9);}return _0x52b32d[_0x9139('0x16')](_0x511ec9)[_0x9139('0x17')]();};}function respondWithResult(_0x375ada,_0x262009){_0x262009=_0x262009||0xc8;return function(_0x5936d2){if(_0x5936d2){return _0x375ada[_0x9139('0x16')](_0x262009)['json'](_0x5936d2);}};}function respondWithFilteredResult(_0x58307f,_0x52c57b){return function(_0x159e50){if(_0x159e50){var _0x3e2bad=typeof _0x52c57b[_0x9139('0x18')]===_0x9139('0x19')&&typeof _0x52c57b[_0x9139('0x1a')]===_0x9139('0x19');var _0x4bd957=_0x159e50['count'];var _0x13cab8=_0x3e2bad?0x0:_0x52c57b[_0x9139('0x18')];var _0x5e0a59=_0x3e2bad?_0x159e50['count']:_0x52c57b[_0x9139('0x18')]+_0x52c57b[_0x9139('0x1a')];var _0x56add4;if(_0x5e0a59>=_0x4bd957){_0x5e0a59=_0x4bd957;_0x56add4=0xc8;}else{_0x56add4=0xce;}_0x58307f[_0x9139('0x16')](_0x56add4);return _0x58307f[_0x9139('0x1b')](_0x9139('0x1c'),_0x13cab8+'-'+_0x5e0a59+'/'+_0x4bd957)[_0x9139('0x1d')](_0x159e50);}return null;};}function patchUpdates(_0xd2eb33){return function(_0x6f901b){try{jsonpatch[_0x9139('0x1e')](_0x6f901b,_0xd2eb33,!![]);}catch(_0x45fa16){return BPromise[_0x9139('0x1f')](_0x45fa16);}return _0x6f901b[_0x9139('0x20')]();};}function saveUpdates(_0x1bac18,_0x269f8a){return function(_0x5a3e2e){if(_0x5a3e2e){return _0x5a3e2e[_0x9139('0x21')](_0x1bac18)[_0x9139('0x22')](function(_0x31635a){return _0x31635a;});}return null;};}function removeEntity(_0x1aee3b,_0x934732){return function(_0x1a7350){if(_0x1a7350){return _0x1a7350['destroy']()[_0x9139('0x22')](function(){_0x1aee3b[_0x9139('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed4da,_0x2ee4bb){return function(_0x10bfa0){if(!_0x10bfa0){_0x3ed4da['sendStatus'](0x194);}return _0x10bfa0;};}function handleError(_0x4118dc,_0xffd487){_0xffd487=_0xffd487||0x1f4;return function(_0x49d01e){logger[_0x9139('0x23')](_0x49d01e[_0x9139('0x24')]);if(_0x49d01e[_0x9139('0x25')]){delete _0x49d01e['name'];}_0x4118dc[_0x9139('0x16')](_0xffd487)[_0x9139('0x26')](_0x49d01e);};}exports[_0x9139('0x27')]=function(_0x22994c,_0x215194){var _0x16dfb4={},_0xfe6854={},_0x573a05={'count':0x0,'rows':[]};var _0x55cc6a=_[_0x9139('0x28')](db[_0x9139('0x29')][_0x9139('0x2a')],function(_0x4c1693){return{'name':_0x4c1693['fieldName'],'type':_0x4c1693[_0x9139('0x2b')][_0x9139('0x2c')]};});_0xfe6854[_0x9139('0x2d')]=_[_0x9139('0x28')](_0x55cc6a,_0x9139('0x25'));_0xfe6854['query']=_['keys'](_0x22994c[_0x9139('0x2e')]);_0xfe6854['filters']=_['intersection'](_0xfe6854[_0x9139('0x2d')],_0xfe6854[_0x9139('0x2e')]);_0x16dfb4['attributes']=_[_0x9139('0x2f')](_0xfe6854[_0x9139('0x2d')],qs['fields'](_0x22994c[_0x9139('0x2e')][_0x9139('0x30')]));_0x16dfb4[_0x9139('0x31')]=_0x16dfb4[_0x9139('0x31')][_0x9139('0x32')]?_0x16dfb4[_0x9139('0x31')]:_0xfe6854[_0x9139('0x2d')];if(!_0x22994c[_0x9139('0x2e')][_0x9139('0x33')](_0x9139('0x34'))){_0x16dfb4[_0x9139('0x1a')]=qs['limit'](_0x22994c[_0x9139('0x2e')][_0x9139('0x1a')]);_0x16dfb4['offset']=qs[_0x9139('0x18')](_0x22994c[_0x9139('0x2e')][_0x9139('0x18')]);}_0x16dfb4['order']=qs[_0x9139('0x35')](_0x22994c[_0x9139('0x2e')][_0x9139('0x35')]);_0x16dfb4[_0x9139('0x36')]=qs[_0x9139('0x37')](_[_0x9139('0x38')](_0x22994c[_0x9139('0x2e')],_0xfe6854[_0x9139('0x37')]),_0x55cc6a);if(_0x22994c[_0x9139('0x2e')][_0x9139('0x39')]){_0x16dfb4['where']=_[_0x9139('0x3a')](_0x16dfb4[_0x9139('0x36')],{'$or':_[_0x9139('0x28')](_0x55cc6a,function(_0x2cebb9){if(_0x2cebb9[_0x9139('0x2b')]!==_0x9139('0x3b')){var _0x1ea313={};_0x1ea313[_0x2cebb9['name']]={'$like':'%'+_0x22994c[_0x9139('0x2e')]['filter']+'%'};return _0x1ea313;}})});}_0x16dfb4=_[_0x9139('0x3a')]({},_0x16dfb4,_0x22994c[_0x9139('0x3c')]);var _0x3fb4db={'where':_0x16dfb4['where']};return db[_0x9139('0x29')][_0x9139('0x3d')](_0x3fb4db)[_0x9139('0x22')](function(_0x236513){_0x573a05[_0x9139('0x3d')]=_0x236513;if(_0x22994c[_0x9139('0x2e')][_0x9139('0x3e')]){_0x16dfb4[_0x9139('0x3f')]=[{'all':!![]}];}return db[_0x9139('0x29')][_0x9139('0x40')](_0x16dfb4);})['then'](function(_0xf14393){_0x573a05[_0x9139('0x41')]=_0xf14393;return _0x573a05;})[_0x9139('0x22')](respondWithFilteredResult(_0x215194,_0x16dfb4))['catch'](handleError(_0x215194,null));};exports['show']=function(_0x4d9670,_0x465f49){var _0x12ba4b={'raw':!![],'where':{'id':_0x4d9670[_0x9139('0x42')]['id']}},_0x3611b4={};_0x3611b4[_0x9139('0x2d')]=_['keys'](db[_0x9139('0x29')][_0x9139('0x2a')]);_0x3611b4[_0x9139('0x2e')]=_[_0x9139('0x43')](_0x4d9670[_0x9139('0x2e')]);_0x3611b4['filters']=_[_0x9139('0x2f')](_0x3611b4[_0x9139('0x2d')],_0x3611b4[_0x9139('0x2e')]);_0x12ba4b[_0x9139('0x31')]=_['intersection'](_0x3611b4['model'],qs[_0x9139('0x30')](_0x4d9670[_0x9139('0x2e')]['fields']));_0x12ba4b['attributes']=_0x12ba4b[_0x9139('0x31')][_0x9139('0x32')]?_0x12ba4b['attributes']:_0x3611b4[_0x9139('0x2d')];if(_0x4d9670[_0x9139('0x2e')]['includeAll']){_0x12ba4b[_0x9139('0x3f')]=[{'all':!![]}];}_0x12ba4b=_['merge']({},_0x12ba4b,_0x4d9670['options']);return db[_0x9139('0x29')][_0x9139('0x44')](_0x12ba4b)[_0x9139('0x22')](handleEntityNotFound(_0x465f49,null))[_0x9139('0x22')](respondWithResult(_0x465f49,null))[_0x9139('0x45')](handleError(_0x465f49,null));};exports['create']=function(_0x3e126c,_0xc55b16){return db[_0x9139('0x29')]['create'](_0x3e126c[_0x9139('0x46')],{})[_0x9139('0x22')](respondWithResult(_0xc55b16,0xc9))[_0x9139('0x45')](handleError(_0xc55b16,null));};exports[_0x9139('0x21')]=function(_0x215793,_0x31395f){if(_0x215793[_0x9139('0x46')]['id']){delete _0x215793[_0x9139('0x46')]['id'];}return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x215793[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x31395f,null))[_0x9139('0x22')](saveUpdates(_0x215793[_0x9139('0x46')],null))[_0x9139('0x22')](respondWithResult(_0x31395f,null))['catch'](handleError(_0x31395f,null));};exports[_0x9139('0x47')]=function(_0x46f77a,_0x557c93){return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x46f77a[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x557c93,null))[_0x9139('0x22')](removeEntity(_0x557c93,null))[_0x9139('0x45')](handleError(_0x557c93,null));};exports[_0x9139('0x48')]=function(_0x23669b,_0x51ecf6){return db[_0x9139('0x29')][_0x9139('0x48')]()[_0x9139('0x22')](respondWithResult(_0x51ecf6,null))['catch'](handleError(_0x51ecf6,null));};
\ No newline at end of file
+var _0x1eba=['name','send','WhatsappQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error'];(function(_0x10d73b,_0xb2bc5){var _0x22f7c2=function(_0x1a89b5){while(--_0x1a89b5){_0x10d73b['push'](_0x10d73b['shift']());}};_0x22f7c2(++_0xb2bc5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x1eba[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require(_0xa1eb('0x0'));var rimraf=require(_0xa1eb('0x1'));var zipdir=require(_0xa1eb('0x2'));var jsonpatch=require(_0xa1eb('0x3'));var rp=require(_0xa1eb('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1eb('0x5'));var util=require(_0xa1eb('0x6'));var path=require(_0xa1eb('0x7'));var sox=require(_0xa1eb('0x8'));var csv=require(_0xa1eb('0x9'));var ejs=require(_0xa1eb('0xa'));var fs=require('fs');var fs_extra=require(_0xa1eb('0xb'));var _=require(_0xa1eb('0xc'));var squel=require(_0xa1eb('0xd'));var crypto=require(_0xa1eb('0xe'));var jsforce=require(_0xa1eb('0xf'));var deskjs=require(_0xa1eb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1eb('0x11'));var Papa=require('papaparse');var Redis=require(_0xa1eb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa1eb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1eb('0x14'));var logger=require('../../config/logger')(_0xa1eb('0x15'));var utils=require(_0xa1eb('0x16'));var config=require(_0xa1eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1eb('0x18'))['db'];function respondWithStatusCode(_0x39b4a3,_0x5df92d){_0x5df92d=_0x5df92d||0xcc;return function(_0x16a623){if(_0x16a623){return _0x39b4a3['sendStatus'](_0x5df92d);}return _0x39b4a3['status'](_0x5df92d)[_0xa1eb('0x19')]();};}function respondWithResult(_0x4c7983,_0x25d058){_0x25d058=_0x25d058||0xc8;return function(_0x2178e2){if(_0x2178e2){return _0x4c7983[_0xa1eb('0x1a')](_0x25d058)[_0xa1eb('0x1b')](_0x2178e2);}};}function respondWithFilteredResult(_0x3cd675,_0x44f37d){return function(_0x1c858c){if(_0x1c858c){var _0x45d6dd=typeof _0x44f37d[_0xa1eb('0x1c')]==='undefined'&&typeof _0x44f37d[_0xa1eb('0x1d')]==='undefined';var _0x1401ef=_0x1c858c[_0xa1eb('0x1e')];var _0x33c4e3=_0x45d6dd?0x0:_0x44f37d[_0xa1eb('0x1c')];var _0x49bfaa=_0x45d6dd?_0x1c858c[_0xa1eb('0x1e')]:_0x44f37d[_0xa1eb('0x1c')]+_0x44f37d[_0xa1eb('0x1d')];var _0xcf45c1;if(_0x49bfaa>=_0x1401ef){_0x49bfaa=_0x1401ef;_0xcf45c1=0xc8;}else{_0xcf45c1=0xce;}_0x3cd675[_0xa1eb('0x1a')](_0xcf45c1);return _0x3cd675[_0xa1eb('0x1f')](_0xa1eb('0x20'),_0x33c4e3+'-'+_0x49bfaa+'/'+_0x1401ef)[_0xa1eb('0x1b')](_0x1c858c);}return null;};}function patchUpdates(_0x4fc14a){return function(_0x137e2c){try{jsonpatch['apply'](_0x137e2c,_0x4fc14a,!![]);}catch(_0x2258d1){return BPromise[_0xa1eb('0x21')](_0x2258d1);}return _0x137e2c[_0xa1eb('0x22')]();};}function saveUpdates(_0x250f99,_0x5e7a34){return function(_0x539634){if(_0x539634){return _0x539634[_0xa1eb('0x23')](_0x250f99)[_0xa1eb('0x24')](function(_0x5b0903){return _0x5b0903;});}return null;};}function removeEntity(_0x437b2a,_0x250728){return function(_0x258d3a){if(_0x258d3a){return _0x258d3a[_0xa1eb('0x25')]()[_0xa1eb('0x24')](function(){_0x437b2a[_0xa1eb('0x1a')](0xcc)[_0xa1eb('0x19')]();});}};}function handleEntityNotFound(_0x364b1c,_0xd7bb88){return function(_0x352796){if(!_0x352796){_0x364b1c[_0xa1eb('0x26')](0x194);}return _0x352796;};}function handleError(_0x208844,_0x57d089){_0x57d089=_0x57d089||0x1f4;return function(_0x7c617e){logger[_0xa1eb('0x27')](_0x7c617e['stack']);if(_0x7c617e[_0xa1eb('0x28')]){delete _0x7c617e['name'];}_0x208844[_0xa1eb('0x1a')](_0x57d089)[_0xa1eb('0x29')](_0x7c617e);};}exports['index']=function(_0x45ff0d,_0x1581ee){var _0x136835={},_0x4f64bb={},_0x12cf56={'count':0x0,'rows':[]};var _0x41b3ad=_['map'](db[_0xa1eb('0x2a')][_0xa1eb('0x2b')],function(_0x401510){return{'name':_0x401510[_0xa1eb('0x2c')],'type':_0x401510[_0xa1eb('0x2d')]['key']};});_0x4f64bb[_0xa1eb('0x2e')]=_[_0xa1eb('0x2f')](_0x41b3ad,_0xa1eb('0x28'));_0x4f64bb[_0xa1eb('0x30')]=_[_0xa1eb('0x31')](_0x45ff0d[_0xa1eb('0x30')]);_0x4f64bb[_0xa1eb('0x32')]=_[_0xa1eb('0x33')](_0x4f64bb[_0xa1eb('0x2e')],_0x4f64bb[_0xa1eb('0x30')]);_0x136835[_0xa1eb('0x34')]=_['intersection'](_0x4f64bb['model'],qs[_0xa1eb('0x35')](_0x45ff0d[_0xa1eb('0x30')][_0xa1eb('0x35')]));_0x136835[_0xa1eb('0x34')]=_0x136835[_0xa1eb('0x34')]['length']?_0x136835['attributes']:_0x4f64bb[_0xa1eb('0x2e')];if(!_0x45ff0d[_0xa1eb('0x30')]['hasOwnProperty']('nolimit')){_0x136835[_0xa1eb('0x1d')]=qs['limit'](_0x45ff0d[_0xa1eb('0x30')]['limit']);_0x136835[_0xa1eb('0x1c')]=qs[_0xa1eb('0x1c')](_0x45ff0d[_0xa1eb('0x30')]['offset']);}_0x136835[_0xa1eb('0x36')]=qs[_0xa1eb('0x37')](_0x45ff0d[_0xa1eb('0x30')]['sort']);_0x136835[_0xa1eb('0x38')]=qs[_0xa1eb('0x32')](_[_0xa1eb('0x39')](_0x45ff0d[_0xa1eb('0x30')],_0x4f64bb[_0xa1eb('0x32')]),_0x41b3ad);if(_0x45ff0d['query'][_0xa1eb('0x3a')]){_0x136835[_0xa1eb('0x38')]=_[_0xa1eb('0x3b')](_0x136835[_0xa1eb('0x38')],{'$or':_[_0xa1eb('0x2f')](_0x41b3ad,function(_0x2af1d1){if(_0x2af1d1[_0xa1eb('0x2d')]!==_0xa1eb('0x3c')){var _0x53f251={};_0x53f251[_0x2af1d1[_0xa1eb('0x28')]]={'$like':'%'+_0x45ff0d[_0xa1eb('0x30')][_0xa1eb('0x3a')]+'%'};return _0x53f251;}})});}_0x136835=_[_0xa1eb('0x3b')]({},_0x136835,_0x45ff0d[_0xa1eb('0x3d')]);var _0x5bf994={'where':_0x136835[_0xa1eb('0x38')]};return db[_0xa1eb('0x2a')][_0xa1eb('0x1e')](_0x5bf994)['then'](function(_0x334849){_0x12cf56[_0xa1eb('0x1e')]=_0x334849;if(_0x45ff0d[_0xa1eb('0x30')][_0xa1eb('0x3e')]){_0x136835[_0xa1eb('0x3f')]=[{'all':!![]}];}return db[_0xa1eb('0x2a')][_0xa1eb('0x40')](_0x136835);})['then'](function(_0x3c8713){_0x12cf56[_0xa1eb('0x41')]=_0x3c8713;return _0x12cf56;})['then'](respondWithFilteredResult(_0x1581ee,_0x136835))[_0xa1eb('0x42')](handleError(_0x1581ee,null));};exports['show']=function(_0x1744e4,_0x3a6f36){var _0x75f7f6={'raw':!![],'where':{'id':_0x1744e4[_0xa1eb('0x43')]['id']}},_0x361675={};_0x361675[_0xa1eb('0x2e')]=_[_0xa1eb('0x31')](db[_0xa1eb('0x2a')][_0xa1eb('0x2b')]);_0x361675[_0xa1eb('0x30')]=_[_0xa1eb('0x31')](_0x1744e4[_0xa1eb('0x30')]);_0x361675[_0xa1eb('0x32')]=_[_0xa1eb('0x33')](_0x361675[_0xa1eb('0x2e')],_0x361675[_0xa1eb('0x30')]);_0x75f7f6['attributes']=_[_0xa1eb('0x33')](_0x361675['model'],qs[_0xa1eb('0x35')](_0x1744e4[_0xa1eb('0x30')]['fields']));_0x75f7f6['attributes']=_0x75f7f6[_0xa1eb('0x34')][_0xa1eb('0x44')]?_0x75f7f6[_0xa1eb('0x34')]:_0x361675['model'];if(_0x1744e4[_0xa1eb('0x30')][_0xa1eb('0x3e')]){_0x75f7f6[_0xa1eb('0x3f')]=[{'all':!![]}];}_0x75f7f6=_[_0xa1eb('0x3b')]({},_0x75f7f6,_0x1744e4[_0xa1eb('0x3d')]);return db[_0xa1eb('0x2a')][_0xa1eb('0x45')](_0x75f7f6)[_0xa1eb('0x24')](handleEntityNotFound(_0x3a6f36,null))[_0xa1eb('0x24')](respondWithResult(_0x3a6f36,null))[_0xa1eb('0x42')](handleError(_0x3a6f36,null));};exports[_0xa1eb('0x46')]=function(_0x393f95,_0x39d3c6){return db[_0xa1eb('0x2a')]['create'](_0x393f95[_0xa1eb('0x47')],{})[_0xa1eb('0x24')](respondWithResult(_0x39d3c6,0xc9))[_0xa1eb('0x42')](handleError(_0x39d3c6,null));};exports[_0xa1eb('0x23')]=function(_0x2b0cbf,_0x12dfd4){if(_0x2b0cbf[_0xa1eb('0x47')]['id']){delete _0x2b0cbf['body']['id'];}return db[_0xa1eb('0x2a')][_0xa1eb('0x45')]({'where':{'id':_0x2b0cbf[_0xa1eb('0x43')]['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x12dfd4,null))[_0xa1eb('0x24')](saveUpdates(_0x2b0cbf[_0xa1eb('0x47')],null))[_0xa1eb('0x24')](respondWithResult(_0x12dfd4,null))[_0xa1eb('0x42')](handleError(_0x12dfd4,null));};exports[_0xa1eb('0x25')]=function(_0x4f7c05,_0x190370){return db['WhatsappQueueReport'][_0xa1eb('0x45')]({'where':{'id':_0x4f7c05['params']['id']}})[_0xa1eb('0x24')](handleEntityNotFound(_0x190370,null))[_0xa1eb('0x24')](removeEntity(_0x190370,null))[_0xa1eb('0x42')](handleError(_0x190370,null));};exports['describe']=function(_0x3fbd6c,_0xbd9a42){return db['WhatsappQueueReport'][_0xa1eb('0x48')]()[_0xa1eb('0x24')](respondWithResult(_0xbd9a42,null))[_0xa1eb('0x42')](handleError(_0xbd9a42,null));};
\ No newline at end of file
index 7780eba..f5390d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x158f=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','report_whatsapp_queue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x158f,0xd3));var _0xf158=function(_0x5807e8,_0x5d1910){_0x5807e8=_0x5807e8-0x0;var _0x2f7f36=_0x158f[_0x5807e8];return _0x2f7f36;};'use strict';var _=require(_0xf158('0x0'));var util=require(_0xf158('0x1'));var logger=require(_0xf158('0x2'))(_0xf158('0x3'));var moment=require(_0xf158('0x4'));var BPromise=require(_0xf158('0x5'));var rp=require(_0xf158('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf158('0x7'));var config=require(_0xf158('0x8'));var attributes=require(_0xf158('0x9'));module[_0xf158('0xa')]=function(_0x41ce1b,_0xe4a703){return _0x41ce1b['define'](_0xf158('0xb'),attributes,{'tableName':_0xf158('0xc'),'paranoid':![],'indexes':[{'name':_0xf158('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x95cf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x2ea2dc,_0x1b3cf6){var _0xd7d188=function(_0x3c5d2b){while(--_0x3c5d2b){_0x2ea2dc['push'](_0x2ea2dc['shift']());}};_0xd7d188(++_0x1b3cf6);}(_0x95cf,0x1a2));var _0xf95c=function(_0x34c6ff,_0x2afa3a){_0x34c6ff=_0x34c6ff-0x0;var _0x1a5a65=_0x95cf[_0x34c6ff];return _0x1a5a65;};'use strict';var _=require(_0xf95c('0x0'));var util=require(_0xf95c('0x1'));var logger=require(_0xf95c('0x2'))(_0xf95c('0x3'));var moment=require(_0xf95c('0x4'));var BPromise=require(_0xf95c('0x5'));var rp=require(_0xf95c('0x6'));var fs=require('fs');var path=require(_0xf95c('0x7'));var rimraf=require(_0xf95c('0x8'));var config=require(_0xf95c('0x9'));var attributes=require('./whatsappQueueReport.attributes');module[_0xf95c('0xa')]=function(_0x2291c6,_0x57302d){return _0x2291c6['define'](_0xf95c('0xb'),attributes,{'tableName':_0xf95c('0xc'),'paranoid':![],'indexes':[{'name':_0xf95c('0xd'),'fields':[_0xf95c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index fded339..a294c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e07=['debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','catch','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e07,0xb1));var _0x79e0=function(_0x24dbad,_0x3390fb){_0x24dbad=_0x24dbad-0x0;var _0x9451f1=_0x9e07[_0x24dbad];return _0x9451f1;};'use strict';var _=require(_0x79e0('0x0'));var util=require(_0x79e0('0x1'));var moment=require(_0x79e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x79e0('0x3'));var fs=require('fs');var Redis=require(_0x79e0('0x4'));var db=require(_0x79e0('0x5'))['db'];var utils=require(_0x79e0('0x6'));var logger=require('../../config/logger')(_0x79e0('0x7'));var config=require(_0x79e0('0x8'));var jayson=require(_0x79e0('0x9'));var client=jayson['client'][_0x79e0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26b75d,_0x26f46b,_0x56341c){return new BPromise(function(_0x425668,_0x3b0e69){return client[_0x79e0('0xb')](_0x26b75d,_0x56341c)[_0x79e0('0xc')](function(_0x3611ec){logger['info'](_0x79e0('0xd'),_0x26f46b,_0x79e0('0xe'));logger[_0x79e0('0xf')](_0x79e0('0x10'),_0x26f46b,_0x79e0('0xe'),JSON[_0x79e0('0x11')](_0x3611ec));if(_0x3611ec[_0x79e0('0x12')]){if(_0x3611ec[_0x79e0('0x12')][_0x79e0('0x13')]===0x1f4){logger[_0x79e0('0x12')](_0x79e0('0xd'),_0x26f46b,_0x3611ec[_0x79e0('0x12')][_0x79e0('0x14')]);return _0x3b0e69(_0x3611ec['error']['message']);}logger[_0x79e0('0x12')](_0x79e0('0xd'),_0x26f46b,_0x3611ec[_0x79e0('0x12')][_0x79e0('0x14')]);return _0x425668(_0x3611ec[_0x79e0('0x12')][_0x79e0('0x14')]);}else{logger[_0x79e0('0x15')](_0x79e0('0xd'),_0x26f46b,_0x79e0('0xe'));_0x425668(_0x3611ec['result']['message']);}})['catch'](function(_0x355530){logger[_0x79e0('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x26f46b,_0x355530);_0x3b0e69(_0x355530);});});}exports[_0x79e0('0x16')]=function(_0x27dd4d){var _0x31c124=this;return new Promise(function(_0x588612,_0xe2c4c4){return db[_0x79e0('0x17')][_0x79e0('0x18')](_0x27dd4d['body'],{'raw':_0x27dd4d[_0x79e0('0x19')]?_0x27dd4d[_0x79e0('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x79e0('0xc')](function(_0x1053af){logger[_0x79e0('0x15')](_0x79e0('0x16'),_0x27dd4d);logger[_0x79e0('0xf')]('CreateWhatsappQueueReport',_0x27dd4d,JSON[_0x79e0('0x11')](_0x1053af));_0x588612(_0x1053af);})[_0x79e0('0x1a')](function(_0x5c855e){logger[_0x79e0('0x12')](_0x79e0('0x16'),_0x5c855e[_0x79e0('0x14')],_0x27dd4d);_0xe2c4c4(_0x31c124[_0x79e0('0x12')](0x1f4,_0x5c855e[_0x79e0('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x724826){var _0x5d74ab=this;return new Promise(function(_0x2e638a,_0x114590){return db[_0x79e0('0x17')][_0x79e0('0x1b')](_0x724826['body'],{'raw':_0x724826[_0x79e0('0x19')]?_0x724826[_0x79e0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x724826['options']?_0x724826[_0x79e0('0x19')][_0x79e0('0x1c')]||null:null,'attributes':_0x724826[_0x79e0('0x19')]?_0x724826[_0x79e0('0x19')][_0x79e0('0x1d')]||null:null,'limit':_0x724826[_0x79e0('0x19')]?_0x724826[_0x79e0('0x19')][_0x79e0('0x1e')]||null:null})[_0x79e0('0xc')](function(_0x7294df){logger[_0x79e0('0x15')](_0x79e0('0x1f'),_0x724826);logger['debug'](_0x79e0('0x1f'),_0x724826,JSON[_0x79e0('0x11')](_0x7294df));_0x2e638a(_0x7294df);})[_0x79e0('0x1a')](function(_0x417843){logger[_0x79e0('0x12')](_0x79e0('0x1f'),_0x417843['message'],_0x724826);_0x114590(_0x5d74ab['error'](0x1f4,_0x417843['message']));});});};
\ No newline at end of file
+var _0xbc07=['message','result','WhatsappQueueReport','create','options','raw','stringify','catch','UpdateWhatsappQueueReport','update','body','where','limit','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1f109c,_0xd9952e){var _0x3984e8=function(_0x40b60b){while(--_0x40b60b){_0x1f109c['push'](_0x1f109c['shift']());}};_0x3984e8(++_0xd9952e);}(_0xbc07,0x193));var _0x7bc0=function(_0x1d10a8,_0x1164f8){_0x1d10a8=_0x1d10a8-0x0;var _0x5bafb1=_0xbc07[_0x1d10a8];return _0x5bafb1;};'use strict';var _=require(_0x7bc0('0x0'));var util=require(_0x7bc0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bc0('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bc0('0x3'))(_0x7bc0('0x4'));var config=require(_0x7bc0('0x5'));var jayson=require(_0x7bc0('0x6'));var client=jayson['client'][_0x7bc0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c66cb,_0x202afa,_0x39f4e3){return new BPromise(function(_0x4b12cd,_0x489964){return client[_0x7bc0('0x8')](_0x3c66cb,_0x39f4e3)[_0x7bc0('0x9')](function(_0x5491e7){logger[_0x7bc0('0xa')](_0x7bc0('0xb'),_0x202afa,_0x7bc0('0xc'));logger[_0x7bc0('0xd')](_0x7bc0('0xe'),_0x202afa,_0x7bc0('0xc'),JSON['stringify'](_0x5491e7));if(_0x5491e7[_0x7bc0('0xf')]){if(_0x5491e7[_0x7bc0('0xf')][_0x7bc0('0x10')]===0x1f4){logger[_0x7bc0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x202afa,_0x5491e7[_0x7bc0('0xf')][_0x7bc0('0x11')]);return _0x489964(_0x5491e7[_0x7bc0('0xf')][_0x7bc0('0x11')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x202afa,_0x5491e7[_0x7bc0('0xf')]['message']);return _0x4b12cd(_0x5491e7[_0x7bc0('0xf')]['message']);}else{logger[_0x7bc0('0xa')](_0x7bc0('0xb'),_0x202afa,_0x7bc0('0xc'));_0x4b12cd(_0x5491e7[_0x7bc0('0x12')][_0x7bc0('0x11')]);}})['catch'](function(_0x222c04){logger[_0x7bc0('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x202afa,_0x222c04);_0x489964(_0x222c04);});});}exports['CreateWhatsappQueueReport']=function(_0x376d2a){var _0x4e1501=this;return new Promise(function(_0x2623a3,_0x3a01e2){return db[_0x7bc0('0x13')][_0x7bc0('0x14')](_0x376d2a['body'],{'raw':_0x376d2a[_0x7bc0('0x15')]?_0x376d2a[_0x7bc0('0x15')][_0x7bc0('0x16')]===undefined?!![]:![]:!![]})[_0x7bc0('0x9')](function(_0x3bcbb2){logger[_0x7bc0('0xa')]('CreateWhatsappQueueReport',_0x376d2a);logger[_0x7bc0('0xd')]('CreateWhatsappQueueReport',_0x376d2a,JSON[_0x7bc0('0x17')](_0x3bcbb2));_0x2623a3(_0x3bcbb2);})[_0x7bc0('0x18')](function(_0x46a3a2){logger[_0x7bc0('0xf')]('CreateWhatsappQueueReport',_0x46a3a2[_0x7bc0('0x11')],_0x376d2a);_0x3a01e2(_0x4e1501[_0x7bc0('0xf')](0x1f4,_0x46a3a2[_0x7bc0('0x11')]));});});};exports[_0x7bc0('0x19')]=function(_0x271221){var _0x2ba75f=this;return new Promise(function(_0x18ade2,_0x44091a){return db[_0x7bc0('0x13')][_0x7bc0('0x1a')](_0x271221[_0x7bc0('0x1b')],{'raw':_0x271221[_0x7bc0('0x15')]?_0x271221[_0x7bc0('0x15')][_0x7bc0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271221['options']?_0x271221[_0x7bc0('0x15')][_0x7bc0('0x1c')]||null:null,'attributes':_0x271221[_0x7bc0('0x15')]?_0x271221['options']['attributes']||null:null,'limit':_0x271221['options']?_0x271221['options'][_0x7bc0('0x1d')]||null:null})[_0x7bc0('0x9')](function(_0x31ec76){logger[_0x7bc0('0xa')]('UpdateWhatsappQueueReport',_0x271221);logger[_0x7bc0('0xd')](_0x7bc0('0x19'),_0x271221,JSON[_0x7bc0('0x17')](_0x31ec76));_0x18ade2(_0x31ec76);})[_0x7bc0('0x18')](function(_0x2fcd8e){logger['error'](_0x7bc0('0x19'),_0x2fcd8e[_0x7bc0('0x11')],_0x271221);_0x44091a(_0x2ba75f['error'](0x1f4,_0x2fcd8e[_0x7bc0('0x11')]));});});};
\ No newline at end of file
index 4a40dae..7bc72f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed81=['index','/describe','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x4c40d4,_0xf233f7){var _0x381e2b=function(_0x129e82){while(--_0x129e82){_0x4c40d4['push'](_0x4c40d4['shift']());}};_0x381e2b(++_0xf233f7);}(_0xed81,0xb6));var _0x1ed8=function(_0x2a2617,_0x5c87e6){_0x2a2617=_0x2a2617-0x0;var _0x135a2c=_0xed81[_0x2a2617];return _0x135a2c;};'use strict';var multer=require(_0x1ed8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1ed8('0x1'));var express=require(_0x1ed8('0x2'));var router=express[_0x1ed8('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ed8('0x4'));var config=require(_0x1ed8('0x5'));var controller=require(_0x1ed8('0x6'));router[_0x1ed8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1ed8('0x8')]);router[_0x1ed8('0x7')](_0x1ed8('0x9'),auth[_0x1ed8('0xa')](),controller['describe']);router[_0x1ed8('0x7')]('/:id',auth[_0x1ed8('0xa')](),controller[_0x1ed8('0xb')]);router[_0x1ed8('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ed8('0xd')](_0x1ed8('0xe'),auth[_0x1ed8('0xa')](),controller[_0x1ed8('0xf')]);router[_0x1ed8('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x1ed8('0x11')]);module[_0x1ed8('0x12')]=router;
\ No newline at end of file
+var _0x55b4=['index','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2c74a9,_0x217a88){var _0x5e773f=function(_0x458b4b){while(--_0x458b4b){_0x2c74a9['push'](_0x2c74a9['shift']());}};_0x5e773f(++_0x217a88);}(_0x55b4,0xe8));var _0x455b=function(_0x4042d8,_0x305288){_0x4042d8=_0x4042d8-0x0;var _0x3cb304=_0x55b4[_0x4042d8];return _0x3cb304;};'use strict';var multer=require('multer');var util=require(_0x455b('0x0'));var path=require(_0x455b('0x1'));var timeout=require(_0x455b('0x2'));var express=require(_0x455b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x455b('0x4'));var interaction=require(_0x455b('0x5'));var config=require(_0x455b('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0x455b('0x7')]('/',auth['isAuthenticated'](),controller[_0x455b('0x8')]);router[_0x455b('0x7')](_0x455b('0x9'),auth[_0x455b('0xa')](),controller[_0x455b('0xb')]);router[_0x455b('0x7')]('/:id',auth[_0x455b('0xa')](),controller[_0x455b('0xc')]);router['post']('/',auth[_0x455b('0xa')](),controller[_0x455b('0xd')]);router[_0x455b('0xe')](_0x455b('0xf'),auth['isAuthenticated'](),controller[_0x455b('0x10')]);router[_0x455b('0x11')](_0x455b('0xf'),auth[_0x455b('0xa')](),controller[_0x455b('0x12')]);module[_0x455b('0x13')]=router;
\ No newline at end of file
index feb239a..3add8ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1867=['DATE','sequelize','exports','ENUM','agent','queue'];(function(_0x1e7a62,_0x385681){var _0x3f1f8a=function(_0x26a1ef){while(--_0x26a1ef){_0x1e7a62['push'](_0x1e7a62['shift']());}};_0x3f1f8a(++_0x385681);}(_0x1867,0xb5));var _0x7186=function(_0x2172e0,_0x4568cf){_0x2172e0=_0x2172e0-0x0;var _0x1f9bf5=_0x1867[_0x2172e0];return _0x1f9bf5;};'use strict';var Sequelize=require(_0x7186('0x0'));module[_0x7186('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x7186('0x2')]('account',_0x7186('0x3'),_0x7186('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x7186('0x5')]}};
\ No newline at end of file
+var _0x65c9=['DATE','sequelize','exports','ENUM','account','agent','queue'];(function(_0xe24de5,_0x5f8ad3){var _0x4c9ceb=function(_0x3aaa42){while(--_0x3aaa42){_0xe24de5['push'](_0xe24de5['shift']());}};_0x4c9ceb(++_0x5f8ad3);}(_0x65c9,0x182));var _0x965c=function(_0x427519,_0x3257bb){_0x427519=_0x427519-0x0;var _0x1cd5c6=_0x65c9[_0x427519];return _0x1cd5c6;};'use strict';var Sequelize=require(_0x965c('0x0'));module[_0x965c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x965c('0x2')](_0x965c('0x3'),_0x965c('0x4'),_0x965c('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x965c('0x6')]}};
\ No newline at end of file
index 2c68370..02eb72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2652=['show','params','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','index','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x1840b1,_0x2d021e){var _0x54ee73=function(_0x313ab9){while(--_0x313ab9){_0x1840b1['push'](_0x1840b1['shift']());}};_0x54ee73(++_0x2d021e);}(_0x2652,0x1e1));var _0x2265=function(_0x2ddded,_0x542bd7){_0x2ddded=_0x2ddded-0x0;var _0x1515bf=_0x2652[_0x2ddded];return _0x1515bf;};'use strict';var emlformat=require(_0x2265('0x0'));var rimraf=require(_0x2265('0x1'));var zipdir=require(_0x2265('0x2'));var jsonpatch=require(_0x2265('0x3'));var rp=require(_0x2265('0x4'));var moment=require(_0x2265('0x5'));var BPromise=require(_0x2265('0x6'));var Mustache=require(_0x2265('0x7'));var util=require(_0x2265('0x8'));var path=require(_0x2265('0x9'));var sox=require(_0x2265('0xa'));var csv=require('to-csv');var ejs=require(_0x2265('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2265('0xc'));var crypto=require(_0x2265('0xd'));var jsforce=require(_0x2265('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2265('0xf'));var querystring=require(_0x2265('0x10'));var Papa=require(_0x2265('0x11'));var Redis=require(_0x2265('0x12'));var authService=require(_0x2265('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2265('0x14'));var hardwareService=require(_0x2265('0x15'));var logger=require(_0x2265('0x16'))(_0x2265('0x17'));var utils=require(_0x2265('0x18'));var config=require(_0x2265('0x19'));var licenseUtil=require(_0x2265('0x1a'));var db=require(_0x2265('0x1b'))['db'];function respondWithStatusCode(_0x241f12,_0x30eb24){_0x30eb24=_0x30eb24||0xcc;return function(_0xcf994a){if(_0xcf994a){return _0x241f12[_0x2265('0x1c')](_0x30eb24);}return _0x241f12[_0x2265('0x1d')](_0x30eb24)[_0x2265('0x1e')]();};}function respondWithResult(_0x144d50,_0x57daf1){_0x57daf1=_0x57daf1||0xc8;return function(_0x5b16a5){if(_0x5b16a5){return _0x144d50[_0x2265('0x1d')](_0x57daf1)['json'](_0x5b16a5);}};}function respondWithFilteredResult(_0x1a0c73,_0x474480){return function(_0x2cbbd9){if(_0x2cbbd9){var _0x31c0e4=typeof _0x474480['offset']===_0x2265('0x1f')&&typeof _0x474480['limit']===_0x2265('0x1f');var _0x502ff3=_0x2cbbd9[_0x2265('0x20')];var _0x298752=_0x31c0e4?0x0:_0x474480[_0x2265('0x21')];var _0x5150d2=_0x31c0e4?_0x2cbbd9[_0x2265('0x20')]:_0x474480['offset']+_0x474480[_0x2265('0x22')];var _0x3a3916;if(_0x5150d2>=_0x502ff3){_0x5150d2=_0x502ff3;_0x3a3916=0xc8;}else{_0x3a3916=0xce;}_0x1a0c73[_0x2265('0x1d')](_0x3a3916);return _0x1a0c73[_0x2265('0x23')](_0x2265('0x24'),_0x298752+'-'+_0x5150d2+'/'+_0x502ff3)[_0x2265('0x25')](_0x2cbbd9);}return null;};}function patchUpdates(_0x217202){return function(_0x17b56e){try{jsonpatch[_0x2265('0x26')](_0x17b56e,_0x217202,!![]);}catch(_0x5ebc4b){return BPromise[_0x2265('0x27')](_0x5ebc4b);}return _0x17b56e['save']();};}function saveUpdates(_0x363ef2,_0x19315){return function(_0x5e012c){if(_0x5e012c){return _0x5e012c[_0x2265('0x28')](_0x363ef2)[_0x2265('0x29')](function(_0xc73f12){return _0xc73f12;});}return null;};}function removeEntity(_0x5a13bc,_0x2017bb){return function(_0x3cdaee){if(_0x3cdaee){return _0x3cdaee[_0x2265('0x2a')]()['then'](function(){_0x5a13bc[_0x2265('0x1d')](0xcc)[_0x2265('0x1e')]();});}};}function handleEntityNotFound(_0x31500e,_0x2095c2){return function(_0x311f05){if(!_0x311f05){_0x31500e[_0x2265('0x1c')](0x194);}return _0x311f05;};}function handleError(_0x1cceaa,_0x4c7c20){_0x4c7c20=_0x4c7c20||0x1f4;return function(_0x5703a1){logger['error'](_0x5703a1[_0x2265('0x2b')]);if(_0x5703a1[_0x2265('0x2c')]){delete _0x5703a1['name'];}_0x1cceaa[_0x2265('0x1d')](_0x4c7c20)['send'](_0x5703a1);};}exports[_0x2265('0x2d')]=function(_0x3fcd0b,_0x48419e){var _0x1e50fb={},_0x1f9392={},_0x4f5e5c={'count':0x0,'rows':[]};var _0x2cf32f=_['map'](db[_0x2265('0x2e')][_0x2265('0x2f')],function(_0x2e0da3){return{'name':_0x2e0da3[_0x2265('0x30')],'type':_0x2e0da3[_0x2265('0x31')][_0x2265('0x32')]};});_0x1f9392[_0x2265('0x33')]=_[_0x2265('0x34')](_0x2cf32f,_0x2265('0x2c'));_0x1f9392[_0x2265('0x35')]=_['keys'](_0x3fcd0b[_0x2265('0x35')]);_0x1f9392[_0x2265('0x36')]=_[_0x2265('0x37')](_0x1f9392[_0x2265('0x33')],_0x1f9392['query']);_0x1e50fb[_0x2265('0x38')]=_['intersection'](_0x1f9392[_0x2265('0x33')],qs[_0x2265('0x39')](_0x3fcd0b[_0x2265('0x35')][_0x2265('0x39')]));_0x1e50fb[_0x2265('0x38')]=_0x1e50fb[_0x2265('0x38')][_0x2265('0x3a')]?_0x1e50fb[_0x2265('0x38')]:_0x1f9392[_0x2265('0x33')];if(!_0x3fcd0b[_0x2265('0x35')][_0x2265('0x3b')](_0x2265('0x3c'))){_0x1e50fb[_0x2265('0x22')]=qs[_0x2265('0x22')](_0x3fcd0b[_0x2265('0x35')]['limit']);_0x1e50fb[_0x2265('0x21')]=qs['offset'](_0x3fcd0b['query'][_0x2265('0x21')]);}_0x1e50fb['order']=qs[_0x2265('0x3d')](_0x3fcd0b[_0x2265('0x35')][_0x2265('0x3d')]);_0x1e50fb[_0x2265('0x3e')]=qs['filters'](_[_0x2265('0x3f')](_0x3fcd0b[_0x2265('0x35')],_0x1f9392[_0x2265('0x36')]),_0x2cf32f);if(_0x3fcd0b[_0x2265('0x35')][_0x2265('0x40')]){_0x1e50fb['where']=_[_0x2265('0x41')](_0x1e50fb['where'],{'$or':_[_0x2265('0x34')](_0x2cf32f,function(_0x445454){if(_0x445454[_0x2265('0x31')]!==_0x2265('0x42')){var _0x110025={};_0x110025[_0x445454[_0x2265('0x2c')]]={'$like':'%'+_0x3fcd0b['query']['filter']+'%'};return _0x110025;}})});}_0x1e50fb=_[_0x2265('0x41')]({},_0x1e50fb,_0x3fcd0b['options']);var _0x3fc26c={'where':_0x1e50fb[_0x2265('0x3e')]};return db[_0x2265('0x2e')]['count'](_0x3fc26c)[_0x2265('0x29')](function(_0x2ddde9){_0x4f5e5c[_0x2265('0x20')]=_0x2ddde9;if(_0x3fcd0b[_0x2265('0x35')][_0x2265('0x43')]){_0x1e50fb[_0x2265('0x44')]=[{'all':!![]}];}return db[_0x2265('0x2e')][_0x2265('0x45')](_0x1e50fb);})[_0x2265('0x29')](function(_0x57b1b2){_0x4f5e5c[_0x2265('0x46')]=_0x57b1b2;return _0x4f5e5c;})['then'](respondWithFilteredResult(_0x48419e,_0x1e50fb))[_0x2265('0x47')](handleError(_0x48419e,null));};exports[_0x2265('0x48')]=function(_0xa22bfd,_0x3a575b){var _0xc01d1e={'raw':!![],'where':{'id':_0xa22bfd[_0x2265('0x49')]['id']}},_0x2a89a2={};_0x2a89a2[_0x2265('0x33')]=_['keys'](db[_0x2265('0x2e')][_0x2265('0x2f')]);_0x2a89a2[_0x2265('0x35')]=_['keys'](_0xa22bfd['query']);_0x2a89a2[_0x2265('0x36')]=_[_0x2265('0x37')](_0x2a89a2['model'],_0x2a89a2['query']);_0xc01d1e['attributes']=_[_0x2265('0x37')](_0x2a89a2['model'],qs[_0x2265('0x39')](_0xa22bfd[_0x2265('0x35')][_0x2265('0x39')]));_0xc01d1e[_0x2265('0x38')]=_0xc01d1e[_0x2265('0x38')][_0x2265('0x3a')]?_0xc01d1e[_0x2265('0x38')]:_0x2a89a2['model'];if(_0xa22bfd['query'][_0x2265('0x43')]){_0xc01d1e[_0x2265('0x44')]=[{'all':!![]}];}_0xc01d1e=_['merge']({},_0xc01d1e,_0xa22bfd[_0x2265('0x4a')]);return db[_0x2265('0x2e')][_0x2265('0x4b')](_0xc01d1e)[_0x2265('0x29')](handleEntityNotFound(_0x3a575b,null))[_0x2265('0x29')](respondWithResult(_0x3a575b,null))['catch'](handleError(_0x3a575b,null));};exports[_0x2265('0x4c')]=function(_0x28c590,_0x54cc15){return db[_0x2265('0x2e')][_0x2265('0x4c')](_0x28c590[_0x2265('0x4d')],{})['then'](respondWithResult(_0x54cc15,0xc9))['catch'](handleError(_0x54cc15,null));};exports[_0x2265('0x28')]=function(_0x44e5e1,_0x3e12c3){if(_0x44e5e1[_0x2265('0x4d')]['id']){delete _0x44e5e1[_0x2265('0x4d')]['id'];}return db['WhatsappTransferReport'][_0x2265('0x4b')]({'where':{'id':_0x44e5e1[_0x2265('0x49')]['id']}})[_0x2265('0x29')](handleEntityNotFound(_0x3e12c3,null))[_0x2265('0x29')](saveUpdates(_0x44e5e1[_0x2265('0x4d')],null))['then'](respondWithResult(_0x3e12c3,null))[_0x2265('0x47')](handleError(_0x3e12c3,null));};exports['destroy']=function(_0x2da2e0,_0x3eef52){return db[_0x2265('0x2e')]['find']({'where':{'id':_0x2da2e0[_0x2265('0x49')]['id']}})[_0x2265('0x29')](handleEntityNotFound(_0x3eef52,null))[_0x2265('0x29')](removeEntity(_0x3eef52,null))['catch'](handleError(_0x3eef52,null));};exports[_0x2265('0x4e')]=function(_0x2f182b,_0x2bdd23){return db[_0x2265('0x2e')][_0x2265('0x4e')]()[_0x2265('0x29')](respondWithResult(_0x2bdd23,null))[_0x2265('0x47')](handleError(_0x2bdd23,null));};
\ No newline at end of file
+var _0x973f=['sort','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','order'];(function(_0x1c0524,_0x17d33f){var _0x3c8ff6=function(_0x4dfbaa){while(--_0x4dfbaa){_0x1c0524['push'](_0x1c0524['shift']());}};_0x3c8ff6(++_0x17d33f);}(_0x973f,0x18d));var _0xf973=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x973f[_0x3511d3];return _0x5d6321;};'use strict';var emlformat=require(_0xf973('0x0'));var rimraf=require(_0xf973('0x1'));var zipdir=require(_0xf973('0x2'));var jsonpatch=require(_0xf973('0x3'));var rp=require(_0xf973('0x4'));var moment=require(_0xf973('0x5'));var BPromise=require(_0xf973('0x6'));var Mustache=require('mustache');var util=require(_0xf973('0x7'));var path=require('path');var sox=require(_0xf973('0x8'));var csv=require(_0xf973('0x9'));var ejs=require(_0xf973('0xa'));var fs=require('fs');var fs_extra=require(_0xf973('0xb'));var _=require('lodash');var squel=require(_0xf973('0xc'));var crypto=require(_0xf973('0xd'));var jsforce=require(_0xf973('0xe'));var deskjs=require(_0xf973('0xf'));var toCsv=require(_0xf973('0x9'));var querystring=require('querystring');var Papa=require(_0xf973('0x10'));var Redis=require(_0xf973('0x11'));var authService=require(_0xf973('0x12'));var qs=require(_0xf973('0x13'));var as=require(_0xf973('0x14'));var hardwareService=require(_0xf973('0x15'));var logger=require('../../config/logger')(_0xf973('0x16'));var utils=require(_0xf973('0x17'));var config=require(_0xf973('0x18'));var licenseUtil=require(_0xf973('0x19'));var db=require(_0xf973('0x1a'))['db'];function respondWithStatusCode(_0x359703,_0x39ab5e){_0x39ab5e=_0x39ab5e||0xcc;return function(_0xe33a78){if(_0xe33a78){return _0x359703['sendStatus'](_0x39ab5e);}return _0x359703[_0xf973('0x1b')](_0x39ab5e)[_0xf973('0x1c')]();};}function respondWithResult(_0x448ce0,_0x1da223){_0x1da223=_0x1da223||0xc8;return function(_0x166765){if(_0x166765){return _0x448ce0['status'](_0x1da223)[_0xf973('0x1d')](_0x166765);}};}function respondWithFilteredResult(_0x824794,_0x5a3a60){return function(_0x2bf956){if(_0x2bf956){var _0x39ad02=typeof _0x5a3a60[_0xf973('0x1e')]===_0xf973('0x1f')&&typeof _0x5a3a60['limit']===_0xf973('0x1f');var _0x334b64=_0x2bf956[_0xf973('0x20')];var _0x23693e=_0x39ad02?0x0:_0x5a3a60[_0xf973('0x1e')];var _0x4ccf53=_0x39ad02?_0x2bf956[_0xf973('0x20')]:_0x5a3a60[_0xf973('0x1e')]+_0x5a3a60[_0xf973('0x21')];var _0x4e98c2;if(_0x4ccf53>=_0x334b64){_0x4ccf53=_0x334b64;_0x4e98c2=0xc8;}else{_0x4e98c2=0xce;}_0x824794[_0xf973('0x1b')](_0x4e98c2);return _0x824794[_0xf973('0x22')](_0xf973('0x23'),_0x23693e+'-'+_0x4ccf53+'/'+_0x334b64)[_0xf973('0x1d')](_0x2bf956);}return null;};}function patchUpdates(_0x980eac){return function(_0x76e82e){try{jsonpatch['apply'](_0x76e82e,_0x980eac,!![]);}catch(_0x36c1bd){return BPromise[_0xf973('0x24')](_0x36c1bd);}return _0x76e82e[_0xf973('0x25')]();};}function saveUpdates(_0x1f7317,_0x3af519){return function(_0x175cf7){if(_0x175cf7){return _0x175cf7[_0xf973('0x26')](_0x1f7317)[_0xf973('0x27')](function(_0x4aa2ea){return _0x4aa2ea;});}return null;};}function removeEntity(_0xcc3f80,_0x49fc20){return function(_0x3284b8){if(_0x3284b8){return _0x3284b8['destroy']()[_0xf973('0x27')](function(){_0xcc3f80[_0xf973('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x173a39,_0x687420){return function(_0x147446){if(!_0x147446){_0x173a39[_0xf973('0x28')](0x194);}return _0x147446;};}function handleError(_0x11dde0,_0x12a202){_0x12a202=_0x12a202||0x1f4;return function(_0x201803){logger[_0xf973('0x29')](_0x201803[_0xf973('0x2a')]);if(_0x201803[_0xf973('0x2b')]){delete _0x201803[_0xf973('0x2b')];}_0x11dde0[_0xf973('0x1b')](_0x12a202)[_0xf973('0x2c')](_0x201803);};}exports[_0xf973('0x2d')]=function(_0x353a2b,_0x385920){var _0x1eb99c={},_0x582c27={},_0x5d5521={'count':0x0,'rows':[]};var _0x5c4532=_[_0xf973('0x2e')](db[_0xf973('0x2f')][_0xf973('0x30')],function(_0x4d9ae6){return{'name':_0x4d9ae6['fieldName'],'type':_0x4d9ae6[_0xf973('0x31')][_0xf973('0x32')]};});_0x582c27['model']=_[_0xf973('0x2e')](_0x5c4532,_0xf973('0x2b'));_0x582c27[_0xf973('0x33')]=_[_0xf973('0x34')](_0x353a2b[_0xf973('0x33')]);_0x582c27[_0xf973('0x35')]=_[_0xf973('0x36')](_0x582c27[_0xf973('0x37')],_0x582c27[_0xf973('0x33')]);_0x1eb99c[_0xf973('0x38')]=_['intersection'](_0x582c27[_0xf973('0x37')],qs['fields'](_0x353a2b[_0xf973('0x33')]['fields']));_0x1eb99c[_0xf973('0x38')]=_0x1eb99c[_0xf973('0x38')][_0xf973('0x39')]?_0x1eb99c['attributes']:_0x582c27[_0xf973('0x37')];if(!_0x353a2b[_0xf973('0x33')]['hasOwnProperty']('nolimit')){_0x1eb99c['limit']=qs[_0xf973('0x21')](_0x353a2b[_0xf973('0x33')][_0xf973('0x21')]);_0x1eb99c[_0xf973('0x1e')]=qs[_0xf973('0x1e')](_0x353a2b[_0xf973('0x33')][_0xf973('0x1e')]);}_0x1eb99c[_0xf973('0x3a')]=qs['sort'](_0x353a2b[_0xf973('0x33')][_0xf973('0x3b')]);_0x1eb99c['where']=qs[_0xf973('0x35')](_['pick'](_0x353a2b[_0xf973('0x33')],_0x582c27[_0xf973('0x35')]),_0x5c4532);if(_0x353a2b[_0xf973('0x33')][_0xf973('0x3c')]){_0x1eb99c['where']=_['merge'](_0x1eb99c[_0xf973('0x3d')],{'$or':_[_0xf973('0x2e')](_0x5c4532,function(_0x360727){if(_0x360727[_0xf973('0x31')]!==_0xf973('0x3e')){var _0x2d38b4={};_0x2d38b4[_0x360727[_0xf973('0x2b')]]={'$like':'%'+_0x353a2b[_0xf973('0x33')][_0xf973('0x3c')]+'%'};return _0x2d38b4;}})});}_0x1eb99c=_[_0xf973('0x3f')]({},_0x1eb99c,_0x353a2b[_0xf973('0x40')]);var _0x2402b1={'where':_0x1eb99c[_0xf973('0x3d')]};return db[_0xf973('0x2f')][_0xf973('0x20')](_0x2402b1)['then'](function(_0x1c3ca2){_0x5d5521[_0xf973('0x20')]=_0x1c3ca2;if(_0x353a2b[_0xf973('0x33')][_0xf973('0x41')]){_0x1eb99c[_0xf973('0x42')]=[{'all':!![]}];}return db[_0xf973('0x2f')]['findAll'](_0x1eb99c);})[_0xf973('0x27')](function(_0x5c33ce){_0x5d5521[_0xf973('0x43')]=_0x5c33ce;return _0x5d5521;})[_0xf973('0x27')](respondWithFilteredResult(_0x385920,_0x1eb99c))[_0xf973('0x44')](handleError(_0x385920,null));};exports[_0xf973('0x45')]=function(_0x401561,_0x4c92af){var _0x485c08={'raw':!![],'where':{'id':_0x401561[_0xf973('0x46')]['id']}},_0x4b151d={};_0x4b151d[_0xf973('0x37')]=_[_0xf973('0x34')](db['WhatsappTransferReport'][_0xf973('0x30')]);_0x4b151d[_0xf973('0x33')]=_[_0xf973('0x34')](_0x401561[_0xf973('0x33')]);_0x4b151d[_0xf973('0x35')]=_['intersection'](_0x4b151d[_0xf973('0x37')],_0x4b151d[_0xf973('0x33')]);_0x485c08[_0xf973('0x38')]=_['intersection'](_0x4b151d[_0xf973('0x37')],qs[_0xf973('0x47')](_0x401561[_0xf973('0x33')][_0xf973('0x47')]));_0x485c08[_0xf973('0x38')]=_0x485c08[_0xf973('0x38')][_0xf973('0x39')]?_0x485c08[_0xf973('0x38')]:_0x4b151d[_0xf973('0x37')];if(_0x401561[_0xf973('0x33')][_0xf973('0x41')]){_0x485c08['include']=[{'all':!![]}];}_0x485c08=_[_0xf973('0x3f')]({},_0x485c08,_0x401561[_0xf973('0x40')]);return db[_0xf973('0x2f')][_0xf973('0x48')](_0x485c08)['then'](handleEntityNotFound(_0x4c92af,null))[_0xf973('0x27')](respondWithResult(_0x4c92af,null))['catch'](handleError(_0x4c92af,null));};exports[_0xf973('0x49')]=function(_0x37fce5,_0x14db2d){return db[_0xf973('0x2f')][_0xf973('0x49')](_0x37fce5[_0xf973('0x4a')],{})[_0xf973('0x27')](respondWithResult(_0x14db2d,0xc9))[_0xf973('0x44')](handleError(_0x14db2d,null));};exports[_0xf973('0x26')]=function(_0xb0b06b,_0x37d92f){if(_0xb0b06b[_0xf973('0x4a')]['id']){delete _0xb0b06b[_0xf973('0x4a')]['id'];}return db['WhatsappTransferReport'][_0xf973('0x48')]({'where':{'id':_0xb0b06b['params']['id']}})['then'](handleEntityNotFound(_0x37d92f,null))[_0xf973('0x27')](saveUpdates(_0xb0b06b[_0xf973('0x4a')],null))[_0xf973('0x27')](respondWithResult(_0x37d92f,null))[_0xf973('0x44')](handleError(_0x37d92f,null));};exports['destroy']=function(_0x329fc4,_0x128d74){return db[_0xf973('0x2f')]['find']({'where':{'id':_0x329fc4[_0xf973('0x46')]['id']}})[_0xf973('0x27')](handleEntityNotFound(_0x128d74,null))['then'](removeEntity(_0x128d74,null))[_0xf973('0x44')](handleError(_0x128d74,null));};exports['describe']=function(_0x577b0c,_0x113a9c){return db[_0xf973('0x2f')][_0xf973('0x4b')]()['then'](respondWithResult(_0x113a9c,null))[_0xf973('0x44')](handleError(_0x113a9c,null));};
\ No newline at end of file
index 973f721..234667a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','WhatsappTransferReport','uniqueid','lodash'];(function(_0xdaf736,_0xd8c667){var _0x1090b3=function(_0x2eab2e){while(--_0x2eab2e){_0xdaf736['push'](_0xdaf736['shift']());}};_0x1090b3(++_0xd8c667);}(_0x55e7,0xf1));var _0x755e=function(_0x234cd7,_0x5c701f){_0x234cd7=_0x234cd7-0x0;var _0x5cc1d9=_0x55e7[_0x234cd7];return _0x5cc1d9;};'use strict';var _=require(_0x755e('0x0'));var util=require(_0x755e('0x1'));var logger=require(_0x755e('0x2'))(_0x755e('0x3'));var moment=require(_0x755e('0x4'));var BPromise=require(_0x755e('0x5'));var rp=require(_0x755e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x755e('0x7'));var config=require(_0x755e('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x160405,_0x477c30){return _0x160405['define'](_0x755e('0x9'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x755e('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc42=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','moment','bluebird','request-promise','./whatsappTransferReport.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc42,0x73));var _0x2dc4=function(_0x229564,_0x5e5fc6){_0x229564=_0x229564-0x0;var _0x5c8aaf=_0xdc42[_0x229564];return _0x5c8aaf;};'use strict';var _=require(_0x2dc4('0x0'));var util=require(_0x2dc4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2dc4('0x2'));var BPromise=require(_0x2dc4('0x3'));var rp=require(_0x2dc4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dc4('0x5'));module[_0x2dc4('0x6')]=function(_0x4fabd6,_0x27d99a){return _0x4fabd6[_0x2dc4('0x7')](_0x2dc4('0x8'),attributes,{'tableName':_0x2dc4('0x9'),'paranoid':![],'indexes':[{'name':_0x2dc4('0xa'),'fields':[_0x2dc4('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index d57af35..be6a8a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x370a=['code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bd1aa,_0x2077aa){var _0x4bf239=function(_0x51f621){while(--_0x51f621){_0x2bd1aa['push'](_0x2bd1aa['shift']());}};_0x4bf239(++_0x2077aa);}(_0x370a,0x130));var _0xa370=function(_0x55714e,_0xcd2d9c){_0x55714e=_0x55714e-0x0;var _0x56d301=_0x370a[_0x55714e];return _0x56d301;};'use strict';var _=require(_0xa370('0x0'));var util=require(_0xa370('0x1'));var moment=require(_0xa370('0x2'));var BPromise=require(_0xa370('0x3'));var rs=require(_0xa370('0x4'));var fs=require('fs');var Redis=require(_0xa370('0x5'));var db=require(_0xa370('0x6'))['db'];var utils=require(_0xa370('0x7'));var logger=require(_0xa370('0x8'))(_0xa370('0x9'));var config=require(_0xa370('0xa'));var jayson=require(_0xa370('0xb'));var client=jayson[_0xa370('0xc')][_0xa370('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5ed134,_0x4fa170,_0x1fbea5){return new BPromise(function(_0x29ea57,_0x598376){return client[_0xa370('0xe')](_0x5ed134,_0x1fbea5)['then'](function(_0x3a303a){logger[_0xa370('0xf')](_0xa370('0x10'),_0x4fa170,'request\x20sent');logger[_0xa370('0x11')](_0xa370('0x12'),_0x4fa170,'request\x20sent',JSON[_0xa370('0x13')](_0x3a303a));if(_0x3a303a[_0xa370('0x14')]){if(_0x3a303a['error'][_0xa370('0x15')]===0x1f4){logger[_0xa370('0x14')](_0xa370('0x10'),_0x4fa170,_0x3a303a[_0xa370('0x14')][_0xa370('0x16')]);return _0x598376(_0x3a303a['error'][_0xa370('0x16')]);}logger[_0xa370('0x14')](_0xa370('0x10'),_0x4fa170,_0x3a303a[_0xa370('0x14')]['message']);return _0x29ea57(_0x3a303a[_0xa370('0x14')]['message']);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x4fa170,_0xa370('0x17'));_0x29ea57(_0x3a303a['result'][_0xa370('0x16')]);}})[_0xa370('0x18')](function(_0x1f1ea9){logger['error'](_0xa370('0x10'),_0x4fa170,_0x1f1ea9);_0x598376(_0x1f1ea9);});});}
\ No newline at end of file
+var _0xb8f7=['jayson/promise','client','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4812c8,_0x38afe9){var _0xa33c4c=function(_0x164a2f){while(--_0x164a2f){_0x4812c8['push'](_0x4812c8['shift']());}};_0xa33c4c(++_0x38afe9);}(_0xb8f7,0xb4));var _0x7b8f=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb8f7[_0x45d3f0];return _0x314b79;};'use strict';var _=require(_0x7b8f('0x0'));var util=require('util');var moment=require(_0x7b8f('0x1'));var BPromise=require(_0x7b8f('0x2'));var rs=require(_0x7b8f('0x3'));var fs=require('fs');var Redis=require(_0x7b8f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b8f('0x5'));var logger=require(_0x7b8f('0x6'))(_0x7b8f('0x7'));var config=require(_0x7b8f('0x8'));var jayson=require(_0x7b8f('0x9'));var client=jayson[_0x7b8f('0xa')][_0x7b8f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a667f,_0x376751,_0x593e89){return new BPromise(function(_0x5ba2b4,_0x1fb187){return client['request'](_0x2a667f,_0x593e89)[_0x7b8f('0xc')](function(_0x3c391f){logger[_0x7b8f('0xd')](_0x7b8f('0xe'),_0x376751,'request\x20sent');logger[_0x7b8f('0xf')](_0x7b8f('0x10'),_0x376751,'request\x20sent',JSON['stringify'](_0x3c391f));if(_0x3c391f['error']){if(_0x3c391f[_0x7b8f('0x11')]['code']===0x1f4){logger[_0x7b8f('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x376751,_0x3c391f['error'][_0x7b8f('0x12')]);return _0x1fb187(_0x3c391f[_0x7b8f('0x11')][_0x7b8f('0x12')]);}logger[_0x7b8f('0x11')](_0x7b8f('0xe'),_0x376751,_0x3c391f['error'][_0x7b8f('0x12')]);return _0x5ba2b4(_0x3c391f[_0x7b8f('0x11')][_0x7b8f('0x12')]);}else{logger[_0x7b8f('0xd')](_0x7b8f('0xe'),_0x376751,_0x7b8f('0x13'));_0x5ba2b4(_0x3c391f['result']['message']);}})[_0x7b8f('0x14')](function(_0x16c1f6){logger['error'](_0x7b8f('0xe'),_0x376751,_0x16c1f6);_0x1fb187(_0x16c1f6);});});}
\ No newline at end of file
index b933be9..f596757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b3d=['default','listen','then','start','info','filter','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','join','status','online','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./config/seedDB','./rpc','./config/logger','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','seedDB'];(function(_0x1a69e5,_0xed12ee){var _0x244ab8=function(_0x556e78){while(--_0x556e78){_0x1a69e5['push'](_0x1a69e5['shift']());}};_0x244ab8(++_0xed12ee);}(_0x0b3d,0x76));var _0xd0b3=function(_0x13eddd,_0x2bb439){_0x13eddd=_0x13eddd-0x0;var _0x3125b5=_0x0b3d[_0x13eddd];return _0x3125b5;};'use strict';var _=require(_0xd0b3('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0xd0b3('0x1'));var checkLicense=require('./config/license');var rpc=require(_0xd0b3('0x2'));var config=require('./config/environment');var logger=require(_0xd0b3('0x3'))('app');var pm2=require(_0xd0b3('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xd0b3('0x5'));var chat=require(_0xd0b3('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd0b3('0x7'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xd0b3('0x8')]['sync']()['then'](function(){if(config[_0xd0b3('0x9')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0xd0b3('0xa')]();})['then'](function(){return rpc[_0xd0b3('0xb')]();})[_0xd0b3('0xc')](function(_0x5950d7){logger['info'](_0x5950d7);return chat[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(){return whatsapp[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(){return schedule['start']();})['then'](function(){return transcribe[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(){return provider[_0xd0b3('0xd')]();})[_0xd0b3('0xc')](function(_0x1f2544){logger[_0xd0b3('0xe')](_0x1f2544);return pm2[_0xd0b3('0xd')](pm2Config);})['then'](function(_0x2d1376){var _0xbd5d4=_0x2d1376[_0xd0b3('0xf')](function(_0x28d379){return typeof _0x28d379['exitCode']===_0xd0b3('0x10')&&_0x28d379[_0xd0b3('0x11')]>=0x0;});if(_0xbd5d4[_0xd0b3('0x12')]>0x0){throw new Error(_0xbd5d4['length']+_0xd0b3('0x13')+_[_0xd0b3('0x14')](_0xbd5d4,function(_0x50ea99){return'\x22'+_0x50ea99[_0xd0b3('0x15')][_0xd0b3('0x16')]+'\x22';}));}logger['info'](_0xd0b3('0x17'),_[_0xd0b3('0x14')](_[_0xd0b3('0xf')](_0x2d1376,{'status':'online'}),_0xd0b3('0x16'))[_0xd0b3('0x18')]());logger[_0xd0b3('0xe')]('Offline\x20apps:',_['map'](_[_0xd0b3('0xf')](_0x2d1376,function(_0x4f755f){return _0x4f755f[_0xd0b3('0x19')]!==_0xd0b3('0x1a');}),_0xd0b3('0x16'))[_0xd0b3('0x18')]()||_0xd0b3('0x1b'));console['log']('App\x20Ready!');})['catch'](function(_0x2925ae){console[_0xd0b3('0x1c')](_0xd0b3('0x1d'),_0x2925ae);logger[_0xd0b3('0x1e')](_0xd0b3('0x1f'),_0x2925ae);process['exit'](0x1);});}main();
\ No newline at end of file
+var _0x12e9=['Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/seedDB','./rpc','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','filter','join','Offline\x20apps:','status','online','log','catch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x12e9,0x66));var _0x912e=function(_0x22141e,_0x489b53){_0x22141e=_0x22141e-0x0;var _0x12539d=_0x12e9[_0x22141e];return _0x12539d;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0x912e('0x0'));var checkLicense=require('./config/license');var rpc=require(_0x912e('0x1'));var config=require(_0x912e('0x2'));var logger=require('./config/logger')(_0x912e('0x3'));var pm2=require(_0x912e('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x912e('0x5'));var chat=require(_0x912e('0x6'));var whatsapp=require(_0x912e('0x7'));var transcribe=require(_0x912e('0x8'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x912e('0x9')][_0x912e('0xa')]()[_0x912e('0xb')](function(){if(config[_0x912e('0xc')]){return seedDb[_0x912e('0xd')]();}})['then'](function(){return checkLicense['default']();})['then'](function(){return rpc[_0x912e('0xe')]();})[_0x912e('0xb')](function(_0x360119){logger[_0x912e('0xf')](_0x360119);return chat[_0x912e('0x10')]();})['then'](function(){return whatsapp[_0x912e('0x10')]();})[_0x912e('0xb')](function(){return schedule[_0x912e('0x10')]();})[_0x912e('0xb')](function(){return transcribe[_0x912e('0x10')]();})[_0x912e('0xb')](function(){return provider[_0x912e('0x10')]();})[_0x912e('0xb')](function(_0x3c153b){logger[_0x912e('0xf')](_0x3c153b);return pm2[_0x912e('0x10')](pm2Config);})[_0x912e('0xb')](function(_0x536c1b){var _0x3a02aa=_0x536c1b['filter'](function(_0x5144c2){return typeof _0x5144c2[_0x912e('0x11')]===_0x912e('0x12')&&_0x5144c2[_0x912e('0x11')]>=0x0;});if(_0x3a02aa['length']>0x0){throw new Error(_0x3a02aa['length']+_0x912e('0x13')+_[_0x912e('0x14')](_0x3a02aa,function(_0x265614){return'\x22'+_0x265614['pm2_env'][_0x912e('0x15')]+'\x22';}));}logger[_0x912e('0xf')](_0x912e('0x16'),_[_0x912e('0x14')](_[_0x912e('0x17')](_0x536c1b,{'status':'online'}),_0x912e('0x15'))[_0x912e('0x18')]());logger[_0x912e('0xf')](_0x912e('0x19'),_[_0x912e('0x14')](_[_0x912e('0x17')](_0x536c1b,function(_0x1efa84){return _0x1efa84[_0x912e('0x1a')]!==_0x912e('0x1b');}),_0x912e('0x15'))[_0x912e('0x18')]()||'None');console[_0x912e('0x1c')]('App\x20Ready!');})[_0x912e('0x1d')](function(_0x499e80){console[_0x912e('0x1c')](_0x912e('0x1e'),_0x499e80);logger['error'](_0x912e('0x1f'),_0x499e80);process[_0x912e('0x20')](0x1);});}main();
\ No newline at end of file
index b87f9e2..f366185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x432f0b,_0x289dff){var _0x36ebb4=function(_0x2f2999){while(--_0x2f2999){_0x432f0b['push'](_0x432f0b['shift']());}};_0x36ebb4(++_0x289dff);}(_0x55ca,0x126));var _0xa55c=function(_0x114ae4,_0x14bdc9){_0x114ae4=_0x114ae4-0x0;var _0x32f566=_0x55ca[_0x114ae4];return _0x32f566;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});}
\ No newline at end of file
+var _0xa41a=['passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','then','status','json','Wrong\x20credentials.','startsWith','Bearer','query','apikey','getUuid','find','sub','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','Forbidden','isWebrtcLicence','webrtc','isMiddleware','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','decryptString','length','splice','unshift','join','promisify','sign','secret','verify','secrets','session','randomBytes','now','toString','../../mysqldb','../../config/environment','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','util','moment','role','fullname','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','openchannelPause','pauseType','lastPauseAt','allowmessenger'];(function(_0x3619e2,_0x292475){var _0x2a5d63=function(_0x3137bc){while(--_0x3137bc){_0x3619e2['push'](_0x3619e2['shift']());}};_0x2a5d63(++_0x292475);}(_0xa41a,0x6b));var _0xaa41=function(_0x1484bb,_0x2ee5bc){_0x1484bb=_0x1484bb-0x0;var _0x4dd0e1=_0xa41a[_0x1484bb];return _0x4dd0e1;};'use strict';var db=require(_0xaa41('0x0'))['db'];var config=require(_0xaa41('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xaa41('0x2'));var encryptor=require(_0xaa41('0x3'));var _=require(_0xaa41('0x4'));var jwt=require(_0xaa41('0x5'));var expressJwt=require(_0xaa41('0x6'));var compose=require(_0xaa41('0x7'));var basicAuth=require(_0xaa41('0x8'));var crypto=require(_0xaa41('0x9'));var BPromise=require('bluebird');var util=require(_0xaa41('0xa'));var moment=require(_0xaa41('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xaa41('0xc'),_0xaa41('0xd'),'name',_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x10'),_0xaa41('0x11'),_0xaa41('0x12'),_0xaa41('0x13'),_0xaa41('0x14'),_0xaa41('0x15'),_0xaa41('0x16'),'smsPause',_0xaa41('0x17'),_0xaa41('0x18'),'showWebBar','lastLoginAt',_0xaa41('0x19'),'crudPermissions',_0xaa41('0x1a'),_0xaa41('0x1b'),_0xaa41('0x1c'),_0xaa41('0x1d'),_0xaa41('0x1e'),'phoneBarDnd',_0xaa41('0x1f'),_0xaa41('0x20'),_0xaa41('0x21'),_0xaa41('0x22'),_0xaa41('0x23'),_0xaa41('0x24'),_0xaa41('0x25'),'hotdesk',_0xaa41('0x26'),_0xaa41('0x27'),_0xaa41('0x28'),_0xaa41('0x29'),_0xaa41('0x2a'),_0xaa41('0x2b'),_0xaa41('0x2c'),_0xaa41('0x2d'),_0xaa41('0x2e'),'selectRecallMeCampaign','chatAutoanswer',_0xaa41('0x2f'),_0xaa41('0x30'),_0xaa41('0x31'),'smsAutoanswer',_0xaa41('0x32'),_0xaa41('0x33'),'openchannelAutoanswerDelay','faxAutoanswer',_0xaa41('0x34'),'whatsappAutoanswer',_0xaa41('0x35')];exports[_0xaa41('0x36')]=function(){return this[_0xaa41('0x37')](!![])[_0xaa41('0x38')](function(_0x1d623c,_0x4eb01f,_0x43c430){if(_0x1d623c[_0xaa41('0x39')]){_0x43c430();}else{return db[_0xaa41('0x3a')][_0xaa41('0x3b')]({'where':{'id':_0x1d623c[_0xaa41('0x3c')]['id']},'attributes':['id',_0xaa41('0x3d'),'disposition'],'raw':!![]})['then'](function(_0x16aec5){if(_0x16aec5&&_0x16aec5['closed']){return _0x4eb01f['status'](_0x16aec5[_0xaa41('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x16aec5[_0xaa41('0x3e')]===_0xaa41('0x3f')?_0xaa41('0x40'):_0xaa41('0x41')});}else{_0x43c430();}})[_0xaa41('0x42')](function(_0xa7269f){_0x43c430(_0xa7269f);});}});};exports['isAuthenticated']=function isAuthenticated(_0x30a174){return compose()[_0xaa41('0x38')](function(_0x63c18c,_0x9a16e3,_0x1d8c2b){var _0x4466a3;if(_0x63c18c[_0xaa41('0x43')][_0xaa41('0x44')]){if(_['startsWith'](_0x63c18c[_0xaa41('0x43')]['authorization'],'Basic')){var _0x714537=basicAuth(_0x63c18c);db[_0xaa41('0x45')]['find']({'where':{'name':_0x714537[_0xaa41('0x46')]}})[_0xaa41('0x47')](function(_0x4e3b44){if(!_0x4e3b44||!_0x4e3b44['authenticate'](_0x714537['pass'])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x4a')});}_0x63c18c[_0xaa41('0x39')]={'id':_0x4e3b44['id']};_0x1d8c2b();})['catch'](function(_0x289c4a){_0x1d8c2b(_0x289c4a);});}else if(_[_0xaa41('0x4b')](_0x63c18c[_0xaa41('0x43')]['authorization'],_0xaa41('0x4c'))){validateJwt(_0x63c18c,_0x9a16e3,_0x1d8c2b);}else{if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x63c18c[_0xaa41('0x4d')][_0xaa41('0x4e')]){try{var _0x57fe1d={'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};verifyJwt(_0x63c18c[_0xaa41('0x4d')]['apikey'],_0x57fe1d)[_0xaa41('0x47')](function(_0x48335f){return db[_0xaa41('0x45')][_0xaa41('0x50')]({'where':{'id':_0x48335f[_0xaa41('0x51')]}})['then'](function(_0x526377){_0x4466a3=_0x526377;return db['Setting'][_0xaa41('0x3b')]({'where':{'id':0x1},'attributes':[_0xaa41('0x52'),_0xaa41('0x53')],'raw':!![]});})[_0xaa41('0x47')](function(_0x4fbb92){if(!_0x4466a3||!_['isEqual'](_0x4466a3[_0xaa41('0x54')],_0x48335f[_0xaa41('0x55')])){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x56')});}if(_0x4466a3[_0xaa41('0x57')]){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}if(_0x4466a3[_0xaa41('0x59')]){if(_0x4fbb92[_0xaa41('0x53')]>0x0){if(moment(_0x4466a3[_0xaa41('0x5a')])['add'](_0x4fbb92['blockDuration'],_0xaa41('0x5b'))>moment()){return _0x9a16e3[_0xaa41('0x48')](0x191)['json']({'message':_0xaa41('0x58')});}}else{return _0x9a16e3['status'](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});}}_0x63c18c[_0xaa41('0x39')]={'id':_0x4466a3['id']};_0x1d8c2b();});})[_0xaa41('0x42')](function(){return _0x9a16e3[_0xaa41('0x48')](0x191)[_0xaa41('0x49')]({'message':_0xaa41('0x58')});});}catch(_0x21f204){_0x1d8c2b(_0x21f204);}}else if(_0x30a174){_0x1d8c2b();}else{return _0x9a16e3['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5c')});}})[_0xaa41('0x38')](function(_0x398c35,_0xc84fb8,_0x1e2eb2){if(_0x398c35['user']){db['User'][_0xaa41('0x50')]({'where':{'id':_0x398c35['user']['id']},'attributes':userAttributes})[_0xaa41('0x47')](function(_0x215896){if(!_0x215896){return _0xc84fb8[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x5d')});}_0x398c35[_0xaa41('0x39')]=_0x215896;_0x1e2eb2();})[_0xaa41('0x42')](function(_0x5ee74c){_0x1e2eb2(_0x5ee74c);});}else if(_0x30a174){_0x1e2eb2();}else{return _0xc84fb8[_0xaa41('0x48')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xaa41('0x5e')]=function canUpdate(){return compose()['use'](function(_0x57240d,_0x5274c9,_0x3bad48){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x198716){if(_0x198716['update']){_0x3bad48();}else{return _0x5274c9['status'](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})[_0xaa41('0x42')](function(_0x2af8ba){_0x3bad48(_0x2af8ba);});});};exports[_0xaa41('0x60')]=function isWebrtcLicence(){return compose()[_0xaa41('0x38')](function(_0x258096,_0x37bf5d,_0x2fa6ec){return licenseUtil['getLicense']()[_0xaa41('0x47')](function(_0x22d512){if(_0x22d512[_0xaa41('0x61')]){_0x2fa6ec();}else{return _0x37bf5d[_0xaa41('0x48')](0x193)[_0xaa41('0x49')]({'message':_0xaa41('0x5f')});}})['catch'](function(_0x406824){_0x2fa6ec(_0x406824);});});};exports[_0xaa41('0x62')]=function(_0x1f50c,_0x2288f8,_0x57d1f6){_0x1f50c[_0xaa41('0x62')]=!![];return _0x57d1f6();};exports['signToken']=function signToken(_0x49fedd){return signJwt(_0x49fedd);};exports[_0xaa41('0x63')]=function(_0xe0eec0,_0x3e16ef){if(!_0xe0eec0['user']){return _0x3e16ef[_0xaa41('0x48')](0x194)[_0xaa41('0x49')]({'message':_0xaa41('0x64')});}var _0x48fa37={'payload':{'id':_0xe0eec0[_0xaa41('0x39')]['id'],'role':_0xe0eec0[_0xaa41('0x39')][_0xaa41('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x48fa37)[_0xaa41('0x47')](function(_0x37fbe2){_0x3e16ef[_0xaa41('0x65')](_0xaa41('0x66'),_0x37fbe2);_0x3e16ef[_0xaa41('0x67')]('/dashboards/general');})[_0xaa41('0x42')](function(_0x5bef5f){return _0x3e16ef['status'](0x1f4)[_0xaa41('0x68')](_0x5bef5f);});};exports[_0xaa41('0x69')]=function(_0x3fef3e){if(_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x54')])||_[_0xaa41('0x6a')](_0x3fef3e[_0xaa41('0x6b')])){return null;}else{return createJwt(_0x3fef3e);}};exports[_0xaa41('0x6c')]=function(_0x519e39){_0x519e39[_0xaa41('0x54')]=generateNonce();_0x519e39[_0xaa41('0x6b')]=generateIssuedAt();return createJwt(_0x519e39);};exports[_0xaa41('0x6d')]=function(_0x4f9e92,_0x2e0f53){var _0x35f664=_0x4f9e92['query'][_0xaa41('0x4e')];if(_0x35f664){var _0xd36d1a={'nonce':_0x2e0f53[_0xaa41('0x54')],'iat':_0x2e0f53['apiKeyIat'],'audience':hardwareConf[_0xaa41('0x4f')](),'issuer':hardwareConf[_0xaa41('0x4f')]()};return verifyJwt(_0x35f664,_0xd36d1a)['then'](function(){return generateApiKey(_0x2e0f53);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xaa41('0x6e')]=function(_0x3cd14f){var _0x3a29d2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3a29d2['test'](_0x3cd14f))throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0xaa41('0x71'));return;};exports[_0xaa41('0x72')]=function(_0x2abb78,_0x5ccdc5,_0x2ae70c){var _0x57cb70=encryptor['decryptString'](_0x5ccdc5)[_0xaa41('0x73')](',');for(var _0x52ae7f=0x0;_0x52ae7f<_0x2ae70c;_0x52ae7f++){if(!_0x57cb70[_0x52ae7f])break;if(_0x2abb78[_0xaa41('0x74')]()===_0x57cb70[_0x52ae7f][_0xaa41('0x74')]()){var _0x169ddf=util['format'](_0xaa41('0x75'),_0x2ae70c);if(_0x2ae70c===0x1){_0x169ddf=_0xaa41('0x76');}throw new db[(_0xaa41('0x6f'))][(_0xaa41('0x70'))](_0x169ddf);}}return;};exports[_0xaa41('0x77')]=function(_0x332a3c,_0xc56018){var _0x337059=_0xc56018?encryptor[_0xaa41('0x78')](_0xc56018)['split'](','):[];if(_0x337059[_0xaa41('0x79')]===0x5){_0x337059[_0xaa41('0x7a')](-0x1,0x1);}_0x337059[_0xaa41('0x7b')](_0x332a3c);return encryptor['encryptString'](_0x337059[_0xaa41('0x7c')](','));};function signJwt(_0x2caf5c){var _0x157898=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x7e')],{'context':jwt});var _0xfbe748=_0x2caf5c[_0xaa41('0x7f')]||config['secrets']['session'];return new BPromise(function(_0x5cb34d,_0x540325){_0x157898(_0x2caf5c['payload'],_0xfbe748,_0x2caf5c['options'])[_0xaa41('0x47')](function(_0x50b598){_0x5cb34d(_0x50b598);})['catch'](function(_0x24c6f3){_0x540325(_0x24c6f3);});});}function verifyJwt(_0x40a524,_0x1a877b,_0x312eee){var _0x5cabc4=BPromise[_0xaa41('0x7d')](jwt[_0xaa41('0x80')],{'context':jwt});var _0x1ddb6c=_0x312eee||config[_0xaa41('0x81')][_0xaa41('0x82')];return new BPromise(function(_0x41ca40,_0x46ebcd){_0x5cabc4(_0x40a524,_0x1ddb6c,_0x1a877b)[_0xaa41('0x47')](function(_0x1795d1){_0x41ca40(_0x1795d1);})['catch'](function(_0x185600){_0x46ebcd(_0x185600);});});}function generateNonce(){return crypto[_0xaa41('0x83')](0x10)['toString']('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xaa41('0x84')]()/0x3e8)['toString']();}function createJwt(_0x1eac4a){var _0x5c8028={'payload':{'iat':_0x1eac4a[_0xaa41('0x6b')],'nonce':_0x1eac4a[_0xaa41('0x54')]},'options':{'algorithm':'HS512','subject':_0x1eac4a['id'][_0xaa41('0x85')](),'issuer':hardwareConf[_0xaa41('0x4f')](),'audience':hardwareConf[_0xaa41('0x4f')]()}};return signJwt(_0x5c8028)[_0xaa41('0x47')](function(_0x5a2683){return{'iat':_0x1eac4a['apiKeyIat'],'nonce':_0x1eac4a[_0xaa41('0x54')],'token':_0x5a2683};});}
\ No newline at end of file
index f273383..2702881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['parseQueryParameters','where','default','fields','filter','user','clause','skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','describe','CmContact','startsWith','cf_','map','CmCustomField','fieldType','type','keys','lodash','../../mysqldb','skipContactsQuery','getContactsSubquery','resolve','then','search','parseAdvancedSearchFilter'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0xb7e7,0x121));var _0x7b7e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb7e7[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x7b7e('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0x7b7e('0x1'))['db'];exports['findAll']=function(_0x1b7cc7,_0x54a37f,_0x3f5804,_0x556d68){var _0x31d0ed={'count':0x0,'rows':[]};var _0x118577=sqlUtils[_0x7b7e('0x2')](_0x54a37f,_0x1b7cc7);if(_0x118577){return Promise['resolve'](_0x31d0ed);}var _0x53ed64=sqlUtils[_0x7b7e('0x3')]();var _0x372bde={};var _0x7f87e0=![];var _0x55ce81=![];return Promise[_0x7b7e('0x4')]()[_0x7b7e('0x5')](function(){if(_0x1b7cc7[_0x7b7e('0x6')]){return sqlUtils[_0x7b7e('0x7')](_0x1b7cc7[_0x7b7e('0x6')],_0x556d68);}else{return sqlUtils[_0x7b7e('0x8')](_0x1b7cc7,_0x556d68);}})[_0x7b7e('0x5')](function(_0x52de3b){_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xa')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xb')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xc')]);_0x53ed64[_0x7b7e('0x9')](_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xe')]);_0x372bde=_0x52de3b['tags'];_0x55ce81=_0x52de3b[_0x7b7e('0xd')][_0x7b7e('0xf')];return sqlUtils['checkListsRestrictions'](_0x54a37f,_0x1b7cc7,_0x55ce81);})[_0x7b7e('0x5')](function(_0x5976ac){_0x53ed64['where'](_0x5976ac);var _0x2889ed=_0x1b7cc7[_0x7b7e('0x6')]?_0x372bde[_0x7b7e('0x10')]:_0x1b7cc7[_0x7b7e('0x11')];_0x7f87e0=_0x2889ed?!![]:![];return sqlUtils[_0x7b7e('0x12')](_0x53ed64,_0x2889ed);})['then'](function(_0x51baf6){_0x31d0ed[_0x7b7e('0x13')]=_0x51baf6;if(_0x31d0ed[_0x7b7e('0x13')]===0x0){return;}return sqlUtils[_0x7b7e('0x14')](_0x53ed64,_0x1b7cc7[_0x7b7e('0xb')],_0x3f5804,_0x7f87e0,_0x372bde[_0x7b7e('0xe')],_0x55ce81);})[_0x7b7e('0x5')](function(_0x242368){if(!_0x242368){return[];}return sqlUtils[_0x7b7e('0x15')](_0x242368,_0x1b7cc7,_0x3f5804);})[_0x7b7e('0x5')](function(_0x429a0e){_0x31d0ed[_0x7b7e('0x16')]=_0x429a0e;return _0x31d0ed;})[_0x7b7e('0x17')](function(_0x448980){throw _0x448980;});};exports[_0x7b7e('0x18')]=function(){var _0x9776c3={};var _0x864287=[];return db[_0x7b7e('0x19')]['describe']()[_0x7b7e('0x5')](function(_0x43db4f){_0x9776c3=_0x43db4f;var _0x24718c=Object['keys'](_0x9776c3)[_0x7b7e('0xc')](function(_0xbf0cb3){return _[_0x7b7e('0x1a')](_0xbf0cb3,_0x7b7e('0x1b'))?_0xbf0cb3:undefined;});var _0x2b7211=_0x24718c[_0x7b7e('0x1c')](function(_0x28bf43){return db[_0x7b7e('0x1d')]['findOne']({'where':{'id':_0x28bf43['slice'](0x3)},'raw':!![]});});return Promise['all'](_0x2b7211);})[_0x7b7e('0x5')](function(_0x22598e){for(var _0x23bfa3=0x0;_0x23bfa3<_0x22598e['length'];_0x23bfa3++){if(_0x22598e[_0x23bfa3]){var _0x51d3b1='cf_'+_0x22598e[_0x23bfa3]['id'];_0x9776c3[_0x51d3b1][_0x7b7e('0x1e')]=_0x22598e[_0x23bfa3][_0x7b7e('0x1f')];}}_0x864287=_[_0x7b7e('0x1c')](Object[_0x7b7e('0x20')](_0x9776c3),function(_0x3ceaf5){return{'name':_0x3ceaf5,'type':_0x9776c3[_0x3ceaf5]['type']};});return _0x864287;})[_0x7b7e('0x17')](function(_0x21a15){throw _0x21a15;});};
\ No newline at end of file
+var _0x5f2f=['rows','catch','keys','filter','startsWith','cf_','map','CmCustomField','findOne','slice','length','fieldType','type','lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','parseQueryParameters','where','fields','user','clause','tags','skip','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts'];(function(_0x21800e,_0x3b5490){var _0x463dbc=function(_0xdb07e2){while(--_0xdb07e2){_0x21800e['push'](_0x21800e['shift']());}};_0x463dbc(++_0x3b5490);}(_0x5f2f,0x73));var _0xf5f2=function(_0x217d9a,_0x3700e8){_0x217d9a=_0x217d9a-0x0;var _0x4aabeb=_0x5f2f[_0x217d9a];return _0x4aabeb;};'use strict';var _=require(_0xf5f2('0x0'));var sqlUtils=require(_0xf5f2('0x1'));var db=require(_0xf5f2('0x2'))['db'];exports[_0xf5f2('0x3')]=function(_0x1172dd,_0x174bc7,_0x3c72ee,_0x107cf){var _0x501fbd={'count':0x0,'rows':[]};var _0x4854b6=sqlUtils[_0xf5f2('0x4')](_0x174bc7,_0x1172dd);if(_0x4854b6){return Promise[_0xf5f2('0x5')](_0x501fbd);}var _0xad7f65=sqlUtils[_0xf5f2('0x6')]();var _0x3133bc={};var _0x473100=![];var _0x5907aa=![];return Promise[_0xf5f2('0x5')]()[_0xf5f2('0x7')](function(){if(_0x1172dd[_0xf5f2('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x1172dd[_0xf5f2('0x8')],_0x107cf);}else{return sqlUtils[_0xf5f2('0x9')](_0x1172dd,_0x107cf);}})[_0xf5f2('0x7')](function(_0x4e0e6b){_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['default']);_0xad7f65['where'](_0x4e0e6b[_0xf5f2('0xb')]);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b['filter']);_0xad7f65[_0xf5f2('0xa')](_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xd')]);_0x3133bc=_0x4e0e6b[_0xf5f2('0xe')];_0x5907aa=_0x4e0e6b[_0xf5f2('0xc')][_0xf5f2('0xf')];return sqlUtils['checkListsRestrictions'](_0x174bc7,_0x1172dd,_0x5907aa);})[_0xf5f2('0x7')](function(_0xea612c){_0xad7f65[_0xf5f2('0xa')](_0xea612c);var _0x1c1a5c=_0x1172dd[_0xf5f2('0x8')]?_0x3133bc['ids']:_0x1172dd[_0xf5f2('0x10')];_0x473100=_0x1c1a5c?!![]:![];return sqlUtils[_0xf5f2('0x11')](_0xad7f65,_0x1c1a5c);})[_0xf5f2('0x7')](function(_0x1b6dd2){_0x501fbd[_0xf5f2('0x12')]=_0x1b6dd2;if(_0x501fbd[_0xf5f2('0x12')]===0x0){return;}return sqlUtils[_0xf5f2('0x13')](_0xad7f65,_0x1172dd[_0xf5f2('0xb')],_0x3c72ee,_0x473100,_0x3133bc[_0xf5f2('0xd')],_0x5907aa);})[_0xf5f2('0x7')](function(_0x20fccd){if(!_0x20fccd){return[];}return sqlUtils[_0xf5f2('0x14')](_0x20fccd,_0x1172dd,_0x3c72ee);})[_0xf5f2('0x7')](function(_0x3ee69){_0x501fbd[_0xf5f2('0x15')]=_0x3ee69;return _0x501fbd;})[_0xf5f2('0x16')](function(_0x1bf655){throw _0x1bf655;});};exports['describe']=function(){var _0x34706d={};var _0x47101e=[];return db['CmContact']['describe']()[_0xf5f2('0x7')](function(_0x388e6c){_0x34706d=_0x388e6c;var _0x4ae323=Object[_0xf5f2('0x17')](_0x34706d)[_0xf5f2('0x18')](function(_0x39e44a){return _[_0xf5f2('0x19')](_0x39e44a,_0xf5f2('0x1a'))?_0x39e44a:undefined;});var _0x4c691a=_0x4ae323[_0xf5f2('0x1b')](function(_0x4669a6){return db[_0xf5f2('0x1c')][_0xf5f2('0x1d')]({'where':{'id':_0x4669a6[_0xf5f2('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x4c691a);})['then'](function(_0x5f1124){for(var _0x3f79d5=0x0;_0x3f79d5<_0x5f1124[_0xf5f2('0x1f')];_0x3f79d5++){if(_0x5f1124[_0x3f79d5]){var _0x1a5bb3=_0xf5f2('0x1a')+_0x5f1124[_0x3f79d5]['id'];_0x34706d[_0x1a5bb3][_0xf5f2('0x20')]=_0x5f1124[_0x3f79d5][_0xf5f2('0x21')];}}_0x47101e=_[_0xf5f2('0x1b')](Object[_0xf5f2('0x17')](_0x34706d),function(_0x4ab014){return{'name':_0x4ab014,'type':_0x34706d[_0x4ab014][_0xf5f2('0x21')]};});return _0x47101e;})[_0xf5f2('0x16')](function(_0x375ca8){throw _0x375ca8;});};
\ No newline at end of file
index 45bff8b..b86bae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x919c=['parseSearch','sqlOperator','conditions','find','fieldType','castTo','DATE','default','text','value','start','end','Tag','map','tags','clause','and','ids','uc.UserId\x20=\x20?','user','skip','keys','some','name','compact','Contact','c.ListId\x20IN\x20?','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','c.ListId\x20IS\x20NULL','attributes','group','limit','offset','subqry.id','having','order','DESC','findAll','keyBy','Sequelize','QueryTypes','SELECT','sequelize','toString','Tags','clone','COUNT(*)','exports','squel','../parsers/advancedSearch','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','firstName','lastName','phone','mobile','email','CompanyId','updatedAt','deletedAt','TagIds','includes','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x919c,0x108));var _0xc919=function(_0x4bb2f0,_0xc7dae3){_0x4bb2f0=_0x4bb2f0-0x0;var _0x2ade54=_0x919c[_0x4bb2f0];return _0x2ade54;};'use strict';var _=require('lodash');var squel=require(_0xc919('0x0'));var as=require(_0xc919('0x1'));var qs=require('../parsers/qs');var utils=require(_0xc919('0x2'));var db=require(_0xc919('0x3'))['db'];function skipContactsQuery(_0x559acf,_0x17727d){var _0x3fc2e7=![];if(_0x559acf[_0xc919('0x4')]===_0xc919('0x5')&&!_0x17727d[_0xc919('0x6')]&&!_0x17727d[_0xc919('0x7')]&&_0x17727d[_0xc919('0x8')]!==_0xc919('0x9')){_0x3fc2e7=!![];}return _0x3fc2e7;}function getContactsSubquery(){return squel['select']()[_0xc919('0xa')](_0xc919('0xb'),'c')[_0xc919('0xc')](_0xc919('0xd'));}function applyJoinClauses(_0x1d6f28,_0x53306e){var _0x16c306=_0x53306e?'c':_0xc919('0xe');_0x1d6f28[_0xc919('0xf')](_0xc919('0x10'),'uc',_0xc919('0x11')+_0x16c306+_0xc919('0x12'))[_0xc919('0xf')](_0xc919('0x13'),'ct',_0xc919('0x14')+_0x16c306+_0xc919('0x12'))['left_join'](_0xc919('0x15'),'t','t.id\x20=\x20ct.TagId');return _0x1d6f28;}function addFieldsToQuery(_0x17a7a8,_0xf8cae7,_0x260ec0,_0xa4adba,_0x574232){var _0x337685=_0x574232?'c':_0xc919('0xe');if(!_0xf8cae7){_0xf8cae7=['id',_0xc919('0x16'),_0xc919('0x17'),_0xc919('0x18'),_0xc919('0x19'),'fax',_0xc919('0x1a'),_0xc919('0x7'),_0xc919('0x1b'),'createdAt',_0xc919('0x1c'),_0xc919('0x1d'),_0xc919('0x1e')];}else if(!_0xf8cae7[_0xc919('0x1f')]('id')){_0xf8cae7[_0xc919('0x20')]('id');}var _0x4c2bcb=_0x260ec0&&_0x574232||!_0x260ec0&&!_0x574232;if(_0xa4adba){_0x4c2bcb=_0xa4adba&&_0x574232||!_0xa4adba&&!_0x574232;}_0xf8cae7[_0xc919('0x21')](function(_0xd2bec9){if(_0xd2bec9==='TagIds'){if(_0x4c2bcb){_0x17a7a8['field'](_0xc919('0x22'),_0xd2bec9);}else if(_0x260ec0||_0xa4adba){_0x17a7a8[_0xc919('0x23')](_0x337685+'.'+_0xd2bec9);}}else{_0x17a7a8[_0xc919('0x23')](_0x337685+'.'+_0xd2bec9);}});return _0x17a7a8;}function getSqlClauses(){var _0x113e75={'default':squel[_0xc919('0x24')](),'fields':squel['expr'](),'filter':squel[_0xc919('0x24')](),'tags':{'clause':squel[_0xc919('0x24')](),'ids':null},'user':{'clause':squel[_0xc919('0x24')](),'skip':![]}};return _0x113e75;}function parseTagParameter(_0x2da8e7){var _0x4b18a9=squel[_0xc919('0x24')]();if(_0x2da8e7){var _0x1a9c6c=utils[_0xc919('0x25')](_0x2da8e7);_0x1a9c6c[_0xc919('0x21')](function(_0x25c203){_0x4b18a9['or'](_0xc919('0x26'),'%,'+_0x25c203+',%');});}return _0x4b18a9;}function parseSearchFilter(_0x17d348){var _0x3fd26e=squel[_0xc919('0x24')]();if(_0x17d348){var _0x4a464e=_0x17d348[_0xc919('0x27')]('\x5c','\x5c\x5c')[_0xc919('0x27')](/'/g,'\x27\x27');if(_0x4a464e[_0xc919('0x28')]('\x20')[_0xc919('0x29')]>0x1){_0x3fd26e['or'](_0xc919('0x2a'),qs[_0xc919('0x2b')](_0x4a464e),null);}else{if(qs[_0xc919('0x2c')](_0x4a464e)){_0x3fd26e['or'](_0xc919('0x2d'),_0x4a464e+'%');_0x3fd26e['or']('c.phone\x20LIKE\x20?',_0x4a464e+'%');_0x3fd26e['or'](_0xc919('0x2e'),_0x4a464e+'%');_0x3fd26e['or'](_0xc919('0x2f'),_0x4a464e+'%');}else if(qs[_0xc919('0x30')](_0x4a464e)){_0x3fd26e['or'](_0xc919('0x31'),_0x4a464e+'%');}else{_0x3fd26e['or'](_0xc919('0x32'),'%'+_0x4a464e+'%');_0x3fd26e['or']('c.lastName\x20LIKE\x20?','%'+_0x4a464e+'%');_0x3fd26e['or'](_0xc919('0x31'),'%'+_0x4a464e+'%');}}}return _0x3fd26e;}function parseAdvancedSearchFilter(_0x4993f8,_0x683064){var _0x2be52c=getSqlClauses();var _0x5d8255=as[_0xc919('0x33')](_0x4993f8);var _0x26a577=_0x5d8255[_0xc919('0x34')];for(var _0x2d1206=0x0;_0x2d1206<_0x5d8255[_0xc919('0x35')]['length'];_0x2d1206++){var _0x40894e=_0x5d8255[_0xc919('0x35')][_0x2d1206];var _0x2193b6='c';var _0x1b2136=_[_0xc919('0x36')](_0x683064,['name',_0x40894e[_0xc919('0x23')]]);if(_0x1b2136){if(_0x40894e[_0xc919('0x23')]==='dateOfBirth'||_0x1b2136[_0xc919('0x37')]==='datetime'){_0x40894e[_0xc919('0x38')]=_0xc919('0x39');}var _0x529e79=as['buildExpression'](_0x2193b6,_0x1b2136['type'],_0x40894e);_0x2be52c[_0xc919('0x3a')][_0x26a577](_0x529e79[_0xc919('0x3b')],_0x529e79[_0xc919('0x3c')][_0xc919('0x3d')],_0x529e79[_0xc919('0x3c')][_0xc919('0x3e')]);}else{if(_0x40894e['field']===_0xc919('0x3f')){var _0xd59867=_0x40894e[_0xc919('0x3c')]['split'](',')[_0xc919('0x40')](function(_0x3d7c0f){return Number(_0x3d7c0f);});var _0x283cc5=parseTagParameter(_0xd59867);_0x2be52c[_0xc919('0x41')][_0xc919('0x42')][_0xc919('0x43')](_0x283cc5);_0x2be52c[_0xc919('0x41')][_0xc919('0x44')]=_0xd59867;}else if(_0x40894e[_0xc919('0x23')]==='User'){_0x2be52c['user'][_0xc919('0x42')][_0xc919('0x43')](_0xc919('0x45'),_0x40894e['value']);_0x2be52c[_0xc919('0x46')][_0xc919('0x47')]=!![];}}}return _0x2be52c;}function parseModelFields(_0x39258a,_0xd449d7){var _0xe1f533=squel[_0xc919('0x24')]();var _0x26ac16=_(_0x39258a)[_0xc919('0x48')]()[_0xc919('0x40')](function(_0x17a042){return _[_0xc919('0x49')](_0xd449d7,[_0xc919('0x4a'),_0x17a042])?_0x17a042:undefined;})[_0xc919('0x4b')]()['value']();if(_0x39258a[_0xc919('0x4c')]){_0x26ac16[_0xc919('0x20')](_0xc919('0x4c'));}if(_0x26ac16[_0xc919('0x29')]>0x0){_0x26ac16['forEach'](function(_0x1ac687){if(_0x1ac687==='ListId'){_0xe1f533[_0xc919('0x43')](_0xc919('0x4d'),[]['concat'](_0x39258a[_0x1ac687]));}else if(_0x1ac687===_0xc919('0x4c')){var _0x41f2af='%'+_0x39258a[_0x1ac687]+'%';_0xe1f533[_0xc919('0x43')](_0xc919('0x4e'),_0x41f2af);}else{_0xe1f533[_0xc919('0x43')]('c.'+_0x1ac687+_0xc919('0x4f'),_0x39258a[_0x1ac687]);}});}return _0xe1f533;}function parseQueryParameters(_0x8a7847,_0x17d021){var _0x1fbd7d=getSqlClauses();return Promise[_0xc919('0x50')]()[_0xc919('0x51')](function(){return parseModelFields(_0x8a7847,_0x17d021);})[_0xc919('0x51')](function(_0x473f0e){_0x1fbd7d[_0xc919('0x52')]['and'](_0x473f0e);return parseTagParameter(_0x8a7847[_0xc919('0x53')]);})['then'](function(_0x28a7a4){_0x1fbd7d[_0xc919('0x41')][_0xc919('0x42')][_0xc919('0x43')](_0x28a7a4);return parseSearchFilter(_0x8a7847[_0xc919('0x54')]);})[_0xc919('0x51')](function(_0x5b81d2){_0x1fbd7d[_0xc919('0x54')]=_0x5b81d2;return _0x1fbd7d;});}function checkListsRestrictions(_0x347bdb,_0x473085,_0x396759){var _0x59344e=squel[_0xc919('0x24')]();return Promise[_0xc919('0x50')]()[_0xc919('0x51')](function(){if(_0x473085['search']&&_0x347bdb[_0xc919('0x4')]===_0xc919('0x5')&&!_0x396759){return _0x347bdb['getLists']({'attributes':['id'],'raw':!![]});}})[_0xc919('0x51')](function(_0x1e370f){if(_0x1e370f){if(_0x1e370f[_0xc919('0x29')]===0x0){_0x59344e[_0xc919('0x43')](_0xc919('0x55'));}else{_0x59344e[_0xc919('0x43')](_0xc919('0x4d'),_[_0xc919('0x40')](_0x1e370f,'id'));}}})['then'](function(){return _0x59344e;});}function buildContactsQuery(_0x471840,_0x1986c5,_0x5758ca,_0x4095f8,_0xcced9f,_0x2f0ec5){if(_0x1986c5){_0x1986c5=_0x5758ca[_0xc919('0x56')];}_0x471840=addFieldsToQuery(_0x471840,_0x1986c5,_0x4095f8,_0x2f0ec5,!![]);var _0x3c8acd=squel['select']();_0x3c8acd=addFieldsToQuery(_0x3c8acd,_0x1986c5,_0x4095f8,_0x2f0ec5,![]);if(_0x4095f8||_0x2f0ec5){_0x471840=applyJoinClauses(_0x471840,!![]);_0x471840[_0xc919('0x57')]('c.id');if(_0x5758ca[_0xc919('0x58')]){_0x3c8acd[_0xc919('0x58')](_0x5758ca[_0xc919('0x58')]);}if(_0x5758ca[_0xc919('0x59')]){_0x3c8acd[_0xc919('0x59')](_0x5758ca[_0xc919('0x59')]);}}else{_0x3c8acd=applyJoinClauses(_0x3c8acd,![]);_0x3c8acd['group'](_0xc919('0x5a'));if(_0x5758ca[_0xc919('0x58')]){_0x471840[_0xc919('0x58')](_0x5758ca['limit']);}if(_0x5758ca[_0xc919('0x59')]){_0x471840[_0xc919('0x59')](_0x5758ca[_0xc919('0x59')]);}}_0x3c8acd[_0xc919('0x5b')](_0xcced9f);if(_0x5758ca[_0xc919('0x5c')]){_0x5758ca[_0xc919('0x5c')][_0xc919('0x21')](function(_0x3ea925){_0x471840[_0xc919('0x5c')]('c.'+_0x3ea925[0x0],_0x3ea925[0x1]===_0xc919('0x5d')?![]:!![]);_0x3c8acd[_0xc919('0x5c')]('subqry.'+_0x3ea925[0x0],_0x3ea925[0x1]==='DESC'?![]:!![]);});}_0x3c8acd[_0xc919('0xa')](_0x471840,'subqry');return _0x3c8acd;}function getFilteredContacts(_0x499e9a){var _0x2fd483=[];return db[_0xc919('0x3f')][_0xc919('0x5e')]({'attributes':['id',_0xc919('0x4a'),'color'],'raw':!![]})['then'](function(_0xa367e2){_0x2fd483=_[_0xc919('0x5f')](_0xa367e2,'id');var _0x404f44={'type':db[_0xc919('0x60')][_0xc919('0x61')][_0xc919('0x62')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0xc919('0x63')]['query'](_0x499e9a[_0xc919('0x64')](),_0x404f44);})[_0xc919('0x51')](function(_0x3e7a3b){_0x3e7a3b['forEach'](function(_0x58bb90){if(_0x58bb90['TagIds']){_0x58bb90[_0xc919('0x65')]=[];_0x58bb90[_0xc919('0x1e')][_0xc919('0x28')](',')[_0xc919('0x21')](function(_0x757478){_0x58bb90[_0xc919('0x65')][_0xc919('0x20')](_0x2fd483[_0x757478]);});}delete _0x58bb90[_0xc919('0x1e')];});return _0x3e7a3b;});}function countFilteredContacts(_0x38a4bc,_0x18a30f){var _0x2a0697=_0x38a4bc[_0xc919('0x66')]();_0x2a0697['field']('COUNT(*)');_0x2a0697=applyJoinClauses(_0x2a0697,!![]);_0x38a4bc[_0xc919('0x57')]('c.id');var _0x2b9498=utils[_0xc919('0x25')](_0x18a30f);if(!_['isEmpty'](_0x2b9498)){_0x2a0697[_0xc919('0xc')]('t.id\x20IN\x20?',_0x2b9498);}var _0x4d4d6e={'type':db[_0xc919('0x60')]['QueryTypes'][_0xc919('0x62')],'raw':!![]};return db[_0xc919('0x63')]['query'](_0x2a0697[_0xc919('0x64')](),_0x4d4d6e)[_0xc919('0x51')](function(_0x5ab23d){return _0x5ab23d[0x0][_0xc919('0x67')];});}module[_0xc919('0x68')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
+var _0xbe65=['CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','conditions','find','fieldType','datetime','castTo','buildExpression','type','default','value','start','end','split','map','tags','clause','and','ids','uc.UserId\x20=\x20?','skip','keys','some','name','compact','Contact','concat','\x20=\x20?','resolve','then','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','group','c.id','limit','offset','subqry.id','order','DESC','subqry.','findAll','SELECT','CmContact','sequelize','query','toString','Tags','push','clone','isEmpty','where','t.id\x20IN\x20?','Sequelize','QueryTypes','COUNT(*)','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','agent','search','ListId','select','from','cm_contacts','subqry','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','left_join','cm_contact_has_tags','tools_tags','t.id\x20=\x20ct.TagId','lastName','phone','mobile','fax','email','CompanyId','updatedAt','deletedAt','TagIds','includes','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbe65,0x17b));var _0x5be6=function(_0x48ea83,_0xb7b30b){_0x48ea83=_0x48ea83-0x0;var _0x1f6925=_0xbe65[_0x48ea83];return _0x1f6925;};'use strict';var _=require('lodash');var squel=require(_0x5be6('0x0'));var as=require(_0x5be6('0x1'));var qs=require(_0x5be6('0x2'));var utils=require(_0x5be6('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0xe13ccb,_0x209caf){var _0x1c9b1d=![];if(_0xe13ccb['role']===_0x5be6('0x4')&&!_0x209caf[_0x5be6('0x5')]&&!_0x209caf[_0x5be6('0x6')]&&_0x209caf['autocomplete']!=='true'){_0x1c9b1d=!![];}return _0x1c9b1d;}function getContactsSubquery(){return squel[_0x5be6('0x7')]()[_0x5be6('0x8')](_0x5be6('0x9'),'c')['where']('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0x5343dd,_0x4cf7be){var _0x44579f=_0x4cf7be?'c':_0x5be6('0xa');_0x5343dd['left_join'](_0x5be6('0xb'),'uc',_0x5be6('0xc')+_0x44579f+_0x5be6('0xd'))[_0x5be6('0xe')](_0x5be6('0xf'),'ct','ct.CmContactId\x20=\x20'+_0x44579f+'.id')['left_join'](_0x5be6('0x10'),'t',_0x5be6('0x11'));return _0x5343dd;}function addFieldsToQuery(_0x40f213,_0x2e1c00,_0x5ce94e,_0x23ec0f,_0x3b731c){var _0x402745=_0x3b731c?'c':_0x5be6('0xa');if(!_0x2e1c00){_0x2e1c00=['id','firstName',_0x5be6('0x12'),_0x5be6('0x13'),_0x5be6('0x14'),_0x5be6('0x15'),_0x5be6('0x16'),_0x5be6('0x6'),_0x5be6('0x17'),'createdAt',_0x5be6('0x18'),_0x5be6('0x19'),_0x5be6('0x1a')];}else if(!_0x2e1c00[_0x5be6('0x1b')]('id')){_0x2e1c00['push']('id');}var _0x4bd69c=_0x5ce94e&&_0x3b731c||!_0x5ce94e&&!_0x3b731c;if(_0x23ec0f){_0x4bd69c=_0x23ec0f&&_0x3b731c||!_0x23ec0f&&!_0x3b731c;}_0x2e1c00[_0x5be6('0x1c')](function(_0x5b4f4c){if(_0x5b4f4c===_0x5be6('0x1a')){if(_0x4bd69c){_0x40f213[_0x5be6('0x1d')](_0x5be6('0x1e'),_0x5b4f4c);}else if(_0x5ce94e||_0x23ec0f){_0x40f213[_0x5be6('0x1d')](_0x402745+'.'+_0x5b4f4c);}}else{_0x40f213[_0x5be6('0x1d')](_0x402745+'.'+_0x5b4f4c);}});return _0x40f213;}function getSqlClauses(){var _0x901c83={'default':squel[_0x5be6('0x1f')](),'fields':squel[_0x5be6('0x1f')](),'filter':squel[_0x5be6('0x1f')](),'tags':{'clause':squel[_0x5be6('0x1f')](),'ids':null},'user':{'clause':squel[_0x5be6('0x1f')](),'skip':![]}};return _0x901c83;}function parseTagParameter(_0x4d275c){var _0x55239a=squel['expr']();if(_0x4d275c){var _0x1d33c1=utils[_0x5be6('0x20')](_0x4d275c);_0x1d33c1[_0x5be6('0x1c')](function(_0x378b1b){_0x55239a['or'](_0x5be6('0x21'),'%,'+_0x378b1b+',%');});}return _0x55239a;}function parseSearchFilter(_0xfd5886){var _0x5f5268=squel[_0x5be6('0x1f')]();if(_0xfd5886){var _0x2ec362=_0xfd5886[_0x5be6('0x22')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x2ec362['split']('\x20')[_0x5be6('0x23')]>0x1){_0x5f5268['or'](_0x5be6('0x24'),qs['getFullTextValue'](_0x2ec362),null);}else{if(qs[_0x5be6('0x25')](_0x2ec362)){_0x5f5268['or'](_0x5be6('0x26'),_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x27'),_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x28'),_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x29'),_0x2ec362+'%');}else if(qs[_0x5be6('0x2a')](_0x2ec362)){_0x5f5268['or'](_0x5be6('0x2b'),_0x2ec362+'%');}else{_0x5f5268['or'](_0x5be6('0x2c'),'%'+_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x2d'),'%'+_0x2ec362+'%');_0x5f5268['or'](_0x5be6('0x2b'),'%'+_0x2ec362+'%');}}}return _0x5f5268;}function parseAdvancedSearchFilter(_0x3c95f1,_0x5f8a22){var _0xe6679b=getSqlClauses();var _0x11add8=as[_0x5be6('0x2e')](_0x3c95f1);var _0x4c1aeb=_0x11add8['sqlOperator'];for(var _0x1899dd=0x0;_0x1899dd<_0x11add8['conditions'][_0x5be6('0x23')];_0x1899dd++){var _0x2ecdcd=_0x11add8[_0x5be6('0x2f')][_0x1899dd];var _0x4ab451='c';var _0x20bf00=_[_0x5be6('0x30')](_0x5f8a22,['name',_0x2ecdcd['field']]);if(_0x20bf00){if(_0x2ecdcd[_0x5be6('0x1d')]==='dateOfBirth'||_0x20bf00[_0x5be6('0x31')]===_0x5be6('0x32')){_0x2ecdcd[_0x5be6('0x33')]='DATE';}var _0x5e05d3=as[_0x5be6('0x34')](_0x4ab451,_0x20bf00[_0x5be6('0x35')],_0x2ecdcd);_0xe6679b[_0x5be6('0x36')][_0x4c1aeb](_0x5e05d3['text'],_0x5e05d3[_0x5be6('0x37')][_0x5be6('0x38')],_0x5e05d3[_0x5be6('0x37')][_0x5be6('0x39')]);}else{if(_0x2ecdcd[_0x5be6('0x1d')]==='Tag'){var _0x22afbf=_0x2ecdcd[_0x5be6('0x37')][_0x5be6('0x3a')](',')[_0x5be6('0x3b')](function(_0x1bd104){return Number(_0x1bd104);});var _0x21d100=parseTagParameter(_0x22afbf);_0xe6679b[_0x5be6('0x3c')][_0x5be6('0x3d')][_0x5be6('0x3e')](_0x21d100);_0xe6679b[_0x5be6('0x3c')][_0x5be6('0x3f')]=_0x22afbf;}else if(_0x2ecdcd[_0x5be6('0x1d')]==='User'){_0xe6679b['user'][_0x5be6('0x3d')][_0x5be6('0x3e')](_0x5be6('0x40'),_0x2ecdcd['value']);_0xe6679b['user'][_0x5be6('0x41')]=!![];}}}return _0xe6679b;}function parseModelFields(_0x492c4f,_0xa007){var _0x51aed5=squel[_0x5be6('0x1f')]();var _0x3c761c=_(_0x492c4f)[_0x5be6('0x42')]()[_0x5be6('0x3b')](function(_0x58e441){return _[_0x5be6('0x43')](_0xa007,[_0x5be6('0x44'),_0x58e441])?_0x58e441:undefined;})[_0x5be6('0x45')]()['value']();if(_0x492c4f[_0x5be6('0x46')]){_0x3c761c['push'](_0x5be6('0x46'));}if(_0x3c761c[_0x5be6('0x23')]>0x0){_0x3c761c[_0x5be6('0x1c')](function(_0x56cd2c){if(_0x56cd2c===_0x5be6('0x6')){_0x51aed5['and']('c.ListId\x20IN\x20?',[][_0x5be6('0x47')](_0x492c4f[_0x56cd2c]));}else if(_0x56cd2c===_0x5be6('0x46')){var _0x5cd773='%'+_0x492c4f[_0x56cd2c]+'%';_0x51aed5[_0x5be6('0x3e')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x5cd773);}else{_0x51aed5[_0x5be6('0x3e')]('c.'+_0x56cd2c+_0x5be6('0x48'),_0x492c4f[_0x56cd2c]);}});}return _0x51aed5;}function parseQueryParameters(_0x4e42bb,_0x1a6f93){var _0x49ee59=getSqlClauses();return Promise[_0x5be6('0x49')]()[_0x5be6('0x4a')](function(){return parseModelFields(_0x4e42bb,_0x1a6f93);})[_0x5be6('0x4a')](function(_0x16f5ab){_0x49ee59['fields'][_0x5be6('0x3e')](_0x16f5ab);return parseTagParameter(_0x4e42bb[_0x5be6('0x4b')]);})[_0x5be6('0x4a')](function(_0x4b49c0){_0x49ee59['tags']['clause'][_0x5be6('0x3e')](_0x4b49c0);return parseSearchFilter(_0x4e42bb['filter']);})[_0x5be6('0x4a')](function(_0x2a6cc5){_0x49ee59[_0x5be6('0x4c')]=_0x2a6cc5;return _0x49ee59;});}function checkListsRestrictions(_0x1885cf,_0x2efed0,_0xd77b17){var _0x4fcccd=squel['expr']();return Promise['resolve']()[_0x5be6('0x4a')](function(){if(_0x2efed0[_0x5be6('0x5')]&&_0x1885cf['role']===_0x5be6('0x4')&&!_0xd77b17){return _0x1885cf[_0x5be6('0x4d')]({'attributes':['id'],'raw':!![]});}})[_0x5be6('0x4a')](function(_0x3f77a6){if(_0x3f77a6){if(_0x3f77a6[_0x5be6('0x23')]===0x0){_0x4fcccd[_0x5be6('0x3e')](_0x5be6('0x4e'));}else{_0x4fcccd[_0x5be6('0x3e')]('c.ListId\x20IN\x20?',_[_0x5be6('0x3b')](_0x3f77a6,'id'));}}})[_0x5be6('0x4a')](function(){return _0x4fcccd;});}function buildContactsQuery(_0x244002,_0x3ab27a,_0x5023a5,_0x3a5dd7,_0x534200,_0x423143){if(_0x3ab27a){_0x3ab27a=_0x5023a5[_0x5be6('0x4f')];}_0x244002=addFieldsToQuery(_0x244002,_0x3ab27a,_0x3a5dd7,_0x423143,!![]);var _0x16a84e=squel[_0x5be6('0x7')]();_0x16a84e=addFieldsToQuery(_0x16a84e,_0x3ab27a,_0x3a5dd7,_0x423143,![]);if(_0x3a5dd7||_0x423143){_0x244002=applyJoinClauses(_0x244002,!![]);_0x244002[_0x5be6('0x50')](_0x5be6('0x51'));if(_0x5023a5[_0x5be6('0x52')]){_0x16a84e[_0x5be6('0x52')](_0x5023a5[_0x5be6('0x52')]);}if(_0x5023a5[_0x5be6('0x53')]){_0x16a84e[_0x5be6('0x53')](_0x5023a5[_0x5be6('0x53')]);}}else{_0x16a84e=applyJoinClauses(_0x16a84e,![]);_0x16a84e[_0x5be6('0x50')](_0x5be6('0x54'));if(_0x5023a5[_0x5be6('0x52')]){_0x244002[_0x5be6('0x52')](_0x5023a5[_0x5be6('0x52')]);}if(_0x5023a5['offset']){_0x244002[_0x5be6('0x53')](_0x5023a5[_0x5be6('0x53')]);}}_0x16a84e['having'](_0x534200);if(_0x5023a5['order']){_0x5023a5[_0x5be6('0x55')][_0x5be6('0x1c')](function(_0x502d7e){_0x244002['order']('c.'+_0x502d7e[0x0],_0x502d7e[0x1]===_0x5be6('0x56')?![]:!![]);_0x16a84e[_0x5be6('0x55')](_0x5be6('0x57')+_0x502d7e[0x0],_0x502d7e[0x1]==='DESC'?![]:!![]);});}_0x16a84e['from'](_0x244002,_0x5be6('0xa'));return _0x16a84e;}function getFilteredContacts(_0x126cb0){var _0x45df4d=[];return db['Tag'][_0x5be6('0x58')]({'attributes':['id','name','color'],'raw':!![]})[_0x5be6('0x4a')](function(_0x3454b1){_0x45df4d=_['keyBy'](_0x3454b1,'id');var _0x529405={'type':db['Sequelize']['QueryTypes'][_0x5be6('0x59')],'model':db[_0x5be6('0x5a')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x5be6('0x5b')][_0x5be6('0x5c')](_0x126cb0[_0x5be6('0x5d')](),_0x529405);})[_0x5be6('0x4a')](function(_0x1f5be7){_0x1f5be7[_0x5be6('0x1c')](function(_0x220ea0){if(_0x220ea0['TagIds']){_0x220ea0['Tags']=[];_0x220ea0[_0x5be6('0x1a')][_0x5be6('0x3a')](',')[_0x5be6('0x1c')](function(_0x3e11ad){_0x220ea0[_0x5be6('0x5e')][_0x5be6('0x5f')](_0x45df4d[_0x3e11ad]);});}delete _0x220ea0[_0x5be6('0x1a')];});return _0x1f5be7;});}function countFilteredContacts(_0x3e3ab9,_0x441a8b){var _0x14fe16=_0x3e3ab9[_0x5be6('0x60')]();_0x14fe16[_0x5be6('0x1d')]('COUNT(*)');_0x14fe16=applyJoinClauses(_0x14fe16,!![]);_0x3e3ab9[_0x5be6('0x50')](_0x5be6('0x51'));var _0x2d962c=utils['getSelectedTags'](_0x441a8b);if(!_[_0x5be6('0x61')](_0x2d962c)){_0x14fe16[_0x5be6('0x62')](_0x5be6('0x63'),_0x2d962c);}var _0x1c259a={'type':db[_0x5be6('0x64')][_0x5be6('0x65')][_0x5be6('0x59')],'raw':!![]};return db[_0x5be6('0x5b')][_0x5be6('0x5c')](_0x14fe16[_0x5be6('0x5d')](),_0x1c259a)[_0x5be6('0x4a')](function(_0x334887){return _0x334887[0x0][_0x5be6('0x66')];});}module['exports']={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
index a73afad..d4bf317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd100=['base64','decryptString','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','binary','end','write','close','unlink','decryptFile','createDecipher','final','secret','utf8'];(function(_0x19434f,_0x5d9c4c){var _0x2a44c7=function(_0x493836){while(--_0x493836){_0x19434f['push'](_0x19434f['shift']());}};_0x2a44c7(++_0x5d9c4c);}(_0xd100,0x134));var _0x0d10=function(_0x596c23,_0x59367f){_0x596c23=_0x596c23-0x0;var _0x54eba4=_0xd100[_0x596c23];return _0x54eba4;};'use strict';var crypto=require(_0x0d10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x0d10('0x1'));var config=require(_0x0d10('0x2'));var logger=require(_0x0d10('0x3'))(_0x0d10('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x0d10('0x5')][_0x0d10('0x6')],'algorithm':_0x0d10('0x7')};const fileOptions={'algorithm':_0x0d10('0x8')};if(config['encrypt']&&config[_0x0d10('0x9')][_0x0d10('0xa')]){var isSupported=isAlgorithmSupported(config[_0x0d10('0x9')][_0x0d10('0xa')]);if(isSupported){fileOptions['algorithm']=config[_0x0d10('0x9')][_0x0d10('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x0d10('0xb')](',\x20');logger['error'](config[_0x0d10('0x9')]['algorithm'],_0x0d10('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x55a5d2){return AES_SUPPORTED_RX['test'](_0x55a5d2);}function getSupportedCiphers(){return crypto[_0x0d10('0xd')]()[_0x0d10('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0x2867b2){return getSupportedCiphers()['indexOf'](_0x2867b2)>-0x1;}function combineOptions(_0x287e9f){var _0x1c4a23={};for(var _0x39f93c in fileOptions){if(fileOptions[_0x0d10('0xf')](_0x39f93c)){_0x1c4a23[_0x39f93c]=fileOptions[_0x39f93c];}}if(_0x287e9f){for(var _0x588655 in _0x287e9f){if(_0x287e9f[_0x0d10('0xf')](_0x588655)){_0x1c4a23[_0x588655]=_0x287e9f[_0x588655];}}}return _0x1c4a23;}exports[_0x0d10('0x10')]=function(_0x21a20b,_0x35d57d,_0xe98a4a,_0x4a5ea8){return new BPromise(function(_0x38fbd6,_0x466a24){_0x4a5ea8=combineOptions(_0x4a5ea8);var _0x48054c=new Buffer(_0xe98a4a);var _0x3d9f92=fs[_0x0d10('0x11')](_0x21a20b);var _0x30e5b6=fs[_0x0d10('0x12')](_0x35d57d);var _0x25a10a=crypto[_0x0d10('0x13')](_0x4a5ea8[_0x0d10('0xa')],_0x48054c);_0x3d9f92['on'](_0x0d10('0x14'),function(_0x28b2a9){var _0x3a3681=new Buffer(_0x25a10a[_0x0d10('0x15')](_0x28b2a9),_0x0d10('0x16'));_0x30e5b6['write'](_0x3a3681);});_0x3d9f92['on'](_0x0d10('0x17'),function(){try{var _0x1224a9=new Buffer(_0x25a10a['final'](_0x0d10('0x16')),'binary');_0x30e5b6[_0x0d10('0x18')](_0x1224a9);_0x30e5b6[_0x0d10('0x17')]();_0x30e5b6['on'](_0x0d10('0x19'),function(){return _0x38fbd6(_0x35d57d);});}catch(_0x5ae1dc){fs[_0x0d10('0x1a')](_0x35d57d);return _0x466a24(_0x5ae1dc);}});});};exports[_0x0d10('0x1b')]=function(_0x9f6904,_0x26ddd9,_0x29e3f2,_0x432dac){return new BPromise(function(_0x18e2e5,_0x26c8e1){_0x432dac=combineOptions(_0x432dac);var _0x6ed968=new Buffer(_0x29e3f2);var _0x407057=fs[_0x0d10('0x11')](_0x9f6904);var _0x2f8eb0=fs[_0x0d10('0x12')](_0x26ddd9);var _0x4a02d6=crypto[_0x0d10('0x1c')](_0x432dac[_0x0d10('0xa')],_0x6ed968);_0x407057['on']('data',function(_0x4f9309){var _0x4764e4=new Buffer(_0x4a02d6[_0x0d10('0x15')](_0x4f9309),_0x0d10('0x16'));_0x2f8eb0['write'](_0x4764e4);});_0x407057['on']('end',function(){try{var _0x308818=new Buffer(_0x4a02d6[_0x0d10('0x1d')](_0x0d10('0x16')),_0x0d10('0x16'));_0x2f8eb0[_0x0d10('0x18')](_0x308818);_0x2f8eb0[_0x0d10('0x17')]();_0x2f8eb0['on'](_0x0d10('0x19'),function(){return _0x18e2e5(_0x26ddd9);});}catch(_0x3ddddb){fs[_0x0d10('0x1a')](_0x26ddd9);return _0x26c8e1(_0x3ddddb);}});});};exports['encryptString']=function(_0x598886,_0x375bca,_0xd52a02){var _0x389069=_0xd52a02||stringOptions[_0x0d10('0xa')];var _0xbba6ad=_0x375bca||stringOptions[_0x0d10('0x1e')];var _0x16f981=crypto['createCipher'](_0x389069,_0xbba6ad);var _0x3a89d8=_0x16f981['update'](_0x598886,_0x0d10('0x1f'),_0x0d10('0x20'));_0x3a89d8+=_0x16f981['final']('base64');return _0x3a89d8;};exports[_0x0d10('0x21')]=function(_0x20e270,_0x457af6,_0x17a5c8){var _0xc7610a=_0x17a5c8||stringOptions[_0x0d10('0xa')];var _0x2766ff=_0x457af6||stringOptions['secret'];var _0x57587c=crypto[_0x0d10('0x1c')](_0xc7610a,_0x2766ff);var _0x56eaf7=_0x57587c[_0x0d10('0x15')](_0x20e270,_0x0d10('0x20'),'utf8');_0x56eaf7+=_0x57587c[_0x0d10('0x1d')](_0x0d10('0x1f'));return _0x56eaf7;};
\ No newline at end of file
+var _0x8493=['write','end','close','decryptFile','createWriteStream','unlink','encryptString','base64','decryptString','secret','utf8','bluebird','lodash','../../config/environment','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','getCiphers','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','final','binary'];(function(_0x3e4bdd,_0x368b8a){var _0x46db74=function(_0x138ef1){while(--_0x138ef1){_0x3e4bdd['push'](_0x3e4bdd['shift']());}};_0x46db74(++_0x368b8a);}(_0x8493,0x103));var _0x3849=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x8493[_0x3ee55a];return _0x581800;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x3849('0x0'));var _=require(_0x3849('0x1'));var config=require(_0x3849('0x2'));var logger=require('../../config/logger')(_0x3849('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x3849('0x4')};const fileOptions={'algorithm':_0x3849('0x5')};if(config['encrypt']&&config[_0x3849('0x6')][_0x3849('0x7')]){var isSupported=isAlgorithmSupported(config[_0x3849('0x6')][_0x3849('0x7')]);if(isSupported){fileOptions[_0x3849('0x7')]=config[_0x3849('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x3849('0x8')](',\x20');logger[_0x3849('0x9')](config[_0x3849('0x6')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x567c56){return AES_SUPPORTED_RX['test'](_0x567c56);}function getSupportedCiphers(){return crypto[_0x3849('0xa')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x444dfb){return getSupportedCiphers()[_0x3849('0xb')](_0x444dfb)>-0x1;}function combineOptions(_0x1684af){var _0x29eaa6={};for(var _0x4866bb in fileOptions){if(fileOptions[_0x3849('0xc')](_0x4866bb)){_0x29eaa6[_0x4866bb]=fileOptions[_0x4866bb];}}if(_0x1684af){for(var _0x55a52 in _0x1684af){if(_0x1684af[_0x3849('0xc')](_0x55a52)){_0x29eaa6[_0x55a52]=_0x1684af[_0x55a52];}}}return _0x29eaa6;}exports[_0x3849('0xd')]=function(_0x42d305,_0x3eef66,_0x5b7975,_0x215b8e){return new BPromise(function(_0x3bd776,_0x2cb2eb){_0x215b8e=combineOptions(_0x215b8e);var _0xedf6b6=new Buffer(_0x5b7975);var _0x358c36=fs[_0x3849('0xe')](_0x42d305);var _0x48b360=fs['createWriteStream'](_0x3eef66);var _0x4ca15d=crypto[_0x3849('0xf')](_0x215b8e[_0x3849('0x7')],_0xedf6b6);_0x358c36['on'](_0x3849('0x10'),function(_0x5e9af5){var _0x5c70e0=new Buffer(_0x4ca15d[_0x3849('0x11')](_0x5e9af5),'binary');_0x48b360['write'](_0x5c70e0);});_0x358c36['on']('end',function(){try{var _0x3bc402=new Buffer(_0x4ca15d[_0x3849('0x12')](_0x3849('0x13')),_0x3849('0x13'));_0x48b360[_0x3849('0x14')](_0x3bc402);_0x48b360[_0x3849('0x15')]();_0x48b360['on'](_0x3849('0x16'),function(){return _0x3bd776(_0x3eef66);});}catch(_0x10a8e6){fs['unlink'](_0x3eef66);return _0x2cb2eb(_0x10a8e6);}});});};exports[_0x3849('0x17')]=function(_0x284fa5,_0x3793ea,_0x4bde25,_0x45f01){return new BPromise(function(_0x363495,_0x51b2cc){_0x45f01=combineOptions(_0x45f01);var _0x567ad9=new Buffer(_0x4bde25);var _0x226b3c=fs['createReadStream'](_0x284fa5);var _0x490033=fs[_0x3849('0x18')](_0x3793ea);var _0x254f70=crypto['createDecipher'](_0x45f01[_0x3849('0x7')],_0x567ad9);_0x226b3c['on'](_0x3849('0x10'),function(_0x10c958){var _0x8039a9=new Buffer(_0x254f70['update'](_0x10c958),_0x3849('0x13'));_0x490033[_0x3849('0x14')](_0x8039a9);});_0x226b3c['on'](_0x3849('0x15'),function(){try{var _0x15b5af=new Buffer(_0x254f70[_0x3849('0x12')](_0x3849('0x13')),'binary');_0x490033[_0x3849('0x14')](_0x15b5af);_0x490033[_0x3849('0x15')]();_0x490033['on'](_0x3849('0x16'),function(){return _0x363495(_0x3793ea);});}catch(_0xb576ed){fs[_0x3849('0x19')](_0x3793ea);return _0x51b2cc(_0xb576ed);}});});};exports[_0x3849('0x1a')]=function(_0x15ae3f,_0x17e0b8,_0x2c2d85){var _0x123d27=_0x2c2d85||stringOptions[_0x3849('0x7')];var _0x391635=_0x17e0b8||stringOptions['secret'];var _0x43750a=crypto[_0x3849('0xf')](_0x123d27,_0x391635);var _0x20f595=_0x43750a['update'](_0x15ae3f,'utf8',_0x3849('0x1b'));_0x20f595+=_0x43750a[_0x3849('0x12')]('base64');return _0x20f595;};exports[_0x3849('0x1c')]=function(_0x3008f5,_0x19f44b,_0x56efd2){var _0x14d9fc=_0x56efd2||stringOptions[_0x3849('0x7')];var _0xaadc7a=_0x19f44b||stringOptions[_0x3849('0x1d')];var _0x9de518=crypto['createDecipher'](_0x14d9fc,_0xaadc7a);var _0xab0240=_0x9de518['update'](_0x3008f5,_0x3849('0x1b'),_0x3849('0x1e'));_0xab0240+=_0x9de518['final'](_0x3849('0x1e'));return _0xab0240;};
\ No newline at end of file
index d1b7e7c..b24ac6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d2=['num','Empty','split','length','isInteger','forEach','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','mkdirSync','join','each','%s.%s','csv','writeFileSync','zip','zip\x20finished','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','finally','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','then','splitSizeCsv','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xc7d2,0x79));var _0x2c7d=function(_0x451959,_0x18c7a5){_0x451959=_0x451959-0x0;var _0x490269=_0xc7d2[_0x451959];return _0x490269;};'use strict';var util=require(_0x2c7d('0x0'));var path=require(_0x2c7d('0x1'));var _=require(_0x2c7d('0x2'));var csv=require(_0x2c7d('0x3'));var fs=require('fs');var BPromise=require(_0x2c7d('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x2c7d('0x5'));var db=require(_0x2c7d('0x6'))['db'];var dbH=require(_0x2c7d('0x6'))[_0x2c7d('0x7')];var logger=require(_0x2c7d('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x2c7d('0x9')][0x2]);var QUERY=process[_0x2c7d('0x9')][0x3];var PATH=process[_0x2c7d('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x529023,_0x54c534){var _0x25b56a={'status':_0x529023};var _0x4de074={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54c534){_0x25b56a[_0x2c7d('0xa')]=_0x54c534;}return db[_0x2c7d('0xb')]['update'](_0x25b56a,_0x4de074);}function main(){var _0x5eb0fb=0x1388;var _0x28b83e;logger[_0x2c7d('0xc')](util[_0x2c7d('0xd')](_0x2c7d('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x2c7d('0xf')][_0x2c7d('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x2c7d('0x11')](function(_0xfb8f79){if(_0xfb8f79){_0x28b83e=_0xfb8f79;_0x5eb0fb=_0x28b83e[_0x2c7d('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x2c7d('0x13')](util[_0x2c7d('0xd')](_0x2c7d('0x14'),QUERY),{'type':dbH['sequelize'][_0x2c7d('0x15')][_0x2c7d('0x16')]});})[_0x2c7d('0x11')](function(_0x360cb2){if(!_0x360cb2[0x0][_0x2c7d('0x17')]){return analyticExtractedReport(_0x2c7d('0x18'));}var _0x20b64b=[];var _0x5c6216=0x0;if(_0x28b83e[_0x2c7d('0x19')]){if(_0x360cb2&&_0x360cb2[_0x2c7d('0x1a')]){var _0x358f04=_['range'](_0x360cb2[0x0][_0x2c7d('0x17')]/_0x5eb0fb);var _0x1623ce=Number[_0x2c7d('0x1b')](_0x360cb2[0x0][_0x2c7d('0x17')]/_0x5eb0fb)?_0x360cb2[0x0][_0x2c7d('0x17')]%_0x5eb0fb:0x0;_0x358f04[_0x2c7d('0x1c')](function(_0x462439){if(_0x462439>0x0){_0x5c6216+=_0x5eb0fb;}_0x20b64b[_0x2c7d('0x1d')](dbH[_0x2c7d('0x1e')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5eb0fb,_0x5c6216),{'type':dbH[_0x2c7d('0x1e')][_0x2c7d('0x15')][_0x2c7d('0x16')]}));});if(_0x1623ce>0x0){_0x5c6216+=_0x5eb0fb;_0x20b64b[_0x2c7d('0x1d')](dbH[_0x2c7d('0x1e')][_0x2c7d('0x13')](util[_0x2c7d('0xd')](_0x2c7d('0x1f'),QUERY,_0x1623ce,_0x5c6216),{'type':dbH[_0x2c7d('0x1e')]['QueryTypes'][_0x2c7d('0x16')]}));}}}else{_0x20b64b[_0x2c7d('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x2c7d('0x16')]}));}var _0x53e8f8=path[_0x2c7d('0x20')](PATH);var _0x24ffe9=path[_0x2c7d('0x21')](PATH,_0x2c7d('0x22'));var _0x16bb14=_0x28b83e['split']&&_0x20b64b['length']>0x1;var _0x311db9=[];if(!fs[_0x2c7d('0x23')](path['join'](_0x53e8f8,_0x24ffe9))&&_0x16bb14){fs[_0x2c7d('0x24')](path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9));}return BPromise[_0x2c7d('0x26')](_0x20b64b,function(_0x36773f){_0x311db9['push'](_0x36773f);})[_0x2c7d('0x11')](function(){for(var _0x359ff0=0x0;_0x359ff0<_0x311db9[_0x2c7d('0x1a')];_0x359ff0+=0x1){var _0x304c89;var _0xf9f4ec=_0x311db9[_0x359ff0];if(_0x16bb14){_0x304c89=path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9,util['format']('%s%d.%s',_0x24ffe9,_0x359ff0,'csv'));}else{_0x304c89=path[_0x2c7d('0x25')](_0x53e8f8,util['format'](_0x2c7d('0x27'),_0x24ffe9,_0x2c7d('0x28')));}fs[_0x2c7d('0x29')](_0x304c89,csv(_0xf9f4ec));}})[_0x2c7d('0x11')](function(){if(_0x16bb14){return new Promise(function(_0x1713e9){zipdir(path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9),{'saveTo':path[_0x2c7d('0x25')](_0x53e8f8,util[_0x2c7d('0xd')](_0x2c7d('0x27'),_0x24ffe9,_0x2c7d('0x2a')))},function(_0x4f4435,_0x3c0039){rimraf(path[_0x2c7d('0x25')](_0x53e8f8,_0x24ffe9),function(){});_0x1713e9(_0x2c7d('0x2b'));});});}})['then'](function(){logger[_0x2c7d('0xc')](util[_0x2c7d('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x16bb14?util[_0x2c7d('0xd')](_0x2c7d('0x27'),_0x24ffe9,_0x16bb14?_0x2c7d('0x2a'):_0x2c7d('0x28')):null);});})['catch'](function(_0x19f0f3){logger[_0x2c7d('0xc')](util[_0x2c7d('0xd')](_0x2c7d('0x2c'),EXTRACTED_REPORT_ID,_0x2c7d('0x2d')),util[_0x2c7d('0x2e')](_0x19f0f3,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2c7d('0x2f')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0xe7c0=['Setting','find','split','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Completed','catch','inspect','Failed','finally','exit','util','path','lodash','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','CSV'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe7c0,0x1d2));var _0x0e7c=function(_0x77e7e8,_0x5a319f){_0x77e7e8=_0x77e7e8-0x0;var _0x205a3e=_0xe7c0[_0x77e7e8];return _0x205a3e;};'use strict';var util=require(_0x0e7c('0x0'));var path=require(_0x0e7c('0x1'));var _=require(_0x0e7c('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x0e7c('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x0e7c('0x4'))['db'];var dbH=require(_0x0e7c('0x4'))[_0x0e7c('0x5')];var logger=require(_0x0e7c('0x6'))(_0x0e7c('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x0e7c('0x8')][0x2]);var QUERY=process[_0x0e7c('0x8')][0x3];var PATH=process[_0x0e7c('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x226379,_0x15202d){var _0x483f4a={'status':_0x226379};var _0xc790a3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x15202d){_0x483f4a[_0x0e7c('0x9')]=_0x15202d;}return db[_0x0e7c('0xa')][_0x0e7c('0xb')](_0x483f4a,_0xc790a3);}function main(){var _0x52ba12=0x1388;var _0xf2a19a;logger['info'](util[_0x0e7c('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0e7c('0xd')));return db[_0x0e7c('0xe')][_0x0e7c('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0e7c('0x10'),_0x0e7c('0x11')]})[_0x0e7c('0x12')](function(_0x29f6ea){if(_0x29f6ea){_0xf2a19a=_0x29f6ea;_0x52ba12=_0xf2a19a[_0x0e7c('0x11')]||0x1388;}})[_0x0e7c('0x12')](function(){return dbH['sequelize'][_0x0e7c('0x13')](util[_0x0e7c('0xc')](_0x0e7c('0x14'),QUERY),{'type':dbH[_0x0e7c('0x15')]['QueryTypes'][_0x0e7c('0x16')]});})['then'](function(_0x1e2d73){if(!_0x1e2d73[0x0][_0x0e7c('0x17')]){return analyticExtractedReport(_0x0e7c('0x18'));}var _0x39ea62=[];var _0x1f1c35=0x0;if(_0xf2a19a['split']){if(_0x1e2d73&&_0x1e2d73[_0x0e7c('0x19')]){var _0x543751=_['range'](_0x1e2d73[0x0][_0x0e7c('0x17')]/_0x52ba12);var _0x1df93b=Number['isInteger'](_0x1e2d73[0x0][_0x0e7c('0x17')]/_0x52ba12)?_0x1e2d73[0x0][_0x0e7c('0x17')]%_0x52ba12:0x0;_0x543751[_0x0e7c('0x1a')](function(_0x1314fc){if(_0x1314fc>0x0){_0x1f1c35+=_0x52ba12;}_0x39ea62[_0x0e7c('0x1b')](dbH['sequelize'][_0x0e7c('0x13')](util['format'](_0x0e7c('0x1c'),QUERY,_0x52ba12,_0x1f1c35),{'type':dbH[_0x0e7c('0x15')][_0x0e7c('0x1d')][_0x0e7c('0x16')]}));});if(_0x1df93b>0x0){_0x1f1c35+=_0x52ba12;_0x39ea62[_0x0e7c('0x1b')](dbH['sequelize']['query'](util[_0x0e7c('0xc')](_0x0e7c('0x1c'),QUERY,_0x1df93b,_0x1f1c35),{'type':dbH[_0x0e7c('0x15')][_0x0e7c('0x1d')][_0x0e7c('0x16')]}));}}}else{_0x39ea62['push'](dbH[_0x0e7c('0x15')][_0x0e7c('0x13')](QUERY,{'type':dbH[_0x0e7c('0x15')][_0x0e7c('0x1d')][_0x0e7c('0x16')]}));}var _0x540995=path[_0x0e7c('0x1e')](PATH);var _0x5a722f=path[_0x0e7c('0x1f')](PATH,'.csv');var _0x5449ad=_0xf2a19a[_0x0e7c('0x10')]&&_0x39ea62['length']>0x1;var _0x36d1b7=[];if(!fs[_0x0e7c('0x20')](path[_0x0e7c('0x21')](_0x540995,_0x5a722f))&&_0x5449ad){fs[_0x0e7c('0x22')](path[_0x0e7c('0x21')](_0x540995,_0x5a722f));}return BPromise[_0x0e7c('0x23')](_0x39ea62,function(_0x525218){_0x36d1b7[_0x0e7c('0x1b')](_0x525218);})[_0x0e7c('0x12')](function(){for(var _0x5e96ff=0x0;_0x5e96ff<_0x36d1b7[_0x0e7c('0x19')];_0x5e96ff+=0x1){var _0x2031ac;var _0x46e0a6=_0x36d1b7[_0x5e96ff];if(_0x5449ad){_0x2031ac=path['join'](_0x540995,_0x5a722f,util[_0x0e7c('0xc')]('%s%d.%s',_0x5a722f,_0x5e96ff,_0x0e7c('0x24')));}else{_0x2031ac=path[_0x0e7c('0x21')](_0x540995,util[_0x0e7c('0xc')](_0x0e7c('0x25'),_0x5a722f,_0x0e7c('0x24')));}fs[_0x0e7c('0x26')](_0x2031ac,csv(_0x46e0a6));}})[_0x0e7c('0x12')](function(){if(_0x5449ad){return new Promise(function(_0x200ae4){zipdir(path[_0x0e7c('0x21')](_0x540995,_0x5a722f),{'saveTo':path[_0x0e7c('0x21')](_0x540995,util[_0x0e7c('0xc')](_0x0e7c('0x25'),_0x5a722f,_0x0e7c('0x27')))},function(_0x2c7724,_0x175a6b){rimraf(path[_0x0e7c('0x21')](_0x540995,_0x5a722f),function(){});_0x200ae4(_0x0e7c('0x28'));});});}})[_0x0e7c('0x12')](function(){logger[_0x0e7c('0x29')](util[_0x0e7c('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x0e7c('0x2a'),_0x5449ad?util[_0x0e7c('0xc')](_0x0e7c('0x25'),_0x5a722f,_0x5449ad?'zip':_0x0e7c('0x24')):null);});})[_0x0e7c('0x2b')](function(_0x9f63f2){logger[_0x0e7c('0x29')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x0e7c('0xd')),util[_0x0e7c('0x2c')](_0x9f63f2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0e7c('0x2d'));})[_0x0e7c('0x2e')](function(){process[_0x0e7c('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index 00f7587..7eba593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f83=['/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','auto','push','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','before','margin','landscape','Arial','black','right','Empty','Setting','find','split','splitSizePdf','then','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','join','each','flatten','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x3f83,0x176));var _0x33f8=function(_0x319542,_0x5063b8){_0x319542=_0x319542-0x0;var _0x2aaee9=_0x3f83[_0x319542];return _0x2aaee9;};'use strict';var _=require(_0x33f8('0x0'));var fs=require('fs');var util=require(_0x33f8('0x1'));var path=require(_0x33f8('0x2'));var moment=require(_0x33f8('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x33f8('0x4'));var zipdir=require(_0x33f8('0x5'));var rimraf=require(_0x33f8('0x6'));var JSDOM=require(_0x33f8('0x7'))[_0x33f8('0x8')];var window=new JSDOM('')[_0x33f8('0x9')];var BPromise=require(_0x33f8('0xa'));var db=require('../../mysqldb')['db'];var dbH=require(_0x33f8('0xb'))[_0x33f8('0xc')];var logger=require(_0x33f8('0xd'))(_0x33f8('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x33f8('0xf')][0x2]);var QUERY=process[_0x33f8('0xf')][0x3];var PATH=process[_0x33f8('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x33f8('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x31c731,_0x3f7c8a){var _0x48a364={'status':_0x31c731};var _0x4a30e6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f7c8a){_0x48a364['savename']=_0x3f7c8a;}return db[_0x33f8('0x11')][_0x33f8('0x12')](_0x48a364,_0x4a30e6);}function getHeaders(_0x1cd7ff){return _[_0x33f8('0x13')](_0x1cd7ff,function(_0x3f3558){return{'text':_0x3f3558,'style':_0x33f8('0x14')};});}function getRows(_0x25b2e7,_0x57c10e){return _[_0x33f8('0x13')](_0x57c10e,function(_0x4ee46d){return _(_0x4ee46d)[_0x33f8('0x15')](_0x25b2e7)[_0x33f8('0x13')](function(_0x20ad39){return _0x20ad39?_[_0x33f8('0x16')](_0x20ad39):'';})[_0x33f8('0x17')]();});}function createTable(_0x16f08f,_0x2ff38b){var _0x3e7eb4={'widths':_[_0x33f8('0x18')](Array(_0x16f08f[_0x33f8('0x19')]),0x91),'heights':function(_0x21506e){return _0x21506e===0x0?_0x33f8('0x1a'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x31b088=getHeaders(_0x16f08f);_0x3e7eb4['body'][_0x33f8('0x1b')](_0x31b088);var _0x1c5756=getRows(_0x16f08f,_0x2ff38b);_0x3e7eb4[_0x33f8('0x1c')]=_0x3e7eb4[_0x33f8('0x1c')]['concat'](_0x1c5756);return _0x3e7eb4;}function createTables(_0x4e7f15){var _0xaf6fd2=[];var _0x1dc299=_['chunk'](Object[_0x33f8('0x1d')](_0x4e7f15[0x0]),0x5);_0x1dc299[_0x33f8('0x1e')](function(_0x40b56c){_0xaf6fd2[_0x33f8('0x1b')](createTable(_0x40b56c,_0x4e7f15));});return _0xaf6fd2;}function getPDFDocDefinition(_0x28cd26){var _0x26f557=util[_0x33f8('0x1f')](_0x33f8('0x20'),NAME,EXTRACTED_REPORT[_0x33f8('0x21')],moment(EXTRACTED_REPORT[_0x33f8('0x22')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x33f8('0x23')])[_0x33f8('0x1f')](FORMAT));var _0x19e2ed=[];for(var _0x4ddeff=0x0;_0x4ddeff<_0x28cd26[_0x33f8('0x19')];_0x4ddeff++){var _0x5567dc=[];if(_0x4ddeff===0x0){_0x5567dc[_0x33f8('0x1b')]({'text':_0x26f557,'style':_0x33f8('0x24')});}var _0xf86605={'table':_0x28cd26[_0x4ddeff]};if(_0x4ddeff>0x0){_0xf86605['pageBreak']=_0x33f8('0x25');_0xf86605[_0x33f8('0x26')]=[0x0,0x46,0x0,0x0];}_0x5567dc[_0x33f8('0x1b')](_0xf86605);_0x19e2ed[_0x33f8('0x1b')](_0x5567dc);}return{'pageSize':'A4','pageOrientation':_0x33f8('0x27'),'content':_0x19e2ed,'footer':function(_0x58555e,_0x33928d){return{'text':_0x58555e[_0x33f8('0x16')]()+'\x20/\x20'+_0x33928d,'style':'footer'};},'defaultStyle':{'font':_0x33f8('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x33f8('0x29')},'footer':{'alignment':_0x33f8('0x2a'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3a0b83){var _0x19aebd=0x1388;var _0x474cde;if(!_0x3a0b83[0x0]['num']){return analyticExtractedReport(_0x33f8('0x2b'));}return db[_0x33f8('0x2c')][_0x33f8('0x2d')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x33f8('0x2e'),_0x33f8('0x2f')]})['then'](function(_0x56fcf5){if(_0x56fcf5){_0x474cde=_0x56fcf5;_0x19aebd=_0x474cde[_0x33f8('0x2f')]||0x3e8;}})[_0x33f8('0x30')](function(){var _0x2780c3=[];var _0x2e1a14=0x0;if(_0x474cde[_0x33f8('0x2e')]){if(_0x3a0b83&&_0x3a0b83[_0x33f8('0x19')]){var _0x442c7f=_[_0x33f8('0x31')](_0x3a0b83[0x0][_0x33f8('0x32')]/_0x19aebd);var _0x12c378=Number[_0x33f8('0x33')](_0x3a0b83[0x0][_0x33f8('0x32')]/_0x19aebd)?_0x3a0b83[0x0][_0x33f8('0x32')]%_0x19aebd:0x0;_0x442c7f['forEach'](function(_0x3052d4){if(_0x3052d4>0x0){_0x2e1a14+=_0x19aebd;}_0x2780c3[_0x33f8('0x1b')](dbH[_0x33f8('0x34')][_0x33f8('0x35')](util['format'](_0x33f8('0x36'),QUERY,_0x19aebd,_0x2e1a14),{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]}));});if(_0x12c378>0x0){_0x2e1a14+=_0x19aebd;_0x2780c3[_0x33f8('0x1b')](dbH['sequelize'][_0x33f8('0x35')](util[_0x33f8('0x1f')](_0x33f8('0x36'),QUERY,_0x12c378,_0x2e1a14),{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]}));}}}else{_0x2780c3[_0x33f8('0x1b')](dbH[_0x33f8('0x34')][_0x33f8('0x35')](QUERY,{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]}));}var _0x2c3114=path['dirname'](PATH);var _0xc180db=path[_0x33f8('0x39')](PATH,_0x33f8('0x3a'));var _0x2cd73d=_0x474cde['split']&&_0x2780c3[_0x33f8('0x19')]>0x1;var _0x30792e=[];if(!fs['existsSync'](path[_0x33f8('0x3b')](_0x2c3114,_0xc180db))&&_0x2cd73d){fs['mkdirSync'](path[_0x33f8('0x3b')](_0x2c3114,_0xc180db));}return BPromise[_0x33f8('0x3c')](_0x2780c3,function(_0x21556c){_0x30792e[_0x33f8('0x1b')](_0x21556c);})['then'](function(){var _0x47a935=[];for(var _0x5c04e0=0x0;_0x5c04e0<_0x30792e[_0x33f8('0x19')];_0x5c04e0+=0x1){var _0x36a780=_0x30792e[_0x5c04e0];var _0x442564=createTables(_[_0x33f8('0x3d')](_0x36a780));var _0x41da8e;var _0x37922b=getPDFDocDefinition(_0x442564);var _0x32bb9b=getPDFPrinter();var _0x3650ee=_0x32bb9b['createPdfKitDocument'](_0x37922b);if(_0x2cd73d){_0x41da8e=path[_0x33f8('0x3b')](_0x2c3114,_0xc180db,util['format'](_0x33f8('0x3e'),_0xc180db,_0x5c04e0,_0x33f8('0x3f')));}else{_0x41da8e=path['join'](_0x2c3114,util[_0x33f8('0x1f')](_0x33f8('0x40'),_0xc180db,_0x33f8('0x3f')));}_0x47a935[_0x33f8('0x1b')](writePDFDocument(_0x3650ee,_0x41da8e));}return Promise['all'](_0x47a935);})[_0x33f8('0x30')](function(){if(_0x2cd73d){return new Promise(function(_0x442769){zipdir(path[_0x33f8('0x3b')](_0x2c3114,_0xc180db),{'saveTo':path[_0x33f8('0x3b')](_0x2c3114,util[_0x33f8('0x1f')](_0x33f8('0x40'),_0xc180db,_0x33f8('0x41')))},function(){rimraf(path[_0x33f8('0x3b')](_0x2c3114,_0xc180db),function(){});_0x442769(_0x33f8('0x42'));});});}})[_0x33f8('0x30')](function(){if(!_0x2cd73d)return;rimraf(path[_0x33f8('0x3b')](_0x2c3114,_0xc180db),function(){});})[_0x33f8('0x30')](function(){logger[_0x33f8('0x43')](util['format'](_0x33f8('0x44'),EXTRACTED_REPORT_ID,_0x33f8('0x45')));return analyticExtractedReport('Completed',_0x2cd73d?util[_0x33f8('0x1f')](_0x33f8('0x40'),_0xc180db,_0x2cd73d?'zip':_0x33f8('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x33f8('0x43')](util[_0x33f8('0x1f')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'PDF'));return db[_0x33f8('0x11')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x33f8('0x30')](function(_0x5f2712){EXTRACTED_REPORT=_0x5f2712;return dbH[_0x33f8('0x34')]['query'](util[_0x33f8('0x1f')](_0x33f8('0x46'),QUERY),{'type':dbH[_0x33f8('0x34')][_0x33f8('0x37')][_0x33f8('0x38')]});})[_0x33f8('0x30')](extractReport)[_0x33f8('0x47')](function(_0x48c3b7){logger['info'](util[_0x33f8('0x1f')](_0x33f8('0x48'),EXTRACTED_REPORT_ID,_0x33f8('0x45')),util[_0x33f8('0x49')](_0x48c3b7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x33f8('0x4a'));})['finally'](function(){process[_0x33f8('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3c63a8=new PdfPrinter({'Arial':{'normal':__dirname+_0x33f8('0x4c'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x33f8('0x4d')}});return _0x3c63a8;}function getPDFDocDefinitionFromHTML(_0x453651,_0x3fe2f4){var _0x32adba=util[_0x33f8('0x1f')]('%s\x20#%d',_0x3fe2f4[_0x33f8('0x4e')],_0x3fe2f4[_0x33f8('0x4f')]);var _0x224097=moment()['format'](_0x33f8('0x50'))['toString']();var _0x34d51b=htmlToPdfmake(_0x453651,{'window':window,'tableAutoSize':!![]});return{'content':[_0x34d51b],'defaultStyle':{'font':_0x33f8('0x28')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x33f8('0x51'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x33f8('0x51')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x33f8('0x24')}];},'footer':function(_0x2135b5,_0x3658db){return[{'text':util[_0x33f8('0x1f')](_0x33f8('0x52'),_0x32adba,_0x2135b5,_0x3658db,_0x224097),'style':_0x33f8('0x53')}];}};}function writePDFDocument(_0x13c7d0,_0x83da57){return new Promise(function(_0x4848e8,_0x52709b){var _0x3b59e1=_0x13c7d0['pipe'](fs[_0x33f8('0x54')](_0x83da57));_0x3b59e1['on'](_0x33f8('0x55'),function(){_0x4848e8(_0x33f8('0x55'));});_0x3b59e1['on'](_0x33f8('0x56'),function(_0x5ed3f7){_0x52709b(_0x5ed3f7);});_0x13c7d0[_0x33f8('0x57')]();});}exports[_0x33f8('0x58')]=function(_0x156a54,_0x2a0dfa){var _0x336bf9=getPDFPrinter();var _0x36965d=getPDFDocDefinitionFromHTML(_0x156a54,_0x2a0dfa);var _0xc1a295=_0x336bf9[_0x33f8('0x59')](_0x36965d);return writePDFDocument(_0xc1a295,_0x2a0dfa[_0x33f8('0x2')])[_0x33f8('0x47')](function(_0x2c0c42){throw _0x2c0c42;});};
\ No newline at end of file
+var _0xaf36=['value','fill','auto','push','body','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','length','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','header','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick'];(function(_0x237ba6,_0x4ccff9){var _0x4d4ab0=function(_0x557f9b){while(--_0x557f9b){_0x237ba6['push'](_0x237ba6['shift']());}};_0x4d4ab0(++_0x4ccff9);}(_0xaf36,0x1c5));var _0x6af3=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0xaf36[_0x23ca4d];return _0x435432;};'use strict';var _=require(_0x6af3('0x0'));var fs=require('fs');var util=require(_0x6af3('0x1'));var path=require(_0x6af3('0x2'));var moment=require(_0x6af3('0x3'));var htmlToPdfmake=require(_0x6af3('0x4'));var PdfPrinter=require(_0x6af3('0x5'));var zipdir=require(_0x6af3('0x6'));var rimraf=require(_0x6af3('0x7'));var JSDOM=require(_0x6af3('0x8'))[_0x6af3('0x9')];var window=new JSDOM('')[_0x6af3('0xa')];var BPromise=require(_0x6af3('0xb'));var db=require(_0x6af3('0xc'))['db'];var dbH=require(_0x6af3('0xc'))[_0x6af3('0xd')];var logger=require(_0x6af3('0xe'))(_0x6af3('0xf'));var EXTRACTED_REPORT_ID=Number(process[_0x6af3('0x10')][0x2]);var QUERY=process[_0x6af3('0x10')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x6af3('0x10')][0x5];var FORMAT=_0x6af3('0x11');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x36fbbe,_0x44ad12){var _0x2cd036={'status':_0x36fbbe};var _0xe69251={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x44ad12){_0x2cd036[_0x6af3('0x12')]=_0x44ad12;}return db['AnalyticExtractedReport'][_0x6af3('0x13')](_0x2cd036,_0xe69251);}function getHeaders(_0x4459a8){return _[_0x6af3('0x14')](_0x4459a8,function(_0x44e539){return{'text':_0x44e539,'style':'tableHeader'};});}function getRows(_0x22f136,_0x1fc6a6){return _[_0x6af3('0x14')](_0x1fc6a6,function(_0xa1801c){return _(_0xa1801c)[_0x6af3('0x15')](_0x22f136)['map'](function(_0x210f22){return _0x210f22?_['toString'](_0x210f22):'';})[_0x6af3('0x16')]();});}function createTable(_0x266859,_0x5eb6fc){var _0x597676={'widths':_[_0x6af3('0x17')](Array(_0x266859['length']),0x91),'heights':function(_0x3a65ad){return _0x3a65ad===0x0?_0x6af3('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xb1e3d6=getHeaders(_0x266859);_0x597676['body'][_0x6af3('0x19')](_0xb1e3d6);var _0x10052a=getRows(_0x266859,_0x5eb6fc);_0x597676[_0x6af3('0x1a')]=_0x597676[_0x6af3('0x1a')]['concat'](_0x10052a);return _0x597676;}function createTables(_0x3c06cf){var _0x15ebac=[];var _0x513e90=_['chunk'](Object[_0x6af3('0x1b')](_0x3c06cf[0x0]),0x5);_0x513e90[_0x6af3('0x1c')](function(_0x1e6d5b){_0x15ebac['push'](createTable(_0x1e6d5b,_0x3c06cf));});return _0x15ebac;}function getPDFDocDefinition(_0x28243e){var _0x3b4723=util[_0x6af3('0x1d')](_0x6af3('0x1e'),NAME,EXTRACTED_REPORT[_0x6af3('0x1f')],moment(EXTRACTED_REPORT[_0x6af3('0x20')])[_0x6af3('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x6af3('0x21')])[_0x6af3('0x1d')](FORMAT));var _0x5f5556=[];for(var _0xefb3a8=0x0;_0xefb3a8<_0x28243e['length'];_0xefb3a8++){var _0x5d2c55=[];if(_0xefb3a8===0x0){_0x5d2c55[_0x6af3('0x19')]({'text':_0x3b4723,'style':'header'});}var _0x20b1bc={'table':_0x28243e[_0xefb3a8]};if(_0xefb3a8>0x0){_0x20b1bc[_0x6af3('0x22')]=_0x6af3('0x23');_0x20b1bc[_0x6af3('0x24')]=[0x0,0x46,0x0,0x0];}_0x5d2c55[_0x6af3('0x19')](_0x20b1bc);_0x5f5556[_0x6af3('0x19')](_0x5d2c55);}return{'pageSize':'A4','pageOrientation':_0x6af3('0x25'),'content':_0x5f5556,'footer':function(_0x2ab027,_0x2f38b3){return{'text':_0x2ab027[_0x6af3('0x26')]()+_0x6af3('0x27')+_0x2f38b3,'style':_0x6af3('0x28')};},'defaultStyle':{'font':_0x6af3('0x29')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6af3('0x2a')},'footer':{'alignment':_0x6af3('0x2b'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x5d98ed){var _0x206d86=0x1388;var _0x1487c4;if(!_0x5d98ed[0x0][_0x6af3('0x2c')]){return analyticExtractedReport(_0x6af3('0x2d'));}return db[_0x6af3('0x2e')][_0x6af3('0x2f')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6af3('0x30')]})['then'](function(_0xe2845b){if(_0xe2845b){_0x1487c4=_0xe2845b;_0x206d86=_0x1487c4[_0x6af3('0x30')]||0x3e8;}})[_0x6af3('0x31')](function(){var _0x529631=[];var _0xb2a0fe=0x0;if(_0x1487c4[_0x6af3('0x32')]){if(_0x5d98ed&&_0x5d98ed['length']){var _0x4e3f49=_[_0x6af3('0x33')](_0x5d98ed[0x0][_0x6af3('0x2c')]/_0x206d86);var _0x3eb60d=Number[_0x6af3('0x34')](_0x5d98ed[0x0][_0x6af3('0x2c')]/_0x206d86)?_0x5d98ed[0x0]['num']%_0x206d86:0x0;_0x4e3f49['forEach'](function(_0x6aa0fa){if(_0x6aa0fa>0x0){_0xb2a0fe+=_0x206d86;}_0x529631['push'](dbH[_0x6af3('0x35')][_0x6af3('0x36')](util[_0x6af3('0x1d')](_0x6af3('0x37'),QUERY,_0x206d86,_0xb2a0fe),{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')][_0x6af3('0x39')]}));});if(_0x3eb60d>0x0){_0xb2a0fe+=_0x206d86;_0x529631['push'](dbH[_0x6af3('0x35')][_0x6af3('0x36')](util[_0x6af3('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3eb60d,_0xb2a0fe),{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')]['SELECT']}));}}}else{_0x529631[_0x6af3('0x19')](dbH[_0x6af3('0x35')][_0x6af3('0x36')](QUERY,{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')][_0x6af3('0x39')]}));}var _0x28844b=path['dirname'](PATH);var _0x69d841=path[_0x6af3('0x3a')](PATH,_0x6af3('0x3b'));var _0x572d62=_0x1487c4[_0x6af3('0x32')]&&_0x529631['length']>0x1;var _0x10c415=[];if(!fs[_0x6af3('0x3c')](path[_0x6af3('0x3d')](_0x28844b,_0x69d841))&&_0x572d62){fs[_0x6af3('0x3e')](path[_0x6af3('0x3d')](_0x28844b,_0x69d841));}return BPromise[_0x6af3('0x3f')](_0x529631,function(_0xf609a4){_0x10c415[_0x6af3('0x19')](_0xf609a4);})[_0x6af3('0x31')](function(){var _0x11c335=[];for(var _0x56d06e=0x0;_0x56d06e<_0x10c415[_0x6af3('0x40')];_0x56d06e+=0x1){var _0x5e1f23=_0x10c415[_0x56d06e];var _0x1e4229=createTables(_['flatten'](_0x5e1f23));var _0x406e4e;var _0xa5325a=getPDFDocDefinition(_0x1e4229);var _0x3f9c00=getPDFPrinter();var _0x12f0e0=_0x3f9c00[_0x6af3('0x41')](_0xa5325a);if(_0x572d62){_0x406e4e=path[_0x6af3('0x3d')](_0x28844b,_0x69d841,util[_0x6af3('0x1d')]('%s%d.%s',_0x69d841,_0x56d06e,_0x6af3('0x42')));}else{_0x406e4e=path['join'](_0x28844b,util[_0x6af3('0x1d')](_0x6af3('0x43'),_0x69d841,_0x6af3('0x42')));}_0x11c335['push'](writePDFDocument(_0x12f0e0,_0x406e4e));}return Promise[_0x6af3('0x44')](_0x11c335);})['then'](function(){if(_0x572d62){return new Promise(function(_0x200cbb){zipdir(path[_0x6af3('0x3d')](_0x28844b,_0x69d841),{'saveTo':path[_0x6af3('0x3d')](_0x28844b,util[_0x6af3('0x1d')](_0x6af3('0x43'),_0x69d841,_0x6af3('0x45')))},function(){rimraf(path['join'](_0x28844b,_0x69d841),function(){});_0x200cbb(_0x6af3('0x46'));});});}})[_0x6af3('0x31')](function(){if(!_0x572d62)return;rimraf(path[_0x6af3('0x3d')](_0x28844b,_0x69d841),function(){});})[_0x6af3('0x31')](function(){logger[_0x6af3('0x47')](util[_0x6af3('0x1d')](_0x6af3('0x48'),EXTRACTED_REPORT_ID,_0x6af3('0x49')));return analyticExtractedReport('Completed',_0x572d62?util[_0x6af3('0x1d')](_0x6af3('0x43'),_0x69d841,_0x572d62?_0x6af3('0x45'):_0x6af3('0x42')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6af3('0x47')](util[_0x6af3('0x1d')](_0x6af3('0x4a'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x6af3('0x4b')][_0x6af3('0x4c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x6af3('0x31')](function(_0x7ba5bd){EXTRACTED_REPORT=_0x7ba5bd;return dbH['sequelize'][_0x6af3('0x36')](util[_0x6af3('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6af3('0x35')][_0x6af3('0x38')][_0x6af3('0x39')]});})['then'](extractReport)[_0x6af3('0x4d')](function(_0x240833){logger[_0x6af3('0x47')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6af3('0x49')),util['inspect'](_0x240833,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6af3('0x4e'));})[_0x6af3('0x4f')](function(){process[_0x6af3('0x50')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xa00b7b=new PdfPrinter({'Arial':{'normal':__dirname+_0x6af3('0x51'),'bold':__dirname+_0x6af3('0x52'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x6af3('0x53')}});return _0xa00b7b;}function getPDFDocDefinitionFromHTML(_0x4736f3,_0x469068){var _0x3afde1=util[_0x6af3('0x1d')](_0x6af3('0x54'),_0x469068[_0x6af3('0x55')],_0x469068['interactionId']);var _0x5b2084=moment()[_0x6af3('0x1d')]('YYYY-MM-DD')[_0x6af3('0x26')]();var _0x265a7d=htmlToPdfmake(_0x4736f3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x265a7d],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6af3('0x56'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x6af3('0x56'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6af3('0x56')}},'header':function(){return[{'text':_0x6af3('0x57'),'style':_0x6af3('0x58')}];},'footer':function(_0x5aa149,_0x37f335){return[{'text':util[_0x6af3('0x1d')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x3afde1,_0x5aa149,_0x37f335,_0x5b2084),'style':'footer'}];}};}function writePDFDocument(_0x5d3439,_0x11aeb7){return new Promise(function(_0x1af4b7,_0x1f6f6b){var _0x287d61=_0x5d3439[_0x6af3('0x59')](fs[_0x6af3('0x5a')](_0x11aeb7));_0x287d61['on'](_0x6af3('0x5b'),function(){_0x1af4b7(_0x6af3('0x5b'));});_0x287d61['on'](_0x6af3('0x5c'),function(_0x19eec0){_0x1f6f6b(_0x19eec0);});_0x5d3439[_0x6af3('0x5d')]();});}exports[_0x6af3('0x5e')]=function(_0x4ad2a9,_0x4119e7){var _0x8d5e89=getPDFPrinter();var _0x20556c=getPDFDocDefinitionFromHTML(_0x4ad2a9,_0x4119e7);var _0x278254=_0x8d5e89['createPdfKitDocument'](_0x20556c);return writePDFDocument(_0x278254,_0x4119e7[_0x6af3('0x2')])[_0x6af3('0x4d')](function(_0x253c82){throw _0x253c82;});};
\ No newline at end of file
index 3ef4dd6..82d063d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe5d=['isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','length','%s%d.%s','xlsx','writeFileSync','%s.%s','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','split'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xbe5d,0x1b0));var _0xdbe5=function(_0x2ec76c,_0x11003a){_0x2ec76c=_0x2ec76c-0x0;var _0x5c892=_0xbe5d[_0x2ec76c];return _0x5c892;};'use strict';var util=require(_0xdbe5('0x0'));var path=require(_0xdbe5('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xdbe5('0x2'));var BPromise=require(_0xdbe5('0x3'));var zipdir=require(_0xdbe5('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xdbe5('0x5'))[_0xdbe5('0x6')];var logger=require('../../config/logger')(_0xdbe5('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xdbe5('0x8')][0x2]);var QUERY=process[_0xdbe5('0x8')][0x3];var PATH=process[_0xdbe5('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x50b5cc,_0xb2d505){var _0x1b7a19={'status':_0x50b5cc};var _0x3b139d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb2d505){_0x1b7a19[_0xdbe5('0x9')]=_0xb2d505;}return db[_0xdbe5('0xa')][_0xdbe5('0xb')](_0x1b7a19,_0x3b139d);}function main(){var _0x1a298c=0x1388;var _0x33a335;logger[_0xdbe5('0xc')](util[_0xdbe5('0xd')](_0xdbe5('0xe'),EXTRACTED_REPORT_ID,_0xdbe5('0xf')));return db[_0xdbe5('0x10')][_0xdbe5('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xdbe5('0x12')]})[_0xdbe5('0x13')](function(_0x14ae5f){if(_0x14ae5f){_0x33a335=_0x14ae5f;_0x1a298c=_0x33a335['splitSizeXlsx']||0x1388;}})[_0xdbe5('0x13')](function(){return dbH[_0xdbe5('0x14')][_0xdbe5('0x15')](util[_0xdbe5('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xdbe5('0x14')][_0xdbe5('0x16')][_0xdbe5('0x17')]});})['then'](function(_0x4b98ad){if(!_0x4b98ad[0x0][_0xdbe5('0x18')]){return analyticExtractedReport(_0xdbe5('0x19'));}var _0x1c6aff=[];var _0x242e18=0x0;if(_0x33a335[_0xdbe5('0x1a')]){if(_0x4b98ad&&_0x4b98ad['length']){var _0x330e9e=_['range'](_0x4b98ad[0x0][_0xdbe5('0x18')]/_0x1a298c);var _0x5443a2=Number[_0xdbe5('0x1b')](_0x4b98ad[0x0][_0xdbe5('0x18')]/_0x1a298c)?_0x4b98ad[0x0]['num']%_0x1a298c:0x0;_0x330e9e[_0xdbe5('0x1c')](function(_0x751f68){if(_0x751f68>0x0){_0x242e18+=_0x1a298c;}_0x1c6aff[_0xdbe5('0x1d')](dbH[_0xdbe5('0x14')][_0xdbe5('0x15')](util[_0xdbe5('0xd')](_0xdbe5('0x1e'),QUERY,_0x1a298c,_0x242e18),{'type':dbH[_0xdbe5('0x14')]['QueryTypes'][_0xdbe5('0x17')]}));});if(_0x5443a2>0x0){_0x242e18+=_0x1a298c;_0x1c6aff[_0xdbe5('0x1d')](dbH['sequelize'][_0xdbe5('0x15')](util[_0xdbe5('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5443a2,_0x242e18),{'type':dbH[_0xdbe5('0x14')][_0xdbe5('0x16')][_0xdbe5('0x17')]}));}}}else{_0x1c6aff[_0xdbe5('0x1d')](dbH['sequelize'][_0xdbe5('0x15')](QUERY,{'type':dbH[_0xdbe5('0x14')][_0xdbe5('0x16')][_0xdbe5('0x17')]}));}var _0x57685a=path[_0xdbe5('0x1f')](PATH);var _0x4f9c2c=path[_0xdbe5('0x20')](PATH,_0xdbe5('0x21'));var _0x5ee97e=_0x33a335[_0xdbe5('0x1a')]&&_0x1c6aff['length']>0x1;var _0x5a6d3a=[];if(!fs[_0xdbe5('0x22')](path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c))&&_0x5ee97e){fs[_0xdbe5('0x24')](path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c));}return BPromise[_0xdbe5('0x25')](_0x1c6aff,function(_0x4515e6){_0x5a6d3a[_0xdbe5('0x1d')](_0x4515e6);})[_0xdbe5('0x13')](function(){for(var _0x3819ed=0x0;_0x3819ed<_0x5a6d3a[_0xdbe5('0x26')];_0x3819ed+=0x1){var _0x59ad9b;var _0x5b455e=_0x5a6d3a[_0x3819ed];if(_0x5ee97e){_0x59ad9b=path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c,util['format'](_0xdbe5('0x27'),_0x4f9c2c,_0x3819ed,_0xdbe5('0x28')));}else{_0x59ad9b=path[_0xdbe5('0x23')](_0x57685a,util['format']('%s.%s',_0x4f9c2c,'xlsx'));}fs[_0xdbe5('0x29')](_0x59ad9b,json2xls(_0x5b455e),'binary');}})['then'](function(){if(_0x5ee97e){return new Promise(function(_0x38d02d){zipdir(path[_0xdbe5('0x23')](_0x57685a,_0x4f9c2c),{'saveTo':path[_0xdbe5('0x23')](_0x57685a,util['format'](_0xdbe5('0x2a'),_0x4f9c2c,'zip'))},function(_0x13ff64,_0x35f2a){rimraf(path['join'](_0x57685a,_0x4f9c2c),function(){});_0x38d02d(_0xdbe5('0x2b'));});});}})[_0xdbe5('0x13')](function(){logger[_0xdbe5('0xc')](util['format'](_0xdbe5('0x2c'),EXTRACTED_REPORT_ID,_0xdbe5('0xf')));return analyticExtractedReport(_0xdbe5('0x2d'),_0x5ee97e?util[_0xdbe5('0xd')](_0xdbe5('0x2a'),_0x4f9c2c,_0x5ee97e?_0xdbe5('0x2e'):_0xdbe5('0x28')):null);});})[_0xdbe5('0x2f')](function(_0x32642d){logger[_0xdbe5('0xc')](util[_0xdbe5('0xd')](_0xdbe5('0x30'),EXTRACTED_REPORT_ID,_0xdbe5('0xf')),util['inspect'](_0x32642d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xdbe5('0x31')](function(){process[_0xdbe5('0x32')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x87d0=['exit','util','path','lodash','bluebird','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.xlsx','split','existsSync','join','each','xlsx','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x87d0,0xbd));var _0x087d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x87d0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x087d('0x0'));var path=require(_0x087d('0x1'));var _=require(_0x087d('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x087d('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x087d('0x4'));var db=require(_0x087d('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x087d('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x087d('0x7')][0x2]);var QUERY=process[_0x087d('0x7')][0x3];var PATH=process[_0x087d('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x571c84,_0x1b1264){var _0x47fa98={'status':_0x571c84};var _0x28cf0d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b1264){_0x47fa98['savename']=_0x1b1264;}return db[_0x087d('0x8')][_0x087d('0x9')](_0x47fa98,_0x28cf0d);}function main(){var _0xf992e1=0x1388;var _0x2b76f1;logger[_0x087d('0xa')](util[_0x087d('0xb')](_0x087d('0xc'),EXTRACTED_REPORT_ID,_0x087d('0xd')));return db[_0x087d('0xe')][_0x087d('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x087d('0x10')]})[_0x087d('0x11')](function(_0x581a32){if(_0x581a32){_0x2b76f1=_0x581a32;_0xf992e1=_0x2b76f1[_0x087d('0x10')]||0x1388;}})['then'](function(){return dbH[_0x087d('0x12')][_0x087d('0x13')](util[_0x087d('0xb')](_0x087d('0x14'),QUERY),{'type':dbH[_0x087d('0x12')][_0x087d('0x15')]['SELECT']});})['then'](function(_0x350df3){if(!_0x350df3[0x0][_0x087d('0x16')]){return analyticExtractedReport(_0x087d('0x17'));}var _0x3e8a5e=[];var _0x20ffa6=0x0;if(_0x2b76f1['split']){if(_0x350df3&&_0x350df3[_0x087d('0x18')]){var _0x2d8722=_['range'](_0x350df3[0x0][_0x087d('0x16')]/_0xf992e1);var _0x306d68=Number[_0x087d('0x19')](_0x350df3[0x0]['num']/_0xf992e1)?_0x350df3[0x0]['num']%_0xf992e1:0x0;_0x2d8722[_0x087d('0x1a')](function(_0x505ad2){if(_0x505ad2>0x0){_0x20ffa6+=_0xf992e1;}_0x3e8a5e[_0x087d('0x1b')](dbH[_0x087d('0x12')]['query'](util[_0x087d('0xb')](_0x087d('0x1c'),QUERY,_0xf992e1,_0x20ffa6),{'type':dbH['sequelize'][_0x087d('0x15')][_0x087d('0x1d')]}));});if(_0x306d68>0x0){_0x20ffa6+=_0xf992e1;_0x3e8a5e[_0x087d('0x1b')](dbH['sequelize']['query'](util[_0x087d('0xb')](_0x087d('0x1c'),QUERY,_0x306d68,_0x20ffa6),{'type':dbH[_0x087d('0x12')][_0x087d('0x15')][_0x087d('0x1d')]}));}}}else{_0x3e8a5e['push'](dbH[_0x087d('0x12')][_0x087d('0x13')](QUERY,{'type':dbH[_0x087d('0x12')][_0x087d('0x15')][_0x087d('0x1d')]}));}var _0x4a97d3=path[_0x087d('0x1e')](PATH);var _0x549a71=path[_0x087d('0x1f')](PATH,_0x087d('0x20'));var _0x345b1a=_0x2b76f1[_0x087d('0x21')]&&_0x3e8a5e[_0x087d('0x18')]>0x1;var _0x616e6c=[];if(!fs[_0x087d('0x22')](path[_0x087d('0x23')](_0x4a97d3,_0x549a71))&&_0x345b1a){fs['mkdirSync'](path['join'](_0x4a97d3,_0x549a71));}return BPromise[_0x087d('0x24')](_0x3e8a5e,function(_0x5e1f57){_0x616e6c[_0x087d('0x1b')](_0x5e1f57);})['then'](function(){for(var _0x2d9682=0x0;_0x2d9682<_0x616e6c[_0x087d('0x18')];_0x2d9682+=0x1){var _0x55de6;var _0x124a10=_0x616e6c[_0x2d9682];if(_0x345b1a){_0x55de6=path[_0x087d('0x23')](_0x4a97d3,_0x549a71,util[_0x087d('0xb')]('%s%d.%s',_0x549a71,_0x2d9682,_0x087d('0x25')));}else{_0x55de6=path[_0x087d('0x23')](_0x4a97d3,util[_0x087d('0xb')](_0x087d('0x26'),_0x549a71,_0x087d('0x25')));}fs['writeFileSync'](_0x55de6,json2xls(_0x124a10),'binary');}})[_0x087d('0x11')](function(){if(_0x345b1a){return new Promise(function(_0x15bebe){zipdir(path['join'](_0x4a97d3,_0x549a71),{'saveTo':path[_0x087d('0x23')](_0x4a97d3,util[_0x087d('0xb')](_0x087d('0x26'),_0x549a71,_0x087d('0x27')))},function(_0x32d547,_0x3040c3){rimraf(path[_0x087d('0x23')](_0x4a97d3,_0x549a71),function(){});_0x15bebe(_0x087d('0x28'));});});}})['then'](function(){logger['info'](util[_0x087d('0xb')](_0x087d('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x087d('0x2a'),_0x345b1a?util[_0x087d('0xb')]('%s.%s',_0x549a71,_0x345b1a?_0x087d('0x27'):_0x087d('0x25')):null);});})['catch'](function(_0x1a9b9b){logger['info'](util['format'](_0x087d('0x2b'),EXTRACTED_REPORT_ID,_0x087d('0xd')),util['inspect'](_0x1a9b9b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x087d('0x2c'));})[_0x087d('0x2d')](function(){process[_0x087d('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
index 375dcfe..0e0ba73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8f3=['findAll','intervals','VoiceExtension','uniq','exten','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','map','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','destroy','then','sortBy','catch','lodash','models','Interval'];(function(_0x2036d3,_0x123ff3){var _0x1b1952=function(_0x1240d9){while(--_0x1240d9){_0x2036d3['push'](_0x2036d3['shift']());}};_0x1b1952(++_0x123ff3);}(_0xd8f3,0x195));var _0x3d8f=function(_0xfd655c,_0x382323){_0xfd655c=_0xfd655c-0x0;var _0xee02d8=_0xd8f3[_0xfd655c];return _0xee02d8;};'use strict';var _=require(_0x3d8f('0x0'));var util=require('util');function rewrite(_0x29e149,_0x1fa9f3){var _0x2ebbc0=this;return _0x29e149[_0x3d8f('0x1')][_0x3d8f('0x2')][_0x3d8f('0x3')]({'raw':!![]})['then'](function(_0xfdfef2){_0x2ebbc0[_0x3d8f('0x4')]=_0xfdfef2;return _0x29e149[_0x3d8f('0x1')][_0x3d8f('0x5')][_0x3d8f('0x3')]({'where':{'IntervalId':_0x1fa9f3['IntervalId']},'raw':!![]});})['then'](function(_0x53fcf3){return _0x29e149['models']['VoiceExtension'][_0x3d8f('0x3')]({'where':{'exten':{'$in':_[_0x3d8f('0x6')](_['map'](_0x53fcf3,_0x3d8f('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x375fcd){var _0x58bb7e=_[_0x3d8f('0x8')](_0x375fcd,{'priority':'1'});var _0x32d810=_[_0x3d8f('0x8')](_0x375fcd,{'isApp':0x1});var _0x580e19=_[_0x3d8f('0x9')](_0x32d810,_0x3d8f('0x7'));var _0x5992b7=['queue',_0x3d8f('0xa')];var _0x46fd7e=[];var _0x1f280a=[];for(var _0x32b7c4 in _0x580e19){if(_0x580e19[_0x3d8f('0xb')](_0x32b7c4)){_0x2ebbc0[_0x3d8f('0xc')]=0x2;_0x2ebbc0[_0x3d8f('0xd')]=[];_0x2ebbc0[_0x3d8f('0xe')]=_[_0x3d8f('0xf')](_0x58bb7e,{'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')]});_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':util[_0x3d8f('0x13')](_0x3d8f('0x14'),_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')]),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});if(_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')]===_0x3d8f('0x17')){_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x18')+_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}else if(_0x580e19[_0x32b7c4][0x0]['type']===_0x3d8f('0x19')){if(_0x2ebbc0[_0x3d8f('0xe')]){_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x1a')+(_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x1b')]?_0x3d8f('0x1c')+_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x1b')]+'}':_0x3d8f('0x1d')),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0['priority']++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':_0x3d8f('0x12'),'appdata':'CDR(routeid)='+_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});var _0x4b95c7=_0x2ebbc0[_0x3d8f('0xc')]++;_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x1f')+(_0x4b95c7+0x2)+_0x3d8f('0x20')+(_0x4b95c7+0x1)+')','context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x4b95c7,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});if(_0x2ebbc0[_0x3d8f('0xe')]){_0x2ebbc0[_0x3d8f('0xd')]['push']({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x2ebbc0[_0x3d8f('0xe')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x1b')]+'}':_0x3d8f('0x21'),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x22')+_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});if(_0x2ebbc0[_0x3d8f('0xe')]&&_0x2ebbc0['extension'][_0x3d8f('0xb')]('recordingFormat')&&_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x23')]!==_0x3d8f('0x24')){_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x25'),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0]['exten'],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x26')+_0x2ebbc0[_0x3d8f('0xe')][_0x3d8f('0x23')]||'wav','context':_0x580e19[_0x32b7c4][0x0]['context'],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}}_0x2ebbc0[_0x3d8f('0xd')]['push']({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0]['VoiceExtensionId']});_0x2ebbc0[_0x3d8f('0xd')]['push']({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x27'),'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});_0x2ebbc0[_0x3d8f('0xd')][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0]['type'],'app':_0x3d8f('0x12'),'appdata':_0x3d8f('0x28'),'context':_0x580e19[_0x32b7c4][0x0]['context'],'exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'priority':_0x2ebbc0[_0x3d8f('0xc')]++,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0]['VoiceExtensionId']});for(var _0x3c6ad2=0x0,_0x2bde85=0x0;_0x3c6ad2<_0x580e19[_0x32b7c4][_0x3d8f('0x29')];_0x3c6ad2+=0x1,_0x2bde85=0x0){var _0x5990e2=_0x580e19[_0x32b7c4][_0x3c6ad2];if(_0x5990e2[_0x3d8f('0x11')]){_0x5990e2[_0x3d8f('0x11')]=_0x5990e2[_0x3d8f('0x11')][_0x3d8f('0x2a')]();}var _0x1b965b=[];var _0x2f799f=[];delete _0x5990e2['id'];delete _0x5990e2[_0x3d8f('0x2b')];delete _0x5990e2[_0x3d8f('0x2c')];var _0x49e1a3=_0x5990e2[_0x3d8f('0x2d')]!==_0x3d8f('0x2e')?[_0x5990e2[_0x3d8f('0x2d')]]:_0x5990e2[_0x3d8f('0x2f')]?_[_0x3d8f('0x30')](_[_0x3d8f('0x8')](_0x2ebbc0['intervals'],{'IntervalId':_0x5990e2['IntervalId']}),_0x3d8f('0x2d')):[];if(_0x5990e2[_0x3d8f('0xb')]('tag')){if(_0x5990e2[_0x3d8f('0x31')]&&_0x5990e2[_0x3d8f('0x31')]!=='--'){_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2['type'],'app':_0x3d8f('0x12'),'appdata':'CDR(tag)='+_0x5990e2[_0x3d8f('0x31')],'context':_0x5990e2['context'],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2['VoiceExtensionId']});}}if(_0x5990e2[_0x3d8f('0x11')]===_0x3d8f('0x19')&&_0x5990e2[_0x3d8f('0xb')](_0x3d8f('0x32'))){if(_0x5990e2[_0x3d8f('0x32')]){_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2[_0x3d8f('0x11')],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x33')+_0x5990e2['callerID']+')','context':_0x5990e2['context'],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0['priority']+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}else{_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2['type'],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x34'),'context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2['exten'],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}}if(_0x5990e2['hasOwnProperty']('answer')){if(_0x5992b7['indexOf'](_0x5990e2[_0x3d8f('0x35')][_0x3d8f('0x2a')]())>=0x0&&_0x5990e2[_0x3d8f('0x36')]!=='custom'){if(_0x5990e2[_0x3d8f('0x37')]){_0x1b965b['push']({'type':_0x5990e2[_0x3d8f('0x11')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2['exten'],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2[_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x38'),'context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2['exten'],'priority':_0x49e1a3['length']+_0x2ebbc0[_0x3d8f('0xc')]+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}else{_0x1b965b['push']({'type':_0x5990e2[_0x3d8f('0x11')],'app':_0x3d8f('0x1e'),'appdata':_0x3d8f('0x39'),'context':_0x5990e2['context'],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0['priority']+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});_0x1b965b[_0x3d8f('0x10')]({'type':_0x5990e2[_0x3d8f('0x11')],'app':'Set','appdata':_0x3d8f('0x3a'),'context':_0x5990e2[_0x3d8f('0x15')],'exten':_0x5990e2[_0x3d8f('0x7')],'priority':_0x49e1a3[_0x3d8f('0x29')]+_0x2ebbc0['priority']+_0x2bde85++,'VoiceExtensionId':_0x5990e2[_0x3d8f('0x16')]});}}}for(var _0x34d437=0x0;_0x34d437<_0x49e1a3[_0x3d8f('0x29')];_0x34d437+=0x1){var _0x40adc8=_0x2ebbc0['priority']+_0x49e1a3[_0x3d8f('0x29')];var _0x2c14cc=_0x34d437===_0x49e1a3['length']-0x1?_0x2ebbc0[_0x3d8f('0xc')]+_0x1b965b[_0x3d8f('0x29')]+_0x2f799f[_0x3d8f('0x29')]+0x2:_0x2ebbc0[_0x3d8f('0xc')]+_0x34d437+0x1;_0x1b965b[_0x3d8f('0x3b')](_0x34d437,0x0,{'type':_0x5990e2[_0x3d8f('0x11')],'app':'GotoIfTime','appdata':_0x49e1a3[_0x34d437]+'?'+_0x5990e2[_0x3d8f('0x15')]+_0x3d8f('0x3c')+_0x40adc8+':'+_0x5990e2['context']+_0x3d8f('0x3c')+_0x2c14cc,'exten':_0x5990e2[_0x3d8f('0x7')],'context':_0x5990e2[_0x3d8f('0x15')],'priority':_0x2ebbc0[_0x3d8f('0xc')]+_0x34d437,'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]});}_0x5990e2[_0x3d8f('0xc')]=_0x1b965b[_0x3d8f('0x29')]?_[_0x3d8f('0x3d')](_0x1b965b)['priority']+0x1:_0x2ebbc0[_0x3d8f('0xc')];_0x2ebbc0[_0x3d8f('0xc')]=(_0x2f799f[_0x3d8f('0x29')]?_['last'](_0x2f799f)[_0x3d8f('0xc')]:_0x5990e2[_0x3d8f('0xc')])+0x1;_0x2ebbc0[_0x3d8f('0xd')]=_[_0x3d8f('0x3e')](_0x2ebbc0['extensions'],_0x1b965b,[_0x5990e2],_0x2f799f);}_0x2ebbc0['extensions'][_0x3d8f('0x10')]({'type':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x11')],'app':'Hangup','exten':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x7')],'context':_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x15')],'priority':_0x2ebbc0[_0x3d8f('0xc')],'VoiceExtensionId':_0x580e19[_0x32b7c4][0x0]['VoiceExtensionId']});_0x46fd7e[_0x3d8f('0x10')](_0x580e19[_0x32b7c4][0x0][_0x3d8f('0x16')]);_0x1f280a=_['concat'](_0x1f280a,_0x2ebbc0[_0x3d8f('0xd')]);}}return _0x29e149[_0x3d8f('0x3f')](function(_0x259055){return _0x29e149[_0x3d8f('0x1')]['VoiceExtension'][_0x3d8f('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x46fd7e}},'transaction':_0x259055})[_0x3d8f('0x41')](function(_0x3bc7dd){return _0x29e149['models'][_0x3d8f('0x5')]['bulkCreate'](_[_0x3d8f('0x42')](_0x1f280a,_0x3d8f('0xc')),{'transaction':_0x259055});});});})[_0x3d8f('0x43')](function(_0x1bea4a){console['error'](_0x1bea4a);});}exports['rewrite']=rewrite;
\ No newline at end of file
+var _0x4816=['):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','extensions','push','type','format','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','Set','${EXTEN:','cutdigits','ExecIf'];(function(_0xd1bbc5,_0x49370a){var _0x506e97=function(_0x1f0165){while(--_0x1f0165){_0xd1bbc5['push'](_0xd1bbc5['shift']());}};_0x506e97(++_0x49370a);}(_0x4816,0xdb));var _0x6481=function(_0x129216,_0x5c208d){_0x129216=_0x129216-0x0;var _0x2a0306=_0x4816[_0x129216];return _0x2a0306;};'use strict';var _=require(_0x6481('0x0'));var util=require(_0x6481('0x1'));function rewrite(_0x3b98b1,_0x3f7b58){var _0x3ed77b=this;return _0x3b98b1[_0x6481('0x2')][_0x6481('0x3')][_0x6481('0x4')]({'raw':!![]})[_0x6481('0x5')](function(_0xa194b1){_0x3ed77b[_0x6481('0x6')]=_0xa194b1;return _0x3b98b1['models'][_0x6481('0x7')][_0x6481('0x4')]({'where':{'IntervalId':_0x3f7b58[_0x6481('0x8')]},'raw':!![]});})[_0x6481('0x5')](function(_0x2b17a3){return _0x3b98b1[_0x6481('0x2')][_0x6481('0x7')][_0x6481('0x4')]({'where':{'exten':{'$in':_[_0x6481('0x9')](_[_0x6481('0xa')](_0x2b17a3,_0x6481('0xb')))}},'order':[{'raw':_0x6481('0xc')}],'raw':!![]});})[_0x6481('0x5')](function(_0x1bc829){var _0x5bcb54=_[_0x6481('0xd')](_0x1bc829,{'priority':'1'});var _0x4216bc=_[_0x6481('0xd')](_0x1bc829,{'isApp':0x1});var _0x2ca583=_[_0x6481('0xe')](_0x4216bc,'exten');var _0x152133=[_0x6481('0xf'),_0x6481('0x10')];var _0x718b5b=[];var _0xb28888=[];for(var _0x3142bd in _0x2ca583){if(_0x2ca583[_0x6481('0x11')](_0x3142bd)){_0x3ed77b[_0x6481('0x12')]=0x2;_0x3ed77b['extensions']=[];_0x3ed77b[_0x6481('0x13')]=_['find'](_0x5bcb54,{'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')]});_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':'Set','appdata':util[_0x6481('0x17')]('CDR(type)=%s',_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')]),'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b['priority']++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});if(_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')]===_0x6481('0x19')){_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0]['type'],'app':'Set','appdata':_0x6481('0x1a')+_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});}else if(_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')]===_0x6481('0x1c')){if(_0x3ed77b[_0x6481('0x13')]){_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'CDR(destination)='+(_0x3ed77b['extension']['cutdigits']?_0x6481('0x1e')+_0x3ed77b[_0x6481('0x13')][_0x6481('0x1f')]+'}':'${EXTEN}'),'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});}_0x3ed77b['extensions'][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'CDR(routeid)='+_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});var _0x15bd5d=_0x3ed77b[_0x6481('0x12')]++;_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x20'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x15bd5d+0x2)+_0x6481('0x21')+(_0x15bd5d+0x1)+')','context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x15bd5d,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});if(_0x3ed77b['extension']){_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':_0x3ed77b[_0x6481('0x13')][_0x6481('0x1f')]?'CDR(prefix)=${EXTEN:0:'+_0x3ed77b['extension'][_0x6481('0x1f')]+'}':'CDR(prefix)=noprefix','context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});}_0x3ed77b['extensions'][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':'Set','appdata':_0x6481('0x22')+_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});if(_0x3ed77b['extension']&&_0x3ed77b['extension']['hasOwnProperty'](_0x6481('0x23'))&&_0x3ed77b[_0x6481('0x13')][_0x6481('0x23')]!==_0x6481('0x24')){_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':_0x6481('0x25'),'context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});_0x3ed77b[_0x6481('0x14')][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3ed77b[_0x6481('0x13')][_0x6481('0x23')]||_0x6481('0x26'),'context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});}}_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b['priority']++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b['priority']++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});_0x3ed77b['extensions'][_0x6481('0x15')]({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'MONITOR_OPTIONS=ab','context':_0x2ca583[_0x3142bd][0x0]['context'],'exten':_0x2ca583[_0x3142bd][0x0][_0x6481('0xb')],'priority':_0x3ed77b[_0x6481('0x12')]++,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0][_0x6481('0x1b')]});for(var _0x109a0f=0x0,_0x40586a=0x0;_0x109a0f<_0x2ca583[_0x3142bd]['length'];_0x109a0f+=0x1,_0x40586a=0x0){var _0x17c6cc=_0x2ca583[_0x3142bd][_0x109a0f];if(_0x17c6cc[_0x6481('0x16')]){_0x17c6cc[_0x6481('0x16')]=_0x17c6cc[_0x6481('0x16')][_0x6481('0x27')]();}var _0x316046=[];var _0x2c0825=[];delete _0x17c6cc['id'];delete _0x17c6cc[_0x6481('0x28')];delete _0x17c6cc[_0x6481('0x29')];var _0x5f4391=_0x17c6cc['interval']!==_0x6481('0x2a')?[_0x17c6cc['interval']]:_0x17c6cc[_0x6481('0x8')]?_[_0x6481('0xa')](_[_0x6481('0xd')](_0x3ed77b[_0x6481('0x6')],{'IntervalId':_0x17c6cc['IntervalId']}),_0x6481('0x2b')):[];if(_0x17c6cc['hasOwnProperty'](_0x6481('0x2c'))){if(_0x17c6cc[_0x6481('0x2c')]&&_0x17c6cc[_0x6481('0x2c')]!=='--'){_0x316046['push']({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':'CDR(tag)='+_0x17c6cc[_0x6481('0x2c')],'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc['exten'],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b['priority']+_0x40586a++,'VoiceExtensionId':_0x17c6cc['VoiceExtensionId']});}}if(_0x17c6cc[_0x6481('0x16')]==='outbound'&&_0x17c6cc[_0x6481('0x11')](_0x6481('0x2e'))){if(_0x17c6cc[_0x6481('0x2e')]){_0x316046['push']({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x20'),'appdata':_0x6481('0x2f')+_0x17c6cc[_0x6481('0x2e')]+')','context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});}else{_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x20'),'appdata':_0x6481('0x30'),'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b['priority']+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});}}if(_0x17c6cc['hasOwnProperty'](_0x6481('0x31'))){if(_0x152133[_0x6481('0x32')](_0x17c6cc[_0x6481('0x33')][_0x6481('0x27')]())>=0x0&&_0x17c6cc[_0x6481('0x34')]!=='custom'){if(_0x17c6cc[_0x6481('0x31')]){_0x316046['push']({'type':_0x17c6cc['type'],'app':_0x6481('0x20'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc['VoiceExtensionId']});_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':'Set','appdata':_0x6481('0x35'),'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});}else{_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc[_0x6481('0x1b')]});_0x316046[_0x6481('0x15')]({'type':_0x17c6cc[_0x6481('0x16')],'app':_0x6481('0x1d'),'appdata':_0x6481('0x36'),'context':_0x17c6cc[_0x6481('0x18')],'exten':_0x17c6cc[_0x6481('0xb')],'priority':_0x5f4391[_0x6481('0x2d')]+_0x3ed77b[_0x6481('0x12')]+_0x40586a++,'VoiceExtensionId':_0x17c6cc['VoiceExtensionId']});}}}for(var _0x7409d9=0x0;_0x7409d9<_0x5f4391[_0x6481('0x2d')];_0x7409d9+=0x1){var _0x52b929=_0x3ed77b[_0x6481('0x12')]+_0x5f4391[_0x6481('0x2d')];var _0x5f50d9=_0x7409d9===_0x5f4391[_0x6481('0x2d')]-0x1?_0x3ed77b[_0x6481('0x12')]+_0x316046['length']+_0x2c0825[_0x6481('0x2d')]+0x2:_0x3ed77b['priority']+_0x7409d9+0x1;_0x316046['splice'](_0x7409d9,0x0,{'type':_0x17c6cc[_0x6481('0x16')],'app':'GotoIfTime','appdata':_0x5f4391[_0x7409d9]+'?'+_0x17c6cc[_0x6481('0x18')]+_0x6481('0x37')+_0x52b929+':'+_0x17c6cc[_0x6481('0x18')]+',${EXTEN},'+_0x5f50d9,'exten':_0x17c6cc[_0x6481('0xb')],'context':_0x17c6cc[_0x6481('0x18')],'priority':_0x3ed77b[_0x6481('0x12')]+_0x7409d9,'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});}_0x17c6cc[_0x6481('0x12')]=_0x316046[_0x6481('0x2d')]?_[_0x6481('0x38')](_0x316046)['priority']+0x1:_0x3ed77b[_0x6481('0x12')];_0x3ed77b[_0x6481('0x12')]=(_0x2c0825['length']?_['last'](_0x2c0825)['priority']:_0x17c6cc['priority'])+0x1;_0x3ed77b[_0x6481('0x14')]=_[_0x6481('0x39')](_0x3ed77b[_0x6481('0x14')],_0x316046,[_0x17c6cc],_0x2c0825);}_0x3ed77b[_0x6481('0x14')]['push']({'type':_0x2ca583[_0x3142bd][0x0][_0x6481('0x16')],'app':_0x6481('0x3a'),'exten':_0x2ca583[_0x3142bd][0x0]['exten'],'context':_0x2ca583[_0x3142bd][0x0][_0x6481('0x18')],'priority':_0x3ed77b['priority'],'VoiceExtensionId':_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']});_0x718b5b[_0x6481('0x15')](_0x2ca583[_0x3142bd][0x0]['VoiceExtensionId']);_0xb28888=_[_0x6481('0x39')](_0xb28888,_0x3ed77b[_0x6481('0x14')]);}}return _0x3b98b1['transaction'](function(_0x371e6a){return _0x3b98b1[_0x6481('0x2')][_0x6481('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x718b5b}},'transaction':_0x371e6a})[_0x6481('0x5')](function(_0x2ee97d){return _0x3b98b1[_0x6481('0x2')]['VoiceExtension']['bulkCreate'](_[_0x6481('0x3b')](_0xb28888,_0x6481('0x12')),{'transaction':_0x371e6a});});});})[_0x6481('0x3c')](function(_0xa65b00){console[_0x6481('0x3d')](_0xa65b00);});}exports[_0x6481('0x3e')]=rewrite;
\ No newline at end of file
index 537b884..9bd8aba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59e3=['info','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','pause','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','Missing\x20ListId\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','map','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','length','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL','id\x20IN\x20?','calleridnum','cm_hopper_final','insert','cm_hopper_black','str','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','VoiceQueue','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','SIGINT'];(function(_0x5d3903,_0x3d6c3e){var _0x4b8bc9=function(_0x92b297){while(--_0x92b297){_0x5d3903['push'](_0x5d3903['shift']());}};_0x4b8bc9(++_0x3d6c3e);}(_0x59e3,0x77));var _0x359e=function(_0x18d2e6,_0x5894c1){_0x18d2e6=_0x18d2e6-0x0;var _0x3eb13c=_0x59e3[_0x18d2e6];return _0x3eb13c;};'use strict';var BPromise=require('bluebird');var util=require(_0x359e('0x0'));var _=require(_0x359e('0x1'));var fs=require('fs');var squel=require(_0x359e('0x2'));var Papa=require(_0x359e('0x3'));var Redis=require('ioredis');var db=require(_0x359e('0x4'))['db'];var config=require(_0x359e('0x5'));var logger=require(_0x359e('0x6'))(_0x359e('0x7'));config[_0x359e('0x8')]=_[_0x359e('0x9')](config[_0x359e('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x359e('0x8')]));require(_0x359e('0xa'))[_0x359e('0xb')](socket);try{if(!process[_0x359e('0xc')][0x2]||process[_0x359e('0xc')][0x2]===_0x359e('0xd')||process[_0x359e('0xc')][0x2]===_0x359e('0xe')){throw new Error(_0x359e('0xf'));}var FILEPATH=process[_0x359e('0xc')][0x2];if(!process[_0x359e('0xc')][0x3]||process[_0x359e('0xc')][0x3]===_0x359e('0xd')||process[_0x359e('0xc')][0x3]===_0x359e('0xe')||!process[_0x359e('0xc')][0x4]||process[_0x359e('0xc')][0x4]===_0x359e('0xd')||process['argv'][0x4]==='null'){throw new Error(_0x359e('0x10'));}var FIELDS=_['zipObject'](process['argv'][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x359e('0xc')][0x5]||process[_0x359e('0xc')][0x5]===_0x359e('0xd')||process[_0x359e('0xc')][0x5]==='null'){throw new Error(_0x359e('0x11'));}var LISTID=process[_0x359e('0xc')][0x5];var COMPANYID=process[_0x359e('0xc')][0x6]&&process[_0x359e('0xc')][0x6]!==_0x359e('0xd')&&process[_0x359e('0xc')][0x6]!==_0x359e('0xe')?process[_0x359e('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x359e('0xc')][0x7]!==_0x359e('0xd')&&process[_0x359e('0xc')][0x7]!==_0x359e('0xe')?process[_0x359e('0xc')][0x7]:null;if(!process[_0x359e('0xc')][0x8]||process[_0x359e('0xc')][0x8]===_0x359e('0xd')||process['argv'][0x8]===_0x359e('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x359e('0xc')][0x8];}catch(_0x2e6fee){logger[_0x359e('0x12')](_0x2e6fee);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x305ac7,_0x4abd01,_0x2c1c48,_0x6ea79f){var _0x28c4d3={'message':_0x4abd01};_0x28c4d3[_0x305ac7]=!![];if(_0x2c1c48){_0x28c4d3[_0x359e('0x13')]=_0x2c1c48;}if(_0x6ea79f){_0x28c4d3['index']=_0x6ea79f;}return _0x28c4d3;}function isEmail(_0x1cf114){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x359e('0x14')](_0x1cf114);}function checkRow(_0x4800ed,_0xddd025,_0xdecc70){return new BPromise(function(_0x531485,_0x163dfe){if(_[_0x359e('0x15')](_0x4800ed)){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x16'),null,_0xdecc70));}if(_0x4800ed['errors']&&_0x4800ed['errors']['length']){var _0x4a98ee=_[_0x359e('0x17')](_0x4800ed[_0x359e('0x18')],_0x359e('0x19'))[_0x359e('0x1a')](';');return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x4a98ee,null,_0xdecc70));}var _0x471657={};for(var _0xeda530 in FIELDS){if(FIELDS[_0x359e('0x1b')](_0xeda530)&&FIELDS[_0xeda530]){_0x471657[_0xeda530]=_0x4800ed[_0x359e('0x1c')][0x0][FIELDS[_0xeda530]]||_0x4800ed[_0x359e('0x1c')][0x0]['\ufeff'+FIELDS[_0xeda530]];}}if(!_0x471657[_0x359e('0x1d')]){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x1e'),null,_0xdecc70));}if(!_0x471657[_0x359e('0x1f')]){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x20'),null,_0xdecc70));}if(_0x471657[_0x359e('0x21')]){var _0x5999c2=moment(_0x471657[_0x359e('0x21')],_0x359e('0x22'));if(!_0x5999c2[_0x359e('0x23')]()){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x24'),null,_0xdecc70));}}if(_0x471657[_0x359e('0x25')]){if(!isEmail(_0x471657['email'])){return _0x163dfe(handleCheckRowError(_0x359e('0x12'),_0x359e('0x26'),null,_0xdecc70));}}_0x471657[_0x359e('0x27')]=LISTID;_0x471657[_0x359e('0x28')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x359e('0x29')]&&_0xddd025){var _0xc2cfb8={};for(var _0x4687ff=0x0,_0x585168=DUPLICATES[_0x359e('0x29')];_0x4687ff<_0x585168;_0x4687ff+=0x1){_0xc2cfb8[DUPLICATES[_0x4687ff]]=_0x471657[DUPLICATES[_0x4687ff]];}var _0x10cf2=_['find'](_0xddd025,_0xc2cfb8);if(_0x10cf2){return _0x163dfe(handleCheckRowError('duplicate',_0x359e('0x2a'),_0x10cf2,_0xdecc70));}}return db[_0x359e('0x2b')][_0x359e('0x2c')](_0x471657,{'raw':!![],'hooks':![],'fields':_['keys'](_0x471657)})[_0x359e('0x2d')](function(_0x3a4f5a){if(DUPLICATES&&DUPLICATES['length']&&_0xddd025){_0xddd025[_0x359e('0x2e')](_[_0x359e('0x2f')](_0x471657,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3a4f5a['id'];return _0x531485();})[_0x359e('0x30')](function(_0x211e30){return _0x163dfe(handleCheckRowError('error',_0x359e('0x31')+(_0x211e30[_0x359e('0x19')]||JSON[_0x359e('0x32')](_0x211e30)),null,_0xdecc70));});});}function checkHopper(){function _0x17684c(){return function(_0x14f80f){logger[_0x359e('0x12')](_0x359e('0x33'),_0x359e('0x34'),util[_0x359e('0x35')](_0x14f80f,{'showHidden':![],'depth':null}));};}var _0x28df5d=function(_0x316e2b,_0x11a8bc){var _0xf804bf=squel['insert']()[_0x359e('0x36')](_0x359e('0x37'))[_0x359e('0x38')]([_0x359e('0x1f'),_0x359e('0x39'),_0x359e('0x3a'),'ListId',_0x11a8bc,'createdAt',_0x359e('0x3b')],squel[_0x359e('0x3c')]()[_0x359e('0x3d')]('phone',_0x359e('0x1f'))['field'](_0x359e('0x3e'),_0x359e('0x39'))[_0x359e('0x3d')]('id',_0x359e('0x3a'))[_0x359e('0x3d')](LISTID[_0x359e('0x3f')](),'ListId')['field'](_0x316e2b['id'][_0x359e('0x3f')](),_0x11a8bc)[_0x359e('0x3d')](_0x359e('0x3e'),_0x359e('0x40'))['field']('NOW()',_0x359e('0x3b'))[_0x359e('0x41')]('cm_contacts')[_0x359e('0x42')]('deletedAt\x20IS\x20NULL')['where'](_0x359e('0x43'),LISTID['toString']())[_0x359e('0x42')](_0x359e('0x44'))[_0x359e('0x42')](_0x359e('0x45'),squel['select']()[_0x359e('0x3d')]('phone')[_0x359e('0x41')]('cm_hopper')[_0x359e('0x42')](_0x11a8bc+_0x359e('0x46'),_0x316e2b['id'][_0x359e('0x3f')]())))[_0x359e('0x3f')]();return _0xf804bf;};var _0x39f86f=function(_0x2b270d,_0x335058){var _0x3fe55c=squel['insert']()[_0x359e('0x36')](_0x359e('0x37'))['fromQuery']([_0x359e('0x1f'),_0x359e('0x39'),_0x359e('0x3a'),_0x359e('0x27'),_0x335058,_0x359e('0x40'),_0x359e('0x3b')],squel[_0x359e('0x3c')]()[_0x359e('0x3d')]('phone',_0x359e('0x1f'))[_0x359e('0x3d')]('NOW()','scheduledAt')[_0x359e('0x3d')]('id',_0x359e('0x3a'))['field'](LISTID['toString'](),_0x359e('0x27'))[_0x359e('0x3d')](_0x2b270d['id'][_0x359e('0x3f')](),_0x335058)['field'](_0x359e('0x3e'),_0x359e('0x40'))['field'](_0x359e('0x3e'),'updatedAt')[_0x359e('0x41')](_0x359e('0x47'))[_0x359e('0x42')](_0x359e('0x48'))[_0x359e('0x42')](_0x359e('0x43'),LISTID[_0x359e('0x3f')]())['where'](_0x359e('0x49'),squel['str'](hopperContacts))[_0x359e('0x42')](_0x359e('0x44'))['where'](_0x359e('0x45'),squel[_0x359e('0x3c')]()[_0x359e('0x3d')](_0x359e('0x4a'))['from'](_0x359e('0x4b'))[_0x359e('0x42')](_0x335058+_0x359e('0x46'),_0x2b270d['id'][_0x359e('0x3f')]()))[_0x359e('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x359e('0x3c')]()[_0x359e('0x3d')]('phone')[_0x359e('0x41')](_0x359e('0x37'))[_0x359e('0x42')](_0x335058+'\x20=\x20?',_0x2b270d['id'][_0x359e('0x3f')]())))[_0x359e('0x3f')]();return _0x3fe55c;};function _0x19f7db(_0xddba70,_0x415d58){var _0x15a425=squel[_0x359e('0x4c')]()[_0x359e('0x36')](_0x359e('0x37'))[_0x359e('0x38')]([_0x359e('0x1f'),_0x359e('0x39'),_0x359e('0x3a'),_0x359e('0x27'),_0x415d58,_0x359e('0x40'),_0x359e('0x3b')],squel[_0x359e('0x3c')]()['field']('phone',_0x359e('0x1f'))['field'](_0x359e('0x3e'),'scheduledAt')[_0x359e('0x3d')]('id',_0x359e('0x3a'))[_0x359e('0x3d')](LISTID[_0x359e('0x3f')](),'ListId')[_0x359e('0x3d')](_0xddba70['id'][_0x359e('0x3f')](),_0x415d58)[_0x359e('0x3d')](_0x359e('0x3e'),_0x359e('0x40'))['field'](_0x359e('0x3e'),'updatedAt')['from'](_0x359e('0x47'))['where'](_0x359e('0x48'))[_0x359e('0x42')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0x359e('0x49'),squel['str'](hopperContacts))[_0x359e('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x359e('0x3f')]();return _0x15a425;}function _0x58861e(_0x21261a,_0x1ed51a){var _0x5032b5=squel['insert']()[_0x359e('0x36')](_0x359e('0x4d'))['fromQuery']([_0x359e('0x1f'),_0x359e('0x3a'),_0x359e('0x27'),_0x1ed51a,_0x359e('0x40'),_0x359e('0x3b')],squel[_0x359e('0x3c')]()[_0x359e('0x3d')](_0x359e('0x1f'),_0x359e('0x1f'))[_0x359e('0x3d')]('id',_0x359e('0x3a'))[_0x359e('0x3d')](LISTID[_0x359e('0x3f')](),_0x359e('0x27'))[_0x359e('0x3d')](_0x21261a['id'][_0x359e('0x3f')](),_0x1ed51a)['field'](_0x359e('0x3e'),'createdAt')[_0x359e('0x3d')](_0x359e('0x3e'),_0x359e('0x3b'))['from']('cm_contacts')[_0x359e('0x42')](_0x359e('0x48'))[_0x359e('0x42')]('ListId\x20=\x20?',LISTID[_0x359e('0x3f')]())[_0x359e('0x42')](_0x359e('0x49'),squel[_0x359e('0x4e')](hopperContacts))[_0x359e('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x359e('0x3f')]();return _0x5032b5;}return db['VoiceQueue'][_0x359e('0x4f')]({'where':{'type':_0x359e('0x50')},'attributes':['id',_0x359e('0x51')],'include':[{'model':db[_0x359e('0x52')],'as':_0x359e('0x53'),'where':{'id':LISTID}}]})[_0x359e('0x2d')](function(_0x5df0ff){var _0x5c4fc5=[];if(_0x5df0ff){var _0x389af9;for(var _0x348a5=0x0,_0x4761ba;_0x348a5<_0x5df0ff[_0x359e('0x29')];_0x348a5+=0x1){_0x4761ba=_0x5df0ff[_0x348a5][_0x359e('0x54')]({'plain':!![]});switch(_0x4761ba[_0x359e('0x51')]){case _0x359e('0x55'):_0x5c4fc5[_0x359e('0x2e')](db[_0x359e('0x56')][_0x359e('0x57')](_0x39f86f(_0x4761ba,_0x359e('0x58')))['then'](function(){})['catch'](_0x17684c()));break;case _0x359e('0x59'):_0x5c4fc5[_0x359e('0x2e')](db[_0x359e('0x56')]['query'](_0x28df5d(_0x4761ba,_0x359e('0x58')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));break;default:_0x5c4fc5[_0x359e('0x2e')](db[_0x359e('0x56')][_0x359e('0x57')](_0x19f7db(_0x4761ba,_0x359e('0x58')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));}}}return _0x5c4fc5;})[_0x359e('0x5a')]()[_0x359e('0x2d')](function(){return db[_0x359e('0x5b')][_0x359e('0x4f')]({'where':{'type':_0x359e('0x50')},'attributes':['id'],'include':[{'model':db[_0x359e('0x52')],'as':_0x359e('0x5c'),'where':{'id':LISTID}}]})[_0x359e('0x2d')](function(_0x3073b0){var _0x2646e1=[];if(_0x3073b0){var _0x475ea2;for(var _0xcbd520=0x0,_0x57a7ff;_0xcbd520<_0x3073b0[_0x359e('0x29')];_0xcbd520+=0x1){_0x57a7ff=_0x3073b0[_0xcbd520][_0x359e('0x54')]({'plain':!![]});_0x2646e1['push'](db[_0x359e('0x56')][_0x359e('0x57')](_0x58861e(_0x57a7ff,_0x359e('0x58')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));}}return _0x2646e1;})[_0x359e('0x5a')]();})[_0x359e('0x2d')](function(){return db[_0x359e('0x5d')]['findAll']({'attributes':['id',_0x359e('0x51')],'include':[{'model':db[_0x359e('0x52')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x38b033){var _0x4a3368=[];if(_0x38b033){for(var _0x5f3a02=0x0,_0x5a9228;_0x5f3a02<_0x38b033[_0x359e('0x29')];_0x5f3a02+=0x1){_0x5a9228=_0x38b033[_0x5f3a02]['get']({'plain':!![]});switch(_0x5a9228[_0x359e('0x51')]){case _0x359e('0x55'):_0x4a3368[_0x359e('0x2e')](db['sequelize'][_0x359e('0x57')](_0x39f86f(_0x5a9228,_0x359e('0x5e')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));break;case'onlyIfOpen':_0x4a3368[_0x359e('0x2e')](db[_0x359e('0x56')][_0x359e('0x57')](_0x28df5d(_0x5a9228,'CampaignId'))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));break;default:_0x4a3368[_0x359e('0x2e')](db[_0x359e('0x56')]['query'](_0x19f7db(_0x5a9228,'CampaignId'))['then'](function(){})['catch'](_0x17684c()));}}}return _0x4a3368;})[_0x359e('0x5a')]();})[_0x359e('0x2d')](function(){return db['Campaign'][_0x359e('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x359e('0x52')],'as':_0x359e('0x5c'),'where':{'id':LISTID}}]})[_0x359e('0x2d')](function(_0x1699aa){var _0x50e830=[];if(_0x1699aa){for(var _0x442423=0x0,_0x4c462b;_0x442423<_0x1699aa[_0x359e('0x29')];_0x442423+=0x1){_0x4c462b=_0x1699aa[_0x442423][_0x359e('0x54')]({'plain':!![]});_0x50e830['push'](db[_0x359e('0x56')][_0x359e('0x57')](_0x58861e(_0x4c462b,_0x359e('0x5e')))[_0x359e('0x2d')](function(){})[_0x359e('0x30')](_0x17684c()));}}return _0x50e830;})['all']();})[_0x359e('0x30')](function(_0x412ac0){logger[_0x359e('0x12')](_0x359e('0x5f'),'generalCheckHopper',_0x412ac0['message']);});}var processPromises=function(_0x208872){return BPromise[_0x359e('0x5a')](promises)[_0x359e('0x2d')](function(_0x5db447){})[_0x359e('0x30')](function(_0x5a2aa9){logger[_0x359e('0x12')](_0x359e('0x60'),JSON[_0x359e('0x32')](_0x5a2aa9));})[_0x359e('0x61')](function(){socket[_0x359e('0x62')](_0x359e('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x208872){return _0x208872[_0x359e('0x64')]();}});};var endCsv=function(){return BPromise[_0x359e('0x65')]()[_0x359e('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x359e('0x2d')](function(){socket['emit'](_0x359e('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x359e('0x66')](FILEPATH);}catch(_0x3aa09d){logger[_0x359e('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0x3aa09d));}finally{process[_0x359e('0x67')](0x0);}});};process['on'](_0x359e('0x68'),function(){logger[_0x359e('0x69')](_0x359e('0x6a'));endCsv();});function main(){return BPromise[_0x359e('0x65')]()[_0x359e('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x359e('0x6b')](',');return db[_0x359e('0x2b')][_0x359e('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x359e('0x2d')](function(_0x5332af){var _0x177461=fs[_0x359e('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x359e('0x6d')](_0x177461,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d1139,_0x384ced){total+=0x1;var _0x34ec76=total;promises[_0x359e('0x2e')](checkRow(_0x5d1139,_0x5332af,_0x34ec76)[_0x359e('0x2d')](function(){success+=0x1;})[_0x359e('0x30')](function(_0x44bf53){if(_0x44bf53[_0x359e('0x12')]){errors+=0x1;delete _0x44bf53[_0x359e('0x12')];}else if(_0x44bf53['duplicate']){duplicates+=0x1;delete _0x44bf53['duplicate'];}rows[_0x359e('0x2e')](_0x44bf53);}));if(total%0xc8===0x0){_0x384ced[_0x359e('0x6e')]();return processPromises(_0x384ced);}},'complete':function(){return processPromises()['then'](function(){logger[_0x359e('0x69')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x3c116d,_0x21de36){logger[_0x359e('0x69')]('CSV\x20parse\x20error',JSON[_0x359e('0x32')](_0x3c116d));endCsv();}});})[_0x359e('0x30')](function(_0x3813c8){logger[_0x359e('0x12')](_0x359e('0x6f'),JSON[_0x359e('0x32')](_0x3813c8));});}main();
\ No newline at end of file
+var _0x8066=['../../../config/logger','api','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','errors','length','map','join','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','keys','then','push','pick','message','stringify','checkHopper','inspect','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','createdAt','from','cm_contacts','where','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','always','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','CmList','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','lodash','squel','papaparse','ioredis','../../../mysqldb'];(function(_0x1f7996,_0x299a14){var _0x584609=function(_0x14c34a){while(--_0x14c34a){_0x1f7996['push'](_0x1f7996['shift']());}};_0x584609(++_0x299a14);}(_0x8066,0xd5));var _0x6806=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8066[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x6806('0x0'));var fs=require('fs');var squel=require(_0x6806('0x1'));var Papa=require(_0x6806('0x2'));var Redis=require(_0x6806('0x3'));var db=require(_0x6806('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x6806('0x5'))(_0x6806('0x6'));config[_0x6806('0x7')]=_[_0x6806('0x8')](config[_0x6806('0x7')],{'host':_0x6806('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6806('0x7')]));require(_0x6806('0xa'))['register'](socket);try{if(!process['argv'][0x2]||process[_0x6806('0xb')][0x2]===_0x6806('0xc')||process[_0x6806('0xb')][0x2]==='null'){throw new Error(_0x6806('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x6806('0xb')][0x3]||process['argv'][0x3]===_0x6806('0xc')||process[_0x6806('0xb')][0x3]===_0x6806('0xe')||!process[_0x6806('0xb')][0x4]||process['argv'][0x4]===_0x6806('0xc')||process[_0x6806('0xb')][0x4]===_0x6806('0xe')){throw new Error(_0x6806('0xf'));}var FIELDS=_[_0x6806('0x10')](process[_0x6806('0xb')][0x3][_0x6806('0x11')](','),process['argv'][0x4]['split'](','));if(!process[_0x6806('0xb')][0x5]||process[_0x6806('0xb')][0x5]===_0x6806('0xc')||process[_0x6806('0xb')][0x5]===_0x6806('0xe')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6806('0xb')][0x6]!==_0x6806('0xc')&&process[_0x6806('0xb')][0x6]!==_0x6806('0xe')?process[_0x6806('0xb')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6806('0xb')][0x7]!=='undefined'&&process[_0x6806('0xb')][0x7]!==_0x6806('0xe')?process[_0x6806('0xb')][0x7]:null;if(!process[_0x6806('0xb')][0x8]||process[_0x6806('0xb')][0x8]===_0x6806('0xc')||process[_0x6806('0xb')][0x8]===_0x6806('0xe')){throw new Error(_0x6806('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x3b94c7){logger[_0x6806('0x13')](_0x3b94c7);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x17d416,_0x135499,_0x4e8228,_0x4ad1d3){var _0x2eb19b={'message':_0x135499};_0x2eb19b[_0x17d416]=!![];if(_0x4e8228){_0x2eb19b[_0x6806('0x14')]=_0x4e8228;}if(_0x4ad1d3){_0x2eb19b[_0x6806('0x15')]=_0x4ad1d3;}return _0x2eb19b;}function isEmail(_0x355439){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x6806('0x16')](_0x355439);}function checkRow(_0x33957c,_0x17b9f2,_0x47648c){return new BPromise(function(_0x11cae4,_0x541bef){if(_['isNil'](_0x33957c)){return _0x541bef(handleCheckRowError(_0x6806('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x47648c));}if(_0x33957c[_0x6806('0x17')]&&_0x33957c[_0x6806('0x17')][_0x6806('0x18')]){var _0x3bb4ba=_[_0x6806('0x19')](_0x33957c[_0x6806('0x17')],'message')[_0x6806('0x1a')](';');return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x3bb4ba,null,_0x47648c));}var _0x2c126b={};for(var _0x4b4a44 in FIELDS){if(FIELDS['hasOwnProperty'](_0x4b4a44)&&FIELDS[_0x4b4a44]){_0x2c126b[_0x4b4a44]=_0x33957c[_0x6806('0x1b')][0x0][FIELDS[_0x4b4a44]]||_0x33957c[_0x6806('0x1b')][0x0]['\ufeff'+FIELDS[_0x4b4a44]];}}if(!_0x2c126b[_0x6806('0x1c')]){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x1d'),null,_0x47648c));}if(!_0x2c126b['phone']){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x1e'),null,_0x47648c));}if(_0x2c126b[_0x6806('0x1f')]){var _0x301b73=moment(_0x2c126b['birthDate'],_0x6806('0x20'));if(!_0x301b73[_0x6806('0x21')]()){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x22'),null,_0x47648c));}}if(_0x2c126b['email']){if(!isEmail(_0x2c126b['email'])){return _0x541bef(handleCheckRowError(_0x6806('0x13'),_0x6806('0x23'),null,_0x47648c));}}_0x2c126b[_0x6806('0x24')]=LISTID;_0x2c126b[_0x6806('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6806('0x18')]&&_0x17b9f2){var _0x772f70={};for(var _0x284ea1=0x0,_0x429dea=DUPLICATES['length'];_0x284ea1<_0x429dea;_0x284ea1+=0x1){_0x772f70[DUPLICATES[_0x284ea1]]=_0x2c126b[DUPLICATES[_0x284ea1]];}var _0x34a9d9=_[_0x6806('0x26')](_0x17b9f2,_0x772f70);if(_0x34a9d9){return _0x541bef(handleCheckRowError(_0x6806('0x27'),_0x6806('0x28'),_0x34a9d9,_0x47648c));}}return db[_0x6806('0x29')]['create'](_0x2c126b,{'raw':!![],'hooks':![],'fields':_[_0x6806('0x2a')](_0x2c126b)})[_0x6806('0x2b')](function(_0x36091b){if(DUPLICATES&&DUPLICATES[_0x6806('0x18')]&&_0x17b9f2){_0x17b9f2[_0x6806('0x2c')](_[_0x6806('0x2d')](_0x2c126b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x36091b['id'];return _0x11cae4();})['catch'](function(_0x43d3f9){return _0x541bef(handleCheckRowError('error','Error\x20while\x20creating\x20contact:\x20'+(_0x43d3f9[_0x6806('0x2e')]||JSON[_0x6806('0x2f')](_0x43d3f9)),null,_0x47648c));});});}function checkHopper(){function _0x63505d(){return function(_0x22870f){logger[_0x6806('0x13')]('cmContact',_0x6806('0x30'),util[_0x6806('0x31')](_0x22870f,{'showHidden':![],'depth':null}));};}var _0x5c512a=function(_0x17bf94,_0xaeb28f){var _0x323bef=squel[_0x6806('0x32')]()['into'](_0x6806('0x33'))[_0x6806('0x34')]([_0x6806('0x35'),_0x6806('0x36'),_0x6806('0x37'),'ListId',_0xaeb28f,'createdAt',_0x6806('0x38')],squel[_0x6806('0x39')]()[_0x6806('0x3a')](_0x6806('0x35'),'phone')['field'](_0x6806('0x3b'),_0x6806('0x36'))['field']('id','ContactId')[_0x6806('0x3a')](LISTID['toString'](),_0x6806('0x24'))['field'](_0x17bf94['id']['toString'](),_0xaeb28f)[_0x6806('0x3a')](_0x6806('0x3b'),_0x6806('0x3c'))[_0x6806('0x3a')](_0x6806('0x3b'),'updatedAt')[_0x6806('0x3d')](_0x6806('0x3e'))['where']('deletedAt\x20IS\x20NULL')[_0x6806('0x3f')]('ListId\x20=\x20?',LISTID[_0x6806('0x40')]())['where'](_0x6806('0x41'))['where'](_0x6806('0x42'),squel[_0x6806('0x39')]()[_0x6806('0x3a')](_0x6806('0x35'))[_0x6806('0x3d')](_0x6806('0x33'))[_0x6806('0x3f')](_0xaeb28f+'\x20=\x20?',_0x17bf94['id']['toString']())))[_0x6806('0x40')]();return _0x323bef;};var _0x36ff8f=function(_0x24cc6c,_0x51b56f){var _0x329032=squel['insert']()[_0x6806('0x43')](_0x6806('0x33'))[_0x6806('0x34')]([_0x6806('0x35'),_0x6806('0x36'),_0x6806('0x37'),'ListId',_0x51b56f,_0x6806('0x3c'),'updatedAt'],squel[_0x6806('0x39')]()[_0x6806('0x3a')]('phone',_0x6806('0x35'))[_0x6806('0x3a')]('NOW()',_0x6806('0x36'))[_0x6806('0x3a')]('id',_0x6806('0x37'))['field'](LISTID[_0x6806('0x40')](),_0x6806('0x24'))[_0x6806('0x3a')](_0x24cc6c['id'][_0x6806('0x40')](),_0x51b56f)['field'](_0x6806('0x3b'),_0x6806('0x3c'))[_0x6806('0x3a')](_0x6806('0x3b'),'updatedAt')[_0x6806('0x3d')](_0x6806('0x3e'))['where'](_0x6806('0x44'))[_0x6806('0x3f')](_0x6806('0x45'),LISTID['toString']())[_0x6806('0x3f')](_0x6806('0x46'),squel[_0x6806('0x47')](hopperContacts))[_0x6806('0x3f')]('phone\x20IS\x20NOT\x20NULL')[_0x6806('0x3f')](_0x6806('0x42'),squel[_0x6806('0x39')]()[_0x6806('0x3a')]('calleridnum')[_0x6806('0x3d')](_0x6806('0x48'))[_0x6806('0x3f')](_0x51b56f+_0x6806('0x49'),_0x24cc6c['id'][_0x6806('0x40')]()))[_0x6806('0x3f')](_0x6806('0x42'),squel[_0x6806('0x39')]()[_0x6806('0x3a')]('phone')[_0x6806('0x3d')](_0x6806('0x33'))[_0x6806('0x3f')](_0x51b56f+_0x6806('0x49'),_0x24cc6c['id'][_0x6806('0x40')]())))[_0x6806('0x40')]();return _0x329032;};function _0x23e0b4(_0x139b3f,_0x184cf8){var _0x2aa483=squel['insert']()[_0x6806('0x43')]('cm_hopper')[_0x6806('0x34')]([_0x6806('0x35'),_0x6806('0x36'),_0x6806('0x37'),_0x6806('0x24'),_0x184cf8,_0x6806('0x3c'),'updatedAt'],squel[_0x6806('0x39')]()[_0x6806('0x3a')](_0x6806('0x35'),_0x6806('0x35'))[_0x6806('0x3a')]('NOW()','scheduledAt')[_0x6806('0x3a')]('id',_0x6806('0x37'))[_0x6806('0x3a')](LISTID[_0x6806('0x40')](),_0x6806('0x24'))[_0x6806('0x3a')](_0x139b3f['id']['toString'](),_0x184cf8)['field'](_0x6806('0x3b'),_0x6806('0x3c'))['field'](_0x6806('0x3b'),'updatedAt')['from'](_0x6806('0x3e'))['where']('deletedAt\x20IS\x20NULL')[_0x6806('0x3f')](_0x6806('0x45'),LISTID[_0x6806('0x40')]())[_0x6806('0x3f')](_0x6806('0x46'),squel['str'](hopperContacts))[_0x6806('0x3f')](_0x6806('0x41')))[_0x6806('0x40')]();return _0x2aa483;}function _0x2438c1(_0x3948bf,_0x390c94){var _0x29d8b5=squel['insert']()[_0x6806('0x43')](_0x6806('0x4a'))['fromQuery']([_0x6806('0x35'),'ContactId',_0x6806('0x24'),_0x390c94,'createdAt',_0x6806('0x38')],squel['select']()[_0x6806('0x3a')]('phone',_0x6806('0x35'))['field']('id',_0x6806('0x37'))[_0x6806('0x3a')](LISTID[_0x6806('0x40')](),'ListId')[_0x6806('0x3a')](_0x3948bf['id'][_0x6806('0x40')](),_0x390c94)[_0x6806('0x3a')](_0x6806('0x3b'),_0x6806('0x3c'))['field'](_0x6806('0x3b'),_0x6806('0x38'))[_0x6806('0x3d')](_0x6806('0x3e'))['where'](_0x6806('0x44'))[_0x6806('0x3f')](_0x6806('0x45'),LISTID[_0x6806('0x40')]())['where']('id\x20IN\x20?',squel[_0x6806('0x47')](hopperContacts))['where'](_0x6806('0x41')))[_0x6806('0x40')]();return _0x29d8b5;}return db[_0x6806('0x4b')][_0x6806('0x4c')]({'where':{'type':_0x6806('0x4d')},'attributes':['id',_0x6806('0x4e')],'include':[{'model':db['CmList'],'as':_0x6806('0x4f'),'where':{'id':LISTID}}]})[_0x6806('0x2b')](function(_0x4b658e){var _0xa85c5b=[];if(_0x4b658e){var _0x4e235f;for(var _0x3f66d3=0x0,_0x649c55;_0x3f66d3<_0x4b658e['length'];_0x3f66d3+=0x1){_0x649c55=_0x4b658e[_0x3f66d3]['get']({'plain':!![]});switch(_0x649c55[_0x6806('0x4e')]){case _0x6806('0x50'):_0xa85c5b[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x36ff8f(_0x649c55,_0x6806('0x53')))[_0x6806('0x2b')](function(){})[_0x6806('0x54')](_0x63505d()));break;case _0x6806('0x55'):_0xa85c5b['push'](db[_0x6806('0x51')][_0x6806('0x52')](_0x5c512a(_0x649c55,_0x6806('0x53')))[_0x6806('0x2b')](function(){})[_0x6806('0x54')](_0x63505d()));break;default:_0xa85c5b[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x23e0b4(_0x649c55,'VoiceQueueId'))[_0x6806('0x2b')](function(){})['catch'](_0x63505d()));}}}return _0xa85c5b;})[_0x6806('0x56')]()[_0x6806('0x2b')](function(){return db[_0x6806('0x4b')][_0x6806('0x4c')]({'where':{'type':_0x6806('0x4d')},'attributes':['id'],'include':[{'model':db[_0x6806('0x57')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6806('0x2b')](function(_0x318630){var _0x285302=[];if(_0x318630){var _0x209dea;for(var _0x434d21=0x0,_0x501a22;_0x434d21<_0x318630[_0x6806('0x18')];_0x434d21+=0x1){_0x501a22=_0x318630[_0x434d21][_0x6806('0x58')]({'plain':!![]});_0x285302['push'](db['sequelize'][_0x6806('0x52')](_0x2438c1(_0x501a22,_0x6806('0x53')))['then'](function(){})[_0x6806('0x54')](_0x63505d()));}}return _0x285302;})[_0x6806('0x56')]();})['then'](function(){return db[_0x6806('0x59')][_0x6806('0x4c')]({'attributes':['id',_0x6806('0x4e')],'include':[{'model':db[_0x6806('0x57')],'as':_0x6806('0x4f'),'where':{'id':LISTID}}]})['then'](function(_0x523be5){var _0x8c00c2=[];if(_0x523be5){for(var _0x397667=0x0,_0xad0e6;_0x397667<_0x523be5[_0x6806('0x18')];_0x397667+=0x1){_0xad0e6=_0x523be5[_0x397667][_0x6806('0x58')]({'plain':!![]});switch(_0xad0e6[_0x6806('0x4e')]){case'always':_0x8c00c2[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x36ff8f(_0xad0e6,_0x6806('0x5a')))[_0x6806('0x2b')](function(){})[_0x6806('0x54')](_0x63505d()));break;case _0x6806('0x55'):_0x8c00c2[_0x6806('0x2c')](db['sequelize'][_0x6806('0x52')](_0x5c512a(_0xad0e6,_0x6806('0x5a')))[_0x6806('0x2b')](function(){})['catch'](_0x63505d()));break;default:_0x8c00c2['push'](db[_0x6806('0x51')][_0x6806('0x52')](_0x23e0b4(_0xad0e6,_0x6806('0x5a')))['then'](function(){})['catch'](_0x63505d()));}}}return _0x8c00c2;})[_0x6806('0x56')]();})['then'](function(){return db[_0x6806('0x59')][_0x6806('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x6806('0x57')],'as':_0x6806('0x5b'),'where':{'id':LISTID}}]})[_0x6806('0x2b')](function(_0x596bf8){var _0xa49a8d=[];if(_0x596bf8){for(var _0x48e74a=0x0,_0x328181;_0x48e74a<_0x596bf8[_0x6806('0x18')];_0x48e74a+=0x1){_0x328181=_0x596bf8[_0x48e74a][_0x6806('0x58')]({'plain':!![]});_0xa49a8d[_0x6806('0x2c')](db[_0x6806('0x51')][_0x6806('0x52')](_0x2438c1(_0x328181,'CampaignId'))['then'](function(){})[_0x6806('0x54')](_0x63505d()));}}return _0xa49a8d;})[_0x6806('0x56')]();})[_0x6806('0x54')](function(_0x3b9cdd){logger[_0x6806('0x13')](_0x6806('0x5c'),_0x6806('0x5d'),_0x3b9cdd['message']);});}var processPromises=function(_0x4b98ea){return BPromise[_0x6806('0x56')](promises)[_0x6806('0x2b')](function(_0x27ce94){})['catch'](function(_0x35ef44){logger[_0x6806('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x6806('0x2f')](_0x35ef44));})[_0x6806('0x5e')](function(){socket[_0x6806('0x5f')](_0x6806('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4b98ea){return _0x4b98ea[_0x6806('0x61')]();}});};var endCsv=function(){return BPromise[_0x6806('0x62')]()[_0x6806('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x6806('0x2b')](function(){socket[_0x6806('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6806('0x63')](FILEPATH);}catch(_0x53ffd2){logger['error'](_0x6806('0x64'),JSON[_0x6806('0x2f')](_0x53ffd2));}finally{process[_0x6806('0x65')](0x0);}});};process['on'](_0x6806('0x66'),function(){logger[_0x6806('0x67')](_0x6806('0x68'));endCsv();});function main(){return BPromise[_0x6806('0x62')]()[_0x6806('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6806('0x11')](',');return db['CmContact']['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6806('0x2b')](function(_0x528507){var _0x241b73=fs[_0x6806('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6806('0x6a')](_0x241b73,{'header':!![],'skipEmptyLines':!![],'step':function(_0x32590e,_0x28788f){total+=0x1;var _0x3d5557=total;promises[_0x6806('0x2c')](checkRow(_0x32590e,_0x528507,_0x3d5557)[_0x6806('0x2b')](function(){success+=0x1;})[_0x6806('0x54')](function(_0x59bf99){if(_0x59bf99[_0x6806('0x13')]){errors+=0x1;delete _0x59bf99['error'];}else if(_0x59bf99[_0x6806('0x27')]){duplicates+=0x1;delete _0x59bf99[_0x6806('0x27')];}rows[_0x6806('0x2c')](_0x59bf99);}));if(total%0xc8===0x0){_0x28788f['pause']();return processPromises(_0x28788f);}},'complete':function(){return processPromises()[_0x6806('0x2b')](function(){logger['info'](_0x6806('0x6b'));endCsv();});},'error':function(_0x39881a,_0x121ecb){logger[_0x6806('0x67')](_0x6806('0x6c'),JSON[_0x6806('0x2f')](_0x39881a));endCsv();}});})[_0x6806('0x54')](function(_0x2f4e67){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x6806('0x2f')](_0x2f4e67));});}main();
\ No newline at end of file
index e8d2f67..75ab3ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b24=['server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','parse','binding','binding\x20doesn\x27t\x20exists','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','\x20=\x20','AdditionalPhones','then','length','push','all','split','filter','CmContactHasItem','update','updated','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','where','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','fromQuery','ContactId','.CmListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','recallme','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','message','exit','errors','query','spread','error','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','catch','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','sequelize','timezones','dialTimezone','isNil','set','offset','stringify','send','start','clone','socket_timestamp','root','.csv','includes','ContactItemType','findAll','name','_description','writeFileSync','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','contact:import:','Abort\x20parser','duplicates','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>'];(function(_0x284e08,_0x1af14e){var _0x1203c5=function(_0x10abe1){while(--_0x10abe1){_0x284e08['push'](_0x284e08['shift']());}};_0x1203c5(++_0x1af14e);}(_0x2b24,0x176));var _0x42b2=function(_0x168761,_0x3371a8){_0x168761=_0x168761-0x0;var _0x1463e8=_0x2b24[_0x168761];return _0x1463e8;};'use strict';var fs=require('fs');var path=require(_0x42b2('0x0'));var _=require(_0x42b2('0x1'));var Papa=require(_0x42b2('0x2'));var util=require(_0x42b2('0x3'));var BPromise=require(_0x42b2('0x4'));var moment=require(_0x42b2('0x5'));var squel=require(_0x42b2('0x6'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x42b2('0x7'));var shared=require('../../../config/environment/shared');var logger=require(_0x42b2('0x8'))(_0x42b2('0x9'));config[_0x42b2('0xa')]=_[_0x42b2('0xb')](config[_0x42b2('0xa')],{'host':_0x42b2('0xc'),'port':0x18eb});var socket=require(_0x42b2('0xd'))(new Redis(config[_0x42b2('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x42b2('0xe')](_0x42b2('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x42b2('0xe')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x4228d7){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x42b2('0x10')](_0x4228d7);}function selectNotIn(_0x2dab9c,_0x24e7e,_0x29c7c7,_0x18ef81,_0xd16e74){return squel[_0x42b2('0x11')]()[_0x42b2('0x12')]('phone')[_0x42b2('0x13')](_0x18ef81)[_0x42b2('0x14')](_0x24e7e,null,_0x24e7e+_0x42b2('0x15')+_0x18ef81+'.'+_0x29c7c7)['where'](_0x18ef81+'.'+_0x29c7c7+_0x42b2('0x16')+_0x2dab9c+'.'+_0x29c7c7)['where'](_0x24e7e+'.dialCheckDuplicateType\x20IN\x20('+_0xd16e74[_0x42b2('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x34c958,_0x154dc0){promisesAdditionalPhones=[];return db['CmContact']['findAll']({'raw':!![],'attributes':['id',_0x42b2('0x17')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x42b2('0x18')](function(_0x3a4e84){if(_0x3a4e84!==null){var _0x12b0f5=[];for(var _0x3e85e9=0x0;_0x3e85e9<_0x3a4e84[_0x42b2('0x19')];_0x3e85e9++){var _0xebf683=_0x3a4e84[_0x3e85e9];_0x12b0f5[_0x42b2('0x1a')](insertAdditionalPhones(_0xebf683));}}Promise[_0x42b2('0x1b')](_0x12b0f5)['then'](function(){_0x34c958({'val':0x1});});});});}function insertAdditionalPhones(_0x8cb53b){return new Promise(function(_0x3e2f14,_0x4f9b4b){var _0x30db0a=_0x8cb53b[_0x42b2('0x17')];var _0x17b1d3=_0x30db0a[_0x42b2('0x1c')](';');var _0x5e7bd5=[];orderBy=0x0;for(var _0x3aa57f=0x0;_0x3aa57f<_0x17b1d3[_0x42b2('0x19')];_0x3aa57f++){_0x5e7bd5[_0x42b2('0x1a')](splitAdditionalPhone(_0x8cb53b['id'],_0x17b1d3[_0x3aa57f]));}Promise['all'](_0x5e7bd5)[_0x42b2('0x18')](function(){_0x3e2f14({'val':_0x17b1d3[_0x42b2('0x19')]});});});}function splitAdditionalPhone(_0x496907,_0x26a1a3){return new Promise(function(_0xd4fc60,_0x2008b9){var _0x5a1484=_0x26a1a3[_0x42b2('0x1c')](':');var _0x57a6dc=_0x5a1484[0x0];var _0x168a3c=_0x5a1484[0x1];if(!_['isNil'](_0x168a3c)){var _0x177783=_0x168a3c[_0x42b2('0x1c')]('|');var _0x486b92=[];for(var _0x45a362=0x0;_0x45a362<_0x177783[_0x42b2('0x19')];_0x45a362++){if(_0x177783[_0x45a362]!==''){var _0x5dfba1=_[_0x42b2('0x1d')](promisesAdditionalPhones,{'contactId':_0x496907,'phone':_0x177783[_0x45a362]});if(_0x5dfba1[_0x42b2('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0x42b2('0x1a')]({'contactId':_0x496907,'contactTypeId':_0x57a6dc,'phone':_0x177783[_0x45a362],'orderBy':orderBy});}}}_0xd4fc60({'ok':0x1});}else _0xd4fc60({'res':0x0});});}function createAdditionalPhone(_0x4e2b51,_0x452e73,_0x1a9061,_0x91faca){var _0x244465='';var _0x5e324b='';var _0x1e182b=_0x1a9061[_0x42b2('0x1c')]('§');_0x244465=_0x1e182b[0x0];if(_0x1e182b[_0x42b2('0x19')]==0x2)_0x5e324b=_0x1e182b[0x1];return new Promise(function(_0x3e4dd9,_0x28d146){return db[_0x42b2('0x1e')]['findOne']({'where':{'CmContactId':_0x4e2b51,'item':_0x244465}})[_0x42b2('0x18')](function(_0x4ecd51){if(_0x4ecd51){return db[_0x42b2('0x1e')][_0x42b2('0x1f')]({'ItemTypeId':_0x452e73,'description':_0x5e324b,'OrderBy':_0x91faca},{'where':{'CmContactId':_0x4e2b51,'item':_0x244465}})[_0x42b2('0x18')](function(_0x51f6ec){_0x3e4dd9({'res':_0x42b2('0x20')});});}else{return db[_0x42b2('0x1e')]['create']({'CmContactId':_0x4e2b51,'item':_0x244465,'description':_0x5e324b,'ItemTypeId':_0x452e73,'OrderBy':_0x91faca,'ItemClass':'PHONE'})[_0x42b2('0x18')](function(_0x104adc){_0x3e4dd9({'res':_0x42b2('0x21')});});}});});}function insertCmHopper(_0x2f208a,_0xec1fd9,_0x671cd4,_0x5e15d2,_0x446d1a){var _0x29152a=[_0x42b2('0x22'),_0x42b2('0x23'),_0x42b2('0x24'),_0x42b2('0x25'),_0xec1fd9+'.'+_0x5e15d2,_0x42b2('0x26'),_0x42b2('0x27'),_0x42b2('0x28'),_0x42b2('0x29'),'\x22'+_0x446d1a+'\x22'];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x2c'))['fromQuery']([_0x42b2('0x2d'),_0x42b2('0x2e'),'ContactId',_0x42b2('0x2f'),_0x5e15d2,_0x42b2('0x30'),_0x42b2('0x31'),_0x42b2('0x32'),_0x42b2('0x33'),'recallme'],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x29152a)['from'](_0xec1fd9)[_0x42b2('0x14')](_0x42b2('0x35'),null,_0x42b2('0x36')+_0xec1fd9+'.CmListId')[_0x42b2('0x14')](_0x671cd4,null,_0x671cd4+_0x42b2('0x15')+_0xec1fd9+'.'+_0x5e15d2)['where'](_0xec1fd9+_0x42b2('0x37'),_0x2f208a)[_0x42b2('0x38')](_0x42b2('0x39'),NOW)['where'](_0x42b2('0x3a'),selectNotIn(_0xec1fd9,_0x671cd4,_0x5e15d2,_0x42b2('0x2c'),[_0x42b2('0x3b'),_0x42b2('0x3c')]))['where'](_0x42b2('0x3a'),selectNotIn(_0xec1fd9,_0x671cd4,_0x5e15d2,_0x42b2('0x2c'),['\x22always\x22'])))[_0x42b2('0x3d')]();}function insertCmHopperBlack(_0x523cf1,_0x5e53d2,_0x52f856,_0x1b7476){var _0xa8bd80=[_0x42b2('0x22'),_0x42b2('0x24'),'cm_contacts.ListId',_0x5e53d2+'.'+_0x1b7476,_0x42b2('0x26'),_0x42b2('0x27')];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x3e'))[_0x42b2('0x3f')]([_0x42b2('0x2d'),_0x42b2('0x40'),_0x42b2('0x2f'),_0x1b7476,_0x42b2('0x30'),_0x42b2('0x31')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0xa8bd80)['from'](_0x5e53d2)[_0x42b2('0x14')]('cm_contacts',null,_0x42b2('0x36')+_0x5e53d2+_0x42b2('0x41'))['join'](_0x52f856,null,_0x52f856+_0x42b2('0x15')+_0x5e53d2+'.'+_0x1b7476)[_0x42b2('0x38')](_0x5e53d2+_0x42b2('0x37'),_0x523cf1)[_0x42b2('0x38')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x42b2('0x3a'),squel[_0x42b2('0x11')]()[_0x42b2('0x12')]('phone')[_0x42b2('0x13')](_0x42b2('0x3e'))[_0x42b2('0x38')](_0x42b2('0x42'),_0x523cf1)[_0x42b2('0x38')](_0x1b7476+_0x42b2('0x16')+_0x5e53d2+'.'+_0x1b7476)))[_0x42b2('0x3d')]();}function insertTzCmHopper(_0x275ba1,_0x1bdc1c,_0x324f59,_0x1a5123,_0x1920be,_0x243b67){var _0x3678b9=[_0x42b2('0x22'),_0x42b2('0x43')+_0x243b67+'.offset-cm_contacts.utcOffset\x20minute)',_0x42b2('0x24'),_0x42b2('0x25'),_0x1bdc1c+'.'+_0x1a5123,'cm_contacts.createdAt',_0x42b2('0x27'),_0x42b2('0x28'),'cm_contacts.UserId','\x22'+_0x1920be+'\x22'];var _0x49b353=squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x2c'))[_0x42b2('0x3f')]([_0x42b2('0x2d'),_0x42b2('0x2e'),_0x42b2('0x40'),_0x42b2('0x2f'),_0x1a5123,_0x42b2('0x30'),_0x42b2('0x31'),_0x42b2('0x32'),_0x42b2('0x33'),_0x42b2('0x44')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x3678b9)['from'](_0x1bdc1c)[_0x42b2('0x14')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x1bdc1c+_0x42b2('0x41'))[_0x42b2('0x14')](_0x324f59,null,_0x324f59+'.id\x20=\x20'+_0x1bdc1c+'.'+_0x1a5123)[_0x42b2('0x14')](_0x243b67,null,_0x243b67+'.id\x20=\x20'+_0x1bdc1c+'.'+_0x1a5123)[_0x42b2('0x38')](_0x1bdc1c+'.CmListId\x20=\x20?',_0x275ba1)[_0x42b2('0x38')](_0x42b2('0x39'),NOW)[_0x42b2('0x38')](_0x42b2('0x3a'),selectNotIn(_0x1bdc1c,_0x324f59,_0x1a5123,_0x42b2('0x2c'),['\x22always\x22',_0x42b2('0x3c')]))[_0x42b2('0x38')](_0x42b2('0x3a'),selectNotIn(_0x1bdc1c,_0x324f59,_0x1a5123,'cm_hopper',[_0x42b2('0x3b')])))['toString']();return _0x49b353;}function insertTzCmHopperBlack(_0x16b832,_0x3b298f,_0x4c69b5,_0x191a80){var _0x3436d8=['cm_contacts.phone',_0x42b2('0x24'),_0x42b2('0x25'),_0x3b298f+'.'+_0x191a80,_0x42b2('0x26'),_0x42b2('0x27')];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x3e'))[_0x42b2('0x3f')]([_0x42b2('0x2d'),'ContactId','ListId',_0x191a80,_0x42b2('0x30'),_0x42b2('0x31')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x3436d8)[_0x42b2('0x13')](_0x3b298f)[_0x42b2('0x14')]('cm_contacts',null,_0x42b2('0x36')+_0x3b298f+_0x42b2('0x41'))[_0x42b2('0x14')](_0x4c69b5,null,_0x4c69b5+_0x42b2('0x15')+_0x3b298f+'.'+_0x191a80)[_0x42b2('0x38')](_0x3b298f+_0x42b2('0x37'),_0x16b832)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x42b2('0x38')](_0x42b2('0x3a'),squel[_0x42b2('0x11')]()[_0x42b2('0x12')](_0x42b2('0x2d'))[_0x42b2('0x13')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x16b832)[_0x42b2('0x38')](_0x191a80+'\x20=\x20'+_0x3b298f+'.'+_0x191a80)))[_0x42b2('0x3d')]();}function insertCmHopperAdditionalPhones(_0x32c5f3){var _0x29b398=['cm_hopper.id',_0x42b2('0x45'),_0x42b2('0x46'),_0x42b2('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x48'))[_0x42b2('0x3f')](['CmHopperId','phone',_0x42b2('0x49'),'createdAt',_0x42b2('0x31')],squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x29b398)[_0x42b2('0x13')](_0x42b2('0x2c'))[_0x42b2('0x14')]('cm_contacts',null,_0x42b2('0x4a'))[_0x42b2('0x14')](_0x42b2('0x4b'),null,_0x42b2('0x4c'))[_0x42b2('0x38')](_0x42b2('0x4d'),_0x32c5f3)['where'](_0x42b2('0x39'),NOW))[_0x42b2('0x3d')]();}function insertCmContact(_0x22894a,_0x46e4dc,_0x58e90f,_0x48884b){var _0x4002f7=_[_0x42b2('0x4e')](_[_0x42b2('0x4f')](_0x48884b),[_0x42b2('0x2f'),_0x42b2('0x50'),_0x42b2('0x30'),_0x42b2('0x31')]);return squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x42b2('0x35'))[_0x42b2('0x3f')](_0x4002f7,squel[_0x42b2('0x11')]()['fields'](_0x4002f7)['from'](_0x46e4dc)['where']('('+_0x58e90f[_0x42b2('0x14')](',')+_0x42b2('0x51'),squel[_0x42b2('0x11')]()[_0x42b2('0x34')](_0x58e90f)[_0x42b2('0x13')]('cm_contacts')[_0x42b2('0x38')](_0x42b2('0x42'),_0x22894a)[_0x42b2('0x38')](_0x42b2('0x52')))['where'](_0x42b2('0x53'),squel['select']()['field'](_0x42b2('0x54'),_0x42b2('0x55'))[_0x42b2('0x13')](_0x46e4dc)[_0x42b2('0x56')](_0x58e90f[_0x42b2('0x14')](','))))[_0x42b2('0x3d')]();}function handleStop(){logger[_0x42b2('0x57')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x38a74a){logger['error'](_0x38a74a[_0x42b2('0x58')]);process[_0x42b2('0x59')](0x1);}function handleError(_0x5817ff,_0x4a4489){stats[_0x42b2('0x5a')][_0x42b2('0x1a')]({'name':_0x4a4489['code'],'message':_0x4a4489['message'],'row':_0x5817ff});}function handleQuery(_0x2b2c3f){logger[_0x42b2('0x57')](_0x2b2c3f);return db['sequelize'][_0x42b2('0x5b')](_0x2b2c3f)[_0x42b2('0x5c')](function(_0x45c6ca){results[_0x42b2('0x1a')](_0x45c6ca);})['catch'](function(_0x3d63a5){logger[_0x42b2('0x5d')](_0x3d63a5['message']);});}function updateTzCampaigns(_0x543a31){return new Promise(function(_0xfbbc2,_0x37d4a7){var _0x1a4629=squel[_0x42b2('0x11')]()[_0x42b2('0x34')]([_0x42b2('0x5e'),'campaigns.dialTimezone'])[_0x42b2('0x13')](_0x42b2('0x5f'))['join'](_0x42b2('0x60'),null,_0x42b2('0x61'))['where'](_0x42b2('0x62')+_0x543a31);db['sequelize'][_0x42b2('0x5b')](_0x1a4629[_0x42b2('0x3d')]())[_0x42b2('0x5c')](function(_0x198483){var _0x26f6da=[];for(var _0xd88942=0x0;_0xd88942<_0x198483['length'];_0xd88942++){_0x26f6da[_0x42b2('0x1a')](getTimezoneData(_0x198483[_0xd88942],tmp_campaigns));}BPromise[_0x42b2('0x1b')](_0x26f6da)['then'](function(){_0xfbbc2({'val':0x1});});})[_0x42b2('0x63')](function(_0x1bb1cd){logger[_0x42b2('0x5d')](_0x1bb1cd[_0x42b2('0x58')]);_0xfbbc2({'val':0x0});});});}function updateTzVoiceQueues(_0x46ad20){return new Promise(function(_0x2bac2a,_0x11e799){var _0x4b59f9=squel[_0x42b2('0x11')]()[_0x42b2('0x34')](['voice_queues.id',_0x42b2('0x64')])[_0x42b2('0x13')](_0x42b2('0x65'))[_0x42b2('0x14')](_0x42b2('0x66'),null,_0x42b2('0x67'))['where'](_0x42b2('0x68')+_0x46ad20);db[_0x42b2('0x69')][_0x42b2('0x5b')](_0x4b59f9[_0x42b2('0x3d')]())[_0x42b2('0x5c')](function(_0x2f25dc){var _0x168a3a=[];for(var _0x591256=0x0;_0x591256<_0x2f25dc[_0x42b2('0x19')];_0x591256++){_0x168a3a[_0x42b2('0x1a')](getTimezoneData(_0x2f25dc[_0x591256],tmp_voice_queues));}BPromise[_0x42b2('0x1b')](_0x168a3a)[_0x42b2('0x18')](function(){_0x2bac2a({'val':0x1});});})[_0x42b2('0x63')](function(_0x322dcd){logger[_0x42b2('0x5d')](_0x322dcd[_0x42b2('0x58')]);_0x2bac2a({'val':0x0});});});}function getTimezoneData(_0x4b225c,_0x402abb){return new Promise(function(_0x5122d2,_0x428076){var _0x259c39=shared[_0x42b2('0x6a')];var _0x59d5d7=_0x259c39[_0x4b225c[_0x42b2('0x6b')]];if(_[_0x42b2('0x6c')](_0x59d5d7)){_0x5122d2({'ret':0x1});}else{var _0x129e75=_0x59d5d7['utcOffset'];var _0x12d9be=squel[_0x42b2('0x2a')]()[_0x42b2('0x2b')](_0x402abb)[_0x42b2('0x6d')]('id',_0x4b225c['id'])[_0x42b2('0x6d')](_0x42b2('0x6e'),_0x129e75)[_0x42b2('0x6d')](_0x42b2('0x6b'),_0x4b225c[_0x42b2('0x6b')])[_0x42b2('0x3d')]();return db[_0x42b2('0x69')]['query'](_0x12d9be)[_0x42b2('0x5c')](function(_0x3df6be){_0x5122d2({'ret':0x1});})[_0x42b2('0x63')](function(_0x77aded){logger[_0x42b2('0x5d')](_0x77aded[_0x42b2('0x58')]);_0x428076({'ret':0x1});});}});}function handleTZQuery(_0x17dc68){logger['info'](_0x17dc68);return db['sequelize'][_0x42b2('0x5b')](_0x17dc68)[_0x42b2('0x5c')](function(_0x249e43){})[_0x42b2('0x63')](function(_0x3c8517){logger[_0x42b2('0x5d')](_0x3c8517[_0x42b2('0x58')]);});}function main(_0x1c0ff5,_0x539de3,_0x57fb32,_0x27219a){logger['info']('main',_0x1c0ff5,JSON[_0x42b2('0x6f')](_0x539de3));process[_0x42b2('0x70')](_0x42b2('0x71'));var _0x23e7a9=_0x539de3['binding'];var _0x1bf15c=_[_0x42b2('0x72')](_0x23e7a9);var _0x3484d1=_0x539de3[_0x42b2('0x73')];var _0x25501e=path[_0x42b2('0x14')](config[_0x42b2('0x74')],'server/files/tmp',_0x3484d1+_0x42b2('0x75'));hasTZ=_[_0x42b2('0x4f')](_0x23e7a9)[_0x42b2('0x76')](_0x42b2('0x6b'));var _0x3bd876=_['keys'](_0x23e7a9)[_0x42b2('0x14')]();logger[_0x42b2('0x57')]('header',_0x3bd876);db[_0x42b2('0x77')][_0x42b2('0x78')]({'raw':!![],'attributes':['id',_0x42b2('0x79')]})[_0x42b2('0x18')](function(_0x483d79){for(var _0x888c03=0x0;_0x888c03<_0x483d79[_0x42b2('0x19')];_0x888c03++){if(_0x483d79[_0x888c03]['name']in _0x23e7a9){contactItemTypes[_0x42b2('0x1a')](_0x483d79[_0x888c03]);delete _0x1bf15c[_0x483d79[_0x888c03][_0x42b2('0x79')]];hasAdditionalPhones=!![];}for(var _0x3e0cbe in _0x23e7a9){if(_0x483d79[_0x888c03]['name']+_0x42b2('0x7a')===_0x3e0cbe){phoneDescriptions[_0x42b2('0x1a')]({'itemTypeId':_0x483d79[_0x888c03]['id'],'description':_0x3e0cbe});delete _0x1bf15c[_0x3e0cbe];}}}if(hasAdditionalPhones)_0x1bf15c[_0x42b2('0x17')]='';var _0x25b751=_[_0x42b2('0x4f')](_0x1bf15c)[_0x42b2('0x14')]();logger[_0x42b2('0x57')]('header',_0x25b751);fs[_0x42b2('0x7b')](_0x25501e,_0x25b751+'\x0a');Papa['parse'](fs[_0x42b2('0x7c')](_0x1c0ff5),{'header':!![],'skipEmptyLines':!![],'step':function(_0x590664,_0x51ee5c){try{for(var _0x55b2fe=0x0,_0x551e2b=[];_0x55b2fe<_0x590664[_0x42b2('0x7d')]['length'];_0x55b2fe++){stats[_0x42b2('0x7e')]+=0x1;if(_0x590664[_0x42b2('0x5a')][_0x55b2fe]){handleError(_0x590664['data'][_0x55b2fe],_0x590664[_0x42b2('0x5a')][_0x55b2fe]);}else{var _0x4f12f5=[];var _0x486dd4=[];var _0x3411ac={};for(var _0x12eaed in _0x23e7a9){let _0xd70d91=contactItemTypes[_0x42b2('0x7f')](_0x2af1f8=>_0x2af1f8[_0x42b2('0x79')]===_0x12eaed);let _0x35019f=contactItemTypes[_0x42b2('0x7f')](_0x35b9e6=>_0x35b9e6[_0x42b2('0x79')]+_0x42b2('0x7a')===_0x12eaed);if(_['isNil'](_0xd70d91)&&_[_0x42b2('0x6c')](_0x35019f)){if(_0x23e7a9[_0x42b2('0x80')](_0x12eaed)){if(_0x590664[_0x42b2('0x7d')][_0x55b2fe][_0x23e7a9[_0x12eaed]]){var _0x5308ad=_[_0x42b2('0x81')](_0x590664['data'][_0x55b2fe][_0x23e7a9[_0x12eaed]][_0x42b2('0x82')](/"/g,'\x27'));switch(_0x12eaed){case _0x42b2('0x2e'):var _0x4510c7=moment(_0x5308ad,_0x42b2('0xf'),!![]);if(_0x4510c7[_0x42b2('0x83')]()){_0x551e2b['push']('\x22'+_0x5308ad+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')](_0x42b2('0x84'));}break;case _0x42b2('0x32'):var _0x379851=parseInt(_0x5308ad);_0x5308ad=_[_0x42b2('0x85')](_0x379851)||_0x379851<0x0||_0x379851>0x4?_0x27219a?0x3:0x2:_0x379851;_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');break;case _0x42b2('0x33'):var _0x35b8a9=parseInt(_0x5308ad);if(_[_0x42b2('0x86')](_0x35b8a9)&&_[_0x42b2('0x76')](_0x57fb32,_0x35b8a9)){_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x35b8a9+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')](_0x42b2('0x87'));}break;case _0x42b2('0x88'):if(isEmail(_0x5308ad)){_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')](_0x42b2('0x89'));}break;case _0x42b2('0x8a'):var _0x1f351d=moment(_0x5308ad,_0x42b2('0x8b'),!![]);if(_0x1f351d[_0x42b2('0x83')]()){_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');}else{_0x4f12f5[_0x42b2('0x1a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x42b2('0x6b'):var _0x514887=shared[_0x42b2('0x6a')];var _0x373466=_0x514887[_0x5308ad];if(!_[_0x42b2('0x6c')](_0x373466)){var _0x37317c=_0x373466['utcOffset'];_0x551e2b[_0x42b2('0x1a')]('\x22'+_0x5308ad+'\x22');_0x551e2b['push']('\x22'+_0x37317c+'\x22');}break;default:_0x551e2b['push']('\x22'+_0x5308ad+'\x22');}}else{switch(_0x12eaed){case'firstName':case _0x42b2('0x2d'):_0x4f12f5[_0x42b2('0x1a')](_0x12eaed+_0x42b2('0x8c'));break;default:_0x551e2b['push']('\x22\x22');}}}}else{var _0x343bb0='';if(!_[_0x42b2('0x6c')](_0xd70d91)){if(!_0x3411ac[_0x42b2('0x80')](_0xd70d91['id'])){if(!_[_0x42b2('0x6c')](_0x590664['data'][_0x55b2fe][_0x23e7a9[_0x12eaed]])){var _0x5308ad=_['trim'](_0x590664['data'][_0x55b2fe][_0x23e7a9[_0x12eaed]][_0x42b2('0x82')](/"/g,'\x27'));var _0x2b28ee=phoneDescriptions[_0x42b2('0x7f')](_0x8e3d28=>_0x8e3d28[_0x42b2('0x8d')]===_0xd70d91['id']);if(!_[_0x42b2('0x6c')](_0x2b28ee)){var _0x2c0a68=_[_0x42b2('0x81')](_0x590664[_0x42b2('0x7d')][_0x55b2fe][_0x23e7a9[_0x2b28ee[_0x42b2('0x8e')]]]['replace'](/"/g,'\x27'));if(!_[_0x42b2('0x6c')](_0x2c0a68))_0x5308ad=_0x5308ad+'§'+_0x2c0a68;}if(_0x343bb0=='')_0x343bb0=_0x5308ad;else _0x343bb0+='|'+_0x5308ad;}_0x486dd4[_0x42b2('0x1a')](_0xd70d91['id']+':'+_0x343bb0);_0x3411ac[_0xd70d91['id']]=0x1;}}}}if(hasAdditionalPhones){_0x551e2b['push']('\x22'+_0x486dd4[_0x42b2('0x14')](';')+'\x22');}if(_0x4f12f5['length']){handleError(_0x590664[_0x42b2('0x7d')][_0x55b2fe],{'code':_0x42b2('0x8f'),'message':_0x4f12f5['join']()});}else{fs[_0x42b2('0x90')](_0x25501e,_0x551e2b['join']()+'\x0a');}_0x551e2b=[];}if(!(stats[_0x42b2('0x7e')]%0xc8)){socket['emit'](_0x42b2('0x91')+_0x3484d1,stats);stats[_0x42b2('0x5a')]=[];}}if(stopped){logger[_0x42b2('0x57')](_0x42b2('0x92'));_0x51ee5c['abort']();}}catch(_0x4df890){handleError(_0x590664[_0x42b2('0x7d')][_0x55b2fe],{'code':'SystemError','message':_0x4df890[_0x42b2('0x58')]});logger['error']('step',_0x4df890[_0x42b2('0x58')]);}},'complete':function(){try{var _0x452cbe=[];var _0x2aed37=[];var _0x4b4acd=_0x42b2('0x35');if(_0x539de3[_0x42b2('0x93')]&&_0x539de3[_0x42b2('0x93')][_0x42b2('0x19')]){_0x4b4acd='cm_contacts_'+_0x3484d1;_0x452cbe[_0x42b2('0x1a')](_0x42b2('0x94')+_0x4b4acd+'\x20LIKE\x20cm_contacts;');}tmp_campaigns='campaigns_'+_0x3484d1;tmp_voice_queues='voice_queues_'+_0x3484d1;_0x2aed37[_0x42b2('0x1a')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x42b2('0x95'));_0x2aed37['push'](_0x42b2('0x94')+tmp_voice_queues+_0x42b2('0x95'));BPromise[_0x42b2('0x96')](_0x2aed37,handleTZQuery)[_0x42b2('0x18')](function(_0x55ea1c){updateTzCampaigns(_0x539de3['ListId'])[_0x42b2('0x18')](function(_0x432eb5){updateTzVoiceQueues(_0x539de3['ListId'])['then'](function(_0x3e5324){if(hasTZ)_0x25b751=_0x25b751[_0x42b2('0x82')](_0x42b2('0x6b'),'dialTimezone,utcOffset');var _0x3f2df9=util[_0x42b2('0xe')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x25501e,_0x4b4acd,_0x25b751,_0x539de3['ListId'],_0x539de3['CompanyId']||null,NOW,NOW);if(_[_0x42b2('0x6c')](_0x23e7a9[_0x42b2('0x2e')])){_0x3f2df9+=_0x42b2('0x97');}_0x452cbe[_0x42b2('0x1a')](_0x3f2df9);if(_0x539de3['duplicates']&&_0x539de3['duplicates']['length']){_0x452cbe['push'](insertCmContact(_0x539de3['ListId'],_0x4b4acd,_0x539de3[_0x42b2('0x93')],_0x23e7a9));_0x452cbe[_0x42b2('0x1a')](_0x42b2('0x98')+_0x4b4acd+';');}BPromise[_0x42b2('0x96')](_0x452cbe,handleQuery)['then'](function(_0x399b5d){BPromise[_0x42b2('0x1b')]([handleAdditionalPhones()])[_0x42b2('0x18')](function(){_0x452cbe=[];for(var _0x1b4d85=0x0;_0x1b4d85<promisesAdditionalPhones['length'];_0x1b4d85++){if(promisesAdditionalPhones[_0x1b4d85][_0x42b2('0x2d')]!='§'){_0x452cbe[_0x42b2('0x1a')](createAdditionalPhone(promisesAdditionalPhones[_0x1b4d85][_0x42b2('0x99')],promisesAdditionalPhones[_0x1b4d85][_0x42b2('0x9a')],promisesAdditionalPhones[_0x1b4d85][_0x42b2('0x2d')],promisesAdditionalPhones[_0x1b4d85][_0x42b2('0x9b')]));}}BPromise['all'](_0x452cbe)[_0x42b2('0x18')](function(){_0x452cbe=[];if(hasTZ){_0x452cbe[_0x42b2('0x1a')](insertTzCmHopper(_0x539de3['ListId'],_0x42b2('0x66'),_0x42b2('0x65'),_0x42b2('0x9c'),_0x27219a,tmp_voice_queues));_0x452cbe['push'](insertTzCmHopperBlack(_0x539de3[_0x42b2('0x2f')],_0x42b2('0x9d'),_0x42b2('0x65'),_0x42b2('0x9c')));_0x452cbe[_0x42b2('0x1a')](insertTzCmHopper(_0x539de3[_0x42b2('0x2f')],_0x42b2('0x60'),_0x42b2('0x5f'),_0x42b2('0x9e'),_0x27219a,tmp_campaigns));_0x452cbe['push'](insertTzCmHopperBlack(_0x539de3['ListId'],_0x42b2('0x9f'),_0x42b2('0x5f'),_0x42b2('0x9e')));_0x452cbe[_0x42b2('0x1a')](insertCmHopperAdditionalPhones(_0x539de3[_0x42b2('0x2f')]));}else{_0x452cbe['push'](insertCmHopper(_0x539de3[_0x42b2('0x2f')],_0x42b2('0x66'),_0x42b2('0x65'),_0x42b2('0x9c'),_0x27219a));_0x452cbe['push'](insertCmHopperBlack(_0x539de3['ListId'],'voice_queues_has_cm_blacklists','voice_queues',_0x42b2('0x9c')));_0x452cbe[_0x42b2('0x1a')](insertCmHopper(_0x539de3[_0x42b2('0x2f')],_0x42b2('0x60'),_0x42b2('0x5f'),_0x42b2('0x9e'),_0x27219a));_0x452cbe[_0x42b2('0x1a')](insertCmHopperBlack(_0x539de3[_0x42b2('0x2f')],'campaigns_has_cm_blacklists',_0x42b2('0x5f'),'CampaignId'));_0x452cbe[_0x42b2('0x1a')](insertCmHopperAdditionalPhones(_0x539de3[_0x42b2('0x2f')]));}_0x452cbe[_0x42b2('0x1a')](_0x42b2('0x98')+tmp_campaigns+';');_0x452cbe[_0x42b2('0x1a')](_0x42b2('0x98')+tmp_voice_queues+';');BPromise['each'](_0x452cbe,handleQuery)[_0x42b2('0x18')](function(_0x4fe69c){stats['finish']=!![];stats[_0x42b2('0xa0')]=_0x539de3[_0x42b2('0x93')]&&_0x539de3['duplicates']['length']?results[0x2][_0x42b2('0xa0')]:results[0x0][_0x42b2('0xa0')];socket[_0x42b2('0xa1')](_0x42b2('0x91')+_0x3484d1,stats);fs['unlink'](_0x1c0ff5);fs[_0x42b2('0xa2')](_0x25501e);process['exit'](0x0);})[_0x42b2('0x63')](function(_0x22a180){logger['error'](_0x22a180[_0x42b2('0x58')]);process[_0x42b2('0x59')](0x1);});});});})[_0x42b2('0x63')](function(_0xd9d6f3){logger[_0x42b2('0x5d')](_0xd9d6f3[_0x42b2('0x58')]);process['exit'](0x1);});});});});}catch(_0x4cbc3f){logger['error'](_0x42b2('0xa3'),_0x4cbc3f['message']);process[_0x42b2('0x59')](0x1);}},'error':function(_0x4c0f23,_0x4a1d01,_0x476823,_0x1eebab){throw new Error(_0x1eebab);}});});}function validate(){if(process[_0x42b2('0xa4')]&&process[_0x42b2('0xa4')][_0x42b2('0x19')]<0x4){throw new Error(_0x42b2('0xa5'));}var _0x2a43f0=path[_0x42b2('0x14')](config[_0x42b2('0x74')],_0x42b2('0xa6'),process[_0x42b2('0xa4')][0x2]);if(!fs[_0x42b2('0xa7')](_0x2a43f0)){throw new Error(_0x42b2('0xa8'));}var _0x51fb75={};try{_0x51fb75=JSON[_0x42b2('0xa9')](process['argv'][0x3]);if(!_0x51fb75[_0x42b2('0xaa')]){throw new Error(_0x42b2('0xab'));}if(!_0x51fb75[_0x42b2('0xaa')][_0x42b2('0x2d')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x51fb75[_0x42b2('0xaa')][_0x42b2('0xac')]){throw new Error(_0x42b2('0xad'));}var _0x168f74=0x0;if(_0x51fb75['binding'][_0x42b2('0x33')]){_0x168f74=0x1;}if(!_0x51fb75[_0x42b2('0x2f')]){throw new Error(_0x42b2('0xae'));}}catch(_0x2f6bc5){throw new Error(_0x42b2('0xaf'));}var _0x3c0464=[];try{_0x3c0464=_[_0x42b2('0xb0')](JSON[_0x42b2('0xa9')](process[_0x42b2('0xa4')][0x4]),'id');}catch(_0x1da532){logger['info'](_0x42b2('0xb1'));}main(_0x2a43f0,_0x51fb75,_0x3c0464,_0x168f74);}validate();process['on'](_0x42b2('0xb2'),handleStop);process['on'](_0x42b2('0xb3'),handleUncaughtException);
\ No newline at end of file
+var _0x909a=['moment','ioredis','../../../config/environment','../../../config/environment/shared','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','AdditionalPhones','then','length','push','all','filter','split','CmContactHasItem','findOne','update','updated','create','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','cm_hopper_black','phone','fields','cm_contacts.ListId\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','fromQuery','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','exit','errors','code','message','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','query','voice_queues.id','voice_queues.dialTimezone','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','sequelize','error','timezones','dialTimezone','isNil','utcOffset','set','offset','main','send','binding','socket_timestamp','server/files/tmp','includes','header','ContactItemType','findAll','name','_description','writeFileSync','createReadStream','data','find','trim','replace','isValid','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','rows','contact:import:','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','orderBy','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','parse','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','util'];(function(_0xb1ee0e,_0x2126df){var _0x376116=function(_0x44b7ad){while(--_0x44b7ad){_0xb1ee0e['push'](_0xb1ee0e['shift']());}};_0x376116(++_0x2126df);}(_0x909a,0xbc));var _0xa909=function(_0x551be0,_0x3372c1){_0x551be0=_0x551be0-0x0;var _0x112d08=_0x909a[_0x551be0];return _0x112d08;};'use strict';var fs=require('fs');var path=require(_0xa909('0x0'));var _=require(_0xa909('0x1'));var Papa=require(_0xa909('0x2'));var util=require(_0xa909('0x3'));var BPromise=require('bluebird');var moment=require(_0xa909('0x4'));var squel=require('squel');var Redis=require(_0xa909('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xa909('0x6'));var shared=require(_0xa909('0x7'));var logger=require('../../../config/logger')(_0xa909('0x8'));config[_0xa909('0x9')]=_[_0xa909('0xa')](config['redis'],{'host':_0xa909('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa909('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()['format'](_0xa909('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0xa909('0xd')](_0xa909('0xc'));function isEmail(_0x52ea00){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0xa909('0xe')](_0x52ea00);}function selectNotIn(_0x748800,_0x1fee21,_0x131863,_0x507e25,_0x1fdb42){return squel[_0xa909('0xf')]()[_0xa909('0x10')]('phone')[_0xa909('0x11')](_0x507e25)[_0xa909('0x12')](_0x1fee21,null,_0x1fee21+_0xa909('0x13')+_0x507e25+'.'+_0x131863)[_0xa909('0x14')](_0x507e25+'.'+_0x131863+_0xa909('0x15')+_0x748800+'.'+_0x131863)[_0xa909('0x14')](_0x1fee21+_0xa909('0x16')+_0x1fdb42[_0xa909('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1e6e3d,_0x16bd65){promisesAdditionalPhones=[];return db[_0xa909('0x17')]['findAll']({'raw':!![],'attributes':['id',_0xa909('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0xa909('0x19')](function(_0x5a0567){if(_0x5a0567!==null){var _0x190274=[];for(var _0x1d02f7=0x0;_0x1d02f7<_0x5a0567[_0xa909('0x1a')];_0x1d02f7++){var _0x2f1d59=_0x5a0567[_0x1d02f7];_0x190274[_0xa909('0x1b')](insertAdditionalPhones(_0x2f1d59));}}Promise[_0xa909('0x1c')](_0x190274)[_0xa909('0x19')](function(){_0x1e6e3d({'val':0x1});});});});}function insertAdditionalPhones(_0x48f9df){return new Promise(function(_0x3cbdc6,_0x55eecf){var _0x436a70=_0x48f9df['AdditionalPhones'];var _0xd996eb=_0x436a70['split'](';');var _0x15500a=[];orderBy=0x0;for(var _0x35a3a1=0x0;_0x35a3a1<_0xd996eb[_0xa909('0x1a')];_0x35a3a1++){_0x15500a['push'](splitAdditionalPhone(_0x48f9df['id'],_0xd996eb[_0x35a3a1]));}Promise[_0xa909('0x1c')](_0x15500a)[_0xa909('0x19')](function(){_0x3cbdc6({'val':_0xd996eb[_0xa909('0x1a')]});});});}function splitAdditionalPhone(_0x54f1d8,_0x456c98){return new Promise(function(_0x52fd44,_0x776ae6){var _0xed8753=_0x456c98['split'](':');var _0x4fb23d=_0xed8753[0x0];var _0x5f2f89=_0xed8753[0x1];if(!_['isNil'](_0x5f2f89)){var _0x8d7f08=_0x5f2f89['split']('|');var _0x47d3eb=[];for(var _0x3d23fb=0x0;_0x3d23fb<_0x8d7f08[_0xa909('0x1a')];_0x3d23fb++){if(_0x8d7f08[_0x3d23fb]!==''){var _0x483140=_[_0xa909('0x1d')](promisesAdditionalPhones,{'contactId':_0x54f1d8,'phone':_0x8d7f08[_0x3d23fb]});if(_0x483140['length']==0x0){orderBy++;promisesAdditionalPhones[_0xa909('0x1b')]({'contactId':_0x54f1d8,'contactTypeId':_0x4fb23d,'phone':_0x8d7f08[_0x3d23fb],'orderBy':orderBy});}}}_0x52fd44({'ok':0x1});}else _0x52fd44({'res':0x0});});}function createAdditionalPhone(_0xe0f7f9,_0x569a88,_0x1305ce,_0x5f5122){var _0x28492e='';var _0x2a511c='';var _0x4a51e6=_0x1305ce[_0xa909('0x1e')]('§');_0x28492e=_0x4a51e6[0x0];if(_0x4a51e6[_0xa909('0x1a')]==0x2)_0x2a511c=_0x4a51e6[0x1];return new Promise(function(_0x5b2f1f,_0x47bb12){return db[_0xa909('0x1f')][_0xa909('0x20')]({'where':{'CmContactId':_0xe0f7f9,'item':_0x28492e}})[_0xa909('0x19')](function(_0x3d7e83){if(_0x3d7e83){return db[_0xa909('0x1f')][_0xa909('0x21')]({'ItemTypeId':_0x569a88,'description':_0x2a511c,'OrderBy':_0x5f5122},{'where':{'CmContactId':_0xe0f7f9,'item':_0x28492e}})['then'](function(_0x25e91f){_0x5b2f1f({'res':_0xa909('0x22')});});}else{return db['CmContactHasItem'][_0xa909('0x23')]({'CmContactId':_0xe0f7f9,'item':_0x28492e,'description':_0x2a511c,'ItemTypeId':_0x569a88,'OrderBy':_0x5f5122,'ItemClass':_0xa909('0x24')})['then'](function(_0x5d25e5){_0x5b2f1f({'res':_0xa909('0x25')});});}});});}function insertCmHopper(_0x2d1d74,_0xd267be,_0xe1c9e3,_0x5a2e77,_0x58330e){var _0x1513ac=['cm_contacts.phone',_0xa909('0x26'),_0xa909('0x27'),_0xa909('0x28'),_0xd267be+'.'+_0x5a2e77,_0xa909('0x29'),_0xa909('0x2a'),_0xa909('0x2b'),_0xa909('0x2c'),'\x22'+_0x58330e+'\x22'];return squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x2f'))['fromQuery'](['phone',_0xa909('0x30'),_0xa909('0x31'),_0xa909('0x32'),_0x5a2e77,_0xa909('0x33'),_0xa909('0x34'),_0xa909('0x35'),_0xa909('0x36'),_0xa909('0x37')],squel[_0xa909('0xf')]()['fields'](_0x1513ac)[_0xa909('0x11')](_0xd267be)[_0xa909('0x12')](_0xa909('0x38'),null,'cm_contacts.ListId\x20=\x20'+_0xd267be+_0xa909('0x39'))[_0xa909('0x12')](_0xe1c9e3,null,_0xe1c9e3+_0xa909('0x13')+_0xd267be+'.'+_0x5a2e77)[_0xa909('0x14')](_0xd267be+_0xa909('0x3a'),_0x2d1d74)[_0xa909('0x14')](_0xa909('0x3b'),NOW)[_0xa909('0x14')](_0xa909('0x3c'),selectNotIn(_0xd267be,_0xe1c9e3,_0x5a2e77,_0xa909('0x2f'),[_0xa909('0x3d'),_0xa909('0x3e')]))['where'](_0xa909('0x3c'),selectNotIn(_0xd267be,_0xe1c9e3,_0x5a2e77,_0xa909('0x2f'),[_0xa909('0x3d')])))[_0xa909('0x3f')]();}function insertCmHopperBlack(_0x744eca,_0x58df5a,_0x3ed0f9,_0xab1767){var _0x50085f=[_0xa909('0x40'),_0xa909('0x27'),'cm_contacts.ListId',_0x58df5a+'.'+_0xab1767,_0xa909('0x29'),_0xa909('0x2a')];return squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x41'))['fromQuery']([_0xa909('0x42'),_0xa909('0x31'),_0xa909('0x32'),_0xab1767,'createdAt',_0xa909('0x34')],squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x50085f)[_0xa909('0x11')](_0x58df5a)[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x44')+_0x58df5a+_0xa909('0x39'))[_0xa909('0x12')](_0x3ed0f9,null,_0x3ed0f9+_0xa909('0x13')+_0x58df5a+'.'+_0xab1767)[_0xa909('0x14')](_0x58df5a+'.CmListId\x20=\x20?',_0x744eca)[_0xa909('0x14')](_0xa909('0x3b'),NOW)[_0xa909('0x14')](_0xa909('0x3c'),squel[_0xa909('0xf')]()[_0xa909('0x10')]('phone')['from'](_0xa909('0x41'))[_0xa909('0x14')]('ListId\x20=\x20?',_0x744eca)[_0xa909('0x14')](_0xab1767+_0xa909('0x15')+_0x58df5a+'.'+_0xab1767)))[_0xa909('0x3f')]();}function insertTzCmHopper(_0x27a59c,_0x401a11,_0xc01f4d,_0xcda892,_0x28b3b7,_0x19d72b){var _0x5b3233=[_0xa909('0x40'),_0xa909('0x45')+_0x19d72b+_0xa909('0x46'),_0xa909('0x27'),_0xa909('0x28'),_0x401a11+'.'+_0xcda892,'cm_contacts.createdAt','cm_contacts.updatedAt',_0xa909('0x2b'),'cm_contacts.UserId','\x22'+_0x28b3b7+'\x22'];var _0x56c752=squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x2f'))[_0xa909('0x47')](['phone',_0xa909('0x30'),_0xa909('0x31'),_0xa909('0x32'),_0xcda892,_0xa909('0x33'),_0xa909('0x34'),_0xa909('0x35'),_0xa909('0x36'),'recallme'],squel['select']()['fields'](_0x5b3233)['from'](_0x401a11)[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x44')+_0x401a11+_0xa909('0x39'))[_0xa909('0x12')](_0xc01f4d,null,_0xc01f4d+_0xa909('0x13')+_0x401a11+'.'+_0xcda892)[_0xa909('0x12')](_0x19d72b,null,_0x19d72b+_0xa909('0x13')+_0x401a11+'.'+_0xcda892)[_0xa909('0x14')](_0x401a11+'.CmListId\x20=\x20?',_0x27a59c)[_0xa909('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x401a11,_0xc01f4d,_0xcda892,_0xa909('0x2f'),['\x22always\x22',_0xa909('0x3e')]))[_0xa909('0x14')](_0xa909('0x3c'),selectNotIn(_0x401a11,_0xc01f4d,_0xcda892,_0xa909('0x2f'),['\x22always\x22'])))['toString']();return _0x56c752;}function insertTzCmHopperBlack(_0x15fbfa,_0x31250d,_0x21bc48,_0x324ad7){var _0x5222c8=['cm_contacts.phone',_0xa909('0x27'),'cm_contacts.ListId',_0x31250d+'.'+_0x324ad7,_0xa909('0x29'),_0xa909('0x2a')];return squel['insert']()[_0xa909('0x2e')](_0xa909('0x41'))[_0xa909('0x47')](['phone',_0xa909('0x31'),_0xa909('0x32'),_0x324ad7,'createdAt',_0xa909('0x34')],squel['select']()[_0xa909('0x43')](_0x5222c8)['from'](_0x31250d)[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x44')+_0x31250d+_0xa909('0x39'))[_0xa909('0x12')](_0x21bc48,null,_0x21bc48+_0xa909('0x13')+_0x31250d+'.'+_0x324ad7)[_0xa909('0x14')](_0x31250d+_0xa909('0x3a'),_0x15fbfa)[_0xa909('0x14')](_0xa909('0x3b'),NOW)[_0xa909('0x14')](_0xa909('0x3c'),squel[_0xa909('0xf')]()[_0xa909('0x10')](_0xa909('0x42'))[_0xa909('0x11')]('cm_hopper_black')[_0xa909('0x14')](_0xa909('0x48'),_0x15fbfa)[_0xa909('0x14')](_0x324ad7+_0xa909('0x15')+_0x31250d+'.'+_0x324ad7)))[_0xa909('0x3f')]();}function insertCmHopperAdditionalPhones(_0x461283){var _0x56480c=[_0xa909('0x49'),_0xa909('0x4a'),_0xa909('0x4b'),_0xa909('0x4c'),_0xa909('0x4d')];return squel[_0xa909('0x2d')]()['into'](_0xa909('0x4e'))['fromQuery']([_0xa909('0x4f'),_0xa909('0x42'),_0xa909('0x50'),_0xa909('0x33'),_0xa909('0x34')],squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x56480c)[_0xa909('0x11')](_0xa909('0x2f'))[_0xa909('0x12')](_0xa909('0x38'),null,_0xa909('0x51'))[_0xa909('0x12')]('cm_contact_has_items',null,_0xa909('0x52'))[_0xa909('0x14')](_0xa909('0x53'),_0x461283)[_0xa909('0x14')](_0xa909('0x3b'),NOW))['toString']();}function insertCmContact(_0x4154d3,_0xfd5b89,_0x58c809,_0x2cd53b){var _0x4a041d=_[_0xa909('0x54')](_[_0xa909('0x55')](_0x2cd53b),[_0xa909('0x32'),'CompanyId',_0xa909('0x33'),_0xa909('0x34')]);return squel[_0xa909('0x2d')]()[_0xa909('0x2e')](_0xa909('0x38'))[_0xa909('0x47')](_0x4a041d,squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x4a041d)[_0xa909('0x11')](_0xfd5b89)[_0xa909('0x14')]('('+_0x58c809[_0xa909('0x12')](',')+_0xa909('0x56'),squel[_0xa909('0xf')]()[_0xa909('0x43')](_0x58c809)[_0xa909('0x11')](_0xa909('0x38'))['where']('ListId\x20=\x20?',_0x4154d3)[_0xa909('0x14')](_0xa909('0x57')))[_0xa909('0x14')](_0xa909('0x58'),squel['select']()[_0xa909('0x10')](_0xa909('0x59'),'min_id')[_0xa909('0x11')](_0xfd5b89)[_0xa909('0x5a')](_0x58c809[_0xa909('0x12')](','))))['toString']();}function handleStop(){logger[_0xa909('0x5b')](_0xa909('0x5c'));stopped=!![];}function handleUncaughtException(_0x451b66){logger['error'](_0x451b66['message']);process[_0xa909('0x5d')](0x1);}function handleError(_0x9131f3,_0x4a2f7f){stats[_0xa909('0x5e')]['push']({'name':_0x4a2f7f[_0xa909('0x5f')],'message':_0x4a2f7f[_0xa909('0x60')],'row':_0x9131f3});}function handleQuery(_0x33cfee){logger['info'](_0x33cfee);return db['sequelize']['query'](_0x33cfee)[_0xa909('0x61')](function(_0x33bb1d){results['push'](_0x33bb1d);})[_0xa909('0x62')](function(_0x58b5a1){logger['error'](_0x58b5a1[_0xa909('0x60')]);});}function updateTzCampaigns(_0x425bbb){return new Promise(function(_0x5ec7de,_0x15b199){var _0x3d0d10=squel[_0xa909('0xf')]()[_0xa909('0x43')]([_0xa909('0x63'),_0xa909('0x64')])[_0xa909('0x11')](_0xa909('0x65'))[_0xa909('0x12')](_0xa909('0x66'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')['where'](_0xa909('0x67')+_0x425bbb);db['sequelize'][_0xa909('0x68')](_0x3d0d10[_0xa909('0x3f')]())[_0xa909('0x61')](function(_0x77be8c){var _0x2eb3e8=[];for(var _0xac72d2=0x0;_0xac72d2<_0x77be8c['length'];_0xac72d2++){_0x2eb3e8[_0xa909('0x1b')](getTimezoneData(_0x77be8c[_0xac72d2],tmp_campaigns));}BPromise[_0xa909('0x1c')](_0x2eb3e8)[_0xa909('0x19')](function(){_0x5ec7de({'val':0x1});});})['catch'](function(_0x5ab391){logger['error'](_0x5ab391[_0xa909('0x60')]);_0x5ec7de({'val':0x0});});});}function updateTzVoiceQueues(_0x3ab2f2){return new Promise(function(_0x74e224,_0x3149e8){var _0x5c9962=squel[_0xa909('0xf')]()[_0xa909('0x43')]([_0xa909('0x69'),_0xa909('0x6a')])[_0xa909('0x11')]('voice_queues')[_0xa909('0x12')]('voice_queues_has_cm_lists',null,_0xa909('0x6b'))[_0xa909('0x14')](_0xa909('0x6c')+_0x3ab2f2);db[_0xa909('0x6d')][_0xa909('0x68')](_0x5c9962[_0xa909('0x3f')]())['spread'](function(_0xf6f38e){var _0x5be633=[];for(var _0xb1aa60=0x0;_0xb1aa60<_0xf6f38e[_0xa909('0x1a')];_0xb1aa60++){_0x5be633[_0xa909('0x1b')](getTimezoneData(_0xf6f38e[_0xb1aa60],tmp_voice_queues));}BPromise[_0xa909('0x1c')](_0x5be633)[_0xa909('0x19')](function(){_0x74e224({'val':0x1});});})[_0xa909('0x62')](function(_0x52aba6){logger[_0xa909('0x6e')](_0x52aba6[_0xa909('0x60')]);_0x74e224({'val':0x0});});});}function getTimezoneData(_0x56bcb5,_0x307e36){return new Promise(function(_0x1c71ef,_0x359bb6){var _0xb999c0=shared[_0xa909('0x6f')];var _0x3fd149=_0xb999c0[_0x56bcb5[_0xa909('0x70')]];if(_[_0xa909('0x71')](_0x3fd149)){_0x1c71ef({'ret':0x1});}else{var _0x1b886b=_0x3fd149[_0xa909('0x72')];var _0x49d55a=squel[_0xa909('0x2d')]()['into'](_0x307e36)[_0xa909('0x73')]('id',_0x56bcb5['id'])[_0xa909('0x73')](_0xa909('0x74'),_0x1b886b)['set'](_0xa909('0x70'),_0x56bcb5[_0xa909('0x70')])[_0xa909('0x3f')]();return db[_0xa909('0x6d')]['query'](_0x49d55a)['spread'](function(_0x2d56ad){_0x1c71ef({'ret':0x1});})['catch'](function(_0x728f2d){logger[_0xa909('0x6e')](_0x728f2d[_0xa909('0x60')]);_0x359bb6({'ret':0x1});});}});}function handleTZQuery(_0x4d0a23){logger['info'](_0x4d0a23);return db[_0xa909('0x6d')][_0xa909('0x68')](_0x4d0a23)[_0xa909('0x61')](function(_0x2885a0){})[_0xa909('0x62')](function(_0x2b253e){logger[_0xa909('0x6e')](_0x2b253e[_0xa909('0x60')]);});}function main(_0x9a7e09,_0x5054d7,_0x34019b,_0x41c0f2){logger[_0xa909('0x5b')](_0xa909('0x75'),_0x9a7e09,JSON['stringify'](_0x5054d7));process[_0xa909('0x76')]('start');var _0x78b1b6=_0x5054d7[_0xa909('0x77')];var _0x479831=_['clone'](_0x78b1b6);var _0x174851=_0x5054d7[_0xa909('0x78')];var _0x148b6e=path[_0xa909('0x12')](config['root'],_0xa909('0x79'),_0x174851+'.csv');hasTZ=_[_0xa909('0x55')](_0x78b1b6)[_0xa909('0x7a')]('dialTimezone');var _0x53e1ce=_[_0xa909('0x55')](_0x78b1b6)['join']();logger[_0xa909('0x5b')](_0xa909('0x7b'),_0x53e1ce);db[_0xa909('0x7c')][_0xa909('0x7d')]({'raw':!![],'attributes':['id',_0xa909('0x7e')]})['then'](function(_0x4cf738){for(var _0x292d94=0x0;_0x292d94<_0x4cf738[_0xa909('0x1a')];_0x292d94++){if(_0x4cf738[_0x292d94][_0xa909('0x7e')]in _0x78b1b6){contactItemTypes[_0xa909('0x1b')](_0x4cf738[_0x292d94]);delete _0x479831[_0x4cf738[_0x292d94]['name']];hasAdditionalPhones=!![];}for(var _0x2db526 in _0x78b1b6){if(_0x4cf738[_0x292d94]['name']+_0xa909('0x7f')===_0x2db526){phoneDescriptions[_0xa909('0x1b')]({'itemTypeId':_0x4cf738[_0x292d94]['id'],'description':_0x2db526});delete _0x479831[_0x2db526];}}}if(hasAdditionalPhones)_0x479831[_0xa909('0x18')]='';var _0x5e1a74=_[_0xa909('0x55')](_0x479831)['join']();logger[_0xa909('0x5b')](_0xa909('0x7b'),_0x5e1a74);fs[_0xa909('0x80')](_0x148b6e,_0x5e1a74+'\x0a');Papa['parse'](fs[_0xa909('0x81')](_0x9a7e09),{'header':!![],'skipEmptyLines':!![],'step':function(_0x150e59,_0x11de1c){try{for(var _0x334e14=0x0,_0x39cd5d=[];_0x334e14<_0x150e59[_0xa909('0x82')][_0xa909('0x1a')];_0x334e14++){stats['rows']+=0x1;if(_0x150e59[_0xa909('0x5e')][_0x334e14]){handleError(_0x150e59['data'][_0x334e14],_0x150e59[_0xa909('0x5e')][_0x334e14]);}else{var _0x4d1196=[];var _0x5d0451=[];var _0x41d5bb={};for(var _0x4e1733 in _0x78b1b6){let _0x146217=contactItemTypes['find'](_0x9912d5=>_0x9912d5[_0xa909('0x7e')]===_0x4e1733);let _0x10d16c=contactItemTypes[_0xa909('0x83')](_0x58149b=>_0x58149b[_0xa909('0x7e')]+'_description'===_0x4e1733);if(_[_0xa909('0x71')](_0x146217)&&_[_0xa909('0x71')](_0x10d16c)){if(_0x78b1b6['hasOwnProperty'](_0x4e1733)){if(_0x150e59['data'][_0x334e14][_0x78b1b6[_0x4e1733]]){var _0x1a50b9=_[_0xa909('0x84')](_0x150e59[_0xa909('0x82')][_0x334e14][_0x78b1b6[_0x4e1733]][_0xa909('0x85')](/"/g,'\x27'));switch(_0x4e1733){case _0xa909('0x30'):var _0x18a2fb=moment(_0x1a50b9,_0xa909('0xc'),!![]);if(_0x18a2fb[_0xa909('0x86')]()){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}else{_0x4d1196[_0xa909('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x3d7cc6=parseInt(_0x1a50b9);_0x1a50b9=_[_0xa909('0x87')](_0x3d7cc6)||_0x3d7cc6<0x0||_0x3d7cc6>0x4?_0x41c0f2?0x3:0x2:_0x3d7cc6;_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');break;case'UserId':var _0x9abe82=parseInt(_0x1a50b9);if(_[_0xa909('0x88')](_0x9abe82)&&_[_0xa909('0x7a')](_0x34019b,_0x9abe82)){_0x39cd5d['push']('\x22'+_0x9abe82+'\x22');}else{_0x4d1196[_0xa909('0x1b')](_0xa909('0x89'));}break;case _0xa909('0x8a'):if(isEmail(_0x1a50b9)){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}else{_0x4d1196[_0xa909('0x1b')](_0xa909('0x8b'));}break;case _0xa909('0x8c'):var _0x367891=moment(_0x1a50b9,_0xa909('0x8d'),!![]);if(_0x367891[_0xa909('0x86')]()){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}else{_0x4d1196[_0xa909('0x1b')](_0xa909('0x8e'));}break;case _0xa909('0x70'):var _0xef1d84=shared['timezones'];var _0x707199=_0xef1d84[_0x1a50b9];if(!_['isNil'](_0x707199)){var _0x5821fd=_0x707199[_0xa909('0x72')];_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x5821fd+'\x22');}break;default:_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x1a50b9+'\x22');}}else{switch(_0x4e1733){case _0xa909('0x8f'):case'phone':_0x4d1196[_0xa909('0x1b')](_0x4e1733+_0xa909('0x90'));break;default:_0x39cd5d[_0xa909('0x1b')]('\x22\x22');}}}}else{var _0xf523ea='';if(!_[_0xa909('0x71')](_0x146217)){if(!_0x41d5bb[_0xa909('0x91')](_0x146217['id'])){if(!_[_0xa909('0x71')](_0x150e59[_0xa909('0x82')][_0x334e14][_0x78b1b6[_0x4e1733]])){var _0x1a50b9=_[_0xa909('0x84')](_0x150e59['data'][_0x334e14][_0x78b1b6[_0x4e1733]][_0xa909('0x85')](/"/g,'\x27'));var _0xbe9407=phoneDescriptions[_0xa909('0x83')](_0x421e98=>_0x421e98[_0xa909('0x92')]===_0x146217['id']);if(!_[_0xa909('0x71')](_0xbe9407)){var _0x415fde=_[_0xa909('0x84')](_0x150e59[_0xa909('0x82')][_0x334e14][_0x78b1b6[_0xbe9407[_0xa909('0x93')]]][_0xa909('0x85')](/"/g,'\x27'));if(!_[_0xa909('0x71')](_0x415fde))_0x1a50b9=_0x1a50b9+'§'+_0x415fde;}if(_0xf523ea=='')_0xf523ea=_0x1a50b9;else _0xf523ea+='|'+_0x1a50b9;}_0x5d0451[_0xa909('0x1b')](_0x146217['id']+':'+_0xf523ea);_0x41d5bb[_0x146217['id']]=0x1;}}}}if(hasAdditionalPhones){_0x39cd5d[_0xa909('0x1b')]('\x22'+_0x5d0451[_0xa909('0x12')](';')+'\x22');}if(_0x4d1196[_0xa909('0x1a')]){handleError(_0x150e59[_0xa909('0x82')][_0x334e14],{'code':_0xa909('0x94'),'message':_0x4d1196['join']()});}else{fs[_0xa909('0x95')](_0x148b6e,_0x39cd5d['join']()+'\x0a');}_0x39cd5d=[];}if(!(stats[_0xa909('0x96')]%0xc8)){socket['emit'](_0xa909('0x97')+_0x174851,stats);stats[_0xa909('0x5e')]=[];}}if(stopped){logger[_0xa909('0x5b')]('Abort\x20parser');_0x11de1c['abort']();}}catch(_0x589794){handleError(_0x150e59[_0xa909('0x82')][_0x334e14],{'code':_0xa909('0x98'),'message':_0x589794[_0xa909('0x60')]});logger['error'](_0xa909('0x99'),_0x589794[_0xa909('0x60')]);}},'complete':function(){try{var _0x56f6b8=[];var _0x3d3429=[];var _0x3200f4=_0xa909('0x38');if(_0x5054d7[_0xa909('0x9a')]&&_0x5054d7[_0xa909('0x9a')]['length']){_0x3200f4=_0xa909('0x9b')+_0x174851;_0x56f6b8[_0xa909('0x1b')](_0xa909('0x9c')+_0x3200f4+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0xa909('0x9d')+_0x174851;tmp_voice_queues=_0xa909('0x9e')+_0x174851;_0x3d3429[_0xa909('0x1b')](_0xa909('0x9c')+tmp_campaigns+_0xa909('0x9f'));_0x3d3429[_0xa909('0x1b')](_0xa909('0x9c')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0xa909('0xa0')](_0x3d3429,handleTZQuery)[_0xa909('0x19')](function(_0x5a7db8){updateTzCampaigns(_0x5054d7[_0xa909('0x32')])['then'](function(_0x431c60){updateTzVoiceQueues(_0x5054d7['ListId'])['then'](function(_0x84690f){if(hasTZ)_0x5e1a74=_0x5e1a74[_0xa909('0x85')](_0xa909('0x70'),_0xa909('0xa1'));var _0x16e1f5=util[_0xa909('0xd')](_0xa909('0xa2'),_0x148b6e,_0x3200f4,_0x5e1a74,_0x5054d7[_0xa909('0x32')],_0x5054d7[_0xa909('0xa3')]||null,NOW,NOW);if(_['isNil'](_0x78b1b6[_0xa909('0x30')])){_0x16e1f5+=_0xa909('0xa4');}_0x56f6b8[_0xa909('0x1b')](_0x16e1f5);if(_0x5054d7[_0xa909('0x9a')]&&_0x5054d7[_0xa909('0x9a')][_0xa909('0x1a')]){_0x56f6b8[_0xa909('0x1b')](insertCmContact(_0x5054d7['ListId'],_0x3200f4,_0x5054d7[_0xa909('0x9a')],_0x78b1b6));_0x56f6b8['push'](_0xa909('0xa5')+_0x3200f4+';');}BPromise[_0xa909('0xa0')](_0x56f6b8,handleQuery)[_0xa909('0x19')](function(_0x5e052a){BPromise[_0xa909('0x1c')]([handleAdditionalPhones()])[_0xa909('0x19')](function(){_0x56f6b8=[];for(var _0x55265a=0x0;_0x55265a<promisesAdditionalPhones[_0xa909('0x1a')];_0x55265a++){if(promisesAdditionalPhones[_0x55265a]['phone']!='§'){_0x56f6b8['push'](createAdditionalPhone(promisesAdditionalPhones[_0x55265a][_0xa909('0xa6')],promisesAdditionalPhones[_0x55265a]['contactTypeId'],promisesAdditionalPhones[_0x55265a][_0xa909('0x42')],promisesAdditionalPhones[_0x55265a][_0xa909('0xa7')]));}}BPromise[_0xa909('0x1c')](_0x56f6b8)['then'](function(){_0x56f6b8=[];if(hasTZ){_0x56f6b8[_0xa909('0x1b')](insertTzCmHopper(_0x5054d7[_0xa909('0x32')],_0xa909('0xa8'),_0xa909('0xa9'),_0xa909('0xaa'),_0x41c0f2,tmp_voice_queues));_0x56f6b8[_0xa909('0x1b')](insertTzCmHopperBlack(_0x5054d7['ListId'],_0xa909('0xab'),_0xa909('0xa9'),_0xa909('0xaa')));_0x56f6b8[_0xa909('0x1b')](insertTzCmHopper(_0x5054d7[_0xa909('0x32')],_0xa909('0x66'),_0xa909('0x65'),_0xa909('0xac'),_0x41c0f2,tmp_campaigns));_0x56f6b8[_0xa909('0x1b')](insertTzCmHopperBlack(_0x5054d7[_0xa909('0x32')],_0xa909('0xad'),_0xa909('0x65'),_0xa909('0xac')));_0x56f6b8['push'](insertCmHopperAdditionalPhones(_0x5054d7[_0xa909('0x32')]));}else{_0x56f6b8[_0xa909('0x1b')](insertCmHopper(_0x5054d7[_0xa909('0x32')],_0xa909('0xa8'),_0xa909('0xa9'),'VoiceQueueId',_0x41c0f2));_0x56f6b8['push'](insertCmHopperBlack(_0x5054d7[_0xa909('0x32')],'voice_queues_has_cm_blacklists',_0xa909('0xa9'),_0xa909('0xaa')));_0x56f6b8[_0xa909('0x1b')](insertCmHopper(_0x5054d7['ListId'],_0xa909('0x66'),_0xa909('0x65'),_0xa909('0xac'),_0x41c0f2));_0x56f6b8[_0xa909('0x1b')](insertCmHopperBlack(_0x5054d7['ListId'],'campaigns_has_cm_blacklists',_0xa909('0x65'),_0xa909('0xac')));_0x56f6b8[_0xa909('0x1b')](insertCmHopperAdditionalPhones(_0x5054d7['ListId']));}_0x56f6b8[_0xa909('0x1b')](_0xa909('0xa5')+tmp_campaigns+';');_0x56f6b8['push'](_0xa909('0xa5')+tmp_voice_queues+';');BPromise[_0xa909('0xa0')](_0x56f6b8,handleQuery)[_0xa909('0x19')](function(_0x51a9c0){stats[_0xa909('0xae')]=!![];stats[_0xa909('0xaf')]=_0x5054d7['duplicates']&&_0x5054d7['duplicates'][_0xa909('0x1a')]?results[0x2][_0xa909('0xaf')]:results[0x0]['affectedRows'];socket[_0xa909('0xb0')](_0xa909('0x97')+_0x174851,stats);fs[_0xa909('0xb1')](_0x9a7e09);fs['unlink'](_0x148b6e);process['exit'](0x0);})[_0xa909('0x62')](function(_0x442682){logger['error'](_0x442682[_0xa909('0x60')]);process[_0xa909('0x5d')](0x1);});});});})[_0xa909('0x62')](function(_0x4786a2){logger[_0xa909('0x6e')](_0x4786a2[_0xa909('0x60')]);process['exit'](0x1);});});});});}catch(_0x2e231d){logger['error'](_0xa909('0xb2'),_0x2e231d[_0xa909('0x60')]);process['exit'](0x1);}},'error':function(_0x266b4c,_0x57b3ec,_0x2e7a99,_0x128540){throw new Error(_0x128540);}});});}function validate(){if(process['argv']&&process[_0xa909('0xb3')][_0xa909('0x1a')]<0x4){throw new Error(_0xa909('0xb4'));}var _0x2063c9=path[_0xa909('0x12')](config[_0xa909('0xb5')],_0xa909('0x79'),process['argv'][0x2]);if(!fs[_0xa909('0xb6')](_0x2063c9)){throw new Error(_0xa909('0xb7'));}var _0x3ae6a0={};try{_0x3ae6a0=JSON['parse'](process[_0xa909('0xb3')][0x3]);if(!_0x3ae6a0[_0xa909('0x77')]){throw new Error(_0xa909('0xb8'));}if(!_0x3ae6a0[_0xa909('0x77')][_0xa909('0x42')]){throw new Error(_0xa909('0xb9'));}if(!_0x3ae6a0[_0xa909('0x77')][_0xa909('0x8f')]){throw new Error(_0xa909('0xba'));}var _0x5e730b=0x0;if(_0x3ae6a0['binding']['UserId']){_0x5e730b=0x1;}if(!_0x3ae6a0['ListId']){throw new Error(_0xa909('0xbb'));}}catch(_0x5862dc){throw new Error('body\x20id\x20mandatory');}var _0x117483=[];try{_0x117483=_[_0xa909('0xbc')](JSON[_0xa909('0xbd')](process[_0xa909('0xb3')][0x4]),'id');}catch(_0x5010cb){logger['info'](_0xa909('0xbe'));}main(_0x2063c9,_0x3ae6a0,_0x117483,_0x5e730b);}validate();process['on']('SIGINT',handleStop);process['on'](_0xa909('0xbf'),handleUncaughtException);
\ No newline at end of file
index 1b5bb68..1b46b20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5e5=['recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','ContactId','cm_contacts','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','keys','CompanyId','id\x20IN\x20?','min_id','group','info','sequelize','catch','main','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','_description','header','writeFileSync','parse','createReadStream','data','rows','errors','find','trim','replace','isValid','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','hasOwnProperty','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','step','\x20LIKE\x20cm_contacts;','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','exit','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','lodash','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','query','length','isNil','AdditionalPhones','push','all','then','error','message','split','filter','findOne','CmContactHasItem','update','updated','create','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','updatedAt','priority','UserId'];(function(_0x1e9ace,_0xbcc2eb){var _0x8b6958=function(_0x1898d0){while(--_0x1898d0){_0x1e9ace['push'](_0x1e9ace['shift']());}};_0x8b6958(++_0xbcc2eb);}(_0xd5e5,0x187));var _0x5d5e=function(_0xec74fe,_0x2dce88){_0xec74fe=_0xec74fe-0x0;var _0x50bda2=_0xd5e5[_0xec74fe];return _0x50bda2;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x5d5e('0x0'));var Papa=require('papaparse');var util=require(_0x5d5e('0x1'));var BPromise=require('bluebird');var moment=require(_0x5d5e('0x2'));var squel=require(_0x5d5e('0x3'));var Redis=require(_0x5d5e('0x4'));var db=require(_0x5d5e('0x5'))['db'];var config=require(_0x5d5e('0x6'));var logger=require(_0x5d5e('0x7'))(_0x5d5e('0x8'));config['redis']=_[_0x5d5e('0x9')](config[_0x5d5e('0xa')],{'host':_0x5d5e('0xb'),'port':0x18eb});var socket=require(_0x5d5e('0xc'))(new Redis(config[_0x5d5e('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x5d5e('0xd')](_0x5d5e('0xe'));var tempTableName=_0x5d5e('0xf')+moment()[_0x5d5e('0xd')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x9f5850){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x5d5e('0x10')](_0x9f5850);}function selectNotIn(_0x1af62a,_0x45663d,_0x32dd18,_0x1901b1,_0x408d57){return squel[_0x5d5e('0x11')]()[_0x5d5e('0x12')](_0x5d5e('0x13'))[_0x5d5e('0x14')](_0x1901b1)[_0x5d5e('0x15')](_0x45663d,null,_0x45663d+_0x5d5e('0x16')+_0x1901b1+'.'+_0x32dd18)[_0x5d5e('0x17')](_0x1901b1+'.'+_0x32dd18+_0x5d5e('0x18')+_0x1af62a+'.'+_0x32dd18)[_0x5d5e('0x17')](_0x45663d+_0x5d5e('0x19')+_0x408d57[_0x5d5e('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3ddf9e,_0x58db07){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize'][_0x5d5e('0x1a')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x248cad){if(_0x248cad!==null){var _0x4dfac7=[];for(var _0x52289f=0x0;_0x52289f<_0x248cad[_0x5d5e('0x1b')];_0x52289f++){var _0x3a0b99=_0x248cad[_0x52289f];if(!_[_0x5d5e('0x1c')](_0x3a0b99[_0x5d5e('0x13')])){if(!_[_0x5d5e('0x1c')](_0x3a0b99[_0x5d5e('0x1d')]))_0x4dfac7['push'](insertAdditionalPhones(_0x3a0b99));promisesContact[_0x5d5e('0x1e')]({'contact':_0x3a0b99});}}}Promise[_0x5d5e('0x1f')](_0x4dfac7)[_0x5d5e('0x20')](function(){_0x3ddf9e({'val':0x1});});})['catch'](function(_0x54d44e){logger[_0x5d5e('0x21')](_0x54d44e[_0x5d5e('0x22')]);});});}function insertAdditionalPhones(_0x27a79c){return new Promise(function(_0x439c11,_0x362779){var _0x28499c=_0x27a79c['AdditionalPhones'];if(_[_0x5d5e('0x1c')](_0x28499c))_0x362779({'val':0x0});else{var _0x4145d0=_0x28499c[_0x5d5e('0x23')](';');var _0x2261ae=[];orderBy=0x0;for(var _0x2023f3=0x0;_0x2023f3<_0x4145d0[_0x5d5e('0x1b')];_0x2023f3++){_0x2261ae[_0x5d5e('0x1e')](splitAdditionalPhone(_0x27a79c['id'],_0x4145d0[_0x2023f3]));}Promise[_0x5d5e('0x1f')](_0x2261ae)['then'](function(){_0x439c11({'val':_0x4145d0['length']});});}});}function splitAdditionalPhone(_0x494258,_0x2e9f3e){return new Promise(function(_0x936072,_0x51fa72){var _0x59e2d9=_0x2e9f3e[_0x5d5e('0x23')](':');var _0x4ff6e5=_0x59e2d9[0x0];var _0x1bbd1d=_0x59e2d9[0x1];if(_0x1bbd1d!==''){var _0xdeebc6=_0x1bbd1d[_0x5d5e('0x23')]('|');var _0x37feb9=[];for(var _0x5132a4=0x0;_0x5132a4<_0xdeebc6[_0x5d5e('0x1b')];_0x5132a4++){if(_0xdeebc6[_0x5132a4]!==''){var _0x33d730=_[_0x5d5e('0x24')](promisesAdditionalPhones,{'contactId':_0x494258,'phone':_0xdeebc6[_0x5132a4]});if(_0x33d730[_0x5d5e('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x5d5e('0x1e')]({'contactId':_0x494258,'contactTypeId':_0x4ff6e5,'phone':_0xdeebc6[_0x5132a4],'orderBy':orderBy});}}}_0x936072({'ok':0x1});}else _0x936072({'res':0x0});});}function createAdditionalPhone(_0x11e96,_0x2b84ae,_0x352487,_0x137c15){var _0x228491='';var _0x31c1b4='';var _0x41cdfc=_0x352487[_0x5d5e('0x23')]('§');_0x228491=_0x41cdfc[0x0];if(_0x41cdfc[_0x5d5e('0x1b')]==0x2)_0x31c1b4=_0x41cdfc[0x1];return new Promise(function(_0x31369b,_0x1d4066){return db['CmContactHasItem'][_0x5d5e('0x25')]({'where':{'CmContactId':_0x11e96,'item':_0x228491}})[_0x5d5e('0x20')](function(_0x557ee4){if(_0x557ee4){return db[_0x5d5e('0x26')][_0x5d5e('0x27')]({'ItemTypeId':_0x2b84ae,'description':_0x31c1b4,'OrderBy':_0x137c15},{'where':{'CmContactId':_0x11e96,'item':_0x228491}})[_0x5d5e('0x20')](function(_0x5328d7){_0x31369b({'res':_0x5d5e('0x28')});});}else{return db[_0x5d5e('0x26')][_0x5d5e('0x29')]({'CmContactId':_0x11e96,'item':_0x228491,'ItemTypeId':_0x2b84ae,'description':_0x31c1b4,'OrderBy':_0x137c15,'ItemClass':_0x5d5e('0x2a')})['then'](function(_0x40a9a9){_0x31369b({'res':_0x5d5e('0x2b')});});}});});}function updateContact(_0x120f89){return new Promise(function(_0x23a0bd,_0x34f3e2){var _0x4b28d1=_0x120f89['id'];delete _0x120f89['id'];return db['CmContact'][_0x5d5e('0x27')](_0x120f89,{'where':{'id':_0x4b28d1}})[_0x5d5e('0x20')](function(_0x44ba93){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x120f89[_0x5d5e('0x13')]},{'where':{'ContactId':_0x4b28d1}})['then'](function(_0x4ea18a){_0x23a0bd({'ret':'OK'});});});});}function insertCmHopper(_0x11978e,_0x3f431a,_0x23da5d,_0x457947,_0x28d891){var _0x2169ed=[_0x5d5e('0x2c'),_0x5d5e('0x2d'),_0x5d5e('0x2e'),_0x5d5e('0x2f'),_0x3f431a+'.'+_0x457947,_0x5d5e('0x30'),_0x5d5e('0x31'),_0x5d5e('0x32'),_0x5d5e('0x33'),'\x22'+_0x28d891+'\x22'];return squel[_0x5d5e('0x34')]()[_0x5d5e('0x35')](_0x5d5e('0x36'))[_0x5d5e('0x37')]([_0x5d5e('0x13'),_0x5d5e('0x38'),'ContactId',_0x5d5e('0x39'),_0x457947,_0x5d5e('0x3a'),_0x5d5e('0x3b'),_0x5d5e('0x3c'),_0x5d5e('0x3d'),_0x5d5e('0x3e')],squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x2169ed)['from'](_0x3f431a)[_0x5d5e('0x15')]('cm_contacts',null,_0x5d5e('0x40')+_0x3f431a+_0x5d5e('0x41'))[_0x5d5e('0x15')](_0x23da5d,null,_0x23da5d+_0x5d5e('0x16')+_0x3f431a+'.'+_0x457947)[_0x5d5e('0x17')](_0x3f431a+'.CmListId\x20=\x20?',_0x11978e)[_0x5d5e('0x17')](_0x5d5e('0x42'),NOW)[_0x5d5e('0x17')](_0x5d5e('0x43'),selectNotIn(_0x3f431a,_0x23da5d,_0x457947,_0x5d5e('0x36'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x5d5e('0x17')](_0x5d5e('0x43'),selectNotIn(_0x3f431a,_0x23da5d,_0x457947,'cm_hopper',[_0x5d5e('0x44')])))[_0x5d5e('0x45')]();}function insertCmHopperBlack(_0x5306a6,_0x18dfb4,_0x4be3bb,_0x5d3f1a){var _0x277d20=[_0x5d5e('0x2c'),_0x5d5e('0x2e'),_0x5d5e('0x2f'),_0x18dfb4+'.'+_0x5d3f1a,_0x5d5e('0x30'),_0x5d5e('0x31')];return squel['insert']()[_0x5d5e('0x35')](_0x5d5e('0x46'))[_0x5d5e('0x37')](['phone',_0x5d5e('0x47'),_0x5d5e('0x39'),_0x5d3f1a,_0x5d5e('0x3a'),_0x5d5e('0x3b')],squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x277d20)[_0x5d5e('0x14')](_0x18dfb4)[_0x5d5e('0x15')](_0x5d5e('0x48'),null,_0x5d5e('0x40')+_0x18dfb4+_0x5d5e('0x41'))[_0x5d5e('0x15')](_0x4be3bb,null,_0x4be3bb+_0x5d5e('0x16')+_0x18dfb4+'.'+_0x5d3f1a)[_0x5d5e('0x17')](_0x18dfb4+_0x5d5e('0x49'),_0x5306a6)['where'](_0x5d5e('0x42'),NOW)[_0x5d5e('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5d5e('0x12')](_0x5d5e('0x13'))['from'](_0x5d5e('0x46'))[_0x5d5e('0x17')](_0x5d5e('0x4a'),_0x5306a6)['where'](_0x5d3f1a+_0x5d5e('0x4b'),_0x18dfb4+'.'+_0x5d3f1a)))[_0x5d5e('0x45')]();}function insertCmHopperAdditionalPhones(_0x41692e){var _0x5374b4=['cm_hopper.id',_0x5d5e('0x4c'),_0x5d5e('0x4d'),_0x5d5e('0x4e'),'cm_contact_has_items.updatedAt'];return squel[_0x5d5e('0x34')]()[_0x5d5e('0x35')]('cm_hopper_additional_phones')[_0x5d5e('0x37')](['CmHopperId',_0x5d5e('0x13'),_0x5d5e('0x4f'),_0x5d5e('0x3a'),'updatedAt'],squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x5374b4)[_0x5d5e('0x14')](_0x5d5e('0x36'))[_0x5d5e('0x15')]('cm_contacts',null,_0x5d5e('0x50'))[_0x5d5e('0x15')](_0x5d5e('0x51'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')['where'](_0x5d5e('0x52'),_0x41692e)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x5d5e('0x45')]();}function insertCmContact(_0x29e56a,_0xcf10a7,_0x1a51ef,_0x447384){var _0x2bc691=_['concat'](_[_0x5d5e('0x53')](_0x447384),[_0x5d5e('0x39'),_0x5d5e('0x54'),_0x5d5e('0x3a'),_0x5d5e('0x3b')]);return squel[_0x5d5e('0x34')]()[_0x5d5e('0x35')]('cm_contacts')[_0x5d5e('0x37')](_0x2bc691,squel[_0x5d5e('0x11')]()[_0x5d5e('0x3f')](_0x2bc691)[_0x5d5e('0x14')](_0xcf10a7)[_0x5d5e('0x17')]('('+_0x1a51ef[_0x5d5e('0x15')](',')+')\x20NOT\x20IN\x20?',squel['select']()['fields'](_0x1a51ef)[_0x5d5e('0x14')](_0x5d5e('0x48'))[_0x5d5e('0x17')](_0x5d5e('0x4a'),_0x29e56a))[_0x5d5e('0x17')](_0x5d5e('0x55'),squel['select']()[_0x5d5e('0x12')]('MIN(id)',_0x5d5e('0x56'))[_0x5d5e('0x14')](_0xcf10a7)[_0x5d5e('0x57')](_0x1a51ef['join'](','))))[_0x5d5e('0x45')]();}function handleStop(){logger[_0x5d5e('0x58')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2fd456){logger['error'](_0x2fd456[_0x5d5e('0x22')]);process['exit'](0x1);}function handleError(_0xe1c70e,_0x37efaf){stats['errors'][_0x5d5e('0x1e')]({'name':_0x37efaf['code'],'message':_0x37efaf[_0x5d5e('0x22')],'row':_0xe1c70e});}function handleQuery(_0x34d0ee){logger[_0x5d5e('0x58')](_0x34d0ee);return db[_0x5d5e('0x59')][_0x5d5e('0x1a')](_0x34d0ee)['spread'](function(_0x574942){results[_0x5d5e('0x1e')](_0x574942);})[_0x5d5e('0x5a')](function(_0x33eba4){logger['error'](_0x33eba4[_0x5d5e('0x22')]);});}function main(_0x5d1e53,_0xb7c2cc,_0x181aea,_0x16f0c3){logger[_0x5d5e('0x58')](_0x5d5e('0x5b'),_0x5d1e53,JSON['stringify'](_0xb7c2cc));process[_0x5d5e('0x5c')](_0x5d5e('0x5d'));var _0x669efa=_0xb7c2cc[_0x5d5e('0x5e')];var _0x3a5656=_['clone'](_0x669efa);var _0x3f0e16=_0xb7c2cc[_0x5d5e('0x5f')];var _0x459a0c=path[_0x5d5e('0x15')](config[_0x5d5e('0x60')],_0x5d5e('0x61'),_0x3f0e16+_0x5d5e('0x62'));logger['info'](_0x5d5e('0x63'),_0xb7c2cc);db['ContactItemType'][_0x5d5e('0x64')]({'raw':!![],'attributes':['id','name']})[_0x5d5e('0x20')](function(_0x3e7ecc){for(var _0x3c038d=0x0;_0x3c038d<_0x3e7ecc[_0x5d5e('0x1b')];_0x3c038d++){if(_0x3e7ecc[_0x3c038d][_0x5d5e('0x65')]in _0x669efa){contactItemTypes[_0x5d5e('0x1e')](_0x3e7ecc[_0x3c038d]);delete _0x3a5656[_0x3e7ecc[_0x3c038d]['name']];hasAdditionalPhones=!![];}for(var _0x31e847 in _0x669efa){if(_0x3e7ecc[_0x3c038d][_0x5d5e('0x65')]+_0x5d5e('0x66')===_0x31e847){phoneDescriptions[_0x5d5e('0x1e')]({'itemTypeId':_0x3e7ecc[_0x3c038d]['id'],'description':_0x31e847});delete _0x3a5656[_0x31e847];}}}if(hasAdditionalPhones)_0x3a5656[_0x5d5e('0x1d')]='';var _0x13f5e8=_[_0x5d5e('0x53')](_0x3a5656)[_0x5d5e('0x15')]();logger[_0x5d5e('0x58')](_0x5d5e('0x67'),_0x13f5e8);fs[_0x5d5e('0x68')](_0x459a0c,_0x13f5e8+'\x0a');Papa[_0x5d5e('0x69')](fs[_0x5d5e('0x6a')](_0x5d1e53),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5e0994,_0x4ff0a4){try{for(var _0x29130b=0x0,_0x5155c0=[];_0x29130b<_0x5e0994[_0x5d5e('0x6b')][_0x5d5e('0x1b')];_0x29130b++){stats[_0x5d5e('0x6c')]+=0x1;if(_0x5e0994[_0x5d5e('0x6d')][_0x29130b]){handleError(_0x5e0994['data'][_0x29130b],_0x5e0994[_0x5d5e('0x6d')][_0x29130b]);}else{var _0x1e47d5=[];var _0xe2e969=[];var _0x229c63={};for(var _0x5def9a in _0x669efa){let _0x375ffb=contactItemTypes[_0x5d5e('0x6e')](_0x5d85c7=>_0x5d85c7[_0x5d5e('0x65')]===_0x5def9a);let _0x2e00d4=contactItemTypes[_0x5d5e('0x6e')](_0x56f08=>_0x56f08[_0x5d5e('0x65')]+_0x5d5e('0x66')===_0x5def9a);if(_[_0x5d5e('0x1c')](_0x375ffb)&&_[_0x5d5e('0x1c')](_0x2e00d4)){if(_0x669efa['hasOwnProperty'](_0x5def9a)){if(_0x5e0994[_0x5d5e('0x6b')][_0x29130b][_0x669efa[_0x5def9a]]){var _0x3e2ffc=_[_0x5d5e('0x6f')](_0x5e0994[_0x5d5e('0x6b')][_0x29130b][_0x669efa[_0x5def9a]][_0x5d5e('0x70')](/"/g,'\x27'));switch(_0x5def9a){case _0x5d5e('0x38'):var _0x4b1486=moment(_0x3e2ffc,_0x5d5e('0xe'),!![]);if(_0x4b1486[_0x5d5e('0x71')]()){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');}else{_0x1e47d5[_0x5d5e('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x2fbf80=parseInt(_0x3e2ffc);_0x3e2ffc=_['isNaN'](_0x2fbf80)||_0x2fbf80<0x0||_0x2fbf80>0x4?_0x16f0c3?0x3:0x2:_0x2fbf80;_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');break;case _0x5d5e('0x3d'):var _0xce6be6=parseInt(_0x3e2ffc);if(_['isNumber'](_0xce6be6)&&_[_0x5d5e('0x72')](_0x181aea,_0xce6be6)){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0xce6be6+'\x22');}else{_0x1e47d5['push'](_0x5d5e('0x73'));}break;case _0x5d5e('0x74'):if(isEmail(_0x3e2ffc)){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');}else{_0x1e47d5[_0x5d5e('0x1e')](_0x5d5e('0x75'));}break;case'dateOfBirth':var _0x3fa6dc=moment(_0x3e2ffc,_0x5d5e('0x76'),!![]);if(_0x3fa6dc[_0x5d5e('0x71')]()){_0x5155c0['push']('\x22'+_0x3e2ffc+'\x22');}else{_0x1e47d5[_0x5d5e('0x1e')](_0x5d5e('0x77'));}break;default:_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0x3e2ffc+'\x22');}}else{switch(_0x5def9a){case'firstName':case _0x5d5e('0x13'):_0x1e47d5[_0x5d5e('0x1e')](_0x5def9a+_0x5d5e('0x78'));break;default:_0x5155c0['push']('\x22\x22');}}}}else{var _0x4b5c33='';if(!_['isNil'](_0x375ffb)){if(!_0x229c63[_0x5d5e('0x79')](_0x375ffb['id'])){for(var _0x193b4a=0x0;_0x193b4a<_0x669efa[_0x5def9a]['length'];_0x193b4a++){var _0x3e2ffc=_[_0x5d5e('0x6f')](_0x5e0994['data'][_0x29130b][_0x669efa[_0x5def9a][_0x193b4a]][_0x5d5e('0x70')](/"/g,'\x27'));var _0x10ef0d=phoneDescriptions[_0x5d5e('0x6e')](_0x216f8b=>_0x216f8b['itemTypeId']===_0x375ffb['id']);if(!_[_0x5d5e('0x1c')](_0x10ef0d)){var _0x362629=_['trim'](_0x5e0994[_0x5d5e('0x6b')][_0x29130b][_0x669efa[_0x10ef0d[_0x5d5e('0x7a')]][0x0]]['replace'](/"/g,'\x27'));if(!_[_0x5d5e('0x1c')](_0x362629))_0x3e2ffc=_0x3e2ffc+'§'+_0x362629;}if(_0x4b5c33=='')_0x4b5c33=_0x3e2ffc;else _0x4b5c33+='|'+_0x3e2ffc;}_0xe2e969[_0x5d5e('0x1e')](_0x375ffb['id']+':'+_0x4b5c33);_0x229c63[_0x375ffb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5155c0[_0x5d5e('0x1e')]('\x22'+_0xe2e969[_0x5d5e('0x15')](';')+'\x22');}if(_0x1e47d5[_0x5d5e('0x1b')]){handleError(_0x5e0994[_0x5d5e('0x6b')][_0x29130b],{'code':_0x5d5e('0x7b'),'message':_0x1e47d5[_0x5d5e('0x15')]()});}else{fs[_0x5d5e('0x7c')](_0x459a0c,_0x5155c0[_0x5d5e('0x15')]()+'\x0a');}_0x5155c0=[];}if(!(stats['rows']%0xc8)){socket[_0x5d5e('0x7d')](_0x5d5e('0x7e')+_0x3f0e16,stats);stats['errors']=[];}}if(stopped){logger[_0x5d5e('0x58')](_0x5d5e('0x7f'));_0x4ff0a4[_0x5d5e('0x80')]();}}catch(_0x164cb8){handleError(_0x5e0994[_0x5d5e('0x6b')][_0x29130b],{'code':_0x5d5e('0x81'),'message':_0x164cb8[_0x5d5e('0x22')]});logger[_0x5d5e('0x21')](_0x5d5e('0x82'),_0x164cb8[_0x5d5e('0x22')]);}},'complete':function(){try{var _0xe025cc=[];var _0xce4d59=tempTableName;_0xe025cc[_0x5d5e('0x1e')]('CREATE\x20TABLE\x20'+_0xce4d59+_0x5d5e('0x83'));logger[_0x5d5e('0x58')](_0x5d5e('0x84'),contactItemTypes[_0x5d5e('0x1b')]);var _0x2f749f=util['format'](_0x5d5e('0x85'),_0x459a0c,_0xce4d59,_0x13f5e8,_0xb7c2cc[_0x5d5e('0x39')],_0xb7c2cc['CompanyId']||null,NOW,NOW);if(_[_0x5d5e('0x1c')](_0x669efa['scheduledat'])){_0x2f749f+=_0x5d5e('0x86');}_0xe025cc[_0x5d5e('0x1e')](_0x2f749f);BPromise['each'](_0xe025cc,handleQuery)[_0x5d5e('0x20')](function(_0x136fb6){BPromise['all']([handleAdditionalPhones()])[_0x5d5e('0x20')](function(){_0xe025cc=[];for(var _0x75732d=0x0;_0x75732d<promisesContact[_0x5d5e('0x1b')];_0x75732d++){_0xe025cc[_0x5d5e('0x1e')](updateContact(promisesContact[_0x75732d][_0x5d5e('0x87')]));}BPromise[_0x5d5e('0x1f')](_0xe025cc)[_0x5d5e('0x20')](function(){_0xe025cc=[];for(var _0x299f43=0x0;_0x299f43<promisesAdditionalPhones[_0x5d5e('0x1b')];_0x299f43++){_0xe025cc[_0x5d5e('0x1e')](createAdditionalPhone(promisesAdditionalPhones[_0x299f43][_0x5d5e('0x88')],promisesAdditionalPhones[_0x299f43]['contactTypeId'],promisesAdditionalPhones[_0x299f43]['phone'],promisesAdditionalPhones[_0x299f43][_0x5d5e('0x89')]));}BPromise[_0x5d5e('0x1f')](_0xe025cc)[_0x5d5e('0x20')](function(){_0xe025cc=[];_0xe025cc[_0x5d5e('0x1e')](insertCmHopperAdditionalPhones(_0xb7c2cc[_0x5d5e('0x39')]));_0xe025cc['push'](_0x5d5e('0x8a')+_0xce4d59+';');BPromise['each'](_0xe025cc,handleQuery)[_0x5d5e('0x20')](function(_0x17c299){stats[_0x5d5e('0x8b')]=!![];stats[_0x5d5e('0x8c')]=updatedRows;socket['emit'](_0x5d5e('0x7e')+_0x3f0e16,stats);fs[_0x5d5e('0x8d')](_0x5d1e53);fs['unlink'](_0x459a0c);process[_0x5d5e('0x8e')](0x0);})[_0x5d5e('0x5a')](function(_0x4ee306){logger[_0x5d5e('0x21')](_0x4ee306[_0x5d5e('0x22')]);process[_0x5d5e('0x8e')](0x1);});});});});})[_0x5d5e('0x5a')](function(_0x4f637a){logger[_0x5d5e('0x21')](_0x4f637a['message']);process['exit'](0x1);});}catch(_0x5d68fb){logger[_0x5d5e('0x21')]('complete',_0x5d68fb[_0x5d5e('0x22')]);process[_0x5d5e('0x8e')](0x1);}},'error':function(_0x10ca38,_0x19e745,_0x531127,_0x562e19){throw new Error(_0x562e19);}});});}function validate(){if(process['argv']&&process[_0x5d5e('0x8f')][_0x5d5e('0x1b')]<0x4){throw new Error(_0x5d5e('0x90'));}var _0x6d1eb3=path[_0x5d5e('0x15')](config[_0x5d5e('0x60')],_0x5d5e('0x61'),process['argv'][0x2]);if(!fs[_0x5d5e('0x91')](_0x6d1eb3)){throw new Error(_0x5d5e('0x92'));}var _0x3c0c04={};try{_0x3c0c04=JSON[_0x5d5e('0x69')](process[_0x5d5e('0x8f')][0x3]);if(!_0x3c0c04['binding']){throw new Error(_0x5d5e('0x93'));}var _0x5300f1=0x0;if(_0x3c0c04[_0x5d5e('0x5e')]['UserId']){_0x5300f1=0x1;}if(!_0x3c0c04['ListId']){throw new Error(_0x5d5e('0x94'));}}catch(_0x17c3fd){throw new Error(_0x5d5e('0x95'));}var _0x4a1c90=[];try{_0x4a1c90=_[_0x5d5e('0x96')](JSON[_0x5d5e('0x69')](process[_0x5d5e('0x8f')][0x4]),'id');}catch(_0x359008){logger['info']('No\x20agent\x20available');}main(_0x6d1eb3,_0x3c0c04,_0x4a1c90,_0x5300f1);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x4ffa=['\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','phone','isNil','AdditionalPhones','push','all','then','split','filter','CmContactHasItem','update','updated','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','cm_hopper','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','into','cm_hopper_black','ContactId','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','CompanyId','fromQuery',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','error','message','exit','errors','code','catch','main','send','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','findAll','name','keys','header','parse','createReadStream','data','rows','find','_description','hasOwnProperty','replace','scheduledat','priority','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','trim','description','appendFileSync','contact:import:','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','where'];(function(_0x286354,_0x128be5){var _0x30fe4d=function(_0x18ae00){while(--_0x18ae00){_0x286354['push'](_0x286354['shift']());}};_0x30fe4d(++_0x128be5);}(_0x4ffa,0x124));var _0xa4ff=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4ffa[_0x46e363];return _0x3fb059;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0xa4ff('0x0'));var util=require('util');var BPromise=require(_0xa4ff('0x1'));var moment=require(_0xa4ff('0x2'));var squel=require(_0xa4ff('0x3'));var Redis=require(_0xa4ff('0x4'));var db=require(_0xa4ff('0x5'))['db'];var config=require(_0xa4ff('0x6'));var logger=require('../../../config/logger')(_0xa4ff('0x7'));config[_0xa4ff('0x8')]=_[_0xa4ff('0x9')](config['redis'],{'host':_0xa4ff('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4ff('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xa4ff('0xb')](_0xa4ff('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0xa4ff('0xb')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5e2d94){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x5e2d94);}function selectNotIn(_0xb9c9bc,_0x3b1fe4,_0x7cb440,_0x2007b1,_0x4ec03b){return squel[_0xa4ff('0xd')]()[_0xa4ff('0xe')]('phone')[_0xa4ff('0xf')](_0x2007b1)[_0xa4ff('0x10')](_0x3b1fe4,null,_0x3b1fe4+'.id\x20=\x20'+_0x2007b1+'.'+_0x7cb440)[_0xa4ff('0x11')](_0x2007b1+'.'+_0x7cb440+_0xa4ff('0x12')+_0xb9c9bc+'.'+_0x7cb440)['where'](_0x3b1fe4+_0xa4ff('0x13')+_0x4ec03b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x34f681,_0x5a3869){promisesAdditionalPhones=[];promisesContact=[];return db[_0xa4ff('0x14')][_0xa4ff('0x15')]('select\x20*\x20from\x20'+tempTableName)[_0xa4ff('0x16')](function(_0x199d1e){if(_0x199d1e!==null){var _0x27f8d8=[];for(var _0x139e7f=0x0;_0x139e7f<_0x199d1e[_0xa4ff('0x17')];_0x139e7f++){var _0x380c2b=_0x199d1e[_0x139e7f];if(!_['isNil'](_0x380c2b[_0xa4ff('0x18')])){if(!_[_0xa4ff('0x19')](_0x380c2b[_0xa4ff('0x1a')]))_0x27f8d8['push'](insertAdditionalPhones(_0x380c2b));promisesContact[_0xa4ff('0x1b')]({'contact':_0x380c2b});}}}Promise[_0xa4ff('0x1c')](_0x27f8d8)['then'](function(){_0x34f681({'val':0x1});});})['catch'](function(_0x28a1bc){logger['error'](_0x28a1bc['message']);});});}function insertAdditionalPhones(_0x31d0da){return new Promise(function(_0x20ba0d,_0x2857e7){var _0x15450d=_0x31d0da[_0xa4ff('0x1a')];if(_['isNil'](_0x15450d))_0x2857e7({'val':0x0});else{var _0x77c629=_0x15450d['split'](';');var _0x570458=[];orderBy=0x0;for(var _0x2598b4=0x0;_0x2598b4<_0x77c629['length'];_0x2598b4++){_0x570458[_0xa4ff('0x1b')](splitAdditionalPhone(_0x31d0da['id'],_0x77c629[_0x2598b4]));}Promise['all'](_0x570458)[_0xa4ff('0x1d')](function(){_0x20ba0d({'val':_0x77c629['length']});});}});}function splitAdditionalPhone(_0x520bdc,_0x132633){return new Promise(function(_0xde9489,_0x24dce3){var _0x1d8a18=_0x132633['split'](':');var _0x4a649c=_0x1d8a18[0x0];var _0x1a62ba=_0x1d8a18[0x1];if(_0x1a62ba!==''){var _0x38f633=_0x1a62ba[_0xa4ff('0x1e')]('|');var _0x3532e3=[];for(var _0x20e611=0x0;_0x20e611<_0x38f633[_0xa4ff('0x17')];_0x20e611++){if(_0x38f633[_0x20e611]!==''){var _0x5420a2=_[_0xa4ff('0x1f')](promisesAdditionalPhones,{'contactId':_0x520bdc,'phone':_0x38f633[_0x20e611]});if(_0x5420a2[_0xa4ff('0x17')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x520bdc,'contactTypeId':_0x4a649c,'phone':_0x38f633[_0x20e611],'orderBy':orderBy});}}}_0xde9489({'ok':0x1});}else _0xde9489({'res':0x0});});}function createAdditionalPhone(_0x56ec3b,_0x166ed8,_0x245479,_0x3c3431){var _0x56c618='';var _0x30d2aa='';var _0x31bf4d=_0x245479[_0xa4ff('0x1e')]('§');_0x56c618=_0x31bf4d[0x0];if(_0x31bf4d[_0xa4ff('0x17')]==0x2)_0x30d2aa=_0x31bf4d[0x1];return new Promise(function(_0x4e56b7,_0x268b06){return db[_0xa4ff('0x20')]['findOne']({'where':{'CmContactId':_0x56ec3b,'item':_0x56c618}})[_0xa4ff('0x1d')](function(_0x1bcd10){if(_0x1bcd10){return db[_0xa4ff('0x20')][_0xa4ff('0x21')]({'ItemTypeId':_0x166ed8,'description':_0x30d2aa,'OrderBy':_0x3c3431},{'where':{'CmContactId':_0x56ec3b,'item':_0x56c618}})[_0xa4ff('0x1d')](function(_0x2c67ee){_0x4e56b7({'res':_0xa4ff('0x22')});});}else{return db[_0xa4ff('0x20')][_0xa4ff('0x23')]({'CmContactId':_0x56ec3b,'item':_0x56c618,'ItemTypeId':_0x166ed8,'description':_0x30d2aa,'OrderBy':_0x3c3431,'ItemClass':_0xa4ff('0x24')})['then'](function(_0x1b7911){_0x4e56b7({'res':_0xa4ff('0x25')});});}});});}function updateContact(_0x554c1b){return new Promise(function(_0x43cce3,_0x306e40){var _0x40659=_0x554c1b['id'];delete _0x554c1b['id'];return db[_0xa4ff('0x26')]['update'](_0x554c1b,{'where':{'id':_0x40659}})[_0xa4ff('0x1d')](function(_0x2236c1){updatedRows+=0x1;return db[_0xa4ff('0x27')]['update']({'phone':_0x554c1b['phone']},{'where':{'ContactId':_0x40659}})[_0xa4ff('0x1d')](function(_0x513aae){_0x43cce3({'ret':'OK'});});});});}function insertCmHopper(_0x270593,_0x1f5f1d,_0x326429,_0x4bf879,_0x23d613){var _0x10ef00=[_0xa4ff('0x28'),_0xa4ff('0x29'),'cm_contacts.id',_0xa4ff('0x2a'),_0x1f5f1d+'.'+_0x4bf879,_0xa4ff('0x2b'),_0xa4ff('0x2c'),'cm_contacts.priority',_0xa4ff('0x2d'),'\x22'+_0x23d613+'\x22'];return squel[_0xa4ff('0x2e')]()['into'](_0xa4ff('0x2f'))['fromQuery']([_0xa4ff('0x18'),'scheduledat','ContactId',_0xa4ff('0x30'),_0x4bf879,_0xa4ff('0x31'),_0xa4ff('0x32'),'priority',_0xa4ff('0x33'),_0xa4ff('0x34')],squel['select']()[_0xa4ff('0x35')](_0x10ef00)['from'](_0x1f5f1d)[_0xa4ff('0x10')](_0xa4ff('0x36'),null,_0xa4ff('0x37')+_0x1f5f1d+_0xa4ff('0x38'))[_0xa4ff('0x10')](_0x326429,null,_0x326429+_0xa4ff('0x39')+_0x1f5f1d+'.'+_0x4bf879)[_0xa4ff('0x11')](_0x1f5f1d+_0xa4ff('0x3a'),_0x270593)[_0xa4ff('0x11')](_0xa4ff('0x3b'),NOW)[_0xa4ff('0x11')](_0xa4ff('0x3c'),selectNotIn(_0x1f5f1d,_0x326429,_0x4bf879,_0xa4ff('0x2f'),[_0xa4ff('0x3d'),_0xa4ff('0x3e')]))[_0xa4ff('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1f5f1d,_0x326429,_0x4bf879,_0xa4ff('0x2f'),['\x22always\x22'])))[_0xa4ff('0x3f')]();}function insertCmHopperBlack(_0x287abb,_0x5d9a26,_0x15837b,_0x1b32c9){var _0x20d0ba=['cm_contacts.phone',_0xa4ff('0x40'),_0xa4ff('0x2a'),_0x5d9a26+'.'+_0x1b32c9,_0xa4ff('0x2b'),_0xa4ff('0x2c')];return squel['insert']()[_0xa4ff('0x41')](_0xa4ff('0x42'))['fromQuery'](['phone',_0xa4ff('0x43'),_0xa4ff('0x30'),_0x1b32c9,'createdAt','updatedAt'],squel[_0xa4ff('0xd')]()['fields'](_0x20d0ba)[_0xa4ff('0xf')](_0x5d9a26)[_0xa4ff('0x10')](_0xa4ff('0x36'),null,_0xa4ff('0x37')+_0x5d9a26+'.CmListId')[_0xa4ff('0x10')](_0x15837b,null,_0x15837b+_0xa4ff('0x39')+_0x5d9a26+'.'+_0x1b32c9)[_0xa4ff('0x11')](_0x5d9a26+'.CmListId\x20=\x20?',_0x287abb)[_0xa4ff('0x11')](_0xa4ff('0x3b'),NOW)['where'](_0xa4ff('0x3c'),squel[_0xa4ff('0xd')]()['field'](_0xa4ff('0x18'))[_0xa4ff('0xf')](_0xa4ff('0x42'))[_0xa4ff('0x11')](_0xa4ff('0x44'),_0x287abb)[_0xa4ff('0x11')](_0x1b32c9+'\x20=\x20?',_0x5d9a26+'.'+_0x1b32c9)))[_0xa4ff('0x3f')]();}function insertCmHopperAdditionalPhones(_0x945692){var _0x2a44f6=[_0xa4ff('0x45'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0xa4ff('0x46')];return squel['insert']()['into'](_0xa4ff('0x47'))['fromQuery']([_0xa4ff('0x48'),_0xa4ff('0x18'),_0xa4ff('0x49'),'createdAt',_0xa4ff('0x32')],squel['select']()[_0xa4ff('0x35')](_0x2a44f6)[_0xa4ff('0xf')](_0xa4ff('0x2f'))[_0xa4ff('0x10')](_0xa4ff('0x36'),null,_0xa4ff('0x4a'))[_0xa4ff('0x10')](_0xa4ff('0x4b'),null,_0xa4ff('0x4c'))[_0xa4ff('0x11')]('cm_hopper.ListId\x20=\x20?',_0x945692)[_0xa4ff('0x11')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xa4ff('0x3f')]();}function insertCmContact(_0x459c69,_0x4ee0e4,_0x45f27b,_0x184396){var _0x42de02=_[_0xa4ff('0x4d')](_['keys'](_0x184396),[_0xa4ff('0x30'),_0xa4ff('0x4e'),_0xa4ff('0x31'),_0xa4ff('0x32')]);return squel['insert']()['into'](_0xa4ff('0x36'))[_0xa4ff('0x4f')](_0x42de02,squel['select']()[_0xa4ff('0x35')](_0x42de02)[_0xa4ff('0xf')](_0x4ee0e4)[_0xa4ff('0x11')]('('+_0x45f27b[_0xa4ff('0x10')](',')+_0xa4ff('0x50'),squel[_0xa4ff('0xd')]()[_0xa4ff('0x35')](_0x45f27b)['from']('cm_contacts')['where'](_0xa4ff('0x44'),_0x459c69))[_0xa4ff('0x11')](_0xa4ff('0x51'),squel[_0xa4ff('0xd')]()[_0xa4ff('0xe')](_0xa4ff('0x52'),'min_id')[_0xa4ff('0xf')](_0x4ee0e4)[_0xa4ff('0x53')](_0x45f27b['join'](','))))[_0xa4ff('0x3f')]();}function handleStop(){logger[_0xa4ff('0x54')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x3ce969){logger[_0xa4ff('0x55')](_0x3ce969[_0xa4ff('0x56')]);process[_0xa4ff('0x57')](0x1);}function handleError(_0x39abc5,_0x53f66c){stats[_0xa4ff('0x58')][_0xa4ff('0x1b')]({'name':_0x53f66c[_0xa4ff('0x59')],'message':_0x53f66c[_0xa4ff('0x56')],'row':_0x39abc5});}function handleQuery(_0xe608c4){logger[_0xa4ff('0x54')](_0xe608c4);return db[_0xa4ff('0x14')]['query'](_0xe608c4)['spread'](function(_0x15b7a6){results['push'](_0x15b7a6);})[_0xa4ff('0x5a')](function(_0x254f09){logger[_0xa4ff('0x55')](_0x254f09[_0xa4ff('0x56')]);});}function main(_0x47fb21,_0x7ed532,_0x323092,_0x4e05fa){logger[_0xa4ff('0x54')](_0xa4ff('0x5b'),_0x47fb21,JSON['stringify'](_0x7ed532));process[_0xa4ff('0x5c')]('start');var _0x42c662=_0x7ed532[_0xa4ff('0x5d')];var _0x54f581=_[_0xa4ff('0x5e')](_0x42c662);var _0x443fa2=_0x7ed532[_0xa4ff('0x5f')];var _0x5893cc=path[_0xa4ff('0x10')](config[_0xa4ff('0x60')],_0xa4ff('0x61'),_0x443fa2+_0xa4ff('0x62'));logger[_0xa4ff('0x54')](_0xa4ff('0x63'),_0x7ed532);db['ContactItemType'][_0xa4ff('0x64')]({'raw':!![],'attributes':['id',_0xa4ff('0x65')]})[_0xa4ff('0x1d')](function(_0x238071){for(var _0x33635c=0x0;_0x33635c<_0x238071['length'];_0x33635c++){if(_0x238071[_0x33635c][_0xa4ff('0x65')]in _0x42c662){contactItemTypes['push'](_0x238071[_0x33635c]);delete _0x54f581[_0x238071[_0x33635c][_0xa4ff('0x65')]];hasAdditionalPhones=!![];}for(var _0x279491 in _0x42c662){if(_0x238071[_0x33635c][_0xa4ff('0x65')]+'_description'===_0x279491){phoneDescriptions['push']({'itemTypeId':_0x238071[_0x33635c]['id'],'description':_0x279491});delete _0x54f581[_0x279491];}}}if(hasAdditionalPhones)_0x54f581[_0xa4ff('0x1a')]='';var _0x9b8628=_[_0xa4ff('0x66')](_0x54f581)['join']();logger[_0xa4ff('0x54')](_0xa4ff('0x67'),_0x9b8628);fs['writeFileSync'](_0x5893cc,_0x9b8628+'\x0a');Papa[_0xa4ff('0x68')](fs[_0xa4ff('0x69')](_0x47fb21),{'header':!![],'skipEmptyLines':!![],'step':function(_0x15da7d,_0x21b986){try{for(var _0x1d2848=0x0,_0x187ddf=[];_0x1d2848<_0x15da7d[_0xa4ff('0x6a')]['length'];_0x1d2848++){stats[_0xa4ff('0x6b')]+=0x1;if(_0x15da7d[_0xa4ff('0x58')][_0x1d2848]){handleError(_0x15da7d[_0xa4ff('0x6a')][_0x1d2848],_0x15da7d['errors'][_0x1d2848]);}else{var _0x114bcd=[];var _0x1b8bc3=[];var _0x55480b={};for(var _0x14058c in _0x42c662){let _0x2e6bf8=contactItemTypes[_0xa4ff('0x6c')](_0x59b1d8=>_0x59b1d8[_0xa4ff('0x65')]===_0x14058c);let _0x33bcf9=contactItemTypes[_0xa4ff('0x6c')](_0x57e67a=>_0x57e67a[_0xa4ff('0x65')]+_0xa4ff('0x6d')===_0x14058c);if(_[_0xa4ff('0x19')](_0x2e6bf8)&&_[_0xa4ff('0x19')](_0x33bcf9)){if(_0x42c662[_0xa4ff('0x6e')](_0x14058c)){if(_0x15da7d['data'][_0x1d2848][_0x42c662[_0x14058c]]){var _0x1e5964=_['trim'](_0x15da7d[_0xa4ff('0x6a')][_0x1d2848][_0x42c662[_0x14058c]][_0xa4ff('0x6f')](/"/g,'\x27'));switch(_0x14058c){case _0xa4ff('0x70'):var _0x3461c4=moment(_0x1e5964,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3461c4['isValid']()){_0x187ddf['push']('\x22'+_0x1e5964+'\x22');}else{_0x114bcd[_0xa4ff('0x1b')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xa4ff('0x71'):var _0x144243=parseInt(_0x1e5964);_0x1e5964=_[_0xa4ff('0x72')](_0x144243)||_0x144243<0x0||_0x144243>0x4?_0x4e05fa?0x3:0x2:_0x144243;_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1e5964+'\x22');break;case _0xa4ff('0x33'):var _0x3fd830=parseInt(_0x1e5964);if(_[_0xa4ff('0x73')](_0x3fd830)&&_[_0xa4ff('0x74')](_0x323092,_0x3fd830)){_0x187ddf['push']('\x22'+_0x3fd830+'\x22');}else{_0x114bcd['push']('agent\x20not\x20exists');}break;case _0xa4ff('0x75'):if(isEmail(_0x1e5964)){_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1e5964+'\x22');}else{_0x114bcd[_0xa4ff('0x1b')](_0xa4ff('0x76'));}break;case _0xa4ff('0x77'):var _0x582f42=moment(_0x1e5964,_0xa4ff('0x78'),!![]);if(_0x582f42[_0xa4ff('0x79')]()){_0x187ddf['push']('\x22'+_0x1e5964+'\x22');}else{_0x114bcd[_0xa4ff('0x1b')](_0xa4ff('0x7a'));}break;default:_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1e5964+'\x22');}}else{switch(_0x14058c){case _0xa4ff('0x7b'):case _0xa4ff('0x18'):_0x114bcd[_0xa4ff('0x1b')](_0x14058c+_0xa4ff('0x7c'));break;default:_0x187ddf[_0xa4ff('0x1b')]('\x22\x22');}}}}else{var _0x5635c='';if(!_['isNil'](_0x2e6bf8)){if(!_0x55480b[_0xa4ff('0x6e')](_0x2e6bf8['id'])){for(var _0x1c6c6d=0x0;_0x1c6c6d<_0x42c662[_0x14058c][_0xa4ff('0x17')];_0x1c6c6d++){var _0x1e5964=_['trim'](_0x15da7d[_0xa4ff('0x6a')][_0x1d2848][_0x42c662[_0x14058c][_0x1c6c6d]][_0xa4ff('0x6f')](/"/g,'\x27'));var _0x1e849d=phoneDescriptions[_0xa4ff('0x6c')](_0x4c8c11=>_0x4c8c11[_0xa4ff('0x7d')]===_0x2e6bf8['id']);if(!_['isNil'](_0x1e849d)){var _0x94f69d=_[_0xa4ff('0x7e')](_0x15da7d[_0xa4ff('0x6a')][_0x1d2848][_0x42c662[_0x1e849d[_0xa4ff('0x7f')]][0x0]][_0xa4ff('0x6f')](/"/g,'\x27'));if(!_[_0xa4ff('0x19')](_0x94f69d))_0x1e5964=_0x1e5964+'§'+_0x94f69d;}if(_0x5635c=='')_0x5635c=_0x1e5964;else _0x5635c+='|'+_0x1e5964;}_0x1b8bc3[_0xa4ff('0x1b')](_0x2e6bf8['id']+':'+_0x5635c);_0x55480b[_0x2e6bf8['id']]=0x1;}}}}if(hasAdditionalPhones){_0x187ddf[_0xa4ff('0x1b')]('\x22'+_0x1b8bc3[_0xa4ff('0x10')](';')+'\x22');}if(_0x114bcd[_0xa4ff('0x17')]){handleError(_0x15da7d[_0xa4ff('0x6a')][_0x1d2848],{'code':'SystemRow','message':_0x114bcd[_0xa4ff('0x10')]()});}else{fs[_0xa4ff('0x80')](_0x5893cc,_0x187ddf[_0xa4ff('0x10')]()+'\x0a');}_0x187ddf=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xa4ff('0x81')+_0x443fa2,stats);stats[_0xa4ff('0x58')]=[];}}if(stopped){logger[_0xa4ff('0x54')](_0xa4ff('0x82'));_0x21b986['abort']();}}catch(_0x2ccda5){handleError(_0x15da7d[_0xa4ff('0x6a')][_0x1d2848],{'code':_0xa4ff('0x83'),'message':_0x2ccda5[_0xa4ff('0x56')]});logger[_0xa4ff('0x55')](_0xa4ff('0x84'),_0x2ccda5[_0xa4ff('0x56')]);}},'complete':function(){try{var _0x5dc1d2=[];var _0x4b9808=tempTableName;_0x5dc1d2[_0xa4ff('0x1b')](_0xa4ff('0x85')+_0x4b9808+_0xa4ff('0x86'));logger[_0xa4ff('0x54')](_0xa4ff('0x87'),contactItemTypes[_0xa4ff('0x17')]);var _0xf686be=util[_0xa4ff('0xb')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x5893cc,_0x4b9808,_0x9b8628,_0x7ed532[_0xa4ff('0x30')],_0x7ed532[_0xa4ff('0x4e')]||null,NOW,NOW);if(_[_0xa4ff('0x19')](_0x42c662['scheduledat'])){_0xf686be+=_0xa4ff('0x88');}_0x5dc1d2[_0xa4ff('0x1b')](_0xf686be);BPromise[_0xa4ff('0x89')](_0x5dc1d2,handleQuery)['then'](function(_0x19fd42){BPromise['all']([handleAdditionalPhones()])['then'](function(){_0x5dc1d2=[];for(var _0x548676=0x0;_0x548676<promisesContact['length'];_0x548676++){_0x5dc1d2['push'](updateContact(promisesContact[_0x548676][_0xa4ff('0x8a')]));}BPromise[_0xa4ff('0x1c')](_0x5dc1d2)[_0xa4ff('0x1d')](function(){_0x5dc1d2=[];for(var _0x454d44=0x0;_0x454d44<promisesAdditionalPhones[_0xa4ff('0x17')];_0x454d44++){_0x5dc1d2[_0xa4ff('0x1b')](createAdditionalPhone(promisesAdditionalPhones[_0x454d44][_0xa4ff('0x8b')],promisesAdditionalPhones[_0x454d44][_0xa4ff('0x8c')],promisesAdditionalPhones[_0x454d44][_0xa4ff('0x18')],promisesAdditionalPhones[_0x454d44][_0xa4ff('0x8d')]));}BPromise['all'](_0x5dc1d2)[_0xa4ff('0x1d')](function(){_0x5dc1d2=[];_0x5dc1d2[_0xa4ff('0x1b')](insertCmHopperAdditionalPhones(_0x7ed532[_0xa4ff('0x30')]));_0x5dc1d2[_0xa4ff('0x1b')](_0xa4ff('0x8e')+_0x4b9808+';');BPromise[_0xa4ff('0x89')](_0x5dc1d2,handleQuery)['then'](function(_0x287363){stats['finish']=!![];stats[_0xa4ff('0x8f')]=updatedRows;socket['emit'](_0xa4ff('0x81')+_0x443fa2,stats);fs[_0xa4ff('0x90')](_0x47fb21);fs['unlink'](_0x5893cc);process[_0xa4ff('0x57')](0x0);})[_0xa4ff('0x5a')](function(_0x40b050){logger[_0xa4ff('0x55')](_0x40b050[_0xa4ff('0x56')]);process[_0xa4ff('0x57')](0x1);});});});});})[_0xa4ff('0x5a')](function(_0x2a6d25){logger['error'](_0x2a6d25[_0xa4ff('0x56')]);process['exit'](0x1);});}catch(_0x3f3eb2){logger[_0xa4ff('0x55')](_0xa4ff('0x91'),_0x3f3eb2['message']);process[_0xa4ff('0x57')](0x1);}},'error':function(_0x5d112e,_0xa8cfd3,_0x3ffb98,_0x500f3c){throw new Error(_0x500f3c);}});});}function validate(){if(process[_0xa4ff('0x92')]&&process[_0xa4ff('0x92')][_0xa4ff('0x17')]<0x4){throw new Error(_0xa4ff('0x93'));}var _0x1263d5=path[_0xa4ff('0x10')](config['root'],'server/files/tmp',process['argv'][0x2]);if(!fs[_0xa4ff('0x94')](_0x1263d5)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x557f6e={};try{_0x557f6e=JSON[_0xa4ff('0x68')](process['argv'][0x3]);if(!_0x557f6e[_0xa4ff('0x5d')]){throw new Error(_0xa4ff('0x95'));}var _0x3d9512=0x0;if(_0x557f6e[_0xa4ff('0x5d')][_0xa4ff('0x33')]){_0x3d9512=0x1;}if(!_0x557f6e[_0xa4ff('0x30')]){throw new Error(_0xa4ff('0x96'));}}catch(_0x14ebb4){throw new Error(_0xa4ff('0x97'));}var _0x586c68=[];try{_0x586c68=_[_0xa4ff('0x98')](JSON[_0xa4ff('0x68')](process[_0xa4ff('0x92')][0x4]),'id');}catch(_0x1ee404){logger[_0xa4ff('0x54')]('No\x20agent\x20available');}main(_0x1263d5,_0x557f6e,_0x586c68,_0x3d9512);}validate();process['on'](_0xa4ff('0x99'),handleStop);process['on'](_0xa4ff('0x9a'),handleUncaughtException);
\ No newline at end of file
index 9c4388d..3958e67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa03d=['Outbound\x20Call','getDescriptions','voice','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Ring','agentconnectAt','Agent\x20Complete','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','UniqueId','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','queue','calleridnum','outbound'];(function(_0x52626f,_0x2026d7){var _0x2e582f=function(_0x57bbee){while(--_0x57bbee){_0x52626f['push'](_0x52626f['shift']());}};_0x2e582f(++_0x2026d7);}(_0xa03d,0xd7));var _0xda03=function(_0x5cdb06,_0x386a36){_0x5cdb06=_0x5cdb06-0x0;var _0x1ba4e8=_0xa03d[_0x5cdb06];return _0x1ba4e8;};'use strict';exports[_0xda03('0x0')]=function(_0x24485c,_0x13276f){var _0x428923=[{'type':_0xda03('0x1'),'content':_0xda03('0x2'),'variableName':null}];switch(_0x24485c[_0xda03('0x3')]()){case'voice':switch(_0x13276f[_0xda03('0x3')]()){case _0xda03('0x4'):_0x428923[_0xda03('0x5')]({'type':_0xda03('0x6'),'content':'','variableName':_0xda03('0x7')});_0x428923[_0xda03('0x5')]({'type':_0xda03('0x6'),'content':'','variableName':_0xda03('0x8')});break;case _0xda03('0x9'):_0x428923[_0xda03('0x5')]({'type':_0xda03('0x1'),'content':_0xda03('0xa'),'variableName':null});_0x428923['push']({'type':_0xda03('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x428923;};exports[_0xda03('0xb')]=function(_0xb37e90,_0x186f79){var _0x4ecd11=[];switch(_0xb37e90[_0xda03('0x3')]()){case _0xda03('0xc'):switch(_0x186f79[_0xda03('0x3')]()){case _0xda03('0x4'):_0x4ecd11=[{'type':_0xda03('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0xe'),'keyType':_0xda03('0x6'),'variableName':_0xda03('0x8')},{'type':'keyValue','content':'','key':_0xda03('0xf'),'keyType':_0xda03('0x6'),'variableName':_0xda03('0x10')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x11'),'keyType':_0xda03('0x6'),'variableName':_0xda03('0x12')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x13'),'keyType':_0xda03('0x6'),'variableName':'queue'},{'type':_0xda03('0xd'),'content':'','key':'UniqueId','keyType':_0xda03('0x6'),'variableName':_0xda03('0x14')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x15'),'keyType':_0xda03('0x6'),'variableName':'agentcalledAt'},{'type':_0xda03('0x1'),'content':_0xda03('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xda03('0x17'),'keyType':_0xda03('0x6'),'variableName':_0xda03('0x18')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x19'),'keyType':_0xda03('0x6'),'variableName':_0xda03('0x1a')},{'type':_0xda03('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x1b'),'keyType':'variable','variableName':'agentcalledAt'},{'type':_0xda03('0xd'),'content':'','key':'Agent\x20Connect','keyType':_0xda03('0x6'),'variableName':_0xda03('0x1c')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x1d'),'keyType':_0xda03('0x6'),'variableName':'agentcompleteAt'},{'type':'keyValue','content':'','key':_0xda03('0x1e'),'keyType':_0xda03('0x6'),'variableName':_0xda03('0x1f')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x20'),'keyType':'variable','variableName':'talktime'}];break;case _0xda03('0x9'):_0x4ecd11=[{'type':_0xda03('0x1'),'content':_0xda03('0x21'),'variableName':null},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x22'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':_0xda03('0x1a')},{'type':'keyValue','content':'','key':_0xda03('0x23'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':_0xda03('0x24')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x25'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':_0xda03('0x14')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x15'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':'starttime'},{'type':'string','content':_0xda03('0x26')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x27'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':_0xda03('0x28')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x29'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':_0xda03('0x2a')},{'type':'keyValue','content':'','key':'Duration','keyType':_0xda03('0x6'),'keyContent':'','variableName':_0xda03('0x2b')},{'type':_0xda03('0xd'),'content':'','key':_0xda03('0x2c'),'keyType':_0xda03('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x4ecd11;};
\ No newline at end of file
+var _0xa0d9=['calleridname','destexten','Queue','UniqueId','uniqueid','Date','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Ring','Agent\x20Connect','agentconnectAt','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','keyValue','Caller\x20Name'];(function(_0x2cd806,_0x25b230){var _0xf787af=function(_0xe9d5ea){while(--_0xe9d5ea){_0x2cd806['push'](_0x2cd806['shift']());}};_0xf787af(++_0x25b230);}(_0xa0d9,0x131));var _0x9a0d=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0xa0d9[_0x53ad58];return _0x554b03;};'use strict';exports[_0x9a0d('0x0')]=function(_0x23b2c1,_0x5556fc){var _0xb464e6=[{'type':'string','content':_0x9a0d('0x1'),'variableName':null}];switch(_0x23b2c1[_0x9a0d('0x2')]()){case _0x9a0d('0x3'):switch(_0x5556fc[_0x9a0d('0x2')]()){case _0x9a0d('0x4'):_0xb464e6[_0x9a0d('0x5')]({'type':_0x9a0d('0x6'),'content':'','variableName':_0x9a0d('0x7')});_0xb464e6[_0x9a0d('0x5')]({'type':_0x9a0d('0x6'),'content':'','variableName':_0x9a0d('0x8')});break;case _0x9a0d('0x9'):_0xb464e6[_0x9a0d('0x5')]({'type':_0x9a0d('0xa'),'content':_0x9a0d('0xb'),'variableName':null});_0xb464e6[_0x9a0d('0x5')]({'type':'variable','content':'','variableName':_0x9a0d('0xc')});break;}}return _0xb464e6;};exports['getDescriptions']=function(_0x25e2d8,_0x3407d2){var _0x502ddc=[];switch(_0x25e2d8[_0x9a0d('0x2')]()){case'voice':switch(_0x3407d2[_0x9a0d('0x2')]()){case'inbound':_0x502ddc=[{'type':_0x9a0d('0xa'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x9a0d('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0x8')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0xe'),'keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0xf')},{'type':'keyValue','content':'','key':'Call\x20To','keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0x10')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x12'),'keyType':'variable','variableName':_0x9a0d('0x13')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x14'),'keyType':_0x9a0d('0x6'),'variableName':'agentcalledAt'},{'type':_0x9a0d('0xa'),'content':_0x9a0d('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0x9a0d('0xd'),'content':'','key':'Agent\x20Name','keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0x16')},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0xc')},{'type':_0x9a0d('0xa'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x17'),'keyType':_0x9a0d('0x6'),'variableName':'agentcalledAt'},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x18'),'keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0x19')},{'type':_0x9a0d('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x9a0d('0x6'),'variableName':'agentcompleteAt'},{'type':_0x9a0d('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x9a0d('0x6'),'variableName':_0x9a0d('0x1a')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x1b'),'keyType':_0x9a0d('0x6'),'variableName':'talktime'}];break;case _0x9a0d('0x9'):_0x502ddc=[{'type':_0x9a0d('0xa'),'content':_0x9a0d('0x1c'),'variableName':null},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x1d'),'keyType':'variable','keyContent':'','variableName':_0x9a0d('0xc')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x1e'),'keyType':_0x9a0d('0x6'),'keyContent':'','variableName':_0x9a0d('0x1f')},{'type':_0x9a0d('0xd'),'content':'','key':'UniqueId','keyType':'variable','keyContent':'','variableName':_0x9a0d('0x13')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x14'),'keyType':'variable','keyContent':'','variableName':_0x9a0d('0x20')},{'type':_0x9a0d('0xa'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x21'),'keyType':_0x9a0d('0x6'),'keyContent':'','variableName':_0x9a0d('0x22')},{'type':'keyValue','content':'','key':_0x9a0d('0x23'),'keyType':_0x9a0d('0x6'),'keyContent':'','variableName':_0x9a0d('0x24')},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x25'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':_0x9a0d('0xd'),'content':'','key':_0x9a0d('0x26'),'keyType':_0x9a0d('0x6'),'keyContent':'','variableName':_0x9a0d('0x27')}];break;}}return _0x502ddc;};
\ No newline at end of file
index a813b91..8ec6135 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17b9=['length','count','having','order','contactName','DESC','getClosedOrderClause','getFilteredInteractions','rows','catch','query','clone','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseQueryParameters','where','body','contact','default','user','read','tags','checkAccountsRestrictions','group','i.id','ids','countFilteredInteractions'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x17b9,0xa8));var _0x917b=function(_0x3646e8,_0x9752ef){_0x3646e8=_0x3646e8-0x0;var _0x4fc8e8=_0x17b9[_0x3646e8];return _0x4fc8e8;};'use strict';var _=require(_0x917b('0x0'));var sqlUtils=require(_0x917b('0x1'));var utils=require(_0x917b('0x2'));exports[_0x917b('0x3')]=function(_0x8df2d6,_0x2be677,_0x35fb56,_0x164fb3,_0x487002){var _0x2672e9={'count':0x0,'rows':[]};var _0x523c96=sqlUtils[_0x917b('0x4')](_0x8df2d6,_0x35fb56,_0x2be677);if(_0x523c96){return Promise[_0x917b('0x5')](_0x2672e9);}var _0x34a9ef=sqlUtils[_0x917b('0x6')](_0x8df2d6);var _0x32af0d={};return Promise[_0x917b('0x5')]()[_0x917b('0x7')](function(){if(_0x2be677[_0x917b('0x8')]){return sqlUtils['parseAdvancedSearchFilter'](_0x2be677[_0x917b('0x8')],_0x487002);}else{return sqlUtils[_0x917b('0x9')](_0x8df2d6,_0x2be677,_0x487002);}})['then'](function(_0x49030e){_0x34a9ef[_0x917b('0xa')](_0x49030e[_0x917b('0xb')]);_0x34a9ef[_0x917b('0xa')](_0x49030e[_0x917b('0xc')]);_0x34a9ef['where'](_0x49030e[_0x917b('0xd')]);_0x34a9ef[_0x917b('0xa')](_0x49030e['fields']);_0x34a9ef['where'](_0x49030e['filter']);_0x34a9ef[_0x917b('0xa')](_0x49030e[_0x917b('0xe')]);_0x34a9ef['having'](_0x49030e[_0x917b('0xf')]);_0x32af0d=_0x49030e[_0x917b('0x10')];return sqlUtils[_0x917b('0x11')](_0x8df2d6,_0x35fb56,_0x2be677);})['then'](function(_0x5ce0a6){_0x34a9ef[_0x917b('0xa')](_0x5ce0a6);_0x34a9ef[_0x917b('0x12')](_0x917b('0x13'));var _0x260ba0=_0x2be677[_0x917b('0x8')]?_0x32af0d[_0x917b('0x14')]:_0x2be677['tag'];return sqlUtils[_0x917b('0x15')](_0x34a9ef,_0x260ba0);})[_0x917b('0x7')](function(_0x3ab25e){_0x2672e9['count']=_0x3ab25e[_0x917b('0x16')];if(_0x2672e9[_0x917b('0x17')]===0x0){return[];}_0x34a9ef[_0x917b('0x18')](_0x32af0d['clause']);if(_0x164fb3['order']){_0x164fb3[_0x917b('0x19')]['forEach'](function(_0x20ac3b){var _0x529967=_0x20ac3b[0x0]===_0x917b('0x1a')?_0x20ac3b[0x0]:'i.'+_0x20ac3b[0x0];_0x34a9ef[_0x917b('0x19')](_0x529967,_0x20ac3b[0x1]===_0x917b('0x1b')?![]:!![]);if(_0x20ac3b[0x0]==='closed'){var _0x151095=sqlUtils[_0x917b('0x1c')](_0x8df2d6,_0x2be677);_0x34a9ef[_0x917b('0x19')](_0x151095,_0x20ac3b[0x1]===_0x917b('0x1b')?![]:!![]);}});}return sqlUtils[_0x917b('0x1d')](_0x8df2d6,_0x34a9ef,_0x2be677,_0x164fb3);})['then'](function(_0x256a5e){_0x2672e9[_0x917b('0x1e')]=_0x256a5e;return _0x2672e9;})[_0x917b('0x1f')](function(_0x32d8f6){throw _0x32d8f6;});};exports['tracked']=function(_0x313c32,_0x4a49f2){return function(_0x5bef59,_0x17e71f,_0x281ca0){var _0x5a89d8=_0x5bef59[_0x917b('0xe')];var _0x17a6d7={};var _0x3e7a9=_0x5bef59[_0x917b('0x20')];if(_0x17a6d7){_0x17a6d7=_[_0x917b('0x21')](_0x5bef59[_0x917b('0xb')]);_0x17a6d7=_['omit'](_0x17a6d7,[_0x917b('0xb'),'html',_0x917b('0x22'),_0x917b('0x23'),_0x917b('0x24')]);}utils[_0x917b('0x25')](_0x5a89d8,_0x17a6d7,_0x3e7a9,_0x313c32,_0x4a49f2);_0x281ca0(null);};};
\ No newline at end of file
+var _0x505c=['closed','getClosedOrderClause','DESC','getFilteredInteractions','catch','query','clone','omit','html','phone','fax','mobile','updateUser','./sql-utils','findAll','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','body','contact','default','fields','filter','user','having','read','group','i.id','ids','tag','countFilteredInteractions','length','count','clause','order','forEach'];(function(_0x135717,_0x34b0dd){var _0x51040a=function(_0x4042cf){while(--_0x4042cf){_0x135717['push'](_0x135717['shift']());}};_0x51040a(++_0x34b0dd);}(_0x505c,0x1a7));var _0xc505=function(_0x1d38e0,_0x23dcaf){_0x1d38e0=_0x1d38e0-0x0;var _0x26e31b=_0x505c[_0x1d38e0];return _0x26e31b;};'use strict';var _=require('lodash');var sqlUtils=require(_0xc505('0x0'));var utils=require('./utils');exports[_0xc505('0x1')]=function(_0x18e4cc,_0xa54ef1,_0x53254a,_0xc3eeb4,_0xb8f22c){var _0x6715b4={'count':0x0,'rows':[]};var _0x1dbeb5=sqlUtils[_0xc505('0x2')](_0x18e4cc,_0x53254a,_0xa54ef1);if(_0x1dbeb5){return Promise[_0xc505('0x3')](_0x6715b4);}var _0x17ac74=sqlUtils[_0xc505('0x4')](_0x18e4cc);var _0x4c680a={};return Promise[_0xc505('0x3')]()[_0xc505('0x5')](function(){if(_0xa54ef1[_0xc505('0x6')]){return sqlUtils[_0xc505('0x7')](_0xa54ef1['search'],_0xb8f22c);}else{return sqlUtils[_0xc505('0x8')](_0x18e4cc,_0xa54ef1,_0xb8f22c);}})[_0xc505('0x5')](function(_0x2d3804){_0x17ac74[_0xc505('0x9')](_0x2d3804[_0xc505('0xa')]);_0x17ac74[_0xc505('0x9')](_0x2d3804[_0xc505('0xb')]);_0x17ac74[_0xc505('0x9')](_0x2d3804[_0xc505('0xc')]);_0x17ac74[_0xc505('0x9')](_0x2d3804[_0xc505('0xd')]);_0x17ac74['where'](_0x2d3804[_0xc505('0xe')]);_0x17ac74['where'](_0x2d3804[_0xc505('0xf')]);_0x17ac74[_0xc505('0x10')](_0x2d3804[_0xc505('0x11')]);_0x4c680a=_0x2d3804['tags'];return sqlUtils['checkAccountsRestrictions'](_0x18e4cc,_0x53254a,_0xa54ef1);})[_0xc505('0x5')](function(_0x332ede){_0x17ac74[_0xc505('0x9')](_0x332ede);_0x17ac74[_0xc505('0x12')](_0xc505('0x13'));var _0x4fe7cf=_0xa54ef1[_0xc505('0x6')]?_0x4c680a[_0xc505('0x14')]:_0xa54ef1[_0xc505('0x15')];return sqlUtils[_0xc505('0x16')](_0x17ac74,_0x4fe7cf);})[_0xc505('0x5')](function(_0x37d786){_0x6715b4['count']=_0x37d786[_0xc505('0x17')];if(_0x6715b4[_0xc505('0x18')]===0x0){return[];}_0x17ac74['having'](_0x4c680a[_0xc505('0x19')]);if(_0xc3eeb4[_0xc505('0x1a')]){_0xc3eeb4[_0xc505('0x1a')][_0xc505('0x1b')](function(_0x1e662a){var _0x4b2ef0=_0x1e662a[0x0]==='contactName'?_0x1e662a[0x0]:'i.'+_0x1e662a[0x0];_0x17ac74['order'](_0x4b2ef0,_0x1e662a[0x1]==='DESC'?![]:!![]);if(_0x1e662a[0x0]===_0xc505('0x1c')){var _0x40737d=sqlUtils[_0xc505('0x1d')](_0x18e4cc,_0xa54ef1);_0x17ac74[_0xc505('0x1a')](_0x40737d,_0x1e662a[0x1]===_0xc505('0x1e')?![]:!![]);}});}return sqlUtils[_0xc505('0x1f')](_0x18e4cc,_0x17ac74,_0xa54ef1,_0xc3eeb4);})[_0xc505('0x5')](function(_0x18006b){_0x6715b4['rows']=_0x18006b;return _0x6715b4;})[_0xc505('0x20')](function(_0x2c768d){throw _0x2c768d;});};exports['tracked']=function(_0x188dfb,_0x125143){return function(_0x26071f,_0x5edb57,_0xa4b7b3){var _0x40d612=_0x26071f['user'];var _0x42dc3b={};var _0x5ae39b=_0x26071f[_0xc505('0x21')];if(_0x42dc3b){_0x42dc3b=_[_0xc505('0x22')](_0x26071f['body']);_0x42dc3b=_[_0xc505('0x23')](_0x42dc3b,[_0xc505('0xa'),_0xc505('0x24'),_0xc505('0x25'),_0xc505('0x26'),_0xc505('0x27')]);}utils[_0xc505('0x28')](_0x40d612,_0x42dc3b,_0x5ae39b,_0x188dfb,_0x125143);_0xa4b7b3(null);};};
\ No newline at end of file
index 5fd3830..fe5ce9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d2d=['\x20=\x20?','resolve','then','fields','tag','filter','get','capitalize','chat','Websites','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','join','Interaction','Sequelize','SELECT','query','toString','merge','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.ContactId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','sequelize','groupBy','Setting','enableEmailPreview','all','COUNT(*)','unreadMessages','isEmpty','t.id\x20IN\x20?','QueryTypes','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','getAccountFK','role','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','users','u.id\x20=\x20ui.UserId','where','\x20IN\x20?','map','getInteractionsTables','interactions','accounts','a.id\x20=\x20i.','me.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','default','value','read','and','Contact','operator','$substring','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','text','tags','clause','ids','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','end','body','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x55fb86,_0x14fed1){_0x55fb86=_0x55fb86-0x0;var _0x283771=_0x1d2d[_0x55fb86];return _0x283771;};'use strict';var _=require(_0xd1d2('0x0'));var squel=require(_0xd1d2('0x1'));var as=require(_0xd1d2('0x2'));var qs=require(_0xd1d2('0x3'));var updateInteraction=require(_0xd1d2('0x4'))['updateInteraction'];var utils=require(_0xd1d2('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x5d3fac,_0x3caa72,_0x2bfabc){var _0x9852c0=![];var _0x269613=utils[_0xd1d2('0x6')](_0x5d3fac);if(_0x3caa72[_0xd1d2('0x7')]==='agent'&&!_0x2bfabc[_0xd1d2('0x8')]&&!_0x2bfabc[_0x269613]){_0x9852c0=!![];}return _0x9852c0;}function getTagsQuery(){return squel[_0xd1d2('0x9')]()[_0xd1d2('0xa')]('id')[_0xd1d2('0xa')](_0xd1d2('0xb'))[_0xd1d2('0xa')](_0xd1d2('0xc'))[_0xd1d2('0xd')](_0xd1d2('0xe'));}function getUsersQuery(_0x353f9b,_0x900ec){var _0x227d7f=utils[_0xd1d2('0xf')](_0x353f9b);var _0x5b21f4=_0xd1d2('0x10')+_0x353f9b+_0xd1d2('0x11');var _0x3ae4ae=squel[_0xd1d2('0x9')]()[_0xd1d2('0xa')](_0xd1d2('0x12'))[_0xd1d2('0xa')](_0xd1d2('0x13'))[_0xd1d2('0xa')](_0xd1d2('0x14')+_0x227d7f)['from'](_0x5b21f4,'ui')[_0xd1d2('0x15')](_0xd1d2('0x16'),'u',_0xd1d2('0x17'));if(_0x900ec['length']>0x0){_0x3ae4ae[_0xd1d2('0x18')](_0xd1d2('0x14')+_0x227d7f+_0xd1d2('0x19'),_[_0xd1d2('0x1a')](_0x900ec,'id'));}return _0x3ae4ae;}function getInteractionsQuery(_0xecac1f){var _0x2723b3=utils[_0xd1d2('0x1b')](_0xecac1f);var _0x57f2f9=utils['getAccountFK'](_0xecac1f);var _0x3be186=utils['getInteractionFK'](_0xecac1f);return squel[_0xd1d2('0x9')]()[_0xd1d2('0xd')](_0x2723b3[_0xd1d2('0x1c')],'i')[_0xd1d2('0x15')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd1d2('0x15')]('users','o','o.id\x20=\x20i.UserId')[_0xd1d2('0x15')](_0x2723b3[_0xd1d2('0x1d')],'a',_0xd1d2('0x1e')+_0x57f2f9)[_0xd1d2('0x15')](_0x2723b3['messages'],'me',_0xd1d2('0x1f')+_0x3be186+_0xd1d2('0x20'))[_0xd1d2('0x15')](_0x2723b3['interactionsTags'],'it','it.'+_0x3be186+_0xd1d2('0x20'))[_0xd1d2('0x15')](_0xd1d2('0xe'),'t',_0xd1d2('0x21'));}function getSqlClauses(){var _0x3f229c={'body':squel[_0xd1d2('0x22')](),'contact':squel[_0xd1d2('0x22')](),'default':squel['expr'](),'fields':squel[_0xd1d2('0x22')](),'filter':squel[_0xd1d2('0x22')](),'read':squel[_0xd1d2('0x22')](),'tags':{'clause':squel[_0xd1d2('0x22')](),'ids':null},'user':squel[_0xd1d2('0x22')]()};return _0x3f229c;}function parseTagParameter(_0x39e991){var _0x28b8be=squel[_0xd1d2('0x22')]();if(_0x39e991){var _0xe6ef3c=utils[_0xd1d2('0x23')](_0x39e991);_0xe6ef3c[_0xd1d2('0x24')](function(_0x4e1bc2){_0x28b8be['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4e1bc2+',%');});}return _0x28b8be;}function parseReadParameter(_0x133c6c){var _0x442375='';if(_0x133c6c){_0x442375=_0xd1d2('0x25');if(_0x133c6c==='1'){_0x442375=_0x442375[_0xd1d2('0x26')](_0xd1d2('0x27'),'=');}else{_0x442375=_0x442375['replace'](_0xd1d2('0x27'),'>');}}return _0x442375;}function parseSearchFilter(_0x41171c,_0x383947){var _0x4b4134=squel[_0xd1d2('0x22')]();if(_0x383947){var _0x1db17f=_0x383947[_0xd1d2('0x26')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd1d2('0x28')](_0x1db17f)){_0x4b4134['or'](_0xd1d2('0x29'),_0x1db17f+'%');if([_0xd1d2('0x2a'),_0xd1d2('0x2b')][_0xd1d2('0x2c')](_0x41171c)){_0x4b4134['or'](_0xd1d2('0x2d'),_0x1db17f+'%');}else if(_0x41171c===_0xd1d2('0x2e')){_0x4b4134['or'](_0xd1d2('0x2f'),_0x1db17f+'%');}else if(_0x41171c===_0xd1d2('0x30')){_0x4b4134['or'](_0xd1d2('0x31'),_0x1db17f+'%');}}else if(_0x41171c===_0xd1d2('0x32')&&qs[_0xd1d2('0x33')](_0x1db17f)){_0x4b4134['or'](_0xd1d2('0x34'),_0x1db17f+'%');}else{if(_0x41171c===_0xd1d2('0x32')){_0x4b4134['or'](_0xd1d2('0x35'),qs[_0xd1d2('0x36')](_0x1db17f))['or'](_0xd1d2('0x37'),qs[_0xd1d2('0x36')](_0x1db17f));}else{if(_0x41171c!=='fax'){_0x4b4134['or'](_0xd1d2('0x38'),qs[_0xd1d2('0x36')](_0x1db17f));}_0x4b4134['or'](_0xd1d2('0x39'),_0x1db17f+'%');}}}return _0x4b4134;}function parseAdvancedSearchFilter(_0x573d27,_0x2ded64){var _0x516049=getSqlClauses();var _0x57a7fb=as[_0xd1d2('0x3a')](_0x573d27);var _0x103c5f=_0x57a7fb[_0xd1d2('0x3b')];for(var _0x1d00e0=0x0;_0x1d00e0<_0x57a7fb[_0xd1d2('0x3c')][_0xd1d2('0x3d')];_0x1d00e0++){var _0x56f48e=_0x57a7fb[_0xd1d2('0x3c')][_0x1d00e0];var _0x168eb8='i';var _0x5bdf40=_[_0xd1d2('0x3e')](_0x2ded64,[_0xd1d2('0xb'),_0x56f48e[_0xd1d2('0xa')]]);if(_0x5bdf40){var _0x2f55a1=as['buildExpression'](_0x168eb8,_0x5bdf40['type'],_0x56f48e);_0x516049[_0xd1d2('0x3f')][_0x103c5f](_0x2f55a1['text'],_0x2f55a1['value']['start'],_0x2f55a1[_0xd1d2('0x40')]['end']);}else{switch(_0x56f48e[_0xd1d2('0xa')]){case'unreadMessages':var _0x47996a=parseReadParameter(_0x56f48e['value']);_0x516049[_0xd1d2('0x41')][_0xd1d2('0x42')](_0x47996a);break;case _0xd1d2('0x43'):if(_0x56f48e[_0xd1d2('0x44')]===_0xd1d2('0x45')){if(_0x56f48e[_0xd1d2('0x40')][_0xd1d2('0x46')]('\x20')[_0xd1d2('0x3d')]>0x1){_0x516049[_0xd1d2('0x47')][_0x103c5f](_0xd1d2('0x48'),qs[_0xd1d2('0x36')](_0x56f48e[_0xd1d2('0x40')]),null);}else{var _0x1c2835='%'+_0x56f48e[_0xd1d2('0x40')]+'%';_0x516049['contact'][_0x103c5f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1c2835,_0x1c2835,_0x1c2835);}}else{_0x5bdf40=_[_0xd1d2('0x3e')](_0x2ded64,[_0xd1d2('0xb'),_0xd1d2('0x49')]);_0x56f48e['field']='ContactId';_0x2f55a1=as[_0xd1d2('0x4a')](_0x168eb8,_0x5bdf40[_0xd1d2('0x4b')],_0x56f48e);_0x516049['contact'][_0x103c5f](_0x2f55a1[_0xd1d2('0x4c')],_0x2f55a1['value']['start'],_0x2f55a1[_0xd1d2('0x40')]['end']);}break;case'Tag':var _0x1825f2=_0x56f48e[_0xd1d2('0x40')][_0xd1d2('0x46')](',')['map'](function(_0x2ba87b){return Number(_0x2ba87b);});var _0x192fa4=parseTagParameter(_0x1825f2);_0x516049[_0xd1d2('0x4d')][_0xd1d2('0x4e')]['and'](_0x192fa4);_0x516049[_0xd1d2('0x4d')][_0xd1d2('0x4f')]=_0x1825f2;break;case'User':if(_0x56f48e[_0xd1d2('0x44')]==='$substring'){_0x516049[_0xd1d2('0x50')][_0x103c5f](_0xd1d2('0x51'),'%'+_0x56f48e[_0xd1d2('0x40')]+'%',null);}else{_0x5bdf40=_[_0xd1d2('0x3e')](_0x2ded64,[_0xd1d2('0xb'),'UserId']);_0x56f48e['field']=_0xd1d2('0x52');_0x2f55a1=as[_0xd1d2('0x4a')](_0x168eb8,_0x5bdf40['type'],_0x56f48e);_0x516049[_0xd1d2('0x50')][_0x103c5f](_0x2f55a1[_0xd1d2('0x4c')],_0x2f55a1[_0xd1d2('0x40')][_0xd1d2('0x53')],_0x2f55a1[_0xd1d2('0x40')][_0xd1d2('0x54')]);}break;case _0xd1d2('0x55'):case'plainBody':_0x2f55a1=as[_0xd1d2('0x4a')]('me',null,_0x56f48e);_0x516049[_0xd1d2('0x55')][_0x103c5f](_0x2f55a1['text'],_0x2f55a1[_0xd1d2('0x40')][_0xd1d2('0x53')],_0x2f55a1['value']['end']);break;}}}return _0x516049;}function parseModelFields(_0x3d4fe3,_0x182ea8,_0x4cb376){var _0x21fdfb=utils[_0xd1d2('0x6')](_0x3d4fe3);var _0x2553df=squel[_0xd1d2('0x22')]();var _0x404ad2=_(_0x182ea8)['keys']()['map'](function(_0x314af3){return _['some'](_0x4cb376,[_0xd1d2('0xb'),_0x314af3])?_0x314af3:undefined;})[_0xd1d2('0x56')]()['value']();if(_0x404ad2[_0xd1d2('0x3d')]>0x0){_0x404ad2[_0xd1d2('0x24')](function(_0x4e780c){if(_0x4e780c===_0x21fdfb){_0x2553df['and']('i.'+_0x21fdfb+_0xd1d2('0x19'),[][_0xd1d2('0x57')](_0x182ea8[_0x4e780c]));}else if(_0x4e780c===_0xd1d2('0x58')){var _0xfd8024=JSON[_0xd1d2('0x59')](_0x182ea8[_0x4e780c])[_0xd1d2('0x5a')];var _0x1f6150=JSON[_0xd1d2('0x59')](_0x182ea8[_0x4e780c])[_0xd1d2('0x5b')];_0x2553df['and'](_0xd1d2('0x5c'),_0xfd8024,_0x1f6150);}else{if(_0x182ea8[_0x4e780c]==='null'){_0x2553df['and']('i.'+_0x4e780c+_0xd1d2('0x5d'));}else{_0x2553df[_0xd1d2('0x42')]('i.'+_0x4e780c+_0xd1d2('0x5e'),_0x182ea8[_0x4e780c]);}}});}return _0x2553df;}function parseQueryParameters(_0x47417f,_0x215dea,_0x459209){var _0x35a51b=getSqlClauses();return Promise[_0xd1d2('0x5f')]()[_0xd1d2('0x60')](function(){return parseModelFields(_0x47417f,_0x215dea,_0x459209);})[_0xd1d2('0x60')](function(_0x28173a){_0x35a51b[_0xd1d2('0x61')][_0xd1d2('0x42')](_0x28173a);return parseReadParameter(_0x215dea['read']);})['then'](function(_0x367f3c){_0x35a51b[_0xd1d2('0x41')][_0xd1d2('0x42')](_0x367f3c);return parseTagParameter(_0x215dea[_0xd1d2('0x62')]);})[_0xd1d2('0x60')](function(_0x1d1d31){_0x35a51b[_0xd1d2('0x4d')][_0xd1d2('0x4e')][_0xd1d2('0x42')](_0x1d1d31);return parseSearchFilter(_0x47417f,_0x215dea[_0xd1d2('0x63')]);})[_0xd1d2('0x60')](function(_0x54406e){_0x35a51b['filter']=_0x54406e;return _0x35a51b;});}function checkAccountsRestrictions(_0x306242,_0x321bc8,_0x3d1da1){var _0x1c6a46=utils['getAccountFK'](_0x306242);var _0x17e149=_0xd1d2('0x64')+_[_0xd1d2('0x65')](_0x306242)+(_0x306242===_0xd1d2('0x66')?_0xd1d2('0x67'):_0xd1d2('0x68'));var _0x1c04e4=squel['expr']();return Promise[_0xd1d2('0x5f')]()[_0xd1d2('0x60')](function(){if(_0x3d1da1[_0xd1d2('0x8')]&&_0x321bc8['role']==='agent'){return _0x321bc8[_0x17e149]({'attributes':['id'],'raw':!![]});}})[_0xd1d2('0x60')](function(_0x3cd7c7){if(_0x3cd7c7){if(_0x3cd7c7[_0xd1d2('0x3d')]===0x0){_0x1c04e4[_0xd1d2('0x42')]('i.'+_0x1c6a46+'\x20IS\x20NULL');}else{_0x1c04e4[_0xd1d2('0x42')]('i.'+_0x1c6a46+_0xd1d2('0x19'),_[_0xd1d2('0x1a')](_0x3cd7c7,'id'));}}else if(!_0x3d1da1[_0x1c6a46]){_0x1c04e4['and']('i.'+_0x1c6a46+_0xd1d2('0x69'));}})[_0xd1d2('0x60')](function(){return _0x1c04e4;});}function getClosedOrderClause(_0x4842f1,_0x69a9e2){var _0x3799b7='';var _0x12201f=[_0xd1d2('0x6a'),'i.secondDisposition',_0xd1d2('0x6b')];if(_0x4842f1===_0xd1d2('0x32')){_0x12201f[_0xd1d2('0x6c')](_0xd1d2('0x6d'));}if(_0x69a9e2[_0xd1d2('0x6e')]==='0'&&_0x4842f1==='mail'){_0x3799b7='i.substatus';}else{if(_0x69a9e2['closed']==='1'){_0x12201f['shift']();}_0x3799b7='CONCAT_WS(\x27\x27,\x20'+_0x12201f[_0xd1d2('0x6f')](',\x20')+')';}return _0x3799b7;}function getFilteredInteractions(_0x271e4a,_0x386b51,_0x5f5043,_0x42d6b8){var _0x17c4eb=utils[_0xd1d2('0xf')](_0x271e4a);var _0x580d83=_[_0xd1d2('0x65')](_0x271e4a)+_0xd1d2('0x70');var _0x47422d=[];var _0x4a42d9=getTagsQuery();var _0x43b43c={'type':db[_0xd1d2('0x71')]['QueryTypes'][_0xd1d2('0x72')],'raw':!![]};var _0x1c3c36=[];var _0x516a57=[];return db['sequelize'][_0xd1d2('0x73')](_0x4a42d9[_0xd1d2('0x74')](),_0x43b43c)[_0xd1d2('0x60')](function(_0x14cd07){_0x47422d=_['keyBy'](_0x14cd07,'id');_0x43b43c=_[_0xd1d2('0x75')](_0x43b43c,{'model':db[_0x580d83],'mapToModel':!![],'nest':!![]});if(_0x5f5043[_0xd1d2('0x61')]){_0x42d6b8[_0xd1d2('0x76')][_0xd1d2('0x24')](function(_0x5d537e){_0x386b51[_0xd1d2('0xa')]('i.'+_0x5d537e);});}else{_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x77'),'unreadMessages');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x78'),'Account.key');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x79'),_0xd1d2('0x7a'));if(_0x271e4a===_0xd1d2('0x32')){_0x386b51[_0xd1d2('0xa')]('a.email',_0xd1d2('0x7b'));_0x386b51['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x386b51['field'](_0xd1d2('0x7c'));_0x386b51['field'](_0xd1d2('0x7d'));_0x386b51['field'](_0xd1d2('0x7e'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x7f'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x80'));_0x386b51[_0xd1d2('0xa')]('i.attach');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x81'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x82'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x83'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x6b'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x84'));_0x386b51['field'](_0xd1d2('0x6a'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x6d'));_0x386b51[_0xd1d2('0xa')]('i.to');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x85'));_0x386b51[_0xd1d2('0xa')]('i.MailAccountId');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x86'));}else if(_0x271e4a==='openchannel'){_0x386b51['field'](_0xd1d2('0x87'),_0xd1d2('0x88'));}else{_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x89'),_0xd1d2('0x88'));}if(_0x271e4a!==_0xd1d2('0x32')){_0x386b51[_0xd1d2('0xa')]('i.*');}_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x8a'),_0xd1d2('0x8b'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x8c'),_0xd1d2('0x8d'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x8e'),_0xd1d2('0x8f'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x90'),_0xd1d2('0x91'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x92'),'Contact.mobile');_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x93'),_0xd1d2('0x94'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x95'),_0xd1d2('0x96'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x97'),_0xd1d2('0x98'));_0x386b51[_0xd1d2('0xa')](_0xd1d2('0x99'),_0xd1d2('0x9a'));}if(_0x42d6b8[_0xd1d2('0x9b')]){_0x386b51['limit'](_0x42d6b8[_0xd1d2('0x9b')]);}if(_0x42d6b8[_0xd1d2('0x9c')]){_0x386b51[_0xd1d2('0x9c')](_0x42d6b8[_0xd1d2('0x9c')]);}return db[_0xd1d2('0x9d')][_0xd1d2('0x73')](_0x386b51[_0xd1d2('0x74')](),_0x43b43c);})[_0xd1d2('0x60')](function(_0x28a351){_0x1c3c36=_0x28a351;var _0x59c11a=getUsersQuery(_0x271e4a,_0x1c3c36);return db[_0xd1d2('0x9d')][_0xd1d2('0x73')](_0x59c11a['toString'](),_0x43b43c);})[_0xd1d2('0x60')](function(_0x234262){_0x516a57=_[_0xd1d2('0x9e')](_0x234262,_0x17c4eb);if(_0x271e4a===_0xd1d2('0x32')){return db[_0xd1d2('0x9f')]['findOne']({'attributes':[_0xd1d2('0xa0')],'raw':!![]});}})[_0xd1d2('0x60')](function(_0x2b4bb8){var _0x720693=_0x2b4bb8?_0x2b4bb8['enableEmailPreview']:undefined;var _0x68f8ba=_0x1c3c36[_0xd1d2('0x1a')](function(_0x3b7fc5){return updateInteraction(_0x3b7fc5,_0x47422d,_0x516a57,_0x720693);});return Promise[_0xd1d2('0xa1')](_0x68f8ba);});}function countFilteredInteractions(_0x39c9f1,_0x18bd6d){var _0x1aa0a5=_0x39c9f1['clone']();_0x1aa0a5[_0xd1d2('0xa')](_0xd1d2('0xa2'));_0x1aa0a5[_0xd1d2('0xa')](_0xd1d2('0x77'),_0xd1d2('0xa3'));var _0x30b8e7=utils[_0xd1d2('0x23')](_0x18bd6d);if(!_[_0xd1d2('0xa4')](_0x30b8e7)){_0x1aa0a5[_0xd1d2('0x18')](_0xd1d2('0xa5'),_0x30b8e7);}var _0x1cad85={'type':db[_0xd1d2('0x71')][_0xd1d2('0xa6')][_0xd1d2('0x72')],'raw':!![]};return db[_0xd1d2('0x9d')][_0xd1d2('0x73')](_0x1aa0a5[_0xd1d2('0x74')](),_0x1cad85);}module['exports']={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
+var _0x99e9=['c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','SELECT','exports','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','./utils','../../mysqldb','getAccountFK','role','agent','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','left_join','u.id\x20=\x20ui.UserId','\x20IN\x20?','map','getInteractionsTables','interactions','cm_contacts','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','expr','getSelectedTags','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','sms','whatsapp','includes','fax','i.from\x20LIKE\x20?','mail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','length','default','value','unreadMessages','read','and','Contact','operator','split','contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','end','Tag','tags','clause','User','user','UserId','buildExpression','compact','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','capitalize','chat','Websites','Accounts','search','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','unshift','i.substatus','closed','shift','Interaction','Sequelize','QueryTypes','sequelize','query','toString','keyBy','forEach','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','i.UserId','openchannel','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','c.lastName','c.email'];(function(_0xa76cbe,_0x53b6b6){var _0x4e47a8=function(_0x452d75){while(--_0x452d75){_0xa76cbe['push'](_0xa76cbe['shift']());}};_0x4e47a8(++_0x53b6b6);}(_0x99e9,0xb4));var _0x999e=function(_0x52a7e1,_0x189bf3){_0x52a7e1=_0x52a7e1-0x0;var _0x4f4495=_0x99e9[_0x52a7e1];return _0x4f4495;};'use strict';var _=require('lodash');var squel=require(_0x999e('0x0'));var as=require(_0x999e('0x1'));var qs=require(_0x999e('0x2'));var updateInteraction=require(_0x999e('0x3'))['updateInteraction'];var utils=require(_0x999e('0x4'));var db=require(_0x999e('0x5'))['db'];function skipInteractionsQuery(_0x3aac27,_0x4e2112,_0x296411){var _0x502307=![];var _0x25421f=utils[_0x999e('0x6')](_0x3aac27);if(_0x4e2112[_0x999e('0x7')]===_0x999e('0x8')&&!_0x296411['search']&&!_0x296411[_0x25421f]){_0x502307=!![];}return _0x502307;}function getTagsQuery(){return squel[_0x999e('0x9')]()[_0x999e('0xa')]('id')[_0x999e('0xa')](_0x999e('0xb'))[_0x999e('0xa')](_0x999e('0xc'))[_0x999e('0xd')](_0x999e('0xe'));}function getUsersQuery(_0x3cb1c2,_0xf40130){var _0x9368cf=utils[_0x999e('0xf')](_0x3cb1c2);var _0x4246b1=_0x999e('0x10')+_0x3cb1c2+_0x999e('0x11');var _0xdb587b=squel[_0x999e('0x9')]()['field'](_0x999e('0x12'))['field'](_0x999e('0x13'))[_0x999e('0xa')](_0x999e('0x14')+_0x9368cf)['from'](_0x4246b1,'ui')[_0x999e('0x15')]('users','u',_0x999e('0x16'));if(_0xf40130['length']>0x0){_0xdb587b['where'](_0x999e('0x14')+_0x9368cf+_0x999e('0x17'),_[_0x999e('0x18')](_0xf40130,'id'));}return _0xdb587b;}function getInteractionsQuery(_0x289e0e){var _0x1e9bff=utils[_0x999e('0x19')](_0x289e0e);var _0x4aac66=utils['getAccountFK'](_0x289e0e);var _0x4fcdfb=utils[_0x999e('0xf')](_0x289e0e);return squel[_0x999e('0x9')]()[_0x999e('0xd')](_0x1e9bff[_0x999e('0x1a')],'i')[_0x999e('0x15')](_0x999e('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x999e('0x1c'),'o',_0x999e('0x1d'))[_0x999e('0x15')](_0x1e9bff['accounts'],'a',_0x999e('0x1e')+_0x4aac66)[_0x999e('0x15')](_0x1e9bff[_0x999e('0x1f')],'me',_0x999e('0x20')+_0x4fcdfb+_0x999e('0x21'))[_0x999e('0x15')](_0x1e9bff[_0x999e('0x22')],'it','it.'+_0x4fcdfb+'\x20=\x20i.id')[_0x999e('0x15')](_0x999e('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x452acd={'body':squel[_0x999e('0x23')](),'contact':squel[_0x999e('0x23')](),'default':squel[_0x999e('0x23')](),'fields':squel[_0x999e('0x23')](),'filter':squel[_0x999e('0x23')](),'read':squel['expr'](),'tags':{'clause':squel[_0x999e('0x23')](),'ids':null},'user':squel[_0x999e('0x23')]()};return _0x452acd;}function parseTagParameter(_0x11068e){var _0x12b9ad=squel[_0x999e('0x23')]();if(_0x11068e){var _0x1d2dc6=utils[_0x999e('0x24')](_0x11068e);_0x1d2dc6['forEach'](function(_0x28f803){_0x12b9ad['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x28f803+',%');});}return _0x12b9ad;}function parseReadParameter(_0x4fed13){var _0x3dff6b='';if(_0x4fed13){_0x3dff6b=_0x999e('0x25');if(_0x4fed13==='1'){_0x3dff6b=_0x3dff6b[_0x999e('0x26')]('{OPERATOR}','=');}else{_0x3dff6b=_0x3dff6b[_0x999e('0x26')](_0x999e('0x27'),'>');}}return _0x3dff6b;}function parseSearchFilter(_0x22cd81,_0x4339bf){var _0x15dca1=squel[_0x999e('0x23')]();if(_0x4339bf){var _0x82e067=_0x4339bf[_0x999e('0x26')]('\x5c','\x5c\x5c')[_0x999e('0x26')](/'/g,'\x27\x27');if(qs[_0x999e('0x28')](_0x82e067)){_0x15dca1['or']('i.id\x20LIKE\x20?',_0x82e067+'%');if([_0x999e('0x29'),_0x999e('0x2a')][_0x999e('0x2b')](_0x22cd81)){_0x15dca1['or']('i.phone\x20LIKE\x20?',_0x82e067+'%');}else if(_0x22cd81===_0x999e('0x2c')){_0x15dca1['or']('i.fax\x20LIKE\x20?',_0x82e067+'%');}else if(_0x22cd81==='openchannel'){_0x15dca1['or'](_0x999e('0x2d'),_0x82e067+'%');}}else if(_0x22cd81===_0x999e('0x2e')&&qs['isEmail'](_0x82e067)){_0x15dca1['or']('c.email\x20LIKE\x20?',_0x82e067+'%');}else{if(_0x22cd81===_0x999e('0x2e')){_0x15dca1['or'](_0x999e('0x2f'),qs[_0x999e('0x30')](_0x82e067))['or'](_0x999e('0x31'),qs['getFullTextValue'](_0x82e067));}else{if(_0x22cd81!==_0x999e('0x2c')){_0x15dca1['or'](_0x999e('0x32'),qs[_0x999e('0x30')](_0x82e067));}_0x15dca1['or'](_0x999e('0x33'),_0x82e067+'%');}}}return _0x15dca1;}function parseAdvancedSearchFilter(_0x4f861f,_0x4ebcb7){var _0x44fb32=getSqlClauses();var _0x490694=as[_0x999e('0x34')](_0x4f861f);var _0x2fda68=_0x490694[_0x999e('0x35')];for(var _0x14c9e0=0x0;_0x14c9e0<_0x490694['conditions'][_0x999e('0x36')];_0x14c9e0++){var _0x28df26=_0x490694['conditions'][_0x14c9e0];var _0x4808d1='i';var _0x327866=_['find'](_0x4ebcb7,[_0x999e('0xb'),_0x28df26['field']]);if(_0x327866){var _0x518083=as['buildExpression'](_0x4808d1,_0x327866['type'],_0x28df26);_0x44fb32[_0x999e('0x37')][_0x2fda68](_0x518083['text'],_0x518083[_0x999e('0x38')]['start'],_0x518083['value']['end']);}else{switch(_0x28df26[_0x999e('0xa')]){case _0x999e('0x39'):var _0xd529df=parseReadParameter(_0x28df26[_0x999e('0x38')]);_0x44fb32[_0x999e('0x3a')][_0x999e('0x3b')](_0xd529df);break;case _0x999e('0x3c'):if(_0x28df26[_0x999e('0x3d')]==='$substring'){if(_0x28df26[_0x999e('0x38')][_0x999e('0x3e')]('\x20')[_0x999e('0x36')]>0x1){_0x44fb32[_0x999e('0x3f')][_0x2fda68]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x999e('0x30')](_0x28df26['value']),null);}else{var _0x36194c='%'+_0x28df26[_0x999e('0x38')]+'%';_0x44fb32[_0x999e('0x3f')][_0x2fda68](_0x999e('0x40'),_0x36194c,_0x36194c,_0x36194c);}}else{_0x327866=_['find'](_0x4ebcb7,[_0x999e('0xb'),_0x999e('0x41')]);_0x28df26[_0x999e('0xa')]='ContactId';_0x518083=as['buildExpression'](_0x4808d1,_0x327866[_0x999e('0x42')],_0x28df26);_0x44fb32[_0x999e('0x3f')][_0x2fda68](_0x518083[_0x999e('0x43')],_0x518083[_0x999e('0x38')][_0x999e('0x44')],_0x518083[_0x999e('0x38')][_0x999e('0x45')]);}break;case _0x999e('0x46'):var _0x2576da=_0x28df26[_0x999e('0x38')]['split'](',')['map'](function(_0xa5742d){return Number(_0xa5742d);});var _0x30a60d=parseTagParameter(_0x2576da);_0x44fb32[_0x999e('0x47')][_0x999e('0x48')][_0x999e('0x3b')](_0x30a60d);_0x44fb32[_0x999e('0x47')]['ids']=_0x2576da;break;case _0x999e('0x49'):if(_0x28df26['operator']==='$substring'){_0x44fb32[_0x999e('0x4a')][_0x2fda68]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x28df26['value']+'%',null);}else{_0x327866=_['find'](_0x4ebcb7,['name',_0x999e('0x4b')]);_0x28df26[_0x999e('0xa')]='UserId';_0x518083=as[_0x999e('0x4c')](_0x4808d1,_0x327866[_0x999e('0x42')],_0x28df26);_0x44fb32[_0x999e('0x4a')][_0x2fda68](_0x518083['text'],_0x518083['value'][_0x999e('0x44')],_0x518083[_0x999e('0x38')][_0x999e('0x45')]);}break;case'body':case'plainBody':_0x518083=as['buildExpression']('me',null,_0x28df26);_0x44fb32['body'][_0x2fda68](_0x518083[_0x999e('0x43')],_0x518083['value']['start'],_0x518083[_0x999e('0x38')][_0x999e('0x45')]);break;}}}return _0x44fb32;}function parseModelFields(_0x5843f1,_0xa50dc6,_0x1a5c3d){var _0x5603a8=utils[_0x999e('0x6')](_0x5843f1);var _0x58be33=squel[_0x999e('0x23')]();var _0x42dfea=_(_0xa50dc6)['keys']()[_0x999e('0x18')](function(_0xdc94ea){return _['some'](_0x1a5c3d,['name',_0xdc94ea])?_0xdc94ea:undefined;})[_0x999e('0x4d')]()['value']();if(_0x42dfea['length']>0x0){_0x42dfea['forEach'](function(_0x1f85dd){if(_0x1f85dd===_0x5603a8){_0x58be33[_0x999e('0x3b')]('i.'+_0x5603a8+_0x999e('0x17'),[][_0x999e('0x4e')](_0xa50dc6[_0x1f85dd]));}else if(_0x1f85dd===_0x999e('0x4f')){var _0x14c01c=JSON['parse'](_0xa50dc6[_0x1f85dd])[_0x999e('0x50')];var _0x2317c5=JSON['parse'](_0xa50dc6[_0x1f85dd])[_0x999e('0x51')];_0x58be33[_0x999e('0x3b')](_0x999e('0x52'),_0x14c01c,_0x2317c5);}else{if(_0xa50dc6[_0x1f85dd]===_0x999e('0x53')){_0x58be33[_0x999e('0x3b')]('i.'+_0x1f85dd+_0x999e('0x54'));}else{_0x58be33[_0x999e('0x3b')]('i.'+_0x1f85dd+_0x999e('0x55'),_0xa50dc6[_0x1f85dd]);}}});}return _0x58be33;}function parseQueryParameters(_0x290c7a,_0x53932a,_0x9f3f7a){var _0x45b61a=getSqlClauses();return Promise[_0x999e('0x56')]()[_0x999e('0x57')](function(){return parseModelFields(_0x290c7a,_0x53932a,_0x9f3f7a);})['then'](function(_0x392324){_0x45b61a[_0x999e('0x58')][_0x999e('0x3b')](_0x392324);return parseReadParameter(_0x53932a[_0x999e('0x3a')]);})[_0x999e('0x57')](function(_0xdb368f){_0x45b61a[_0x999e('0x3a')][_0x999e('0x3b')](_0xdb368f);return parseTagParameter(_0x53932a['tag']);})['then'](function(_0xd118f9){_0x45b61a[_0x999e('0x47')][_0x999e('0x48')][_0x999e('0x3b')](_0xd118f9);return parseSearchFilter(_0x290c7a,_0x53932a[_0x999e('0x59')]);})[_0x999e('0x57')](function(_0x23c5fb){_0x45b61a['filter']=_0x23c5fb;return _0x45b61a;});}function checkAccountsRestrictions(_0x5579c4,_0xb9d60b,_0x55ae5){var _0x36c3dc=utils[_0x999e('0x6')](_0x5579c4);var _0x25176f='get'+_[_0x999e('0x5a')](_0x5579c4)+(_0x5579c4===_0x999e('0x5b')?_0x999e('0x5c'):_0x999e('0x5d'));var _0x502c9=squel[_0x999e('0x23')]();return Promise[_0x999e('0x56')]()['then'](function(){if(_0x55ae5[_0x999e('0x5e')]&&_0xb9d60b['role']===_0x999e('0x8')){return _0xb9d60b[_0x25176f]({'attributes':['id'],'raw':!![]});}})[_0x999e('0x57')](function(_0x2ce0b3){if(_0x2ce0b3){if(_0x2ce0b3[_0x999e('0x36')]===0x0){_0x502c9[_0x999e('0x3b')]('i.'+_0x36c3dc+_0x999e('0x54'));}else{_0x502c9['and']('i.'+_0x36c3dc+_0x999e('0x17'),_[_0x999e('0x18')](_0x2ce0b3,'id'));}}else if(!_0x55ae5[_0x36c3dc]){_0x502c9[_0x999e('0x3b')]('i.'+_0x36c3dc+_0x999e('0x5f'));}})[_0x999e('0x57')](function(){return _0x502c9;});}function getClosedOrderClause(_0x121110,_0x23fd58){var _0x3d398c='';var _0x455b0e=[_0x999e('0x60'),_0x999e('0x61'),_0x999e('0x62')];if(_0x121110===_0x999e('0x2e')){_0x455b0e[_0x999e('0x63')](_0x999e('0x64'));}if(_0x23fd58['closed']==='0'&&_0x121110===_0x999e('0x2e')){_0x3d398c=_0x999e('0x64');}else{if(_0x23fd58[_0x999e('0x65')]==='1'){_0x455b0e[_0x999e('0x66')]();}_0x3d398c='CONCAT_WS(\x27\x27,\x20'+_0x455b0e['join'](',\x20')+')';}return _0x3d398c;}function getFilteredInteractions(_0x21c8be,_0x2d398f,_0x67267d,_0x33abdc){var _0x1c9b64=utils[_0x999e('0xf')](_0x21c8be);var _0x1596bb=_[_0x999e('0x5a')](_0x21c8be)+_0x999e('0x67');var _0x5d4f50=[];var _0xe137c1=getTagsQuery();var _0x47c693={'type':db[_0x999e('0x68')][_0x999e('0x69')]['SELECT'],'raw':!![]};var _0x61ba8=[];var _0x175904=[];return db[_0x999e('0x6a')][_0x999e('0x6b')](_0xe137c1[_0x999e('0x6c')](),_0x47c693)['then'](function(_0x1807b7){_0x5d4f50=_[_0x999e('0x6d')](_0x1807b7,'id');_0x47c693=_['merge'](_0x47c693,{'model':db[_0x1596bb],'mapToModel':!![],'nest':!![]});if(_0x67267d['fields']){_0x33abdc['attributes'][_0x999e('0x6e')](function(_0x3f37e8){_0x2d398f[_0x999e('0xa')]('i.'+_0x3f37e8);});}else{_0x2d398f[_0x999e('0xa')](_0x999e('0x6f'),'unreadMessages');_0x2d398f['field']('a.key',_0x999e('0x70'));_0x2d398f['field']('a.mandatoryDisposition',_0x999e('0x71'));if(_0x21c8be==='mail'){_0x2d398f[_0x999e('0xa')](_0x999e('0x72'),_0x999e('0x73'));_0x2d398f['field'](_0x999e('0x74'),_0x999e('0x75'));_0x2d398f[_0x999e('0xa')](_0x999e('0x76'));_0x2d398f[_0x999e('0xa')](_0x999e('0x77'));_0x2d398f[_0x999e('0xa')]('i.updatedAt');_0x2d398f[_0x999e('0xa')](_0x999e('0x78'));_0x2d398f[_0x999e('0xa')]('i.closedAt');_0x2d398f[_0x999e('0xa')](_0x999e('0x79'));_0x2d398f['field'](_0x999e('0x7a'));_0x2d398f[_0x999e('0xa')](_0x999e('0x7b'));_0x2d398f[_0x999e('0xa')](_0x999e('0x7c'));_0x2d398f[_0x999e('0xa')](_0x999e('0x62'));_0x2d398f[_0x999e('0xa')](_0x999e('0x61'));_0x2d398f['field'](_0x999e('0x60'));_0x2d398f[_0x999e('0xa')](_0x999e('0x64'));_0x2d398f['field'](_0x999e('0x7d'));_0x2d398f['field'](_0x999e('0x7e'));_0x2d398f[_0x999e('0xa')](_0x999e('0x7f'));_0x2d398f['field'](_0x999e('0x80'));}else if(_0x21c8be===_0x999e('0x81')){_0x2d398f[_0x999e('0xa')](_0x999e('0x82'),_0x999e('0x75'));}else{_0x2d398f[_0x999e('0xa')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x999e('0x75'));}if(_0x21c8be!=='mail'){_0x2d398f[_0x999e('0xa')]('i.*');}_0x2d398f['field'](_0x999e('0x83'),'Contact.firstName');_0x2d398f[_0x999e('0xa')](_0x999e('0x84'),'Contact.lastName');_0x2d398f[_0x999e('0xa')](_0x999e('0x85'),'Contact.email');_0x2d398f[_0x999e('0xa')](_0x999e('0x86'),_0x999e('0x87'));_0x2d398f[_0x999e('0xa')](_0x999e('0x88'),_0x999e('0x89'));_0x2d398f[_0x999e('0xa')](_0x999e('0x8a'),'Contact.fax');_0x2d398f['field'](_0x999e('0x8b'),_0x999e('0x8c'));_0x2d398f[_0x999e('0xa')](_0x999e('0x8d'),_0x999e('0x8e'));_0x2d398f[_0x999e('0xa')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x999e('0x8f'));}if(_0x33abdc[_0x999e('0x90')]){_0x2d398f['limit'](_0x33abdc[_0x999e('0x90')]);}if(_0x33abdc[_0x999e('0x91')]){_0x2d398f[_0x999e('0x91')](_0x33abdc['offset']);}return db[_0x999e('0x6a')][_0x999e('0x6b')](_0x2d398f[_0x999e('0x6c')](),_0x47c693);})['then'](function(_0x216040){_0x61ba8=_0x216040;var _0x372316=getUsersQuery(_0x21c8be,_0x61ba8);return db[_0x999e('0x6a')]['query'](_0x372316['toString'](),_0x47c693);})[_0x999e('0x57')](function(_0x47e5ce){_0x175904=_[_0x999e('0x92')](_0x47e5ce,_0x1c9b64);if(_0x21c8be===_0x999e('0x2e')){return db[_0x999e('0x93')][_0x999e('0x94')]({'attributes':[_0x999e('0x95')],'raw':!![]});}})[_0x999e('0x57')](function(_0x43043a){var _0x523231=_0x43043a?_0x43043a[_0x999e('0x95')]:undefined;var _0x540a9e=_0x61ba8['map'](function(_0x3dc18c){return updateInteraction(_0x3dc18c,_0x5d4f50,_0x175904,_0x523231);});return Promise[_0x999e('0x96')](_0x540a9e);});}function countFilteredInteractions(_0xa0a5de,_0x302e73){var _0x2c9443=_0xa0a5de[_0x999e('0x97')]();_0x2c9443['field'](_0x999e('0x98'));_0x2c9443['field'](_0x999e('0x6f'),_0x999e('0x39'));var _0x3f82db=utils['getSelectedTags'](_0x302e73);if(!_[_0x999e('0x99')](_0x3f82db)){_0x2c9443['where'](_0x999e('0x9a'),_0x3f82db);}var _0x16a7d6={'type':db[_0x999e('0x68')][_0x999e('0x69')][_0x999e('0x9b')],'raw':!![]};return db['sequelize']['query'](_0x2c9443[_0x999e('0x6c')](),_0x16a7d6);}module[_0x999e('0x9c')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
index 7e98ff0..0535e13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca1a=['catch','updateInteraction','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged','abandoned','total','disposition','UserId','answered','MailMessage','findOne','out','-id','then','trimStart','plainBody'];(function(_0x4ac943,_0x1dc21b){var _0x433e74=function(_0x198d9e){while(--_0x198d9e){_0x4ac943['push'](_0x4ac943['shift']());}};_0x433e74(++_0x1dc21b);}(_0xca1a,0x17f));var _0xaca1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaca1('0x0'));var db=require(_0xaca1('0x1'))['db'];function getInteractionUsers(_0x46d351,_0x50f201){return new Promise(function(_0x4ae017,_0x2ec649){try{var _0x7f6ebb=[];if(_0x50f201[_0x46d351]){_0x7f6ebb=_0x50f201[_0x46d351][_0xaca1('0x2')](function(_0x212425){return{'id':_0x212425['id'],'fullname':_0x212425[_0xaca1('0x3')]};});}return _0x4ae017(_0x7f6ebb);}catch(_0x398004){_0x2ec649(_0x398004);}});}function getInteractionTags(_0x5d5320,_0x12e7c6){var _0x1cbd57=[];if(_0x5d5320){_0x5d5320[_0xaca1('0x4')](',')[_0xaca1('0x5')](function(_0x200639){_0x1cbd57[_0xaca1('0x6')](_0x12e7c6[_0x200639]);});}return _0x1cbd57;}function updateWaitingCounter(_0x74c06){if(_0x74c06[_0xaca1('0x7')]){_0x74c06[_0xaca1('0x7')]-=0x1;}}function updateInteractionCounters(_0x1121d9){_0x1121d9['waiting']=0x0;_0x1121d9[_0xaca1('0x8')]=0x0;_0x1121d9['answered']=0x0;_0x1121d9[_0xaca1('0x9')]=0x0;_0x1121d9[_0xaca1('0xa')]=0x0;_0x1121d9[_0xaca1('0xb')]=0x0;if(_0x1121d9['closed']){if(_0x1121d9[_0xaca1('0xc')]==='abandoned'){_0x1121d9[_0xaca1('0xa')]+=0x1;updateWaitingCounter(_0x1121d9);}if(_0x1121d9[_0xaca1('0xd')]){_0x1121d9[_0xaca1('0xe')]+=0x1;if(_0x1121d9[_0xaca1('0x8')]){_0x1121d9[_0xaca1('0x8')]-=0x1;}}else{if(_0x1121d9[_0xaca1('0xc')]){_0x1121d9['unmanaged']+=0x1;updateWaitingCounter(_0x1121d9);}}}else{if(!_0x1121d9[_0xaca1('0xd')]){_0x1121d9[_0xaca1('0x7')]+=0x1;}if(_0x1121d9[_0xaca1('0xd')]){_0x1121d9[_0xaca1('0x8')]+=0x1;updateWaitingCounter(_0x1121d9);}}_0x1121d9[_0xaca1('0xb')]+=0x1;return _0x1121d9;}function getLastMessageText(_0x1c9023){return db[_0xaca1('0xf')][_0xaca1('0x10')]({'where':{'$and':[{'MailInteractionId':_0x1c9023['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xaca1('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xaca1('0x12'),'raw':!![]})[_0xaca1('0x13')](function(_0x113dde){if(_0x113dde&&_0x113dde['plainBody']){_0x1c9023['lastMsgText']=_[_0xaca1('0x14')](_0x113dde[_0xaca1('0x15')]);}return _0x1c9023;})[_0xaca1('0x16')](function(_0x5a7f8c){throw _0x5a7f8c;});}exports[_0xaca1('0x17')]=function(_0x50e923,_0x13328a,_0x1fab5,_0x509479){return new Promise(function(_0x1ac726,_0x357227){return getInteractionUsers(_0x50e923['id'],_0x1fab5)[_0xaca1('0x13')](function(_0x56e52d){_0x50e923[_0xaca1('0x18')]=_0x56e52d;return getInteractionTags(_0x50e923[_0xaca1('0x19')],_0x13328a);})[_0xaca1('0x13')](function(_0x49529e){_0x50e923[_0xaca1('0x1a')]=_0x49529e;delete _0x50e923[_0xaca1('0x19')];return updateInteractionCounters(_0x50e923);})[_0xaca1('0x13')](function(_0x505f50){if(_0x509479){return getLastMessageText(_0x505f50);}else{return _0x505f50;}})['then'](function(_0x40cb80){_0x1ac726(_0x40cb80);})[_0xaca1('0x16')](function(_0x1f3313){_0x357227(_0x1f3313);});});};
\ No newline at end of file
+var _0x3af2=['answered','unmanaged','abandoned','closed','disposition','UserId','MailMessage','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','lodash','map','fullname','split','forEach','push','waiting','talking'];(function(_0x1682cc,_0x194ec0){var _0x391601=function(_0x45028a){while(--_0x45028a){_0x1682cc['push'](_0x1682cc['shift']());}};_0x391601(++_0x194ec0);}(_0x3af2,0x94));var _0x23af=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0x3af2[_0x4ec13d];return _0x3c3fa7;};'use strict';var _=require(_0x23af('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x165782,_0x3a855c){return new Promise(function(_0x53f69c,_0x389993){try{var _0x3406f5=[];if(_0x3a855c[_0x165782]){_0x3406f5=_0x3a855c[_0x165782][_0x23af('0x1')](function(_0x340aa0){return{'id':_0x340aa0['id'],'fullname':_0x340aa0[_0x23af('0x2')]};});}return _0x53f69c(_0x3406f5);}catch(_0x344ee7){_0x389993(_0x344ee7);}});}function getInteractionTags(_0x6f00f3,_0x4c81ba){var _0x4dc0e2=[];if(_0x6f00f3){_0x6f00f3[_0x23af('0x3')](',')[_0x23af('0x4')](function(_0x4840d7){_0x4dc0e2[_0x23af('0x5')](_0x4c81ba[_0x4840d7]);});}return _0x4dc0e2;}function updateWaitingCounter(_0x51e023){if(_0x51e023[_0x23af('0x6')]){_0x51e023[_0x23af('0x6')]-=0x1;}}function updateInteractionCounters(_0x1d0c9c){_0x1d0c9c['waiting']=0x0;_0x1d0c9c[_0x23af('0x7')]=0x0;_0x1d0c9c[_0x23af('0x8')]=0x0;_0x1d0c9c[_0x23af('0x9')]=0x0;_0x1d0c9c[_0x23af('0xa')]=0x0;_0x1d0c9c['total']=0x0;if(_0x1d0c9c[_0x23af('0xb')]){if(_0x1d0c9c[_0x23af('0xc')]==='abandoned'){_0x1d0c9c[_0x23af('0xa')]+=0x1;updateWaitingCounter(_0x1d0c9c);}if(_0x1d0c9c['UserId']){_0x1d0c9c[_0x23af('0x8')]+=0x1;if(_0x1d0c9c[_0x23af('0x7')]){_0x1d0c9c[_0x23af('0x7')]-=0x1;}}else{if(_0x1d0c9c[_0x23af('0xc')]){_0x1d0c9c[_0x23af('0x9')]+=0x1;updateWaitingCounter(_0x1d0c9c);}}}else{if(!_0x1d0c9c['UserId']){_0x1d0c9c['waiting']+=0x1;}if(_0x1d0c9c[_0x23af('0xd')]){_0x1d0c9c[_0x23af('0x7')]+=0x1;updateWaitingCounter(_0x1d0c9c);}}_0x1d0c9c['total']+=0x1;return _0x1d0c9c;}function getLastMessageText(_0x8a9d98){return db[_0x23af('0xe')][_0x23af('0xf')]({'where':{'$and':[{'MailInteractionId':_0x8a9d98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x23af('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x23af('0x11')],'order':_0x23af('0x12'),'raw':!![]})[_0x23af('0x13')](function(_0x5722a0){if(_0x5722a0&&_0x5722a0[_0x23af('0x11')]){_0x8a9d98[_0x23af('0x14')]=_[_0x23af('0x15')](_0x5722a0[_0x23af('0x11')]);}return _0x8a9d98;})[_0x23af('0x16')](function(_0x232a19){throw _0x232a19;});}exports[_0x23af('0x17')]=function(_0x182566,_0x2b6bf0,_0x5cb66d,_0x51753e){return new Promise(function(_0x4d3ceb,_0x1d95b5){return getInteractionUsers(_0x182566['id'],_0x5cb66d)['then'](function(_0xf69b0d){_0x182566[_0x23af('0x18')]=_0xf69b0d;return getInteractionTags(_0x182566[_0x23af('0x19')],_0x2b6bf0);})[_0x23af('0x13')](function(_0x52a200){_0x182566['Tags']=_0x52a200;delete _0x182566[_0x23af('0x19')];return updateInteractionCounters(_0x182566);})[_0x23af('0x13')](function(_0x38da36){if(_0x51753e){return getLastMessageText(_0x38da36);}else{return _0x38da36;}})[_0x23af('0x13')](function(_0x357de8){_0x4d3ceb(_0x357de8);})[_0x23af('0x16')](function(_0x54de1e){_0x1d95b5(_0x54de1e);});});};
\ No newline at end of file
index 3e811a4..1b695d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe62e=['unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','catch','error','exports','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','upperFirst','InteractionId'];(function(_0x434db2,_0x113541){var _0x4e9284=function(_0x5d59b4){while(--_0x5d59b4){_0x434db2['push'](_0x434db2['shift']());}};_0x4e9284(++_0x113541);}(_0xe62e,0x7c));var _0xee62=function(_0x57a8e8,_0x559564){_0x57a8e8=_0x57a8e8-0x0;var _0x2a365b=_0xe62e[_0x57a8e8];return _0x2a365b;};'use strict';var _=require('lodash');var db=require(_0xee62('0x0'))['db'];var loggers={'openchannel':require(_0xee62('0x1'))(_0xee62('0x2')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xee62('0x1'))(_0xee62('0x3')),'sms':require(_0xee62('0x1'))(_0xee62('0x4')),'chat':require('../../config/logger')(_0xee62('0x5')),'whatsapp':require(_0xee62('0x1'))(_0xee62('0x6'))};function getAccountFK(_0x58a649){return _[_0xee62('0x7')](_0x58a649)+(_0x58a649===_0xee62('0x8')?_0xee62('0x9'):'Account')+'Id';}function getInteractionFK(_0xbd022){return _[_0xee62('0x7')](_0xbd022)+'InteractionId';}function getInteractionId(_0xa81505,_0x502c05,_0x34c5c8){if(_0xa81505&&_0xa81505[_[_0xee62('0xa')](_0x34c5c8)+'InteractionId']){return _0xa81505[_[_0xee62('0xa')](_0x34c5c8)+_0xee62('0xb')];}else if(_0xa81505&&_0xa81505['id']){return _0xa81505['id'];}else if(_0x502c05&&_0x502c05['id']){return _0x502c05['id'];}else{return _0xee62('0xc');}}function getInteractionsTables(_0x53f77e){return{'accounts':_0x53f77e+'_'+(_0x53f77e==='chat'?_0xee62('0xd'):_0xee62('0xe')),'interactions':_0x53f77e+_0xee62('0xf'),'interactionsTags':_0x53f77e+_0xee62('0x10'),'messages':_0x53f77e+_0xee62('0x11'),'userInteractions':_0xee62('0x12')+_0x53f77e+'_interactions'};}function getSelectedTags(_0x2fe381){var _0x4faf04=[];if(_0x2fe381){_0x4faf04=Array['isArray'](_0x2fe381)?_0x2fe381:[_0x2fe381];}return _0x4faf04;}function log(_0x5e1cc4,_0x1dcaf6,_0x5deae9,_0x4063cd,_0x16fda5,_0x2bffec){loggers[_0x16fda5[_0xee62('0x13')]()][_0x5e1cc4](_0xee62('0x14'),_0x2bffec[_0xee62('0x15')](),_0x1dcaf6?_0x1dcaf6['id']:null,_0x1dcaf6?_0x1dcaf6[_0xee62('0x16')]:null,_0x1dcaf6?_0x1dcaf6[_0xee62('0x17')]:null,getInteractionId(_0x5deae9,_0x4063cd,_0x16fda5),_0x5deae9?JSON[_0xee62('0x18')](_0x5deae9):_0xee62('0x19'));}function updateUser(_0x2de082,_0x4d0551,_0x18cfa3,_0x4f1932,_0x4373c5){db[_[_0xee62('0xa')](_0x4f1932)+_0xee62('0x1a')][_0xee62('0x1b')]({'where':{'id':getInteractionId(_0x4d0551,_0x18cfa3,_0x4f1932)}})[_0xee62('0x1c')](function(_0x53486b){if(_0x53486b){return _0x53486b[_0xee62('0x1d')]({'UserId':_0x2de082?_0x2de082['id']:null});}})[_0xee62('0x1c')](function(_0x337fbd){if(_0x337fbd){log(_0xee62('0x1e'),_0x2de082,_0x4d0551,_0x18cfa3,_0x4f1932,_0x4373c5);}})[_0xee62('0x1f')](function(){log(_0xee62('0x20'),_0x2de082,_0x4d0551,_0x18cfa3,_0x4f1932,_0x4373c5);});}module[_0xee62('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
+var _0x91cd=['lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Account','InteractionId','upperFirst','unknown','chat','websites','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','info','catch','error','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x91cd,0xc0));var _0xd91c=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x91cd[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0xd91c('0x0'));var db=require(_0xd91c('0x1'))['db'];var loggers={'openchannel':require(_0xd91c('0x2'))(_0xd91c('0x3')),'mail':require(_0xd91c('0x2'))(_0xd91c('0x4')),'fax':require('../../config/logger')(_0xd91c('0x5')),'sms':require(_0xd91c('0x2'))(_0xd91c('0x6')),'chat':require(_0xd91c('0x2'))(_0xd91c('0x7')),'whatsapp':require(_0xd91c('0x2'))(_0xd91c('0x8'))};function getAccountFK(_0x1799cb){return _[_0xd91c('0x9')](_0x1799cb)+(_0x1799cb==='chat'?'Website':_0xd91c('0xa'))+'Id';}function getInteractionFK(_0x47a5b4){return _[_0xd91c('0x9')](_0x47a5b4)+_0xd91c('0xb');}function getInteractionId(_0x13da30,_0x23b9d2,_0x5b7cf2){if(_0x13da30&&_0x13da30[_[_0xd91c('0xc')](_0x5b7cf2)+'InteractionId']){return _0x13da30[_[_0xd91c('0xc')](_0x5b7cf2)+_0xd91c('0xb')];}else if(_0x13da30&&_0x13da30['id']){return _0x13da30['id'];}else if(_0x23b9d2&&_0x23b9d2['id']){return _0x23b9d2['id'];}else{return _0xd91c('0xd');}}function getInteractionsTables(_0x8a22d7){return{'accounts':_0x8a22d7+'_'+(_0x8a22d7===_0xd91c('0xe')?_0xd91c('0xf'):'accounts'),'interactions':_0x8a22d7+_0xd91c('0x10'),'interactionsTags':_0x8a22d7+_0xd91c('0x11'),'messages':_0x8a22d7+_0xd91c('0x12'),'userInteractions':_0xd91c('0x13')+_0x8a22d7+'_interactions'};}function getSelectedTags(_0x3cdd66){var _0x36b3d9=[];if(_0x3cdd66){_0x36b3d9=Array[_0xd91c('0x14')](_0x3cdd66)?_0x3cdd66:[_0x3cdd66];}return _0x36b3d9;}function log(_0x2864f1,_0x4ecb70,_0x550c3b,_0x58632f,_0xa4573f,_0xf95d24){loggers[_0xa4573f[_0xd91c('0x15')]()][_0x2864f1](_0xd91c('0x16'),_0xf95d24['toUpperCase'](),_0x4ecb70?_0x4ecb70['id']:null,_0x4ecb70?_0x4ecb70[_0xd91c('0x17')]:null,_0x4ecb70?_0x4ecb70[_0xd91c('0x18')]:null,getInteractionId(_0x550c3b,_0x58632f,_0xa4573f),_0x550c3b?JSON[_0xd91c('0x19')](_0x550c3b):_0xd91c('0x1a'));}function updateUser(_0x22c6ca,_0x4edfc3,_0xc50e29,_0x312fe5,_0x259984){db[_[_0xd91c('0xc')](_0x312fe5)+_0xd91c('0x1b')]['findOne']({'where':{'id':getInteractionId(_0x4edfc3,_0xc50e29,_0x312fe5)}})['then'](function(_0x523526){if(_0x523526){return _0x523526['update']({'UserId':_0x22c6ca?_0x22c6ca['id']:null});}})['then'](function(_0x11e74d){if(_0x11e74d){log(_0xd91c('0x1c'),_0x22c6ca,_0x4edfc3,_0xc50e29,_0x312fe5,_0x259984);}})[_0xd91c('0x1d')](function(){log(_0xd91c('0x1e'),_0x22c6ca,_0x4edfc3,_0xc50e29,_0x312fe5,_0x259984);});}module[_0xd91c('0x1f')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
index aaf0da7..cd731a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x280b=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','util','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json'];(function(_0x54f322,_0x24a660){var _0xb0a1d5=function(_0x523587){while(--_0x523587){_0x54f322['push'](_0x54f322['shift']());}};_0xb0a1d5(++_0x24a660);}(_0x280b,0xfa));var _0xb280=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x280b[_0x432682];return _0x463d05;};'use strict';var crypto=require('crypto');var util=require(_0xb280('0x0'));var compose=require(_0xb280('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0xb280('0x2'));function getValueFromLicense(_0x2ac682,_0x41fd9c){if(_0x2ac682&&_0x41fd9c){if(_0x41fd9c[_0xb280('0x3')]&&_0x41fd9c[_0xb280('0x4')]){var _0x1d9c55=_0x41fd9c[_0xb280('0x3')];var _0x31da34=_0x41fd9c['license'];var _0x3446cf=_0x1d9c55[_0xb280('0x5')]('-')[0x4];var _0x1ce8bc=_0x1d9c55[_0xb280('0x5')]('-')[0x0];var _0x7cca0e=crypto[_0xb280('0x6')]('aes-256-ctr',util[_0xb280('0x7')]('%s:%s:%s',_0x3446cf,_0x1d9c55,_0x1ce8bc));var _0x44198c=_0x7cca0e[_0xb280('0x8')](_0x31da34,_0xb280('0x9'),_0xb280('0xa'));_0x44198c+=_0x7cca0e[_0xb280('0xb')]('utf8');var _0x4b4862=JSON[_0xb280('0xc')](_0x44198c);return _0x4b4862[_0xb280('0xd')](_0x2ac682)?_0x4b4862[_0x2ac682]:null;}}return null;}function isLimit(_0x539a66,_0x46a375,_0x407e96,_0x194072){var _0x36f155=_0x46a375;return compose()[_0xb280('0xe')](function(_0x4b0809,_0xd5e76b,_0x5cf012){return db[_0xb280('0xf')][_0xb280('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xb280('0x11')](function(_0x300f87){var _0x55a575=getValueFromLicense(_0x539a66,_0x300f87);return _0x55a575?_0x55a575:_0x36f155;})[_0xb280('0x11')](function(_0x4d97a4){_0x36f155=_0x4d97a4;return _0x407e96['count'](_0x194072);})[_0xb280('0x11')](function(_0xe3053d){if(_0xe3053d>=_0x36f155){return _0xd5e76b[_0xb280('0x12')](0x193)[_0xb280('0x13')]({'message':util[_0xb280('0x7')](_0xb280('0x14'),_0x539a66)});}_0x5cf012();})[_0xb280('0x15')](function(_0x5187bd){_0x5cf012(_0x5187bd);});});}function isUserLimit(){return isLimit(_0xb280('0x16'),0x1,db[_0xb280('0x17')],{'where':{'$or':[{'role':_0xb280('0x18')},{'role':_0xb280('0x19')}]}});}exports[_0xb280('0x1a')]=isUserLimit;
\ No newline at end of file
+var _0x773a=['use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','hasOwnProperty'];(function(_0x1dd397,_0x5bbff0){var _0x3f1e50=function(_0x1087f0){while(--_0x1087f0){_0x1dd397['push'](_0x1dd397['shift']());}};_0x3f1e50(++_0x5bbff0);}(_0x773a,0x194));var _0xa773=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x773a[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0xa773('0x0'));var util=require(_0xa773('0x1'));var compose=require('composable-middleware');var db=require(_0xa773('0x2'))['db'];var config=require(_0xa773('0x3'));function getValueFromLicense(_0x324129,_0x48aa9b){if(_0x324129&&_0x48aa9b){if(_0x48aa9b[_0xa773('0x4')]&&_0x48aa9b['license']){var _0x4f9a6b=_0x48aa9b[_0xa773('0x4')];var _0x2c957a=_0x48aa9b[_0xa773('0x5')];var _0x29bca5=_0x4f9a6b[_0xa773('0x6')]('-')[0x4];var _0x523d66=_0x4f9a6b[_0xa773('0x6')]('-')[0x0];var _0x3b5b74=crypto[_0xa773('0x7')](_0xa773('0x8'),util[_0xa773('0x9')](_0xa773('0xa'),_0x29bca5,_0x4f9a6b,_0x523d66));var _0x1e1e0b=_0x3b5b74[_0xa773('0xb')](_0x2c957a,_0xa773('0xc'),_0xa773('0xd'));_0x1e1e0b+=_0x3b5b74[_0xa773('0xe')](_0xa773('0xd'));var _0x33022e=JSON['parse'](_0x1e1e0b);return _0x33022e[_0xa773('0xf')](_0x324129)?_0x33022e[_0x324129]:null;}}return null;}function isLimit(_0x405464,_0x312d31,_0x249949,_0x40b3b9){var _0x3c2b7c=_0x312d31;return compose()[_0xa773('0x10')](function(_0x419e1d,_0x3b7d22,_0x26c75b){return db[_0xa773('0x11')][_0xa773('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5a8ed5){var _0x3a57b3=getValueFromLicense(_0x405464,_0x5a8ed5);return _0x3a57b3?_0x3a57b3:_0x3c2b7c;})[_0xa773('0x13')](function(_0x45ef08){_0x3c2b7c=_0x45ef08;return _0x249949['count'](_0x40b3b9);})['then'](function(_0x5adc15){if(_0x5adc15>=_0x3c2b7c){return _0x3b7d22[_0xa773('0x14')](0x193)[_0xa773('0x15')]({'message':util['format'](_0xa773('0x16'),_0x405464)});}_0x26c75b();})[_0xa773('0x17')](function(_0x17ca38){_0x26c75b(_0x17ca38);});});}function isUserLimit(){return isLimit(_0xa773('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xa773('0x19')},{'role':_0xa773('0x1a')}]}});}exports[_0xa773('0x1b')]=isUserLimit;
\ No newline at end of file
index 884236f..f33ae2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ed5=['$lte','add','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','LIKE\x20?','$lt','>\x20?','<=\x20?','>=\x20?','$notIn','start','$endsWith','minutes','seconds','lodash','moment','parseSearch','sqlOperator','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between','value','includes','$gt'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x4ed5,0x1c3));var _0x54ed=function(_0x555061,_0x1e3346){_0x555061=_0x555061-0x0;var _0xdc6ad9=_0x4ed5[_0x555061];return _0xdc6ad9;};'use strict';var _=require(_0x54ed('0x0'));var moment=require(_0x54ed('0x1'));exports[_0x54ed('0x2')]=function(_0xcb5a2f){var _0x77bf7c={'conditions':[]};_0x77bf7c[_0x54ed('0x3')]=_['startsWith'](_0xcb5a2f,'[$or]')?'or':_0x54ed('0x4');var _0x4e34f7=_0xcb5a2f[_0x54ed('0x5')](_0x54ed('0x6'),'')[_0x54ed('0x5')](_0x54ed('0x7'),'')[_0x54ed('0x8')]('||');for(var _0x53362f=0x0;_0x53362f<_0x4e34f7[_0x54ed('0x9')];_0x53362f++){var _0x57296c=_0x4e34f7[_0x53362f][_0x54ed('0x8')](':=');var _0x5d0640=_0x57296c[0x0];var _0x29dc2e=_0x57296c[_0x54ed('0xa')](0x1);_0x29dc2e[_0x54ed('0xb')](function(_0x40b99b){var _0x5364ad=_0x40b99b[_0x54ed('0x8')]('[')[_0x54ed('0xc')]();var _0x3afc24=_0x40b99b[_0x54ed('0xd')](/\[(.*?)\]/g);_0x3afc24[_0x54ed('0xb')](function(_0xe44d71){var _0x5d9050=_0xe44d71[_0x54ed('0x8')]('[')[_0x54ed('0xe')](function(_0x10acd7){return _0x10acd7[_0x54ed('0xf')](']')>-0x1;})[_0x54ed('0x10')](function(_0x364cf5){return _0x364cf5[_0x54ed('0x8')](']')[0x0];})[0x0];_0x77bf7c[_0x54ed('0x11')]['push']({'field':_0x5d0640,'operator':_0x5364ad,'value':_0x5d9050});});});}return _0x77bf7c;};exports[_0x54ed('0x12')]=function(_0x1026ef,_0x270925,_0x36f4eb){var _0x4511b1={};if(_0x270925===_0x54ed('0x13')){if(_0x36f4eb[_0x54ed('0x14')]===_0x54ed('0x15')){_0x36f4eb[_0x54ed('0x14')]=_0x54ed('0x16');_0x36f4eb['value']+=','+_0x36f4eb[_0x54ed('0x17')];}else if(_[_0x54ed('0x18')]([_0x54ed('0x19'),_0x54ed('0x1a')],_0x36f4eb[_0x54ed('0x14')])){_0x36f4eb[_0x54ed('0x17')]=moment(_0x36f4eb[_0x54ed('0x17')])[_0x54ed('0x1b')](0x1,'days')[_0x54ed('0x1c')](_0x54ed('0x1d'));}}if(_0x36f4eb[_0x54ed('0x1e')]){_0x270925=_0x36f4eb['castTo'];_0x4511b1[_0x54ed('0x1f')]='CAST('+_0x1026ef+'.'+_0x36f4eb[_0x54ed('0x20')]+_0x54ed('0x21')+_0x36f4eb[_0x54ed('0x1e')]+')\x20'+parseOperator(_0x36f4eb[_0x54ed('0x14')]);}else{_0x4511b1[_0x54ed('0x1f')]=_0x1026ef+'.'+_0x36f4eb['field']+'\x20'+parseOperator(_0x36f4eb[_0x54ed('0x14')]);}if(_[_0x54ed('0x18')]([_0x54ed('0x22'),'$notIn'],_0x36f4eb[_0x54ed('0x14')]))_0x4511b1[_0x54ed('0x1f')]='('+_0x4511b1[_0x54ed('0x1f')]+_0x54ed('0x23')+_0x1026ef+'.'+_0x36f4eb[_0x54ed('0x20')]+_0x54ed('0x24');_0x4511b1['value']=parseValue(_0x270925,_0x36f4eb[_0x54ed('0x14')],_0x36f4eb[_0x54ed('0x17')]);return _0x4511b1;};function parseOperator(_0x57e4f9){var _0xb46882;switch(_0x57e4f9){case _0x54ed('0x25'):_0xb46882=_0x54ed('0x26');break;case'$notIn':_0xb46882=_0x54ed('0x27');break;case _0x54ed('0x15'):_0xb46882=_0x54ed('0x28');break;case _0x54ed('0x22'):_0xb46882=_0x54ed('0x29');break;case _0x54ed('0x2a'):case'$startsWith':case'$endsWith':_0xb46882=_0x54ed('0x2b');break;case _0x54ed('0x2c'):_0xb46882='<\x20?';break;case _0x54ed('0x19'):_0xb46882=_0x54ed('0x2d');break;case _0x54ed('0x1a'):_0xb46882=_0x54ed('0x2e');break;case'$gte':_0xb46882=_0x54ed('0x2f');break;case _0x54ed('0x16'):_0xb46882='BETWEEN\x20?\x20AND\x20?';break;}return _0xb46882;}function parseValue(_0x2e1e1d,_0x5c0256,_0x1cc8f4){var _0x36e27d={'start':undefined,'end':undefined};switch(_0x5c0256){case _0x54ed('0x25'):case _0x54ed('0x30'):_0x36e27d[_0x54ed('0x31')]=_0x1cc8f4[_0x54ed('0x8')](',');break;case'$substring':_0x36e27d[_0x54ed('0x31')]='%'+_0x1cc8f4+'%';break;case'$startsWith':_0x36e27d['start']=_0x1cc8f4+'%';break;case _0x54ed('0x32'):_0x36e27d[_0x54ed('0x31')]='%'+_0x1cc8f4;break;case'$between':var _0x1944d6=_0x1cc8f4[_0x54ed('0x8')](',');var _0x1cc8f4=_0x1944d6[_0x54ed('0xc')]();var _0x44766d=_0x1944d6['pop']();if(_0x2e1e1d===_0x54ed('0x13')){_0x1cc8f4=moment(_0x1cc8f4)['utcOffset'](0x0,!![])[_0x54ed('0x1c')]();_0x44766d=moment(_0x44766d)['utcOffset'](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0x54ed('0x33'))[_0x54ed('0x1b')](0x3b,_0x54ed('0x34'))[_0x54ed('0x1c')]();}_0x36e27d={'start':_0x1cc8f4,'end':_0x44766d};break;default:_0x36e27d[_0x54ed('0x31')]=_0x1cc8f4;break;}return _0x36e27d;}
\ No newline at end of file
+var _0x4378=['split','length','slice','shift','match','filter','indexOf','conditions','push','buildExpression','operator','$between','value','$gt','$lte','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20OR\x20','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','hours','minutes','add','seconds','lodash','moment','parseSearch','startsWith','and','replace','[$or]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4378,0xd1));var _0x8437=function(_0x3ab24b,_0x50d285){_0x3ab24b=_0x3ab24b-0x0;var _0x4fdbed=_0x4378[_0x3ab24b];return _0x4fdbed;};'use strict';var _=require(_0x8437('0x0'));var moment=require(_0x8437('0x1'));exports[_0x8437('0x2')]=function(_0xfbe720){var _0x4ea7d3={'conditions':[]};_0x4ea7d3['sqlOperator']=_[_0x8437('0x3')](_0xfbe720,'[$or]')?'or':_0x8437('0x4');var _0x549655=_0xfbe720[_0x8437('0x5')]('[$and]','')[_0x8437('0x5')](_0x8437('0x6'),'')[_0x8437('0x7')]('||');for(var _0x20870e=0x0;_0x20870e<_0x549655[_0x8437('0x8')];_0x20870e++){var _0x2a0d75=_0x549655[_0x20870e]['split'](':=');var _0x59a01f=_0x2a0d75[0x0];var _0x543125=_0x2a0d75[_0x8437('0x9')](0x1);_0x543125['forEach'](function(_0x24e432){var _0x549c51=_0x24e432[_0x8437('0x7')]('[')[_0x8437('0xa')]();var _0x22f9e9=_0x24e432[_0x8437('0xb')](/\[(.*?)\]/g);_0x22f9e9['forEach'](function(_0x62f87d){var _0x2e7821=_0x62f87d[_0x8437('0x7')]('[')[_0x8437('0xc')](function(_0x1cd1e1){return _0x1cd1e1[_0x8437('0xd')](']')>-0x1;})['map'](function(_0x48ef20){return _0x48ef20['split'](']')[0x0];})[0x0];_0x4ea7d3[_0x8437('0xe')][_0x8437('0xf')]({'field':_0x59a01f,'operator':_0x549c51,'value':_0x2e7821});});});}return _0x4ea7d3;};exports[_0x8437('0x10')]=function(_0x3eae2c,_0x310c4f,_0x3ae6d3){var _0x54af4e={};if(_0x310c4f==='DATE'){if(_0x3ae6d3[_0x8437('0x11')]==='$eq'){_0x3ae6d3['operator']=_0x8437('0x12');_0x3ae6d3[_0x8437('0x13')]+=','+_0x3ae6d3['value'];}else if(_['includes']([_0x8437('0x14'),_0x8437('0x15')],_0x3ae6d3[_0x8437('0x11')])){_0x3ae6d3['value']=moment(_0x3ae6d3['value'])['add'](0x1,'days')[_0x8437('0x16')](_0x8437('0x17'));}}if(_0x3ae6d3['castTo']){_0x310c4f=_0x3ae6d3[_0x8437('0x18')];_0x54af4e[_0x8437('0x19')]=_0x8437('0x1a')+_0x3eae2c+'.'+_0x3ae6d3[_0x8437('0x1b')]+_0x8437('0x1c')+_0x3ae6d3[_0x8437('0x18')]+')\x20'+parseOperator(_0x3ae6d3[_0x8437('0x11')]);}else{_0x54af4e[_0x8437('0x19')]=_0x3eae2c+'.'+_0x3ae6d3[_0x8437('0x1b')]+'\x20'+parseOperator(_0x3ae6d3[_0x8437('0x11')]);}if(_['includes']([_0x8437('0x1d'),_0x8437('0x1e')],_0x3ae6d3['operator']))_0x54af4e['text']='('+_0x54af4e[_0x8437('0x19')]+_0x8437('0x1f')+_0x3eae2c+'.'+_0x3ae6d3[_0x8437('0x1b')]+'\x20IS\x20NULL)';_0x54af4e[_0x8437('0x13')]=parseValue(_0x310c4f,_0x3ae6d3[_0x8437('0x11')],_0x3ae6d3[_0x8437('0x13')]);return _0x54af4e;};function parseOperator(_0x9cfe9f){var _0x442c7d;switch(_0x9cfe9f){case'$in':_0x442c7d=_0x8437('0x20');break;case _0x8437('0x1e'):_0x442c7d=_0x8437('0x21');break;case'$eq':_0x442c7d=_0x8437('0x22');break;case _0x8437('0x1d'):_0x442c7d=_0x8437('0x23');break;case _0x8437('0x24'):case _0x8437('0x25'):case _0x8437('0x26'):_0x442c7d=_0x8437('0x27');break;case _0x8437('0x28'):_0x442c7d=_0x8437('0x29');break;case _0x8437('0x14'):_0x442c7d=_0x8437('0x2a');break;case'$lte':_0x442c7d=_0x8437('0x2b');break;case _0x8437('0x2c'):_0x442c7d=_0x8437('0x2d');break;case _0x8437('0x12'):_0x442c7d=_0x8437('0x2e');break;}return _0x442c7d;}function parseValue(_0x1e45ea,_0x11435f,_0x2b5fd3){var _0x6b3732={'start':undefined,'end':undefined};switch(_0x11435f){case'$in':case'$notIn':_0x6b3732[_0x8437('0x2f')]=_0x2b5fd3[_0x8437('0x7')](',');break;case _0x8437('0x24'):_0x6b3732[_0x8437('0x2f')]='%'+_0x2b5fd3+'%';break;case'$startsWith':_0x6b3732[_0x8437('0x2f')]=_0x2b5fd3+'%';break;case _0x8437('0x26'):_0x6b3732['start']='%'+_0x2b5fd3;break;case _0x8437('0x12'):var _0x348cec=_0x2b5fd3[_0x8437('0x7')](',');var _0x2b5fd3=_0x348cec[_0x8437('0xa')]();var _0x4e7d30=_0x348cec[_0x8437('0x30')]();if(_0x1e45ea==='DATE'){_0x2b5fd3=moment(_0x2b5fd3)[_0x8437('0x31')](0x0,!![])['format']();_0x4e7d30=moment(_0x4e7d30)[_0x8437('0x31')](0x0,!![])['add'](0x17,_0x8437('0x32'))['add'](0x3b,_0x8437('0x33'))[_0x8437('0x34')](0x3b,_0x8437('0x35'))[_0x8437('0x16')]();}_0x6b3732={'start':_0x2b5fd3,'end':_0x4e7d30};break;default:_0x6b3732['start']=_0x2b5fd3;break;}return _0x6b3732;}
\ No newline at end of file
index df6eff7..214e291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['filters','isEmpty','forOwn','find','isPlainObject','$gte','format','YYYY-MM-DD','$lte','utc','subtract','uniqueid','isArray','limit','sort','map','priority','col','unsigned','substr','DESC','cast','ASC','omit','length','isString','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','query','$id','name','model','attributes','intersection','hasOwnProperty','nolimit','offset','order','where','filter','object','columns','value','merge','VIRTUAL','lower','lodash','sequelize','parse','keys','includes','fields','split'];(function(_0x517a2d,_0x21e839){var _0x42498c=function(_0x4451b9){while(--_0x4451b9){_0x517a2d['push'](_0x517a2d['shift']());}};_0x42498c(++_0x21e839);}(_0xa41a,0x6b));var _0xaa41=function(_0x56e653,_0x580908){_0x56e653=_0x56e653-0x0;var _0x3b93d4=_0xa41a[_0x56e653];return _0x3b93d4;};'use strict';var _=require(_0xaa41('0x0'));var sequelize=require(_0xaa41('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1612c4){var _0x2a96ba=['ne'];try{var _0x43654a=JSON[_0xaa41('0x2')](_0x1612c4);var _0x37c7a1=Object[_0xaa41('0x3')](_0x43654a)[0x0];return _0x2a96ba[_0xaa41('0x4')](_0x37c7a1);}catch(_0x251efa){return![];}}function getOperatorValue(_0x5dad7c){var _0x2122a0=JSON[_0xaa41('0x2')](_0x5dad7c);var _0x54bc5a=Object['keys'](_0x2122a0)[0x0];var _0x179545=_0x2122a0[_0x54bc5a];return{['$'+_0x54bc5a]:_0x179545};}exports[_0xaa41('0x5')]=function(_0x588ab4){var _0x31df43=null;if(_0x588ab4){_0x31df43=_0x588ab4[_0xaa41('0x6')](',');}return _0x31df43;};exports[_0xaa41('0x7')]=function(_0x1cc344,_0x4263d6){var _0x38d930={};if(!_[_0xaa41('0x8')](_0x1cc344)){_[_0xaa41('0x9')](_0x1cc344,function(_0x1c291e,_0x5c9fc7){try{if(_0x4263d6){var _0x1d3aac=_[_0xaa41('0xa')](_0x4263d6,{'name':_0x5c9fc7})||{};if(hasSequelizeOperator(_0x1c291e)){_0x38d930[_0x5c9fc7]=getOperatorValue(_0x1c291e);}else if(_0x1d3aac['type']==='DATE'&&_[_0xaa41('0xb')](_0x1c291e)){var _0x518b5b=JSON[_0xaa41('0x2')](_0x1c291e);var _0x12d9e6={'$gte':moment(moment(_0x518b5b[_0xaa41('0xc')])[_0xaa41('0xd')](_0xaa41('0xe')))['utc']()[_0xaa41('0xd')](),'$lte':moment(moment(_0x518b5b[_0xaa41('0xf')])[_0xaa41('0xd')](_0xaa41('0xe')))[_0xaa41('0x10')]()[_0xaa41('0x11')](0x1,'s')[_0xaa41('0xd')]()};_0x38d930[_0x5c9fc7]=_0x12d9e6;}else if(_0x1d3aac['name']===_0xaa41('0x12')){_0x38d930[_0x5c9fc7]=_0x1c291e;}else{_0x38d930[_0x5c9fc7]=_[_0xaa41('0x13')](_0x1c291e)?_0x1c291e:JSON[_0xaa41('0x2')](_0x1c291e);}}else{_0x38d930[_0x5c9fc7]=_[_0xaa41('0x13')](_0x1c291e)?_0x1c291e:JSON[_0xaa41('0x2')](_0x1c291e);}}catch(_0xd20ddf){_0x38d930[_0x5c9fc7]=_0x1c291e[_0xaa41('0x6')](',');}});}return _0x38d930;};exports[_0xaa41('0x14')]=function(_0x150ddf){_0x150ddf=parseInt(_0x150ddf,0xa);if(!_0x150ddf||_0x150ddf<0x0){_0x150ddf=LIMIT_VALUE;}return _0x150ddf;};exports['offset']=function(_0x5cd936){_0x5cd936=parseInt(_0x5cd936,0xa);if(!_0x5cd936||_0x5cd936<0x0){_0x5cd936=0x0;}return _0x5cd936;};exports[_0xaa41('0x15')]=function(_0x22de55){var _0x35c753,_0x54c488=null;if(_0x22de55){_0x35c753=_0x22de55[_0xaa41('0x6')](',');_0x54c488=_[_0xaa41('0x16')](_0x35c753,function(_0x4e768e){if(_0x4e768e['indexOf']('-')===0x0){return[_0x4e768e===_0xaa41('0x17')?sequelize['cast'](sequelize[_0xaa41('0x18')](_0xaa41('0x17')),_0xaa41('0x19')):_0x4e768e[_0xaa41('0x1a')](0x1),_0xaa41('0x1b')];}else{return[_0x4e768e==='priority'?sequelize[_0xaa41('0x1c')](sequelize[_0xaa41('0x18')](_0xaa41('0x17')),_0xaa41('0x19')):_0x4e768e,_0xaa41('0x1d')];}});}return _0x54c488;};exports[_0xaa41('0x1e')]=function(_0x5c3074,_0x5795f4){if(_[_0xaa41('0x8')](_0x5c3074)){return _0x5c3074;}if(_['isArray'](_0x5c3074)){for(var _0x493a10=0x0;_0x493a10<_0x5c3074[_0xaa41('0x1f')];_0x493a10+=0x1){_0x5c3074[_0x493a10]=this['omit'](_0x5c3074[_0x493a10],_0x5795f4);}return _0x5c3074;}if(!_['isObject'](_0x5c3074)){return _0x5c3074;}if(_[_0xaa41('0x20')](_0x5795f4)){_0x5795f4=[_0x5795f4];}if(!_[_0xaa41('0x13')](_0x5795f4)){return _0x5c3074;}for(var _0x392214=0x0;_0x392214<_0x5795f4[_0xaa41('0x1f')];_0x392214+=0x1){_[_0xaa41('0x21')](_0x5c3074,_0x5795f4[_0x392214]);}for(var _0xa7269f in _0x5c3074){if(_0x5c3074['hasOwnProperty'](_0xa7269f)){_0x5c3074[_0xa7269f]=this[_0xaa41('0x1e')](_0x5c3074[_0xa7269f],_0x5795f4);}}return _0x5c3074;};exports[_0xaa41('0x22')]=function(_0x63c18c){return _0x63c18c[_0xaa41('0x23')](RegExp(_0xaa41('0x24')))?!![]:![];};exports[_0xaa41('0x25')]=function(_0x30f88e){return _0x30f88e[_0xaa41('0x23')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x377add){var _0x48b48b=[];_0x377add['split'](/[ ,]+/)[_0xaa41('0x26')](function(_0x1176bd){_0x1176bd=_0x1176bd['replace'](/([^:]")"+/g,'$1');_0x1176bd='+'+_0x1176bd+'*';var _0x392b5d=/[ `!@#$%^&*()_\-?~]/;if(_0x1176bd[_0xaa41('0x23')](_0x392b5d))_0x1176bd='\x22'+_0x1176bd+'\x22';_0x48b48b['push'](_0x1176bd);});return _0x48b48b['join']('\x20');};exports['getOptions']=function(_0x1cf3da,_0x2f5cc0,_0x2a186e){var _0x38afc4={},_0x58f203={};if(_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x28')]){_0x2f5cc0[_0xaa41('0x27')]['id']=_0x2f5cc0['query'][_0xaa41('0x28')];delete _0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x28')];}_0x38afc4['model']=_[_0xaa41('0x16')](_0x1cf3da,_0xaa41('0x29'));_0x38afc4['query']=_[_0xaa41('0x3')](_0x2f5cc0[_0xaa41('0x27')]);_0x38afc4[_0xaa41('0x7')]=_['intersection'](_0x38afc4[_0xaa41('0x2a')],_0x38afc4['query']);_0x58f203[_0xaa41('0x2b')]=_[_0xaa41('0x2c')](_0x38afc4[_0xaa41('0x2a')],this['fields'](_0x2f5cc0['query']['fields']));_0x58f203[_0xaa41('0x2b')]=_0x58f203[_0xaa41('0x2b')][_0xaa41('0x1f')]?_0x58f203[_0xaa41('0x2b')]:_0x38afc4['model'];if(!_0x2f5cc0['query'][_0xaa41('0x2d')](_0xaa41('0x2e'))){_0x58f203[_0xaa41('0x14')]=this[_0xaa41('0x14')](_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x14')]);_0x58f203[_0xaa41('0x2f')]=this['offset'](_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x2f')]);}_0x58f203[_0xaa41('0x30')]=this[_0xaa41('0x15')](_0x2f5cc0['query']['sort']);_0x58f203[_0xaa41('0x31')]=this[_0xaa41('0x7')](_['pick'](_0x2f5cc0[_0xaa41('0x27')],_0x38afc4['filters']),_0x1cf3da);if(_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x32')]){var _0x1a2d11=_0x1cf3da;var _0x466eee=_0x2f5cc0[_0xaa41('0x27')][_0xaa41('0x32')];if(typeof _0x466eee===_0xaa41('0x33')){_0x1a2d11=_[_0xaa41('0x32')](_0x1cf3da,function(_0x5d9b22){return _[_0xaa41('0x4')](_0x466eee[_0xaa41('0x34')],_0x5d9b22[_0xaa41('0x29')]);});_0x466eee=_0x466eee[_0xaa41('0x35')];}_0x58f203[_0xaa41('0x31')]=_[_0xaa41('0x36')](_0x58f203['where'],{'$or':_['map'](_0x1a2d11,function(_0x87e2f4){if(_0x87e2f4['type']!==_0xaa41('0x37')){if(_0x2a186e){return sequelize[_0xaa41('0x31')](sequelize['fn'](_0xaa41('0x38'),sequelize[_0xaa41('0x18')](_0x87e2f4[_0xaa41('0x29')])),{'$like':sequelize['fn'](_0xaa41('0x38'),'%'+_0x2f5cc0[_0xaa41('0x27')]['filter']+'%')});}else{var _0x124992={};_0x124992[_0x87e2f4['name']]={'$like':'%'+_0x2f5cc0['query'][_0xaa41('0x32')]+'%'};return _0x124992;}}})});}_0x58f203=_['merge']({},_0x58f203,_0x2f5cc0['options']);return _0x58f203;};
\ No newline at end of file
+var _0xd67b=['attributes','nolimit','offset','sort','where','filter','object','columns','value','merge','lower','options','sequelize','includes','parse','keys','fields','split','filters','forOwn','find','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','$lte','subtract','name','isArray','limit','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isEmpty','length','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','push','getOptions','$id','query','model','intersection'];(function(_0x37d529,_0x13c20c){var _0x4d19ee=function(_0x156754){while(--_0x156754){_0x37d529['push'](_0x37d529['shift']());}};_0x4d19ee(++_0x13c20c);}(_0xd67b,0x133));var _0xbd67=function(_0x103697,_0x48be99){_0x103697=_0x103697-0x0;var _0x190e31=_0xd67b[_0x103697];return _0x190e31;};'use strict';var _=require('lodash');var sequelize=require(_0xbd67('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1da24d){var _0x280954=['ne'];try{var _0x317e33=JSON['parse'](_0x1da24d);var _0x40e384=Object['keys'](_0x317e33)[0x0];return _0x280954[_0xbd67('0x1')](_0x40e384);}catch(_0x5a827b){return![];}}function getOperatorValue(_0x309962){var _0xa5c384=JSON[_0xbd67('0x2')](_0x309962);var _0x27b016=Object[_0xbd67('0x3')](_0xa5c384)[0x0];var _0x72f9ac=_0xa5c384[_0x27b016];return{['$'+_0x27b016]:_0x72f9ac};}exports[_0xbd67('0x4')]=function(_0xfad775){var _0x1da7f1=null;if(_0xfad775){_0x1da7f1=_0xfad775[_0xbd67('0x5')](',');}return _0x1da7f1;};exports[_0xbd67('0x6')]=function(_0x3a7f43,_0x283f2f){var _0x52b981={};if(!_['isEmpty'](_0x3a7f43)){_[_0xbd67('0x7')](_0x3a7f43,function(_0x5aad7a,_0x388d95){try{if(_0x283f2f){var _0xb6b4b5=_[_0xbd67('0x8')](_0x283f2f,{'name':_0x388d95})||{};if(hasSequelizeOperator(_0x5aad7a)){_0x52b981[_0x388d95]=getOperatorValue(_0x5aad7a);}else if(_0xb6b4b5[_0xbd67('0x9')]===_0xbd67('0xa')&&_[_0xbd67('0xb')](_0x5aad7a)){var _0x3621ad=JSON[_0xbd67('0x2')](_0x5aad7a);var _0x341b2b={'$gte':moment(moment(_0x3621ad[_0xbd67('0xc')])['format'](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0xf')](),'$lte':moment(moment(_0x3621ad[_0xbd67('0x10')])[_0xbd67('0xf')](_0xbd67('0xd')))[_0xbd67('0xe')]()[_0xbd67('0x11')](0x1,'s')[_0xbd67('0xf')]()};_0x52b981[_0x388d95]=_0x341b2b;}else if(_0xb6b4b5[_0xbd67('0x12')]==='uniqueid'){_0x52b981[_0x388d95]=_0x5aad7a;}else{_0x52b981[_0x388d95]=_['isArray'](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}else{_0x52b981[_0x388d95]=_[_0xbd67('0x13')](_0x5aad7a)?_0x5aad7a:JSON[_0xbd67('0x2')](_0x5aad7a);}}catch(_0x47d066){_0x52b981[_0x388d95]=_0x5aad7a[_0xbd67('0x5')](',');}});}return _0x52b981;};exports[_0xbd67('0x14')]=function(_0x357ff2){_0x357ff2=parseInt(_0x357ff2,0xa);if(!_0x357ff2||_0x357ff2<0x0){_0x357ff2=LIMIT_VALUE;}return _0x357ff2;};exports['offset']=function(_0x5906a2){_0x5906a2=parseInt(_0x5906a2,0xa);if(!_0x5906a2||_0x5906a2<0x0){_0x5906a2=0x0;}return _0x5906a2;};exports['sort']=function(_0x1f9193){var _0x4609b7,_0xb3f67f=null;if(_0x1f9193){_0x4609b7=_0x1f9193['split'](',');_0xb3f67f=_[_0xbd67('0x15')](_0x4609b7,function(_0x40ec96){if(_0x40ec96[_0xbd67('0x16')]('-')===0x0){return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')]('priority'),_0xbd67('0x1a')):_0x40ec96[_0xbd67('0x1b')](0x1),_0xbd67('0x1c')];}else{return[_0x40ec96===_0xbd67('0x17')?sequelize[_0xbd67('0x18')](sequelize[_0xbd67('0x19')](_0xbd67('0x17')),_0xbd67('0x1a')):_0x40ec96,_0xbd67('0x1d')];}});}return _0xb3f67f;};exports[_0xbd67('0x1e')]=function(_0x46b7ff,_0x57602d){if(_[_0xbd67('0x1f')](_0x46b7ff)){return _0x46b7ff;}if(_['isArray'](_0x46b7ff)){for(var _0x25bf7a=0x0;_0x25bf7a<_0x46b7ff[_0xbd67('0x20')];_0x25bf7a+=0x1){_0x46b7ff[_0x25bf7a]=this[_0xbd67('0x1e')](_0x46b7ff[_0x25bf7a],_0x57602d);}return _0x46b7ff;}if(!_['isObject'](_0x46b7ff)){return _0x46b7ff;}if(_[_0xbd67('0x21')](_0x57602d)){_0x57602d=[_0x57602d];}if(!_[_0xbd67('0x13')](_0x57602d)){return _0x46b7ff;}for(var _0x4dfa19=0x0;_0x4dfa19<_0x57602d[_0xbd67('0x20')];_0x4dfa19+=0x1){_[_0xbd67('0x22')](_0x46b7ff,_0x57602d[_0x4dfa19]);}for(var _0x374f1b in _0x46b7ff){if(_0x46b7ff[_0xbd67('0x23')](_0x374f1b)){_0x46b7ff[_0x374f1b]=this[_0xbd67('0x1e')](_0x46b7ff[_0x374f1b],_0x57602d);}}return _0x46b7ff;};exports['isNumeric']=function(_0x5975dc){return _0x5975dc[_0xbd67('0x24')](RegExp(_0xbd67('0x25')))?!![]:![];};exports[_0xbd67('0x26')]=function(_0x44eced){return _0x44eced[_0xbd67('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0xbd67('0x27')]=function(_0x256137){var _0x2e123e=[];_0x256137[_0xbd67('0x5')](/[ ,]+/)[_0xbd67('0x28')](function(_0x5cb0ce){_0x5cb0ce=_0x5cb0ce['replace'](/([^:]")"+/g,'$1');_0x5cb0ce='+'+_0x5cb0ce+'*';var _0x5fcae8=/[ `!@#$%^&*()_\-?~]/;if(_0x5cb0ce[_0xbd67('0x24')](_0x5fcae8))_0x5cb0ce='\x22'+_0x5cb0ce+'\x22';_0x2e123e[_0xbd67('0x29')](_0x5cb0ce);});return _0x2e123e['join']('\x20');};exports[_0xbd67('0x2a')]=function(_0x15da85,_0xb3f593,_0x484989){var _0x4d1ce3={},_0x5186eb={};if(_0xb3f593['query'][_0xbd67('0x2b')]){_0xb3f593[_0xbd67('0x2c')]['id']=_0xb3f593[_0xbd67('0x2c')]['$id'];delete _0xb3f593['query'][_0xbd67('0x2b')];}_0x4d1ce3[_0xbd67('0x2d')]=_[_0xbd67('0x15')](_0x15da85,_0xbd67('0x12'));_0x4d1ce3[_0xbd67('0x2c')]=_[_0xbd67('0x3')](_0xb3f593['query']);_0x4d1ce3[_0xbd67('0x6')]=_[_0xbd67('0x2e')](_0x4d1ce3[_0xbd67('0x2d')],_0x4d1ce3['query']);_0x5186eb[_0xbd67('0x2f')]=_['intersection'](_0x4d1ce3[_0xbd67('0x2d')],this[_0xbd67('0x4')](_0xb3f593['query'][_0xbd67('0x4')]));_0x5186eb[_0xbd67('0x2f')]=_0x5186eb[_0xbd67('0x2f')][_0xbd67('0x20')]?_0x5186eb[_0xbd67('0x2f')]:_0x4d1ce3[_0xbd67('0x2d')];if(!_0xb3f593['query'][_0xbd67('0x23')](_0xbd67('0x30'))){_0x5186eb[_0xbd67('0x14')]=this[_0xbd67('0x14')](_0xb3f593[_0xbd67('0x2c')]['limit']);_0x5186eb['offset']=this[_0xbd67('0x31')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x31')]);}_0x5186eb['order']=this[_0xbd67('0x32')](_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x32')]);_0x5186eb[_0xbd67('0x33')]=this['filters'](_['pick'](_0xb3f593['query'],_0x4d1ce3['filters']),_0x15da85);if(_0xb3f593['query'][_0xbd67('0x34')]){var _0x5a6b2d=_0x15da85;var _0x4d08a6=_0xb3f593['query'][_0xbd67('0x34')];if(typeof _0x4d08a6===_0xbd67('0x35')){_0x5a6b2d=_[_0xbd67('0x34')](_0x15da85,function(_0x2ca134){return _['includes'](_0x4d08a6[_0xbd67('0x36')],_0x2ca134[_0xbd67('0x12')]);});_0x4d08a6=_0x4d08a6[_0xbd67('0x37')];}_0x5186eb[_0xbd67('0x33')]=_[_0xbd67('0x38')](_0x5186eb[_0xbd67('0x33')],{'$or':_[_0xbd67('0x15')](_0x5a6b2d,function(_0x532c9b){if(_0x532c9b[_0xbd67('0x9')]!=='VIRTUAL'){if(_0x484989){return sequelize[_0xbd67('0x33')](sequelize['fn'](_0xbd67('0x39'),sequelize[_0xbd67('0x19')](_0x532c9b[_0xbd67('0x12')])),{'$like':sequelize['fn'](_0xbd67('0x39'),'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%')});}else{var _0xfe170b={};_0xfe170b[_0x532c9b['name']]={'$like':'%'+_0xb3f593[_0xbd67('0x2c')][_0xbd67('0x34')]+'%'};return _0xfe170b;}}})});}_0x5186eb=_['merge']({},_0x5186eb,_0xb3f593[_0xbd67('0x3a')]);return _0x5186eb;};
\ No newline at end of file
index cd663f0..681ab5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5578=['pick','filterAgentAttributes','../../mysqldb','client','http','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','length','idle','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','merge','catch','getRealtimeAgents','unknown','*pause','getAgentStatus','Queue','map','findOne','all','value','busy','getAgentIdsByStatus','resolve','includes','User','fullname','chatPause','faxPause','smsPause','pauseType','globalStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','substring','internal','validateSortParameter','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','mailStatus','openchannelStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','routealias'];(function(_0xcf76f5,_0x49de1e){var _0x597348=function(_0x187f96){while(--_0x187f96){_0xcf76f5['push'](_0xcf76f5['shift']());}};_0x597348(++_0x49de1e);}(_0x5578,0xa8));var _0x8557=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x5578[_0x1ae4a9];return _0x54d0b0;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require(_0x8557('0x0'))['db'];var amiClient=jayson[_0x8557('0x1')][_0x8557('0x2')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function isAgentPaused(_0x432ba7,_0x33ddcf){var _0x366f9c=[_0x432ba7['chatPause'],_0x432ba7['faxPause'],_0x432ba7[_0x8557('0x3')],_0x432ba7[_0x8557('0x4')],_0x432ba7['smsPause'],_0x432ba7[_0x8557('0x5')],_0x432ba7[_0x8557('0x6')]];if(!_0x33ddcf)return _[_0x8557('0x7')](_0x366f9c);var _0x5257b6=_[_0x8557('0x8')](_0x366f9c);return _0x5257b6[_0x8557('0x9')]>0x0&&_0x5257b6[_0x8557('0x9')]<_0x366f9c[_0x8557('0x9')]?!![]:![];}function isIdle(_0x4d0d0b){return _0x4d0d0b===_0x8557('0xa')||_0x4d0d0b==='unknown'||_0x4d0d0b===_0x8557('0xb')||_0x4d0d0b===_0x8557('0xc')||_[_0x8557('0xd')](_0x4d0d0b);}function isAgentIdle(_0x2735ac){if(_0x2735ac[_0x8557('0xe')]!==_0x8557('0xa')&&_0x2735ac[_0x8557('0x5')]){_0x2735ac[_0x8557('0xe')]=_0x8557('0xf');return![];}return _[_0x8557('0x7')]([_0x2735ac['chatStatus'],_0x2735ac[_0x8557('0x10')],_0x2735ac['mailStatus'],_0x2735ac[_0x8557('0x11')],_0x2735ac[_0x8557('0x12')],_0x2735ac[_0x8557('0xe')],_0x2735ac[_0x8557('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x8557('0x14')](_0x8557('0x15'),{})[_0x8557('0x16')](function(_0x3aa335){if(_0x3aa335['error']){throw new Error(_0x8557('0x17'));}var _0x1a8345=_0x3aa335[_0x8557('0x18')];return routingClient[_0x8557('0x14')](_0x8557('0x15'),{})['then'](function(_0x5bbeb5){if(_0x5bbeb5[_0x8557('0x19')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x11b965=_0x5bbeb5['result'];return _[_0x8557('0x1a')]({},_0x1a8345,_0x11b965);});})[_0x8557('0x1b')](function(_0x5f07d1){throw _0x5f07d1;});}exports[_0x8557('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x31160){var _0x1ace1c=_0x8557('0x1d');if(isAgentPaused(_0x31160))_0x1ace1c=_0x8557('0xf');else if(isAgentPaused(_0x31160,!![]))_0x1ace1c=_0x8557('0x1e');else if(isAgentIdle(_0x31160))_0x1ace1c=_0x8557('0xa');else _0x1ace1c='busy';return _0x1ace1c;}exports[_0x8557('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x5696a3,_0x5c2fdf){var _0x7bd28d=_['isArray'](_0x5696a3)?_0x5696a3:[_0x5696a3];var _0x584130=_['startCase'](_0x5c2fdf)+_0x8557('0x20');var _0x4873d4=_[_0x8557('0x21')](_0x7bd28d,function(_0x10d1a9){return db[_0x584130][_0x8557('0x22')]({'where':{'id':_0x10d1a9}})[_0x8557('0x16')](function(_0x4d8f57){if(!_0x4d8f57)return[];return _0x4d8f57['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x8557('0x23')](_0x4873d4)['then'](function(_0x5943c0){var _0x27bbeb=_(_0x5943c0)['flatten']()[_0x8557('0x21')]('id')['uniq']()[_0x8557('0x24')]();return _0x27bbeb;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x52ad0a,_0x4bb048,_0xe45141){try{if(_0x4bb048[_0x8557('0x9')]>0x0){_0x52ad0a=_0x52ad0a[_0x8557('0x8')](function(_0x34c616){return _0x4bb048['includes'](_0x34c616['id']);});}var _0x423ba5=_0x52ad0a[_0x8557('0x8')](function(_0x42eaab){var _0x8e6aa2=_0x8557('0x25');if(isAgentIdle(_0x42eaab)){_0x8e6aa2=_0x8557('0xa');}return _0x8e6aa2===_0xe45141;});return _[_0x8557('0x21')](_0x423ba5,'id');}catch(_0x61acc1){throw _0x61acc1;}}exports[_0x8557('0x26')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x9270df,_0x1bfda1,_0x432003){return Promise[_0x8557('0x27')]()[_0x8557('0x16')](function(){if(_0x1bfda1['length']>0x0){_0x9270df=_0x9270df[_0x8557('0x8')](function(_0x2358c6){return _0x1bfda1[_0x8557('0x28')](_0x2358c6['id']);});}return _0x9270df;})['then'](function(){return db[_0x8557('0x29')]['findAll']({'attributes':['id','name',_0x8557('0x2a'),_0x8557('0x2b'),_0x8557('0x2c'),'mailPause',_0x8557('0x4'),_0x8557('0x2d'),'voicePause',_0x8557('0x6'),_0x8557('0x2e')],'where':{'id':{'$in':_[_0x8557('0x21')](_0x9270df,'id')}},'raw':!![]});})[_0x8557('0x16')](function(_0x34934e){return _0x34934e[_0x8557('0x21')](function(_0x531a3e){var _0x3f81e1=_['find'](_0x9270df,['id',_0x531a3e['id']]);var _0x50eefc=filterAgentAttributes(_0x3f81e1);_[_0x8557('0x1a')](_0x531a3e,_0x50eefc);_0x531a3e[_0x8557('0x2f')]=getAgentStatus(_0x531a3e);return _0x531a3e;});})[_0x8557('0x16')](function(_0x2d089c){var _0x310cd4=sortAgentsByStatus(_0x2d089c,_0x432003);return _[_0x8557('0x21')](_0x310cd4,'id');})[_0x8557('0x1b')](function(_0xe91e82){throw _0xe91e82;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x526b35){var _0x1ab771={'fields':[],'order':null};var _0x928ff6=_0x526b35[_0x8557('0x30')](',');_0x1ab771[_0x8557('0x31')]=_['filter'](_0x928ff6,function(_0x4377d0){if(!_0x4377d0[_0x8557('0x28')](_0x8557('0x2f'))){return!![];}_0x1ab771[_0x8557('0x32')]=_[_0x8557('0x33')](_0x4377d0,'-')?_0x8557('0x34'):_0x8557('0x35');return![];});return _0x1ab771;}exports[_0x8557('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x5b7672){if(_0x5b7672[_0x8557('0x28')](_0x8557('0x2a'))&&!_0x5b7672[_0x8557('0x28')]('internal')){var _0x5c2efd=_0x5b7672[_0x8557('0x37')](0x0,_0x5b7672['indexOf'](_0x8557('0x2a')));_0x5b7672+=','+_0x5c2efd+_0x8557('0x38');}return _0x5b7672;}exports[_0x8557('0x39')]=validateSortParameter;function sortAgentsByStatus(_0x1abd7e,_0x23131e){var _0x578943=_0x1abd7e['sort'](function(_0x27818a,_0x18d337){if(_0x27818a[_0x8557('0x2f')]===_0x18d337[_0x8557('0x2f')]){if(_0x27818a[_0x8557('0x2f')]===_0x8557('0xf')){if(_0x23131e===_0x8557('0x34')){return(_0x27818a[_0x8557('0x2e')]||'')<(_0x18d337[_0x8557('0x2e')]||'')||_0x27818a[_0x8557('0x2a')]['toLowerCase']()>_0x18d337['fullname'][_0x8557('0x3a')]()?0x1:-0x1;}else{return(_0x27818a[_0x8557('0x2e')]||'')<(_0x18d337[_0x8557('0x2e')]||'')||_0x27818a['fullname'][_0x8557('0x3a')]()>_0x18d337['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x23131e===_0x8557('0x34')){return _0x27818a[_0x8557('0x2a')][_0x8557('0x3a')]()<_0x18d337[_0x8557('0x2a')][_0x8557('0x3a')]()?0x1:-0x1;}else{return _0x27818a[_0x8557('0x2a')]['toLowerCase']()<_0x18d337[_0x8557('0x2a')]['toLowerCase']()?-0x1:0x1;}}}else{if(_0x23131e===_0x8557('0x34')){return _0x27818a[_0x8557('0x2f')]<_0x18d337['globalStatus']?0x1:-0x1;}else{return _0x27818a[_0x8557('0x2f')]<_0x18d337[_0x8557('0x2f')]?-0x1:0x1;}}});return _0x578943;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x16c141){var _0x6bd47e=[_0x8557('0x3b'),_0x8557('0x3c'),_0x8557('0x3d'),_0x8557('0x3e'),'pauseType',_0x8557('0x3e'),_0x8557('0x38'),_0x8557('0x3f'),_0x8557('0x2b'),_0x8557('0x4'),_0x8557('0x3'),_0x8557('0x2d'),_0x8557('0x6'),_0x8557('0x2c'),_0x8557('0x5'),_0x8557('0x40'),_0x8557('0x41'),_0x8557('0x42'),_0x8557('0x43'),_0x8557('0x44'),_0x8557('0x45'),'chatCurrentCapacity',_0x8557('0x46'),_0x8557('0x47'),_0x8557('0x48'),'whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','openchannelStatus',_0x8557('0x49'),_0x8557('0x12'),'whatsappStatus','faxStatus',_0x8557('0xe'),'chatStatusTime',_0x8557('0x4a'),'mailStatusTime','smsStatusTime',_0x8557('0x4b'),_0x8557('0x4c'),'voiceStatusTime',_0x8557('0x4d'),_0x8557('0x4e'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0x8557('0x4f'),_0x8557('0x50')];var _0x4f8933=[_0x8557('0x2b'),_0x8557('0x4'),_0x8557('0x3'),_0x8557('0x2d'),_0x8557('0x6'),_0x8557('0x2c'),_0x8557('0x5'),_0x8557('0x3c')];var _0x350b08=_(_0x16c141)['omit'](_0x4f8933)[_0x8557('0x51')](_0x6bd47e)[_0x8557('0x24')]();return _0x350b08;}exports[_0x8557('0x52')]=filterAgentAttributes;
\ No newline at end of file
+var _0x1ce1=['map','uniq','value','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','pauseType','getSortedAgentsIdsByStatus','globalStatus','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','openchannelCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','mailStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','screenrecording','phoneBarEnableAutomaticScreenRecording','lodash','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','isNil','voiceStatus','pause','faxStatus','openchannelStatus','smsStatus','whatsappStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','getAgentStatus','isArray','startCase','findOne','getAgents','all','flatten'];(function(_0x28c927,_0x20e448){var _0x3d9e52=function(_0x1e5526){while(--_0x1e5526){_0x28c927['push'](_0x28c927['shift']());}};_0x3d9e52(++_0x20e448);}(_0x1ce1,0x81));var _0x11ce=function(_0x458e0b,_0x1944a8){_0x458e0b=_0x458e0b-0x0;var _0x45edad=_0x1ce1[_0x458e0b];return _0x45edad;};'use strict';var _=require(_0x11ce('0x0'));var jayson=require('jayson/promise');var db=require(_0x11ce('0x1'))['db'];var amiClient=jayson[_0x11ce('0x2')][_0x11ce('0x3')]({'port':0x232a});var routingClient=jayson[_0x11ce('0x2')]['http']({'port':0x232c});function isAgentPaused(_0x24c170,_0x8db765){var _0x4bf19f=[_0x24c170[_0x11ce('0x4')],_0x24c170[_0x11ce('0x5')],_0x24c170[_0x11ce('0x6')],_0x24c170[_0x11ce('0x7')],_0x24c170[_0x11ce('0x8')],_0x24c170[_0x11ce('0x9')],_0x24c170[_0x11ce('0xa')]];if(!_0x8db765)return _[_0x11ce('0xb')](_0x4bf19f);var _0x1dd949=_[_0x11ce('0xc')](_0x4bf19f);return _0x1dd949['length']>0x0&&_0x1dd949[_0x11ce('0xd')]<_0x4bf19f[_0x11ce('0xd')]?!![]:![];}function isIdle(_0x3ccbf4){return _0x3ccbf4===_0x11ce('0xe')||_0x3ccbf4===_0x11ce('0xf')||_0x3ccbf4===_0x11ce('0x10')||_0x3ccbf4===_0x11ce('0x11')||_[_0x11ce('0x12')](_0x3ccbf4);}function isAgentIdle(_0xc85fa8){if(_0xc85fa8[_0x11ce('0x13')]!=='idle'&&_0xc85fa8[_0x11ce('0x9')]){_0xc85fa8[_0x11ce('0x13')]=_0x11ce('0x14');return![];}return _['every']([_0xc85fa8['chatStatus'],_0xc85fa8[_0x11ce('0x15')],_0xc85fa8['mailStatus'],_0xc85fa8[_0x11ce('0x16')],_0xc85fa8[_0x11ce('0x17')],_0xc85fa8['voiceStatus'],_0xc85fa8[_0x11ce('0x18')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x11ce('0x19')]('Agents',{})[_0x11ce('0x1a')](function(_0x3d73ac){if(_0x3d73ac['error']){throw new Error(_0x11ce('0x1b'));}var _0x510705=_0x3d73ac['result'];return routingClient[_0x11ce('0x19')](_0x11ce('0x1c'),{})[_0x11ce('0x1a')](function(_0x182647){if(_0x182647['error']){throw new Error(_0x11ce('0x1d'));}var _0x13fd18=_0x182647['result'];return _[_0x11ce('0x1e')]({},_0x510705,_0x13fd18);});})[_0x11ce('0x1f')](function(_0x46d855){throw _0x46d855;});}exports[_0x11ce('0x20')]=getRealtimeAgents;function getAgentStatus(_0x598c0a){var _0x52af2b=_0x11ce('0xf');if(isAgentPaused(_0x598c0a))_0x52af2b=_0x11ce('0x14');else if(isAgentPaused(_0x598c0a,!![]))_0x52af2b=_0x11ce('0x21');else if(isAgentIdle(_0x598c0a))_0x52af2b=_0x11ce('0xe');else _0x52af2b='busy';return _0x52af2b;}exports[_0x11ce('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x1405c5,_0x2c7f37){var _0xccec94=_[_0x11ce('0x23')](_0x1405c5)?_0x1405c5:[_0x1405c5];var _0x50190e=_[_0x11ce('0x24')](_0x2c7f37)+'Queue';var _0x35bd3b=_['map'](_0xccec94,function(_0x2e6c57){return db[_0x50190e][_0x11ce('0x25')]({'where':{'id':_0x2e6c57}})[_0x11ce('0x1a')](function(_0xb80f56){if(!_0xb80f56)return[];return _0xb80f56[_0x11ce('0x26')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x11ce('0x27')](_0x35bd3b)[_0x11ce('0x1a')](function(_0x513b72){var _0x2f3989=_(_0x513b72)[_0x11ce('0x28')]()[_0x11ce('0x29')]('id')[_0x11ce('0x2a')]()[_0x11ce('0x2b')]();return _0x2f3989;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0xf33b5e,_0x5c8659,_0x147627){try{if(_0x5c8659[_0x11ce('0xd')]>0x0){_0xf33b5e=_0xf33b5e[_0x11ce('0xc')](function(_0x3a718f){return _0x5c8659[_0x11ce('0x2c')](_0x3a718f['id']);});}var _0x59b1ab=_0xf33b5e['filter'](function(_0xcc6db1){var _0xc3862f='busy';if(isAgentIdle(_0xcc6db1)){_0xc3862f=_0x11ce('0xe');}return _0xc3862f===_0x147627;});return _[_0x11ce('0x29')](_0x59b1ab,'id');}catch(_0x20d898){throw _0x20d898;}}exports[_0x11ce('0x2d')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x488cf8,_0x4fc2e2,_0xfc110f){return Promise[_0x11ce('0x2e')]()['then'](function(){if(_0x4fc2e2[_0x11ce('0xd')]>0x0){_0x488cf8=_0x488cf8[_0x11ce('0xc')](function(_0x2ae437){return _0x4fc2e2['includes'](_0x2ae437['id']);});}return _0x488cf8;})['then'](function(){return db[_0x11ce('0x2f')][_0x11ce('0x30')]({'attributes':['id',_0x11ce('0x31'),_0x11ce('0x32'),'chatPause',_0x11ce('0x5'),_0x11ce('0x6'),_0x11ce('0x7'),_0x11ce('0x8'),_0x11ce('0x9'),'whatsappPause',_0x11ce('0x33')],'where':{'id':{'$in':_[_0x11ce('0x29')](_0x488cf8,'id')}},'raw':!![]});})[_0x11ce('0x1a')](function(_0x351f1f){return _0x351f1f['map'](function(_0xf741e8){var _0x53bf9a=_['find'](_0x488cf8,['id',_0xf741e8['id']]);var _0x5e9333=filterAgentAttributes(_0x53bf9a);_[_0x11ce('0x1e')](_0xf741e8,_0x5e9333);_0xf741e8['globalStatus']=getAgentStatus(_0xf741e8);return _0xf741e8;});})['then'](function(_0x558258){var _0x5c0406=sortAgentsByStatus(_0x558258,_0xfc110f);return _[_0x11ce('0x29')](_0x5c0406,'id');})[_0x11ce('0x1f')](function(_0x4f1245){throw _0x4f1245;});}exports[_0x11ce('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2f49bf){var _0x39d33e={'fields':[],'order':null};var _0x86adb=_0x2f49bf['split'](',');_0x39d33e['fields']=_[_0x11ce('0xc')](_0x86adb,function(_0x55d3a2){if(!_0x55d3a2[_0x11ce('0x2c')](_0x11ce('0x35'))){return!![];}_0x39d33e[_0x11ce('0x36')]=_[_0x11ce('0x37')](_0x55d3a2,'-')?_0x11ce('0x38'):_0x11ce('0x39');return![];});return _0x39d33e;}exports[_0x11ce('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x58b922){if(_0x58b922[_0x11ce('0x2c')]('fullname')&&!_0x58b922['includes'](_0x11ce('0x3b'))){var _0x553f11=_0x58b922['substring'](0x0,_0x58b922['indexOf'](_0x11ce('0x32')));_0x58b922+=','+_0x553f11+_0x11ce('0x3b');}return _0x58b922;}exports[_0x11ce('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x4a706f,_0x1dee1a){var _0x1d7d25=_0x4a706f[_0x11ce('0x3d')](function(_0x397dec,_0x320708){if(_0x397dec[_0x11ce('0x35')]===_0x320708[_0x11ce('0x35')]){if(_0x397dec[_0x11ce('0x35')]===_0x11ce('0x14')){if(_0x1dee1a===_0x11ce('0x38')){return(_0x397dec[_0x11ce('0x33')]||'')<(_0x320708[_0x11ce('0x33')]||'')||_0x397dec[_0x11ce('0x32')][_0x11ce('0x3e')]()>_0x320708['fullname'][_0x11ce('0x3e')]()?0x1:-0x1;}else{return(_0x397dec[_0x11ce('0x33')]||'')<(_0x320708[_0x11ce('0x33')]||'')||_0x397dec[_0x11ce('0x32')]['toLowerCase']()>_0x320708['fullname'][_0x11ce('0x3e')]()?-0x1:0x1;}}else{if(_0x1dee1a==='DESC'){return _0x397dec[_0x11ce('0x32')][_0x11ce('0x3e')]()<_0x320708['fullname'][_0x11ce('0x3e')]()?0x1:-0x1;}else{return _0x397dec['fullname'][_0x11ce('0x3e')]()<_0x320708[_0x11ce('0x32')][_0x11ce('0x3e')]()?-0x1:0x1;}}}else{if(_0x1dee1a===_0x11ce('0x38')){return _0x397dec[_0x11ce('0x35')]<_0x320708[_0x11ce('0x35')]?0x1:-0x1;}else{return _0x397dec[_0x11ce('0x35')]<_0x320708[_0x11ce('0x35')]?-0x1:0x1;}}});return _0x1d7d25;}exports[_0x11ce('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0x2239e4){var _0x5c4dad=[_0x11ce('0x40'),_0x11ce('0x41'),_0x11ce('0x42'),_0x11ce('0x43'),_0x11ce('0x33'),'lastPauseAt',_0x11ce('0x3b'),_0x11ce('0x44'),_0x11ce('0x4'),_0x11ce('0x7'),'mailPause',_0x11ce('0x8'),'whatsappPause',_0x11ce('0x5'),_0x11ce('0x9'),'chatCapacity','openchannelCapacity',_0x11ce('0x45'),_0x11ce('0x46'),_0x11ce('0x47'),_0x11ce('0x48'),'chatCurrentCapacity',_0x11ce('0x49'),'mailCurrentCapacity',_0x11ce('0x4a'),_0x11ce('0x4b'),_0x11ce('0x4c'),_0x11ce('0x4d'),_0x11ce('0x16'),_0x11ce('0x4e'),_0x11ce('0x17'),'whatsappStatus',_0x11ce('0x15'),'voiceStatus','chatStatusTime',_0x11ce('0x4f'),'mailStatusTime',_0x11ce('0x50'),_0x11ce('0x51'),_0x11ce('0x52'),'voiceStatusTime','queue','destconnectedlinenum',_0x11ce('0x53'),'phoneBarEnableScreenRecordingByAgent',_0x11ce('0x54'),'routealias'];var _0x12f13b=['chatPause','openchannelPause',_0x11ce('0x6'),_0x11ce('0x8'),_0x11ce('0xa'),'faxPause',_0x11ce('0x9'),'online'];var _0x3ba5ec=_(_0x2239e4)['omit'](_0x12f13b)['pick'](_0x5c4dad)['value']();return _0x3ba5ec;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
index 8991b84..31ab922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe261=['format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','inbound','concat','outbound','map','paused','find','merge','pick','lodash','jayson/promise','util','client','http','available','waiting','busy','invalid','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','voice','request','startCase','Queues','then','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe261,0xa5));var _0x1e26=function(_0x115401,_0x261e66){_0x115401=_0x115401-0x0;var _0x4ed7b8=_0xe261[_0x115401];return _0x4ed7b8;};'use strict';var _=require(_0x1e26('0x0'));var jayson=require(_0x1e26('0x1'));var util=require(_0x1e26('0x2'));var amiClient=jayson[_0x1e26('0x3')][_0x1e26('0x4')]({'port':0x232a});var routingClient=jayson[_0x1e26('0x3')][_0x1e26('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1e26('0x5'),'loggedIn','paused',_0x1e26('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x1e26('0x7'),'inUse',_0x1e26('0x8'),'loggedInDb','notInUse',_0x1e26('0x9'),_0x1e26('0xa'),_0x1e26('0xb'),_0x1e26('0xc'),_0x1e26('0xd'),_0x1e26('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1e26('0xf'),_0x1e26('0x10'),'message',_0x1e26('0x11'),_0x1e26('0x12'),_0x1e26('0x13'),_0x1e26('0x14'),_0x1e26('0x15'),_0x1e26('0x16'),_0x1e26('0x17'),_0x1e26('0x18'),_0x1e26('0x19'),'erlangBusyFactor',_0x1e26('0x1a'),_0x1e26('0x1b'),_0x1e26('0x1c'),'predictiveIntervalAvailable',_0x1e26('0x1d'),_0x1e26('0x1e'),_0x1e26('0x1f'),_0x1e26('0x20'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x2a82a4,_0x4fa3ee){var _0x5ab71d=_0x4fa3ee===_0x1e26('0x21')?amiClient:routingClient;return _0x5ab71d[_0x1e26('0x22')](_[_0x1e26('0x23')](_0x4fa3ee)+_0x1e26('0x24'),_0x2a82a4)[_0x1e26('0x25')](function(_0x70b166){if(_0x70b166[_0x1e26('0x26')])throw new Error(util[_0x1e26('0x27')](_0x1e26('0x28'),_0x4fa3ee));return _0x70b166['result'];})[_0x1e26('0x29')](function(_0x3f6e35){throw _0x3f6e35;});}exports[_0x1e26('0x2a')]=getRealtimeQueues;function initializeQueues(_0x4360f7,_0x31e43e,_0x53f214,_0x3cd685){var _0x57639e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x53f214===_0x1e26('0x21')){if(_0x3cd685===_0x1e26('0x2b')){_0x57639e=_0x57639e[_0x1e26('0x2c')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3cd685===_0x1e26('0x2d')){_0x57639e=_0x57639e[_0x1e26('0x2c')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4360f7[_0x1e26('0x2e')](function(_0x1821a4){var _0x50f03e=_0x1821a4['get']({'plain':!![]});_0x50f03e[_0x1e26('0x2f')]=0x0;_0x50f03e['loggedInDb']=0x0;_0x50f03e['loggedIn']=0x0;_0x50f03e[_0x1e26('0x5')]=0x0;_0x50f03e['waiting']=0x0;if(_0x53f214===_0x1e26('0x21')){_0x50f03e[_0x1e26('0xc')]=0x0;_0x50f03e[_0x1e26('0x7')]=0x0;if(_0x3cd685==='outbound'){_0x50f03e['pTalking']=0x0;_0x50f03e[_0x1e26('0x10')]=0x0;}}var _0x4d4dbe=_[_0x1e26('0x30')](_0x31e43e,['id',_0x50f03e['id']]);if(_0x4d4dbe){_[_0x1e26('0x31')](_0x50f03e,_[_0x1e26('0x32')](_0x4d4dbe,_0x57639e));}return _0x50f03e;});}exports['initializeQueues']=initializeQueues;
\ No newline at end of file
+var _0x592e=['erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','map','get','available','waiting','outbound','merge','pick','initializeQueues','lodash','client','http','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable','unknown','pTalking','originated','message','statusMessage','Trunk','startProgressive','erlangCalls'];(function(_0x32832c,_0x24a45a){var _0x47e377=function(_0x2e1bab){while(--_0x2e1bab){_0x32832c['push'](_0x32832c['shift']());}};_0x47e377(++_0x24a45a);}(_0x592e,0x17a));var _0xe592=function(_0x190da7,_0x343c35){_0x190da7=_0x190da7-0x0;var _0x371875=_0x592e[_0x190da7];return _0x371875;};'use strict';var _=require(_0xe592('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson[_0xe592('0x1')][_0xe592('0x2')]({'port':0x232a});var routingClient=jayson[_0xe592('0x1')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xe592('0x3'),_0xe592('0x4'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xe592('0x5'),_0xe592('0x6'),_0xe592('0x7'),_0xe592('0x8'),_0xe592('0x9'),_0xe592('0xa'),_0xe592('0xb'),_0xe592('0xc'),'talking',_0xe592('0xd'),_0xe592('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xe592('0xf'),_0xe592('0x10'),_0xe592('0x11'),_0xe592('0x12'),'dialActive','dialMethod',_0xe592('0x13'),'startPredictive',_0xe592('0x14'),_0xe592('0x15'),_0xe592('0x16'),_0xe592('0x17'),_0xe592('0x18'),_0xe592('0x19'),'dialPredictiveIntervalMaxThreshold',_0xe592('0x1a'),_0xe592('0x1b'),_0xe592('0x1c'),_0xe592('0x1d'),_0xe592('0x1e'),_0xe592('0x1f'),_0xe592('0x20'),_0xe592('0x21')];function getRealtimeQueues(_0xcfbfd3,_0x15d760){var _0x2bbc84=_0x15d760===_0xe592('0x22')?amiClient:routingClient;return _0x2bbc84[_0xe592('0x23')](_['startCase'](_0x15d760)+'Queues',_0xcfbfd3)['then'](function(_0x18fcb2){if(_0x18fcb2['error'])throw new Error(util[_0xe592('0x24')](_0xe592('0x25'),_0x15d760));return _0x18fcb2[_0xe592('0x26')];})['catch'](function(_0x416e41){throw _0x416e41;});}exports[_0xe592('0x27')]=getRealtimeQueues;function initializeQueues(_0x1759eb,_0x49d513,_0x18c864,_0x3ffe46){var _0xa4b4e=DEFAULT_QUEUE_ATTRIBUTES;if(_0x18c864===_0xe592('0x22')){if(_0x3ffe46===_0xe592('0x28')){_0xa4b4e=_0xa4b4e[_0xe592('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x3ffe46==='outbound'){_0xa4b4e=_0xa4b4e[_0xe592('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1759eb[_0xe592('0x2a')](function(_0x2b382a){var _0xd4a3be=_0x2b382a[_0xe592('0x2b')]({'plain':!![]});_0xd4a3be[_0xe592('0x4')]=0x0;_0xd4a3be['loggedInDb']=0x0;_0xd4a3be['loggedIn']=0x0;_0xd4a3be[_0xe592('0x2c')]=0x0;_0xd4a3be[_0xe592('0x2d')]=0x0;if(_0x18c864===_0xe592('0x22')){_0xd4a3be['talking']=0x0;_0xd4a3be[_0xe592('0x5')]=0x0;if(_0x3ffe46===_0xe592('0x2e')){_0xd4a3be['pTalking']=0x0;_0xd4a3be[_0xe592('0x10')]=0x0;}}var _0x16e9ea=_['find'](_0x49d513,['id',_0xd4a3be['id']]);if(_0x16e9ea){_[_0xe592('0x2f')](_0xd4a3be,_[_0xe592('0x30')](_0x16e9ea,_0xa4b4e));}return _0xd4a3be;});}exports[_0xe592('0x31')]=initializeQueues;
\ No newline at end of file
index caef8b4..729b9dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x344adc,_0x183c37){var _0x4014b2=function(_0xe809e5){while(--_0xe809e5){_0x344adc['push'](_0x344adc['shift']());}};_0x4014b2(++_0x183c37);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x21bfab,_0x2fee48){var _0x4db318=function(_0x10396d){while(--_0x10396d){_0x21bfab['push'](_0x21bfab['shift']());}};_0x4db318(++_0x2fee48);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
index 7c1c352..5345d57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2daf=['127.0.0.1','getFirstInterface','cpus','model','createHash','md5','digest','hex','getUuid','platform','licenseToken','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address'];(function(_0x2a169c,_0x3aec5d){var _0x2d25da=function(_0x275fc3){while(--_0x275fc3){_0x2a169c['push'](_0x2a169c['shift']());}};_0x2d25da(++_0x3aec5d);}(_0x2daf,0x1f0));var _0xf2da=function(_0x777456,_0x57998f){_0x777456=_0x777456-0x0;var _0x5895b0=_0x2daf[_0x777456];return _0x5895b0;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf2da('0x0'));var machine=require(_0xf2da('0x1'));var exec=require(_0xf2da('0x2'))['execSync'];var config=require(_0xf2da('0x3'));function getInterfaces(){var _0x10622d=[];var _0x3b5058=os[_0xf2da('0x4')]();var _0x19b22c=_[_0xf2da('0x5')](_[_0xf2da('0x6')](_0x3b5058));for(var _0x224e80=0x0;_0x224e80<_0x19b22c[_0xf2da('0x7')];_0x224e80++){var _0x52f408=_0x3b5058[_0x19b22c[_0x224e80]][_0xf2da('0x8')](function(_0x5f41a3){return _0x5f41a3['family']===_0xf2da('0x9')&&_0x5f41a3[_0xf2da('0xa')]===![];});_0x10622d=_0x10622d[_0xf2da('0xb')](_0x52f408);}return _0x10622d;}function getFirstInterface(){var _0xd95799=_[_0xf2da('0xc')](getInterfaces());return{'macAddress':_0xd95799&&_0xd95799[_0xf2da('0xd')]?_0xd95799[_0xf2da('0xd')]:_0xf2da('0xe'),'ipAddress':_0xd95799&&_0xd95799[_0xf2da('0xf')]?_0xd95799[_0xf2da('0xf')]:_0xf2da('0x10')};}exports[_0xf2da('0x11')]=getFirstInterface;function getCPUhash(){var _0x422665=_[_0xf2da('0x5')](os[_0xf2da('0x12')]()['map'](function(_0x693754){return _0x693754[_0xf2da('0x13')];}))['join'](':');return crypto[_0xf2da('0x14')](_0xf2da('0x15'))['update'](_0x422665)[_0xf2da('0x16')](_0xf2da('0x17'));}exports[_0xf2da('0x18')]=function(){var _0x461a80=os[_0xf2da('0x19')]();var _0x17fbb2=/[0-9a-f-]{36}/;if(config[_0xf2da('0x1a')]&&_0x17fbb2['test'](config[_0xf2da('0x1a')])){return config[_0xf2da('0x1a')];}else if(_0x461a80==='win32'){return exec(_0xf2da('0x1b'),{'encoding':'utf8'})[_0xf2da('0x1c')]('\x0d\x0a','');}else{var _0x221f5f=getFirstInterface();var _0x290019=getCPUhash();var _0x4655a5=_0x290019+'|'+os['hostname']()+'|'+_0x221f5f[_0xf2da('0x1d')]+'|'+_0x221f5f[_0xf2da('0x1e')];var _0x5537a3=crypto[_0xf2da('0x14')](_0xf2da('0x15'))['update'](_0x4655a5)[_0xf2da('0x16')]('hex');return _0x5537a3[_0xf2da('0x1f')](0x0,0x8)+'-'+_0x5537a3[_0xf2da('0x1f')](0x8,0xc)+'-'+_0x5537a3['substring'](0xc,0x10)+'-'+_0x5537a3[_0xf2da('0x1f')](0x10,0x14)+'-'+_0x5537a3[_0xf2da('0x1f')](0x14);}};
\ No newline at end of file
+var _0x4954=['lodash','crypto','bimedia-machine-uuid','../environment','networkInterfaces','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','hex','platform','test','licenseToken','win32','utf8','replace','hostname','digest','substring'];(function(_0x352c08,_0x3c8fd8){var _0xebd1de=function(_0x197a71){while(--_0x197a71){_0x352c08['push'](_0x352c08['shift']());}};_0xebd1de(++_0x3c8fd8);}(_0x4954,0x108));var _0x4495=function(_0x26c533,_0x139a01){_0x26c533=_0x26c533-0x0;var _0x56a9bc=_0x4954[_0x26c533];return _0x56a9bc;};'use strict';var _=require(_0x4495('0x0'));var os=require('os');var crypto=require(_0x4495('0x1'));var machine=require(_0x4495('0x2'));var exec=require('child_process')['execSync'];var config=require(_0x4495('0x3'));function getInterfaces(){var _0x4530bb=[];var _0x27e397=os[_0x4495('0x4')]();var _0x501da2=_['orderBy'](_[_0x4495('0x5')](_0x27e397));for(var _0x24ee41=0x0;_0x24ee41<_0x501da2['length'];_0x24ee41++){var _0x2edb4b=_0x27e397[_0x501da2[_0x24ee41]][_0x4495('0x6')](function(_0x537213){return _0x537213[_0x4495('0x7')]==='IPv4'&&_0x537213[_0x4495('0x8')]===![];});_0x4530bb=_0x4530bb[_0x4495('0x9')](_0x2edb4b);}return _0x4530bb;}function getFirstInterface(){var _0x15ec27=_[_0x4495('0xa')](getInterfaces());return{'macAddress':_0x15ec27&&_0x15ec27[_0x4495('0xb')]?_0x15ec27[_0x4495('0xb')]:_0x4495('0xc'),'ipAddress':_0x15ec27&&_0x15ec27[_0x4495('0xd')]?_0x15ec27[_0x4495('0xd')]:'127.0.0.1'};}exports[_0x4495('0xe')]=getFirstInterface;function getCPUhash(){var _0xd852a4=_[_0x4495('0xf')](os[_0x4495('0x10')]()[_0x4495('0x11')](function(_0x41010c){return _0x41010c[_0x4495('0x12')];}))[_0x4495('0x13')](':');return crypto[_0x4495('0x14')](_0x4495('0x15'))[_0x4495('0x16')](_0xd852a4)['digest'](_0x4495('0x17'));}exports['getUuid']=function(){var _0x123764=os[_0x4495('0x18')]();var _0x347cd4=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x347cd4[_0x4495('0x19')](config[_0x4495('0x1a')])){return config[_0x4495('0x1a')];}else if(_0x123764===_0x4495('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4495('0x1c')})[_0x4495('0x1d')]('\x0d\x0a','');}else{var _0x30ca2c=getFirstInterface();var _0x5abd66=getCPUhash();var _0x1ac2ce=_0x5abd66+'|'+os[_0x4495('0x1e')]()+'|'+_0x30ca2c['macAddress']+'|'+_0x30ca2c['ipAddress'];var _0x584e0c=crypto[_0x4495('0x14')](_0x4495('0x15'))[_0x4495('0x16')](_0x1ac2ce)[_0x4495('0x1f')]('hex');return _0x584e0c['substring'](0x0,0x8)+'-'+_0x584e0c[_0x4495('0x20')](0x8,0xc)+'-'+_0x584e0c[_0x4495('0x20')](0xc,0x10)+'-'+_0x584e0c[_0x4495('0x20')](0x10,0x14)+'-'+_0x584e0c['substring'](0x14);}};
\ No newline at end of file
index 24d1f89..c1cc6c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa32e=['catch','message','finally','findOrCreate','spread','default','util','request-promise','../../mysqldb','../../components/encryptor','./hardware','license','format','exports','version','GET','then','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s'];(function(_0x54ed79,_0xb0d910){var _0x36fe0f=function(_0x1f2235){while(--_0x1f2235){_0x54ed79['push'](_0x54ed79['shift']());}};_0x36fe0f(++_0xb0d910);}(_0xa32e,0x1f3));var _0xea32=function(_0x47e554,_0x4d1dda){_0x47e554=_0x47e554-0x0;var _0x4190db=_0xa32e[_0x47e554];return _0x4190db;};'use strict';var util=require(_0xea32('0x0'));var moment=require('moment');var rp=require(_0xea32('0x1'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require(_0xea32('0x2'))['db'];var encryptor=require(_0xea32('0x3'));var hardware=require(_0xea32('0x4'));var logger=require('../logger')(_0xea32('0x5'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x13f8d5){return new BPromise(function(_0x1f8a50,_0x2fb2cf){var _0x25edce=util[_0xea32('0x6')]('%s/api/servers/%s/check?version=%s',HOST,_0x13f8d5,module[_0xea32('0x7')]['version']);if(oldToken){_0x25edce=util[_0xea32('0x6')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x13f8d5,module['exports'][_0xea32('0x8')],oldToken);}var _0x2f1b6a={'uri':_0x25edce,'method':_0xea32('0x9'),'timeout':0xea60,'json':!![]};return rp(_0x2f1b6a)[_0xea32('0xa')](function(_0x161bf0){_0x1f8a50(_0x161bf0);})['catch'](function(_0x528fba){_0x2fb2cf(_0x528fba);});});}function manageLicense(_0x51d0e1,_0xf5f65d){var _0x2a64d6=_0xf5f65d['get']({'plain':!![]});if(!isOldTokenSent&&_0x2a64d6['data1']!==_0x51d0e1&&!_0x2a64d6[_0xea32('0xb')]){oldToken=_0x2a64d6['data1'];}httpRequest(_0x51d0e1)[_0xea32('0xa')](function(_0x10610c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x10610c[_0xea32('0xc')]){isOldTokenSent=![];if(!_0x2a64d6[_0xea32('0x5')]&&_0x2a64d6[_0xea32('0x5')]!=_0x10610c[_0xea32('0x5')]||_0x2a64d6['license']&&_0x2a64d6[_0xea32('0xb')]){logger[_0xea32('0xd')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2a64d6[_0xea32('0x5')]&&!_0x2a64d6[_0xea32('0xb')]&&_0x2a64d6[_0xea32('0x5')]!=_0x10610c[_0xea32('0x5')]){logger[_0xea32('0xd')](_0xea32('0xe'));}if(_0x2a64d6[_0xea32('0x5')]&&!_0x2a64d6['data2']&&_0x2a64d6['license']==_0x10610c[_0xea32('0x5')]){return _0xf5f65d;}return _0xf5f65d[_0xea32('0xf')]({'data1':_0x51d0e1,'data2':null,'license':_0x10610c[_0xea32('0x5')]});}else{if(_0x10610c[_0xea32('0x5')]||_0x2a64d6[_0xea32('0x5')]){if(!_0x2a64d6['data2']){if(_0x2a64d6[_0xea32('0x10')]==_0x51d0e1){GRAY_PERIOD_REASON='Disabled';logger[_0xea32('0xd')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xea32('0xd')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2a64d6[_0xea32('0x10')],_0x51d0e1);}logger[_0xea32('0xd')](_0xea32('0x11'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0xea32('0x6')]('YYYY-MM-DD\x20HH:mm'));return _0xf5f65d[_0xea32('0xf')]({'data2':encryptor[_0xea32('0x12')](moment()[_0xea32('0x6')](_0xea32('0x13')))});}else{if(moment()['diff'](encryptor[_0xea32('0x14')](_0x2a64d6['data2']),_0xea32('0x15'))>DAYS){logger['info'](_0xea32('0x16'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0xf5f65d[_0xea32('0xf')]({'data1':_0x51d0e1,'data2':null,'license':null});}}}else{if(_0x2a64d6[_0xea32('0x10')]!=_0x51d0e1){logger[_0xea32('0xd')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2a64d6[_0xea32('0x10')],_0x51d0e1);return _0xf5f65d[_0xea32('0xf')]({'data1':_0x51d0e1,'data2':null,'license':null});}}}return _0xf5f65d;})['then'](function(_0x128bdd){_0xf5f65d=_0x128bdd;})[_0xea32('0x17')](function(_0x5d81b7){logger['error'](_0x5d81b7[_0xea32('0x18')]);})[_0xea32('0x19')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xf5f65d);},TIME);});}function defaultLicense(){var _0x2cd1fe=hardware['getUuid']();if(_0x2cd1fe){return db['License'][_0xea32('0x1a')]({'where':{'id':0x1},'defaults':{'data1':_0x2cd1fe}})[_0xea32('0x1b')](function(_0x5d83d1,_0x4ae011){logger[_0xea32('0xd')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2cd1fe);manageLicense(_0x2cd1fe,_0x5d83d1);})[_0xea32('0x17')](function(_0x3a8576){logger['error'](_0x3a8576[_0xea32('0x18')]);});}}exports[_0xea32('0x1c')]=defaultLicense;
\ No newline at end of file
+var _0x7260=['%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','diff','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','catch','message','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','license','format','exports'];(function(_0x566584,_0xfe8be5){var _0x5614d4=function(_0x412a0c){while(--_0x412a0c){_0x566584['push'](_0x566584['shift']());}};_0x5614d4(++_0xfe8be5);}(_0x7260,0x105));var _0x0726=function(_0x5c210b,_0x32b9bf){_0x5c210b=_0x5c210b-0x0;var _0x16868d=_0x7260[_0x5c210b];return _0x16868d;};'use strict';var util=require(_0x0726('0x0'));var moment=require(_0x0726('0x1'));var rp=require(_0x0726('0x2'));var BPromise=require(_0x0726('0x3'));var pkginfo=require(_0x0726('0x4'))(module,_0x0726('0x5'));var db=require(_0x0726('0x6'))['db'];var encryptor=require(_0x0726('0x7'));var hardware=require('./hardware');var logger=require('../logger')(_0x0726('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2a841a){return new BPromise(function(_0x5ddc79,_0x2c72f6){var _0x435d8a=util[_0x0726('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x2a841a,module[_0x0726('0xa')][_0x0726('0x5')]);if(oldToken){_0x435d8a=util[_0x0726('0x9')](_0x0726('0xb'),HOST,_0x2a841a,module[_0x0726('0xa')][_0x0726('0x5')],oldToken);}var _0x2551e4={'uri':_0x435d8a,'method':_0x0726('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x2551e4)[_0x0726('0xd')](function(_0x441ad2){_0x5ddc79(_0x441ad2);})['catch'](function(_0x565638){_0x2c72f6(_0x565638);});});}function manageLicense(_0x13ebd7,_0x2390d3){var _0x6db667=_0x2390d3['get']({'plain':!![]});if(!isOldTokenSent&&_0x6db667[_0x0726('0xe')]!==_0x13ebd7&&!_0x6db667[_0x0726('0xf')]){oldToken=_0x6db667['data1'];}httpRequest(_0x13ebd7)[_0x0726('0xd')](function(_0x142fb2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x142fb2[_0x0726('0x10')]){isOldTokenSent=![];if(!_0x6db667[_0x0726('0x8')]&&_0x6db667['license']!=_0x142fb2[_0x0726('0x8')]||_0x6db667[_0x0726('0x8')]&&_0x6db667[_0x0726('0xf')]){logger[_0x0726('0x11')](_0x0726('0x12'));}if(_0x6db667[_0x0726('0x8')]&&!_0x6db667[_0x0726('0xf')]&&_0x6db667[_0x0726('0x8')]!=_0x142fb2[_0x0726('0x8')]){logger[_0x0726('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x6db667[_0x0726('0x8')]&&!_0x6db667[_0x0726('0xf')]&&_0x6db667[_0x0726('0x8')]==_0x142fb2[_0x0726('0x8')]){return _0x2390d3;}return _0x2390d3[_0x0726('0x13')]({'data1':_0x13ebd7,'data2':null,'license':_0x142fb2[_0x0726('0x8')]});}else{if(_0x142fb2['license']||_0x6db667[_0x0726('0x8')]){if(!_0x6db667[_0x0726('0xf')]){if(_0x6db667[_0x0726('0xe')]==_0x13ebd7){GRAY_PERIOD_REASON=_0x0726('0x14');logger[_0x0726('0x11')](_0x0726('0x15'));}else{GRAY_PERIOD_REASON='Changed';logger[_0x0726('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x6db667['data1'],_0x13ebd7);}logger['info'](_0x0726('0x16'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0x0726('0x17')));return _0x2390d3['update']({'data2':encryptor[_0x0726('0x18')](moment()[_0x0726('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0726('0x19')](encryptor['decryptString'](_0x6db667[_0x0726('0xf')]),'days')>DAYS){logger[_0x0726('0x11')]('DEMO\x20START\x20AT\x20%s',moment()[_0x0726('0x9')](_0x0726('0x17')));isOldTokenSent=![];return _0x2390d3[_0x0726('0x13')]({'data1':_0x13ebd7,'data2':null,'license':null});}}}else{if(_0x6db667[_0x0726('0xe')]!=_0x13ebd7){logger[_0x0726('0x11')](_0x0726('0x1a'),_0x6db667[_0x0726('0xe')],_0x13ebd7);return _0x2390d3[_0x0726('0x13')]({'data1':_0x13ebd7,'data2':null,'license':null});}}}return _0x2390d3;})[_0x0726('0xd')](function(_0x5e94ce){_0x2390d3=_0x5e94ce;})[_0x0726('0x1b')](function(_0x4f3bf3){logger['error'](_0x4f3bf3[_0x0726('0x1c')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x0726('0x1d')](),_0x2390d3);},TIME);});}function defaultLicense(){var _0x56208e=hardware[_0x0726('0x1d')]();if(_0x56208e){return db[_0x0726('0x1e')][_0x0726('0x1f')]({'where':{'id':0x1},'defaults':{'data1':_0x56208e}})['spread'](function(_0x5b75b0,_0x54b610){logger[_0x0726('0x11')](_0x0726('0x20'),_0x56208e);manageLicense(_0x56208e,_0x5b75b0);})[_0x0726('0x1b')](function(_0x40ed28){logger['error'](_0x40ed28['message']);});}}exports[_0x0726('0x21')]=defaultLicense;
\ No newline at end of file
index 827e7f8..2382625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdf9=['machineUuid','gray','deadline','add','days','grayReason','changed','message','User','findAll','role','sequelize','COUNT','col','count','telephone','telephones','forEach','admin','user','catch','pick','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo'];(function(_0x2cdeb3,_0x2e5aa0){var _0x4f81d6=function(_0x447d5c){while(--_0x447d5c){_0x2cdeb3['push'](_0x2cdeb3['shift']());}};_0x4f81d6(++_0x2e5aa0);}(_0xfdf9,0x1dc));var _0x9fdf=function(_0x4568a0,_0x3670bb){_0x4568a0=_0x4568a0-0x0;var _0x1bb2de=_0xfdf9[_0x4568a0];return _0x1bb2de;};'use strict';var util=require(_0x9fdf('0x0'));var _=require(_0x9fdf('0x1'));var moment=require('moment');var BPromise=require(_0x9fdf('0x2'));var hardware=require(_0x9fdf('0x3'));var encryptor=require(_0x9fdf('0x4'));var db=require(_0x9fdf('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9fdf('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9fdf('0x7'),'machineUuid':hardware[_0x9fdf('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9fdf('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9fdf('0x9'),'machineUuid':hardware[_0x9fdf('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4d4bb9){return new BPromise(function(_0x494af8,_0x19a2aa){return db[_0x9fdf('0xa')][_0x9fdf('0xb')](_[_0x9fdf('0xc')](_0x4d4bb9,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0xe70fe1){return checkLicense(_0xe70fe1,null);})[_0x9fdf('0xd')](function(_0x542ce0){_0x494af8(_0x542ce0);return;})['catch'](function(_0x26af3f){_0x19a2aa(_0x26af3f);});});}function checkLicense(_0x2c7d56,_0x264bb2){if(!_0x2c7d56){demoLicense[_0x9fdf('0xe')]=_0x2c7d56[_0x9fdf('0xf')];return demoLicense;}try{var _0x16221f=_0x264bb2||_0x2c7d56['license'];if(_['isEmpty'](_0x16221f)){throw new Error(_0x9fdf('0x10'));}var _0x2202c4=_0x2c7d56[_0x9fdf('0xf')];var _0x409bee=_0x2c7d56[_0x9fdf('0x11')];var _0x31111e=_0x2202c4[_0x9fdf('0x12')]('-')[0x4];var _0xa91a9f=_0x2202c4['split']('-')[0x0];var _0x3cc4d2=encryptor[_0x9fdf('0x13')](_0x16221f,util[_0x9fdf('0x14')](_0x9fdf('0x15'),_0x31111e,_0x2202c4,_0xa91a9f));var _0x513afb=JSON[_0x9fdf('0x16')](_0x3cc4d2);_0x513afb[_0x9fdf('0x17')]=![];_0x513afb[_0x9fdf('0xe')]=_0x2202c4;_0x513afb[_0x9fdf('0x18')]=hardware[_0x9fdf('0x8')]();if(_0x409bee){var _0x205daf=encryptor['decryptString'](_0x409bee);_0x513afb[_0x9fdf('0x19')]=_0x205daf;_0x513afb[_0x9fdf('0x1a')]=moment(_0x205daf)[_0x9fdf('0x1b')](0x7,_0x9fdf('0x1c'))[_0x9fdf('0x14')]();_0x513afb[_0x9fdf('0x1d')]=_0x513afb[_0x9fdf('0xe')]!=_0x513afb[_0x9fdf('0x18')]?_0x9fdf('0x1e'):'disabled';}return _0x513afb;}catch(_0x454f9e){breakingLicense['uuid']=_0x2c7d56[_0x9fdf('0xf')];breakingLicense[_0x9fdf('0x1f')]=_0x454f9e[_0x9fdf('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x28ad6d,_0x5ddd5f){getLicense()[_0x9fdf('0xd')](function(_0x43fbfe){return db[_0x9fdf('0x20')][_0x9fdf('0x21')]({'attributes':[_0x9fdf('0x22'),[db[_0x9fdf('0x23')]['fn'](_0x9fdf('0x24'),db[_0x9fdf('0x23')][_0x9fdf('0x25')]('role')),_0x9fdf('0x26')]],'group':_0x9fdf('0x22'),'where':{'role':{'$or':['admin','user',_0x9fdf('0x27')]}},'raw':!![]})[_0x9fdf('0xd')](function(_0x2aa61d){var _0x371455={'user':_0x43fbfe['users']||0x0,'telephone':_0x43fbfe[_0x9fdf('0x28')]||0x0};_0x2aa61d[_0x9fdf('0x29')](function(_0x1e189e){var _0x45dc5f=_0x1e189e[_0x9fdf('0x22')]===_0x9fdf('0x2a')?_0x9fdf('0x2b'):_0x1e189e[_0x9fdf('0x22')];_0x371455[_0x45dc5f]-=_0x1e189e['count'];if(_0x371455[_0x45dc5f]<0x0)_0x371455[_0x45dc5f]=0x0;});_0x28ad6d(_0x371455);return;});})[_0x9fdf('0x2c')](function(_0x1d09c8){_0x5ddd5f(_0x1d09c8);});});}function checkUserLimits(_0x20e413){return new BPromise(function(_0x2de549,_0x32fcf6){getLimits()[_0x9fdf('0xd')](function(_0x46a16b){var _0x4603ce=_[_0x9fdf('0x2d')](_[_0x9fdf('0x2e')](_0x20e413,'role'),[_0x9fdf('0x2a'),_0x9fdf('0x2b'),_0x9fdf('0x27')]);var _0x1b16db=(_0x4603ce['admin']||0x0)+(_0x4603ce['user']||0x0);var _0x507f6a=_0x4603ce[_0x9fdf('0x27')]||0x0;if(_0x1b16db>_0x46a16b[_0x9fdf('0x2b')])return _0x32fcf6(_0x9fdf('0x2f'));if(_0x507f6a>_0x46a16b[_0x9fdf('0x27')])return _0x32fcf6(_0x9fdf('0x30'));return _0x2de549();})['catch'](function(_0x4d7fa1){_0x32fcf6(_0x4d7fa1);});});}module[_0x9fdf('0x31')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xdeb9=['grayReason','message','User','sequelize','role','count','user','users','telephones','forEach','admin','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','defaults','then','catch','uuid','data1','isEmpty','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','add'];(function(_0x42f95b,_0x2e2989){var _0x3e74f1=function(_0x25a042){while(--_0x25a042){_0x42f95b['push'](_0x42f95b['shift']());}};_0x3e74f1(++_0x2e2989);}(_0xdeb9,0xb8));var _0x9deb=function(_0x16e8f4,_0x2e705e){_0x16e8f4=_0x16e8f4-0x0;var _0x5b8986=_0xdeb9[_0x16e8f4];return _0x5b8986;};'use strict';var util=require('util');var _=require(_0x9deb('0x0'));var moment=require('moment');var BPromise=require(_0x9deb('0x1'));var hardware=require(_0x9deb('0x2'));var encryptor=require(_0x9deb('0x3'));var db=require(_0x9deb('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9deb('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9deb('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9deb('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x9deb('0x7'),'machineUuid':hardware[_0x9deb('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xe24759){return new BPromise(function(_0x311e8a,_0x48ed66){return db[_0x9deb('0x9')]['find'](_[_0x9deb('0xa')](_0xe24759,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x3bb3fa){return checkLicense(_0x3bb3fa,null);})[_0x9deb('0xb')](function(_0x2ce52e){_0x311e8a(_0x2ce52e);return;})[_0x9deb('0xc')](function(_0x13f6d3){_0x48ed66(_0x13f6d3);});});}function checkLicense(_0x30993d,_0x20faec){if(!_0x30993d){demoLicense[_0x9deb('0xd')]=_0x30993d[_0x9deb('0xe')];return demoLicense;}try{var _0xa9b41f=_0x20faec||_0x30993d['license'];if(_[_0x9deb('0xf')](_0xa9b41f)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x278d24=_0x30993d['data1'];var _0x2d532a=_0x30993d[_0x9deb('0x10')];var _0x3e823f=_0x278d24['split']('-')[0x4];var _0x3fb657=_0x278d24[_0x9deb('0x11')]('-')[0x0];var _0x42be8c=encryptor['decryptString'](_0xa9b41f,util[_0x9deb('0x12')](_0x9deb('0x13'),_0x3e823f,_0x278d24,_0x3fb657));var _0x2346fa=JSON[_0x9deb('0x14')](_0x42be8c);_0x2346fa[_0x9deb('0x15')]=![];_0x2346fa[_0x9deb('0xd')]=_0x278d24;_0x2346fa[_0x9deb('0x16')]=hardware['getUuid']();if(_0x2d532a){var _0x536bd3=encryptor[_0x9deb('0x17')](_0x2d532a);_0x2346fa[_0x9deb('0x18')]=_0x536bd3;_0x2346fa['deadline']=moment(_0x536bd3)[_0x9deb('0x19')](0x7,'days')[_0x9deb('0x12')]();_0x2346fa[_0x9deb('0x1a')]=_0x2346fa['uuid']!=_0x2346fa[_0x9deb('0x16')]?'changed':'disabled';}return _0x2346fa;}catch(_0x1ee8fa){breakingLicense['uuid']=_0x30993d[_0x9deb('0xe')];breakingLicense[_0x9deb('0x1b')]=_0x1ee8fa[_0x9deb('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x862d9f,_0x187da3){getLicense()[_0x9deb('0xb')](function(_0x2299fa){return db[_0x9deb('0x1c')]['findAll']({'attributes':['role',[db[_0x9deb('0x1d')]['fn']('COUNT',db[_0x9deb('0x1d')]['col'](_0x9deb('0x1e'))),_0x9deb('0x1f')]],'group':_0x9deb('0x1e'),'where':{'role':{'$or':['admin',_0x9deb('0x20'),'telephone']}},'raw':!![]})['then'](function(_0x5d67d2){var _0x2d71be={'user':_0x2299fa[_0x9deb('0x21')]||0x0,'telephone':_0x2299fa[_0x9deb('0x22')]||0x0};_0x5d67d2[_0x9deb('0x23')](function(_0x452254){var _0x13588d=_0x452254[_0x9deb('0x1e')]===_0x9deb('0x24')?_0x9deb('0x20'):_0x452254['role'];_0x2d71be[_0x13588d]-=_0x452254[_0x9deb('0x1f')];if(_0x2d71be[_0x13588d]<0x0)_0x2d71be[_0x13588d]=0x0;});_0x862d9f(_0x2d71be);return;});})['catch'](function(_0x208afd){_0x187da3(_0x208afd);});});}function checkUserLimits(_0x1d6438){return new BPromise(function(_0x597154,_0x4bd46f){getLimits()[_0x9deb('0xb')](function(_0x4ef698){var _0x389a20=_['pick'](_[_0x9deb('0x25')](_0x1d6438,'role'),[_0x9deb('0x24'),_0x9deb('0x20'),_0x9deb('0x26')]);var _0x35b3ce=(_0x389a20[_0x9deb('0x24')]||0x0)+(_0x389a20[_0x9deb('0x20')]||0x0);var _0x50f1d8=_0x389a20[_0x9deb('0x26')]||0x0;if(_0x35b3ce>_0x4ef698['user'])return _0x4bd46f(_0x9deb('0x27'));if(_0x50f1d8>_0x4ef698[_0x9deb('0x26')])return _0x4bd46f(_0x9deb('0x28'));return _0x597154();})[_0x9deb('0xc')](function(_0x1f1e4f){_0x4bd46f(_0x1f1e4f);});});}module[_0x9deb('0x29')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index de6b577..11fb0d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f0e=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0x136deb,_0x1be08c){var _0x5c009d=function(_0xc0eb7a){while(--_0xc0eb7a){_0x136deb['push'](_0x136deb['shift']());}};_0x5c009d(++_0x1be08c);}(_0x9f0e,0x116));var _0xe9f0=function(_0x40e976,_0xfaa87d){_0x40e976=_0x40e976-0x0;var _0x267707=_0x9f0e[_0x40e976];return _0x267707;};'use strict';module[_0xe9f0('0x0')]={'DOMAIN':_0xe9f0('0x1'),'SESSION_SECRET':_0xe9f0('0x2'),'GOOGLE_ID':_0xe9f0('0x3'),'GOOGLE_SECRET':_0xe9f0('0x4'),'DEBUG':''};
\ No newline at end of file
+var _0x1a85=['secret','myappanuglar-secret','app-id'];(function(_0x43ac5c,_0x3a8f43){var _0x15775d=function(_0x1c2f3d){while(--_0x1c2f3d){_0x43ac5c['push'](_0x43ac5c['shift']());}};_0x15775d(++_0x3a8f43);}(_0x1a85,0x178));var _0x51a8=function(_0x5b3946,_0x23053c){_0x5b3946=_0x5b3946-0x0;var _0x2bd577=_0x1a85[_0x5b3946];return _0x2bd577;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x51a8('0x0'),'GOOGLE_ID':_0x51a8('0x1'),'GOOGLE_SECRET':_0x51a8('0x2'),'DEBUG':''};
\ No newline at end of file
index 4c840ad..a2a4692 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7567=['../utils/loggers','fileLogger','exports'];(function(_0x248228,_0x471d26){var _0xfae98c=function(_0x3dc4b1){while(--_0x3dc4b1){_0x248228['push'](_0x248228['shift']());}};_0xfae98c(++_0x471d26);}(_0x7567,0x120));var _0x7756=function(_0xc8a52d,_0x63015b){_0xc8a52d=_0xc8a52d-0x0;var _0x358d2d=_0x7567[_0xc8a52d];return _0x358d2d;};'use strict';var fileLogger=require(_0x7756('0x0'))[_0x7756('0x1')];module[_0x7756('0x2')]=fileLogger;
\ No newline at end of file
+var _0xa817=['../utils/loggers','fileLogger'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xa817,0x1a0));var _0x7a81=function(_0x1574ec,_0x2201fc){_0x1574ec=_0x1574ec-0x0;var _0x47f1ba=_0xa817[_0x1574ec];return _0x47f1ba;};'use strict';var fileLogger=require(_0x7a81('0x0'))[_0x7a81('0x1')];module['exports']=fileLogger;
\ No newline at end of file
index 7af7522..b9896f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ff1=['express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x1624f5,_0xa2f147){var _0x23b431=function(_0x5393d4){while(--_0x5393d4){_0x1624f5['push'](_0x1624f5['shift']());}};_0x23b431(++_0xa2f147);}(_0x6ff1,0x185));var _0x16ff=function(_0x1452ca,_0x425d39){_0x1452ca=_0x1452ca-0x0;var _0x583f0b=_0x6ff1[_0x1452ca];return _0x583f0b;};'use strict';var path=require(_0x16ff('0x0'));var os=require('os');var config={'apps':[{'name':_0x16ff('0x1'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x3'))},{'name':_0x16ff('0x4'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x5'))},{'name':_0x16ff('0x6'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x7'))},{'name':'email','script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x8'))},{'name':'routing','script':path[_0x16ff('0x2')](__dirname,_0x16ff('0x9'))},{'name':_0x16ff('0xa'),'script':path[_0x16ff('0x2')](__dirname,_0x16ff('0xb'))}]};module[_0x16ff('0xc')]=config;
\ No newline at end of file
+var _0x8bc7=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0x1d467b,_0x22be08){var _0x429e03=function(_0x1d8493){while(--_0x1d8493){_0x1d467b['push'](_0x1d467b['shift']());}};_0x429e03(++_0x22be08);}(_0x8bc7,0x160));var _0x78bc=function(_0x3cfee2,_0x3902a6){_0x3cfee2=_0x3cfee2-0x0;var _0x1e9312=_0x8bc7[_0x3cfee2];return _0x1e9312;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x78bc('0x0'),'script':path[_0x78bc('0x1')](__dirname,'../../services/express/index.js')},{'name':'ami','script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x2'))},{'name':_0x78bc('0x3'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x4'))},{'name':_0x78bc('0x5'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x6'))},{'name':_0x78bc('0x7'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0x8'))},{'name':_0x78bc('0x9'),'script':path[_0x78bc('0x1')](__dirname,_0x78bc('0xa'))}]};module[_0x78bc('0xb')]=config;
\ No newline at end of file
index 15e007d..335828a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f9=['connect','start','then','stop','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config'];(function(_0x3be478,_0x5ab600){var _0x3f7689=function(_0x53c5db){while(--_0x53c5db){_0x3be478['push'](_0x3be478['shift']());}};_0x3f7689(++_0x5ab600);}(_0x62f9,0x1c5));var _0x962f=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0x62f9[_0x162780];return _0x1ea2dc;};'use strict';var pm2=require('pm2');var BPromise=require(_0x962f('0x0'));var config=require(_0x962f('0x1'));function connect(){return new BPromise(function(_0x254d82,_0x45b436){return pm2[_0x962f('0x2')](function(_0x4b3d4c){if(_0x4b3d4c){return _0x45b436(_0x4b3d4c);}return _0x254d82('connected');});});};exports[_0x962f('0x3')]=function(_0x3bb5de){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x242db6,_0x54206d){return pm2[_0x962f('0x3')](_0x3bb5de,function(_0x229769,_0x45c444){if(_0x229769){return _0x54206d(_0x229769);}pm2['disconnect']();return _0x242db6(_0x45c444);});});});};exports[_0x962f('0x5')]=function(_0x39e5a9){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x151d07,_0x3932c7){return pm2['stop'](_0x39e5a9,function(_0x1079db,_0x4afe5a){if(_0x1079db){return _0x3932c7(_0x1079db);}pm2[_0x962f('0x6')]();return _0x151d07(_0x4afe5a);});});});};exports[_0x962f('0x7')]=function(_0x26a5a4){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x3c15df,_0x3270c6){return pm2[_0x962f('0x7')](_0x26a5a4,function(_0x2a459d,_0x2e381a){if(_0x2a459d){return _0x3270c6(_0x2a459d);}pm2[_0x962f('0x6')]();return _0x3c15df(_0x2e381a);});});});};exports[_0x962f('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x399887,_0x1ca6cd){return pm2[_0x962f('0x8')](function(_0x2ec545,_0x26a506){if(_0x2ec545){return _0x1ca6cd(_0x2ec545);}pm2[_0x962f('0x6')]();return _0x399887(_0x26a506);});});});};exports['describe']=function(_0x5bb200){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x10dcfc,_0x1e4bfd){return pm2[_0x962f('0x9')](_0x5bb200,function(_0x5ecede,_0x25c6e7){if(_0x5ecede){return _0x1e4bfd(_0x5ecede);}pm2[_0x962f('0x6')]();return _0x10dcfc(_0x25c6e7);});});});};exports['delete']=function(_0x204f9d){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x2c61c0,_0x192287){return pm2[_0x962f('0xa')](_0x204f9d,function(_0x31ec29,_0x335380){if(_0x31ec29){return _0x192287(_0x31ec29);}pm2[_0x962f('0x6')]();return _0x2c61c0(_0x335380);});});});};exports[_0x962f('0xb')]=function(){return connect()[_0x962f('0x4')](function(){return new BPromise(function(_0x1502e0,_0x302726){return pm2[_0x962f('0xb')](function(_0x52056a){if(_0x52056a){return _0x302726(_0x52056a);}return _0x1502e0(_0x962f('0xc'));});});});};
\ No newline at end of file
+var _0xb4d1=['restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connected','start','then','disconnect','stop'];(function(_0xbe51fd,_0x6c956){var _0x4fa8ee=function(_0x5c1fc1){while(--_0x5c1fc1){_0xbe51fd['push'](_0xbe51fd['shift']());}};_0x4fa8ee(++_0x6c956);}(_0xb4d1,0x1b8));var _0x1b4d=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xb4d1[_0x311c35];return _0x5cc50c;};'use strict';var pm2=require(_0x1b4d('0x0'));var BPromise=require(_0x1b4d('0x1'));var config=require(_0x1b4d('0x2'));function connect(){return new BPromise(function(_0x4122ff,_0x5e2eda){return pm2['connect'](function(_0x3adb8f){if(_0x3adb8f){return _0x5e2eda(_0x3adb8f);}return _0x4122ff(_0x1b4d('0x3'));});});};exports[_0x1b4d('0x4')]=function(_0x31a815){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x4979c1,_0x5d74df){return pm2[_0x1b4d('0x4')](_0x31a815,function(_0x34604c,_0x14c8a5){if(_0x34604c){return _0x5d74df(_0x34604c);}pm2[_0x1b4d('0x6')]();return _0x4979c1(_0x14c8a5);});});});};exports[_0x1b4d('0x7')]=function(_0x5d6d2c){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x4cf38c,_0x4c34d1){return pm2[_0x1b4d('0x7')](_0x5d6d2c,function(_0x7427a9,_0x266685){if(_0x7427a9){return _0x4c34d1(_0x7427a9);}pm2[_0x1b4d('0x6')]();return _0x4cf38c(_0x266685);});});});};exports[_0x1b4d('0x8')]=function(_0x53823c){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x3c9f43,_0x3937d0){return pm2[_0x1b4d('0x8')](_0x53823c,function(_0x58228b,_0x4b38eb){if(_0x58228b){return _0x3937d0(_0x58228b);}pm2['disconnect']();return _0x3c9f43(_0x4b38eb);});});});};exports[_0x1b4d('0x9')]=function(){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x5a4c07,_0x49e647){return pm2[_0x1b4d('0x9')](function(_0x52ab55,_0x566282){if(_0x52ab55){return _0x49e647(_0x52ab55);}pm2[_0x1b4d('0x6')]();return _0x5a4c07(_0x566282);});});});};exports[_0x1b4d('0xa')]=function(_0x136911){return connect()['then'](function(){return new BPromise(function(_0x3431e9,_0x4e3b91){return pm2[_0x1b4d('0xa')](_0x136911,function(_0x5e4c9f,_0x11a7ae){if(_0x5e4c9f){return _0x4e3b91(_0x5e4c9f);}pm2[_0x1b4d('0x6')]();return _0x3431e9(_0x11a7ae);});});});};exports[_0x1b4d('0xb')]=function(_0x4975d6){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x3b92be,_0xf8f932){return pm2[_0x1b4d('0xb')](_0x4975d6,function(_0x5cb38a,_0x3d1a48){if(_0x5cb38a){return _0xf8f932(_0x5cb38a);}pm2['disconnect']();return _0x3b92be(_0x3d1a48);});});});};exports['dump']=function(){return connect()[_0x1b4d('0x5')](function(){return new BPromise(function(_0x5e64f6,_0x21b214){return pm2[_0x1b4d('0xc')](function(_0x57924c){if(_0x57924c){return _0x21b214(_0x57924c);}return _0x5e64f6(_0x1b4d('0xd'));});});});};
\ No newline at end of file
index 478b802..b27407f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x752f=['format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','subtract','minutes','length','map','info','join','system','timeout'];(function(_0x5d701f,_0x118997){var _0x4ae155=function(_0x5290b0){while(--_0x5290b0){_0x5d701f['push'](_0x5d701f['shift']());}};_0x4ae155(++_0x118997);}(_0x752f,0xcb));var _0xf752=function(_0x200b13,_0x4b6bf7){_0x200b13=_0x200b13-0x0;var _0x2c4c56=_0x752f[_0x200b13];return _0x2c4c56;};'use strict';var _=require(_0xf752('0x0'));var moment=require(_0xf752('0x1'));var Redis=require('ioredis');var util=require(_0xf752('0x2'));var config=require(_0xf752('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xf752('0x4'))(_0xf752('0x5'));config[_0xf752('0x6')]=_[_0xf752('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf752('0x8'))(new Redis(config[_0xf752('0x6')]));function closeInteractions(){var _0x53b9de=0x0;var _0x1e42f4=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xf752('0x9')],'where':{'id':0x1}})[_0xf752('0xa')](function(_0x106066){_0x53b9de=_0x106066['chatTimeout'];if(_0x53b9de){return db[_0xf752('0xb')][_0xf752('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf752('0xd')](_0x106066['chatTimeout'],_0xf752('0xe'))}}});}else{return[];}})[_0xf752('0xa')](function(_0x4b5ad2){if(_0x4b5ad2&&_0x4b5ad2[_0xf752('0xf')]){_0x1e42f4=_[_0xf752('0x10')](_0x4b5ad2||[],'id');logger[_0xf752('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x1e42f4[_0xf752('0x12')]());return db[_0xf752('0xb')]['update']({'closeReason':_0xf752('0x13'),'disposition':_0xf752('0x14'),'closed':!![],'closedAt':moment()[_0xf752('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x1e42f4}});}})['then'](function(){if(_0x1e42f4&&_0x1e42f4[_0xf752('0xf')]){logger[_0xf752('0x11')](_0xf752('0x16'),_0x1e42f4[_0xf752('0x12')]());for(var _0x46cedd=0x0;_0x46cedd<_0x1e42f4[_0xf752('0xf')];_0x46cedd++){io['emit'](_0xf752('0x17'),{'id':_0x1e42f4[_0x46cedd],'closed':!![]});}}})[_0xf752('0x18')](function(_0x2c9661){logger[_0xf752('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x2c9661?util[_0xf752('0x1a')](_0x2c9661,{'showHidden':![],'depth':null}):'');});}exports[_0xf752('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xaa66=['[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','chatInteraction:update','catch','error','inspect','start','lodash','moment','ioredis','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','system','timeout','format'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xaa66,0xa3));var _0x6aa6=function(_0x39e63b,_0x4db05c){_0x39e63b=_0x39e63b-0x0;var _0x20be39=_0xaa66[_0x39e63b];return _0x20be39;};'use strict';var _=require(_0x6aa6('0x0'));var moment=require(_0x6aa6('0x1'));var Redis=require(_0x6aa6('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0x6aa6('0x3'))('schedule');config[_0x6aa6('0x4')]=_[_0x6aa6('0x5')](config['redis'],{'host':_0x6aa6('0x6'),'port':0x18eb});var io=require(_0x6aa6('0x7'))(new Redis(config[_0x6aa6('0x4')]));function closeInteractions(){var _0x39cba4=0x0;var _0x32bb3f=[];return db[_0x6aa6('0x8')][_0x6aa6('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6aa6('0xa')](function(_0x5d46ca){_0x39cba4=_0x5d46ca[_0x6aa6('0xb')];if(_0x39cba4){return db[_0x6aa6('0xc')][_0x6aa6('0xd')]({'raw':!![],'attributes':['id',_0x6aa6('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6aa6('0xf')](_0x5d46ca[_0x6aa6('0xb')],_0x6aa6('0x10'))}}});}else{return[];}})[_0x6aa6('0xa')](function(_0x56ce51){if(_0x56ce51&&_0x56ce51[_0x6aa6('0x11')]){_0x32bb3f=_['map'](_0x56ce51||[],'id');logger[_0x6aa6('0x12')](_0x6aa6('0x13'),_0x32bb3f['join']());return db[_0x6aa6('0xc')]['update']({'closeReason':_0x6aa6('0x14'),'disposition':_0x6aa6('0x15'),'closed':!![],'closedAt':moment()[_0x6aa6('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x32bb3f}});}})[_0x6aa6('0xa')](function(){if(_0x32bb3f&&_0x32bb3f[_0x6aa6('0x11')]){logger[_0x6aa6('0x12')](_0x6aa6('0x17'),_0x32bb3f[_0x6aa6('0x18')]());for(var _0xe68c70=0x0;_0xe68c70<_0x32bb3f[_0x6aa6('0x11')];_0xe68c70++){io[_0x6aa6('0x19')](_0x6aa6('0x1a'),{'id':_0x32bb3f[_0xe68c70],'closed':!![]});}}})[_0x6aa6('0x1b')](function(_0x683dfc){logger[_0x6aa6('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x683dfc?util[_0x6aa6('0x1d')](_0x683dfc,{'showHidden':![],'depth':null}):'');});}exports[_0x6aa6('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 3f701a2..fa63b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3811=['exports','startAllRefreshIntervals'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x3811,0x97));var _0x1381=function(_0x5b2bc9,_0x4a2415){_0x5b2bc9=_0x5b2bc9-0x0;var _0x348893=_0x3811[_0x5b2bc9];return _0x348893;};'use strict';function start(){var _0x1bf5b5=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1bf5b5[_0x1381('0x0')]();}module[_0x1381('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x8da7=['exports'];(function(_0x1f56b7,_0x4ceccf){var _0x6b66fe=function(_0x50ab4f){while(--_0x50ab4f){_0x1f56b7['push'](_0x1f56b7['shift']());}};_0x6b66fe(++_0x4ceccf);}(_0x8da7,0x19b));var _0x78da=function(_0x271a34,_0x950180){_0x271a34=_0x271a34-0x0;var _0x2d4c4b=_0x8da7[_0x271a34];return _0x2d4c4b;};'use strict';function start(){var _0x56a164=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x56a164['startAllRefreshIntervals']();}module[_0x78da('0x0')]={'intervals':{},'start':start};
\ No newline at end of file
index 191826f..af73880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf201=['sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','MailServerOut','CloudProvider','keys','jobs','map','toString','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','run\x20job','active','isBetween','startAt','endAt','add','cron','add\x20cron','stop\x20cron','length','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','\x22%s\x22\x20<%s>','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','format','%s.%s','basename','zip','existsSync','status','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xf201,0x199));var _0x1f20=function(_0x29f631,_0x381b4d){_0x29f631=_0x29f631-0x0;var _0x53376c=_0xf201[_0x29f631];return _0x53376c;};'use strict';var fs=require('fs');var util=require(_0x1f20('0x0'));var path=require(_0x1f20('0x1'));var _=require(_0x1f20('0x2'));var moment=require(_0x1f20('0x3'));var CronJobManager=require(_0x1f20('0x4'));var jayson=require(_0x1f20('0x5'));var BPromise=require(_0x1f20('0x6'));var logger=require(_0x1f20('0x7'))(_0x1f20('0x8'));var db=require(_0x1f20('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x1f20('0xa'));var client=jayson['client'][_0x1f20('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x154c82,_0x3cbb1a){return function(){logger[_0x1f20('0xc')](_0x1f20('0xd'),_0x154c82[_0x1f20('0xe')]);var _0x1d97d1=!![];var _0x14d4df=_0x154c82[_0x1f20('0xf')]['getSmtpOptions']();var _0x4a4020={'account':_0x14d4df,'message':{'from':util['format'](_0x1f20('0x10'),_0x154c82[_0x1f20('0xf')][_0x1f20('0x11')],_0x154c82[_0x1f20('0xf')]['email']||_0x154c82[_0x1f20('0xf')]['Smtp'][_0x1f20('0x12')]),'to':_0x154c82[_0x1f20('0xe')],'cc':_0x154c82['cc'],'bcc':_0x154c82['bcc'],'subject':util['format'](_0x1f20('0x13'),_0x3cbb1a[_0x1f20('0x11')],_0x154c82[_0x1f20('0x14')],_0x154c82['subtractUnit'])}};var _0x31e35b=path[_0x1f20('0x15')](__dirname,_0x1f20('0x16'));var _0x222e99=_0x3cbb1a[_0x1f20('0x17')];var _0x2e76b8=util[_0x1f20('0x18')](_0x1f20('0x19'),path[_0x1f20('0x1a')](_0x3cbb1a[_0x1f20('0x17')],path['extname'](_0x3cbb1a[_0x1f20('0x17')])),_0x1f20('0x1b'));var _0x541ea3=path[_0x1f20('0x15')](_0x31e35b,_0x222e99);var _0x14319e=path[_0x1f20('0x15')](_0x31e35b,_0x2e76b8);if(fs[_0x1f20('0x1c')](_0x541ea3)){_0x3cbb1a[_0x1f20('0x1d')]='Sent';_0x4a4020['message'][_0x1f20('0x1e')]=[{'filename':_0x222e99,'path':_0x541ea3}];_0x4a4020[_0x1f20('0x1f')][_0x1f20('0x20')]=util[_0x1f20('0x18')](_0x1f20('0x21'),JSON['stringify'](_0x3cbb1a,null,0x2));}else if(fs[_0x1f20('0x1c')](_0x14319e)){_0x3cbb1a[_0x1f20('0x1d')]=_0x1f20('0x22');_0x4a4020[_0x1f20('0x1f')][_0x1f20('0x1e')]=[{'filename':_0x2e76b8,'path':_0x14319e}];}else{_0x4a4020[_0x1f20('0x1f')][_0x1f20('0x20')]=_0x1f20('0x23');if(!_0x154c82[_0x1f20('0x24')]){_0x1d97d1=![];logger[_0x1f20('0xc')](_0x1f20('0x25'));}}if(_0x1d97d1){return client[_0x1f20('0x26')](_0x1f20('0x27'),_0x4a4020)[_0x1f20('0x28')](function(_0x27feaf){if(_0x27feaf['error']){return logger[_0x1f20('0x29')](_0x1f20('0x2a'),JSON[_0x1f20('0x2b')](_0x27feaf));}return logger[_0x1f20('0xc')](_0x1f20('0x2c'));})[_0x1f20('0x2d')](function(_0x1d7110){return logger[_0x1f20('0x29')](_0x1f20('0x2a'),JSON[_0x1f20('0x2b')](_0x1d7110));});}};}function handleError(){return function(_0x278d57){return logger['error'](JSON[_0x1f20('0x2b')](_0x278d57));};}function handleResult(_0xf5f8b1){return function(_0x44791d){logger[_0x1f20('0xc')](_0x1f20('0x2e'),JSON[_0x1f20('0x2b')](_0x44791d));if(_0xf5f8b1[_0x1f20('0xf')]&&_0xf5f8b1[_0x1f20('0xf')][_0x1f20('0x2f')]&&!_[_0x1f20('0x30')](_0xf5f8b1['email'])){setTimeout(handleSendEmail(_0xf5f8b1,_0x44791d),0x3c*0x3e8);}};}function handleJob(_0x2398d8){return function(){try{if(_['isNil'](_0x2398d8['subtractNumber'])){return logger['info'](_0x1f20('0x31'));}if(_['isNil'](_0x2398d8[_0x1f20('0x32')])){return logger[_0x1f20('0xc')](_0x1f20('0x33'));}var _0x441f60={'startDate':moment()[_0x1f20('0x34')](_0x2398d8['subtractNumber'],_0x2398d8['subtractUnit'])[_0x1f20('0x18')](_0x1f20('0x35')),'endDate':moment()[_0x1f20('0x18')](_0x1f20('0x35')),'type':_0x1f20('0x36'),'output':_0x2398d8[_0x1f20('0x37')],'name':_0x2398d8[_0x1f20('0x11')]};if(!_[_0x1f20('0x30')](_0x2398d8[_0x1f20('0x38')])){logger[_0x1f20('0xc')](_0x1f20('0x39'),_0x2398d8[_0x1f20('0x38')]);return analyticDefaultReportController['runReport']({'id':_0x2398d8[_0x1f20('0x38')]},_0x441f60)[_0x1f20('0x28')](handleResult(_0x2398d8))[_0x1f20('0x2d')](handleError());}if(!_['isNil'](_0x2398d8[_0x1f20('0x3a')])){logger[_0x1f20('0xc')](_0x1f20('0x3b'),_0x2398d8[_0x1f20('0x3a')]);return analyticCustomReportController[_0x1f20('0x3c')]({'id':_0x2398d8[_0x1f20('0x3a')]},_0x441f60)[_0x1f20('0x28')](handleResult(_0x2398d8))[_0x1f20('0x2d')](handleError());}}catch(_0x36fee2){logger[_0x1f20('0x29')](JSON[_0x1f20('0x2b')](_0x36fee2));}return logger[_0x1f20('0xc')](_0x1f20('0x3d'));};}function getJobs(_0x45f3fa){var _0x3d5b1e={};if(_0x45f3fa){_0x3d5b1e['id']=_0x45f3fa;}return db[_0x1f20('0x3e')]['findAll']({'where':_0x3d5b1e,'include':[{'model':db[_0x1f20('0xf')],'attributes':['id',_0x1f20('0x11'),_0x1f20('0xe')],'include':[{'model':db[_0x1f20('0x3f')],'as':_0x1f20('0x2f'),'include':[{'model':db[_0x1f20('0x40')],'as':'CloudProvider'}]}]}]})['then'](function(_0x573c99){var _0x5157e6=_[_0x1f20('0x41')](manager[_0x1f20('0x42')]);var _0x4cc5f2=_[_0x1f20('0x43')](_0x573c99,function(_0x47c9d9){return _0x47c9d9['id']['toString']();});var _0x3f6d24=_['keyBy'](_0x573c99,function(_0x3841e3){return _0x3841e3['id'][_0x1f20('0x44')]();});var _0x418973=_0x45f3fa?_0x4cc5f2:_['difference'](_0x4cc5f2,_0x5157e6);var _0x5c5e3a=_[_0x1f20('0x45')](_0x4cc5f2,_0x5157e6);var _0x52eafb=_[_0x1f20('0x46')](_0x5157e6,_0x4cc5f2);var _0x1e8cc9;var _0x14d25c;for(_0x1e8cc9=0x0;_0x1e8cc9<_0x52eafb['length']&&!_0x45f3fa;_0x1e8cc9+=0x1){_0x14d25c=_0x52eafb[_0x1e8cc9]['toString']();if(manager[_0x1f20('0x47')](_0x14d25c)){manager[_0x1f20('0x48')](_0x14d25c);manager[_0x1f20('0x49')](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x4a'),_0x14d25c);}}logger[_0x1f20('0xc')](_0x1f20('0x4b'),JSON[_0x1f20('0x2b')](_0x418973));for(_0x1e8cc9=0x0;_0x1e8cc9<_0x418973['length'];_0x1e8cc9+=0x1){_0x14d25c=_0x418973[_0x1e8cc9][_0x1f20('0x44')]();logger['info']('index',_0x14d25c);if(_0x45f3fa){logger[_0x1f20('0xc')](_0x1f20('0x4c'),_0x45f3fa);logger[_0x1f20('0xc')](JSON[_0x1f20('0x2b')](_0x3f6d24[_0x14d25c]));BPromise[_0x1f20('0x4d')]()[_0x1f20('0x28')](handleJob(_0x3f6d24[_0x14d25c]));logger[_0x1f20('0xc')](_0x1f20('0x4e'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c]['cron']);}else if(_0x3f6d24[_0x14d25c]['cron']&&_0x3f6d24[_0x14d25c][_0x1f20('0x4f')]&&moment()[_0x1f20('0x50')](_0x3f6d24[_0x14d25c][_0x1f20('0x51')],_0x3f6d24[_0x14d25c][_0x1f20('0x52')])){manager[_0x1f20('0x53')](_0x14d25c,_0x3f6d24[_0x14d25c][_0x1f20('0x54')],handleJob(_0x3f6d24[_0x14d25c]));manager['start'](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x55'),_0x3f6d24[_0x14d25c]['name'],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}else if(manager['exists'](_0x14d25c)){manager[_0x1f20('0x48')](_0x14d25c);manager['deleteJob'](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x56'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}}for(_0x1e8cc9=0x0,_0x14d25c;_0x1e8cc9<_0x5c5e3a[_0x1f20('0x57')]&&!_0x45f3fa;_0x1e8cc9+=0x1){_0x14d25c=_0x5c5e3a[_0x1e8cc9][_0x1f20('0x44')]();if(manager[_0x1f20('0x47')](_0x14d25c)){if(_0x3f6d24[_0x14d25c]['cron']&&_0x3f6d24[_0x14d25c][_0x1f20('0x4f')]&&moment()[_0x1f20('0x50')](_0x3f6d24[_0x14d25c]['startAt'],_0x3f6d24[_0x14d25c][_0x1f20('0x52')])){manager['update'](_0x14d25c,_0x3f6d24[_0x14d25c][_0x1f20('0x54')],handleJob(_0x3f6d24[_0x14d25c]));logger[_0x1f20('0xc')](_0x1f20('0x58'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}else{manager[_0x1f20('0x48')](_0x14d25c);manager[_0x1f20('0x49')](_0x14d25c);logger[_0x1f20('0xc')](_0x1f20('0x56'),_0x3f6d24[_0x14d25c][_0x1f20('0x11')],_0x3f6d24[_0x14d25c][_0x1f20('0x54')]);}}}})['catch'](function(_0x27d882){logger[_0x1f20('0x29')](JSON[_0x1f20('0x2b')](_0x27d882));});}exports['run']=function(_0x5cd201){return getJobs(_0x5cd201);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0xb9b4=['intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','add\x20cron','update','update\x20cron','stop\x20cron','run','start','util','path','moment','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','\x22%s\x22\x20<%s>','name','user','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s','basename','extname','existsSync','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','email\x20sent','catch','Smtp','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','jobs','map','toString','keyBy','difference'];(function(_0x3cb11a,_0x15f068){var _0x2451c7=function(_0x4042f3){while(--_0x4042f3){_0x3cb11a['push'](_0x3cb11a['shift']());}};_0x2451c7(++_0x15f068);}(_0xb9b4,0xbd));var _0x4b9b=function(_0x53983b,_0x1985b6){_0x53983b=_0x53983b-0x0;var _0x4d6c18=_0xb9b4[_0x53983b];return _0x4d6c18;};'use strict';var fs=require('fs');var util=require(_0x4b9b('0x0'));var path=require(_0x4b9b('0x1'));var _=require('lodash');var moment=require(_0x4b9b('0x2'));var CronJobManager=require(_0x4b9b('0x3'));var jayson=require('jayson/promise');var BPromise=require(_0x4b9b('0x4'));var logger=require(_0x4b9b('0x5'))(_0x4b9b('0x6'));var db=require(_0x4b9b('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x4b9b('0x8'));var client=jayson[_0x4b9b('0x9')][_0x4b9b('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x23fc26,_0x23e093){return function(){logger[_0x4b9b('0xb')](_0x4b9b('0xc'),_0x23fc26[_0x4b9b('0xd')]);var _0x3b11b1=!![];var _0x59f927=_0x23fc26[_0x4b9b('0xe')][_0x4b9b('0xf')]();var _0x4669b8={'account':_0x59f927,'message':{'from':util['format'](_0x4b9b('0x10'),_0x23fc26[_0x4b9b('0xe')][_0x4b9b('0x11')],_0x23fc26[_0x4b9b('0xe')][_0x4b9b('0xd')]||_0x23fc26['MailAccount']['Smtp'][_0x4b9b('0x12')]),'to':_0x23fc26['email'],'cc':_0x23fc26['cc'],'bcc':_0x23fc26['bcc'],'subject':util['format'](_0x4b9b('0x13'),_0x23e093[_0x4b9b('0x11')],_0x23fc26[_0x4b9b('0x14')],_0x23fc26[_0x4b9b('0x15')])}};var _0x27bbed=path[_0x4b9b('0x16')](__dirname,_0x4b9b('0x17'));var _0x44a4a2=_0x23e093[_0x4b9b('0x18')];var _0x5399f3=util[_0x4b9b('0x19')](_0x4b9b('0x1a'),path[_0x4b9b('0x1b')](_0x23e093['savename'],path[_0x4b9b('0x1c')](_0x23e093[_0x4b9b('0x18')])),'zip');var _0x1f2a80=path['join'](_0x27bbed,_0x44a4a2);var _0xf7c59c=path[_0x4b9b('0x16')](_0x27bbed,_0x5399f3);if(fs[_0x4b9b('0x1d')](_0x1f2a80)){_0x23e093[_0x4b9b('0x1e')]='Sent';_0x4669b8[_0x4b9b('0x1f')][_0x4b9b('0x20')]=[{'filename':_0x44a4a2,'path':_0x1f2a80}];_0x4669b8[_0x4b9b('0x1f')]['text']=util['format'](_0x4b9b('0x21'),JSON[_0x4b9b('0x22')](_0x23e093,null,0x2));}else if(fs[_0x4b9b('0x1d')](_0xf7c59c)){_0x23e093[_0x4b9b('0x1e')]=_0x4b9b('0x23');_0x4669b8[_0x4b9b('0x1f')]['attachments']=[{'filename':_0x5399f3,'path':_0xf7c59c}];}else{_0x4669b8[_0x4b9b('0x1f')][_0x4b9b('0x24')]=_0x4b9b('0x25');if(!_0x23fc26['sendIfEmpty']){_0x3b11b1=![];logger[_0x4b9b('0xb')](_0x4b9b('0x26'));}}if(_0x3b11b1){return client['request'](_0x4b9b('0x27'),_0x4669b8)[_0x4b9b('0x28')](function(_0x4a1819){if(_0x4a1819['error']){return logger[_0x4b9b('0x29')]('error\x20mail',JSON[_0x4b9b('0x22')](_0x4a1819));}return logger['info'](_0x4b9b('0x2a'));})[_0x4b9b('0x2b')](function(_0x5aea9d){return logger[_0x4b9b('0x29')]('error\x20mail',JSON[_0x4b9b('0x22')](_0x5aea9d));});}};}function handleError(){return function(_0xf48466){return logger['error'](JSON[_0x4b9b('0x22')](_0xf48466));};}function handleResult(_0x4fd217){return function(_0x97ce43){logger[_0x4b9b('0xb')]('data',JSON[_0x4b9b('0x22')](_0x97ce43));if(_0x4fd217[_0x4b9b('0xe')]&&_0x4fd217[_0x4b9b('0xe')][_0x4b9b('0x2c')]&&!_[_0x4b9b('0x2d')](_0x4fd217[_0x4b9b('0xd')])){setTimeout(handleSendEmail(_0x4fd217,_0x97ce43),0x3c*0x3e8);}};}function handleJob(_0x5a7bbe){return function(){try{if(_[_0x4b9b('0x2d')](_0x5a7bbe['subtractNumber'])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x4b9b('0x2d')](_0x5a7bbe[_0x4b9b('0x15')])){return logger[_0x4b9b('0xb')](_0x4b9b('0x2e'));}var _0x5cc32f={'startDate':moment()[_0x4b9b('0x2f')](_0x5a7bbe[_0x4b9b('0x14')],_0x5a7bbe['subtractUnit'])[_0x4b9b('0x19')](_0x4b9b('0x30')),'endDate':moment()['format'](_0x4b9b('0x30')),'type':_0x4b9b('0x31'),'output':_0x5a7bbe['output'],'name':_0x5a7bbe[_0x4b9b('0x11')]};if(!_[_0x4b9b('0x2d')](_0x5a7bbe['DefaultReportId'])){logger[_0x4b9b('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x5a7bbe[_0x4b9b('0x32')]);return analyticDefaultReportController[_0x4b9b('0x33')]({'id':_0x5a7bbe[_0x4b9b('0x32')]},_0x5cc32f)[_0x4b9b('0x28')](handleResult(_0x5a7bbe))[_0x4b9b('0x2b')](handleError());}if(!_[_0x4b9b('0x2d')](_0x5a7bbe[_0x4b9b('0x34')])){logger[_0x4b9b('0xb')]('exec\x20custom\x20report\x20id:%s',_0x5a7bbe[_0x4b9b('0x34')]);return analyticCustomReportController['runReport']({'id':_0x5a7bbe[_0x4b9b('0x34')]},_0x5cc32f)['then'](handleResult(_0x5a7bbe))[_0x4b9b('0x2b')](handleError());}}catch(_0x39ab5a){logger[_0x4b9b('0x29')](JSON[_0x4b9b('0x22')](_0x39ab5a));}return logger[_0x4b9b('0xb')](_0x4b9b('0x35'));};}function getJobs(_0x422b8d){var _0x52b42e={};if(_0x422b8d){_0x52b42e['id']=_0x422b8d;}return db[_0x4b9b('0x36')][_0x4b9b('0x37')]({'where':_0x52b42e,'include':[{'model':db[_0x4b9b('0xe')],'attributes':['id',_0x4b9b('0x11'),_0x4b9b('0xd')],'include':[{'model':db[_0x4b9b('0x38')],'as':_0x4b9b('0x2c'),'include':[{'model':db[_0x4b9b('0x39')],'as':'CloudProvider'}]}]}]})[_0x4b9b('0x28')](function(_0x44d372){var _0x24da77=_['keys'](manager[_0x4b9b('0x3a')]);var _0x5d7113=_[_0x4b9b('0x3b')](_0x44d372,function(_0x3fec4f){return _0x3fec4f['id'][_0x4b9b('0x3c')]();});var _0xae9b7a=_[_0x4b9b('0x3d')](_0x44d372,function(_0x4642b2){return _0x4642b2['id'][_0x4b9b('0x3c')]();});var _0x3c58c8=_0x422b8d?_0x5d7113:_[_0x4b9b('0x3e')](_0x5d7113,_0x24da77);var _0x416b2e=_[_0x4b9b('0x3f')](_0x5d7113,_0x24da77);var _0x2e6a4a=_[_0x4b9b('0x3e')](_0x24da77,_0x5d7113);var _0x116afe;var _0x5b4062;for(_0x116afe=0x0;_0x116afe<_0x2e6a4a[_0x4b9b('0x40')]&&!_0x422b8d;_0x116afe+=0x1){_0x5b4062=_0x2e6a4a[_0x116afe]['toString']();if(manager[_0x4b9b('0x41')](_0x5b4062)){manager[_0x4b9b('0x42')](_0x5b4062);manager[_0x4b9b('0x43')](_0x5b4062);logger['info'](_0x4b9b('0x44'),_0x5b4062);}}logger[_0x4b9b('0xb')](_0x4b9b('0x45'),JSON[_0x4b9b('0x22')](_0x3c58c8));for(_0x116afe=0x0;_0x116afe<_0x3c58c8[_0x4b9b('0x40')];_0x116afe+=0x1){_0x5b4062=_0x3c58c8[_0x116afe]['toString']();logger[_0x4b9b('0xb')]('index',_0x5b4062);if(_0x422b8d){logger[_0x4b9b('0xb')](_0x4b9b('0x46'),_0x422b8d);logger[_0x4b9b('0xb')](JSON['stringify'](_0xae9b7a[_0x5b4062]));BPromise[_0x4b9b('0x47')]()[_0x4b9b('0x28')](handleJob(_0xae9b7a[_0x5b4062]));logger[_0x4b9b('0xb')]('run\x20job',_0xae9b7a[_0x5b4062]['name'],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}else if(_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]&&_0xae9b7a[_0x5b4062][_0x4b9b('0x49')]&&moment()[_0x4b9b('0x4a')](_0xae9b7a[_0x5b4062][_0x4b9b('0x4b')],_0xae9b7a[_0x5b4062][_0x4b9b('0x4c')])){manager[_0x4b9b('0x4d')](_0x5b4062,_0xae9b7a[_0x5b4062][_0x4b9b('0x48')],handleJob(_0xae9b7a[_0x5b4062]));manager['start'](_0x5b4062);logger[_0x4b9b('0xb')](_0x4b9b('0x4e'),_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}else if(manager[_0x4b9b('0x41')](_0x5b4062)){manager[_0x4b9b('0x42')](_0x5b4062);manager['deleteJob'](_0x5b4062);logger[_0x4b9b('0xb')]('stop\x20cron',_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}}for(_0x116afe=0x0,_0x5b4062;_0x116afe<_0x416b2e[_0x4b9b('0x40')]&&!_0x422b8d;_0x116afe+=0x1){_0x5b4062=_0x416b2e[_0x116afe][_0x4b9b('0x3c')]();if(manager[_0x4b9b('0x41')](_0x5b4062)){if(_0xae9b7a[_0x5b4062]['cron']&&_0xae9b7a[_0x5b4062][_0x4b9b('0x49')]&&moment()['isBetween'](_0xae9b7a[_0x5b4062][_0x4b9b('0x4b')],_0xae9b7a[_0x5b4062][_0x4b9b('0x4c')])){manager[_0x4b9b('0x4f')](_0x5b4062,_0xae9b7a[_0x5b4062]['cron'],handleJob(_0xae9b7a[_0x5b4062]));logger[_0x4b9b('0xb')](_0x4b9b('0x50'),_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}else{manager[_0x4b9b('0x42')](_0x5b4062);manager['deleteJob'](_0x5b4062);logger[_0x4b9b('0xb')](_0x4b9b('0x51'),_0xae9b7a[_0x5b4062][_0x4b9b('0x11')],_0xae9b7a[_0x5b4062][_0x4b9b('0x48')]);}}}})[_0x4b9b('0x2b')](function(_0xbd60c0){logger[_0x4b9b('0x29')](JSON[_0x4b9b('0x22')](_0xbd60c0));});}exports[_0x4b9b('0x52')]=function(_0x595fcf){return getJobs(_0x595fcf);};exports[_0x4b9b('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index b72a942..35f24a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49f8=['sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','data1','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','resolve','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Negative','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeRegion','Cloud\x20Provider\x20not\x20available','forEach','push','all','catch','start','lodash','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment'];(function(_0x21bb2f,_0x4199b9){var _0x279b0e=function(_0x4014b5){while(--_0x4014b5){_0x21bb2f['push'](_0x21bb2f['shift']());}};_0x279b0e(++_0x4199b9);}(_0x49f8,0xff));var _0x849f=function(_0x166953,_0x214d3a){_0x166953=_0x166953-0x0;var _0x4a8baf=_0x49f8[_0x166953];return _0x4a8baf;};var _=require(_0x849f('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0x849f('0x1'));var BPromise=require(_0x849f('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x849f('0x3'))('transcribe');function getTranscriptionJob(_0xdf19d3,_0x59d2a8,_0x4786cc,_0x590f53){return new Promise(function(_0x1e8405,_0x30ebab){var _0x21f577=new AWS[(_0x849f('0x4'))]({'accessKeyId':_0x59d2a8,'secretAccessKey':_0xdf19d3,'region':_0x4786cc});_0x21f577[_0x849f('0x5')]({'TranscriptionJobName':_0x590f53},function(_0xc6443e,_0x565438){if(_0xc6443e){return _0x30ebab(_0xc6443e);}else{return _0x1e8405(_0x565438);}});});}function sentiment(_0x47f0a5,_0x5c013d,_0x306c11,_0x1a902c,_0x3b094c){return new Promise(function(_0x51cf64,_0x1de72f){var _0x28de6e=new AWS[(_0x849f('0x6'))]({'accessKeyId':_0x5c013d,'secretAccessKey':_0x47f0a5,'region':_0x306c11});_0x28de6e['detectSentiment']({'Text':_0x1a902c,'LanguageCode':_0x3b094c[_0x849f('0x7')](0x0,0x2)},function(_0x5b4593,_0xd5525f){if(_0x5b4593){return _0x1de72f(_0x5b4593);}else{return _0x51cf64(_0xd5525f);}});});}function checkTranscribeJob(_0x25b276,_0x401480,_0x23c0ef){var _0x58dede;return new BPromise(function(_0x4f13f9,_0x41f999){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0xa'),_0x25b276['id'],_0x25b276['transcribeName']));return getTranscriptionJob(_0x23c0ef['data1'],_0x23c0ef[_0x849f('0xb')],_0x401480['transcribeRegion'],_0x25b276[_0x849f('0xc')])[_0x849f('0xd')](function(_0x45b940){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0xe'),_0x25b276['id'],_0x25b276[_0x849f('0xc')],_0x45b940['TranscriptionJob'][_0x849f('0xf')]));if(!_0x25b276[_0x849f('0x10')]){switch(_0x45b940[_0x849f('0x11')]['TranscriptionJobStatus']){case _0x849f('0x12'):var _0x364c9b={'transcribeStatus':_0x45b940['TranscriptionJob'][_0x849f('0xf')],'fileUri':_0x45b940[_0x849f('0x11')]['Transcript']['TranscriptFileUri']};logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x13'),_0x25b276['id']));return rp({'uri':_0x45b940[_0x849f('0x11')][_0x849f('0x14')][_0x849f('0x15')],'json':!![]})[_0x849f('0xd')](function(_0x2af70d){logger['info'](util[_0x849f('0x9')](_0x849f('0x16'),_0x25b276['id']));if(_0x2af70d&&_0x2af70d[_0x849f('0x17')]&&_0x2af70d[_0x849f('0x17')][_0x849f('0x18')]&&_0x2af70d['results'][_0x849f('0x18')][_0x849f('0x19')]){_0x364c9b[_0x849f('0x10')]='';for(var _0xe404c6=0x0;_0xe404c6<_0x2af70d[_0x849f('0x17')][_0x849f('0x18')][_0x849f('0x19')];_0xe404c6++){_0x364c9b[_0x849f('0x10')]+=_0x2af70d[_0x849f('0x17')][_0x849f('0x18')][_0xe404c6][_0x849f('0x1a')]+'';}}return _0x25b276[_0x849f('0x1b')](_0x364c9b);})[_0x849f('0xd')](function(){logger['info'](util[_0x849f('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x25b276['id']));if(!_0x25b276[_0x849f('0x1c')]){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x1f'));}if(!_0x401480[_0x849f('0x20')]||!_0x401480[_0x849f('0x21')]||!_0x401480['sentimentRegion']||!_0x401480[_0x849f('0x22')]||!_0x401480[_0x849f('0x23')]){throw new db[(_0x849f('0x1d'))]['ValidationError'](_0x849f('0x24'));}if(!_0x364c9b['fileText']){throw new Error(_0x849f('0x25'));}if(_0x401480[_0x849f('0x21')]===_0x23c0ef['id']){return _0x23c0ef;}else{return db[_0x849f('0x26')][_0x849f('0x27')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x849f('0xd')](function(_0x47eb70){if(!_0x47eb70){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x47eb70['data1']||!_0x47eb70['data2']){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x28'));}_0x58dede=_0x47eb70;logger[_0x849f('0x8')](util[_0x849f('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x25b276['id']));return sentiment(_0x58dede[_0x849f('0x29')],_0x58dede[_0x849f('0xb')],_0x401480[_0x849f('0x2a')],_0x364c9b[_0x849f('0x10')],_0x401480[_0x849f('0x22')]);})[_0x849f('0xd')](function(_0x357f90){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x2b'),_0x25b276['id']));return _0x25b276['update']({'sentiment':_0x357f90['Sentiment'],'sPositive':_0x357f90[_0x849f('0x2c')][_0x849f('0x2d')],'sNegative':_0x357f90[_0x849f('0x2c')]['Negative'],'sMixed':_0x357f90[_0x849f('0x2c')][_0x849f('0x2e')],'sNeutral':_0x357f90[_0x849f('0x2c')][_0x849f('0x2f')]});})['then'](function(){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x30'),_0x25b276['id']));_0x4f13f9();});case _0x849f('0x31'):return _0x25b276[_0x849f('0x1b')]({'transcribeStatus':_0x849f('0x31'),'failureReason':_0x45b940[_0x849f('0x11')]['FailureReason']})[_0x849f('0xd')](function(){logger[_0x849f('0x8')](util[_0x849f('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x25b276['id']));_0x4f13f9();});default:logger['info'](util[_0x849f('0x9')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x25b276['id']));break;}}else{return BPromise[_0x849f('0x32')]()['then'](function(){if(!_0x25b276[_0x849f('0x1c')]){throw new db[(_0x849f('0x1d'))]['ValidationError'](_0x849f('0x1f'));}if(!_0x401480[_0x849f('0x20')]||!_0x401480[_0x849f('0x21')]||!_0x401480[_0x849f('0x2a')]||!_0x401480['language']||!_0x401480['bucket']){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x25b276[_0x849f('0x10')]){throw new Error(_0x849f('0x25'));}if(_0x401480[_0x849f('0x21')]===_0x23c0ef['id']){return _0x23c0ef;}else{return db['CloudProvider'][_0x849f('0x27')]({'where':{'id':_settings[_0x849f('0x21')]}});}})[_0x849f('0xd')](function(_0x258696){if(!_0x258696){throw new db[(_0x849f('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x258696[_0x849f('0x29')]||!_0x258696[_0x849f('0xb')]){throw new db['Sequelize'][(_0x849f('0x1e'))](_0x849f('0x28'));}_0x58dede=_0x258696;logger['info'](util[_0x849f('0x9')](_0x849f('0x33'),_0x25b276['id']));return sentiment(_0x58dede[_0x849f('0x29')],_0x58dede[_0x849f('0xb')],_0x401480[_0x849f('0x2a')],_0x25b276[_0x849f('0x10')],_0x401480[_0x849f('0x22')]);})[_0x849f('0xd')](function(_0x2431ac){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x2b'),_0x25b276['id']));return _0x25b276[_0x849f('0x1b')]({'sentiment':_0x2431ac[_0x849f('0x34')],'sPositive':_0x2431ac['SentimentScore'][_0x849f('0x2d')],'sNegative':_0x2431ac[_0x849f('0x2c')][_0x849f('0x35')],'sMixed':_0x2431ac[_0x849f('0x2c')][_0x849f('0x2e')],'sNeutral':_0x2431ac[_0x849f('0x2c')]['Neutral'],'transcribeStatus':_0x849f('0x12')});})[_0x849f('0xd')](function(){logger[_0x849f('0x8')](util[_0x849f('0x9')](_0x849f('0x30'),_0x25b276['id']));_0x4f13f9();});}})['catch'](function(_0x3913b7){if(_0x3913b7){if(!_0x3913b7['name']||_0x3913b7[_0x849f('0x36')]!==_0x849f('0x37')){logger[_0x849f('0x38')](util[_0x849f('0x9')](_0x849f('0x39'),_0x25b276['id']),util[_0x849f('0x3a')](_0x3913b7,{'showHidden':![],'depth':null}));}}_0x4f13f9();});});}function checkTranscribe(){var _0x4f9f17;var _0x103185;var _0x1d7be3;return db[_0x849f('0x3b')][_0x849f('0x3c')]({'where':{'transcribeStatus':_0x849f('0x3d')}})[_0x849f('0xd')](function(_0x11adfd){if(!_0x11adfd||!_0x11adfd[_0x849f('0x19')]){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x3e'));}_0x4f9f17=_0x11adfd;return db[_0x849f('0x3f')][_0x849f('0x27')]({'where':{'id':0x1}});})[_0x849f('0xd')](function(_0x36e27c){if(!_0x36e27c){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))]('Settings\x20not\x20available');}_0x103185=_0x36e27c;if(!_0x103185[_0x849f('0x40')]||!_0x103185['transcribeAccountId']||!_0x103185[_0x849f('0x41')]||!_0x103185[_0x849f('0x22')]||!_0x103185[_0x849f('0x23')]){throw new db[(_0x849f('0x1d'))]['ValidationError']('Transcribe\x20not\x20configured');}return db['CloudProvider']['findOne']({'where':{'id':_0x103185['transcribeAccountId']}});})['then'](function(_0x1f6117){if(!_0x1f6117){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x42'));}if(!_0x1f6117[_0x849f('0x29')]||!_0x1f6117[_0x849f('0xb')]){throw new db[(_0x849f('0x1d'))][(_0x849f('0x1e'))](_0x849f('0x28'));}_0x1d7be3=_0x1f6117;var _0xa7d9e2=[];_0x4f9f17[_0x849f('0x43')](function(_0x27719a){_0xa7d9e2[_0x849f('0x44')](checkTranscribeJob(_0x27719a,_0x103185,_0x1d7be3));});return BPromise[_0x849f('0x45')](_0xa7d9e2);})[_0x849f('0x46')](function(_0x45f26b){if(_0x45f26b){if(!_0x45f26b['name']||_0x45f26b['name']!==_0x849f('0x37')){logger[_0x849f('0x38')](util[_0x849f('0x3a')](_0x45f26b,{'showHidden':![],'depth':null}));}}});}exports[_0x849f('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x7cda=['TranscriptionJob','fileText','TranscriptionJobStatus','Transcript','TranscriptFileUri','then','transcripts','length','results','tempSentiment','Sequelize','sentimentAccountId','language','bucket','ValidationError','CloudProvider','Cloud\x20Provider\x20not\x20available','sentimentRegion','update','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20configured','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','all','inspect','start','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','getTranscriptionJob','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x7cda,0xf6));var _0xa7cd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7cda[_0x3dd15e];return _0x231fd0;};var _=require('lodash');var AWS=require(_0xa7cd('0x0'));var rp=require(_0xa7cd('0x1'));var util=require(_0xa7cd('0x2'));var BPromise=require('bluebird');var db=require(_0xa7cd('0x3'))['db'];var logger=require(_0xa7cd('0x4'))('transcribe');function getTranscriptionJob(_0x232be5,_0xdb8470,_0x5560e0,_0x37990d){return new Promise(function(_0x5f20a2,_0x3d43e6){var _0x5c2b39=new AWS['TranscribeService']({'accessKeyId':_0xdb8470,'secretAccessKey':_0x232be5,'region':_0x5560e0});_0x5c2b39[_0xa7cd('0x5')]({'TranscriptionJobName':_0x37990d},function(_0x4a9e39,_0x2554e8){if(_0x4a9e39){return _0x3d43e6(_0x4a9e39);}else{return _0x5f20a2(_0x2554e8);}});});}function sentiment(_0x205075,_0x108be3,_0x6d21d3,_0x31879f,_0x372273){return new Promise(function(_0x39d8c4,_0x1a66f7){var _0xd20e5d=new AWS['Comprehend']({'accessKeyId':_0x108be3,'secretAccessKey':_0x205075,'region':_0x6d21d3});_0xd20e5d['detectSentiment']({'Text':_0x31879f,'LanguageCode':_0x372273[_0xa7cd('0x6')](0x0,0x2)},function(_0xf902eb,_0x53cf92){if(_0xf902eb){return _0x1a66f7(_0xf902eb);}else{return _0x39d8c4(_0x53cf92);}});});}function checkTranscribeJob(_0xc60cec,_0x4056ee,_0x57fb93){var _0x3bbf3b;return new BPromise(function(_0x3f72f8,_0x136aae){logger['info'](util[_0xa7cd('0x7')](_0xa7cd('0x8'),_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')]));return getTranscriptionJob(_0x57fb93[_0xa7cd('0xa')],_0x57fb93[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0xc')],_0xc60cec['transcribeName'])['then'](function(_0x44d991){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0xc60cec['id'],_0xc60cec[_0xa7cd('0x9')],_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus']));if(!_0xc60cec[_0xa7cd('0xf')]){switch(_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x10')]){case'COMPLETED':var _0x111774={'transcribeStatus':_0x44d991[_0xa7cd('0xe')]['TranscriptionJobStatus'],'fileUri':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x11')][_0xa7cd('0x12')]};logger['info'](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0xc60cec['id']));return rp({'uri':_0x44d991[_0xa7cd('0xe')]['Transcript']['TranscriptFileUri'],'json':!![]})[_0xa7cd('0x13')](function(_0x4dc29b){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0xc60cec['id']));if(_0x4dc29b&&_0x4dc29b['results']&&_0x4dc29b['results'][_0xa7cd('0x14')]&&_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')]){_0x111774['fileText']='';for(var _0x39f093=0x0;_0x39f093<_0x4dc29b['results'][_0xa7cd('0x14')][_0xa7cd('0x15')];_0x39f093++){_0x111774['fileText']+=_0x4dc29b[_0xa7cd('0x16')][_0xa7cd('0x14')][_0x39f093]['transcript']+'';}}return _0xc60cec['update'](_0x111774);})[_0xa7cd('0x13')](function(){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee['sentimentRegion']||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x111774[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')]['findOne']({'where':{'id':_settings[_0xa7cd('0x19')]}});}})[_0xa7cd('0x13')](function(_0xb4cfa){if(!_0xb4cfa){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0xb4cfa[_0xa7cd('0xa')]||!_0xb4cfa[_0xa7cd('0xb')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Cloud\x20Provider\x20not\x20configured');}_0x3bbf3b=_0xb4cfa;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0xc60cec['id']));return sentiment(_0x3bbf3b['data1'],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0x111774['fileText'],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x29c3d2){logger['info'](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x29c3d2[_0xa7cd('0x21')],'sPositive':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x29c3d2['SentimentScore']['Negative'],'sMixed':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x29c3d2[_0xa7cd('0x22')][_0xa7cd('0x25')]});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});case _0xa7cd('0x26'):return _0xc60cec[_0xa7cd('0x20')]({'transcribeStatus':_0xa7cd('0x26'),'failureReason':_0x44d991[_0xa7cd('0xe')][_0xa7cd('0x27')]})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0xc60cec['id']));_0x3f72f8();});default:logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x28'),_0xc60cec['id']));break;}}else{return BPromise[_0xa7cd('0x29')]()[_0xa7cd('0x13')](function(){if(!_0xc60cec[_0xa7cd('0x17')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4056ee['sentiment']||!_0x4056ee[_0xa7cd('0x19')]||!_0x4056ee[_0xa7cd('0x1f')]||!_0x4056ee[_0xa7cd('0x1a')]||!_0x4056ee['bucket']){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x2a'));}if(!_0xc60cec[_0xa7cd('0xf')]){throw new Error('Transcript\x20not\x20available');}if(_0x4056ee[_0xa7cd('0x19')]===_0x57fb93['id']){return _0x57fb93;}else{return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_settings[_0xa7cd('0x19')]}});}})['then'](function(_0x5d2b48){if(!_0x5d2b48){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x5d2b48[_0xa7cd('0xa')]||!_0x5d2b48['data2']){throw new db['Sequelize'][(_0xa7cd('0x1c'))](_0xa7cd('0x2c'));}_0x3bbf3b=_0x5d2b48;logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2d'),_0xc60cec['id']));return sentiment(_0x3bbf3b[_0xa7cd('0xa')],_0x3bbf3b[_0xa7cd('0xb')],_0x4056ee[_0xa7cd('0x1f')],_0xc60cec[_0xa7cd('0xf')],_0x4056ee[_0xa7cd('0x1a')]);})[_0xa7cd('0x13')](function(_0x31577f){logger[_0xa7cd('0xd')](util[_0xa7cd('0x7')](_0xa7cd('0x2e'),_0xc60cec['id']));return _0xc60cec[_0xa7cd('0x20')]({'sentiment':_0x31577f['Sentiment'],'sPositive':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x23')],'sNegative':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x2f')],'sMixed':_0x31577f[_0xa7cd('0x22')][_0xa7cd('0x24')],'sNeutral':_0x31577f[_0xa7cd('0x22')]['Neutral'],'transcribeStatus':_0xa7cd('0x30')});})[_0xa7cd('0x13')](function(){logger[_0xa7cd('0xd')](util['format'](_0xa7cd('0x31'),_0xc60cec['id']));_0x3f72f8();});}})[_0xa7cd('0x32')](function(_0x6ee082){if(_0x6ee082){if(!_0x6ee082[_0xa7cd('0x33')]||_0x6ee082[_0xa7cd('0x33')]!==_0xa7cd('0x34')){logger[_0xa7cd('0x35')](util[_0xa7cd('0x7')](_0xa7cd('0x36'),_0xc60cec['id']),util['inspect'](_0x6ee082,{'showHidden':![],'depth':null}));}}_0x3f72f8();});});}function checkTranscribe(){var _0x5d1d6d;var _0x54299b;var _0x35e023;return db[_0xa7cd('0x37')][_0xa7cd('0x38')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xa7cd('0x13')](function(_0x2104fe){if(!_0x2104fe||!_0x2104fe['length']){throw new db['Sequelize']['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x5d1d6d=_0x2104fe;return db[_0xa7cd('0x39')][_0xa7cd('0x2b')]({'where':{'id':0x1}});})[_0xa7cd('0x13')](function(_0x11f0d0){if(!_0x11f0d0){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3a'));}_0x54299b=_0x11f0d0;if(!_0x54299b['transcribe']||!_0x54299b[_0xa7cd('0x3b')]||!_0x54299b['transcribeRegion']||!_0x54299b[_0xa7cd('0x1a')]||!_0x54299b[_0xa7cd('0x1b')]){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x3c'));}return db[_0xa7cd('0x1d')][_0xa7cd('0x2b')]({'where':{'id':_0x54299b['transcribeAccountId']}});})[_0xa7cd('0x13')](function(_0x51c67f){if(!_0x51c67f){throw new db[(_0xa7cd('0x18'))][(_0xa7cd('0x1c'))](_0xa7cd('0x1e'));}if(!_0x51c67f[_0xa7cd('0xa')]||!_0x51c67f[_0xa7cd('0xb')]){throw new db['Sequelize']['ValidationError'](_0xa7cd('0x2c'));}_0x35e023=_0x51c67f;var _0x46b48a=[];_0x5d1d6d[_0xa7cd('0x3d')](function(_0x2101ea){_0x46b48a['push'](checkTranscribeJob(_0x2101ea,_0x54299b,_0x35e023));});return BPromise[_0xa7cd('0x3e')](_0x46b48a);})[_0xa7cd('0x32')](function(_0x2dd1a2){if(_0x2dd1a2){if(!_0x2dd1a2[_0xa7cd('0x33')]||_0x2dd1a2['name']!=='SequelizeValidationError'){logger['error'](util[_0xa7cd('0x3f')](_0x2dd1a2,{'showHidden':![],'depth':null}));}}});}exports[_0xa7cd('0x40')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 5ae2e4b..a20d5b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdced=['emit','error','inspect','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','info','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:'];(function(_0x711bc2,_0x43a478){var _0x34fa5d=function(_0x5b3f2c){while(--_0x5b3f2c){_0x711bc2['push'](_0x711bc2['shift']());}};_0x34fa5d(++_0x43a478);}(_0xdced,0xcb));var _0xddce=function(_0x4e566c,_0x16e04c){_0x4e566c=_0x4e566c-0x0;var _0x31947e=_0xdced[_0x4e566c];return _0x31947e;};'use strict';var _=require('lodash');var moment=require(_0xddce('0x0'));var Redis=require(_0xddce('0x1'));var util=require(_0xddce('0x2'));var config=require(_0xddce('0x3'));var db=require(_0xddce('0x4'))['db'];var logger=require(_0xddce('0x5'))('schedule');config[_0xddce('0x6')]=_['defaults'](config[_0xddce('0x6')],{'host':_0xddce('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xddce('0x6')]));function closeInteractions(){var _0x57e11c=[];return db[_0xddce('0x8')][_0xddce('0x9')]({'raw':!![],'attributes':['id',_0xddce('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xddce('0xb')](0x18,'hours')}}})[_0xddce('0xc')](function(_0x392605){if(_0x392605&&_0x392605[_0xddce('0xd')]){_0x57e11c=_['map'](_0x392605||[],'id');logger['info'](_0xddce('0xe'),_0x57e11c[_0xddce('0xf')]());return db['WhatsappInteraction'][_0xddce('0x10')]({'closeReason':_0xddce('0x11'),'disposition':_0xddce('0x12'),'closed':!![],'closedAt':moment()['format'](_0xddce('0x13'))},{'where':{'id':_0x57e11c}});}})['then'](function(){if(_0x57e11c&&_0x57e11c[_0xddce('0xd')]){logger[_0xddce('0x14')](_0xddce('0x15'),_0x57e11c[_0xddce('0xf')]());for(var _0x1e5ca2=0x0;_0x1e5ca2<_0x57e11c[_0xddce('0xd')];_0x1e5ca2++){io[_0xddce('0x16')]('whatsappInteraction:update',{'id':_0x57e11c[_0x1e5ca2],'closed':!![]});}}})['catch'](function(_0x3bbec9){logger[_0xddce('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x3bbec9?util[_0xddce('0x18')](_0x3bbec9,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x889d=['lastMsgAt','subtract','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','system','timeout','format','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','start','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll'];(function(_0x4af93f,_0x5c2ed0){var _0x377cca=function(_0x4ca7dd){while(--_0x4ca7dd){_0x4af93f['push'](_0x4af93f['shift']());}};_0x377cca(++_0x5c2ed0);}(_0x889d,0x179));var _0xd889=function(_0xed1ea6,_0x5d20b7){_0xed1ea6=_0xed1ea6-0x0;var _0x4cc611=_0x889d[_0xed1ea6];return _0x4cc611;};'use strict';var _=require(_0xd889('0x0'));var moment=require(_0xd889('0x1'));var Redis=require(_0xd889('0x2'));var util=require(_0xd889('0x3'));var config=require(_0xd889('0x4'));var db=require(_0xd889('0x5'))['db'];var logger=require(_0xd889('0x6'))(_0xd889('0x7'));config[_0xd889('0x8')]=_[_0xd889('0x9')](config[_0xd889('0x8')],{'host':_0xd889('0xa'),'port':0x18eb});var io=require(_0xd889('0xb'))(new Redis(config[_0xd889('0x8')]));function closeInteractions(){var _0x58dd28=[];return db['WhatsappInteraction'][_0xd889('0xc')]({'raw':!![],'attributes':['id',_0xd889('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xd889('0xe')](0x18,_0xd889('0xf'))}}})[_0xd889('0x10')](function(_0x286ae1){if(_0x286ae1&&_0x286ae1['length']){_0x58dd28=_[_0xd889('0x11')](_0x286ae1||[],'id');logger[_0xd889('0x12')](_0xd889('0x13'),_0x58dd28[_0xd889('0x14')]());return db[_0xd889('0x15')]['update']({'closeReason':_0xd889('0x16'),'disposition':_0xd889('0x17'),'closed':!![],'closedAt':moment()[_0xd889('0x18')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x58dd28}});}})[_0xd889('0x10')](function(){if(_0x58dd28&&_0x58dd28[_0xd889('0x19')]){logger['info'](_0xd889('0x1a'),_0x58dd28[_0xd889('0x14')]());for(var _0x206653=0x0;_0x206653<_0x58dd28['length'];_0x206653++){io[_0xd889('0x1b')]('whatsappInteraction:update',{'id':_0x58dd28[_0x206653],'closed':!![]});}}})[_0xd889('0x1c')](function(_0xcc3481){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xcc3481?util['inspect'](_0xcc3481,{'showHidden':![],'depth':null}):'');});}exports[_0xd889('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 999c1a5..fc87e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4df6=['bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then'];(function(_0x2e43b5,_0x4db3cf){var _0x3666bf=function(_0x4324af){while(--_0x4324af){_0x2e43b5['push'](_0x2e43b5['shift']());}};_0x3666bf(++_0x4db3cf);}(_0x4df6,0x1d1));var _0x64df=function(_0x5d3bd4,_0x3f4535){_0x5d3bd4=_0x5d3bd4-0x0;var _0x51b857=_0x4df6[_0x5d3bd4];return _0x51b857;};'use strict';var util=require(_0x64df('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x64df('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x64df('0x2')+i,'phone':0xf879fb460+i,'email':_0x64df('0x3')+i+_0x64df('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x64df('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x64df('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x64df('0x5')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x64df('0x1')]({'id':i,'firstName':_0x64df('0x6')+i,'lastName':_0x64df('0x2')+i,'phone':0xf879fb460+i,'email':_0x64df('0x3')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x64df('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x64df('0x5')]()});}db[_0x64df('0x7')][_0x64df('0x8')]({'where':{}})[_0x64df('0x9')](function(){return db[_0x64df('0x7')][_0x64df('0xa')](contacts);})[_0x64df('0x9')](function(){console[_0x64df('0xb')](_0x64df('0xc'),_0x64df('0xd'));return db[_0x64df('0xe')]['destroy']({'where':{}});})[_0x64df('0x9')](function(){return db[_0x64df('0xe')][_0x64df('0xa')](hopper);})['then'](function(){console[_0x64df('0xb')](_0x64df('0xc'),_0x64df('0xf'));return db['CmContact'][_0x64df('0xa')](contacts2);})['then'](function(){console['log'](_0x64df('0xc'),_0x64df('0x10'));return db[_0x64df('0xe')][_0x64df('0xa')](hopper2);})[_0x64df('0x9')](function(){console[_0x64df('0xb')](_0x64df('0xc'),_0x64df('0x11'));})[_0x64df('0x12')](function(_0x4b7246){console['log'](_0x4b7246);});
\ No newline at end of file
+var _0xfca2=['bulkCreate','contacts1','CmHopper','log','finished\x20populating','hopper1','contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','push','CmContact','destroy','then'];(function(_0x9faa6a,_0x2127b8){var _0x5c38e5=function(_0x32cce9){while(--_0x32cce9){_0x9faa6a['push'](_0x9faa6a['shift']());}};_0x5c38e5(++_0x2127b8);}(_0xfca2,0x95));var _0x2fca=function(_0x5b7963,_0x10bff5){_0x5b7963=_0x5b7963-0x0;var _0x57f611=_0xfca2[_0x5b7963];return _0x57f611;};'use strict';var util=require(_0x2fca('0x0'));var db=require(_0x2fca('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x2fca('0x2')+i,'lastName':_0x2fca('0x3')+i,'phone':0xf879fb460+i,'email':_0x2fca('0x4')+i+_0x2fca('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2fca('0x6')](),'updatedAt':Date[_0x2fca('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2fca('0x7')]({'id':i,'firstName':_0x2fca('0x2')+i,'lastName':_0x2fca('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2fca('0x7')]({'id':i,'active':![],'scheduledat':Date[_0x2fca('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2fca('0x6')](),'updatedAt':Date['now']()});}db[_0x2fca('0x8')][_0x2fca('0x9')]({'where':{}})[_0x2fca('0xa')](function(){return db[_0x2fca('0x8')][_0x2fca('0xb')](contacts);})[_0x2fca('0xa')](function(){console['log']('finished\x20populating',_0x2fca('0xc'));return db['CmHopper'][_0x2fca('0x9')]({'where':{}});})[_0x2fca('0xa')](function(){return db[_0x2fca('0xd')][_0x2fca('0xb')](hopper);})[_0x2fca('0xa')](function(){console[_0x2fca('0xe')](_0x2fca('0xf'),_0x2fca('0x10'));return db[_0x2fca('0x8')][_0x2fca('0xb')](contacts2);})[_0x2fca('0xa')](function(){console[_0x2fca('0xe')](_0x2fca('0xf'),_0x2fca('0x11'));return db[_0x2fca('0xd')]['bulkCreate'](hopper2);})['then'](function(){console[_0x2fca('0xe')](_0x2fca('0xf'),_0x2fca('0x12'));})[_0x2fca('0x13')](function(_0x3a55a2){console[_0x2fca('0xe')](_0x3a55a2);});
\ No newline at end of file
index c95a2d5..e974885 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc049=['\x22%s\x22\x20<%s>','User','then','log','add\x20user','catch','push','format','agent','%s%s','%s%s@xcally.com','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xc049,0xde));var _0x9c04=function(_0x79098a,_0x143930){_0x79098a=_0x79098a-0x0;var _0x3a959b=_0xc049[_0x79098a];return _0x3a959b;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x9c04('0x0')]({'name':util[_0x9c04('0x1')]('%s%s',_0x9c04('0x2'),i),'fullname':util['format'](_0x9c04('0x3'),_0x9c04('0x2'),i),'email':util[_0x9c04('0x1')](_0x9c04('0x4'),'agent',i),'role':_0x9c04('0x2'),'password':'password','internal':0xfa0+i,'type':_0x9c04('0x5'),'transport':[_0x9c04('0x6'),'ws','wss'],'disallow':[_0x9c04('0x7')],'allow':['ulaw'],'defaultuser':util['format'](_0x9c04('0x3'),_0x9c04('0x2'),i),'encryption':_0x9c04('0x8'),'avpf':_0x9c04('0x8'),'force_avp':_0x9c04('0x8'),'icesupport':'yes','dtlsenable':_0x9c04('0x8'),'dtlsverify':'no','dtlscertfile':_0x9c04('0x9'),'dtlsprivatekey':_0x9c04('0xa'),'dtlssetup':_0x9c04('0xb'),'callerid':util['format'](_0x9c04('0xc'),util[_0x9c04('0x1')](_0x9c04('0x3'),_0x9c04('0x2'),i),0xfa0+i)});}db[_0x9c04('0xd')]['bulkCreate'](users)[_0x9c04('0xe')](function(){console[_0x9c04('0xf')](_0x9c04('0x10'));})[_0x9c04('0x11')](function(_0x503ba7){console[_0x9c04('0xf')](_0x503ba7);});
\ No newline at end of file
+var _0x1e5f=['format','%s%s','agent','%s%s@xcally.com','password','friend','all','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push'];(function(_0x42a831,_0x5e084d){var _0xc8a765=function(_0x1df073){while(--_0x1df073){_0x42a831['push'](_0x42a831['shift']());}};_0xc8a765(++_0x5e084d);}(_0x1e5f,0xb1));var _0xf1e5=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x1e5f[_0x4715d2];return _0x141811;};'use strict';var util=require(_0xf1e5('0x0'));var db=require(_0xf1e5('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf1e5('0x2')]({'name':util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),'fullname':util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),'email':util[_0xf1e5('0x3')](_0xf1e5('0x6'),_0xf1e5('0x5'),i),'role':_0xf1e5('0x5'),'password':_0xf1e5('0x7'),'internal':0xfa0+i,'type':_0xf1e5('0x8'),'transport':['udp','ws','wss'],'disallow':[_0xf1e5('0x9')],'allow':['ulaw'],'defaultuser':util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),'encryption':'yes','avpf':'yes','force_avp':_0xf1e5('0xa'),'icesupport':_0xf1e5('0xa'),'dtlsenable':_0xf1e5('0xa'),'dtlsverify':'no','dtlscertfile':_0xf1e5('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf1e5('0xc'),'callerid':util['format'](_0xf1e5('0xd'),util[_0xf1e5('0x3')](_0xf1e5('0x4'),_0xf1e5('0x5'),i),0xfa0+i)});}db[_0xf1e5('0xe')][_0xf1e5('0xf')](users)[_0xf1e5('0x10')](function(){console[_0xf1e5('0x11')](_0xf1e5('0x12'));})[_0xf1e5('0x13')](function(_0x1ac3c8){console[_0xf1e5('0x11')](_0x1ac3c8);});
\ No newline at end of file
index 7e1cbac..2982c5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c45=['openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','address','request','remotePort','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','role','Campaign','format','length','user:%s','handshake','query','find','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','userProfileId','SmsQueue','WhatsappQueue','getVoiceQueues','getFaxQueues','getMailQueues','all','voice','fax','sms','mail'];(function(_0x5052df,_0x5f232e){var _0x51fd2f=function(_0x488f1a){while(--_0x488f1a){_0x5052df['push'](_0x5052df['shift']());}};_0x51fd2f(++_0x5f232e);}(_0x1c45,0x1b0));var _0x51c4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1c45[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x51c4('0x0'));var util=require(_0x51c4('0x1'));var BPromise=require(_0x51c4('0x2'));var db=require(_0x51c4('0x3'))['db'];var config=require(_0x51c4('0x4'));var queryQueues={'attributes':['id',_0x51c4('0x5')],'include':[{'as':_0x51c4('0x6'),'model':db[_0x51c4('0x7')],'attributes':['id','name','role'],'raw':!![],'where':{'role':_0x51c4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x51c4('0x5')],'where':{'role':_0x51c4('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x51c4('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x51c4('0x5')],'where':{'role':_0x51c4('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x51c4('0x5'),_0x51c4('0xa')],'where':{'type':_0x51c4('0xb')}};function getAssociatedResources(_0x524a08,_0x52fc47,_0x39ceec){return db[_0x51c4('0xc')][_0x51c4('0xd')]({'where':{'name':_0x524a08,'userProfileId':_0x52fc47},'raw':!![]})[_0x51c4('0xe')](function(_0x109781){if(_0x109781){if(_0x109781[_0x51c4('0xf')]){switch(_0x524a08){case'VoiceQueues':case _0x51c4('0x10'):case _0x51c4('0x11'):case _0x51c4('0x12'):case _0x51c4('0x13'):case _0x51c4('0x14'):case _0x51c4('0x15'):return db[_0x39ceec][_0x51c4('0x16')](queryQueues);case _0x51c4('0x17'):return db[_0x39ceec][_0x51c4('0x16')](queryTelephones);case _0x51c4('0x18'):return db[_0x39ceec][_0x51c4('0x16')](queryTrunks);case _0x51c4('0x19'):return db[_0x39ceec][_0x51c4('0x16')](queryCampaigns);}}else{return db['UserProfileResource'][_0x51c4('0x16')]({'attributes':[_0x51c4('0x1a')],'where':{'sectionId':_0x109781['id']},'raw':!![]})['then'](function(_0x312169){if(_0x312169){var _0x42d96f={'where':{'id':_[_0x51c4('0x1b')](_0x312169,_0x51c4('0x1a'))},'raw':!![]};switch(_0x39ceec){case _0x51c4('0x7'):_0x42d96f[_0x51c4('0x1c')][_0x51c4('0x1d')]='telephone';break;case _0x51c4('0x1e'):_0x42d96f[_0x51c4('0x1c')]['type']=_0x51c4('0xb');break;}return db[_0x39ceec]['findAll'](_0x42d96f);}else{return[];}});}}else{return[];}})[_0x51c4('0xe')](function(_0x1f227d){return _0x1f227d;});}function joinOrLeaveQueues(_0x2e7341,_0x44c384,_0x535690,_0x3a67ed){_0x2e7341[_0x44c384](util[_0x51c4('0x1f')]('%s:queue:%s',_0x535690,_0x3a67ed['name']));if(_0x3a67ed[_0x51c4('0x6')]){for(var _0x1fb226=0x0;_0x1fb226<_0x3a67ed[_0x51c4('0x6')][_0x51c4('0x20')];_0x1fb226+=0x1){_0x2e7341[_0x44c384](util[_0x51c4('0x1f')](_0x51c4('0x21'),_0x3a67ed['Agents'][_0x1fb226][_0x51c4('0x5')]));}}}function joinOrLeave(_0x45cc46,_0x3cc1c0,_0x3b56d1){var _0x2281a0;if(_0x45cc46[_0x51c4('0x22')][_0x51c4('0x23')]['id']){db[_0x51c4('0x7')][_0x51c4('0x24')]({'attributes':['id',_0x51c4('0x5'),_0x51c4('0x1d'),'userProfileId'],'where':{'id':_0x45cc46[_0x51c4('0x22')][_0x51c4('0x23')]['id']},'include':[{'model':db[_0x51c4('0x25')],'as':_0x51c4('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x27')],'as':_0x51c4('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x29')],'as':_0x51c4('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2b')],'as':_0x51c4('0x2c'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2d')],'as':_0x51c4('0x2e'),'attributes':['id'],'raw':!![]},{'model':db[_0x51c4('0x2f')],'as':_0x51c4('0x30'),'attributes':['id'],'raw':!![]}]})[_0x51c4('0xe')](function(_0x573f86){if(_0x573f86){_0x2281a0=_0x573f86;_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x21'),_0x573f86['name']));var _0x2275ba=[];switch(_0x573f86[_0x51c4('0x1d')]){case _0x51c4('0x31'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));if(queryQueues['hasOwnProperty'](_0x51c4('0x34'))){delete queryQueues[_0x51c4('0x34')];}_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x36')]['findAll'](queryQueues));_0x2275ba['push'](db[_0x51c4('0x37')][_0x51c4('0x16')](queryQueues));_0x2275ba['push'](db[_0x51c4('0x38')][_0x51c4('0x16')](queryQueues));_0x2275ba['push'](db['SmsQueue'][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x39')]['findAll'](queryQueues));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x3a')][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db['WhatsappQueue'][_0x51c4('0x16')](queryQueues));_0x2275ba[_0x51c4('0x35')](db['User'][_0x51c4('0x16')](queryTelephones));_0x2275ba['push'](db[_0x51c4('0x3b')][_0x51c4('0x16')](queryTrunks));_0x2275ba[_0x51c4('0x35')](db[_0x51c4('0x1e')][_0x51c4('0x16')](queryCampaigns));_0x2275ba['push'](db[_0x51c4('0x7')]['findAll'](queryAgents));break;case _0x51c4('0x3c'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x3d'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x36')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x10'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x37')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x11'),_0x573f86[_0x51c4('0x3e')],'FaxQueue'));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x12'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x3f')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x13'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x39')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x14'),_0x573f86['userProfileId'],_0x51c4('0x3a')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x15'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x40')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources('Telephones',_0x573f86[_0x51c4('0x3e')],_0x51c4('0x7')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x18'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x3b')));_0x2275ba[_0x51c4('0x35')](getAssociatedResources(_0x51c4('0x19'),_0x573f86[_0x51c4('0x3e')],_0x51c4('0x1e')));_0x2275ba['push'](db[_0x51c4('0x7')]['findAll'](queryAgents));break;case _0x51c4('0x8'):_0x45cc46[_0x3cc1c0](_0x51c4('0x32'));_0x45cc46[_0x3cc1c0](_0x51c4('0x33'));_0x2275ba['push'](_0x573f86[_0x51c4('0x41')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getChatQueues']({'attributes':['id',_0x51c4('0x5')]}));_0x2275ba[_0x51c4('0x35')](_0x573f86[_0x51c4('0x42')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getSmsQueues']({'attributes':['id',_0x51c4('0x5')]}));_0x2275ba[_0x51c4('0x35')](_0x573f86[_0x51c4('0x43')]({'attributes':['id','name']}));_0x2275ba[_0x51c4('0x35')](_0x573f86['getOpenchannelQueues']({'attributes':['id','name']}));_0x2275ba['push'](_0x573f86['getWhatsappQueues']({'attributes':['id',_0x51c4('0x5')]}));break;}return BPromise[_0x51c4('0x44')](_0x2275ba);}})[_0x51c4('0xe')](function(_0x3046c9){if(_0x3046c9&&_0x3046c9[_0x51c4('0x20')]){for(var _0x21616a=0x0;_0x21616a<_0x3046c9[_0x51c4('0x20')];_0x21616a+=0x1){for(var _0xa642c=0x0;_0xa642c<_0x3046c9[_0x21616a][_0x51c4('0x20')];_0xa642c+=0x1){switch(_0x21616a){case 0x0:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x45'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x1:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,'chat',_0x3046c9[_0x21616a][_0xa642c]);break;case 0x2:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x46'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x3:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x47'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x4:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x48'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x5:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x49'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x6:joinOrLeaveQueues(_0x45cc46,_0x3cc1c0,_0x51c4('0x4a'),_0x3046c9[_0x21616a][_0xa642c]);break;case 0x7:if(_0x2281a0[_0x51c4('0x1d')]!==_0x51c4('0x8'))_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')]('telephone:%s',_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0x8:if(_0x2281a0[_0x51c4('0x1d')]!==_0x51c4('0x8'))_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x4b'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0x9:if(_0x2281a0[_0x51c4('0x1d')]!=='agent')_0x45cc46[_0x3cc1c0](util[_0x51c4('0x1f')](_0x51c4('0x4c'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0xa')],_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;case 0xa:_0x45cc46[_0x3cc1c0](util['format'](_0x51c4('0x21'),_0x3046c9[_0x21616a][_0xa642c][_0x51c4('0x5')]));break;}}}}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x1f7b02=_[_0x51c4('0x1b')](_0x2281a0['ChatInteractions'],'id');return _0x2281a0[_0x51c4('0x4e')](_0x1f7b02)[_0x51c4('0xe')](function(){for(var _0x53b226=0x0;_0x53b226<_0x1f7b02[_0x51c4('0x20')];_0x53b226+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x50'),{'ChatInteractionId':Number(_0x1f7b02[_0x53b226]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x201020=_[_0x51c4('0x1b')](_0x2281a0['MailInteractions'],'id');return _0x2281a0[_0x51c4('0x51')](_0x201020)[_0x51c4('0xe')](function(){for(var _0x4a1a8c=0x0;_0x4a1a8c<_0x201020[_0x51c4('0x20')];_0x4a1a8c+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x52'),{'MailInteractionId':Number(_0x201020[_0x4a1a8c]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x17c2c7=_['map'](_0x2281a0[_0x51c4('0x2a')],'id');return _0x2281a0[_0x51c4('0x53')](_0x17c2c7)[_0x51c4('0xe')](function(){for(var _0x515ea5=0x0;_0x515ea5<_0x17c2c7[_0x51c4('0x20')];_0x515ea5+=0x1){_0x3b56d1['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x17c2c7[_0x515ea5]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0==='leave'){var _0x3add72=_['map'](_0x2281a0[_0x51c4('0x2c')],'id');return _0x2281a0['removeSmsInteractions'](_0x3add72)['then'](function(){for(var _0x1619c3=0x0;_0x1619c3<_0x3add72[_0x51c4('0x20')];_0x1619c3+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x54'),{'SmsInteractionId':Number(_0x3add72[_0x1619c3]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x5a47be=_['map'](_0x2281a0[_0x51c4('0x2e')],'id');return _0x2281a0['removeOpenchannelInteractions'](_0x5a47be)[_0x51c4('0xe')](function(){for(var _0xc24a04=0x0;_0xc24a04<_0x5a47be[_0x51c4('0x20')];_0xc24a04+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x55'),{'OpenchannelInteractionId':Number(_0x5a47be[_0xc24a04]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0xe')](function(){if(_0x3cc1c0===_0x51c4('0x4d')){var _0x4aa45a=_[_0x51c4('0x1b')](_0x2281a0[_0x51c4('0x30')],'id');return _0x2281a0[_0x51c4('0x56')](_0x4aa45a)[_0x51c4('0xe')](function(){for(var _0x4d1d7d=0x0;_0x4d1d7d<_0x4aa45a[_0x51c4('0x20')];_0x4d1d7d+=0x1){_0x3b56d1[_0x51c4('0x4f')](_0x51c4('0x57'),{'WhatsappInteractionId':Number(_0x4aa45a[_0x4d1d7d]),'UserId':Number(_0x2281a0['id'])});}});}})[_0x51c4('0x58')](function(_0x508613){_0x45cc46['log'](_0x508613);});}}function onDisconnect(_0x4cc05b,_0x17868d){joinOrLeave(_0x4cc05b,_0x51c4('0x4d'),_0x17868d);}function onConnect(_0xcc4cd8){joinOrLeave(_0xcc4cd8,_0x51c4('0x59'));}exports[_0x51c4('0x5a')]=function(_0x75a708){_0x75a708['on'](_0x51c4('0x5b'),function(_0x572553){_0x572553['setMaxListeners'](0x0);_0x572553[_0x51c4('0x5c')]=_0x572553[_0x51c4('0x5d')]['connection']['remoteAddress']+':'+_0x572553[_0x51c4('0x5d')][_0x51c4('0x5b')][_0x51c4('0x5e')];_0x572553['connectedAt']=new Date();_0x572553['log']=function(_0x53e111){console[_0x51c4('0x5f')](_0x51c4('0x60')+_0x572553[_0x51c4('0x61')]['name']+'['+_0x572553[_0x51c4('0x5c')]+']',_0x53e111);};_0x572553['on'](_0x51c4('0x62'),function(){onDisconnect(_0x572553,_0x75a708);_0x572553[_0x51c4('0x5f')](_0x51c4('0x63'));});onConnect(_0x572553);_0x572553[_0x51c4('0x5f')](_0x51c4('0x64'));});};
\ No newline at end of file
+var _0x8c25=['campaign:%s:%s','leave','map','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','connectedAt','nsp','disconnect','CONNECTED','util','../mysqldb','./environment','name','role','agent','telephone','type','then','autoAssociation','ChatQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','User','where','Campaign','ivr','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueues','FaxQueues','SmsQueues','getVoiceQueues','getChatQueues','getSmsQueues','getWhatsappQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s'];(function(_0x110c84,_0x3ae4a8){var _0xb614dc=function(_0x4b3d7b){while(--_0x4b3d7b){_0x110c84['push'](_0x110c84['shift']());}};_0xb614dc(++_0x3ae4a8);}(_0x8c25,0xe2));var _0x58c2=function(_0x5c0eb3,_0x4be675){_0x5c0eb3=_0x5c0eb3-0x0;var _0x32a4e0=_0x8c25[_0x5c0eb3];return _0x32a4e0;};'use strict';var _=require('lodash');var util=require(_0x58c2('0x0'));var BPromise=require('bluebird');var db=require(_0x58c2('0x1'))['db'];var config=require(_0x58c2('0x2'));var queryQueues={'attributes':['id',_0x58c2('0x3')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x58c2('0x3'),_0x58c2('0x4')],'raw':!![],'where':{'role':_0x58c2('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x58c2('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x58c2('0x3')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x58c2('0x3'),_0x58c2('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x42916a,_0x301334,_0x5f1014){return db['UserProfileSection']['findOne']({'where':{'name':_0x42916a,'userProfileId':_0x301334},'raw':!![]})[_0x58c2('0x8')](function(_0x390b4f){if(_0x390b4f){if(_0x390b4f[_0x58c2('0x9')]){switch(_0x42916a){case'VoiceQueues':case _0x58c2('0xa'):case'FaxQueues':case'SmsQueues':case _0x58c2('0xb'):case _0x58c2('0xc'):case _0x58c2('0xd'):return db[_0x5f1014][_0x58c2('0xe')](queryQueues);case _0x58c2('0xf'):return db[_0x5f1014][_0x58c2('0xe')](queryTelephones);case _0x58c2('0x10'):return db[_0x5f1014]['findAll'](queryTrunks);case _0x58c2('0x11'):return db[_0x5f1014][_0x58c2('0xe')](queryCampaigns);}}else{return db[_0x58c2('0x12')][_0x58c2('0xe')]({'attributes':[_0x58c2('0x13')],'where':{'sectionId':_0x390b4f['id']},'raw':!![]})['then'](function(_0xd4ef52){if(_0xd4ef52){var _0x5342a8={'where':{'id':_['map'](_0xd4ef52,_0x58c2('0x13'))},'raw':!![]};switch(_0x5f1014){case _0x58c2('0x14'):_0x5342a8[_0x58c2('0x15')][_0x58c2('0x4')]=_0x58c2('0x6');break;case _0x58c2('0x16'):_0x5342a8[_0x58c2('0x15')][_0x58c2('0x7')]=_0x58c2('0x17');break;}return db[_0x5f1014][_0x58c2('0xe')](_0x5342a8);}else{return[];}});}}else{return[];}})[_0x58c2('0x8')](function(_0x245ca5){return _0x245ca5;});}function joinOrLeaveQueues(_0x3890aa,_0x2ca868,_0x4f1955,_0x3ba7ea){_0x3890aa[_0x2ca868](util[_0x58c2('0x18')](_0x58c2('0x19'),_0x4f1955,_0x3ba7ea['name']));if(_0x3ba7ea[_0x58c2('0x1a')]){for(var _0x52c3ca=0x0;_0x52c3ca<_0x3ba7ea['Agents'][_0x58c2('0x1b')];_0x52c3ca+=0x1){_0x3890aa[_0x2ca868](util[_0x58c2('0x18')](_0x58c2('0x1c'),_0x3ba7ea[_0x58c2('0x1a')][_0x52c3ca][_0x58c2('0x3')]));}}}function joinOrLeave(_0x18d361,_0x5b419f,_0x804ace){var _0x2d42d2;if(_0x18d361[_0x58c2('0x1d')][_0x58c2('0x1e')]['id']){db['User'][_0x58c2('0x1f')]({'attributes':['id','name','role',_0x58c2('0x20')],'where':{'id':_0x18d361[_0x58c2('0x1d')][_0x58c2('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x58c2('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x22')],'as':_0x58c2('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x24')],'as':_0x58c2('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x26')],'as':_0x58c2('0x27'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x58c2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x58c2('0x29')],'as':_0x58c2('0x2a'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x377955){if(_0x377955){_0x2d42d2=_0x377955;_0x18d361[_0x5b419f](util[_0x58c2('0x18')]('user:%s',_0x377955[_0x58c2('0x3')]));var _0x30e40f=[];switch(_0x377955[_0x58c2('0x4')]){case _0x58c2('0x2b'):_0x18d361[_0x5b419f](_0x58c2('0x2c'));_0x18d361[_0x5b419f](_0x58c2('0x2d'));if(queryQueues[_0x58c2('0x2e')](_0x58c2('0x2f'))){delete queryQueues[_0x58c2('0x2f')];}_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x31')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x32')][_0x58c2('0xe')](queryQueues));_0x30e40f['push'](db[_0x58c2('0x33')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x34')][_0x58c2('0xe')](queryQueues));_0x30e40f['push'](db[_0x58c2('0x35')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x36')][_0x58c2('0xe')](queryQueues));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x37')][_0x58c2('0xe')](queryQueues));_0x30e40f['push'](db[_0x58c2('0x14')][_0x58c2('0xe')](queryTelephones));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x38')]['findAll'](queryTrunks));_0x30e40f[_0x58c2('0x30')](db[_0x58c2('0x16')]['findAll'](queryCampaigns));_0x30e40f[_0x58c2('0x30')](db['User'][_0x58c2('0xe')](queryAgents));break;case _0x58c2('0x39'):_0x18d361[_0x5b419f]('voice:inbound');_0x18d361[_0x5b419f](_0x58c2('0x2d'));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x3a'),_0x377955['userProfileId'],_0x58c2('0x31')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0xa'),_0x377955[_0x58c2('0x20')],_0x58c2('0x32')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x3b'),_0x377955[_0x58c2('0x20')],_0x58c2('0x33')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x3c'),_0x377955['userProfileId'],_0x58c2('0x34')));_0x30e40f['push'](getAssociatedResources(_0x58c2('0xb'),_0x377955[_0x58c2('0x20')],_0x58c2('0x35')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources('OpenchannelQueues',_0x377955[_0x58c2('0x20')],_0x58c2('0x36')));_0x30e40f['push'](getAssociatedResources('WhatsappQueues',_0x377955[_0x58c2('0x20')],_0x58c2('0x37')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources('Telephones',_0x377955[_0x58c2('0x20')],_0x58c2('0x14')));_0x30e40f[_0x58c2('0x30')](getAssociatedResources(_0x58c2('0x10'),_0x377955['userProfileId'],_0x58c2('0x38')));_0x30e40f['push'](getAssociatedResources('IvrCampaigns',_0x377955[_0x58c2('0x20')],_0x58c2('0x16')));_0x30e40f['push'](db[_0x58c2('0x14')]['findAll'](queryAgents));break;case _0x58c2('0x5'):_0x18d361[_0x5b419f](_0x58c2('0x2c'));_0x18d361[_0x5b419f](_0x58c2('0x2d'));_0x30e40f['push'](_0x377955[_0x58c2('0x3d')]({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955[_0x58c2('0x3e')]({'attributes':['id','name']}));_0x30e40f['push'](_0x377955['getFaxQueues']({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955[_0x58c2('0x3f')]({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955['getMailQueues']({'attributes':['id','name']}));_0x30e40f[_0x58c2('0x30')](_0x377955['getOpenchannelQueues']({'attributes':['id',_0x58c2('0x3')]}));_0x30e40f[_0x58c2('0x30')](_0x377955[_0x58c2('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0x58c2('0x41')](_0x30e40f);}})[_0x58c2('0x8')](function(_0x3ac186){if(_0x3ac186&&_0x3ac186['length']){for(var _0x539b70=0x0;_0x539b70<_0x3ac186[_0x58c2('0x1b')];_0x539b70+=0x1){for(var _0x463cb1=0x0;_0x463cb1<_0x3ac186[_0x539b70][_0x58c2('0x1b')];_0x463cb1+=0x1){switch(_0x539b70){case 0x0:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x42'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x1:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x43'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x2:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x44'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x3:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x45'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x4:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x46'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x5:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x47'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x6:joinOrLeaveQueues(_0x18d361,_0x5b419f,_0x58c2('0x48'),_0x3ac186[_0x539b70][_0x463cb1]);break;case 0x7:if(_0x2d42d2[_0x58c2('0x4')]!==_0x58c2('0x5'))_0x18d361[_0x5b419f](util[_0x58c2('0x18')](_0x58c2('0x49'),_0x3ac186[_0x539b70][_0x463cb1][_0x58c2('0x3')]));break;case 0x8:if(_0x2d42d2[_0x58c2('0x4')]!==_0x58c2('0x5'))_0x18d361[_0x5b419f](util[_0x58c2('0x18')]('trunk:%s',_0x3ac186[_0x539b70][_0x463cb1]['name']));break;case 0x9:if(_0x2d42d2['role']!==_0x58c2('0x5'))_0x18d361[_0x5b419f](util[_0x58c2('0x18')](_0x58c2('0x4a'),_0x3ac186[_0x539b70][_0x463cb1]['type'],_0x3ac186[_0x539b70][_0x463cb1][_0x58c2('0x3')]));break;case 0xa:_0x18d361[_0x5b419f](util[_0x58c2('0x18')](_0x58c2('0x1c'),_0x3ac186[_0x539b70][_0x463cb1]['name']));break;}}}}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x2496dd=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x21')],'id');return _0x2d42d2[_0x58c2('0x4d')](_0x2496dd)[_0x58c2('0x8')](function(){for(var _0x3eeeaa=0x0;_0x3eeeaa<_0x2496dd[_0x58c2('0x1b')];_0x3eeeaa+=0x1){_0x804ace['emit'](_0x58c2('0x4e'),{'ChatInteractionId':Number(_0x2496dd[_0x3eeeaa]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x4cf499=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x23')],'id');return _0x2d42d2[_0x58c2('0x4f')](_0x4cf499)[_0x58c2('0x8')](function(){for(var _0x1e3e90=0x0;_0x1e3e90<_0x4cf499[_0x58c2('0x1b')];_0x1e3e90+=0x1){_0x804ace[_0x58c2('0x50')](_0x58c2('0x51'),{'MailInteractionId':Number(_0x4cf499[_0x1e3e90]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x8a697e=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x25')],'id');return _0x2d42d2[_0x58c2('0x52')](_0x8a697e)[_0x58c2('0x8')](function(){for(var _0x1f7e9d=0x0;_0x1f7e9d<_0x8a697e['length'];_0x1f7e9d+=0x1){_0x804ace[_0x58c2('0x50')](_0x58c2('0x53'),{'FaxInteractionId':Number(_0x8a697e[_0x1f7e9d]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x340935=_[_0x58c2('0x4c')](_0x2d42d2[_0x58c2('0x27')],'id');return _0x2d42d2[_0x58c2('0x54')](_0x340935)[_0x58c2('0x8')](function(){for(var _0x4bba23=0x0;_0x4bba23<_0x340935[_0x58c2('0x1b')];_0x4bba23+=0x1){_0x804ace[_0x58c2('0x50')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x340935[_0x4bba23]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x3422b8=_['map'](_0x2d42d2[_0x58c2('0x28')],'id');return _0x2d42d2[_0x58c2('0x55')](_0x3422b8)[_0x58c2('0x8')](function(){for(var _0x54d57c=0x0;_0x54d57c<_0x3422b8[_0x58c2('0x1b')];_0x54d57c+=0x1){_0x804ace[_0x58c2('0x50')](_0x58c2('0x56'),{'OpenchannelInteractionId':Number(_0x3422b8[_0x54d57c]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x8')](function(){if(_0x5b419f===_0x58c2('0x4b')){var _0x3f3338=_['map'](_0x2d42d2[_0x58c2('0x2a')],'id');return _0x2d42d2['removeWhatsappInteractions'](_0x3f3338)[_0x58c2('0x8')](function(){for(var _0x4057bb=0x0;_0x4057bb<_0x3f3338['length'];_0x4057bb+=0x1){_0x804ace['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3f3338[_0x4057bb]),'UserId':Number(_0x2d42d2['id'])});}});}})[_0x58c2('0x57')](function(_0x4e6c3d){_0x18d361[_0x58c2('0x58')](_0x4e6c3d);});}}function onDisconnect(_0x21333c,_0x56bd3f){joinOrLeave(_0x21333c,_0x58c2('0x4b'),_0x56bd3f);}function onConnect(_0x2832f5){joinOrLeave(_0x2832f5,_0x58c2('0x59'));}exports[_0x58c2('0x5a')]=function(_0x5a63c1){_0x5a63c1['on'](_0x58c2('0x5b'),function(_0x1ab8cd){_0x1ab8cd[_0x58c2('0x5c')](0x0);_0x1ab8cd['address']=_0x1ab8cd[_0x58c2('0x5d')]['connection'][_0x58c2('0x5e')]+':'+_0x1ab8cd['request']['connection'][_0x58c2('0x5f')];_0x1ab8cd[_0x58c2('0x60')]=new Date();_0x1ab8cd[_0x58c2('0x58')]=function(_0x56d151){console['log']('SocketIO\x20'+_0x1ab8cd[_0x58c2('0x61')][_0x58c2('0x3')]+'['+_0x1ab8cd['address']+']',_0x56d151);};_0x1ab8cd['on'](_0x58c2('0x62'),function(){onDisconnect(_0x1ab8cd,_0x5a63c1);_0x1ab8cd[_0x58c2('0x58')]('DISCONNECTED');});onConnect(_0x1ab8cd);_0x1ab8cd[_0x58c2('0x58')](_0x58c2('0x63'));});};
\ No newline at end of file
index 5091db0..159ac83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f2=['agent','incomingmessage','outgoingmessage','AfterCreateMessage','get','offlineMessage','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','changed','closed','AfterUpdate','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterUpdate','closedinteraction','afterCreate','newmessage','ChatOfflineMessage','SmsInteraction','newinteraction','Sms','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','error','code','Trigger,\x20%s','catch','channel','motionChannel','event','direction','resolve','then','ContactId','undefined','query','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name'];(function(_0x2a3fee,_0x1d9274){var _0x22add6=function(_0x54b0ed){while(--_0x54b0ed){_0x2a3fee['push'](_0x2a3fee['shift']());}};_0x22add6(++_0x1d9274);}(_0x13f2,0xf9));var _0x213f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x13f2[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x213f('0x0'));var db=require(_0x213f('0x1'))['db'];var jayson=require(_0x213f('0x2'));var logger=require(_0x213f('0x3'))(_0x213f('0x4'));var client=jayson[_0x213f('0x5')][_0x213f('0x6')]({'port':0x232a});var triggers=[{'channel':_0x213f('0x7'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x213f('0x7'),'model':_0x213f('0x8'),'event':_0x213f('0x9'),'condition':_0x213f('0xa'),'callback':afterUpdate},{'channel':_0x213f('0x7'),'model':'ChatMessage','event':_0x213f('0xb'),'condition':_0x213f('0xc'),'callback':afterCreateMessage},{'channel':_0x213f('0x7'),'model':_0x213f('0xd'),'event':_0x213f('0xb'),'condition':_0x213f('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x213f('0xe'),'event':_0x213f('0xb'),'condition':_0x213f('0xf'),'callback':afterCreate},{'channel':_0x213f('0x10'),'model':_0x213f('0xe'),'event':_0x213f('0x9'),'condition':_0x213f('0xa'),'callback':afterUpdate},{'channel':_0x213f('0x10'),'model':'SmsMessage','event':_0x213f('0xb'),'condition':_0x213f('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x213f('0x11'),'event':_0x213f('0xb'),'condition':_0x213f('0xf'),'callback':afterCreate},{'channel':_0x213f('0x12'),'model':_0x213f('0x11'),'event':_0x213f('0x9'),'condition':_0x213f('0xa'),'callback':afterUpdate},{'channel':_0x213f('0x12'),'model':_0x213f('0x13'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x213f('0x14'),'model':_0x213f('0x15'),'event':_0x213f('0xb'),'condition':_0x213f('0xf'),'callback':afterCreate},{'channel':_0x213f('0x14'),'model':_0x213f('0x15'),'event':_0x213f('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x213f('0x14'),'model':'FaxMessage','event':_0x213f('0xb'),'condition':_0x213f('0xc'),'callback':afterCreateMessage},{'channel':_0x213f('0x16'),'model':_0x213f('0x17'),'event':'afterCreate','condition':_0x213f('0xf'),'callback':afterCreate},{'channel':_0x213f('0x16'),'model':'MailInteraction','event':_0x213f('0x9'),'condition':_0x213f('0xa'),'callback':afterUpdate},{'channel':_0x213f('0x16'),'model':_0x213f('0x18'),'event':_0x213f('0xb'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x213f('0x19'),'model':_0x213f('0x1a'),'event':_0x213f('0xb'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x213f('0x19'),'model':_0x213f('0x1a'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x213f('0x19'),'model':_0x213f('0x1b'),'event':_0x213f('0xb'),'condition':_0x213f('0xc'),'callback':afterCreateMessage}];function request(_0x5a2d9f){return client[_0x213f('0x1c')]('EventManager',_0x5a2d9f)['then'](function(_0x2460d3){logger['info']('Trigger,\x20%s',_0x213f('0x1d'),_0x2460d3);if(_0x2460d3[_0x213f('0x1e')]){if(_0x2460d3[_0x213f('0x1e')][_0x213f('0x1f')]===0x1f4){logger['error'](_0x213f('0x20'),_0x213f('0x1d'),_0x2460d3[_0x213f('0x1e')]);}}})[_0x213f('0x21')](function(_0xba71fa){logger[_0x213f('0x1e')](_0x213f('0x20'),'EventManager',_0xba71fa);});}function afterCreateMessage(_0x46406b){return function(_0x320ce9){_0x320ce9=_0x320ce9['get']({'plain':!![]});_0x320ce9[_0x213f('0x22')]=_0x46406b;_0x320ce9[_0x213f('0x23')]=_0x46406b;_0x320ce9[_0x213f('0x24')]=_0x320ce9[_0x213f('0x25')];Promise[_0x213f('0x26')]()[_0x213f('0x27')](function(){if(typeof _0x320ce9[_0x213f('0x28')]===_0x213f('0x29'))return null;var _0x17cda3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x320ce9[_0x213f('0x28')];return db['sequelize'][_0x213f('0x2a')](_0x17cda3,{'type':db['Sequelize'][_0x213f('0x2b')][_0x213f('0x2c')],'raw':!![]});})[_0x213f('0x27')](function(_0x54b944){if(_0x54b944){_0x320ce9[_0x213f('0x2d')]=_0x54b944[0x0];}if(typeof _0x320ce9[_0x213f('0x2e')]===_0x213f('0x29'))return;return getAgent(_0x320ce9[_0x213f('0x2e')]);})[_0x213f('0x27')](function(_0x2fdf5c){if(_0x2fdf5c){_0x320ce9[_0x213f('0x2f')]=util[_0x213f('0x30')](_0x213f('0x31'),_0x2fdf5c[_0x213f('0x32')]);_0x320ce9[_0x213f('0x33')]=_0x2fdf5c;_0x320ce9['channel']=_0x46406b;return request({'event':_0x213f('0x34'),'message':_0x320ce9});}else{return request({'event':_0x213f('0x35'),'message':_0x320ce9});}})[_0x213f('0x21')](function(_0x17749c){logger[_0x213f('0x1e')](_0x213f('0x20'),_0x213f('0x36'),_0x17749c);});};}function afterCreateOfflineMessage(_0x51a990){return function(_0x45168a){_0x45168a=_0x45168a[_0x213f('0x37')]({'plain':!![]});_0x45168a[_0x213f('0x22')]=_0x51a990;_0x45168a[_0x213f('0x23')]=_0x51a990;_0x45168a[_0x213f('0x24')]=_0x213f('0x38');return request({'event':_0x45168a['event'],'message':_0x45168a});};}function afterCreate(_0x526d32,_0x484804){return function(_0x4985f8){_0x4985f8=_0x4985f8[_0x213f('0x37')]({'plain':!![]});_0x4985f8[_0x213f('0x22')]=_0x526d32;_0x4985f8[_0x213f('0x23')]=_0x526d32;_0x4985f8['event']=_0x213f('0x39');Promise['resolve']()[_0x213f('0x27')](function(){var _0x2d6a12=_0x213f('0x3a')+_0x4985f8[_0x213f('0x28')];return db[_0x213f('0x3b')][_0x213f('0x2a')](_0x2d6a12,{'type':db[_0x213f('0x3c')]['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0xe479e4){if(_0xe479e4){_0x4985f8[_0x213f('0x2d')]=_0xe479e4[0x0];}if(typeof _0x4985f8[_0x213f('0x2e')]===_0x213f('0x29'))return;return getAgent(_0x4985f8['UserId']);})['then'](function(_0x25f7f2){if(_0x25f7f2){_0x4985f8[_0x213f('0x2f')]=util[_0x213f('0x30')]('SIP/%s',_0x25f7f2[_0x213f('0x32')]);_0x4985f8[_0x213f('0x33')]=_0x25f7f2;}return request({'event':_0x484804,'message':_0x4985f8});})[_0x213f('0x21')](function(_0x57a989){logger['error'](_0x213f('0x20'),'AfterCreate',_0x57a989);});};}function afterUpdate(_0x5472d3){return function(_0x51b913){var _0x131220=_0x51b913[_0x213f('0x3d')]('closed')&&_0x51b913[_0x213f('0x3e')];var _0x1b2b2b=_0x51b913['changed']('substatus');if(_0x131220||_0x1b2b2b){var _0x1c135a=_0x131220?_0x213f('0xa'):'substatus';var _0x4b053d=_0x51b913[_0x213f('0x37')]({'plain':!![]});_0x4b053d[_0x213f('0x22')]=_0x5472d3;_0x4b053d[_0x213f('0x23')]=_0x5472d3;_0x4b053d['event']=_0x131220?_0x213f('0x3e'):'substatus';var _0x2c80e0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b053d[_0x213f('0x28')];return db['sequelize'][_0x213f('0x2a')](_0x2c80e0,{'type':db['Sequelize'][_0x213f('0x2b')][_0x213f('0x2c')],'raw':!![]})[_0x213f('0x27')](function(_0x52bc6a){if(_0x52bc6a){_0x4b053d['contact']=_0x52bc6a[0x0];}if(typeof _0x4b053d[_0x213f('0x2e')]==='undefined')return;return getAgent(_0x4b053d['UserId']);})[_0x213f('0x27')](function(_0x40b711){if(_0x40b711){_0x4b053d[_0x213f('0x2f')]=util[_0x213f('0x30')](_0x213f('0x31'),_0x40b711[_0x213f('0x32')]);_0x4b053d[_0x213f('0x33')]=_0x40b711;}return request({'event':_0x1c135a,'message':_0x4b053d});})[_0x213f('0x21')](function(_0x5532aa){logger[_0x213f('0x1e')](_0x213f('0x20'),_0x213f('0x3f'),_0x5532aa);});}};}function getAgent(_0x1a1e93){return db['User'][_0x213f('0x40')]({'where':{'id':_0x1a1e93},'attributes':['id',_0x213f('0x32'),_0x213f('0x41'),_0x213f('0x42'),_0x213f('0x43')],'raw':!![]})[_0x213f('0x27')](function(_0x3bfd83){return _0x3bfd83;});}exports[_0x213f('0x44')]=function(){for(var _0x59314f=0x0;_0x59314f<triggers[_0x213f('0x45')];_0x59314f+=0x1){if(db[_0x213f('0x46')](triggers[_0x59314f]['model'])){db[triggers[_0x59314f][_0x213f('0x47')]][_0x213f('0x48')](triggers[_0x59314f]['event'],triggers[_0x59314f]['callback'](triggers[_0x59314f][_0x213f('0x22')][_0x213f('0x49')](),triggers[_0x59314f][_0x213f('0x4a')]));}}};
\ No newline at end of file
+var _0x4017=['FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','request','info','Trigger,\x20%s','code','error','EventManager','get','channel','motionChannel','event','resolve','then','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface','format','SIP/%s','name','agent','outgoingmessage','catch','AfterCreateMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','triggers','client','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x4017,0x1a0));var _0x7401=function(_0x1df610,_0x58626f){_0x1df610=_0x1df610-0x0;var _0x9fbdc=_0x4017[_0x1df610];return _0x9fbdc;};'use strict';var util=require(_0x7401('0x0'));var db=require(_0x7401('0x1'))['db'];var jayson=require(_0x7401('0x2'));var logger=require('../logger')(_0x7401('0x3'));var client=jayson[_0x7401('0x4')][_0x7401('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x7401('0x6'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0x9'),'model':_0x7401('0x6'),'event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':_0x7401('0x9'),'model':_0x7401('0xc'),'event':_0x7401('0x7'),'condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x9'),'model':'ChatOfflineMessage','event':_0x7401('0x7'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':'Sms','model':'SmsInteraction','event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0xe'),'model':_0x7401('0xf'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7401('0xe'),'model':_0x7401('0x10'),'event':_0x7401('0x7'),'condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x11'),'model':'WhatsappInteraction','event':_0x7401('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7401('0x11'),'model':_0x7401('0x12'),'event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':_0x7401('0x11'),'model':_0x7401('0x13'),'event':'afterCreate','condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x14'),'model':_0x7401('0x15'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0x14'),'model':'FaxInteraction','event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':'Fax','model':_0x7401('0x16'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7401('0x17'),'model':_0x7401('0x18'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0x7401('0x18'),'event':_0x7401('0xa'),'condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0x7401('0x7'),'condition':_0x7401('0xd'),'callback':afterCreateMessage},{'channel':_0x7401('0x19'),'model':_0x7401('0x1a'),'event':_0x7401('0x7'),'condition':_0x7401('0x8'),'callback':afterCreate},{'channel':_0x7401('0x19'),'model':_0x7401('0x1a'),'event':'afterUpdate','condition':_0x7401('0xb'),'callback':afterUpdate},{'channel':_0x7401('0x19'),'model':'OpenchannelMessage','event':_0x7401('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x5892e0){return client[_0x7401('0x1b')]('EventManager',_0x5892e0)['then'](function(_0x24873b){logger[_0x7401('0x1c')](_0x7401('0x1d'),'EventManager',_0x24873b);if(_0x24873b['error']){if(_0x24873b['error'][_0x7401('0x1e')]===0x1f4){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x20'),_0x24873b['error']);}}})['catch'](function(_0xbbb086){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x20'),_0xbbb086);});}function afterCreateMessage(_0x5e9d69){return function(_0x2d415){_0x2d415=_0x2d415[_0x7401('0x21')]({'plain':!![]});_0x2d415[_0x7401('0x22')]=_0x5e9d69;_0x2d415[_0x7401('0x23')]=_0x5e9d69;_0x2d415[_0x7401('0x24')]=_0x2d415['direction'];Promise[_0x7401('0x25')]()[_0x7401('0x26')](function(){if(typeof _0x2d415[_0x7401('0x27')]==='undefined')return null;var _0x32e4f9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d415[_0x7401('0x27')];return db[_0x7401('0x28')][_0x7401('0x29')](_0x32e4f9,{'type':db[_0x7401('0x2a')][_0x7401('0x2b')][_0x7401('0x2c')],'raw':!![]});})['then'](function(_0x344d5e){if(_0x344d5e){_0x2d415[_0x7401('0x2d')]=_0x344d5e[0x0];}if(typeof _0x2d415[_0x7401('0x2e')]===_0x7401('0x2f'))return;return getAgent(_0x2d415['UserId']);})['then'](function(_0x3338f6){if(_0x3338f6){_0x2d415[_0x7401('0x30')]=util[_0x7401('0x31')](_0x7401('0x32'),_0x3338f6[_0x7401('0x33')]);_0x2d415[_0x7401('0x34')]=_0x3338f6;_0x2d415[_0x7401('0x22')]=_0x5e9d69;return request({'event':'incomingmessage','message':_0x2d415});}else{return request({'event':_0x7401('0x35'),'message':_0x2d415});}})[_0x7401('0x36')](function(_0x317d88){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x37'),_0x317d88);});};}function afterCreateOfflineMessage(_0x4f5bd7){return function(_0x5cf710){_0x5cf710=_0x5cf710[_0x7401('0x21')]({'plain':!![]});_0x5cf710[_0x7401('0x22')]=_0x4f5bd7;_0x5cf710[_0x7401('0x23')]=_0x4f5bd7;_0x5cf710[_0x7401('0x24')]='offlineMessage';return request({'event':_0x5cf710[_0x7401('0x24')],'message':_0x5cf710});};}function afterCreate(_0x3cc367,_0x351f11){return function(_0x3c4ec7){_0x3c4ec7=_0x3c4ec7[_0x7401('0x21')]({'plain':!![]});_0x3c4ec7['channel']=_0x3cc367;_0x3c4ec7[_0x7401('0x23')]=_0x3cc367;_0x3c4ec7[_0x7401('0x24')]='opened';Promise['resolve']()[_0x7401('0x26')](function(){var _0x496f34=_0x7401('0x38')+_0x3c4ec7[_0x7401('0x27')];return db[_0x7401('0x28')][_0x7401('0x29')](_0x496f34,{'type':db[_0x7401('0x2a')]['QueryTypes'][_0x7401('0x2c')],'raw':!![]});})[_0x7401('0x26')](function(_0x49c415){if(_0x49c415){_0x3c4ec7[_0x7401('0x2d')]=_0x49c415[0x0];}if(typeof _0x3c4ec7[_0x7401('0x2e')]===_0x7401('0x2f'))return;return getAgent(_0x3c4ec7[_0x7401('0x2e')]);})[_0x7401('0x26')](function(_0x4b55df){if(_0x4b55df){_0x3c4ec7[_0x7401('0x30')]=util[_0x7401('0x31')](_0x7401('0x32'),_0x4b55df[_0x7401('0x33')]);_0x3c4ec7[_0x7401('0x34')]=_0x4b55df;}return request({'event':_0x351f11,'message':_0x3c4ec7});})[_0x7401('0x36')](function(_0x371184){logger[_0x7401('0x1f')]('Trigger,\x20%s',_0x7401('0x39'),_0x371184);});};}function afterUpdate(_0x57c75f){return function(_0x2743f4){var _0x2e25a7=_0x2743f4[_0x7401('0x3a')](_0x7401('0x3b'))&&_0x2743f4[_0x7401('0x3b')];var _0xe49588=_0x2743f4[_0x7401('0x3a')](_0x7401('0x3c'));if(_0x2e25a7||_0xe49588){var _0x264d14=_0x2e25a7?_0x7401('0xb'):'substatus';var _0x4418a2=_0x2743f4['get']({'plain':!![]});_0x4418a2[_0x7401('0x22')]=_0x57c75f;_0x4418a2[_0x7401('0x23')]=_0x57c75f;_0x4418a2['event']=_0x2e25a7?_0x7401('0x3b'):_0x7401('0x3c');var _0x5bd989=_0x7401('0x38')+_0x4418a2[_0x7401('0x27')];return db['sequelize']['query'](_0x5bd989,{'type':db[_0x7401('0x2a')][_0x7401('0x2b')][_0x7401('0x2c')],'raw':!![]})[_0x7401('0x26')](function(_0x59ed42){if(_0x59ed42){_0x4418a2[_0x7401('0x2d')]=_0x59ed42[0x0];}if(typeof _0x4418a2['UserId']===_0x7401('0x2f'))return;return getAgent(_0x4418a2[_0x7401('0x2e')]);})[_0x7401('0x26')](function(_0x4227d1){if(_0x4227d1){_0x4418a2[_0x7401('0x30')]=util[_0x7401('0x31')]('SIP/%s',_0x4227d1[_0x7401('0x33')]);_0x4418a2['agent']=_0x4227d1;}return request({'event':_0x264d14,'message':_0x4418a2});})[_0x7401('0x36')](function(_0x51dac6){logger[_0x7401('0x1f')](_0x7401('0x1d'),_0x7401('0x3d'),_0x51dac6);});}};}function getAgent(_0x406c78){return db[_0x7401('0x3e')][_0x7401('0x3f')]({'where':{'id':_0x406c78},'attributes':['id','name',_0x7401('0x40'),_0x7401('0x41'),'internal'],'raw':!![]})[_0x7401('0x26')](function(_0x498c5c){return _0x498c5c;});}exports[_0x7401('0x42')]=function(){for(var _0x3afbbf=0x0;_0x3afbbf<triggers[_0x7401('0x43')];_0x3afbbf+=0x1){if(db[_0x7401('0x44')](triggers[_0x3afbbf][_0x7401('0x45')])){db[triggers[_0x3afbbf]['model']][_0x7401('0x46')](triggers[_0x3afbbf]['event'],triggers[_0x3afbbf][_0x7401('0x47')](triggers[_0x3afbbf][_0x7401('0x22')]['toLowerCase'](),triggers[_0x3afbbf][_0x7401('0x48')]));}}};
\ No newline at end of file
index efb6c2b..d33f6d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99f6=['User','count','then','agents','catch','lodash','bluebird','../mysqldb','./license/util','voice','chat','fax','sms','whatsapp','toLowerCase','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent'];(function(_0x25e3e2,_0x13bb2a){var _0x21b158=function(_0x2b5ac0){while(--_0x2b5ac0){_0x25e3e2['push'](_0x25e3e2['shift']());}};_0x21b158(++_0x13bb2a);}(_0x99f6,0x73));var _0x699f=function(_0x655ab,_0x3bf2e9){_0x655ab=_0x655ab-0x0;var _0x1c456a=_0x99f6[_0x655ab];return _0x1c456a;};'use strict';var _=require(_0x699f('0x0'));var BPromise=require(_0x699f('0x1'));var db=require(_0x699f('0x2'))['db'];var util=require(_0x699f('0x3'));var channels=[_0x699f('0x4'),'mail',_0x699f('0x5'),_0x699f('0x6'),_0x699f('0x7'),_0x699f('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x7246b1){_0x7246b1=_0x7246b1[_0x699f('0x9')]();return _['includes'](channels,_0x7246b1);};exports[_0x699f('0xa')]=function(_0x40d9b0,_0x154776,_0xf76cc0,_0x1ceab0){var _0x53f8e0={'loginAttempts':_0x154776,'blocked':_0xf76cc0};if(!_[_0x699f('0xb')](_0x1ceab0)){_0x53f8e0[_0x699f('0xc')]=_0x1ceab0;}return _0x40d9b0[_0x699f('0xd')](_0x53f8e0);};exports[_0x699f('0xe')]=function(_0x5e9a5d){return new BPromise(function(_0x2fd384,_0x184935){var _0x3cb955=0x0;if(_0x5e9a5d[_0x699f('0xf')]!==_0x699f('0x10')){_0x2fd384(_0x5e9a5d);}db[_0x699f('0x11')][_0x699f('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5e9a5d['id']}}})[_0x699f('0x13')](function(_0x503f33){_0x3cb955=_0x503f33;return util[_0x699f('0xe')]();})['then'](function(_0x2f208e){if(_0x2f208e&&_0x2f208e['agents']&&_0x3cb955>=_0x2f208e[_0x699f('0x14')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2fd384(_0x5e9a5d);})[_0x699f('0x15')](function(_0x5af2a6){_0x184935(_0x5af2a6);});});};
\ No newline at end of file
+var _0xb851=['blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','mail','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','isUndefined'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb851,0x145));var _0x1b85=function(_0x10ff23,_0x33286e){_0x10ff23=_0x10ff23-0x0;var _0x470e76=_0xb851[_0x10ff23];return _0x470e76;};'use strict';var _=require(_0x1b85('0x0'));var BPromise=require(_0x1b85('0x1'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice',_0x1b85('0x2'),'chat',_0x1b85('0x3'),_0x1b85('0x4'),_0x1b85('0x5'),_0x1b85('0x6')];exports[_0x1b85('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x285d1f){_0x285d1f=_0x285d1f[_0x1b85('0x8')]();return _[_0x1b85('0x9')](channels,_0x285d1f);};exports['clearBlockUser']=function(_0x33e2b2,_0x1c617a,_0x3715fc,_0x483b9f){var _0x4ba4a3={'loginAttempts':_0x1c617a,'blocked':_0x3715fc};if(!_[_0x1b85('0xa')](_0x483b9f)){_0x4ba4a3[_0x1b85('0xb')]=_0x483b9f;}return _0x33e2b2[_0x1b85('0xc')](_0x4ba4a3);};exports[_0x1b85('0xd')]=function(_0x368abd){return new BPromise(function(_0x52fdc9,_0x596c01){var _0x23ad89=0x0;if(_0x368abd[_0x1b85('0xe')]!==_0x1b85('0xf')){_0x52fdc9(_0x368abd);}db[_0x1b85('0x10')][_0x1b85('0x11')]({'where':{'role':_0x1b85('0xf'),'online':!![],'id':{'$ne':_0x368abd['id']}}})[_0x1b85('0x12')](function(_0x4c147c){_0x23ad89=_0x4c147c;return util['getLicense']();})[_0x1b85('0x12')](function(_0x401ce3){if(_0x401ce3&&_0x401ce3[_0x1b85('0x13')]&&_0x23ad89>=_0x401ce3['agents']){throw Error(_0x1b85('0x14'));}_0x52fdc9(_0x368abd);})['catch'](function(_0x4827a8){_0x596c01(_0x4827a8);});});};
\ No newline at end of file
index 5dcc428..d49f2f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x3e5845,_0xc189ea){var _0x299772=function(_0xcc2aa1){while(--_0xcc2aa1){_0x3e5845['push'](_0x3e5845['shift']());}};_0x299772(++_0xc189ea);}(_0x153f,0x15b));var _0xf153=function(_0x5959d8,_0x2c907d){_0x5959d8=_0x5959d8-0x0;var _0x227e66=_0x153f[_0x5959d8];return _0x227e66;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0x5fdb12,_0x435771){var _0x48ed34=function(_0x2f7a42){while(--_0x2f7a42){_0x5fdb12['push'](_0x5fdb12['shift']());}};_0x48ed34(++_0x435771);}(_0x153f,0x15b));var _0xf153=function(_0x4132ed,_0x1a6252){_0x4132ed=_0x4132ed-0x0;var _0x292212=_0x153f[_0x4132ed];return _0x292212;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index a8fbdc0..c000688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca5a=['404','status','render','json','send'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xca5a,0x82));var _0xaca5=function(_0x431ff0,_0x5e192a){_0x431ff0=_0x431ff0-0x0;var _0x3aaadd=_0xca5a[_0x431ff0];return _0x3aaadd;};'use strict';module['exports'][0x194]=function pageNotFound(_0x219ca8,_0x4a75c0){var _0x403030=_0xaca5('0x0');var _0x3bd5ec=0x194;var _0x194278={'status':_0x3bd5ec};_0x4a75c0['status'](_0x194278[_0xaca5('0x1')]);_0x4a75c0[_0xaca5('0x2')](_0x403030,{},function(_0x108f2c,_0x5bce2b){if(_0x108f2c){return _0x4a75c0[_0xaca5('0x1')](_0x194278[_0xaca5('0x1')])[_0xaca5('0x3')](_0x194278);}_0x4a75c0[_0xaca5('0x4')](_0x5bce2b);});};
\ No newline at end of file
+var _0x84a3=['render','exports','404','status'];(function(_0x580078,_0x458893){var _0x168ae9=function(_0xe4ce9a){while(--_0xe4ce9a){_0x580078['push'](_0x580078['shift']());}};_0x168ae9(++_0x458893);}(_0x84a3,0x189));var _0x384a=function(_0x103c86,_0x1ef914){_0x103c86=_0x103c86-0x0;var _0x1d4773=_0x84a3[_0x103c86];return _0x1d4773;};'use strict';module[_0x384a('0x0')][0x194]=function pageNotFound(_0x147df8,_0x27eb68){var _0x5c64de=_0x384a('0x1');var _0x13aa92=0x194;var _0x45f797={'status':_0x13aa92};_0x27eb68[_0x384a('0x2')](_0x45f797[_0x384a('0x2')]);_0x27eb68[_0x384a('0x3')](_0x5c64de,{},function(_0x29c597,_0x1c7168){if(_0x29c597){return _0x27eb68[_0x384a('0x2')](_0x45f797[_0x384a('0x2')])['json'](_0x45f797);}_0x27eb68['send'](_0x1c7168);});};
\ No newline at end of file
index d5a617b..b3c04ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc624=['team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','MailApplication','TagId','Items','FaxAccount','FaxAccountId','Interactions','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','SmsAccountId','SmsMessage','Pause','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','ChatInternalMessage','ChatGroupId','chat_group_has_users','Website','CmCompany','CompanyId','Phones','CmContactId','JscriptySessions','OpenchannelInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','Queue','CampaignId','OwnerId','Condition','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','Hopper','CmHopperId','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','AccountId','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','DeskConfiguration','DeskField','Subjects','int_desk_configuration_has_tags','ZohoConfiguration','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowField','CloudProviderId','Dynamics365Field','FreshsalesConfiguration','FreshsalesField','FromId','ToId','SessionId','ProjectId','user_has_teams','Hoppers','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','MailTransferReport','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','CmCustomField','CustomFields','HopperHistory','voice_queues_has_cm_lists','UserProfile','UserProfileSection','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','../api/pause/pause.model','../api/cdr/cdr.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','TeamVoicePrefix','UserVoicePrefix','../api/user-setting/user-setting.model','hasOne','cascade','UserSetting','userSetting','UserId','hasMany','VoiceQueuesRt','Extensions','ReportAgentPreview','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','ChatGroup','Contacts','cm_user_has_contacts','cm_user_has_lists','Team','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','UserSmsQueue','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SpiedAgents','Applications','moh_has_sounds','Members','VoiceQueueId','HopperFinals','CmHopperHistory','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','Agents','Teams','voice_queues_has_cm_blacklists','VoiceMail','mailboxuser','mailbox','VoiceMailMessage','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','restrict','Imap','Smtp','Dispositions','Answers','Messages','List','ListId'];(function(_0x45a557,_0x4a01d7){var _0x10bbd4=function(_0x4da264){while(--_0x4da264){_0x45a557['push'](_0x45a557['shift']());}};_0x10bbd4(++_0x4a01d7);}(_0xc624,0x99));var _0x4c62=function(_0x195fb9,_0x3f727c){_0x195fb9=_0x195fb9-0x0;var _0x1778c4=_0xc624[_0x195fb9];return _0x1778c4;};'use strict';var config=require(_0x4c62('0x0'));var Sequelize=require(_0x4c62('0x1'));var _=require(_0x4c62('0x2'));var jstz=require('jstz');var timezone=jstz[_0x4c62('0x3')]();config[_0x4c62('0x1')]=_[_0x4c62('0x4')](config[_0x4c62('0x1')],{'database':'motion2','username':_0x4c62('0x5'),'password':_0x4c62('0x6'),'options':{'host':_0x4c62('0x7'),'port':0xcea,'dialect':_0x4c62('0x8'),'dialectOptions':{'charset':_0x4c62('0x9')},'logging':![],'timezone':timezone[_0x4c62('0xa')](),'define':{'charset':_0x4c62('0xb'),'collate':_0x4c62('0xc')}}});config[_0x4c62('0xd')]=_[_0x4c62('0x4')](config['sequelizeHistory'],{'database':'motion2','username':_0x4c62('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x4c62('0x8'),'dialectOptions':{'charset':_0x4c62('0x9')},'logging':![],'timezone':timezone[_0x4c62('0xa')](),'define':{'charset':_0x4c62('0xb'),'collate':_0x4c62('0xc')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x4c62('0xe')],config[_0x4c62('0x1')][_0x4c62('0xf')],config[_0x4c62('0x1')][_0x4c62('0x10')],config[_0x4c62('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4c62('0xd')][_0x4c62('0xe')],config[_0x4c62('0xd')][_0x4c62('0xf')],config['sequelizeHistory'][_0x4c62('0x10')],config[_0x4c62('0xd')][_0x4c62('0x11')])};db[_0x4c62('0x12')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x14'));db[_0x4c62('0x15')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x16'));db[_0x4c62('0x17')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x18'));db[_0x4c62('0x19')]=db['sequelize']['import'](_0x4c62('0x1a'));db[_0x4c62('0x1b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x1c'));db[_0x4c62('0x1d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x1e'));db[_0x4c62('0x1f')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x4c62('0x20')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0x4c62('0x1')]['import'](_0x4c62('0x21'));db['VoiceMailMessage']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x22'));db[_0x4c62('0x23')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0x4c62('0x24')]=db['sequelize'][_0x4c62('0x13')]('../api/voiceDialReport/voiceDialReport.model');db[_0x4c62('0x25')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x26'));db[_0x4c62('0x27')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x28'));db['MemberReport']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x29'));db[_0x4c62('0x2a')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/trunk/trunk.model');db[_0x4c62('0x2b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x2c'));db[_0x4c62('0x2d')]=db[_0x4c62('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4c62('0x2e')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x2f'));db[_0x4c62('0x30')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x31'));db[_0x4c62('0x32')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x33'));db['UserFaxQueue']=db[_0x4c62('0x1')]['import'](_0x4c62('0x34'));db['UserSmsQueue']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x35'));db[_0x4c62('0x36')]=db['sequelize'][_0x4c62('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x4c62('0x37')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x38'));db[_0x4c62('0x39')]=db['sequelize']['import'](_0x4c62('0x3a'));db[_0x4c62('0x3b')]=db['sequelize']['import']('../api/mailServerOut/mailServerOut.model');db[_0x4c62('0x3c')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x3d'));db[_0x4c62('0x3e')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x3f'));db[_0x4c62('0x40')]=db[_0x4c62('0x1')]['import']('../api/mailSubstatus/mailSubstatus.model');db[_0x4c62('0x41')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x42'));db[_0x4c62('0x43')]=db[_0x4c62('0x1')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x4c62('0x1')]['import'](_0x4c62('0x44'));db[_0x4c62('0x45')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x46'));db[_0x4c62('0x47')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/dashboard/dashboard.model');db[_0x4c62('0x48')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x49'));db[_0x4c62('0x4a')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x4b'));db[_0x4c62('0x4c')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/faxInteraction/faxInteraction.model');db[_0x4c62('0x4d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x4e'));db[_0x4c62('0x4f')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x50'));db[_0x4c62('0x51')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x52'));db[_0x4c62('0x53')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x54'));db[_0x4c62('0x55')]=db['sequelize'][_0x4c62('0x13')]('../api/smsApplication/smsApplication.model');db[_0x4c62('0x56')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x57'));db['SmsMessage']=db['sequelize']['import'](_0x4c62('0x58'));db[_0x4c62('0x59')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x5a'));db[_0x4c62('0x5b')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x5c'));db[_0x4c62('0x5d')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x5e'));db[_0x4c62('0x5f')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x60'));db['OpenchannelMessage']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x61'));db[_0x4c62('0x62')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x63'));db[_0x4c62('0x64')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x65'));db['OpenchannelQueueReport']=db[_0x4c62('0x1')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x4c62('0x66')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/chatApplication/chatApplication.model');db[_0x4c62('0x67')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x68'));db[_0x4c62('0x69')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x6a'));db['ChatOfflineMessage']=db[_0x4c62('0x1')]['import'](_0x4c62('0x6b'));db[_0x4c62('0x6c')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x6d'));db['ChatGroup']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x6e'));db[_0x4c62('0x6f')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x70'));db['CmCompany']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x71'));db[_0x4c62('0x72')]=db['sequelize']['import']('../api/cmContact/cmContact.model');db[_0x4c62('0x73')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x74'));db[_0x4c62('0x75')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x4c62('0x76')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x77'));db['CmHopperHistory']=db['sequelize']['import'](_0x4c62('0x78'));db['ReportAgentPreview']=db['sequelize']['import'](_0x4c62('0x79'));db['CmCustomField']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x7a'));db[_0x4c62('0x7b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x7c'));db[_0x4c62('0x7d')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x7e'));db[_0x4c62('0x7f')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x80'));db[_0x4c62('0x81')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x82'));db['Condition']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x83'));db['Interval']=db['sequelize'][_0x4c62('0x13')]('../api/interval/interval.model');db['Pause']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x84'));db['Cdr']=db[_0x4c62('0x1')]['import'](_0x4c62('0x85'));db['VoiceQueuesLog']=db[_0x4c62('0x1')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x4c62('0x86')]=db[_0x4c62('0x1')]['import']('../api/schedule/schedule.model');db[_0x4c62('0x87')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x88'));db[_0x4c62('0x89')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x8a'));db[_0x4c62('0x8b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x8c'));db[_0x4c62('0x8d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x8e'));db['CmHopperAdditionalPhone']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x8f'));db[_0x4c62('0x90')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x91'));db[_0x4c62('0x92')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/trigger/trigger.model');db[_0x4c62('0x93')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x94'));db[_0x4c62('0x95')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x96'));db[_0x4c62('0x97')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x98'));db['AnalyticCustomReport']=db['sequelize']['import']('../api/analyticCustomReport/analyticCustomReport.model');db[_0x4c62('0x99')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0x9a'));db[_0x4c62('0x9b')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x9c'));db[_0x4c62('0x9d')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x9e'));db[_0x4c62('0x9f')]=db['sequelize']['import'](_0x4c62('0xa0'));db['AnalyticTreeReport']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x4c62('0xa1')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xa2'));db[_0x4c62('0xa3')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x4c62('0xa4')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xa5'));db[_0x4c62('0xa6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xa7'));db[_0x4c62('0xa8')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xa9'));db[_0x4c62('0xaa')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xab'));db[_0x4c62('0xac')]=db['sequelize'][_0x4c62('0x13')]('../api/intDeskAccount/intDeskAccount.model');db['DeskConfiguration']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xad'));db['DeskField']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xae'));db['ZohoAccount']=db['sequelize'][_0x4c62('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xaf'));db[_0x4c62('0xb0')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xb1'));db[_0x4c62('0xb2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xb3'));db[_0x4c62('0xb4')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xb5'));db[_0x4c62('0xb6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xb7'));db['FreshdeskAccount']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xb8'));db[_0x4c62('0xb9')]=db['sequelize'][_0x4c62('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize']['import'](_0x4c62('0xba'));db[_0x4c62('0xbb')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xbc'));db[_0x4c62('0xbd')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xbe'));db[_0x4c62('0xbf')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/intVtigerField/intVtigerField.model');db[_0x4c62('0xc0')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xc1'));db[_0x4c62('0xc2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc3'));db['ServicenowField']=db[_0x4c62('0x1')]['import']('../api/intServicenowField/intServicenowField.model');db[_0x4c62('0xc4')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc5'));db[_0x4c62('0xc6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc7'));db['Dynamics365Field']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x4c62('0xc8')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xc9'));db['FreshsalesConfiguration']=db['sequelize']['import'](_0x4c62('0xca'));db['FreshsalesField']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xcb'));db[_0x4c62('0x95')]=db[_0x4c62('0x1')]['import'](_0x4c62('0x96'));db['Network']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xcc'));db[_0x4c62('0xcd')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x4c62('0xce')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x4c62('0xcf')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd0'));db[_0x4c62('0xd1')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x4c62('0xd2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd3'));db[_0x4c62('0xd4')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/squareReport/squareReport.model');db[_0x4c62('0xd5')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd6'));db[_0x4c62('0xd7')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xd8'));db[_0x4c62('0xd9')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xda'));db[_0x4c62('0xdb')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x4c62('0xdc')]=db[_0x4c62('0x1')]['import']('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/squareRecording/squareRecording.model');db['SquareMessage']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xdd'));db['Team']=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xde'));db[_0x4c62('0xdf')]=db[_0x4c62('0x1')]['import']('../api/license/license.model');db[_0x4c62('0xe0')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe1'));db[_0x4c62('0xe2')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe3'));db[_0x4c62('0xe4')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe5'));db[_0x4c62('0xe6')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe7'));db['MailTransferReport']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x4c62('0xe8')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xe9'));db[_0x4c62('0xea')]=db['sequelize'][_0x4c62('0x13')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db['sequelize'][_0x4c62('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x4c62('0xeb')]=db[_0x4c62('0x1')]['import'](_0x4c62('0xec'));db[_0x4c62('0xed')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xee'));db[_0x4c62('0xef')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf0'));db['UserProfile']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf1'));db['UserProfileSection']=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x4c62('0xf2')]=db['sequelize']['import']('../api/userProfileResource/userProfileResource.model');db[_0x4c62('0xf3')]=db['sequelize'][_0x4c62('0x13')](_0x4c62('0xf4'));db[_0x4c62('0xf5')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf6'));db[_0x4c62('0xf7')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xf8'));db[_0x4c62('0xf9')]=db['sequelize']['import'](_0x4c62('0xfa'));db[_0x4c62('0xfb')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xfc'));db[_0x4c62('0xfd')]=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0xfe'));db['WhatsappTransferReport']=db[_0x4c62('0x1')]['import'](_0x4c62('0xff'));db['WhatsappQueue']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x100'));db[_0x4c62('0x101')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0x4c62('0x102')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x4c62('0x103')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x4c62('0x104')]=db[_0x4c62('0x1')][_0x4c62('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db[_0x4c62('0x1')][_0x4c62('0x13')](_0x4c62('0x105'));db[_0x4c62('0x12')][_0x4c62('0x106')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x4c62('0x107'),'foreignKey':'UserId'});db[_0x4c62('0x12')]['hasOne'](db[_0x4c62('0x108')],{'as':_0x4c62('0x109'),'onDelete':'cascade','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x1f')],{'as':'Recordings','foreignKey':'UserId'});db[_0x4c62('0x12')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x4c62('0x10c'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':_0x4c62('0x10d'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x12')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x4c62('0x12')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x10e')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x4c62('0x12')][_0x4c62('0x10b')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x67')],{'as':_0x4c62('0x10f'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x56')],{'as':_0x4c62('0x110'),'foreignKey':_0x4c62('0x10a')});db['User']['hasMany'](db['FaxInteraction'],{'as':_0x4c62('0x111'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0x41')],{'as':_0x4c62('0x112'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0xf9')],{'as':_0x4c62('0x113'),'foreignKey':'UserId'});db[_0x4c62('0x12')][_0x4c62('0x10b')](db[_0x4c62('0xf3')],{'as':_0x4c62('0x114'),'foreignKey':'SenderId'});db[_0x4c62('0x12')][_0x4c62('0x115')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x4c62('0x116')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x118')],{'as':'Groups','through':'chat_group_has_users'});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x72')],{'as':_0x4c62('0x119'),'through':_0x4c62('0x11a')});db[_0x4c62('0x12')]['belongsToMany'](db[_0x4c62('0xed')],{'as':'Lists','through':_0x4c62('0x11b')});db['User'][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':'user_has_teams'});db['User']['belongsToMany'](db[_0x4c62('0x41')],{'as':_0x4c62('0x112'),'through':_0x4c62('0x11d')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x67')],{'as':_0x4c62('0x10f'),'through':_0x4c62('0x11e')});db[_0x4c62('0x12')]['belongsToMany'](db['FaxInteraction'],{'as':_0x4c62('0x111'),'through':'user_has_fax_interactions'});db[_0x4c62('0x12')]['belongsToMany'](db[_0x4c62('0x56')],{'as':_0x4c62('0x110'),'through':_0x4c62('0x11f')});db['User'][_0x4c62('0x117')](db[_0x4c62('0x5f')],{'as':'OpenchannelInteractions','through':_0x4c62('0x120')});db['User'][_0x4c62('0x117')](db['WhatsappInteraction'],{'as':_0x4c62('0x113'),'through':_0x4c62('0x121')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x1d')],{'as':_0x4c62('0x122'),'through':'UserVoiceQueue','required':![]});db['User'][_0x4c62('0x117')](db[_0x4c62('0xef')],{'as':'VoicePrefixes','through':_0x4c62('0x104'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x3e')],{'as':_0x4c62('0x123'),'through':_0x4c62('0x32'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db['ChatQueue'],{'as':_0x4c62('0x124'),'through':_0x4c62('0x30'),'required':![],'hooks':!![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db['FaxQueue'],{'as':_0x4c62('0x125'),'through':_0x4c62('0x126'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x59')],{'as':_0x4c62('0x127'),'through':_0x4c62('0x128'),'required':![]});db[_0x4c62('0x12')]['belongsToMany'](db[_0x4c62('0x62')],{'as':'OpenchannelQueues','through':_0x4c62('0x36'),'required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x129')],{'as':_0x4c62('0x12a'),'through':'UserWhatsappQueue','required':![]});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0xed')],{'through':_0x4c62('0x11b')});db['User'][_0x4c62('0x117')](db[_0x4c62('0x64')],{'as':_0x4c62('0x12b'),'through':'user_has_chat_websites'});db[_0x4c62('0x12')][_0x4c62('0x117')](db['FaxAccount'],{'as':'FaxAccounts','through':_0x4c62('0x12c')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x3c')],{'as':'MailAccounts','through':_0x4c62('0x12d')});db[_0x4c62('0x12')][_0x4c62('0x117')](db[_0x4c62('0x5b')],{'as':'OpenchannelAccounts','through':_0x4c62('0x12e')});db[_0x4c62('0x12')]['belongsToMany'](db['SmsAccount'],{'as':_0x4c62('0x12f'),'through':_0x4c62('0x130')});db['User']['belongsToMany'](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0x4c62('0x131')});db['VoiceChanSpy'][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':_0x4c62('0x132'),'onDelete':_0x4c62('0x107'),'foreignKey':'ChanSpyId'});db[_0x4c62('0x17')][_0x4c62('0x10b')](db['VoiceExtension'],{'onDelete':_0x4c62('0x107')});db['VoiceExtension'][_0x4c62('0x10b')](db['VoiceExtension'],{'as':_0x4c62('0x133'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x1b')]['belongsToMany'](db[_0x4c62('0x87')],{'as':'Sounds','through':_0x4c62('0x134')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x2d')],{'as':_0x4c62('0x135'),'foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')]['hasMany'](db[_0x4c62('0x73')],{'as':'Hoppers','foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':_0x4c62('0x137'),'foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x138')],{'as':_0x4c62('0x139'),'foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x10e')],{'as':_0x4c62('0x10e'),'foreignKey':'VoiceQueueId'});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db[_0x4c62('0x75')],{'as':_0x4c62('0x13a'),'foreignKey':'VoiceQueueId'});db[_0x4c62('0x1d')][_0x4c62('0x10b')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x4c62('0x136')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Trunk'],{'as':_0x4c62('0x2a'),'foreignKey':_0x4c62('0x13b')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Trunk'],{'as':_0x4c62('0x13c'),'foreignKey':_0x4c62('0x13d')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Interval'],{'as':_0x4c62('0x13e'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x1d')][_0x4c62('0x115')](db['Pause'],{'as':_0x4c62('0x140'),'foreignKey':_0x4c62('0x141')});db['VoiceQueue']['belongsToMany'](db[_0x4c62('0xed')],{'as':_0x4c62('0x142'),'through':'voice_queues_has_cm_lists'});db[_0x4c62('0x1d')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x2e')});db[_0x4c62('0x1d')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'as':_0x4c62('0x144'),'through':_0x4c62('0x102')});db[_0x4c62('0x1d')]['belongsToMany'](db[_0x4c62('0xed')],{'as':'BlackLists','through':_0x4c62('0x145')});db['VoiceRecording'][_0x4c62('0x115')](db['User'],{'as':'User','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x20')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x12'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x146')][_0x4c62('0x10b')](db['VoiceMailMessage'],{'as':'Messages','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x147'),'sourceKey':_0x4c62('0x148')});db[_0x4c62('0x149')][_0x4c62('0x115')](db[_0x4c62('0x146')],{'foreignKey':'mailboxuser','targetKey':_0x4c62('0x148')});db[_0x4c62('0x23')][_0x4c62('0x10b')](db['VoiceQueueReport'],{'as':_0x4c62('0x14a'),'foreignKey':_0x4c62('0x14b'),'constraints':![]});db[_0x4c62('0x23')][_0x4c62('0x10b')](db[_0x4c62('0x25')],{'as':_0x4c62('0x14c'),'foreignKey':_0x4c62('0x14b'),'constraints':![]});db[_0x4c62('0x23')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':'User','foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x23')][_0x4c62('0x115')](db['CmContact'],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x39')][_0x4c62('0x115')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x4c62('0x14f')});db[_0x4c62('0x39')][_0x4c62('0x115')](db[_0x4c62('0x101')],{'as':_0x4c62('0x101'),'foreignKey':'CloudProviderId','onDelete':'restrict'});db[_0x4c62('0x3b')][_0x4c62('0x115')](db[_0x4c62('0x3c')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x4c62('0x3b')][_0x4c62('0x115')](db[_0x4c62('0x101')],{'as':_0x4c62('0x101'),'foreignKey':'CloudProviderId','onDelete':_0x4c62('0x150')});db[_0x4c62('0x3c')][_0x4c62('0x106')](db[_0x4c62('0x39')],{'as':_0x4c62('0x151'),'onDelete':'cascade'});db[_0x4c62('0x3c')][_0x4c62('0x106')](db[_0x4c62('0x3b')],{'as':_0x4c62('0x152'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x3c')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x14f'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x3c')]['hasMany'](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x14f')});db['MailAccount'][_0x4c62('0x10b')](db[_0x4c62('0x43')],{'as':_0x4c62('0x155'),'foreignKey':'MailAccountId'});db['MailAccount']['hasMany'](db[_0x4c62('0x41')],{'as':'Interactions'});db[_0x4c62('0x3c')]['hasMany'](db['MailApplication'],{'as':'Applications'});db[_0x4c62('0x3c')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0x3c')][_0x4c62('0x115')](db[_0x4c62('0x90')],{'as':_0x4c62('0x90'),'foreignKey':'TemplateId'});db[_0x4c62('0x3c')][_0x4c62('0x115')](db['Pause'],{'as':_0x4c62('0x140'),'foreignKey':_0x4c62('0x141')});db['MailAccount'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':'user_has_mail_accounts'});db[_0x4c62('0x3e')][_0x4c62('0x117')](db['User'],{'as':'Agents','through':'UserMailQueue'});db['MailQueue'][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x158'),'as':'Teams'});db['MailInteraction'][_0x4c62('0x10b')](db[_0x4c62('0x43')],{'as':_0x4c62('0x155'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x159')});db[_0x4c62('0x41')]['belongsTo'](db[_0x4c62('0x3c')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x14f')});db['MailInteraction'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':'ContactId'});db[_0x4c62('0x41')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':'UserId'});db[_0x4c62('0x41')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x15c'),'as':_0x4c62('0x15d')});db[_0x4c62('0x41')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x15c'),'as':_0x4c62('0x15e')});db['MailInteraction'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':_0x4c62('0x11d'),'foreignKey':_0x4c62('0x159')});db[_0x4c62('0x43')][_0x4c62('0x10b')](db['Attachment'],{'as':_0x4c62('0x160'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x43')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x12')});db[_0x4c62('0x43')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x14d')});db['MailMessage'][_0x4c62('0x115')](db[_0x4c62('0x41')],{'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x159')});db['MailMessage']['belongsTo'](db[_0x4c62('0x3c')],{'as':'Account','foreignKey':_0x4c62('0x14f')});db['MailMessage'][_0x4c62('0x115')](db['ChatWebsite'],{'as':_0x4c62('0x64'),'foreignKey':_0x4c62('0x162')});db['MailMessage'][_0x4c62('0x115')](db['ChatOfflineMessage'],{'as':'ChatOfflineMessage','foreignKey':_0x4c62('0x163')});db['MailApplication']['belongsTo'](db['User'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x164')]['belongsTo'](db['MailQueue'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x164')][_0x4c62('0x115')](db['MailAccount'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x164')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x164')]['belongsTo'](db[_0x4c62('0x89')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0x45')][_0x4c62('0x115')](db[_0x4c62('0x3c')],{});db['MailQueueReport'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':'List','foreignKey':_0x4c62('0x157')});db[_0x4c62('0x45')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x45')]['belongsTo'](db[_0x4c62('0x41')],{});db['MailQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x43')],{});db[_0x4c62('0x45')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db[_0x4c62('0x45')]['belongsTo'](db[_0x4c62('0x3e')],{});db['Dashboard'][_0x4c62('0x10b')](db[_0x4c62('0x48')],{'as':_0x4c62('0x166'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':'Dispositions','foreignKey':_0x4c62('0x168'),'onDelete':'cascade'});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x168')});db[_0x4c62('0x167')]['hasMany'](db['FaxInteraction'],{'as':_0x4c62('0x169')});db['FaxAccount'][_0x4c62('0x10b')](db[_0x4c62('0x4a')],{'as':_0x4c62('0x133')});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':'Exntensions','onDelete':'cascade'});db[_0x4c62('0x167')][_0x4c62('0x10b')](db[_0x4c62('0x4d')],{'as':_0x4c62('0x155')});db[_0x4c62('0x167')][_0x4c62('0x115')](db['Trunk'],{'as':'Trunk'});db['FaxAccount'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0x167')][_0x4c62('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x4c62('0x167')][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x143'),'through':_0x4c62('0x12c')});db[_0x4c62('0x4a')]['belongsTo'](db[_0x4c62('0x12')],{'onDelete':'restrict'});db[_0x4c62('0x4a')]['belongsTo'](db[_0x4c62('0x4f')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x4a')]['belongsTo'](db[_0x4c62('0x167')],{'onDelete':_0x4c62('0x150')});db['FaxApplication'][_0x4c62('0x115')](db[_0x4c62('0x89')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0x4c')][_0x4c62('0x10b')](db[_0x4c62('0x4d')],{'as':_0x4c62('0x155'),'onDelete':_0x4c62('0x107'),'foreignKey':'FaxInteractionId'});db['FaxInteraction']['belongsTo'](db[_0x4c62('0x167')],{'as':_0x4c62('0x15a'),'foreignKey':'FaxAccountId'});db['FaxInteraction'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':'Contact','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x4c')][_0x4c62('0x115')](db['User'],{'as':'Owner','foreignKey':_0x4c62('0x10a')});db['FaxInteraction'][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x16a'),'as':_0x4c62('0x15d')});db[_0x4c62('0x4c')]['belongsToMany'](db['Tag'],{'through':_0x4c62('0x16a'),'as':_0x4c62('0x15e')});db[_0x4c62('0x4c')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':_0x4c62('0x16b'),'foreignKey':_0x4c62('0x16c')});db[_0x4c62('0x4d')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x12')});db[_0x4c62('0x4d')]['belongsTo'](db[_0x4c62('0x4c')],{'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x16c')});db['FaxMessage'][_0x4c62('0x115')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x4c62('0x4d')]['belongsTo'](db[_0x4c62('0xe4')],{'as':_0x4c62('0xe4'),'foreignKey':_0x4c62('0x16d')});db[_0x4c62('0x4d')][_0x4c62('0x115')](db['FaxAccount'],{'as':_0x4c62('0x15a'),'foreignKey':'FaxAccountId'});db[_0x4c62('0x4f')][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x143'),'through':_0x4c62('0x126')});db[_0x4c62('0x4f')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':'team_has_fax_queues','as':_0x4c62('0x144')});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0x167')],{});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0x51')]['belongsTo'](db[_0x4c62('0x72')],{'as':'Contact','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0x4c')],{});db['FaxQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x4d')],{});db[_0x4c62('0x51')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db['FaxQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x4f')],{});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x16e'),'onDelete':'cascade'});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':'SmsAccountId'});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x16f')],{'as':_0x4c62('0x155'),'foreignKey':_0x4c62('0x16e')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x4c62('0x169')});db[_0x4c62('0x53')][_0x4c62('0x10b')](db[_0x4c62('0x55')],{'as':'Applications'});db[_0x4c62('0x53')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db['SmsAccount'][_0x4c62('0x115')](db[_0x4c62('0x170')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c62('0x141')});db['SmsAccount'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x130')});db[_0x4c62('0x55')][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x55')][_0x4c62('0x115')](db[_0x4c62('0x59')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x55')][_0x4c62('0x115')](db['SmsAccount'],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0x55')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x55')]['belongsTo'](db['Tag'],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0x56')][_0x4c62('0x10b')](db[_0x4c62('0x16f')],{'as':'Messages','onDelete':_0x4c62('0x107'),'foreignKey':'SmsInteractionId'});db[_0x4c62('0x56')][_0x4c62('0x115')](db[_0x4c62('0x53')],{'as':'Account','foreignKey':_0x4c62('0x16e')});db[_0x4c62('0x56')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x56')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0x4c62('0x56')][_0x4c62('0x117')](db['Tag'],{'through':_0x4c62('0x171'),'as':_0x4c62('0x15d')});db[_0x4c62('0x56')][_0x4c62('0x117')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x4c62('0x56')]['belongsToMany'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':_0x4c62('0x11f'),'foreignKey':_0x4c62('0x172')});db[_0x4c62('0x16f')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x12')});db[_0x4c62('0x16f')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':'Contact'});db[_0x4c62('0x16f')]['belongsTo'](db[_0x4c62('0x56')],{'onDelete':'cascade','as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x172')});db[_0x4c62('0x16f')][_0x4c62('0x115')](db[_0x4c62('0x53')],{'as':'Account','foreignKey':_0x4c62('0x16e')});db['SmsQueue'][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x143'),'through':_0x4c62('0x128'),'foreignKey':_0x4c62('0x173')});db['SmsQueue'][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x174'),'as':_0x4c62('0x144')});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x175'),'onDelete':_0x4c62('0x107')});db['OpenchannelAccount']['hasMany'](db[_0x4c62('0x7f')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x5f')],{'as':_0x4c62('0x169'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x176')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x4c62('0x5b')]['hasMany'](db[_0x4c62('0x5d')],{'as':_0x4c62('0x133'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x5b')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db['OpenchannelAccount'][_0x4c62('0x115')](db[_0x4c62('0x170')],{'as':'mandatoryDispositionPause','foreignKey':_0x4c62('0x141')});db[_0x4c62('0x5b')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x4c62('0x5d')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x150')});db['OpenchannelApplication'][_0x4c62('0x115')](db[_0x4c62('0x62')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x177')});db[_0x4c62('0x5d')]['belongsTo'](db[_0x4c62('0x5b')],{'onDelete':_0x4c62('0x150'),'foreignKey':'OpenchannelAccountId'});db[_0x4c62('0x5d')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x5d')][_0x4c62('0x115')](db[_0x4c62('0x89')],{'onDelete':'restrict','foreignKey':_0x4c62('0x165')});db[_0x4c62('0x5f')]['hasMany'](db[_0x4c62('0x176')],{'as':'Messages','onDelete':'cascade','foreignKey':'OpenchannelInteractionId'});db[_0x4c62('0x5f')][_0x4c62('0x115')](db[_0x4c62('0x5b')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x5f')][_0x4c62('0x115')](db['CmContact'],{'as':_0x4c62('0x14d'),'foreignKey':'ContactId'});db[_0x4c62('0x5f')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':'UserId'});db[_0x4c62('0x5f')][_0x4c62('0x117')](db['Tag'],{'through':_0x4c62('0x178'),'as':_0x4c62('0x15d')});db['OpenchannelInteraction']['belongsToMany'](db[_0x4c62('0x89')],{'through':_0x4c62('0x178'),'as':_0x4c62('0x15e')});db[_0x4c62('0x5f')][_0x4c62('0x117')](db['User'],{'as':_0x4c62('0x15f'),'through':'user_has_openchannel_interactions','foreignKey':_0x4c62('0x179')});db[_0x4c62('0x176')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x107'),'as':'User'});db[_0x4c62('0x176')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x14d')});db['OpenchannelMessage']['belongsTo'](db[_0x4c62('0x5f')],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x179')});db[_0x4c62('0x176')]['belongsTo'](db[_0x4c62('0xe4')],{'as':_0x4c62('0xe4'),'foreignKey':_0x4c62('0x16d')});db[_0x4c62('0x176')]['belongsTo'](db[_0x4c62('0x5b')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x175')});db[_0x4c62('0x62')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x36'),'foreignKey':_0x4c62('0x177')});db[_0x4c62('0x62')]['belongsToMany'](db[_0x4c62('0x11c')],{'through':_0x4c62('0x17a'),'as':_0x4c62('0x144')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x162'),'onDelete':'cascade'});db['ChatWebsite'][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x162')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x6f')],{'as':_0x4c62('0x17b')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x67')],{'as':_0x4c62('0x169')});db[_0x4c62('0x64')]['hasMany'](db[_0x4c62('0x66')],{'as':_0x4c62('0x133')});db[_0x4c62('0x64')][_0x4c62('0x10b')](db[_0x4c62('0x69')],{'as':_0x4c62('0x155')});db[_0x4c62('0x64')][_0x4c62('0x115')](db['CmList'],{'as':'List','foreignKey':_0x4c62('0x157')});db[_0x4c62('0x64')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'as':_0x4c62('0x13e'),'foreignKey':'IntervalId'});db[_0x4c62('0x64')][_0x4c62('0x115')](db[_0x4c62('0x3c')],{'as':_0x4c62('0x3c'),'foreignKey':'MailAccountId'});db['ChatWebsite']['belongsTo'](db[_0x4c62('0x170')],{'as':_0x4c62('0x140'),'foreignKey':_0x4c62('0x141')});db['ChatWebsite'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x17c')});db[_0x4c62('0x17d')]['belongsTo'](db[_0x4c62('0x5b')],{});db[_0x4c62('0x17d')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db[_0x4c62('0x17d')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x17d')][_0x4c62('0x115')](db[_0x4c62('0x5f')],{});db['OpenchannelQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x176')],{});db[_0x4c62('0x17d')]['belongsTo'](db[_0x4c62('0x12')],{});db[_0x4c62('0x17d')]['belongsTo'](db[_0x4c62('0x62')],{});db[_0x4c62('0x66')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x17e'),'foreignKey':_0x4c62('0x10a'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x66')][_0x4c62('0x115')](db[_0x4c62('0x6c')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x4c62('0x150')});db[_0x4c62('0x66')]['belongsTo'](db[_0x4c62('0x64')],{'as':'Website','foreignKey':_0x4c62('0x162'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x66')][_0x4c62('0x115')](db[_0x4c62('0x89')],{'onDelete':'restrict','foreignKey':_0x4c62('0x165')});db[_0x4c62('0x67')][_0x4c62('0x10b')](db[_0x4c62('0x69')],{'as':_0x4c62('0x155'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x17f')});db['ChatInteraction'][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':_0x4c62('0x15a'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x4c62('0x115')](db['CmContact'],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x67')]['belongsTo'](db['User'],{'as':_0x4c62('0x15b'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x67')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x180'),'as':_0x4c62('0x15d')});db[_0x4c62('0x67')]['belongsToMany'](db[_0x4c62('0x89')],{'through':_0x4c62('0x180'),'as':_0x4c62('0x15e')});db[_0x4c62('0x67')][_0x4c62('0x117')](db['User'],{'as':'Users','through':_0x4c62('0x11e'),'foreignKey':'ChatInteractionId'});db[_0x4c62('0x69')][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x12')});db['ChatMessage'][_0x4c62('0x115')](db['CmContact'],{'onDelete':'cascade','as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x69')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x17f')});db[_0x4c62('0x69')][_0x4c62('0x115')](db['Attachment'],{'as':_0x4c62('0xe4'),'foreignKey':_0x4c62('0x16d')});db[_0x4c62('0x69')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':'Account','foreignKey':_0x4c62('0x162')});db[_0x4c62('0x181')][_0x4c62('0x10b')](db[_0x4c62('0xe4')],{'as':'Attachments','foreignKey':_0x4c62('0x163'),'onDelete':'cascade','hooks':!![]});db[_0x4c62('0x181')][_0x4c62('0x115')](db[_0x4c62('0x72')],{'onDelete':_0x4c62('0x107'),'as':'Contact','foreignKey':_0x4c62('0x14e')});db['ChatOfflineMessage'][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':_0x4c62('0x15a'),'foreignKey':'ChatWebsiteId'});db[_0x4c62('0x6c')][_0x4c62('0x117')](db['User'],{'as':'Agents','through':_0x4c62('0x30'),'hooks':!![]});db[_0x4c62('0x6c')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x182'),'as':_0x4c62('0x144')});db[_0x4c62('0x118')]['hasMany'](db[_0x4c62('0x183')],{'as':_0x4c62('0x155'),'foreignKey':_0x4c62('0x184'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x118')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':'Members','through':_0x4c62('0x185')});db[_0x4c62('0x6f')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'as':_0x4c62('0x186'),'foreignKey':_0x4c62('0x162')});db[_0x4c62('0x187')][_0x4c62('0x10b')](db[_0x4c62('0x72')],{'as':_0x4c62('0x119'),'foreignKey':_0x4c62('0x188')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x8d')],{'as':_0x4c62('0x189'),'foreignKey':_0x4c62('0x18a')});db['CmContact']['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x138')],{'as':_0x4c62('0x139'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')]['hasMany'](db['ReportAgentPreview'],{'as':_0x4c62('0x10e'),'foreignKey':_0x4c62('0x14e')});db['CmContact'][_0x4c62('0x10b')](db[_0x4c62('0xd1')],{'as':_0x4c62('0x18b'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x5f')],{'as':_0x4c62('0x18c'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x67')],{'as':_0x4c62('0x10f'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x150')});db['CmContact']['hasMany'](db[_0x4c62('0x56')],{'as':_0x4c62('0x110'),'foreignKey':_0x4c62('0x14e'),'onDelete':'restrict'});db[_0x4c62('0x72')][_0x4c62('0x10b')](db[_0x4c62('0x4c')],{'as':_0x4c62('0x111'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x72')][_0x4c62('0x10b')](db['MailInteraction'],{'as':_0x4c62('0x112'),'foreignKey':'ContactId','onDelete':_0x4c62('0x150')});db[_0x4c62('0x72')][_0x4c62('0x115')](db[_0x4c62('0x187')],{'as':_0x4c62('0x18d'),'foreignKey':_0x4c62('0x188')});db[_0x4c62('0x72')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x72')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'through':'cm_user_has_contacts'});db[_0x4c62('0x72')]['belongsToMany'](db['Tag'],{'as':'Tags','through':_0x4c62('0x18e')});db[_0x4c62('0x72')][_0x4c62('0x117')](db['Tag'],{'through':_0x4c62('0x18e'),'as':_0x4c62('0x15e')});db[_0x4c62('0x73')][_0x4c62('0x10b')](db[_0x4c62('0x18f')],{'as':_0x4c62('0x190'),'foreignKey':'CmHopperId'});db['CmHopper'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':'ContactId','onDelete':'cascade'});db[_0x4c62('0x73')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157'),'onDelete':'cascade'});db[_0x4c62('0x73')][_0x4c62('0x115')](db['User'],{'as':_0x4c62('0x17e'),'foreignKey':_0x4c62('0x10a')});db[_0x4c62('0x73')][_0x4c62('0x115')](db[_0x4c62('0x1d')],{'as':_0x4c62('0x191'),'foreignKey':'VoiceQueueId','onDelete':_0x4c62('0x107')});db['CmHopper']['belongsTo'](db['Campaign'],{'as':_0x4c62('0xe0'),'foreignKey':_0x4c62('0x192'),'onDelete':'cascade'});db[_0x4c62('0x73')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':_0x4c62('0x193')});db['CmHopperBlack'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e'),'onDelete':_0x4c62('0x107')});db['CmHopperBlack'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':'List','foreignKey':'ListId','onDelete':_0x4c62('0x107')});db[_0x4c62('0x75')][_0x4c62('0x115')](db['VoiceQueue'],{'as':_0x4c62('0x191'),'foreignKey':_0x4c62('0x136'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x75')]['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':_0x4c62('0x192'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x7d')][_0x4c62('0x10b')](db[_0x4c62('0x194')],{'as':{'plural':_0x4c62('0x195'),'singular':_0x4c62('0x196')},'foreignKey':_0x4c62('0x197'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x7d')][_0x4c62('0x10b')](db['Condition'],{'as':{'plural':'Any','singular':_0x4c62('0x198')},'foreignKey':_0x4c62('0x199'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x7d')][_0x4c62('0x10b')](db['Action'],{'as':'Actions','foreignKey':_0x4c62('0x19a'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x81')][_0x4c62('0x10b')](db[_0x4c62('0x81')],{'as':'Dispositions','foreignKey':_0x4c62('0x19b'),'onDelete':'cascade'});db['Interval']['hasMany'](db[_0x4c62('0x13e')],{'as':_0x4c62('0x19c'),'foreignKey':_0x4c62('0x13f'),'onDelete':_0x4c62('0x107'),'hooks':!![],'required':![]});db[_0x4c62('0x13e')][_0x4c62('0x10b')](db[_0x4c62('0x19')],{'as':_0x4c62('0x10d'),'foreignKey':_0x4c62('0x13f'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x13e')][_0x4c62('0x10b')](db[_0x4c62('0x164')],{'as':'MailApplications','foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x13e')]['hasMany'](db[_0x4c62('0x66')],{'as':'ChatApplications','foreignKey':_0x4c62('0x13f')});db[_0x4c62('0x13e')]['hasMany'](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x4c62('0x13f')});db['Interval'][_0x4c62('0x10b')](db['SmsApplication'],{'as':'SmsApplications','foreignKey':_0x4c62('0x13f')});db['Schedule']['belongsTo'](db[_0x4c62('0x3c')],{});db[_0x4c62('0x86')][_0x4c62('0x115')](db['AnalyticDefaultReport'],{'foreignKey':_0x4c62('0x19d')});db[_0x4c62('0x86')][_0x4c62('0x115')](db[_0x4c62('0x19e')],{'foreignKey':_0x4c62('0x19f')});db[_0x4c62('0x87')][_0x4c62('0x117')](db[_0x4c62('0x1b')],{'as':_0x4c62('0x1a0'),'through':'moh_has_sounds','onDelete':_0x4c62('0x150')});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x72')],{'through':'cm_contact_has_tags'});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x67')],{'through':_0x4c62('0x180')});db['Tag']['belongsToMany'](db[_0x4c62('0x41')],{'through':_0x4c62('0x15c')});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x56')],{'through':_0x4c62('0x171')});db[_0x4c62('0x89')]['belongsToMany'](db['FaxInteraction'],{'through':_0x4c62('0x16a')});db[_0x4c62('0x89')][_0x4c62('0x117')](db[_0x4c62('0x5f')],{'through':_0x4c62('0x178')});db['Tag'][_0x4c62('0x117')](db[_0x4c62('0xf9')],{'through':_0x4c62('0x1a1')});db[_0x4c62('0x8d')]['belongsTo'](db[_0x4c62('0x8b')],{'as':_0x4c62('0x1a2'),'foreignKey':'ItemTypeId'});db[_0x4c62('0x18f')][_0x4c62('0x115')](db['CmHopper'],{'as':_0x4c62('0x1a3'),'foreignKey':_0x4c62('0x1a4')});db['CmContactHasItem'][_0x4c62('0x115')](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x18a')});db[_0x4c62('0x92')][_0x4c62('0x10b')](db[_0x4c62('0x194')],{'as':{'plural':_0x4c62('0x1a5'),'singular':_0x4c62('0x1a6')},'foreignKey':'TriggerAllId','onDelete':_0x4c62('0x107'),'hooks':!![]});db[_0x4c62('0x92')][_0x4c62('0x10b')](db['Condition'],{'as':{'plural':_0x4c62('0x1a7'),'singular':'AnyCondition'},'foreignKey':_0x4c62('0x1a8'),'onDelete':'cascade','hooks':!![]});db[_0x4c62('0x92')][_0x4c62('0x10b')](db['Action'],{'as':_0x4c62('0x1a9'),'foreignKey':_0x4c62('0x1aa'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x4c62('0x10b')](db[_0x4c62('0x9f')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x19f'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0x4c62('0x9f')],{'as':_0x4c62('0x1ab'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0x4c62('0x9d')]['hasMany'](db[_0x4c62('0x9f')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':'MetricId'});db[_0x4c62('0x9f')][_0x4c62('0x115')](db[_0x4c62('0x9d')],{'foreignKey':_0x4c62('0x1ac')});db[_0x4c62('0xa1')][_0x4c62('0x10b')](db[_0x4c62('0xa3')],{'as':_0x4c62('0x1ad'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xa3')][_0x4c62('0x10b')](db['SalesforceField'],{'as':'Subjects','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xa3')][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1b0'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xa3')][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1ab'),'onDelete':'cascade','foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xa3')]['belongsTo'](db[_0x4c62('0xa1')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db['SalesforceField'][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['SalesforceField'][_0x4c62('0x10b')](db['SalesforceField'],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xa4')][_0x4c62('0x10b')](db[_0x4c62('0xa4')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xa4')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':'Variable','foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xa6')]['hasMany'](db[_0x4c62('0xa8')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x4c62('0xa8')][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':'Subjects','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xa8')]['hasMany'](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db['SugarcrmConfiguration']['hasMany'](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1ab'),'onDelete':'cascade','foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x4c62('0x115')](db[_0x4c62('0xa6')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xaa')][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['SugarcrmField'][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xaa')][_0x4c62('0x10b')](db[_0x4c62('0xaa')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db['SugarcrmField'][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db['DeskAccount'][_0x4c62('0x10b')](db[_0x4c62('0x1b7')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1b7')][_0x4c62('0x10b')](db[_0x4c62('0x1b8')],{'as':_0x4c62('0x1b9'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db['DeskConfiguration'][_0x4c62('0x10b')](db['DeskField'],{'as':_0x4c62('0x1b0'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db['DeskConfiguration']['hasMany'](db[_0x4c62('0x1b8')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':'FieldId'});db[_0x4c62('0x1b7')]['belongsTo'](db[_0x4c62('0xac')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1b7')]['belongsToMany'](db[_0x4c62('0x89')],{'through':_0x4c62('0x1ba')});db['DeskField']['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4c62('0x1b8')][_0x4c62('0x10b')](db['DeskField'],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db['DeskField'][_0x4c62('0x10b')](db[_0x4c62('0x1b8')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1b8')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db['ZohoAccount'][_0x4c62('0x10b')](db[_0x4c62('0x1bb')],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1bb')]['hasMany'](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b9'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1bb')][_0x4c62('0x10b')](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x4c62('0x1bb')]['hasMany'](db[_0x4c62('0xb0')],{'as':'Fields','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1bb')][_0x4c62('0x115')](db[_0x4c62('0x1bc')],{'as':_0x4c62('0x15a'),'foreignKey':'AccountId'});db[_0x4c62('0xb0')][_0x4c62('0x10b')](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb0')]['hasMany'](db[_0x4c62('0xb0')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xb0')]['hasMany'](db[_0x4c62('0xb0')],{'as':'Field','foreignKey':_0x4c62('0x1b2')});db['ZohoField'][_0x4c62('0x115')](db['Variable'],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xb2')]['hasMany'](db['ZendeskConfiguration'],{'as':_0x4c62('0x1ad'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db['ZendeskConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':'Subjects','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb4')]['hasMany'](db[_0x4c62('0xb6')],{'as':_0x4c62('0x1b0'),'foreignKey':'DescriptionId'});db[_0x4c62('0xb4')][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':_0x4c62('0x1ab'),'foreignKey':'FieldId'});db[_0x4c62('0xb4')]['belongsTo'](db[_0x4c62('0xb2')],{'as':'Account','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xb4')]['belongsToMany'](db['Tag'],{'through':_0x4c62('0x1bd')});db[_0x4c62('0xb6')][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':'Subject','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb6')][_0x4c62('0x10b')](db[_0x4c62('0xb6')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xb6')][_0x4c62('0x10b')](db['ZendeskField'],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xb6')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0x1be')][_0x4c62('0x10b')](db['FreshdeskConfiguration'],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db['FreshdeskConfiguration'][_0x4c62('0x10b')](db['FreshdeskField'],{'as':_0x4c62('0x1b9'),'onDelete':'cascade','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0xb9')][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':'Descriptions','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xb9')][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':'Fields','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xb9')][_0x4c62('0x115')](db[_0x4c62('0x1be')],{'as':_0x4c62('0x15a'),'foreignKey':'AccountId'});db[_0x4c62('0xb9')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x1c0')});db['FreshdeskField'][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['FreshdeskField'][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0x1bf')][_0x4c62('0x10b')](db[_0x4c62('0x1bf')],{'as':_0x4c62('0x1b5'),'foreignKey':'FieldId'});db[_0x4c62('0x1bf')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db['VtigerAccount'][_0x4c62('0x10b')](db[_0x4c62('0xbd')],{'as':_0x4c62('0x1ad'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db['VtigerConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b9'),'foreignKey':_0x4c62('0x1af')});db['VtigerConfiguration'][_0x4c62('0x10b')](db['VtigerField'],{'as':_0x4c62('0x1b0'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xbd')][_0x4c62('0x10b')](db[_0x4c62('0xbf')],{'as':'Fields','foreignKey':_0x4c62('0x1b2')});db['VtigerConfiguration']['belongsTo'](db[_0x4c62('0xbb')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xbf')]['hasMany'](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['VtigerField'][_0x4c62('0x10b')](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xbf')]['hasMany'](db[_0x4c62('0xbf')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xbf')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xc0')]['hasMany'](db[_0x4c62('0xc2')],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db['ServicenowConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0x1c1')],{'as':_0x4c62('0x1b9'),'foreignKey':'SubjectId'});db[_0x4c62('0xc2')]['hasMany'](db[_0x4c62('0x1c1')],{'as':'Descriptions','foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xc2')][_0x4c62('0x10b')](db[_0x4c62('0x1c1')],{'as':_0x4c62('0x1ab'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x4c62('0x115')](db[_0x4c62('0xc0')],{'as':_0x4c62('0x15a'),'foreignKey':'AccountId'});db[_0x4c62('0x1c1')][_0x4c62('0x10b')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1c1')]['hasMany'](db[_0x4c62('0x1c1')],{'as':_0x4c62('0x1b4'),'foreignKey':_0x4c62('0x1b1')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c1')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xc4')]['hasMany'](db[_0x4c62('0xc6')],{'as':'Configurations','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0xc4')][_0x4c62('0x115')](db[_0x4c62('0x101')],{'as':_0x4c62('0x101'),'foreignKey':_0x4c62('0x1c2')});db['Dynamics365Configuration'][_0x4c62('0x10b')](db['Dynamics365Field'],{'as':_0x4c62('0x1b9'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1af')});db['Dynamics365Configuration'][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b0'),'onDelete':'cascade','foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0xc6')][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1ab'),'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0xc6')][_0x4c62('0x115')](db[_0x4c62('0xc4')],{'as':'Account','foreignKey':_0x4c62('0x1ae')});db['Dynamics365Field'][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1c3')]['hasMany'](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b4'),'foreignKey':'DescriptionId'});db[_0x4c62('0x1c3')][_0x4c62('0x10b')](db[_0x4c62('0x1c3')],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c3')]['belongsTo'](db[_0x4c62('0x93')],{'as':'Variable','foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xc8')][_0x4c62('0x10b')](db['FreshsalesConfiguration'],{'as':_0x4c62('0x1ad'),'onDelete':'cascade','foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1c4')][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':_0x4c62('0x1b9'),'foreignKey':_0x4c62('0x1af')});db[_0x4c62('0x1c4')][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':_0x4c62('0x1b0'),'foreignKey':_0x4c62('0x1b1')});db['FreshsalesConfiguration'][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':_0x4c62('0x1ab'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c4')][_0x4c62('0x115')](db[_0x4c62('0xc8')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1ae')});db[_0x4c62('0x1c5')][_0x4c62('0x10b')](db['FreshsalesField'],{'as':_0x4c62('0x1b3'),'foreignKey':_0x4c62('0x1af')});db['FreshsalesField'][_0x4c62('0x10b')](db[_0x4c62('0x1c5')],{'as':'Description','foreignKey':_0x4c62('0x1b1')});db[_0x4c62('0x1c5')][_0x4c62('0x10b')](db['FreshsalesField'],{'as':_0x4c62('0x1b5'),'foreignKey':_0x4c62('0x1b2')});db[_0x4c62('0x1c5')][_0x4c62('0x115')](db[_0x4c62('0x93')],{'as':_0x4c62('0x93'),'foreignKey':_0x4c62('0x1b6')});db[_0x4c62('0xcd')]['belongsTo'](db[_0x4c62('0x64')],{});db['ChatQueueReport'][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db[_0x4c62('0xcd')]['belongsTo'](db[_0x4c62('0x72')],{'as':'Contact','foreignKey':_0x4c62('0x14e')});db[_0x4c62('0xcd')]['belongsTo'](db[_0x4c62('0x67')],{});db[_0x4c62('0xcd')][_0x4c62('0x115')](db[_0x4c62('0x69')],{});db[_0x4c62('0xcd')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db['ChatQueueReport']['belongsTo'](db[_0x4c62('0x6c')],{});db['ChatInternalMessage'][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1c6')});db[_0x4c62('0x183')][_0x4c62('0x115')](db['User'],{'onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1c7')});db[_0x4c62('0xd1')][_0x4c62('0x10b')](db[_0x4c62('0xcf')],{'foreignKey':_0x4c62('0x1c8'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xd1')][_0x4c62('0x10b')](db[_0x4c62('0xce')],{'foreignKey':_0x4c62('0x1c8'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xd2')]['belongsTo'](db[_0x4c62('0x53')],{});db[_0x4c62('0xd2')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0xd2')]['belongsTo'](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db['SmsQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x56')],{});db[_0x4c62('0xd2')][_0x4c62('0x115')](db['SmsMessage'],{});db['SmsQueueReport']['belongsTo'](db[_0x4c62('0x12')],{});db[_0x4c62('0xd2')][_0x4c62('0x115')](db[_0x4c62('0x59')],{});db[_0x4c62('0xd7')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':'ProjectId'});db[_0x4c62('0xd7')][_0x4c62('0x10b')](db[_0x4c62('0xcf')],{'foreignKey':_0x4c62('0x1c9')});db['JscriptyProject'][_0x4c62('0x10b')](db[_0x4c62('0xce')],{'foreignKey':'ProjectId'});db['Team'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x1ca')});db['Team'][_0x4c62('0x117')](db['VoiceQueue'],{'through':_0x4c62('0x102'),'as':'VoiceQueues'});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0x3e')],{'through':_0x4c62('0x158'),'as':_0x4c62('0x123')});db[_0x4c62('0x11c')]['belongsToMany'](db[_0x4c62('0x6c')],{'through':_0x4c62('0x182'),'as':_0x4c62('0x124')});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0x4f')],{'through':'team_has_fax_queues','as':'FaxQueues'});db['Team'][_0x4c62('0x117')](db['SmsQueue'],{'through':_0x4c62('0x174'),'as':_0x4c62('0x127')});db[_0x4c62('0x11c')]['belongsToMany'](db[_0x4c62('0x62')],{'through':_0x4c62('0x17a'),'as':'OpenchannelQueues'});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0x129')],{'through':'team_has_whatsapp_queues','as':_0x4c62('0x12a')});db[_0x4c62('0x11c')][_0x4c62('0x117')](db[_0x4c62('0xef')],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x4c62('0xe0')][_0x4c62('0x10b')](db[_0x4c62('0x73')],{'as':_0x4c62('0x1cb'),'foreignKey':_0x4c62('0x192')});db[_0x4c62('0xe0')][_0x4c62('0x10b')](db[_0x4c62('0x76')],{'as':_0x4c62('0x137'),'foreignKey':_0x4c62('0x192')});db[_0x4c62('0xe0')]['hasMany'](db['CmHopperHistory'],{'as':_0x4c62('0x139'),'foreignKey':_0x4c62('0x192')});db[_0x4c62('0xe0')][_0x4c62('0x10b')](db['CmHopperBlack'],{'as':_0x4c62('0x13a'),'foreignKey':_0x4c62('0x192')});db['Campaign']['belongsTo'](db[_0x4c62('0x2a')],{'as':_0x4c62('0x2a'),'foreignKey':'TrunkId'});db[_0x4c62('0xe0')][_0x4c62('0x115')](db[_0x4c62('0x2a')],{'as':_0x4c62('0x13c'),'foreignKey':'TrunkBackupId'});db[_0x4c62('0xe0')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'as':_0x4c62('0x13e'),'foreignKey':_0x4c62('0x13f')});db['Campaign'][_0x4c62('0x115')](db[_0x4c62('0xdc')],{'as':_0x4c62('0xdc'),'foreignKey':_0x4c62('0x1cc')});db[_0x4c62('0xe0')][_0x4c62('0x117')](db[_0x4c62('0xed')],{'as':'Lists','through':_0x4c62('0x1cd')});db[_0x4c62('0xe0')][_0x4c62('0x117')](db[_0x4c62('0xed')],{'as':_0x4c62('0x1ce'),'through':_0x4c62('0x1cf')});db[_0x4c62('0xe4')][_0x4c62('0x115')](db[_0x4c62('0x181')],{'as':_0x4c62('0x181'),'foreignKey':_0x4c62('0x163')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x43')],{});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x41')],{});db[_0x4c62('0x1d0')]['belongsTo'](db[_0x4c62('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x4c62('0x1d1')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db[_0x4c62('0x3e')],{'foreignKey':_0x4c62('0x1d6'),'as':_0x4c62('0x1d7')});db[_0x4c62('0x1d0')][_0x4c62('0x115')](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0x4c62('0x1d8')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x69')],{});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x67')],{});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'foreignKey':'FromChatWebsiteId','as':_0x4c62('0x1d1')});db['ChatTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x6c')],{'foreignKey':_0x4c62('0x1d9'),'as':_0x4c62('0x1d7')});db[_0x4c62('0xe8')][_0x4c62('0x115')](db[_0x4c62('0x64')],{'foreignKey':_0x4c62('0x1da'),'as':_0x4c62('0x1d8')});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x4d')],{});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x4c')],{});db['FaxTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x167')],{'foreignKey':_0x4c62('0x1db'),'as':_0x4c62('0x1d1')});db[_0x4c62('0xea')][_0x4c62('0x115')](db['User'],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db['FaxTransferReport'][_0x4c62('0x115')](db['FaxQueue'],{'foreignKey':_0x4c62('0x1dc'),'as':'ToQueue'});db[_0x4c62('0xea')][_0x4c62('0x115')](db[_0x4c62('0x167')],{'foreignKey':_0x4c62('0x1dd'),'as':_0x4c62('0x1d8')});db['OpenchannelTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x176')],{});db[_0x4c62('0x1de')]['belongsTo'](db[_0x4c62('0x5f')],{});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x5b')],{'foreignKey':_0x4c62('0x1df'),'as':_0x4c62('0x1d1')});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db['OpenchannelTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x62')],{'foreignKey':'ToOpenchannelQueueId','as':_0x4c62('0x1d7')});db[_0x4c62('0x1de')][_0x4c62('0x115')](db[_0x4c62('0x5b')],{'foreignKey':_0x4c62('0x1e0'),'as':_0x4c62('0x1d8')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db['SmsMessage'],{});db['SmsTransferReport'][_0x4c62('0x115')](db[_0x4c62('0x56')],{});db[_0x4c62('0xeb')][_0x4c62('0x115')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x4c62('0x1d1')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db['User'],{'foreignKey':_0x4c62('0x1d2'),'as':_0x4c62('0x1d3')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d4'),'as':_0x4c62('0x1d5')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db[_0x4c62('0x59')],{'foreignKey':_0x4c62('0x1e1'),'as':_0x4c62('0x1d7')});db[_0x4c62('0xeb')][_0x4c62('0x115')](db[_0x4c62('0x53')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x4c62('0xed')]['hasMany'](db['Disposition'],{'as':_0x4c62('0x153'),'foreignKey':_0x4c62('0x157'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xed')][_0x4c62('0x10b')](db[_0x4c62('0x1e2')],{'as':_0x4c62('0x1e3'),'foreignKey':'ListId'});db[_0x4c62('0xed')][_0x4c62('0x10b')](db['CmContact'],{'as':'Contacts','onDelete':'cascade','foreignKey':_0x4c62('0x157')});db[_0x4c62('0xed')][_0x4c62('0x10b')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x4c62('0xed')][_0x4c62('0x10b')](db[_0x4c62('0x138')],{'as':_0x4c62('0x1e4'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0xed')]['hasMany'](db[_0x4c62('0x10e')],{'as':_0x4c62('0x10e'),'foreignKey':_0x4c62('0x157')});db[_0x4c62('0xed')][_0x4c62('0x117')](db[_0x4c62('0x1d')],{'as':'Queues','through':_0x4c62('0x1e5')});db[_0x4c62('0xed')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x11b')});db[_0x4c62('0xef')][_0x4c62('0x10b')](db['VoiceExtension'],{'as':_0x4c62('0x10d'),'onDelete':_0x4c62('0x107')});db['VoicePrefix'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':_0x4c62('0x104')});db[_0x4c62('0xef')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x103'),'as':_0x4c62('0x144')});db[_0x4c62('0x1e6')]['hasMany'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15f'),'foreignKey':_0x4c62('0x116')});db[_0x4c62('0x1e6')][_0x4c62('0x10b')](db[_0x4c62('0x1e7')],{'as':'UserProfileSections','foreignKey':_0x4c62('0x116'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0x1e7')][_0x4c62('0x10b')](db[_0x4c62('0xf2')],{'as':'Resources','foreignKey':_0x4c62('0x1e8'),'onDelete':_0x4c62('0x107')});db[_0x4c62('0xf5')]['hasMany'](db[_0x4c62('0x81')],{'as':_0x4c62('0x153'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x4c62('0xf5')][_0x4c62('0x10b')](db[_0x4c62('0x7f')],{'as':_0x4c62('0x154'),'foreignKey':_0x4c62('0x1e9')});db[_0x4c62('0xf5')]['hasMany'](db[_0x4c62('0xfb')],{'as':_0x4c62('0x155'),'foreignKey':_0x4c62('0x1e9')});db[_0x4c62('0xf5')]['hasMany'](db[_0x4c62('0xf9')],{'as':'Interactions'});db[_0x4c62('0xf5')][_0x4c62('0x10b')](db[_0x4c62('0xf7')],{'as':'Applications'});db[_0x4c62('0xf5')][_0x4c62('0x115')](db[_0x4c62('0xed')],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db['WhatsappAccount'][_0x4c62('0x115')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':_0x4c62('0x143'),'through':'user_has_whatsapp_accounts'});db[_0x4c62('0xf7')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'onDelete':_0x4c62('0x150')});db['WhatsappApplication'][_0x4c62('0x115')](db[_0x4c62('0x129')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0xf7')]['belongsTo'](db[_0x4c62('0xf5')],{'onDelete':_0x4c62('0x150')});db[_0x4c62('0xf7')][_0x4c62('0x115')](db[_0x4c62('0x13e')],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x13f')});db['WhatsappApplication'][_0x4c62('0x115')](db['Tag'],{'onDelete':_0x4c62('0x150'),'foreignKey':_0x4c62('0x165')});db[_0x4c62('0xf9')][_0x4c62('0x10b')](db[_0x4c62('0xfb')],{'as':'Messages','onDelete':_0x4c62('0x107'),'foreignKey':_0x4c62('0x1ea')});db[_0x4c62('0xf9')][_0x4c62('0x115')](db[_0x4c62('0xf5')],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1e9')});db['WhatsappInteraction']['belongsTo'](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0xf9')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x15b'),'foreignKey':_0x4c62('0x10a')});db['WhatsappInteraction'][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x1a1'),'as':_0x4c62('0x15d')});db[_0x4c62('0xf9')][_0x4c62('0x117')](db[_0x4c62('0x89')],{'through':_0x4c62('0x1a1'),'as':_0x4c62('0x15e')});db[_0x4c62('0xf9')]['belongsToMany'](db[_0x4c62('0x12')],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x4c62('0xfb')]['belongsTo'](db[_0x4c62('0x12')],{'as':_0x4c62('0x12')});db[_0x4c62('0xfb')][_0x4c62('0x115')](db['CmContact'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x14d')});db[_0x4c62('0xfb')]['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x4c62('0x107'),'as':_0x4c62('0x161'),'foreignKey':_0x4c62('0x1ea')});db[_0x4c62('0xfb')][_0x4c62('0x115')](db['WhatsappAccount'],{'as':_0x4c62('0x15a'),'foreignKey':_0x4c62('0x1e9')});db['WhatsappQueueReport'][_0x4c62('0x115')](db[_0x4c62('0xf5')],{});db[_0x4c62('0xfd')][_0x4c62('0x115')](db['CmList'],{'as':_0x4c62('0x156'),'foreignKey':'ListId'});db[_0x4c62('0xfd')]['belongsTo'](db[_0x4c62('0x72')],{'as':_0x4c62('0x14d'),'foreignKey':_0x4c62('0x14e')});db[_0x4c62('0xfd')][_0x4c62('0x115')](db[_0x4c62('0xf9')],{});db['WhatsappQueueReport'][_0x4c62('0x115')](db[_0x4c62('0x129')],{});db[_0x4c62('0xfd')]['belongsTo'](db[_0x4c62('0xfb')],{});db[_0x4c62('0xfd')][_0x4c62('0x115')](db[_0x4c62('0x12')],{});db[_0x4c62('0x1eb')][_0x4c62('0x115')](db[_0x4c62('0xfb')],{});db['WhatsappTransferReport'][_0x4c62('0x115')](db[_0x4c62('0xf9')],{});db[_0x4c62('0x1eb')][_0x4c62('0x115')](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0x4c62('0x115')](db[_0x4c62('0xf5')],{'foreignKey':_0x4c62('0x1ec'),'as':'ToAccount'});db[_0x4c62('0x1eb')]['belongsTo'](db[_0x4c62('0x129')],{'foreignKey':_0x4c62('0x1ed'),'as':_0x4c62('0x1d7')});db[_0x4c62('0x1eb')][_0x4c62('0x115')](db[_0x4c62('0x12')],{'foreignKey':_0x4c62('0x1d2'),'as':'FromAgent'});db[_0x4c62('0x1eb')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x4c62('0x1d5')});db[_0x4c62('0x129')][_0x4c62('0x117')](db[_0x4c62('0x12')],{'as':'Agents','through':_0x4c62('0x37'),'foreignKey':_0x4c62('0x1ee')});db[_0x4c62('0x129')][_0x4c62('0x117')](db[_0x4c62('0x11c')],{'through':_0x4c62('0x1ef'),'as':'Teams'});db[_0x4c62('0x108')][_0x4c62('0x115')](db['User'],{'as':'user','foreignKey':_0x4c62('0x10a'),'onDelete':_0x4c62('0x107'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0x4c62('0xc4')],{'as':_0x4c62('0xc4'),'onDelete':_0x4c62('0x150')});db['CloudProvider'][_0x4c62('0x106')](db[_0x4c62('0x39')],{'as':_0x4c62('0x151'),'onDelete':_0x4c62('0x150')});db[_0x4c62('0x101')][_0x4c62('0x106')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x4c62('0x150')});module[_0x4c62('0x1f0')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xa50f=['WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','User','cascade','UserId','hasOne','userSetting','hasMany','VoiceQueuesRt','Extensions','HopperFinals','ChatInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','MailQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_fax_accounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','UserVoiceQueueRt','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','MailServerIn','MailAccountId','CloudProviderId','restrict','MailAccount','Imap','Smtp','Dispositions','Answers','MailMessage','Interactions','Applications','List','ListId','TemplateId','team_has_mail_queues','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Interaction','ChatOfflineMessageId','TagId','ContactId','Items','FaxAccountId','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','CompanyId','Phones','CmContactId','Company','cm_contact_has_tags','CmHopperId','Agent','CampaignId','OwnerId','Automation','AutomationAllId','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','AnalyticDefaultReport','DefaultReportId','AnalyticMetric','MetricId','SalesforceConfiguration','Configurations','SalesforceField','Subjects','Descriptions','Subject','SubjectId','Description','DescriptionId','FieldId','SugarcrmAccount','AccountId','SugarcrmConfiguration','SugarcrmField','Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZendeskConfiguration','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','ChatQueueReport','FromId','ToId','SessionId','SmsQueueReport','JscriptyProject','ProjectId','ChatQueues','team_has_sms_queues','team_has_whatsapp_queues','VoicePrefixes','SquareProject','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToQueue','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','Resources','WhatsappAccount','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','sequelize','lodash','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','username','options','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','import','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskField','FreshdeskAccount','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','JscriptyQuestionReport','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','../api/whatsappApplication/whatsappApplication.model'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0xa50f,0xfa));var _0xfa50=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xa50f[_0x3e5086];return _0xfeb102;};'use strict';var config=require(_0xfa50('0x0'));var Sequelize=require(_0xfa50('0x1'));var _=require(_0xfa50('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config['sequelize']=_[_0xfa50('0x3')](config['sequelize'],{'database':_0xfa50('0x4'),'username':'xcall','password':_0xfa50('0x5'),'options':{'host':_0xfa50('0x6'),'port':0xcea,'dialect':_0xfa50('0x7'),'dialectOptions':{'charset':_0xfa50('0x8')},'logging':![],'timezone':timezone[_0xfa50('0x9')](),'define':{'charset':_0xfa50('0xa'),'collate':_0xfa50('0xb')}}});config['sequelizeHistory']=_[_0xfa50('0x3')](config[_0xfa50('0xc')],{'database':_0xfa50('0x4'),'username':_0xfa50('0xd'),'password':_0xfa50('0x5'),'options':{'host':_0xfa50('0x6'),'port':0xcea,'dialect':_0xfa50('0x7'),'dialectOptions':{'charset':_0xfa50('0x8')},'logging':![],'timezone':timezone[_0xfa50('0x9')](),'define':{'charset':'utf8','collate':_0xfa50('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa50('0x1')][_0xfa50('0xe')],config[_0xfa50('0x1')][_0xfa50('0xf')],config[_0xfa50('0x1')]['password'],config[_0xfa50('0x1')][_0xfa50('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa50('0xc')][_0xfa50('0xe')],config[_0xfa50('0xc')][_0xfa50('0xf')],config[_0xfa50('0xc')]['password'],config['sequelizeHistory'][_0xfa50('0x10')])};db['User']=db[_0xfa50('0x1')]['import'](_0xfa50('0x11'));db[_0xfa50('0x12')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x13'));db[_0xfa50('0x14')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x15'));db[_0xfa50('0x16')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/voiceExtension/voiceExtension.model');db[_0xfa50('0x18')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x19'));db[_0xfa50('0x1a')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x1b'));db[_0xfa50('0x1c')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x1d'));db['ScreenRecording']=db[_0xfa50('0x1')]['import'](_0xfa50('0x1e'));db[_0xfa50('0x1f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x20'));db['VoiceMailMessage']=db[_0xfa50('0x1')]['import'](_0xfa50('0x21'));db[_0xfa50('0x22')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x23'));db[_0xfa50('0x24')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x25'));db[_0xfa50('0x26')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x27'));db[_0xfa50('0x28')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x29'));db['MemberReport']=db[_0xfa50('0x1')]['import'](_0xfa50('0x2a'));db['Trunk']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/trunk/trunk.model');db[_0xfa50('0x2b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x2c'));db['UserVoiceQueueRt']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x2d'));db[_0xfa50('0x2e')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x2f'));db[_0xfa50('0x30')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x31'));db[_0xfa50('0x32')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x33'));db[_0xfa50('0x34')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x35'));db['UserSmsQueue']=db[_0xfa50('0x1')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0xfa50('0x36')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x37'));db[_0xfa50('0x38')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x39'));db['MailServerIn']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x3a'));db[_0xfa50('0x3b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x3c'));db['MailAccount']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/mailAccount/mailAccount.model');db[_0xfa50('0x3d')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x3e'));db[_0xfa50('0x3f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x40'));db[_0xfa50('0x41')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x42'));db['MailMessage']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x43'));db[_0xfa50('0x44')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/mailApplication/mailApplication.model');db[_0xfa50('0x45')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x46'));db[_0xfa50('0x47')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x48'));db[_0xfa50('0x49')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x4a'));db[_0xfa50('0x4b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x4c'));db[_0xfa50('0x4d')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x4e'));db[_0xfa50('0x4f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x50'));db[_0xfa50('0x51')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x52'));db[_0xfa50('0x53')]=db['sequelize']['import'](_0xfa50('0x54'));db[_0xfa50('0x55')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x56'));db['SmsAccount']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x57'));db['SmsApplication']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x58'));db[_0xfa50('0x59')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x5a'));db[_0xfa50('0x5b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x5c'));db[_0xfa50('0x5d')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/smsQueue/smsQueue.model');db[_0xfa50('0x5e')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/openchannelAccount/openchannelAccount.model');db['OpenchannelApplication']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/openchannelApplication/openchannelApplication.model');db[_0xfa50('0x5f')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x60'));db['OpenchannelMessage']=db['sequelize']['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xfa50('0x61')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x62'));db[_0xfa50('0x63')]=db['sequelize']['import'](_0xfa50('0x64'));db['OpenchannelQueueReport']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x65'));db[_0xfa50('0x66')]=db[_0xfa50('0x1')]['import']('../api/chatApplication/chatApplication.model');db[_0xfa50('0x67')]=db[_0xfa50('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0xfa50('0x68')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x69'));db[_0xfa50('0x6a')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x6b'));db[_0xfa50('0x6c')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x6d'));db[_0xfa50('0x6e')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/chatGroup/chatGroup.model');db[_0xfa50('0x6f')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x70'));db[_0xfa50('0x71')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x72'));db[_0xfa50('0x73')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmContact/cmContact.model');db[_0xfa50('0x74')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x75'));db[_0xfa50('0x76')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x77'));db[_0xfa50('0x78')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xfa50('0x79')]=db['sequelize']['import'](_0xfa50('0x7a'));db[_0xfa50('0x7b')]=db[_0xfa50('0x1')]['import']('../api/reportAgentPreview/reportAgentPreview.model');db[_0xfa50('0x7c')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmCustomField/cmCustomField.model');db[_0xfa50('0x7d')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x7e'));db['Automation']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/automation/automation.model');db[_0xfa50('0x7f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x80'));db[_0xfa50('0x81')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x82'));db[_0xfa50('0x83')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x84'));db[_0xfa50('0x85')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x86'));db[_0xfa50('0x87')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/pause/pause.model');db[_0xfa50('0x88')]=db[_0xfa50('0x1')]['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db['sequelize'][_0xfa50('0x17')]('../api/schedule/schedule.model');db[_0xfa50('0x89')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8a'));db['Tag']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8b'));db[_0xfa50('0x8c')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8d'));db[_0xfa50('0x8e')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x8f'));db[_0xfa50('0x90')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x91'));db[_0xfa50('0x92')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/template/template.model');db[_0xfa50('0x93')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x94'));db[_0xfa50('0x95')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x96'));db[_0xfa50('0x97')]=db['sequelize']['import'](_0xfa50('0x98'));db[_0xfa50('0x99')]=db[_0xfa50('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0xfa50('0x9a')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x9b'));db['AnalyticDefaultReport']=db[_0xfa50('0x1')]['import'](_0xfa50('0x9c'));db[_0xfa50('0x9d')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x9e'));db['AnalyticMetric']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/analyticMetric/analyticMetric.model');db[_0xfa50('0x9f')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa0'));db['AnalyticTreeReport']=db['sequelize']['import'](_0xfa50('0xa1'));db[_0xfa50('0xa2')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa3'));db['SalesforceConfiguration']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xa4'));db['SalesforceField']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa5'));db['SugarcrmAccount']=db[_0xfa50('0x1')]['import'](_0xfa50('0xa6'));db['SugarcrmConfiguration']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa7'));db['SugarcrmField']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa8'));db['DeskAccount']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xa9'));db[_0xfa50('0xaa')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xab'));db[_0xfa50('0xac')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xad'));db[_0xfa50('0xae')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xaf'));db[_0xfa50('0xb0')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xb1'));db[_0xfa50('0xb2')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xb3'));db[_0xfa50('0xb4')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xb5'));db['ZendeskConfiguration']=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xfa50('0xb6')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/intZendeskField/intZendeskField.model');db[_0xfa50('0xb7')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db['FreshdeskConfiguration']=db['sequelize'][_0xfa50('0x17')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xfa50('0xb8')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xb9'));db[_0xfa50('0xba')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xbb'));db[_0xfa50('0xbc')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xbd'));db['VtigerField']=db['sequelize']['import'](_0xfa50('0xbe'));db[_0xfa50('0xbf')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xc0'));db[_0xfa50('0xc1')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xc2'));db[_0xfa50('0xc3')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xc4'));db['Dynamics365Account']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xc5'));db[_0xfa50('0xc6')]=db['sequelize'][_0xfa50('0x17')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xfa50('0xc7')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xc8'));db[_0xfa50('0xc9')]=db['sequelize'][_0xfa50('0x17')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xfa50('0xca')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xcb'));db[_0xfa50('0xcc')]=db['sequelize']['import'](_0xfa50('0xcd'));db[_0xfa50('0x97')]=db[_0xfa50('0x1')]['import'](_0xfa50('0x98'));db[_0xfa50('0xce')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xcf'));db['ChatQueueReport']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd0'));db[_0xfa50('0xd1')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xfa50('0xd2')]=db[_0xfa50('0x1')]['import']('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xfa50('0xd3')]=db[_0xfa50('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xfa50('0xd4')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd5'));db['SquareReport']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd6'));db[_0xfa50('0xd7')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xd8'));db['JscriptyProject']=db[_0xfa50('0x1')]['import'](_0xfa50('0xd9'));db[_0xfa50('0xda')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdb'));db['SquareOdbc']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdc'));db['SquareProject']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdd'));db[_0xfa50('0xde')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xdf'));db['SquareMessage']=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xe0'));db[_0xfa50('0xe1')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xe2'));db['License']=db['sequelize']['import'](_0xfa50('0xe3'));db[_0xfa50('0xe4')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/campaign/campaign.model');db[_0xfa50('0xe5')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xe6'));db[_0xfa50('0xe7')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xe8'));db[_0xfa50('0xe9')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xea'));db[_0xfa50('0xeb')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xec'));db[_0xfa50('0xed')]=db['sequelize']['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xfa50('0xee')]=db['sequelize']['import'](_0xfa50('0xef'));db[_0xfa50('0xf0')]=db['sequelize']['import'](_0xfa50('0xf1'));db[_0xfa50('0xf2')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xf3'));db[_0xfa50('0xf4')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cmList/cmList.model');db[_0xfa50('0xf5')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xf6'));db[_0xfa50('0xf7')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0xf8'));db[_0xfa50('0xf9')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0xfa'));db[_0xfa50('0xfb')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/userProfileResource/userProfileResource.model');db[_0xfa50('0xfc')]=db[_0xfa50('0x1')]['import'](_0xfa50('0xfd'));db['WhatsappAccount']=db['sequelize'][_0xfa50('0x17')]('../api/whatsappAccount/whatsappAccount.model');db['WhatsappApplication']=db[_0xfa50('0x1')]['import'](_0xfa50('0xfe'));db[_0xfa50('0xff')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xfa50('0x100')]=db['sequelize']['import']('../api/whatsappMessage/whatsappMessage.model');db[_0xfa50('0x101')]=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x102'));db[_0xfa50('0x103')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x104'));db['WhatsappQueue']=db['sequelize'][_0xfa50('0x17')](_0xfa50('0x105'));db[_0xfa50('0x106')]=db[_0xfa50('0x1')][_0xfa50('0x17')]('../api/cloudProvider/cloudProvider.model');db[_0xfa50('0x107')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x108'));db[_0xfa50('0x109')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x10a'));db[_0xfa50('0x10b')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x10c'));db[_0xfa50('0x10d')]=db[_0xfa50('0x1')][_0xfa50('0x17')](_0xfa50('0x10e'));db[_0xfa50('0x10f')]['hasOne'](db[_0xfa50('0x1f')],{'as':_0xfa50('0x1f'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x112')](db[_0xfa50('0x10d')],{'as':_0xfa50('0x113'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x111')});db['User'][_0xfa50('0x114')](db[_0xfa50('0x1c')],{'as':'Recordings','foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db['UserVoiceQueueRt'],{'as':_0xfa50('0x115'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0x16')],{'as':_0xfa50('0x116'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db['User'][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':_0xfa50('0x117'),'foreignKey':_0xfa50('0x111')});db['User']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0x7b')],{'as':_0xfa50('0x7b'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0x5f')],{'as':'OpenchannelInteractions','foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0x67')],{'as':_0xfa50('0x118'),'foreignKey':'UserId'});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0x59')],{'as':'SmsInteractions','foreignKey':'UserId'});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0x4f')],{'as':_0xfa50('0x119'),'foreignKey':'UserId'});db[_0xfa50('0x10f')][_0xfa50('0x114')](db['MailInteraction'],{'as':_0xfa50('0x11a'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')][_0xfa50('0x114')](db[_0xfa50('0xff')],{'as':_0xfa50('0x11b'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x10f')]['hasMany'](db[_0xfa50('0xfc')],{'as':_0xfa50('0x11c'),'foreignKey':_0xfa50('0x11d')});db[_0xfa50('0x10f')][_0xfa50('0x11e')](db[_0xfa50('0xf7')],{'as':_0xfa50('0xf7'),'foreignKey':_0xfa50('0x11f')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x6e')],{'as':'Groups','through':_0xfa50('0x121')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x73')],{'as':_0xfa50('0x122'),'through':'cm_user_has_contacts'});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x123'),'through':_0xfa50('0x124')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x125')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x41')],{'as':'MailInteractions','through':_0xfa50('0x126')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x67')],{'as':'ChatInteractions','through':_0xfa50('0x127')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x4f')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x59')],{'as':_0xfa50('0x128'),'through':_0xfa50('0x129')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xfa50('0x12a'),'through':_0xfa50('0x12b')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db['WhatsappInteraction'],{'as':_0xfa50('0x11b'),'through':'user_has_whatsapp_interactions'});db['User'][_0xfa50('0x120')](db[_0xfa50('0x1a')],{'as':_0xfa50('0x12c'),'through':_0xfa50('0x2e'),'required':![]});db['User'][_0xfa50('0x120')](db[_0xfa50('0xf5')],{'as':'VoicePrefixes','through':_0xfa50('0x10b'),'required':![]});db[_0xfa50('0x10f')]['belongsToMany'](db['MailQueue'],{'as':_0xfa50('0x12d'),'through':_0xfa50('0x32'),'required':![]});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x6c')],{'as':'ChatQueues','through':_0xfa50('0x30'),'required':![],'hooks':!![]});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x53')],{'as':_0xfa50('0x12e'),'through':_0xfa50('0x34'),'required':![]});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x5d')],{'as':_0xfa50('0x12f'),'through':_0xfa50('0x130'),'required':![]});db['User'][_0xfa50('0x120')](db[_0xfa50('0x61')],{'as':_0xfa50('0x131'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xfa50('0x120')](db[_0xfa50('0x132')],{'as':_0xfa50('0x133'),'through':_0xfa50('0x38'),'required':![]});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'through':'cm_user_has_lists'});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x63')],{'as':_0xfa50('0x134'),'through':'user_has_chat_websites'});db[_0xfa50('0x10f')][_0xfa50('0x120')](db['FaxAccount'],{'as':'FaxAccounts','through':_0xfa50('0x135')});db[_0xfa50('0x10f')]['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0xfa50('0x136')});db[_0xfa50('0x10f')]['belongsToMany'](db[_0xfa50('0x5e')],{'as':'OpenchannelAccounts','through':_0xfa50('0x137')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db[_0xfa50('0x138')],{'as':'SmsAccounts','through':_0xfa50('0x139')});db[_0xfa50('0x10f')][_0xfa50('0x120')](db['WhatsappAccount'],{'as':_0xfa50('0x13a'),'through':_0xfa50('0x13b')});db[_0xfa50('0x12')][_0xfa50('0x114')](db['VoiceExtension'],{'as':_0xfa50('0x13c'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x13d')});db[_0xfa50('0x14')][_0xfa50('0x114')](db[_0xfa50('0x16')],{'onDelete':_0xfa50('0x110')});db[_0xfa50('0x16')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0xfa50('0x110')});db[_0xfa50('0x18')][_0xfa50('0x120')](db['Sound'],{'as':_0xfa50('0x13e'),'through':_0xfa50('0x13f')});db[_0xfa50('0x1a')][_0xfa50('0x114')](db[_0xfa50('0x140')],{'as':_0xfa50('0x141'),'foreignKey':_0xfa50('0x142')});db[_0xfa50('0x1a')][_0xfa50('0x114')](db[_0xfa50('0x74')],{'as':_0xfa50('0x143'),'foreignKey':'VoiceQueueId'});db[_0xfa50('0x1a')][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':_0xfa50('0x117'),'foreignKey':_0xfa50('0x142')});db[_0xfa50('0x1a')]['hasMany'](db[_0xfa50('0x79')],{'as':_0xfa50('0x144'),'foreignKey':_0xfa50('0x142')});db['VoiceQueue'][_0xfa50('0x114')](db[_0xfa50('0x7b')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0xfa50('0x1a')][_0xfa50('0x114')](db['CmHopperBlack'],{'as':_0xfa50('0x145'),'foreignKey':_0xfa50('0x142')});db[_0xfa50('0x1a')]['hasMany'](db[_0xfa50('0xd4')],{'as':_0xfa50('0x146'),'foreignKey':'VoiceQueueId'});db[_0xfa50('0x1a')][_0xfa50('0x11e')](db['Trunk'],{'as':_0xfa50('0x147'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0xfa50('0x11e')](db['Trunk'],{'as':_0xfa50('0x148'),'foreignKey':_0xfa50('0x149')});db[_0xfa50('0x1a')][_0xfa50('0x11e')](db[_0xfa50('0x85')],{'as':'Interval','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x1a')][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x1a')][_0xfa50('0x120')](db['CmList'],{'as':'Lists','through':_0xfa50('0x14d')});db['VoiceQueue'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x2e')});db[_0xfa50('0x1a')][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'as':_0xfa50('0x14f'),'through':'TeamVoiceQueue'});db[_0xfa50('0x1a')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x150'),'through':_0xfa50('0x151')});db[_0xfa50('0x1c')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x10f'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x152')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x10f'),'foreignKey':'UserId'});db[_0xfa50('0x1f')][_0xfa50('0x114')](db[_0xfa50('0x153')],{'as':_0xfa50('0x154'),'onDelete':'cascade','foreignKey':_0xfa50('0x155'),'sourceKey':_0xfa50('0x156')});db[_0xfa50('0x153')]['belongsTo'](db[_0xfa50('0x1f')],{'foreignKey':_0xfa50('0x155'),'targetKey':'mailbox'});db[_0xfa50('0x22')][_0xfa50('0x114')](db['VoiceQueueReport'],{'as':_0xfa50('0x157'),'foreignKey':_0xfa50('0x158'),'constraints':![]});db[_0xfa50('0x22')][_0xfa50('0x114')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0xfa50('0x158'),'constraints':![]});db[_0xfa50('0x22')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User','foreignKey':'UserId'});db['VoiceCallReport'][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db[_0xfa50('0x15a')][_0xfa50('0x11e')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x15a')]['belongsTo'](db[_0xfa50('0x106')],{'as':'CloudProvider','foreignKey':_0xfa50('0x15c'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x3b')][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'as':_0xfa50('0x15e'),'foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x3b')][_0xfa50('0x11e')](db[_0xfa50('0x106')],{'as':_0xfa50('0x106'),'foreignKey':_0xfa50('0x15c'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x15e')][_0xfa50('0x112')](db[_0xfa50('0x15a')],{'as':_0xfa50('0x15f'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x15e')][_0xfa50('0x112')](db[_0xfa50('0x3b')],{'as':_0xfa50('0x160'),'onDelete':_0xfa50('0x110')});db['MailAccount']['hasMany'](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x15b'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x15e')]['hasMany'](db[_0xfa50('0x7f')],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x15e')]['hasMany'](db[_0xfa50('0x163')],{'as':_0xfa50('0x154'),'foreignKey':_0xfa50('0x15b')});db[_0xfa50('0x15e')]['hasMany'](db[_0xfa50('0x41')],{'as':_0xfa50('0x164')});db[_0xfa50('0x15e')][_0xfa50('0x114')](db[_0xfa50('0x44')],{'as':_0xfa50('0x165')});db['MailAccount']['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x15e')][_0xfa50('0x11e')](db[_0xfa50('0x92')],{'as':_0xfa50('0x92'),'foreignKey':_0xfa50('0x168')});db[_0xfa50('0x15e')]['belongsTo'](db[_0xfa50('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x15e')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x136')});db['MailQueue'][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x14e'),'through':'UserMailQueue'});db['MailQueue'][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x169'),'as':_0xfa50('0x14f')});db[_0xfa50('0x41')][_0xfa50('0x114')](db['MailMessage'],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x15b')});db['MailInteraction'][_0xfa50('0x11e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xfa50('0x41')][_0xfa50('0x11e')](db['User'],{'as':_0xfa50('0x16b'),'foreignKey':'UserId'});db[_0xfa50('0x41')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x16d'),'as':_0xfa50('0x16e')});db[_0xfa50('0x41')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x16d'),'as':_0xfa50('0x16f')});db[_0xfa50('0x41')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':_0xfa50('0x126'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db[_0xfa50('0xe7')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':'cascade','as':_0xfa50('0x159')});db[_0xfa50('0x163')]['belongsTo'](db[_0xfa50('0x41')],{'as':_0xfa50('0x171'),'foreignKey':'MailInteractionId'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db['MailAccount'],{'as':_0xfa50('0x16a'),'foreignKey':'MailAccountId'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':_0xfa50('0x63'),'foreignKey':'ChatWebsiteId'});db[_0xfa50('0x163')][_0xfa50('0x11e')](db[_0xfa50('0x6a')],{'as':_0xfa50('0x6a'),'foreignKey':_0xfa50('0x172')});db['MailApplication'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':'restrict'});db[_0xfa50('0x44')][_0xfa50('0x11e')](db['MailQueue'],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x44')]['belongsTo'](db[_0xfa50('0x15e')],{'onDelete':_0xfa50('0x15d')});db['MailApplication'][_0xfa50('0x11e')](db['Interval'],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x44')]['belongsTo'](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x173')});db[_0xfa50('0x45')][_0xfa50('0x11e')](db['MailAccount'],{});db['MailQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':'List','foreignKey':_0xfa50('0x167')});db[_0xfa50('0x45')][_0xfa50('0x11e')](db['CmContact'],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x45')][_0xfa50('0x11e')](db[_0xfa50('0x41')],{});db['MailQueueReport']['belongsTo'](db[_0xfa50('0x163')],{});db[_0xfa50('0x45')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x45')]['belongsTo'](db[_0xfa50('0x3d')],{});db[_0xfa50('0x47')][_0xfa50('0x114')](db[_0xfa50('0x49')],{'as':_0xfa50('0x175'),'onDelete':_0xfa50('0x110')});db['FaxAccount']['hasMany'](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':'FaxAccountId','onDelete':_0xfa50('0x110')});db['FaxAccount']['hasMany'](db[_0xfa50('0x7f')],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x176')});db[_0xfa50('0x4b')][_0xfa50('0x114')](db[_0xfa50('0x4f')],{'as':'Interactions'});db[_0xfa50('0x4b')][_0xfa50('0x114')](db[_0xfa50('0x4d')],{'as':_0xfa50('0x165')});db[_0xfa50('0x4b')][_0xfa50('0x114')](db['VoiceExtension'],{'as':_0xfa50('0x177'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x4b')][_0xfa50('0x114')](db['FaxMessage'],{'as':_0xfa50('0x154')});db[_0xfa50('0x4b')][_0xfa50('0x11e')](db[_0xfa50('0x147')],{'as':_0xfa50('0x147')});db[_0xfa50('0x4b')][_0xfa50('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xfa50('0x167')});db[_0xfa50('0x4b')]['belongsTo'](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x4b')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xfa50('0x4d')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x4d')]['belongsTo'](db[_0xfa50('0x53')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x4d')]['belongsTo'](db[_0xfa50('0x4b')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x4d')][_0xfa50('0x11e')](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':'TagId'});db['FaxInteraction'][_0xfa50('0x114')](db[_0xfa50('0x51')],{'as':'Messages','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x178')});db[_0xfa50('0x4f')][_0xfa50('0x11e')](db[_0xfa50('0x4b')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x176')});db[_0xfa50('0x4f')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xfa50('0x174')});db[_0xfa50('0x4f')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x16b'),'foreignKey':'UserId'});db[_0xfa50('0x4f')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x179'),'as':'Tags'});db[_0xfa50('0x4f')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db[_0xfa50('0x4f')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':'user_has_fax_interactions','foreignKey':_0xfa50('0x178')});db[_0xfa50('0x51')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x10f')});db[_0xfa50('0x51')][_0xfa50('0x11e')](db[_0xfa50('0x4f')],{'as':_0xfa50('0x171'),'foreignKey':_0xfa50('0x178')});db['FaxMessage'][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db['FaxMessage']['belongsTo'](db['Attachment'],{'as':_0xfa50('0xe7'),'foreignKey':_0xfa50('0x17a')});db[_0xfa50('0x51')]['belongsTo'](db['FaxAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x176')});db[_0xfa50('0x53')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x34')});db[_0xfa50('0x53')][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x17b'),'as':_0xfa50('0x14f')});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0x4b')],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':'ListId'});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db['FaxQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x4f')],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db['FaxMessage'],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x55')][_0xfa50('0x11e')](db['FaxQueue'],{});db[_0xfa50('0x138')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x17c'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x138')][_0xfa50('0x114')](db['CannedAnswer'],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x17c')});db[_0xfa50('0x138')][_0xfa50('0x114')](db[_0xfa50('0x5b')],{'as':'Messages','foreignKey':_0xfa50('0x17c')});db['SmsAccount'][_0xfa50('0x114')](db[_0xfa50('0x59')],{'as':_0xfa50('0x164')});db[_0xfa50('0x138')][_0xfa50('0x114')](db['SmsApplication'],{'as':_0xfa50('0x165')});db[_0xfa50('0x138')][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x138')][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa50('0x14c')});db['SmsAccount'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Agents','through':_0xfa50('0x139')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x5d')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x138')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x17d')]['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x17d')][_0xfa50('0x11e')](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x173')});db[_0xfa50('0x59')][_0xfa50('0x114')](db[_0xfa50('0x5b')],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x17e')});db[_0xfa50('0x59')][_0xfa50('0x11e')](db[_0xfa50('0x138')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x17c')});db[_0xfa50('0x59')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x59')][_0xfa50('0x11e')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xfa50('0x59')][_0xfa50('0x120')](db['Tag'],{'through':_0xfa50('0x17f'),'as':_0xfa50('0x16e')});db[_0xfa50('0x59')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x17f'),'as':_0xfa50('0x16f')});db[_0xfa50('0x59')][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x170'),'through':_0xfa50('0x129'),'foreignKey':_0xfa50('0x17e')});db[_0xfa50('0x5b')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User'});db[_0xfa50('0x5b')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db[_0xfa50('0x5b')]['belongsTo'](db[_0xfa50('0x59')],{'onDelete':_0xfa50('0x110'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xfa50('0x5b')]['belongsTo'](db[_0xfa50('0x138')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x17c')});db['SmsQueue'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Agents','through':_0xfa50('0x130'),'foreignKey':_0xfa50('0x180')});db[_0xfa50('0x5d')]['belongsToMany'](db[_0xfa50('0xe1')],{'through':'team_has_sms_queues','as':_0xfa50('0x14f')});db['OpenchannelAccount'][_0xfa50('0x114')](db['Disposition'],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x181'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xfa50('0x114')](db[_0xfa50('0x7f')],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x181')});db['OpenchannelAccount'][_0xfa50('0x114')](db[_0xfa50('0x5f')],{'as':_0xfa50('0x164'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xfa50('0x114')](db[_0xfa50('0x182')],{'as':_0xfa50('0x154'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x5e')][_0xfa50('0x114')](db[_0xfa50('0x183')],{'as':_0xfa50('0x165'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x5e')][_0xfa50('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xfa50('0x167')});db[_0xfa50('0x5e')][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x5e')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x137')});db['OpenchannelApplication'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x183')][_0xfa50('0x11e')](db[_0xfa50('0x61')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x184')});db['OpenchannelApplication']['belongsTo'](db[_0xfa50('0x5e')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x183')][_0xfa50('0x11e')](db[_0xfa50('0x85')],{'onDelete':_0xfa50('0x15d'),'foreignKey':'IntervalId'});db['OpenchannelApplication']['belongsTo'](db[_0xfa50('0x16c')],{'onDelete':'restrict','foreignKey':_0xfa50('0x173')});db[_0xfa50('0x5f')][_0xfa50('0x114')](db[_0xfa50('0x182')],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x185')});db[_0xfa50('0x5f')][_0xfa50('0x11e')](db['OpenchannelAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x5f')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x5f')][_0xfa50('0x11e')](db['User'],{'as':_0xfa50('0x16b'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x186'),'as':_0xfa50('0x16e')});db[_0xfa50('0x5f')][_0xfa50('0x120')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xfa50('0x16f')});db['OpenchannelInteraction'][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':_0xfa50('0x12b'),'foreignKey':_0xfa50('0x185')});db[_0xfa50('0x182')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x10f')});db['OpenchannelMessage'][_0xfa50('0x11e')](db['CmContact'],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db['OpenchannelMessage'][_0xfa50('0x11e')](db['OpenchannelInteraction'],{'onDelete':_0xfa50('0x110'),'as':'Interaction','foreignKey':_0xfa50('0x185')});db[_0xfa50('0x182')][_0xfa50('0x11e')](db[_0xfa50('0xe7')],{'as':_0xfa50('0xe7'),'foreignKey':_0xfa50('0x17a')});db[_0xfa50('0x182')][_0xfa50('0x11e')](db['OpenchannelAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x181')});db[_0xfa50('0x61')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':'Agents','through':_0xfa50('0x36'),'foreignKey':_0xfa50('0x184')});db[_0xfa50('0x61')][_0xfa50('0x120')](db['Team'],{'through':_0xfa50('0x187'),'as':'Teams'});db[_0xfa50('0x63')]['hasMany'](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x188'),'onDelete':'cascade'});db[_0xfa50('0x63')][_0xfa50('0x114')](db['CannedAnswer'],{'as':_0xfa50('0x162'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite']['hasMany'](db[_0xfa50('0x6f')],{'as':_0xfa50('0x189')});db[_0xfa50('0x63')]['hasMany'](db[_0xfa50('0x67')],{'as':_0xfa50('0x164')});db[_0xfa50('0x63')][_0xfa50('0x114')](db[_0xfa50('0x66')],{'as':_0xfa50('0x165')});db[_0xfa50('0x63')][_0xfa50('0x114')](db['ChatMessage'],{'as':'Messages'});db[_0xfa50('0x63')][_0xfa50('0x11e')](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x63')][_0xfa50('0x11e')](db['Interval'],{'as':_0xfa50('0x85'),'foreignKey':'IntervalId'});db[_0xfa50('0x63')][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'as':'MailAccount','foreignKey':_0xfa50('0x15b')});db['ChatWebsite'][_0xfa50('0x11e')](db[_0xfa50('0x87')],{'as':_0xfa50('0x14b'),'foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x63')][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x18a')});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x5e')],{});db[_0xfa50('0x18b')]['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xfa50('0x11e')](db['CmContact'],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x5f')],{});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db['OpenchannelMessage'],{});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x18b')][_0xfa50('0x11e')](db[_0xfa50('0x61')],{});db['ChatApplication'][_0xfa50('0x11e')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0xfa50('0x66')][_0xfa50('0x11e')](db[_0xfa50('0x6c')],{'as':_0xfa50('0x18c'),'foreignKey':_0xfa50('0x18d'),'onDelete':_0xfa50('0x15d')});db['ChatApplication'][_0xfa50('0x11e')](db['ChatWebsite'],{'as':_0xfa50('0x18e'),'foreignKey':_0xfa50('0x188'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x66')]['belongsTo'](db[_0xfa50('0x16c')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xfa50('0x67')][_0xfa50('0x114')](db[_0xfa50('0x68')],{'as':_0xfa50('0x154'),'onDelete':'cascade','foreignKey':_0xfa50('0x18f')});db['ChatInteraction'][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x188')});db[_0xfa50('0x67')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db['ChatInteraction']['belongsTo'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x16b'),'foreignKey':_0xfa50('0x111')});db[_0xfa50('0x67')][_0xfa50('0x120')](db['Tag'],{'through':_0xfa50('0x190'),'as':_0xfa50('0x16e')});db[_0xfa50('0x67')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x190'),'as':_0xfa50('0x16f')});db[_0xfa50('0x67')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'through':_0xfa50('0x127'),'foreignKey':_0xfa50('0x18f')});db[_0xfa50('0x68')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x10f')});db[_0xfa50('0x68')][_0xfa50('0x11e')](db['CmContact'],{'onDelete':_0xfa50('0x110'),'as':'Contact','foreignKey':_0xfa50('0x174')});db['ChatMessage'][_0xfa50('0x11e')](db[_0xfa50('0x67')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x171'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db[_0xfa50('0xe7')],{'as':_0xfa50('0xe7'),'foreignKey':_0xfa50('0x17a')});db[_0xfa50('0x68')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':'Account','foreignKey':_0xfa50('0x188')});db[_0xfa50('0x6a')][_0xfa50('0x114')](db[_0xfa50('0xe7')],{'as':_0xfa50('0x191'),'foreignKey':_0xfa50('0x172'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x6a')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':'Contact','foreignKey':'ContactId'});db[_0xfa50('0x6a')]['belongsTo'](db[_0xfa50('0x63')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x188')});db[_0xfa50('0x6c')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':'UserChatQueue','hooks':!![]});db[_0xfa50('0x6c')][_0xfa50('0x120')](db['Team'],{'through':_0xfa50('0x192'),'as':_0xfa50('0x14f')});db[_0xfa50('0x6e')][_0xfa50('0x114')](db['ChatInternalMessage'],{'as':_0xfa50('0x154'),'foreignKey':'ChatGroupId','onDelete':'cascade'});db[_0xfa50('0x6e')][_0xfa50('0x120')](db[_0xfa50('0x10f')],{'as':'Members','through':_0xfa50('0x121')});db[_0xfa50('0x6f')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'as':_0xfa50('0x18e'),'foreignKey':_0xfa50('0x188')});db[_0xfa50('0x71')]['hasMany'](db[_0xfa50('0x73')],{'as':'Contacts','foreignKey':_0xfa50('0x193')});db[_0xfa50('0x73')][_0xfa50('0x114')](db['CmContactHasItem'],{'as':_0xfa50('0x194'),'foreignKey':_0xfa50('0x195')});db['CmContact']['hasMany'](db[_0xfa50('0x74')],{'as':_0xfa50('0x143'),'foreignKey':'ContactId'});db[_0xfa50('0x73')][_0xfa50('0x114')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ContactId'});db[_0xfa50('0x73')][_0xfa50('0x114')](db['CmHopperHistory'],{'as':_0xfa50('0x144'),'foreignKey':'ContactId'});db[_0xfa50('0x73')]['hasMany'](db[_0xfa50('0x7b')],{'as':_0xfa50('0x7b'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x73')]['hasMany'](db[_0xfa50('0xd4')],{'as':_0xfa50('0x146'),'foreignKey':_0xfa50('0x174')});db['CmContact']['hasMany'](db[_0xfa50('0x5f')],{'as':_0xfa50('0x12a'),'foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x73')][_0xfa50('0x114')](db[_0xfa50('0x67')],{'as':_0xfa50('0x118'),'foreignKey':_0xfa50('0x174'),'onDelete':'restrict'});db[_0xfa50('0x73')]['hasMany'](db['SmsInteraction'],{'as':_0xfa50('0x128'),'foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x15d')});db['CmContact'][_0xfa50('0x114')](db['FaxInteraction'],{'as':_0xfa50('0x119'),'foreignKey':'ContactId','onDelete':_0xfa50('0x15d')});db[_0xfa50('0x73')][_0xfa50('0x114')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xfa50('0x174'),'onDelete':'restrict'});db[_0xfa50('0x73')][_0xfa50('0x11e')](db['CmCompany'],{'as':_0xfa50('0x196'),'foreignKey':'CompanyId'});db[_0xfa50('0x73')]['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167'),'onDelete':'cascade'});db[_0xfa50('0x73')][_0xfa50('0x120')](db['User'],{'as':_0xfa50('0x170'),'through':'cm_user_has_contacts'});db[_0xfa50('0x73')]['belongsToMany'](db[_0xfa50('0x16c')],{'as':_0xfa50('0x16e'),'through':'cm_contact_has_tags'});db[_0xfa50('0x73')]['belongsToMany'](db[_0xfa50('0x16c')],{'through':_0xfa50('0x197'),'as':_0xfa50('0x16f')});db[_0xfa50('0x74')][_0xfa50('0x114')](db[_0xfa50('0x90')],{'as':'AdditionalPhones','foreignKey':_0xfa50('0x198')});db[_0xfa50('0x74')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':'Contact','foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x74')]['belongsTo'](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x74')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x199'),'foreignKey':'UserId'});db[_0xfa50('0x74')]['belongsTo'](db[_0xfa50('0x1a')],{'as':_0xfa50('0x18c'),'foreignKey':_0xfa50('0x142'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x74')][_0xfa50('0x11e')](db['Campaign'],{'as':_0xfa50('0xe4'),'foreignKey':_0xfa50('0x19a'),'onDelete':_0xfa50('0x110')});db['CmHopper']['belongsTo'](db[_0xfa50('0x10f')],{'as':'Owner','foreignKey':_0xfa50('0x19b')});db[_0xfa50('0x76')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x76')][_0xfa50('0x11e')](db['CmList'],{'as':'List','foreignKey':_0xfa50('0x167'),'onDelete':'cascade'});db[_0xfa50('0x76')][_0xfa50('0x11e')](db[_0xfa50('0x1a')],{'as':_0xfa50('0x18c'),'foreignKey':_0xfa50('0x142'),'onDelete':_0xfa50('0x110')});db['CmHopperBlack'][_0xfa50('0x11e')](db['Campaign'],{'as':_0xfa50('0xe4'),'foreignKey':_0xfa50('0x19a'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x19c')][_0xfa50('0x114')](db[_0xfa50('0x83')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xfa50('0x19d'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x19c')][_0xfa50('0x114')](db['Condition'],{'as':{'plural':'Any','singular':_0xfa50('0x19e')},'foreignKey':_0xfa50('0x19f'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0xfa50('0x114')](db[_0xfa50('0x7d')],{'as':'Actions','foreignKey':_0xfa50('0x1a0'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x81')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':'Dispositions','foreignKey':_0xfa50('0x1a1'),'onDelete':_0xfa50('0x110')});db['Interval'][_0xfa50('0x114')](db[_0xfa50('0x85')],{'as':_0xfa50('0x1a2'),'foreignKey':_0xfa50('0x14a'),'onDelete':_0xfa50('0x110'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xfa50('0x16')],{'as':_0xfa50('0x116'),'foreignKey':'IntervalId','onDelete':'restrict'});db['Interval'][_0xfa50('0x114')](db['MailApplication'],{'as':_0xfa50('0x1a3'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x85')][_0xfa50('0x114')](db[_0xfa50('0x66')],{'as':'ChatApplications','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x85')][_0xfa50('0x114')](db[_0xfa50('0x4d')],{'as':_0xfa50('0x1a4'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x85')][_0xfa50('0x114')](db['SmsApplication'],{'as':_0xfa50('0x1a5'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x1a6')][_0xfa50('0x11e')](db['MailAccount'],{});db[_0xfa50('0x1a6')]['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xfa50('0x1a6')][_0xfa50('0x11e')](db['AnalyticCustomReport'],{'foreignKey':_0xfa50('0x1a7')});db[_0xfa50('0x89')][_0xfa50('0x120')](db[_0xfa50('0x18')],{'as':_0xfa50('0x1a8'),'through':_0xfa50('0x13f'),'onDelete':'restrict'});db[_0xfa50('0x16c')][_0xfa50('0x120')](db['CmContact'],{'through':'cm_contact_has_tags'});db['Tag'][_0xfa50('0x120')](db['ChatInteraction'],{'through':_0xfa50('0x190')});db[_0xfa50('0x16c')][_0xfa50('0x120')](db[_0xfa50('0x41')],{'through':_0xfa50('0x16d')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':_0xfa50('0x17f')});db[_0xfa50('0x16c')][_0xfa50('0x120')](db[_0xfa50('0x4f')],{'through':_0xfa50('0x179')});db['Tag']['belongsToMany'](db['OpenchannelInteraction'],{'through':_0xfa50('0x186')});db['Tag']['belongsToMany'](db[_0xfa50('0xff')],{'through':_0xfa50('0x1a9')});db['CmContactHasItem'][_0xfa50('0x11e')](db[_0xfa50('0x8c')],{'as':_0xfa50('0x1aa'),'foreignKey':_0xfa50('0x1ab')});db[_0xfa50('0x90')]['belongsTo'](db['CmHopper'],{'as':_0xfa50('0x1ac'),'foreignKey':_0xfa50('0x198')});db[_0xfa50('0x8e')][_0xfa50('0x11e')](db['CmContact'],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x195')});db[_0xfa50('0x93')][_0xfa50('0x114')](db['Condition'],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xfa50('0x1ad'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x93')][_0xfa50('0x114')](db[_0xfa50('0x83')],{'as':{'plural':_0xfa50('0x1ae'),'singular':_0xfa50('0x1af')},'foreignKey':_0xfa50('0x1b0'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x93')][_0xfa50('0x114')](db[_0xfa50('0x7d')],{'as':_0xfa50('0x1b1'),'foreignKey':_0xfa50('0x1b2'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x9a')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1a7'),'hooks':!![]});db[_0xfa50('0x1b4')][_0xfa50('0x114')](db['AnalyticFieldReport'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1b5')});db[_0xfa50('0x1b6')][_0xfa50('0x114')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1b7')});db[_0xfa50('0x9f')][_0xfa50('0x11e')](db['AnalyticMetric'],{'foreignKey':_0xfa50('0x1b7')});db[_0xfa50('0xa2')][_0xfa50('0x114')](db[_0xfa50('0x1b8')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':'AccountId'});db[_0xfa50('0x1b8')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':'SubjectId'});db[_0xfa50('0x1b8')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bc'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa50('0x1b8')][_0xfa50('0x114')](db['SalesforceField'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':'FieldId'});db[_0xfa50('0x1b8')]['belongsTo'](db[_0xfa50('0xa2')],{'as':'Account','foreignKey':'AccountId'});db[_0xfa50('0x1ba')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0x1ba')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0x1ba')][_0xfa50('0x114')](db[_0xfa50('0x1ba')],{'as':'Field','foreignKey':_0xfa50('0x1c1')});db['SalesforceField'][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':'VariableId'});db[_0xfa50('0x1c2')][_0xfa50('0x114')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1c4')][_0xfa50('0x114')](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bb'),'onDelete':'cascade','foreignKey':_0xfa50('0x1be')});db[_0xfa50('0x1c4')][_0xfa50('0x114')](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bc'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0x1c4')][_0xfa50('0x114')](db['SugarcrmField'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0x1c4')][_0xfa50('0x11e')](db[_0xfa50('0x1c2')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1c5')]['hasMany'](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bd'),'foreignKey':'SubjectId'});db[_0xfa50('0x1c5')]['hasMany'](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1bf'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0xfa50('0x114')](db[_0xfa50('0x1c5')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0x1c5')][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':'Variable','foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0x1c8')][_0xfa50('0x114')](db[_0xfa50('0xaa')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xaa')]['hasMany'](db[_0xfa50('0xac')],{'as':_0xfa50('0x1bb'),'onDelete':'cascade','foreignKey':_0xfa50('0x1be')});db['DeskConfiguration'][_0xfa50('0x114')](db['DeskField'],{'as':_0xfa50('0x1bc'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xaa')][_0xfa50('0x114')](db['DeskField'],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xaa')][_0xfa50('0x11e')](db[_0xfa50('0x1c8')],{'as':_0xfa50('0x16a'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1c9')});db['DeskField']['hasMany'](db['DeskField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db['DeskField'][_0xfa50('0x114')](db[_0xfa50('0xac')],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xac')]['hasMany'](db[_0xfa50('0xac')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xac')][_0xfa50('0x11e')](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db['ZohoAccount'][_0xfa50('0x114')](db[_0xfa50('0xb0')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db['ZohoConfiguration'][_0xfa50('0x114')](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xb0')][_0xfa50('0x114')](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1bc'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xb0')][_0xfa50('0x114')](db['ZohoField'],{'as':_0xfa50('0x1b3'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xb0')][_0xfa50('0x11e')](db[_0xfa50('0xae')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db['ZohoField'][_0xfa50('0x114')](db['ZohoField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xb2')][_0xfa50('0x114')](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1bf'),'foreignKey':'DescriptionId'});db[_0xfa50('0xb2')]['hasMany'](db[_0xfa50('0xb2')],{'as':_0xfa50('0x1c6'),'foreignKey':'FieldId'});db['ZohoField'][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':'VariableId'});db[_0xfa50('0xb4')][_0xfa50('0x114')](db[_0xfa50('0x1ca')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1ca')][_0xfa50('0x114')](db[_0xfa50('0xb6')],{'as':_0xfa50('0x1bb'),'foreignKey':_0xfa50('0x1be')});db['ZendeskConfiguration'][_0xfa50('0x114')](db['ZendeskField'],{'as':_0xfa50('0x1bc'),'foreignKey':_0xfa50('0x1c0')});db['ZendeskConfiguration']['hasMany'](db[_0xfa50('0xb6')],{'as':_0xfa50('0x1b3'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0x1ca')][_0xfa50('0x11e')](db[_0xfa50('0xb4')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1ca')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':'int_zendesk_configuration_has_tags'});db[_0xfa50('0xb6')][_0xfa50('0x114')](db['ZendeskField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xb6')]['hasMany'](db['ZendeskField'],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xb6')][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0xb7')][_0xfa50('0x114')](db[_0xfa50('0x1cb')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1cb')][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1be')});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db['FreshdeskConfiguration'][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db['FreshdeskConfiguration'][_0xfa50('0x11e')](db[_0xfa50('0xb7')],{'as':'Account','foreignKey':'AccountId'});db[_0xfa50('0x1cb')][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1cc')});db[_0xfa50('0xb8')][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xb8')][_0xfa50('0x114')](db[_0xfa50('0xb8')],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xb8')]['hasMany'](db[_0xfa50('0xb8')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db['FreshdeskField'][_0xfa50('0x11e')](db['Variable'],{'as':'Variable','foreignKey':_0xfa50('0x1c7')});db['VtigerAccount']['hasMany'](db[_0xfa50('0xbc')],{'as':_0xfa50('0x1b9'),'onDelete':_0xfa50('0x110'),'foreignKey':'AccountId'});db['VtigerConfiguration'][_0xfa50('0x114')](db[_0xfa50('0x1cd')],{'as':_0xfa50('0x1bb'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xbc')][_0xfa50('0x114')](db[_0xfa50('0x1cd')],{'as':_0xfa50('0x1bc'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xbc')][_0xfa50('0x114')](db['VtigerField'],{'as':_0xfa50('0x1b3'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0xfa50('0x11e')](db[_0xfa50('0xba')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0x1cd')][_0xfa50('0x114')](db['VtigerField'],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0x1cd')][_0xfa50('0x114')](db['VtigerField'],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db['VtigerField'][_0xfa50('0x114')](db[_0xfa50('0x1cd')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db['VtigerField']['belongsTo'](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0xbf')]['hasMany'](db[_0xfa50('0xc1')],{'as':_0xfa50('0x1b9'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xc1')][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1bb'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xc1')]['hasMany'](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1bc'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xc1')][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1b3'),'foreignKey':'FieldId'});db[_0xfa50('0xc1')][_0xfa50('0x11e')](db[_0xfa50('0xbf')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xc3')][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':'Subject','foreignKey':_0xfa50('0x1be')});db['ServicenowField'][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db['ServicenowField'][_0xfa50('0x114')](db[_0xfa50('0xc3')],{'as':'Field','foreignKey':_0xfa50('0x1c1')});db['ServicenowField'][_0xfa50('0x11e')](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0x1ce')]['hasMany'](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0xfa50('0x110'),'foreignKey':'AccountId'});db[_0xfa50('0x1ce')][_0xfa50('0x11e')](db[_0xfa50('0x106')],{'as':_0xfa50('0x106'),'foreignKey':_0xfa50('0x15c')});db[_0xfa50('0xc6')][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1bb'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xc6')][_0xfa50('0x114')](db['Dynamics365Field'],{'as':_0xfa50('0x1bc'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xc6')][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1b3'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xc6')][_0xfa50('0x11e')](db[_0xfa50('0x1ce')],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xc7')][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1bd'),'foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xc7')]['hasMany'](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1bf'),'foreignKey':_0xfa50('0x1c0')});db['Dynamics365Field'][_0xfa50('0x114')](db[_0xfa50('0xc7')],{'as':_0xfa50('0x1c6'),'foreignKey':_0xfa50('0x1c1')});db[_0xfa50('0xc7')][_0xfa50('0x11e')](db['Variable'],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0xc9')]['hasMany'](db[_0xfa50('0xca')],{'as':_0xfa50('0x1b9'),'onDelete':'cascade','foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xca')][_0xfa50('0x114')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0xfa50('0x1be')});db[_0xfa50('0xca')][_0xfa50('0x114')](db[_0xfa50('0xcc')],{'as':'Descriptions','foreignKey':_0xfa50('0x1c0')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0xfa50('0x1b3'),'foreignKey':_0xfa50('0x1c1')});db['FreshsalesConfiguration'][_0xfa50('0x11e')](db[_0xfa50('0xc9')],{'as':'Account','foreignKey':_0xfa50('0x1c3')});db[_0xfa50('0xcc')][_0xfa50('0x114')](db[_0xfa50('0xcc')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa50('0xcc')][_0xfa50('0x114')](db['FreshsalesField'],{'as':'Description','foreignKey':_0xfa50('0x1c0')});db[_0xfa50('0xcc')]['hasMany'](db[_0xfa50('0xcc')],{'as':'Field','foreignKey':_0xfa50('0x1c1')});db['FreshsalesField'][_0xfa50('0x11e')](db[_0xfa50('0x95')],{'as':_0xfa50('0x95'),'foreignKey':_0xfa50('0x1c7')});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{});db[_0xfa50('0x1cf')]['belongsTo'](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x67')],{});db['ChatQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x68')],{});db[_0xfa50('0x1cf')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x1cf')]['belongsTo'](db[_0xfa50('0x6c')],{});db['ChatInternalMessage'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':'cascade','foreignKey':_0xfa50('0x1d0')});db[_0xfa50('0xd1')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1d1')});db['JscriptySessionReport']['hasMany'](db[_0xfa50('0xd3')],{'foreignKey':_0xfa50('0x1d2'),'onDelete':_0xfa50('0x110')});db['JscriptySessionReport'][_0xfa50('0x114')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x138')],{});db['SmsQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db['SmsQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x59')],{});db['SmsQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x5b')],{});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x1d3')][_0xfa50('0x11e')](db[_0xfa50('0x5d')],{});db[_0xfa50('0x1d4')][_0xfa50('0x114')](db['JscriptySessionReport'],{'foreignKey':_0xfa50('0x1d5')});db[_0xfa50('0x1d4')][_0xfa50('0x114')](db['JscriptyQuestionReport'],{'foreignKey':_0xfa50('0x1d5')});db[_0xfa50('0x1d4')]['hasMany'](db[_0xfa50('0xd2')],{'foreignKey':_0xfa50('0x1d5')});db[_0xfa50('0xe1')]['belongsToMany'](db['User'],{'as':_0xfa50('0x14e'),'through':'user_has_teams'});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x1a')],{'through':_0xfa50('0x107'),'as':_0xfa50('0x12c')});db['Team'][_0xfa50('0x120')](db['MailQueue'],{'through':_0xfa50('0x169'),'as':'MailQueues'});db[_0xfa50('0xe1')][_0xfa50('0x120')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0xfa50('0x1d6')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x53')],{'through':_0xfa50('0x17b'),'as':_0xfa50('0x12e')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x5d')],{'through':_0xfa50('0x1d7'),'as':_0xfa50('0x12f')});db['Team'][_0xfa50('0x120')](db[_0xfa50('0x61')],{'through':'team_has_openchannel_queues','as':_0xfa50('0x131')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db[_0xfa50('0x132')],{'through':_0xfa50('0x1d8'),'as':_0xfa50('0x133')});db[_0xfa50('0xe1')][_0xfa50('0x120')](db['VoicePrefix'],{'through':_0xfa50('0x109'),'as':_0xfa50('0x1d9')});db[_0xfa50('0xe4')][_0xfa50('0x114')](db[_0xfa50('0x74')],{'as':'Hoppers','foreignKey':_0xfa50('0x19a')});db[_0xfa50('0xe4')][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':'HopperFinals','foreignKey':_0xfa50('0x19a')});db['Campaign']['hasMany'](db[_0xfa50('0x79')],{'as':_0xfa50('0x144'),'foreignKey':_0xfa50('0x19a')});db[_0xfa50('0xe4')]['hasMany'](db[_0xfa50('0x76')],{'as':'HopperBlacks','foreignKey':_0xfa50('0x19a')});db[_0xfa50('0xe4')][_0xfa50('0x11e')](db[_0xfa50('0x147')],{'as':_0xfa50('0x147'),'foreignKey':'TrunkId'});db[_0xfa50('0xe4')][_0xfa50('0x11e')](db[_0xfa50('0x147')],{'as':_0xfa50('0x148'),'foreignKey':_0xfa50('0x149')});db['Campaign'][_0xfa50('0x11e')](db[_0xfa50('0x85')],{'as':_0xfa50('0x85'),'foreignKey':_0xfa50('0x14a')});db[_0xfa50('0xe4')][_0xfa50('0x11e')](db[_0xfa50('0x1da')],{'as':_0xfa50('0x1da'),'foreignKey':'SquareProjectId'});db[_0xfa50('0xe4')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':_0xfa50('0x123'),'through':'campaigns_has_cm_lists'});db[_0xfa50('0xe4')][_0xfa50('0x120')](db[_0xfa50('0xf4')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xfa50('0xe7')][_0xfa50('0x11e')](db[_0xfa50('0x6a')],{'as':_0xfa50('0x6a'),'foreignKey':_0xfa50('0x172')});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db[_0xfa50('0x163')],{});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db['MailInteraction'],{});db['MailTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x15e')],{'foreignKey':'FromMailAccountId','as':_0xfa50('0x1db')});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db['User'],{'foreignKey':'FromUserId','as':_0xfa50('0x1dc')});db['MailTransferReport'][_0xfa50('0x11e')](db['User'],{'foreignKey':_0xfa50('0x1dd'),'as':_0xfa50('0x1de')});db[_0xfa50('0xeb')][_0xfa50('0x11e')](db[_0xfa50('0x3d')],{'foreignKey':_0xfa50('0x1df'),'as':'ToQueue'});db['MailTransferReport'][_0xfa50('0x11e')](db['MailAccount'],{'foreignKey':_0xfa50('0x1e0'),'as':_0xfa50('0x1e1')});db[_0xfa50('0xed')]['belongsTo'](db[_0xfa50('0x68')],{});db[_0xfa50('0xed')]['belongsTo'](db[_0xfa50('0x67')],{});db['ChatTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'foreignKey':_0xfa50('0x1e2'),'as':_0xfa50('0x1db')});db[_0xfa50('0xed')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':'FromAgent'});db[_0xfa50('0xed')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':'ToUserId','as':_0xfa50('0x1de')});db[_0xfa50('0xed')][_0xfa50('0x11e')](db['ChatQueue'],{'foreignKey':_0xfa50('0x1e4'),'as':_0xfa50('0x1e5')});db[_0xfa50('0xed')][_0xfa50('0x11e')](db[_0xfa50('0x63')],{'foreignKey':_0xfa50('0x1e6'),'as':_0xfa50('0x1e1')});db['FaxTransferReport'][_0xfa50('0x11e')](db['FaxMessage'],{});db[_0xfa50('0xee')][_0xfa50('0x11e')](db[_0xfa50('0x4f')],{});db[_0xfa50('0xee')][_0xfa50('0x11e')](db[_0xfa50('0x4b')],{'foreignKey':'FromFaxAccountId','as':_0xfa50('0x1db')});db[_0xfa50('0xee')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':_0xfa50('0x1dc')});db[_0xfa50('0xee')][_0xfa50('0x11e')](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db['FaxTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x53')],{'foreignKey':_0xfa50('0x1e7'),'as':_0xfa50('0x1e5')});db[_0xfa50('0xee')]['belongsTo'](db[_0xfa50('0x4b')],{'foreignKey':_0xfa50('0x1e8'),'as':_0xfa50('0x1e1')});db[_0xfa50('0xf0')]['belongsTo'](db[_0xfa50('0x182')],{});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x5f')],{});db['OpenchannelTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x5e')],{'foreignKey':'FromOpenchannelAccountId','as':_0xfa50('0x1db')});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':'ToUserId','as':_0xfa50('0x1de')});db[_0xfa50('0xf0')]['belongsTo'](db[_0xfa50('0x61')],{'foreignKey':_0xfa50('0x1e9'),'as':_0xfa50('0x1e5')});db[_0xfa50('0xf0')][_0xfa50('0x11e')](db[_0xfa50('0x5e')],{'foreignKey':_0xfa50('0x1ea'),'as':_0xfa50('0x1e1')});db[_0xfa50('0xf2')][_0xfa50('0x11e')](db[_0xfa50('0x5b')],{});db['SmsTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x59')],{});db[_0xfa50('0xf2')][_0xfa50('0x11e')](db['SmsAccount'],{'foreignKey':_0xfa50('0x1eb'),'as':_0xfa50('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':_0xfa50('0x1dc')});db['SmsTransferReport'][_0xfa50('0x11e')](db['User'],{'foreignKey':_0xfa50('0x1dd'),'as':'ToAgent'});db[_0xfa50('0xf2')][_0xfa50('0x11e')](db[_0xfa50('0x5d')],{'foreignKey':'ToSmsQueueId','as':_0xfa50('0x1e5')});db[_0xfa50('0xf2')]['belongsTo'](db[_0xfa50('0x138')],{'foreignKey':_0xfa50('0x1ec'),'as':'ToAccount'});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x167'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0xf4')]['hasMany'](db[_0xfa50('0x7c')],{'as':'CustomFields','foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x73')],{'as':_0xfa50('0x122'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x78')],{'as':'HopperFinals','foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x114')](db[_0xfa50('0x79')],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList']['hasMany'](db[_0xfa50('0x7b')],{'as':_0xfa50('0x7b'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0xf4')][_0xfa50('0x120')](db['VoiceQueue'],{'as':'Queues','through':'voice_queues_has_cm_lists'});db[_0xfa50('0xf4')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':'cm_user_has_lists'});db[_0xfa50('0xf5')][_0xfa50('0x114')](db['VoiceExtension'],{'as':_0xfa50('0x116'),'onDelete':_0xfa50('0x110')});db['VoicePrefix']['belongsToMany'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x14e'),'through':_0xfa50('0x10b')});db['VoicePrefix'][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':'TeamVoicePrefix','as':_0xfa50('0x14f')});db[_0xfa50('0xf7')][_0xfa50('0x114')](db[_0xfa50('0x10f')],{'as':_0xfa50('0x170'),'foreignKey':'userProfileId'});db[_0xfa50('0xf7')]['hasMany'](db['UserProfileSection'],{'as':'UserProfileSections','foreignKey':_0xfa50('0x11f'),'onDelete':'cascade'});db[_0xfa50('0xf9')][_0xfa50('0x114')](db[_0xfa50('0xfb')],{'as':_0xfa50('0x1ed'),'foreignKey':'sectionId','onDelete':_0xfa50('0x110')});db[_0xfa50('0x1ee')][_0xfa50('0x114')](db[_0xfa50('0x81')],{'as':_0xfa50('0x161'),'foreignKey':_0xfa50('0x1ef'),'onDelete':_0xfa50('0x110')});db[_0xfa50('0x1ee')][_0xfa50('0x114')](db['CannedAnswer'],{'as':_0xfa50('0x162'),'foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0x1ee')]['hasMany'](db[_0xfa50('0x100')],{'as':_0xfa50('0x154'),'foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0x1ee')]['hasMany'](db['WhatsappInteraction'],{'as':_0xfa50('0x164')});db[_0xfa50('0x1ee')][_0xfa50('0x114')](db['WhatsappApplication'],{'as':_0xfa50('0x165')});db[_0xfa50('0x1ee')][_0xfa50('0x11e')](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db['WhatsappAccount']['belongsTo'](db[_0xfa50('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0xfa50('0x14c')});db[_0xfa50('0x1ee')]['belongsToMany'](db[_0xfa50('0x10f')],{'as':'Agents','through':'user_has_whatsapp_accounts'});db['WhatsappApplication'][_0xfa50('0x11e')](db['User'],{'onDelete':'restrict'});db['WhatsappApplication'][_0xfa50('0x11e')](db[_0xfa50('0x132')],{'onDelete':_0xfa50('0x15d')});db['WhatsappApplication'][_0xfa50('0x11e')](db['WhatsappAccount'],{'onDelete':_0xfa50('0x15d')});db['WhatsappApplication'][_0xfa50('0x11e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa50('0x14a')});db[_0xfa50('0x1f0')][_0xfa50('0x11e')](db[_0xfa50('0x16c')],{'onDelete':_0xfa50('0x15d'),'foreignKey':_0xfa50('0x173')});db[_0xfa50('0xff')][_0xfa50('0x114')](db[_0xfa50('0x100')],{'as':_0xfa50('0x154'),'onDelete':_0xfa50('0x110'),'foreignKey':_0xfa50('0x1f1')});db[_0xfa50('0xff')][_0xfa50('0x11e')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0xff')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':'ContactId'});db[_0xfa50('0xff')]['belongsTo'](db[_0xfa50('0x10f')],{'as':_0xfa50('0x16b'),'foreignKey':_0xfa50('0x111')});db['WhatsappInteraction'][_0xfa50('0x120')](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1a9'),'as':_0xfa50('0x16e')});db[_0xfa50('0xff')]['belongsToMany'](db[_0xfa50('0x16c')],{'through':_0xfa50('0x1a9'),'as':'ThroughTags'});db[_0xfa50('0xff')]['belongsToMany'](db['User'],{'as':_0xfa50('0x170'),'through':_0xfa50('0x1f2'),'foreignKey':_0xfa50('0x1f1')});db['WhatsappMessage'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'as':'User'});db[_0xfa50('0x100')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'onDelete':_0xfa50('0x110'),'as':_0xfa50('0x159')});db[_0xfa50('0x100')][_0xfa50('0x11e')](db[_0xfa50('0xff')],{'onDelete':_0xfa50('0x110'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage'][_0xfa50('0x11e')](db['WhatsappAccount'],{'as':_0xfa50('0x16a'),'foreignKey':_0xfa50('0x1ef')});db[_0xfa50('0x101')]['belongsTo'](db[_0xfa50('0x1ee')],{});db['WhatsappQueueReport']['belongsTo'](db['CmList'],{'as':_0xfa50('0x166'),'foreignKey':_0xfa50('0x167')});db[_0xfa50('0x101')][_0xfa50('0x11e')](db[_0xfa50('0x73')],{'as':_0xfa50('0x159'),'foreignKey':_0xfa50('0x174')});db[_0xfa50('0x101')]['belongsTo'](db[_0xfa50('0xff')],{});db[_0xfa50('0x101')][_0xfa50('0x11e')](db[_0xfa50('0x132')],{});db[_0xfa50('0x101')]['belongsTo'](db[_0xfa50('0x100')],{});db['WhatsappQueueReport'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{});db[_0xfa50('0x103')]['belongsTo'](db['WhatsappMessage'],{});db[_0xfa50('0x103')][_0xfa50('0x11e')](db['WhatsappInteraction'],{});db[_0xfa50('0x103')][_0xfa50('0x11e')](db[_0xfa50('0x1ee')],{'foreignKey':_0xfa50('0x1f3'),'as':_0xfa50('0x1db')});db[_0xfa50('0x103')][_0xfa50('0x11e')](db['WhatsappAccount'],{'foreignKey':_0xfa50('0x1f4'),'as':_0xfa50('0x1e1')});db[_0xfa50('0x103')]['belongsTo'](db[_0xfa50('0x132')],{'foreignKey':_0xfa50('0x1f5'),'as':_0xfa50('0x1e5')});db['WhatsappTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1e3'),'as':_0xfa50('0x1dc')});db['WhatsappTransferReport'][_0xfa50('0x11e')](db[_0xfa50('0x10f')],{'foreignKey':_0xfa50('0x1dd'),'as':_0xfa50('0x1de')});db[_0xfa50('0x132')][_0xfa50('0x120')](db['User'],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':_0xfa50('0x1f6')});db['WhatsappQueue'][_0xfa50('0x120')](db[_0xfa50('0xe1')],{'through':_0xfa50('0x1d8'),'as':_0xfa50('0x14f')});db[_0xfa50('0x10d')][_0xfa50('0x11e')](db['User'],{'as':_0xfa50('0x1f7'),'foreignKey':_0xfa50('0x111'),'onDelete':_0xfa50('0x110'),'hooks':!![]});db[_0xfa50('0x106')][_0xfa50('0x112')](db['Dynamics365Account'],{'as':'Dynamics365Account','onDelete':_0xfa50('0x15d')});db[_0xfa50('0x106')]['hasOne'](db[_0xfa50('0x15a')],{'as':_0xfa50('0x15f'),'onDelete':_0xfa50('0x15d')});db[_0xfa50('0x106')][_0xfa50('0x112')](db[_0xfa50('0x3b')],{'as':_0xfa50('0x160'),'onDelete':_0xfa50('0x15d')});module[_0xfa50('0x1f8')]={'db':db,'dbH':dbH};
\ No newline at end of file
index d054bcb..e9bb3ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd89c=['/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','./api/mailServerOut','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','/api/cm/hopper_final','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/cloudProviders','/api/realtime','./api/realtime','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/apidoc','static','join','root','/demo','/snippet','snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd89c,0x118));var _0xcd89=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd89c[_0x164eca];return _0x2ce562;};'use strict';var path=require(_0xcd89('0x0'));var express=require(_0xcd89('0x1'));var errors=require(_0xcd89('0x2'));var config=require(_0xcd89('0x3'));var setupLoggers=require(_0xcd89('0x4'))[_0xcd89('0x5')];var clientSideLogs=require(_0xcd89('0x6'));exports[_0xcd89('0x7')]=function(_0x6f63ed){return setupLoggers(_0x6f63ed)[_0xcd89('0x8')](function(){_0x6f63ed[_0xcd89('0x9')]('/api/users',require('./api/user'));_0x6f63ed['use'](_0xcd89('0xa'),require(_0xcd89('0xb')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc'),require(_0xcd89('0xd')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe'),require(_0xcd89('0xf')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10'),require(_0xcd89('0x11')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x12'),require(_0xcd89('0x13')));_0x6f63ed['use']('/api/voice/recordings',require(_0xcd89('0x14')));_0x6f63ed[_0xcd89('0x9')]('/api/screen/recordings',require(_0xcd89('0x15')));_0x6f63ed['use'](_0xcd89('0x16'),require(_0xcd89('0x17')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x18'),require(_0xcd89('0x19')));_0x6f63ed['use']('/api/voice/calls/reports',require(_0xcd89('0x1a')));_0x6f63ed['use'](_0xcd89('0x1b'),require(_0xcd89('0x1c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x1d'),require(_0xcd89('0x1e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x1f'),require(_0xcd89('0x20')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x21'),require(_0xcd89('0x22')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x23'),require('./api/trunk'));_0x6f63ed[_0xcd89('0x9')]('/api/voice/transfers/reports',require(_0xcd89('0x24')));_0x6f63ed[_0xcd89('0x9')]('/api/mail/out_servers',require(_0xcd89('0x25')));_0x6f63ed['use']('/api/mail/accounts',require(_0xcd89('0x26')));_0x6f63ed['use'](_0xcd89('0x27'),require(_0xcd89('0x28')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x29'),require(_0xcd89('0x2a')));_0x6f63ed['use'](_0xcd89('0x2b'),require('./api/mailInteraction'));_0x6f63ed[_0xcd89('0x9')]('/api/mail/messages',require(_0xcd89('0x2c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x2d'),require(_0xcd89('0x2e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x2f'),require(_0xcd89('0x30')));_0x6f63ed[_0xcd89('0x9')]('/api/dashboards',require(_0xcd89('0x31')));_0x6f63ed[_0xcd89('0x9')]('/api/dashboards/items',require(_0xcd89('0x32')));_0x6f63ed['use'](_0xcd89('0x33'),require(_0xcd89('0x34')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x35'),require(_0xcd89('0x36')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x37'),require(_0xcd89('0x38')));_0x6f63ed[_0xcd89('0x9')]('/api/fax/messages',require(_0xcd89('0x39')));_0x6f63ed[_0xcd89('0x9')]('/api/fax/queues',require(_0xcd89('0x3a')));_0x6f63ed['use'](_0xcd89('0x3b'),require(_0xcd89('0x3c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x3d'),require(_0xcd89('0x3e')));_0x6f63ed['use'](_0xcd89('0x3f'),require('./api/smsApplication'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x40'),require(_0xcd89('0x41')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x42'),require(_0xcd89('0x43')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x44'),require('./api/smsQueue'));_0x6f63ed[_0xcd89('0x9')]('/api/openchannel/accounts',require(_0xcd89('0x45')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x46'),require(_0xcd89('0x47')));_0x6f63ed[_0xcd89('0x9')]('/api/openchannel/interactions',require(_0xcd89('0x48')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x49'),require(_0xcd89('0x4a')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x4b'),require(_0xcd89('0x4c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x4d'),require(_0xcd89('0x4e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x4f'),require(_0xcd89('0x50')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x51'),require(_0xcd89('0x52')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x53'),require(_0xcd89('0x54')));_0x6f63ed['use'](_0xcd89('0x55'),require(_0xcd89('0x56')));_0x6f63ed['use'](_0xcd89('0x57'),require(_0xcd89('0x58')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x59'),require(_0xcd89('0x5a')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x5b'),require(_0xcd89('0x5c')));_0x6f63ed['use'](_0xcd89('0x5d'),require(_0xcd89('0x5e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x5f'),require(_0xcd89('0x60')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x61'),require(_0xcd89('0x62')));_0x6f63ed['use'](_0xcd89('0x63'),require(_0xcd89('0x64')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x65'),require('./api/cmHopperBlack'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x66'),require('./api/cmHopperFinal'));_0x6f63ed['use'](_0xcd89('0x67'),require('./api/cmHopperHistory'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x68'),require(_0xcd89('0x69')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x6a'),require(_0xcd89('0x6b')));_0x6f63ed[_0xcd89('0x9')]('/api/automations',require(_0xcd89('0x6c')));_0x6f63ed['use'](_0xcd89('0x6d'),require(_0xcd89('0x6e')));_0x6f63ed['use'](_0xcd89('0x6f'),require(_0xcd89('0x70')));_0x6f63ed[_0xcd89('0x9')]('/api/conditions',require(_0xcd89('0x71')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x72'),require('./api/interval'));_0x6f63ed[_0xcd89('0x9')]('/api/pauses',require(_0xcd89('0x73')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x74'),require(_0xcd89('0x75')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x76'),require(_0xcd89('0x77')));_0x6f63ed['use']('/api/schedules',require('./api/schedule'));_0x6f63ed[_0xcd89('0x9')]('/api/sounds',require('./api/sound'));_0x6f63ed['use']('/api/tags',require(_0xcd89('0x78')));_0x6f63ed[_0xcd89('0x9')]('/api/contact_item_types',require(_0xcd89('0x79')));_0x6f63ed['use'](_0xcd89('0x7a'),require(_0xcd89('0x7b')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x7c'),require(_0xcd89('0x7d')));_0x6f63ed['use'](_0xcd89('0x7e'),require(_0xcd89('0x7f')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x80'),require(_0xcd89('0x81')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x82'),require(_0xcd89('0x83')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x84'),require(_0xcd89('0x85')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x86'),require(_0xcd89('0x87')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x88'),require(_0xcd89('0x89')));_0x6f63ed['use']('/api/analytics/default_reports',require(_0xcd89('0x8a')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x8b'),require(_0xcd89('0x8c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x8d'),require(_0xcd89('0x8e')));_0x6f63ed[_0xcd89('0x9')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x8f'),require('./api/analyticTreeReport'));_0x6f63ed['use'](_0xcd89('0x90'),require(_0xcd89('0x91')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x92'),require('./api/intSalesforceConfiguration'));_0x6f63ed[_0xcd89('0x9')]('/api/integrations/salesforce/fields',require(_0xcd89('0x93')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x94'),require(_0xcd89('0x95')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x96'),require(_0xcd89('0x97')));_0x6f63ed['use']('/api/integrations/sugarcrm/fields',require(_0xcd89('0x98')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x99'),require('./api/intDeskAccount'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x9a'),require('./api/intDeskConfiguration'));_0x6f63ed['use'](_0xcd89('0x9b'),require(_0xcd89('0x9c')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x9d'),require(_0xcd89('0x9e')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x9f'),require(_0xcd89('0xa0')));_0x6f63ed['use']('/api/integrations/zoho/fields',require('./api/intZohoField'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa1'),require('./api/intZendeskAccount'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa2'),require('./api/intZendeskConfiguration'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa3'),require(_0xcd89('0xa4')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa5'),require(_0xcd89('0xa6')));_0x6f63ed['use'](_0xcd89('0xa7'),require(_0xcd89('0xa8')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xa9'),require(_0xcd89('0xaa')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xab'),require(_0xcd89('0xac')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xad'),require(_0xcd89('0xae')));_0x6f63ed['use'](_0xcd89('0xaf'),require(_0xcd89('0xb0')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb1'),require(_0xcd89('0xb2')));_0x6f63ed[_0xcd89('0x9')]('/api/integrations/servicenow/configurations',require(_0xcd89('0xb3')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb4'),require('./api/intServicenowField'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb5'),require(_0xcd89('0xb6')));_0x6f63ed[_0xcd89('0x9')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xb7'),require(_0xcd89('0xb8')));_0x6f63ed['use'](_0xcd89('0xb9'),require(_0xcd89('0xba')));_0x6f63ed['use']('/api/integrations/freshsales/configurations',require(_0xcd89('0xbb')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xbc'),require(_0xcd89('0xbd')));_0x6f63ed[_0xcd89('0x9')]('/api/networks',require(_0xcd89('0xbe')));_0x6f63ed['use'](_0xcd89('0xbf'),require(_0xcd89('0xc0')));_0x6f63ed[_0xcd89('0x9')]('/api/chat/internal/messages',require(_0xcd89('0xc1')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc2'),require('./api/jscriptyAnswerReport'));_0x6f63ed[_0xcd89('0x9')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc3'),require(_0xcd89('0xc4')));_0x6f63ed['use'](_0xcd89('0xc5'),require(_0xcd89('0xc6')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc7'),require(_0xcd89('0xc8')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xc9'),require(_0xcd89('0xca')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xcb'),require(_0xcd89('0xcc')));_0x6f63ed['use'](_0xcd89('0xcd'),require(_0xcd89('0xce')));_0x6f63ed[_0xcd89('0x9')]('/api/square/odbc',require('./api/squareOdbc'));_0x6f63ed['use'](_0xcd89('0xcf'),require(_0xcd89('0xd0')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd1'),require(_0xcd89('0xd2')));_0x6f63ed[_0xcd89('0x9')]('/api/square/messages',require('./api/squareMessage'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd3'),require(_0xcd89('0xd4')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd5'),require('./api/license'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd6'),require('./api/campaign'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd7'),require('./api/migration'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xd8'),require(_0xcd89('0xd9')));_0x6f63ed['use'](_0xcd89('0xda'),require('./api/plugin'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xdb'),require('./api/mailTransferReport'));_0x6f63ed['use'](_0xcd89('0xdc'),require(_0xcd89('0xdd')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xde'),require(_0xcd89('0xdf')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe0'),require(_0xcd89('0xe1')));_0x6f63ed['use']('/api/sms/reports/transfer',require(_0xcd89('0xe2')));_0x6f63ed[_0xcd89('0x9')]('/api/cm/lists',require(_0xcd89('0xe3')));_0x6f63ed['use'](_0xcd89('0xe4'),require(_0xcd89('0xe5')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe6'),require(_0xcd89('0xe7')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe8'),require('./api/userProfileSection'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xe9'),require(_0xcd89('0xea')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xeb'),require(_0xcd89('0xec')));_0x6f63ed[_0xcd89('0x9')]('/api/whatsapp/accounts',require(_0xcd89('0xed')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xee'),require(_0xcd89('0xef')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xf0'),require('./api/whatsappInteraction'));_0x6f63ed['use'](_0xcd89('0xf1'),require(_0xcd89('0xf2')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xf3'),require('./api/whatsappQueueReport'));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xf4'),require(_0xcd89('0xf5')));_0x6f63ed[_0xcd89('0x9')]('/api/whatsapp/queues',require('./api/whatsappQueue'));_0x6f63ed['use'](_0xcd89('0xf6'),require('./api/cloudProvider'));_0x6f63ed['use'](_0xcd89('0xf7'),require(_0xcd89('0xf8')));_0x6f63ed[_0xcd89('0x9')]('/api/user-settings',require(_0xcd89('0xf9')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xfa'),require(_0xcd89('0xfb')));_0x6f63ed[_0xcd89('0x9')]('/api/auth/google',require(_0xcd89('0xfc')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0xfd'),require(_0xcd89('0xfe')));_0x6f63ed['use']('/api/jira',require(_0xcd89('0xff')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x100'),require(_0xcd89('0x101')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x102'),require('./api/version'));_0x6f63ed[_0xcd89('0x9')]('/api/system',require(_0xcd89('0x103')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x104'),require(_0xcd89('0x105')));_0x6f63ed['use'](_0xcd89('0x106'),require('./api/webbar'));_0x6f63ed[_0xcd89('0x9')]('/api/logs',clientSideLogs);_0x6f63ed['use'](_0xcd89('0x107'),express[_0xcd89('0x108')](path[_0xcd89('0x109')](config['root'],_0xcd89('0x107'))));_0x6f63ed[_0xcd89('0x9')]('/www',express['static'](path[_0xcd89('0x109')](config[_0xcd89('0x10a')],'/www')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10b'),express['static'](path[_0xcd89('0x109')](config[_0xcd89('0x10a')],_0xcd89('0x10b'))));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10c'),express[_0xcd89('0x108')](path[_0xcd89('0x109')](config['root'],_0xcd89('0x10d'),'3.1.0')));_0x6f63ed[_0xcd89('0x9')](_0xcd89('0x10e'),express['static'](path['join'](config[_0xcd89('0x10a')],_0xcd89('0x10f'))));_0x6f63ed[_0xcd89('0x110')](_0xcd89('0x111'))[_0xcd89('0x112')](errors[0x194]);_0x6f63ed['route']('/*')[_0xcd89('0x112')](function(_0x40dbeb,_0x5ee60b){_0x5ee60b[_0xcd89('0x113')](path[_0xcd89('0x114')](_0x6f63ed[_0xcd89('0x112')](_0xcd89('0x115'))+_0xcd89('0x116')));});return _0x6f63ed;});};
\ No newline at end of file
+var _0x8a36=['./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','./api/pm2','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','/index.html','path','express','./config/environment','./utils/client-side-logger','setupLoggers','then','use','/api/users','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8a36,0xbe));var _0x68a3=function(_0x1cb000,_0x52ad31){_0x1cb000=_0x1cb000-0x0;var _0x558e01=_0x8a36[_0x1cb000];return _0x558e01;};'use strict';var path=require(_0x68a3('0x0'));var express=require(_0x68a3('0x1'));var errors=require('./errors');var config=require(_0x68a3('0x2'));var setupLoggers=require(_0x68a3('0x3'))[_0x68a3('0x4')];var clientSideLogs=require('./api/client-side-logs');exports['default']=function(_0x145037){return setupLoggers(_0x145037)[_0x68a3('0x5')](function(){_0x145037[_0x68a3('0x6')](_0x68a3('0x7'),require('./api/user'));_0x145037[_0x68a3('0x6')](_0x68a3('0x8'),require(_0x68a3('0x9')));_0x145037[_0x68a3('0x6')]('/api/voice/contexts',require(_0x68a3('0xa')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb'),require('./api/voiceExtension'));_0x145037[_0x68a3('0x6')](_0x68a3('0xc'),require(_0x68a3('0xd')));_0x145037[_0x68a3('0x6')]('/api/voice/queues',require(_0x68a3('0xe')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf'),require(_0x68a3('0x10')));_0x145037[_0x68a3('0x6')](_0x68a3('0x11'),require(_0x68a3('0x12')));_0x145037[_0x68a3('0x6')](_0x68a3('0x13'),require(_0x68a3('0x14')));_0x145037[_0x68a3('0x6')](_0x68a3('0x15'),require(_0x68a3('0x16')));_0x145037[_0x68a3('0x6')](_0x68a3('0x17'),require('./api/voiceCallReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0x18'),require(_0x68a3('0x19')));_0x145037[_0x68a3('0x6')](_0x68a3('0x1a'),require(_0x68a3('0x1b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x1c'),require(_0x68a3('0x1d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x1e'),require(_0x68a3('0x1f')));_0x145037['use'](_0x68a3('0x20'),require(_0x68a3('0x21')));_0x145037[_0x68a3('0x6')](_0x68a3('0x22'),require(_0x68a3('0x23')));_0x145037['use'](_0x68a3('0x24'),require('./api/mailServerOut'));_0x145037[_0x68a3('0x6')](_0x68a3('0x25'),require(_0x68a3('0x26')));_0x145037['use'](_0x68a3('0x27'),require(_0x68a3('0x28')));_0x145037[_0x68a3('0x6')](_0x68a3('0x29'),require(_0x68a3('0x2a')));_0x145037[_0x68a3('0x6')](_0x68a3('0x2b'),require(_0x68a3('0x2c')));_0x145037[_0x68a3('0x6')](_0x68a3('0x2d'),require(_0x68a3('0x2e')));_0x145037[_0x68a3('0x6')]('/api/mail/applications',require(_0x68a3('0x2f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x30'),require(_0x68a3('0x31')));_0x145037[_0x68a3('0x6')](_0x68a3('0x32'),require(_0x68a3('0x33')));_0x145037['use']('/api/dashboards/items',require(_0x68a3('0x34')));_0x145037[_0x68a3('0x6')](_0x68a3('0x35'),require(_0x68a3('0x36')));_0x145037[_0x68a3('0x6')](_0x68a3('0x37'),require(_0x68a3('0x38')));_0x145037['use'](_0x68a3('0x39'),require(_0x68a3('0x3a')));_0x145037['use']('/api/fax/messages',require('./api/faxMessage'));_0x145037['use']('/api/fax/queues',require(_0x68a3('0x3b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x3c'),require(_0x68a3('0x3d')));_0x145037['use'](_0x68a3('0x3e'),require('./api/smsAccount'));_0x145037[_0x68a3('0x6')](_0x68a3('0x3f'),require('./api/smsApplication'));_0x145037[_0x68a3('0x6')](_0x68a3('0x40'),require(_0x68a3('0x41')));_0x145037[_0x68a3('0x6')](_0x68a3('0x42'),require(_0x68a3('0x43')));_0x145037[_0x68a3('0x6')](_0x68a3('0x44'),require('./api/smsQueue'));_0x145037[_0x68a3('0x6')](_0x68a3('0x45'),require(_0x68a3('0x46')));_0x145037[_0x68a3('0x6')](_0x68a3('0x47'),require('./api/openchannelApplication'));_0x145037[_0x68a3('0x6')](_0x68a3('0x48'),require(_0x68a3('0x49')));_0x145037['use'](_0x68a3('0x4a'),require(_0x68a3('0x4b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x4c'),require(_0x68a3('0x4d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x4e'),require('./api/chatWebsite'));_0x145037[_0x68a3('0x6')](_0x68a3('0x4f'),require(_0x68a3('0x50')));_0x145037['use']('/api/chat/applications',require('./api/chatApplication'));_0x145037['use'](_0x68a3('0x51'),require(_0x68a3('0x52')));_0x145037[_0x68a3('0x6')]('/api/chat/messages',require('./api/chatMessage'));_0x145037['use']('/api/chat/offline_messages',require(_0x68a3('0x53')));_0x145037['use']('/api/chat/queues',require(_0x68a3('0x54')));_0x145037[_0x68a3('0x6')](_0x68a3('0x55'),require(_0x68a3('0x56')));_0x145037[_0x68a3('0x6')](_0x68a3('0x57'),require(_0x68a3('0x58')));_0x145037['use'](_0x68a3('0x59'),require(_0x68a3('0x5a')));_0x145037[_0x68a3('0x6')](_0x68a3('0x5b'),require('./api/cmContact'));_0x145037[_0x68a3('0x6')](_0x68a3('0x5c'),require(_0x68a3('0x5d')));_0x145037['use'](_0x68a3('0x5e'),require(_0x68a3('0x5f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x60'),require(_0x68a3('0x61')));_0x145037['use'](_0x68a3('0x62'),require(_0x68a3('0x63')));_0x145037[_0x68a3('0x6')](_0x68a3('0x64'),require(_0x68a3('0x65')));_0x145037[_0x68a3('0x6')](_0x68a3('0x66'),require(_0x68a3('0x67')));_0x145037[_0x68a3('0x6')](_0x68a3('0x68'),require('./api/automation'));_0x145037['use'](_0x68a3('0x69'),require(_0x68a3('0x6a')));_0x145037['use']('/api/dispositions',require(_0x68a3('0x6b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x6c'),require('./api/condition'));_0x145037[_0x68a3('0x6')](_0x68a3('0x6d'),require(_0x68a3('0x6e')));_0x145037[_0x68a3('0x6')](_0x68a3('0x6f'),require('./api/pause'));_0x145037[_0x68a3('0x6')]('/api/cdr',require(_0x68a3('0x70')));_0x145037[_0x68a3('0x6')](_0x68a3('0x71'),require(_0x68a3('0x72')));_0x145037['use'](_0x68a3('0x73'),require(_0x68a3('0x74')));_0x145037[_0x68a3('0x6')]('/api/sounds',require(_0x68a3('0x75')));_0x145037[_0x68a3('0x6')](_0x68a3('0x76'),require(_0x68a3('0x77')));_0x145037['use'](_0x68a3('0x78'),require(_0x68a3('0x79')));_0x145037[_0x68a3('0x6')](_0x68a3('0x7a'),require(_0x68a3('0x7b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x7c'),require(_0x68a3('0x7d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x7e'),require(_0x68a3('0x7f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x80'),require(_0x68a3('0x81')));_0x145037[_0x68a3('0x6')](_0x68a3('0x82'),require(_0x68a3('0x83')));_0x145037[_0x68a3('0x6')](_0x68a3('0x84'),require(_0x68a3('0x85')));_0x145037[_0x68a3('0x6')](_0x68a3('0x86'),require('./api/integrationReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0x87'),require('./api/analyticCustomReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0x88'),require(_0x68a3('0x89')));_0x145037[_0x68a3('0x6')](_0x68a3('0x8a'),require(_0x68a3('0x8b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x8c'),require(_0x68a3('0x8d')));_0x145037[_0x68a3('0x6')](_0x68a3('0x8e'),require(_0x68a3('0x8f')));_0x145037[_0x68a3('0x6')](_0x68a3('0x90'),require(_0x68a3('0x91')));_0x145037['use'](_0x68a3('0x92'),require(_0x68a3('0x93')));_0x145037[_0x68a3('0x6')]('/api/integrations/salesforce/configurations',require(_0x68a3('0x94')));_0x145037[_0x68a3('0x6')](_0x68a3('0x95'),require(_0x68a3('0x96')));_0x145037[_0x68a3('0x6')](_0x68a3('0x97'),require(_0x68a3('0x98')));_0x145037[_0x68a3('0x6')](_0x68a3('0x99'),require('./api/intSugarcrmConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0x9a'),require(_0x68a3('0x9b')));_0x145037[_0x68a3('0x6')](_0x68a3('0x9c'),require('./api/intDeskAccount'));_0x145037[_0x68a3('0x6')](_0x68a3('0x9d'),require(_0x68a3('0x9e')));_0x145037[_0x68a3('0x6')](_0x68a3('0x9f'),require(_0x68a3('0xa0')));_0x145037[_0x68a3('0x6')](_0x68a3('0xa1'),require('./api/intZohoAccount'));_0x145037[_0x68a3('0x6')](_0x68a3('0xa2'),require(_0x68a3('0xa3')));_0x145037[_0x68a3('0x6')](_0x68a3('0xa4'),require(_0x68a3('0xa5')));_0x145037[_0x68a3('0x6')](_0x68a3('0xa6'),require(_0x68a3('0xa7')));_0x145037[_0x68a3('0x6')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0xa8'),require(_0x68a3('0xa9')));_0x145037[_0x68a3('0x6')](_0x68a3('0xaa'),require(_0x68a3('0xab')));_0x145037[_0x68a3('0x6')](_0x68a3('0xac'),require(_0x68a3('0xad')));_0x145037[_0x68a3('0x6')]('/api/integrations/freshdesk/fields',require(_0x68a3('0xae')));_0x145037[_0x68a3('0x6')](_0x68a3('0xaf'),require(_0x68a3('0xb0')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb1'),require('./api/intVtigerConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0xb2'),require('./api/intVtigerField'));_0x145037[_0x68a3('0x6')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x145037['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x145037[_0x68a3('0x6')](_0x68a3('0xb3'),require(_0x68a3('0xb4')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb5'),require('./api/intDynamics365Account'));_0x145037['use'](_0x68a3('0xb6'),require(_0x68a3('0xb7')));_0x145037[_0x68a3('0x6')](_0x68a3('0xb8'),require(_0x68a3('0xb9')));_0x145037[_0x68a3('0x6')]('/api/integrations/freshsales/accounts',require(_0x68a3('0xba')));_0x145037['use'](_0x68a3('0xbb'),require(_0x68a3('0xbc')));_0x145037['use']('/api/integrations/freshsales/fields',require(_0x68a3('0xbd')));_0x145037[_0x68a3('0x6')](_0x68a3('0xbe'),require(_0x68a3('0xbf')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc0'),require(_0x68a3('0xc1')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc2'),require(_0x68a3('0xc3')));_0x145037[_0x68a3('0x6')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x145037[_0x68a3('0x6')](_0x68a3('0xc4'),require(_0x68a3('0xc5')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc6'),require(_0x68a3('0xc7')));_0x145037[_0x68a3('0x6')](_0x68a3('0xc8'),require(_0x68a3('0xc9')));_0x145037['use'](_0x68a3('0xca'),require(_0x68a3('0xcb')));_0x145037[_0x68a3('0x6')](_0x68a3('0xcc'),require(_0x68a3('0xcd')));_0x145037[_0x68a3('0x6')](_0x68a3('0xce'),require(_0x68a3('0xcf')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd0'),require(_0x68a3('0xd1')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd2'),require(_0x68a3('0xd3')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd4'),require(_0x68a3('0xd5')));_0x145037[_0x68a3('0x6')](_0x68a3('0xd6'),require(_0x68a3('0xd7')));_0x145037['use'](_0x68a3('0xd8'),require(_0x68a3('0xd9')));_0x145037['use'](_0x68a3('0xda'),require(_0x68a3('0xdb')));_0x145037[_0x68a3('0x6')](_0x68a3('0xdc'),require(_0x68a3('0xdd')));_0x145037[_0x68a3('0x6')](_0x68a3('0xde'),require(_0x68a3('0xdf')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe0'),require(_0x68a3('0xe1')));_0x145037['use'](_0x68a3('0xe2'),require(_0x68a3('0xe3')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe4'),require(_0x68a3('0xe5')));_0x145037['use']('/api/mail/reports/transfer',require(_0x68a3('0xe6')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe7'),require(_0x68a3('0xe8')));_0x145037[_0x68a3('0x6')](_0x68a3('0xe9'),require(_0x68a3('0xea')));_0x145037[_0x68a3('0x6')]('/api/openchannel/reports/transfer',require(_0x68a3('0xeb')));_0x145037[_0x68a3('0x6')](_0x68a3('0xec'),require(_0x68a3('0xed')));_0x145037[_0x68a3('0x6')]('/api/cm/lists',require('./api/cmList'));_0x145037[_0x68a3('0x6')](_0x68a3('0xee'),require(_0x68a3('0xef')));_0x145037[_0x68a3('0x6')]('/api/userProfiles',require(_0x68a3('0xf0')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf1'),require('./api/userProfileSection'));_0x145037[_0x68a3('0x6')](_0x68a3('0xf2'),require('./api/userProfileResource'));_0x145037[_0x68a3('0x6')](_0x68a3('0xf3'),require(_0x68a3('0xf4')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf5'),require('./api/whatsappAccount'));_0x145037[_0x68a3('0x6')]('/api/whatsapp/applications',require(_0x68a3('0xf6')));_0x145037['use']('/api/whatsapp/interactions',require(_0x68a3('0xf7')));_0x145037[_0x68a3('0x6')](_0x68a3('0xf8'),require('./api/whatsappMessage'));_0x145037['use'](_0x68a3('0xf9'),require(_0x68a3('0xfa')));_0x145037['use'](_0x68a3('0xfb'),require(_0x68a3('0xfc')));_0x145037[_0x68a3('0x6')](_0x68a3('0xfd'),require(_0x68a3('0xfe')));_0x145037[_0x68a3('0x6')](_0x68a3('0xff'),require(_0x68a3('0x100')));_0x145037[_0x68a3('0x6')]('/api/realtime',require(_0x68a3('0x101')));_0x145037['use'](_0x68a3('0x102'),require(_0x68a3('0x103')));_0x145037[_0x68a3('0x6')]('/api/auth/local',require(_0x68a3('0x104')));_0x145037[_0x68a3('0x6')](_0x68a3('0x105'),require(_0x68a3('0x106')));_0x145037[_0x68a3('0x6')]('/api/auth/activedirectory',require(_0x68a3('0x107')));_0x145037[_0x68a3('0x6')](_0x68a3('0x108'),require(_0x68a3('0x109')));_0x145037[_0x68a3('0x6')](_0x68a3('0x10a'),require(_0x68a3('0x10b')));_0x145037[_0x68a3('0x6')]('/api/version',require(_0x68a3('0x10c')));_0x145037[_0x68a3('0x6')](_0x68a3('0x10d'),require(_0x68a3('0x10e')));_0x145037[_0x68a3('0x6')]('/api/pm2',require(_0x68a3('0x10f')));_0x145037['use']('/api/webbar',require('./api/webbar'));_0x145037[_0x68a3('0x6')](_0x68a3('0x110'),clientSideLogs);_0x145037['use'](_0x68a3('0x111'),express[_0x68a3('0x112')](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x111'))));_0x145037[_0x68a3('0x6')]('/www',express[_0x68a3('0x112')](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x115'))));_0x145037[_0x68a3('0x6')](_0x68a3('0x116'),express['static'](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x116'))));_0x145037[_0x68a3('0x6')](_0x68a3('0x117'),express[_0x68a3('0x112')](path['join'](config['root'],_0x68a3('0x118'),'3.1.0')));_0x145037[_0x68a3('0x6')]('/plugins',express['static'](path[_0x68a3('0x113')](config[_0x68a3('0x114')],_0x68a3('0x119'))));_0x145037['route'](_0x68a3('0x11a'))[_0x68a3('0x11b')](errors[0x194]);_0x145037[_0x68a3('0x11c')]('/*')['get'](function(_0x499ee9,_0x4e890f){_0x4e890f[_0x68a3('0x11d')](path['resolve'](_0x145037['get']('appPath')+_0x68a3('0x11e')));});return _0x145037;});};
\ No newline at end of file
index 33048ba..d68ff6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf333=['../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc'];(function(_0x2baedf,_0x12183b){var _0x53bca4=function(_0x2adc66){while(--_0x2adc66){_0x2baedf['push'](_0x2baedf['shift']());}};_0x53bca4(++_0x12183b);}(_0xf333,0x1cd));var _0x3f33=function(_0x2d8e83,_0x39f41a){_0x2d8e83=_0x2d8e83-0x0;var _0x3d81f5=_0xf333[_0x2d8e83];return _0x3d81f5;};'use strict';var jayson=require(_0x3f33('0x0'));var _=require('lodash');var config=require(_0x3f33('0x1'));exports['listen']=function(){return new Promise(function(_0x2c963f,_0x39f614){var _0x56335c={};_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/user/user.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x3')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x4')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x5')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x6')));_0x56335c=_['merge'](_0x56335c,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x7')));_0x56335c=_['merge'](_0x56335c,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/memberReport/memberReport.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x8')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x9')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xa')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0xb')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xc')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0xd')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xe')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0xf')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x10')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x11')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/faxAccount/faxAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/faxApplication/faxApplication.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x12')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x13')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x14')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x15')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/smsAccount/smsAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/smsInteraction/smsInteraction.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x16')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x17')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x18')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x19')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1a')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x1b')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1c')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x1d')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1e')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x1f')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x20')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x21')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x22')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x23')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x24')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x25')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x26')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x27')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x28')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x29')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x2a')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x2b')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x2c')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x2d')));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x2e')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x2f')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x30')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x31')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x32')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x33')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x34')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x35')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x36')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x37')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x38')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x39')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x3a')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/campaign/campaign.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/attachment/attachment.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x3b')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x56335c=_['merge'](_0x56335c,require(_0x3f33('0x3c')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require(_0x3f33('0x3d')));_0x56335c=_[_0x3f33('0x2')](_0x56335c,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x28b256=jayson[_0x3f33('0x3e')](_0x56335c)[_0x3f33('0x3f')]();var _0x46bc07=config[_0x3f33('0x40')][_0x3f33('0x41')]||config[_0x3f33('0x41')]+0x1;var _0x21e1b4=config[_0x3f33('0x40')]['ip']||_0x3f33('0x42');_0x28b256['on'](_0x3f33('0x43'),function(_0x22af67){return _0x39f614(_0x22af67);});_0x28b256[_0x3f33('0x44')](_0x46bc07,_0x21e1b4,function(){console[_0x3f33('0x45')](_0x3f33('0x46'),_0x21e1b4,_0x46bc07);require(_0x3f33('0x47'))[_0x3f33('0x48')]();return _0x2c963f(_0x3f33('0x49')+_0x21e1b4+':'+_0x46bc07);});});};
\ No newline at end of file
+var _0x0c42=['../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','port','rpc','localhost','error','log','../config/triggers','default','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc'];(function(_0x1e6579,_0x595c18){var _0x2f8541=function(_0x25e888){while(--_0x25e888){_0x1e6579['push'](_0x1e6579['shift']());}};_0x2f8541(++_0x595c18);}(_0x0c42,0x191));var _0x20c4=function(_0x1bcbb5,_0x578704){_0x1bcbb5=_0x1bcbb5-0x0;var _0x422c0d=_0x0c42[_0x1bcbb5];return _0x422c0d;};'use strict';var jayson=require(_0x20c4('0x0'));var _=require(_0x20c4('0x1'));var config=require(_0x20c4('0x2'));exports[_0x20c4('0x3')]=function(){return new Promise(function(_0xe6959,_0x5810aa){var _0x5d686d={};_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x5')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x6')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceQueue/voiceQueue.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceRecording/voiceRecording.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x7')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x8')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x9')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xa')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xb')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xc')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xd')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/mailAccount/mailAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/mailQueue/mailQueue.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0xe')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0xf')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x10')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x11')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x12')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x13')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x14')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x15')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x16')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x17')));_0x5d686d=_['merge'](_0x5d686d,require('../api/smsAccount/smsAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/smsInteraction/smsInteraction.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x18')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x19')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1a')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1b')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1c')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1d')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1e')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x1f')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x20')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x21')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x22')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x23')));_0x5d686d=_['merge'](_0x5d686d,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x24')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x25')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x26')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x27')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x28')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x29')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2a')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2b')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/variable/variable.rpc'));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x2c')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2d')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x2e')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x2f')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x30')));_0x5d686d=_['merge'](_0x5d686d,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x5d686d=_['merge'](_0x5d686d,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x31')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x32')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x33')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require('../api/squareReport/squareReport.rpc'));_0x5d686d=_['merge'](_0x5d686d,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x34')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x35')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x36')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x37')));_0x5d686d=_['merge'](_0x5d686d,require('../api/squareMessage/squareMessage.rpc'));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x38')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x39')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3a')));_0x5d686d=_['merge'](_0x5d686d,require(_0x20c4('0x3b')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3c')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3d')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3e')));_0x5d686d=_[_0x20c4('0x4')](_0x5d686d,require(_0x20c4('0x3f')));var _0x45d795=jayson[_0x20c4('0x40')](_0x5d686d)['http']();var _0xf6ee5d=config['rpc'][_0x20c4('0x41')]||config[_0x20c4('0x41')]+0x1;var _0x32fdba=config[_0x20c4('0x42')]['ip']||_0x20c4('0x43');_0x45d795['on'](_0x20c4('0x44'),function(_0x2f3e06){return _0x5810aa(_0x2f3e06);});_0x45d795[_0x20c4('0x3')](_0xf6ee5d,_0x32fdba,function(){console[_0x20c4('0x45')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x32fdba,_0xf6ee5d);require(_0x20c4('0x46'))[_0x20c4('0x47')]();return _0xe6959('RPC\x20listening\x20on\x20'+_0x32fdba+':'+_0xf6ee5d);});});};
\ No newline at end of file
index cf436fc..ce9e168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5565=['sendRequest','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','lodash','EventEmitter','./error','call','setEncoding','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype'];(function(_0x160e77,_0x4e4702){var _0x10ad58=function(_0x542626){while(--_0x542626){_0x160e77['push'](_0x160e77['shift']());}};_0x10ad58(++_0x4e4702);}(_0x5565,0x104));var _0x5556=function(_0x30dcbb,_0x2270d7){_0x30dcbb=_0x30dcbb-0x0;var _0x7ef54d=_0x5565[_0x30dcbb];return _0x7ef54d;};'use strict';var util=require('util');var _=require(_0x5556('0x0'));var EventEmitter=require('events')[_0x5556('0x1')];var AGIReply=require('./reply');var AGIError=require(_0x5556('0x2'));function AGIChannel(_0x133756){var _0x42a6b5=this,_0x31cc51=new AGIReply(),_0x5e4b48=![],_0x3d63e9={};EventEmitter[_0x5556('0x3')](_0x42a6b5);_0x133756[_0x5556('0x4')]('utf8');_0x133756[_0x5556('0x5')](0x8*0x3c*0x3c*0x3e8);_0x31cc51['setEncoding']('utf8');_0x31cc51['on'](_0x5556('0x6'),function(_0x4365d6){for(var _0x445978 in _0x4365d6){_0x42a6b5[_0x445978]=_0x4365d6[_0x445978];}_0x42a6b5[_0x5556('0x7')](_0x5556('0x8'));});_0x31cc51['on'](_0x5556('0x9'),function(_0x20c44d){if(_0x20c44d[_0x5556('0xa')]()==_0x5556('0xb')){_0x42a6b5[_0x5556('0x7')](_0x5556('0xb'));return;}if(_0x20c44d[_0x5556('0xc')](0x0,0xb)==_0x5556('0xd')){_0x5e4b48=!![];}if(_0x5e4b48){_0x3d63e9['rx']+=_0x20c44d+'\x0a';if(_0x20c44d[_0x5556('0xe')](_0x5556('0xf'))!=-0x1){_0x5e4b48=![];}}else{_0x3d63e9['rx']=_0x20c44d;}if(_0x5e4b48){return;}if(typeof _0x3d63e9['cb']==_0x5556('0x10')){var _0x53d3cd=_0x3d63e9['rx'][_0x5556('0xc')](0x0,0x3),_0x30bde4=null,_0x6cf747=null;_0x53d3cd=parseInt(_0x53d3cd);if(isNaN(_0x53d3cd)){_0x3d63e9['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5556('0x11')});return;}if(_0x53d3cd!=0xc8){_0x3d63e9['cb'](null,{'code':_0x53d3cd,'result':-0x1,'extra':'KO'});return;}_0x30bde4=_0x3d63e9['rx'][_0x5556('0xc')](0x4)[_0x5556('0x12')]('result=','');if(_0x30bde4['indexOf']('\x20')!=-0x1){_0x30bde4=_0x30bde4['substr'](0x0,_0x30bde4[_0x5556('0x13')]('\x20'));}if(_['startsWith'](_0x30bde4,'-1')){_0x30bde4=parseInt(_0x30bde4);}_0x6cf747=_0x3d63e9['rx'][_0x5556('0x14')]('\x20');if(_0x6cf747[_0x5556('0x15')]==0x3){_0x6cf747=_0x6cf747[0x2][_0x5556('0xc')](0x1,_0x6cf747[0x2][_0x5556('0x15')]-0x1);}else if(_0x6cf747[_0x5556('0x15')]>0x3){var _0x420be9=/\((.+)\)/;var _0x24709f=_0x3d63e9['rx'][_0x5556('0x16')](_0x420be9);if(_0x24709f){_0x6cf747=_0x24709f[0x1];}else{_0x6cf747=null;}}else{_0x6cf747=null;}_0x3d63e9['cb'](null,{'code':_0x53d3cd,'result':_0x30bde4,'extra':_0x6cf747});}});_0x133756['on']('error',function(_0x3b8fca){_0x42a6b5[_0x5556('0x7')](_0x5556('0x17'),new AGIError(_0x5556('0x18'),_0x3b8fca[_0x5556('0x19')]));});_0x133756['on'](_0x5556('0x1a'),function(){_0x42a6b5[_0x5556('0x7')](_0x5556('0x1a'),new AGIError(_0x5556('0x1b')));});_0x133756['on'](_0x5556('0x1c'),function(){_0x42a6b5[_0x5556('0x7')](_0x5556('0x1c'),new AGIError(_0x5556('0x1d')));_0x133756[_0x5556('0x1e')]();});_0x133756[_0x5556('0x1f')](_0x31cc51);this[_0x5556('0x20')]=function(_0x150cb1,_0x3d060c){var _0x150cb1=_0x150cb1||'',_0x3d060c=typeof _0x3d060c==_0x5556('0x10')?_0x3d060c:new Function();_0x3d63e9={'tx':_0x150cb1,'rx':'','cb':_0x3d060c};_0x133756[_0x5556('0x21')](_0x150cb1+'\x0a');},this[_0x5556('0x1a')]=function(){_0x133756[_0x5556('0x1e')]();};}util[_0x5556('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x5556('0x23')][_0x5556('0x24')]=function(_0x597626){return this[_0x5556('0x20')][_0x5556('0x25')](this,_0x597626);};AGIChannel[_0x5556('0x23')][_0x5556('0x26')]=function(){return this['sendRequest'](_0x5556('0x27'));};AGIChannel[_0x5556('0x23')][_0x5556('0x28')]=function(_0xbebaf8,_0x4a361f,_0x2054ac){_0xbebaf8=_0xbebaf8===undefined?_0x5556('0x29'):_0xbebaf8;_0x4a361f=_0x4a361f===undefined?'5':_0x4a361f;_0x2054ac=_0x2054ac===undefined?'1':_0x2054ac;return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x2b'),_0xbebaf8,_0x4a361f*0x3e8,_0x2054ac));};AGIChannel[_0x5556('0x23')][_0x5556('0x2c')]=function(_0x1caef3){_0x1caef3=_0x1caef3||_0x5556('0x2d');return this[_0x5556('0x24')](util['format'](_0x5556('0x2e'),_0x1caef3));};AGIChannel[_0x5556('0x23')][_0x5556('0x2f')]=function(_0x1d299e,_0xd635b9){if(_[_0x5556('0x30')](_0xd635b9)){return this['sendRequest'](util[_0x5556('0x2a')](_0x5556('0x31'),_0x1d299e,_0xd635b9[_0x5556('0x32')](',')));}return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x31'),_0x1d299e,_0xd635b9));};AGIChannel[_0x5556('0x23')][_0x5556('0x33')]=function(_0x4fd0ed){return this[_0x5556('0x24')](util['format'](_0x5556('0x34'),_0x4fd0ed));};AGIChannel[_0x5556('0x23')][_0x5556('0x35')]=function(_0x252fec){return this[_0x5556('0x24')](util['format'](_0x5556('0x36'),_0x252fec));};AGIChannel[_0x5556('0x23')]['setPriority']=function(_0x43d0b4){return this[_0x5556('0x24')](util[_0x5556('0x2a')]('SET\x20PRIORITY\x20%s',_0x43d0b4));};AGIChannel[_0x5556('0x23')][_0x5556('0xb')]=function(){return this[_0x5556('0x24')](_0x5556('0x37'));};AGIChannel[_0x5556('0x23')]['setVariable']=function(_0x4c98e4,_0x15ef57){var _0x27e434=_[_0x5556('0x38')](_0x15ef57)||_[_0x5556('0x39')](_0x15ef57)?_0x15ef57[_0x5556('0x3a')]():_0x15ef57;return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x3b'),_0x4c98e4,_0x27e434?_0x27e434[_0x5556('0x3a')]()[_0x5556('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x5556('0x3c')]=function(_0x2ea81b,_0xeef9c2){return this[_0x5556('0x24')](util['format'](_0x5556('0x3d'),_0x2ea81b,_0xeef9c2));};AGIChannel[_0x5556('0x23')][_0x5556('0x3e')]=function(_0x6e4312,_0x44b57f){return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x3f'),_0x6e4312,_0x44b57f));};AGIChannel[_0x5556('0x23')][_0x5556('0x40')]=function(_0x16ab7a,_0x14ea0e){return this[_0x5556('0x24')](util[_0x5556('0x2a')](_0x5556('0x41'),_0x16ab7a,_0x14ea0e));};AGIChannel[_0x5556('0x23')]['continueAt']=function(_0x494d60,_0x521803,_0x161b45){_0x521803=_0x521803||this['extension'];_0x161b45=_0x161b45||0x1;this[_0x5556('0x33')](_0x494d60);this['setExtension'](_0x521803);this['setPriority'](_0x161b45);return this[_0x5556('0x2c')](util[_0x5556('0x2a')](_0x5556('0x42'),_0x494d60,_0x521803,_0x161b45));};AGIChannel[_0x5556('0x23')][_0x5556('0x43')]=function(_0x4af5dc){return this[_0x5556('0x24')](util['format'](_0x5556('0x44'),_0x4af5dc));};AGIChannel[_0x5556('0x23')]['recordFile']=function(_0x2bb45f,_0x5a252b,_0x1d00d5,_0x6425ab,_0x41d274,_0x106c79){_0x5a252b=_0x5a252b||_0x5556('0x45');_0x1d00d5=_0x1d00d5||'';_0x6425ab=_0x6425ab===undefined?-0x1:_0x6425ab==='-1'?-0x1:_0x6425ab*0x3e8;_0x41d274=_0x41d274===undefined?'':'s='+_0x41d274;_0x106c79=_0x106c79?'BEEP':'';return this['sendRequest'](util[_0x5556('0x2a')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2bb45f,_0x5a252b,_0x1d00d5,_0x6425ab,_0x106c79,_0x41d274));};AGIChannel[_0x5556('0x23')]['streamFile']=function(_0x1c8938,_0x2f8e35){_0x2f8e35=_0x2f8e35||'';return this['sendRequest'](util[_0x5556('0x2a')](_0x5556('0x46'),_0x1c8938,_0x2f8e35));};AGIChannel[_0x5556('0x23')]['agi']=function(_0x23c199){return this[_0x5556('0x2f')](_0x5556('0x47'),_0x23c199);};AGIChannel[_0x5556('0x23')][_0x5556('0x48')]=function(_0x62107b){return this[_0x5556('0x2f')]('WAIT',_0x62107b);};AGIChannel['prototype']['error']=function(_0x46ed63,_0x36bf4e){this[_0x5556('0x2c')](util[_0x5556('0x2a')](_0x5556('0x49'),_0x46ed63['id'],_0x46ed63['label'],_0x36bf4e));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0x1a54=['SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayDigits','SAY\x20DIGITS\x20%s\x20%s','continueAt','setContext','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','EventEmitter','./reply','./error','call','utf8','setTimeout','setEncoding','headers','emit','ready','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','write','prototype','sendRequest','command','sync','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','SET\x20CONTEXT\x20%s','setExtension','setPriority'];(function(_0x29dadd,_0x26b6e0){var _0x12e802=function(_0x1f149d){while(--_0x1f149d){_0x29dadd['push'](_0x29dadd['shift']());}};_0x12e802(++_0x26b6e0);}(_0x1a54,0x12e));var _0x41a5=function(_0x54f882,_0x4ce7f4){_0x54f882=_0x54f882-0x0;var _0x221326=_0x1a54[_0x54f882];return _0x221326;};'use strict';var util=require(_0x41a5('0x0'));var _=require('lodash');var EventEmitter=require('events')[_0x41a5('0x1')];var AGIReply=require(_0x41a5('0x2'));var AGIError=require(_0x41a5('0x3'));function AGIChannel(_0x5a55b5){var _0x217f68=this,_0x3ba60a=new AGIReply(),_0x39fe63=![],_0x3b3d6e={};EventEmitter[_0x41a5('0x4')](_0x217f68);_0x5a55b5['setEncoding'](_0x41a5('0x5'));_0x5a55b5[_0x41a5('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3ba60a[_0x41a5('0x7')](_0x41a5('0x5'));_0x3ba60a['on'](_0x41a5('0x8'),function(_0x45c3d6){for(var _0x206532 in _0x45c3d6){_0x217f68[_0x206532]=_0x45c3d6[_0x206532];}_0x217f68[_0x41a5('0x9')](_0x41a5('0xa'));});_0x3ba60a['on'](_0x41a5('0xb'),function(_0x29eb80){if(_0x29eb80[_0x41a5('0xc')]()==_0x41a5('0xd')){_0x217f68[_0x41a5('0x9')](_0x41a5('0xd'));return;}if(_0x29eb80[_0x41a5('0xe')](0x0,0xb)=='520-Invalid'){_0x39fe63=!![];}if(_0x39fe63){_0x3b3d6e['rx']+=_0x29eb80+'\x0a';if(_0x29eb80['search'](_0x41a5('0xf'))!=-0x1){_0x39fe63=![];}}else{_0x3b3d6e['rx']=_0x29eb80;}if(_0x39fe63){return;}if(typeof _0x3b3d6e['cb']==_0x41a5('0x10')){var _0x5b8bfe=_0x3b3d6e['rx'][_0x41a5('0xe')](0x0,0x3),_0x3aecdf=null,_0x35954d=null;_0x5b8bfe=parseInt(_0x5b8bfe);if(isNaN(_0x5b8bfe)){_0x3b3d6e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x41a5('0x11')});return;}if(_0x5b8bfe!=0xc8){_0x3b3d6e['cb'](null,{'code':_0x5b8bfe,'result':-0x1,'extra':'KO'});return;}_0x3aecdf=_0x3b3d6e['rx'][_0x41a5('0xe')](0x4)[_0x41a5('0x12')](_0x41a5('0x13'),'');if(_0x3aecdf['indexOf']('\x20')!=-0x1){_0x3aecdf=_0x3aecdf['substr'](0x0,_0x3aecdf['indexOf']('\x20'));}if(_[_0x41a5('0x14')](_0x3aecdf,'-1')){_0x3aecdf=parseInt(_0x3aecdf);}_0x35954d=_0x3b3d6e['rx'][_0x41a5('0x15')]('\x20');if(_0x35954d[_0x41a5('0x16')]==0x3){_0x35954d=_0x35954d[0x2][_0x41a5('0xe')](0x1,_0x35954d[0x2][_0x41a5('0x16')]-0x1);}else if(_0x35954d[_0x41a5('0x16')]>0x3){var _0x47557b=/\((.+)\)/;var _0x3b7cf7=_0x3b3d6e['rx'][_0x41a5('0x17')](_0x47557b);if(_0x3b7cf7){_0x35954d=_0x3b7cf7[0x1];}else{_0x35954d=null;}}else{_0x35954d=null;}_0x3b3d6e['cb'](null,{'code':_0x5b8bfe,'result':_0x3aecdf,'extra':_0x35954d});}});_0x5a55b5['on'](_0x41a5('0x18'),function(_0x3b4cc8){_0x217f68['emit'](_0x41a5('0x18'),new AGIError(_0x41a5('0x19'),_0x3b4cc8[_0x41a5('0x1a')]));});_0x5a55b5['on'](_0x41a5('0x1b'),function(){_0x217f68[_0x41a5('0x9')](_0x41a5('0x1b'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x5a55b5['on'](_0x41a5('0x1c'),function(){_0x217f68[_0x41a5('0x9')](_0x41a5('0x1c'),new AGIError(_0x41a5('0x1d')));_0x5a55b5[_0x41a5('0x1e')]();});_0x5a55b5['pipe'](_0x3ba60a);this['command']=function(_0x4be7f2,_0x8e2d18){var _0x4be7f2=_0x4be7f2||'',_0x8e2d18=typeof _0x8e2d18==_0x41a5('0x10')?_0x8e2d18:new Function();_0x3b3d6e={'tx':_0x4be7f2,'rx':'','cb':_0x8e2d18};_0x5a55b5[_0x41a5('0x1f')](_0x4be7f2+'\x0a');},this[_0x41a5('0x1b')]=function(){_0x5a55b5[_0x41a5('0x1e')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x41a5('0x20')][_0x41a5('0x21')]=function(_0x1c50db){return this[_0x41a5('0x22')][_0x41a5('0x23')](this,_0x1c50db);};AGIChannel[_0x41a5('0x20')]['answer']=function(){return this[_0x41a5('0x21')](_0x41a5('0x24'));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x25')]=function(_0x5ad479,_0x3553e1,_0x1877ed){_0x5ad479=_0x5ad479===undefined?'beep':_0x5ad479;_0x3553e1=_0x3553e1===undefined?'5':_0x3553e1;_0x1877ed=_0x1877ed===undefined?'1':_0x1877ed;return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x27'),_0x5ad479,_0x3553e1*0x3e8,_0x1877ed));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x28')]=function(_0x24fd01){_0x24fd01=_0x24fd01||'NO\x20MESSAGE';return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x29'),_0x24fd01));};AGIChannel[_0x41a5('0x20')]['exec']=function(_0x30943f,_0x35f713){if(_[_0x41a5('0x2a')](_0x35f713)){return this[_0x41a5('0x21')](util['format']('EXEC\x20%s\x20%s',_0x30943f,_0x35f713[_0x41a5('0x2b')](',')));}return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x2c'),_0x30943f,_0x35f713));};AGIChannel['prototype']['setContext']=function(_0x388e4d){return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x2d'),_0x388e4d));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x2e')]=function(_0x55776d){return this[_0x41a5('0x21')](util[_0x41a5('0x26')]('SET\x20EXTENSION\x20%s',_0x55776d));};AGIChannel['prototype'][_0x41a5('0x2f')]=function(_0x401b06){return this['sendRequest'](util['format'](_0x41a5('0x30'),_0x401b06));};AGIChannel['prototype'][_0x41a5('0xd')]=function(){return this[_0x41a5('0x21')]('HANGUP');};AGIChannel[_0x41a5('0x20')][_0x41a5('0x31')]=function(_0x16484c,_0x31b87d){var _0x2e22d0=_[_0x41a5('0x32')](_0x31b87d)||_[_0x41a5('0x33')](_0x31b87d)?_0x31b87d[_0x41a5('0x34')]():_0x31b87d;return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x35'),_0x16484c,_0x2e22d0?_0x2e22d0[_0x41a5('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x41a5('0x20')]['sayNumber']=function(_0x3b904a,_0x538497){return this[_0x41a5('0x21')](util[_0x41a5('0x26')]('SAY\x20NUMBER\x20%s\x20%s',_0x3b904a,_0x538497));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x36')]=function(_0x53ce7b,_0x4723b4){return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x37'),_0x53ce7b,_0x4723b4));};AGIChannel[_0x41a5('0x20')]['sayPhonetic']=function(_0x49f978,_0x14c563){return this[_0x41a5('0x21')](util[_0x41a5('0x26')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x49f978,_0x14c563));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x38')]=function(_0x564826,_0x47cf8e,_0x14cfa0){_0x47cf8e=_0x47cf8e||this['extension'];_0x14cfa0=_0x14cfa0||0x1;this[_0x41a5('0x39')](_0x564826);this[_0x41a5('0x2e')](_0x47cf8e);this[_0x41a5('0x2f')](_0x14cfa0);return this['noop'](util[_0x41a5('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x564826,_0x47cf8e,_0x14cfa0));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x3a')]=function(_0x69237){return this['sendRequest'](util[_0x41a5('0x26')](_0x41a5('0x3b'),_0x69237));};AGIChannel[_0x41a5('0x20')]['recordFile']=function(_0x4c7a3b,_0xdf7d3e,_0x24bcc4,_0x586b44,_0x57bd20,_0x48b39c){_0xdf7d3e=_0xdf7d3e||_0x41a5('0x3c');_0x24bcc4=_0x24bcc4||'';_0x586b44=_0x586b44===undefined?-0x1:_0x586b44==='-1'?-0x1:_0x586b44*0x3e8;_0x57bd20=_0x57bd20===undefined?'':'s='+_0x57bd20;_0x48b39c=_0x48b39c?_0x41a5('0x3d'):'';return this[_0x41a5('0x21')](util[_0x41a5('0x26')](_0x41a5('0x3e'),_0x4c7a3b,_0xdf7d3e,_0x24bcc4,_0x586b44,_0x48b39c,_0x57bd20));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x3f')]=function(_0x52f835,_0x1d0d2f){_0x1d0d2f=_0x1d0d2f||'';return this['sendRequest'](util['format']('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x52f835,_0x1d0d2f));};AGIChannel[_0x41a5('0x20')][_0x41a5('0x40')]=function(_0x940a0b){return this['exec'](_0x41a5('0x41'),_0x940a0b);};AGIChannel['prototype']['wait']=function(_0x240adf){return this['exec'](_0x41a5('0x42'),_0x240adf);};AGIChannel[_0x41a5('0x20')][_0x41a5('0x18')]=function(_0x4eec14,_0x5de0ca){this['noop'](util[_0x41a5('0x26')](_0x41a5('0x43'),_0x4eec14['id'],_0x4eec14[_0x41a5('0x44')],_0x5de0ca));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x41a5('0x45')]=AGIChannel;
\ No newline at end of file
index 56df19e..d6488ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dd2=['Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x0dd2,0x74));var _0x20dd=function(_0x288536,_0x369b51){_0x288536=_0x288536-0x0;var _0x525e94=_0x0dd2[_0x288536];return _0x525e94;};'use strict';var util=require(_0x20dd('0x0'));var error={'E_AGI_UNDEFINED':_0x20dd('0x1'),'E_AGI_ARGUMENT_PORT':_0x20dd('0x2'),'E_AGI_SERVER_ERROR':_0x20dd('0x3'),'E_AGI_SERVER_CLOSE':_0x20dd('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x20dd('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x20dd('0x6'),'E_AGI_SOCKET_ERROR':_0x20dd('0x7'),'E_AGI_SOCKET_CLOSE':_0x20dd('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x20dd('0x9'),'E_AGI_COMMAND_EMPTY':_0x20dd('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x20dd('0xb'),'E_AGI_IVR_ENTRY':_0x20dd('0xc')};function AGIError(_0x4119b0){var _0x4119b0=_0x4119b0||null,_0x49afd8=_0x49afd8||[],_0x4d0632=0x1,_0x4b0001='';if(!error[_0x4119b0]){_0x4119b0=_0x20dd('0xd');}_0x49afd8[_0x20dd('0xe')](error[_0x4119b0]);while(arguments[_0x4d0632]){_0x49afd8['push'](arguments[_0x4d0632]);_0x4d0632++;}_0x4b0001=util[_0x20dd('0xf')][_0x20dd('0x10')](util,_0x49afd8);this[_0x20dd('0x11')]=_0x4b0001;this[_0x20dd('0x12')]=_0x4119b0;}module[_0x20dd('0x13')]=AGIError;
\ No newline at end of file
+var _0xf63b=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x1b9d41,_0xd4009d){var _0x38ec46=function(_0x37e998){while(--_0x37e998){_0x1b9d41['push'](_0x1b9d41['shift']());}};_0x38ec46(++_0xd4009d);}(_0xf63b,0x191));var _0xbf63=function(_0xe61616,_0x1bd828){_0xe61616=_0xe61616-0x0;var _0x3fa7e0=_0xf63b[_0xe61616];return _0x3fa7e0;};'use strict';var util=require(_0xbf63('0x0'));var error={'E_AGI_UNDEFINED':_0xbf63('0x1'),'E_AGI_ARGUMENT_PORT':_0xbf63('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xbf63('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xbf63('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xbf63('0x5'),'E_AGI_SOCKET_ERROR':_0xbf63('0x6'),'E_AGI_SOCKET_CLOSE':_0xbf63('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xbf63('0x8'),'E_AGI_COMMAND_EMPTY':_0xbf63('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xbf63('0xa'),'E_AGI_IVR_ENTRY':_0xbf63('0xb')};function AGIError(_0x3e643a){var _0x3e643a=_0x3e643a||null,_0x461529=_0x461529||[],_0x5ef9b3=0x1,_0x148df9='';if(!error[_0x3e643a]){_0x3e643a=_0xbf63('0xc');}_0x461529[_0xbf63('0xd')](error[_0x3e643a]);while(arguments[_0x5ef9b3]){_0x461529[_0xbf63('0xd')](arguments[_0x5ef9b3]);_0x5ef9b3++;}_0x148df9=util['format']['apply'](util,_0x461529);this[_0xbf63('0xe')]=_0x148df9;this[_0xbf63('0xf')]=_0x3e643a;}module[_0xbf63('0x10')]=AGIError;
\ No newline at end of file
index 82553e7..2e8bcc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfae=['defaults','subscribe','E_AGI_SERVER_ERROR','message','agi','parse','emit','error','lodash','ioredis','./error','../../config/environment','redis'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0xcfae,0xe5));var _0xecfa=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xcfae[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0xecfa('0x0'));var EventEmitter=require('events')['EventEmitter'];var Redis=require(_0xecfa('0x1'));var AGIError=require(_0xecfa('0x2'));var config=require(_0xecfa('0x3'));config[_0xecfa('0x4')]=_[_0xecfa('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xecfa('0x4')]);sub[_0xecfa('0x6')]('agi',function(_0x11741a){if(_0x11741a)return eventEmitter['emit']('error',new AGIError(_0xecfa('0x7'),_0x11741a));});sub['on'](_0xecfa('0x8'),function(_0x483ca5,_0x283c60){if(_0x483ca5!==_0xecfa('0x9'))return;try{var _0x5169fb=JSON[_0xecfa('0xa')](_0x283c60);eventEmitter[_0xecfa('0xb')]('projectUpdate',_0x5169fb);}catch(_0x1e2337){eventEmitter[_0xecfa('0xb')](_0xecfa('0xc'),new AGIError(_0xecfa('0x7'),_0x1e2337));}});module['exports']={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0xd3bb=['redis','subscribe','agi','emit','E_AGI_SERVER_ERROR','message','parse','exports','events','EventEmitter','ioredis','./error','../../config/environment'];(function(_0x12e24d,_0x59ce3d){var _0xabbeaf=function(_0xa75a68){while(--_0xa75a68){_0x12e24d['push'](_0x12e24d['shift']());}};_0xabbeaf(++_0x59ce3d);}(_0xd3bb,0x1e9));var _0xbd3b=function(_0x1499df,_0x5c754e){_0x1499df=_0x1499df-0x0;var _0x1252dd=_0xd3bb[_0x1499df];return _0x1252dd;};'use strict';var _=require('lodash');var EventEmitter=require(_0xbd3b('0x0'))[_0xbd3b('0x1')];var Redis=require(_0xbd3b('0x2'));var AGIError=require(_0xbd3b('0x3'));var config=require(_0xbd3b('0x4'));config[_0xbd3b('0x5')]=_['defaults'](config[_0xbd3b('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xbd3b('0x5')]);sub[_0xbd3b('0x6')](_0xbd3b('0x7'),function(_0x2d48c7){if(_0x2d48c7)return eventEmitter[_0xbd3b('0x8')]('error',new AGIError(_0xbd3b('0x9'),_0x2d48c7));});sub['on'](_0xbd3b('0xa'),function(_0x2f99f6,_0x58d8e1){if(_0x2f99f6!==_0xbd3b('0x7'))return;try{var _0x558bc2=JSON[_0xbd3b('0xb')](_0x58d8e1);eventEmitter[_0xbd3b('0x8')]('projectUpdate',_0x558bc2);}catch(_0x57b71f){eventEmitter[_0xbd3b('0x8')]('error',new AGIError(_0xbd3b('0x9'),_0x57b71f));}});module[_0xbd3b('0xc')]={'EventEmitter':eventEmitter};
\ No newline at end of file
index 8ce9610..c18bbe3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6152=['split','agicommand','vswitch','target','default','info','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','getVertex','traverseBFS','no\x20vertex\x20found','no\x20edge/s\x20available','length','condition'];(function(_0x580ce3,_0x3a1357){var _0x530f6a=function(_0x2a14b9){while(--_0x2a14b9){_0x580ce3['push'](_0x580ce3['shift']());}};_0x530f6a(++_0x3a1357);}(_0x6152,0x106));var _0x2615=function(_0x49b060,_0x37b87e){_0x49b060=_0x49b060-0x0;var _0x204323=_0x6152[_0x49b060];return _0x204323;};'use strict';var _=require(_0x2615('0x0'));var logger=require(_0x2615('0x1'))('agi');var verticesWithRetry=[_0x2615('0x2'),'getdigits',_0x2615('0x3')];var Graph=function(){this[_0x2615('0x4')]={};this[_0x2615('0x5')]={};this[_0x2615('0x6')]=0x0;};Graph[_0x2615('0x7')][_0x2615('0x8')]=function(_0x3cd30c){this[_0x2615('0x4')][_0x3cd30c['id']]=_0x3cd30c;this[_0x2615('0x5')][_0x3cd30c['id']]=[];};Graph[_0x2615('0x7')][_0x2615('0x9')]=function(_0x2359bf,_0x1d957d,_0x276817){this['edges'][_0x2359bf][_0x2615('0xa')]({'target':_0x1d957d,'condition':_0x276817});this[_0x2615('0x6')]+=0x1;};Graph[_0x2615('0x7')][_0x2615('0xb')]=function(){return _[_0x2615('0xb')](this[_0x2615('0x4')]);};Graph[_0x2615('0x7')]['relations']=function(){return this[_0x2615('0x6')];};Graph['prototype'][_0x2615('0xc')]=function(_0x221c9e){return this[_0x2615('0x4')][_0x221c9e];};Graph[_0x2615('0x7')][_0x2615('0xd')]=function(_0x238a46,_0x4e3f43){if(!this['vertices'][_0x238a46]){return logger['info'](_0x2615('0xe'));}var _0x4a5398=_0x4e3f43(this['vertices'][_0x238a46]);if(!_0x4a5398){return logger['info']('stop\x20traverse');}if(this[_0x2615('0x5')][_0x238a46]['length']===0x0){return logger['info'](_0x2615('0xf'));}for(var _0x5ae2f3=0x0,_0x5f3043=[],_0xd238e7=![];_0x5ae2f3<this['edges'][_0x238a46][_0x2615('0x10')];_0x5ae2f3+=0x1){if(this[_0x2615('0x5')][_0x238a46][_0x5ae2f3][_0x2615('0x11')]){_0x5f3043=this[_0x2615('0x5')][_0x238a46][_0x5ae2f3][_0x2615('0x11')][_0x2615('0x12')](',');for(var _0x3a6e45=0x0;_0x3a6e45<_0x5f3043[_0x2615('0x10')];_0x3a6e45+=0x1){if(this[_0x2615('0x4')][_0x238a46][_0x2615('0x13')]===_0x2615('0x14')&&_0x5f3043[_0x3a6e45]==='-'){_0xd238e7=this[_0x2615('0x5')][_0x238a46][_0x5ae2f3][_0x2615('0x15')];logger['info'](_0x2615('0x16'),_0x5f3043[_0x3a6e45],this[_0x2615('0x5')][_0x238a46][_0x5ae2f3][_0x2615('0x15')]);}else if(this[_0x2615('0x4')][_0x238a46]['agicommand']===_0x2615('0x2')&&_0x5f3043[_0x3a6e45]==='i'){_0xd238e7=this[_0x2615('0x5')][_0x238a46][_0x5ae2f3][_0x2615('0x15')];logger[_0x2615('0x17')](_0x2615('0x18'),_0x5f3043[_0x3a6e45],this['edges'][_0x238a46][_0x5ae2f3][_0x2615('0x15')]);}if(_0x5f3043[_0x3a6e45]===_0x4a5398){return this[_0x2615('0xd')](this['edges'][_0x238a46][_0x5ae2f3]['target'],_0x4e3f43);}}}else{return this['traverseBFS'](this[_0x2615('0x5')][_0x238a46][_0x5ae2f3][_0x2615('0x15')],_0x4e3f43);}}if(_0x5f3043['length']){if(this[_0x2615('0x4')][_0x238a46][_0x2615('0x13')]==='vswitch'){if(_0xd238e7){return this['traverseBFS'](_0xd238e7,_0x4e3f43);}return logger[_0x2615('0x17')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x2615('0x19')](verticesWithRetry,this[_0x2615('0x4')][_0x238a46][_0x2615('0x13')])){if(_0x4a5398==='-'){return logger[_0x2615('0x17')](_0x2615('0x1a'));}if(_0xd238e7&&_0x4a5398!=='t'){return this[_0x2615('0xd')](_0xd238e7,_0x4e3f43);}return this['traverseBFS'](_0x238a46,_0x4e3f43);}return logger[_0x2615('0x17')](_0x2615('0x1b'));}};module['exports']=Graph;
\ No newline at end of file
+var _0x786c=['edges','numberOfEdges','prototype','addVertex','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','agicommand','target','invalid','vswitch','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','vertices'];(function(_0x400eb4,_0x229c79){var _0x544f8e=function(_0x203188){while(--_0x203188){_0x400eb4['push'](_0x400eb4['shift']());}};_0x544f8e(++_0x229c79);}(_0x786c,0x172));var _0xc786=function(_0x50f419,_0x52b3e0){_0x50f419=_0x50f419-0x0;var _0x18cd95=_0x786c[_0x50f419];return _0x18cd95;};'use strict';var _=require(_0xc786('0x0'));var logger=require(_0xc786('0x1'))(_0xc786('0x2'));var verticesWithRetry=[_0xc786('0x3'),_0xc786('0x4'),_0xc786('0x5')];var Graph=function(){this[_0xc786('0x6')]={};this[_0xc786('0x7')]={};this[_0xc786('0x8')]=0x0;};Graph[_0xc786('0x9')][_0xc786('0xa')]=function(_0x21905b){this['vertices'][_0x21905b['id']]=_0x21905b;this[_0xc786('0x7')][_0x21905b['id']]=[];};Graph[_0xc786('0x9')]['addEdge']=function(_0x52146c,_0x23d4d1,_0x2f9f7a){this[_0xc786('0x7')][_0x52146c][_0xc786('0xb')]({'target':_0x23d4d1,'condition':_0x2f9f7a});this[_0xc786('0x8')]+=0x1;};Graph['prototype'][_0xc786('0xc')]=function(){return _['size'](this[_0xc786('0x6')]);};Graph[_0xc786('0x9')][_0xc786('0xd')]=function(){return this[_0xc786('0x8')];};Graph[_0xc786('0x9')][_0xc786('0xe')]=function(_0x3ec275){return this['vertices'][_0x3ec275];};Graph['prototype'][_0xc786('0xf')]=function(_0x13e3b5,_0x553b57){if(!this[_0xc786('0x6')][_0x13e3b5]){return logger['info'](_0xc786('0x10'));}var _0x58b01f=_0x553b57(this['vertices'][_0x13e3b5]);if(!_0x58b01f){return logger[_0xc786('0x11')](_0xc786('0x12'));}if(this[_0xc786('0x7')][_0x13e3b5][_0xc786('0x13')]===0x0){return logger['info'](_0xc786('0x14'));}for(var _0x35ae24=0x0,_0x4503ae=[],_0x2f691e=![];_0x35ae24<this['edges'][_0x13e3b5][_0xc786('0x13')];_0x35ae24+=0x1){if(this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x15')]){_0x4503ae=this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x15')]['split'](',');for(var _0x5490b1=0x0;_0x5490b1<_0x4503ae[_0xc786('0x13')];_0x5490b1+=0x1){if(this['vertices'][_0x13e3b5][_0xc786('0x16')]==='vswitch'&&_0x4503ae[_0x5490b1]==='-'){_0x2f691e=this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x17')];logger[_0xc786('0x11')]('default',_0x4503ae[_0x5490b1],this['edges'][_0x13e3b5][_0x35ae24][_0xc786('0x17')]);}else if(this[_0xc786('0x6')][_0x13e3b5][_0xc786('0x16')]===_0xc786('0x3')&&_0x4503ae[_0x5490b1]==='i'){_0x2f691e=this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x17')];logger[_0xc786('0x11')](_0xc786('0x18'),_0x4503ae[_0x5490b1],this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x17')]);}if(_0x4503ae[_0x5490b1]===_0x58b01f){return this[_0xc786('0xf')](this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x17')],_0x553b57);}}}else{return this[_0xc786('0xf')](this[_0xc786('0x7')][_0x13e3b5][_0x35ae24][_0xc786('0x17')],_0x553b57);}}if(_0x4503ae[_0xc786('0x13')]){if(this[_0xc786('0x6')][_0x13e3b5][_0xc786('0x16')]===_0xc786('0x19')){if(_0x2f691e){return this[_0xc786('0xf')](_0x2f691e,_0x553b57);}return logger[_0xc786('0x11')]('default\x20on\x20switch\x20not\x20found');}else if(_['includes'](verticesWithRetry,this[_0xc786('0x6')][_0x13e3b5]['agicommand'])){if(_0x58b01f==='-'){return logger['info'](_0xc786('0x1a'));}if(_0x2f691e&&_0x58b01f!=='t'){return this[_0xc786('0xf')](_0x2f691e,_0x553b57);}return this[_0xc786('0xf')](_0x13e3b5,_0x553b57);}return logger[_0xc786('0x11')](_0xc786('0x1b'));}};module[_0xc786('0x1c')]=Graph;
\ No newline at end of file
index eada91c..e46778c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67c7=['format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','arg_1','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','name','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','connection','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','error','stack','findIndex','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info'];(function(_0x2492dd,_0x190912){var _0x4b7c4f=function(_0x2c10d9){while(--_0x2c10d9){_0x2492dd['push'](_0x2492dd['shift']());}};_0x4b7c4f(++_0x190912);}(_0x67c7,0x8f));var _0x767c=function(_0x2dbed7,_0x2962d5){_0x2dbed7=_0x2dbed7-0x0;var _0x326efc=_0x67c7[_0x2dbed7];return _0x326efc;};'use strict';var _=require('lodash');var syncho=require(_0x767c('0x0'));var util=require(_0x767c('0x1'));var config=require(_0x767c('0x2'));var logger=require(_0x767c('0x3'))(_0x767c('0x4'));var utilLicense=require(_0x767c('0x5'));var rpc=require(_0x767c('0x6'));var Project=require(_0x767c('0x7'));var AGIEmitter=require(_0x767c('0x8'))[_0x767c('0x9')];var projects=[];config[_0x767c('0x4')]=_[_0x767c('0xa')](config[_0x767c('0x4')],{'ip':_0x767c('0xb'),'port':0x11dd});AGIEmitter['on'](_0x767c('0xc'),projectUpdateHandler);function connectionHandler(_0x314245){process[_0x767c('0xd')](function(){syncho(function(){try{setChannelVariables(_0x314245);agiHandler(_0x314245);}catch(_0x21e7cb){logger[_0x767c('0xe')](_0x21e7cb[_0x767c('0xf')]);}});});}function projectUpdateHandler(_0x2af0de){try{var _0x437376=_[_0x767c('0x10')](projects,['id',_0x2af0de['id']]);if(_0x437376>-0x1){if(_0x2af0de['deleted']===!![]){projects[_0x767c('0x11')](_0x437376,0x1);}else{projects[_0x437376]=_0x2af0de;}}else{projects['push'](_0x2af0de);}}catch(_0x2c65dd){logger[_0x767c('0xe')](_0x2c65dd[_0x767c('0xf')]);}}function listeningHandler(){console[_0x767c('0x12')](_0x767c('0x13'),config[_0x767c('0x4')][_0x767c('0x14')]);logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x17'),config[_0x767c('0x4')]['ip'],config[_0x767c('0x4')][_0x767c('0x14')]));}function errorHandler(_0x17b57c){if(_0x17b57c&&_0x17b57c['name']&&_0x17b57c[_0x767c('0x18')]){logger[_0x767c('0xe')](util[_0x767c('0x16')]('[%s]\x20%s',_0x17b57c['name'],_0x17b57c[_0x767c('0x18')]));}else{logger['error'](util['format']('[ERROR]\x20%s',_0x17b57c['stack']));}}function closeHandler(){logger[_0x767c('0x15')](util[_0x767c('0x16')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x767c('0x19')],this['calleridname'],this['callerid'],this[_0x767c('0x1a')],this[_0x767c('0x1b')]));try{createSquareReport(this);}catch(_0x481e19){logger[_0x767c('0xe')](_0x481e19[_0x767c('0xf')]);}}function timeoutHandler(){logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x1c'),this[_0x767c('0x19')],this[_0x767c('0x1d')],this[_0x767c('0x1e')],this[_0x767c('0x1a')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x767c('0x16')](_0x767c('0x1f'),this['arg_1'],this[_0x767c('0x1d')],this['callerid'],this[_0x767c('0x1a')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x312ffe,_0x42d482){rpc[_0x767c('0x20')](_0x312ffe)[_0x767c('0x21')](function(_0x2a72a){if(_0x42d482){_0x42d482(null,_0x2a72a);}})[_0x767c('0x22')](function(_0xceddda){if(_0x42d482){_0x42d482(null,_0xceddda);}});}function setChannelVariables(_0x29a5d9){for(var _0x35667e in _0x29a5d9){if(_0x29a5d9[_0x767c('0x23')](_0x35667e)){if(_0x35667e[_0x767c('0x24')](_0x767c('0x25'))===0x0){_0x29a5d9[_0x35667e[_0x767c('0x26')](0x4)]=_0x29a5d9[_0x35667e];delete _0x29a5d9[_0x35667e];}}}}function agiHandler(_0x14c154){logger['debug']('variables',JSON[_0x767c('0x27')](_0x14c154,null,0x2));logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x28'),_0x14c154['arg_1'],_0x14c154['calleridname'],_0x14c154['callerid'],_0x14c154[_0x767c('0x1a')],_0x14c154[_0x767c('0x1b')]));_0x14c154['on'](_0x767c('0xe'),errorHandler);_0x14c154['on'](_0x767c('0x29'),closeHandler);_0x14c154['on'](_0x767c('0x2a'),timeoutHandler);_0x14c154[_0x767c('0x2b')]=![];_0x14c154['on'](_0x767c('0x2c'),hangupHandler);var _0x37a8bc=_[_0x767c('0x2d')](projects,[_0x767c('0x2e'),_0x14c154[_0x767c('0x19')]]);if(!_0x37a8bc)return Project['handleNotFound'](_0x14c154);if(!_0x37a8bc[_0x767c('0x2f')])return Project[_0x767c('0x30')](_0x14c154);return Project[_0x767c('0x31')](_0x37a8bc,_0x14c154);}function main(){var _0x4ae680;return utilLicense[_0x767c('0x32')]()['then'](function(_0x4fbc51){if(!_0x4fbc51)return;if(_0x4fbc51['voice']){if(_0x4fbc51[_0x767c('0x33')]&&_0x4fbc51['callysquare']>0x0){logger[_0x767c('0x15')](util[_0x767c('0x16')](_0x767c('0x34'),_0x4fbc51[_0x767c('0x33')]));_0x4ae680=_0x4fbc51[_0x767c('0x33')];}else{logger[_0x767c('0x15')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x767c('0x15')](_0x767c('0x35'));_0x4ae680=-0x1;}})[_0x767c('0x21')](function(){return Project['getAll']();})[_0x767c('0x21')](function(_0x23c42b){projects=_0x23c42b;return;})[_0x767c('0x22')](function(_0x3464ec){logger['error']('[LICENSE]',_0x3464ec[_0x767c('0xf')]);})['finally'](function(){var _0x37768c=require('./server')(config['agi']['port'],config['agi']['ip'],_0x4ae680);_0x37768c['on'](_0x767c('0xe'),errorHandler);_0x37768c['on']('listening',listeningHandler);_0x37768c['on'](_0x767c('0x36'),connectionHandler);_0x37768c['on'](_0x767c('0x29'),closeHandler);});}main();
\ No newline at end of file
+var _0x5091=['[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','connection','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','EventEmitter','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare'];(function(_0x1f6ece,_0xe5621a){var _0x20cae0=function(_0x21a4a1){while(--_0x21a4a1){_0x1f6ece['push'](_0x1f6ece['shift']());}};_0x20cae0(++_0xe5621a);}(_0x5091,0x100));var _0x1509=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5091[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require(_0x1509('0x0'));var config=require(_0x1509('0x1'));var logger=require(_0x1509('0x2'))(_0x1509('0x3'));var utilLicense=require(_0x1509('0x4'));var rpc=require('./rpc');var Project=require(_0x1509('0x5'));var AGIEmitter=require(_0x1509('0x6'))[_0x1509('0x7')];var projects=[];config[_0x1509('0x3')]=_['defaults'](config[_0x1509('0x3')],{'ip':_0x1509('0x8'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x436c69){process[_0x1509('0x9')](function(){syncho(function(){try{setChannelVariables(_0x436c69);agiHandler(_0x436c69);}catch(_0x4bdcfd){logger[_0x1509('0xa')](_0x4bdcfd[_0x1509('0xb')]);}});});}function projectUpdateHandler(_0x4bc07f){try{var _0x137ee2=_[_0x1509('0xc')](projects,['id',_0x4bc07f['id']]);if(_0x137ee2>-0x1){if(_0x4bc07f[_0x1509('0xd')]===!![]){projects[_0x1509('0xe')](_0x137ee2,0x1);}else{projects[_0x137ee2]=_0x4bc07f;}}else{projects[_0x1509('0xf')](_0x4bc07f);}}catch(_0x3e944c){logger[_0x1509('0xa')](_0x3e944c[_0x1509('0xb')]);}}function listeningHandler(){console[_0x1509('0x10')](_0x1509('0x11'),config['agi']['port']);logger['info'](util[_0x1509('0x12')](_0x1509('0x13'),config['agi']['ip'],config[_0x1509('0x3')][_0x1509('0x14')]));}function errorHandler(_0x48aaff){if(_0x48aaff&&_0x48aaff[_0x1509('0x15')]&&_0x48aaff[_0x1509('0x16')]){logger[_0x1509('0xa')](util[_0x1509('0x12')](_0x1509('0x17'),_0x48aaff[_0x1509('0x15')],_0x48aaff[_0x1509('0x16')]));}else{logger[_0x1509('0xa')](util['format'](_0x1509('0x18'),_0x48aaff[_0x1509('0xb')]));}}function closeHandler(){logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x1a'),this[_0x1509('0x1b')],this[_0x1509('0x1c')],this[_0x1509('0x1d')],this[_0x1509('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x1770d9){logger[_0x1509('0xa')](_0x1770d9['stack']);}}function timeoutHandler(){logger['info'](util[_0x1509('0x12')](_0x1509('0x1f'),this[_0x1509('0x1b')],this[_0x1509('0x1c')],this[_0x1509('0x1d')],this[_0x1509('0x1e')],this[_0x1509('0x20')]));}function hangupHandler(){logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x21'),this[_0x1509('0x1b')],this[_0x1509('0x1c')],this[_0x1509('0x1d')],this['dnid'],this[_0x1509('0x20')]));this['evtHangup']=!![];}function createSquareReport(_0x5921c1,_0x39d342){rpc[_0x1509('0x22')](_0x5921c1)[_0x1509('0x23')](function(_0x2e79f8){if(_0x39d342){_0x39d342(null,_0x2e79f8);}})[_0x1509('0x24')](function(_0x411f95){if(_0x39d342){_0x39d342(null,_0x411f95);}});}function setChannelVariables(_0x3cae06){for(var _0x394b8d in _0x3cae06){if(_0x3cae06['hasOwnProperty'](_0x394b8d)){if(_0x394b8d['indexOf'](_0x1509('0x25'))===0x0){_0x3cae06[_0x394b8d[_0x1509('0x26')](0x4)]=_0x3cae06[_0x394b8d];delete _0x3cae06[_0x394b8d];}}}}function agiHandler(_0x2ef393){logger['debug'](_0x1509('0x27'),JSON[_0x1509('0x28')](_0x2ef393,null,0x2));logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x29'),_0x2ef393[_0x1509('0x1b')],_0x2ef393[_0x1509('0x1c')],_0x2ef393[_0x1509('0x1d')],_0x2ef393[_0x1509('0x1e')],_0x2ef393[_0x1509('0x20')]));_0x2ef393['on'](_0x1509('0xa'),errorHandler);_0x2ef393['on'](_0x1509('0x2a'),closeHandler);_0x2ef393['on'](_0x1509('0x2b'),timeoutHandler);_0x2ef393[_0x1509('0x2c')]=![];_0x2ef393['on'](_0x1509('0x2d'),hangupHandler);var _0x49d7da=_[_0x1509('0x2e')](projects,[_0x1509('0x15'),_0x2ef393['arg_1']]);if(!_0x49d7da)return Project[_0x1509('0x2f')](_0x2ef393);if(!_0x49d7da[_0x1509('0x30')])return Project[_0x1509('0x31')](_0x2ef393);return Project[_0x1509('0x32')](_0x49d7da,_0x2ef393);}function main(){var _0x1ccd1b;return utilLicense[_0x1509('0x33')]()[_0x1509('0x23')](function(_0x417134){if(!_0x417134)return;if(_0x417134[_0x1509('0x34')]){if(_0x417134[_0x1509('0x35')]&&_0x417134[_0x1509('0x35')]>0x0){logger[_0x1509('0x19')](util[_0x1509('0x12')](_0x1509('0x36'),_0x417134[_0x1509('0x35')]));_0x1ccd1b=_0x417134[_0x1509('0x35')];}else{logger[_0x1509('0x19')](_0x1509('0x37'));}}else{logger[_0x1509('0x19')](_0x1509('0x38'));_0x1ccd1b=-0x1;}})[_0x1509('0x23')](function(){return Project[_0x1509('0x39')]();})[_0x1509('0x23')](function(_0x247b45){projects=_0x247b45;return;})[_0x1509('0x24')](function(_0x39fd31){logger[_0x1509('0xa')](_0x1509('0x3a'),_0x39fd31[_0x1509('0xb')]);})[_0x1509('0x3b')](function(){var _0x5a1737=require(_0x1509('0x3c'))(config[_0x1509('0x3')][_0x1509('0x14')],config['agi']['ip'],_0x1ccd1b);_0x5a1737['on'](_0x1509('0xa'),errorHandler);_0x5a1737['on']('listening',listeningHandler);_0x5a1737['on'](_0x1509('0x3d'),connectionHandler);_0x5a1737['on'](_0x1509('0x2a'),closeHandler);});}main();
\ No newline at end of file
index 28593a5..ffa710c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa9a=['client','request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise'];(function(_0x1b9da3,_0x4e6c3d){var _0x4e23ff=function(_0x486381){while(--_0x486381){_0x1b9da3['push'](_0x1b9da3['shift']());}};_0x4e23ff(++_0x4e6c3d);}(_0xfa9a,0x9e));var _0xafa9=function(_0x1dbf56,_0x3d9934){_0x1dbf56=_0x1dbf56-0x0;var _0x3c82c9=_0xfa9a[_0x1dbf56];return _0x3c82c9;};'use strict';var BPromise=require(_0xafa9('0x0'));var jayson=require(_0xafa9('0x1'));var client=jayson[_0xafa9('0x2')]['http']({'port':0x232b});function request(_0x3984ef,_0x548166){return new BPromise(function(_0x29a258,_0x267f75){return client[_0xafa9('0x3')](_0x3984ef,_0x548166)[_0xafa9('0x4')](function(_0x17cc28){if(_0x17cc28['error']){return _0x267f75(_0x17cc28[_0xafa9('0x5')][_0xafa9('0x6')]);}else{return _0x29a258(_0x17cc28['result']);}})[_0xafa9('0x7')](function(_0x238f11){return _0x267f75(_0x238f11);});});}exports[_0xafa9('0x8')]=function(_0x3692c2,_0x3ffa4e){return request(_0xafa9('0x9'),{'account':_0x3692c2,'message':_0x3ffa4e});};
\ No newline at end of file
+var _0xee86=['request','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http'];(function(_0x184575,_0x444400){var _0x28bb63=function(_0x525432){while(--_0x525432){_0x184575['push'](_0x184575['shift']());}};_0x28bb63(++_0x444400);}(_0xee86,0xb0));var _0x6ee8=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xee86[_0x525c7b];return _0x27b33e;};'use strict';var BPromise=require(_0x6ee8('0x0'));var jayson=require(_0x6ee8('0x1'));var client=jayson[_0x6ee8('0x2')][_0x6ee8('0x3')]({'port':0x232b});function request(_0x5a8057,_0x2c1031){return new BPromise(function(_0x319646,_0x198c6b){return client[_0x6ee8('0x4')](_0x5a8057,_0x2c1031)['then'](function(_0x5cbdd0){if(_0x5cbdd0[_0x6ee8('0x5')]){return _0x198c6b(_0x5cbdd0['error'][_0x6ee8('0x6')]);}else{return _0x319646(_0x5cbdd0['result']);}})[_0x6ee8('0x7')](function(_0x1ca583){return _0x198c6b(_0x1ca583);});});}exports[_0x6ee8('0x8')]=function(_0x1fb106,_0x5f06cf){return request(_0x6ee8('0x9'),{'account':_0x1fb106,'message':_0x5f06cf});};
\ No newline at end of file
index a19f62d..d997f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5fc=['calleridname','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','lodash','moment','util','../../config/logger','./rpc','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','length','source','target','addEdge','value','inspect','production','debug','root','stringify','joinAt','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','clear','vertex','gotoc','info','context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x5ce41e,_0x934b39){var _0x237661=function(_0x6addd6){while(--_0x6addd6){_0x5ce41e['push'](_0x5ce41e['shift']());}};_0x237661(++_0x934b39);}(_0xc5fc,0x79));var _0xcc5f=function(_0x239c32,_0x98e899){_0x239c32=_0x239c32-0x0;var _0x4d2613=_0xc5fc[_0x239c32];return _0x4d2613;};'use strict';var _=require(_0xcc5f('0x0'));var moment=require(_0xcc5f('0x1'));var parser=require('xml2json');var util=require(_0xcc5f('0x2'));var logger=require(_0xcc5f('0x3'))('agi');var rpc=require(_0xcc5f('0x4'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require(_0xcc5f('0x5'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xcc5f('0x6')]()[_0xcc5f('0x7')](function(_0x3876f6){logger[_0xcc5f('0x8')](_0xcc5f('0x9'),_0x3876f6[_0xcc5f('0xa')]);return[];});}function addVertex(_0x5f5c32,_0x3ff808,_0x11fea9){_0x3ff808[_0xcc5f('0xb')]=_0x11fea9;if(_0x3ff808[_0xcc5f('0xc')](_0xcc5f('0xd'))){_0x3ff808[_0xcc5f('0xe')]=parseInt(_0x3ff808[_0xcc5f('0xd')],0xa);}_0x5f5c32[_0xcc5f('0xf')](_[_0xcc5f('0x10')](_0x3ff808,_0xcc5f('0x11')));}function initGraph(_0xb5dcb7,_0x2ba7b1){var _0x2a44d0=new Graph();for(var _0x393754 in _0xb5dcb7){if(_0xb5dcb7['hasOwnProperty'](_0x393754)){if(_['isArray'](_0xb5dcb7[_0x393754])){for(var _0x400df5=0x0;_0x400df5<_0xb5dcb7[_0x393754][_0xcc5f('0x12')];_0x400df5+=0x1){addVertex(_0x2a44d0,_0xb5dcb7[_0x393754][_0x400df5],_0x393754);}}else{addVertex(_0x2a44d0,_0xb5dcb7[_0x393754],_0x393754);}}}for(var _0x538d7e=0x0;_0x538d7e<_0x2ba7b1[_0xcc5f('0x12')];_0x538d7e+=0x1){if(_0x2ba7b1[_0x538d7e][_0xcc5f('0x13')]&&_0x2ba7b1[_0x538d7e][_0xcc5f('0x14')]){_0x2a44d0[_0xcc5f('0x15')](_0x2ba7b1[_0x538d7e][_0xcc5f('0x13')],_0x2ba7b1[_0x538d7e][_0xcc5f('0x14')],_0x2ba7b1[_0x538d7e][_0xcc5f('0x16')]);}}return _0x2a44d0;}function getRoot(_0x17891e){return parser['toJson'](_0x17891e,{'object':!![]})['mxGraphModel']['root'];}function inspect(_0x37d03a){return util[_0xcc5f('0x17')](_0x37d03a,{'showHidden':![],'depth':null});}function initialize(_0x4a8db8,_0xbeb1d5){var _0x179dcb=getRoot(_0x4a8db8[_0xcc5f('0x18')]);if(!_0x179dcb||!_0x179dcb['start'])return;var _0x29a817,_0x4a31d6,_0x5b60b1;logger[_0xcc5f('0x19')](_0xcc5f('0x1a'),JSON[_0xcc5f('0x1b')](_0x179dcb,null,0x2));_0xbeb1d5[_0xcc5f('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x29a817=initGraph(_[_0xcc5f('0x10')](_0x179dcb,_0xcc5f('0x11')),_0x179dcb[_0xcc5f('0x11')]);_0x4a31d6=new Vertices(_0xbeb1d5,rpc,mailRpc);logger['info'](util[_0xcc5f('0x1d')](_0xcc5f('0x1e'),_0xbeb1d5[_0xcc5f('0x1f')],_0xbeb1d5['calleridname'],_0xbeb1d5['callerid'],_0xbeb1d5[_0xcc5f('0x20')],_0xbeb1d5[_0xcc5f('0x21')]));_0x29a817['traverseBFS'](_0x179dcb['start']['id'],function(_0x3feb96){try{_0x3feb96=_0x4a31d6[_0xcc5f('0x22')](_0x3feb96);logger[_0xcc5f('0x19')](_0xcc5f('0x23'),JSON[_0xcc5f('0x1b')](_0x3feb96,null,0x2));if(_0x3feb96[_0xcc5f('0xb')]===_0xcc5f('0x24')){logger[_0xcc5f('0x25')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0xbeb1d5[_0xcc5f('0x26')]=_0x3feb96[_0xcc5f('0x26')]||_0xbeb1d5[_0xcc5f('0x26')];_0xbeb1d5['extension']=_0x3feb96[_0xcc5f('0x27')];_0xbeb1d5[_0xcc5f('0x28')]=_0x3feb96['priority']?_0x3feb96[_0xcc5f('0x28')]-0x1:0x1;return null;}else if(_0x3feb96&&_0x4a31d6[_0x3feb96[_0xcc5f('0xb')]]){_0x5b60b1=_0x4a31d6[_0x3feb96[_0xcc5f('0xb')]](_0x3feb96);logger[_0xcc5f('0x25')](_0xcc5f('0x29'),JSON[_0xcc5f('0x1b')](_0x5b60b1,null,0x2));if(_0x5b60b1&&_0x5b60b1['code']===AGI_CODE_SUCCESS&&_0x5b60b1[_0xcc5f('0x2a')]!==AGI_RESULT_ERROR&&!_0xbeb1d5[_0xcc5f('0x2b')]){logger[_0xcc5f('0x19')]('response',inspect(_0x5b60b1));return _[_0xcc5f('0x2c')](_0x5b60b1[_0xcc5f('0x2a')])?null:_0x5b60b1[_0xcc5f('0x2a')][_0xcc5f('0x2d')]();}else{logger[_0xcc5f('0x8')]('response',inspect(_0x5b60b1));return null;}}else{logger[_0xcc5f('0x8')](_0xcc5f('0x2e'));return null;}}catch(_0xb3cab1){logger[_0xcc5f('0x8')](_0xb3cab1[_0xcc5f('0xa')]);return null;}});if(_0x179dcb[_0xcc5f('0x2f')]){logger[_0xcc5f('0x25')](util[_0xcc5f('0x1d')](_0xcc5f('0x30'),_0xbeb1d5[_0xcc5f('0x1f')],_0xbeb1d5['calleridname'],_0xbeb1d5['callerid'],_0xbeb1d5[_0xcc5f('0x20')],_0xbeb1d5[_0xcc5f('0x21')]));_0x29a817['traverseBFS'](_0x179dcb[_0xcc5f('0x2f')]['id'],function(_0x4ad5c7){try{_0x4ad5c7=_0x4a31d6['clear'](_0x4ad5c7);logger['debug'](_0xcc5f('0x23'),JSON['stringify'](_0x4ad5c7,null,0x2));if(_0x4ad5c7&&_0x4a31d6[_0x4ad5c7['agicommand']]){_0x5b60b1=_0x4a31d6[_0x4ad5c7[_0xcc5f('0xb')]](_0x4ad5c7);if(_0x5b60b1){logger[_0xcc5f('0x19')](_0xcc5f('0x29'),inspect(_0x5b60b1));return _[_0xcc5f('0x2c')](_0x5b60b1[_0xcc5f('0x2a')])?null:_0x5b60b1['result'][_0xcc5f('0x2d')]();}else{logger[_0xcc5f('0x8')](_0xcc5f('0x29'),inspect(_0x5b60b1));return null;}}else{logger[_0xcc5f('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x45b81e){logger[_0xcc5f('0x8')](_0x45b81e[_0xcc5f('0xa')]);return null;}});}logger['info'](util[_0xcc5f('0x1d')](_0xcc5f('0x31'),_0xbeb1d5[_0xcc5f('0x1f')],_0xbeb1d5[_0xcc5f('0x32')],_0xbeb1d5[_0xcc5f('0x33')],_0xbeb1d5[_0xcc5f('0x20')],_0xbeb1d5[_0xcc5f('0x21')]));logger[_0xcc5f('0x25')](util[_0xcc5f('0x1d')](_0xcc5f('0x34'),_0xbeb1d5[_0xcc5f('0x26')],_0xbeb1d5[_0xcc5f('0x27')],parseInt(_0xbeb1d5[_0xcc5f('0x28')],0xa)+0x1));_0xbeb1d5[_0xcc5f('0x35')](_0xbeb1d5[_0xcc5f('0x26')],_0xbeb1d5[_0xcc5f('0x27')],parseInt(_0xbeb1d5[_0xcc5f('0x28')],0xa)+0x1);_0xbeb1d5[_0xcc5f('0x36')]();}function handleNotFound(_0x20b190){logger[_0xcc5f('0x8')](util['format'](_0xcc5f('0x37'),_0x20b190['arg_1']));_0x20b190[_0xcc5f('0x35')](_0x20b190[_0xcc5f('0x26')],_0x20b190[_0xcc5f('0x27')],parseInt(_0x20b190[_0xcc5f('0x28')],0xa)+0x1);_0x20b190[_0xcc5f('0x36')]();}function handleUnpublished(_0x3df5dd){logger[_0xcc5f('0x8')](util[_0xcc5f('0x1d')](_0xcc5f('0x38'),_0x3df5dd[_0xcc5f('0x1f')]));_0x3df5dd[_0xcc5f('0x35')](_0x3df5dd['context'],_0x3df5dd['extension'],parseInt(_0x3df5dd[_0xcc5f('0x28')],0xa)+0x1);_0x3df5dd[_0xcc5f('0x36')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0x1bc3=['hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','value','toJson','mxGraphModel','production','start','stringify','joinAt','format','info','arg_1','calleridname','uniqueid','traverseBFS','debug','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','isUndefined','result','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','clear','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand'];(function(_0xeed419,_0x5e2a5a){var _0x54d294=function(_0x58a054){while(--_0x58a054){_0xeed419['push'](_0xeed419['shift']());}};_0x54d294(++_0x5e2a5a);}(_0x1bc3,0x1e0));var _0x31bc=function(_0x55b6ce,_0x4e6416){_0x55b6ce=_0x55b6ce-0x0;var _0x4d03bc=_0x1bc3[_0x55b6ce];return _0x4d03bc;};'use strict';var _=require(_0x31bc('0x0'));var moment=require(_0x31bc('0x1'));var parser=require(_0x31bc('0x2'));var util=require(_0x31bc('0x3'));var logger=require(_0x31bc('0x4'))(_0x31bc('0x5'));var rpc=require(_0x31bc('0x6'));var mailRpc=require(_0x31bc('0x7'));var Graph=require(_0x31bc('0x8'));var Vertices=require(_0x31bc('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x31bc('0xa')]()[_0x31bc('0xb')](function(_0x4b0884){logger[_0x31bc('0xc')](_0x31bc('0xd'),_0x4b0884[_0x31bc('0xe')]);return[];});}function addVertex(_0x3f3a11,_0x577a00,_0x360a91){_0x577a00[_0x31bc('0xf')]=_0x360a91;if(_0x577a00[_0x31bc('0x10')](_0x31bc('0x11'))){_0x577a00[_0x31bc('0x12')]=parseInt(_0x577a00[_0x31bc('0x11')],0xa);}_0x3f3a11[_0x31bc('0x13')](_[_0x31bc('0x14')](_0x577a00,_0x31bc('0x15')));}function initGraph(_0x4dcaae,_0x4f7e48){var _0x3de9ed=new Graph();for(var _0x40a7d4 in _0x4dcaae){if(_0x4dcaae[_0x31bc('0x10')](_0x40a7d4)){if(_[_0x31bc('0x16')](_0x4dcaae[_0x40a7d4])){for(var _0x5a33e1=0x0;_0x5a33e1<_0x4dcaae[_0x40a7d4]['length'];_0x5a33e1+=0x1){addVertex(_0x3de9ed,_0x4dcaae[_0x40a7d4][_0x5a33e1],_0x40a7d4);}}else{addVertex(_0x3de9ed,_0x4dcaae[_0x40a7d4],_0x40a7d4);}}}for(var _0x370955=0x0;_0x370955<_0x4f7e48[_0x31bc('0x17')];_0x370955+=0x1){if(_0x4f7e48[_0x370955]['source']&&_0x4f7e48[_0x370955][_0x31bc('0x18')]){_0x3de9ed[_0x31bc('0x19')](_0x4f7e48[_0x370955][_0x31bc('0x1a')],_0x4f7e48[_0x370955][_0x31bc('0x18')],_0x4f7e48[_0x370955][_0x31bc('0x1b')]);}}return _0x3de9ed;}function getRoot(_0x11d3f8){return parser[_0x31bc('0x1c')](_0x11d3f8,{'object':!![]})[_0x31bc('0x1d')]['root'];}function inspect(_0x2011f8){return util['inspect'](_0x2011f8,{'showHidden':![],'depth':null});}function initialize(_0xb24628,_0xb783f3){var _0x469f35=getRoot(_0xb24628[_0x31bc('0x1e')]);if(!_0x469f35||!_0x469f35[_0x31bc('0x1f')])return;var _0x4f7f97,_0x56d635,_0x5ef5be;logger['debug']('root',JSON[_0x31bc('0x20')](_0x469f35,null,0x2));_0xb783f3[_0x31bc('0x21')]=moment()[_0x31bc('0x22')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f7f97=initGraph(_[_0x31bc('0x14')](_0x469f35,'mxCell'),_0x469f35[_0x31bc('0x15')]);_0x56d635=new Vertices(_0xb783f3,rpc,mailRpc);logger[_0x31bc('0x23')](util[_0x31bc('0x22')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xb783f3[_0x31bc('0x24')],_0xb783f3[_0x31bc('0x25')],_0xb783f3['callerid'],_0xb783f3['dnid'],_0xb783f3[_0x31bc('0x26')]));_0x4f7f97[_0x31bc('0x27')](_0x469f35[_0x31bc('0x1f')]['id'],function(_0x871cbc){try{_0x871cbc=_0x56d635['clear'](_0x871cbc);logger[_0x31bc('0x28')]('vertex',JSON[_0x31bc('0x20')](_0x871cbc,null,0x2));if(_0x871cbc[_0x31bc('0xf')]===_0x31bc('0x29')){logger[_0x31bc('0x23')](_0x31bc('0x2a'));_0xb783f3[_0x31bc('0x2b')]=_0x871cbc[_0x31bc('0x2b')]||_0xb783f3[_0x31bc('0x2b')];_0xb783f3['extension']=_0x871cbc[_0x31bc('0x2c')];_0xb783f3[_0x31bc('0x2d')]=_0x871cbc[_0x31bc('0x2d')]?_0x871cbc[_0x31bc('0x2d')]-0x1:0x1;return null;}else if(_0x871cbc&&_0x56d635[_0x871cbc[_0x31bc('0xf')]]){_0x5ef5be=_0x56d635[_0x871cbc[_0x31bc('0xf')]](_0x871cbc);logger['info'](_0x31bc('0x2e'),JSON['stringify'](_0x5ef5be,null,0x2));if(_0x5ef5be&&_0x5ef5be[_0x31bc('0x2f')]===AGI_CODE_SUCCESS&&_0x5ef5be['result']!==AGI_RESULT_ERROR&&!_0xb783f3['evtHangup']){logger['debug'](_0x31bc('0x2e'),inspect(_0x5ef5be));return _[_0x31bc('0x30')](_0x5ef5be['result'])?null:_0x5ef5be[_0x31bc('0x31')][_0x31bc('0x32')]();}else{logger[_0x31bc('0xc')](_0x31bc('0x2e'),inspect(_0x5ef5be));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x48c9e6){logger[_0x31bc('0xc')](_0x48c9e6[_0x31bc('0xe')]);return null;}});if(_0x469f35['finally']){logger[_0x31bc('0x23')](util['format'](_0x31bc('0x33'),_0xb783f3[_0x31bc('0x24')],_0xb783f3[_0x31bc('0x25')],_0xb783f3[_0x31bc('0x34')],_0xb783f3[_0x31bc('0x35')],_0xb783f3[_0x31bc('0x26')]));_0x4f7f97[_0x31bc('0x27')](_0x469f35['finally']['id'],function(_0x16a5fb){try{_0x16a5fb=_0x56d635[_0x31bc('0x36')](_0x16a5fb);logger[_0x31bc('0x28')]('vertex',JSON['stringify'](_0x16a5fb,null,0x2));if(_0x16a5fb&&_0x56d635[_0x16a5fb[_0x31bc('0xf')]]){_0x5ef5be=_0x56d635[_0x16a5fb[_0x31bc('0xf')]](_0x16a5fb);if(_0x5ef5be){logger[_0x31bc('0x28')](_0x31bc('0x2e'),inspect(_0x5ef5be));return _[_0x31bc('0x30')](_0x5ef5be['result'])?null:_0x5ef5be[_0x31bc('0x31')][_0x31bc('0x32')]();}else{logger[_0x31bc('0xc')]('response',inspect(_0x5ef5be));return null;}}else{logger['error'](_0x31bc('0x37'));return null;}}catch(_0x438f63){logger[_0x31bc('0xc')](_0x438f63[_0x31bc('0xe')]);return null;}});}logger['info'](util[_0x31bc('0x22')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0xb783f3[_0x31bc('0x24')],_0xb783f3[_0x31bc('0x25')],_0xb783f3[_0x31bc('0x34')],_0xb783f3['dnid'],_0xb783f3[_0x31bc('0x26')]));logger[_0x31bc('0x23')](util['format'](_0x31bc('0x38'),_0xb783f3[_0x31bc('0x2b')],_0xb783f3[_0x31bc('0x2c')],parseInt(_0xb783f3[_0x31bc('0x2d')],0xa)+0x1));_0xb783f3[_0x31bc('0x39')](_0xb783f3[_0x31bc('0x2b')],_0xb783f3[_0x31bc('0x2c')],parseInt(_0xb783f3[_0x31bc('0x2d')],0xa)+0x1);_0xb783f3[_0x31bc('0x3a')]();}function handleNotFound(_0x513310){logger[_0x31bc('0xc')](util['format'](_0x31bc('0x3b'),_0x513310['arg_1']));_0x513310[_0x31bc('0x39')](_0x513310['context'],_0x513310[_0x31bc('0x2c')],parseInt(_0x513310[_0x31bc('0x2d')],0xa)+0x1);_0x513310['close']();}function handleUnpublished(_0x5de061){logger[_0x31bc('0xc')](util[_0x31bc('0x22')](_0x31bc('0x3c'),_0x5de061[_0x31bc('0x24')]));_0x5de061[_0x31bc('0x39')](_0x5de061[_0x31bc('0x2b')],_0x5de061[_0x31bc('0x2c')],parseInt(_0x5de061['priority'],0xa)+0x1);_0x5de061[_0x31bc('0x3a')]();}module[_0x31bc('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index c5cdd90..45d69f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5fe=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','emit','headers','_inBody','line','exports','util','stream','_localBuffer','prototype','_transform'];(function(_0x2d994d,_0x168a27){var _0xd54be4=function(_0x1db925){while(--_0x1db925){_0x2d994d['push'](_0x2d994d['shift']());}};_0xd54be4(++_0x168a27);}(_0xd5fe,0x1ab));var _0xed5f=function(_0x27c25f,_0x4ff5fe){_0x27c25f=_0x27c25f-0x0;var _0x2da4c4=_0xd5fe[_0x27c25f];return _0x2da4c4;};'use strict';var util=require(_0xed5f('0x0'));var Transform=require(_0xed5f('0x1'))['Transform'];function AGIReply(_0x4081be){Transform['call'](this,_0x4081be);this[_0xed5f('0x2')]='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xed5f('0x3')][_0xed5f('0x4')]=function(_0x480b23,_0x5dee27,_0x467a03){var _0x20a6b9='\x0a',_0x3a98a7=['\x0a\x0a',_0xed5f('0x5')],_0x281196=-0x1,_0x21f73a=-0x1,_0x2c1ae3='',_0x58cb03=0x0,_0xf9ac71='',_0x4f941d='';this['_localBuffer']+=_0x480b23[_0xed5f('0x6')]();_0xf9ac71=this[_0xed5f('0x2')];if(!this['_inBody']){_0x58cb03=0x0;while(_0x3a98a7[_0x58cb03]){while((_0x21f73a=_0xf9ac71[_0xed5f('0x7')](_0x3a98a7[_0x58cb03]))!=-0x1){_0x2c1ae3=_0x3a98a7[_0x58cb03];_0x4f941d=_0xf9ac71[_0xed5f('0x8')](0x0,_0x21f73a);_0xf9ac71=_0xf9ac71[_0xed5f('0x8')](_0x21f73a+_0x2c1ae3[_0xed5f('0x9')]);var _0x538a56=_0x4f941d[_0xed5f('0xa')](_0x20a6b9),_0x89a468=0x0,_0x185830={},_0xc738d7='',_0x51b774='',_0x5c138b=-0x1;while(_0x538a56[_0x89a468]){_0x5c138b=_0x538a56[_0x89a468][_0xed5f('0x7')](':');if(_0x5c138b!=-0x1){_0xc738d7=_0x538a56[_0x89a468][_0xed5f('0xb')](0x0,_0x5c138b)[_0xed5f('0xc')]();_0x51b774=_0x538a56[_0x89a468][_0xed5f('0xb')](_0x5c138b+0x1)[_0xed5f('0xc')]();if(_0xc738d7[_0xed5f('0x9')]>0x0){_0x185830[_0xc738d7]=_0x51b774;}}else{}_0x89a468++;}this[_0xed5f('0xd')](_0xed5f('0xe'),_0x185830);this[_0xed5f('0xf')]=!![];}_0x58cb03++;}this[_0xed5f('0x2')]=_0xf9ac71;}else{while((_0x281196=_0xf9ac71[_0xed5f('0x7')](_0x20a6b9))!=-0x1){_0x4f941d=_0xf9ac71[_0xed5f('0x8')](0x0,_0x281196);this['emit'](_0xed5f('0x10'),_0x4f941d);_0xf9ac71=_0xf9ac71[_0xed5f('0x8')](_0x281196+_0x20a6b9[_0xed5f('0x9')]);}this['_localBuffer']=_0xf9ac71;}_0x467a03();};module[_0xed5f('0x11')]=AGIReply;
\ No newline at end of file
+var _0xae7b=['emit','line','exports','util','stream','Transform','_localBuffer','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim'];(function(_0x4c76ad,_0x24bdab){var _0xde0a18=function(_0x575d21){while(--_0x575d21){_0x4c76ad['push'](_0x4c76ad['shift']());}};_0xde0a18(++_0x24bdab);}(_0xae7b,0xbe));var _0xbae7=function(_0x268c4c,_0x5cce8d){_0x268c4c=_0x268c4c-0x0;var _0x37e96e=_0xae7b[_0x268c4c];return _0x37e96e;};'use strict';var util=require(_0xbae7('0x0'));var Transform=require(_0xbae7('0x1'))[_0xbae7('0x2')];function AGIReply(_0x593104){Transform['call'](this,_0x593104);this[_0xbae7('0x3')]='';this[_0xbae7('0x4')]=![];}util[_0xbae7('0x5')](AGIReply,Transform);AGIReply[_0xbae7('0x6')]['_transform']=function(_0x48b6a2,_0x339d6b,_0xb625f6){var _0x163147='\x0a',_0x56c84c=['\x0a\x0a',_0xbae7('0x7')],_0x429316=-0x1,_0x539635=-0x1,_0x228a90='',_0x319b0b=0x0,_0x100e0e='',_0x4dba83='';this['_localBuffer']+=_0x48b6a2[_0xbae7('0x8')]();_0x100e0e=this[_0xbae7('0x3')];if(!this[_0xbae7('0x4')]){_0x319b0b=0x0;while(_0x56c84c[_0x319b0b]){while((_0x539635=_0x100e0e[_0xbae7('0x9')](_0x56c84c[_0x319b0b]))!=-0x1){_0x228a90=_0x56c84c[_0x319b0b];_0x4dba83=_0x100e0e['substring'](0x0,_0x539635);_0x100e0e=_0x100e0e[_0xbae7('0xa')](_0x539635+_0x228a90[_0xbae7('0xb')]);var _0x484906=_0x4dba83['split'](_0x163147),_0x123146=0x0,_0x48af40={},_0x3d17ae='',_0x4090a1='',_0x5b1abe=-0x1;while(_0x484906[_0x123146]){_0x5b1abe=_0x484906[_0x123146][_0xbae7('0x9')](':');if(_0x5b1abe!=-0x1){_0x3d17ae=_0x484906[_0x123146][_0xbae7('0xc')](0x0,_0x5b1abe)[_0xbae7('0xd')]();_0x4090a1=_0x484906[_0x123146][_0xbae7('0xc')](_0x5b1abe+0x1)['trim']();if(_0x3d17ae[_0xbae7('0xb')]>0x0){_0x48af40[_0x3d17ae]=_0x4090a1;}}else{}_0x123146++;}this['emit']('headers',_0x48af40);this[_0xbae7('0x4')]=!![];}_0x319b0b++;}this[_0xbae7('0x3')]=_0x100e0e;}else{while((_0x429316=_0x100e0e[_0xbae7('0x9')](_0x163147))!=-0x1){_0x4dba83=_0x100e0e[_0xbae7('0xa')](0x0,_0x429316);this[_0xbae7('0xe')](_0xbae7('0xf'),_0x4dba83);_0x100e0e=_0x100e0e['substring'](_0x429316+_0x163147[_0xbae7('0xb')]);}this[_0xbae7('0x3')]=_0x100e0e;}_0xb625f6();};module[_0xbae7('0x10')]=AGIReply;
\ No newline at end of file
index f3165db..677ae49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8743=['agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','jayson/promise','http','request','then','error','message','catch','getSquareProjects','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','CloudProvider','name','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','createSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentLogin','agentPause'];(function(_0x2a2a08,_0xe94437){var _0x9d3d37=function(_0x4cdc9a){while(--_0x4cdc9a){_0x2a2a08['push'](_0x2a2a08['shift']());}};_0x9d3d37(++_0xe94437);}(_0x8743,0x7a));var _0x3874=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8743[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3874('0x0'));var moment=require(_0x3874('0x1'));var jayson=require(_0x3874('0x2'));var client=jayson['client'][_0x3874('0x3')]({'port':0x2329});function request(_0x2c398d,_0x4bc542){return new Promise(function(_0x511fe6,_0x35cd1b){return client[_0x3874('0x4')](_0x2c398d,_0x4bc542)[_0x3874('0x5')](function(_0x531cb6){if(_0x531cb6['error']){return _0x35cd1b(_0x531cb6[_0x3874('0x6')][_0x3874('0x7')]);}else{return _0x511fe6(_0x531cb6['result']);}})[_0x3874('0x8')](function(_0x3ecd70){return _0x35cd1b(_0x3ecd70);});});}exports[_0x3874('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x3874('0xa')]=function(_0x5294db){return request(_0x3874('0xb'),{'options':{'raw':![],'where':{'name':_0x5294db},'attributes':[_0x3874('0xc')]}});};exports['getMailAccountById']=function(_0x5017c2){return request(_0x3874('0xd'),{'options':{'raw':![],'where':{'id':_0x5017c2},'include':[{'model':_0x3874('0xe'),'as':_0x3874('0xf'),'include':[{'model':_0x3874('0x10'),'as':_0x3874('0x10')}]}],'attributes':['id',_0x3874('0x11'),'email'],'smtp':!![]}});};exports[_0x3874('0x12')]=function(_0xcaa466){return request(_0x3874('0xb'),{'options':{'where':{'id':_0xcaa466},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x13')]=function(_0xb75788){return request('ShowVoiceQueue',{'options':{'where':{'id':_0xb75788},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x14')]=function(_0x389320){return request(_0x3874('0x15'),{'options':{'where':{'id':_0x389320},'attributes':[_0x3874('0x11')]}});};exports['getSquareOdbcById']=function(_0x2518ef){return request(_0x3874('0x16'),{'options':{'where':{'id':_0x2518ef},'attributes':['dsn']}});};exports[_0x3874('0x17')]=function(_0x121540){return request(_0x3874('0x18'),{'options':{'where':{'id':_0x121540},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x19')]=function(_0x2798ae){return request(_0x3874('0x1a'),{'options':{'where':{'phone':_0x2798ae[_0x3874('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x56b53f){return request(_0x3874('0x1c'),{'options':{'where':{'id':_0x56b53f},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x1d')]=function(_0x2f45bc){return request(_0x3874('0x1e'),{'options':{'where':{'id':_0x2f45bc},'attributes':[_0x3874('0x1f')]}});};exports[_0x3874('0x20')]=function(_0x4be207){return request(_0x3874('0x21'),{'options':{'raw':![],'where':{'id':_0x4be207},'include':[{'model':'Interval','as':_0x3874('0x22')}]}});};exports[_0x3874('0x23')]=function(_0x5c7819){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5c7819},'attributes':['id',_0x3874('0x11')]}});};exports[_0x3874('0x24')]=function(_0x104d3e){return request('CreateSmsMessage',{'body':_0x104d3e});};exports[_0x3874('0x25')]=function(_0x13dfd4){return request('CreateSquareDetailsReport',{'body':_0x13dfd4});};exports[_0x3874('0x26')]=function(_0x2abf25){return request(_0x3874('0x27'),{'body':_[_0x3874('0x28')](_0x2abf25,{'project_name':_0x2abf25[_0x3874('0x29')],'prev_project_name':_0x2abf25[_0x3874('0x2a')]||'','is_subproject':_0x2abf25[_0x3874('0x2a')]?!![]:![],'leaveAt':moment()[_0x3874('0x2b')](_0x3874('0x2c'))})});};exports[_0x3874('0x2d')]=function(_0x51e084){return request(_0x3874('0x2e'),{'body':_0x51e084});};exports[_0x3874('0x2f')]=function(_0x547c3d){return request('CreateSquareMessage',{'body':_0x547c3d});};exports[_0x3874('0x30')]=function(_0x415dc2){return request(_0x3874('0x31'),{'options':{'raw':![],'where':{'phone':_0x415dc2[_0x3874('0x1b')],'ListId':_0x415dc2[_0x3874('0x32')]}}})[_0x3874('0x5')](function(_0x4eb71e){if(_0x4eb71e){return _0x4eb71e;}return request('CreateCmContact',{'body':_0x415dc2});});};exports[_0x3874('0x33')]=function(_0x29d99f){return request(_0x3874('0x34'),{'options':{'where':{'id':_0x29d99f},'attributes':[_0x3874('0x11')]}});};exports[_0x3874('0x35')]=function(_0x2ea0ca,_0x13e6dd){return request('LoginUser',{'body':{'interface':_0x13e6dd},'options':{'where':_0x2ea0ca}});};exports[_0x3874('0x36')]=function(_0x58c1a6,_0x2b8e1f,_0x30cb2c){return request('PauseUser',{'body':{'type':_0x2b8e1f,'uniqueid':_0x30cb2c},'options':{'where':_0x58c1a6}});};exports[_0x3874('0x37')]=function(_0x8b49b8){return request(_0x3874('0x38'),{'body':{},'options':{'where':_0x8b49b8}});};exports[_0x3874('0x39')]=function(_0x54e00b){return request(_0x3874('0x3a'),{'body':{},'options':{'where':_0x54e00b}});};
\ No newline at end of file
+var _0x9221=['email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','dsn','getUserById','getContactByPhone','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','http','request','then','error','result','catch','GetSquareProjects','production','getSquareProject','getMailAccountById','ShowMailAccount','Smtp','CloudProvider','name'];(function(_0x48c23e,_0x5c8409){var _0x4f7aee=function(_0x852640){while(--_0x852640){_0x48c23e['push'](_0x48c23e['shift']());}};_0x4f7aee(++_0x5c8409);}(_0x9221,0x64));var _0x1922=function(_0x5585f5,_0x167771){_0x5585f5=_0x5585f5-0x0;var _0x3439c9=_0x9221[_0x5585f5];return _0x3439c9;};'use strict';var _=require('lodash');var moment=require(_0x1922('0x0'));var jayson=require(_0x1922('0x1'));var client=jayson['client'][_0x1922('0x2')]({'port':0x2329});function request(_0x1099ca,_0x5f14f2){return new Promise(function(_0x309b6b,_0x43c8a3){return client[_0x1922('0x3')](_0x1099ca,_0x5f14f2)[_0x1922('0x4')](function(_0x263f7f){if(_0x263f7f[_0x1922('0x5')]){return _0x43c8a3(_0x263f7f[_0x1922('0x5')]['message']);}else{return _0x309b6b(_0x263f7f[_0x1922('0x6')]);}})[_0x1922('0x7')](function(_0x195fa4){return _0x43c8a3(_0x195fa4);});});}exports['getSquareProjects']=function(){return request(_0x1922('0x8'),{'options':{'raw':![],'attributes':['id','name',_0x1922('0x9')]}});};exports[_0x1922('0xa')]=function(_0x1082d8){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x1082d8},'attributes':[_0x1922('0x9')]}});};exports[_0x1922('0xb')]=function(_0x5c488f){return request(_0x1922('0xc'),{'options':{'raw':![],'where':{'id':_0x5c488f},'include':[{'model':'MailServerOut','as':_0x1922('0xd'),'include':[{'model':'CloudProvider','as':_0x1922('0xe')}]}],'attributes':['id',_0x1922('0xf'),_0x1922('0x10')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x514b6d){return request(_0x1922('0x11'),{'options':{'where':{'id':_0x514b6d},'attributes':[_0x1922('0xf')]}});};exports[_0x1922('0x12')]=function(_0x3116dc){return request(_0x1922('0x13'),{'options':{'where':{'id':_0x3116dc},'attributes':['name']}});};exports[_0x1922('0x14')]=function(_0x4cb94e){return request(_0x1922('0x15'),{'options':{'where':{'id':_0x4cb94e},'attributes':[_0x1922('0xf')]}});};exports[_0x1922('0x16')]=function(_0x207ff4){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x207ff4},'attributes':[_0x1922('0x17')]}});};exports[_0x1922('0x18')]=function(_0x2c9ed9){return request('ShowUser',{'options':{'where':{'id':_0x2c9ed9},'attributes':['name']}});};exports[_0x1922('0x19')]=function(_0x51acda){return request(_0x1922('0x1a'),{'options':{'where':{'phone':_0x51acda[_0x1922('0x1b')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x4c60f8){return request(_0x1922('0x1c'),{'options':{'where':{'id':_0x4c60f8},'attributes':['name']}});};exports[_0x1922('0x1d')]=function(_0x199997){return request(_0x1922('0x1e'),{'options':{'where':{'id':_0x199997},'attributes':[_0x1922('0x1f')]}});};exports['getIntervalById']=function(_0x2f2c49){return request(_0x1922('0x20'),{'options':{'raw':![],'where':{'id':_0x2f2c49},'include':[{'model':_0x1922('0x21'),'as':_0x1922('0x22')}]}});};exports['getSmsAccountById']=function(_0xa5a368){return request(_0x1922('0x23'),{'options':{'where':{'id':_0xa5a368},'attributes':['id',_0x1922('0xf')]}});};exports['createSmsMessage']=function(_0x29b92f){return request('CreateSmsMessage',{'body':_0x29b92f});};exports['createSquareDetailsReport']=function(_0x82372b){return request(_0x1922('0x24'),{'body':_0x82372b});};exports[_0x1922('0x25')]=function(_0x17deb3){return request(_0x1922('0x26'),{'body':_[_0x1922('0x27')](_0x17deb3,{'project_name':_0x17deb3[_0x1922('0x28')],'prev_project_name':_0x17deb3[_0x1922('0x29')]||'','is_subproject':_0x17deb3[_0x1922('0x29')]?!![]:![],'leaveAt':moment()[_0x1922('0x2a')](_0x1922('0x2b'))})});};exports['createSquareRecording']=function(_0x3db249){return request('CreateSquareRecording',{'body':_0x3db249});};exports[_0x1922('0x2c')]=function(_0x43f56c){return request(_0x1922('0x2d'),{'body':_0x43f56c});};exports[_0x1922('0x2e')]=function(_0x1bb708){return request(_0x1922('0x2f'),{'options':{'raw':![],'where':{'phone':_0x1bb708[_0x1922('0x1b')],'ListId':_0x1bb708[_0x1922('0x30')]}}})[_0x1922('0x4')](function(_0x4b0799){if(_0x4b0799){return _0x4b0799;}return request(_0x1922('0x31'),{'body':_0x1bb708});});};exports[_0x1922('0x32')]=function(_0x353c71){return request(_0x1922('0x33'),{'options':{'where':{'id':_0x353c71},'attributes':[_0x1922('0xf')]}});};exports['agentLogin']=function(_0x10f398,_0x39d7d5){return request(_0x1922('0x34'),{'body':{'interface':_0x39d7d5},'options':{'where':_0x10f398}});};exports[_0x1922('0x35')]=function(_0x2a4215,_0x474e85,_0x17a45b){return request('PauseUser',{'body':{'type':_0x474e85,'uniqueid':_0x17a45b},'options':{'where':_0x2a4215}});};exports[_0x1922('0x36')]=function(_0x3f9435){return request(_0x1922('0x37'),{'body':{},'options':{'where':_0x3f9435}});};exports[_0x1922('0x38')]=function(_0x40234e){return request(_0x1922('0x39'),{'body':{},'options':{'where':_0x40234e}});};
\ No newline at end of file
index 2e06af5..06fdb24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe599=['./lex','exports','./polly'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe599,0x1e5));var _0x9e59=function(_0x5a474f,_0x1336ca){_0x5a474f=_0x5a474f-0x0;var _0x58f2bd=_0xe599[_0x5a474f];return _0x58f2bd;};var polly=require(_0x9e59('0x0'));var lex=require(_0x9e59('0x1'));module[_0x9e59('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x7c1a=['./polly','./lex','exports'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x7c1a,0x159));var _0xa7c1=function(_0x59f3c8,_0x269e43){_0x59f3c8=_0x59f3c8-0x0;var _0x320c2f=_0x7c1a[_0x59f3c8];return _0x320c2f;};var polly=require(_0xa7c1('0x0'));var lex=require(_0xa7c1('0x1'));module[_0xa7c1('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 72296e1..4b7c7ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['exports'];(function(_0x3ce522,_0x3b550e){var _0x3cec1a=function(_0x25f50f){while(--_0x25f50f){_0x3ce522['push'](_0x3ce522['shift']());}};_0x3cec1a(++_0x3b550e);}(_0xb688,0xcf));var _0x8b68=function(_0x1f07c9,_0x170120){_0x1f07c9=_0x1f07c9-0x0;var _0x34aaf5=_0xb688[_0x1f07c9];return _0x34aaf5;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);};
\ No newline at end of file
+var _0xd8b0=['exports','./lib/api'];(function(_0x483de0,_0x58b3e1){var _0x72e01c=function(_0x2dbe59){while(--_0x2dbe59){_0x483de0['push'](_0x483de0['shift']());}};_0x72e01c(++_0x58b3e1);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var lex=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]=function(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1){return lex(_0x5a55a3,_0x585166,_0x4b72b0,_0x3ff8df,_0x5b9b89,_0x43bca1);};
\ No newline at end of file
index ee9b83c..f9e6ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x28211a,_0xb8a582){var _0x453aaa=function(_0xa4c76d){while(--_0xa4c76d){_0x28211a['push'](_0x28211a['shift']());}};_0x453aaa(++_0xb8a582);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x51b127,_0x418542){var _0x3dd74d=function(_0xcc4f3b){while(--_0xcc4f3b){_0x51b127['push'](_0x51b127['shift']());}};_0x3dd74d(++_0x418542);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index eb21c84..1dbab38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x438e=['./lib/api'];(function(_0x5ebcc2,_0x7ac56b){var _0xb43585=function(_0x1d999b){while(--_0x1d999b){_0x5ebcc2['push'](_0x5ebcc2['shift']());}};_0xb43585(++_0x7ac56b);}(_0x438e,0xf0));var _0xe438=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x438e[_0x3902c1];return _0x1266cc;};'use strict';var polly=require(_0xe438('0x0'));module['exports']=function(_0x56f09a,_0x505048,_0x517c89,_0x5dc497,_0x18877f,_0x450ad8,_0x4d8015){return polly(_0x56f09a,_0x505048,_0x517c89,_0x5dc497,_0x18877f,_0x450ad8,_0x4d8015);};
\ No newline at end of file
+var _0x4752=['./lib/api','exports'];(function(_0x24502f,_0x134350){var _0x402fd9=function(_0x5e90b2){while(--_0x5e90b2){_0x24502f['push'](_0x24502f['shift']());}};_0x402fd9(++_0x134350);}(_0x4752,0x9c));var _0x2475=function(_0x4a12fd,_0x27c87e){_0x4a12fd=_0x4a12fd-0x0;var _0x50bacd=_0x4752[_0x4a12fd];return _0x50bacd;};'use strict';var polly=require(_0x2475('0x0'));module[_0x2475('0x1')]=function(_0x2e3094,_0xc1a445,_0x99af8b,_0x2a7980,_0x25a073,_0x4014b5,_0x27fdae){return polly(_0x2e3094,_0xc1a445,_0x99af8b,_0x2a7980,_0x25a073,_0x4014b5,_0x27fdae);};
\ No newline at end of file
index 7f80780..fa6e46c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf418=['mp3','path','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf418,0xd0));var _0x8f41=function(_0x267136,_0x249002){_0x267136=_0x267136-0x0;var _0x2b102e=_0xf418[_0x267136];return _0x2b102e;};'use strict';var fs=require('fs');var path=require(_0x8f41('0x0'));var BPromise=require('bluebird');var rs=require(_0x8f41('0x1'));var AWS=require(_0x8f41('0x2'));function pollyResult(_0x1f96a4,_0x51b316,_0x9fb03a){return new BPromise(function(_0xf39878,_0x259976){_0x1f96a4[_0x8f41('0x3')](_0x51b316,function(_0x4d29ab,_0x4083d4){if(_0x4d29ab){_0x259976(_0x4d29ab);}else if(_0x4083d4){if(_0x4083d4['AudioStream']instanceof Buffer){fs[_0x8f41('0x4')](_0x9fb03a,_0x4083d4[_0x8f41('0x5')],function(_0x447c0e){if(_0x447c0e){_0x259976(_0x447c0e);}else{_0xf39878();}});}else{_0x259976(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x259976(new Error(_0x8f41('0x6')));}});});}module['exports']=function(_0x3ae8f8,_0x13545e,_0x338df6,_0xc0c2d0,_0x5b3fda,_0xbb6a9,_0x4ce095){var _0x2973fb=new AWS[(_0x8f41('0x7'))]({'accessKeyId':_0x3ae8f8,'secretAccessKey':_0x13545e,'region':_0x338df6});var _0x3cc893={'Text':_0x5b3fda,'TextType':_0xbb6a9||'text','OutputFormat':_0x8f41('0x8'),'VoiceId':_0xc0c2d0};return pollyResult(_0x2973fb,_0x3cc893,_0x4ce095);};
\ No newline at end of file
+var _0x7b3a=['path','bluebird','randomstring','synthesizeSpeech','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x5a0247,_0x4043d0){var _0x2197c6=function(_0x30dcf6){while(--_0x30dcf6){_0x5a0247['push'](_0x5a0247['shift']());}};_0x2197c6(++_0x4043d0);}(_0x7b3a,0xf0));var _0xa7b3=function(_0xbc641b,_0x2dd133){_0xbc641b=_0xbc641b-0x0;var _0xdbed64=_0x7b3a[_0xbc641b];return _0xdbed64;};'use strict';var fs=require('fs');var path=require(_0xa7b3('0x0'));var BPromise=require(_0xa7b3('0x1'));var rs=require(_0xa7b3('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x37d91c,_0x34a3a4,_0x162e1a){return new BPromise(function(_0x1f2f64,_0x4a73a7){_0x37d91c[_0xa7b3('0x3')](_0x34a3a4,function(_0x35b02b,_0x3d6597){if(_0x35b02b){_0x4a73a7(_0x35b02b);}else if(_0x3d6597){if(_0x3d6597['AudioStream']instanceof Buffer){fs['writeFile'](_0x162e1a,_0x3d6597[_0xa7b3('0x4')],function(_0x513255){if(_0x513255){_0x4a73a7(_0x513255);}else{_0x1f2f64();}});}else{_0x4a73a7(new Error(_0xa7b3('0x5')));}}else{_0x4a73a7(new Error(_0xa7b3('0x6')));}});});}module[_0xa7b3('0x7')]=function(_0x2aebad,_0x4dc99e,_0x59e3f6,_0x224f50,_0x5c4685,_0x33e2cf,_0x6b7fc1){var _0x1d87f9=new AWS[(_0xa7b3('0x8'))]({'accessKeyId':_0x2aebad,'secretAccessKey':_0x4dc99e,'region':_0x59e3f6});var _0xf25ca6={'Text':_0x5c4685,'TextType':_0x33e2cf||_0xa7b3('0x9'),'OutputFormat':'mp3','VoiceId':_0x224f50};return pollyResult(_0x1d87f9,_0xf25ca6,_0x6b7fc1);};
\ No newline at end of file
index 709dac5..04b6ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0x51663d,_0x534aef,_0x191272,_0x4d1399){return asr(_0x51663d,_0x534aef,_0x191272);};
\ No newline at end of file
+'use strict';var asr=require('./lib/api');module['exports']=function(_0x48c43d,_0xebded2,_0x8286fc,_0x3085dd){return asr(_0x48c43d,_0xebded2,_0x8286fc);};
\ No newline at end of file
index cac6875..4b65f53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7119=['base64','POST','LINEAR16','8000','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','readFileSync'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7119,0x1c7));var _0x9711=function(_0x2f36d2,_0x24285c){_0x2f36d2=_0x2f36d2-0x0;var _0x147f7f=_0x7119[_0x2f36d2];return _0x147f7f;};'use strict';var url=require('url');var BPromise=require(_0x9711('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x9711('0x1')]=function(_0x5843e8,_0x347925,_0x443d8f){return new BPromise(function(_0x36cd4d,_0x2de7dd){var _0x47dda0;if(typeof _0x5843e8!==_0x9711('0x2')||_0x5843e8[_0x9711('0x3')]===0x0){return _0x2de7dd(_0x9711('0x4'));}if(typeof _0x347925!==_0x9711('0x2')||_0x347925[_0x9711('0x3')]===0x0){return _0x2de7dd('key\x20should\x20be\x20a\x20string');}if(typeof _0x443d8f!==_0x9711('0x5')&&(typeof _0x443d8f!==_0x9711('0x2')||_0x443d8f[_0x9711('0x3')]===0x0)){return _0x2de7dd('lang\x20should\x20be\x20a\x20string');}try{_0x47dda0=fs[_0x9711('0x6')](_0x5843e8)['toString'](_0x9711('0x7'));}catch(_0x16e820){return _0x2de7dd(_0x16e820);}return _0x36cd4d({'method':_0x9711('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x347925,'body':{'config':{'encoding':_0x9711('0x9'),'sampleRateHertz':_0x9711('0xa'),'languageCode':_0x443d8f},'audio':{'content':_0x47dda0}},'json':!![]});});};
\ No newline at end of file
+var _0xe5b3=['https://speech.googleapis.com','exports','string','length','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe5b3,0x133));var _0x3e5b=function(_0x312aaa,_0x5ace19){_0x312aaa=_0x312aaa-0x0;var _0x478545=_0xe5b3[_0x312aaa];return _0x478545;};'use strict';var url=require('url');var BPromise=require(_0x3e5b('0x0'));var fs=require('fs');var host=_0x3e5b('0x1');module[_0x3e5b('0x2')]=function(_0x1c38ed,_0x2a71ef,_0x3171c5){return new BPromise(function(_0x7f1cc0,_0x1e58ed){var _0x320b1e;if(typeof _0x1c38ed!==_0x3e5b('0x3')||_0x1c38ed[_0x3e5b('0x4')]===0x0){return _0x1e58ed('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x2a71ef!==_0x3e5b('0x3')||_0x2a71ef[_0x3e5b('0x4')]===0x0){return _0x1e58ed('key\x20should\x20be\x20a\x20string');}if(typeof _0x3171c5!==_0x3e5b('0x5')&&(typeof _0x3171c5!==_0x3e5b('0x3')||_0x3171c5[_0x3e5b('0x4')]===0x0)){return _0x1e58ed(_0x3e5b('0x6'));}try{_0x320b1e=fs['readFileSync'](_0x1c38ed)['toString'](_0x3e5b('0x7'));}catch(_0x3d3b6e){return _0x1e58ed(_0x3d3b6e);}return _0x7f1cc0({'method':_0x3e5b('0x8'),'uri':host+_0x3e5b('0x9')+_0x2a71ef,'body':{'config':{'encoding':_0x3e5b('0xa'),'sampleRateHertz':'8000','languageCode':_0x3171c5},'audio':{'content':_0x320b1e}},'json':!![]});});};
\ No newline at end of file
index 5ea50fc..c8a6ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c29=['./asr','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c29,0x17e));var _0x92c2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x2c29[_0x502c7d];return _0x30b7ed;};var asr=require(_0x92c2('0x0'));module[_0x92c2('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xcf59=['./asr'];(function(_0xa6e0ec,_0x107711){var _0xc215c=function(_0x184b89){while(--_0x184b89){_0xa6e0ec['push'](_0xa6e0ec['shift']());}};_0xc215c(++_0x107711);}(_0xcf59,0x122));var _0x9cf5=function(_0x3786dd,_0x5777fc){_0x3786dd=_0x3786dd-0x0;var _0x4c7a8e=_0xcf59[_0x3786dd];return _0x4c7a8e;};var asr=require(_0x9cf5('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 994dc3f..e68eade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70dd=['status','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','length','Dialogflow\x20V2\x20response:','allRequiredParamsPresent','queryResult','diagnosticInfo','fields','fulfillmentText','intent','displayName','queryText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','error','download\x20error','pipe','end','data','transcode','error\x20convert','start','tmp','generate','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','ssml','input','voice','audioConfig','text:synthesize','resolve','.mp3','audioContent','writeFile','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.wav','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','result','source','action','fulfillment'];(function(_0x195be9,_0x3655fc){var _0x476dd1=function(_0x476a39){while(--_0x476a39){_0x195be9['push'](_0x195be9['shift']());}};_0x476dd1(++_0x3655fc);}(_0x70dd,0xa5));var _0xd70d=function(_0x223948,_0x792cf8){_0x223948=_0x223948-0x0;var _0x5193ef=_0x70dd[_0x223948];return _0x5193ef;};'use strict';var apiai=require(_0xd70d('0x0'));var BPromise=require(_0xd70d('0x1'));var dialogflow=require(_0xd70d('0x2'));var fs=require('fs');var http=require(_0xd70d('0x3'));var https=require(_0xd70d('0x4'));var md5=require(_0xd70d('0x5'));var path=require(_0xd70d('0x6'));var querystring=require('querystring');var rp=require(_0xd70d('0x7'));var rs=require('randomstring');var sox=require(_0xd70d('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xd70d('0x9'))[_0xd70d('0xa')];var util=require(_0xd70d('0xb'));var aws=require(_0xd70d('0xc'));var google=require(_0xd70d('0xd'));var sestek=require(_0xd70d('0xe'));var tilde=require(_0xd70d('0xf'));var logger=require(_0xd70d('0x10'))(_0xd70d('0x11'));var ISPEECH_API=_0xd70d('0x12');function downloadFile(_0x299bbf,_0x2308be){return new BPromise(function(_0x52ae23,_0x427754){var _0x5d388c=urlParse(_0x299bbf);var _0x2f1c7a=_0x5d388c[_0xd70d('0x13')]===_0xd70d('0x14')?https:http;var _0x3d74af={'host':_0x5d388c[_0xd70d('0x15')],'path':_0x5d388c['path'],'headers':{'user-agent':_0xd70d('0x16')}};_0x2f1c7a[_0xd70d('0x17')](_0x3d74af,function(_0x2ea8d5){if(_0x2ea8d5[_0xd70d('0x18')]!==0xc8){logger['error'](_0xd70d('0x19')+_0x299bbf+_0xd70d('0x1a')+_0x2ea8d5[_0xd70d('0x18')]+'\x20('+_0x2ea8d5[_0xd70d('0x1b')]+')');_0x427754(new Error('request\x20to\x20'+_0x299bbf+_0xd70d('0x1a')+_0x2ea8d5[_0xd70d('0x18')]+'\x20('+_0x2ea8d5[_0xd70d('0x1b')]+')'));return;}var _0x5c767a=fs['createWriteStream'](_0x2308be);_0x5c767a['on'](_0xd70d('0x1c'),function(){logger[_0xd70d('0x1d')](_0xd70d('0x1e'));_0x5c767a[_0xd70d('0x1f')](_0x52ae23);});_0x5c767a['on'](_0xd70d('0x20'),function(_0x561735){fs['unlink'](_0x2308be);logger['error'](_0xd70d('0x21'),_0x561735);_0x427754(_0x561735);});_0x2ea8d5[_0xd70d('0x22')](_0x5c767a);})['on']('error',function(_0x8d311a){logger['error'](_0x8d311a);_0x427754(_0x8d311a);})[_0xd70d('0x23')]();});}function uploadFile(_0x3a813c){return new BPromise(function(_0x39ae5f,_0x4bcc25){var _0x43c0f1=urlParse(_0x3a813c);var _0x573d7e=_0x43c0f1[_0xd70d('0x13')]===_0xd70d('0x14')?https:http;var _0x59b188={'host':_0x43c0f1[_0xd70d('0x15')],'path':_0x43c0f1[_0xd70d('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x573d7e[_0xd70d('0x17')](_0x59b188,function(_0x52cb70){if(_0x52cb70[_0xd70d('0x18')]!==0xc8){_0x4bcc25(new Error(_0xd70d('0x19')+_0x3a813c+_0xd70d('0x1a')+_0x52cb70[_0xd70d('0x18')]+'\x20('+_0x52cb70['statusMessage']+')'));return;}var _0x25665c='';_0x52cb70['on'](_0xd70d('0x24'),function(_0x40b770){_0x25665c+=_0x40b770;});_0x52cb70['on'](_0xd70d('0x23'),function(){_0x39ae5f(_0x25665c);});})['on'](_0xd70d('0x20'),function(_0xc6c6f5){_0x4bcc25(_0xc6c6f5);})[_0xd70d('0x23')]();});}function convertFile(_0x5dc319,_0x4de068){return new BPromise(function(_0x158c98,_0x353723){var _0x9c8906=sox[_0xd70d('0x25')](_0x5dc319,_0x4de068,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x9c8906['on']('error',function(_0x574a98){logger[_0xd70d('0x20')](_0xd70d('0x26'),_0x574a98);_0x353723(_0x574a98);});_0x9c8906['on'](_0xd70d('0x23'),function(){logger['info']('finish\x20to\x20convert');_0x158c98();});_0x9c8906[_0xd70d('0x27')]();});}function base64Decode(_0x285f60,_0x5b7746){var _0x556597=path['resolve'](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+'.wav');fs[_0xd70d('0x2a')](_0x556597,_0x285f60,_0xd70d('0x2b'));return convertFile(_0x556597,_0x5b7746)[_0xd70d('0x2c')](function(){try{fs[_0xd70d('0x2d')](_0x556597);fs[_0xd70d('0x2e')](_0x5b7746,_0xd70d('0x2f'));}catch(_0x47e885){logger[_0xd70d('0x20')](_0x47e885);}return _0x5b7746[_0xd70d('0x30')]('.')[0x0];});}function base64Encode(_0x1ff75c){var _0x5c4f40=fs[_0xd70d('0x31')](_0x1ff75c);return new Buffer(_0x5c4f40)[_0xd70d('0x32')](_0xd70d('0x2b'));}exports[_0xd70d('0x33')]=function(_0x3d5515,_0x1202e2,_0x115832,_0x1194df,_0x4fb5bc,_0x160d62){var _0x810594,_0x28f9be;var _0x48dd73='https://texttospeech.googleapis.com/v1/';var _0x1bb579=_0xd70d('0x34')+_0x3d5515;var _0x56ce76={};if(_0x1202e2===_0xd70d('0x35')){_0x56ce76[_0xd70d('0x36')]={'ssml':_0x115832};}else{_0x56ce76[_0xd70d('0x36')]={'text':_0x115832};};_0x56ce76[_0xd70d('0x37')]={'languageCode':_0x1194df,'ssmlGender':_0x4fb5bc};_0x56ce76[_0xd70d('0x38')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x29b15b={'url':_0x48dd73+_0xd70d('0x39')+_0x1bb579,'method':'POST','json':!![],'body':_0x56ce76};return rp(_0x29b15b)[_0xd70d('0x2c')](function(_0x5be8cc){return new BPromise(function(_0x23b2a7,_0x371752){_0x810594=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x3b'));var _0x2a2795=Buffer['from'](_0x5be8cc[_0xd70d('0x3c')],_0xd70d('0x2b'));return fs[_0xd70d('0x3d')](_0x810594,_0x2a2795,function(_0x129e4b){_0x371752(_0x129e4b);},function(_0x18584d){fs[_0xd70d('0x2e')](_0x810594,_0xd70d('0x2f'));_0x23b2a7(_0x18584d);});});})[_0xd70d('0x2c')](function(_0x574a0a){_0x28f9be=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+'.wav');return convertFile(_0x810594,_0x28f9be);})[_0xd70d('0x2c')](function(){try{fs[_0xd70d('0x2d')](_0x810594);fs[_0xd70d('0x2e')](_0x28f9be,_0xd70d('0x2f'));}catch(_0x59ef87){logger[_0xd70d('0x20')](_0x59ef87);}logger[_0xd70d('0x1d')]('googleCloudTTS\x20path',_0x28f9be[_0xd70d('0x30')]('.')[0x0]);return _0x28f9be['split']('.')[0x0];});};exports[_0xd70d('0x3e')]=function(_0x51dee4,_0x43a81e){var _0x5ec921=_0xd70d('0x3f');var _0x5342e8,_0x1bbfeb;var _0x596e66;var _0x386bd3={'encoding':_0xd70d('0x40'),'method':_0xd70d('0x41'),'timeout':0x2710,'url':_0x5ec921,'headers':{'Content-Type':_0xd70d('0x42')},'body':_0xd70d('0x43')+encodeURIComponent(JSON['stringify']([[[_0xd70d('0x44'),JSON[_0xd70d('0x45')]([_0x51dee4,_0x43a81e||'en',![],_0xd70d('0x46')]),null,_0xd70d('0x47')]]]))};return rp(_0x386bd3)['then'](function(_0x811aac){try{_0x596e66=eval(_0x811aac['slice'](0x5))[0x0][0x2];}catch(_0x1d454b){throw new Error('parse\x20response\x20failed:\x0a'+_0x811aac[_0xd70d('0x24')]);}if(!_0x596e66){if(_0x51dee4['length']>0xc8){throw new Error(_0xd70d('0x48'));}else{throw new Error(_0xd70d('0x49')+_0x43a81e+_0xd70d('0x4a'));}}try{_0x596e66=eval(_0x596e66)[0x0];}catch(_0x272c2d){throw new Error(_0xd70d('0x4b')+res[_0xd70d('0x24')]);}const _0x12e5e7=_0x596e66;_0x5342e8=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x3b'));fs[_0xd70d('0x2a')](_0x5342e8,_0x596e66,{'encoding':_0xd70d('0x2b')});_0x1bbfeb=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c'));return convertFile(_0x5342e8,_0x1bbfeb);})[_0xd70d('0x2c')](function(){try{fs['unlink'](_0x5342e8);fs[_0xd70d('0x2e')](_0x1bbfeb,_0xd70d('0x2f'));}catch(_0x5c816b){logger[_0xd70d('0x20')](_0x5c816b);}logger[_0xd70d('0x1d')]('goggleTTS\x20path',_0x1bbfeb[_0xd70d('0x30')]('.')[0x0]);return _0x1bbfeb[_0xd70d('0x30')]('.')[0x0];});};exports['googleASR']=function(_0xbc3c8b,_0x436348,_0x4a8b78){return google[_0xd70d('0x4d')](_0xbc3c8b,_0x436348,_0x4a8b78)[_0xd70d('0x2c')](function(_0x4c74ae){logger['info'](_0x4c74ae[_0xd70d('0x4e')]);return rp(_0x4c74ae);})[_0xd70d('0x2c')](function(_0x34b675){var _0x4a91e4='';var _0x40438c=0x0;try{fs[_0xd70d('0x2d')](_0xbc3c8b);}catch(_0x5c78bd){logger[_0xd70d('0x20')](_0x5c78bd);}if(_0x34b675&&_0x34b675[_0xd70d('0x4f')]){_0x4a91e4=_0x34b675[_0xd70d('0x4f')][_0xd70d('0x50')](function(_0x10b41f){return _0x10b41f&&_0x10b41f[_0xd70d('0x51')][0x0]&&_0x10b41f[_0xd70d('0x51')][0x0]['transcript']?_0x10b41f[_0xd70d('0x51')][0x0][_0xd70d('0x52')]:'';})[_0xd70d('0x53')]('\x0a');_0x40438c=_0x34b675[_0xd70d('0x4f')][_0xd70d('0x50')](function(_0x86c817){return _0x86c817&&_0x86c817['alternatives'][0x0]&&_0x86c817[_0xd70d('0x51')][0x0][_0xd70d('0x54')]?_0x86c817[_0xd70d('0x51')][0x0][_0xd70d('0x54')]:0x0;})[_0xd70d('0x53')]('\x0a');}logger[_0xd70d('0x1d')](_0xd70d('0x55'),_0x4a91e4);logger[_0xd70d('0x1d')](_0xd70d('0x56'),_0x40438c);return{'transcript':_0x4a91e4,'confidence':_0x40438c};})[_0xd70d('0x57')](function(_0x47b9a4){logger[_0xd70d('0x20')](_0xd70d('0x58'),_0x47b9a4[_0xd70d('0x18')],_0x47b9a4[_0xd70d('0x59')],_0x47b9a4['message']);});};exports[_0xd70d('0x5a')]=function(_0xbd0428,_0x3b2820,_0x2c8561,_0x4792cf){var _0x12decd=apiai(_0x3b2820,{'language':_0x4792cf||'en'});return _0x12decd['textRequest'](_0x2c8561,{'sessionId':md5(_0xbd0428)})[_0xd70d('0x2c')](function(_0x1f5adb){logger[_0xd70d('0x1d')](JSON[_0xd70d('0x45')](_0x1f5adb));return{'source':_0x1f5adb[_0xd70d('0x5b')][_0xd70d('0x5c')],'resolvedQuery':_0x1f5adb[_0xd70d('0x5b')]['resolvedQuery'],'action':_0x1f5adb['result'][_0xd70d('0x5d')],'actionIncomplete':_0x1f5adb[_0xd70d('0x5b')]['actionIncomplete'],'speech':_0x1f5adb['result'][_0xd70d('0x5e')]['speech'],'score':_0x1f5adb[_0xd70d('0x5b')]['score'],'statusCode':_0x1f5adb[_0xd70d('0x5f')]['code'],'endConversation':_0x1f5adb['result'][_0xd70d('0x60')]['endConversation']||![],'isFallbackIntent':_0x1f5adb['result'][_0xd70d('0x60')][_0xd70d('0x61')]};});};exports[_0xd70d('0x62')]=function(_0x3755fd,_0x4f1ed8,_0x5291a3,_0x57f637,_0x3761b6,_0x191821){var _0x43335f=_0x57f637[_0xd70d('0x63')](/\\n/g,'\x0a');var _0x1af8a4={'credentials':{'private_key':_0x43335f,'client_email':_0x5291a3}};var _0x49eedc=new dialogflow[(_0xd70d('0x64'))](_0x1af8a4);var _0x51a14d=_0x49eedc[_0xd70d('0x65')](_0x4f1ed8,md5(_0x3755fd));var _0x200bd1={'session':_0x51a14d,'queryInput':{'text':{'text':_0x3761b6,'languageCode':_0x191821}}};return _0x49eedc['detectIntent'](_0x200bd1)['then'](function(_0x485a13){if(_0x485a13&&_0x485a13[_0xd70d('0x66')]){logger[_0xd70d('0x1d')](_0xd70d('0x67'),JSON[_0xd70d('0x45')](_0x485a13));var _0x62e5db=_0x485a13[0x0];if(_0x62e5db){var _0x3dd597={'action':_0x62e5db['queryResult'][_0xd70d('0x5d')],'allRequiredParamsPresent':_0x62e5db['queryResult'][_0xd70d('0x68')],'endConversation':_0x62e5db[_0xd70d('0x69')]['diagnosticInfo']&&_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6a')][_0xd70d('0x6b')]?_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6a')][_0xd70d('0x6b')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x62e5db['queryResult'][_0xd70d('0x6c')],'intentName':_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6d')]['name'],'intentDisplayName':_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6d')][_0xd70d('0x6e')],'isFallbackIntent':_0x62e5db['queryResult'][_0xd70d('0x6d')]['isFallback'],'languageCode':_0x62e5db[_0xd70d('0x69')]['languageCode'],'queryText':_0x62e5db[_0xd70d('0x69')][_0xd70d('0x6f')],'responseId':_0x62e5db['responseId'],'score':_0x62e5db[_0xd70d('0x69')]['intentDetectionConfidence'],'speech':_0x62e5db['queryResult'][_0xd70d('0x6c')],'providerResponse':JSON[_0xd70d('0x45')](_0x485a13)};return _0x3dd597;}}});};exports[_0xd70d('0x70')]=function(_0x278493,_0x2b15db,_0x4436cb,_0x2e8490){return tilde['asr'](_0x278493,_0x2b15db,_0x4436cb,_0x2e8490)['then'](function(_0x14c98d){try{fs[_0xd70d('0x2d')](_0x278493);}catch(_0x4f668a){logger[_0xd70d('0x20')](_0x4f668a);}logger[_0xd70d('0x1d')](_0xd70d('0x71'),_0x14c98d['transcript']);logger[_0xd70d('0x1d')]('Tilde\x20ASR\x20confidence',_0x14c98d[_0xd70d('0x54')]);return _0x14c98d;});};exports[_0xd70d('0x72')]=function(_0x15b705,_0x5ef55d,_0x13d05d,_0x2cc207,_0x193d0c,_0x4446a9){var _0x4da3be=path[_0xd70d('0x3a')](__dirname,'tmp',rs[_0xd70d('0x29')](0x4)+'.mp3');var _0x55b3cc;return aws['polly'](_0x15b705,_0x5ef55d,_0x13d05d,_0x2cc207,_0x193d0c,_0x4446a9,_0x4da3be)['then'](function(){_0x55b3cc=path['resolve'](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c'));return convertFile(_0x4da3be,_0x55b3cc);})[_0xd70d('0x2c')](function(){try{fs['unlink'](_0x4da3be);fs[_0xd70d('0x2e')](_0x55b3cc,_0xd70d('0x2f'));}catch(_0x35c5d9){logger[_0xd70d('0x20')](_0x35c5d9);}return _0x55b3cc[_0xd70d('0x30')]('.')[0x0];});};exports['awsLex']=function(_0x1f8df9,_0x16f580,_0x950adb,_0x22513a,_0xc76d34,_0x7174f0){return aws['lex'](_0x1f8df9,_0x16f580,_0x950adb,_0x22513a,_0xc76d34,_0x7174f0)[_0xd70d('0x2c')](function(_0x4d206b){logger[_0xd70d('0x1d')](JSON[_0xd70d('0x45')](_0x4d206b));return _0x4d206b;});};exports['ispeechTTS']=function(_0xf78ce,_0x16706b,_0x27b212,_0x3f7565){var _0x5274aa=util[_0xd70d('0x73')](_0xd70d('0x74'),ISPEECH_API,_0xf78ce,encodeURIComponent(_0x16706b),_0x27b212,_0x3f7565);var _0x250f76=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x3b'));var _0x55b335;return downloadFile(_0x5274aa,_0x250f76)[_0xd70d('0x2c')](function(){_0x55b335=path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c'));return convertFile(_0x250f76,_0x55b335);})[_0xd70d('0x2c')](function(){try{fs['unlink'](_0x250f76);fs[_0xd70d('0x2e')](_0x55b335,_0xd70d('0x2f'));}catch(_0x2329e2){logger[_0xd70d('0x20')](_0x2329e2);}return _0x55b335[_0xd70d('0x30')]('.')[0x0];});};exports[_0xd70d('0x75')]=function(_0x36196a,_0x57687a,_0x5b7e7b,_0x229177){var _0x2af24f=util[_0xd70d('0x73')](_0xd70d('0x76'),ISPEECH_API,_0x57687a,_0x5b7e7b,base64Encode(_0x36196a),_0x229177?util[_0xd70d('0x73')](_0xd70d('0x77'),encodeURIComponent(_0x229177)):'freeform=3');return uploadFile(_0x2af24f)[_0xd70d('0x2c')](function(_0x2f2b02){return querystring[_0xd70d('0xa')](_0x2f2b02);});};exports[_0xd70d('0x78')]=function(_0x1a362c,_0x215828){return sestek[_0xd70d('0x79')](_0x1a362c,_0x215828)[_0xd70d('0x2c')](function(_0x1fbf58){logger[_0xd70d('0x1d')](JSON[_0xd70d('0x45')](_0x1fbf58));var _0x41f963={'speech':_0x1fbf58[_0xd70d('0x7a')],'action':_0x1fbf58[_0xd70d('0x7b')]?_0x1fbf58[_0xd70d('0x7b')][_0xd70d('0x7c')]:undefined,'actiondata':_0x1fbf58[_0xd70d('0x7b')]?_0x1fbf58[_0xd70d('0x7b')][_0xd70d('0x7d')]:undefined};if(_0x1fbf58[_0xd70d('0x7b')]&&_0x1fbf58[_0xd70d('0x7b')][_0xd70d('0x7e')]){return base64Decode(_0x1fbf58['channelData'][_0xd70d('0x7e')][_0xd70d('0x7f')],path[_0xd70d('0x3a')](__dirname,_0xd70d('0x28'),rs[_0xd70d('0x29')](0x4)+_0xd70d('0x4c')))[_0xd70d('0x2c')](function(_0x5cbf31){_0x41f963[_0xd70d('0x80')]=_0x5cbf31;return _0x41f963;});}return _0x41f963;});};exports[_0xd70d('0x81')]=function(){return __dirname;};
\ No newline at end of file
+var _0x0066=['audiofile','dirName','dialogflow','http','https','md5','path','querystring','request-promise','sox','url','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','pipe','end','transcode','error\x20convert','finish\x20to\x20convert','resolve','tmp','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','asr','uri','results','alternatives','transcript','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','action','actionIncomplete','fulfillment','speech','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','ispeechASR','model=%s','freeform=3','nda','text','channelData','CustomAction','AudioFromTts'];(function(_0x45175a,_0x2ab997){var _0x390448=function(_0x12f8f9){while(--_0x12f8f9){_0x45175a['push'](_0x45175a['shift']());}};_0x390448(++_0x2ab997);}(_0x0066,0x1a9));var _0x6006=function(_0xabe9cd,_0x39dda7){_0xabe9cd=_0xabe9cd-0x0;var _0x10cc3d=_0x0066[_0xabe9cd];return _0x10cc3d;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0x6006('0x0'));var fs=require('fs');var http=require(_0x6006('0x1'));var https=require(_0x6006('0x2'));var md5=require(_0x6006('0x3'));var path=require(_0x6006('0x4'));var querystring=require(_0x6006('0x5'));var rp=require(_0x6006('0x6'));var rs=require('randomstring');var sox=require(_0x6006('0x7'));var tts=require('google-tts-api');var urlParse=require(_0x6006('0x8'))[_0x6006('0x9')];var util=require(_0x6006('0xa'));var aws=require(_0x6006('0xb'));var google=require(_0x6006('0xc'));var sestek=require(_0x6006('0xd'));var tilde=require(_0x6006('0xe'));var logger=require('../../../config/logger')(_0x6006('0xf'));var ISPEECH_API=_0x6006('0x10');function downloadFile(_0x6f9897,_0x19cb9c){return new BPromise(function(_0x3304d5,_0x57d535){var _0x4852bc=urlParse(_0x6f9897);var _0xea162c=_0x4852bc[_0x6006('0x11')]===_0x6006('0x12')?https:http;var _0x33a01c={'host':_0x4852bc[_0x6006('0x13')],'path':_0x4852bc['path'],'headers':{'user-agent':_0x6006('0x14')}};_0xea162c[_0x6006('0x15')](_0x33a01c,function(_0x2b97b8){if(_0x2b97b8[_0x6006('0x16')]!==0xc8){logger[_0x6006('0x17')](_0x6006('0x18')+_0x6f9897+_0x6006('0x19')+_0x2b97b8[_0x6006('0x16')]+'\x20('+_0x2b97b8[_0x6006('0x1a')]+')');_0x57d535(new Error(_0x6006('0x18')+_0x6f9897+_0x6006('0x19')+_0x2b97b8[_0x6006('0x16')]+'\x20('+_0x2b97b8[_0x6006('0x1a')]+')'));return;}var _0x587f9b=fs[_0x6006('0x1b')](_0x19cb9c);_0x587f9b['on'](_0x6006('0x1c'),function(){logger[_0x6006('0x1d')](_0x6006('0x1e'));_0x587f9b[_0x6006('0x1f')](_0x3304d5);});_0x587f9b['on'](_0x6006('0x17'),function(_0xf759c7){fs['unlink'](_0x19cb9c);logger[_0x6006('0x17')](_0x6006('0x20'),_0xf759c7);_0x57d535(_0xf759c7);});_0x2b97b8[_0x6006('0x21')](_0x587f9b);})['on'](_0x6006('0x17'),function(_0xfbd90e){logger['error'](_0xfbd90e);_0x57d535(_0xfbd90e);})[_0x6006('0x22')]();});}function uploadFile(_0x2a78e0){return new BPromise(function(_0x5ab1fb,_0x462f06){var _0x3867ad=urlParse(_0x2a78e0);var _0x3db067=_0x3867ad[_0x6006('0x11')]===_0x6006('0x12')?https:http;var _0x42aeef={'host':_0x3867ad['host'],'path':_0x3867ad[_0x6006('0x4')],'headers':{'user-agent':_0x6006('0x14')}};_0x3db067[_0x6006('0x15')](_0x42aeef,function(_0x37f693){if(_0x37f693[_0x6006('0x16')]!==0xc8){_0x462f06(new Error(_0x6006('0x18')+_0x2a78e0+_0x6006('0x19')+_0x37f693[_0x6006('0x16')]+'\x20('+_0x37f693['statusMessage']+')'));return;}var _0x517545='';_0x37f693['on']('data',function(_0x1480bb){_0x517545+=_0x1480bb;});_0x37f693['on'](_0x6006('0x22'),function(){_0x5ab1fb(_0x517545);});})['on'](_0x6006('0x17'),function(_0x29fb9a){_0x462f06(_0x29fb9a);})[_0x6006('0x22')]();});}function convertFile(_0x2fb741,_0x5d9fd0){return new BPromise(function(_0x51a95e,_0x2feade){var _0x123c3b=sox[_0x6006('0x23')](_0x2fb741,_0x5d9fd0,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x123c3b['on'](_0x6006('0x17'),function(_0x415db1){logger[_0x6006('0x17')](_0x6006('0x24'),_0x415db1);_0x2feade(_0x415db1);});_0x123c3b['on']('end',function(){logger[_0x6006('0x1d')](_0x6006('0x25'));_0x51a95e();});_0x123c3b['start']();});}function base64Decode(_0x5645d0,_0x31ffb2){var _0x53f20d=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs['generate'](0x4)+_0x6006('0x28'));fs[_0x6006('0x29')](_0x53f20d,_0x5645d0,_0x6006('0x2a'));return convertFile(_0x53f20d,_0x31ffb2)[_0x6006('0x2b')](function(){try{fs[_0x6006('0x2c')](_0x53f20d);fs[_0x6006('0x2d')](_0x31ffb2,_0x6006('0x2e'));}catch(_0x2408f9){logger[_0x6006('0x17')](_0x2408f9);}return _0x31ffb2[_0x6006('0x2f')]('.')[0x0];});}function base64Encode(_0x18286d){var _0x4a5a06=fs[_0x6006('0x30')](_0x18286d);return new Buffer(_0x4a5a06)[_0x6006('0x31')](_0x6006('0x2a'));}exports[_0x6006('0x32')]=function(_0x213e38,_0x1efca1,_0x4ac7a6,_0x311c8a,_0xe30ec,_0x247be5){var _0x14b456,_0x401d64;var _0x81869=_0x6006('0x33');var _0x451be0=_0x6006('0x34')+_0x213e38;var _0x21d10b={};if(_0x1efca1==='ssml'){_0x21d10b[_0x6006('0x35')]={'ssml':_0x4ac7a6};}else{_0x21d10b[_0x6006('0x35')]={'text':_0x4ac7a6};};_0x21d10b[_0x6006('0x36')]={'languageCode':_0x311c8a,'ssmlGender':_0xe30ec};_0x21d10b[_0x6006('0x37')]={'audioEncoding':_0x6006('0x38'),'sampleRateHertz':0x1f40};var _0xe9127={'url':_0x81869+_0x6006('0x39')+_0x451be0,'method':_0x6006('0x3a'),'json':!![],'body':_0x21d10b};return rp(_0xe9127)[_0x6006('0x2b')](function(_0x1fcc09){return new BPromise(function(_0x1730d8,_0x3314a2){_0x14b456=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));var _0x4ecabb=Buffer[_0x6006('0x3d')](_0x1fcc09[_0x6006('0x3e')],_0x6006('0x2a'));return fs[_0x6006('0x3f')](_0x14b456,_0x4ecabb,function(_0x182a83){_0x3314a2(_0x182a83);},function(_0x38841c){fs[_0x6006('0x2d')](_0x14b456,_0x6006('0x2e'));_0x1730d8(_0x38841c);});});})[_0x6006('0x2b')](function(_0x57217e){_0x401d64=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28'));return convertFile(_0x14b456,_0x401d64);})[_0x6006('0x2b')](function(){try{fs['unlink'](_0x14b456);fs[_0x6006('0x2d')](_0x401d64,'777');}catch(_0x388ee4){logger[_0x6006('0x17')](_0x388ee4);}logger[_0x6006('0x1d')](_0x6006('0x40'),_0x401d64[_0x6006('0x2f')]('.')[0x0]);return _0x401d64[_0x6006('0x2f')]('.')[0x0];});};exports[_0x6006('0x41')]=function(_0x4b3258,_0x53e63a){var _0x2d9253='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x387b33,_0x40eed6;var _0x4b68f6;var _0x16f439={'encoding':_0x6006('0x42'),'method':'POST','timeout':0x2710,'url':_0x2d9253,'headers':{'Content-Type':_0x6006('0x43')},'body':_0x6006('0x44')+encodeURIComponent(JSON['stringify']([[[_0x6006('0x45'),JSON[_0x6006('0x46')]([_0x4b3258,_0x53e63a||'en',![],_0x6006('0x47')]),null,_0x6006('0x48')]]]))};return rp(_0x16f439)[_0x6006('0x2b')](function(_0x43fd54){try{_0x4b68f6=eval(_0x43fd54[_0x6006('0x49')](0x5))[0x0][0x2];}catch(_0x1e2af3){throw new Error(_0x6006('0x4a')+_0x43fd54[_0x6006('0x4b')]);}if(!_0x4b68f6){if(_0x4b3258[_0x6006('0x4c')]>0xc8){throw new Error(_0x6006('0x4d'));}else{throw new Error(_0x6006('0x4e')+_0x53e63a+_0x6006('0x4f'));}}try{_0x4b68f6=eval(_0x4b68f6)[0x0];}catch(_0x36ef22){throw new Error(_0x6006('0x4a')+res[_0x6006('0x4b')]);}const _0x2b479f=_0x4b68f6;_0x387b33=path[_0x6006('0x26')](__dirname,'tmp',rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));fs[_0x6006('0x29')](_0x387b33,_0x4b68f6,{'encoding':_0x6006('0x2a')});_0x40eed6=path[_0x6006('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x6006('0x28'));return convertFile(_0x387b33,_0x40eed6);})[_0x6006('0x2b')](function(){try{fs['unlink'](_0x387b33);fs['chmodSync'](_0x40eed6,_0x6006('0x2e'));}catch(_0x1473dc){logger[_0x6006('0x17')](_0x1473dc);}logger[_0x6006('0x1d')]('goggleTTS\x20path',_0x40eed6[_0x6006('0x2f')]('.')[0x0]);return _0x40eed6[_0x6006('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x1550f5,_0x5407fe,_0x1d5b72){return google[_0x6006('0x50')](_0x1550f5,_0x5407fe,_0x1d5b72)['then'](function(_0x41b56d){logger['info'](_0x41b56d[_0x6006('0x51')]);return rp(_0x41b56d);})[_0x6006('0x2b')](function(_0x3f4c24){var _0x47e9b7='';var _0x341dbe=0x0;try{fs[_0x6006('0x2c')](_0x1550f5);}catch(_0x22beb1){logger[_0x6006('0x17')](_0x22beb1);}if(_0x3f4c24&&_0x3f4c24[_0x6006('0x52')]){_0x47e9b7=_0x3f4c24[_0x6006('0x52')]['map'](function(_0x5e5770){return _0x5e5770&&_0x5e5770[_0x6006('0x53')][0x0]&&_0x5e5770['alternatives'][0x0]['transcript']?_0x5e5770[_0x6006('0x53')][0x0][_0x6006('0x54')]:'';})['join']('\x0a');_0x341dbe=_0x3f4c24[_0x6006('0x52')]['map'](function(_0x318b62){return _0x318b62&&_0x318b62[_0x6006('0x53')][0x0]&&_0x318b62[_0x6006('0x53')][0x0][_0x6006('0x55')]?_0x318b62['alternatives'][0x0][_0x6006('0x55')]:0x0;})[_0x6006('0x56')]('\x0a');}logger[_0x6006('0x1d')](_0x6006('0x57'),_0x47e9b7);logger['info'](_0x6006('0x58'),_0x341dbe);return{'transcript':_0x47e9b7,'confidence':_0x341dbe};})[_0x6006('0x59')](function(_0x2b7056){logger[_0x6006('0x17')](_0x6006('0x5a'),_0x2b7056[_0x6006('0x16')],_0x2b7056[_0x6006('0x5b')],_0x2b7056[_0x6006('0x5c')]);});};exports['googleDialogflow']=function(_0x450a4a,_0x2eca3c,_0x22c679,_0x553f46){var _0x4cd08d=apiai(_0x2eca3c,{'language':_0x553f46||'en'});return _0x4cd08d[_0x6006('0x5d')](_0x22c679,{'sessionId':md5(_0x450a4a)})[_0x6006('0x2b')](function(_0x3074bb){logger[_0x6006('0x1d')](JSON[_0x6006('0x46')](_0x3074bb));return{'source':_0x3074bb['result'][_0x6006('0x5e')],'resolvedQuery':_0x3074bb[_0x6006('0x5f')]['resolvedQuery'],'action':_0x3074bb[_0x6006('0x5f')][_0x6006('0x60')],'actionIncomplete':_0x3074bb[_0x6006('0x5f')][_0x6006('0x61')],'speech':_0x3074bb['result'][_0x6006('0x62')][_0x6006('0x63')],'score':_0x3074bb[_0x6006('0x5f')]['score'],'statusCode':_0x3074bb['status'][_0x6006('0x64')],'endConversation':_0x3074bb['result'][_0x6006('0x65')][_0x6006('0x66')]||![],'isFallbackIntent':_0x3074bb[_0x6006('0x5f')][_0x6006('0x65')][_0x6006('0x67')]};});};exports[_0x6006('0x68')]=function(_0x233244,_0x1011b8,_0x2f155a,_0x2c7841,_0x572ab9,_0x23f731){var _0x46f6d3=_0x2c7841[_0x6006('0x69')](/\\n/g,'\x0a');var _0x1e2936={'credentials':{'private_key':_0x46f6d3,'client_email':_0x2f155a}};var _0x4bf43f=new dialogflow[(_0x6006('0x6a'))](_0x1e2936);var _0x2b7f88=_0x4bf43f[_0x6006('0x6b')](_0x1011b8,md5(_0x233244));var _0x5ae62e={'session':_0x2b7f88,'queryInput':{'text':{'text':_0x572ab9,'languageCode':_0x23f731}}};return _0x4bf43f[_0x6006('0x6c')](_0x5ae62e)[_0x6006('0x2b')](function(_0x1ff994){if(_0x1ff994&&_0x1ff994[_0x6006('0x4c')]){logger[_0x6006('0x1d')](_0x6006('0x6d'),JSON[_0x6006('0x46')](_0x1ff994));var _0x4d95ce=_0x1ff994[0x0];if(_0x4d95ce){var _0x114a6f={'action':_0x4d95ce[_0x6006('0x6e')][_0x6006('0x60')],'allRequiredParamsPresent':_0x4d95ce['queryResult'][_0x6006('0x6f')],'endConversation':_0x4d95ce['queryResult']['diagnosticInfo']&&_0x4d95ce['queryResult'][_0x6006('0x70')][_0x6006('0x71')]?_0x4d95ce[_0x6006('0x6e')][_0x6006('0x70')]['fields'][_0x6006('0x72')][_0x6006('0x73')]:![],'fulfillmentText':_0x4d95ce[_0x6006('0x6e')][_0x6006('0x74')],'intentName':_0x4d95ce['queryResult'][_0x6006('0x75')][_0x6006('0x5b')],'intentDisplayName':_0x4d95ce['queryResult'][_0x6006('0x75')][_0x6006('0x76')],'isFallbackIntent':_0x4d95ce['queryResult']['intent'][_0x6006('0x77')],'languageCode':_0x4d95ce[_0x6006('0x6e')]['languageCode'],'queryText':_0x4d95ce['queryResult'][_0x6006('0x78')],'responseId':_0x4d95ce[_0x6006('0x79')],'score':_0x4d95ce['queryResult'][_0x6006('0x7a')],'speech':_0x4d95ce[_0x6006('0x6e')][_0x6006('0x74')],'providerResponse':JSON[_0x6006('0x46')](_0x1ff994)};return _0x114a6f;}}});};exports[_0x6006('0x7b')]=function(_0x2b13c5,_0xc5b9a2,_0x42ed5b,_0x38b6c9){return tilde['asr'](_0x2b13c5,_0xc5b9a2,_0x42ed5b,_0x38b6c9)[_0x6006('0x2b')](function(_0xe74a23){try{fs[_0x6006('0x2c')](_0x2b13c5);}catch(_0x1ec9bd){logger[_0x6006('0x17')](_0x1ec9bd);}logger['info'](_0x6006('0x7c'),_0xe74a23['transcript']);logger[_0x6006('0x1d')](_0x6006('0x7d'),_0xe74a23[_0x6006('0x55')]);return _0xe74a23;});};exports[_0x6006('0x7e')]=function(_0x2e6c84,_0x8df704,_0x430b1e,_0x1b0239,_0x59a717,_0x54ff4c){var _0x14277f=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));var _0xdb830a;return aws['polly'](_0x2e6c84,_0x8df704,_0x430b1e,_0x1b0239,_0x59a717,_0x54ff4c,_0x14277f)[_0x6006('0x2b')](function(){_0xdb830a=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28'));return convertFile(_0x14277f,_0xdb830a);})['then'](function(){try{fs['unlink'](_0x14277f);fs['chmodSync'](_0xdb830a,_0x6006('0x2e'));}catch(_0x16db60){logger[_0x6006('0x17')](_0x16db60);}return _0xdb830a['split']('.')[0x0];});};exports[_0x6006('0x7f')]=function(_0x201707,_0x21a1e0,_0x9b8c7d,_0x52f1cf,_0x1f22c7,_0x5885b2){return aws[_0x6006('0x80')](_0x201707,_0x21a1e0,_0x9b8c7d,_0x52f1cf,_0x1f22c7,_0x5885b2)[_0x6006('0x2b')](function(_0x28a03f){logger['info'](JSON[_0x6006('0x46')](_0x28a03f));return _0x28a03f;});};exports[_0x6006('0x81')]=function(_0x2d4b25,_0x40d1ba,_0x1eadbe,_0x1636b5){var _0x58222e=util[_0x6006('0x82')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2d4b25,encodeURIComponent(_0x40d1ba),_0x1eadbe,_0x1636b5);var _0x590ffb=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x3c'));var _0x2964e7;return downloadFile(_0x58222e,_0x590ffb)[_0x6006('0x2b')](function(){_0x2964e7=path[_0x6006('0x26')](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28'));return convertFile(_0x590ffb,_0x2964e7);})[_0x6006('0x2b')](function(){try{fs[_0x6006('0x2c')](_0x590ffb);fs[_0x6006('0x2d')](_0x2964e7,_0x6006('0x2e'));}catch(_0x7fd96b){logger[_0x6006('0x17')](_0x7fd96b);}return _0x2964e7[_0x6006('0x2f')]('.')[0x0];});};exports[_0x6006('0x83')]=function(_0x2f3cc6,_0x441672,_0x12c40f,_0x1a9c7e){var _0x168857=util[_0x6006('0x82')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x441672,_0x12c40f,base64Encode(_0x2f3cc6),_0x1a9c7e?util[_0x6006('0x82')](_0x6006('0x84'),encodeURIComponent(_0x1a9c7e)):_0x6006('0x85'));return uploadFile(_0x168857)[_0x6006('0x2b')](function(_0x5a246a){return querystring[_0x6006('0x9')](_0x5a246a);});};exports['sestekNDA']=function(_0x158d91,_0x33b46b){return sestek[_0x6006('0x86')](_0x158d91,_0x33b46b)[_0x6006('0x2b')](function(_0x1cb845){logger[_0x6006('0x1d')](JSON[_0x6006('0x46')](_0x1cb845));var _0x26bd23={'speech':_0x1cb845[_0x6006('0x87')],'action':_0x1cb845[_0x6006('0x88')]?_0x1cb845[_0x6006('0x88')][_0x6006('0x89')]:undefined,'actiondata':_0x1cb845[_0x6006('0x88')]?_0x1cb845['channelData']['CustomActionData']:undefined};if(_0x1cb845['channelData']&&_0x1cb845[_0x6006('0x88')][_0x6006('0x8a')]){return base64Decode(_0x1cb845[_0x6006('0x88')]['AudioFromTts']['Data'],path['resolve'](__dirname,_0x6006('0x27'),rs[_0x6006('0x3b')](0x4)+_0x6006('0x28')))[_0x6006('0x2b')](function(_0xcf72ed){_0x26bd23[_0x6006('0x8b')]=_0xcf72ed;return _0x26bd23;});}return _0x26bd23;});};exports[_0x6006('0x8c')]=function(){return __dirname;};
\ No newline at end of file
index eb9d04c..1f0e518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f2=['exports'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x68f2,0x145));var _0x268f=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x68f2[_0x139a3c];return _0x2b375b;};var nda=require('./nda');module[_0x268f('0x0')]={'nda':nda};
\ No newline at end of file
+var _0x8069=['exports','./nda'];(function(_0x286911,_0x2a5fb6){var _0x47e7e0=function(_0x528af0){while(--_0x528af0){_0x286911['push'](_0x286911['shift']());}};_0x47e7e0(++_0x2a5fb6);}(_0x8069,0x111));var _0x9806=function(_0x4ac100,_0x4f33f1){_0x4ac100=_0x4ac100-0x0;var _0x56bae7=_0x8069[_0x4ac100];return _0x56bae7;};var nda=require(_0x9806('0x0'));module[_0x9806('0x1')]={'nda':nda};
\ No newline at end of file
index f063419..f8b38d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d90=['ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','request-promise','../../../../../config/logger','exports','resolve','ndauth_url','/token','username','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','body','channelData'];(function(_0x88399a,_0x331342){var _0x87af24=function(_0x549907){while(--_0x549907){_0x88399a['push'](_0x88399a['shift']());}};_0x87af24(++_0x331342);}(_0x1d90,0x13e));var _0x01d9=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x1d90[_0x5c2cd5];return _0x5180e9;};'use strict';var rp=require(_0x01d9('0x0'));var url=require('url');var logger=require(_0x01d9('0x1'))('agi');module[_0x01d9('0x2')]=function(_0x5525be,_0x1d6da0){var _0x40b43e={'method':'POST','uri':url[_0x01d9('0x3')](_0x1d6da0[_0x01d9('0x4')],_0x01d9('0x5')),'form':{'grant_type':'password','username':_0x1d6da0[_0x01d9('0x6')],'password':_0x1d6da0[_0x01d9('0x7')]},'json':!![]};return rp(_0x40b43e)[_0x01d9('0x8')](function(_0x598409){var _0xef9d5b={'method':'POST','uri':url['resolve'](_0x1d6da0[_0x01d9('0x9')],_0x01d9('0xa')),'body':{'type':_0x1d6da0[_0x01d9('0xb')]||'message','channelId':_0x01d9('0xc'),'conversation':{'id':_0x5525be[_0x01d9('0xd')]},'from':{'id':_0x5525be[_0x01d9('0xe')],'name':_0x5525be['calleridname']},'recipient':{'id':_0x5525be[_0x01d9('0xf')],'name':_0x5525be[_0x01d9('0x10')]},'text':_0x1d6da0[_0x01d9('0x11')],'channelData':{}},'headers':{'Authorization':_0x01d9('0x12')+_0x598409[_0x01d9('0x13')]},'json':!![]};if(_0x1d6da0[_0x01d9('0x14')]){_0xef9d5b[_0x01d9('0x15')][_0x01d9('0x16')][_0x01d9('0x17')]=_0x1d6da0[_0x01d9('0x14')];}if(_0x1d6da0[_0x01d9('0x18')]=='1'){_0xef9d5b[_0x01d9('0x15')]['channelData'][_0x01d9('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x01d9('0x1a')};}if(_0x1d6da0[_0x01d9('0x1b')]){_0xef9d5b[_0x01d9('0x15')]['channelData'][_0x01d9('0x1c')]=_0x1d6da0[_0x01d9('0x1b')];if(_0x1d6da0[_0x01d9('0x1d')]){_0xef9d5b[_0x01d9('0x15')][_0x01d9('0x16')]['CustomActionData']=_0x1d6da0[_0x01d9('0x1d')];}}logger[_0x01d9('0x1e')](JSON['stringify'](_0xef9d5b));return rp(_0xef9d5b);});};
\ No newline at end of file
+var _0xe706=['ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','text','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','custom_action','info','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','username','then'];(function(_0x909398,_0x2e6d0b){var _0x16e1f3=function(_0x444050){while(--_0x444050){_0x909398['push'](_0x909398['shift']());}};_0x16e1f3(++_0x2e6d0b);}(_0xe706,0xa3));var _0x6e70=function(_0x540c04,_0x4c1e2f){_0x540c04=_0x540c04-0x0;var _0x5bcb58=_0xe706[_0x540c04];return _0x5bcb58;};'use strict';var rp=require(_0x6e70('0x0'));var url=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('agi');module[_0x6e70('0x3')]=function(_0x315629,_0x2ca810){var _0x7dfbc3={'method':_0x6e70('0x4'),'uri':url[_0x6e70('0x5')](_0x2ca810[_0x6e70('0x6')],_0x6e70('0x7')),'form':{'grant_type':_0x6e70('0x8'),'username':_0x2ca810[_0x6e70('0x9')],'password':_0x2ca810[_0x6e70('0x8')]},'json':!![]};return rp(_0x7dfbc3)[_0x6e70('0xa')](function(_0x45a2d4){var _0x188ed3={'method':_0x6e70('0x4'),'uri':url[_0x6e70('0x5')](_0x2ca810[_0x6e70('0xb')],_0x6e70('0xc')),'body':{'type':_0x2ca810[_0x6e70('0xd')]||_0x6e70('0xe'),'channelId':_0x6e70('0xf'),'conversation':{'id':_0x315629[_0x6e70('0x10')]},'from':{'id':_0x315629[_0x6e70('0x11')],'name':_0x315629[_0x6e70('0x12')]},'recipient':{'id':_0x315629['dnid'],'name':_0x315629['extension']},'text':_0x2ca810[_0x6e70('0x13')],'channelData':{}},'headers':{'Authorization':_0x6e70('0x14')+_0x45a2d4[_0x6e70('0x15')]},'json':!![]};if(_0x2ca810[_0x6e70('0x16')]){_0x188ed3[_0x6e70('0x17')][_0x6e70('0x18')][_0x6e70('0x19')]=_0x2ca810[_0x6e70('0x16')];}if(_0x2ca810['ndagenerate_audio']=='1'){_0x188ed3['body']['channelData'][_0x6e70('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x2ca810['custom_action']){_0x188ed3[_0x6e70('0x17')][_0x6e70('0x18')]['CustomAction']=_0x2ca810[_0x6e70('0x1b')];if(_0x2ca810['custom_action_data']){_0x188ed3[_0x6e70('0x17')][_0x6e70('0x18')]['CustomActionData']=_0x2ca810['custom_action_data'];}}logger[_0x6e70('0x1c')](JSON['stringify'](_0x188ed3));return rp(_0x188ed3);});};
\ No newline at end of file
index ccb16ba..f1b4132 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5476=['exports','./lib/api'];(function(_0x56c0cf,_0x14262f){var _0x2c8b9e=function(_0x1bacb0){while(--_0x1bacb0){_0x56c0cf['push'](_0x56c0cf['shift']());}};_0x2c8b9e(++_0x14262f);}(_0x5476,0x13f));var _0x6547=function(_0x3bc9ff,_0x2c1c2d){_0x3bc9ff=_0x3bc9ff-0x0;var _0x2cad4e=_0x5476[_0x3bc9ff];return _0x2cad4e;};'use strict';var asr=require(_0x6547('0x0'));module[_0x6547('0x1')]=function(_0x5e3882,_0x40b235,_0x4dc8a1,_0x4976ef){return asr(_0x5e3882,_0x40b235,_0x4dc8a1,_0x4976ef);};
\ No newline at end of file
+var _0xdd56=['./lib/api','exports'];(function(_0x448b5b,_0x8b12ae){var _0x590391=function(_0x425325){while(--_0x425325){_0x448b5b['push'](_0x448b5b['shift']());}};_0x590391(++_0x8b12ae);}(_0xdd56,0xf4));var _0x6dd5=function(_0xad56c9,_0x10f723){_0xad56c9=_0xad56c9-0x0;var _0x4838a2=_0xdd56[_0xad56c9];return _0x4838a2;};'use strict';var asr=require(_0x6dd5('0x0'));module[_0x6dd5('0x1')]=function(_0x131eb3,_0x8e04e7,_0x5a424d,_0x3c0d62){return asr(_0x131eb3,_0x8e04e7,_0x5a424d,_0x3c0d62);};
\ No newline at end of file
index aab0d16..7fd4d41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x329b=['Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','close','bluebird','crypto','../../../../../../config/logger','agi','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','hex','Open\x20Tilde\x20ASR\x20socket','send','stringify','createReadStream','data','EOS'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x329b,0xf8));var _0xb329=function(_0x4fa4fd,_0x4c656b){_0x4fa4fd=_0x4fa4fd-0x0;var _0x3c50d0=_0x329b[_0x4fa4fd];return _0x3c50d0;};'use strict';var BPromise=require(_0xb329('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xb329('0x1'));var logger=require(_0xb329('0x2'))(_0xb329('0x3'));module['exports']=function(_0x25cc94,_0x492ab7,_0x41a0b8,_0x320361){return new BPromise(function(_0x42fc77,_0x4dc5ef){logger[_0xb329('0x4')](_0xb329('0x5'),_0x320361||_0xb329('0x6'));var _0x4380bd=new WebSocket(_0x320361||_0xb329('0x6'),{'perMessageDeflate':![]});var _0x358f84='';var _0x5b1896='0';var _0x11cf92='1';var _0xb93733=_0xb329('0x7');function _0x4aabeb(_0x3ebd1b){var _0x508fa4=crypto['createHash']('sha1');_0x508fa4[_0xb329('0x8')](_0x3ebd1b);return _0x508fa4['digest'](_0xb329('0x9'));}function _0x293398(){try{logger[_0xb329('0x4')](_0xb329('0xa'));var _0x9bb736=moment()['unix']();var _0xaa12d2=_0x4aabeb(_0x9bb736+_0x492ab7+_0x41a0b8);_0x4380bd[_0xb329('0xb')](JSON[_0xb329('0xc')]({'appID':_0x492ab7,'timestamp':_0x9bb736,'appKey':_0xaa12d2}));var _0x287b60=fs[_0xb329('0xd')](_0x25cc94);_0x287b60['on'](_0xb329('0xe'),function(_0x55fbd9){_0x4380bd[_0xb329('0xb')](_0x55fbd9);});_0x287b60['on']('close',function(){_0x4380bd[_0xb329('0xb')](_0xb329('0xf'));});}catch(_0x4a3c22){logger['error'](_0xb329('0x10'),JSON['stringify'](_0x4a3c22));_0x4380bd[_0xb329('0x11')]();}}function _0x381d3e(_0x271263){try{if(_0x271263){var _0x5ebddd=JSON[_0xb329('0x12')](_0x271263);switch(_0x5ebddd[_0xb329('0x13')]){case 0x0:if(_0x5ebddd[_0xb329('0x14')]){if(_0x5ebddd['result'][_0xb329('0x15')]){logger[_0xb329('0x4')](_0xb329('0x16'),JSON[_0xb329('0xc')](_0x5ebddd[_0xb329('0x14')]['hypotheses']));_0x358f84=_0x5ebddd[_0xb329('0x14')][_0xb329('0x17')][0x0]['transcript'];_0x5b1896=_0x5ebddd[_0xb329('0x14')][_0xb329('0x17')][0x0][_0xb329('0x18')];_0x11cf92='0';_0xb93733='Success.';_0x4380bd[_0xb329('0x11')]();}}break;case 0x1:logger[_0xb329('0x4')](_0xb329('0x7'));_0x11cf92='1';_0xb93733=_0xb329('0x7');break;case 0x2:logger[_0xb329('0x4')](_0xb329('0x19'));_0x11cf92='2';_0xb93733=_0xb329('0x19');break;case 0x9:logger[_0xb329('0x4')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x11cf92='9';_0xb93733='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xb329('0x4')]('Authentication\x20failed.');_0x11cf92='10';_0xb93733=_0xb329('0x1a');break;case 0xb:logger[_0xb329('0x4')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x11cf92='11';_0xb93733='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x5536fa){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xb329('0xc')](_0x5536fa));_0x4380bd[_0xb329('0x11')]();}}function _0x3cd92a(){logger[_0xb329('0x4')](_0xb329('0x1b'));_0x42fc77({'transcript':_0x358f84,'confidence':_0x5b1896,'status':_0x11cf92,'status_message':_0xb93733});}function _0x8532bb(_0xc3f6a8){logger[_0xb329('0x1c')](_0xb329('0x1d'));if(!_[_0xb329('0x1e')](_0xc3f6a8)){logger[_0xb329('0x1c')](_[_0xb329('0x1f')](_0xc3f6a8)?JSON[_0xb329('0xc')](_0xc3f6a8):_0xc3f6a8);}}_0x4380bd['on']('open',_0x293398);_0x4380bd['on']('message',_0x381d3e);_0x4380bd['on'](_0xb329('0x20'),_0x3cd92a);_0x4380bd['on'](_0xb329('0x1c'),_0x8532bb);});};
\ No newline at end of file
+var _0x5d92=['parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','lodash','moment','crypto','../../../../../../config/logger','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','hex','info','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate'];(function(_0x5a160a,_0x2a5bb8){var _0x491362=function(_0x3e30b4){while(--_0x3e30b4){_0x5a160a['push'](_0x5a160a['shift']());}};_0x491362(++_0x2a5bb8);}(_0x5d92,0xc7));var _0x25d9=function(_0xf2d08a,_0x4a20ee){_0xf2d08a=_0xf2d08a-0x0;var _0x43464e=_0x5d92[_0xf2d08a];return _0x43464e;};'use strict';var BPromise=require('bluebird');var _=require(_0x25d9('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x25d9('0x1'));var crypto=require(_0x25d9('0x2'));var logger=require(_0x25d9('0x3'))('agi');module[_0x25d9('0x4')]=function(_0x3767e8,_0x41c28f,_0x573fc2,_0x412eae){return new BPromise(function(_0x13c1c4,_0x59889c){logger['info'](_0x25d9('0x5'),_0x412eae||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x48d1af=new WebSocket(_0x412eae||_0x25d9('0x6'),{'perMessageDeflate':![]});var _0x102386='';var _0x48a34c='0';var _0x1650f2='1';var _0x3754bd=_0x25d9('0x7');function _0x38c4b5(_0x24dafa){var _0x295c67=crypto['createHash'](_0x25d9('0x8'));_0x295c67[_0x25d9('0x9')](_0x24dafa);return _0x295c67[_0x25d9('0xa')](_0x25d9('0xb'));}function _0x5b122d(){try{logger[_0x25d9('0xc')]('Open\x20Tilde\x20ASR\x20socket');var _0x40f7da=moment()[_0x25d9('0xd')]();var _0x4ee872=_0x38c4b5(_0x40f7da+_0x41c28f+_0x573fc2);_0x48d1af['send'](JSON[_0x25d9('0xe')]({'appID':_0x41c28f,'timestamp':_0x40f7da,'appKey':_0x4ee872}));var _0x108030=fs[_0x25d9('0xf')](_0x3767e8);_0x108030['on'](_0x25d9('0x10'),function(_0x29641e){_0x48d1af[_0x25d9('0x11')](_0x29641e);});_0x108030['on'](_0x25d9('0x12'),function(){_0x48d1af['send'](_0x25d9('0x13'));});}catch(_0x3be3a8){logger[_0x25d9('0x14')](_0x25d9('0x15'),JSON[_0x25d9('0xe')](_0x3be3a8));_0x48d1af[_0x25d9('0x16')]();}}function _0x109e4b(_0x3ccb99){try{if(_0x3ccb99){var _0x92a637=JSON[_0x25d9('0x17')](_0x3ccb99);switch(_0x92a637['status']){case 0x0:if(_0x92a637[_0x25d9('0x18')]){if(_0x92a637[_0x25d9('0x18')][_0x25d9('0x19')]){logger[_0x25d9('0xc')](_0x25d9('0x1a'),JSON[_0x25d9('0xe')](_0x92a637[_0x25d9('0x18')]['hypotheses']));_0x102386=_0x92a637[_0x25d9('0x18')][_0x25d9('0x1b')][0x0]['transcript'];_0x48a34c=_0x92a637['result'][_0x25d9('0x1b')][0x0][_0x25d9('0x1c')];_0x1650f2='0';_0x3754bd=_0x25d9('0x1d');_0x48d1af['terminate']();}}break;case 0x1:logger['info'](_0x25d9('0x7'));_0x1650f2='1';_0x3754bd=_0x25d9('0x7');break;case 0x2:logger['info'](_0x25d9('0x1e'));_0x1650f2='2';_0x3754bd=_0x25d9('0x1e');break;case 0x9:logger[_0x25d9('0xc')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x1650f2='9';_0x3754bd=_0x25d9('0x1f');break;case 0xa:logger[_0x25d9('0xc')]('Authentication\x20failed.');_0x1650f2='10';_0x3754bd=_0x25d9('0x20');break;case 0xb:logger[_0x25d9('0xc')](_0x25d9('0x21'));_0x1650f2='11';_0x3754bd=_0x25d9('0x21');}}}catch(_0xb04350){logger[_0x25d9('0x14')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x25d9('0xe')](_0xb04350));_0x48d1af[_0x25d9('0x16')]();}}function _0x26698d(){logger['info'](_0x25d9('0x22'));_0x13c1c4({'transcript':_0x102386,'confidence':_0x48a34c,'status':_0x1650f2,'status_message':_0x3754bd});}function _0x173c3a(_0x31b1a3){logger['error'](_0x25d9('0x23'));if(!_['isNil'](_0x31b1a3)){logger[_0x25d9('0x14')](_[_0x25d9('0x24')](_0x31b1a3)?JSON[_0x25d9('0xe')](_0x31b1a3):_0x31b1a3);}}_0x48d1af['on']('open',_0x5b122d);_0x48d1af['on']('message',_0x109e4b);_0x48d1af['on'](_0x25d9('0x12'),_0x26698d);_0x48d1af['on'](_0x25d9('0x14'),_0x173c3a);});};
\ No newline at end of file
index f6702a1..86ba7ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8df7=['./asr'];(function(_0x1b8063,_0x274b41){var _0x529a24=function(_0x18e90e){while(--_0x18e90e){_0x1b8063['push'](_0x1b8063['shift']());}};_0x529a24(++_0x274b41);}(_0x8df7,0x1ba));var _0x78df=function(_0x277e5e,_0x4a0bfc){_0x277e5e=_0x277e5e-0x0;var _0x1bc0f0=_0x8df7[_0x277e5e];return _0x1bc0f0;};var asr=require(_0x78df('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
+var _0xd6a1=['./asr','exports'];(function(_0x1711e0,_0x645432){var _0x186f71=function(_0x32030a){while(--_0x32030a){_0x1711e0['push'](_0x1711e0['shift']());}};_0x186f71(++_0x645432);}(_0xd6a1,0x16a));var _0x1d6a=function(_0x299471,_0x297ba4){_0x299471=_0x299471-0x0;var _0x52b1e1=_0xd6a1[_0x299471];return _0x52b1e1;};var asr=require(_0x1d6a('0x0'));module[_0x1d6a('0x1')]={'asr':asr};
\ No newline at end of file
index 7a9e90f..e315e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0x4d150a,_0x25f904){var _0x885bd4=function(_0x552a7d){while(--_0x552a7d){_0x4d150a['push'](_0x4d150a['shift']());}};_0x885bd4(++_0x25f904);}(_0x34e8,0x12c));var _0x834e=function(_0x1a6b43,_0x597ba7){_0x1a6b43=_0x1a6b43-0x0;var _0xfb59c8=_0x34e8[_0x1a6b43];return _0xfb59c8;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);};
\ No newline at end of file
+var _0x34e8=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','call','emit','error'];(function(_0xebc72a,_0x5a55c5){var _0x441d7d=function(_0x8a1eaf){while(--_0x8a1eaf){_0xebc72a['push'](_0xebc72a['shift']());}};_0x441d7d(++_0x5a55c5);}(_0x34e8,0x12c));var _0x834e=function(_0x85bfa6,_0x15c451){_0x85bfa6=_0x85bfa6-0x0;var _0x34b064=_0x34e8[_0x85bfa6];return _0x34b064;};'use strict';var util=require(_0x834e('0x0'));var net=require(_0x834e('0x1'));var EventEmitter=require(_0x834e('0x2'))[_0x834e('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x834e('0x4'));var AGIServer=function(_0x21e2e0,_0x472111,_0x31bf20){var _0x289ef2=this;var _0x19a3e0=null;var _0x398bee=0x0;if(!_0x21e2e0)_0x21e2e0=0x11dd;if(!_0x472111)_0x472111='127.0.0.1';EventEmitter[_0x834e('0x5')](_0x289ef2);function _0x52056d(){if(!_0x21e2e0){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0x8')));return![];}_0x19a3e0=net[_0x834e('0x9')]();_0x19a3e0[_0x834e('0xa')](_0x21e2e0,_0x472111);_0x19a3e0['on'](_0x834e('0xb'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xb'));});_0x19a3e0['on'](_0x834e('0xc'),function(_0x186b3b){_0x19a3e0[_0x834e('0xd')](function(_0x36e124,_0x14038b){if(_0x36e124){_0x289ef2[_0x834e('0x6')](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x36e124));}else if(_0x31bf20&&_0x31bf20<0x0){_0x289ef2[_0x834e('0x6')]('error',new AGIError(_0x834e('0xf')));_0x186b3b[_0x834e('0x10')]();}else if(_0x31bf20&&_0x31bf20>0x0&&_0x31bf20<_0x14038b){_0x398bee+=0x1;_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0x11'),_0x398bee));_0x186b3b[_0x834e('0x10')]();}else{var _0x21cc0a=new AGIChannel(_0x186b3b);_0x21cc0a['on']('ready',function(){_0x289ef2[_0x834e('0x6')](_0x834e('0xc'),_0x21cc0a);});}});});_0x19a3e0['on']('error',function(_0x316205){_0x289ef2['emit'](_0x834e('0x7'),new AGIError(_0x834e('0xe'),_0x316205['code']));});_0x19a3e0['on'](_0x834e('0x12'),function(){_0x289ef2[_0x834e('0x6')](_0x834e('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x834e('0x13')](function(){_0x52056d();});};util[_0x834e('0x14')](AGIServer,EventEmitter);module[_0x834e('0x15')]=function(_0xb993a1,_0x237947,_0x254677){return new AGIServer(_0xb993a1,_0x237947,_0x254677);};
\ No newline at end of file
index e6723d3..807f2fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c32=['restAPI','url','method','timeout','number','includes','PUT','toUpperCase','body','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','parse','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','split','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','no\x20key\x20configured','bot','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','private_key','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','variable_id','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','math','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','failure','playback','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','getMailAccount','account_id','Smtp','no\x20mail\x20account\x20found','email','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','host','AGI','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','voicemail','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','request-promise','../../config/logger','../../config/environment','./scripts','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','then','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUser','getTrunk','getSound','getSoundById','getMailAccountById','sendMailMessage','getIntervals','interval','map','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','arg_1','file','createSquareMessage','createCmContact','isEmpty','callback_','lastName','isNil','phone','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','google_tts_language'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x9c32,0x15d));var _0x29c3=function(_0x375a67,_0x3e678a){_0x375a67=_0x375a67-0x0;var _0x1138ab=_0x9c32[_0x375a67];return _0x1138ab;};'use strict';var fs=require('fs');var util=require(_0x29c3('0x0'));var _=require(_0x29c3('0x1'));var sh=require(_0x29c3('0x2'));var odbc=require('odbc')();var rs=require(_0x29c3('0x3'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x29c3('0x4'));var logger=require(_0x29c3('0x5'))('agi');var config=require(_0x29c3('0x6'));var shared=require('../../config/environment/shared');var scripts=require(_0x29c3('0x7'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x29c3('0x8')];var verticesWithRetry=[_0x29c3('0x9'),_0x29c3('0xa'),'getsecretdigits'];var AGIVertices=function(_0x4fdba0,_0x480f7b,_0x1e9797){this[_0x29c3('0xb')]=_0x4fdba0;this[_0x29c3('0xc')]=_0x480f7b;this[_0x29c3('0xd')]=_0x1e9797;};AGIVertices[_0x29c3('0xe')][_0x29c3('0xf')]=function(_0xb8345f,_0xa666cf){this[_0x29c3('0xc')][_0x29c3('0x10')](_0xb8345f)['then'](function(_0x3dfaa5){_0xa666cf(null,_0x3dfaa5?_0x3dfaa5[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x17eaae){_0xa666cf(_0x17eaae);});};AGIVertices[_0x29c3('0xe')]['getVoiceQueue']=function(_0x5c0e60,_0x49453d){this[_0x29c3('0xc')]['getVoiceQueueById'](_0x5c0e60)[_0x29c3('0x13')](function(_0x2312a9){_0x49453d(null,_0x2312a9?_0x2312a9[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x4314a){_0x49453d(_0x4314a);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x14')]=function(_0x46bf7e,_0x15d85b){this['rpc'][_0x29c3('0x15')](_0x46bf7e)[_0x29c3('0x13')](function(_0x5570dd){_0x15d85b(null,_0x5570dd?_0x5570dd[_0x29c3('0x11')]:![]);})['catch'](function(_0x23e4ce){_0x15d85b(_0x23e4ce);});};AGIVertices['prototype'][_0x29c3('0x16')]=function(_0x1a5ae6,_0x5937aa){this[_0x29c3('0xc')][_0x29c3('0x17')](_0x1a5ae6)[_0x29c3('0x13')](function(_0x2bbe49){_0x5937aa(null,_0x2bbe49?_0x2bbe49['dsn']:![]);})[_0x29c3('0x12')](function(_0x5843da){_0x5937aa(_0x5843da);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x18')]=function(_0x25ae6a,_0x1e4ae9){this['rpc']['getUserById'](_0x25ae6a)[_0x29c3('0x13')](function(_0x220059){_0x1e4ae9(null,_0x220059?_0x220059[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x4016ff){_0x1e4ae9(_0x4016ff);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x19')]=function(_0x4d048f,_0xbb6330){this[_0x29c3('0xc')]['getTrunkById'](_0x4d048f)['then'](function(_0x53cf8b){_0xbb6330(null,_0x53cf8b?_0x53cf8b['name']:![]);})[_0x29c3('0x12')](function(_0x2d7905){_0xbb6330(_0x2d7905);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1a')]=function(_0x2736c9,_0x25fed2){var _0x471e2b=this;this[_0x29c3('0xc')][_0x29c3('0x1b')](_0x2736c9)[_0x29c3('0x13')](function(_0x2c02cc){_0x25fed2(null,_0x2c02cc?_0x471e2b['getSoundPath'](_0x2c02cc['save_name']):![]);})[_0x29c3('0x12')](function(_0x4a425a){_0x25fed2(_0x4a425a);});};AGIVertices[_0x29c3('0xe')]['getMailAccount']=function(_0x277d7c,_0x4baad6){this[_0x29c3('0xc')][_0x29c3('0x1c')](_0x277d7c)[_0x29c3('0x13')](function(_0x3e0ef4){_0x4baad6(null,_0x3e0ef4?_0x3e0ef4:![]);})[_0x29c3('0x12')](function(_0x169fe0){_0x4baad6(_0x169fe0);});};AGIVertices[_0x29c3('0xe')]['sendMailMessage']=function(_0x3a94c1,_0x3a26e6,_0x5cd6fc){this['mailRpc'][_0x29c3('0x1d')](_0x3a94c1,_0x3a26e6)[_0x29c3('0x13')](function(){_0x5cd6fc(null);})[_0x29c3('0x12')](function(_0x5d460b){_0x5cd6fc(_0x5d460b);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1e')]=function(_0x5e61e7,_0x3c73cf){this[_0x29c3('0xc')]['getIntervalById'](_0x5e61e7)[_0x29c3('0x13')](function(_0x4eea80){if(_0x4eea80){if(_0x4eea80['IntervalId']){_0x3c73cf(null,[_0x4eea80[_0x29c3('0x1f')]]);}else{_0x3c73cf(null,_[_0x29c3('0x20')](_0x4eea80[_0x29c3('0x21')],_0x29c3('0x1f')));}}else{_0x3c73cf(null,![]);}})[_0x29c3('0x12')](function(_0x48adc5){_0x3c73cf(_0x48adc5);});};AGIVertices['prototype']['getSoundPath']=function(_0xbd8816){return util[_0x29c3('0x22')]('%s/sounds/converted/%s',FILES_PATH,_0xbd8816);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x23')]=function(_0x4af7c0,_0x455ce8,_0x37c2bc){odbc[_0x29c3('0x24')](_0x4af7c0,function(_0x770918){if(_0x770918){logger[_0x29c3('0x25')](_0x29c3('0x26'),_0x770918);_0x37c2bc(_0x770918);}else{logger[_0x29c3('0x27')](_0x29c3('0x28'));odbc[_0x29c3('0x29')](_0x455ce8,function(_0x1b272e,_0x1ae855){if(_0x1b272e){logger[_0x29c3('0x27')](_0x29c3('0x2a'),_0x455ce8);_0x37c2bc(_0x1b272e);}else{logger[_0x29c3('0x27')](_0x29c3('0x2b'),_0x455ce8);odbc['close'](function(_0x5886f6){if(_0x5886f6){logger['error'](_0x29c3('0x2c'),_0x5886f6);}_0x37c2bc(null,_0x1ae855);});}});}});};AGIVertices[_0x29c3('0xe')]['getSmsAccount']=function(_0x4b9633,_0xff5466){this[_0x29c3('0xc')]['getSmsAccountById'](_0x4b9633)['then'](function(_0x19388a){_0xff5466(null,_0x19388a?_0x19388a:![]);})[_0x29c3('0x12')](function(_0x43beb4){_0xff5466(_0x43beb4);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x2d')]=function(_0x480397,_0x48330b){this[_0x29c3('0xc')]['createSmsMessage'](_0x480397)[_0x29c3('0x13')](function(_0x255ec5){_0x48330b(null,_0x255ec5);})[_0x29c3('0x12')](function(_0x117976){_0x48330b(_0x117976);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x2e')]=function(_0x482ee1,_0x1c7422,_0x4c2687){this[_0x29c3('0xc')][_0x29c3('0x2e')]({'uniqueid':this[_0x29c3('0xb')]['uniqueid'],'node':_0x482ee1[_0x29c3('0x2f')],'application':_0x482ee1[_0x29c3('0x30')],'data':_0x1c7422||null,'project_name':this[_0x29c3('0xb')]['arg_1'],'callerid':this[_0x29c3('0xb')][_0x29c3('0x31')]})['then'](function(_0x5b3b40){if(_0x4c2687){_0x4c2687(null,_0x5b3b40);}})[_0x29c3('0x12')](function(_0x49764b){if(_0x4c2687){_0x4c2687(_0x49764b);}});};AGIVertices[_0x29c3('0xe')]['createSquareRecording']=function(_0xe306de,_0x374ea1,_0x2a674a,_0x2d1084){this[_0x29c3('0xc')][_0x29c3('0x32')]({'uniqueid':this[_0x29c3('0xb')][_0x29c3('0x33')],'callerid':this[_0x29c3('0xb')][_0x29c3('0x31')],'calleridname':this[_0x29c3('0xb')][_0x29c3('0x34')],'context':this[_0x29c3('0xb')][_0x29c3('0x35')],'extension':this[_0x29c3('0xb')][_0x29c3('0x36')],'priority':this['channel'][_0x29c3('0x37')],'accountcode':this[_0x29c3('0xb')][_0x29c3('0x38')],'dnid':this[_0x29c3('0xb')][_0x29c3('0x39')],'projectName':this[_0x29c3('0xb')][_0x29c3('0x3a')],'saveName':_0x374ea1,'filename':_0xe306de[_0x29c3('0x3b')]||_0x374ea1,'savePath':_0x2a674a})[_0x29c3('0x13')](function(_0x5a145e){_0x2d1084(null,_0x5a145e);})[_0x29c3('0x12')](function(_0x567ee0){_0x2d1084(_0x567ee0);});};AGIVertices['prototype'][_0x29c3('0x3c')]=function(_0x28d09f,_0x3f98ae,_0x42604e,_0x5cd3d7,_0x4ce964){this[_0x29c3('0xc')][_0x29c3('0x3c')]({'uniqueid':this[_0x29c3('0xb')][_0x29c3('0x33')],'body':_0x28d09f,'direction':_0x3f98ae,'providerName':_0x42604e,'providerResponse':_0x5cd3d7})[_0x29c3('0x13')](function(_0x21da22){if(_0x4ce964){_0x4ce964(null,_0x21da22);}})[_0x29c3('0x12')](function(_0x4d7b9f){if(_0x4ce964){_0x4ce964(_0x4d7b9f);}});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x3d')]=function(_0x12c2a7,_0xa3edd0){this[_0x29c3('0xc')][_0x29c3('0x3d')]({'firstName':_[_0x29c3('0x3e')](_0x12c2a7[_0x29c3('0x11')])||_['isNil'](_0x12c2a7['name'])?_0x29c3('0x3f')+Math['random']():_0x12c2a7[_0x29c3('0x11')],'lastName':_['isEmpty'](_0x12c2a7[_0x29c3('0x40')])||_[_0x29c3('0x41')](_0x12c2a7['lastName'])?null:_0x12c2a7[_0x29c3('0x40')],'phone':_0x12c2a7[_0x29c3('0x42')],'ListId':_0x12c2a7[_0x29c3('0x43')],'scheduledat':_0x12c2a7[_0x29c3('0x44')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x29c3('0x45'),'description':'Callback\x20scheduled\x20at\x20'+_0x12c2a7['scheduledAt']['toString'](),'priority':_0x12c2a7[_0x29c3('0x46')]})[_0x29c3('0x13')](function(_0x1258cc){_0xa3edd0(null,_0x1258cc);})['catch'](function(_0x42f988){_0xa3edd0(_0x42f988);});};AGIVertices['prototype'][_0x29c3('0x47')]=function(_0x1db157,_0x551d06){this['rpc'][_0x29c3('0x48')](_0x1db157)[_0x29c3('0x13')](function(_0x21f91b){_0x551d06(null,_0x21f91b?_0x21f91b[_0x29c3('0x11')]:![]);})[_0x29c3('0x12')](function(_0x1b9b25){_0x551d06(_0x1b9b25);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x49')]=function(_0x599f68,_0x2b1017,_0x288218){var _0x4430a6={'role':_0x29c3('0x4a')};_0x4430a6[_0x599f68]=this[_0x29c3('0xb')]['callerid'];this['rpc'][_0x29c3('0x49')](_0x4430a6,_0x2b1017,this[_0x29c3('0xb')][_0x29c3('0x33')])[_0x29c3('0x13')](function(_0x5dca32){_0x288218(null,_[_0x29c3('0x41')](_0x5dca32)?![]:!![]);})[_0x29c3('0x12')](function(_0x5fb069){logger[_0x29c3('0x25')](_0x5fb069);_0x288218(null,![]);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x4b')]=function(_0x4536df,_0x15c4a6){var _0x14c82b={'role':'agent'};_0x14c82b[_0x4536df]=this['channel'][_0x29c3('0x31')];this[_0x29c3('0xc')][_0x29c3('0x4b')](_0x14c82b)['then'](function(_0x3a7331){_0x15c4a6(null,_['isNil'](_0x3a7331)?![]:!![]);})[_0x29c3('0x12')](function(_0xec1004){logger[_0x29c3('0x25')](_0xec1004);_0x15c4a6(null,![]);});};AGIVertices[_0x29c3('0xe')]['agentLogout']=function(_0x92e5ea,_0x5e9553){var _0x452093={'role':'agent'};_0x452093[_0x92e5ea]=this[_0x29c3('0xb')][_0x29c3('0x31')];this[_0x29c3('0xc')]['agentLogout'](_0x452093)[_0x29c3('0x13')](function(_0x407020){_0x5e9553(null,_[_0x29c3('0x41')](_0x407020)?![]:!![]);})['catch'](function(_0x4d8913){logger[_0x29c3('0x25')](_0x4d8913);_0x5e9553(null,![]);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x4c')]=function(_0x4b2745,_0x3c9df5){var _0x41a811={'role':'agent'};_0x41a811[_0x4b2745]=this[_0x29c3('0xb')][_0x29c3('0x31')];var _0x263a36=_0x4b2745!=_0x29c3('0x4d')?util['format']('%s/%s@from-sip/n',_0x29c3('0x4e'),this[_0x29c3('0xb')][_0x29c3('0x31')]):undefined;this[_0x29c3('0xc')]['agentLogin'](_0x41a811,_0x263a36)['then'](function(_0x3d082a){_0x3c9df5(null,_[_0x29c3('0x41')](_0x3d082a)?![]:!![]);})[_0x29c3('0x12')](function(_0x5469a8){logger[_0x29c3('0x25')](_0x5469a8);_0x3c9df5(null,![]);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x4f')]=function(_0x292828,_0x5067f3){sh[_0x29c3('0x50')](_[_0x29c3('0x51')](_0x292828),function(_0x4549d3,_0x14ed4f){var _0x4a8ff0=_0x14ed4f[_0x29c3('0x52')](/(\r\n|\n|\r)/gm,'');_0x5067f3(null,_0x4a8ff0);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x53')]=function(_0x51e777,_0x115a5a){scripts[_0x29c3('0x53')](_0x51e777['apiKey'],_0x51e777['google_cloud_tts_text_type']||_0x29c3('0x54'),_0x51e777[_0x29c3('0x54')],_0x51e777[_0x29c3('0x55')]||_0x29c3('0x56'),_0x51e777[_0x29c3('0x57')]||'MALE',_0x51e777[_0x29c3('0x58')]||_0x29c3('0x59'))[_0x29c3('0x13')](function(_0x4d035e){_0x115a5a(null,_0x4d035e);})[_0x29c3('0x12')](function(_0x2567ea){_0x115a5a(_0x2567ea);});};AGIVertices[_0x29c3('0xe')]['googleTTS']=function(_0x39b27e,_0x5cd506){scripts[_0x29c3('0x5a')](_0x39b27e[_0x29c3('0x54')],_0x39b27e[_0x29c3('0x5b')]||'en',0x1)[_0x29c3('0x13')](function(_0x2d1e91){_0x5cd506(null,_0x2d1e91);})[_0x29c3('0x12')](function(_0x1a42bf){_0x5cd506(_0x1a42bf);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x5c')]=function(_0x48e334,_0x1085fb){var _0x5f4817={'uri':_0x48e334[_0x29c3('0x5d')],'method':_0x48e334[_0x29c3('0x5e')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x48e334[_0x29c3('0x5f')])===_0x29c3('0x60')&&parseInt(_0x48e334['timeout'])>=0x1?parseInt(_0x48e334['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x29c3('0x61')](['POST',_0x29c3('0x62')],_0x5f4817[_0x29c3('0x5e')][_0x29c3('0x63')]())){try{_0x5f4817[_0x29c3('0x64')]=_0x48e334[_0x29c3('0x8')]?JSON['parse'](_0x48e334[_0x29c3('0x8')]):{};}catch(_0x19ce50){logger[_0x29c3('0x25')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x19ce50);}}try{_0x5f4817[_0x29c3('0x65')]=_0x48e334[_0x29c3('0x66')]?JSON['parse'](_0x48e334[_0x29c3('0x66')]):{};}catch(_0xb83961){logger[_0x29c3('0x25')](_0x29c3('0x67'),_0xb83961);}if(_0x48e334[_0x29c3('0x68')]){try{var _0x36a1f3=require(_0x48e334['computedVariables'])[_0x29c3('0x69')](this,_0x5f4817);_0x5f4817[_0x29c3('0x6a')]=Mustache['render'](_0x48e334[_0x29c3('0x5d')],_0x36a1f3,{},['$$','$$']);if(_0x5f4817[_0x29c3('0x65')]){_0x5f4817[_0x29c3('0x65')]=JSON[_0x29c3('0x6b')](Mustache[_0x29c3('0x6c')](JSON[_0x29c3('0x6d')](_0x5f4817[_0x29c3('0x65')]),_0x36a1f3,{},['$$','$$']));}if(_0x5f4817[_0x29c3('0x64')]){_0x5f4817[_0x29c3('0x64')]=JSON[_0x29c3('0x6b')](Mustache[_0x29c3('0x6c')](JSON[_0x29c3('0x6d')](_0x5f4817[_0x29c3('0x64')]),_0x36a1f3,{},['$$','$$']));}}catch(_0x3b3610){logger[_0x29c3('0x25')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3b3610);}}rp(_0x5f4817)[_0x29c3('0x13')](function(_0x3a5817){var _0x29318f={'statusCode':_0x3a5817[_0x29c3('0x6e')]||0xc8,'statusMessage':_0x3a5817[_0x29c3('0x6f')]||'OK','headers':_0x3a5817[_0x29c3('0x65')]||{},'body':_0x3a5817[_0x29c3('0x64')]||{}};_0x1085fb(null,_0x29318f);})[_0x29c3('0x12')](function(_0x11a7fa){var _0x2feb2d={'statusCode':_0x11a7fa[_0x29c3('0x6e')]||0x1f4,'statusMessage':_0x11a7fa[_0x29c3('0x70')]||_0x29c3('0x71'),'headers':_0x11a7fa[_0x29c3('0x72')][_0x29c3('0x65')]||{},'body':_0x11a7fa[_0x29c3('0x72')]['body']||{}};_0x1085fb(null,_0x2feb2d);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x73')]=function(_0x42923e,_0x32cdd0){scripts[_0x29c3('0x73')](this[_0x29c3('0xb')][_0x29c3('0x33')],_0x42923e[_0x29c3('0x74')],_0x42923e[_0x29c3('0x54')],_0x42923e[_0x29c3('0x75')]||'en')[_0x29c3('0x13')](function(_0x20fc3c){_0x32cdd0(null,_0x20fc3c);})[_0x29c3('0x12')](function(_0xe3ee56){_0x32cdd0(_0xe3ee56);});};AGIVertices['prototype'][_0x29c3('0x76')]=function(_0x18611c,_0x406f92){scripts[_0x29c3('0x76')](this['channel'][_0x29c3('0x33')],_0x18611c[_0x29c3('0x77')],_0x18611c[_0x29c3('0x78')],_0x18611c['private_key'],_0x18611c['text'],_0x18611c[_0x29c3('0x79')]||'en')[_0x29c3('0x13')](function(_0x21d243){_0x406f92(null,_0x21d243);})['catch'](function(_0x5bc936){_0x406f92(_0x5bc936);});};AGIVertices['prototype'][_0x29c3('0x7a')]=function(_0x509120,_0x432773){scripts[_0x29c3('0x7a')](this['channel'],_0x509120)['then'](function(_0x1c72e4){_0x432773(null,_0x1c72e4);})[_0x29c3('0x12')](function(_0x2586a1){_0x432773(_0x2586a1);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x7b')]=function(_0x3a3b3c,_0x51989e){scripts[_0x29c3('0x7b')](_0x3a3b3c['key'],_0x3a3b3c['text'],_0x3a3b3c[_0x29c3('0x7c')]||_0x29c3('0x56'),_0x3a3b3c[_0x29c3('0x7d')])[_0x29c3('0x13')](function(_0x102e78){_0x51989e(null,_0x102e78);})[_0x29c3('0x12')](function(_0x195210){_0x51989e(_0x195210);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x7e')]=function(_0x51f48d,_0x4e63b3,_0x887d3d){scripts[_0x29c3('0x7e')](_0x4e63b3,_0x51f48d[_0x29c3('0x74')],_0x51f48d[_0x29c3('0x7f')]||_0x29c3('0x56'),this[_0x29c3('0x80')](_0x51f48d[_0x29c3('0x81')])?_0x51f48d[_0x29c3('0x81')]:undefined)[_0x29c3('0x13')](function(_0x53fbe7){_0x887d3d(null,_0x53fbe7);})[_0x29c3('0x12')](function(_0x408b1e){_0x887d3d(_0x408b1e);});};AGIVertices[_0x29c3('0xe')][_0x29c3('0x82')]=function(_0x570f33,_0x1d2d71){scripts['awsPolly'](_0x570f33[_0x29c3('0x83')],_0x570f33[_0x29c3('0x84')],_0x570f33[_0x29c3('0x85')],_0x570f33[_0x29c3('0x86')]||_0x29c3('0x87'),_0x570f33['text'],_0x570f33[_0x29c3('0x88')]||_0x29c3('0x54'))[_0x29c3('0x13')](function(_0x4d7065){_0x1d2d71(null,_0x4d7065);})[_0x29c3('0x12')](function(_0x362df5){_0x1d2d71(_0x362df5);});};AGIVertices[_0x29c3('0xe')]['awsLex']=function(_0x26e820,_0x35b5a2){scripts[_0x29c3('0x89')](this[_0x29c3('0xb')]['uniqueid'],_0x26e820[_0x29c3('0x83')],_0x26e820[_0x29c3('0x84')],_0x26e820['aws_lex_region'],_0x26e820[_0x29c3('0x54')],_0x26e820[_0x29c3('0x8a')])[_0x29c3('0x13')](function(_0x32f744){_0x35b5a2(null,_0x32f744);})[_0x29c3('0x12')](function(_0x327373){_0x35b5a2(_0x327373);});};AGIVertices['prototype']['googleASR']=function(_0x2af260,_0x182c6f,_0x2f8d69){scripts[_0x29c3('0x8b')](_0x182c6f,_0x2af260[_0x29c3('0x74')],_0x2af260[_0x29c3('0x8c')]||_0x29c3('0x56'))[_0x29c3('0x13')](function(_0x9c0566){_0x2f8d69(null,_0x9c0566);})['catch'](function(_0x2ddd40){_0x2f8d69(_0x2ddd40);});};AGIVertices[_0x29c3('0xe')]['tildeASR']=function(_0x175910,_0x52b8b7,_0x1ff3d8){scripts['tildeASR'](_0x52b8b7,_0x175910[_0x29c3('0x8d')],_0x175910[_0x29c3('0x8e')],_0x175910[_0x29c3('0x6a')])[_0x29c3('0x13')](function(_0x42e3f7){_0x1ff3d8(null,_0x42e3f7);})[_0x29c3('0x12')](function(_0x38d74e){_0x1ff3d8(_0x38d74e);});};AGIVertices['prototype'][_0x29c3('0x8f')]=function(_0x32746c){var _0x6717e0=_[_0x29c3('0x61')](verticesWithRetry,_0x32746c[_0x29c3('0x30')])?_0x32746c:_[_0x29c3('0x90')](_0x32746c);for(var _0x5d2c73 in _0x6717e0){if(_0x6717e0['hasOwnProperty'](_0x5d2c73)){if(_0x6717e0[_0x5d2c73]&&_[_0x29c3('0x91')](_0x6717e0[_0x5d2c73])){if(_['includes'](recursiveMapAttributes,_0x5d2c73)){_0x6717e0[_0x5d2c73]=this[_0x29c3('0x92')](_0x6717e0[_0x5d2c73]);}else{_0x6717e0[_0x5d2c73]=this[_0x29c3('0x93')](_0x6717e0[_0x5d2c73]);}}}}return _0x6717e0;};AGIVertices[_0x29c3('0xe')]['recursiveNodeIndex']=function(_0x1bdd37){for(var _0x59379e in _0x1bdd37){if(_0x1bdd37[_0x29c3('0x94')](_0x59379e)){if(_[_0x29c3('0x95')](_0x1bdd37[_0x59379e])){this[_0x29c3('0x96')](_0x1bdd37[_0x59379e]);}else if(_[_0x29c3('0x97')](_0x1bdd37[_0x59379e])){for(var _0x5c11b3=0x0;_0x5c11b3<_0x1bdd37[_0x59379e][_0x29c3('0x98')];_0x5c11b3++){this[_0x29c3('0x96')](_0x1bdd37[_0x59379e][_0x5c11b3]);}}else if(_[_0x29c3('0x91')](_0x1bdd37[_0x59379e])){_0x1bdd37[_0x59379e]=this[_0x29c3('0x93')](_0x1bdd37[_0x59379e]);}}}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x99')]=function(_0x42e832,_0x3f7664){for(var _0x12eb9f in _0x42e832){if(_0x42e832['hasOwnProperty'](_0x12eb9f)){if(_['isPlainObject'](_0x42e832[_0x12eb9f])){if(!_['isEmpty'](_0x42e832[_0x12eb9f])){this[_0x29c3('0x99')](_0x42e832[_0x12eb9f],util[_0x29c3('0x22')]('%s.%s',_0x3f7664,_0x12eb9f));}}else if(_[_0x29c3('0x97')](_0x42e832[_0x12eb9f])){for(var _0x3879f3=0x0;_0x3879f3<_0x42e832[_0x12eb9f][_0x29c3('0x98')];_0x3879f3++){this['saveRestApiResult'](_0x42e832[_0x12eb9f][_0x3879f3],util['format'](_0x29c3('0x9a'),_0x3f7664,_0x12eb9f+'['+_0x3879f3+']'));}}else{if(!_[_0x29c3('0x41')](_0x42e832[_0x12eb9f])){this['channel']['setVariable'](util['format'](_0x29c3('0x9a'),_0x3f7664,_0x12eb9f),_0x42e832[_0x12eb9f]);}}}}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x92')]=function(_0x291e1e){try{var _0x2bcb23=JSON[_0x29c3('0x6b')](_0x291e1e);this[_0x29c3('0x96')](_0x2bcb23);return JSON[_0x29c3('0x6d')](_0x2bcb23);}catch(_0x2e1c7b){return this[_0x29c3('0x93')](_0x291e1e);}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x93')]=function(_0x317c25){var _0x19fe05=_0x317c25[_0x29c3('0x9b')]('{');for(var _0x4532c1=0x1;_0x4532c1<_0x19fe05[_0x29c3('0x98')];_0x4532c1+=0x1){var _0x2854c3=_0x19fe05[_0x4532c1][_0x29c3('0x9b')]('}');if(_0x2854c3[_0x29c3('0x98')]>0x1){_0x317c25=_0x317c25[_0x29c3('0x9c')]('{'+_0x2854c3[0x0]+'}',this['channel'][_0x29c3('0xf')](_0x2854c3[0x0])[_0x29c3('0x9d')]||_0x2854c3[0x0]);}}if(_0x19fe05[_0x29c3('0x98')]===0x1){return _0x317c25[_0x29c3('0x9e')]();}return this[_0x29c3('0x93')](_0x317c25);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x9f')]=function(_0x17acf5,_0x26e939){var _0x34c87e=this[_0x29c3('0xb')][_0x29c3('0xf')](_0x17acf5);if(_0x34c87e[_0x29c3('0xa0')]===-0x1){return _0x34c87e;}logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xa1'),_0x26e939,_0x34c87e[_0x29c3('0x9d')]));return this['channel']['setVariable'](_0x26e939,_0x34c87e[_0x29c3('0x9d')]);};AGIVertices[_0x29c3('0xe')]['isConfigured']=function(_0x35347a){return _0x35347a&&_0x35347a!=='0'&&_0x35347a!=='-1'&&_0x35347a!=='';};AGIVertices[_0x29c3('0xe')]['maxRetry']=function(_0x53ceab){this['createSquareDetailsReport'][_0x29c3('0x69')](this,_0x53ceab,'-');_0x53ceab[_0x29c3('0xa2')]=_0x53ceab[_0x29c3('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x29c3('0xe')][_0x29c3('0xa4')]=function(_0x13f95a){logger[_0x29c3('0x27')](util['format'](_0x29c3('0xa5'),_0x13f95a['label']));if(!this[_0x29c3('0x80')](_0x13f95a['text'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20text\x20configured');}var _0x20e342='\x22'+_0x13f95a[_0x29c3('0x54')]+'\x22';if(this['isConfigured'](_0x13f95a[_0x29c3('0x72')])){_0x20e342+=','+_0x13f95a['options'];}var _0x2c95e2=this[_0x29c3('0xb')][_0x29c3('0x50')]('MRCPSynth',_0x20e342);if(_0x2c95e2[_0x29c3('0xa0')]===-0x1){return _0x2c95e2;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xa7'),_0x20e342));};AGIVertices['prototype']['mrcprecog']=function(_0x62c103){logger['info'](util['format'](_0x29c3('0xa8'),_0x62c103[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x62c103[_0x29c3('0xa9')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x60b65a=_0x62c103[_0x29c3('0xa9')];if(this[_0x29c3('0x80')](_0x62c103[_0x29c3('0x72')])){_0x60b65a+=','+_0x62c103[_0x29c3('0x72')];}var _0x13bb9f=this['channel']['exec']('MRCPRecog',_0x60b65a);if(_0x13bb9f[_0x29c3('0xa0')]===-0x1){return _0x13bb9f;}var _0x4feae1=this[_0x29c3('0x9f')](_0x29c3('0xaa'),_0x29c3('0xab'));if(_0x4feae1[_0x29c3('0xa0')]===-0x1){return _0x4feae1;}var _0x160809=this['getAndSetVariable'](_0x29c3('0xac'),'MRCP_RECOG_TRANSCRIPT');if(_0x160809['result']===-0x1){return _0x160809;}var _0x9ebcc5=this[_0x29c3('0x9f')](_0x29c3('0xad'),_0x29c3('0xae'));if(_0x9ebcc5[_0x29c3('0xa0')]===-0x1){return _0x9ebcc5;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xaf'),_0x60b65a));};AGIVertices['prototype'][_0x29c3('0xb0')]=function(_0x1176fe){logger['info'](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1176fe[_0x29c3('0x2f')]));return this['channel']['agi']([_0x1176fe[_0x29c3('0xb1')],_0x1176fe[_0x29c3('0xb2')]]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0xb3')]=function(_0x1687bc){logger['info'](util[_0x29c3('0x22')](_0x29c3('0xb4'),_0x1687bc[_0x29c3('0x2f')]));if(this[_0x29c3('0x80')](_0x1687bc[_0x29c3('0x5f')])){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xb5'),_0x1687bc[_0x29c3('0x5f')]));var _0xb05863=this[_0x29c3('0xb')][_0x29c3('0xb6')](_0x1687bc[_0x29c3('0x5f')]);if(_0xb05863[_0x29c3('0xa0')]===-0x1){return _0xb05863;}}return this[_0x29c3('0xb')]['answer']();};AGIVertices[_0x29c3('0xe')][_0x29c3('0x45')]=function(_0x486b05){logger[_0x29c3('0x27')](util['format'](_0x29c3('0xb7'),_0x486b05[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x486b05['list_id'])){return this['channel'][_0x29c3('0x25')](_0x486b05,_0x29c3('0xb8'));}_0x486b05[_0x29c3('0x44')]=moment();if(this[_0x29c3('0x80')](_0x486b05[_0x29c3('0xb9')])){_0x486b05[_0x29c3('0x44')]=moment()[_0x29c3('0xba')](_0x486b05[_0x29c3('0xb9')],_0x29c3('0xbb'));}if(!this[_0x29c3('0x80')](_0x486b05[_0x29c3('0x46')])){_0x486b05[_0x29c3('0x46')]=0x2;}this[_0x29c3('0x3d')][_0x29c3('0x69')](this,_0x486b05);return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xbc'),_0x486b05[_0x29c3('0x42')],_0x486b05['list_id'],_0x486b05['scheduledAt']));};AGIVertices[_0x29c3('0xe')]['custom_app']=function(_0x4f9cba){logger['info'](util['format'](_0x29c3('0xbd'),_0x4f9cba[_0x29c3('0x2f')]));var _0x5b761f=this[_0x29c3('0xb')][_0x29c3('0x50')](_0x4f9cba['application'],_0x4f9cba[_0x29c3('0x72')]);if(_0x5b761f[_0x29c3('0xa0')]===-0x1){return _0x5b761f;}return this['channel']['noop'](util[_0x29c3('0x22')]('Executed\x20command\x20%s\x20%s',_0x4f9cba[_0x29c3('0xbe')],_0x4f9cba['options']));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xbf')]=function(_0x394c8d){logger['info'](util[_0x29c3('0x22')](_0x29c3('0xc0'),_0x394c8d[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x394c8d[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20text\x20configured');}var _0x43ca79='\x22'+_0x394c8d['text']+'\x22';if(this[_0x29c3('0x80')](_0x394c8d[_0x29c3('0x72')])){_0x43ca79+=','+_0x394c8d['options'];}var _0x1d8517=this[_0x29c3('0xb')]['exec'](_0x29c3('0xc1'),_0x43ca79);if(_0x1d8517[_0x29c3('0xa0')]===-0x1){return _0x1d8517;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xa7'),_0x43ca79));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xc2')]=function(_0x476934){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xc3'),_0x476934[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x476934[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}var _0x3f3fdc='\x22'+_0x476934[_0x29c3('0x54')]+'\x22';if(this[_0x29c3('0x80')](_0x476934[_0x29c3('0x72')])){_0x3f3fdc+=','+_0x476934[_0x29c3('0x72')];}var _0x2cc5e8=this['channel']['exec'](_0x29c3('0xc1'),_0x3f3fdc);if(_0x2cc5e8[_0x29c3('0xa0')]===-0x1){return _0x2cc5e8;}return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0xa7'),_0x3f3fdc));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xc5')]=function(_0x51cb1a){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xc6'),_0x51cb1a[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x51cb1a[_0x29c3('0xa9')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc7'));}var _0x3fbf5c=_0x51cb1a[_0x29c3('0xa9')];if(this[_0x29c3('0x80')](_0x51cb1a['options'])){_0x3fbf5c+=','+_0x51cb1a[_0x29c3('0x72')];}var _0x5b1976=this['channel'][_0x29c3('0x50')]('MRCPRecog',_0x3fbf5c);if(_0x5b1976[_0x29c3('0xa0')]===-0x1){return _0x5b1976;}var _0x2d6366=this[_0x29c3('0x9f')](_0x29c3('0xaa'),_0x29c3('0xc8'));if(_0x2d6366['result']===-0x1){return _0x2d6366;}var _0xe6b122=this[_0x29c3('0x9f')](_0x29c3('0xac'),_0x29c3('0xc9'));if(_0xe6b122['result']===-0x1){return _0xe6b122;}var _0x1fb04e=this[_0x29c3('0x9f')]('RECOG_INSTANCE()',_0x29c3('0xca'));if(_0x1fb04e[_0x29c3('0xa0')]===-0x1){return _0x1fb04e;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3fbf5c));};AGIVertices['prototype'][_0x29c3('0xcb')]=function(_0x35dfc4){logger[_0x29c3('0x27')](util['format'](_0x29c3('0xcc'),_0x35dfc4['label']));if(!this[_0x29c3('0x80')](_0x35dfc4[_0x29c3('0xa9')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc7'));}var _0x1de558=_0x35dfc4[_0x29c3('0xa9')];if(this[_0x29c3('0x80')](_0x35dfc4[_0x29c3('0x72')])){_0x1de558+=','+_0x35dfc4[_0x29c3('0x72')];}var _0x14d09f=this[_0x29c3('0xb')]['exec'](_0x29c3('0xcd'),_0x1de558);if(_0x14d09f[_0x29c3('0xa0')]===-0x1){return _0x14d09f;}var _0x4b9b5=this[_0x29c3('0x9f')](_0x29c3('0xaa'),_0x29c3('0xce'));if(_0x4b9b5[_0x29c3('0xa0')]===-0x1){return _0x4b9b5;}var _0x775de5=this['getAndSetVariable'](_0x29c3('0xac'),_0x29c3('0xcf'));if(_0x775de5['result']===-0x1){return _0x775de5;}var _0x43859c=this[_0x29c3('0x9f')](_0x29c3('0xad'),_0x29c3('0xd0'));if(_0x43859c[_0x29c3('0xa0')]===-0x1){return _0x43859c;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xaf'),_0x1de558));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xd1')]=function(_0x27e186){logger['info'](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x27e186['label']));if(!this[_0x29c3('0x80')](_0x27e186[_0x29c3('0xd2')])){return this[_0x29c3('0xb')]['error'](_0x27e186,'no\x20database\x20selected');}var _0x22a1f6=this[_0x29c3('0x16')][_0x29c3('0x69')](this,_0x27e186[_0x29c3('0xd2')]);if(!_0x22a1f6){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x27e186,_0x29c3('0xd3'));}if(!this['isConfigured'](_0x27e186[_0x29c3('0x29')])){return this['channel'][_0x29c3('0x25')](_0x27e186,_0x29c3('0xd4'));}var _0x5685a2=_0x27e186[_0x29c3('0x29')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xd5'),_0x5685a2));var _0x5848e9=this[_0x29c3('0x23')][_0x29c3('0x69')](this,_0x22a1f6,_0x5685a2);this['createSquareDetailsReport'][_0x29c3('0x69')](this,_0x27e186,_0x5685a2);if(!this['isConfigured'](_0x27e186['variable_id'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xd6'));}var _0x397001=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x27e186['variable_id']);if(!_0x397001){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x27e186,_0x29c3('0xd7'));}var _0x9c68ea=this;_0x5848e9[_0x29c3('0xd8')](function(_0x3eccbd,_0x3d50a8){Object[_0x29c3('0xd9')](_0x3eccbd)[_0x29c3('0xd8')](function(_0x54a18b){_0x9c68ea['channel'][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0xdb'),_0x397001,_0x3d50a8,_0x54a18b),_0x3eccbd[_0x54a18b]);});});this[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0xdc'),_0x397001),_0x5848e9['length']);return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xdd'),_0x397001));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xde')]=function(_0x52f69b){logger[_0x29c3('0xdf')](util[_0x29c3('0x22')](_0x29c3('0xe0'),_0x52f69b['label']));if(!this[_0x29c3('0x80')](_0x52f69b[_0x29c3('0xe1')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x52f69b,'no\x20user\x20selected');}var _0x10e913=this[_0x29c3('0x18')]['sync'](this,_0x52f69b['sip_id']);if(!_0x10e913){return this[_0x29c3('0xb')]['error'](_0x52f69b,_0x29c3('0xe2'));}var _0x61d058=this[_0x29c3('0xb')]['exec'](_0x29c3('0xe3'),[util[_0x29c3('0x22')]('SIP/%s',_0x10e913),_0x52f69b[_0x29c3('0x5f')],_0x52f69b[_0x29c3('0xe4')],_0x52f69b['url']]);if(_0x61d058[_0x29c3('0xa0')]===-0x1){return _0x61d058;}return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0xe5'),_0x29c3('0xe3')));};AGIVertices[_0x29c3('0xe')]['dialogflow']=function(_0x3f5c3f){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3f5c3f['label']));if(!this[_0x29c3('0x80')](_0x3f5c3f[_0x29c3('0x74')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xe6'));}if(!this[_0x29c3('0x80')](_0x3f5c3f[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xe7')]=!![];this['createSquareDetailsReport'](_0x3f5c3f);this['createSquareMessage'](_0x3f5c3f[_0x29c3('0x54')],'in','','');this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('Trying\x20Dialogflow:\x20%s',_0x3f5c3f['text']));var _0x54f0c2=this[_0x29c3('0x73')]['sync'](this,_0x3f5c3f);if(_0x54f0c2){for(var _0x25fd68 in _0x54f0c2){if(_0x54f0c2[_0x29c3('0x94')](_0x25fd68)){this['channel']['setVariable'](util[_0x29c3('0x22')]('DIALOGFLOW_%s',_0x25fd68['toUpperCase']()),_0x54f0c2[_0x25fd68]);}}this[_0x29c3('0x3c')](_0x54f0c2[_0x29c3('0xe8')],_0x29c3('0xe9'),_0x29c3('0xea'),'');return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xeb'),_0x54f0c2[_0x29c3('0xe8')]));}return this['channel'][_0x29c3('0x25')](_0x3f5c3f,_0x29c3('0xec'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xed')]=function(_0x589976){logger['info'](util['format'](_0x29c3('0xee'),_0x589976[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x589976[_0x29c3('0x77')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xef'));}if(!this['isConfigured'](_0x589976[_0x29c3('0x78')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20client_email\x20configured');}if(!this[_0x29c3('0x80')](_0x589976[_0x29c3('0xf0')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20private_key\x20configured');}if(!this[_0x29c3('0x80')](_0x589976['dialogflowV2_language'])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0xf1'));}if(!this['isConfigured'](_0x589976[_0x29c3('0x54')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xe7')]=!![];this[_0x29c3('0x2e')](_0x589976);this['createSquareMessage'](_0x589976['text'],'in','','');this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0xf2'),_0x589976['text']));var _0x9cedb9=this[_0x29c3('0x76')][_0x29c3('0x69')](this,_0x589976);if(_0x9cedb9){for(var _0x714659 in _0x9cedb9){if(_0x9cedb9[_0x29c3('0x94')](_0x714659)){if(_0x714659!==_0x29c3('0xf3')){this[_0x29c3('0xb')]['setVariable'](util[_0x29c3('0x22')]('DIALOGFLOW_%s',_0x714659[_0x29c3('0x63')]()),_0x9cedb9[_0x714659]);}}}this[_0x29c3('0x3c')](_0x9cedb9[_0x29c3('0xe8')],_0x29c3('0xe9'),_0x29c3('0xed'),_0x9cedb9[_0x29c3('0xf3')]);return this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0xf4'),_0x9cedb9['speech']));}return this['channel'][_0x29c3('0x25')](_0x589976,_0x29c3('0xf5'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0xf6')]=function(_0x22f765){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0xf7'),_0x22f765['label']));if(!this[_0x29c3('0x80')](_0x22f765[_0x29c3('0xf8')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xf9'));}if(!this[_0x29c3('0x80')](_0x22f765['username'])){return this['channel']['noop'](_0x29c3('0xfa'));}if(!this[_0x29c3('0x80')](_0x22f765[_0x29c3('0xfb')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20password\x20configured');}if(!this[_0x29c3('0x80')](_0x22f765[_0x29c3('0xfc')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0xc4'));}this['channel'][_0x29c3('0xe7')]=!![];this['createSquareDetailsReport'](_0x22f765);this[_0x29c3('0x3c')](_0x22f765[_0x29c3('0x54')],'in','','');this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0xfd'),_0x22f765[_0x29c3('0x54')]));var _0x85e50a=this[_0x29c3('0x7a')][_0x29c3('0x69')](this,_0x22f765);if(_0x85e50a){for(var _0x210579 in _0x85e50a){if(_0x85e50a['hasOwnProperty'](_0x210579)){this[_0x29c3('0xb')][_0x29c3('0xda')](util['format']('SESTEK_NDA_%s',_0x210579['toUpperCase']()),_0x85e50a[_0x210579]);}}this['createSquareMessage'](_0x85e50a[_0x29c3('0xe8')],'out',_0x29c3('0xf6'),'');if(_0x85e50a['audiofile']){this['channel'][_0x29c3('0xa6')](util['format'](_0x29c3('0xfe'),_0x85e50a[_0x29c3('0xff')]));var _0x36534a=this[_0x29c3('0xb')][_0x29c3('0x100')](_0x85e50a[_0x29c3('0xff')]);try{fs['unlink'](_0x85e50a[_0x29c3('0xff')]+_0x29c3('0x101'));}catch(_0x2b13be){logger[_0x29c3('0x25')](_0x2b13be);}return _0x36534a;}else{return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x102'),_0x85e50a[_0x29c3('0xe8')]));}}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x22f765,_0x29c3('0x103'));};AGIVertices[_0x29c3('0xe')]['end']=function(_0x1f095a){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x104'),_0x1f095a['label']));return this['channel']['noop'](_0x29c3('0x105'));};AGIVertices['prototype'][_0x29c3('0x106')]=function(_0x174fda){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x107'),_0x174fda[_0x29c3('0x2f')]));var _0x20ea6a='';if(_0x174fda[_0x29c3('0x108')]){if(!this[_0x29c3('0x80')](_0x174fda['trunk_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x174fda,'no\x20trunk\x20selected');}else{var _0xf2781a=parseInt(_0x174fda['trunk_id'],0xa);if(isNaN(_0xf2781a)){_0x20ea6a=_0x174fda[_0x29c3('0x108')];}else{_0x20ea6a=this[_0x29c3('0x19')][_0x29c3('0x69')](this,_0x174fda[_0x29c3('0x108')]);if(!_0x20ea6a){return this['channel'][_0x29c3('0x25')](_0x174fda,'no\x20trunk\x20found');}}}}else if(_0x174fda[_0x29c3('0x109')]){_0x20ea6a=_0x174fda['trunk_name'];}else{return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x174fda,_0x29c3('0x10a'));}var _0x173f8a=this[_0x29c3('0xb')][_0x29c3('0x50')]('DIAL',[util[_0x29c3('0x22')](_0x29c3('0x10b'),_0x20ea6a,_0x174fda['phone']),_0x174fda['timeout'],_0x174fda[_0x29c3('0xe4')],_0x174fda[_0x29c3('0x5d')]]);if(_0x173f8a[_0x29c3('0xa0')]===-0x1){return _0x173f8a;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format'](_0x29c3('0xe5'),_0x29c3('0xe3')));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x10c')]=function(_0x2cd0d3){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x2cd0d3[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x10c'));};AGIVertices['prototype']['getdigits']=function(_0x1f747b){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x10d'),_0x1f747b[_0x29c3('0x2f')]));if(_0x1f747b[_0x29c3('0xa2')]===0x0){return this['maxRetry'](_0x1f747b);}_0x1f747b[_0x29c3('0xa2')]-=0x1;if(!this[_0x29c3('0x80')](_0x1f747b[_0x29c3('0x10e')])){return this['channel'][_0x29c3('0x25')](_0x1f747b,'no\x20file\x20audio\x20selected');}var _0x2c4ec7=this[_0x29c3('0x1a')]['sync'](this,_0x1f747b['file_id']);if(!_0x2c4ec7){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x1f747b,_0x29c3('0x10f'));}if(!this[_0x29c3('0x80')](_0x1f747b['variable_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3b7c91=this[_0x29c3('0xb')][_0x29c3('0x110')](_0x2c4ec7,_0x1f747b[_0x29c3('0x111')],_0x1f747b['maxdigit']);var _0x3878f5=_0x3b7c91[_0x29c3('0xa0')]?_0x3b7c91[_0x29c3('0xa0')][_0x29c3('0x9e')]():'';logger['info']('test',JSON[_0x29c3('0x6d')](_0x3b7c91));if(_0x3b7c91['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x1f747b,_0x3878f5);return _0x3b7c91;}else if(_0x3b7c91[_0x29c3('0x9d')]===_0x29c3('0x5f')){_0x3b7c91[_0x29c3('0xa0')]=_0x3878f5[_0x29c3('0x98')]>=parseInt(_0x1f747b['mindigit'])?'x':'i';}else{_0x3b7c91[_0x29c3('0xa0')]=_0x3878f5[_0x29c3('0x98')]>=parseInt(_0x1f747b['mindigit'])&&_0x3878f5[_0x29c3('0x98')]<=parseInt(_0x1f747b[_0x29c3('0x112')])?'x':'i';}var _0xf7c510=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x1f747b[_0x29c3('0x113')]);if(!_0xf7c510){return this[_0x29c3('0xb')]['error'](_0x1f747b,'no\x20variable\x20found');}this[_0x29c3('0xb')][_0x29c3('0xda')](_0xf7c510,_0x3878f5);if(this['isConfigured'](_0x1f747b[_0x29c3('0x114')])){var _0x5351ab=parseInt(_0x1f747b[_0x29c3('0x114')],0xa);var _0x461a00=rs[_0x29c3('0x115')]({'charset':'*','length':_0x5351ab});var _0x52ea8e=_0x3878f5[_0x29c3('0x98')];if(_0x52ea8e>0x0){if(_0x52ea8e>_0x5351ab){this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x1f747b,_0x1f747b[_0x29c3('0x116')]===_0x29c3('0x117')?_0x461a00+_0x3878f5['substr'](_0x5351ab):_0x3878f5[_0x29c3('0x118')](0x0,_0x52ea8e-_0x5351ab)+_0x461a00);}else{this['createSquareDetailsReport'][_0x29c3('0x69')](this,_0x1f747b,rs['generate']({'charset':'*','length':_0x52ea8e}));}}else{this[_0x29c3('0x2e')]['sync'](this,_0x1f747b,'');}}else{this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x1f747b,_0x3878f5);}return _0x3b7c91;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x119')]=function(_0x54953f){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x11a'),_0x54953f[_0x29c3('0x2f')]));return this['getdigits'](_0x54953f);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x11b')]=function(_0x457dca){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x11c'),_0x457dca[_0x29c3('0x2f')]));this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x457dca,_0x457dca[_0x29c3('0x11d')]);return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('GOAL\x20%s',_0x457dca['goalname']));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x11e')]=function(_0x113716){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x11f'),_0x113716[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x113716['aws_access_key_id'])||!this[_0x29c3('0x80')](_0x113716[_0x29c3('0x84')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0x120'));}if(!this[_0x29c3('0x80')](_0x113716['text'])){return this[_0x29c3('0xb')]['noop']('no\x20text\x20configured');}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x121'),_0x113716[_0x29c3('0x54')]));var _0x3d20d3=this[_0x29c3('0x82')][_0x29c3('0x69')](this,_0x113716);if(_0x3d20d3){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x122'),_0x3d20d3));var _0x2cdced=this[_0x29c3('0xb')][_0x29c3('0x100')](_0x3d20d3);try{fs[_0x29c3('0x123')](_0x3d20d3+_0x29c3('0x101'));}catch(_0x2b95bd){logger[_0x29c3('0x25')](_0x2b95bd);}return _0x2cdced;}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x113716,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x29c3('0x124')]=function(_0xffc0af){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x125'),_0xffc0af[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0xffc0af[_0x29c3('0x83')])||!this[_0x29c3('0x80')](_0xffc0af['aws_secret_access_key'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x29c3('0x80')](_0xffc0af['aws_bot_name'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x126'));}if(!this[_0x29c3('0x80')](_0xffc0af['text'])){return this[_0x29c3('0xb')]['noop']('no\x20text\x20configured');}this[_0x29c3('0xb')]['bot']=!![];this[_0x29c3('0x2e')](_0xffc0af);this[_0x29c3('0x3c')](_0xffc0af[_0x29c3('0x54')],'in','','');this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x127'),_0xffc0af[_0x29c3('0x54')]));var _0xf1e192=this[_0x29c3('0x89')][_0x29c3('0x69')](this,_0xffc0af);if(_0xf1e192){for(var _0x166928 in _0xf1e192){if(_0xf1e192[_0x29c3('0x94')](_0x166928)&&_[_0x29c3('0x91')](_0xf1e192[_0x166928])){this[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x128'),_0x166928['toUpperCase']()),_0xf1e192[_0x166928]);}}if(_['isNil'](_0xf1e192[_0x29c3('0x70')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x129'));}else{this[_0x29c3('0x3c')](_0xf1e192[_0x29c3('0x70')],_0x29c3('0xe9'),'amazonlex','');return this[_0x29c3('0xb')]['noop'](util['format'](_0x29c3('0x12a'),_0xf1e192[_0x29c3('0x70')]));}}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0xffc0af,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x29c3('0xe')][_0x29c3('0x12b')]=function(_0x46a590){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x12c'),_0x46a590['label'],_0x46a590['timeout']));if(!this['isConfigured'](_0x46a590[_0x29c3('0x74')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0xe6'));}var _0x527ef8=_0x29c3('0x12d');var _0xca2505=util[_0x29c3('0x22')]('%s/recordings/%s',FILES_PATH,rs[_0x29c3('0x115')](0x4));var _0x47516b=util['format'](_0x29c3('0x9a'),_0xca2505,_0x527ef8);var _0x106307=!![];if(_0x46a590[_0x29c3('0x12e')]===_0x29c3('0x12f')){_0x106307=![];}var _0xd1f691=this[_0x29c3('0xb')]['recordFile'](_0xca2505,_0x527ef8,_0x46a590[_0x29c3('0x130')],_0x46a590[_0x29c3('0x5f')],undefined,_0x106307);if(_0xd1f691[_0x29c3('0xa0')]!==-0x1){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x131'),_0x47516b));var _0x331e00=this[_0x29c3('0x8b')][_0x29c3('0x69')](this,_0x46a590,_0x47516b);if(_0x331e00){for(var _0xfa8972 in _0x331e00){if(_0x331e00[_0x29c3('0x94')](_0xfa8972)){this['channel'][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x132'),_0xfa8972[_0x29c3('0x63')]()),_0x331e00[_0xfa8972]);}}return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x133'),JSON[_0x29c3('0x6d')](_0x331e00)));}}return _0xd1f691;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x134')]=function(_0x604846){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x604846[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x604846[_0x29c3('0x8d')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20appid\x20configured');}if(!this[_0x29c3('0x80')](_0x604846['appsecret'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x135'));}var _0x115cd4=_0x29c3('0x12d');var _0x446dd4=util[_0x29c3('0x22')](_0x29c3('0x136'),FILES_PATH,rs[_0x29c3('0x115')](0x4));var _0x37a883=util[_0x29c3('0x22')](_0x29c3('0x9a'),_0x446dd4,_0x115cd4);var _0x1848fc=!![];if(_0x604846['beep']===_0x29c3('0x12f')){_0x1848fc=![];}var _0xcc032f=this[_0x29c3('0xb')][_0x29c3('0x137')](_0x446dd4,_0x115cd4,_0x604846[_0x29c3('0x130')],_0x604846['timeout'],undefined,_0x1848fc);if(_0xcc032f['result']!==-0x1){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('tilde\x20%s\x20file\x20created',_0x37a883));var _0x479e52=this['tildeASR'][_0x29c3('0x69')](this,_0x604846,_0x37a883);if(_0x479e52){for(var _0x1c1358 in _0x479e52){if(_0x479e52[_0x29c3('0x94')](_0x1c1358)){this[_0x29c3('0xb')]['setVariable'](util[_0x29c3('0x22')](_0x29c3('0x138'),_0x1c1358[_0x29c3('0x63')]()),_0x479e52[_0x1c1358]);}}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x139'),JSON[_0x29c3('0x6d')](_0x479e52)));}}return _0xcc032f;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x13a')]=function(_0x200d46){logger['info'](util[_0x29c3('0x22')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x200d46['label']));return this[_0x29c3('0xb')][_0x29c3('0x13b')](_0x200d46[_0x29c3('0x35')],_0x200d46[_0x29c3('0x36')],_0x200d46[_0x29c3('0x37')]);};AGIVertices['prototype'][_0x29c3('0x13c')]=function(_0xb19b88){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x13d'),_0xb19b88[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0xb19b88[_0x29c3('0x13e')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0xb19b88,_0x29c3('0x13f'));}try{var _0x57bd12=eval(_0xb19b88['condition'])?_0x29c3('0x140'):_0x29c3('0x141');this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x142'),_0xb19b88[_0x29c3('0x13e')],_0x57bd12));return{'code':0xc8,'result':_0x57bd12};}catch(_0x40bfa7){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x4cdb6e){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4cdb6e[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x4cdb6e[_0x29c3('0x143')])){return this['channel'][_0x29c3('0x25')](_0x4cdb6e,_0x29c3('0x144'));}var _0x5aa04d=this[_0x29c3('0x1e')]['sync'](this,_0x4cdb6e[_0x29c3('0x143')]);if(!_0x5aa04d){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4cdb6e,_0x29c3('0x145'));}for(var _0x573969=0x0;_0x573969<_0x5aa04d[_0x29c3('0x98')];_0x573969+=0x1){var _0x3de380=this[_0x29c3('0xb')][_0x29c3('0xf')](util['format'](_0x29c3('0x146'),_0x5aa04d[_0x573969]));if(_0x3de380[_0x29c3('0xa0')]===-0x1){return _0x3de380;}logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('IFTIME\x20%s\x20%s',_0x5aa04d[_0x573969],_0x3de380[_0x29c3('0x9d')]));if(_0x3de380['extra']==='true'){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x147'),_0x5aa04d[_0x573969],_0x29c3('0x140')));this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')]('IFTIME\x20%s\x20%s',_0x5aa04d[_0x573969],_0x29c3('0x140')));return{'code':0xc8,'result':_0x29c3('0x140')};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x147'),_0x5aa04d[_0x573969],_0x29c3('0x141')));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x147'),_0x5aa04d[_0x573969],'false'));}}return{'code':0xc8,'result':_0x29c3('0x141')};};AGIVertices['prototype'][_0x29c3('0x148')]=function(_0x5736b7){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5736b7[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0x148')]();};AGIVertices[_0x29c3('0xe')][_0x29c3('0x149')]=function(_0x443a28){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x14a'),_0x443a28[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x443a28['key'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20key\x20configured');}var _0x1eaa1e=_0x29c3('0x12d');var _0x15fe33=util[_0x29c3('0x22')](_0x29c3('0x136'),FILES_PATH,rs[_0x29c3('0x115')](0x4));var _0x22a43f=util[_0x29c3('0x22')](_0x29c3('0x9a'),_0x15fe33,_0x1eaa1e);var _0x45cae6=!![];if(_0x443a28[_0x29c3('0x12e')]===_0x29c3('0x12f')){_0x45cae6=![];}var _0x511600=this['channel'][_0x29c3('0x137')](_0x15fe33,_0x1eaa1e,_0x443a28['intKey'],_0x443a28[_0x29c3('0x5f')],undefined,_0x45cae6);if(_0x511600[_0x29c3('0xa0')]!==-0x1){this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x14b'),_0x22a43f));var _0x35bf86=this['ispeechASR'][_0x29c3('0x69')](this,_0x443a28,_0x22a43f);if(_0x35bf86){for(var _0x589895 in _0x35bf86){if(_0x35bf86['hasOwnProperty'](_0x589895)){this['channel'][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x14c'),_0x589895[_0x29c3('0x63')]()),_0x35bf86[_0x589895]);}}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x14d'),JSON[_0x29c3('0x6d')](_0x35bf86)));}}return _0x511600;};AGIVertices[_0x29c3('0xe')][_0x29c3('0x14e')]=function(_0x4b07ee){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x14f'),_0x4b07ee['label']));if(!this[_0x29c3('0x80')](_0x4b07ee['key'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20key\x20configured');}if(!this[_0x29c3('0x80')](_0x4b07ee[_0x29c3('0x54')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x150'),_0x4b07ee['text']));var _0x43f53e=this[_0x29c3('0x7b')]['sync'](this,_0x4b07ee);if(_0x43f53e){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x14b'),_0x43f53e));var _0x52c71a=this['channel'][_0x29c3('0x100')](_0x43f53e,_0x4b07ee[_0x29c3('0x130')]);try{fs[_0x29c3('0x123')](_0x43f53e+_0x29c3('0x101'));}catch(_0x10fdd5){logger[_0x29c3('0x25')](_0x10fdd5);}return _0x52c71a;}return this[_0x29c3('0xb')]['error'](_0x4b07ee,_0x29c3('0x151'));};AGIVertices[_0x29c3('0xe')]['login']=function(_0x2d2625){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x152'),_0x2d2625[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x2d2625[_0x29c3('0x153')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x2d2625,_0x29c3('0x154'));}logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x155'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x2d2625[_0x29c3('0x153')]));var _0x38ac25=this[_0x29c3('0x4c')]['sync'](this,_0x2d2625['findBy']);if(_0x38ac25){logger['info'](util[_0x29c3('0x22')](_0x29c3('0x156'),this[_0x29c3('0xb')]['callerid'],_0x2d2625['findBy']));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x156'),this['channel'][_0x29c3('0x31')],_0x2d2625[_0x29c3('0x153')]));return{'code':0xc8,'result':_0x29c3('0x157')};}else{logger['info'](util['format'](_0x29c3('0x158'),this[_0x29c3('0xb')]['callerid'],_0x2d2625[_0x29c3('0x153')]));this['channel'][_0x29c3('0xa6')](util['format'](_0x29c3('0x158'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x2d2625[_0x29c3('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x29c3('0xe')][_0x29c3('0x159')]=function(_0x4bdfd6){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x4bdfd6[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x4bdfd6[_0x29c3('0x153')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4bdfd6,_0x29c3('0x154'));}logger['info'](util[_0x29c3('0x22')](_0x29c3('0x155'),this['channel']['callerid'],_0x4bdfd6['findBy']));var _0x584488=this['agentLogout']['sync'](this,_0x4bdfd6[_0x29c3('0x153')]);if(_0x584488){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x156'),this[_0x29c3('0xb')]['callerid'],_0x4bdfd6[_0x29c3('0x153')]));this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x156'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x4bdfd6['findBy']));return{'code':0xc8,'result':_0x29c3('0x157')};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x29c3('0x31')],_0x4bdfd6['findBy']));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x29c3('0xb')][_0x29c3('0x31')],_0x4bdfd6[_0x29c3('0x153')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x29c3('0x15a')]=function(_0x199786){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x199786['label']));if(!this['isConfigured'](_0x199786[_0x29c3('0x15b')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x199786,'no\x20operation\x20configured');}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('math\x20%s',_0x199786[_0x29c3('0x15b')]));var _0x374006=eval(_0x199786['operation']);if(!this[_0x29c3('0x80')](_0x199786[_0x29c3('0x113')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xd6'));}var _0x20b449=this[_0x29c3('0xf')]['sync'](this,_0x199786[_0x29c3('0x113')]);if(!_0x20b449){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x199786,_0x29c3('0xd7'));}if(_[_0x29c3('0x97')](_0x374006)){var _0x20dbad=this;_0x374006[_0x29c3('0xd8')](function(_0x241615,_0x3dc722){_0x20dbad[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x15c'),_0x20b449,_0x3dc722),_0x241615);});return this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x15d'),_0x20b449));}else{return this['channel'][_0x29c3('0xda')](_0x20b449,_0x374006);}};AGIVertices[_0x29c3('0xe')]['menu']=function(_0x5016b0){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x15e'),_0x5016b0[_0x29c3('0x2f')]));if(_0x5016b0[_0x29c3('0xa2')]===0x0){return this[_0x29c3('0xa3')](_0x5016b0);}_0x5016b0[_0x29c3('0xa2')]-=0x1;if(!this[_0x29c3('0x80')](_0x5016b0[_0x29c3('0x10e')])){return this['channel'][_0x29c3('0x25')](_0x5016b0,_0x29c3('0x15f'));}var _0x28ea4b=this['getSound'][_0x29c3('0x69')](this,_0x5016b0[_0x29c3('0x10e')]);if(!_0x28ea4b){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5016b0,_0x29c3('0x10f'));}var _0x8c8da6=this['channel'][_0x29c3('0x110')](_0x28ea4b,_0x5016b0['response'],_0x5016b0[_0x29c3('0x160')]);var _0x52fb5c=_0x8c8da6[_0x29c3('0xa0')];if(_0x8c8da6[_0x29c3('0xa0')]===-0x1){this[_0x29c3('0x2e')]['sync'](this,_0x5016b0,'-1');return _0x8c8da6;}else if(_0x8c8da6[_0x29c3('0x9d')]===_0x29c3('0x5f')){_0x8c8da6[_0x29c3('0xa0')]=_0x8c8da6[_0x29c3('0xa0')]['length']>0x0?_0x8c8da6['result']:'t';}else if(_[_0x29c3('0x3e')](_0x8c8da6['result'])){_0x8c8da6[_0x29c3('0xa0')]='#';_0x52fb5c='#';}if(!this[_0x29c3('0x80')](_0x5016b0[_0x29c3('0x113')])){this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0xc7d593=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x5016b0[_0x29c3('0x113')]);if(!_0xc7d593){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5016b0,'no\x20variable\x20found');}this[_0x29c3('0xb')][_0x29c3('0xda')](_0xc7d593,_0x52fb5c);}this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x5016b0,_0x52fb5c);return _0x8c8da6;};AGIVertices[_0x29c3('0xe')][_0x29c3('0xa6')]=function(_0x326d26){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x326d26[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x326d26[_0x29c3('0x161')]||_0x326d26[_0x29c3('0x2f')]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x162')]=function(_0x1695e6){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x163'),_0x1695e6[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x1695e6[_0x29c3('0x153')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x1695e6,_0x29c3('0x154'));}logger[_0x29c3('0x27')](util['format'](_0x29c3('0x155'),this[_0x29c3('0xb')]['callerid'],_0x1695e6[_0x29c3('0x153')]));var _0x478807=this[_0x29c3('0x47')][_0x29c3('0x69')](this,_0x1695e6['pause_id']);var _0x37be0d=this['agentPause'][_0x29c3('0x69')](this,_0x1695e6[_0x29c3('0x153')],_0x478807);if(_0x37be0d){logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x29c3('0xb')]['callerid'],_0x1695e6[_0x29c3('0x153')]));this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x156'),this['channel'][_0x29c3('0x31')],_0x1695e6[_0x29c3('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x158'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x1695e6[_0x29c3('0x153')]));this['channel'][_0x29c3('0xa6')](util['format'](_0x29c3('0x156'),this['channel'][_0x29c3('0x31')],_0x1695e6[_0x29c3('0x153')]));return{'code':0xc8,'result':_0x29c3('0x164')};}};AGIVertices['prototype'][_0x29c3('0x165')]=function(_0x450b0e){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x450b0e[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x450b0e[_0x29c3('0x10e')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x450b0e,'no\x20file\x20audio\x20selected');}var _0x327504=this[_0x29c3('0x1a')][_0x29c3('0x69')](this,_0x450b0e[_0x29c3('0x10e')]);if(!_0x327504){return this[_0x29c3('0xb')]['error'](_0x450b0e,'no\x20file\x20audio\x20found');}var _0x133bef=this[_0x29c3('0xb')]['exec']('PLAYBACK',[_0x327504,_0x450b0e['opts']]);if(_0x133bef[_0x29c3('0xa0')]===-0x1){return _0x133bef;}return this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x166'),'PLAYBACK',_0x327504));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x167')]=function(_0x4046a0){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x168'),_0x4046a0[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x4046a0['queue_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4046a0,_0x29c3('0x169'));}var _0x2bf445='';var _0x5e1960=parseInt(_0x4046a0[_0x29c3('0x16a')],0xa);if(isNaN(_0x5e1960)){_0x2bf445=_0x4046a0['queue_id'];}else{_0x2bf445=this[_0x29c3('0x16b')]['sync'](this,_0x4046a0[_0x29c3('0x16a')]);if(!_0x2bf445){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4046a0,_0x29c3('0x16c'));}}var _0x50c5f8='';if(this[_0x29c3('0x80')](_0x4046a0[_0x29c3('0x10e')])){var _0x2be117=this[_0x29c3('0x1a')]['sync'](this,_0x4046a0[_0x29c3('0x10e')]);if(_0x2be117){_0x50c5f8=_0x2be117;}}this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x4046a0,_0x2bf445);if(_0x4046a0[_0x29c3('0xe4')][_0x29c3('0x16d')]('x')<0x0){_0x4046a0[_0x29c3('0xe4')]+='x';}if(_0x4046a0[_0x29c3('0xe4')][_0x29c3('0x16d')]('X')<0x0){_0x4046a0[_0x29c3('0xe4')]+='X';}this[_0x29c3('0xb')][_0x29c3('0xda')](_0x29c3('0x16e'),_0x2bf445?_0x2bf445[_0x29c3('0x16f')]():'');var _0xa87e3a=this[_0x29c3('0xb')][_0x29c3('0x50')](_0x29c3('0x170'),[_0x2bf445,_0x4046a0[_0x29c3('0xe4')],_0x4046a0['url'],_0x50c5f8,_0x4046a0[_0x29c3('0x5f')],_0x4046a0[_0x29c3('0xb0')],_0x4046a0['macro'],_0x4046a0[_0x29c3('0x171')],'',_0x4046a0['position']]);if(_0xa87e3a[_0x29c3('0xa0')]===-0x1){return _0xa87e3a;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x166'),'QUEUE',_0x2bf445));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x172')]=function(_0xbb0351){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xbb0351[_0x29c3('0x2f')]));var _0x39f599=_0xbb0351['recordingFormat']||_0x29c3('0x12d');var _0x1e84f8=util[_0x29c3('0x22')](_0x29c3('0x173'),this[_0x29c3('0xb')][_0x29c3('0x33')],rs[_0x29c3('0x115')](0x5));var _0x4797f6=util[_0x29c3('0x22')](_0x29c3('0x174'),FILES_PATH,_0x1e84f8,_0x39f599);var _0x100390=util['format'](_0x29c3('0x136'),FILES_PATH,_0x1e84f8);this[_0x29c3('0x32')]['sync'](this,_0xbb0351,_0x1e84f8,_0x4797f6);this[_0x29c3('0xb')][_0x29c3('0xda')](_0x29c3('0x175'),_0x1e84f8);logger[_0x29c3('0x27')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x100390,_0x39f599,_0xbb0351[_0x29c3('0x176')],_0xbb0351['timeout']);return this['channel']['recordFile'](_0x100390,_0x39f599,_0xbb0351[_0x29c3('0x176')],_0xbb0351[_0x29c3('0x5f')],undefined,!![]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x177')]=function(_0x51376f){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x178'),_0x51376f[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x51376f[_0x29c3('0x5d')])){return this['channel'][_0x29c3('0xa6')](_0x29c3('0x179'));}var _0x3dd0c5=this[_0x29c3('0x5c')][_0x29c3('0x69')](this,_0x51376f);logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x17a'),util['inspect'](_0x3dd0c5,{'showHidden':![],'depth':null})));if(!this[_0x29c3('0x80')](_0x51376f[_0x29c3('0x113')])){return this[_0x29c3('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3308a4=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x51376f[_0x29c3('0x113')]);if(!_0x3308a4){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x51376f,_0x29c3('0xd7'));}this['channel']['setVariable'](util[_0x29c3('0x22')](_0x29c3('0x17b'),_0x3308a4),_0x3dd0c5['statusCode']?_0x3dd0c5[_0x29c3('0x6e')]:_0x29c3('0x17c'));this[_0x29c3('0xb')][_0x29c3('0xda')](util[_0x29c3('0x22')](_0x29c3('0x17d'),_0x3308a4),_0x3dd0c5['statusMessage']?_0x3dd0c5['statusMessage']:'OK');if(_0x3dd0c5[_0x29c3('0x64')]){try{this[_0x29c3('0x99')](_0x3dd0c5[_0x29c3('0x64')],_0x3308a4);}catch(_0x1fa911){logger[_0x29c3('0x25')](util[_0x29c3('0x22')](_0x29c3('0x17e'),_0x3308a4));}}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format'](_0x29c3('0xdd'),_0x3308a4));};AGIVertices[_0x29c3('0xe')]['saydigits']=function(_0x39fa5c){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x17f'),_0x39fa5c[_0x29c3('0x2f')]));return this['channel'][_0x29c3('0x180')](_0x39fa5c[_0x29c3('0x181')][_0x29c3('0x52')](/\s+/g,''),_0x39fa5c[_0x29c3('0x176')]);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x182')]=function(_0x4fda58){logger['info'](util[_0x29c3('0x22')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4fda58[_0x29c3('0x2f')]));return this[_0x29c3('0xb')]['sayNumber'](_0x4fda58[_0x29c3('0x60')][_0x29c3('0x52')](/\s+/g,''),_0x4fda58['escape_digits']);};AGIVertices[_0x29c3('0xe')][_0x29c3('0x183')]=function(_0x3a536c){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x184'),_0x3a536c[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0x185')](_0x3a536c['text'],_0x3a536c[_0x29c3('0x176')]);};AGIVertices['prototype']['sendMail']=function(_0x15c106){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x15c106[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x15c106['account_id'])){return this['channel'][_0x29c3('0xa6')]('no\x20mail\x20account\x20configured');}var _0x169d6c=this[_0x29c3('0x186')]['sync'](this,_0x15c106[_0x29c3('0x187')]);if(!_0x169d6c||!_0x169d6c[_0x29c3('0x188')]){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x15c106,_0x29c3('0x189'));}var _0x2cc2cd={'from':util[_0x29c3('0x22')]('\x22%s\x22\x20<%s>',_0x169d6c[_0x29c3('0x11')],_0x169d6c[_0x29c3('0x18a')]||_0x169d6c[_0x29c3('0x188')]['user']),'to':_0x15c106['to']||'','cc':_0x15c106['cc']||'','bcc':_0x15c106[_0x29c3('0x18b')]||'','subject':_0x15c106[_0x29c3('0x18c')],'html':_0x15c106['text'],'text':_0x15c106[_0x29c3('0x54')]};if(this[_0x29c3('0x80')](_0x15c106[_0x29c3('0x18d')])){}logger[_0x29c3('0xdf')]('sendMail\x20message',JSON[_0x29c3('0x6d')](_0x2cc2cd));this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x15c106,_0x15c106[_0x29c3('0x187')]);this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x18e'),_0x169d6c[_0x29c3('0x11')]));this['sendMailMessage'][_0x29c3('0x69')](this,_0x169d6c[_0x29c3('0x18f')],_0x2cc2cd);return this[_0x29c3('0xb')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x29c3('0x190')]=function(_0x218ffb){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x191'),_0x218ffb[_0x29c3('0x2f')]));return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x192'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x193')]=function(_0x2189bd){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2189bd['label']));if(!this[_0x29c3('0x80')](_0x2189bd[_0x29c3('0x194')])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x195'));}var _0x5cb95d=this[_0x29c3('0x196')][_0x29c3('0x69')](this,_0x2189bd[_0x29c3('0x194')]);if(!_0x5cb95d){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x2189bd,_0x29c3('0x197'));}var _0x56a798={'body':_0x2189bd['sms_text'],'phone':_0x2189bd['to']||'','SmsAccountId':_0x5cb95d['id']};logger[_0x29c3('0xdf')](_0x29c3('0x198'),JSON[_0x29c3('0x6d')](_0x56a798));this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x2189bd,_0x2189bd[_0x29c3('0x194')]);this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x199'),_0x5cb95d[_0x29c3('0x11')]));this['createSmsMessage'][_0x29c3('0x69')](this,_0x56a798);return this['channel']['noop'](_0x29c3('0x19a'));};AGIVertices['prototype'][_0x29c3('0x19b')]=function(_0x2f9907){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x19c'),_0x2f9907[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x2f9907['variable_id'])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x2f9907,_0x29c3('0x19d'));}var _0x5539ef=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x2f9907[_0x29c3('0x113')]);if(!_0x5539ef){return this['channel'][_0x29c3('0x25')](_0x2f9907,_0x29c3('0xd7'));}return this[_0x29c3('0xb')]['setVariable'](_0x5539ef,_0x2f9907[_0x29c3('0x19e')]);};AGIVertices[_0x29c3('0xe')]['start']=function(_0x485253){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x19f'),_0x485253[_0x29c3('0x2f')]));this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0x1a0'));if(_0x485253[_0x29c3('0xb3')]==='yes'){this[_0x29c3('0xb')]['noop'](_0x29c3('0x1a1'));return this[_0x29c3('0xb')]['answer']();}return this[_0x29c3('0xb')][_0x29c3('0xa6')]('Skipped\x20Answer');};AGIVertices[_0x29c3('0xe')]['subproject']=function(_0x5cad66){logger['info'](util['format'](_0x29c3('0x1a2'),_0x5cad66[_0x29c3('0x2f')]));if(!this['isConfigured'](_0x5cad66[_0x29c3('0x1a3')])){return this['channel'][_0x29c3('0x25')](_0x5cad66,_0x29c3('0x1a4'));}var _0x97412c=this[_0x29c3('0x14')][_0x29c3('0x69')](this,_0x5cad66[_0x29c3('0x1a3')]);if(!this['isConfigured'](_0x97412c)){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5cad66,util[_0x29c3('0x22')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5cad66[_0x29c3('0x1a3')]));}if(_0x97412c===this[_0x29c3('0xb')][_0x29c3('0x3a')]){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x5cad66,_0x29c3('0x1a5'));}this['createSquareDetailsReport']['sync'](this,_0x5cad66,_0x97412c);var _0x1d736f=this[_0x29c3('0xb')]['exec']('AGI',util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x29c3('0xb0')][_0x29c3('0x1a6')]||'127.0.0.1',_0x97412c,this[_0x29c3('0xb')][_0x29c3('0x3a')]));if(_0x1d736f[_0x29c3('0xa0')]===-0x1){return _0x1d736f;}return this[_0x29c3('0xb')][_0x29c3('0xa6')](util['format'](_0x29c3('0x166'),_0x29c3('0x1a7'),_0x97412c));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1a8')]=function(_0x2d1d48){logger['info'](util[_0x29c3('0x22')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x2d1d48['label']));var _0x813065=this[_0x29c3('0x4f')][_0x29c3('0x69')](this,_0x2d1d48['command']);this[_0x29c3('0x2e')][_0x29c3('0x69')](this,_0x2d1d48,_0x2d1d48['command']);if(this[_0x29c3('0x80')](_0x2d1d48[_0x29c3('0x113')])){var _0x9ade88=this[_0x29c3('0xf')]['sync'](this,_0x2d1d48[_0x29c3('0x113')]);if(_0x9ade88){this[_0x29c3('0xb')][_0x29c3('0xda')](_0x9ade88,_0x813065);return this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x2d1d48[_0x29c3('0xb1')],_0x9ade88));}}return this['channel'][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x1a9'),_0x2d1d48['command']));};AGIVertices['prototype'][_0x29c3('0x1aa')]=function(_0x2c593e){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x1ab'),_0x2c593e[_0x29c3('0x2f')]));_0x2c593e[_0x29c3('0x54')]=_0x2c593e[_0x29c3('0x54')][_0x29c3('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x29c3('0x80')](_0x2c593e['apiKey'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')]('no\x20apiKey\x20configured');}if(!this[_0x29c3('0x80')](_0x2c593e[_0x29c3('0x54')])){return this[_0x29c3('0xb')]['noop'](_0x29c3('0xc4'));}this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2c593e['text']));var _0x3b1b6f=this[_0x29c3('0x53')][_0x29c3('0x69')](this,_0x2c593e);if(_0x3b1b6f){this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x1ac'),_0x3b1b6f));var _0x3e506b=this['channel'][_0x29c3('0x100')](_0x3b1b6f);try{fs['unlink'](_0x3b1b6f+_0x29c3('0x101'));}catch(_0x4ce46e){logger['error'](_0x4ce46e);}return _0x3e506b;}return this['channel']['error'](_0x2c593e,_0x29c3('0x1ad'));};AGIVertices['prototype']['tts']=function(_0x4046ec){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x1ae'),_0x4046ec[_0x29c3('0x2f')]));_0x4046ec['text']=_0x4046ec['text'][_0x29c3('0x52')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x29c3('0x80')](_0x4046ec['text'])){return this[_0x29c3('0xb')][_0x29c3('0xa6')](_0x29c3('0xc4'));}this[_0x29c3('0xb')]['noop'](util[_0x29c3('0x22')](_0x29c3('0x1af'),_0x4046ec[_0x29c3('0x54')]));var _0x1eae53=this[_0x29c3('0x5a')][_0x29c3('0x69')](this,_0x4046ec);if(_0x1eae53){this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x1b0'),_0x1eae53));var _0xcdf791=this['channel'][_0x29c3('0x100')](_0x1eae53);try{fs['unlink'](_0x1eae53+_0x29c3('0x101'));}catch(_0x31b5cd){logger[_0x29c3('0x25')](_0x31b5cd);}return _0xcdf791;}return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x4046ec,_0x29c3('0x1b1'));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1b2')]=function(_0x16277b){logger[_0x29c3('0x27')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x16277b[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x16277b[_0x29c3('0x153')])){return this['channel']['error'](_0x16277b,_0x29c3('0x154'));}logger[_0x29c3('0x27')](util['format'](_0x29c3('0x155'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x16277b[_0x29c3('0x153')]));var _0x1b66f7=this[_0x29c3('0x4b')][_0x29c3('0x69')](this,_0x16277b[_0x29c3('0x153')]);if(_0x1b66f7){logger[_0x29c3('0x27')](util['format'](_0x29c3('0x156'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x16277b[_0x29c3('0x153')]));this[_0x29c3('0xb')][_0x29c3('0xa6')](util[_0x29c3('0x22')](_0x29c3('0x156'),this['channel']['callerid'],_0x16277b[_0x29c3('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x29c3('0x27')](util[_0x29c3('0x22')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x29c3('0xb')]['callerid'],_0x16277b[_0x29c3('0x153')]));this['channel']['noop'](util[_0x29c3('0x22')](_0x29c3('0x158'),this[_0x29c3('0xb')][_0x29c3('0x31')],_0x16277b[_0x29c3('0x153')]));return{'code':0xc8,'result':_0x29c3('0x164')};}};AGIVertices['prototype'][_0x29c3('0x1b3')]=function(_0x1f2017){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1f2017[_0x29c3('0x2f')]));var _0x3b451a=this[_0x29c3('0xb')][_0x29c3('0x50')]('VOICEMAIL',[_0x1f2017[_0x29c3('0x1b4')],_0x1f2017[_0x29c3('0x72')]]);if(_0x3b451a['result']===-0x1){return _0x3b451a;}return this[_0x29c3('0xb')]['noop'](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x1f2017[_0x29c3('0x1b4')]));};AGIVertices[_0x29c3('0xe')][_0x29c3('0x1b5')]=function(_0x550f1d){logger[_0x29c3('0x27')](util[_0x29c3('0x22')](_0x29c3('0x1b6'),_0x550f1d[_0x29c3('0x2f')]));if(!this[_0x29c3('0x80')](_0x550f1d[_0x29c3('0x113')])){return this[_0x29c3('0xb')][_0x29c3('0x25')](_0x550f1d,_0x29c3('0x19d'));}var _0x412163=this[_0x29c3('0xf')][_0x29c3('0x69')](this,_0x550f1d[_0x29c3('0x113')]);if(!_0x412163){return this[_0x29c3('0xb')]['error'](_0x550f1d,_0x29c3('0xd7'));}var _0x17ff44=this[_0x29c3('0xb')][_0x29c3('0xf')](_0x412163);return{'code':0xc8,'result':_0x17ff44[_0x29c3('0x9d')]?_0x17ff44[_0x29c3('0x9d')]:'-'};};String[_0x29c3('0xe')][_0x29c3('0x9c')]=function(_0x1b70a5,_0x4f4e68){return this[_0x29c3('0x9b')](_0x1b70a5)[_0x29c3('0x1b7')](_0x4f4e68);};module[_0x29c3('0x1b8')]=AGIVertices;
\ No newline at end of file
+var _0x0c1a=['maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','grammar','no\x20grammar\x20configured','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','Trying\x20DialogflowV2:\x20%s','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','NOBEEP','recordFile','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechASR','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','Trying\x20SendMail\x20with\x20account\x20%s','sendMailMessage','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','arg_1','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','util','lodash','shelljs','moment','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','prototype','getVariableById','then','catch','getVoiceQueue','name','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','label','agicommand','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','internal','%s/%s@from-sip/n','agentLogin','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','method','timeout','number','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','url','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s'];(function(_0x229f05,_0x119629){var _0x4fb588=function(_0x26c469){while(--_0x26c469){_0x229f05['push'](_0x229f05['shift']());}};_0x4fb588(++_0x119629);}(_0x0c1a,0x127));var _0xa0c1=function(_0x474309,_0x1e0bb1){_0x474309=_0x474309-0x0;var _0x4f95eb=_0x0c1a[_0x474309];return _0x4f95eb;};'use strict';var fs=require('fs');var util=require(_0xa0c1('0x0'));var _=require(_0xa0c1('0x1'));var sh=require(_0xa0c1('0x2'));var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xa0c1('0x3'));var Mustache=require('mustache');var rp=require(_0xa0c1('0x4'));var logger=require(_0xa0c1('0x5'))(_0xa0c1('0x6'));var config=require(_0xa0c1('0x7'));var shared=require(_0xa0c1('0x8'));var scripts=require(_0xa0c1('0x9'));var FILES_PATH=_0xa0c1('0xa');var recursiveMapAttributes=[_0xa0c1('0xb'),_0xa0c1('0xc')];var verticesWithRetry=[_0xa0c1('0xd'),'getdigits',_0xa0c1('0xe')];var AGIVertices=function(_0x166e8f,_0x119df0,_0x1afec5){this[_0xa0c1('0xf')]=_0x166e8f;this[_0xa0c1('0x10')]=_0x119df0;this['mailRpc']=_0x1afec5;};AGIVertices[_0xa0c1('0x11')]['getVariable']=function(_0x269f4c,_0x5d2f84){this['rpc'][_0xa0c1('0x12')](_0x269f4c)[_0xa0c1('0x13')](function(_0x25d55d){_0x5d2f84(null,_0x25d55d?_0x25d55d['name']:![]);})[_0xa0c1('0x14')](function(_0xd201d8){_0x5d2f84(_0xd201d8);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x15')]=function(_0x1cafb2,_0x1b7287){this['rpc']['getVoiceQueueById'](_0x1cafb2)[_0xa0c1('0x13')](function(_0x35c8fd){_0x1b7287(null,_0x35c8fd?_0x35c8fd[_0xa0c1('0x16')]:![]);})[_0xa0c1('0x14')](function(_0x10f3dc){_0x1b7287(_0x10f3dc);});};AGIVertices['prototype']['getSquareProject']=function(_0x3f70a4,_0x10dc55){this[_0xa0c1('0x10')][_0xa0c1('0x17')](_0x3f70a4)['then'](function(_0x29a801){_0x10dc55(null,_0x29a801?_0x29a801['name']:![]);})[_0xa0c1('0x14')](function(_0x509327){_0x10dc55(_0x509327);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x18')]=function(_0x956323,_0x11dbc6){this[_0xa0c1('0x10')]['getSquareOdbcById'](_0x956323)[_0xa0c1('0x13')](function(_0x409a8d){_0x11dbc6(null,_0x409a8d?_0x409a8d[_0xa0c1('0x19')]:![]);})[_0xa0c1('0x14')](function(_0x1c880a){_0x11dbc6(_0x1c880a);});};AGIVertices['prototype'][_0xa0c1('0x1a')]=function(_0x41bfc7,_0xf95130){this['rpc'][_0xa0c1('0x1b')](_0x41bfc7)[_0xa0c1('0x13')](function(_0x585393){_0xf95130(null,_0x585393?_0x585393['name']:![]);})[_0xa0c1('0x14')](function(_0xb88f2){_0xf95130(_0xb88f2);});};AGIVertices['prototype'][_0xa0c1('0x1c')]=function(_0x26b267,_0xb2237d){this[_0xa0c1('0x10')]['getTrunkById'](_0x26b267)[_0xa0c1('0x13')](function(_0x634887){_0xb2237d(null,_0x634887?_0x634887[_0xa0c1('0x16')]:![]);})['catch'](function(_0x30c757){_0xb2237d(_0x30c757);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1d')]=function(_0x3ed7b5,_0x217a5f){var _0x49530b=this;this['rpc'][_0xa0c1('0x1e')](_0x3ed7b5)[_0xa0c1('0x13')](function(_0x3be9e2){_0x217a5f(null,_0x3be9e2?_0x49530b[_0xa0c1('0x1f')](_0x3be9e2[_0xa0c1('0x20')]):![]);})[_0xa0c1('0x14')](function(_0x44114e){_0x217a5f(_0x44114e);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x21')]=function(_0x121e2a,_0x24a5bf){this['rpc'][_0xa0c1('0x22')](_0x121e2a)['then'](function(_0xcd1f57){_0x24a5bf(null,_0xcd1f57?_0xcd1f57:![]);})[_0xa0c1('0x14')](function(_0x5d3344){_0x24a5bf(_0x5d3344);});};AGIVertices[_0xa0c1('0x11')]['sendMailMessage']=function(_0x28fb4e,_0x4e4498,_0x575e98){this['mailRpc']['sendMailMessage'](_0x28fb4e,_0x4e4498)[_0xa0c1('0x13')](function(){_0x575e98(null);})[_0xa0c1('0x14')](function(_0x1db772){_0x575e98(_0x1db772);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x23')]=function(_0x256bb6,_0x31a7fd){this['rpc'][_0xa0c1('0x24')](_0x256bb6)[_0xa0c1('0x13')](function(_0x39c846){if(_0x39c846){if(_0x39c846[_0xa0c1('0x25')]){_0x31a7fd(null,[_0x39c846[_0xa0c1('0x26')]]);}else{_0x31a7fd(null,_[_0xa0c1('0x27')](_0x39c846[_0xa0c1('0x28')],_0xa0c1('0x26')));}}else{_0x31a7fd(null,![]);}})['catch'](function(_0x38fcbb){_0x31a7fd(_0x38fcbb);});};AGIVertices['prototype'][_0xa0c1('0x1f')]=function(_0x2f025b){return util[_0xa0c1('0x29')](_0xa0c1('0x2a'),FILES_PATH,_0x2f025b);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x2b')]=function(_0x4d9c24,_0x4fa2a3,_0xece281){odbc[_0xa0c1('0x2c')](_0x4d9c24,function(_0x250305){if(_0x250305){logger[_0xa0c1('0x2d')](_0xa0c1('0x2e'),_0x250305);_0xece281(_0x250305);}else{logger[_0xa0c1('0x2f')]('ODBC\x20connection\x20successfully');odbc[_0xa0c1('0x30')](_0x4fa2a3,function(_0x2542d8,_0x1a9251){if(_0x2542d8){logger[_0xa0c1('0x2f')]('Error\x20executing\x20query\x20%s',_0x4fa2a3);_0xece281(_0x2542d8);}else{logger[_0xa0c1('0x2f')]('Query\x20executed\x20correctly\x20%s',_0x4fa2a3);odbc[_0xa0c1('0x31')](function(_0x3bf0be){if(_0x3bf0be){logger[_0xa0c1('0x2d')](_0xa0c1('0x32'),_0x3bf0be);}_0xece281(null,_0x1a9251);});}});}});};AGIVertices['prototype'][_0xa0c1('0x33')]=function(_0x47a5e7,_0x20db9e){this[_0xa0c1('0x10')]['getSmsAccountById'](_0x47a5e7)[_0xa0c1('0x13')](function(_0xa1f005){_0x20db9e(null,_0xa1f005?_0xa1f005:![]);})[_0xa0c1('0x14')](function(_0x1ecb8c){_0x20db9e(_0x1ecb8c);});};AGIVertices[_0xa0c1('0x11')]['createSmsMessage']=function(_0x3ff66f,_0x4b40b9){this[_0xa0c1('0x10')][_0xa0c1('0x34')](_0x3ff66f)['then'](function(_0x4dcc72){_0x4b40b9(null,_0x4dcc72);})['catch'](function(_0x7b0c65){_0x4b40b9(_0x7b0c65);});};AGIVertices['prototype'][_0xa0c1('0x35')]=function(_0x2561ba,_0x2bc730,_0x1a4dce){this[_0xa0c1('0x10')][_0xa0c1('0x35')]({'uniqueid':this[_0xa0c1('0xf')]['uniqueid'],'node':_0x2561ba[_0xa0c1('0x36')],'application':_0x2561ba[_0xa0c1('0x37')],'data':_0x2bc730||null,'project_name':this['channel']['arg_1'],'callerid':this[_0xa0c1('0xf')][_0xa0c1('0x38')]})[_0xa0c1('0x13')](function(_0x42c058){if(_0x1a4dce){_0x1a4dce(null,_0x42c058);}})['catch'](function(_0x5ccd7d){if(_0x1a4dce){_0x1a4dce(_0x5ccd7d);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x4653ba,_0x2841fb,_0x5706d7,_0x3dd230){this['rpc'][_0xa0c1('0x39')]({'uniqueid':this['channel'][_0xa0c1('0x3a')],'callerid':this['channel'][_0xa0c1('0x38')],'calleridname':this[_0xa0c1('0xf')][_0xa0c1('0x3b')],'context':this['channel'][_0xa0c1('0x3c')],'extension':this[_0xa0c1('0xf')][_0xa0c1('0x3d')],'priority':this[_0xa0c1('0xf')][_0xa0c1('0x3e')],'accountcode':this[_0xa0c1('0xf')][_0xa0c1('0x3f')],'dnid':this[_0xa0c1('0xf')]['dnid'],'projectName':this[_0xa0c1('0xf')]['arg_1'],'saveName':_0x2841fb,'filename':_0x4653ba[_0xa0c1('0x40')]||_0x2841fb,'savePath':_0x5706d7})['then'](function(_0x5479d7){_0x3dd230(null,_0x5479d7);})[_0xa0c1('0x14')](function(_0x245987){_0x3dd230(_0x245987);});};AGIVertices['prototype'][_0xa0c1('0x41')]=function(_0x5df18c,_0x2c3416,_0x2b09c3,_0x559a9c,_0x575b7e){this['rpc'][_0xa0c1('0x41')]({'uniqueid':this['channel'][_0xa0c1('0x3a')],'body':_0x5df18c,'direction':_0x2c3416,'providerName':_0x2b09c3,'providerResponse':_0x559a9c})['then'](function(_0x4771e5){if(_0x575b7e){_0x575b7e(null,_0x4771e5);}})[_0xa0c1('0x14')](function(_0x472d53){if(_0x575b7e){_0x575b7e(_0x472d53);}});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x42')]=function(_0x20eaad,_0x338b51){this[_0xa0c1('0x10')][_0xa0c1('0x42')]({'firstName':_[_0xa0c1('0x43')](_0x20eaad[_0xa0c1('0x16')])||_[_0xa0c1('0x44')](_0x20eaad[_0xa0c1('0x16')])?'callback_'+Math[_0xa0c1('0x45')]():_0x20eaad[_0xa0c1('0x16')],'lastName':_[_0xa0c1('0x43')](_0x20eaad[_0xa0c1('0x46')])||_[_0xa0c1('0x44')](_0x20eaad[_0xa0c1('0x46')])?null:_0x20eaad[_0xa0c1('0x46')],'phone':_0x20eaad[_0xa0c1('0x47')],'ListId':_0x20eaad[_0xa0c1('0x48')],'scheduledat':_0x20eaad[_0xa0c1('0x49')],'callbackUniqueid':this[_0xa0c1('0xf')][_0xa0c1('0x3a')],'tags':_0xa0c1('0x4a'),'description':_0xa0c1('0x4b')+_0x20eaad[_0xa0c1('0x49')][_0xa0c1('0x4c')](),'priority':_0x20eaad[_0xa0c1('0x4d')]})[_0xa0c1('0x13')](function(_0x1baa07){_0x338b51(null,_0x1baa07);})[_0xa0c1('0x14')](function(_0x1917ec){_0x338b51(_0x1917ec);});};AGIVertices['prototype'][_0xa0c1('0x4e')]=function(_0x2eee65,_0x2f26ac){this[_0xa0c1('0x10')]['getPauseById'](_0x2eee65)[_0xa0c1('0x13')](function(_0x43cc3e){_0x2f26ac(null,_0x43cc3e?_0x43cc3e[_0xa0c1('0x16')]:![]);})['catch'](function(_0x27e84b){_0x2f26ac(_0x27e84b);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x4f')]=function(_0xa99acf,_0x30acca,_0x33150f){var _0xb03a9={'role':'agent'};_0xb03a9[_0xa99acf]=this['channel']['callerid'];this[_0xa0c1('0x10')][_0xa0c1('0x4f')](_0xb03a9,_0x30acca,this[_0xa0c1('0xf')][_0xa0c1('0x3a')])[_0xa0c1('0x13')](function(_0x1ad99d){_0x33150f(null,_[_0xa0c1('0x44')](_0x1ad99d)?![]:!![]);})[_0xa0c1('0x14')](function(_0xc402f0){logger[_0xa0c1('0x2d')](_0xc402f0);_0x33150f(null,![]);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x50')]=function(_0x2239c0,_0x5c7548){var _0x4fbc24={'role':_0xa0c1('0x51')};_0x4fbc24[_0x2239c0]=this['channel'][_0xa0c1('0x38')];this['rpc'][_0xa0c1('0x50')](_0x4fbc24)[_0xa0c1('0x13')](function(_0x291230){_0x5c7548(null,_['isNil'](_0x291230)?![]:!![]);})[_0xa0c1('0x14')](function(_0x547c38){logger['error'](_0x547c38);_0x5c7548(null,![]);});};AGIVertices[_0xa0c1('0x11')]['agentLogout']=function(_0x44e6d4,_0x1820ef){var _0x3fa9a7={'role':_0xa0c1('0x51')};_0x3fa9a7[_0x44e6d4]=this['channel'][_0xa0c1('0x38')];this[_0xa0c1('0x10')][_0xa0c1('0x52')](_0x3fa9a7)[_0xa0c1('0x13')](function(_0x49cb6d){_0x1820ef(null,_[_0xa0c1('0x44')](_0x49cb6d)?![]:!![]);})[_0xa0c1('0x14')](function(_0x29e5bb){logger[_0xa0c1('0x2d')](_0x29e5bb);_0x1820ef(null,![]);});};AGIVertices[_0xa0c1('0x11')]['agentLogin']=function(_0x27a8ea,_0x5cf82a){var _0x511aea={'role':'agent'};_0x511aea[_0x27a8ea]=this['channel']['callerid'];var _0x774926=_0x27a8ea!=_0xa0c1('0x53')?util[_0xa0c1('0x29')](_0xa0c1('0x54'),'LOCAL',this[_0xa0c1('0xf')][_0xa0c1('0x38')]):undefined;this[_0xa0c1('0x10')][_0xa0c1('0x55')](_0x511aea,_0x774926)[_0xa0c1('0x13')](function(_0x5d0f8a){_0x5cf82a(null,_[_0xa0c1('0x44')](_0x5d0f8a)?![]:!![]);})['catch'](function(_0x223054){logger[_0xa0c1('0x2d')](_0x223054);_0x5cf82a(null,![]);});};AGIVertices[_0xa0c1('0x11')]['shellCommand']=function(_0x137b8d,_0x416404){sh[_0xa0c1('0x56')](_[_0xa0c1('0x57')](_0x137b8d),function(_0x5994c3,_0x29788a){var _0x3afad9=_0x29788a[_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'');_0x416404(null,_0x3afad9);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x59')]=function(_0x124e41,_0x345df6){scripts[_0xa0c1('0x59')](_0x124e41[_0xa0c1('0x5a')],_0x124e41['google_cloud_tts_text_type']||_0xa0c1('0x5b'),_0x124e41[_0xa0c1('0x5b')],_0x124e41[_0xa0c1('0x5c')]||_0xa0c1('0x5d'),_0x124e41[_0xa0c1('0x5e')]||_0xa0c1('0x5f'),_0x124e41['audioEncoding']||'MP3')[_0xa0c1('0x13')](function(_0x338d2f){_0x345df6(null,_0x338d2f);})[_0xa0c1('0x14')](function(_0x3e1ee8){_0x345df6(_0x3e1ee8);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x60')]=function(_0x132acd,_0x37b091){scripts[_0xa0c1('0x60')](_0x132acd[_0xa0c1('0x5b')],_0x132acd[_0xa0c1('0x61')]||'en',0x1)['then'](function(_0x18b0cd){_0x37b091(null,_0x18b0cd);})[_0xa0c1('0x14')](function(_0x6fa296){_0x37b091(_0x6fa296);});};AGIVertices[_0xa0c1('0x11')]['restAPI']=function(_0x239bcd,_0x12928e){var _0x4ef956={'uri':_0x239bcd['url'],'method':_0x239bcd[_0xa0c1('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x239bcd[_0xa0c1('0x63')])===_0xa0c1('0x64')&&parseInt(_0x239bcd['timeout'])>=0x1?parseInt(_0x239bcd[_0xa0c1('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xa0c1('0x65')]([_0xa0c1('0x66'),'PUT'],_0x4ef956[_0xa0c1('0x62')][_0xa0c1('0x67')]())){try{_0x4ef956[_0xa0c1('0x68')]=_0x239bcd['rawBody']?JSON[_0xa0c1('0x69')](_0x239bcd[_0xa0c1('0xc')]):{};}catch(_0x21b9e7){logger[_0xa0c1('0x2d')](_0xa0c1('0x6a'),_0x21b9e7);}}try{_0x4ef956[_0xa0c1('0x6b')]=_0x239bcd[_0xa0c1('0xb')]?JSON['parse'](_0x239bcd['rawHeaders']):{};}catch(_0x1a633c){logger['error'](_0xa0c1('0x6c'),_0x1a633c);}if(_0x239bcd[_0xa0c1('0x6d')]){try{var _0x376d44=require(_0x239bcd[_0xa0c1('0x6d')])[_0xa0c1('0x6e')](this,_0x4ef956);_0x4ef956[_0xa0c1('0x6f')]=Mustache['render'](_0x239bcd[_0xa0c1('0x70')],_0x376d44,{},['$$','$$']);if(_0x4ef956['headers']){_0x4ef956[_0xa0c1('0x6b')]=JSON[_0xa0c1('0x69')](Mustache[_0xa0c1('0x71')](JSON[_0xa0c1('0x72')](_0x4ef956['headers']),_0x376d44,{},['$$','$$']));}if(_0x4ef956[_0xa0c1('0x68')]){_0x4ef956['body']=JSON[_0xa0c1('0x69')](Mustache[_0xa0c1('0x71')](JSON[_0xa0c1('0x72')](_0x4ef956[_0xa0c1('0x68')]),_0x376d44,{},['$$','$$']));}}catch(_0x34594a){logger[_0xa0c1('0x2d')](_0xa0c1('0x73'),_0x34594a);}}rp(_0x4ef956)[_0xa0c1('0x13')](function(_0x3f69cc){var _0x449dd1={'statusCode':_0x3f69cc[_0xa0c1('0x74')]||0xc8,'statusMessage':_0x3f69cc[_0xa0c1('0x75')]||'OK','headers':_0x3f69cc[_0xa0c1('0x6b')]||{},'body':_0x3f69cc['body']||{}};_0x12928e(null,_0x449dd1);})[_0xa0c1('0x14')](function(_0x4a8cb2){var _0x3c87c9={'statusCode':_0x4a8cb2['statusCode']||0x1f4,'statusMessage':_0x4a8cb2[_0xa0c1('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4a8cb2[_0xa0c1('0x77')]['headers']||{},'body':_0x4a8cb2[_0xa0c1('0x77')][_0xa0c1('0x68')]||{}};_0x12928e(null,_0x3c87c9);});};AGIVertices[_0xa0c1('0x11')]['googleDialogflow']=function(_0x14863e,_0x5d846a){scripts['googleDialogflow'](this[_0xa0c1('0xf')][_0xa0c1('0x3a')],_0x14863e['key'],_0x14863e[_0xa0c1('0x5b')],_0x14863e[_0xa0c1('0x78')]||'en')[_0xa0c1('0x13')](function(_0x3435c4){_0x5d846a(null,_0x3435c4);})['catch'](function(_0x9e7281){_0x5d846a(_0x9e7281);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x79')]=function(_0x25a64c,_0x39c630){scripts[_0xa0c1('0x79')](this['channel'][_0xa0c1('0x3a')],_0x25a64c[_0xa0c1('0x7a')],_0x25a64c[_0xa0c1('0x7b')],_0x25a64c['private_key'],_0x25a64c[_0xa0c1('0x5b')],_0x25a64c[_0xa0c1('0x7c')]||'en')[_0xa0c1('0x13')](function(_0x1534b6){_0x39c630(null,_0x1534b6);})[_0xa0c1('0x14')](function(_0x5865bc){_0x39c630(_0x5865bc);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x7d')]=function(_0xcce523,_0x282e76){scripts[_0xa0c1('0x7d')](this[_0xa0c1('0xf')],_0xcce523)[_0xa0c1('0x13')](function(_0x6b8e43){_0x282e76(null,_0x6b8e43);})['catch'](function(_0xf81df3){_0x282e76(_0xf81df3);});};AGIVertices['prototype'][_0xa0c1('0x7e')]=function(_0xd4a776,_0x42b289){scripts[_0xa0c1('0x7e')](_0xd4a776[_0xa0c1('0x7f')],_0xd4a776[_0xa0c1('0x5b')],_0xd4a776[_0xa0c1('0x80')]||'en-US',_0xd4a776['speed'])[_0xa0c1('0x13')](function(_0x4d4979){_0x42b289(null,_0x4d4979);})[_0xa0c1('0x14')](function(_0x3732f1){_0x42b289(_0x3732f1);});};AGIVertices[_0xa0c1('0x11')]['ispeechASR']=function(_0x14c94d,_0x4f5e73,_0xfce59c){scripts['ispeechASR'](_0x4f5e73,_0x14c94d[_0xa0c1('0x7f')],_0x14c94d[_0xa0c1('0x81')]||'en-US',this[_0xa0c1('0x82')](_0x14c94d['model'])?_0x14c94d[_0xa0c1('0x83')]:undefined)[_0xa0c1('0x13')](function(_0x39956c){_0xfce59c(null,_0x39956c);})['catch'](function(_0x59aa5d){_0xfce59c(_0x59aa5d);});};AGIVertices[_0xa0c1('0x11')]['awsPolly']=function(_0x386bd4,_0x29f391){scripts[_0xa0c1('0x84')](_0x386bd4[_0xa0c1('0x85')],_0x386bd4[_0xa0c1('0x86')],_0x386bd4[_0xa0c1('0x87')],_0x386bd4[_0xa0c1('0x88')]||_0xa0c1('0x89'),_0x386bd4[_0xa0c1('0x5b')],_0x386bd4[_0xa0c1('0x8a')]||_0xa0c1('0x5b'))[_0xa0c1('0x13')](function(_0x25c64a){_0x29f391(null,_0x25c64a);})['catch'](function(_0x3a4ad5){_0x29f391(_0x3a4ad5);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x8b')]=function(_0x49ebc6,_0xf714be){scripts['awsLex'](this[_0xa0c1('0xf')][_0xa0c1('0x3a')],_0x49ebc6['aws_access_key_id'],_0x49ebc6[_0xa0c1('0x86')],_0x49ebc6[_0xa0c1('0x8c')],_0x49ebc6['text'],_0x49ebc6['aws_bot_name'])[_0xa0c1('0x13')](function(_0x59c9c4){_0xf714be(null,_0x59c9c4);})[_0xa0c1('0x14')](function(_0x22943b){_0xf714be(_0x22943b);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x8d')]=function(_0x3fd4fa,_0x4fdc1d,_0x513e10){scripts[_0xa0c1('0x8d')](_0x4fdc1d,_0x3fd4fa[_0xa0c1('0x7f')],_0x3fd4fa[_0xa0c1('0x8e')]||_0xa0c1('0x5d'))[_0xa0c1('0x13')](function(_0x2d9c8a){_0x513e10(null,_0x2d9c8a);})[_0xa0c1('0x14')](function(_0x21c852){_0x513e10(_0x21c852);});};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x8f')]=function(_0x55caab,_0x35e840,_0xe741b3){scripts[_0xa0c1('0x8f')](_0x35e840,_0x55caab['appid'],_0x55caab[_0xa0c1('0x90')],_0x55caab[_0xa0c1('0x6f')])['then'](function(_0x3d524a){_0xe741b3(null,_0x3d524a);})[_0xa0c1('0x14')](function(_0x40ed74){_0xe741b3(_0x40ed74);});};AGIVertices['prototype'][_0xa0c1('0x91')]=function(_0x5ae6e6){var _0x1cc8e6=_[_0xa0c1('0x65')](verticesWithRetry,_0x5ae6e6[_0xa0c1('0x37')])?_0x5ae6e6:_[_0xa0c1('0x92')](_0x5ae6e6);for(var _0x3e441e in _0x1cc8e6){if(_0x1cc8e6[_0xa0c1('0x93')](_0x3e441e)){if(_0x1cc8e6[_0x3e441e]&&_['isString'](_0x1cc8e6[_0x3e441e])){if(_[_0xa0c1('0x65')](recursiveMapAttributes,_0x3e441e)){_0x1cc8e6[_0x3e441e]=this[_0xa0c1('0x94')](_0x1cc8e6[_0x3e441e]);}else{_0x1cc8e6[_0x3e441e]=this['replaceAllVariables'](_0x1cc8e6[_0x3e441e]);}}}}return _0x1cc8e6;};AGIVertices[_0xa0c1('0x11')]['recursiveNodeIndex']=function(_0xe9ab80){for(var _0x5aca45 in _0xe9ab80){if(_0xe9ab80[_0xa0c1('0x93')](_0x5aca45)){if(_['isPlainObject'](_0xe9ab80[_0x5aca45])){this[_0xa0c1('0x95')](_0xe9ab80[_0x5aca45]);}else if(_['isArray'](_0xe9ab80[_0x5aca45])){for(var _0x44d5ad=0x0;_0x44d5ad<_0xe9ab80[_0x5aca45][_0xa0c1('0x96')];_0x44d5ad++){this['recursiveNodeIndex'](_0xe9ab80[_0x5aca45][_0x44d5ad]);}}else if(_[_0xa0c1('0x97')](_0xe9ab80[_0x5aca45])){_0xe9ab80[_0x5aca45]=this[_0xa0c1('0x98')](_0xe9ab80[_0x5aca45]);}}}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x99')]=function(_0x5a5d5f,_0x4eeccb){for(var _0x45c2d4 in _0x5a5d5f){if(_0x5a5d5f[_0xa0c1('0x93')](_0x45c2d4)){if(_['isPlainObject'](_0x5a5d5f[_0x45c2d4])){if(!_[_0xa0c1('0x43')](_0x5a5d5f[_0x45c2d4])){this[_0xa0c1('0x99')](_0x5a5d5f[_0x45c2d4],util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x4eeccb,_0x45c2d4));}}else if(_[_0xa0c1('0x9b')](_0x5a5d5f[_0x45c2d4])){for(var _0x163e94=0x0;_0x163e94<_0x5a5d5f[_0x45c2d4][_0xa0c1('0x96')];_0x163e94++){this[_0xa0c1('0x99')](_0x5a5d5f[_0x45c2d4][_0x163e94],util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x4eeccb,_0x45c2d4+'['+_0x163e94+']'));}}else{if(!_[_0xa0c1('0x44')](_0x5a5d5f[_0x45c2d4])){this['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')]('%s.%s',_0x4eeccb,_0x45c2d4),_0x5a5d5f[_0x45c2d4]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x2111fc){try{var _0x54fabf=JSON[_0xa0c1('0x69')](_0x2111fc);this[_0xa0c1('0x95')](_0x54fabf);return JSON['stringify'](_0x54fabf);}catch(_0x56bab3){return this['replaceAllVariables'](_0x2111fc);}};AGIVertices[_0xa0c1('0x11')]['replaceAllVariables']=function(_0x3026ba){var _0x22d0e6=_0x3026ba['split']('{');for(var _0x460ecd=0x1;_0x460ecd<_0x22d0e6['length'];_0x460ecd+=0x1){var _0x8b1328=_0x22d0e6[_0x460ecd][_0xa0c1('0x9d')]('}');if(_0x8b1328['length']>0x1){_0x3026ba=_0x3026ba[_0xa0c1('0x9e')]('{'+_0x8b1328[0x0]+'}',this[_0xa0c1('0xf')][_0xa0c1('0x9f')](_0x8b1328[0x0])[_0xa0c1('0xa0')]||_0x8b1328[0x0]);}}if(_0x22d0e6['length']===0x1){return _0x3026ba['toString']();}return this['replaceAllVariables'](_0x3026ba);};AGIVertices['prototype'][_0xa0c1('0xa1')]=function(_0x19c730,_0x2cee2e){var _0x457845=this[_0xa0c1('0xf')]['getVariable'](_0x19c730);if(_0x457845[_0xa0c1('0xa2')]===-0x1){return _0x457845;}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xa3'),_0x2cee2e,_0x457845[_0xa0c1('0xa0')]));return this[_0xa0c1('0xf')]['setVariable'](_0x2cee2e,_0x457845[_0xa0c1('0xa0')]);};AGIVertices['prototype'][_0xa0c1('0x82')]=function(_0x27f554){return _0x27f554&&_0x27f554!=='0'&&_0x27f554!=='-1'&&_0x27f554!=='';};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xa4')]=function(_0x4ec6af){this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x4ec6af,'-');_0x4ec6af[_0xa0c1('0xa5')]=_0x4ec6af[_0xa0c1('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xa6')]=function(_0x4bab42){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xa7'),_0x4bab42['label']));if(!this[_0xa0c1('0x82')](_0x4bab42[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')]['noop']('no\x20text\x20configured');}var _0x1f5d42='\x22'+_0x4bab42['text']+'\x22';if(this[_0xa0c1('0x82')](_0x4bab42[_0xa0c1('0x77')])){_0x1f5d42+=','+_0x4bab42['options'];}var _0x488f6e=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0xa8'),_0x1f5d42);if(_0x488f6e[_0xa0c1('0xa2')]===-0x1){return _0x488f6e;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xaa'),_0x1f5d42));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xab')]=function(_0x3ef94d){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x3ef94d[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x3ef94d[_0xa0c1('0xac')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xad'));}var _0x3efe0f=_0x3ef94d[_0xa0c1('0xac')];if(this[_0xa0c1('0x82')](_0x3ef94d[_0xa0c1('0x77')])){_0x3efe0f+=','+_0x3ef94d[_0xa0c1('0x77')];}var _0x2c416f=this[_0xa0c1('0xf')][_0xa0c1('0x56')]('MRCPRecog',_0x3efe0f);if(_0x2c416f[_0xa0c1('0xa2')]===-0x1){return _0x2c416f;}var _0x5dec11=this[_0xa0c1('0xa1')](_0xa0c1('0xae'),_0xa0c1('0xaf'));if(_0x5dec11[_0xa0c1('0xa2')]===-0x1){return _0x5dec11;}var _0x29331e=this[_0xa0c1('0xa1')](_0xa0c1('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x29331e[_0xa0c1('0xa2')]===-0x1){return _0x29331e;}var _0x2df1b9=this[_0xa0c1('0xa1')](_0xa0c1('0xb1'),_0xa0c1('0xb2'));if(_0x2df1b9[_0xa0c1('0xa2')]===-0x1){return _0x2df1b9;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xb3'),_0x3efe0f));};AGIVertices['prototype'][_0xa0c1('0x6')]=function(_0x520450){logger['info'](util['format'](_0xa0c1('0xb4'),_0x520450['label']));return this['channel'][_0xa0c1('0x6')]([_0x520450['command'],_0x520450[_0xa0c1('0xb5')]]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xb6')]=function(_0x1d8391){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0xb7'),_0x1d8391[_0xa0c1('0x36')]));if(this['isConfigured'](_0x1d8391['timeout'])){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1d8391[_0xa0c1('0x63')]));var _0x3542a3=this[_0xa0c1('0xf')][_0xa0c1('0xb8')](_0x1d8391[_0xa0c1('0x63')]);if(_0x3542a3[_0xa0c1('0xa2')]===-0x1){return _0x3542a3;}}return this['channel'][_0xa0c1('0xb6')]();};AGIVertices[_0xa0c1('0x11')]['callback']=function(_0xec8c5d){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0xb9'),_0xec8c5d[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0xec8c5d[_0xa0c1('0x48')])){return this['channel'][_0xa0c1('0x2d')](_0xec8c5d,_0xa0c1('0xba'));}_0xec8c5d[_0xa0c1('0x49')]=moment();if(this[_0xa0c1('0x82')](_0xec8c5d['delay'])){_0xec8c5d[_0xa0c1('0x49')]=moment()['add'](_0xec8c5d[_0xa0c1('0xbb')],_0xa0c1('0xbc'));}if(!this[_0xa0c1('0x82')](_0xec8c5d[_0xa0c1('0x4d')])){_0xec8c5d[_0xa0c1('0x4d')]=0x2;}this['createCmContact'][_0xa0c1('0x6e')](this,_0xec8c5d);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xbd'),_0xec8c5d[_0xa0c1('0x47')],_0xec8c5d[_0xa0c1('0x48')],_0xec8c5d[_0xa0c1('0x49')]));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xbe')]=function(_0x48a4cc){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x48a4cc[_0xa0c1('0x36')]));var _0x185f30=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0x48a4cc[_0xa0c1('0xbf')],_0x48a4cc['options']);if(_0x185f30[_0xa0c1('0xa2')]===-0x1){return _0x185f30;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0x48a4cc[_0xa0c1('0xbf')],_0x48a4cc[_0xa0c1('0x77')]));};AGIVertices[_0xa0c1('0x11')]['lumenvoxtts']=function(_0x43a2cc){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x43a2cc[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x43a2cc[_0xa0c1('0x5b')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}var _0x2e4455='\x22'+_0x43a2cc[_0xa0c1('0x5b')]+'\x22';if(this[_0xa0c1('0x82')](_0x43a2cc[_0xa0c1('0x77')])){_0x2e4455+=','+_0x43a2cc[_0xa0c1('0x77')];}var _0x57f4b7=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0xa8'),_0x2e4455);if(_0x57f4b7['result']===-0x1){return _0x57f4b7;}return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xaa'),_0x2e4455));};AGIVertices['prototype'][_0xa0c1('0xc2')]=function(_0x296d4f){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xc3'),_0x296d4f[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x296d4f['text'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}var _0x19138a='\x22'+_0x296d4f[_0xa0c1('0x5b')]+'\x22';if(this['isConfigured'](_0x296d4f[_0xa0c1('0x77')])){_0x19138a+=','+_0x296d4f[_0xa0c1('0x77')];}var _0x88cabf=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0xa8'),_0x19138a);if(_0x88cabf[_0xa0c1('0xa2')]===-0x1){return _0x88cabf;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xaa'),_0x19138a));};AGIVertices[_0xa0c1('0x11')]['lumenvoxasr']=function(_0x31e327){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0xc4'),_0x31e327[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x31e327[_0xa0c1('0xac')])){return this['channel'][_0xa0c1('0xa9')]('no\x20grammar\x20configured');}var _0x5aa939=_0x31e327[_0xa0c1('0xac')];if(this[_0xa0c1('0x82')](_0x31e327['options'])){_0x5aa939+=','+_0x31e327['options'];}var _0x4c64ab=this['channel'][_0xa0c1('0x56')](_0xa0c1('0xc5'),_0x5aa939);if(_0x4c64ab[_0xa0c1('0xa2')]===-0x1){return _0x4c64ab;}var _0x28ad24=this[_0xa0c1('0xa1')](_0xa0c1('0xae'),_0xa0c1('0xc6'));if(_0x28ad24[_0xa0c1('0xa2')]===-0x1){return _0x28ad24;}var _0x4e8ba8=this['getAndSetVariable']('RECOG_INPUT()',_0xa0c1('0xc7'));if(_0x4e8ba8[_0xa0c1('0xa2')]===-0x1){return _0x4e8ba8;}var _0x383ef0=this[_0xa0c1('0xa1')]('RECOG_INSTANCE()',_0xa0c1('0xc8'));if(_0x383ef0[_0xa0c1('0xa2')]===-0x1){return _0x383ef0;}return this[_0xa0c1('0xf')]['noop'](util['format'](_0xa0c1('0xb3'),_0x5aa939));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xc9')]=function(_0x279854){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0xca'),_0x279854[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x279854[_0xa0c1('0xac')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('no\x20grammar\x20configured');}var _0x9b3f99=_0x279854['grammar'];if(this['isConfigured'](_0x279854[_0xa0c1('0x77')])){_0x9b3f99+=','+_0x279854[_0xa0c1('0x77')];}var _0xe9edce=this[_0xa0c1('0xf')][_0xa0c1('0x56')]('MRCPRecog',_0x9b3f99);if(_0xe9edce[_0xa0c1('0xa2')]===-0x1){return _0xe9edce;}var _0x1db13a=this[_0xa0c1('0xa1')](_0xa0c1('0xae'),'SESTEK_ASR_CONFIDENCE');if(_0x1db13a['result']===-0x1){return _0x1db13a;}var _0x2625f2=this[_0xa0c1('0xa1')](_0xa0c1('0xb0'),_0xa0c1('0xcb'));if(_0x2625f2[_0xa0c1('0xa2')]===-0x1){return _0x2625f2;}var _0x3a0139=this[_0xa0c1('0xa1')](_0xa0c1('0xb1'),'SESTEK_ASR_INSTANCE');if(_0x3a0139[_0xa0c1('0xa2')]===-0x1){return _0x3a0139;}return this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xb3'),_0x9b3f99));};AGIVertices['prototype'][_0xa0c1('0xcc')]=function(_0x5b5d86){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xcd'),_0x5b5d86[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x5b5d86['odbc_id'])){return this['channel'][_0xa0c1('0x2d')](_0x5b5d86,_0xa0c1('0xce'));}var _0x310f96=this[_0xa0c1('0x18')][_0xa0c1('0x6e')](this,_0x5b5d86[_0xa0c1('0xcf')]);if(!_0x310f96){return this['channel'][_0xa0c1('0x2d')](_0x5b5d86,_0xa0c1('0xd0'));}if(!this[_0xa0c1('0x82')](_0x5b5d86['query'])){return this[_0xa0c1('0xf')]['error'](_0x5b5d86,_0xa0c1('0xd1'));}var _0x4d4210=_0x5b5d86['query'][_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xd2'),_0x4d4210));var _0x4502ce=this[_0xa0c1('0x2b')][_0xa0c1('0x6e')](this,_0x310f96,_0x4d4210);this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x5b5d86,_0x4d4210);if(!this[_0xa0c1('0x82')](_0x5b5d86[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xd4'));}var _0x4354eb=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x5b5d86['variable_id']);if(!_0x4354eb){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x5b5d86,'no\x20variable\x20found');}var _0x230a7a=this;_0x4502ce[_0xa0c1('0xd5')](function(_0x544117,_0x98b830){Object['keys'](_0x544117)['forEach'](function(_0x175dea){_0x230a7a['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')]('%s[%s][%s]',_0x4354eb,_0x98b830,_0x175dea),_0x544117[_0x175dea]);});});this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0xd6'),_0x4354eb),_0x4502ce['length']);return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xd7'),_0x4354eb));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xd8')]=function(_0x4504de){logger[_0xa0c1('0xd9')](util[_0xa0c1('0x29')](_0xa0c1('0xda'),_0x4504de[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x4504de[_0xa0c1('0xdb')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x4504de,_0xa0c1('0xdc'));}var _0x33555c=this['getUser'][_0xa0c1('0x6e')](this,_0x4504de[_0xa0c1('0xdb')]);if(!_0x33555c){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x4504de,'no\x20user\x20found');}var _0x51d2c8=this[_0xa0c1('0xf')]['exec']('DIAL',[util['format']('SIP/%s',_0x33555c),_0x4504de[_0xa0c1('0x63')],_0x4504de[_0xa0c1('0xdd')],_0x4504de[_0xa0c1('0x70')]]);if(_0x51d2c8['result']===-0x1){return _0x51d2c8;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xde'),_0xa0c1('0xdf')));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xe0')]=function(_0x60b54c){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xe1'),_0x60b54c[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x60b54c[_0xa0c1('0x7f')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xe2'));}if(!this['isConfigured'](_0x60b54c['text'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xe3')]=!![];this[_0xa0c1('0x35')](_0x60b54c);this[_0xa0c1('0x41')](_0x60b54c[_0xa0c1('0x5b')],'in','','');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0xe4'),_0x60b54c[_0xa0c1('0x5b')]));var _0x1dd930=this[_0xa0c1('0xe5')][_0xa0c1('0x6e')](this,_0x60b54c);if(_0x1dd930){for(var _0x5c4d1e in _0x1dd930){if(_0x1dd930[_0xa0c1('0x93')](_0x5c4d1e)){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0xe6'),_0x5c4d1e[_0xa0c1('0x67')]()),_0x1dd930[_0x5c4d1e]);}}this['createSquareMessage'](_0x1dd930['speech'],'out','dialogflow','');return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xe7'),_0x1dd930[_0xa0c1('0xe8')]));}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x60b54c,_0xa0c1('0xe9'));};AGIVertices[_0xa0c1('0x11')]['dialogflowV2']=function(_0x16e660){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xea'),_0x16e660[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0x7a')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xeb'));}if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0x7b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xec'));}if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0xed')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xee'));}if(!this[_0xa0c1('0x82')](_0x16e660[_0xa0c1('0x7c')])){return this['channel'][_0xa0c1('0xa9')]('no\x20anguage\x20configured');}if(!this[_0xa0c1('0x82')](_0x16e660['text'])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this['channel'][_0xa0c1('0xe3')]=!![];this[_0xa0c1('0x35')](_0x16e660);this[_0xa0c1('0x41')](_0x16e660[_0xa0c1('0x5b')],'in','','');this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xef'),_0x16e660[_0xa0c1('0x5b')]));var _0x218bdd=this[_0xa0c1('0x79')][_0xa0c1('0x6e')](this,_0x16e660);if(_0x218bdd){for(var _0x347697 in _0x218bdd){if(_0x218bdd[_0xa0c1('0x93')](_0x347697)){if(_0x347697!=='providerResponse'){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util['format'](_0xa0c1('0xe6'),_0x347697['toUpperCase']()),_0x218bdd[_0x347697]);}}}this['createSquareMessage'](_0x218bdd[_0xa0c1('0xe8')],'out',_0xa0c1('0xf0'),_0x218bdd[_0xa0c1('0xf1')]);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xf2'),_0x218bdd[_0xa0c1('0xe8')]));}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x16e660,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xf3')]=function(_0x2fedf7){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0xf4'),_0x2fedf7[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x2fedf7[_0xa0c1('0xf5')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xf6'));}if(!this[_0xa0c1('0x82')](_0x2fedf7[_0xa0c1('0xf7')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xf8'));}if(!this[_0xa0c1('0x82')](_0x2fedf7[_0xa0c1('0xf9')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0xfa'));}if(!this[_0xa0c1('0x82')](_0x2fedf7['ndassistant_url'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xe3')]=!![];this['createSquareDetailsReport'](_0x2fedf7);this[_0xa0c1('0x41')](_0x2fedf7[_0xa0c1('0x5b')],'in','','');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('Trying\x20SestekNDA:\x20%s',_0x2fedf7[_0xa0c1('0x5b')]));var _0x2f6a0e=this[_0xa0c1('0x7d')]['sync'](this,_0x2fedf7);if(_0x2f6a0e){for(var _0x670f08 in _0x2f6a0e){if(_0x2f6a0e[_0xa0c1('0x93')](_0x670f08)){this['channel']['setVariable'](util[_0xa0c1('0x29')](_0xa0c1('0xfb'),_0x670f08[_0xa0c1('0x67')]()),_0x2f6a0e[_0x670f08]);}}this[_0xa0c1('0x41')](_0x2f6a0e[_0xa0c1('0xe8')],_0xa0c1('0xfc'),_0xa0c1('0xf3'),'');if(_0x2f6a0e[_0xa0c1('0xfd')]){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xfe'),_0x2f6a0e[_0xa0c1('0xfd')]));var _0x52b48f=this['channel']['streamFile'](_0x2f6a0e['audiofile']);try{fs[_0xa0c1('0xff')](_0x2f6a0e[_0xa0c1('0xfd')]+'.wav');}catch(_0x4d5949){logger[_0xa0c1('0x2d')](_0x4d5949);}return _0x52b48f;}else{return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x100'),_0x2f6a0e[_0xa0c1('0xe8')]));}}return this['channel'][_0xa0c1('0x2d')](_0x2fedf7,_0xa0c1('0x101'));};AGIVertices['prototype'][_0xa0c1('0x102')]=function(_0x296990){logger['info'](util['format'](_0xa0c1('0x103'),_0x296990[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('end');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x104')]=function(_0x52e1dd){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x105'),_0x52e1dd[_0xa0c1('0x36')]));var _0x4c5f56='';if(_0x52e1dd[_0xa0c1('0x106')]){if(!this[_0xa0c1('0x82')](_0x52e1dd[_0xa0c1('0x106')])){return this[_0xa0c1('0xf')]['error'](_0x52e1dd,_0xa0c1('0x107'));}else{var _0x5ef3aa=parseInt(_0x52e1dd[_0xa0c1('0x106')],0xa);if(isNaN(_0x5ef3aa)){_0x4c5f56=_0x52e1dd[_0xa0c1('0x106')];}else{_0x4c5f56=this['getTrunk'][_0xa0c1('0x6e')](this,_0x52e1dd['trunk_id']);if(!_0x4c5f56){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x52e1dd,_0xa0c1('0x108'));}}}}else if(_0x52e1dd['trunk_name']){_0x4c5f56=_0x52e1dd[_0xa0c1('0x109')];}else{return this[_0xa0c1('0xf')]['error'](_0x52e1dd,_0xa0c1('0x107'));}var _0x518414=this['channel']['exec'](_0xa0c1('0xdf'),[util[_0xa0c1('0x29')]('SIP/%s/%s',_0x4c5f56,_0x52e1dd[_0xa0c1('0x47')]),_0x52e1dd['timeout'],_0x52e1dd[_0xa0c1('0xdd')],_0x52e1dd[_0xa0c1('0x70')]]);if(_0x518414['result']===-0x1){return _0x518414;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x10a')]=function(_0x96ffbb){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x10b'),_0x96ffbb['label']));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x10a'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x10c')]=function(_0x2da8e7){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x10d'),_0x2da8e7[_0xa0c1('0x36')]));if(_0x2da8e7[_0xa0c1('0xa5')]===0x0){return this[_0xa0c1('0xa4')](_0x2da8e7);}_0x2da8e7[_0xa0c1('0xa5')]-=0x1;if(!this[_0xa0c1('0x82')](_0x2da8e7['file_id'])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2da8e7,_0xa0c1('0x10e'));}var _0x347b51=this[_0xa0c1('0x1d')][_0xa0c1('0x6e')](this,_0x2da8e7[_0xa0c1('0x10f')]);if(!_0x347b51){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2da8e7,_0xa0c1('0x110'));}if(!this[_0xa0c1('0x82')](_0x2da8e7['variable_id'])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0xed98d2=this[_0xa0c1('0xf')][_0xa0c1('0x111')](_0x347b51,_0x2da8e7[_0xa0c1('0x112')],_0x2da8e7[_0xa0c1('0x113')]);var _0x250b06=_0xed98d2[_0xa0c1('0xa2')]?_0xed98d2[_0xa0c1('0xa2')][_0xa0c1('0x4c')]():'';logger[_0xa0c1('0x2f')](_0xa0c1('0x114'),JSON[_0xa0c1('0x72')](_0xed98d2));if(_0xed98d2[_0xa0c1('0xa2')]===-0x1){this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,_0x250b06);return _0xed98d2;}else if(_0xed98d2[_0xa0c1('0xa0')]===_0xa0c1('0x63')){_0xed98d2[_0xa0c1('0xa2')]=_0x250b06[_0xa0c1('0x96')]>=parseInt(_0x2da8e7[_0xa0c1('0x115')])?'x':'i';}else{_0xed98d2['result']=_0x250b06[_0xa0c1('0x96')]>=parseInt(_0x2da8e7[_0xa0c1('0x115')])&&_0x250b06[_0xa0c1('0x96')]<=parseInt(_0x2da8e7[_0xa0c1('0x113')])?'x':'i';}var _0x8d8948=this['getVariable'][_0xa0c1('0x6e')](this,_0x2da8e7[_0xa0c1('0xd3')]);if(!_0x8d8948){return this[_0xa0c1('0xf')]['error'](_0x2da8e7,_0xa0c1('0x116'));}this['channel']['setVariable'](_0x8d8948,_0x250b06);if(this[_0xa0c1('0x82')](_0x2da8e7['hiddendigitsnum'])){var _0x26701f=parseInt(_0x2da8e7[_0xa0c1('0x117')],0xa);var _0x15e622=rs[_0xa0c1('0x118')]({'charset':'*','length':_0x26701f});var _0x48a4e0=_0x250b06[_0xa0c1('0x96')];if(_0x48a4e0>0x0){if(_0x48a4e0>_0x26701f){this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,_0x2da8e7[_0xa0c1('0x119')]==='first'?_0x15e622+_0x250b06[_0xa0c1('0x11a')](_0x26701f):_0x250b06[_0xa0c1('0x11a')](0x0,_0x48a4e0-_0x26701f)+_0x15e622);}else{this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,rs['generate']({'charset':'*','length':_0x48a4e0}));}}else{this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,'');}}else{this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x2da8e7,_0x250b06);}return _0xed98d2;};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0xe')]=function(_0x35ddd3){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x11b'),_0x35ddd3[_0xa0c1('0x36')]));return this[_0xa0c1('0x10c')](_0x35ddd3);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x11c')]=function(_0x107e6d){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x11d'),_0x107e6d[_0xa0c1('0x36')]));this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x107e6d,_0x107e6d[_0xa0c1('0x11e')]);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x11f'),_0x107e6d['goalname']));};AGIVertices['prototype'][_0xa0c1('0x120')]=function(_0x3fb2cb){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x121'),_0x3fb2cb[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x3fb2cb[_0xa0c1('0x85')])||!this['isConfigured'](_0x3fb2cb[_0xa0c1('0x86')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x3fb2cb[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x122'),_0x3fb2cb[_0xa0c1('0x5b')]));var _0x5c56f4=this[_0xa0c1('0x84')][_0xa0c1('0x6e')](this,_0x3fb2cb);if(_0x5c56f4){this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x123'),_0x5c56f4));var _0x2382fe=this[_0xa0c1('0xf')]['streamFile'](_0x5c56f4);try{fs[_0xa0c1('0xff')](_0x5c56f4+_0xa0c1('0x124'));}catch(_0x105e03){logger[_0xa0c1('0x2d')](_0x105e03);}return _0x2382fe;}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x3fb2cb,_0xa0c1('0x125'));};AGIVertices[_0xa0c1('0x11')]['awslex']=function(_0x2602cb){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2602cb['label']));if(!this[_0xa0c1('0x82')](_0x2602cb[_0xa0c1('0x85')])||!this[_0xa0c1('0x82')](_0x2602cb[_0xa0c1('0x86')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x126'));}if(!this[_0xa0c1('0x82')](_0x2602cb['aws_bot_name'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x127'));}if(!this[_0xa0c1('0x82')](_0x2602cb[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xe3')]=!![];this[_0xa0c1('0x35')](_0x2602cb);this[_0xa0c1('0x41')](_0x2602cb['text'],'in','','');this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x128'),_0x2602cb[_0xa0c1('0x5b')]));var _0x4f2757=this[_0xa0c1('0x8b')][_0xa0c1('0x6e')](this,_0x2602cb);if(_0x4f2757){for(var _0xd94182 in _0x4f2757){if(_0x4f2757[_0xa0c1('0x93')](_0xd94182)&&_[_0xa0c1('0x97')](_0x4f2757[_0xd94182])){this['channel']['setVariable'](util[_0xa0c1('0x29')](_0xa0c1('0x129'),_0xd94182[_0xa0c1('0x67')]()),_0x4f2757[_0xd94182]);}}if(_[_0xa0c1('0x44')](_0x4f2757[_0xa0c1('0x76')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0x12a'));}else{this[_0xa0c1('0x41')](_0x4f2757[_0xa0c1('0x76')],_0xa0c1('0xfc'),_0xa0c1('0x12b'),'');return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x12c'),_0x4f2757[_0xa0c1('0x76')]));}}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2602cb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0xa0c1('0x12d')]=function(_0x57bdb9){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x12e'),_0x57bdb9['label'],_0x57bdb9[_0xa0c1('0x63')]));if(!this['isConfigured'](_0x57bdb9[_0xa0c1('0x7f')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xe2'));}var _0x40c053='wav';var _0x1a416c=util[_0xa0c1('0x29')](_0xa0c1('0x12f'),FILES_PATH,rs[_0xa0c1('0x118')](0x4));var _0x5930be=util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x1a416c,_0x40c053);var _0x274c5c=!![];if(_0x57bdb9[_0xa0c1('0x130')]==='NOBEEP'){_0x274c5c=![];}var _0x5494d8=this['channel']['recordFile'](_0x1a416c,_0x40c053,_0x57bdb9['intKey'],_0x57bdb9[_0xa0c1('0x63')],undefined,_0x274c5c);if(_0x5494d8[_0xa0c1('0xa2')]!==-0x1){this[_0xa0c1('0xf')]['noop'](util['format'](_0xa0c1('0x131'),_0x5930be));var _0x4e7e9c=this['googleASR'][_0xa0c1('0x6e')](this,_0x57bdb9,_0x5930be);if(_0x4e7e9c){for(var _0x281b43 in _0x4e7e9c){if(_0x4e7e9c[_0xa0c1('0x93')](_0x281b43)){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util['format'](_0xa0c1('0x132'),_0x281b43['toUpperCase']()),_0x4e7e9c[_0x281b43]);}}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xa0c1('0x72')](_0x4e7e9c)));}}return _0x5494d8;};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x133')]=function(_0xb4284d){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x134'),_0xb4284d['label']));if(!this[_0xa0c1('0x82')](_0xb4284d['appid'])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x135'));}if(!this[_0xa0c1('0x82')](_0xb4284d[_0xa0c1('0x90')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x136'));}var _0x19ea74=_0xa0c1('0x137');var _0x4d3c2d=util['format']('%s/recordings/%s',FILES_PATH,rs[_0xa0c1('0x118')](0x4));var _0x3ebf77=util[_0xa0c1('0x29')](_0xa0c1('0x9a'),_0x4d3c2d,_0x19ea74);var _0x3c11a=!![];if(_0xb4284d[_0xa0c1('0x130')]===_0xa0c1('0x138')){_0x3c11a=![];}var _0x530508=this[_0xa0c1('0xf')][_0xa0c1('0x139')](_0x4d3c2d,_0x19ea74,_0xb4284d[_0xa0c1('0x13a')],_0xb4284d[_0xa0c1('0x63')],undefined,_0x3c11a);if(_0x530508[_0xa0c1('0xa2')]!==-0x1){this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x13b'),_0x3ebf77));var _0x284d9e=this[_0xa0c1('0x8f')][_0xa0c1('0x6e')](this,_0xb4284d,_0x3ebf77);if(_0x284d9e){for(var _0x40cf93 in _0x284d9e){if(_0x284d9e[_0xa0c1('0x93')](_0x40cf93)){this['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0x13c'),_0x40cf93['toUpperCase']()),_0x284d9e[_0x40cf93]);}}return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x13d'),JSON[_0xa0c1('0x72')](_0x284d9e)));}}return _0x530508;};AGIVertices['prototype'][_0xa0c1('0x13e')]=function(_0x4b6f09){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x4b6f09[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0x13f')](_0x4b6f09[_0xa0c1('0x3c')],_0x4b6f09[_0xa0c1('0x3d')],_0x4b6f09[_0xa0c1('0x3e')]);};AGIVertices['prototype'][_0xa0c1('0x140')]=function(_0x379835){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x141'),_0x379835[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x379835[_0xa0c1('0x142')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x379835,_0xa0c1('0x143'));}try{var _0x15c915=eval(_0x379835[_0xa0c1('0x142')])?_0xa0c1('0x144'):_0xa0c1('0x145');this['channel'][_0xa0c1('0xa9')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x379835[_0xa0c1('0x142')],_0x15c915));return{'code':0xc8,'result':_0x15c915};}catch(_0x47b1d7){return{'code':0xc8,'result':_0xa0c1('0x145')};}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x146')]=function(_0x43f98f){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x147'),_0x43f98f['label']));if(!this[_0xa0c1('0x82')](_0x43f98f[_0xa0c1('0x148')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x43f98f,_0xa0c1('0x149'));}var _0x378b0c=this[_0xa0c1('0x23')][_0xa0c1('0x6e')](this,_0x43f98f[_0xa0c1('0x148')]);if(!_0x378b0c){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x43f98f,_0xa0c1('0x14a'));}for(var _0x357033=0x0;_0x357033<_0x378b0c[_0xa0c1('0x96')];_0x357033+=0x1){var _0x58afc4=this[_0xa0c1('0xf')][_0xa0c1('0x9f')](util[_0xa0c1('0x29')](_0xa0c1('0x14b'),_0x378b0c[_0x357033]));if(_0x58afc4[_0xa0c1('0xa2')]===-0x1){return _0x58afc4;}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('IFTIME\x20%s\x20%s',_0x378b0c[_0x357033],_0x58afc4[_0xa0c1('0xa0')]));if(_0x58afc4[_0xa0c1('0xa0')]==='true'){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x14c'),_0x378b0c[_0x357033],_0xa0c1('0x144')));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x14c'),_0x378b0c[_0x357033],_0xa0c1('0x144')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x14c'),_0x378b0c[_0x357033],'false'));this['channel'][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x14c'),_0x378b0c[_0x357033],'false'));}}return{'code':0xc8,'result':_0xa0c1('0x145')};};AGIVertices[_0xa0c1('0x11')]['hangup']=function(_0x11450a){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x14d'),_0x11450a[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0x14e')]();};AGIVertices['prototype'][_0xa0c1('0x14f')]=function(_0x55218d){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x150'),_0x55218d[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x55218d[_0xa0c1('0x7f')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xe2'));}var _0xa2c1c2=_0xa0c1('0x137');var _0x3049cd=util[_0xa0c1('0x29')](_0xa0c1('0x12f'),FILES_PATH,rs[_0xa0c1('0x118')](0x4));var _0x63bbcc=util[_0xa0c1('0x29')]('%s.%s',_0x3049cd,_0xa2c1c2);var _0x5a1d0b=!![];if(_0x55218d[_0xa0c1('0x130')]===_0xa0c1('0x138')){_0x5a1d0b=![];}var _0x501328=this[_0xa0c1('0xf')][_0xa0c1('0x139')](_0x3049cd,_0xa2c1c2,_0x55218d['intKey'],_0x55218d[_0xa0c1('0x63')],undefined,_0x5a1d0b);if(_0x501328[_0xa0c1('0xa2')]!==-0x1){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x151'),_0x63bbcc));var _0x4acd24=this[_0xa0c1('0x152')][_0xa0c1('0x6e')](this,_0x55218d,_0x63bbcc);if(_0x4acd24){for(var _0x2c47ca in _0x4acd24){if(_0x4acd24['hasOwnProperty'](_0x2c47ca)){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util['format'](_0xa0c1('0x153'),_0x2c47ca[_0xa0c1('0x67')]()),_0x4acd24[_0x2c47ca]);}}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('IspeechASR\x20Result\x20%s',JSON[_0xa0c1('0x72')](_0x4acd24)));}}return _0x501328;};AGIVertices['prototype'][_0xa0c1('0x154')]=function(_0x412dce){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x155'),_0x412dce[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x412dce[_0xa0c1('0x7f')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0xe2'));}if(!this[_0xa0c1('0x82')](_0x412dce[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x156'),_0x412dce['text']));var _0x5b8aee=this[_0xa0c1('0x7e')][_0xa0c1('0x6e')](this,_0x412dce);if(_0x5b8aee){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x151'),_0x5b8aee));var _0x3a8644=this[_0xa0c1('0xf')][_0xa0c1('0x157')](_0x5b8aee,_0x412dce['intKey']);try{fs['unlink'](_0x5b8aee+_0xa0c1('0x124'));}catch(_0x40bec5){logger[_0xa0c1('0x2d')](_0x40bec5);}return _0x3a8644;}return this['channel'][_0xa0c1('0x2d')](_0x412dce,_0xa0c1('0x158'));};AGIVertices['prototype'][_0xa0c1('0x159')]=function(_0xe6d58b){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x15a'),_0xe6d58b[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0xe6d58b[_0xa0c1('0x15b')])){return this[_0xa0c1('0xf')]['error'](_0xe6d58b,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this['channel']['callerid'],_0xe6d58b['findBy']));var _0x1f6914=this[_0xa0c1('0x55')][_0xa0c1('0x6e')](this,_0xe6d58b[_0xa0c1('0x15b')]);if(_0x1f6914){logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')]['callerid'],_0xe6d58b['findBy']));this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0xe6d58b[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x15f')};}else{logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xa0c1('0x38')],_0xe6d58b[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x160'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0xe6d58b[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x161')};}};AGIVertices['prototype'][_0xa0c1('0x162')]=function(_0x3bf6dd){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x163'),_0x3bf6dd['label']));if(!this[_0xa0c1('0x82')](_0x3bf6dd[_0xa0c1('0x15b')])){return this[_0xa0c1('0xf')]['error'](_0x3bf6dd,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this['channel']['callerid'],_0x3bf6dd[_0xa0c1('0x15b')]));var _0x1f481e=this[_0xa0c1('0x52')][_0xa0c1('0x6e')](this,_0x3bf6dd[_0xa0c1('0x15b')]);if(_0x1f481e){logger['info'](util[_0xa0c1('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x3bf6dd[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x15e'),this['channel'][_0xa0c1('0x38')],_0x3bf6dd[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x15f')};}else{logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x160'),this['channel'][_0xa0c1('0x38')],_0x3bf6dd[_0xa0c1('0x15b')]));this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x160'),this[_0xa0c1('0xf')]['callerid'],_0x3bf6dd[_0xa0c1('0x15b')]));return{'code':0xc8,'result':_0xa0c1('0x161')};}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x164')]=function(_0xfbab31){logger[_0xa0c1('0x2f')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0xfbab31['label']));if(!this[_0xa0c1('0x82')](_0xfbab31[_0xa0c1('0x165')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0xfbab31,'no\x20operation\x20configured');}this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x166'),_0xfbab31['operation']));var _0xb6f657=eval(_0xfbab31['operation']);if(!this['isConfigured'](_0xfbab31[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2dae35=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0xfbab31[_0xa0c1('0xd3')]);if(!_0x2dae35){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0xfbab31,_0xa0c1('0x116'));}if(_[_0xa0c1('0x9b')](_0xb6f657)){var _0x54ccf7=this;_0xb6f657[_0xa0c1('0xd5')](function(_0x213571,_0x44e086){_0x54ccf7[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0x167'),_0x2dae35,_0x44e086),_0x213571);});return this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x168'),_0x2dae35));}else{return this[_0xa0c1('0xf')][_0xa0c1('0x9c')](_0x2dae35,_0xb6f657);}};AGIVertices['prototype'][_0xa0c1('0xd')]=function(_0x2dfdb3){logger[_0xa0c1('0x2f')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x2dfdb3[_0xa0c1('0x36')]));if(_0x2dfdb3['retry']===0x0){return this['maxRetry'](_0x2dfdb3);}_0x2dfdb3['retry']-=0x1;if(!this[_0xa0c1('0x82')](_0x2dfdb3[_0xa0c1('0x10f')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2dfdb3,'no\x20file\x20audio\x20selected');}var _0x8abb0d=this[_0xa0c1('0x1d')][_0xa0c1('0x6e')](this,_0x2dfdb3[_0xa0c1('0x10f')]);if(!_0x8abb0d){return this['channel'][_0xa0c1('0x2d')](_0x2dfdb3,_0xa0c1('0x110'));}var _0x4a8e00=this[_0xa0c1('0xf')]['getData'](_0x8abb0d,_0x2dfdb3[_0xa0c1('0x112')],_0x2dfdb3[_0xa0c1('0x169')]);var _0x2c1f3d=_0x4a8e00[_0xa0c1('0xa2')];if(_0x4a8e00[_0xa0c1('0xa2')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x2dfdb3,'-1');return _0x4a8e00;}else if(_0x4a8e00['extra']===_0xa0c1('0x63')){_0x4a8e00[_0xa0c1('0xa2')]=_0x4a8e00[_0xa0c1('0xa2')][_0xa0c1('0x96')]>0x0?_0x4a8e00[_0xa0c1('0xa2')]:'t';}else if(_[_0xa0c1('0x43')](_0x4a8e00['result'])){_0x4a8e00['result']='#';_0x2c1f3d='#';}if(!this[_0xa0c1('0x82')](_0x2dfdb3['variable_id'])){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xd4'));}else{var _0x5ae374=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x2dfdb3[_0xa0c1('0xd3')]);if(!_0x5ae374){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x2dfdb3,_0xa0c1('0x116'));}this[_0xa0c1('0xf')]['setVariable'](_0x5ae374,_0x2c1f3d);}this['createSquareDetailsReport'][_0xa0c1('0x6e')](this,_0x2dfdb3,_0x2c1f3d);return _0x4a8e00;};AGIVertices[_0xa0c1('0x11')]['noop']=function(_0x1df1fa){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x16a'),_0x1df1fa['label']));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0x1df1fa['output']||_0x1df1fa[_0xa0c1('0x36')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x16b')]=function(_0x5e7be8){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x16c'),_0x5e7be8[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x5e7be8[_0xa0c1('0x15b')])){return this['channel'][_0xa0c1('0x2d')](_0x5e7be8,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this[_0xa0c1('0xf')]['callerid'],_0x5e7be8[_0xa0c1('0x15b')]));var _0x312697=this[_0xa0c1('0x4e')][_0xa0c1('0x6e')](this,_0x5e7be8[_0xa0c1('0x16d')]);var _0x53934d=this[_0xa0c1('0x4f')]['sync'](this,_0x5e7be8[_0xa0c1('0x15b')],_0x312697);if(_0x53934d){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8[_0xa0c1('0x15b')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xa0c1('0x160'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8[_0xa0c1('0x15b')]));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x5e7be8['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x16e')]=function(_0x23d5f1){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x16f'),_0x23d5f1['label']));if(!this[_0xa0c1('0x82')](_0x23d5f1[_0xa0c1('0x10f')])){return this[_0xa0c1('0xf')]['error'](_0x23d5f1,'no\x20file\x20audio\x20selected');}var _0x13bc6b=this[_0xa0c1('0x1d')][_0xa0c1('0x6e')](this,_0x23d5f1[_0xa0c1('0x10f')]);if(!_0x13bc6b){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x23d5f1,'no\x20file\x20audio\x20found');}var _0x4a0c1e=this[_0xa0c1('0xf')]['exec'](_0xa0c1('0x170'),[_0x13bc6b,_0x23d5f1['opts']]);if(_0x4a0c1e[_0xa0c1('0xa2')]===-0x1){return _0x4a0c1e;}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x170'),_0x13bc6b));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x171')]=function(_0x59293f){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x59293f['label']));if(!this[_0xa0c1('0x82')](_0x59293f[_0xa0c1('0x172')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x59293f,'no\x20queue\x20selected');}var _0x496f23='';var _0xa2a07=parseInt(_0x59293f[_0xa0c1('0x172')],0xa);if(isNaN(_0xa2a07)){_0x496f23=_0x59293f[_0xa0c1('0x172')];}else{_0x496f23=this[_0xa0c1('0x15')][_0xa0c1('0x6e')](this,_0x59293f['queue_id']);if(!_0x496f23){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x59293f,_0xa0c1('0x173'));}}var _0x256eb5='';if(this['isConfigured'](_0x59293f[_0xa0c1('0x10f')])){var _0x28daa1=this['getSound']['sync'](this,_0x59293f[_0xa0c1('0x10f')]);if(_0x28daa1){_0x256eb5=_0x28daa1;}}this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x59293f,_0x496f23);if(_0x59293f[_0xa0c1('0xdd')]['indexOf']('x')<0x0){_0x59293f[_0xa0c1('0xdd')]+='x';}if(_0x59293f[_0xa0c1('0xdd')][_0xa0c1('0x174')]('X')<0x0){_0x59293f[_0xa0c1('0xdd')]+='X';}this[_0xa0c1('0xf')][_0xa0c1('0x9c')]('XMCS-QUEUE',_0x496f23?_0x496f23[_0xa0c1('0x175')]():'');var _0x273251=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0x176'),[_0x496f23,_0x59293f[_0xa0c1('0xdd')],_0x59293f['url'],_0x256eb5,_0x59293f['timeout'],_0x59293f[_0xa0c1('0x6')],_0x59293f[_0xa0c1('0x177')],_0x59293f[_0xa0c1('0x178')],'',_0x59293f[_0xa0c1('0x179')]]);if(_0x273251[_0xa0c1('0xa2')]===-0x1){return _0x273251;}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x176'),_0x496f23));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x17a')]=function(_0x63eec5){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x17b'),_0x63eec5[_0xa0c1('0x36')]));var _0x464389=_0x63eec5['recordingFormat']||_0xa0c1('0x137');var _0x36aefe=util['format']('%s_%s',this['channel'][_0xa0c1('0x3a')],rs[_0xa0c1('0x118')](0x5));var _0x2ef2d2=util['format'](_0xa0c1('0x17c'),FILES_PATH,_0x36aefe,_0x464389);var _0x2b4406=util[_0xa0c1('0x29')]('%s/recordings/%s',FILES_PATH,_0x36aefe);this['createSquareRecording'][_0xa0c1('0x6e')](this,_0x63eec5,_0x36aefe,_0x2ef2d2);this[_0xa0c1('0xf')][_0xa0c1('0x9c')]('RECORDING_SAVENAME',_0x36aefe);logger[_0xa0c1('0x2f')](_0xa0c1('0x17d'),_0x2b4406,_0x464389,_0x63eec5[_0xa0c1('0x17e')],_0x63eec5[_0xa0c1('0x63')]);return this[_0xa0c1('0xf')][_0xa0c1('0x139')](_0x2b4406,_0x464389,_0x63eec5[_0xa0c1('0x17e')],_0x63eec5[_0xa0c1('0x63')],undefined,!![]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x17f')]=function(_0xf0f142){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x180'),_0xf0f142[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0xf0f142[_0xa0c1('0x70')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0x181'));}var _0x5c973e=this[_0xa0c1('0x182')][_0xa0c1('0x6e')](this,_0xf0f142);logger['info'](util[_0xa0c1('0x29')](_0xa0c1('0x183'),util[_0xa0c1('0x184')](_0x5c973e,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0xf0f142[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0x185'));}var _0x534e58=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0xf0f142[_0xa0c1('0xd3')]);if(!_0x534e58){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0xf0f142,'no\x20variable\x20found');}this[_0xa0c1('0xf')][_0xa0c1('0x9c')](util[_0xa0c1('0x29')](_0xa0c1('0x186'),_0x534e58),_0x5c973e[_0xa0c1('0x74')]?_0x5c973e[_0xa0c1('0x74')]:_0xa0c1('0x187'));this['channel'][_0xa0c1('0x9c')](util[_0xa0c1('0x29')]('%s_STATUS_MESSAGE',_0x534e58),_0x5c973e[_0xa0c1('0x75')]?_0x5c973e[_0xa0c1('0x75')]:'OK');if(_0x5c973e[_0xa0c1('0x68')]){try{this['saveRestApiResult'](_0x5c973e[_0xa0c1('0x68')],_0x534e58);}catch(_0x1abd8b){logger[_0xa0c1('0x2d')](util[_0xa0c1('0x29')](_0xa0c1('0x188'),_0x534e58));}}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xd7'),_0x534e58));};AGIVertices[_0xa0c1('0x11')]['saydigits']=function(_0x2b1d89){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x189'),_0x2b1d89[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')]['sayDigits'](_0x2b1d89[_0xa0c1('0x18a')][_0xa0c1('0x58')](/\s+/g,''),_0x2b1d89[_0xa0c1('0x17e')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x18b')]=function(_0x375718){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x18c'),_0x375718[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')]['sayNumber'](_0x375718[_0xa0c1('0x64')][_0xa0c1('0x58')](/\s+/g,''),_0x375718[_0xa0c1('0x17e')]);};AGIVertices['prototype'][_0xa0c1('0x18d')]=function(_0x573389){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x18e'),_0x573389['label']));return this['channel'][_0xa0c1('0x18f')](_0x573389[_0xa0c1('0x5b')],_0x573389[_0xa0c1('0x17e')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x190')]=function(_0x5dd5bd){logger['info'](util[_0xa0c1('0x29')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x5dd5bd[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x5dd5bd[_0xa0c1('0x191')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x192'));}var _0x3a14b7=this['getMailAccount'][_0xa0c1('0x6e')](this,_0x5dd5bd[_0xa0c1('0x191')]);if(!_0x3a14b7||!_0x3a14b7[_0xa0c1('0x193')]){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x5dd5bd,_0xa0c1('0x194'));}var _0xb68883={'from':util[_0xa0c1('0x29')](_0xa0c1('0x195'),_0x3a14b7[_0xa0c1('0x16')],_0x3a14b7[_0xa0c1('0x196')]||_0x3a14b7[_0xa0c1('0x193')]['user']),'to':_0x5dd5bd['to']||'','cc':_0x5dd5bd['cc']||'','bcc':_0x5dd5bd[_0xa0c1('0x197')]||'','subject':_0x5dd5bd[_0xa0c1('0x198')],'html':_0x5dd5bd['text'],'text':_0x5dd5bd[_0xa0c1('0x5b')]};if(this[_0xa0c1('0x82')](_0x5dd5bd['template_id'])){}logger[_0xa0c1('0xd9')]('sendMail\x20message',JSON[_0xa0c1('0x72')](_0xb68883));this['createSquareDetailsReport'][_0xa0c1('0x6e')](this,_0x5dd5bd,_0x5dd5bd[_0xa0c1('0x191')]);this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x199'),_0x3a14b7[_0xa0c1('0x16')]));this[_0xa0c1('0x19a')][_0xa0c1('0x6e')](this,_0x3a14b7[_0xa0c1('0x19b')],_0xb68883);return this['channel']['noop'](_0xa0c1('0x19c'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x19d')]=function(_0x35434e){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x19e'),_0x35434e[_0xa0c1('0x36')]));return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x19f')]=function(_0x20ffba){logger[_0xa0c1('0x2f')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x20ffba[_0xa0c1('0x36')]));if(!this['isConfigured'](_0x20ffba[_0xa0c1('0x1a0')])){return this[_0xa0c1('0xf')]['noop'](_0xa0c1('0x1a1'));}var _0x568482=this[_0xa0c1('0x33')]['sync'](this,_0x20ffba['sms_account_id']);if(!_0x568482){return this[_0xa0c1('0xf')]['error'](_0x20ffba,'no\x20sms\x20account\x20found');}var _0x7955a4={'body':_0x20ffba[_0xa0c1('0x1a2')],'phone':_0x20ffba['to']||'','SmsAccountId':_0x568482['id']};logger['debug'](_0xa0c1('0x1a3'),JSON['stringify'](_0x7955a4));this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x20ffba,_0x20ffba[_0xa0c1('0x1a0')]);this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util['format'](_0xa0c1('0x1a4'),_0x568482['name']));this[_0xa0c1('0x34')][_0xa0c1('0x6e')](this,_0x7955a4);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1a5')]=function(_0x3c575a){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x1a6'),_0x3c575a[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x3c575a[_0xa0c1('0xd3')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x3c575a,'no\x20variable\x20selected');}var _0x206ea3=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x3c575a[_0xa0c1('0xd3')]);if(!_0x206ea3){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x3c575a,_0xa0c1('0x116'));}return this['channel'][_0xa0c1('0x9c')](_0x206ea3,_0x3c575a[_0xa0c1('0x1a7')]);};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1a8')]=function(_0x4233c2){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1a9'),_0x4233c2['label']));this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x1aa'));if(_0x4233c2['answer']===_0xa0c1('0x1ab')){this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x1ac'));return this[_0xa0c1('0xf')][_0xa0c1('0xb6')]();}return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0x1ad'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1ae')]=function(_0x563bbe){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1af'),_0x563bbe['label']));if(!this['isConfigured'](_0x563bbe[_0xa0c1('0x1b0')])){return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x563bbe,_0xa0c1('0x1b1'));}var _0x1e67f2=this['getSquareProject'][_0xa0c1('0x6e')](this,_0x563bbe[_0xa0c1('0x1b0')]);if(!this[_0xa0c1('0x82')](_0x1e67f2)){return this[_0xa0c1('0xf')]['error'](_0x563bbe,util[_0xa0c1('0x29')](_0xa0c1('0x1b2'),_0x563bbe[_0xa0c1('0x1b0')]));}if(_0x1e67f2===this[_0xa0c1('0xf')][_0xa0c1('0x1b3')]){return this['channel'][_0xa0c1('0x2d')](_0x563bbe,_0xa0c1('0x1b4'));}this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x563bbe,_0x1e67f2);var _0x25ae77=this['channel'][_0xa0c1('0x56')](_0xa0c1('0x1b5'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi']['host']||_0xa0c1('0x1b6'),_0x1e67f2,this[_0xa0c1('0xf')][_0xa0c1('0x1b3')]));if(_0x25ae77[_0xa0c1('0xa2')]===-0x1){return _0x25ae77;}return this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x1b5'),_0x1e67f2));};AGIVertices['prototype'][_0xa0c1('0x1b7')]=function(_0x3541fa){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1b8'),_0x3541fa[_0xa0c1('0x36')]));var _0x5b0d39=this[_0xa0c1('0x1b9')]['sync'](this,_0x3541fa[_0xa0c1('0x1ba')]);this[_0xa0c1('0x35')][_0xa0c1('0x6e')](this,_0x3541fa,_0x3541fa[_0xa0c1('0x1ba')]);if(this[_0xa0c1('0x82')](_0x3541fa[_0xa0c1('0xd3')])){var _0x530a6a=this[_0xa0c1('0x9f')][_0xa0c1('0x6e')](this,_0x3541fa[_0xa0c1('0xd3')]);if(_0x530a6a){this[_0xa0c1('0xf')][_0xa0c1('0x9c')](_0x530a6a,_0x5b0d39);return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x1bb'),_0x3541fa[_0xa0c1('0x1ba')],_0x530a6a));}}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x1bc'),_0x3541fa[_0xa0c1('0x1ba')]));};AGIVertices[_0xa0c1('0x11')]['google_cloud_tts']=function(_0x19e7c5){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1bd'),_0x19e7c5[_0xa0c1('0x36')]));_0x19e7c5[_0xa0c1('0x5b')]=_0x19e7c5['text'][_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x19e7c5['apiKey'])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0x1be'));}if(!this[_0xa0c1('0x82')](_0x19e7c5[_0xa0c1('0x5b')])){return this['channel'][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0x1bf'),_0x19e7c5['text']));var _0x35cbe4=this[_0xa0c1('0x59')]['sync'](this,_0x19e7c5);if(_0x35cbe4){this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x35cbe4));var _0x39292a=this[_0xa0c1('0xf')][_0xa0c1('0x157')](_0x35cbe4);try{fs[_0xa0c1('0xff')](_0x35cbe4+'.wav');}catch(_0x3c281e){logger[_0xa0c1('0x2d')](_0x3c281e);}return _0x39292a;}return this[_0xa0c1('0xf')][_0xa0c1('0x2d')](_0x19e7c5,_0xa0c1('0x1c0'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1c1')]=function(_0x2f9acc){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2f9acc[_0xa0c1('0x36')]));_0x2f9acc[_0xa0c1('0x5b')]=_0x2f9acc['text'][_0xa0c1('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xa0c1('0x82')](_0x2f9acc[_0xa0c1('0x5b')])){return this[_0xa0c1('0xf')][_0xa0c1('0xa9')](_0xa0c1('0xc1'));}this[_0xa0c1('0xf')][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('Trying\x20Google\x20TTS\x20%s',_0x2f9acc['text']));var _0x3ec245=this[_0xa0c1('0x60')]['sync'](this,_0x2f9acc);if(_0x3ec245){this[_0xa0c1('0xf')]['noop'](util[_0xa0c1('0x29')]('Google\x20TTS\x20%s\x20file\x20created',_0x3ec245));var _0x2f3552=this[_0xa0c1('0xf')][_0xa0c1('0x157')](_0x3ec245);try{fs[_0xa0c1('0xff')](_0x3ec245+_0xa0c1('0x124'));}catch(_0x2121f6){logger[_0xa0c1('0x2d')](_0x2121f6);}return _0x2f3552;}return this['channel']['error'](_0x2f9acc,_0xa0c1('0x1c2'));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1c3')]=function(_0x1adad7){logger[_0xa0c1('0x2f')](util['format'](_0xa0c1('0x1c4'),_0x1adad7['label']));if(!this[_0xa0c1('0x82')](_0x1adad7[_0xa0c1('0x15b')])){return this['channel'][_0xa0c1('0x2d')](_0x1adad7,_0xa0c1('0x15c'));}logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x15d'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x1adad7['findBy']));var _0x4522a4=this[_0xa0c1('0x50')][_0xa0c1('0x6e')](this,_0x1adad7[_0xa0c1('0x15b')]);if(_0x4522a4){logger['info'](util['format'](_0xa0c1('0x15e'),this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x1adad7[_0xa0c1('0x15b')]));this['channel']['noop'](util[_0xa0c1('0x29')](_0xa0c1('0x15e'),this['channel'][_0xa0c1('0x38')],_0x1adad7['findBy']));return{'code':0xc8,'result':_0xa0c1('0x15f')};}else{logger[_0xa0c1('0x2f')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa0c1('0xf')]['callerid'],_0x1adad7[_0xa0c1('0x15b')]));this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa0c1('0xf')][_0xa0c1('0x38')],_0x1adad7['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x1fe84a){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x1fe84a[_0xa0c1('0x36')]));var _0x576888=this[_0xa0c1('0xf')][_0xa0c1('0x56')](_0xa0c1('0x1c5'),[_0x1fe84a[_0xa0c1('0x1c6')],_0x1fe84a[_0xa0c1('0x77')]]);if(_0x576888[_0xa0c1('0xa2')]===-0x1){return _0x576888;}return this['channel'][_0xa0c1('0xa9')](util[_0xa0c1('0x29')](_0xa0c1('0xc0'),_0xa0c1('0x1c5'),_0x1fe84a[_0xa0c1('0x1c6')]));};AGIVertices[_0xa0c1('0x11')][_0xa0c1('0x1c7')]=function(_0x190bd1){logger[_0xa0c1('0x2f')](util[_0xa0c1('0x29')](_0xa0c1('0x1c8'),_0x190bd1[_0xa0c1('0x36')]));if(!this[_0xa0c1('0x82')](_0x190bd1[_0xa0c1('0xd3')])){return this['channel']['error'](_0x190bd1,_0xa0c1('0x1c9'));}var _0x56f5e1=this['getVariable'][_0xa0c1('0x6e')](this,_0x190bd1[_0xa0c1('0xd3')]);if(!_0x56f5e1){return this[_0xa0c1('0xf')]['error'](_0x190bd1,_0xa0c1('0x116'));}var _0x43ddaa=this[_0xa0c1('0xf')][_0xa0c1('0x9f')](_0x56f5e1);return{'code':0xc8,'result':_0x43ddaa[_0xa0c1('0xa0')]?_0x43ddaa[_0xa0c1('0xa0')]:'-'};};String['prototype'][_0xa0c1('0x9e')]=function(_0x2248ad,_0x45f0a8){return this[_0xa0c1('0x9d')](_0x2248ad)[_0xa0c1('0x1ca')](_0x45f0a8);};module['exports']=AGIVertices;
\ No newline at end of file
index bd87c32..343e349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d6=['[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','prototype','startAcw','interface','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','savePause','acwTimeout','timer','stopAcw','lastPauseAt','format','queue','updateAcw','update','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','error','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','syncAgentConnect','mandatoryDisposition','destlinkedid','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]'];(function(_0x414e29,_0x2b6db2){var _0x1b7033=function(_0x315de5){while(--_0x315de5){_0x414e29['push'](_0x414e29['shift']());}};_0x1b7033(++_0x2b6db2);}(_0xc7d6,0x1c0));var _0x6c7d=function(_0x3fb9e4,_0xe718d5){_0x3fb9e4=_0x3fb9e4-0x0;var _0x5a230c=_0xc7d6[_0x3fb9e4];return _0x5a230c;};'use strict';var _=require(_0x6c7d('0x0'));var moment=require(_0x6c7d('0x1'));var ami=require('../ami');var logger=require(_0x6c7d('0x2'))(_0x6c7d('0x3'));var RpcUser=require(_0x6c7d('0x4'));var RpcVoiceAgentReport=require(_0x6c7d('0x5'));function Acw(_0x4e7349){this[_0x6c7d('0x6')]=_0x4e7349['voiceQueues'];this['agents']=_0x4e7349[_0x6c7d('0x7')];this['timers']=_0x4e7349[_0x6c7d('0x8')];this[_0x6c7d('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x6c7d('0xa')](this));ami['on'](_0x6c7d('0xb'),this[_0x6c7d('0xc')]['bind'](this));ami['on']('hangup',this[_0x6c7d('0xd')][_0x6c7d('0xa')](this));ami['on'](_0x6c7d('0xe'),this[_0x6c7d('0xf')]['bind'](this));ami['on'](_0x6c7d('0x10'),this[_0x6c7d('0x11')][_0x6c7d('0xa')](this));ami['on']('blindtransfer',this[_0x6c7d('0x12')]['bind'](this));ami['on'](_0x6c7d('0x13'),this[_0x6c7d('0x14')][_0x6c7d('0xa')](this));}function getDiff(_0x55aa7d){var _0x35ba57=moment()['milliseconds'](0x0);var _0x58ea40=moment(_0x55aa7d)['milliseconds'](0x0);return _0x35ba57[_0x6c7d('0x15')](_0x58ea40,'seconds');}Acw[_0x6c7d('0x16')][_0x6c7d('0x17')]=function(_0x2caa0d){try{var _0x374368=this;var _0x4bb929=this[_0x6c7d('0x9')][_0x2caa0d][_0x6c7d('0x18')];var _0x2d4b84=this['channels'][_0x2caa0d]['queue'];var _0x624f77=this[_0x6c7d('0x6')][_0x2d4b84];var _0x14c665=![];var _0xdc09ec=_0x6c7d('0x19');if(_0x624f77['mandatoryDisposition']){if(_0x624f77[_0x6c7d('0x1a')][_0x6c7d('0x1b')]){_0x14c665=!![];_0xdc09ec=_0x624f77[_0x6c7d('0x1a')][_0x6c7d('0x1b')];}}return ami[_0x6c7d('0x1c')]({'action':_0x6c7d('0x1d'),'interface':_0x4bb929,'paused':!![],'reason':_0xdc09ec})[_0x6c7d('0x1e')](function(){if(_0x374368[_0x6c7d('0x7')][_0x4bb929]){return RpcUser[_0x6c7d('0x1f')](_0x374368[_0x6c7d('0x7')][_0x4bb929]['id'])[_0x6c7d('0x1e')](function(_0x372b60){if(_0x372b60&&!_0x372b60[_0x6c7d('0x20')]){logger['info'](_0x6c7d('0x21'),_0x2caa0d,_0x4bb929,_0x2d4b84);var _0x2bc2e3=_0x374368[_0x6c7d('0x9')][_0x2caa0d]['attended']&&_0x374368['channels'][_0x2caa0d]['destlinkedid']?_0x374368[_0x6c7d('0x9')][_0x2caa0d]['destlinkedid']:_0x2caa0d;return RpcUser[_0x6c7d('0x22')](_0x374368['agents'][_0x4bb929],_0xdc09ec,_0x2bc2e3)['then'](function(){if(!_0x14c665){_0x374368[_0x6c7d('0x8')][_0x4bb929]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2caa0d,_0x374368['voiceQueues'][_0x2d4b84][_0x6c7d('0x23')],_0x4bb929,_0x2d4b84);_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x24')]=setTimeout(_0x374368[_0x6c7d('0x25')][_0x6c7d('0xa')](_0x374368,_0x4bb929),_0x374368[_0x6c7d('0x6')][_0x2d4b84]['acwTimeout']*0x3e8);_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x26')]=moment()[_0x6c7d('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0x374368['timers'][_0x4bb929]['uniqueid']=_0x2caa0d;_0x374368['timers'][_0x4bb929][_0x6c7d('0x28')]=_0x2d4b84;_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x29')]=function(){var _0x38e22f=getDiff(_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x26')]);clearTimeout(_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x24')]);_0x374368['timers'][_0x4bb929][_0x6c7d('0x24')]=![];RpcVoiceAgentReport[_0x6c7d('0x2a')]({'acwtime':_0x38e22f},_0x374368[_0x6c7d('0x8')][_0x4bb929][_0x6c7d('0x2b')],_0x4bb929)[_0x6c7d('0x1e')](function(_0x22a072){logger[_0x6c7d('0x2c')](_0x6c7d('0x2d'),_0x2caa0d,_0x38e22f,_0x22a072);})['catch'](function(_0x2152ec){logger['error'](_0x6c7d('0x2e'),_0x2caa0d,_0x2152ec);});delete _0x374368['timers'][_0x4bb929];};}});}else{logger[_0x6c7d('0x2c')](_0x6c7d('0x2f'),_0x2caa0d,_0x4bb929,_0x2d4b84);}});}})[_0x6c7d('0x30')](function(){logger[_0x6c7d('0x31')](_0x6c7d('0x32'),_0x2caa0d,_0x374368[_0x6c7d('0x6')][_0x2d4b84]['acwTimeout'],_0x4bb929,_0x2d4b84);})['finally'](function(){delete _0x374368[_0x6c7d('0x9')][_0x2caa0d];});}catch(_0x12bac8){logger['error'](_0x6c7d('0x33'),_0x12bac8['message']);}};Acw['prototype'][_0x6c7d('0x25')]=function(_0x404b1f){try{var _0xce1782=this;if(_0xce1782[_0x6c7d('0x8')][_0x404b1f]){_0xce1782[_0x6c7d('0x8')][_0x404b1f][_0x6c7d('0x24')]=![];var _0x2cd691=_0xce1782['timers'][_0x404b1f][_0x6c7d('0x2b')];var _0xfc486f=_0xce1782[_0x6c7d('0x8')][_0x404b1f][_0x6c7d('0x28')];var _0x246b76=_0xce1782[_0x6c7d('0x6')][_0xfc486f][_0x6c7d('0x23')];logger[_0x6c7d('0x2c')](_0x6c7d('0x34'),_0x2cd691,_0x404b1f);RpcUser[_0x6c7d('0x35')](this[_0x6c7d('0x7')][_0x404b1f]);RpcVoiceAgentReport[_0x6c7d('0x2a')]({'acwtime':_0x246b76,'agentacw':!![]},_0x2cd691,_0x404b1f)['then'](function(_0x56c6d9){logger[_0x6c7d('0x2c')](_0x6c7d('0x2d'),_0x2cd691,_0x246b76,_0x56c6d9);})[_0x6c7d('0x30')](function(_0x5426ae){logger[_0x6c7d('0x31')](_0x6c7d('0x2e'),_0x2cd691,_0x5426ae);});}else{logger[_0x6c7d('0x31')](_0x6c7d('0x36'),_0x404b1f);if(_0xce1782['timers']){logger['info'](_0x6c7d('0x37'),JSON['stringify'](_0xce1782[_0x6c7d('0x8')]));}}}catch(_0x14d880){logger[_0x6c7d('0x31')](_0x6c7d('0x38'),_0x14d880[_0x6c7d('0x39')]);}};Acw['prototype'][_0x6c7d('0x3a')]=function(_0x48b102){try{if(this[_0x6c7d('0x6')][_0x48b102[_0x6c7d('0x28')]]&&(this[_0x6c7d('0x6')][_0x48b102[_0x6c7d('0x28')]][_0x6c7d('0x3')]||this[_0x6c7d('0x6')][_0x48b102[_0x6c7d('0x28')]][_0x6c7d('0x3b')])){if(this[_0x6c7d('0x7')][_0x48b102['interface']]){this[_0x6c7d('0x9')][_0x48b102[_0x6c7d('0x2b')]]={'queue':_0x48b102['queue'],'interface':_0x48b102['interface'],'destlinkedid':_0x48b102[_0x6c7d('0x3c')]};}}}catch(_0x4e6ff2){logger['error'](_0x6c7d('0x3d'),_0x4e6ff2['message']);}};Acw['prototype'][_0x6c7d('0x14')]=function(_0x3246bb){try{if(this['voiceQueues'][_0x3246bb[_0x6c7d('0x28')]]&&(this[_0x6c7d('0x6')][_0x3246bb[_0x6c7d('0x28')]]['acw']||this[_0x6c7d('0x6')][_0x3246bb[_0x6c7d('0x28')]][_0x6c7d('0x3b')])){if(this[_0x6c7d('0x7')][_0x3246bb[_0x6c7d('0x18')]]){this[_0x6c7d('0x9')][_0x3246bb[_0x6c7d('0x2b')]]={'queue':_0x3246bb[_0x6c7d('0x28')],'interface':_0x3246bb[_0x6c7d('0x18')]};}}}catch(_0x372c54){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x372c54[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0xc')]=function(_0x47b452){try{if(this[_0x6c7d('0x9')][_0x47b452[_0x6c7d('0x2b')]]&&_[_0x6c7d('0x3e')](this[_0x6c7d('0x9')][_0x47b452[_0x6c7d('0x2b')]][_0x6c7d('0x3f')])){logger['info'](_0x6c7d('0x40'),_0x47b452[_0x6c7d('0x2b')]);this[_0x6c7d('0x17')](_0x47b452[_0x6c7d('0x2b')]);}else if(this[_0x6c7d('0x9')][_0x47b452[_0x6c7d('0x41')]]&&_[_0x6c7d('0x3e')](this['channels'][_0x47b452[_0x6c7d('0x41')]][_0x6c7d('0x3f')])){logger[_0x6c7d('0x2c')]('[%s][HANGUP:LINKEDID]',_0x47b452[_0x6c7d('0x41')]);this[_0x6c7d('0x17')](_0x47b452[_0x6c7d('0x41')]);}}catch(_0x2d8728){logger[_0x6c7d('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x2d8728[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0xd')]=function(_0x332fc0){try{if(this[_0x6c7d('0x9')][_0x332fc0[_0x6c7d('0x2b')]]&&this['channels'][_0x332fc0[_0x6c7d('0x2b')]][_0x6c7d('0x3f')]){logger[_0x6c7d('0x2c')](_0x6c7d('0x42'),_0x332fc0[_0x6c7d('0x2b')]);this[_0x6c7d('0x17')](_0x332fc0[_0x6c7d('0x2b')]);}else if(this['channels'][_0x332fc0[_0x6c7d('0x41')]]&&this[_0x6c7d('0x9')][_0x332fc0['linkedid']]['attended']){logger[_0x6c7d('0x2c')](_0x6c7d('0x43'),_0x332fc0[_0x6c7d('0x41')]);this[_0x6c7d('0x17')](_0x332fc0['linkedid']);}}catch(_0x4d6acf){logger[_0x6c7d('0x31')](_0x6c7d('0x44'),_0x4d6acf[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0x11')]=function(_0x44c3c3){try{if(!_[_0x6c7d('0x45')](this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x46')]])){this[_0x6c7d('0x17')](_0x44c3c3[_0x6c7d('0x46')]);if(this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x47')]]){this['channels'][_0x44c3c3[_0x6c7d('0x47')]][_0x6c7d('0x3f')]=!![];this['channels'][_0x44c3c3['transfertargetuniqueid']]=this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x47')]];delete this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x47')]];}}else if(!_['isNil'](this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x48')]])){this['startAcw'](_0x44c3c3[_0x6c7d('0x48')]);if(this[_0x6c7d('0x9')][_0x44c3c3['origtransfereruniqueid']]){this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x49')]][_0x6c7d('0x3f')]=!![];this[_0x6c7d('0x9')][_0x44c3c3[_0x6c7d('0x46')]]=this[_0x6c7d('0x9')][_0x44c3c3['origtransfereruniqueid']];delete this['channels'][_0x44c3c3[_0x6c7d('0x49')]];}}}catch(_0x2b58ab){logger['error'](_0x6c7d('0x4a'),_0x2b58ab[_0x6c7d('0x39')]);}};Acw['prototype'][_0x6c7d('0x12')]=function(_0x9f9d87){try{if(this[_0x6c7d('0x9')][_0x9f9d87['transfereruniqueid']]){logger[_0x6c7d('0x2c')](_0x6c7d('0x4b'),JSON[_0x6c7d('0x4c')](_0x9f9d87[_0x6c7d('0x4d')]));this[_0x6c7d('0x17')](_0x9f9d87['transfereruniqueid']);}else if(this[_0x6c7d('0x9')][_0x9f9d87[_0x6c7d('0x4e')]]){logger[_0x6c7d('0x2c')](_0x6c7d('0x4f'),JSON[_0x6c7d('0x4c')](_0x9f9d87['transfererlinkedid']));this[_0x6c7d('0x17')](_0x9f9d87['transfererlinkedid']);}}catch(_0x40331c){logger['error'](_0x6c7d('0x50'),_0x40331c[_0x6c7d('0x39')]);}};Acw[_0x6c7d('0x16')][_0x6c7d('0xf')]=function(_0x3b69e7){try{if(this[_0x6c7d('0x6')][_0x3b69e7[_0x6c7d('0x28')]]&&this[_0x6c7d('0x6')][_0x3b69e7[_0x6c7d('0x28')]]['autopause']===_0x6c7d('0x51')){if(this[_0x6c7d('0x7')][_0x3b69e7[_0x6c7d('0x18')]]){logger['info'](_0x6c7d('0x52'),_0x3b69e7[_0x6c7d('0x2b')],_0x3b69e7[_0x6c7d('0x18')],_0x3b69e7[_0x6c7d('0x28')]);return RpcUser['savePause'](this[_0x6c7d('0x7')][_0x3b69e7[_0x6c7d('0x18')]],_0x6c7d('0x53'),_0x3b69e7[_0x6c7d('0x2b')]);}}}catch(_0x253374){logger['error'](_0x6c7d('0x54'),_0x253374['message']);}};module[_0x6c7d('0x55')]=Acw;
\ No newline at end of file
+var _0x3a04=['blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','timer','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','prototype','[ACW][syncAgentConnect]\x20%s','acw','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','exports','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x3a04,0x145));var _0x43a0=function(_0x4da279,_0x287048){_0x4da279=_0x4da279-0x0;var _0xca923f=_0x3a04[_0x4da279];return _0xca923f;};'use strict';var _=require('lodash');var moment=require(_0x43a0('0x0'));var ami=require(_0x43a0('0x1'));var logger=require(_0x43a0('0x2'))('acw');var RpcUser=require(_0x43a0('0x3'));var RpcVoiceAgentReport=require(_0x43a0('0x4'));function Acw(_0x2f6488){this[_0x43a0('0x5')]=_0x2f6488['voiceQueues'];this[_0x43a0('0x6')]=_0x2f6488[_0x43a0('0x6')];this[_0x43a0('0x7')]=_0x2f6488[_0x43a0('0x7')];this[_0x43a0('0x8')]={};ami['on'](_0x43a0('0x9'),this[_0x43a0('0xa')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0xc'),this[_0x43a0('0xd')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0xe'),this[_0x43a0('0xf')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x10'),this[_0x43a0('0x11')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x12'),this['syncAttendedTransfer'][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x13'),this[_0x43a0('0x14')][_0x43a0('0xb')](this));ami['on'](_0x43a0('0x15'),this[_0x43a0('0x16')][_0x43a0('0xb')](this));}function getDiff(_0x1e0d7d){var _0x34dd87=moment()['milliseconds'](0x0);var _0x20cc46=moment(_0x1e0d7d)[_0x43a0('0x17')](0x0);return _0x34dd87[_0x43a0('0x18')](_0x20cc46,_0x43a0('0x19'));}Acw['prototype']['startAcw']=function(_0x38b70d){try{var _0x3472fc=this;var _0x432656=this['channels'][_0x38b70d][_0x43a0('0x1a')];var _0x232558=this[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x1b')];var _0x483cd7=this[_0x43a0('0x5')][_0x232558];var _0x3e17cc=![];var _0x4ca61c=_0x43a0('0x1c');if(_0x483cd7[_0x43a0('0x1d')]){if(_0x483cd7['mandatoryDispositionPause']['name']){_0x3e17cc=!![];_0x4ca61c=_0x483cd7[_0x43a0('0x1e')]['name'];}}return ami[_0x43a0('0x1f')]({'action':_0x43a0('0x20'),'interface':_0x432656,'paused':!![],'reason':_0x4ca61c})[_0x43a0('0x21')](function(){if(_0x3472fc['agents'][_0x432656]){return RpcUser[_0x43a0('0x22')](_0x3472fc[_0x43a0('0x6')][_0x432656]['id'])[_0x43a0('0x21')](function(_0x304169){if(_0x304169&&!_0x304169[_0x43a0('0x23')]){logger[_0x43a0('0x24')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x38b70d,_0x432656,_0x232558);var _0x5d545b=_0x3472fc[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x25')]&&_0x3472fc[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x26')]?_0x3472fc[_0x43a0('0x8')][_0x38b70d][_0x43a0('0x26')]:_0x38b70d;return RpcUser[_0x43a0('0x27')](_0x3472fc[_0x43a0('0x6')][_0x432656],_0x4ca61c,_0x5d545b)[_0x43a0('0x21')](function(){if(!_0x3e17cc){_0x3472fc['timers'][_0x432656]={};logger[_0x43a0('0x24')](_0x43a0('0x28'),_0x38b70d,_0x3472fc[_0x43a0('0x5')][_0x232558][_0x43a0('0x29')],_0x432656,_0x232558);_0x3472fc[_0x43a0('0x7')][_0x432656]['timer']=setTimeout(_0x3472fc[_0x43a0('0x2a')][_0x43a0('0xb')](_0x3472fc,_0x432656),_0x3472fc['voiceQueues'][_0x232558][_0x43a0('0x29')]*0x3e8);_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x2b')]=moment()[_0x43a0('0x2c')](_0x43a0('0x2d'));_0x3472fc[_0x43a0('0x7')][_0x432656]['uniqueid']=_0x38b70d;_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x1b')]=_0x232558;_0x3472fc[_0x43a0('0x7')][_0x432656]['updateAcw']=function(){var _0x350850=getDiff(_0x3472fc[_0x43a0('0x7')][_0x432656]['lastPauseAt']);clearTimeout(_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x2e')]);_0x3472fc[_0x43a0('0x7')][_0x432656][_0x43a0('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x350850},_0x3472fc['timers'][_0x432656][_0x43a0('0x2f')],_0x432656)['then'](function(_0x5defd3){logger[_0x43a0('0x24')](_0x43a0('0x30'),_0x38b70d,_0x350850,_0x5defd3);})[_0x43a0('0x31')](function(_0x599873){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x38b70d,_0x599873);});delete _0x3472fc[_0x43a0('0x7')][_0x432656];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x38b70d,_0x432656,_0x232558);}});}})['catch'](function(){logger[_0x43a0('0x32')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x38b70d,_0x3472fc[_0x43a0('0x5')][_0x232558][_0x43a0('0x29')],_0x432656,_0x232558);})[_0x43a0('0x33')](function(){delete _0x3472fc[_0x43a0('0x8')][_0x38b70d];});}catch(_0x3321a3){logger[_0x43a0('0x32')](_0x43a0('0x34'),_0x3321a3[_0x43a0('0x35')]);}};Acw['prototype'][_0x43a0('0x2a')]=function(_0x3864f5){try{var _0x14451f=this;if(_0x14451f[_0x43a0('0x7')][_0x3864f5]){_0x14451f[_0x43a0('0x7')][_0x3864f5]['timer']=![];var _0x216ddb=_0x14451f[_0x43a0('0x7')][_0x3864f5][_0x43a0('0x2f')];var _0x43f8b7=_0x14451f[_0x43a0('0x7')][_0x3864f5][_0x43a0('0x1b')];var _0x277d43=_0x14451f[_0x43a0('0x5')][_0x43f8b7][_0x43a0('0x29')];logger['info'](_0x43a0('0x36'),_0x216ddb,_0x3864f5);RpcUser[_0x43a0('0x37')](this[_0x43a0('0x6')][_0x3864f5]);RpcVoiceAgentReport['update']({'acwtime':_0x277d43,'agentacw':!![]},_0x216ddb,_0x3864f5)[_0x43a0('0x21')](function(_0x5f0e8d){logger[_0x43a0('0x24')](_0x43a0('0x30'),_0x216ddb,_0x277d43,_0x5f0e8d);})[_0x43a0('0x31')](function(_0xf939ad){logger[_0x43a0('0x32')](_0x43a0('0x38'),_0x216ddb,_0xf939ad);});}else{logger[_0x43a0('0x32')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x3864f5);if(_0x14451f['timers']){logger[_0x43a0('0x24')](_0x43a0('0x39'),JSON[_0x43a0('0x3a')](_0x14451f['timers']));}}}catch(_0x4a2a8a){logger[_0x43a0('0x32')](_0x43a0('0x3b'),_0x4a2a8a[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')]['syncAgentConnect']=function(_0x5857f8){try{if(this['voiceQueues'][_0x5857f8['queue']]&&(this[_0x43a0('0x5')][_0x5857f8[_0x43a0('0x1b')]]['acw']||this['voiceQueues'][_0x5857f8['queue']][_0x43a0('0x1d')])){if(this[_0x43a0('0x6')][_0x5857f8[_0x43a0('0x1a')]]){this['channels'][_0x5857f8['uniqueid']]={'queue':_0x5857f8[_0x43a0('0x1b')],'interface':_0x5857f8[_0x43a0('0x1a')],'destlinkedid':_0x5857f8[_0x43a0('0x26')]};}}}catch(_0x3b8122){logger[_0x43a0('0x32')](_0x43a0('0x3d'),_0x3b8122['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x47bebe){try{if(this['voiceQueues'][_0x47bebe[_0x43a0('0x1b')]]&&(this[_0x43a0('0x5')][_0x47bebe[_0x43a0('0x1b')]][_0x43a0('0x3e')]||this[_0x43a0('0x5')][_0x47bebe[_0x43a0('0x1b')]]['mandatoryDisposition'])){if(this[_0x43a0('0x6')][_0x47bebe['interface']]){this['channels'][_0x47bebe['uniqueid']]={'queue':_0x47bebe[_0x43a0('0x1b')],'interface':_0x47bebe[_0x43a0('0x1a')]};}}}catch(_0x943988){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x943988[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')]['syncHangupRequest']=function(_0x79ba9c){try{if(this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x2f')]]&&_['isUndefined'](this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x2f')]]['attended'])){logger['info'](_0x43a0('0x3f'),_0x79ba9c[_0x43a0('0x2f')]);this[_0x43a0('0x40')](_0x79ba9c[_0x43a0('0x2f')]);}else if(this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x41')]]&&_[_0x43a0('0x42')](this[_0x43a0('0x8')][_0x79ba9c[_0x43a0('0x41')]]['attended'])){logger[_0x43a0('0x24')](_0x43a0('0x43'),_0x79ba9c[_0x43a0('0x41')]);this[_0x43a0('0x40')](_0x79ba9c[_0x43a0('0x41')]);}}catch(_0x1264f1){logger[_0x43a0('0x32')](_0x43a0('0x44'),_0x1264f1[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')]['syncHangup']=function(_0xa8b5e){try{if(this[_0x43a0('0x8')][_0xa8b5e[_0x43a0('0x2f')]]&&this['channels'][_0xa8b5e[_0x43a0('0x2f')]][_0x43a0('0x25')]){logger[_0x43a0('0x24')](_0x43a0('0x45'),_0xa8b5e[_0x43a0('0x2f')]);this[_0x43a0('0x40')](_0xa8b5e[_0x43a0('0x2f')]);}else if(this['channels'][_0xa8b5e['linkedid']]&&this[_0x43a0('0x8')][_0xa8b5e[_0x43a0('0x41')]]['attended']){logger[_0x43a0('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0xa8b5e[_0x43a0('0x41')]);this[_0x43a0('0x40')](_0xa8b5e['linkedid']);}}catch(_0x17a304){logger[_0x43a0('0x32')]('[ACW][syncHangup]\x20%s',_0x17a304[_0x43a0('0x35')]);}};Acw[_0x43a0('0x3c')][_0x43a0('0x46')]=function(_0x3e51ad){try{if(!_[_0x43a0('0x47')](this[_0x43a0('0x8')][_0x3e51ad['transfereeuniqueid']])){this[_0x43a0('0x40')](_0x3e51ad[_0x43a0('0x48')]);if(this[_0x43a0('0x8')][_0x3e51ad['secondtransfereruniqueid']]){this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x49')]][_0x43a0('0x25')]=!![];this['channels'][_0x3e51ad['transfertargetuniqueid']]=this[_0x43a0('0x8')][_0x3e51ad['secondtransfereruniqueid']];delete this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x49')]];}}else if(!_[_0x43a0('0x47')](this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x4a')]])){this[_0x43a0('0x40')](_0x3e51ad[_0x43a0('0x4a')]);if(this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x4b')]]){this['channels'][_0x3e51ad['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x3e51ad[_0x43a0('0x48')]]=this[_0x43a0('0x8')][_0x3e51ad[_0x43a0('0x4b')]];delete this['channels'][_0x3e51ad[_0x43a0('0x4b')]];}}}catch(_0x122228){logger[_0x43a0('0x32')](_0x43a0('0x4c'),_0x122228['message']);}};Acw[_0x43a0('0x3c')][_0x43a0('0x14')]=function(_0x451b95){try{if(this[_0x43a0('0x8')][_0x451b95[_0x43a0('0x4d')]]){logger[_0x43a0('0x24')](_0x43a0('0x4e'),JSON[_0x43a0('0x3a')](_0x451b95[_0x43a0('0x4d')]));this[_0x43a0('0x40')](_0x451b95[_0x43a0('0x4d')]);}else if(this['channels'][_0x451b95[_0x43a0('0x4f')]]){logger[_0x43a0('0x24')](_0x43a0('0x50'),JSON[_0x43a0('0x3a')](_0x451b95[_0x43a0('0x4f')]));this[_0x43a0('0x40')](_0x451b95[_0x43a0('0x4f')]);}}catch(_0x4d5370){logger[_0x43a0('0x32')](_0x43a0('0x51'),_0x4d5370['message']);}};Acw[_0x43a0('0x3c')][_0x43a0('0x11')]=function(_0x15d723){try{if(this[_0x43a0('0x5')][_0x15d723[_0x43a0('0x1b')]]&&this[_0x43a0('0x5')][_0x15d723[_0x43a0('0x1b')]][_0x43a0('0x52')]===_0x43a0('0x53')){if(this[_0x43a0('0x6')][_0x15d723[_0x43a0('0x1a')]]){logger['info'](_0x43a0('0x54'),_0x15d723[_0x43a0('0x2f')],_0x15d723[_0x43a0('0x1a')],_0x15d723['queue']);return RpcUser['savePause'](this[_0x43a0('0x6')][_0x15d723[_0x43a0('0x1a')]],'Auto-Pause',_0x15d723[_0x43a0('0x2f')]);}}}catch(_0x568d7f){logger[_0x43a0('0x32')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x568d7f[_0x43a0('0x35')]);}};module[_0x43a0('0x55')]=Acw;
\ No newline at end of file
index 54b041e..8e879ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4b=['username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','format','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipPeerStatus','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f4b,0xc6));var _0xb8f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f4b[_0x3dd15e];return _0x231fd0;};'use strict';var Manager=require(_0xb8f4('0x0'));var BPromise=require(_0xb8f4('0x1'));var util=require(_0xb8f4('0x2'));var logger=require(_0xb8f4('0x3'))(_0xb8f4('0x4'));var config=require(_0xb8f4('0x5'));var ami=new Manager(config[_0xb8f4('0x6')]['port'],config['asterisk']['ip'],config['asterisk'][_0xb8f4('0x7')],config[_0xb8f4('0x6')][_0xb8f4('0x8')],!![]);ami[_0xb8f4('0x9')]();ami[_0xb8f4('0xa')]=BPromise[_0xb8f4('0xb')](ami[_0xb8f4('0xc')]);function error(_0x5a25e1){logger[_0xb8f4('0xd')](util['format'](_0xb8f4('0xe'),config[_0xb8f4('0x6')][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config['asterisk'][_0xb8f4('0xf')],util['inspect'](_0x5a25e1,![],null)));}function close(){logger[_0xb8f4('0xd')](util['format'](_0xb8f4('0x10'),config['asterisk'][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config[_0xb8f4('0x6')][_0xb8f4('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x11')});};};ami[_0xb8f4('0x12')]=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x13')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x14')});};};ami[_0xb8f4('0x15')]=function(){return function(){return ami['Action']({'action':_0xb8f4('0x16')});};};ami[_0xb8f4('0x17')]=function(){return function(){return ami[_0xb8f4('0xa')]({'action':_0xb8f4('0x18')});};};function connect(){logger[_0xb8f4('0x19')](util[_0xb8f4('0x1a')](_0xb8f4('0x1b'),config[_0xb8f4('0x6')][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config[_0xb8f4('0x6')][_0xb8f4('0xf')]));ami[_0xb8f4('0x1c')](_0xb8f4('0xd'),error);ami['once'](_0xb8f4('0x1d'),close);}ami['on'](_0xb8f4('0x1e'),connect);ami['on'](_0xb8f4('0x1f'),function(_0x153ab3){logger[_0xb8f4('0x19')](util['format'](_0xb8f4('0x20'),config[_0xb8f4('0x6')]['username'],config[_0xb8f4('0x6')]['ip'],config['asterisk'][_0xb8f4('0xf')],util[_0xb8f4('0x21')](_0x153ab3,![],null)));});ami['on'](_0xb8f4('0x22'),function(){logger[_0xb8f4('0x19')](util[_0xb8f4('0x1a')](_0xb8f4('0x23'),config[_0xb8f4('0x6')][_0xb8f4('0x7')],config[_0xb8f4('0x6')]['ip'],config[_0xb8f4('0x6')][_0xb8f4('0xf')]));return Promise[_0xb8f4('0x24')]()[_0xb8f4('0x25')](ami['actionSipShowRegistry']())[_0xb8f4('0x25')](ami[_0xb8f4('0x12')]())['then'](ami[_0xb8f4('0x26')]())[_0xb8f4('0x25')](ami[_0xb8f4('0x15')]())[_0xb8f4('0x25')](ami['actionCoreShowChannels']())['catch'](function(_0x142986){logger['error'](_0xb8f4('0x27'),util[_0xb8f4('0x21')](_0x142986,{'showHidden':![],'depth':null}));});});ami[_0xb8f4('0x1c')](_0xb8f4('0xd'),error);ami[_0xb8f4('0x1c')](_0xb8f4('0x1d'),close);module[_0xb8f4('0x28')]=ami;
\ No newline at end of file
+var _0xede1=['actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','../../config/environment','asterisk','port','password','keepConnected','Action','promisify','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary'];(function(_0x1ecae6,_0x5f187b){var _0x27224e=function(_0xff11f){while(--_0xff11f){_0x1ecae6['push'](_0x1ecae6['shift']());}};_0x27224e(++_0x5f187b);}(_0xede1,0x194));var _0x1ede=function(_0x454a06,_0x4dd92f){_0x454a06=_0x454a06-0x0;var _0x200db2=_0xede1[_0x454a06];return _0x200db2;};'use strict';var Manager=require(_0x1ede('0x0'));var BPromise=require(_0x1ede('0x1'));var util=require(_0x1ede('0x2'));var logger=require(_0x1ede('0x3'))('ami');var config=require(_0x1ede('0x4'));var ami=new Manager(config[_0x1ede('0x5')][_0x1ede('0x6')],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')]['username'],config[_0x1ede('0x5')][_0x1ede('0x7')],!![]);ami[_0x1ede('0x8')]();ami[_0x1ede('0x9')]=BPromise[_0x1ede('0xa')](ami[_0x1ede('0xb')]);function error(_0x38bd02){logger['error'](util[_0x1ede('0xc')](_0x1ede('0xd'),config[_0x1ede('0x5')][_0x1ede('0xe')],config[_0x1ede('0x5')]['ip'],config['asterisk']['port'],util[_0x1ede('0xf')](_0x38bd02,![],null)));}function close(){logger[_0x1ede('0x10')](util['format'](_0x1ede('0x11'),config['asterisk'][_0x1ede('0xe')],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')][_0x1ede('0x6')]));}ami[_0x1ede('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x1ede('0x13')]=function(){return function(){return ami['Action']({'action':_0x1ede('0x14')});};};ami[_0x1ede('0x15')]=function(){return function(){return ami[_0x1ede('0x9')]({'action':_0x1ede('0x16')});};};ami[_0x1ede('0x17')]=function(){return function(){return ami[_0x1ede('0x9')]({'action':_0x1ede('0x18')});};};ami[_0x1ede('0x19')]=function(){return function(){return ami[_0x1ede('0x9')]({'action':_0x1ede('0x1a')});};};function connect(){logger[_0x1ede('0x1b')](util[_0x1ede('0xc')](_0x1ede('0x1c'),config['asterisk'][_0x1ede('0xe')],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')][_0x1ede('0x6')]));ami[_0x1ede('0x1d')]('error',error);ami[_0x1ede('0x1d')](_0x1ede('0x1e'),close);}ami['on'](_0x1ede('0x1f'),connect);ami['on'](_0x1ede('0x20'),function(_0x4de750){logger[_0x1ede('0x1b')](util[_0x1ede('0xc')](_0x1ede('0x21'),config[_0x1ede('0x5')]['username'],config[_0x1ede('0x5')]['ip'],config['asterisk'][_0x1ede('0x6')],util[_0x1ede('0xf')](_0x4de750,![],null)));});ami['on'](_0x1ede('0x22'),function(){logger[_0x1ede('0x1b')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x1ede('0x5')]['username'],config[_0x1ede('0x5')]['ip'],config[_0x1ede('0x5')][_0x1ede('0x6')]));return Promise['resolve']()[_0x1ede('0x23')](ami[_0x1ede('0x12')]())[_0x1ede('0x23')](ami[_0x1ede('0x13')]())['then'](ami['actionSipPeerStatus']())[_0x1ede('0x23')](ami['actionQueueSummary']())[_0x1ede('0x23')](ami['actionCoreShowChannels']())[_0x1ede('0x24')](function(_0x23b7b0){logger[_0x1ede('0x10')](_0x1ede('0x25'),util['inspect'](_0x23b7b0,{'showHidden':![],'depth':null}));});});ami[_0x1ede('0x1d')](_0x1ede('0x10'),error);ami['once'](_0x1ede('0x1e'),close);module[_0x1ede('0x26')]=ami;
\ No newline at end of file
index cb3d70d..7ef391b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x549d16,_0x4d069a){var _0x344ccc=function(_0x1d992a){while(--_0x1d992a){_0x549d16['push'](_0x549d16['shift']());}};_0x344ccc(++_0x4d069a);}(_0xac4a,0x13f));var _0xaac4=function(_0xa177f8,_0x54f9e5){_0xa177f8=_0xa177f8-0x0;var _0x184280=_0xac4a[_0xa177f8];return _0x184280;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client;
\ No newline at end of file
+var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x3d4fdf,_0x210831){var _0xe0e37e=function(_0x32362b){while(--_0x32362b){_0x3d4fdf['push'](_0x3d4fdf['shift']());}};_0xe0e37e(++_0x210831);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x181f81,_0x594c9c){_0x181f81=_0x181f81-0x0;var _0x25b0c6=_0xbdb7[_0x181f81];return _0x25b0c6;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client;
\ No newline at end of file
index ef7d24c..37a0556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0a3=['reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','erlangCalls','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','predictiveIntervalHitRate','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','getSeconds','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','getContactDialer','checkIsBlackList','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','p\x20=\x20','Umin\x20=\x20','exports','lodash','moment','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','./models/history','./models/final','./models/agentComplete','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','varset','queuemember','queuestatuscomplete','getSettings','previewRecallmeReminderInterval','emit','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','name','voice_queue:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','predictiveIntervalAvgHoldtime','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','---------------------------','merge','startProgressive','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','message','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','Trunk','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','isArray','length','push','command','iftime\x20%s,%s','content','indexOf','true','catch','Action','then','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','campaigns','undefined','resolve','dialGlobalInterval','dialTimezone','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','silly','Dialer::ifTime()','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','[ifTime][Action]','queue','uniqueid','answertime','ivr','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','createHistory','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','Abandoned','countabandonedretry','dialAbandonedMaxRetry','rescheduleContact','dialAbandonedRetryFrequency','VoiceQueueId','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','syncQueueMember','actionid','isNil','locked','paused','stateinterface','rrmemory','idHopper','syncQueueStatusComplete','strategy','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','responsetime','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','HangupInAMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerAgiCallsDay','membername','AMD','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','stateGlobal','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','moveContactManagedDialer','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','clearZombieChannels','[actions]','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','launchHandleIvr','handleIvr','actionOriginate','object','originate','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','updatedAt','%s%s','XMD-','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','dialCutDigit','substring','SIP/%s/%s%s','dialPrefix','trim','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','Error','originate\x20action\x20Error','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]'];(function(_0x1caa4b,_0x3e3bd2){var _0x2a8a13=function(_0x41d224){while(--_0x41d224){_0x1caa4b['push'](_0x1caa4b['shift']());}};_0x2a8a13(++_0x3e3bd2);}(_0xa0a3,0x7b));var _0x3a0a=function(_0x2b0a0c,_0x435ea6){_0x2b0a0c=_0x2b0a0c-0x0;var _0xf5bdfc=_0xa0a3[_0x2b0a0c];return _0xf5bdfc;};'use strict';var util=require('util');var _=require(_0x3a0a('0x0'));var uuid=require('uuid');var moment=require(_0x3a0a('0x1'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x3a0a('0x2'));var hopperUtils=require(_0x3a0a('0x3'));var ut=require(_0x3a0a('0x4'));var config=require(_0x3a0a('0x5'));var logger=require(_0x3a0a('0x6'))(_0x3a0a('0x7'));var loggerBooked=require(_0x3a0a('0x6'))('booked');var loggerPredictive=require(_0x3a0a('0x6'))(_0x3a0a('0x8'));var loggerPredictiveCalls=require(_0x3a0a('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x3a0a('0x6'))(_0x3a0a('0x9'));var ami=require(_0x3a0a('0xa'));config[_0x3a0a('0xb')]=_[_0x3a0a('0xc')](config['redis'],{'host':_0x3a0a('0xd'),'port':0x18eb});var io=require(_0x3a0a('0xe'))(new Redis(config[_0x3a0a('0xb')]));var cmHopper=require(_0x3a0a('0xf'));var voiceQueueRt=require(_0x3a0a('0x10'));var RpcSetting=require('../rpc/setting');var Interval=require('../rpc/interval');var Action=require('./models/action');var History=require(_0x3a0a('0x11'));var Final=require(_0x3a0a('0x12'));var AgentComplete=require(_0x3a0a('0x13'));var QueueCallerAbandon=require('./models/queueCallerAbandon');var Hangup=require(_0x3a0a('0x14'));var ipAgi=process[_0x3a0a('0x15')][_0x3a0a('0x16')]||_0x3a0a('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x3a0a('0x18')]['enqueue']=function(_0x2aa802){this['tail']=this[_0x3a0a('0x19')]?this[_0x3a0a('0x19')][_0x3a0a('0x1a')](_0x2aa802):_0x2aa802();};function Dialer(_0x39cca4,_0x29d35e){this[_0x3a0a('0x1b')]=new Sequence();this[_0x3a0a('0x1c')]=_0x29d35e;this[_0x3a0a('0x1d')]=_0x39cca4[_0x3a0a('0x1d')];this['campaigns']=_0x39cca4['campaigns'];this[_0x3a0a('0x1e')]=_0x39cca4[_0x3a0a('0x1e')];this['trunks']=_0x39cca4[_0x3a0a('0x1f')];this[_0x3a0a('0x20')]=config[_0x3a0a('0x20')]||0x2;this['channels']={};this[_0x3a0a('0x21')]={};this[_0x3a0a('0x22')]={};this[_0x3a0a('0x23')]={};this['optionPredictive']={};this['startPredictive']={};this['startProgressive']={};this[_0x3a0a('0x24')]={};this[_0x3a0a('0x25')]={};this[_0x3a0a('0x26')]={};this[_0x3a0a('0x27')]={};ami['on'](_0x3a0a('0x28'),this[_0x3a0a('0x29')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x2b'),this[_0x3a0a('0x2c')]['bind'](this));ami['on'](_0x3a0a('0x2d'),this[_0x3a0a('0x2e')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x2f'),this[_0x3a0a('0x30')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x31'),this['syncQueueSummary']['bind'](this));ami['on'](_0x3a0a('0x32'),this[_0x3a0a('0x33')]['bind'](this));ami['on'](_0x3a0a('0x34'),this['syncHangup'][_0x3a0a('0x2a')](this));ami['on']('newexten',this[_0x3a0a('0x35')][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x36'),this['syncVarSet'][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x37'),this['syncQueueMember'][_0x3a0a('0x2a')](this));ami['on'](_0x3a0a('0x38'),this['syncQueueStatusComplete'][_0x3a0a('0x2a')](this));this['loopCampaigns']();this['loopClearZombieChannels']();RpcSetting[_0x3a0a('0x39')]()['then'](function(_0x232ba5){previewRecallmeReminderInterval=_0x232ba5[_0x3a0a('0x3a')];});}function isNotNull(_0x5884df){return _0x5884df!==null&&!_['isUndefined'](_0x5884df);}function msgResponse(_0x40e1d5,_0x395ed1,_0x55ee4d){return{'action':_0x40e1d5,'response':_0x395ed1,'message':_0x55ee4d,'stack':_0x55ee4d};}function emit(_0x3f4cec,_0x2d1d68,_0x1d7bf6){io['to'](_0x3f4cec)[_0x3a0a('0x3b')](_0x2d1d68,_0x1d7bf6);}function emitOutboundVoiceQueueSummary(_0x339d1b){if(_0x339d1b[_0x3a0a('0x3c')]===_0x3a0a('0x3d')){logger[_0x3a0a('0x3e')](_0x3a0a('0x3f'),util[_0x3a0a('0x40')](_0x339d1b,{'showHidden':![],'depth':null}));emit(util['format']('voice:queue:%s',_0x339d1b[_0x3a0a('0x41')]),_0x3a0a('0x42'),_0x339d1b);}}function checkGetDataPredictive(_0x5b1172){if(isNotNull(_0x5b1172)&&!_[_0x3a0a('0x43')](_0x5b1172)){loggerPredictive[_0x3a0a('0x44')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x45'),_0x5b1172[_0x3a0a('0x46')]);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x47'),_0x5b1172[_0x3a0a('0x48')]);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x49'),_0x5b1172[_0x3a0a('0x4a')]);loggerPredictive[_0x3a0a('0x44')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b1172[_0x3a0a('0x4b')]);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x4c'),_0x5b1172['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x3a0a('0x4d'),_0x5b1172[_0x3a0a('0x4e')]);loggerPredictive['info']('---------------------------');if(_0x5b1172['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x5b1172[_0x3a0a('0x4e')])&&_0x5b1172[_0x3a0a('0x4e')]>0x0){return!![];}loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x4f'));if(!_[_0x3a0a('0x50')](_0x5b1172[_0x3a0a('0x51')])&&_0x5b1172[_0x3a0a('0x51')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x3a0a('0x44')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x3a0a('0x52'));}return![];}function mergeDataErlangB(_0x57d0e5){return function(_0x37999b){loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x53'));loggerPredictive['info'](_0x3a0a('0x54'),_0x37999b['erlangCalls']);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x55'),_0x37999b[_0x3a0a('0x56')]);loggerPredictive[_0x3a0a('0x44')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37999b['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x37999b[_0x3a0a('0x57')]);loggerPredictive['info'](_0x3a0a('0x58'),_0x37999b[_0x3a0a('0x59')]);loggerPredictive['info'](_0x3a0a('0x5a'));_[_0x3a0a('0x5b')](_0x57d0e5,_0x37999b);};}function ifInterval(_0x22803c,_0x3d769b){if(_[_0x3a0a('0x50')](_0x3d769b)){return![];}return utils['getSeconds'](undefined,_0x3d769b)<_0x22803c*0x3c;}function clearPredictiveAttributes(_0xccb1f4){if(_0xccb1f4['startProgressive']){_0xccb1f4[_0x3a0a('0x5c')]=undefined;loggerPredictive[_0x3a0a('0x3e')](_0xccb1f4[_0x3a0a('0x41')],_0x3a0a('0x5d'));}if(_0xccb1f4[_0x3a0a('0x5e')]){_0xccb1f4[_0x3a0a('0x5e')]=undefined;loggerPredictive[_0x3a0a('0x3e')](_0xccb1f4['name'],_0x3a0a('0x5f'));}if(_0xccb1f4['handlePredictive']){clearInterval(_0xccb1f4['handlePredictive']);_0xccb1f4[_0x3a0a('0x60')]=undefined;loggerPredictive['debug'](_0xccb1f4['name'],_0x3a0a('0x61'));}}function loggerCatchPredictive(_0x3b6f54,_0x1c0fee){return function(_0x194ec8){loggerPredictive['error'](_0x1c0fee[_0x3a0a('0x41')],_0x3b6f54);loggerPredictive[_0x3a0a('0x62')](_0x194ec8[_0x3a0a('0x63')]);clearPredictiveAttributes(_0x1c0fee);};}function loggerCatch(_0x569095){return function(_0x39aae1){logger[_0x3a0a('0x62')](_0x569095,util['inspect'](_0x39aae1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x17fc3f,_0x28937e,_0x1c330f){return function(_0x22b845){utils[_0x3a0a('0x64')](_0x28937e,_0x1c330f,0x0);logger[_0x3a0a('0x62')](_0x17fc3f,util[_0x3a0a('0x40')](_0x22b845,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x58467c){return function(_0x5e79c1){if(isNotNull(_0x5e79c1)&&isNotNull(_0x5e79c1[0x0])){if(_0x5e79c1[0x0]['contactsRescheduled']>0x0){_0x58467c['message']=utils['CAMPAIGN_STATUS']['CONTACTS_RESCHEDULED'];logger[_0x3a0a('0x44')](_0x3a0a('0x65')+_0x58467c['name'],_0x5e79c1[0x0][_0x3a0a('0x66')],_0x3a0a('0x67'));}else{_0x58467c[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x6a')];logger[_0x3a0a('0x44')]('[getContactDialer2][Empty]'+_0x58467c[_0x3a0a('0x41')]);}}};}function createObjHistory(_0x55fb62,_0x4b7a42,_0x17262f,_0x35e0bd,_0x5b2496){_0x55fb62[_0x3a0a('0x68')]=_0x17262f;var _0x1edc36=new Action(_0x55fb62,_0x4b7a42);var _0x31fb77=new History(_0x1edc36);_0x31fb77[_0x3a0a('0x6b')]=_0x35e0bd;_0x31fb77[_0x3a0a('0x6c')]=_0x5b2496;_0x31fb77[_0x3a0a('0x6d')]=_0x1edc36['starttime'];return _0x31fb77;}function unlockQueueStatus(_0x4592d9,_0xe39578){setTimeout(function(){if(_[_0x3a0a('0x50')](_0x4592d9['queueStatusComplete'])){loggerBooked[_0x3a0a('0x62')](_0x3a0a('0x6e'),_0xe39578);}_0x4592d9['queueStatusComplete']=!![];loggerBooked[_0x3a0a('0x44')](_0x3a0a('0x6f'),_0xe39578,JSON[_0x3a0a('0x70')](_[_0x3a0a('0x71')](_0x4592d9,[_0x3a0a('0x41'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x53f9b6){return function(){if(!isNotNull(_0x53f9b6[_0x3a0a('0x72')])){_0x53f9b6['message']=utils[_0x3a0a('0x69')]['NULL_INTERVAL'];throw _0x53f9b6[_0x3a0a('0x41')]+_0x3a0a('0x73');}if(!isNotNull(_0x53f9b6[_0x3a0a('0x72')][_0x3a0a('0x74')])){_0x53f9b6[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x75')];throw _0x53f9b6['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x3a0a('0x43')](_0x53f9b6[_0x3a0a('0x72')][_0x3a0a('0x74')]))){_0x53f9b6[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x75')];throw _0x53f9b6[_0x3a0a('0x41')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x46ffa5){return function(){if(!utils[_0x3a0a('0x76')](_0x46ffa5)){_0x46ffa5['message']=utils[_0x3a0a('0x69')][_0x3a0a('0x77')];throw _0x46ffa5[_0x3a0a('0x41')]+_0x3a0a('0x78');}};}function emitCampaignSummary(_0x384dc5){if(utils[_0x3a0a('0x79')](_0x384dc5)){emit(util[_0x3a0a('0x7a')](_0x3a0a('0x7b'),_0x384dc5['name']),_0x3a0a('0x7c'),_0x384dc5);}}function loggerCatchQueueSummary(_0x575516,_0x48996e){return function(_0x55e5e4){clearPredictiveAttributes(_0x48996e);emitCampaignSummary(_0x48996e);loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x575516,util[_0x3a0a('0x40')](_0x55e5e4,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x6159f3){if(_0x6159f3[_0x3a0a('0x7d')]){if(_0x6159f3[_0x3a0a('0x7e')]===0x0){_0x6159f3[_0x3a0a('0x7d')]=![];_0x6159f3[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x77')];loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x3a0a('0x7f'),_0x6159f3[_0x3a0a('0x41')],_0x3a0a('0x80'));}else{_0x6159f3[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x81')];loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x3a0a('0x7f'),_0x6159f3[_0x3a0a('0x41')],_0x3a0a('0x82'));}emitCampaignSummary(_0x6159f3);}}function myreject(_0x20a6c1){return function(_0x18b58d){return _0x20a6c1(msgResponse('[ifTime][Action]','Error',JSON['stringify'](_0x18b58d)));};}Dialer[_0x3a0a('0x18')][_0x3a0a('0x83')]=function(_0x1eb594){return!_[_0x3a0a('0x50')](_0x1eb594)&&_0x1eb594&&!_[_0x3a0a('0x50')](_0x1eb594['name'])&&!_[_0x3a0a('0x50')](_0x1eb594[_0x3a0a('0x84')])&&_0x1eb594[_0x3a0a('0x84')]&&(this[_0x3a0a('0x1f')][util[_0x3a0a('0x7a')](_0x3a0a('0x85'),_0x1eb594[_0x3a0a('0x41')])][_0x3a0a('0x86')]===_0x3a0a('0x87')||this['trunks'][util[_0x3a0a('0x7a')](_0x3a0a('0x85'),_0x1eb594['name'])][_0x3a0a('0x86')]===_0x3a0a('0x88'));};Dialer[_0x3a0a('0x18')]['checkIsTrunkReachable']=function(_0x44a18b){var _0x1a7908=this;return function(){if(!_0x1a7908[_0x3a0a('0x83')](_0x44a18b[_0x3a0a('0x89')])){if(!_0x1a7908['isTrunkReachable'](_0x44a18b[_0x3a0a('0x8a')])){_0x44a18b['message']=utils['CAMPAIGN_STATUS']['TRUNK_NOT_REACHABLE'];throw _0x44a18b[_0x3a0a('0x41')]+_0x3a0a('0x8b');}}};};Dialer['prototype'][_0x3a0a('0x8c')]=function(_0x2ee2ac,_0x3839fa,_0x475f1f,_0x1561a3){var _0x411875=this;return function(){var _0x4a0ad6=!![];return _0x411875[_0x3a0a('0x8d')](_0x2ee2ac,_0x3839fa,_0x475f1f,_0x1561a3,_0x4a0ad6);};};Dialer['prototype'][_0x3a0a('0x8e')]=function(_0x58af3c,_0x38f6b3,_0x31b986,_0x280ce9){var _0x10276c=this;return function(){var _0x319257=![];return _0x10276c[_0x3a0a('0x8d')](_0x58af3c['Intervals'],_0x38f6b3,_0x31b986,_0x280ce9,_0x319257);};};Dialer['prototype']['ifTimeIvr']=function(_0x3d2861,_0x3bf807,_0x54ca82,_0x469f32,_0xecc9f3){var _0x4064d9=[];return new Promise(function(_0xc0da49,_0x413d66){if(!isNotNull(_0x3d2861)){_0x469f32[_0x3a0a('0x68')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x413d66(msgResponse(_0x3a0a('0x8f'),_0x3a0a('0x90'),_0x54ca82+_0x3a0a('0x91')));}if(_['isEmpty'](_0x3d2861)){_0x469f32['message']=utils[_0x3a0a('0x69')]['EMPTY_INTERVAL'];return _0x413d66(msgResponse(_0x3a0a('0x8f'),_0x3a0a('0x90'),_0x54ca82+_0x3a0a('0x92')));}if(_0x3bf807&&_[_0x3a0a('0x50')](config[_0x3a0a('0x93')][_0x3bf807])){_0x469f32[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x94')];return _0x413d66(msgResponse('ifTime',_0x3a0a('0x90'),_0x54ca82+'\x20Timezone\x20unknow\x20'+_0x3bf807));}if(_[_0x3a0a('0x95')](_0x3d2861)){for(var _0x1fa2d2=0x0;_0x1fa2d2<_0x3d2861[_0x3a0a('0x96')];_0x1fa2d2+=0x1){_0x4064d9[_0x3a0a('0x97')](ami['Action']({'action':_0x3a0a('0x98'),'command':util['format'](_0x3a0a('0x99'),_0x3d2861[_0x1fa2d2]['interval'],!_[_0x3a0a('0x50')](config['timezones'][_0x3bf807])?_0x3bf807:'')})['then'](function(_0x53fe1c){return _0x53fe1c[_0x3a0a('0x9a')][_0x3a0a('0x9b')](_0x3a0a('0x9c'))>=0x0;})[_0x3a0a('0x9d')](myreject(_0x413d66)));}}else{_0x4064d9[_0x3a0a('0x97')](ami[_0x3a0a('0x9e')]({'action':_0x3a0a('0x98'),'command':util[_0x3a0a('0x7a')]('iftime\x20%s,%s',_0x3d2861,!_['isUndefined'](config[_0x3a0a('0x93')][_0x3bf807])?_0x3bf807:'')})[_0x3a0a('0x9f')](function(_0x450b67){return _0x450b67[_0x3a0a('0x9a')][_0x3a0a('0x9b')](_0x3a0a('0x9c'))>=0x0;})[_0x3a0a('0x9d')](myreject(_0x413d66)));}Promise[_0x3a0a('0xa0')](_0x4064d9)[_0x3a0a('0x9f')](function(_0x350592){var _0x3b22f2=_[_0x3a0a('0xa1')](_0x350592);if(_0x3b22f2){return _0xc0da49(_0x3b22f2);}else{_0x469f32[_0x3a0a('0x68')]=_0xecc9f3?utils[_0x3a0a('0x69')][_0x3a0a('0xa2')]:utils['CAMPAIGN_STATUS'][_0x3a0a('0xa3')];return _0x413d66(msgResponse(_0x3a0a('0xa4'),_0x3a0a('0x90'),_0x3a0a('0xa5')+_0xecc9f3+'\x20'+_0x54ca82+_0x3a0a('0xa6')+util[_0x3a0a('0x40')](_0x3d2861,{'showHidden':![],'depth':null})+_0x3a0a('0xa7')+_0x3bf807));}})['catch'](function(_0x1ebe1b){return _0x413d66(msgResponse('ifTime',_0x3a0a('0x90'),JSON['stringify'](_0x1ebe1b)));});});};Dialer[_0x3a0a('0x18')][_0x3a0a('0xa8')]=function(){var _0x5d9b05=this;return cmHopper[_0x3a0a('0xa9')]({'active':![]},{'where':{'active':!![]}})[_0x3a0a('0x9f')](function(){setInterval(function(){_0x5d9b05[_0x3a0a('0xaa')]();},0x3e8);});};Dialer[_0x3a0a('0x18')][_0x3a0a('0xaa')]=function(){var _0x2ddc7c=this;var _0xeed980;for(var _0xdab3a8 in this[_0x3a0a('0xab')]){if(typeof this[_0x3a0a('0xab')][_0xdab3a8]!==_0x3a0a('0xac')){_0xeed980=this[_0x3a0a('0xab')][_0xdab3a8];if(utils['isIVRCampaign'](_0xeed980)&&utils[_0x3a0a('0x76')](_0xeed980)){_0xeed980[_0x3a0a('0x7d')]=!![];Promise[_0x3a0a('0xad')]()[_0x3a0a('0x9f')](checkIsIVRCampaignActive(_0xeed980))[_0x3a0a('0x9f')](checkInterval(_0xeed980))['then'](_0x2ddc7c['checkIsTrunkReachable'](_0xeed980))['then'](_0x2ddc7c['checkIfTime'](_0xeed980[_0x3a0a('0xae')],_0xeed980[_0x3a0a('0xaf')],_0xeed980[_0x3a0a('0x41')],_0xeed980))[_0x3a0a('0x9f')](_0x2ddc7c[_0x3a0a('0x8e')](_0xeed980[_0x3a0a('0x72')],_0xeed980[_0x3a0a('0xaf')],_0xeed980[_0x3a0a('0x41')],_0xeed980))['then'](_0x2ddc7c['launchHandleIvr'](_0xeed980))[_0x3a0a('0x9d')](loggerCatchQueueSummary(_0x3a0a('0xb0'),_0xeed980));}else{notSendMessagesCampaign(_0xeed980);}}}};Dialer[_0x3a0a('0x18')][_0x3a0a('0xb1')]=function(_0x2a085a){if(_0x2a085a[_0x3a0a('0xb2')]!==_0x3a0a('0x8')){clearPredictiveAttributes(_0x2a085a);}switch(_0x2a085a['dialMethod']){case _0x3a0a('0xb3'):this[_0x3a0a('0xb4')](_0x2a085a,0x1);break;case _0x3a0a('0xb5'):this['handlePower'](_0x2a085a,_0x2a085a[_0x3a0a('0xb6')]);break;case'predictive':this[_0x3a0a('0x8')](_0x2a085a);break;case _0x3a0a('0xb7'):this['handlePower'](_0x2a085a,0x1);break;default:logger[_0x3a0a('0x62')](_0x3a0a('0xb8'),_0x2a085a[_0x3a0a('0x41')],'method\x20not\x20recognized');}};Dialer['prototype'][_0x3a0a('0x8f')]=function(_0x54f92a,_0x1b0fa3){var _0x42afaf=_0x54f92a[_0x3a0a('0xaf')];var _0x10b89a=_0x1b0fa3?_0x54f92a[_0x3a0a('0xae')]:_0x54f92a['Interval']['Intervals'];logger[_0x3a0a('0xb9')](_0x3a0a('0xba'),_0x10b89a,_0x42afaf,_0x54f92a[_0x3a0a('0x41')],util[_0x3a0a('0x7a')]('Voice\x20Queue\x20%s\x20$s',_0x54f92a['name'],_0x54f92a['id']));var _0x46516b=null;return Interval[_0x3a0a('0xbb')](_0x10b89a,_0x42afaf)[_0x3a0a('0x9f')](function(_0x3cb287){if(_0x3cb287===!![]){return _0x3cb287;}else{_0x54f92a[_0x3a0a('0x68')]=_0x1b0fa3?utils['CAMPAIGN_STATUS'][_0x3a0a('0xa2')]:utils['CAMPAIGN_STATUS'][_0x3a0a('0xa3')];_0x46516b=msgResponse(_0x3a0a('0xa4'),'Failure',_0x3a0a('0xa5')+_0x1b0fa3+'\x20'+_0x54f92a['name']+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3a0a('0x40')](_0x10b89a,{'showHidden':![],'depth':null})+_0x3a0a('0xa7')+_0x42afaf);}if(_0x46516b!==null){logger['silly'](_0x3a0a('0xbc'),_0x46516b);_0x46516b[_0x3a0a('0xbd')]=_0x1b0fa3;throw _0x46516b;}})[_0x3a0a('0x9d')](function(_0x175d38){logger[_0x3a0a('0x62')](_0x3a0a('0xbe'),_0x175d38);throw msgResponse(_0x3a0a('0xbf'),'Error',util[_0x3a0a('0x40')](_0x175d38,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x3a0a('0x29')]=function(_0x1b48b8){if(this['voiceQueues'][_0x1b48b8[_0x3a0a('0xc0')]]){if(this[_0x3a0a('0x23')][_0x1b48b8[_0x3a0a('0xc1')]]&&this[_0x3a0a('0x23')][_0x1b48b8[_0x3a0a('0xc1')]][_0x3a0a('0x3c')]!=='ivr'){this['updateOriginated'](this['voiceQueues'][_0x1b48b8['queue']]);this[_0x3a0a('0x23')][_0x1b48b8['uniqueid']][_0x3a0a('0xc2')]=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3a0a('0x18')]['syncAgentComplete']=function(_0x12039e){var _0x1ade9d=this['uniqueId'][_0x12039e['uniqueid']];if(this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]]){if(_0x1ade9d&&_0x1ade9d[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')){delete this[_0x3a0a('0x23')][_0x12039e[_0x3a0a('0xc1')]];this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]]['outboundAnswerCallsDay']+=0x1;var _0x243786=new AgentComplete(_0x1ade9d,_0x12039e);if(_0x12039e[_0x3a0a('0xc4')]===_0x3a0a('0xc5')){_0x243786[_0x3a0a('0xc6')]=this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]]['dialQueueProject2']&&this[_0x3a0a('0x1d')][_0x12039e[_0x3a0a('0xc0')]][_0x3a0a('0xc7')]?moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8')):undefined;}hopperUtils[_0x3a0a('0xc9')](_0x243786)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xca')));hopperUtils['moveContactManagedDialer'](_0x243786)['catch'](loggerCatch(_0x3a0a('0xcb')));}}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x2c')]=function(_0x38e14c){var _0x995e71=this[_0x3a0a('0x23')][_0x38e14c[_0x3a0a('0xc1')]];var _0x3454ac=this;var _0x543227=![];var _0x211944;var _0x577c4c;if(this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]]){if(_0x995e71&&_0x995e71[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')){delete this[_0x3a0a('0x23')][_0x38e14c[_0x3a0a('0xc1')]];this['updateOriginated'](this[_0x3a0a('0x1d')][_0x38e14c['queue']]);_0x995e71[_0x3a0a('0xcc')]=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');var _0x503f95=new QueueCallerAbandon(_0x995e71,_0x38e14c);if(utils['getSeconds'](_0x995e71['droptime'],_0x995e71['responsetime'])>=_0x995e71[_0x3a0a('0xcd')]){this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0x4a')]+=0x1;this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xce')]+=0x1;this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xcf')]+=0x1;_0x503f95[_0x3a0a('0x6b')]=0xa;_0x503f95[_0x3a0a('0x6c')]=_0x3a0a('0xd0');_0x503f95[_0x3a0a('0xd1')]=_0x3a0a('0xd2');_0x503f95[_0x3a0a('0xc6')]=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd3')]?moment()['format'](_0x3a0a('0xc8')):undefined;_0x503f95[_0x3a0a('0xd4')]+=0x1;_0x503f95[_0x3a0a('0xd5')]+=0x1;_0x211944=this['voiceQueues'][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd6')];_0x577c4c=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xd8')](_0x503f95,_0x503f95[_0x3a0a('0x6b')],_0x995e71[_0x3a0a('0xd9')])[_0x3a0a('0x9f')](function(_0x4aeafd){_0x543227=_0x4aeafd[_0x3a0a('0xda')]==0x1;if(_0x503f95['countdropretry']>=_0x3454ac[_0x3a0a('0x1d')][_0x38e14c['queue']][_0x3a0a('0xdb')]){_0x3454ac[_0x3a0a('0xdc')](_0x503f95,_0x4aeafd['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x503f95[_0x3a0a('0xd4')],'scheduledat':moment()[_0x3a0a('0xdd')](_0x3454ac[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd6')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x995e71[_0x3a0a('0xdf')],'ListId':_0x995e71[_0x3a0a('0xe0')],'VoiceQueueId':_0x995e71['VoiceQueueId']||undefined,'CampaignId':_0x995e71['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xe1')));var _0x4fafc2=new History(_0x503f95);_0x4fafc2[_0x3a0a('0x6b')]=0xa;_0x4fafc2[_0x3a0a('0x6c')]=_0x3a0a('0xd0');_0x4fafc2[_0x3a0a('0xe2')]=moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8'));_0x4fafc2[_0x3a0a('0x6d')]=_0x4fafc2[_0x3a0a('0xe2')];_0x4fafc2['calleridname']=_0x503f95[_0x3a0a('0xe3')];_0x4fafc2[_0x3a0a('0xe4')]=_0x503f95['calleridnum'];hopperUtils['createHistory'](_0x4fafc2)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xe5')));}})[_0x3a0a('0x9f')](function(){if(_0x543227)hopperUtils[_0x3a0a('0xe6')](_0x503f95,_0x211944,_0x577c4c)[_0x3a0a('0x9f')](function(){return 0x1;});});}else{this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0x4b')]+=0x1;this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xe7')]+=0x1;_0x503f95[_0x3a0a('0x6b')]=0xb;_0x503f95[_0x3a0a('0x6c')]=_0x3a0a('0xe8');_0x503f95[_0x3a0a('0xd1')]='CALLEREXIT';_0x503f95[_0x3a0a('0xe9')]+=0x1;_0x503f95[_0x3a0a('0xd5')]+=0x1;_0x211944=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]]['dialAbandonedRetryFrequency'];_0x577c4c=this[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xd8')](_0x503f95,_0x503f95[_0x3a0a('0x6b')],_0x995e71[_0x3a0a('0xd9')])[_0x3a0a('0x9f')](function(_0x1c4d2a){if(_0x503f95[_0x3a0a('0xe9')]>=_0x3454ac[_0x3a0a('0x1d')][_0x38e14c[_0x3a0a('0xc0')]][_0x3a0a('0xea')]){_0x3454ac[_0x3a0a('0xdc')](_0x503f95,_0x1c4d2a[_0x3a0a('0xda')]);}else{hopperUtils[_0x3a0a('0xeb')]({'active':![],'countabandonedretry':_0x503f95[_0x3a0a('0xe9')],'scheduledat':moment()[_0x3a0a('0xdd')](_0x3454ac[_0x3a0a('0x1d')][_0x38e14c['queue']][_0x3a0a('0xec')],'minutes')[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x995e71[_0x3a0a('0xdf')],'ListId':_0x995e71['ListId'],'VoiceQueueId':_0x995e71[_0x3a0a('0xed')]||undefined,'CampaignId':_0x995e71[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xef')));var _0xbad4ad=new History(_0x503f95);_0xbad4ad[_0x3a0a('0x6b')]=0xb;_0xbad4ad[_0x3a0a('0x6c')]=_0x3a0a('0xe8');_0xbad4ad['starttime']=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');_0xbad4ad[_0x3a0a('0x6d')]=_0xbad4ad[_0x3a0a('0xe2')];_0xbad4ad['calleridname']=_0x503f95[_0x3a0a('0xe3')];_0xbad4ad[_0x3a0a('0xe4')]=_0x503f95[_0x3a0a('0xe4')];hopperUtils[_0x3a0a('0xc9')](_0xbad4ad)['catch'](loggerCatch(_0x3a0a('0xf0')));}})[_0x3a0a('0x9f')](function(){if(_0x543227)hopperUtils['swapAdditionalPhones'](_0x503f95,_0x211944,_0x577c4c)[_0x3a0a('0x9f')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x48e80b){if(this[_0x3a0a('0x21')][_0x48e80b['uniqueid']]){this[_0x3a0a('0x21')][_0x48e80b['uniqueid']][_0x3a0a('0xf1')]=_0x48e80b[_0x3a0a('0xf1')];}if(this[_0x3a0a('0x23')][_0x48e80b[_0x3a0a('0xc1')]]){this['uniqueId'][_0x48e80b['uniqueid']][_0x3a0a('0xf1')]=_0x48e80b[_0x3a0a('0xf1')];}};Dialer[_0x3a0a('0x18')][_0x3a0a('0xf2')]=function(_0x35ba1e){if(!this[_0x3a0a('0x21')][_0x35ba1e['actionid']]){return;}var _0x23e8ea=this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]['strategy']||'rrmemory';if(_0x23e8ea==='roundrobin'){if(this[_0x3a0a('0x21')][_0x35ba1e['actionid']]&&_[_0x3a0a('0xf4')](this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xf5')])&&_0x35ba1e[_0x3a0a('0x86')]==='1'&&_0x35ba1e[_0x3a0a('0xf6')]==='0'){if(this[_0x3a0a('0x1e')][_0x35ba1e[_0x3a0a('0xf7')]]){if(!this[_0x3a0a('0x1e')][_0x35ba1e['stateinterface']]['locked']){this[_0x3a0a('0x1e')][_0x35ba1e['stateinterface']][_0x3a0a('0xf5')]=!![];this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xf5')]=!![];this['actions'][_0x35ba1e[_0x3a0a('0xf3')]]['stateinterface']=_0x35ba1e[_0x3a0a('0xf7')];}}}}else if(_0x23e8ea===_0x3a0a('0xf8')){if(this['actions'][_0x35ba1e['actionid']]){if(this[_0x3a0a('0x1e')][_0x35ba1e[_0x3a0a('0xf7')]]){this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xf7')]=_0x35ba1e['stateinterface'];if(_['isNil'](this[_0x3a0a('0x25')][this['actions'][_0x35ba1e['actionid']][_0x3a0a('0xc0')]])){this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x35ba1e[_0x3a0a('0xf3')]]['queue']]=[];}this[_0x3a0a('0x25')][this['actions'][_0x35ba1e[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]['push'](_[_0x3a0a('0x5b')](_[_0x3a0a('0x71')](this[_0x3a0a('0x21')][_0x35ba1e['actionid']],[_0x3a0a('0xf9'),_0x3a0a('0xf7')]),{'status':_0x35ba1e[_0x3a0a('0x86')],'paused':_0x35ba1e[_0x3a0a('0xf6')]}));}}}};Dialer['prototype'][_0x3a0a('0xfa')]=function(_0x5a18f1){if(!this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]){return;}var _0x1f9d1e=this;var _0x245d6a=this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]];var _0x1ec865=_0x245d6a[_0x3a0a('0xfb')]||_0x3a0a('0xf8');if(_0x1ec865===_0x3a0a('0xfc')){if(this['actions'][_0x5a18f1['actionid']]&&this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xf7')]){this[_0x3a0a('0x1c')][_0x3a0a('0xfd')](this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]['idHopper'],this['actions'][_0x5a18f1['actionid']][_0x3a0a('0xf7')])[_0x3a0a('0x9d')](function(_0x1a849e){logger[_0x3a0a('0x62')](_0x3a0a('0xfe'),util[_0x3a0a('0x40')](_0x1a849e,{'showHidden':![],'depth':null}));})[_0x3a0a('0x1a')](function(){_0x1f9d1e['updateOriginated'](_0x1f9d1e['voiceQueues'][_0x1f9d1e['actions'][_0x5a18f1[_0x3a0a('0xf3')]]['queue']]);_0x1f9d1e[_0x3a0a('0x1e')][_0x1f9d1e['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xf7')]]['locked']=![];delete _0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1['actionid']];unlockQueueStatus(_0x245d6a);});}else{this[_0x3a0a('0xff')](this['voiceQueues'][this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xdf')],'ListId':this[_0x3a0a('0x21')][_0x5a18f1['actionid']]['ListId'],'VoiceQueueId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xed')]||undefined,'CampaignId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x100')));delete this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]];unlockQueueStatus(_0x245d6a);}}else if(_0x1ec865===_0x3a0a('0xf8')){var _0x2d67fb;if(this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]&&!_[_0x3a0a('0x43')](this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]])){if(this['queueBookedRR'][_0x1f9d1e['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]){this[_0x3a0a('0x26')][_0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]=this[_0x3a0a('0x26')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]?this[_0x3a0a('0x26')][this[_0x3a0a('0x21')][_0x5a18f1['actionid']]['queue']]:this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]['queue']]?this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]['_rr']||0x0:0x0;}this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]][_0x3a0a('0x101')]=this[_0x3a0a('0x26')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]];for(var _0x4c95a1=0x0;_0x4c95a1<this[_0x3a0a('0x25')][this['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]][_0x3a0a('0x96')];_0x4c95a1+=0x1){_0x2d67fb=rr(this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]);this[_0x3a0a('0x26')][_0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]['queue']]=this[_0x3a0a('0x25')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]][_0x3a0a('0x101')];if(_0x2d67fb['status']==='1'&&_0x2d67fb[_0x3a0a('0xf6')]==='0'){break;}}if(!_[_0x3a0a('0xf4')](_0x2d67fb)){this[_0x3a0a('0x1e')][_0x2d67fb['stateinterface']]['unlockRR']=_['isUndefined'](this[_0x3a0a('0x1e')][_0x2d67fb[_0x3a0a('0xf7')]]['unlockRR'])?!![]:this[_0x3a0a('0x1e')][_0x2d67fb[_0x3a0a('0xf7')]][_0x3a0a('0x102')];}loggerBooked['info'](_0x3a0a('0x103'),_0x5a18f1[_0x3a0a('0xf3')],'Agent:\x20',JSON[_0x3a0a('0x70')](_[_0x3a0a('0x71')](this[_0x3a0a('0x1e')][_0x2d67fb[_0x3a0a('0xf7')]],[_0x3a0a('0x41'),_0x3a0a('0x102')])),_0x3a0a('0x104'),JSON[_0x3a0a('0x70')](_0x2d67fb[_0x3a0a('0xf9')]));if(!_[_0x3a0a('0xf4')](_0x2d67fb)&&_0x2d67fb['status']==='1'&&_0x2d67fb[_0x3a0a('0xf6')]==='0'&&this[_0x3a0a('0x1e')][_0x2d67fb[_0x3a0a('0xf7')]]['unlockRR']){this[_0x3a0a('0x1e')][_0x2d67fb[_0x3a0a('0xf7')]][_0x3a0a('0x102')]=![];this[_0x3a0a('0x25')][_0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]=[];this[_0x3a0a('0x1c')][_0x3a0a('0xfd')](_0x2d67fb[_0x3a0a('0xf9')],_0x2d67fb['stateinterface'])[_0x3a0a('0x9d')](function(_0x20cb12){logger[_0x3a0a('0x62')](_0x3a0a('0xfe'),util[_0x3a0a('0x40')](_0x20cb12,{'showHidden':![],'depth':null}));})[_0x3a0a('0x1a')](function(){_0x1f9d1e['updateOriginated'](_0x1f9d1e['voiceQueues'][_0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]);setTimeout(function(){_0x1f9d1e['agents'][_0x2d67fb[_0x3a0a('0xf7')]][_0x3a0a('0x102')]=!![];loggerBooked['info'](_0x3a0a('0x105'),_0x5a18f1[_0x3a0a('0xf3')],_0x3a0a('0x106'),JSON['stringify'](_[_0x3a0a('0x71')](_0x1f9d1e['agents'][_0x2d67fb[_0x3a0a('0xf7')]],[_0x3a0a('0x41'),_0x3a0a('0x102')])),_0x3a0a('0x104'),JSON[_0x3a0a('0x70')](_0x2d67fb[_0x3a0a('0xf9')]));},0xc7);delete _0x1f9d1e[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]];unlockQueueStatus(_0x245d6a,_0x5a18f1['actionid']);});}else{loggerBooked[_0x3a0a('0x44')]('[booked][unlock]');this['updateOriginated'](this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]);hopperUtils[_0x3a0a('0xeb')]({'active':![],'ContactId':this['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xdf')],'ListId':this['actions'][_0x5a18f1['actionid']][_0x3a0a('0xe0')],'VoiceQueueId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xed')]||undefined,'CampaignId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x3a0a('0x21')][_0x5a18f1['actionid']];unlockQueueStatus(_0x245d6a);}}else{loggerBooked[_0x3a0a('0x44')]('[booked][unlock2]');this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xc0')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xdf')],'ListId':this['actions'][_0x5a18f1[_0x3a0a('0xf3')]]['ListId'],'VoiceQueueId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3a0a('0x21')][_0x5a18f1['actionid']]['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x107')));delete this[_0x3a0a('0x21')][_0x5a18f1['actionid']];unlockQueueStatus(_0x245d6a);}}else{loggerBooked[_0x3a0a('0x44')]('[booked][unlock3]');this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xc0')]]);hopperUtils[_0x3a0a('0xeb')]({'active':![],'ContactId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xdf')],'ListId':this[_0x3a0a('0x21')][_0x5a18f1['actionid']][_0x3a0a('0xe0')],'VoiceQueueId':this['actions'][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xed')]||undefined,'CampaignId':this[_0x3a0a('0x21')][_0x5a18f1[_0x3a0a('0xf3')]][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x108')));delete this['actions'][_0x5a18f1[_0x3a0a('0xf3')]];unlockQueueStatus(_0x245d6a);}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x2e')]=function(_0x1325c2){var _0xac6636=this['actions'][_0x1325c2[_0x3a0a('0xf3')]];if(_0xac6636){delete this[_0x3a0a('0x21')][_0x1325c2[_0x3a0a('0xf3')]];_0xac6636[_0x3a0a('0x109')]=moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8'));var _0x307aaa=_0xac6636[_0x3a0a('0x3c')]===_0x3a0a('0xc3')?this[_0x3a0a('0xab')][_0xac6636[_0x3a0a('0xc0')]]:this[_0x3a0a('0x1d')][_0xac6636[_0x3a0a('0x10a')]()];if(_0x1325c2[_0x3a0a('0x10b')]!==_0x3a0a('0x10c')){this['updateOriginated'](_0x307aaa);return this[_0x3a0a('0x10d')](_0xac6636,_0x307aaa,_0x1325c2)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x10e')));}this[_0x3a0a('0x23')][_0x1325c2[_0x3a0a('0xc1')]]=_0xac6636;}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x10f')]=function(_0x2f157b){var _0x46be5d=this;var _0x39568a=this[_0x3a0a('0x23')][_0x2f157b[_0x3a0a('0xc1')]];var _0x4339be;if(!_[_0x3a0a('0xf4')](_0x2f157b)&&!_[_0x3a0a('0xf4')](_0x2f157b[_0x3a0a('0x110')])&&!_[_0x3a0a('0xf4')](_0x2f157b['variable'][_0x3a0a('0x111')])&&_0x2f157b[_0x3a0a('0x112')]===_0x3a0a('0x113')&&_0x39568a){if(_0x39568a[_0x3a0a('0x3c')]!=='ivr'&&this[_0x3a0a('0x1d')][_0x39568a['queue']][_0x3a0a('0x114')]&&_0x2f157b[_0x3a0a('0x115')]===_0x3a0a('0x116')){delete this[_0x3a0a('0x23')][_0x2f157b[_0x3a0a('0xc1')]];this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][_0x39568a['queue']]);this[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]][_0x3a0a('0x117')]+=0x1;this[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]]['outboundAnswerAgiCallsDay']+=0x1;_0x4339be=new Hangup(_0x39568a,_0x2f157b);_0x4339be[_0x3a0a('0x6b')]=0x12;_0x4339be[_0x3a0a('0x6c')]=_0x3a0a('0x118');_0x4339be['membername']='AMD';ami['emit'](_0x3a0a('0x119'),ut[_0x3a0a('0x11a')](_0x4339be,'amd'));this[_0x3a0a('0x11b')](_0x4339be,_0x3a0a('0x11c'),_0x3a0a('0x11d'));}if(_0x39568a[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')&&this[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]]['dialAMDActive']&&_0x2f157b['value']===_0x3a0a('0x11e')){return new Promise(function(_0x262836,_0x28f485){delete _0x46be5d[_0x3a0a('0x23')][_0x2f157b[_0x3a0a('0xc1')]];_0x46be5d[_0x3a0a('0xff')](_0x46be5d[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]]);_0x46be5d[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]]['outboundAnswerCallsDay']+=0x1;_0x46be5d[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]][_0x3a0a('0x11f')]+=0x1;var _0x507882=_0x46be5d[_0x3a0a('0x1d')][_0x39568a[_0x3a0a('0xc0')]];var _0x1011b8=new Hangup(_0x39568a,_0x2f157b);_0x1011b8['state']=0x13;_0x1011b8[_0x3a0a('0x6c')]='Machine';_0x1011b8[_0x3a0a('0x120')]=_0x3a0a('0x121');_0x1011b8['countmachineretry']+=0x1;_0x1011b8[_0x3a0a('0xd5')]+=0x1;_0x1011b8[_0x3a0a('0x122')]=!![];ami[_0x3a0a('0x3b')](_0x3a0a('0x119'),ut['buildObj'](_0x1011b8,_0x3a0a('0x122')));hopperUtils[_0x3a0a('0xc9')](_0x1011b8)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x123')));if(_0x1011b8[_0x3a0a('0x124')]+_0x1011b8[_0x3a0a('0x125')]+_0x1011b8[_0x3a0a('0x126')]+_0x1011b8[_0x3a0a('0x127')]+_0x1011b8['countdropretry']+_0x1011b8[_0x3a0a('0xe9')]+_0x1011b8[_0x3a0a('0x128')]+_0x1011b8[_0x3a0a('0x129')]>=_0x507882[_0x3a0a('0x12a')]){_0x46be5d['stateGlobal'](_0x1011b8,_0x262836,_0x28f485,_0x3a0a('0x12b'));}else{if(_0x1011b8['countmachineretry']>=_0x507882[_0x3a0a('0x12c')]){_0x46be5d[_0x3a0a('0x12d')](_0x1011b8,_0x262836,_0x28f485,_0x3a0a('0x12e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x1011b8['countmachineretry'],'scheduledat':moment()['add'](_0x507882[_0x3a0a('0x12f')],_0x3a0a('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1011b8[_0x3a0a('0xdf')],'ListId':_0x1011b8[_0x3a0a('0xe0')],'VoiceQueueId':_0x1011b8['VoiceQueueId']||undefined,'CampaignId':_0x1011b8['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x130')));_0x262836({'reschedule':0x1});}}});}if(_0x39568a[_0x3a0a('0x3c')]===_0x3a0a('0xc3')&&this[_0x3a0a('0xab')][_0x39568a['queue']][_0x3a0a('0x114')]&&_0x2f157b[_0x3a0a('0x115')]==='HANGUP'){delete this[_0x3a0a('0x23')][_0x2f157b[_0x3a0a('0xc1')]];this['updateOriginated'](this[_0x3a0a('0xab')][_0x39568a[_0x3a0a('0xc0')]]);_0x4339be=new Hangup(_0x39568a,_0x2f157b);_0x4339be[_0x3a0a('0x6b')]=0x12;_0x4339be['statedesc']=_0x3a0a('0x118');_0x4339be[_0x3a0a('0x120')]=_0x3a0a('0x121');ami[_0x3a0a('0x3b')]('custom:amd',ut[_0x3a0a('0x11a')](_0x4339be,_0x3a0a('0x122')));this['saveInDb'](_0x4339be,_0x3a0a('0x131'),'[syncHangupInAMDIvr]');}if(_0x39568a[_0x3a0a('0x3c')]==='ivr'&&this['campaigns'][_0x39568a['queue']][_0x3a0a('0x114')]&&_0x2f157b[_0x3a0a('0x115')]===_0x3a0a('0x11e')){return new Promise(function(_0x146e38,_0x4747c8){delete _0x46be5d['uniqueId'][_0x2f157b[_0x3a0a('0xc1')]];_0x46be5d[_0x3a0a('0xff')](_0x46be5d[_0x3a0a('0xab')][_0x39568a[_0x3a0a('0xc0')]]);_0x46be5d[_0x3a0a('0xab')][_0x39568a['queue']]['outboundAnswerCallsDay']+=0x1;_0x46be5d[_0x3a0a('0xab')][_0x39568a['queue']][_0x3a0a('0x11f')]+=0x1;var _0x3cf273=_0x46be5d['campaigns'][_0x39568a['queue']];var _0x40294c=new Hangup(_0x39568a,_0x2f157b);_0x40294c[_0x3a0a('0x6b')]=0x13;_0x40294c[_0x3a0a('0x6c')]='Machine';_0x40294c[_0x3a0a('0x120')]='AMD';_0x40294c[_0x3a0a('0x128')]+=0x1;_0x40294c[_0x3a0a('0xd5')]+=0x1;_0x40294c['amd']=!![];ami[_0x3a0a('0x3b')]('custom:amd',ut['buildObj'](_0x40294c,'amd'));hopperUtils['createHistory'](_0x40294c)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x123')));if(_0x40294c[_0x3a0a('0x124')]+_0x40294c['countcongestionretry']+_0x40294c[_0x3a0a('0x126')]+_0x40294c[_0x3a0a('0x127')]+_0x40294c[_0x3a0a('0xd4')]+_0x40294c[_0x3a0a('0xe9')]+_0x40294c[_0x3a0a('0x128')]+_0x40294c[_0x3a0a('0x129')]>=_0x3cf273[_0x3a0a('0x12a')]){_0x46be5d[_0x3a0a('0x132')](_0x40294c,_0x146e38,_0x4747c8,_0x3a0a('0x12b'));}else{if(_0x40294c[_0x3a0a('0x128')]>=_0x3cf273['dialMachineMaxRetry']){_0x46be5d[_0x3a0a('0x12d')](_0x40294c,_0x146e38,_0x4747c8,_0x3a0a('0x12e'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x40294c[_0x3a0a('0x128')],'scheduledat':moment()[_0x3a0a('0xdd')](_0x3cf273[_0x3a0a('0x12f')],_0x3a0a('0xde'))[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40294c[_0x3a0a('0xdf')],'ListId':_0x40294c[_0x3a0a('0xe0')],'VoiceQueueId':_0x40294c['VoiceQueueId']||undefined,'CampaignId':_0x40294c[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x130')));_0x146e38({'reschedule':0x1});}}});}}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x133')]=function(_0x36ccb0){var _0x3abe28=this[_0x3a0a('0x23')][_0x36ccb0[_0x3a0a('0xc1')]];var _0x2c642e;if(_0x3abe28&&_0x3abe28[_0x3a0a('0x3c')]===_0x3a0a('0xc3')){delete this[_0x3a0a('0x23')][_0x36ccb0['uniqueid']];this['updateOriginated'](this[_0x3a0a('0xab')][_0x3abe28['queue']]);this[_0x3a0a('0xab')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x134')]+=0x1;_0x2c642e=new Hangup(_0x3abe28,_0x36ccb0);hopperUtils[_0x3a0a('0xc9')](_0x2c642e)['catch'](loggerCatch(_0x3a0a('0x135')));hopperUtils['moveContactManagedDialer'](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x136')));}if(_0x3abe28&&_0x3abe28[_0x3a0a('0x3c')]!==_0x3a0a('0xc3')&&isNotNull(this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x137')])){delete this['uniqueId'][_0x36ccb0['uniqueid']];this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][_0x3abe28['queue']]);this['voiceQueues'][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x117')]+=0x1;this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x11f')]+=0x1;_0x2c642e=new Hangup(_0x3abe28,_0x36ccb0);_0x2c642e['state']=0x10;_0x2c642e[_0x3a0a('0x6c')]=_0x3a0a('0x138');_0x2c642e[_0x3a0a('0x120')]=_0x3a0a('0x139');hopperUtils['createHistory'](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x135')));hopperUtils[_0x3a0a('0x13a')](_0x2c642e)['catch'](loggerCatch(_0x3a0a('0x136')));}if(_0x3abe28&&_0x3abe28[_0x3a0a('0x3c')]!=='ivr'&&!isNotNull(this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]][_0x3a0a('0x137')])){delete this[_0x3a0a('0x23')][_0x36ccb0[_0x3a0a('0xc1')]];this[_0x3a0a('0xff')](this[_0x3a0a('0x1d')][_0x3abe28['queue']]);this[_0x3a0a('0x1d')][_0x3abe28[_0x3a0a('0xc0')]]['outboundUnknownCallsDay']+=0x1;_0x2c642e=new Hangup(_0x3abe28,_0x36ccb0);_0x2c642e[_0x3a0a('0x6b')]=0xc;_0x2c642e[_0x3a0a('0x6c')]=_0x36ccb0[_0x3a0a('0x13b')];_0x2c642e[_0x3a0a('0x120')]=_0x3a0a('0x13c');hopperUtils[_0x3a0a('0xc9')](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x3a0a('0x13a')](_0x2c642e)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x136')));}};Dialer['prototype'][_0x3a0a('0x9')]=function(_0x407003){var _0x4b1d3c=this;if(!_0x4b1d3c[_0x3a0a('0x27')][_0x407003[_0x3a0a('0x41')]]){_0x4b1d3c['queuesSummary'][_0x407003[_0x3a0a('0x41')]]={'running':![]};}else if(_0x4b1d3c[_0x3a0a('0x27')][_0x407003[_0x3a0a('0x41')]][_0x3a0a('0x13d')]===!![]){return;}else if(_0x4b1d3c[_0x3a0a('0x27')][_0x407003[_0x3a0a('0x41')]][_0x3a0a('0x13d')]===![]){_0x4b1d3c[_0x3a0a('0x27')][_0x407003['name']]['running']=!![];}var _0x1c2a73=_0x4b1d3c[_0x3a0a('0x1d')][_0x407003[_0x3a0a('0x41')]];var _0x270fd6=_0x1c2a73[_0x3a0a('0x68')]!==utils['CAMPAIGN_STATUS'][_0x3a0a('0x77')];var _0x277061=utils[_0x3a0a('0x13e')](_0x1c2a73);_0x1c2a73[_0x3a0a('0x13f')]=utils[_0x3a0a('0x140')](_0x1c2a73,_0x4b1d3c[_0x3a0a('0x1f')]);Promise[_0x3a0a('0xad')]()[_0x3a0a('0x9f')](function(){if(_0x1c2a73[_0x3a0a('0x13f')]===utils[_0x3a0a('0x69')][_0x3a0a('0x77')]){if(_0x270fd6){clearPredictiveAttributes(_0x1c2a73);_0x407003[_0x3a0a('0x5e')]=undefined;_0x407003[_0x3a0a('0x5c')]=undefined;}if(_0x1c2a73['statusMessage']===utils[_0x3a0a('0x69')][_0x3a0a('0x77')]){_0x407003[_0x3a0a('0x141')]=0x0;_0x407003[_0x3a0a('0xf6')]=0x0;_0x407003[_0x3a0a('0x142')]=0x0;_0x407003[_0x3a0a('0x143')]=0x0;_0x407003[_0x3a0a('0x144')]=0x0;}}else if(_0x1c2a73[_0x3a0a('0x13f')]===utils['CAMPAIGN_STATUS'][_0x3a0a('0x145')]&&!_0x277061){return _0x4b1d3c[_0x3a0a('0x8f')](_0x1c2a73,!![])['then'](function(){return _0x4b1d3c['ifTime'](_0x1c2a73,![]);})[_0x3a0a('0x9f')](function(){return _0x4b1d3c['checkDialMethod'](_0x1c2a73);})[_0x3a0a('0x9d')](function(_0x3e494a){loggerSyncQueueSummary[_0x3a0a('0x3e')](_0x3a0a('0x146'),util[_0x3a0a('0x40')](_0x3e494a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x1c2a73);});}else{clearPredictiveAttributes(_0x1c2a73);}})[_0x3a0a('0x9f')](function(){var _0x34c88b=_0x407003[_0x3a0a('0x147')](_0x1c2a73);if(_0x34c88b||_0x1c2a73[_0x3a0a('0x148')]){_0x1c2a73[_0x3a0a('0x148')]=![];_0x407003[_0x3a0a('0x149')](_0x1c2a73);Object[_0x3a0a('0x14a')](_0x1c2a73,_0x407003);emitOutboundVoiceQueueSummary(_0x407003);}_0x4b1d3c[_0x3a0a('0x27')][_0x1c2a73[_0x3a0a('0x41')]][_0x3a0a('0x13d')]=![];})[_0x3a0a('0x9d')](function(_0xc91641){logger[_0x3a0a('0x62')](_0x3a0a('0x146'),util[_0x3a0a('0x40')](_0xc91641,{'showHidden':![],'depth':null}));_0x4b1d3c[_0x3a0a('0x27')][_0x1c2a73[_0x3a0a('0x41')]][_0x3a0a('0x13d')]=![];});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x33')]=_[_0x3a0a('0x14b')](function(){var _0x2ca91e=_['filter'](this[_0x3a0a('0x1d')],function(_0xf7b557){return _0xf7b557[_0x3a0a('0x14c')];});var _0x552460=_['filter'](this[_0x3a0a('0x1e')],function(_0x5f35cc){return _0x5f35cc[_0x3a0a('0x14d')]&&_0x5f35cc[_0x3a0a('0x86')]===_0x3a0a('0x87');});if(_0x2ca91e[_0x3a0a('0x96')]>0x0&&_0x552460['length']>0x0){return Promise[_0x3a0a('0xad')]()['then'](cmHopper['handlePreviewRecallNotifications'](_[_0x3a0a('0x14e')](_0x2ca91e,'id'),previewRecallmeReminderInterval,_['map'](_0x552460,'id')))[_0x3a0a('0x9f')](function(_0x526b11){for(var _0x100b81=0x0;_0x100b81<_0x526b11['length'];_0x100b81++){var _0x434992=_0x526b11[_0x100b81][_0x3a0a('0x14f')][_0x3a0a('0x41')];if(_0x434992)io['to'](util[_0x3a0a('0x7a')](_0x3a0a('0x150'),_0x434992))[_0x3a0a('0x3b')](_0x3a0a('0x151'),{'hopper':_0x526b11[_0x100b81]});}})['catch'](function(_0xaba4d0){logger[_0x3a0a('0x62')](_0x3a0a('0x152'),_0xaba4d0);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3a0a('0x18')][_0x3a0a('0x153')]=function(){var _0x117113=this;setInterval(function(){_0x117113['clearZombieChannels'](_0x117113[_0x3a0a('0x23')],_0x3a0a('0x154'));_0x117113[_0x3a0a('0x155')](_0x117113['actions'],_0x3a0a('0x156'));},0x32c8);};Dialer[_0x3a0a('0x18')][_0x3a0a('0x155')]=function(_0x5a56da,_0x204af5){var _0x2638fd=this;for(var _0x58c877 in _0x5a56da){if(typeof _0x5a56da[_0x58c877]!==_0x3a0a('0xac')){this[_0x3a0a('0x1b')][_0x3a0a('0x157')](function(){if(!_[_0x3a0a('0xf4')](_0x5a56da[_0x58c877])){return ami[_0x3a0a('0x9e')]({'action':_0x3a0a('0x86'),'channel':_0x5a56da[_0x58c877][_0x3a0a('0xf1')]})[_0x3a0a('0x9d')](function(_0x41914b){if(_0x41914b[_0x3a0a('0x68')]===_0x3a0a('0x158')){setTimeout(function(){if(_0x5a56da[_0x58c877]&&_0x5a56da[_0x58c877]['type']!==_0x3a0a('0xc3')){_0x2638fd['updateOriginated'](_0x2638fd[_0x3a0a('0x1d')][_0x5a56da[_0x58c877][_0x3a0a('0xc0')]]);logger[_0x3a0a('0x62')](_0x3a0a('0x159'),_0x204af5,_0x58c877,_0x5a56da[_0x58c877][_0x3a0a('0xc0')]);delete _0x5a56da[_0x58c877];}if(_0x5a56da[_0x58c877]&&_0x5a56da[_0x58c877][_0x3a0a('0x3c')]===_0x3a0a('0xc3')){_0x2638fd['updateOriginated'](_0x2638fd[_0x3a0a('0xab')][_0x5a56da[_0x58c877][_0x3a0a('0xc0')]]);logger['error'](_0x3a0a('0x15a'),_0x204af5,_0x58c877,_0x5a56da[_0x58c877][_0x3a0a('0xc0')]);delete _0x5a56da[_0x58c877];}},0x2328);}});}});}}};Dialer['prototype'][_0x3a0a('0x15b')]=function(_0xfbc377){return Promise['resolve']()['then'](voiceQueueRt[_0x3a0a('0x15b')](_0xfbc377))[_0x3a0a('0x9d')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x55ac75){if(!_[_0x3a0a('0x50')](_0x55ac75)&&_0x55ac75!==null){if(typeof _0x55ac75['originated']!=='undefined'){if(_0x55ac75[_0x3a0a('0x7e')]>0x0){_0x55ac75[_0x3a0a('0x7e')]-=0x1;}else{logger[_0x3a0a('0x62')](_0x3a0a('0x15c'));}}}else{logger['error'](_0x3a0a('0x15d'));}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x15e')]=function(_0x4041c0,_0x47ebca){var _0x117110=this;return function(_0x58932b){_0x117110[_0x3a0a('0xff')](_0x47ebca);logger[_0x3a0a('0x62')](_0x4041c0,util[_0x3a0a('0x40')](_0x58932b,{'showHidden':![],'depth':null}));};};Dialer[_0x3a0a('0x18')]['emptyContact']=function(_0x7a96df,_0x3b888e,_0x2e8b9c){var _0x3594a0={'state':0x19,'statedesc':'notFound'};this[_0x3a0a('0xff')](_0x3b888e);this['saveInDb'](_[_0x3a0a('0x5b')](_0x3594a0,_['pick'](_0x2e8b9c,[_0x3a0a('0xdf'),_0x3a0a('0xe0'),'UserId',_0x3a0a('0xed'),_0x3a0a('0xee')])),_0x3a0a('0x15f'),'[emptyContact]');logger['error'](_0x7a96df);};Dialer[_0x3a0a('0x18')][_0x3a0a('0x11b')]=function(_0x2141b4,_0x32c4f7,_0x12c078){hopperUtils['createHistory'](_0x2141b4)['catch'](loggerCatch(_0x32c4f7));hopperUtils[_0x3a0a('0x13a')](_0x2141b4)[_0x3a0a('0x9d')](loggerCatch(_0x12c078));};Dialer[_0x3a0a('0x18')][_0x3a0a('0xdc')]=function(_0x242a36,_0x2e766f){hopperUtils[_0x3a0a('0xc9')](_0x242a36)['catch'](loggerCatch(_0x3a0a('0xca')));if(_0x2e766f==0x0){hopperUtils[_0x3a0a('0x13a')](_0x242a36)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x160')));}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x152')]=function(_0x19f671){return Promise[_0x3a0a('0xad')]()[_0x3a0a('0x9f')](cmHopper[_0x3a0a('0x161')](_0x19f671['id'],previewRecallmeReminderInterval))[_0x3a0a('0x9f')](function(_0x119760){for(var _0x3e7304=0x0;_0x3e7304<_0x119760['length'];_0x3e7304++){var _0x572ef8=_0x119760[_0x3e7304][_0x3a0a('0x14f')][_0x3a0a('0x41')];if(_0x572ef8)io['to'](util[_0x3a0a('0x7a')](_0x3a0a('0x150'),_0x572ef8))['emit'](_0x3a0a('0x151'),{'hopper':_0x119760[_0x3e7304]});}})[_0x3a0a('0x9d')](function(){});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x162')]=function(_0x5a7e4b){var _0x430f6b=this;return function(){_0x430f6b[_0x3a0a('0x163')](_0x5a7e4b);};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x164')]=function(_0x258178,_0x597547){var _0x797f94=this;var _0x4d2015=uuid['v4']();this['actions'][_0x4d2015]=new Action(_0x258178,_0x597547,_0x4d2015);return new Promise(function(_0xac5d11,_0x208dbe){if(_[_0x3a0a('0x50')](_0x258178)&&typeof _0x258178!==_0x3a0a('0x165')){return _0x208dbe(msgResponse(_0x3a0a('0x166'),_0x3a0a('0x90'),'voiceQueue\x20is\x20undefine'));}if(_[_0x3a0a('0x50')](_0x597547['phone'])||_0x597547[_0x3a0a('0x167')]===null){return _0x208dbe(msgResponse(_0x3a0a('0x166'),_0x3a0a('0x90'),'contact\x20is\x20undefine'));}var _0x96099c={'XMD-CALLERID':_0x797f94[_0x3a0a('0x21')][_0x4d2015][_0x3a0a('0x168')](),'XMD-AGI':_0x258178[_0x3a0a('0x137')]?util[_0x3a0a('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x258178['dialQueueProject']):_0x3a0a('0x169'),'XMD-AGIAFTER':_0x258178[_0x3a0a('0xd3')]?util['format'](_0x3a0a('0x16a'),ipAgi,_0x258178['dialQueueProject2']):_0x3a0a('0x169'),'XMD-QUEUE':utils['isOutboundQueue'](_0x258178)?util[_0x3a0a('0x7a')](_0x3a0a('0x16b'),_0x258178[_0x3a0a('0x41')],_0x258178[_0x3a0a('0x16c')]||'',_0x258178['dialAgiAfterHangupAgent']?'c':'',_0x258178[_0x3a0a('0xcd')]||0x3):_0x3a0a('0x169'),'XMD-CONTACTID':_0x597547[_0x3a0a('0xdf')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x797f94['actions'][_0x4d2015][_0x3a0a('0x168')](),'XMD-AMD':_0x258178['dialAMDActive']?_0x3a0a('0x145'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x258178[_0x3a0a('0x114')]){_0x96099c['XMD-AMDINITIALSILENCE']=_0x258178[_0x3a0a('0x16d')]||0x9c4;_0x96099c[_0x3a0a('0x16e')]=_0x258178[_0x3a0a('0x16f')]||0x5dc;_0x96099c[_0x3a0a('0x170')]=_0x258178['dialAMDAfterGreetingSilence']||0x320;_0x96099c[_0x3a0a('0x171')]=_0x258178[_0x3a0a('0x172')]||0x1388;_0x96099c[_0x3a0a('0x173')]=_0x258178[_0x3a0a('0x174')]||0x64;_0x96099c[_0x3a0a('0x175')]=_0x258178[_0x3a0a('0x176')]||0x32;_0x96099c[_0x3a0a('0x177')]=_0x258178[_0x3a0a('0x178')]||0x3;_0x96099c['XMD-AMDSILENCETHRESHOLD']=_0x258178[_0x3a0a('0x179')]||0x100;_0x96099c[_0x3a0a('0x17a')]=_0x258178[_0x3a0a('0x17b')]||0x1388;}if(utils['isOutboundQueue'](_0x258178)){_0x96099c[_0x3a0a('0x17c')]=_0x597547[_0x3a0a('0xed')];}else{_0x96099c['XMD-CAMPAIGNID']=_0x597547[_0x3a0a('0xee')];}for(var _0x53bc5d in _0x597547[_0x3a0a('0x17d')]){if(typeof _0x597547['Contact'][_0x53bc5d]!=='undefined'){if(isNotNull(_0x597547[_0x3a0a('0x17d')][_0x53bc5d])&&_0x53bc5d!=='id'&&_0x53bc5d!=='tags'&&_0x53bc5d!=='createdAt'&&_0x53bc5d!==_0x3a0a('0x17e')){_0x96099c[util[_0x3a0a('0x7a')](_0x3a0a('0x17f'),_0x3a0a('0x180'),_['toUpper'](_0x53bc5d))]=_0x597547[_0x3a0a('0x17d')][_0x53bc5d];}}}var _0x10692c=_0x797f94[_0x3a0a('0x83')](_0x258178[_0x3a0a('0x89')])?utils[_0x3a0a('0x181')](_0x258178[_0x3a0a('0x89')][_0x3a0a('0x182')],_0x258178[_0x3a0a('0x183')],_0x258178[_0x3a0a('0x184')]>0x0?utils[_0x3a0a('0x185')](_0x258178['dialOriginateCallerIdNumber'],_0x258178[_0x3a0a('0x184')]):_0x258178['dialOriginateCallerIdNumber']):utils[_0x3a0a('0x181')](_[_0x3a0a('0xf4')](_0x258178[_0x3a0a('0x8a')])?_0x258178[_0x3a0a('0x89')][_0x3a0a('0x182')]:_0x258178[_0x3a0a('0x8a')][_0x3a0a('0x182')],_0x258178['dialOriginateCallerIdName'],_0x258178[_0x3a0a('0x184')]>0x0?utils[_0x3a0a('0x185')](_0x258178[_0x3a0a('0x186')],_0x258178[_0x3a0a('0x184')]):_0x258178[_0x3a0a('0x186')]);if(_0x10692c){_0x96099c[_0x3a0a('0x187')]=_0x797f94[_0x3a0a('0x21')][_0x4d2015]['originatecalleridname']=utils[_0x3a0a('0x188')](_0x10692c);_0x96099c[_0x3a0a('0x189')]=_0x597547['phone'];}_0x258178['variables']=_0x96099c;return ami[_0x3a0a('0x9e')]({'actionid':_0x4d2015,'action':_0x3a0a('0x166'),'channel':_0x797f94[_0x3a0a('0x83')](_0x258178[_0x3a0a('0x89')])?util[_0x3a0a('0x7a')]('SIP/%s/%s%s',_0x258178[_0x3a0a('0x89')][_0x3a0a('0x41')],isNotNull(_0x258178['dialPrefix'])?_0x258178['dialPrefix']['trim']()||'':'',_0x258178[_0x3a0a('0x18a')]>0x0?_0x597547['phone'][_0x3a0a('0x18b')](_0x258178[_0x3a0a('0x18a')]):_0x597547[_0x3a0a('0x167')]):util['format'](_0x3a0a('0x18c'),_['isNil'](_0x258178[_0x3a0a('0x8a')])?_0x258178[_0x3a0a('0x89')][_0x3a0a('0x41')]:_0x258178[_0x3a0a('0x8a')]['name'],isNotNull(_0x258178[_0x3a0a('0x18d')])?_0x258178[_0x3a0a('0x18d')][_0x3a0a('0x18e')]()||'':'',_0x258178[_0x3a0a('0x18a')]>0x0?_0x597547[_0x3a0a('0x167')][_0x3a0a('0x18b')](_0x258178[_0x3a0a('0x18a')]):_0x597547['phone']),'callerid':_0x10692c,'Exten':_0x3a0a('0x113'),'Context':'from-sip','Priority':'1','variable':_0x96099c,'timeout':(_0x258178[_0x3a0a('0x18f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4d2015})[_0x3a0a('0x9f')](function(_0x3337ad){return _0xac5d11(_0x3337ad);})[_0x3a0a('0x9d')](function(_0x25481e){_0x258178[_0x3a0a('0x190')]+=0x1;var _0xe89b72=new History(_0x797f94[_0x3a0a('0x21')][_0x4d2015]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0x3a0a('0x70')](_0x25481e)));_0xe89b72[_0x3a0a('0x6b')]=0xe;_0xe89b72[_0x3a0a('0x6c')]=_0x3a0a('0x191');_0xe89b72['starttime']=moment()['format'](_0x3a0a('0xc8'));_0xe89b72[_0x3a0a('0x6d')]=_0xe89b72['starttime'];hopperUtils[_0x3a0a('0xc9')](_0xe89b72)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x192')));_0x797f94['moveContactManagedDialer'](_0xe89b72)[_0x3a0a('0x9d')](loggerCatch('[originate][error]'))[_0x3a0a('0x1a')](function(){delete _0x797f94[_0x3a0a('0x21')][_0x4d2015];return _0x208dbe(msgResponse('originate',_0x3a0a('0x193'),_0x3a0a('0x194')));});});});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x195')]=function(_0x55c29a,_0x33de3d,_0x291119){var _0x51ba9b=new History(_0x33de3d);if(_0x51ba9b[_0x3a0a('0x124')]+_0x51ba9b['countcongestionretry']+_0x51ba9b[_0x3a0a('0x126')]+_0x51ba9b['countnosuchnumberretry']+_0x51ba9b[_0x3a0a('0xd4')]+_0x51ba9b['countabandonedretry']+_0x51ba9b[_0x3a0a('0x128')]+_0x51ba9b[_0x3a0a('0x129')]>=_0x291119['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x55c29a){case 0x3:if(_0x51ba9b['countnoanswerretry']>=_0x291119[_0x3a0a('0x196')]-0x1){return!![];}hopperUtils[_0x3a0a('0xeb')]({'active':![],'countnoanswerretry':_0x51ba9b[_0x3a0a('0x126')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119['dialNoAnswerRetryFrequency'],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b['VoiceQueueId']||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x197')));break;case 0x5:if(_0x51ba9b[_0x3a0a('0x124')]>=_0x291119[_0x3a0a('0x198')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x51ba9b[_0x3a0a('0x124')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x199')],'minutes')[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x19a')));break;case 0x8:if(_0x51ba9b[_0x3a0a('0x125')]>=_0x291119[_0x3a0a('0x19b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x51ba9b[_0x3a0a('0x125')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x19c')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x19d')));break;case 0x0:if(_0x51ba9b[_0x3a0a('0x127')]>=_0x291119[_0x3a0a('0x19e')]-0x1){return!![];}else{hopperUtils[_0x3a0a('0xeb')]({'active':![],'countnosuchnumberretry':_0x51ba9b[_0x3a0a('0x127')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x19f')],_0x3a0a('0xde'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1a0')));}break;case 0xa:if(_0x51ba9b[_0x3a0a('0xd4')]>=_0x291119['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0x3a0a('0xeb')]({'active':![],'countdropretry':_0x51ba9b['countdropretry']+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0xd6')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b['VoiceQueueId']||undefined,'CampaignId':_0x51ba9b['CampaignId']||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xe1')));break;case 0xb:if(_0x51ba9b[_0x3a0a('0xe9')]>=_0x291119[_0x3a0a('0xea')]-0x1){return!![];}hopperUtils[_0x3a0a('0xeb')]({'active':![],'countabandonedretry':_0x51ba9b[_0x3a0a('0xe9')]+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119['dialAbandonedRetryFrequency'],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xef')));break;case 0x13:if(_0x51ba9b['countmachineretry']>=_0x291119[_0x3a0a('0x12c')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x51ba9b[_0x3a0a('0x128')]+=0x1,'scheduledat':moment()['add'](_0x291119[_0x3a0a('0x12f')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b['ContactId'],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b['VoiceQueueId']||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x51ba9b[_0x3a0a('0x129')]>=_0x291119[_0x3a0a('0x1a1')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x51ba9b['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3a0a('0xdd')](_0x291119[_0x3a0a('0x1a2')],_0x3a0a('0xde'))[_0x3a0a('0x7a')](_0x3a0a('0xc8')),'ContactId':_0x51ba9b[_0x3a0a('0xdf')],'ListId':_0x51ba9b[_0x3a0a('0xe0')],'VoiceQueueId':_0x51ba9b[_0x3a0a('0xed')]||undefined,'CampaignId':_0x51ba9b[_0x3a0a('0xee')]||undefined})['catch'](loggerCatch(_0x3a0a('0x1a3')));break;default:return!![];}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x10d')]=function(_0x2eb920,_0x4fe05d,_0x548864){var _0x2d18ac=this;var _0x2083a4=new History(_0x2eb920);var _0x571ef4=![];var _0x14a652;var _0x57eb8d;return new Promise(function(_0x352b42,_0x1e415e){if(_['isUndefined'](_0x4fe05d)&&typeof _0x4fe05d!==_0x3a0a('0x165')){return _0x1e415e(msgResponse('[callProgressDetecting]','Failure','entity\x20is\x20undefine'));}if(_[_0x3a0a('0x50')](_0x548864)&&typeof _0x548864!=='object'){return _0x1e415e(msgResponse('[callProgressDetecting]',_0x3a0a('0x90'),_0x3a0a('0x1a4')));}hopperUtils['verifyAdditionalPhones'](_0x2083a4,_0x548864[_0x3a0a('0xc4')],_0x4fe05d)['then'](function(_0x10aca3){if(_0x10aca3['additional']==0x1)_0x571ef4=!![];switch(_0x548864[_0x3a0a('0xc4')]){case'0':_0x4fe05d[_0x3a0a('0x1a5')]+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x0;_0x2083a4[_0x3a0a('0x6c')]=_0x3a0a('0x1a6');_0x2083a4['countnosuchnumberretry']+=0x1;_0x2083a4['countglobal']+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x3a0a('0x11a')](_0x2eb920,_0x3a0a('0x1a7')));_0x14a652=_0x4fe05d['dialNoSuchNumberRetryFrequency'];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils['createHistory'](_0x2083a4)['catch'](loggerCatch(_0x3a0a('0x123')));if(_0x2d18ac[_0x3a0a('0x195')](0x0,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x127')]>=_0x4fe05d[_0x3a0a('0x19e')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x200\x20no\x20such\x20number....');}else{_0x2d18ac['stateGlobal'](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1a8'));}}break;case'3':_0x4fe05d[_0x3a0a('0x1a9')]+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x3;_0x2083a4[_0x3a0a('0x6c')]=_0x3a0a('0x1aa');_0x2083a4[_0x3a0a('0x126')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;var _0xddedf0=ut[_0x3a0a('0x1ab')](_0x2eb920,_0x4fe05d);ami[_0x3a0a('0x3b')](_0x3a0a('0x1ac'),_0xddedf0);_0x14a652=_0x4fe05d['dialNoAnswerRetryFrequency'];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils['createHistory'](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1ad')));if(_0x2d18ac[_0x3a0a('0x195')](0x3,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4['countnoanswerretry']>=_0x4fe05d[_0x3a0a('0x196')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1ae'));}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1ae'));}}break;case'5':_0x4fe05d['outboundBusyCallsDay']+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x5;_0x2083a4[_0x3a0a('0x6c')]='Busy';_0x2083a4[_0x3a0a('0x124')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;ami['emit'](_0x3a0a('0x1af'),ut[_0x3a0a('0x11a')](_0x2eb920,_0x3a0a('0x1b0')));_0x14a652=_0x4fe05d[_0x3a0a('0x199')];_0x57eb8d=_0x4fe05d['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1b1')));if(_0x2d18ac[_0x3a0a('0x195')](0x5,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x124')]>=_0x4fe05d[_0x3a0a('0x198')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b2'));}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x205\x20busy');}}break;case'8':_0x4fe05d['outboundCongestionCallsDay']+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0x8;_0x2083a4[_0x3a0a('0x6c')]=_0x3a0a('0x1b3');_0x2083a4[_0x3a0a('0x125')]+=0x1;_0x2083a4['countglobal']+=0x1;_0x14a652=_0x4fe05d[_0x3a0a('0x19c')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];ami['emit'](_0x3a0a('0x1b4'),ut['buildObj'](_0x2eb920,_0x3a0a('0x1b5')));hopperUtils[_0x3a0a('0xc9')](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1b6')));if(_0x2d18ac[_0x3a0a('0x195')](0x8,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4['countcongestionretry']>=_0x4fe05d['dialCongestionMaxRetry']){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b7'));}else{_0x2d18ac['stateGlobal'](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b7'));}}break;case'11':_0x4fe05d[_0x3a0a('0x1b8')]+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0xb;_0x2083a4[_0x3a0a('0x6c')]='Abandoned';_0x2083a4[_0x3a0a('0xe9')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;_0x14a652=_0x4fe05d[_0x3a0a('0xec')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xc9')](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0xf0')));if(_0x2d18ac[_0x3a0a('0x195')](0xb,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0xe9')]>=_0x4fe05d[_0x3a0a('0xea')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1b9'));}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x2011\x20abandoned');}}break;case'20':_0x4fe05d['outboundRejectCallsDay']+=0x1;_0x2083a4['state']=0x14;_0x2083a4[_0x3a0a('0x6c')]='AgentReject';_0x2083a4[_0x3a0a('0x129')]+=0x1;_0x2083a4[_0x3a0a('0xd5')]+=0x1;_0x14a652=_0x4fe05d[_0x3a0a('0x1a2')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];ami[_0x3a0a('0x3b')](_0x3a0a('0x1ba'),ut[_0x3a0a('0x11a')](_0x2eb920,_0x3a0a('0x1bb')));hopperUtils[_0x3a0a('0xc9')](_0x2083a4)[_0x3a0a('0x9d')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x2d18ac['checkRetriveMax'](0x14,_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x129')]>=_0x4fe05d[_0x3a0a('0x1a1')]){_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,'reason\x2020\x20agentreject');}else{_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,_0x3a0a('0x1bc'));}}break;default:_0x4fe05d['outboundUnknownCallsDay']+=0x1;_0x2083a4[_0x3a0a('0x6b')]=0xc;_0x2083a4[_0x3a0a('0x6c')]=_0x548864['reason'];_0x14a652=_0x4fe05d[_0x3a0a('0x1a2')];_0x57eb8d=_0x4fe05d[_0x3a0a('0xd7')];hopperUtils[_0x3a0a('0xc9')](_0x2083a4)['catch'](loggerCatch(_0x3a0a('0x1bd')));if(_0x2d18ac[_0x3a0a('0x195')](_0x548864[_0x3a0a('0xc4')],_0x2eb920,_0x4fe05d)&&!_0x571ef4){if(_0x2083a4[_0x3a0a('0x124')]+_0x2083a4['countcongestionretry']+_0x2083a4[_0x3a0a('0x126')]+_0x2083a4[_0x3a0a('0x127')]+_0x2083a4['countdropretry']+_0x2083a4['countabandonedretry']+_0x2083a4['countmachineretry']+_0x2083a4[_0x3a0a('0x129')]>=_0x4fe05d[_0x3a0a('0x12a')]){_0x2d18ac[_0x3a0a('0x132')](_0x2083a4,_0x352b42,_0x1e415e,_0x548864['reason']);}else{_0x2d18ac[_0x3a0a('0x12d')](_0x2083a4,_0x352b42,_0x1e415e,_0x548864[_0x3a0a('0xc4')]);}}}})[_0x3a0a('0x9f')](function(){if(_0x571ef4){hopperUtils[_0x3a0a('0xe6')](_0x2083a4,_0x14a652,_0x57eb8d)[_0x3a0a('0x9f')](function(){return _0x352b42(0x1);});}});});};Dialer['prototype'][_0x3a0a('0x132')]=function(_0x4c0955,_0x346f88,_0xd350d1,_0x66bf1d){var _0x3ec6b2=new Final(_0x4c0955);_0x3ec6b2['state']=0xf;_0x3ec6b2[_0x3a0a('0x6c')]=_0x3a0a('0x1be');this[_0x3a0a('0x12d')](_0x3ec6b2,_0x346f88,_0xd350d1,_0x66bf1d);};Dialer[_0x3a0a('0x18')][_0x3a0a('0x12d')]=function(_0x49be30,_0x2bdea7,_0x293b04,_0xd0a979){hopperUtils[_0x3a0a('0x13a')](_0x49be30)['then'](function(){return _0x2bdea7(msgResponse(_0x3a0a('0x1bf'),_0x3a0a('0x10c'),_0xd0a979));})[_0x3a0a('0x9d')](function(){return _0x293b04(msgResponse(_0x3a0a('0x1c0'),_0x3a0a('0x90'),_0x3a0a('0x1c1')));});};Dialer['prototype']['predictive']=function(_0x1c557b){var _0x3cacce=_0x1c557b[_0x3a0a('0x1c2')]/0x64;var _0xa9ae30=_0x1c557b['outboundDropCallsDayTimeout']/(_0x1c557b[_0x3a0a('0xce')]+_0x1c557b[_0x3a0a('0x117')]);var _0x102327=Math[_0x3a0a('0x1c3')](_0x1c557b[_0x3a0a('0x1c4')]*(_0x1c557b['predictiveIntervalMaxThreshold']/0x64));var _0x59e2ec=Math['round'](_0x1c557b['predictiveIntervalAvailable']*(_0x1c557b[_0x3a0a('0x1c5')]/0x64));var _0x267c78=_0x1c557b[_0x3a0a('0x141')]+_0x1c557b[_0x3a0a('0x143')];var _0x196bb4=Math['floor'](_0x1c557b[_0x3a0a('0x1c6')]*_0x1c557b[_0x3a0a('0x59')]*_0x1c557b['predictiveIntervalHitRate']*_0x1c557b[_0x3a0a('0x1c7')]);if(_[_0x3a0a('0x50')](_0x1c557b['startProgressive'])){if(!_[_0x3a0a('0x50')](_0x1c557b[_0x3a0a('0x5e')])){_0x1c557b[_0x3a0a('0x5e')]=undefined;loggerPredictive[_0x3a0a('0x62')](_0x3a0a('0x1c8'),_0x3a0a('0x1c9'));}if(!_[_0x3a0a('0x50')](_0x1c557b['handlePredictive'])){loggerPredictive[_0x3a0a('0x62')](_0x3a0a('0x1c8'),_0x3a0a('0x1ca'));clearInterval(_0x1c557b[_0x3a0a('0x60')]);_0x1c557b[_0x3a0a('0x60')]=undefined;}_0x1c557b[_0x3a0a('0x5c')]=moment()[_0x3a0a('0x7a')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3a0a('0x44')](_0x1c557b[_0x3a0a('0x41')],'collection\x20data\x20in\x20progressive\x20at',_0x1c557b[_0x3a0a('0x5c')]);this['handlePower'](_0x1c557b,0x1);}else if(ifInterval(_0x1c557b['dialPredictiveInterval'],_0x1c557b[_0x3a0a('0x5c')])){this['handlePower'](_0x1c557b,0x1);loggerPredictiveCalls[_0x3a0a('0x44')](_0x3a0a('0x1cb'),_0x1c557b['startProgressive'],_0x1c557b[_0x3a0a('0x41')]);_0x1c557b['erlangCalls']=0x0;_0x1c557b['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x3cacce<_0xa9ae30&&_0x1c557b[_0x3a0a('0x1cc')]===_0x3a0a('0x1cd')){clearPredictiveAttributes(_0x1c557b);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x1ce'),_0x3a0a('0x1cf'),_0xa9ae30,_0x3a0a('0x5c'),_0x1c557b['name']);}else if(_0x196bb4<_0x1c557b[_0x3a0a('0xcf')]&&_0x1c557b[_0x3a0a('0x1cc')]===_0x3a0a('0x1cd')){clearPredictiveAttributes(_0x1c557b);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x1d0'),_0x3a0a('0x1d1'),_0x196bb4,_0x3a0a('0x1d2'),_0x1c557b[_0x3a0a('0xcf')],_0x3a0a('0x5c'),_0x1c557b['name']);}else if(!ifInterval(_0x1c557b[_0x3a0a('0x1d3')],_0x1c557b[_0x3a0a('0x5c')])&&_[_0x3a0a('0x50')](_0x1c557b['startPredictive'])&&!_[_0x3a0a('0x50')](_0x1c557b[_0x3a0a('0x5c')])){_0x1c557b['startPredictive']=moment()['format'](_0x3a0a('0xc8'));loggerPredictive[_0x3a0a('0x44')](_0x1c557b[_0x3a0a('0x41')],'started\x20in\x20predictive\x20at',_0x1c557b[_0x3a0a('0x5e')]);hopperUtils[_0x3a0a('0x1d4')](_0x1c557b[_0x3a0a('0x1d3')])[_0x3a0a('0x9f')](this[_0x3a0a('0x1d5')](_0x1c557b))[_0x3a0a('0x9f')](mergeDataErlangB(_0x1c557b))[_0x3a0a('0x9f')](this['startMethodPredictive'](_0x1c557b))[_0x3a0a('0x9d')](loggerCatchPredictive(_0x3a0a('0x1d6'),_0x1c557b));}else if(!ifInterval(_0x1c557b[_0x3a0a('0x1d3')],_0x1c557b[_0x3a0a('0x5e')])){_0x1c557b[_0x3a0a('0xcf')]=0x0;_0x1c557b[_0x3a0a('0x5e')]=moment()[_0x3a0a('0x7a')](_0x3a0a('0xc8'));loggerPredictive[_0x3a0a('0x44')](_0x1c557b[_0x3a0a('0x41')],'recalculate\x20predictive\x20at',_0x1c557b[_0x3a0a('0x5e')]);clearInterval(_0x1c557b[_0x3a0a('0x60')]);_0x1c557b['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x1c557b[_0x3a0a('0x1d3')])[_0x3a0a('0x9f')](this[_0x3a0a('0x1d5')](_0x1c557b))[_0x3a0a('0x9f')](mergeDataErlangB(_0x1c557b))[_0x3a0a('0x9f')](this[_0x3a0a('0x1d7')](_0x1c557b))[_0x3a0a('0x9d')](loggerCatchPredictive(_0x3a0a('0x1d8'),_0x1c557b));}else if(_0x1c557b[_0x3a0a('0x1c4')]&&_0x267c78<_0x1c557b[_0x3a0a('0x1c4')]-_0x59e2ec){clearPredictiveAttributes(_0x1c557b);loggerPredictive['info'](_0x1c557b[_0x3a0a('0x41')],_0x3a0a('0x1d9'),_0x267c78,_0x3a0a('0x1da'),_0x1c557b['predictiveIntervalAvailable'],'-',_0x59e2ec,'=',_0x1c557b[_0x3a0a('0x1c4')]-_0x59e2ec,')');}else if(_0x1c557b['predictiveIntervalAvailable']&&_0x267c78>_0x1c557b['predictiveIntervalAvailable']+_0x102327){clearPredictiveAttributes(_0x1c557b);loggerPredictive['info'](_0x1c557b[_0x3a0a('0x41')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x267c78,_0x3a0a('0x1db'),_0x1c557b['predictiveIntervalAvailable'],'+',_0x102327,'=',_0x1c557b[_0x3a0a('0x1c4')]+_0x102327,')');}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1d5')]=function(_0x5289d4){var _0x39dc0d=this;return function(_0x59a682){return new Promise(function(_0x5b9f66,_0x53dd49){_['merge'](_0x5289d4,_0x59a682[0x0]);if(checkGetDataPredictive(_0x59a682[0x0])){var _0xf8e9c4=_0x5289d4[_0x3a0a('0x1c4')]=_0x5289d4['talking']+_0x5289d4['available'];var _0x19d742=_0x5289d4[_0x3a0a('0x1d3')]*0x3c;var _0x19888f=_0x59a682[0x0][_0x3a0a('0x4e')]+_0x59a682[0x0]['predictiveIntervalAvgHoldtime'];var _0x40b70f=(_0x59a682[0x0][_0x3a0a('0x48')]+_0x59a682[0x0][_0x3a0a('0x4a')]+_0x59a682[0x0][_0x3a0a('0x4b')])/_0x59a682[0x0][_0x3a0a('0x46')];_0x5289d4['predictiveIntervalHitRate']=_0x40b70f>0x0?_0x40b70f:0x1;switch(_0x5289d4[_0x3a0a('0x1cc')]){case _0x3a0a('0x1cd'):var _0x2483e9=_0x5289d4['dialPredictiveOptimizationPercentage']/0x64;return _0x39dc0d[_0x3a0a('0x1dc')](_0xf8e9c4,_0x19d742,_0x19888f,_0x40b70f,_0x2483e9)[_0x3a0a('0x9f')](function(_0x3b6bf3){return _0x5b9f66(_0x3b6bf3);});case _0x3a0a('0x1dd'):var _0x467d75=_0x5289d4[_0x3a0a('0x1c2')]/0x64;return _0x39dc0d[_0x3a0a('0x1de')](_0xf8e9c4,_0x19d742,_0x19888f,_0x40b70f,_0x467d75)[_0x3a0a('0x9f')](function(_0x1606f9){return _0x5b9f66(_0x1606f9);});default:return _0x53dd49(msgResponse(_0x3a0a('0x1df'),_0x3a0a('0x90'),_0x3a0a('0x1e0')));}}else{return _0x53dd49(msgResponse(_0x3a0a('0x1df'),_0x3a0a('0x90'),_0x3a0a('0x1e1')));}});};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1e2')]=function(_0x3366a5){var _0x519a3a=this;return function(_0x3602db){return new Promise(function(_0xe571f1,_0x3855cc){_[_0x3a0a('0x5b')](_0x3366a5,_0x3602db[0x0]);if(checkGetDataPredictive(_0x3602db[0x0])){loggerPredictive[_0x3a0a('0x44')](JSON['stringify'](_0x3602db[0x0]));if(_0x3366a5[_0x3a0a('0x1cc')]==='dropRate'){return _0x519a3a[_0x3a0a('0x15b')](_0x3366a5['id'])[_0x3a0a('0x9f')](function(_0x53fb11){var _0x3af896=_0x3366a5[_0x3a0a('0x1e3')]-_0x53fb11[0x0][_0x3a0a('0x1e4')];var _0x55017a=_0x3366a5[_0x3a0a('0x1d3')]*0x3c;var _0x2f7db4=_0x3602db[0x0][_0x3a0a('0x4e')]+_0x3602db[0x0][_0x3a0a('0x51')];var _0x481e1a=(_0x3602db[0x0]['predictiveIntervalAnsweredCalls']+_0x3602db[0x0][_0x3a0a('0x4a')]+_0x3602db[0x0][_0x3a0a('0x4b')])/_0x3602db[0x0][_0x3a0a('0x46')];var _0x120d31=_0x3366a5['dialPredictiveOptimizationPercentage']/0x64;_0x3366a5[_0x3a0a('0x1e5')]=_0x53fb11[0x0][_0x3a0a('0x1e4')]||0x0;_0x3366a5[_0x3a0a('0x1e6')]=_0x481e1a>0x0?_0x481e1a:0x1;return _0x519a3a[_0x3a0a('0x1dc')](_0x3af896,_0x55017a,_0x2f7db4,_0x481e1a,_0x120d31);})[_0x3a0a('0x9f')](function(_0x3ce71d){return _0xe571f1(_0x3ce71d);})['catch'](function(_0x498cc9){return _0x3855cc(msgResponse(_0x3a0a('0x1e7'),'Failure',JSON[_0x3a0a('0x70')](_0x498cc9)));});}if(_0x3366a5[_0x3a0a('0x1cc')]===_0x3a0a('0x1dd')){return _0x519a3a[_0x3a0a('0x15b')](_0x3366a5['id'])[_0x3a0a('0x9f')](function(_0x59b82a){var _0x2b0216=_0x3366a5[_0x3a0a('0x1e3')]-_0x59b82a[0x0][_0x3a0a('0x1e4')];var _0x24e62a=_0x3366a5[_0x3a0a('0x1d3')]*0x3c;var _0x573739=_0x3602db[0x0][_0x3a0a('0x4e')]+_0x3602db[0x0]['predictiveIntervalAvgHoldtime'];var _0x19b419=(_0x3602db[0x0][_0x3a0a('0x48')]+_0x3602db[0x0][_0x3a0a('0x4a')]+_0x3602db[0x0][_0x3a0a('0x4b')])/_0x3602db[0x0][_0x3a0a('0x46')];var _0x21958e=_0x3366a5[_0x3a0a('0x1c2')]/0x64;_0x3366a5[_0x3a0a('0x1e5')]=_0x59b82a[0x0][_0x3a0a('0x1e4')]||0x0;_0x3366a5[_0x3a0a('0x1e6')]=_0x19b419>0x0?_0x19b419:0x1;return _0x519a3a[_0x3a0a('0x1de')](_0x2b0216,_0x24e62a,_0x573739,_0x19b419,_0x21958e);})[_0x3a0a('0x9f')](function(_0x45e244){return _0xe571f1(_0x45e244);})[_0x3a0a('0x9d')](function(_0x23c3c3){return _0x3855cc(msgResponse(_0x3a0a('0x1e7'),'Failure',JSON[_0x3a0a('0x70')](_0x23c3c3)));});}}else{return _0x3855cc(msgResponse('[getDataPredictive]',_0x3a0a('0x90'),_0x3a0a('0x1e1')));}});};};Dialer[_0x3a0a('0x18')]['startMethodPredictive']=function(_0x2dc084){var _0x20bec0=this;return function(){var _0x1a3255=0x0;var _0x214780=Math[_0x3a0a('0x1e8')](_0x2dc084[_0x3a0a('0x56')]*0x3e8);if(_0x214780>0x0){_0x214780=_0x214780<0x64?0x64:_0x214780;loggerPredictive['info'](_0x2dc084['name'],_0x3a0a('0x1e9'),_0x214780,_0x3a0a('0x1ea'));_0x2dc084['handlePredictive']=setInterval(function(){_0x20bec0['handlePredictive'](_0x2dc084);loggerPredictiveCalls[_0x3a0a('0x44')](_0x3a0a('0x1eb'),_0x1a3255+=0x1);},_0x214780);}else{loggerPredictive[_0x3a0a('0x44')](_0x2dc084['name'],_0x3a0a('0x1ec'));}};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1ed')]=function(_0x25c6f5,_0x41f419){var _0x20165c=this;return function(_0x54bdab){if(_[_0x3a0a('0x43')](_0x54bdab)){if(_[_0x3a0a('0xf4')](_0x41f419[_0x3a0a('0x1ee')])||!_0x41f419[_0x3a0a('0x1ef')]){if(_0x25c6f5[_0x3a0a('0xb2')]===_0x3a0a('0xb7')){_0x25c6f5['queueStatusComplete']=_['isUndefined'](_0x25c6f5[_0x3a0a('0x1f0')])?!![]:_0x25c6f5[_0x3a0a('0x1f0')];var _0x542ae8=uuid['v4']();_0x20165c['actions'][_0x542ae8]=new Action(_0x25c6f5,_0x41f419,_0x542ae8);loggerBooked['info'](_0x3a0a('0x1f1'),_0x542ae8,_0x3a0a('0x1f2'),JSON[_0x3a0a('0x70')](_0x25c6f5[_0x3a0a('0x1f0')]),_0x3a0a('0x1f3'),_0x25c6f5[_0x3a0a('0x41')]);if(_0x25c6f5[_0x3a0a('0x1f0')]){_0x25c6f5[_0x3a0a('0x1f0')]=![];_0x20165c['queueBooked'][_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xc0')]]=[];ami['Action']({'actionid':_0x542ae8,'action':'queuestatus','queue':_0x25c6f5[_0x3a0a('0x41')]})[_0x3a0a('0x9d')](function(){_0x20165c[_0x3a0a('0xff')](_0x25c6f5);hopperUtils[_0x3a0a('0xeb')]({'active':![],'ContactId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xdf')],'ListId':_0x20165c[_0x3a0a('0x21')][_0x542ae8]['ListId'],'VoiceQueueId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xed')]||undefined,'CampaignId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1f4')));delete _0x20165c[_0x3a0a('0x21')][_0x542ae8];});}else{loggerBooked[_0x3a0a('0x44')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x25c6f5['queueStatusComplete']),'Queue:\x20',_0x25c6f5['name']);_0x20165c[_0x3a0a('0xff')](_0x25c6f5);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xdf')],'ListId':_0x20165c[_0x3a0a('0x21')][_0x542ae8]['ListId'],'VoiceQueueId':_0x20165c[_0x3a0a('0x21')][_0x542ae8]['VoiceQueueId']||undefined,'CampaignId':_0x20165c[_0x3a0a('0x21')][_0x542ae8][_0x3a0a('0xee')]||undefined})[_0x3a0a('0x9d')](loggerCatch(_0x3a0a('0x1f4')));delete _0x20165c[_0x3a0a('0x21')][_0x542ae8];}}else{return _0x20165c['actionOriginate'](_0x25c6f5,_0x41f419);}}else{if(utils[_0x3a0a('0x1f5')](undefined,_0x41f419[_0x3a0a('0x1f6')])<_0x25c6f5[_0x3a0a('0x1f7')]*0x3c){if(_0x41f419['Agent']&&!_0x41f419[_0x3a0a('0x14f')][_0x3a0a('0x1f8')]){_0x20165c[_0x3a0a('0x1c')][_0x3a0a('0xfd')](_0x41f419['id'])['finally'](function(){_0x20165c['updateOriginated'](_0x25c6f5);});}else{hopperUtils['unlockContact']({'active':![]},_0x41f419['id'],0x1)['finally'](function(){_0x20165c[_0x3a0a('0xff')](_0x25c6f5);});}}else{_0x25c6f5[_0x3a0a('0x1f9')]+=0x1;_0x20165c['updateOriginated'](_0x25c6f5);if(_0x25c6f5[_0x3a0a('0x1fa')]){hopperUtils[_0x3a0a('0xeb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x41f419[_0x3a0a('0xdf')],'ListId':_0x41f419[_0x3a0a('0xe0')],'VoiceQueueId':_0x41f419[_0x3a0a('0xed')]||undefined,'CampaignId':_0x41f419['CampaignId']||undefined})['catch'](loggerCatch(_0x3a0a('0x1fb')));hopperUtils[_0x3a0a('0xc9')](createObjHistory(_0x25c6f5,_0x41f419,utils[_0x3a0a('0x69')][_0x3a0a('0x1fc')],0x17,_0x3a0a('0x1fd')))['catch'](loggerCatch(_0x3a0a('0x1fe')));}else{_0x20165c['saveInDb'](createObjHistory(_0x25c6f5,_0x41f419,utils[_0x3a0a('0x69')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),_0x3a0a('0x1ff'),_0x3a0a('0x200'));}}}}else{_0x25c6f5['outboundBlacklistCallsDay']+=0x1;_0x20165c[_0x3a0a('0x11b')](createObjHistory(_0x25c6f5,_0x41f419,utils[_0x3a0a('0x69')]['BLACKLIST'],0xd,_0x3a0a('0x201')),'[Originate][historyBlacklist]',_0x3a0a('0x202'));throw _0x3a0a('0x203');}};};Dialer[_0x3a0a('0x18')][_0x3a0a('0x163')]=function(_0x6ec426){var _0x329cc8=this;var _0x33204b=_0x6ec426[_0x3a0a('0x204')]-_0x6ec426[_0x3a0a('0x7e')]-_0x6ec426['temp'];emitCampaignSummary(_0x6ec426);if(_0x33204b>0x0){if(_0x33204b>this[_0x3a0a('0x20')]){_0x33204b=this[_0x3a0a('0x20')];}_0x6ec426[_0x3a0a('0x205')]+=_0x33204b;hopperUtils[_0x3a0a('0x206')](_0x6ec426['id'],_0x33204b,_0x6ec426[_0x3a0a('0x207')],_0x6ec426)[_0x3a0a('0x9f')](function(_0x55e09f){_0x6ec426['temp']-=_0x33204b;_0x6ec426[_0x3a0a('0x205')]=_0x6ec426['temp']>0x0?_0x6ec426[_0x3a0a('0x205')]:0x0;if(!utils[_0x3a0a('0x208')](_0x55e09f)){_0x6ec426['message']=utils[_0x3a0a('0x69')][_0x3a0a('0x6a')];logger[_0x3a0a('0x44')](_0x3a0a('0x209')+_0x6ec426[_0x3a0a('0x41')]);}else{_0x6ec426[_0x3a0a('0x7e')]+=_0x55e09f[_0x3a0a('0x96')];_0x6ec426[_0x3a0a('0x68')]=utils['CAMPAIGN_STATUS'][_0x3a0a('0x20a')];for(var _0x1c27f2=0x0;_0x1c27f2<_0x55e09f['length'];_0x1c27f2+=0x1){_0x6ec426[_0x3a0a('0x20b')]+=0x1;if(_[_0x3a0a('0xf4')](_0x55e09f[_0x1c27f2])||_[_0x3a0a('0xf4')](_0x55e09f[_0x1c27f2][_0x3a0a('0x17d')])||_['isNil'](_0x55e09f[_0x1c27f2][_0x3a0a('0x167')])){_0x329cc8[_0x3a0a('0x20c')](_0x3a0a('0x20d'),_0x6ec426,_0x55e09f[_0x1c27f2]);}else{hopperUtils[_0x3a0a('0x20e')](_[_0x3a0a('0x71')](_0x55e09f[_0x1c27f2],[_0x3a0a('0xee'),_0x3a0a('0x167')]))['then'](_0x329cc8[_0x3a0a('0x1ed')](_0x6ec426,_0x55e09f[_0x1c27f2]))[_0x3a0a('0x9d')](_0x329cc8[_0x3a0a('0x15e')](_0x3a0a('0x20f'),_0x6ec426));}}}})[_0x3a0a('0x9d')](loggerGetContactDialer(_0x3a0a('0x210'),_0x6ec426,_0x33204b));}};Dialer[_0x3a0a('0x18')]['handlePower']=function(_0x5383e5,_0x4420f2){var _0x434ccd=this;var _0x34971d=[];if(_0x4420f2<0x1||_0x5383e5['dialMethod']===_0x3a0a('0xb7')){_0x4420f2=0x1;}var _0x322964=Math['floor'](_0x5383e5[_0x3a0a('0x141')]*_0x4420f2)-_0x5383e5[_0x3a0a('0x7e')]-_0x5383e5[_0x3a0a('0x205')];if(_0x5383e5['dialLimitQueue']>0x0){var _0x78ed3f=_0x5383e5[_0x3a0a('0x211')]-_0x5383e5[_0x3a0a('0x7e')]-_0x5383e5['talking']-_0x5383e5[_0x3a0a('0x205')]-_0x5383e5['pTalking'];if(_0x322964>_0x78ed3f){_0x322964=_0x78ed3f;}}if(_0x322964>0x0){if(_0x5383e5['dialMethod']===_0x3a0a('0xb7')){_0x322964=0x1;}if(_0x322964>this['maxNumberOriginate']){_0x322964=this[_0x3a0a('0x20')];}_0x5383e5[_0x3a0a('0x205')]+=_0x322964;for(var _0x2ecd62 in this[_0x3a0a('0x1e')]){if(typeof this['agents'][_0x2ecd62]!==_0x3a0a('0xac')){if(this['agents'][_0x2ecd62][_0x3a0a('0x6b')]===_0x3a0a('0x212')&&this[_0x3a0a('0x1e')][_0x2ecd62][_0x3a0a('0x86')]===_0x3a0a('0x87')){_0x34971d[_0x3a0a('0x97')](this[_0x3a0a('0x1e')][_0x2ecd62]['id']);}}}hopperUtils['getContactDialer'](_0x5383e5,_0x34971d,_0x322964)[_0x3a0a('0x9f')](function(_0x3d75b3){_0x5383e5[_0x3a0a('0x205')]-=_0x322964;_0x5383e5['temp']=_0x5383e5[_0x3a0a('0x205')]>0x0?_0x5383e5[_0x3a0a('0x205')]:0x0;if(!utils[_0x3a0a('0x208')](_0x3d75b3)){hopperUtils[_0x3a0a('0x213')](_0x5383e5)['then'](sendMessageReschedule(_0x5383e5))['catch'](loggerCatch(_0x3a0a('0x214')));}else{_0x5383e5[_0x3a0a('0x7e')]+=_0x3d75b3[_0x3a0a('0x96')];_0x5383e5[_0x3a0a('0x68')]=_0x5383e5[_0x3a0a('0xb2')]===_0x3a0a('0xb7')?utils['CAMPAIGN_STATUS'][_0x3a0a('0x145')]:utils['CAMPAIGN_STATUS']['RUNNING'];for(var _0x970d36=0x0;_0x970d36<_0x3d75b3['length'];_0x970d36+=0x1){if(_[_0x3a0a('0xf4')](_0x3d75b3[_0x970d36])||_[_0x3a0a('0xf4')](_0x3d75b3[_0x970d36][_0x3a0a('0x17d')])||_['isNil'](_0x3d75b3[_0x970d36]['phone'])){_0x434ccd['emptyContact'](_0x3a0a('0x20d'),_0x5383e5,_0x3d75b3[_0x970d36]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x3d75b3[_0x970d36],['VoiceQueueId',_0x3a0a('0x167')]))[_0x3a0a('0x9f')](_0x434ccd[_0x3a0a('0x1ed')](_0x5383e5,_0x3d75b3[_0x970d36]))[_0x3a0a('0x9d')](_0x434ccd[_0x3a0a('0x15e')](_0x3a0a('0x20d'),_0x5383e5));}}}})[_0x3a0a('0x9d')](loggerGetContactDialer(_0x3a0a('0x215'),_0x5383e5,_0x322964));}};Dialer[_0x3a0a('0x18')][_0x3a0a('0x60')]=function(_0xc11a57){if(_0xc11a57[_0x3a0a('0x211')]>0x0){var _0x1348c6=_0xc11a57['dialLimitQueue']-_0xc11a57[_0x3a0a('0x7e')]-_0xc11a57[_0x3a0a('0x143')];if(_0x1348c6>0x0){this[_0x3a0a('0x216')](_0xc11a57);}else{loggerPredictiveCalls['info']('[handlePredictive][limitChannel]');}}else{this[_0x3a0a('0x216')](_0xc11a57);}};Dialer[_0x3a0a('0x18')]['tryOriginatePredictive']=function(_0x435514){var _0x41f806=this;var _0x26bb89=[];_0x435514[_0x3a0a('0x7e')]+=0x1;for(var _0x3d0b7f in this['agents']){if(typeof this['agents'][_0x3d0b7f]!==_0x3a0a('0xac')){if(this[_0x3a0a('0x1e')][_0x3d0b7f][_0x3a0a('0x6b')]==='not_inuse'&&this[_0x3a0a('0x1e')][_0x3d0b7f]['status']===_0x3a0a('0x87')){_0x26bb89[_0x3a0a('0x97')](this['agents'][_0x3d0b7f]['id']);}}}return this[_0x3a0a('0x217')](_0x435514['id'],_0x26bb89,0x1,_0x435514[_0x3a0a('0x207')],_0x435514)['then'](function(_0x45eab){if(!utils['checkContactEmpty'](_0x45eab)){utils[_0x3a0a('0x64')](_0x435514,0x1,0x0);return hopperUtils[_0x3a0a('0x213')](_0x435514)[_0x3a0a('0x9f')](sendMessageReschedule(_0x435514))[_0x3a0a('0x9d')](loggerCatch('[countReScheduled]\x20'));}else{_0x435514[_0x3a0a('0x68')]=utils[_0x3a0a('0x69')][_0x3a0a('0x20a')];if(_['isNil'](_0x45eab[0x0])||_[_0x3a0a('0xf4')](_0x45eab[0x0][_0x3a0a('0x17d')])||_['isNil'](_0x45eab[0x0][_0x3a0a('0x167')])){_0x41f806['emptyContact'](_0x3a0a('0x20d'),_0x435514,_0x45eab[0x0]);}else{return hopperUtils[_0x3a0a('0x218')](_[_0x3a0a('0x71')](_0x45eab[0x0],[_0x3a0a('0xed'),'phone']))[_0x3a0a('0x9f')](_0x41f806[_0x3a0a('0x1ed')](_0x435514,_0x45eab[0x0]))[_0x3a0a('0x9d')](_0x41f806['loggerHandler'](_0x3a0a('0x219'),_0x435514));}}})[_0x3a0a('0x9d')](loggerGetContactDialer(_0x3a0a('0x21a'),_0x435514,0x1));};Dialer[_0x3a0a('0x18')]['abandonmentRate']=function(_0x17b2e2,_0x3da2e9,_0x29e3d9,_0x1bd4d2,_0x4624b9,_0x4f6bd9){loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21b'));loggerPredictive['info'](_0x3a0a('0x21c'),_0x17b2e2);loggerPredictive['info'](_0x3a0a('0x21d'),_0x3da2e9);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21e'),_0x29e3d9);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21f'),_0x1bd4d2);loggerPredictive['info'](_0x3a0a('0x220'),_0x4624b9);loggerPredictive[_0x3a0a('0x44')]('---------------------------');return new Promise(function(_0x5a28e8,_0xe2ee27){if(_0x17b2e2<=0x0||isNaN(_0x17b2e2)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),_0x3a0a('0x222')+_0x17b2e2));}if(_0x29e3d9<=0x0||isNaN(_0x29e3d9)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),'Ts\x20=\x20'+_0x29e3d9));}if(_0x1bd4d2<=0x0||isNaN(_0x1bd4d2)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),'p\x20=\x20'+_0x1bd4d2));}if(_0x3da2e9<=0x0||isNaN(_0x3da2e9)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),_0x3a0a('0x223')+_0x3da2e9));}if(_0x4624b9<=0x0||isNaN(_0x4624b9)){return _0xe2ee27(msgResponse(_0x3a0a('0x221'),_0x3a0a('0x193'),_0x3a0a('0x224')+_0x4624b9));}_0x4f6bd9=_0x4f6bd9||0x0;var _0x5751f4=0x1/_0x29e3d9;var _0xc696e5=0x0;var _0x41506c=0x0;var _0x156b80=0x0;var _0x568a31=0x0;for(var _0x33569c=0x0;_0x156b80<_0x4624b9;_0x33569c+=0x1){_0x41506c=_0x33569c/_0x3da2e9;_0xc696e5=(_0x1bd4d2*_0x41506c+_0x4f6bd9)/_0x5751f4;_0x156b80=utils[_0x3a0a('0x225')](_0xc696e5,_0x17b2e2);_0x568a31=_0xc696e5/_0x17b2e2*(0x1-utils['erlangb'](_0xc696e5,_0x17b2e2));}return _0x5a28e8({'erlangCalls':_0x33569c,'erlangCallToSecond':_0x3da2e9/_0x33569c,'erlangAbandonmentRate':_0x156b80,'erlangBusyFactor':_0x568a31});});};Dialer[_0x3a0a('0x18')][_0x3a0a('0x1de')]=function(_0x218d83,_0x11004a,_0x3c8740,_0x2ebdb5,_0x675a48,_0x551e8f){loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x226'));loggerPredictive['info'](_0x3a0a('0x21c'),_0x218d83);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11004a);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21e'),_0x3c8740);loggerPredictive[_0x3a0a('0x44')](_0x3a0a('0x21f'),_0x2ebdb5);loggerPredictive['info'](_0x3a0a('0x227'),_0x675a48);loggerPredictive[_0x3a0a('0x44')]('---------------------------');return new Promise(function(_0x53a9b7,_0x46af32){if(_0x218d83<=0x0||isNaN(_0x218d83)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x222')+_0x218d83));}if(_0x3c8740<=0x0||isNaN(_0x3c8740)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x229')+_0x3c8740));}if(_0x2ebdb5<=0x0||isNaN(_0x2ebdb5)){return _0x46af32(msgResponse(_0x3a0a('0x228'),'Error',_0x3a0a('0x22a')+_0x2ebdb5));}if(_0x11004a<=0x0||isNaN(_0x11004a)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x223')+_0x11004a));}if(_0x675a48<=0x0||isNaN(_0x675a48)){return _0x46af32(msgResponse(_0x3a0a('0x228'),_0x3a0a('0x193'),_0x3a0a('0x22b')+_0x675a48));}_0x551e8f=_0x551e8f||0x0;var _0x3aa421=0x1/_0x3c8740;var _0x14136f=0x0;var _0x331b3f=0x0;var _0x9d4f09=0x0;var _0x5c4d0b=0x0;for(var _0x2fe722=0x0;_0x5c4d0b<_0x675a48;_0x2fe722+=0x1){_0x331b3f=_0x2fe722/_0x11004a;_0x14136f=(_0x2ebdb5*_0x331b3f+_0x551e8f)/_0x3aa421;_0x9d4f09=utils[_0x3a0a('0x225')](_0x14136f,_0x218d83);_0x5c4d0b=_0x14136f/_0x218d83*(0x1-utils[_0x3a0a('0x225')](_0x14136f,_0x218d83));}return _0x53a9b7({'erlangCalls':_0x2fe722,'erlangCallToSecond':_0x11004a/_0x2fe722,'erlangAbandonmentRate':_0x9d4f09,'erlangBusyFactor':_0x5c4d0b});});};module[_0x3a0a('0x22c')]=Dialer;
\ No newline at end of file
+var _0x7d6c=['is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','Error','isTrunkReachable','active','SIP/%s','status','checkIsTrunkReachable','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','Intervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','Failure','\x20Timezone\x20unknow\x20','isArray','length','push','Action','command','interval','timezones','indexOf','true','catch','iftime\x20%s,%s','content','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','campaigns','undefined','resolve','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','launchHandleIvr','[syncCampaigns]','dialMethod','predictive','power','handlePower','dialPowerLevel','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','uniqueid','type','ivr','updateOriginated','queue','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','createHistory','moveContactManagedDialer','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','countglobal','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','add','dialDropRetryFrequency','minutes','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','queueCallerAbandonCreateState','rescheduleContact','ContactId','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actions','channel','actionid','strategy','roundrobin','isNil','paused','stateinterface','locked','rrmemory','idHopper','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','saveInDb','dialAMDActive','MACHINE','Machine','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','createStateFinal','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','statusMessage','getQueueCampaignStatusMessage','available','inUse','talking','ACTIVE','checkDialMethod','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','reachable','handlePreviewRecallNotifications','map','Agent','user:dialPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','[emptyContact]','checkPreviewRecallReminder','handleIvr','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialAgiAfterHangupAgent','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','getCallerId','callerid','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','Trunk','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialMachineMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','Global','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','[CatchErlangB]','predictiveIntervalPauses','floor','milliseconds','UserId','recallme','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','voicePause','run','unlockContact','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','[actionOriginate]\x20','checkIsBlackListIvr','checkContactBlack','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','RUNNING','checkIsBlackList','tryOriginatePredictive','dialOrderByScheduledAt','checkContactLowerLimitOriginate','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','abandonmentRate','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','lodash','uuid','moment','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','booked','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/history','./models/final','./models/queueCallerAbandon','./models/hangup','env','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','syncQueueCallerAbandon','originateresponse','bind','agentcomplete','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','inspect','format','voice:queue:%s','voice_queue:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','startPredictive','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','pick','NULL_INTERVAL','Interval','\x20INTERVAL_IS_NULL','isEmpty','isIVRCampaignActive','INACTIVE','isIVRCampaign','campaign:ivr:%s','sendMessageOneNotActive','originated'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7d6c,0x19c));var _0xc7d6=function(_0x5de692,_0x334911){_0x5de692=_0x5de692-0x0;var _0x30995e=_0x7d6c[_0x5de692];return _0x30995e;};'use strict';var util=require('util');var _=require(_0xc7d6('0x0'));var uuid=require(_0xc7d6('0x1'));var moment=require(_0xc7d6('0x2'));var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require(_0xc7d6('0x3'));var ut=require(_0xc7d6('0x4'));var config=require(_0xc7d6('0x5'));var logger=require(_0xc7d6('0x6'))('dialer');var loggerBooked=require('../../../config/logger')(_0xc7d6('0x7'));var loggerPredictive=require(_0xc7d6('0x6'))('predictive');var loggerPredictiveCalls=require(_0xc7d6('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xc7d6('0x6'))(_0xc7d6('0x8'));var ami=require(_0xc7d6('0x9'));config[_0xc7d6('0xa')]=_[_0xc7d6('0xb')](config[_0xc7d6('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0xc7d6('0xc'))(new Redis(config[_0xc7d6('0xa')]));var cmHopper=require(_0xc7d6('0xd'));var voiceQueueRt=require(_0xc7d6('0xe'));var RpcSetting=require(_0xc7d6('0xf'));var Interval=require(_0xc7d6('0x10'));var Action=require(_0xc7d6('0x11'));var History=require(_0xc7d6('0x12'));var Final=require(_0xc7d6('0x13'));var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0xc7d6('0x14'));var Hangup=require(_0xc7d6('0x15'));var ipAgi=process[_0xc7d6('0x16')]['XCALLY_IP_AGI']||_0xc7d6('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc7d6('0x18')][_0xc7d6('0x19')]=function(_0x596e9d){this[_0xc7d6('0x1a')]=this[_0xc7d6('0x1a')]?this[_0xc7d6('0x1a')][_0xc7d6('0x1b')](_0x596e9d):_0x596e9d();};function Dialer(_0x420117,_0x2a1778){this[_0xc7d6('0x1c')]=new Sequence();this[_0xc7d6('0x1d')]=_0x2a1778;this[_0xc7d6('0x1e')]=_0x420117[_0xc7d6('0x1e')];this['campaigns']=_0x420117['campaigns'];this[_0xc7d6('0x1f')]=_0x420117[_0xc7d6('0x1f')];this['trunks']=_0x420117[_0xc7d6('0x20')];this[_0xc7d6('0x21')]=config[_0xc7d6('0x21')]||0x2;this['channels']={};this['actions']={};this[_0xc7d6('0x22')]={};this[_0xc7d6('0x23')]={};this[_0xc7d6('0x24')]={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0xc7d6('0x25')]={};this[_0xc7d6('0x26')]={};this[_0xc7d6('0x27')]={};ami['on']('agentconnect',this[_0xc7d6('0x28')]['bind'](this));ami['on']('queuecallerabandon',this[_0xc7d6('0x29')]['bind'](this));ami['on'](_0xc7d6('0x2a'),this['syncOriginateResponse'][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x2c'),this[_0xc7d6('0x2d')][_0xc7d6('0x2b')](this));ami['on']('custom:queuesummary',this[_0xc7d6('0x8')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x2e'),this[_0xc7d6('0x2f')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x30'),this[_0xc7d6('0x31')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x32'),this[_0xc7d6('0x33')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x34'),this[_0xc7d6('0x35')][_0xc7d6('0x2b')](this));ami['on']('queuemember',this[_0xc7d6('0x36')][_0xc7d6('0x2b')](this));ami['on'](_0xc7d6('0x37'),this['syncQueueStatusComplete'][_0xc7d6('0x2b')](this));this[_0xc7d6('0x38')]();this[_0xc7d6('0x39')]();RpcSetting[_0xc7d6('0x3a')]()[_0xc7d6('0x3b')](function(_0x2ce2ea){previewRecallmeReminderInterval=_0x2ce2ea[_0xc7d6('0x3c')];});}function isNotNull(_0x4b5aec){return _0x4b5aec!==null&&!_[_0xc7d6('0x3d')](_0x4b5aec);}function msgResponse(_0x1c3cee,_0x280fa9,_0x5ecfcf){return{'action':_0x1c3cee,'response':_0x280fa9,'message':_0x5ecfcf,'stack':_0x5ecfcf};}function emit(_0x13d46c,_0xa63c26,_0x5a1d85){io['to'](_0x13d46c)[_0xc7d6('0x3e')](_0xa63c26,_0x5a1d85);}function emitOutboundVoiceQueueSummary(_0x5f29b9){if(_0x5f29b9['type']==='outbound'){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xc7d6('0x3f')](_0x5f29b9,{'showHidden':![],'depth':null}));emit(util[_0xc7d6('0x40')](_0xc7d6('0x41'),_0x5f29b9['name']),_0xc7d6('0x42'),_0x5f29b9);}}function checkGetDataPredictive(_0x1cb095){if(isNotNull(_0x1cb095)&&!_['isEmpty'](_0x1cb095)){loggerPredictive['info'](_0xc7d6('0x43'));loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x45'),_0x1cb095[_0xc7d6('0x46')]);loggerPredictive['info'](_0xc7d6('0x47'),_0x1cb095[_0xc7d6('0x48')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x49'),_0x1cb095[_0xc7d6('0x4a')]);loggerPredictive['info'](_0xc7d6('0x4b'),_0x1cb095[_0xc7d6('0x4c')]);loggerPredictive[_0xc7d6('0x44')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1cb095[_0xc7d6('0x4d')]);loggerPredictive['info'](_0xc7d6('0x4e'),_0x1cb095[_0xc7d6('0x4f')]);loggerPredictive[_0xc7d6('0x44')]('---------------------------');if(_0x1cb095[_0xc7d6('0x46')]>0x0){if(!_[_0xc7d6('0x3d')](_0x1cb095[_0xc7d6('0x4f')])&&_0x1cb095[_0xc7d6('0x4f')]>0x0){return!![];}loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x50'));if(!_['isUndefined'](_0x1cb095[_0xc7d6('0x4d')])&&_0x1cb095[_0xc7d6('0x4d')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x51'));}}else{loggerPredictive[_0xc7d6('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xb37e3a){return function(_0x5725b4){loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x52'));loggerPredictive['info'](_0xc7d6('0x53'),_0x5725b4[_0xc7d6('0x54')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x55'),_0x5725b4[_0xc7d6('0x56')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x57'),_0x5725b4[_0xc7d6('0x58')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x59'),_0x5725b4['erlangBusyFactor']);loggerPredictive['info'](_0xc7d6('0x57'),_0x5725b4[_0xc7d6('0x58')]);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x5a'));_[_0xc7d6('0x5b')](_0xb37e3a,_0x5725b4);};}function ifInterval(_0x5eeedf,_0x5091e9){if(_[_0xc7d6('0x3d')](_0x5091e9)){return![];}return utils[_0xc7d6('0x5c')](undefined,_0x5091e9)<_0x5eeedf*0x3c;}function clearPredictiveAttributes(_0x37b57b){if(_0x37b57b['startProgressive']){_0x37b57b[_0xc7d6('0x5d')]=undefined;loggerPredictive['debug'](_0x37b57b[_0xc7d6('0x5e')],_0xc7d6('0x5f'));}if(_0x37b57b[_0xc7d6('0x60')]){_0x37b57b[_0xc7d6('0x60')]=undefined;loggerPredictive[_0xc7d6('0x61')](_0x37b57b[_0xc7d6('0x5e')],_0xc7d6('0x62'));}if(_0x37b57b[_0xc7d6('0x63')]){clearInterval(_0x37b57b[_0xc7d6('0x63')]);_0x37b57b[_0xc7d6('0x63')]=undefined;loggerPredictive[_0xc7d6('0x61')](_0x37b57b[_0xc7d6('0x5e')],_0xc7d6('0x64'));}}function loggerCatchPredictive(_0x50a7e8,_0x12e7db){return function(_0x5e5b01){loggerPredictive[_0xc7d6('0x65')](_0x12e7db[_0xc7d6('0x5e')],_0x50a7e8);loggerPredictive[_0xc7d6('0x65')](_0x5e5b01[_0xc7d6('0x66')]);clearPredictiveAttributes(_0x12e7db);};}function loggerCatch(_0x1f0234){return function(_0x5b67f1){logger[_0xc7d6('0x65')](_0x1f0234,util[_0xc7d6('0x3f')](_0x5b67f1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x53fab1,_0x1a2b92,_0x47a127){return function(_0x13945e){utils['checkContactLowerLimitOriginate'](_0x1a2b92,_0x47a127,0x0);logger[_0xc7d6('0x65')](_0x53fab1,util[_0xc7d6('0x3f')](_0x13945e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x404332){return function(_0x25a199){if(isNotNull(_0x25a199)&&isNotNull(_0x25a199[0x0])){if(_0x25a199[0x0][_0xc7d6('0x67')]>0x0){_0x404332[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x6a')];logger[_0xc7d6('0x44')](_0xc7d6('0x6b')+_0x404332[_0xc7d6('0x5e')],_0x25a199[0x0]['contactsRescheduled'],_0xc7d6('0x6c'));}else{_0x404332['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x6d')];logger['info'](_0xc7d6('0x6e')+_0x404332[_0xc7d6('0x5e')]);}}};}function createObjHistory(_0x60dc11,_0xd87625,_0x1f948f,_0x321916,_0x10e33b){_0x60dc11[_0xc7d6('0x68')]=_0x1f948f;var _0x3233ec=new Action(_0x60dc11,_0xd87625);var _0x39ad91=new History(_0x3233ec);_0x39ad91[_0xc7d6('0x6f')]=_0x321916;_0x39ad91[_0xc7d6('0x70')]=_0x10e33b;_0x39ad91[_0xc7d6('0x71')]=_0x3233ec[_0xc7d6('0x72')];return _0x39ad91;}function unlockQueueStatus(_0x5ca39d,_0x5c0db2){setTimeout(function(){if(_[_0xc7d6('0x3d')](_0x5ca39d[_0xc7d6('0x73')])){loggerBooked[_0xc7d6('0x65')](_0xc7d6('0x74'),_0x5c0db2);}_0x5ca39d[_0xc7d6('0x73')]=!![];loggerBooked[_0xc7d6('0x44')](_0xc7d6('0x75'),_0x5c0db2,JSON[_0xc7d6('0x76')](_[_0xc7d6('0x77')](_0x5ca39d,[_0xc7d6('0x5e'),_0xc7d6('0x73')])));},0x1f3);}function checkInterval(_0x366281){return function(){if(!isNotNull(_0x366281['Interval'])){_0x366281['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x78')];throw _0x366281[_0xc7d6('0x5e')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x366281[_0xc7d6('0x79')]['Intervals'])){_0x366281[_0xc7d6('0x68')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x366281[_0xc7d6('0x5e')]+_0xc7d6('0x7a');}if(!isNotNull(_[_0xc7d6('0x7b')](_0x366281['Interval']['Intervals']))){_0x366281[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x78')];throw _0x366281[_0xc7d6('0x5e')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x5c0f53){return function(){if(!utils[_0xc7d6('0x7c')](_0x5c0f53)){_0x5c0f53[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x7d')];throw _0x5c0f53['name']+'\x20NOT\x20Active';}};}function emitCampaignSummary(_0xce2ec8){if(utils[_0xc7d6('0x7e')](_0xce2ec8)){emit(util[_0xc7d6('0x40')](_0xc7d6('0x7f'),_0xce2ec8[_0xc7d6('0x5e')]),'campaign:save',_0xce2ec8);}}function loggerCatchQueueSummary(_0x12f3f7,_0x1a0fce){return function(_0x5d543d){clearPredictiveAttributes(_0x1a0fce);emitCampaignSummary(_0x1a0fce);loggerSyncQueueSummary[_0xc7d6('0x61')](_0x12f3f7,util[_0xc7d6('0x3f')](_0x5d543d,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1c18c1){if(_0x1c18c1[_0xc7d6('0x80')]){if(_0x1c18c1[_0xc7d6('0x81')]===0x0){_0x1c18c1['sendMessageOneNotActive']=![];_0x1c18c1[_0xc7d6('0x68')]=utils['CAMPAIGN_STATUS'][_0xc7d6('0x7d')];loggerSyncQueueSummary[_0xc7d6('0x61')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1c18c1['name'],_0xc7d6('0x82'));}else{_0x1c18c1['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x83')];loggerSyncQueueSummary[_0xc7d6('0x61')](_0xc7d6('0x84'),_0x1c18c1[_0xc7d6('0x5e')],_0xc7d6('0x85'));}emitCampaignSummary(_0x1c18c1);}}function myreject(_0xf2ac70){return function(_0x56bfa6){return _0xf2ac70(msgResponse('[ifTime][Action]',_0xc7d6('0x86'),JSON[_0xc7d6('0x76')](_0x56bfa6)));};}Dialer[_0xc7d6('0x18')][_0xc7d6('0x87')]=function(_0x93c126){return!_['isUndefined'](_0x93c126)&&_0x93c126&&!_[_0xc7d6('0x3d')](_0x93c126[_0xc7d6('0x5e')])&&!_[_0xc7d6('0x3d')](_0x93c126[_0xc7d6('0x88')])&&_0x93c126[_0xc7d6('0x88')]&&(this['trunks'][util[_0xc7d6('0x40')](_0xc7d6('0x89'),_0x93c126[_0xc7d6('0x5e')])][_0xc7d6('0x8a')]==='reachable'||this[_0xc7d6('0x20')][util[_0xc7d6('0x40')](_0xc7d6('0x89'),_0x93c126['name'])][_0xc7d6('0x8a')]==='unmonitored');};Dialer['prototype'][_0xc7d6('0x8b')]=function(_0x595c34){var _0x384ebf=this;return function(){if(!_0x384ebf[_0xc7d6('0x87')](_0x595c34['Trunk'])){if(!_0x384ebf[_0xc7d6('0x87')](_0x595c34[_0xc7d6('0x8c')])){_0x595c34['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x8d')];throw _0x595c34[_0xc7d6('0x5e')]+_0xc7d6('0x8e');}}};};Dialer['prototype'][_0xc7d6('0x8f')]=function(_0x107717,_0x3fcb74,_0x2e8853,_0x19aaa4){var _0x66943d=this;return function(){var _0x45dbbf=!![];return _0x66943d['ifTimeIvr'](_0x107717,_0x3fcb74,_0x2e8853,_0x19aaa4,_0x45dbbf);};};Dialer[_0xc7d6('0x18')]['checkIfTimeIntervals']=function(_0x13abb8,_0x5650b3,_0xad5d06,_0x10c647){var _0x182809=this;return function(){var _0x325165=![];return _0x182809[_0xc7d6('0x90')](_0x13abb8[_0xc7d6('0x91')],_0x5650b3,_0xad5d06,_0x10c647,_0x325165);};};Dialer[_0xc7d6('0x18')][_0xc7d6('0x90')]=function(_0x70bc20,_0x532dff,_0x2be3ba,_0x54e0d5,_0x3ff404){var _0x3854af=[];return new Promise(function(_0x76a071,_0x5d9f55){if(!isNotNull(_0x70bc20)){_0x54e0d5[_0xc7d6('0x68')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];return _0x5d9f55(msgResponse(_0xc7d6('0x92'),'Failure',_0x2be3ba+_0xc7d6('0x93')));}if(_[_0xc7d6('0x7b')](_0x70bc20)){_0x54e0d5[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x94')];return _0x5d9f55(msgResponse(_0xc7d6('0x92'),'Failure',_0x2be3ba+'\x20Intervals\x20is\x20empty\x20'));}if(_0x532dff&&_[_0xc7d6('0x3d')](config['timezones'][_0x532dff])){_0x54e0d5[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')][_0xc7d6('0x95')];return _0x5d9f55(msgResponse(_0xc7d6('0x92'),_0xc7d6('0x96'),_0x2be3ba+_0xc7d6('0x97')+_0x532dff));}if(_[_0xc7d6('0x98')](_0x70bc20)){for(var _0x417cb5=0x0;_0x417cb5<_0x70bc20[_0xc7d6('0x99')];_0x417cb5+=0x1){_0x3854af[_0xc7d6('0x9a')](ami[_0xc7d6('0x9b')]({'action':_0xc7d6('0x9c'),'command':util[_0xc7d6('0x40')]('iftime\x20%s,%s',_0x70bc20[_0x417cb5][_0xc7d6('0x9d')],!_[_0xc7d6('0x3d')](config[_0xc7d6('0x9e')][_0x532dff])?_0x532dff:'')})[_0xc7d6('0x3b')](function(_0x89722e){return _0x89722e['content'][_0xc7d6('0x9f')](_0xc7d6('0xa0'))>=0x0;})[_0xc7d6('0xa1')](myreject(_0x5d9f55)));}}else{_0x3854af['push'](ami['Action']({'action':_0xc7d6('0x9c'),'command':util[_0xc7d6('0x40')](_0xc7d6('0xa2'),_0x70bc20,!_[_0xc7d6('0x3d')](config[_0xc7d6('0x9e')][_0x532dff])?_0x532dff:'')})['then'](function(_0x4f741b){return _0x4f741b[_0xc7d6('0xa3')][_0xc7d6('0x9f')](_0xc7d6('0xa0'))>=0x0;})[_0xc7d6('0xa1')](myreject(_0x5d9f55)));}Promise[_0xc7d6('0xa4')](_0x3854af)['then'](function(_0x3d9a01){var _0x3fa7e1=_[_0xc7d6('0xa5')](_0x3d9a01);if(_0x3fa7e1){return _0x76a071(_0x3fa7e1);}else{_0x54e0d5[_0xc7d6('0x68')]=_0x3ff404?utils['CAMPAIGN_STATUS'][_0xc7d6('0xa6')]:utils[_0xc7d6('0x69')][_0xc7d6('0xa7')];return _0x5d9f55(msgResponse(_0xc7d6('0xa8'),_0xc7d6('0x96'),_0xc7d6('0xa9')+_0x3ff404+'\x20'+_0x2be3ba+_0xc7d6('0xaa')+util['inspect'](_0x70bc20,{'showHidden':![],'depth':null})+_0xc7d6('0xab')+_0x532dff));}})[_0xc7d6('0xa1')](function(_0x4d12b8){return _0x5d9f55(msgResponse(_0xc7d6('0x92'),_0xc7d6('0x96'),JSON[_0xc7d6('0x76')](_0x4d12b8)));});});};Dialer[_0xc7d6('0x18')]['loopCampaigns']=function(){var _0x4e3710=this;return cmHopper[_0xc7d6('0xac')]({'active':![]},{'where':{'active':!![]}})[_0xc7d6('0x3b')](function(){setInterval(function(){_0x4e3710[_0xc7d6('0xad')]();},0x3e8);});};Dialer[_0xc7d6('0x18')]['syncCampaigns']=function(){var _0x312271=this;var _0x275566;for(var _0x202d4f in this['campaigns']){if(typeof this[_0xc7d6('0xae')][_0x202d4f]!==_0xc7d6('0xaf')){_0x275566=this['campaigns'][_0x202d4f];if(utils[_0xc7d6('0x7e')](_0x275566)&&utils[_0xc7d6('0x7c')](_0x275566)){_0x275566['sendMessageOneNotActive']=!![];Promise[_0xc7d6('0xb0')]()['then'](checkIsIVRCampaignActive(_0x275566))['then'](checkInterval(_0x275566))[_0xc7d6('0x3b')](_0x312271[_0xc7d6('0x8b')](_0x275566))[_0xc7d6('0x3b')](_0x312271[_0xc7d6('0x8f')](_0x275566[_0xc7d6('0xb1')],_0x275566[_0xc7d6('0xb2')],_0x275566[_0xc7d6('0x5e')],_0x275566))[_0xc7d6('0x3b')](_0x312271[_0xc7d6('0xb3')](_0x275566[_0xc7d6('0x79')],_0x275566[_0xc7d6('0xb2')],_0x275566[_0xc7d6('0x5e')],_0x275566))['then'](_0x312271[_0xc7d6('0xb4')](_0x275566))[_0xc7d6('0xa1')](loggerCatchQueueSummary(_0xc7d6('0xb5'),_0x275566));}else{notSendMessagesCampaign(_0x275566);}}}};Dialer['prototype']['checkDialMethod']=function(_0x21826c){if(_0x21826c[_0xc7d6('0xb6')]!==_0xc7d6('0xb7')){clearPredictiveAttributes(_0x21826c);}switch(_0x21826c['dialMethod']){case'progressive':this['handlePower'](_0x21826c,0x1);break;case _0xc7d6('0xb8'):this[_0xc7d6('0xb9')](_0x21826c,_0x21826c[_0xc7d6('0xba')]);break;case'predictive':this[_0xc7d6('0xb7')](_0x21826c);break;case'booked':this[_0xc7d6('0xb9')](_0x21826c,0x1);break;default:logger[_0xc7d6('0x65')]('Queue',_0x21826c[_0xc7d6('0x5e')],_0xc7d6('0xbb'));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x92')]=function(_0x3f1be4,_0x3a273f){var _0x130d5a=_0x3f1be4[_0xc7d6('0xb2')];var _0x3f3c9b=_0x3a273f?_0x3f1be4[_0xc7d6('0xb1')]:_0x3f1be4[_0xc7d6('0x79')][_0xc7d6('0x91')];logger[_0xc7d6('0xbc')](_0xc7d6('0xbd'),_0x3f3c9b,_0x130d5a,_0x3f1be4[_0xc7d6('0x5e')],util[_0xc7d6('0x40')](_0xc7d6('0xbe'),_0x3f1be4[_0xc7d6('0x5e')],_0x3f1be4['id']));var _0x5c31ca=null;return Interval['intervalIftime'](_0x3f3c9b,_0x130d5a)['then'](function(_0x5135d5){if(_0x5135d5===!![]){return _0x5135d5;}else{_0x3f1be4[_0xc7d6('0x68')]=_0x3a273f?utils[_0xc7d6('0x69')][_0xc7d6('0xa6')]:utils[_0xc7d6('0x69')][_0xc7d6('0xa7')];_0x5c31ca=msgResponse(_0xc7d6('0xa8'),_0xc7d6('0x96'),_0xc7d6('0xa9')+_0x3a273f+'\x20'+_0x3f1be4[_0xc7d6('0x5e')]+_0xc7d6('0xaa')+util[_0xc7d6('0x3f')](_0x3f3c9b,{'showHidden':![],'depth':null})+_0xc7d6('0xab')+_0x130d5a);}if(_0x5c31ca!==null){logger['silly'](_0xc7d6('0xbf'),_0x5c31ca);_0x5c31ca[_0xc7d6('0xc0')]=_0x3a273f;throw _0x5c31ca;}})[_0xc7d6('0xa1')](function(_0x427430){logger[_0xc7d6('0x65')](_0xc7d6('0xc1'),_0x427430);throw msgResponse('[ifTime][Action]',_0xc7d6('0x86'),util[_0xc7d6('0x3f')](_0x427430,{'showHidden':![],'depth':null}));});};Dialer[_0xc7d6('0x18')][_0xc7d6('0x28')]=function(_0x46a7c9){if(this['voiceQueues'][_0x46a7c9['queue']]){if(this['uniqueId'][_0x46a7c9[_0xc7d6('0xc2')]]&&this['uniqueId'][_0x46a7c9[_0xc7d6('0xc2')]][_0xc7d6('0xc3')]!==_0xc7d6('0xc4')){this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x46a7c9[_0xc7d6('0xc6')]]);this[_0xc7d6('0x23')][_0x46a7c9[_0xc7d6('0xc2')]][_0xc7d6('0xc7')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x2d')]=function(_0x26acc5){var _0x1b927b=this[_0xc7d6('0x23')][_0x26acc5['uniqueid']];if(this['voiceQueues'][_0x26acc5[_0xc7d6('0xc6')]]){if(_0x1b927b&&_0x1b927b['type']!=='ivr'){delete this[_0xc7d6('0x23')][_0x26acc5[_0xc7d6('0xc2')]];this[_0xc7d6('0x1e')][_0x26acc5[_0xc7d6('0xc6')]][_0xc7d6('0xc9')]+=0x1;var _0x1ed6b5=new AgentComplete(_0x1b927b,_0x26acc5);if(_0x26acc5[_0xc7d6('0xca')]===_0xc7d6('0xcb')){_0x1ed6b5[_0xc7d6('0xcc')]=this[_0xc7d6('0x1e')][_0x26acc5['queue']]['dialQueueProject2']&&this[_0xc7d6('0x1e')][_0x26acc5['queue']]['dialAgiAfterHangupAgent']?moment()[_0xc7d6('0x40')](_0xc7d6('0xc8')):undefined;}hopperUtils[_0xc7d6('0xcd')](_0x1ed6b5)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0xc7d6('0xce')](_0x1ed6b5)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x4c598){var _0x51d220=this[_0xc7d6('0x23')][_0x4c598[_0xc7d6('0xc2')]];var _0x85c3b4=this;var _0x1f754a=![];var _0x2eb90f;var _0x365442;if(this[_0xc7d6('0x1e')][_0x4c598['queue']]){if(_0x51d220&&_0x51d220['type']!=='ivr'){delete this['uniqueId'][_0x4c598[_0xc7d6('0xc2')]];this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]]);_0x51d220[_0xc7d6('0xcf')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));var _0x4cbf4d=new QueueCallerAbandon(_0x51d220,_0x4c598);if(utils[_0xc7d6('0x5c')](_0x51d220[_0xc7d6('0xcf')],_0x51d220[_0xc7d6('0xd0')])>=_0x51d220[_0xc7d6('0xd1')]){this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0x4a')]+=0x1;this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xd2')]+=0x1;this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xd3')]+=0x1;_0x4cbf4d[_0xc7d6('0x6f')]=0xa;_0x4cbf4d[_0xc7d6('0x70')]=_0xc7d6('0xd4');_0x4cbf4d[_0xc7d6('0xd5')]=_0xc7d6('0xd6');_0x4cbf4d[_0xc7d6('0xcc')]=this['voiceQueues'][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xd7')]?moment()[_0xc7d6('0x40')](_0xc7d6('0xc8')):undefined;_0x4cbf4d[_0xc7d6('0xd8')]+=0x1;_0x4cbf4d[_0xc7d6('0xd9')]+=0x1;_0x2eb90f=this[_0xc7d6('0x1e')][_0x4c598['queue']]['dialDropRetryFrequency'];_0x365442=this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xdb')](_0x4cbf4d,_0x4cbf4d[_0xc7d6('0x6f')],_0x51d220[_0xc7d6('0xdc')])['then'](function(_0x4a77ea){_0x1f754a=_0x4a77ea[_0xc7d6('0xdd')]==0x1;if(_0x4cbf4d[_0xc7d6('0xd8')]>=_0x85c3b4[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xde')]){_0x85c3b4['queueCallerAbandonCreateState'](_0x4cbf4d,_0x4a77ea[_0xc7d6('0xdd')]);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x4cbf4d[_0xc7d6('0xd8')],'scheduledat':moment()[_0xc7d6('0xdf')](_0x85c3b4['voiceQueues'][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xe0')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x51d220['ContactId'],'ListId':_0x51d220[_0xc7d6('0xe2')],'VoiceQueueId':_0x51d220['VoiceQueueId']||undefined,'CampaignId':_0x51d220[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0xe4')));var _0x4b55ad=new History(_0x4cbf4d);_0x4b55ad[_0xc7d6('0x6f')]=0xa;_0x4b55ad[_0xc7d6('0x70')]=_0xc7d6('0xd4');_0x4b55ad[_0xc7d6('0x72')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));_0x4b55ad[_0xc7d6('0x71')]=_0x4b55ad[_0xc7d6('0x72')];_0x4b55ad['calleridname']=_0x4cbf4d[_0xc7d6('0xe5')];_0x4b55ad[_0xc7d6('0xe6')]=_0x4cbf4d[_0xc7d6('0xe6')];hopperUtils[_0xc7d6('0xcd')](_0x4b55ad)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0xe7')));}})[_0xc7d6('0x3b')](function(){if(_0x1f754a)hopperUtils[_0xc7d6('0xe8')](_0x4cbf4d,_0x2eb90f,_0x365442)['then'](function(){return 0x1;});});}else{this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0x4c')]+=0x1;this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]]['outboundDropCallsDayCallersExit']+=0x1;_0x4cbf4d['state']=0xb;_0x4cbf4d[_0xc7d6('0x70')]=_0xc7d6('0xe9');_0x4cbf4d['dropreason']=_0xc7d6('0xea');_0x4cbf4d[_0xc7d6('0xeb')]+=0x1;_0x4cbf4d[_0xc7d6('0xd9')]+=0x1;_0x2eb90f=this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xec')];_0x365442=this[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]][_0xc7d6('0xda')];hopperUtils['verifyAdditionalPhones'](_0x4cbf4d,_0x4cbf4d[_0xc7d6('0x6f')],_0x51d220[_0xc7d6('0xdc')])[_0xc7d6('0x3b')](function(_0x532d48){if(_0x4cbf4d[_0xc7d6('0xeb')]>=_0x85c3b4[_0xc7d6('0x1e')][_0x4c598['queue']][_0xc7d6('0xed')]){_0x85c3b4[_0xc7d6('0xee')](_0x4cbf4d,_0x532d48[_0xc7d6('0xdd')]);}else{hopperUtils[_0xc7d6('0xef')]({'active':![],'countabandonedretry':_0x4cbf4d[_0xc7d6('0xeb')],'scheduledat':moment()[_0xc7d6('0xdf')](_0x85c3b4[_0xc7d6('0x1e')][_0x4c598[_0xc7d6('0xc6')]]['dialAbandonedRetryFrequency'],'minutes')[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x51d220[_0xc7d6('0xf0')],'ListId':_0x51d220[_0xc7d6('0xe2')],'VoiceQueueId':_0x51d220[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x51d220[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0xf2')));var _0x36f9d5=new History(_0x4cbf4d);_0x36f9d5[_0xc7d6('0x6f')]=0xb;_0x36f9d5['statedesc']=_0xc7d6('0xe9');_0x36f9d5['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x36f9d5[_0xc7d6('0x71')]=_0x36f9d5[_0xc7d6('0x72')];_0x36f9d5[_0xc7d6('0xe5')]=_0x4cbf4d['calleridname'];_0x36f9d5[_0xc7d6('0xe6')]=_0x4cbf4d['calleridnum'];hopperUtils[_0xc7d6('0xcd')](_0x36f9d5)['catch'](loggerCatch(_0xc7d6('0xf3')));}})[_0xc7d6('0x3b')](function(){if(_0x1f754a)hopperUtils[_0xc7d6('0xe8')](_0x4cbf4d,_0x2eb90f,_0x365442)['then'](function(){return 0x1;});});}}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x33')]=function(_0x1e10bb){if(this['actions'][_0x1e10bb['uniqueid']]){this[_0xc7d6('0xf4')][_0x1e10bb[_0xc7d6('0xc2')]][_0xc7d6('0xf5')]=_0x1e10bb[_0xc7d6('0xf5')];}if(this[_0xc7d6('0x23')][_0x1e10bb['uniqueid']]){this[_0xc7d6('0x23')][_0x1e10bb[_0xc7d6('0xc2')]]['channel']=_0x1e10bb['channel'];}};Dialer['prototype'][_0xc7d6('0x36')]=function(_0x1bda04){if(!this[_0xc7d6('0xf4')][_0x1bda04['actionid']]){return;}var _0x437b46=this['voiceQueues'][this['actions'][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0xf7')]||'rrmemory';if(_0x437b46===_0xc7d6('0xf8')){if(this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]&&_[_0xc7d6('0xf9')](this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]['locked'])&&_0x1bda04[_0xc7d6('0x8a')]==='1'&&_0x1bda04[_0xc7d6('0xfa')]==='0'){if(this[_0xc7d6('0x1f')][_0x1bda04['stateinterface']]){if(!this['agents'][_0x1bda04[_0xc7d6('0xfb')]][_0xc7d6('0xfc')]){this[_0xc7d6('0x1f')][_0x1bda04[_0xc7d6('0xfb')]][_0xc7d6('0xfc')]=!![];this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xfc')]=!![];this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]['stateinterface']=_0x1bda04['stateinterface'];}}}}else if(_0x437b46===_0xc7d6('0xfd')){if(this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]){if(this[_0xc7d6('0x1f')][_0x1bda04['stateinterface']]){this[_0xc7d6('0xf4')][_0x1bda04['actionid']][_0xc7d6('0xfb')]=_0x1bda04[_0xc7d6('0xfb')];if(_[_0xc7d6('0xf9')](this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]]['queue']])){this[_0xc7d6('0x25')][this['actions'][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]=[];}this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x9a')](_[_0xc7d6('0x5b')](_['pick'](this[_0xc7d6('0xf4')][_0x1bda04[_0xc7d6('0xf6')]],[_0xc7d6('0xfe'),'stateinterface']),{'status':_0x1bda04['status'],'paused':_0x1bda04[_0xc7d6('0xfa')]}));}}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0xff')]=function(_0x329bbe){if(!this[_0xc7d6('0xf4')][_0x329bbe['actionid']]){return;}var _0x473376=this;var _0xeaafdb=this[_0xc7d6('0x1e')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]];var _0x45092b=_0xeaafdb['strategy']||'rrmemory';if(_0x45092b===_0xc7d6('0xf8')){if(this['actions'][_0x329bbe[_0xc7d6('0xf6')]]&&this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]]['stateinterface']){this[_0xc7d6('0x1d')]['run'](this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xfe')],this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xfb')])[_0xc7d6('0xa1')](function(_0xa864f8){logger[_0xc7d6('0x65')](_0xc7d6('0x100'),util[_0xc7d6('0x3f')](_0xa864f8,{'showHidden':![],'depth':null}));})[_0xc7d6('0x1b')](function(){_0x473376[_0xc7d6('0xc5')](_0x473376[_0xc7d6('0x1e')][_0x473376[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);_0x473376[_0xc7d6('0x1f')][_0x473376['actions'][_0x329bbe['actionid']]['stateinterface']][_0xc7d6('0xfc')]=![];delete _0x473376[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]];unlockQueueStatus(_0xeaafdb);});}else{this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xf0')],'ListId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xe2')],'VoiceQueueId':this[_0xc7d6('0xf4')][_0x329bbe['actionid']]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x329bbe[_0xc7d6('0xf6')]]['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x101')));delete this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]];unlockQueueStatus(_0xeaafdb);}}else if(_0x45092b===_0xc7d6('0xfd')){var _0x5be598;if(this[_0xc7d6('0xf4')][_0x329bbe['actionid']]&&!_['isEmpty'](this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x329bbe['actionid']][_0xc7d6('0xc6')]])){if(this[_0xc7d6('0x26')][_0x473376[_0xc7d6('0xf4')][_0x329bbe['actionid']][_0xc7d6('0xc6')]]){this[_0xc7d6('0x26')][_0x473376[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]=this[_0xc7d6('0x26')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]]['queue']]?this[_0xc7d6('0x26')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]:this[_0xc7d6('0x25')][this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]?this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x102')]||0x0:0x0;}this[_0xc7d6('0x25')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x102')]=this[_0xc7d6('0x26')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]];for(var _0x16c7f7=0x0;_0x16c7f7<this['queueBooked'][this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]][_0xc7d6('0x99')];_0x16c7f7+=0x1){_0x5be598=rr(this['queueBooked'][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);this[_0xc7d6('0x26')][_0x473376[_0xc7d6('0xf4')][_0x329bbe['actionid']]['queue']]=this[_0xc7d6('0x25')][this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]['_rr'];if(_0x5be598['status']==='1'&&_0x5be598[_0xc7d6('0xfa')]==='0'){break;}}if(!_[_0xc7d6('0xf9')](_0x5be598)){this['agents'][_0x5be598[_0xc7d6('0xfb')]]['unlockRR']=_[_0xc7d6('0x3d')](this['agents'][_0x5be598['stateinterface']][_0xc7d6('0x103')])?!![]:this[_0xc7d6('0x1f')][_0x5be598['stateinterface']][_0xc7d6('0x103')];}loggerBooked['info'](_0xc7d6('0x104'),_0x329bbe[_0xc7d6('0xf6')],_0xc7d6('0x105'),JSON[_0xc7d6('0x76')](_[_0xc7d6('0x77')](this[_0xc7d6('0x1f')][_0x5be598[_0xc7d6('0xfb')]],['name','unlockRR'])),_0xc7d6('0x106'),JSON['stringify'](_0x5be598[_0xc7d6('0xfe')]));if(!_[_0xc7d6('0xf9')](_0x5be598)&&_0x5be598[_0xc7d6('0x8a')]==='1'&&_0x5be598['paused']==='0'&&this[_0xc7d6('0x1f')][_0x5be598['stateinterface']][_0xc7d6('0x103')]){this[_0xc7d6('0x1f')][_0x5be598[_0xc7d6('0xfb')]][_0xc7d6('0x103')]=![];this[_0xc7d6('0x25')][_0x473376['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]=[];this['preview']['run'](_0x5be598[_0xc7d6('0xfe')],_0x5be598[_0xc7d6('0xfb')])[_0xc7d6('0xa1')](function(_0x1a29c2){logger[_0xc7d6('0x65')](_0xc7d6('0x100'),util['inspect'](_0x1a29c2,{'showHidden':![],'depth':null}));})[_0xc7d6('0x1b')](function(){_0x473376[_0xc7d6('0xc5')](_0x473376[_0xc7d6('0x1e')][_0x473376['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);setTimeout(function(){_0x473376[_0xc7d6('0x1f')][_0x5be598[_0xc7d6('0xfb')]][_0xc7d6('0x103')]=!![];loggerBooked['info']('[booked][RR][finaly]',_0x329bbe['actionid'],_0xc7d6('0x105'),JSON[_0xc7d6('0x76')](_[_0xc7d6('0x77')](_0x473376[_0xc7d6('0x1f')][_0x5be598['stateinterface']],[_0xc7d6('0x5e'),_0xc7d6('0x103')])),_0xc7d6('0x106'),JSON[_0xc7d6('0x76')](_0x5be598[_0xc7d6('0xfe')]));},0xc7);delete _0x473376['actions'][_0x329bbe['actionid']];unlockQueueStatus(_0xeaafdb,_0x329bbe['actionid']);});}else{loggerBooked['info'](_0xc7d6('0x107'));this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xf0')],'ListId':this[_0xc7d6('0xf4')][_0x329bbe['actionid']][_0xc7d6('0xe2')],'VoiceQueueId':this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xf1')]||undefined,'CampaignId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]];unlockQueueStatus(_0xeaafdb);}}else{loggerBooked['info'](_0xc7d6('0x108'));this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':this['actions'][_0x329bbe['actionid']]['ContactId'],'ListId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]]['ListId'],'VoiceQueueId':this['actions'][_0x329bbe[_0xc7d6('0xf6')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x329bbe['actionid']][_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x109')));delete this[_0xc7d6('0xf4')][_0x329bbe['actionid']];unlockQueueStatus(_0xeaafdb);}}else{loggerBooked['info'](_0xc7d6('0x10a'));this[_0xc7d6('0xc5')](this['voiceQueues'][this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xc6')]]);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xf0')],'ListId':this['actions'][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xe2')],'VoiceQueueId':this[_0xc7d6('0xf4')][_0x329bbe[_0xc7d6('0xf6')]][_0xc7d6('0xf1')]||undefined,'CampaignId':this[_0xc7d6('0xf4')][_0x329bbe['actionid']][_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this['actions'][_0x329bbe[_0xc7d6('0xf6')]];unlockQueueStatus(_0xeaafdb);}};Dialer['prototype'][_0xc7d6('0x10b')]=function(_0xecde42){var _0x237d73=this[_0xc7d6('0xf4')][_0xecde42[_0xc7d6('0xf6')]];if(_0x237d73){delete this[_0xc7d6('0xf4')][_0xecde42[_0xc7d6('0xf6')]];_0x237d73['responsetime']=moment()['format'](_0xc7d6('0xc8'));var _0x4e18fe=_0x237d73['type']===_0xc7d6('0xc4')?this[_0xc7d6('0xae')][_0x237d73[_0xc7d6('0xc6')]]:this[_0xc7d6('0x1e')][_0x237d73[_0xc7d6('0x10c')]()];if(_0xecde42[_0xc7d6('0x10d')]!=='Success'){this['updateOriginated'](_0x4e18fe);return this[_0xc7d6('0x10e')](_0x237d73,_0x4e18fe,_0xecde42)['catch'](loggerCatch(_0xc7d6('0x10f')));}this[_0xc7d6('0x23')][_0xecde42[_0xc7d6('0xc2')]]=_0x237d73;}};Dialer['prototype'][_0xc7d6('0x35')]=function(_0x54f8b2){var _0x3db16d=this;var _0x103084=this[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];var _0x237300;if(!_[_0xc7d6('0xf9')](_0x54f8b2)&&!_[_0xc7d6('0xf9')](_0x54f8b2[_0xc7d6('0x110')])&&!_[_0xc7d6('0xf9')](_0x54f8b2['variable'][_0xc7d6('0x111')])&&_0x54f8b2[_0xc7d6('0x112')]===_0xc7d6('0x113')&&_0x103084){if(_0x103084[_0xc7d6('0xc3')]!==_0xc7d6('0xc4')&&this[_0xc7d6('0x1e')][_0x103084[_0xc7d6('0xc6')]]['dialAMDActive']&&_0x54f8b2[_0xc7d6('0x114')]===_0xc7d6('0x115')){delete this[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];this['updateOriginated'](this[_0xc7d6('0x1e')][_0x103084['queue']]);this[_0xc7d6('0x1e')][_0x103084['queue']][_0xc7d6('0xc9')]+=0x1;this[_0xc7d6('0x1e')][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0x116')]+=0x1;_0x237300=new Hangup(_0x103084,_0x54f8b2);_0x237300[_0xc7d6('0x6f')]=0x12;_0x237300[_0xc7d6('0x70')]=_0xc7d6('0x117');_0x237300[_0xc7d6('0x118')]=_0xc7d6('0x119');ami['emit'](_0xc7d6('0x11a'),ut[_0xc7d6('0x11b')](_0x237300,_0xc7d6('0x11c')));this[_0xc7d6('0x11d')](_0x237300,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0x103084[_0xc7d6('0xc3')]!==_0xc7d6('0xc4')&&this[_0xc7d6('0x1e')][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0x11e')]&&_0x54f8b2[_0xc7d6('0x114')]===_0xc7d6('0x11f')){return new Promise(function(_0x42a9e1,_0x5ab4f9){delete _0x3db16d[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];_0x3db16d[_0xc7d6('0xc5')](_0x3db16d[_0xc7d6('0x1e')][_0x103084['queue']]);_0x3db16d[_0xc7d6('0x1e')][_0x103084['queue']][_0xc7d6('0xc9')]+=0x1;_0x3db16d['voiceQueues'][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0x116')]+=0x1;var _0x138d0f=_0x3db16d['voiceQueues'][_0x103084[_0xc7d6('0xc6')]];var _0x355a16=new Hangup(_0x103084,_0x54f8b2);_0x355a16[_0xc7d6('0x6f')]=0x13;_0x355a16[_0xc7d6('0x70')]=_0xc7d6('0x120');_0x355a16[_0xc7d6('0x118')]='AMD';_0x355a16[_0xc7d6('0x121')]+=0x1;_0x355a16[_0xc7d6('0xd9')]+=0x1;_0x355a16[_0xc7d6('0x11c')]=!![];ami[_0xc7d6('0x3e')](_0xc7d6('0x11a'),ut[_0xc7d6('0x11b')](_0x355a16,_0xc7d6('0x11c')));hopperUtils[_0xc7d6('0xcd')](_0x355a16)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x355a16[_0xc7d6('0x122')]+_0x355a16[_0xc7d6('0x123')]+_0x355a16[_0xc7d6('0x124')]+_0x355a16[_0xc7d6('0x125')]+_0x355a16['countdropretry']+_0x355a16[_0xc7d6('0xeb')]+_0x355a16[_0xc7d6('0x121')]+_0x355a16[_0xc7d6('0x126')]>=_0x138d0f[_0xc7d6('0x127')]){_0x3db16d[_0xc7d6('0x128')](_0x355a16,_0x42a9e1,_0x5ab4f9,_0xc7d6('0x129'));}else{if(_0x355a16[_0xc7d6('0x121')]>=_0x138d0f['dialMachineMaxRetry']){_0x3db16d['createStateFinal'](_0x355a16,_0x42a9e1,_0x5ab4f9,_0xc7d6('0x12a'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x355a16['countmachineretry'],'scheduledat':moment()[_0xc7d6('0xdf')](_0x138d0f['dialMachineRetryFrequency'],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x355a16[_0xc7d6('0xf0')],'ListId':_0x355a16['ListId'],'VoiceQueueId':_0x355a16[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x355a16[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x12b')));_0x42a9e1({'reschedule':0x1});}}});}if(_0x103084['type']===_0xc7d6('0xc4')&&this[_0xc7d6('0xae')][_0x103084['queue']][_0xc7d6('0x11e')]&&_0x54f8b2[_0xc7d6('0x114')]==='HANGUP'){delete this[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];this['updateOriginated'](this[_0xc7d6('0xae')][_0x103084[_0xc7d6('0xc6')]]);_0x237300=new Hangup(_0x103084,_0x54f8b2);_0x237300[_0xc7d6('0x6f')]=0x12;_0x237300[_0xc7d6('0x70')]=_0xc7d6('0x117');_0x237300[_0xc7d6('0x118')]=_0xc7d6('0x119');ami['emit'](_0xc7d6('0x11a'),ut[_0xc7d6('0x11b')](_0x237300,_0xc7d6('0x11c')));this['saveInDb'](_0x237300,_0xc7d6('0x12c'),_0xc7d6('0x12d'));}if(_0x103084['type']===_0xc7d6('0xc4')&&this[_0xc7d6('0xae')][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0x11e')]&&_0x54f8b2[_0xc7d6('0x114')]===_0xc7d6('0x11f')){return new Promise(function(_0x30aaa3,_0x4236d1){delete _0x3db16d[_0xc7d6('0x23')][_0x54f8b2[_0xc7d6('0xc2')]];_0x3db16d[_0xc7d6('0xc5')](_0x3db16d['campaigns'][_0x103084['queue']]);_0x3db16d[_0xc7d6('0xae')][_0x103084[_0xc7d6('0xc6')]][_0xc7d6('0xc9')]+=0x1;_0x3db16d[_0xc7d6('0xae')][_0x103084['queue']][_0xc7d6('0x116')]+=0x1;var _0x4343e5=_0x3db16d['campaigns'][_0x103084[_0xc7d6('0xc6')]];var _0x4dc02e=new Hangup(_0x103084,_0x54f8b2);_0x4dc02e['state']=0x13;_0x4dc02e[_0xc7d6('0x70')]=_0xc7d6('0x120');_0x4dc02e[_0xc7d6('0x118')]=_0xc7d6('0x119');_0x4dc02e[_0xc7d6('0x121')]+=0x1;_0x4dc02e[_0xc7d6('0xd9')]+=0x1;_0x4dc02e[_0xc7d6('0x11c')]=!![];ami['emit'](_0xc7d6('0x11a'),ut[_0xc7d6('0x11b')](_0x4dc02e,'amd'));hopperUtils[_0xc7d6('0xcd')](_0x4dc02e)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x12e')));if(_0x4dc02e[_0xc7d6('0x122')]+_0x4dc02e[_0xc7d6('0x123')]+_0x4dc02e[_0xc7d6('0x124')]+_0x4dc02e[_0xc7d6('0x125')]+_0x4dc02e[_0xc7d6('0xd8')]+_0x4dc02e['countabandonedretry']+_0x4dc02e[_0xc7d6('0x121')]+_0x4dc02e['countagentrejectretry']>=_0x4343e5[_0xc7d6('0x127')]){_0x3db16d['stateGlobal'](_0x4dc02e,_0x30aaa3,_0x4236d1,'reason19\x20machine....');}else{if(_0x4dc02e[_0xc7d6('0x121')]>=_0x4343e5['dialMachineMaxRetry']){_0x3db16d[_0xc7d6('0x12f')](_0x4dc02e,_0x30aaa3,_0x4236d1,_0xc7d6('0x12a'));}else{hopperUtils[_0xc7d6('0xef')]({'active':![],'countmachineretry':_0x4dc02e['countmachineretry'],'scheduledat':moment()[_0xc7d6('0xdf')](_0x4343e5[_0xc7d6('0x130')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x4dc02e[_0xc7d6('0xf0')],'ListId':_0x4dc02e[_0xc7d6('0xe2')],'VoiceQueueId':_0x4dc02e[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x4dc02e['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch('[rescheduleContact][Machine]'));_0x30aaa3({'reschedule':0x1});}}});}}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x31')]=function(_0x13b37e){var _0x1445ed=this['uniqueId'][_0x13b37e[_0xc7d6('0xc2')]];var _0x660da9;if(_0x1445ed&&_0x1445ed[_0xc7d6('0xc3')]===_0xc7d6('0xc4')){delete this[_0xc7d6('0x23')][_0x13b37e[_0xc7d6('0xc2')]];this['updateOriginated'](this[_0xc7d6('0xae')][_0x1445ed[_0xc7d6('0xc6')]]);this[_0xc7d6('0xae')][_0x1445ed[_0xc7d6('0xc6')]][_0xc7d6('0x131')]+=0x1;_0x660da9=new Hangup(_0x1445ed,_0x13b37e);hopperUtils[_0xc7d6('0xcd')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x132')));hopperUtils['moveContactManagedDialer'](_0x660da9)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x133')));}if(_0x1445ed&&_0x1445ed[_0xc7d6('0xc3')]!==_0xc7d6('0xc4')&&isNotNull(this[_0xc7d6('0x1e')][_0x1445ed[_0xc7d6('0xc6')]][_0xc7d6('0x134')])){delete this['uniqueId'][_0x13b37e[_0xc7d6('0xc2')]];this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x1445ed['queue']]);this[_0xc7d6('0x1e')][_0x1445ed['queue']][_0xc7d6('0xc9')]+=0x1;this['voiceQueues'][_0x1445ed['queue']][_0xc7d6('0x116')]+=0x1;_0x660da9=new Hangup(_0x1445ed,_0x13b37e);_0x660da9[_0xc7d6('0x6f')]=0x10;_0x660da9[_0xc7d6('0x70')]='AnswerAGI';_0x660da9[_0xc7d6('0x118')]=_0xc7d6('0x135');hopperUtils[_0xc7d6('0xcd')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x132')));hopperUtils[_0xc7d6('0xce')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch('[syncHangupIvr]'));}if(_0x1445ed&&_0x1445ed[_0xc7d6('0xc3')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x1445ed['queue']]['dialQueueProject'])){delete this[_0xc7d6('0x23')][_0x13b37e['uniqueid']];this[_0xc7d6('0xc5')](this[_0xc7d6('0x1e')][_0x1445ed[_0xc7d6('0xc6')]]);this['voiceQueues'][_0x1445ed[_0xc7d6('0xc6')]][_0xc7d6('0x136')]+=0x1;_0x660da9=new Hangup(_0x1445ed,_0x13b37e);_0x660da9[_0xc7d6('0x6f')]=0xc;_0x660da9[_0xc7d6('0x70')]=_0x13b37e[_0xc7d6('0x137')];_0x660da9['membername']=_0xc7d6('0x138');hopperUtils[_0xc7d6('0xcd')](_0x660da9)['catch'](loggerCatch(_0xc7d6('0x132')));hopperUtils[_0xc7d6('0xce')](_0x660da9)[_0xc7d6('0xa1')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc7d6('0x18')]['syncQueueSummary']=function(_0xd9c073){var _0x2dbd56=this;if(!_0x2dbd56[_0xc7d6('0x27')][_0xd9c073['name']]){_0x2dbd56['queuesSummary'][_0xd9c073['name']]={'running':![]};}else if(_0x2dbd56[_0xc7d6('0x27')][_0xd9c073[_0xc7d6('0x5e')]][_0xc7d6('0x139')]===!![]){return;}else if(_0x2dbd56[_0xc7d6('0x27')][_0xd9c073[_0xc7d6('0x5e')]][_0xc7d6('0x139')]===![]){_0x2dbd56[_0xc7d6('0x27')][_0xd9c073[_0xc7d6('0x5e')]][_0xc7d6('0x139')]=!![];}var _0x3c805f=_0x2dbd56[_0xc7d6('0x1e')][_0xd9c073[_0xc7d6('0x5e')]];var _0x2b7c25=_0x3c805f[_0xc7d6('0x68')]!==utils[_0xc7d6('0x69')][_0xc7d6('0x7d')];var _0x1f69d2=utils['isPreviewCampaign'](_0x3c805f);_0x3c805f[_0xc7d6('0x13a')]=utils[_0xc7d6('0x13b')](_0x3c805f,_0x2dbd56[_0xc7d6('0x20')]);Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](function(){if(_0x3c805f[_0xc7d6('0x13a')]===utils['CAMPAIGN_STATUS'][_0xc7d6('0x7d')]){if(_0x2b7c25){clearPredictiveAttributes(_0x3c805f);_0xd9c073[_0xc7d6('0x60')]=undefined;_0xd9c073[_0xc7d6('0x5d')]=undefined;}if(_0x3c805f['statusMessage']===utils[_0xc7d6('0x69')]['INACTIVE']){_0xd9c073[_0xc7d6('0x13c')]=0x0;_0xd9c073['paused']=0x0;_0xd9c073[_0xc7d6('0x13d')]=0x0;_0xd9c073[_0xc7d6('0x13e')]=0x0;_0xd9c073['pTalking']=0x0;}}else if(_0x3c805f[_0xc7d6('0x13a')]===utils[_0xc7d6('0x69')][_0xc7d6('0x13f')]&&!_0x1f69d2){return _0x2dbd56['ifTime'](_0x3c805f,!![])[_0xc7d6('0x3b')](function(){return _0x2dbd56[_0xc7d6('0x92')](_0x3c805f,![]);})['then'](function(){return _0x2dbd56[_0xc7d6('0x140')](_0x3c805f);})['catch'](function(_0x2124d1){loggerSyncQueueSummary[_0xc7d6('0x61')](_0xc7d6('0x141'),util[_0xc7d6('0x3f')](_0x2124d1,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3c805f);});}else{clearPredictiveAttributes(_0x3c805f);}})['then'](function(){var _0xa17e6=_0xd9c073[_0xc7d6('0x142')](_0x3c805f);if(_0xa17e6||_0x3c805f[_0xc7d6('0x143')]){_0x3c805f[_0xc7d6('0x143')]=![];_0xd9c073[_0xc7d6('0x144')](_0x3c805f);Object[_0xc7d6('0x145')](_0x3c805f,_0xd9c073);emitOutboundVoiceQueueSummary(_0xd9c073);}_0x2dbd56[_0xc7d6('0x27')][_0x3c805f[_0xc7d6('0x5e')]]['running']=![];})[_0xc7d6('0xa1')](function(_0x463854){logger['error'](_0xc7d6('0x141'),util[_0xc7d6('0x3f')](_0x463854,{'showHidden':![],'depth':null}));_0x2dbd56[_0xc7d6('0x27')][_0x3c805f['name']][_0xc7d6('0x139')]=![];});};Dialer[_0xc7d6('0x18')]['syncQueueSummaryComplete']=_[_0xc7d6('0x146')](function(){var _0x2aaedb=_[_0xc7d6('0x147')](this['voiceQueues'],function(_0x198af5){return _0x198af5[_0xc7d6('0x148')];});var _0x27144d=_[_0xc7d6('0x147')](this['agents'],function(_0x56930c){return _0x56930c['online']&&_0x56930c[_0xc7d6('0x8a')]===_0xc7d6('0x149');});if(_0x2aaedb['length']>0x0&&_0x27144d[_0xc7d6('0x99')]>0x0){return Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](cmHopper[_0xc7d6('0x14a')](_[_0xc7d6('0x14b')](_0x2aaedb,'id'),previewRecallmeReminderInterval,_['map'](_0x27144d,'id')))['then'](function(_0x214c60){for(var _0x13bc78=0x0;_0x13bc78<_0x214c60[_0xc7d6('0x99')];_0x13bc78++){var _0xd24ae0=_0x214c60[_0x13bc78][_0xc7d6('0x14c')]['name'];if(_0xd24ae0)io['to'](util[_0xc7d6('0x40')]('user:%s',_0xd24ae0))[_0xc7d6('0x3e')](_0xc7d6('0x14d'),{'hopper':_0x214c60[_0x13bc78]});}})[_0xc7d6('0xa1')](function(_0x293586){logger[_0xc7d6('0x65')]('checkPreviewRecallReminder',_0x293586);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xc7d6('0x39')]=function(){var _0x1b8101=this;setInterval(function(){_0x1b8101['clearZombieChannels'](_0x1b8101['uniqueId'],_0xc7d6('0x14e'));_0x1b8101[_0xc7d6('0x14f')](_0x1b8101['actions'],_0xc7d6('0x150'));},0x32c8);};Dialer[_0xc7d6('0x18')][_0xc7d6('0x14f')]=function(_0x449a3f,_0x1d225b){var _0x12a5ca=this;for(var _0x50bb6f in _0x449a3f){if(typeof _0x449a3f[_0x50bb6f]!==_0xc7d6('0xaf')){this[_0xc7d6('0x1c')][_0xc7d6('0x19')](function(){if(!_[_0xc7d6('0xf9')](_0x449a3f[_0x50bb6f])){return ami['Action']({'action':_0xc7d6('0x8a'),'channel':_0x449a3f[_0x50bb6f][_0xc7d6('0xf5')]})['catch'](function(_0x132570){if(_0x132570[_0xc7d6('0x68')]===_0xc7d6('0x151')){setTimeout(function(){if(_0x449a3f[_0x50bb6f]&&_0x449a3f[_0x50bb6f]['type']!==_0xc7d6('0xc4')){_0x12a5ca[_0xc7d6('0xc5')](_0x12a5ca[_0xc7d6('0x1e')][_0x449a3f[_0x50bb6f]['queue']]);logger[_0xc7d6('0x65')]('[Dialer][checkChannel]',_0x1d225b,_0x50bb6f,_0x449a3f[_0x50bb6f][_0xc7d6('0xc6')]);delete _0x449a3f[_0x50bb6f];}if(_0x449a3f[_0x50bb6f]&&_0x449a3f[_0x50bb6f][_0xc7d6('0xc3')]===_0xc7d6('0xc4')){_0x12a5ca[_0xc7d6('0xc5')](_0x12a5ca[_0xc7d6('0xae')][_0x449a3f[_0x50bb6f]['queue']]);logger[_0xc7d6('0x65')](_0xc7d6('0x152'),_0x1d225b,_0x50bb6f,_0x449a3f[_0x50bb6f][_0xc7d6('0xc6')]);delete _0x449a3f[_0x50bb6f];}},0x2328);}});}});}}};Dialer[_0xc7d6('0x18')]['getVoiceQueueRtPauses']=function(_0x5879a7){return Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](voiceQueueRt[_0xc7d6('0x153')](_0x5879a7))[_0xc7d6('0xa1')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x4c3b4f){if(!_['isUndefined'](_0x4c3b4f)&&_0x4c3b4f!==null){if(typeof _0x4c3b4f[_0xc7d6('0x81')]!=='undefined'){if(_0x4c3b4f[_0xc7d6('0x81')]>0x0){_0x4c3b4f['originated']-=0x1;}else{logger[_0xc7d6('0x65')](_0xc7d6('0x154'));}}}else{logger[_0xc7d6('0x65')](_0xc7d6('0x155'));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x156')]=function(_0x4cc08a,_0x1c2a95){var _0x3f24a4=this;return function(_0x2d33f6){_0x3f24a4[_0xc7d6('0xc5')](_0x1c2a95);logger['error'](_0x4cc08a,util[_0xc7d6('0x3f')](_0x2d33f6,{'showHidden':![],'depth':null}));};};Dialer[_0xc7d6('0x18')][_0xc7d6('0x157')]=function(_0x304b2e,_0x16c1f8,_0x28e7f9){var _0x1eb344={'state':0x19,'statedesc':_0xc7d6('0x158')};this[_0xc7d6('0xc5')](_0x16c1f8);this['saveInDb'](_[_0xc7d6('0x5b')](_0x1eb344,_[_0xc7d6('0x77')](_0x28e7f9,['ContactId',_0xc7d6('0xe2'),'UserId',_0xc7d6('0xf1'),'CampaignId'])),'[emptyContact][createHistory]',_0xc7d6('0x159'));logger['error'](_0x304b2e);};Dialer['prototype']['saveInDb']=function(_0x221ab0,_0x157cbd,_0xde8fda){hopperUtils[_0xc7d6('0xcd')](_0x221ab0)[_0xc7d6('0xa1')](loggerCatch(_0x157cbd));hopperUtils[_0xc7d6('0xce')](_0x221ab0)[_0xc7d6('0xa1')](loggerCatch(_0xde8fda));};Dialer[_0xc7d6('0x18')]['queueCallerAbandonCreateState']=function(_0xdd2edd,_0xce60fc){hopperUtils['createHistory'](_0xdd2edd)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0xce60fc==0x0){hopperUtils[_0xc7d6('0xce')](_0xdd2edd)[_0xc7d6('0xa1')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x15a')]=function(_0x1840e6){return Promise[_0xc7d6('0xb0')]()[_0xc7d6('0x3b')](cmHopper[_0xc7d6('0x14a')](_0x1840e6['id'],previewRecallmeReminderInterval))[_0xc7d6('0x3b')](function(_0x2502cd){for(var _0x5ac7b7=0x0;_0x5ac7b7<_0x2502cd[_0xc7d6('0x99')];_0x5ac7b7++){var _0x1f73ed=_0x2502cd[_0x5ac7b7][_0xc7d6('0x14c')]['name'];if(_0x1f73ed)io['to'](util[_0xc7d6('0x40')]('user:%s',_0x1f73ed))[_0xc7d6('0x3e')]('user:dialPreviewRecallReminder',{'hopper':_0x2502cd[_0x5ac7b7]});}})[_0xc7d6('0xa1')](function(){});};Dialer[_0xc7d6('0x18')][_0xc7d6('0xb4')]=function(_0xf80c59){var _0x721a3c=this;return function(){_0x721a3c[_0xc7d6('0x15b')](_0xf80c59);};};Dialer[_0xc7d6('0x18')]['actionOriginate']=function(_0x3622ab,_0x3e012d){var _0x27a2c3=this;var _0x2e4acb=uuid['v4']();this[_0xc7d6('0xf4')][_0x2e4acb]=new Action(_0x3622ab,_0x3e012d,_0x2e4acb);return new Promise(function(_0x3c3ef2,_0x25806a){if(_['isUndefined'](_0x3622ab)&&typeof _0x3622ab!==_0xc7d6('0x15c')){return _0x25806a(msgResponse(_0xc7d6('0x15d'),_0xc7d6('0x96'),_0xc7d6('0x15e')));}if(_['isUndefined'](_0x3e012d[_0xc7d6('0x15f')])||_0x3e012d[_0xc7d6('0x15f')]===null){return _0x25806a(msgResponse(_0xc7d6('0x15d'),_0xc7d6('0x96'),_0xc7d6('0x160')));}var _0x463e1b={'XMD-CALLERID':_0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb][_0xc7d6('0x161')](),'XMD-AGI':_0x3622ab['dialQueueProject']?util[_0xc7d6('0x40')](_0xc7d6('0x162'),ipAgi,_0x3622ab[_0xc7d6('0x134')]):_0xc7d6('0x163'),'XMD-AGIAFTER':_0x3622ab[_0xc7d6('0xd7')]?util[_0xc7d6('0x40')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3622ab[_0xc7d6('0xd7')]):'NONE','XMD-QUEUE':utils[_0xc7d6('0x164')](_0x3622ab)?util[_0xc7d6('0x40')](_0xc7d6('0x165'),_0x3622ab[_0xc7d6('0x5e')],_0x3622ab['dialQueueOptions']||'',_0x3622ab[_0xc7d6('0x166')]?'c':'',_0x3622ab['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x3e012d[_0xc7d6('0xf0')],'XMD-CDRTYPE':_0xc7d6('0x167'),'CALLERID(all)':_0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb]['getCaller'](),'XMD-AMD':_0x3622ab[_0xc7d6('0x11e')]?_0xc7d6('0x13f'):'NONE','XMD-DESTINATION':_0xc7d6('0x113')};if(_0x3622ab[_0xc7d6('0x11e')]){_0x463e1b[_0xc7d6('0x168')]=_0x3622ab[_0xc7d6('0x169')]||0x9c4;_0x463e1b[_0xc7d6('0x16a')]=_0x3622ab[_0xc7d6('0x16b')]||0x5dc;_0x463e1b['XMD-AMDAFTERGREETINGSILENCE']=_0x3622ab[_0xc7d6('0x16c')]||0x320;_0x463e1b[_0xc7d6('0x16d')]=_0x3622ab[_0xc7d6('0x16e')]||0x1388;_0x463e1b[_0xc7d6('0x16f')]=_0x3622ab['dialAMDMinWordLength']||0x64;_0x463e1b[_0xc7d6('0x170')]=_0x3622ab['dialAMDBetweenWordsSilence']||0x32;_0x463e1b[_0xc7d6('0x171')]=_0x3622ab['dialAMDMaximumNumberOfWords']||0x3;_0x463e1b[_0xc7d6('0x172')]=_0x3622ab[_0xc7d6('0x173')]||0x100;_0x463e1b[_0xc7d6('0x174')]=_0x3622ab[_0xc7d6('0x175')]||0x1388;}if(utils['isOutboundQueue'](_0x3622ab)){_0x463e1b[_0xc7d6('0x176')]=_0x3e012d[_0xc7d6('0xf1')];}else{_0x463e1b[_0xc7d6('0x177')]=_0x3e012d[_0xc7d6('0xe3')];}for(var _0xd6901d in _0x3e012d[_0xc7d6('0x178')]){if(typeof _0x3e012d[_0xc7d6('0x178')][_0xd6901d]!==_0xc7d6('0xaf')){if(isNotNull(_0x3e012d['Contact'][_0xd6901d])&&_0xd6901d!=='id'&&_0xd6901d!==_0xc7d6('0x179')&&_0xd6901d!=='createdAt'&&_0xd6901d!==_0xc7d6('0x17a')){_0x463e1b[util['format'](_0xc7d6('0x17b'),_0xc7d6('0x17c'),_['toUpper'](_0xd6901d))]=_0x3e012d[_0xc7d6('0x178')][_0xd6901d];}}}var _0x7b0959=_0x27a2c3[_0xc7d6('0x87')](_0x3622ab['Trunk'])?utils[_0xc7d6('0x17d')](_0x3622ab['Trunk'][_0xc7d6('0x17e')],_0x3622ab['dialOriginateCallerIdName'],_0x3622ab['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0xc7d6('0x17f')](_0x3622ab['dialOriginateCallerIdNumber'],_0x3622ab[_0xc7d6('0x180')]):_0x3622ab[_0xc7d6('0x181')]):utils[_0xc7d6('0x17d')](_['isNil'](_0x3622ab[_0xc7d6('0x8c')])?_0x3622ab[_0xc7d6('0x182')][_0xc7d6('0x17e')]:_0x3622ab[_0xc7d6('0x8c')][_0xc7d6('0x17e')],_0x3622ab['dialOriginateCallerIdName'],_0x3622ab[_0xc7d6('0x180')]>0x0?utils['getCallerIdRandom'](_0x3622ab[_0xc7d6('0x181')],_0x3622ab[_0xc7d6('0x180')]):_0x3622ab[_0xc7d6('0x181')]);if(_0x7b0959){_0x463e1b[_0xc7d6('0x183')]=_0x27a2c3['actions'][_0x2e4acb][_0xc7d6('0x184')]=utils[_0xc7d6('0x185')](_0x7b0959);_0x463e1b[_0xc7d6('0x186')]=_0x3e012d[_0xc7d6('0x15f')];}_0x3622ab[_0xc7d6('0x187')]=_0x463e1b;return ami['Action']({'actionid':_0x2e4acb,'action':_0xc7d6('0x15d'),'channel':_0x27a2c3['isTrunkReachable'](_0x3622ab[_0xc7d6('0x182')])?util[_0xc7d6('0x40')](_0xc7d6('0x188'),_0x3622ab[_0xc7d6('0x182')][_0xc7d6('0x5e')],isNotNull(_0x3622ab[_0xc7d6('0x189')])?_0x3622ab[_0xc7d6('0x189')]['trim']()||'':'',_0x3622ab[_0xc7d6('0x18a')]>0x0?_0x3e012d['phone'][_0xc7d6('0x18b')](_0x3622ab[_0xc7d6('0x18a')]):_0x3e012d[_0xc7d6('0x15f')]):util[_0xc7d6('0x40')](_0xc7d6('0x188'),_[_0xc7d6('0xf9')](_0x3622ab[_0xc7d6('0x8c')])?_0x3622ab[_0xc7d6('0x182')][_0xc7d6('0x5e')]:_0x3622ab['TrunkBackup'][_0xc7d6('0x5e')],isNotNull(_0x3622ab[_0xc7d6('0x189')])?_0x3622ab['dialPrefix'][_0xc7d6('0x18c')]()||'':'',_0x3622ab[_0xc7d6('0x18a')]>0x0?_0x3e012d[_0xc7d6('0x15f')][_0xc7d6('0x18b')](_0x3622ab[_0xc7d6('0x18a')]):_0x3e012d[_0xc7d6('0x15f')]),'callerid':_0x7b0959,'Exten':_0xc7d6('0x113'),'Context':_0xc7d6('0x18d'),'Priority':'1','variable':_0x463e1b,'timeout':(_0x3622ab[_0xc7d6('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2e4acb})[_0xc7d6('0x3b')](function(_0x290e41){return _0x3c3ef2(_0x290e41);})[_0xc7d6('0xa1')](function(_0x22a69e){_0x3622ab['outboundOriginateFailureCallsDay']+=0x1;var _0x485f21=new History(_0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb]);logger[_0xc7d6('0x65')](util[_0xc7d6('0x40')](_0xc7d6('0x18f'),JSON[_0xc7d6('0x76')](_0x22a69e)));_0x485f21[_0xc7d6('0x6f')]=0xe;_0x485f21[_0xc7d6('0x70')]='OriginateError';_0x485f21[_0xc7d6('0x72')]=moment()['format'](_0xc7d6('0xc8'));_0x485f21['endtime']=_0x485f21[_0xc7d6('0x72')];hopperUtils[_0xc7d6('0xcd')](_0x485f21)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x190')));_0x27a2c3['moveContactManagedDialer'](_0x485f21)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x190')))[_0xc7d6('0x1b')](function(){delete _0x27a2c3[_0xc7d6('0xf4')][_0x2e4acb];return _0x25806a(msgResponse(_0xc7d6('0x15d'),_0xc7d6('0x86'),'originate\x20action\x20Error'));});});});};Dialer[_0xc7d6('0x18')][_0xc7d6('0x191')]=function(_0x5d738a,_0x39d386,_0x4a8a41){var _0x340b75=new History(_0x39d386);if(_0x340b75[_0xc7d6('0x122')]+_0x340b75[_0xc7d6('0x123')]+_0x340b75[_0xc7d6('0x124')]+_0x340b75[_0xc7d6('0x125')]+_0x340b75[_0xc7d6('0xd8')]+_0x340b75[_0xc7d6('0xeb')]+_0x340b75[_0xc7d6('0x121')]+_0x340b75[_0xc7d6('0x126')]>=_0x4a8a41['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x5d738a){case 0x3:if(_0x340b75[_0xc7d6('0x124')]>=_0x4a8a41['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countnoanswerretry':_0x340b75['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x192')],_0xc7d6('0xe1'))[_0xc7d6('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x193')));break;case 0x5:if(_0x340b75['countbusyretry']>=_0x4a8a41[_0xc7d6('0x194')]-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countbusyretry':_0x340b75['countbusyretry']+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x195')],_0xc7d6('0xe1'))['format'](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x340b75[_0xc7d6('0x123')]>=_0x4a8a41[_0xc7d6('0x196')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countcongestionretry':_0x340b75[_0xc7d6('0x123')]+=0x1,'scheduledat':moment()['add'](_0x4a8a41[_0xc7d6('0x197')],_0xc7d6('0xe1'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x198')));break;case 0x0:if(_0x340b75[_0xc7d6('0x125')]>=_0x4a8a41[_0xc7d6('0x199')]-0x1){return!![];}else{hopperUtils[_0xc7d6('0xef')]({'active':![],'countnosuchnumberretry':_0x340b75['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x19a')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75['ListId'],'VoiceQueueId':_0x340b75[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x19b')));}break;case 0xa:if(_0x340b75['countdropretry']>=_0x4a8a41['dialDropMaxRetry']-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countdropretry':_0x340b75[_0xc7d6('0xd8')]+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0xe0')],_0xc7d6('0xe1'))[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x340b75[_0xc7d6('0xeb')]>=_0x4a8a41[_0xc7d6('0xed')]-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countabandonedretry':_0x340b75[_0xc7d6('0xeb')]+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0xec')],_0xc7d6('0xe1'))['format'](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75['ListId'],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0xf2')));break;case 0x13:if(_0x340b75['countmachineretry']>=_0x4a8a41[_0xc7d6('0x19c')]-0x1){return!![];}hopperUtils[_0xc7d6('0xef')]({'active':![],'countmachineretry':_0x340b75[_0xc7d6('0x121')]+=0x1,'scheduledat':moment()[_0xc7d6('0xdf')](_0x4a8a41[_0xc7d6('0x130')],'minutes')[_0xc7d6('0x40')](_0xc7d6('0xc8')),'ContactId':_0x340b75['ContactId'],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})['catch'](loggerCatch(_0xc7d6('0x12b')));break;case 0x14:if(_0x340b75[_0xc7d6('0x126')]>=_0x4a8a41['dialAgentRejectMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countagentrejectretry':_0x340b75[_0xc7d6('0x126')]+=0x1,'scheduledat':moment()['add'](_0x4a8a41[_0xc7d6('0x19d')],_0xc7d6('0xe1'))['format'](_0xc7d6('0xc8')),'ContactId':_0x340b75[_0xc7d6('0xf0')],'ListId':_0x340b75[_0xc7d6('0xe2')],'VoiceQueueId':_0x340b75['VoiceQueueId']||undefined,'CampaignId':_0x340b75[_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x19e')));break;default:return!![];}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x10e')]=function(_0x29df3c,_0x4c02ae,_0x169a72){var _0x36a8e3=this;var _0xac56aa=new History(_0x29df3c);var _0x2f1d3d=![];var _0x3641d1;var _0x3672b4;return new Promise(function(_0x52b225,_0xcbf8af){if(_['isUndefined'](_0x4c02ae)&&typeof _0x4c02ae!==_0xc7d6('0x15c')){return _0xcbf8af(msgResponse(_0xc7d6('0x19f'),_0xc7d6('0x96'),_0xc7d6('0x1a0')));}if(_['isUndefined'](_0x169a72)&&typeof _0x169a72!==_0xc7d6('0x15c')){return _0xcbf8af(msgResponse(_0xc7d6('0x19f'),_0xc7d6('0x96'),'evt\x20is\x20undefine'));}hopperUtils[_0xc7d6('0xdb')](_0xac56aa,_0x169a72[_0xc7d6('0xca')],_0x4c02ae)[_0xc7d6('0x3b')](function(_0x2e9295){if(_0x2e9295[_0xc7d6('0xdd')]==0x1)_0x2f1d3d=!![];switch(_0x169a72[_0xc7d6('0xca')]){case'0':_0x4c02ae[_0xc7d6('0x1a1')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x0;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1a2');_0xac56aa[_0xc7d6('0x125')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;ami['emit'](_0xc7d6('0x1a3'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1a4')));_0x3641d1=_0x4c02ae[_0xc7d6('0x19a')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x12e')));if(_0x36a8e3[_0xc7d6('0x191')](0x0,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x125')]>=_0x4c02ae[_0xc7d6('0x199')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1a5'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1a5'));}}break;case'3':_0x4c02ae['outboundNoAnswerCallsDay']+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x3;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1a6');_0xac56aa[_0xc7d6('0x124')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;var _0x5f1554=ut[_0xc7d6('0x1a7')](_0x29df3c,_0x4c02ae);ami['emit'](_0xc7d6('0x1a8'),_0x5f1554);_0x3641d1=_0x4c02ae[_0xc7d6('0x192')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1a9')));if(_0x36a8e3[_0xc7d6('0x191')](0x3,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x124')]>=_0x4c02ae[_0xc7d6('0x1aa')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1ab'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1ab'));}}break;case'5':_0x4c02ae[_0xc7d6('0x1ac')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x5;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1ad');_0xac56aa[_0xc7d6('0x122')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;ami[_0xc7d6('0x3e')](_0xc7d6('0x1ae'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1af')));_0x3641d1=_0x4c02ae[_0xc7d6('0x195')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1b0')));if(_0x36a8e3[_0xc7d6('0x191')](0x5,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x122')]>=_0x4c02ae['dialBusyMaxRetry']){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b1'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b1'));}}break;case'8':_0x4c02ae[_0xc7d6('0x1b2')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x8;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1b3');_0xac56aa[_0xc7d6('0x123')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;_0x3641d1=_0x4c02ae['dialCongestionRetryFrequency'];_0x3672b4=_0x4c02ae['callAdditionalPhoneAfterMin'];ami[_0xc7d6('0x3e')](_0xc7d6('0x1b4'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1b5')));hopperUtils[_0xc7d6('0xcd')](_0xac56aa)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x36a8e3[_0xc7d6('0x191')](0x8,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa['countcongestionretry']>=_0x4c02ae[_0xc7d6('0x196')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b6'));}else{_0x36a8e3['stateGlobal'](_0xac56aa,_0x52b225,_0xcbf8af,'reason\x208\x20congestion');}}break;case'11':_0x4c02ae['outboundAbandonedCallsDay']+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0xb;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0xe9');_0xac56aa[_0xc7d6('0xeb')]+=0x1;_0xac56aa[_0xc7d6('0xd9')]+=0x1;_0x3641d1=_0x4c02ae['dialAbandonedRetryFrequency'];_0x3672b4=_0x4c02ae['callAdditionalPhoneAfterMin'];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0xf3')));if(_0x36a8e3[_0xc7d6('0x191')](0xb,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0xeb')]>=_0x4c02ae[_0xc7d6('0xed')]){_0x36a8e3['createStateFinal'](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b7'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1b7'));}}break;case'20':_0x4c02ae[_0xc7d6('0x1b8')]+=0x1;_0xac56aa[_0xc7d6('0x6f')]=0x14;_0xac56aa[_0xc7d6('0x70')]=_0xc7d6('0x1b9');_0xac56aa[_0xc7d6('0x126')]+=0x1;_0xac56aa['countglobal']+=0x1;_0x3641d1=_0x4c02ae[_0xc7d6('0x19d')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];ami['emit'](_0xc7d6('0x1ba'),ut[_0xc7d6('0x11b')](_0x29df3c,_0xc7d6('0x1bb')));hopperUtils['createHistory'](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x36a8e3[_0xc7d6('0x191')](0x14,_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x126')]>=_0x4c02ae[_0xc7d6('0x1bc')]){_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1bd'));}else{_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0xc7d6('0x1bd'));}}break;default:_0x4c02ae[_0xc7d6('0x136')]+=0x1;_0xac56aa['state']=0xc;_0xac56aa[_0xc7d6('0x70')]=_0x169a72['reason'];_0x3641d1=_0x4c02ae[_0xc7d6('0x19d')];_0x3672b4=_0x4c02ae[_0xc7d6('0xda')];hopperUtils[_0xc7d6('0xcd')](_0xac56aa)[_0xc7d6('0xa1')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x36a8e3[_0xc7d6('0x191')](_0x169a72[_0xc7d6('0xca')],_0x29df3c,_0x4c02ae)&&!_0x2f1d3d){if(_0xac56aa[_0xc7d6('0x122')]+_0xac56aa[_0xc7d6('0x123')]+_0xac56aa[_0xc7d6('0x124')]+_0xac56aa[_0xc7d6('0x125')]+_0xac56aa[_0xc7d6('0xd8')]+_0xac56aa[_0xc7d6('0xeb')]+_0xac56aa[_0xc7d6('0x121')]+_0xac56aa[_0xc7d6('0x126')]>=_0x4c02ae['dialGlobalMaxRetry']){_0x36a8e3[_0xc7d6('0x128')](_0xac56aa,_0x52b225,_0xcbf8af,_0x169a72[_0xc7d6('0xca')]);}else{_0x36a8e3[_0xc7d6('0x12f')](_0xac56aa,_0x52b225,_0xcbf8af,_0x169a72[_0xc7d6('0xca')]);}}}})[_0xc7d6('0x3b')](function(){if(_0x2f1d3d){hopperUtils[_0xc7d6('0xe8')](_0xac56aa,_0x3641d1,_0x3672b4)[_0xc7d6('0x3b')](function(){return _0x52b225(0x1);});}});});};Dialer[_0xc7d6('0x18')]['stateGlobal']=function(_0x20ba36,_0x9577ad,_0x4fface,_0x55eeda){var _0x462e70=new Final(_0x20ba36);_0x462e70[_0xc7d6('0x6f')]=0xf;_0x462e70['statedesc']=_0xc7d6('0x1be');this[_0xc7d6('0x12f')](_0x462e70,_0x9577ad,_0x4fface,_0x55eeda);};Dialer[_0xc7d6('0x18')]['createStateFinal']=function(_0x42f794,_0x187384,_0x2bb079,_0x514c0a){hopperUtils[_0xc7d6('0xce')](_0x42f794)['then'](function(){return _0x187384(msgResponse('[callProgressDetecting]','Success',_0x514c0a));})['catch'](function(){return _0x2bb079(msgResponse('[moveContactManagedDialer][0]',_0xc7d6('0x96'),_0xc7d6('0x1bf')));});};Dialer[_0xc7d6('0x18')]['predictive']=function(_0x591fb2){var _0xb749e0=_0x591fb2['dialPredictiveOptimizationPercentage']/0x64;var _0x9adb1f=_0x591fb2['outboundDropCallsDayTimeout']/(_0x591fb2['outboundDropCallsDayTimeout']+_0x591fb2[_0xc7d6('0xc9')]);var _0x33ac52=Math[_0xc7d6('0x1c0')](_0x591fb2[_0xc7d6('0x1c1')]*(_0x591fb2[_0xc7d6('0x1c2')]/0x64));var _0x52b1f6=Math[_0xc7d6('0x1c0')](_0x591fb2[_0xc7d6('0x1c1')]*(_0x591fb2[_0xc7d6('0x1c3')]/0x64));var _0x2b9c44=_0x591fb2[_0xc7d6('0x13c')]+_0x591fb2[_0xc7d6('0x13e')];var _0x1cd41f=Math['floor'](_0x591fb2[_0xc7d6('0x54')]*_0x591fb2[_0xc7d6('0x58')]*_0x591fb2[_0xc7d6('0x1c4')]*_0x591fb2['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x591fb2[_0xc7d6('0x5d')])){if(!_[_0xc7d6('0x3d')](_0x591fb2[_0xc7d6('0x60')])){_0x591fb2['startPredictive']=undefined;loggerPredictive[_0xc7d6('0x65')](_0xc7d6('0x1c5'),_0xc7d6('0x1c6'));}if(!_[_0xc7d6('0x3d')](_0x591fb2[_0xc7d6('0x63')])){loggerPredictive[_0xc7d6('0x65')](_0xc7d6('0x1c5'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x591fb2[_0xc7d6('0x63')]);_0x591fb2['handlePredictive']=undefined;}_0x591fb2[_0xc7d6('0x5d')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));loggerPredictive[_0xc7d6('0x44')](_0x591fb2[_0xc7d6('0x5e')],'collection\x20data\x20in\x20progressive\x20at',_0x591fb2[_0xc7d6('0x5d')]);this[_0xc7d6('0xb9')](_0x591fb2,0x1);}else if(ifInterval(_0x591fb2[_0xc7d6('0x1c7')],_0x591fb2[_0xc7d6('0x5d')])){this[_0xc7d6('0xb9')](_0x591fb2,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x591fb2[_0xc7d6('0x5d')],_0x591fb2[_0xc7d6('0x5e')]);_0x591fb2['erlangCalls']=0x0;_0x591fb2[_0xc7d6('0xd3')]=0x0;}else if(_0xb749e0<_0x9adb1f&&_0x591fb2[_0xc7d6('0x1c8')]===_0xc7d6('0x1c9')){clearPredictiveAttributes(_0x591fb2);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x1ca'),_0xc7d6('0x1cb'),_0x9adb1f,'startProgressive',_0x591fb2[_0xc7d6('0x5e')]);}else if(_0x1cd41f<_0x591fb2[_0xc7d6('0xd3')]&&_0x591fb2[_0xc7d6('0x1c8')]==='dropRate'){clearPredictiveAttributes(_0x591fb2);loggerPredictive['info'](_0xc7d6('0x1cc'),_0xc7d6('0x1cd'),_0x1cd41f,_0xc7d6('0x1ce'),_0x591fb2[_0xc7d6('0xd3')],_0xc7d6('0x5d'),_0x591fb2[_0xc7d6('0x5e')]);}else if(!ifInterval(_0x591fb2[_0xc7d6('0x1c7')],_0x591fb2['startProgressive'])&&_['isUndefined'](_0x591fb2[_0xc7d6('0x60')])&&!_[_0xc7d6('0x3d')](_0x591fb2[_0xc7d6('0x5d')])){_0x591fb2[_0xc7d6('0x60')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));loggerPredictive['info'](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1cf'),_0x591fb2[_0xc7d6('0x60')]);hopperUtils[_0xc7d6('0x1d0')](_0x591fb2['dialPredictiveInterval'])[_0xc7d6('0x3b')](this[_0xc7d6('0x1d1')](_0x591fb2))[_0xc7d6('0x3b')](mergeDataErlangB(_0x591fb2))[_0xc7d6('0x3b')](this[_0xc7d6('0x1d2')](_0x591fb2))[_0xc7d6('0xa1')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x591fb2));}else if(!ifInterval(_0x591fb2[_0xc7d6('0x1c7')],_0x591fb2['startPredictive'])){_0x591fb2['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x591fb2[_0xc7d6('0x60')]=moment()[_0xc7d6('0x40')](_0xc7d6('0xc8'));loggerPredictive['info'](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1d3'),_0x591fb2[_0xc7d6('0x60')]);clearInterval(_0x591fb2[_0xc7d6('0x63')]);_0x591fb2['handlePredictive']=undefined;hopperUtils[_0xc7d6('0x1d0')](_0x591fb2[_0xc7d6('0x1c7')])[_0xc7d6('0x3b')](this['getDataPredictive'](_0x591fb2))[_0xc7d6('0x3b')](mergeDataErlangB(_0x591fb2))['then'](this[_0xc7d6('0x1d2')](_0x591fb2))[_0xc7d6('0xa1')](loggerCatchPredictive(_0xc7d6('0x1d4'),_0x591fb2));}else if(_0x591fb2[_0xc7d6('0x1c1')]&&_0x2b9c44<_0x591fb2[_0xc7d6('0x1c1')]-_0x52b1f6){clearPredictiveAttributes(_0x591fb2);loggerPredictive[_0xc7d6('0x44')](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1d5'),_0x2b9c44,_0xc7d6('0x1d6'),_0x591fb2['predictiveIntervalAvailable'],'-',_0x52b1f6,'=',_0x591fb2[_0xc7d6('0x1c1')]-_0x52b1f6,')');}else if(_0x591fb2[_0xc7d6('0x1c1')]&&_0x2b9c44>_0x591fb2[_0xc7d6('0x1c1')]+_0x33ac52){clearPredictiveAttributes(_0x591fb2);loggerPredictive[_0xc7d6('0x44')](_0x591fb2[_0xc7d6('0x5e')],_0xc7d6('0x1d5'),_0x2b9c44,_0xc7d6('0x1d7'),_0x591fb2['predictiveIntervalAvailable'],'+',_0x33ac52,'=',_0x591fb2[_0xc7d6('0x1c1')]+_0x33ac52,')');}};Dialer['prototype'][_0xc7d6('0x1d1')]=function(_0x8dfe90){var _0x219781=this;return function(_0x57341d){return new Promise(function(_0x5110b9,_0x47d186){_[_0xc7d6('0x5b')](_0x8dfe90,_0x57341d[0x0]);if(checkGetDataPredictive(_0x57341d[0x0])){var _0x40d7a3=_0x8dfe90[_0xc7d6('0x1c1')]=_0x8dfe90[_0xc7d6('0x13e')]+_0x8dfe90[_0xc7d6('0x13c')];var _0x341083=_0x8dfe90[_0xc7d6('0x1c7')]*0x3c;var _0x280b81=_0x57341d[0x0][_0xc7d6('0x4f')]+_0x57341d[0x0][_0xc7d6('0x4d')];var _0x14ecfa=(_0x57341d[0x0][_0xc7d6('0x48')]+_0x57341d[0x0][_0xc7d6('0x4a')]+_0x57341d[0x0][_0xc7d6('0x4c')])/_0x57341d[0x0][_0xc7d6('0x46')];_0x8dfe90[_0xc7d6('0x1c4')]=_0x14ecfa>0x0?_0x14ecfa:0x1;switch(_0x8dfe90['dialPredictiveOptimization']){case'dropRate':var _0x2e333c=_0x8dfe90[_0xc7d6('0x1d8')]/0x64;return _0x219781['abandonmentRate'](_0x40d7a3,_0x341083,_0x280b81,_0x14ecfa,_0x2e333c)[_0xc7d6('0x3b')](function(_0xf1892){return _0x5110b9(_0xf1892);});case _0xc7d6('0x1d9'):var _0x4557c9=_0x8dfe90[_0xc7d6('0x1d8')]/0x64;return _0x219781[_0xc7d6('0x1da')](_0x40d7a3,_0x341083,_0x280b81,_0x14ecfa,_0x4557c9)[_0xc7d6('0x3b')](function(_0x20d91a){return _0x5110b9(_0x20d91a);});default:return _0x47d186(msgResponse(_0xc7d6('0x1db'),_0xc7d6('0x96'),_0xc7d6('0x1dc')));}}else{return _0x47d186(msgResponse(_0xc7d6('0x1db'),_0xc7d6('0x96'),_0xc7d6('0x1dd')));}});};};Dialer[_0xc7d6('0x18')]['getDataPredictiveOld']=function(_0x3165f0){var _0x59650d=this;return function(_0x433ab3){return new Promise(function(_0xa2ede2,_0x2d3957){_[_0xc7d6('0x5b')](_0x3165f0,_0x433ab3[0x0]);if(checkGetDataPredictive(_0x433ab3[0x0])){loggerPredictive[_0xc7d6('0x44')](JSON[_0xc7d6('0x76')](_0x433ab3[0x0]));if(_0x3165f0[_0xc7d6('0x1c8')]===_0xc7d6('0x1c9')){return _0x59650d[_0xc7d6('0x153')](_0x3165f0['id'])[_0xc7d6('0x3b')](function(_0x2228ca){var _0x3a98e3=_0x3165f0[_0xc7d6('0x1de')]-_0x2228ca[0x0][_0xc7d6('0x1df')];var _0x5535fc=_0x3165f0['dialPredictiveInterval']*0x3c;var _0x57c78e=_0x433ab3[0x0][_0xc7d6('0x4f')]+_0x433ab3[0x0][_0xc7d6('0x4d')];var _0x25a323=(_0x433ab3[0x0][_0xc7d6('0x48')]+_0x433ab3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x433ab3[0x0][_0xc7d6('0x4c')])/_0x433ab3[0x0][_0xc7d6('0x46')];var _0x15023e=_0x3165f0[_0xc7d6('0x1d8')]/0x64;_0x3165f0['predictiveIntervalPauses']=_0x2228ca[0x0]['outboundQueuePauses']||0x0;_0x3165f0['predictiveIntervalHitRate']=_0x25a323>0x0?_0x25a323:0x1;return _0x59650d['abandonmentRate'](_0x3a98e3,_0x5535fc,_0x57c78e,_0x25a323,_0x15023e);})[_0xc7d6('0x3b')](function(_0x176fe0){return _0xa2ede2(_0x176fe0);})[_0xc7d6('0xa1')](function(_0x1d7cbe){return _0x2d3957(msgResponse(_0xc7d6('0x1e0'),_0xc7d6('0x96'),JSON[_0xc7d6('0x76')](_0x1d7cbe)));});}if(_0x3165f0[_0xc7d6('0x1c8')]===_0xc7d6('0x1d9')){return _0x59650d[_0xc7d6('0x153')](_0x3165f0['id'])['then'](function(_0x271beb){var _0x36d179=_0x3165f0[_0xc7d6('0x1de')]-_0x271beb[0x0][_0xc7d6('0x1df')];var _0x1993ff=_0x3165f0[_0xc7d6('0x1c7')]*0x3c;var _0x40fcb5=_0x433ab3[0x0][_0xc7d6('0x4f')]+_0x433ab3[0x0][_0xc7d6('0x4d')];var _0x6bd14f=(_0x433ab3[0x0][_0xc7d6('0x48')]+_0x433ab3[0x0][_0xc7d6('0x4a')]+_0x433ab3[0x0][_0xc7d6('0x4c')])/_0x433ab3[0x0]['predictiveIntervalTotalCalls'];var _0x9585f7=_0x3165f0[_0xc7d6('0x1d8')]/0x64;_0x3165f0[_0xc7d6('0x1e1')]=_0x271beb[0x0][_0xc7d6('0x1df')]||0x0;_0x3165f0[_0xc7d6('0x1c4')]=_0x6bd14f>0x0?_0x6bd14f:0x1;return _0x59650d[_0xc7d6('0x1da')](_0x36d179,_0x1993ff,_0x40fcb5,_0x6bd14f,_0x9585f7);})[_0xc7d6('0x3b')](function(_0x31253e){return _0xa2ede2(_0x31253e);})['catch'](function(_0x4af921){return _0x2d3957(msgResponse(_0xc7d6('0x1e0'),_0xc7d6('0x96'),JSON['stringify'](_0x4af921)));});}}else{return _0x2d3957(msgResponse(_0xc7d6('0x1db'),'Failure',_0xc7d6('0x1dd')));}});};};Dialer['prototype'][_0xc7d6('0x1d2')]=function(_0x3e139e){var _0x14107c=this;return function(){var _0x15b5c4=0x0;var _0x3dd79c=Math[_0xc7d6('0x1e2')](_0x3e139e['erlangCallToSecond']*0x3e8);if(_0x3dd79c>0x0){_0x3dd79c=_0x3dd79c<0x64?0x64:_0x3dd79c;loggerPredictive[_0xc7d6('0x44')](_0x3e139e[_0xc7d6('0x5e')],'one\x20call\x20every:',_0x3dd79c,_0xc7d6('0x1e3'));_0x3e139e[_0xc7d6('0x63')]=setInterval(function(){_0x14107c[_0xc7d6('0x63')](_0x3e139e);loggerPredictiveCalls['info']('[handlePredictive]',_0x15b5c4+=0x1);},_0x3dd79c);}else{loggerPredictive['info'](_0x3e139e['name'],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc7d6('0x18')]['checkContactBlack']=function(_0x14d01c,_0x314a07){var _0x59357c=this;return function(_0x523392){if(_[_0xc7d6('0x7b')](_0x523392)){if(_[_0xc7d6('0xf9')](_0x314a07[_0xc7d6('0x1e4')])||!_0x314a07[_0xc7d6('0x1e5')]){if(_0x14d01c[_0xc7d6('0xb6')]==='booked'){_0x14d01c['queueStatusComplete']=_[_0xc7d6('0x3d')](_0x14d01c[_0xc7d6('0x73')])?!![]:_0x14d01c[_0xc7d6('0x73')];var _0x1ecc79=uuid['v4']();_0x59357c[_0xc7d6('0xf4')][_0x1ecc79]=new Action(_0x14d01c,_0x314a07,_0x1ecc79);loggerBooked[_0xc7d6('0x44')]('[booked][checkContactBlack]',_0x1ecc79,_0xc7d6('0x1e6'),JSON['stringify'](_0x14d01c[_0xc7d6('0x73')]),'Queue:\x20',_0x14d01c[_0xc7d6('0x5e')]);if(_0x14d01c[_0xc7d6('0x73')]){_0x14d01c[_0xc7d6('0x73')]=![];_0x59357c[_0xc7d6('0x25')][_0x59357c['actions'][_0x1ecc79][_0xc7d6('0xc6')]]=[];ami['Action']({'actionid':_0x1ecc79,'action':'queuestatus','queue':_0x14d01c[_0xc7d6('0x5e')]})[_0xc7d6('0xa1')](function(){_0x59357c['updateOriginated'](_0x14d01c);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':_0x59357c['actions'][_0x1ecc79][_0xc7d6('0xf0')],'ListId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79]['ListId'],'VoiceQueueId':_0x59357c['actions'][_0x1ecc79]['VoiceQueueId']||undefined,'CampaignId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79][_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1e7')));delete _0x59357c[_0xc7d6('0xf4')][_0x1ecc79];});}else{loggerBooked[_0xc7d6('0x44')](_0xc7d6('0x1e8'),JSON[_0xc7d6('0x76')](_0x14d01c[_0xc7d6('0x73')]),'Queue:\x20',_0x14d01c[_0xc7d6('0x5e')]);_0x59357c['updateOriginated'](_0x14d01c);hopperUtils[_0xc7d6('0xef')]({'active':![],'ContactId':_0x59357c['actions'][_0x1ecc79][_0xc7d6('0xf0')],'ListId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79]['ListId'],'VoiceQueueId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79][_0xc7d6('0xf1')]||undefined,'CampaignId':_0x59357c[_0xc7d6('0xf4')][_0x1ecc79][_0xc7d6('0xe3')]||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1e7')));delete _0x59357c[_0xc7d6('0xf4')][_0x1ecc79];}}else{return _0x59357c[_0xc7d6('0x1e9')](_0x14d01c,_0x314a07);}}else{if(utils[_0xc7d6('0x5c')](undefined,_0x314a07['scheduledat'])<_0x14d01c['dialRecallMeTimeout']*0x3c){if(_0x314a07[_0xc7d6('0x14c')]&&!_0x314a07[_0xc7d6('0x14c')][_0xc7d6('0x1ea')]){_0x59357c[_0xc7d6('0x1d')][_0xc7d6('0x1eb')](_0x314a07['id'])[_0xc7d6('0x1b')](function(){_0x59357c[_0xc7d6('0xc5')](_0x14d01c);});}else{hopperUtils[_0xc7d6('0x1ec')]({'active':![]},_0x314a07['id'],0x1)[_0xc7d6('0x1b')](function(){_0x59357c[_0xc7d6('0xc5')](_0x14d01c);});}}else{_0x14d01c['outboundReCallsDay']+=0x1;_0x59357c[_0xc7d6('0xc5')](_0x14d01c);if(_0x14d01c[_0xc7d6('0x1ed')]){hopperUtils[_0xc7d6('0xef')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x314a07[_0xc7d6('0xf0')],'ListId':_0x314a07[_0xc7d6('0xe2')],'VoiceQueueId':_0x314a07[_0xc7d6('0xf1')]||undefined,'CampaignId':_0x314a07['CampaignId']||undefined})[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x1ee')));hopperUtils[_0xc7d6('0xcd')](createObjHistory(_0x14d01c,_0x314a07,utils[_0xc7d6('0x69')][_0xc7d6('0x1ef')],0x17,_0xc7d6('0x1f0')))[_0xc7d6('0xa1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x59357c[_0xc7d6('0x11d')](createObjHistory(_0x14d01c,_0x314a07,utils[_0xc7d6('0x69')][_0xc7d6('0x1f1')],0x16,_0xc7d6('0x1f2')),_0xc7d6('0x1f3'),_0xc7d6('0x1f4'));}}}}else{_0x14d01c[_0xc7d6('0x1f5')]+=0x1;_0x59357c[_0xc7d6('0x11d')](createObjHistory(_0x14d01c,_0x314a07,utils[_0xc7d6('0x69')][_0xc7d6('0x1f6')],0xd,_0xc7d6('0x1f7')),_0xc7d6('0x1f8'),_0xc7d6('0x1f9'));throw'inBlackList';}};};Dialer[_0xc7d6('0x18')][_0xc7d6('0x15b')]=function(_0x3c5e66){var _0x5d3249=this;var _0x4dfd5e=_0x3c5e66[_0xc7d6('0x1fa')]-_0x3c5e66['originated']-_0x3c5e66['temp'];emitCampaignSummary(_0x3c5e66);if(_0x4dfd5e>0x0){if(_0x4dfd5e>this[_0xc7d6('0x21')]){_0x4dfd5e=this[_0xc7d6('0x21')];}_0x3c5e66[_0xc7d6('0x1fb')]+=_0x4dfd5e;hopperUtils[_0xc7d6('0x1fc')](_0x3c5e66['id'],_0x4dfd5e,_0x3c5e66['dialOrderByScheduledAt'],_0x3c5e66)[_0xc7d6('0x3b')](function(_0x5b8dce){_0x3c5e66[_0xc7d6('0x1fb')]-=_0x4dfd5e;_0x3c5e66['temp']=_0x3c5e66[_0xc7d6('0x1fb')]>0x0?_0x3c5e66[_0xc7d6('0x1fb')]:0x0;if(!utils[_0xc7d6('0x1fd')](_0x5b8dce)){_0x3c5e66['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x6d')];logger[_0xc7d6('0x44')](_0xc7d6('0x1fe')+_0x3c5e66[_0xc7d6('0x5e')]);}else{_0x3c5e66[_0xc7d6('0x81')]+=_0x5b8dce[_0xc7d6('0x99')];_0x3c5e66[_0xc7d6('0x68')]=utils[_0xc7d6('0x69')]['RUNNING'];for(var _0x70f295=0x0;_0x70f295<_0x5b8dce['length'];_0x70f295+=0x1){_0x3c5e66['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x5b8dce[_0x70f295])||_[_0xc7d6('0xf9')](_0x5b8dce[_0x70f295][_0xc7d6('0x178')])||_[_0xc7d6('0xf9')](_0x5b8dce[_0x70f295][_0xc7d6('0x15f')])){_0x5d3249[_0xc7d6('0x157')](_0xc7d6('0x1ff'),_0x3c5e66,_0x5b8dce[_0x70f295]);}else{hopperUtils[_0xc7d6('0x200')](_['pick'](_0x5b8dce[_0x70f295],['CampaignId',_0xc7d6('0x15f')]))['then'](_0x5d3249[_0xc7d6('0x201')](_0x3c5e66,_0x5b8dce[_0x70f295]))[_0xc7d6('0xa1')](_0x5d3249[_0xc7d6('0x156')]('[actionOriginateIvr]\x20',_0x3c5e66));}}}})['catch'](loggerGetContactDialer(_0xc7d6('0x202'),_0x3c5e66,_0x4dfd5e));}};Dialer['prototype']['handlePower']=function(_0x120708,_0x4cb4fd){var _0x2bc820=this;var _0x19aac3=[];if(_0x4cb4fd<0x1||_0x120708[_0xc7d6('0xb6')]===_0xc7d6('0x7')){_0x4cb4fd=0x1;}var _0x20d3dd=Math[_0xc7d6('0x1e2')](_0x120708['available']*_0x4cb4fd)-_0x120708[_0xc7d6('0x81')]-_0x120708['temp'];if(_0x120708[_0xc7d6('0x203')]>0x0){var _0x295c89=_0x120708[_0xc7d6('0x203')]-_0x120708[_0xc7d6('0x81')]-_0x120708[_0xc7d6('0x13e')]-_0x120708[_0xc7d6('0x1fb')]-_0x120708[_0xc7d6('0x204')];if(_0x20d3dd>_0x295c89){_0x20d3dd=_0x295c89;}}if(_0x20d3dd>0x0){if(_0x120708[_0xc7d6('0xb6')]===_0xc7d6('0x7')){_0x20d3dd=0x1;}if(_0x20d3dd>this['maxNumberOriginate']){_0x20d3dd=this[_0xc7d6('0x21')];}_0x120708[_0xc7d6('0x1fb')]+=_0x20d3dd;for(var _0x551669 in this[_0xc7d6('0x1f')]){if(typeof this[_0xc7d6('0x1f')][_0x551669]!==_0xc7d6('0xaf')){if(this['agents'][_0x551669][_0xc7d6('0x6f')]===_0xc7d6('0x205')&&this[_0xc7d6('0x1f')][_0x551669]['status']===_0xc7d6('0x149')){_0x19aac3[_0xc7d6('0x9a')](this['agents'][_0x551669]['id']);}}}hopperUtils[_0xc7d6('0x206')](_0x120708,_0x19aac3,_0x20d3dd)[_0xc7d6('0x3b')](function(_0x13b15c){_0x120708['temp']-=_0x20d3dd;_0x120708[_0xc7d6('0x1fb')]=_0x120708[_0xc7d6('0x1fb')]>0x0?_0x120708['temp']:0x0;if(!utils[_0xc7d6('0x1fd')](_0x13b15c)){hopperUtils[_0xc7d6('0x207')](_0x120708)[_0xc7d6('0x3b')](sendMessageReschedule(_0x120708))[_0xc7d6('0xa1')](loggerCatch(_0xc7d6('0x208')));}else{_0x120708[_0xc7d6('0x81')]+=_0x13b15c[_0xc7d6('0x99')];_0x120708['message']=_0x120708[_0xc7d6('0xb6')]===_0xc7d6('0x7')?utils[_0xc7d6('0x69')]['ACTIVE']:utils[_0xc7d6('0x69')][_0xc7d6('0x209')];for(var _0x3bfd19=0x0;_0x3bfd19<_0x13b15c[_0xc7d6('0x99')];_0x3bfd19+=0x1){if(_[_0xc7d6('0xf9')](_0x13b15c[_0x3bfd19])||_[_0xc7d6('0xf9')](_0x13b15c[_0x3bfd19][_0xc7d6('0x178')])||_[_0xc7d6('0xf9')](_0x13b15c[_0x3bfd19][_0xc7d6('0x15f')])){_0x2bc820[_0xc7d6('0x157')](_0xc7d6('0x1ff'),_0x120708,_0x13b15c[_0x3bfd19]);}else{hopperUtils[_0xc7d6('0x20a')](_[_0xc7d6('0x77')](_0x13b15c[_0x3bfd19],[_0xc7d6('0xf1'),'phone']))[_0xc7d6('0x3b')](_0x2bc820[_0xc7d6('0x201')](_0x120708,_0x13b15c[_0x3bfd19]))[_0xc7d6('0xa1')](_0x2bc820[_0xc7d6('0x156')](_0xc7d6('0x1ff'),_0x120708));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x120708,_0x20d3dd));}};Dialer[_0xc7d6('0x18')][_0xc7d6('0x63')]=function(_0x2c83e5){if(_0x2c83e5[_0xc7d6('0x203')]>0x0){var _0x3b239f=_0x2c83e5[_0xc7d6('0x203')]-_0x2c83e5[_0xc7d6('0x81')]-_0x2c83e5[_0xc7d6('0x13e')];if(_0x3b239f>0x0){this[_0xc7d6('0x20b')](_0x2c83e5);}else{loggerPredictiveCalls[_0xc7d6('0x44')]('[handlePredictive][limitChannel]');}}else{this[_0xc7d6('0x20b')](_0x2c83e5);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x48d262){var _0x52c927=this;var _0x2cec6b=[];_0x48d262['originated']+=0x1;for(var _0xa42411 in this['agents']){if(typeof this[_0xc7d6('0x1f')][_0xa42411]!==_0xc7d6('0xaf')){if(this[_0xc7d6('0x1f')][_0xa42411][_0xc7d6('0x6f')]===_0xc7d6('0x205')&&this[_0xc7d6('0x1f')][_0xa42411][_0xc7d6('0x8a')]===_0xc7d6('0x149')){_0x2cec6b[_0xc7d6('0x9a')](this[_0xc7d6('0x1f')][_0xa42411]['id']);}}}return this[_0xc7d6('0x206')](_0x48d262['id'],_0x2cec6b,0x1,_0x48d262[_0xc7d6('0x20c')],_0x48d262)[_0xc7d6('0x3b')](function(_0x5723a0){if(!utils[_0xc7d6('0x1fd')](_0x5723a0)){utils[_0xc7d6('0x20d')](_0x48d262,0x1,0x0);return hopperUtils[_0xc7d6('0x207')](_0x48d262)[_0xc7d6('0x3b')](sendMessageReschedule(_0x48d262))[_0xc7d6('0xa1')](loggerCatch('[countReScheduled]\x20'));}else{_0x48d262['message']=utils[_0xc7d6('0x69')][_0xc7d6('0x209')];if(_['isNil'](_0x5723a0[0x0])||_['isNil'](_0x5723a0[0x0]['Contact'])||_[_0xc7d6('0xf9')](_0x5723a0[0x0]['phone'])){_0x52c927[_0xc7d6('0x157')]('[actionOriginate]\x20',_0x48d262,_0x5723a0[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0xc7d6('0x77')](_0x5723a0[0x0],[_0xc7d6('0xf1'),_0xc7d6('0x15f')]))[_0xc7d6('0x3b')](_0x52c927[_0xc7d6('0x201')](_0x48d262,_0x5723a0[0x0]))[_0xc7d6('0xa1')](_0x52c927[_0xc7d6('0x156')](_0xc7d6('0x20e'),_0x48d262));}}})[_0xc7d6('0xa1')](loggerGetContactDialer(_0xc7d6('0x20f'),_0x48d262,0x1));};Dialer[_0xc7d6('0x18')][_0xc7d6('0x210')]=function(_0x3f32e5,_0x256000,_0x46c7e4,_0x5125c7,_0x5bf7c5,_0x50e4bc){loggerPredictive[_0xc7d6('0x44')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0xc7d6('0x211'),_0x3f32e5);loggerPredictive[_0xc7d6('0x44')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x256000);loggerPredictive[_0xc7d6('0x44')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46c7e4);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x212'),_0x5125c7);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bf7c5);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x5a'));return new Promise(function(_0x44c1c8,_0x5b4bc8){if(_0x3f32e5<=0x0||isNaN(_0x3f32e5)){return _0x5b4bc8(msgResponse(_0xc7d6('0x213'),_0xc7d6('0x86'),'m\x20=\x20'+_0x3f32e5));}if(_0x46c7e4<=0x0||isNaN(_0x46c7e4)){return _0x5b4bc8(msgResponse(_0xc7d6('0x213'),_0xc7d6('0x86'),_0xc7d6('0x214')+_0x46c7e4));}if(_0x5125c7<=0x0||isNaN(_0x5125c7)){return _0x5b4bc8(msgResponse(_0xc7d6('0x213'),_0xc7d6('0x86'),'p\x20=\x20'+_0x5125c7));}if(_0x256000<=0x0||isNaN(_0x256000)){return _0x5b4bc8(msgResponse('[abandonmentRate]',_0xc7d6('0x86'),_0xc7d6('0x215')+_0x256000));}if(_0x5bf7c5<=0x0||isNaN(_0x5bf7c5)){return _0x5b4bc8(msgResponse('[abandonmentRate]',_0xc7d6('0x86'),_0xc7d6('0x216')+_0x5bf7c5));}_0x50e4bc=_0x50e4bc||0x0;var _0x54507e=0x1/_0x46c7e4;var _0x1c6223=0x0;var _0x28e56a=0x0;var _0x158b89=0x0;var _0xbd28ba=0x0;for(var _0x311bba=0x0;_0x158b89<_0x5bf7c5;_0x311bba+=0x1){_0x28e56a=_0x311bba/_0x256000;_0x1c6223=(_0x5125c7*_0x28e56a+_0x50e4bc)/_0x54507e;_0x158b89=utils[_0xc7d6('0x217')](_0x1c6223,_0x3f32e5);_0xbd28ba=_0x1c6223/_0x3f32e5*(0x1-utils[_0xc7d6('0x217')](_0x1c6223,_0x3f32e5));}return _0x44c1c8({'erlangCalls':_0x311bba,'erlangCallToSecond':_0x256000/_0x311bba,'erlangAbandonmentRate':_0x158b89,'erlangBusyFactor':_0xbd28ba});});};Dialer[_0xc7d6('0x18')][_0xc7d6('0x1da')]=function(_0x517b26,_0x5502c1,_0x54ed67,_0xcaa182,_0x5dd293,_0xe5098f){loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x218'));loggerPredictive['info'](_0xc7d6('0x211'),_0x517b26);loggerPredictive['info'](_0xc7d6('0x219'),_0x5502c1);loggerPredictive[_0xc7d6('0x44')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x54ed67);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x212'),_0xcaa182);loggerPredictive['info'](_0xc7d6('0x21a'),_0x5dd293);loggerPredictive[_0xc7d6('0x44')](_0xc7d6('0x5a'));return new Promise(function(_0x2b747e,_0x29ee25){if(_0x517b26<=0x0||isNaN(_0x517b26)){return _0x29ee25(msgResponse('[busyFactor]','Error','m\x20=\x20'+_0x517b26));}if(_0x54ed67<=0x0||isNaN(_0x54ed67)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),_0xc7d6('0x86'),_0xc7d6('0x214')+_0x54ed67));}if(_0xcaa182<=0x0||isNaN(_0xcaa182)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),_0xc7d6('0x86'),_0xc7d6('0x21c')+_0xcaa182));}if(_0x5502c1<=0x0||isNaN(_0x5502c1)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),'Error',_0xc7d6('0x215')+_0x5502c1));}if(_0x5dd293<=0x0||isNaN(_0x5dd293)){return _0x29ee25(msgResponse(_0xc7d6('0x21b'),_0xc7d6('0x86'),_0xc7d6('0x21d')+_0x5dd293));}_0xe5098f=_0xe5098f||0x0;var _0x2de33d=0x1/_0x54ed67;var _0x30866a=0x0;var _0x4c68f1=0x0;var _0xec5776=0x0;var _0x10b32f=0x0;for(var _0x133724=0x0;_0x10b32f<_0x5dd293;_0x133724+=0x1){_0x4c68f1=_0x133724/_0x5502c1;_0x30866a=(_0xcaa182*_0x4c68f1+_0xe5098f)/_0x2de33d;_0xec5776=utils[_0xc7d6('0x217')](_0x30866a,_0x517b26);_0x10b32f=_0x30866a/_0x517b26*(0x1-utils[_0xc7d6('0x217')](_0x30866a,_0x517b26));}return _0x2b747e({'erlangCalls':_0x133724,'erlangCallToSecond':_0x5502c1/_0x133724,'erlangAbandonmentRate':_0xec5776,'erlangBusyFactor':_0x10b32f});});};module['exports']=Dialer;
\ No newline at end of file
index 9c23770..7095824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032a=['countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','dialCutDigit','substring','exports','util','lodash','moment','string','voiceQueue','uniqueid','Contact','phone','firstName','lastName','number','queue','name','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnosuchnumberretry'];(function(_0x7ad6c4,_0x22b0f2){var _0x21eef2=function(_0x48aee2){while(--_0x48aee2){_0x7ad6c4['push'](_0x7ad6c4['shift']());}};_0x21eef2(++_0x22b0f2);}(_0x032a,0x135));var _0xa032=function(_0x257017,_0x330627){_0x257017=_0x257017-0x0;var _0x38536d=_0x032a[_0x257017];return _0x38536d;};'use strict';var util=require(_0xa032('0x0'));var _=require(_0xa032('0x1'));var moment=require(_0xa032('0x2'));function checkNameSurname(_0x33cae8,_0x4a5177,_0x33e78f){var _0x10cb6b='';if(!_['isNil'](_0x4a5177)&&_0xa032('0x3')===typeof _0x4a5177){_0x10cb6b+=_0x4a5177;}if(!_['isNil'](_0x33e78f)&&_0xa032('0x3')===typeof _0x33e78f){_0x10cb6b+='\x20'+_0x33e78f;}if(_0x10cb6b!==''){return _0x10cb6b;}return _0x33cae8;}function Action(_0x3b24df,_0x434465,_0x1228fd){this[_0xa032('0x4')]=_0x3b24df;this[_0xa032('0x5')]=_0x1228fd||undefined;this['name']=checkNameSurname(_0x434465[_0xa032('0x6')][_0xa032('0x7')],_0x434465[_0xa032('0x6')][_0xa032('0x8')],_0x434465['Contact'][_0xa032('0x9')]);this[_0xa032('0xa')]=_0x434465[_0xa032('0x7')];this[_0xa032('0xb')]=_0x3b24df[_0xa032('0xc')];this['active']=_0x434465['active']||![];this[_0xa032('0xd')]=_0x3b24df[_0xa032('0xd')];this[_0xa032('0xe')]=_0x3b24df[_0xa032('0xe')]||0x3;this[_0xa032('0xf')]=_0x434465['scheduledat'];this[_0xa032('0x10')]=_0x434465[_0xa032('0x10')];this[_0xa032('0x11')]=_0x434465['countcongestionretry'];this['countnoanswerretry']=_0x434465['countnoanswerretry'];this[_0xa032('0x12')]=_0x434465[_0xa032('0x12')];this['countdropretry']=_0x434465['countdropretry'];this[_0xa032('0x13')]=_0x434465[_0xa032('0x13')];this['countmachineretry']=_0x434465[_0xa032('0x14')];this[_0xa032('0x15')]=_0x434465[_0xa032('0x15')];this[_0xa032('0x16')]=_0x434465[_0xa032('0x16')];this[_0xa032('0x17')]=_0x434465[_0xa032('0x17')];this['UserId']=_0x434465[_0xa032('0x18')];this[_0xa032('0x19')]=_0x434465[_0xa032('0x19')];this[_0xa032('0x1a')]=_0x434465['CampaignId'];this[_0xa032('0x1b')]=_0x434465['id'];this[_0xa032('0x1c')]=_0x434465['Contact'][_0xa032('0x8')]||'';this['starttime']=moment()[_0xa032('0x1d')](_0xa032('0x1e'));this[_0xa032('0x1f')]=_0x434465[_0xa032('0x1f')];this[_0xa032('0x20')]=_0x434465['callbackuniqueid'];this[_0xa032('0x21')]=_0x434465['callbackat'];this[_0xa032('0x22')]=_0x434465['recallme'];this['originatecalleridnum']='';this[_0xa032('0x23')]='';}Action[_0xa032('0x24')][_0xa032('0x25')]=function(){return util[_0xa032('0x1d')]('\x22%s\x22\x20<%s>',this['name'],this[_0xa032('0x4')][_0xa032('0x26')]>0x0?this[_0xa032('0xa')][_0xa032('0x27')](this[_0xa032('0x4')][_0xa032('0x26')]):this[_0xa032('0xa')]);};Action[_0xa032('0x24')]['getQueue']=function(){return this[_0xa032('0xb')];};module[_0xa032('0x28')]=Action;
\ No newline at end of file
+var _0x3eb4=['lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','phone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eb4,0x105));var _0x43eb=function(_0x3f14ae,_0x3a6d1f){_0x3f14ae=_0x3f14ae-0x0;var _0x4b4d0b=_0x3eb4[_0x3f14ae];return _0x4b4d0b;};'use strict';var util=require(_0x43eb('0x0'));var _=require(_0x43eb('0x1'));var moment=require(_0x43eb('0x2'));function checkNameSurname(_0x484448,_0x15cd12,_0x1ebfd7){var _0x44c06b='';if(!_[_0x43eb('0x3')](_0x15cd12)&&_0x43eb('0x4')===typeof _0x15cd12){_0x44c06b+=_0x15cd12;}if(!_[_0x43eb('0x3')](_0x1ebfd7)&&_0x43eb('0x4')===typeof _0x1ebfd7){_0x44c06b+='\x20'+_0x1ebfd7;}if(_0x44c06b!==''){return _0x44c06b;}return _0x484448;}function Action(_0x129bd7,_0xd1cf9d,_0x2be18f){this[_0x43eb('0x5')]=_0x129bd7;this[_0x43eb('0x6')]=_0x2be18f||undefined;this['name']=checkNameSurname(_0xd1cf9d[_0x43eb('0x7')][_0x43eb('0x8')],_0xd1cf9d[_0x43eb('0x7')]['firstName'],_0xd1cf9d[_0x43eb('0x7')][_0x43eb('0x9')]);this[_0x43eb('0xa')]=_0xd1cf9d[_0x43eb('0x8')];this[_0x43eb('0xb')]=_0x129bd7[_0x43eb('0xc')];this['active']=_0xd1cf9d[_0x43eb('0xd')]||![];this[_0x43eb('0xe')]=_0x129bd7[_0x43eb('0xe')];this[_0x43eb('0xf')]=_0x129bd7[_0x43eb('0xf')]||0x3;this[_0x43eb('0x10')]=_0xd1cf9d[_0x43eb('0x10')];this['countbusyretry']=_0xd1cf9d['countbusyretry'];this[_0x43eb('0x11')]=_0xd1cf9d[_0x43eb('0x11')];this[_0x43eb('0x12')]=_0xd1cf9d[_0x43eb('0x12')];this[_0x43eb('0x13')]=_0xd1cf9d[_0x43eb('0x13')];this['countdropretry']=_0xd1cf9d['countdropretry'];this[_0x43eb('0x14')]=_0xd1cf9d[_0x43eb('0x14')];this[_0x43eb('0x15')]=_0xd1cf9d[_0x43eb('0x15')];this[_0x43eb('0x16')]=_0xd1cf9d['countagentrejectretry'];this[_0x43eb('0x17')]=_0xd1cf9d[_0x43eb('0x17')];this[_0x43eb('0x18')]=_0xd1cf9d['ListId'];this[_0x43eb('0x19')]=_0xd1cf9d[_0x43eb('0x19')];this[_0x43eb('0x1a')]=_0xd1cf9d[_0x43eb('0x1a')];this[_0x43eb('0x1b')]=_0xd1cf9d[_0x43eb('0x1b')];this[_0x43eb('0x1c')]=_0xd1cf9d['id'];this[_0x43eb('0x1d')]=_0xd1cf9d[_0x43eb('0x7')]['firstName']||'';this[_0x43eb('0x1e')]=moment()[_0x43eb('0x1f')](_0x43eb('0x20'));this[_0x43eb('0x21')]=_0xd1cf9d[_0x43eb('0x21')];this[_0x43eb('0x22')]=_0xd1cf9d[_0x43eb('0x22')];this['callbackat']=_0xd1cf9d[_0x43eb('0x23')];this[_0x43eb('0x24')]=_0xd1cf9d[_0x43eb('0x24')];this['originatecalleridnum']='';this[_0x43eb('0x25')]='';}Action[_0x43eb('0x26')][_0x43eb('0x27')]=function(){return util[_0x43eb('0x1f')](_0x43eb('0x28'),this[_0x43eb('0xc')],this['voiceQueue']['dialCutDigit']>0x0?this[_0x43eb('0xa')][_0x43eb('0x29')](this[_0x43eb('0x5')][_0x43eb('0x2a')]):this[_0x43eb('0xa')]);};Action['prototype'][_0x43eb('0x2b')]=function(){return this[_0x43eb('0xb')];};module[_0x43eb('0x2c')]=Action;
\ No newline at end of file
index d2f52b0..fc64e41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa511=['originatecalleridnum','originatecalleridname','agiafterat','exports','state','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','answertime','format','ringtime','getSeconds','holdtime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xa511,0x144));var _0x1a51=function(_0x5ddef9,_0x263512){_0x5ddef9=_0x5ddef9-0x0;var _0x416904=_0xa511[_0x5ddef9];return _0x416904;};'use strict';var moment=require('moment');var utils=require('../utils');function AgentComplete(_0x3bc979,_0x37c7ec){this[_0x1a51('0x0')]=0x4;this['statedesc']='Answer';this[_0x1a51('0x1')]=_0x3bc979[_0x1a51('0x1')];this[_0x1a51('0x2')]=_0x3bc979[_0x1a51('0x2')];this[_0x1a51('0x3')]=_0x3bc979[_0x1a51('0x2')]===_0x1a51('0x4')?'queue':_0x3bc979['type'];this['countbusyretry']=_0x3bc979[_0x1a51('0x5')];this['countcongestionretry']=_0x3bc979[_0x1a51('0x6')];this[_0x1a51('0x7')]=_0x3bc979[_0x1a51('0x7')];this[_0x1a51('0x8')]=_0x3bc979[_0x1a51('0x5')]+_0x3bc979['countcongestionretry']+_0x3bc979[_0x1a51('0x7')]+_0x3bc979['countnosuchnumberretry']+_0x3bc979[_0x1a51('0x9')]+_0x3bc979[_0x1a51('0xa')]+_0x3bc979[_0x1a51('0xb')]+_0x3bc979['countagentrejectretry'];this[_0x1a51('0xc')]=_0x3bc979[_0x1a51('0xc')];this[_0x1a51('0x9')]=_0x3bc979['countdropretry'];this[_0x1a51('0xa')]=_0x3bc979['countabandonedretry'];this[_0x1a51('0xb')]=_0x3bc979[_0x1a51('0xb')];this['countagentrejectretry']=_0x3bc979[_0x1a51('0xd')];this['uniqueid']=_0x37c7ec['uniqueid'];this[_0x1a51('0xe')]=_0x3bc979['name'];this[_0x1a51('0xf')]=_0x3bc979[_0x1a51('0x10')];this[_0x1a51('0x11')]=_0x3bc979['starttime'];this['responsetime']=_0x3bc979[_0x1a51('0x12')];this[_0x1a51('0x13')]=_0x3bc979[_0x1a51('0x13')];this['endtime']=moment()[_0x1a51('0x14')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1a51('0x15')]=utils[_0x1a51('0x16')](_0x3bc979['responsetime'],_0x3bc979[_0x1a51('0x11')]);this[_0x1a51('0x17')]=utils[_0x1a51('0x16')](_0x3bc979[_0x1a51('0x13')],_0x3bc979['responsetime']);this['talktime']=utils[_0x1a51('0x16')](this[_0x1a51('0x18')],_0x3bc979[_0x1a51('0x13')]);this['queue']=_0x37c7ec[_0x1a51('0x19')];this[_0x1a51('0x1a')]=_0x37c7ec[_0x1a51('0x1a')];this[_0x1a51('0x1b')]=_0x37c7ec[_0x1a51('0x1b')];this['callback']=_0x3bc979[_0x1a51('0x1c')];this[_0x1a51('0x1d')]=_0x3bc979[_0x1a51('0x1d')];this[_0x1a51('0x1e')]=_0x3bc979['callbackat'];this[_0x1a51('0x1f')]=_0x3bc979[_0x1a51('0x1f')];this['ContactId']=_0x3bc979['ContactId'];this[_0x1a51('0x20')]=_0x3bc979[_0x1a51('0x20')];this[_0x1a51('0x21')]=_0x3bc979[_0x1a51('0x21')];this['VoiceQueueId']=_0x3bc979[_0x1a51('0x22')];this[_0x1a51('0x23')]=_0x3bc979['CampaignId'];this[_0x1a51('0x24')]=_0x3bc979['originatecalleridnum']||'';this[_0x1a51('0x25')]=_0x3bc979[_0x1a51('0x25')]||'';this[_0x1a51('0x26')]=_0x3bc979['agiafterat'];}module[_0x1a51('0x27')]=AgentComplete;
\ No newline at end of file
+var _0xf14f=['reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','membername'];(function(_0x2a7517,_0x46caf1){var _0x32c1c8=function(_0x36c645){while(--_0x36c645){_0x2a7517['push'](_0x2a7517['shift']());}};_0x32c1c8(++_0x46caf1);}(_0xf14f,0x1c3));var _0xff14=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0xf14f[_0x46401e];return _0x447cba;};'use strict';var moment=require(_0xff14('0x0'));var utils=require(_0xff14('0x1'));function AgentComplete(_0x25876b,_0x55c3c7){this['state']=0x4;this[_0xff14('0x2')]=_0xff14('0x3');this[_0xff14('0x4')]=_0x25876b[_0xff14('0x4')];this['type']=_0x25876b[_0xff14('0x5')];this[_0xff14('0x6')]=_0x25876b[_0xff14('0x5')]===_0xff14('0x7')?_0xff14('0x8'):_0x25876b[_0xff14('0x5')];this[_0xff14('0x9')]=_0x25876b[_0xff14('0x9')];this[_0xff14('0xa')]=_0x25876b['countcongestionretry'];this['countnoanswerretry']=_0x25876b[_0xff14('0xb')];this[_0xff14('0xc')]=_0x25876b['countbusyretry']+_0x25876b[_0xff14('0xa')]+_0x25876b[_0xff14('0xb')]+_0x25876b[_0xff14('0xd')]+_0x25876b[_0xff14('0xe')]+_0x25876b[_0xff14('0xf')]+_0x25876b[_0xff14('0x10')]+_0x25876b['countagentrejectretry'];this[_0xff14('0xd')]=_0x25876b[_0xff14('0xd')];this[_0xff14('0xe')]=_0x25876b[_0xff14('0xe')];this[_0xff14('0xf')]=_0x25876b['countabandonedretry'];this[_0xff14('0x10')]=_0x25876b['countmachineretry'];this[_0xff14('0x11')]=_0x25876b['countagentrejectretry'];this[_0xff14('0x12')]=_0x55c3c7[_0xff14('0x12')];this[_0xff14('0x13')]=_0x25876b[_0xff14('0x14')];this[_0xff14('0x15')]=_0x25876b['number'];this[_0xff14('0x16')]=_0x25876b[_0xff14('0x16')];this[_0xff14('0x17')]=_0x25876b[_0xff14('0x17')];this[_0xff14('0x18')]=_0x25876b[_0xff14('0x18')];this[_0xff14('0x19')]=moment()[_0xff14('0x1a')](_0xff14('0x1b'));this[_0xff14('0x1c')]=utils[_0xff14('0x1d')](_0x25876b[_0xff14('0x17')],_0x25876b[_0xff14('0x16')]);this[_0xff14('0x1e')]=utils['getSeconds'](_0x25876b[_0xff14('0x18')],_0x25876b['responsetime']);this[_0xff14('0x1f')]=utils['getSeconds'](this[_0xff14('0x19')],_0x25876b[_0xff14('0x18')]);this[_0xff14('0x8')]=_0x55c3c7[_0xff14('0x8')];this[_0xff14('0x20')]=_0x55c3c7[_0xff14('0x20')];this[_0xff14('0x21')]=_0x55c3c7[_0xff14('0x21')];this[_0xff14('0x22')]=_0x25876b[_0xff14('0x22')];this[_0xff14('0x23')]=_0x25876b['callbackuniqueid'];this['callbackat']=_0x25876b[_0xff14('0x24')];this[_0xff14('0x25')]=_0x25876b['recallme'];this['ContactId']=_0x25876b['ContactId'];this[_0xff14('0x26')]=_0x25876b[_0xff14('0x26')];this['UserId']=_0x25876b[_0xff14('0x27')];this[_0xff14('0x28')]=_0x25876b['VoiceQueueId'];this[_0xff14('0x29')]=_0x25876b['CampaignId'];this[_0xff14('0x2a')]=_0x25876b[_0xff14('0x2a')]||'';this['originatecalleridname']=_0x25876b[_0xff14('0x2b')]||'';this['agiafterat']=_0x25876b['agiafterat'];}module['exports']=AgentComplete;
\ No newline at end of file
index 57535eb..8bb224d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37de=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid'];(function(_0x1b7d85,_0x38e492){var _0x529046=function(_0x15c714){while(--_0x15c714){_0x1b7d85['push'](_0x1b7d85['shift']());}};_0x529046(++_0x38e492);}(_0x37de,0xba));var _0xe37d=function(_0x3388d8,_0x256024){_0x3388d8=_0x3388d8-0x0;var _0x2bbe73=_0x37de[_0x3388d8];return _0x2bbe73;};'use strict';function Final(_0x375f58){this[_0xe37d('0x0')]=_0x375f58[_0xe37d('0x0')];this[_0xe37d('0x1')]=_0x375f58[_0xe37d('0x1')];this[_0xe37d('0x2')]=_0x375f58[_0xe37d('0x2')];this[_0xe37d('0x3')]=_0x375f58[_0xe37d('0x2')]===_0xe37d('0x4')?_0xe37d('0x5'):_0x375f58[_0xe37d('0x2')];this[_0xe37d('0x6')]=_0x375f58[_0xe37d('0x6')];this['countcongestionretry']=_0x375f58['countcongestionretry'];this[_0xe37d('0x7')]=_0x375f58[_0xe37d('0x7')];this['countglobal']=_0x375f58['countbusyretry']+_0x375f58[_0xe37d('0x8')]+_0x375f58['countnoanswerretry']+_0x375f58[_0xe37d('0x9')]+_0x375f58[_0xe37d('0xa')]+_0x375f58[_0xe37d('0xb')]+_0x375f58[_0xe37d('0xc')]+_0x375f58[_0xe37d('0xd')];this[_0xe37d('0x9')]=_0x375f58[_0xe37d('0x9')];this[_0xe37d('0xa')]=_0x375f58[_0xe37d('0xa')];this[_0xe37d('0xb')]=_0x375f58[_0xe37d('0xb')];this[_0xe37d('0xc')]=_0x375f58[_0xe37d('0xc')];this[_0xe37d('0xd')]=_0x375f58[_0xe37d('0xd')];this[_0xe37d('0x5')]=_0x375f58[_0xe37d('0x5')];this[_0xe37d('0xe')]=_0x375f58[_0xe37d('0xe')];this[_0xe37d('0xf')]=_0x375f58['calleridnum'];this['starttime']=_0x375f58[_0xe37d('0x10')];this[_0xe37d('0x11')]=_0x375f58[_0xe37d('0x11')];this[_0xe37d('0x12')]=_0x375f58[_0xe37d('0x11')];this[_0xe37d('0x13')]=_0x375f58[_0xe37d('0x13')]||0x0;this[_0xe37d('0x14')]=_0x375f58[_0xe37d('0x14')]||0x0;this['talktime']=_0x375f58[_0xe37d('0x15')]||0x0;this[_0xe37d('0x16')]=_0x375f58[_0xe37d('0x16')];this['callbackuniqueid']=_0x375f58[_0xe37d('0x17')];this[_0xe37d('0x18')]=_0x375f58['callbackat'];this[_0xe37d('0x19')]=_0x375f58[_0xe37d('0x19')];this[_0xe37d('0x1a')]=_0x375f58[_0xe37d('0x1a')];this[_0xe37d('0x1b')]=_0x375f58['ListId'];this['UserId']=_0x375f58[_0xe37d('0x1c')];this[_0xe37d('0x1d')]=_0x375f58[_0xe37d('0x1d')];this[_0xe37d('0x1e')]=_0x375f58[_0xe37d('0x1e')];this[_0xe37d('0x1f')]=_0x375f58[_0xe37d('0x1f')]||'';this[_0xe37d('0x20')]=_0x375f58[_0xe37d('0x20')]||'';this['state']=_0x375f58['state'];this['statedesc']=_0x375f58[_0xe37d('0x21')];}module[_0xe37d('0x22')]=Final;
\ No newline at end of file
+var _0x1f6e=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x1f6e,0xb0));var _0xe1f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f6e[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x398ab1){this['uniqueid']=_0x398ab1[_0xe1f6('0x0')];this[_0xe1f6('0x1')]=_0x398ab1[_0xe1f6('0x1')];this[_0xe1f6('0x2')]=_0x398ab1[_0xe1f6('0x2')];this[_0xe1f6('0x3')]=_0x398ab1['type']==='outbound'?_0xe1f6('0x4'):_0x398ab1[_0xe1f6('0x2')];this['countbusyretry']=_0x398ab1[_0xe1f6('0x5')];this['countcongestionretry']=_0x398ab1[_0xe1f6('0x6')];this[_0xe1f6('0x7')]=_0x398ab1[_0xe1f6('0x7')];this[_0xe1f6('0x8')]=_0x398ab1[_0xe1f6('0x5')]+_0x398ab1['countcongestionretry']+_0x398ab1[_0xe1f6('0x7')]+_0x398ab1[_0xe1f6('0x9')]+_0x398ab1['countdropretry']+_0x398ab1['countabandonedretry']+_0x398ab1['countmachineretry']+_0x398ab1[_0xe1f6('0xa')];this['countnosuchnumberretry']=_0x398ab1[_0xe1f6('0x9')];this[_0xe1f6('0xb')]=_0x398ab1[_0xe1f6('0xb')];this[_0xe1f6('0xc')]=_0x398ab1['countabandonedretry'];this[_0xe1f6('0xd')]=_0x398ab1[_0xe1f6('0xd')];this[_0xe1f6('0xa')]=_0x398ab1[_0xe1f6('0xa')];this[_0xe1f6('0x4')]=_0x398ab1[_0xe1f6('0x4')];this[_0xe1f6('0xe')]=_0x398ab1[_0xe1f6('0xe')];this[_0xe1f6('0xf')]=_0x398ab1[_0xe1f6('0xf')];this[_0xe1f6('0x10')]=_0x398ab1[_0xe1f6('0x10')];this[_0xe1f6('0x11')]=_0x398ab1['responsetime'];this[_0xe1f6('0x12')]=_0x398ab1[_0xe1f6('0x11')];this[_0xe1f6('0x13')]=_0x398ab1[_0xe1f6('0x13')]||0x0;this[_0xe1f6('0x14')]=_0x398ab1[_0xe1f6('0x14')]||0x0;this[_0xe1f6('0x15')]=_0x398ab1['talktime']||0x0;this[_0xe1f6('0x16')]=_0x398ab1[_0xe1f6('0x16')];this[_0xe1f6('0x17')]=_0x398ab1[_0xe1f6('0x17')];this['callbackat']=_0x398ab1[_0xe1f6('0x18')];this[_0xe1f6('0x19')]=_0x398ab1[_0xe1f6('0x19')];this[_0xe1f6('0x1a')]=_0x398ab1['ContactId'];this[_0xe1f6('0x1b')]=_0x398ab1[_0xe1f6('0x1b')];this['UserId']=_0x398ab1[_0xe1f6('0x1c')];this['VoiceQueueId']=_0x398ab1[_0xe1f6('0x1d')];this['CampaignId']=_0x398ab1[_0xe1f6('0x1e')];this[_0xe1f6('0x1f')]=_0x398ab1[_0xe1f6('0x1f')]||'';this[_0xe1f6('0x20')]=_0x398ab1[_0xe1f6('0x20')]||'';this[_0xe1f6('0x21')]=_0x398ab1['state'];this[_0xe1f6('0x22')]=_0x398ab1[_0xe1f6('0x22')];}module[_0xe1f6('0x23')]=Final;
\ No newline at end of file
index 2d324bb..98ea07a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0668=['ListId','UserId','VoiceQueueId','CampaignId','exports','moment','../utils','Answer','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','holdtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0xccc579,_0x3def9a){var _0x33d5ae=function(_0x43bbd6){while(--_0x43bbd6){_0xccc579['push'](_0xccc579['shift']());}};_0x33d5ae(++_0x3def9a);}(_0x0668,0x7d));var _0x8066=function(_0x403160,_0x33497f){_0x403160=_0x403160-0x0;var _0x50c5a2=_0x0668[_0x403160];return _0x50c5a2;};'use strict';var moment=require(_0x8066('0x0'));var utils=require(_0x8066('0x1'));function Hangup(_0x3bc881,_0x3852f3){this['state']=0x4;this['statedesc']=_0x8066('0x2');this[_0x8066('0x3')]=_0x3bc881[_0x8066('0x3')];this[_0x8066('0x4')]=_0x3bc881[_0x8066('0x4')];this['campaigntype']=_0x3bc881[_0x8066('0x4')]===_0x8066('0x5')?_0x8066('0x6'):_0x3bc881[_0x8066('0x4')];this[_0x8066('0x7')]=_0x3bc881['amd']||![];this[_0x8066('0x8')]=_0x3bc881[_0x8066('0x8')];this[_0x8066('0x9')]=_0x3bc881['countcongestionretry'];this[_0x8066('0xa')]=_0x3bc881['countnoanswerretry'];this[_0x8066('0xb')]=_0x3bc881[_0x8066('0x8')]+_0x3bc881[_0x8066('0x9')]+_0x3bc881[_0x8066('0xa')]+_0x3bc881['countnosuchnumberretry']+_0x3bc881[_0x8066('0xc')]+_0x3bc881[_0x8066('0xd')]+_0x3bc881[_0x8066('0xe')]+_0x3bc881[_0x8066('0xf')];this['countnosuchnumberretry']=_0x3bc881[_0x8066('0x10')];this[_0x8066('0xc')]=_0x3bc881[_0x8066('0xc')];this[_0x8066('0xd')]=_0x3bc881['countabandonedretry'];this['countmachineretry']=_0x3bc881[_0x8066('0xe')];this[_0x8066('0xf')]=_0x3bc881[_0x8066('0xf')];this[_0x8066('0x11')]=_0x3852f3[_0x8066('0x11')];this['calleridname']=_0x3bc881[_0x8066('0x12')];this[_0x8066('0x13')]=_0x3bc881[_0x8066('0x14')];this['starttime']=_0x3bc881[_0x8066('0x15')];this[_0x8066('0x16')]=_0x3bc881[_0x8066('0x16')];this[_0x8066('0x17')]=moment()[_0x8066('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x8066('0x19')]=utils[_0x8066('0x1a')](_0x3bc881[_0x8066('0x16')],_0x3bc881[_0x8066('0x15')]);this[_0x8066('0x1b')]=0x0;this['talktime']=utils[_0x8066('0x1a')](this['endtime'],_0x3bc881[_0x8066('0x16')]);this[_0x8066('0x6')]=_0x3bc881[_0x8066('0x6')];this['membername']='IVR';this[_0x8066('0x1c')]=_0x3852f3[_0x8066('0x1d')];this[_0x8066('0x1e')]=_0x3bc881[_0x8066('0x1e')];this[_0x8066('0x1f')]=_0x3bc881[_0x8066('0x1f')];this[_0x8066('0x20')]=_0x3bc881['callbackat'];this[_0x8066('0x21')]=_0x3bc881[_0x8066('0x21')];this['ContactId']=_0x3bc881[_0x8066('0x22')];this['ListId']=_0x3bc881[_0x8066('0x23')];this[_0x8066('0x24')]=_0x3bc881[_0x8066('0x24')];this[_0x8066('0x25')]=_0x3bc881['VoiceQueueId'];this['CampaignId']=_0x3bc881[_0x8066('0x26')];}module[_0x8066('0x27')]=Hangup;
\ No newline at end of file
+var _0xfe00=['starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','statedesc','Answer','scheduledat','type','campaigntype','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfe00,0x6d));var _0x0fe0=function(_0xf6ec0b,_0x3d8b8c){_0xf6ec0b=_0xf6ec0b-0x0;var _0x3c31b9=_0xfe00[_0xf6ec0b];return _0x3c31b9;};'use strict';var moment=require(_0x0fe0('0x0'));var utils=require('../utils');function Hangup(_0x4f2bc9,_0x3e165c){this[_0x0fe0('0x1')]=0x4;this[_0x0fe0('0x2')]=_0x0fe0('0x3');this[_0x0fe0('0x4')]=_0x4f2bc9[_0x0fe0('0x4')];this[_0x0fe0('0x5')]=_0x4f2bc9['type'];this[_0x0fe0('0x6')]=_0x4f2bc9[_0x0fe0('0x5')]==='outbound'?_0x0fe0('0x7'):_0x4f2bc9[_0x0fe0('0x5')];this[_0x0fe0('0x8')]=_0x4f2bc9['amd']||![];this[_0x0fe0('0x9')]=_0x4f2bc9[_0x0fe0('0x9')];this[_0x0fe0('0xa')]=_0x4f2bc9[_0x0fe0('0xa')];this[_0x0fe0('0xb')]=_0x4f2bc9[_0x0fe0('0xb')];this[_0x0fe0('0xc')]=_0x4f2bc9[_0x0fe0('0x9')]+_0x4f2bc9['countcongestionretry']+_0x4f2bc9[_0x0fe0('0xb')]+_0x4f2bc9['countnosuchnumberretry']+_0x4f2bc9['countdropretry']+_0x4f2bc9[_0x0fe0('0xd')]+_0x4f2bc9['countmachineretry']+_0x4f2bc9[_0x0fe0('0xe')];this[_0x0fe0('0xf')]=_0x4f2bc9[_0x0fe0('0xf')];this['countdropretry']=_0x4f2bc9[_0x0fe0('0x10')];this[_0x0fe0('0xd')]=_0x4f2bc9[_0x0fe0('0xd')];this[_0x0fe0('0x11')]=_0x4f2bc9['countmachineretry'];this['countagentrejectretry']=_0x4f2bc9[_0x0fe0('0xe')];this[_0x0fe0('0x12')]=_0x3e165c['uniqueid'];this[_0x0fe0('0x13')]=_0x4f2bc9[_0x0fe0('0x14')];this[_0x0fe0('0x15')]=_0x4f2bc9[_0x0fe0('0x16')];this[_0x0fe0('0x17')]=_0x4f2bc9[_0x0fe0('0x17')];this[_0x0fe0('0x18')]=_0x4f2bc9[_0x0fe0('0x18')];this['endtime']=moment()[_0x0fe0('0x19')](_0x0fe0('0x1a'));this[_0x0fe0('0x1b')]=utils[_0x0fe0('0x1c')](_0x4f2bc9[_0x0fe0('0x18')],_0x4f2bc9[_0x0fe0('0x17')]);this[_0x0fe0('0x1d')]=0x0;this[_0x0fe0('0x1e')]=utils[_0x0fe0('0x1c')](this[_0x0fe0('0x1f')],_0x4f2bc9[_0x0fe0('0x18')]);this[_0x0fe0('0x7')]=_0x4f2bc9[_0x0fe0('0x7')];this['membername']='IVR';this[_0x0fe0('0x20')]=_0x3e165c[_0x0fe0('0x21')];this[_0x0fe0('0x22')]=_0x4f2bc9[_0x0fe0('0x22')];this[_0x0fe0('0x23')]=_0x4f2bc9['callbackuniqueid'];this[_0x0fe0('0x24')]=_0x4f2bc9[_0x0fe0('0x24')];this[_0x0fe0('0x25')]=_0x4f2bc9[_0x0fe0('0x25')];this[_0x0fe0('0x26')]=_0x4f2bc9['ContactId'];this['ListId']=_0x4f2bc9[_0x0fe0('0x27')];this[_0x0fe0('0x28')]=_0x4f2bc9[_0x0fe0('0x28')];this['VoiceQueueId']=_0x4f2bc9[_0x0fe0('0x29')];this['CampaignId']=_0x4f2bc9[_0x0fe0('0x2a')];}module[_0x0fe0('0x2b')]=Hangup;
\ No newline at end of file
index 8746716..3ae35fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x943f=['ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','exports','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','calleridnum','starttime','responsetime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x105a1a,_0x40e12c){var _0x586215=function(_0x292fcd){while(--_0x292fcd){_0x105a1a['push'](_0x105a1a['shift']());}};_0x586215(++_0x40e12c);}(_0x943f,0xa7));var _0xf943=function(_0x232eae,_0x125c74){_0x232eae=_0x232eae-0x0;var _0x265692=_0x943f[_0x232eae];return _0x265692;};'use strict';var utils=require('../utils');function History(_0x37cbad){this[_0xf943('0x0')]=_0x37cbad[_0xf943('0x0')];this['scheduledat']=_0x37cbad[_0xf943('0x1')]||undefined;this['type']=_0x37cbad[_0xf943('0x2')];this['campaigntype']=_0x37cbad[_0xf943('0x2')]===_0xf943('0x3')?_0xf943('0x4'):_0x37cbad[_0xf943('0x2')];this[_0xf943('0x5')]=_0x37cbad['countbusyretry'];this[_0xf943('0x6')]=_0x37cbad['countcongestionretry'];this[_0xf943('0x7')]=_0x37cbad[_0xf943('0x7')];this[_0xf943('0x8')]=_0x37cbad[_0xf943('0x5')]+_0x37cbad[_0xf943('0x6')]+_0x37cbad['countnoanswerretry']+_0x37cbad[_0xf943('0x9')]+_0x37cbad[_0xf943('0xa')]+_0x37cbad['countabandonedretry']+_0x37cbad[_0xf943('0xb')]+_0x37cbad['countagentrejectretry'];this[_0xf943('0x9')]=_0x37cbad[_0xf943('0x9')];this[_0xf943('0xa')]=_0x37cbad[_0xf943('0xa')];this['countabandonedretry']=_0x37cbad[_0xf943('0xc')];this[_0xf943('0xb')]=_0x37cbad[_0xf943('0xb')];this['countagentrejectretry']=_0x37cbad[_0xf943('0xd')];this[_0xf943('0x4')]=_0x37cbad[_0xf943('0x4')];this['calleridname']=_0x37cbad['name'];this[_0xf943('0xe')]=_0x37cbad['number'];this[_0xf943('0xf')]=_0x37cbad[_0xf943('0xf')];this[_0xf943('0x10')]=_0x37cbad[_0xf943('0x10')];this['endtime']=_0x37cbad[_0xf943('0x10')];this[_0xf943('0x11')]=utils[_0xf943('0x12')](_0x37cbad[_0xf943('0x10')],_0x37cbad['starttime']);this[_0xf943('0x13')]=0x0;this[_0xf943('0x14')]=0x0;this['callback']=_0x37cbad[_0xf943('0x15')];this[_0xf943('0x16')]=_0x37cbad[_0xf943('0x16')];this[_0xf943('0x17')]=_0x37cbad[_0xf943('0x17')];this[_0xf943('0x18')]=_0x37cbad[_0xf943('0x18')];this[_0xf943('0x19')]=_0x37cbad[_0xf943('0x19')];this['ListId']=_0x37cbad['ListId'];this[_0xf943('0x1a')]=_0x37cbad[_0xf943('0x1a')];this[_0xf943('0x1b')]=_0x37cbad[_0xf943('0x1b')];this['CampaignId']=_0x37cbad[_0xf943('0x1c')];this['originatecalleridnum']=_0x37cbad['originatecalleridnum']||'';this[_0xf943('0x1d')]=_0x37cbad['originatecalleridname']||'';this[_0xf943('0x1e')]=_0x37cbad[_0xf943('0x1e')];this['statedesc']=_0x37cbad['statedesc'];}module[_0xf943('0x1f')]=History;
\ No newline at end of file
+var _0x4d21=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','name','responsetime','getSeconds','starttime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x4d21,0x7c));var _0x14d2=function(_0x493fe2,_0xb64d6c){_0x493fe2=_0x493fe2-0x0;var _0x24e309=_0x4d21[_0x493fe2];return _0x24e309;};'use strict';var utils=require(_0x14d2('0x0'));function History(_0x38e449){this[_0x14d2('0x1')]=_0x38e449['uniqueid'];this[_0x14d2('0x2')]=_0x38e449['scheduledat']||undefined;this[_0x14d2('0x3')]=_0x38e449[_0x14d2('0x3')];this[_0x14d2('0x4')]=_0x38e449[_0x14d2('0x3')]===_0x14d2('0x5')?_0x14d2('0x6'):_0x38e449[_0x14d2('0x3')];this['countbusyretry']=_0x38e449[_0x14d2('0x7')];this[_0x14d2('0x8')]=_0x38e449[_0x14d2('0x8')];this[_0x14d2('0x9')]=_0x38e449['countnoanswerretry'];this['countglobal']=_0x38e449['countbusyretry']+_0x38e449[_0x14d2('0x8')]+_0x38e449[_0x14d2('0x9')]+_0x38e449[_0x14d2('0xa')]+_0x38e449[_0x14d2('0xb')]+_0x38e449[_0x14d2('0xc')]+_0x38e449['countmachineretry']+_0x38e449[_0x14d2('0xd')];this[_0x14d2('0xa')]=_0x38e449[_0x14d2('0xa')];this['countdropretry']=_0x38e449[_0x14d2('0xb')];this[_0x14d2('0xc')]=_0x38e449[_0x14d2('0xc')];this['countmachineretry']=_0x38e449[_0x14d2('0xe')];this[_0x14d2('0xd')]=_0x38e449['countagentrejectretry'];this['queue']=_0x38e449['queue'];this['calleridname']=_0x38e449[_0x14d2('0xf')];this['calleridnum']=_0x38e449['number'];this['starttime']=_0x38e449['starttime'];this[_0x14d2('0x10')]=_0x38e449[_0x14d2('0x10')];this['endtime']=_0x38e449[_0x14d2('0x10')];this['ringtime']=utils[_0x14d2('0x11')](_0x38e449[_0x14d2('0x10')],_0x38e449[_0x14d2('0x12')]);this['holdtime']=0x0;this[_0x14d2('0x13')]=0x0;this['callback']=_0x38e449['callback'];this[_0x14d2('0x14')]=_0x38e449[_0x14d2('0x14')];this[_0x14d2('0x15')]=_0x38e449[_0x14d2('0x15')];this[_0x14d2('0x16')]=_0x38e449[_0x14d2('0x16')];this[_0x14d2('0x17')]=_0x38e449[_0x14d2('0x17')];this[_0x14d2('0x18')]=_0x38e449[_0x14d2('0x18')];this[_0x14d2('0x19')]=_0x38e449['UserId'];this['VoiceQueueId']=_0x38e449[_0x14d2('0x1a')];this['CampaignId']=_0x38e449[_0x14d2('0x1b')];this[_0x14d2('0x1c')]=_0x38e449[_0x14d2('0x1c')]||'';this[_0x14d2('0x1d')]=_0x38e449[_0x14d2('0x1d')]||'';this['state']=_0x38e449[_0x14d2('0x1e')];this[_0x14d2('0x1f')]=_0x38e449[_0x14d2('0x1f')];}module[_0x14d2('0x20')]=History;
\ No newline at end of file
index 47ddc3c..e5e88d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cdf=['droptime','dropreason','ringtime','getSeconds','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime'];(function(_0x24360c,_0x49fdc5){var _0x427d13=function(_0x520f25){while(--_0x520f25){_0x24360c['push'](_0x24360c['shift']());}};_0x427d13(++_0x49fdc5);}(_0x8cdf,0x10d));var _0xf8cd=function(_0x186cea,_0x57db8f){_0x186cea=_0x186cea-0x0;var _0x37303d=_0x8cdf[_0x186cea];return _0x37303d;};'use strict';var utils=require(_0xf8cd('0x0'));function QueueCallerAbandon(_0x484996,_0xe7d7cd){this[_0xf8cd('0x1')]=_0x484996[_0xf8cd('0x1')];this[_0xf8cd('0x2')]=_0x484996['type'];this['campaigntype']=_0x484996[_0xf8cd('0x2')]===_0xf8cd('0x3')?_0xf8cd('0x4'):_0x484996[_0xf8cd('0x2')];this[_0xf8cd('0x5')]=_0x484996[_0xf8cd('0x5')];this[_0xf8cd('0x6')]=_0x484996[_0xf8cd('0x6')];this[_0xf8cd('0x7')]=_0x484996['countnoanswerretry'];this['countglobal']=_0x484996[_0xf8cd('0x5')]+_0x484996['countcongestionretry']+_0x484996['countnoanswerretry']+_0x484996[_0xf8cd('0x8')]+_0x484996[_0xf8cd('0x9')]+_0x484996['countabandonedretry']+_0x484996[_0xf8cd('0xa')]+_0x484996[_0xf8cd('0xb')];this[_0xf8cd('0x8')]=_0x484996['countnosuchnumberretry'];this[_0xf8cd('0x9')]=_0x484996[_0xf8cd('0x9')];this['countabandonedretry']=_0x484996['countabandonedretry'];this[_0xf8cd('0xa')]=_0x484996[_0xf8cd('0xa')];this['countagentrejectretry']=_0x484996[_0xf8cd('0xb')];this['uniqueid']=_0xe7d7cd[_0xf8cd('0xc')];this[_0xf8cd('0xd')]=_0x484996[_0xf8cd('0xe')];this['calleridnum']=_0x484996[_0xf8cd('0xf')];this[_0xf8cd('0x10')]=_0x484996[_0xf8cd('0x10')];this[_0xf8cd('0x11')]=_0x484996['responsetime'];this['droptime']=_0x484996[_0xf8cd('0x12')];this[_0xf8cd('0x13')]=_0x484996[_0xf8cd('0x13')];this['endtime']=this[_0xf8cd('0x12')];this[_0xf8cd('0x14')]=utils[_0xf8cd('0x15')](_0x484996[_0xf8cd('0x11')],_0x484996['starttime']);this[_0xf8cd('0x16')]=utils[_0xf8cd('0x15')](this['droptime'],_0x484996[_0xf8cd('0x11')]);this[_0xf8cd('0x17')]=0x0;this[_0xf8cd('0x4')]=_0xe7d7cd[_0xf8cd('0x4')];this[_0xf8cd('0x18')]=_0xe7d7cd['connectedlinename'];this['reason']=_0xe7d7cd[_0xf8cd('0x19')];this[_0xf8cd('0x1a')]=_0x484996[_0xf8cd('0x1a')];this[_0xf8cd('0x1b')]=_0x484996[_0xf8cd('0x1b')];this[_0xf8cd('0x1c')]=_0x484996[_0xf8cd('0x1c')];this[_0xf8cd('0x1d')]=_0x484996[_0xf8cd('0x1d')];this[_0xf8cd('0x1e')]=_0x484996['ContactId'];this[_0xf8cd('0x1f')]=_0x484996[_0xf8cd('0x1f')];this[_0xf8cd('0x20')]=_0x484996[_0xf8cd('0x20')];this[_0xf8cd('0x21')]=_0x484996[_0xf8cd('0x21')];this[_0xf8cd('0x22')]=_0x484996['CampaignId'];this[_0xf8cd('0x23')]=_0x484996['originatecalleridnum']||'';this[_0xf8cd('0x24')]=_0x484996[_0xf8cd('0x24')]||'';this[_0xf8cd('0x25')]=_0x484996[_0xf8cd('0x25')];this[_0xf8cd('0x26')]=_0x484996['state'];this['statedesc']=_0x484996[_0xf8cd('0x27')];}module[_0xf8cd('0x28')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x909c=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','calleridnum','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x25e109,_0x6ab24c){var _0xc0f7d6=function(_0x2fb92b){while(--_0x2fb92b){_0x25e109['push'](_0x25e109['shift']());}};_0xc0f7d6(++_0x6ab24c);}(_0x909c,0x1b5));var _0xc909=function(_0x5772a1,_0x1c0ce9){_0x5772a1=_0x5772a1-0x0;var _0x2db4a1=_0x909c[_0x5772a1];return _0x2db4a1;};'use strict';var utils=require(_0xc909('0x0'));function QueueCallerAbandon(_0x46f0c5,_0x2d5260){this[_0xc909('0x1')]=_0x46f0c5[_0xc909('0x1')];this[_0xc909('0x2')]=_0x46f0c5[_0xc909('0x2')];this[_0xc909('0x3')]=_0x46f0c5[_0xc909('0x2')]===_0xc909('0x4')?_0xc909('0x5'):_0x46f0c5[_0xc909('0x2')];this[_0xc909('0x6')]=_0x46f0c5['countbusyretry'];this[_0xc909('0x7')]=_0x46f0c5[_0xc909('0x7')];this[_0xc909('0x8')]=_0x46f0c5[_0xc909('0x8')];this['countglobal']=_0x46f0c5[_0xc909('0x6')]+_0x46f0c5[_0xc909('0x7')]+_0x46f0c5[_0xc909('0x8')]+_0x46f0c5[_0xc909('0x9')]+_0x46f0c5[_0xc909('0xa')]+_0x46f0c5[_0xc909('0xb')]+_0x46f0c5['countmachineretry']+_0x46f0c5[_0xc909('0xc')];this[_0xc909('0x9')]=_0x46f0c5['countnosuchnumberretry'];this[_0xc909('0xa')]=_0x46f0c5[_0xc909('0xa')];this[_0xc909('0xb')]=_0x46f0c5[_0xc909('0xb')];this['countmachineretry']=_0x46f0c5['countmachineretry'];this[_0xc909('0xc')]=_0x46f0c5[_0xc909('0xc')];this[_0xc909('0xd')]=_0x2d5260[_0xc909('0xd')];this[_0xc909('0xe')]=_0x46f0c5['name'];this[_0xc909('0xf')]=_0x46f0c5['number'];this[_0xc909('0x10')]=_0x46f0c5[_0xc909('0x10')];this[_0xc909('0x11')]=_0x46f0c5[_0xc909('0x11')];this[_0xc909('0x12')]=_0x46f0c5[_0xc909('0x12')];this[_0xc909('0x13')]=_0x46f0c5[_0xc909('0x13')];this[_0xc909('0x14')]=this[_0xc909('0x12')];this[_0xc909('0x15')]=utils[_0xc909('0x16')](_0x46f0c5['responsetime'],_0x46f0c5[_0xc909('0x10')]);this['holdtime']=utils[_0xc909('0x16')](this[_0xc909('0x12')],_0x46f0c5[_0xc909('0x11')]);this[_0xc909('0x17')]=0x0;this[_0xc909('0x5')]=_0x2d5260[_0xc909('0x5')];this['membername']=_0x2d5260['connectedlinename'];this[_0xc909('0x18')]=_0x2d5260[_0xc909('0x18')];this[_0xc909('0x19')]=_0x46f0c5[_0xc909('0x19')];this[_0xc909('0x1a')]=_0x46f0c5[_0xc909('0x1a')];this[_0xc909('0x1b')]=_0x46f0c5['callbackat'];this[_0xc909('0x1c')]=_0x46f0c5['recallme'];this[_0xc909('0x1d')]=_0x46f0c5[_0xc909('0x1d')];this[_0xc909('0x1e')]=_0x46f0c5[_0xc909('0x1e')];this[_0xc909('0x1f')]=_0x46f0c5[_0xc909('0x1f')];this[_0xc909('0x20')]=_0x46f0c5['VoiceQueueId'];this[_0xc909('0x21')]=_0x46f0c5['CampaignId'];this[_0xc909('0x22')]=_0x46f0c5[_0xc909('0x22')]||'';this[_0xc909('0x23')]=_0x46f0c5[_0xc909('0x23')]||'';this[_0xc909('0x24')]=_0x46f0c5[_0xc909('0x24')];this[_0xc909('0x25')]=_0x46f0c5[_0xc909('0x25')];this['statedesc']=_0x46f0c5[_0xc909('0x26')];}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 9f9e0ee..a8fdf22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0x5369c2,_0x565c6e){var _0x1308be=function(_0x4f6cc4){while(--_0x4f6cc4){_0x5369c2['push'](_0x5369c2['shift']());}};_0x1308be(++_0x565c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory;
\ No newline at end of file
+var _0xa9e0=['catch','temp','getContactDialer','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperBlack','inspect','dialOrderByScheduledAt'];(function(_0xa4e62f,_0x4dfa39){var _0x3157ac=function(_0x4a167c){while(--_0x4a167c){_0xa4e62f['push'](_0xa4e62f['shift']());}};_0x3157ac(++_0x4dfa39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var util=require(_0x0a9e('0x0'));var logger=require(_0x0a9e('0x1'))(_0x0a9e('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0a9e('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x333808){return util[_0x0a9e('0x4')](_0x333808,{'showHidden':![],'depth':null});}function getContactDialer(_0x2ab90b,_0x991246,_0x981158){return cmHopper['getContactDialer'](_0x2ab90b['id'],_0x991246,_0x981158,_0x2ab90b[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x2cc193){_0x2ab90b['temp']-=_0x981158;if(_0x2ab90b['temp']<0x0){_0x2ab90b[_0x0a9e('0x7')]=0x0;}logger['error']('[getContactDialer]',inspectError(_0x2cc193));});}exports[_0x0a9e('0x8')]=getContactDialer;function getContactDialerIvr(_0xf81284,_0x307b3e){return cmHopper[_0x0a9e('0x9')](_0xf81284['id'],_0x307b3e,_0xf81284[_0x0a9e('0x5')])[_0x0a9e('0x6')](function(_0x4a4c56){_0xf81284['temp']-=_0x307b3e;if(_0xf81284['temp']<0x0){_0xf81284['temp']=0x0;}logger[_0x0a9e('0xa')](_0x0a9e('0xb'),inspectError(_0x4a4c56));});}exports[_0x0a9e('0x9')]=getContactDialerIvr;function countReScheduled(_0x26d672){return cmHopper[_0x0a9e('0xc')](_0x26d672)[_0x0a9e('0x6')](function(_0x5db4b0){logger[_0x0a9e('0xa')](_0x0a9e('0xd'),inspectError(_0x5db4b0));});}exports[_0x0a9e('0xc')]=countReScheduled;function rescheduleContact(_0x281129){return cmHopper[_0x0a9e('0xe')](_0x281129)[_0x0a9e('0x6')](function(_0x52a03d){logger[_0x0a9e('0xa')]('[rescheduleContact]',inspectError(_0x52a03d));});}exports[_0x0a9e('0xe')]=rescheduleContact;function unlockContact(_0x519dfd,_0x16033c,_0x12066b){return cmHopper['unlockContact'](_0x519dfd,_0x16033c,_0x12066b)[_0x0a9e('0x6')](function(_0x5a0a06){logger[_0x0a9e('0xa')](_0x0a9e('0xf'),inspectError(_0x5a0a06));});}exports[_0x0a9e('0x10')]=unlockContact;function moveContactManagedDialer(_0x205fd6){return cmHopper[_0x0a9e('0x11')](_0x205fd6)[_0x0a9e('0x6')](function(_0x530eb7){logger[_0x0a9e('0xa')](_0x0a9e('0x12'),inspectError(_0x530eb7));});}exports[_0x0a9e('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x1c696a){return cmHopperBlack[_0x0a9e('0x13')](_0x1c696a)['catch'](function(_0x2c3407){logger[_0x0a9e('0xa')]('[checkIsBlackList]',inspectError(_0x2c3407));});}exports[_0x0a9e('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x5a09ef){return cmHopperBlack['checkIsBlackListIvr'](_0x5a09ef)[_0x0a9e('0x6')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x14'),inspectError(_0x432e56));});}exports['checkIsBlackListIvr']=checkIsBlackListIvr;function verifyAdditionalPhones(_0xfb6e48,_0x2fb0e4,_0x3b45bc){return cmHopperAdditionalPhone[_0x0a9e('0x15')](_0xfb6e48,_0x2fb0e4,_0x3b45bc)[_0x0a9e('0x6')](function(_0x42ac8f){logger[_0x0a9e('0xa')]('[verifyAdditionalPhone]',inspectError(_0x42ac8f));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0x197ec0,_0x3a8e58,_0x40c424){return cmHopperAdditionalPhone[_0x0a9e('0x16')](_0x197ec0,_0x3a8e58,_0x40c424)['catch'](function(_0x384319){logger['error'](_0x0a9e('0x17'),inspectError(_0x384319));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x1dc186){return cmHopperHistory[_0x0a9e('0x18')](_0x1dc186)[_0x0a9e('0x6')](function(_0x14433c){logger[_0x0a9e('0xa')](_0x0a9e('0x19'),inspectError(_0x14433c));});}exports[_0x0a9e('0x18')]=avgHandleTime;function createHistory(_0x14de77){return cmHopperHistory['createHistory'](_0x14de77)[_0x0a9e('0x6')](function(_0x468813){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),inspectError(_0x468813));});}exports['createHistory']=createHistory;
\ No newline at end of file
index 51f1c65..64e7b4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd593=['seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','dialTimezone','dialGlobalInterval','isNil','Interval','Intervals','isEmpty','SIP/','reachable','unmonitored','includes','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','getQueueCampaignStatusMessage','match','isUndefined','string','format','\x22%s\x22\x20<%s>','\x5cw{0,','pow','replace','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','lodash','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0xd593,0x1b2));var _0x3d59=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xd593[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x3d59('0x0'));var moment=require(_0x3d59('0x1'));var util=require('util');var logger=require(_0x3d59('0x2'))(_0x3d59('0x3'));var timezones=require(_0x3d59('0x4'))[_0x3d59('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x3d59('0x6'),'BLACKLIST':_0x3d59('0x7'),'CONTACTS_RESCHEDULED':_0x3d59('0x8'),'DEACTIVATED':_0x3d59('0x9'),'DISACTIVED':_0x3d59('0xa'),'EMPTY_INTERVAL':_0x3d59('0xb'),'INACTIVE':_0x3d59('0xc'),'NO_AGENTS_LOGGED':_0x3d59('0xd'),'NO_AVAILABLE_CONTACTS':'AVAILABLE_CONTACTS_FINISHED','NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x3d59('0xe'),'OVERTIME_GLOBAL_INTERVAL':_0x3d59('0xf'),'QUEUE_RECALL':_0x3d59('0x10'),'RECALL_TIMEOUT':_0x3d59('0x11'),'RUNNING':_0x3d59('0x12'),'UNKNOWN_TIMEZONE':_0x3d59('0x13'),'UNREACHABLE_TRUNK':_0x3d59('0x14')};exports[_0x3d59('0x15')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x18317b){return _0x18317b[_0x3d59('0x16')]===_0x3d59('0x17');}exports[_0x3d59('0x18')]=isPreviewCampaign;function isIVRCampaign(_0x34b7eb){return _0x34b7eb[_0x3d59('0x19')]===_0x3d59('0x1a');}exports[_0x3d59('0x1b')]=isIVRCampaign;function isOutboundQueue(_0x354ec1){return _0x354ec1[_0x3d59('0x19')]===_0x3d59('0x1c');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x13a0a0){return _0x13a0a0[_0x3d59('0x1d')];}exports[_0x3d59('0x1e')]=isQueueCampaignActive;function isIVRCampaignActive(_0x2d8f87){return _0x2d8f87[_0x3d59('0x1f')];}exports[_0x3d59('0x20')]=isIVRCampaignActive;function getSeconds(_0x2cb020,_0x53bb42){var _0x390b05=moment(_0x2cb020)[_0x3d59('0x21')](0x0);var _0x58e68b=moment(_0x53bb42)[_0x3d59('0x21')](0x0);return _0x390b05['diff'](_0x58e68b,_0x3d59('0x22'));}exports[_0x3d59('0x23')]=getSeconds;function hasQueueCampaignDataChanged(_0x2dbd45,_0xdc0d67){var _0x2925f8=![];var _0x49d124=_0x2dbd45[_0x3d59('0x16')]!==_0xdc0d67[_0x3d59('0x16')]||_0x2dbd45[_0x3d59('0x1d')]!==_0xdc0d67[_0x3d59('0x1d')]||_0x2dbd45[_0x3d59('0x24')]!==_0xdc0d67[_0x3d59('0x24')];var _0x4fd38a=_0x2dbd45[_0x3d59('0x25')]!==_0xdc0d67[_0x3d59('0x25')]||_0x2dbd45['loggedIn']!==_0xdc0d67[_0x3d59('0x26')]||_0x2dbd45[_0x3d59('0x27')]!==_0xdc0d67['loggedInDb']||_0x2dbd45[_0x3d59('0x28')]!==_0xdc0d67[_0x3d59('0x28')]||_0x2dbd45['talking']!==_0xdc0d67[_0x3d59('0x29')]||_0x2dbd45[_0x3d59('0x2a')]!==_0xdc0d67[_0x3d59('0x2a')]||_0x2dbd45['waiting']!==_0xdc0d67[_0x3d59('0x2b')]||_0x2dbd45[_0x3d59('0x2c')]!==_0xdc0d67[_0x3d59('0x2c')]||_0x2dbd45[_0x3d59('0x2d')]!==_0xdc0d67[_0x3d59('0x2d')];if(_0x2dbd45[_0x3d59('0x2e')]&&_0xdc0d67[_0x3d59('0x2e')]){_0x2925f8=_0x2dbd45['Trunk'][_0x3d59('0x2f')]!==_0xdc0d67[_0x3d59('0x2e')][_0x3d59('0x2f')]||_0x2dbd45['Trunk'][_0x3d59('0x1f')]!==_0xdc0d67[_0x3d59('0x2e')][_0x3d59('0x1f')];}return _0x49d124||_0x4fd38a||_0x2925f8;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x2fe2d6){var _0x50ddd2=null;var _0xca166=_0x2fe2d6[_0x3d59('0x30')];if(_['isNil'](_0x2fe2d6[_0x3d59('0x31')])||_[_0x3d59('0x32')](_0x2fe2d6[_0x3d59('0x33')])||_[_0x3d59('0x32')](_0x2fe2d6[_0x3d59('0x33')][_0x3d59('0x34')])){_0x50ddd2=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_['isEmpty'](_0x2fe2d6[_0x3d59('0x31')])||_[_0x3d59('0x35')](_0x2fe2d6[_0x3d59('0x33')]['Intervals'])){_0x50ddd2=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0xca166&&!timezones[_0xca166]){_0x50ddd2=CAMPAIGN_STATUS['UNKNOWN_TIMEZONE'];}return _0x50ddd2;}function checkAnyValidTrunk(_0x352f77,_0x49ff38){var _0x378973=null;var _0x30842b=_0x3d59('0x36');var _0x1c83db=[_0x3d59('0x37'),_0x3d59('0x38')];var _0x335768=!![];if(_0x352f77[_0x3d59('0x2e')]&&_0x352f77['Trunk']['active']){_0x30842b+=_0x352f77[_0x3d59('0x2e')]['name'];_0x378973=_0x49ff38[_0x30842b];_0x335768=_0x1c83db[_0x3d59('0x39')](_0x378973[_0x3d59('0x3a')]);}else if(_0x352f77['TrunkBackup']&&_0x352f77['TrunkBackup'][_0x3d59('0x1f')]){_0x30842b+=_0x352f77['TrunkBackup'][_0x3d59('0x2f')];_0x378973=_0x49ff38[_0x30842b];_0x335768=_0x1c83db[_0x3d59('0x39')](_0x378973[_0x3d59('0x3a')]);}return _0x335768;}function getQueueCampaignStatusMessage(_0x486473,_0xd13811){var _0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x6')];var _0x5aa550=isPreviewCampaign(_0x486473);if(!isQueueCampaignActive(_0x486473)){if(_0x5aa550){_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3b')];}else{if(_0x486473[_0x3d59('0x2d')]===0x0&&_0x486473[_0x3d59('0x29')]===0x0&&_0x486473['waiting']===0x0&&(_0x486473['pTalking']||0x0)===0x0){_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3b')];}else{_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3c')];}}}else if(_0x486473['loggedIn']===0x0){_0x189e8f=CAMPAIGN_STATUS[_0x3d59('0x3d')];}else if(!checkAnyValidTrunk(_0x486473,_0xd13811)){_0x189e8f=CAMPAIGN_STATUS['UNREACHABLE_TRUNK'];}else if(!isPreviewCampaign(_0x486473)){var _0x21978d=checkAnyValidQueueCampaignInterval(_0x486473);if(_0x21978d){_0x189e8f=_0x21978d;}}return _0x189e8f;}exports[_0x3d59('0x3e')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x233ea8){var _0x2430f9=CAMPAIGN_STATUS['DISACTIVED'];if(_0x233ea8['originated']===0x0&&_0x233ea8[_0x3d59('0x29')]===0x0&&_0x233ea8[_0x3d59('0x2b')]===0x0&&(_0x233ea8['pTalking']||0x0)===0x0){_0x2430f9=CAMPAIGN_STATUS['INACTIVE'];}return _0x2430f9;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x37487f){var _0x178c2a=_0x37487f[_0x3d59('0x3f')](/"(.*?)"/);return _0x178c2a?_0x178c2a[0x1]:_0x37487f;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x18a9f9,_0x397544,_0x3ff121){if(!_[_0x3d59('0x40')](_0x3ff121)&&typeof _0x3ff121==='string'&&!_[_0x3d59('0x35')](_0x3ff121)){if(!_[_0x3d59('0x40')](_0x397544)&&typeof _0x397544===_0x3d59('0x41')&&!_[_0x3d59('0x35')](_0x397544)){return util[_0x3d59('0x42')](_0x3d59('0x43'),_0x397544,_0x3ff121);}return util[_0x3d59('0x42')](_0x3d59('0x43'),_0x3ff121,_0x3ff121);}if(!_['isUndefined'](_0x18a9f9)&&typeof _0x18a9f9===_0x3d59('0x41')&&!_[_0x3d59('0x35')](_0x18a9f9)){return _0x18a9f9;}return'\x22\x22\x20<>';}exports['getCallerId']=getCallerId;function getCallerIdRandom(_0x409a25,_0x48b57d){var _0x177e7a;var _0xff3e51;var _0x549c4b;if(_0x48b57d<=0x0){_0x48b57d=0x1;}_0x177e7a=new RegExp(_0x3d59('0x44')+_0x48b57d+'}$');_0xff3e51=Math[_0x3d59('0x45')](0xa,_0x48b57d-0x1);_0x549c4b=Math['pow'](0xa,_0x48b57d)-0x1;return util['format']('%s',_[_0x3d59('0x46')](_0x409a25,_0x177e7a,_['random'](_0xff3e51,_0x549c4b)[_0x3d59('0x47')]()));}exports[_0x3d59('0x48')]=getCallerIdRandom;function decrementOriginate(_0x286081){if(_0x286081[_0x3d59('0x2d')]&&_0x286081[_0x3d59('0x2d')]>0x0){_0x286081[_0x3d59('0x2d')]-=0x1;}else{logger['error'](_0x3d59('0x49'));}}exports[_0x3d59('0x4a')]=decrementOriginate;function checkContactEmpty(_0x47e8dc){return _0x47e8dc&&_0x47e8dc[_0x3d59('0x4b')]>0x0;}exports[_0x3d59('0x4c')]=checkContactEmpty;function erlangb(_0x4b9449,_0x3507bd){if(_0x3507bd===0x0){return 0x0;}var _0x593cf9=0x1;for(var _0x52e036=0x1;_0x52e036<=_0x3507bd;_0x52e036+=0x1){_0x593cf9=0x1+_0x593cf9*_0x52e036/_0x4b9449;}return 0x1/_0x593cf9;}exports[_0x3d59('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x484376,_0x1aaa86,_0x25704e){if(_0x1aaa86>_0x25704e){for(var _0x4e1a5e=0x0;_0x4e1a5e<_0x1aaa86-_0x25704e;_0x4e1a5e+=0x1){decrementOriginate(_0x484376);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;
\ No newline at end of file
+var _0xd808=['TrunkBackup','includes','status','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignActiveStatusMessage','match','extractCalleridName','string','isUndefined','format','\x22%s\x22\x20<%s>','getCallerId','pow','replace','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','lodash','moment','dialer','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd808,0x103));var _0x8d80=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xd808[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x8d80('0x0'));var moment=require(_0x8d80('0x1'));var util=require('util');var logger=require('../../../../config/logger')(_0x8d80('0x2'));var timezones=require('../../../../config/environment/shared')[_0x8d80('0x3')];var CAMPAIGN_STATUS={'ACTIVE':_0x8d80('0x4'),'BLACKLIST':_0x8d80('0x5'),'CONTACTS_RESCHEDULED':_0x8d80('0x6'),'DEACTIVATED':_0x8d80('0x7'),'DISACTIVED':_0x8d80('0x8'),'EMPTY_INTERVAL':_0x8d80('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x8d80('0xa'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x8d80('0xb'),'QUEUE_RECALL':_0x8d80('0xc'),'RECALL_TIMEOUT':_0x8d80('0xd'),'RUNNING':_0x8d80('0xe'),'UNKNOWN_TIMEZONE':_0x8d80('0xf'),'UNREACHABLE_TRUNK':_0x8d80('0x10')};exports[_0x8d80('0x11')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x50c5c1){return _0x50c5c1[_0x8d80('0x12')]==='preview';}exports[_0x8d80('0x13')]=isPreviewCampaign;function isIVRCampaign(_0x7b33aa){return _0x7b33aa[_0x8d80('0x14')]===_0x8d80('0x15');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x429123){return _0x429123[_0x8d80('0x14')]==='outbound';}exports[_0x8d80('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x6e665e){return _0x6e665e[_0x8d80('0x17')];}exports[_0x8d80('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x45b57a){return _0x45b57a[_0x8d80('0x19')];}exports[_0x8d80('0x1a')]=isIVRCampaignActive;function getSeconds(_0x45e769,_0x3347f1){var _0x1e1dbe=moment(_0x45e769)[_0x8d80('0x1b')](0x0);var _0x480e72=moment(_0x3347f1)[_0x8d80('0x1b')](0x0);return _0x1e1dbe[_0x8d80('0x1c')](_0x480e72,'seconds');}exports[_0x8d80('0x1d')]=getSeconds;function hasQueueCampaignDataChanged(_0x54fb20,_0x54b2a7){var _0x553aed=![];var _0x29efa9=_0x54fb20[_0x8d80('0x12')]!==_0x54b2a7[_0x8d80('0x12')]||_0x54fb20[_0x8d80('0x17')]!==_0x54b2a7[_0x8d80('0x17')]||_0x54fb20[_0x8d80('0x1e')]!==_0x54b2a7[_0x8d80('0x1e')];var _0x58e23d=_0x54fb20[_0x8d80('0x1f')]!==_0x54b2a7[_0x8d80('0x1f')]||_0x54fb20[_0x8d80('0x20')]!==_0x54b2a7[_0x8d80('0x20')]||_0x54fb20[_0x8d80('0x21')]!==_0x54b2a7[_0x8d80('0x21')]||_0x54fb20[_0x8d80('0x22')]!==_0x54b2a7[_0x8d80('0x22')]||_0x54fb20['talking']!==_0x54b2a7[_0x8d80('0x23')]||_0x54fb20[_0x8d80('0x24')]!==_0x54b2a7[_0x8d80('0x24')]||_0x54fb20['waiting']!==_0x54b2a7[_0x8d80('0x25')]||_0x54fb20[_0x8d80('0x26')]!==_0x54b2a7[_0x8d80('0x26')]||_0x54fb20['originated']!==_0x54b2a7[_0x8d80('0x27')];if(_0x54fb20[_0x8d80('0x28')]&&_0x54b2a7[_0x8d80('0x28')]){_0x553aed=_0x54fb20[_0x8d80('0x28')][_0x8d80('0x29')]!==_0x54b2a7[_0x8d80('0x28')]['name']||_0x54fb20[_0x8d80('0x28')][_0x8d80('0x19')]!==_0x54b2a7[_0x8d80('0x28')][_0x8d80('0x19')];}return _0x29efa9||_0x58e23d||_0x553aed;}exports[_0x8d80('0x2a')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xd6d69d){var _0x34b671=null;var _0x21f751=_0xd6d69d['dialTimezone'];if(_[_0x8d80('0x2b')](_0xd6d69d[_0x8d80('0x2c')])||_['isNil'](_0xd6d69d[_0x8d80('0x2d')])||_['isNil'](_0xd6d69d[_0x8d80('0x2d')][_0x8d80('0x2e')])){_0x34b671=CAMPAIGN_STATUS[_0x8d80('0x2f')];}else if(_['isEmpty'](_0xd6d69d[_0x8d80('0x2c')])||_[_0x8d80('0x30')](_0xd6d69d[_0x8d80('0x2d')][_0x8d80('0x2e')])){_0x34b671=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x21f751&&!timezones[_0x21f751]){_0x34b671=CAMPAIGN_STATUS[_0x8d80('0x31')];}return _0x34b671;}function checkAnyValidTrunk(_0x47f170,_0x36e5ab){var _0x455ace=null;var _0x28e45d=_0x8d80('0x32');var _0xf09981=[_0x8d80('0x33'),_0x8d80('0x34')];var _0x241d16=!![];if(_0x47f170[_0x8d80('0x28')]&&_0x47f170[_0x8d80('0x28')]['active']){_0x28e45d+=_0x47f170[_0x8d80('0x28')][_0x8d80('0x29')];_0x455ace=_0x36e5ab[_0x28e45d];_0x241d16=_0xf09981['includes'](_0x455ace['status']);}else if(_0x47f170[_0x8d80('0x35')]&&_0x47f170[_0x8d80('0x35')][_0x8d80('0x19')]){_0x28e45d+=_0x47f170[_0x8d80('0x35')]['name'];_0x455ace=_0x36e5ab[_0x28e45d];_0x241d16=_0xf09981[_0x8d80('0x36')](_0x455ace[_0x8d80('0x37')]);}return _0x241d16;}function getQueueCampaignStatusMessage(_0x3be366,_0x59a056){var _0x41ee7f=CAMPAIGN_STATUS['ACTIVE'];var _0x5d9271=isPreviewCampaign(_0x3be366);if(!isQueueCampaignActive(_0x3be366)){if(_0x5d9271){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x38')];}else{if(_0x3be366['originated']===0x0&&_0x3be366['talking']===0x0&&_0x3be366[_0x8d80('0x25')]===0x0&&(_0x3be366[_0x8d80('0x24')]||0x0)===0x0){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x38')];}else{_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x39')];}}}else if(_0x3be366['loggedIn']===0x0){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x3a')];}else if(!checkAnyValidTrunk(_0x3be366,_0x59a056)){_0x41ee7f=CAMPAIGN_STATUS[_0x8d80('0x3b')];}else if(!isPreviewCampaign(_0x3be366)){var _0x1a62e5=checkAnyValidQueueCampaignInterval(_0x3be366);if(_0x1a62e5){_0x41ee7f=_0x1a62e5;}}return _0x41ee7f;}exports['getQueueCampaignStatusMessage']=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x34a6f9){var _0x470ef8=CAMPAIGN_STATUS[_0x8d80('0x39')];if(_0x34a6f9[_0x8d80('0x27')]===0x0&&_0x34a6f9['talking']===0x0&&_0x34a6f9[_0x8d80('0x25')]===0x0&&(_0x34a6f9[_0x8d80('0x24')]||0x0)===0x0){_0x470ef8=CAMPAIGN_STATUS['INACTIVE'];}return _0x470ef8;}exports[_0x8d80('0x3c')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x40f6a2){var _0x5359f2=_0x40f6a2[_0x8d80('0x3d')](/"(.*?)"/);return _0x5359f2?_0x5359f2[0x1]:_0x40f6a2;}exports[_0x8d80('0x3e')]=extractCalleridName;function getCallerId(_0x40cc3e,_0x4f265b,_0xaab1b5){if(!_['isUndefined'](_0xaab1b5)&&typeof _0xaab1b5===_0x8d80('0x3f')&&!_[_0x8d80('0x30')](_0xaab1b5)){if(!_[_0x8d80('0x40')](_0x4f265b)&&typeof _0x4f265b===_0x8d80('0x3f')&&!_[_0x8d80('0x30')](_0x4f265b)){return util[_0x8d80('0x41')](_0x8d80('0x42'),_0x4f265b,_0xaab1b5);}return util[_0x8d80('0x41')](_0x8d80('0x42'),_0xaab1b5,_0xaab1b5);}if(!_[_0x8d80('0x40')](_0x40cc3e)&&typeof _0x40cc3e===_0x8d80('0x3f')&&!_[_0x8d80('0x30')](_0x40cc3e)){return _0x40cc3e;}return'\x22\x22\x20<>';}exports[_0x8d80('0x43')]=getCallerId;function getCallerIdRandom(_0x295bbd,_0x451e68){var _0x58ea1f;var _0x15f627;var _0x5792b7;if(_0x451e68<=0x0){_0x451e68=0x1;}_0x58ea1f=new RegExp('\x5cw{0,'+_0x451e68+'}$');_0x15f627=Math['pow'](0xa,_0x451e68-0x1);_0x5792b7=Math[_0x8d80('0x44')](0xa,_0x451e68)-0x1;return util['format']('%s',_[_0x8d80('0x45')](_0x295bbd,_0x58ea1f,_[_0x8d80('0x46')](_0x15f627,_0x5792b7)[_0x8d80('0x47')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x2de10c){if(_0x2de10c['originated']&&_0x2de10c[_0x8d80('0x27')]>0x0){_0x2de10c['originated']-=0x1;}else{logger[_0x8d80('0x48')](_0x8d80('0x49'));}}exports[_0x8d80('0x4a')]=decrementOriginate;function checkContactEmpty(_0x57dd62){return _0x57dd62&&_0x57dd62[_0x8d80('0x4b')]>0x0;}exports[_0x8d80('0x4c')]=checkContactEmpty;function erlangb(_0x505047,_0x1a173d){if(_0x1a173d===0x0){return 0x0;}var _0x160cbb=0x1;for(var _0x42c83a=0x1;_0x42c83a<=_0x1a173d;_0x42c83a+=0x1){_0x160cbb=0x1+_0x160cbb*_0x42c83a/_0x505047;}return 0x1/_0x160cbb;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x240ffd,_0x569f1c,_0x529578){if(_0x569f1c>_0x529578){for(var _0x568845=0x0;_0x568845<_0x569f1c-_0x529578;_0x568845+=0x1){decrementOriginate(_0x240ffd);}}}exports[_0x8d80('0x4d')]=checkContactLowerLimitOriginate;
\ No newline at end of file
index 80fd4e9..0dfaf5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x3bf29b,_0x32c9b1){var _0x10d5d0=function(_0x38601e){while(--_0x38601e){_0x3bf29b['push'](_0x3bf29b['shift']());}};_0x10d5d0(++_0x32c9b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0xb96a9b,_0x1c0e4f){var _0x4da4d4=function(_0x557a59){while(--_0x557a59){_0xb96a9b['push'](_0xb96a9b['shift']());}};_0x4da4d4(++_0x1c0e4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index fd7fd74..fbb62b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a9=['channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','\x20notify\x20','error','\x20receiveFax\x20','stringify','merge','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./util/util','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncNewState','syncNewExten','faxstatus','syncFaxStatus','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid'];(function(_0x2431d6,_0x25189a){var _0x4d0f9b=function(_0x52cd84){while(--_0x52cd84){_0x2431d6['push'](_0x2431d6['shift']());}};_0x4d0f9b(++_0x25189a);}(_0x21a9,0x12f));var _0x921a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x21a9[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0x921a('0x0'));var _=require(_0x921a('0x1'));var BPromise=require(_0x921a('0x2'));var uuid=require(_0x921a('0x3'));var moment=require(_0x921a('0x4'));var path=require(_0x921a('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x921a('0x6'));var logger=require(_0x921a('0x7'))(_0x921a('0x8'));var ami=require(_0x921a('0x9'));var rpcDb=require(_0x921a('0xa'));var Channel=require('./channel');var ut=require(_0x921a('0xb'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require(_0x921a('0xc'));function Fax(_0x57b635){this[_0x921a('0xd')]={};this[_0x921a('0xe')]=_0x57b635[_0x921a('0xe')];this[_0x921a('0xf')]=_0x57b635['trunks'];this[_0x921a('0x10')]={};ami['on'](_0x921a('0x11'),this[_0x921a('0x12')][_0x921a('0x13')](this));ami['on'](_0x921a('0x14'),this['syncVarSet'][_0x921a('0x13')](this));ami['on']('newstate',this[_0x921a('0x15')][_0x921a('0x13')](this));ami['on']('newexten',this[_0x921a('0x16')][_0x921a('0x13')](this));ami['on'](_0x921a('0x17'),this[_0x921a('0x18')][_0x921a('0x13')](this));ami['on']('receivefax',this['syncReceiveFax']['bind'](this));ami['on'](_0x921a('0x19'),this[_0x921a('0x1a')][_0x921a('0x13')](this));ami['on'](_0x921a('0x1b'),this[_0x921a('0x1c')][_0x921a('0x13')](this));}Fax[_0x921a('0x1d')][_0x921a('0x12')]=function(_0x1ddd39){if(_0x1ddd39[_0x921a('0x1e')]===_0x921a('0x1f')){for(var _0x1d477a in this[_0x921a('0xe')]){if(this[_0x921a('0xe')][_0x921a('0x20')](_0x1d477a)){if(_0x1ddd39[_0x921a('0x21')]===this[_0x921a('0xe')][_0x1d477a][_0x921a('0x22')]){this['channels'][_0x1ddd39[_0x921a('0x23')]]={};this[_0x921a('0xd')][_0x1ddd39[_0x921a('0x23')]][_0x921a('0x24')]=_0x1ddd39['channel'];this['channels'][_0x1ddd39['uniqueid']]['id']=this['faxAccounts'][_0x1d477a]['id'];this[_0x921a('0xd')][_0x1ddd39['uniqueid']]['name']=this['faxAccounts'][_0x1d477a][_0x921a('0x25')];logger[_0x921a('0x26')](_0x1ddd39['uniqueid'],_0x921a('0x27'));}}}}if(this[_0x921a('0x10')][_0x1ddd39['uniqueid']]){this[_0x921a('0xd')][_0x1ddd39[_0x921a('0x23')]]={};this[_0x921a('0xd')][_0x1ddd39[_0x921a('0x23')]][_0x921a('0x24')]=_0x1ddd39[_0x921a('0x24')];logger['info'](_0x1ddd39['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x921a('0x1d')]['syncVarSet']=function(_0x4ae1eb){if(this[_0x921a('0xd')][_0x4ae1eb['uniqueid']]){for(var _0xdceb93 in _0x4ae1eb[_0x921a('0x28')]){if(_0x4ae1eb[_0x921a('0x28')][_0x921a('0x20')](_0xdceb93)){this['channels'][_0x4ae1eb[_0x921a('0x23')]][_0xdceb93]=_0x4ae1eb[_0x921a('0x29')];}}}};Fax[_0x921a('0x1d')][_0x921a('0x15')]=function(_0x4c1e5d){if(this[_0x921a('0xd')][_0x4c1e5d[_0x921a('0x23')]]){this[_0x921a('0xd')][_0x4c1e5d['uniqueid']][_0x921a('0x2a')]=_0x4c1e5d[_0x921a('0x2a')];this[_0x921a('0xd')][_0x4c1e5d[_0x921a('0x23')]][_0x921a('0x2b')]=_0x4c1e5d['channelstatedesc'];}};Fax[_0x921a('0x1d')][_0x921a('0x16')]=function(_0x588607){if(this[_0x921a('0xd')][_0x588607[_0x921a('0x23')]]){for(var _0x1ba2c3 in _0x588607[_0x921a('0x28')]){if(_0x588607[_0x921a('0x28')][_0x921a('0x20')](_0x1ba2c3)){this[_0x921a('0xd')][_0x588607['uniqueid']][_0x1ba2c3]=_0x588607[_0x921a('0x29')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x13a54){if(this[_0x921a('0xd')][_0x13a54[_0x921a('0x23')]]){this[_0x921a('0xd')][_0x13a54[_0x921a('0x23')]]['operation']=_0x13a54[_0x921a('0x2c')];this[_0x921a('0xd')][_0x13a54[_0x921a('0x23')]][_0x921a('0x2d')]=_0x13a54[_0x921a('0x2d')];this['channels'][_0x13a54['uniqueid']][_0x921a('0x22')]=_0x13a54[_0x921a('0x22')];this['channels'][_0x13a54[_0x921a('0x23')]]['filename']=_0x13a54[_0x921a('0x2e')];logger[_0x921a('0x26')](_0x13a54[_0x921a('0x23')],_0x921a('0x2f'));}};Fax[_0x921a('0x1d')][_0x921a('0x30')]=function(_0x364fdc){var _0x3df654=this;if(this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]]){var _0x7e9780=this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]]['id'];this['channels'][_0x364fdc['uniqueid']][_0x921a('0x31')]=_0x364fdc[_0x921a('0x31')];this['channels'][_0x364fdc[_0x921a('0x23')]][_0x921a('0x32')]=_0x364fdc[_0x921a('0x32')];this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x22')]=_0x364fdc[_0x921a('0x22')];this['channels'][_0x364fdc[_0x921a('0x23')]][_0x921a('0x33')]=_0x364fdc[_0x921a('0x33')];this[_0x921a('0xd')][_0x364fdc['uniqueid']][_0x921a('0x34')]=_0x364fdc[_0x921a('0x34')];this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x2e')]=_0x364fdc[_0x921a('0x2e')];this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x35')]=_0x364fdc[_0x921a('0x35')];if(this[_0x921a('0xd')][_0x364fdc[_0x921a('0x23')]][_0x921a('0x32')]>0x0){tiff2pdf(_0x364fdc['filename'],'/var/opt/motion2/server/files/attachments/',function(_0x403eb9){logger['info'](_0x364fdc[_0x921a('0x23')],_0x921a('0x36'),_0x403eb9[_0x921a('0x37')]);attachment['create']({'name':path[_0x921a('0x38')](_0x364fdc[_0x921a('0x2e')])[_0x921a('0x25')],'basename':path[_0x921a('0x38')](_0x364fdc[_0x921a('0x2e')])[_0x921a('0x25')]+_0x921a('0x39'),'type':_0x921a('0x3a')})[_0x921a('0x3b')](function(_0x1922fb){faxAccount[_0x921a('0x3c')](_0x7e9780,{'from':_0x364fdc[_0x921a('0x35')],'mapKey':_0x921a('0x8'),'body':path[_0x921a('0x38')](_0x364fdc[_0x921a('0x2e')])[_0x921a('0x25')]+_0x921a('0x39'),'AttachmentId':_0x1922fb['id']})[_0x921a('0x3d')](function(_0x1eede1){logger['error'](_0x364fdc[_0x921a('0x23')],_0x921a('0x3e'),JSON['stringify'](_0x1eede1));});})['catch'](function(_0x59b651){logger[_0x921a('0x3f')](_0x364fdc[_0x921a('0x23')],_0x921a('0x40'),JSON[_0x921a('0x41')](_0x59b651));});});}logger[_0x921a('0x26')](_0x364fdc['uniqueid'],_0x921a('0x40'));}};Fax[_0x921a('0x1d')][_0x921a('0x1c')]=function(_0x115538){if(this['actions'][_0x115538[_0x921a('0x23')]]){_[_0x921a('0x42')](this['channels'][_0x115538[_0x921a('0x23')]],_['pick'](_0x115538,[_0x921a('0x43'),_0x921a('0x44')]));}};function updateStatus(_0x34ad8f){if(_0x34ad8f[_0x921a('0x45')]){faxMessage[_0x921a('0x46')](_0x34ad8f[_0x921a('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x921a('0x3b')](function(_0x283238){ut[_0x921a('0x47')](_0x921a('0x48'),_0x283238);})[_0x921a('0x3d')](function(_0x4bd52b){ut[_0x921a('0x47')](_0x921a('0x49'),_0x4bd52b);});}else{ut[_0x921a('0x47')](_0x921a('0x4a'));}}Fax[_0x921a('0x1d')]['updateStatus']=function(_0x51c368,_0x331172,_0x221f09){var _0x5e3551=this;var _0x257b66={};if(_0x331172){_0x257b66={'read':_0x331172};}else{_0x257b66={'failMessage':_0x221f09};}if(this[_0x921a('0x10')][_0x51c368][_0x921a('0x45')]){faxMessage[_0x921a('0x46')](this[_0x921a('0x10')][_0x51c368]['AttachmentId'],_0x257b66)['then'](function(_0xe19377){ut[_0x921a('0x47')](_0x921a('0x4b'),_0xe19377);})[_0x921a('0x3d')](function(_0x216551){ut[_0x921a('0x47')](_0x921a('0x4c'),_0x216551);})[_0x921a('0x4d')](function(){delete _0x5e3551['channels'][_0x51c368];delete _0x5e3551['actions'][_0x51c368];});}else{ut[_0x921a('0x47')](_0x921a('0x4e'));delete this[_0x921a('0xd')][_0x51c368];delete this[_0x921a('0x10')][_0x51c368];}};Fax[_0x921a('0x1d')][_0x921a('0x1a')]=function(_0xdca9a0){var _0x57b457=this;if(this['channels'][_0xdca9a0[_0x921a('0x23')]]){if(this[_0x921a('0x10')][_0xdca9a0[_0x921a('0x23')]]){this['channels'][_0xdca9a0[_0x921a('0x23')]]['id']=this[_0x921a('0x10')][_0xdca9a0[_0x921a('0x23')]]['id'];this[_0x921a('0xd')][_0xdca9a0[_0x921a('0x23')]][_0x921a('0x25')]=this['actions'][_0xdca9a0[_0x921a('0x23')]]['name'];}logger[_0x921a('0x26')](_0xdca9a0[_0x921a('0x23')],this[_0x921a('0x10')][_0xdca9a0['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x921a('0x4f'),JSON[_0x921a('0x41')](this[_0x921a('0xd')][_0xdca9a0['uniqueid']]));if(this[_0x921a('0x10')][_0xdca9a0['uniqueid']]){if(this[_0x921a('0xd')][_0xdca9a0[_0x921a('0x23')]][_0x921a('0x50')]>0x0&&this[_0x921a('0xd')][_0xdca9a0['uniqueid']][_0x921a('0x17')]==='SUCCESS'){this['updateStatus'](_0xdca9a0[_0x921a('0x23')],!![]);}else{this[_0x921a('0x51')](_0xdca9a0['uniqueid'],![],this['channels'][_0xdca9a0[_0x921a('0x23')]]['faxstatusstring']?_0x921a('0x52')+this['channels'][_0xdca9a0['uniqueid']][_0x921a('0x53')]:_0x921a('0x54'));}}}};Fax[_0x921a('0x1d')][_0x921a('0x55')]=function(_0x4abeea){var _0x49dc10=this;return new BPromise(function(_0x246794,_0x1f78d5){_0x49dc10[_0x921a('0x56')](_0x4abeea,_0x49dc10[_0x921a('0xe')][_0x4abeea[_0x921a('0x57')]])[_0x921a('0x3b')](function(_0x261570){ut[_0x921a('0x47')]('[Fax][execOriginate][success]',_0x261570);_0x246794(ut[_0x921a('0x37')](_0x921a('0x58')));})['catch'](function(_0x38733a){ut[_0x921a('0x47')](_0x921a('0x59'),_0x38733a);updateStatus(_0x4abeea);_0x1f78d5(ut[_0x921a('0x37')](_0x921a('0x5a')));});});};Fax[_0x921a('0x1d')][_0x921a('0x5b')]=function(_0x4e4d8e){var _0x549c36=this;return new BPromise(function(_0x542e9c,_0x4d5ccd){var _0x1c4d94=_0x549c36[_0x921a('0x5c')](_0x549c36[_0x921a('0xe')][_0x4e4d8e[_0x921a('0x57')]][_0x921a('0x5d')],_0x4e4d8e);if(_0x1c4d94['isValid']){_0x542e9c(ut[_0x921a('0x37')](_0x921a('0x5e')));}else{_0x4d5ccd(ut[_0x921a('0x37')](_0x1c4d94[_0x921a('0x37')]));}});};function originate(_0xef9164,_0x19668b,_0x38c964){return new BPromise(function(_0xdbbc2b,_0x58e54d){if(_0x38c964){var _0x5d7d31=util[_0x921a('0x5f')](_0x921a('0x60'),path[_0x921a('0x38')](_0xef9164[_0x921a('0x5')])[_0x921a('0x25')],_0xef9164[_0x921a('0x5')]);gs['execute'](_0x5d7d31)[_0x921a('0x3b')](function(){_0xef9164[_0x921a('0x5')]=util['format'](_0x921a('0x61'),path['parse'](_0xef9164[_0x921a('0x5')])[_0x921a('0x62')],path[_0x921a('0x38')](_0xef9164[_0x921a('0x5')])[_0x921a('0x25')]);_0x19668b['XMF-PATH']=_0xef9164[_0x921a('0x5')];ut[_0x921a('0x47')]('Convert\x20pdf\x20to\x20tif','');ami[_0x921a('0x63')](ut['variablesAction'](_0xef9164,_0x19668b))[_0x921a('0x3b')](function(_0x68831e){_0xdbbc2b(_0x68831e);})[_0x921a('0x3d')](function(_0x2062ec){_0x58e54d(_0x2062ec);});})[_0x921a('0x3d')](function(_0x4cc65e){_0x58e54d(_0x4cc65e);});}else{ami[_0x921a('0x63')](ut[_0x921a('0x64')](_0xef9164,_0x19668b))['then'](function(_0x50cea5){_0xdbbc2b(_0x50cea5);})[_0x921a('0x3d')](function(_0x545d74){_0x58e54d(_0x545d74);});}});}Fax[_0x921a('0x1d')][_0x921a('0x56')]=function(_0x4a0373,_0x1723e6){var _0x2ad577=this;return new BPromise(function(_0x3ca1e0,_0x2e343e){var _0x15d142=uuid['v4']();var _0x403b98=ut['addVariables'](_0x4a0373,_0x1723e6);_0x2ad577['actions'][_0x15d142]=new Action(_0x15d142,_0x1723e6,_0x4a0373);var _0x1f980f=_0x2ad577['actions'][_0x15d142];if(path[_0x921a('0x38')](_0x4a0373[_0x921a('0x5')])['ext']===_0x921a('0x39')){originate(_0x1f980f,_0x403b98,!![])[_0x921a('0x3b')](function(_0x4549d9){_0x3ca1e0(_0x4549d9);})[_0x921a('0x3d')](function(_0x3e97b4){_0x2e343e(_0x3e97b4);});}else{originate(_0x1f980f,_0x403b98,![])[_0x921a('0x3b')](function(_0x5c3772){_0x3ca1e0(_0x5c3772);})[_0x921a('0x3d')](function(_0x80fa42){_0x2e343e(_0x80fa42);});}});};Fax['prototype'][_0x921a('0x65')]=function(_0x36ead1){return!_['isNil'](_0x36ead1)&&!_[_0x921a('0x66')](_0x36ead1['name'])&&!_[_0x921a('0x66')](_0x36ead1[_0x921a('0x67')])&&_0x36ead1[_0x921a('0x67')]&&!_[_0x921a('0x66')](this[_0x921a('0xf')][util['format'](_0x921a('0x68'),_0x36ead1[_0x921a('0x25')])])&&!_[_0x921a('0x66')](this['trunks'][util[_0x921a('0x5f')]('SIP/%s',_0x36ead1[_0x921a('0x25')])][_0x921a('0x2d')])&&(this['trunks'][util[_0x921a('0x5f')](_0x921a('0x68'),_0x36ead1[_0x921a('0x25')])]['status']===_0x921a('0x69')||this[_0x921a('0xf')][util[_0x921a('0x5f')]('SIP/%s',_0x36ead1[_0x921a('0x25')])][_0x921a('0x2d')]==='unmonitored');};Fax[_0x921a('0x1d')]['checkTrunk']=function(_0x97ed0,_0x401b03){if(!this[_0x921a('0x65')](_0x97ed0)){ut[_0x921a('0x47')](_0x921a('0x6a'),_[_0x921a('0x66')](_0x97ed0)?'':_0x97ed0[_0x921a('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x921a('0x6b')};}if(_[_0x921a('0x66')](_0x401b03['fax'])){ut[_0x921a('0x47')](_0x921a('0x6c'),JSON[_0x921a('0x41')](_0x401b03));return{'isValid':![],'message':_0x921a('0x6d')};}if(_[_0x921a('0x66')](_0x401b03['path'])){ut[_0x921a('0x47')](_0x921a('0x6e'),JSON['stringify'](_0x401b03));return{'isValid':![],'message':_0x921a('0x6f')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x921a('0x70')]=Fax;
\ No newline at end of file
+var _0x70dd=['\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','uuid','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','channels','faxAccounts','trunks','actions','syncNewchannel','syncVarSet','bind','newstate','syncNewState','newexten','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','prototype','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]'];(function(_0x4fdc46,_0x2a3759){var _0x2c178a=function(_0x59ead9){while(--_0x59ead9){_0x4fdc46['push'](_0x4fdc46['shift']());}};_0x2c178a(++_0x2a3759);}(_0x70dd,0x75));var _0xd70d=function(_0x2e3d0e,_0x9160d){_0x2e3d0e=_0x2e3d0e-0x0;var _0x2510ac=_0x70dd[_0x2e3d0e];return _0x2510ac;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xd70d('0x0'));var moment=require('moment');var path=require(_0xd70d('0x1'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xd70d('0x2'));var logger=require(_0xd70d('0x3'))(_0xd70d('0x4'));var ami=require(_0xd70d('0x5'));var rpcDb=require(_0xd70d('0x6'));var Channel=require(_0xd70d('0x7'));var ut=require(_0xd70d('0x8'));var Action=require(_0xd70d('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require('../rpc/attachment');var faxMessage=require('../rpc/faxMessage');function Fax(_0x4b16b4){this[_0xd70d('0xa')]={};this[_0xd70d('0xb')]=_0x4b16b4['faxAccounts'];this['trunks']=_0x4b16b4[_0xd70d('0xc')];this[_0xd70d('0xd')]={};ami['on']('newchannel',this[_0xd70d('0xe')]['bind'](this));ami['on']('varset',this[_0xd70d('0xf')][_0xd70d('0x10')](this));ami['on'](_0xd70d('0x11'),this[_0xd70d('0x12')][_0xd70d('0x10')](this));ami['on'](_0xd70d('0x13'),this['syncNewExten'][_0xd70d('0x10')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on']('receivefax',this[_0xd70d('0x14')][_0xd70d('0x10')](this));ami['on']('hangup',this[_0xd70d('0x15')][_0xd70d('0x10')](this));ami['on'](_0xd70d('0x16'),this[_0xd70d('0x17')][_0xd70d('0x10')](this));}Fax['prototype'][_0xd70d('0xe')]=function(_0x4dca2b){if(_0x4dca2b['context']===_0xd70d('0x18')){for(var _0xcf22a2 in this[_0xd70d('0xb')]){if(this[_0xd70d('0xb')][_0xd70d('0x19')](_0xcf22a2)){if(_0x4dca2b[_0xd70d('0x1a')]===this['faxAccounts'][_0xcf22a2][_0xd70d('0x1b')]){this[_0xd70d('0xa')][_0x4dca2b['uniqueid']]={};this[_0xd70d('0xa')][_0x4dca2b[_0xd70d('0x1c')]][_0xd70d('0x1d')]=_0x4dca2b[_0xd70d('0x1d')];this[_0xd70d('0xa')][_0x4dca2b[_0xd70d('0x1c')]]['id']=this['faxAccounts'][_0xcf22a2]['id'];this['channels'][_0x4dca2b[_0xd70d('0x1c')]][_0xd70d('0x1e')]=this['faxAccounts'][_0xcf22a2][_0xd70d('0x1e')];logger[_0xd70d('0x1f')](_0x4dca2b[_0xd70d('0x1c')],_0xd70d('0x20'));}}}}if(this['actions'][_0x4dca2b[_0xd70d('0x1c')]]){this['channels'][_0x4dca2b['uniqueid']]={};this[_0xd70d('0xa')][_0x4dca2b[_0xd70d('0x1c')]]['channel']=_0x4dca2b[_0xd70d('0x1d')];logger[_0xd70d('0x1f')](_0x4dca2b[_0xd70d('0x1c')],_0xd70d('0x20'));}};Fax['prototype']['syncVarSet']=function(_0x5a4d2c){if(this['channels'][_0x5a4d2c['uniqueid']]){for(var _0x396b9c in _0x5a4d2c[_0xd70d('0x21')]){if(_0x5a4d2c[_0xd70d('0x21')][_0xd70d('0x19')](_0x396b9c)){this[_0xd70d('0xa')][_0x5a4d2c['uniqueid']][_0x396b9c]=_0x5a4d2c[_0xd70d('0x22')];}}}};Fax[_0xd70d('0x23')][_0xd70d('0x12')]=function(_0x95edc6){if(this[_0xd70d('0xa')][_0x95edc6[_0xd70d('0x1c')]]){this['channels'][_0x95edc6['uniqueid']][_0xd70d('0x24')]=_0x95edc6[_0xd70d('0x24')];this['channels'][_0x95edc6[_0xd70d('0x1c')]][_0xd70d('0x25')]=_0x95edc6[_0xd70d('0x25')];}};Fax['prototype'][_0xd70d('0x26')]=function(_0x2a205a){if(this['channels'][_0x2a205a[_0xd70d('0x1c')]]){for(var _0x5cb18c in _0x2a205a[_0xd70d('0x21')]){if(_0x2a205a[_0xd70d('0x21')][_0xd70d('0x19')](_0x5cb18c)){this['channels'][_0x2a205a[_0xd70d('0x1c')]][_0x5cb18c]=_0x2a205a[_0xd70d('0x22')];}}}};Fax['prototype'][_0xd70d('0x27')]=function(_0x5c0f34){if(this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]]){this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]][_0xd70d('0x28')]=_0x5c0f34[_0xd70d('0x28')];this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]][_0xd70d('0x29')]=_0x5c0f34[_0xd70d('0x29')];this[_0xd70d('0xa')][_0x5c0f34[_0xd70d('0x1c')]]['localstationid']=_0x5c0f34[_0xd70d('0x1b')];this[_0xd70d('0xa')][_0x5c0f34['uniqueid']]['filename']=_0x5c0f34[_0xd70d('0x2a')];logger[_0xd70d('0x1f')](_0x5c0f34['uniqueid'],_0xd70d('0x2b'));}};Fax[_0xd70d('0x23')][_0xd70d('0x14')]=function(_0x2e4a22){var _0x326e7d=this;if(this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]]){var _0x34147c=this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]]['id'];this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]]['remotestationid']=_0x2e4a22[_0xd70d('0x2c')];this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x2d')]=_0x2e4a22['pagestransferred'];this[_0xd70d('0xa')][_0x2e4a22['uniqueid']][_0xd70d('0x1b')]=_0x2e4a22[_0xd70d('0x1b')];this['channels'][_0x2e4a22['uniqueid']][_0xd70d('0x2e')]=_0x2e4a22[_0xd70d('0x2e')];this['channels'][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x2f')]=_0x2e4a22[_0xd70d('0x2f')];this[_0xd70d('0xa')][_0x2e4a22['uniqueid']][_0xd70d('0x2a')]=_0x2e4a22[_0xd70d('0x2a')];this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x30')]=_0x2e4a22[_0xd70d('0x30')];if(this[_0xd70d('0xa')][_0x2e4a22[_0xd70d('0x1c')]][_0xd70d('0x2d')]>0x0){tiff2pdf(_0x2e4a22[_0xd70d('0x2a')],_0xd70d('0x31'),function(_0x1a3b6c){logger[_0xd70d('0x1f')](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x32'),_0x1a3b6c[_0xd70d('0x33')]);attachment[_0xd70d('0x34')]({'name':path['parse'](_0x2e4a22[_0xd70d('0x2a')])['name'],'basename':path[_0xd70d('0x35')](_0x2e4a22[_0xd70d('0x2a')])[_0xd70d('0x1e')]+_0xd70d('0x36'),'type':_0xd70d('0x37')})[_0xd70d('0x38')](function(_0xd05ecb){faxAccount['notify'](_0x34147c,{'from':_0x2e4a22['calleridnum'],'mapKey':_0xd70d('0x4'),'body':path['parse'](_0x2e4a22['filename'])['name']+_0xd70d('0x36'),'AttachmentId':_0xd05ecb['id']})[_0xd70d('0x39')](function(_0x5bd7a9){logger[_0xd70d('0x3a')](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x3b'),JSON[_0xd70d('0x3c')](_0x5bd7a9));});})[_0xd70d('0x39')](function(_0x284bc4){logger[_0xd70d('0x3a')](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x3d'),JSON[_0xd70d('0x3c')](_0x284bc4));});});}logger['info'](_0x2e4a22[_0xd70d('0x1c')],_0xd70d('0x3d'));}};Fax[_0xd70d('0x23')][_0xd70d('0x17')]=function(_0x266e7d){if(this[_0xd70d('0xd')][_0x266e7d['uniqueid']]){_['merge'](this['channels'][_0x266e7d['uniqueid']],_['pick'](_0x266e7d,['response','reason']));}};function updateStatus(_0x544f59){if(_0x544f59[_0xd70d('0x3e')]){faxMessage[_0xd70d('0x3f')](_0x544f59['AttachmentId'],{'failMessage':_0xd70d('0x40')})[_0xd70d('0x38')](function(_0x26a6b0){ut[_0xd70d('0x41')](_0xd70d('0x42'),_0x26a6b0);})[_0xd70d('0x39')](function(_0x42f4b3){ut[_0xd70d('0x41')](_0xd70d('0x43'),_0x42f4b3);});}else{ut[_0xd70d('0x41')](_0xd70d('0x44'));}}Fax[_0xd70d('0x23')][_0xd70d('0x45')]=function(_0x576a58,_0x4f93e9,_0x2b440d){var _0x1dca91=this;var _0x398e05={};if(_0x4f93e9){_0x398e05={'read':_0x4f93e9};}else{_0x398e05={'failMessage':_0x2b440d};}if(this[_0xd70d('0xd')][_0x576a58][_0xd70d('0x3e')]){faxMessage[_0xd70d('0x3f')](this[_0xd70d('0xd')][_0x576a58][_0xd70d('0x3e')],_0x398e05)[_0xd70d('0x38')](function(_0x445bbf){ut[_0xd70d('0x41')]('[Fax][Message][Updated]',_0x445bbf);})[_0xd70d('0x39')](function(_0x2ad61f){ut[_0xd70d('0x41')]('[Fax][Message][NoUpdate1]',_0x2ad61f);})[_0xd70d('0x46')](function(){delete _0x1dca91[_0xd70d('0xa')][_0x576a58];delete _0x1dca91[_0xd70d('0xd')][_0x576a58];});}else{ut['logger'](_0xd70d('0x47'));delete this[_0xd70d('0xa')][_0x576a58];delete this[_0xd70d('0xd')][_0x576a58];}};Fax[_0xd70d('0x23')][_0xd70d('0x15')]=function(_0x459ccf){var _0x42bff8=this;if(this['channels'][_0x459ccf['uniqueid']]){if(this[_0xd70d('0xd')][_0x459ccf['uniqueid']]){this['channels'][_0x459ccf[_0xd70d('0x1c')]]['id']=this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]]['id'];this['channels'][_0x459ccf['uniqueid']][_0xd70d('0x1e')]=this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]][_0xd70d('0x1e')];}logger[_0xd70d('0x1f')](_0x459ccf[_0xd70d('0x1c')],this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]]?_0xd70d('0x48'):_0xd70d('0x49'),JSON[_0xd70d('0x3c')](this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]]));if(this[_0xd70d('0xd')][_0x459ccf[_0xd70d('0x1c')]]){if(this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]][_0xd70d('0x4a')]>0x0&&this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]]['faxstatus']===_0xd70d('0x4b')){this[_0xd70d('0x45')](_0x459ccf[_0xd70d('0x1c')],!![]);}else{this[_0xd70d('0x45')](_0x459ccf['uniqueid'],![],this['channels'][_0x459ccf['uniqueid']][_0xd70d('0x4c')]?_0xd70d('0x4d')+this[_0xd70d('0xa')][_0x459ccf[_0xd70d('0x1c')]][_0xd70d('0x4c')]:_0xd70d('0x4e'));}}}};Fax[_0xd70d('0x23')]['send']=function(_0x4dface){var _0x30b69c=this;return new BPromise(function(_0x5b11cc,_0xf4f6dc){_0x30b69c[_0xd70d('0x4f')](_0x4dface,_0x30b69c[_0xd70d('0xb')][_0x4dface[_0xd70d('0x50')]])[_0xd70d('0x38')](function(_0x236bcf){ut['logger'](_0xd70d('0x51'),_0x236bcf);_0x5b11cc(ut[_0xd70d('0x33')]('Fax\x20received'));})[_0xd70d('0x39')](function(_0x4de761){ut[_0xd70d('0x41')]('[Fax][execOriginate][failure]',_0x4de761);updateStatus(_0x4dface);_0xf4f6dc(ut[_0xd70d('0x33')](_0xd70d('0x52')));});});};Fax[_0xd70d('0x23')][_0xd70d('0x53')]=function(_0x1f5ccb){var _0x2961e1=this;return new BPromise(function(_0x401b6f,_0x2fbe29){var _0x553681=_0x2961e1[_0xd70d('0x54')](_0x2961e1[_0xd70d('0xb')][_0x1f5ccb[_0xd70d('0x50')]][_0xd70d('0x55')],_0x1f5ccb);if(_0x553681['isValid']){_0x401b6f(ut[_0xd70d('0x33')]('Trunk\x20Reachable'));}else{_0x2fbe29(ut[_0xd70d('0x33')](_0x553681[_0xd70d('0x33')]));}});};function originate(_0x47a4ad,_0x305918,_0x2018b3){return new BPromise(function(_0x45965b,_0x562399){if(_0x2018b3){var _0x341d74=util[_0xd70d('0x56')](_0xd70d('0x57'),path[_0xd70d('0x35')](_0x47a4ad[_0xd70d('0x1')])['name'],_0x47a4ad[_0xd70d('0x1')]);gs[_0xd70d('0x58')](_0x341d74)[_0xd70d('0x38')](function(){_0x47a4ad['path']=util[_0xd70d('0x56')](_0xd70d('0x59'),path[_0xd70d('0x35')](_0x47a4ad[_0xd70d('0x1')])[_0xd70d('0x5a')],path['parse'](_0x47a4ad[_0xd70d('0x1')])['name']);_0x305918[_0xd70d('0x5b')]=_0x47a4ad['path'];ut[_0xd70d('0x41')](_0xd70d('0x5c'),'');ami[_0xd70d('0x5d')](ut[_0xd70d('0x5e')](_0x47a4ad,_0x305918))[_0xd70d('0x38')](function(_0x4eef2a){_0x45965b(_0x4eef2a);})[_0xd70d('0x39')](function(_0x228ced){_0x562399(_0x228ced);});})['catch'](function(_0x5be5c2){_0x562399(_0x5be5c2);});}else{ami[_0xd70d('0x5d')](ut['variablesAction'](_0x47a4ad,_0x305918))[_0xd70d('0x38')](function(_0xb1adbb){_0x45965b(_0xb1adbb);})['catch'](function(_0x49ce21){_0x562399(_0x49ce21);});}});}Fax[_0xd70d('0x23')][_0xd70d('0x4f')]=function(_0x673daa,_0x522c3a){var _0x356baa=this;return new BPromise(function(_0x4539b1,_0x18c255){var _0x534eb6=uuid['v4']();var _0x56024a=ut[_0xd70d('0x5f')](_0x673daa,_0x522c3a);_0x356baa[_0xd70d('0xd')][_0x534eb6]=new Action(_0x534eb6,_0x522c3a,_0x673daa);var _0x5839b8=_0x356baa['actions'][_0x534eb6];if(path[_0xd70d('0x35')](_0x673daa[_0xd70d('0x1')])['ext']===_0xd70d('0x36')){originate(_0x5839b8,_0x56024a,!![])[_0xd70d('0x38')](function(_0x563772){_0x4539b1(_0x563772);})[_0xd70d('0x39')](function(_0x458cdc){_0x18c255(_0x458cdc);});}else{originate(_0x5839b8,_0x56024a,![])[_0xd70d('0x38')](function(_0x20f7ad){_0x4539b1(_0x20f7ad);})[_0xd70d('0x39')](function(_0x4b951f){_0x18c255(_0x4b951f);});}});};Fax[_0xd70d('0x23')][_0xd70d('0x60')]=function(_0x4dfec7){return!_[_0xd70d('0x61')](_0x4dfec7)&&!_[_0xd70d('0x61')](_0x4dfec7[_0xd70d('0x1e')])&&!_[_0xd70d('0x61')](_0x4dfec7[_0xd70d('0x62')])&&_0x4dfec7[_0xd70d('0x62')]&&!_[_0xd70d('0x61')](this[_0xd70d('0xc')][util[_0xd70d('0x56')](_0xd70d('0x63'),_0x4dfec7[_0xd70d('0x1e')])])&&!_[_0xd70d('0x61')](this[_0xd70d('0xc')][util[_0xd70d('0x56')](_0xd70d('0x63'),_0x4dfec7[_0xd70d('0x1e')])]['status'])&&(this['trunks'][util[_0xd70d('0x56')](_0xd70d('0x63'),_0x4dfec7[_0xd70d('0x1e')])][_0xd70d('0x29')]===_0xd70d('0x64')||this[_0xd70d('0xc')][util[_0xd70d('0x56')]('SIP/%s',_0x4dfec7[_0xd70d('0x1e')])][_0xd70d('0x29')]===_0xd70d('0x65'));};Fax[_0xd70d('0x23')][_0xd70d('0x54')]=function(_0x505f47,_0x538188){if(!this['isTrunkReachable'](_0x505f47)){ut[_0xd70d('0x41')](_0xd70d('0x66'),_[_0xd70d('0x61')](_0x505f47)?'':_0x505f47[_0xd70d('0x1e')]+_0xd70d('0x67'));return{'isValid':![],'message':_0xd70d('0x68')};}if(_[_0xd70d('0x61')](_0x538188[_0xd70d('0x4')])){ut[_0xd70d('0x41')](_0xd70d('0x69'),JSON[_0xd70d('0x3c')](_0x538188));return{'isValid':![],'message':_0xd70d('0x6a')};}if(_[_0xd70d('0x61')](_0x538188['path'])){ut[_0xd70d('0x41')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xd70d('0x3c')](_0x538188));return{'isValid':![],'message':_0xd70d('0x6b')};}return{'isValid':!![],'message':_0xd70d('0x6c')};};module[_0xd70d('0x6d')]=Fax;
\ No newline at end of file
index e728c0b..4201d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeee8=['error','inspect','notify','resolve','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount'];(function(_0x17dbbe,_0x1e095d){var _0x5bffa0=function(_0x4aa2f3){while(--_0x4aa2f3){_0x17dbbe['push'](_0x17dbbe['shift']());}};_0x5bffa0(++_0x1e095d);}(_0xeee8,0x9b));var _0x8eee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xeee8[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0x8eee('0x0'));var BPromise=require(_0x8eee('0x1'));var logger=require('../../../config/logger')(_0x8eee('0x2'));var _=require(_0x8eee('0x3'));var faxAccount=require(_0x8eee('0x4'));function loggerCatch(_0x1f6ad1){return function(_0x534355){logger[_0x8eee('0x5')](_0x1f6ad1,util[_0x8eee('0x6')](_0x534355,{'showHidden':![],'depth':null}));};}exports[_0x8eee('0x7')]=function(_0x112ce5,_0x4607f6){return BPromise[_0x8eee('0x8')]()['then'](faxAccount[_0x8eee('0x7')](_0x112ce5,_0x4607f6))['catch'](loggerCatch(_0x8eee('0x9')));};
\ No newline at end of file
+var _0x1af3=['then','catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','error','inspect','notify','resolve'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x1af3,0x1b3));var _0x31af=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x1af3[_0x4fde08];return _0x12e725;};'use strict';var util=require(_0x31af('0x0'));var BPromise=require(_0x31af('0x1'));var logger=require(_0x31af('0x2'))(_0x31af('0x3'));var _=require(_0x31af('0x4'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x4da9f8){return function(_0x2d4641){logger[_0x31af('0x5')](_0x4da9f8,util[_0x31af('0x6')](_0x2d4641,{'showHidden':![],'depth':null}));};}exports[_0x31af('0x7')]=function(_0x231e4c,_0x2ba586){return BPromise[_0x31af('0x8')]()[_0x31af('0x9')](faxAccount['notify'](_0x231e4c,_0x2ba586))[_0x31af('0xa')](loggerCatch(_0x31af('0xb')));};
\ No newline at end of file
index 0eea200..43f4212 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a34=['info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec','execute'];(function(_0x4af012,_0x2c7c1c){var _0x1e05b1=function(_0x5508d8){while(--_0x5508d8){_0x4af012['push'](_0x4af012['shift']());}};_0x1e05b1(++_0x2c7c1c);}(_0x0a34,0x107));var _0x40a3=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x0a34[_0x1992f1];return _0x413dfe;};'use strict';var util=require(_0x40a3('0x0'));var logger=require(_0x40a3('0x1'))(_0x40a3('0x2'));var BPromise=require(_0x40a3('0x3'));var exec=require(_0x40a3('0x4'))[_0x40a3('0x5')];exports[_0x40a3('0x6')]=function(_0x285df7){return new BPromise(function(_0x758b7d,_0x204890){exec(_0x285df7,function(_0x433f0f,_0x1fc670,_0xbf6268){logger[_0x40a3('0x7')](_0x40a3('0x8'),_0x1fc670);if(_0x433f0f){logger[_0x40a3('0x7')](_0x40a3('0x8'),_0x40a3('0x9'),util['inspect'](_0x433f0f,{'showHidden':![],'depth':null}),_0x1fc670,_0xbf6268);_0x204890(_0x433f0f);}_0x758b7d(_0x1fc670);});});};
\ No newline at end of file
+var _0x31dc=['util','fax','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x31dc,0xe6));var _0xc31d=function(_0x5a5df4,_0x114e4f){_0x5a5df4=_0x5a5df4-0x0;var _0x314aa8=_0x31dc[_0x5a5df4];return _0x314aa8;};'use strict';var util=require(_0xc31d('0x0'));var logger=require('../../../../config/logger')(_0xc31d('0x1'));var BPromise=require(_0xc31d('0x2'));var exec=require(_0xc31d('0x3'))[_0xc31d('0x4')];exports[_0xc31d('0x5')]=function(_0x1819db){return new BPromise(function(_0x58dd56,_0x25314e){exec(_0x1819db,function(_0x2119ea,_0x429fbe,_0x2f7e30){logger[_0xc31d('0x6')](_0xc31d('0x7'),_0x429fbe);if(_0x2119ea){logger[_0xc31d('0x6')](_0xc31d('0x7'),_0xc31d('0x8'),util[_0xc31d('0x9')](_0x2119ea,{'showHidden':![],'depth':null}),_0x429fbe,_0x2f7e30);_0x25314e(_0x2119ea);}_0x58dd56(_0x429fbe);});});};
\ No newline at end of file
index 8440e5b..9a4d125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5217=['faxdetect','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','lodash','moment','../../../../config/logger','fax','logger','info','inspect','addVariables','ecm','headerinfo','format','\x22%s\x22','gateway'];(function(_0x4588bd,_0x57222b){var _0x1becaa=function(_0x2ec59d){while(--_0x2ec59d){_0x4588bd['push'](_0x4588bd['shift']());}};_0x1becaa(++_0x57222b);}(_0x5217,0xfa));var _0x7521=function(_0x45e0f7,_0x2c731e){_0x45e0f7=_0x45e0f7-0x0;var _0x2319de=_0x5217[_0x45e0f7];return _0x2319de;};'use strict';var util=require(_0x7521('0x0'));var _=require(_0x7521('0x1'));var moment=require(_0x7521('0x2'));var logger=require(_0x7521('0x3'))(_0x7521('0x4'));exports['message']=function(_0x2a90a1){return{'message':_0x2a90a1};};exports[_0x7521('0x5')]=function(_0x336a1e,_0x3289ae){logger[_0x7521('0x6')](_0x336a1e,util[_0x7521('0x7')](_0x3289ae,{'showHidden':![],'depth':null}));};exports[_0x7521('0x8')]=function(_0x50c94a,_0x5d7c81){var _0x470823={'XMF-ECM':_0x5d7c81[_0x7521('0x9')],'XMF-HEADERINFO':_0x5d7c81[_0x7521('0xa')],'XMF-MINRATE':_0x5d7c81['minrate'],'XMF-MAXRATE':_0x5d7c81['maxrate'],'XMF-MODEM':util[_0x7521('0xb')](_0x7521('0xc'),_0x5d7c81['modem']),'XMF-GATEWAY':_0x5d7c81[_0x7521('0xd')],'XMF-FAXDETECT':_0x5d7c81[_0x7521('0xe')],'XMF-T38TIMEOUT':_0x5d7c81['t38timeout'],'XMF-LOCALSTATIONID':_0x5d7c81[_0x7521('0xf')],'XMF-PATH':_0x50c94a[_0x7521('0x10')]};return _0x470823;};exports[_0x7521('0x11')]=function(_0x29a7f6,_0x5379d8){return{'actionid':_0x29a7f6['uniqueid'],'action':_0x7521('0x12'),'channel':_0x29a7f6[_0x7521('0x13')],'Exten':_0x7521('0x14'),'Context':_0x7521('0x15'),'Priority':'1','callerid':util['format'](_0x7521('0x16'),_0x29a7f6[_0x7521('0xa')]?_0x29a7f6[_0x7521('0xa')]:'',_0x29a7f6[_0x7521('0xf')]),'variable':_0x5379d8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x29a7f6[_0x7521('0x17')]};};
\ No newline at end of file
+var _0x62e9=['uniqueid','originate','channel','from-sip','format','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','info','inspect','addVariables','ecm','headerinfo','minrate','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction'];(function(_0x43a1b8,_0x1c90c8){var _0x324ecc=function(_0x53a93b){while(--_0x53a93b){_0x43a1b8['push'](_0x43a1b8['shift']());}};_0x324ecc(++_0x1c90c8);}(_0x62e9,0x1e6));var _0x962e=function(_0x132299,_0x27324c){_0x132299=_0x132299-0x0;var _0x4389f5=_0x62e9[_0x132299];return _0x4389f5;};'use strict';var util=require(_0x962e('0x0'));var _=require(_0x962e('0x1'));var moment=require(_0x962e('0x2'));var logger=require(_0x962e('0x3'))(_0x962e('0x4'));exports['message']=function(_0x967e76){return{'message':_0x967e76};};exports['logger']=function(_0x510fdc,_0x4300f8){logger[_0x962e('0x5')](_0x510fdc,util[_0x962e('0x6')](_0x4300f8,{'showHidden':![],'depth':null}));};exports[_0x962e('0x7')]=function(_0x35213d,_0x234782){var _0x28ea41={'XMF-ECM':_0x234782[_0x962e('0x8')],'XMF-HEADERINFO':_0x234782[_0x962e('0x9')],'XMF-MINRATE':_0x234782[_0x962e('0xa')],'XMF-MAXRATE':_0x234782['maxrate'],'XMF-MODEM':util['format'](_0x962e('0xb'),_0x234782[_0x962e('0xc')]),'XMF-GATEWAY':_0x234782[_0x962e('0xd')],'XMF-FAXDETECT':_0x234782[_0x962e('0xe')],'XMF-T38TIMEOUT':_0x234782['t38timeout'],'XMF-LOCALSTATIONID':_0x234782[_0x962e('0xf')],'XMF-PATH':_0x35213d[_0x962e('0x10')]};return _0x28ea41;};exports[_0x962e('0x11')]=function(_0x26afc9,_0x1c06ad){return{'actionid':_0x26afc9[_0x962e('0x12')],'action':_0x962e('0x13'),'channel':_0x26afc9[_0x962e('0x14')],'Exten':'xcally-motion-fax','Context':_0x962e('0x15'),'Priority':'1','callerid':util[_0x962e('0x16')](_0x962e('0x17'),_0x26afc9[_0x962e('0x9')]?_0x26afc9[_0x962e('0x9')]:'',_0x26afc9[_0x962e('0xf')]),'variable':_0x1c06ad,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x26afc9[_0x962e('0x12')]};};
\ No newline at end of file
index d04e60a..e9743fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf458=['getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','inspect','[index.js][main]','util','./server','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers'];(function(_0x3ab370,_0x55c92b){var _0x18bbd8=function(_0xa33b){while(--_0xa33b){_0x3ab370['push'](_0x3ab370['shift']());}};_0x18bbd8(++_0x55c92b);}(_0xf458,0x17f));var _0x8f45=function(_0x544da3,_0x564963){_0x544da3=_0x544da3-0x0;var _0x509883=_0xf458[_0x544da3];return _0x509883;};'use strict';var util=require(_0x8f45('0x0'));var moment=require('moment');var server=require(_0x8f45('0x1'));var Realtime=require(_0x8f45('0x2'));var Report=require(_0x8f45('0x3'));var Acw=require(_0x8f45('0x4'));var Trigger=require(_0x8f45('0x5'));var Dialer=require('./dialer');var Preview=require(_0x8f45('0x6'));var Fax=require('./fax');var user=require(_0x8f45('0x7'));var voiceQueue=require(_0x8f45('0x8'));var voiceQueueReport=require(_0x8f45('0x9'));var voiceCallReport=require(_0x8f45('0xa'));var trunk=require(_0x8f45('0xb'));var trigger=require(_0x8f45('0xc'));var template=require(_0x8f45('0xd'));var cmHopperHistory=require(_0x8f45('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x8f45('0xf'));var faxAccount=require(_0x8f45('0x10'));var zendesk=require(_0x8f45('0x11'));var salesforce=require(_0x8f45('0x12'));var sugarcrm=require(_0x8f45('0x13'));var freshdesk=require(_0x8f45('0x14'));var desk=require(_0x8f45('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x8f45('0x16'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x8f45('0x17'));var dynamics365=require(_0x8f45('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x8f45('0x19'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x8f45('0x1a')](_0x8f45('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8f45('0x1a')](_0x8f45('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x8f45('0x1c')]()[_0x8f45('0x1d')](user[_0x8f45('0x1e')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x1f')]())[_0x8f45('0x1d')](user[_0x8f45('0x20')]())[_0x8f45('0x1d')](realtime['initTelephones']())[_0x8f45('0x1d')](trunk['getTrunks']())[_0x8f45('0x1d')](realtime[_0x8f45('0x21')]())['then'](voiceQueue[_0x8f45('0x22')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x23')]())[_0x8f45('0x1d')](trigger[_0x8f45('0x24')]())[_0x8f45('0x1d')](realtime['initTriggers']())[_0x8f45('0x1d')](template['getTemplates']())[_0x8f45('0x1d')](realtime['initTemplates']())[_0x8f45('0x1d')](zendesk[_0x8f45('0x25')]())['then'](realtime[_0x8f45('0x26')]())[_0x8f45('0x1d')](salesforce[_0x8f45('0x27')]())['then'](realtime[_0x8f45('0x28')]())[_0x8f45('0x1d')](sugarcrm[_0x8f45('0x29')]())[_0x8f45('0x1d')](realtime['initSugarcrmAccounts']())[_0x8f45('0x1d')](freshdesk[_0x8f45('0x2a')]())['then'](realtime[_0x8f45('0x2b')]())['then'](desk[_0x8f45('0x2c')]())[_0x8f45('0x1d')](realtime['initDeskAccounts']())['then'](zoho[_0x8f45('0x2d')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x2e')]())[_0x8f45('0x1d')](vtiger[_0x8f45('0x2f')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x30')]())[_0x8f45('0x1d')](freshsales[_0x8f45('0x31')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x32')]())[_0x8f45('0x1d')](servicenow[_0x8f45('0x33')]())[_0x8f45('0x1d')](realtime['initServicenowAccounts']())[_0x8f45('0x1d')](dynamics365[_0x8f45('0x34')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x35')]())[_0x8f45('0x1d')](campaign[_0x8f45('0x36')]())[_0x8f45('0x1d')](realtime['initCampaigns']())['then'](voiceExtension[_0x8f45('0x37')]())['then'](realtime[_0x8f45('0x38')]())[_0x8f45('0x1d')](faxAccount[_0x8f45('0x39')]())['then'](realtime[_0x8f45('0x3a')]())[_0x8f45('0x1d')](function(){return realtime;});}function initParams(){return Promise[_0x8f45('0x1c')]()[_0x8f45('0x1d')](voiceQueueReport[_0x8f45('0x3b')]())[_0x8f45('0x1d')](realtime[_0x8f45('0x3c')]())[_0x8f45('0x1d')](cmHopperHistory[_0x8f45('0x3d')]())['then'](realtime[_0x8f45('0x3e')]())[_0x8f45('0x1d')](cmHopperHistory[_0x8f45('0x3f')]())['then'](realtime[_0x8f45('0x40')]())[_0x8f45('0x1d')](voiceCallReport[_0x8f45('0x41')]())['then'](realtime[_0x8f45('0x42')]())[_0x8f45('0x43')](function(_0x61f1e9){logger['error']('[index.js][initParams]',util[_0x8f45('0x44')](_0x61f1e9,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(){return initRealtime();})[_0x8f45('0x1d')](function(){return initParams();})[_0x8f45('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x8f45('0x43')](function(_0xad6219){logger['error'](_0x8f45('0x45'),util[_0x8f45('0x44')](_0xad6219,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x909c=['initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','listen','sync','util','moment','./server','./realtime','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','initTelephones','getVoiceQueues','initVoiceQueues','getTriggers','initTemplates','getZendeskAccounts'];(function(_0x1988ea,_0x5d7a22){var _0x23c4de=function(_0x53d3b8){while(--_0x53d3b8){_0x1988ea['push'](_0x1988ea['shift']());}};_0x23c4de(++_0x5d7a22);}(_0x909c,0x1b6));var _0xc909=function(_0x445af8,_0x31831c){_0x445af8=_0x445af8-0x0;var _0x47448d=_0x909c[_0x445af8];return _0x47448d;};'use strict';var util=require(_0xc909('0x0'));var moment=require(_0xc909('0x1'));var server=require(_0xc909('0x2'));var Realtime=require(_0xc909('0x3'));var Report=require('./report');var Acw=require(_0xc909('0x4'));var Trigger=require(_0xc909('0x5'));var Dialer=require(_0xc909('0x6'));var Preview=require(_0xc909('0x7'));var Fax=require('./fax');var user=require(_0xc909('0x8'));var voiceQueue=require(_0xc909('0x9'));var voiceQueueReport=require(_0xc909('0xa'));var voiceCallReport=require(_0xc909('0xb'));var trunk=require(_0xc909('0xc'));var trigger=require(_0xc909('0xd'));var template=require(_0xc909('0xe'));var cmHopperHistory=require(_0xc909('0xf'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xc909('0x10'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xc909('0x11'));var sugarcrm=require(_0xc909('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xc909('0x13'));var zoho=require(_0xc909('0x14'));var vtiger=require(_0xc909('0x15'));var freshsales=require(_0xc909('0x16'));var servicenow=require(_0xc909('0x17'));var dynamics365=require(_0xc909('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xc909('0x19'))(_0xc909('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xc909('0x1b')](_0xc909('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc909('0x1b')](_0xc909('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc909('0x1d')]()[_0xc909('0x1e')](user['getAgents']())[_0xc909('0x1e')](realtime[_0xc909('0x1f')]())[_0xc909('0x1e')](user['getTelephones']())[_0xc909('0x1e')](realtime[_0xc909('0x20')]())[_0xc909('0x1e')](trunk['getTrunks']())[_0xc909('0x1e')](realtime['initTrunks']())[_0xc909('0x1e')](voiceQueue[_0xc909('0x21')]())[_0xc909('0x1e')](realtime[_0xc909('0x22')]())[_0xc909('0x1e')](trigger[_0xc909('0x23')]())[_0xc909('0x1e')](realtime['initTriggers']())[_0xc909('0x1e')](template['getTemplates']())['then'](realtime[_0xc909('0x24')]())[_0xc909('0x1e')](zendesk[_0xc909('0x25')]())[_0xc909('0x1e')](realtime[_0xc909('0x26')]())[_0xc909('0x1e')](salesforce[_0xc909('0x27')]())[_0xc909('0x1e')](realtime[_0xc909('0x28')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0xc909('0x1e')](realtime[_0xc909('0x29')]())[_0xc909('0x1e')](freshdesk['getFreshdeskAccounts']())[_0xc909('0x1e')](realtime[_0xc909('0x2a')]())[_0xc909('0x1e')](desk[_0xc909('0x2b')]())[_0xc909('0x1e')](realtime[_0xc909('0x2c')]())[_0xc909('0x1e')](zoho[_0xc909('0x2d')]())[_0xc909('0x1e')](realtime[_0xc909('0x2e')]())[_0xc909('0x1e')](vtiger[_0xc909('0x2f')]())[_0xc909('0x1e')](realtime[_0xc909('0x30')]())[_0xc909('0x1e')](freshsales['getFreshsalesAccounts']())[_0xc909('0x1e')](realtime[_0xc909('0x31')]())[_0xc909('0x1e')](servicenow[_0xc909('0x32')]())[_0xc909('0x1e')](realtime[_0xc909('0x33')]())[_0xc909('0x1e')](dynamics365['getDynamics365Accounts']())[_0xc909('0x1e')](realtime['initDynamics365Accounts']())[_0xc909('0x1e')](campaign['getCampaigns']())['then'](realtime[_0xc909('0x34')]())[_0xc909('0x1e')](voiceExtension['getVoiceExtensions']())[_0xc909('0x1e')](realtime[_0xc909('0x35')]())['then'](faxAccount[_0xc909('0x36')]())['then'](realtime[_0xc909('0x37')]())[_0xc909('0x1e')](function(){return realtime;});}function initParams(){return Promise[_0xc909('0x1d')]()[_0xc909('0x1e')](voiceQueueReport[_0xc909('0x38')]())[_0xc909('0x1e')](realtime[_0xc909('0x39')]())['then'](cmHopperHistory[_0xc909('0x3a')]())[_0xc909('0x1e')](realtime[_0xc909('0x3b')]())[_0xc909('0x1e')](cmHopperHistory[_0xc909('0x3c')]())[_0xc909('0x1e')](realtime[_0xc909('0x3d')]())[_0xc909('0x1e')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xc909('0x3e')]())[_0xc909('0x3f')](function(_0x5c40aa){logger[_0xc909('0x40')]('[index.js][initParams]',util[_0xc909('0x41')](_0x5c40aa,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc909('0x42')](realtime,preview,fax)[_0xc909('0x1e')](function(){return initRealtime();})[_0xc909('0x1e')](function(){return initParams();})[_0xc909('0x1e')](function(){report[_0xc909('0x43')]();setInterval(initRealtime,0x1388);})[_0xc909('0x3f')](function(_0x357900){logger['error']('[index.js][main]',util[_0xc909('0x41')](_0x357900,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index 3cec01d..acbd8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0ee=['talking','statePause','toNumber','voiceStatusCallerIdNumber','voiceStatusQueue','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','onhold','prototype','updateStatusRealtime','toLowerCase','idle','inuse'];(function(_0x515846,_0x3ebfad){var _0x38c2ea=function(_0x415d59){while(--_0x415d59){_0x515846['push'](_0x515846['shift']());}};_0x38c2ea(++_0x3ebfad);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xb0ee[_0x4ed520];return _0x4415a6;};'use strict';var _=require('lodash');var util=require(_0xeb0e('0x0'));var moment=require(_0xeb0e('0x1'));var md5=require(_0xeb0e('0x2'));var Redis=require(_0xeb0e('0x3'));var config=require(_0xeb0e('0x4'));config[_0xeb0e('0x5')]=_[_0xeb0e('0x6')](config[_0xeb0e('0x5')],{'host':_0xeb0e('0x7'),'port':0x18eb});var io=require(_0xeb0e('0x8'))(new Redis(config['redis']));function Agent(_0x1a95ad){this['id']=_0x1a95ad['id']||0x0;this[_0xeb0e('0x9')]=_0x1a95ad[_0xeb0e('0x9')]||'';this[_0xeb0e('0xa')]=_0x1a95ad['email']||'';this[_0xeb0e('0xb')]=_0x1a95ad[_0xeb0e('0xb')]||'';this[_0xeb0e('0xc')]=_0x1a95ad[_0xeb0e('0xc')]||'';this[_0xeb0e('0xd')]=_0xeb0e('0xe');this[_0xeb0e('0xf')]=0x0;this[_0xeb0e('0x10')]=_0xeb0e('0xe');this[_0xeb0e('0x11')]='';this[_0xeb0e('0x12')]='';this[_0xeb0e('0x13')]='';this[_0xeb0e('0x14')]='';this[_0xeb0e('0x15')]=_0x1a95ad[_0xeb0e('0x15')]||![];this[_0xeb0e('0x16')]=_0xeb0e('0xe');this[_0xeb0e('0x17')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0xeb0e('0x18')]=![];this['local']=![];this['md5']='';}Agent[_0xeb0e('0x19')][_0xeb0e('0x1a')]=function(_0x324125){var _0x235ac5;if(_0x324125&&_0x324125['state']){_0x235ac5=_0x324125[_0xeb0e('0xd')][_0xeb0e('0x1b')]();switch(_0x235ac5){case'not_inuse':_0x235ac5=_0xeb0e('0x1c');break;case _0xeb0e('0x1d'):_0x235ac5=_0xeb0e('0x1e');break;}}if(_0x235ac5&&this[_0xeb0e('0x16')]!==_0x235ac5||_0x324125[_0xeb0e('0x1f')]){this[_0xeb0e('0x17')]=_[_0xeb0e('0x20')](moment()['format']('x'));}if(_0x235ac5){this[_0xeb0e('0x16')]=_0x235ac5;}var _0x972b84={'id':this['id'],'name':this[_0xeb0e('0x9')],'email':this[_0xeb0e('0xa')],'accountcode':this[_0xeb0e('0xb')],'fullname':this[_0xeb0e('0xc')],'state':this[_0xeb0e('0xd')],'stateTime':this[_0xeb0e('0xf')],'status':this['status'],'address':this[_0xeb0e('0x11')],'online':this[_0xeb0e('0x15')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xeb0e('0x21')],'voiceStatusQueue':this[_0xeb0e('0x22')],'interface':this['interface'],'onhold':this[_0xeb0e('0x18')]};var _0x346fa8=md5(JSON['stringify'](_0x972b84));if(this[_0xeb0e('0x2')]!==_0x346fa8){this['md5']=_0x346fa8;io['to'](util['format']('user:%s',_0x972b84[_0xeb0e('0x9')]))['emit'](_0xeb0e('0x23'),_0x972b84);io[_0xeb0e('0x24')](_0xeb0e('0x25'),_0x972b84);}};module[_0xeb0e('0x26')]=Agent;
\ No newline at end of file
+var _0xc12a=['format','online','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','voiceStatusTime','voiceStatusCallerIdNumber','onhold','prototype','updateStatusRealtime','toLowerCase','idle','inuse','voiceStatus','statePause','toNumber'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xc12a,0x1c1));var _0xac12=function(_0x35f135,_0x4042dd){_0x35f135=_0x35f135-0x0;var _0x434f7c=_0xc12a[_0x35f135];return _0x434f7c;};'use strict';var _=require(_0xac12('0x0'));var util=require(_0xac12('0x1'));var moment=require('moment');var md5=require(_0xac12('0x2'));var Redis=require(_0xac12('0x3'));var config=require(_0xac12('0x4'));config[_0xac12('0x5')]=_[_0xac12('0x6')](config[_0xac12('0x5')],{'host':_0xac12('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xac12('0x5')]));function Agent(_0x1eacbd){this['id']=_0x1eacbd['id']||0x0;this[_0xac12('0x8')]=_0x1eacbd['name']||'';this['email']=_0x1eacbd[_0xac12('0x9')]||'';this[_0xac12('0xa')]=_0x1eacbd['accountcode']||'';this[_0xac12('0xb')]=_0x1eacbd[_0xac12('0xb')]||'';this[_0xac12('0xc')]=_0xac12('0xd');this[_0xac12('0xe')]=0x0;this[_0xac12('0xf')]='unknown';this[_0xac12('0x10')]='';this[_0xac12('0x11')]='';this[_0xac12('0x12')]='';this[_0xac12('0x13')]='';this['online']=_0x1eacbd['online']||![];this['voiceStatus']=_0xac12('0xd');this[_0xac12('0x14')]=0x0;this[_0xac12('0x15')]='';this['voiceStatusQueue']='';this[_0xac12('0x16')]=![];this['local']=![];this[_0xac12('0x2')]='';}Agent[_0xac12('0x17')][_0xac12('0x18')]=function(_0x4c1a01){var _0x470ecd;if(_0x4c1a01&&_0x4c1a01[_0xac12('0xc')]){_0x470ecd=_0x4c1a01[_0xac12('0xc')][_0xac12('0x19')]();switch(_0x470ecd){case'not_inuse':_0x470ecd=_0xac12('0x1a');break;case _0xac12('0x1b'):_0x470ecd='talking';break;}}if(_0x470ecd&&this[_0xac12('0x1c')]!==_0x470ecd||_0x4c1a01[_0xac12('0x1d')]){this[_0xac12('0x14')]=_[_0xac12('0x1e')](moment()[_0xac12('0x1f')]('x'));}if(_0x470ecd){this[_0xac12('0x1c')]=_0x470ecd;}var _0x4ad48f={'id':this['id'],'name':this[_0xac12('0x8')],'email':this[_0xac12('0x9')],'accountcode':this['accountcode'],'fullname':this[_0xac12('0xb')],'state':this[_0xac12('0xc')],'stateTime':this[_0xac12('0xe')],'status':this[_0xac12('0xf')],'address':this['address'],'online':this[_0xac12('0x20')],'voiceStatus':this[_0xac12('0x1c')],'voiceStatusTime':this[_0xac12('0x14')],'voiceStatusCallerIdNumber':this[_0xac12('0x15')],'voiceStatusQueue':this[_0xac12('0x21')],'interface':this[_0xac12('0x13')],'onhold':this['onhold']};var _0x4c9eb2=md5(JSON[_0xac12('0x22')](_0x4ad48f));if(this['md5']!==_0x4c9eb2){this[_0xac12('0x2')]=_0x4c9eb2;io['to'](util['format'](_0xac12('0x23'),_0x4ad48f[_0xac12('0x8')]))[_0xac12('0x24')](_0xac12('0x25'),_0x4ad48f);io['emit'](_0xac12('0x26'),_0x4ad48f);}};module[_0xac12('0x27')]=Agent;
\ No newline at end of file
index f56c8de..7b4e930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c2b=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls'];(function(_0xa3dffc,_0x29cb5b){var _0x113e6e=function(_0x389c3c){while(--_0x389c3c){_0xa3dffc['push'](_0xa3dffc['shift']());}};_0x113e6e(++_0x29cb5b);}(_0x4c2b,0xe7));var _0xb4c2=function(_0x2bfe4a,_0x56489a){_0x2bfe4a=_0x2bfe4a-0x0;var _0x4ce1ed=_0x4c2b[_0x2bfe4a];return _0x4ce1ed;};'use strict';function Campaign(_0x201c4c){this['id']=_0x201c4c['id']||0x0;this[_0xb4c2('0x0')]=_0x201c4c[_0xb4c2('0x0')]||'';this[_0xb4c2('0x1')]=_0x201c4c[_0xb4c2('0x1')]||'campaign';this[_0xb4c2('0x2')]=0x0;this['temp']=0x0;this[_0xb4c2('0x3')]=0x0;this[_0xb4c2('0x4')]=0x0;this[_0xb4c2('0x5')]='';this[_0xb4c2('0x6')]=!![];this[_0xb4c2('0x7')]=_0x201c4c[_0xb4c2('0x7')];this[_0xb4c2('0x8')]=_0x201c4c[_0xb4c2('0x8')];this[_0xb4c2('0x9')]=_0x201c4c[_0xb4c2('0x9')]||null;this[_0xb4c2('0xa')]=_0x201c4c[_0xb4c2('0xa')]?_0x201c4c[_0xb4c2('0xa')]:null;this[_0xb4c2('0xb')]=_0x201c4c[_0xb4c2('0xb')];this[_0xb4c2('0xc')]=_0x201c4c[_0xb4c2('0xc')];this[_0xb4c2('0xd')]=_0x201c4c[_0xb4c2('0xd')]||0x1e;this[_0xb4c2('0xe')]=_0x201c4c[_0xb4c2('0xe')];this['dialCongestionRetryFrequency']=_0x201c4c['dialCongestionRetryFrequency'];this[_0xb4c2('0xf')]=_0x201c4c[_0xb4c2('0xf')];this[_0xb4c2('0x10')]=_0x201c4c[_0xb4c2('0x10')];this[_0xb4c2('0x11')]=_0x201c4c[_0xb4c2('0x11')];this[_0xb4c2('0x12')]=_0x201c4c[_0xb4c2('0x12')];this['dialGlobalMaxRetry']=_0x201c4c['dialGlobalMaxRetry'];this[_0xb4c2('0x13')]=_0x201c4c['dialNoSuchNumberMaxRetry']||0x3;this[_0xb4c2('0x14')]=_0x201c4c[_0xb4c2('0x14')]||0x96;this[_0xb4c2('0x15')]=_0x201c4c[_0xb4c2('0x15')]||0x3;this[_0xb4c2('0x16')]=_0x201c4c[_0xb4c2('0x16')]||0x96;this[_0xb4c2('0x17')]=_0x201c4c[_0xb4c2('0x17')]||0x3;this[_0xb4c2('0x18')]=_0x201c4c[_0xb4c2('0x18')]||0x96;this[_0xb4c2('0x19')]=_0x201c4c[_0xb4c2('0x19')]||0x3;this[_0xb4c2('0x1a')]=_0x201c4c[_0xb4c2('0x1a')]||0x96;this[_0xb4c2('0x1b')]=_0x201c4c[_0xb4c2('0x1b')]||0x3;this['dialAgentRejectRetryFrequency']=_0x201c4c[_0xb4c2('0x1c')]||0x96;this[_0xb4c2('0x1d')]=_0x201c4c['dialOrderByScheduledAt']||_0xb4c2('0x1e');this[_0xb4c2('0x1f')]=_0x201c4c[_0xb4c2('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x201c4c[_0xb4c2('0x20')]||undefined;this[_0xb4c2('0x21')]=_0x201c4c[_0xb4c2('0x21')]||undefined;this[_0xb4c2('0x22')]=_0x201c4c[_0xb4c2('0x22')]?_0x201c4c[_0xb4c2('0x22')]:undefined;this['Trunk']=_0x201c4c[_0xb4c2('0x23')]?_0x201c4c[_0xb4c2('0x23')]:undefined;this[_0xb4c2('0x24')]=_0x201c4c[_0xb4c2('0x24')]?_0x201c4c['Interval']:undefined;this['SquareProject']=_0x201c4c['SquareProject']?_0x201c4c[_0xb4c2('0x25')]:undefined;this[_0xb4c2('0x26')]=_0x201c4c[_0xb4c2('0x25')]?_0x201c4c[_0xb4c2('0x25')][_0xb4c2('0x0')]:undefined;this[_0xb4c2('0x27')]=_0x201c4c[_0xb4c2('0x27')]||![];this[_0xb4c2('0x28')]=_0x201c4c[_0xb4c2('0x28')];this[_0xb4c2('0x29')]=_0x201c4c['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x201c4c['dialAMDAfterGreetingSilence'];this[_0xb4c2('0x2a')]=_0x201c4c['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x201c4c[_0xb4c2('0x2b')];this[_0xb4c2('0x2c')]=_0x201c4c[_0xb4c2('0x2c')];this[_0xb4c2('0x2d')]=_0x201c4c[_0xb4c2('0x2d')];this['dialAMDSilenceThreshold']=_0x201c4c[_0xb4c2('0x2e')];this['dialAMDMaximumWordLength']=_0x201c4c[_0xb4c2('0x2f')];}module['exports']=Campaign;
\ No newline at end of file
+var _0x7912=['message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x7912,0x17b));var _0x2791=function(_0x19a4ae,_0x21054a){_0x19a4ae=_0x19a4ae-0x0;var _0x13b6c3=_0x7912[_0x19a4ae];return _0x13b6c3;};'use strict';function Campaign(_0x2e800f){this['id']=_0x2e800f['id']||0x0;this['name']=_0x2e800f[_0x2791('0x0')]||'';this[_0x2791('0x1')]=_0x2e800f['type']||_0x2791('0x2');this['originated']=0x0;this[_0x2791('0x3')]=0x0;this[_0x2791('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x2791('0x5')]='';this['sendMessageOneNotActive']=!![];this[_0x2791('0x6')]=_0x2e800f['active'];this['limitCalls']=_0x2e800f[_0x2791('0x7')];this[_0x2791('0x8')]=_0x2e800f[_0x2791('0x8')]||null;this['dialGlobalInterval']=_0x2e800f[_0x2791('0x9')]?_0x2e800f['dialGlobalInterval']:null;this[_0x2791('0xa')]=_0x2e800f[_0x2791('0xa')];this[_0x2791('0xb')]=_0x2e800f[_0x2791('0xb')];this[_0x2791('0xc')]=_0x2e800f['dialOriginateTimeout']||0x1e;this[_0x2791('0xd')]=_0x2e800f[_0x2791('0xd')];this[_0x2791('0xe')]=_0x2e800f[_0x2791('0xe')];this['dialBusyMaxRetry']=_0x2e800f[_0x2791('0xf')];this[_0x2791('0x10')]=_0x2e800f['dialBusyRetryFrequency'];this[_0x2791('0x11')]=_0x2e800f[_0x2791('0x11')];this[_0x2791('0x12')]=_0x2e800f[_0x2791('0x12')];this[_0x2791('0x13')]=_0x2e800f[_0x2791('0x13')];this['dialNoSuchNumberMaxRetry']=_0x2e800f[_0x2791('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2e800f[_0x2791('0x15')]||0x96;this[_0x2791('0x16')]=_0x2e800f[_0x2791('0x16')]||0x3;this[_0x2791('0x17')]=_0x2e800f[_0x2791('0x17')]||0x96;this[_0x2791('0x18')]=_0x2e800f[_0x2791('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x2e800f[_0x2791('0x19')]||0x96;this['dialMachineMaxRetry']=_0x2e800f[_0x2791('0x1a')]||0x3;this[_0x2791('0x1b')]=_0x2e800f['dialMachineRetryFrequency']||0x96;this[_0x2791('0x1c')]=_0x2e800f[_0x2791('0x1c')]||0x3;this[_0x2791('0x1d')]=_0x2e800f['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x2e800f[_0x2791('0x1e')]||_0x2791('0x1f');this['dialPrefix']=_0x2e800f[_0x2791('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2e800f['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2791('0x21')]=_0x2e800f[_0x2791('0x21')]||undefined;this['TrunkBackup']=_0x2e800f[_0x2791('0x22')]?_0x2e800f[_0x2791('0x22')]:undefined;this[_0x2791('0x23')]=_0x2e800f[_0x2791('0x23')]?_0x2e800f[_0x2791('0x23')]:undefined;this[_0x2791('0x24')]=_0x2e800f[_0x2791('0x24')]?_0x2e800f[_0x2791('0x24')]:undefined;this[_0x2791('0x25')]=_0x2e800f[_0x2791('0x25')]?_0x2e800f[_0x2791('0x25')]:undefined;this['dialQueueProject']=_0x2e800f[_0x2791('0x25')]?_0x2e800f['SquareProject'][_0x2791('0x0')]:undefined;this[_0x2791('0x26')]=_0x2e800f[_0x2791('0x26')]||![];this[_0x2791('0x27')]=_0x2e800f[_0x2791('0x27')];this[_0x2791('0x28')]=_0x2e800f[_0x2791('0x28')];this[_0x2791('0x29')]=_0x2e800f['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x2e800f['dialAMDTotalAnalysisTime'];this[_0x2791('0x2a')]=_0x2e800f[_0x2791('0x2a')];this['dialAMDBetweenWordsSilence']=_0x2e800f[_0x2791('0x2b')];this[_0x2791('0x2c')]=_0x2e800f['dialAMDMaximumNumberOfWords'];this[_0x2791('0x2d')]=_0x2e800f[_0x2791('0x2d')];this[_0x2791('0x2e')]=_0x2e800f[_0x2791('0x2e')];}module[_0x2791('0x2f')]=Campaign;
\ No newline at end of file
index 2dff9ec..aab77b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x130d=['connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','duration','billableseconds','holdtime','tag','monitor','monitorFilename','queue','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel'];(function(_0x1ddefc,_0xa2b97f){var _0x3cc12d=function(_0x2fd42d){while(--_0x2fd42d){_0x1ddefc['push'](_0x1ddefc['shift']());}};_0x3cc12d(++_0xa2b97f);}(_0x130d,0x19d));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';function Channel(){this[_0xd130('0x0')]=null;this[_0xd130('0x1')]='';this[_0xd130('0x2')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0xd130('0x3')]=undefined;this[_0xd130('0x4')]=undefined;this[_0xd130('0x5')]=0x0;this[_0xd130('0x6')]='';this[_0xd130('0x7')]=0x0;this[_0xd130('0x8')]=0x0;this[_0xd130('0x9')]=0x0;this[_0xd130('0xa')]=![];this['answertime']=null;this[_0xd130('0xb')]=null;this[_0xd130('0xc')]=![];this['abandoned']=![];this[_0xd130('0xd')]='';this['lastdata']='';this[_0xd130('0xe')]=0x0;this[_0xd130('0xf')]=0x0;this[_0xd130('0x10')]=0x0;this['type']=null;this[_0xd130('0x11')]=null;this['disposition']=null;this[_0xd130('0x12')]=![];this[_0xd130('0x13')]=null;this[_0xd130('0x14')]=null;this['monitors']=[];this[_0xd130('0x15')]=undefined;this[_0xd130('0x16')]=undefined;this[_0xd130('0x17')]=undefined;this[_0xd130('0x18')]=0x0;}module[_0xd130('0x19')]=Channel;
\ No newline at end of file
+var _0x69d4=['channel','calleridnum','calleridname','connectedlinenum','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','disposition','monitor','queue','monitors','transfercalleridnum','exports','starttime'];(function(_0x2b9607,_0x3b5e1d){var _0x3044eb=function(_0x9e91c3){while(--_0x9e91c3){_0x2b9607['push'](_0x2b9607['shift']());}};_0x3044eb(++_0x3b5e1d);}(_0x69d4,0x83));var _0x469d=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x69d4[_0x2a55f8];return _0x245efd;};'use strict';function Channel(){this[_0x469d('0x0')]=null;this[_0x469d('0x1')]='';this['destinationchannel']='';this[_0x469d('0x2')]=0x0;this[_0x469d('0x3')]='';this[_0x469d('0x4')]=undefined;this['connectedlinename']=undefined;this[_0x469d('0x5')]=0x0;this['context']='';this[_0x469d('0x6')]=0x0;this[_0x469d('0x7')]=0x0;this[_0x469d('0x8')]=0x0;this[_0x469d('0x9')]=![];this[_0x469d('0xa')]=null;this[_0x469d('0xb')]=null;this['unmanaged']=![];this[_0x469d('0xc')]=![];this['lastapplication']='';this[_0x469d('0xd')]='';this[_0x469d('0xe')]=0x0;this[_0x469d('0xf')]=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0x469d('0x10')]=null;this[_0x469d('0x11')]=![];this['monitorFilename']=null;this[_0x469d('0x12')]=null;this[_0x469d('0x13')]=[];this[_0x469d('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0x469d('0x15')]=Channel;
\ No newline at end of file
index 597d9b3..7604960 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f3e=['serverUrl','Configurations','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x1688bc,_0x43de16){var _0x546480=function(_0x3a747c){while(--_0x3a747c){_0x1688bc['push'](_0x1688bc['shift']());}};_0x546480(++_0x43de16);}(_0x7f3e,0x1e2));var _0xe7f3=function(_0x1c50f7,_0x291af7){_0x1c50f7=_0x1c50f7-0x0;var _0x2d4878=_0x7f3e[_0x1c50f7];return _0x2d4878;};'use strict';function DeskAccount(_0x4c5fe1){this['id']=_0x4c5fe1['id']||0x0;this[_0xe7f3('0x0')]=_0x4c5fe1[_0xe7f3('0x0')]||'';this['username']=_0x4c5fe1[_0xe7f3('0x1')]||'';this[_0xe7f3('0x2')]=_0x4c5fe1[_0xe7f3('0x2')]||'';this[_0xe7f3('0x3')]=_0x4c5fe1['authType']||'';this[_0xe7f3('0x4')]=_0x4c5fe1[_0xe7f3('0x4')]||'';this[_0xe7f3('0x5')]=_0x4c5fe1[_0xe7f3('0x5')]||'';this[_0xe7f3('0x6')]=_0x4c5fe1[_0xe7f3('0x6')]||'';this['token']=_0x4c5fe1[_0xe7f3('0x7')]||'';this[_0xe7f3('0x8')]=_0x4c5fe1[_0xe7f3('0x8')]||'';this[_0xe7f3('0x9')]=_0x4c5fe1['type']||'';this[_0xe7f3('0xa')]=_0x4c5fe1[_0xe7f3('0xa')]||'';this[_0xe7f3('0xb')]=_0x4c5fe1[_0xe7f3('0xb')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x566a=['consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey'];(function(_0x37cf32,_0x562b9c){var _0x1feaac=function(_0x142e17){while(--_0x142e17){_0x37cf32['push'](_0x37cf32['shift']());}};_0x1feaac(++_0x562b9c);}(_0x566a,0xe4));var _0xa566=function(_0x22fcf2,_0x45f2f0){_0x22fcf2=_0x22fcf2-0x0;var _0x4ccdb1=_0x566a[_0x22fcf2];return _0x4ccdb1;};'use strict';function DeskAccount(_0x1daeb7){this['id']=_0x1daeb7['id']||0x0;this['name']=_0x1daeb7[_0xa566('0x0')]||'';this[_0xa566('0x1')]=_0x1daeb7[_0xa566('0x1')]||'';this[_0xa566('0x2')]=_0x1daeb7[_0xa566('0x2')]||'';this[_0xa566('0x3')]=_0x1daeb7[_0xa566('0x3')]||'';this[_0xa566('0x4')]=_0x1daeb7[_0xa566('0x4')]||'';this[_0xa566('0x5')]=_0x1daeb7[_0xa566('0x5')]||'';this['consumerSecret']=_0x1daeb7[_0xa566('0x6')]||'';this[_0xa566('0x7')]=_0x1daeb7[_0xa566('0x7')]||'';this[_0xa566('0x8')]=_0x1daeb7[_0xa566('0x8')]||'';this['type']=_0x1daeb7[_0xa566('0x9')]||'';this[_0xa566('0xa')]=_0x1daeb7[_0xa566('0xa')]||'';this[_0xa566('0xb')]=_0x1daeb7[_0xa566('0xb')]||{};}module[_0xa566('0xc')]=DeskAccount;
\ No newline at end of file
index 498b102..0bea7e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16a8=['name','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','Configurations','CloudProvider','exports'];(function(_0x40899c,_0x506ae7){var _0x1198d2=function(_0x47c9bf){while(--_0x47c9bf){_0x40899c['push'](_0x40899c['shift']());}};_0x1198d2(++_0x506ae7);}(_0x16a8,0xfd));var _0x816a=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x16a8[_0x3b380d];return _0x54502b;};'use strict';function Dynamics365Account(_0xc10a0f){this['id']=_0xc10a0f['id']||0x0;this[_0x816a('0x0')]=_0xc10a0f['name']||'';this[_0x816a('0x1')]=_0xc10a0f[_0x816a('0x1')]||'';this[_0x816a('0x2')]=_0xc10a0f[_0x816a('0x2')]||'';this['remoteUri']=_0xc10a0f[_0x816a('0x3')]||'';this['tenantId']=_0xc10a0f[_0x816a('0x4')]||'';this[_0x816a('0x5')]=_0xc10a0f[_0x816a('0x5')]||'';this[_0x816a('0x6')]=_0xc10a0f[_0x816a('0x6')]||{};this['serverUrl']=_0xc10a0f['serverUrl']||'';this[_0x816a('0x7')]=_0xc10a0f[_0x816a('0x7')]||![];this[_0x816a('0x8')]=_0xc10a0f[_0x816a('0x8')]||{};this[_0x816a('0x9')]=_0xc10a0f[_0x816a('0x9')]||{};}module[_0x816a('0xa')]=Dynamics365Account;
\ No newline at end of file
+var _0x0f1e=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0f1e,0x186));var _0xe0f1=function(_0x113bde,_0x4f07f2){_0x113bde=_0x113bde-0x0;var _0x2b8e60=_0x0f1e[_0x113bde];return _0x2b8e60;};'use strict';function Dynamics365Account(_0x96defd){this['id']=_0x96defd['id']||0x0;this[_0xe0f1('0x0')]=_0x96defd[_0xe0f1('0x0')]||'';this['username']=_0x96defd['username']||'';this[_0xe0f1('0x1')]=_0x96defd[_0xe0f1('0x1')]||'';this[_0xe0f1('0x2')]=_0x96defd[_0xe0f1('0x2')]||'';this[_0xe0f1('0x3')]=_0x96defd[_0xe0f1('0x3')]||'';this[_0xe0f1('0x4')]=_0x96defd['clientId']||'';this[_0xe0f1('0x5')]=_0x96defd[_0xe0f1('0x5')]||{};this['serverUrl']=_0x96defd[_0xe0f1('0x6')]||'';this[_0xe0f1('0x7')]=_0x96defd[_0xe0f1('0x7')]||![];this['Configurations']=_0x96defd[_0xe0f1('0x8')]||{};this[_0xe0f1('0x9')]=_0x96defd[_0xe0f1('0x9')]||{};}module[_0xe0f1('0xa')]=Dynamics365Account;
\ No newline at end of file
index 44358b4..089c24f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a15=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect'];(function(_0x4f5c0e,_0x27d3cd){var _0x24c9e0=function(_0x37a81a){while(--_0x37a81a){_0x4f5c0e['push'](_0x4f5c0e['shift']());}};_0x24c9e0(++_0x27d3cd);}(_0x4a15,0x7e));var _0x54a1=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4a15[_0x618414];return _0x21c19a;};'use strict';function FaxAccount(_0x2e4a96){this['id']=_0x2e4a96['id']||0x0;this[_0x54a1('0x0')]=_0x2e4a96[_0x54a1('0x0')]||'';this[_0x54a1('0x1')]=_0x2e4a96['description'];this[_0x54a1('0x2')]=_0x2e4a96[_0x54a1('0x2')];this[_0x54a1('0x3')]=_0x2e4a96[_0x54a1('0x3')];this[_0x54a1('0x4')]=_0x2e4a96['localstationid'];this[_0x54a1('0x5')]=_0x2e4a96[_0x54a1('0x5')]||0x960;this[_0x54a1('0x6')]=_0x2e4a96[_0x54a1('0x6')]||0x3840;this[_0x54a1('0x7')]=_0x2e4a96[_0x54a1('0x7')]||'v17,v27,v29';this[_0x54a1('0x8')]=_0x2e4a96['gateway']||'no';this[_0x54a1('0x9')]=_0x2e4a96['faxdetect']||'no';this[_0x54a1('0xa')]=_0x2e4a96['t38timeout']||0x1388;this[_0x54a1('0xb')]=_0x2e4a96[_0x54a1('0xb')]||_0x54a1('0xc');this['Trunk']=_0x2e4a96[_0x54a1('0xd')]?_0x2e4a96[_0x54a1('0xd')]:undefined;this['ListId']=_0x2e4a96[_0x54a1('0xe')];this[_0x54a1('0xf')]=_0x2e4a96['key'];}module[_0x54a1('0x10')]=FaxAccount;
\ No newline at end of file
+var _0xbc2d=['Trunk','ListId','key','exports','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','tech','SIP'];(function(_0x2bdb33,_0x3505df){var _0x36b487=function(_0x4419e3){while(--_0x4419e3){_0x2bdb33['push'](_0x2bdb33['shift']());}};_0x36b487(++_0x3505df);}(_0xbc2d,0x1c4));var _0xdbc2=function(_0x456ba9,_0x3de64d){_0x456ba9=_0x456ba9-0x0;var _0xed35b4=_0xbc2d[_0x456ba9];return _0xed35b4;};'use strict';function FaxAccount(_0x1d1f8b){this['id']=_0x1d1f8b['id']||0x0;this[_0xdbc2('0x0')]=_0x1d1f8b[_0xdbc2('0x0')]||'';this['description']=_0x1d1f8b['description'];this[_0xdbc2('0x1')]=_0x1d1f8b[_0xdbc2('0x1')];this['headerinfo']=_0x1d1f8b[_0xdbc2('0x2')];this[_0xdbc2('0x3')]=_0x1d1f8b['localstationid'];this['minrate']=_0x1d1f8b[_0xdbc2('0x4')]||0x960;this[_0xdbc2('0x5')]=_0x1d1f8b[_0xdbc2('0x5')]||0x3840;this[_0xdbc2('0x6')]=_0x1d1f8b[_0xdbc2('0x6')]||_0xdbc2('0x7');this[_0xdbc2('0x8')]=_0x1d1f8b[_0xdbc2('0x8')]||'no';this[_0xdbc2('0x9')]=_0x1d1f8b['faxdetect']||'no';this['t38timeout']=_0x1d1f8b['t38timeout']||0x1388;this[_0xdbc2('0xa')]=_0x1d1f8b[_0xdbc2('0xa')]||_0xdbc2('0xb');this[_0xdbc2('0xc')]=_0x1d1f8b[_0xdbc2('0xc')]?_0x1d1f8b[_0xdbc2('0xc')]:undefined;this[_0xdbc2('0xd')]=_0x1d1f8b[_0xdbc2('0xd')];this[_0xdbc2('0xe')]=_0x1d1f8b[_0xdbc2('0xe')];}module[_0xdbc2('0xf')]=FaxAccount;
\ No newline at end of file
index e5867dd..e4d066e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf69=['exports','name','username','apiKey','token','serverUrl','Configurations'];(function(_0x2fce71,_0x1b697e){var _0x3e764e=function(_0xf37504){while(--_0xf37504){_0x2fce71['push'](_0x2fce71['shift']());}};_0x3e764e(++_0x1b697e);}(_0xbf69,0x190));var _0x9bf6=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0xbf69[_0x2aea9e];return _0x430b92;};'use strict';function FreshdeskAccount(_0x509fbe){this['id']=_0x509fbe['id']||0x0;this[_0x9bf6('0x0')]=_0x509fbe[_0x9bf6('0x0')]||'';this[_0x9bf6('0x1')]=_0x509fbe['username']||'';this[_0x9bf6('0x2')]=_0x509fbe[_0x9bf6('0x3')]||'';this['remoteUri']=_0x509fbe['remoteUri']||'';this[_0x9bf6('0x4')]=_0x509fbe[_0x9bf6('0x4')]||'';this[_0x9bf6('0x5')]=_0x509fbe[_0x9bf6('0x5')]||{};}module[_0x9bf6('0x6')]=FreshdeskAccount;
\ No newline at end of file
+var _0x28d9=['serverUrl','Configurations','exports','name','username'];(function(_0x4305b2,_0xdea0a9){var _0x4c97a7=function(_0x4c160f){while(--_0x4c160f){_0x4305b2['push'](_0x4305b2['shift']());}};_0x4c97a7(++_0xdea0a9);}(_0x28d9,0xcb));var _0x928d=function(_0x3c4778,_0x4fc6e9){_0x3c4778=_0x3c4778-0x0;var _0xac1d9b=_0x28d9[_0x3c4778];return _0xac1d9b;};'use strict';function FreshdeskAccount(_0x2f4c8a){this['id']=_0x2f4c8a['id']||0x0;this[_0x928d('0x0')]=_0x2f4c8a[_0x928d('0x0')]||'';this[_0x928d('0x1')]=_0x2f4c8a[_0x928d('0x1')]||'';this['apiKey']=_0x2f4c8a['token']||'';this['remoteUri']=_0x2f4c8a['remoteUri']||'';this[_0x928d('0x2')]=_0x2f4c8a[_0x928d('0x2')]||'';this[_0x928d('0x3')]=_0x2f4c8a[_0x928d('0x3')]||{};}module[_0x928d('0x4')]=FreshdeskAccount;
\ No newline at end of file
index e4ef11b..b9a9c8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fe0=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x29f0a9,_0xe416a2){var _0x1918eb=function(_0x52445c){while(--_0x52445c){_0x29f0a9['push'](_0x29f0a9['shift']());}};_0x1918eb(++_0xe416a2);}(_0x4fe0,0x195));var _0x04fe=function(_0x3e9c37,_0x3a8a4d){_0x3e9c37=_0x3e9c37-0x0;var _0x2ee6d8=_0x4fe0[_0x3e9c37];return _0x2ee6d8;};'use strict';function FreshsalesAccount(_0x1de6df){this['id']=_0x1de6df['id']||0x0;this[_0x04fe('0x0')]=_0x1de6df[_0x04fe('0x0')]||'';this[_0x04fe('0x1')]=_0x1de6df[_0x04fe('0x1')]||'';this[_0x04fe('0x2')]=_0x1de6df[_0x04fe('0x3')]||'';this['remoteUri']=_0x1de6df[_0x04fe('0x4')]||'';this['serverUrl']=_0x1de6df[_0x04fe('0x5')]||'';this[_0x04fe('0x6')]=_0x1de6df[_0x04fe('0x6')]||{};}module[_0x04fe('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x4b47=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x4b47,0x1b4));var _0x74b4=function(_0x338a0c,_0x3ca555){_0x338a0c=_0x338a0c-0x0;var _0x46a4fe=_0x4b47[_0x338a0c];return _0x46a4fe;};'use strict';function FreshsalesAccount(_0x40f022){this['id']=_0x40f022['id']||0x0;this['name']=_0x40f022[_0x74b4('0x0')]||'';this[_0x74b4('0x1')]=_0x40f022[_0x74b4('0x1')]||'';this[_0x74b4('0x2')]=_0x40f022[_0x74b4('0x3')]||'';this[_0x74b4('0x4')]=_0x40f022['remoteUri']||'';this['serverUrl']=_0x40f022[_0x74b4('0x5')]||'';this[_0x74b4('0x6')]=_0x40f022['Configurations']||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 46a8036..cdadf30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf289=['motionChannel','voice','routealias','mohtime','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','priority','assigned','lastAssignedTo'];(function(_0x313c92,_0x5d9943){var _0x8ddf39=function(_0x5c8fe7){while(--_0x5c8fe7){_0x313c92['push'](_0x313c92['shift']());}};_0x8ddf39(++_0x5d9943);}(_0xf289,0x18e));var _0x9f28=function(_0x10451f,_0x5e94d6){_0x10451f=_0x10451f-0x0;var _0x3028a8=_0xf289[_0x10451f];return _0x3028a8;};'use strict';function QueueReport(){this['type']=_0x9f28('0x0');this[_0x9f28('0x1')]='';this[_0x9f28('0x2')]='';this[_0x9f28('0x3')]='';this[_0x9f28('0x4')]='';this[_0x9f28('0x5')]=null;this[_0x9f28('0x6')]=null;this['position']=0x1;this[_0x9f28('0x7')]=0x1;this[_0x9f28('0x8')]=![];this[_0x9f28('0x9')]=null;this[_0x9f28('0xa')]=![];this[_0x9f28('0xb')]=null;this[_0x9f28('0xc')]=![];this[_0x9f28('0xd')]=null;this[_0x9f28('0xe')]=0x1;this['channel']='';this[_0x9f28('0xf')]='';this[_0x9f28('0x10')]='';this[_0x9f28('0x11')]='';this[_0x9f28('0x12')]='';this['exten']='';this[_0x9f28('0x13')]='';this['holdtime']=0x0;this[_0x9f28('0x14')]=![];this[_0x9f28('0x15')]='';this[_0x9f28('0x16')]=_0x9f28('0x17');this[_0x9f28('0x18')]=null;this[_0x9f28('0x19')]=0x0;this[_0x9f28('0x1a')]={};}module[_0x9f28('0x1b')]=QueueReport;
\ No newline at end of file
+var _0x8320=['queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','priority','holdtime','assigned','voice','routealias','mohtime','variables','exports','uniqueid','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit'];(function(_0x515e5c,_0x3c3367){var _0x5427b3=function(_0x56ef07){while(--_0x56ef07){_0x515e5c['push'](_0x515e5c['shift']());}};_0x5427b3(++_0x3c3367);}(_0x8320,0x1c5));var _0x0832=function(_0x4d521e,_0x58ba39){_0x4d521e=_0x4d521e-0x0;var _0x3beb42=_0x8320[_0x4d521e];return _0x3beb42;};'use strict';function QueueReport(){this['type']='inbound';this[_0x0832('0x0')]='';this['calleridnum']='';this[_0x0832('0x1')]='';this[_0x0832('0x2')]='';this['queuecallerjoinAt']=null;this[_0x0832('0x3')]=null;this[_0x0832('0x4')]=0x1;this[_0x0832('0x5')]=0x1;this[_0x0832('0x6')]=![];this[_0x0832('0x7')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x0832('0x8')]=![];this[_0x0832('0x9')]=null;this[_0x0832('0xa')]=0x1;this[_0x0832('0xb')]='';this[_0x0832('0xc')]='';this[_0x0832('0xd')]='';this['accountcode']='';this['context']='';this['exten']='';this[_0x0832('0xe')]='';this[_0x0832('0xf')]=0x0;this[_0x0832('0x10')]=![];this['lastAssignedTo']='';this['motionChannel']=_0x0832('0x11');this[_0x0832('0x12')]=null;this[_0x0832('0x13')]=0x0;this[_0x0832('0x14')]={};}module[_0x0832('0x15')]=QueueReport;
\ No newline at end of file
index 91a10f3..3c7997d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e5f=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','password','clientId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e5f,0xd8));var _0xf8e5=function(_0x26ebfc,_0x4a7f59){_0x26ebfc=_0x26ebfc-0x0;var _0x3d450b=_0x8e5f[_0x26ebfc];return _0x3d450b;};'use strict';function SalesforceAccount(_0x140263){this['id']=_0x140263['id']||0x0;this[_0xf8e5('0x0')]=_0x140263[_0xf8e5('0x0')]||'';this[_0xf8e5('0x1')]=_0x140263[_0xf8e5('0x1')]||'';this['remoteUri']=_0x140263['remoteUri']||'';this[_0xf8e5('0x2')]=_0x140263['password']||'';this[_0xf8e5('0x3')]=_0x140263['clientId']||'';this[_0xf8e5('0x4')]=_0x140263[_0xf8e5('0x4')]||'';this[_0xf8e5('0x5')]=_0x140263[_0xf8e5('0x5')]||'';this['type']=_0x140263[_0xf8e5('0x6')]||_0xf8e5('0x7');this[_0xf8e5('0x8')]=_0x140263['serverUrl']||'';this[_0xf8e5('0x9')]=_0x140263[_0xf8e5('0x9')]||{};}module[_0xf8e5('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0xa8cb=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x4800bf,_0x3f6aa0){var _0x4dc339=function(_0x5d32f2){while(--_0x5d32f2){_0x4800bf['push'](_0x4800bf['shift']());}};_0x4dc339(++_0x3f6aa0);}(_0xa8cb,0x1de));var _0xba8c=function(_0x37ec83,_0x6870fc){_0x37ec83=_0x37ec83-0x0;var _0x1aa4e6=_0xa8cb[_0x37ec83];return _0x1aa4e6;};'use strict';function SalesforceAccount(_0x399b52){this['id']=_0x399b52['id']||0x0;this[_0xba8c('0x0')]=_0x399b52['name']||'';this['username']=_0x399b52[_0xba8c('0x1')]||'';this[_0xba8c('0x2')]=_0x399b52['remoteUri']||'';this[_0xba8c('0x3')]=_0x399b52[_0xba8c('0x3')]||'';this[_0xba8c('0x4')]=_0x399b52[_0xba8c('0x4')]||'';this[_0xba8c('0x5')]=_0x399b52['clientSecret']||'';this[_0xba8c('0x6')]=_0x399b52['securityToken']||'';this[_0xba8c('0x7')]=_0x399b52[_0xba8c('0x7')]||_0xba8c('0x8');this[_0xba8c('0x9')]=_0x399b52[_0xba8c('0x9')]||'';this['Configurations']=_0x399b52[_0xba8c('0xa')]||{};}module[_0xba8c('0xb')]=SalesforceAccount;
\ No newline at end of file
index 32df87b..acac10a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac65=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0xac65,0x1e9));var _0x5ac6=function(_0x3a2ede,_0x38ff82){_0x3a2ede=_0x3a2ede-0x0;var _0x415094=_0xac65[_0x3a2ede];return _0x415094;};'use strict';function ServicenowAccount(_0x415f94){this['id']=_0x415f94['id']||0x0;this[_0x5ac6('0x0')]=_0x415f94[_0x5ac6('0x0')]||'';this[_0x5ac6('0x1')]=_0x415f94[_0x5ac6('0x1')]||'';this['password']=_0x415f94['password']||'';this[_0x5ac6('0x2')]=_0x415f94[_0x5ac6('0x2')]||'';this[_0x5ac6('0x3')]=_0x415f94[_0x5ac6('0x3')]||'';this['Configurations']=_0x415f94[_0x5ac6('0x4')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0x230c=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x29ae84,_0x2a26e0){var _0x526794=function(_0x432b73){while(--_0x432b73){_0x29ae84['push'](_0x29ae84['shift']());}};_0x526794(++_0x2a26e0);}(_0x230c,0x1c9));var _0xc230=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x230c[_0x1928c9];return _0x51b5fb;};'use strict';function ServicenowAccount(_0x35ff2d){this['id']=_0x35ff2d['id']||0x0;this[_0xc230('0x0')]=_0x35ff2d['name']||'';this[_0xc230('0x1')]=_0x35ff2d[_0xc230('0x1')]||'';this[_0xc230('0x2')]=_0x35ff2d[_0xc230('0x2')]||'';this[_0xc230('0x3')]=_0x35ff2d[_0xc230('0x3')]||'';this[_0xc230('0x4')]=_0x35ff2d[_0xc230('0x4')]||'';this[_0xc230('0x5')]=_0x35ff2d[_0xc230('0x5')]||{};}module[_0xc230('0x6')]=ServicenowAccount;
\ No newline at end of file
index 88fc631..0ad4b19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5292=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0x149));var _0x2529=function(_0x5bf019,_0x375a83){_0x5bf019=_0x5bf019-0x0;var _0x42497e=_0x5292[_0x5bf019];return _0x42497e;};'use strict';function SugarcrmAccount(_0x5aed51){this['id']=_0x5aed51['id']||0x0;this[_0x2529('0x0')]=_0x5aed51[_0x2529('0x0')]||'';this['username']=_0x5aed51[_0x2529('0x1')]||'';this[_0x2529('0x2')]=_0x5aed51[_0x2529('0x2')]||'';this[_0x2529('0x3')]=_0x5aed51[_0x2529('0x3')]||'';this[_0x2529('0x4')]=_0x5aed51['serverUrl']||'';this['Configurations']=_0x5aed51[_0x2529('0x5')]||{};}module[_0x2529('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x6278=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6278,0x7c));var _0x8627=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0x6278[_0x2a276d];return _0x2914cd;};'use strict';function SugarcrmAccount(_0x91ac69){this['id']=_0x91ac69['id']||0x0;this[_0x8627('0x0')]=_0x91ac69[_0x8627('0x0')]||'';this[_0x8627('0x1')]=_0x91ac69[_0x8627('0x1')]||'';this[_0x8627('0x2')]=_0x91ac69['password']||'';this[_0x8627('0x3')]=_0x91ac69['remoteUri']||'';this[_0x8627('0x4')]=_0x91ac69[_0x8627('0x4')]||'';this[_0x8627('0x5')]=_0x91ac69[_0x8627('0x5')]||{};}module[_0x8627('0x6')]=SugarcrmAccount;
\ No newline at end of file
index 532558c..be8e65b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe605=['address','exports','name','accountcode','state','unknown','stateTime','status'];(function(_0x27b17c,_0x4dea39){var _0x3237bc=function(_0x484b0a){while(--_0x484b0a){_0x27b17c['push'](_0x27b17c['shift']());}};_0x3237bc(++_0x4dea39);}(_0xe605,0x92));var _0x5e60=function(_0x5855be,_0x370316){_0x5855be=_0x5855be-0x0;var _0x21d0ea=_0xe605[_0x5855be];return _0x21d0ea;};'use strict';function Telephone(_0x4cf32c){this['id']=_0x4cf32c['id']||0x0;this[_0x5e60('0x0')]=_0x4cf32c['name']||'';this[_0x5e60('0x1')]=_0x4cf32c[_0x5e60('0x1')]||'';this[_0x5e60('0x2')]=_0x5e60('0x3');this[_0x5e60('0x4')]=0x0;this[_0x5e60('0x5')]=_0x5e60('0x3');this[_0x5e60('0x6')]='';}module[_0x5e60('0x7')]=Telephone;
\ No newline at end of file
+var _0x2143=['status','address','exports','name','state','unknown','stateTime'];(function(_0xe085c5,_0x5a85cc){var _0x52345a=function(_0x22ce94){while(--_0x22ce94){_0xe085c5['push'](_0xe085c5['shift']());}};_0x52345a(++_0x5a85cc);}(_0x2143,0x114));var _0x3214=function(_0x317ff1,_0x5117df){_0x317ff1=_0x317ff1-0x0;var _0x1f3dd3=_0x2143[_0x317ff1];return _0x1f3dd3;};'use strict';function Telephone(_0x554969){this['id']=_0x554969['id']||0x0;this[_0x3214('0x0')]=_0x554969[_0x3214('0x0')]||'';this['accountcode']=_0x554969['accountcode']||'';this[_0x3214('0x1')]=_0x3214('0x2');this[_0x3214('0x3')]=0x0;this[_0x3214('0x4')]=_0x3214('0x2');this[_0x3214('0x5')]='';}module[_0x3214('0x6')]=Telephone;
\ No newline at end of file
index 7703979..09c4c10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x3aab4f,_0x4ffbb6){var _0x551503=function(_0xead478){while(--_0xead478){_0x3aab4f['push'](_0x3aab4f['shift']());}};_0x551503(++_0x4ffbb6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x4e4865,_0x2f7d4c){var _0x3240d0=function(_0x220252){while(--_0x220252){_0x4e4865['push'](_0x4e4865['shift']());}};_0x3240d0(++_0x2f7d4c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index c4e091e..b64ab01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x22c8b5,_0x296a12){var _0x474ea9=function(_0x441d03){while(--_0x441d03){_0x22c8b5['push'](_0x22c8b5['shift']());}};_0x474ea9(++_0x296a12);}(_0x2032,0xd9));var _0x2203=function(_0x2ac9d2,_0x538bd1){_0x2ac9d2=_0x2ac9d2-0x0;var _0x2a0ab8=_0x2032[_0x2ac9d2];return _0x2a0ab8;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
+var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x36b48f,_0x1c8d6d){var _0x454d96=function(_0xaaec3f){while(--_0xaaec3f){_0x36b48f['push'](_0x36b48f['shift']());}};_0x454d96(++_0x1c8d6d);}(_0x2032,0xd9));var _0x2203=function(_0x3715e7,_0x3143d2){_0x3715e7=_0x3715e7-0x0;var _0xbfc598=_0x2032[_0x3715e7];return _0xbfc598;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
index b36b0e5..70fee96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4fc=['port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','state','unknown','status','registry','indexOf','split'];(function(_0x4f9a98,_0x10b6a5){var _0x110360=function(_0x3689ef){while(--_0x3689ef){_0x4f9a98['push'](_0x4f9a98['shift']());}};_0x110360(++_0x10b6a5);}(_0xa4fc,0x168));var _0xca4f=function(_0x2480be,_0x209617){_0x2480be=_0x2480be-0x0;var _0x3e7123=_0xa4fc[_0x2480be];return _0x3e7123;};'use strict';function Trunk(_0x5452f2){this['id']=_0x5452f2['id']||0x0;this[_0xca4f('0x0')]=_0x5452f2['active']||![];this[_0xca4f('0x1')]=_0x5452f2[_0xca4f('0x1')]||'';this[_0xca4f('0x2')]=_0xca4f('0x3');this['stateTime']=0x0;this[_0xca4f('0x4')]=_0xca4f('0x3');this[_0xca4f('0x5')]=_0x5452f2[_0xca4f('0x5')]&&_0x5452f2['registry'][_0xca4f('0x6')](':')?_0x5452f2[_0xca4f('0x5')][_0xca4f('0x7')](':')[0x0]:'';this['host']='';this[_0xca4f('0x8')]='';this[_0xca4f('0x9')]='';this[_0xca4f('0xa')]='';this[_0xca4f('0xb')]='';this[_0xca4f('0xc')]=_0xca4f('0x3');this[_0xca4f('0xd')]='';this[_0xca4f('0xe')]='';this[_0xca4f('0xf')]=_0x5452f2['defaultuser']||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0x5b82=['unknown','stateTime','status','registry','indexOf','host','port','domain','refresh','registrationtime','address','defaultuser','name','state'];(function(_0x21614f,_0x3b7d65){var _0x3554da=function(_0x32a53c){while(--_0x32a53c){_0x21614f['push'](_0x21614f['shift']());}};_0x3554da(++_0x3b7d65);}(_0x5b82,0x140));var _0x25b8=function(_0x40c83d,_0x37b817){_0x40c83d=_0x40c83d-0x0;var _0x38181d=_0x5b82[_0x40c83d];return _0x38181d;};'use strict';function Trunk(_0x215a60){this['id']=_0x215a60['id']||0x0;this['active']=_0x215a60['active']||![];this['name']=_0x215a60[_0x25b8('0x0')]||'';this[_0x25b8('0x1')]=_0x25b8('0x2');this[_0x25b8('0x3')]=0x0;this[_0x25b8('0x4')]=_0x25b8('0x2');this['registry']=_0x215a60[_0x25b8('0x5')]&&_0x215a60[_0x25b8('0x5')][_0x25b8('0x6')](':')?_0x215a60[_0x25b8('0x5')]['split'](':')[0x0]:'';this[_0x25b8('0x7')]='';this[_0x25b8('0x8')]='';this[_0x25b8('0x9')]='';this['domainport']='';this[_0x25b8('0xa')]='';this['stateRegistry']='unknown';this[_0x25b8('0xb')]='';this[_0x25b8('0xc')]='';this[_0x25b8('0xd')]=_0x215a60['defaultuser']||'';}module['exports']=Trunk;
\ No newline at end of file
index f09d8d5..c88a53a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb681=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x5b3c90,_0x21c65d){var _0x510052=function(_0x194140){while(--_0x194140){_0x5b3c90['push'](_0x5b3c90['shift']());}};_0x510052(++_0x21c65d);}(_0xb681,0x113));var _0x1b68=function(_0x52fe6c,_0xe5929c){_0x52fe6c=_0x52fe6c-0x0;var _0x5d8037=_0xb681[_0x52fe6c];return _0x5d8037;};'use strict';function voiceExtension(_0x1c925e){this['id']=_0x1c925e['id']||0x0;this['exten']=_0x1c925e[_0x1b68('0x0')]||'';this[_0x1b68('0x1')]=_0x1c925e[_0x1b68('0x1')]||_0x1b68('0x2');this[_0x1b68('0x3')]=_0x1c925e[_0x1b68('0x3')]||![];}module[_0x1b68('0x4')]=voiceExtension;
\ No newline at end of file
+var _0xcfcd=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcfcd,0x169));var _0xdcfc=function(_0x55b4c8,_0x3c1440){_0x55b4c8=_0x55b4c8-0x0;var _0x247ca1=_0xcfcd[_0x55b4c8];return _0x247ca1;};'use strict';function voiceExtension(_0x1762ae){this['id']=_0x1762ae['id']||0x0;this[_0xdcfc('0x0')]=_0x1762ae[_0xdcfc('0x0')]||'';this[_0xdcfc('0x1')]=_0x1762ae[_0xdcfc('0x1')]||_0xdcfc('0x2');this[_0xdcfc('0x3')]=_0x1762ae[_0xdcfc('0x3')]||![];}module[_0xdcfc('0x4')]=voiceExtension;
\ No newline at end of file
index f4ee4eb..ab92da9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5844=['invalid','onHold','ringing','ringInUse','talking','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','available','busy','inUse'];(function(_0x204eb7,_0x4974c3){var _0x37e444=function(_0x390613){while(--_0x390613){_0x204eb7['push'](_0x204eb7['shift']());}};_0x37e444(++_0x4974c3);}(_0x5844,0x6a));var _0x4584=function(_0x5e2983,_0x74d125){_0x5e2983=_0x5e2983-0x0;var _0x2e1e22=_0x5844[_0x5e2983];return _0x2e1e22;};'use strict';var monitorFormat={'wav':_0x4584('0x0'),'wav49':_0x4584('0x1'),'gsm':_0x4584('0x2')};var strategy={'fewestcalls':_0x4584('0x3'),'leastrecent':_0x4584('0x4'),'linear':_0x4584('0x5'),'random':'random','ringall':_0x4584('0x6'),'rr':_0x4584('0x7'),'rrmemory':_0x4584('0x8'),'rrordered':_0x4584('0x9'),'wrandom':_0x4584('0xa')};function VoiceQueue(_0x20c39f){this['id']=_0x20c39f['id']||0x0;this[_0x4584('0xb')]=_0x20c39f[_0x4584('0xb')]||'';this[_0x4584('0xc')]=_0x20c39f[_0x4584('0xc')]||'';this[_0x4584('0xd')]=_0x20c39f['type']||_0x4584('0xe');this[_0x4584('0xf')]=0x0;this[_0x4584('0x10')]=0x0;this[_0x4584('0x11')]=0x0;this[_0x4584('0x12')]=0x0;this[_0x4584('0x13')]=0x0;this[_0x4584('0x14')]=0x0;this[_0x4584('0x15')]=0x0;this[_0x4584('0x16')]=0x0;this[_0x4584('0x17')]=0x0;this[_0x4584('0x18')]=0x0;this[_0x4584('0x19')]=0x0;this[_0x4584('0x1a')]=0x0;this['loggedIn']=0x0;this['notInUse']=0x0;this[_0x4584('0x1b')]=0x0;this['paused']=0x0;this[_0x4584('0x1c')]=0x0;this[_0x4584('0x1d')]=0x0;this[_0x4584('0x1e')]=0x0;this['unavailable']=0x0;this[_0x4584('0x1f')]=0x0;this['acw']=_0x20c39f[_0x4584('0x20')]||![];this[_0x4584('0x21')]=_0x20c39f[_0x4584('0x21')]||0xa;this[_0x4584('0x22')]=_0x20c39f[_0x4584('0x22')]||'no';this[_0x4584('0x23')]=!![];this[_0x4584('0x24')]='';this[_0x4584('0x25')]='';this[_0x4584('0x26')]=0x0;this['temp']=0x0;this[_0x4584('0x27')]=_0x20c39f['dialTimezone']||null;this[_0x4584('0x28')]=_0x20c39f[_0x4584('0x28')]?_0x20c39f[_0x4584('0x28')]:null;this[_0x4584('0x29')]=_0x20c39f['dialActive'];this[_0x4584('0x2a')]=_0x20c39f[_0x4584('0x2a')]||_0x4584('0x2b');this[_0x4584('0x2c')]=_0x20c39f[_0x4584('0x2c')]||0x0;this[_0x4584('0x2d')]=_0x20c39f[_0x4584('0x2d')]||0x0;this[_0x4584('0x2e')]=_0x20c39f[_0x4584('0x2e')]||0x1;this[_0x4584('0x2f')]=_0x20c39f[_0x4584('0x2f')]||_0x4584('0x30');this['dialPredictiveOptimizationPercentage']=_0x20c39f['dialPredictiveOptimizationPercentage']||0.03;this[_0x4584('0x31')]=_0x20c39f[_0x4584('0x31')]||0x258;this[_0x4584('0x32')]=_0x20c39f[_0x4584('0x32')]||'anonymous';this[_0x4584('0x33')]=_0x20c39f[_0x4584('0x33')]||'anonymous';this['dialOriginateTimeout']=_0x20c39f[_0x4584('0x34')]||0x1e;this[_0x4584('0x35')]=_0x20c39f[_0x4584('0x35')]||_0x4584('0x36');this[_0x4584('0x37')]=_0x20c39f[_0x4584('0x37')]||0x3;this['dialQueueProject']=_0x20c39f[_0x4584('0x38')]||undefined;this[_0x4584('0x39')]=_0x20c39f[_0x4584('0x39')]||0x3;this[_0x4584('0x3a')]=_0x20c39f['dialCongestionRetryFrequency']||0x96;this[_0x4584('0x3b')]=_0x20c39f[_0x4584('0x3b')]||0x3;this[_0x4584('0x3c')]=_0x20c39f[_0x4584('0x3c')]||0x96;this[_0x4584('0x3d')]=_0x20c39f[_0x4584('0x3d')]||0x3;this['dialNoAnswerRetryFrequency']=_0x20c39f['dialNoAnswerRetryFrequency']||0x96;this[_0x4584('0x3e')]=_0x20c39f['dialNoSuchNumberMaxRetry']||0x3;this[_0x4584('0x3f')]=_0x20c39f[_0x4584('0x3f')]||0x96;this[_0x4584('0x40')]=_0x20c39f[_0x4584('0x40')]||0x3;this[_0x4584('0x41')]=_0x20c39f[_0x4584('0x41')]||0x96;this[_0x4584('0x42')]=_0x20c39f[_0x4584('0x42')]||0x3;this[_0x4584('0x43')]=_0x20c39f['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x20c39f[_0x4584('0x44')]||0x3;this['dialMachineRetryFrequency']=_0x20c39f[_0x4584('0x45')]||0x96;this[_0x4584('0x46')]=_0x20c39f[_0x4584('0x46')]||0x3;this[_0x4584('0x47')]=_0x20c39f[_0x4584('0x47')]||0x96;this[_0x4584('0x48')]=_0x20c39f[_0x4584('0x48')]||0x3;this[_0x4584('0x49')]=_0x20c39f[_0x4584('0x49')]||0x4;this[_0x4584('0x4a')]=_0x20c39f[_0x4584('0x4a')]?_0x20c39f[_0x4584('0x4a')]:undefined;this['TrunkBackup']=_0x20c39f[_0x4584('0x4b')]?_0x20c39f[_0x4584('0x4b')]:undefined;this[_0x4584('0x4c')]=_0x20c39f['dialPrefix']||undefined;this[_0x4584('0x4d')]=_0x20c39f[_0x4584('0x4d')]?_0x20c39f['Interval']:undefined;this[_0x4584('0x4e')]=_0x20c39f['dialOrderByScheduledAt']||_0x4584('0x4f');this['dialRandomLastDigitCallerIdNumber']=_0x20c39f['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x20c39f[_0x4584('0x50')]||undefined;this[_0x4584('0x51')]=strategy[_0x20c39f['strategy']];this['queueStatusComplete']=!![];this[_0x4584('0x52')]=_0x20c39f[_0x4584('0x52')]||![];this[_0x4584('0x53')]=_0x20c39f['dialAMDInitialSilence'];this[_0x4584('0x54')]=_0x20c39f[_0x4584('0x54')];this['dialAMDAfterGreetingSilence']=_0x20c39f[_0x4584('0x55')];this[_0x4584('0x56')]=_0x20c39f[_0x4584('0x56')];this[_0x4584('0x57')]=_0x20c39f['dialAMDMinWordLength'];this[_0x4584('0x58')]=_0x20c39f['dialAMDBetweenWordsSilence'];this[_0x4584('0x59')]=_0x20c39f[_0x4584('0x59')];this[_0x4584('0x5a')]=_0x20c39f[_0x4584('0x5a')];this['dialAMDMaximumWordLength']=_0x20c39f['dialAMDMaximumWordLength'];this[_0x4584('0x5b')]=0x0;this['pTalking']=0x0;this[_0x4584('0x5c')]=_0x20c39f[_0x4584('0x5c')];this[_0x4584('0x5d')]=0x0;this[_0x4584('0x5e')]=0x0;this[_0x4584('0x5f')]=0x0;this[_0x4584('0x60')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x4584('0x61')]=0x0;this[_0x4584('0x62')]=0x0;this[_0x4584('0x63')]=0x0;this[_0x4584('0x64')]=0x0;this[_0x4584('0x65')]=0x0;this[_0x4584('0x66')]=0x0;this[_0x4584('0x67')]=0x0;this[_0x4584('0x68')]=0x0;this['startProgressive']=undefined;this[_0x4584('0x69')]=undefined;this[_0x4584('0x6a')]=undefined;this[_0x4584('0x6b')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x4584('0x6c')]=0x0;this[_0x4584('0x6d')]=0x0;this[_0x4584('0x6e')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x4584('0x6f')]=0x0;this[_0x4584('0x70')]=0x0;this[_0x4584('0x71')]=_0x20c39f[_0x4584('0x72')]||0x14;this[_0x4584('0x73')]=_0x20c39f[_0x4584('0x72')]||0xa;this[_0x4584('0x74')]=0x0;this[_0x4584('0x75')]=0x0;this[_0x4584('0x76')]=0x1;this[_0x4584('0x77')]=0x0;this['erlangCallToSecond']=0x0;this[_0x4584('0x78')]=0x0;this[_0x4584('0x79')]=0x0;this[_0x4584('0x7a')]=_0x20c39f['dialRecallMeTimeout']||0x1e;this[_0x4584('0x7b')]=_0x20c39f[_0x4584('0x7b')]||![];this['dialPreviewAutoRecallMe']=!!_0x20c39f['dialPreviewAutoRecallMe']||![];this['dialPreviewRecallmeReminder']=!!_0x20c39f[_0x4584('0x7c')]||![];this[_0x4584('0x7d')]=_0x20c39f['dialQueueProject2']||undefined;this[_0x4584('0x7e')]=_0x20c39f[_0x4584('0x7e')]||![];this[_0x4584('0x7f')]=_0x20c39f[_0x4584('0x7f')]||![];this[_0x4584('0xc')]=monitorFormat[_0x20c39f['monitor_format']]?monitorFormat[_0x20c39f['monitor_format']]:undefined;this['mandatoryDisposition']=_0x20c39f[_0x4584('0x80')]||![];this['mandatoryDispositionPause']=_0x20c39f[_0x4584('0x81')]?_0x20c39f[_0x4584('0x81')]:undefined;this[_0x4584('0x82')]=![];}module[_0x4584('0x83')]=VoiceQueue;
\ No newline at end of file
+var _0xc63d=['dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','gsm','fewestcalls','leastrecent','linear','random','roundrobin','rrmemory','name','monitor_format','type','total','sumDuration','sumHoldTime','sumBillable','abandoned','busy','inUse','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup'];(function(_0x22b39b,_0x2b7d63){var _0x280e1d=function(_0xc74635){while(--_0xc74635){_0x22b39b['push'](_0x22b39b['shift']());}};_0x280e1d(++_0x2b7d63);}(_0xc63d,0xaf));var _0xdc63=function(_0x56a52f,_0x47e091){_0x56a52f=_0x56a52f-0x0;var _0x27329d=_0xc63d[_0x56a52f];return _0x27329d;};'use strict';var monitorFormat={'wav':_0xdc63('0x0'),'wav49':_0xdc63('0x1'),'gsm':_0xdc63('0x2')};var strategy={'fewestcalls':_0xdc63('0x3'),'leastrecent':_0xdc63('0x4'),'linear':_0xdc63('0x5'),'random':_0xdc63('0x6'),'ringall':'ringall','rr':_0xdc63('0x7'),'rrmemory':_0xdc63('0x8'),'rrordered':'rrordered','wrandom':'wrandom'};function VoiceQueue(_0x5dd54b){this['id']=_0x5dd54b['id']||0x0;this[_0xdc63('0x9')]=_0x5dd54b[_0xdc63('0x9')]||'';this['monitor_format']=_0x5dd54b[_0xdc63('0xa')]||'';this[_0xdc63('0xb')]=_0x5dd54b[_0xdc63('0xb')]||'inbound';this['waiting']=0x0;this[_0xdc63('0xc')]=0x0;this['answered']=0x0;this[_0xdc63('0xd')]=0x0;this[_0xdc63('0xe')]=0x0;this[_0xdc63('0xf')]=0x0;this['unmanaged']=0x0;this[_0xdc63('0x10')]=0x0;this['available']=0x0;this[_0xdc63('0x11')]=0x0;this[_0xdc63('0x12')]=0x0;this['invalid']=0x0;this['loggedIn']=0x0;this[_0xdc63('0x13')]=0x0;this[_0xdc63('0x14')]=0x0;this[_0xdc63('0x15')]=0x0;this[_0xdc63('0x16')]=0x0;this[_0xdc63('0x17')]=0x0;this[_0xdc63('0x18')]=0x0;this[_0xdc63('0x19')]=0x0;this[_0xdc63('0x1a')]=0x0;this[_0xdc63('0x1b')]=_0x5dd54b['acw']||![];this[_0xdc63('0x1c')]=_0x5dd54b['acwTimeout']||0xa;this[_0xdc63('0x1d')]=_0x5dd54b[_0xdc63('0x1d')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0xdc63('0x1e')]='';this[_0xdc63('0x1f')]=0x0;this[_0xdc63('0x20')]=0x0;this[_0xdc63('0x21')]=_0x5dd54b[_0xdc63('0x21')]||null;this[_0xdc63('0x22')]=_0x5dd54b[_0xdc63('0x22')]?_0x5dd54b[_0xdc63('0x22')]:null;this[_0xdc63('0x23')]=_0x5dd54b[_0xdc63('0x23')];this[_0xdc63('0x24')]=_0x5dd54b[_0xdc63('0x24')]||_0xdc63('0x25');this[_0xdc63('0x26')]=_0x5dd54b[_0xdc63('0x26')]||0x0;this['dialLimitQueue']=_0x5dd54b[_0xdc63('0x27')]||0x0;this[_0xdc63('0x28')]=_0x5dd54b[_0xdc63('0x28')]||0x1;this[_0xdc63('0x29')]=_0x5dd54b[_0xdc63('0x29')]||_0xdc63('0x2a');this[_0xdc63('0x2b')]=_0x5dd54b[_0xdc63('0x2b')]||0.03;this[_0xdc63('0x2c')]=_0x5dd54b[_0xdc63('0x2c')]||0x258;this[_0xdc63('0x2d')]=_0x5dd54b['dialOriginateCallerIdName']||_0xdc63('0x2e');this['dialOriginateCallerIdNumber']=_0x5dd54b[_0xdc63('0x2f')]||_0xdc63('0x2e');this[_0xdc63('0x30')]=_0x5dd54b['dialOriginateTimeout']||0x1e;this[_0xdc63('0x31')]=_0x5dd54b[_0xdc63('0x31')]||_0xdc63('0x32');this[_0xdc63('0x33')]=_0x5dd54b[_0xdc63('0x33')]||0x3;this[_0xdc63('0x34')]=_0x5dd54b['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x5dd54b[_0xdc63('0x35')]||0x3;this[_0xdc63('0x36')]=_0x5dd54b[_0xdc63('0x36')]||0x96;this[_0xdc63('0x37')]=_0x5dd54b[_0xdc63('0x37')]||0x3;this[_0xdc63('0x38')]=_0x5dd54b[_0xdc63('0x38')]||0x96;this[_0xdc63('0x39')]=_0x5dd54b[_0xdc63('0x39')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5dd54b[_0xdc63('0x3a')]||0x96;this[_0xdc63('0x3b')]=_0x5dd54b[_0xdc63('0x3b')]||0x3;this[_0xdc63('0x3c')]=_0x5dd54b[_0xdc63('0x3c')]||0x96;this['dialDropMaxRetry']=_0x5dd54b[_0xdc63('0x3d')]||0x3;this['dialDropRetryFrequency']=_0x5dd54b[_0xdc63('0x3e')]||0x96;this[_0xdc63('0x3f')]=_0x5dd54b[_0xdc63('0x3f')]||0x3;this[_0xdc63('0x40')]=_0x5dd54b[_0xdc63('0x40')]||0x96;this[_0xdc63('0x41')]=_0x5dd54b[_0xdc63('0x41')]||0x3;this['dialMachineRetryFrequency']=_0x5dd54b[_0xdc63('0x42')]||0x96;this['dialAgentRejectMaxRetry']=_0x5dd54b[_0xdc63('0x43')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5dd54b[_0xdc63('0x44')]||0x96;this['callAdditionalPhoneAfterMin']=_0x5dd54b[_0xdc63('0x45')]||0x3;this[_0xdc63('0x46')]=_0x5dd54b['dialGlobalMaxRetry']||0x4;this[_0xdc63('0x47')]=_0x5dd54b['Trunk']?_0x5dd54b['Trunk']:undefined;this[_0xdc63('0x48')]=_0x5dd54b['TrunkBackup']?_0x5dd54b['TrunkBackup']:undefined;this['dialPrefix']=_0x5dd54b[_0xdc63('0x49')]||undefined;this[_0xdc63('0x4a')]=_0x5dd54b['Interval']?_0x5dd54b[_0xdc63('0x4a')]:undefined;this['dialOrderByScheduledAt']=_0x5dd54b[_0xdc63('0x4b')]||'DESC';this[_0xdc63('0x4c')]=_0x5dd54b[_0xdc63('0x4c')]||undefined;this[_0xdc63('0x4d')]=_0x5dd54b[_0xdc63('0x4d')]||undefined;this['strategy']=strategy[_0x5dd54b['strategy']];this['queueStatusComplete']=!![];this[_0xdc63('0x4e')]=_0x5dd54b['dialAMDActive']||![];this[_0xdc63('0x4f')]=_0x5dd54b[_0xdc63('0x4f')];this[_0xdc63('0x50')]=_0x5dd54b[_0xdc63('0x50')];this[_0xdc63('0x51')]=_0x5dd54b[_0xdc63('0x51')];this['dialAMDTotalAnalysisTime']=_0x5dd54b['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x5dd54b[_0xdc63('0x52')];this[_0xdc63('0x53')]=_0x5dd54b[_0xdc63('0x53')];this[_0xdc63('0x54')]=_0x5dd54b[_0xdc63('0x54')];this[_0xdc63('0x55')]=_0x5dd54b['dialAMDSilenceThreshold'];this[_0xdc63('0x56')]=_0x5dd54b[_0xdc63('0x56')];this['outboundRejectCallsDay']=0x0;this[_0xdc63('0x57')]=0x0;this['timeout']=_0x5dd54b['timeout'];this[_0xdc63('0x58')]=0x0;this[_0xdc63('0x59')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0xdc63('0x5a')]=0x0;this[_0xdc63('0x5b')]=0x0;this[_0xdc63('0x5c')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xdc63('0x5d')]=0x0;this[_0xdc63('0x5e')]=0x0;this[_0xdc63('0x5f')]=0x0;this[_0xdc63('0x60')]=0x0;this[_0xdc63('0x61')]=0x0;this[_0xdc63('0x62')]=0x0;this[_0xdc63('0x63')]=undefined;this[_0xdc63('0x64')]=undefined;this['handlePredictive']=undefined;this[_0xdc63('0x65')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xdc63('0x66')]=0x0;this[_0xdc63('0x67')]=0x0;this[_0xdc63('0x68')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xdc63('0x69')]=0x0;this[_0xdc63('0x6a')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xdc63('0x6b')]=_0x5dd54b[_0xdc63('0x6c')]||0x14;this[_0xdc63('0x6d')]=_0x5dd54b[_0xdc63('0x6c')]||0xa;this[_0xdc63('0x6e')]=0x0;this[_0xdc63('0x6f')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xdc63('0x70')]=0x0;this['erlangCallToSecond']=0x0;this['erlangAbandonmentRate']=0x0;this[_0xdc63('0x71')]=0x0;this['dialRecallMeTimeout']=_0x5dd54b[_0xdc63('0x72')]||0x1e;this['dialRecallInQueue']=_0x5dd54b[_0xdc63('0x73')]||![];this[_0xdc63('0x74')]=!!_0x5dd54b[_0xdc63('0x74')]||![];this[_0xdc63('0x75')]=!!_0x5dd54b[_0xdc63('0x75')]||![];this[_0xdc63('0x76')]=_0x5dd54b[_0xdc63('0x76')]||undefined;this[_0xdc63('0x77')]=_0x5dd54b[_0xdc63('0x77')]||![];this[_0xdc63('0x78')]=_0x5dd54b[_0xdc63('0x78')]||![];this[_0xdc63('0xa')]=monitorFormat[_0x5dd54b[_0xdc63('0xa')]]?monitorFormat[_0x5dd54b[_0xdc63('0xa')]]:undefined;this['mandatoryDisposition']=_0x5dd54b[_0xdc63('0x79')]||![];this[_0xdc63('0x7a')]=_0x5dd54b[_0xdc63('0x7a')]?_0x5dd54b[_0xdc63('0x7a')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0xdc63('0x7b')]=VoiceQueue;
\ No newline at end of file
index 0ae72fa..bea6ca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae1c=['strategy','abandoned','busy','invalid','onHold','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','notInUse','loggedin','callers','length','SIP/','incall','status','booked','keys','queue','dialer','exten','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundCongestionCallsDay','preview','exports','ringing','talking','waiting','available','answered','inUse','loggedIn','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','paused','pTalking','sumDuration','total','name'];(function(_0x48bf27,_0x5849c8){var _0x15c620=function(_0x57d915){while(--_0x57d915){_0x48bf27['push'](_0x48bf27['shift']());}};_0x15c620(++_0x5849c8);}(_0xae1c,0xff));var _0xcae1=function(_0x4b366e,_0x479e1f){_0x4b366e=_0x4b366e-0x0;var _0x464dff=_0xae1c[_0x4b366e];return _0x464dff;};'use strict';var INBOUND_COUNTERS=['available','loggedIn','loggedInDb','paused',_0xcae1('0x0'),_0xcae1('0x1'),_0xcae1('0x2')];var OUTBOUND_COUNTERS=[_0xcae1('0x3'),_0xcae1('0x4'),_0xcae1('0x5'),_0xcae1('0x6'),_0xcae1('0x7'),_0xcae1('0x8'),_0xcae1('0x9'),_0xcae1('0xa'),_0xcae1('0xb'),_0xcae1('0xc'),'outboundCongestionCallsDay','outboundNoAnswerCallsDay',_0xcae1('0xd'),_0xcae1('0xe'),_0xcae1('0xf'),'outboundUnknownCallsDay',_0xcae1('0x10'),_0xcae1('0x11'),_0xcae1('0x1'),'sumBillable',_0xcae1('0x12'),_0xcae1('0x13'),'waiting'];function VoiceQueueSummary(_0x4e24fb){this['id']=_0x4e24fb['id'];this[_0xcae1('0x14')]=_0x4e24fb[_0xcae1('0x14')];this[_0xcae1('0x15')]=_0x4e24fb[_0xcae1('0x15')];this[_0xcae1('0x16')]=_0x4e24fb[_0xcae1('0x16')]||0x0;this[_0xcae1('0x4')]=_0x4e24fb[_0xcae1('0x4')]||0x0;this[_0xcae1('0x3')]=_0x4e24fb[_0xcae1('0x3')]||0x0;this[_0xcae1('0x17')]=_0x4e24fb[_0xcae1('0x17')]||0x0;this[_0xcae1('0x5')]=_0x4e24fb[_0xcae1('0x5')]||0x0;this[_0xcae1('0x18')]=_0x4e24fb['invalid']||0x0;this[_0xcae1('0x6')]=_0x4e24fb[_0xcae1('0x6')]||0x0;this['loggedInDb']=_0x4e24fb['loggedInDb']||0x0;this[_0xcae1('0x19')]=_0x4e24fb[_0xcae1('0x19')]||0x0;this['notInUse']=_0x4e24fb['notInUse']||0x0;this[_0xcae1('0x10')]=_0x4e24fb['paused']||0x0;this[_0xcae1('0x0')]=_0x4e24fb[_0xcae1('0x0')]||0x0;this[_0xcae1('0x1a')]=_0x4e24fb[_0xcae1('0x1a')];this[_0xcae1('0x1b')]=_0x4e24fb[_0xcae1('0x1b')];this[_0xcae1('0x12')]=_0x4e24fb[_0xcae1('0x12')];this[_0xcae1('0x1c')]=_0x4e24fb[_0xcae1('0x1c')]||0x0;this[_0xcae1('0x1')]=_0x4e24fb[_0xcae1('0x1')]||0x0;this[_0xcae1('0x13')]=_0x4e24fb[_0xcae1('0x13')]||0x0;this['type']=_0x4e24fb[_0xcae1('0x1d')];this[_0xcae1('0x1e')]=_0x4e24fb[_0xcae1('0x1e')]||0x0;this[_0xcae1('0x1f')]=_0x4e24fb['unknown']||0x0;this[_0xcae1('0x20')]=_0x4e24fb[_0xcae1('0x20')]||0x0;this[_0xcae1('0x2')]=_0x4e24fb[_0xcae1('0x2')]||0x0;if(_0x4e24fb[_0xcae1('0x1d')]===_0xcae1('0x21')){this[_0xcae1('0x11')]=_0x4e24fb[_0xcae1('0x11')]||0x0;this['dialActive']=_0x4e24fb[_0xcae1('0x22')];this['dialMethod']=_0x4e24fb[_0xcae1('0x23')];this[_0xcae1('0x24')]=_0x4e24fb['dialOriginateCallerIdName'];this[_0xcae1('0x25')]=_0x4e24fb[_0xcae1('0x25')];this[_0xcae1('0x26')]=_0x4e24fb['dialOriginateTimeout'];this['dialPrefix']=_0x4e24fb[_0xcae1('0x27')];this[_0xcae1('0x28')]=_0x4e24fb[_0xcae1('0x28')];this[_0xcae1('0x29')]=_0x4e24fb[_0xcae1('0x29')];this[_0xcae1('0xa')]=_0x4e24fb[_0xcae1('0xa')];this['outboundBlacklistCallsDay']=_0x4e24fb[_0xcae1('0xb')];this[_0xcae1('0xc')]=_0x4e24fb[_0xcae1('0xc')];this['outboundCongestionCallsDay']=_0x4e24fb['outboundCongestionCallsDay'];this[_0xcae1('0x2a')]=_0x4e24fb['outboundDropCallsDayACS'];this[_0xcae1('0x2b')]=_0x4e24fb[_0xcae1('0x2b')];this[_0xcae1('0x2c')]=_0x4e24fb[_0xcae1('0x2c')];this[_0xcae1('0x2d')]=_0x4e24fb[_0xcae1('0x2d')];this[_0xcae1('0xd')]=_0x4e24fb[_0xcae1('0xd')];this[_0xcae1('0x2e')]=_0x4e24fb[_0xcae1('0x2e')];this['outboundReCallsDay']=_0x4e24fb[_0xcae1('0xe')];this[_0xcae1('0xf')]=_0x4e24fb[_0xcae1('0xf')];this[_0xcae1('0x2f')]=_0x4e24fb['outboundUnknownCallsDay'];this[_0xcae1('0x30')]=_0x4e24fb['predictiveIntervalAnsweredCalls'];this[_0xcae1('0x31')]=_0x4e24fb['predictiveIntervalAvgHoldtime'];this[_0xcae1('0x32')]=_0x4e24fb[_0xcae1('0x32')];this[_0xcae1('0x33')]=_0x4e24fb[_0xcae1('0x33')];this[_0xcae1('0x34')]=_0x4e24fb[_0xcae1('0x34')];this[_0xcae1('0x35')]=_0x4e24fb[_0xcae1('0x35')];this[_0xcae1('0x36')]=_0x4e24fb[_0xcae1('0x36')];this['predictiveIntervalHitRate']=_0x4e24fb[_0xcae1('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x4e24fb[_0xcae1('0x38')];this['predictiveIntervalPauses']=_0x4e24fb[_0xcae1('0x39')];this[_0xcae1('0x3a')]=_0x4e24fb['predictiveIntervalAvailable'];this[_0xcae1('0x3b')]=_0x4e24fb[_0xcae1('0x3b')];this[_0xcae1('0x8')]=_0x4e24fb[_0xcae1('0x8')];this['erlangCalls']=_0x4e24fb[_0xcae1('0x3c')];this[_0xcae1('0x3d')]=_0x4e24fb['erlangCallToSecond'];this[_0xcae1('0x3e')]=_0x4e24fb[_0xcae1('0x3e')];this[_0xcae1('0x3f')]=_0x4e24fb['erlangBusyFactor'];this[_0xcae1('0x40')]=_0x4e24fb['startPredictive'];this[_0xcae1('0x41')]=_0x4e24fb[_0xcae1('0x41')];this[_0xcae1('0x42')]=_0x4e24fb['message'];this[_0xcae1('0x43')]=_0x4e24fb[_0xcae1('0x43')];}if(_0x4e24fb[_0xcae1('0x44')]){this[_0xcae1('0x44')]={'id':_0x4e24fb[_0xcae1('0x44')]['id'],'name':_0x4e24fb[_0xcae1('0x44')]['name'],'active':_0x4e24fb[_0xcae1('0x44')][_0xcae1('0x45')],'callerid':_0x4e24fb[_0xcae1('0x44')][_0xcae1('0x46')]};}}VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x48')]=function(_0x349a18,_0x1d6700,_0x145fd7,_0x43f389){this[_0xcae1('0x7')]=0x0;this['talking']=0x0;this[_0xcae1('0x10')]=0x0;this[_0xcae1('0x1f')]=0x0;this[_0xcae1('0x49')]=0x0;this[_0xcae1('0x5')]=0x0;this[_0xcae1('0x17')]=0x0;this[_0xcae1('0x18')]=0x0;this[_0xcae1('0x1e')]=0x0;this['ringing']=0x0;this[_0xcae1('0x1a')]=0x0;this[_0xcae1('0x19')]=0x0;if(_0x145fd7){if(_0x145fd7[_0xcae1('0x3')]){this[_0xcae1('0x3')]=Number(_0x145fd7['available']);}if(_0x145fd7['loggedin']){this['loggedIn']=Number(_0x145fd7[_0xcae1('0x4a')]);}if(_0x145fd7[_0xcae1('0x4b')]){this[_0xcae1('0x2')]=Number(_0x145fd7[_0xcae1('0x4b')]);}}for(var _0x11bacb=0x0;_0x11bacb<_0x349a18[_0xcae1('0x4c')];_0x11bacb++){var _0x5b95ab=_0x1d6700[_0xcae1('0x4d')+_0x349a18[_0x11bacb][_0xcae1('0x14')]];if(_0x5b95ab&&_0x5b95ab['online']){this[_0xcae1('0x7')]+=0x1;}if(_0x349a18[_0x11bacb][_0xcae1('0x4e')]==='1'){this[_0xcae1('0x1')]+=0x1;}if(_0x349a18[_0x11bacb]['paused']==='1'&&!['2','7','8']['includes'](_0x349a18[_0x11bacb][_0xcae1('0x4f')])){this[_0xcae1('0x10')]+=0x1;}switch(_0x349a18[_0x11bacb][_0xcae1('0x4f')]){case'0':this[_0xcae1('0x1f')]+=0x1;break;case'1':this[_0xcae1('0x49')]+=0x1;break;case'2':this[_0xcae1('0x5')]+=0x1;break;case'3':this[_0xcae1('0x17')]+=0x1;break;case'4':this[_0xcae1('0x18')]+=0x1;break;case'5':this[_0xcae1('0x1e')]+=0x1;break;case'6':this[_0xcae1('0x0')]+=0x1;break;case'7':this[_0xcae1('0x1a')]+=0x1;break;case'8':this[_0xcae1('0x19')]+=0x1;break;}}if(this['dialMethod']===_0xcae1('0x50')){var _0xcad695=Object[_0xcae1('0x51')](_0x43f389);for(var _0x258630=0x0;_0x258630<_0xcad695[_0xcae1('0x4c')];_0x258630++){var _0x3ccfb4=_0xcad695[_0x258630];var _0x9ef6d4=_0x43f389[_0x3ccfb4];if(_0x9ef6d4[_0xcae1('0x52')]===this[_0xcae1('0x14')]&&_0x9ef6d4[_0xcae1('0x1d')]===_0xcae1('0x53')&&_0x9ef6d4[_0xcae1('0x54')]==='xcally-motion-preview'){this[_0xcae1('0x1')]+=0x1;}}if(this[_0xcae1('0x1')]>this[_0xcae1('0x5')]){this['talking']=this[_0xcae1('0x5')];}this[_0xcae1('0x11')]=0x0;}return this;};VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x55')]=function(_0x5282ac){var _0x2efd37=![];if(_0x5282ac){_0x2efd37=INBOUND_COUNTERS[_0xcae1('0x56')](function(_0x1b40b9){return this[_0x1b40b9]!==_0x5282ac[_0x1b40b9];},this);}return _0x2efd37;};VoiceQueueSummary['prototype'][_0xcae1('0x57')]=function(_0x16b1b2){var _0x90b0ad=![];var _0x4e5d01=![];var _0x303b98=![];if(_0x16b1b2){_0x90b0ad=this[_0xcae1('0x23')]!==_0x16b1b2['dialMethod']||this[_0xcae1('0x22')]!==_0x16b1b2[_0xcae1('0x22')]||this[_0xcae1('0x42')]!==_0x16b1b2['message']||this[_0xcae1('0x43')]!==_0x16b1b2[_0xcae1('0x43')];_0x4e5d01=OUTBOUND_COUNTERS['some'](function(_0x4b68d1){return this[_0x4b68d1]!==_0x16b1b2[_0x4b68d1];},this);if(this[_0xcae1('0x44')]&&_0x16b1b2[_0xcae1('0x44')]){_0x303b98=this[_0xcae1('0x44')][_0xcae1('0x14')]!==_0x16b1b2['Trunk'][_0xcae1('0x14')]||this[_0xcae1('0x44')]['active']!==_0x16b1b2[_0xcae1('0x44')][_0xcae1('0x45')];}}return _0x90b0ad||_0x4e5d01||_0x303b98;};VoiceQueueSummary[_0xcae1('0x47')][_0xcae1('0x58')]=function(_0x1de80e){this[_0xcae1('0x4')]=_0x1de80e[_0xcae1('0x4')];this[_0xcae1('0x42')]=_0x1de80e[_0xcae1('0x42')];this['statusMessage']=_0x1de80e['statusMessage'];this[_0xcae1('0x8')]=_0x1de80e['originated'];this['outboundAbandonedCallsDay']=_0x1de80e[_0xcae1('0x9')];this[_0xcae1('0xa')]=_0x1de80e[_0xcae1('0xa')];this[_0xcae1('0xb')]=_0x1de80e[_0xcae1('0xb')];this[_0xcae1('0xc')]=_0x1de80e[_0xcae1('0xc')];this[_0xcae1('0x59')]=_0x1de80e[_0xcae1('0x59')];this[_0xcae1('0x2d')]=_0x1de80e[_0xcae1('0x2d')];this[_0xcae1('0xd')]=_0x1de80e['outboundNoSuchCallsDay'];this['outboundReCallsDay']=_0x1de80e[_0xcae1('0xe')];this[_0xcae1('0xf')]=_0x1de80e[_0xcae1('0xf')];this[_0xcae1('0x2f')]=_0x1de80e[_0xcae1('0x2f')];this['sumBillable']=_0x1de80e[_0xcae1('0x1b')];this[_0xcae1('0x12')]=_0x1de80e[_0xcae1('0x12')];this[_0xcae1('0x13')]=_0x1de80e[_0xcae1('0x13')];if(this[_0xcae1('0x23')]===_0xcae1('0x5a')){this[_0xcae1('0x11')]=_0x1de80e[_0xcae1('0x11')];}};module[_0xcae1('0x5b')]=VoiceQueueSummary;
\ No newline at end of file
+var _0xac4f=['callers','length','online','incall','includes','status','keys','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','exports','available','loggedInDb','ringing','answered','loggedIn','originated','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','pTalking','talking','sumBillable','sumDuration','total','waiting','name','strategy','abandoned','busy','inUse','invalid','onHold','notInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','ringInUse','loggedin'];(function(_0x109ecb,_0x597118){var _0x13422b=function(_0x14c3e3){while(--_0x14c3e3){_0x109ecb['push'](_0x109ecb['shift']());}};_0x13422b(++_0x597118);}(_0xac4f,0x122));var _0xfac4=function(_0x5d84d6,_0x1a4671){_0x5d84d6=_0x5d84d6-0x0;var _0x2cd0f5=_0xac4f[_0x5d84d6];return _0x2cd0f5;};'use strict';var INBOUND_COUNTERS=[_0xfac4('0x0'),'loggedIn',_0xfac4('0x1'),'paused',_0xfac4('0x2'),'talking','waiting'];var OUTBOUND_COUNTERS=[_0xfac4('0x0'),_0xfac4('0x3'),'inUse',_0xfac4('0x4'),_0xfac4('0x1'),_0xfac4('0x5'),'outboundAbandonedCallsDay',_0xfac4('0x6'),_0xfac4('0x7'),_0xfac4('0x8'),_0xfac4('0x9'),_0xfac4('0xa'),_0xfac4('0xb'),'outboundReCallsDay',_0xfac4('0xc'),_0xfac4('0xd'),_0xfac4('0xe'),_0xfac4('0xf'),_0xfac4('0x10'),_0xfac4('0x11'),_0xfac4('0x12'),_0xfac4('0x13'),_0xfac4('0x14')];function VoiceQueueSummary(_0x2ebb02){this['id']=_0x2ebb02['id'];this[_0xfac4('0x15')]=_0x2ebb02[_0xfac4('0x15')];this['strategy']=_0x2ebb02[_0xfac4('0x16')];this['abandoned']=_0x2ebb02[_0xfac4('0x17')]||0x0;this[_0xfac4('0x3')]=_0x2ebb02[_0xfac4('0x3')]||0x0;this[_0xfac4('0x0')]=_0x2ebb02[_0xfac4('0x0')]||0x0;this[_0xfac4('0x18')]=_0x2ebb02[_0xfac4('0x18')]||0x0;this[_0xfac4('0x19')]=_0x2ebb02['inUse']||0x0;this[_0xfac4('0x1a')]=_0x2ebb02[_0xfac4('0x1a')]||0x0;this[_0xfac4('0x4')]=_0x2ebb02[_0xfac4('0x4')]||0x0;this[_0xfac4('0x1')]=_0x2ebb02[_0xfac4('0x1')]||0x0;this[_0xfac4('0x1b')]=_0x2ebb02[_0xfac4('0x1b')]||0x0;this[_0xfac4('0x1c')]=_0x2ebb02['notInUse']||0x0;this['paused']=_0x2ebb02['paused']||0x0;this[_0xfac4('0x2')]=_0x2ebb02[_0xfac4('0x2')]||0x0;this['ringInUse']=_0x2ebb02['ringInUse'];this['sumBillable']=_0x2ebb02[_0xfac4('0x11')];this[_0xfac4('0x12')]=_0x2ebb02['sumDuration'];this[_0xfac4('0x1d')]=_0x2ebb02[_0xfac4('0x1d')]||0x0;this[_0xfac4('0x10')]=_0x2ebb02[_0xfac4('0x10')]||0x0;this[_0xfac4('0x13')]=_0x2ebb02[_0xfac4('0x13')]||0x0;this[_0xfac4('0x1e')]=_0x2ebb02[_0xfac4('0x1e')];this[_0xfac4('0x1f')]=_0x2ebb02[_0xfac4('0x1f')]||0x0;this[_0xfac4('0x20')]=_0x2ebb02['unknown']||0x0;this[_0xfac4('0x21')]=_0x2ebb02[_0xfac4('0x21')]||0x0;this['waiting']=_0x2ebb02[_0xfac4('0x14')]||0x0;if(_0x2ebb02[_0xfac4('0x1e')]===_0xfac4('0x22')){this['pTalking']=_0x2ebb02[_0xfac4('0xf')]||0x0;this[_0xfac4('0x23')]=_0x2ebb02['dialActive'];this[_0xfac4('0x24')]=_0x2ebb02[_0xfac4('0x24')];this[_0xfac4('0x25')]=_0x2ebb02[_0xfac4('0x25')];this[_0xfac4('0x26')]=_0x2ebb02['dialOriginateCallerIdNumber'];this[_0xfac4('0x27')]=_0x2ebb02['dialOriginateTimeout'];this[_0xfac4('0x28')]=_0x2ebb02[_0xfac4('0x28')];this['temp']=_0x2ebb02[_0xfac4('0x29')];this['outboundAnswerAgiCallsDay']=_0x2ebb02[_0xfac4('0x2a')];this['outboundAnswerCallsDay']=_0x2ebb02['outboundAnswerCallsDay'];this[_0xfac4('0x7')]=_0x2ebb02['outboundBlacklistCallsDay'];this[_0xfac4('0x8')]=_0x2ebb02[_0xfac4('0x8')];this['outboundCongestionCallsDay']=_0x2ebb02['outboundCongestionCallsDay'];this[_0xfac4('0x2b')]=_0x2ebb02['outboundDropCallsDayACS'];this[_0xfac4('0x2c')]=_0x2ebb02[_0xfac4('0x2c')];this[_0xfac4('0x2d')]=_0x2ebb02[_0xfac4('0x2d')];this[_0xfac4('0xa')]=_0x2ebb02[_0xfac4('0xa')];this['outboundNoSuchCallsDay']=_0x2ebb02['outboundNoSuchCallsDay'];this[_0xfac4('0x2e')]=_0x2ebb02[_0xfac4('0x2e')];this[_0xfac4('0x2f')]=_0x2ebb02[_0xfac4('0x2f')];this[_0xfac4('0xc')]=_0x2ebb02[_0xfac4('0xc')];this[_0xfac4('0xd')]=_0x2ebb02[_0xfac4('0xd')];this[_0xfac4('0x30')]=_0x2ebb02[_0xfac4('0x30')];this['predictiveIntervalAvgHoldtime']=_0x2ebb02['predictiveIntervalAvgHoldtime'];this[_0xfac4('0x31')]=_0x2ebb02[_0xfac4('0x31')];this[_0xfac4('0x32')]=_0x2ebb02[_0xfac4('0x32')];this[_0xfac4('0x33')]=_0x2ebb02[_0xfac4('0x33')];this[_0xfac4('0x34')]=_0x2ebb02[_0xfac4('0x34')];this[_0xfac4('0x35')]=_0x2ebb02[_0xfac4('0x35')];this[_0xfac4('0x36')]=_0x2ebb02[_0xfac4('0x36')];this['predictiveIntervalMultiplicativeFactor']=_0x2ebb02[_0xfac4('0x37')];this[_0xfac4('0x38')]=_0x2ebb02[_0xfac4('0x38')];this[_0xfac4('0x39')]=_0x2ebb02[_0xfac4('0x39')];this[_0xfac4('0x3a')]=_0x2ebb02['predictiveIntervalTotalCalls'];this['originated']=_0x2ebb02[_0xfac4('0x5')];this[_0xfac4('0x3b')]=_0x2ebb02[_0xfac4('0x3b')];this['erlangCallToSecond']=_0x2ebb02[_0xfac4('0x3c')];this[_0xfac4('0x3d')]=_0x2ebb02[_0xfac4('0x3d')];this[_0xfac4('0x3e')]=_0x2ebb02[_0xfac4('0x3e')];this['startPredictive']=_0x2ebb02[_0xfac4('0x3f')];this[_0xfac4('0x40')]=_0x2ebb02[_0xfac4('0x40')];this[_0xfac4('0x41')]=_0x2ebb02[_0xfac4('0x41')];this[_0xfac4('0x42')]=_0x2ebb02[_0xfac4('0x42')];}if(_0x2ebb02[_0xfac4('0x43')]){this['Trunk']={'id':_0x2ebb02[_0xfac4('0x43')]['id'],'name':_0x2ebb02[_0xfac4('0x43')][_0xfac4('0x15')],'active':_0x2ebb02[_0xfac4('0x43')][_0xfac4('0x44')],'callerid':_0x2ebb02[_0xfac4('0x43')][_0xfac4('0x45')]};}}VoiceQueueSummary[_0xfac4('0x46')][_0xfac4('0x47')]=function(_0x1a9aee,_0x4127c6,_0x27847f,_0x288831){this[_0xfac4('0x1')]=0x0;this[_0xfac4('0x10')]=0x0;this['paused']=0x0;this['unknown']=0x0;this['notInUse']=0x0;this[_0xfac4('0x19')]=0x0;this[_0xfac4('0x18')]=0x0;this[_0xfac4('0x1a')]=0x0;this[_0xfac4('0x1f')]=0x0;this[_0xfac4('0x2')]=0x0;this[_0xfac4('0x48')]=0x0;this['onHold']=0x0;if(_0x27847f){if(_0x27847f['available']){this['available']=Number(_0x27847f[_0xfac4('0x0')]);}if(_0x27847f['loggedin']){this[_0xfac4('0x4')]=Number(_0x27847f[_0xfac4('0x49')]);}if(_0x27847f[_0xfac4('0x4a')]){this[_0xfac4('0x14')]=Number(_0x27847f[_0xfac4('0x4a')]);}}for(var _0x12aeff=0x0;_0x12aeff<_0x1a9aee[_0xfac4('0x4b')];_0x12aeff++){var _0x2c751f=_0x4127c6['SIP/'+_0x1a9aee[_0x12aeff][_0xfac4('0x15')]];if(_0x2c751f&&_0x2c751f[_0xfac4('0x4c')]){this['loggedInDb']+=0x1;}if(_0x1a9aee[_0x12aeff][_0xfac4('0x4d')]==='1'){this['talking']+=0x1;}if(_0x1a9aee[_0x12aeff][_0xfac4('0xe')]==='1'&&!['2','7','8'][_0xfac4('0x4e')](_0x1a9aee[_0x12aeff][_0xfac4('0x4f')])){this[_0xfac4('0xe')]+=0x1;}switch(_0x1a9aee[_0x12aeff][_0xfac4('0x4f')]){case'0':this[_0xfac4('0x20')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xfac4('0x19')]+=0x1;break;case'3':this[_0xfac4('0x18')]+=0x1;break;case'4':this[_0xfac4('0x1a')]+=0x1;break;case'5':this[_0xfac4('0x1f')]+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0xfac4('0x48')]+=0x1;break;case'8':this[_0xfac4('0x1b')]+=0x1;break;}}if(this[_0xfac4('0x24')]==='booked'){var _0x4337ab=Object[_0xfac4('0x50')](_0x288831);for(var _0x32c735=0x0;_0x32c735<_0x4337ab[_0xfac4('0x4b')];_0x32c735++){var _0x594b99=_0x4337ab[_0x32c735];var _0x12afb6=_0x288831[_0x594b99];if(_0x12afb6['queue']===this[_0xfac4('0x15')]&&_0x12afb6['type']===_0xfac4('0x51')&&_0x12afb6[_0xfac4('0x52')]===_0xfac4('0x53')){this[_0xfac4('0x10')]+=0x1;}}if(this['talking']>this[_0xfac4('0x19')]){this['talking']=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xfac4('0x46')][_0xfac4('0x54')]=function(_0x248420){var _0x17116a=![];if(_0x248420){_0x17116a=INBOUND_COUNTERS[_0xfac4('0x55')](function(_0x357779){return this[_0x357779]!==_0x248420[_0x357779];},this);}return _0x17116a;};VoiceQueueSummary[_0xfac4('0x46')][_0xfac4('0x56')]=function(_0x1db04a){var _0x47b525=![];var _0x1c726d=![];var _0x41814e=![];if(_0x1db04a){_0x47b525=this[_0xfac4('0x24')]!==_0x1db04a[_0xfac4('0x24')]||this['dialActive']!==_0x1db04a[_0xfac4('0x23')]||this[_0xfac4('0x41')]!==_0x1db04a[_0xfac4('0x41')]||this[_0xfac4('0x42')]!==_0x1db04a['statusMessage'];_0x1c726d=OUTBOUND_COUNTERS[_0xfac4('0x55')](function(_0x53eefd){return this[_0x53eefd]!==_0x1db04a[_0x53eefd];},this);if(this[_0xfac4('0x43')]&&_0x1db04a[_0xfac4('0x43')]){_0x41814e=this[_0xfac4('0x43')]['name']!==_0x1db04a[_0xfac4('0x43')][_0xfac4('0x15')]||this[_0xfac4('0x43')][_0xfac4('0x44')]!==_0x1db04a[_0xfac4('0x43')][_0xfac4('0x44')];}}return _0x47b525||_0x1c726d||_0x41814e;};VoiceQueueSummary['prototype'][_0xfac4('0x57')]=function(_0x9c4efb){this[_0xfac4('0x3')]=_0x9c4efb[_0xfac4('0x3')];this[_0xfac4('0x41')]=_0x9c4efb[_0xfac4('0x41')];this[_0xfac4('0x42')]=_0x9c4efb['statusMessage'];this['originated']=_0x9c4efb[_0xfac4('0x5')];this[_0xfac4('0x58')]=_0x9c4efb[_0xfac4('0x58')];this['outboundAnswerCallsDay']=_0x9c4efb[_0xfac4('0x6')];this[_0xfac4('0x7')]=_0x9c4efb[_0xfac4('0x7')];this['outboundBusyCallsDay']=_0x9c4efb['outboundBusyCallsDay'];this[_0xfac4('0x9')]=_0x9c4efb[_0xfac4('0x9')];this[_0xfac4('0xa')]=_0x9c4efb[_0xfac4('0xa')];this['outboundNoSuchCallsDay']=_0x9c4efb[_0xfac4('0xb')];this[_0xfac4('0x2f')]=_0x9c4efb[_0xfac4('0x2f')];this[_0xfac4('0xc')]=_0x9c4efb['outboundRejectCallsDay'];this[_0xfac4('0xd')]=_0x9c4efb[_0xfac4('0xd')];this[_0xfac4('0x11')]=_0x9c4efb[_0xfac4('0x11')];this[_0xfac4('0x12')]=_0x9c4efb['sumDuration'];this['total']=_0x9c4efb['total'];if(this[_0xfac4('0x24')]===_0xfac4('0x59')){this[_0xfac4('0xf')]=_0x9c4efb[_0xfac4('0xf')];}};module[_0xfac4('0x5a')]=VoiceQueueSummary;
\ No newline at end of file
index 1f82a40..d86de2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc5f=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x4e3ddd,_0x354180){var _0x1298a7=function(_0x276982){while(--_0x276982){_0x4e3ddd['push'](_0x4e3ddd['shift']());}};_0x1298a7(++_0x354180);}(_0xcc5f,0x162));var _0xfcc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc5f[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x13396a){this['id']=_0x13396a['id']||0x0;this[_0xfcc5('0x0')]=_0x13396a['name']||'';this[_0xfcc5('0x1')]=_0x13396a[_0xfcc5('0x1')]||'';this['accessKey']=_0x13396a['accessKey']||'';this['remoteUri']=_0x13396a[_0xfcc5('0x2')]||'';this[_0xfcc5('0x3')]=_0x13396a[_0xfcc5('0x3')]||'';this[_0xfcc5('0x4')]=_0x13396a[_0xfcc5('0x4')]||{};}module['exports']=VtigerAccount;
\ No newline at end of file
+var _0xdcd6=['Configurations','username','accessKey','remoteUri','serverUrl'];(function(_0x4cb4a6,_0x31d41a){var _0x4c3978=function(_0x2df692){while(--_0x2df692){_0x4cb4a6['push'](_0x4cb4a6['shift']());}};_0x4c3978(++_0x31d41a);}(_0xdcd6,0x92));var _0x6dcd=function(_0x3e45a6,_0x576195){_0x3e45a6=_0x3e45a6-0x0;var _0x4751f7=_0xdcd6[_0x3e45a6];return _0x4751f7;};'use strict';function VtigerAccount(_0x2814e3){this['id']=_0x2814e3['id']||0x0;this['name']=_0x2814e3['name']||'';this[_0x6dcd('0x0')]=_0x2814e3[_0x6dcd('0x0')]||'';this['accessKey']=_0x2814e3[_0x6dcd('0x1')]||'';this[_0x6dcd('0x2')]=_0x2814e3[_0x6dcd('0x2')]||'';this[_0x6dcd('0x3')]=_0x2814e3[_0x6dcd('0x3')]||'';this[_0x6dcd('0x4')]=_0x2814e3['Configurations']||{};}module['exports']=VtigerAccount;
\ No newline at end of file
index 8301c94..07e5918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5404=['exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x5404,0xdd));var _0x4540=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5404[_0x19950b];return _0x3c6b41;};'use strict';function ZendeskAccount(_0xae2598){this['id']=_0xae2598['id']||0x0;this[_0x4540('0x0')]=_0xae2598[_0x4540('0x0')]||'';this[_0x4540('0x1')]=_0xae2598['username']||'';this[_0x4540('0x2')]=_0xae2598[_0x4540('0x2')]||'';this[_0x4540('0x3')]=_0xae2598[_0x4540('0x3')]||'';this['remoteUri']=_0xae2598[_0x4540('0x4')]||'';this[_0x4540('0x5')]=_0xae2598['authType']||'';this[_0x4540('0x6')]=_0xae2598['type']||_0x4540('0x7');this[_0x4540('0x8')]=_0xae2598['serverUrl']||'';this[_0x4540('0x9')]=_0xae2598[_0x4540('0x9')]||{};}module[_0x4540('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0x830f=['name','username','token','remoteUri','authType','type','integrationTab','serverUrl','exports'];(function(_0x2b6acc,_0x1afc35){var _0x4d4a38=function(_0x2cf899){while(--_0x2cf899){_0x2b6acc['push'](_0x2b6acc['shift']());}};_0x4d4a38(++_0x1afc35);}(_0x830f,0x1ef));var _0xf830=function(_0x35f301,_0xfa346d){_0x35f301=_0x35f301-0x0;var _0x2164d8=_0x830f[_0x35f301];return _0x2164d8;};'use strict';function ZendeskAccount(_0x398cee){this['id']=_0x398cee['id']||0x0;this[_0xf830('0x0')]=_0x398cee[_0xf830('0x0')]||'';this[_0xf830('0x1')]=_0x398cee[_0xf830('0x1')]||'';this['password']=_0x398cee['password']||'';this[_0xf830('0x2')]=_0x398cee[_0xf830('0x2')]||'';this[_0xf830('0x3')]=_0x398cee['remoteUri']||'';this[_0xf830('0x4')]=_0x398cee['authType']||'';this[_0xf830('0x5')]=_0x398cee['type']||_0xf830('0x6');this[_0xf830('0x7')]=_0x398cee[_0xf830('0x7')]||'';this['Configurations']=_0x398cee['Configurations']||{};}module[_0xf830('0x8')]=ZendeskAccount;
\ No newline at end of file
index f61cab5..6f2549b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5ff=['Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x4b304b,_0x3ca867){var _0x2a1baf=function(_0x9fb7eb){while(--_0x9fb7eb){_0x4b304b['push'](_0x4b304b['shift']());}};_0x2a1baf(++_0x3ca867);}(_0xf5ff,0xff));var _0xff5f=function(_0x3d7e29,_0x962572){_0x3d7e29=_0x3d7e29-0x0;var _0x10eedb=_0xf5ff[_0x3d7e29];return _0x10eedb;};'use strict';function ZohoAccount(_0x399f56){this['id']=_0x399f56['id']||0x0;this[_0xff5f('0x0')]=_0x399f56['name']||'';this[_0xff5f('0x1')]=_0x399f56[_0xff5f('0x1')]||'';this[_0xff5f('0x2')]=_0x399f56[_0xff5f('0x2')]||'';this['zone']=_0x399f56[_0xff5f('0x3')]||'';this[_0xff5f('0x4')]=_0x399f56[_0xff5f('0x4')]||'';this[_0xff5f('0x5')]=_0x399f56[_0xff5f('0x5')]||'';this[_0xff5f('0x6')]=_0x399f56['serverUrl']||'';this[_0xff5f('0x7')]=_0x399f56[_0xff5f('0x7')]||'';this[_0xff5f('0x8')]=_0x399f56[_0xff5f('0x8')]||'';this[_0xff5f('0x9')]=_0x399f56[_0xff5f('0x9')]||{};}module[_0xff5f('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x234e=['zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','name','description','host'];(function(_0x349b8a,_0x35b021){var _0x1d5645=function(_0x1deb06){while(--_0x1deb06){_0x349b8a['push'](_0x349b8a['shift']());}};_0x1d5645(++_0x35b021);}(_0x234e,0xb1));var _0xe234=function(_0x4ad8f9,_0x237d5f){_0x4ad8f9=_0x4ad8f9-0x0;var _0x4bec6d=_0x234e[_0x4ad8f9];return _0x4bec6d;};'use strict';function ZohoAccount(_0x526b90){this['id']=_0x526b90['id']||0x0;this[_0xe234('0x0')]=_0x526b90[_0xe234('0x0')]||'';this[_0xe234('0x1')]=_0x526b90[_0xe234('0x1')]||'';this[_0xe234('0x2')]=_0x526b90[_0xe234('0x2')]||'';this[_0xe234('0x3')]=_0x526b90[_0xe234('0x3')]||'';this[_0xe234('0x4')]=_0x526b90[_0xe234('0x4')]||'';this[_0xe234('0x5')]=_0x526b90[_0xe234('0x5')]||'';this['serverUrl']=_0x526b90[_0xe234('0x6')]||'';this[_0xe234('0x7')]=_0x526b90[_0xe234('0x7')]||'';this[_0xe234('0x8')]=_0x526b90[_0xe234('0x8')]||'';this['Configurations']=_0x526b90[_0xe234('0x9')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
index 117c5bd..fd2a201 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78e=['Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname'];(function(_0x40e74c,_0x1883a2){var _0x3a8c6b=function(_0x1a4ae4){while(--_0x1a4ae4){_0x40e74c['push'](_0x40e74c['shift']());}};_0x3a8c6b(++_0x1883a2);}(_0xb78e,0x1c9));var _0xeb78=function(_0x22552e,_0x240b36){_0x22552e=_0x22552e-0x0;var _0x2decbb=_0xb78e[_0x22552e];return _0x2decbb;};'use strict';var util=require(_0xeb78('0x0'));var _=require(_0xeb78('0x1'));var moment=require('moment');function checkNameSurname(_0x1570f5,_0x2785f9,_0xb198c1){var _0x2520cf='';if(!_[_0xeb78('0x2')](_0x2785f9)&&_0xeb78('0x3')===typeof _0x2785f9){_0x2520cf+=_0x2785f9;}if(!_[_0xeb78('0x2')](_0xb198c1)&&_0xeb78('0x3')===typeof _0xb198c1){_0x2520cf+='\x20'+_0xb198c1;}if(_0x2520cf!==''){return _0x2520cf;}return _0x1570f5;}function Action(_0x57ec6b,_0x3c35e7,_0x17a736,_0x1ccc2f,_0x30c884){this[_0xeb78('0x4')]=_0x17a736||undefined;this[_0xeb78('0x5')]=_0x57ec6b['id'];this[_0xeb78('0x6')]=_0x3c35e7['name'];this[_0xeb78('0x7')]=_0x3c35e7[_0xeb78('0x7')];this[_0xeb78('0x8')]=_0xeb78('0x6');this[_0xeb78('0x9')]=![];this[_0xeb78('0xa')]=_[_0xeb78('0x2')](_0x57ec6b[_0xeb78('0xb')])?undefined:_0x57ec6b[_0xeb78('0xb')]['name'];this[_0xeb78('0xc')]=this[_0xeb78('0xa')]?util[_0xeb78('0xd')](_0xeb78('0xe'),this[_0xeb78('0xa')]):_0x1ccc2f||undefined;this[_0xeb78('0xf')]=checkNameSurname(_0x57ec6b[_0xeb78('0x10')][_0xeb78('0x11')],_0x57ec6b[_0xeb78('0x10')][_0xeb78('0x12')],_0x57ec6b['Contact'][_0xeb78('0x13')]);this[_0xeb78('0x14')]=_0x57ec6b['active']||![];this['calleridnum']=_0x57ec6b['phone'];this[_0xeb78('0x15')]=_0x57ec6b['scheduledat'];this[_0xeb78('0x16')]=_0x57ec6b[_0xeb78('0x16')]||0x0;this['countcongestionretry']=_0x57ec6b[_0xeb78('0x17')]||0x0;this['countnoanswerretry']=_0x57ec6b[_0xeb78('0x18')]||0x0;this[_0xeb78('0x19')]=(_0x57ec6b['countbusyretry']||0x0)+(_0x57ec6b[_0xeb78('0x17')]||0x0)+(_0x57ec6b[_0xeb78('0x18')]||0x0)+(_0x57ec6b[_0xeb78('0x1a')]||0x0)+(_0x57ec6b['countdropretry']||0x0)+(_0x57ec6b[_0xeb78('0x1b')]||0x0)+(_0x57ec6b[_0xeb78('0x1c')]||0x0)+(_0x57ec6b['countagentrejectretry']||0x0);this['countnosuchnumberretry']=_0x57ec6b[_0xeb78('0x1a')]||0x0;this[_0xeb78('0x1d')]=_0x57ec6b[_0xeb78('0x1d')]||0x0;this[_0xeb78('0x1b')]=_0x57ec6b[_0xeb78('0x1b')]||0x0;this[_0xeb78('0x1c')]=_0x57ec6b[_0xeb78('0x1c')]||0x0;this[_0xeb78('0x1e')]=_0x57ec6b[_0xeb78('0x1e')]||0x0;this['callback']=_0x57ec6b['callback'];this['callbackuniqueid']=_0x57ec6b['callbackuniqueid'];this[_0xeb78('0x1f')]=_0x57ec6b['callbackat'];this[_0xeb78('0x20')]=_0x57ec6b[_0xeb78('0x20')];this['ContactId']=_0x57ec6b[_0xeb78('0x21')];this['ListId']=_0x57ec6b[_0xeb78('0x22')];this[_0xeb78('0x23')]=_[_0xeb78('0x2')](_0x57ec6b[_0xeb78('0xb')])?_0x57ec6b['UserId']:_0x57ec6b[_0xeb78('0xb')]['id'];this['VoiceQueueId']=_0x57ec6b[_0xeb78('0x24')];this[_0xeb78('0x25')]='';this[_0xeb78('0x26')]='';}Action['prototype'][_0xeb78('0x27')]=function(){return util[_0xeb78('0xd')](_0xeb78('0x28'),this[_0xeb78('0xf')],this[_0xeb78('0x29')]);};module[_0xeb78('0x2a')]=Action;
\ No newline at end of file
+var _0x955f=['countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','exports','util','lodash','moment','isNil','uniqueid','queue','name','type','campaigntype','dialAnswer','Agent','channelAgent','format','membername','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry'];(function(_0x2ea046,_0x5ab912){var _0x433e5a=function(_0x13202c){while(--_0x13202c){_0x2ea046['push'](_0x2ea046['shift']());}};_0x433e5a(++_0x5ab912);}(_0x955f,0x1eb));var _0xf955=function(_0x1f1850,_0x3c042a){_0x1f1850=_0x1f1850-0x0;var _0x2fd9ff=_0x955f[_0x1f1850];return _0x2fd9ff;};'use strict';var util=require(_0xf955('0x0'));var _=require(_0xf955('0x1'));var moment=require(_0xf955('0x2'));function checkNameSurname(_0x382225,_0x2834f7,_0x585f6e){var _0xd75c8f='';if(!_['isNil'](_0x2834f7)&&'string'===typeof _0x2834f7){_0xd75c8f+=_0x2834f7;}if(!_[_0xf955('0x3')](_0x585f6e)&&'string'===typeof _0x585f6e){_0xd75c8f+='\x20'+_0x585f6e;}if(_0xd75c8f!==''){return _0xd75c8f;}return _0x382225;}function Action(_0x13b796,_0x2caff2,_0x3fdac2,_0x59d5b3,_0x18432f){this[_0xf955('0x4')]=_0x3fdac2||undefined;this['idContact']=_0x13b796['id'];this[_0xf955('0x5')]=_0x2caff2[_0xf955('0x6')];this[_0xf955('0x7')]=_0x2caff2[_0xf955('0x7')];this[_0xf955('0x8')]=_0xf955('0x5');this[_0xf955('0x9')]=![];this['membername']=_[_0xf955('0x3')](_0x13b796['Agent'])?undefined:_0x13b796[_0xf955('0xa')][_0xf955('0x6')];this[_0xf955('0xb')]=this['membername']?util[_0xf955('0xc')]('SIP/%s',this[_0xf955('0xd')]):_0x59d5b3||undefined;this['calleridname']=checkNameSurname(_0x13b796[_0xf955('0xe')][_0xf955('0xf')],_0x13b796[_0xf955('0xe')][_0xf955('0x10')],_0x13b796[_0xf955('0xe')][_0xf955('0x11')]);this[_0xf955('0x12')]=_0x13b796[_0xf955('0x12')]||![];this[_0xf955('0x13')]=_0x13b796[_0xf955('0xf')];this['scheduledat']=_0x13b796[_0xf955('0x14')];this['countbusyretry']=_0x13b796[_0xf955('0x15')]||0x0;this[_0xf955('0x16')]=_0x13b796[_0xf955('0x16')]||0x0;this[_0xf955('0x17')]=_0x13b796['countnoanswerretry']||0x0;this['countglobal']=(_0x13b796[_0xf955('0x15')]||0x0)+(_0x13b796[_0xf955('0x16')]||0x0)+(_0x13b796[_0xf955('0x17')]||0x0)+(_0x13b796['countnosuchnumberretry']||0x0)+(_0x13b796[_0xf955('0x18')]||0x0)+(_0x13b796[_0xf955('0x19')]||0x0)+(_0x13b796[_0xf955('0x1a')]||0x0)+(_0x13b796[_0xf955('0x1b')]||0x0);this[_0xf955('0x1c')]=_0x13b796['countnosuchnumberretry']||0x0;this[_0xf955('0x18')]=_0x13b796[_0xf955('0x18')]||0x0;this[_0xf955('0x19')]=_0x13b796['countabandonedretry']||0x0;this[_0xf955('0x1a')]=_0x13b796['countmachineretry']||0x0;this[_0xf955('0x1b')]=_0x13b796[_0xf955('0x1b')]||0x0;this[_0xf955('0x1d')]=_0x13b796[_0xf955('0x1d')];this[_0xf955('0x1e')]=_0x13b796['callbackuniqueid'];this[_0xf955('0x1f')]=_0x13b796[_0xf955('0x1f')];this[_0xf955('0x20')]=_0x13b796[_0xf955('0x20')];this[_0xf955('0x21')]=_0x13b796[_0xf955('0x21')];this[_0xf955('0x22')]=_0x13b796['ListId'];this[_0xf955('0x23')]=_[_0xf955('0x3')](_0x13b796[_0xf955('0xa')])?_0x13b796[_0xf955('0x23')]:_0x13b796[_0xf955('0xa')]['id'];this[_0xf955('0x24')]=_0x13b796[_0xf955('0x24')];this['originatecalleridnum']='';this[_0xf955('0x25')]='';}Action[_0xf955('0x26')][_0xf955('0x27')]=function(){return util[_0xf955('0xc')](_0xf955('0x28'),this[_0xf955('0x29')],this['number']);};module[_0xf955('0x2a')]=Action;
\ No newline at end of file
index 474d7be..5e81140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b84=['countbusyretry','scheduledAt','unlockAgent','idContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','outboundAbandonedCallsDay','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','checkInBlack','Contact\x20is\x20undefined','lookAgent','execCall','Queue:\x20','custom:agentcalled','[Preview][execCall][failure]','logBlacklist','createHistory','active','SIP/%s','format','reachable','unmonitored','execRun','getContactPreview','recallme','validateContact','checkIsBlackList','phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','logger','[Preview][validateContact][Empty\x20Contact]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdNumber','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','addVariables','toLowerVariables','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','filterKey','keys','variable','addVariable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','ioredis','preview','../../../config/logger','actionPreview','./action','../dialer/utils','defaults','socket.io-emitter','redis','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncNewExten','syncVarSet','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','available','paused','message','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','CAMPAIGN_STATUS','DEACTIVATED','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','loggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','activeContact','actioncountonusuch','incrementPreviewCounters','swapAdditionalPhones','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','total','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','BUSY','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]'];(function(_0x133989,_0x1c254){var _0xcc6824=function(_0x3c8a0a){while(--_0x3c8a0a){_0x133989['push'](_0x133989['shift']());}};_0xcc6824(++_0x1c254);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x4b84[_0x2a238a];return _0xeef802;};'use strict';var util=require(_0x44b8('0x0'));var _=require(_0x44b8('0x1'));var uuid=require('uuid');var moment=require('moment');var Redis=require(_0x44b8('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x44b8('0x3'));var loggerAction=require(_0x44b8('0x4'))(_0x44b8('0x5'));var ami=require('../ami');var rpcDb=require('./rpcDb');var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x44b8('0x6'));var ut=require('./util/util');var utils=require(_0x44b8('0x7'));config['redis']=_[_0x44b8('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x44b8('0x9'))(new Redis(config[_0x44b8('0xa')]));var Sequence=function(){};Sequence[_0x44b8('0xb')]['enqueue']=function(_0xc650ec){this[_0x44b8('0xc')]=this[_0x44b8('0xc')]?this[_0x44b8('0xc')][_0x44b8('0xd')](_0xc650ec):_0xc650ec();};function Preview(_0x37e471){this[_0x44b8('0xe')]=new Sequence();this['campaignsPreview']=_0x37e471[_0x44b8('0xf')];this[_0x44b8('0x10')]=_0x37e471['trunks'];this[_0x44b8('0x11')]={};this['agents']=_0x37e471[_0x44b8('0x12')];this[_0x44b8('0x13')]=0x0;ami['on']('originateresponse',this[_0x44b8('0x14')]['bind'](this));ami['on']('hangup',this[_0x44b8('0x15')][_0x44b8('0x16')](this));ami['on'](_0x44b8('0x17'),this[_0x44b8('0x18')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0x44b8('0x16')](this));ami['on']('newexten',this[_0x44b8('0x19')][_0x44b8('0x16')](this));ami['on']('varset',this[_0x44b8('0x1a')][_0x44b8('0x16')](this));ami['on']('attendedtransfer',this[_0x44b8('0x1b')][_0x44b8('0x16')](this));ami['on']('blindtransfer',this[_0x44b8('0x1c')][_0x44b8('0x16')](this));this[_0x44b8('0x1d')](this[_0x44b8('0x1e')]);}function emit(_0x102ef9,_0x369c09,_0x452f2f){io['to'](_0x102ef9)[_0x44b8('0x1f')](_0x369c09,_0x452f2f);}function emitVoiceQueueChannelRemove(_0x429461){logger[_0x44b8('0x20')](_0x44b8('0x21'),JSON[_0x44b8('0x22')](_0x429461));emit(util['format'](_0x44b8('0x23'),_0x429461[_0x44b8('0x24')]),_0x44b8('0x25'),_0x429461);io[_0x44b8('0x1f')](_0x44b8('0x26'),_0x429461);}function notSendMessagesQueue(_0x51a34a){if(_0x51a34a[_0x44b8('0x27')]){if(_0x51a34a['originated']===0x0&&_0x51a34a[_0x44b8('0x28')]===0x0){_0x51a34a[_0x44b8('0x27')]=![];_0x51a34a[_0x44b8('0x29')]=0x0;_0x51a34a[_0x44b8('0x2a')]=0x0;_0x51a34a[_0x44b8('0x2b')]=utils['CAMPAIGN_STATUS'][_0x44b8('0x2c')];ut['logger'](_0x44b8('0x2d'),_0x51a34a[_0x44b8('0x24')]+'\x20is\x20not\x20active');}else{_0x51a34a[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x2f')];ut['logger'](_0x44b8('0x2d'),_0x51a34a[_0x44b8('0x24')]+'\x20is\x20deactivated');}}}Preview[_0x44b8('0xb')]['loopCampaigns']=function(){var _0xfb0028=this;setInterval(function(){_0xfb0028['syncCampaigns']();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x387293=this[_0x44b8('0x1e')];this[_0x44b8('0x13')]+=0x1;for(var _0x1bd1be in _0x387293){if(_0x387293[_0x44b8('0x30')](_0x1bd1be)&&(_0x387293[_0x1bd1be][_0x44b8('0x31')]===_0x44b8('0x3')||_0x387293[_0x1bd1be][_0x44b8('0x31')]===_0x44b8('0x32'))&&_0x387293[_0x1bd1be][_0x44b8('0x33')]===_0x44b8('0x34')){if(this[_0x44b8('0x13')]>0x7){this[_0x44b8('0x13')]=0x0;this['clearZombieChannels']();}}if(_0x387293[_0x44b8('0x30')](_0x1bd1be)&&_0x387293[_0x1bd1be]['dialMethod']===_0x44b8('0x3')&&_0x387293[_0x1bd1be][_0x44b8('0x33')]===_0x44b8('0x34')){if(_0x387293[_0x1bd1be][_0x44b8('0x35')]){this[_0x44b8('0x36')](_0x387293[_0x1bd1be]);if(_0x387293[_0x1bd1be]['dialPreviewAutoRecallMe'])this[_0x44b8('0x37')](_0x387293[_0x1bd1be]);}else{notSendMessagesQueue(_0x387293[_0x1bd1be]);}}}};Preview[_0x44b8('0xb')][_0x44b8('0x38')]=function(_0x339f0f){var _0x46b008=this;this['sequence'][_0x44b8('0x39')](function(){if(!_[_0x44b8('0x3a')](_0x46b008[_0x44b8('0x11')][_0x339f0f])){loggerAction[_0x44b8('0x20')](_0x44b8('0x3b'),_0x339f0f,_0x44b8('0x3c'),_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')],_0x44b8('0x3e'),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]][_0x44b8('0x3f')]),_0x44b8('0x40'),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]][_0x44b8('0x28')]),JSON[_0x44b8('0x22')](_0x46b008[_0x44b8('0x11')][_0x339f0f]['dialAnswer']),JSON[_0x44b8('0x22')](_[_0x44b8('0x41')](_0x46b008['actions'][_0x339f0f],[_0x44b8('0x42'),_0x44b8('0x43'),_0x44b8('0x44'),_0x44b8('0x45')])));return ami['Action']({'action':_0x44b8('0x46'),'channel':_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x47')]})[_0x44b8('0x48')](function(_0x9cb2a){if(_0x9cb2a[_0x44b8('0x2b')]===_0x44b8('0x49')){setTimeout(function(){if(_0x46b008[_0x44b8('0x11')][_0x339f0f]){ut[_0x44b8('0x4a')](_0x46b008[_0x44b8('0x1e')][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]],_0x44b8('0x4b'));if(_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x4c')]===!![]){ut[_0x44b8('0x4d')](_0x46b008['campaignsPreview'][_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]],_0x44b8('0x4b'));ut['loggerError'](_0x44b8('0x4e')+_0x339f0f,_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]);}ut['loggerError'](_0x44b8('0x4f')+_0x339f0f,_0x46b008[_0x44b8('0x11')][_0x339f0f][_0x44b8('0x3d')]);delete _0x46b008[_0x44b8('0x11')][_0x339f0f];}},0x2328);}});}});};Preview[_0x44b8('0xb')]['clearZombieChannels']=function(){var _0x5ae5f9=this;loggerAction[_0x44b8('0x20')](_0x44b8('0x50'),_[_0x44b8('0x51')](this[_0x44b8('0x11')]));for(var _0x43906b in this[_0x44b8('0x11')]){if(_0x5ae5f9[_0x44b8('0x11')][_0x44b8('0x30')](_0x43906b)){_0x5ae5f9[_0x44b8('0x38')](_0x43906b);}}};Preview[_0x44b8('0xb')][_0x44b8('0x37')]=function(_0x2a9b2a){var _0xc1b9de=this;rpcDb[_0x44b8('0x52')](_0x2a9b2a['id'],ut[_0x44b8('0x53')](this[_0x44b8('0x12')]))[_0x44b8('0x54')](function(_0x3b3d5d){if(!_[_0x44b8('0x3a')](_0x3b3d5d)){for(var _0x49c507=0x0;_0x49c507<_0x3b3d5d['length'];_0x49c507+=0x1){if(ut[_0x44b8('0x55')](_0x3b3d5d[_0x49c507][_0x44b8('0x56')])<_0x2a9b2a[_0x44b8('0x57')]*0x3c){if(_0x3b3d5d[_0x49c507][_0x44b8('0x58')]&&!_0x3b3d5d[_0x49c507][_0x44b8('0x58')][_0x44b8('0x59')]){_0xc1b9de[_0x44b8('0x5a')](_0x3b3d5d[_0x49c507]['id'])['then'](ut[_0x44b8('0x5b')]('[RecallMe]'))[_0x44b8('0x48')](ut[_0x44b8('0x5b')](_0x44b8('0x5c')));}else{rpcDb[_0x44b8('0x5d')](_0x3b3d5d[_0x49c507]['id']);}}else{var _0x103d57=new Action(_0x3b3d5d[_0x49c507],_0x2a9b2a);_0x103d57[_0x44b8('0x5e')]=moment()['format'](_0x44b8('0x5f'));_0x2a9b2a[_0x44b8('0x60')]+=0x1;ut[_0x44b8('0x61')](_0x103d57,0x17,_0x44b8('0x62'));if(_0x2a9b2a['dialRecallInQueue']){rpcDb[_0x44b8('0x63')](ut[_0x44b8('0x64')](_0x3b3d5d[_0x49c507]));rpcDb[_0x44b8('0x65')](_0x103d57,_0x44b8('0x66'));}else{ut[_0x44b8('0x61')](_0x103d57,0x16,_0x44b8('0x67'));rpcDb['createCustomerHistory'](_0x103d57,_0x44b8('0x68'));rpcDb[_0x44b8('0x69')](_0x103d57,_0x44b8('0x68'));}}}}})[_0x44b8('0x48')](ut[_0x44b8('0x5b')]('[getContactRecallMe]'));};Preview['prototype'][_0x44b8('0x36')]=function(_0x4eb344){_0x4eb344[_0x44b8('0x27')]=!![];if(ut['IsNotLoggedIn'](_0x4eb344[_0x44b8('0x6a')])){_0x4eb344[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x6b')];}else if(!ut[_0x44b8('0x6c')](_0x4eb344[_0x44b8('0x35')])){_0x4eb344[_0x44b8('0x2b')]=utils['CAMPAIGN_STATUS'][_0x44b8('0x2c')];}else if(!this[_0x44b8('0x6d')](_0x4eb344[_0x44b8('0x6e')])){if(!this['isTrunkReachable'](_0x4eb344[_0x44b8('0x6f')])){_0x4eb344[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x70')];}else{_0x4eb344['message']=utils[_0x44b8('0x2e')][_0x44b8('0x71')];}}else{_0x4eb344['message']=utils[_0x44b8('0x2e')][_0x44b8('0x71')];}};Preview[_0x44b8('0xb')][_0x44b8('0x72')]=function(_0xe86e34,_0x546a50,_0x5b99a3){var _0xc181d2=this;var _0x3154bc=this[_0x44b8('0x11')][_0x546a50];var _0x4358aa=this[_0x44b8('0x1e')][_0x3154bc[_0x44b8('0x3d')]];var _0x3c9534;var _0xf0fb0d=![];var _0x10bbd9=0x2;var _0xdff81b=0x3;if(_0x4358aa){switch(_0x5b99a3){case'1':_0x4358aa[_0x44b8('0x73')]+=0x1;_0x3154bc[_0x44b8('0x74')]+=0x1;_0x3154bc['countglobal']=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x0,_0x44b8('0x76'));ami[_0x44b8('0x1f')](_0x44b8('0x77'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x79')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0x7a'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'0',_0x4358aa)[_0x44b8('0x54')](function(_0x15bcba){_0xf0fb0d=_0x15bcba[_0x44b8('0x7c')]==0x1;_0x10bbd9=_0x4358aa[_0x44b8('0x7d')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,'Global');rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0x81'));}else{if(_0x3154bc[_0x44b8('0x74')]>=_0x4358aa[_0x44b8('0x82')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0x81'));}else{rpcDb[_0x44b8('0x83')](ut['scheduledAt'](_0x3154bc,_0x44b8('0x74'),_0x4358aa[_0x44b8('0x7d')]),_0x3154bc['unlockAgent'],_0x3154bc[_0x44b8('0x84')]);}}delete this[_0x44b8('0x11')][_0xe86e34['linkedid']];}else{_0x3154bc[_0x44b8('0x74')]++;logger[_0x44b8('0x20')](_0x44b8('0x85'),_0x3154bc['countnosuchnumberretry']);logger[_0x44b8('0x20')]('id',_0x3154bc['idContact']);_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnosuchnumberretry':_0x3154bc[_0x44b8('0x74')]}})[_0x44b8('0x54')](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case _0x44b8('0x88'):var _0x230b6a=moment()['format'](_0x44b8('0x5f'));_0x3154bc['responsetime']=_0x230b6a;_0x3154bc[_0x44b8('0x89')]=_0x230b6a;_0x3154bc[_0x44b8('0x4c')]=!![];_0x4358aa['pTalking']+=0x1;logger[_0x44b8('0x20')](_0x44b8('0x8a'),_0x3154bc[_0x44b8('0x8b')],_0x44b8('0x8c'),_0x4358aa[_0x44b8('0x24')],_0x44b8('0x40'),_0x4358aa[_0x44b8('0x28')]);ami[_0x44b8('0x1f')](_0x44b8('0x8d'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x8e'),this[_0x44b8('0x1e')][_0x3154bc['queue']]));if(_0x4358aa[_0x44b8('0x8f')]){ami[_0x44b8('0x1f')](_0x44b8('0x90'),ut['buildAcw'](_0x3154bc));}break;case'16':ami[_0x44b8('0x1f')](_0x44b8('0x91'),ut['buildObj'](_0x3154bc,_0x44b8('0x92'),this[_0x44b8('0x1e')][_0x3154bc[_0x44b8('0x3d')]]));emitVoiceQueueChannelRemove(ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0x92')));_0x4358aa['outboundAnswerCallsDay']+=0x1;_0x4358aa[_0x44b8('0x93')]+=0x1;_0x4358aa[_0x44b8('0x94')]+=0x1;ut[_0x44b8('0x4d')](_0x4358aa,_0x44b8('0x95'));_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x4,_0x44b8('0x97'));rpcDb['createCustomerHistory'](_0x3154bc,_0x44b8('0x98'));rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0x99'));rpcDb[_0x44b8('0x9a')](_0x3154bc);_0x4358aa['sumDuration']+=_0x3154bc['talktime'];_0x4358aa['sumBillable']+=_0x3154bc[_0x44b8('0x9b')];logger[_0x44b8('0x20')](_0x44b8('0x9c'),_0x3154bc[_0x44b8('0x8b')],_0x44b8('0x8c'),_0x4358aa['name'],_0x44b8('0x40'),_0x4358aa['pTalking']);delete this[_0x44b8('0x11')][_0xe86e34[_0x44b8('0x9d')]];break;case _0x44b8('0x9e'):_0x4358aa['outboundBusyCallsDay']+=0x1;_0x3154bc['countbusyretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x5,'Busy');_0x10bbd9=_0x4358aa[_0x44b8('0x9f')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xa0'),ut[_0x44b8('0x78')](_0x3154bc,'busy'));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xa1'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'5',_0x4358aa)[_0x44b8('0x54')](function(_0x220f1b){_0xf0fb0d=_0x220f1b['additional']==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xa3'));}else{if(_0x3154bc[_0x44b8('0xa4')]>=_0x4358aa['dialBusyMaxRetry']){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xa1'));}else{rpcDb['rescheduleContact'](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xa4'),_0x4358aa['dialBusyRetryFrequency']),_0x3154bc[_0x44b8('0xa6')],_0x3154bc['activeContact']);}}}else{_0x3154bc['countbusyretry']++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countbusyretry':_0x3154bc[_0x44b8('0xa4')]}})['then'](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case _0x44b8('0xa8'):_0x4358aa[_0x44b8('0xa9')]+=0x1;_0x3154bc[_0x44b8('0xaa')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x3,_0x44b8('0xab'));_0x10bbd9=_0x4358aa[_0x44b8('0xac')];_0xdff81b=_0x4358aa['callAdditionalPhoneAfterMin'];var _0x388c4c=ut['buildNoAnswerEventPayload'](_0x3154bc,_0x4358aa);ami['emit']('custom:agentnoanswer',_0x388c4c);rpcDb[_0x44b8('0x65')](_0x3154bc,'[callProgressDetectingCustomer][logNoAnswer]');_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'3',_0x4358aa)[_0x44b8('0x54')](function(_0x268e1e){_0xf0fb0d=_0x268e1e[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb['createCustomerFinal'](_0x3c9534,_0x44b8('0xad'));}else{if(_0x3154bc[_0x44b8('0xaa')]>=_0x4358aa[_0x44b8('0xae')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xaf'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xaa'),_0x4358aa[_0x44b8('0xac')]),_0x3154bc['unlockAgent'],_0x3154bc['activeContact']);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2['incrementPreviewCounters']({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case'CONGESTION':_0x4358aa[_0x44b8('0xb0')]+=0x1;_0x3154bc['countcongestionretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x8,_0x44b8('0xb1'));_0x10bbd9=_0x4358aa[_0x44b8('0xb2')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xb3'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xb4')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xb5'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'8',_0x4358aa)[_0x44b8('0x54')](function(_0x5de033){_0xf0fb0d=_0x5de033[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xb6'));}else{if(_0x3154bc[_0x44b8('0xb7')]>=_0x4358aa[_0x44b8('0xb8')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xb5'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,'countcongestionretry',_0x4358aa[_0x44b8('0x9f')]),_0x3154bc[_0x44b8('0xa6')],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc['countcongestionretry']++;_0xc181d2['incrementPreviewCounters']({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countcongestionretry':_0x3154bc[_0x44b8('0xb7')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case _0x44b8('0xb9'):_0x4358aa[_0x44b8('0xba')]+=0x1;_0x3154bc[_0x44b8('0xbb')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x14,_0x44b8('0xbc'));_0x10bbd9=_0x4358aa['dialAgentRejectRetryFrequency'];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];ami[_0x44b8('0x1f')](_0x44b8('0xbd'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xbe')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xbf'));_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'20',_0x4358aa)['then'](function(_0x478f17){_0xf0fb0d=_0x478f17[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0x14,_0x44b8('0xbc'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xc0'));}else{if(_0x3154bc[_0x44b8('0xbb')]>=_0x4358aa[_0x44b8('0xc1')]){rpcDb['createCustomerFinal'](_0x3154bc,_0x44b8('0xc0'));}else{rpcDb[_0x44b8('0x83')](ut['scheduledAt'](_0x3154bc,'countagentrejectretry',_0x4358aa[_0x44b8('0xc2')]),_0x3154bc['unlockAgent'],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});break;case'ABANDONED':_0x4358aa[_0x44b8('0xc3')]+=0x1;_0x3154bc['countabandonedretry']+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0xb,_0x44b8('0xc4'));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xc5'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'11',_0x4358aa)['then'](function(_0x4d3b82){_0xf0fb0d=_0x4d3b82['additional']==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xc5'));}else{if(_0x3154bc[_0x44b8('0xc6')]>=_0x4358aa[_0x44b8('0xc7')]){rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xc5'));}else{rpcDb[_0x44b8('0x83')](ut[_0x44b8('0xa5')](_0x3154bc,_0x44b8('0xc8'),_0x4358aa[_0x44b8('0xc9')]),_0x3154bc[_0x44b8('0xa6')],_0x3154bc[_0x44b8('0x84')]);}}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc['idContact'],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})['then'](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)['then'](function(){});});}});break;case'18':_0x4358aa['outboundUnknownCallsDay']+=0x1;_0x3154bc[_0x44b8('0xca')]+=0x1;_0x3154bc['countglobal']=ut['totalGlobal'](_0x3154bc);ut['logCustomer'](_0x3154bc,0x12,_0xe86e34['cause-txt']||_0xe86e34['dialstatus']);ami[_0x44b8('0x1f')](_0x44b8('0xcb'),ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xcc')));rpcDb['createCustomerHistory'](_0x3154bc,_0x44b8('0xcd'));_0xc181d2[_0x44b8('0x7b')](_0x3154bc,'18',_0x4358aa)['then'](function(_0x572e5c){_0xf0fb0d=_0x572e5c[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut['cloneAction'](_0x3154bc,0x12,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xcd'));}else{rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xcd'));}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})['then'](function(){_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});delete this['actions'][_0xe86e34[_0x44b8('0x9d')]];break;case'19':_0x4358aa[_0x44b8('0xce')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut['totalGlobal'](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0x13,_0xe86e34['cause-txt']||_0xe86e34[_0x44b8('0xcf')]);ami[_0x44b8('0x1f')]('custom:amd',ut[_0x44b8('0x78')](_0x3154bc,_0x44b8('0xcc')));rpcDb[_0x44b8('0x65')](_0x3154bc,_0x44b8('0xd0'));_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'18',_0x4358aa)[_0x44b8('0x54')](function(_0xf73cde){_0xf0fb0d=_0xf73cde[_0x44b8('0x7c')]==0x1;if(!_0xf0fb0d){if(ut[_0x44b8('0x75')](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xd0'));}else{rpcDb['createCustomerFinal'](_0x3154bc,'[callProgressDetectingCustomer][machine]');}}else{_0x3154bc[_0x44b8('0xaa')]++;_0xc181d2[_0x44b8('0x86')]({'id':_0x3154bc[_0x44b8('0xa7')],'field':{'countnoanswerretry':_0x3154bc[_0x44b8('0xaa')]}})[_0x44b8('0x54')](function(){_0xc181d2['swapAdditionalPhones'](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});});}});delete this['actions'][_0xe86e34[_0x44b8('0x9d')]];break;default:if(_0x3154bc['dialAnswer']){ut[_0x44b8('0x4d')](_0x4358aa,_0x44b8('0xd1'));ut[_0x44b8('0xd2')](_0x44b8('0xd3')+_0x4358aa[_0x44b8('0x24')],_0xe86e34);}_0x4358aa[_0x44b8('0xce')]+=0x1;_0x3154bc[_0x44b8('0x96')]=ut[_0x44b8('0x75')](_0x3154bc);ut[_0x44b8('0x61')](_0x3154bc,0xc,_0xe86e34['cause-txt']||_0xe86e34[_0x44b8('0xcf')]);_0x10bbd9=_0x4358aa[_0x44b8('0xc2')];_0xdff81b=_0x4358aa[_0x44b8('0x7e')];rpcDb[_0x44b8('0x65')](_0x3154bc,'[callProgressDetectingCustomer][logUnknown]');_0xc181d2['verifyAdditionalPhones'](_0x3154bc,'20',_0x4358aa)['then'](function(_0xf5e39){_0xf0fb0d=_0xf5e39['additional']==0x1;if(!_0xf0fb0d){if(ut['totalGlobal'](_0x3154bc)>=_0x4358aa[_0x44b8('0x7f')]){_0x3c9534=ut[_0x44b8('0x80')](_0x3154bc,0xf,_0x44b8('0xa2'));rpcDb[_0x44b8('0x69')](_0x3c9534,_0x44b8('0xd4'));}else{rpcDb[_0x44b8('0x69')](_0x3154bc,_0x44b8('0xd4'));}delete this[_0x44b8('0x11')][_0xe86e34['linkedid']];}else{_0xc181d2[_0x44b8('0x87')](_0x3154bc,_0x10bbd9,_0xdff81b)[_0x44b8('0x54')](function(){});}});}if(!(_0x3154bc[_0x44b8('0x4c')]&&_0x5b99a3==='16')){ut[_0x44b8('0x4a')](_0x4358aa,'[callProgressDetectingCustomer]');logger[_0x44b8('0x20')](_0x44b8('0xd5'),_0x3154bc[_0x44b8('0x8b')],'\x20Queue',_0x4358aa['name'],_0x44b8('0x3e'),_0x4358aa[_0x44b8('0x3f')]);}if(_0x5b99a3!==_0x44b8('0x88')){delete this[_0x44b8('0x11')][_0xe86e34[_0x44b8('0x9d')]];delete this['actions'][_0xe86e34[_0x44b8('0xd6')]];}_0x4358aa[_0x44b8('0xd7')]=!![];}};Preview['prototype'][_0x44b8('0xd8')]=function(_0x13942e,_0xcb4c9b,_0x237f67){if(_['isUndefined'](_0xcb4c9b)&&_0x44b8('0xd9')!==typeof _0xcb4c9b){return;}if(_['isUndefined'](_0x237f67)&&_0x44b8('0xd9')!==typeof _0x237f67){return;}switch(_0x237f67[_0x44b8('0xda')]){case'0':ut[_0x44b8('0xdb')](_0x13942e,0x0,_0x44b8('0x76'));rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xdd'));break;case'3':ut[_0x44b8('0xdb')](_0x13942e,0x3,_0x44b8('0xab'));rpcDb['createAgentHistory'](_0x13942e,_0x44b8('0xde'));break;case'5':ut[_0x44b8('0xdb')](_0x13942e,0x5,_0x44b8('0xdf'));rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe0'));break;case'8':ut[_0x44b8('0xdb')](_0x13942e,0x8,'Congestion');rpcDb['createAgentHistory'](_0x13942e,_0x44b8('0xe1'));break;case'22':ut[_0x44b8('0xdb')](_0x13942e,0x16,'AnswerAGI');rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe2'));break;default:ut['logAgent'](_0x13942e,0xc,_0x237f67[_0x44b8('0xda')]);rpcDb[_0x44b8('0xdc')](_0x13942e,_0x44b8('0xe1'));}ut[_0x44b8('0x4a')](_0xcb4c9b,_0x44b8('0xe3'));logger[_0x44b8('0x20')](_0x44b8('0xe4'),_0x13942e[_0x44b8('0x8b')],_0x44b8('0x8c'),_0xcb4c9b[_0x44b8('0x24')],_0x44b8('0x3e'),_0xcb4c9b[_0x44b8('0x3f')]);delete this[_0x44b8('0x11')][_0x13942e[_0x44b8('0x8b')]];};Preview[_0x44b8('0xb')]['verifyAdditionalPhones']=function(_0x30fca,_0x3d92a9,_0x13ab7b){return cmHopperAdditionalPhone[_0x44b8('0x7b')](_0x30fca,_0x3d92a9,_0x13ab7b)['catch'](logger[_0x44b8('0x20')](_0x44b8('0xe5')));};Preview['prototype'][_0x44b8('0x87')]=function(_0x4b9731,_0x1cd645,_0x3fee20){return cmHopperAdditionalPhone[_0x44b8('0x87')](_0x4b9731,_0x1cd645,_0x3fee20)[_0x44b8('0x48')](logger['info']('[swapAdditionalPhone]\x20'));};Preview[_0x44b8('0xb')][_0x44b8('0x86')]=function(_0x5a2a9f){return Promise['resolve']()['then'](cmHopperAdditionalPhone[_0x44b8('0x86')](_0x5a2a9f))[_0x44b8('0x48')](logger[_0x44b8('0x20')]('[incrementPreviewCounters]\x20'));};Preview['prototype'][_0x44b8('0xe6')]=function(_0x289fbd,_0x12f78b,_0x24a6a6,_0x2f5451,_0xc54e64){var _0x100295=this;return new Promise(function(_0x287902,_0x2675e9){if(_['isNil'](_0x12f78b)||_[_0x44b8('0x3a')](_0x12f78b['Contact'])||_[_0x44b8('0x3a')](_0x12f78b['phone'])||_['isNil'](_0x12f78b[_0x44b8('0x44')])){_0x2675e9(ut[_0x44b8('0x2b')](_0x44b8('0xe7'),_0x2f5451,_0xc54e64));return;}var _0x13c741=uuid['v4']();var _0x2eec38=_0x100295[_0x44b8('0x1e')][_0x12f78b[_0x44b8('0x3c')][_0x44b8('0x24')]];var _0x17b749=_0x24a6a6?_0x100295['agents'][_0x24a6a6]['id']:undefined;_0x100295[_0x44b8('0x11')][_0x13c741]=new Action(_0x12f78b,_0x2eec38,_0x13c741,_0x24a6a6,_0x17b749);var _0x1e3b5f=_0x100295[_0x44b8('0x11')][_0x13c741];_0x1e3b5f['unlockAgent']=_0x2f5451;_0x1e3b5f['activeContact']=_0xc54e64;_0x1e3b5f[_0x44b8('0xe8')]=_0x24a6a6;if(_['isEmpty'](_0x289fbd)){_0x100295[_0x44b8('0xe9')](_0x1e3b5f,_0x2eec38,_0x12f78b,_0x24a6a6)['then'](function(_0x1ae0bb){logger['info']('[Preview][execCall][success]',_0x44b8('0xea')+_0x1e3b5f[_0x44b8('0x3d')]+'\x20IdHopper:\x20'+_0x1e3b5f[_0x44b8('0xa7')],JSON[_0x44b8('0x22')](_0x1ae0bb));ami[_0x44b8('0x1f')](_0x44b8('0xeb'),ut[_0x44b8('0x78')](_0x1e3b5f,'called',_0x100295[_0x44b8('0x1e')][_0x1e3b5f['queue']]));_0x287902(ut['message']('Calling'));})[_0x44b8('0x48')](function(_0x2818ec){ut['logger'](_0x44b8('0xec'),_0x2818ec);_0x2675e9(ut[_0x44b8('0x2b')]('Call\x20failed',_0x2f5451,_0xc54e64));});}else{_0x2eec38['outboundBlacklistCallsDay']+=0x1;ut[_0x44b8('0xed')](_0x1e3b5f);rpcDb[_0x44b8('0xee')](_0x1e3b5f,'[Blacklist][error]');delete _0x100295[_0x44b8('0x11')][_0x13c741];_0x2675e9(ut[_0x44b8('0x2b')]('Contact\x20in\x20black\x20List',_0x2f5451,_0xc54e64));}});};Preview[_0x44b8('0xb')][_0x44b8('0x6d')]=function(_0x5ce5ed){return!_[_0x44b8('0x3a')](_0x5ce5ed)&&!_[_0x44b8('0x3a')](_0x5ce5ed[_0x44b8('0x24')])&&!_['isNil'](_0x5ce5ed[_0x44b8('0xef')])&&_0x5ce5ed['active']&&!_[_0x44b8('0x3a')](this['trunks'][util['format'](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])])&&!_[_0x44b8('0x3a')](this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])][_0x44b8('0x46')])&&(this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed['name'])][_0x44b8('0x46')]===_0x44b8('0xf2')||this[_0x44b8('0x10')][util[_0x44b8('0xf1')](_0x44b8('0xf0'),_0x5ce5ed[_0x44b8('0x24')])][_0x44b8('0x46')]===_0x44b8('0xf3'));};Preview['prototype'][_0x44b8('0x5a')]=function(_0x3f33a9,_0x561645){return this[_0x44b8('0xf4')](_0x3f33a9,_0x561645)[_0x44b8('0x54')](function(_0x2a40a3){return _['pick'](_0x2a40a3,['message']);})[_0x44b8('0x48')](function(_0x133da8){if(_0x133da8['unlock']){rpcDb['unlockContact'](_0x3f33a9);}if(_0x133da8[_0x44b8('0xef')]){rpcDb[_0x44b8('0x5d')](_0x3f33a9);}throw _[_0x44b8('0x41')](_0x133da8,[_0x44b8('0x2b')]);});};Preview[_0x44b8('0xb')]['execRun']=function(_0x2ded38,_0x4fbf1d){var _0x444f66=this;var _0x1386c6,_0x36537c;return rpcDb[_0x44b8('0xf5')](_0x2ded38)[_0x44b8('0x54')](function(_0x180c33){if(!_['isNil'](_0x180c33[0x0])){_0x36537c=_0x180c33[0x0][_0x44b8('0xf6')]?![]:!![];_0x1386c6=_0x180c33[0x0]['recallme']?!![]:![];_0x1386c6=_0x4fbf1d?!![]:_0x1386c6;}var _0x2c3e11=_0x444f66[_0x44b8('0xf7')](_0x180c33);if(_0x2c3e11['isValid']){rpcDb[_0x44b8('0xf8')](_['pick'](_0x180c33[0x0],[_0x44b8('0x44'),_0x44b8('0xf9')]))[_0x44b8('0x54')](function(_0x4b0aa0){_0x444f66[_0x44b8('0xe6')](_0x4b0aa0,_0x180c33[0x0],_0x4fbf1d,_0x36537c,_0x1386c6)[_0x44b8('0x54')](function(_0x4ff63e){return _0x4ff63e;})[_0x44b8('0x48')](function(_0x5af83d){throw _0x5af83d;});})['catch'](function(_0x4220b5){ut['logger'](_0x44b8('0xfa'),_0x4220b5);throw ut['message'](_0x44b8('0xfb'),_0x36537c,_0x1386c6);});}else{throw ut[_0x44b8('0x2b')](_0x2c3e11['message'],_0x36537c,_0x1386c6);}})[_0x44b8('0x48')](function(_0x39507e){ut['logger']('[Preview][getContactPreview]',_0x39507e);throw ut[_0x44b8('0x2b')](_0x44b8('0xfb'),![],!![]);});};Preview[_0x44b8('0xb')][_0x44b8('0xf7')]=function(_0x596fa4){if(_[_0x44b8('0x3a')](_0x596fa4)||_[_0x44b8('0xfc')](_0x596fa4)||!_[_0x44b8('0x3a')](_0x596fa4[0x0][_0x44b8('0x58')])&&_['isNil'](_0x596fa4[0x0]['Agent'][_0x44b8('0x24')])){ut[_0x44b8('0xfd')](_0x44b8('0xfe'),_0x596fa4);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1443bd=this[_0x44b8('0x1e')][_0x596fa4[0x0]['Queue'][_0x44b8('0x24')]];_0x1443bd[_0x44b8('0x2b')]=utils[_0x44b8('0x2e')][_0x44b8('0x71')];if(_[_0x44b8('0x3a')](_0x1443bd)){ut[_0x44b8('0xfd')]('[Preview][validateContact][Empty\x20Campaign]',_0x1443bd);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x44b8('0x6d')](_0x1443bd['Trunk'])){ut[_0x44b8('0xfd')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x44b8('0xff')+_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x100'));if(!this[_0x44b8('0x6d')](_0x1443bd[_0x44b8('0x6f')])){ut[_0x44b8('0xfd')](_0x44b8('0x101'),_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x102'));return{'isValid':![],'message':_0x44b8('0x103')};}}if(!ut[_0x44b8('0x6c')](_0x1443bd[_0x44b8('0x35')])){ut[_0x44b8('0xfd')](_0x44b8('0x104'),_0x1443bd[_0x44b8('0x24')]+_0x44b8('0x105'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1443bd[_0x44b8('0x24')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x44b8('0x106')};};Preview[_0x44b8('0xb')][_0x44b8('0xe9')]=function(_0x10fd21,_0x420a61,_0x22e5ae,_0x2f3340){var _0x4d98de=this;return new Promise(function(_0x597139,_0x2fffd5){var _0x3c90c2=_0x10fd21[_0x44b8('0x8b')];var _0x43c7ac=_0x4d98de[_0x44b8('0x6d')](_0x420a61['Trunk'])?util[_0x44b8('0xf1')](_0x44b8('0x107'),_0x420a61[_0x44b8('0x6e')][_0x44b8('0x24')],_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x108')])?'':_0x420a61['dialPrefix'][_0x44b8('0x109')]()||'',_0x420a61[_0x44b8('0x10a')]>0x0?_0x22e5ae[_0x44b8('0xf9')][_0x44b8('0x10b')](_0x420a61[_0x44b8('0x10a')]):_0x22e5ae['phone']):util['format'](_0x44b8('0x107'),_[_0x44b8('0x3a')](_0x420a61['TrunkBackup'])?_0x420a61['Trunk'][_0x44b8('0x24')]:_0x420a61['TrunkBackup'][_0x44b8('0x24')],_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x108')])?'':_0x420a61[_0x44b8('0x108')][_0x44b8('0x109')]()||'',_0x420a61[_0x44b8('0x10a')]>0x0?_0x22e5ae[_0x44b8('0xf9')][_0x44b8('0x10b')](_0x420a61['dialCutDigit']):_0x22e5ae[_0x44b8('0xf9')]);var _0xf24cdd=_0x4d98de[_0x44b8('0x6d')](_0x420a61['Trunk'])?ut[_0x44b8('0x10c')](_0x420a61[_0x44b8('0x6e')]['callerid'],_0x420a61['dialOriginateCallerIdName'],_0x420a61['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x420a61[_0x44b8('0x10d')],_0x420a61['dialRandomLastDigitCallerIdNumber']):_0x420a61['dialOriginateCallerIdNumber']):ut[_0x44b8('0x10c')](_[_0x44b8('0x3a')](_0x420a61[_0x44b8('0x6f')])?_0x420a61['Trunk'][_0x44b8('0x10e')]:_0x420a61['TrunkBackup'][_0x44b8('0x10e')],_0x420a61[_0x44b8('0x10f')],_0x420a61[_0x44b8('0x110')]>0x0?ut[_0x44b8('0x111')](_0x420a61['dialOriginateCallerIdNumber'],_0x420a61[_0x44b8('0x110')]):_0x420a61[_0x44b8('0x10d')]);if(_0xf24cdd){_0x10fd21[_0x44b8('0x112')]=ut[_0x44b8('0x113')](_0xf24cdd);_0x10fd21['originatecalleridnum']=ut['extractCalleridNumber'](_0xf24cdd);}var _0x35a564=ut[_0x44b8('0x114')](_0x420a61,_0x22e5ae,_0x43c7ac,_0xf24cdd,_0x3c90c2,_0x10fd21);_['merge'](_0x10fd21,ut[_0x44b8('0x115')](_0x35a564));_0x10fd21[_0x44b8('0x5e')]=moment()[_0x44b8('0xf1')](_0x44b8('0x5f'));_0x420a61[_0x44b8('0x116')]=_0x35a564;var _0x2da727=ut[_0x44b8('0x117')](_0x10fd21,_0x420a61,_0x35a564,_0x10fd21[_0x44b8('0x84')],_0x2f3340);return ami['Action'](_0x2da727)[_0x44b8('0x54')](function(_0x3e5fa8){_0x420a61[_0x44b8('0x3f')]+=0x1;logger['info'](_0x44b8('0x118'),_0x3c90c2,'\x20Queue',_0x420a61[_0x44b8('0x24')],'originated:\x20',_0x420a61[_0x44b8('0x3f')]);_0x597139(_0x3e5fa8);})[_0x44b8('0x48')](function(_0x1f5c08){ut[_0x44b8('0xdb')](_0x10fd21,0xe,_0x44b8('0x119'));rpcDb[_0x44b8('0xdc')](_0x10fd21,_0x44b8('0x11a'));_0x2fffd5(_0x1f5c08);});});};Preview[_0x44b8('0xb')][_0x44b8('0x19')]=function(_0x31913d){if(this[_0x44b8('0x11')][_0x31913d[_0x44b8('0x9d')]]){this['actions'][_0x31913d[_0x44b8('0x9d')]]['channel']=_0x31913d[_0x44b8('0x47')];}};Preview['prototype'][_0x44b8('0x14')]=function(_0x31132c){var _0xdfc44b=this;var _0x2c8438=this[_0x44b8('0x11')][_0x31132c[_0x44b8('0x11b')]];if(_0x2c8438){if(_0x2c8438[_0x44b8('0xe8')]&&this['agents'][_0x2c8438[_0x44b8('0xe8')]]){ut[_0x44b8('0x11c')](_0x2c8438,this[_0x44b8('0x12')][_0x2c8438[_0x44b8('0xe8')]][_0x44b8('0x24')],this[_0x44b8('0x12')][_0x2c8438[_0x44b8('0xe8')]]['id']);}var _0x46cdee=_[_0x44b8('0x11d')](_0x2c8438);_0x46cdee[_0x44b8('0x11e')]=moment()[_0x44b8('0xf1')](_0x44b8('0x5f'));var _0xbbc40d=_0xdfc44b[_0x44b8('0x1e')][_0x2c8438['queue']];if(ut[_0x44b8('0x11f')](_0x31132c[_0x44b8('0x120')])){if(_0x2c8438['unlockAgent']){rpcDb[_0x44b8('0x121')](_0x2c8438[_0x44b8('0xa7')]);}if(_0x2c8438[_0x44b8('0x84')]){rpcDb[_0x44b8('0x5d')](_0x2c8438[_0x44b8('0xa7')]);}ami['emit'](_0x44b8('0x122'),ut[_0x44b8('0x78')](_0x2c8438,_0x44b8('0x123'),this[_0x44b8('0x1e')][_0x2c8438['queue']]));this[_0x44b8('0xd8')](_0x46cdee,_0xbbc40d,_0x31132c);}else{_0x2c8438[_0x44b8('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x46cdee,0x4,'Answer');rpcDb[_0x44b8('0xdc')](_0x46cdee,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x44b8('0x15')]=function(_0xb5c212){var _0x87a38=this['actions'][_0xb5c212[_0x44b8('0x9d')]];var _0x32dafb;if(_0x87a38){_0x32dafb=this[_0x44b8('0x1e')][_0x87a38[_0x44b8('0x3d')]];logger['info'](_0x44b8('0x124'),_0xb5c212['linkedid'],_0x44b8('0x8c'),_0x32dafb[_0x44b8('0x24')],'pTalking:\x20',_0x32dafb[_0x44b8('0x28')]);}if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]]&&_0xb5c212[_0x44b8('0x9d')]!==_0xb5c212[_0x44b8('0x8b')]){if(_0xb5c212['cause']==='16'&&this['actions'][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}else if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x126'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')],'\x20Queue',_0x32dafb['name'],_0x44b8('0x40'),_0x32dafb['pTalking']);this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}}else if(_0x87a38&&_['isNil'](_0x87a38[_0x44b8('0x127')])&&_0x32dafb[_0x44b8('0x128')]&&_0xb5c212[_0x44b8('0x9d')]===_0xb5c212[_0x44b8('0x8b')]&&_[_0x44b8('0x3a')](_0xb5c212[_0x44b8('0xda')])&&_0xb5c212['cause']==='16'&&_0xb5c212[_0x44b8('0x129')]==='6'&&_[_0x44b8('0x12a')](_0x87a38['transfer'])){if(_0x87a38[_0x44b8('0xa6')]){rpcDb[_0x44b8('0x121')](_0x87a38[_0x44b8('0xa7')]);}if(_0x87a38[_0x44b8('0x84')]){rpcDb[_0x44b8('0x5d')](_0x87a38['idContact']);}_0xb5c212[_0x44b8('0xda')]='22';this[_0x44b8('0xd8')](_0x87a38,_0x32dafb,_0xb5c212);}else if(_0x87a38&&_0x87a38[_0x44b8('0x12b')]){if(_0xb5c212[_0x44b8('0x125')]==='16'&&this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x12c'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212['cause'],_0x44b8('0x8c'),_0x32dafb[_0x44b8('0x24')],_0x44b8('0x40'),_0x32dafb['pTalking']);this['callProgressDetectingCustomer'](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212['cause']);}else if(this[_0x44b8('0x11')][_0xb5c212[_0x44b8('0x9d')]][_0x44b8('0x4c')]){logger[_0x44b8('0x20')](_0x44b8('0x126'),_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')],'\x20Queue',_0x32dafb['name'],_0x44b8('0x40'),_0x32dafb[_0x44b8('0x28')]);this[_0x44b8('0x72')](_0xb5c212,_0xb5c212[_0x44b8('0x9d')],_0xb5c212[_0x44b8('0x125')]);}}};Preview[_0x44b8('0xb')]['syncDialEnd']=function(_0x4d88a6){if(this[_0x44b8('0x11')][_0x4d88a6[_0x44b8('0xd6')]]&&_0x4d88a6[_0x44b8('0xd6')]!==_0x4d88a6[_0x44b8('0x12d')]){this[_0x44b8('0x72')](_0x4d88a6,_0x4d88a6[_0x44b8('0xd6')],_0x4d88a6[_0x44b8('0xcf')]);}};Preview['prototype'][_0x44b8('0x18')]=function(_0x1f6244){if(this[_0x44b8('0x11')][_0x1f6244['linkedid']]&&_0x1f6244[_0x44b8('0x9d')]!==_0x1f6244[_0x44b8('0x8b')]&&!this[_0x44b8('0x11')][_0x1f6244[_0x44b8('0x9d')]]['dialAnswer']){if(_0x1f6244[_0x44b8('0x125')]==='1'){this[_0x44b8('0x72')](_0x1f6244,_0x1f6244[_0x44b8('0x9d')],_0x1f6244['cause']);}}};Preview['prototype']['addVariable']=function(_0x4b3c64,_0x59a43a,_0x355c5c){if(this[_0x44b8('0x11')][_0x4b3c64]){if(_[_0x44b8('0x3a')](this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')])){this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')]={};}this[_0x44b8('0x11')][_0x4b3c64][_0x44b8('0x116')][_0x59a43a]=_0x355c5c;}};Preview[_0x44b8('0xb')][_0x44b8('0x1a')]=function(_0x56aecf){try{if(!_[_0x44b8('0x3a')](_0x56aecf)){if(ut[_0x44b8('0x12e')](_[_0x44b8('0x12f')](_0x56aecf[_0x44b8('0x130')])[0x0])){this[_0x44b8('0x131')](_0x56aecf['uniqueid'],_[_0x44b8('0x12f')](_0x56aecf['variable'])[0x0],_0x56aecf[_0x44b8('0x132')]);}}}catch(_0x3432da){logger[_0x44b8('0x133')]('[syncVarSet][Preview]',util[_0x44b8('0x134')](_0x3432da,{'showHidden':![],'depth':null}));}};Preview[_0x44b8('0xb')]['syncAttendedTransfer']=function(_0xc8e8f4){if(_0xc8e8f4){if(this[_0x44b8('0x11')][_0xc8e8f4[_0x44b8('0x135')]]){this['actions'][_0xc8e8f4[_0x44b8('0x135')]]['transfer']=!![];}}};Preview[_0x44b8('0xb')][_0x44b8('0x1c')]=function(_0x280fe1){if(_0x280fe1){if(this['actions'][_0x280fe1[_0x44b8('0x136')]]){this['actions'][_0x280fe1[_0x44b8('0x136')]][_0x44b8('0x12b')]=!![];}}};module[_0x44b8('0x137')]=Preview;
\ No newline at end of file
+var _0x3e74=['unmonitored','run','execRun','unlock','unlockContact','getContactPreview','isValid','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','Trunk\x20not\x20working\x20correctly','dialActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','starttime','variables','variablesAction','Action','[originated][increment]','OriginateError','syncNewExten','actionid','logLookAgent','YYYY-MM-DD\x20HH:mm:ss','response','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destlinkedid','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','util','uuid','moment','ioredis','preview','actionPreview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','../dialer/utils','redis','defaults','localhost','tail','sequence','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','voice:queue:%s','name','sendMessageOneNotActive','originated','paused','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','message','DEACTIVATED','prototype','syncCampaigns','hasOwnProperty','dialMethod','type','outbound','clearZombieChannels','recallMe','clearZombieChannel','queue','pTalking:\x20','pTalking','dialAnswer','pick','contactId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','Agent','voicePause','[RecallMe]','disableContact','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','logger2','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','Trunk','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','decrementTalkink','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','BUSY','Busy','dialBusyRetryFrequency','busy','additional','Global','dialBusyMaxRetry','countbusyretry','incrementPreviewCounters','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','queueSummaryCountersUpdated','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Queue','agents','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable'];(function(_0x42df9d,_0x8050b9){var _0x1cf222=function(_0x2c0ecb){while(--_0x2c0ecb){_0x42df9d['push'](_0x42df9d['shift']());}};_0x1cf222(++_0x8050b9);}(_0x3e74,0x175));var _0x43e7=function(_0x183bd3,_0x3eb79f){_0x183bd3=_0x183bd3-0x0;var _0x3678e8=_0x3e74[_0x183bd3];return _0x3678e8;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var uuid=require(_0x43e7('0x1'));var moment=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x43e7('0x4'));var loggerAction=require('../../../config/logger')(_0x43e7('0x5'));var ami=require(_0x43e7('0x6'));var rpcDb=require(_0x43e7('0x7'));var cmHopperAdditionalPhone=require(_0x43e7('0x8'));var Action=require(_0x43e7('0x9'));var ut=require('./util/util');var utils=require(_0x43e7('0xa'));config[_0x43e7('0xb')]=_[_0x43e7('0xc')](config[_0x43e7('0xb')],{'host':_0x43e7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x39c8bd){this[_0x43e7('0xe')]=this['tail']?this[_0x43e7('0xe')]['finally'](_0x39c8bd):_0x39c8bd();};function Preview(_0xf7c520){this[_0x43e7('0xf')]=new Sequence();this['campaignsPreview']=_0xf7c520[_0x43e7('0x10')];this[_0x43e7('0x11')]=_0xf7c520[_0x43e7('0x11')];this[_0x43e7('0x12')]={};this['agents']=_0xf7c520['agents'];this[_0x43e7('0x13')]=0x0;ami['on'](_0x43e7('0x14'),this[_0x43e7('0x15')]['bind'](this));ami['on']('hangup',this[_0x43e7('0x16')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x18'),this[_0x43e7('0x19')]['bind'](this));ami['on']('dialend',this[_0x43e7('0x1a')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x43e7('0x1c'),this[_0x43e7('0x1d')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1e'),this[_0x43e7('0x1f')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x20'),this[_0x43e7('0x21')][_0x43e7('0x17')](this));this[_0x43e7('0x22')](this[_0x43e7('0x23')]);}function emit(_0x177ee1,_0x4b5d64,_0xef1a5a){io['to'](_0x177ee1)[_0x43e7('0x24')](_0x4b5d64,_0xef1a5a);}function emitVoiceQueueChannelRemove(_0x4b386b){logger[_0x43e7('0x25')](_0x43e7('0x26'),JSON[_0x43e7('0x27')](_0x4b386b));emit(util[_0x43e7('0x28')](_0x43e7('0x29'),_0x4b386b[_0x43e7('0x2a')]),'voice_queue_channel:remove',_0x4b386b);io[_0x43e7('0x24')]('voice_queue_presence:remove',_0x4b386b);}function notSendMessagesQueue(_0x4c9df3){if(_0x4c9df3[_0x43e7('0x2b')]){if(_0x4c9df3[_0x43e7('0x2c')]===0x0&&_0x4c9df3['pTalking']===0x0){_0x4c9df3[_0x43e7('0x2b')]=![];_0x4c9df3['available']=0x0;_0x4c9df3[_0x43e7('0x2d')]=0x0;_0x4c9df3['message']=utils[_0x43e7('0x2e')][_0x43e7('0x2f')];ut[_0x43e7('0x30')](_0x43e7('0x31'),_0x4c9df3['name']+'\x20is\x20not\x20active');}else{_0x4c9df3[_0x43e7('0x32')]=utils['CAMPAIGN_STATUS'][_0x43e7('0x33')];ut[_0x43e7('0x30')](_0x43e7('0x31'),_0x4c9df3[_0x43e7('0x2a')]+'\x20is\x20deactivated');}}}Preview[_0x43e7('0x34')][_0x43e7('0x22')]=function(){var _0x45b675=this;setInterval(function(){_0x45b675[_0x43e7('0x35')]();},0x7cf);};Preview[_0x43e7('0x34')][_0x43e7('0x35')]=function(){var _0x2b85a5=this[_0x43e7('0x23')];this[_0x43e7('0x13')]+=0x1;for(var _0x35dbcd in _0x2b85a5){if(_0x2b85a5[_0x43e7('0x36')](_0x35dbcd)&&(_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]===_0x43e7('0x4')||_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]==='booked')&&_0x2b85a5[_0x35dbcd][_0x43e7('0x38')]===_0x43e7('0x39')){if(this[_0x43e7('0x13')]>0x7){this[_0x43e7('0x13')]=0x0;this[_0x43e7('0x3a')]();}}if(_0x2b85a5['hasOwnProperty'](_0x35dbcd)&&_0x2b85a5[_0x35dbcd][_0x43e7('0x37')]===_0x43e7('0x4')&&_0x2b85a5[_0x35dbcd][_0x43e7('0x38')]===_0x43e7('0x39')){if(_0x2b85a5[_0x35dbcd]['dialActive']){this['setMessage'](_0x2b85a5[_0x35dbcd]);if(_0x2b85a5[_0x35dbcd]['dialPreviewAutoRecallMe'])this[_0x43e7('0x3b')](_0x2b85a5[_0x35dbcd]);}else{notSendMessagesQueue(_0x2b85a5[_0x35dbcd]);}}}};Preview[_0x43e7('0x34')][_0x43e7('0x3c')]=function(_0x234fe6){var _0x108313=this;this[_0x43e7('0xf')]['enqueue'](function(){if(!_['isNil'](_0x108313['actions'][_0x234fe6])){loggerAction['info']('[clearZombieChannels][talking]',_0x234fe6,'Queue',_0x108313['actions'][_0x234fe6][_0x43e7('0x3d')],'originated:\x20',JSON[_0x43e7('0x27')](_0x108313[_0x43e7('0x23')][_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x3d')]][_0x43e7('0x2c')]),_0x43e7('0x3e'),JSON[_0x43e7('0x27')](_0x108313['campaignsPreview'][_0x108313['actions'][_0x234fe6]['queue']][_0x43e7('0x3f')]),JSON[_0x43e7('0x27')](_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x40')]),JSON[_0x43e7('0x27')](_[_0x43e7('0x41')](_0x108313[_0x43e7('0x12')][_0x234fe6],[_0x43e7('0x42'),'UserId',_0x43e7('0x43'),_0x43e7('0x44')])));return ami['Action']({'action':_0x43e7('0x45'),'channel':_0x108313['actions'][_0x234fe6][_0x43e7('0x46')]})[_0x43e7('0x47')](function(_0x1c6f45){if(_0x1c6f45[_0x43e7('0x32')]===_0x43e7('0x48')){setTimeout(function(){if(_0x108313[_0x43e7('0x12')][_0x234fe6]){ut['updateOriginated'](_0x108313['campaignsPreview'][_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x3d')]],_0x43e7('0x49'));if(_0x108313[_0x43e7('0x12')][_0x234fe6][_0x43e7('0x40')]===!![]){ut['decrementTalkink'](_0x108313[_0x43e7('0x23')][_0x108313[_0x43e7('0x12')][_0x234fe6]['queue']],_0x43e7('0x49'));ut['loggerError'](_0x43e7('0x4a')+_0x234fe6,_0x108313['actions'][_0x234fe6][_0x43e7('0x3d')]);}ut[_0x43e7('0x4b')](_0x43e7('0x4c')+_0x234fe6,_0x108313[_0x43e7('0x12')][_0x234fe6]['queue']);delete _0x108313['actions'][_0x234fe6];}},0x2328);}});}});};Preview[_0x43e7('0x34')][_0x43e7('0x3a')]=function(){var _0xe979b5=this;loggerAction[_0x43e7('0x25')]('[action]',_['size'](this['actions']));for(var _0x35e4fb in this['actions']){if(_0xe979b5[_0x43e7('0x12')]['hasOwnProperty'](_0x35e4fb)){_0xe979b5['clearZombieChannel'](_0x35e4fb);}}};Preview[_0x43e7('0x34')]['recallMe']=function(_0x2de14f){var _0x39db7f=this;rpcDb[_0x43e7('0x4d')](_0x2de14f['id'],ut[_0x43e7('0x4e')](this['agents']))[_0x43e7('0x4f')](function(_0x2b9046){if(!_[_0x43e7('0x50')](_0x2b9046)){for(var _0x1fd277=0x0;_0x1fd277<_0x2b9046[_0x43e7('0x51')];_0x1fd277+=0x1){if(ut[_0x43e7('0x52')](_0x2b9046[_0x1fd277]['scheduledat'])<_0x2de14f['dialRecallMeTimeout']*0x3c){if(_0x2b9046[_0x1fd277][_0x43e7('0x53')]&&!_0x2b9046[_0x1fd277][_0x43e7('0x53')][_0x43e7('0x54')]){_0x39db7f['run'](_0x2b9046[_0x1fd277]['id'])['then'](ut['logger2'](_0x43e7('0x55')))[_0x43e7('0x47')](ut['logger2'](_0x43e7('0x55')));}else{rpcDb[_0x43e7('0x56')](_0x2b9046[_0x1fd277]['id']);}}else{var _0x3c96fe=new Action(_0x2b9046[_0x1fd277],_0x2de14f);_0x3c96fe['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2de14f['outboundReCallsDay']+=0x1;ut[_0x43e7('0x57')](_0x3c96fe,0x17,_0x43e7('0x58'));if(_0x2de14f['dialRecallInQueue']){rpcDb[_0x43e7('0x59')](ut[_0x43e7('0x5a')](_0x2b9046[_0x1fd277]));rpcDb[_0x43e7('0x5b')](_0x3c96fe,_0x43e7('0x5c'));}else{ut['logCustomer'](_0x3c96fe,0x16,_0x43e7('0x5d'));rpcDb['createCustomerHistory'](_0x3c96fe,'[HistoryRecallClose]');rpcDb[_0x43e7('0x5e')](_0x3c96fe,_0x43e7('0x5f'));}}}}})[_0x43e7('0x47')](ut[_0x43e7('0x60')](_0x43e7('0x61')));};Preview[_0x43e7('0x34')][_0x43e7('0x62')]=function(_0x256ddd){_0x256ddd[_0x43e7('0x2b')]=!![];if(ut[_0x43e7('0x63')](_0x256ddd['loggedIn'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')]['NO_AGENTS_LOGGED'];}else if(!ut[_0x43e7('0x64')](_0x256ddd['dialActive'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x2f')];}else if(!this[_0x43e7('0x65')](_0x256ddd[_0x43e7('0x66')])){if(!this['isTrunkReachable'](_0x256ddd['TrunkBackup'])){_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x67')];}else{_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];}}else{_0x256ddd[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];}};Preview[_0x43e7('0x34')][_0x43e7('0x69')]=function(_0x4ace49,_0x1ec35a,_0x2da2f3){var _0x50a3fa=this;var _0x4314d8=this[_0x43e7('0x12')][_0x1ec35a];var _0x2d0052=this['campaignsPreview'][_0x4314d8['queue']];var _0x459c13;var _0x3d9a29=![];var _0x4ebdde=0x2;var _0x283dd8=0x3;if(_0x2d0052){switch(_0x2da2f3){case'1':_0x2d0052['outboundNoSuchCallsDay']+=0x1;_0x4314d8['countnosuchnumberretry']+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x0,_0x43e7('0x6c'));ami[_0x43e7('0x24')]('custom:agentnosuchnumber',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x6e')));rpcDb['createCustomerHistory'](_0x4314d8,_0x43e7('0x6f'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'0',_0x2d0052)[_0x43e7('0x4f')](function(_0x5bb536){_0x3d9a29=_0x5bb536['additional']==0x1;_0x4ebdde=_0x2d0052['dialNoSuchNumberRetryFrequency'];_0x283dd8=_0x2d0052[_0x43e7('0x71')];if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,'Global');rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0x74'));}else{if(_0x4314d8[_0x43e7('0x75')]>=_0x2d0052[_0x43e7('0x76')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0x75'),_0x2d0052[_0x43e7('0x79')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];}else{_0x4314d8[_0x43e7('0x75')]++;logger[_0x43e7('0x25')](_0x43e7('0x7d'),_0x4314d8['countnosuchnumberretry']);logger['info']('id',_0x4314d8[_0x43e7('0x7e')]);_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8['idContact'],'field':{'countnosuchnumberretry':_0x4314d8['countnosuchnumberretry']}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)['then'](function(){});});}});break;case _0x43e7('0x80'):var _0x135791=moment()[_0x43e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x4314d8[_0x43e7('0x81')]=_0x135791;_0x4314d8[_0x43e7('0x82')]=_0x135791;_0x4314d8[_0x43e7('0x40')]=!![];_0x2d0052[_0x43e7('0x3f')]+=0x1;logger[_0x43e7('0x25')](_0x43e7('0x83'),_0x4314d8[_0x43e7('0x84')],'\x20Queue',_0x2d0052[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x2d0052[_0x43e7('0x3f')]);ami['emit']('custom:agentconnect',ut[_0x43e7('0x6d')](_0x4314d8,'connect',this['campaignsPreview'][_0x4314d8[_0x43e7('0x3d')]]));if(_0x2d0052[_0x43e7('0x85')]){ami['emit'](_0x43e7('0x86'),ut[_0x43e7('0x87')](_0x4314d8));}break;case'16':ami[_0x43e7('0x24')](_0x43e7('0x88'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x89'),this[_0x43e7('0x23')][_0x4314d8['queue']]));emitVoiceQueueChannelRemove(ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x89')));_0x2d0052['outboundAnswerCallsDay']+=0x1;_0x2d0052[_0x43e7('0x8a')]+=0x1;_0x2d0052['answered']+=0x1;ut[_0x43e7('0x8b')](_0x2d0052,_0x43e7('0x8c'));_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x4,_0x43e7('0x8d'));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0x8e'));rpcDb['createCustomerFinal'](_0x4314d8,_0x43e7('0x8f'));rpcDb[_0x43e7('0x90')](_0x4314d8);_0x2d0052[_0x43e7('0x91')]+=_0x4314d8[_0x43e7('0x92')];_0x2d0052[_0x43e7('0x93')]+=_0x4314d8['talktime'];logger[_0x43e7('0x25')](_0x43e7('0x94'),_0x4314d8[_0x43e7('0x84')],_0x43e7('0x95'),_0x2d0052[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x2d0052[_0x43e7('0x3f')]);delete this['actions'][_0x4ace49['linkedid']];break;case _0x43e7('0x96'):_0x2d0052['outboundBusyCallsDay']+=0x1;_0x4314d8['countbusyretry']+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x5,_0x43e7('0x97'));_0x4ebdde=_0x2d0052[_0x43e7('0x98')];_0x283dd8=_0x2d0052[_0x43e7('0x71')];ami[_0x43e7('0x24')]('custom:agentbusy',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0x99')));rpcDb[_0x43e7('0x5b')](_0x4314d8,'[callProgressDetectingCustomer][logBusy]');_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'5',_0x2d0052)[_0x43e7('0x4f')](function(_0x184ae3){_0x3d9a29=_0x184ae3[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb['createCustomerFinal'](_0x459c13,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x4314d8['countbusyretry']>=_0x2d0052[_0x43e7('0x9c')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0x9d'),_0x2d0052[_0x43e7('0x98')]),_0x4314d8['unlockAgent'],_0x4314d8['activeContact']);}}}else{_0x4314d8['countbusyretry']++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countbusyretry':_0x4314d8['countbusyretry']}})['then'](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0x9f'):_0x2d0052['outboundNoAnswerCallsDay']+=0x1;_0x4314d8[_0x43e7('0xa0')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x3,'NoAnswer');_0x4ebdde=_0x2d0052[_0x43e7('0xa1')];_0x283dd8=_0x2d0052['callAdditionalPhoneAfterMin'];var _0xa66309=ut[_0x43e7('0xa2')](_0x4314d8,_0x2d0052);ami[_0x43e7('0x24')](_0x43e7('0xa3'),_0xa66309);rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xa4'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'3',_0x2d0052)['then'](function(_0x109c86){_0x3d9a29=_0x109c86[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut['cloneAction'](_0x4314d8,0xf,'Global');rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0xa5'));}else{if(_0x4314d8['countnoanswerretry']>=_0x2d0052[_0x43e7('0xa6')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xa4'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xa0'),_0x2d0052[_0x43e7('0xa1')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8['idContact'],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0xa7'):_0x2d0052['outboundCongestionCallsDay']+=0x1;_0x4314d8['countcongestionretry']+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x8,_0x43e7('0xa8'));_0x4ebdde=_0x2d0052[_0x43e7('0xa9')];_0x283dd8=_0x2d0052['callAdditionalPhoneAfterMin'];ami['emit'](_0x43e7('0xaa'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xab')));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xac'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'8',_0x2d0052)['then'](function(_0x403276){_0x3d9a29=_0x403276[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut['cloneAction'](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xad'));}else{if(_0x4314d8[_0x43e7('0xae')]>=_0x2d0052['dialCongestionMaxRetry']){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xac'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xae'),_0x2d0052['dialBusyRetryFrequency']),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8['countcongestionretry']++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countcongestionretry':_0x4314d8[_0x43e7('0xae')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case'CANCEL':_0x2d0052[_0x43e7('0xaf')]+=0x1;_0x4314d8[_0x43e7('0xb0')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x14,_0x43e7('0xb1'));_0x4ebdde=_0x2d0052[_0x43e7('0xb2')];_0x283dd8=_0x2d0052[_0x43e7('0x71')];ami[_0x43e7('0x24')]('custom:agentreject',ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xb3')));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xb4'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'20',_0x2d0052)['then'](function(_0x2c5bf9){_0x3d9a29=_0x2c5bf9[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x459c13,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4314d8[_0x43e7('0xb0')]>=_0x2d0052['dialAgentRejectMaxRetry']){rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xb5'));}else{rpcDb[_0x43e7('0x77')](ut[_0x43e7('0x78')](_0x4314d8,_0x43e7('0xb0'),_0x2d0052['dialAgentRejectRetryFrequency']),_0x4314d8['unlockAgent'],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case _0x43e7('0xb6'):_0x2d0052[_0x43e7('0xb7')]+=0x1;_0x4314d8[_0x43e7('0xb8')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0xb,_0x43e7('0xb9'));rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xba'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'11',_0x2d0052)[_0x43e7('0x4f')](function(_0x3286b1){_0x3d9a29=_0x3286b1[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052[_0x43e7('0x72')]){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb['createCustomerFinal'](_0x459c13,_0x43e7('0xba'));}else{if(_0x4314d8[_0x43e7('0xbb')]>=_0x2d0052[_0x43e7('0xbc')]){rpcDb[_0x43e7('0x5e')](_0x4314d8,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x43e7('0x77')](ut['scheduledAt'](_0x4314d8,_0x43e7('0xb8'),_0x2d0052[_0x43e7('0xbd')]),_0x4314d8[_0x43e7('0x7a')],_0x4314d8[_0x43e7('0x7b')]);}}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8['idContact'],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});break;case'18':_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8['countmachineretry']+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut['logCustomer'](_0x4314d8,0x12,_0x4ace49[_0x43e7('0xbf')]||_0x4ace49[_0x43e7('0xc0')]);ami[_0x43e7('0x24')](_0x43e7('0xc1'),ut['buildObj'](_0x4314d8,'amd'));rpcDb['createCustomerHistory'](_0x4314d8,_0x43e7('0xc2'));_0x50a3fa['verifyAdditionalPhones'](_0x4314d8,'18',_0x2d0052)['then'](function(_0x4d7f0f){_0x3d9a29=_0x4d7f0f[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0x12,'Global');rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc2'));}else{rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xc2'));}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa['incrementPreviewCounters']({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)['then'](function(){});});}});delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];break;case'19':_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8[_0x43e7('0x6a')]=ut['totalGlobal'](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0x13,_0x4ace49[_0x43e7('0xbf')]||_0x4ace49[_0x43e7('0xc0')]);ami['emit'](_0x43e7('0xc1'),ut[_0x43e7('0x6d')](_0x4314d8,_0x43e7('0xc3')));rpcDb[_0x43e7('0x5b')](_0x4314d8,'[callProgressDetectingCustomer][machine]');_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'18',_0x2d0052)['then'](function(_0x299086){_0x3d9a29=_0x299086[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut['totalGlobal'](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc4'));}else{rpcDb[_0x43e7('0x5e')](_0x4314d8,_0x43e7('0xc4'));}}else{_0x4314d8[_0x43e7('0xa0')]++;_0x50a3fa[_0x43e7('0x9e')]({'id':_0x4314d8[_0x43e7('0x7e')],'field':{'countnoanswerretry':_0x4314d8[_0x43e7('0xa0')]}})[_0x43e7('0x4f')](function(){_0x50a3fa['swapAdditionalPhones'](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});});}});delete this['actions'][_0x4ace49[_0x43e7('0x7c')]];break;default:if(_0x4314d8[_0x43e7('0x40')]){ut[_0x43e7('0x8b')](_0x2d0052,'[default]');ut[_0x43e7('0x4b')](_0x43e7('0xc5')+_0x2d0052[_0x43e7('0x2a')],_0x4ace49);}_0x2d0052[_0x43e7('0xbe')]+=0x1;_0x4314d8['countglobal']=ut[_0x43e7('0x6b')](_0x4314d8);ut[_0x43e7('0x57')](_0x4314d8,0xc,_0x4ace49['cause-txt']||_0x4ace49['dialstatus']);_0x4ebdde=_0x2d0052['dialAgentRejectRetryFrequency'];_0x283dd8=_0x2d0052[_0x43e7('0x71')];rpcDb[_0x43e7('0x5b')](_0x4314d8,_0x43e7('0xc6'));_0x50a3fa[_0x43e7('0x70')](_0x4314d8,'20',_0x2d0052)[_0x43e7('0x4f')](function(_0x40019e){_0x3d9a29=_0x40019e[_0x43e7('0x9a')]==0x1;if(!_0x3d9a29){if(ut[_0x43e7('0x6b')](_0x4314d8)>=_0x2d0052['dialGlobalMaxRetry']){_0x459c13=ut[_0x43e7('0x73')](_0x4314d8,0xf,_0x43e7('0x9b'));rpcDb[_0x43e7('0x5e')](_0x459c13,_0x43e7('0xc7'));}else{rpcDb['createCustomerFinal'](_0x4314d8,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];}else{_0x50a3fa[_0x43e7('0x7f')](_0x4314d8,_0x4ebdde,_0x283dd8)[_0x43e7('0x4f')](function(){});}});}if(!(_0x4314d8['dialAnswer']&&_0x2da2f3==='16')){ut[_0x43e7('0xc8')](_0x2d0052,_0x43e7('0xc9'));logger[_0x43e7('0x25')](_0x43e7('0xca'),_0x4314d8[_0x43e7('0x84')],_0x43e7('0x95'),_0x2d0052['name'],_0x43e7('0xcb'),_0x2d0052['originated']);}if(_0x2da2f3!=='ANSWER'){delete this[_0x43e7('0x12')][_0x4ace49[_0x43e7('0x7c')]];delete this['actions'][_0x4ace49['destlinkedid']];}_0x2d0052[_0x43e7('0xcc')]=!![];}};Preview[_0x43e7('0x34')]['callProgressDetectingAgent']=function(_0x189c38,_0x156a3c,_0x302138){if(_[_0x43e7('0xcd')](_0x156a3c)&&'object'!==typeof _0x156a3c){return;}if(_['isUndefined'](_0x302138)&&_0x43e7('0xce')!==typeof _0x302138){return;}switch(_0x302138[_0x43e7('0xcf')]){case'0':ut[_0x43e7('0xd0')](_0x189c38,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x189c38,_0x43e7('0xd1'));break;case'3':ut[_0x43e7('0xd0')](_0x189c38,0x3,_0x43e7('0xd2'));rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd4'));break;case'5':ut[_0x43e7('0xd0')](_0x189c38,0x5,_0x43e7('0x97'));rpcDb[_0x43e7('0xd3')](_0x189c38,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x189c38,0x8,'Congestion');rpcDb[_0x43e7('0xd3')](_0x189c38,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x43e7('0xd0')](_0x189c38,0x16,_0x43e7('0xd5'));rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd6'));break;default:ut[_0x43e7('0xd0')](_0x189c38,0xc,_0x302138['reason']);rpcDb[_0x43e7('0xd3')](_0x189c38,_0x43e7('0xd7'));}ut[_0x43e7('0xc8')](_0x156a3c,_0x43e7('0xd8'));logger['info'](_0x43e7('0xd9'),_0x189c38[_0x43e7('0x84')],_0x43e7('0x95'),_0x156a3c[_0x43e7('0x2a')],_0x43e7('0xcb'),_0x156a3c[_0x43e7('0x2c')]);delete this[_0x43e7('0x12')][_0x189c38['uniqueid']];};Preview[_0x43e7('0x34')][_0x43e7('0x70')]=function(_0x20fab2,_0x3637d9,_0x3c52d3){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x20fab2,_0x3637d9,_0x3c52d3)[_0x43e7('0x47')](logger[_0x43e7('0x25')]('[verifyAdditionalPhone]\x20'));};Preview[_0x43e7('0x34')][_0x43e7('0x7f')]=function(_0x577ac6,_0x235418,_0x368c57){return cmHopperAdditionalPhone[_0x43e7('0x7f')](_0x577ac6,_0x235418,_0x368c57)[_0x43e7('0x47')](logger[_0x43e7('0x25')]('[swapAdditionalPhone]\x20'));};Preview[_0x43e7('0x34')][_0x43e7('0x9e')]=function(_0x1e5d48){return Promise['resolve']()[_0x43e7('0x4f')](cmHopperAdditionalPhone[_0x43e7('0x9e')](_0x1e5d48))['catch'](logger[_0x43e7('0x25')](_0x43e7('0xda')));};Preview[_0x43e7('0x34')][_0x43e7('0xdb')]=function(_0x15b04a,_0x3b5f39,_0x4d5736,_0xcbdb35,_0xa5981f){var _0x19ddfa=this;return new Promise(function(_0x4a4031,_0x5a7f2e){if(_[_0x43e7('0x50')](_0x3b5f39)||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0xdc')])||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0xdd')])||_[_0x43e7('0x50')](_0x3b5f39[_0x43e7('0x43')])){_0x5a7f2e(ut[_0x43e7('0x32')]('Contact\x20is\x20undefined',_0xcbdb35,_0xa5981f));return;}var _0x723c7=uuid['v4']();var _0xfbdb90=_0x19ddfa[_0x43e7('0x23')][_0x3b5f39[_0x43e7('0xde')][_0x43e7('0x2a')]];var _0x114e00=_0x4d5736?_0x19ddfa[_0x43e7('0xdf')][_0x4d5736]['id']:undefined;_0x19ddfa[_0x43e7('0x12')][_0x723c7]=new Action(_0x3b5f39,_0xfbdb90,_0x723c7,_0x4d5736,_0x114e00);var _0x51e17c=_0x19ddfa[_0x43e7('0x12')][_0x723c7];_0x51e17c[_0x43e7('0x7a')]=_0xcbdb35;_0x51e17c[_0x43e7('0x7b')]=_0xa5981f;_0x51e17c[_0x43e7('0xe0')]=_0x4d5736;if(_[_0x43e7('0xe1')](_0x15b04a)){_0x19ddfa['execCall'](_0x51e17c,_0xfbdb90,_0x3b5f39,_0x4d5736)[_0x43e7('0x4f')](function(_0x186e57){logger[_0x43e7('0x25')](_0x43e7('0xe2'),_0x43e7('0xe3')+_0x51e17c['queue']+_0x43e7('0xe4')+_0x51e17c['idContact'],JSON[_0x43e7('0x27')](_0x186e57));ami[_0x43e7('0x24')](_0x43e7('0xe5'),ut[_0x43e7('0x6d')](_0x51e17c,'called',_0x19ddfa[_0x43e7('0x23')][_0x51e17c[_0x43e7('0x3d')]]));_0x4a4031(ut[_0x43e7('0x32')](_0x43e7('0xe6')));})[_0x43e7('0x47')](function(_0x27bbd6){ut[_0x43e7('0x30')](_0x43e7('0xe7'),_0x27bbd6);_0x5a7f2e(ut[_0x43e7('0x32')](_0x43e7('0xe8'),_0xcbdb35,_0xa5981f));});}else{_0xfbdb90[_0x43e7('0xe9')]+=0x1;ut['logBlacklist'](_0x51e17c);rpcDb['createHistory'](_0x51e17c,_0x43e7('0xea'));delete _0x19ddfa['actions'][_0x723c7];_0x5a7f2e(ut['message'](_0x43e7('0xeb'),_0xcbdb35,_0xa5981f));}});};Preview[_0x43e7('0x34')]['isTrunkReachable']=function(_0x143be2){return!_['isNil'](_0x143be2)&&!_['isNil'](_0x143be2['name'])&&!_[_0x43e7('0x50')](_0x143be2[_0x43e7('0xec')])&&_0x143be2[_0x43e7('0xec')]&&!_[_0x43e7('0x50')](this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])])&&!_[_0x43e7('0x50')](this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])][_0x43e7('0x45')])&&(this[_0x43e7('0x11')][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2[_0x43e7('0x2a')])][_0x43e7('0x45')]===_0x43e7('0xee')||this['trunks'][util[_0x43e7('0x28')](_0x43e7('0xed'),_0x143be2['name'])][_0x43e7('0x45')]===_0x43e7('0xef'));};Preview[_0x43e7('0x34')][_0x43e7('0xf0')]=function(_0x49441c,_0x31797a){return this[_0x43e7('0xf1')](_0x49441c,_0x31797a)['then'](function(_0x43500a){return _[_0x43e7('0x41')](_0x43500a,[_0x43e7('0x32')]);})['catch'](function(_0x22b824){if(_0x22b824[_0x43e7('0xf2')]){rpcDb[_0x43e7('0xf3')](_0x49441c);}if(_0x22b824[_0x43e7('0xec')]){rpcDb[_0x43e7('0x56')](_0x49441c);}throw _['pick'](_0x22b824,[_0x43e7('0x32')]);});};Preview[_0x43e7('0x34')]['execRun']=function(_0x1d31f5,_0x47b03b){var _0x4bf8ad=this;var _0x55baca,_0x5486a6;return rpcDb[_0x43e7('0xf4')](_0x1d31f5)[_0x43e7('0x4f')](function(_0x7f518f){if(!_[_0x43e7('0x50')](_0x7f518f[0x0])){_0x5486a6=_0x7f518f[0x0]['recallme']?![]:!![];_0x55baca=_0x7f518f[0x0]['recallme']?!![]:![];_0x55baca=_0x47b03b?!![]:_0x55baca;}var _0x267b26=_0x4bf8ad['validateContact'](_0x7f518f);if(_0x267b26[_0x43e7('0xf5')]){rpcDb['checkIsBlackList'](_[_0x43e7('0x41')](_0x7f518f[0x0],['VoiceQueueId','phone']))['then'](function(_0x5653b0){_0x4bf8ad[_0x43e7('0xdb')](_0x5653b0,_0x7f518f[0x0],_0x47b03b,_0x5486a6,_0x55baca)[_0x43e7('0x4f')](function(_0x574658){return _0x574658;})['catch'](function(_0x466aa7){throw _0x466aa7;});})[_0x43e7('0x47')](function(_0x517289){ut['logger'](_0x43e7('0xf6'),_0x517289);throw ut[_0x43e7('0x32')](_0x43e7('0xf7'),_0x5486a6,_0x55baca);});}else{throw ut[_0x43e7('0x32')](_0x267b26['message'],_0x5486a6,_0x55baca);}})[_0x43e7('0x47')](function(_0x536b7d){ut[_0x43e7('0x30')](_0x43e7('0xf8'),_0x536b7d);throw ut[_0x43e7('0x32')](_0x43e7('0xf7'),![],!![]);});};Preview[_0x43e7('0x34')][_0x43e7('0xf9')]=function(_0x2cbbda){if(_['isNil'](_0x2cbbda)||_[_0x43e7('0xe1')](_0x2cbbda)||!_[_0x43e7('0x50')](_0x2cbbda[0x0]['Agent'])&&_[_0x43e7('0x50')](_0x2cbbda[0x0][_0x43e7('0x53')][_0x43e7('0x2a')])){ut[_0x43e7('0x30')](_0x43e7('0xfa'),_0x2cbbda);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x3fd573=this['campaignsPreview'][_0x2cbbda[0x0][_0x43e7('0xde')]['name']];_0x3fd573[_0x43e7('0x32')]=utils[_0x43e7('0x2e')][_0x43e7('0x68')];if(_[_0x43e7('0x50')](_0x3fd573)){ut[_0x43e7('0x30')]('[Preview][validateContact][Empty\x20Campaign]',_0x3fd573);return{'isValid':![],'message':_0x43e7('0xfb')};}if(!this['isTrunkReachable'](_0x3fd573[_0x43e7('0x66')])){ut[_0x43e7('0x30')](_0x43e7('0xfc'),'campaign\x20Name:\x20'+_0x3fd573[_0x43e7('0x2a')]+_0x43e7('0xfd'));if(!this[_0x43e7('0x65')](_0x3fd573[_0x43e7('0xfe')])){ut[_0x43e7('0x30')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x3fd573[_0x43e7('0x2a')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x43e7('0xff')};}}if(!ut[_0x43e7('0x64')](_0x3fd573[_0x43e7('0x100')])){ut[_0x43e7('0x30')](_0x43e7('0x101'),_0x3fd573[_0x43e7('0x2a')]+_0x43e7('0x102'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x3fd573[_0x43e7('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x43e7('0x103')};};Preview[_0x43e7('0x34')][_0x43e7('0x104')]=function(_0xbc6e18,_0x16c757,_0xf9178f,_0x3bb7ab){var _0x2be8c7=this;return new Promise(function(_0x2bb14d,_0x57f7ea){var _0x240478=_0xbc6e18['uniqueid'];var _0x2b7b33=_0x2be8c7[_0x43e7('0x65')](_0x16c757['Trunk'])?util[_0x43e7('0x28')](_0x43e7('0x105'),_0x16c757['Trunk'][_0x43e7('0x2a')],_[_0x43e7('0x50')](_0x16c757[_0x43e7('0x106')])?'':_0x16c757[_0x43e7('0x106')][_0x43e7('0x107')]()||'',_0x16c757[_0x43e7('0x108')]>0x0?_0xf9178f[_0x43e7('0xdd')][_0x43e7('0x109')](_0x16c757['dialCutDigit']):_0xf9178f[_0x43e7('0xdd')]):util[_0x43e7('0x28')](_0x43e7('0x105'),_['isNil'](_0x16c757[_0x43e7('0xfe')])?_0x16c757[_0x43e7('0x66')]['name']:_0x16c757[_0x43e7('0xfe')][_0x43e7('0x2a')],_['isNil'](_0x16c757[_0x43e7('0x106')])?'':_0x16c757[_0x43e7('0x106')][_0x43e7('0x107')]()||'',_0x16c757['dialCutDigit']>0x0?_0xf9178f[_0x43e7('0xdd')][_0x43e7('0x109')](_0x16c757['dialCutDigit']):_0xf9178f[_0x43e7('0xdd')]);var _0x2ed5e0=_0x2be8c7[_0x43e7('0x65')](_0x16c757[_0x43e7('0x66')])?ut['getCallerId'](_0x16c757['Trunk'][_0x43e7('0x10a')],_0x16c757[_0x43e7('0x10b')],_0x16c757[_0x43e7('0x10c')]>0x0?ut[_0x43e7('0x10d')](_0x16c757['dialOriginateCallerIdNumber'],_0x16c757[_0x43e7('0x10c')]):_0x16c757[_0x43e7('0x10e')]):ut[_0x43e7('0x10f')](_[_0x43e7('0x50')](_0x16c757['TrunkBackup'])?_0x16c757[_0x43e7('0x66')][_0x43e7('0x10a')]:_0x16c757[_0x43e7('0xfe')][_0x43e7('0x10a')],_0x16c757[_0x43e7('0x10b')],_0x16c757['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x16c757['dialOriginateCallerIdNumber'],_0x16c757[_0x43e7('0x10c')]):_0x16c757[_0x43e7('0x10e')]);if(_0x2ed5e0){_0xbc6e18[_0x43e7('0x110')]=ut['extractCalleridName'](_0x2ed5e0);_0xbc6e18[_0x43e7('0x111')]=ut['extractCalleridNumber'](_0x2ed5e0);}var _0x1c7f6a=ut[_0x43e7('0x112')](_0x16c757,_0xf9178f,_0x2b7b33,_0x2ed5e0,_0x240478,_0xbc6e18);_[_0x43e7('0x113')](_0xbc6e18,ut[_0x43e7('0x114')](_0x1c7f6a));_0xbc6e18[_0x43e7('0x115')]=moment()[_0x43e7('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x16c757[_0x43e7('0x116')]=_0x1c7f6a;var _0x202421=ut[_0x43e7('0x117')](_0xbc6e18,_0x16c757,_0x1c7f6a,_0xbc6e18[_0x43e7('0x7b')],_0x3bb7ab);return ami[_0x43e7('0x118')](_0x202421)[_0x43e7('0x4f')](function(_0x4637f6){_0x16c757[_0x43e7('0x2c')]+=0x1;logger[_0x43e7('0x25')](_0x43e7('0x119'),_0x240478,_0x43e7('0x95'),_0x16c757[_0x43e7('0x2a')],_0x43e7('0xcb'),_0x16c757['originated']);_0x2bb14d(_0x4637f6);})[_0x43e7('0x47')](function(_0x24d6e4){ut['logAgent'](_0xbc6e18,0xe,_0x43e7('0x11a'));rpcDb[_0x43e7('0xd3')](_0xbc6e18,'[originateFailure][logOriginateFailure]');_0x57f7ea(_0x24d6e4);});});};Preview[_0x43e7('0x34')][_0x43e7('0x11b')]=function(_0x2b9cf9){if(this['actions'][_0x2b9cf9['linkedid']]){this[_0x43e7('0x12')][_0x2b9cf9[_0x43e7('0x7c')]][_0x43e7('0x46')]=_0x2b9cf9[_0x43e7('0x46')];}};Preview[_0x43e7('0x34')][_0x43e7('0x15')]=function(_0x25b5a2){var _0xfe77ea=this;var _0x5d2cb0=this[_0x43e7('0x12')][_0x25b5a2[_0x43e7('0x11c')]];if(_0x5d2cb0){if(_0x5d2cb0[_0x43e7('0xe0')]&&this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]]){ut[_0x43e7('0x11d')](_0x5d2cb0,this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]][_0x43e7('0x2a')],this[_0x43e7('0xdf')][_0x5d2cb0[_0x43e7('0xe0')]]['id']);}var _0x218743=_['clone'](_0x5d2cb0);_0x218743[_0x43e7('0x81')]=moment()[_0x43e7('0x28')](_0x43e7('0x11e'));var _0x21c8b9=_0xfe77ea[_0x43e7('0x23')][_0x5d2cb0[_0x43e7('0x3d')]];if(ut['isFailure'](_0x25b5a2[_0x43e7('0x11f')])){if(_0x5d2cb0['unlockAgent']){rpcDb[_0x43e7('0xf3')](_0x5d2cb0[_0x43e7('0x7e')]);}if(_0x5d2cb0[_0x43e7('0x7b')]){rpcDb['disableContact'](_0x5d2cb0[_0x43e7('0x7e')]);}ami[_0x43e7('0x24')]('custom:agentringnoanswer',ut[_0x43e7('0x6d')](_0x5d2cb0,'rejected',this[_0x43e7('0x23')][_0x5d2cb0[_0x43e7('0x3d')]]));this[_0x43e7('0x120')](_0x218743,_0x21c8b9,_0x25b5a2);}else{_0x5d2cb0[_0x43e7('0x115')]=moment()['format'](_0x43e7('0x11e'));ut[_0x43e7('0xd0')](_0x218743,0x4,_0x43e7('0x8d'));rpcDb['createAgentHistory'](_0x218743,_0x43e7('0x121'));}}};Preview[_0x43e7('0x34')][_0x43e7('0x16')]=function(_0x431345){var _0x77c2f=this[_0x43e7('0x12')][_0x431345['linkedid']];var _0x3f057e;if(_0x77c2f){_0x3f057e=this['campaignsPreview'][_0x77c2f[_0x43e7('0x3d')]];logger[_0x43e7('0x25')]('[syncHangup][talking]',_0x431345[_0x43e7('0x7c')],_0x43e7('0x95'),_0x3f057e['name'],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);}if(this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]]&&_0x431345['linkedid']!==_0x431345['uniqueid']){if(_0x431345[_0x43e7('0x122')]==='16'&&this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}else if(this[_0x43e7('0x12')][_0x431345['linkedid']][_0x43e7('0x40')]){logger[_0x43e7('0x25')]('[syncHangup][talking][cause]',_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')],_0x43e7('0x95'),_0x3f057e[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345['linkedid'],_0x431345[_0x43e7('0x122')]);}}else if(_0x77c2f&&_['isNil'](_0x77c2f[_0x43e7('0x123')])&&_0x3f057e[_0x43e7('0x124')]&&_0x431345['linkedid']===_0x431345[_0x43e7('0x84')]&&_['isNil'](_0x431345[_0x43e7('0xcf')])&&_0x431345[_0x43e7('0x122')]==='16'&&_0x431345[_0x43e7('0x125')]==='6'&&_['isUndefined'](_0x77c2f['transfer'])){if(_0x77c2f[_0x43e7('0x7a')]){rpcDb[_0x43e7('0xf3')](_0x77c2f['idContact']);}if(_0x77c2f[_0x43e7('0x7b')]){rpcDb[_0x43e7('0x56')](_0x77c2f[_0x43e7('0x7e')]);}_0x431345['reason']='22';this[_0x43e7('0x120')](_0x77c2f,_0x3f057e,_0x431345);}else if(_0x77c2f&&_0x77c2f[_0x43e7('0x126')]){if(_0x431345[_0x43e7('0x122')]==='16'&&this['actions'][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){logger[_0x43e7('0x25')](_0x43e7('0x127'),_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')],'\x20Queue',_0x3f057e[_0x43e7('0x2a')],_0x43e7('0x3e'),_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}else if(this[_0x43e7('0x12')][_0x431345[_0x43e7('0x7c')]][_0x43e7('0x40')]){logger[_0x43e7('0x25')](_0x43e7('0x128'),_0x431345[_0x43e7('0x7c')],_0x431345['cause'],'\x20Queue',_0x3f057e['name'],'pTalking:\x20',_0x3f057e[_0x43e7('0x3f')]);this[_0x43e7('0x69')](_0x431345,_0x431345[_0x43e7('0x7c')],_0x431345[_0x43e7('0x122')]);}}};Preview[_0x43e7('0x34')][_0x43e7('0x1a')]=function(_0x51dc07){if(this['actions'][_0x51dc07[_0x43e7('0x129')]]&&_0x51dc07[_0x43e7('0x129')]!==_0x51dc07['destuniqueid']){this['callProgressDetectingCustomer'](_0x51dc07,_0x51dc07[_0x43e7('0x129')],_0x51dc07[_0x43e7('0xc0')]);}};Preview['prototype'][_0x43e7('0x19')]=function(_0x57bcab){if(this['actions'][_0x57bcab[_0x43e7('0x7c')]]&&_0x57bcab[_0x43e7('0x7c')]!==_0x57bcab['uniqueid']&&!this['actions'][_0x57bcab[_0x43e7('0x7c')]][_0x43e7('0x40')]){if(_0x57bcab[_0x43e7('0x122')]==='1'){this[_0x43e7('0x69')](_0x57bcab,_0x57bcab['linkedid'],_0x57bcab[_0x43e7('0x122')]);}}};Preview[_0x43e7('0x34')]['addVariable']=function(_0x560373,_0x4cdb87,_0x4eaf92){if(this[_0x43e7('0x12')][_0x560373]){if(_[_0x43e7('0x50')](this['actions'][_0x560373]['variables'])){this[_0x43e7('0x12')][_0x560373][_0x43e7('0x116')]={};}this[_0x43e7('0x12')][_0x560373][_0x43e7('0x116')][_0x4cdb87]=_0x4eaf92;}};Preview[_0x43e7('0x34')]['syncVarSet']=function(_0x3836e7){try{if(!_[_0x43e7('0x50')](_0x3836e7)){if(ut[_0x43e7('0x12a')](_[_0x43e7('0x12b')](_0x3836e7[_0x43e7('0x12c')])[0x0])){this['addVariable'](_0x3836e7[_0x43e7('0x84')],_[_0x43e7('0x12b')](_0x3836e7[_0x43e7('0x12c')])[0x0],_0x3836e7[_0x43e7('0x12d')]);}}}catch(_0x5564b4){logger[_0x43e7('0x12e')](_0x43e7('0x12f'),util[_0x43e7('0x130')](_0x5564b4,{'showHidden':![],'depth':null}));}};Preview[_0x43e7('0x34')][_0x43e7('0x1f')]=function(_0x308403){if(_0x308403){if(this['actions'][_0x308403[_0x43e7('0x131')]]){this[_0x43e7('0x12')][_0x308403[_0x43e7('0x131')]][_0x43e7('0x126')]=!![];}}};Preview['prototype'][_0x43e7('0x21')]=function(_0x48c784){if(_0x48c784){if(this[_0x43e7('0x12')][_0x48c784['transfererlinkedid']]){this[_0x43e7('0x12')][_0x48c784['transfererlinkedid']][_0x43e7('0x126')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index f269125..20a72fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b19=['queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','error','inspect','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete'];(function(_0xa20971,_0x1bf32c){var _0x4f4271=function(_0x299c14){while(--_0x299c14){_0xa20971['push'](_0xa20971['shift']());}};_0x4f4271(++_0x1bf32c);}(_0x0b19,0x88));var _0x90b1=function(_0x3b9149,_0x2f93ab){_0x3b9149=_0x3b9149-0x0;var _0x2067f4=_0x0b19[_0x3b9149];return _0x2067f4;};'use strict';var util=require(_0x90b1('0x0'));var BPromise=require(_0x90b1('0x1'));var logger=require(_0x90b1('0x2'))(_0x90b1('0x3'));var cmHopper=require(_0x90b1('0x4'));var cmHopperHistory=require(_0x90b1('0x5'));var cmHopperBlack=require(_0x90b1('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x90b1('0x7'));function loggerCatch(_0x3db6d6){return function(_0x5e2801){logger[_0x90b1('0x8')](_0x3db6d6,util[_0x90b1('0x9')](_0x5e2801,{'showHidden':![],'depth':null}));};}function create(_0x49c1bf){return cmHopperHistory[_0x90b1('0xa')](_0x49c1bf)[_0x90b1('0xb')](loggerCatch(_0x90b1('0xc')));}function createAgent(_0x48ddb9){return BPromise[_0x90b1('0xd')]()['then'](agentReportPreview['createHistory'](_0x48ddb9))['catch'](loggerCatch(_0x90b1('0xc')));}function moveContact(_0x4234e1){return cmHopper[_0x90b1('0xe')](_0x4234e1,!![])[_0x90b1('0xb')](loggerCatch(_0x90b1('0xf')));}exports['checkIsBlackList']=function(_0x302ae0){return cmHopperBlack['checkIsBlackList'](_0x302ae0)['catch'](loggerCatch(_0x90b1('0x10')));};exports[_0x90b1('0x11')]=function(_0x17e4a5){return BPromise['resolve']()[_0x90b1('0x12')](cmHopper['getContactPreview'](_0x17e4a5))[_0x90b1('0xb')](loggerCatch(_0x90b1('0x13')));};exports['createHistory']=function(_0x192567,_0x5b9ed6){create(_0x192567)[_0x90b1('0xb')](loggerCatch(_0x5b9ed6));moveContact(_0x192567)[_0x90b1('0xb')](loggerCatch(_0x5b9ed6));};exports[_0x90b1('0x14')]=function(_0x23e9f5,_0x28bc8a){createAgent(_0x23e9f5)[_0x90b1('0xb')](loggerCatch(_0x28bc8a));};exports[_0x90b1('0x15')]=function(_0x2f8e09,_0x1f88cd){create(_0x2f8e09)[_0x90b1('0xb')](loggerCatch(_0x1f88cd));};exports[_0x90b1('0x16')]=function(_0x51ec02,_0x3232dc){moveContact(_0x51ec02)['catch'](loggerCatch(_0x3232dc));};exports[_0x90b1('0x17')]=function(_0x950ece,_0xefc747,_0x338397){if(_0xefc747){_0x950ece['UserId']=null;}if(_0x338397){_0x950ece[_0x90b1('0x18')]=![];}return cmHopper[_0x90b1('0x17')](_0x950ece)[_0x90b1('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0xb6e360){return cmHopper[_0x90b1('0x19')](_0xb6e360)[_0x90b1('0xb')](loggerCatch(_0x90b1('0x1a')));};exports[_0x90b1('0x1b')]=function(_0x5eb63a){return cmHopper['unlockContact']({'UserId':null},_0x5eb63a,0x1)[_0x90b1('0xb')](loggerCatch(_0x90b1('0x1c')));};exports[_0x90b1('0x1d')]=function(_0x2b0c1a){return cmHopper[_0x90b1('0x1b')]({'active':![]},_0x2b0c1a,0x1)['catch'](loggerCatch(_0x90b1('0x1e')));};exports[_0x90b1('0x1f')]=function(_0x46fe8b){var _0x2e8b05={};_0x2e8b05[_0x90b1('0x20')]=_0x46fe8b[_0x90b1('0x20')];_0x2e8b05[_0x90b1('0x21')]=_0x46fe8b[_0x90b1('0x21')];_0x2e8b05[_0x90b1('0x22')]=_0x46fe8b[_0x90b1('0x22')];_0x2e8b05[_0x90b1('0x23')]=_0x46fe8b['calleridname'];_0x2e8b05[_0x90b1('0x24')]=_0x46fe8b[_0x90b1('0x24')];_0x2e8b05[_0x90b1('0x25')]=_0x46fe8b[_0x90b1('0x26')];_0x2e8b05[_0x90b1('0x27')]=_0x46fe8b[_0x90b1('0x26')];_0x2e8b05[_0x90b1('0x28')]=0x1;_0x2e8b05[_0x90b1('0x29')]=_0x46fe8b[_0x90b1('0x2a')];_0x2e8b05[_0x90b1('0x2b')]=_0x46fe8b[_0x90b1('0x2c')];_0x2e8b05[_0x90b1('0x2d')]=_0x90b1('0x2e');_0x2e8b05[_0x90b1('0x2f')]=_0x90b1('0x30');_0x2e8b05['holdtime']=0x0;_0x2e8b05[_0x90b1('0x31')]=0x1;_0x2e8b05[_0x90b1('0x32')]=_0x46fe8b['membername'];_0x2e8b05[_0x90b1('0x33')]=_0x90b1('0x34');return BPromise[_0x90b1('0xd')]()[_0x90b1('0x12')](voiceQueueReport[_0x90b1('0x35')](_0x2e8b05))[_0x90b1('0xb')](loggerCatch(_0x90b1('0x36')));};exports[_0x90b1('0x37')]=function(_0x42e759,_0x375659){return BPromise['resolve']()['then'](cmHopper[_0x90b1('0x37')](_0x42e759,_0x375659))[_0x90b1('0xb')](loggerCatch(_0x90b1('0x38')));};exports[_0x90b1('0x39')]=function(_0x6a99d){return cmHopper[_0x90b1('0x17')](_0x6a99d,!![],!![])['catch'](loggerCatch(_0x90b1('0x3a')));};
\ No newline at end of file
+var _0x135b=['COMPLETED','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','then','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason'];(function(_0x55b39f,_0x11ace2){var _0x5b55af=function(_0x227158){while(--_0x227158){_0x55b39f['push'](_0x55b39f['shift']());}};_0x5b55af(++_0x11ace2);}(_0x135b,0x11d));var _0xb135=function(_0x5eb542,_0x382306){_0x5eb542=_0x5eb542-0x0;var _0x17d20b=_0x135b[_0x5eb542];return _0x17d20b;};'use strict';var util=require(_0xb135('0x0'));var BPromise=require('bluebird');var logger=require(_0xb135('0x1'))(_0xb135('0x2'));var cmHopper=require(_0xb135('0x3'));var cmHopperHistory=require(_0xb135('0x4'));var cmHopperBlack=require(_0xb135('0x5'));var agentReportPreview=require(_0xb135('0x6'));var voiceQueueReport=require(_0xb135('0x7'));function loggerCatch(_0x23da99){return function(_0x4c9d62){logger['error'](_0x23da99,util[_0xb135('0x8')](_0x4c9d62,{'showHidden':![],'depth':null}));};}function create(_0x4604a7){return cmHopperHistory[_0xb135('0x9')](_0x4604a7)[_0xb135('0xa')](loggerCatch(_0xb135('0xb')));}function createAgent(_0x20c2dd){return BPromise[_0xb135('0xc')]()['then'](agentReportPreview[_0xb135('0x9')](_0x20c2dd))['catch'](loggerCatch(_0xb135('0xb')));}function moveContact(_0x5e529d){return cmHopper['moveContactManagedDialer'](_0x5e529d,!![])['catch'](loggerCatch(_0xb135('0xd')));}exports[_0xb135('0xe')]=function(_0x1e1834){return cmHopperBlack[_0xb135('0xe')](_0x1e1834)[_0xb135('0xa')](loggerCatch(_0xb135('0xf')));};exports[_0xb135('0x10')]=function(_0xf9580b){return BPromise[_0xb135('0xc')]()[_0xb135('0x11')](cmHopper[_0xb135('0x10')](_0xf9580b))[_0xb135('0xa')](loggerCatch(_0xb135('0x12')));};exports[_0xb135('0x9')]=function(_0x37ce7d,_0x4c2974){create(_0x37ce7d)[_0xb135('0xa')](loggerCatch(_0x4c2974));moveContact(_0x37ce7d)['catch'](loggerCatch(_0x4c2974));};exports[_0xb135('0x13')]=function(_0x51220a,_0x2d46b4){createAgent(_0x51220a)[_0xb135('0xa')](loggerCatch(_0x2d46b4));};exports[_0xb135('0x14')]=function(_0x2f4c04,_0x2995db){create(_0x2f4c04)[_0xb135('0xa')](loggerCatch(_0x2995db));};exports[_0xb135('0x15')]=function(_0x5827be,_0x661964){moveContact(_0x5827be)['catch'](loggerCatch(_0x661964));};exports[_0xb135('0x16')]=function(_0x5be6a1,_0x3f39c1,_0x4d8e87){if(_0x3f39c1){_0x5be6a1[_0xb135('0x17')]=null;}if(_0x4d8e87){_0x5be6a1[_0xb135('0x18')]=![];}return cmHopper[_0xb135('0x16')](_0x5be6a1)[_0xb135('0xa')](loggerCatch(_0xb135('0x19')));};exports[_0xb135('0x1a')]=function(_0x20b5a7){return cmHopper[_0xb135('0x1a')](_0x20b5a7)[_0xb135('0xa')](loggerCatch(_0xb135('0x1b')));};exports['unlockContact']=function(_0x4c72af){return cmHopper[_0xb135('0x1c')]({'UserId':null},_0x4c72af,0x1)[_0xb135('0xa')](loggerCatch(_0xb135('0x1d')));};exports[_0xb135('0x1e')]=function(_0x443a06){return cmHopper[_0xb135('0x1c')]({'active':![]},_0x443a06,0x1)[_0xb135('0xa')](loggerCatch(_0xb135('0x1f')));};exports['crateCustomerReportQueue']=function(_0x3dba14){var _0x98ed60={};_0x98ed60[_0xb135('0x20')]=_0x3dba14[_0xb135('0x20')];_0x98ed60[_0xb135('0x21')]=_0x3dba14['uniqueid'];_0x98ed60[_0xb135('0x22')]=_0x3dba14['calleridnum'];_0x98ed60['calleridname']=_0x3dba14[_0xb135('0x23')];_0x98ed60['queue']=_0x3dba14[_0xb135('0x24')];_0x98ed60['queuecallerjoinAt']=_0x3dba14[_0xb135('0x25')];_0x98ed60[_0xb135('0x26')]=_0x3dba14['answertime'];_0x98ed60[_0xb135('0x27')]=0x1;_0x98ed60[_0xb135('0x28')]=_0x3dba14['endtime'];_0x98ed60[_0xb135('0x29')]=_0x3dba14[_0xb135('0x2a')];_0x98ed60[_0xb135('0x2b')]=_0xb135('0x2c');_0x98ed60[_0xb135('0x2d')]=_0xb135('0x2e');_0x98ed60[_0xb135('0x2f')]=0x0;_0x98ed60[_0xb135('0x30')]=0x1;_0x98ed60[_0xb135('0x31')]=_0x3dba14[_0xb135('0x2a')];_0x98ed60[_0xb135('0x32')]=_0xb135('0x33');return BPromise[_0xb135('0xc')]()[_0xb135('0x11')](voiceQueueReport[_0xb135('0x34')](_0x98ed60))['catch'](loggerCatch(_0xb135('0x35')));};exports['getContactRecallMe']=function(_0x56b790,_0x8f690){return BPromise['resolve']()[_0xb135('0x11')](cmHopper['getContactRecallMe'](_0x56b790,_0x8f690))['catch'](loggerCatch(_0xb135('0x36')));};exports[_0xb135('0x37')]=function(_0x2a9621){return cmHopper[_0xb135('0x16')](_0x2a9621,!![],!![])[_0xb135('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index dd8f8cb..f85b402 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48cf=['callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','extractCalleridNumber','match','variables','keys','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','error','inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','Queue','name','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLower','originated','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','statedesc','ringtime','getSeconds','UserId','endtime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','active','add','minutes','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','filterKey','type','campaigntype','scheduledat','countglobal','callback'];(function(_0xa8ce53,_0x529d2d){var _0x4d8bf9=function(_0x13fa1b){while(--_0x13fa1b){_0xa8ce53['push'](_0xa8ce53['shift']());}};_0x4d8bf9(++_0x529d2d);}(_0x48cf,0xba));var _0xf48c=function(_0x3ac9b4,_0x17bba8){_0x3ac9b4=_0x3ac9b4-0x0;var _0x20655d=_0x48cf[_0x3ac9b4];return _0x20655d;};'use strict';var util=require(_0xf48c('0x0'));var _=require(_0xf48c('0x1'));var moment=require(_0xf48c('0x2'));var logger=require(_0xf48c('0x3'))(_0xf48c('0x4'));var ipAgi=process[_0xf48c('0x5')][_0xf48c('0x6')]||_0xf48c('0x7');var utils=require(_0xf48c('0x8'));exports['loggerCatch']=function(_0x1365cf){return function(_0x351c05){logger[_0xf48c('0x9')](_0x1365cf,util[_0xf48c('0xa')](_0x351c05,{'showHidden':![],'depth':null}));};};exports[_0xf48c('0xb')]=function(_0x45aff2,_0x207b96){logger['info'](_0x45aff2,util[_0xf48c('0xa')](_0x207b96,{'showHidden':![],'depth':null}));};exports[_0xf48c('0xc')]=function(_0x425fca,_0x1d19b9){logger['error'](_0x425fca,util[_0xf48c('0xa')](_0x1d19b9,{'showHidden':![],'depth':null}));};exports[_0xf48c('0xd')]=function(_0x2a54c7){return function(_0x376b1e){logger[_0xf48c('0xe')](_0x2a54c7,util[_0xf48c('0xa')](_0x376b1e,{'showHidden':![],'depth':null}));};};exports[_0xf48c('0xf')]=function(_0x119f98,_0x368ab2,_0x4b5b25){return{'message':_0x119f98,'unlock':_0x368ab2,'active':_0x4b5b25};};exports[_0xf48c('0x10')]=function(_0x2f5322,_0x51ad4f,_0x38cb4d){if(!_[_0xf48c('0x11')](_0x38cb4d)&&_0xf48c('0x12')===typeof _0x38cb4d&&!_[_0xf48c('0x13')](_0x38cb4d)){if(!_['isUndefined'](_0x51ad4f)&&_0xf48c('0x12')===typeof _0x51ad4f&&!_[_0xf48c('0x13')](_0x51ad4f)){return util['format'](_0xf48c('0x14'),_0x51ad4f,_0x38cb4d);}return util[_0xf48c('0x15')]('\x22%s\x22\x20<%s>',_0x38cb4d,_0x38cb4d);}if(!_['isUndefined'](_0x2f5322)&&_0xf48c('0x12')===typeof _0x2f5322&&!_['isEmpty'](_0x2f5322)){return _0x2f5322;}return _0xf48c('0x16');};exports[_0xf48c('0x17')]=function(_0x4d9353){if(_['isNil'](_0x4d9353)){return![];}return _0x4d9353;};exports['addVariables']=function(_0x1e9de0,_0xa38bcd,_0x508969,_0x4ffbfa,_0x5448ad,_0x379ca4){var _0xfb189b={'XMD-QUEUE':_0xa38bcd[_0xf48c('0x18')]?_0xa38bcd[_0xf48c('0x18')][_0xf48c('0x19')]:'','XMD-CALLERID':_0x4ffbfa,'XMD-CALLERID-PREVIEW':_0x379ca4?util['format']('\x22%s\x22\x20<%s>',_0x379ca4['calleridname'],_0x379ca4[_0xf48c('0x1a')]):_0x4ffbfa,'XMD-DIALID':_0x5448ad,'XMD-CONTACTID':_0xa38bcd['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4ffbfa,'XMD-VOICEQUEUEID':_0xa38bcd[_0xf48c('0x1b')],'XMD-DIALCHANNEL':_0x508969,'XMD-DIALTIMEOUT':_0x1e9de0[_0xf48c('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xf48c('0x15')](_0xf48c('0x1d'),_0x1e9de0['dialQueueProject2']?'g':'',_[_0xf48c('0x13')](_0x1e9de0[_0xf48c('0x1e')])?'':_0xf48c('0x1f')),'XMD-DIALURL':_0x1e9de0[_0xf48c('0x20')]||'','XMD-AGI':_0x1e9de0[_0xf48c('0x21')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x1e9de0[_0xf48c('0x21')]):'NONE','XMD-AGIAFTER':_0x1e9de0['dialQueueProject2']?util[_0xf48c('0x15')](_0xf48c('0x22'),ipAgi,_0x1e9de0[_0xf48c('0x23')]):_0xf48c('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x379ca4?_0x379ca4[_0xf48c('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x379ca4?_0x379ca4[_0xf48c('0x26')]:'','XMD-DESTINATION':_0xf48c('0x27'),'SIPADDHEADER':_0xf48c('0x28')};if(!_[_0xf48c('0x13')](_0x1e9de0[_0xf48c('0x1e')])){_0xfb189b[util[_0xf48c('0x15')]('%s',_0xf48c('0x29'))]=_0x1e9de0[_0xf48c('0x1e')];_0xfb189b[util[_0xf48c('0x15')]('%s',_0xf48c('0x2a'))]=_0x5448ad;}if(_0xa38bcd&&_0xa38bcd[_0xf48c('0x2b')]){for(var _0x15aceb in _0xa38bcd[_0xf48c('0x2b')]){if(_0xa38bcd['Contact']['hasOwnProperty'](_0x15aceb)){if(!_[_0xf48c('0x2c')](_0xa38bcd[_0xf48c('0x2b')][_0x15aceb])&&_0x15aceb!=='id'&&_0x15aceb!==_0xf48c('0x2d')&&_0x15aceb!==_0xf48c('0x2e')&&_0x15aceb!=='updatedAt'){_0xfb189b[util[_0xf48c('0x15')](_0xf48c('0x2f'),_0xf48c('0x30'),_[_0xf48c('0x31')](_0x15aceb))]=_0xa38bcd[_0xf48c('0x2b')][_0x15aceb];}}}}return _0xfb189b;};exports['toLowerVariables']=function(_0x2dcc64){var _0x4dda30={};for(var _0x526a6e in _0x2dcc64){if(_0x2dcc64['hasOwnProperty'](_0x526a6e)){_0x4dda30[util[_0xf48c('0x15')]('%s',_[_0xf48c('0x32')](_0x526a6e))]=_0x2dcc64[_0x526a6e];}}return{'variables':_0x4dda30};};exports['updateOriginated']=function(_0x5192f4,_0x4c162e){if(!_[_0xf48c('0x2c')](_0x5192f4)){if(_0x5192f4['hasOwnProperty'](_0xf48c('0x33'))){if(_0x5192f4[_0xf48c('0x33')]>0x0){_0x5192f4[_0xf48c('0x33')]-=0x1;}else{logger[_0xf48c('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4c162e);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4c162e);}};exports['logBlacklist']=function(_0x28bd71){var _0xc525b=moment()['format'](_0xf48c('0x34'));_0x28bd71[_0xf48c('0x35')]=0xd;_0x28bd71['statedesc']=_0xf48c('0x36');_0x28bd71[_0xf48c('0x37')]=_0xc525b;_0x28bd71[_0xf48c('0x38')]=_0xc525b;_0x28bd71['endtime']=_0xc525b;};exports[_0xf48c('0x39')]=function(_0x1ca715,_0x1bd246,_0x42c636){var _0x361069=moment()['format'](_0xf48c('0x34'));_0x1ca715[_0xf48c('0x35')]=_0x1bd246;_0x1ca715[_0xf48c('0x3a')]=_0x42c636;_0x1ca715[_0xf48c('0x38')]=_0x361069;_0x1ca715[_0xf48c('0x3b')]=utils[_0xf48c('0x3c')](_0x1ca715['responsetime'],_0x1ca715[_0xf48c('0x37')]);};exports['logLookAgent']=function(_0x2b93ad,_0x30fb91,_0x448087){_0x2b93ad['membername']=_0x30fb91;_0x2b93ad[_0xf48c('0x3d')]=_0x448087;};exports['logCustomer']=function(_0xcabe4f,_0x185eda,_0x25698f){var _0x43367c=moment()[_0xf48c('0x15')](_0xf48c('0x34'));_0xcabe4f['state']=_0x185eda;_0xcabe4f[_0xf48c('0x3a')]=_0x25698f;_0xcabe4f[_0xf48c('0x38')]=_0xcabe4f[_0xf48c('0x38')]?_0xcabe4f[_0xf48c('0x38')]:_0x43367c;_0xcabe4f[_0xf48c('0x3e')]=_0xcabe4f[_0xf48c('0x3e')]?_0xcabe4f[_0xf48c('0x3e')]:_0x43367c;_0xcabe4f['ringtime']=utils['getSeconds'](_0xcabe4f[_0xf48c('0x38')]||0x0,_0xcabe4f[_0xf48c('0x37')]||0x0);_0xcabe4f['talktime']=_0xcabe4f[_0xf48c('0x3f')]?utils[_0xf48c('0x3c')](_0xcabe4f[_0xf48c('0x3e')],_0xcabe4f[_0xf48c('0x3f')]):0x0;};exports[_0xf48c('0x40')]=function(_0x462602){return _0x462602===_0xf48c('0x41');};exports[_0xf48c('0x42')]=function(_0x3c454f,_0x42dd6f,_0x555bc7,_0x2a3ff8,_0xe290a5){var _0x16d42d=_0x2a3ff8?_0xf48c('0x43'):_0x3c454f[_0xf48c('0x44')];_0x16d42d=_0xe290a5?_0xf48c('0x45'):_0x16d42d;return{'actionid':_0x3c454f[_0xf48c('0x46')],'action':_0xf48c('0x47'),'channel':_0x3c454f[_0xf48c('0x48')],'callerid':util[_0xf48c('0x15')](_0xf48c('0x14'),_0x16d42d,_0x3c454f[_0xf48c('0x1a')]),'Exten':_0xf48c('0x27'),'Context':_0xf48c('0x49'),'Priority':'1','variable':_0x555bc7,'timeout':(_0x42dd6f[_0xf48c('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3c454f[_0xf48c('0x46')]};};exports[_0xf48c('0x4b')]=function(_0x3680fe){return _0x3680fe[_0xf48c('0x4c')]+_0x3680fe[_0xf48c('0x4d')]+_0x3680fe[_0xf48c('0x4e')]+_0x3680fe[_0xf48c('0x4f')]+_0x3680fe[_0xf48c('0x50')];};exports[_0xf48c('0x51')]=function(_0x5ad609){var _0x505b63=_[_0xf48c('0x52')](_0x5ad609);_0x505b63[_0xf48c('0x35')]=0xf;_0x505b63['statedesc']='Global';return _0x505b63;};exports['scheduledAt']=function(_0x5e91ed,_0x40b9a7,_0xa9932d){var _0x30c981={};_0x30c981[_0x40b9a7]=_0x5e91ed[_0x40b9a7];_0x30c981[_0xf48c('0x53')]=![];_0x30c981['scheduledat']=moment()[_0xf48c('0x54')](_0xa9932d,_0xf48c('0x55'))['format'](_0xf48c('0x34'));_0x30c981[_0xf48c('0x56')]=_0x5e91ed['ContactId'];_0x30c981[_0xf48c('0x57')]=_0x5e91ed[_0xf48c('0x57')];_0x30c981[_0xf48c('0x1b')]=_0x5e91ed[_0xf48c('0x1b')]||undefined;return _0x30c981;};exports[_0xf48c('0x58')]=function(_0x3df361,_0x46ec7f){if(!_['isNil'](_0x3df361)){if(_0x3df361['pTalking']>0x0){_0x3df361['pTalking']-=0x1;}else{logger[_0xf48c('0x9')](_0x46ec7f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xf48c('0x9')](_0x46ec7f,_0xf48c('0x59'));}};exports[_0xf48c('0x5a')]=function(_0x591707){if(_0x591707<=0x0){return!![];}return![];};function buildObj(_0x4f6609,_0x2d26cb,_0x1c2013){_0x4f6609[_0xf48c('0x5b')]=_0x2d26cb;_0x4f6609[_0xf48c('0x19')]=_0x4f6609[_0xf48c('0x5c')];_0x4f6609[_0xf48c('0x5d')]=_0x4f6609[_0xf48c('0x48')];_0x4f6609[_0xf48c('0x5e')]=_0xf48c('0x5f');if(_0x1c2013){_0x4f6609[_0xf48c('0x60')]=_0x1c2013[_0xf48c('0x60')];}return _0x4f6609;}exports[_0xf48c('0x61')]=buildObj;exports[_0xf48c('0x62')]=function(_0x5daf1d){var _0x334c7d={};_0x334c7d[_0xf48c('0x5c')]=_0x5daf1d[_0xf48c('0x5c')];_0x334c7d[_0xf48c('0x5d')]=_0x5daf1d[_0xf48c('0x48')];_0x334c7d['uniqueid']=_0x5daf1d[_0xf48c('0x46')];return _0x334c7d;};exports[_0xf48c('0x63')]=function(_0xee46a1){var _0x13dc21=[];for(var _0x241eae in _0xee46a1){if(_0xee46a1['hasOwnProperty'](_0x241eae)){if(!_[_0xf48c('0x2c')](_0xee46a1[_0x241eae])&&_0xee46a1[_0x241eae][_0xf48c('0x35')]===_0xf48c('0x64')&&_0xee46a1[_0x241eae]['status']===_0xf48c('0x65')){_0x13dc21[_0xf48c('0x66')](_0xee46a1[_0x241eae]['id']);}}}return _0x13dc21;};exports[_0xf48c('0x67')]=function(_0x19d73d){var _0x28115f=moment()[_0xf48c('0x68')](0x0);var _0xc441c4=moment(_0x19d73d)[_0xf48c('0x68')](0x0);return _0x28115f[_0xf48c('0x69')](_0xc441c4,'seconds');};exports[_0xf48c('0x6a')]=function(_0xa5157c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xa5157c['ContactId'],'ListId':_0xa5157c[_0xf48c('0x57')],'VoiceQueueId':_0xa5157c[_0xf48c('0x1b')]||undefined,'CampaignId':_0xa5157c[_0xf48c('0x6b')]||undefined};};exports[_0xf48c('0x6c')]=function(_0x246e05){if(_0x246e05==='uniqueid'||_0x246e05==='idContact'||_0x246e05===_0xf48c('0x5c')||_0x246e05===_0xf48c('0x6d')||_0x246e05===_0xf48c('0x6e')||_0x246e05==='dialAnswer'||_0x246e05==='membername'||_0x246e05==='channelAgent'||_0x246e05===_0xf48c('0x44')||_0x246e05==='active'||_0x246e05===_0xf48c('0x1a')||_0x246e05===_0xf48c('0x6f')||_0x246e05===_0xf48c('0x4c')||_0x246e05==='countcongestionretry'||_0x246e05===_0xf48c('0x4e')||_0x246e05===_0xf48c('0x70')||_0x246e05===_0xf48c('0x71')||_0x246e05===_0xf48c('0x72')||_0x246e05===_0xf48c('0x73')||_0x246e05===_0xf48c('0x74')||_0x246e05==='ContactId'||_0x246e05===_0xf48c('0x57')||_0x246e05===_0xf48c('0x3d')||_0x246e05===_0xf48c('0x1b')||_0x246e05===_0xf48c('0x75')||_0x246e05===_0xf48c('0x76')||_0x246e05===_0xf48c('0x77')||_0x246e05===_0xf48c('0x78')||_0x246e05==='xmd-listid'||_0x246e05===_0xf48c('0x79')||_0x246e05===_0xf48c('0x7a')||_0x246e05===_0xf48c('0x7b')||_0x246e05===_0xf48c('0x7c')||_0x246e05===_0xf48c('0x7d')||_0x246e05===_0xf48c('0x7e')||_0x246e05===_0xf48c('0x7f')||_0x246e05===_0xf48c('0x80')||_0x246e05===_0xf48c('0x81')||_0x246e05===_0xf48c('0x82')||_0x246e05===_0xf48c('0x83')||_0x246e05===_0xf48c('0x84')||_0x246e05===_0xf48c('0x85')||_0x246e05===_0xf48c('0x86')||_0x246e05===_0xf48c('0x87')||_0x246e05===_0xf48c('0x88')||_0x246e05===_0xf48c('0x89')||_0x246e05===_0xf48c('0x8a')||_0x246e05===_0xf48c('0x83')||_0x246e05===_0xf48c('0x84')||_0x246e05===_0xf48c('0x85')||_0x246e05===_0xf48c('0x86')||_0x246e05===_0xf48c('0x87')||_0x246e05===_0xf48c('0x88')||_0x246e05==='rtpaudioqosrtt'||_0x246e05==='rtpaudioqosrttbridged'||_0x246e05===_0xf48c('0x8b')||_0x246e05==='bridgepvtcallid'||_0x246e05==='state'||_0x246e05===_0xf48c('0x3a')){return![];}return!![];};exports[_0xf48c('0x8c')]=function(_0x1587b6,_0x303b0d){var _0x82e68f,_0x5dbe0c,_0x32daee;if(_0x303b0d<=0x0){_0x303b0d=0x1;}_0x82e68f=new RegExp(_0xf48c('0x8d')+_0x303b0d+'}$');_0x5dbe0c=Math[_0xf48c('0x8e')](0xa,_0x303b0d-0x1);_0x32daee=Math[_0xf48c('0x8e')](0xa,_0x303b0d)-0x1;return util[_0xf48c('0x15')]('%s',_['replace'](_0x1587b6,_0x82e68f,_['random'](_0x5dbe0c,_0x32daee)));};exports[_0xf48c('0x8f')]=function(_0x2ed93e){var _0x271c0f=_0x2ed93e['match'](/"(.*?)"/);return _0x271c0f?_0x271c0f[0x1]:_0x2ed93e;};exports[_0xf48c('0x90')]=function(_0x8e0240){var _0x125781=_0x8e0240[_0xf48c('0x91')](/<(.*?)>/);return _0x125781?_0x125781[0x1]:_0x8e0240;};function buildNoAnswerEventPayload(_0x4c5c55,_0x205d0a){var _0x3c32f9=buildObj(_0x4c5c55,'noanswer');if(!_[_0xf48c('0x13')](_0x205d0a[_0xf48c('0x92')])){Object[_0xf48c('0x93')](_0x205d0a[_0xf48c('0x92')])['forEach'](function(_0x4c01ea){_0x3c32f9[_0x4c01ea[_0xf48c('0x94')]()]=_0x205d0a[_0xf48c('0x92')][_0x4c01ea];});}return _0x3c32f9;}exports[_0xf48c('0x95')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x8c7f=['Call-Type:\x20PREVIEW','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toLowerVariables','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','statedesc','starttime','responsetime','logAgent','YYYY-MM-DD\x20HH:mm:ss','getSeconds','logLookAgent','membername','UserId','logCustomer','endtime','talktime','answertime','variablesAction','uniqueid','originate','channelAgent','from-sip','timeout','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledat','add','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','type','campaigntype','dialAnswer','active','countbusyretry','countcongestionretry','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','../../dialer/utils','error','inspect','logger','info','logger2','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','addVariables','Queue','name','calleridname','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview'];(function(_0x32fda4,_0x15a7ca){var _0x464fe5=function(_0x30f63d){while(--_0x30f63d){_0x32fda4['push'](_0x32fda4['shift']());}};_0x464fe5(++_0x15a7ca);}(_0x8c7f,0xf1));var _0xf8c7=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x8c7f[_0x297fd3];return _0x2af381;};'use strict';var util=require('util');var _=require(_0xf8c7('0x0'));var moment=require(_0xf8c7('0x1'));var logger=require(_0xf8c7('0x2'))(_0xf8c7('0x3'));var ipAgi=process[_0xf8c7('0x4')][_0xf8c7('0x5')]||'127.0.0.1';var utils=require(_0xf8c7('0x6'));exports['loggerCatch']=function(_0x487b75){return function(_0x1944b1){logger[_0xf8c7('0x7')](_0x487b75,util[_0xf8c7('0x8')](_0x1944b1,{'showHidden':![],'depth':null}));};};exports[_0xf8c7('0x9')]=function(_0x2ece32,_0xf16db0){logger[_0xf8c7('0xa')](_0x2ece32,util['inspect'](_0xf16db0,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x113b1a,_0x2355aa){logger['error'](_0x113b1a,util[_0xf8c7('0x8')](_0x2355aa,{'showHidden':![],'depth':null}));};exports[_0xf8c7('0xb')]=function(_0x1b2e99){return function(_0x5d6a75){logger['info'](_0x1b2e99,util[_0xf8c7('0x8')](_0x5d6a75,{'showHidden':![],'depth':null}));};};exports[_0xf8c7('0xc')]=function(_0x1e18e6,_0x3a01ef,_0x262e7f){return{'message':_0x1e18e6,'unlock':_0x3a01ef,'active':_0x262e7f};};exports['getCallerId']=function(_0x2ccc94,_0x3d88ac,_0x1630d3){if(!_[_0xf8c7('0xd')](_0x1630d3)&&_0xf8c7('0xe')===typeof _0x1630d3&&!_[_0xf8c7('0xf')](_0x1630d3)){if(!_[_0xf8c7('0xd')](_0x3d88ac)&&_0xf8c7('0xe')===typeof _0x3d88ac&&!_[_0xf8c7('0xf')](_0x3d88ac)){return util['format'](_0xf8c7('0x10'),_0x3d88ac,_0x1630d3);}return util[_0xf8c7('0x11')](_0xf8c7('0x10'),_0x1630d3,_0x1630d3);}if(!_[_0xf8c7('0xd')](_0x2ccc94)&&_0xf8c7('0xe')===typeof _0x2ccc94&&!_[_0xf8c7('0xf')](_0x2ccc94)){return _0x2ccc94;}return _0xf8c7('0x12');};exports['isActive']=function(_0x200491){if(_['isNil'](_0x200491)){return![];}return _0x200491;};exports[_0xf8c7('0x13')]=function(_0x10f2cf,_0xc90296,_0x1b5f90,_0x12465a,_0x21689c,_0x325277){var _0x290f81={'XMD-QUEUE':_0xc90296[_0xf8c7('0x14')]?_0xc90296[_0xf8c7('0x14')][_0xf8c7('0x15')]:'','XMD-CALLERID':_0x12465a,'XMD-CALLERID-PREVIEW':_0x325277?util['format'](_0xf8c7('0x10'),_0x325277[_0xf8c7('0x16')],_0x325277['calleridnum']):_0x12465a,'XMD-DIALID':_0x21689c,'XMD-CONTACTID':_0xc90296[_0xf8c7('0x17')],'XMD-CDRTYPE':_0xf8c7('0x18'),'CALLERID(all)':_0x12465a,'XMD-VOICEQUEUEID':_0xc90296['VoiceQueueId'],'XMD-DIALCHANNEL':_0x1b5f90,'XMD-DIALTIMEOUT':_0x10f2cf[_0xf8c7('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0xf8c7('0x11')](_0xf8c7('0x1a'),_0x10f2cf[_0xf8c7('0x1b')]?'g':'',_[_0xf8c7('0xf')](_0x10f2cf['monitor_format'])?'':_0xf8c7('0x1c')),'XMD-DIALURL':_0x10f2cf[_0xf8c7('0x1d')]||'','XMD-AGI':_0x10f2cf[_0xf8c7('0x1e')]?util[_0xf8c7('0x11')](_0xf8c7('0x1f'),ipAgi,_0x10f2cf[_0xf8c7('0x1e')]):_0xf8c7('0x20'),'XMD-AGIAFTER':_0x10f2cf[_0xf8c7('0x1b')]?util[_0xf8c7('0x11')](_0xf8c7('0x1f'),ipAgi,_0x10f2cf[_0xf8c7('0x1b')]):_0xf8c7('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x325277?_0x325277[_0xf8c7('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x325277?_0x325277['originatecalleridname']:'','XMD-DESTINATION':_0xf8c7('0x22'),'SIPADDHEADER':_0xf8c7('0x23')};if(!_['isEmpty'](_0x10f2cf[_0xf8c7('0x24')])){_0x290f81[util[_0xf8c7('0x11')]('%s',_0xf8c7('0x25'))]=_0x10f2cf[_0xf8c7('0x24')];_0x290f81[util['format']('%s',_0xf8c7('0x26'))]=_0x21689c;}if(_0xc90296&&_0xc90296[_0xf8c7('0x27')]){for(var _0xef7993 in _0xc90296[_0xf8c7('0x27')]){if(_0xc90296[_0xf8c7('0x27')][_0xf8c7('0x28')](_0xef7993)){if(!_['isNil'](_0xc90296[_0xf8c7('0x27')][_0xef7993])&&_0xef7993!=='id'&&_0xef7993!==_0xf8c7('0x29')&&_0xef7993!==_0xf8c7('0x2a')&&_0xef7993!=='updatedAt'){_0x290f81[util[_0xf8c7('0x11')]('%s%s',_0xf8c7('0x2b'),_['toUpper'](_0xef7993))]=_0xc90296[_0xf8c7('0x27')][_0xef7993];}}}}return _0x290f81;};exports[_0xf8c7('0x2c')]=function(_0x4543f2){var _0x3eb405={};for(var _0x2b7bc9 in _0x4543f2){if(_0x4543f2[_0xf8c7('0x28')](_0x2b7bc9)){_0x3eb405[util[_0xf8c7('0x11')]('%s',_[_0xf8c7('0x2d')](_0x2b7bc9))]=_0x4543f2[_0x2b7bc9];}}return{'variables':_0x3eb405};};exports[_0xf8c7('0x2e')]=function(_0x279f7c,_0x5e836c){if(!_[_0xf8c7('0x2f')](_0x279f7c)){if(_0x279f7c[_0xf8c7('0x28')]('originated')){if(_0x279f7c[_0xf8c7('0x30')]>0x0){_0x279f7c[_0xf8c7('0x30')]-=0x1;}else{logger[_0xf8c7('0x7')](_0xf8c7('0x31'),_0x5e836c);}}}else{logger[_0xf8c7('0x7')](_0xf8c7('0x32'),_0x5e836c);}};exports['logBlacklist']=function(_0x4efed6){var _0x598e72=moment()[_0xf8c7('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x4efed6[_0xf8c7('0x33')]=0xd;_0x4efed6[_0xf8c7('0x34')]='Blacklist';_0x4efed6[_0xf8c7('0x35')]=_0x598e72;_0x4efed6[_0xf8c7('0x36')]=_0x598e72;_0x4efed6['endtime']=_0x598e72;};exports[_0xf8c7('0x37')]=function(_0x3ec08c,_0x153c4b,_0x18ef1f){var _0x725530=moment()[_0xf8c7('0x11')](_0xf8c7('0x38'));_0x3ec08c[_0xf8c7('0x33')]=_0x153c4b;_0x3ec08c[_0xf8c7('0x34')]=_0x18ef1f;_0x3ec08c['responsetime']=_0x725530;_0x3ec08c['ringtime']=utils[_0xf8c7('0x39')](_0x3ec08c[_0xf8c7('0x36')],_0x3ec08c['starttime']);};exports[_0xf8c7('0x3a')]=function(_0x3eafbf,_0x126062,_0x1131a4){_0x3eafbf[_0xf8c7('0x3b')]=_0x126062;_0x3eafbf[_0xf8c7('0x3c')]=_0x1131a4;};exports[_0xf8c7('0x3d')]=function(_0x52116a,_0x9e9f42,_0xfc3dd8){var _0x3bb2e7=moment()[_0xf8c7('0x11')](_0xf8c7('0x38'));_0x52116a['state']=_0x9e9f42;_0x52116a[_0xf8c7('0x34')]=_0xfc3dd8;_0x52116a[_0xf8c7('0x36')]=_0x52116a[_0xf8c7('0x36')]?_0x52116a['responsetime']:_0x3bb2e7;_0x52116a[_0xf8c7('0x3e')]=_0x52116a[_0xf8c7('0x3e')]?_0x52116a['endtime']:_0x3bb2e7;_0x52116a['ringtime']=utils[_0xf8c7('0x39')](_0x52116a[_0xf8c7('0x36')]||0x0,_0x52116a['starttime']||0x0);_0x52116a[_0xf8c7('0x3f')]=_0x52116a['answertime']?utils[_0xf8c7('0x39')](_0x52116a[_0xf8c7('0x3e')],_0x52116a[_0xf8c7('0x40')]):0x0;};exports['isFailure']=function(_0x1d5b1a){return _0x1d5b1a==='Failure';};exports[_0xf8c7('0x41')]=function(_0x44be85,_0x2f8faa,_0xe56464,_0x58bd21,_0x41a7a0){var _0x2dd6ef=_0x58bd21?'RECALL':_0x44be85[_0xf8c7('0x16')];_0x2dd6ef=_0x41a7a0?'BOOKED':_0x2dd6ef;return{'actionid':_0x44be85[_0xf8c7('0x42')],'action':_0xf8c7('0x43'),'channel':_0x44be85[_0xf8c7('0x44')],'callerid':util[_0xf8c7('0x11')]('\x22%s\x22\x20<%s>',_0x2dd6ef,_0x44be85['calleridnum']),'Exten':_0xf8c7('0x22'),'Context':_0xf8c7('0x45'),'Priority':'1','variable':_0xe56464,'timeout':(_0x2f8faa[_0xf8c7('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x44be85['uniqueid']};};exports['totalGlobal']=function(_0x535f28){return _0x535f28['countbusyretry']+_0x535f28['countcongestionretry']+_0x535f28['countnoanswerretry']+_0x535f28[_0xf8c7('0x47')]+_0x535f28[_0xf8c7('0x48')];};exports[_0xf8c7('0x49')]=function(_0x21c6bb){var _0x308f7a=_[_0xf8c7('0x4a')](_0x21c6bb);_0x308f7a['state']=0xf;_0x308f7a['statedesc']='Global';return _0x308f7a;};exports['scheduledAt']=function(_0x53c8e1,_0x1884e4,_0x28e205){var _0x29c04b={};_0x29c04b[_0x1884e4]=_0x53c8e1[_0x1884e4];_0x29c04b['active']=![];_0x29c04b[_0xf8c7('0x4b')]=moment()[_0xf8c7('0x4c')](_0x28e205,_0xf8c7('0x4d'))[_0xf8c7('0x11')](_0xf8c7('0x38'));_0x29c04b[_0xf8c7('0x17')]=_0x53c8e1[_0xf8c7('0x17')];_0x29c04b[_0xf8c7('0x4e')]=_0x53c8e1[_0xf8c7('0x4e')];_0x29c04b[_0xf8c7('0x4f')]=_0x53c8e1[_0xf8c7('0x4f')]||undefined;return _0x29c04b;};exports['decrementTalkink']=function(_0x1bf77a,_0x5c5bb3){if(!_[_0xf8c7('0x2f')](_0x1bf77a)){if(_0x1bf77a[_0xf8c7('0x50')]>0x0){_0x1bf77a[_0xf8c7('0x50')]-=0x1;}else{logger[_0xf8c7('0x7')](_0x5c5bb3,_0xf8c7('0x51'));}}else{logger[_0xf8c7('0x7')](_0x5c5bb3,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x59ff35){if(_0x59ff35<=0x0){return!![];}return![];};function buildObj(_0x467eda,_0x514518,_0x140a77){_0x467eda[_0xf8c7('0x52')]=_0x514518;_0x467eda[_0xf8c7('0x15')]=_0x467eda[_0xf8c7('0x53')];_0x467eda[_0xf8c7('0x54')]=_0x467eda['channelAgent'];_0x467eda['motionChannel']=_0xf8c7('0x55');if(_0x140a77){_0x467eda['mandatoryDisposition']=_0x140a77[_0xf8c7('0x56')];}return _0x467eda;}exports['buildObj']=buildObj;exports[_0xf8c7('0x57')]=function(_0x51ed31){var _0x4196c1={};_0x4196c1[_0xf8c7('0x53')]=_0x51ed31[_0xf8c7('0x53')];_0x4196c1[_0xf8c7('0x54')]=_0x51ed31[_0xf8c7('0x44')];_0x4196c1[_0xf8c7('0x42')]=_0x51ed31['uniqueid'];return _0x4196c1;};exports[_0xf8c7('0x58')]=function(_0x36ba62){var _0x251b7e=[];for(var _0x5d5e7d in _0x36ba62){if(_0x36ba62['hasOwnProperty'](_0x5d5e7d)){if(!_[_0xf8c7('0x2f')](_0x36ba62[_0x5d5e7d])&&_0x36ba62[_0x5d5e7d][_0xf8c7('0x33')]===_0xf8c7('0x59')&&_0x36ba62[_0x5d5e7d][_0xf8c7('0x5a')]===_0xf8c7('0x5b')){_0x251b7e[_0xf8c7('0x5c')](_0x36ba62[_0x5d5e7d]['id']);}}}return _0x251b7e;};exports[_0xf8c7('0x5d')]=function(_0x5715a1){var _0x414589=moment()[_0xf8c7('0x5e')](0x0);var _0x1a1c59=moment(_0x5715a1)[_0xf8c7('0x5e')](0x0);return _0x414589[_0xf8c7('0x5f')](_0x1a1c59,_0xf8c7('0x60'));};exports['createBody']=function(_0x4df3b6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4df3b6['ContactId'],'ListId':_0x4df3b6[_0xf8c7('0x4e')],'VoiceQueueId':_0x4df3b6[_0xf8c7('0x4f')]||undefined,'CampaignId':_0x4df3b6[_0xf8c7('0x61')]||undefined};};exports[_0xf8c7('0x62')]=function(_0x449ec8){if(_0x449ec8===_0xf8c7('0x42')||_0x449ec8==='idContact'||_0x449ec8===_0xf8c7('0x53')||_0x449ec8===_0xf8c7('0x63')||_0x449ec8===_0xf8c7('0x64')||_0x449ec8===_0xf8c7('0x65')||_0x449ec8===_0xf8c7('0x3b')||_0x449ec8===_0xf8c7('0x44')||_0x449ec8===_0xf8c7('0x16')||_0x449ec8===_0xf8c7('0x66')||_0x449ec8==='calleridnum'||_0x449ec8==='scheduledat'||_0x449ec8===_0xf8c7('0x67')||_0x449ec8===_0xf8c7('0x68')||_0x449ec8==='countnoanswerretry'||_0x449ec8===_0xf8c7('0x69')||_0x449ec8==='callback'||_0x449ec8===_0xf8c7('0x6a')||_0x449ec8===_0xf8c7('0x6b')||_0x449ec8==='recallme'||_0x449ec8===_0xf8c7('0x17')||_0x449ec8===_0xf8c7('0x4e')||_0x449ec8===_0xf8c7('0x3c')||_0x449ec8===_0xf8c7('0x4f')||_0x449ec8===_0xf8c7('0x6c')||_0x449ec8===_0xf8c7('0x6d')||_0x449ec8==='xmd-queue'||_0x449ec8==='xmd-phone'||_0x449ec8===_0xf8c7('0x6e')||_0x449ec8===_0xf8c7('0x6f')||_0x449ec8===_0xf8c7('0x70')||_0x449ec8===_0xf8c7('0x71')||_0x449ec8===_0xf8c7('0x72')||_0x449ec8===_0xf8c7('0x73')||_0x449ec8===_0xf8c7('0x74')||_0x449ec8===_0xf8c7('0x75')||_0x449ec8===_0xf8c7('0x76')||_0x449ec8==='xmd-agiafter'||_0x449ec8==='xmd-agi'||_0x449ec8==='rtpaudioqos'||_0x449ec8===_0xf8c7('0x77')||_0x449ec8===_0xf8c7('0x78')||_0x449ec8==='rtpaudioqosjitterbridged'||_0x449ec8===_0xf8c7('0x79')||_0x449ec8===_0xf8c7('0x7a')||_0x449ec8===_0xf8c7('0x7b')||_0x449ec8==='rtpaudioqosrttbridged'||_0x449ec8===_0xf8c7('0x7c')||_0x449ec8===_0xf8c7('0x77')||_0x449ec8==='rtpaudioqosjitter'||_0x449ec8==='rtpaudioqosjitterbridged'||_0x449ec8===_0xf8c7('0x79')||_0x449ec8===_0xf8c7('0x7a')||_0x449ec8===_0xf8c7('0x7b')||_0x449ec8===_0xf8c7('0x7d')||_0x449ec8===_0xf8c7('0x7e')||_0x449ec8==='bridgepvtcallid'||_0x449ec8==='state'||_0x449ec8===_0xf8c7('0x34')){return![];}return!![];};exports[_0xf8c7('0x7f')]=function(_0xe37c51,_0x170753){var _0x3d9537,_0x3268d2,_0x20eca0;if(_0x170753<=0x0){_0x170753=0x1;}_0x3d9537=new RegExp(_0xf8c7('0x80')+_0x170753+'}$');_0x3268d2=Math['pow'](0xa,_0x170753-0x1);_0x20eca0=Math[_0xf8c7('0x81')](0xa,_0x170753)-0x1;return util['format']('%s',_[_0xf8c7('0x82')](_0xe37c51,_0x3d9537,_[_0xf8c7('0x83')](_0x3268d2,_0x20eca0)));};exports['extractCalleridName']=function(_0x54c67f){var _0x626c13=_0x54c67f[_0xf8c7('0x84')](/"(.*?)"/);return _0x626c13?_0x626c13[0x1]:_0x54c67f;};exports['extractCalleridNumber']=function(_0x419a67){var _0xa3de0a=_0x419a67[_0xf8c7('0x84')](/<(.*?)>/);return _0xa3de0a?_0xa3de0a[0x1]:_0x419a67;};function buildNoAnswerEventPayload(_0x807dd5,_0x3cb1b8){var _0x1108e8=buildObj(_0x807dd5,_0xf8c7('0x85'));if(!_['isEmpty'](_0x3cb1b8[_0xf8c7('0x86')])){Object['keys'](_0x3cb1b8[_0xf8c7('0x86')])[_0xf8c7('0x87')](function(_0x479841){_0x1108e8[_0x479841[_0xf8c7('0x88')]()]=_0x3cb1b8[_0xf8c7('0x86')][_0x479841];});}return _0x1108e8;}exports[_0xf8c7('0x89')]=buildNoAnswerEventPayload;
\ No newline at end of file
index 631fcd5..639e8bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2866=['queueremove','queuepause','boolean','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x4c4bf6,_0x78115f){var _0x206ad4=function(_0x543957){while(--_0x543957){_0x4c4bf6['push'](_0x4c4bf6['shift']());}};_0x206ad4(++_0x78115f);}(_0x2866,0x129));var _0x6286=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x2866[_0x2dc7c9];return _0x3e6536;};'use strict';exports[_0x6286('0x0')]={'queue':{'type':_0x6286('0x1'),'required':!![]},'interface':{'type':_0x6286('0x1'),'required':!![]},'membername':{'type':_0x6286('0x1'),'required':!![]},'penalty':{'type':_0x6286('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x6286('0x3')]={'queue':{'type':_0x6286('0x1'),'required':!![]},'interface':{'type':_0x6286('0x1'),'required':!![]}};exports[_0x6286('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x6286('0x5')},'reason':{'type':_0x6286('0x1'),'required':![]}};exports[_0x6286('0x6')]={'module':{'type':_0x6286('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x6286('0x1'),'required':!![]}};exports[_0x6286('0x7')]={'uniqueid':{'type':_0x6286('0x1'),'required':!![]},'filename':{'type':_0x6286('0x1')},'format':{'type':_0x6286('0x1')},'mixmonitorid':{'type':'string'}};exports[_0x6286('0x8')]={'uniqueid':{'type':_0x6286('0x1'),'required':!![]}};exports[_0x6286('0x9')]={'uniqueid':{'type':_0x6286('0x1'),'required':!![]},'exten':{'type':_0x6286('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x58ed=['boolean','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','queueremove','queuepause'];(function(_0xc7caa8,_0x28ee9c){var _0x18fe7e=function(_0x5186fe){while(--_0x5186fe){_0xc7caa8['push'](_0xc7caa8['shift']());}};_0x18fe7e(++_0x28ee9c);}(_0x58ed,0x1da));var _0xd58e=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x58ed[_0x50e593];return _0x3821d0;};'use strict';exports['queueadd']={'queue':{'type':_0xd58e('0x0'),'required':!![]},'interface':{'type':_0xd58e('0x0'),'required':!![]},'membername':{'type':_0xd58e('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xd58e('0x1')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xd58e('0x0'),'required':!![]}};exports[_0xd58e('0x2')]={'interface':{'type':_0xd58e('0x0'),'required':!![]},'paused':{'type':_0xd58e('0x3')},'reason':{'type':'string','required':![]}};exports[_0xd58e('0x4')]={'module':{'type':_0xd58e('0x0'),'required':![]}};exports[_0xd58e('0x5')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]}};exports[_0xd58e('0x6')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0xd58e('0x7')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]}};exports[_0xd58e('0x8')]={'uniqueid':{'type':_0xd58e('0x0'),'required':!![]},'exten':{'type':_0xd58e('0x0'),'required':!![]},'context':{'type':_0xd58e('0x0')}};
\ No newline at end of file
index 0a7b26e..2b8b4bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['queuecallerabandonAt','queuecallerexitAt','total','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','moment','util','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','timers','salesforceAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','SIP/%s','isNil','interface','name','hasOwnProperty','answered','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','diff','queuecallerjoinAt','seconds','queuecallercompleteAt'];(function(_0x3acef7,_0x52f2ae){var _0x7e935a=function(_0x55ddc1){while(--_0x55ddc1){_0x3acef7['push'](_0x3acef7['shift']());}};_0x7e935a(++_0x52f2ae);}(_0x757a,0xde));var _0xa757=function(_0xc70213,_0x450c05){_0xc70213=_0xc70213-0x0;var _0x45f9d9=_0x757a[_0xc70213];return _0x45f9d9;};'use strict';var _=require('lodash');var moment=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Agent=require('../model/agent');var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require(_0xa757('0x2'));var Trigger=require(_0xa757('0x3'));var Template=require(_0xa757('0x4'));var Campaign=require(_0xa757('0x5'));var VoiceExtension=require(_0xa757('0x6'));var ZendeskAccount=require(_0xa757('0x7'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xa757('0x8'));var SugarcrmAccount=require(_0xa757('0x9'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xa757('0xa'));var VtigerAccount=require(_0xa757('0xb'));var ServicenowAccount=require(_0xa757('0xc'));var Dynamics365Account=require(_0xa757('0xd'));var FreshsalesAccount=require(_0xa757('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xa757('0xf')]={};this[_0xa757('0x10')]={};this[_0xa757('0x11')]={};this[_0xa757('0x12')]={};this[_0xa757('0x13')]={};this[_0xa757('0x14')]={};this[_0xa757('0x15')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this['queueChannels']={};this['outboundChannels']={};this[_0xa757('0x16')]={};this['settings']={};this['zendeskAccounts']={};this[_0xa757('0x17')]={};this['sugarcrmAccounts']={};this['freshdeskAccounts']={};this[_0xa757('0x18')]={};this[_0xa757('0x19')]={};this[_0xa757('0x1a')]={};this[_0xa757('0x1b')]={};this[_0xa757('0x1c')]={};this[_0xa757('0x1d')]={};this[_0xa757('0x1e')]={};}function freeIsNotKey(_0x2f7947,_0x185011,_0x3df1f9){var _0x50aac1=_[_0xa757('0x1f')](_0x2f7947,function(_0x44eab8){return _0x44eab8[_0x3df1f9];});for(var _0xde8248 in _0x185011){if(_0x185011['hasOwnProperty'](_0xde8248)){if(!_0x50aac1[_0xde8248]){delete _0x185011[_0xde8248];}}}}function freeIsNotKeySip(_0x54b305,_0x151c04){var _0x468d45=_[_0xa757('0x1f')](_0x54b305,function(_0x340599){return util[_0xa757('0x20')](_0xa757('0x21'),_0x340599['name']);});for(var _0x58954 in _0x151c04){if(_0x151c04['hasOwnProperty'](_0x58954)){if(!_0x468d45[_0x58954]){delete _0x151c04[_0x58954];}}}}function freeIsNotKeyAgent(_0x32c2a1,_0x167640){var _0x14014c=_[_0xa757('0x1f')](_0x32c2a1,function(_0x4d598c){var _0x5638c7=_[_0xa757('0x22')](_0x4d598c[_0xa757('0x23')])?util[_0xa757('0x20')](_0xa757('0x21'),_0x4d598c[_0xa757('0x24')]):_0x4d598c[_0xa757('0x23')];return _0x5638c7;});for(var _0x2ca10d in _0x167640){if(_0x167640[_0xa757('0x25')](_0x2ca10d)){if(!_0x14014c[_0x2ca10d]){delete _0x167640[_0x2ca10d];}}}}function clearVoiceCallReports(_0x2bf276){_0x2bf276['total']=0x0;_0x2bf276[_0xa757('0x26')]=0x0;_0x2bf276['sumHoldTime']=0x0;_0x2bf276[_0xa757('0x27')]=0x0;_0x2bf276['sumBillable']=0x0;}function clearCampaigns(_0x40551d){if(!_[_0xa757('0x28')](_0x40551d)){for(var _0x37c7e6 in _0x40551d){if(_0x40551d['hasOwnProperty'](_0x37c7e6)){_0x40551d[_0x37c7e6][_0xa757('0x29')]=0x0;_0x40551d[_0x37c7e6][_0xa757('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x471e84){if(!_[_0xa757('0x28')](_0x471e84)){for(var _0x5b4779 in _0x471e84){if(_0x471e84[_0xa757('0x25')](_0x5b4779)){_0x471e84[_0x5b4779]['total']=0x0;_0x471e84[_0x5b4779]['answered']=0x0;_0x471e84[_0x5b4779]['unmanaged']=0x0;_0x471e84[_0x5b4779]['abandoned']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2b')]=0x0;_0x471e84[_0x5b4779]['sumDuration']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2c')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779]['outboundNoAnswerCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2e')]=0x0;_0x471e84[_0x5b4779]['outboundCongestionCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x2f')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x30')]=0x0;_0x471e84[_0x5b4779]['outboundDropCallsDayTimeout']=0x0;_0x471e84[_0x5b4779][_0xa757('0x31')]=0x0;_0x471e84[_0x5b4779]['outboundBlacklistCallsDay']=0x0;_0x471e84[_0x5b4779][_0xa757('0x32')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x33')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x34')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x2d')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x35')]=0x0;_0x471e84[_0x5b4779][_0xa757('0x36')]=!![];}}}}Realtime[_0xa757('0x37')][_0xa757('0x38')]=function(_0x112282,_0x384424){for(var _0x1f5d5a in _0x384424){if(_0x112282[_0xa757('0x25')](_0x1f5d5a)){_0x112282[_0x1f5d5a]=_0x384424[_0x1f5d5a];}}};Realtime[_0xa757('0x37')][_0xa757('0x39')]=function(){var _0x27be88=this;return function(_0xc1cc20){if(_0xc1cc20){freeIsNotKeyAgent(_0xc1cc20,_0x27be88[_0xa757('0xf')]);for(var _0x1ad384=0x0,_0x1eacde={};_0x1ad384<_0xc1cc20[_0xa757('0x3a')];_0x1ad384+=0x1){_0x1eacde=_0xc1cc20[_0x1ad384];var _0x3de18f=_[_0xa757('0x22')](_0x1eacde[_0xa757('0x23')])?util[_0xa757('0x20')]('SIP/%s',_0x1eacde[_0xa757('0x24')]):_0x1eacde[_0xa757('0x23')];if(_[_0xa757('0x3b')](_0x27be88[_0xa757('0xf')][_0x3de18f])){_0x27be88[_0xa757('0xf')][_0x3de18f]=new Agent(_0x1eacde);}else{_0x27be88['mergeFromDatabase'](_0x27be88[_0xa757('0xf')][_0x3de18f],_0x1eacde);}}}return _0x27be88[_0xa757('0xf')];};};Realtime[_0xa757('0x37')][_0xa757('0x3c')]=function(){var _0xd54446=this;return function(_0xc97cb8){if(_0xc97cb8){freeIsNotKeySip(_0xc97cb8,_0xd54446['telephones']);for(var _0x1346c2=0x0,_0x444639={};_0x1346c2<_0xc97cb8[_0xa757('0x3a')];_0x1346c2+=0x1){_0x444639=_0xc97cb8[_0x1346c2];if(_[_0xa757('0x3b')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639[_0xa757('0x24')])])){_0xd54446[_0xa757('0x10')][util['format'](_0xa757('0x21'),_0x444639[_0xa757('0x24')])]=new Telephone(_0x444639);}else{_0xd54446[_0xa757('0x38')](_0xd54446[_0xa757('0x10')][util[_0xa757('0x20')](_0xa757('0x21'),_0x444639['name'])],_0x444639);}}}return _0xd54446[_0xa757('0x10')];};};Realtime[_0xa757('0x37')]['initTrunks']=function(){var _0x5eae0b=this;return function(_0x9607af){if(_0x9607af){freeIsNotKeySip(_0x9607af,_0x5eae0b[_0xa757('0x11')]);for(var _0x5b11fe=0x0,_0x51c3d1={};_0x5b11fe<_0x9607af[_0xa757('0x3a')];_0x5b11fe+=0x1){_0x51c3d1=_0x9607af[_0x5b11fe];if(_[_0xa757('0x3b')](_0x5eae0b[_0xa757('0x11')][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])])){_0x5eae0b[_0xa757('0x11')][util[_0xa757('0x20')](_0xa757('0x21'),_0x51c3d1['name'])]=new Trunk(_0x51c3d1);}else{_0x5eae0b[_0xa757('0x38')](_0x5eae0b['trunks'][util['format'](_0xa757('0x21'),_0x51c3d1[_0xa757('0x24')])],_0x51c3d1);}}}return _0x5eae0b[_0xa757('0x11')];};};Realtime[_0xa757('0x37')][_0xa757('0x3d')]=function(){var _0x5d347c=this;return function(_0x5d25bb){if(_0x5d25bb){freeIsNotKey(_0x5d25bb,_0x5d347c[_0xa757('0x13')],'id');for(var _0x129d77=0x0,_0x2b171c={};_0x129d77<_0x5d25bb[_0xa757('0x3a')];_0x129d77+=0x1){_0x2b171c=_0x5d25bb[_0x129d77];if(_[_0xa757('0x3b')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']])){_0x5d347c['triggers'][_0x2b171c['id']]=new Trigger(_0x2b171c);}else{_0x5d347c[_0xa757('0x38')](_0x5d347c[_0xa757('0x13')][_0x2b171c['id']],_0x2b171c);}}}return _0x5d347c['triggers'];};};Realtime[_0xa757('0x37')]['initTemplates']=function(){var _0x2d111e=this;return function(_0x4518dc){if(_0x4518dc){freeIsNotKey(_0x4518dc,_0x2d111e['templates'],'id');for(var _0x267d68=0x0,_0x23efad={};_0x267d68<_0x4518dc['length'];_0x267d68+=0x1){_0x23efad=_0x4518dc[_0x267d68];if(_[_0xa757('0x3b')](_0x2d111e[_0xa757('0x15')][_0x23efad['id']])){_0x2d111e[_0xa757('0x15')][_0x23efad['id']]=new Template(_0x23efad);}else{_0x2d111e[_0xa757('0x38')](_0x2d111e['templates'][_0x23efad['id']],_0x23efad);}}}return _0x2d111e[_0xa757('0x15')];};};Realtime[_0xa757('0x37')][_0xa757('0x3e')]=function(){var _0xec4610=this;return function(_0x4d7493){if(_0x4d7493){freeIsNotKey(_0x4d7493,_0xec4610[_0xa757('0x3f')],'id');for(var _0x5b6017=0x0,_0x50c131={};_0x5b6017<_0x4d7493[_0xa757('0x3a')];_0x5b6017+=0x1){_0x50c131=_0x4d7493[_0x5b6017];if(_[_0xa757('0x3b')](_0xec4610[_0xa757('0x3f')][_0x50c131['id']])){_0xec4610['zendeskAccounts'][_0x50c131['id']]=new ZendeskAccount(_0x50c131);}else{_0xec4610[_0xa757('0x38')](_0xec4610['zendeskAccounts'][_0x50c131['id']],_0x50c131);}}}return _0xec4610[_0xa757('0x3f')];};};Realtime[_0xa757('0x37')][_0xa757('0x40')]=function(){var _0xbef575=this;return function(_0x18b0ca){if(_0x18b0ca){freeIsNotKey(_0x18b0ca,_0xbef575[_0xa757('0x17')],'id');for(var _0x57bf73=0x0,_0x505cd={};_0x57bf73<_0x18b0ca['length'];_0x57bf73+=0x1){_0x505cd=_0x18b0ca[_0x57bf73];if(_[_0xa757('0x3b')](_0xbef575[_0xa757('0x17')][_0x505cd['id']])){_0xbef575[_0xa757('0x17')][_0x505cd['id']]=new SalesforceAccount(_0x505cd);}else{_0xbef575[_0xa757('0x38')](_0xbef575[_0xa757('0x17')][_0x505cd['id']],_0x505cd);}}}return _0xbef575[_0xa757('0x17')];};};Realtime[_0xa757('0x37')][_0xa757('0x41')]=function(){var _0x405397=this;return function(_0x1d05d7){if(_0x1d05d7){freeIsNotKey(_0x1d05d7,_0x405397[_0xa757('0x42')],'id');for(var _0x19ceef=0x0,_0x2367c7={};_0x19ceef<_0x1d05d7[_0xa757('0x3a')];_0x19ceef+=0x1){_0x2367c7=_0x1d05d7[_0x19ceef];if(_[_0xa757('0x3b')](_0x405397[_0xa757('0x42')][_0x2367c7['id']])){_0x405397['freshdeskAccounts'][_0x2367c7['id']]=new FreshdeskAccount(_0x2367c7);}else{_0x405397[_0xa757('0x38')](_0x405397['freshdeskAccounts'][_0x2367c7['id']],_0x2367c7);}}}return _0x405397[_0xa757('0x42')];};};Realtime[_0xa757('0x37')][_0xa757('0x43')]=function(){var _0x24c0ad=this;return function(_0x4cb461){if(_0x4cb461){freeIsNotKey(_0x4cb461,_0x24c0ad[_0xa757('0x18')],'id');for(var _0x1ee01e=0x0,_0x8614f9={};_0x1ee01e<_0x4cb461[_0xa757('0x3a')];_0x1ee01e+=0x1){_0x8614f9=_0x4cb461[_0x1ee01e];if(_['isUndefined'](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']])){_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']]=new ZohoAccount(_0x8614f9);}else{_0x24c0ad[_0xa757('0x38')](_0x24c0ad[_0xa757('0x18')][_0x8614f9['id']],_0x8614f9);}}}return _0x24c0ad[_0xa757('0x18')];};};Realtime[_0xa757('0x37')]['initDeskAccounts']=function(){var _0x485100=this;return function(_0x5d21c1){if(_0x5d21c1){freeIsNotKey(_0x5d21c1,_0x485100['deskAccounts'],'id');for(var _0x1d8742=0x0,_0x9b3779={};_0x1d8742<_0x5d21c1[_0xa757('0x3a')];_0x1d8742+=0x1){_0x9b3779=_0x5d21c1[_0x1d8742];if(_[_0xa757('0x3b')](_0x485100[_0xa757('0x19')][_0x9b3779['id']])){_0x485100[_0xa757('0x19')][_0x9b3779['id']]=new DeskAccount(_0x9b3779);}else{_0x485100['mergeFromDatabase'](_0x485100[_0xa757('0x19')][_0x9b3779['id']],_0x9b3779);}}}return _0x485100[_0xa757('0x19')];};};Realtime[_0xa757('0x37')][_0xa757('0x44')]=function(){var _0x48b578=this;return function(_0x26c74e){if(_0x26c74e){freeIsNotKey(_0x26c74e,_0x48b578[_0xa757('0x45')],'id');for(var _0x4af840=0x0,_0x39699d={};_0x4af840<_0x26c74e['length'];_0x4af840+=0x1){_0x39699d=_0x26c74e[_0x4af840];if(_[_0xa757('0x3b')](_0x48b578['sugarcrmAccounts'][_0x39699d['id']])){_0x48b578[_0xa757('0x45')][_0x39699d['id']]=new SugarcrmAccount(_0x39699d);}else{_0x48b578['mergeFromDatabase'](_0x48b578['sugarcrmAccounts'][_0x39699d['id']],_0x39699d);}}}return _0x48b578[_0xa757('0x45')];};};Realtime[_0xa757('0x37')][_0xa757('0x46')]=function(){var _0x1b5db5=this;return function(_0x14e226){if(_0x14e226){freeIsNotKey(_0x14e226,_0x1b5db5[_0xa757('0x1a')],'id');for(var _0x4c19a6=0x0,_0x4f0d7b={};_0x4c19a6<_0x14e226[_0xa757('0x3a')];_0x4c19a6+=0x1){_0x4f0d7b=_0x14e226[_0x4c19a6];if(_[_0xa757('0x3b')](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']])){_0x1b5db5['vtigerAccounts'][_0x4f0d7b['id']]=new VtigerAccount(_0x4f0d7b);}else{_0x1b5db5['mergeFromDatabase'](_0x1b5db5[_0xa757('0x1a')][_0x4f0d7b['id']],_0x4f0d7b);}}}return _0x1b5db5[_0xa757('0x1a')];};};Realtime[_0xa757('0x37')][_0xa757('0x47')]=function(){var _0x12b802=this;return function(_0x3e6d40){if(_0x3e6d40){freeIsNotKey(_0x3e6d40,_0x12b802['servicenowAccounts'],'id');for(var _0x466728=0x0,_0x45f2a4={};_0x466728<_0x3e6d40[_0xa757('0x3a')];_0x466728+=0x1){_0x45f2a4=_0x3e6d40[_0x466728];if(_[_0xa757('0x3b')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']])){_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']]=new ServicenowAccount(_0x45f2a4);}else{_0x12b802[_0xa757('0x38')](_0x12b802[_0xa757('0x1b')][_0x45f2a4['id']],_0x45f2a4);}}}return _0x12b802[_0xa757('0x1b')];};};Realtime[_0xa757('0x37')]['initDynamics365Accounts']=function(){var _0x9e96e6=this;return function(_0x5c803a){if(_0x5c803a){freeIsNotKey(_0x5c803a,_0x9e96e6['dynamics365Accounts'],'id');for(var _0x40ce42=0x0,_0x3da8c1={};_0x40ce42<_0x5c803a[_0xa757('0x3a')];_0x40ce42+=0x1){_0x3da8c1=_0x5c803a[_0x40ce42];if(_[_0xa757('0x3b')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']])){_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']]=new Dynamics365Account(_0x3da8c1);}else{_0x9e96e6[_0xa757('0x38')](_0x9e96e6[_0xa757('0x1c')][_0x3da8c1['id']],_0x3da8c1);}}}return _0x9e96e6[_0xa757('0x1c')];};};Realtime[_0xa757('0x37')][_0xa757('0x48')]=function(){var _0x4fc507=this;return function(_0x3f8c5c){if(_0x3f8c5c){freeIsNotKey(_0x3f8c5c,_0x4fc507[_0xa757('0x1d')],'id');for(var _0x5f0b71=0x0,_0x11ebb3={};_0x5f0b71<_0x3f8c5c[_0xa757('0x3a')];_0x5f0b71+=0x1){_0x11ebb3=_0x3f8c5c[_0x5f0b71];if(_[_0xa757('0x3b')](_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']])){_0x4fc507[_0xa757('0x1d')][_0x11ebb3['id']]=new FreshsalesAccount(_0x11ebb3);}else{_0x4fc507[_0xa757('0x38')](_0x4fc507['freshsalesAccounts'][_0x11ebb3['id']],_0x11ebb3);}}}return _0x4fc507[_0xa757('0x1d')];};};Realtime['prototype'][_0xa757('0x49')]=function(){var _0x3250d0=this;return function(_0x2d9d97){for(var _0x3c87c0=0x0;_0x3c87c0<_0x2d9d97[_0xa757('0x3a')];_0x3c87c0+=0x1){_['merge'](_0x3250d0['voiceQueues'][_0x2d9d97[_0x3c87c0][_0xa757('0x24')]],_0x2d9d97[_0x3c87c0]);}return _0x3250d0[_0xa757('0x12')];};};Realtime[_0xa757('0x37')]['initVoiceQueueReports']=function(){var _0x115a94=this;return function(_0x55bc0f){clearVoiceQueues(_0x115a94[_0xa757('0x12')]);if(_0x55bc0f){_0x55bc0f=_[_0xa757('0x4a')](_0x55bc0f,_0xa757('0x4b'));for(var _0xbf1bbf in _0x55bc0f){if(_0x55bc0f[_0xa757('0x25')](_0xbf1bbf)){for(var _0x40a79b=0x0;_0x40a79b<_0x55bc0f[_0xbf1bbf]['length'];_0x40a79b+=0x1){var _0xa28144=_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4c')];if(_0x115a94[_0xa757('0x12')][_0xa28144]){if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4d')]){_0x115a94[_0xa757('0x12')][_0xa28144]['unmanaged']+=0x1;}if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x4e')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x4f')]+=0x1;}_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt'])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;if(_0x40a79b===_0x55bc0f[_0xbf1bbf]['length']-0x1){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x27')]+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x54')]||_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x55')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x51')]),_0xa757('0x52'))||0x0;_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x56')]+=0x1;if(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x57')]){_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x26')]+=0x1;_0x115a94[_0xa757('0x12')][_0xa28144]['sumBillable']+=moment(_0x55bc0f[_0xbf1bbf][_0x40a79b][_0xa757('0x53')])[_0xa757('0x50')](moment(_0x55bc0f[_0xbf1bbf][_0x40a79b]['queuecallerleaveAt']),_0xa757('0x52'))||0x0;}}else{_0x115a94[_0xa757('0x12')][_0xa28144]['sumDuration']+=_0x115a94[_0xa757('0x12')][_0xa28144][_0xa757('0x2b')]||0x0;}}}}}}return _0x115a94[_0xa757('0x12')];};};Realtime[_0xa757('0x37')][_0xa757('0x58')]=function(){var _0x312542=this;return function(_0xdb2ac6){clearVoiceCallReports(_0x312542[_0xa757('0x59')]);if(_0xdb2ac6){for(var _0x1f74af=0x0;_0x1f74af<_0xdb2ac6[_0xa757('0x3a')];_0x1f74af+=0x1){_0x312542[_0xa757('0x59')][_0xa757('0x56')]+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x27')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')];if(_0xdb2ac6[_0x1f74af][_0xa757('0x5b')]==='ANSWERED'){_0x312542[_0xa757('0x59')]['answered']+=0x1;_0x312542[_0xa757('0x59')][_0xa757('0x2b')]+=_0xdb2ac6[_0x1f74af][_0xa757('0x5a')]-_0xdb2ac6[_0x1f74af][_0xa757('0x5c')]||0x0;_0x312542[_0xa757('0x59')]['sumBillable']+=_0xdb2ac6[_0x1f74af][_0xa757('0x5c')];}}}return _0x312542[_0xa757('0x59')];};};Realtime[_0xa757('0x37')]['initCampaigns']=function(){var _0x3317d8=this;return function(_0x3619ec){if(_0x3619ec){freeIsNotKey(_0x3619ec,_0x3317d8[_0xa757('0x14')],'name');for(var _0x501134=0x0,_0x1f437d={};_0x501134<_0x3619ec[_0xa757('0x3a')];_0x501134+=0x1){_0x1f437d=_0x3619ec[_0x501134];if(_[_0xa757('0x3b')](_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]])){_0x3317d8['campaigns'][_0x1f437d['name']]=new Campaign(_0x1f437d);}else{_0x3317d8[_0xa757('0x38')](_0x3317d8[_0xa757('0x14')][_0x1f437d[_0xa757('0x24')]],_0x1f437d);_0x3317d8['campaigns'][_0x1f437d[_0xa757('0x24')]][_0xa757('0x5d')]=_0x1f437d[_0xa757('0x5e')]?_0x1f437d[_0xa757('0x5e')][_0xa757('0x24')]:undefined;}}}return _0x3317d8[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x5f')]=function(){var _0xe38e76=this;return function(_0x35c1aa){if(_0x35c1aa){freeIsNotKey(_0x35c1aa,_0xe38e76[_0xa757('0x60')],'id');for(var _0xafcf19=0x0,_0x5a7042={};_0xafcf19<_0x35c1aa[_0xa757('0x3a')];_0xafcf19+=0x1){_0x5a7042=_0x35c1aa[_0xafcf19];if(_[_0xa757('0x3b')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']])){_0xe38e76[_0xa757('0x60')][_0x5a7042['id']]=new VoiceExtension(_0x5a7042);}else{_0xe38e76[_0xa757('0x38')](_0xe38e76[_0xa757('0x60')][_0x5a7042['id']],_0x5a7042);}}}return _0xe38e76[_0xa757('0x60')];};};Realtime[_0xa757('0x37')][_0xa757('0x61')]=function(){var _0x2d34b7=this;return function(_0x3997f8){clearCampaigns(_0x2d34b7[_0xa757('0x14')]);for(var _0x132033=0x0;_0x132033<_0x3997f8[_0xa757('0x3a')];_0x132033+=0x1){_[_0xa757('0x62')](_0x2d34b7[_0xa757('0x14')][_0x3997f8[_0x132033][_0xa757('0x24')]],_0x3997f8[_0x132033]);}return _0x2d34b7[_0xa757('0x14')];};};Realtime[_0xa757('0x37')][_0xa757('0x63')]=function(){var _0x1bcb2e=this;return function(_0x20ea21){if(_0x20ea21){freeIsNotKey(_0x20ea21,_0x1bcb2e['faxAccounts'],'id');for(var _0x768a79=0x0,_0x39c52a={};_0x768a79<_0x20ea21['length'];_0x768a79+=0x1){_0x39c52a=_0x20ea21[_0x768a79];if(_[_0xa757('0x3b')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']])){_0x1bcb2e[_0xa757('0x1e')][_0x39c52a['id']]=new FaxAccount(_0x39c52a);}else{_0x1bcb2e[_0xa757('0x38')](_0x1bcb2e['faxAccounts'][_0x39c52a['id']],_0x39c52a);}}}return _0x1bcb2e[_0xa757('0x1e')];};};Realtime[_0xa757('0x37')][_0xa757('0x64')]=function(){var _0x7ba6b3=this;return function(_0x535ff7){if(_0x535ff7){freeIsNotKey(_0x535ff7,_0x7ba6b3[_0xa757('0x12')],_0xa757('0x24'));for(var _0x4bf5c2=0x0,_0x30716a={};_0x4bf5c2<_0x535ff7[_0xa757('0x3a')];_0x4bf5c2+=0x1){_0x30716a=_0x535ff7[_0x4bf5c2];if(_['isUndefined'](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]])){_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]]=new VoiceQueue(_0x30716a);}else{_0x7ba6b3[_0xa757('0x38')](_0x7ba6b3[_0xa757('0x12')][_0x30716a[_0xa757('0x24')]],_0x30716a);}}}return _0x7ba6b3[_0xa757('0x12')];};};module[_0xa757('0x65')]=Realtime;
\ No newline at end of file
+var _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x5a8583,_0x5b6da2){var _0x43b22f=function(_0x4b0cf4){while(--_0x4b0cf4){_0x5a8583['push'](_0x5a8583['shift']());}};_0x43b22f(++_0x5b6da2);}(_0xadb5,0xad));var _0x5adb=function(_0x3d40c8,_0x4413b9){_0x3d40c8=_0x3d40c8-0x0;var _0x424d80=_0xadb5[_0x3d40c8];return _0x424d80;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime;
\ No newline at end of file
index 87c3d0a..d104d5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a5a=['assign','hasOwnProperty','mergeDBDataToRealtime'];(function(_0x19527a,_0x1857f6){var _0x95df0a=function(_0x518ae8){while(--_0x518ae8){_0x19527a['push'](_0x19527a['shift']());}};_0x95df0a(++_0x1857f6);}(_0x1a5a,0x114));var _0xa1a5=function(_0x5c5fe7,_0x2a64eb){_0x5c5fe7=_0x5c5fe7-0x0;var _0xd817f=_0x1a5a[_0x5c5fe7];return _0xd817f;};'use strict';function mergeDBDataToRealtime(_0x1932df,_0x356780){var _0x27d75c=Object[_0xa1a5('0x0')]({},_0x1932df);for(var _0x447f87 in _0x356780){if(_0x27d75c[_0xa1a5('0x1')](_0x447f87)){_0x27d75c[_0x447f87]=_0x356780[_0x447f87];}}return _0x27d75c;}exports[_0xa1a5('0x2')]=mergeDBDataToRealtime;
\ No newline at end of file
+var _0xf6b0=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x1944f0,_0x4922e9){var _0x56f508=function(_0x5eb98f){while(--_0x5eb98f){_0x1944f0['push'](_0x1944f0['shift']());}};_0x56f508(++_0x4922e9);}(_0xf6b0,0x17a));var _0x0f6b=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xf6b0[_0x45d3f0];return _0x314b79;};'use strict';function mergeDBDataToRealtime(_0x26888e,_0x24863d){var _0x38575e=Object['assign']({},_0x26888e);for(var _0x2d291e in _0x24863d){if(_0x38575e[_0x0f6b('0x0')](_0x2d291e)){_0x38575e[_0x2d291e]=_0x24863d[_0x2d291e];}}return _0x38575e;}exports[_0x0f6b('0x1')]=mergeDBDataToRealtime;
\ No newline at end of file
index d8d77e6..484a674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef74=['createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','format','SIP/%s','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','getAgentByInternal','keys','getCallType','channel','internal','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','calleridnum','disposition','ANSWERED','calleridname','transfers','transfereelinkedid','uniqueid','linkedid','UserId','split','monitor','monitors','monitorFilename','filename'];(function(_0x29b183,_0xceba7a){var _0x49960a=function(_0xea2952){while(--_0xea2952){_0x29b183['push'](_0x29b183['shift']());}};_0x49960a(++_0xceba7a);}(_0xef74,0x132));var _0x4ef7=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xef74[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x4ef7('0x0'));var moment=require(_0x4ef7('0x1'));var util=require(_0x4ef7('0x2'));var config=require(_0x4ef7('0x3'));var ami=require(_0x4ef7('0x4'));var RpcVoiceAgentReport=require(_0x4ef7('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x4ef7('0x6'));var RpcMemberReport=require(_0x4ef7('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x4ef7('0x8'));var RpcVoiceTransferReport=require(_0x4ef7('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x4ef7('0xa'));var VoiceAgentReport=require(_0x4ef7('0xb'));var VoiceDialReport=require(_0x4ef7('0xc'));var UserReport=require(_0x4ef7('0xd'));function Report(_0x39bd9f){this['realtime']=_0x39bd9f;this['agents']=_0x39bd9f[_0x4ef7('0xe')];this['telephones']=_0x39bd9f[_0x4ef7('0xf')];}Report['prototype']['sync']=function(_0x366b5c){var _0x3acd56=new VoiceQueueReport(this[_0x4ef7('0x10')]);var _0x5539c4=new VoiceAgentReport(this[_0x4ef7('0x10')]);var _0x42c7dd=new VoiceDialReport(this[_0x4ef7('0x10')]);var _0x1b37d4=new VoiceCallReport(this['realtime']);var _0x218093=new UserReport(this[_0x4ef7('0x10')]);if(config[_0x4ef7('0x11')]&&config[_0x4ef7('0x11')][_0x4ef7('0x12')]){ami['on'](_0x4ef7('0x13'),this[_0x4ef7('0x14')][_0x4ef7('0x15')](this));ami['on'](_0x4ef7('0x16'),this[_0x4ef7('0x17')][_0x4ef7('0x15')](this));ami['on']('custom:voiceAgentReport',this[_0x4ef7('0x18')][_0x4ef7('0x15')](this));ami['on'](_0x4ef7('0x19'),this[_0x4ef7('0x1a')][_0x4ef7('0x15')](this));ami['on'](_0x4ef7('0x1b'),this['blindTransfer'][_0x4ef7('0x15')](this));ami['on'](_0x4ef7('0x1c'),this[_0x4ef7('0x1d')][_0x4ef7('0x15')](this));}};Report[_0x4ef7('0x1e')][_0x4ef7('0x1f')]=function(_0x314080){var _0x274084;_0x274084=_[_0x4ef7('0x20')](this[_0x4ef7('0xe')],function(_0x178590){return _0x178590['accountcode']==_0x314080||_0x178590[_0x4ef7('0x21')]==_0x314080;});if(_[_0x4ef7('0x22')](_0x274084)){var _0xc6e750=_['find'](this['telephones'],function(_0x14c115){return _0x14c115[_0x4ef7('0x23')]==_0x314080||_0x14c115['name']==_0x314080;});if(_0xc6e750){_0x274084=_['find'](this[_0x4ef7('0xe')],function(_0x46f8f8){return _0x46f8f8[_0x4ef7('0x24')]==util[_0x4ef7('0x25')](_0x4ef7('0x26'),_0xc6e750[_0x4ef7('0x21')]);});}}return _0x274084;};Report[_0x4ef7('0x1e')][_0x4ef7('0x14')]=function(_0x280fc0){for(var _0x2f80bd=0x0;_0x2f80bd<_0x280fc0[_0x4ef7('0x27')];_0x2f80bd+=0x1){var _0x94886e=this['findAgent'](_0x280fc0[_0x2f80bd][_0x4ef7('0x28')]);if(_0x94886e){_0x280fc0[_0x2f80bd]['accountcode']=_0x94886e[_0x4ef7('0x23')];_0x280fc0[_0x2f80bd]['assigned']=!![];_0x280fc0[_0x2f80bd][_0x4ef7('0x29')]=_0x94886e[_0x4ef7('0x21')];_0x280fc0[_0x2f80bd]['interface']=_[_0x4ef7('0x22')](_0x94886e[_0x4ef7('0x24')])?util['format'](_0x4ef7('0x26'),_0x94886e['name']):_0x94886e[_0x4ef7('0x24')];if(_0x280fc0[_0x2f80bd][_0x4ef7('0x2a')]){_0x280fc0[_0x2f80bd][_0x4ef7('0x2b')]=moment()[_0x4ef7('0x25')](_0x4ef7('0x2c'));}if(_0x280fc0[_0x2f80bd][_0x4ef7('0x2d')]){_0x280fc0[_0x2f80bd]['queuecallerexitAt']=moment()[_0x4ef7('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x280fc0[_0x2f80bd]);}RpcVoiceQueueReport[_0x4ef7('0x2e')](_0x280fc0[_0x2f80bd]);}};function extractCalleridNumber(_0x30091f){var _0x5a7703=_0x30091f[_0x4ef7('0x2f')](/<(.*?)>/);return _0x5a7703?_0x5a7703[0x1]:_0x30091f;}Report[_0x4ef7('0x1e')][_0x4ef7('0x30')]=function(_0x484316){for(var _0x1aa87c=0x0;_0x1aa87c<Object[_0x4ef7('0x31')](this[_0x4ef7('0xe')])[_0x4ef7('0x27')];_0x1aa87c++){var _0x53b6ee=Object['keys'](this[_0x4ef7('0xe')])[_0x1aa87c];var _0x116b2c=this[_0x4ef7('0xe')][_0x53b6ee];if(_0x116b2c[_0x4ef7('0x23')]===Number(_0x484316))return _0x116b2c;}return null;};Report[_0x4ef7('0x1e')][_0x4ef7('0x32')]=function(_0x3f9911){var _0x33fbcf=_0x3f9911[_0x4ef7('0x33')]['split']('-')[0x0];var _0x2d7001=this['agents'][_0x33fbcf];if(!_0x2d7001)_0x2d7001=this[_0x4ef7('0x30')](_0x3f9911['calleridnum']);return!_0x2d7001?'outbound':_0x4ef7('0x34');};Report[_0x4ef7('0x1e')]['voiceCallReport']=function(_0x26665a){_0x26665a['destination']=_0x26665a[_0x4ef7('0x35')]||_0x26665a[_0x4ef7('0x36')];if(_0x26665a[_0x4ef7('0x37')]==_0x4ef7('0x38')){_0x26665a[_0x4ef7('0x39')]=_0x4ef7('0x3a');_0x26665a[_0x4ef7('0x3b')]=_0x26665a[_0x4ef7('0x3a')];if(_0x26665a[_0x4ef7('0x3c')]==_0x4ef7('0x3d')){_0x26665a[_0x4ef7('0x23')]='';_0x26665a[_0x4ef7('0x35')]=extractCalleridNumber(_0x26665a[_0x4ef7('0x3e')]);}else if(_0x26665a[_0x4ef7('0x3c')]==_0x4ef7('0x3f')){if(_0x26665a[_0x4ef7('0x35')]==_0x4ef7('0x40')){_0x26665a['destination']=extractCalleridNumber(_0x26665a[_0x4ef7('0x41')]);_0x26665a['calleridnum']=_0x26665a[_0x4ef7('0x42')];_0x26665a[_0x4ef7('0x43')]=[_0x26665a['channel'],_0x26665a[_0x4ef7('0x33')]=_0x26665a[_0x4ef7('0x43')]][0x0];_0x26665a[_0x4ef7('0x3e')]=_0x26665a[_0x4ef7('0x41')];}else{_0x26665a[_0x4ef7('0x35')]=_0x26665a[_0x4ef7('0x44')];_0x26665a[_0x4ef7('0x44')]=_0x26665a['originatecalleridnum'];if(_0x26665a[_0x4ef7('0x45')]==_0x4ef7('0x46')){_0x26665a[_0x4ef7('0x23')]=_0x26665a[_0x4ef7('0x28')];}else{_0x26665a[_0x4ef7('0x23')]='';}}}}else{_0x26665a[_0x4ef7('0x3e')]=util[_0x4ef7('0x25')]('\x22%s\x22\x20<%s>',_0x26665a[_0x4ef7('0x47')],_0x26665a[_0x4ef7('0x44')]);}if(RpcVoiceTransferReport[_0x4ef7('0x48')][_0x26665a['linkedid']]){var _0x49dd19=RpcVoiceTransferReport[_0x4ef7('0x48')][_0x26665a['linkedid']];_0x49dd19[_0x4ef7('0x49')]=_0x26665a[_0x4ef7('0x4a')];RpcVoiceTransferReport['blindTransfer'](_0x49dd19);delete RpcVoiceTransferReport[_0x4ef7('0x48')][_0x26665a[_0x4ef7('0x4b')]];}if(_[_0x4ef7('0x22')](_0x26665a[_0x4ef7('0x37')])){_0x26665a[_0x4ef7('0x37')]=this[_0x4ef7('0x32')](_0x26665a);}if(_[_0x4ef7('0x22')](_0x26665a[_0x4ef7('0x4c')])){var _0x5df507=_0x26665a[_0x4ef7('0x33')][_0x4ef7('0x4d')]('-')[0x0];var _0x5d790b=this[_0x4ef7('0xe')][_0x5df507];if(!_0x5d790b)_0x5d790b=this['getAgentByInternal'](_0x26665a[_0x4ef7('0x23')]);if(_0x5d790b){_0x26665a['UserId']=_0x5d790b['id'];_0x26665a['membername']=_0x5d790b[_0x4ef7('0x21')];}}RpcVoiceCallReport[_0x4ef7('0x2e')](_0x26665a);if(_0x26665a[_0x4ef7('0x4e')]){for(var _0x52ce38=0x0;_0x52ce38<_0x26665a[_0x4ef7('0x4f')][_0x4ef7('0x27')];_0x52ce38+=0x1){_0x26665a[_0x4ef7('0x50')]=_0x26665a[_0x4ef7('0x4f')][_0x52ce38][_0x4ef7('0x51')];_0x26665a[_0x4ef7('0x52')]=_0x26665a['monitors'][_0x52ce38][_0x4ef7('0x52')];if(_0x26665a[_0x4ef7('0x36')]==_0x4ef7('0x40')){_0x26665a[_0x4ef7('0x44')]=_0x26665a[_0x4ef7('0x28')];_0x26665a['calleridname']=_0x26665a[_0x4ef7('0x53')];_0x26665a['connectedlinenum']=_0x26665a[_0x4ef7('0x23')];_0x26665a[_0x4ef7('0x53')]=_0x26665a['membername'];_0x26665a[_0x4ef7('0x36')]=_0x26665a[_0x4ef7('0x42')];}else if(_0x26665a[_0x4ef7('0x36')]==_0x4ef7('0x54')){_0x26665a['calleridnum']=_0x26665a[_0x4ef7('0x35')];_0x26665a[_0x4ef7('0x36')]=_0x26665a[_0x4ef7('0x42')];}RpcVoiceRecording['create'](_0x26665a);}}};Report[_0x4ef7('0x1e')][_0x4ef7('0x18')]=function(_0x391f51){if(_[_0x4ef7('0x55')](_0x391f51)){_0x391f51[_0x4ef7('0x56')](function(_0x3e3a9d){RpcVoiceAgentReport['create'](_0x3e3a9d);});}else{RpcVoiceAgentReport[_0x4ef7('0x2e')](_0x391f51);}};Report['prototype']['voiceDialReport']=function(_0x1e57bd){RpcVoiceDialReport[_0x4ef7('0x2e')](_0x1e57bd);var _0x3df7a0;var _0x1565de;var _0x47956f=_0x1e57bd[_0x4ef7('0x33')];if(_[_0x4ef7('0x57')](_0x47956f,_0x4ef7('0x58'))){_0x1565de=_0x47956f[_0x4ef7('0x59')](_0x47956f['indexOf']('/')+0x1,_0x47956f[_0x4ef7('0x5a')]('@'));_0x3df7a0=_[_0x4ef7('0x20')](this['agents'],function(_0x578096){return _0x578096[_0x4ef7('0x5b')]==_0x1565de||_0x578096[_0x4ef7('0x5c')]==_0x1565de||_0x578096[_0x4ef7('0x23')]==_0x1565de;});}else{_0x1565de=_0x47956f[_0x4ef7('0x59')](_0x47956f['indexOf']('/')+0x1,_0x47956f[_0x4ef7('0x5d')]('-'));_0x3df7a0=this[_0x4ef7('0x1f')](_0x1565de);}if(_0x3df7a0){_0x1e57bd['interface']=_[_0x4ef7('0x22')](_0x3df7a0['interface'])?util[_0x4ef7('0x25')](_0x4ef7('0x26'),_0x3df7a0['name']):_0x3df7a0[_0x4ef7('0x24')];_0x1e57bd[_0x4ef7('0x5e')]=_0x3df7a0[_0x4ef7('0x21')];_0x1e57bd[_0x4ef7('0x23')]=_0x3df7a0[_0x4ef7('0x23')];RpcMemberReport[_0x4ef7('0x1a')](_0x1e57bd);}};Report[_0x4ef7('0x1e')]['blindTransfer']=function(_0x4847e8){RpcVoiceTransferReport[_0x4ef7('0x48')][_0x4847e8[_0x4ef7('0x5f')]]=_0x4847e8;};Report[_0x4ef7('0x1e')][_0x4ef7('0x1d')]=function(_0x5c8fd4){RpcVoiceTransferReport[_0x4ef7('0x1d')](_0x5c8fd4);};module[_0x4ef7('0x60')]=Report;
\ No newline at end of file
+var _0x15fe=['getAgentByInternal','calleridnum','outbound','internal','destination','exten','dialer','lastapplication','queue','context','destinationchannel','callerid','calleridpreview','originatecalleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','type','getCallType','split','UserId','membername','monitor','monitors','monitorFilename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','../../../config/environment','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','keys','channel'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x15fe,0x87));var _0xe15f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x15fe[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe15f('0x0'));var moment=require(_0xe15f('0x1'));var util=require('util');var config=require(_0xe15f('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xe15f('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xe15f('0x4'));var RpcVoiceRecording=require(_0xe15f('0x5'));var RpcVoiceTransferReport=require(_0xe15f('0x6'));var VoiceQueueReport=require(_0xe15f('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xe15f('0x8'));var VoiceDialReport=require(_0xe15f('0x9'));var UserReport=require(_0xe15f('0xa'));function Report(_0x5eecb8){this[_0xe15f('0xb')]=_0x5eecb8;this[_0xe15f('0xc')]=_0x5eecb8[_0xe15f('0xc')];this['telephones']=_0x5eecb8[_0xe15f('0xd')];}Report[_0xe15f('0xe')][_0xe15f('0xf')]=function(_0x14789d){var _0x1a53c1=new VoiceQueueReport(this['realtime']);var _0x587aca=new VoiceAgentReport(this[_0xe15f('0xb')]);var _0x2073eb=new VoiceDialReport(this[_0xe15f('0xb')]);var _0x5963d6=new VoiceCallReport(this[_0xe15f('0xb')]);var _0x1f804e=new UserReport(this[_0xe15f('0xb')]);if(config[_0xe15f('0x10')]&&config[_0xe15f('0x10')][_0xe15f('0x11')]){ami['on'](_0xe15f('0x12'),this[_0xe15f('0x13')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x15'),this[_0xe15f('0x16')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x17'),this[_0xe15f('0x18')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x19'),this[_0xe15f('0x1a')][_0xe15f('0x14')](this));ami['on'](_0xe15f('0x1b'),this[_0xe15f('0x1c')][_0xe15f('0x14')](this));ami['on']('attendedtransfer',this[_0xe15f('0x1d')]['bind'](this));}};Report[_0xe15f('0xe')][_0xe15f('0x1e')]=function(_0x71e3e6){var _0x421860;_0x421860=_[_0xe15f('0x1f')](this[_0xe15f('0xc')],function(_0x2d34b7){return _0x2d34b7[_0xe15f('0x20')]==_0x71e3e6||_0x2d34b7['name']==_0x71e3e6;});if(_[_0xe15f('0x21')](_0x421860)){var _0x4b56db=_[_0xe15f('0x1f')](this[_0xe15f('0xd')],function(_0x2ab97c){return _0x2ab97c['accountcode']==_0x71e3e6||_0x2ab97c[_0xe15f('0x22')]==_0x71e3e6;});if(_0x4b56db){_0x421860=_[_0xe15f('0x1f')](this[_0xe15f('0xc')],function(_0x118665){return _0x118665[_0xe15f('0x23')]==util[_0xe15f('0x24')](_0xe15f('0x25'),_0x4b56db[_0xe15f('0x22')]);});}}return _0x421860;};Report[_0xe15f('0xe')][_0xe15f('0x13')]=function(_0x7f1e80){for(var _0x596d3b=0x0;_0x596d3b<_0x7f1e80[_0xe15f('0x26')];_0x596d3b+=0x1){var _0x376bec=this[_0xe15f('0x1e')](_0x7f1e80[_0x596d3b][_0xe15f('0x27')]);if(_0x376bec){_0x7f1e80[_0x596d3b]['accountcode']=_0x376bec[_0xe15f('0x20')];_0x7f1e80[_0x596d3b][_0xe15f('0x28')]=!![];_0x7f1e80[_0x596d3b][_0xe15f('0x29')]=_0x376bec[_0xe15f('0x22')];_0x7f1e80[_0x596d3b][_0xe15f('0x23')]=_[_0xe15f('0x21')](_0x376bec[_0xe15f('0x23')])?util[_0xe15f('0x24')](_0xe15f('0x25'),_0x376bec[_0xe15f('0x22')]):_0x376bec[_0xe15f('0x23')];if(_0x7f1e80[_0x596d3b]['queuecallercomplete']){_0x7f1e80[_0x596d3b][_0xe15f('0x2a')]=moment()[_0xe15f('0x24')](_0xe15f('0x2b'));}if(_0x7f1e80[_0x596d3b]['queuecallerexit']){_0x7f1e80[_0x596d3b][_0xe15f('0x2c')]=moment()[_0xe15f('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xe15f('0x13')](_0x7f1e80[_0x596d3b]);}RpcVoiceQueueReport[_0xe15f('0x2d')](_0x7f1e80[_0x596d3b]);}};function extractCalleridNumber(_0x3e6f0b){var _0x52a4df=_0x3e6f0b[_0xe15f('0x2e')](/<(.*?)>/);return _0x52a4df?_0x52a4df[0x1]:_0x3e6f0b;}Report['prototype']['getAgentByInternal']=function(_0xb30bc4){for(var _0x38b167=0x0;_0x38b167<Object[_0xe15f('0x2f')](this['agents'])['length'];_0x38b167++){var _0x2ce635=Object['keys'](this[_0xe15f('0xc')])[_0x38b167];var _0x188bb2=this[_0xe15f('0xc')][_0x2ce635];if(_0x188bb2[_0xe15f('0x20')]===Number(_0xb30bc4))return _0x188bb2;}return null;};Report[_0xe15f('0xe')]['getCallType']=function(_0x55b869){var _0x30d40c=_0x55b869[_0xe15f('0x30')]['split']('-')[0x0];var _0x1e1d86=this[_0xe15f('0xc')][_0x30d40c];if(!_0x1e1d86)_0x1e1d86=this[_0xe15f('0x31')](_0x55b869[_0xe15f('0x32')]);return!_0x1e1d86?_0xe15f('0x33'):_0xe15f('0x34');};Report[_0xe15f('0xe')][_0xe15f('0x16')]=function(_0x282715){_0x282715['destination']=_0x282715[_0xe15f('0x35')]||_0x282715[_0xe15f('0x36')];if(_0x282715['type']==_0xe15f('0x37')){_0x282715[_0xe15f('0x38')]=_0xe15f('0x39');_0x282715['lastdata']=_0x282715[_0xe15f('0x39')];if(_0x282715[_0xe15f('0x3a')]=='from-voip-provider'){_0x282715['accountcode']='';_0x282715['destination']=extractCalleridNumber(_0x282715['callerid']);}else if(_0x282715['context']=='from-sip'){if(_0x282715[_0xe15f('0x35')]=='xcally-motion-preview'){_0x282715[_0xe15f('0x35')]=extractCalleridNumber(_0x282715['calleridpreview']);_0x282715[_0xe15f('0x32')]=_0x282715['originatecalleridnum'];_0x282715['destinationchannel']=[_0x282715['channel'],_0x282715[_0xe15f('0x30')]=_0x282715[_0xe15f('0x3b')]][0x0];_0x282715[_0xe15f('0x3c')]=_0x282715[_0xe15f('0x3d')];}else{_0x282715['destination']=_0x282715[_0xe15f('0x32')];_0x282715[_0xe15f('0x32')]=_0x282715[_0xe15f('0x3e')];if(_0x282715['disposition']==_0xe15f('0x3f')){_0x282715[_0xe15f('0x20')]=_0x282715[_0xe15f('0x27')];}else{_0x282715['accountcode']='';}}}}else{_0x282715[_0xe15f('0x3c')]=util[_0xe15f('0x24')](_0xe15f('0x40'),_0x282715[_0xe15f('0x41')],_0x282715[_0xe15f('0x32')]);}if(RpcVoiceTransferReport['transfers'][_0x282715[_0xe15f('0x42')]]){var _0x45b43d=RpcVoiceTransferReport[_0xe15f('0x43')][_0x282715[_0xe15f('0x42')]];_0x45b43d[_0xe15f('0x44')]=_0x282715[_0xe15f('0x45')];RpcVoiceTransferReport['blindTransfer'](_0x45b43d);delete RpcVoiceTransferReport[_0xe15f('0x43')][_0x282715[_0xe15f('0x42')]];}if(_[_0xe15f('0x21')](_0x282715[_0xe15f('0x46')])){_0x282715['type']=this[_0xe15f('0x47')](_0x282715);}if(_[_0xe15f('0x21')](_0x282715['UserId'])){var _0x410f46=_0x282715[_0xe15f('0x30')][_0xe15f('0x48')]('-')[0x0];var _0x5f0f95=this[_0xe15f('0xc')][_0x410f46];if(!_0x5f0f95)_0x5f0f95=this[_0xe15f('0x31')](_0x282715[_0xe15f('0x20')]);if(_0x5f0f95){_0x282715[_0xe15f('0x49')]=_0x5f0f95['id'];_0x282715[_0xe15f('0x4a')]=_0x5f0f95[_0xe15f('0x22')];}}RpcVoiceCallReport['create'](_0x282715);if(_0x282715[_0xe15f('0x4b')]){for(var _0x438983=0x0;_0x438983<_0x282715[_0xe15f('0x4c')]['length'];_0x438983+=0x1){_0x282715[_0xe15f('0x4d')]=_0x282715[_0xe15f('0x4c')][_0x438983]['filename'];_0x282715[_0xe15f('0x4e')]=_0x282715[_0xe15f('0x4c')][_0x438983][_0xe15f('0x4e')];if(_0x282715[_0xe15f('0x36')]==_0xe15f('0x4f')){_0x282715[_0xe15f('0x32')]=_0x282715[_0xe15f('0x27')];_0x282715[_0xe15f('0x41')]=_0x282715['connectedlinename'];_0x282715[_0xe15f('0x27')]=_0x282715['accountcode'];_0x282715[_0xe15f('0x50')]=_0x282715['membername'];_0x282715['exten']=_0x282715[_0xe15f('0x3e')];}else if(_0x282715[_0xe15f('0x36')]==_0xe15f('0x51')){_0x282715[_0xe15f('0x32')]=_0x282715[_0xe15f('0x35')];_0x282715[_0xe15f('0x36')]=_0x282715[_0xe15f('0x3e')];}RpcVoiceRecording[_0xe15f('0x2d')](_0x282715);}}};Report['prototype'][_0xe15f('0x18')]=function(_0xd85d58){if(_[_0xe15f('0x52')](_0xd85d58)){_0xd85d58[_0xe15f('0x53')](function(_0x41b2d0){RpcVoiceAgentReport[_0xe15f('0x2d')](_0x41b2d0);});}else{RpcVoiceAgentReport[_0xe15f('0x2d')](_0xd85d58);}};Report['prototype'][_0xe15f('0x1a')]=function(_0x627f33){RpcVoiceDialReport[_0xe15f('0x2d')](_0x627f33);var _0x6fb311;var _0x12387c;var _0x128a84=_0x627f33['channel'];if(_['startsWith'](_0x128a84,_0xe15f('0x54'))){_0x12387c=_0x128a84[_0xe15f('0x55')](_0x128a84[_0xe15f('0x56')]('/')+0x1,_0x128a84[_0xe15f('0x56')]('@'));_0x6fb311=_[_0xe15f('0x1f')](this[_0xe15f('0xc')],function(_0x50c6e9){return _0x50c6e9[_0xe15f('0x57')]==_0x12387c||_0x50c6e9[_0xe15f('0x58')]==_0x12387c||_0x50c6e9[_0xe15f('0x20')]==_0x12387c;});}else{_0x12387c=_0x128a84[_0xe15f('0x55')](_0x128a84[_0xe15f('0x56')]('/')+0x1,_0x128a84[_0xe15f('0x59')]('-'));_0x6fb311=this[_0xe15f('0x1e')](_0x12387c);}if(_0x6fb311){_0x627f33[_0xe15f('0x23')]=_[_0xe15f('0x21')](_0x6fb311['interface'])?util[_0xe15f('0x24')](_0xe15f('0x25'),_0x6fb311[_0xe15f('0x22')]):_0x6fb311[_0xe15f('0x23')];_0x627f33['membername']=_0x6fb311[_0xe15f('0x22')];_0x627f33[_0xe15f('0x20')]=_0x6fb311[_0xe15f('0x20')];RpcMemberReport[_0xe15f('0x1a')](_0x627f33);}};Report['prototype'][_0xe15f('0x1c')]=function(_0x1d2259){RpcVoiceTransferReport[_0xe15f('0x43')][_0x1d2259[_0xe15f('0x5a')]]=_0x1d2259;};Report['prototype'][_0xe15f('0x1d')]=function(_0x251d47){RpcVoiceTransferReport[_0xe15f('0x1d')](_0x251d47);};module[_0xe15f('0x5b')]=Report;
\ No newline at end of file
index 9ae6da6..a19a473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa177=['trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','inspect','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','username','state','debug','find','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','[userReport][devicestatechange]','device','local','inuse','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/logger','ami','../ami','defaults','localhost','socket.io-emitter'];(function(_0x149414,_0x1535de){var _0x5f07ff=function(_0x5e0c04){while(--_0x5e0c04){_0x149414['push'](_0x149414['shift']());}};_0x5f07ff(++_0x1535de);}(_0xa177,0x1be));var _0x7a17=function(_0x3f934f,_0x5c1a72){_0x3f934f=_0x3f934f-0x0;var _0x385975=_0xa177[_0x3f934f];return _0x385975;};'use strict';var _=require(_0x7a17('0x0'));var moment=require(_0x7a17('0x1'));var util=require(_0x7a17('0x2'));var Redis=require('ioredis');var BPromise=require(_0x7a17('0x3'));var config=require('../../../config/environment');var logger=require(_0x7a17('0x4'))(_0x7a17('0x5'));var ami=require(_0x7a17('0x6'));config['redis']=_[_0x7a17('0x7')](config['redis'],{'host':_0x7a17('0x8'),'port':0x18eb});var io=require(_0x7a17('0x9'))(new Redis(config['redis']));function UserReport(_0x2f7640){this[_0x7a17('0xa')]=_0x2f7640['trunks'];this[_0x7a17('0xb')]=_0x2f7640[_0x7a17('0xb')];this[_0x7a17('0xc')]=_0x2f7640[_0x7a17('0xc')];ami['on']('registryentry',this[_0x7a17('0xd')][_0x7a17('0xe')](this));ami['on'](_0x7a17('0xf'),this['syncRegistry'][_0x7a17('0xe')](this));ami['on'](_0x7a17('0x10'),this[_0x7a17('0x11')][_0x7a17('0xe')](this));ami['on'](_0x7a17('0x12'),this[_0x7a17('0x13')][_0x7a17('0xe')](this));return this[_0x7a17('0x14')]();}function showSipRegistrations(){Promise[_0x7a17('0x15')]()[_0x7a17('0x16')](ami[_0x7a17('0x17')]())[_0x7a17('0x18')](function(_0x401c4b){logger[_0x7a17('0x19')]('[userReport][sipshowregistry]',util[_0x7a17('0x1a')](_0x401c4b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7a17('0x15')]()[_0x7a17('0x16')](ami[_0x7a17('0x1b')]())['catch'](function(_0x240702){logger[_0x7a17('0x19')](_0x7a17('0x1c'),util[_0x7a17('0x1a')](_0x240702,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x7a17('0x15')]()[_0x7a17('0x16')](ami[_0x7a17('0x1d')]())[_0x7a17('0x18')](function(_0x35212c){logger[_0x7a17('0x19')](_0x7a17('0x1e'),util['inspect'](_0x35212c,{'showHidden':![],'depth':null}));});}UserReport[_0x7a17('0x1f')][_0x7a17('0x14')]=function(){setInterval(function(){BPromise[_0x7a17('0x15')]()[_0x7a17('0x16')](showSipRegistrations())[_0x7a17('0x16')](listDeviceStates())[_0x7a17('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x7a17('0x1f')][_0x7a17('0x20')]=function(_0x11a24f){return _0x11a24f!==null&&!_['isUndefined'](_0x11a24f);};UserReport[_0x7a17('0x1f')][_0x7a17('0x21')]=function(_0x488d26,_0x5b121c,_0x400b8d){io['to'](_0x488d26)[_0x7a17('0x21')](_0x5b121c,_0x400b8d);};UserReport[_0x7a17('0x1f')][_0x7a17('0xd')]=function(_0x5e3ddb){try{if(this[_0x7a17('0x20')](_0x5e3ddb)){logger[_0x7a17('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5e3ddb[_0x7a17('0x23')],_0x5e3ddb[_0x7a17('0x24')]);logger[_0x7a17('0x25')]('[userReport][registry]',util[_0x7a17('0x1a')](_0x5e3ddb,{'showHidden':![],'depth':null}));var _0x10a899=_[_0x7a17('0x26')](this[_0x7a17('0xa')],{'defaultuser':_0x5e3ddb['username']});if(_0x10a899){_0x5e3ddb[_0x7a17('0x27')]=_0x5e3ddb[_0x7a17('0x24')];_[_0x7a17('0x28')](_0x10a899,_[_0x7a17('0x29')](_0x5e3ddb,[_0x7a17('0x2a'),_0x7a17('0x2b'),'username',_0x7a17('0x24')]));logger[_0x7a17('0x25')](_0x7a17('0x2c'),util[_0x7a17('0x1a')](_0x10a899,{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')](_0x7a17('0x2e'),_0x10a899[_0x7a17('0x2f')]),_0x7a17('0x30'),_0x10a899);}}}catch(_0x4791f0){logger[_0x7a17('0x19')](_0x7a17('0x31'),util[_0x7a17('0x1a')](_0x4791f0,{'showHidden':![],'depth':null}));}};UserReport[_0x7a17('0x1f')]['syncDeviceState']=function(_0x28e3b9){try{if(this['isNotNull'](_0x28e3b9)){logger[_0x7a17('0x22')](_0x7a17('0x32'),_0x28e3b9['device'],_0x28e3b9[_0x7a17('0x24')]);logger[_0x7a17('0x25')](_0x7a17('0x33'),util[_0x7a17('0x1a')](_0x28e3b9,{'showHidden':![],'depth':null}));if(this[_0x7a17('0xb')][_0x28e3b9['device']]){if(!this['agents'][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x35')]||_0x28e3b9[_0x7a17('0x24')]['toLowerCase']()==_0x7a17('0x36')){this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x35')]=![];if(this[_0x7a17('0xb')][_0x28e3b9['device']][_0x7a17('0x24')]!==_0x28e3b9[_0x7a17('0x24')][_0x7a17('0x37')]()){this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x38')]=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]]['state']=_0x28e3b9[_0x7a17('0x24')]['toLowerCase']();this[_0x7a17('0xb')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x3a')](_0x28e3b9);}}else if(this['telephones'][_0x28e3b9[_0x7a17('0x34')]]){if(this[_0x7a17('0xc')][_0x28e3b9['device']][_0x7a17('0x24')]!==_0x28e3b9[_0x7a17('0x24')]['toLowerCase']()){this[_0x7a17('0xc')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x38')]=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}this[_0x7a17('0xc')][_0x28e3b9[_0x7a17('0x34')]]['state']=_0x28e3b9[_0x7a17('0x24')][_0x7a17('0x37')]();logger[_0x7a17('0x25')](_0x7a17('0x3b'),util[_0x7a17('0x1a')](this['telephones'][_0x28e3b9['device']],{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')]('telephone:%s',this[_0x7a17('0xc')][_0x28e3b9['device']][_0x7a17('0x2f')]),_0x7a17('0x3c'),this[_0x7a17('0xc')][_0x28e3b9[_0x7a17('0x34')]]);}else if(this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]]){if(this['trunks'][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x24')]!==_0x28e3b9[_0x7a17('0x24')][_0x7a17('0x37')]()){this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]]['stateTime']=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x24')]=_0x28e3b9['state'][_0x7a17('0x37')]();logger[_0x7a17('0x25')](_0x7a17('0x3d'),util[_0x7a17('0x1a')](this[_0x7a17('0xa')][_0x28e3b9['device']],{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')](_0x7a17('0x2e'),this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]][_0x7a17('0x2f')]),_0x7a17('0x30'),this[_0x7a17('0xa')][_0x28e3b9[_0x7a17('0x34')]]);}else if(_[_0x7a17('0x3e')](_0x28e3b9[_0x7a17('0x34')],_0x7a17('0x3f'))){var _0x422890=_0x28e3b9['device'];var _0x59fa75=_0x422890['substring'](_0x422890[_0x7a17('0x40')]('/')+0x1,_0x422890[_0x7a17('0x40')]('@'));var _0x4aa77e=_[_0x7a17('0x26')](this['agents'],function(_0x4ce17c){return _0x4ce17c[_0x7a17('0x41')]==_0x59fa75||_0x4ce17c['phone']==_0x59fa75||_0x4ce17c['accountcode']==_0x59fa75;});if(_0x4aa77e){if(_0x4aa77e['state']!==_0x28e3b9[_0x7a17('0x24')]['toLowerCase']()){_0x4aa77e[_0x7a17('0x38')]=_[_0x7a17('0x39')](moment()[_0x7a17('0x2d')]('x'));}_0x4aa77e['state']=_0x28e3b9['state'][_0x7a17('0x37')]();_0x4aa77e['local']=!![];_0x4aa77e['updateStatusRealtime'](_0x28e3b9);}}}}catch(_0x55cd42){logger['error'](_0x7a17('0x33'),util[_0x7a17('0x1a')](_0x55cd42,{'showHidden':![],'depth':null}));}};UserReport[_0x7a17('0x1f')][_0x7a17('0x13')]=function(_0x5edcce){try{if(this[_0x7a17('0x20')](_0x5edcce)&&this[_0x7a17('0x20')](_0x5edcce[_0x7a17('0x12')])){logger[_0x7a17('0x22')](_0x7a17('0x42'),_0x5edcce[_0x7a17('0x43')],_0x5edcce[_0x7a17('0x44')],_0x5edcce[_0x7a17('0x12')]);logger[_0x7a17('0x25')](_0x7a17('0x45'),util[_0x7a17('0x1a')](_0x5edcce,{'showHidden':![],'depth':null}));if(this[_0x7a17('0xb')][_0x5edcce['peer']]){if(!this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x35')]||_0x5edcce[_0x7a17('0x12')]['toLowerCase']()==_0x7a17('0x46')){this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]]['local']=![];this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x47')]=_0x5edcce[_0x7a17('0x12')][_0x7a17('0x37')]();this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x44')]=_0x5edcce[_0x7a17('0x44')];this[_0x7a17('0xb')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x3a')](_0x5edcce);}}else if(this[_0x7a17('0xc')][_0x5edcce['peer']]){this[_0x7a17('0xc')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x47')]=_0x5edcce['peerstatus'][_0x7a17('0x37')]();this[_0x7a17('0xc')][_0x5edcce['peer']][_0x7a17('0x44')]=_0x5edcce[_0x7a17('0x44')];logger['debug'](_0x7a17('0x48'),util[_0x7a17('0x1a')](this[_0x7a17('0xc')][_0x5edcce[_0x7a17('0x43')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x7a17('0x2d')](_0x7a17('0x49'),this[_0x7a17('0xc')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x2f')]),_0x7a17('0x3c'),this[_0x7a17('0xc')][_0x5edcce['peer']]);}else if(this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]]){this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x47')]=_0x5edcce[_0x7a17('0x12')][_0x7a17('0x37')]();this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]]['address']=_0x5edcce[_0x7a17('0x44')];logger['debug'](_0x7a17('0x4a'),util[_0x7a17('0x1a')](this[_0x7a17('0xa')][_0x5edcce['peer']],{'showHidden':![],'depth':null}));this[_0x7a17('0x21')](util[_0x7a17('0x2d')](_0x7a17('0x2e'),this['trunks'][_0x5edcce[_0x7a17('0x43')]][_0x7a17('0x2f')]),_0x7a17('0x30'),this[_0x7a17('0xa')][_0x5edcce[_0x7a17('0x43')]]);}}}catch(_0x522907){logger[_0x7a17('0x19')](_0x7a17('0x45'),util[_0x7a17('0x1a')](_0x522907,{'showHidden':![],'depth':null}));}};module[_0x7a17('0x4b')]=UserReport;
\ No newline at end of file
+var _0xbf02=['name','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','telephone:%s'];(function(_0x5639f6,_0x35b3df){var _0x2696be=function(_0x2f8a89){while(--_0x2f8a89){_0x5639f6['push'](_0x5639f6['shift']());}};_0x2696be(++_0x35b3df);}(_0xbf02,0xf3));var _0x2bf0=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xbf02[_0x36884e];return _0x1cc367;};'use strict';var _=require('lodash');var moment=require(_0x2bf0('0x0'));var util=require('util');var Redis=require(_0x2bf0('0x1'));var BPromise=require(_0x2bf0('0x2'));var config=require(_0x2bf0('0x3'));var logger=require(_0x2bf0('0x4'))(_0x2bf0('0x5'));var ami=require(_0x2bf0('0x6'));config[_0x2bf0('0x7')]=_['defaults'](config[_0x2bf0('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2bf0('0x7')]));function UserReport(_0x4dbf89){this[_0x2bf0('0x8')]=_0x4dbf89['trunks'];this[_0x2bf0('0x9')]=_0x4dbf89['agents'];this['telephones']=_0x4dbf89[_0x2bf0('0xa')];ami['on'](_0x2bf0('0xb'),this[_0x2bf0('0xc')][_0x2bf0('0xd')](this));ami['on'](_0x2bf0('0xe'),this[_0x2bf0('0xc')][_0x2bf0('0xd')](this));ami['on'](_0x2bf0('0xf'),this[_0x2bf0('0x10')][_0x2bf0('0xd')](this));ami['on'](_0x2bf0('0x11'),this[_0x2bf0('0x12')][_0x2bf0('0xd')](this));return this[_0x2bf0('0x13')]();}function showSipRegistrations(){Promise[_0x2bf0('0x14')]()['then'](ami[_0x2bf0('0x15')]())[_0x2bf0('0x16')](function(_0x36b932){logger[_0x2bf0('0x17')](_0x2bf0('0x18'),util[_0x2bf0('0x19')](_0x36b932,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x2bf0('0x14')]()[_0x2bf0('0x1a')](ami[_0x2bf0('0x1b')]())['catch'](function(_0x3d946c){logger[_0x2bf0('0x17')](_0x2bf0('0x1c'),util[_0x2bf0('0x19')](_0x3d946c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x2bf0('0x14')]()[_0x2bf0('0x1a')](ami[_0x2bf0('0x1d')]())['catch'](function(_0x42eedb){logger[_0x2bf0('0x17')](_0x2bf0('0x1e'),util[_0x2bf0('0x19')](_0x42eedb,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x2bf0('0x1a')](showSipRegistrations())[_0x2bf0('0x1a')](listDeviceStates())[_0x2bf0('0x1a')](showPeersStatus());},0x32c8);};UserReport[_0x2bf0('0x1f')][_0x2bf0('0x20')]=function(_0x1b4d77){return _0x1b4d77!==null&&!_[_0x2bf0('0x21')](_0x1b4d77);};UserReport[_0x2bf0('0x1f')][_0x2bf0('0x22')]=function(_0x14357b,_0x2c9bae,_0x3faeee){io['to'](_0x14357b)[_0x2bf0('0x22')](_0x2c9bae,_0x3faeee);};UserReport['prototype'][_0x2bf0('0xc')]=function(_0x3bd61e){try{if(this[_0x2bf0('0x20')](_0x3bd61e)){logger[_0x2bf0('0x23')](_0x2bf0('0x24'),_0x3bd61e[_0x2bf0('0x25')],_0x3bd61e['state']);logger[_0x2bf0('0x26')](_0x2bf0('0x27'),util[_0x2bf0('0x19')](_0x3bd61e,{'showHidden':![],'depth':null}));var _0x51a96f=_['find'](this[_0x2bf0('0x8')],{'defaultuser':_0x3bd61e['username']});if(_0x51a96f){_0x3bd61e[_0x2bf0('0x28')]=_0x3bd61e[_0x2bf0('0x29')];_[_0x2bf0('0x2a')](_0x51a96f,_[_0x2bf0('0x2b')](_0x3bd61e,[_0x2bf0('0x2c'),_0x2bf0('0x2d'),_0x2bf0('0x25'),_0x2bf0('0x29')]));logger[_0x2bf0('0x26')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x2bf0('0x19')](_0x51a96f,{'showHidden':![],'depth':null}));this[_0x2bf0('0x22')](util[_0x2bf0('0x2e')](_0x2bf0('0x2f'),_0x51a96f['name']),_0x2bf0('0x30'),_0x51a96f);}}}catch(_0x315f3e){logger[_0x2bf0('0x17')]('[userReport][registry]',util['inspect'](_0x315f3e,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x4fae41){try{if(this[_0x2bf0('0x20')](_0x4fae41)){logger[_0x2bf0('0x23')](_0x2bf0('0x31'),_0x4fae41[_0x2bf0('0x32')],_0x4fae41[_0x2bf0('0x29')]);logger['debug']('[userReport][devicestatechange]',util['inspect'](_0x4fae41,{'showHidden':![],'depth':null}));if(this[_0x2bf0('0x9')][_0x4fae41[_0x2bf0('0x32')]]){if(!this['agents'][_0x4fae41['device']][_0x2bf0('0x33')]||_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]()=='inuse'){this[_0x2bf0('0x9')][_0x4fae41[_0x2bf0('0x32')]]['local']=![];if(this[_0x2bf0('0x9')][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x29')]!==_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]()){this['agents'][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x35')]=_[_0x2bf0('0x36')](moment()[_0x2bf0('0x2e')]('x'));}this['agents'][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x29')]=_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]();this[_0x2bf0('0x9')][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x37')](_0x4fae41);}}else if(this['telephones'][_0x4fae41['device']]){if(this[_0x2bf0('0xa')][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x29')]!==_0x4fae41[_0x2bf0('0x29')]['toLowerCase']()){this[_0x2bf0('0xa')][_0x4fae41['device']]['stateTime']=_['toNumber'](moment()[_0x2bf0('0x2e')]('x'));}this[_0x2bf0('0xa')][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x29')]=_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]();logger[_0x2bf0('0x26')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x2bf0('0xa')][_0x4fae41[_0x2bf0('0x32')]],{'showHidden':![],'depth':null}));this[_0x2bf0('0x22')](util[_0x2bf0('0x2e')](_0x2bf0('0x38'),this[_0x2bf0('0xa')][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x39')]),'telephone:save',this[_0x2bf0('0xa')][_0x4fae41[_0x2bf0('0x32')]]);}else if(this['trunks'][_0x4fae41[_0x2bf0('0x32')]]){if(this['trunks'][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x29')]!==_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]()){this['trunks'][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x35')]=_[_0x2bf0('0x36')](moment()[_0x2bf0('0x2e')]('x'));}this[_0x2bf0('0x8')][_0x4fae41[_0x2bf0('0x32')]][_0x2bf0('0x29')]=_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]();logger['debug'](_0x2bf0('0x3a'),util[_0x2bf0('0x19')](this[_0x2bf0('0x8')][_0x4fae41[_0x2bf0('0x32')]],{'showHidden':![],'depth':null}));this[_0x2bf0('0x22')](util[_0x2bf0('0x2e')]('trunk:%s',this[_0x2bf0('0x8')][_0x4fae41[_0x2bf0('0x32')]]['name']),_0x2bf0('0x30'),this[_0x2bf0('0x8')][_0x4fae41['device']]);}else if(_[_0x2bf0('0x3b')](_0x4fae41[_0x2bf0('0x32')],_0x2bf0('0x3c'))){var _0x25a8cb=_0x4fae41[_0x2bf0('0x32')];var _0x1aabcc=_0x25a8cb[_0x2bf0('0x3d')](_0x25a8cb[_0x2bf0('0x3e')]('/')+0x1,_0x25a8cb[_0x2bf0('0x3e')]('@'));var _0xd88c5c=_[_0x2bf0('0x3f')](this[_0x2bf0('0x9')],function(_0x2fc0b1){return _0x2fc0b1['mobile']==_0x1aabcc||_0x2fc0b1['phone']==_0x1aabcc||_0x2fc0b1[_0x2bf0('0x40')]==_0x1aabcc;});if(_0xd88c5c){if(_0xd88c5c['state']!==_0x4fae41['state'][_0x2bf0('0x34')]()){_0xd88c5c['stateTime']=_[_0x2bf0('0x36')](moment()[_0x2bf0('0x2e')]('x'));}_0xd88c5c[_0x2bf0('0x29')]=_0x4fae41[_0x2bf0('0x29')][_0x2bf0('0x34')]();_0xd88c5c[_0x2bf0('0x33')]=!![];_0xd88c5c['updateStatusRealtime'](_0x4fae41);}}}}catch(_0x51b2b8){logger[_0x2bf0('0x17')](_0x2bf0('0x41'),util[_0x2bf0('0x19')](_0x51b2b8,{'showHidden':![],'depth':null}));}};UserReport[_0x2bf0('0x1f')][_0x2bf0('0x12')]=function(_0x44e36e){try{if(this[_0x2bf0('0x20')](_0x44e36e)&&this[_0x2bf0('0x20')](_0x44e36e[_0x2bf0('0x11')])){logger[_0x2bf0('0x23')](_0x2bf0('0x42'),_0x44e36e['peer'],_0x44e36e[_0x2bf0('0x43')],_0x44e36e[_0x2bf0('0x11')]);logger[_0x2bf0('0x26')](_0x2bf0('0x44'),util[_0x2bf0('0x19')](_0x44e36e,{'showHidden':![],'depth':null}));if(this[_0x2bf0('0x9')][_0x44e36e[_0x2bf0('0x45')]]){if(!this[_0x2bf0('0x9')][_0x44e36e[_0x2bf0('0x45')]][_0x2bf0('0x33')]||_0x44e36e[_0x2bf0('0x11')]['toLowerCase']()==_0x2bf0('0x46')){this['agents'][_0x44e36e[_0x2bf0('0x45')]][_0x2bf0('0x33')]=![];this[_0x2bf0('0x9')][_0x44e36e[_0x2bf0('0x45')]][_0x2bf0('0x47')]=_0x44e36e['peerstatus'][_0x2bf0('0x34')]();this['agents'][_0x44e36e['peer']]['address']=_0x44e36e[_0x2bf0('0x43')];this[_0x2bf0('0x9')][_0x44e36e[_0x2bf0('0x45')]][_0x2bf0('0x37')](_0x44e36e);}}else if(this[_0x2bf0('0xa')][_0x44e36e[_0x2bf0('0x45')]]){this[_0x2bf0('0xa')][_0x44e36e[_0x2bf0('0x45')]][_0x2bf0('0x47')]=_0x44e36e[_0x2bf0('0x11')][_0x2bf0('0x34')]();this[_0x2bf0('0xa')][_0x44e36e['peer']]['address']=_0x44e36e[_0x2bf0('0x43')];logger[_0x2bf0('0x26')](_0x2bf0('0x48'),util[_0x2bf0('0x19')](this['telephones'][_0x44e36e[_0x2bf0('0x45')]],{'showHidden':![],'depth':null}));this[_0x2bf0('0x22')](util['format'](_0x2bf0('0x38'),this[_0x2bf0('0xa')][_0x44e36e['peer']]['name']),'telephone:save',this[_0x2bf0('0xa')][_0x44e36e[_0x2bf0('0x45')]]);}else if(this[_0x2bf0('0x8')][_0x44e36e[_0x2bf0('0x45')]]){this[_0x2bf0('0x8')][_0x44e36e['peer']][_0x2bf0('0x47')]=_0x44e36e[_0x2bf0('0x11')][_0x2bf0('0x34')]();this[_0x2bf0('0x8')][_0x44e36e['peer']][_0x2bf0('0x43')]=_0x44e36e[_0x2bf0('0x43')];logger[_0x2bf0('0x26')](_0x2bf0('0x49'),util[_0x2bf0('0x19')](this['trunks'][_0x44e36e[_0x2bf0('0x45')]],{'showHidden':![],'depth':null}));this[_0x2bf0('0x22')](util[_0x2bf0('0x2e')](_0x2bf0('0x2f'),this[_0x2bf0('0x8')][_0x44e36e[_0x2bf0('0x45')]][_0x2bf0('0x39')]),_0x2bf0('0x30'),this['trunks'][_0x44e36e[_0x2bf0('0x45')]]);}}}catch(_0x4d1ff1){logger[_0x2bf0('0x17')]('[userReport][peerstatus]',util[_0x2bf0('0x19')](_0x4d1ff1,{'showHidden':![],'depth':null}));}};module[_0x2bf0('0x4a')]=UserReport;
\ No newline at end of file
index 192abeb..76d9bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7660=['privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','variables','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','lastevent','connect','routealias','pick','destconnectedlinenum','channel','split','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:agentringnoanswer','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','addVariable','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','voice','merge','event'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7660,0x1ac));var _0x0766=function(_0x4a4b45,_0x16bc77){_0x4a4b45=_0x4a4b45-0x0;var _0x3d9e27=_0x7660[_0x4a4b45];return _0x3d9e27;};'use strict';var _=require('lodash');var moment=require(_0x0766('0x0'));var util=require(_0x0766('0x1'));var Redis=require(_0x0766('0x2'));var config=require('../../../config/environment');var logger=require(_0x0766('0x3'))(_0x0766('0x4'));var ami=require(_0x0766('0x5'));config['redis']=_[_0x0766('0x6')](config[_0x0766('0x7')],{'host':_0x0766('0x8'),'port':0x18eb});var io=require(_0x0766('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x11e7a4){this['channels']={};this[_0x0766('0xa')]=_0x11e7a4[_0x0766('0xb')];this[_0x0766('0xc')]=_0x11e7a4[_0x0766('0xc')];this['agents']=_0x11e7a4[_0x0766('0xd')];this['variables']={};ami['on'](_0x0766('0xe'),this['syncAgentCalled'][_0x0766('0xf')](this));ami['on'](_0x0766('0x10'),this[_0x0766('0x11')][_0x0766('0xf')](this));ami['on'](_0x0766('0x12'),this[_0x0766('0x13')][_0x0766('0xf')](this));ami['on']('queuecallerabandon',this[_0x0766('0x14')]['bind'](this));ami['on'](_0x0766('0x15'),this[_0x0766('0x16')][_0x0766('0xf')](this));ami['on'](_0x0766('0x17'),this[_0x0766('0x18')][_0x0766('0xf')](this));ami['on'](_0x0766('0x19'),this[_0x0766('0x1a')]['bind'](this));ami['on'](_0x0766('0x1b'),this[_0x0766('0x1c')][_0x0766('0xf')](this));ami['on'](_0x0766('0x1d'),this[_0x0766('0x1e')][_0x0766('0xf')](this));ami['on'](_0x0766('0x1f'),this[_0x0766('0x20')][_0x0766('0xf')](this));ami['on'](_0x0766('0x21'),this[_0x0766('0x22')][_0x0766('0xf')](this));}VoiceAgentReport[_0x0766('0x23')][_0x0766('0x24')]=function(_0x2f06ec,_0x51c74d,_0x58ddc4){io['to'](_0x2f06ec)['emit'](_0x51c74d,_0x58ddc4);};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x25')]=function(_0x1c8e06){return _0x1c8e06!==null&&!_[_0x0766('0x26')](_0x1c8e06);};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x27')]=function(_0xfb949d){try{if(this[_0x0766('0x25')](_0xfb949d)){logger[_0x0766('0x28')](_0x0766('0x29'),_0xfb949d[_0x0766('0x2a')],_0xfb949d[_0x0766('0x2b')],_0xfb949d[_0x0766('0x2c')]);logger[_0x0766('0x2d')](_0x0766('0x2e'),_0xfb949d[_0x0766('0x2a')],util[_0x0766('0x2f')](_0xfb949d,{'showHidden':![],'depth':null}));if(_[_0x0766('0x26')](this[_0x0766('0xb')][_0xfb949d[_0x0766('0x2a')]])){this['channels'][_0xfb949d[_0x0766('0x2a')]]={};}var _0xa964d7=this[_0x0766('0xd')][_0xfb949d[_0x0766('0x30')]];var _0x122d1e=this['channels'][_0xfb949d[_0x0766('0x2a')]][_0xfb949d[_0x0766('0x2c')]];var _0x26991c=this[_0x0766('0xc')][_0xfb949d[_0x0766('0x31')]];var _0x24b078=this['variables'][_0xfb949d[_0x0766('0x2a')]];if(_['isUndefined'](_0x122d1e)){_0x122d1e={'agentcalledAt':moment()[_0x0766('0x32')](_0x0766('0x33')),'lastevent':_0x0766('0x34'),'mandatoryDisposition':_0x26991c&&_0x26991c['mandatoryDisposition']?_0x26991c[_0x0766('0x35')]:![],'type':_0x26991c&&_0x26991c[_0x0766('0x36')]?_0x26991c['type']:'inbound','variables':_0x24b078,'motionChannel':_0x0766('0x37')};}_[_0x0766('0x38')](_0x122d1e,_['omit'](_0xfb949d,[_0x0766('0x39'),_0x0766('0x3a')]));logger['debug'](_0x0766('0x3b'),_0xfb949d[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x122d1e,{'showHidden':![],'depth':null}));ami[_0x0766('0x24')]('custom:agentcalled',_0x122d1e);var _0x42bc85={'id':_0xa964d7['id'],'calleridnum':_0x122d1e['calleridnum'],'queue':_0x122d1e['queue'],'variables':_0x122d1e[_0x0766('0x3c')],'uniqueid':_0xfb949d[_0x0766('0x2a')]};logger[_0x0766('0x2d')](_0x0766('0x3d'),_0xfb949d['uniqueid'],util['inspect'](_0x42bc85,{'showHidden':![],'depth':null}));this['emit'](util[_0x0766('0x32')](_0x0766('0x3e'),_0xfb949d[_0x0766('0x2b')]),_0x0766('0x3f'),_0x42bc85);}}catch(_0x4d24c8){logger[_0x0766('0x40')]('[%s][voiceAgentReport][agentcalled]',_0xfb949d[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x4d24c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')]['syncAgentConnect']=function(_0x16074a){try{if(this[_0x0766('0x25')](_0x16074a)){if(this['channels'][_0x16074a[_0x0766('0x2a')]]){logger[_0x0766('0x2d')](_0x0766('0x41'),_0x16074a[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x16074a,{'showHidden':![],'depth':null}));for(var _0x4adafd in this['channels'][_0x16074a[_0x0766('0x2a')]]){if(this['channels'][_0x16074a[_0x0766('0x2a')]][_0x0766('0x42')](_0x4adafd)){if(_0x16074a[_0x0766('0x2c')]===_0x4adafd){logger[_0x0766('0x28')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x16074a['uniqueid'],_0x16074a['membername'],_0x16074a[_0x0766('0x2c')]);this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x43')]=moment()[_0x0766('0x32')](_0x0766('0x33'));this['channels'][_0x16074a['uniqueid']][_0x4adafd]['connectedlinename']=_0x16074a[_0x0766('0x44')];this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x45')]=_0x16074a['connectedlinenum'];this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x46')]=_0x16074a[_0x0766('0x46')];this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x47')]=_0x16074a[_0x0766('0x47')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['holdtime']=_0x16074a['holdtime'];this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x48')]=_0x0766('0x49');if(this[_0x0766('0xa')][this['channels'][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x2a')]]){var _0x2c76e0=this[_0x0766('0xa')][this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x2a')]][_0x0766('0x4a')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x4a')]=_0x2c76e0;_0x16074a[_0x0766('0x4a')]=_0x2c76e0;}_[_0x0766('0x38')](this[_0x0766('0xd')][_0x16074a['interface']],_[_0x0766('0x4b')](_0x16074a,['queue',_0x0766('0x4c'),_0x0766('0x4a')]));var _0x2ce675=this['agents'][_0x16074a[_0x0766('0x4d')][_0x0766('0x4e')]('-')[0x0]];var _0xfda657={'id':_0x2ce675['id'],'name':_0x2ce675['name'],'agentconnected':!![],'destaccountcode':_0x2ce675['accountcode'],'destconnectedlinenum':this['channels'][_0x16074a[_0x0766('0x2a')]][_0x16074a[_0x0766('0x2c')]][_0x0766('0x4f')],'queue':this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x16074a['destuniqueid']][_0x0766('0x31')],'routealias':this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x16074a[_0x0766('0x2c')]][_0x0766('0x4a')],'uniqueid':this['channels'][_0x16074a[_0x0766('0x2a')]][_0x16074a[_0x0766('0x2c')]][_0x0766('0x2a')]};logger['debug'](_0x0766('0x50'),_0x16074a['uniqueid'],util[_0x0766('0x2f')](_0xfda657,{'showHidden':![],'depth':null}));ami[_0x0766('0x24')](_0x0766('0x51'),_0xfda657);logger[_0x0766('0x2d')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x16074a['uniqueid'],util[_0x0766('0x2f')](_0xfda657,{'showHidden':![],'depth':null}));this['emit'](util[_0x0766('0x32')](_0x0766('0x3e'),_0x16074a[_0x0766('0x2b')]),_0x0766('0x52'),_0xfda657);}else if(!this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['agentringnoanswer']&&!this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['agentcomplete']){logger[_0x0766('0x28')](_0x0766('0x53'),_0x16074a[_0x0766('0x2a')],this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x2b')],_0x4adafd);this[_0x0766('0xb')][_0x16074a['uniqueid']][_0x4adafd][_0x0766('0x12')]=!![];this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x54')]=moment()[_0x0766('0x32')](_0x0766('0x33'));this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x55')]=_0x16074a[_0x0766('0x2c')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd]['answeredelsewheremembername']=_0x16074a[_0x0766('0x2b')];this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x48')]=_0x0766('0x56');this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd][_0x0766('0x57')]=_0x0766('0x56');logger[_0x0766('0x2d')](_0x0766('0x58'),_0x16074a[_0x0766('0x2a')],util['inspect'](this['channels'][_0x16074a[_0x0766('0x2a')]][_0x4adafd],{'showHidden':![],'depth':null}));ami[_0x0766('0x24')]('custom:agentansweredelsewhere',this[_0x0766('0xb')][_0x16074a[_0x0766('0x2a')]][_0x4adafd]);}}}}}}catch(_0x36e6a5){logger[_0x0766('0x40')](_0x0766('0x59'),_0x16074a['uniqueid'],util[_0x0766('0x2f')](_0x36e6a5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')]['syncAgentRingNoAnswer']=function(_0x3d1c91){try{if(this[_0x0766('0x25')](_0x3d1c91)){logger[_0x0766('0x2d')](_0x0766('0x5a'),_0x3d1c91[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x3d1c91,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x3d1c91[_0x0766('0x2a')]]&&this[_0x0766('0xb')][_0x3d1c91[_0x0766('0x2a')]][_0x3d1c91[_0x0766('0x2c')]]){logger[_0x0766('0x28')](_0x0766('0x5b'),_0x3d1c91[_0x0766('0x2a')],_0x3d1c91[_0x0766('0x2b')],_0x3d1c91[_0x0766('0x2c')]);var _0x12c051=this[_0x0766('0xd')][_0x3d1c91[_0x0766('0x30')]];var _0x176bdc=this[_0x0766('0xb')][_0x3d1c91[_0x0766('0x2a')]][_0x3d1c91['destuniqueid']];_0x176bdc[_0x0766('0x12')]=!![];_0x176bdc[_0x0766('0x54')]=moment()[_0x0766('0x32')](_0x0766('0x33'));_0x176bdc[_0x0766('0x48')]=_0x0766('0x5c');_0x176bdc[_0x0766('0x57')]=_0x0766('0x5c');var _0x127a59={'id':_0x12c051['id'],'name':_0x12c051[_0x0766('0x5d')],'queue':_0x176bdc[_0x0766('0x31')],'uniqueid':_0x176bdc[_0x0766('0x2a')]};logger[_0x0766('0x2d')](_0x0766('0x5e'),_0x3d1c91[_0x0766('0x2a')],util['inspect'](_0x127a59,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x0766('0x3e'),_0x12c051[_0x0766('0x5d')]),_0x0766('0x5f'),_0x127a59);ami[_0x0766('0x24')](_0x0766('0x60'),_0x176bdc);}}}catch(_0x5a5915){logger[_0x0766('0x40')](_0x0766('0x61'),_0x3d1c91['uniqueid'],util[_0x0766('0x2f')](_0x5a5915,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x14')]=function(_0x192937){try{if(this[_0x0766('0x25')](_0x192937)){logger[_0x0766('0x2d')](_0x0766('0x62'),_0x192937[_0x0766('0x2a')],util['inspect'](_0x192937,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]]){for(var _0x326313 in this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]]){if(this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]]['hasOwnProperty'](_0x326313)&&!this['channels'][_0x192937['uniqueid']][_0x326313][_0x0766('0x12')]&&!this['channels'][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x15')]){logger[_0x0766('0x28')](_0x0766('0x63'),_0x192937[_0x0766('0x2a')],this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x2b')],_0x326313);this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x12')]=!![];this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x54')]=moment()['format'](_0x0766('0x33'));this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313][_0x0766('0x48')]=_0x0766('0x64');this[_0x0766('0xb')][_0x192937['uniqueid']][_0x326313][_0x0766('0x57')]=_0x0766('0x64');logger['debug'](_0x0766('0x65'),_0x192937[_0x0766('0x2a')],util[_0x0766('0x2f')](this[_0x0766('0xb')][_0x192937['uniqueid']][_0x326313],{'showHidden':![],'depth':null}));ami['emit'](_0x0766('0x66'),this[_0x0766('0xb')][_0x192937[_0x0766('0x2a')]][_0x326313]);}}}}}catch(_0x3d8488){logger[_0x0766('0x40')]('[%s][voiceAgentReport][queuecallerabandon]',_0x192937[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x3d8488,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x16')]=function(_0x1fd2cf){try{if(this['isNotNull'](_0x1fd2cf)){logger[_0x0766('0x2d')](_0x0766('0x67'),_0x1fd2cf[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x1fd2cf,{'showHidden':![],'depth':null}));if(this['channels'][_0x1fd2cf[_0x0766('0x2a')]]){for(var _0xbe5627 in this[_0x0766('0xb')][_0x1fd2cf['uniqueid']]){if(this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0x0766('0x42')](_0xbe5627)){if(this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627]['agentconnectAt']&&!this['channels'][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x15')]){logger[_0x0766('0x28')](_0x0766('0x68'),_0x1fd2cf[_0x0766('0x2a')],this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x2b')],_0xbe5627);this[_0x0766('0xb')][_0x1fd2cf['uniqueid']][_0xbe5627]['agentcomplete']=!![];this['channels'][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x69')]=moment()[_0x0766('0x32')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x48')]=_0x0766('0x6a');this['channels'][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x57')]=_0x1fd2cf[_0x0766('0x57')]==_0x0766('0x6b')?_0x0766('0x6c'):_0x1fd2cf['reason'];this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627]['talktime']=_0x1fd2cf[_0x0766('0x6d')];if(this[_0x0766('0xc')][_0x1fd2cf[_0x0766('0x31')]]&&this[_0x0766('0xc')][_0x1fd2cf[_0x0766('0x31')]][_0x0766('0x6e')]){this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627][_0x0766('0x6f')]=this[_0x0766('0xc')][_0x1fd2cf['queue']][_0x0766('0x70')];this[_0x0766('0xb')][_0x1fd2cf['uniqueid']][_0xbe5627][_0x0766('0x71')]=!![];}this[_0x0766('0xd')][_0x1fd2cf['interface']]=_[_0x0766('0x72')](this[_0x0766('0xd')][_0x1fd2cf[_0x0766('0x30')]],[_0x0766('0x31'),_0x0766('0x4c')]);logger[_0x0766('0x2d')](_0x0766('0x73'),_0x1fd2cf[_0x0766('0x2a')],util[_0x0766('0x2f')](this[_0x0766('0xb')][_0x1fd2cf['uniqueid']][_0xbe5627],{'showHidden':![],'depth':null}));ami[_0x0766('0x24')](_0x0766('0x74'),this[_0x0766('0xb')][_0x1fd2cf[_0x0766('0x2a')]][_0xbe5627]);logger[_0x0766('0x2d')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x1fd2cf['uniqueid'],util['inspect']({'id':this[_0x0766('0xd')][_0x1fd2cf[_0x0766('0x30')]]['id'],'destaccountcode':_0x1fd2cf[_0x0766('0x75')]},{'showHidden':![],'depth':null}));this[_0x0766('0x24')](util[_0x0766('0x32')](_0x0766('0x3e'),_0x1fd2cf[_0x0766('0x2b')]),_0x0766('0x76'),{'id':this['agents'][_0x1fd2cf[_0x0766('0x30')]]['id'],'destaccountcode':Number(_0x1fd2cf[_0x0766('0x75')])});}}}}}}catch(_0xfa7d45){logger[_0x0766('0x40')](_0x0766('0x77'),_0x1fd2cf[_0x0766('0x2a')],util['inspect'](_0xfa7d45,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x18')]=function(_0x4f187f){try{if(this[_0x0766('0x25')](_0x4f187f)){logger[_0x0766('0x2d')](_0x0766('0x78'),_0x4f187f[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x4f187f,{'showHidden':![],'depth':null}));this[_0x0766('0x79')](_0x4f187f[_0x0766('0x2a')],_['keys'](_0x4f187f[_0x0766('0x7a')])[0x0],_0x4f187f['value']);if(this[_0x0766('0xb')][_0x4f187f[_0x0766('0x2a')]]){for(var _0x3e99fa in this['channels'][_0x4f187f['uniqueid']]){if(this['channels'][_0x4f187f['uniqueid']]['hasOwnProperty'](_0x3e99fa)){logger[_0x0766('0x28')](_0x0766('0x7b'),_0x4f187f['uniqueid'],_0x3e99fa,_['keys'](_0x4f187f['variable'])[0x0],_0x4f187f[_0x0766('0x7c')]);if(_[_0x0766('0x26')](this[_0x0766('0xb')][_0x4f187f['uniqueid']][_0x3e99fa]['variables'])){this[_0x0766('0xb')][_0x4f187f[_0x0766('0x2a')]][_0x3e99fa][_0x0766('0x3c')]={};}this['channels'][_0x4f187f['uniqueid']][_0x3e99fa][_0x0766('0x3c')]=this[_0x0766('0x3c')][_0x4f187f['uniqueid']];}}}}}catch(_0x1d52f3){logger[_0x0766('0x40')]('[%s][voiceAgentReport][varset]',_0x4f187f[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x1d52f3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x79')]=function(_0x1424e4,_0x1d22e7,_0x5105e8){var _0x44c2a6=[_0x0766('0x7d'),_0x0766('0x7e'),'rtpaudioqosjitter',_0x0766('0x7f'),_0x0766('0x80'),'rtpaudioqoslossbridged',_0x0766('0x81'),'rtpaudioqosrttbridged',_0x0766('0x82'),_0x0766('0x83'),_0x0766('0x84'),'bridgepvtcallid',_0x0766('0x85'),_0x0766('0x86'),'memberinterface',_0x0766('0x87'),_0x0766('0x2b'),_0x0766('0x88'),'memberrealtime'];if(!_[_0x0766('0x89')](_0x1d22e7)&&!_['includes'](_0x44c2a6,_0x1d22e7)){if(_[_0x0766('0x26')](this['variables'][_0x1424e4])){this[_0x0766('0x3c')][_0x1424e4]={};}this['variables'][_0x1424e4][_0x1d22e7]=_0x5105e8;}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x1a')]=function(_0x3d3b65){try{if(this[_0x0766('0x25')](_0x3d3b65)){logger[_0x0766('0x2d')]('[%s][voiceAgentReport][hangup]\x20event:',_0x3d3b65['uniqueid'],util[_0x0766('0x2f')](_0x3d3b65,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]]){for(var _0x1622e4 in this[_0x0766('0xb')][_0x3d3b65['uniqueid']]){if(this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]]['hasOwnProperty'](_0x1622e4)){if(this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]][_0x1622e4][_0x0766('0x57')]==_0x0766('0x6b')&&this[_0x0766('0xb')][_0x3d3b65['uniqueid']][_0x1622e4]['agentcomplete']){logger[_0x0766('0x28')](_0x0766('0x8a'),_0x3d3b65['uniqueid'],_0x1622e4);this['channels'][_0x3d3b65[_0x0766('0x2a')]][_0x1622e4][_0x0766('0x69')]=moment()[_0x0766('0x32')](_0x0766('0x33'));}}}logger['debug'](_0x0766('0x8b'),_0x3d3b65['uniqueid'],util['inspect'](_[_0x0766('0x8c')](this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]]),{'showHidden':![],'depth':null}));ami[_0x0766('0x24')](_0x0766('0x8d'),_[_0x0766('0x8c')](this[_0x0766('0xb')][_0x3d3b65['uniqueid']]));delete this[_0x0766('0xb')][_0x3d3b65[_0x0766('0x2a')]];}if(this[_0x0766('0x3c')][_0x3d3b65[_0x0766('0x2a')]]){delete this['variables'][_0x3d3b65['uniqueid']];}}}catch(_0x9ff4e0){logger['error'](_0x0766('0x8e'),_0x3d3b65[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x9ff4e0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x20')]=function(_0x35ef43){try{if(this[_0x0766('0x25')](_0x35ef43)){logger[_0x0766('0x2d')](_0x0766('0x8f'),_0x35ef43['uniqueid'],util[_0x0766('0x2f')](_0x35ef43,{'showHidden':![],'depth':null}));if(this[_0x0766('0xb')][_0x35ef43['transfereeuniqueid']]){for(var _0x1caa65 in this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]]){if(this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]]['hasOwnProperty'](_0x1caa65)){if(_0x35ef43[_0x0766('0x91')]===_0x1caa65){logger[_0x0766('0x28')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x35ef43['uniqueid'],this[_0x0766('0xb')][_0x35ef43['transfereeuniqueid']][_0x1caa65][_0x0766('0x2b')],_0x1caa65);var _0x3302e3=moment();this[_0x0766('0xb')][_0x35ef43['transfereeuniqueid']][_0x1caa65]['agentcomplete']=!![];this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]][_0x1caa65][_0x0766('0x69')]=moment()[_0x0766('0x32')](_0x0766('0x33'));this['channels'][_0x35ef43[_0x0766('0x90')]][_0x1caa65][_0x0766('0x48')]='complete';this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]][_0x1caa65][_0x0766('0x57')]=_0x0766('0x6b');this['channels'][_0x35ef43['transfereeuniqueid']][_0x1caa65][_0x0766('0x6d')]=_0x3302e3[_0x0766('0x92')](this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]][_0x1caa65]['agentconnectAt'],_0x0766('0x93'));}}}}if(this[_0x0766('0xb')][_0x35ef43['secondtransfereruniqueid']]){var _0x7b9eb1=this[_0x0766('0xb')][_0x35ef43[_0x0766('0x94')]];this[_0x0766('0xb')][_0x35ef43['secondtransfereruniqueid']]=this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]];this[_0x0766('0xb')][_0x35ef43[_0x0766('0x90')]]=_0x7b9eb1;}}}catch(_0xb4d7f2){logger['error'](_0x0766('0x95'),_0x35ef43['uniqueid'],util[_0x0766('0x2f')](_0xb4d7f2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x22')]=function(_0x3971fb){try{if(this['isNotNull'](_0x3971fb)){logger[_0x0766('0x2d')](_0x0766('0x96'),_0x3971fb[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x3971fb,{'showHidden':![],'depth':null}));if(this['channels'][_0x3971fb[_0x0766('0x90')]]){for(var _0x315b86 in this['channels'][_0x3971fb[_0x0766('0x90')]]){if(this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x0766('0x42')](_0x315b86)){if(_0x3971fb[_0x0766('0x97')]===_0x315b86){logger[_0x0766('0x28')](_0x0766('0x98'),_0x3971fb['uniqueid'],this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x2b')],_0x315b86);var _0x3d5e67=moment();this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x15')]=!![];this[_0x0766('0xb')][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x69')]=_0x3d5e67;this['channels'][_0x3971fb[_0x0766('0x90')]][_0x315b86][_0x0766('0x48')]='complete';this[_0x0766('0xb')][_0x3971fb['transfereeuniqueid']][_0x315b86][_0x0766('0x57')]=_0x0766('0x6b');this[_0x0766('0xb')][_0x3971fb['transfereeuniqueid']][_0x315b86][_0x0766('0x6d')]=_0x3d5e67[_0x0766('0x92')](this[_0x0766('0xb')][_0x3971fb['transfereeuniqueid']][_0x315b86][_0x0766('0x43')],_0x0766('0x93'));}}}}}}catch(_0xf8e291){logger[_0x0766('0x40')](_0x0766('0x99'),_0x3971fb[_0x0766('0x2a')],util[_0x0766('0x2f')](_0xf8e291,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0766('0x23')][_0x0766('0x1c')]=function(_0x2d807f){var _0x36f6f8='';try{if(this['isNotNull'](_0x2d807f)){logger['debug'](_0x0766('0x9a'),_0x2d807f[_0x0766('0x2a')],util[_0x0766('0x2f')](_0x2d807f,{'showHidden':![],'depth':null}));if(_0x2d807f[_0x0766('0x4d')]){_0x36f6f8=_0x2d807f[_0x0766('0x4d')][_0x0766('0x9b')](0x0,_0x2d807f[_0x0766('0x4d')]['lastIndexOf']('-'));if(this['agents'][_0x36f6f8]){logger[_0x0766('0x28')](_0x0766('0x9c'),_0x2d807f[_0x0766('0x2a')],_0x36f6f8);this[_0x0766('0xd')][_0x36f6f8][_0x0766('0x9d')]=!![];}}}}catch(_0x19f1dd){logger[_0x0766('0x40')](_0x0766('0x9e'),_0x2d807f['uniqueid'],util[_0x0766('0x2f')](_0x19f1dd,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x438498){var _0x245c5a='';try{if(this[_0x0766('0x25')](_0x438498)){logger[_0x0766('0x2d')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x438498['uniqueid'],util[_0x0766('0x2f')](_0x438498,{'showHidden':![],'depth':null}));if(_0x438498[_0x0766('0x4d')]){_0x245c5a=_0x438498[_0x0766('0x4d')][_0x0766('0x9b')](0x0,_0x438498[_0x0766('0x4d')][_0x0766('0x9f')]('-'));if(this['agents'][_0x245c5a]){logger[_0x0766('0x28')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x438498[_0x0766('0x2a')],_0x245c5a);this[_0x0766('0xd')][_0x245c5a][_0x0766('0x9d')]=![];}}}}catch(_0xccd749){logger[_0x0766('0x40')](_0x0766('0xa0'),_0x438498[_0x0766('0x2a')],util['inspect'](_0xccd749,{'showHidden':![],'depth':null}));}};module[_0x0766('0xa1')]=VoiceAgentReport;
\ No newline at end of file
+var _0xe3aa=['voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','membername','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','destconnectedlinenum','accountcode','exten','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswer','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','complete','transfer','agent','talktime','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]','lodash','util','ioredis','../../../config/logger','ami','../ami','defaults','localhost','socket.io-emitter','redis','channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','isUndefined','queue','YYYY-MM-DD\x20HH:mm:ss','called','mandatoryDisposition','type','inbound'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe3aa,0x74));var _0xae3a=function(_0x20ce5e,_0x412fb6){_0x20ce5e=_0x20ce5e-0x0;var _0x21ec8c=_0xe3aa[_0x20ce5e];return _0x21ec8c;};'use strict';var _=require(_0xae3a('0x0'));var moment=require('moment');var util=require(_0xae3a('0x1'));var Redis=require(_0xae3a('0x2'));var config=require('../../../config/environment');var logger=require(_0xae3a('0x3'))(_0xae3a('0x4'));var ami=require(_0xae3a('0x5'));config['redis']=_[_0xae3a('0x6')](config['redis'],{'host':_0xae3a('0x7'),'port':0x18eb});var io=require(_0xae3a('0x8'))(new Redis(config[_0xae3a('0x9')]));function VoiceAgentReport(_0x4c2485){this[_0xae3a('0xa')]={};this[_0xae3a('0xb')]=_0x4c2485[_0xae3a('0xa')];this[_0xae3a('0xc')]=_0x4c2485['voiceQueues'];this['agents']=_0x4c2485[_0xae3a('0xd')];this[_0xae3a('0xe')]={};ami['on']('agentcalled',this[_0xae3a('0xf')][_0xae3a('0x10')](this));ami['on']('agentconnect',this[_0xae3a('0x11')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xae3a('0x10')](this));ami['on'](_0xae3a('0x12'),this[_0xae3a('0x13')]['bind'](this));ami['on'](_0xae3a('0x14'),this[_0xae3a('0x15')][_0xae3a('0x10')](this));ami['on'](_0xae3a('0x16'),this[_0xae3a('0x17')][_0xae3a('0x10')](this));ami['on'](_0xae3a('0x18'),this[_0xae3a('0x19')][_0xae3a('0x10')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xae3a('0x10')](this));ami['on'](_0xae3a('0x1a'),this['syncMusicOnHoldStop'][_0xae3a('0x10')](this));ami['on'](_0xae3a('0x1b'),this[_0xae3a('0x1c')][_0xae3a('0x10')](this));ami['on']('blindtransfer',this[_0xae3a('0x1d')][_0xae3a('0x10')](this));}VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x1f')]=function(_0x36f703,_0x599589,_0x7235f){io['to'](_0x36f703)['emit'](_0x599589,_0x7235f);};VoiceAgentReport[_0xae3a('0x1e')]['isNotNull']=function(_0x1846be){return _0x1846be!==null&&!_['isUndefined'](_0x1846be);};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0xf')]=function(_0x4f8060){try{if(this['isNotNull'](_0x4f8060)){logger[_0xae3a('0x20')](_0xae3a('0x21'),_0x4f8060[_0xae3a('0x22')],_0x4f8060['membername'],_0x4f8060[_0xae3a('0x23')]);logger[_0xae3a('0x24')](_0xae3a('0x25'),_0x4f8060[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x4f8060,{'showHidden':![],'depth':null}));if(_[_0xae3a('0x27')](this[_0xae3a('0xa')][_0x4f8060[_0xae3a('0x22')]])){this[_0xae3a('0xa')][_0x4f8060[_0xae3a('0x22')]]={};}var _0x575575=this['agents'][_0x4f8060['interface']];var _0x108a81=this[_0xae3a('0xa')][_0x4f8060['uniqueid']][_0x4f8060[_0xae3a('0x23')]];var _0x32014e=this['voiceQueues'][_0x4f8060[_0xae3a('0x28')]];var _0x204c7e=this[_0xae3a('0xe')][_0x4f8060['uniqueid']];if(_[_0xae3a('0x27')](_0x108a81)){_0x108a81={'agentcalledAt':moment()['format'](_0xae3a('0x29')),'lastevent':_0xae3a('0x2a'),'mandatoryDisposition':_0x32014e&&_0x32014e[_0xae3a('0x2b')]?_0x32014e[_0xae3a('0x2b')]:![],'type':_0x32014e&&_0x32014e['type']?_0x32014e[_0xae3a('0x2c')]:_0xae3a('0x2d'),'variables':_0x204c7e,'motionChannel':_0xae3a('0x2e')};}_[_0xae3a('0x2f')](_0x108a81,_[_0xae3a('0x30')](_0x4f8060,[_0xae3a('0x31'),_0xae3a('0x32')]));logger['debug'](_0xae3a('0x33'),_0x4f8060['uniqueid'],util[_0xae3a('0x26')](_0x108a81,{'showHidden':![],'depth':null}));ami[_0xae3a('0x1f')](_0xae3a('0x34'),_0x108a81);var _0xd82de7={'id':_0x575575['id'],'calleridnum':_0x108a81[_0xae3a('0x35')],'queue':_0x108a81[_0xae3a('0x28')],'variables':_0x108a81[_0xae3a('0xe')],'uniqueid':_0x4f8060['uniqueid']};logger['debug'](_0xae3a('0x36'),_0x4f8060[_0xae3a('0x22')],util[_0xae3a('0x26')](_0xd82de7,{'showHidden':![],'depth':null}));this[_0xae3a('0x1f')](util[_0xae3a('0x37')](_0xae3a('0x38'),_0x4f8060['membername']),_0xae3a('0x39'),_0xd82de7);}}catch(_0x4b03de){logger[_0xae3a('0x3a')](_0xae3a('0x3b'),_0x4f8060['uniqueid'],util['inspect'](_0x4b03de,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x11')]=function(_0x53fc8f){try{if(this[_0xae3a('0x3c')](_0x53fc8f)){if(this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]]){logger[_0xae3a('0x24')](_0xae3a('0x3d'),_0x53fc8f[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x53fc8f,{'showHidden':![],'depth':null}));for(var _0x3dc333 in this['channels'][_0x53fc8f[_0xae3a('0x22')]]){if(this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0xae3a('0x3e')](_0x3dc333)){if(_0x53fc8f['destuniqueid']===_0x3dc333){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x53fc8f[_0xae3a('0x22')],_0x53fc8f[_0xae3a('0x3f')],_0x53fc8f[_0xae3a('0x23')]);this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x40')]=moment()[_0xae3a('0x37')](_0xae3a('0x29'));this[_0xae3a('0xa')][_0x53fc8f['uniqueid']][_0x3dc333][_0xae3a('0x41')]=_0x53fc8f[_0xae3a('0x41')];this['channels'][_0x53fc8f['uniqueid']][_0x3dc333][_0xae3a('0x42')]=_0x53fc8f[_0xae3a('0x42')];this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x43')]=_0x53fc8f[_0xae3a('0x43')];this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x44')]=_0x53fc8f[_0xae3a('0x44')];this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x45')]=_0x53fc8f[_0xae3a('0x45')];this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x46')]=_0xae3a('0x47');if(this['voiceChannels'][this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333]['uniqueid']]){var _0x4f2253=this[_0xae3a('0xb')][this['channels'][_0x53fc8f['uniqueid']][_0x3dc333][_0xae3a('0x22')]]['routealias'];this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x48')]=_0x4f2253;_0x53fc8f[_0xae3a('0x48')]=_0x4f2253;}_[_0xae3a('0x2f')](this[_0xae3a('0xd')][_0x53fc8f[_0xae3a('0x49')]],_['pick'](_0x53fc8f,[_0xae3a('0x28'),_0xae3a('0x4a'),_0xae3a('0x48')]));var _0x1ee8d4=this[_0xae3a('0xd')][_0x53fc8f['channel']['split']('-')[0x0]];var _0x4b4ea5={'id':_0x1ee8d4['id'],'name':_0x1ee8d4['name'],'agentconnected':!![],'destaccountcode':_0x1ee8d4[_0xae3a('0x4b')],'destconnectedlinenum':this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x53fc8f[_0xae3a('0x23')]][_0xae3a('0x4c')],'queue':this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x53fc8f[_0xae3a('0x23')]][_0xae3a('0x28')],'routealias':this[_0xae3a('0xa')][_0x53fc8f['uniqueid']][_0x53fc8f[_0xae3a('0x23')]][_0xae3a('0x48')],'uniqueid':this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x53fc8f[_0xae3a('0x23')]]['uniqueid']};logger[_0xae3a('0x24')](_0xae3a('0x4d'),_0x53fc8f[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x4b4ea5,{'showHidden':![],'depth':null}));ami[_0xae3a('0x1f')](_0xae3a('0x4e'),_0x4b4ea5);logger[_0xae3a('0x24')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x53fc8f[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x4b4ea5,{'showHidden':![],'depth':null}));this['emit'](util[_0xae3a('0x37')](_0xae3a('0x38'),_0x53fc8f[_0xae3a('0x3f')]),_0xae3a('0x4f'),_0x4b4ea5);}else if(!this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333]['agentringnoanswer']&&!this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x14')]){logger['info'](_0xae3a('0x50'),_0x53fc8f[_0xae3a('0x22')],this[_0xae3a('0xa')][_0x53fc8f['uniqueid']][_0x3dc333]['membername'],_0x3dc333);this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x51')]=!![];this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x52')]=moment()[_0xae3a('0x37')](_0xae3a('0x29'));this[_0xae3a('0xa')][_0x53fc8f['uniqueid']][_0x3dc333][_0xae3a('0x53')]=_0x53fc8f[_0xae3a('0x23')];this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x54')]=_0x53fc8f[_0xae3a('0x3f')];this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x46')]=_0xae3a('0x55');this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333][_0xae3a('0x56')]=_0xae3a('0x55');logger[_0xae3a('0x24')](_0xae3a('0x57'),_0x53fc8f[_0xae3a('0x22')],util[_0xae3a('0x26')](this[_0xae3a('0xa')][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333],{'showHidden':![],'depth':null}));ami['emit'](_0xae3a('0x58'),this['channels'][_0x53fc8f[_0xae3a('0x22')]][_0x3dc333]);}}}}}}catch(_0x9a6f43){logger[_0xae3a('0x3a')]('[%s][voiceAgentReport][agentconnect]',_0x53fc8f[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x9a6f43,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')]['syncAgentRingNoAnswer']=function(_0xcf6796){try{if(this['isNotNull'](_0xcf6796)){logger[_0xae3a('0x24')](_0xae3a('0x59'),_0xcf6796[_0xae3a('0x22')],util[_0xae3a('0x26')](_0xcf6796,{'showHidden':![],'depth':null}));if(this[_0xae3a('0xa')][_0xcf6796[_0xae3a('0x22')]]&&this[_0xae3a('0xa')][_0xcf6796[_0xae3a('0x22')]][_0xcf6796[_0xae3a('0x23')]]){logger[_0xae3a('0x20')](_0xae3a('0x5a'),_0xcf6796[_0xae3a('0x22')],_0xcf6796[_0xae3a('0x3f')],_0xcf6796['destuniqueid']);var _0x238719=this[_0xae3a('0xd')][_0xcf6796[_0xae3a('0x49')]];var _0x53641d=this['channels'][_0xcf6796[_0xae3a('0x22')]][_0xcf6796[_0xae3a('0x23')]];_0x53641d[_0xae3a('0x51')]=!![];_0x53641d[_0xae3a('0x52')]=moment()[_0xae3a('0x37')](_0xae3a('0x29'));_0x53641d[_0xae3a('0x46')]='rejected';_0x53641d[_0xae3a('0x56')]=_0xae3a('0x5b');var _0x5c4851={'id':_0x238719['id'],'name':_0x238719[_0xae3a('0x5c')],'queue':_0x53641d[_0xae3a('0x28')],'uniqueid':_0x53641d[_0xae3a('0x22')]};logger[_0xae3a('0x24')](_0xae3a('0x5d'),_0xcf6796[_0xae3a('0x22')],util['inspect'](_0x5c4851,{'showHidden':![],'depth':null}));this[_0xae3a('0x1f')](util['format'](_0xae3a('0x38'),_0x238719[_0xae3a('0x5c')]),'user:agentringnoanswer',_0x5c4851);ami['emit']('custom:agentringnoanswer',_0x53641d);}}}catch(_0x4fc7e9){logger['error']('[%s][voiceAgentReport][agentringnoanswer]',_0xcf6796[_0xae3a('0x22')],util['inspect'](_0x4fc7e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x13')]=function(_0x481c92){try{if(this[_0xae3a('0x3c')](_0x481c92)){logger[_0xae3a('0x24')](_0xae3a('0x5e'),_0x481c92[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x481c92,{'showHidden':![],'depth':null}));if(this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]]){for(var _0x4de374 in this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]]){if(this[_0xae3a('0xa')][_0x481c92['uniqueid']]['hasOwnProperty'](_0x4de374)&&!this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374][_0xae3a('0x51')]&&!this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374][_0xae3a('0x14')]){logger[_0xae3a('0x20')](_0xae3a('0x5f'),_0x481c92[_0xae3a('0x22')],this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374][_0xae3a('0x3f')],_0x4de374);this['channels'][_0x481c92['uniqueid']][_0x4de374][_0xae3a('0x51')]=!![];this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374][_0xae3a('0x52')]=moment()[_0xae3a('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xae3a('0xa')][_0x481c92['uniqueid']][_0x4de374][_0xae3a('0x46')]='abandoned';this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374]['reason']=_0xae3a('0x60');logger[_0xae3a('0x24')](_0xae3a('0x61'),_0x481c92[_0xae3a('0x22')],util[_0xae3a('0x26')](this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374],{'showHidden':![],'depth':null}));ami[_0xae3a('0x1f')](_0xae3a('0x62'),this[_0xae3a('0xa')][_0x481c92[_0xae3a('0x22')]][_0x4de374]);}}}}}catch(_0x3dabb6){logger[_0xae3a('0x3a')]('[%s][voiceAgentReport][queuecallerabandon]',_0x481c92['uniqueid'],util[_0xae3a('0x26')](_0x3dabb6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentComplete']=function(_0x566c1a){try{if(this[_0xae3a('0x3c')](_0x566c1a)){logger[_0xae3a('0x24')](_0xae3a('0x63'),_0x566c1a[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x566c1a,{'showHidden':![],'depth':null}));if(this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]]){for(var _0x4f1dd2 in this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]]){if(this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]]['hasOwnProperty'](_0x4f1dd2)){if(this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2][_0xae3a('0x40')]&&!this['channels'][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2][_0xae3a('0x14')]){logger[_0xae3a('0x20')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x566c1a[_0xae3a('0x22')],this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2][_0xae3a('0x3f')],_0x4f1dd2);this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2]['agentcomplete']=!![];this[_0xae3a('0xa')][_0x566c1a['uniqueid']][_0x4f1dd2]['agentcompleteAt']=moment()[_0xae3a('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xae3a('0xa')][_0x566c1a['uniqueid']][_0x4f1dd2][_0xae3a('0x46')]=_0xae3a('0x64');this['channels'][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2]['reason']=_0x566c1a['reason']==_0xae3a('0x65')?_0xae3a('0x66'):_0x566c1a[_0xae3a('0x56')];this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2][_0xae3a('0x67')]=_0x566c1a[_0xae3a('0x67')];if(this[_0xae3a('0xc')][_0x566c1a[_0xae3a('0x28')]]&&this[_0xae3a('0xc')][_0x566c1a[_0xae3a('0x28')]]['acw']){this['channels'][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2][_0xae3a('0x68')]=this['voiceQueues'][_0x566c1a[_0xae3a('0x28')]][_0xae3a('0x69')];this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2][_0xae3a('0x6a')]=!![];}this[_0xae3a('0xd')][_0x566c1a['interface']]=_['omit'](this[_0xae3a('0xd')][_0x566c1a[_0xae3a('0x49')]],[_0xae3a('0x28'),_0xae3a('0x4a')]);logger['debug'](_0xae3a('0x6b'),_0x566c1a[_0xae3a('0x22')],util[_0xae3a('0x26')](this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2],{'showHidden':![],'depth':null}));ami['emit'](_0xae3a('0x6c'),this[_0xae3a('0xa')][_0x566c1a[_0xae3a('0x22')]][_0x4f1dd2]);logger[_0xae3a('0x24')](_0xae3a('0x6d'),_0x566c1a[_0xae3a('0x22')],util[_0xae3a('0x26')]({'id':this[_0xae3a('0xd')][_0x566c1a[_0xae3a('0x49')]]['id'],'destaccountcode':_0x566c1a[_0xae3a('0x6e')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xae3a('0x38'),_0x566c1a['membername']),_0xae3a('0x6f'),{'id':this[_0xae3a('0xd')][_0x566c1a[_0xae3a('0x49')]]['id'],'destaccountcode':Number(_0x566c1a[_0xae3a('0x6e')])});}}}}}}catch(_0x3edd6f){logger[_0xae3a('0x3a')](_0xae3a('0x70'),_0x566c1a[_0xae3a('0x22')],util['inspect'](_0x3edd6f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x17')]=function(_0x3ba967){try{if(this[_0xae3a('0x3c')](_0x3ba967)){logger['debug'](_0xae3a('0x71'),_0x3ba967[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x3ba967,{'showHidden':![],'depth':null}));this['addVariable'](_0x3ba967[_0xae3a('0x22')],_['keys'](_0x3ba967[_0xae3a('0x72')])[0x0],_0x3ba967[_0xae3a('0x73')]);if(this[_0xae3a('0xa')][_0x3ba967[_0xae3a('0x22')]]){for(var _0x3fe39f in this[_0xae3a('0xa')][_0x3ba967['uniqueid']]){if(this[_0xae3a('0xa')][_0x3ba967[_0xae3a('0x22')]]['hasOwnProperty'](_0x3fe39f)){logger[_0xae3a('0x20')](_0xae3a('0x74'),_0x3ba967[_0xae3a('0x22')],_0x3fe39f,_['keys'](_0x3ba967['variable'])[0x0],_0x3ba967[_0xae3a('0x73')]);if(_[_0xae3a('0x27')](this[_0xae3a('0xa')][_0x3ba967[_0xae3a('0x22')]][_0x3fe39f][_0xae3a('0xe')])){this['channels'][_0x3ba967['uniqueid']][_0x3fe39f][_0xae3a('0xe')]={};}this['channels'][_0x3ba967['uniqueid']][_0x3fe39f][_0xae3a('0xe')]=this[_0xae3a('0xe')][_0x3ba967[_0xae3a('0x22')]];}}}}}catch(_0x927977){logger[_0xae3a('0x3a')](_0xae3a('0x75'),_0x3ba967[_0xae3a('0x22')],util['inspect'](_0x927977,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x76')]=function(_0x214369,_0x4d0985,_0xca659e){var _0x3a6880=['rtpaudioqos',_0xae3a('0x77'),'rtpaudioqosjitter',_0xae3a('0x78'),_0xae3a('0x79'),_0xae3a('0x7a'),'rtpaudioqosrtt',_0xae3a('0x7b'),_0xae3a('0x7c'),_0xae3a('0x7d'),_0xae3a('0x7e'),_0xae3a('0x7f'),_0xae3a('0x80'),_0xae3a('0x81'),_0xae3a('0x82'),_0xae3a('0x83'),_0xae3a('0x3f'),'memberpenalty',_0xae3a('0x84')];if(!_[_0xae3a('0x85')](_0x4d0985)&&!_[_0xae3a('0x86')](_0x3a6880,_0x4d0985)){if(_[_0xae3a('0x27')](this[_0xae3a('0xe')][_0x214369])){this[_0xae3a('0xe')][_0x214369]={};}this[_0xae3a('0xe')][_0x214369][_0x4d0985]=_0xca659e;}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x19')]=function(_0x2e0bcf){try{if(this[_0xae3a('0x3c')](_0x2e0bcf)){logger[_0xae3a('0x24')](_0xae3a('0x87'),_0x2e0bcf[_0xae3a('0x22')],util['inspect'](_0x2e0bcf,{'showHidden':![],'depth':null}));if(this[_0xae3a('0xa')][_0x2e0bcf[_0xae3a('0x22')]]){for(var _0x580bb0 in this['channels'][_0x2e0bcf[_0xae3a('0x22')]]){if(this[_0xae3a('0xa')][_0x2e0bcf[_0xae3a('0x22')]][_0xae3a('0x3e')](_0x580bb0)){if(this[_0xae3a('0xa')][_0x2e0bcf[_0xae3a('0x22')]][_0x580bb0][_0xae3a('0x56')]==_0xae3a('0x65')&&this[_0xae3a('0xa')][_0x2e0bcf[_0xae3a('0x22')]][_0x580bb0][_0xae3a('0x14')]){logger[_0xae3a('0x20')](_0xae3a('0x88'),_0x2e0bcf[_0xae3a('0x22')],_0x580bb0);this[_0xae3a('0xa')][_0x2e0bcf['uniqueid']][_0x580bb0]['agentcompleteAt']=moment()['format'](_0xae3a('0x29'));}}}logger[_0xae3a('0x24')]('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x2e0bcf[_0xae3a('0x22')],util[_0xae3a('0x26')](_[_0xae3a('0x89')](this[_0xae3a('0xa')][_0x2e0bcf[_0xae3a('0x22')]]),{'showHidden':![],'depth':null}));ami[_0xae3a('0x1f')](_0xae3a('0x8a'),_[_0xae3a('0x89')](this[_0xae3a('0xa')][_0x2e0bcf['uniqueid']]));delete this[_0xae3a('0xa')][_0x2e0bcf[_0xae3a('0x22')]];}if(this['variables'][_0x2e0bcf[_0xae3a('0x22')]]){delete this['variables'][_0x2e0bcf['uniqueid']];}}}catch(_0x19d4d1){logger[_0xae3a('0x3a')](_0xae3a('0x8b'),_0x2e0bcf[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x19d4d1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x3f7fce){try{if(this[_0xae3a('0x3c')](_0x3f7fce)){logger[_0xae3a('0x24')](_0xae3a('0x8c'),_0x3f7fce[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x3f7fce,{'showHidden':![],'depth':null}));if(this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x8d')]]){for(var _0x592844 in this[_0xae3a('0xa')][_0x3f7fce['transfereeuniqueid']]){if(this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x8d')]][_0xae3a('0x3e')](_0x592844)){if(_0x3f7fce['origtransfereruniqueid']===_0x592844){logger[_0xae3a('0x20')](_0xae3a('0x8e'),_0x3f7fce[_0xae3a('0x22')],this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x8d')]][_0x592844]['membername'],_0x592844);var _0x192cb0=moment();this['channels'][_0x3f7fce['transfereeuniqueid']][_0x592844][_0xae3a('0x14')]=!![];this[_0xae3a('0xa')][_0x3f7fce['transfereeuniqueid']][_0x592844][_0xae3a('0x8f')]=moment()[_0xae3a('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x8d')]][_0x592844]['lastevent']=_0xae3a('0x64');this['channels'][_0x3f7fce[_0xae3a('0x8d')]][_0x592844]['reason']=_0xae3a('0x65');this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x8d')]][_0x592844]['talktime']=_0x192cb0['diff'](this['channels'][_0x3f7fce[_0xae3a('0x8d')]][_0x592844][_0xae3a('0x40')],_0xae3a('0x90'));}}}}if(this[_0xae3a('0xa')][_0x3f7fce['secondtransfereruniqueid']]){var _0x53f1be=this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x91')]];this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x91')]]=this[_0xae3a('0xa')][_0x3f7fce[_0xae3a('0x8d')]];this[_0xae3a('0xa')][_0x3f7fce['transfereeuniqueid']]=_0x53f1be;}}}catch(_0x1b3ec6){logger[_0xae3a('0x3a')](_0xae3a('0x92'),_0x3f7fce[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x1b3ec6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')]['syncBlindTransfer']=function(_0x70d227){try{if(this[_0xae3a('0x3c')](_0x70d227)){logger['debug'](_0xae3a('0x93'),_0x70d227[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x70d227,{'showHidden':![],'depth':null}));if(this[_0xae3a('0xa')][_0x70d227[_0xae3a('0x8d')]]){for(var _0x3a0be8 in this[_0xae3a('0xa')][_0x70d227[_0xae3a('0x8d')]]){if(this[_0xae3a('0xa')][_0x70d227[_0xae3a('0x8d')]][_0xae3a('0x3e')](_0x3a0be8)){if(_0x70d227[_0xae3a('0x94')]===_0x3a0be8){logger[_0xae3a('0x20')](_0xae3a('0x95'),_0x70d227['uniqueid'],this[_0xae3a('0xa')][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8][_0xae3a('0x3f')],_0x3a0be8);var _0x484c19=moment();this['channels'][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8]['agentcomplete']=!![];this['channels'][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8][_0xae3a('0x8f')]=_0x484c19;this['channels'][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8][_0xae3a('0x46')]=_0xae3a('0x64');this[_0xae3a('0xa')][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8]['reason']=_0xae3a('0x65');this['channels'][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8]['talktime']=_0x484c19[_0xae3a('0x96')](this[_0xae3a('0xa')][_0x70d227[_0xae3a('0x8d')]][_0x3a0be8][_0xae3a('0x40')],_0xae3a('0x90'));}}}}}}catch(_0x4c3fd9){logger[_0xae3a('0x3a')](_0xae3a('0x97'),_0x70d227[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x4c3fd9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0x98')]=function(_0x15e8a6){var _0x3b2fa0='';try{if(this[_0xae3a('0x3c')](_0x15e8a6)){logger[_0xae3a('0x24')](_0xae3a('0x99'),_0x15e8a6[_0xae3a('0x22')],util[_0xae3a('0x26')](_0x15e8a6,{'showHidden':![],'depth':null}));if(_0x15e8a6['channel']){_0x3b2fa0=_0x15e8a6['channel'][_0xae3a('0x9a')](0x0,_0x15e8a6[_0xae3a('0x9b')][_0xae3a('0x9c')]('-'));if(this['agents'][_0x3b2fa0]){logger[_0xae3a('0x20')](_0xae3a('0x9d'),_0x15e8a6[_0xae3a('0x22')],_0x3b2fa0);this['agents'][_0x3b2fa0][_0xae3a('0x9e')]=!![];}}}}catch(_0x54f442){logger[_0xae3a('0x3a')](_0xae3a('0x9f'),_0x15e8a6[_0xae3a('0x22')],util['inspect'](_0x54f442,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xae3a('0x1e')][_0xae3a('0xa0')]=function(_0x3bfd8a){var _0x4f26b1='';try{if(this[_0xae3a('0x3c')](_0x3bfd8a)){logger[_0xae3a('0x24')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x3bfd8a['uniqueid'],util['inspect'](_0x3bfd8a,{'showHidden':![],'depth':null}));if(_0x3bfd8a['channel']){_0x4f26b1=_0x3bfd8a[_0xae3a('0x9b')]['substring'](0x0,_0x3bfd8a[_0xae3a('0x9b')]['lastIndexOf']('-'));if(this['agents'][_0x4f26b1]){logger[_0xae3a('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3bfd8a['uniqueid'],_0x4f26b1);this['agents'][_0x4f26b1]['onhold']=![];}}}}catch(_0x59abaa){logger['error'](_0xae3a('0xa1'),_0x3bfd8a['uniqueid'],util[_0xae3a('0x26')](_0x59abaa,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index 16a3c5b..2c6c385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d5=['originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:%s','user:agentcomplete','length','transferType','then','getSettings','stopRecordingOnTransfer','StopMixMonitor','Action','catch','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','transfertargetcalleridnum','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','origtransfererlinkedid','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','keys','context','from-sip','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','channel','split','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','undefined','exten','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','queue','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','includes','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','diff','connectedlinename','UserId','membername','holdtime','destinationchannel','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s'];(function(_0x2ec8e3,_0x53a96a){var _0x186638=function(_0x369773){while(--_0x369773){_0x2ec8e3['push'](_0x2ec8e3['shift']());}};_0x186638(++_0x53a96a);}(_0x55d5,0x100));var _0x555d=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x55d5[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0x555d('0x0'));var moment=require(_0x555d('0x1'));var util=require(_0x555d('0x2'));var path=require(_0x555d('0x3'));var Redis=require('ioredis');var config=require(_0x555d('0x4'));var logger=require(_0x555d('0x5'))('ami');var ami=require(_0x555d('0x6'));var Channel=require(_0x555d('0x7'));var RpcSetting=require(_0x555d('0x8'));var applications=[_0x555d('0x9'),'queue',_0x555d('0xa'),_0x555d('0xb'),_0x555d('0xc'),_0x555d('0xd')];var dispositions=[_0x555d('0xe'),_0x555d('0xf'),'FAILED',_0x555d('0xe'),_0x555d('0xe'),_0x555d('0xe'),_0x555d('0x10'),'BUSY',_0x555d('0xf'),'FAILED','FAILED'];config[_0x555d('0x11')]=_[_0x555d('0x12')](config[_0x555d('0x11')],{'host':_0x555d('0x13'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x555d('0x11')]));function VoiceCallReport(_0x1d3317){this[_0x555d('0x14')]=_0x1d3317[_0x555d('0x14')];this[_0x555d('0x15')]=_0x1d3317[_0x555d('0x15')];this[_0x555d('0x16')]={};ami['on'](_0x555d('0x17'),this[_0x555d('0x18')][_0x555d('0x19')](this));ami['on'](_0x555d('0x1a'),this[_0x555d('0x18')][_0x555d('0x19')](this));ami['on']('newchannel',this['syncNewChannel']['bind'](this));ami['on']('newstate',this[_0x555d('0x1b')][_0x555d('0x19')](this));ami['on'](_0x555d('0x1c'),this[_0x555d('0x1d')][_0x555d('0x19')](this));ami['on'](_0x555d('0x1e'),this[_0x555d('0x1f')][_0x555d('0x19')](this));ami['on']('newcallerid',this[_0x555d('0x20')][_0x555d('0x19')](this));ami['on'](_0x555d('0x21'),this[_0x555d('0x22')]['bind'](this));ami['on'](_0x555d('0x23'),this[_0x555d('0x24')]['bind'](this));ami['on'](_0x555d('0x25'),this[_0x555d('0x26')][_0x555d('0x19')](this));ami['on'](_0x555d('0x27'),this[_0x555d('0x28')][_0x555d('0x19')](this));try{logger[_0x555d('0x29')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x555d('0x2a')]();}catch(_0x5847ec){logger[_0x555d('0x2b')](_0x555d('0x2c'),util[_0x555d('0x2d')](_0x5847ec,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x555d('0x2e')][_0x555d('0x2f')]=function(_0x2ef1db){return _0x2ef1db!==null&&!_[_0x555d('0x30')](_0x2ef1db);};VoiceCallReport[_0x555d('0x2e')]['emit']=function(_0x1642af,_0x5a8e25,_0x522e07){io['to'](_0x1642af)[_0x555d('0x31')](_0x5a8e25,_0x522e07);};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x20')]=function(_0x103c00){try{if(this[_0x555d('0x2f')](_0x103c00)){logger[_0x555d('0x29')](_0x555d('0x32'),_0x103c00['uniqueid'],_0x103c00[_0x555d('0x33')],_0x103c00[_0x555d('0x34')]);logger[_0x555d('0x35')](_0x555d('0x36'),_0x103c00[_0x555d('0x37')],util[_0x555d('0x2d')](_0x103c00,{'showHidden':![],'depth':null}));if(_0x103c00[_0x555d('0x37')]===_0x103c00[_0x555d('0x38')]){if(!_[_0x555d('0x30')](this[_0x555d('0x14')][_0x103c00[_0x555d('0x37')]])){_[_0x555d('0x39')](this[_0x555d('0x14')][_0x103c00[_0x555d('0x37')]],_[_0x555d('0x3a')](_0x103c00,_[_0x555d('0x3b')](this[_0x555d('0x14')][_0x103c00[_0x555d('0x37')]])));}}if(_0x103c00[_0x555d('0x3c')]===_0x555d('0x3d')){if(this[_0x555d('0x15')][_0x103c00['channel']['split']('-')[0x0]]){if(_0x103c00['exten']==_0x555d('0x3e')){this[_0x555d('0x15')][_0x103c00['channel']['split']('-')[0x0]][_0x555d('0x3f')]=_0x103c00[_0x555d('0x40')];this['emit'](util[_0x555d('0x41')]('user:%s',this[_0x555d('0x15')][_0x103c00[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]][_0x555d('0x44')]),_0x555d('0x45'),{'destaccountcode':this[_0x555d('0x15')][_0x103c00[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]][_0x555d('0x46')],'destconnectedlinenum':_0x103c00[_0x555d('0x40')]});}}}}}catch(_0x5c83a8){logger[_0x555d('0x2b')](_0x555d('0x47'),_0x103c00['uniqueid'],util[_0x555d('0x2d')](_0x5c83a8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')]['syncNewChannel']=function(_0x266122){try{if(this['isNotNull'](_0x266122)){logger[_0x555d('0x35')]('[%s][voiceCallReport][newchannel]\x20event:',_0x266122['uniqueid'],util[_0x555d('0x2d')](_0x266122,{'showHidden':![],'depth':null}));if(this[_0x555d('0x14')][_0x266122[_0x555d('0x37')]]){return;}if(_0x266122[_0x555d('0x42')]===_0x555d('0x48')){return;}if(_0x266122[_0x555d('0x37')]!==_0x266122['linkedid']&&!this[_0x555d('0x16')][_0x266122['linkedid']]){return;}logger[_0x555d('0x29')](_0x555d('0x49'),_0x266122['uniqueid'],_0x266122['context'],_0x266122['exten']);this[_0x555d('0x14')][_0x266122[_0x555d('0x37')]]=new Channel();this['channels'][_0x266122['uniqueid']][_0x555d('0x4a')]=moment()[_0x555d('0x41')](_0x555d('0x4b'));this[_0x555d('0x14')][_0x266122[_0x555d('0x37')]][_0x555d('0x4c')]=dispositions[_[_0x555d('0x4d')](_0x266122['channelstate'])];_[_0x555d('0x39')](this[_0x555d('0x14')][_0x266122[_0x555d('0x37')]],_[_0x555d('0x3a')](_0x266122,_[_0x555d('0x3b')](this[_0x555d('0x14')][_0x266122[_0x555d('0x37')]])));if(_0x266122['context']===_0x555d('0x3d')){var _0x499534=this['agents'][_0x266122[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]];if(_0x499534&&typeof _0x499534[_0x555d('0x3f')]===_0x555d('0x4e')){_0x499534[_0x555d('0x3f')]=_0x266122[_0x555d('0x4f')];logger['debug'](_0x555d('0x50'),_0x266122['uniqueid'],util['inspect']({'id':_0x499534['id'],'destaccountcode':_0x499534['accountcode'],'destconnectedlinenum':_0x266122[_0x555d('0x4f')]},{'showHidden':![],'depth':null}));this[_0x555d('0x31')](util[_0x555d('0x41')]('user:%s',_0x499534['name']),'user:agentconnect',{'id':_0x499534['id'],'destaccountcode':_0x499534[_0x555d('0x46')],'destconnectedlinenum':_0x266122[_0x555d('0x4f')]});}}}}catch(_0x3d8cf3){logger['error']('[%s][voiceCallReport][newchannel]',_0x266122[_0x555d('0x37')],util[_0x555d('0x2d')](_0x3d8cf3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x18')]=function(_0x75eca4){try{if(this[_0x555d('0x2f')](_0x75eca4)){logger['debug']('[%s][voiceCallReport][newexten]\x20event:',_0x75eca4[_0x555d('0x37')],util[_0x555d('0x2d')](_0x75eca4,{'showHidden':![],'depth':null}));if(_0x75eca4['channel']==='OutgoingSpoolFailed'||_0x75eca4['exten']==='h')return;if(_0x75eca4[_0x555d('0x37')]===_0x75eca4['linkedid']||this[_0x555d('0x16')][_0x75eca4[_0x555d('0x38')]]){_0x75eca4[_0x555d('0x51')]=_0x75eca4[_0x555d('0x51')]?_0x75eca4['application'][_0x555d('0x52')]():undefined;_0x75eca4[_0x555d('0x53')]=_0x75eca4['appdata']||_0x75eca4['applicationdata'];if(_0x75eca4[_0x555d('0x54')]&&!_0x75eca4[_0x555d('0x54')][_0x555d('0x55')]('CDR(routeAlias)')&&_0x75eca4[_0x555d('0x51')]!==_0x555d('0x56')){_0x75eca4[_0x555d('0x53')]=_0x75eca4[_0x555d('0x53')][_0x555d('0x52')]();}logger[_0x555d('0x29')](_0x555d('0x57'),_0x75eca4[_0x555d('0x37')],_0x75eca4[_0x555d('0x51')],_0x75eca4[_0x555d('0x53')]);if(_[_0x555d('0x30')](this[_0x555d('0x14')][_0x75eca4['uniqueid']])){this[_0x555d('0x14')][_0x75eca4[_0x555d('0x37')]]=new Channel();this['channels'][_0x75eca4[_0x555d('0x37')]]['starttime']=_0x75eca4['duration']?moment()[_0x555d('0x58')](moment['duration'](_0x75eca4[_0x555d('0x59')])['seconds'](),_0x555d('0x5a'))[_0x555d('0x41')](_0x555d('0x4b')):moment()[_0x555d('0x41')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x75eca4['uniqueid']][_0x555d('0x4c')]=_0x555d('0xe');}_[_0x555d('0x39')](this[_0x555d('0x14')][_0x75eca4[_0x555d('0x37')]],_[_0x555d('0x3a')](_0x75eca4,_[_0x555d('0x3b')](this['channels'][_0x75eca4[_0x555d('0x37')]])));if(_[_0x555d('0x5b')](applications,_0x75eca4['application'])){this[_0x555d('0x14')][_0x75eca4['uniqueid']]['lastapplication']=_0x75eca4[_0x555d('0x51')];this[_0x555d('0x14')][_0x75eca4[_0x555d('0x37')]]['lastdata']=_0x75eca4[_0x555d('0x53')];if(_0x75eca4[_0x555d('0x51')]===_0x555d('0x9')&&_[_0x555d('0x55')](_0x75eca4[_0x555d('0x53')][_0x555d('0x52')](),_0x555d('0x5c'))){var _0x5b830a=_0x75eca4['applicationdata'][_0x555d('0x43')]('=');var _0x2e2ba9=_0x5b830a[0x0][_0x555d('0x52')]()[_0x555d('0x5d')](/cdr\((.*)\)/);if(_0x2e2ba9){if(_0x2e2ba9[0x1]===_0x555d('0x5e')&&!_[_0x555d('0x5f')](this[_0x555d('0x14')][_0x75eca4[_0x555d('0x37')]][_0x2e2ba9[0x1]]))return;this['channels'][_0x75eca4['uniqueid']][_0x2e2ba9[0x1]]=_0x5b830a[0x1];}}else if(_0x75eca4['application']===_0x555d('0x56')){this[_0x555d('0x14')][_0x75eca4[_0x555d('0x37')]][_0x555d('0x56')]=_0x75eca4['applicationdata'][_0x555d('0x43')](',')[0x0];}}}}}catch(_0x22c6a6){logger['error'](_0x555d('0x60'),_0x75eca4['uniqueid'],util['inspect'](_0x22c6a6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x1b')]=function(_0x53efd3){try{if(this[_0x555d('0x2f')](_0x53efd3)){logger['info'](_0x555d('0x61'),_0x53efd3[_0x555d('0x37')],_0x53efd3[_0x555d('0x38')],_0x53efd3['calleridname'],_0x53efd3[_0x555d('0x34')]);logger[_0x555d('0x35')](_0x555d('0x62'),_0x53efd3[_0x555d('0x37')],util[_0x555d('0x2d')](_0x53efd3,{'showHidden':![],'depth':null}));if(_0x53efd3[_0x555d('0x63')]!=='6')return;var _0x1501ff=this[_0x555d('0x15')][_0x53efd3[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]];if(_0x53efd3[_0x555d('0x37')]!==_0x53efd3[_0x555d('0x38')]){var _0x55fc28=moment();if(this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]]){if(!this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x64')]){this[_0x555d('0x14')][_0x53efd3['linkedid']][_0x555d('0x64')]=!![];this[_0x555d('0x14')][_0x53efd3['linkedid']][_0x555d('0x65')]=_0x55fc28[_0x555d('0x41')](_0x555d('0x4b'));if(this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x4a')]){this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]]['holdtime']=_0x55fc28[_0x555d('0x66')](this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x4a')],_0x555d('0x5a'));}}this[_0x555d('0x14')][_0x53efd3['linkedid']][_0x555d('0x38')]=_0x53efd3['uniqueid'];if(_0x53efd3[_0x555d('0x34')]!==_0x555d('0x3e')){this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x40')]=_0x53efd3[_0x555d('0x34')];}this[_0x555d('0x14')][_0x53efd3['linkedid']][_0x555d('0x67')]=_0x53efd3[_0x555d('0x33')];this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]]['destinationchannel']=_0x53efd3['channel'];this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x4c')]=dispositions[_[_0x555d('0x4d')](_0x53efd3[_0x555d('0x63')])];if(_0x1501ff){this[_0x555d('0x14')][_0x53efd3['linkedid']][_0x555d('0x68')]=_0x1501ff['id'];this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x69')]=_0x1501ff[_0x555d('0x44')];}}if(this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]]){if(!this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]][_0x555d('0x64')]){this[_0x555d('0x14')][_0x53efd3['uniqueid']]['answered']=!![];this['channels'][_0x53efd3['uniqueid']]['answertime']=_0x55fc28[_0x555d('0x41')](_0x555d('0x4b'));if(this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]][_0x555d('0x4a')]){this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]][_0x555d('0x6a')]=_0x55fc28[_0x555d('0x66')](this['channels'][_0x53efd3[_0x555d('0x37')]][_0x555d('0x4a')],'seconds');}}if(_0x53efd3['calleridnum']!==_0x555d('0x3e')){this['channels'][_0x53efd3[_0x555d('0x37')]]['connectedlinenum']=_0x53efd3[_0x555d('0x34')];}this[_0x555d('0x14')][_0x53efd3['uniqueid']]['connectedlinename']=_0x53efd3[_0x555d('0x33')];this['channels'][_0x53efd3[_0x555d('0x37')]][_0x555d('0x6b')]=_0x53efd3[_0x555d('0x42')];this[_0x555d('0x14')][_0x53efd3['uniqueid']][_0x555d('0x4c')]=dispositions[_['toNumber'](_0x53efd3['channelstate'])];}}else{if(this['channels'][_0x53efd3[_0x555d('0x37')]]){if(_0x1501ff){this['channels'][_0x53efd3[_0x555d('0x37')]]['UserId']=_0x1501ff['id'];this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]][_0x555d('0x69')]=_0x1501ff[_0x555d('0x44')];}}}if(_0x53efd3['context']===_0x555d('0x3d')){if(_0x1501ff){_0x1501ff['destconnectedlinenum']=_0x53efd3[_0x555d('0x4f')];var _0x58f75e,_0x4677b9;if(this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]]){_0x58f75e=this['channels'][_0x53efd3['uniqueid']][_0x555d('0x6c')];_0x4677b9=this[_0x555d('0x14')][_0x53efd3[_0x555d('0x37')]][_0x555d('0x56')];}else if(this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]]){_0x58f75e=this[_0x555d('0x14')][_0x53efd3['linkedid']]['routealias'];_0x4677b9=this[_0x555d('0x14')][_0x53efd3[_0x555d('0x38')]][_0x555d('0x56')];}_0x1501ff[_0x555d('0x56')]=_0x4677b9;_0x1501ff[_0x555d('0x6c')]=_0x58f75e;var _0x129703={'id':_0x1501ff['id'],'name':_0x1501ff['name'],'agentconnected':!![],'destaccountcode':_0x1501ff['accountcode'],'destconnectedlinenum':_0x53efd3[_0x555d('0x4f')],'queue':_0x4677b9||undefined,'routealias':_0x58f75e,'uniqueid':_0x53efd3[_0x555d('0x38')]};logger['debug']('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x53efd3[_0x555d('0x37')],util[_0x555d('0x2d')](_0x129703,{'showHidden':![],'depth':null}));this['emit'](util[_0x555d('0x41')]('user:%s',_0x1501ff[_0x555d('0x44')]),_0x555d('0x45'),_0x129703);}}}}catch(_0x144a84){logger[_0x555d('0x2b')](_0x555d('0x6d'),_0x53efd3[_0x555d('0x37')],util[_0x555d('0x2d')](_0x144a84,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x555d('0x6e')]=function(_0x556b4c,_0x6a6f35){try{if(this['channels'][_0x556b4c]){logger[_0x555d('0x29')](_0x555d('0x6f'),_0x556b4c,_0x6a6f35);this[_0x555d('0x14')][_0x556b4c][_0x555d('0x70')]=!![];if(_[_0x555d('0x71')](_0x6a6f35,_0x555d('0x72'))){_0x6a6f35=_0x6a6f35[_0x555d('0x73')](_0x555d('0x72'),_0x555d('0x74'));}this[_0x555d('0x14')][_0x556b4c][_0x555d('0x75')]=_0x6a6f35;var _0x28afa5=_[_0x555d('0x76')](this[_0x555d('0x14')][_0x556b4c][_0x555d('0x77')],{'filename':_0x6a6f35});if(_[_0x555d('0x5f')](_0x28afa5)){this[_0x555d('0x14')][_0x556b4c]['monitors'][_0x555d('0x78')]({'filename':_0x6a6f35,'createdAt':moment()[_0x555d('0x41')](_0x555d('0x4b')),'mixmonitorid':'','status':'rec'});}}}catch(_0x235fd9){logger['error'](_0x555d('0x79'),_0x556b4c,util['inspect'](_0x235fd9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x1d')]=function(_0x1cca2c){try{if(this[_0x555d('0x2f')](_0x1cca2c)){logger[_0x555d('0x35')](_0x555d('0x7a'),_0x1cca2c[_0x555d('0x37')],util['inspect'](_0x1cca2c,{'showHidden':![],'depth':null}));if(this['channels'][_0x1cca2c[_0x555d('0x37')]]&&_0x1cca2c[_0x555d('0x42')]!=_0x555d('0x48')){if(this[_0x555d('0x2f')](_0x1cca2c['variable'])){if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x7c')])){logger[_0x555d('0x29')](_0x555d('0x7d'),_0x1cca2c[_0x555d('0x37')],_0x1cca2c[_0x555d('0x7e')]);this[_0x555d('0x6e')](_0x1cca2c[_0x555d('0x37')],_0x1cca2c[_0x555d('0x7e')]);}else if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x7f')])){logger[_0x555d('0x29')](_0x555d('0x80'),_0x1cca2c[_0x555d('0x37')],_0x1cca2c['value']);this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x37')]][_0x555d('0x34')]=_0x1cca2c['value'];}else if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x81')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x1cca2c[_0x555d('0x37')],_0x1cca2c[_0x555d('0x7e')]);this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x37')]][_0x555d('0x82')]=_0x1cca2c[_0x555d('0x7e')];}else if(this[_0x555d('0x2f')](_0x1cca2c['variable']['xmd-cdrtype'])){logger[_0x555d('0x29')](_0x555d('0x83'),_0x1cca2c['uniqueid'],_0x1cca2c['value']);this['channels'][_0x1cca2c[_0x555d('0x37')]][_0x555d('0x5e')]=_0x1cca2c[_0x555d('0x7e')];}else if(this[_0x555d('0x2f')](_0x1cca2c['variable'][_0x555d('0x84')])){logger[_0x555d('0x29')](_0x555d('0x85'),_0x1cca2c[_0x555d('0x37')],_0x1cca2c['value']['split'](',')[0x0]);this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x37')]]['queue']=_0x1cca2c[_0x555d('0x7e')]['split'](',')[0x0];}else if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x86')])){logger[_0x555d('0x29')](_0x555d('0x87'),_0x1cca2c['uniqueid'],_0x1cca2c[_0x555d('0x7e')]);this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x37')]][_0x555d('0x88')]=_0x1cca2c[_0x555d('0x7e')];}else if(this[_0x555d('0x2f')](_0x1cca2c['variable'][_0x555d('0x89')])){logger['info'](_0x555d('0x8a'),_0x1cca2c[_0x555d('0x37')],_0x1cca2c[_0x555d('0x7e')]);this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x37')]][_0x555d('0x8b')]=_0x1cca2c[_0x555d('0x7e')];}else if(this['isNotNull'](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x8c')])){logger[_0x555d('0x29')](_0x555d('0x8d'),_0x1cca2c[_0x555d('0x37')],_0x1cca2c['value']);this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x37')]]['calleridpreview']=_0x1cca2c[_0x555d('0x7e')];}else if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x8e')])){logger[_0x555d('0x29')](_0x555d('0x8f'),_0x1cca2c[_0x555d('0x37')],_0x1cca2c[_0x555d('0x7e')]);this[_0x555d('0x14')][_0x1cca2c['uniqueid']]['queue']=_0x1cca2c['value'];}else if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x90')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1cca2c[_0x555d('0x37')],_0x1cca2c[_0x555d('0x7e')]);this['channels'][_0x1cca2c[_0x555d('0x37')]][_0x555d('0x91')]=_0x1cca2c[_0x555d('0x7e')];}}}else if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x7c')])){if(_0x1cca2c[_0x555d('0x7e')]){var _0x59d09b=path[_0x555d('0x92')](_0x1cca2c[_0x555d('0x7e')])[_0x555d('0x44')];logger['info'](_0x555d('0x7d'),_0x59d09b,_0x1cca2c[_0x555d('0x7e')]);this[_0x555d('0x6e')](_0x59d09b,_0x1cca2c[_0x555d('0x7e')]);}}else if(this[_0x555d('0x14')][_0x1cca2c[_0x555d('0x38')]]){if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')])){if(this[_0x555d('0x2f')](_0x1cca2c[_0x555d('0x7b')][_0x555d('0x90')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1cca2c[_0x555d('0x38')],_0x1cca2c[_0x555d('0x7e')]);this['channels'][_0x1cca2c['linkedid']]['sipcalllinkedid']=_0x1cca2c['value'];}}}}}catch(_0x44969f){logger[_0x555d('0x2b')]('[%s][voiceCallReport][varset]',_0x1cca2c[_0x555d('0x37')],util[_0x555d('0x2d')](_0x44969f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x555d('0x1f')]=function(_0x1457fc){try{if(this[_0x555d('0x2f')](_0x1457fc)){logger[_0x555d('0x35')](_0x555d('0x93'),_0x1457fc['uniqueid'],util['inspect'](_0x1457fc,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x1457fc['linkedid']]){if(this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc['linkedid']][_0x555d('0x38')]]){this[_0x555d('0x14')][this['blindTransfers'][_0x1457fc[_0x555d('0x38')]][_0x555d('0x38')]][_0x555d('0x37')]=_0x1457fc['uniqueid'];this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc['linkedid']]['linkedid']][_0x555d('0x64')]=this['channels'][_0x1457fc[_0x555d('0x37')]][_0x555d('0x64')];this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc['linkedid']][_0x555d('0x38')]][_0x555d('0x65')]=this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x65')];this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]]['linkedid']][_0x555d('0x6b')]=this[_0x555d('0x14')][this['blindTransfers'][_0x1457fc['linkedid']][_0x555d('0x38')]][_0x555d('0x42')];this['channels'][this[_0x555d('0x16')][_0x1457fc['linkedid']][_0x555d('0x38')]]['disposition']=this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x4c')];this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]]=this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]][_0x555d('0x38')]];delete this['channels'][this['blindTransfers'][_0x1457fc[_0x555d('0x38')]][_0x555d('0x38')]];}else if(this[_0x555d('0x14')][this['blindTransfers'][_0x1457fc['linkedid']][_0x555d('0x37')]]){this['channels'][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]]['uniqueid']]['uniqueid']=[this['channels'][this['blindTransfers'][_0x1457fc['linkedid']]['uniqueid']][_0x555d('0x38')],this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc['linkedid']][_0x555d('0x37')]][_0x555d('0x38')]=this[_0x555d('0x14')][this['blindTransfers'][_0x1457fc[_0x555d('0x38')]][_0x555d('0x37')]][_0x555d('0x37')]][0x0];this['channels'][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]]['uniqueid']][_0x555d('0x64')]=this[_0x555d('0x14')][_0x1457fc['uniqueid']]['answered'];this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc['linkedid']][_0x555d('0x37')]][_0x555d('0x65')]=this['channels'][_0x1457fc[_0x555d('0x37')]][_0x555d('0x65')];this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]][_0x555d('0x37')]][_0x555d('0x6b')]=this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc['linkedid']][_0x555d('0x37')]][_0x555d('0x42')];this[_0x555d('0x14')][this['blindTransfers'][_0x1457fc[_0x555d('0x38')]][_0x555d('0x37')]]['disposition']=this['channels'][_0x1457fc[_0x555d('0x37')]][_0x555d('0x4c')];this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]]=this[_0x555d('0x14')][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]][_0x555d('0x37')]];delete this['channels'][this[_0x555d('0x16')][_0x1457fc[_0x555d('0x38')]][_0x555d('0x37')]];}}if(this['channels'][_0x1457fc[_0x555d('0x37')]]){logger[_0x555d('0x29')](_0x555d('0x94'),_0x1457fc['uniqueid'],_0x1457fc['cause-txt']);var _0x8ae86d=moment();this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]]['endtime']=_0x8ae86d[_0x555d('0x41')](_0x555d('0x4b'));this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x59')]=_0x8ae86d['diff'](this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x4a')],_0x555d('0x5a'));if(this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x64')]){this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x95')]=_0x8ae86d[_0x555d('0x66')](this['channels'][_0x1457fc[_0x555d('0x37')]]['answertime'],_0x555d('0x5a'));this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]]['holdtime']=this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x59')]-this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x95')];}if(_0x1457fc[_0x555d('0x3c')]===_0x555d('0x3d')){if(this[_0x555d('0x15')][_0x1457fc[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]]){this['agents'][_0x1457fc['channel'][_0x555d('0x43')]('-')[0x0]]=_['omit'](this['agents'][_0x1457fc[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]],[_0x555d('0x3f')]);logger['debug'](_0x555d('0x96'),_0x1457fc[_0x555d('0x37')],util[_0x555d('0x2d')]({'id':this[_0x555d('0x15')][_0x1457fc[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1457fc[_0x555d('0x42')]['split']('-')[0x0]][_0x555d('0x46')]},{'showHidden':![],'depth':null}));this[_0x555d('0x31')](util['format'](_0x555d('0x97'),this[_0x555d('0x15')][_0x1457fc[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]][_0x555d('0x44')]),_0x555d('0x98'),{'id':this['agents'][_0x1457fc[_0x555d('0x42')][_0x555d('0x43')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x1457fc[_0x555d('0x42')]['split']('-')[0x0]]['accountcode']});for(var _0x192c13=0x0;_0x192c13<Object[_0x555d('0x3b')](this[_0x555d('0x15')])[_0x555d('0x99')];_0x192c13++){var _0xdf0d8c=Object[_0x555d('0x3b')](this['agents'])[_0x192c13];var _0x3d9e06=this['agents'][_0xdf0d8c];if(_0x3d9e06['accountcode']===Number(this[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]]['connectedlinenum'])){this[_0x555d('0x31')](util[_0x555d('0x41')](_0x555d('0x97'),_0x3d9e06[_0x555d('0x44')]),_0x555d('0x98'),{'id':_0x3d9e06['id'],'destaccountcode':_0x3d9e06[_0x555d('0x46')],'transfer':this[_0x555d('0x14')][_0x1457fc['uniqueid']][_0x555d('0x9a')]});break;}}}}var _0x1d20d7=this;Promise['resolve']()[_0x555d('0x9b')](function(){var _0x4c2d36=_0x1d20d7[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]];if(typeof _0x4c2d36[_0x555d('0x9a')]===_0x555d('0x4e'))return;if(_['isEmpty'](_0x4c2d36[_0x555d('0x77')]))return;return RpcSetting[_0x555d('0x9c')]()['then'](function(_0x3409dd){if(!_0x3409dd[_0x555d('0x9d')])return;return Promise['resolve']()[_0x555d('0x9b')](function(){return ami['Action']({'action':_0x555d('0x9e'),'channel':_0x4c2d36['channel']})['catch'](function(){});})[_0x555d('0x9b')](function(){return ami[_0x555d('0x9f')]({'action':'StopMixMonitor','channel':_0x4c2d36[_0x555d('0x6b')]})[_0x555d('0xa0')](function(){})[_0x555d('0xa1')](function(){var _0xc3ac94=_0x1d20d7['agents'][_0x4c2d36[_0x555d('0x6b')][_0x555d('0x43')]('-')[0x0]];if(!_0xc3ac94)return;io[_0x555d('0x31')](_0x555d('0xa2'),{'agentId':_0xc3ac94['id'],'uniqueid':_0x4c2d36['uniqueid']});});});});})[_0x555d('0x9b')](function(){if(_0x1457fc[_0x555d('0xa3')]===_0x555d('0xa4')){_0x1d20d7[_0x555d('0x16')][_0x1457fc[_0x555d('0x37')]]=_0x1457fc;}else{if(_0x1d20d7[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]][_0x555d('0x5e')]===_0x555d('0xa5')&&_0x1d20d7[_0x555d('0x16')][_0x1457fc[_0x555d('0x37')]]){_0x1d20d7[_0x555d('0x14')][_0x1457fc['uniqueid']][_0x555d('0x37')]=[_0x1d20d7['channels'][_0x1457fc['uniqueid']][_0x555d('0x38')],_0x1d20d7['channels'][_0x1457fc[_0x555d('0x37')]][_0x555d('0x38')]=_0x1d20d7[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]]['uniqueid']][0x0];delete _0x1d20d7[_0x555d('0x16')][_0x1457fc['uniqueid']];}}logger['debug'](_0x555d('0xa6'),_0x1457fc['uniqueid'],util[_0x555d('0x2d')](_0x1d20d7[_0x555d('0x14')][_0x1457fc['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceCallReport',_0x1d20d7['channels'][_0x1457fc[_0x555d('0x37')]]);delete _0x1d20d7[_0x555d('0x14')][_0x1457fc[_0x555d('0x37')]];});}}}catch(_0xf7cf83){logger['error'](_0x555d('0xa7'),_0x1457fc['uniqueid'],util['inspect'](_0xf7cf83,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x22')]=function(_0x3c7efa){try{if(this[_0x555d('0x2f')](_0x3c7efa)){logger[_0x555d('0x29')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x3c7efa[_0x555d('0x37')],_0x3c7efa['origtransferercalleridnum'],_0x3c7efa[_0x555d('0xa8')]);logger[_0x555d('0x35')]('[%s][voiceCallReport][attendedtransfer]\x20event:',_0x3c7efa[_0x555d('0x37')],util['inspect'](_0x3c7efa,{'showHidden':![],'depth':null}));var _0x41381e;if(this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xa9')]]){this['channels'][_0x3c7efa[_0x555d('0xa9')]][_0x555d('0xaa')]=_0x3c7efa['origtransferercalleridnum'];this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xa9')]][_0x555d('0xab')]=_0x3c7efa[_0x555d('0xa8')];if(this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xac')]]){_0x41381e=this['channels'][_0x3c7efa[_0x555d('0xac')]];this['channels'][_0x3c7efa['secondtransfereruniqueid']]=this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xa9')]];this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xa9')]]=_0x41381e;}this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xac')]][_0x555d('0x9a')]=_0x555d('0xad');}else if(this[_0x555d('0x14')][_0x3c7efa['transfertargetuniqueid']]){this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xae')]][_0x555d('0xaa')]=_0x3c7efa[_0x555d('0xaf')];this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xae')]]['transferconnectedlinenum']=_0x3c7efa[_0x555d('0xa8')];if(this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb0')]]){_0x41381e=this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb0')]];this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb0')]]=this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xae')]];this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xae')]]=_0x41381e;}this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xae')]][_0x555d('0x9a')]=_0x555d('0xad');}if((this['channels'][_0x3c7efa[_0x555d('0xb0')]]||this['channels'][_0x3c7efa[_0x555d('0xb1')]])&&this['channels'][_0x3c7efa[_0x555d('0xac')]]){var _0x534bca=_['some']([this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb0')]],this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb1')]],this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xac')]]],function(_0x477f26){return _0x477f26&&_0x477f26['type']===_0x555d('0xa5')&&_0x477f26[_0x555d('0xb2')];});if(_0x534bca){if(this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb0')]])this[_0x555d('0x14')][_0x3c7efa['origtransfereruniqueid']][_0x555d('0x9a')]=_0x555d('0xad');if(this['channels'][_0x3c7efa['origtransfererlinkedid']])this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xb1')]]['transferType']=_0x555d('0xad');this[_0x555d('0x14')][_0x3c7efa[_0x555d('0xac')]][_0x555d('0x9a')]=_0x555d('0xad');}}}}catch(_0x25514a){logger[_0x555d('0x2b')](_0x555d('0xb3'),_0x3c7efa[_0x555d('0x37')],util['inspect'](_0x25514a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x24')]=function(_0x53180f){try{if(this[_0x555d('0x2f')](_0x53180f)){logger[_0x555d('0x29')](_0x555d('0xb4'),_0x53180f[_0x555d('0x37')],_0x53180f[_0x555d('0xb5')],_0x53180f[_0x555d('0xb6')]);logger[_0x555d('0x35')](_0x555d('0xb7'),_0x53180f[_0x555d('0x37')],util['inspect'](_0x53180f,{'showHidden':![],'depth':null}));if(this['channels'][_0x53180f[_0x555d('0xa9')]]){this['channels'][_0x53180f['transfereeuniqueid']][_0x555d('0xaa')]=_0x53180f[_0x555d('0xb5')];this[_0x555d('0x14')][_0x53180f[_0x555d('0xa9')]][_0x555d('0xab')]=_0x53180f[_0x555d('0xb6')];this[_0x555d('0x14')][_0x53180f[_0x555d('0xa9')]][_0x555d('0x9a')]=_0x555d('0xb8');this[_0x555d('0x1f')]({'event':_0x555d('0xa4'),'uniqueid':_0x53180f['transfereeuniqueid'],'linkedid':_0x53180f['transfereruniqueid'],'context':_0x53180f[_0x555d('0x3c')],'channel':_0x53180f['transfererchannel']});}else{this[_0x555d('0x14')][_0x53180f[_0x555d('0xb9')]]['transferType']=_0x555d('0xb8');this[_0x555d('0x1f')]({'event':'BlindTransfer','uniqueid':_0x53180f['transfereruniqueid'],'linkedid':_0x53180f[_0x555d('0xa9')],'context':_0x53180f[_0x555d('0x3c')],'channel':_0x53180f[_0x555d('0xba')]});}}}catch(_0xb75b0a){logger[_0x555d('0x2b')](_0x555d('0xbb'),_0x53180f[_0x555d('0x37')],util['inspect'](_0xb75b0a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x26')]=function(_0x3435da){try{if(this[_0x555d('0x2f')](_0x3435da)){logger[_0x555d('0x35')](_0x555d('0xbc'),_0x3435da[_0x555d('0x37')],util[_0x555d('0x2d')](_0x3435da,{'showHidden':![],'depth':null}));if(this[_0x555d('0x14')][_0x3435da[_0x555d('0x37')]]){if(!_[_0x555d('0x5f')](this[_0x555d('0x14')][_0x3435da[_0x555d('0x37')]][_0x555d('0x65')])){this['channels'][_0x3435da['uniqueid']][_0x555d('0xbd')]=moment()[_0x555d('0x41')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x555d('0x29')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x3435da[_0x555d('0x37')],this[_0x555d('0x14')][_0x3435da[_0x555d('0x37')]]['mohstarttime']);}}}}catch(_0x289b04){logger[_0x555d('0x2b')](_0x555d('0xbe'),_0x3435da[_0x555d('0x37')],util['inspect'](_0x289b04,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x555d('0x2e')][_0x555d('0x28')]=function(_0x5a5676){try{if(this['isNotNull'](_0x5a5676)){logger[_0x555d('0x35')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x5a5676[_0x555d('0x37')],util[_0x555d('0x2d')](_0x5a5676,{'showHidden':![],'depth':null}));if(this[_0x555d('0x14')][_0x5a5676['uniqueid']]){if(!_[_0x555d('0x5f')](this['channels'][_0x5a5676[_0x555d('0x37')]]['mohstarttime'])){this['channels'][_0x5a5676['uniqueid']][_0x555d('0xbf')]+=moment()[_0x555d('0xc0')](0x0)[_0x555d('0x66')](this[_0x555d('0x14')][_0x5a5676[_0x555d('0x37')]]['mohstarttime'],_0x555d('0x5a'));logger[_0x555d('0x29')](_0x555d('0xc1'),_0x5a5676[_0x555d('0x37')],this[_0x555d('0x14')][_0x5a5676[_0x555d('0x37')]][_0x555d('0xbf')]);delete this[_0x555d('0x14')][_0x5a5676[_0x555d('0x37')]][_0x555d('0xbd')];}}}}catch(_0x16327c){logger[_0x555d('0x2b')](_0x555d('0xc2'),_0x5a5676[_0x555d('0x37')],util[_0x555d('0x2d')](_0x16327c,{'showHidden':![],'depth':null}));}};module[_0x555d('0xc3')]=VoiceCallReport;
\ No newline at end of file
+var _0xa7a4=['callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','xmd-callerid-preview','calleridpreview','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','then','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','finally','webbar:stopmonitors','event','BlindTransfer','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfercalleridnum','transfereeuniqueid','transferconnectedlinenum','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','secondtransfereruniqueid','some','origtransfererlinkedid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','lodash','moment','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','set','queue','playback','NO\x20ANSWER','FAILED','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','syncNewChannel','newstate','syncNewState','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','pick','keys','context','channel','exten','xcally-motion-preview','split','connectedlinenum','format','name','accountcode','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','from-sip','destconnectedlinenum','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','subtract','duration','seconds','includes','lastdata','startsWith','match','type','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','connectedlinename','UserId','membername','diff','destinationchannel','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','replace','.wav49','.WAV','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa7a4,0x103));var _0x4a7a=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0xa7a4[_0x390a19];return _0x5d8230;};'use strict';var _=require(_0x4a7a('0x0'));var moment=require(_0x4a7a('0x1'));var util=require(_0x4a7a('0x2'));var path=require(_0x4a7a('0x3'));var Redis=require(_0x4a7a('0x4'));var config=require(_0x4a7a('0x5'));var logger=require('../../../config/logger')(_0x4a7a('0x6'));var ami=require(_0x4a7a('0x7'));var Channel=require(_0x4a7a('0x8'));var RpcSetting=require(_0x4a7a('0x9'));var applications=[_0x4a7a('0xa'),_0x4a7a('0xb'),'agi','dial',_0x4a7a('0xc'),'voicemail'];var dispositions=[_0x4a7a('0xd'),_0x4a7a('0xe'),'FAILED',_0x4a7a('0xd'),_0x4a7a('0xd'),_0x4a7a('0xd'),'ANSWERED','BUSY','FAILED',_0x4a7a('0xe'),_0x4a7a('0xe')];config[_0x4a7a('0xf')]=_[_0x4a7a('0x10')](config[_0x4a7a('0xf')],{'host':_0x4a7a('0x11'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a7a('0xf')]));function VoiceCallReport(_0xd1e0ad){this[_0x4a7a('0x12')]=_0xd1e0ad[_0x4a7a('0x12')];this['agents']=_0xd1e0ad[_0x4a7a('0x13')];this[_0x4a7a('0x14')]={};ami['on'](_0x4a7a('0x15'),this[_0x4a7a('0x16')]['bind'](this));ami['on'](_0x4a7a('0x17'),this[_0x4a7a('0x16')][_0x4a7a('0x18')](this));ami['on']('newchannel',this[_0x4a7a('0x19')][_0x4a7a('0x18')](this));ami['on'](_0x4a7a('0x1a'),this[_0x4a7a('0x1b')]['bind'](this));ami['on']('varset',this[_0x4a7a('0x1c')]['bind'](this));ami['on']('hangup',this[_0x4a7a('0x1d')]['bind'](this));ami['on'](_0x4a7a('0x1e'),this[_0x4a7a('0x1f')][_0x4a7a('0x18')](this));ami['on'](_0x4a7a('0x20'),this[_0x4a7a('0x21')]['bind'](this));ami['on'](_0x4a7a('0x22'),this[_0x4a7a('0x23')][_0x4a7a('0x18')](this));ami['on'](_0x4a7a('0x24'),this['syncMusicOnHoldStart'][_0x4a7a('0x18')](this));ami['on']('musiconholdstop',this[_0x4a7a('0x25')][_0x4a7a('0x18')](this));try{logger[_0x4a7a('0x26')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x4a7a('0x27')]();}catch(_0x228f0b){logger[_0x4a7a('0x28')](_0x4a7a('0x29'),util[_0x4a7a('0x2a')](_0x228f0b,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x4a7a('0x2b')][_0x4a7a('0x2c')]=function(_0x431f2c){return _0x431f2c!==null&&!_[_0x4a7a('0x2d')](_0x431f2c);};VoiceCallReport[_0x4a7a('0x2b')]['emit']=function(_0x5e790f,_0x43911d,_0x550f90){io['to'](_0x5e790f)[_0x4a7a('0x2e')](_0x43911d,_0x550f90);};VoiceCallReport[_0x4a7a('0x2b')]['syncNewCallerId']=function(_0x28d7a8){try{if(this['isNotNull'](_0x28d7a8)){logger[_0x4a7a('0x26')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x28d7a8['uniqueid'],_0x28d7a8[_0x4a7a('0x2f')],_0x28d7a8[_0x4a7a('0x30')]);logger['debug'](_0x4a7a('0x31'),_0x28d7a8[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x28d7a8,{'showHidden':![],'depth':null}));if(_0x28d7a8[_0x4a7a('0x32')]===_0x28d7a8[_0x4a7a('0x33')]){if(!_['isUndefined'](this[_0x4a7a('0x12')][_0x28d7a8[_0x4a7a('0x32')]])){_[_0x4a7a('0x34')](this[_0x4a7a('0x12')][_0x28d7a8[_0x4a7a('0x32')]],_[_0x4a7a('0x35')](_0x28d7a8,_[_0x4a7a('0x36')](this[_0x4a7a('0x12')][_0x28d7a8[_0x4a7a('0x32')]])));}}if(_0x28d7a8[_0x4a7a('0x37')]==='from-sip'){if(this['agents'][_0x28d7a8[_0x4a7a('0x38')]['split']('-')[0x0]]){if(_0x28d7a8[_0x4a7a('0x39')]==_0x4a7a('0x3a')){this[_0x4a7a('0x13')][_0x28d7a8[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]]['destconnectedlinenum']=_0x28d7a8[_0x4a7a('0x3c')];this['emit'](util[_0x4a7a('0x3d')]('user:%s',this[_0x4a7a('0x13')][_0x28d7a8[_0x4a7a('0x38')]['split']('-')[0x0]][_0x4a7a('0x3e')]),'user:agentconnect',{'destaccountcode':this[_0x4a7a('0x13')][_0x28d7a8[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]][_0x4a7a('0x3f')],'destconnectedlinenum':_0x28d7a8[_0x4a7a('0x3c')]});}}}}}catch(_0x185bb4){logger[_0x4a7a('0x28')](_0x4a7a('0x40'),_0x28d7a8[_0x4a7a('0x32')],util['inspect'](_0x185bb4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4a7a('0x19')]=function(_0x5b0aba){try{if(this[_0x4a7a('0x2c')](_0x5b0aba)){logger[_0x4a7a('0x41')](_0x4a7a('0x42'),_0x5b0aba[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x5b0aba,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x12')][_0x5b0aba[_0x4a7a('0x32')]]){return;}if(_0x5b0aba[_0x4a7a('0x38')]===_0x4a7a('0x43')){return;}if(_0x5b0aba['uniqueid']!==_0x5b0aba[_0x4a7a('0x33')]&&!this[_0x4a7a('0x14')][_0x5b0aba['linkedid']]){return;}logger[_0x4a7a('0x26')](_0x4a7a('0x44'),_0x5b0aba[_0x4a7a('0x32')],_0x5b0aba[_0x4a7a('0x37')],_0x5b0aba[_0x4a7a('0x39')]);this[_0x4a7a('0x12')][_0x5b0aba['uniqueid']]=new Channel();this[_0x4a7a('0x12')][_0x5b0aba[_0x4a7a('0x32')]][_0x4a7a('0x45')]=moment()[_0x4a7a('0x3d')](_0x4a7a('0x46'));this['channels'][_0x5b0aba[_0x4a7a('0x32')]][_0x4a7a('0x47')]=dispositions[_[_0x4a7a('0x48')](_0x5b0aba[_0x4a7a('0x49')])];_[_0x4a7a('0x34')](this[_0x4a7a('0x12')][_0x5b0aba['uniqueid']],_[_0x4a7a('0x35')](_0x5b0aba,_[_0x4a7a('0x36')](this[_0x4a7a('0x12')][_0x5b0aba['uniqueid']])));if(_0x5b0aba[_0x4a7a('0x37')]===_0x4a7a('0x4a')){var _0x18e18f=this[_0x4a7a('0x13')][_0x5b0aba[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]];if(_0x18e18f&&typeof _0x18e18f[_0x4a7a('0x4b')]===_0x4a7a('0x4c')){_0x18e18f[_0x4a7a('0x4b')]=_0x5b0aba['exten'];logger['debug'](_0x4a7a('0x4d'),_0x5b0aba['uniqueid'],util[_0x4a7a('0x2a')]({'id':_0x18e18f['id'],'destaccountcode':_0x18e18f['accountcode'],'destconnectedlinenum':_0x5b0aba[_0x4a7a('0x39')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x4a7a('0x4e'),_0x18e18f['name']),_0x4a7a('0x4f'),{'id':_0x18e18f['id'],'destaccountcode':_0x18e18f[_0x4a7a('0x3f')],'destconnectedlinenum':_0x5b0aba[_0x4a7a('0x39')]});}}}}catch(_0x972766){logger[_0x4a7a('0x28')](_0x4a7a('0x50'),_0x5b0aba[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x972766,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4a7a('0x16')]=function(_0x399ac2){try{if(this['isNotNull'](_0x399ac2)){logger[_0x4a7a('0x41')](_0x4a7a('0x51'),_0x399ac2[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x399ac2,{'showHidden':![],'depth':null}));if(_0x399ac2[_0x4a7a('0x38')]==='OutgoingSpoolFailed'||_0x399ac2[_0x4a7a('0x39')]==='h')return;if(_0x399ac2['uniqueid']===_0x399ac2[_0x4a7a('0x33')]||this['blindTransfers'][_0x399ac2[_0x4a7a('0x33')]]){_0x399ac2[_0x4a7a('0x52')]=_0x399ac2[_0x4a7a('0x52')]?_0x399ac2['application'][_0x4a7a('0x53')]():undefined;_0x399ac2[_0x4a7a('0x54')]=_0x399ac2[_0x4a7a('0x55')]||_0x399ac2[_0x4a7a('0x54')];if(_0x399ac2[_0x4a7a('0x55')]&&!_0x399ac2[_0x4a7a('0x55')]['startsWith'](_0x4a7a('0x56'))&&_0x399ac2['application']!=='queue'){_0x399ac2['applicationdata']=_0x399ac2['applicationdata']['toLowerCase']();}logger['info']('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x399ac2[_0x4a7a('0x32')],_0x399ac2[_0x4a7a('0x52')],_0x399ac2[_0x4a7a('0x54')]);if(_['isUndefined'](this[_0x4a7a('0x12')][_0x399ac2[_0x4a7a('0x32')]])){this[_0x4a7a('0x12')][_0x399ac2[_0x4a7a('0x32')]]=new Channel();this[_0x4a7a('0x12')][_0x399ac2[_0x4a7a('0x32')]][_0x4a7a('0x45')]=_0x399ac2['duration']?moment()[_0x4a7a('0x57')](moment[_0x4a7a('0x58')](_0x399ac2[_0x4a7a('0x58')])[_0x4a7a('0x59')](),_0x4a7a('0x59'))[_0x4a7a('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x4a7a('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4a7a('0x12')][_0x399ac2[_0x4a7a('0x32')]][_0x4a7a('0x47')]='NO\x20ANSWER';}_[_0x4a7a('0x34')](this['channels'][_0x399ac2[_0x4a7a('0x32')]],_['pick'](_0x399ac2,_['keys'](this['channels'][_0x399ac2[_0x4a7a('0x32')]])));if(_[_0x4a7a('0x5a')](applications,_0x399ac2[_0x4a7a('0x52')])){this['channels'][_0x399ac2[_0x4a7a('0x32')]]['lastapplication']=_0x399ac2['application'];this[_0x4a7a('0x12')][_0x399ac2[_0x4a7a('0x32')]][_0x4a7a('0x5b')]=_0x399ac2['applicationdata'];if(_0x399ac2[_0x4a7a('0x52')]===_0x4a7a('0xa')&&_[_0x4a7a('0x5c')](_0x399ac2['applicationdata'][_0x4a7a('0x53')](),'cdr(')){var _0x51a7b9=_0x399ac2[_0x4a7a('0x54')][_0x4a7a('0x3b')]('=');var _0x5069cb=_0x51a7b9[0x0][_0x4a7a('0x53')]()[_0x4a7a('0x5d')](/cdr\((.*)\)/);if(_0x5069cb){if(_0x5069cb[0x1]===_0x4a7a('0x5e')&&!_['isNil'](this[_0x4a7a('0x12')][_0x399ac2[_0x4a7a('0x32')]][_0x5069cb[0x1]]))return;this[_0x4a7a('0x12')][_0x399ac2['uniqueid']][_0x5069cb[0x1]]=_0x51a7b9[0x1];}}else if(_0x399ac2['application']===_0x4a7a('0xb')){this['channels'][_0x399ac2[_0x4a7a('0x32')]][_0x4a7a('0xb')]=_0x399ac2['applicationdata'][_0x4a7a('0x3b')](',')[0x0];}}}}}catch(_0x41877a){logger[_0x4a7a('0x28')](_0x4a7a('0x5f'),_0x399ac2[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x41877a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4a7a('0x1b')]=function(_0x38ba31){try{if(this['isNotNull'](_0x38ba31)){logger[_0x4a7a('0x26')](_0x4a7a('0x60'),_0x38ba31[_0x4a7a('0x32')],_0x38ba31[_0x4a7a('0x33')],_0x38ba31[_0x4a7a('0x2f')],_0x38ba31[_0x4a7a('0x30')]);logger['debug']('[%s][voiceCallReport][newstate]\x20event:',_0x38ba31[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x38ba31,{'showHidden':![],'depth':null}));if(_0x38ba31[_0x4a7a('0x49')]!=='6')return;var _0x340840=this['agents'][_0x38ba31['channel'][_0x4a7a('0x3b')]('-')[0x0]];if(_0x38ba31['uniqueid']!==_0x38ba31[_0x4a7a('0x33')]){var _0x44a9f7=moment();if(this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]]){if(!this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]][_0x4a7a('0x61')]){this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]][_0x4a7a('0x61')]=!![];this[_0x4a7a('0x12')][_0x38ba31['linkedid']][_0x4a7a('0x62')]=_0x44a9f7[_0x4a7a('0x3d')](_0x4a7a('0x46'));if(this[_0x4a7a('0x12')][_0x38ba31['linkedid']][_0x4a7a('0x45')]){this['channels'][_0x38ba31[_0x4a7a('0x33')]][_0x4a7a('0x63')]=_0x44a9f7['diff'](this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]][_0x4a7a('0x45')],_0x4a7a('0x59'));}}this[_0x4a7a('0x12')][_0x38ba31['linkedid']][_0x4a7a('0x33')]=_0x38ba31[_0x4a7a('0x32')];if(_0x38ba31[_0x4a7a('0x30')]!==_0x4a7a('0x3a')){this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]]['connectedlinenum']=_0x38ba31['calleridnum'];}this['channels'][_0x38ba31[_0x4a7a('0x33')]][_0x4a7a('0x64')]=_0x38ba31[_0x4a7a('0x2f')];this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]]['destinationchannel']=_0x38ba31[_0x4a7a('0x38')];this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]]['disposition']=dispositions[_['toNumber'](_0x38ba31[_0x4a7a('0x49')])];if(_0x340840){this['channels'][_0x38ba31['linkedid']][_0x4a7a('0x65')]=_0x340840['id'];this['channels'][_0x38ba31['linkedid']][_0x4a7a('0x66')]=_0x340840[_0x4a7a('0x3e')];}}if(this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]]){if(!this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x61')]){this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x61')]=!![];this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x62')]=_0x44a9f7[_0x4a7a('0x3d')](_0x4a7a('0x46'));if(this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x45')]){this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]]['holdtime']=_0x44a9f7[_0x4a7a('0x67')](this['channels'][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x45')],'seconds');}}if(_0x38ba31[_0x4a7a('0x30')]!=='xcally-motion-preview'){this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]]['connectedlinenum']=_0x38ba31[_0x4a7a('0x30')];}this['channels'][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x64')]=_0x38ba31[_0x4a7a('0x2f')];this['channels'][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x68')]=_0x38ba31[_0x4a7a('0x38')];this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]]['disposition']=dispositions[_['toNumber'](_0x38ba31[_0x4a7a('0x49')])];}}else{if(this[_0x4a7a('0x12')][_0x38ba31['uniqueid']]){if(_0x340840){this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]]['UserId']=_0x340840['id'];this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x66')]=_0x340840['name'];}}}if(_0x38ba31[_0x4a7a('0x37')]===_0x4a7a('0x4a')){if(_0x340840){_0x340840['destconnectedlinenum']=_0x38ba31[_0x4a7a('0x39')];var _0x594097,_0x1eb434;if(this[_0x4a7a('0x12')][_0x38ba31['uniqueid']]){_0x594097=this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0x69')];_0x1eb434=this['channels'][_0x38ba31[_0x4a7a('0x32')]][_0x4a7a('0xb')];}else if(this[_0x4a7a('0x12')][_0x38ba31['linkedid']]){_0x594097=this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]][_0x4a7a('0x69')];_0x1eb434=this[_0x4a7a('0x12')][_0x38ba31[_0x4a7a('0x33')]]['queue'];}_0x340840[_0x4a7a('0xb')]=_0x1eb434;_0x340840[_0x4a7a('0x69')]=_0x594097;var _0x4dd8d0={'id':_0x340840['id'],'name':_0x340840['name'],'agentconnected':!![],'destaccountcode':_0x340840[_0x4a7a('0x3f')],'destconnectedlinenum':_0x38ba31[_0x4a7a('0x39')],'queue':_0x1eb434||undefined,'routealias':_0x594097,'uniqueid':_0x38ba31[_0x4a7a('0x33')]};logger[_0x4a7a('0x41')](_0x4a7a('0x6a'),_0x38ba31[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x4dd8d0,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x4a7a('0x4e'),_0x340840[_0x4a7a('0x3e')]),_0x4a7a('0x4f'),_0x4dd8d0);}}}}catch(_0x556e9f){logger[_0x4a7a('0x28')](_0x4a7a('0x6b'),_0x38ba31[_0x4a7a('0x32')],util['inspect'](_0x556e9f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4a7a('0x6c')]=function(_0x5869d7,_0x4cfc28){try{if(this[_0x4a7a('0x12')][_0x5869d7]){logger[_0x4a7a('0x26')](_0x4a7a('0x6d'),_0x5869d7,_0x4cfc28);this[_0x4a7a('0x12')][_0x5869d7]['monitor']=!![];if(_['endsWith'](_0x4cfc28,'.wav49')){_0x4cfc28=_0x4cfc28[_0x4a7a('0x6e')](_0x4a7a('0x6f'),_0x4a7a('0x70'));}this[_0x4a7a('0x12')][_0x5869d7]['monitorFilename']=_0x4cfc28;var _0x1a0143=_[_0x4a7a('0x71')](this['channels'][_0x5869d7][_0x4a7a('0x72')],{'filename':_0x4cfc28});if(_[_0x4a7a('0x73')](_0x1a0143)){this[_0x4a7a('0x12')][_0x5869d7][_0x4a7a('0x72')]['push']({'filename':_0x4cfc28,'createdAt':moment()[_0x4a7a('0x3d')](_0x4a7a('0x46')),'mixmonitorid':'','status':_0x4a7a('0x74')});}}}catch(_0x546da1){logger[_0x4a7a('0x28')](_0x4a7a('0x75'),_0x5869d7,util[_0x4a7a('0x2a')](_0x546da1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a7a('0x2b')][_0x4a7a('0x1c')]=function(_0x31b48c){try{if(this[_0x4a7a('0x2c')](_0x31b48c)){logger[_0x4a7a('0x41')]('[%s][voiceCallReport][varset]\x20event:',_0x31b48c['uniqueid'],util['inspect'](_0x31b48c,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x32')]]&&_0x31b48c[_0x4a7a('0x38')]!='OutgoingSpoolFailed'){if(this['isNotNull'](_0x31b48c['variable'])){if(this['isNotNull'](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x77')])){logger[_0x4a7a('0x26')](_0x4a7a('0x78'),_0x31b48c[_0x4a7a('0x32')],_0x31b48c[_0x4a7a('0x79')]);this[_0x4a7a('0x6c')](_0x31b48c['uniqueid'],_0x31b48c['value']);}else if(this[_0x4a7a('0x2c')](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x7a')])){logger[_0x4a7a('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x31b48c['uniqueid'],_0x31b48c['value']);this['channels'][_0x31b48c[_0x4a7a('0x32')]][_0x4a7a('0x30')]=_0x31b48c[_0x4a7a('0x79')];}else if(this[_0x4a7a('0x2c')](_0x31b48c['variable'][_0x4a7a('0x7b')])){logger[_0x4a7a('0x26')](_0x4a7a('0x7c'),_0x31b48c['uniqueid'],_0x31b48c[_0x4a7a('0x79')]);this[_0x4a7a('0x12')][_0x31b48c['uniqueid']][_0x4a7a('0x7d')]=_0x31b48c['value'];}else if(this[_0x4a7a('0x2c')](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x7e')])){logger['info'](_0x4a7a('0x7f'),_0x31b48c['uniqueid'],_0x31b48c[_0x4a7a('0x79')]);this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x32')]]['type']=_0x31b48c[_0x4a7a('0x79')];}else if(this['isNotNull'](_0x31b48c['variable'][_0x4a7a('0x80')])){logger['info'](_0x4a7a('0x81'),_0x31b48c[_0x4a7a('0x32')],_0x31b48c[_0x4a7a('0x79')]['split'](',')[0x0]);this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x32')]][_0x4a7a('0xb')]=_0x31b48c[_0x4a7a('0x79')][_0x4a7a('0x3b')](',')[0x0];}else if(this['isNotNull'](_0x31b48c['variable'][_0x4a7a('0x82')])){logger['info'](_0x4a7a('0x83'),_0x31b48c[_0x4a7a('0x32')],_0x31b48c[_0x4a7a('0x79')]);this['channels'][_0x31b48c[_0x4a7a('0x32')]][_0x4a7a('0x84')]=_0x31b48c[_0x4a7a('0x79')];}else if(this[_0x4a7a('0x2c')](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x85')])){logger[_0x4a7a('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x31b48c[_0x4a7a('0x32')],_0x31b48c[_0x4a7a('0x79')]);this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x32')]]['destination']=_0x31b48c[_0x4a7a('0x79')];}else if(this['isNotNull'](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x86')])){logger[_0x4a7a('0x26')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x31b48c['uniqueid'],_0x31b48c[_0x4a7a('0x79')]);this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x32')]][_0x4a7a('0x87')]=_0x31b48c['value'];}else if(this[_0x4a7a('0x2c')](_0x31b48c['variable']['xmcs-queue'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x31b48c[_0x4a7a('0x32')],_0x31b48c[_0x4a7a('0x79')]);this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x32')]]['queue']=_0x31b48c[_0x4a7a('0x79')];}else if(this[_0x4a7a('0x2c')](_0x31b48c['variable'][_0x4a7a('0x88')])){logger[_0x4a7a('0x26')](_0x4a7a('0x89'),_0x31b48c[_0x4a7a('0x32')],_0x31b48c[_0x4a7a('0x79')]);this['channels'][_0x31b48c[_0x4a7a('0x32')]][_0x4a7a('0x8a')]=_0x31b48c[_0x4a7a('0x79')];}}}else if(this[_0x4a7a('0x2c')](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x77')])){if(_0x31b48c[_0x4a7a('0x79')]){var _0x1b44db=path[_0x4a7a('0x8b')](_0x31b48c[_0x4a7a('0x79')])['name'];logger['info'](_0x4a7a('0x78'),_0x1b44db,_0x31b48c['value']);this[_0x4a7a('0x6c')](_0x1b44db,_0x31b48c[_0x4a7a('0x79')]);}}else if(this[_0x4a7a('0x12')][_0x31b48c[_0x4a7a('0x33')]]){if(this[_0x4a7a('0x2c')](_0x31b48c['variable'])){if(this[_0x4a7a('0x2c')](_0x31b48c[_0x4a7a('0x76')][_0x4a7a('0x88')])){logger[_0x4a7a('0x26')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x31b48c[_0x4a7a('0x33')],_0x31b48c[_0x4a7a('0x79')]);this['channels'][_0x31b48c[_0x4a7a('0x33')]][_0x4a7a('0x8c')]=_0x31b48c[_0x4a7a('0x79')];}}}}}catch(_0x593a7c){logger[_0x4a7a('0x28')](_0x4a7a('0x8d'),_0x31b48c[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x593a7c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a7a('0x2b')][_0x4a7a('0x1d')]=function(_0x4dde40){try{if(this['isNotNull'](_0x4dde40)){logger[_0x4a7a('0x41')](_0x4a7a('0x8e'),_0x4dde40[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x4dde40,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]]){if(this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]]['linkedid']]){this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x33')]][_0x4a7a('0x32')]=_0x4dde40['uniqueid'];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40['linkedid']][_0x4a7a('0x33')]][_0x4a7a('0x61')]=this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x61')];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x33')]][_0x4a7a('0x62')]=this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x62')];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40['linkedid']][_0x4a7a('0x33')]]['destinationchannel']=this[_0x4a7a('0x12')][this['blindTransfers'][_0x4dde40['linkedid']][_0x4a7a('0x33')]][_0x4a7a('0x38')];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x33')]][_0x4a7a('0x47')]=this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x47')];this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]]=this[_0x4a7a('0x12')][this['blindTransfers'][_0x4dde40['linkedid']][_0x4a7a('0x33')]];delete this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40['linkedid']][_0x4a7a('0x33')]];}else if(this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]]){this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40['linkedid']][_0x4a7a('0x32')]][_0x4a7a('0x32')]=[this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]][_0x4a7a('0x33')],this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]]['linkedid']=this['channels'][this['blindTransfers'][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]][_0x4a7a('0x32')]][0x0];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]][_0x4a7a('0x61')]=this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x61')];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]][_0x4a7a('0x62')]=this['channels'][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x62')];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]][_0x4a7a('0x68')]=this[_0x4a7a('0x12')][this['blindTransfers'][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]][_0x4a7a('0x38')];this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40['linkedid']]['uniqueid']]['disposition']=this['channels'][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x47')];this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]]=this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]];delete this[_0x4a7a('0x12')][this[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x33')]][_0x4a7a('0x32')]];}}if(this[_0x4a7a('0x12')][_0x4dde40['uniqueid']]){logger[_0x4a7a('0x26')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x4dde40[_0x4a7a('0x32')],_0x4dde40[_0x4a7a('0x8f')]);var _0x1e13aa=moment();this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x90')]=_0x1e13aa['format'](_0x4a7a('0x46'));this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x58')]=_0x1e13aa[_0x4a7a('0x67')](this['channels'][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x45')],_0x4a7a('0x59'));if(this['channels'][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x61')]){this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x91')]=_0x1e13aa[_0x4a7a('0x67')](this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]]['answertime'],'seconds');this['channels'][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x63')]=this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x58')]-this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]]['billableseconds'];}if(_0x4dde40[_0x4a7a('0x37')]===_0x4a7a('0x4a')){if(this[_0x4a7a('0x13')][_0x4dde40['channel'][_0x4a7a('0x3b')]('-')[0x0]]){this[_0x4a7a('0x13')][_0x4dde40[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]]=_[_0x4a7a('0x92')](this['agents'][_0x4dde40[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]],[_0x4a7a('0x4b')]);logger[_0x4a7a('0x41')](_0x4a7a('0x93'),_0x4dde40[_0x4a7a('0x32')],util[_0x4a7a('0x2a')]({'id':this[_0x4a7a('0x13')][_0x4dde40['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x4a7a('0x13')][_0x4dde40[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]][_0x4a7a('0x3f')]},{'showHidden':![],'depth':null}));this[_0x4a7a('0x2e')](util[_0x4a7a('0x3d')](_0x4a7a('0x4e'),this[_0x4a7a('0x13')][_0x4dde40['channel']['split']('-')[0x0]][_0x4a7a('0x3e')]),_0x4a7a('0x94'),{'id':this['agents'][_0x4dde40[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4dde40[_0x4a7a('0x38')][_0x4a7a('0x3b')]('-')[0x0]][_0x4a7a('0x3f')]});for(var _0x229b58=0x0;_0x229b58<Object[_0x4a7a('0x36')](this[_0x4a7a('0x13')])[_0x4a7a('0x95')];_0x229b58++){var _0x2d890f=Object['keys'](this[_0x4a7a('0x13')])[_0x229b58];var _0x11e156=this[_0x4a7a('0x13')][_0x2d890f];if(_0x11e156[_0x4a7a('0x3f')]===Number(this['channels'][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x3c')])){this[_0x4a7a('0x2e')](util[_0x4a7a('0x3d')](_0x4a7a('0x4e'),_0x11e156[_0x4a7a('0x3e')]),'user:agentcomplete',{'id':_0x11e156['id'],'destaccountcode':_0x11e156['accountcode'],'transfer':this[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x96')]});break;}}}}var _0xf701d0=this;Promise['resolve']()[_0x4a7a('0x97')](function(){var _0x11a1e9=_0xf701d0[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]];if(typeof _0x11a1e9[_0x4a7a('0x96')]===_0x4a7a('0x4c'))return;if(_['isEmpty'](_0x11a1e9['monitors']))return;return RpcSetting[_0x4a7a('0x98')]()[_0x4a7a('0x97')](function(_0x12b908){if(!_0x12b908[_0x4a7a('0x99')])return;return Promise[_0x4a7a('0x9a')]()[_0x4a7a('0x97')](function(){return ami[_0x4a7a('0x9b')]({'action':_0x4a7a('0x9c'),'channel':_0x11a1e9[_0x4a7a('0x38')]})['catch'](function(){});})[_0x4a7a('0x97')](function(){return ami['Action']({'action':_0x4a7a('0x9c'),'channel':_0x11a1e9[_0x4a7a('0x68')]})['catch'](function(){})[_0x4a7a('0x9d')](function(){var _0x45bcd0=_0xf701d0[_0x4a7a('0x13')][_0x11a1e9[_0x4a7a('0x68')][_0x4a7a('0x3b')]('-')[0x0]];if(!_0x45bcd0)return;io[_0x4a7a('0x2e')](_0x4a7a('0x9e'),{'agentId':_0x45bcd0['id'],'uniqueid':_0x11a1e9[_0x4a7a('0x32')]});});});});})[_0x4a7a('0x97')](function(){if(_0x4dde40[_0x4a7a('0x9f')]===_0x4a7a('0xa0')){_0xf701d0[_0x4a7a('0x14')][_0x4dde40[_0x4a7a('0x32')]]=_0x4dde40;}else{if(_0xf701d0[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x5e')]===_0x4a7a('0xa1')&&_0xf701d0['blindTransfers'][_0x4dde40['uniqueid']]){_0xf701d0[_0x4a7a('0x12')][_0x4dde40['uniqueid']]['uniqueid']=[_0xf701d0[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x33')],_0xf701d0[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]][_0x4a7a('0x33')]=_0xf701d0[_0x4a7a('0x12')][_0x4dde40['uniqueid']][_0x4a7a('0x32')]][0x0];delete _0xf701d0['blindTransfers'][_0x4dde40[_0x4a7a('0x32')]];}}logger[_0x4a7a('0x41')](_0x4a7a('0xa2'),_0x4dde40[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0xf701d0[_0x4a7a('0x12')][_0x4dde40[_0x4a7a('0x32')]],{'showHidden':![],'depth':null}));ami[_0x4a7a('0x2e')](_0x4a7a('0xa3'),_0xf701d0['channels'][_0x4dde40[_0x4a7a('0x32')]]);delete _0xf701d0[_0x4a7a('0x12')][_0x4dde40['uniqueid']];});}}}catch(_0x257ec1){logger[_0x4a7a('0x28')](_0x4a7a('0xa4'),_0x4dde40[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x257ec1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x436219){try{if(this[_0x4a7a('0x2c')](_0x436219)){logger[_0x4a7a('0x26')](_0x4a7a('0xa5'),_0x436219[_0x4a7a('0x32')],_0x436219[_0x4a7a('0xa6')],_0x436219[_0x4a7a('0xa7')]);logger[_0x4a7a('0x41')](_0x4a7a('0xa8'),_0x436219[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x436219,{'showHidden':![],'depth':null}));var _0x102f61;if(this['channels'][_0x436219['transfereeuniqueid']]){this[_0x4a7a('0x12')][_0x436219['transfereeuniqueid']][_0x4a7a('0xa9')]=_0x436219['origtransferercalleridnum'];this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xaa')]][_0x4a7a('0xab')]=_0x436219['transfertargetcalleridnum'];if(this[_0x4a7a('0x12')][_0x436219['secondtransfereruniqueid']]){_0x102f61=this[_0x4a7a('0x12')][_0x436219['secondtransfereruniqueid']];this[_0x4a7a('0x12')][_0x436219['secondtransfereruniqueid']]=this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xaa')]];this['channels'][_0x436219[_0x4a7a('0xaa')]]=_0x102f61;}this['channels'][_0x436219['secondtransfereruniqueid']][_0x4a7a('0x96')]=_0x4a7a('0xac');}else if(this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xad')]]){this[_0x4a7a('0x12')][_0x436219['transfertargetuniqueid']][_0x4a7a('0xa9')]=_0x436219[_0x4a7a('0xa6')];this['channels'][_0x436219[_0x4a7a('0xad')]][_0x4a7a('0xab')]=_0x436219[_0x4a7a('0xa7')];if(this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xae')]]){_0x102f61=this['channels'][_0x436219[_0x4a7a('0xae')]];this['channels'][_0x436219[_0x4a7a('0xae')]]=this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xad')]];this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xad')]]=_0x102f61;}this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xad')]]['transferType']=_0x4a7a('0xac');}if((this['channels'][_0x436219[_0x4a7a('0xae')]]||this[_0x4a7a('0x12')][_0x436219['origtransfererlinkedid']])&&this['channels'][_0x436219[_0x4a7a('0xaf')]]){var _0xb4d10a=_[_0x4a7a('0xb0')]([this[_0x4a7a('0x12')][_0x436219['origtransfereruniqueid']],this[_0x4a7a('0x12')][_0x436219['origtransfererlinkedid']],this['channels'][_0x436219[_0x4a7a('0xaf')]]],function(_0xbde67b){return _0xbde67b&&_0xbde67b['type']===_0x4a7a('0xa1')&&_0xbde67b['routeid'];});if(_0xb4d10a){if(this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xae')]])this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xae')]][_0x4a7a('0x96')]='ATTENDED';if(this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xb1')]])this['channels'][_0x436219[_0x4a7a('0xb1')]][_0x4a7a('0x96')]=_0x4a7a('0xac');this[_0x4a7a('0x12')][_0x436219[_0x4a7a('0xaf')]][_0x4a7a('0x96')]='ATTENDED';}}}}catch(_0x133621){logger[_0x4a7a('0x28')](_0x4a7a('0xb2'),_0x436219['uniqueid'],util[_0x4a7a('0x2a')](_0x133621,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a7a('0x2b')][_0x4a7a('0x23')]=function(_0x4c3786){try{if(this[_0x4a7a('0x2c')](_0x4c3786)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x4c3786[_0x4a7a('0x32')],_0x4c3786[_0x4a7a('0xb3')],_0x4c3786['extension']);logger['debug'](_0x4a7a('0xb4'),_0x4c3786['uniqueid'],util[_0x4a7a('0x2a')](_0x4c3786,{'showHidden':![],'depth':null}));if(this['channels'][_0x4c3786[_0x4a7a('0xaa')]]){this[_0x4a7a('0x12')][_0x4c3786[_0x4a7a('0xaa')]][_0x4a7a('0xa9')]=_0x4c3786[_0x4a7a('0xb3')];this[_0x4a7a('0x12')][_0x4c3786[_0x4a7a('0xaa')]]['transferconnectedlinenum']=_0x4c3786['extension'];this[_0x4a7a('0x12')][_0x4c3786[_0x4a7a('0xaa')]][_0x4a7a('0x96')]=_0x4a7a('0xb5');this[_0x4a7a('0x1d')]({'event':'BlindTransfer','uniqueid':_0x4c3786[_0x4a7a('0xaa')],'linkedid':_0x4c3786[_0x4a7a('0xb6')],'context':_0x4c3786[_0x4a7a('0x37')],'channel':_0x4c3786[_0x4a7a('0xb7')]});}else{this[_0x4a7a('0x12')][_0x4c3786[_0x4a7a('0xb6')]]['transferType']=_0x4a7a('0xb5');this[_0x4a7a('0x1d')]({'event':_0x4a7a('0xa0'),'uniqueid':_0x4c3786[_0x4a7a('0xb6')],'linkedid':_0x4c3786['transfereeuniqueid'],'context':_0x4c3786[_0x4a7a('0x37')],'channel':_0x4c3786[_0x4a7a('0xb7')]});}}}catch(_0x3f235c){logger['error'](_0x4a7a('0xb8'),_0x4c3786[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x3f235c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a7a('0x2b')]['syncMusicOnHoldStart']=function(_0xc051aa){try{if(this[_0x4a7a('0x2c')](_0xc051aa)){logger[_0x4a7a('0x41')](_0x4a7a('0xb9'),_0xc051aa[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0xc051aa,{'showHidden':![],'depth':null}));if(this['channels'][_0xc051aa[_0x4a7a('0x32')]]){if(!_[_0x4a7a('0x73')](this['channels'][_0xc051aa[_0x4a7a('0x32')]][_0x4a7a('0x62')])){this[_0x4a7a('0x12')][_0xc051aa['uniqueid']][_0x4a7a('0xba')]=moment()[_0x4a7a('0x3d')](_0x4a7a('0x46'));logger[_0x4a7a('0x26')](_0x4a7a('0xbb'),_0xc051aa[_0x4a7a('0x32')],this['channels'][_0xc051aa['uniqueid']]['mohstarttime']);}}}}catch(_0x1329a1){logger['error']('[%s][voiceCallReport][musiconholdstart]',_0xc051aa['uniqueid'],util['inspect'](_0x1329a1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a7a('0x2b')][_0x4a7a('0x25')]=function(_0x105de7){try{if(this[_0x4a7a('0x2c')](_0x105de7)){logger[_0x4a7a('0x41')](_0x4a7a('0xbc'),_0x105de7[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x105de7,{'showHidden':![],'depth':null}));if(this[_0x4a7a('0x12')][_0x105de7[_0x4a7a('0x32')]]){if(!_[_0x4a7a('0x73')](this[_0x4a7a('0x12')][_0x105de7['uniqueid']][_0x4a7a('0xba')])){this[_0x4a7a('0x12')][_0x105de7[_0x4a7a('0x32')]][_0x4a7a('0xbd')]+=moment()[_0x4a7a('0xbe')](0x0)[_0x4a7a('0x67')](this[_0x4a7a('0x12')][_0x105de7['uniqueid']][_0x4a7a('0xba')],_0x4a7a('0x59'));logger[_0x4a7a('0x26')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x105de7[_0x4a7a('0x32')],this[_0x4a7a('0x12')][_0x105de7[_0x4a7a('0x32')]][_0x4a7a('0xbd')]);delete this['channels'][_0x105de7['uniqueid']][_0x4a7a('0xba')];}}}}catch(_0x5d33d1){logger[_0x4a7a('0x28')](_0x4a7a('0xbf'),_0x105de7[_0x4a7a('0x32')],util[_0x4a7a('0x2a')](_0x5d33d1,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 2545446..148f683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','duration','diff','starttime','total','answered','holdtime','seconds','billableseconds','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','applications','variables','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','addVariable','keys','value','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepeer','membercalls','memberinterface'];(function(_0x48418b,_0x3f1a9d){var _0x55d52a=function(_0x52fc20){while(--_0x52fc20){_0x48418b['push'](_0x48418b['shift']());}};_0x55d52a(++_0x3f1a9d);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5b0741,_0x438df7){_0x5b0741=_0x5b0741-0x0;var _0x3ee9c9=_0x7fbe[_0x5b0741];return _0x3ee9c9;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xe7fb('0x0'));var Redis=require(_0xe7fb('0x1'));var config=require(_0xe7fb('0x2'));var logger=require(_0xe7fb('0x3'))(_0xe7fb('0x4'));var ami=require(_0xe7fb('0x5'));config[_0xe7fb('0x6')]=_[_0xe7fb('0x7')](config[_0xe7fb('0x6')],{'host':_0xe7fb('0x8'),'port':0x18eb});var io=require(_0xe7fb('0x9'))(new Redis(config[_0xe7fb('0x6')]));function VoiceDialReport(_0x24cd67){this[_0xe7fb('0xa')]=_0x24cd67['outboundChannels'];this[_0xe7fb('0xb')]=_0x24cd67[_0xe7fb('0xb')];this[_0xe7fb('0xc')]={};this[_0xe7fb('0xd')]={};ami['on']('dialbegin',this['syncDialBegin'][_0xe7fb('0xe')](this));ami['on'](_0xe7fb('0xf'),this[_0xe7fb('0x10')][_0xe7fb('0xe')](this));ami['on'](_0xe7fb('0x11'),this[_0xe7fb('0x12')][_0xe7fb('0xe')](this));ami['on'](_0xe7fb('0x13'),this[_0xe7fb('0x14')][_0xe7fb('0xe')](this));}VoiceDialReport[_0xe7fb('0x15')][_0xe7fb('0x16')]=function(_0xdf9760){return _0xdf9760!==null&&!_[_0xe7fb('0x17')](_0xdf9760);};VoiceDialReport[_0xe7fb('0x15')]['emit']=function(_0x278b75,_0x2225e5,_0x5573ab){io['to'](_0x278b75)[_0xe7fb('0x18')](_0x2225e5,_0x5573ab);};VoiceDialReport[_0xe7fb('0x15')]['syncDialBegin']=function(_0xa76acf){try{if(this['isNotNull'](_0xa76acf)){logger[_0xe7fb('0x19')](_0xe7fb('0x1a'),_0xa76acf[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0xa76acf,{'showHidden':![],'depth':null}));if(this['channels'][_0xa76acf[_0xe7fb('0x1b')]]){_['merge'](this[_0xe7fb('0xa')][_0xa76acf['uniqueid']],{'starttime':moment()[_0xe7fb('0x1d')](_0xe7fb('0x1e')),'lastevent':_0xe7fb('0x1f'),'interface':_0xa76acf[_0xe7fb('0x20')]['substring'](0x0,_0xa76acf[_0xe7fb('0x20')]['lastIndexOf']('-')),'membername':_0xa76acf[_0xe7fb('0x20')]['substring'](_0xa76acf[_0xe7fb('0x20')]['lastIndexOf']('/')+0x1,_0xa76acf[_0xe7fb('0x20')][_0xe7fb('0x21')]('-'))},_['omit'](_0xa76acf,[_0xe7fb('0x22'),_0xe7fb('0x23')]));logger[_0xe7fb('0x24')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0xa76acf[_0xe7fb('0x1b')],this[_0xe7fb('0xa')][_0xa76acf['uniqueid']]['membername'],this['channels'][_0xa76acf[_0xe7fb('0x1b')]]['interface']);logger['debug'](_0xe7fb('0x25'),_0xa76acf[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](this['channels'][_0xa76acf[_0xe7fb('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0xe7fb('0xc')][_0xa76acf[_0xe7fb('0x1b')]])_[_0xe7fb('0x26')](this[_0xe7fb('0xa')][_0xa76acf[_0xe7fb('0x1b')]],this[_0xe7fb('0xc')][_0xa76acf['uniqueid']]);this['emit'](_0xe7fb('0x27'),_0xe7fb('0x28'),this[_0xe7fb('0xa')][_0xa76acf['uniqueid']]);logger[_0xe7fb('0x19')](_0xe7fb('0x29'),_0xa76acf[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](this[_0xe7fb('0xa')][_0xa76acf[_0xe7fb('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xe7fb('0x18')](_0xe7fb('0x2a'),this['channels'][_0xa76acf[_0xe7fb('0x1b')]]);}}}catch(_0x1742f3){logger[_0xe7fb('0x2b')]('[%s][voiceDialReport][dialbegin]',_0xa76acf['uniqueid'],util[_0xe7fb('0x1c')](_0x1742f3,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xe7fb('0x10')]=function(_0x2f8774){try{if(this[_0xe7fb('0x16')](_0x2f8774)){logger[_0xe7fb('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x2f8774[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0x2f8774,{'showHidden':![],'depth':null}));if(this[_0xe7fb('0xa')][_0x2f8774[_0xe7fb('0x1b')]]){this[_0xe7fb('0xa')][_0x2f8774['uniqueid']][_0xe7fb('0x2c')]=_0x2f8774[_0xe7fb('0x2c')];if(_0x2f8774[_0xe7fb('0x2c')]===_0xe7fb('0x2d')){this[_0xe7fb('0xa')][_0x2f8774[_0xe7fb('0x1b')]][_0xe7fb('0x2e')]=_0x2f8774[_0xe7fb('0x2e')];this[_0xe7fb('0xa')][_0x2f8774['uniqueid']][_0xe7fb('0x2f')]=_0x2f8774[_0xe7fb('0x2f')];this[_0xe7fb('0xa')][_0x2f8774['uniqueid']][_0xe7fb('0x30')]=moment()[_0xe7fb('0x1d')](_0xe7fb('0x1e'));this[_0xe7fb('0xa')][_0x2f8774[_0xe7fb('0x1b')]][_0xe7fb('0x31')]=_0xe7fb('0x32');logger[_0xe7fb('0x24')](_0xe7fb('0x33'),_0x2f8774[_0xe7fb('0x1b')],_0x2f8774[_0xe7fb('0x20')][_0xe7fb('0x34')](_0x2f8774[_0xe7fb('0x20')][_0xe7fb('0x21')]('/')+0x1,_0x2f8774[_0xe7fb('0x20')][_0xe7fb('0x21')]('-')));logger[_0xe7fb('0x19')](_0xe7fb('0x35'),_0x2f8774[_0xe7fb('0x1b')],util['inspect'](this[_0xe7fb('0xa')][_0x2f8774[_0xe7fb('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xe7fb('0x18')](_0xe7fb('0x36'),this['channels'][_0x2f8774[_0xe7fb('0x1b')]]);}logger[_0xe7fb('0x19')](_0xe7fb('0x37'),_0x2f8774[_0xe7fb('0x1b')],util['inspect'](this[_0xe7fb('0xa')][_0x2f8774[_0xe7fb('0x1b')]],{'showHidden':![],'depth':null}));this[_0xe7fb('0x18')](_0xe7fb('0x27'),_0xe7fb('0x28'),this[_0xe7fb('0xa')][_0x2f8774['uniqueid']]);}}}catch(_0x4362c2){logger[_0xe7fb('0x2b')](_0xe7fb('0x38'),_0x2f8774['uniqueid'],util[_0xe7fb('0x1c')](_0x4362c2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe7fb('0x15')]['syncVarSet']=function(_0x490333){try{if(this['isNotNull'](_0x490333)){logger['debug']('[%s][voiceDialReport][varset]\x20event:',_0x490333[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0x490333,{'showHidden':![],'depth':null}));this[_0xe7fb('0x39')](_0x490333['uniqueid'],_[_0xe7fb('0x3a')](_0x490333['variable'])[0x0],_0x490333[_0xe7fb('0x3b')]);if(this[_0xe7fb('0x16')](_0x490333['variable'])&&this[_0xe7fb('0x16')](_0x490333[_0xe7fb('0x3c')][_0xe7fb('0x3d')])){if(_[_0xe7fb('0x17')](this['channels'][_0x490333[_0xe7fb('0x1b')]])){this[_0xe7fb('0xa')][_0x490333[_0xe7fb('0x1b')]]={'routeId':_0x490333['value'],'variables':this[_0xe7fb('0xd')][_0x490333[_0xe7fb('0x1b')]],'motionChannel':_0xe7fb('0x3e')};logger[_0xe7fb('0x24')](_0xe7fb('0x3f'),_0x490333['uniqueid'],_0x490333[_0xe7fb('0x3c')]['outboundrouteid'],_[_0xe7fb('0x3a')](_0x490333[_0xe7fb('0x3c')])[0x0],_0x490333[_0xe7fb('0x3b')]);logger[_0xe7fb('0x19')](_0xe7fb('0x40'),_0x490333['uniqueid'],util[_0xe7fb('0x1c')](this['channels'][_0x490333['uniqueid']],{'showHidden':![],'depth':null}));this[_0xe7fb('0x18')](_0xe7fb('0x27'),_0xe7fb('0x28'),this['channels'][_0x490333[_0xe7fb('0x1b')]]);}}}}catch(_0x4cefe7){logger['error']('[%s][voiceDialReport][varset]',_0x490333[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0x4cefe7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xe7fb('0x15')][_0xe7fb('0x39')]=function(_0x2dc09c,_0x1f0533,_0x18a590){var _0x347177=['rtpaudioqos',_0xe7fb('0x41'),'rtpaudioqosjitter',_0xe7fb('0x42'),_0xe7fb('0x43'),'rtpaudioqoslossbridged',_0xe7fb('0x44'),'rtpaudioqosrttbridged',_0xe7fb('0x45'),'sipuri',_0xe7fb('0x46'),'bridgepvtcallid',_0xe7fb('0x47'),'memberdynamic',_0xe7fb('0x48'),_0xe7fb('0x49'),_0xe7fb('0x4a'),_0xe7fb('0x4b'),_0xe7fb('0x4c')];if(!_[_0xe7fb('0x4d')](_0x1f0533)&&!_[_0xe7fb('0x4e')](_0x347177,_0x1f0533)){if(_['isUndefined'](this['variables'][_0x2dc09c])){this[_0xe7fb('0xd')][_0x2dc09c]={};}this['variables'][_0x2dc09c][_0x1f0533]=_0x18a590;}};VoiceDialReport['prototype']['syncHangup']=function(_0x50b8df){try{if(this['isNotNull'](_0x50b8df)){logger[_0xe7fb('0x19')](_0xe7fb('0x4f'),_0x50b8df[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0x50b8df,{'showHidden':![],'depth':null}));if(this['channels'][_0x50b8df[_0xe7fb('0x1b')]]){logger[_0xe7fb('0x24')](_0xe7fb('0x50'),_0x50b8df['uniqueid'],_0x50b8df['cause-txt']);this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x51')]=moment()['format'](_0xe7fb('0x1e'));this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x52')]=moment(this['channels'][_0x50b8df['uniqueid']][_0xe7fb('0x51')])[_0xe7fb('0x53')](this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x54')],'seconds');this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x31')]='complete';this['outbound'][_0xe7fb('0x55')]+=0x1;if(this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x30')]){this[_0xe7fb('0xb')][_0xe7fb('0x56')]+=0x1;this['channels'][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x57')]=moment(this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x30')])[_0xe7fb('0x53')](this['channels'][_0x50b8df[_0xe7fb('0x1b')]]['starttime'],_0xe7fb('0x58'));this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x59')]=moment(this['channels'][_0x50b8df['uniqueid']][_0xe7fb('0x51')])[_0xe7fb('0x53')](this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]][_0xe7fb('0x30')],'seconds');this[_0xe7fb('0xb')]['sumHoldTime']+=this[_0xe7fb('0xa')][_0x50b8df['uniqueid']]['holdtime']||0x0;this[_0xe7fb('0xb')][_0xe7fb('0x5a')]+=this[_0xe7fb('0xa')][_0x50b8df['uniqueid']][_0xe7fb('0x59')];}this[_0xe7fb('0xb')][_0xe7fb('0x5b')]+=this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]]['duration'];logger[_0xe7fb('0x19')](_0xe7fb('0x5c'),_0x50b8df['uniqueid'],util[_0xe7fb('0x1c')](this[_0xe7fb('0xa')][_0x50b8df['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xe7fb('0x18')]('custom:voiceDialReport',this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]]);logger[_0xe7fb('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x50b8df[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xe7fb('0x18')](_0xe7fb('0x5d'),this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x50b8df[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](this[_0xe7fb('0xa')][_0x50b8df['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xe7fb('0x27'),_0xe7fb('0x5e'),this[_0xe7fb('0xb')]);logger[_0xe7fb('0x24')](_0xe7fb('0x5f'),JSON[_0xe7fb('0x60')](this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]]));logger[_0xe7fb('0x19')](_0xe7fb('0x61'),_0x50b8df[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](this[_0xe7fb('0xa')][_0x50b8df['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xe7fb('0x27'),_0xe7fb('0x62'),this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x1b')]]);delete this[_0xe7fb('0xa')][_0x50b8df['uniqueid']];}else if(this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x63')]]){this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x63')]][_0xe7fb('0x1b')]=this[_0xe7fb('0xa')][_0x50b8df[_0xe7fb('0x63')]][_0xe7fb('0x64')];}if(this[_0xe7fb('0xd')][_0x50b8df['uniqueid']]){delete this[_0xe7fb('0xd')][_0x50b8df['uniqueid']];}}}catch(_0x279663){logger[_0xe7fb('0x2b')](_0xe7fb('0x65'),_0x50b8df[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0x279663,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xe7fb('0x66')]=function(_0x38e66a){try{if(this[_0xe7fb('0x16')](_0x38e66a)){logger[_0xe7fb('0x19')](_0xe7fb('0x67'),_0x38e66a[_0xe7fb('0x1b')],util[_0xe7fb('0x1c')](_0x38e66a,{'showHidden':![],'depth':null}));if(_0x38e66a[_0xe7fb('0x68')][_0xe7fb('0x69')]()===_0xe7fb('0x6a')){_0x38e66a[_0xe7fb('0x6b')]=(_0x38e66a[_0xe7fb('0x6c')]||_0x38e66a[_0xe7fb('0x6b')])[_0xe7fb('0x69')]();if(_['startsWith'](_0x38e66a['applicationdata'],'cdr(')){if(_[_0xe7fb('0x17')](this[_0xe7fb('0xc')][_0x38e66a[_0xe7fb('0x1b')]]))this[_0xe7fb('0xc')][_0x38e66a['uniqueid']]={};logger[_0xe7fb('0x24')](_0xe7fb('0x6d'),_0x38e66a[_0xe7fb('0x1b')],_0x38e66a[_0xe7fb('0x68')],_0x38e66a['applicationdata']);var _0x2f7fa6=_0x38e66a['applicationdata'][_0xe7fb('0x6e')]('=');var _0x325c51=_0x2f7fa6[0x0][_0xe7fb('0x6f')](/cdr\((.*)\)/);if(_0x325c51)this[_0xe7fb('0xc')][_0x38e66a[_0xe7fb('0x1b')]][_0x325c51[0x1]]=_0x2f7fa6[0x1];}}}}catch(_0x4ab541){logger[_0xe7fb('0x2b')]('[%s][voiceDialReport][newexten]',_0x38e66a[_0xe7fb('0x1b')],util['inspect'](_0x4ab541,{'showHidden':![],'depth':null}));}};module[_0xe7fb('0x70')]=VoiceDialReport;
\ No newline at end of file
+var _0x5075=['redis','defaults','outboundChannels','outbound','dialbegin','syncDialBegin','bind','dialend','varset','hangup','prototype','isNotNull','isUndefined','emit','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','channels','merge','format','called','channel','substring','lastIndexOf','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','holdtime','billableseconds','sumHoldTime','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','applications','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami'];(function(_0x32db5a,_0x2eab99){var _0x44a506=function(_0x15df3c){while(--_0x15df3c){_0x32db5a['push'](_0x32db5a['shift']());}};_0x44a506(++_0x2eab99);}(_0x5075,0x73));var _0x5507=function(_0x3c4a7c,_0x2f4e3c){_0x3c4a7c=_0x3c4a7c-0x0;var _0xf13d1e=_0x5075[_0x3c4a7c];return _0xf13d1e;};'use strict';var _=require(_0x5507('0x0'));var moment=require(_0x5507('0x1'));var util=require(_0x5507('0x2'));var Redis=require(_0x5507('0x3'));var config=require(_0x5507('0x4'));var logger=require(_0x5507('0x5'))(_0x5507('0x6'));var ami=require('../ami');config[_0x5507('0x7')]=_[_0x5507('0x8')](config[_0x5507('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5507('0x7')]));function VoiceDialReport(_0x773559){this['channels']=_0x773559[_0x5507('0x9')];this[_0x5507('0xa')]=_0x773559[_0x5507('0xa')];this['applications']={};this['variables']={};ami['on'](_0x5507('0xb'),this[_0x5507('0xc')][_0x5507('0xd')](this));ami['on'](_0x5507('0xe'),this['syncDialEnd'][_0x5507('0xd')](this));ami['on'](_0x5507('0xf'),this['syncVarSet'][_0x5507('0xd')](this));ami['on'](_0x5507('0x10'),this['syncHangup'][_0x5507('0xd')](this));}VoiceDialReport[_0x5507('0x11')][_0x5507('0x12')]=function(_0x267f27){return _0x267f27!==null&&!_[_0x5507('0x13')](_0x267f27);};VoiceDialReport[_0x5507('0x11')]['emit']=function(_0x9cc3f9,_0x2b7c43,_0xc828e5){io['to'](_0x9cc3f9)[_0x5507('0x14')](_0x2b7c43,_0xc828e5);};VoiceDialReport['prototype'][_0x5507('0xc')]=function(_0x10d7b9){try{if(this[_0x5507('0x12')](_0x10d7b9)){logger[_0x5507('0x15')](_0x5507('0x16'),_0x10d7b9[_0x5507('0x17')],util[_0x5507('0x18')](_0x10d7b9,{'showHidden':![],'depth':null}));if(this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]]){_[_0x5507('0x1a')](this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]],{'starttime':moment()[_0x5507('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x5507('0x1c'),'interface':_0x10d7b9[_0x5507('0x1d')][_0x5507('0x1e')](0x0,_0x10d7b9[_0x5507('0x1d')]['lastIndexOf']('-')),'membername':_0x10d7b9[_0x5507('0x1d')][_0x5507('0x1e')](_0x10d7b9[_0x5507('0x1d')][_0x5507('0x1f')]('/')+0x1,_0x10d7b9[_0x5507('0x1d')][_0x5507('0x1f')]('-'))},_['omit'](_0x10d7b9,[_0x5507('0x20'),_0x5507('0x21')]));logger[_0x5507('0x22')](_0x5507('0x23'),_0x10d7b9[_0x5507('0x17')],this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]][_0x5507('0x24')],this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]][_0x5507('0x25')]);logger[_0x5507('0x15')](_0x5507('0x26'),_0x10d7b9[_0x5507('0x17')],util[_0x5507('0x18')](this['channels'][_0x10d7b9[_0x5507('0x17')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x10d7b9[_0x5507('0x17')]])_['merge'](this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]],this['applications'][_0x10d7b9['uniqueid']]);this[_0x5507('0x14')](_0x5507('0x27'),'voice_outbound_channel:save',this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]]);logger[_0x5507('0x15')](_0x5507('0x28'),_0x10d7b9[_0x5507('0x17')],util[_0x5507('0x18')](this['channels'][_0x10d7b9[_0x5507('0x17')]],{'showHidden':![],'depth':null}));ami[_0x5507('0x14')](_0x5507('0x29'),this[_0x5507('0x19')][_0x10d7b9[_0x5507('0x17')]]);}}}catch(_0x495bbe){logger['error'](_0x5507('0x2a'),_0x10d7b9[_0x5507('0x17')],util[_0x5507('0x18')](_0x495bbe,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5507('0x11')]['syncDialEnd']=function(_0x777eb7){try{if(this[_0x5507('0x12')](_0x777eb7)){logger[_0x5507('0x15')](_0x5507('0x2b'),_0x777eb7[_0x5507('0x17')],util[_0x5507('0x18')](_0x777eb7,{'showHidden':![],'depth':null}));if(this[_0x5507('0x19')][_0x777eb7[_0x5507('0x17')]]){this['channels'][_0x777eb7[_0x5507('0x17')]][_0x5507('0x2c')]=_0x777eb7[_0x5507('0x2c')];if(_0x777eb7['dialstatus']==='ANSWER'){this[_0x5507('0x19')][_0x777eb7[_0x5507('0x17')]][_0x5507('0x2d')]=_0x777eb7[_0x5507('0x2d')];this[_0x5507('0x19')][_0x777eb7['uniqueid']]['connectedlinename']=_0x777eb7[_0x5507('0x2e')];this[_0x5507('0x19')][_0x777eb7[_0x5507('0x17')]][_0x5507('0x2f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x5507('0x19')][_0x777eb7['uniqueid']][_0x5507('0x30')]=_0x5507('0x31');logger[_0x5507('0x22')](_0x5507('0x32'),_0x777eb7[_0x5507('0x17')],_0x777eb7[_0x5507('0x1d')][_0x5507('0x1e')](_0x777eb7[_0x5507('0x1d')][_0x5507('0x1f')]('/')+0x1,_0x777eb7[_0x5507('0x1d')]['lastIndexOf']('-')));logger['debug']('[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:',_0x777eb7['uniqueid'],util[_0x5507('0x18')](this[_0x5507('0x19')][_0x777eb7[_0x5507('0x17')]],{'showHidden':![],'depth':null}));ami[_0x5507('0x14')](_0x5507('0x33'),this[_0x5507('0x19')][_0x777eb7[_0x5507('0x17')]]);}logger[_0x5507('0x15')](_0x5507('0x34'),_0x777eb7[_0x5507('0x17')],util[_0x5507('0x18')](this[_0x5507('0x19')][_0x777eb7[_0x5507('0x17')]],{'showHidden':![],'depth':null}));this[_0x5507('0x14')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x777eb7[_0x5507('0x17')]]);}}}catch(_0x41283f){logger[_0x5507('0x35')](_0x5507('0x36'),_0x777eb7[_0x5507('0x17')],util[_0x5507('0x18')](_0x41283f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5507('0x11')][_0x5507('0x37')]=function(_0x3dd253){try{if(this[_0x5507('0x12')](_0x3dd253)){logger[_0x5507('0x15')](_0x5507('0x38'),_0x3dd253[_0x5507('0x17')],util[_0x5507('0x18')](_0x3dd253,{'showHidden':![],'depth':null}));this[_0x5507('0x39')](_0x3dd253[_0x5507('0x17')],_[_0x5507('0x3a')](_0x3dd253[_0x5507('0x3b')])[0x0],_0x3dd253[_0x5507('0x3c')]);if(this['isNotNull'](_0x3dd253[_0x5507('0x3b')])&&this[_0x5507('0x12')](_0x3dd253['variable']['outboundrouteid'])){if(_[_0x5507('0x13')](this[_0x5507('0x19')][_0x3dd253[_0x5507('0x17')]])){this[_0x5507('0x19')][_0x3dd253[_0x5507('0x17')]]={'routeId':_0x3dd253['value'],'variables':this[_0x5507('0x3d')][_0x3dd253[_0x5507('0x17')]],'motionChannel':_0x5507('0x3e')};logger['info'](_0x5507('0x3f'),_0x3dd253[_0x5507('0x17')],_0x3dd253[_0x5507('0x3b')][_0x5507('0x40')],_[_0x5507('0x3a')](_0x3dd253['variable'])[0x0],_0x3dd253[_0x5507('0x3c')]);logger['debug'](_0x5507('0x41'),_0x3dd253[_0x5507('0x17')],util[_0x5507('0x18')](this[_0x5507('0x19')][_0x3dd253[_0x5507('0x17')]],{'showHidden':![],'depth':null}));this[_0x5507('0x14')](_0x5507('0x27'),_0x5507('0x42'),this['channels'][_0x3dd253[_0x5507('0x17')]]);}}}}catch(_0x22e63b){logger['error']('[%s][voiceDialReport][varset]',_0x3dd253['uniqueid'],util[_0x5507('0x18')](_0x22e63b,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x5507('0x39')]=function(_0x4e53fa,_0x754595,_0x55f8c2){var _0x5ef341=[_0x5507('0x43'),_0x5507('0x44'),_0x5507('0x45'),_0x5507('0x46'),_0x5507('0x47'),_0x5507('0x48'),'rtpaudioqosrtt',_0x5507('0x49'),_0x5507('0x4a'),_0x5507('0x4b'),'bridgepeer',_0x5507('0x4c'),_0x5507('0x4d'),_0x5507('0x4e'),_0x5507('0x4f'),_0x5507('0x50'),_0x5507('0x24'),_0x5507('0x51'),_0x5507('0x52')];if(!_[_0x5507('0x53')](_0x754595)&&!_[_0x5507('0x54')](_0x5ef341,_0x754595)){if(_[_0x5507('0x13')](this['variables'][_0x4e53fa])){this['variables'][_0x4e53fa]={};}this[_0x5507('0x3d')][_0x4e53fa][_0x754595]=_0x55f8c2;}};VoiceDialReport[_0x5507('0x11')][_0x5507('0x55')]=function(_0x1b34c8){try{if(this[_0x5507('0x12')](_0x1b34c8)){logger[_0x5507('0x15')](_0x5507('0x56'),_0x1b34c8[_0x5507('0x17')],util[_0x5507('0x18')](_0x1b34c8,{'showHidden':![],'depth':null}));if(this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]]){logger[_0x5507('0x22')](_0x5507('0x57'),_0x1b34c8[_0x5507('0x17')],_0x1b34c8[_0x5507('0x58')]);this[_0x5507('0x19')][_0x1b34c8['uniqueid']][_0x5507('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x5a')]=moment(this[_0x5507('0x19')][_0x1b34c8['uniqueid']][_0x5507('0x59')])[_0x5507('0x5b')](this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x5c')],_0x5507('0x5d'));this['channels'][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x30')]=_0x5507('0x5e');this['outbound']['total']+=0x1;if(this[_0x5507('0x19')][_0x1b34c8['uniqueid']][_0x5507('0x2f')]){this[_0x5507('0xa')]['answered']+=0x1;this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x5f')]=moment(this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x2f')])[_0x5507('0x5b')](this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x5c')],_0x5507('0x5d'));this[_0x5507('0x19')][_0x1b34c8['uniqueid']][_0x5507('0x60')]=moment(this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x59')])[_0x5507('0x5b')](this['channels'][_0x1b34c8[_0x5507('0x17')]]['answertime'],_0x5507('0x5d'));this[_0x5507('0xa')][_0x5507('0x61')]+=this['channels'][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x5f')]||0x0;this[_0x5507('0xa')]['sumBillable']+=this[_0x5507('0x19')][_0x1b34c8['uniqueid']][_0x5507('0x60')];}this['outbound']['sumDuration']+=this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]][_0x5507('0x5a')];logger[_0x5507('0x15')](_0x5507('0x62'),_0x1b34c8[_0x5507('0x17')],util['inspect'](this['channels'][_0x1b34c8[_0x5507('0x17')]],{'showHidden':![],'depth':null}));ami[_0x5507('0x14')](_0x5507('0x63'),this[_0x5507('0x19')][_0x1b34c8['uniqueid']]);logger[_0x5507('0x15')](_0x5507('0x64'),_0x1b34c8[_0x5507('0x17')],util[_0x5507('0x18')](this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]],{'showHidden':![],'depth':null}));ami[_0x5507('0x14')]('custom:dialend',this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]]);logger[_0x5507('0x15')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x1b34c8[_0x5507('0x17')],util['inspect'](this['channels'][_0x1b34c8['uniqueid']],{'showHidden':![],'depth':null}));this[_0x5507('0x14')](_0x5507('0x27'),_0x5507('0x65'),this[_0x5507('0xa')]);logger[_0x5507('0x22')](_0x5507('0x66'),JSON[_0x5507('0x67')](this['channels'][_0x1b34c8[_0x5507('0x17')]]));logger['debug'](_0x5507('0x68'),_0x1b34c8[_0x5507('0x17')],util[_0x5507('0x18')](this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]],{'showHidden':![],'depth':null}));this[_0x5507('0x14')](_0x5507('0x27'),_0x5507('0x69'),this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x17')]]);delete this[_0x5507('0x19')][_0x1b34c8['uniqueid']];}else if(this[_0x5507('0x19')][_0x1b34c8[_0x5507('0x6a')]]){this[_0x5507('0x19')][_0x1b34c8['linkedid']][_0x5507('0x17')]=this[_0x5507('0x19')][_0x1b34c8['linkedid']][_0x5507('0x6b')];}if(this['variables'][_0x1b34c8['uniqueid']]){delete this[_0x5507('0x3d')][_0x1b34c8['uniqueid']];}}}catch(_0xb92deb){logger[_0x5507('0x35')](_0x5507('0x6c'),_0x1b34c8[_0x5507('0x17')],util[_0x5507('0x18')](_0xb92deb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x5507('0x11')]['syncNewExten']=function(_0x43fccf){try{if(this[_0x5507('0x12')](_0x43fccf)){logger[_0x5507('0x15')](_0x5507('0x6d'),_0x43fccf[_0x5507('0x17')],util[_0x5507('0x18')](_0x43fccf,{'showHidden':![],'depth':null}));if(_0x43fccf[_0x5507('0x6e')][_0x5507('0x6f')]()===_0x5507('0x70')){_0x43fccf[_0x5507('0x71')]=(_0x43fccf[_0x5507('0x72')]||_0x43fccf[_0x5507('0x71')])['toLowerCase']();if(_[_0x5507('0x73')](_0x43fccf[_0x5507('0x71')],_0x5507('0x74'))){if(_[_0x5507('0x13')](this[_0x5507('0x75')][_0x43fccf[_0x5507('0x17')]]))this['applications'][_0x43fccf[_0x5507('0x17')]]={};logger['info'](_0x5507('0x76'),_0x43fccf['uniqueid'],_0x43fccf['application'],_0x43fccf[_0x5507('0x71')]);var _0x20274e=_0x43fccf[_0x5507('0x71')][_0x5507('0x77')]('=');var _0x447e8d=_0x20274e[0x0]['match'](/cdr\((.*)\)/);if(_0x447e8d)this[_0x5507('0x75')][_0x43fccf['uniqueid']][_0x447e8d[0x1]]=_0x20274e[0x1];}}}}catch(_0x410c16){logger[_0x5507('0x35')](_0x5507('0x78'),_0x43fccf[_0x5507('0x17')],util['inspect'](_0x410c16,{'showHidden':![],'depth':null}));}};module[_0x5507('0x79')]=VoiceDialReport;
\ No newline at end of file
index 6e6c692..9763a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa007=['[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','keys','value','variable','CONTINUE','TIMEOUT','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','membercalls','memberdynamic','memberlastcall','membername','memberrealtime','includes','handleHangup','length','unmanaged','abandoned','sumHoldTime','sumDuration','milliseconds','diff','answered','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','lastevent','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','syncHangup','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transfertype','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','application','appdata','CDR(routeAlias)','applicationdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/voiceQueueSummary','redis','defaults','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','channels','queueChannels','voiceQueues','campaigns','summary','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','syncQueueStatusComplete','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','hangup','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','variables','[%s][voiceQueueReport][checkVariables]','inspect','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','queue','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','name','voice_queue:save','isNotNull','loopQueueShow','queues','[voiceQueueReport][queues]','loopQueueSummary','then','actionid','isRunning','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','realtime','handleInboundQueueSummaryReport','assign','outbound','custom:queuesummary','statusRequests','completeEvent','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','queuecallerjoin','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa007,0x15e));var _0x7a00=function(_0x276de9,_0x2c2f75){_0x276de9=_0x276de9-0x0;var _0xbac321=_0xa007[_0x276de9];return _0xbac321;};'use strict';var _=require(_0x7a00('0x0'));var moment=require(_0x7a00('0x1'));var util=require(_0x7a00('0x2'));var Redis=require(_0x7a00('0x3'));var config=require(_0x7a00('0x4'));var logger=require(_0x7a00('0x5'))(_0x7a00('0x6'));var ami=require(_0x7a00('0x7'));var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x7a00('0x8'));config[_0x7a00('0x9')]=_[_0x7a00('0xa')](config[_0x7a00('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x7a00('0xb'))(new Redis(config[_0x7a00('0x9')]));var Sequence=function(){};Sequence[_0x7a00('0xc')][_0x7a00('0xd')]=function(_0x4f5212){this[_0x7a00('0xe')]=this[_0x7a00('0xe')]?this[_0x7a00('0xe')]['finally'](_0x4f5212):_0x4f5212();};function VoiceQueueReport(_0x40d10c){this[_0x7a00('0xf')]=new Sequence();this[_0x7a00('0x10')]={};this['realtime']=_0x40d10c;this['agents']=_0x40d10c['agents'];this[_0x7a00('0x11')]=_0x40d10c[_0x7a00('0x12')];this[_0x7a00('0x13')]=_0x40d10c[_0x7a00('0x13')];this['campaigns']=_0x40d10c[_0x7a00('0x14')];this[_0x7a00('0x15')]=initializeSummary();this['variables']={};ami['on'](_0x7a00('0x16'),this[_0x7a00('0x17')][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x19'),this[_0x7a00('0x1a')]['bind'](this));ami['on'](_0x7a00('0x1b'),this[_0x7a00('0x1c')][_0x7a00('0x18')](this));ami['on']('queuestatuscomplete',this[_0x7a00('0x1d')]['bind'](this));ami['on']('queuecallerjoin',this[_0x7a00('0x1e')]['bind'](this));ami['on'](_0x7a00('0x1f'),this['syncQueueCallerAbandon'][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x20'),this[_0x7a00('0x21')][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x22'),this['syncAgentComplete'][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x23'),this[_0x7a00('0x24')][_0x7a00('0x18')](this));ami['on']('varset',this['syncVarSet'][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x25'),this['syncHangup'][_0x7a00('0x18')](this));ami['on']('fullybooted',this[_0x7a00('0x26')][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x27'),this[_0x7a00('0x28')][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x29'),this[_0x7a00('0x2a')]['bind'](this));ami['on'](_0x7a00('0x2b'),this['syncAttendedTransfer'][_0x7a00('0x18')](this));ami['on'](_0x7a00('0x2c'),this['syncBlindTransfer'][_0x7a00('0x18')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x30b2b5){if(!_['isEmpty'](_0x30b2b5)){for(var _0x2e858f in _0x30b2b5){if(_0x30b2b5['hasOwnProperty'](_0x2e858f)){delete _0x30b2b5[_0x2e858f];}}}}function clearCampaigns(_0x537dc1){if(!_[_0x7a00('0x2d')](_0x537dc1)){for(var _0x49c74a in _0x537dc1){if(_0x537dc1[_0x7a00('0x2e')](_0x49c74a)){_0x537dc1[_0x49c74a][_0x7a00('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x500335){if(!_['isEmpty'](_0x500335)){for(var _0x96eba5 in _0x500335){if(_0x500335[_0x7a00('0x2e')](_0x96eba5)){_0x500335[_0x96eba5][_0x7a00('0x2f')]=0x0;_0x500335[_0x96eba5][_0x7a00('0x30')]=0x0;_0x500335[_0x96eba5][_0x7a00('0x31')]=0x0;_0x500335[_0x96eba5][_0x7a00('0x32')]=0x0;_0x500335[_0x96eba5][_0x7a00('0x33')]=!![];}}}}function clearAgentBooked(_0x22f8ab){if(!_[_0x7a00('0x2d')](_0x22f8ab)){for(var _0x28ce6d in _0x22f8ab){if(_0x22f8ab[_0x7a00('0x2e')](_0x28ce6d)){_0x22f8ab[_0x28ce6d]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport['prototype'][_0x7a00('0x34')]=function(){var _0x304f56=this;for(var _0x3854d0 in this['channels']){if(this['channels']['hasOwnProperty'](_0x3854d0)&&!this[_0x7a00('0x11')][_0x3854d0][_0x7a00('0x35')]){this[_0x7a00('0xf')][_0x7a00('0xd')](function(){if(!_[_0x7a00('0x36')](_0x304f56[_0x7a00('0x11')][_0x3854d0])){return ami[_0x7a00('0x37')]({'action':_0x7a00('0x38'),'channel':_0x304f56['channels'][_0x3854d0][_0x7a00('0x39')]})[_0x7a00('0x3a')](function(_0x3caf16){if(_0x3caf16[_0x7a00('0x3b')]===_0x7a00('0x3c')){setTimeout(function(){if(_0x304f56[_0x7a00('0x11')][_0x3854d0]){delete _0x304f56['channels'][_0x3854d0];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x3854d0,util['inspect'](_0x3caf16,{'showHidden':![],'depth':null}));}if(_0x304f56[_0x7a00('0x10')][_0x3854d0]){delete _0x304f56[_0x7a00('0x10')][_0x3854d0];logger[_0x7a00('0x3d')]('[%s][voiceQueueReport][checkQueueReport]',_0x3854d0,util['inspect'](_0x3caf16,{'showHidden':![],'depth':null}));}if(_0x304f56[_0x7a00('0x3e')][_0x3854d0]){delete _0x304f56[_0x7a00('0x3e')][_0x3854d0];logger[_0x7a00('0x3d')](_0x7a00('0x3f'),_0x3854d0,util[_0x7a00('0x40')](_0x3caf16,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x26')]=function(){logger[_0x7a00('0x3d')](_0x7a00('0x41'));clearChannels(this['channels']);this[_0x7a00('0x42')](this['queueReports']);clearAgentBooked(this[_0x7a00('0x43')]);clearVoiceQueues(this[_0x7a00('0x13')]);clearCampaigns(this[_0x7a00('0x14')]);this['summary']=initializeSummary();};VoiceQueueReport['prototype'][_0x7a00('0x42')]=function(_0x1cff18){var _0x4308ee=this;if(!_['isEmpty'](_0x1cff18)){for(var _0x5634dc in _0x1cff18){if(_0x1cff18[_0x7a00('0x2e')](_0x5634dc)){_0x4308ee['emitVoiceQueueChannelRemove'](_0x1cff18[_0x5634dc],_0x7a00('0x44'));delete _0x1cff18[_0x5634dc];}}}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x45')]=function(_0xb177f5,_0x59340a,_0x336831){io['to'](_0xb177f5)['emit'](_0x59340a,_0x336831);};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x46')]=function(_0x573df7,_0x246d7d){logger['debug'](_0x7a00('0x47')+_0x246d7d+_0x7a00('0x48'),_0x573df7[_0x7a00('0x49')],util['inspect'](_0x573df7,{'showHidden':![],'depth':null}));this[_0x7a00('0x45')](util['format']('voice:queue:%s',_0x573df7[_0x7a00('0x4a')]),_0x7a00('0x4b'),_0x573df7);io[_0x7a00('0x45')](_0x7a00('0x4c'),_0x573df7);};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x4d')]=function(_0x321ca9,_0x89a14d){logger[_0x7a00('0x4e')](_0x7a00('0x47')+_0x89a14d+_0x7a00('0x4f'),_0x321ca9[_0x7a00('0x49')],util['inspect'](_0x321ca9,{'showHidden':![],'depth':null}));if(_0x321ca9[_0x7a00('0x50')]===_0x7a00('0x51')){return;}this['emit'](util[_0x7a00('0x52')](_0x7a00('0x53'),_0x321ca9[_0x7a00('0x4a')]),_0x7a00('0x54'),_0x321ca9);io['emit'](_0x7a00('0x55'),_0x321ca9);};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x56')]=function(_0x29852f){if(_0x29852f[_0x7a00('0x57')]===_0x7a00('0x58')){logger[_0x7a00('0x4e')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x29852f,{'showHidden':![],'depth':null}));this['emit'](util[_0x7a00('0x52')](_0x7a00('0x53'),_0x29852f[_0x7a00('0x59')]),_0x7a00('0x5a'),_0x29852f);}};VoiceQueueReport['prototype'][_0x7a00('0x5b')]=function(_0x3171b4){return _0x3171b4!==null&&!_['isUndefined'](_0x3171b4);};VoiceQueueReport['prototype'][_0x7a00('0x5c')]=function(){var _0x5efb87=this;setInterval(function(){_0x5efb87[_0x7a00('0x34')]();ami[_0x7a00('0x37')]({'action':_0x7a00('0x5d')})[_0x7a00('0x3a')](function(_0x4b7b3a){logger[_0x7a00('0x3d')](_0x7a00('0x5e'),util[_0x7a00('0x40')](_0x4b7b3a,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x5f')]=function(){var _0x67dc35=this;setInterval(function(){if(!_0x67dc35[_0x7a00('0x15')]['isRunning']){return ami[_0x7a00('0x37')]({'action':_0x7a00('0x16')})[_0x7a00('0x60')](function(_0x464821){_0x67dc35['summary']['id']=_0x464821[_0x7a00('0x61')];_0x67dc35[_0x7a00('0x15')][_0x7a00('0x62')]=!![];_0x67dc35[_0x7a00('0x15')][_0x7a00('0x63')][_0x464821[_0x7a00('0x61')]]={};})['catch'](function(_0x5b1f56){logger[_0x7a00('0x3d')](_0x7a00('0x64'),util[_0x7a00('0x40')](_0x5b1f56,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x65')]=function(_0x99b4ca,_0x16e7af){var _0x575f2f=this[_0x7a00('0x15')][_0x7a00('0x5d')][_0x99b4ca['name']][_0x7a00('0x66')];var _0x687b77=new VoiceQueueSummary(_0x99b4ca);return _0x687b77[_0x7a00('0x67')](_0x16e7af[_0x7a00('0x43')],this['agents'],_0x575f2f,this[_0x7a00('0x68')][_0x7a00('0x11')]);};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x69')]=function(_0x2bb1b9,_0x4f0095){var _0x409f23=this['createQueueSummaryReport'](_0x2bb1b9,_0x4f0095);var _0x1714f8=![];_0x1714f8=_0x409f23['compareToInboundQueue'](_0x2bb1b9);if(_0x1714f8){Object[_0x7a00('0x6a')](_0x2bb1b9,_0x409f23);this[_0x7a00('0x68')][_0x7a00('0x13')][_0x2bb1b9['name']]=_0x2bb1b9;this[_0x7a00('0x56')](_0x409f23);}};VoiceQueueReport[_0x7a00('0xc')]['syncQueueStatusComplete']=function(_0x474e96){var _0x12245e=null;var _0x13598e=this[_0x7a00('0x15')]['id'];if(this['summary'][_0x7a00('0x63')][_0x13598e]){_0x12245e=this['summary'][_0x7a00('0x63')][_0x13598e][_0x474e96[_0x7a00('0x61')]];}if(!_0x12245e){this['summary']=initializeSummary();return;}var _0x4349cb=this['voiceQueues'][_0x12245e['queue']];if(_0x4349cb[_0x7a00('0x57')]===_0x7a00('0x58')){this[_0x7a00('0x69')](_0x4349cb,_0x12245e);}else if(_0x4349cb[_0x7a00('0x57')]===_0x7a00('0x6b')){var _0xaaaf=this['createQueueSummaryReport'](_0x4349cb,_0x12245e);ami[_0x7a00('0x45')](_0x7a00('0x6c'),_0xaaaf);}this[_0x7a00('0x15')][_0x7a00('0x6d')]-=0x1;var _0x1a05e0=this[_0x7a00('0x15')]['statusRequests']>0x0?!![]:![];if(!_0x1a05e0){return this['syncQueueSummaryComplete'](this[_0x7a00('0x15')][_0x7a00('0x6e')]);}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x1c')]=function(_0x100e45){var _0x476620=this['summary']['id'];if(this[_0x7a00('0x15')][_0x7a00('0x63')][_0x476620]&&this['summary'][_0x7a00('0x63')][_0x476620][_0x100e45[_0x7a00('0x61')]]){this[_0x7a00('0x15')][_0x7a00('0x63')][_0x476620][_0x100e45[_0x7a00('0x61')]][_0x7a00('0x43')]['push'](_0x100e45);}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x17')]=function(_0x2be616){var _0x5dcc98=this;try{if(this[_0x7a00('0x5b')](_0x2be616)&&this['isNotNull'](_0x2be616[_0x7a00('0x4a')])){logger[_0x7a00('0x4e')](_0x7a00('0x6f'),util['inspect'](_0x2be616,{'showHidden':![],'depth':null}));var _0x55cf7f=this[_0x7a00('0x13')][_0x2be616[_0x7a00('0x4a')]];if(_0x55cf7f){logger[_0x7a00('0x70')](_0x7a00('0x71'),_0x55cf7f[_0x7a00('0x59')]);this['summary'][_0x7a00('0x5d')][_0x55cf7f[_0x7a00('0x59')]]={'summaryEvent':_0x2be616};this[_0x7a00('0x15')][_0x7a00('0x6d')]+=0x1;return ami[_0x7a00('0x37')]({'action':_0x7a00('0x63'),'queue':_0x55cf7f[_0x7a00('0x59')]})['then'](function(_0x44d248){if(!_0x5dcc98[_0x7a00('0x15')][_0x7a00('0x63')][_0x2be616[_0x7a00('0x61')]]){_0x5dcc98['summary'][_0x7a00('0x63')][_0x2be616[_0x7a00('0x61')]]={};}_0x5dcc98['summary'][_0x7a00('0x63')][_0x2be616[_0x7a00('0x61')]][_0x44d248[_0x7a00('0x61')]]={'queue':_0x55cf7f[_0x7a00('0x59')],'agents':[]};})['catch'](function(_0x382a15){throw _0x382a15;});}}}catch(_0xff8083){logger[_0x7a00('0x3d')](_0x7a00('0x64'),util[_0x7a00('0x40')](_0xff8083,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x1a')]=function(_0x1dd6a8){if(this[_0x7a00('0x15')][_0x7a00('0x6d')]>0x0){this[_0x7a00('0x15')]['completeEvent']=_0x1dd6a8;return;}logger[_0x7a00('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x7a00('0x40')](_0x1dd6a8,{'showHidden':![],'depth':null}));this[_0x7a00('0x15')]=initializeSummary();ami[_0x7a00('0x45')](_0x7a00('0x72'),{});};VoiceQueueReport['prototype'][_0x7a00('0x1e')]=function(_0x1f5c13){try{if(this[_0x7a00('0x5b')](_0x1f5c13)){logger['debug'](_0x7a00('0x73'),_0x1f5c13[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x1f5c13,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7a00('0x10')][_0x1f5c13[_0x7a00('0x49')]])){this[_0x7a00('0x10')][_0x1f5c13[_0x7a00('0x49')]]=[];}if(_[_0x7a00('0x74')](this[_0x7a00('0x11')][_0x1f5c13[_0x7a00('0x49')]])){this[_0x7a00('0x11')][_0x1f5c13['uniqueid']]={};}var _0x5c4dc5=new QueueReport();_0x5c4dc5[_0x7a00('0x4a')]=_0x1f5c13[_0x7a00('0x4a')];_0x5c4dc5['type']=this[_0x7a00('0x13')][_0x5c4dc5[_0x7a00('0x4a')]]&&this[_0x7a00('0x13')][_0x5c4dc5[_0x7a00('0x4a')]][_0x7a00('0x57')]?this[_0x7a00('0x13')][_0x5c4dc5[_0x7a00('0x4a')]][_0x7a00('0x57')]||'inbound':_0x7a00('0x58');_0x5c4dc5[_0x7a00('0x75')]=moment()['format'](_0x7a00('0x76'));_0x5c4dc5[_0x7a00('0x77')]=_0x1f5c13['position'];_0x5c4dc5[_0x7a00('0x78')]=_0x1f5c13[_0x7a00('0x78')];_0x5c4dc5[_0x7a00('0x49')]=_0x1f5c13[_0x7a00('0x49')];_0x5c4dc5['routealias']=this['channels'][_0x1f5c13[_0x7a00('0x49')]][_0x7a00('0x79')];logger[_0x7a00('0x70')](_0x7a00('0x7a'),_0x5c4dc5['queue'],_0x5c4dc5['type']);_[_0x7a00('0x7b')](_0x5c4dc5,_[_0x7a00('0x7c')](_0x1f5c13,_['keys'](_0x5c4dc5)));this[_0x7a00('0x10')][_0x1f5c13[_0x7a00('0x49')]]['push'](_0x5c4dc5);this['channels'][_0x1f5c13['uniqueid']]=_0x5c4dc5;this[_0x7a00('0x46')](_0x5c4dc5,_0x7a00('0x7d'));}}catch(_0x56b2bb){logger[_0x7a00('0x3d')](_0x7a00('0x73'),_0x1f5c13['uniqueid'],util[_0x7a00('0x40')](_0x56b2bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x7e')]=function(_0xbd895e){try{if(this['isNotNull'](_0xbd895e)){logger[_0x7a00('0x4e')](_0x7a00('0x7f'),_0xbd895e[_0x7a00('0x49')],util[_0x7a00('0x40')](_0xbd895e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xbd895e['uniqueid']]){var _0x4e4a44=_[_0x7a00('0x80')](this['queueReports'][_0xbd895e[_0x7a00('0x49')]]);_0x4e4a44[_0x7a00('0x81')]=![];_0x4e4a44[_0x7a00('0x82')]=null;_0x4e4a44[_0x7a00('0x83')]=_0xbd895e[_0x7a00('0x83')];_0x4e4a44[_0x7a00('0x84')]=_0xbd895e['originalposition'];_0x4e4a44['queuecallerabandon']=!![];_0x4e4a44[_0x7a00('0x85')]=moment()[_0x7a00('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e4a44[_0x7a00('0x50')]=_0x7a00('0x86');_0x4e4a44[_0x7a00('0x87')]=null;logger[_0x7a00('0x70')](_0x7a00('0x88'),_0x4e4a44[_0x7a00('0x4a')],_0x4e4a44[_0x7a00('0x57')]);this[_0x7a00('0x11')][_0xbd895e[_0x7a00('0x49')]]=_0x4e4a44;this[_0x7a00('0x4d')](_0x4e4a44,_0x7a00('0x1f'));}}}catch(_0x5c1c4c){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0xbd895e['uniqueid'],util['inspect'](_0x5c1c4c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5f54b0){try{if(this[_0x7a00('0x5b')](_0x5f54b0)){logger[_0x7a00('0x4e')](_0x7a00('0x89'),_0x5f54b0[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x5f54b0,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x5f54b0[_0x7a00('0x49')]]){var _0x16e427=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x5f54b0[_0x7a00('0x49')]]);_0x16e427[_0x7a00('0x8a')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x16e427[_0x7a00('0x8b')]=_0x5f54b0[_0x7a00('0x8b')];_0x16e427['connectedlinename']=_0x5f54b0['connectedlinename'];logger[_0x7a00('0x70')](_0x7a00('0x8c'),_0x16e427[_0x7a00('0x4a')],_0x16e427[_0x7a00('0x57')],_0x5f54b0['connectedlinenum'],_0x5f54b0[_0x7a00('0x8d')]);this[_0x7a00('0x11')][_0x5f54b0['uniqueid']]=_0x16e427;this[_0x7a00('0x46')](_0x16e427,'queuecallerleave');}}}catch(_0x34f234){logger['error'](_0x7a00('0x89'),_0x5f54b0['uniqueid'],util['inspect'](_0x34f234,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x24')]=function(_0x30b380){try{if(this[_0x7a00('0x5b')](_0x30b380)){logger[_0x7a00('0x4e')](_0x7a00('0x8e'),_0x30b380[_0x7a00('0x49')],util['inspect'](_0x30b380,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x30b380[_0x7a00('0x49')]]){var _0x5a9d61=_[_0x7a00('0x80')](this['queueReports'][_0x30b380[_0x7a00('0x49')]]);_0x5a9d61['queuecallercomplete']=!![];_0x5a9d61[_0x7a00('0x50')]=_0x7a00('0x8f');logger['info'](_0x7a00('0x90'),_0x5a9d61[_0x7a00('0x4a')],_0x5a9d61[_0x7a00('0x57')]);}}}catch(_0x4ba577){logger['error'](_0x7a00('0x8e'),_0x30b380['uniqueid'],util[_0x7a00('0x40')](_0x4ba577,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x91')]=function(_0x26d953){try{if(this['isNotNull'](_0x26d953)){logger[_0x7a00('0x4e')](_0x7a00('0x92'),_0x26d953[_0x7a00('0x49')],util['inspect'](_0x26d953,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x26d953[_0x7a00('0x49')]]){var _0x21ba18=_['last'](this['queueReports'][_0x26d953[_0x7a00('0x49')]]);_0x21ba18['queuecallerabandon']=![];_0x21ba18[_0x7a00('0x85')]=null;_0x21ba18[_0x7a00('0x93')]=!![];_0x21ba18[_0x7a00('0x87')]=_0x26d953['membername'];_0x21ba18[_0x7a00('0x83')]=_0x26d953['holdtime'];_0x21ba18[_0x7a00('0x81')]=!![];_0x21ba18[_0x7a00('0x94')]=![];_0x21ba18[_0x7a00('0x95')]=null;if(!_0x21ba18[_0x7a00('0x96')]){if(_0x26d953['reason']==_0x7a00('0x96')){_0x21ba18[_0x7a00('0x50')]=_0x7a00('0x97');logger[_0x7a00('0x70')](_0x7a00('0x98'),_0x21ba18[_0x7a00('0x4a')],_0x21ba18[_0x7a00('0x57')]);}else{if(_[_0x7a00('0x99')](_0x26d953[_0x7a00('0x39')][_0x7a00('0x9a')](),_0x7a00('0x9b'))){if(this[_0x7a00('0x10')][_0x26d953[_0x7a00('0x9c')]]){var _0xb74566=_['last'](this['queueReports'][_0x26d953[_0x7a00('0x9c')]]);_0xb74566[_0x7a00('0x81')]=![];_0xb74566[_0x7a00('0x94')]=!![];_0xb74566[_0x7a00('0x95')]=moment(_0x21ba18[_0x7a00('0x75')])['add'](_0x26d953[_0x7a00('0x83')],_0x7a00('0x9d'))['format'](_0x7a00('0x76'));_0xb74566[_0x7a00('0x50')]=_0x7a00('0x9e');_0xb74566[_0x7a00('0x96')]=!![];_0xb74566['transfertype']=_0x7a00('0x9f');_0xb74566[_0x7a00('0xa0')]=_0x26d953[_0x7a00('0xa1')];_0xb74566['transferuniqueid']=_0x26d953['uniqueid'];logger[_0x7a00('0x70')](_0x7a00('0xa2'),_0xb74566[_0x7a00('0x4a')],_0xb74566[_0x7a00('0x57')]);var _0x59d373=this['queueReports'][_0x26d953['linkedid']];this['queueReports'][_0x26d953['linkedid']]=this['queueReports'][_0x26d953[_0x7a00('0x49')]];this[_0x7a00('0x10')][_0x26d953[_0x7a00('0x49')]]=_0x59d373;}}else{_0x21ba18[_0x7a00('0x50')]=_0x7a00('0xa3')+_0x26d953[_0x7a00('0xa4')][_0x7a00('0xa5')]();logger[_0x7a00('0x70')](_0x7a00('0xa6'),_0x21ba18[_0x7a00('0x4a')],_0x21ba18[_0x7a00('0x57')],_0x21ba18[_0x7a00('0x50')]);}}}this[_0x7a00('0x11')][_0x26d953[_0x7a00('0x49')]]=_0x21ba18;this['emitVoiceQueueChannelRemove'](_0x21ba18,_0x7a00('0x22'));}}}catch(_0x166eff){logger[_0x7a00('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x26d953[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x166eff,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0xa7')]=function(_0x168351){try{if(this[_0x7a00('0x5b')](_0x168351)){logger[_0x7a00('0x4e')](_0x7a00('0xa8'),_0x168351[_0x7a00('0x49')],util['inspect'](_0x168351,{'showHidden':![],'depth':null}));this[_0x7a00('0xa9')](_0x168351[_0x7a00('0x49')],_[_0x7a00('0xaa')](_0x168351['variable'])[0x0],_0x168351[_0x7a00('0xab')]);if(this[_0x7a00('0x10')][_0x168351['uniqueid']]){var _0x3c9276=_['last'](this['queueReports'][_0x168351[_0x7a00('0x49')]]);if(_0x3c9276){if(this[_0x7a00('0x5b')](_0x168351[_0x7a00('0xac')])&&this[_0x7a00('0x5b')](_0x168351[_0x7a00('0xac')][_0x7a00('0x63')])){switch(_0x168351[_0x7a00('0xab')]){case _0x7a00('0xad'):_0x3c9276['queuecallerexit']=![];_0x3c9276[_0x7a00('0x95')]=null;break;case _0x7a00('0xae'):_0x3c9276['lastevent']='timeout';_0x3c9276[_0x7a00('0x94')]=!![];_0x3c9276[_0x7a00('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3c9276['queuecallerleaveAt']=moment()[_0x7a00('0x52')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7a00('0x4e')](_0x7a00('0xaf'),_0x168351[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x3c9276,{'showHidden':![],'depth':null}));ami[_0x7a00('0x45')](_0x7a00('0xb0'),_0x3c9276);break;default:_0x3c9276['queuecallerexit']=!![];_0x3c9276[_0x7a00('0x95')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x3c9276[_0x7a00('0x8a')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));}_0x3c9276['queuecallerabandon']=![];_0x3c9276[_0x7a00('0x85')]=null;_0x3c9276[_0x7a00('0x50')]=_0x168351[_0x7a00('0xab')];this['channels'][_0x168351['uniqueid']]=_0x3c9276;this[_0x7a00('0x4d')](_0x3c9276,_0x7a00('0xb1'));}else if(this[_0x7a00('0x5b')](_0x168351['variable'])&&this[_0x7a00('0x5b')](_0x168351[_0x7a00('0xac')][_0x7a00('0xb2')])){if(!_0x3c9276[_0x7a00('0x1f')]){_0x3c9276[_0x7a00('0x94')]=!![];_0x3c9276[_0x7a00('0x95')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x3c9276[_0x7a00('0x50')]=_0x7a00('0xb3');_0x3c9276[_0x7a00('0x8a')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));this[_0x7a00('0x11')][_0x168351[_0x7a00('0x49')]]=_0x3c9276;}}logger['info'](_0x7a00('0xb4'),_0x168351[_0x7a00('0x49')],_0x3c9276['queue'],_0x3c9276[_0x7a00('0x57')],_[_0x7a00('0xaa')](_0x168351[_0x7a00('0xac')])[0x0],_0x168351['value']);_0x3c9276[_0x7a00('0x3e')]=this[_0x7a00('0x3e')][_0x168351['uniqueid']];}}}}catch(_0x31ae83){logger['error'](_0x7a00('0xa8'),_0x168351[_0x7a00('0x49')],util['inspect'](_0x31ae83,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x259249,_0x4c8ce8,_0x40e01a){var _0x3b0d74=['rtpaudioqos',_0x7a00('0xb5'),_0x7a00('0xb6'),'rtpaudioqosjitterbridged',_0x7a00('0xb7'),_0x7a00('0xb8'),_0x7a00('0xb9'),_0x7a00('0xba'),_0x7a00('0xbb'),'sipuri','bridgepeer','bridgepvtcallid',_0x7a00('0xbc'),_0x7a00('0xbd'),'memberinterface',_0x7a00('0xbe'),_0x7a00('0xbf'),'memberpenalty',_0x7a00('0xc0')];if(!_[_0x7a00('0x36')](_0x4c8ce8)&&!_[_0x7a00('0xc1')](_0x3b0d74,_0x4c8ce8)){if(_['isUndefined'](this['variables'][_0x259249])){this[_0x7a00('0x3e')][_0x259249]={};}this[_0x7a00('0x3e')][_0x259249][_0x4c8ce8]=_0x40e01a;}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0xc2')]=function(_0x514e82,_0xd43160,_0x7ae4c8){var _0x37c2d5={};for(var _0x314d48=0x0;_0x314d48<this['queueReports'][_0x514e82][_0x7a00('0xc3')];_0x314d48+=0x1){_0x37c2d5=this[_0x7a00('0x10')][_0x514e82][_0x314d48];if(this['voiceQueues'][_0x37c2d5[_0x7a00('0x4a')]]){if(_0x37c2d5[_0x7a00('0x94')]&&_0x37c2d5[_0x7a00('0x96')]!=!![]){this[_0x7a00('0x13')][_0x37c2d5['queue']][_0x7a00('0xc4')]+=0x1;}if(_0x37c2d5[_0x7a00('0x1f')]){this[_0x7a00('0x13')][_0x37c2d5[_0x7a00('0x4a')]][_0x7a00('0xc5')]+=0x1;}this[_0x7a00('0x13')][_0x37c2d5['queue']][_0x7a00('0xc6')]+=moment(_0x37c2d5[_0x7a00('0x8a')])['diff'](_0x37c2d5[_0x7a00('0x75')],'seconds')||0x0;if(_0x314d48===this[_0x7a00('0x10')][_0x514e82][_0x7a00('0xc3')]-0x1){this[_0x7a00('0x13')][_0x37c2d5['queue']][_0x7a00('0xc7')]+=moment()[_0x7a00('0xc8')](0x0)[_0x7a00('0xc9')](_0x37c2d5[_0x7a00('0x75')],_0x7a00('0x9d'));this['voiceQueues'][_0x37c2d5[_0x7a00('0x4a')]]['total']+=0x1;if(_0x37c2d5[_0x7a00('0x81')]){this[_0x7a00('0x13')][_0x37c2d5['queue']][_0x7a00('0xca')]+=0x1;this[_0x7a00('0x13')][_0x37c2d5[_0x7a00('0x4a')]][_0x7a00('0xcb')]+=moment()['milliseconds'](0x0)[_0x7a00('0xc9')](_0x37c2d5[_0x7a00('0x8a')],_0x7a00('0x9d'));_0x37c2d5[_0x7a00('0x82')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));_0x37c2d5['queuecallerexit']=![];_0x37c2d5[_0x7a00('0x95')]=null;}if(_0x37c2d5[_0x7a00('0x94')]&&_0x37c2d5['transfer']!=!![]){_0x37c2d5['lastevent']=_0x7a00('0xc4');logger[_0x7a00('0x4e')](_0x7a00('0xcc'),_0x514e82,util[_0x7a00('0x40')](_0x37c2d5,{'showHidden':![],'depth':null}));ami[_0x7a00('0x45')](_0x7a00('0xcd'),_0x37c2d5);}if(_0x37c2d5[_0x7a00('0x1f')]){_0x37c2d5[_0x7a00('0xce')]=_0x7a00('0xc5');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x514e82,util[_0x7a00('0x40')](_0x37c2d5,{'showHidden':![],'depth':null}));ami[_0x7a00('0x45')](_0x7a00('0xcf'),_0x37c2d5);}}else{this[_0x7a00('0x13')][_0x37c2d5[_0x7a00('0x4a')]][_0x7a00('0xc7')]+=this[_0x7a00('0x13')][_0x37c2d5[_0x7a00('0x4a')]][_0x7a00('0xc6')];}logger[_0x7a00('0x70')](_0x7a00('0xd0'),_0x514e82,_0x37c2d5[_0x7a00('0x4a')],_0x37c2d5[_0x7a00('0x57')],_0xd43160);if(_0x7ae4c8&&_0x37c2d5[_0x7a00('0x50')]===_0x7a00('0x51')){_0x37c2d5['queuecallerexitreason']='COMPLETEDBYAGENT';}this[_0x7a00('0x11')][_0x514e82]=_0x37c2d5;this[_0x7a00('0x4d')](_0x37c2d5,'hangup');}}logger[_0x7a00('0x4e')](_0x7a00('0xd1'),_0x514e82,util['inspect'](this['queueReports'][_0x514e82],{'showHidden':![],'depth':null}));ami[_0x7a00('0x45')]('custom:voiceQueueReport',this[_0x7a00('0x10')][_0x514e82]);if(_0x37c2d5['queuecallerexitreason']===_0x7a00('0x51')){return;}if(_0x37c2d5[_0x7a00('0x94')]||_0x37c2d5[_0x7a00('0x1f')]||_0x37c2d5['queuecallercomplete']){delete this[_0x7a00('0x10')][_0x514e82];delete this[_0x7a00('0x11')][_0x514e82];if(this[_0x7a00('0x3e')][_0x514e82]){delete this[_0x7a00('0x3e')][_0x514e82];}}};VoiceQueueReport['prototype'][_0x7a00('0xd2')]=function(_0x542df9){try{if(this[_0x7a00('0x5b')](_0x542df9)){logger[_0x7a00('0x4e')](_0x7a00('0xd3'),_0x542df9[_0x7a00('0x49')],util['inspect'](_0x542df9,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x542df9['uniqueid']]){return this[_0x7a00('0xc2')](_0x542df9['uniqueid'],_0x542df9[_0x7a00('0xd4')],![]);}if(this[_0x7a00('0x10')][_0x542df9[_0x7a00('0x9c')]]){if(_0x542df9[_0x7a00('0xd5')]==='21'){return;}return this[_0x7a00('0xc2')](_0x542df9[_0x7a00('0x9c')],_0x542df9[_0x7a00('0xd4')],!![]);}var _0x56bfbc=Object[_0x7a00('0xaa')](this['queueReports']);for(var _0x15ea24=0x0;_0x15ea24<_0x56bfbc['length'];_0x15ea24++){var _0x44445f=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x56bfbc[_0x15ea24]]);if(_0x44445f&&_0x44445f[_0x7a00('0xd6')]===_0x542df9['uniqueid']){return this[_0x7a00('0xc2')](_0x44445f['uniqueid'],_0x542df9[_0x7a00('0xd4')],!![]);}}}}catch(_0x187a27){logger['error'](_0x7a00('0xd3'),_0x542df9[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x187a27,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7a00('0xd7')]=function(_0x4adf70){try{if(this[_0x7a00('0x5b')](_0x4adf70)){logger['debug'](_0x7a00('0xd8'),_0x4adf70[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x4adf70,{'showHidden':![],'depth':null}));var _0x539a9b;var _0x3e54e4;var _0x59ad00;if(this['queueReports'][_0x4adf70[_0x7a00('0xd9')]]){_0x539a9b=_[_0x7a00('0x80')](this['queueReports'][_0x4adf70[_0x7a00('0xd9')]]);_0x539a9b[_0x7a00('0xa0')]=_0x4adf70[_0x7a00('0xda')];_0x539a9b[_0x7a00('0xdb')]=_0x4adf70[_0x7a00('0xdc')];_0x539a9b['queuecallerexitreason']=_0x7a00('0x51');_0x539a9b[_0x7a00('0x96')]=!![];_0x539a9b['transfertype']=_0x7a00('0xdd');if(this[_0x7a00('0x10')][_0x4adf70['secondtransfereruniqueid']]){_0x59ad00=this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xdc')]];this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xdc')]]=this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xd9')]];this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xd9')]]=_0x59ad00;_0x3e54e4=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x4adf70['transfereeuniqueid']]);_0x3e54e4[_0x7a00('0x35')]=!![];}logger[_0x7a00('0x70')](_0x7a00('0xde'),_0x4adf70['uniqueid'],_0x539a9b[_0x7a00('0x4a')],_0x539a9b[_0x7a00('0x57')],_0x539a9b[_0x7a00('0xa0')],_0x539a9b[_0x7a00('0xdb')]);}else if(this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xdf')]]){_0x539a9b=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x4adf70['transfertargetuniqueid']]);_0x539a9b['transferexten']=_0x4adf70[_0x7a00('0xe0')];_0x539a9b[_0x7a00('0xdb')]=_0x4adf70[_0x7a00('0xe1')];_0x539a9b['queuecallerexitreason']=_0x7a00('0x51');_0x539a9b[_0x7a00('0x96')]=!![];_0x539a9b[_0x7a00('0xe2')]=_0x7a00('0xdd');if(this[_0x7a00('0x10')][_0x4adf70['origtransfereruniqueid']]){_0x59ad00=this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xe1')]];this['queueReports'][_0x4adf70[_0x7a00('0xe1')]]=this[_0x7a00('0x10')][_0x4adf70['transfertargetuniqueid']];this[_0x7a00('0x10')][_0x4adf70['transfertargetuniqueid']]=_0x59ad00;_0x3e54e4=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xdf')]]);_0x3e54e4[_0x7a00('0x35')]=!![];}logger[_0x7a00('0x70')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4adf70[_0x7a00('0x49')],_0x539a9b[_0x7a00('0x4a')],_0x539a9b[_0x7a00('0x57')],_0x539a9b[_0x7a00('0xa0')],_0x539a9b[_0x7a00('0xdb')]);}else if(this['queueReports'][_0x4adf70['origtransfereruniqueid']]){_0x539a9b=_[_0x7a00('0x80')](this['queueReports'][_0x4adf70[_0x7a00('0xe1')]]);_0x539a9b[_0x7a00('0xa0')]=_0x4adf70[_0x7a00('0xe0')];_0x539a9b[_0x7a00('0xdb')]=_0x4adf70[_0x7a00('0xe1')];_0x539a9b['queuecallerexitreason']=_0x7a00('0x51');_0x539a9b[_0x7a00('0x96')]=!![];_0x539a9b['transfertype']='ATTENDED';_0x539a9b['switch']=!![];_0x539a9b[_0x7a00('0xd6')]=_0x4adf70[_0x7a00('0xd9')];}else if(this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xdc')]]){_0x539a9b=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x4adf70[_0x7a00('0xdc')]]);_0x539a9b['transferexten']=_0x4adf70[_0x7a00('0xda')];_0x539a9b[_0x7a00('0xdb')]=_0x4adf70[_0x7a00('0xdc')];_0x539a9b['queuecallerexitreason']=_0x7a00('0x51');_0x539a9b['transfer']=!![];_0x539a9b[_0x7a00('0xe2')]=_0x7a00('0xdd');_0x539a9b['switch']=!![];_0x539a9b[_0x7a00('0xd6')]=_0x4adf70['transfertargetuniqueid'];}}}catch(_0x1b26aa){logger['error'](_0x7a00('0xd8'),_0x4adf70[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x1b26aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')]['syncBlindTransfer']=function(_0x3afe54){try{if(this['isNotNull'](_0x3afe54)){logger[_0x7a00('0x4e')]('[%s][voiceQueueReport][blindtransfer]',_0x3afe54[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x3afe54,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x3afe54[_0x7a00('0xd9')]]){var _0xadd844=_[_0x7a00('0x80')](this[_0x7a00('0x10')][_0x3afe54[_0x7a00('0xd9')]]);_0xadd844['queuecallerexitreason']='BLINDTRANSFER';_0xadd844[_0x7a00('0x96')]=!![];_0xadd844[_0x7a00('0xe2')]='BLIND';_0xadd844[_0x7a00('0xa0')]=_0x3afe54[_0x7a00('0xe3')];_0xadd844[_0x7a00('0xdb')]=_0x3afe54[_0x7a00('0xd9')];logger[_0x7a00('0x70')](_0x7a00('0xe4'),_0x3afe54[_0x7a00('0x49')],_0xadd844[_0x7a00('0x4a')],_0xadd844[_0x7a00('0x57')],_0xadd844[_0x7a00('0xa0')],_0xadd844[_0x7a00('0xdb')]);this['syncHangup']({'event':_0x7a00('0xe5'),'uniqueid':_0x3afe54[_0x7a00('0xd9')],'context':_0x3afe54[_0x7a00('0xe6')],'channel':_0x3afe54['transfererchannel']});}}}catch(_0x5e05df){logger[_0x7a00('0x3d')](_0x7a00('0xe7'),_0x3afe54[_0x7a00('0x49')],util['inspect'](_0x5e05df,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x28')]=function(_0x1daa90){try{if(this[_0x7a00('0x5b')](_0x1daa90)){logger['debug'](_0x7a00('0xe8'),_0x1daa90[_0x7a00('0x49')],util['inspect'](_0x1daa90,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x1daa90['uniqueid']]){var _0x397973=_['last'](this[_0x7a00('0x10')][_0x1daa90[_0x7a00('0x49')]]);if(!_['isNil'](_0x397973[_0x7a00('0x8a')])){_0x397973[_0x7a00('0xe9')]=moment()[_0x7a00('0x52')](_0x7a00('0x76'));logger[_0x7a00('0x70')](_0x7a00('0xea'),_0x1daa90['uniqueid'],_0x397973[_0x7a00('0xe9')]);}}}}catch(_0x4d7e4a){logger[_0x7a00('0x3d')](_0x7a00('0xe8'),_0x1daa90[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x4d7e4a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')][_0x7a00('0x2a')]=function(_0x48f2cc){try{if(this[_0x7a00('0x5b')](_0x48f2cc)){logger['debug'](_0x7a00('0xeb'),_0x48f2cc[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x48f2cc,{'showHidden':![],'depth':null}));if(this[_0x7a00('0x10')][_0x48f2cc[_0x7a00('0x49')]]){var _0xdfaba7=_['last'](this['queueReports'][_0x48f2cc['uniqueid']]);if(!_[_0x7a00('0x36')](_0xdfaba7[_0x7a00('0xe9')])){_0xdfaba7['mohtime']+=moment()[_0x7a00('0xc8')](0x0)['diff'](_0xdfaba7[_0x7a00('0xe9')],'seconds');logger[_0x7a00('0x70')](_0x7a00('0xec'),_0x48f2cc[_0x7a00('0x49')],_0xdfaba7[_0x7a00('0xed')]);delete _0xdfaba7[_0x7a00('0xe9')];}}}}catch(_0x8b4425){logger[_0x7a00('0x3d')]('[%s][voiceQueueReport][musiconholdstop]',_0x48f2cc[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x8b4425,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7a00('0xc')]['syncNewExten']=function(_0x41dc99){try{if(this[_0x7a00('0x5b')](_0x41dc99)){logger[_0x7a00('0x4e')]('[%s][voiceQueueReport][newexten]\x20event:',_0x41dc99['uniqueid'],util[_0x7a00('0x40')](_0x41dc99,{'showHidden':![],'depth':null}));if(_0x41dc99[_0x7a00('0xee')][_0x7a00('0x9a')]()==='set'){_0x41dc99['applicationdata']=_0x41dc99[_0x7a00('0xef')]&&_0x41dc99[_0x7a00('0xef')]['startsWith'](_0x7a00('0xf0'))?_0x41dc99[_0x7a00('0xef')]:(_0x41dc99['appdata']||_0x41dc99['applicationdata'])[_0x7a00('0x9a')]();if(_[_0x7a00('0x99')](_0x41dc99[_0x7a00('0xf1')][_0x7a00('0x9a')](),'cdr(')){logger[_0x7a00('0x70')](_0x7a00('0xf2'),_0x41dc99[_0x7a00('0x49')],_0x41dc99[_0x7a00('0xee')],_0x41dc99[_0x7a00('0xf1')]);if(_[_0x7a00('0x74')](this[_0x7a00('0x11')][_0x41dc99['uniqueid']]))this[_0x7a00('0x11')][_0x41dc99['uniqueid']]={};var _0xc0c4b8=_0x41dc99['applicationdata'][_0x7a00('0xf3')]('=');var _0x31fd07=_0xc0c4b8[0x0][_0x7a00('0x9a')]()[_0x7a00('0xf4')](/cdr\((.*)\)/);if(_0x31fd07)this[_0x7a00('0x11')][_0x41dc99[_0x7a00('0x49')]][_0x31fd07[0x1]]=_0xc0c4b8[0x1];}}}}catch(_0x9d3583){logger[_0x7a00('0x3d')](_0x7a00('0xf5'),_0x41dc99[_0x7a00('0x49')],util[_0x7a00('0x40')](_0x9d3583,{'showHidden':![],'depth':null}));}};module[_0x7a00('0xf6')]=VoiceQueueReport;
\ No newline at end of file
+var _0x3d49=['queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','includes','unmanaged','abandoned','sumHoldTime','diff','length','sumDuration','milliseconds','total','answered','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncHangup','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','origtransfererexten','secondtransfererexten','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','match','moment','util','ioredis','../../../config/environment','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','tail','finally','sequence','queueReports','realtime','agents','channels','voiceQueues','campaigns','summary','variables','syncQueueSummary','bind','syncQueueSummaryComplete','queuemember','syncQueueMember','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','prototype','clearZombieChannels','switch','enqueue','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','queue',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','name','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','isRunning','queuesummary','then','queuestatus','actionid','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','compareToInboundQueue','assign','syncQueueStatusComplete','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername'];(function(_0x46ebcd,_0x23bec6){var _0x341a0b=function(_0xb894ff){while(--_0xb894ff){_0x46ebcd['push'](_0x46ebcd['shift']());}};_0x341a0b(++_0x23bec6);}(_0x3d49,0x151));var _0x93d4=function(_0x424bd3,_0x8760d8){_0x424bd3=_0x424bd3-0x0;var _0x1fdade=_0x3d49[_0x424bd3];return _0x1fdade;};'use strict';var _=require('lodash');var moment=require(_0x93d4('0x0'));var util=require(_0x93d4('0x1'));var Redis=require(_0x93d4('0x2'));var config=require(_0x93d4('0x3'));var logger=require('../../../config/logger')(_0x93d4('0x4'));var ami=require(_0x93d4('0x5'));var QueueReport=require(_0x93d4('0x6'));var VoiceQueueSummary=require(_0x93d4('0x7'));config[_0x93d4('0x8')]=_[_0x93d4('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x1eaf9f){this[_0x93d4('0xa')]=this[_0x93d4('0xa')]?this[_0x93d4('0xa')][_0x93d4('0xb')](_0x1eaf9f):_0x1eaf9f();};function VoiceQueueReport(_0x174c6d){this[_0x93d4('0xc')]=new Sequence();this[_0x93d4('0xd')]={};this[_0x93d4('0xe')]=_0x174c6d;this[_0x93d4('0xf')]=_0x174c6d[_0x93d4('0xf')];this[_0x93d4('0x10')]=_0x174c6d['queueChannels'];this[_0x93d4('0x11')]=_0x174c6d['voiceQueues'];this[_0x93d4('0x12')]=_0x174c6d[_0x93d4('0x12')];this[_0x93d4('0x13')]=initializeSummary();this[_0x93d4('0x14')]={};ami['on']('queuesummary',this[_0x93d4('0x15')][_0x93d4('0x16')](this));ami['on']('queuesummarycomplete',this[_0x93d4('0x17')][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x18'),this[_0x93d4('0x19')][_0x93d4('0x16')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x93d4('0x16')](this));ami['on']('queuecallerjoin',this[_0x93d4('0x1a')][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x1b'),this[_0x93d4('0x1c')][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x1d'),this['syncQueueCallerLeave'][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x1e'),this[_0x93d4('0x1f')]['bind'](this));ami['on'](_0x93d4('0x20'),this['syncAgentConnect'][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x21'),this[_0x93d4('0x22')][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x23'),this['syncHangup'][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x24'),this[_0x93d4('0x25')][_0x93d4('0x16')](this));ami['on'](_0x93d4('0x26'),this[_0x93d4('0x27')]['bind'](this));ami['on'](_0x93d4('0x28'),this[_0x93d4('0x29')][_0x93d4('0x16')](this));ami['on']('attendedtransfer',this[_0x93d4('0x2a')]['bind'](this));ami['on'](_0x93d4('0x2b'),this[_0x93d4('0x2c')]['bind'](this));this[_0x93d4('0x2d')]();this[_0x93d4('0x2e')]();}function clearChannels(_0x2294af){if(!_['isEmpty'](_0x2294af)){for(var _0x572c52 in _0x2294af){if(_0x2294af[_0x93d4('0x2f')](_0x572c52)){delete _0x2294af[_0x572c52];}}}}function clearCampaigns(_0x52a1ae){if(!_[_0x93d4('0x30')](_0x52a1ae)){for(var _0x12a9cb in _0x52a1ae){if(_0x52a1ae['hasOwnProperty'](_0x12a9cb)){_0x52a1ae[_0x12a9cb]['originated']=0x0;}}}}function clearVoiceQueues(_0x28379a){if(!_[_0x93d4('0x30')](_0x28379a)){for(var _0x8ed25e in _0x28379a){if(_0x28379a[_0x93d4('0x2f')](_0x8ed25e)){_0x28379a[_0x8ed25e][_0x93d4('0x31')]=0x0;_0x28379a[_0x8ed25e][_0x93d4('0x32')]=0x0;_0x28379a[_0x8ed25e][_0x93d4('0x33')]=0x0;_0x28379a[_0x8ed25e][_0x93d4('0x34')]=0x0;_0x28379a[_0x8ed25e][_0x93d4('0x35')]=!![];}}}}function clearAgentBooked(_0x57b7f6){if(!_[_0x93d4('0x30')](_0x57b7f6)){for(var _0x13c3f1 in _0x57b7f6){if(_0x57b7f6[_0x93d4('0x2f')](_0x13c3f1)){_0x57b7f6[_0x13c3f1]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x37')]=function(){var _0x3e11a5=this;for(var _0x3192ca in this[_0x93d4('0x10')]){if(this['channels'][_0x93d4('0x2f')](_0x3192ca)&&!this[_0x93d4('0x10')][_0x3192ca][_0x93d4('0x38')]){this['sequence'][_0x93d4('0x39')](function(){if(!_[_0x93d4('0x3a')](_0x3e11a5[_0x93d4('0x10')][_0x3192ca])){return ami[_0x93d4('0x3b')]({'action':_0x93d4('0x3c'),'channel':_0x3e11a5['channels'][_0x3192ca][_0x93d4('0x3d')]})[_0x93d4('0x3e')](function(_0x15f899){if(_0x15f899[_0x93d4('0x3f')]===_0x93d4('0x40')){setTimeout(function(){if(_0x3e11a5[_0x93d4('0x10')][_0x3192ca]){delete _0x3e11a5[_0x93d4('0x10')][_0x3192ca];logger[_0x93d4('0x41')](_0x93d4('0x42'),_0x3192ca,util[_0x93d4('0x43')](_0x15f899,{'showHidden':![],'depth':null}));}if(_0x3e11a5[_0x93d4('0xd')][_0x3192ca]){delete _0x3e11a5['queueReports'][_0x3192ca];logger[_0x93d4('0x41')]('[%s][voiceQueueReport][checkQueueReport]',_0x3192ca,util['inspect'](_0x15f899,{'showHidden':![],'depth':null}));}if(_0x3e11a5['variables'][_0x3192ca]){delete _0x3e11a5['variables'][_0x3192ca];logger[_0x93d4('0x41')](_0x93d4('0x44'),_0x3192ca,util[_0x93d4('0x43')](_0x15f899,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x25')]=function(){logger[_0x93d4('0x41')](_0x93d4('0x45'));clearChannels(this[_0x93d4('0x10')]);this['clearQueueReport'](this[_0x93d4('0xd')]);clearAgentBooked(this[_0x93d4('0xf')]);clearVoiceQueues(this[_0x93d4('0x11')]);clearCampaigns(this[_0x93d4('0x12')]);this[_0x93d4('0x13')]=initializeSummary();};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x46')]=function(_0x1c7e50){var _0xeaca44=this;if(!_[_0x93d4('0x30')](_0x1c7e50)){for(var _0x4ceb6a in _0x1c7e50){if(_0x1c7e50['hasOwnProperty'](_0x4ceb6a)){_0xeaca44[_0x93d4('0x47')](_0x1c7e50[_0x4ceb6a],_0x93d4('0x48'));delete _0x1c7e50[_0x4ceb6a];}}}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x49')]=function(_0x46f01d,_0x14de3e,_0x240d1a){io['to'](_0x46f01d)[_0x93d4('0x49')](_0x14de3e,_0x240d1a);};VoiceQueueReport['prototype'][_0x93d4('0x4a')]=function(_0x1fd63f,_0x41cf8d){logger[_0x93d4('0x4b')](_0x93d4('0x4c')+_0x41cf8d+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1fd63f[_0x93d4('0x4d')],util['inspect'](_0x1fd63f,{'showHidden':![],'depth':null}));this[_0x93d4('0x49')](util[_0x93d4('0x4e')](_0x93d4('0x4f'),_0x1fd63f[_0x93d4('0x50')]),'voice_queue_channel:save',_0x1fd63f);io[_0x93d4('0x49')]('voice_queue_presence:save',_0x1fd63f);};VoiceQueueReport[_0x93d4('0x36')]['emitVoiceQueueChannelRemove']=function(_0x3b7886,_0x3ab24c){logger[_0x93d4('0x4b')]('[%s][voiceQueueReport]['+_0x3ab24c+_0x93d4('0x51'),_0x3b7886[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x3b7886,{'showHidden':![],'depth':null}));if(_0x3b7886[_0x93d4('0x52')]==='ATTENDEDTRANSFER'){return;}this[_0x93d4('0x49')](util[_0x93d4('0x4e')](_0x93d4('0x4f'),_0x3b7886[_0x93d4('0x50')]),'voice_queue_channel:remove',_0x3b7886);io[_0x93d4('0x49')](_0x93d4('0x53'),_0x3b7886);};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x54')]=function(_0x198501){if(_0x198501[_0x93d4('0x55')]===_0x93d4('0x56')){logger[_0x93d4('0x4b')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x93d4('0x43')](_0x198501,{'showHidden':![],'depth':null}));this[_0x93d4('0x49')](util[_0x93d4('0x4e')](_0x93d4('0x4f'),_0x198501[_0x93d4('0x57')]),_0x93d4('0x58'),_0x198501);}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x59')]=function(_0x12e9a0){return _0x12e9a0!==null&&!_[_0x93d4('0x5a')](_0x12e9a0);};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x2e')]=function(){var _0x39c97a=this;setInterval(function(){_0x39c97a['clearZombieChannels']();ami[_0x93d4('0x3b')]({'action':_0x93d4('0x5b')})['catch'](function(_0xc2e6ef){logger[_0x93d4('0x41')](_0x93d4('0x5c'),util[_0x93d4('0x43')](_0xc2e6ef,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x2d')]=function(){var _0x2afeab=this;setInterval(function(){if(!_0x2afeab[_0x93d4('0x13')][_0x93d4('0x5d')]){return ami[_0x93d4('0x3b')]({'action':_0x93d4('0x5e')})[_0x93d4('0x5f')](function(_0x16bb7c){_0x2afeab[_0x93d4('0x13')]['id']=_0x16bb7c['actionid'];_0x2afeab[_0x93d4('0x13')][_0x93d4('0x5d')]=!![];_0x2afeab[_0x93d4('0x13')][_0x93d4('0x60')][_0x16bb7c[_0x93d4('0x61')]]={};})['catch'](function(_0x126429){logger['error'](_0x93d4('0x62'),util[_0x93d4('0x43')](_0x126429,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x63')]=function(_0x273c25,_0x1ddc11){var _0x15a65c=this[_0x93d4('0x13')][_0x93d4('0x5b')][_0x273c25[_0x93d4('0x57')]][_0x93d4('0x64')];var _0x414b14=new VoiceQueueSummary(_0x273c25);return _0x414b14[_0x93d4('0x65')](_0x1ddc11[_0x93d4('0xf')],this[_0x93d4('0xf')],_0x15a65c,this[_0x93d4('0xe')][_0x93d4('0x10')]);};VoiceQueueReport[_0x93d4('0x36')]['handleInboundQueueSummaryReport']=function(_0x4315b6,_0x2cf93e){var _0x106677=this[_0x93d4('0x63')](_0x4315b6,_0x2cf93e);var _0xa5dd7e=![];_0xa5dd7e=_0x106677[_0x93d4('0x66')](_0x4315b6);if(_0xa5dd7e){Object[_0x93d4('0x67')](_0x4315b6,_0x106677);this[_0x93d4('0xe')][_0x93d4('0x11')][_0x4315b6[_0x93d4('0x57')]]=_0x4315b6;this[_0x93d4('0x54')](_0x106677);}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x68')]=function(_0x42439f){var _0x17d82c=null;var _0x33e6b1=this[_0x93d4('0x13')]['id'];if(this[_0x93d4('0x13')]['queuestatus'][_0x33e6b1]){_0x17d82c=this['summary'][_0x93d4('0x60')][_0x33e6b1][_0x42439f[_0x93d4('0x61')]];}if(!_0x17d82c){this[_0x93d4('0x13')]=initializeSummary();return;}var _0x70572f=this[_0x93d4('0x11')][_0x17d82c[_0x93d4('0x50')]];if(_0x70572f[_0x93d4('0x55')]==='inbound'){this[_0x93d4('0x69')](_0x70572f,_0x17d82c);}else if(_0x70572f[_0x93d4('0x55')]===_0x93d4('0x6a')){var _0x237cca=this['createQueueSummaryReport'](_0x70572f,_0x17d82c);ami['emit'](_0x93d4('0x6b'),_0x237cca);}this[_0x93d4('0x13')]['statusRequests']-=0x1;var _0x1ed7ae=this[_0x93d4('0x13')][_0x93d4('0x6c')]>0x0?!![]:![];if(!_0x1ed7ae){return this[_0x93d4('0x17')](this[_0x93d4('0x13')][_0x93d4('0x6d')]);}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x19')]=function(_0x36c485){var _0x174906=this[_0x93d4('0x13')]['id'];if(this[_0x93d4('0x13')][_0x93d4('0x60')][_0x174906]&&this[_0x93d4('0x13')][_0x93d4('0x60')][_0x174906][_0x36c485[_0x93d4('0x61')]]){this[_0x93d4('0x13')][_0x93d4('0x60')][_0x174906][_0x36c485['actionid']][_0x93d4('0xf')][_0x93d4('0x6e')](_0x36c485);}};VoiceQueueReport['prototype'][_0x93d4('0x15')]=function(_0x5d3310){var _0x36d681=this;try{if(this['isNotNull'](_0x5d3310)&&this['isNotNull'](_0x5d3310[_0x93d4('0x50')])){logger[_0x93d4('0x4b')](_0x93d4('0x6f'),util[_0x93d4('0x43')](_0x5d3310,{'showHidden':![],'depth':null}));var _0x4a8702=this[_0x93d4('0x11')][_0x5d3310[_0x93d4('0x50')]];if(_0x4a8702){logger[_0x93d4('0x70')](_0x93d4('0x71'),_0x4a8702[_0x93d4('0x57')]);this['summary'][_0x93d4('0x5b')][_0x4a8702[_0x93d4('0x57')]]={'summaryEvent':_0x5d3310};this['summary'][_0x93d4('0x6c')]+=0x1;return ami[_0x93d4('0x3b')]({'action':_0x93d4('0x60'),'queue':_0x4a8702['name']})[_0x93d4('0x5f')](function(_0x3a6cf3){if(!_0x36d681['summary'][_0x93d4('0x60')][_0x5d3310['actionid']]){_0x36d681[_0x93d4('0x13')]['queuestatus'][_0x5d3310['actionid']]={};}_0x36d681[_0x93d4('0x13')]['queuestatus'][_0x5d3310[_0x93d4('0x61')]][_0x3a6cf3[_0x93d4('0x61')]]={'queue':_0x4a8702[_0x93d4('0x57')],'agents':[]};})[_0x93d4('0x3e')](function(_0x64fa5a){throw _0x64fa5a;});}}}catch(_0x426e9c){logger[_0x93d4('0x41')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x426e9c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0x17')]=function(_0x15146f){if(this[_0x93d4('0x13')][_0x93d4('0x6c')]>0x0){this['summary'][_0x93d4('0x6d')]=_0x15146f;return;}logger[_0x93d4('0x4b')](_0x93d4('0x72'),util[_0x93d4('0x43')](_0x15146f,{'showHidden':![],'depth':null}));this[_0x93d4('0x13')]=initializeSummary();ami[_0x93d4('0x49')]('custom:queuesummarycomplete',{});};VoiceQueueReport['prototype'][_0x93d4('0x1a')]=function(_0x2abaa2){try{if(this[_0x93d4('0x59')](_0x2abaa2)){logger[_0x93d4('0x4b')](_0x93d4('0x73'),_0x2abaa2[_0x93d4('0x4d')],util['inspect'](_0x2abaa2,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x93d4('0xd')][_0x2abaa2[_0x93d4('0x4d')]])){this[_0x93d4('0xd')][_0x2abaa2[_0x93d4('0x4d')]]=[];}if(_[_0x93d4('0x5a')](this[_0x93d4('0x10')][_0x2abaa2['uniqueid']])){this[_0x93d4('0x10')][_0x2abaa2[_0x93d4('0x4d')]]={};}var _0xc79cf=new QueueReport();_0xc79cf[_0x93d4('0x50')]=_0x2abaa2['queue'];_0xc79cf['type']=this[_0x93d4('0x11')][_0xc79cf['queue']]&&this['voiceQueues'][_0xc79cf[_0x93d4('0x50')]][_0x93d4('0x55')]?this['voiceQueues'][_0xc79cf[_0x93d4('0x50')]]['type']||_0x93d4('0x56'):_0x93d4('0x56');_0xc79cf[_0x93d4('0x74')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0xc79cf[_0x93d4('0x75')]=_0x2abaa2[_0x93d4('0x75')];_0xc79cf[_0x93d4('0x76')]=_0x2abaa2['count'];_0xc79cf[_0x93d4('0x4d')]=_0x2abaa2[_0x93d4('0x4d')];_0xc79cf['routealias']=this[_0x93d4('0x10')][_0x2abaa2[_0x93d4('0x4d')]][_0x93d4('0x77')];logger[_0x93d4('0x70')](_0x93d4('0x78'),_0xc79cf[_0x93d4('0x50')],_0xc79cf['type']);_['merge'](_0xc79cf,_[_0x93d4('0x79')](_0x2abaa2,_['keys'](_0xc79cf)));this[_0x93d4('0xd')][_0x2abaa2[_0x93d4('0x4d')]][_0x93d4('0x6e')](_0xc79cf);this[_0x93d4('0x10')][_0x2abaa2[_0x93d4('0x4d')]]=_0xc79cf;this[_0x93d4('0x4a')](_0xc79cf,'queuecallerjoin');}}catch(_0x45304c){logger[_0x93d4('0x41')](_0x93d4('0x73'),_0x2abaa2[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x45304c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0x1c')]=function(_0x2a5cc2){try{if(this['isNotNull'](_0x2a5cc2)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x2a5cc2[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x2a5cc2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2a5cc2[_0x93d4('0x4d')]]){var _0x3dcde8=_['last'](this[_0x93d4('0xd')][_0x2a5cc2['uniqueid']]);_0x3dcde8[_0x93d4('0x7a')]=![];_0x3dcde8[_0x93d4('0x7b')]=null;_0x3dcde8[_0x93d4('0x7c')]=_0x2a5cc2[_0x93d4('0x7c')];_0x3dcde8['originalposition']=_0x2a5cc2[_0x93d4('0x7d')];_0x3dcde8['queuecallerabandon']=!![];_0x3dcde8[_0x93d4('0x7e')]=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x3dcde8[_0x93d4('0x52')]=_0x93d4('0x80');_0x3dcde8['lastAssignedTo']=null;logger[_0x93d4('0x70')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3dcde8[_0x93d4('0x50')],_0x3dcde8[_0x93d4('0x55')]);this['channels'][_0x2a5cc2[_0x93d4('0x4d')]]=_0x3dcde8;this['emitVoiceQueueChannelRemove'](_0x3dcde8,_0x93d4('0x1b'));}}}catch(_0x2b794b){logger[_0x93d4('0x41')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2a5cc2[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x2b794b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0x81')]=function(_0x5343ec){try{if(this['isNotNull'](_0x5343ec)){logger[_0x93d4('0x4b')](_0x93d4('0x82'),_0x5343ec[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x5343ec,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0x5343ec[_0x93d4('0x4d')]]){var _0x2d7c6e=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x5343ec[_0x93d4('0x4d')]]);_0x2d7c6e[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d7c6e['connectedlinenum']=_0x5343ec['connectedlinenum'];_0x2d7c6e[_0x93d4('0x85')]=_0x5343ec[_0x93d4('0x85')];logger[_0x93d4('0x70')](_0x93d4('0x86'),_0x2d7c6e[_0x93d4('0x50')],_0x2d7c6e[_0x93d4('0x55')],_0x5343ec['connectedlinenum'],_0x5343ec['connectedlinename']);this[_0x93d4('0x10')][_0x5343ec[_0x93d4('0x4d')]]=_0x2d7c6e;this['emitVoiceQueueChannelSave'](_0x2d7c6e,_0x93d4('0x1d'));}}}catch(_0x198bfc){logger[_0x93d4('0x41')](_0x93d4('0x82'),_0x5343ec[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x198bfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x87')]=function(_0x5d890e){try{if(this[_0x93d4('0x59')](_0x5d890e)){logger[_0x93d4('0x4b')](_0x93d4('0x88'),_0x5d890e[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x5d890e,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0x5d890e['uniqueid']]){var _0x385003=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x5d890e[_0x93d4('0x4d')]]);_0x385003['queuecallercomplete']=!![];_0x385003[_0x93d4('0x52')]='COMPLETEDBYAGENT';logger[_0x93d4('0x70')](_0x93d4('0x89'),_0x385003['queue'],_0x385003[_0x93d4('0x55')]);}}}catch(_0x4276f3){logger['error'](_0x93d4('0x88'),_0x5d890e['uniqueid'],util[_0x93d4('0x43')](_0x4276f3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x1f')]=function(_0xbd7b14){try{if(this[_0x93d4('0x59')](_0xbd7b14)){logger[_0x93d4('0x4b')](_0x93d4('0x8a'),_0xbd7b14[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0xbd7b14,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0xbd7b14['uniqueid']]){var _0x2cd9a3=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x4d')]]);_0x2cd9a3[_0x93d4('0x1b')]=![];_0x2cd9a3['queuecallerabandonAt']=null;_0x2cd9a3[_0x93d4('0x8b')]=!![];_0x2cd9a3['lastAssignedTo']=_0xbd7b14[_0x93d4('0x8c')];_0x2cd9a3[_0x93d4('0x7c')]=_0xbd7b14[_0x93d4('0x7c')];_0x2cd9a3['queuecallercomplete']=!![];_0x2cd9a3[_0x93d4('0x8d')]=![];_0x2cd9a3[_0x93d4('0x8e')]=null;if(!_0x2cd9a3[_0x93d4('0x8f')]){if(_0xbd7b14[_0x93d4('0x90')]=='transfer'){_0x2cd9a3[_0x93d4('0x52')]=_0x93d4('0x91');logger[_0x93d4('0x70')](_0x93d4('0x92'),_0x2cd9a3['queue'],_0x2cd9a3['type']);}else{if(_['startsWith'](_0xbd7b14[_0x93d4('0x3d')][_0x93d4('0x93')](),_0x93d4('0x94'))){if(this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x95')]]){var _0x5c1dbe=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x95')]]);_0x5c1dbe[_0x93d4('0x7a')]=![];_0x5c1dbe[_0x93d4('0x8d')]=!![];_0x5c1dbe['queuecallerexitAt']=moment(_0x2cd9a3['queuecallerjoinAt'])[_0x93d4('0x96')](_0xbd7b14[_0x93d4('0x7c')],_0x93d4('0x97'))[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x5c1dbe[_0x93d4('0x52')]=_0x93d4('0x98');_0x5c1dbe[_0x93d4('0x8f')]=!![];_0x5c1dbe[_0x93d4('0x99')]='FORWARD';_0x5c1dbe[_0x93d4('0x9a')]=_0xbd7b14[_0x93d4('0x9b')];_0x5c1dbe[_0x93d4('0x9c')]=_0xbd7b14['uniqueid'];logger[_0x93d4('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5c1dbe['queue'],_0x5c1dbe[_0x93d4('0x55')]);var _0x116af3=this[_0x93d4('0xd')][_0xbd7b14['linkedid']];this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x95')]]=this[_0x93d4('0xd')][_0xbd7b14[_0x93d4('0x4d')]];this['queueReports'][_0xbd7b14['uniqueid']]=_0x116af3;}}else{_0x2cd9a3[_0x93d4('0x52')]='COMPLETEDBY'+_0xbd7b14[_0x93d4('0x90')][_0x93d4('0x9d')]();logger[_0x93d4('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x2cd9a3[_0x93d4('0x50')],_0x2cd9a3[_0x93d4('0x55')],_0x2cd9a3[_0x93d4('0x52')]);}}}this[_0x93d4('0x10')][_0xbd7b14[_0x93d4('0x4d')]]=_0x2cd9a3;this[_0x93d4('0x47')](_0x2cd9a3,_0x93d4('0x1e'));}}}catch(_0x4e933d){logger[_0x93d4('0x41')](_0x93d4('0x8a'),_0xbd7b14[_0x93d4('0x4d')],util['inspect'](_0x4e933d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x22')]=function(_0x3bbda4){try{if(this[_0x93d4('0x59')](_0x3bbda4)){logger[_0x93d4('0x4b')](_0x93d4('0x9e'),_0x3bbda4[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x3bbda4,{'showHidden':![],'depth':null}));this[_0x93d4('0x9f')](_0x3bbda4[_0x93d4('0x4d')],_[_0x93d4('0xa0')](_0x3bbda4[_0x93d4('0xa1')])[0x0],_0x3bbda4[_0x93d4('0xa2')]);if(this['queueReports'][_0x3bbda4[_0x93d4('0x4d')]]){var _0x2d688c=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x3bbda4[_0x93d4('0x4d')]]);if(_0x2d688c){if(this[_0x93d4('0x59')](_0x3bbda4[_0x93d4('0xa1')])&&this[_0x93d4('0x59')](_0x3bbda4[_0x93d4('0xa1')][_0x93d4('0x60')])){switch(_0x3bbda4['value']){case _0x93d4('0xa3'):_0x2d688c[_0x93d4('0x8d')]=![];_0x2d688c[_0x93d4('0x8e')]=null;break;case _0x93d4('0xa4'):_0x2d688c[_0x93d4('0xa5')]=_0x93d4('0xa6');_0x2d688c['queuecallerexit']=!![];_0x2d688c['queuecallerexitAt']=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x2d688c[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));logger[_0x93d4('0x4b')](_0x93d4('0xa7'),_0x3bbda4[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x2d688c,{'showHidden':![],'depth':null}));ami[_0x93d4('0x49')](_0x93d4('0xa8'),_0x2d688c);break;default:_0x2d688c[_0x93d4('0x8d')]=!![];_0x2d688c[_0x93d4('0x8e')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d688c[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d688c['queuecallerabandon']=![];_0x2d688c[_0x93d4('0x7e')]=null;_0x2d688c['queuecallerexitreason']=_0x3bbda4['value'];this[_0x93d4('0x10')][_0x3bbda4['uniqueid']]=_0x2d688c;this[_0x93d4('0x47')](_0x2d688c,_0x93d4('0x21'));}else if(this[_0x93d4('0x59')](_0x3bbda4['variable'])&&this[_0x93d4('0x59')](_0x3bbda4['variable']['queueposition'])){if(!_0x2d688c[_0x93d4('0x1b')]){_0x2d688c[_0x93d4('0x8d')]=!![];_0x2d688c[_0x93d4('0x8e')]=moment()['format'](_0x93d4('0x7f'));_0x2d688c['queuecallerexitreason']=_0x93d4('0xa9');_0x2d688c[_0x93d4('0x84')]=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));this[_0x93d4('0x10')][_0x3bbda4[_0x93d4('0x4d')]]=_0x2d688c;}}logger['info'](_0x93d4('0xaa'),_0x3bbda4['uniqueid'],_0x2d688c[_0x93d4('0x50')],_0x2d688c[_0x93d4('0x55')],_['keys'](_0x3bbda4[_0x93d4('0xa1')])[0x0],_0x3bbda4['value']);_0x2d688c[_0x93d4('0x14')]=this['variables'][_0x3bbda4['uniqueid']];}}}}catch(_0x22b22d){logger[_0x93d4('0x41')](_0x93d4('0x9e'),_0x3bbda4['uniqueid'],util[_0x93d4('0x43')](_0x22b22d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x9f')]=function(_0xde7f93,_0x386875,_0x5cf365){var _0x392d67=[_0x93d4('0xab'),_0x93d4('0xac'),_0x93d4('0xad'),_0x93d4('0xae'),_0x93d4('0xaf'),_0x93d4('0xb0'),_0x93d4('0xb1'),_0x93d4('0xb2'),_0x93d4('0xb3'),_0x93d4('0xb4'),'bridgepeer',_0x93d4('0xb5'),_0x93d4('0xb6'),_0x93d4('0xb7'),'memberinterface',_0x93d4('0xb8'),_0x93d4('0x8c'),'memberpenalty','memberrealtime'];if(!_[_0x93d4('0x3a')](_0x386875)&&!_[_0x93d4('0xb9')](_0x392d67,_0x386875)){if(_[_0x93d4('0x5a')](this[_0x93d4('0x14')][_0xde7f93])){this[_0x93d4('0x14')][_0xde7f93]={};}this[_0x93d4('0x14')][_0xde7f93][_0x386875]=_0x5cf365;}};VoiceQueueReport[_0x93d4('0x36')]['handleHangup']=function(_0x59ed42,_0x46ed3c,_0x38d33c){var _0x29d97f={};for(var _0x2eba9f=0x0;_0x2eba9f<this[_0x93d4('0xd')][_0x59ed42]['length'];_0x2eba9f+=0x1){_0x29d97f=this[_0x93d4('0xd')][_0x59ed42][_0x2eba9f];if(this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]]){if(_0x29d97f[_0x93d4('0x8d')]&&_0x29d97f['transfer']!=!![]){this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xba')]+=0x1;}if(_0x29d97f[_0x93d4('0x1b')]){this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xbb')]+=0x1;}this['voiceQueues'][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xbc')]+=moment(_0x29d97f['queuecallerleaveAt'])[_0x93d4('0xbd')](_0x29d97f['queuecallerjoinAt'],_0x93d4('0x97'))||0x0;if(_0x2eba9f===this[_0x93d4('0xd')][_0x59ed42][_0x93d4('0xbe')]-0x1){this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xbf')]+=moment()[_0x93d4('0xc0')](0x0)[_0x93d4('0xbd')](_0x29d97f[_0x93d4('0x74')],'seconds');this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xc1')]+=0x1;if(_0x29d97f['queuecallercomplete']){this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xc2')]+=0x1;this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xc3')]+=moment()[_0x93d4('0xc0')](0x0)[_0x93d4('0xbd')](_0x29d97f[_0x93d4('0x84')],'seconds');_0x29d97f['queuecallercompleteAt']=moment()[_0x93d4('0x4e')](_0x93d4('0x7f'));_0x29d97f[_0x93d4('0x8d')]=![];_0x29d97f['queuecallerexitAt']=null;}if(_0x29d97f['queuecallerexit']&&_0x29d97f[_0x93d4('0x8f')]!=!![]){_0x29d97f[_0x93d4('0xa5')]=_0x93d4('0xba');logger[_0x93d4('0x4b')](_0x93d4('0xc4'),_0x59ed42,util[_0x93d4('0x43')](_0x29d97f,{'showHidden':![],'depth':null}));ami[_0x93d4('0x49')](_0x93d4('0xc5'),_0x29d97f);}if(_0x29d97f[_0x93d4('0x1b')]){_0x29d97f['lastevent']=_0x93d4('0xbb');logger['debug'](_0x93d4('0xc6'),_0x59ed42,util[_0x93d4('0x43')](_0x29d97f,{'showHidden':![],'depth':null}));ami[_0x93d4('0x49')](_0x93d4('0xc7'),_0x29d97f);}}else{this[_0x93d4('0x11')][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xbf')]+=this['voiceQueues'][_0x29d97f[_0x93d4('0x50')]][_0x93d4('0xbc')];}logger[_0x93d4('0x70')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x59ed42,_0x29d97f['queue'],_0x29d97f[_0x93d4('0x55')],_0x46ed3c);if(_0x38d33c&&_0x29d97f['queuecallerexitreason']==='ATTENDEDTRANSFER'){_0x29d97f[_0x93d4('0x52')]='COMPLETEDBYAGENT';}this['channels'][_0x59ed42]=_0x29d97f;this[_0x93d4('0x47')](_0x29d97f,_0x93d4('0x23'));}}logger[_0x93d4('0x4b')](_0x93d4('0xc8'),_0x59ed42,util[_0x93d4('0x43')](this[_0x93d4('0xd')][_0x59ed42],{'showHidden':![],'depth':null}));ami[_0x93d4('0x49')](_0x93d4('0xc9'),this[_0x93d4('0xd')][_0x59ed42]);if(_0x29d97f[_0x93d4('0x52')]==='ATTENDEDTRANSFER'){return;}if(_0x29d97f['queuecallerexit']||_0x29d97f['queuecallerabandon']||_0x29d97f[_0x93d4('0x7a')]){delete this[_0x93d4('0xd')][_0x59ed42];delete this[_0x93d4('0x10')][_0x59ed42];if(this[_0x93d4('0x14')][_0x59ed42]){delete this[_0x93d4('0x14')][_0x59ed42];}}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0xca')]=function(_0x1e8afd){try{if(this[_0x93d4('0x59')](_0x1e8afd)){logger[_0x93d4('0x4b')](_0x93d4('0xcb'),_0x1e8afd[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x1e8afd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1e8afd['uniqueid']]){return this[_0x93d4('0xcc')](_0x1e8afd[_0x93d4('0x4d')],_0x1e8afd[_0x93d4('0xcd')],![]);}if(this[_0x93d4('0xd')][_0x1e8afd[_0x93d4('0x95')]]){if(_0x1e8afd[_0x93d4('0xce')]==='21'){return;}return this[_0x93d4('0xcc')](_0x1e8afd['linkedid'],_0x1e8afd['cause-txt'],!![]);}var _0x2ea811=Object[_0x93d4('0xa0')](this[_0x93d4('0xd')]);for(var _0x400bc2=0x0;_0x400bc2<_0x2ea811[_0x93d4('0xbe')];_0x400bc2++){var _0x428515=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x2ea811[_0x400bc2]]);if(_0x428515&&_0x428515[_0x93d4('0xcf')]===_0x1e8afd['uniqueid']){return this[_0x93d4('0xcc')](_0x428515[_0x93d4('0x4d')],_0x1e8afd[_0x93d4('0xcd')],!![]);}}}}catch(_0x1aa00b){logger[_0x93d4('0x41')](_0x93d4('0xcb'),_0x1e8afd[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x1aa00b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')]['syncAttendedTransfer']=function(_0x26e52f){try{if(this[_0x93d4('0x59')](_0x26e52f)){logger[_0x93d4('0x4b')](_0x93d4('0xd0'),_0x26e52f[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x26e52f,{'showHidden':![],'depth':null}));var _0x45b62c;var _0x3b6cdb;var _0x13b2ba;if(this[_0x93d4('0xd')][_0x26e52f['transfereeuniqueid']]){_0x45b62c=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd1')]]);_0x45b62c['transferexten']=_0x26e52f['secondtransfererexten'];_0x45b62c['transferuniqueid']=_0x26e52f[_0x93d4('0xd2')];_0x45b62c[_0x93d4('0x52')]=_0x93d4('0xd3');_0x45b62c[_0x93d4('0x8f')]=!![];_0x45b62c[_0x93d4('0x99')]=_0x93d4('0xd4');if(this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd2')]]){_0x13b2ba=this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd2')]];this[_0x93d4('0xd')][_0x26e52f['secondtransfereruniqueid']]=this['queueReports'][_0x26e52f[_0x93d4('0xd1')]];this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd1')]]=_0x13b2ba;_0x3b6cdb=_['last'](this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd1')]]);_0x3b6cdb['switch']=!![];}logger[_0x93d4('0x70')](_0x93d4('0xd5'),_0x26e52f[_0x93d4('0x4d')],_0x45b62c[_0x93d4('0x50')],_0x45b62c[_0x93d4('0x55')],_0x45b62c[_0x93d4('0x9a')],_0x45b62c[_0x93d4('0x9c')]);}else if(this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd6')]]){_0x45b62c=_[_0x93d4('0x83')](this['queueReports'][_0x26e52f[_0x93d4('0xd6')]]);_0x45b62c[_0x93d4('0x9a')]=_0x26e52f['origtransfererexten'];_0x45b62c[_0x93d4('0x9c')]=_0x26e52f[_0x93d4('0xd7')];_0x45b62c[_0x93d4('0x52')]='ATTENDEDTRANSFER';_0x45b62c[_0x93d4('0x8f')]=!![];_0x45b62c['transfertype']=_0x93d4('0xd4');if(this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd7')]]){_0x13b2ba=this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd7')]];this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd7')]]=this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd6')]];this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd6')]]=_0x13b2ba;_0x3b6cdb=_[_0x93d4('0x83')](this['queueReports'][_0x26e52f[_0x93d4('0xd6')]]);_0x3b6cdb['switch']=!![];}logger[_0x93d4('0x70')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x26e52f[_0x93d4('0x4d')],_0x45b62c[_0x93d4('0x50')],_0x45b62c['type'],_0x45b62c['transferexten'],_0x45b62c[_0x93d4('0x9c')]);}else if(this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd7')]]){_0x45b62c=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd7')]]);_0x45b62c['transferexten']=_0x26e52f[_0x93d4('0xd8')];_0x45b62c['transferuniqueid']=_0x26e52f[_0x93d4('0xd7')];_0x45b62c['queuecallerexitreason']='ATTENDEDTRANSFER';_0x45b62c[_0x93d4('0x8f')]=!![];_0x45b62c['transfertype']=_0x93d4('0xd4');_0x45b62c['switch']=!![];_0x45b62c['transferid']=_0x26e52f[_0x93d4('0xd1')];}else if(this[_0x93d4('0xd')][_0x26e52f[_0x93d4('0xd2')]]){_0x45b62c=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x26e52f['secondtransfereruniqueid']]);_0x45b62c['transferexten']=_0x26e52f[_0x93d4('0xd9')];_0x45b62c['transferuniqueid']=_0x26e52f['secondtransfereruniqueid'];_0x45b62c[_0x93d4('0x52')]=_0x93d4('0xd3');_0x45b62c[_0x93d4('0x8f')]=!![];_0x45b62c[_0x93d4('0x99')]=_0x93d4('0xd4');_0x45b62c['switch']=!![];_0x45b62c[_0x93d4('0xcf')]=_0x26e52f['transfertargetuniqueid'];}}}catch(_0x330e08){logger[_0x93d4('0x41')](_0x93d4('0xd0'),_0x26e52f['uniqueid'],util['inspect'](_0x330e08,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')][_0x93d4('0x2c')]=function(_0xddad0){try{if(this[_0x93d4('0x59')](_0xddad0)){logger['debug'](_0x93d4('0xda'),_0xddad0[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0xddad0,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0xddad0[_0x93d4('0xd1')]]){var _0x133d24=_[_0x93d4('0x83')](this['queueReports'][_0xddad0[_0x93d4('0xd1')]]);_0x133d24[_0x93d4('0x52')]=_0x93d4('0xdb');_0x133d24[_0x93d4('0x8f')]=!![];_0x133d24[_0x93d4('0x99')]=_0x93d4('0xdc');_0x133d24[_0x93d4('0x9a')]=_0xddad0[_0x93d4('0xdd')];_0x133d24[_0x93d4('0x9c')]=_0xddad0[_0x93d4('0xd1')];logger['info'](_0x93d4('0xde'),_0xddad0['uniqueid'],_0x133d24[_0x93d4('0x50')],_0x133d24['type'],_0x133d24['transferexten'],_0x133d24[_0x93d4('0x9c')]);this['syncHangup']({'event':_0x93d4('0xdf'),'uniqueid':_0xddad0['transfereeuniqueid'],'context':_0xddad0[_0x93d4('0xe0')],'channel':_0xddad0[_0x93d4('0xe1')]});}}}catch(_0x1058e5){logger['error'](_0x93d4('0xda'),_0xddad0['uniqueid'],util[_0x93d4('0x43')](_0x1058e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')]['syncMusicOnHoldStart']=function(_0xd2171){try{if(this[_0x93d4('0x59')](_0xd2171)){logger[_0x93d4('0x4b')](_0x93d4('0xe2'),_0xd2171['uniqueid'],util[_0x93d4('0x43')](_0xd2171,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0xd2171[_0x93d4('0x4d')]]){var _0x489cdd=_[_0x93d4('0x83')](this['queueReports'][_0xd2171[_0x93d4('0x4d')]]);if(!_['isNil'](_0x489cdd[_0x93d4('0x84')])){_0x489cdd[_0x93d4('0xe3')]=moment()[_0x93d4('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x93d4('0x70')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0xd2171[_0x93d4('0x4d')],_0x489cdd[_0x93d4('0xe3')]);}}}}catch(_0x465278){logger[_0x93d4('0x41')](_0x93d4('0xe2'),_0xd2171[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x465278,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x93d4('0x36')]['syncMusicOnHoldStop']=function(_0x58fe96){try{if(this[_0x93d4('0x59')](_0x58fe96)){logger[_0x93d4('0x4b')](_0x93d4('0xe4'),_0x58fe96[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x58fe96,{'showHidden':![],'depth':null}));if(this[_0x93d4('0xd')][_0x58fe96[_0x93d4('0x4d')]]){var _0x55ded3=_[_0x93d4('0x83')](this[_0x93d4('0xd')][_0x58fe96[_0x93d4('0x4d')]]);if(!_[_0x93d4('0x3a')](_0x55ded3[_0x93d4('0xe3')])){_0x55ded3['mohtime']+=moment()['milliseconds'](0x0)['diff'](_0x55ded3[_0x93d4('0xe3')],_0x93d4('0x97'));logger[_0x93d4('0x70')](_0x93d4('0xe5'),_0x58fe96[_0x93d4('0x4d')],_0x55ded3[_0x93d4('0xe6')]);delete _0x55ded3[_0x93d4('0xe3')];}}}}catch(_0x3ddb28){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x58fe96[_0x93d4('0x4d')],util['inspect'](_0x3ddb28,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x93d4('0xe7')]=function(_0x4c1e22){try{if(this[_0x93d4('0x59')](_0x4c1e22)){logger['debug'](_0x93d4('0xe8'),_0x4c1e22[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x4c1e22,{'showHidden':![],'depth':null}));if(_0x4c1e22[_0x93d4('0xe9')][_0x93d4('0x93')]()==='set'){_0x4c1e22[_0x93d4('0xea')]=_0x4c1e22['appdata']&&_0x4c1e22[_0x93d4('0xeb')][_0x93d4('0xec')](_0x93d4('0xed'))?_0x4c1e22['appdata']:(_0x4c1e22[_0x93d4('0xeb')]||_0x4c1e22['applicationdata'])[_0x93d4('0x93')]();if(_[_0x93d4('0xec')](_0x4c1e22[_0x93d4('0xea')]['toLowerCase'](),'cdr(')){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x4c1e22[_0x93d4('0x4d')],_0x4c1e22[_0x93d4('0xe9')],_0x4c1e22[_0x93d4('0xea')]);if(_[_0x93d4('0x5a')](this[_0x93d4('0x10')][_0x4c1e22[_0x93d4('0x4d')]]))this['channels'][_0x4c1e22[_0x93d4('0x4d')]]={};var _0x2bb55d=_0x4c1e22[_0x93d4('0xea')]['split']('=');var _0x3c3b97=_0x2bb55d[0x0][_0x93d4('0x93')]()[_0x93d4('0xee')](/cdr\((.*)\)/);if(_0x3c3b97)this['channels'][_0x4c1e22[_0x93d4('0x4d')]][_0x3c3b97[0x1]]=_0x2bb55d[0x1];}}}}catch(_0x5b1a46){logger['error']('[%s][voiceQueueReport][newexten]',_0x4c1e22[_0x93d4('0x4d')],util[_0x93d4('0x43')](_0x5b1a46,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
index b9b2481..260e751 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a56=['../client','queue','Request','CreateReportAgentPreview'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x6a56,0x68));var _0x66a5=function(_0x20cf8a,_0x44cd6b){_0x20cf8a=_0x20cf8a-0x0;var _0x54e165=_0x6a56[_0x20cf8a];return _0x54e165;};'use strict';var client=require(_0x66a5('0x0'));exports['createHistory']=function(_0x37a7bb){return function(){_0x37a7bb['campaign']=_0x37a7bb[_0x66a5('0x1')];return client[_0x66a5('0x2')](_0x66a5('0x3'),{'body':_0x37a7bb,'log':_0x66a5('0x3')});};};
\ No newline at end of file
+var _0xf93b=['../client','campaign','queue','CreateReportAgentPreview'];(function(_0x56cf55,_0x1ee74b){var _0x20a1c5=function(_0x52b5f8){while(--_0x52b5f8){_0x56cf55['push'](_0x56cf55['shift']());}};_0x20a1c5(++_0x1ee74b);}(_0xf93b,0x12c));var _0xbf93=function(_0x2181b1,_0x569637){_0x2181b1=_0x2181b1-0x0;var _0x530548=_0xf93b[_0x2181b1];return _0x530548;};'use strict';var client=require(_0xbf93('0x0'));exports['createHistory']=function(_0x4bf4dd){return function(){_0x4bf4dd[_0xbf93('0x1')]=_0x4bf4dd[_0xbf93('0x2')];return client['Request'](_0xbf93('0x3'),{'body':_0x4bf4dd,'log':_0xbf93('0x3')});};};
\ No newline at end of file
index 7c2af31..afe5224 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81a4=['Request','CreateAttachment','create'];(function(_0x13fd50,_0x17020d){var _0x11e0da=function(_0x3a9c93){while(--_0x3a9c93){_0x13fd50['push'](_0x13fd50['shift']());}};_0x11e0da(++_0x17020d);}(_0x81a4,0x125));var _0x481a=function(_0x3299d1,_0x545733){_0x3299d1=_0x3299d1-0x0;var _0x44356e=_0x81a4[_0x3299d1];return _0x44356e;};'use strict';var client=require('../client');exports[_0x481a('0x0')]=function(_0x4229f3){return client[_0x481a('0x1')](_0x481a('0x2'),{'body':_0x4229f3,'log':_0x481a('0x2')});};
\ No newline at end of file
+var _0xed03=['Request','../client','create'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xed03,0xdc));var _0x3ed0=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0xed03[_0x5416db];return _0x243e35;};'use strict';var client=require(_0x3ed0('0x0'));exports[_0x3ed0('0x1')]=function(_0x4e1330){return client[_0x3ed0('0x2')]('CreateAttachment',{'body':_0x4e1330,'log':'CreateAttachment'});};
\ No newline at end of file
index e2a8abb..fac266b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','Interval','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt'];(function(_0x4acf4d,_0xfc6bb3){var _0x13da0d=function(_0x4871d7){while(--_0x4871d7){_0x4acf4d['push'](_0x4acf4d['shift']());}};_0x13da0d(++_0xfc6bb3);}(_0xdb28,0x106));var _0x8db2=function(_0x24795b,_0x2aaa7c){_0x24795b=_0x24795b-0x0;var _0x23c698=_0xdb28[_0x24795b];return _0x23c698;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(){return client[_0x8db2('0x2')](_0x8db2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'dialOriginateTimeout',_0x8db2('0x9'),_0x8db2('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'dialAbandonedMaxRetry',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'dialAgentRejectMaxRetry',_0x8db2('0x15'),_0x8db2('0x16'),'dialGlobalInterval',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21'),_0x8db2('0x22')],'include':[{'model':_0x8db2('0x23'),'as':_0x8db2('0x23'),'attributes':['id',_0x8db2('0x24'),'callerid',_0x8db2('0x5')]},{'model':_0x8db2('0x23'),'as':'TrunkBackup','attributes':['id',_0x8db2('0x24'),_0x8db2('0x25'),_0x8db2('0x5')]},{'model':_0x8db2('0x26'),'as':_0x8db2('0x26'),'attributes':['id',_0x8db2('0x24')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8db2('0x24'),_0x8db2('0x27')]}]},{'model':_0x8db2('0x28'),'as':_0x8db2('0x28'),'attributes':['id','name']}]},'log':_0x8db2('0x29')});};};
\ No newline at end of file
+var _0xdb28=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','Interval','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt'];(function(_0x28c185,_0x1cfea5){var _0x2da0da=function(_0x8f9823){while(--_0x8f9823){_0x28c185['push'](_0x28c185['shift']());}};_0x2da0da(++_0x1cfea5);}(_0xdb28,0x106));var _0x8db2=function(_0x17c925,_0x204dfb){_0x17c925=_0x17c925-0x0;var _0x2ec402=_0xdb28[_0x17c925];return _0x2ec402;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(){return client[_0x8db2('0x2')](_0x8db2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'dialOriginateTimeout',_0x8db2('0x9'),_0x8db2('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'dialAbandonedMaxRetry',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'dialAgentRejectMaxRetry',_0x8db2('0x15'),_0x8db2('0x16'),'dialGlobalInterval',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21'),_0x8db2('0x22')],'include':[{'model':_0x8db2('0x23'),'as':_0x8db2('0x23'),'attributes':['id',_0x8db2('0x24'),'callerid',_0x8db2('0x5')]},{'model':_0x8db2('0x23'),'as':'TrunkBackup','attributes':['id',_0x8db2('0x24'),_0x8db2('0x25'),_0x8db2('0x5')]},{'model':_0x8db2('0x26'),'as':_0x8db2('0x26'),'attributes':['id',_0x8db2('0x24')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8db2('0x24'),_0x8db2('0x27')]}]},{'model':_0x8db2('0x28'),'as':_0x8db2('0x28'),'attributes':['id','name']}]},'log':_0x8db2('0x29')});};};
\ No newline at end of file
index 9bcd6ff..7811121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b73=['GetCmContact','../client','createContact','Request','CreateCmContact','getContacts'];(function(_0x2ed4b3,_0x413430){var _0x16b3f0=function(_0x587932){while(--_0x587932){_0x2ed4b3['push'](_0x2ed4b3['shift']());}};_0x16b3f0(++_0x413430);}(_0x2b73,0x11b));var _0x32b7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2b73[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x32b7('0x0'));exports[_0x32b7('0x1')]=function(_0x211ca7){return function(){return client[_0x32b7('0x2')](_0x32b7('0x3'),{'body':_0x211ca7,'log':'CreateCmContact'});};};exports[_0x32b7('0x4')]=function(_0x5a886a){return function(){return client[_0x32b7('0x2')](_0x32b7('0x5'),{'options':_0x5a886a,'log':_0x32b7('0x5')});};};
\ No newline at end of file
+var _0x1f41=['GetCmContact','createContact','CreateCmContact','getContacts','Request'];(function(_0x2a63be,_0x4ad6cf){var _0x351bd7=function(_0x1630b8){while(--_0x1630b8){_0x2a63be['push'](_0x2a63be['shift']());}};_0x351bd7(++_0x4ad6cf);}(_0x1f41,0x1af));var _0x11f4=function(_0x408f6d,_0x5bc66a){_0x408f6d=_0x408f6d-0x0;var _0xc75c69=_0x1f41[_0x408f6d];return _0xc75c69;};'use strict';var client=require('../client');exports[_0x11f4('0x0')]=function(_0x339d67){return function(){return client['Request'](_0x11f4('0x1'),{'body':_0x339d67,'log':_0x11f4('0x1')});};};exports[_0x11f4('0x2')]=function(_0x2bbf26){return function(){return client[_0x11f4('0x3')](_0x11f4('0x4'),{'options':_0x2bbf26,'log':'GetCmContact'});};};
\ No newline at end of file
index 284c174..e87d610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4dc=['GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','VoiceQueueId','countReScheduled','GetCmHopperPreview','User','name','VoiceQueue','Queue','getCmHopper','unlockContact','Agent','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','Request','GetCmHopper','CmContact','Contact','updateContacts','format','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','rescheduleContact','ListId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer'];(function(_0x4b1c53,_0x3af279){var _0x29692f=function(_0x75554a){while(--_0x75554a){_0x4b1c53['push'](_0x4b1c53['shift']());}};_0x29692f(++_0x3af279);}(_0xa4dc,0x16a));var _0xca4d=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xa4dc[_0x411017];return _0x2adeea;};'use strict';var client=require(_0xca4d('0x0'));var moment=require(_0xca4d('0x1'));exports['getContacts']=function(_0x572477,_0x3e9b62){return function(){return client[_0xca4d('0x2')](_0xca4d('0x3'),{'options':{'where':{'VoiceQueueId':_0x572477},'include':[{'model':_0xca4d('0x4'),'as':_0xca4d('0x5')}],'limit':_0x3e9b62,'raw':![]},'log':'getCmHopper'});};};exports[_0xca4d('0x6')]=function(_0x4fb74e,_0x1b60f4,_0x51470b){return function(){return client[_0xca4d('0x2')]('UpdateCmHopper',{'body':_0x4fb74e,'options':{'where':{'VoiceQueueId':_0x1b60f4,'scheduledat':{'$lte':moment()[_0xca4d('0x7')](_0xca4d('0x8'))}},'limit':_0x51470b},'log':_0xca4d('0x9')});};};exports[_0xca4d('0xa')]=function(_0x51e00e){return client[_0xca4d('0x2')](_0xca4d('0x9'),{'body':_0x51e00e,'options':{'where':{'ContactId':_0x51e00e['ContactId'],'ListId':_0x51e00e[_0xca4d('0xb')],'VoiceQueueId':_0x51e00e['VoiceQueueId'],'CampaignId':_0x51e00e[_0xca4d('0xc')]}},'log':_0xca4d('0xa')});};exports[_0xca4d('0xd')]=function(_0x13c678,_0x2b7b48,_0x434e77){return function(){return client[_0xca4d('0x2')](_0xca4d('0xe'),{'options':{'where':{'VoiceQueueId':_0x13c678,'ListId':_0x2b7b48,'ContactId':_0x434e77}},'log':'DestroyCmHopper'});};};exports[_0xca4d('0xf')]=function(_0x50c8d8,_0x112ce3,_0x16c5c0,_0x2e86ae){return client['Request'](_0xca4d('0x10'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x50c8d8,'active':![],'scheduledat':{'$lte':moment()['format'](_0xca4d('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x112ce3}}]},'order':[[_0xca4d('0x11'),_0xca4d('0x12')],[_0xca4d('0x13'),_0x2e86ae],['id',_0xca4d('0x14')]],'raw':!![],'limit':_0x16c5c0},'log':_0xca4d('0x10')});};exports[_0xca4d('0x15')]=function(_0x5b7620,_0xcd0ab0,_0x20ed84){return client[_0xca4d('0x2')](_0xca4d('0x10'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x5b7620,'active':![],'scheduledat':{'$lte':moment()[_0xca4d('0x7')](_0xca4d('0x8'))}},'include':[{'model':_0xca4d('0x4'),'as':_0xca4d('0x5')}],'order':[[_0xca4d('0x11'),'DESC'],['scheduledat',_0x20ed84],['id',_0xca4d('0x14')]],'raw':!![],'limit':_0xcd0ab0},'log':'GetContactDialerIvr'});};exports[_0xca4d('0x16')]=function(_0x555f0e,_0x375efa){_0x555f0e[_0xca4d('0x17')]=_0x555f0e[_0xca4d('0x18')];return client[_0xca4d('0x2')](_0xca4d('0x19'),{'body':_0x555f0e,'options':{'where':{'ContactId':_0x555f0e['ContactId'],'ListId':_0x555f0e['ListId'],'VoiceQueueId':_0x555f0e[_0xca4d('0x1a')],'CampaignId':_0x555f0e[_0xca4d('0xc')],'active':_0x375efa?undefined:!![]}},'log':_0xca4d('0x19')});};exports[_0xca4d('0x1b')]=function(_0x5ef722){return client[_0xca4d('0x2')]('CountReScheduled',{'options':{'where':{'VoiceQueueId':_0x5ef722['id']?_0x5ef722['id']||null:null}},'log':_0xca4d('0x1b')});};exports['getContactPreview']=function(_0x44c9a6){return function(){return client['Request'](_0xca4d('0x1c'),{'options':{'where':{'id':_0x44c9a6},'include':[{'model':_0xca4d('0x4'),'as':_0xca4d('0x5')},{'model':_0xca4d('0x1d'),'as':'Agent','attributes':['id',_0xca4d('0x1e')]},{'model':_0xca4d('0x1f'),'as':_0xca4d('0x20'),'attributes':['id',_0xca4d('0x1e')]}],'raw':!![]},'log':_0xca4d('0x21')});};};exports[_0xca4d('0x22')]=function(_0x13cd87,_0x39fe11,_0xa6e7e2){return client[_0xca4d('0x2')](_0xca4d('0x9'),{'body':_0x13cd87,'options':{'where':{'id':_0x39fe11},'limit':_0xa6e7e2},'log':_0xca4d('0x9')});};exports['getContactRecallMe']=function(_0x53efdb,_0xcc6dd5){return function(){return client[_0xca4d('0x2')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x53efdb,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xca4d('0x7')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0xcc6dd5}},'order':[[_0xca4d('0x11'),_0xca4d('0x12')],['scheduledat',_0xca4d('0x12')],['id',_0xca4d('0x14')]],'include':[{'model':_0xca4d('0x4'),'as':_0xca4d('0x5')},{'model':'User','as':_0xca4d('0x23'),'attributes':['id',_0xca4d('0x1e'),_0xca4d('0x24')]}],'group':_0xca4d('0x25'),'raw':!![]},'log':'GetContactDialer'});};};exports[_0xca4d('0x26')]=function(_0x2ea3a6,_0x3458cc){return client[_0xca4d('0x2')]('ResetActiveCalls',{'body':_0x2ea3a6,'options':_0x3458cc||{},'log':_0xca4d('0x27')});};exports[_0xca4d('0x28')]=function(_0xcca4c5,_0x5ab7e7,_0x40d8ec){return function(){return client[_0xca4d('0x2')](_0xca4d('0x29'),{'body':{'where':{'voiceQueueIds':_0xcca4c5,'interval':_0x5ab7e7,'availableAgentsIds':_0x40d8ec}},'log':_0xca4d('0x28')});};};
\ No newline at end of file
+var _0x90b5=['Queue','name','unlockContact','getContactRecallMe','GetContactRecallMe','CmContact','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','getContacts','Request','Contact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','moveContactManagedDialer','campaign','ListId','MoveContactManagedDialer','countReScheduled','CountReScheduled','GetCmHopperPreview','User','Agent','VoiceQueue'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x90b5,0x139));var _0x590b=function(_0xdfbd33,_0x2873a7){_0xdfbd33=_0xdfbd33-0x0;var _0x130768=_0x90b5[_0xdfbd33];return _0x130768;};'use strict';var client=require(_0x590b('0x0'));var moment=require('moment');exports[_0x590b('0x1')]=function(_0xe39dc,_0xf402e8){return function(){return client[_0x590b('0x2')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0xe39dc},'include':[{'model':'CmContact','as':_0x590b('0x3')}],'limit':_0xf402e8,'raw':![]},'log':_0x590b('0x4')});};};exports['updateContacts']=function(_0x208ef2,_0x2059e4,_0x88a5f9){return function(){return client['Request'](_0x590b('0x5'),{'body':_0x208ef2,'options':{'where':{'VoiceQueueId':_0x2059e4,'scheduledat':{'$lte':moment()[_0x590b('0x6')](_0x590b('0x7'))}},'limit':_0x88a5f9},'log':_0x590b('0x5')});};};exports[_0x590b('0x8')]=function(_0x268b0a){return client[_0x590b('0x2')](_0x590b('0x5'),{'body':_0x268b0a,'options':{'where':{'ContactId':_0x268b0a[_0x590b('0x9')],'ListId':_0x268b0a['ListId'],'VoiceQueueId':_0x268b0a[_0x590b('0xa')],'CampaignId':_0x268b0a[_0x590b('0xb')]}},'log':'rescheduleContact'});};exports[_0x590b('0xc')]=function(_0x4a5939,_0x392467,_0x311c9d){return function(){return client[_0x590b('0x2')](_0x590b('0xd'),{'options':{'where':{'VoiceQueueId':_0x4a5939,'ListId':_0x392467,'ContactId':_0x311c9d}},'log':'DestroyCmHopper'});};};exports[_0x590b('0xe')]=function(_0x1b7ac6,_0x88865c,_0x1c8607,_0x2e85b1){return client[_0x590b('0x2')](_0x590b('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x1b7ac6,'active':![],'scheduledat':{'$lte':moment()[_0x590b('0x6')](_0x590b('0x7'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x88865c}}]},'order':[[_0x590b('0x10'),_0x590b('0x11')],[_0x590b('0x12'),_0x2e85b1],['id',_0x590b('0x13')]],'raw':!![],'limit':_0x1c8607},'log':_0x590b('0xf')});};exports[_0x590b('0x14')]=function(_0x4f2512,_0x1ec65a,_0x530e24){return client[_0x590b('0x2')](_0x590b('0xf'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4f2512,'active':![],'scheduledat':{'$lte':moment()[_0x590b('0x6')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':'CmContact','as':_0x590b('0x3')}],'order':[['priority',_0x590b('0x11')],[_0x590b('0x12'),_0x530e24],['id',_0x590b('0x13')]],'raw':!![],'limit':_0x1ec65a},'log':'GetContactDialerIvr'});};exports[_0x590b('0x15')]=function(_0x8ab843,_0x2b8ea0){_0x8ab843[_0x590b('0x16')]=_0x8ab843['queue'];return client[_0x590b('0x2')]('MoveContactManagedDialer',{'body':_0x8ab843,'options':{'where':{'ContactId':_0x8ab843[_0x590b('0x9')],'ListId':_0x8ab843[_0x590b('0x17')],'VoiceQueueId':_0x8ab843['VoiceQueueId'],'CampaignId':_0x8ab843['CampaignId'],'active':_0x2b8ea0?undefined:!![]}},'log':_0x590b('0x18')});};exports[_0x590b('0x19')]=function(_0x52bdad){return client[_0x590b('0x2')](_0x590b('0x1a'),{'options':{'where':{'VoiceQueueId':_0x52bdad['id']?_0x52bdad['id']||null:null}},'log':'countReScheduled'});};exports['getContactPreview']=function(_0x26f073){return function(){return client['Request'](_0x590b('0x1b'),{'options':{'where':{'id':_0x26f073},'include':[{'model':'CmContact','as':'Contact'},{'model':_0x590b('0x1c'),'as':_0x590b('0x1d'),'attributes':['id','name']},{'model':_0x590b('0x1e'),'as':_0x590b('0x1f'),'attributes':['id',_0x590b('0x20')]}],'raw':!![]},'log':_0x590b('0x4')});};};exports[_0x590b('0x21')]=function(_0x5c5903,_0x32d355,_0xd96ca3){return client[_0x590b('0x2')](_0x590b('0x5'),{'body':_0x5c5903,'options':{'where':{'id':_0x32d355},'limit':_0xd96ca3},'log':_0x590b('0x5')});};exports[_0x590b('0x22')]=function(_0x5ee979,_0x1dfce0){return function(){return client['Request'](_0x590b('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x5ee979,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x590b('0x6')](_0x590b('0x7'))},'UserId':{'$in':_0x1dfce0}},'order':[[_0x590b('0x10'),'DESC'],[_0x590b('0x12'),'DESC'],['id',_0x590b('0x13')]],'include':[{'model':_0x590b('0x24'),'as':_0x590b('0x3')},{'model':_0x590b('0x1c'),'as':_0x590b('0x1d'),'attributes':['id','name',_0x590b('0x25')]}],'group':_0x590b('0x26'),'raw':!![]},'log':_0x590b('0xf')});};};exports[_0x590b('0x27')]=function(_0x5efcae,_0x5c28ec){return client[_0x590b('0x2')](_0x590b('0x28'),{'body':_0x5efcae,'options':_0x5c28ec||{},'log':_0x590b('0x28')});};exports[_0x590b('0x29')]=function(_0x525f95,_0x557cf2,_0x2387f7){return function(){return client['Request'](_0x590b('0x2a'),{'body':{'where':{'voiceQueueIds':_0x525f95,'interval':_0x557cf2,'availableAgentsIds':_0x2387f7}},'log':_0x590b('0x29')});};};
\ No newline at end of file
index 2e8a907..c0c8bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eee=['VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','IncrementPreviewCounters','../client','verifyAdditionalPhones','Request'];(function(_0x4aa875,_0x45f71e){var _0x43518c=function(_0xde1ca7){while(--_0xde1ca7){_0x4aa875['push'](_0x4aa875['shift']());}};_0x43518c(++_0x45f71e);}(_0x4eee,0x6d));var _0xe4ee=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x4eee[_0x102977];return _0x15c466;};'use strict';var client=require(_0xe4ee('0x0'));exports[_0xe4ee('0x1')]=function(_0x114e91,_0x58b860,_0x4ce1a7){return client[_0xe4ee('0x2')](_0xe4ee('0x3'),{'body':_0x114e91,'reason':_0x58b860,'entity':_0x4ce1a7,'log':'VerifyAdditionalPhones'});};exports[_0xe4ee('0x4')]=function(_0x3ef9ce,_0x1ef5d8,_0x5a3985){return client[_0xe4ee('0x2')](_0xe4ee('0x5'),{'body':_0x3ef9ce,'duration':_0x1ef5d8,'waitTime':_0x5a3985,'log':'SwapAdditionalPhones'});};exports['incrementPreviewCounters']=function(_0x4893b6){return function(){return client['Request']('IncrementPreviewCounters',{'body':_0x4893b6,'log':_0xe4ee('0x6')});};};
\ No newline at end of file
+var _0xe953=['../client','Request','VerifyAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters'];(function(_0x171e46,_0xc36ce0){var _0x18fe9d=function(_0x3916f3){while(--_0x3916f3){_0x171e46['push'](_0x171e46['shift']());}};_0x18fe9d(++_0xc36ce0);}(_0xe953,0x13e));var _0x3e95=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xe953[_0x119705];return _0x2affc2;};'use strict';var client=require(_0x3e95('0x0'));exports['verifyAdditionalPhones']=function(_0x4809ef,_0x12fe11,_0x8a286){return client[_0x3e95('0x1')](_0x3e95('0x2'),{'body':_0x4809ef,'reason':_0x12fe11,'entity':_0x8a286,'log':_0x3e95('0x2')});};exports['swapAdditionalPhones']=function(_0x55c405,_0xc624d8,_0xd51783){return client[_0x3e95('0x1')](_0x3e95('0x3'),{'body':_0x55c405,'duration':_0xc624d8,'waitTime':_0xd51783,'log':_0x3e95('0x3')});};exports[_0x3e95('0x4')]=function(_0xba81d9){return function(){return client['Request']('IncrementPreviewCounters',{'body':_0xba81d9,'log':_0x3e95('0x5')});};};
\ No newline at end of file
index f38ef07..d406405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfccf=['checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId','checkIsBlackListIvr','CampaignId','phone','GetCmHopperBlackIvr','../client'];(function(_0x5247b7,_0x5893dc){var _0x582e8b=function(_0x199252){while(--_0x199252){_0x5247b7['push'](_0x5247b7['shift']());}};_0x582e8b(++_0x5893dc);}(_0xfccf,0xaa));var _0xffcc=function(_0x47a336,_0x47e8ab){_0x47a336=_0x47a336-0x0;var _0x1dff25=_0xfccf[_0x47a336];return _0x1dff25;};'use strict';var client=require(_0xffcc('0x0'));exports[_0xffcc('0x1')]=function(_0x135d48){return client[_0xffcc('0x2')](_0xffcc('0x3'),{'options':{'where':{'VoiceQueueId':_0x135d48[_0xffcc('0x4')],'phone':_0x135d48['phone']},'raw':![]},'log':'GetCmHopperBlack'});};exports[_0xffcc('0x5')]=function(_0x164660){return function(){return client[_0xffcc('0x2')](_0xffcc('0x3'),{'options':{'where':{'CampaignId':_0x164660[_0xffcc('0x6')],'phone':_0x164660[_0xffcc('0x7')]},'raw':![]},'log':_0xffcc('0x8')});};};
\ No newline at end of file
+var _0x569b=['checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId'];(function(_0x171651,_0xe35f1){var _0x5efa1c=function(_0x35b860){while(--_0x35b860){_0x171651['push'](_0x171651['shift']());}};_0x5efa1c(++_0xe35f1);}(_0x569b,0x173));var _0xb569=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x569b[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xb569('0x0'));exports[_0xb569('0x1')]=function(_0x4fa17e){return client[_0xb569('0x2')](_0xb569('0x3'),{'options':{'where':{'VoiceQueueId':_0x4fa17e[_0xb569('0x4')],'phone':_0x4fa17e['phone']},'raw':![]},'log':_0xb569('0x3')});};exports[_0xb569('0x5')]=function(_0x5eb2eb){return function(){return client[_0xb569('0x2')](_0xb569('0x3'),{'options':{'where':{'CampaignId':_0x5eb2eb[_0xb569('0x6')],'phone':_0x5eb2eb['phone']},'raw':![]},'log':_0xb569('0x7')});};};
\ No newline at end of file
index b2f8e5d..ad9d3c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2678=['Request','CreateCmHopperFinal','../client','createContact','campaign'];(function(_0x5ed606,_0x440b06){var _0x548c89=function(_0x28c15e){while(--_0x28c15e){_0x5ed606['push'](_0x5ed606['shift']());}};_0x548c89(++_0x440b06);}(_0x2678,0x115));var _0x8267=function(_0x1eb452,_0x489819){_0x1eb452=_0x1eb452-0x0;var _0x2a7e3f=_0x2678[_0x1eb452];return _0x2a7e3f;};'use strict';var client=require(_0x8267('0x0'));exports[_0x8267('0x1')]=function(_0x58d400){return function(){_0x58d400[_0x8267('0x2')]=_0x58d400['queue'];return client[_0x8267('0x3')](_0x8267('0x4'),{'body':_0x58d400,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0xf3fc=['../client','createContact','CreateCmHopperFinal'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0xf3fc,0x7b));var _0xcf3f=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf3fc[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0xcf3f('0x0'));exports[_0xcf3f('0x1')]=function(_0x5c50b3){return function(){_0x5c50b3['campaign']=_0x5c50b3['queue'];return client['Request'](_0xcf3f('0x2'),{'body':_0x5c50b3,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
index 5e46c04..5fec227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdb1=['day','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivr','../client','moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','AvgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','startOf'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0xfdb1,0x1cc));var _0x1fdb=function(_0x391ffe,_0x354a51){_0x391ffe=_0x391ffe-0x0;var _0x1a6f61=_0xfdb1[_0x391ffe];return _0x1a6f61;};'use strict';var client=require(_0x1fdb('0x0'));var moment=require(_0x1fdb('0x1'));exports[_0x1fdb('0x2')]=function(_0x18b685){_0x18b685[_0x1fdb('0x3')]=_0x18b685[_0x1fdb('0x4')];return client[_0x1fdb('0x5')](_0x1fdb('0x6'),{'body':_0x18b685,'log':'CreateCmHopperHistory'});};exports['avgHandleTime']=function(_0x52054f){return client[_0x1fdb('0x5')](_0x1fdb('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x1fdb('0x8')](_0x52054f,_0x1fdb('0x9'))[_0x1fdb('0xa')](_0x1fdb('0xb')),moment()[_0x1fdb('0xa')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':_0x1fdb('0xc')});};exports[_0x1fdb('0xd')]=function(){return function(){return client[_0x1fdb('0x5')]('GetVoiceQueueHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x1fdb('0xe')](_0x1fdb('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x1fdb('0xf'))[_0x1fdb('0xa')](_0x1fdb('0xb'))]},'campaigntype':'queue'},'raw':![]},'log':_0x1fdb('0x10')});};};exports['getCampaignHopperHistory']=function(){return function(){return client[_0x1fdb('0x5')](_0x1fdb('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x1fdb('0xe')](_0x1fdb('0xf'))['format'](_0x1fdb('0xb')),moment()['endOf']('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x1fdb('0x12')},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
+var _0x3ae4=['ivr','moment','createHistory','queue','Request','CreateCmHopperHistory','avgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','day','getCampaignHopperHistory','GetCampaignHopperHistory','endOf'];(function(_0x26fa66,_0x48d8bc){var _0x1691af=function(_0x19dd41){while(--_0x19dd41){_0x26fa66['push'](_0x26fa66['shift']());}};_0x1691af(++_0x48d8bc);}(_0x3ae4,0x166));var _0x43ae=function(_0x413953,_0xbe7e74){_0x413953=_0x413953-0x0;var _0x5511a9=_0x3ae4[_0x413953];return _0x5511a9;};'use strict';var client=require('../client');var moment=require(_0x43ae('0x0'));exports[_0x43ae('0x1')]=function(_0x43fdbe){_0x43fdbe['campaign']=_0x43fdbe[_0x43ae('0x2')];return client[_0x43ae('0x3')](_0x43ae('0x4'),{'body':_0x43fdbe,'log':_0x43ae('0x4')});};exports[_0x43ae('0x5')]=function(_0x499f94){return client[_0x43ae('0x3')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x43ae('0x6')](_0x499f94,_0x43ae('0x7'))[_0x43ae('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x43ae('0x8')](_0x43ae('0x9'))]}},'raw':![]},'log':_0x43ae('0xa')});};exports['getVoiceQueueHopperHistory']=function(){return function(){return client[_0x43ae('0x3')](_0x43ae('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x43ae('0xc'))[_0x43ae('0x8')](_0x43ae('0x9')),moment()['endOf'](_0x43ae('0xc'))[_0x43ae('0x8')](_0x43ae('0x9'))]},'campaigntype':'queue'},'raw':![]},'log':_0x43ae('0xb')});};};exports[_0x43ae('0xd')]=function(){return function(){return client['Request'](_0x43ae('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0x43ae('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x43ae('0xf')]('day')[_0x43ae('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x43ae('0x10')},'raw':![]},'log':_0x43ae('0xe')});};};
\ No newline at end of file
index cd64b30..b33d361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa958=['tech','TrunkId','key','Trunk','callerid','active','getFaxAccount','NotifyFaxAccount','../client','Request','GetFaxAccount','name','description','ecm','headerinfo','maxrate','modem','gateway','faxdetect','t38timeout'];(function(_0xea46d,_0x254082){var _0x1fa4c5=function(_0x4d7817){while(--_0x4d7817){_0xea46d['push'](_0xea46d['shift']());}};_0x1fa4c5(++_0x254082);}(_0xa958,0x94));var _0x8a95=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xa958[_0x21549c];return _0x426cbd;};'use strict';var client=require(_0x8a95('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x8a95('0x1')](_0x8a95('0x2'),{'options':{'raw':![],'attributes':['id',_0x8a95('0x3'),_0x8a95('0x4'),_0x8a95('0x5'),_0x8a95('0x6'),'localstationid','minrate',_0x8a95('0x7'),_0x8a95('0x8'),_0x8a95('0x9'),_0x8a95('0xa'),_0x8a95('0xb'),_0x8a95('0xc'),_0x8a95('0xd'),'ListId',_0x8a95('0xe')],'include':[{'model':_0x8a95('0xf'),'as':_0x8a95('0xf'),'attributes':['id',_0x8a95('0x3'),_0x8a95('0x10'),_0x8a95('0x11')]}]},'log':_0x8a95('0x12')});};};exports['notify']=function(_0x27dfce,_0x98e81c){return client['Request'](_0x8a95('0x13'),{'account':{'id':_0x27dfce},'body':_0x98e81c,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0x6d0c=['../client','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','maxrate','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount'];(function(_0x39f469,_0x1b323d){var _0x3fabf8=function(_0x455665){while(--_0x455665){_0x39f469['push'](_0x39f469['shift']());}};_0x3fabf8(++_0x1b323d);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x417ed5,_0x4a9a0e){_0x417ed5=_0x417ed5-0x0;var _0x3539d8=_0x6d0c[_0x417ed5];return _0x3539d8;};'use strict';var client=require(_0xc6d0('0x0'));exports[_0xc6d0('0x1')]=function(){return function(){return client[_0xc6d0('0x2')](_0xc6d0('0x3'),{'options':{'raw':![],'attributes':['id',_0xc6d0('0x4'),_0xc6d0('0x5'),'ecm',_0xc6d0('0x6'),'localstationid','minrate',_0xc6d0('0x7'),'modem','gateway',_0xc6d0('0x8'),_0xc6d0('0x9'),_0xc6d0('0xa'),_0xc6d0('0xb'),_0xc6d0('0xc'),_0xc6d0('0xd')],'include':[{'model':_0xc6d0('0xe'),'as':_0xc6d0('0xe'),'attributes':['id',_0xc6d0('0x4'),_0xc6d0('0xf'),_0xc6d0('0x10')]}]},'log':_0xc6d0('0x11')});};};exports[_0xc6d0('0x12')]=function(_0x395085,_0x7c3cd7){return client[_0xc6d0('0x2')](_0xc6d0('0x13'),{'account':{'id':_0x395085},'body':_0x7c3cd7,'log':_0xc6d0('0x13')});};
\ No newline at end of file
index 77ea6a8..7c6f268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc147=['Request','UpdateFaxMessage','update'];(function(_0x4b78f6,_0x1f8628){var _0x301649=function(_0xefa743){while(--_0xefa743){_0x4b78f6['push'](_0x4b78f6['shift']());}};_0x301649(++_0x1f8628);}(_0xc147,0xdd));var _0x7c14=function(_0x274410,_0x537586){_0x274410=_0x274410-0x0;var _0x578e69=_0xc147[_0x274410];return _0x578e69;};'use strict';var client=require('../client');exports[_0x7c14('0x0')]=function(_0x1a707a,_0x2bdcd8){return client[_0x7c14('0x1')](_0x7c14('0x2'),{'body':_0x2bdcd8,'options':{'where':{'AttachmentId':_0x1a707a}},'log':_0x7c14('0x2')});};
\ No newline at end of file
+var _0xb54c=['../client','update','Request'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb54c,0xde));var _0xcb54=function(_0x416926,_0x452b77){_0x416926=_0x416926-0x0;var _0x2c0f66=_0xb54c[_0x416926];return _0x2c0f66;};'use strict';var client=require(_0xcb54('0x0'));exports[_0xcb54('0x1')]=function(_0x5e7a2f,_0x4f8b96){return client[_0xcb54('0x2')]('UpdateFaxMessage',{'body':_0x4f8b96,'options':{'where':{'AttachmentId':_0x5e7a2f}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index 6ea2aac..3d22385 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99ad=['authType','type','DeskConfiguration','DeskField','content','Variable','Descriptions','key','keyType','keyContent','variableName','idField','nameField','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','name','description','username','password','remoteUri'];(function(_0x6dfa2e,_0x4887a8){var _0x1f4d26=function(_0x3ad1c5){while(--_0x3ad1c5){_0x6dfa2e['push'](_0x6dfa2e['shift']());}};_0x1f4d26(++_0x4887a8);}(_0x99ad,0xd0));var _0xd99a=function(_0x4adf09,_0x131b95){_0x4adf09=_0x4adf09-0x0;var _0x41338e=_0x99ad[_0x4adf09];return _0x41338e;};'use strict';var client=require(_0xd99a('0x0'));exports[_0xd99a('0x1')]=function(){return function(_0x169968){return client[_0xd99a('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0xd99a('0x3'),_0xd99a('0x4'),_0xd99a('0x5'),_0xd99a('0x6'),_0xd99a('0x7'),_0xd99a('0x8'),_0xd99a('0x9'),'serverUrl'],'include':[{'model':_0xd99a('0xa'),'as':'Configurations','attributes':['id',_0xd99a('0x3')],'include':[{'model':_0xd99a('0xb'),'as':'Subjects','attributes':['id',_0xd99a('0x9'),_0xd99a('0xc'),'variableName'],'include':[{'model':_0xd99a('0xd'),'as':_0xd99a('0xd'),'attributes':['id',_0xd99a('0x3')]}]},{'model':_0xd99a('0xb'),'as':_0xd99a('0xe'),'attributes':['id',_0xd99a('0x9'),_0xd99a('0xc'),_0xd99a('0xf'),_0xd99a('0x10'),_0xd99a('0x11'),_0xd99a('0x12')],'include':[{'model':_0xd99a('0xd'),'as':_0xd99a('0xd'),'attributes':['id',_0xd99a('0x3')]}]},{'model':_0xd99a('0xb'),'as':'Fields','attributes':['id',_0xd99a('0x9'),'content',_0xd99a('0x13'),_0xd99a('0x14'),'customField',_0xd99a('0x12')],'include':[{'model':_0xd99a('0xd'),'as':_0xd99a('0xd'),'attributes':['id',_0xd99a('0x3')]}]},{'model':_0xd99a('0x15'),'as':_0xd99a('0x16'),'attributes':['id',_0xd99a('0x3')]}]}]},'log':_0xd99a('0x17')});};};
\ No newline at end of file
+var _0xcaef=['Request','GetDeskAccount','name','description','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','content','Variable','Descriptions','key','keyContent','variableName','Fields','idField','nameField','customField','Tag','getDeskAccounts'];(function(_0x409682,_0x370090){var _0x1ee901=function(_0xe93c56){while(--_0xe93c56){_0x409682['push'](_0x409682['shift']());}};_0x1ee901(++_0x370090);}(_0xcaef,0xa7));var _0xfcae=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xcaef[_0xd09668];return _0x68726;};'use strict';var client=require('../../client');exports[_0xfcae('0x0')]=function(){return function(_0x30d3e2){return client[_0xfcae('0x1')](_0xfcae('0x2'),{'options':{'raw':![],'attributes':['id',_0xfcae('0x3'),_0xfcae('0x4'),'username',_0xfcae('0x5'),_0xfcae('0x6'),_0xfcae('0x7'),_0xfcae('0x8'),_0xfcae('0x9')],'include':[{'model':_0xfcae('0xa'),'as':_0xfcae('0xb'),'attributes':['id',_0xfcae('0x3')],'include':[{'model':_0xfcae('0xc'),'as':'Subjects','attributes':['id',_0xfcae('0x8'),_0xfcae('0xd'),'variableName'],'include':[{'model':_0xfcae('0xe'),'as':_0xfcae('0xe'),'attributes':['id',_0xfcae('0x3')]}]},{'model':_0xfcae('0xc'),'as':_0xfcae('0xf'),'attributes':['id','type','content',_0xfcae('0x10'),'keyType',_0xfcae('0x11'),_0xfcae('0x12')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xfcae('0x3')]}]},{'model':_0xfcae('0xc'),'as':_0xfcae('0x13'),'attributes':['id','type',_0xfcae('0xd'),_0xfcae('0x14'),_0xfcae('0x15'),_0xfcae('0x16'),_0xfcae('0x12')],'include':[{'model':_0xfcae('0xe'),'as':'Variable','attributes':['id',_0xfcae('0x3')]}]},{'model':_0xfcae('0x17'),'as':'Tags','attributes':['id',_0xfcae('0x3')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
index d72faa0..27253d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd523=['Fields','type','idField','nameField','customField','CloudProvider','data5','data7','GetDynamics365Account','../../client','getDynamics365Accounts','Request','name','username','password','tenantId','clientId','clientSecret','serverUrl','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','openNewTab','Dynamics365Field','Subjects','content','variableName','Variable','Descriptions','key','keyType'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xd523,0x153));var _0x3d52=function(_0x5ee4b2,_0x10f363){_0x5ee4b2=_0x5ee4b2-0x0;var _0xa5a78=_0xd523[_0x5ee4b2];return _0xa5a78;};'use strict';var client=require(_0x3d52('0x0'));exports[_0x3d52('0x1')]=function(){return function(_0x3d35b0){return client[_0x3d52('0x2')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x3d52('0x3'),_0x3d52('0x4'),_0x3d52('0x5'),'remoteUri',_0x3d52('0x6'),_0x3d52('0x7'),_0x3d52('0x8'),_0x3d52('0x9'),'description','modernAuthentication'],'include':[{'model':_0x3d52('0xa'),'as':_0x3d52('0xb'),'attributes':['id',_0x3d52('0x3'),_0x3d52('0xc'),_0x3d52('0xd'),_0x3d52('0xe'),_0x3d52('0xf')],'include':[{'model':_0x3d52('0x10'),'as':_0x3d52('0x11'),'attributes':['id','type',_0x3d52('0x12'),_0x3d52('0x13')],'include':[{'model':_0x3d52('0x14'),'as':_0x3d52('0x14'),'attributes':['id',_0x3d52('0x3')]}]},{'model':'Dynamics365Field','as':_0x3d52('0x15'),'attributes':['id','type','content',_0x3d52('0x16'),_0x3d52('0x17'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0x3d52('0x14'),'attributes':['id',_0x3d52('0x3')]}]},{'model':_0x3d52('0x10'),'as':_0x3d52('0x18'),'attributes':['id',_0x3d52('0x19'),_0x3d52('0x12'),_0x3d52('0x1a'),_0x3d52('0x1b'),_0x3d52('0x1c'),_0x3d52('0x13')],'include':[{'model':_0x3d52('0x14'),'as':_0x3d52('0x14'),'attributes':['id',_0x3d52('0x3')]}]}]},{'model':_0x3d52('0x1d'),'as':_0x3d52('0x1d'),'attributes':['id','data2',_0x3d52('0x1e'),_0x3d52('0x1f')]}]},'log':_0x3d52('0x20')});};};
\ No newline at end of file
+var _0xcf66=['data7','../../client','getDynamics365Accounts','GetDynamics365Account','name','remoteUri','tenantId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType','moduleCreate','additionalSearchContact','type','variableName','Variable','content','key','keyType','keyContent','Fields','idField','nameField','customField','CloudProvider','data2'];(function(_0x41fdcc,_0xef343d){var _0x11db4a=function(_0x514907){while(--_0x514907){_0x41fdcc['push'](_0x41fdcc['shift']());}};_0x11db4a(++_0xef343d);}(_0xcf66,0x71));var _0x6cf6=function(_0x125ba9,_0x222a6f){_0x125ba9=_0x125ba9-0x0;var _0x1750aa=_0xcf66[_0x125ba9];return _0x1750aa;};'use strict';var client=require(_0x6cf6('0x0'));exports[_0x6cf6('0x1')]=function(){return function(_0x3ec413){return client['Request'](_0x6cf6('0x2'),{'options':{'raw':![],'attributes':['id',_0x6cf6('0x3'),'username','password',_0x6cf6('0x4'),_0x6cf6('0x5'),'clientId',_0x6cf6('0x6'),_0x6cf6('0x7'),_0x6cf6('0x8'),'modernAuthentication'],'include':[{'model':_0x6cf6('0x9'),'as':_0x6cf6('0xa'),'attributes':['id',_0x6cf6('0x3'),_0x6cf6('0xb'),_0x6cf6('0xc'),_0x6cf6('0xd'),'openNewTab'],'include':[{'model':'Dynamics365Field','as':'Subjects','attributes':['id',_0x6cf6('0xe'),'content',_0x6cf6('0xf')],'include':[{'model':_0x6cf6('0x10'),'as':_0x6cf6('0x10'),'attributes':['id',_0x6cf6('0x3')]}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id','type',_0x6cf6('0x11'),_0x6cf6('0x12'),_0x6cf6('0x13'),_0x6cf6('0x14'),_0x6cf6('0xf')],'include':[{'model':_0x6cf6('0x10'),'as':'Variable','attributes':['id',_0x6cf6('0x3')]}]},{'model':'Dynamics365Field','as':_0x6cf6('0x15'),'attributes':['id',_0x6cf6('0xe'),'content',_0x6cf6('0x16'),_0x6cf6('0x17'),_0x6cf6('0x18'),_0x6cf6('0xf')],'include':[{'model':_0x6cf6('0x10'),'as':_0x6cf6('0x10'),'attributes':['id',_0x6cf6('0x3')]}]}]},{'model':_0x6cf6('0x19'),'as':_0x6cf6('0x19'),'attributes':['id',_0x6cf6('0x1a'),'data5',_0x6cf6('0x1b')]}]},'log':_0x6cf6('0x2')});};};
\ No newline at end of file
index abe4ea3..c7bf86d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0901=['../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','content','variableName','Variable','Descriptions','type','keyType','Fields','idField','nameField','customField'];(function(_0x21eed4,_0x3d90df){var _0x295f53=function(_0x32daef){while(--_0x32daef){_0x21eed4['push'](_0x21eed4['shift']());}};_0x295f53(++_0x3d90df);}(_0x0901,0x134));var _0x1090=function(_0x22603b,_0x10d113){_0x22603b=_0x22603b-0x0;var _0x393471=_0x0901[_0x22603b];return _0x393471;};'use strict';var client=require(_0x1090('0x0'));exports[_0x1090('0x1')]=function(){return function(_0x42b657){return client[_0x1090('0x2')](_0x1090('0x3'),{'options':{'raw':![],'attributes':['id',_0x1090('0x4'),'username','apiKey',_0x1090('0x5'),_0x1090('0x6')],'include':[{'model':_0x1090('0x7'),'as':_0x1090('0x8'),'attributes':['id',_0x1090('0x4')],'include':[{'model':_0x1090('0x9'),'attributes':['id','name']},{'model':_0x1090('0xa'),'as':_0x1090('0xb'),'attributes':['id','type',_0x1090('0xc'),_0x1090('0xd')],'include':[{'model':_0x1090('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':'FreshdeskField','as':_0x1090('0xf'),'attributes':['id',_0x1090('0x10'),_0x1090('0xc'),'key',_0x1090('0x11'),'keyContent','variableName'],'include':[{'model':_0x1090('0xe'),'as':_0x1090('0xe'),'attributes':['id',_0x1090('0x4')]}]},{'model':_0x1090('0xa'),'as':_0x1090('0x12'),'attributes':['id',_0x1090('0x10'),_0x1090('0xc'),_0x1090('0x13'),_0x1090('0x14'),_0x1090('0x15'),_0x1090('0xd')],'include':[{'model':_0x1090('0xe'),'as':_0x1090('0xe'),'attributes':['id','name']}]}]}]},'log':_0x1090('0x3')});};};
\ No newline at end of file
+var _0x8b35=['FreshdeskField','Fields','idField','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','name','type','content','variableName','Variable','Descriptions','key','keyType','keyContent'];(function(_0x132fad,_0x442482){var _0x58b453=function(_0xc4a03f){while(--_0xc4a03f){_0x132fad['push'](_0x132fad['shift']());}};_0x58b453(++_0x442482);}(_0x8b35,0x17a));var _0x58b3=function(_0x466902,_0x3abab){_0x466902=_0x466902-0x0;var _0x1f65ee=_0x8b35[_0x466902];return _0x1f65ee;};'use strict';var client=require(_0x58b3('0x0'));exports[_0x58b3('0x1')]=function(){return function(_0x3e264c){return client[_0x58b3('0x2')](_0x58b3('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x58b3('0x4'),_0x58b3('0x5'),_0x58b3('0x6'),_0x58b3('0x7')],'include':[{'model':_0x58b3('0x8'),'as':'Configurations','attributes':['id',_0x58b3('0x9')],'include':[{'model':'Tag','attributes':['id',_0x58b3('0x9')]},{'model':'FreshdeskField','as':'Subjects','attributes':['id',_0x58b3('0xa'),_0x58b3('0xb'),_0x58b3('0xc')],'include':[{'model':_0x58b3('0xd'),'as':_0x58b3('0xd'),'attributes':['id',_0x58b3('0x9')]}]},{'model':'FreshdeskField','as':_0x58b3('0xe'),'attributes':['id',_0x58b3('0xa'),'content',_0x58b3('0xf'),_0x58b3('0x10'),_0x58b3('0x11'),'variableName'],'include':[{'model':_0x58b3('0xd'),'as':'Variable','attributes':['id',_0x58b3('0x9')]}]},{'model':_0x58b3('0x12'),'as':_0x58b3('0x13'),'attributes':['id',_0x58b3('0xa'),_0x58b3('0xb'),_0x58b3('0x14'),_0x58b3('0x15'),'customField',_0x58b3('0xc')],'include':[{'model':_0x58b3('0xd'),'as':'Variable','attributes':['id',_0x58b3('0x9')]}]}]}]},'log':_0x58b3('0x3')});};};
\ No newline at end of file
index 80c7538..78cd3dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['variableName','Variable','FreshsalesField','Descriptions','keyType','keyContent','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','apiKey','remoteUri','FreshsalesConfiguration','Configurations','Subjects','type','content'];(function(_0x57a4d0,_0xa6e6b){var _0xaaadee=function(_0x544da2){while(--_0x544da2){_0x57a4d0['push'](_0x57a4d0['shift']());}};_0xaaadee(++_0xa6e6b);}(_0x2ef3,0xba));var _0x32ef=function(_0x11cb50,_0x324785){_0x11cb50=_0x11cb50-0x0;var _0x47d7b1=_0x2ef3[_0x11cb50];return _0x47d7b1;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(_0x47513a){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),'username',_0x32ef('0x5'),_0x32ef('0x6'),'serverUrl'],'include':[{'model':_0x32ef('0x7'),'as':_0x32ef('0x8'),'attributes':['id','name'],'include':[{'model':'FreshsalesField','as':_0x32ef('0x9'),'attributes':['id',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':_0x32ef('0xd'),'attributes':['id',_0x32ef('0x4')]}]},{'model':_0x32ef('0xe'),'as':_0x32ef('0xf'),'attributes':['id',_0x32ef('0xa'),'content','key',_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0xc')],'include':[{'model':_0x32ef('0xd'),'as':'Variable','attributes':['id',_0x32ef('0x4')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0xa899=['variableName','../../client','getFreshsalesAccounts','GetFreshsalesAccount','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','Variable','Descriptions','key','keyType','keyContent'];(function(_0x3072a1,_0x2c1dec){var _0x19292e=function(_0x5c9329){while(--_0x5c9329){_0x3072a1['push'](_0x3072a1['shift']());}};_0x19292e(++_0x2c1dec);}(_0xa899,0x155));var _0x9a89=function(_0x2e53e1,_0x12aed1){_0x2e53e1=_0x2e53e1-0x0;var _0x3a23de=_0xa899[_0x2e53e1];return _0x3a23de;};'use strict';var client=require(_0x9a89('0x0'));exports[_0x9a89('0x1')]=function(){return function(_0x2134fe){return client['Request'](_0x9a89('0x2'),{'options':{'raw':![],'attributes':['id',_0x9a89('0x3'),_0x9a89('0x4'),_0x9a89('0x5'),_0x9a89('0x6'),_0x9a89('0x7')],'include':[{'model':_0x9a89('0x8'),'as':_0x9a89('0x9'),'attributes':['id',_0x9a89('0x3')],'include':[{'model':_0x9a89('0xa'),'as':_0x9a89('0xb'),'attributes':['id',_0x9a89('0xc'),_0x9a89('0xd'),'variableName'],'include':[{'model':'Variable','as':_0x9a89('0xe'),'attributes':['id',_0x9a89('0x3')]}]},{'model':'FreshsalesField','as':_0x9a89('0xf'),'attributes':['id','type',_0x9a89('0xd'),_0x9a89('0x10'),_0x9a89('0x11'),_0x9a89('0x12'),_0x9a89('0x13')],'include':[{'model':_0x9a89('0xe'),'as':_0x9a89('0xe'),'attributes':['id','name']}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
index ff0051f..d42b95b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c4d=['password','remoteUri','clientId','clientSecret','securityToken','serverUrl','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','name'];(function(_0x3792e6,_0x32bd91){var _0x441e44=function(_0x357478){while(--_0x357478){_0x3792e6['push'](_0x3792e6['shift']());}};_0x441e44(++_0x32bd91);}(_0x4c4d,0x1a2));var _0xd4c4=function(_0x55a514,_0x34b64b){_0x55a514=_0x55a514-0x0;var _0x2e501b=_0x4c4d[_0x55a514];return _0x2e501b;};'use strict';var client=require(_0xd4c4('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x4ccde2){return client['Request']('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0xd4c4('0x1'),'username',_0xd4c4('0x2'),_0xd4c4('0x3'),_0xd4c4('0x4'),_0xd4c4('0x5'),_0xd4c4('0x6'),_0xd4c4('0x7'),'type'],'include':[{'model':_0xd4c4('0x8'),'as':_0xd4c4('0x9'),'attributes':['id',_0xd4c4('0x1'),_0xd4c4('0xa'),_0xd4c4('0xb'),'ticketType',_0xd4c4('0xc'),_0xd4c4('0xd'),_0xd4c4('0xe'),_0xd4c4('0xf')],'include':[{'model':_0xd4c4('0x10'),'as':_0xd4c4('0x11'),'include':[{'model':_0xd4c4('0x12'),'as':_0xd4c4('0x12'),'attributes':['id',_0xd4c4('0x1')]}]},{'model':'SalesforceField','as':_0xd4c4('0x13'),'include':[{'model':'Variable','as':_0xd4c4('0x12'),'attributes':['id',_0xd4c4('0x1')]}]},{'model':'SalesforceField','as':_0xd4c4('0x14'),'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x5942=['Configurations','moduleCreate','ticketType','additionalSearchAccount','additionalSearchLead','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','remoteUri','clientId','clientSecret','securityToken','SalesforceConfiguration'];(function(_0x52f04a,_0x2d093b){var _0x1cb057=function(_0x78883e){while(--_0x78883e){_0x52f04a['push'](_0x52f04a['shift']());}};_0x1cb057(++_0x2d093b);}(_0x5942,0x16a));var _0x2594=function(_0x24244b,_0x15bf86){_0x24244b=_0x24244b-0x0;var _0x44073f=_0x5942[_0x24244b];return _0x44073f;};'use strict';var client=require(_0x2594('0x0'));exports[_0x2594('0x1')]=function(){return function(_0xd22294){return client[_0x2594('0x2')](_0x2594('0x3'),{'options':{'raw':![],'attributes':['id',_0x2594('0x4'),_0x2594('0x5'),_0x2594('0x6'),_0x2594('0x7'),_0x2594('0x8'),_0x2594('0x9'),_0x2594('0xa'),'serverUrl','type'],'include':[{'model':_0x2594('0xb'),'as':_0x2594('0xc'),'attributes':['id',_0x2594('0x4'),'moduleSearch',_0x2594('0xd'),_0x2594('0xe'),'leadId',_0x2594('0xf'),'additionalSearchContact',_0x2594('0x10')],'include':[{'model':_0x2594('0x11'),'as':_0x2594('0x12'),'include':[{'model':'Variable','as':_0x2594('0x13'),'attributes':['id',_0x2594('0x4')]}]},{'model':_0x2594('0x11'),'as':_0x2594('0x14'),'include':[{'model':'Variable','as':_0x2594('0x13'),'attributes':['id',_0x2594('0x4')]}]},{'model':_0x2594('0x11'),'as':_0x2594('0x15'),'include':[{'model':_0x2594('0x13'),'as':_0x2594('0x13'),'attributes':['id',_0x2594('0x4')]}]}]}]},'log':_0x2594('0x3')});};};
\ No newline at end of file
index cc28899..c3801e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['keyContent','Fields','content','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','name','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','variableName','Variable','Descriptions','type','key'];(function(_0x2dff94,_0x57289f){var _0x1bdabf=function(_0x5265a2){while(--_0x5265a2){_0x2dff94['push'](_0x2dff94['shift']());}};_0x1bdabf(++_0x57289f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(_0x40a0d0){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),'description','username','password',_0xac4a('0x5'),_0xac4a('0x6'),_0xac4a('0x7')],'include':[{'model':_0xac4a('0x8'),'as':_0xac4a('0x9'),'attributes':['id',_0xac4a('0x4')],'include':[{'model':_0xac4a('0xa'),'as':_0xac4a('0xb'),'attributes':['id','type','content',_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id','name']}]},{'model':_0xac4a('0xa'),'as':_0xac4a('0xe'),'attributes':['id',_0xac4a('0xf'),'content',_0xac4a('0x10'),'keyType',_0xac4a('0x11'),'variableName'],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]},{'model':'ServicenowField','as':_0xac4a('0x12'),'attributes':['id',_0xac4a('0xf'),_0xac4a('0x13'),_0xac4a('0x14'),_0xac4a('0x15'),_0xac4a('0x16'),_0xac4a('0xc')],'include':[{'model':_0xac4a('0xd'),'as':_0xac4a('0xd'),'attributes':['id',_0xac4a('0x4')]}]}]}]},'log':_0xac4a('0x17')});};};
\ No newline at end of file
+var _0x0295=['name','content','Variable','Descriptions','type','keyType','keyContent','variableName','idField','nameField','customField','GetServicenowkAccount','../../client','Request','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations'];(function(_0x41cff5,_0x1ca091){var _0x3704ce=function(_0x5422ed){while(--_0x5422ed){_0x41cff5['push'](_0x41cff5['shift']());}};_0x3704ce(++_0x1ca091);}(_0x0295,0x1f0));var _0x5029=function(_0x17cffd,_0x2e92ca){_0x17cffd=_0x17cffd-0x0;var _0x54b404=_0x0295[_0x17cffd];return _0x54b404;};'use strict';var client=require(_0x5029('0x0'));exports['getServicenowAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5'),_0x5029('0x6'),_0x5029('0x7')],'include':[{'model':_0x5029('0x8'),'as':_0x5029('0x9'),'attributes':['id',_0x5029('0xa')],'include':[{'model':'ServicenowField','as':'Subjects','attributes':['id','type',_0x5029('0xb'),'variableName'],'include':[{'model':_0x5029('0xc'),'as':'Variable','attributes':['id',_0x5029('0xa')]}]},{'model':'ServicenowField','as':_0x5029('0xd'),'attributes':['id',_0x5029('0xe'),_0x5029('0xb'),'key',_0x5029('0xf'),_0x5029('0x10'),_0x5029('0x11')],'include':[{'model':'Variable','as':_0x5029('0xc'),'attributes':['id',_0x5029('0xa')]}]},{'model':'ServicenowField','as':'Fields','attributes':['id','type','content',_0x5029('0x12'),_0x5029('0x13'),_0x5029('0x14'),_0x5029('0x11')],'include':[{'model':_0x5029('0xc'),'as':_0x5029('0xc'),'attributes':['id',_0x5029('0xa')]}]}]}]},'log':_0x5029('0x15')});};};
\ No newline at end of file
index f876e14..0d7535c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0x3f994d,_0x249d72){var _0x5309b4=function(_0x545307){while(--_0x545307){_0x3f994d['push'](_0x3f994d['shift']());}};_0x5309b4(++_0x249d72);}(_0xdb28,0x106));var _0x8db2=function(_0x46669d,_0x3120be){_0x46669d=_0x46669d-0x0;var _0x2b4a03=_0xdb28[_0x46669d];return _0x2b4a03;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
+var _0x5f2f=['username','password','SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','variableName','Variable','Descriptions','key','Fields','content','idField','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbea58,_0x54e202){_0xbea58=_0xbea58-0x0;var _0x3e064d=_0x5f2f[_0xbea58];return _0x3e064d;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(_0x2dcf60){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),'remoteUri','serverUrl'],'include':[{'model':_0xf5f2('0x7'),'as':_0xf5f2('0x8'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xa'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id','name']}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xe'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xf'),'keyType','keyContent',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':'Variable','attributes':['id',_0xf5f2('0x4')]}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0x10'),'attributes':['id',_0xf5f2('0xb'),_0xf5f2('0x11'),_0xf5f2('0x12'),'nameField',_0xf5f2('0x13'),_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id',_0xf5f2('0x4')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
index 7ff49f9..1a1b1b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0160=['Variable','VtigerField','Descriptions','key','keyType','keyContent','Fields','idField','customField','GetVtigerAccount','../../client','Request','name','description','username','accessKey','serverUrl','VtigerConfiguration','Configurations','Subjects','type','content','variableName'];(function(_0x458833,_0x398f53){var _0x2283ba=function(_0x4c3bed){while(--_0x4c3bed){_0x458833['push'](_0x458833['shift']());}};_0x2283ba(++_0x398f53);}(_0x0160,0xab));var _0x0016=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x0160[_0x2c9b79];return _0x265032;};'use strict';var client=require(_0x0016('0x0'));exports['getVtigerAccounts']=function(){return function(_0x4fa09e){return client[_0x0016('0x1')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x0016('0x2'),_0x0016('0x3'),_0x0016('0x4'),_0x0016('0x5'),'remoteUri',_0x0016('0x6')],'include':[{'model':_0x0016('0x7'),'as':_0x0016('0x8'),'attributes':['id','name'],'include':[{'model':'VtigerField','as':_0x0016('0x9'),'attributes':['id',_0x0016('0xa'),_0x0016('0xb'),_0x0016('0xc')],'include':[{'model':_0x0016('0xd'),'as':_0x0016('0xd'),'attributes':['id',_0x0016('0x2')]}]},{'model':_0x0016('0xe'),'as':_0x0016('0xf'),'attributes':['id',_0x0016('0xa'),_0x0016('0xb'),_0x0016('0x10'),_0x0016('0x11'),_0x0016('0x12'),_0x0016('0xc')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':'VtigerField','as':_0x0016('0x13'),'attributes':['id',_0x0016('0xa'),_0x0016('0xb'),_0x0016('0x14'),'nameField',_0x0016('0x15'),_0x0016('0xc')],'include':[{'model':_0x0016('0xd'),'as':_0x0016('0xd'),'attributes':['id','name']}]}]}]},'log':_0x0016('0x16')});};};
\ No newline at end of file
+var _0xd0e6=['content','Variable','VtigerField','Descriptions','type','key','keyType','keyContent','variableName','Fields','nameField','customField','GetVtigerAccount','../../client','Request','name','description','username','accessKey','VtigerConfiguration','Configurations','Subjects'];(function(_0x311dcb,_0x3a299b){var _0x5e9922=function(_0x224944){while(--_0x224944){_0x311dcb['push'](_0x311dcb['shift']());}};_0x5e9922(++_0x3a299b);}(_0xd0e6,0xbd));var _0x6d0e=function(_0x2865c9,_0x575948){_0x2865c9=_0x2865c9-0x0;var _0x585985=_0xd0e6[_0x2865c9];return _0x585985;};'use strict';var client=require(_0x6d0e('0x0'));exports['getVtigerAccounts']=function(){return function(_0x2de9ff){return client[_0x6d0e('0x1')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x6d0e('0x2'),_0x6d0e('0x3'),_0x6d0e('0x4'),_0x6d0e('0x5'),'remoteUri','serverUrl'],'include':[{'model':_0x6d0e('0x6'),'as':_0x6d0e('0x7'),'attributes':['id','name'],'include':[{'model':'VtigerField','as':_0x6d0e('0x8'),'attributes':['id','type',_0x6d0e('0x9'),'variableName'],'include':[{'model':'Variable','as':_0x6d0e('0xa'),'attributes':['id','name']}]},{'model':_0x6d0e('0xb'),'as':_0x6d0e('0xc'),'attributes':['id',_0x6d0e('0xd'),_0x6d0e('0x9'),_0x6d0e('0xe'),_0x6d0e('0xf'),_0x6d0e('0x10'),_0x6d0e('0x11')],'include':[{'model':_0x6d0e('0xa'),'as':'Variable','attributes':['id',_0x6d0e('0x2')]}]},{'model':_0x6d0e('0xb'),'as':_0x6d0e('0x12'),'attributes':['id',_0x6d0e('0xd'),_0x6d0e('0x9'),'idField',_0x6d0e('0x13'),_0x6d0e('0x14'),_0x6d0e('0x11')],'include':[{'model':'Variable','as':_0x6d0e('0xa'),'attributes':['id',_0x6d0e('0x2')]}]}]}]},'log':_0x6d0e('0x15')});};};
\ No newline at end of file
index 921307b..9043868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd08=['getZendeskAccounts','Request','GetZendeskAccount','username','password','token','authType','serverUrl','type','ZendeskConfiguration','Configurations','Tag','Subjects','variableName','Variable','name','Descriptions','content','keyType','keyContent','ZendeskField','Fields','idField','nameField','customField'];(function(_0x247543,_0x476db6){var _0xede2f=function(_0x14c206){while(--_0x14c206){_0x247543['push'](_0x247543['shift']());}};_0xede2f(++_0x476db6);}(_0xcd08,0xe1));var _0x8cd0=function(_0x3f2441,_0x4f641f){_0x3f2441=_0x3f2441-0x0;var _0x377ad7=_0xcd08[_0x3f2441];return _0x377ad7;};'use strict';var client=require('../../client');exports[_0x8cd0('0x0')]=function(){return function(_0xa59e5b){return client[_0x8cd0('0x1')](_0x8cd0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x8cd0('0x3'),_0x8cd0('0x4'),_0x8cd0('0x5'),'remoteUri',_0x8cd0('0x6'),_0x8cd0('0x7'),_0x8cd0('0x8')],'include':[{'model':_0x8cd0('0x9'),'as':_0x8cd0('0xa'),'attributes':['id','name'],'include':[{'model':_0x8cd0('0xb'),'attributes':['id','name']},{'model':'ZendeskField','as':_0x8cd0('0xc'),'attributes':['id','type','content',_0x8cd0('0xd')],'include':[{'model':_0x8cd0('0xe'),'as':_0x8cd0('0xe'),'attributes':['id',_0x8cd0('0xf')]}]},{'model':'ZendeskField','as':_0x8cd0('0x10'),'attributes':['id',_0x8cd0('0x8'),_0x8cd0('0x11'),'key',_0x8cd0('0x12'),_0x8cd0('0x13'),_0x8cd0('0xd')],'include':[{'model':_0x8cd0('0xe'),'as':_0x8cd0('0xe'),'attributes':['id',_0x8cd0('0xf')]}]},{'model':_0x8cd0('0x14'),'as':_0x8cd0('0x15'),'attributes':['id','type','content',_0x8cd0('0x16'),_0x8cd0('0x17'),_0x8cd0('0x18'),'variableName'],'include':[{'model':_0x8cd0('0xe'),'as':_0x8cd0('0xe'),'attributes':['id',_0x8cd0('0xf')]}]}]}]},'log':_0x8cd0('0x2')});};};
\ No newline at end of file
+var _0x5dd7=['customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Tag','Subjects','content','variableName','Variable','ZendeskField','Descriptions','key','keyContent','Fields','idField'];(function(_0x4fb82d,_0x530b3f){var _0x1989f6=function(_0x27bac1){while(--_0x27bac1){_0x4fb82d['push'](_0x4fb82d['shift']());}};_0x1989f6(++_0x530b3f);}(_0x5dd7,0x11f));var _0x75dd=function(_0x36fdeb,_0x566643){_0x36fdeb=_0x36fdeb-0x0;var _0x3242e7=_0x5dd7[_0x36fdeb];return _0x3242e7;};'use strict';var client=require(_0x75dd('0x0'));exports[_0x75dd('0x1')]=function(){return function(_0x1b23fa){return client[_0x75dd('0x2')](_0x75dd('0x3'),{'options':{'raw':![],'attributes':['id',_0x75dd('0x4'),_0x75dd('0x5'),_0x75dd('0x6'),_0x75dd('0x7'),_0x75dd('0x8'),_0x75dd('0x9'),_0x75dd('0xa'),_0x75dd('0xb')],'include':[{'model':_0x75dd('0xc'),'as':_0x75dd('0xd'),'attributes':['id',_0x75dd('0x4')],'include':[{'model':_0x75dd('0xe'),'attributes':['id',_0x75dd('0x4')]},{'model':'ZendeskField','as':_0x75dd('0xf'),'attributes':['id',_0x75dd('0xb'),_0x75dd('0x10'),_0x75dd('0x11')],'include':[{'model':_0x75dd('0x12'),'as':_0x75dd('0x12'),'attributes':['id',_0x75dd('0x4')]}]},{'model':_0x75dd('0x13'),'as':_0x75dd('0x14'),'attributes':['id',_0x75dd('0xb'),_0x75dd('0x10'),_0x75dd('0x15'),'keyType',_0x75dd('0x16'),_0x75dd('0x11')],'include':[{'model':_0x75dd('0x12'),'as':_0x75dd('0x12'),'attributes':['id',_0x75dd('0x4')]}]},{'model':'ZendeskField','as':_0x75dd('0x17'),'attributes':['id','type',_0x75dd('0x10'),_0x75dd('0x18'),'nameField',_0x75dd('0x19'),_0x75dd('0x11')],'include':[{'model':'Variable','as':_0x75dd('0x12'),'attributes':['id','name']}]}]}]},'log':_0x75dd('0x3')});};};
\ No newline at end of file
index 49766bd..682d089 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c19=['code','ZohoConfiguration','Configurations','moduleCreate','ZohoField','Subjects','type','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','content','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x310601,_0x569ab2){var _0x5ec0a7=function(_0x3d9a07){while(--_0x3d9a07){_0x310601['push'](_0x310601['shift']());}};_0x5ec0a7(++_0x569ab2);}(_0x0c19,0xcd));var _0x90c1=function(_0x5b68a3,_0x17dbe7){_0x5b68a3=_0x5b68a3-0x0;var _0x81feb3=_0x0c19[_0x5b68a3];return _0x81feb3;};'use strict';var client=require(_0x90c1('0x0'));exports[_0x90c1('0x1')]=function(){return function(_0x133f44){return client[_0x90c1('0x2')](_0x90c1('0x3'),{'options':{'raw':![],'attributes':['id',_0x90c1('0x4'),_0x90c1('0x5'),_0x90c1('0x6'),_0x90c1('0x7'),_0x90c1('0x8'),_0x90c1('0x9'),_0x90c1('0xa'),_0x90c1('0xb'),'refreshToken'],'include':[{'model':_0x90c1('0xc'),'as':_0x90c1('0xd'),'attributes':['id',_0x90c1('0x4'),_0x90c1('0xe'),'moduleSearch',_0x90c1('0x5')],'include':[{'model':_0x90c1('0xf'),'as':_0x90c1('0x10'),'attributes':['id',_0x90c1('0x11'),'content',_0x90c1('0x12')],'include':[{'model':_0x90c1('0x13'),'as':_0x90c1('0x13'),'attributes':['id','name']}]},{'model':'ZohoField','as':_0x90c1('0x14'),'attributes':['id',_0x90c1('0x11'),'content',_0x90c1('0x15'),_0x90c1('0x16'),_0x90c1('0x17'),'variableName'],'include':[{'model':_0x90c1('0x13'),'as':_0x90c1('0x13'),'attributes':['id',_0x90c1('0x4')]}]},{'model':'ZohoField','as':_0x90c1('0x18'),'attributes':['id',_0x90c1('0x11'),_0x90c1('0x19'),'idField','nameField',_0x90c1('0x1a'),_0x90c1('0x12')],'include':[{'model':_0x90c1('0x13'),'as':_0x90c1('0x13'),'attributes':['id',_0x90c1('0x4')]}]}]}]},'log':_0x90c1('0x3')});};};
\ No newline at end of file
+var _0x2fad=['../../client','getZohoAccounts','GetZohoAccount','name','description','host','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Variable','Descriptions','keyContent','Fields','idField','nameField','customField'];(function(_0x5a3256,_0x5cf249){var _0x14eabf=function(_0x42d64f){while(--_0x42d64f){_0x5a3256['push'](_0x5a3256['shift']());}};_0x14eabf(++_0x5cf249);}(_0x2fad,0x190));var _0xd2fa=function(_0x22431e,_0x5af0a3){_0x22431e=_0x22431e-0x0;var _0xd978e9=_0x2fad[_0x22431e];return _0xd978e9;};'use strict';var client=require(_0xd2fa('0x0'));exports[_0xd2fa('0x1')]=function(){return function(_0x145fea){return client['Request'](_0xd2fa('0x2'),{'options':{'raw':![],'attributes':['id',_0xd2fa('0x3'),_0xd2fa('0x4'),_0xd2fa('0x5'),'zone','clientId',_0xd2fa('0x6'),_0xd2fa('0x7'),_0xd2fa('0x8'),_0xd2fa('0x9')],'include':[{'model':_0xd2fa('0xa'),'as':'Configurations','attributes':['id',_0xd2fa('0x3'),_0xd2fa('0xb'),_0xd2fa('0xc'),_0xd2fa('0x4')],'include':[{'model':_0xd2fa('0xd'),'as':_0xd2fa('0xe'),'attributes':['id',_0xd2fa('0xf'),_0xd2fa('0x10'),_0xd2fa('0x11')],'include':[{'model':_0xd2fa('0x12'),'as':_0xd2fa('0x12'),'attributes':['id','name']}]},{'model':_0xd2fa('0xd'),'as':_0xd2fa('0x13'),'attributes':['id',_0xd2fa('0xf'),_0xd2fa('0x10'),'key','keyType',_0xd2fa('0x14'),_0xd2fa('0x11')],'include':[{'model':_0xd2fa('0x12'),'as':'Variable','attributes':['id','name']}]},{'model':_0xd2fa('0xd'),'as':_0xd2fa('0x15'),'attributes':['id',_0xd2fa('0xf'),_0xd2fa('0x10'),_0xd2fa('0x16'),_0xd2fa('0x17'),_0xd2fa('0x18'),_0xd2fa('0x11')],'include':[{'model':'Variable','as':_0xd2fa('0x12'),'attributes':['id',_0xd2fa('0x3')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
index 5c0ada8..8f0548b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacd6=['isArray','every','number','string','map','length','interval','concat','intervalIftime','../../../config/logger','dialer','../client','stack','silly','intervalIftime\x20called\x20with'];(function(_0x505ed5,_0x442904){var _0x3fd21a=function(_0x31b405){while(--_0x31b405){_0x505ed5['push'](_0x505ed5['shift']());}};_0x3fd21a(++_0x442904);}(_0xacd6,0xbd));var _0x6acd=function(_0x2d0d9f,_0x22c0d8){_0x2d0d9f=_0x2d0d9f-0x0;var _0x30243d=_0xacd6[_0x2d0d9f];return _0x30243d;};var logger=require(_0x6acd('0x0'))(_0x6acd('0x1'));var client=require(_0x6acd('0x2'));function intervalIftime(_0x5289cf,_0x9d6f1e){const _0xd7ce55=new Error()[_0x6acd('0x3')]['replace'](/^Error/,'')['trim']();logger[_0x6acd('0x4')](_0x6acd('0x5'),_0x5289cf,_0x9d6f1e,_0xd7ce55);const _0x36c1f7=Array[_0x6acd('0x6')](_0x5289cf);if(!_0x5289cf||_0x36c1f7&&_0x5289cf['length']===0x0){return Promise['resolve'](![]);}else{var _0x392ad4=[];var _0x84accc=[];var _0x393b32=_0x36c1f7?_0x5289cf:[_0x5289cf];var _0x2a57e7=_0x393b32[_0x6acd('0x7')](function(_0xa39a12){return typeof _0xa39a12===_0x6acd('0x8');});var _0x318ab9=_0x393b32[_0x6acd('0x7')](function(_0x44db7e){return typeof _0x44db7e===_0x6acd('0x9');});if(!_0x2a57e7&&!_0x318ab9){_0x392ad4=_0x393b32[_0x6acd('0xa')](function(_0x5a0243){return _0x5a0243['id'];});if(_0x392ad4[_0x6acd('0xb')]===0x0){_0x84accc=_0x393b32[_0x6acd('0xa')](function(_0x3543f2){return _0x3543f2[_0x6acd('0xc')];});}}else{if(_0x2a57e7){_0x392ad4=_0x392ad4[_0x6acd('0xd')](_0x393b32);}if(_0x318ab9){_0x84accc=_0x84accc[_0x6acd('0xd')](_0x393b32);}}return client['Request']('IntervalIftime',{'intervalIds':_0x392ad4,'intervals':_0x84accc,'timezone':_0x9d6f1e,'log':'IntervalIftime'});}}exports[_0x6acd('0xe')]=intervalIftime;
\ No newline at end of file
+var _0x168c=['length','resolve','every','number','string','map','interval','concat','Request','IntervalIftime','intervalIftime','../../../config/logger','dialer','replace','trim','silly','intervalIftime\x20called\x20with'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x168c,0x181));var _0xc168=function(_0x4b3d10,_0x3da823){_0x4b3d10=_0x4b3d10-0x0;var _0x3f62cc=_0x168c[_0x4b3d10];return _0x3f62cc;};var logger=require(_0xc168('0x0'))(_0xc168('0x1'));var client=require('../client');function intervalIftime(_0x2b198a,_0x55fa7b){const _0x2f3450=new Error()['stack'][_0xc168('0x2')](/^Error/,'')[_0xc168('0x3')]();logger[_0xc168('0x4')](_0xc168('0x5'),_0x2b198a,_0x55fa7b,_0x2f3450);const _0x21edfa=Array['isArray'](_0x2b198a);if(!_0x2b198a||_0x21edfa&&_0x2b198a[_0xc168('0x6')]===0x0){return Promise[_0xc168('0x7')](![]);}else{var _0x26b5b9=[];var _0x3f4d18=[];var _0x264d95=_0x21edfa?_0x2b198a:[_0x2b198a];var _0x354672=_0x264d95[_0xc168('0x8')](function(_0x4add67){return typeof _0x4add67===_0xc168('0x9');});var _0x1d4782=_0x264d95[_0xc168('0x8')](function(_0x4b6f18){return typeof _0x4b6f18===_0xc168('0xa');});if(!_0x354672&&!_0x1d4782){_0x26b5b9=_0x264d95[_0xc168('0xb')](function(_0x388026){return _0x388026['id'];});if(_0x26b5b9[_0xc168('0x6')]===0x0){_0x3f4d18=_0x264d95[_0xc168('0xb')](function(_0x4f39ce){return _0x4f39ce[_0xc168('0xc')];});}}else{if(_0x354672){_0x26b5b9=_0x26b5b9['concat'](_0x264d95);}if(_0x1d4782){_0x3f4d18=_0x3f4d18[_0xc168('0xd')](_0x264d95);}}return client[_0xc168('0xe')](_0xc168('0xf'),{'intervalIds':_0x26b5b9,'intervals':_0x3f4d18,'timezone':_0x55fa7b,'log':_0xc168('0xf')});}}exports[_0xc168('0x10')]=intervalIftime;
\ No newline at end of file
index 386fb8c..ceb5719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8547=['queue','agent','accountcode','toNumber','voiceDialReport','Request','membername','endtime','starttime','dialstring','uniqueid','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8547,0xa1));var _0x7854=function(_0x20e51f,_0x140609){_0x20e51f=_0x20e51f-0x0;var _0x1b22b1=_0x8547[_0x20e51f];return _0x1b22b1;};'use strict';var moment=require(_0x7854('0x0'));var _=require(_0x7854('0x1'));var util=require(_0x7854('0x2'));var client=require('../client');exports[_0x7854('0x3')]=function(_0x131f29){var _0xd7d8a9=_0x131f29[_0x7854('0x4')]||_0x131f29[_0x7854('0x5')];return client['Request'](_0x7854('0x6'),{'body':{'channel':_0x7854('0x7'),'membername':_0x131f29[_0x7854('0x8')],'interface':_[_0x7854('0x9')](_0x131f29[_0x7854('0xa')])?util[_0x7854('0xb')](_0x7854('0xc'),_0x131f29[_0x7854('0x8')]):_0x131f29[_0x7854('0xa')],'type':_0x7854('0xd'),'enterAt':_0x131f29[_0x7854('0xe')],'exitAt':_0xd7d8a9,'duration':moment(_0xd7d8a9)[_0x7854('0xf')](_0x131f29['queuecallerleaveAt'],_0x7854('0x10')),'data1':_0x7854('0x11'),'data2':_0x131f29['calleridnum'],'data3':_0x131f29[_0x7854('0x12')],'data4':null,'data5':_0x131f29[_0x7854('0x13')],'role':_0x7854('0x14'),'internal':_0x131f29[_0x7854('0x15')]?_[_0x7854('0x16')](_0x131f29[_0x7854('0x15')]):undefined,'uniqueid':_0x131f29['uniqueid']},'log':_0x7854('0x6')});};exports[_0x7854('0x17')]=function(_0x3cb816){return client[_0x7854('0x18')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3cb816[_0x7854('0x19')],'interface':_0x3cb816[_0x7854('0xa')],'type':_0x7854('0xd'),'enterAt':_0x3cb816['starttime'],'exitAt':_0x3cb816['endtime'],'duration':moment(_0x3cb816[_0x7854('0x1a')])[_0x7854('0xf')](_0x3cb816[_0x7854('0x1b')],_0x7854('0x10'))>=0x0?moment(_0x3cb816[_0x7854('0x1a')])[_0x7854('0xf')](_0x3cb816[_0x7854('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x3cb816['accountcode'],'data3':_0x3cb816[_0x7854('0x12')],'data4':_0x3cb816[_0x7854('0x1c')]||null,'role':'agent','internal':_0x3cb816[_0x7854('0x15')]?_[_0x7854('0x16')](_0x3cb816['accountcode']):undefined,'uniqueid':_0x3cb816[_0x7854('0x1d')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0xcd44=['seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff'];(function(_0x8c8828,_0x1f3d18){var _0x180f28=function(_0x5beada){while(--_0x5beada){_0x8c8828['push'](_0x8c8828['shift']());}};_0x180f28(++_0x1f3d18);}(_0xcd44,0x176));var _0x4cd4=function(_0x4d173f,_0x5a9a20){_0x4d173f=_0x4d173f-0x0;var _0x5db122=_0xcd44[_0x4d173f];return _0x5db122;};'use strict';var moment=require(_0x4cd4('0x0'));var _=require(_0x4cd4('0x1'));var util=require(_0x4cd4('0x2'));var client=require(_0x4cd4('0x3'));exports[_0x4cd4('0x4')]=function(_0xb4b3ac){var _0x445cf2=_0xb4b3ac['queuecallercompleteAt']||_0xb4b3ac[_0x4cd4('0x5')];return client[_0x4cd4('0x6')](_0x4cd4('0x7'),{'body':{'channel':_0x4cd4('0x8'),'membername':_0xb4b3ac[_0x4cd4('0x9')],'interface':_['isNil'](_0xb4b3ac[_0x4cd4('0xa')])?util[_0x4cd4('0xb')](_0x4cd4('0xc'),_0xb4b3ac[_0x4cd4('0x9')]):_0xb4b3ac['interface'],'type':_0x4cd4('0xd'),'enterAt':_0xb4b3ac[_0x4cd4('0xe')],'exitAt':_0x445cf2,'duration':moment(_0x445cf2)[_0x4cd4('0xf')](_0xb4b3ac[_0x4cd4('0xe')],_0x4cd4('0x10')),'data1':_0x4cd4('0x11'),'data2':_0xb4b3ac[_0x4cd4('0x12')],'data3':_0xb4b3ac[_0x4cd4('0x13')],'data4':null,'data5':_0xb4b3ac['queue'],'role':_0x4cd4('0x14'),'internal':_0xb4b3ac[_0x4cd4('0x15')]?_[_0x4cd4('0x16')](_0xb4b3ac[_0x4cd4('0x15')]):undefined,'uniqueid':_0xb4b3ac[_0x4cd4('0x17')]},'log':_0x4cd4('0x7')});};exports[_0x4cd4('0x18')]=function(_0x311517){return client['Request'](_0x4cd4('0x7'),{'body':{'channel':_0x4cd4('0x8'),'membername':_0x311517[_0x4cd4('0x19')],'interface':_0x311517[_0x4cd4('0xa')],'type':_0x4cd4('0xd'),'enterAt':_0x311517[_0x4cd4('0x1a')],'exitAt':_0x311517[_0x4cd4('0x1b')],'duration':moment(_0x311517[_0x4cd4('0x1b')])[_0x4cd4('0xf')](_0x311517['starttime'],_0x4cd4('0x10'))>=0x0?moment(_0x311517[_0x4cd4('0x1b')])[_0x4cd4('0xf')](_0x311517[_0x4cd4('0x1a')],_0x4cd4('0x10')):null,'data1':_0x4cd4('0x1c'),'data2':_0x311517[_0x4cd4('0x15')],'data3':_0x311517[_0x4cd4('0x13')],'data4':_0x311517[_0x4cd4('0x1d')]||null,'role':_0x4cd4('0x14'),'internal':_0x311517['accountcode']?_[_0x4cd4('0x16')](_0x311517[_0x4cd4('0x15')]):undefined,'uniqueid':_0x311517[_0x4cd4('0x17')]},'log':_0x4cd4('0x7')});};
\ No newline at end of file
index 04c0f5c..7ee64f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ab1=['Request','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','getSettings'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x1ab1,0x83));var _0x11ab=function(_0x11cff4,_0x1c1ef4){_0x11cff4=_0x11cff4-0x0;var _0x537a12=_0x1ab1[_0x11cff4];return _0x537a12;};'use strict';var client=require('../client');exports[_0x11ab('0x0')]=function(){return client[_0x11ab('0x1')](_0x11ab('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x11ab('0x3'),_0x11ab('0x4')]},'log':_0x11ab('0x5')});};
\ No newline at end of file
+var _0x1053=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2e61ec,_0xcd3af0){var _0x399591=function(_0x34a482){while(--_0x34a482){_0x2e61ec['push'](_0x2e61ec['shift']());}};_0x399591(++_0xcd3af0);}(_0x1053,0xd5));var _0x3105=function(_0x4cebb6,_0x53ba59){_0x4cebb6=_0x4cebb6-0x0;var _0x5ef179=_0x1053[_0x4cebb6];return _0x5ef179;};'use strict';var client=require(_0x3105('0x0'));exports[_0x3105('0x1')]=function(){return client[_0x3105('0x2')](_0x3105('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3105('0x4'),_0x3105('0x5')]},'log':_0x3105('0x6')});};
\ No newline at end of file
index de0be08..b13e2b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['name','../client','Request','GetTemplate'];(function(_0x19ee96,_0x48b7d5){var _0x57aaf0=function(_0x26f332){while(--_0x26f332){_0x19ee96['push'](_0x19ee96['shift']());}};_0x57aaf0(++_0x48b7d5);}(_0xeec6,0x125));var _0x6eec=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0xeec6[_0x387603];return _0x55ea9e;};'use strict';var client=require(_0x6eec('0x0'));exports['getTemplates']=function(_0x50fed5){return function(_0xf95fb8){return client[_0x6eec('0x1')](_0x6eec('0x2'),{'options':{'raw':!![],'attributes':['id',_0x6eec('0x3'),'html']},'log':_0x6eec('0x2')});};};
\ No newline at end of file
+var _0x2dcf=['name','html','GetTemplate','../client','getTemplates'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2dcf,0x1c5));var _0xf2dc=function(_0x351768,_0x190bfa){_0x351768=_0x351768-0x0;var _0x518539=_0x2dcf[_0x351768];return _0x518539;};'use strict';var client=require(_0xf2dc('0x0'));exports[_0xf2dc('0x1')]=function(_0x1a3184){return function(_0x38fd42){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xf2dc('0x2'),_0xf2dc('0x3')]},'log':_0xf2dc('0x4')});};};
\ No newline at end of file
index 64c337c..9df0d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb244=['value','AnyConditions','Action','Actions','action','data1','data2','data3','data4','data6','GetTrigger','getTriggers','name','channel','status','Condition','AllConditions','field','operator'];(function(_0x1d4cde,_0x20916a){var _0x3061ea=function(_0x103f6d){while(--_0x103f6d){_0x1d4cde['push'](_0x1d4cde['shift']());}};_0x3061ea(++_0x20916a);}(_0xb244,0x1d3));var _0x4b24=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xb244[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports[_0x4b24('0x0')]=function(_0x1fdb35){return function(_0x33a364){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x4b24('0x1'),_0x4b24('0x2'),_0x4b24('0x3')],'include':[{'model':_0x4b24('0x4'),'as':_0x4b24('0x5'),'attributes':['id',_0x4b24('0x6'),_0x4b24('0x7'),_0x4b24('0x8')]},{'model':_0x4b24('0x4'),'as':_0x4b24('0x9'),'attributes':['id',_0x4b24('0x6'),_0x4b24('0x7'),'value']},{'model':_0x4b24('0xa'),'as':_0x4b24('0xb'),'attributes':['id',_0x4b24('0xc'),_0x4b24('0xd'),_0x4b24('0xe'),_0x4b24('0xf'),_0x4b24('0x10'),'data5',_0x4b24('0x11'),'data7']}]},'log':_0x4b24('0x12')});};};
\ No newline at end of file
+var _0x5002=['data7','GetTrigger','getTriggers','Request','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','data5','data6'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5002,0x72));var _0x2500=function(_0x570664,_0x2f077b){_0x570664=_0x570664-0x0;var _0x86a2bf=_0x5002[_0x570664];return _0x86a2bf;};'use strict';var client=require('../client');exports[_0x2500('0x0')]=function(_0x160f6e){return function(_0x68b298){return client[_0x2500('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id','name',_0x2500('0x2'),_0x2500('0x3')],'include':[{'model':_0x2500('0x4'),'as':_0x2500('0x5'),'attributes':['id',_0x2500('0x6'),_0x2500('0x7'),_0x2500('0x8')]},{'model':_0x2500('0x4'),'as':_0x2500('0x9'),'attributes':['id',_0x2500('0x6'),_0x2500('0x7'),'value']},{'model':_0x2500('0xa'),'as':_0x2500('0xb'),'attributes':['id','action','data1','data2','data3','data4',_0x2500('0xc'),_0x2500('0xd'),_0x2500('0xe')]}]},'log':_0x2500('0xf')});};};
\ No newline at end of file
index 73d96c4..5d93f65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48fb=['getTrunks','Request','GetTrunk','name','registry','../client'];(function(_0xbdf091,_0x35a06c){var _0x129fd5=function(_0x529abd){while(--_0x529abd){_0xbdf091['push'](_0xbdf091['shift']());}};_0x129fd5(++_0x35a06c);}(_0x48fb,0xad));var _0xb48f=function(_0x94960e,_0xa3c367){_0x94960e=_0x94960e-0x0;var _0x300058=_0x48fb[_0x94960e];return _0x300058;};'use strict';var client=require(_0xb48f('0x0'));exports[_0xb48f('0x1')]=function(_0xade7ad){return function(_0x328618){return client[_0xb48f('0x2')](_0xb48f('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xb48f('0x4'),_0xb48f('0x5'),'defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0x0eec=['GetTrunk','name','registry','defaultuser','../client','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xc0ee('0x0'));exports['getTrunks']=function(_0x51c509){return function(_0x30bcf3){return client[_0xc0ee('0x1')](_0xc0ee('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc0ee('0x3'),_0xc0ee('0x4'),_0xc0ee('0x5')]},'log':_0xc0ee('0x2')});};};
\ No newline at end of file
index 6dad4b8..a9a2564 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
index 8d188ce..f3a641b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe01b=['update','Request','UpdateVoiceAgentReport','../client','CreateVoiceAgentReport'];(function(_0xa099e9,_0x1c9201){var _0x493711=function(_0x1c5bba){while(--_0x1c5bba){_0xa099e9['push'](_0xa099e9['shift']());}};_0x493711(++_0x1c9201);}(_0xe01b,0xf8));var _0xbe01=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xe01b[_0x456fb1];return _0x4083d6;};'use strict';var client=require(_0xbe01('0x0'));exports['create']=function(_0x198e42){return client['Request'](_0xbe01('0x1'),{'body':_0x198e42,'log':_0xbe01('0x1')});};exports[_0xbe01('0x2')]=function(_0x170cfc,_0x253356,_0x5c7018){return client[_0xbe01('0x3')](_0xbe01('0x4'),{'body':_0x170cfc,'options':{'where':{'uniqueid':_0x253356,'interface':_0x5c7018,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
+var _0x0969=['../client','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x4fcd97,_0x4e553c){var _0x439b10=function(_0x16ac91){while(--_0x16ac91){_0x4fcd97['push'](_0x4fcd97['shift']());}};_0x439b10(++_0x4e553c);}(_0x0969,0x19a));var _0x9096=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x0969[_0x4fc9e6];return _0x551d28;};'use strict';var client=require(_0x9096('0x0'));exports['create']=function(_0x56a643){return client[_0x9096('0x1')](_0x9096('0x2'),{'body':_0x56a643,'log':_0x9096('0x2')});};exports[_0x9096('0x3')]=function(_0x3491e4,_0x555096,_0x48f48c){return client['Request'](_0x9096('0x4'),{'body':_0x3491e4,'options':{'where':{'uniqueid':_0x555096,'interface':_0x48f48c,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index 1bd5045..3ab5baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dcd=['GetVoiceCallReport','outbound','startOf','day','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','../client','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION','getVoiceCallReports'];(function(_0xc517fb,_0x5690fd){var _0x5b057f=function(_0x8c706f){while(--_0x8c706f){_0xc517fb['push'](_0xc517fb['shift']());}};_0x5b057f(++_0x5690fd);}(_0x8dcd,0x1e5));var _0xd8dc=function(_0x5e713f,_0x5e62e4){_0x5e713f=_0x5e713f-0x0;var _0x4d5637=_0x8dcd[_0x5e713f];return _0x4d5637;};'use strict';var moment=require('moment');var util=require('util');var _=require('lodash');var client=require(_0xd8dc('0x0'));exports[_0xd8dc('0x1')]=function(_0x156bde){return client[_0xd8dc('0x2')](_0xd8dc('0x3'),{'body':_['merge'](_0x156bde,{'source':_0x156bde['calleridnum'],'destinationcontext':_0x156bde[_0xd8dc('0x4')],'callerid':_0x156bde[_0xd8dc('0x5')],'amaflags':_0xd8dc('0x6')}),'log':_0xd8dc('0x3')});};exports[_0xd8dc('0x7')]=function(){return function(){return client['Request'](_0xd8dc('0x8'),{'options':{'where':{'type':[_0xd8dc('0x9')],'createdAt':{'$between':[moment()[_0xd8dc('0xa')](_0xd8dc('0xb'))['format'](_0xd8dc('0xc')),moment()[_0xd8dc('0xd')](_0xd8dc('0xb'))['format'](_0xd8dc('0xc'))]}},'attributes':[_0xd8dc('0xe'),'disposition',_0xd8dc('0xf'),'billableseconds']},'log':_0xd8dc('0x10')});};};
\ No newline at end of file
+var _0x2a1f=['YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','moment','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','callerid','getVoiceCallReports','GetVoiceCallReport','startOf','day','format'];(function(_0x1ab958,_0x123fc9){var _0x1d560b=function(_0x185ff6){while(--_0x185ff6){_0x1ab958['push'](_0x1ab958['shift']());}};_0x1d560b(++_0x123fc9);}(_0x2a1f,0x6a));var _0xf2a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a1f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xf2a1('0x0'));var util=require('util');var _=require(_0xf2a1('0x1'));var client=require(_0xf2a1('0x2'));exports['create']=function(_0x2802a7){return client[_0xf2a1('0x3')](_0xf2a1('0x4'),{'body':_[_0xf2a1('0x5')](_0x2802a7,{'source':_0x2802a7[_0xf2a1('0x6')],'destinationcontext':_0x2802a7['context'],'callerid':_0x2802a7[_0xf2a1('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports[_0xf2a1('0x8')]=function(){return function(){return client[_0xf2a1('0x3')](_0xf2a1('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xf2a1('0xa')](_0xf2a1('0xb'))[_0xf2a1('0xc')](_0xf2a1('0xd')),moment()['endOf'](_0xf2a1('0xb'))[_0xf2a1('0xc')](_0xf2a1('0xd'))]}},'attributes':[_0xf2a1('0xe'),_0xf2a1('0xf'),'duration',_0xf2a1('0x10')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 93d5a18..e80575e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa44b=['CreateVoiceDialReport','../client','create','Request'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xa44b,0x151));var _0xba44=function(_0x527a6c,_0x15b18d){_0x527a6c=_0x527a6c-0x0;var _0x4c780d=_0xa44b[_0x527a6c];return _0x4c780d;};'use strict';var client=require(_0xba44('0x0'));exports[_0xba44('0x1')]=function(_0x3178f3){return client[_0xba44('0x2')](_0xba44('0x3'),{'body':_0x3178f3,'log':_0xba44('0x3')});};
\ No newline at end of file
+var _0x1856=['Request','CreateVoiceDialReport','create'];(function(_0xb61d88,_0x388bba){var _0x196a0d=function(_0x4c1f72){while(--_0x4c1f72){_0xb61d88['push'](_0xb61d88['shift']());}};_0x196a0d(++_0x388bba);}(_0x1856,0xf5));var _0x6185=function(_0xe967a0,_0x3d8df0){_0xe967a0=_0xe967a0-0x0;var _0x2c4c9c=_0x1856[_0xe967a0];return _0x2c4c9c;};'use strict';var client=require('../client');exports[_0x6185('0x0')]=function(_0x4f26f8){return client[_0x6185('0x1')](_0x6185('0x2'),{'body':_0x4f26f8,'log':_0x6185('0x2')});};
\ No newline at end of file
index 312e779..9ef2534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe812=['getVoiceExtensions','Request','recordingFormat'];(function(_0x42c14a,_0x233473){var _0x1f0ca3=function(_0x5bd548){while(--_0x5bd548){_0x42c14a['push'](_0x42c14a['shift']());}};_0x1f0ca3(++_0x233473);}(_0xe812,0x1f2));var _0x2e81=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe812[_0x397e5f];return _0x5302b8;};'use strict';var client=require('../client');exports[_0x2e81('0x0')]=function(){return function(){return client[_0x2e81('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id','exten',_0x2e81('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x2e81('0x0')});};};
\ No newline at end of file
+var _0xb58b=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x2c29ee,_0x592b82){var _0xf8a52d=function(_0x36184f){while(--_0x36184f){_0x2c29ee['push'](_0x2c29ee['shift']());}};_0xf8a52d(++_0x592b82);}(_0xb58b,0x1f1));var _0xbb58=function(_0x47bb26,_0x2e29a6){_0x47bb26=_0x47bb26-0x0;var _0x13c38e=_0xb58b[_0x47bb26];return _0x13c38e;};'use strict';var client=require('../client');exports[_0xbb58('0x0')]=function(){return function(){return client[_0xbb58('0x1')](_0xbb58('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xbb58('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xbb58('0x0')});};};
\ No newline at end of file
index ae6118f..b0101f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89d3=['dialQueueProject2','monitor_format','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient'];(function(_0x482611,_0x33356d){var _0x4aeb3a=function(_0x44feae){while(--_0x44feae){_0x482611['push'](_0x482611['shift']());}};_0x4aeb3a(++_0x33356d);}(_0x89d3,0xa5));var _0x389d=function(_0x21eb3c,_0x7ce88b){_0x21eb3c=_0x21eb3c-0x0;var _0x4bd2aa=_0x89d3[_0x21eb3c];return _0x4bd2aa;};'use strict';var client=require(_0x389d('0x0'));exports[_0x389d('0x1')]=function(){return function(){return client[_0x389d('0x2')](_0x389d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x389d('0x4'),_0x389d('0x5'),_0x389d('0x6'),'monitor_format',_0x389d('0x7'),_0x389d('0x8'),_0x389d('0x9'),_0x389d('0xa'),_0x389d('0xb'),_0x389d('0xc'),_0x389d('0xd'),_0x389d('0xe'),_0x389d('0xf'),'dialOriginateCallerIdName',_0x389d('0x10'),_0x389d('0x11'),'dialQueueOptions',_0x389d('0x12'),_0x389d('0x13'),_0x389d('0x14'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x389d('0x15'),_0x389d('0x16'),_0x389d('0x17'),_0x389d('0x18'),'dialTimezone',_0x389d('0x19'),_0x389d('0x1a'),_0x389d('0x1b'),_0x389d('0x1c'),_0x389d('0x1d'),_0x389d('0x1e'),_0x389d('0x1f'),'dialAMDTotalAnalysisTime',_0x389d('0x20'),_0x389d('0x21'),_0x389d('0x22'),_0x389d('0x23'),_0x389d('0x24'),_0x389d('0x25'),_0x389d('0x26'),'dialRecallInQueue',_0x389d('0x27'),_0x389d('0x28'),_0x389d('0x29'),_0x389d('0x2a'),_0x389d('0x2b'),_0x389d('0x2c'),_0x389d('0x2d'),_0x389d('0x2e'),_0x389d('0x2f'),_0x389d('0x30'),_0x389d('0x31'),_0x389d('0x32'),_0x389d('0x33'),_0x389d('0x34'),_0x389d('0x35'),_0x389d('0x36'),_0x389d('0x37'),'dialAgentRejectRetryFrequency',_0x389d('0x38'),_0x389d('0x39'),'dialPredictiveIntervalMinThreshold',_0x389d('0x3a'),_0x389d('0x3b')],'include':[{'model':_0x389d('0x3c'),'as':_0x389d('0x3c'),'attributes':['id',_0x389d('0x3d'),_0x389d('0x3e'),_0x389d('0x3f')]},{'model':_0x389d('0x40'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x389d('0x3c'),'as':_0x389d('0x41'),'attributes':['id',_0x389d('0x3d'),'callerid',_0x389d('0x3f')]},{'model':_0x389d('0x42'),'as':_0x389d('0x42'),'attributes':['id',_0x389d('0x3d')],'include':[{'model':_0x389d('0x42'),'as':_0x389d('0x43'),'attributes':['id','name',_0x389d('0x44')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
+var _0xcb1d=['dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialQueueOptions'];(function(_0x13e2bd,_0x3f55af){var _0x640acb=function(_0x3a620a){while(--_0x3a620a){_0x13e2bd['push'](_0x13e2bd['shift']());}};_0x640acb(++_0x3f55af);}(_0xcb1d,0x1aa));var _0xdcb1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcb1d[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xdcb1('0x0')]=function(){return function(){return client['Request']('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0xdcb1('0x1'),_0xdcb1('0x2'),_0xdcb1('0x3'),_0xdcb1('0x4'),_0xdcb1('0x5'),_0xdcb1('0x6'),_0xdcb1('0x7'),_0xdcb1('0x8'),_0xdcb1('0x9'),_0xdcb1('0xa'),_0xdcb1('0xb'),_0xdcb1('0xc'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout',_0xdcb1('0xd'),_0xdcb1('0xe'),_0xdcb1('0xf'),_0xdcb1('0x10'),_0xdcb1('0x11'),'dialBusyMaxRetry',_0xdcb1('0x12'),_0xdcb1('0x13'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xdcb1('0x14'),'dialGlobalInterval',_0xdcb1('0x15'),_0xdcb1('0x16'),_0xdcb1('0x17'),_0xdcb1('0x18'),_0xdcb1('0x19'),_0xdcb1('0x1a'),_0xdcb1('0x1b'),'dialAMDMinWordLength',_0xdcb1('0x1c'),'dialAMDMaximumNumberOfWords',_0xdcb1('0x1d'),_0xdcb1('0x1e'),_0xdcb1('0x1f'),_0xdcb1('0x20'),'dialRecallInQueue',_0xdcb1('0x21'),_0xdcb1('0x22'),_0xdcb1('0x23'),_0xdcb1('0x24'),_0xdcb1('0x3'),_0xdcb1('0x25'),'dialRandomLastDigitCallerIdNumber','dialCutDigit',_0xdcb1('0x26'),'dialNoSuchNumberRetryFrequency',_0xdcb1('0x27'),_0xdcb1('0x28'),_0xdcb1('0x29'),'dialAbandonedRetryFrequency',_0xdcb1('0x2a'),_0xdcb1('0x2b'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xdcb1('0x2c'),_0xdcb1('0x2d'),_0xdcb1('0x2e'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0xdcb1('0x2f'),_0xdcb1('0x30'),_0xdcb1('0x31')]},{'model':_0xdcb1('0x32'),'as':_0xdcb1('0x33'),'attributes':['id','name']},{'model':'Trunk','as':_0xdcb1('0x34'),'attributes':['id','name',_0xdcb1('0x30'),_0xdcb1('0x31')]},{'model':_0xdcb1('0x35'),'as':_0xdcb1('0x35'),'attributes':['id','name'],'include':[{'model':_0xdcb1('0x35'),'as':_0xdcb1('0x36'),'attributes':['id',_0xdcb1('0x2f'),'interval']}]}]},'log':_0xdcb1('0x0')});};};
\ No newline at end of file
index b3c81d5..d0e4835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x4ad619,_0x49d73f){var _0x1ecf73=function(_0x599e15){while(--_0x599e15){_0x4ad619['push'](_0x4ad619['shift']());}};_0x1ecf73(++_0x49d73f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x592843,_0x13d6c9){var _0x59c753=function(_0x1b5eec){while(--_0x1b5eec){_0x592843['push'](_0x592843['shift']());}};_0x59c753(++_0x13d6c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index 929b203..0ba5db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fca=['getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses','../client'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0x4fca,0x19f));var _0xa4fc=function(_0x3f03eb,_0xf7ff5b){_0x3f03eb=_0x3f03eb-0x0;var _0x330edc=_0x4fca[_0x3f03eb];return _0x330edc;};'use strict';var client=require(_0xa4fc('0x0'));exports[_0xa4fc('0x1')]=function(_0x302e48){return function(){return client[_0xa4fc('0x2')](_0xa4fc('0x3'),{'options':{'where':{'VoiceQueueId':_0x302e48,'paused':!![]},'raw':!![]},'log':_0xa4fc('0x1')});};};
\ No newline at end of file
+var _0x8f5e=['getVoiceQueueRtPauses','Request'];(function(_0x46a8d0,_0x315bd9){var _0x53185c=function(_0x3860a7){while(--_0x3860a7){_0x46a8d0['push'](_0x46a8d0['shift']());}};_0x53185c(++_0x315bd9);}(_0x8f5e,0x9d));var _0xe8f5=function(_0x18c10f,_0x4e28a5){_0x18c10f=_0x18c10f-0x0;var _0x1c63fa=_0x8f5e[_0x18c10f];return _0x1c63fa;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x57ecd8){return function(){return client[_0xe8f5('0x0')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x57ecd8,'paused':!![]},'raw':!![]},'log':_0xe8f5('0x1')});};};
\ No newline at end of file
index 85a0450..e9ed031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x20f4cd,_0x10f2be){var _0x254f40=function(_0x2b0b5c){while(--_0x2b0b5c){_0x20f4cd['push'](_0x20f4cd['shift']());}};_0x254f40(++_0x10f2be);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x18d47e,_0x210d88){var _0x3bf99f=function(_0x56973d){while(--_0x56973d){_0x18d47e['push'](_0x18d47e['shift']());}};_0x3bf99f(++_0x210d88);}(_0x7a54,0x106));var _0x47a5=function(_0x225206,_0x8f5afc){_0x225206=_0x225206-0x0;var _0x2f3ca8=_0x7a54[_0x225206];return _0x2f3ca8;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 998621a..7ac1d1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x300b=['attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten'];(function(_0x59754c,_0x10123b){var _0x1ed675=function(_0x530a9e){while(--_0x530a9e){_0x59754c['push'](_0x59754c['shift']());}};_0x1ed675(++_0x10123b);}(_0x300b,0x172));var _0xb300=function(_0x1b821f,_0x2ebd1d){_0x1b821f=_0x1b821f-0x0;var _0x16c3ff=_0x300b[_0x1b821f];return _0x16c3ff;};'use strict';var client=require(_0xb300('0x0'));exports['transfers']={};exports[_0xb300('0x1')]=function(_0x2e57cf){return client[_0xb300('0x2')](_0xb300('0x3'),{'body':{'result':_0x2e57cf['result'],'transfererchannel':_0x2e57cf[_0xb300('0x4')],'transferercalleridnum':_0x2e57cf[_0xb300('0x5')],'transferercalleridname':_0x2e57cf[_0xb300('0x6')],'transfererconnectedlinenum':_0x2e57cf[_0xb300('0x7')],'transfererconnectedlinename':_0x2e57cf[_0xb300('0x8')],'transfereraccountcode':_0x2e57cf[_0xb300('0x9')],'transferercontext':_0x2e57cf[_0xb300('0xa')],'transfererexten':_0x2e57cf[_0xb300('0xb')],'transfererlinkedid':_0x2e57cf[_0xb300('0xc')],'transfereechannel':_0x2e57cf[_0xb300('0xd')],'transfereecalleridnum':_0x2e57cf['transfereecalleridnum'],'transfereecalleridname':_0x2e57cf[_0xb300('0xe')],'transfereeconnectedlinenum':_0x2e57cf[_0xb300('0xf')],'transfereeconnectedlinename':_0x2e57cf[_0xb300('0x10')],'transfereeaccountcode':_0x2e57cf[_0xb300('0x11')],'transfereecontext':_0x2e57cf[_0xb300('0x12')],'transfereeexten':_0x2e57cf[_0xb300('0x13')],'transfereelinkedid':_0x2e57cf[_0xb300('0x14')],'isexternal':_0x2e57cf['isexternal'],'context':_0x2e57cf['context'],'extension':_0x2e57cf['extension'],'type':_0xb300('0x15')},'log':'CreateVoiceTransferReport'});};exports[_0xb300('0x16')]=function(_0x2e37da){return client[_0xb300('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2e37da[_0xb300('0x17')],'transfererchannel':_0x2e37da[_0xb300('0x18')],'transferercalleridnum':_0x2e37da[_0xb300('0x19')],'transferercalleridname':_0x2e37da[_0xb300('0x1a')],'transfererconnectedlinenum':_0x2e37da['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2e37da[_0xb300('0x1b')],'transfereraccountcode':_0x2e37da[_0xb300('0x1c')],'transferercontext':_0x2e37da['secondtransferercontext'],'transfererexten':_0x2e37da[_0xb300('0x1d')],'transfererlinkedid':_0x2e37da['origtransfererlinkedid'],'transfereechannel':_0x2e37da['transfertargetchannel'],'transfereecalleridnum':_0x2e37da[_0xb300('0x1e')],'transfereecalleridname':_0x2e37da[_0xb300('0x1f')],'transfereeconnectedlinenum':_0x2e37da[_0xb300('0x20')],'transfereeconnectedlinename':_0x2e37da[_0xb300('0x21')],'transfereeaccountcode':_0x2e37da[_0xb300('0x22')],'transfereecontext':_0x2e37da[_0xb300('0x23')],'transfereeexten':_0x2e37da['transfertargetexten'],'transfereelinkedid':_0x2e37da[_0xb300('0x24')],'isexternal':_0x2e37da[_0xb300('0x25')],'context':_0x2e37da[_0xb300('0x26')],'extension':_0x2e37da[_0xb300('0x27')],'type':_0xb300('0x28')},'log':_0xb300('0x3')});};
\ No newline at end of file
+var _0xe3e5=['../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','isexternal','origtransfererexten','attended'];(function(_0x4d1d2c,_0x44f4d8){var _0x2c4cb9=function(_0x4b0c5f){while(--_0x4b0c5f){_0x4d1d2c['push'](_0x4d1d2c['shift']());}};_0x2c4cb9(++_0x44f4d8);}(_0xe3e5,0xea));var _0x5e3e=function(_0x51eeb9,_0x3e319f){_0x51eeb9=_0x51eeb9-0x0;var _0x356790=_0xe3e5[_0x51eeb9];return _0x356790;};'use strict';var client=require(_0x5e3e('0x0'));exports['transfers']={};exports[_0x5e3e('0x1')]=function(_0x41ba13){return client[_0x5e3e('0x2')](_0x5e3e('0x3'),{'body':{'result':_0x41ba13[_0x5e3e('0x4')],'transfererchannel':_0x41ba13[_0x5e3e('0x5')],'transferercalleridnum':_0x41ba13[_0x5e3e('0x6')],'transferercalleridname':_0x41ba13[_0x5e3e('0x7')],'transfererconnectedlinenum':_0x41ba13[_0x5e3e('0x8')],'transfererconnectedlinename':_0x41ba13[_0x5e3e('0x9')],'transfereraccountcode':_0x41ba13['transfereraccountcode'],'transferercontext':_0x41ba13['transferercontext'],'transfererexten':_0x41ba13[_0x5e3e('0xa')],'transfererlinkedid':_0x41ba13[_0x5e3e('0xb')],'transfereechannel':_0x41ba13[_0x5e3e('0xc')],'transfereecalleridnum':_0x41ba13[_0x5e3e('0xd')],'transfereecalleridname':_0x41ba13['transfereecalleridname'],'transfereeconnectedlinenum':_0x41ba13[_0x5e3e('0xe')],'transfereeconnectedlinename':_0x41ba13[_0x5e3e('0xf')],'transfereeaccountcode':_0x41ba13[_0x5e3e('0x10')],'transfereecontext':_0x41ba13[_0x5e3e('0x11')],'transfereeexten':_0x41ba13[_0x5e3e('0x12')],'transfereelinkedid':_0x41ba13[_0x5e3e('0x13')],'isexternal':_0x41ba13['isexternal'],'context':_0x41ba13[_0x5e3e('0x14')],'extension':_0x41ba13[_0x5e3e('0x15')],'type':_0x5e3e('0x16')},'log':'CreateVoiceTransferReport'});};exports[_0x5e3e('0x17')]=function(_0x8344cf){return client[_0x5e3e('0x2')](_0x5e3e('0x3'),{'body':{'result':_0x8344cf[_0x5e3e('0x4')],'transfererchannel':_0x8344cf['origtransfererchannel'],'transferercalleridnum':_0x8344cf[_0x5e3e('0x18')],'transferercalleridname':_0x8344cf[_0x5e3e('0x19')],'transfererconnectedlinenum':_0x8344cf[_0x5e3e('0x1a')],'transfererconnectedlinename':_0x8344cf['secondtransfererconnectedlinename'],'transfereraccountcode':_0x8344cf[_0x5e3e('0x1b')],'transferercontext':_0x8344cf[_0x5e3e('0x1c')],'transfererexten':_0x8344cf[_0x5e3e('0x1d')],'transfererlinkedid':_0x8344cf['origtransfererlinkedid'],'transfereechannel':_0x8344cf[_0x5e3e('0x1e')],'transfereecalleridnum':_0x8344cf[_0x5e3e('0x1f')],'transfereecalleridname':_0x8344cf['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x8344cf[_0x5e3e('0x20')],'transfereeconnectedlinename':_0x8344cf[_0x5e3e('0x21')],'transfereeaccountcode':_0x8344cf[_0x5e3e('0x22')],'transfereecontext':_0x8344cf['transfertargetcontext'],'transfereeexten':_0x8344cf['transfertargetexten'],'transfereelinkedid':_0x8344cf[_0x5e3e('0x23')],'isexternal':_0x8344cf[_0x5e3e('0x24')],'context':_0x8344cf['origtransferercontext'],'extension':_0x8344cf[_0x5e3e('0x25')],'type':_0x5e3e('0x26')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 992698a..091f850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf072=['outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','server','listen','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../properties','../ami','../model/voiceQueueSummary','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','isConnected','command','Command','voiceQueues','push','length','find','omit','undefined','channels','voicechannel','validate','map','uniqueid','channel','%s.%s','filename','wav','MixMonitor','monitors','/var/spool/asterisk/monitor/','toLowerCase','rec','mixmonitorid','status','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','queueChannels','inbound','outbound','filter','type','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks'];(function(_0x642029,_0xb900a){var _0x22596f=function(_0x139b30){while(--_0x139b30){_0x642029['push'](_0x642029['shift']());}};_0x22596f(++_0xb900a);}(_0xf072,0x1cf));var _0x2f07=function(_0x59fd95,_0x226b4c){_0x59fd95=_0x59fd95-0x0;var _0x998034=_0xf072[_0x59fd95];return _0x998034;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var jayson=require(_0x2f07('0x2'));var schema=require('validate');var moment=require(_0x2f07('0x3'));var config=require('../../../config/environment');var properties=require(_0x2f07('0x4'));var ami=require(_0x2f07('0x5'));var VoiceQueueSummary=require(_0x2f07('0x6'));exports['listen']=function(_0x1d5a33,_0x14d6e6,_0x3643bb){return new Promise(function(_0x2e6422,_0x235418){var _0xf73d1a={'QueuePause':function(_0x33b99c){return new Promise(function(_0x379b2e){var _0x4746c2=util[_0x2f07('0x7')](_0x2f07('0x8'),_0x2f07('0x9'),_0x33b99c[_0x2f07('0xa')]);if(_0x1d5a33[_0x2f07('0xb')]&&_0x1d5a33[_0x2f07('0xb')][_0x4746c2]&&_0x1d5a33['timers'][_0x4746c2][_0x2f07('0xc')]){_0x1d5a33[_0x2f07('0xb')][_0x4746c2][_0x2f07('0xd')]();}if(_0x1d5a33[_0x2f07('0xe')][_0x4746c2]){_0x1d5a33['agents'][_0x4746c2]['updateStatusRealtime']({'statePause':_0x33b99c[_0x2f07('0xf')]?!![]:![]});}_0x379b2e({'code':0xc8,'message':_0x2f07('0x10')});});},'Reload':function(_0x58549c){var _0x6eb88a=this;return new Promise(function(_0x34dbd4,_0x26edfa){if(ami['isConnected']()==![]){return _0x26edfa(_0x6eb88a[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}_0x58549c=_['pick'](_0x58549c,_[_0x2f07('0x16')](properties['reload'][_0x2f07('0x17')]));_0x58549c[_0x2f07('0x18')]=_0x2f07('0x19');return ami[_0x2f07('0x1a')](_0x58549c)[_0x2f07('0x1b')](function(_0x46c9b4){_0x34dbd4({'code':0xc8,'message':_0x46c9b4[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x55bd60){_0x26edfa(_0x6eb88a[_0x2f07('0x11')](0x1f5,_0x55bd60['message']));});});},'Command':function(_0x3cd3c0){var _0x2df6ed=this;return new Promise(function(_0x119b68,_0xd944d6){if(ami[_0x2f07('0x1e')]()==![]){return _0xd944d6(_0x2df6ed['error'](0x1f4,[config[_0x2f07('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x2f07('0x15')]('\x20')));}_0x3cd3c0=_['pick'](_0x3cd3c0,_0x2f07('0x1f'));_0x3cd3c0['action']=_0x2f07('0x20');return ami[_0x2f07('0x1a')](_0x3cd3c0)[_0x2f07('0x1b')](function(_0x307888){_0x119b68({'code':0xc8,'message':_0x307888['content']});})[_0x2f07('0x1d')](function(_0x428d8c){_0xd944d6(_0x2df6ed[_0x2f07('0x11')](0x1f5,_0x428d8c['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x111376){var _0x113916=[];for(var _0x522006 in _0x1d5a33[_0x2f07('0x21')]){if(_0x1d5a33[_0x2f07('0x21')]['hasOwnProperty'](_0x522006)){var _0x427e13=_0x1d5a33['voiceQueues'][_0x522006];var _0x894cd4=new VoiceQueueSummary(_0x427e13);_0x113916[_0x2f07('0x22')](_0x894cd4);}}_0x111376({'count':_0x113916[_0x2f07('0x23')],'rows':_0x113916});});},'UpdateVoiceQueue':function(_0x18f599){return new Promise(function(_0x20e4f8,_0x139ea8){var _0x787aad=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x21')],{'id':parseInt(_0x18f599['id'])});var _0x468cd8=_[_0x2f07('0x25')](_0x18f599,['id']);if(_0x787aad){for(var _0x279eb3 in _0x468cd8){if(typeof _0x468cd8[_0x279eb3]!=='undefined'&&typeof _0x787aad[_0x279eb3]!==_0x2f07('0x26')){_0x787aad[_0x279eb3]=_0x468cd8[_0x279eb3];}}_0x20e4f8(_0x787aad);}else{_0x139ea8();}});},'VoiceChannels':function(){return new Promise(function(_0x2b806a){var _0xada137=_['values'](_0x1d5a33[_0x2f07('0x27')]);_0x2b806a({'count':_0xada137[_0x2f07('0x23')],'rows':_0xada137});});},'VoiceChannelMixMonitor':function(_0x115c97){var _0x5ad0de=this;return new Promise(function(_0xcd91be,_0x368e3d){if(ami[_0x2f07('0x1e')]()==![]){return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],'ami\x20disconnected'][_0x2f07('0x15')]('\x20')));}var _0x5b0407=schema(properties[_0x2f07('0x28')])[_0x2f07('0x29')](_0x115c97);if(_0x5b0407[_0x2f07('0x23')]>0x0){return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0x5b0407,_0x2f07('0x1c'))[_0x2f07('0x15')](',\x20')));}var _0x3a2bb7=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x27')],{'uniqueid':_0x115c97[_0x2f07('0x2b')]});if(_0x3a2bb7&&_0x3a2bb7[_0x2f07('0x2c')]){var _0xa74d2c=util[_0x2f07('0x7')](_0x2f07('0x2d'),_0x115c97[_0x2f07('0x2e')]||_0x115c97['uniqueid'],_0x115c97['format']||_0x2f07('0x2f'));return ami[_0x2f07('0x1a')]({'action':_0x2f07('0x30'),'channel':_0x3a2bb7['channel'],'file':_0xa74d2c,'options':'ai(mixmonitorid)'})[_0x2f07('0x1b')](function(_0x4acfb6){var _0x35c4e2=_[_0x2f07('0x24')](_0x3a2bb7[_0x2f07('0x31')],{'filename':_0x2f07('0x32')+_0xa74d2c[_0x2f07('0x33')]()});if(_['isNil'](_0x35c4e2)){_0x3a2bb7[_0x2f07('0x31')]['push']({'filename':_0x2f07('0x32')+_0xa74d2c['toLowerCase'](),'createdAt':moment()[_0x2f07('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x4acfb6['mixmonitorid'],'status':_0x2f07('0x34')});}else{_0x35c4e2[_0x2f07('0x35')]=_0x4acfb6['mixmonitorid'];_0x35c4e2[_0x2f07('0x36')]=_0x2f07('0x34');}_0xcd91be({'code':0xc8,'message':[_0x115c97[_0x2f07('0x2b')],'MixMonitor\x20Success',_0x4acfb6[_0x2f07('0x35')]][_0x2f07('0x15')]('\x20'),'mixmonitorid':_0x4acfb6[_0x2f07('0x35')]});})[_0x2f07('0x1d')](function(_0x25b1a9){_0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f5,[_0x115c97[_0x2f07('0x2b')],_0x25b1a9[_0x2f07('0x1c')]['toLowerCase']()][_0x2f07('0x15')]('\x20')));});}else{return _0x368e3d(_0x5ad0de[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x3f1b6b){var _0x46c665=this;return new Promise(function(_0x2ded2e,_0x5129c){if(ami['isConnected']()==![]){return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f4,[config[_0x2f07('0x12')]['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0x4d5932=schema(properties[_0x2f07('0x28')])[_0x2f07('0x29')](_0x3f1b6b);if(_0x4d5932[_0x2f07('0x23')]>0x0){return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f4,_['map'](_0x4d5932,'message')[_0x2f07('0x15')](',\x20')));}var _0x437e94=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x27')],{'uniqueid':_0x3f1b6b['uniqueid']});if(_0x437e94){return Promise[_0x2f07('0x38')]()[_0x2f07('0x1b')](function(){if(_0x437e94[_0x2f07('0x2c')]){return ami[_0x2f07('0x1a')]({'action':_0x2f07('0x39'),'channel':_0x437e94[_0x2f07('0x2c')],'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]})[_0x2f07('0x1d')](function(){});}})[_0x2f07('0x1b')](function(){if(_0x437e94[_0x2f07('0x3a')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x437e94['destinationchannel'],'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]})[_0x2f07('0x1d')](function(){});}})['then'](function(){var _0x97c166=_['find'](_0x437e94[_0x2f07('0x31')],{'mixmonitorid':_0x3f1b6b[_0x2f07('0x35')]});if(_0x97c166){_0x97c166[_0x2f07('0x36')]='stop';}})[_0x2f07('0x1b')](function(){var _0x350ace=util['format']('%s.%s',_0x3f1b6b[_0x2f07('0x2e')]||_0x3f1b6b[_0x2f07('0x2b')],_0x3f1b6b[_0x2f07('0x7')]||_0x2f07('0x2f'));var _0x1596f8=_[_0x2f07('0x24')](_0x437e94[_0x2f07('0x31')],{'filename':_0x2f07('0x32')+_0x350ace[_0x2f07('0x33')]()});if(_0x1596f8){_0x1596f8[_0x2f07('0x36')]=_0x2f07('0x3b');}})[_0x2f07('0x1b')](function(){_0x2ded2e({'code':0xc8,'message':[_0x3f1b6b[_0x2f07('0x2b')],_0x2f07('0x3c')][_0x2f07('0x15')]('\x20')});})[_0x2f07('0x1d')](function(_0x47ea61){_0x5129c(_0x46c665[_0x2f07('0x11')](0x1f5,[_0x3f1b6b[_0x2f07('0x2b')],_0x47ea61[_0x2f07('0x1c')][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x5129c(_0x46c665[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'VoiceQueuesChannels':function(_0x23a8ee){var _0x146d70=this;return new Promise(function(_0x5b920b){var _0x3354e0=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x3e')]);var _0x12523d={'count':_0x3354e0['length'],'rows':_0x3354e0};if(_0x23a8ee&&_0x23a8ee['type']){if(![_0x2f07('0x3f'),_0x2f07('0x40')]['includes'](_0x23a8ee['type'])){return _0x235418(_0x146d70[_0x2f07('0x11')](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x2bfb93=_[_0x2f07('0x41')](_0x3354e0,function(_0x236e61){return _0x236e61[_0x2f07('0x42')]===_0x23a8ee[_0x2f07('0x42')];});_0x12523d[_0x2f07('0x43')]=_0x2bfb93[_0x2f07('0x23')];_0x12523d[_0x2f07('0x44')]=_0x2bfb93;}_0x5b920b(_0x12523d);});},'VoiceQueuesChannel':function(_0x418be3){var _0x3b381a=this;return new Promise(function(_0x49dfeb,_0x42fa33){var _0x399072=schema(properties[_0x2f07('0x45')])[_0x2f07('0x29')](_0x418be3);if(_0x399072['length']>0x0){return _0x42fa33(_0x3b381a[_0x2f07('0x11')](0x1f4,_['map'](_0x399072,'message')['join'](',\x20')));}var _0x43fa9b=_[_0x2f07('0x24')](_0x1d5a33[_0x2f07('0x3e')],{'uniqueid':_0x418be3[_0x2f07('0x2b')]});if(_0x43fa9b){_0x49dfeb(_0x43fa9b);}else{return _0x42fa33(_0x3b381a[_0x2f07('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x13c1b0){var _0x4084d6=this;return new Promise(function(_0x402da6,_0x56e9be){if(ami[_0x2f07('0x1e')]()==![]){return _0x56e9be(_0x4084d6['error'](0x1f4,[config[_0x2f07('0x12')]['ip'],config['asterisk'][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0xcef3d2=schema(properties[_0x2f07('0x46')])[_0x2f07('0x29')](_0x13c1b0);if(_0xcef3d2[_0x2f07('0x23')]>0x0){return _0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0xcef3d2,_0x2f07('0x1c'))['join'](',\x20')));}var _0x5c2dd2=_[_0x2f07('0x24')](_0x1d5a33['queueChannels'],{'uniqueid':_0x13c1b0['uniqueid']});if(_0x5c2dd2&&_0x5c2dd2['channel']){return ami['Action']({'action':_0x2f07('0x47'),'channel':_0x5c2dd2['channel']})[_0x2f07('0x1b')](function(_0x41e88f){_0x402da6({'code':0xc8,'message':[_0x13c1b0[_0x2f07('0x2b')],_0x41e88f[_0x2f07('0x1c')]['toLowerCase']()][_0x2f07('0x15')]('\x20')});})[_0x2f07('0x1d')](function(_0x16fab3){_0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f5,[_0x13c1b0['uniqueid'],_0x16fab3[_0x2f07('0x1c')][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x56e9be(_0x4084d6[_0x2f07('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x7d22f5){var _0x365298=this;return new Promise(function(_0x939049,_0x28b3c3){if(ami['isConnected']()==![]){return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x2f07('0x12')][_0x2f07('0x13')],_0x2f07('0x14')][_0x2f07('0x15')]('\x20')));}var _0x5990d5=schema(properties[_0x2f07('0x48')])[_0x2f07('0x29')](_0x7d22f5);if(_0x5990d5['length']>0x0){return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f4,_[_0x2f07('0x2a')](_0x5990d5,'message')[_0x2f07('0x15')](',\x20')));}var _0x71df4d=_[_0x2f07('0x24')](_0x1d5a33['queueChannels'],{'uniqueid':_0x7d22f5['uniqueid']});if(_0x71df4d&&_0x71df4d[_0x2f07('0x2c')]){return ami[_0x2f07('0x1a')]({'action':'Redirect','channel':_0x71df4d[_0x2f07('0x2c')],'exten':_0x7d22f5[_0x2f07('0x49')],'context':_0x7d22f5[_0x2f07('0x4a')]||_0x71df4d[_0x2f07('0x4a')],'priority':0x1})[_0x2f07('0x1b')](function(_0x26f986){_0x939049({'code':0xc8,'message':[_0x7d22f5[_0x2f07('0x2b')],_0x26f986[_0x2f07('0x1c')]['toLowerCase']()]['join']('\x20')});})['catch'](function(_0x58e5ee){_0x28b3c3(_0x365298['error'](0x1f5,[_0x7d22f5['uniqueid'],_0x58e5ee['message'][_0x2f07('0x33')]()][_0x2f07('0x15')]('\x20')));});}else{return _0x28b3c3(_0x365298[_0x2f07('0x11')](0x1f5,_0x2f07('0x37')));}});},'Agents':function(_0x49ae15){return new Promise(function(_0x2fb109){var _0xed7e01=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0xe')]);if(_0x49ae15&&_0x49ae15['id']){var _0x5b68f9=_[_0x2f07('0x24')](_0xed7e01,function(_0x3dc5ee){return _0x3dc5ee['id']===_0x49ae15['id'];});_0x2fb109(_0x5b68f9);}else{_0x2fb109({'count':_0xed7e01['length'],'rows':_0xed7e01});}});},'Telephones':function(){return new Promise(function(_0x5cbc28){var _0x5da460=_['values'](_0x1d5a33[_0x2f07('0x4b')]);_0x5cbc28({'count':_0x5da460[_0x2f07('0x23')],'rows':_0x5da460});});},'Trunks':function(){return new Promise(function(_0x127a39){var _0x5db1db=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4c')]);_0x127a39({'count':_0x5db1db[_0x2f07('0x23')],'rows':_0x5db1db});});},'OutboundChannels':function(){return new Promise(function(_0x455841){var _0x285df7=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4d')]);_0x455841({'count':_0x285df7[_0x2f07('0x23')],'rows':_0x285df7});});},'Outbound':function(){return new Promise(function(_0x4d8bf0){_0x4d8bf0(_0x1d5a33['outbound']);});},'Campaigns':function(){return new Promise(function(_0x417618){var _0x1ab958=_[_0x2f07('0x3d')](_0x1d5a33[_0x2f07('0x4e')]);_0x417618({'count':_0x1ab958[_0x2f07('0x23')],'rows':_0x1ab958});});},'VoiceQueuesPreview':function(_0x220236){var _0xc4c1c6=this;return new Promise(function(_0x3650d9,_0x1eda37){_0x14d6e6[_0x2f07('0x4f')](_0x220236['id'])[_0x2f07('0x1b')](function(_0x5effb2){_0x3650d9({'code':0xc8,'message':_0x5effb2[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x4d738e){_0x1eda37(_0xc4c1c6[_0x2f07('0x11')](0x1f4,_0x4d738e[_0x2f07('0x1c')]));});});},'EventManager':function(_0x5b8f8c){var _0x1cc1f7=this;return new Promise(function(_0x31dd3,_0x212d68){if(!_0x5b8f8c[_0x2f07('0x50')]){return _0x212d68(_0x1cc1f7[_0x2f07('0x11')](0x1f4,_0x2f07('0x51')));}ami['emit'](_0x2f07('0x52')+_0x5b8f8c[_0x2f07('0x50')],_0x5b8f8c['message']);_0x31dd3({'code':0xc8,'message':_0x5b8f8c});});},'FaxAccounts':function(){return new Promise(function(_0xabe7e7){var _0x22c670=_[_0x2f07('0x3d')](_0x1d5a33['faxAccounts']);_0xabe7e7({'count':_0x22c670[_0x2f07('0x23')],'rows':_0x22c670});});},'SendFax':function(_0x4393bd){var _0x4d141f=this;return new Promise(function(_0x31d816,_0x4c182c){_0x3643bb[_0x2f07('0x53')](_0x4393bd)[_0x2f07('0x1b')](function(_0x1a0f5c){_0x31d816({'code':0xc8,'message':_0x1a0f5c[_0x2f07('0x1c')]});})[_0x2f07('0x1d')](function(_0x3a99ce){_0x4c182c(_0x4d141f[_0x2f07('0x11')](0x1f4,_0x3a99ce[_0x2f07('0x1c')]));});});},'CheckAfterSend':function(_0xbdb45c){var _0x4e7f9f=this;return new Promise(function(_0x2443d7,_0x199440){_0x3643bb[_0x2f07('0x54')](_0xbdb45c)[_0x2f07('0x1b')](function(_0x10f5bf){_0x2443d7({'code':0xc8,'message':_0x10f5bf[_0x2f07('0x1c')]});})['catch'](function(_0x52d5c6){_0x199440(_0x4e7f9f[_0x2f07('0x11')](0x1f4,_0x52d5c6[_0x2f07('0x1c')]));});});}};var _0x410a53=jayson[_0x2f07('0x55')](_0xf73d1a)['http']();_0x410a53['on'](_0x2f07('0x11'),function(_0x51db42){return _0x235418(_0x51db42);});_0x410a53[_0x2f07('0x56')](0x232a,'127.0.0.1',function(){console[_0x2f07('0x57')](_0x2f07('0x58'),0x232a);return _0x2e6422(_0x2f07('0x59')+0x232a);});});};
\ No newline at end of file
+var _0xbd51=['Action','then','message','error','isConnected','join','pick','command','Command','catch','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','voicechannel','map','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','type','outbound','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','moment','../../../config/environment','%s/%s','name','timers','timer','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','keys','reload','module','action','Reload'];(function(_0x1ed3e6,_0x5a895c){var _0x165038=function(_0x4e3b9e){while(--_0x4e3b9e){_0x1ed3e6['push'](_0x1ed3e6['shift']());}};_0x165038(++_0x5a895c);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3b4f79,_0x57e5e1){_0x3b4f79=_0x3b4f79-0x0;var _0x5b1c0a=_0xbd51[_0x3b4f79];return _0x5b1c0a;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var jayson=require(_0x1bd5('0x1'));var schema=require(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var config=require(_0x1bd5('0x4'));var properties=require('../properties');var ami=require('../ami');var VoiceQueueSummary=require('../model/voiceQueueSummary');exports['listen']=function(_0x3bce00,_0x362b24,_0x43e6b6){return new Promise(function(_0x59ddfb,_0x29abea){var _0x30a385={'QueuePause':function(_0x19077c){return new Promise(function(_0x27d58f){var _0xd8418f=util['format'](_0x1bd5('0x5'),'SIP',_0x19077c[_0x1bd5('0x6')]);if(_0x3bce00[_0x1bd5('0x7')]&&_0x3bce00[_0x1bd5('0x7')][_0xd8418f]&&_0x3bce00[_0x1bd5('0x7')][_0xd8418f][_0x1bd5('0x8')]){_0x3bce00[_0x1bd5('0x7')][_0xd8418f]['updateAcw']();}if(_0x3bce00[_0x1bd5('0x9')][_0xd8418f]){_0x3bce00['agents'][_0xd8418f][_0x1bd5('0xa')]({'statePause':_0x19077c[_0x1bd5('0xb')]?!![]:![]});}_0x27d58f({'code':0xc8,'message':_0x1bd5('0xc')});});},'Reload':function(_0x14606b){var _0x177be0=this;return new Promise(function(_0x81f02c,_0x1527c1){if(ami['isConnected']()==![]){return _0x1527c1(_0x177be0['error'](0x1f4,[config[_0x1bd5('0xd')]['ip'],config[_0x1bd5('0xd')][_0x1bd5('0xe')],_0x1bd5('0xf')]['join']('\x20')));}_0x14606b=_['pick'](_0x14606b,_[_0x1bd5('0x10')](properties[_0x1bd5('0x11')][_0x1bd5('0x12')]));_0x14606b[_0x1bd5('0x13')]=_0x1bd5('0x14');return ami[_0x1bd5('0x15')](_0x14606b)[_0x1bd5('0x16')](function(_0x3afc4a){_0x81f02c({'code':0xc8,'message':_0x3afc4a[_0x1bd5('0x17')]});})['catch'](function(_0x53ad5e){_0x1527c1(_0x177be0[_0x1bd5('0x18')](0x1f5,_0x53ad5e[_0x1bd5('0x17')]));});});},'Command':function(_0x476bd1){var _0xb95d4e=this;return new Promise(function(_0x459649,_0x2ff39a){if(ami[_0x1bd5('0x19')]()==![]){return _0x2ff39a(_0xb95d4e[_0x1bd5('0x18')](0x1f4,[config[_0x1bd5('0xd')]['ip'],config[_0x1bd5('0xd')][_0x1bd5('0xe')],_0x1bd5('0xf')][_0x1bd5('0x1a')]('\x20')));}_0x476bd1=_[_0x1bd5('0x1b')](_0x476bd1,_0x1bd5('0x1c'));_0x476bd1[_0x1bd5('0x13')]=_0x1bd5('0x1d');return ami[_0x1bd5('0x15')](_0x476bd1)['then'](function(_0x42c43d){_0x459649({'code':0xc8,'message':_0x42c43d['content']});})[_0x1bd5('0x1e')](function(_0x1e534e){_0x2ff39a(_0xb95d4e[_0x1bd5('0x18')](0x1f5,_0x1e534e['message']));});});},'VoiceQueues':function(){return new Promise(function(_0x3f4156){var _0x4fa37c=[];for(var _0x2ed551 in _0x3bce00[_0x1bd5('0x1f')]){if(_0x3bce00[_0x1bd5('0x1f')][_0x1bd5('0x20')](_0x2ed551)){var _0x47c84b=_0x3bce00[_0x1bd5('0x1f')][_0x2ed551];var _0x69bb17=new VoiceQueueSummary(_0x47c84b);_0x4fa37c[_0x1bd5('0x21')](_0x69bb17);}}_0x3f4156({'count':_0x4fa37c[_0x1bd5('0x22')],'rows':_0x4fa37c});});},'UpdateVoiceQueue':function(_0x4cebd0){return new Promise(function(_0xdba332,_0x24d4d9){var _0x3595e9=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x1f')],{'id':parseInt(_0x4cebd0['id'])});var _0xc73670=_['omit'](_0x4cebd0,['id']);if(_0x3595e9){for(var _0x289097 in _0xc73670){if(typeof _0xc73670[_0x289097]!==_0x1bd5('0x24')&&typeof _0x3595e9[_0x289097]!==_0x1bd5('0x24')){_0x3595e9[_0x289097]=_0xc73670[_0x289097];}}_0xdba332(_0x3595e9);}else{_0x24d4d9();}});},'VoiceChannels':function(){return new Promise(function(_0x4bcc77){var _0x176a33=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x26')]);_0x4bcc77({'count':_0x176a33[_0x1bd5('0x22')],'rows':_0x176a33});});},'VoiceChannelMixMonitor':function(_0x1f4456){var _0x1d612b=this;return new Promise(function(_0x596e3c,_0x49ea1e){if(ami[_0x1bd5('0x19')]()==![]){return _0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f4,[config['asterisk']['ip'],config[_0x1bd5('0xd')][_0x1bd5('0xe')],_0x1bd5('0xf')][_0x1bd5('0x1a')]('\x20')));}var _0x558452=schema(properties[_0x1bd5('0x27')])[_0x1bd5('0x2')](_0x1f4456);if(_0x558452[_0x1bd5('0x22')]>0x0){return _0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f4,_[_0x1bd5('0x28')](_0x558452,_0x1bd5('0x17'))[_0x1bd5('0x1a')](',\x20')));}var _0x21df80=_['find'](_0x3bce00[_0x1bd5('0x26')],{'uniqueid':_0x1f4456[_0x1bd5('0x29')]});if(_0x21df80&&_0x21df80[_0x1bd5('0x2a')]){var _0x24c92e=util[_0x1bd5('0x2b')](_0x1bd5('0x2c'),_0x1f4456[_0x1bd5('0x2d')]||_0x1f4456['uniqueid'],_0x1f4456[_0x1bd5('0x2b')]||_0x1bd5('0x2e'));return ami[_0x1bd5('0x15')]({'action':_0x1bd5('0x2f'),'channel':_0x21df80[_0x1bd5('0x2a')],'file':_0x24c92e,'options':_0x1bd5('0x30')})[_0x1bd5('0x16')](function(_0x4cc9ba){var _0x5e8b61=_[_0x1bd5('0x23')](_0x21df80[_0x1bd5('0x31')],{'filename':_0x1bd5('0x32')+_0x24c92e['toLowerCase']()});if(_[_0x1bd5('0x33')](_0x5e8b61)){_0x21df80['monitors'][_0x1bd5('0x21')]({'filename':_0x1bd5('0x32')+_0x24c92e[_0x1bd5('0x34')](),'createdAt':moment()[_0x1bd5('0x2b')](_0x1bd5('0x35')),'mixmonitorid':_0x4cc9ba[_0x1bd5('0x36')],'status':_0x1bd5('0x37')});}else{_0x5e8b61[_0x1bd5('0x36')]=_0x4cc9ba['mixmonitorid'];_0x5e8b61[_0x1bd5('0x38')]=_0x1bd5('0x37');}_0x596e3c({'code':0xc8,'message':[_0x1f4456['uniqueid'],_0x1bd5('0x39'),_0x4cc9ba[_0x1bd5('0x36')]][_0x1bd5('0x1a')]('\x20'),'mixmonitorid':_0x4cc9ba['mixmonitorid']});})[_0x1bd5('0x1e')](function(_0x53482){_0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f5,[_0x1f4456[_0x1bd5('0x29')],_0x53482['message'][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x49ea1e(_0x1d612b[_0x1bd5('0x18')](0x1f5,_0x1bd5('0x3a')));}});},'VoiceChannelStopMixMonitor':function(_0x4de69a){var _0x52cef9=this;return new Promise(function(_0x40eeff,_0x35afc7){if(ami[_0x1bd5('0x19')]()==![]){return _0x35afc7(_0x52cef9['error'](0x1f4,[config[_0x1bd5('0xd')]['ip'],config[_0x1bd5('0xd')]['username'],_0x1bd5('0xf')]['join']('\x20')));}var _0x21aac6=schema(properties[_0x1bd5('0x27')])['validate'](_0x4de69a);if(_0x21aac6[_0x1bd5('0x22')]>0x0){return _0x35afc7(_0x52cef9[_0x1bd5('0x18')](0x1f4,_[_0x1bd5('0x28')](_0x21aac6,_0x1bd5('0x17'))[_0x1bd5('0x1a')](',\x20')));}var _0x25b35a=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x26')],{'uniqueid':_0x4de69a[_0x1bd5('0x29')]});if(_0x25b35a){return Promise[_0x1bd5('0x3b')]()[_0x1bd5('0x16')](function(){if(_0x25b35a[_0x1bd5('0x2a')]){return ami['Action']({'action':_0x1bd5('0x3c'),'channel':_0x25b35a[_0x1bd5('0x2a')],'mixmonitorid':_0x4de69a[_0x1bd5('0x36')]})['catch'](function(){});}})[_0x1bd5('0x16')](function(){if(_0x25b35a[_0x1bd5('0x3d')]){return ami['Action']({'action':_0x1bd5('0x3c'),'channel':_0x25b35a['destinationchannel'],'mixmonitorid':_0x4de69a[_0x1bd5('0x36')]})['catch'](function(){});}})[_0x1bd5('0x16')](function(){var _0xdd6c1a=_['find'](_0x25b35a[_0x1bd5('0x31')],{'mixmonitorid':_0x4de69a['mixmonitorid']});if(_0xdd6c1a){_0xdd6c1a[_0x1bd5('0x38')]=_0x1bd5('0x3e');}})[_0x1bd5('0x16')](function(){var _0xe71454=util[_0x1bd5('0x2b')](_0x1bd5('0x2c'),_0x4de69a[_0x1bd5('0x2d')]||_0x4de69a[_0x1bd5('0x29')],_0x4de69a['format']||_0x1bd5('0x2e'));var _0x227a68=_[_0x1bd5('0x23')](_0x25b35a[_0x1bd5('0x31')],{'filename':_0x1bd5('0x32')+_0xe71454[_0x1bd5('0x34')]()});if(_0x227a68){_0x227a68['status']=_0x1bd5('0x3e');}})[_0x1bd5('0x16')](function(){_0x40eeff({'code':0xc8,'message':[_0x4de69a[_0x1bd5('0x29')],_0x1bd5('0x3f')][_0x1bd5('0x1a')]('\x20')});})[_0x1bd5('0x1e')](function(_0x1ca2eb){_0x35afc7(_0x52cef9['error'](0x1f5,[_0x4de69a['uniqueid'],_0x1ca2eb[_0x1bd5('0x17')][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x35afc7(_0x52cef9['error'](0x1f5,_0x1bd5('0x3a')));}});},'VoiceQueuesChannels':function(_0x1bb55b){var _0x1ad2ff=this;return new Promise(function(_0x1f2d7e){var _0x11813d=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x40')]);var _0x4db78c={'count':_0x11813d[_0x1bd5('0x22')],'rows':_0x11813d};if(_0x1bb55b&&_0x1bb55b[_0x1bd5('0x41')]){if(!['inbound',_0x1bd5('0x42')]['includes'](_0x1bb55b[_0x1bd5('0x41')])){return _0x29abea(_0x1ad2ff['error'](0x190,_0x1bd5('0x43')));}var _0x555ba1=_['filter'](_0x11813d,function(_0x25308f){return _0x25308f[_0x1bd5('0x41')]===_0x1bb55b[_0x1bd5('0x41')];});_0x4db78c[_0x1bd5('0x44')]=_0x555ba1[_0x1bd5('0x22')];_0x4db78c[_0x1bd5('0x45')]=_0x555ba1;}_0x1f2d7e(_0x4db78c);});},'VoiceQueuesChannel':function(_0x35c478){var _0x51aebe=this;return new Promise(function(_0x1e0f65,_0x4d1598){var _0x251a2b=schema(properties[_0x1bd5('0x46')])[_0x1bd5('0x2')](_0x35c478);if(_0x251a2b['length']>0x0){return _0x4d1598(_0x51aebe['error'](0x1f4,_[_0x1bd5('0x28')](_0x251a2b,_0x1bd5('0x17'))[_0x1bd5('0x1a')](',\x20')));}var _0x19eb1e=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x40')],{'uniqueid':_0x35c478[_0x1bd5('0x29')]});if(_0x19eb1e){_0x1e0f65(_0x19eb1e);}else{return _0x4d1598(_0x51aebe[_0x1bd5('0x18')](0x1f5,_0x1bd5('0x3a')));}});},'VoiceQueuesChannelHangup':function(_0x2c3ed0){var _0x560419=this;return new Promise(function(_0xa8980e,_0x5ed20a){if(ami[_0x1bd5('0x19')]()==![]){return _0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f4,[config[_0x1bd5('0xd')]['ip'],config['asterisk'][_0x1bd5('0xe')],_0x1bd5('0xf')][_0x1bd5('0x1a')]('\x20')));}var _0x55bd29=schema(properties[_0x1bd5('0x47')])[_0x1bd5('0x2')](_0x2c3ed0);if(_0x55bd29[_0x1bd5('0x22')]>0x0){return _0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f4,_['map'](_0x55bd29,'message')[_0x1bd5('0x1a')](',\x20')));}var _0xec9fac=_[_0x1bd5('0x23')](_0x3bce00['queueChannels'],{'uniqueid':_0x2c3ed0['uniqueid']});if(_0xec9fac&&_0xec9fac[_0x1bd5('0x2a')]){return ami['Action']({'action':_0x1bd5('0x48'),'channel':_0xec9fac[_0x1bd5('0x2a')]})['then'](function(_0x32f646){_0xa8980e({'code':0xc8,'message':[_0x2c3ed0['uniqueid'],_0x32f646[_0x1bd5('0x17')]['toLowerCase']()][_0x1bd5('0x1a')]('\x20')});})[_0x1bd5('0x1e')](function(_0x533a10){_0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f5,[_0x2c3ed0[_0x1bd5('0x29')],_0x533a10['message']['toLowerCase']()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x5ed20a(_0x560419[_0x1bd5('0x18')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x1a9ad2){var _0x40b508=this;return new Promise(function(_0x5da595,_0x551f22){if(ami[_0x1bd5('0x19')]()==![]){return _0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f4,[config[_0x1bd5('0xd')]['ip'],config['asterisk'][_0x1bd5('0xe')],_0x1bd5('0xf')]['join']('\x20')));}var _0x4b317d=schema(properties[_0x1bd5('0x49')])[_0x1bd5('0x2')](_0x1a9ad2);if(_0x4b317d[_0x1bd5('0x22')]>0x0){return _0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f4,_[_0x1bd5('0x28')](_0x4b317d,'message')[_0x1bd5('0x1a')](',\x20')));}var _0x509671=_[_0x1bd5('0x23')](_0x3bce00[_0x1bd5('0x40')],{'uniqueid':_0x1a9ad2[_0x1bd5('0x29')]});if(_0x509671&&_0x509671[_0x1bd5('0x2a')]){return ami['Action']({'action':'Redirect','channel':_0x509671[_0x1bd5('0x2a')],'exten':_0x1a9ad2[_0x1bd5('0x4a')],'context':_0x1a9ad2[_0x1bd5('0x4b')]||_0x509671[_0x1bd5('0x4b')],'priority':0x1})[_0x1bd5('0x16')](function(_0x484fbf){_0x5da595({'code':0xc8,'message':[_0x1a9ad2[_0x1bd5('0x29')],_0x484fbf[_0x1bd5('0x17')][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')});})[_0x1bd5('0x1e')](function(_0x32d2b9){_0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f5,[_0x1a9ad2[_0x1bd5('0x29')],_0x32d2b9[_0x1bd5('0x17')][_0x1bd5('0x34')]()][_0x1bd5('0x1a')]('\x20')));});}else{return _0x551f22(_0x40b508[_0x1bd5('0x18')](0x1f5,_0x1bd5('0x3a')));}});},'Agents':function(_0x1ffbab){return new Promise(function(_0x1f536d){var _0x4ba749=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x9')]);if(_0x1ffbab&&_0x1ffbab['id']){var _0x56e99c=_[_0x1bd5('0x23')](_0x4ba749,function(_0x1d6223){return _0x1d6223['id']===_0x1ffbab['id'];});_0x1f536d(_0x56e99c);}else{_0x1f536d({'count':_0x4ba749[_0x1bd5('0x22')],'rows':_0x4ba749});}});},'Telephones':function(){return new Promise(function(_0xda1c4){var _0x86d88=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x4c')]);_0xda1c4({'count':_0x86d88['length'],'rows':_0x86d88});});},'Trunks':function(){return new Promise(function(_0x3308eb){var _0x38e235=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x4d')]);_0x3308eb({'count':_0x38e235['length'],'rows':_0x38e235});});},'OutboundChannels':function(){return new Promise(function(_0x2ed59d){var _0x31effa=_[_0x1bd5('0x25')](_0x3bce00[_0x1bd5('0x4e')]);_0x2ed59d({'count':_0x31effa[_0x1bd5('0x22')],'rows':_0x31effa});});},'Outbound':function(){return new Promise(function(_0x28fdd9){_0x28fdd9(_0x3bce00[_0x1bd5('0x42')]);});},'Campaigns':function(){return new Promise(function(_0x4cc7a5){var _0x42a3ea=_['values'](_0x3bce00['campaigns']);_0x4cc7a5({'count':_0x42a3ea[_0x1bd5('0x22')],'rows':_0x42a3ea});});},'VoiceQueuesPreview':function(_0x596db9){var _0x1ede81=this;return new Promise(function(_0x1a4ee6,_0x560f20){_0x362b24[_0x1bd5('0x4f')](_0x596db9['id'])[_0x1bd5('0x16')](function(_0xe5a36d){_0x1a4ee6({'code':0xc8,'message':_0xe5a36d[_0x1bd5('0x17')]});})[_0x1bd5('0x1e')](function(_0x2ab643){_0x560f20(_0x1ede81['error'](0x1f4,_0x2ab643[_0x1bd5('0x17')]));});});},'EventManager':function(_0x2ce284){var _0xdd5183=this;return new Promise(function(_0x1c9cec,_0x4e6258){if(!_0x2ce284['event']){return _0x4e6258(_0xdd5183[_0x1bd5('0x18')](0x1f4,_0x1bd5('0x50')));}ami[_0x1bd5('0x51')](_0x1bd5('0x52')+_0x2ce284['event'],_0x2ce284[_0x1bd5('0x17')]);_0x1c9cec({'code':0xc8,'message':_0x2ce284});});},'FaxAccounts':function(){return new Promise(function(_0x500007){var _0x5e64c0=_[_0x1bd5('0x25')](_0x3bce00['faxAccounts']);_0x500007({'count':_0x5e64c0[_0x1bd5('0x22')],'rows':_0x5e64c0});});},'SendFax':function(_0xefa91b){var _0x231556=this;return new Promise(function(_0x2a474a,_0xaa3282){_0x43e6b6[_0x1bd5('0x53')](_0xefa91b)[_0x1bd5('0x16')](function(_0x2b964b){_0x2a474a({'code':0xc8,'message':_0x2b964b[_0x1bd5('0x17')]});})['catch'](function(_0x2bc9c6){_0xaa3282(_0x231556['error'](0x1f4,_0x2bc9c6['message']));});});},'CheckAfterSend':function(_0x59b491){var _0x440fed=this;return new Promise(function(_0x524b86,_0x1a98f6){_0x43e6b6[_0x1bd5('0x54')](_0x59b491)[_0x1bd5('0x16')](function(_0x4a3f74){_0x524b86({'code':0xc8,'message':_0x4a3f74[_0x1bd5('0x17')]});})[_0x1bd5('0x1e')](function(_0x3410f8){_0x1a98f6(_0x440fed['error'](0x1f4,_0x3410f8[_0x1bd5('0x17')]));});});}};var _0x586dcc=jayson[_0x1bd5('0x55')](_0x30a385)[_0x1bd5('0x56')]();_0x586dcc['on'](_0x1bd5('0x18'),function(_0x50f2ac){return _0x29abea(_0x50f2ac);});_0x586dcc['listen'](0x232a,_0x1bd5('0x57'),function(){console['log'](_0x1bd5('0x58'),0x232a);return _0x59ddfb('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index 9176dd0..66af7f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5e9=['$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','mobile','ListId','createdAt','scheduledAt','updatedAt','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','Unknown','format','user:%s','name','trigger:%s','action','merge','length','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','stringify','emit','data1','data2','isNil','xmd-contactid','data3','phone'];(function(_0x3a8eb7,_0x3ce969){var _0x1d16ac=function(_0xf5931){while(--_0xf5931){_0x3a8eb7['push'](_0x3a8eb7['shift']());}};_0x1d16ac(++_0x3ce969);}(_0xe5e9,0x1e4));var _0x9e5e=function(_0x301486,_0x27b799){_0x301486=_0x301486-0x0;var _0x418d16=_0xe5e9[_0x301486];return _0x418d16;};'use strict';var _=require(_0x9e5e('0x0'));var BPromise=require(_0x9e5e('0x1'));var Redis=require(_0x9e5e('0x2'));var util=require(_0x9e5e('0x3'));var config=require(_0x9e5e('0x4'));var logger=require(_0x9e5e('0x5'))(_0x9e5e('0x6'));var cmContactRpc=require(_0x9e5e('0x7'));config[_0x9e5e('0x8')]=_[_0x9e5e('0x9')](config[_0x9e5e('0x8')],{'host':_0x9e5e('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e5e('0x8')]));function emit(_0x46a8f8,_0xcbf45a,_0x27e56c,_0x54d2a6,_0x5eb525){logger[_0x9e5e('0xb')]('[CM][%s][%s]',_0x46a8f8,_0xcbf45a['id'],_0x27e56c,_0x54d2a6,JSON[_0x9e5e('0xc')](_0x5eb525));io['to'](_0x27e56c)[_0x9e5e('0xd')](_0x54d2a6,_0x5eb525);}exports['exec']=function(_0x426d4e,_0x550eb2,_0x1c3fd3,_0x31c74b){var _0x59f761,_0xfa8a35;var _0x1f35f3={};var _0x5289a8;var _0x5d0d8f=Number(_0x1c3fd3[_0x9e5e('0xe')]);var _0x1698f3=_0x1c3fd3['data2']?Boolean(Number(_0x1c3fd3[_0x9e5e('0xf')])):![];var _0x40b1ea;var _0x309d58=![];if(!_[_0x9e5e('0x10')](_0x1c3fd3['data5'])){if(_0x1c3fd3['data5']=='1')_0x309d58=!![];}if(!_0x309d58){if(_0x31c74b[_0x9e5e('0x11')]){_0x1f35f3['id']=_0x31c74b[_0x9e5e('0x11')];}}if(!_0x1f35f3['id']){_0x1f35f3['ListId']=_0x5d0d8f;_0x40b1ea=_0x1c3fd3['data3']&&_0x1c3fd3[_0x9e5e('0x12')]!=='0'?_0x1c3fd3[_0x9e5e('0x12')]['split'](','):[_0x9e5e('0x13')];_0x1f35f3[_0x9e5e('0x14')]=_[_0x9e5e('0x15')](_0x40b1ea,function(_0x4bd9ad){var _0x45918d={};_0x45918d[_0x4bd9ad]=_0x31c74b[_0x9e5e('0x16')]?_0x31c74b['destcalleridnum']:_0x31c74b[_0x9e5e('0x17')];return _0x45918d;});_0x5289a8=_0x31c74b[_0x9e5e('0x16')]?_0x31c74b[_0x9e5e('0x18')]:_0x31c74b[_0x9e5e('0x17')];}var _0x1b153a=['id',_0x9e5e('0x19'),_0x9e5e('0x1a'),_0x9e5e('0x13'),_0x9e5e('0x1b'),'fax',_0x9e5e('0x1c'),_0x9e5e('0x1d'),_0x9e5e('0x1e'),_0x9e5e('0x1f')];var _0xe2ac11=_['union'](_0x1b153a,_0x40b1ea);BPromise[_0x9e5e('0x20')]()[_0x9e5e('0x21')](cmContactRpc[_0x9e5e('0x22')]({'attributes':_0xe2ac11,'where':_0x1f35f3,'phone':_0x5289a8}))[_0x9e5e('0x21')](function(_0x2327a0){_0xfa8a35=_0x2327a0;if(!_[_0x9e5e('0x23')](_0xfa8a35)){if(_0xfa8a35['length']===0x1){_0x59f761=_0xfa8a35[0x0];logger[_0x9e5e('0xb')](_0x9e5e('0x24'),_0x31c74b[_0x9e5e('0x25')],_0x550eb2['id'],_0x59f761['id']);}else{logger[_0x9e5e('0xb')](_0x9e5e('0x26'),_0x31c74b['uniqueid'],_0x550eb2['id'],_['map'](_0xfa8a35,'id')[_0x9e5e('0x27')](','));}return;}else{logger['info'](_0x9e5e('0x28'),_0x31c74b[_0x9e5e('0x25')],_0x550eb2['id']);var _0xb521fc={'ListId':_0x5d0d8f};var _0x2b280d=_0x1c3fd3['data4']&&_0x1c3fd3[_0x9e5e('0x29')]!=='0'?_0x1c3fd3[_0x9e5e('0x29')]:_0x9e5e('0x13');if(_0x1698f3){logger['info'](_0x9e5e('0x2a'),_0x31c74b[_0x9e5e('0x25')],_0x550eb2['id']);_0xb521fc[_0x2b280d]=_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])?_0x31c74b[_0x9e5e('0x17')]:_0x31c74b['destcalleridnum'];if(_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])){_0xb521fc['firstName']=_0x31c74b['calleridname']&&_0x31c74b[_0x9e5e('0x2b')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2b')]:'Unknown';}else{_0xb521fc[_0x9e5e('0x19')]=_0x31c74b[_0x9e5e('0x2d')]&&_0x31c74b[_0x9e5e('0x2d')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2d')]:'Unknown';}return BPromise['resolve']()[_0x9e5e('0x21')](cmContactRpc['createContact'](_0xb521fc))[_0x9e5e('0x21')](function(_0x5a2c4b){_0x59f761=_0x5a2c4b;_0xfa8a35[_0x9e5e('0x2e')](_0x5a2c4b);if(_0x59f761){logger['info'](_0x9e5e('0x2f'),_0x31c74b['uniqueid'],_0x550eb2['id'],_0x59f761['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x31c74b['uniqueid'],_0x550eb2['id']);_0xb521fc[_0x2b280d]=_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])?_0x31c74b[_0x9e5e('0x17')]:_0x31c74b[_0x9e5e('0x18')];if(_[_0x9e5e('0x10')](_0x31c74b[_0x9e5e('0x16')])){_0xb521fc[_0x9e5e('0x19')]=_0x31c74b[_0x9e5e('0x2b')]&&_0x31c74b[_0x9e5e('0x2b')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2b')]:_0x9e5e('0x30');}else{_0xb521fc[_0x9e5e('0x19')]=_0x31c74b[_0x9e5e('0x2d')]&&_0x31c74b[_0x9e5e('0x2d')]!==_0x9e5e('0x2c')?_0x31c74b[_0x9e5e('0x2d')]:_0x9e5e('0x30');}_0x59f761=_0xb521fc;_0xfa8a35[_0x9e5e('0x2e')](_0xb521fc);return;}}})['then'](function(){if(_0x426d4e){emit(_0x31c74b['uniqueid'],_0x550eb2,util[_0x9e5e('0x31')](_0x9e5e('0x32'),_0x426d4e[_0x9e5e('0x33')]),util[_0x9e5e('0x31')](_0x9e5e('0x34'),_0x1c3fd3[_0x9e5e('0x35')]['toLowerCase']()),{'evt':_[_0x9e5e('0x36')](_0x31c74b,{'autoCreate':_0x1698f3}),'contact':_0x59f761===undefined?{}:_0x59f761,'contacts':_0xfa8a35[_0x9e5e('0x37')]===0x0?undefined:_0xfa8a35});}});};
\ No newline at end of file
+var _0xf6b4=['createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','calleridname','Unknown','destcalleridname','<unknown>'];(function(_0x298b9b,_0x1778ca){var _0x57c485=function(_0x3d45dc){while(--_0x3d45dc){_0x298b9b['push'](_0x298b9b['shift']());}};_0x57c485(++_0x1778ca);}(_0xf6b4,0x1b6));var _0x4f6b=function(_0x203c05,_0x584521){_0x203c05=_0x203c05-0x0;var _0x43a504=_0xf6b4[_0x203c05];return _0x43a504;};'use strict';var _=require(_0x4f6b('0x0'));var BPromise=require(_0x4f6b('0x1'));var Redis=require(_0x4f6b('0x2'));var util=require(_0x4f6b('0x3'));var config=require(_0x4f6b('0x4'));var logger=require(_0x4f6b('0x5'))(_0x4f6b('0x6'));var cmContactRpc=require(_0x4f6b('0x7'));config[_0x4f6b('0x8')]=_['defaults'](config[_0x4f6b('0x8')],{'host':_0x4f6b('0x9'),'port':0x18eb});var io=require(_0x4f6b('0xa'))(new Redis(config[_0x4f6b('0x8')]));function emit(_0x527e65,_0xaba707,_0x597322,_0x337939,_0x9a1587){logger['info'](_0x4f6b('0xb'),_0x527e65,_0xaba707['id'],_0x597322,_0x337939,JSON[_0x4f6b('0xc')](_0x9a1587));io['to'](_0x597322)[_0x4f6b('0xd')](_0x337939,_0x9a1587);}exports[_0x4f6b('0xe')]=function(_0x183eec,_0x3529f3,_0x59ed6b,_0x5c75df){var _0x324ef1,_0x222935;var _0x8e2c73={};var _0x169d84;var _0x1d39f5=Number(_0x59ed6b[_0x4f6b('0xf')]);var _0x4917f4=_0x59ed6b[_0x4f6b('0x10')]?Boolean(Number(_0x59ed6b['data2'])):![];var _0x20d873;var _0x55b07a=![];if(!_['isNil'](_0x59ed6b[_0x4f6b('0x11')])){if(_0x59ed6b[_0x4f6b('0x11')]=='1')_0x55b07a=!![];}if(!_0x55b07a){if(_0x5c75df[_0x4f6b('0x12')]){_0x8e2c73['id']=_0x5c75df['xmd-contactid'];}}if(!_0x8e2c73['id']){_0x8e2c73[_0x4f6b('0x13')]=_0x1d39f5;_0x20d873=_0x59ed6b['data3']&&_0x59ed6b[_0x4f6b('0x14')]!=='0'?_0x59ed6b['data3']['split'](','):['phone'];_0x8e2c73[_0x4f6b('0x15')]=_[_0x4f6b('0x16')](_0x20d873,function(_0xb19188){var _0x3a7f2a={};_0x3a7f2a[_0xb19188]=_0x5c75df[_0x4f6b('0x17')]?_0x5c75df[_0x4f6b('0x18')]:_0x5c75df[_0x4f6b('0x19')];return _0x3a7f2a;});_0x169d84=_0x5c75df[_0x4f6b('0x17')]?_0x5c75df[_0x4f6b('0x18')]:_0x5c75df[_0x4f6b('0x19')];}var _0x173ed7=['id',_0x4f6b('0x1a'),_0x4f6b('0x1b'),_0x4f6b('0x1c'),'mobile',_0x4f6b('0x1d'),_0x4f6b('0x13'),'createdAt',_0x4f6b('0x1e'),_0x4f6b('0x1f')];var _0x2b1441=_[_0x4f6b('0x20')](_0x173ed7,_0x20d873);BPromise[_0x4f6b('0x21')]()[_0x4f6b('0x22')](cmContactRpc['getContacts']({'attributes':_0x2b1441,'where':_0x8e2c73,'phone':_0x169d84}))[_0x4f6b('0x22')](function(_0x5e99bf){_0x222935=_0x5e99bf;if(!_[_0x4f6b('0x23')](_0x222935)){if(_0x222935[_0x4f6b('0x24')]===0x1){_0x324ef1=_0x222935[0x0];logger[_0x4f6b('0x25')](_0x4f6b('0x26'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id'],_0x324ef1['id']);}else{logger[_0x4f6b('0x25')](_0x4f6b('0x28'),_0x5c75df['uniqueid'],_0x3529f3['id'],_[_0x4f6b('0x16')](_0x222935,'id')[_0x4f6b('0x29')](','));}return;}else{logger['info'](_0x4f6b('0x2a'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id']);var _0x456294={'ListId':_0x1d39f5};var _0x480d86=_0x59ed6b[_0x4f6b('0x2b')]&&_0x59ed6b[_0x4f6b('0x2b')]!=='0'?_0x59ed6b[_0x4f6b('0x2b')]:_0x4f6b('0x1c');if(_0x4917f4){logger['info'](_0x4f6b('0x2c'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id']);_0x456294[_0x480d86]=_[_0x4f6b('0x2d')](_0x5c75df[_0x4f6b('0x17')])?_0x5c75df[_0x4f6b('0x19')]:_0x5c75df[_0x4f6b('0x18')];if(_[_0x4f6b('0x2d')](_0x5c75df[_0x4f6b('0x17')])){_0x456294[_0x4f6b('0x1a')]=_0x5c75df[_0x4f6b('0x2e')]&&_0x5c75df['calleridname']!=='<unknown>'?_0x5c75df[_0x4f6b('0x2e')]:_0x4f6b('0x2f');}else{_0x456294[_0x4f6b('0x1a')]=_0x5c75df[_0x4f6b('0x30')]&&_0x5c75df[_0x4f6b('0x30')]!==_0x4f6b('0x31')?_0x5c75df['destcalleridname']:_0x4f6b('0x2f');}return BPromise[_0x4f6b('0x21')]()[_0x4f6b('0x22')](cmContactRpc[_0x4f6b('0x32')](_0x456294))[_0x4f6b('0x22')](function(_0xfe327f){_0x324ef1=_0xfe327f;_0x222935[_0x4f6b('0x33')](_0xfe327f);if(_0x324ef1){logger[_0x4f6b('0x25')](_0x4f6b('0x34'),_0x5c75df[_0x4f6b('0x27')],_0x3529f3['id'],_0x324ef1['id']);}return;});}else{logger[_0x4f6b('0x25')](_0x4f6b('0x35'),_0x5c75df['uniqueid'],_0x3529f3['id']);_0x456294[_0x480d86]=_[_0x4f6b('0x2d')](_0x5c75df['routeId'])?_0x5c75df['calleridnum']:_0x5c75df[_0x4f6b('0x18')];if(_[_0x4f6b('0x2d')](_0x5c75df['routeId'])){_0x456294['firstName']=_0x5c75df[_0x4f6b('0x2e')]&&_0x5c75df['calleridname']!==_0x4f6b('0x31')?_0x5c75df['calleridname']:_0x4f6b('0x2f');}else{_0x456294['firstName']=_0x5c75df[_0x4f6b('0x30')]&&_0x5c75df[_0x4f6b('0x30')]!=='<unknown>'?_0x5c75df[_0x4f6b('0x30')]:_0x4f6b('0x2f');}_0x324ef1=_0x456294;_0x222935['push'](_0x456294);return;}}})['then'](function(){if(_0x183eec){emit(_0x5c75df[_0x4f6b('0x27')],_0x3529f3,util[_0x4f6b('0x36')](_0x4f6b('0x37'),_0x183eec[_0x4f6b('0x38')]),util[_0x4f6b('0x36')](_0x4f6b('0x39'),_0x59ed6b[_0x4f6b('0x3a')][_0x4f6b('0x3b')]()),{'evt':_[_0x4f6b('0x3c')](_0x5c75df,{'autoCreate':_0x4917f4}),'contact':_0x324ef1===undefined?{}:_0x324ef1,'contacts':_0x222935[_0x4f6b('0x24')]===0x0?undefined:_0x222935});}});};
\ No newline at end of file
index 0b0d8c7..77d2780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6132=['data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','data6','winArguments','format','user:%s','name','trigger:%s:%s','toLowerCase','jscripty','emit','trigger:%s','merge','exec','accounts','queue','routeId','urlforward','script','parse','query','search','replace','checkTrigger','channel','AllConditions','every','AnyConditions','some','checkConditions','account','operator','value','ChatWebsiteId','upperFirst','AccountId','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','undefined','offlineMessage','created','exports','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/logger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','syncCustomEvent','custom:agentconnect','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','info','stringify','prototype','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','variables','Actions','length','action','contactmanager','browser','data1'];(function(_0x54bdd1,_0x48f43c){var _0x161bf4=function(_0x38eae4){while(--_0x38eae4){_0x54bdd1['push'](_0x54bdd1['shift']());}};_0x161bf4(++_0x48f43c);}(_0x6132,0x13a));var _0x2613=function(_0x58d63b,_0x56b3d2){_0x58d63b=_0x58d63b-0x0;var _0x417200=_0x6132[_0x58d63b];return _0x417200;};'use strict';var util=require(_0x2613('0x0'));var _=require(_0x2613('0x1'));var url=require(_0x2613('0x2'));var Mustache=require(_0x2613('0x3'));var Redis=require('ioredis');var urlforward=require(_0x2613('0x4'));var integration=require(_0x2613('0x5'));var cmContact=require(_0x2613('0x6'));var script=require(_0x2613('0x7'));var config=require('../../../config/environment');var logger=require(_0x2613('0x8'))('trigger');var ami=require('../ami');config[_0x2613('0x9')]=_[_0x2613('0xa')](config[_0x2613('0x9')],{'host':_0x2613('0xb'),'port':0x18eb});var io=require(_0x2613('0xc'))(new Redis(config['redis']));var operators={'equals':function(_0x370d75,_0x3e8f36){return _0x370d75==_0x3e8f36;},'not_equals':function(_0x196831,_0x5c9af5){return _0x196831!=_0x5c9af5;}};var barAndWebActions=[_0x2613('0xd'),_0x2613('0x2'),_0x2613('0xe')];function Trigger(_0x37fe48){this[_0x2613('0xf')]=_0x37fe48[_0x2613('0xf')];this[_0x2613('0x10')]=_0x37fe48[_0x2613('0x10')];this[_0x2613('0x11')]=_0x37fe48[_0x2613('0x11')];this['templates']=_0x37fe48[_0x2613('0x12')];this[_0x2613('0x13')]=_0x37fe48[_0x2613('0x13')];this[_0x2613('0x14')]=_0x37fe48['zendeskAccounts'];this[_0x2613('0x15')]=_0x37fe48[_0x2613('0x15')];this[_0x2613('0x16')]=_0x37fe48[_0x2613('0x16')];this['sugarcrmAccounts']=_0x37fe48[_0x2613('0x17')];this[_0x2613('0x18')]=_0x37fe48[_0x2613('0x18')];this[_0x2613('0x19')]=_0x37fe48['deskAccounts'];this[_0x2613('0x1a')]=_0x37fe48[_0x2613('0x1a')];this['servicenowAccounts']=_0x37fe48[_0x2613('0x1b')];this[_0x2613('0x1c')]=_0x37fe48[_0x2613('0x1c')];this[_0x2613('0x1d')]=_0x37fe48[_0x2613('0x1d')];this['accounts']={'zendesk':this[_0x2613('0x14')],'salesforce':this[_0x2613('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x2613('0x17')],'zoho':this[_0x2613('0x18')],'desk':this[_0x2613('0x19')],'vtiger':this[_0x2613('0x1a')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x2613('0x1d')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x2613('0x1e')]['bind'](this));ami['on'](_0x2613('0x1f'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0x2613('0x20')](this));ami['on'](_0x2613('0x21'),this['syncCustomEvent'][_0x2613('0x20')](this));ami['on'](_0x2613('0x22'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x23'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x24'),this['syncCustomEvent'][_0x2613('0x20')](this));ami['on'](_0x2613('0x25'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x26'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x27'),this[_0x2613('0x1e')]['bind'](this));ami['on'](_0x2613('0x28'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x29'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x2a'),this[_0x2613('0x2b')]['bind'](this));ami['on'](_0x2613('0x2c'),this[_0x2613('0x2b')][_0x2613('0x20')](this));ami['on'](_0x2613('0x2d'),this[_0x2613('0x2b')][_0x2613('0x20')](this));ami['on']('custom:newinteraction',this[_0x2613('0x1e')]['bind'](this));ami['on'](_0x2613('0x2e'),this['syncCustomEvent'][_0x2613('0x20')](this));ami['on']('custom:substatus',this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x2f'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x30'),this['syncCustomEvent']['bind'](this));ami['on'](_0x2613('0x31'),this[_0x2613('0x1e')][_0x2613('0x20')](this));ami['on'](_0x2613('0x32'),this[_0x2613('0x1e')][_0x2613('0x20')](this));}Trigger['prototype']['emit']=function(_0x26615c,_0x4df905,_0x506097){logger[_0x2613('0x33')](_0x26615c,_0x4df905,JSON[_0x2613('0x34')](_0x506097));io['to'](_0x26615c)['emit'](_0x4df905,_0x506097);};Trigger[_0x2613('0x35')]['syncCustomEvent']=function(_0x2ff547){var _0x2e8200=_['clone'](_0x2ff547);if(typeof _0x2e8200['motionChannel']==='undefined'){_0x2e8200[_0x2613('0x36')]=_0x2613('0x37');}this[_0x2613('0x38')](_0x2e8200);};Trigger['prototype'][_0x2613('0x2b')]=function(_0x3e732a){if(this[_0x2613('0x10')][_0x3e732a[_0x2613('0x39')]]){this[_0x2613('0x1e')](_0x3e732a);}};Trigger['prototype']['checkTriggers']=function(_0x34846b){var _0x3f49d3;for(var _0x46126d in this['triggers']){if(this['triggers'][_0x2613('0x3a')](_0x46126d)){if(this[_0x2613('0xf')][_0x46126d][_0x2613('0x3b')]){_0x3f49d3=this['checkTrigger'](this['triggers'][_0x46126d],_0x34846b);if(_0x3f49d3){_['merge'](_0x34846b,_0x34846b[_0x2613('0x3c')]);for(var _0x18abfe=0x0,_0x300eb5,_0x4ca62b,_0x3cf14e;_0x18abfe<this[_0x2613('0xf')][_0x46126d][_0x2613('0x3d')][_0x2613('0x3e')];_0x18abfe+=0x1){_0x300eb5=this[_0x2613('0xf')][_0x46126d][_0x2613('0x3d')][_0x18abfe];if(this[_0x2613('0x10')][_0x34846b[_0x2613('0x39')]]){switch(_0x300eb5[_0x2613('0x3f')]['toLowerCase']()){case _0x2613('0x40'):break;case'motionbar':case _0x2613('0x41'):var _0x3a08f2={};switch(barAndWebActions[_0x300eb5[_0x2613('0x42')]]){case'popup':_0x3a08f2['TemplateId']=_0x300eb5[_0x2613('0x43')];_0x3a08f2[_0x2613('0x44')]=this[_0x2613('0x12')][_0x300eb5[_0x2613('0x43')]]?Mustache[_0x2613('0x45')](this['templates'][_0x300eb5['data2']]['html'],_0x34846b):_0x2613('0x46');break;case _0x2613('0x2'):_0x3a08f2[_0x2613('0x47')]=this[_0x2613('0x48')](_0x300eb5['data2'],_0x34846b,_[_0x2613('0x49')](_0x300eb5['data3'])?!![]:parseInt(_0x300eb5[_0x2613('0x4a')],0xa));if(_['isNil'](_0x300eb5['data4'])){_0x3a08f2[_0x2613('0x4b')]='0';}else{_0x3a08f2[_0x2613('0x4c')]=_0x300eb5[_0x2613('0x4d')];_0x3a08f2[_0x2613('0x4e')]=_[_0x2613('0x49')](_0x300eb5[_0x2613('0x4f')])?_0x2613('0x50'):_0x300eb5[_0x2613('0x4f')];_0x3a08f2['windowHeight']=_[_0x2613('0x49')](_0x300eb5['data6'])?'600':_0x300eb5[_0x2613('0x51')];}break;case _0x2613('0xe'):_0x3a08f2['winApplication']=_0x300eb5[_0x2613('0x43')]?Mustache[_0x2613('0x45')](_0x300eb5['data2'],_0x34846b):'';_0x3a08f2[_0x2613('0x52')]=_0x300eb5[_0x2613('0x4a')]?Mustache['render'](_0x300eb5[_0x2613('0x4a')],_0x34846b):'';break;}this['emit'](util[_0x2613('0x53')](_0x2613('0x54'),this[_0x2613('0x10')][_0x34846b['interface']][_0x2613('0x55')]),util['format'](_0x2613('0x56'),_0x300eb5['action'][_0x2613('0x57')](),barAndWebActions[_0x300eb5[_0x2613('0x42')]]),_['merge'](_0x3a08f2,_0x34846b));break;case _0x2613('0x58'):this[_0x2613('0x59')](util[_0x2613('0x53')](_0x2613('0x54'),this[_0x2613('0x10')][_0x34846b[_0x2613('0x39')]]['name']),util[_0x2613('0x53')](_0x2613('0x5a'),_0x300eb5[_0x2613('0x3f')][_0x2613('0x57')]()),_[_0x2613('0x5b')]({'ProjectId':parseInt(_0x300eb5['data1'],0xa)},_0x34846b));break;default:this[_0x2613('0x59')](util[_0x2613('0x53')](_0x2613('0x54'),this[_0x2613('0x10')][_0x34846b['interface']][_0x2613('0x55')]),util['format'](_0x2613('0x5a'),_0x300eb5[_0x2613('0x3f')][_0x2613('0x57')]()),_['merge']({},_0x300eb5,_0x34846b));}}switch(_0x300eb5[_0x2613('0x3f')]['toLowerCase']()){case _0x2613('0x40'):cmContact['exec'](this[_0x2613('0x10')][_0x34846b['interface']],this['triggers'][_0x46126d],_0x300eb5,_0x34846b);break;case'integration':integration[_0x2613('0x5c')](_0x300eb5,_0x34846b,this[_0x2613('0x5d')],this[_0x2613('0x10')][_0x34846b[_0x2613('0x39')]],this[_0x2613('0x11')][_0x34846b[_0x2613('0x5e')]],this['voiceExtensions'][_0x34846b[_0x2613('0x5f')]]);break;case _0x2613('0x60'):urlforward[_0x2613('0x5c')](_0x300eb5,_0x34846b);break;case _0x2613('0x61'):script[_0x2613('0x5c')](_0x300eb5,_0x34846b);break;}}}}}}};Trigger[_0x2613('0x35')][_0x2613('0x48')]=function(_0x4228f7,_0x5ebcfb,_0x1dd94a){var _0x1d5793=url[_0x2613('0x62')](Mustache[_0x2613('0x45')](_0x4228f7,_0x5ebcfb),!![]);if(_0x1dd94a){_[_0x2613('0x5b')](_0x1d5793[_0x2613('0x63')],_0x5ebcfb);}delete _0x1d5793[_0x2613('0x64')];var _0x4eeb61=url[_0x2613('0x53')](_0x1d5793);_0x4eeb61=_0x4eeb61[_0x2613('0x65')](/\/\?/g,'?');return _0x4eeb61;};Trigger['prototype'][_0x2613('0x66')]=function(_0x4e795d,_0x1ff9bb){var _0x2c81f5=!![];var _0x3869a8=!![];var _0x5df758=![];if(_0x4e795d[_0x2613('0x67')]===_0x1ff9bb[_0x2613('0x36')]){_0x5df758=!![];}if(_0x4e795d[_0x2613('0x68')][_0x2613('0x3e')]){_0x2c81f5=_[_0x2613('0x69')](_0x4e795d[_0x2613('0x68')],this['checkConditions'](_0x1ff9bb,_0x4e795d[_0x2613('0x67')]));}if(_0x4e795d[_0x2613('0x6a')][_0x2613('0x3e')]){_0x3869a8=_[_0x2613('0x6b')](_0x4e795d[_0x2613('0x6a')],this[_0x2613('0x6c')](_0x1ff9bb,_0x4e795d[_0x2613('0x67')]));}return _0x5df758&&_0x2c81f5&&_0x3869a8;};Trigger[_0x2613('0x35')][_0x2613('0x6c')]=function(_0x16cea6,_0x3090a3){return function(_0x56bb47){switch(_0x56bb47['field']){case _0x2613('0x6d'):if(_0x16cea6['channel']===_0x3090a3){if(_0x3090a3==='chat'){return _0x16cea6['ChatWebsiteId']?operators[_0x56bb47[_0x2613('0x6e')]](Number(_0x56bb47[_0x2613('0x6f')]),_0x16cea6[_0x2613('0x70')]):![];}else{return _0x16cea6[_[_0x2613('0x71')](_0x3090a3)+_0x2613('0x72')]?operators[_0x56bb47[_0x2613('0x6e')]](Number(_0x56bb47['value']),_0x16cea6[_[_0x2613('0x71')](_0x3090a3)+_0x2613('0x72')]):![];}}break;case'interaction':case _0x2613('0x73'):if(_0x16cea6['channel']===_0x3090a3){return _0x16cea6[_0x2613('0x74')]?operators[_0x56bb47['operator']](_0x56bb47[_0x2613('0x6f')],_0x16cea6[_0x2613('0x74')]):![];}break;case _0x2613('0x5e'):return _0x16cea6[_0x2613('0x5e')]?operators[_0x56bb47[_0x2613('0x6e')]](_0x56bb47[_0x2613('0x6f')],_0x16cea6[_0x2613('0x5e')]):![];case _0x2613('0x75'):return _0x16cea6[_0x2613('0x76')]?operators[_0x56bb47[_0x2613('0x6e')]](_0x56bb47[_0x2613('0x6f')],_0x16cea6[_0x2613('0x76')]):![];case _0x2613('0x77'):return _0x16cea6[_0x2613('0x77')]?operators[_0x56bb47['operator']](_0x56bb47[_0x2613('0x6f')],_0x16cea6['lastevent']):![];case'routeId':return _0x16cea6[_0x2613('0x5f')]?operators[_0x56bb47[_0x2613('0x6e')]](_0x56bb47[_0x2613('0x6f')],_0x16cea6[_0x2613('0x5f')]):![];case _0x2613('0x78'):if(_0x56bb47[_0x2613('0x6f')]===_0x2613('0x79'))_0x56bb47[_0x2613('0x6f')]=null;return typeof _0x16cea6[_0x2613('0x7a')]!==_0x2613('0x7b')?operators[_0x56bb47[_0x2613('0x6e')]](_0x56bb47['value'],_0x16cea6[_0x2613('0x7a')]):![];case _0x2613('0x7c'):if(_0x16cea6['channel']===_0x3090a3){return _0x56bb47[_0x2613('0x6f')]===_0x2613('0x7d')&&_0x56bb47[_0x2613('0x6e')]==='equals'?!![]:![];}break;}return![];};};module[_0x2613('0x7e')]=Trigger;
\ No newline at end of file
+var _0x7d2a=['some','AnyConditions','field','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','event','agent','lastevent','mailSubstatus','substatus','offlineMessage','equals','exports','util','mustache','ioredis','./integration','./cmContact','./script','trigger','../ami','redis','defaults','socket.io-emitter','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','undefined','motionChannel','voice','checkTriggers','agents','interface','checkTrigger','merge','variables','length','Actions','action','toLowerCase','motionbar','browser','popup','data2','html','render','template\x20not\x20found','url','buildUri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','name','format','data1','jscripty','user:%s','trigger:%s','contactmanager','exec','integration','queue','routeId','script','replace','checkConditions','channel'];(function(_0x2de3a8,_0xba59c6){var _0x597892=function(_0x15fed8){while(--_0x15fed8){_0x2de3a8['push'](_0x2de3a8['shift']());}};_0x597892(++_0xba59c6);}(_0x7d2a,0x171));var _0xa7d2=function(_0x37b2b7,_0x32e421){_0x37b2b7=_0x37b2b7-0x0;var _0x4c3951=_0x7d2a[_0x37b2b7];return _0x4c3951;};'use strict';var util=require(_0xa7d2('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0xa7d2('0x1'));var Redis=require(_0xa7d2('0x2'));var urlforward=require('./urlforward');var integration=require(_0xa7d2('0x3'));var cmContact=require(_0xa7d2('0x4'));var script=require(_0xa7d2('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa7d2('0x6'));var ami=require(_0xa7d2('0x7'));config[_0xa7d2('0x8')]=_[_0xa7d2('0x9')](config[_0xa7d2('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xa7d2('0xa'))(new Redis(config[_0xa7d2('0x8')]));var operators={'equals':function(_0x20d699,_0x157b87){return _0x20d699==_0x157b87;},'not_equals':function(_0x6c7fc1,_0x5c96bb){return _0x6c7fc1!=_0x5c96bb;}};var barAndWebActions=['popup','url',_0xa7d2('0xb')];function Trigger(_0x22ee8b){this[_0xa7d2('0xc')]=_0x22ee8b[_0xa7d2('0xc')];this['agents']=_0x22ee8b['agents'];this[_0xa7d2('0xd')]=_0x22ee8b[_0xa7d2('0xd')];this[_0xa7d2('0xe')]=_0x22ee8b[_0xa7d2('0xe')];this['voiceExtensions']=_0x22ee8b[_0xa7d2('0xf')];this[_0xa7d2('0x10')]=_0x22ee8b['zendeskAccounts'];this[_0xa7d2('0x11')]=_0x22ee8b['freshdeskAccounts'];this[_0xa7d2('0x12')]=_0x22ee8b[_0xa7d2('0x12')];this[_0xa7d2('0x13')]=_0x22ee8b[_0xa7d2('0x13')];this['zohoAccounts']=_0x22ee8b['zohoAccounts'];this[_0xa7d2('0x14')]=_0x22ee8b[_0xa7d2('0x14')];this[_0xa7d2('0x15')]=_0x22ee8b[_0xa7d2('0x15')];this[_0xa7d2('0x16')]=_0x22ee8b['servicenowAccounts'];this['dynamics365Accounts']=_0x22ee8b[_0xa7d2('0x17')];this[_0xa7d2('0x18')]=_0x22ee8b[_0xa7d2('0x18')];this[_0xa7d2('0x19')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xa7d2('0x12')],'freshdesk':this[_0xa7d2('0x11')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xa7d2('0x1a')],'desk':this[_0xa7d2('0x14')],'vtiger':this[_0xa7d2('0x15')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0xa7d2('0x1b'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on']('custom:agentconnect',this['syncCustomEvent']['bind'](this));ami['on'](_0xa7d2('0x1e'),this[_0xa7d2('0x1c')]['bind'](this));ami['on'](_0xa7d2('0x1f'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x20'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x21'),this[_0xa7d2('0x1c')]['bind'](this));ami['on'](_0xa7d2('0x22'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentcongestion',this['syncCustomEvent']['bind'](this));ami['on'](_0xa7d2('0x23'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on']('custom:amd',this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x24'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x25'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x26'),this['syncAgentDial'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x27'),this[_0xa7d2('0x28')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x29'),this[_0xa7d2('0x28')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2a'),this[_0xa7d2('0x1c')]['bind'](this));ami['on'](_0xa7d2('0x2b'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2c'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2d'),this['syncCustomEvent'][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2e'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x2f'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on'](_0xa7d2('0x30'),this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));ami['on']('custom:offlineMessage',this[_0xa7d2('0x1c')][_0xa7d2('0x1d')](this));}Trigger[_0xa7d2('0x31')][_0xa7d2('0x32')]=function(_0x372427,_0x1be86f,_0x3f082f){logger[_0xa7d2('0x33')](_0x372427,_0x1be86f,JSON['stringify'](_0x3f082f));io['to'](_0x372427)[_0xa7d2('0x32')](_0x1be86f,_0x3f082f);};Trigger[_0xa7d2('0x31')]['syncCustomEvent']=function(_0x37d93a){var _0xb680bd=_['clone'](_0x37d93a);if(typeof _0xb680bd['motionChannel']===_0xa7d2('0x34')){_0xb680bd[_0xa7d2('0x35')]=_0xa7d2('0x36');}this[_0xa7d2('0x37')](_0xb680bd);};Trigger['prototype'][_0xa7d2('0x28')]=function(_0x4449d6){if(this[_0xa7d2('0x38')][_0x4449d6[_0xa7d2('0x39')]]){this[_0xa7d2('0x1c')](_0x4449d6);}};Trigger[_0xa7d2('0x31')][_0xa7d2('0x37')]=function(_0xba3527){var _0x233618;for(var _0x2b946f in this[_0xa7d2('0xc')]){if(this[_0xa7d2('0xc')]['hasOwnProperty'](_0x2b946f)){if(this[_0xa7d2('0xc')][_0x2b946f]['status']){_0x233618=this[_0xa7d2('0x3a')](this[_0xa7d2('0xc')][_0x2b946f],_0xba3527);if(_0x233618){_[_0xa7d2('0x3b')](_0xba3527,_0xba3527[_0xa7d2('0x3c')]);for(var _0x19fb45=0x0,_0x5c747a,_0x2579bc,_0x3d321f;_0x19fb45<this[_0xa7d2('0xc')][_0x2b946f]['Actions'][_0xa7d2('0x3d')];_0x19fb45+=0x1){_0x5c747a=this[_0xa7d2('0xc')][_0x2b946f][_0xa7d2('0x3e')][_0x19fb45];if(this['agents'][_0xba3527[_0xa7d2('0x39')]]){switch(_0x5c747a[_0xa7d2('0x3f')][_0xa7d2('0x40')]()){case'contactmanager':break;case _0xa7d2('0x41'):case _0xa7d2('0x42'):var _0x3d33cf={};switch(barAndWebActions[_0x5c747a['data1']]){case _0xa7d2('0x43'):_0x3d33cf['TemplateId']=_0x5c747a[_0xa7d2('0x44')];_0x3d33cf[_0xa7d2('0x45')]=this[_0xa7d2('0xe')][_0x5c747a[_0xa7d2('0x44')]]?Mustache[_0xa7d2('0x46')](this[_0xa7d2('0xe')][_0x5c747a['data2']]['html'],_0xba3527):_0xa7d2('0x47');break;case _0xa7d2('0x48'):_0x3d33cf['uri']=this[_0xa7d2('0x49')](_0x5c747a[_0xa7d2('0x44')],_0xba3527,_[_0xa7d2('0x4a')](_0x5c747a[_0xa7d2('0x4b')])?!![]:parseInt(_0x5c747a[_0xa7d2('0x4b')],0xa));if(_['isNil'](_0x5c747a[_0xa7d2('0x4c')])){_0x3d33cf[_0xa7d2('0x4d')]='0';}else{_0x3d33cf['uriLocation']=_0x5c747a[_0xa7d2('0x4c')];_0x3d33cf[_0xa7d2('0x4e')]=_['isNil'](_0x5c747a[_0xa7d2('0x4f')])?_0xa7d2('0x50'):_0x5c747a[_0xa7d2('0x4f')];_0x3d33cf[_0xa7d2('0x51')]=_[_0xa7d2('0x4a')](_0x5c747a[_0xa7d2('0x52')])?_0xa7d2('0x53'):_0x5c747a[_0xa7d2('0x52')];}break;case'winapp':_0x3d33cf['winApplication']=_0x5c747a[_0xa7d2('0x44')]?Mustache[_0xa7d2('0x46')](_0x5c747a[_0xa7d2('0x44')],_0xba3527):'';_0x3d33cf['winArguments']=_0x5c747a[_0xa7d2('0x4b')]?Mustache[_0xa7d2('0x46')](_0x5c747a[_0xa7d2('0x4b')],_0xba3527):'';break;}this['emit'](util['format']('user:%s',this[_0xa7d2('0x38')][_0xba3527['interface']][_0xa7d2('0x54')]),util[_0xa7d2('0x55')]('trigger:%s:%s',_0x5c747a[_0xa7d2('0x3f')]['toLowerCase'](),barAndWebActions[_0x5c747a[_0xa7d2('0x56')]]),_[_0xa7d2('0x3b')](_0x3d33cf,_0xba3527));break;case _0xa7d2('0x57'):this[_0xa7d2('0x32')](util[_0xa7d2('0x55')](_0xa7d2('0x58'),this['agents'][_0xba3527[_0xa7d2('0x39')]][_0xa7d2('0x54')]),util[_0xa7d2('0x55')](_0xa7d2('0x59'),_0x5c747a[_0xa7d2('0x3f')][_0xa7d2('0x40')]()),_[_0xa7d2('0x3b')]({'ProjectId':parseInt(_0x5c747a[_0xa7d2('0x56')],0xa)},_0xba3527));break;default:this['emit'](util['format'](_0xa7d2('0x58'),this[_0xa7d2('0x38')][_0xba3527[_0xa7d2('0x39')]][_0xa7d2('0x54')]),util[_0xa7d2('0x55')]('trigger:%s',_0x5c747a['action'][_0xa7d2('0x40')]()),_[_0xa7d2('0x3b')]({},_0x5c747a,_0xba3527));}}switch(_0x5c747a[_0xa7d2('0x3f')][_0xa7d2('0x40')]()){case _0xa7d2('0x5a'):cmContact[_0xa7d2('0x5b')](this[_0xa7d2('0x38')][_0xba3527[_0xa7d2('0x39')]],this[_0xa7d2('0xc')][_0x2b946f],_0x5c747a,_0xba3527);break;case _0xa7d2('0x5c'):integration[_0xa7d2('0x5b')](_0x5c747a,_0xba3527,this[_0xa7d2('0x19')],this[_0xa7d2('0x38')][_0xba3527[_0xa7d2('0x39')]],this[_0xa7d2('0xd')][_0xba3527[_0xa7d2('0x5d')]],this[_0xa7d2('0xf')][_0xba3527[_0xa7d2('0x5e')]]);break;case'urlforward':urlforward['exec'](_0x5c747a,_0xba3527);break;case _0xa7d2('0x5f'):script[_0xa7d2('0x5b')](_0x5c747a,_0xba3527);break;}}}}}}};Trigger[_0xa7d2('0x31')][_0xa7d2('0x49')]=function(_0x5db5db,_0x43342b,_0x3b474e){var _0x5dcdbe=url['parse'](Mustache[_0xa7d2('0x46')](_0x5db5db,_0x43342b),!![]);if(_0x3b474e){_[_0xa7d2('0x3b')](_0x5dcdbe['query'],_0x43342b);}delete _0x5dcdbe['search'];var _0x36ffa1=url[_0xa7d2('0x55')](_0x5dcdbe);_0x36ffa1=_0x36ffa1[_0xa7d2('0x60')](/\/\?/g,'?');return _0x36ffa1;};Trigger[_0xa7d2('0x31')][_0xa7d2('0x3a')]=function(_0x592668,_0x2725fd){var _0x320139=!![];var _0x2d8afd=!![];var _0x1b1a7d=![];if(_0x592668['channel']===_0x2725fd[_0xa7d2('0x35')]){_0x1b1a7d=!![];}if(_0x592668['AllConditions'][_0xa7d2('0x3d')]){_0x320139=_['every'](_0x592668['AllConditions'],this[_0xa7d2('0x61')](_0x2725fd,_0x592668[_0xa7d2('0x62')]));}if(_0x592668['AnyConditions']['length']){_0x2d8afd=_[_0xa7d2('0x63')](_0x592668[_0xa7d2('0x64')],this[_0xa7d2('0x61')](_0x2725fd,_0x592668['channel']));}return _0x1b1a7d&&_0x320139&&_0x2d8afd;};Trigger[_0xa7d2('0x31')][_0xa7d2('0x61')]=function(_0x414d5b,_0x328946){return function(_0x121772){switch(_0x121772[_0xa7d2('0x65')]){case'account':if(_0x414d5b[_0xa7d2('0x62')]===_0x328946){if(_0x328946==='chat'){return _0x414d5b[_0xa7d2('0x66')]?operators[_0x121772[_0xa7d2('0x67')]](Number(_0x121772['value']),_0x414d5b[_0xa7d2('0x66')]):![];}else{return _0x414d5b[_[_0xa7d2('0x68')](_0x328946)+_0xa7d2('0x69')]?operators[_0x121772[_0xa7d2('0x67')]](Number(_0x121772[_0xa7d2('0x6a')]),_0x414d5b[_[_0xa7d2('0x68')](_0x328946)+'AccountId']):![];}}break;case _0xa7d2('0x6b'):case _0xa7d2('0x6c'):if(_0x414d5b[_0xa7d2('0x62')]===_0x328946){return _0x414d5b[_0xa7d2('0x6d')]?operators[_0x121772[_0xa7d2('0x67')]](_0x121772['value'],_0x414d5b[_0xa7d2('0x6d')]):![];}break;case'queue':return _0x414d5b['queue']?operators[_0x121772[_0xa7d2('0x67')]](_0x121772['value'],_0x414d5b['queue']):![];case _0xa7d2('0x6e'):return _0x414d5b['membername']?operators[_0x121772[_0xa7d2('0x67')]](_0x121772[_0xa7d2('0x6a')],_0x414d5b['membername']):![];case'lastevent':return _0x414d5b[_0xa7d2('0x6f')]?operators[_0x121772[_0xa7d2('0x67')]](_0x121772[_0xa7d2('0x6a')],_0x414d5b[_0xa7d2('0x6f')]):![];case _0xa7d2('0x5e'):return _0x414d5b['routeId']?operators[_0x121772[_0xa7d2('0x67')]](_0x121772[_0xa7d2('0x6a')],_0x414d5b['routeId']):![];case _0xa7d2('0x70'):if(_0x121772['value']==='null')_0x121772['value']=null;return typeof _0x414d5b[_0xa7d2('0x71')]!=='undefined'?operators[_0x121772[_0xa7d2('0x67')]](_0x121772[_0xa7d2('0x6a')],_0x414d5b[_0xa7d2('0x71')]):![];case _0xa7d2('0x72'):if(_0x414d5b['channel']===_0x328946){return _0x121772['value']==='created'&&_0x121772['operator']===_0xa7d2('0x73')?!![]:![];}break;}return![];};};module[_0xa7d2('0x74')]=Trigger;
\ No newline at end of file
index 3774837..98d3f5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x326f,0xd1));var _0xf326=function(_0x11c120,_0x27509b){_0x11c120=_0x11c120-0x0;var _0x42eead=_0x326f[_0x11c120];return _0x42eead;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});};
\ No newline at end of file
+var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0xd72ecb,_0x43db2b){var _0x4d1675=function(_0xaee005){while(--_0xaee005){_0xd72ecb['push'](_0xd72ecb['shift']());}};_0x4d1675(++_0x43db2b);}(_0x7217,0x19e));var _0x7721=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x7217[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});};
\ No newline at end of file
index 74e4661..a772591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb7f=['destcalleridnum','/systemusers(','body','headers','odata-entityid','lastIndexOf','calleridnum','telephone1','contacts?$select=','replace','%2b','Bearer\x20','contactid','nothing',']\x20Enduser\x20created!','enduserId','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','incident','POST','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','callDirection','queue','phonecalls','substring','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','%s/api/data/v9.0/','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','./util','md5','ioredis','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','tenantId','data2','resolve','data5','clientId','remoteUri','password','clientSecret','access_token','catch','error','toUpperCase','then','GET','4.0','value','isNil','validateEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','message','toLowerCase','outbound'];(function(_0x198164,_0x4269db){var _0x351451=function(_0xef73da){while(--_0xef73da){_0x198164['push'](_0x198164['shift']());}};_0x351451(++_0x4269db);}(_0xeb7f,0x185));var _0xfeb7=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xeb7f[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0xfeb7('0x0'));var rp=require(_0xfeb7('0x1'));var util=require(_0xfeb7('0x2'));var intUtil=require(_0xfeb7('0x3'));var md5=require(_0xfeb7('0x4'));var Redis=require(_0xfeb7('0x5'));var logger=require('../../../../config/logger')('dynamics365');var config=require('../../../../config/environment');config[_0xfeb7('0x6')]=_[_0xfeb7('0x7')](config[_0xfeb7('0x6')],{'host':_0xfeb7('0x8'),'port':0x18eb});var io=require(_0xfeb7('0x9'))(new Redis(config[_0xfeb7('0x6')]));function getAuthToken(_0x471805,_0x1d8017,_0x446b55){if(_0x471805[_0xfeb7('0xa')]){_0x471805['remoteUri']=_0x471805[_0xfeb7('0xb')]['data7'];_0x471805[_0xfeb7('0xc')]=_0x471805[_0xfeb7('0xb')][_0xfeb7('0xd')];return Promise[_0xfeb7('0xe')](_0x471805[_0xfeb7('0xb')][_0xfeb7('0xf')]);}var _0x3c65d4={'method':'POST','uri':_0x1d8017,'form':{'client_id':_0x471805[_0xfeb7('0x10')],'resource':_0x471805[_0xfeb7('0x11')],'username':_0x471805['username'],'password':_0x471805[_0xfeb7('0x12')],'grant_type':_0xfeb7('0x12'),'client_secret':_0x471805[_0xfeb7('0x13')]},'json':!![]};return rp(_0x3c65d4)['then'](function(_0x323b7e){return _0x323b7e[_0xfeb7('0x14')];})[_0xfeb7('0x15')](function(_0x52956e){logger[_0xfeb7('0x16')]('['+[_0x446b55[_0xfeb7('0x17')]()]+']\x20Wrong\x20credentials!');return _0x52956e['message'];});}function getUser(_0x461614,_0x1cfca3,_0x24ed4a,_0x540201,_0xd52811,_0x3a42ac){return new Promise(function(_0x35ffdf,_0x508fe2){return getAuthToken(_0x1cfca3,_0x540201,_0x3a42ac)[_0xfeb7('0x18')](function(_0xe8a0b9){var _0x50aa03={'method':_0xfeb7('0x19'),'uri':_0xd52811+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0xe8a0b9,'OData-Version':_0xfeb7('0x1a')},'json':!![]};return rp(_0x50aa03);})['then'](function(_0x281d9e){var _0x20cb06=_0x281d9e[_0xfeb7('0x1b')];var _0x300bcd=![];var _0x2d9231=null;if(!_[_0xfeb7('0x1c')](_0x24ed4a)){if(intUtil[_0xfeb7('0x1d')](_0x24ed4a[_0xfeb7('0x1e')])){_0x461614['userEmail']=_0x24ed4a[_0xfeb7('0x1e')];for(_0x2d9231=0x0;_0x2d9231<_0x20cb06[_0xfeb7('0x1f')];_0x2d9231++){if(_0x20cb06[_0x2d9231][_0xfeb7('0x20')]===_0x24ed4a[_0xfeb7('0x1e')]&&!_0x20cb06[_0x2d9231]['isdisabled']){_0x300bcd=!![];logger[_0xfeb7('0x21')]('['+[_0x3a42ac[_0xfeb7('0x17')]()]+_0xfeb7('0x22')+_0x20cb06[_0x2d9231][_0xfeb7('0x23')]+'!');_0x461614[_0xfeb7('0x24')]=_0x20cb06[_0x2d9231][_0xfeb7('0x23')];}}}}if(!_0x300bcd){logger[_0xfeb7('0x21')]('['+[_0x3a42ac['toUpperCase']()]+_0xfeb7('0x25'));_0x461614[_0xfeb7('0x26')]=_0x1cfca3[_0xfeb7('0x27')];for(_0x2d9231=0x0;_0x2d9231<_0x20cb06[_0xfeb7('0x1f')];_0x2d9231++){if(_0x20cb06[_0x2d9231][_0xfeb7('0x20')]===_0x1cfca3[_0xfeb7('0x27')]){_0x461614[_0xfeb7('0x24')]=_0x20cb06[_0x2d9231]['systemuserid'];}}}_0x35ffdf(_0x461614);})[_0xfeb7('0x15')](function(_0x3740f1){_0x508fe2(_0x3740f1[_0xfeb7('0x28')]);});});}function createEndUser(_0x232e45,_0x5c4fdd,_0x2fae97,_0x59e909,_0x190481,_0x3bc544,_0x54b2bc){return new Promise(function(_0x5f2861,_0x4b7ab2){return getAuthToken(_0x5c4fdd,_0x2fae97,_0x3bc544)[_0xfeb7('0x18')](function(_0x2dc835){var _0x2128c0=_0x3bc544[_0xfeb7('0x29')]()===_0xfeb7('0x2a')?_0x190481[_0xfeb7('0x2b')]:_0x190481['calleridnum'];var _0x5879a6={'method':'POST','uri':_0x59e909+'contacts','body':{'fullname':_0x2128c0,'firstname':_0x2128c0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xfeb7('0x2c')+_0x232e45[_0xfeb7('0x24')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x2dc835,'OData-Version':_0xfeb7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x5879a6[_0xfeb7('0x2d')][_0x54b2bc]=_0x2128c0;return rp(_0x5879a6);})['then'](function(_0xd3a15a){var _0x402ad3=_0xd3a15a[_0xfeb7('0x2e')][_0xfeb7('0x2f')];var _0x4f1dfd=_0x402ad3['substring'](_0x402ad3[_0xfeb7('0x30')]('(')+0x1,_0x402ad3[_0xfeb7('0x30')](')'));_0x232e45['enduserId']=_0x4f1dfd;_0x5f2861(_0x232e45);})[_0xfeb7('0x15')](function(_0x30816f){_0x4b7ab2(_0x30816f[_0xfeb7('0x28')]);});});}function getEndUser(_0x3133bf,_0xdd148a,_0x12de00,_0x1836de,_0x40a912,_0x1f4c5e,_0xcf100c,_0x19ee41){var _0xf877c1=_0x1f4c5e[_0xfeb7('0x29')]()===_0xfeb7('0x2a')?_0x40a912[_0xfeb7('0x2b')]:_0x40a912[_0xfeb7('0x31')];return getAuthToken(_0xdd148a,_0x12de00,_0x1f4c5e)[_0xfeb7('0x18')](function(_0x2d9666){_0x19ee41=_0x19ee41?_0x19ee41:_0xfeb7('0x32');var _0x40a5a9={'method':_0xfeb7('0x19'),'uri':_0x1836de+_0xfeb7('0x33')+_0x19ee41+'&$filter='+_0x19ee41+'\x20eq\x20\x27'+_0xf877c1[_0xfeb7('0x34')]('+',_0xfeb7('0x35'))+'\x27','headers':{'Authorization':_0xfeb7('0x36')+_0x2d9666,'If-None-Match':null,'OData-Version':_0xfeb7('0x1a')},'json':!![]};return rp(_0x40a5a9);})[_0xfeb7('0x18')](function(_0x3fb1c0){var _0x8fa789=![];if(!_0x3fb1c0)return _0x8fa789;var _0x5a062d=_0x3fb1c0[_0xfeb7('0x1b')];for(var _0x1c3cb0=0x0;_0x1c3cb0<_0x5a062d[_0xfeb7('0x1f')];_0x1c3cb0++){if(_0x5a062d[_0x1c3cb0][_0x19ee41]===_0xf877c1){_0x8fa789=!![];_0x3133bf['enduserId']=_0x5a062d[_0x1c3cb0][_0xfeb7('0x37')];}}return _0x8fa789;})[_0xfeb7('0x18')](function(_0x4d5f18){if(_0x4d5f18)return _0x3133bf;if(_0xcf100c===_0xfeb7('0x38')){logger[_0xfeb7('0x21')]('['+[_0x1f4c5e[_0xfeb7('0x17')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x3133bf;}return createEndUser(_0x3133bf,_0xdd148a,_0x12de00,_0x1836de,_0x40a912,_0x1f4c5e,_0x19ee41)[_0xfeb7('0x18')](function(_0x1c6f16){logger[_0xfeb7('0x21')]('['+[_0x1f4c5e['toUpperCase']()]+_0xfeb7('0x39'),_0x1c6f16[_0xfeb7('0x3a')]);return _0x1c6f16;});});}function getCustomFields(_0x33a331,_0x50615d,_0x39bcf3){var _0x49680d={};if(_0x33a331[_0xfeb7('0x1f')]>0x0){_[_0xfeb7('0x3b')](_0x33a331,function(_0x1d7202){if(_[_0xfeb7('0x3c')](['string',_0xfeb7('0x3d')],_0x1d7202[_0xfeb7('0x3e')])&&_0x1d7202[_0xfeb7('0x3f')]&&!_0x1d7202[_0xfeb7('0x40')]){var _0x3a9ad0=_0x1d7202[_0xfeb7('0x41')]['toLowerCase']();var _0x2cf4e9=_0x3a9ad0['substring'](0x0,_0x3a9ad0['indexOf']('_'));var _0x576da2=_0x3a9ad0['substring'](_0x3a9ad0[_0xfeb7('0x42')]('_')+0x1);if(_0x2cf4e9===_0x39bcf3){_0x49680d[_0x576da2]=_0x1d7202[_0xfeb7('0x43')];}}});}return _0x49680d;}function getTicket(_0xb32a21,_0x338e1b,_0x363935,_0x367508,_0x3db2ea,_0x2f5512,_0x3dc0c8){return new Promise(function(_0x429d2b,_0x3b1f99){var _0x5aa500;return getAuthToken(_0x338e1b,_0x363935,_0x3dc0c8)[_0xfeb7('0x18')](function(_0x21093a){if(_0x2f5512['ticketType']===_0xfeb7('0x44')){_0x5aa500={'method':_0xfeb7('0x45'),'uri':_0x367508+_0xfeb7('0x46'),'body':Object[_0xfeb7('0x47')]({},{'title':intUtil[_0xfeb7('0x48')](_0x2f5512[_0xfeb7('0x49')],_0x3db2ea,'\x20'),'description':intUtil[_0xfeb7('0x48')](_0x2f5512[_0xfeb7('0x4a')],_0x3db2ea,'\x0a'),'customerid_contact@odata.bind':_0xb32a21[_0xfeb7('0x3a')]?_0xfeb7('0x4b')+_0xb32a21[_0xfeb7('0x3a')]+')':undefined,'ownerid@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','caseorigincode':'1'},getCustomFields(_0x2f5512[_0xfeb7('0x4c')],_0x3db2ea,_0x2f5512[_0xfeb7('0x4d')])),'headers':{'Authorization':_0xfeb7('0x36')+_0x21093a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2f5512[_0xfeb7('0x4d')]===_0xfeb7('0x4e')){var _0xee54c2=_0xb32a21[_0xfeb7('0x3a')]?[{'partyid_systemuser@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','participationtypemask':_0xb32a21[_0xfeb7('0x4f')]===_0xfeb7('0x50')?0x2:0x1},{'partyid_contact@odata.bind':_0xfeb7('0x4b')+_0xb32a21[_0xfeb7('0x3a')]+')','participationtypemask':_0xb32a21['callDirection']===_0xfeb7('0x50')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','participationtypemask':_0xb32a21[_0xfeb7('0x4f')]===_0xfeb7('0x50')?0x2:0x1}];_0x5aa500={'method':_0xfeb7('0x45'),'uri':_0x367508+_0xfeb7('0x51'),'body':Object['assign']({},{'subject':intUtil[_0xfeb7('0x48')](_0x2f5512['Subjects'],_0x3db2ea,'\x20'),'phonenumber':String(_0x3db2ea['calleridnum']),'description':intUtil[_0xfeb7('0x48')](_0x2f5512[_0xfeb7('0x4a')],_0x3db2ea,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb32a21['enduserId']?_0xfeb7('0x4b')+_0xb32a21[_0xfeb7('0x3a')]+')':undefined,'ownerid@odata.bind':_0xfeb7('0x2c')+_0xb32a21[_0xfeb7('0x24')]+')','directioncode':_0xb32a21[_0xfeb7('0x4f')]===_0xfeb7('0x50')?![]:!![],'phonecall_activity_parties':_0xee54c2},getCustomFields(_0x2f5512[_0xfeb7('0x4c')],_0x3db2ea,_0x2f5512[_0xfeb7('0x4d')])),'headers':{'Authorization':'Bearer\x20'+_0x21093a,'OData-Version':_0xfeb7('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5aa500);})['then'](function(_0x145f2e){var _0x1678e6=_0x145f2e[_0xfeb7('0x2e')][_0xfeb7('0x2f')];var _0xc495ed=_0x1678e6[_0xfeb7('0x52')](_0x1678e6['lastIndexOf']('(')+0x1,_0x1678e6[_0xfeb7('0x30')](')'));_0xb32a21['ticketId']=_0xc495ed;_0x429d2b(_0xb32a21);})['catch'](function(_0x335312){_0x3b1f99(_0x335312[_0xfeb7('0x28')]);});});}function emit(_0x4e3224,_0x284466,_0x1af222,_0x327d88){var _0x3b6d66={'uri':util[_0xfeb7('0x53')](_0xfeb7('0x54'),_0x4e3224,_0x1af222,_0x327d88)};io['to'](util[_0xfeb7('0x53')]('user:%s',_0x284466))[_0xfeb7('0x55')](_0xfeb7('0x56'),_0x3b6d66);}exports['cs']=function(_0x11e19b,_0x18fa04,_0xbe215b,_0x44385e,_0x47f104,_0xf91878,_0x484b0d,_0x5c955f){var _0x459a8b={};_0xf91878['remoteUri']=_0xf91878[_0xfeb7('0xa')]?intUtil[_0xfeb7('0x57')](_0xf91878[_0xfeb7('0xb')][_0xfeb7('0x58')]):intUtil[_0xfeb7('0x57')](_0xf91878[_0xfeb7('0x11')]);_0xf91878[_0xfeb7('0x59')]=intUtil[_0xfeb7('0x57')](_0xf91878[_0xfeb7('0x59')]);_0x459a8b[_0xfeb7('0x4f')]=_0x5c955f==='queue'||_0x5c955f==='unmanaged'?_0xfeb7('0x50'):'outbound';var _0x5cc5bf=_0xf91878[_0xfeb7('0xa')]?util[_0xfeb7('0x53')](_0xfeb7('0x5a'),_0xf91878[_0xfeb7('0xb')][_0xfeb7('0x58')]):util[_0xfeb7('0x53')]('%s/api/data/v9.0/',_0xf91878[_0xfeb7('0x11')]);var _0x1aa2f8=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0xf91878[_0xfeb7('0xc')]);var _0x21f273=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf91878[_0xfeb7('0x59')],_0x18fa04['uniqueid'],md5(_0x18fa04[_0xfeb7('0x5b')]));if(_0x47f104&&_0x47f104[_0xfeb7('0x5c')]){logger[_0xfeb7('0x21')]('[QUEUE]','Recording\x20is\x20enabled!');_0x18fa04[_0xfeb7('0x5d')]=_0x21f273;}else if(_0x484b0d&&_0x484b0d[_0xfeb7('0x5e')]&&_0x484b0d[_0xfeb7('0x5e')]!==_0xfeb7('0x5f')){logger[_0xfeb7('0x21')](_0xfeb7('0x60'),_0xfeb7('0x61'));_0x18fa04[_0xfeb7('0x5d')]=_0x21f273;}else{_0x18fa04[_0xfeb7('0x5d')]='';}return getUser(_0x459a8b,_0xf91878,_0x44385e,_0x1aa2f8,_0x5cc5bf,_0x5c955f)[_0xfeb7('0x18')](function(_0x1bd0df){logger[_0xfeb7('0x21')]('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x62'),_0x1bd0df['userId']);logger[_0xfeb7('0x21')]('['+_0x5c955f[_0xfeb7('0x17')]()+']\x20The\x20User\x20email\x20is:',_0x1bd0df['userEmail']);return getEndUser(_0x1bd0df,_0xf91878,_0x1aa2f8,_0x5cc5bf,_0x18fa04,_0x5c955f,_0xbe215b['moduleCreate'],_0xbe215b[_0xfeb7('0x63')]);})[_0xfeb7('0x18')](function(_0x5db8f3){logger['info']('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x64'),_0x5db8f3['enduserId']);logger[_0xfeb7('0x21')]('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x65'),_0x18fa04[_0xfeb7('0x31')]);return getTicket(_0x5db8f3,_0xf91878,_0x1aa2f8,_0x5cc5bf,_0x18fa04,_0xbe215b,_0x5c955f);})[_0xfeb7('0x18')](function(_0x239476){logger[_0xfeb7('0x21')](util['format']('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x66'),_0xbe215b[_0xfeb7('0x4d')],_0x239476['ticketId']));logger['info'](util[_0xfeb7('0x53')]('['+_0x5c955f[_0xfeb7('0x17')]()+_0xfeb7('0x67'),_0x5c955f));if(_0x5c955f!==_0xfeb7('0x68')&&_0xbe215b[_0xfeb7('0x69')]){logger['info']('['+_0x5c955f[_0xfeb7('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xf91878[_0xfeb7('0x11')],_0x44385e[_0xfeb7('0x6a')],_0xbe215b[_0xfeb7('0x4d')],_0x239476['ticketId']);}})[_0xfeb7('0x15')](function(_0x3de77d){logger[_0xfeb7('0x16')]('['+_0x5c955f['toUpperCase']()+_0xfeb7('0x6b'),_0x3de77d[_0xfeb7('0x28')]);console[_0xfeb7('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x3de77d);});};
\ No newline at end of file
+var _0x88be=['destcalleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','nameField','idField','indexOf','ticketType','incident','getString','Subjects','Descriptions','Fields','phonecall','callDirection','queue','/contacts(','phonecalls','assign','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','POST','clientId','username','password','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','email','length','internalemailaddress','isdisabled','info','systemuserid','userId','userEmail','toLowerCase','outbound','calleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId'];(function(_0x1abf77,_0x529f4c){var _0x27ccf2=function(_0x384a80){while(--_0x384a80){_0x1abf77['push'](_0x1abf77['shift']());}};_0x27ccf2(++_0x529f4c);}(_0x88be,0x9a));var _0xe88b=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x88be[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xe88b('0x0'));var rp=require(_0xe88b('0x1'));var util=require(_0xe88b('0x2'));var intUtil=require('./util');var md5=require(_0xe88b('0x3'));var Redis=require(_0xe88b('0x4'));var logger=require('../../../../config/logger')(_0xe88b('0x5'));var config=require(_0xe88b('0x6'));config[_0xe88b('0x7')]=_['defaults'](config[_0xe88b('0x7')],{'host':_0xe88b('0x8'),'port':0x18eb});var io=require(_0xe88b('0x9'))(new Redis(config['redis']));function getAuthToken(_0x5c641b,_0x23279c,_0x99cde3){if(_0x5c641b[_0xe88b('0xa')]){_0x5c641b[_0xe88b('0xb')]=_0x5c641b[_0xe88b('0xc')][_0xe88b('0xd')];_0x5c641b['tenantId']=_0x5c641b[_0xe88b('0xc')][_0xe88b('0xe')];return Promise[_0xe88b('0xf')](_0x5c641b['CloudProvider']['data5']);}var _0x5a4d8d={'method':_0xe88b('0x10'),'uri':_0x23279c,'form':{'client_id':_0x5c641b[_0xe88b('0x11')],'resource':_0x5c641b[_0xe88b('0xb')],'username':_0x5c641b[_0xe88b('0x12')],'password':_0x5c641b[_0xe88b('0x13')],'grant_type':'password','client_secret':_0x5c641b['clientSecret']},'json':!![]};return rp(_0x5a4d8d)[_0xe88b('0x14')](function(_0x25a08d){return _0x25a08d[_0xe88b('0x15')];})[_0xe88b('0x16')](function(_0x34c0bb){logger[_0xe88b('0x17')]('['+[_0x99cde3[_0xe88b('0x18')]()]+_0xe88b('0x19'));return _0x34c0bb[_0xe88b('0x1a')];});}function getUser(_0x158c81,_0x108f25,_0x51a117,_0x226cdd,_0x1a43d7,_0x448d27){return new Promise(function(_0x1e7a44,_0x5a7d93){return getAuthToken(_0x108f25,_0x226cdd,_0x448d27)[_0xe88b('0x14')](function(_0x9c55ff){var _0x2fa3ad={'method':_0xe88b('0x1b'),'uri':_0x1a43d7+_0xe88b('0x1c'),'headers':{'Authorization':_0xe88b('0x1d')+_0x9c55ff,'OData-Version':_0xe88b('0x1e')},'json':!![]};return rp(_0x2fa3ad);})[_0xe88b('0x14')](function(_0x358d1f){var _0x11688f=_0x358d1f['value'];var _0x237fda=![];var _0x4811ce=null;if(!_[_0xe88b('0x1f')](_0x51a117)){if(intUtil['validateEmail'](_0x51a117[_0xe88b('0x20')])){_0x158c81['userEmail']=_0x51a117['email'];for(_0x4811ce=0x0;_0x4811ce<_0x11688f[_0xe88b('0x21')];_0x4811ce++){if(_0x11688f[_0x4811ce][_0xe88b('0x22')]===_0x51a117[_0xe88b('0x20')]&&!_0x11688f[_0x4811ce][_0xe88b('0x23')]){_0x237fda=!![];logger[_0xe88b('0x24')]('['+[_0x448d27['toUpperCase']()]+']\x20Agent\x20found\x20'+_0x11688f[_0x4811ce][_0xe88b('0x25')]+'!');_0x158c81[_0xe88b('0x26')]=_0x11688f[_0x4811ce][_0xe88b('0x25')];}}}}if(!_0x237fda){logger['info']('['+[_0x448d27[_0xe88b('0x18')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x158c81[_0xe88b('0x27')]=_0x108f25[_0xe88b('0x12')];for(_0x4811ce=0x0;_0x4811ce<_0x11688f[_0xe88b('0x21')];_0x4811ce++){if(_0x11688f[_0x4811ce][_0xe88b('0x22')]===_0x108f25[_0xe88b('0x12')]){_0x158c81[_0xe88b('0x26')]=_0x11688f[_0x4811ce][_0xe88b('0x25')];}}}_0x1e7a44(_0x158c81);})['catch'](function(_0x5c5163){_0x5a7d93(_0x5c5163[_0xe88b('0x1a')]);});});}function createEndUser(_0x35f764,_0x3602f4,_0xcc7b01,_0x328ad2,_0x4e0eb1,_0x41dfb1,_0x4286b0){return new Promise(function(_0x32d602,_0x507ebf){return getAuthToken(_0x3602f4,_0xcc7b01,_0x41dfb1)[_0xe88b('0x14')](function(_0x2fa571){var _0x11491a=_0x41dfb1[_0xe88b('0x28')]()===_0xe88b('0x29')?_0x4e0eb1['destcalleridnum']:_0x4e0eb1[_0xe88b('0x2a')];var _0x265ffd={'method':_0xe88b('0x10'),'uri':_0x328ad2+'contacts','body':{'fullname':_0x11491a,'firstname':_0x11491a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xe88b('0x2b')+_0x35f764[_0xe88b('0x26')]+')'},'headers':{'Authorization':_0xe88b('0x1d')+_0x2fa571,'OData-Version':_0xe88b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x265ffd[_0xe88b('0x2c')][_0x4286b0]=_0x11491a;return rp(_0x265ffd);})[_0xe88b('0x14')](function(_0x5567fe){var _0x521aaf=_0x5567fe[_0xe88b('0x2d')][_0xe88b('0x2e')];var _0x26fe78=_0x521aaf[_0xe88b('0x2f')](_0x521aaf[_0xe88b('0x30')]('(')+0x1,_0x521aaf['lastIndexOf'](')'));_0x35f764[_0xe88b('0x31')]=_0x26fe78;_0x32d602(_0x35f764);})[_0xe88b('0x16')](function(_0x3444db){_0x507ebf(_0x3444db[_0xe88b('0x1a')]);});});}function getEndUser(_0x26e140,_0x4189e9,_0x2abd53,_0x5c12ef,_0x599f9e,_0x189135,_0x1863ba,_0x4e4c4f){var _0x296a63=_0x189135[_0xe88b('0x28')]()===_0xe88b('0x29')?_0x599f9e[_0xe88b('0x32')]:_0x599f9e['calleridnum'];return getAuthToken(_0x4189e9,_0x2abd53,_0x189135)[_0xe88b('0x14')](function(_0x5e9792){_0x4e4c4f=_0x4e4c4f?_0x4e4c4f:_0xe88b('0x33');var _0x429963={'method':'GET','uri':_0x5c12ef+_0xe88b('0x34')+_0x4e4c4f+_0xe88b('0x35')+_0x4e4c4f+_0xe88b('0x36')+_0x296a63[_0xe88b('0x37')]('+',_0xe88b('0x38'))+'\x27','headers':{'Authorization':_0xe88b('0x1d')+_0x5e9792,'If-None-Match':null,'OData-Version':_0xe88b('0x1e')},'json':!![]};return rp(_0x429963);})['then'](function(_0x23580d){var _0x57e93f=![];if(!_0x23580d)return _0x57e93f;var _0x367dfc=_0x23580d['value'];for(var _0x5d354b=0x0;_0x5d354b<_0x367dfc[_0xe88b('0x21')];_0x5d354b++){if(_0x367dfc[_0x5d354b][_0x4e4c4f]===_0x296a63){_0x57e93f=!![];_0x26e140['enduserId']=_0x367dfc[_0x5d354b][_0xe88b('0x39')];}}return _0x57e93f;})[_0xe88b('0x14')](function(_0x4011a4){if(_0x4011a4)return _0x26e140;if(_0x1863ba===_0xe88b('0x3a')){logger[_0xe88b('0x24')]('['+[_0x189135[_0xe88b('0x18')]()]+_0xe88b('0x3b'));return _0x26e140;}return createEndUser(_0x26e140,_0x4189e9,_0x2abd53,_0x5c12ef,_0x599f9e,_0x189135,_0x4e4c4f)[_0xe88b('0x14')](function(_0x5a694f){logger[_0xe88b('0x24')]('['+[_0x189135[_0xe88b('0x18')]()]+_0xe88b('0x3c'),_0x5a694f['enduserId']);return _0x5a694f;});});}function getCustomFields(_0x32e711,_0x214910,_0xa88546){var _0x495b67={};if(_0x32e711['length']>0x0){_[_0xe88b('0x3d')](_0x32e711,function(_0x3eaf08){if(_['includes']([_0xe88b('0x3e'),'picklist'],_0x3eaf08['type'])&&_0x3eaf08[_0xe88b('0x3f')]&&!_0x3eaf08['customField']){var _0x5bb5d7=_0x3eaf08[_0xe88b('0x40')][_0xe88b('0x28')]();var _0x244260=_0x5bb5d7[_0xe88b('0x2f')](0x0,_0x5bb5d7[_0xe88b('0x41')]('_'));var _0x287c10=_0x5bb5d7[_0xe88b('0x2f')](_0x5bb5d7[_0xe88b('0x41')]('_')+0x1);if(_0x244260===_0xa88546){_0x495b67[_0x287c10]=_0x3eaf08['content'];}}});}return _0x495b67;}function getTicket(_0x163fab,_0x39d850,_0x62e169,_0xd0e634,_0x52a55a,_0x3050d6,_0x463f37){return new Promise(function(_0xd40dc1,_0x4dac32){var _0x2e3dd5;return getAuthToken(_0x39d850,_0x62e169,_0x463f37)[_0xe88b('0x14')](function(_0x16f654){if(_0x3050d6[_0xe88b('0x42')]===_0xe88b('0x43')){_0x2e3dd5={'method':_0xe88b('0x10'),'uri':_0xd0e634+'incidents','body':Object['assign']({},{'title':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x45')],_0x52a55a,'\x20'),'description':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x46')],_0x52a55a,'\x0a'),'customerid_contact@odata.bind':_0x163fab['enduserId']?'/contacts('+_0x163fab[_0xe88b('0x31')]+')':undefined,'ownerid@odata.bind':_0xe88b('0x2b')+_0x163fab[_0xe88b('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x3050d6[_0xe88b('0x47')],_0x52a55a,_0x3050d6['ticketType'])),'headers':{'Authorization':_0xe88b('0x1d')+_0x16f654,'OData-Version':_0xe88b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3050d6['ticketType']===_0xe88b('0x48')){var _0x1c71c9=_0x163fab[_0xe88b('0x31')]?[{'partyid_systemuser@odata.bind':_0xe88b('0x2b')+_0x163fab[_0xe88b('0x26')]+')','participationtypemask':_0x163fab[_0xe88b('0x49')]===_0xe88b('0x4a')?0x2:0x1},{'partyid_contact@odata.bind':_0xe88b('0x4b')+_0x163fab[_0xe88b('0x31')]+')','participationtypemask':_0x163fab[_0xe88b('0x49')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xe88b('0x2b')+_0x163fab['userId']+')','participationtypemask':_0x163fab[_0xe88b('0x49')]===_0xe88b('0x4a')?0x2:0x1}];_0x2e3dd5={'method':_0xe88b('0x10'),'uri':_0xd0e634+_0xe88b('0x4c'),'body':Object[_0xe88b('0x4d')]({},{'subject':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x45')],_0x52a55a,'\x20'),'phonenumber':String(_0x52a55a[_0xe88b('0x2a')]),'description':intUtil[_0xe88b('0x44')](_0x3050d6[_0xe88b('0x46')],_0x52a55a,'\x0a'),'regardingobjectid_contact@odata.bind':_0x163fab['enduserId']?_0xe88b('0x4b')+_0x163fab[_0xe88b('0x31')]+')':undefined,'ownerid@odata.bind':_0xe88b('0x2b')+_0x163fab['userId']+')','directioncode':_0x163fab[_0xe88b('0x49')]===_0xe88b('0x4a')?![]:!![],'phonecall_activity_parties':_0x1c71c9},getCustomFields(_0x3050d6[_0xe88b('0x47')],_0x52a55a,_0x3050d6[_0xe88b('0x42')])),'headers':{'Authorization':_0xe88b('0x1d')+_0x16f654,'OData-Version':_0xe88b('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2e3dd5);})[_0xe88b('0x14')](function(_0x34c8fc){var _0x46d840=_0x34c8fc[_0xe88b('0x2d')][_0xe88b('0x2e')];var _0x4d276d=_0x46d840[_0xe88b('0x2f')](_0x46d840[_0xe88b('0x30')]('(')+0x1,_0x46d840[_0xe88b('0x30')](')'));_0x163fab[_0xe88b('0x4e')]=_0x4d276d;_0xd40dc1(_0x163fab);})[_0xe88b('0x16')](function(_0x71558a){_0x4dac32(_0x71558a[_0xe88b('0x1a')]);});});}function emit(_0x4ab1ce,_0x1aa5d2,_0x3195d8,_0xf19f6e){var _0x4c2959={'uri':util[_0xe88b('0x4f')](_0xe88b('0x50'),_0x4ab1ce,_0x3195d8,_0xf19f6e)};io['to'](util[_0xe88b('0x4f')]('user:%s',_0x1aa5d2))['emit'](_0xe88b('0x51'),_0x4c2959);}exports['cs']=function(_0x17a256,_0x223a3c,_0x25b159,_0x3d2ba6,_0x252695,_0x2674ce,_0x1816c8,_0x154a9f){var _0x16d57f={};_0x2674ce[_0xe88b('0xb')]=_0x2674ce[_0xe88b('0xa')]?intUtil[_0xe88b('0x52')](_0x2674ce[_0xe88b('0xc')]['data7']):intUtil[_0xe88b('0x52')](_0x2674ce[_0xe88b('0xb')]);_0x2674ce['serverUrl']=intUtil[_0xe88b('0x52')](_0x2674ce['serverUrl']);_0x16d57f[_0xe88b('0x49')]=_0x154a9f==='queue'||_0x154a9f===_0xe88b('0x53')?_0xe88b('0x4a'):_0xe88b('0x29');var _0x31aed2=_0x2674ce[_0xe88b('0xa')]?util[_0xe88b('0x4f')]('%s/api/data/v9.0/',_0x2674ce[_0xe88b('0xc')][_0xe88b('0xd')]):util[_0xe88b('0x4f')]('%s/api/data/v9.0/',_0x2674ce[_0xe88b('0xb')]);var _0x36fa97=util[_0xe88b('0x4f')]('https://login.microsoftonline.com/%s/oauth2/token',_0x2674ce['tenantId']);var _0x55563d=util[_0xe88b('0x4f')](_0xe88b('0x54'),_0x2674ce[_0xe88b('0x55')],_0x223a3c[_0xe88b('0x56')],md5(_0x223a3c[_0xe88b('0x56')]));if(_0x252695&&_0x252695['monitor_format']){logger[_0xe88b('0x24')](_0xe88b('0x57'),_0xe88b('0x58'));_0x223a3c[_0xe88b('0x59')]=_0x55563d;}else if(_0x1816c8&&_0x1816c8['recordingFormat']&&_0x1816c8['recordingFormat']!==_0xe88b('0x5a')){logger['info'](_0xe88b('0x5b'),_0xe88b('0x58'));_0x223a3c[_0xe88b('0x59')]=_0x55563d;}else{_0x223a3c[_0xe88b('0x59')]='';}return getUser(_0x16d57f,_0x2674ce,_0x3d2ba6,_0x36fa97,_0x31aed2,_0x154a9f)['then'](function(_0x7e519){logger[_0xe88b('0x24')]('['+_0x154a9f[_0xe88b('0x18')]()+']\x20The\x20User\x20ID\x20is:',_0x7e519['userId']);logger['info']('['+_0x154a9f[_0xe88b('0x18')]()+']\x20The\x20User\x20email\x20is:',_0x7e519['userEmail']);return getEndUser(_0x7e519,_0x2674ce,_0x36fa97,_0x31aed2,_0x223a3c,_0x154a9f,_0x25b159[_0xe88b('0x5c')],_0x25b159['additionalSearchContact']);})[_0xe88b('0x14')](function(_0x48ced0){logger[_0xe88b('0x24')]('['+_0x154a9f['toUpperCase']()+_0xe88b('0x5d'),_0x48ced0[_0xe88b('0x31')]);logger[_0xe88b('0x24')]('['+_0x154a9f['toUpperCase']()+_0xe88b('0x5e'),_0x223a3c[_0xe88b('0x2a')]);return getTicket(_0x48ced0,_0x2674ce,_0x36fa97,_0x31aed2,_0x223a3c,_0x25b159,_0x154a9f);})[_0xe88b('0x14')](function(_0x5a9762){logger[_0xe88b('0x24')](util[_0xe88b('0x4f')]('['+_0x154a9f[_0xe88b('0x18')]()+_0xe88b('0x5f'),_0x25b159[_0xe88b('0x42')],_0x5a9762['ticketId']));logger[_0xe88b('0x24')](util[_0xe88b('0x4f')]('['+_0x154a9f[_0xe88b('0x18')]()+_0xe88b('0x60'),_0x154a9f));if(_0x154a9f!==_0xe88b('0x53')&&_0x25b159[_0xe88b('0x61')]){logger[_0xe88b('0x24')]('['+_0x154a9f[_0xe88b('0x18')]()+']',_0xe88b('0x62'));emit(_0x2674ce[_0xe88b('0xb')],_0x3d2ba6[_0xe88b('0x63')],_0x25b159[_0xe88b('0x42')],_0x5a9762['ticketId']);}})[_0xe88b('0x16')](function(_0x5753df){logger['error']('['+_0x154a9f[_0xe88b('0x18')]()+_0xe88b('0x64'),_0x5753df[_0xe88b('0x1a')]);console[_0xe88b('0x17')](_0xe88b('0x65'),_0x5753df);});};
\ No newline at end of file
index 78760b5..7d7bc4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd951=['serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','calleridname','stringify','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','<br>','Tags','name','Fields','mapValues','keyBy','custom_fields','value','format','%s/api/v2/tickets','POST','then','info','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xd951,0xe3));var _0x1d95=function(_0x218fb6,_0x92897c){_0x218fb6=_0x218fb6-0x0;var _0x26d570=_0xd951[_0x218fb6];return _0x26d570;};'use strict';var _=require(_0x1d95('0x0'));var rp=require(_0x1d95('0x1'));var md5=require(_0x1d95('0x2'));var util=require('util');var Redis=require(_0x1d95('0x3'));var intUtil=require(_0x1d95('0x4'));var config=require(_0x1d95('0x5'));var logger=require(_0x1d95('0x6'))(_0x1d95('0x7'));config['redis']=_[_0x1d95('0x8')](config[_0x1d95('0x9')],{'host':_0x1d95('0xa'),'port':0x18eb});var io=require(_0x1d95('0xb'))(new Redis(config[_0x1d95('0x9')]));var headers={'Content-Type':_0x1d95('0xc'),'Accept':'application/json'};function emit(_0x382de1,_0xaf0c52,_0x52623f){io['to'](_0x382de1)[_0x1d95('0xd')](_0xaf0c52,_0x52623f);}function getTicket(_0x150830,_0x551f81,_0x4c0f45,_0x2527ad,_0x2e73e3){logger['info'](_0x1d95('0xe'));var _0x41d10c=_[_0x1d95('0xf')]({'responder_id':_0x551f81['id'],'requester_id':_0x4c0f45['id'],'name':util['format'](_0x1d95('0x10'),_0x2e73e3['calleridname']),'phone':_0x2e73e3[_0x1d95('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1d95('0x12')](_0x2527ad[_0x1d95('0x13')],_0x2e73e3,'\x20'),'description':intUtil[_0x1d95('0x12')](_0x2527ad[_0x1d95('0x14')],_0x2e73e3,_0x1d95('0x15')),'tags':getTags(_0x2527ad[_0x1d95('0x16')],_0x1d95('0x17'))},getCustomFields(_0x2527ad[_0x1d95('0x18')],_0x2e73e3));_0x41d10c['custom_fields']=_[_0x1d95('0x19')](_[_0x1d95('0x1a')](_0x41d10c[_0x1d95('0x1b')],'id'),_0x1d95('0x1c'));return request({'uri':util[_0x1d95('0x1d')](_0x1d95('0x1e'),_0x150830['remoteUri']),'method':_0x1d95('0x1f'),'body':_0x41d10c})[_0x1d95('0x20')](function(_0x4b2c6f){logger[_0x1d95('0x21')]('Ticket\x20created!');return _0x4b2c6f;});}function getUser(_0x57d17a,_0x2db7de){if(intUtil['validateEmail'](_0x2db7de)){return request({'uri':util['format'](_0x1d95('0x22'),_0x57d17a['remoteUri']),'qs':{'email':_0x2db7de}})[_0x1d95('0x20')](function(_0x4fabfb){if(_0x4fabfb[_0x1d95('0x23')]){logger[_0x1d95('0x21')](_0x1d95('0x24'));return _[_0x1d95('0x25')](_0x4fabfb,function(_0x387958){return _0x387958[_0x1d95('0x26')][_0x1d95('0x27')]===_0x2db7de;});}else{logger[_0x1d95('0x21')](_0x1d95('0x28'));return request({'uri':util[_0x1d95('0x1d')]('%s/api/v2/agents/me',_0x57d17a[_0x1d95('0x29')])})[_0x1d95('0x20')](function(_0x20f81d){logger[_0x1d95('0x21')](_0x1d95('0x2a'));return _0x20f81d;});}});}else{logger[_0x1d95('0x21')](_0x1d95('0x2b'));return request({'uri':util[_0x1d95('0x1d')](_0x1d95('0x2c'),_0x57d17a[_0x1d95('0x29')])})[_0x1d95('0x20')](function(_0x3ed40f){logger[_0x1d95('0x21')](_0x1d95('0x2a'));return _0x3ed40f;});}}function getEndUser(_0x1532cb,_0x43e408,_0x30e9f6){logger[_0x1d95('0x21')]('Searching\x20enduser\x20with\x20phone',_0x30e9f6);return request({'uri':util[_0x1d95('0x1d')](_0x1d95('0x2d'),_0x1532cb['remoteUri']),'qs':{'phone':_0x30e9f6}})[_0x1d95('0x20')](function(_0x2f7d58){if(_0x2f7d58[_0x1d95('0x23')]){logger[_0x1d95('0x21')](_0x1d95('0x2e'));return _[_0x1d95('0x25')](_0x2f7d58,{'phone':_0x30e9f6});}else{logger[_0x1d95('0x21')](_0x1d95('0x2f'));return request({'uri':util['format'](_0x1d95('0x2d'),_0x1532cb[_0x1d95('0x29')]),'method':_0x1d95('0x1f'),'body':{'name':_0x43e408,'phone':_0x30e9f6}})[_0x1d95('0x20')](function(_0x72e3d4){logger['info'](_0x1d95('0x30'));return _0x72e3d4;});}});}function getAuth(_0x10be9c){return util[_0x1d95('0x1d')](_0x1d95('0x31'),new Buffer(_0x10be9c[_0x1d95('0x32')]+':X')[_0x1d95('0x33')](_0x1d95('0x34')));}function request(_0x215baf){logger[_0x1d95('0x35')](_0x1d95('0x36'),JSON['stringify'](_0x215baf));return rp(_[_0x1d95('0x8')](_0x215baf,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x36c4a1,_0xe5322d){var _0xaae517=[];if(_0x36c4a1&&_0x36c4a1[_0x1d95('0x23')]>0x0){_0xaae517=_[_0x1d95('0x37')](_0x36c4a1,_0xe5322d);}return _0xaae517;}function getCustomFields(_0x5b726a,_0x50e763){var _0x28759e=[];var _0x59b1b9={'custom_fields':[]};if(_0x5b726a[_0x1d95('0x23')]>0x0){_[_0x1d95('0x38')](_0x5b726a,function(_0x450b7b){if(_[_0x1d95('0x39')]([_0x1d95('0x3a'),_0x1d95('0x3b')],_0x450b7b[_0x1d95('0x3c')])&&_0x450b7b[_0x1d95('0x3d')]&&!_0x450b7b[_0x1d95('0x3e')]){_0x59b1b9[_0x450b7b[_0x1d95('0x3d')][_0x1d95('0x3f')]()]=_0x450b7b[_0x1d95('0x40')][_0x1d95('0x33')]();}else if(_[_0x1d95('0x39')]([_0x1d95('0x3a'),'picklist'],_0x450b7b[_0x1d95('0x3c')])&&_0x450b7b[_0x1d95('0x41')]&&_0x450b7b[_0x1d95('0x3e')]){_0x59b1b9['custom_fields']['push']({'id':_0x450b7b[_0x1d95('0x41')],'value':_0x450b7b[_0x1d95('0x40')][_0x1d95('0x33')]()});}else if(_0x450b7b[_0x1d95('0x3c')]===_0x1d95('0x42')&&_0x450b7b[_0x1d95('0x43')]&&_0x450b7b[_0x1d95('0x41')]&&_0x450b7b[_0x1d95('0x3e')]){_0x50e763[_0x450b7b[_0x1d95('0x43')]]&&_0x59b1b9[_0x1d95('0x1b')][_0x1d95('0x44')]({'id':_0x450b7b[_0x1d95('0x41')],'value':_0x50e763[_0x450b7b[_0x1d95('0x43')]][_0x1d95('0x33')]()});}else if(_0x450b7b[_0x1d95('0x3c')]===_0x1d95('0x45')&&_0x450b7b['Variable']&&_0x450b7b[_0x1d95('0x46')][_0x1d95('0x17')]&&_0x450b7b[_0x1d95('0x41')]&&_0x450b7b['customField']){_0x50e763[_0x450b7b[_0x1d95('0x46')][_0x1d95('0x17')][_0x1d95('0x3f')]()]&&_0x59b1b9[_0x1d95('0x1b')][_0x1d95('0x44')]({'id':_0x450b7b['idField'],'value':_0x50e763[_0x450b7b['Variable'][_0x1d95('0x17')]['toLowerCase']()][_0x1d95('0x33')]()});}});}return _0x59b1b9;}exports[_0x1d95('0x47')]=function(_0x91fb30,_0x4736cf,_0xba1003,_0x20b3e0,_0x47865d,_0x5d1cf5){var _0x24a287,_0x13fd68;_0x5d1cf5['remoteUri']=intUtil[_0x1d95('0x48')](_0x5d1cf5[_0x1d95('0x29')]);_0x5d1cf5['serverUrl']=intUtil[_0x1d95('0x48')](_0x5d1cf5[_0x1d95('0x49')]);if(_0x47865d&&_0x47865d[_0x1d95('0x4a')]){logger[_0x1d95('0x21')](_0x1d95('0x4b'),_0x1d95('0x4c'));_0x4736cf[_0x1d95('0x4d')]=util[_0x1d95('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5d1cf5[_0x1d95('0x49')],_0x4736cf[_0x1d95('0x4e')],md5(_0x4736cf[_0x1d95('0x4e')]));}else{_0x4736cf[_0x1d95('0x4d')]='';}headers['Authorization']=getAuth(_0x5d1cf5);return getUser(_0x5d1cf5,_0x20b3e0[_0x1d95('0x27')])[_0x1d95('0x20')](function(_0x3ec88d){_0x24a287=_0x3ec88d;logger[_0x1d95('0x21')]('The\x20User\x20ID\x20is:',_0x24a287['id']);return getEndUser(_0x5d1cf5,_0x4736cf['calleridname'],_0x4736cf[_0x1d95('0x11')]);})[_0x1d95('0x20')](function(_0x104c4f){_0x13fd68=_0x104c4f;logger[_0x1d95('0x21')]('The\x20Enduser\x20ID\x20is:',_0x13fd68['id']);return getTicket(_0x5d1cf5,_0x24a287,_0x13fd68,_0xba1003,_0x4736cf);})[_0x1d95('0x20')](function(_0x660545){if(_0x660545&&_0x660545['id']){logger[_0x1d95('0x21')]('Ticket\x20created!');logger[_0x1d95('0x21')](_0x1d95('0x4f'),_0x660545['id']);logger[_0x1d95('0x21')](_0x1d95('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1d95('0x50'),_0x20b3e0[_0x1d95('0x17')]),_0x1d95('0x51'),{'uri':util[_0x1d95('0x1d')]('%s/helpdesk/tickets/%d',_0x5d1cf5[_0x1d95('0x29')],_0x660545['id'])});}})[_0x1d95('0x52')](function(_0x17ae7b){logger[_0x1d95('0x53')](_0x1d95('0x4b'),JSON['stringify'](_0x17ae7b));});};exports[_0x1d95('0x54')]=function(_0x3abfba,_0x2c53dc,_0x35e8be,_0x13acf0,_0x4a69ed,_0x3c2a5a,_0x223045){var _0x42d93b,_0x110578;_0x3c2a5a[_0x1d95('0x29')]=intUtil['stripTrailingSlash'](_0x3c2a5a[_0x1d95('0x29')]);_0x3c2a5a['serverUrl']=intUtil[_0x1d95('0x48')](_0x3c2a5a[_0x1d95('0x49')]);if(_0x223045&&_0x223045[_0x1d95('0x55')]&&_0x223045[_0x1d95('0x55')]!==_0x1d95('0x56')){logger[_0x1d95('0x21')](_0x1d95('0x57'),_0x1d95('0x4c'));_0x2c53dc[_0x1d95('0x4d')]=util[_0x1d95('0x1d')](_0x1d95('0x58'),_0x3c2a5a[_0x1d95('0x49')],_0x2c53dc['uniqueid'],md5(_0x2c53dc[_0x1d95('0x4e')]));}headers[_0x1d95('0x59')]=getAuth(_0x3c2a5a);return getUser(_0x3c2a5a,_0x13acf0[_0x1d95('0x27')])['then'](function(_0xca3413){_0x42d93b=_0xca3413;logger[_0x1d95('0x21')](_0x1d95('0x5a'),_0x42d93b['id']);return getEndUser(_0x3c2a5a,_0x2c53dc[_0x1d95('0x5b')],_0x2c53dc[_0x1d95('0x5c')]);})[_0x1d95('0x20')](function(_0x3f3a0a){_0x110578=_0x3f3a0a;logger[_0x1d95('0x21')]('The\x20Enduser\x20ID\x20is:',_0x110578['id']);return getTicket(_0x3c2a5a,_0x42d93b,_0x110578,_0x35e8be,_0x2c53dc);})[_0x1d95('0x20')](function(_0x20af09){if(_0x20af09&&_0x20af09['id']){logger[_0x1d95('0x21')](_0x1d95('0x5d'));logger[_0x1d95('0x21')](_0x1d95('0x4f'),_0x20af09['id']);logger['info']('[OUTBOUND]',_0x1d95('0x5e'));emit(util[_0x1d95('0x1d')](_0x1d95('0x50'),_0x13acf0[_0x1d95('0x17')]),_0x1d95('0x51'),{'uri':util[_0x1d95('0x1d')]('%s/helpdesk/tickets/%d',_0x3c2a5a[_0x1d95('0x29')],_0x20af09['id'])});}})[_0x1d95('0x52')](function(_0x5e67d5){logger['error'](_0x1d95('0x57'),JSON['stringify'](_0x5e67d5));});};exports[_0x1d95('0x5f')]=function(_0x681aa7,_0x2fe095,_0x2634aa,_0xd6f8e0,_0x1409a1,_0x2ea1e7){var _0x4439d2,_0x454dc5;_0x2ea1e7[_0x1d95('0x29')]=intUtil[_0x1d95('0x48')](_0x2ea1e7['remoteUri']);_0x2ea1e7[_0x1d95('0x49')]=intUtil[_0x1d95('0x48')](_0x2ea1e7['serverUrl']);if(_0x1409a1&&_0x1409a1['monitor_format']){logger[_0x1d95('0x21')]('['+_0x2fe095[_0x1d95('0x60')][_0x1d95('0x61')]()+']','Recording\x20is\x20enabled!');_0x2fe095[_0x1d95('0x4d')]=util['format'](_0x1d95('0x58'),_0x2ea1e7[_0x1d95('0x49')],_0x2fe095[_0x1d95('0x4e')],md5(_0x2fe095[_0x1d95('0x4e')]));}else{_0x2fe095[_0x1d95('0x4d')]='';}headers[_0x1d95('0x59')]=getAuth(_0x2ea1e7);return getUser(_0x2ea1e7,'')['then'](function(_0x4cb965){_0x4439d2=_0x4cb965;logger[_0x1d95('0x21')](_0x1d95('0x5a'),_0x4439d2['id']);return getEndUser(_0x2ea1e7,_0x2fe095[_0x1d95('0x62')],_0x2fe095[_0x1d95('0x11')]);})[_0x1d95('0x20')](function(_0x34188a){_0x454dc5=_0x34188a;logger[_0x1d95('0x21')]('The\x20Enduser\x20ID\x20is:',_0x454dc5['id']);return getTicket(_0x2ea1e7,_0x4439d2,_0x454dc5,_0x2634aa,_0x2fe095);})['then'](function(_0x2126e1){if(_0x2126e1){logger['info'](_0x1d95('0x5d'));logger[_0x1d95('0x21')](_0x1d95('0x4f'),_0x2126e1['id']);}})[_0x1d95('0x52')](function(_0x27450d){logger['error']('['+_0x2fe095['lastevent'][_0x1d95('0x61')]()+']',JSON[_0x1d95('0x63')](_0x27450d));});};
\ No newline at end of file
+var _0xf353=['%s/helpdesk/tickets/%d','unmanaged','toUpperCase','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','type','nameField','idField','customField','push','content','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xf353,0xc5));var _0x3f35=function(_0x3b0196,_0x3e39a1){_0x3b0196=_0x3b0196-0x0;var _0x663b5a=_0xf353[_0x3b0196];return _0x663b5a;};'use strict';var _=require(_0x3f35('0x0'));var rp=require(_0x3f35('0x1'));var md5=require(_0x3f35('0x2'));var util=require('util');var Redis=require(_0x3f35('0x3'));var intUtil=require(_0x3f35('0x4'));var config=require(_0x3f35('0x5'));var logger=require(_0x3f35('0x6'))('freshdesk');config['redis']=_[_0x3f35('0x7')](config[_0x3f35('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x3f35('0x9'))(new Redis(config[_0x3f35('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x3f35('0xa')};function emit(_0x53f957,_0x4d5898,_0x4c599f){io['to'](_0x53f957)[_0x3f35('0xb')](_0x4d5898,_0x4c599f);}function getTicket(_0x175a0d,_0x2ccadf,_0x2aabaa,_0x9ac484,_0x4f8d95){logger[_0x3f35('0xc')]('Creating\x20new\x20ticket...');var _0x4fbea4=_[_0x3f35('0xd')]({'responder_id':_0x2ccadf['id'],'requester_id':_0x2aabaa['id'],'name':util[_0x3f35('0xe')](_0x3f35('0xf'),_0x4f8d95[_0x3f35('0x10')]),'phone':_0x4f8d95[_0x3f35('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x3f35('0x12')](_0x9ac484['Subjects'],_0x4f8d95,'\x20'),'description':intUtil[_0x3f35('0x12')](_0x9ac484[_0x3f35('0x13')],_0x4f8d95,_0x3f35('0x14')),'tags':getTags(_0x9ac484[_0x3f35('0x15')],_0x3f35('0x16'))},getCustomFields(_0x9ac484[_0x3f35('0x17')],_0x4f8d95));_0x4fbea4[_0x3f35('0x18')]=_[_0x3f35('0x19')](_[_0x3f35('0x1a')](_0x4fbea4[_0x3f35('0x18')],'id'),_0x3f35('0x1b'));return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x1c'),_0x175a0d[_0x3f35('0x1d')]),'method':_0x3f35('0x1e'),'body':_0x4fbea4})[_0x3f35('0x1f')](function(_0x20b9ee){logger['info']('Ticket\x20created!');return _0x20b9ee;});}function getUser(_0x3397cb,_0x2cb35a){if(intUtil[_0x3f35('0x20')](_0x2cb35a)){return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x21'),_0x3397cb[_0x3f35('0x1d')]),'qs':{'email':_0x2cb35a}})['then'](function(_0x520e33){if(_0x520e33[_0x3f35('0x22')]){logger[_0x3f35('0xc')](_0x3f35('0x23'));return _['find'](_0x520e33,function(_0xb536c3){return _0xb536c3['contact'][_0x3f35('0x24')]===_0x2cb35a;});}else{logger[_0x3f35('0xc')](_0x3f35('0x25'));return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x26'),_0x3397cb[_0x3f35('0x1d')])})['then'](function(_0x5b26a2){logger[_0x3f35('0xc')](_0x3f35('0x27'));return _0x5b26a2;});}});}else{logger[_0x3f35('0xc')](_0x3f35('0x28'));return request({'uri':util[_0x3f35('0xe')](_0x3f35('0x26'),_0x3397cb[_0x3f35('0x1d')])})[_0x3f35('0x1f')](function(_0x10b71c){logger['info'](_0x3f35('0x27'));return _0x10b71c;});}}function getEndUser(_0x23cd3a,_0x1415d6,_0x330852){logger['info'](_0x3f35('0x29'),_0x330852);return request({'uri':util[_0x3f35('0xe')]('%s/api/v2/contacts',_0x23cd3a[_0x3f35('0x1d')]),'qs':{'phone':_0x330852}})[_0x3f35('0x1f')](function(_0x1a2fd7){if(_0x1a2fd7[_0x3f35('0x22')]){logger[_0x3f35('0xc')](_0x3f35('0x2a'));return _[_0x3f35('0x2b')](_0x1a2fd7,{'phone':_0x330852});}else{logger[_0x3f35('0xc')](_0x3f35('0x2c'));return request({'uri':util['format'](_0x3f35('0x2d'),_0x23cd3a[_0x3f35('0x1d')]),'method':_0x3f35('0x1e'),'body':{'name':_0x1415d6,'phone':_0x330852}})[_0x3f35('0x1f')](function(_0xbca459){logger[_0x3f35('0xc')](_0x3f35('0x2e'));return _0xbca459;});}});}function getAuth(_0x2e05f8){return util[_0x3f35('0xe')](_0x3f35('0x2f'),new Buffer(_0x2e05f8[_0x3f35('0x30')]+':X')[_0x3f35('0x31')]('base64'));}function request(_0x387302){logger[_0x3f35('0x32')](_0x3f35('0x33'),JSON[_0x3f35('0x34')](_0x387302));return rp(_[_0x3f35('0x7')](_0x387302,{'method':_0x3f35('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x700a16,_0x5563a9){var _0x4544f6=[];if(_0x700a16&&_0x700a16[_0x3f35('0x22')]>0x0){_0x4544f6=_[_0x3f35('0x36')](_0x700a16,_0x5563a9);}return _0x4544f6;}function getCustomFields(_0x488a10,_0xdaab59){var _0x107edb=[];var _0x4022a5={'custom_fields':[]};if(_0x488a10['length']>0x0){_[_0x3f35('0x37')](_0x488a10,function(_0x549e06){if(_[_0x3f35('0x38')]([_0x3f35('0x39'),_0x3f35('0x3a')],_0x549e06[_0x3f35('0x3b')])&&_0x549e06[_0x3f35('0x3c')]&&!_0x549e06['customField']){_0x4022a5[_0x549e06[_0x3f35('0x3c')]['toLowerCase']()]=_0x549e06['content']['toString']();}else if(_[_0x3f35('0x38')]([_0x3f35('0x39'),_0x3f35('0x3a')],_0x549e06[_0x3f35('0x3b')])&&_0x549e06[_0x3f35('0x3d')]&&_0x549e06[_0x3f35('0x3e')]){_0x4022a5[_0x3f35('0x18')][_0x3f35('0x3f')]({'id':_0x549e06['idField'],'value':_0x549e06[_0x3f35('0x40')][_0x3f35('0x31')]()});}else if(_0x549e06[_0x3f35('0x3b')]==='variable'&&_0x549e06[_0x3f35('0x41')]&&_0x549e06['idField']&&_0x549e06[_0x3f35('0x3e')]){_0xdaab59[_0x549e06[_0x3f35('0x41')]]&&_0x4022a5['custom_fields'][_0x3f35('0x3f')]({'id':_0x549e06[_0x3f35('0x3d')],'value':_0xdaab59[_0x549e06['variableName']][_0x3f35('0x31')]()});}else if(_0x549e06[_0x3f35('0x3b')]===_0x3f35('0x42')&&_0x549e06[_0x3f35('0x43')]&&_0x549e06[_0x3f35('0x43')][_0x3f35('0x16')]&&_0x549e06[_0x3f35('0x3d')]&&_0x549e06['customField']){_0xdaab59[_0x549e06[_0x3f35('0x43')][_0x3f35('0x16')][_0x3f35('0x44')]()]&&_0x4022a5[_0x3f35('0x18')][_0x3f35('0x3f')]({'id':_0x549e06[_0x3f35('0x3d')],'value':_0xdaab59[_0x549e06[_0x3f35('0x43')][_0x3f35('0x16')][_0x3f35('0x44')]()][_0x3f35('0x31')]()});}});}return _0x4022a5;}exports[_0x3f35('0x45')]=function(_0x17cde1,_0x328966,_0x55c977,_0x41c5ae,_0x3e36ce,_0x352880){var _0x23a013,_0x106731;_0x352880['remoteUri']=intUtil[_0x3f35('0x46')](_0x352880[_0x3f35('0x1d')]);_0x352880[_0x3f35('0x47')]=intUtil[_0x3f35('0x46')](_0x352880[_0x3f35('0x47')]);if(_0x3e36ce&&_0x3e36ce[_0x3f35('0x48')]){logger[_0x3f35('0xc')](_0x3f35('0x49'),_0x3f35('0x4a'));_0x328966[_0x3f35('0x4b')]=util[_0x3f35('0xe')](_0x3f35('0x4c'),_0x352880['serverUrl'],_0x328966[_0x3f35('0x4d')],md5(_0x328966[_0x3f35('0x4d')]));}else{_0x328966['recordingURL']='';}headers[_0x3f35('0x4e')]=getAuth(_0x352880);return getUser(_0x352880,_0x41c5ae[_0x3f35('0x24')])[_0x3f35('0x1f')](function(_0x19def6){_0x23a013=_0x19def6;logger[_0x3f35('0xc')](_0x3f35('0x4f'),_0x23a013['id']);return getEndUser(_0x352880,_0x328966[_0x3f35('0x10')],_0x328966[_0x3f35('0x11')]);})[_0x3f35('0x1f')](function(_0x135f5e){_0x106731=_0x135f5e;logger[_0x3f35('0xc')]('The\x20Enduser\x20ID\x20is:',_0x106731['id']);return getTicket(_0x352880,_0x23a013,_0x106731,_0x55c977,_0x328966);})['then'](function(_0xe12db8){if(_0xe12db8&&_0xe12db8['id']){logger[_0x3f35('0xc')](_0x3f35('0x50'));logger[_0x3f35('0xc')]('The\x20Ticket\x20ID\x20is:',_0xe12db8['id']);logger[_0x3f35('0xc')](_0x3f35('0x49'),_0x3f35('0x51'));emit(util[_0x3f35('0xe')](_0x3f35('0x52'),_0x41c5ae[_0x3f35('0x16')]),_0x3f35('0x53'),{'uri':util[_0x3f35('0xe')]('%s/helpdesk/tickets/%d',_0x352880[_0x3f35('0x1d')],_0xe12db8['id'])});}})[_0x3f35('0x54')](function(_0x15baaa){logger['error']('[QUEUE]',JSON[_0x3f35('0x34')](_0x15baaa));});};exports[_0x3f35('0x55')]=function(_0x48b4bc,_0x1f2a4f,_0x36919d,_0xce83e4,_0x5bd303,_0x1c32d5,_0xf129b7){var _0x3bcd2e,_0xd3844d;_0x1c32d5[_0x3f35('0x1d')]=intUtil['stripTrailingSlash'](_0x1c32d5[_0x3f35('0x1d')]);_0x1c32d5[_0x3f35('0x47')]=intUtil['stripTrailingSlash'](_0x1c32d5[_0x3f35('0x47')]);if(_0xf129b7&&_0xf129b7[_0x3f35('0x56')]&&_0xf129b7['recordingFormat']!==_0x3f35('0x57')){logger[_0x3f35('0xc')](_0x3f35('0x58'),'Recording\x20is\x20enabled!');_0x1f2a4f[_0x3f35('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c32d5[_0x3f35('0x47')],_0x1f2a4f['uniqueid'],md5(_0x1f2a4f[_0x3f35('0x4d')]));}headers[_0x3f35('0x4e')]=getAuth(_0x1c32d5);return getUser(_0x1c32d5,_0xce83e4[_0x3f35('0x24')])[_0x3f35('0x1f')](function(_0x4f0f89){_0x3bcd2e=_0x4f0f89;logger[_0x3f35('0xc')](_0x3f35('0x4f'),_0x3bcd2e['id']);return getEndUser(_0x1c32d5,_0x1f2a4f[_0x3f35('0x59')],_0x1f2a4f[_0x3f35('0x5a')]);})['then'](function(_0x75b015){_0xd3844d=_0x75b015;logger[_0x3f35('0xc')]('The\x20Enduser\x20ID\x20is:',_0xd3844d['id']);return getTicket(_0x1c32d5,_0x3bcd2e,_0xd3844d,_0x36919d,_0x1f2a4f);})['then'](function(_0x58bb3e){if(_0x58bb3e&&_0x58bb3e['id']){logger[_0x3f35('0xc')](_0x3f35('0x50'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x58bb3e['id']);logger[_0x3f35('0xc')](_0x3f35('0x58'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3f35('0xe')](_0x3f35('0x52'),_0xce83e4[_0x3f35('0x16')]),'trigger:browser:url',{'uri':util[_0x3f35('0xe')](_0x3f35('0x5b'),_0x1c32d5['remoteUri'],_0x58bb3e['id'])});}})[_0x3f35('0x54')](function(_0x502fb9){logger['error']('[OUTBOUND]',JSON[_0x3f35('0x34')](_0x502fb9));});};exports[_0x3f35('0x5c')]=function(_0x4d20b6,_0x4f5579,_0x3fe687,_0x5e4483,_0x471bb6,_0x162a60){var _0x47416e,_0x3e0872;_0x162a60[_0x3f35('0x1d')]=intUtil[_0x3f35('0x46')](_0x162a60[_0x3f35('0x1d')]);_0x162a60[_0x3f35('0x47')]=intUtil[_0x3f35('0x46')](_0x162a60[_0x3f35('0x47')]);if(_0x471bb6&&_0x471bb6['monitor_format']){logger[_0x3f35('0xc')]('['+_0x4f5579['lastevent'][_0x3f35('0x5d')]()+']',_0x3f35('0x4a'));_0x4f5579['recordingURL']=util[_0x3f35('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x162a60[_0x3f35('0x47')],_0x4f5579['uniqueid'],md5(_0x4f5579['uniqueid']));}else{_0x4f5579[_0x3f35('0x4b')]='';}headers[_0x3f35('0x4e')]=getAuth(_0x162a60);return getUser(_0x162a60,'')[_0x3f35('0x1f')](function(_0x2d4734){_0x47416e=_0x2d4734;logger[_0x3f35('0xc')](_0x3f35('0x4f'),_0x47416e['id']);return getEndUser(_0x162a60,_0x4f5579[_0x3f35('0x10')],_0x4f5579[_0x3f35('0x11')]);})[_0x3f35('0x1f')](function(_0x66fcfd){_0x3e0872=_0x66fcfd;logger[_0x3f35('0xc')](_0x3f35('0x5e'),_0x3e0872['id']);return getTicket(_0x162a60,_0x47416e,_0x3e0872,_0x3fe687,_0x4f5579);})['then'](function(_0x1ac3fe){if(_0x1ac3fe){logger[_0x3f35('0xc')](_0x3f35('0x50'));logger[_0x3f35('0xc')](_0x3f35('0x5f'),_0x1ac3fe['id']);}})['catch'](function(_0xbe0c94){logger['error']('['+_0x4f5579['lastevent'][_0x3f35('0x5d')]()+']',JSON[_0x3f35('0x34')](_0xbe0c94));});};
\ No newline at end of file
index 8c6e30d..ee256b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3ea=['util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','adminEmail','info','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise'];(function(_0x30be59,_0xb414fd){var _0x23d4cd=function(_0x3e11a5){while(--_0x3e11a5){_0x30be59['push'](_0x30be59['shift']());}};_0x23d4cd(++_0xb414fd);}(_0xb3ea,0x109));var _0xab3e=function(_0x502bf9,_0x372b11){_0x502bf9=_0x502bf9-0x0;var _0x3768ac=_0xb3ea[_0x502bf9];return _0x3768ac;};'use strict';var _=require(_0xab3e('0x0'));var rp=require(_0xab3e('0x1'));var md5=require('md5');var util=require(_0xab3e('0x2'));var moment=require(_0xab3e('0x3'));var Promise=require(_0xab3e('0x4'));var Redis=require(_0xab3e('0x5'));var intUtil=require(_0xab3e('0x6'));var config=require(_0xab3e('0x7'));var logger=require(_0xab3e('0x8'))(_0xab3e('0x9'));config['redis']=_[_0xab3e('0xa')](config[_0xab3e('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xab3e('0xc'))(new Redis(config[_0xab3e('0xb')]));function getAdminId(_0x284c32,_0x32e329,_0x2a0f2f,_0x432c4e){return new Promise(function(_0x20ed5d,_0x2f5f87){var _0x1db8d3=![];var _0xd25eea={'method':'GET','uri':_0x432c4e+_0xab3e('0xd'),'json':!![]};_0xd25eea[_0xab3e('0xe')]=_0x2a0f2f;logger['info'](_0xab3e('0xf'));return rp(_0xd25eea)[_0xab3e('0x10')](function(_0x50c92b){if(_0x50c92b){var _0x4fa588=_0x50c92b[_0xab3e('0x11')];var _0x1e0ac6=null;for(_0x1e0ac6=0x0;_0x1e0ac6<_0x4fa588[_0xab3e('0x12')];_0x1e0ac6++){if(_0x4fa588[_0x1e0ac6]['email']===_0x284c32[_0xab3e('0x13')]){_0x284c32['adminId']=_0x4fa588[_0x1e0ac6]['id'];_0x1db8d3=!![];}}if(_0x1db8d3){logger[_0xab3e('0x14')]('Admin\x20found:',_0x284c32[_0xab3e('0x15')]);_0x20ed5d(_0x284c32);}else{_0x2f5f87({'statusCode':0x194,'message':_0xab3e('0x16')});}}else{_0x2f5f87({'statusCode':0x194,'message':_0xab3e('0x16')});}})[_0xab3e('0x17')](function(_0x5ef29f){logger[_0xab3e('0x18')]('['+[_0x32e329[_0xab3e('0x19')]()]+']',_0x5ef29f[_0xab3e('0x1a')]);_0x2f5f87(_0x5ef29f);});});}function getUser(_0x3d8259,_0x4d1729,_0x138a8a){return function(_0x4ad799){return new Promise(function(_0x5d6bf9,_0xcd8c33){var _0x1ca261={'method':'GET','uri':_0x138a8a+_0xab3e('0xd'),'json':!![]};_0x1ca261['headers']=_0x4d1729;logger['info']('Getting\x20user\x20list');return rp(_0x1ca261)['then'](function(_0x2bcae8){if(_0x2bcae8){var _0x5f5305=_0x2bcae8[_0xab3e('0x11')];var _0x210f90=![];var _0x39ea97=null;if(_0x4ad799[_0xab3e('0x1b')]!==null){logger['info'](_0xab3e('0x1c'),_0x4ad799[_0xab3e('0x1b')]);_0x4ad799[_0xab3e('0x1d')]=_0x4ad799[_0xab3e('0x1b')];for(_0x39ea97=0x0;_0x39ea97<_0x5f5305['length'];_0x39ea97++){if(_0x5f5305[_0x39ea97][_0xab3e('0x1e')]===_0x4ad799[_0xab3e('0x1b')]){_0x210f90=!![];_0x4ad799[_0xab3e('0x1f')]=_0x5f5305[_0x39ea97]['id'];logger[_0xab3e('0x14')](_0xab3e('0x20'),_0x4ad799['userId']);}}}if(!_0x210f90){logger['info'](_0xab3e('0x21'));_0x4ad799['userEmail']=_0x4ad799[_0xab3e('0x13')];_0x4ad799['userId']=_0x4ad799[_0xab3e('0x15')];_0x210f90=!![];}if(_0x210f90){_0x5d6bf9(_0x4ad799);}else{_0xcd8c33({'statusCode':0x194,'message':_0xab3e('0x16')});}}else{_0xcd8c33({'statusCode':0x194,'message':_0xab3e('0x16')});}})[_0xab3e('0x17')](function(_0x4343f1){logger[_0xab3e('0x18')]('['+[_0x3d8259[_0xab3e('0x19')]()]+']',_0x4343f1[_0xab3e('0x1a')]);_0xcd8c33(_0x4343f1);});});};}function searchContact(_0x2c87a6,_0xb9949b,_0x1196a9,_0x1a9520){return new Promise(function(_0x511ac0,_0x39308c){var _0xe0b7e6={'method':'GET','headers':_0xb9949b,'uri':_0x2c87a6+'/api/lookup?q='+_0x1a9520+_0xab3e('0x22')+_0x1196a9+_0xab3e('0x23'),'json':!![]};rp(_0xe0b7e6)[_0xab3e('0x10')](function(_0x451900){var _0x51385c=_[_0xab3e('0x24')](_0x451900['contacts'][_0xab3e('0x25')],[_0x1196a9,_0x1a9520]);_0x511ac0(_0x51385c);})[_0xab3e('0x17')](function(_0x2d92ff){_0x39308c(_0x2d92ff);});});}function getEndUser(_0x41e256,_0x53e40d,_0xa9b809){return function(_0x60b892){return new Promise(function(_0x2aad8d,_0x1953f6){logger[_0xab3e('0x14')](util[_0xab3e('0x26')](_0xab3e('0x27'),_0x60b892['contactNumber']));searchContact(_0xa9b809,_0x53e40d,_0xab3e('0x28'),_0x60b892[_0xab3e('0x29')])[_0xab3e('0x10')](function(_0x27c527){if(_0x27c527){_0x60b892[_0xab3e('0x2a')]=_0x27c527['id'];logger[_0xab3e('0x14')]('Contact\x20found\x20mobile_number:',_0x60b892[_0xab3e('0x2a')]);return _0x2aad8d(_0x60b892);}searchContact(_0xa9b809,_0x53e40d,_0xab3e('0x2b'),_0x60b892[_0xab3e('0x29')])[_0xab3e('0x10')](function(_0x47b56b){if(_0x47b56b){_0x60b892[_0xab3e('0x2a')]=_0x47b56b['id'];logger[_0xab3e('0x14')](_0xab3e('0x2c'),_0x60b892[_0xab3e('0x2a')]);return _0x2aad8d(_0x60b892);}createEndUser(_0x60b892,_0x41e256,_0x53e40d,_0xa9b809)[_0xab3e('0x10')](function(_0x521917){logger[_0xab3e('0x14')]('Contact\x20created:',_0x521917[_0xab3e('0x2a')]);return _0x2aad8d(_0x521917);});});})[_0xab3e('0x17')](function(_0x4ecb48){_0x1953f6(_0x4ecb48);});});};}function createEndUser(_0x5142c4,_0xf52593,_0x294945,_0x2e5285){return new Promise(function(_0x3ea68a,_0x45e53d){var _0x5ba92a=moment();var _0x251577={'method':_0xab3e('0x2d'),'uri':_0x2e5285+_0xab3e('0x2e'),'body':{'contact':{'last_name':_0x5142c4[_0xab3e('0x29')],'work_number':_0x5142c4[_0xab3e('0x29')],'mobile_number':_0x5142c4[_0xab3e('0x29')],'owner_id':_0x5142c4[_0xab3e('0x1f')],'created_at':_0x5ba92a[_0xab3e('0x26')](_0xab3e('0x2f'))}},'json':!![]};_0x251577['headers']=_0x294945;logger['info'](_0xab3e('0x30'));return rp(_0x251577)[_0xab3e('0x10')](function(_0x4c3665){_0x5142c4[_0xab3e('0x2a')]=_0x4c3665[_0xab3e('0x31')]['id'];_0x3ea68a(_0x5142c4);})[_0xab3e('0x17')](function(_0x1bdbcc){logger['error']('['+[_0xf52593[_0xab3e('0x19')]()]+']',_0x1bdbcc[_0xab3e('0x1a')]);_0x45e53d(_0x1bdbcc[_0xab3e('0x1a')]);});});}function getTicket(_0x4cee74,_0x202ca7,_0x1733d6,_0x2922b1,_0x4efb90){return function(_0x1fc95f){logger[_0xab3e('0x14')](_0xab3e('0x32'));return new Promise(function(_0x13ecb1,_0x598b15){var _0x1ddb81=moment();var _0x46324c={'method':_0xab3e('0x2d'),'uri':_0x1733d6+_0xab3e('0x33'),'body':{'title':intUtil[_0xab3e('0x34')](_0x2922b1[_0xab3e('0x35')],_0x4efb90,'\x20'),'description':intUtil[_0xab3e('0x34')](_0x2922b1['Descriptions'],_0x4efb90,'\x0a'),'owner_id':_0x1fc95f[_0xab3e('0x1f')],'creater_id':_0x1fc95f['adminId'],'targetable_id':_0x1fc95f[_0xab3e('0x2a')],'targetable_type':_0xab3e('0x36'),'created_at':_0x1ddb81[_0xab3e('0x26')](_0xab3e('0x2f')),'due_date':_0x1ddb81[_0xab3e('0x37')](0x1e,'m')[_0xab3e('0x26')](_0xab3e('0x2f'))},'json':!![]};_0x46324c[_0xab3e('0xe')]=_0x202ca7;return rp(_0x46324c)[_0xab3e('0x10')](function(_0xd7a225){_0x1fc95f[_0xab3e('0x38')]=_0xd7a225[_0xab3e('0x39')]['id'];logger[_0xab3e('0x14')](_0xab3e('0x3a'),_0x1fc95f[_0xab3e('0x38')]);_0x13ecb1(_0x1fc95f);})[_0xab3e('0x17')](function(_0x1ba36d){logger['error']('['+[_0x4cee74[_0xab3e('0x19')]()]+']',_0x1ba36d[_0xab3e('0x1a')]);_0x598b15(_0x1ba36d[_0xab3e('0x1a')]);});});};}function emit(_0x1fff8c,_0xf4c048,_0x1a7edf){var _0x48daaa={'uri':_0x1fff8c+_0xab3e('0x3b')+_0x1a7edf};io['to'](util[_0xab3e('0x26')](_0xab3e('0x3c'),_0xf4c048))[_0xab3e('0x3d')](_0xab3e('0x3e'),_0x48daaa);}exports['cs']=function(_0x40a996,_0x1fc9dd,_0x12fef2,_0x272413,_0x1e4ef6,_0x52ff37,_0xbdb075,_0x180d15){var _0x2c52bd={};var _0xd84297={'Authorization':_0xab3e('0x3f')+_0x52ff37[_0xab3e('0x40')]};_0x52ff37[_0xab3e('0x41')]=intUtil[_0xab3e('0x42')](_0x52ff37[_0xab3e('0x41')]);_0x52ff37[_0xab3e('0x43')]=intUtil['stripTrailingSlash'](_0x52ff37['serverUrl']);var _0x13b661=_0x52ff37[_0xab3e('0x41')];_0x2c52bd[_0xab3e('0x13')]=_0x52ff37[_0xab3e('0x44')];_0x2c52bd[_0xab3e('0x29')]=_0x180d15[_0xab3e('0x45')]()==='outbound'?_0x1fc9dd[_0xab3e('0x46')]:_0x1fc9dd[_0xab3e('0x47')];_0x2c52bd[_0xab3e('0x48')]=_0x180d15===_0xab3e('0x49')||_0x180d15===_0xab3e('0x4a')?_0xab3e('0x49'):_0xab3e('0x4b');if(_0x272413){_0x2c52bd[_0xab3e('0x1b')]=_0x272413[_0xab3e('0x1e')];}var _0x3b8c18=util[_0xab3e('0x26')](_0xab3e('0x4c'),_0x52ff37['serverUrl'],_0x1fc9dd[_0xab3e('0x4d')],md5(_0x1fc9dd['uniqueid']));if(_0x1e4ef6&&_0x1e4ef6['monitor_format']){logger[_0xab3e('0x14')](_0xab3e('0x4e'),_0xab3e('0x4f'));_0x1fc9dd[_0xab3e('0x50')]=_0x3b8c18;}else if(_0xbdb075&&_0xbdb075[_0xab3e('0x51')]&&_0xbdb075[_0xab3e('0x51')]!==_0xab3e('0x52')){logger[_0xab3e('0x14')](_0xab3e('0x53'),_0xab3e('0x4f'));_0x1fc9dd[_0xab3e('0x50')]=_0x3b8c18;}else{_0x1fc9dd[_0xab3e('0x50')]='';}return getAdminId(_0x2c52bd,_0x180d15,_0xd84297,_0x13b661)['then'](getUser(_0x180d15,_0xd84297,_0x13b661))[_0xab3e('0x10')](getEndUser(_0x180d15,_0xd84297,_0x13b661))[_0xab3e('0x10')](getTicket(_0x180d15,_0xd84297,_0x13b661,_0x12fef2,_0x1fc9dd))['then'](function(_0x240dd0){logger[_0xab3e('0x14')](util['format'](_0xab3e('0x54'),_0x240dd0[_0xab3e('0x38')]));if(_0x180d15!==_0xab3e('0x4a')){logger[_0xab3e('0x14')]('['+[_0x180d15['toUpperCase']()]+']',_0xab3e('0x55'));emit(_0x13b661,_0x272413[_0xab3e('0x56')],_0x240dd0[_0xab3e('0x2a')]);}})[_0xab3e('0x17')](function(_0x209ebb){logger[_0xab3e('0x18')]('['+[_0x180d15['toUpperCase']()]+_0xab3e('0x57'),util[_0xab3e('0x58')](_0x209ebb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x752a=['serverUrl','remoteUri','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','userId','Admin\x20selected','catch','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','ticketId','task','/contacts/','user:%s','emit','apiKey','stripTrailingSlash'];(function(_0x5df44a,_0x47812e){var _0x4e22b2=function(_0x1215a7){while(--_0x1215a7){_0x5df44a['push'](_0x5df44a['shift']());}};_0x4e22b2(++_0x47812e);}(_0x752a,0xbc));var _0xa752=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x752a[_0x303c30];return _0x43161b;};'use strict';var _=require(_0xa752('0x0'));var rp=require(_0xa752('0x1'));var md5=require('md5');var util=require(_0xa752('0x2'));var moment=require(_0xa752('0x3'));var Promise=require(_0xa752('0x4'));var Redis=require(_0xa752('0x5'));var intUtil=require(_0xa752('0x6'));var config=require(_0xa752('0x7'));var logger=require(_0xa752('0x8'))(_0xa752('0x9'));config[_0xa752('0xa')]=_[_0xa752('0xb')](config[_0xa752('0xa')],{'host':_0xa752('0xc'),'port':0x18eb});var io=require(_0xa752('0xd'))(new Redis(config['redis']));function getAdminId(_0x4f5db2,_0x1d73e2,_0x3100d7,_0x4b8107){return new Promise(function(_0x2e41bd,_0x32ba50){var _0x298cbb=![];var _0x4247a5={'method':_0xa752('0xe'),'uri':_0x4b8107+_0xa752('0xf'),'json':!![]};_0x4247a5[_0xa752('0x10')]=_0x3100d7;logger[_0xa752('0x11')](_0xa752('0x12'));return rp(_0x4247a5)[_0xa752('0x13')](function(_0x43fad5){if(_0x43fad5){var _0x44c3d2=_0x43fad5['users'];var _0x174e60=null;for(_0x174e60=0x0;_0x174e60<_0x44c3d2[_0xa752('0x14')];_0x174e60++){if(_0x44c3d2[_0x174e60][_0xa752('0x15')]===_0x4f5db2[_0xa752('0x16')]){_0x4f5db2['adminId']=_0x44c3d2[_0x174e60]['id'];_0x298cbb=!![];}}if(_0x298cbb){logger[_0xa752('0x11')]('Admin\x20found:',_0x4f5db2[_0xa752('0x17')]);_0x2e41bd(_0x4f5db2);}else{_0x32ba50({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x32ba50({'statusCode':0x194,'message':_0xa752('0x18')});}})['catch'](function(_0x363a27){logger[_0xa752('0x19')]('['+[_0x1d73e2[_0xa752('0x1a')]()]+']',_0x363a27[_0xa752('0x1b')]);_0x32ba50(_0x363a27);});});}function getUser(_0x4a6573,_0x4e21c5,_0x6dd5e2){return function(_0x4fe6f5){return new Promise(function(_0x54fc74,_0x3e6c30){var _0x4c4c41={'method':_0xa752('0xe'),'uri':_0x6dd5e2+_0xa752('0xf'),'json':!![]};_0x4c4c41['headers']=_0x4e21c5;logger[_0xa752('0x11')](_0xa752('0x1c'));return rp(_0x4c4c41)[_0xa752('0x13')](function(_0x680368){if(_0x680368){var _0x35093b=_0x680368[_0xa752('0x1d')];var _0x1eaa3b=![];var _0x3588ad=null;if(_0x4fe6f5['agentEmail']!==null){logger[_0xa752('0x11')](_0xa752('0x1e'),_0x4fe6f5[_0xa752('0x1f')]);_0x4fe6f5[_0xa752('0x20')]=_0x4fe6f5[_0xa752('0x1f')];for(_0x3588ad=0x0;_0x3588ad<_0x35093b['length'];_0x3588ad++){if(_0x35093b[_0x3588ad][_0xa752('0x15')]===_0x4fe6f5[_0xa752('0x1f')]){_0x1eaa3b=!![];_0x4fe6f5['userId']=_0x35093b[_0x3588ad]['id'];logger[_0xa752('0x11')]('User\x20found:',_0x4fe6f5[_0xa752('0x21')]);}}}if(!_0x1eaa3b){logger[_0xa752('0x11')](_0xa752('0x22'));_0x4fe6f5[_0xa752('0x20')]=_0x4fe6f5[_0xa752('0x16')];_0x4fe6f5['userId']=_0x4fe6f5[_0xa752('0x17')];_0x1eaa3b=!![];}if(_0x1eaa3b){_0x54fc74(_0x4fe6f5);}else{_0x3e6c30({'statusCode':0x194,'message':_0xa752('0x18')});}}else{_0x3e6c30({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xa752('0x23')](function(_0x314eb9){logger[_0xa752('0x19')]('['+[_0x4a6573[_0xa752('0x1a')]()]+']',_0x314eb9[_0xa752('0x1b')]);_0x3e6c30(_0x314eb9);});});};}function searchContact(_0x5cb44c,_0x584e15,_0x35b74a,_0x4ded05){return new Promise(function(_0xcd946d,_0x7a542e){var _0x1c4f5a={'method':_0xa752('0xe'),'headers':_0x584e15,'uri':_0x5cb44c+'/api/lookup?q='+_0x4ded05+'&f='+_0x35b74a+_0xa752('0x24'),'json':!![]};rp(_0x1c4f5a)['then'](function(_0x657713){var _0x5c686b=_[_0xa752('0x25')](_0x657713[_0xa752('0x26')][_0xa752('0x26')],[_0x35b74a,_0x4ded05]);_0xcd946d(_0x5c686b);})[_0xa752('0x23')](function(_0x36c07d){_0x7a542e(_0x36c07d);});});}function getEndUser(_0x26ccc8,_0x4f0a88,_0x43796d){return function(_0x5155c9){return new Promise(function(_0x5879a0,_0x173403){logger['info'](util['format'](_0xa752('0x27'),_0x5155c9[_0xa752('0x28')]));searchContact(_0x43796d,_0x4f0a88,_0xa752('0x29'),_0x5155c9[_0xa752('0x28')])[_0xa752('0x13')](function(_0x3132c3){if(_0x3132c3){_0x5155c9[_0xa752('0x2a')]=_0x3132c3['id'];logger[_0xa752('0x11')](_0xa752('0x2b'),_0x5155c9['endUserId']);return _0x5879a0(_0x5155c9);}searchContact(_0x43796d,_0x4f0a88,_0xa752('0x2c'),_0x5155c9[_0xa752('0x28')])[_0xa752('0x13')](function(_0xa2d981){if(_0xa2d981){_0x5155c9[_0xa752('0x2a')]=_0xa2d981['id'];logger[_0xa752('0x11')](_0xa752('0x2d'),_0x5155c9[_0xa752('0x2a')]);return _0x5879a0(_0x5155c9);}createEndUser(_0x5155c9,_0x26ccc8,_0x4f0a88,_0x43796d)[_0xa752('0x13')](function(_0x10ee22){logger[_0xa752('0x11')](_0xa752('0x2e'),_0x10ee22[_0xa752('0x2a')]);return _0x5879a0(_0x10ee22);});});})[_0xa752('0x23')](function(_0x15e36d){_0x173403(_0x15e36d);});});};}function createEndUser(_0x2ffa57,_0x27f9be,_0x3f1762,_0x259741){return new Promise(function(_0x42f15d,_0x453610){var _0x47687a=moment();var _0x8803f3={'method':_0xa752('0x2f'),'uri':_0x259741+_0xa752('0x30'),'body':{'contact':{'last_name':_0x2ffa57[_0xa752('0x28')],'work_number':_0x2ffa57[_0xa752('0x28')],'mobile_number':_0x2ffa57[_0xa752('0x28')],'owner_id':_0x2ffa57['userId'],'created_at':_0x47687a[_0xa752('0x31')](_0xa752('0x32'))}},'json':!![]};_0x8803f3[_0xa752('0x10')]=_0x3f1762;logger[_0xa752('0x11')](_0xa752('0x33'));return rp(_0x8803f3)[_0xa752('0x13')](function(_0x12262b){_0x2ffa57['endUserId']=_0x12262b[_0xa752('0x34')]['id'];_0x42f15d(_0x2ffa57);})[_0xa752('0x23')](function(_0x588dc2){logger[_0xa752('0x19')]('['+[_0x27f9be[_0xa752('0x1a')]()]+']',_0x588dc2[_0xa752('0x1b')]);_0x453610(_0x588dc2[_0xa752('0x1b')]);});});}function getTicket(_0x3b7029,_0x35ef61,_0x4a561f,_0x1dd8d7,_0x19d1fb){return function(_0x33d703){logger[_0xa752('0x11')]('Creating\x20new\x20task');return new Promise(function(_0x2c5eee,_0x2564f7){var _0x543cc9=moment();var _0x540367={'method':_0xa752('0x2f'),'uri':_0x4a561f+_0xa752('0x35'),'body':{'title':intUtil[_0xa752('0x36')](_0x1dd8d7[_0xa752('0x37')],_0x19d1fb,'\x20'),'description':intUtil[_0xa752('0x36')](_0x1dd8d7[_0xa752('0x38')],_0x19d1fb,'\x0a'),'owner_id':_0x33d703['userId'],'creater_id':_0x33d703[_0xa752('0x17')],'targetable_id':_0x33d703[_0xa752('0x2a')],'targetable_type':'Contact','created_at':_0x543cc9['format'](_0xa752('0x32')),'due_date':_0x543cc9['add'](0x1e,'m')[_0xa752('0x31')](_0xa752('0x32'))},'json':!![]};_0x540367[_0xa752('0x10')]=_0x35ef61;return rp(_0x540367)['then'](function(_0x320284){_0x33d703[_0xa752('0x39')]=_0x320284[_0xa752('0x3a')]['id'];logger['info']('Task\x20created:',_0x33d703[_0xa752('0x39')]);_0x2c5eee(_0x33d703);})[_0xa752('0x23')](function(_0x567ba7){logger[_0xa752('0x19')]('['+[_0x3b7029[_0xa752('0x1a')]()]+']',_0x567ba7['message']);_0x2564f7(_0x567ba7['message']);});});};}function emit(_0x55adfa,_0x145ce3,_0x2155ac){var _0x44d899={'uri':_0x55adfa+_0xa752('0x3b')+_0x2155ac};io['to'](util[_0xa752('0x31')](_0xa752('0x3c'),_0x145ce3))[_0xa752('0x3d')]('trigger:browser:url',_0x44d899);}exports['cs']=function(_0x314da6,_0xda19e5,_0x56cfa4,_0x359609,_0x15779f,_0x321471,_0x215b96,_0x179b82){var _0x1ab87c={};var _0x399568={'Authorization':'Token\x20token='+_0x321471[_0xa752('0x3e')]};_0x321471['remoteUri']=intUtil[_0xa752('0x3f')](_0x321471['remoteUri']);_0x321471[_0xa752('0x40')]=intUtil[_0xa752('0x3f')](_0x321471[_0xa752('0x40')]);var _0x66724a=_0x321471[_0xa752('0x41')];_0x1ab87c['adminEmail']=_0x321471['username'];_0x1ab87c[_0xa752('0x28')]=_0x179b82[_0xa752('0x42')]()==='outbound'?_0xda19e5[_0xa752('0x43')]:_0xda19e5[_0xa752('0x44')];_0x1ab87c[_0xa752('0x45')]=_0x179b82===_0xa752('0x46')||_0x179b82===_0xa752('0x47')?_0xa752('0x46'):_0xa752('0x48');if(_0x359609){_0x1ab87c[_0xa752('0x1f')]=_0x359609[_0xa752('0x15')];}var _0x4ff59c=util[_0xa752('0x31')](_0xa752('0x49'),_0x321471[_0xa752('0x40')],_0xda19e5[_0xa752('0x4a')],md5(_0xda19e5[_0xa752('0x4a')]));if(_0x15779f&&_0x15779f[_0xa752('0x4b')]){logger[_0xa752('0x11')](_0xa752('0x4c'),_0xa752('0x4d'));_0xda19e5['recordingURL']=_0x4ff59c;}else if(_0x215b96&&_0x215b96[_0xa752('0x4e')]&&_0x215b96['recordingFormat']!==_0xa752('0x4f')){logger[_0xa752('0x11')]('[OUTBOUND]',_0xa752('0x4d'));_0xda19e5['recordingURL']=_0x4ff59c;}else{_0xda19e5[_0xa752('0x50')]='';}return getAdminId(_0x1ab87c,_0x179b82,_0x399568,_0x66724a)[_0xa752('0x13')](getUser(_0x179b82,_0x399568,_0x66724a))[_0xa752('0x13')](getEndUser(_0x179b82,_0x399568,_0x66724a))[_0xa752('0x13')](getTicket(_0x179b82,_0x399568,_0x66724a,_0x56cfa4,_0xda19e5))[_0xa752('0x13')](function(_0x2a2a0d){logger[_0xa752('0x11')](util[_0xa752('0x31')](_0xa752('0x51'),_0x2a2a0d[_0xa752('0x39')]));if(_0x179b82!=='unmanaged'){logger[_0xa752('0x11')]('['+[_0x179b82['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x66724a,_0x359609['name'],_0x2a2a0d[_0xa752('0x2a')]);}})['catch'](function(_0x3d0066){logger[_0xa752('0x19')]('['+[_0x179b82[_0xa752('0x1a')]()]+_0xa752('0x52'),util[_0xa752('0x53')](_0x3d0066,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index cac2793..73fed14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76df=['./servicenow','./dynamics365','salesforce','sugarcrm','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','find','data3','queue','routeId','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','freshdesk','servicenow','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger'];(function(_0x22c247,_0x3a015e){var _0x2e6877=function(_0x59374e){while(--_0x59374e){_0x22c247['push'](_0x22c247['shift']());}};_0x2e6877(++_0x3a015e);}(_0x76df,0x87));var _0xf76d=function(_0x49a4b5,_0x420d0c){_0x49a4b5=_0x49a4b5-0x0;var _0x343547=_0x76df[_0x49a4b5];return _0x343547;};'use strict';var _=require(_0xf76d('0x0'));var util=require(_0xf76d('0x1'));var zendesk=require(_0xf76d('0x2'));var salesforce=require(_0xf76d('0x3'));var sugarcrm=require(_0xf76d('0x4'));var freshdesk=require(_0xf76d('0x5'));var zoho=require(_0xf76d('0x6'));var desk=require(_0xf76d('0x7'));var vtiger=require(_0xf76d('0x8'));var servicenow=require(_0xf76d('0x9'));var dynamics365=require(_0xf76d('0xa'));var freshsales=require('./freshsales');var integrations=['zendesk',_0xf76d('0xb'),_0xf76d('0xc'),'freshdesk',_0xf76d('0xd'),_0xf76d('0xe'),_0xf76d('0xf'),_0xf76d('0x10'),_0xf76d('0x11'),'servicenow'];exports[_0xf76d('0x12')]=function(_0x3226ea,_0x28a9ef,_0x3ff905,_0x3cd3cb,_0x46eba8,_0x5e03c8){if(_0x3ff905){if(_[_0xf76d('0x13')](integrations,_0x3226ea[_0xf76d('0x14')]['toLowerCase']())){try{var _0x2752b5=null;var _0x47d49e='';var _0x2afea4=_0x3ff905[_0x3226ea['data1']['toLowerCase']()];if(_0x2afea4){var _0x4b58fc=_0x2afea4[_0x3226ea['data2']];if(_0x4b58fc){var _0x4108e6=_[_0xf76d('0x15')](_0x4b58fc['Configurations'],{'id':parseInt(_0x3226ea[_0xf76d('0x16')],0xa)});if(_0x4108e6){if(_0x3cd3cb){if(_0x46eba8&&_0x28a9ef['queue']){_0x47d49e=_0xf76d('0x17');}else if(_0x28a9ef[_0xf76d('0x18')]){_0x47d49e='outbound';}else{console[_0xf76d('0x19')](_0xf76d('0x1a'),_0x28a9ef);}}else{_0x47d49e=_0xf76d('0x1b');}switch(_0x3226ea[_0xf76d('0x14')][_0xf76d('0x1c')]()){case'zendesk':zendesk[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case'salesforce':salesforce[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0xc'):sugarcrm[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0x1d'):freshdesk[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case'zoho':zoho[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0xe'):desk[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case _0xf76d('0xf'):vtiger[_0x47d49e](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8);break;case'freshsales':freshsales['cs'](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8,_0x47d49e);break;case _0xf76d('0x1e'):servicenow['cs'](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8,_0x47d49e);break;case _0xf76d('0x10'):dynamics365['cs'](_0x3226ea,_0x28a9ef,_0x4108e6,_0x3cd3cb,_0x46eba8,_0x4b58fc,_0x5e03c8,_0x47d49e);break;default:console[_0xf76d('0x19')]('unknown\x20integration');}}else{_0x2752b5=require(_0xf76d('0x1f'))(_0x3226ea[_0xf76d('0x14')]['toLowerCase']());_0x2752b5[_0xf76d('0x20')](_0xf76d('0x21'),util[_0xf76d('0x22')](_0xf76d('0x23'),_0x3226ea[_0xf76d('0x14')][_0xf76d('0x1c')](),_0x3226ea['data3']));}}else{_0x2752b5=require('../../../../config/logger')(_0x3226ea['data1'][_0xf76d('0x1c')]());_0x2752b5[_0xf76d('0x20')](_0xf76d('0x21'),util[_0xf76d('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x3226ea[_0xf76d('0x14')][_0xf76d('0x1c')](),_0x3226ea['data2']));}}else{}}catch(_0x53403e){console[_0xf76d('0x20')](_0x53403e);}}}};
\ No newline at end of file
+var _0x859b=['util','./salesforce','./zoho','./vtiger','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','dynamics365','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','lodash'];(function(_0x1f7962,_0x181f16){var _0x3af491=function(_0x504ecf){while(--_0x504ecf){_0x1f7962['push'](_0x1f7962['shift']());}};_0x3af491(++_0x181f16);}(_0x859b,0x149));var _0xb859=function(_0x19fe24,_0x47a3b5){_0x19fe24=_0x19fe24-0x0;var _0x211c0a=_0x859b[_0x19fe24];return _0x211c0a;};'use strict';var _=require(_0xb859('0x0'));var util=require(_0xb859('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0xb859('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0xb859('0x3'));var desk=require('./desk');var vtiger=require(_0xb859('0x4'));var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0xb859('0x5'));var integrations=[_0xb859('0x6'),_0xb859('0x7'),_0xb859('0x8'),_0xb859('0x9'),_0xb859('0xa'),_0xb859('0xb'),_0xb859('0xc'),'dynamics365','freshsales',_0xb859('0xd')];exports[_0xb859('0xe')]=function(_0x99f4de,_0x54a7f0,_0x2aed7b,_0x33f474,_0x1f364b,_0x26e7ff){if(_0x2aed7b){if(_[_0xb859('0xf')](integrations,_0x99f4de[_0xb859('0x10')][_0xb859('0x11')]())){try{var _0x550bc4=null;var _0x29bcf1='';var _0x1ff913=_0x2aed7b[_0x99f4de[_0xb859('0x10')][_0xb859('0x11')]()];if(_0x1ff913){var _0x5e4b3c=_0x1ff913[_0x99f4de['data2']];if(_0x5e4b3c){var _0x5d382f=_[_0xb859('0x12')](_0x5e4b3c[_0xb859('0x13')],{'id':parseInt(_0x99f4de['data3'],0xa)});if(_0x5d382f){if(_0x33f474){if(_0x1f364b&&_0x54a7f0[_0xb859('0x14')]){_0x29bcf1=_0xb859('0x14');}else if(_0x54a7f0[_0xb859('0x15')]){_0x29bcf1=_0xb859('0x16');}else{console[_0xb859('0x17')](_0xb859('0x18'),_0x54a7f0);}}else{_0x29bcf1=_0xb859('0x19');}switch(_0x99f4de[_0xb859('0x10')][_0xb859('0x11')]()){case _0xb859('0x6'):zendesk[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0x7'):salesforce[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0x8'):sugarcrm[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case'freshdesk':freshdesk[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case'zoho':zoho[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0xb'):desk[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case _0xb859('0xc'):vtiger[_0x29bcf1](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff);break;case'freshsales':freshsales['cs'](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff,_0x29bcf1);break;case'servicenow':servicenow['cs'](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff,_0x29bcf1);break;case _0xb859('0x1a'):dynamics365['cs'](_0x99f4de,_0x54a7f0,_0x5d382f,_0x33f474,_0x1f364b,_0x5e4b3c,_0x26e7ff,_0x29bcf1);break;default:console[_0xb859('0x17')]('unknown\x20integration');}}else{_0x550bc4=require(_0xb859('0x1b'))(_0x99f4de['data1'][_0xb859('0x11')]());_0x550bc4[_0xb859('0x1c')](_0xb859('0x1d'),util[_0xb859('0x1e')](_0xb859('0x1f'),_0x99f4de[_0xb859('0x10')][_0xb859('0x11')](),_0x99f4de[_0xb859('0x20')]));}}else{_0x550bc4=require(_0xb859('0x1b'))(_0x99f4de[_0xb859('0x10')]['toLowerCase']());_0x550bc4[_0xb859('0x1c')]('[EXEC]',util['format']('%s\x20account\x20#%s\x20not\x20found',_0x99f4de[_0xb859('0x10')][_0xb859('0x11')](),_0x99f4de['data2']));}}else{}}catch(_0x71a938){console['error'](_0x71a938);}}}};
\ No newline at end of file
index 1acef36..72a07af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0828=['Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','account_contact_lead','additionalSearchAccount','Account','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','idField','content','toString','variableName','customVariable','name','Variable','concat','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','outbound','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','catch','unmanaged','lastevent','toUpperCase','calleridname','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','identity','display_name'];(function(_0xb927e4,_0x1ced6a){var _0x3b333c=function(_0x12e8eb){while(--_0x12e8eb){_0xb927e4['push'](_0xb927e4['shift']());}};_0x3b333c(++_0x1ced6a);}(_0x0828,0x14e));var _0x8082=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x0828[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x8082('0x0'));var BPromise=require(_0x8082('0x1'));var md5=require(_0x8082('0x2'));var jsforce=require(_0x8082('0x3'));var util=require('util');var Redis=require(_0x8082('0x4'));var intUtil=require(_0x8082('0x5'));var config=require(_0x8082('0x6'));var logger=require(_0x8082('0x7'))('salesforce');config['redis']=_['defaults'](config[_0x8082('0x8')],{'host':_0x8082('0x9'),'port':0x18eb});var io=require(_0x8082('0xa'))(new Redis(config['redis']));function emit(_0xef4bfe,_0x3e0092,_0x8f699d){io['to'](_0xef4bfe)[_0x8082('0xb')](_0x3e0092,_0x8f699d);}function getTicket(_0xd28fbd,_0x2013fa,_0x4f7b8a,_0x22bc2f,_0x21400f,_0x2385be,_0x1edb40,_0x31c3b0){var _0x300b8d=Object['assign']({},{'OwnerId':_0x2013fa['id'],'Subject':intUtil[_0x8082('0xc')](_0x22bc2f[_0x8082('0xd')],_0x21400f,'\x20'),'Description':intUtil[_0x8082('0xc')](_0x22bc2f[_0x8082('0xe')],_0x21400f,'\x0a')},getCustomFields(_0x2385be,_0x21400f));if(_0x4f7b8a){if(_0x22bc2f[_0x8082('0xf')]===_0x8082('0x10')){_0x300b8d[_0x8082('0x11')]=moment['utc']();_0x300b8d['IsReminderSet']=![];_0x300b8d['IsRecurrence']=![];if(_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x13')||_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x14')){_0x300b8d[_0x8082('0x15')]=_0x4f7b8a['id'];}else if(_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x16')){_0x300b8d[_0x8082('0x17')]=_0x4f7b8a['id'];}}else if(_0x22bc2f['ticketType']===_0x8082('0x18')){if(_0x4f7b8a[_0x8082('0x12')]==='contact'){_0x300b8d[_0x8082('0x19')]=_0x4f7b8a['id'];}else if(_0x4f7b8a[_0x8082('0x12')]===_0x8082('0x16')){_0x300b8d[_0x8082('0x1a')]=_0x4f7b8a['id'];}else if(_0x4f7b8a[_0x8082('0x12')]==='lead'&&_0x22bc2f['leadId']){_0x300b8d[_0x22bc2f[_0x8082('0x1b')]]=_0x4f7b8a['id'];}else{logger[_0x8082('0x1c')](_0x8082('0x1d'));}}}return _0x1edb40[_0x8082('0x1e')](_0x22bc2f[_0x8082('0xf')])[_0x8082('0x1f')](_0x300b8d);}function getUser(_0x326cf3,_0x4f623d,_0x4e7a99){if(!_[_0x8082('0x20')](_0x4f623d)&&intUtil['validateEmail'](_0x4f623d)){var _0x4686ed={'Email':_0x4f623d};var _0x4fa941={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4e7a99[_0x8082('0x1e')](_0x8082('0x21'))[_0x8082('0x22')](_0x4686ed,_0x4fa941)[_0x8082('0x23')]()[_0x8082('0x24')](function(_0x5a26e4){if(_0x5a26e4[_0x8082('0x25')]){var _0x3a4f8d=_[_0x8082('0x22')](_0x5a26e4,function(_0x34e8ec){return _0x34e8ec[_0x8082('0x26')]===_0x4f623d;});if(_0x3a4f8d){logger[_0x8082('0x1c')](_0x8082('0x27'),_0x4f623d);return BPromise[_0x8082('0x28')]({'id':_0x3a4f8d['Id'],'name':_0x3a4f8d[_0x8082('0x29')]});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4f623d);return _0x4e7a99[_0x8082('0x2a')]()[_0x8082('0x24')](function(_0x4d2483){return BPromise[_0x8082('0x28')]({'id':_0x4d2483['user_id'],'name':_0x4d2483[_0x8082('0x2b')]});});}});}else{logger[_0x8082('0x1c')](_0x8082('0x2c'),_0x4f623d);return _0x4e7a99[_0x8082('0x2a')]()[_0x8082('0x24')](function(_0x396d14){return BPromise[_0x8082('0x28')]({'id':_0x396d14[_0x8082('0x2d')],'name':_0x396d14[_0x8082('0x2b')]});});}}function getEndUser(_0x4a61e5,_0x45ff84,_0x422dc1,_0x26c646,_0x4878eb){var _0x7a6abc={'$or':{'Phone':_0x26c646}};var _0x3bb366={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x8082('0x28')]()[_0x8082('0x24')](function(){logger[_0x8082('0x1c')](_0x8082('0x2e'),_0x26c646,_0x45ff84[_0x8082('0x2f')]);switch(_0x45ff84[_0x8082('0x2f')]){case _0x8082('0x30'):var _0x5e2d65=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x32')]){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x32')]]=_0x26c646;_['merge'](_0x5e2d65[_0x8082('0x33')],_0x789523);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x34'))['find'](_0x5e2d65,_0x3bb366)['execute']()[_0x8082('0x24')](function(_0x17d3d1){if(_0x17d3d1&&_0x17d3d1[_0x8082('0x25')]){return _0x17d3d1;}else{var _0x2f2e5d=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x35')]){var _0x152e8b={};_0x152e8b[_0x45ff84[_0x8082('0x35')]]=_0x26c646;_[_0x8082('0x36')](_0x2f2e5d[_0x8082('0x33')],_0x152e8b);}return _0x4878eb['sobject'](_0x8082('0x37'))[_0x8082('0x22')](_0x2f2e5d,_0x3bb366);}});case _0x8082('0x38'):var _0x20dc21=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84['additionalSearchAccount']){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x39')]]=_0x26c646;_[_0x8082('0x36')](_0x20dc21[_0x8082('0x33')],_0x789523);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x3a'))['find'](_0x20dc21,_0x3bb366)[_0x8082('0x23')]()[_0x8082('0x24')](function(_0x127264){if(_0x127264&&_0x127264['length']){return _0x127264;}else{var _0x100b68=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x32')]){var _0x12e10f={};_0x12e10f[_0x45ff84[_0x8082('0x32')]]=_0x26c646;_['merge'](_0x100b68[_0x8082('0x33')],_0x12e10f);}return _0x4878eb['sobject'](_0x8082('0x34'))[_0x8082('0x22')](_0x100b68,_0x3bb366)['then'](function(_0x292f34){if(_0x292f34&&_0x292f34[_0x8082('0x25')]){return _0x292f34;}else{var _0x3c36cf=_['cloneDeep'](_0x7a6abc);if(_0x45ff84[_0x8082('0x35')]){var _0x4831a9={};_0x4831a9[_0x45ff84[_0x8082('0x35')]]=_0x26c646;_[_0x8082('0x36')](_0x3c36cf[_0x8082('0x33')],_0x4831a9);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x37'))['find'](_0x3c36cf,_0x3bb366);}});}});case _0x8082('0x13'):var _0x5e2d65=_['cloneDeep'](_0x7a6abc);if(_0x45ff84[_0x8082('0x32')]){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x32')]]=_0x26c646;_[_0x8082('0x36')](_0x5e2d65['$or'],_0x789523);}return _0x4878eb[_0x8082('0x1e')]('Contact')[_0x8082('0x22')](_0x5e2d65,_0x3bb366)['execute']();case _0x8082('0x14'):var _0xfe9bbe=_[_0x8082('0x31')](_0x7a6abc);if(_0x45ff84[_0x8082('0x35')]){var _0x789523={};_0x789523[_0x45ff84['additionalSearchLead']]=_0x26c646;_[_0x8082('0x36')](_0xfe9bbe['$or'],_0x789523);}return _0x4878eb['sobject'](_0x8082('0x37'))[_0x8082('0x22')](_0xfe9bbe,_0x3bb366);case _0x8082('0x16'):var _0x20dc21=_['cloneDeep'](_0x7a6abc);if(_0x45ff84[_0x8082('0x39')]){var _0x789523={};_0x789523[_0x45ff84[_0x8082('0x39')]]=_0x26c646;_['merge'](_0x20dc21[_0x8082('0x33')],_0x789523);}return _0x4878eb[_0x8082('0x1e')](_0x8082('0x3a'))[_0x8082('0x22')](_0x20dc21,_0x3bb366);default:return null;}})[_0x8082('0x24')](function(_0x4e1ea9){if(_0x4e1ea9&&_0x4e1ea9['length']){var _0x239d01=_['first'](_0x4e1ea9);if(_0x239d01){return BPromise['resolve']({'id':_0x239d01['Id'],'name':_0x239d01[_0x8082('0x29')],'phone':_0x239d01[_0x8082('0x3b')],'endUserType':_0x239d01[_0x8082('0x3c')][_0x8082('0x3d')][_0x8082('0x3e')]()});}}})[_0x8082('0x24')](function(_0x3ad309){if(_0x3ad309){logger[_0x8082('0x1c')](_0x8082('0x3f'),_0x3ad309[_0x8082('0x12')],_0x26c646);return BPromise['resolve'](_0x3ad309);}else{logger['info'](_0x8082('0x40'),_0x26c646);var _0x44aa39={'Phone':_0x26c646};if(_0x45ff84[_0x8082('0x41')]){if(_0x45ff84[_0x8082('0x41')]==='contact'){logger[_0x8082('0x1c')](_0x8082('0x42'),_0x26c646,_0x45ff84[_0x8082('0x41')]);_0x44aa39[_0x8082('0x43')]=_0x422dc1!==_0x8082('0x44')?_0x422dc1:util[_0x8082('0x45')](_0x8082('0x46'),_0x26c646);}else if(_0x45ff84[_0x8082('0x41')]===_0x8082('0x14')){logger[_0x8082('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x26c646,_0x45ff84[_0x8082('0x41')]);_0x44aa39[_0x8082('0x43')]=_0x422dc1!==_0x8082('0x44')?_0x422dc1:util[_0x8082('0x45')]('Caller\x20-\x20%s',_0x26c646);_0x44aa39[_0x8082('0x47')]=_0x8082('0x48');}else if(_0x45ff84[_0x8082('0x41')]===_0x8082('0x16')){logger[_0x8082('0x1c')](_0x8082('0x42'),_0x26c646,_0x45ff84['moduleCreate']);_0x44aa39['Name']=_0x422dc1!==_0x8082('0x44')?_0x422dc1:util[_0x8082('0x45')](_0x8082('0x46'),_0x26c646);}else{return null;}}return _0x4878eb[_0x8082('0x1e')](_[_0x8082('0x49')](_0x45ff84[_0x8082('0x41')]))[_0x8082('0x1f')](_0x44aa39)[_0x8082('0x24')](function(_0x5c8888){return BPromise[_0x8082('0x28')]({'id':_0x5c8888['id'],'endUserType':_0x45ff84[_0x8082('0x41')]});});}});}function getCustomFields(_0xcf8ea8,_0x46843c){var _0x1eac58={};if(_0xcf8ea8[_0x8082('0x25')]>0x0){_[_0x8082('0x4a')](_0xcf8ea8,function(_0x140009){if(_[_0x8082('0x4b')]([_0x8082('0x4c'),_0x8082('0x4d')],_0x140009['type'])&&_0x140009[_0x8082('0x4e')]){_0x1eac58[_0x140009['idField']]=_0x140009[_0x8082('0x4f')][_0x8082('0x50')]();}else if(_0x140009[_0x8082('0x3d')]==='variable'&&_0x140009[_0x8082('0x51')]&&_0x140009[_0x8082('0x4e')]){_0x46843c[_0x140009[_0x8082('0x51')]]&&(_0x1eac58[_0x140009['idField']]=_0x46843c[_0x140009['variableName']][_0x8082('0x50')]());}else if(_0x140009[_0x8082('0x3d')]===_0x8082('0x52')&&_0x140009['Variable']&&_0x140009['Variable']['name']&&_0x140009['idField']){_0x46843c[_0x140009['Variable'][_0x8082('0x53')]['toLowerCase']()]&&(_0x1eac58[_0x140009['idField']]=_0x46843c[_0x140009[_0x8082('0x54')][_0x8082('0x53')][_0x8082('0x3e')]()][_0x8082('0x50')]());}});}return _0x1eac58;}function getConnection(_0x62d804){var _0x171c37=_0x62d804['password'][_0x8082('0x55')](_0x62d804['securityToken']);var _0x536c53=new jsforce['Connection']({'oauth2':{'loginUrl':_0x62d804[_0x8082('0x56')]||_0x8082('0x57'),'clientId':_0x62d804[_0x8082('0x58')],'clientSecret':_0x62d804[_0x8082('0x59')]}});return _0x536c53[_0x8082('0x5a')](_0x62d804[_0x8082('0x5b')],_0x171c37)[_0x8082('0x24')](function(){logger['info'](_0x8082('0x5c'));return _0x536c53;});}exports[_0x8082('0x5d')]=function(_0x5a1202,_0x5a02ac,_0x3a4011,_0x498af0,_0x40c864,_0x4a0b09){var _0x44fadf,_0x38093c,_0x3f218e,_0x4265af;_0x4a0b09[_0x8082('0x5e')]=intUtil[_0x8082('0x5f')](_0x4a0b09[_0x8082('0x5e')]);_0x4a0b09[_0x8082('0x56')]=intUtil['stripTrailingSlash'](_0x4a0b09[_0x8082('0x56')]);if(_0x40c864&&_0x40c864[_0x8082('0x60')]){logger['info'](_0x8082('0x61'),_0x8082('0x62'));_0x5a02ac['recordingURL']=util['format'](_0x8082('0x63'),_0x4a0b09[_0x8082('0x5e')],_0x5a02ac[_0x8082('0x64')],md5(_0x5a02ac[_0x8082('0x64')]));}else{_0x5a02ac['recordingURL']='';}return getConnection(_0x4a0b09)[_0x8082('0x24')](function(_0xd5a50c){_0x4265af=_0xd5a50c;return getUser(_0x4a0b09,_0x498af0[_0x8082('0x65')],_0x4265af);})[_0x8082('0x24')](function(_0x5ace68){_0x44fadf=_0x5ace68;return getEndUser(_0x4a0b09,_0x3a4011,_0x5a02ac['calleridname'],_0x5a02ac[_0x8082('0x66')],_0x4265af);})[_0x8082('0x24')](function(_0xc5370e){_0x38093c=_0xc5370e;return getTicket(_0x4a0b09,_0x44fadf,_0x38093c,_0x3a4011,_0x5a02ac,_0x3a4011[_0x8082('0x67')],_0x4265af,_0x8082('0x5d'));})[_0x8082('0x24')](function(_0x1b2210){_0x3f218e=_0x1b2210;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x3f218e['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3f218e['id'],_0x498af0[_0x8082('0x53')],_0x4a0b09[_0x8082('0x3d')]);switch(_0x4a0b09[_0x8082('0x3d')]){case _0x8082('0x68'):emit(util[_0x8082('0x45')](_0x8082('0x69'),_0x498af0[_0x8082('0x53')]),_0x8082('0x6a'),{'recordId':_0x3f218e['id']});break;case _0x8082('0x6b'):emit(util[_0x8082('0x45')]('user:%s',_0x498af0[_0x8082('0x53')]),_0x8082('0x6c'),{'uri':util[_0x8082('0x45')](_0x8082('0x6d'),_0x4265af[_0x8082('0x6e')],_0x3f218e['id'])});break;default:logger[_0x8082('0x6f')](_0x8082('0x70'));}})['catch'](function(_0x2d5e2b){logger['error']('[QUEUE]',_0x2d5e2b);});};exports[_0x8082('0x71')]=function(_0x3b929e,_0x4a6e7f,_0x239be2,_0x7eb418,_0x45be70,_0x40bbfe,_0x3fadd0){var _0x140093,_0x5e7e59,_0x54b217,_0x5b5c8f;_0x40bbfe['serverUrl']=intUtil[_0x8082('0x5f')](_0x40bbfe[_0x8082('0x5e')]);_0x40bbfe['remoteUri']=intUtil[_0x8082('0x5f')](_0x40bbfe[_0x8082('0x56')]);if(_0x3fadd0&&_0x3fadd0[_0x8082('0x72')]&&_0x3fadd0[_0x8082('0x72')]!==_0x8082('0x73')){logger[_0x8082('0x1c')](_0x8082('0x74'),'Recording\x20is\x20enabled!');_0x4a6e7f[_0x8082('0x75')]=util[_0x8082('0x45')](_0x8082('0x63'),_0x40bbfe['serverUrl'],_0x4a6e7f[_0x8082('0x64')],md5(_0x4a6e7f[_0x8082('0x64')]));}return getConnection(_0x40bbfe)[_0x8082('0x24')](function(_0x98d644){_0x5b5c8f=_0x98d644;return getUser(_0x40bbfe,_0x7eb418['email'],_0x5b5c8f);})['then'](function(_0x557817){_0x140093=_0x557817;return getEndUser(_0x40bbfe,_0x239be2,_0x4a6e7f[_0x8082('0x76')],_0x4a6e7f['destcalleridnum'],_0x5b5c8f);})[_0x8082('0x24')](function(_0x4626bf){_0x5e7e59=_0x4626bf;return getTicket(_0x40bbfe,_0x140093,_0x5e7e59,_0x239be2,_0x4a6e7f,_0x239be2[_0x8082('0x67')],_0x5b5c8f,_0x8082('0x71'));})[_0x8082('0x24')](function(_0x532f43){_0x54b217=_0x532f43;logger[_0x8082('0x1c')](_0x8082('0x77'),_0x54b217['id']);logger[_0x8082('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x54b217['id'],_0x7eb418['name'],_0x40bbfe['type']);switch(_0x40bbfe[_0x8082('0x3d')]){case _0x8082('0x68'):emit(util['format'](_0x8082('0x69'),_0x7eb418[_0x8082('0x53')]),_0x8082('0x6a'),{'recordId':_0x54b217['id']});break;case _0x8082('0x6b'):emit(util[_0x8082('0x45')](_0x8082('0x69'),_0x7eb418[_0x8082('0x53')]),'trigger:browser:url',{'uri':util[_0x8082('0x45')](_0x8082('0x6d'),_0x5b5c8f[_0x8082('0x6e')],_0x54b217['id'])});break;default:logger['error'](_0x8082('0x74'),_0x8082('0x78'));}})[_0x8082('0x79')](function(_0x20a9a2){logger['error'](_0x8082('0x74'),_0x20a9a2);});};exports[_0x8082('0x7a')]=function(_0x520cd7,_0x39bf44,_0x1d32ff,_0x4b59ea,_0x2e0599,_0x509cfa){var _0x287d32,_0x598a06,_0x3fbb8e,_0x3af86c;_0x509cfa[_0x8082('0x5e')]=intUtil['stripTrailingSlash'](_0x509cfa[_0x8082('0x5e')]);_0x509cfa[_0x8082('0x56')]=intUtil[_0x8082('0x5f')](_0x509cfa['remoteUri']);if(_0x2e0599&&_0x2e0599[_0x8082('0x60')]){logger[_0x8082('0x1c')]('['+_0x39bf44[_0x8082('0x7b')][_0x8082('0x7c')]()+']',_0x8082('0x62'));_0x39bf44[_0x8082('0x75')]=util[_0x8082('0x45')](_0x8082('0x63'),_0x509cfa[_0x8082('0x5e')],_0x39bf44[_0x8082('0x64')],md5(_0x39bf44['uniqueid']));}else{_0x39bf44[_0x8082('0x75')]='';}return getConnection(_0x509cfa)[_0x8082('0x24')](function(_0x19184c){_0x3af86c=_0x19184c;if(!_[_0x8082('0x20')](_0x4b59ea)){return getUser(_0x509cfa,_0x4b59ea['name'],_0x3af86c);}else{return getUser(_0x509cfa,null,_0x3af86c);}})[_0x8082('0x24')](function(_0x51c6f4){_0x287d32=_0x51c6f4;return getEndUser(_0x509cfa,_0x1d32ff,_0x39bf44[_0x8082('0x7d')],_0x39bf44[_0x8082('0x66')],_0x3af86c);})['then'](function(_0x1f32be){_0x598a06=_0x1f32be;return getTicket(_0x509cfa,_0x287d32,_0x598a06,_0x1d32ff,_0x39bf44,_0x1d32ff[_0x8082('0x67')],_0x3af86c);})['then'](function(_0x124965){_0x3fbb8e=_0x124965;logger[_0x8082('0x1c')]('['+_0x39bf44[_0x8082('0x7b')][_0x8082('0x7c')]()+']\x20Ticket\x20%s\x20created.',_0x3fbb8e['id']);logger[_0x8082('0x1c')]('['+_0x39bf44[_0x8082('0x7b')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x509cfa['type']);})[_0x8082('0x79')](function(_0x5b3ceb){logger['error']('['+_0x39bf44[_0x8082('0x7b')]['toUpperCase']()+']',_0x5b3ceb);});};
\ No newline at end of file
+var _0x0986=['md5','jsforce','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','endUserType','contact','lead','WhoId','WhatId','Case','ContactId','AccountId','leadId','info','sobject','isNil','validateEmail','User','execute','then','find','Email','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','cloneDeep','additionalSearchAccount','length','Lead','account','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','Caller\x20-\x20%s','format','No\x20Company','upperFirst','create','forEach','includes','string','toString','idField','variableName','customVariable','Variable','name','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','bluebird'];(function(_0x21f8b1,_0x496b9d){var _0x173733=function(_0x420789){while(--_0x420789){_0x21f8b1['push'](_0x21f8b1['shift']());}};_0x173733(++_0x496b9d);}(_0x0986,0x17f));var _0x6098=function(_0x18ab6c,_0x87743b){_0x18ab6c=_0x18ab6c-0x0;var _0x30d073=_0x0986[_0x18ab6c];return _0x30d073;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6098('0x0'));var md5=require(_0x6098('0x1'));var jsforce=require(_0x6098('0x2'));var util=require(_0x6098('0x3'));var Redis=require(_0x6098('0x4'));var intUtil=require(_0x6098('0x5'));var config=require('../../../../config/environment');var logger=require(_0x6098('0x6'))('salesforce');config[_0x6098('0x7')]=_[_0x6098('0x8')](config['redis'],{'host':_0x6098('0x9'),'port':0x18eb});var io=require(_0x6098('0xa'))(new Redis(config[_0x6098('0x7')]));function emit(_0x49eb9e,_0x49450f,_0xe0de29){io['to'](_0x49eb9e)['emit'](_0x49450f,_0xe0de29);}function getTicket(_0x1623db,_0x194bea,_0x4b1b8f,_0x4029cf,_0x3c21ed,_0x1cf191,_0x1915f4,_0x443ba8){var _0x1941b4=Object['assign']({},{'OwnerId':_0x194bea['id'],'Subject':intUtil[_0x6098('0xb')](_0x4029cf[_0x6098('0xc')],_0x3c21ed,'\x20'),'Description':intUtil[_0x6098('0xb')](_0x4029cf[_0x6098('0xd')],_0x3c21ed,'\x0a')},getCustomFields(_0x1cf191,_0x3c21ed));if(_0x4b1b8f){if(_0x4029cf[_0x6098('0xe')]===_0x6098('0xf')){_0x1941b4[_0x6098('0x10')]=moment[_0x6098('0x11')]();_0x1941b4['IsReminderSet']=![];_0x1941b4['IsRecurrence']=![];if(_0x4b1b8f[_0x6098('0x12')]===_0x6098('0x13')||_0x4b1b8f[_0x6098('0x12')]===_0x6098('0x14')){_0x1941b4[_0x6098('0x15')]=_0x4b1b8f['id'];}else if(_0x4b1b8f[_0x6098('0x12')]==='account'){_0x1941b4[_0x6098('0x16')]=_0x4b1b8f['id'];}}else if(_0x4029cf['ticketType']===_0x6098('0x17')){if(_0x4b1b8f[_0x6098('0x12')]==='contact'){_0x1941b4[_0x6098('0x18')]=_0x4b1b8f['id'];}else if(_0x4b1b8f['endUserType']==='account'){_0x1941b4[_0x6098('0x19')]=_0x4b1b8f['id'];}else if(_0x4b1b8f['endUserType']===_0x6098('0x14')&&_0x4029cf[_0x6098('0x1a')]){_0x1941b4[_0x4029cf[_0x6098('0x1a')]]=_0x4b1b8f['id'];}else{logger[_0x6098('0x1b')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1915f4[_0x6098('0x1c')](_0x4029cf[_0x6098('0xe')])['create'](_0x1941b4);}function getUser(_0x245900,_0x4623c5,_0x375783){if(!_[_0x6098('0x1d')](_0x4623c5)&&intUtil[_0x6098('0x1e')](_0x4623c5)){var _0x356592={'Email':_0x4623c5};var _0x1d379e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x375783[_0x6098('0x1c')](_0x6098('0x1f'))['find'](_0x356592,_0x1d379e)[_0x6098('0x20')]()[_0x6098('0x21')](function(_0xe25b30){if(_0xe25b30['length']){var _0xd75960=_[_0x6098('0x22')](_0xe25b30,function(_0x81704f){return _0x81704f[_0x6098('0x23')]===_0x4623c5;});if(_0xd75960){logger[_0x6098('0x1b')](_0x6098('0x24'),_0x4623c5);return BPromise['resolve']({'id':_0xd75960['Id'],'name':_0xd75960['Name']});}}else{logger[_0x6098('0x1b')](_0x6098('0x25'),_0x4623c5);return _0x375783[_0x6098('0x26')]()[_0x6098('0x21')](function(_0x32f614){return BPromise[_0x6098('0x27')]({'id':_0x32f614[_0x6098('0x28')],'name':_0x32f614[_0x6098('0x29')]});});}});}else{logger[_0x6098('0x1b')](_0x6098('0x25'),_0x4623c5);return _0x375783[_0x6098('0x26')]()[_0x6098('0x21')](function(_0x757d4e){return BPromise['resolve']({'id':_0x757d4e[_0x6098('0x28')],'name':_0x757d4e['display_name']});});}}function getEndUser(_0x3a38bb,_0x198400,_0x332ca0,_0x298b6b,_0x401639){var _0x55171f={'$or':{'Phone':_0x298b6b}};var _0x2dfd9a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6098('0x27')]()['then'](function(){logger[_0x6098('0x1b')](_0x6098('0x2a'),_0x298b6b,_0x198400[_0x6098('0x2b')]);switch(_0x198400['moduleSearch']){case'contact_lead':var _0x141a3e=_['cloneDeep'](_0x55171f);if(_0x198400[_0x6098('0x2c')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x2c')]]=_0x298b6b;_[_0x6098('0x2d')](_0x141a3e[_0x6098('0x2e')],_0x2636fa);}return _0x401639[_0x6098('0x1c')](_0x6098('0x2f'))[_0x6098('0x22')](_0x141a3e,_0x2dfd9a)[_0x6098('0x20')]()[_0x6098('0x21')](function(_0x592011){if(_0x592011&&_0x592011['length']){return _0x592011;}else{var _0x1cf3f9=_['cloneDeep'](_0x55171f);if(_0x198400[_0x6098('0x30')]){var _0x2cb089={};_0x2cb089[_0x198400['additionalSearchLead']]=_0x298b6b;_[_0x6098('0x2d')](_0x1cf3f9[_0x6098('0x2e')],_0x2cb089);}return _0x401639[_0x6098('0x1c')]('Lead')[_0x6098('0x22')](_0x1cf3f9,_0x2dfd9a);}});case _0x6098('0x31'):var _0x1addad=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x33')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x33')]]=_0x298b6b;_[_0x6098('0x2d')](_0x1addad[_0x6098('0x2e')],_0x2636fa);}return _0x401639[_0x6098('0x1c')]('Account')[_0x6098('0x22')](_0x1addad,_0x2dfd9a)[_0x6098('0x20')]()[_0x6098('0x21')](function(_0x1869f1){if(_0x1869f1&&_0x1869f1['length']){return _0x1869f1;}else{var _0x551283=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x2c')]){var _0x23e138={};_0x23e138[_0x198400[_0x6098('0x2c')]]=_0x298b6b;_['merge'](_0x551283[_0x6098('0x2e')],_0x23e138);}return _0x401639[_0x6098('0x1c')]('Contact')[_0x6098('0x22')](_0x551283,_0x2dfd9a)[_0x6098('0x21')](function(_0x1216b2){if(_0x1216b2&&_0x1216b2[_0x6098('0x34')]){return _0x1216b2;}else{var _0xdb4105=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x30')]){var _0x445269={};_0x445269[_0x198400[_0x6098('0x30')]]=_0x298b6b;_[_0x6098('0x2d')](_0xdb4105[_0x6098('0x2e')],_0x445269);}return _0x401639['sobject'](_0x6098('0x35'))[_0x6098('0x22')](_0xdb4105,_0x2dfd9a);}});}});case'contact':var _0x141a3e=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x2c')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x2c')]]=_0x298b6b;_[_0x6098('0x2d')](_0x141a3e['$or'],_0x2636fa);}return _0x401639[_0x6098('0x1c')](_0x6098('0x2f'))['find'](_0x141a3e,_0x2dfd9a)[_0x6098('0x20')]();case _0x6098('0x14'):var _0x1fef0d=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x30')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x30')]]=_0x298b6b;_[_0x6098('0x2d')](_0x1fef0d[_0x6098('0x2e')],_0x2636fa);}return _0x401639['sobject'](_0x6098('0x35'))[_0x6098('0x22')](_0x1fef0d,_0x2dfd9a);case _0x6098('0x36'):var _0x1addad=_[_0x6098('0x32')](_0x55171f);if(_0x198400[_0x6098('0x33')]){var _0x2636fa={};_0x2636fa[_0x198400[_0x6098('0x33')]]=_0x298b6b;_[_0x6098('0x2d')](_0x1addad[_0x6098('0x2e')],_0x2636fa);}return _0x401639[_0x6098('0x1c')]('Account')[_0x6098('0x22')](_0x1addad,_0x2dfd9a);default:return null;}})[_0x6098('0x21')](function(_0x139639){if(_0x139639&&_0x139639[_0x6098('0x34')]){var _0x5d364d=_[_0x6098('0x37')](_0x139639);if(_0x5d364d){return BPromise[_0x6098('0x27')]({'id':_0x5d364d['Id'],'name':_0x5d364d[_0x6098('0x38')],'phone':_0x5d364d[_0x6098('0x39')],'endUserType':_0x5d364d[_0x6098('0x3a')][_0x6098('0x3b')][_0x6098('0x3c')]()});}}})['then'](function(_0x494f39){if(_0x494f39){logger['info'](_0x6098('0x3d'),_0x494f39[_0x6098('0x12')],_0x298b6b);return BPromise[_0x6098('0x27')](_0x494f39);}else{logger[_0x6098('0x1b')](_0x6098('0x3e'),_0x298b6b);var _0x53c397={'Phone':_0x298b6b};if(_0x198400['moduleCreate']){if(_0x198400[_0x6098('0x3f')]===_0x6098('0x13')){logger['info'](_0x6098('0x40'),_0x298b6b,_0x198400[_0x6098('0x3f')]);_0x53c397[_0x6098('0x41')]=_0x332ca0!==_0x6098('0x42')?_0x332ca0:util['format'](_0x6098('0x43'),_0x298b6b);}else if(_0x198400[_0x6098('0x3f')]===_0x6098('0x14')){logger[_0x6098('0x1b')](_0x6098('0x40'),_0x298b6b,_0x198400[_0x6098('0x3f')]);_0x53c397['LastName']=_0x332ca0!==_0x6098('0x42')?_0x332ca0:util[_0x6098('0x44')](_0x6098('0x43'),_0x298b6b);_0x53c397['Company']=_0x6098('0x45');}else if(_0x198400[_0x6098('0x3f')]===_0x6098('0x36')){logger[_0x6098('0x1b')](_0x6098('0x40'),_0x298b6b,_0x198400[_0x6098('0x3f')]);_0x53c397[_0x6098('0x38')]=_0x332ca0!==_0x6098('0x42')?_0x332ca0:util[_0x6098('0x44')](_0x6098('0x43'),_0x298b6b);}else{return null;}}return _0x401639[_0x6098('0x1c')](_[_0x6098('0x46')](_0x198400[_0x6098('0x3f')]))[_0x6098('0x47')](_0x53c397)[_0x6098('0x21')](function(_0x2303e2){return BPromise[_0x6098('0x27')]({'id':_0x2303e2['id'],'endUserType':_0x198400['moduleCreate']});});}});}function getCustomFields(_0x5532d1,_0x5397bb){var _0x239794={};if(_0x5532d1[_0x6098('0x34')]>0x0){_[_0x6098('0x48')](_0x5532d1,function(_0x246cfc){if(_[_0x6098('0x49')]([_0x6098('0x4a'),'picklist'],_0x246cfc[_0x6098('0x3b')])&&_0x246cfc['idField']){_0x239794[_0x246cfc['idField']]=_0x246cfc['content'][_0x6098('0x4b')]();}else if(_0x246cfc[_0x6098('0x3b')]==='variable'&&_0x246cfc['variableName']&&_0x246cfc[_0x6098('0x4c')]){_0x5397bb[_0x246cfc[_0x6098('0x4d')]]&&(_0x239794[_0x246cfc['idField']]=_0x5397bb[_0x246cfc[_0x6098('0x4d')]]['toString']());}else if(_0x246cfc['type']===_0x6098('0x4e')&&_0x246cfc[_0x6098('0x4f')]&&_0x246cfc[_0x6098('0x4f')][_0x6098('0x50')]&&_0x246cfc[_0x6098('0x4c')]){_0x5397bb[_0x246cfc['Variable'][_0x6098('0x50')][_0x6098('0x3c')]()]&&(_0x239794[_0x246cfc[_0x6098('0x4c')]]=_0x5397bb[_0x246cfc['Variable'][_0x6098('0x50')][_0x6098('0x3c')]()][_0x6098('0x4b')]());}});}return _0x239794;}function getConnection(_0x537789){var _0x38db20=_0x537789[_0x6098('0x51')][_0x6098('0x52')](_0x537789[_0x6098('0x53')]);var _0x3ad54b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x537789[_0x6098('0x54')]||_0x6098('0x55'),'clientId':_0x537789[_0x6098('0x56')],'clientSecret':_0x537789[_0x6098('0x57')]}});return _0x3ad54b[_0x6098('0x58')](_0x537789[_0x6098('0x59')],_0x38db20)[_0x6098('0x21')](function(){logger[_0x6098('0x1b')]('Connection\x20established.');return _0x3ad54b;});}exports[_0x6098('0x5a')]=function(_0x575440,_0x375aa4,_0x53f672,_0x14e3c7,_0x183e81,_0x1b42aa){var _0xf47ec1,_0x318301,_0x512e4d,_0x3dc229;_0x1b42aa['serverUrl']=intUtil[_0x6098('0x5b')](_0x1b42aa['serverUrl']);_0x1b42aa[_0x6098('0x54')]=intUtil[_0x6098('0x5b')](_0x1b42aa[_0x6098('0x54')]);if(_0x183e81&&_0x183e81[_0x6098('0x5c')]){logger[_0x6098('0x1b')](_0x6098('0x5d'),'Recording\x20is\x20enabled!');_0x375aa4[_0x6098('0x5e')]=util[_0x6098('0x44')](_0x6098('0x5f'),_0x1b42aa['serverUrl'],_0x375aa4[_0x6098('0x60')],md5(_0x375aa4[_0x6098('0x60')]));}else{_0x375aa4[_0x6098('0x5e')]='';}return getConnection(_0x1b42aa)[_0x6098('0x21')](function(_0x51df61){_0x3dc229=_0x51df61;return getUser(_0x1b42aa,_0x14e3c7[_0x6098('0x61')],_0x3dc229);})[_0x6098('0x21')](function(_0x1ee6c8){_0xf47ec1=_0x1ee6c8;return getEndUser(_0x1b42aa,_0x53f672,_0x375aa4[_0x6098('0x62')],_0x375aa4[_0x6098('0x63')],_0x3dc229);})[_0x6098('0x21')](function(_0xc37020){_0x318301=_0xc37020;return getTicket(_0x1b42aa,_0xf47ec1,_0x318301,_0x53f672,_0x375aa4,_0x53f672['Fields'],_0x3dc229,_0x6098('0x5a'));})[_0x6098('0x21')](function(_0x2c28b5){_0x512e4d=_0x2c28b5;logger[_0x6098('0x1b')](_0x6098('0x64'),_0x512e4d['id']);logger[_0x6098('0x1b')](_0x6098('0x65'),_0x512e4d['id'],_0x14e3c7['name'],_0x1b42aa[_0x6098('0x3b')]);switch(_0x1b42aa[_0x6098('0x3b')]){case _0x6098('0x66'):emit(util[_0x6098('0x44')]('user:%s',_0x14e3c7['name']),_0x6098('0x67'),{'recordId':_0x512e4d['id']});break;case _0x6098('0x68'):emit(util[_0x6098('0x44')](_0x6098('0x69'),_0x14e3c7[_0x6098('0x50')]),_0x6098('0x6a'),{'uri':util[_0x6098('0x44')](_0x6098('0x6b'),_0x3dc229[_0x6098('0x6c')],_0x512e4d['id'])});break;default:logger[_0x6098('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x6098('0x6e')](function(_0x181a21){logger['error'](_0x6098('0x5d'),_0x181a21);});};exports[_0x6098('0x6f')]=function(_0x19e15b,_0xbb7285,_0x340622,_0x469a6b,_0x59efd7,_0x5916cd,_0x4f639d){var _0x3b2935,_0x40b838,_0x350190,_0x1a979b;_0x5916cd[_0x6098('0x70')]=intUtil[_0x6098('0x5b')](_0x5916cd[_0x6098('0x70')]);_0x5916cd[_0x6098('0x54')]=intUtil[_0x6098('0x5b')](_0x5916cd['remoteUri']);if(_0x4f639d&&_0x4f639d[_0x6098('0x71')]&&_0x4f639d[_0x6098('0x71')]!==_0x6098('0x72')){logger[_0x6098('0x1b')](_0x6098('0x73'),_0x6098('0x74'));_0xbb7285[_0x6098('0x5e')]=util['format'](_0x6098('0x5f'),_0x5916cd['serverUrl'],_0xbb7285[_0x6098('0x60')],md5(_0xbb7285[_0x6098('0x60')]));}return getConnection(_0x5916cd)[_0x6098('0x21')](function(_0xbac737){_0x1a979b=_0xbac737;return getUser(_0x5916cd,_0x469a6b['email'],_0x1a979b);})['then'](function(_0x3e1e8f){_0x3b2935=_0x3e1e8f;return getEndUser(_0x5916cd,_0x340622,_0xbb7285[_0x6098('0x75')],_0xbb7285[_0x6098('0x76')],_0x1a979b);})[_0x6098('0x21')](function(_0x24fccd){_0x40b838=_0x24fccd;return getTicket(_0x5916cd,_0x3b2935,_0x40b838,_0x340622,_0xbb7285,_0x340622[_0x6098('0x77')],_0x1a979b,_0x6098('0x6f'));})[_0x6098('0x21')](function(_0x539b86){_0x350190=_0x539b86;logger[_0x6098('0x1b')](_0x6098('0x78'),_0x350190['id']);logger[_0x6098('0x1b')](_0x6098('0x79'),_0x350190['id'],_0x469a6b[_0x6098('0x50')],_0x5916cd[_0x6098('0x3b')]);switch(_0x5916cd[_0x6098('0x3b')]){case _0x6098('0x66'):emit(util[_0x6098('0x44')](_0x6098('0x69'),_0x469a6b['name']),'trigger:salesforce:display',{'recordId':_0x350190['id']});break;case _0x6098('0x68'):emit(util[_0x6098('0x44')](_0x6098('0x69'),_0x469a6b['name']),_0x6098('0x6a'),{'uri':util[_0x6098('0x44')](_0x6098('0x6b'),_0x1a979b[_0x6098('0x6c')],_0x350190['id'])});break;default:logger[_0x6098('0x6d')](_0x6098('0x73'),_0x6098('0x7a'));}})['catch'](function(_0x5d46a5){logger[_0x6098('0x6d')](_0x6098('0x73'),_0x5d46a5);});};exports[_0x6098('0x7b')]=function(_0x4cf334,_0x4e11bd,_0x41e9d4,_0x5bbb17,_0x549ab8,_0x3a446b){var _0x33930b,_0x13cfa3,_0x29896a,_0x3120fb;_0x3a446b[_0x6098('0x70')]=intUtil[_0x6098('0x5b')](_0x3a446b[_0x6098('0x70')]);_0x3a446b[_0x6098('0x54')]=intUtil[_0x6098('0x5b')](_0x3a446b[_0x6098('0x54')]);if(_0x549ab8&&_0x549ab8[_0x6098('0x5c')]){logger[_0x6098('0x1b')]('['+_0x4e11bd[_0x6098('0x7c')][_0x6098('0x7d')]()+']',_0x6098('0x74'));_0x4e11bd[_0x6098('0x5e')]=util[_0x6098('0x44')](_0x6098('0x5f'),_0x3a446b[_0x6098('0x70')],_0x4e11bd['uniqueid'],md5(_0x4e11bd[_0x6098('0x60')]));}else{_0x4e11bd[_0x6098('0x5e')]='';}return getConnection(_0x3a446b)[_0x6098('0x21')](function(_0x3989d3){_0x3120fb=_0x3989d3;if(!_[_0x6098('0x1d')](_0x5bbb17)){return getUser(_0x3a446b,_0x5bbb17[_0x6098('0x50')],_0x3120fb);}else{return getUser(_0x3a446b,null,_0x3120fb);}})[_0x6098('0x21')](function(_0x2c5154){_0x33930b=_0x2c5154;return getEndUser(_0x3a446b,_0x41e9d4,_0x4e11bd['calleridname'],_0x4e11bd['calleridnum'],_0x3120fb);})[_0x6098('0x21')](function(_0x20a515){_0x13cfa3=_0x20a515;return getTicket(_0x3a446b,_0x33930b,_0x13cfa3,_0x41e9d4,_0x4e11bd,_0x41e9d4[_0x6098('0x77')],_0x3120fb);})[_0x6098('0x21')](function(_0x4da9d2){_0x29896a=_0x4da9d2;logger[_0x6098('0x1b')]('['+_0x4e11bd['lastevent'][_0x6098('0x7d')]()+_0x6098('0x7e'),_0x29896a['id']);logger[_0x6098('0x1b')]('['+_0x4e11bd['lastevent'][_0x6098('0x7d')]()+_0x6098('0x7f'),_0x3a446b[_0x6098('0x3b')]);})[_0x6098('0x6e')](function(_0x1184f7){logger[_0x6098('0x6d')]('['+_0x4e11bd[_0x6098('0x7c')][_0x6098('0x7d')]()+']',_0x1184f7);});};
\ No newline at end of file
index 2c066a9..f9ca89c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6829=['remoteUri','stripTrailingSlash','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','callDirection','queue','unmanaged','serverUrl','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','customField','toString','idField','variable','variableName','toLowerCase','Variable','name',']\x20getTicket\x20input\x20crm','assign','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','all','push','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password'];(function(_0x2718c7,_0x5a1636){var _0x59d89c=function(_0x4d4f49){while(--_0x4d4f49){_0x2718c7['push'](_0x2718c7['shift']());}};_0x59d89c(++_0x5a1636);}(_0x6829,0x164));var _0x9682=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x6829[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0x9682('0x0'));var Promise=require(_0x9682('0x1'));var rp=require(_0x9682('0x2'));var util=require(_0x9682('0x3'));var md5=require(_0x9682('0x4'));var Redis=require(_0x9682('0x5'));var intUtil=require(_0x9682('0x6'));var config=require(_0x9682('0x7'));var logger=require(_0x9682('0x8'))(_0x9682('0x9'));config['redis']=_[_0x9682('0xa')](config[_0x9682('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9682('0xb')]));function getAdminUser(_0x294c65,_0x12c509,_0x238b68,_0x269a7e,_0x35c928,_0x5630b){return new Promise(function(_0x26a956,_0x407e97){var _0x2e7bf5={'method':'GET','uri':_0x269a7e+_0x9682('0xc')+'&'+_0x35c928+'&'+_0x5630b,'auth':_0x12c509,'json':!![]};return rp(_0x2e7bf5)[_0x9682('0xd')](function(_0x5d82f3){if(_0x5d82f3[_0x9682('0xe')][_0x9682('0xf')]>0x0){_0x238b68[_0x9682('0x10')]=_0x5d82f3['result'][0x0][_0x9682('0x11')];}logger[_0x9682('0x12')]('['+[_0x294c65[_0x9682('0x13')]()]+_0x9682('0x14'),_0x238b68);_0x26a956(_0x238b68);})['catch'](function(_0x2e5173){logger[_0x9682('0x15')]('['+[_0x294c65['toUpperCase']()]+']',_0x2e5173['message']);_0x407e97(_0x2e5173[_0x9682('0x16')]);});});}function getUser(_0x3abb67,_0x1a916b,_0x36f8d9,_0x2cc921,_0x158505){return function(_0x966376){logger['info']('['+[_0x3abb67[_0x9682('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x966376);return new Promise(function(_0x117613,_0x23ef2a){if(intUtil[_0x9682('0x17')](_0x966376[_0x9682('0x18')])){var _0x1061bc={'method':_0x9682('0x19'),'uri':_0x36f8d9+_0x9682('0x1a')+_0x966376['userEmail']+'&'+_0x2cc921+'&'+_0x158505,'auth':_0x1a916b,'json':!![]};logger[_0x9682('0x12')]('['+[_0x3abb67[_0x9682('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x1061bc);return rp(_0x1061bc)['then'](function(_0x5cf413){logger[_0x9682('0x12')]('['+[_0x3abb67[_0x9682('0x13')]()]+_0x9682('0x1b'),_0x5cf413);if(_0x5cf413[_0x9682('0xe')][_0x9682('0xf')]>0x0&&String(_0x5cf413[_0x9682('0xe')][0x0][_0x9682('0x1c')])===_0x9682('0x1d')){_0x966376[_0x9682('0x1e')]=_0x5cf413[_0x9682('0xe')][0x0][_0x9682('0x11')];}else{_0x966376['userId']=_0x966376[_0x9682('0x10')];_0x966376[_0x9682('0x18')]=_0x966376[_0x9682('0x1f')];}logger[_0x9682('0x12')]('['+[_0x3abb67['toUpperCase']()]+_0x9682('0x20'),_0x966376);_0x117613(_0x966376);})[_0x9682('0x21')](function(_0x1a5bf4){logger[_0x9682('0x15')]('['+[_0x3abb67['toUpperCase']()]+']',_0x1a5bf4[_0x9682('0x16')]);_0x23ef2a(_0x1a5bf4[_0x9682('0x16')]);});}else{logger[_0x9682('0x12')]('['+[_0x3abb67[_0x9682('0x13')]()]+_0x9682('0x22'));_0x966376[_0x9682('0x1e')]=_0x966376[_0x9682('0x10')];_0x966376[_0x9682('0x18')]=_0x966376['adminEmail'];_0x117613(_0x966376);}});};}function createEndUser(_0x54a808,_0xa98aab,_0x548197,_0x235b14,_0x226e85){logger[_0x9682('0x12')]('['+[_0x54a808[_0x9682('0x13')]()]+_0x9682('0x23'),_0x548197);return new Promise(function(_0x20daeb,_0x4c46e9){var _0x4c5121={'method':_0x9682('0x24'),'uri':_0x235b14+_0x9682('0x25')+_0x226e85,'body':{'user_name':_0x548197[_0x9682('0x26')],'roles':_0x9682('0x27'),'first_name':_0x548197[_0x9682('0x26')],'active':_0x9682('0x1d'),'date_format':_0x9682('0x28'),'phone':_0x548197[_0x9682('0x26')]},'auth':_0xa98aab,'json':!![]};return rp(_0x4c5121)[_0x9682('0xd')](function(_0x37cfc8){logger[_0x9682('0x12')]('['+[_0x54a808['toUpperCase']()]+_0x9682('0x29'),_0x37cfc8['result']);_0x548197[_0x9682('0x2a')]=_0x37cfc8['result'][_0x9682('0x11')];_0x20daeb(_0x548197);})[_0x9682('0x21')](function(_0x53cab5){logger[_0x9682('0x15')]('['+[_0x54a808['toUpperCase']()]+']',_0x53cab5['message']);_0x4c46e9(_0x53cab5[_0x9682('0x16')]);});});}function getEndUser(_0x17fe89,_0x8ccdcd,_0x11806d,_0x2bf386,_0x1fc7fd){return function(_0x571054){logger[_0x9682('0x12')]('['+[_0x17fe89[_0x9682('0x13')]()]+_0x9682('0x2b'),_0x571054);return new Promise(function(_0x8a64e7,_0x11272d){var _0xa85bc4={'method':'GET','uri':_0x11806d+_0x9682('0x2c')+_0x571054[_0x9682('0x26')]+'&'+_0x2bf386+'&'+_0x1fc7fd,'auth':_0x8ccdcd,'json':!![]};return rp(_0xa85bc4)[_0x9682('0xd')](function(_0x4acbd7){if(_0x4acbd7[_0x9682('0xe')]['length']>0x0){_0x571054[_0x9682('0x2a')]=_0x4acbd7[_0x9682('0xe')][0x0][_0x9682('0x11')];logger[_0x9682('0x12')]('['+[_0x17fe89[_0x9682('0x13')]()]+_0x9682('0x2d'),_0x571054);_0x8a64e7(_0x571054);}else{return createEndUser(_0x17fe89,_0x8ccdcd,_0x571054,_0x11806d,_0x2bf386)[_0x9682('0xd')](function(_0x5899e9){logger['info']('['+[_0x17fe89[_0x9682('0x13')]()]+_0x9682('0x2e'),_0x5899e9);_0x8a64e7(_0x5899e9);});}})['catch'](function(_0x20bf4e){logger[_0x9682('0x15')]('['+[_0x17fe89[_0x9682('0x13')]()]+']',_0x20bf4e[_0x9682('0x16')]);_0x11272d(_0x20bf4e['message']);});});};}function getCustomFields(_0x46d187,_0x16ea9b){var _0x82f20e={};if(_0x46d187[_0x9682('0xf')]>0x0){_[_0x9682('0x2f')](_0x46d187,function(_0x3a55f3){if(_[_0x9682('0x30')]([_0x9682('0x31'),_0x9682('0x32')],_0x3a55f3[_0x9682('0x33')])&&_0x3a55f3[_0x9682('0x34')]&&!_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3[_0x9682('0x34')]['toLowerCase']()]=_0x3a55f3['content'][_0x9682('0x36')]();}else if(_[_0x9682('0x30')](['string',_0x9682('0x32')],_0x3a55f3[_0x9682('0x33')])&&_0x3a55f3[_0x9682('0x37')]&&_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3[_0x9682('0x37')]['toLowerCase']()]=_0x3a55f3['content'][_0x9682('0x36')]();}else if(_0x3a55f3[_0x9682('0x33')]===_0x9682('0x38')&&_0x3a55f3[_0x9682('0x39')]&&_0x3a55f3[_0x9682('0x37')]&&_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3['idField'][_0x9682('0x3a')]()]=_0x16ea9b[_0x3a55f3[_0x9682('0x39')]][_0x9682('0x36')]();}else if(_0x3a55f3[_0x9682('0x33')]==='customVariable'&&_0x3a55f3[_0x9682('0x3b')]&&_0x3a55f3[_0x9682('0x3b')][_0x9682('0x3c')]&&_0x3a55f3[_0x9682('0x37')]&&_0x3a55f3[_0x9682('0x35')]){_0x82f20e[_0x3a55f3[_0x9682('0x37')][_0x9682('0x3a')]()]=_0x16ea9b[_0x3a55f3[_0x9682('0x3b')][_0x9682('0x3c')][_0x9682('0x3a')]()][_0x9682('0x36')]();}});}return _0x82f20e;}function getTicket(_0xcffb8f,_0x1743e3,_0x9ea681,_0x512e51,_0x1dbc75,_0x4991ea){return function(_0x3da836){logger[_0x9682('0x12')]('['+[_0xcffb8f[_0x9682('0x13')]()]+_0x9682('0x3d'),_0x3da836);return new Promise(function(_0x49d2b7,_0xf43402){var _0x1318ec=_0xcffb8f[_0x9682('0x3a')]()==='outbound'?_0x3da836[_0x9682('0x1e')]:_0x3da836[_0x9682('0x2a')];var _0x3b4e0f={'method':_0x9682('0x24'),'uri':_0x9ea681+'incident'+'?'+_0x4991ea,'body':Object[_0x9682('0x3e')]({},{'active':'true','caller_id':_0x1318ec,'assigned_to':_0x3da836[_0x9682('0x1e')],'short_description':intUtil[_0x9682('0x3f')](_0x512e51['Subjects'],_0x1dbc75,'\x20'),'description':intUtil[_0x9682('0x3f')](_0x512e51['Descriptions'],_0x1dbc75,'\x0a')},getCustomFields(_0x512e51[_0x9682('0x40')],_0x1dbc75)),'auth':_0x1743e3,'json':!![]};return rp(_0x3b4e0f)[_0x9682('0xd')](function(_0x4308df){logger[_0x9682('0x12')]('['+[_0xcffb8f[_0x9682('0x13')]()]+_0x9682('0x41'),_0x4308df[_0x9682('0xe')]);_0x3da836[_0x9682('0x42')]=_0x4308df[_0x9682('0xe')][_0x9682('0x11')];_0x3da836[_0x9682('0x43')]=_0x4308df[_0x9682('0xe')][_0x9682('0x44')];logger['info']('['+[_0xcffb8f[_0x9682('0x13')]()]+_0x9682('0x45'),_0x3da836);_0x49d2b7(_0x3da836);})['catch'](function(_0x2a7a65){logger[_0x9682('0x15')]('['+[_0xcffb8f[_0x9682('0x13')]()]+']',_0x2a7a65['message']);_0xf43402(_0x2a7a65[_0x9682('0x16')]);});});};}function createRemoteTag(_0xc58fd3,_0x1ea04a,_0x1b11f1,_0x381d17){return new Promise(function(_0x19a734,_0x11b33d){var _0x421a5c={'method':'POST','uri':_0x1b11f1+_0x9682('0x46')+'?'+_0x381d17,'body':{'short_description':_0xc58fd3,'global':!![],'active':!![],'name':_0xc58fd3},'auth':_0x1ea04a,'json':!![]};return rp(_0x421a5c)['then'](function(_0x1f51ca){var _0x27b639=_0x1f51ca[_0x9682('0xe')]['sys_id'];_0x19a734(_0x27b639);});});}function getRemoteTag(_0x4aa8b7,_0x11ab4c,_0x2a201d,_0x1a064a,_0x38133d){return new Promise(function(_0x24bf6c,_0x248415){var _0x398485={'method':_0x9682('0x19'),'uri':_0x2a201d+'label'+'?sysparm_query=name%3D'+_0x4aa8b7+'&'+_0x1a064a,'auth':_0x11ab4c,'json':!![]};return rp(_0x398485)[_0x9682('0xd')](function(_0x27ab83){if(_0x27ab83[_0x9682('0xe')]['length']>0x0){var _0x3f6962=_0x27ab83['result'][0x0][_0x9682('0x11')];_0x24bf6c(_0x3f6962);}else{return createRemoteTag(_0x4aa8b7,_0x11ab4c,_0x2a201d,_0x1a064a)[_0x9682('0xd')](function(_0x276583){_0x24bf6c(_0x276583);});}});});}function assignTagToIncident(_0x108295,_0x11aa9d,_0x34bc1a,_0x4c2483,_0x15da87){return new Promise(function(_0x17bcb8,_0x54f08c){var _0x33869a={'method':_0x9682('0x24'),'uri':_0x34bc1a+_0x9682('0x47')+'?'+_0x15da87,'body':{'label':_0x108295,'table':_0x9682('0x48'),'id_type':_0x9682('0x49'),'table_key':_0x4c2483[_0x9682('0x42')],'title':_0x9682('0x4a')+_0x4c2483[_0x9682('0x43')],'id_display':_0x4c2483[_0x9682('0x43')]},'auth':_0x11aa9d,'json':!![]};return rp(_0x33869a)['then'](function(_0x28f75a){_0x17bcb8();})[_0x9682('0x21')](function(){_0x17bcb8();});});}function manageTags(_0x320d16,_0x464d6d,_0x280c94,_0x1c6f2f,_0x1d89fd,_0xcd8c40,_0x525057){return new Promise(function(_0x3882b7,_0x2a4dbf){var _0xc4d987=[];_0x464d6d[_0x9682('0x2f')](function(_0x2668e2){_0xc4d987['push'](getRemoteTag(_0x2668e2,_0x280c94,_0x1c6f2f,_0xcd8c40,_0x525057));});return Promise[_0x9682('0x4b')](_0xc4d987)[_0x9682('0xd')](function(_0x372d18){if(_0x372d18[_0x9682('0xf')]){logger[_0x9682('0x12')]('['+[_0x320d16[_0x9682('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x372d18);var _0x37eb64=[];_0x372d18[_0x9682('0x2f')](function(_0xd9b5e5){_0x37eb64[_0x9682('0x4c')](assignTagToIncident(_0xd9b5e5,_0x280c94,_0x1c6f2f,_0x1d89fd,_0xcd8c40));});return Promise[_0x9682('0x4b')](_0x37eb64)[_0x9682('0xd')](function(){_0x3882b7();})[_0x9682('0x21')](function(){_0x3882b7();});}else{_0x3882b7();}});});}function getTags(_0x192ad2,_0x3e858c,_0x1458d6,_0x5f09f2,_0x4afc82,_0x4e4b17){return function(_0x4ab20a){return new Promise(function(_0x593eb2,_0x48e5bf){var _0x531755=[];var _0x1bb4fa=_0x5f09f2[_0x9682('0x4d')];if(_0x1bb4fa&&_0x1bb4fa[_0x9682('0xf')]>0x0){_0x531755=_['map'](_0x1bb4fa,_0x9682('0x3c'));}if(_0x531755[_0x9682('0xf')]>0x0){return manageTags(_0x192ad2,_0x531755,_0x3e858c,_0x1458d6,_0x4ab20a,_0x4afc82,_0x4e4b17)[_0x9682('0xd')](function(){_0x593eb2(_0x4ab20a);});}else{_0x593eb2(_0x4ab20a);}});};}function emit(_0xe95812,_0x2caebf,_0x221c1a){var _0x30ad6b=_0x9682('0x4e')+_0x9682('0x4f')+_0x9682('0x50')+_0x9682('0x51');var _0x2c5f98={'uri':_0xe95812+_0x9682('0x52')+_0x221c1a+_0x30ad6b};io['to'](util['format'](_0x9682('0x53'),_0x2caebf))[_0x9682('0x54')](_0x9682('0x55'),_0x2c5f98);}exports['cs']=function(_0x26ebb9,_0xcc4310,_0x2a6173,_0x2e845f,_0x1c3077,_0x4430c5,_0x3e70fc,_0x4895a1){var _0x4cbf53={};var _0x49bbeb={'user':_0x4430c5[_0x9682('0x56')],'pass':_0x4430c5[_0x9682('0x57')]};var _0x225190='sysparm_limit=1';var _0x2a6527='sysparm_display_value=true';_0x4430c5[_0x9682('0x58')]=intUtil[_0x9682('0x59')](_0x4430c5[_0x9682('0x58')]);_0x4430c5['serverUrl']=intUtil['stripTrailingSlash'](_0x4430c5['serverUrl']);var _0x3ff1a6=util[_0x9682('0x5a')](_0x9682('0x5b'),_0x4430c5[_0x9682('0x58')]);_0x4cbf53['userEmail']=!_[_0x9682('0x5c')](_0x2e845f)?_0x2e845f['email']:null;_0x4cbf53[_0x9682('0x1f')]=_0x4430c5[_0x9682('0x5d')];_0x4cbf53[_0x9682('0x26')]=_0x4895a1['toLowerCase']()===_0x9682('0x5e')?_0xcc4310[_0x9682('0x5f')]:_0xcc4310['calleridnum'];_0x4cbf53[_0x9682('0x60')]=_0x4895a1===_0x9682('0x61')||_0x4895a1===_0x9682('0x62')?'queue':_0x9682('0x5e');var _0x17236c=util[_0x9682('0x5a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4430c5[_0x9682('0x63')],_0xcc4310[_0x9682('0x64')],md5(_0xcc4310[_0x9682('0x64')]));if(_0x1c3077&&_0x1c3077[_0x9682('0x65')]){logger[_0x9682('0x12')]('[QUEUE]',_0x9682('0x66'));_0xcc4310[_0x9682('0x67')]=_0x17236c;}else if(_0x3e70fc&&_0x3e70fc[_0x9682('0x68')]&&_0x3e70fc[_0x9682('0x68')]!==_0x9682('0x69')){logger[_0x9682('0x12')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xcc4310[_0x9682('0x67')]=_0x17236c;}else{_0xcc4310[_0x9682('0x67')]='';}return getAdminUser(_0x4895a1,_0x49bbeb,_0x4cbf53,_0x3ff1a6,_0x2a6527,_0x225190)['then'](getUser(_0x4895a1,_0x49bbeb,_0x3ff1a6,_0x2a6527,_0x225190))[_0x9682('0xd')](getEndUser(_0x4895a1,_0x49bbeb,_0x3ff1a6,_0x2a6527,_0x225190))[_0x9682('0xd')](getTicket(_0x4895a1,_0x49bbeb,_0x3ff1a6,_0x2a6173,_0xcc4310,_0x2a6527))[_0x9682('0xd')](function(_0x4e4c24){logger[_0x9682('0x12')](util[_0x9682('0x5a')](_0x9682('0x6a'),_0x4e4c24[_0x9682('0x42')]));logger[_0x9682('0x12')](util['format'](_0x9682('0x6b'),_0x4895a1));if(_0x4895a1!==_0x9682('0x62')){logger[_0x9682('0x12')]('['+[_0x4895a1[_0x9682('0x13')]()]+']',_0x9682('0x6c'));emit(_0x4430c5[_0x9682('0x58')],_0x2e845f['name'],_0x4e4c24[_0x9682('0x42')]);}})['catch'](function(_0x1b4258){logger[_0x9682('0x15')]('['+[_0x4895a1[_0x9682('0x13')]()]+_0x9682('0x6d'),util[_0x9682('0x6e')](_0x1b4258,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x435d=['recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','error','toUpperCase','message','info','validateEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','userEmail','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','then','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','Subjects','getString','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]'];(function(_0x491a04,_0x158148){var _0x23696f=function(_0x4df819){while(--_0x4df819){_0x491a04['push'](_0x491a04['shift']());}};_0x23696f(++_0x158148);}(_0x435d,0x169));var _0xd435=function(_0x2c7a4d,_0x288484){_0x2c7a4d=_0x2c7a4d-0x0;var _0x33f0f7=_0x435d[_0x2c7a4d];return _0x33f0f7;};'use strict';var _=require(_0xd435('0x0'));var Promise=require(_0xd435('0x1'));var rp=require('request-promise');var util=require(_0xd435('0x2'));var md5=require(_0xd435('0x3'));var Redis=require(_0xd435('0x4'));var intUtil=require(_0xd435('0x5'));var config=require(_0xd435('0x6'));var logger=require(_0xd435('0x7'))(_0xd435('0x8'));config[_0xd435('0x9')]=_[_0xd435('0xa')](config['redis'],{'host':_0xd435('0xb'),'port':0x18eb});var io=require(_0xd435('0xc'))(new Redis(config['redis']));function getAdminUser(_0x5b3380,_0x3b2a63,_0x1fa61d,_0x4c5e37,_0x1d50ae,_0x4c8cd1){return new Promise(function(_0x525d96,_0x2066d4){var _0x52b2ed={'method':_0xd435('0xd'),'uri':_0x4c5e37+_0xd435('0xe')+'&'+_0x1d50ae+'&'+_0x4c8cd1,'auth':_0x3b2a63,'json':!![]};return rp(_0x52b2ed)['then'](function(_0x347330){if(_0x347330[_0xd435('0xf')][_0xd435('0x10')]>0x0){_0x1fa61d[_0xd435('0x11')]=_0x347330[_0xd435('0xf')][0x0][_0xd435('0x12')];}logger['info']('['+[_0x5b3380['toUpperCase']()]+_0xd435('0x13'),_0x1fa61d);_0x525d96(_0x1fa61d);})['catch'](function(_0x128d65){logger[_0xd435('0x14')]('['+[_0x5b3380[_0xd435('0x15')]()]+']',_0x128d65[_0xd435('0x16')]);_0x2066d4(_0x128d65['message']);});});}function getUser(_0x3dd392,_0x52f72f,_0x45196b,_0x330589,_0x3adcd7){return function(_0x446cbf){logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+'],\x20getUser\x20input\x20crm',_0x446cbf);return new Promise(function(_0x1b626e,_0x5ed584){if(intUtil[_0xd435('0x18')](_0x446cbf['userEmail'])){var _0x12dd65={'method':_0xd435('0xd'),'uri':_0x45196b+_0xd435('0x19')+_0x446cbf['userEmail']+'&'+_0x330589+'&'+_0x3adcd7,'auth':_0x52f72f,'json':!![]};logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+_0xd435('0x1a'),_0x12dd65);return rp(_0x12dd65)['then'](function(_0x2cebc3){logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+_0xd435('0x1b'),_0x2cebc3);if(_0x2cebc3[_0xd435('0xf')][_0xd435('0x10')]>0x0&&String(_0x2cebc3[_0xd435('0xf')][0x0][_0xd435('0x1c')])===_0xd435('0x1d')){_0x446cbf[_0xd435('0x1e')]=_0x2cebc3[_0xd435('0xf')][0x0][_0xd435('0x12')];}else{_0x446cbf[_0xd435('0x1e')]=_0x446cbf[_0xd435('0x11')];_0x446cbf[_0xd435('0x1f')]=_0x446cbf[_0xd435('0x20')];}logger[_0xd435('0x17')]('['+[_0x3dd392[_0xd435('0x15')]()]+_0xd435('0x21'),_0x446cbf);_0x1b626e(_0x446cbf);})[_0xd435('0x22')](function(_0x5d1046){logger['error']('['+[_0x3dd392[_0xd435('0x15')]()]+']',_0x5d1046[_0xd435('0x16')]);_0x5ed584(_0x5d1046[_0xd435('0x16')]);});}else{logger[_0xd435('0x17')]('['+[_0x3dd392['toUpperCase']()]+_0xd435('0x23'));_0x446cbf[_0xd435('0x1e')]=_0x446cbf['adminId'];_0x446cbf[_0xd435('0x1f')]=_0x446cbf[_0xd435('0x20')];_0x1b626e(_0x446cbf);}});};}function createEndUser(_0x366900,_0x12f2f8,_0x278768,_0xa78643,_0x33d8d4){logger[_0xd435('0x17')]('['+[_0x366900[_0xd435('0x15')]()]+_0xd435('0x24'),_0x278768);return new Promise(function(_0x10aea7,_0xc911ef){var _0x43f7fb={'method':_0xd435('0x25'),'uri':_0xa78643+_0xd435('0x26')+_0x33d8d4,'body':{'user_name':_0x278768[_0xd435('0x27')],'roles':'user','first_name':_0x278768[_0xd435('0x27')],'active':_0xd435('0x1d'),'date_format':_0xd435('0x28'),'phone':_0x278768[_0xd435('0x27')]},'auth':_0x12f2f8,'json':!![]};return rp(_0x43f7fb)[_0xd435('0x29')](function(_0x26e481){logger[_0xd435('0x17')]('['+[_0x366900[_0xd435('0x15')]()]+_0xd435('0x2a'),_0x26e481[_0xd435('0xf')]);_0x278768[_0xd435('0x2b')]=_0x26e481[_0xd435('0xf')]['sys_id'];_0x10aea7(_0x278768);})[_0xd435('0x22')](function(_0x40dfc6){logger['error']('['+[_0x366900[_0xd435('0x15')]()]+']',_0x40dfc6[_0xd435('0x16')]);_0xc911ef(_0x40dfc6[_0xd435('0x16')]);});});}function getEndUser(_0x1b7e66,_0x5a3120,_0x71e9c3,_0x3b39a3,_0x27ef26){return function(_0x1c0299){logger['info']('['+[_0x1b7e66[_0xd435('0x15')]()]+_0xd435('0x2c'),_0x1c0299);return new Promise(function(_0x377f97,_0x325a91){var _0x195dee={'method':_0xd435('0xd'),'uri':_0x71e9c3+_0xd435('0x2d')+_0x1c0299[_0xd435('0x27')]+'&'+_0x3b39a3+'&'+_0x27ef26,'auth':_0x5a3120,'json':!![]};return rp(_0x195dee)['then'](function(_0xbf8b8f){if(_0xbf8b8f[_0xd435('0xf')]['length']>0x0){_0x1c0299['endUserId']=_0xbf8b8f[_0xd435('0xf')][0x0][_0xd435('0x12')];logger[_0xd435('0x17')]('['+[_0x1b7e66['toUpperCase']()]+_0xd435('0x2e'),_0x1c0299);_0x377f97(_0x1c0299);}else{return createEndUser(_0x1b7e66,_0x5a3120,_0x1c0299,_0x71e9c3,_0x3b39a3)[_0xd435('0x29')](function(_0x515d3c){logger['info']('['+[_0x1b7e66[_0xd435('0x15')]()]+_0xd435('0x2f'),_0x515d3c);_0x377f97(_0x515d3c);});}})[_0xd435('0x22')](function(_0x42703f){logger[_0xd435('0x14')]('['+[_0x1b7e66[_0xd435('0x15')]()]+']',_0x42703f[_0xd435('0x16')]);_0x325a91(_0x42703f['message']);});});};}function getCustomFields(_0x3ef09,_0x20bba0){var _0x1d17d7={};if(_0x3ef09['length']>0x0){_[_0xd435('0x30')](_0x3ef09,function(_0x57da79){if(_[_0xd435('0x31')]([_0xd435('0x32'),_0xd435('0x33')],_0x57da79[_0xd435('0x34')])&&_0x57da79[_0xd435('0x35')]&&!_0x57da79['customField']){_0x1d17d7[_0x57da79[_0xd435('0x35')][_0xd435('0x36')]()]=_0x57da79[_0xd435('0x37')][_0xd435('0x38')]();}else if(_[_0xd435('0x31')]([_0xd435('0x32'),'picklist'],_0x57da79[_0xd435('0x34')])&&_0x57da79[_0xd435('0x39')]&&_0x57da79[_0xd435('0x3a')]){_0x1d17d7[_0x57da79[_0xd435('0x39')]['toLowerCase']()]=_0x57da79['content']['toString']();}else if(_0x57da79[_0xd435('0x34')]===_0xd435('0x3b')&&_0x57da79[_0xd435('0x3c')]&&_0x57da79['idField']&&_0x57da79['customField']){_0x1d17d7[_0x57da79[_0xd435('0x39')]['toLowerCase']()]=_0x20bba0[_0x57da79['variableName']][_0xd435('0x38')]();}else if(_0x57da79[_0xd435('0x34')]===_0xd435('0x3d')&&_0x57da79[_0xd435('0x3e')]&&_0x57da79[_0xd435('0x3e')][_0xd435('0x3f')]&&_0x57da79[_0xd435('0x39')]&&_0x57da79[_0xd435('0x3a')]){_0x1d17d7[_0x57da79[_0xd435('0x39')][_0xd435('0x36')]()]=_0x20bba0[_0x57da79['Variable'][_0xd435('0x3f')][_0xd435('0x36')]()][_0xd435('0x38')]();}});}return _0x1d17d7;}function getTicket(_0x527c9d,_0x5d14f9,_0x4cd6e2,_0x367699,_0x14d620,_0x55d25c){return function(_0xcbf1b3){logger[_0xd435('0x17')]('['+[_0x527c9d[_0xd435('0x15')]()]+_0xd435('0x40'),_0xcbf1b3);return new Promise(function(_0x1397a7,_0x1e0b79){var _0x2e31c7=_0x527c9d[_0xd435('0x36')]()===_0xd435('0x41')?_0xcbf1b3[_0xd435('0x1e')]:_0xcbf1b3[_0xd435('0x2b')];var _0x5a0e20={'method':'POST','uri':_0x4cd6e2+_0xd435('0x42')+'?'+_0x55d25c,'body':Object['assign']({},{'active':_0xd435('0x1d'),'caller_id':_0x2e31c7,'assigned_to':_0xcbf1b3['userId'],'short_description':intUtil['getString'](_0x367699[_0xd435('0x43')],_0x14d620,'\x20'),'description':intUtil[_0xd435('0x44')](_0x367699[_0xd435('0x45')],_0x14d620,'\x0a')},getCustomFields(_0x367699['Fields'],_0x14d620)),'auth':_0x5d14f9,'json':!![]};return rp(_0x5a0e20)[_0xd435('0x29')](function(_0x30e5b0){logger['info']('['+[_0x527c9d[_0xd435('0x15')]()]+_0xd435('0x46'),_0x30e5b0[_0xd435('0xf')]);_0xcbf1b3[_0xd435('0x47')]=_0x30e5b0[_0xd435('0xf')][_0xd435('0x12')];_0xcbf1b3[_0xd435('0x48')]=_0x30e5b0[_0xd435('0xf')]['number'];logger[_0xd435('0x17')]('['+[_0x527c9d[_0xd435('0x15')]()]+']\x20getTicket\x20crm',_0xcbf1b3);_0x1397a7(_0xcbf1b3);})[_0xd435('0x22')](function(_0x14e5e1){logger[_0xd435('0x14')]('['+[_0x527c9d[_0xd435('0x15')]()]+']',_0x14e5e1[_0xd435('0x16')]);_0x1e0b79(_0x14e5e1['message']);});});};}function createRemoteTag(_0x17a84f,_0x57afdc,_0x425d2e,_0x302457){return new Promise(function(_0x55e5f7,_0x2d1c08){var _0x37ca0d={'method':_0xd435('0x25'),'uri':_0x425d2e+_0xd435('0x49')+'?'+_0x302457,'body':{'short_description':_0x17a84f,'global':!![],'active':!![],'name':_0x17a84f},'auth':_0x57afdc,'json':!![]};return rp(_0x37ca0d)['then'](function(_0x4ca11b){var _0x39bf02=_0x4ca11b[_0xd435('0xf')][_0xd435('0x12')];_0x55e5f7(_0x39bf02);});});}function getRemoteTag(_0x2e9871,_0x2bb5d6,_0x1aa872,_0x244938,_0x2a5782){return new Promise(function(_0x21828c,_0x1a310a){var _0x1172e8={'method':_0xd435('0xd'),'uri':_0x1aa872+_0xd435('0x49')+_0xd435('0x4a')+_0x2e9871+'&'+_0x244938,'auth':_0x2bb5d6,'json':!![]};return rp(_0x1172e8)[_0xd435('0x29')](function(_0xb438e0){if(_0xb438e0['result'][_0xd435('0x10')]>0x0){var _0x2a7205=_0xb438e0[_0xd435('0xf')][0x0][_0xd435('0x12')];_0x21828c(_0x2a7205);}else{return createRemoteTag(_0x2e9871,_0x2bb5d6,_0x1aa872,_0x244938)[_0xd435('0x29')](function(_0x499be5){_0x21828c(_0x499be5);});}});});}function assignTagToIncident(_0x5abc24,_0x1047d4,_0x47d864,_0x54b4a7,_0x239b0b){return new Promise(function(_0x121287,_0x167d5b){var _0x3b563e={'method':_0xd435('0x25'),'uri':_0x47d864+_0xd435('0x4b')+'?'+_0x239b0b,'body':{'label':_0x5abc24,'table':_0xd435('0x42'),'id_type':'Incident','table_key':_0x54b4a7[_0xd435('0x47')],'title':_0xd435('0x4c')+_0x54b4a7[_0xd435('0x48')],'id_display':_0x54b4a7[_0xd435('0x48')]},'auth':_0x1047d4,'json':!![]};return rp(_0x3b563e)[_0xd435('0x29')](function(_0xf03cef){_0x121287();})['catch'](function(){_0x121287();});});}function manageTags(_0x3783fd,_0x5227f0,_0x406cbd,_0x102620,_0x1480b3,_0x1d4eb2,_0x4b937f){return new Promise(function(_0x57cd4d,_0x1bfe58){var _0xe83d35=[];_0x5227f0[_0xd435('0x30')](function(_0x3dd30d){_0xe83d35[_0xd435('0x4d')](getRemoteTag(_0x3dd30d,_0x406cbd,_0x102620,_0x1d4eb2,_0x4b937f));});return Promise[_0xd435('0x4e')](_0xe83d35)['then'](function(_0x165df7){if(_0x165df7[_0xd435('0x10')]){logger[_0xd435('0x17')]('['+[_0x3783fd['toUpperCase']()]+_0xd435('0x4f'),_0x165df7);var _0x2ab98a=[];_0x165df7[_0xd435('0x30')](function(_0x529b2c){_0x2ab98a[_0xd435('0x4d')](assignTagToIncident(_0x529b2c,_0x406cbd,_0x102620,_0x1480b3,_0x1d4eb2));});return Promise[_0xd435('0x4e')](_0x2ab98a)[_0xd435('0x29')](function(){_0x57cd4d();})[_0xd435('0x22')](function(){_0x57cd4d();});}else{_0x57cd4d();}});});}function getTags(_0x1a20e3,_0x4d9439,_0x47e0f8,_0x124e63,_0x4807da,_0x4f1c81){return function(_0x275a84){return new Promise(function(_0x5dd11d,_0x432faa){var _0x3f80dc=[];var _0x2bb013=_0x124e63[_0xd435('0x50')];if(_0x2bb013&&_0x2bb013['length']>0x0){_0x3f80dc=_[_0xd435('0x51')](_0x2bb013,'name');}if(_0x3f80dc[_0xd435('0x10')]>0x0){return manageTags(_0x1a20e3,_0x3f80dc,_0x4d9439,_0x47e0f8,_0x275a84,_0x4807da,_0x4f1c81)[_0xd435('0x29')](function(){_0x5dd11d(_0x275a84);});}else{_0x5dd11d(_0x275a84);}});};}function emit(_0x474e78,_0x56f9a2,_0x235d43){var _0x3d90e9=_0xd435('0x52')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xd435('0x53')+_0xd435('0x54');var _0x19a9c0={'uri':_0x474e78+_0xd435('0x55')+_0x235d43+_0x3d90e9};io['to'](util['format'](_0xd435('0x56'),_0x56f9a2))[_0xd435('0x57')](_0xd435('0x58'),_0x19a9c0);}exports['cs']=function(_0x102c96,_0x42796f,_0x2afdc2,_0x29adca,_0x4df5a2,_0x1442fa,_0x25e185,_0x5685f7){var _0x538090={};var _0x3da58a={'user':_0x1442fa[_0xd435('0x59')],'pass':_0x1442fa[_0xd435('0x5a')]};var _0x2e463a=_0xd435('0x5b');var _0x40002d=_0xd435('0x5c');_0x1442fa[_0xd435('0x5d')]=intUtil[_0xd435('0x5e')](_0x1442fa[_0xd435('0x5d')]);_0x1442fa[_0xd435('0x5f')]=intUtil[_0xd435('0x5e')](_0x1442fa[_0xd435('0x5f')]);var _0x1fb7a0=util[_0xd435('0x60')](_0xd435('0x61'),_0x1442fa[_0xd435('0x5d')]);_0x538090['userEmail']=!_[_0xd435('0x62')](_0x29adca)?_0x29adca[_0xd435('0x63')]:null;_0x538090[_0xd435('0x20')]=_0x1442fa['email'];_0x538090[_0xd435('0x27')]=_0x5685f7[_0xd435('0x36')]()===_0xd435('0x41')?_0x42796f[_0xd435('0x64')]:_0x42796f[_0xd435('0x65')];_0x538090[_0xd435('0x66')]=_0x5685f7===_0xd435('0x67')||_0x5685f7==='unmanaged'?_0xd435('0x67'):'outbound';var _0xeb7ce4=util[_0xd435('0x60')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1442fa[_0xd435('0x5f')],_0x42796f[_0xd435('0x68')],md5(_0x42796f[_0xd435('0x68')]));if(_0x4df5a2&&_0x4df5a2[_0xd435('0x69')]){logger['info'](_0xd435('0x6a'),_0xd435('0x6b'));_0x42796f['recordingURL']=_0xeb7ce4;}else if(_0x25e185&&_0x25e185[_0xd435('0x6c')]&&_0x25e185['recordingFormat']!==_0xd435('0x6d')){logger[_0xd435('0x17')](_0xd435('0x6e'),'Recording\x20is\x20enabled!');_0x42796f['recordingURL']=_0xeb7ce4;}else{_0x42796f[_0xd435('0x6f')]='';}return getAdminUser(_0x5685f7,_0x3da58a,_0x538090,_0x1fb7a0,_0x40002d,_0x2e463a)[_0xd435('0x29')](getUser(_0x5685f7,_0x3da58a,_0x1fb7a0,_0x40002d,_0x2e463a))[_0xd435('0x29')](getEndUser(_0x5685f7,_0x3da58a,_0x1fb7a0,_0x40002d,_0x2e463a))[_0xd435('0x29')](getTicket(_0x5685f7,_0x3da58a,_0x1fb7a0,_0x2afdc2,_0x42796f,_0x40002d))[_0xd435('0x29')](function(_0x1f0849){logger['info'](util[_0xd435('0x60')](_0xd435('0x70'),_0x1f0849[_0xd435('0x47')]));logger[_0xd435('0x17')](util[_0xd435('0x60')](_0xd435('0x71'),_0x5685f7));if(_0x5685f7!==_0xd435('0x72')){logger['info']('['+[_0x5685f7['toUpperCase']()]+']',_0xd435('0x73'));emit(_0x1442fa['remoteUri'],_0x29adca[_0xd435('0x3f')],_0x1f0849[_0xd435('0x47')]);}})[_0xd435('0x22')](function(_0x4191f9){logger['error']('['+[_0x5685f7[_0xd435('0x15')]()]+_0xd435('0x74'),util[_0xd435('0x75')](_0x4191f9,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 61b68c2..b7500b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a73=['idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','get_entry_list','Employees','then','entry_list','length','find','name_value_list','user_name','Agent\x20found!','value','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','map','type','string','customField','nameField','content','custom_fields','variable','variableName','push','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','[QUEUE]','outbound','recordingFormat','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','user:%s','trigger:browser:url','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','localhost','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','direction','forEach'];(function(_0x1a8ec2,_0x54754b){var _0x3ff96f=function(_0x43163c){while(--_0x43163c){_0x1a8ec2['push'](_0x1a8ec2['shift']());}};_0x3ff96f(++_0x54754b);}(_0x3a73,0xcd));var _0x33a7=function(_0x125b16,_0x28d5a7){_0x125b16=_0x125b16-0x0;var _0x4c26c2=_0x3a73[_0x125b16];return _0x4c26c2;};'use strict';var _=require(_0x33a7('0x0'));var rp=require(_0x33a7('0x1'));var BPromise=require(_0x33a7('0x2'));var md5=require(_0x33a7('0x3'));var util=require(_0x33a7('0x4'));var Redis=require(_0x33a7('0x5'));var intUtil=require(_0x33a7('0x6'));var config=require('../../../../config/environment');var logger=require(_0x33a7('0x7'))(_0x33a7('0x8'));config['redis']=_[_0x33a7('0x9')](config['redis'],{'host':_0x33a7('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33a7('0xb')]));var def={'method':_0x33a7('0xc'),'json':!![]};function emit(_0x480ed3,_0x1e1cf3,_0x2985a0){io['to'](_0x480ed3)[_0x33a7('0xd')](_0x1e1cf3,_0x2985a0);}function getTicket(_0x352e75,_0xf97db7,_0x4fdd5d,_0x137f1f,_0x347c12,_0x47fdd1,_0xa8ac78,_0x293142){logger[_0x33a7('0xe')](_0x33a7('0xf'));var _0x3369bb=new Date();var _0x275b5b=[{'name':_0x33a7('0x10'),'value':intUtil[_0x33a7('0x11')](_0x137f1f[_0x33a7('0x12')],_0x347c12,'\x20')},{'name':'assigned_user_id','value':_0xf97db7['id']},{'name':_0x33a7('0x13'),'value':_0xf97db7['id']},{'name':_0x33a7('0x14'),'value':intUtil[_0x33a7('0x11')](_0x137f1f[_0x33a7('0x15')],_0x347c12,'\x0a')},{'name':'date_start','value':_0x3369bb[_0x33a7('0x16')]()[_0x33a7('0x17')](0x0,0x13)[_0x33a7('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x33a7('0x19'),'value':'15'},{'name':_0x33a7('0x1a'),'value':_0x4fdd5d['id']},{'name':_0x33a7('0x1b'),'value':_0x33a7('0x1c')},{'name':'parent_name','value':_0x4fdd5d[_0x33a7('0x10')]},{'name':_0x33a7('0x1d'),'value':_0x293142}];if(_0x47fdd1['length']){_[_0x33a7('0x1e')](_0x47fdd1,function(_0x4720d8){if(_0x347c12[_0x4720d8['variableName']]){_0x275b5b['push']({'name':_0x4720d8[_0x33a7('0x1f')],'value':_0x347c12[_0x4720d8['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0xa8ac78['id'],'module_name':_0x33a7('0x22'),'name_value_list':_0x275b5b})}});}function getAuth(_0x1d7af7){return util[_0x33a7('0x23')](_0x33a7('0x24'),new Buffer(_0x1d7af7[_0x33a7('0x25')]+':X')[_0x33a7('0x26')]('base64'));}function getServerInfo(_0x27a81e){return request({'form':{'method':_0x33a7('0x27'),'input_type':'JSON','response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0x27a81e['id']})}});}function getUser(_0x45b63d,_0x2473b4,_0x57ac96){if(!_[_0x33a7('0x28')](_0x2473b4)){logger['info']('Getting\x20agent\x20with\x20name',_0x2473b4);return request({'form':{'method':_0x33a7('0x29'),'input_type':_0x33a7('0x20'),'response_type':'JSON','rest_data':JSON[_0x33a7('0x21')]({'session':_0x57ac96['id'],'module_name':_0x33a7('0x2a'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x2473b4),'order_by':'','offset':'0','select_fields':['id',_0x33a7('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33a7('0x2b')](function(_0x2b92ae){if(_0x2b92ae[_0x33a7('0x2c')][_0x33a7('0x2d')]){var _0x54cfeb=_[_0x33a7('0x2e')](_0x2b92ae[_0x33a7('0x2c')],function(_0x4c3464){return _0x4c3464[_0x33a7('0x2f')][_0x33a7('0x30')]['value']===_0x2473b4;});if(_0x54cfeb){logger[_0x33a7('0xe')](_0x33a7('0x31'));return BPromise['resolve']({'id':_0x54cfeb[_0x33a7('0x2f')]['id'][_0x33a7('0x32')],'name':_0x54cfeb[_0x33a7('0x2f')][_0x33a7('0x10')]['value']});}}logger[_0x33a7('0xe')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x33a7('0x33')]({'id':_0x57ac96[_0x33a7('0x2f')][_0x33a7('0x34')]['value'],'name':_0x57ac96[_0x33a7('0x2f')][_0x33a7('0x30')][_0x33a7('0x32')]});});}else{logger[_0x33a7('0xe')](_0x33a7('0x35'));return BPromise['resolve']({'id':_0x57ac96[_0x33a7('0x2f')][_0x33a7('0x34')][_0x33a7('0x32')],'name':_0x57ac96[_0x33a7('0x2f')]['user_name'][_0x33a7('0x32')]});}}function getEndUser(_0x29f206,_0x365b44,_0x32d1eb,_0x2a9d3f){logger[_0x33a7('0xe')](_0x33a7('0x36'),_0x32d1eb);return request({'form':{'method':_0x33a7('0x29'),'input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON['stringify']({'session':_0x2a9d3f['id'],'module_name':_0x33a7('0x1c'),'query':util['format'](_0x33a7('0x37'),_0x32d1eb),'order_by':'','offset':'0','select_fields':['id',_0x33a7('0x10'),_0x33a7('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x33a7('0x2b')](function(_0x517749){if(_0x517749[_0x33a7('0x2c')][_0x33a7('0x2d')]){var _0x4a78f8=_[_0x33a7('0x2e')](_0x517749['entry_list'],function(_0x369a81){return _0x369a81[_0x33a7('0x2f')][_0x33a7('0x38')][_0x33a7('0x32')]===_0x32d1eb;});if(_0x4a78f8){logger['info']('Enduser\x20found!');return BPromise[_0x33a7('0x33')]({'id':_0x4a78f8['name_value_list']['id'][_0x33a7('0x32')],'name':_0x4a78f8[_0x33a7('0x2f')][_0x33a7('0x10')][_0x33a7('0x32')],'phone':_0x4a78f8[_0x33a7('0x2f')][_0x33a7('0x38')][_0x33a7('0x32')]});}}else{logger['info'](_0x33a7('0x39'));return request({'form':{'method':_0x33a7('0x3a'),'input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0x2a9d3f['id'],'module_name':_0x33a7('0x1c'),'name_value_list':[{'name':_0x33a7('0x3b'),'value':_0x365b44!==_0x33a7('0x3c')?_0x365b44:util['format']('Caller\x20-\x20%s',_0x32d1eb)},{'name':_0x33a7('0x38'),'value':_0x32d1eb}]})}})[_0x33a7('0x2b')](function(_0x368e20){logger[_0x33a7('0xe')]('Enduser\x20created.');return BPromise[_0x33a7('0x33')]({'id':_0x368e20['id'],'name':_0x368e20['entry_list'][_0x33a7('0x3b')]['value'],'phone':_0x368e20[_0x33a7('0x2c')][_0x33a7('0x38')][_0x33a7('0x32')]});});}});}function request(_0x115e80){logger['debug']('[HTTP]',JSON[_0x33a7('0x21')](_0x115e80));return rp(_['merge'](def,_0x115e80));}function getTags(_0x480265,_0x43f0d3){var _0x3197d0=[];if(_0x480265&&_0x480265['length']>0x0){_0x3197d0=_[_0x33a7('0x3d')](_0x480265,_0x43f0d3);}return _0x3197d0;}function getCustomFields(_0x3afbb5,_0x2ea44e){var _0x13095b=[];var _0x2adc78={'custom_fields':[]};if(_0x3afbb5[_0x33a7('0x2d')]>0x0){_[_0x33a7('0x1e')](_0x3afbb5,function(_0x3783e7){if(_0x3783e7[_0x33a7('0x3e')]===_0x33a7('0x3f')&&_0x3783e7['nameField']&&!_0x3783e7[_0x33a7('0x40')]){_0x2adc78[_0x3783e7[_0x33a7('0x41')]['toLowerCase']()]=_0x3783e7[_0x33a7('0x42')]['toString']();}else if(_0x3783e7[_0x33a7('0x3e')]===_0x33a7('0x3f')&&_0x3783e7[_0x33a7('0x1f')]&&_0x3783e7[_0x33a7('0x40')]){_0x2adc78[_0x33a7('0x43')]['push']({'id':_0x3783e7[_0x33a7('0x1f')],'value':_0x3783e7[_0x33a7('0x42')][_0x33a7('0x26')]()});}else if(_0x3783e7['type']===_0x33a7('0x44')&&_0x3783e7[_0x33a7('0x45')]&&_0x3783e7[_0x33a7('0x1f')]&&_0x3783e7[_0x33a7('0x40')]){_0x2ea44e[_0x3783e7[_0x33a7('0x45')]]&&_0x2adc78[_0x33a7('0x43')][_0x33a7('0x46')]({'id':_0x3783e7[_0x33a7('0x1f')],'value':_0x2ea44e[_0x3783e7[_0x33a7('0x45')]][_0x33a7('0x26')]()});}else if(_0x3783e7[_0x33a7('0x3e')]===_0x33a7('0x47')&&_0x3783e7['Variable']&&_0x3783e7[_0x33a7('0x48')][_0x33a7('0x10')]&&_0x3783e7[_0x33a7('0x1f')]&&_0x3783e7[_0x33a7('0x40')]){_0x2ea44e[_0x3783e7['Variable'][_0x33a7('0x10')][_0x33a7('0x49')]()]&&_0x2adc78['custom_fields'][_0x33a7('0x46')]({'id':_0x3783e7[_0x33a7('0x1f')],'value':_0x2ea44e[_0x3783e7[_0x33a7('0x48')]['name'][_0x33a7('0x49')]()][_0x33a7('0x26')]()});}});}return _0x2adc78;}function getConnection(_0x816e0f){return request({'method':_0x33a7('0xc'),'form':{'method':'login','input_type':'JSON','response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'user_auth':{'user_name':_0x816e0f[_0x33a7('0x4a')],'password':_0x816e0f[_0x33a7('0x4b')],'encryption':_0x33a7('0x4c')},'application':_0x33a7('0x4d')})}})[_0x33a7('0x2b')](function(_0x2472ef){var _0x45eeeb=_0x2472ef;if(_0x45eeeb['id']){def[_0x33a7('0x4e')]=_0x45eeeb['id'];return BPromise[_0x33a7('0x33')](_0x45eeeb);}else{throw new Error(util[_0x33a7('0x23')](_0x33a7('0x4f'),_0x816e0f['id']));}});}function setRelationship(_0x5aad68,_0x82427a,_0x26e961,_0x46ce28){return request({'form':{'method':_0x33a7('0x50'),'input_type':_0x33a7('0x20'),'response_type':_0x33a7('0x20'),'rest_data':JSON[_0x33a7('0x21')]({'session':_0x5aad68['id'],'module_name':_0x33a7('0x22'),'module_id':_0x26e961['id'],'link_field_name':_0x46ce28,'related_ids':[_0x82427a['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0xf42159,_0x138905,_0x5f35ef,_0x17baad,_0x11c2f5,_0xe58509){var _0x4206e7,_0xb654d8,_0x586ca4,_0x22f846;_0xe58509[_0x33a7('0x51')]=intUtil[_0x33a7('0x52')](_0xe58509[_0x33a7('0x51')]);_0xe58509['serverUrl']=intUtil[_0x33a7('0x52')](_0xe58509[_0x33a7('0x53')]);def[_0x33a7('0x54')]=util[_0x33a7('0x23')](_0x33a7('0x55'),_0xe58509[_0x33a7('0x51')]);if(_0x11c2f5&&_0x11c2f5[_0x33a7('0x56')]){logger[_0x33a7('0xe')]('[QUEUE]',_0x33a7('0x57'));_0x138905[_0x33a7('0x58')]=util[_0x33a7('0x23')](_0x33a7('0x59'),_0xe58509[_0x33a7('0x53')],_0x138905[_0x33a7('0x5a')],md5(_0x138905[_0x33a7('0x5a')]));}else{_0x138905[_0x33a7('0x58')]='';}return getConnection(_0xe58509)[_0x33a7('0x2b')](function(_0x73905f){_0x22f846=_0x73905f;return getUser(_0xe58509,_0x17baad[_0x33a7('0x10')],_0x22f846);})[_0x33a7('0x2b')](function(_0x4e9203){_0x4206e7=_0x4e9203;logger[_0x33a7('0xe')]('The\x20User\x20ID\x20is:',_0x4206e7['id']);return getEndUser(_0xe58509,_0x138905[_0x33a7('0x5b')],_0x138905[_0x33a7('0x5c')],_0x22f846);})[_0x33a7('0x2b')](function(_0x3ac3ae){_0xb654d8=_0x3ac3ae;logger['info'](_0x33a7('0x5d'),_0xb654d8['id']);return getTicket(_0xe58509,_0x4206e7,_0xb654d8,_0x5f35ef,_0x138905,_0x5f35ef[_0x33a7('0x5e')],_0x22f846,_0x33a7('0x5f'));})[_0x33a7('0x2b')](function(_0x311ea7){_0x586ca4=_0x311ea7;logger[_0x33a7('0xe')](_0x33a7('0x60'));logger[_0x33a7('0xe')]('The\x20Ticket\x20ID\x20is:',_0x586ca4['id']);return setRelationship(_0x22f846,_0x4206e7,_0x586ca4,_0x33a7('0x61'));})[_0x33a7('0x2b')](function(){return setRelationship(_0x22f846,_0xb654d8,_0x586ca4,_0x33a7('0x62'));})[_0x33a7('0x2b')](function(){return getServerInfo(_0x22f846);})[_0x33a7('0x2b')](function(_0x44bfb1){var _0x2fc0d4=parseInt(_0x44bfb1['version'][_0x33a7('0x63')](0x0));var _0x23115e=util[_0x33a7('0x23')](_0x33a7('0x64'),_0xe58509[_0x33a7('0x51')],_0x586ca4['id']);if(_0x2fc0d4>0x6){_0x23115e=util[_0x33a7('0x23')](_0x33a7('0x65'),_0xe58509[_0x33a7('0x51')],_0x586ca4['id']);}logger['info']('[QUEUE]',_0x33a7('0x66'));emit(util[_0x33a7('0x23')]('user:%s',_0x17baad['name']),'trigger:browser:url',{'uri':_0x23115e});})[_0x33a7('0x67')](function(_0x144906){logger['error'](_0x33a7('0x68'),JSON[_0x33a7('0x21')](_0x144906));});};exports[_0x33a7('0x69')]=function(_0x4324f3,_0x42948f,_0x1d736d,_0x2c7c89,_0x19c5f3,_0x2f9ac7,_0x2559a4){var _0x30e7d5,_0x1329eb,_0x46f951,_0xebd283;_0x2f9ac7[_0x33a7('0x51')]=intUtil['stripTrailingSlash'](_0x2f9ac7[_0x33a7('0x51')]);_0x2f9ac7[_0x33a7('0x53')]=intUtil[_0x33a7('0x52')](_0x2f9ac7['serverUrl']);def[_0x33a7('0x54')]=util[_0x33a7('0x23')](_0x33a7('0x55'),_0x2f9ac7['remoteUri']);if(_0x2559a4&&_0x2559a4[_0x33a7('0x6a')]&&_0x2559a4['recordingFormat']!=='none'){logger[_0x33a7('0xe')]('[OUTBOUND]',_0x33a7('0x57'));_0x42948f[_0x33a7('0x58')]=util[_0x33a7('0x23')](_0x33a7('0x59'),_0x2f9ac7[_0x33a7('0x53')],_0x42948f[_0x33a7('0x5a')],md5(_0x42948f[_0x33a7('0x5a')]));}return getConnection(_0x2f9ac7)[_0x33a7('0x2b')](function(_0x42aa22){_0xebd283=_0x42aa22;return getUser(_0x2f9ac7,_0x2c7c89[_0x33a7('0x10')],_0xebd283);})[_0x33a7('0x2b')](function(_0x37c2bf){_0x30e7d5=_0x37c2bf;logger[_0x33a7('0xe')](_0x33a7('0x6b'),_0x30e7d5['id']);return getEndUser(_0x2f9ac7,_0x42948f['destcalleridname'],_0x42948f[_0x33a7('0x6c')],_0xebd283);})[_0x33a7('0x2b')](function(_0x2c741c){_0x1329eb=_0x2c741c;logger['info'](_0x33a7('0x5d'),_0x1329eb['id']);return getTicket(_0x2f9ac7,_0x30e7d5,_0x1329eb,_0x1d736d,_0x42948f,_0x1d736d['Fields'],_0xebd283,_0x33a7('0x6d'));})[_0x33a7('0x2b')](function(_0x170c4d){_0x46f951=_0x170c4d;logger['info'](_0x33a7('0x60'));logger[_0x33a7('0xe')](_0x33a7('0x6e'),_0x46f951['id']);return setRelationship(_0xebd283,_0x30e7d5,_0x46f951,_0x33a7('0x61'));})['then'](function(){return setRelationship(_0xebd283,_0x1329eb,_0x46f951,_0x33a7('0x62'));})[_0x33a7('0x2b')](function(){return getServerInfo(_0xebd283);})[_0x33a7('0x2b')](function(_0x5a6b83){var _0x214b9b=parseInt(_0x5a6b83['version'][_0x33a7('0x63')](0x0));var _0x18aafc=util['format'](_0x33a7('0x64'),_0x2f9ac7['remoteUri'],_0x46f951['id']);if(_0x214b9b>0x6){_0x18aafc=util[_0x33a7('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2f9ac7[_0x33a7('0x51')],_0x46f951['id']);}logger[_0x33a7('0xe')](_0x33a7('0x6f'),_0x33a7('0x66'));emit(util[_0x33a7('0x23')](_0x33a7('0x70'),_0x2c7c89[_0x33a7('0x10')]),_0x33a7('0x71'),{'uri':_0x18aafc});})[_0x33a7('0x67')](function(_0x49a450){logger[_0x33a7('0x72')](_0x33a7('0x6f'),JSON['stringify'](_0x49a450));});};exports[_0x33a7('0x73')]=function(_0x5c3ad7,_0x3a8afb,_0xdf5713,_0x930408,_0x151771,_0x55b335){var _0xf2511e,_0xf72c18,_0x2ab153,_0x22227c;_0x55b335[_0x33a7('0x51')]=intUtil[_0x33a7('0x52')](_0x55b335[_0x33a7('0x51')]);_0x55b335[_0x33a7('0x53')]=intUtil['stripTrailingSlash'](_0x55b335[_0x33a7('0x53')]);def[_0x33a7('0x54')]=util[_0x33a7('0x23')](_0x33a7('0x55'),_0x55b335['remoteUri']);if(_0x151771&&_0x151771[_0x33a7('0x56')]){logger[_0x33a7('0xe')]('['+_0x3a8afb[_0x33a7('0x74')][_0x33a7('0x75')]()+']','Recording\x20is\x20enabled!');_0x3a8afb['recordingURL']=util[_0x33a7('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55b335['serverUrl'],_0x3a8afb[_0x33a7('0x5a')],md5(_0x3a8afb[_0x33a7('0x5a')]));}else{_0x3a8afb['recordingURL']='';}return getConnection(_0x55b335)[_0x33a7('0x2b')](function(_0x36ea8d){_0x22227c=_0x36ea8d;if(!_[_0x33a7('0x28')](_0x930408)){return getUser(_0x55b335,_0x930408[_0x33a7('0x10')],_0x22227c);}else{return getUser(_0x55b335,null,_0x22227c);}})[_0x33a7('0x2b')](function(_0x326407){_0xf2511e=_0x326407;logger['info']('The\x20User\x20ID\x20is:',_0xf2511e['id']);return getEndUser(_0x55b335,_0x3a8afb[_0x33a7('0x5b')],_0x3a8afb['calleridnum'],_0x22227c);})[_0x33a7('0x2b')](function(_0x96dc77){_0xf72c18=_0x96dc77;logger['info'](_0x33a7('0x5d'),_0xf72c18['id']);return getTicket(_0x55b335,_0xf2511e,_0xf72c18,_0xdf5713,_0x3a8afb,_0xdf5713['Fields'],_0x22227c,'Inbound');})[_0x33a7('0x2b')](function(_0x2094b6){_0x2ab153=_0x2094b6;logger[_0x33a7('0xe')]('Ticket\x20created!');logger['info'](_0x33a7('0x6e'),_0x2ab153['id']);return setRelationship(_0x22227c,_0xf2511e,_0x2ab153,'users');})[_0x33a7('0x2b')](function(){return setRelationship(_0x22227c,_0xf72c18,_0x2ab153,_0x33a7('0x62'));})[_0x33a7('0x2b')](function(){return getServerInfo(_0x22227c);})[_0x33a7('0x67')](function(_0xca35f5){logger[_0x33a7('0x72')]('['+_0x3a8afb[_0x33a7('0x74')][_0x33a7('0x75')]()+']',JSON['stringify'](_0xca35f5));});};
\ No newline at end of file
+var _0xacae=['xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','recordingFormat','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','contacts','version','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[OUTBOUND]','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','defaults','redis','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','push','idField','set_entry','JSON','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','stringify','isNil','Getting\x20agent\x20with\x20name','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','user_name','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','phone_home','then','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','map','type','string','nameField','customField','toLowerCase','content','custom_fields','variable','Variable','POST','login','username','password','PLAIN'];(function(_0x5a99b6,_0x50c27f){var _0x18bb13=function(_0x5eefdf){while(--_0x5eefdf){_0x5a99b6['push'](_0x5a99b6['shift']());}};_0x18bb13(++_0x50c27f);}(_0xacae,0xab));var _0xeaca=function(_0x11fc36,_0x343f71){_0x11fc36=_0x11fc36-0x0;var _0x46b314=_0xacae[_0x11fc36];return _0x46b314;};'use strict';var _=require(_0xeaca('0x0'));var rp=require(_0xeaca('0x1'));var BPromise=require(_0xeaca('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0xeaca('0x3'));var intUtil=require(_0xeaca('0x4'));var config=require(_0xeaca('0x5'));var logger=require(_0xeaca('0x6'))(_0xeaca('0x7'));config['redis']=_[_0xeaca('0x8')](config[_0xeaca('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xeaca('0xa'))(new Redis(config[_0xeaca('0x9')]));var def={'method':'POST','json':!![]};function emit(_0x883d43,_0x5eb9ea,_0x1a1368){io['to'](_0x883d43)[_0xeaca('0xb')](_0x5eb9ea,_0x1a1368);}function getTicket(_0x1647a6,_0x27e8e2,_0x2c81d5,_0x2aafef,_0x26955a,_0x2c386c,_0x49a4f3,_0x2c0547){logger[_0xeaca('0xc')](_0xeaca('0xd'));var _0x424227=new Date();var _0x36d31e=[{'name':_0xeaca('0xe'),'value':intUtil[_0xeaca('0xf')](_0x2aafef['Subjects'],_0x26955a,'\x20')},{'name':_0xeaca('0x10'),'value':_0x27e8e2['id']},{'name':_0xeaca('0x11'),'value':_0x27e8e2['id']},{'name':_0xeaca('0x12'),'value':intUtil[_0xeaca('0xf')](_0x2aafef[_0xeaca('0x13')],_0x26955a,'\x0a')},{'name':_0xeaca('0x14'),'value':_0x424227[_0xeaca('0x15')]()[_0xeaca('0x16')](0x0,0x13)[_0xeaca('0x17')]('T','\x20')},{'name':_0xeaca('0x18'),'value':'0'},{'name':_0xeaca('0x19'),'value':'15'},{'name':_0xeaca('0x1a'),'value':_0x2c81d5['id']},{'name':_0xeaca('0x1b'),'value':_0xeaca('0x1c')},{'name':_0xeaca('0x1d'),'value':_0x2c81d5['name']},{'name':_0xeaca('0x1e'),'value':_0x2c0547}];if(_0x2c386c[_0xeaca('0x1f')]){_[_0xeaca('0x20')](_0x2c386c,function(_0x124f22){if(_0x26955a[_0x124f22[_0xeaca('0x21')]]){_0x36d31e[_0xeaca('0x22')]({'name':_0x124f22[_0xeaca('0x23')],'value':_0x26955a[_0x124f22[_0xeaca('0x21')]]});}});}return request({'form':{'method':_0xeaca('0x24'),'input_type':'JSON','response_type':_0xeaca('0x25'),'rest_data':JSON['stringify']({'session':_0x49a4f3['id'],'module_name':_0xeaca('0x26'),'name_value_list':_0x36d31e})}});}function getAuth(_0x506627){return util['format'](_0xeaca('0x27'),new Buffer(_0x506627[_0xeaca('0x28')]+':X')[_0xeaca('0x29')](_0xeaca('0x2a')));}function getServerInfo(_0x23a511){return request({'form':{'method':_0xeaca('0x2b'),'input_type':'JSON','response_type':_0xeaca('0x25'),'rest_data':JSON[_0xeaca('0x2c')]({'session':_0x23a511['id']})}});}function getUser(_0xf5fd62,_0x1a4e31,_0x48e90d){if(!_[_0xeaca('0x2d')](_0x1a4e31)){logger[_0xeaca('0xc')](_0xeaca('0x2e'),_0x1a4e31);return request({'form':{'method':'get_entry_list','input_type':_0xeaca('0x25'),'response_type':'JSON','rest_data':JSON[_0xeaca('0x2c')]({'session':_0x48e90d['id'],'module_name':_0xeaca('0x2f'),'query':util[_0xeaca('0x30')](_0xeaca('0x31'),_0x1a4e31),'order_by':'','offset':'0','select_fields':['id',_0xeaca('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x40fc07){if(_0x40fc07[_0xeaca('0x32')]['length']){var _0x25a4bf=_[_0xeaca('0x33')](_0x40fc07[_0xeaca('0x32')],function(_0x4f0ffa){return _0x4f0ffa['name_value_list'][_0xeaca('0x34')][_0xeaca('0x35')]===_0x1a4e31;});if(_0x25a4bf){logger['info'](_0xeaca('0x36'));return BPromise[_0xeaca('0x37')]({'id':_0x25a4bf[_0xeaca('0x38')]['id']['value'],'name':_0x25a4bf['name_value_list']['name'][_0xeaca('0x35')]});}}logger[_0xeaca('0xc')](_0xeaca('0x39'));return BPromise[_0xeaca('0x37')]({'id':_0x48e90d['name_value_list'][_0xeaca('0x3a')][_0xeaca('0x35')],'name':_0x48e90d['name_value_list'][_0xeaca('0x34')]['value']});});}else{logger[_0xeaca('0xc')](_0xeaca('0x3b'));return BPromise[_0xeaca('0x37')]({'id':_0x48e90d['name_value_list'][_0xeaca('0x3a')][_0xeaca('0x35')],'name':_0x48e90d[_0xeaca('0x38')][_0xeaca('0x34')][_0xeaca('0x35')]});}}function getEndUser(_0x1d03e2,_0x76539c,_0xb2a79b,_0x41b4a6){logger[_0xeaca('0xc')](_0xeaca('0x3c'),_0xb2a79b);return request({'form':{'method':_0xeaca('0x3d'),'input_type':_0xeaca('0x25'),'response_type':_0xeaca('0x25'),'rest_data':JSON[_0xeaca('0x2c')]({'session':_0x41b4a6['id'],'module_name':'Contacts','query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0xb2a79b),'order_by':'','offset':'0','select_fields':['id',_0xeaca('0xe'),_0xeaca('0x3e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xeaca('0x3f')](function(_0x39da0e){if(_0x39da0e['entry_list'][_0xeaca('0x1f')]){var _0x5b5471=_['find'](_0x39da0e[_0xeaca('0x32')],function(_0x5c06a8){return _0x5c06a8[_0xeaca('0x38')][_0xeaca('0x3e')]['value']===_0xb2a79b;});if(_0x5b5471){logger[_0xeaca('0xc')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x5b5471[_0xeaca('0x38')]['id'][_0xeaca('0x35')],'name':_0x5b5471[_0xeaca('0x38')][_0xeaca('0xe')]['value'],'phone':_0x5b5471['name_value_list']['phone_home'][_0xeaca('0x35')]});}}else{logger[_0xeaca('0xc')](_0xeaca('0x40'));return request({'form':{'method':'set_entry','input_type':_0xeaca('0x25'),'response_type':'JSON','rest_data':JSON[_0xeaca('0x2c')]({'session':_0x41b4a6['id'],'module_name':_0xeaca('0x1c'),'name_value_list':[{'name':_0xeaca('0x41'),'value':_0x76539c!==_0xeaca('0x42')?_0x76539c:util['format'](_0xeaca('0x43'),_0xb2a79b)},{'name':_0xeaca('0x3e'),'value':_0xb2a79b}]})}})[_0xeaca('0x3f')](function(_0x48f9ff){logger['info'](_0xeaca('0x44'));return BPromise['resolve']({'id':_0x48f9ff['id'],'name':_0x48f9ff['entry_list'][_0xeaca('0x41')][_0xeaca('0x35')],'phone':_0x48f9ff[_0xeaca('0x32')][_0xeaca('0x3e')][_0xeaca('0x35')]});});}});}function request(_0x56cda2){logger[_0xeaca('0x45')]('[HTTP]',JSON[_0xeaca('0x2c')](_0x56cda2));return rp(_['merge'](def,_0x56cda2));}function getTags(_0x4ea6ee,_0x412da6){var _0x304e65=[];if(_0x4ea6ee&&_0x4ea6ee[_0xeaca('0x1f')]>0x0){_0x304e65=_[_0xeaca('0x46')](_0x4ea6ee,_0x412da6);}return _0x304e65;}function getCustomFields(_0x15edad,_0x26f3e9){var _0x11d706=[];var _0x437324={'custom_fields':[]};if(_0x15edad[_0xeaca('0x1f')]>0x0){_[_0xeaca('0x20')](_0x15edad,function(_0x42b023){if(_0x42b023[_0xeaca('0x47')]===_0xeaca('0x48')&&_0x42b023[_0xeaca('0x49')]&&!_0x42b023[_0xeaca('0x4a')]){_0x437324[_0x42b023['nameField'][_0xeaca('0x4b')]()]=_0x42b023[_0xeaca('0x4c')]['toString']();}else if(_0x42b023[_0xeaca('0x47')]===_0xeaca('0x48')&&_0x42b023[_0xeaca('0x23')]&&_0x42b023['customField']){_0x437324[_0xeaca('0x4d')][_0xeaca('0x22')]({'id':_0x42b023['idField'],'value':_0x42b023['content'][_0xeaca('0x29')]()});}else if(_0x42b023['type']===_0xeaca('0x4e')&&_0x42b023[_0xeaca('0x21')]&&_0x42b023[_0xeaca('0x23')]&&_0x42b023[_0xeaca('0x4a')]){_0x26f3e9[_0x42b023[_0xeaca('0x21')]]&&_0x437324[_0xeaca('0x4d')][_0xeaca('0x22')]({'id':_0x42b023['idField'],'value':_0x26f3e9[_0x42b023['variableName']][_0xeaca('0x29')]()});}else if(_0x42b023['type']==='customVariable'&&_0x42b023[_0xeaca('0x4f')]&&_0x42b023[_0xeaca('0x4f')][_0xeaca('0xe')]&&_0x42b023[_0xeaca('0x23')]&&_0x42b023[_0xeaca('0x4a')]){_0x26f3e9[_0x42b023[_0xeaca('0x4f')]['name'][_0xeaca('0x4b')]()]&&_0x437324[_0xeaca('0x4d')]['push']({'id':_0x42b023[_0xeaca('0x23')],'value':_0x26f3e9[_0x42b023[_0xeaca('0x4f')][_0xeaca('0xe')][_0xeaca('0x4b')]()][_0xeaca('0x29')]()});}});}return _0x437324;}function getConnection(_0x1b87e2){return request({'method':_0xeaca('0x50'),'form':{'method':_0xeaca('0x51'),'input_type':_0xeaca('0x25'),'response_type':_0xeaca('0x25'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1b87e2[_0xeaca('0x52')],'password':_0x1b87e2[_0xeaca('0x53')],'encryption':_0xeaca('0x54')},'application':_0xeaca('0x55')})}})[_0xeaca('0x3f')](function(_0x265d4a){var _0x4dedf1=_0x265d4a;if(_0x4dedf1['id']){def[_0xeaca('0x56')]=_0x4dedf1['id'];return BPromise[_0xeaca('0x37')](_0x4dedf1);}else{throw new Error(util['format'](_0xeaca('0x57'),_0x1b87e2['id']));}});}function setRelationship(_0x49c568,_0x39f973,_0x213566,_0x43bdce){return request({'form':{'method':_0xeaca('0x58'),'input_type':_0xeaca('0x25'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x49c568['id'],'module_name':_0xeaca('0x26'),'module_id':_0x213566['id'],'link_field_name':_0x43bdce,'related_ids':[_0x39f973['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xeaca('0x59')]=function(_0x4d039c,_0x386231,_0x5be27a,_0xa32ef,_0xacb9c8,_0x602ff2){var _0x273796,_0x4fcbf3,_0x1c8bde,_0x5af33d;_0x602ff2[_0xeaca('0x5a')]=intUtil[_0xeaca('0x5b')](_0x602ff2['remoteUri']);_0x602ff2[_0xeaca('0x5c')]=intUtil['stripTrailingSlash'](_0x602ff2[_0xeaca('0x5c')]);def[_0xeaca('0x5d')]=util[_0xeaca('0x30')](_0xeaca('0x5e'),_0x602ff2['remoteUri']);if(_0xacb9c8&&_0xacb9c8[_0xeaca('0x5f')]){logger[_0xeaca('0xc')]('[QUEUE]',_0xeaca('0x60'));_0x386231[_0xeaca('0x61')]=util['format'](_0xeaca('0x62'),_0x602ff2[_0xeaca('0x5c')],_0x386231[_0xeaca('0x63')],md5(_0x386231[_0xeaca('0x63')]));}else{_0x386231['recordingURL']='';}return getConnection(_0x602ff2)['then'](function(_0x149364){_0x5af33d=_0x149364;return getUser(_0x602ff2,_0xa32ef[_0xeaca('0xe')],_0x5af33d);})[_0xeaca('0x3f')](function(_0x2bad71){_0x273796=_0x2bad71;logger[_0xeaca('0xc')](_0xeaca('0x64'),_0x273796['id']);return getEndUser(_0x602ff2,_0x386231[_0xeaca('0x65')],_0x386231[_0xeaca('0x66')],_0x5af33d);})[_0xeaca('0x3f')](function(_0x5ba776){_0x4fcbf3=_0x5ba776;logger['info'](_0xeaca('0x67'),_0x4fcbf3['id']);return getTicket(_0x602ff2,_0x273796,_0x4fcbf3,_0x5be27a,_0x386231,_0x5be27a['Fields'],_0x5af33d,_0xeaca('0x68'));})[_0xeaca('0x3f')](function(_0x121307){_0x1c8bde=_0x121307;logger['info']('Ticket\x20created!');logger[_0xeaca('0xc')](_0xeaca('0x69'),_0x1c8bde['id']);return setRelationship(_0x5af33d,_0x273796,_0x1c8bde,_0xeaca('0x6a'));})['then'](function(){return setRelationship(_0x5af33d,_0x4fcbf3,_0x1c8bde,'contacts');})['then'](function(){return getServerInfo(_0x5af33d);})['then'](function(_0x1aa9d5){var _0x22bb72=parseInt(_0x1aa9d5['version'][_0xeaca('0x6b')](0x0));var _0x3d7230=util[_0xeaca('0x30')](_0xeaca('0x6c'),_0x602ff2[_0xeaca('0x5a')],_0x1c8bde['id']);if(_0x22bb72>0x6){_0x3d7230=util[_0xeaca('0x30')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x602ff2[_0xeaca('0x5a')],_0x1c8bde['id']);}logger[_0xeaca('0xc')](_0xeaca('0x6d'),_0xeaca('0x6e'));emit(util['format'](_0xeaca('0x6f'),_0xa32ef[_0xeaca('0xe')]),'trigger:browser:url',{'uri':_0x3d7230});})[_0xeaca('0x70')](function(_0x5e8085){logger[_0xeaca('0x71')]('[QUEUE]',JSON[_0xeaca('0x2c')](_0x5e8085));});};exports['outbound']=function(_0x20768c,_0x11fb94,_0xd75f01,_0x51f602,_0x15780f,_0x1bebdf,_0x27a676){var _0x195c32,_0x14c2f3,_0x57649c,_0x5385f1;_0x1bebdf['remoteUri']=intUtil[_0xeaca('0x5b')](_0x1bebdf[_0xeaca('0x5a')]);_0x1bebdf[_0xeaca('0x5c')]=intUtil[_0xeaca('0x5b')](_0x1bebdf[_0xeaca('0x5c')]);def['uri']=util[_0xeaca('0x30')](_0xeaca('0x5e'),_0x1bebdf[_0xeaca('0x5a')]);if(_0x27a676&&_0x27a676['recordingFormat']&&_0x27a676[_0xeaca('0x72')]!=='none'){logger['info']('[OUTBOUND]',_0xeaca('0x60'));_0x11fb94[_0xeaca('0x61')]=util[_0xeaca('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bebdf['serverUrl'],_0x11fb94[_0xeaca('0x63')],md5(_0x11fb94['uniqueid']));}return getConnection(_0x1bebdf)[_0xeaca('0x3f')](function(_0x4160a2){_0x5385f1=_0x4160a2;return getUser(_0x1bebdf,_0x51f602['name'],_0x5385f1);})[_0xeaca('0x3f')](function(_0x33fb94){_0x195c32=_0x33fb94;logger['info'](_0xeaca('0x64'),_0x195c32['id']);return getEndUser(_0x1bebdf,_0x11fb94[_0xeaca('0x73')],_0x11fb94[_0xeaca('0x74')],_0x5385f1);})['then'](function(_0x4ecddc){_0x14c2f3=_0x4ecddc;logger[_0xeaca('0xc')](_0xeaca('0x67'),_0x14c2f3['id']);return getTicket(_0x1bebdf,_0x195c32,_0x14c2f3,_0xd75f01,_0x11fb94,_0xd75f01[_0xeaca('0x75')],_0x5385f1,_0xeaca('0x76'));})[_0xeaca('0x3f')](function(_0x4426ce){_0x57649c=_0x4426ce;logger[_0xeaca('0xc')](_0xeaca('0x77'));logger[_0xeaca('0xc')]('The\x20Ticket\x20ID\x20is:',_0x57649c['id']);return setRelationship(_0x5385f1,_0x195c32,_0x57649c,_0xeaca('0x6a'));})[_0xeaca('0x3f')](function(){return setRelationship(_0x5385f1,_0x14c2f3,_0x57649c,_0xeaca('0x78'));})[_0xeaca('0x3f')](function(){return getServerInfo(_0x5385f1);})[_0xeaca('0x3f')](function(_0x4fa23e){var _0x3b50e4=parseInt(_0x4fa23e[_0xeaca('0x79')][_0xeaca('0x6b')](0x0));var _0x5f11ab=util[_0xeaca('0x30')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1bebdf[_0xeaca('0x5a')],_0x57649c['id']);if(_0x3b50e4>0x6){_0x5f11ab=util[_0xeaca('0x30')](_0xeaca('0x7a'),_0x1bebdf[_0xeaca('0x5a')],_0x57649c['id']);}logger['info'](_0xeaca('0x7b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xeaca('0x30')](_0xeaca('0x6f'),_0x51f602[_0xeaca('0xe')]),_0xeaca('0x7c'),{'uri':_0x5f11ab});})[_0xeaca('0x70')](function(_0x4df86c){logger[_0xeaca('0x71')](_0xeaca('0x7b'),JSON[_0xeaca('0x2c')](_0x4df86c));});};exports[_0xeaca('0x7d')]=function(_0x2c219a,_0x2904ff,_0xbd32af,_0x55c7ba,_0x564e80,_0x186493){var _0x5c47e3,_0x48e602,_0x350651,_0x567181;_0x186493[_0xeaca('0x5a')]=intUtil['stripTrailingSlash'](_0x186493[_0xeaca('0x5a')]);_0x186493['serverUrl']=intUtil[_0xeaca('0x5b')](_0x186493[_0xeaca('0x5c')]);def[_0xeaca('0x5d')]=util[_0xeaca('0x30')](_0xeaca('0x5e'),_0x186493[_0xeaca('0x5a')]);if(_0x564e80&&_0x564e80[_0xeaca('0x5f')]){logger[_0xeaca('0xc')]('['+_0x2904ff[_0xeaca('0x7e')][_0xeaca('0x7f')]()+']',_0xeaca('0x60'));_0x2904ff[_0xeaca('0x61')]=util[_0xeaca('0x30')](_0xeaca('0x62'),_0x186493[_0xeaca('0x5c')],_0x2904ff[_0xeaca('0x63')],md5(_0x2904ff['uniqueid']));}else{_0x2904ff[_0xeaca('0x61')]='';}return getConnection(_0x186493)[_0xeaca('0x3f')](function(_0x340aba){_0x567181=_0x340aba;if(!_['isNil'](_0x55c7ba)){return getUser(_0x186493,_0x55c7ba[_0xeaca('0xe')],_0x567181);}else{return getUser(_0x186493,null,_0x567181);}})[_0xeaca('0x3f')](function(_0x195db1){_0x5c47e3=_0x195db1;logger[_0xeaca('0xc')]('The\x20User\x20ID\x20is:',_0x5c47e3['id']);return getEndUser(_0x186493,_0x2904ff[_0xeaca('0x65')],_0x2904ff[_0xeaca('0x66')],_0x567181);})[_0xeaca('0x3f')](function(_0x484774){_0x48e602=_0x484774;logger[_0xeaca('0xc')](_0xeaca('0x67'),_0x48e602['id']);return getTicket(_0x186493,_0x5c47e3,_0x48e602,_0xbd32af,_0x2904ff,_0xbd32af[_0xeaca('0x75')],_0x567181,_0xeaca('0x68'));})['then'](function(_0x121d95){_0x350651=_0x121d95;logger['info'](_0xeaca('0x77'));logger[_0xeaca('0xc')](_0xeaca('0x69'),_0x350651['id']);return setRelationship(_0x567181,_0x5c47e3,_0x350651,_0xeaca('0x6a'));})[_0xeaca('0x3f')](function(){return setRelationship(_0x567181,_0x48e602,_0x350651,_0xeaca('0x78'));})['then'](function(){return getServerInfo(_0x567181);})[_0xeaca('0x70')](function(_0x40cca1){logger[_0xeaca('0x71')]('['+_0x2904ff[_0xeaca('0x7e')]['toUpperCase']()+']',JSON['stringify'](_0x40cca1));});};
\ No newline at end of file
index 3d06db4..2073e68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d0e=['push','content','variable','variableName','type','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy','string'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x3d0e,0xa9));var _0xe3d0=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x3d0e[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xe3d0('0x0'));exports[_0xe3d0('0x1')]=function(_0x4bef12,_0x5a9f15,_0x2423d0){var _0x40cbf5=[];if(_0x4bef12[_0xe3d0('0x2')]>0x0){var _0x885650=_[_0xe3d0('0x3')](_0x4bef12,['id']);for(var _0x569d5a=0x0;_0x569d5a<_0x885650[_0xe3d0('0x2')];_0x569d5a++){var _0x9b14bf=_0x885650[_0x569d5a];if(_0x9b14bf['type']===_0xe3d0('0x4')){_0x40cbf5[_0xe3d0('0x5')](_0x9b14bf[_0xe3d0('0x6')]);}else if(_0x9b14bf['type']===_0xe3d0('0x7')&&_0x9b14bf[_0xe3d0('0x8')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]&&_0x40cbf5['push'](_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]['toString']());}else if(_0x9b14bf[_0xe3d0('0x9')]===_0xe3d0('0xa')&&_0x9b14bf[_0xe3d0('0xb')]&&_0x9b14bf[_0xe3d0('0xb')][_0xe3d0('0xc')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0xb')]['name'][_0xe3d0('0xd')]()]&&_0x40cbf5['push'](_0x5a9f15[_0x9b14bf[_0xe3d0('0xb')][_0xe3d0('0xc')][_0xe3d0('0xd')]()][_0xe3d0('0xe')]());}else if(_0x9b14bf[_0xe3d0('0x9')]===_0xe3d0('0xf')){if(_0x9b14bf[_0xe3d0('0x10')]===_0xe3d0('0x4')&&_0x9b14bf[_0xe3d0('0x11')]){_0x40cbf5['push'](util[_0xe3d0('0x12')](_0xe3d0('0x13'),_0x9b14bf[_0xe3d0('0x11')],_0x9b14bf[_0xe3d0('0x14')]));}else if(_0x9b14bf[_0xe3d0('0x10')]===_0xe3d0('0x7')&&_0x9b14bf['variableName']&&_0x9b14bf[_0xe3d0('0x11')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]&&_0x40cbf5['push'](util[_0xe3d0('0x12')](_0xe3d0('0x13'),_0x9b14bf['key'],_0x5a9f15[_0x9b14bf[_0xe3d0('0x8')]]));}else if(_0x9b14bf[_0xe3d0('0x10')]==='customVariable'&&_0x9b14bf[_0xe3d0('0xb')]&&_0x9b14bf['Variable'][_0xe3d0('0xc')]&&_0x9b14bf[_0xe3d0('0x11')]){_0x5a9f15[_0x9b14bf[_0xe3d0('0xb')][_0xe3d0('0xc')][_0xe3d0('0xd')]()]&&_0x40cbf5[_0xe3d0('0x5')](util['format'](_0xe3d0('0x13'),_0x9b14bf[_0xe3d0('0x11')],_0x5a9f15[_0x9b14bf['Variable'][_0xe3d0('0xc')]['toLowerCase']()]));}}}}return _0x40cbf5[_0xe3d0('0x15')](_0x2423d0);};exports[_0xe3d0('0x16')]=function(_0xf7715c){var _0x58344=_0xf7715c[_0xe3d0('0x17')](-0x1);if(_0x58344==='/'){_0xf7715c=_0xf7715c[_0xe3d0('0x18')](0x0,_0xf7715c[_0xe3d0('0x19')](_0x58344));}return _0xf7715c;};exports[_0xe3d0('0x1a')]=function(_0x41205c){if(!_[_0xe3d0('0x1b')](_0x41205c)&&_0x41205c!==''){var _0x3460af=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x3460af[_0xe3d0('0x1c')](String(_0x41205c)[_0xe3d0('0xd')]());}else{return![];}};
\ No newline at end of file
+var _0x1472=['variableName','customVariable','Variable','name','toLowerCase','keyType','key','format','%s:\x20%s','keyContent','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','string','push','content','type','variable'];(function(_0x35de6c,_0x46bbcb){var _0x314f2d=function(_0x41a8e4){while(--_0x41a8e4){_0x35de6c['push'](_0x35de6c['shift']());}};_0x314f2d(++_0x46bbcb);}(_0x1472,0x1d3));var _0x2147=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x1472[_0x385eb1];return _0x5d40eb;};'use strict';var _=require(_0x2147('0x0'));var util=require(_0x2147('0x1'));exports['getString']=function(_0x1e76da,_0x1acf3f,_0x56522f){var _0x16e849=[];if(_0x1e76da[_0x2147('0x2')]>0x0){var _0xd76080=_['sortBy'](_0x1e76da,['id']);for(var _0x48464b=0x0;_0x48464b<_0xd76080[_0x2147('0x2')];_0x48464b++){var _0x3fde9f=_0xd76080[_0x48464b];if(_0x3fde9f['type']===_0x2147('0x3')){_0x16e849[_0x2147('0x4')](_0x3fde9f[_0x2147('0x5')]);}else if(_0x3fde9f[_0x2147('0x6')]===_0x2147('0x7')&&_0x3fde9f[_0x2147('0x8')]){_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]&&_0x16e849[_0x2147('0x4')](_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]['toString']());}else if(_0x3fde9f[_0x2147('0x6')]===_0x2147('0x9')&&_0x3fde9f['Variable']&&_0x3fde9f[_0x2147('0xa')][_0x2147('0xb')]){_0x1acf3f[_0x3fde9f['Variable'][_0x2147('0xb')][_0x2147('0xc')]()]&&_0x16e849['push'](_0x1acf3f[_0x3fde9f['Variable']['name'][_0x2147('0xc')]()]['toString']());}else if(_0x3fde9f[_0x2147('0x6')]==='keyValue'){if(_0x3fde9f[_0x2147('0xd')]==='string'&&_0x3fde9f[_0x2147('0xe')]){_0x16e849[_0x2147('0x4')](util[_0x2147('0xf')](_0x2147('0x10'),_0x3fde9f['key'],_0x3fde9f[_0x2147('0x11')]));}else if(_0x3fde9f['keyType']===_0x2147('0x7')&&_0x3fde9f[_0x2147('0x8')]&&_0x3fde9f[_0x2147('0xe')]){_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]&&_0x16e849[_0x2147('0x4')](util['format']('%s:\x20%s',_0x3fde9f[_0x2147('0xe')],_0x1acf3f[_0x3fde9f[_0x2147('0x8')]]));}else if(_0x3fde9f[_0x2147('0xd')]===_0x2147('0x9')&&_0x3fde9f[_0x2147('0xa')]&&_0x3fde9f['Variable'][_0x2147('0xb')]&&_0x3fde9f[_0x2147('0xe')]){_0x1acf3f[_0x3fde9f[_0x2147('0xa')][_0x2147('0xb')]['toLowerCase']()]&&_0x16e849[_0x2147('0x4')](util[_0x2147('0xf')](_0x2147('0x10'),_0x3fde9f[_0x2147('0xe')],_0x1acf3f[_0x3fde9f[_0x2147('0xa')]['name']['toLowerCase']()]));}}}}return _0x16e849[_0x2147('0x12')](_0x56522f);};exports['stripTrailingSlash']=function(_0x4d820b){var _0x4999d1=_0x4d820b[_0x2147('0x13')](-0x1);if(_0x4999d1==='/'){_0x4d820b=_0x4d820b[_0x2147('0x14')](0x0,_0x4d820b[_0x2147('0x15')](_0x4999d1));}return _0x4d820b;};exports[_0x2147('0x16')]=function(_0x428743){if(!_[_0x2147('0x17')](_0x428743)&&_0x428743!==''){var _0x28459c=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x28459c[_0x2147('0x18')](String(_0x428743)[_0x2147('0xc')]());}else{return![];}};
\ No newline at end of file
index 3974387..a060b13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
+var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x3cdb38,_0x402ef1){var _0x558522=function(_0x47f069){while(--_0x47f069){_0x3cdb38['push'](_0x3cdb38['shift']());}};_0x558522(++_0x402ef1);}(_0x34e8,0x12c));var _0x834e=function(_0x1a89d4,_0x4867df){_0x1a89d4=_0x1a89d4-0x0;var _0x59ae77=_0x34e8[_0x1a89d4];return _0x59ae77;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});};
\ No newline at end of file
index e459f76..097b831 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf066=['content','push','variable','variableName','idField','custom_fields','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','[HTTP]','GET','map','includes','string','picklist','type','customField','toLowerCase'];(function(_0x3e5f6e,_0x415244){var _0x3ba20e=function(_0x2cccc5){while(--_0x2cccc5){_0x3e5f6e['push'](_0x3e5f6e['shift']());}};_0x3ba20e(++_0x415244);}(_0xf066,0x169));var _0x6f06=function(_0x955747,_0xd1ab29){_0x955747=_0x955747-0x0;var _0x3ff6d5=_0xf066[_0x955747];return _0x3ff6d5;};'use strict';var _=require(_0x6f06('0x0'));var rp=require(_0x6f06('0x1'));var md5=require(_0x6f06('0x2'));var util=require('util');var Redis=require(_0x6f06('0x3'));var intUtil=require('./util');var config=require(_0x6f06('0x4'));var logger=require(_0x6f06('0x5'))('zendesk');config[_0x6f06('0x6')]=_[_0x6f06('0x7')](config[_0x6f06('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f06('0x6')]));function emit(_0x34c25d,_0xf2eee6,_0x3e8eff){io['to'](_0x34c25d)['emit'](_0xf2eee6,_0x3e8eff);}var headers={'Content-Type':'application/json','Accept':_0x6f06('0x8')};function getTicket(_0x17dba5,_0x189c81,_0x44d4b8,_0xcdb556,_0xe8820b){logger[_0x6f06('0x9')](_0x6f06('0xa'));return request({'uri':util['format'](_0x6f06('0xb'),_0x17dba5[_0x6f06('0xc')]),'method':'POST','body':{'ticket':_[_0x6f06('0xd')]({'requester_id':_0x44d4b8['id'],'submitter_id':_0x189c81?_0x189c81['id']:undefined,'assignee_id':_0x189c81?_0x189c81['id']:undefined,'tags':getTags(_0xcdb556[_0x6f06('0xe')],_0x6f06('0xf')),'subject':intUtil[_0x6f06('0x10')](_0xcdb556[_0x6f06('0x11')],_0xe8820b,'\x20'),'description':intUtil['getString'](_0xcdb556[_0x6f06('0x12')],_0xe8820b,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6f06('0x10')](_0xcdb556['Descriptions'],_0xe8820b,'\x0a')}},getCustomFields(_0xcdb556[_0x6f06('0x13')],_0xe8820b))}})[_0x6f06('0x14')](function(_0x4563be){logger[_0x6f06('0x9')]('Ticket\x20created!');return _0x4563be['ticket'];});}function getUser(_0x51a319,_0x5a4db6){if(intUtil[_0x6f06('0x15')](_0x5a4db6)){logger[_0x6f06('0x9')](_0x6f06('0x16'),_0x5a4db6);return request({'uri':util[_0x6f06('0x17')](_0x6f06('0x18'),_0x51a319['remoteUri']),'qs':{'query':util[_0x6f06('0x17')](_0x6f06('0x19'),_0x5a4db6)}})[_0x6f06('0x14')](function(_0xc2adbe){if(_0xc2adbe[_0x6f06('0x1a')]){logger[_0x6f06('0x9')]('Agent\x20found!');return _[_0x6f06('0x1b')](_0xc2adbe[_0x6f06('0x1c')],{'email':_0x5a4db6,'role':'agent'});}else{logger[_0x6f06('0x9')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x6f06('0x1d'),_0x51a319[_0x6f06('0xc')])})[_0x6f06('0x14')](function(_0x22dba8){logger[_0x6f06('0x9')](_0x6f06('0x1e'));return _0x22dba8[_0x6f06('0x1f')];});}});}else{logger[_0x6f06('0x9')](_0x6f06('0x20'));return request({'uri':util['format'](_0x6f06('0x1d'),_0x51a319[_0x6f06('0xc')])})['then'](function(_0x304c11){logger[_0x6f06('0x9')](_0x6f06('0x1e'));return _0x304c11[_0x6f06('0x1f')];});}}function getEndUser(_0x184da3,_0x38f3d7,_0x2cecff){logger[_0x6f06('0x9')]('Searching\x20enduser\x20with\x20phone',_0x2cecff);return request({'uri':util['format'](_0x6f06('0x18'),_0x184da3[_0x6f06('0xc')]),'qs':{'query':util[_0x6f06('0x17')](_0x6f06('0x21'),_0x2cecff)}})[_0x6f06('0x14')](function(_0x174ecf){var _0x345f68;if(_0x174ecf[_0x6f06('0x1c')]['length']){_0x174ecf[_0x6f06('0x1c')]=_[_0x6f06('0x22')](_0x174ecf[_0x6f06('0x1c')],{'suspended':![],'role':_0x6f06('0x23')});if(_0x174ecf[_0x6f06('0x1c')][_0x6f06('0x24')]){_0x345f68=_['first'](_0x174ecf[_0x6f06('0x1c')]);}}if(_0x345f68){logger[_0x6f06('0x9')](_0x6f06('0x25'));return _0x345f68;}else{logger[_0x6f06('0x9')](_0x6f06('0x26'));return request({'uri':util[_0x6f06('0x17')](_0x6f06('0x27'),_0x184da3['remoteUri']),'method':_0x6f06('0x28'),'body':{'user':{'role':_0x6f06('0x23'),'name':util[_0x6f06('0x17')](_0x6f06('0x29'),_0x38f3d7||_0x2cecff),'phone':_0x2cecff}}})['then'](function(_0x3a599e){logger[_0x6f06('0x9')](_0x6f06('0x2a'));return _0x3a599e[_0x6f06('0x1f')];});}});}function getAuth(_0xb2eaf4){var _0x3703ae;if(_0xb2eaf4[_0x6f06('0x2b')]===_0x6f06('0x2c')){_0x3703ae=util[_0x6f06('0x17')](_0x6f06('0x2d'),_0xb2eaf4[_0x6f06('0x2e')],_0xb2eaf4[_0x6f06('0x2c')]);}else if(_0xb2eaf4[_0x6f06('0x2b')]===_0x6f06('0x2f')){_0x3703ae=util['format']('%s/token:%s',_0xb2eaf4[_0x6f06('0x2e')],_0xb2eaf4[_0x6f06('0x2f')]);}return util[_0x6f06('0x17')](_0x6f06('0x30'),new Buffer(_0x3703ae)[_0x6f06('0x31')]('base64'));}function request(_0x19e9b5){logger['debug'](_0x6f06('0x32'),JSON['stringify'](_0x19e9b5));return rp(_[_0x6f06('0x7')](_0x19e9b5,{'method':_0x6f06('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x416387,_0x43acab){var _0x46fa39=[];if(_0x416387&&_0x416387['length']>0x0){_0x46fa39=_[_0x6f06('0x34')](_0x416387,_0x43acab);}return _0x46fa39;}function getCustomFields(_0x4e105e,_0x2afe92){var _0xc33e79=[];var _0x53f69f={'custom_fields':[]};if(_0x4e105e[_0x6f06('0x24')]>0x0){_['forEach'](_0x4e105e,function(_0x57b9d3){if(_[_0x6f06('0x35')]([_0x6f06('0x36'),_0x6f06('0x37')],_0x57b9d3[_0x6f06('0x38')])&&_0x57b9d3['nameField']&&!_0x57b9d3[_0x6f06('0x39')]){_0x53f69f[_0x57b9d3['nameField'][_0x6f06('0x3a')]()]=_0x57b9d3[_0x6f06('0x3b')]['toString']();}else if(_[_0x6f06('0x35')]([_0x6f06('0x36'),_0x6f06('0x37')],_0x57b9d3[_0x6f06('0x38')])&&_0x57b9d3['idField']&&_0x57b9d3[_0x6f06('0x39')]){_0x53f69f['custom_fields'][_0x6f06('0x3c')]({'id':_0x57b9d3['idField'],'value':_0x57b9d3[_0x6f06('0x3b')][_0x6f06('0x31')]()});}else if(_0x57b9d3[_0x6f06('0x38')]===_0x6f06('0x3d')&&_0x57b9d3[_0x6f06('0x3e')]&&_0x57b9d3[_0x6f06('0x3f')]&&_0x57b9d3[_0x6f06('0x39')]){_0x2afe92[_0x57b9d3[_0x6f06('0x3e')]]&&_0x53f69f[_0x6f06('0x40')][_0x6f06('0x3c')]({'id':_0x57b9d3[_0x6f06('0x3f')],'value':_0x2afe92[_0x57b9d3['variableName']]['toString']()});}else if(_0x57b9d3[_0x6f06('0x38')]===_0x6f06('0x41')&&_0x57b9d3['Variable']&&_0x57b9d3['Variable'][_0x6f06('0xf')]&&_0x57b9d3[_0x6f06('0x3f')]&&_0x57b9d3[_0x6f06('0x39')]){_0x2afe92[_0x57b9d3['Variable']['name'][_0x6f06('0x3a')]()]&&_0x53f69f[_0x6f06('0x40')][_0x6f06('0x3c')]({'id':_0x57b9d3[_0x6f06('0x3f')],'value':_0x2afe92[_0x57b9d3[_0x6f06('0x42')][_0x6f06('0xf')][_0x6f06('0x3a')]()][_0x6f06('0x31')]()});}});}return _0x53f69f;}exports[_0x6f06('0x43')]=function(_0x4df8fb,_0x2cbc38,_0x2ffbab,_0x592879,_0x2b0199,_0x32e309){var _0x4162e0,_0x39450e;_0x32e309['remoteUri']=intUtil[_0x6f06('0x44')](_0x32e309[_0x6f06('0xc')]);_0x32e309[_0x6f06('0x45')]=intUtil[_0x6f06('0x44')](_0x32e309[_0x6f06('0x45')]);if(_0x2b0199&&_0x2b0199['monitor_format']){logger[_0x6f06('0x9')](_0x6f06('0x46'),'Recording\x20is\x20enabled!');_0x2cbc38[_0x6f06('0x47')]=util[_0x6f06('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x32e309[_0x6f06('0x45')],_0x2cbc38['uniqueid'],md5(_0x2cbc38[_0x6f06('0x48')]));}else{_0x2cbc38[_0x6f06('0x47')]='';}headers[_0x6f06('0x49')]=getAuth(_0x32e309);return getUser(_0x32e309,_0x592879[_0x6f06('0x4a')])[_0x6f06('0x14')](function(_0x4e9da2){_0x4162e0=_0x4e9da2;logger['info'](_0x6f06('0x4b'),_0x4162e0['id']);return getEndUser(_0x32e309,_0x2cbc38['calleridname'],_0x2cbc38['calleridnum']);})[_0x6f06('0x14')](function(_0x7b77f8){_0x39450e=_0x7b77f8;logger[_0x6f06('0x9')](_0x6f06('0x4c'),_0x39450e['id']);return getTicket(_0x32e309,_0x4162e0,_0x39450e,_0x2ffbab,_0x2cbc38);})['then'](function(_0x513a65){if(_0x513a65){logger[_0x6f06('0x9')]('The\x20Ticket\x20ID\x20is:',_0x513a65['id']);switch(_0x32e309[_0x6f06('0x38')]){case _0x6f06('0x4d'):logger[_0x6f06('0x9')](_0x6f06('0x46'),_0x6f06('0x4e'));return request({'uri':util[_0x6f06('0x17')](_0x6f06('0x4f'),_0x32e309['remoteUri'],_0x4162e0['id'],_0x513a65['id']),'method':'POST'});case _0x6f06('0x50'):logger[_0x6f06('0x9')](_0x6f06('0x46'),_0x6f06('0x51'));emit(util[_0x6f06('0x17')]('user:%s',_0x592879[_0x6f06('0xf')]),_0x6f06('0x52'),{'uri':util[_0x6f06('0x17')](_0x6f06('0x53'),_0x32e309[_0x6f06('0xc')][_0x6f06('0x54')]('/api/v2',''),_0x513a65['id'])});break;default:logger[_0x6f06('0x55')](_0x6f06('0x46'),_0x6f06('0x56'));}}})[_0x6f06('0x57')](function(_0x6873c){logger[_0x6f06('0x55')](_0x6f06('0x58'),util[_0x6f06('0x59')](_0x6873c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x372b47,_0x3c6632,_0x292d43,_0x2728e7,_0x2ee51f,_0x28536b,_0x286d3a){var _0x1536dd,_0x3adad0;_0x28536b[_0x6f06('0xc')]=intUtil['stripTrailingSlash'](_0x28536b[_0x6f06('0xc')]);_0x28536b[_0x6f06('0x45')]=intUtil[_0x6f06('0x44')](_0x28536b[_0x6f06('0x45')]);if(_0x286d3a&&_0x286d3a[_0x6f06('0x5a')]&&_0x286d3a[_0x6f06('0x5a')]!==_0x6f06('0x5b')){logger['info'](_0x6f06('0x5c'),'Recording\x20is\x20enabled!');_0x3c6632[_0x6f06('0x47')]=util[_0x6f06('0x17')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x28536b[_0x6f06('0x45')],_0x3c6632[_0x6f06('0x48')],md5(_0x3c6632[_0x6f06('0x48')]));}headers[_0x6f06('0x49')]=getAuth(_0x28536b);return getUser(_0x28536b,_0x2728e7['email'])['then'](function(_0x1e6feb){_0x1536dd=_0x1e6feb;logger[_0x6f06('0x9')](_0x6f06('0x4b'),_0x1536dd['id']);return getEndUser(_0x28536b,_0x3c6632[_0x6f06('0x5d')],_0x3c6632[_0x6f06('0x5e')]);})['then'](function(_0x386841){_0x3adad0=_0x386841;logger[_0x6f06('0x9')]('The\x20Enduser\x20ID\x20is:',_0x3adad0['id']);return getTicket(_0x28536b,_0x1536dd,_0x3adad0,_0x292d43,_0x3c6632);})[_0x6f06('0x14')](function(_0x381e97){if(_0x381e97){logger['info'](_0x6f06('0x5f'),_0x381e97['id']);switch(_0x28536b[_0x6f06('0x38')]){case _0x6f06('0x4d'):logger[_0x6f06('0x9')](_0x6f06('0x5c'),_0x6f06('0x4e'));return request({'uri':util[_0x6f06('0x17')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x28536b['remoteUri'],_0x1536dd['id'],_0x381e97['id']),'method':'POST'});case _0x6f06('0x50'):logger[_0x6f06('0x9')](_0x6f06('0x5c'),_0x6f06('0x51'));emit(util[_0x6f06('0x17')](_0x6f06('0x60'),_0x2728e7[_0x6f06('0xf')]),_0x6f06('0x52'),{'uri':util['format'](_0x6f06('0x53'),_0x28536b[_0x6f06('0xc')][_0x6f06('0x54')](_0x6f06('0x61'),''),_0x381e97['id'])});break;default:logger['error'](_0x6f06('0x5c'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x6f06('0x57')](function(_0x22f293){logger[_0x6f06('0x55')](_0x6f06('0x62'),util[_0x6f06('0x59')](_0x22f293,{'showHidden':!![],'depth':null}));});};exports[_0x6f06('0x63')]=function(_0x6680b1,_0x250a30,_0x2bf2ec,_0x48a3b0,_0x19b68a,_0x3a8ccd){var _0x5866b3,_0x5c3fdb;_0x3a8ccd['remoteUri']=intUtil[_0x6f06('0x44')](_0x3a8ccd[_0x6f06('0xc')]);_0x3a8ccd['serverUrl']=intUtil[_0x6f06('0x44')](_0x3a8ccd[_0x6f06('0x45')]);if(_0x19b68a&&_0x19b68a[_0x6f06('0x64')]){logger['info']('['+_0x250a30[_0x6f06('0x65')][_0x6f06('0x66')]()+']','Recording\x20is\x20enabled!');_0x250a30[_0x6f06('0x47')]=util['format'](_0x6f06('0x67'),_0x3a8ccd[_0x6f06('0x45')],_0x250a30[_0x6f06('0x48')],md5(_0x250a30['uniqueid']));}else{_0x250a30[_0x6f06('0x47')]='';}headers[_0x6f06('0x49')]=getAuth(_0x3a8ccd);return getUser(_0x3a8ccd)[_0x6f06('0x14')](function(_0x4d7cb1){_0x5866b3=_0x4d7cb1;logger[_0x6f06('0x9')](_0x6f06('0x4b'),_0x5866b3['id']);return getEndUser(_0x3a8ccd,_0x250a30['calleridname'],_0x250a30[_0x6f06('0x68')]);})['then'](function(_0x472060){_0x5c3fdb=_0x472060;logger[_0x6f06('0x9')](_0x6f06('0x4c'),_0x5c3fdb['id']);return getTicket(_0x3a8ccd,_0x5866b3,_0x5c3fdb,_0x2bf2ec,_0x250a30);})[_0x6f06('0x14')](function(_0x252863){if(_0x252863){logger[_0x6f06('0x9')](_0x6f06('0x5f'),_0x252863['id']);}})[_0x6f06('0x57')](function(_0x3305f1){logger['error']('['+_0x250a30[_0x6f06('0x65')][_0x6f06('0x66')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x6f06('0x59')](_0x3305f1,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xde53=['custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','info','format','%s/tickets.json','remoteUri','POST','merge','name','getString','Descriptions','Ticket\x20created!','ticket','validateEmail','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','%s/search.json','length','%s/users.json','end-user','Enduser\x20created.','authType','password','username','token','%s/token:%s','Basic\x20%s','base64','[HTTP]','stringify','GET','map','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField'];(function(_0x9d6369,_0xc84bae){var _0x3e1aff=function(_0x179fb1){while(--_0x179fb1){_0x9d6369['push'](_0x9d6369['shift']());}};_0x3e1aff(++_0xc84bae);}(_0xde53,0x1da));var _0x3de5=function(_0xc8148,_0x5a54e7){_0xc8148=_0xc8148-0x0;var _0xf94e19=_0xde53[_0xc8148];return _0xf94e19;};'use strict';var _=require(_0x3de5('0x0'));var rp=require('request-promise');var md5=require(_0x3de5('0x1'));var util=require(_0x3de5('0x2'));var Redis=require(_0x3de5('0x3'));var intUtil=require(_0x3de5('0x4'));var config=require(_0x3de5('0x5'));var logger=require(_0x3de5('0x6'))(_0x3de5('0x7'));config[_0x3de5('0x8')]=_[_0x3de5('0x9')](config[_0x3de5('0x8')],{'host':_0x3de5('0xa'),'port':0x18eb});var io=require(_0x3de5('0xb'))(new Redis(config[_0x3de5('0x8')]));function emit(_0x4c9e02,_0x33fabc,_0x4b4df5){io['to'](_0x4c9e02)['emit'](_0x33fabc,_0x4b4df5);}var headers={'Content-Type':_0x3de5('0xc'),'Accept':_0x3de5('0xc')};function getTicket(_0x41dda0,_0x4e6a54,_0x4b3ec0,_0xf5cb6f,_0x3d5fb6){logger[_0x3de5('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x3de5('0xe')](_0x3de5('0xf'),_0x41dda0[_0x3de5('0x10')]),'method':_0x3de5('0x11'),'body':{'ticket':_[_0x3de5('0x12')]({'requester_id':_0x4b3ec0['id'],'submitter_id':_0x4e6a54?_0x4e6a54['id']:undefined,'assignee_id':_0x4e6a54?_0x4e6a54['id']:undefined,'tags':getTags(_0xf5cb6f['Tags'],_0x3de5('0x13')),'subject':intUtil[_0x3de5('0x14')](_0xf5cb6f['Subjects'],_0x3d5fb6,'\x20'),'description':intUtil['getString'](_0xf5cb6f[_0x3de5('0x15')],_0x3d5fb6,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3de5('0x14')](_0xf5cb6f[_0x3de5('0x15')],_0x3d5fb6,'\x0a')}},getCustomFields(_0xf5cb6f['Fields'],_0x3d5fb6))}})['then'](function(_0x18bbc0){logger[_0x3de5('0xd')](_0x3de5('0x16'));return _0x18bbc0[_0x3de5('0x17')];});}function getUser(_0x20f5e5,_0x51d3d7){if(intUtil[_0x3de5('0x18')](_0x51d3d7)){logger[_0x3de5('0xd')]('Getting\x20agent\x20with\x20email',_0x51d3d7);return request({'uri':util[_0x3de5('0xe')]('%s/search.json',_0x20f5e5[_0x3de5('0x10')]),'qs':{'query':util[_0x3de5('0xe')](_0x3de5('0x19'),_0x51d3d7)}})[_0x3de5('0x1a')](function(_0x1e7c24){if(_0x1e7c24[_0x3de5('0x1b')]){logger[_0x3de5('0xd')](_0x3de5('0x1c'));return _[_0x3de5('0x1d')](_0x1e7c24[_0x3de5('0x1e')],{'email':_0x51d3d7,'role':'agent'});}else{logger[_0x3de5('0xd')](_0x3de5('0x1f'));return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x20'),_0x20f5e5[_0x3de5('0x10')])})[_0x3de5('0x1a')](function(_0x5550cf){logger['info'](_0x3de5('0x21'));return _0x5550cf['user'];});}});}else{logger[_0x3de5('0xd')](_0x3de5('0x1f'));return request({'uri':util['format'](_0x3de5('0x20'),_0x20f5e5[_0x3de5('0x10')])})['then'](function(_0x27fa9a){logger[_0x3de5('0xd')](_0x3de5('0x21'));return _0x27fa9a[_0x3de5('0x22')];});}}function getEndUser(_0x4f71ab,_0xd75bfd,_0x11b54b){logger[_0x3de5('0xd')](_0x3de5('0x23'),_0x11b54b);return request({'uri':util['format'](_0x3de5('0x24'),_0x4f71ab[_0x3de5('0x10')]),'qs':{'query':util[_0x3de5('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x11b54b)}})[_0x3de5('0x1a')](function(_0x444b2c){var _0x40ef4a;if(_0x444b2c[_0x3de5('0x1e')]['length']){_0x444b2c[_0x3de5('0x1e')]=_['filter'](_0x444b2c[_0x3de5('0x1e')],{'suspended':![],'role':'end-user'});if(_0x444b2c[_0x3de5('0x1e')][_0x3de5('0x25')]){_0x40ef4a=_['first'](_0x444b2c['results']);}}if(_0x40ef4a){logger[_0x3de5('0xd')]('Enduser\x20found!');return _0x40ef4a;}else{logger[_0x3de5('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x26'),_0x4f71ab[_0x3de5('0x10')]),'method':'POST','body':{'user':{'role':_0x3de5('0x27'),'name':util['format']('Caller\x20-\x20%s',_0xd75bfd||_0x11b54b),'phone':_0x11b54b}}})[_0x3de5('0x1a')](function(_0xa51487){logger[_0x3de5('0xd')](_0x3de5('0x28'));return _0xa51487[_0x3de5('0x22')];});}});}function getAuth(_0x545a10){var _0x501a0d;if(_0x545a10[_0x3de5('0x29')]===_0x3de5('0x2a')){_0x501a0d=util[_0x3de5('0xe')]('%s:%s',_0x545a10[_0x3de5('0x2b')],_0x545a10[_0x3de5('0x2a')]);}else if(_0x545a10[_0x3de5('0x29')]===_0x3de5('0x2c')){_0x501a0d=util[_0x3de5('0xe')](_0x3de5('0x2d'),_0x545a10[_0x3de5('0x2b')],_0x545a10['token']);}return util['format'](_0x3de5('0x2e'),new Buffer(_0x501a0d)['toString'](_0x3de5('0x2f')));}function request(_0x1e2bcd){logger['debug'](_0x3de5('0x30'),JSON[_0x3de5('0x31')](_0x1e2bcd));return rp(_[_0x3de5('0x9')](_0x1e2bcd,{'method':_0x3de5('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x4b8bca,_0xdeae51){var _0x38a41f=[];if(_0x4b8bca&&_0x4b8bca['length']>0x0){_0x38a41f=_[_0x3de5('0x33')](_0x4b8bca,_0xdeae51);}return _0x38a41f;}function getCustomFields(_0x101d97,_0x3a8877){var _0xcc43d1=[];var _0x44c26c={'custom_fields':[]};if(_0x101d97[_0x3de5('0x25')]>0x0){_['forEach'](_0x101d97,function(_0x451c0b){if(_['includes']([_0x3de5('0x34'),_0x3de5('0x35')],_0x451c0b[_0x3de5('0x36')])&&_0x451c0b['nameField']&&!_0x451c0b['customField']){_0x44c26c[_0x451c0b[_0x3de5('0x37')][_0x3de5('0x38')]()]=_0x451c0b[_0x3de5('0x39')][_0x3de5('0x3a')]();}else if(_['includes']([_0x3de5('0x34'),_0x3de5('0x35')],_0x451c0b[_0x3de5('0x36')])&&_0x451c0b[_0x3de5('0x3b')]&&_0x451c0b[_0x3de5('0x3c')]){_0x44c26c[_0x3de5('0x3d')][_0x3de5('0x3e')]({'id':_0x451c0b['idField'],'value':_0x451c0b[_0x3de5('0x39')][_0x3de5('0x3a')]()});}else if(_0x451c0b[_0x3de5('0x36')]==='variable'&&_0x451c0b['variableName']&&_0x451c0b[_0x3de5('0x3b')]&&_0x451c0b[_0x3de5('0x3c')]){_0x3a8877[_0x451c0b[_0x3de5('0x3f')]]&&_0x44c26c[_0x3de5('0x3d')][_0x3de5('0x3e')]({'id':_0x451c0b[_0x3de5('0x3b')],'value':_0x3a8877[_0x451c0b['variableName']][_0x3de5('0x3a')]()});}else if(_0x451c0b[_0x3de5('0x36')]===_0x3de5('0x40')&&_0x451c0b[_0x3de5('0x41')]&&_0x451c0b[_0x3de5('0x41')][_0x3de5('0x13')]&&_0x451c0b[_0x3de5('0x3b')]&&_0x451c0b[_0x3de5('0x3c')]){_0x3a8877[_0x451c0b['Variable']['name'][_0x3de5('0x38')]()]&&_0x44c26c[_0x3de5('0x3d')][_0x3de5('0x3e')]({'id':_0x451c0b[_0x3de5('0x3b')],'value':_0x3a8877[_0x451c0b[_0x3de5('0x41')][_0x3de5('0x13')]['toLowerCase']()][_0x3de5('0x3a')]()});}});}return _0x44c26c;}exports[_0x3de5('0x42')]=function(_0x4e3b78,_0x752ee2,_0x50eaa0,_0x45b9f4,_0x921adb,_0x597515){var _0xb4e029,_0x2848b0;_0x597515['remoteUri']=intUtil[_0x3de5('0x43')](_0x597515[_0x3de5('0x10')]);_0x597515[_0x3de5('0x44')]=intUtil[_0x3de5('0x43')](_0x597515[_0x3de5('0x44')]);if(_0x921adb&&_0x921adb[_0x3de5('0x45')]){logger['info'](_0x3de5('0x46'),_0x3de5('0x47'));_0x752ee2[_0x3de5('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x597515[_0x3de5('0x44')],_0x752ee2[_0x3de5('0x49')],md5(_0x752ee2[_0x3de5('0x49')]));}else{_0x752ee2['recordingURL']='';}headers[_0x3de5('0x4a')]=getAuth(_0x597515);return getUser(_0x597515,_0x45b9f4[_0x3de5('0x4b')])[_0x3de5('0x1a')](function(_0x506960){_0xb4e029=_0x506960;logger[_0x3de5('0xd')](_0x3de5('0x4c'),_0xb4e029['id']);return getEndUser(_0x597515,_0x752ee2[_0x3de5('0x4d')],_0x752ee2['calleridnum']);})[_0x3de5('0x1a')](function(_0x487595){_0x2848b0=_0x487595;logger[_0x3de5('0xd')](_0x3de5('0x4e'),_0x2848b0['id']);return getTicket(_0x597515,_0xb4e029,_0x2848b0,_0x50eaa0,_0x752ee2);})[_0x3de5('0x1a')](function(_0x5743c1){if(_0x5743c1){logger[_0x3de5('0xd')](_0x3de5('0x4f'),_0x5743c1['id']);switch(_0x597515['type']){case _0x3de5('0x50'):logger[_0x3de5('0xd')]('[QUEUE]',_0x3de5('0x51'));return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x52'),_0x597515['remoteUri'],_0xb4e029['id'],_0x5743c1['id']),'method':_0x3de5('0x11')});case'newTab':logger[_0x3de5('0xd')](_0x3de5('0x46'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3de5('0xe')]('user:%s',_0x45b9f4[_0x3de5('0x13')]),_0x3de5('0x53'),{'uri':util[_0x3de5('0xe')]('%s/agent/tickets/%s',_0x597515[_0x3de5('0x10')][_0x3de5('0x54')]('/api/v2',''),_0x5743c1['id'])});break;default:logger[_0x3de5('0x55')](_0x3de5('0x46'),_0x3de5('0x56'));}}})[_0x3de5('0x57')](function(_0x2c70f4){logger[_0x3de5('0x55')](_0x3de5('0x58'),util[_0x3de5('0x59')](_0x2c70f4,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x41adf5,_0x142569,_0x292122,_0x33e57e,_0x56587a,_0x62fc10,_0x3c3aa4){var _0x3546c7,_0x345cb4;_0x62fc10[_0x3de5('0x10')]=intUtil[_0x3de5('0x43')](_0x62fc10[_0x3de5('0x10')]);_0x62fc10[_0x3de5('0x44')]=intUtil[_0x3de5('0x43')](_0x62fc10[_0x3de5('0x44')]);if(_0x3c3aa4&&_0x3c3aa4[_0x3de5('0x5a')]&&_0x3c3aa4[_0x3de5('0x5a')]!==_0x3de5('0x5b')){logger[_0x3de5('0xd')]('[OUTBOUND]',_0x3de5('0x47'));_0x142569[_0x3de5('0x48')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x62fc10[_0x3de5('0x44')],_0x142569[_0x3de5('0x49')],md5(_0x142569[_0x3de5('0x49')]));}headers[_0x3de5('0x4a')]=getAuth(_0x62fc10);return getUser(_0x62fc10,_0x33e57e[_0x3de5('0x4b')])[_0x3de5('0x1a')](function(_0xe9a688){_0x3546c7=_0xe9a688;logger[_0x3de5('0xd')](_0x3de5('0x4c'),_0x3546c7['id']);return getEndUser(_0x62fc10,_0x142569[_0x3de5('0x5c')],_0x142569[_0x3de5('0x5d')]);})[_0x3de5('0x1a')](function(_0xf8d7f9){_0x345cb4=_0xf8d7f9;logger['info'](_0x3de5('0x4e'),_0x345cb4['id']);return getTicket(_0x62fc10,_0x3546c7,_0x345cb4,_0x292122,_0x142569);})[_0x3de5('0x1a')](function(_0x2d2bb3){if(_0x2d2bb3){logger[_0x3de5('0xd')](_0x3de5('0x4f'),_0x2d2bb3['id']);switch(_0x62fc10['type']){case _0x3de5('0x50'):logger[_0x3de5('0xd')](_0x3de5('0x5e'),_0x3de5('0x51'));return request({'uri':util[_0x3de5('0xe')](_0x3de5('0x52'),_0x62fc10['remoteUri'],_0x3546c7['id'],_0x2d2bb3['id']),'method':_0x3de5('0x11')});case _0x3de5('0x5f'):logger[_0x3de5('0xd')]('[OUTBOUND]',_0x3de5('0x60'));emit(util[_0x3de5('0xe')](_0x3de5('0x61'),_0x33e57e[_0x3de5('0x13')]),_0x3de5('0x53'),{'uri':util[_0x3de5('0xe')](_0x3de5('0x62'),_0x62fc10['remoteUri'][_0x3de5('0x54')](_0x3de5('0x63'),''),_0x2d2bb3['id'])});break;default:logger[_0x3de5('0x55')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x3de5('0x57')](function(_0x38cda1){logger[_0x3de5('0x55')](_0x3de5('0x64'),util['inspect'](_0x38cda1,{'showHidden':!![],'depth':null}));});};exports[_0x3de5('0x65')]=function(_0x39b8b1,_0xbc6de5,_0x45a6e2,_0x1b52f9,_0x275a58,_0x2e5d86){var _0xd13e7b,_0x42cafa;_0x2e5d86[_0x3de5('0x10')]=intUtil[_0x3de5('0x43')](_0x2e5d86[_0x3de5('0x10')]);_0x2e5d86[_0x3de5('0x44')]=intUtil[_0x3de5('0x43')](_0x2e5d86['serverUrl']);if(_0x275a58&&_0x275a58[_0x3de5('0x45')]){logger['info']('['+_0xbc6de5[_0x3de5('0x66')][_0x3de5('0x67')]()+']',_0x3de5('0x47'));_0xbc6de5[_0x3de5('0x48')]=util[_0x3de5('0xe')](_0x3de5('0x68'),_0x2e5d86[_0x3de5('0x44')],_0xbc6de5['uniqueid'],md5(_0xbc6de5[_0x3de5('0x49')]));}else{_0xbc6de5[_0x3de5('0x48')]='';}headers[_0x3de5('0x4a')]=getAuth(_0x2e5d86);return getUser(_0x2e5d86)[_0x3de5('0x1a')](function(_0x55426a){_0xd13e7b=_0x55426a;logger[_0x3de5('0xd')](_0x3de5('0x4c'),_0xd13e7b['id']);return getEndUser(_0x2e5d86,_0xbc6de5[_0x3de5('0x4d')],_0xbc6de5[_0x3de5('0x69')]);})[_0x3de5('0x1a')](function(_0x4071e4){_0x42cafa=_0x4071e4;logger[_0x3de5('0xd')](_0x3de5('0x4e'),_0x42cafa['id']);return getTicket(_0x2e5d86,_0xd13e7b,_0x42cafa,_0x45a6e2,_0xbc6de5);})['then'](function(_0x179f37){if(_0x179f37){logger[_0x3de5('0xd')](_0x3de5('0x4f'),_0x179f37['id']);}})[_0x3de5('0x57')](function(_0x3431c5){logger['error']('['+_0xbc6de5['lastevent'][_0x3de5('0x67')]()+']'+_0x3de5('0x6a'),util[_0x3de5('0x59')](_0x3431c5,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 97caab4..811170b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0737=['split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','email','Agent\x20found!','profile','name','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','moduleCreate','contact','nothing','lead','Leads','Creating\x20new\x20call...','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','startCase','talktime','Call_Duration','answertime','endtime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','outbound','agentcalledAt','Call_Type','Inbound','Fields','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','/api/voice/recordings/','destcalleridname','Outbound','[OUTBOUND]','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','../../../../config/environment','redis','localhost','emit','debug','[HTTP]','stringify','length','includes','string','idField','content','toString','type','variable','variableName','Variable','toLowerCase'];(function(_0x225915,_0x2eaa2f){var _0x3b8d10=function(_0x4c9dd5){while(--_0x4c9dd5){_0x225915['push'](_0x225915['shift']());}};_0x3b8d10(++_0x2eaa2f);}(_0x0737,0x116));var _0x7073=function(_0x60dc78,_0x371ada){_0x60dc78=_0x60dc78-0x0;var _0x39b56b=_0x0737[_0x60dc78];return _0x39b56b;};'use strict';var _=require(_0x7073('0x0'));var rp=require(_0x7073('0x1'));var md5=require(_0x7073('0x2'));var util=require(_0x7073('0x3'));var intUtil=require(_0x7073('0x4'));var moment=require('moment');var Redis=require(_0x7073('0x5'));var BPromise=require('bluebird');var config=require(_0x7073('0x6'));var logger=require('../../../../config/logger')('zoho');config[_0x7073('0x7')]=_['defaults'](config['redis'],{'host':_0x7073('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3161cc,_0x589b08,_0x1a5f71){io['to'](_0x3161cc)[_0x7073('0x9')](_0x589b08,_0x1a5f71);}function request(_0x1d4323){logger[_0x7073('0xa')](_0x7073('0xb'),JSON[_0x7073('0xc')](_0x1d4323));return rp(_0x1d4323);}function getCustomFields(_0x36574d,_0x498b65){var _0x5b5e13={};if(_0x36574d[_0x7073('0xd')]>0x0){_['forEach'](_0x36574d,function(_0xf14e75){if(_[_0x7073('0xe')]([_0x7073('0xf'),'picklist'],_0xf14e75['type'])&&_0xf14e75[_0x7073('0x10')]){_0x5b5e13[_0xf14e75['idField']]=_0xf14e75[_0x7073('0x11')][_0x7073('0x12')]();}else if(_0xf14e75[_0x7073('0x13')]===_0x7073('0x14')&&_0xf14e75['variableName']&&_0xf14e75[_0x7073('0x10')]&&_0x498b65[_0xf14e75[_0x7073('0x15')]]){_0x5b5e13[_0xf14e75[_0x7073('0x10')]]=_0x498b65[_0xf14e75[_0x7073('0x15')]][_0x7073('0x12')]();}else if(_0xf14e75['type']==='customVariable'&&_0xf14e75[_0x7073('0x16')]&&_0xf14e75[_0x7073('0x16')]['name']&&_0xf14e75[_0x7073('0x10')]&&_0x498b65[_0xf14e75['Variable']['name'][_0x7073('0x17')]()]){_0x5b5e13[_0xf14e75['idField']]=_0x498b65[_0xf14e75['Variable']['name'][_0x7073('0x17')]()]['toString']();}});}return _0x5b5e13;}function getName(_0x21551c){if(_0x21551c['indexOf']('\x20')>0x0){var _0x4e0aae=_0x21551c[_0x7073('0x18')](/ (.+)/);if(_0x4e0aae[0x1]){return _0x4e0aae;}}return[_0x21551c,_0x21551c];}var accountsTokens={};function getAccessToken(_0x6af429){return new Promise(function(_0x34f13e,_0x25b491){if(!_[_0x7073('0x19')](accountsTokens[_0x6af429['id']])&&!_[_0x7073('0x19')](accountsTokens[_0x6af429['id']][_0x7073('0x1a')])){if(moment()[_0x7073('0x1b')](accountsTokens[_0x6af429['id']][_0x7073('0x1c')])){_0x34f13e(accountsTokens[_0x6af429['id']][_0x7073('0x1a')]);}}var _0x225632;switch(_0x6af429[_0x7073('0x1d')]){case'US':_0x225632=_0x7073('0x1e');break;case'AU':_0x225632=_0x7073('0x1f');break;case'EU':_0x225632=_0x7073('0x20');break;case'IN':_0x225632=_0x7073('0x21');break;case'CN':_0x225632=_0x7073('0x22');break;default:_0x225632=_0x7073('0x20');break;}var _0x116885={'method':_0x7073('0x23'),'uri':_0x225632+_0x7073('0x24'),'qs':{'refresh_token':_0x6af429[_0x7073('0x25')],'client_id':_0x6af429[_0x7073('0x26')],'client_secret':_0x6af429['clientSecret'],'grant_type':_0x7073('0x27')},'json':!![]};return rp(_0x116885)[_0x7073('0x28')](function(_0x486e88){accountsTokens[_0x6af429['id']]={'access_token':_0x486e88[_0x7073('0x1a')],'expires_in':moment()[_0x7073('0x29')](_0x486e88[_0x7073('0x1c')],'seconds')};_0x34f13e(_0x486e88['access_token']);})[_0x7073('0x2a')](function(_0xeab550){logger[_0x7073('0x2b')](_0x7073('0x2c'),_0xeab550['stack']);_0x25b491(_0xeab550);});});}function getUser(_0x230b07,_0x2f770b,_0x2442ca,_0x31116a){logger[_0x7073('0x2d')](_0x7073('0x2e'));return request({'method':_0x7073('0x2f'),'uri':util[_0x7073('0x30')](_0x7073('0x31'),_0x2f770b),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x7073('0x32')+_0x230b07},'json':!![]})[_0x7073('0x28')](function(_0x12ce6b){if(_0x12ce6b['users']){var _0x3325a2=-0x1;if(_['isArrayLikeObject'](_0x12ce6b[_0x7073('0x33')])){if(!_[_0x7073('0x19')](_0x31116a)){_0x3325a2=_['findIndex'](_0x12ce6b[_0x7073('0x33')],function(_0x4ebcb2){return _0x4ebcb2[_0x7073('0x34')]===_0x31116a;});}if(_0x3325a2>=0x0){logger[_0x7073('0x2d')](_0x7073('0x35'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x3325a2=_['findIndex'](_0x12ce6b['users'],function(_0x448c78){return _0x448c78[_0x7073('0x36')][_0x7073('0x37')]==='Administrator';});}return _0x12ce6b[_0x7073('0x33')][_0x3325a2];}else{if(_0x12ce6b['user'][_0x7073('0x36')]['name']===_0x7073('0x38')){logger[_0x7073('0x2d')]('Using\x20the\x20admin\x20account!');user=_0x12ce6b[_0x7073('0x39')];return user;}else{logger[_0x7073('0x2b')](_0x7073('0x3a'),JSON[_0x7073('0xc')](_0x12ce6b));throw new Error(_0x7073('0x3b')+JSON['stringify'](_0x12ce6b));}}}else{logger[_0x7073('0x2b')](_0x7073('0x3a'),JSON[_0x7073('0xc')](_0x12ce6b));throw new Error(_0x7073('0x3b')+JSON[_0x7073('0xc')](_0x12ce6b));}})[_0x7073('0x2a')](function(_0x196f9c){console[_0x7073('0x2b')](_0x196f9c);});}function getZohoUser(_0x3675a5,_0xe66a4b){return new BPromise(function(_0x312455,_0xbba8a8){request(_0x3675a5)['then'](function(_0x3096c1){var _0x57a990=null;if(_0x3096c1){_0x57a990=_0x3096c1[_0x7073('0x3c')][0x0];_0x57a990[_0x7073('0x3d')]=_0xe66a4b;}_0x312455(_0x57a990);})[_0x7073('0x2a')](function(_0x3ebc33){_0xbba8a8(_0x3ebc33);});});}function createEndUser(_0x1284c9,_0x32df14,_0x3927cb,_0x357f45,_0x1fd39a,_0x222905){var _0x3927cb=getName(_0x3927cb);return request({'method':'POST','uri':_0x7073('0x3e')+_0x32df14+_0x7073('0x3f')+_['startCase'](_0x222905['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3927cb[0x1],'First_Name':_0x3927cb[0x0],'Phone':_0x357f45,'Owner':{'name':!_[_0x7073('0x19')](_0x1fd39a[_0x7073('0x40')][_0x7073('0x37')])?_0x1fd39a[_0x7073('0x40')][_0x7073('0x37')]:!_[_0x7073('0x19')](_0x1fd39a[_0x7073('0x41')])?_0x1fd39a['first_name']+'\x20'+_0x1fd39a['last_name']:_0x1fd39a[_0x7073('0x42')],'id':_0x1fd39a['id']}}]},'headers':{'Authorization':_0x7073('0x32')+_0x1284c9},'json':!![]})[_0x7073('0x28')](function(_0x90d659){if(_0x90d659&&_0x90d659[_0x7073('0x3c')][0x0][_0x7073('0x43')]==='SUCCESS'){var _0x129cda=_0x90d659[_0x7073('0x3c')][0x0][_0x7073('0x44')];_0x129cda['enduserType']=_['startCase'](_0x222905['moduleCreate'])+'s';return _0x129cda;}logger[_0x7073('0x2b')](_0x7073('0x3a'),JSON[_0x7073('0xc')](data));throw new Error(_0x7073('0x45')+JSON['stringify'](data));})[_0x7073('0x2a')](function(_0x5f13e9){console[_0x7073('0x46')](_0x7073('0x47'),_0x5f13e9);});}function getEndUser(_0x203018,_0x8b8053,_0x57b7be,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2){var _0x99dbde={'method':'GET','uri':'','headers':{'Authorization':_0x7073('0x32')+_0x203018},'json':!![]};switch(_0x43c9c2[_0x7073('0x48')]){case _0x7073('0x49'):_0x99dbde[_0x7073('0x4a')]=_0x7073('0x3e')+_0x8b8053+_0x7073('0x4b')+_0x517b84+'))';return getZohoUser(_0x99dbde,_0x7073('0x4c'))['then'](function(_0x49c99d){if(_0x49c99d)return _0x49c99d;_0x99dbde['uri']=_0x7073('0x3e')+_0x8b8053+_0x7073('0x4d')+_0x517b84+'))';return getZohoUser(_0x99dbde,'Leads')[_0x7073('0x28')](function(_0x2fa7cb){if(_0x2fa7cb)return _0x2fa7cb;if(_0x43c9c2[_0x7073('0x4e')]!='nothing'){return createEndUser(_0x203018,_0x8b8053,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2);}else{return{};}});});break;case _0x7073('0x4f'):_0x99dbde[_0x7073('0x4a')]=_0x7073('0x3e')+_0x8b8053+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x517b84+'))';return getZohoUser(_0x99dbde,'Contacts')[_0x7073('0x28')](function(_0x43d03f){if(_0x43d03f)return _0x43d03f;if(_0x43c9c2[_0x7073('0x4e')]!=_0x7073('0x50')){return createEndUser(_0x203018,_0x8b8053,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2);}else{return{};}});break;case _0x7073('0x51'):_0x99dbde[_0x7073('0x4a')]='https://www.zohoapis.'+_0x8b8053+_0x7073('0x4d')+_0x517b84+'))';return getZohoUser(_0x99dbde,_0x7073('0x52'))['then'](function(_0x27bb04){if(_0x27bb04)return _0x27bb04;if(_0x43c9c2[_0x7073('0x4e')]!=_0x7073('0x50')){return createEndUser(_0x203018,_0x8b8053,_0x3cbde7,_0x517b84,_0x350a1e,_0x43c9c2);}else{return{};}});break;}}function getCall(_0x3a8326,_0x447b44,_0x4472d1,_0x45fd24,_0x5d8afa,_0x157ad5,_0x4a0fdb,_0x371f14){logger[_0x7073('0x2d')](_0x7073('0x53'));var _0x302ec9={};_0x302ec9['Owner']={'name':!_['isNil'](_0x45fd24[_0x7073('0x40')][_0x7073('0x37')])&&!_[_0x7073('0x19')](_0x45fd24[_0x7073('0x36')]['name'])&&_0x45fd24['profile'][_0x7073('0x37')]==='administrator'?_0x45fd24['role']['name']:!_[_0x7073('0x19')](_0x45fd24['first_name'])?_0x45fd24[_0x7073('0x41')]+'\x20'+_0x45fd24[_0x7073('0x42')]:_0x45fd24[_0x7073('0x42')],'id':_0x45fd24['id']};_0x302ec9['Subject']=intUtil[_0x7073('0x54')](_0x157ad5[_0x7073('0x55')],_0x4a0fdb,'\x20');_0x302ec9[_0x7073('0x56')]=intUtil[_0x7073('0x54')](_0x157ad5[_0x7073('0x57')],_0x4a0fdb,'\x0a');if(_0x5d8afa[_0x7073('0x3d')]==='Contacts'){_0x302ec9[_0x7073('0x58')]={'name':!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x59')])?_0x5d8afa[_0x7073('0x59')]:!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x5a')])?_0x5d8afa[_0x7073('0x5a')]+'\x20'+_0x5d8afa[_0x7073('0x5b')]:_0x5d8afa[_0x7073('0x5b')],'id':_0x5d8afa['id']};}if(_0x5d8afa[_0x7073('0x3d')]===_0x7073('0x52')){_0x302ec9['What_Id']={'name':!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x59')])?_0x5d8afa['Full_Name']:!_[_0x7073('0x19')](_0x5d8afa[_0x7073('0x5a')])?_0x5d8afa[_0x7073('0x5a')]+'\x20'+_0x5d8afa['Last_Name']:_0x5d8afa[_0x7073('0x5b')],'id':_0x5d8afa['id']};_0x302ec9[_0x7073('0x5c')]=_[_0x7073('0x5d')](_0x5d8afa['enduserType']);}if(_0x4a0fdb[_0x7073('0x5e')]){_0x302ec9[_0x7073('0x5f')]=moment['utc'](parseInt(_0x4a0fdb[_0x7073('0x5e')])*0x3e8)[_0x7073('0x30')]('mm:ss');}else if(_0x4a0fdb[_0x7073('0x60')]&&_0x4a0fdb[_0x7073('0x61')]){_0x302ec9[_0x7073('0x5f')]=moment[_0x7073('0x62')](moment(_0x4a0fdb['endtime'],_0x7073('0x63'))[_0x7073('0x64')](moment(_0x4a0fdb[_0x7073('0x65')],_0x7073('0x63'))))[_0x7073('0x30')](_0x7073('0x66'));}switch(_0x4a0fdb[_0x7073('0x67')]){case _0x7073('0x68'):_0x302ec9[_0x7073('0x69')]=_0x7073('0x6a');break;case'complete':case _0x7073('0x6b'):_0x302ec9[_0x7073('0x69')]=_0x7073('0x6c');break;case _0x7073('0x6d'):_0x302ec9['Call_Result']=_0x7073('0x6e');break;case _0x7073('0x6f'):_0x302ec9['Call_Result']=_0x7073('0x70');break;case _0x7073('0x71'):_0x302ec9[_0x7073('0x69')]=_0x7073('0x72');default:}_0x302ec9['Call_Start_Time']=(_0x371f14===_0x7073('0x73')?moment(_0x4a0fdb[_0x7073('0x65')])['format'](_0x7073('0x63')):moment(_0x4a0fdb[_0x7073('0x74')])[_0x7073('0x30')](_0x7073('0x63')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x302ec9[_0x7073('0x75')]=_0x371f14||_0x7073('0x76');_0x302ec9=_['merge'](_0x302ec9,getCustomFields(_0x157ad5[_0x7073('0x77')],_0x4a0fdb));return request({'method':_0x7073('0x23'),'uri':_0x7073('0x3e')+_0x447b44+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x3a8326},'body':{'data':[_0x302ec9]},'json':!![]})[_0x7073('0x28')](function(_0x1e183d){if(_0x1e183d&&_0x1e183d[_0x7073('0x3c')][0x0][_0x7073('0x43')]==='SUCCESS'){logger['info'](_0x7073('0x78'));return{'id':_0x1e183d[_0x7073('0x3c')][0x0][_0x7073('0x44')]['id']};}})['catch'](function(_0x5ce921){logger[_0x7073('0x2d')]('err',_0x5ce921['stack']);console[_0x7073('0x46')](_0x7073('0x79'),_0x5ce921);});}exports[_0x7073('0x7a')]=function(_0xa17245,_0x4a8893,_0x4dfb6f,_0x5ab27e,_0x38ed3f,_0x4a913b){var _0x32df28,_0x196244,_0x4246c8;_0x4a913b[_0x7073('0x7b')]=intUtil[_0x7073('0x7c')](_0x4a913b[_0x7073('0x7b')]);_0x4a913b['serverUrl']=intUtil[_0x7073('0x7c')](_0x4a913b[_0x7073('0x7d')]);if(_0x38ed3f&&_0x38ed3f['monitor_format']){logger['info']('[QUEUE]',_0x7073('0x7e'));_0x4a8893[_0x7073('0x7f')]=_0x4a913b[_0x7073('0x7d')]+'/api/voice/recordings/'+_0x4a8893[_0x7073('0x80')]+_0x7073('0x81')+md5(_0x4a8893[_0x7073('0x80')]);}else{_0x4a8893[_0x7073('0x7f')]='';}var _0x42f390=_0x4a913b[_0x7073('0x7b')]===_0x7073('0x82')?'eu':_0x7073('0x83');return getAccessToken(_0x4a913b)[_0x7073('0x28')](function(_0x1c130c){_0x4246c8=_0x1c130c;return getUser(_0x4246c8,_0x42f390,_0x4a913b,_0x5ab27e['email']);})[_0x7073('0x28')](function(_0x12bc8e){_0x32df28=_0x12bc8e;logger[_0x7073('0x2d')](_0x7073('0x84'),_0x32df28['id']);return getEndUser(_0x4246c8,_0x42f390,_0x4a913b,_0x4a8893[_0x7073('0x85')],_0x4a8893[_0x7073('0x86')],_0x32df28,_0x4dfb6f);})[_0x7073('0x28')](function(_0x595868){_0x196244=_0x595868;return getCall(_0x4246c8,_0x42f390,_0x4a913b,_0x32df28,_0x196244,_0x4dfb6f,_0x4a8893,_0x7073('0x76'));})[_0x7073('0x28')](function(_0x463c6e){if(_0x463c6e){logger[_0x7073('0x2d')](_0x7073('0x87'),_0x463c6e['id']);logger[_0x7073('0x2d')](_0x7073('0x88'),_0x7073('0x89'));emit(util[_0x7073('0x30')](_0x7073('0x8a'),_0x5ab27e[_0x7073('0x37')]),_0x7073('0x8b'),{'uri':_0x7073('0x8c')+_0x4a913b[_0x7073('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x463c6e['id']});}})[_0x7073('0x2a')](function(_0x506028){logger[_0x7073('0x2b')](_0x7073('0x88'),JSON[_0x7073('0xc')](_0x506028));});};exports['outbound']=function(_0x4f6c20,_0x1d3871,_0x34ba7d,_0x3278af,_0x1b2c15,_0x1d3fdd,_0x18a08f){var _0x42fde6,_0x592a33,_0xd93281;_0x1d3fdd[_0x7073('0x7b')]=intUtil[_0x7073('0x7c')](_0x1d3fdd[_0x7073('0x7b')]);_0x1d3fdd[_0x7073('0x7d')]=intUtil['stripTrailingSlash'](_0x1d3fdd['serverUrl']);if(_0x18a08f&&_0x18a08f[_0x7073('0x8d')]&&_0x18a08f['recordingFormat']!==_0x7073('0x8e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1d3871[_0x7073('0x7f')]=_0x1d3fdd[_0x7073('0x7d')]+_0x7073('0x8f')+_0x1d3871[_0x7073('0x80')]+_0x7073('0x81')+md5(_0x1d3871[_0x7073('0x80')]);}var _0x589ab4=_0x1d3fdd['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x1d3fdd)[_0x7073('0x28')](function(_0x3b8d17){_0xd93281=_0x3b8d17;return getUser(_0xd93281,_0x589ab4,_0x1d3fdd,_0x3278af['email']);})['then'](function(_0x13871d){_0x42fde6=_0x13871d;logger[_0x7073('0x2d')](_0x7073('0x84'),_0x42fde6['id']);return getEndUser(_0xd93281,_0x589ab4,_0x1d3fdd,_0x1d3871[_0x7073('0x90')],_0x1d3871['destcalleridnum'],_0x42fde6,_0x34ba7d);})[_0x7073('0x28')](function(_0x151b44){_0x592a33=_0x151b44;return getCall(_0xd93281,_0x589ab4,_0x1d3fdd,_0x42fde6,_0x592a33,_0x34ba7d,_0x1d3871,_0x7073('0x91'));})[_0x7073('0x28')](function(_0x5e2215){if(_0x5e2215){logger[_0x7073('0x2d')](_0x7073('0x87'),_0x5e2215['id']);logger[_0x7073('0x2d')](_0x7073('0x92'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7073('0x30')](_0x7073('0x8a'),_0x3278af[_0x7073('0x37')]),_0x7073('0x8b'),{'uri':_0x7073('0x8c')+_0x1d3fdd['host']+_0x7073('0x93')+_0x5e2215['id']});}})[_0x7073('0x2a')](function(_0x1c336d){logger['error']('[OUTBOUND]',JSON[_0x7073('0xc')](_0x1c336d));});};exports[_0x7073('0x94')]=function(_0x29af29,_0x40095f,_0x31e7d3,_0x53d4d1,_0x2115a1,_0x246818){var _0x2d397e,_0x15d060,_0x41f223;_0x246818[_0x7073('0x7b')]=intUtil[_0x7073('0x7c')](_0x246818['host']);_0x246818[_0x7073('0x7d')]=intUtil['stripTrailingSlash'](_0x246818[_0x7073('0x7d')]);if(_0x2115a1&&_0x2115a1[_0x7073('0x95')]){logger['info']('['+_0x40095f[_0x7073('0x67')][_0x7073('0x96')]()+']','Recording\x20is\x20enabled!');_0x40095f[_0x7073('0x7f')]=_0x246818[_0x7073('0x7d')]+'/api/voice/recordings/'+_0x40095f['uniqueid']+_0x7073('0x81')+md5(_0x40095f['uniqueid']);}else{_0x40095f[_0x7073('0x7f')]='';}var _0x3fb1ec=_0x246818[_0x7073('0x7b')]===_0x7073('0x82')?'eu':'com';return getAccessToken(_0x246818)[_0x7073('0x28')](function(_0x437e81){_0x41f223=_0x437e81;return getUser(_0x41f223,_0x3fb1ec,_0x246818);})[_0x7073('0x28')](function(_0x38eee8){_0x2d397e=_0x38eee8;logger[_0x7073('0x2d')](_0x7073('0x84'),_0x2d397e['id']);return getEndUser(_0x41f223,_0x3fb1ec,_0x246818,_0x40095f[_0x7073('0x85')],_0x40095f[_0x7073('0x86')],_0x2d397e,_0x31e7d3);})['then'](function(_0x156eaa){_0x15d060=_0x156eaa;return getCall(_0x41f223,_0x3fb1ec,_0x246818,_0x2d397e,_0x15d060,_0x31e7d3,_0x40095f,'Inbound');})[_0x7073('0x28')](function(_0x1867c4){if(_0x1867c4){logger[_0x7073('0x2d')](_0x7073('0x87'),_0x1867c4['id']);}})[_0x7073('0x2a')](function(_0x198981){logger['error']('['+_0x40095f[_0x7073('0x67')][_0x7073('0x96')]()+']',JSON[_0x7073('0xc')](_0x198981));});};
\ No newline at end of file
+var _0xecb2=['POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','user','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','Called','complete','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Call_Start_Time','agentcalledAt','Inbound','merge','/crm/v2/Calls','log','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','user:%s','https://crm.','lastevent','toUpperCase','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','socket.io-emitter','debug','[HTTP]','stringify','length','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn'];(function(_0x35db8f,_0x3aff8d){var _0x51806b=function(_0x1e351b){while(--_0x1e351b){_0x35db8f['push'](_0x35db8f['shift']());}};_0x51806b(++_0x3aff8d);}(_0xecb2,0x112));var _0x2ecb=function(_0x29e4ab,_0x4866ee){_0x29e4ab=_0x29e4ab-0x0;var _0x553981=_0xecb2[_0x29e4ab];return _0x553981;};'use strict';var _=require(_0x2ecb('0x0'));var rp=require(_0x2ecb('0x1'));var md5=require(_0x2ecb('0x2'));var util=require('util');var intUtil=require(_0x2ecb('0x3'));var moment=require(_0x2ecb('0x4'));var Redis=require(_0x2ecb('0x5'));var BPromise=require(_0x2ecb('0x6'));var config=require(_0x2ecb('0x7'));var logger=require(_0x2ecb('0x8'))(_0x2ecb('0x9'));config[_0x2ecb('0xa')]=_[_0x2ecb('0xb')](config[_0x2ecb('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x2ecb('0xc'))(new Redis(config['redis']));function emit(_0x2bbcb3,_0x324bb,_0x27cd9c){io['to'](_0x2bbcb3)['emit'](_0x324bb,_0x27cd9c);}function request(_0x395910){logger[_0x2ecb('0xd')](_0x2ecb('0xe'),JSON[_0x2ecb('0xf')](_0x395910));return rp(_0x395910);}function getCustomFields(_0x2bbbd1,_0xd33862){var _0x5a0b48={};if(_0x2bbbd1[_0x2ecb('0x10')]>0x0){_['forEach'](_0x2bbbd1,function(_0x46a965){if(_['includes'](['string','picklist'],_0x46a965['type'])&&_0x46a965['idField']){_0x5a0b48[_0x46a965[_0x2ecb('0x11')]]=_0x46a965[_0x2ecb('0x12')]['toString']();}else if(_0x46a965[_0x2ecb('0x13')]===_0x2ecb('0x14')&&_0x46a965['variableName']&&_0x46a965['idField']&&_0xd33862[_0x46a965[_0x2ecb('0x15')]]){_0x5a0b48[_0x46a965['idField']]=_0xd33862[_0x46a965['variableName']][_0x2ecb('0x16')]();}else if(_0x46a965['type']===_0x2ecb('0x17')&&_0x46a965[_0x2ecb('0x18')]&&_0x46a965[_0x2ecb('0x18')]['name']&&_0x46a965[_0x2ecb('0x11')]&&_0xd33862[_0x46a965[_0x2ecb('0x18')]['name']['toLowerCase']()]){_0x5a0b48[_0x46a965[_0x2ecb('0x11')]]=_0xd33862[_0x46a965[_0x2ecb('0x18')][_0x2ecb('0x19')][_0x2ecb('0x1a')]()][_0x2ecb('0x16')]();}});}return _0x5a0b48;}function getName(_0x2fb1ad){if(_0x2fb1ad[_0x2ecb('0x1b')]('\x20')>0x0){var _0x2c1298=_0x2fb1ad[_0x2ecb('0x1c')](/ (.+)/);if(_0x2c1298[0x1]){return _0x2c1298;}}return[_0x2fb1ad,_0x2fb1ad];}var accountsTokens={};function getAccessToken(_0x7d0f91){return new Promise(function(_0x16de5e,_0x1c9633){if(!_[_0x2ecb('0x1d')](accountsTokens[_0x7d0f91['id']])&&!_['isNil'](accountsTokens[_0x7d0f91['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x7d0f91['id']][_0x2ecb('0x1e')])){_0x16de5e(accountsTokens[_0x7d0f91['id']]['access_token']);}}var _0x55bca5;switch(_0x7d0f91[_0x2ecb('0x1f')]){case'US':_0x55bca5=_0x2ecb('0x20');break;case'AU':_0x55bca5=_0x2ecb('0x21');break;case'EU':_0x55bca5=_0x2ecb('0x22');break;case'IN':_0x55bca5='https://accounts.zoho.in';break;case'CN':_0x55bca5=_0x2ecb('0x23');break;default:_0x55bca5=_0x2ecb('0x22');break;}var _0x475991={'method':_0x2ecb('0x24'),'uri':_0x55bca5+_0x2ecb('0x25'),'qs':{'refresh_token':_0x7d0f91[_0x2ecb('0x26')],'client_id':_0x7d0f91[_0x2ecb('0x27')],'client_secret':_0x7d0f91['clientSecret'],'grant_type':_0x2ecb('0x28')},'json':!![]};return rp(_0x475991)['then'](function(_0x4d82e6){accountsTokens[_0x7d0f91['id']]={'access_token':_0x4d82e6[_0x2ecb('0x29')],'expires_in':moment()['add'](_0x4d82e6['expires_in'],_0x2ecb('0x2a'))};_0x16de5e(_0x4d82e6[_0x2ecb('0x29')]);})[_0x2ecb('0x2b')](function(_0x3b16c1){logger[_0x2ecb('0x2c')](_0x2ecb('0x2d'),_0x3b16c1[_0x2ecb('0x2e')]);_0x1c9633(_0x3b16c1);});});}function getUser(_0xb39862,_0x27d82b,_0x442f83,_0x1a1587){logger[_0x2ecb('0x2f')](_0x2ecb('0x30'));return request({'method':_0x2ecb('0x31'),'uri':util[_0x2ecb('0x32')](_0x2ecb('0x33'),_0x27d82b),'qs':{'type':_0x2ecb('0x34')},'headers':{'Authorization':_0x2ecb('0x35')+_0xb39862},'json':!![]})[_0x2ecb('0x36')](function(_0x33bb55){if(_0x33bb55[_0x2ecb('0x37')]){var _0x1683f3=-0x1;if(_[_0x2ecb('0x38')](_0x33bb55[_0x2ecb('0x37')])){if(!_['isNil'](_0x1a1587)){_0x1683f3=_['findIndex'](_0x33bb55[_0x2ecb('0x37')],function(_0x448530){return _0x448530[_0x2ecb('0x39')]===_0x1a1587;});}if(_0x1683f3>=0x0){logger[_0x2ecb('0x2f')](_0x2ecb('0x3a'));}else{logger[_0x2ecb('0x2f')](_0x2ecb('0x3b'));_0x1683f3=_[_0x2ecb('0x3c')](_0x33bb55[_0x2ecb('0x37')],function(_0x4503df){return _0x4503df['profile']['name']==='Administrator';});}return _0x33bb55[_0x2ecb('0x37')][_0x1683f3];}else{if(_0x33bb55[_0x2ecb('0x3d')][_0x2ecb('0x3e')][_0x2ecb('0x19')]===_0x2ecb('0x3f')){logger[_0x2ecb('0x2f')](_0x2ecb('0x3b'));user=_0x33bb55[_0x2ecb('0x3d')];return user;}else{logger['error'](_0x2ecb('0x40'),JSON[_0x2ecb('0xf')](_0x33bb55));throw new Error(_0x2ecb('0x41')+JSON['stringify'](_0x33bb55));}}}else{logger[_0x2ecb('0x2c')](_0x2ecb('0x40'),JSON[_0x2ecb('0xf')](_0x33bb55));throw new Error(_0x2ecb('0x41')+JSON[_0x2ecb('0xf')](_0x33bb55));}})[_0x2ecb('0x2b')](function(_0x598df5){console[_0x2ecb('0x2c')](_0x598df5);});}function getZohoUser(_0x3605fd,_0x47c10f){return new BPromise(function(_0x261b7e,_0x1247d4){request(_0x3605fd)[_0x2ecb('0x36')](function(_0x286c0b){var _0x548b1a=null;if(_0x286c0b){_0x548b1a=_0x286c0b[_0x2ecb('0x42')][0x0];_0x548b1a[_0x2ecb('0x43')]=_0x47c10f;}_0x261b7e(_0x548b1a);})['catch'](function(_0x2977e0){_0x1247d4(_0x2977e0);});});}function createEndUser(_0x52fb24,_0x5f4986,_0x4dc090,_0x4de2f4,_0x42c12d,_0x349a35){var _0x4dc090=getName(_0x4dc090);return request({'method':_0x2ecb('0x24'),'uri':_0x2ecb('0x44')+_0x5f4986+'/crm/v2/'+_[_0x2ecb('0x45')](_0x349a35[_0x2ecb('0x46')])+'s','body':{'data':[{'Last_Name':_0x4dc090[0x1],'First_Name':_0x4dc090[0x0],'Phone':_0x4de2f4,'Owner':{'name':!_[_0x2ecb('0x1d')](_0x42c12d[_0x2ecb('0x47')][_0x2ecb('0x19')])?_0x42c12d[_0x2ecb('0x47')][_0x2ecb('0x19')]:!_[_0x2ecb('0x1d')](_0x42c12d[_0x2ecb('0x48')])?_0x42c12d[_0x2ecb('0x48')]+'\x20'+_0x42c12d[_0x2ecb('0x49')]:_0x42c12d[_0x2ecb('0x49')],'id':_0x42c12d['id']}}]},'headers':{'Authorization':_0x2ecb('0x35')+_0x52fb24},'json':!![]})['then'](function(_0x5bb1b4){if(_0x5bb1b4&&_0x5bb1b4['data'][0x0][_0x2ecb('0x4a')]===_0x2ecb('0x4b')){var _0x399351=_0x5bb1b4['data'][0x0][_0x2ecb('0x4c')];_0x399351[_0x2ecb('0x43')]=_['startCase'](_0x349a35['moduleCreate'])+'s';return _0x399351;}logger[_0x2ecb('0x2c')](_0x2ecb('0x40'),JSON[_0x2ecb('0xf')](data));throw new Error(_0x2ecb('0x4d')+JSON['stringify'](data));})[_0x2ecb('0x2b')](function(_0x2c139e){console['log'](_0x2ecb('0x4e'),_0x2c139e);});}function getEndUser(_0x28e56c,_0x4a91eb,_0xc10e73,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585){var _0x312638={'method':_0x2ecb('0x31'),'uri':'','headers':{'Authorization':_0x2ecb('0x35')+_0x28e56c},'json':!![]};switch(_0x36a585[_0x2ecb('0x4f')]){case _0x2ecb('0x50'):_0x312638['uri']=_0x2ecb('0x44')+_0x4a91eb+_0x2ecb('0x51')+_0x393144+'))';return getZohoUser(_0x312638,_0x2ecb('0x52'))[_0x2ecb('0x36')](function(_0xc35d7c){if(_0xc35d7c)return _0xc35d7c;_0x312638[_0x2ecb('0x53')]='https://www.zohoapis.'+_0x4a91eb+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x393144+'))';return getZohoUser(_0x312638,_0x2ecb('0x54'))[_0x2ecb('0x36')](function(_0x1b4414){if(_0x1b4414)return _0x1b4414;if(_0x36a585[_0x2ecb('0x46')]!=_0x2ecb('0x55')){return createEndUser(_0x28e56c,_0x4a91eb,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585);}else{return{};}});});break;case _0x2ecb('0x56'):_0x312638[_0x2ecb('0x53')]=_0x2ecb('0x44')+_0x4a91eb+_0x2ecb('0x51')+_0x393144+'))';return getZohoUser(_0x312638,'Contacts')[_0x2ecb('0x36')](function(_0x126525){if(_0x126525)return _0x126525;if(_0x36a585['moduleCreate']!=_0x2ecb('0x55')){return createEndUser(_0x28e56c,_0x4a91eb,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585);}else{return{};}});break;case _0x2ecb('0x57'):_0x312638[_0x2ecb('0x53')]='https://www.zohoapis.'+_0x4a91eb+_0x2ecb('0x58')+_0x393144+'))';return getZohoUser(_0x312638,_0x2ecb('0x54'))['then'](function(_0x1818f1){if(_0x1818f1)return _0x1818f1;if(_0x36a585[_0x2ecb('0x46')]!=_0x2ecb('0x55')){return createEndUser(_0x28e56c,_0x4a91eb,_0x40ddc8,_0x393144,_0x1473c0,_0x36a585);}else{return{};}});break;}}function getCall(_0x36e880,_0x368ade,_0x16408d,_0x117a27,_0x2216dc,_0xa29984,_0xa0df78,_0x334958){logger[_0x2ecb('0x2f')](_0x2ecb('0x59'));var _0x4f842a={};_0x4f842a[_0x2ecb('0x5a')]={'name':!_[_0x2ecb('0x1d')](_0x117a27['role']['name'])&&!_[_0x2ecb('0x1d')](_0x117a27[_0x2ecb('0x3e')][_0x2ecb('0x19')])&&_0x117a27[_0x2ecb('0x3e')]['name']===_0x2ecb('0x5b')?_0x117a27[_0x2ecb('0x47')]['name']:!_['isNil'](_0x117a27[_0x2ecb('0x48')])?_0x117a27[_0x2ecb('0x48')]+'\x20'+_0x117a27[_0x2ecb('0x49')]:_0x117a27[_0x2ecb('0x49')],'id':_0x117a27['id']};_0x4f842a[_0x2ecb('0x5c')]=intUtil[_0x2ecb('0x5d')](_0xa29984[_0x2ecb('0x5e')],_0xa0df78,'\x20');_0x4f842a[_0x2ecb('0x5f')]=intUtil[_0x2ecb('0x5d')](_0xa29984[_0x2ecb('0x60')],_0xa0df78,'\x0a');if(_0x2216dc['enduserType']==='Contacts'){_0x4f842a['Who_Id']={'name':!_[_0x2ecb('0x1d')](_0x2216dc[_0x2ecb('0x61')])?_0x2216dc[_0x2ecb('0x61')]:!_[_0x2ecb('0x1d')](_0x2216dc['First_Name'])?_0x2216dc[_0x2ecb('0x62')]+'\x20'+_0x2216dc[_0x2ecb('0x63')]:_0x2216dc['Last_Name'],'id':_0x2216dc['id']};}if(_0x2216dc[_0x2ecb('0x43')]===_0x2ecb('0x54')){_0x4f842a[_0x2ecb('0x64')]={'name':!_[_0x2ecb('0x1d')](_0x2216dc[_0x2ecb('0x61')])?_0x2216dc[_0x2ecb('0x61')]:!_[_0x2ecb('0x1d')](_0x2216dc[_0x2ecb('0x62')])?_0x2216dc[_0x2ecb('0x62')]+'\x20'+_0x2216dc['Last_Name']:_0x2216dc[_0x2ecb('0x63')],'id':_0x2216dc['id']};_0x4f842a['$se_module']=_[_0x2ecb('0x45')](_0x2216dc['enduserType']);}if(_0xa0df78[_0x2ecb('0x65')]){_0x4f842a[_0x2ecb('0x66')]=moment[_0x2ecb('0x67')](parseInt(_0xa0df78[_0x2ecb('0x65')])*0x3e8)[_0x2ecb('0x32')](_0x2ecb('0x68'));}else if(_0xa0df78[_0x2ecb('0x69')]&&_0xa0df78[_0x2ecb('0x6a')]){_0x4f842a[_0x2ecb('0x66')]=moment[_0x2ecb('0x67')](moment(_0xa0df78[_0x2ecb('0x6a')],_0x2ecb('0x6b'))[_0x2ecb('0x6c')](moment(_0xa0df78[_0x2ecb('0x6d')],_0x2ecb('0x6b'))))[_0x2ecb('0x32')](_0x2ecb('0x68'));}switch(_0xa0df78['lastevent']){case'called':_0x4f842a['Call_Result']=_0x2ecb('0x6e');break;case _0x2ecb('0x6f'):case _0x2ecb('0x70'):_0x4f842a[_0x2ecb('0x71')]=_0x2ecb('0x72');break;case _0x2ecb('0x73'):_0x4f842a[_0x2ecb('0x71')]=_0x2ecb('0x74');break;case _0x2ecb('0x75'):_0x4f842a[_0x2ecb('0x71')]=_0x2ecb('0x76');break;case _0x2ecb('0x77'):_0x4f842a[_0x2ecb('0x71')]='Timeout';default:}_0x4f842a[_0x2ecb('0x78')]=(_0x334958==='outbound'?moment(_0xa0df78[_0x2ecb('0x6d')])['format'](_0x2ecb('0x6b')):moment(_0xa0df78[_0x2ecb('0x79')])[_0x2ecb('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x2ecb('0x32')](_0x2ecb('0x6b'));_0x4f842a['Call_Type']=_0x334958||_0x2ecb('0x7a');_0x4f842a=_[_0x2ecb('0x7b')](_0x4f842a,getCustomFields(_0xa29984['Fields'],_0xa0df78));return request({'method':_0x2ecb('0x24'),'uri':'https://www.zohoapis.'+_0x368ade+_0x2ecb('0x7c'),'headers':{'Authorization':_0x2ecb('0x35')+_0x36e880},'body':{'data':[_0x4f842a]},'json':!![]})['then'](function(_0x5f54bc){if(_0x5f54bc&&_0x5f54bc['data'][0x0][_0x2ecb('0x4a')]===_0x2ecb('0x4b')){logger[_0x2ecb('0x2f')]('Call\x20created!');return{'id':_0x5f54bc[_0x2ecb('0x42')][0x0][_0x2ecb('0x4c')]['id']};}})[_0x2ecb('0x2b')](function(_0x27aaf2){logger[_0x2ecb('0x2f')]('err',_0x27aaf2[_0x2ecb('0x2e')]);console[_0x2ecb('0x7d')]('err',_0x27aaf2);});}exports[_0x2ecb('0x7e')]=function(_0x41e89c,_0x5d2d16,_0x40d10e,_0x28be68,_0x5b618e,_0x4c8090){var _0x3f391c,_0x3667d7,_0x1e68ec;_0x4c8090['host']=intUtil[_0x2ecb('0x7f')](_0x4c8090[_0x2ecb('0x80')]);_0x4c8090['serverUrl']=intUtil[_0x2ecb('0x7f')](_0x4c8090[_0x2ecb('0x81')]);if(_0x5b618e&&_0x5b618e[_0x2ecb('0x82')]){logger[_0x2ecb('0x2f')]('[QUEUE]',_0x2ecb('0x83'));_0x5d2d16[_0x2ecb('0x84')]=_0x4c8090['serverUrl']+_0x2ecb('0x85')+_0x5d2d16[_0x2ecb('0x86')]+_0x2ecb('0x87')+md5(_0x5d2d16[_0x2ecb('0x86')]);}else{_0x5d2d16[_0x2ecb('0x84')]='';}var _0x9da6ea=_0x4c8090[_0x2ecb('0x80')]===_0x2ecb('0x88')?'eu':_0x2ecb('0x89');return getAccessToken(_0x4c8090)[_0x2ecb('0x36')](function(_0x4a6ff1){_0x1e68ec=_0x4a6ff1;return getUser(_0x1e68ec,_0x9da6ea,_0x4c8090,_0x28be68[_0x2ecb('0x39')]);})[_0x2ecb('0x36')](function(_0x557ff9){_0x3f391c=_0x557ff9;logger[_0x2ecb('0x2f')](_0x2ecb('0x8a'),_0x3f391c['id']);return getEndUser(_0x1e68ec,_0x9da6ea,_0x4c8090,_0x5d2d16[_0x2ecb('0x8b')],_0x5d2d16[_0x2ecb('0x8c')],_0x3f391c,_0x40d10e);})[_0x2ecb('0x36')](function(_0x3eab97){_0x3667d7=_0x3eab97;return getCall(_0x1e68ec,_0x9da6ea,_0x4c8090,_0x3f391c,_0x3667d7,_0x40d10e,_0x5d2d16,_0x2ecb('0x7a'));})[_0x2ecb('0x36')](function(_0x7fdc5c){if(_0x7fdc5c){logger['info'](_0x2ecb('0x8d'),_0x7fdc5c['id']);logger[_0x2ecb('0x2f')](_0x2ecb('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x28be68['name']),'trigger:browser:url',{'uri':'https://crm.'+_0x4c8090[_0x2ecb('0x80')]+_0x2ecb('0x8f')+_0x7fdc5c['id']});}})[_0x2ecb('0x2b')](function(_0x5d7d61){logger[_0x2ecb('0x2c')]('[QUEUE]',JSON[_0x2ecb('0xf')](_0x5d7d61));});};exports[_0x2ecb('0x90')]=function(_0x17de1a,_0x5b52c2,_0x3c43a7,_0xe8d1ad,_0x46e31c,_0x13ea0a,_0x7f9b11){var _0x75ea09,_0x4edfc3,_0x488457;_0x13ea0a[_0x2ecb('0x80')]=intUtil[_0x2ecb('0x7f')](_0x13ea0a[_0x2ecb('0x80')]);_0x13ea0a[_0x2ecb('0x81')]=intUtil[_0x2ecb('0x7f')](_0x13ea0a[_0x2ecb('0x81')]);if(_0x7f9b11&&_0x7f9b11['recordingFormat']&&_0x7f9b11[_0x2ecb('0x91')]!==_0x2ecb('0x92')){logger[_0x2ecb('0x2f')](_0x2ecb('0x93'),_0x2ecb('0x83'));_0x5b52c2[_0x2ecb('0x84')]=_0x13ea0a[_0x2ecb('0x81')]+'/api/voice/recordings/'+_0x5b52c2[_0x2ecb('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x5b52c2[_0x2ecb('0x86')]);}var _0x90a758=_0x13ea0a[_0x2ecb('0x80')]===_0x2ecb('0x88')?'eu':_0x2ecb('0x89');return getAccessToken(_0x13ea0a)['then'](function(_0xa5fd30){_0x488457=_0xa5fd30;return getUser(_0x488457,_0x90a758,_0x13ea0a,_0xe8d1ad['email']);})['then'](function(_0x4a411d){_0x75ea09=_0x4a411d;logger[_0x2ecb('0x2f')](_0x2ecb('0x8a'),_0x75ea09['id']);return getEndUser(_0x488457,_0x90a758,_0x13ea0a,_0x5b52c2[_0x2ecb('0x94')],_0x5b52c2[_0x2ecb('0x95')],_0x75ea09,_0x3c43a7);})['then'](function(_0x144d0f){_0x4edfc3=_0x144d0f;return getCall(_0x488457,_0x90a758,_0x13ea0a,_0x75ea09,_0x4edfc3,_0x3c43a7,_0x5b52c2,_0x2ecb('0x96'));})[_0x2ecb('0x36')](function(_0xea273f){if(_0xea273f){logger[_0x2ecb('0x2f')](_0x2ecb('0x8d'),_0xea273f['id']);logger[_0x2ecb('0x2f')](_0x2ecb('0x93'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x2ecb('0x97'),_0xe8d1ad['name']),'trigger:browser:url',{'uri':_0x2ecb('0x98')+_0x13ea0a[_0x2ecb('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0xea273f['id']});}})[_0x2ecb('0x2b')](function(_0x49a2e7){logger[_0x2ecb('0x2c')](_0x2ecb('0x93'),JSON[_0x2ecb('0xf')](_0x49a2e7));});};exports['unmanaged']=function(_0xdd2789,_0x234d0d,_0x10e1c9,_0x2aa156,_0x3855bd,_0x2d6e1e){var _0x5e7652,_0x8dcad9,_0x47e292;_0x2d6e1e[_0x2ecb('0x80')]=intUtil[_0x2ecb('0x7f')](_0x2d6e1e[_0x2ecb('0x80')]);_0x2d6e1e['serverUrl']=intUtil[_0x2ecb('0x7f')](_0x2d6e1e[_0x2ecb('0x81')]);if(_0x3855bd&&_0x3855bd[_0x2ecb('0x82')]){logger[_0x2ecb('0x2f')]('['+_0x234d0d[_0x2ecb('0x99')][_0x2ecb('0x9a')]()+']','Recording\x20is\x20enabled!');_0x234d0d[_0x2ecb('0x84')]=_0x2d6e1e[_0x2ecb('0x81')]+_0x2ecb('0x85')+_0x234d0d['uniqueid']+_0x2ecb('0x87')+md5(_0x234d0d[_0x2ecb('0x86')]);}else{_0x234d0d[_0x2ecb('0x84')]='';}var _0x1e734c=_0x2d6e1e['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x2d6e1e)['then'](function(_0x369069){_0x47e292=_0x369069;return getUser(_0x47e292,_0x1e734c,_0x2d6e1e);})[_0x2ecb('0x36')](function(_0x5b1a2f){_0x5e7652=_0x5b1a2f;logger[_0x2ecb('0x2f')](_0x2ecb('0x8a'),_0x5e7652['id']);return getEndUser(_0x47e292,_0x1e734c,_0x2d6e1e,_0x234d0d[_0x2ecb('0x8b')],_0x234d0d[_0x2ecb('0x8c')],_0x5e7652,_0x10e1c9);})[_0x2ecb('0x36')](function(_0x24caf9){_0x8dcad9=_0x24caf9;return getCall(_0x47e292,_0x1e734c,_0x2d6e1e,_0x5e7652,_0x8dcad9,_0x10e1c9,_0x234d0d,_0x2ecb('0x7a'));})[_0x2ecb('0x36')](function(_0x1d3bde){if(_0x1d3bde){logger[_0x2ecb('0x2f')](_0x2ecb('0x8d'),_0x1d3bde['id']);}})[_0x2ecb('0x2b')](function(_0x57f559){logger[_0x2ecb('0x2c')]('['+_0x234d0d[_0x2ecb('0x99')][_0x2ecb('0x9a')]()+']',JSON['stringify'](_0x57f559));});};
\ No newline at end of file
index f2d6950..9778ed0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe06e=['format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','data2','Script','data3','render','exec','error'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe06e,0xd5));var _0xee06=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0xe06e[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require(_0xee06('0x0'));var sh=require(_0xee06('0x1'));var Mustache=require(_0xee06('0x2'));var logger=require(_0xee06('0x3'))(_0xee06('0x4'));exports['exec']=function(_0x3d5a11,_0x29e3aa){var _0xe277a0=_0x3d5a11[_0xee06('0x5')]?_0x3d5a11[_0xee06('0x5')]:_0xee06('0x6');var _0x3cc268=_0x3d5a11[_0xee06('0x7')]?Mustache[_0xee06('0x8')](_0x3d5a11[_0xee06('0x7')],_0x29e3aa):_0x29e3aa;sh[_0xee06('0x9')](_0x3cc268,function(_0x366467,_0x3271a7,_0x382661){if(_0x366467!==0x0){logger[_0xee06('0xa')](util[_0xee06('0xb')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0xe277a0,_0x3cc268,_0x366467,_0x382661));}else{logger[_0xee06('0xc')](util['format'](_0xee06('0xd'),_0xe277a0,_0x3cc268,_0x3271a7));}});};
\ No newline at end of file
+var _0xe4e9=['error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script'];(function(_0x4f69db,_0x18c44d){var _0x31e6f4=function(_0x137c6b){while(--_0x137c6b){_0x4f69db['push'](_0x4f69db['shift']());}};_0x31e6f4(++_0x18c44d);}(_0xe4e9,0x16f));var _0x9e4e=function(_0x1cd47c,_0x5592fe){_0x1cd47c=_0x1cd47c-0x0;var _0x12b02f=_0xe4e9[_0x1cd47c];return _0x12b02f;};'use strict';var util=require('util');var sh=require(_0x9e4e('0x0'));var Mustache=require(_0x9e4e('0x1'));var logger=require(_0x9e4e('0x2'))(_0x9e4e('0x3'));exports[_0x9e4e('0x4')]=function(_0x3842c2,_0x5143c4){var _0x22e852=_0x3842c2[_0x9e4e('0x5')]?_0x3842c2[_0x9e4e('0x5')]:_0x9e4e('0x6');var _0x2ebcf1=_0x3842c2['data3']?Mustache['render'](_0x3842c2['data3'],_0x5143c4):_0x5143c4;sh[_0x9e4e('0x4')](_0x2ebcf1,function(_0x2135d3,_0x5ab738,_0x4087f4){if(_0x2135d3!==0x0){logger[_0x9e4e('0x7')](util['format'](_0x9e4e('0x8'),_0x22e852,_0x2ebcf1,_0x2135d3,_0x4087f4));}else{logger[_0x9e4e('0x9')](util[_0x9e4e('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x22e852,_0x2ebcf1,_0x5ab738));}});};
\ No newline at end of file
index af76231..8921458 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf62d=[',\x20request\x20body:\x20','object','statusCode','catch','name','message','request-promise','util','lodash','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xf62d,0x17c));var _0xdf62=function(_0x3dbdf3,_0x24618e){_0x3dbdf3=_0x3dbdf3-0x0;var _0x3ed9a8=_0xf62d[_0x3dbdf3];return _0x3ed9a8;};'use strict';var rp=require(_0xdf62('0x0'));var util=require(_0xdf62('0x1'));var _=require(_0xdf62('0x2'));var Mustache=require('mustache');var logger=require(_0xdf62('0x3'))(_0xdf62('0x4'));exports['exec']=function(_0x4baa0c,_0x1b7334){var _0x2ff1c5,_0x3e4469;var _0x4cb43b={'method':_0x4baa0c[_0xdf62('0x5')][_0xdf62('0x6')](),'uri':Mustache[_0xdf62('0x7')](_0x4baa0c[_0xdf62('0x8')],_0x1b7334),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4baa0c[_0xdf62('0x9')])===_0xdf62('0xa')&&parseInt(_0x4baa0c[_0xdf62('0x9')])>=0x1&&parseInt(_0x4baa0c['data5'])<=0xa?parseInt(_0x4baa0c['data5'])*0x3e8:0x5*0x3e8};try{_0x4cb43b[_0xdf62('0xb')]=_0x4baa0c[_0xdf62('0xc')]?JSON[_0xdf62('0xd')](Mustache[_0xdf62('0x7')](_0x4baa0c[_0xdf62('0xc')],_0x1b7334)):{};}catch(_0x2a75d9){logger[_0xdf62('0xe')](_0x2a75d9[_0xdf62('0xf')]);}switch(_0x4baa0c[_0xdf62('0x5')]['toUpperCase']()){case _0xdf62('0x10'):case _0xdf62('0x11'):_0x2ff1c5=null;_0x4cb43b['qs']=_0x1b7334;break;case _0xdf62('0x12'):case'PUT':if(_0x4baa0c['data7']){try{_0x2ff1c5=JSON[_0xdf62('0xd')](Mustache['render'](_0x4baa0c[_0xdf62('0x13')],_0x1b7334));_0x4cb43b['body']=_0x2ff1c5;}catch(_0x20aa48){logger[_0xdf62('0xe')](_0x20aa48[_0xdf62('0xf')]);logger['error'](_0xdf62('0x14'));}}else{_0x2ff1c5=_0x1b7334;_0x4cb43b[_0xdf62('0x15')]=_0x2ff1c5;}break;}logger[_0xdf62('0x16')](util[_0xdf62('0x17')](_0xdf62('0x18'),_0x4baa0c[_0xdf62('0x5')],_0x4baa0c[_0xdf62('0x8')],JSON[_0xdf62('0x19')](_0x4cb43b)));rp(_0x4cb43b)[_0xdf62('0x1a')](function(_0x2274f1){_0x2ff1c5=!_[_0xdf62('0x1b')](_0x2ff1c5)?_0xdf62('0x1c')+_0x2ff1c5:'';_0x3e4469=typeof _0x2274f1[_0xdf62('0x15')]===_0xdf62('0x1d')?JSON[_0xdf62('0x19')](_0x2274f1[_0xdf62('0x15')]):_0x2274f1[_0xdf62('0x15')];logger['info'](util[_0xdf62('0x17')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x4baa0c[_0xdf62('0x5')],_0x4baa0c[_0xdf62('0x8')],_0x2274f1[_0xdf62('0x1e')],_0x3e4469));})[_0xdf62('0x1f')](function(_0xdd9a61){logger[_0xdf62('0xe')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x4baa0c['data1'],_0x4baa0c[_0xdf62('0x8')],_0xdd9a61[_0xdf62('0x1e')],_0xdd9a61[_0xdf62('0x20')],_0xdd9a61[_0xdf62('0x21')]));});};
\ No newline at end of file
+var _0x8c94=['data2','then',',\x20request\x20body:\x20','stringify','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','number','data5','headers','data6','parse','error','toUpperCase','GET','DELETE','PUT','body','stack','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s'];(function(_0x611891,_0x34498d){var _0x285b64=function(_0x7fc9a0){while(--_0x7fc9a0){_0x611891['push'](_0x611891['shift']());}};_0x285b64(++_0x34498d);}(_0x8c94,0x6a));var _0x48c9=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x8c94[_0x13e741];return _0x3f8bb3;};'use strict';var rp=require(_0x48c9('0x0'));var util=require('util');var _=require(_0x48c9('0x1'));var Mustache=require(_0x48c9('0x2'));var logger=require(_0x48c9('0x3'))(_0x48c9('0x4'));exports[_0x48c9('0x5')]=function(_0xfcde36,_0x544383){var _0x90e91,_0x142aba;var _0x200c3a={'method':_0xfcde36[_0x48c9('0x6')]['toUpperCase'](),'uri':Mustache[_0x48c9('0x7')](_0xfcde36['data2'],_0x544383),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xfcde36['data5'])===_0x48c9('0x8')&&parseInt(_0xfcde36['data5'])>=0x1&&parseInt(_0xfcde36[_0x48c9('0x9')])<=0xa?parseInt(_0xfcde36[_0x48c9('0x9')])*0x3e8:0x5*0x3e8};try{_0x200c3a[_0x48c9('0xa')]=_0xfcde36[_0x48c9('0xb')]?JSON[_0x48c9('0xc')](Mustache['render'](_0xfcde36['data6'],_0x544383)):{};}catch(_0x25f14d){logger[_0x48c9('0xd')](_0x25f14d['stack']);}switch(_0xfcde36[_0x48c9('0x6')][_0x48c9('0xe')]()){case _0x48c9('0xf'):case _0x48c9('0x10'):_0x90e91=null;_0x200c3a['qs']=_0x544383;break;case'POST':case _0x48c9('0x11'):if(_0xfcde36['data7']){try{_0x90e91=JSON[_0x48c9('0xc')](Mustache[_0x48c9('0x7')](_0xfcde36['data7'],_0x544383));_0x200c3a[_0x48c9('0x12')]=_0x90e91;}catch(_0x1b6425){logger['error'](_0x1b6425[_0x48c9('0x13')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x90e91=_0x544383;_0x200c3a[_0x48c9('0x12')]=_0x90e91;}break;}logger['info'](util[_0x48c9('0x14')](_0x48c9('0x15'),_0xfcde36['data1'],_0xfcde36[_0x48c9('0x16')],JSON['stringify'](_0x200c3a)));rp(_0x200c3a)[_0x48c9('0x17')](function(_0x1e057e){_0x90e91=!_['isNil'](_0x90e91)?_0x48c9('0x18')+_0x90e91:'';_0x142aba=typeof _0x1e057e['body']==='object'?JSON[_0x48c9('0x19')](_0x1e057e[_0x48c9('0x12')]):_0x1e057e['body'];logger[_0x48c9('0x1a')](util['format'](_0x48c9('0x1b'),_0xfcde36[_0x48c9('0x6')],_0xfcde36[_0x48c9('0x16')],_0x1e057e['statusCode'],_0x142aba));})['catch'](function(_0x32cf47){logger[_0x48c9('0xd')](util[_0x48c9('0x14')](_0x48c9('0x1c'),_0xfcde36[_0x48c9('0x6')],_0xfcde36[_0x48c9('0x16')],_0x32cf47[_0x48c9('0x1d')],_0x32cf47[_0x48c9('0x1e')],_0x32cf47[_0x48c9('0x1f')]));});};
\ No newline at end of file
index 985d5be..02e844d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f77=['Request','request','then','debug','rpc','error','routing','message','result','bluebird','../../config/logger','http'];(function(_0x34933a,_0x327378){var _0x36abb4=function(_0x2d6814){while(--_0x2d6814){_0x34933a['push'](_0x34933a['shift']());}};_0x36abb4(++_0x327378);}(_0x6f77,0x189));var _0x76f7=function(_0x3746fe,_0x30b6b0){_0x3746fe=_0x3746fe-0x0;var _0xb3093d=_0x6f77[_0x3746fe];return _0xb3093d;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x76f7('0x0'));var logger=require(_0x76f7('0x1'))('routing');var client=jayson['client'][_0x76f7('0x2')]({'port':0x2329});client[_0x76f7('0x3')]=function(_0x2acc6d,_0x4f8962){return new BPromise(function(_0x3ec5ca,_0x3451d7){return client[_0x76f7('0x4')](_0x2acc6d,_0x4f8962)[_0x76f7('0x5')](function(_0x7169ac){logger[_0x76f7('0x6')](_0x76f7('0x7'),'routing',_0x2acc6d,_0x4f8962,_0x7169ac);if(_0x7169ac['error']){logger[_0x76f7('0x8')](_0x76f7('0x7'),_0x76f7('0x9'),_0x2acc6d,_0x7169ac['error'][_0x76f7('0xa')],_0x4f8962);return _0x3451d7(_0x7169ac[_0x76f7('0x8')][_0x76f7('0xa')]);}else{return _0x3ec5ca(_0x7169ac[_0x76f7('0xb')]);}})['catch'](function(_0x404aeb){logger[_0x76f7('0x8')](_0x76f7('0x7'),'routing',_0x2acc6d,_0x404aeb,_0x4f8962);return _0x3451d7(_0x404aeb);});});};module['exports']=client;
\ No newline at end of file
+var _0xc5c9=['rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','http','Request','request','then','debug'];(function(_0x330e73,_0x4c848a){var _0x1a2854=function(_0x151e14){while(--_0x151e14){_0x330e73['push'](_0x330e73['shift']());}};_0x1a2854(++_0x4c848a);}(_0xc5c9,0x164));var _0x9c5c=function(_0x399dfd,_0x400a71){_0x399dfd=_0x399dfd-0x0;var _0x9afbdd=_0xc5c9[_0x399dfd];return _0x9afbdd;};'use strict';var jayson=require(_0x9c5c('0x0'));var BPromise=require(_0x9c5c('0x1'));var logger=require('../../config/logger')(_0x9c5c('0x2'));var client=jayson['client'][_0x9c5c('0x3')]({'port':0x2329});client[_0x9c5c('0x4')]=function(_0x316884,_0x12965b){return new BPromise(function(_0x38b701,_0x312f8b){return client[_0x9c5c('0x5')](_0x316884,_0x12965b)[_0x9c5c('0x6')](function(_0x357e42){logger[_0x9c5c('0x7')](_0x9c5c('0x8'),'routing',_0x316884,_0x12965b,_0x357e42);if(_0x357e42['error']){logger[_0x9c5c('0x9')](_0x9c5c('0x8'),_0x9c5c('0x2'),_0x316884,_0x357e42[_0x9c5c('0x9')]['message'],_0x12965b);return _0x312f8b(_0x357e42[_0x9c5c('0x9')][_0x9c5c('0xa')]);}else{return _0x38b701(_0x357e42[_0x9c5c('0xb')]);}})[_0x9c5c('0xc')](function(_0x3acfa1){logger[_0x9c5c('0x9')](_0x9c5c('0x8'),_0x9c5c('0x2'),_0x316884,_0x3acfa1,_0x12965b);return _0x312f8b(_0x3acfa1);});});};module[_0x9c5c('0xd')]=client;
\ No newline at end of file
index cc2d6cb..8746ba1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x853f=['getMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then'];(function(_0x71f9ca,_0x326e46){var _0x16ac94=function(_0x4fbf07){while(--_0x4fbf07){_0x71f9ca['push'](_0x71f9ca['shift']());}};_0x16ac94(++_0x326e46);}(_0x853f,0x1cd));var _0xf853=function(_0x142434,_0x5e630d){_0x142434=_0x142434-0x0;var _0x2ca867=_0x853f[_0x142434];return _0x2ca867;};'use strict';var server=require(_0xf853('0x0'));var Realtime=require(_0xf853('0x1'));var EmailChannel=require(_0xf853('0x2'));var mailAccount=require(_0xf853('0x3'));var setting=require(_0xf853('0x4'));var logger=require('../../config/logger')('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xf853('0x5')]()[_0xf853('0x6')](mailAccount[_0xf853('0x7')]())[_0xf853('0x6')](realtime['initMailAccounts']())[_0xf853('0x6')](function(){email[_0xf853('0x8')](realtime[_0xf853('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xf853('0x6')](function(){return initRealtime();})['then'](function(){return setting[_0xf853('0xa')]();})[_0xf853('0x6')](function(_0x2271ec){return setInterval(initRealtime,_0x2271ec[_0xf853('0xb')]*0x3e8);})['catch'](function(_0x4b9678){logger[_0xf853('0xc')]('Email\x20service\x20initialization',_0x4b9678);});}main();
\ No newline at end of file
+var _0x262a=['../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting'];(function(_0x35d3a8,_0x44406a){var _0x182378=function(_0x298e0b){while(--_0x298e0b){_0x35d3a8['push'](_0x35d3a8['shift']());}};_0x182378(++_0x44406a);}(_0x262a,0x16b));var _0xa262=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0x262a[_0x3f477c];return _0x4c36b3;};'use strict';var server=require(_0xa262('0x0'));var Realtime=require(_0xa262('0x1'));var EmailChannel=require(_0xa262('0x2'));var mailAccount=require(_0xa262('0x3'));var setting=require(_0xa262('0x4'));var logger=require(_0xa262('0x5'))(_0xa262('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xa262('0x7')]()[_0xa262('0x8')](mailAccount[_0xa262('0x9')]())[_0xa262('0x8')](realtime[_0xa262('0xa')]())[_0xa262('0x8')](function(){email['refresh'](realtime[_0xa262('0xb')]);return realtime;});}function main(){return server[_0xa262('0xc')](realtime,email)[_0xa262('0x8')](function(){return initRealtime();})[_0xa262('0x8')](function(){return setting[_0xa262('0xd')]();})['then'](function(_0x5693c7){return setInterval(initRealtime,_0x5693c7[_0xa262('0xe')]*0x3e8);})[_0xa262('0xf')](function(_0x3b521d){logger['error']('Email\x20service\x20initialization',_0x3b521d);});}main();
\ No newline at end of file
index 9a95e26..a39580f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec4c=['active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','service','provider','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','disabled','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','then','verified','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key'];(function(_0x23889b,_0x588ae1){var _0x3b38c2=function(_0x4d614f){while(--_0x4d614f){_0x23889b['push'](_0x23889b['shift']());}};_0x3b38c2(++_0x588ae1);}(_0xec4c,0xd0));var _0xcec4=function(_0x117f4c,_0x36a9b1){_0x117f4c=_0x117f4c-0x0;var _0x2b24e9=_0xec4c[_0x117f4c];return _0x2b24e9;};'use strict';var _=require('lodash');var moment=require(_0xcec4('0x0'));var BPromise=require(_0xcec4('0x1'));var md5=require(_0xcec4('0x2'));var Redis=require(_0xcec4('0x3'));var config=require(_0xcec4('0x4'));var logger=require('../../../config/logger')(_0xcec4('0x5'));config[_0xcec4('0x6')]=_[_0xcec4('0x7')](config['redis'],{'host':_0xcec4('0x8'),'port':0x18eb});var io=require(_0xcec4('0x9'))(new Redis(config[_0xcec4('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require(_0xcec4('0xa'));var mailAccount=require(_0xcec4('0xb'));var md5Accounts={};function EmailChannel(_0x48a464){logger[_0xcec4('0xc')](_0xcec4('0xd'));this[_0xcec4('0xe')]=_0x48a464['mailAccounts'];this[_0xcec4('0xf')]={};this[_0xcec4('0x10')]=new EmailSmtp();}EmailChannel[_0xcec4('0x11')][_0xcec4('0x12')]=function(_0x30ccc7){var _0x27db38=this[_0xcec4('0xe')][_0x30ccc7];var _0x3e58c3={'id':_0x27db38['id'],'name':_0x27db38['name'],'key':_0x27db38[_0xcec4('0x13')],'active':_0x27db38[_0xcec4('0x14')],'Imap':{'status':_0x27db38[_0xcec4('0x15')][_0xcec4('0x16')],'messageStatus':_0x27db38['Imap'][_0xcec4('0x17')],'total':_0x27db38['Imap'][_0xcec4('0x18')]}};if(_[_0xcec4('0x19')](md5Accounts[_0x30ccc7])){md5Accounts[_0x30ccc7]={};}var _0x167b2e=md5(JSON[_0xcec4('0x1a')](_0x3e58c3));if(md5Accounts[_0x30ccc7][_0xcec4('0x2')]!==_0x167b2e){md5Accounts[_0x30ccc7][_0xcec4('0x2')]=_0x167b2e;io['emit'](_0xcec4('0x1b'),_0x3e58c3);}};EmailChannel[_0xcec4('0x11')][_0xcec4('0x1c')]=function(_0x5775f7){for(var _0x19f04b in _0x5775f7){if(_0x5775f7['hasOwnProperty'](_0x19f04b)){if(_0x5775f7[_0x19f04b][_0xcec4('0x15')]&&_0x5775f7[_0x19f04b][_0xcec4('0x14')]){var _0x5bd2e2=_0x5775f7[_0x19f04b][_0xcec4('0x15')];if(!_0x5bd2e2[_0xcec4('0x1d')]&&_0x5775f7[_0x19f04b][_0xcec4('0x1e')]!=='custom')_0x5bd2e2['service']=_0x5775f7[_0x19f04b]['provider'];if(!this[_0xcec4('0xf')]['hasOwnProperty'](_0x5bd2e2['id'])){this[_0xcec4('0xf')][_0x5bd2e2['id']]=new EmailImap(_0x5bd2e2,_0x5775f7[_0x19f04b][_0xcec4('0x5')]);this[_0xcec4('0xf')][_0x5bd2e2['id']]['on']('box',this[_0xcec4('0x1f')]['bind'](this,_0x19f04b));this[_0xcec4('0xf')][_0x5bd2e2['id']]['on']('email',this[_0xcec4('0x20')][_0xcec4('0x21')](this,_0x19f04b));this[_0xcec4('0xf')][_0x5bd2e2['id']]['on'](_0xcec4('0x22'),this[_0xcec4('0x23')][_0xcec4('0x21')](this,_0x19f04b));this['imapAccounts'][_0x5bd2e2['id']]['on'](_0xcec4('0x24'),this[_0xcec4('0x25')][_0xcec4('0x21')](this,_0x19f04b));}}else{if(_[_0xcec4('0x19')](this[_0xcec4('0xe')][_0x19f04b][_0xcec4('0x15')])){this[_0xcec4('0xe')][_0x19f04b][_0xcec4('0x15')]={};}this['mailAccounts'][_0x19f04b][_0xcec4('0x15')][_0xcec4('0x16')]=_0xcec4('0x26');this['mailAccounts'][_0x19f04b][_0xcec4('0x15')][_0xcec4('0x17')]='';this[_0xcec4('0x12')](_0x19f04b);}}}};EmailChannel[_0xcec4('0x11')]['handleImapBox']=function(_0x358a3a,_0x2b3909){if(this[_0xcec4('0xe')][_0x358a3a]){this['mailAccounts'][_0x358a3a][_0xcec4('0x15')][_0xcec4('0x16')]=_0xcec4('0x27');this['mailAccounts'][_0x358a3a][_0xcec4('0x15')]['messageStatus']=_0x2b3909[_0xcec4('0x28')];if(_0x2b3909[_0xcec4('0x29')]){this[_0xcec4('0xe')][_0x358a3a]['Imap'][_0xcec4('0x18')]=_0x2b3909[_0xcec4('0x29')]['total'];}return this[_0xcec4('0x12')](_0x358a3a);}};EmailChannel[_0xcec4('0x11')]['handleImapEmail']=function(_0x5ab8fb,_0x19d660){logger[_0xcec4('0xc')](_0xcec4('0x2a'),_0x19d660['firstName'],_0x19d660[_0xcec4('0x2b')],_0x19d660[_0xcec4('0x2c')],_0x5ab8fb);if(this[_0xcec4('0xe')][_0x5ab8fb]){return mailAccount[_0xcec4('0x2d')](_0x5ab8fb,_0x19d660)['then'](function(_0x35ebbd){if(_0x35ebbd){logger[_0xcec4('0xc')](_0xcec4('0x2e'));}})[_0xcec4('0x2f')](function(_0x885802){logger[_0xcec4('0x24')](_0xcec4('0x30'),JSON[_0xcec4('0x1a')](_0x885802));});}};EmailChannel[_0xcec4('0x11')]['handleImapEnd']=function(_0x3ea2f8){if(this[_0xcec4('0xe')][_0x3ea2f8]&&this[_0xcec4('0xe')][_0x3ea2f8][_0xcec4('0x15')]){if(this[_0xcec4('0xf')][this[_0xcec4('0xe')][_0x3ea2f8][_0xcec4('0x15')]['id']]){delete this[_0xcec4('0xf')][this[_0xcec4('0xe')][_0x3ea2f8]['Imap']['id']];}this[_0xcec4('0xe')][_0x3ea2f8][_0xcec4('0x15')][_0xcec4('0x31')]=moment();this[_0xcec4('0x12')](_0x3ea2f8);}};EmailChannel[_0xcec4('0x11')][_0xcec4('0x25')]=function(_0x1c2d42,_0x252f19){if(this[_0xcec4('0xe')][_0x1c2d42]){this[_0xcec4('0xe')][_0x1c2d42][_0xcec4('0x15')][_0xcec4('0x16')]=_0xcec4('0x24');this[_0xcec4('0xe')][_0x1c2d42][_0xcec4('0x15')][_0xcec4('0x17')]=_0x252f19;return this['emit'](_0x1c2d42);}};EmailChannel[_0xcec4('0x11')][_0xcec4('0x32')]=function(_0x4f9067,_0x169e46){return this[_0xcec4('0x10')][_0xcec4('0x33')](_0x4f9067,_0x169e46);};EmailChannel[_0xcec4('0x11')][_0xcec4('0x34')]=function(_0x25d9c3){var _0xb68636=this;if(this[_0xcec4('0xe')][_0x25d9c3['id']]){if(_[_0xcec4('0x19')](this[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')])){this[_0xcec4('0xe')][_0x25d9c3['id']]['Smtp']={};}this[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')]['lastSync']=moment();return new BPromise(function(_0x1ac7b7,_0x3c0776){return _0xb68636['smtp'][_0xcec4('0x36')](_0x25d9c3)[_0xcec4('0x37')](function(_0x20a288){_0xb68636[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')][_0xcec4('0x16')]=_0xcec4('0x38');_0xb68636[_0xcec4('0xe')][_0x25d9c3['id']]['Smtp']['messageStatus']='';_0xb68636[_0xcec4('0x12')](_0x25d9c3['id']);_0x1ac7b7(_0x20a288);})[_0xcec4('0x2f')](function(_0xe0dc52){_0xb68636['mailAccounts'][_0x25d9c3['id']][_0xcec4('0x35')][_0xcec4('0x16')]=_0xcec4('0x24');_0xb68636[_0xcec4('0xe')][_0x25d9c3['id']][_0xcec4('0x35')][_0xcec4('0x17')]=_0xe0dc52;_0xb68636[_0xcec4('0x12')](_0x25d9c3['id']);_0x3c0776(_0xe0dc52);});});}return this[_0xcec4('0x10')][_0xcec4('0x36')](_0x25d9c3);};module['exports']=EmailChannel;
\ No newline at end of file
+var _0x602e=['../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','Imap','messageStatus','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','active','service','provider','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','status','connected','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verified','verify','lodash','moment','ioredis','../../../config/environment'];(function(_0x270d0d,_0x3fe5af){var _0x1e000b=function(_0x1e241a){while(--_0x1e241a){_0x270d0d['push'](_0x270d0d['shift']());}};_0x1e000b(++_0x3fe5af);}(_0x602e,0x6a));var _0xe602=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x602e[_0x1d1d09];return _0x8827e;};'use strict';var _=require(_0xe602('0x0'));var moment=require(_0xe602('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0xe602('0x2'));var config=require(_0xe602('0x3'));var logger=require(_0xe602('0x4'))(_0xe602('0x5'));config[_0xe602('0x6')]=_['defaults'](config['redis'],{'host':_0xe602('0x7'),'port':0x18eb});var io=require(_0xe602('0x8'))(new Redis(config[_0xe602('0x6')]));var EmailImap=require(_0xe602('0x9'));var EmailSmtp=require(_0xe602('0xa'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x1a5544){logger[_0xe602('0xb')](_0xe602('0xc'));this[_0xe602('0xd')]=_0x1a5544[_0xe602('0xd')];this[_0xe602('0xe')]={};this[_0xe602('0xf')]=new EmailSmtp();}EmailChannel[_0xe602('0x10')][_0xe602('0x11')]=function(_0x179a43){var _0xe4dfbb=this['mailAccounts'][_0x179a43];var _0x5b705f={'id':_0xe4dfbb['id'],'name':_0xe4dfbb[_0xe602('0x12')],'key':_0xe4dfbb['key'],'active':_0xe4dfbb['active'],'Imap':{'status':_0xe4dfbb[_0xe602('0x13')]['status'],'messageStatus':_0xe4dfbb[_0xe602('0x13')][_0xe602('0x14')],'total':_0xe4dfbb[_0xe602('0x13')]['total']}};if(_[_0xe602('0x15')](md5Accounts[_0x179a43])){md5Accounts[_0x179a43]={};}var _0xfbd5d6=md5(JSON[_0xe602('0x16')](_0x5b705f));if(md5Accounts[_0x179a43][_0xe602('0x17')]!==_0xfbd5d6){md5Accounts[_0x179a43][_0xe602('0x17')]=_0xfbd5d6;io[_0xe602('0x11')](_0xe602('0x18'),_0x5b705f);}};EmailChannel['prototype'][_0xe602('0x19')]=function(_0x1c83ee){for(var _0x210592 in _0x1c83ee){if(_0x1c83ee[_0xe602('0x1a')](_0x210592)){if(_0x1c83ee[_0x210592]['Imap']&&_0x1c83ee[_0x210592][_0xe602('0x1b')]){var _0x59f31f=_0x1c83ee[_0x210592][_0xe602('0x13')];if(!_0x59f31f[_0xe602('0x1c')]&&_0x1c83ee[_0x210592][_0xe602('0x1d')]!=='custom')_0x59f31f[_0xe602('0x1c')]=_0x1c83ee[_0x210592]['provider'];if(!this[_0xe602('0xe')][_0xe602('0x1a')](_0x59f31f['id'])){this[_0xe602('0xe')][_0x59f31f['id']]=new EmailImap(_0x59f31f,_0x1c83ee[_0x210592][_0xe602('0x5')]);this['imapAccounts'][_0x59f31f['id']]['on'](_0xe602('0x1e'),this[_0xe602('0x1f')][_0xe602('0x20')](this,_0x210592));this[_0xe602('0xe')][_0x59f31f['id']]['on'](_0xe602('0x5'),this[_0xe602('0x21')][_0xe602('0x20')](this,_0x210592));this[_0xe602('0xe')][_0x59f31f['id']]['on'](_0xe602('0x22'),this[_0xe602('0x23')]['bind'](this,_0x210592));this['imapAccounts'][_0x59f31f['id']]['on']('error',this[_0xe602('0x24')]['bind'](this,_0x210592));}}else{if(_['isNil'](this['mailAccounts'][_0x210592][_0xe602('0x13')])){this[_0xe602('0xd')][_0x210592][_0xe602('0x13')]={};}this[_0xe602('0xd')][_0x210592]['Imap']['status']='disabled';this[_0xe602('0xd')][_0x210592][_0xe602('0x13')][_0xe602('0x14')]='';this[_0xe602('0x11')](_0x210592);}}}};EmailChannel[_0xe602('0x10')][_0xe602('0x1f')]=function(_0x4e9722,_0x171eff){if(this[_0xe602('0xd')][_0x4e9722]){this[_0xe602('0xd')][_0x4e9722][_0xe602('0x13')][_0xe602('0x25')]=_0xe602('0x26');this[_0xe602('0xd')][_0x4e9722][_0xe602('0x13')][_0xe602('0x14')]=_0x171eff[_0xe602('0x12')];if(_0x171eff['messages']){this['mailAccounts'][_0x4e9722][_0xe602('0x13')][_0xe602('0x27')]=_0x171eff['messages'][_0xe602('0x27')];}return this[_0xe602('0x11')](_0x4e9722);}};EmailChannel[_0xe602('0x10')]['handleImapEmail']=function(_0x47690d,_0x3c8625){logger[_0xe602('0xb')](_0xe602('0x28'),_0x3c8625[_0xe602('0x29')],_0x3c8625[_0xe602('0x2a')],_0x3c8625[_0xe602('0x2b')],_0x47690d);if(this[_0xe602('0xd')][_0x47690d]){return mailAccount[_0xe602('0x2c')](_0x47690d,_0x3c8625)[_0xe602('0x2d')](function(_0x19ff76){if(_0x19ff76){logger[_0xe602('0xb')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x2bd327){logger[_0xe602('0x2e')](_0xe602('0x2f'),JSON[_0xe602('0x16')](_0x2bd327));});}};EmailChannel['prototype'][_0xe602('0x23')]=function(_0x151684){if(this[_0xe602('0xd')][_0x151684]&&this[_0xe602('0xd')][_0x151684]['Imap']){if(this[_0xe602('0xe')][this[_0xe602('0xd')][_0x151684][_0xe602('0x13')]['id']]){delete this['imapAccounts'][this[_0xe602('0xd')][_0x151684][_0xe602('0x13')]['id']];}this['mailAccounts'][_0x151684][_0xe602('0x13')]['lastSync']=moment();this['emit'](_0x151684);}};EmailChannel[_0xe602('0x10')][_0xe602('0x24')]=function(_0x3694cb,_0xeb3ac5){if(this[_0xe602('0xd')][_0x3694cb]){this['mailAccounts'][_0x3694cb][_0xe602('0x13')][_0xe602('0x25')]=_0xe602('0x2e');this[_0xe602('0xd')][_0x3694cb][_0xe602('0x13')]['messageStatus']=_0xeb3ac5;return this['emit'](_0x3694cb);}};EmailChannel[_0xe602('0x10')][_0xe602('0x30')]=function(_0x5cafcb,_0x248132){return this[_0xe602('0xf')][_0xe602('0x31')](_0x5cafcb,_0x248132);};EmailChannel[_0xe602('0x10')][_0xe602('0x32')]=function(_0x590267){var _0x285379=this;if(this[_0xe602('0xd')][_0x590267['id']]){if(_[_0xe602('0x15')](this[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')])){this[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')]={};}this[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')][_0xe602('0x34')]=moment();return new BPromise(function(_0x2bee93,_0x11029b){return _0x285379['smtp']['verify'](_0x590267)[_0xe602('0x2d')](function(_0xdb17c3){_0x285379[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')]['status']=_0xe602('0x35');_0x285379[_0xe602('0xd')][_0x590267['id']]['Smtp'][_0xe602('0x14')]='';_0x285379[_0xe602('0x11')](_0x590267['id']);_0x2bee93(_0xdb17c3);})['catch'](function(_0x3943bd){_0x285379[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')][_0xe602('0x25')]=_0xe602('0x2e');_0x285379[_0xe602('0xd')][_0x590267['id']][_0xe602('0x33')]['messageStatus']=_0x3943bd;_0x285379[_0xe602('0x11')](_0x590267['id']);_0x11029b(_0x3943bd);});});}return this['smtp'][_0xe602('0x36')](_0x590267);};module['exports']=EmailChannel;
\ No newline at end of file
index cdb5532..0da1e92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6866=['end','handleEnd','error','handleError','connect','prototype','connTimeout','authTimeout','service','user','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','handleReady','openBox','handleOpenBox','emit','box','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchEnd','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','mailbox','account','getAccount','once','bind'];(function(_0x1d0e71,_0x1aaecd){var _0x16376e=function(_0x472cf9){while(--_0x472cf9){_0x1d0e71['push'](_0x1d0e71['shift']());}};_0x16376e(++_0x1aaecd);}(_0x6866,0xe4));var _0x6686=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6866[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x6686('0x0'));var util=require(_0x6686('0x1'));var Imap=require(_0x6686('0x2'));var simpleParser=require(_0x6686('0x3'))[_0x6686('0x4')];var Iconv=require(_0x6686('0x5'))[_0x6686('0x6')];var EventEmitter=require(_0x6686('0x7'))['EventEmitter'];var utils=require(_0x6686('0x8'));var logger=require(_0x6686('0x9'))(_0x6686('0xa'));function EmailImap(_0x1df4a8,_0x59d0f5){this[_0x6686('0xb')]=_0x1df4a8[_0x6686('0xb')];this[_0x6686('0xc')]=this[_0x6686('0xd')](_0x1df4a8,_0x59d0f5);this[_0x6686('0x2')]=new Imap(this[_0x6686('0xc')]);this[_0x6686('0x2')][_0x6686('0xe')]('ready',this['handleReady'][_0x6686('0xf')](this));this[_0x6686('0x2')][_0x6686('0xe')](_0x6686('0x10'),this[_0x6686('0x11')][_0x6686('0xf')](this));this[_0x6686('0x2')]['on'](_0x6686('0x12'),this[_0x6686('0x13')][_0x6686('0xf')](this));this[_0x6686('0x2')][_0x6686('0x14')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x6686('0x15')][_0x6686('0xd')]=function(_0x546993,_0x2926ae){var _0x124350={'connTimeout':_0x546993[_0x6686('0x16')]?_0x546993[_0x6686('0x16')]*0x3e8:0x2710,'authTimeout':_0x546993[_0x6686('0x17')]?_0x546993[_0x6686('0x17')]*0x3e8:0x1388};if(_0x546993[_0x6686('0x18')]){_0x124350[_0x6686('0x19')]=_0x546993['user'];if(_0x546993[_0x6686('0x1a')]){_0x124350['xoauth2']=utils[_0x6686('0x1b')](_0x546993[_0x6686('0x1c')][_0x6686('0x1d')],_0x546993[_0x6686('0x19')]);}else{_0x124350[_0x6686('0x1e')]=_0x546993[_0x6686('0x1e')];}}else{if(_0x546993[_0x6686('0x1f')]){_0x124350[_0x6686('0x19')]=_0x546993[_0x6686('0x19')];_0x124350[_0x6686('0x1e')]=_0x546993[_0x6686('0x1e')];}}_0x124350['email']=_0x2926ae||_0x546993[_0x6686('0x19')]||_0x6686('0x20');_0x124350[_0x6686('0x21')]=_0x546993[_0x6686('0x21')];_0x124350[_0x6686('0x22')]=_0x546993[_0x6686('0x22')]||0x3e1;if(_0x546993[_0x6686('0x23')]){_0x124350[_0x6686('0x23')]=!![];}else{_0x124350[_0x6686('0x23')]=![];_0x124350[_0x6686('0x24')]=_0x6686('0x25');}return _0x124350;};EmailImap[_0x6686('0x15')][_0x6686('0x26')]=function(){this[_0x6686('0x2')][_0x6686('0x27')](this[_0x6686('0xb')],![],this[_0x6686('0x28')][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x28')]=function(_0x24915e,_0x40a48f){if(_0x24915e){this[_0x6686('0x13')](_0x24915e,!![]);}else{this[_0x6686('0x29')](_0x6686('0x2a'),_0x40a48f);this['readUnseen']();}};EmailImap[_0x6686('0x15')]['handleCloseBox']=function(_0x2d5ed2){if(_0x2d5ed2){this[_0x6686('0x13')](_0x2d5ed2,!![]);}else{this['imap']['end']();}};EmailImap['prototype']['readUnseen']=function(){this[_0x6686('0x2')][_0x6686('0x2b')]([_0x6686('0x2c')],this[_0x6686('0x2d')][_0x6686('0xf')](this));};EmailImap['prototype'][_0x6686('0x2d')]=function(_0x4af678,_0x1e9e54){if(_0x4af678){this[_0x6686('0x13')](_0x4af678,!![]);}else{if(_0x1e9e54[_0x6686('0x2e')]){try{var _0x170f5f=this['imap'][_0x6686('0x2f')](_0x1e9e54,{'bodies':'','markSeen':!![]});_0x170f5f['on']('message',this[_0x6686('0x30')][_0x6686('0xf')](this));_0x170f5f[_0x6686('0xe')](_0x6686('0x12'),this['handleFetchError'][_0x6686('0xf')](this));_0x170f5f[_0x6686('0xe')]('end',this[_0x6686('0x31')]['bind'](this));}catch(_0x16c948){logger[_0x6686('0x12')](_0x16c948);}}else{this[_0x6686('0x2')][_0x6686('0x32')](!![],this[_0x6686('0x33')][_0x6686('0xf')](this));}}};EmailImap[_0x6686('0x15')][_0x6686('0x30')]=function(_0x5cf931){_0x5cf931['on']('body',this[_0x6686('0x34')]['bind'](this));_0x5cf931[_0x6686('0xe')](_0x6686('0x35'),this['handleMessageAttributes'][_0x6686('0xf')](this));_0x5cf931[_0x6686('0xe')](_0x6686('0x10'),this['handleMessageEnd'][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x34')]=function(_0x3bc346){simpleParser(_0x3bc346,{'Iconv':Iconv},this['handleSimpleParser'][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')]['handleMessageAttributes']=function(){};EmailImap[_0x6686('0x15')][_0x6686('0x36')]=function(){};EmailImap[_0x6686('0x15')][_0x6686('0x37')]=function(_0x29b508,_0x3fbfe1){if(_0x29b508){logger[_0x6686('0x12')](_0x29b508);}else{var _0x47e0cf=this;utils[_0x6686('0x38')](this['account'],_0x3fbfe1,function(_0x537cea){_0x47e0cf['emit']('email',_0x537cea);});}};EmailImap[_0x6686('0x15')][_0x6686('0x31')]=function(){this[_0x6686('0x2')][_0x6686('0x32')](!![],this[_0x6686('0x33')][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x39')]=function(_0x10cc79){this[_0x6686('0x13')](_0x10cc79);this[_0x6686('0x2')][_0x6686('0x32')](!![],this[_0x6686('0x33')][_0x6686('0xf')](this));};EmailImap[_0x6686('0x15')][_0x6686('0x11')]=function(){this[_0x6686('0x29')](_0x6686('0x10'));};EmailImap[_0x6686('0x15')][_0x6686('0x13')]=function(_0x598970,_0x3ba0ab){logger['error'](_0x6686('0x13'),this[_0x6686('0xc')][_0x6686('0xa')],JSON['stringify'](_0x598970));var _0x4113fb='';if(_0x598970){if(_0x598970[_0x6686('0x3a')]){_0x4113fb=_0x598970[_0x6686('0x3a')];}else{for(var _0x223e26 in _0x598970){if(_0x598970[_0x6686('0x3b')](_0x223e26)){_0x4113fb+=_['upperFirst'](_0x223e26)+':\x20'+_0x598970[_0x223e26]+'\x0a';}}}}if(_0x3ba0ab){this[_0x6686('0x2')][_0x6686('0x10')]();}else{this[_0x6686('0x29')](_0x6686('0x12'),_0x4113fb);this[_0x6686('0x29')](_0x6686('0x10'));}};module[_0x6686('0x3c')]=EmailImap;
\ No newline at end of file
+var _0xe125=['user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','handleCloseBox','readUnseen','search','UNSEEN','length','fetch','message','handleFetchMessage','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','handleFetchError','stringify','textCode','hasOwnProperty','upperFirst','lodash','imap','mailparser','iconv','Iconv','events','EventEmitter','./utils','mailbox','account','getAccount','handleReady','bind','once','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xe125,0x1d9));var _0x5e12=function(_0x53eb8e,_0x15bd61){_0x53eb8e=_0x53eb8e-0x0;var _0x3bced1=_0xe125[_0x53eb8e];return _0x3bced1;};'use strict';var _=require(_0x5e12('0x0'));var util=require('util');var Imap=require(_0x5e12('0x1'));var simpleParser=require(_0x5e12('0x2'))['simpleParser'];var Iconv=require(_0x5e12('0x3'))[_0x5e12('0x4')];var EventEmitter=require(_0x5e12('0x5'))[_0x5e12('0x6')];var utils=require(_0x5e12('0x7'));var logger=require('../../../config/logger')('email');function EmailImap(_0x485b6c,_0x25eeab){this[_0x5e12('0x8')]=_0x485b6c[_0x5e12('0x8')];this[_0x5e12('0x9')]=this[_0x5e12('0xa')](_0x485b6c,_0x25eeab);this['imap']=new Imap(this['account']);this[_0x5e12('0x1')]['once']('ready',this[_0x5e12('0xb')][_0x5e12('0xc')](this));this[_0x5e12('0x1')][_0x5e12('0xd')](_0x5e12('0xe'),this[_0x5e12('0xf')][_0x5e12('0xc')](this));this[_0x5e12('0x1')]['on'](_0x5e12('0x10'),this[_0x5e12('0x11')][_0x5e12('0xc')](this));this['imap']['connect']();}util[_0x5e12('0x12')](EmailImap,EventEmitter);EmailImap[_0x5e12('0x13')][_0x5e12('0xa')]=function(_0xcbe5f7,_0x8bfdb){var _0xff6977={'connTimeout':_0xcbe5f7[_0x5e12('0x14')]?_0xcbe5f7['connTimeout']*0x3e8:0x2710,'authTimeout':_0xcbe5f7[_0x5e12('0x15')]?_0xcbe5f7[_0x5e12('0x15')]*0x3e8:0x1388};if(_0xcbe5f7[_0x5e12('0x16')]){_0xff6977[_0x5e12('0x17')]=_0xcbe5f7[_0x5e12('0x17')];if(_0xcbe5f7[_0x5e12('0x18')]){_0xff6977[_0x5e12('0x19')]=utils[_0x5e12('0x1a')](_0xcbe5f7[_0x5e12('0x1b')][_0x5e12('0x1c')],_0xcbe5f7['user']);}else{_0xff6977[_0x5e12('0x1d')]=_0xcbe5f7[_0x5e12('0x1d')];}}else{if(_0xcbe5f7[_0x5e12('0x1e')]){_0xff6977[_0x5e12('0x17')]=_0xcbe5f7[_0x5e12('0x17')];_0xff6977[_0x5e12('0x1d')]=_0xcbe5f7[_0x5e12('0x1d')];}}_0xff6977[_0x5e12('0x1f')]=_0x8bfdb||_0xcbe5f7['user']||_0x5e12('0x20');_0xff6977['host']=_0xcbe5f7[_0x5e12('0x21')];_0xff6977[_0x5e12('0x22')]=_0xcbe5f7[_0x5e12('0x22')]||0x3e1;if(_0xcbe5f7[_0x5e12('0x23')]){_0xff6977[_0x5e12('0x23')]=!![];}else{_0xff6977[_0x5e12('0x23')]=![];_0xff6977[_0x5e12('0x24')]=_0x5e12('0x25');}return _0xff6977;};EmailImap['prototype']['handleReady']=function(){this[_0x5e12('0x1')][_0x5e12('0x26')](this[_0x5e12('0x8')],![],this[_0x5e12('0x27')][_0x5e12('0xc')](this));};EmailImap['prototype'][_0x5e12('0x27')]=function(_0x14e662,_0x440faa){if(_0x14e662){this[_0x5e12('0x11')](_0x14e662,!![]);}else{this[_0x5e12('0x28')]('box',_0x440faa);this['readUnseen']();}};EmailImap['prototype'][_0x5e12('0x29')]=function(_0x136547){if(_0x136547){this[_0x5e12('0x11')](_0x136547,!![]);}else{this['imap'][_0x5e12('0xe')]();}};EmailImap['prototype'][_0x5e12('0x2a')]=function(){this[_0x5e12('0x1')][_0x5e12('0x2b')]([_0x5e12('0x2c')],this['handleReadUnseen'][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')]['handleReadUnseen']=function(_0x19ec97,_0x1b46a2){if(_0x19ec97){this[_0x5e12('0x11')](_0x19ec97,!![]);}else{if(_0x1b46a2[_0x5e12('0x2d')]){try{var _0x59fd88=this['imap'][_0x5e12('0x2e')](_0x1b46a2,{'bodies':'','markSeen':!![]});_0x59fd88['on'](_0x5e12('0x2f'),this[_0x5e12('0x30')]['bind'](this));_0x59fd88['once']('error',this['handleFetchError'][_0x5e12('0xc')](this));_0x59fd88[_0x5e12('0xd')](_0x5e12('0xe'),this[_0x5e12('0x31')]['bind'](this));}catch(_0x42600c){logger[_0x5e12('0x10')](_0x42600c);}}else{this['imap'][_0x5e12('0x32')](!![],this[_0x5e12('0x29')][_0x5e12('0xc')](this));}}};EmailImap[_0x5e12('0x13')][_0x5e12('0x30')]=function(_0x57270c){_0x57270c['on']('body',this[_0x5e12('0x33')][_0x5e12('0xc')](this));_0x57270c[_0x5e12('0xd')](_0x5e12('0x34'),this[_0x5e12('0x35')][_0x5e12('0xc')](this));_0x57270c[_0x5e12('0xd')](_0x5e12('0xe'),this[_0x5e12('0x36')]['bind'](this));};EmailImap[_0x5e12('0x13')][_0x5e12('0x33')]=function(_0x5063db){simpleParser(_0x5063db,{'Iconv':Iconv},this[_0x5e12('0x37')][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')]['handleMessageAttributes']=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x1cffba,_0x10f588){if(_0x1cffba){logger['error'](_0x1cffba);}else{var _0x1cb573=this;utils[_0x5e12('0x38')](this['account'],_0x10f588,function(_0xeb913){_0x1cb573[_0x5e12('0x28')]('email',_0xeb913);});}};EmailImap['prototype'][_0x5e12('0x31')]=function(){this[_0x5e12('0x1')]['closeBox'](!![],this[_0x5e12('0x29')][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')][_0x5e12('0x39')]=function(_0x3eff0a){this['handleError'](_0x3eff0a);this[_0x5e12('0x1')][_0x5e12('0x32')](!![],this['handleCloseBox'][_0x5e12('0xc')](this));};EmailImap[_0x5e12('0x13')]['handleEnd']=function(){this[_0x5e12('0x28')](_0x5e12('0xe'));};EmailImap[_0x5e12('0x13')]['handleError']=function(_0x4a1aa1,_0x485d04){logger[_0x5e12('0x10')](_0x5e12('0x11'),this['account'][_0x5e12('0x1f')],JSON[_0x5e12('0x3a')](_0x4a1aa1));var _0x5d856a='';if(_0x4a1aa1){if(_0x4a1aa1[_0x5e12('0x3b')]){_0x5d856a=_0x4a1aa1['textCode'];}else{for(var _0x2fba5f in _0x4a1aa1){if(_0x4a1aa1[_0x5e12('0x3c')](_0x2fba5f)){_0x5d856a+=_[_0x5e12('0x3d')](_0x2fba5f)+':\x20'+_0x4a1aa1[_0x2fba5f]+'\x0a';}}}}if(_0x485d04){this['imap'][_0x5e12('0xe')]();}else{this[_0x5e12('0x28')](_0x5e12('0x10'),_0x5d856a);this[_0x5e12('0x28')](_0x5e12('0xe'));}};module['exports']=EmailImap;
\ No newline at end of file
index e8f25b5..8ec1ff8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4804=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','use','sendMail','prototype','verify','createTransport'];(function(_0x122633,_0x22057b){var _0x2d02e5=function(_0x420024){while(--_0x420024){_0x122633['push'](_0x122633['shift']());}};_0x2d02e5(++_0x22057b);}(_0x4804,0x1e2));var _0x4480=function(_0x2908b7,_0x21d35e){_0x2908b7=_0x2908b7-0x0;var _0x5ab26f=_0x4804[_0x2908b7];return _0x5ab26f;};'use strict';var nodemailer=require(_0x4480('0x0'));var inlineBase64=require(_0x4480('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x4480('0x2')]=function(_0x306276,_0x55feae){return new Promise(function(_0x204ab9,_0x3fb92f){var _0x1355c8=nodemailer['createTransport'](_0x306276);_0x1355c8[_0x4480('0x3')]('compile',inlineBase64());_0x1355c8[_0x4480('0x4')](_0x55feae,function(_0x50a40e,_0x406115){if(_0x50a40e){_0x3fb92f(_0x50a40e['toString']());}else{_0x204ab9(_0x406115);}});});};EmailSmtp[_0x4480('0x5')][_0x4480('0x6')]=function(_0x2ced78){return new Promise(function(_0x7ce473,_0x367289){var _0x232179=nodemailer[_0x4480('0x7')](_0x2ced78);_0x232179[_0x4480('0x6')](function(_0x118da4,_0x1a2a9c){if(_0x118da4){_0x367289(_0x118da4['toString']());}else{if(_0x1a2a9c){_0x7ce473(_0x1a2a9c);}else{_0x367289(_0x4480('0x8'));}}});});};module[_0x4480('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0xa25c=['verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','toString'];(function(_0x4d7181,_0x58f2b7){var _0x2a356b=function(_0x2a0038){while(--_0x2a0038){_0x4d7181['push'](_0x4d7181['shift']());}};_0x2a356b(++_0x58f2b7);}(_0xa25c,0x1ef));var _0xca25=function(_0x40c3a5,_0x4615ca){_0x40c3a5=_0x40c3a5-0x0;var _0x2b19da=_0xa25c[_0x40c3a5];return _0x2b19da;};'use strict';var nodemailer=require(_0xca25('0x0'));var inlineBase64=require(_0xca25('0x1'));function EmailSmtp(){}EmailSmtp[_0xca25('0x2')][_0xca25('0x3')]=function(_0x2d40b8,_0x4cf873){return new Promise(function(_0x819c16,_0x2f0919){var _0x3b1268=nodemailer[_0xca25('0x4')](_0x2d40b8);_0x3b1268[_0xca25('0x5')](_0xca25('0x6'),inlineBase64());_0x3b1268[_0xca25('0x7')](_0x4cf873,function(_0x9ec2bb,_0xdd6ff4){if(_0x9ec2bb){_0x2f0919(_0x9ec2bb[_0xca25('0x8')]());}else{_0x819c16(_0xdd6ff4);}});});};EmailSmtp[_0xca25('0x2')][_0xca25('0x9')]=function(_0x3f5df9){return new Promise(function(_0x32b7c5,_0x797033){var _0x2f6d65=nodemailer[_0xca25('0x4')](_0x3f5df9);_0x2f6d65[_0xca25('0x9')](function(_0x153f00,_0x1f39b3){if(_0x153f00){_0x797033(_0x153f00['toString']());}else{if(_0x1f39b3){_0x32b7c5(_0x1f39b3);}else{_0x797033(_0xca25('0xa'));}}});});};module[_0xca25('0xb')]=EmailSmtp;
\ No newline at end of file
index 8ba3fc7..355de06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5ce=['indexOf','split','length','join','pop','isEmpty','html','test','replace','includes','<img','attachments','forEach','push','filename','_SRC','_IMG','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','email','originCc','bcc','attach','type','attachment','format','%s-%s','now','server/files/attachments/','writeFileSync','content','contentType','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','headerLines','line','isAutoreply','parser','from','subject','inReplyTo','date','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','<p>Empty\x20message</p>','Attachments','generateXOAuth2Token','user=','utf-8','base64','lodash','moment','path','util','node-tnef','../../../config/logger','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','substring'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xd5ce,0xc3));var _0xed5c=function(_0x119bb1,_0x1fb2f4){_0x119bb1=_0x119bb1-0x0;var _0x510da7=_0xd5ce[_0x119bb1];return _0x510da7;};'use strict';var _=require(_0xed5c('0x0'));var moment=require(_0xed5c('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0xed5c('0x2'));var util=require(_0xed5c('0x3'));var tnef=require(_0xed5c('0x4'));var logger=require(_0xed5c('0x5'))('email');var config=require(_0xed5c('0x6'));function getAddress(_0x277c72){var _0xcf336b=_[_0xed5c('0x7')](_0x277c72['value']);return _0xcf336b&&_0xcf336b[_0xed5c('0x8')]?_0xcf336b[_0xed5c('0x8')]:_0xed5c('0x9')+random[_0xed5c('0xa')](0x6)+_0xed5c('0xb');}function getFirstName(_0x228d53){var _0x4c3e07=_[_0xed5c('0x7')](_0x228d53[_0xed5c('0xc')]);if(_0x4c3e07&&_0x4c3e07['name']){if(_0x4c3e07[_0xed5c('0xd')]==_0x4c3e07[_0xed5c('0x8')]){return _0x4c3e07['name'][_0xed5c('0xe')](0x0,_0x4c3e07[_0xed5c('0xd')][_0xed5c('0xf')]('@'));}var _0x2c656e=_0x4c3e07['name'][_0xed5c('0x10')](/\s+/);return _0x2c656e[_0xed5c('0x11')]>0x1?_0x2c656e['slice'](0x0,-0x1)[_0xed5c('0x12')]('\x20'):_0x4c3e07[_0xed5c('0xd')];}return'Anonymous';}function getLastName(_0x41f64a){var _0x36e9aa=_['head'](_0x41f64a[_0xed5c('0xc')]);if(_0x36e9aa&&_0x36e9aa[_0xed5c('0xd')]){var _0x4e422e=_0x36e9aa[_0xed5c('0xd')][_0xed5c('0x10')](/\s+/);return _0x4e422e[_0xed5c('0x11')]>0x1?_0x4e422e[_0xed5c('0x13')]():'';}return'';}function getMails(_0x5727d1,_0x194280){var _0x128cb2='';for(var _0x5d9b08=0x0;_0x5d9b08<_0x194280[_0xed5c('0xc')][_0xed5c('0x11')];_0x5d9b08+=0x1){if(_0x194280[_0xed5c('0xc')][_0x5d9b08]['address']!==_0x5727d1){if(!_[_0xed5c('0x14')](_0x128cb2)){_0x128cb2+=',';}_0x128cb2+=_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0xd')]||_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0x8')]||'';_0x128cb2+='\x20<';_0x128cb2+=_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0x8')]?_0x194280[_0xed5c('0xc')][_0x5d9b08][_0xed5c('0x8')]:'anonymous'+random[_0xed5c('0xa')](0x6)+_0xed5c('0xb');_0x128cb2+='>';}}return _0x128cb2;}function parseEmail(_0xebd1d3,_0x1b1097,_0x994aaa){if(_0x1b1097[_0xed5c('0x15')]){var _0x2b0254=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x2b0254[_0xed5c('0x16')](_0x1b1097[_0xed5c('0x15')])){_0x1b1097[_0xed5c('0x15')]=_0x1b1097['html'][_0xed5c('0x17')](_0x2b0254,'');}if(_0x1b1097['html'][_0xed5c('0x18')](_0xed5c('0x19'))){var _0x3796ff=[];_0x1b1097[_0xed5c('0x1a')][_0xed5c('0x1b')](_0x388bc4=>{_0x3796ff[_0xed5c('0x1c')](_0x388bc4[_0xed5c('0x1d')]);});var _0x30a2f1=/<img.*? _SRC(.*?)[^>]+>/g;var _0xab2877=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x1249ba=_0x1b1097[_0xed5c('0x15')][_0xed5c('0x17')](_0xab2877,_0xed5c('0x1e'));var _0x340c15=_0x1249ba[_0xed5c('0x17')](_0x30a2f1,_0xed5c('0x1f'));for(let _0x1429e5=0x0;_0x1429e5<_0x3796ff[_0xed5c('0x11')];_0x1429e5++){var _0x5f2425=_0x340c15[_0xed5c('0x17')](_0xed5c('0x1f'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x3796ff[_0x1429e5]+'\x20]</span>');_0x340c15=_0x5f2425;}_0x1b1097[_0xed5c('0x15')]=_0x340c15;}_0x994aaa['body']=_0x1b1097['html'];}else{_0x994aaa[_0xed5c('0x20')]=_0x1b1097[_0xed5c('0x21')];}if(_0x994aaa['body']){_0x994aaa['body']=_0x994aaa['body'][_0xed5c('0x17')](/<a\s+/gi,_0xed5c('0x22'));}if(_0x1b1097['to']){_0x994aaa[_0xed5c('0x23')][_0xed5c('0x24')]=getMails(null,_0x1b1097['to']);var _0x3ad7c5=getMails(_0xebd1d3[_0xed5c('0x25')],_0x1b1097['to']);if(!_[_0xed5c('0x14')](_0x3ad7c5)){_0x994aaa['message']['cc']+=_0x3ad7c5;}}if(_0x1b1097['cc']){_0x994aaa[_0xed5c('0x23')]['originCc']=getMails(null,_0x1b1097['cc']);var _0x5caddc=getMails(_0xebd1d3[_0xed5c('0x25')],_0x1b1097['cc']);if(!_['isEmpty'](_0x5caddc)){if(!_[_0xed5c('0x14')](_0x994aaa[_0xed5c('0x23')]['cc'])){_0x994aaa[_0xed5c('0x23')]['cc']+=',';}_0x994aaa['message']['cc']+=_0x5caddc;}}if(!_[_0xed5c('0x18')](_0x994aaa[_0xed5c('0x23')]['originTo'],_0xebd1d3[_0xed5c('0x25')])&&!_[_0xed5c('0x18')](_0x994aaa[_0xed5c('0x23')][_0xed5c('0x26')],_0xebd1d3['email'])){_0x994aaa['message'][_0xed5c('0x27')]=_0xebd1d3[_0xed5c('0x25')];}if(_0x1b1097[_0xed5c('0x1a')]&&_0x1b1097['attachments'][_0xed5c('0x11')]){_0x994aaa[_0xed5c('0x23')][_0xed5c('0x28')]=_0x1b1097[_0xed5c('0x1a')][_0xed5c('0x11')];for(var _0x22fa18=0x0,_0x238fd5,_0x1897d7,_0x5e033c;_0x22fa18<_0x1b1097[_0xed5c('0x1a')][_0xed5c('0x11')];_0x22fa18+=0x1){if(_0x1b1097[_0xed5c('0x1a')][_0x22fa18][_0xed5c('0x29')]===_0xed5c('0x2a')){_0x5e033c=_0x1b1097['attachments'][_0x22fa18][_0xed5c('0x1d')]||'attachment-'+_0x22fa18;_0x238fd5=util[_0xed5c('0x2b')](_0xed5c('0x2c'),Date[_0xed5c('0x2d')](),_0x5e033c);_0x1897d7=path[_0xed5c('0x12')](config['root'],_0xed5c('0x2e'),_0x238fd5);fs[_0xed5c('0x2f')](_0x1897d7,_0x1b1097[_0xed5c('0x1a')][_0x22fa18][_0xed5c('0x30')]);_0x994aaa[_0xed5c('0x23')][_0xed5c('0x1a')]['push']({'name':_0x5e033c,'basename':_0x238fd5,'type':_0x1b1097['attachments'][_0x22fa18][_0xed5c('0x31')],'filepath':_0x1897d7});}}}if(_0x1b1097['headerLines']&&_0x1b1097['headerLines'][_0xed5c('0x11')]>0x0){var _0x50caff=[_0xed5c('0x32'),_0xed5c('0x33'),_0xed5c('0x34')];for(var _0x159f90=0x0;_0x159f90<_0x1b1097[_0xed5c('0x35')]['length'];_0x159f90++){var _0x53a835=_[_0xed5c('0xf')](_0x50caff,_0x1b1097[_0xed5c('0x35')][_0x159f90][_0xed5c('0x36')]);if(_0x53a835>=0x0){_0x994aaa[_0xed5c('0x37')]=!![];}}}return _0x994aaa;}exports[_0xed5c('0x38')]=function(_0x35e8f0,_0x3b2dca,_0x16b407){var _0x44c156={'from':getAddress(_0x3b2dca[_0xed5c('0x39')]),'firstName':getFirstName(_0x3b2dca[_0xed5c('0x39')]),'lastName':getLastName(_0x3b2dca[_0xed5c('0x39')]),'mapKey':_0xed5c('0x25'),'message':{'from':getMails(_0x35e8f0['email'],_0x3b2dca[_0xed5c('0x39')]),'to':_0x35e8f0[_0xed5c('0x25')],'cc':'','subject':_0x3b2dca[_0xed5c('0x3a')]||'','messageId':_0x3b2dca['messageId'],'inReplyTo':_0x3b2dca[_0xed5c('0x3b')],'sentAt':moment(_0x3b2dca[_0xed5c('0x3c')])[_0xed5c('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x3b2dca[_0xed5c('0x15')]&&!_0x3b2dca[_0xed5c('0x21')]){var _0x45b8d5=_['filter'](_0x3b2dca[_0xed5c('0x1a')],{'contentType':'application/ms-tnef'});if(_0x45b8d5[_0xed5c('0x11')]){logger['info'](util[_0xed5c('0x2b')](_0xed5c('0x3d'),_0x3b2dca[_0xed5c('0x3e')]));tnef[_0xed5c('0x3f')](_['first'](_0x45b8d5)[_0xed5c('0x30')],function(_0x44b238,_0x246209){if(_0x246209){_0x3b2dca['html']=_0x246209['BodyHTML']||_0xed5c('0x40');if(_0x246209[_0xed5c('0x41')]){for(var _0xfa5f7a=0x0;_0xfa5f7a<_0x246209['Attachments']['length'];_0xfa5f7a++){var _0x501884=_0x246209[_0xed5c('0x41')][_0xfa5f7a];_0x44c156['message'][_0xed5c('0x1a')][_0xed5c('0x1c')]({'filename':_0x501884['Title'],'content':Buffer[_0xed5c('0x39')](_0x501884['Data'])});}}}_0x16b407(parseEmail(_0x35e8f0,_0x3b2dca,_0x44c156));});}else{_0x3b2dca[_0xed5c('0x15')]='<p>Empty\x20message</p>';_0x16b407(parseEmail(_0x35e8f0,_0x3b2dca,_0x44c156));}}else{_0x16b407(parseEmail(_0x35e8f0,_0x3b2dca,_0x44c156));}};exports[_0xed5c('0x42')]=function(_0x3b9074,_0x4bcdb7){var _0xa53e19=[_0xed5c('0x43')+(_0x4bcdb7||''),'auth=Bearer\x20'+_0x3b9074,'',''];return Buffer[_0xed5c('0x39')](_0xa53e19[_0xed5c('0x12')]('\ 1'),_0xed5c('0x44'))['toString'](_0xed5c('0x45'));};
\ No newline at end of file
+var _0xa50b=['head','address','generate','@xcally.com','value','name','substring','split','length','join','Anonymous','html','test','replace','<img','forEach','push','filename','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','isEmpty','originCc','includes','bcc','attachments','attach','type','attachment','attachment-','%s-%s','now','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','from','subject','messageId','date','format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','<p>Empty\x20message</p>','Attachments','Title','Data','user=','auth=Bearer\x20','utf-8','base64','moment','randomstring','path','util','../../../config/logger','email','../../../config/environment'];(function(_0x3ebf89,_0x380730){var _0xf8e782=function(_0x193c9b){while(--_0x193c9b){_0x3ebf89['push'](_0x3ebf89['shift']());}};_0xf8e782(++_0x380730);}(_0xa50b,0x1a3));var _0xba50=function(_0x3cf18c,_0x520870){_0x3cf18c=_0x3cf18c-0x0;var _0xc8e728=_0xa50b[_0x3cf18c];return _0xc8e728;};'use strict';var _=require('lodash');var moment=require(_0xba50('0x0'));var random=require(_0xba50('0x1'));var fs=require('fs');var path=require(_0xba50('0x2'));var util=require(_0xba50('0x3'));var tnef=require('node-tnef');var logger=require(_0xba50('0x4'))(_0xba50('0x5'));var config=require(_0xba50('0x6'));function getAddress(_0x101789){var _0x258796=_[_0xba50('0x7')](_0x101789['value']);return _0x258796&&_0x258796[_0xba50('0x8')]?_0x258796[_0xba50('0x8')]:'anonymous'+random[_0xba50('0x9')](0x6)+_0xba50('0xa');}function getFirstName(_0x2979bc){var _0x4c91ba=_[_0xba50('0x7')](_0x2979bc[_0xba50('0xb')]);if(_0x4c91ba&&_0x4c91ba[_0xba50('0xc')]){if(_0x4c91ba[_0xba50('0xc')]==_0x4c91ba['address']){return _0x4c91ba[_0xba50('0xc')][_0xba50('0xd')](0x0,_0x4c91ba[_0xba50('0xc')]['indexOf']('@'));}var _0x429237=_0x4c91ba[_0xba50('0xc')][_0xba50('0xe')](/\s+/);return _0x429237[_0xba50('0xf')]>0x1?_0x429237['slice'](0x0,-0x1)[_0xba50('0x10')]('\x20'):_0x4c91ba[_0xba50('0xc')];}return _0xba50('0x11');}function getLastName(_0x1c0f02){var _0x308335=_['head'](_0x1c0f02['value']);if(_0x308335&&_0x308335[_0xba50('0xc')]){var _0x1b03f7=_0x308335[_0xba50('0xc')]['split'](/\s+/);return _0x1b03f7[_0xba50('0xf')]>0x1?_0x1b03f7['pop']():'';}return'';}function getMails(_0x3121d7,_0x158e5d){var _0xb51721='';for(var _0x4de9b9=0x0;_0x4de9b9<_0x158e5d[_0xba50('0xb')][_0xba50('0xf')];_0x4de9b9+=0x1){if(_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0x8')]!==_0x3121d7){if(!_['isEmpty'](_0xb51721)){_0xb51721+=',';}_0xb51721+=_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0xc')]||_0x158e5d['value'][_0x4de9b9][_0xba50('0x8')]||'';_0xb51721+='\x20<';_0xb51721+=_0x158e5d['value'][_0x4de9b9][_0xba50('0x8')]?_0x158e5d[_0xba50('0xb')][_0x4de9b9][_0xba50('0x8')]:'anonymous'+random['generate'](0x6)+_0xba50('0xa');_0xb51721+='>';}}return _0xb51721;}function parseEmail(_0x38b564,_0x599281,_0x3b7146){if(_0x599281[_0xba50('0x12')]){var _0xe115c9=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0xe115c9[_0xba50('0x13')](_0x599281['html'])){_0x599281[_0xba50('0x12')]=_0x599281[_0xba50('0x12')][_0xba50('0x14')](_0xe115c9,'');}if(_0x599281['html']['includes'](_0xba50('0x15'))){var _0x1dcc40=[];_0x599281['attachments'][_0xba50('0x16')](_0x4ea2c5=>{_0x1dcc40[_0xba50('0x17')](_0x4ea2c5[_0xba50('0x18')]);});var _0x50b5ff=/<img.*? _SRC(.*?)[^>]+>/g;var _0x38270c=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x453da7=_0x599281[_0xba50('0x12')][_0xba50('0x14')](_0x38270c,'_SRC');var _0x48f5c7=_0x453da7['replace'](_0x50b5ff,'_IMG');for(let _0x3f701f=0x0;_0x3f701f<_0x1dcc40['length'];_0x3f701f++){var _0x5264f0=_0x48f5c7[_0xba50('0x14')](_0xba50('0x19'),_0xba50('0x1a')+_0x1dcc40[_0x3f701f]+_0xba50('0x1b'));_0x48f5c7=_0x5264f0;}_0x599281[_0xba50('0x12')]=_0x48f5c7;}_0x3b7146[_0xba50('0x1c')]=_0x599281[_0xba50('0x12')];}else{_0x3b7146[_0xba50('0x1c')]=_0x599281[_0xba50('0x1d')];}if(_0x3b7146[_0xba50('0x1c')]){_0x3b7146[_0xba50('0x1c')]=_0x3b7146['body'][_0xba50('0x14')](/<a\s+/gi,_0xba50('0x1e'));}if(_0x599281['to']){_0x3b7146[_0xba50('0x1f')][_0xba50('0x20')]=getMails(null,_0x599281['to']);var _0x250ee6=getMails(_0x38b564[_0xba50('0x5')],_0x599281['to']);if(!_[_0xba50('0x21')](_0x250ee6)){_0x3b7146[_0xba50('0x1f')]['cc']+=_0x250ee6;}}if(_0x599281['cc']){_0x3b7146['message'][_0xba50('0x22')]=getMails(null,_0x599281['cc']);var _0xb5f689=getMails(_0x38b564['email'],_0x599281['cc']);if(!_[_0xba50('0x21')](_0xb5f689)){if(!_[_0xba50('0x21')](_0x3b7146[_0xba50('0x1f')]['cc'])){_0x3b7146['message']['cc']+=',';}_0x3b7146[_0xba50('0x1f')]['cc']+=_0xb5f689;}}if(!_[_0xba50('0x23')](_0x3b7146['message'][_0xba50('0x20')],_0x38b564[_0xba50('0x5')])&&!_[_0xba50('0x23')](_0x3b7146['message'][_0xba50('0x22')],_0x38b564[_0xba50('0x5')])){_0x3b7146[_0xba50('0x1f')][_0xba50('0x24')]=_0x38b564['email'];}if(_0x599281[_0xba50('0x25')]&&_0x599281[_0xba50('0x25')][_0xba50('0xf')]){_0x3b7146[_0xba50('0x1f')][_0xba50('0x26')]=_0x599281[_0xba50('0x25')][_0xba50('0xf')];for(var _0x5d0ed8=0x0,_0x4bca6a,_0x2f6ff5,_0x3d1df0;_0x5d0ed8<_0x599281['attachments']['length'];_0x5d0ed8+=0x1){if(_0x599281[_0xba50('0x25')][_0x5d0ed8][_0xba50('0x27')]===_0xba50('0x28')){_0x3d1df0=_0x599281[_0xba50('0x25')][_0x5d0ed8][_0xba50('0x18')]||_0xba50('0x29')+_0x5d0ed8;_0x4bca6a=util['format'](_0xba50('0x2a'),Date[_0xba50('0x2b')](),_0x3d1df0);_0x2f6ff5=path[_0xba50('0x10')](config['root'],'server/files/attachments/',_0x4bca6a);fs[_0xba50('0x2c')](_0x2f6ff5,_0x599281[_0xba50('0x25')][_0x5d0ed8][_0xba50('0x2d')]);_0x3b7146[_0xba50('0x1f')][_0xba50('0x25')][_0xba50('0x17')]({'name':_0x3d1df0,'basename':_0x4bca6a,'type':_0x599281[_0xba50('0x25')][_0x5d0ed8]['contentType'],'filepath':_0x2f6ff5});}}}if(_0x599281[_0xba50('0x2e')]&&_0x599281[_0xba50('0x2e')][_0xba50('0xf')]>0x0){var _0x31bfd8=[_0xba50('0x2f'),_0xba50('0x30'),_0xba50('0x31')];for(var _0x1b6eb2=0x0;_0x1b6eb2<_0x599281[_0xba50('0x2e')][_0xba50('0xf')];_0x1b6eb2++){var _0x72aa1a=_[_0xba50('0x32')](_0x31bfd8,_0x599281[_0xba50('0x2e')][_0x1b6eb2][_0xba50('0x33')]);if(_0x72aa1a>=0x0){_0x3b7146['isAutoreply']=!![];}}}return _0x3b7146;}exports['parser']=function(_0xef7a11,_0x27eed3,_0x23645e){var _0x526c63={'from':getAddress(_0x27eed3[_0xba50('0x34')]),'firstName':getFirstName(_0x27eed3[_0xba50('0x34')]),'lastName':getLastName(_0x27eed3[_0xba50('0x34')]),'mapKey':_0xba50('0x5'),'message':{'from':getMails(_0xef7a11[_0xba50('0x5')],_0x27eed3[_0xba50('0x34')]),'to':_0xef7a11[_0xba50('0x5')],'cc':'','subject':_0x27eed3[_0xba50('0x35')]||'','messageId':_0x27eed3[_0xba50('0x36')],'inReplyTo':_0x27eed3['inReplyTo'],'sentAt':moment(_0x27eed3[_0xba50('0x37')])[_0xba50('0x38')](_0xba50('0x39')),'attach':![],'attachments':[]}};if(!_0x27eed3[_0xba50('0x12')]&&!_0x27eed3['textAsHtml']){var _0x4b0565=_[_0xba50('0x3a')](_0x27eed3[_0xba50('0x25')],{'contentType':_0xba50('0x3b')});if(_0x4b0565[_0xba50('0xf')]){logger[_0xba50('0x3c')](util[_0xba50('0x38')](_0xba50('0x3d'),_0x27eed3[_0xba50('0x36')]));tnef['parseBuffer'](_[_0xba50('0x3e')](_0x4b0565)['content'],function(_0x43ffe0,_0x4be7f4){if(_0x4be7f4){_0x27eed3['html']=_0x4be7f4['BodyHTML']||_0xba50('0x3f');if(_0x4be7f4[_0xba50('0x40')]){for(var _0x139ac7=0x0;_0x139ac7<_0x4be7f4[_0xba50('0x40')][_0xba50('0xf')];_0x139ac7++){var _0x47d450=_0x4be7f4[_0xba50('0x40')][_0x139ac7];_0x526c63[_0xba50('0x1f')][_0xba50('0x25')]['push']({'filename':_0x47d450[_0xba50('0x41')],'content':Buffer[_0xba50('0x34')](_0x47d450[_0xba50('0x42')])});}}}_0x23645e(parseEmail(_0xef7a11,_0x27eed3,_0x526c63));});}else{_0x27eed3['html']=_0xba50('0x3f');_0x23645e(parseEmail(_0xef7a11,_0x27eed3,_0x526c63));}}else{_0x23645e(parseEmail(_0xef7a11,_0x27eed3,_0x526c63));}};exports['generateXOAuth2Token']=function(_0x33935a,_0x35ead5){var _0x80659f=[_0xba50('0x43')+(_0x35ead5||''),_0xba50('0x44')+_0x33935a,'',''];return Buffer[_0xba50('0x34')](_0x80659f[_0xba50('0x10')]('\ 1'),_0xba50('0x45'))['toString'](_0xba50('0x46'));};
\ No newline at end of file
index ed597eb..3595cca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f20=['lodash','name','active','Imap','Smtp','exports'];(function(_0xb8dcd7,_0x5d832b){var _0x121a74=function(_0x5af714){while(--_0x5af714){_0xb8dcd7['push'](_0xb8dcd7['shift']());}};_0x121a74(++_0x5d832b);}(_0x9f20,0x18c));var _0x09f2=function(_0x6ddeb1,_0x55784d){_0x6ddeb1=_0x6ddeb1-0x0;var _0x38ebbe=_0x9f20[_0x6ddeb1];return _0x38ebbe;};'use strict';var _=require(_0x09f2('0x0'));function MailAccount(_0x27bab9){this['id']=_0x27bab9['id']||0x0;this[_0x09f2('0x1')]=_0x27bab9[_0x09f2('0x1')]||'Service';this['key']=_0x27bab9['key']||'SERV';this[_0x09f2('0x2')]=_0x27bab9[_0x09f2('0x2')]||![];this[_0x09f2('0x3')]=_0x27bab9[_0x09f2('0x3')]||[];this[_0x09f2('0x4')]=_0x27bab9['Smtp']||[];}module[_0x09f2('0x5')]=MailAccount;
\ No newline at end of file
+var _0xf5ce=['Smtp','exports','name','key','SERV','active','Imap'];(function(_0x29b7b6,_0x1cdfd3){var _0x16fc74=function(_0x15f641){while(--_0x15f641){_0x29b7b6['push'](_0x29b7b6['shift']());}};_0x16fc74(++_0x1cdfd3);}(_0xf5ce,0x1b4));var _0xef5c=function(_0x1aee8a,_0x55c058){_0x1aee8a=_0x1aee8a-0x0;var _0x153913=_0xf5ce[_0x1aee8a];return _0x153913;};'use strict';var _=require('lodash');function MailAccount(_0x331c52){this['id']=_0x331c52['id']||0x0;this[_0xef5c('0x0')]=_0x331c52[_0xef5c('0x0')]||'Service';this[_0xef5c('0x1')]=_0x331c52['key']||_0xef5c('0x2');this[_0xef5c('0x3')]=_0x331c52['active']||![];this[_0xef5c('0x4')]=_0x331c52['Imap']||[];this['Smtp']=_0x331c52[_0xef5c('0x5')]||[];}module[_0xef5c('0x6')]=MailAccount;
\ No newline at end of file
index a5d4966..3ac0c37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff29=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined'];(function(_0x19d8be,_0x2e4c8d){var _0x1b75bc=function(_0x1225bd){while(--_0x1225bd){_0x19d8be['push'](_0x19d8be['shift']());}};_0x1b75bc(++_0x2e4c8d);}(_0xff29,0x182));var _0x9ff2=function(_0x2a8404,_0x565c19){_0x2a8404=_0x2a8404-0x0;var _0x534563=_0xff29[_0x2a8404];return _0x534563;};'use strict';var _=require(_0x9ff2('0x0'));var MailAccount=require(_0x9ff2('0x1'));var Realtime=function(){this[_0x9ff2('0x2')]={};};function freeIsNotKey(_0x48c77f,_0x46c5de,_0x52abba){var _0x5002d5=_[_0x9ff2('0x3')](_0x48c77f,function(_0x31d069,_0x7cda65){return _0x31d069[_0x52abba];});for(var _0x76db54 in _0x46c5de){if(_0x46c5de[_0x9ff2('0x4')](_0x76db54)){if(!_0x5002d5[_0x76db54]){delete _0x46c5de[_0x76db54];}}}}Realtime[_0x9ff2('0x5')][_0x9ff2('0x6')]=function(_0x2133de,_0x4f1bc7){for(var _0x27a172 in _0x4f1bc7){if(_0x2133de[_0x9ff2('0x4')](_0x27a172)){_0x2133de[_0x27a172]=_0x4f1bc7[_0x27a172];}}};Realtime[_0x9ff2('0x5')][_0x9ff2('0x7')]=function(){var _0x1a3140=this;return function(_0x3f3970){if(_0x3f3970){freeIsNotKey(_0x3f3970,_0x1a3140[_0x9ff2('0x2')],'id');for(var _0x18b6f6=0x0,_0x491aa5={},_0x1bafd9={};_0x18b6f6<_0x3f3970[_0x9ff2('0x8')];_0x18b6f6+=0x1){_0x491aa5=_0x3f3970[_0x18b6f6];if(_[_0x9ff2('0x9')](_0x1a3140[_0x9ff2('0x2')][_0x491aa5['id']])){_0x1a3140[_0x9ff2('0x2')][_0x491aa5['id']]=new MailAccount(_0x491aa5);}else{_[_0x9ff2('0xa')](_0x1a3140['mailAccounts'][_0x491aa5['id']],_0x491aa5);}}}return _0x1a3140['mailAccounts'];};};module[_0x9ff2('0xb')]=Realtime;
\ No newline at end of file
+var _0xdd7e=['lodash','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','mailAccounts','isUndefined','merge','exports'];(function(_0x235504,_0x268219){var _0x5ab2ea=function(_0x1e8a60){while(--_0x1e8a60){_0x235504['push'](_0x235504['shift']());}};_0x5ab2ea(++_0x268219);}(_0xdd7e,0x1c2));var _0xedd7=function(_0x3802a1,_0x5d2527){_0x3802a1=_0x3802a1-0x0;var _0x1f61ae=_0xdd7e[_0x3802a1];return _0x1f61ae;};'use strict';var _=require(_0xedd7('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x430938,_0x4806b9,_0x3f7db8){var _0x4fd044=_['mapKeys'](_0x430938,function(_0x155898,_0x48899c){return _0x155898[_0x3f7db8];});for(var _0x51aeda in _0x4806b9){if(_0x4806b9['hasOwnProperty'](_0x51aeda)){if(!_0x4fd044[_0x51aeda]){delete _0x4806b9[_0x51aeda];}}}}Realtime['prototype'][_0xedd7('0x1')]=function(_0x38a6f6,_0x50d410){for(var _0x3d172e in _0x50d410){if(_0x38a6f6[_0xedd7('0x2')](_0x3d172e)){_0x38a6f6[_0x3d172e]=_0x50d410[_0x3d172e];}}};Realtime[_0xedd7('0x3')][_0xedd7('0x4')]=function(){var _0x17aa2b=this;return function(_0x718cfe){if(_0x718cfe){freeIsNotKey(_0x718cfe,_0x17aa2b[_0xedd7('0x5')],'id');for(var _0x58a10a=0x0,_0x400b6a={},_0x10a9bb={};_0x58a10a<_0x718cfe['length'];_0x58a10a+=0x1){_0x400b6a=_0x718cfe[_0x58a10a];if(_[_0xedd7('0x6')](_0x17aa2b[_0xedd7('0x5')][_0x400b6a['id']])){_0x17aa2b[_0xedd7('0x5')][_0x400b6a['id']]=new MailAccount(_0x400b6a);}else{_[_0xedd7('0x7')](_0x17aa2b['mailAccounts'][_0x400b6a['id']],_0x400b6a);}}}return _0x17aa2b[_0xedd7('0x5')];};};module[_0xedd7('0x8')]=Realtime;
\ No newline at end of file
index 9c54729..8d71ea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39bd=['provider','service','email','active','key','ListId','Imap','CloudProvider','name','type','data5','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','GetMailAccount'];(function(_0x188f19,_0x40e555){var _0x466996=function(_0x11c62e){while(--_0x11c62e){_0x188f19['push'](_0x188f19['shift']());}};_0x466996(++_0x40e555);}(_0x39bd,0x7c));var _0xd39b=function(_0x16ed21,_0x4ecef0){_0x16ed21=_0x16ed21-0x0;var _0x63c47b=_0x39bd[_0x16ed21];return _0x63c47b;};'use strict';var client=require(_0xd39b('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xd39b('0x1'),{'options':{'attributes':['id','name',_0xd39b('0x2'),_0xd39b('0x3'),_0xd39b('0x4'),_0xd39b('0x5'),_0xd39b('0x6'),_0xd39b('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xd39b('0x8'),'include':[{'model':_0xd39b('0x9'),'attributes':['id',_0xd39b('0xa'),_0xd39b('0x3'),_0xd39b('0xb'),_0xd39b('0xc')],'as':_0xd39b('0x9')}]},{'model':'MailServerOut','as':_0xd39b('0xd'),'include':[{'model':_0xd39b('0x9'),'attributes':['id',_0xd39b('0xa'),_0xd39b('0x3'),_0xd39b('0xb'),'data5'],'as':_0xd39b('0x9')}]}]},'log':_0xd39b('0xe')});};};exports[_0xd39b('0xf')]=function(_0xfcdb02,_0x319ba7){return client[_0xd39b('0x10')](_0xd39b('0x11'),{'account':{'id':_0xfcdb02},'body':_0x319ba7,'log':_0xd39b('0x11')});};
\ No newline at end of file
+var _0x5d17=['getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','provider','service','active','key','ListId','TemplateId','Imap','CloudProvider','type','data5'];(function(_0x4b934b,_0x12b060){var _0x23280f=function(_0x5b8feb){while(--_0x5b8feb){_0x4b934b['push'](_0x4b934b['shift']());}};_0x23280f(++_0x12b060);}(_0x5d17,0x114));var _0x75d1=function(_0x1e6e4e,_0x2b1b09){_0x1e6e4e=_0x1e6e4e-0x0;var _0x3d746b=_0x5d17[_0x1e6e4e];return _0x3d746b;};'use strict';var client=require(_0x75d1('0x0'));exports[_0x75d1('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0x75d1('0x2'),_0x75d1('0x3'),_0x75d1('0x4'),'email',_0x75d1('0x5'),_0x75d1('0x6'),_0x75d1('0x7'),_0x75d1('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x75d1('0x9'),'include':[{'model':_0x75d1('0xa'),'attributes':['id',_0x75d1('0x2'),_0x75d1('0x4'),_0x75d1('0xb'),_0x75d1('0xc')],'as':_0x75d1('0xa')}]},{'model':'MailServerOut','as':'Smtp','include':[{'model':_0x75d1('0xa'),'attributes':['id','name','service',_0x75d1('0xb'),_0x75d1('0xc')],'as':'CloudProvider'}]}]},'log':_0x75d1('0xd')});};};exports[_0x75d1('0xe')]=function(_0x28b9b4,_0xe07f4a){return client[_0x75d1('0xf')](_0x75d1('0x10'),{'account':{'id':_0x28b9b4},'body':_0xe07f4a,'log':'NotifyMailAccount'});};
\ No newline at end of file
index 035c80e..6871336 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf53=['getSettings','Request','ShowSetting','loginMailFrequency'];(function(_0x3e8d4d,_0x55cd8f){var _0x3f4d24=function(_0x1cf516){while(--_0x1cf516){_0x3e8d4d['push'](_0x3e8d4d['shift']());}};_0x3f4d24(++_0x55cd8f);}(_0xaf53,0xc4));var _0x3af5=function(_0x324f5c,_0x19e1f0){_0x324f5c=_0x324f5c-0x0;var _0x2c81c4=_0xaf53[_0x324f5c];return _0x2c81c4;};'use strict';var client=require('../client');exports[_0x3af5('0x0')]=function(){return client[_0x3af5('0x1')](_0x3af5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3af5('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x6877=['Request','loginMailFrequency','../client','getSettings'];(function(_0x194a45,_0x5d1d26){var _0x71ded8=function(_0x1c489a){while(--_0x1c489a){_0x194a45['push'](_0x194a45['shift']());}};_0x71ded8(++_0x5d1d26);}(_0x6877,0x10e));var _0x7687=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x6877[_0x22b68a];return _0x1ac67a;};'use strict';var client=require(_0x7687('0x0'));exports[_0x7687('0x1')]=function(){return client[_0x7687('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7687('0x3')]},'log':'GetSettings'});};
\ No newline at end of file
index c077b3d..595575a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
index ee71bd0..4f48c0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b22=['exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','log'];(function(_0x40ecb9,_0xd4cf49){var _0x300143=function(_0x110792){while(--_0x110792){_0x40ecb9['push'](_0x40ecb9['shift']());}};_0x300143(++_0xd4cf49);}(_0x2b22,0xb9));var _0x22b2=function(_0x2d3c82,_0x929c2f){_0x2d3c82=_0x2d3c82-0x0;var _0x3172ab=_0x2b22[_0x2d3c82];return _0x3172ab;};'use strict';var _=require(_0x22b2('0x0'));var http=require(_0x22b2('0x1'));var express=require('express');var sticky=require(_0x22b2('0x2'));var Redis=require(_0x22b2('0x3'));var config=require(_0x22b2('0x4'));var app=express();var server=http[_0x22b2('0x5')](app);server[_0x22b2('0x6')]=0xdbba0;if(sticky[_0x22b2('0x7')](server,config[_0x22b2('0x8')])){var socketio=require(_0x22b2('0x9'))(server,{'transports':[_0x22b2('0xa'),'polling']});config[_0x22b2('0xb')]=_[_0x22b2('0xc')](config[_0x22b2('0xb')],{'host':_0x22b2('0xd'),'port':0x18eb});socketio[_0x22b2('0xe')](require(_0x22b2('0xf'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x22b2('0xb')])}));require(_0x22b2('0x10'))[_0x22b2('0x11')]();require(_0x22b2('0x12'))['default'](socketio);require(_0x22b2('0x13'))[_0x22b2('0x11')](app);require(_0x22b2('0x14'))['default'](app);}else{server['once']('listening',function(){console[_0x22b2('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x22b2('0x8')]);});}exports=module[_0x22b2('0x16')]=app;
\ No newline at end of file
+var _0xf84b=['../../config/express','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','express','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','polling','redis','localhost','adapter','../../config/triggers','default'];(function(_0x15be66,_0x3a86c1){var _0x1d5d87=function(_0x4dd8d0){while(--_0x4dd8d0){_0x15be66['push'](_0x15be66['shift']());}};_0x1d5d87(++_0x3a86c1);}(_0xf84b,0x85));var _0xbf84=function(_0x102ce6,_0x40aee3){_0x102ce6=_0x102ce6-0x0;var _0x3f2cf4=_0xf84b[_0x102ce6];return _0x3f2cf4;};'use strict';var _=require('lodash');var http=require(_0xbf84('0x0'));var express=require(_0xbf84('0x1'));var sticky=require(_0xbf84('0x2'));var Redis=require(_0xbf84('0x3'));var config=require(_0xbf84('0x4'));var app=express();var server=http['createServer'](app);server[_0xbf84('0x5')]=0xdbba0;if(sticky[_0xbf84('0x6')](server,config['port'])){var socketio=require(_0xbf84('0x7'))(server,{'transports':['websocket',_0xbf84('0x8')]});config['redis']=_['defaults'](config[_0xbf84('0x9')],{'host':_0xbf84('0xa'),'port':0x18eb});socketio[_0xbf84('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xbf84('0x9')])}));require(_0xbf84('0xc'))['default']();require('../../config/socketio')[_0xbf84('0xd')](socketio);require(_0xbf84('0xe'))[_0xbf84('0xd')](app);require(_0xbf84('0xf'))['default'](app);}else{server[_0xbf84('0x10')](_0xbf84('0x11'),function(){console['log'](_0xbf84('0x12'),config[_0xbf84('0x13')]);});}exports=module[_0xbf84('0x14')]=app;
\ No newline at end of file
index e2eee26..4597ddc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57a3=['result','catch','exports','jayson/promise','bluebird','client','http','Request','request','debug','rpc','routing','error','message'];(function(_0x13a900,_0x43b7be){var _0x5e613d=function(_0x5ccf09){while(--_0x5ccf09){_0x13a900['push'](_0x13a900['shift']());}};_0x5e613d(++_0x43b7be);}(_0x57a3,0x8f));var _0x357a=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x57a3[_0x3da832];return _0xe602f2;};'use strict';var jayson=require(_0x357a('0x0'));var BPromise=require(_0x357a('0x1'));var logger=require('../../config/logger')('routing');var client=jayson[_0x357a('0x2')][_0x357a('0x3')]({'port':0x2329});client[_0x357a('0x4')]=function(_0x27bc34,_0x5683aa){return new BPromise(function(_0x4afa8c,_0x23ab89){return client[_0x357a('0x5')](_0x27bc34,_0x5683aa)['then'](function(_0x41fb92){logger[_0x357a('0x6')](_0x357a('0x7'),_0x357a('0x8'),_0x27bc34,_0x5683aa,_0x41fb92);if(_0x41fb92[_0x357a('0x9')]){logger['error'](_0x357a('0x7'),_0x357a('0x8'),_0x27bc34,_0x41fb92['error'][_0x357a('0xa')],_0x5683aa);return _0x23ab89(_0x41fb92[_0x357a('0x9')][_0x357a('0xa')]);}else{return _0x4afa8c(_0x41fb92[_0x357a('0xb')]);}})[_0x357a('0xc')](function(_0x5c3482){logger[_0x357a('0x9')](_0x357a('0x7'),_0x357a('0x8'),_0x27bc34,_0x5c3482,_0x5683aa);return _0x23ab89(_0x5c3482);});});};module[_0x357a('0xd')]=client;
\ No newline at end of file
+var _0xca0e=['result','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','debug','rpc','error','message'];(function(_0x4c18f2,_0x1c4824){var _0x17cec7=function(_0x2c23f4){while(--_0x2c23f4){_0x4c18f2['push'](_0x4c18f2['shift']());}};_0x17cec7(++_0x1c4824);}(_0xca0e,0x1ae));var _0xeca0=function(_0x417058,_0x5ad74e){_0x417058=_0x417058-0x0;var _0x3b7501=_0xca0e[_0x417058];return _0x3b7501;};'use strict';var jayson=require(_0xeca0('0x0'));var BPromise=require(_0xeca0('0x1'));var logger=require(_0xeca0('0x2'))(_0xeca0('0x3'));var client=jayson[_0xeca0('0x4')][_0xeca0('0x5')]({'port':0x2329});client[_0xeca0('0x6')]=function(_0x4219a6,_0x5b5f8e){return new BPromise(function(_0x2bdcad,_0x493f17){return client['request'](_0x4219a6,_0x5b5f8e)[_0xeca0('0x7')](function(_0x57c41a){logger[_0xeca0('0x8')](_0xeca0('0x9'),_0xeca0('0x3'),_0x4219a6,_0x5b5f8e,_0x57c41a);if(_0x57c41a['error']){logger[_0xeca0('0xa')](_0xeca0('0x9'),_0xeca0('0x3'),_0x4219a6,_0x57c41a[_0xeca0('0xa')][_0xeca0('0xb')],_0x5b5f8e);return _0x493f17(_0x57c41a[_0xeca0('0xa')][_0xeca0('0xb')]);}else{return _0x2bdcad(_0x57c41a[_0xeca0('0xc')]);}})['catch'](function(_0x226b3c){logger['error']('rpc','routing',_0x4219a6,_0x226b3c,_0x5b5f8e);return _0x493f17(_0x226b3c);});});};module['exports']=client;
\ No newline at end of file
index 5312411..a7e4965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe507=['bluebird','./server','./realtime','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','getSmsQueues','getMailQueues','initMailQueues','initFaxQueues','initWhatsappQueues','catch'];(function(_0x2f48a7,_0x54ea3c){var _0x3546f6=function(_0x2323d4){while(--_0x2323d4){_0x2f48a7['push'](_0x2f48a7['shift']());}};_0x3546f6(++_0x54ea3c);}(_0xe507,0x13b));var _0x7e50=function(_0x120bc2,_0x57a253){_0x120bc2=_0x120bc2-0x0;var _0x454a41=_0xe507[_0x120bc2];return _0x454a41;};'use strict';var BPromise=require(_0x7e50('0x0'));var server=require(_0x7e50('0x1'));var Realtime=require(_0x7e50('0x2'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x7e50('0x3'));var chatQueue=require(_0x7e50('0x4'));var smsQueue=require(_0x7e50('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0x7e50('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7e50('0x7')]()[_0x7e50('0x8')](user[_0x7e50('0x9')]())[_0x7e50('0x8')](realtime[_0x7e50('0xa')]())[_0x7e50('0x8')](interval[_0x7e50('0xb')]())[_0x7e50('0x8')](realtime['initIntervals']())[_0x7e50('0x8')](openchannelQueue[_0x7e50('0xc')]())[_0x7e50('0x8')](realtime[_0x7e50('0xd')]())[_0x7e50('0x8')](chatQueue[_0x7e50('0xe')]())[_0x7e50('0x8')](realtime['initChatQueues']())[_0x7e50('0x8')](smsQueue[_0x7e50('0xf')]())[_0x7e50('0x8')](realtime['initSmsQueues']())[_0x7e50('0x8')](mailQueue[_0x7e50('0x10')]())[_0x7e50('0x8')](realtime[_0x7e50('0x11')]())[_0x7e50('0x8')](faxQueue['getFaxQueues']())[_0x7e50('0x8')](realtime[_0x7e50('0x12')]())[_0x7e50('0x8')](whatsappQueue['getWhatsappQueues']())[_0x7e50('0x8')](realtime[_0x7e50('0x13')]())[_0x7e50('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x7e50('0x8')](function(_0x469e14){return initRealtime();})[_0x7e50('0x8')](function(_0x20724d){return setInterval(initRealtime,0x1388);})[_0x7e50('0x14')](function(_0x331fb8){console['log'](_0x331fb8);});}main();
\ No newline at end of file
+var _0xadfe=['resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue'];(function(_0x223433,_0x4d0887){var _0x2fb5a8=function(_0x5a3bd2){while(--_0x5a3bd2){_0x223433['push'](_0x223433['shift']());}};_0x2fb5a8(++_0x4d0887);}(_0xadfe,0x1ad));var _0xeadf=function(_0xacb35c,_0xf6245e){_0xacb35c=_0xacb35c-0x0;var _0x44c8a9=_0xadfe[_0xacb35c];return _0x44c8a9;};'use strict';var BPromise=require(_0xeadf('0x0'));var server=require('./server');var Realtime=require(_0xeadf('0x1'));var user=require(_0xeadf('0x2'));var interval=require(_0xeadf('0x3'));var openchannelQueue=require(_0xeadf('0x4'));var chatQueue=require(_0xeadf('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xeadf('0x6'));var whatsappQueue=require(_0xeadf('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xeadf('0x8')]()[_0xeadf('0x9')](user[_0xeadf('0xa')]())[_0xeadf('0x9')](realtime[_0xeadf('0xb')]())[_0xeadf('0x9')](interval[_0xeadf('0xc')]())[_0xeadf('0x9')](realtime[_0xeadf('0xd')]())[_0xeadf('0x9')](openchannelQueue[_0xeadf('0xe')]())[_0xeadf('0x9')](realtime[_0xeadf('0xf')]())[_0xeadf('0x9')](chatQueue[_0xeadf('0x10')]())['then'](realtime[_0xeadf('0x11')]())[_0xeadf('0x9')](smsQueue['getSmsQueues']())[_0xeadf('0x9')](realtime['initSmsQueues']())[_0xeadf('0x9')](mailQueue['getMailQueues']())[_0xeadf('0x9')](realtime[_0xeadf('0x12')]())[_0xeadf('0x9')](faxQueue[_0xeadf('0x13')]())['then'](realtime[_0xeadf('0x14')]())[_0xeadf('0x9')](whatsappQueue['getWhatsappQueues']())[_0xeadf('0x9')](realtime[_0xeadf('0x15')]())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x221078){return initRealtime();})[_0xeadf('0x9')](function(_0xb60c11){return setInterval(initRealtime,0x1388);})['catch'](function(_0x23a5f7){console[_0xeadf('0x16')](_0x23a5f7);});}main();
\ No newline at end of file
index fcd8285..e6a029e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5aadc2,_0x3ff7c1){var _0x1c2d03=function(_0x55ffab){while(--_0x55ffab){_0x5aadc2['push'](_0x5aadc2['shift']());}};_0x1c2d03(++_0x3ff7c1);}(_0x814b,0x1a2));var _0xb814=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0x814b[_0x4cc492];return _0x1f36b9;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x508e28,_0x4dc058){var _0x49b6d3=function(_0xd67e74){while(--_0xd67e74){_0x508e28['push'](_0x508e28['shift']());}};_0x49b6d3(++_0x4dc058);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x5fc3[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
index 8e4d76d..06fc0c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b19=['jayson/promise','client','http','request','then','error','message','result','sendMailMessage','SendMail','bluebird'];(function(_0x311bc7,_0x390f57){var _0x3ec959=function(_0x415275){while(--_0x415275){_0x311bc7['push'](_0x311bc7['shift']());}};_0x3ec959(++_0x390f57);}(_0x8b19,0x149));var _0x98b1=function(_0x4e866b,_0x519cb0){_0x4e866b=_0x4e866b-0x0;var _0x32eddd=_0x8b19[_0x4e866b];return _0x32eddd;};'use strict';var BPromise=require(_0x98b1('0x0'));var jayson=require(_0x98b1('0x1'));var client=jayson[_0x98b1('0x2')][_0x98b1('0x3')]({'port':0x232b});function request(_0x2f0eb5,_0x39c810){return new BPromise(function(_0x23d73c,_0x510b77){return client[_0x98b1('0x4')](_0x2f0eb5,_0x39c810)[_0x98b1('0x5')](function(_0x1f288e){if(_0x1f288e[_0x98b1('0x6')]){return _0x510b77(_0x1f288e[_0x98b1('0x6')][_0x98b1('0x7')]);}else{return _0x23d73c(_0x1f288e[_0x98b1('0x8')]);}})['catch'](function(_0x21de65){return _0x510b77(_0x21de65);});});}exports[_0x98b1('0x9')]=function(_0x44a40a,_0x1811c6){return request(_0x98b1('0xa'),{'account':_0x44a40a,'message':_0x1811c6});};
\ No newline at end of file
+var _0x7ab8=['jayson/promise','http','then','error','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x559907,_0x55f18c){var _0x512891=function(_0x52f12b){while(--_0x52f12b){_0x559907['push'](_0x559907['shift']());}};_0x512891(++_0x55f18c);}(_0x7ab8,0x171));var _0x87ab=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7ab8[_0x2c91e9];return _0x13f0ff;};'use strict';var BPromise=require(_0x87ab('0x0'));var jayson=require(_0x87ab('0x1'));var client=jayson['client'][_0x87ab('0x2')]({'port':0x232b});function request(_0x3d88f4,_0x347f58){return new BPromise(function(_0xc52019,_0x23fd32){return client['request'](_0x3d88f4,_0x347f58)[_0x87ab('0x3')](function(_0x405845){if(_0x405845[_0x87ab('0x4')]){return _0x23fd32(_0x405845[_0x87ab('0x4')][_0x87ab('0x5')]);}else{return _0xc52019(_0x405845[_0x87ab('0x6')]);}})[_0x87ab('0x7')](function(_0x4bec89){return _0x23fd32(_0x4bec89);});});}exports[_0x87ab('0x8')]=function(_0x4dd620,_0x2e0362){return request(_0x87ab('0x9'),{'account':_0x4dd620,'message':_0x2e0362});};
\ No newline at end of file
index 70a9cd4..f86badb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15d5=['mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','mailPause','chatCurrentCapacity','mailCurrentCapacity','faxStatusTime','whatsappStatus','whatsappCurrentCapacity','mailWaitingInteractions','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x15d5,0xbe));var _0x515d=function(_0xd51a95,_0x24d8dc){_0xd51a95=_0xd51a95-0x0;var _0x1634be=_0x15d5[_0xd51a95];return _0x1634be;};'use strict';var _=require(_0x515d('0x0'));var moment=require(_0x515d('0x1'));var md5=require(_0x515d('0x2'));var Redis=require(_0x515d('0x3'));var config=require(_0x515d('0x4'));config[_0x515d('0x5')]=_[_0x515d('0x6')](config[_0x515d('0x5')],{'host':_0x515d('0x7'),'port':0x18eb});var io=require(_0x515d('0x8'))(new Redis(config[_0x515d('0x5')]));function Agent(_0x1c04e){this['id']=_0x1c04e['id']||0x0;this[_0x515d('0x9')]=_0x1c04e[_0x515d('0x9')]||'';this[_0x515d('0xa')]=_0x1c04e[_0x515d('0xa')]||!![];this[_0x515d('0xb')]=_0x1c04e[_0x515d('0xb')]||![];this[_0x515d('0xc')]=_0x1c04e[_0x515d('0xc')]||![];this['mailPause']=_0x1c04e['mailPause']||![];this['faxPause']=_0x1c04e[_0x515d('0xd')]||![];this[_0x515d('0xe')]=_0x1c04e[_0x515d('0xe')]||![];this['openchannelPause']=_0x1c04e[_0x515d('0xf')]||![];this[_0x515d('0x10')]=_0x515d('0x11');this[_0x515d('0x12')]=0x0;this[_0x515d('0x13')]=_0x1c04e[_0x515d('0x13')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x515d('0x14')]=_0x515d('0x11');this[_0x515d('0x15')]=0x0;this[_0x515d('0x16')]=_0x1c04e[_0x515d('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x515d('0x17')]=_0x515d('0x11');this['faxStatusTime']=0x0;this[_0x515d('0x18')]=_0x1c04e[_0x515d('0x18')]||0x0;this[_0x515d('0x19')]=0x0;this[_0x515d('0x1a')]=_0x515d('0x11');this[_0x515d('0x1b')]=0x0;this[_0x515d('0x1c')]=_0x1c04e[_0x515d('0x1c')]||0x0;this[_0x515d('0x1d')]=0x0;this['whatsappStatus']=_0x515d('0x11');this[_0x515d('0x1e')]=0x0;this[_0x515d('0x1f')]=_0x1c04e[_0x515d('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x515d('0x20')]=_0x515d('0x11');this[_0x515d('0x21')]=0x0;this[_0x515d('0x22')]=_0x1c04e[_0x515d('0x22')]||0x0;this[_0x515d('0x23')]=0x0;this[_0x515d('0x24')]=![];this[_0x515d('0x25')]=undefined;this['md5']='';this[_0x515d('0x26')]={};this[_0x515d('0x27')]={};this['mailWaitingInteractions']={};this[_0x515d('0x28')]={};this[_0x515d('0x29')]={};this[_0x515d('0x2a')]={};this[_0x515d('0x2b')]();}Agent[_0x515d('0x2c')][_0x515d('0x2d')]=function(_0x5f4d95){if(this[_0x5f4d95+'CurrentCapacity']>0x0){if(this[_0x5f4d95+_0x515d('0x2e')]>0x0&&this[_0x5f4d95+_0x515d('0x2f')]>=this[_0x5f4d95+'Capacity']){return _0x515d('0x30');}else{return _0x515d('0x31');}}else{return _0x515d('0x32');}};Agent[_0x515d('0x2c')]['updateRealtime']=function(){var _0x1cb960=[_0x515d('0x33'),_0x515d('0x34'),'openchannel',_0x515d('0x35'),_0x515d('0x36'),_0x515d('0x37')];for(var _0x321454=0x0;_0x321454<_0x1cb960[_0x515d('0x38')];_0x321454+=0x1){var _0xafbfd7=this[_0x515d('0x2d')](_0x1cb960[_0x321454]);if(this[_0x1cb960[_0x321454]+_0x515d('0x39')]!==_0xafbfd7){this[_0x1cb960[_0x321454]+_0x515d('0x3a')]=_[_0x515d('0x3b')](moment()[_0x515d('0x3c')]('x'));}this[_0x1cb960[_0x321454]+_0x515d('0x39')]=_0xafbfd7;}var _0x108217={'id':this['id'],'name':this[_0x515d('0x9')],'online':this[_0x515d('0xa')],'voicePause':this[_0x515d('0xb')],'chatPause':this[_0x515d('0xc')],'mailPause':this[_0x515d('0x3d')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x515d('0xf')],'chatStatus':this[_0x515d('0x10')],'chatStatusTime':this[_0x515d('0x12')],'chatCapacity':this[_0x515d('0x13')],'chatCurrentCapacity':this[_0x515d('0x3e')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x515d('0x15')],'mailCapacity':this[_0x515d('0x16')],'mailCurrentCapacity':this[_0x515d('0x3f')],'faxStatus':this[_0x515d('0x17')],'faxStatusTime':this[_0x515d('0x40')],'faxCapacity':this[_0x515d('0x18')],'faxCurrentCapacity':this[_0x515d('0x19')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x515d('0x1b')],'smsCapacity':this[_0x515d('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x515d('0x41')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x515d('0x1f')],'whatsappCurrentCapacity':this[_0x515d('0x42')],'openchannelStatus':this[_0x515d('0x20')],'openchannelStatusTime':this[_0x515d('0x21')],'openchannelCapacity':this[_0x515d('0x22')],'openchannelCurrentCapacity':this[_0x515d('0x23')],'busy':this[_0x515d('0x24')],'busyQueue':this[_0x515d('0x25')],'chatWaitingInteractions':this[_0x515d('0x26')],'faxWaitingInteractions':this[_0x515d('0x27')],'mailWaitingInteractions':this[_0x515d('0x43')],'openchannelWaitingInteractions':this[_0x515d('0x28')],'smsWaitingInteractions':this[_0x515d('0x29')],'whatsappWaitingInteractions':this[_0x515d('0x2a')]};var _0xec0968=md5(JSON['stringify'](_0x108217));if(this[_0x515d('0x2')]!==_0xec0968){this[_0x515d('0x2')]=_0xec0968;io[_0x515d('0x44')](_0x515d('0x45'),_0x108217);}};module['exports']=Agent;
\ No newline at end of file
+var _0xbeac=['format','chatStatus','mailStatus','smsStatusTime','whatsappStatus','openchannelStatusTime','chatWaitingInteractions','faxWaitingInteractions','stringify','emit','exports','lodash','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','CurrentCapacity','maxcapacity','idle','mail','chat','openchannel','fax','sms','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber'];(function(_0x4afadd,_0x2885c0){var _0x5a771d=function(_0x209854){while(--_0x209854){_0x4afadd['push'](_0x4afadd['shift']());}};_0x5a771d(++_0x2885c0);}(_0xbeac,0x1e7));var _0xcbea=function(_0x380eea,_0x711c86){_0x380eea=_0x380eea-0x0;var _0x1aa0ab=_0xbeac[_0x380eea];return _0x1aa0ab;};'use strict';var _=require(_0xcbea('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xcbea('0x1'));var config=require(_0xcbea('0x2'));config['redis']=_[_0xcbea('0x3')](config[_0xcbea('0x4')],{'host':_0xcbea('0x5'),'port':0x18eb});var io=require(_0xcbea('0x6'))(new Redis(config['redis']));function Agent(_0x364fbe){this['id']=_0x364fbe['id']||0x0;this[_0xcbea('0x7')]=_0x364fbe[_0xcbea('0x7')]||'';this[_0xcbea('0x8')]=_0x364fbe['online']||!![];this[_0xcbea('0x9')]=_0x364fbe[_0xcbea('0x9')]||![];this[_0xcbea('0xa')]=_0x364fbe[_0xcbea('0xa')]||![];this[_0xcbea('0xb')]=_0x364fbe[_0xcbea('0xb')]||![];this[_0xcbea('0xc')]=_0x364fbe[_0xcbea('0xc')]||![];this[_0xcbea('0xd')]=_0x364fbe[_0xcbea('0xd')]||![];this[_0xcbea('0xe')]=_0x364fbe[_0xcbea('0xe')]||![];this['chatStatus']=_0xcbea('0xf');this[_0xcbea('0x10')]=0x0;this[_0xcbea('0x11')]=_0x364fbe[_0xcbea('0x11')]||0x0;this[_0xcbea('0x12')]=0x0;this['mailStatus']=_0xcbea('0xf');this[_0xcbea('0x13')]=0x0;this[_0xcbea('0x14')]=_0x364fbe[_0xcbea('0x14')]||0x0;this[_0xcbea('0x15')]=0x0;this[_0xcbea('0x16')]=_0xcbea('0xf');this[_0xcbea('0x17')]=0x0;this[_0xcbea('0x18')]=_0x364fbe[_0xcbea('0x18')]||0x0;this[_0xcbea('0x19')]=0x0;this[_0xcbea('0x1a')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0x364fbe[_0xcbea('0x1b')]||0x0;this[_0xcbea('0x1c')]=0x0;this['whatsappStatus']=_0xcbea('0xf');this[_0xcbea('0x1d')]=0x0;this[_0xcbea('0x1e')]=_0x364fbe['whatsappCapacity']||0x0;this[_0xcbea('0x1f')]=0x0;this[_0xcbea('0x20')]='unknown';this['openchannelStatusTime']=0x0;this[_0xcbea('0x21')]=_0x364fbe[_0xcbea('0x21')]||0x0;this[_0xcbea('0x22')]=0x0;this[_0xcbea('0x23')]=![];this[_0xcbea('0x24')]=undefined;this[_0xcbea('0x25')]='';this['chatWaitingInteractions']={};this['faxWaitingInteractions']={};this[_0xcbea('0x26')]={};this[_0xcbea('0x27')]={};this['smsWaitingInteractions']={};this[_0xcbea('0x28')]={};this[_0xcbea('0x29')]();}Agent[_0xcbea('0x2a')]['getChannelStatus']=function(_0x5156ed){if(this[_0x5156ed+'CurrentCapacity']>0x0){if(this[_0x5156ed+'Capacity']>0x0&&this[_0x5156ed+_0xcbea('0x2b')]>=this[_0x5156ed+'Capacity']){return _0xcbea('0x2c');}else{return'working';}}else{return _0xcbea('0x2d');}};Agent[_0xcbea('0x2a')][_0xcbea('0x29')]=function(){var _0x2a99ca=[_0xcbea('0x2e'),_0xcbea('0x2f'),_0xcbea('0x30'),_0xcbea('0x31'),_0xcbea('0x32'),_0xcbea('0x33')];for(var _0x409583=0x0;_0x409583<_0x2a99ca[_0xcbea('0x34')];_0x409583+=0x1){var _0xabde1b=this[_0xcbea('0x35')](_0x2a99ca[_0x409583]);if(this[_0x2a99ca[_0x409583]+_0xcbea('0x36')]!==_0xabde1b){this[_0x2a99ca[_0x409583]+_0xcbea('0x37')]=_[_0xcbea('0x38')](moment()[_0xcbea('0x39')]('x'));}this[_0x2a99ca[_0x409583]+'Status']=_0xabde1b;}var _0x40eab0={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xcbea('0x9')],'chatPause':this[_0xcbea('0xa')],'mailPause':this[_0xcbea('0xb')],'smsPause':this[_0xcbea('0xd')],'faxPause':this[_0xcbea('0xc')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xcbea('0x3a')],'chatStatusTime':this[_0xcbea('0x10')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xcbea('0x3b')],'mailStatusTime':this[_0xcbea('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xcbea('0x15')],'faxStatus':this[_0xcbea('0x16')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xcbea('0x18')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xcbea('0x1a')],'smsStatusTime':this[_0xcbea('0x3c')],'smsCapacity':this[_0xcbea('0x1b')],'smsCurrentCapacity':this[_0xcbea('0x1c')],'whatsappStatus':this[_0xcbea('0x3d')],'whatsappStatusTime':this[_0xcbea('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xcbea('0x1f')],'openchannelStatus':this[_0xcbea('0x20')],'openchannelStatusTime':this[_0xcbea('0x3e')],'openchannelCapacity':this[_0xcbea('0x21')],'openchannelCurrentCapacity':this[_0xcbea('0x22')],'busy':this[_0xcbea('0x23')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0xcbea('0x3f')],'faxWaitingInteractions':this[_0xcbea('0x40')],'mailWaitingInteractions':this[_0xcbea('0x26')],'openchannelWaitingInteractions':this[_0xcbea('0x27')],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this[_0xcbea('0x28')]};var _0x1daa21=md5(JSON[_0xcbea('0x41')](_0x40eab0));if(this[_0xcbea('0x25')]!==_0x1daa21){this[_0xcbea('0x25')]=_0x1daa21;io[_0xcbea('0x42')]('user:save',_0x40eab0);}};module[_0xcbea('0x43')]=Agent;
\ No newline at end of file
index d7f2313..aab0dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1123=['map','paused','online','loggedIn','chatPause','available','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','_rr','mapAgentsId'];(function(_0x8d065b,_0x4c6115){var _0x1244e3=function(_0x2555ff){while(--_0x2555ff){_0x8d065b['push'](_0x8d065b['shift']());}};_0x1244e3(++_0x4c6115);}(_0x1123,0xe3));var _0x3112=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x1123[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var md5=require(_0x3112('0x0'));var util=require(_0x3112('0x1'));var Redis=require(_0x3112('0x2'));var config=require('../../../config/environment');config[_0x3112('0x3')]=_[_0x3112('0x4')](config[_0x3112('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x3112('0x5'))(new Redis(config[_0x3112('0x3')]));function ChatQueue(_0x5e3df6){this['id']=_0x5e3df6['id']||0x0;this['name']=_0x5e3df6[_0x3112('0x6')]||'';this[_0x3112('0x7')]=_0x5e3df6[_0x3112('0x7')]||0xa;this[_0x3112('0x8')]=_0x5e3df6[_0x3112('0x8')]||_0x3112('0x9');this['Agents']=_0x5e3df6[_0x3112('0xa')];this['mapAgentsId']={};this[_0x3112('0xb')]=0x0;this[_0x3112('0x0')]='';this['updateRouting']();this[_0x3112('0xc')]();}ChatQueue[_0x3112('0xd')]['updateRouting']=function(){var _0x3db583=this['mapAgentsId'][_0x3112('0xe')];this[_0x3112('0xf')]=_[_0x3112('0x10')](this['Agents'],'id');this[_0x3112('0xf')][_0x3112('0xe')]=_0x3db583;};ChatQueue[_0x3112('0xd')][_0x3112('0xc')]=function(){this['loggedIn']=0x0;this[_0x3112('0x11')]=0x0;for(var _0x122b00=0x0;_0x122b00<this['Agents']['length'];_0x122b00+=0x1){if(this[_0x3112('0xa')][_0x122b00][_0x3112('0x12')]){this[_0x3112('0x13')]+=0x1;}if(this[_0x3112('0xa')][_0x122b00][_0x3112('0x14')]){this['paused']+=0x1;}}this[_0x3112('0x15')]=this[_0x3112('0x13')]-this[_0x3112('0x11')];this[_0x3112('0x15')]=this[_0x3112('0x15')]>=0x0?this[_0x3112('0x15')]:0x0;var _0x37419c={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3112('0x13')],'name':this[_0x3112('0x6')],'paused':this[_0x3112('0x11')],'waiting':this[_0x3112('0xb')]};var _0x4bc59e=md5(JSON[_0x3112('0x16')](_0x37419c));if(this[_0x3112('0x0')]!==_0x4bc59e){this[_0x3112('0x0')]=_0x4bc59e;io['to'](util[_0x3112('0x17')](_0x3112('0x18'),_0x37419c[_0x3112('0x6')]))['emit'](_0x3112('0x19'),_0x37419c);}};module[_0x3112('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0x3a1a=['chat_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','updateRouting','_rr','loggedIn','paused','online','chatPause','available','chat:queue:%s','emit'];(function(_0x112f18,_0x1ec9c9){var _0x1e4f99=function(_0x492ef4){while(--_0x492ef4){_0x112f18['push'](_0x112f18['shift']());}};_0x1e4f99(++_0x1ec9c9);}(_0x3a1a,0x1cd));var _0xa3a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a1a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa3a1('0x0'));var md5=require(_0xa3a1('0x1'));var util=require(_0xa3a1('0x2'));var Redis=require(_0xa3a1('0x3'));var config=require('../../../config/environment');config[_0xa3a1('0x4')]=_[_0xa3a1('0x5')](config['redis'],{'host':_0xa3a1('0x6'),'port':0x18eb});var io=require(_0xa3a1('0x7'))(new Redis(config[_0xa3a1('0x4')]));function ChatQueue(_0x47e556){this['id']=_0x47e556['id']||0x0;this['name']=_0x47e556[_0xa3a1('0x8')]||'';this['timeout']=_0x47e556[_0xa3a1('0x9')]||0xa;this[_0xa3a1('0xa')]=_0x47e556[_0xa3a1('0xa')]||_0xa3a1('0xb');this[_0xa3a1('0xc')]=_0x47e556[_0xa3a1('0xc')];this[_0xa3a1('0xd')]={};this['waiting']=0x0;this[_0xa3a1('0x1')]='';this['updateRouting']();this[_0xa3a1('0xe')]();}ChatQueue[_0xa3a1('0xf')][_0xa3a1('0x10')]=function(){var _0x4275e2=this['mapAgentsId'][_0xa3a1('0x11')];this[_0xa3a1('0xd')]=_['map'](this[_0xa3a1('0xc')],'id');this[_0xa3a1('0xd')][_0xa3a1('0x11')]=_0x4275e2;};ChatQueue['prototype'][_0xa3a1('0xe')]=function(){this[_0xa3a1('0x12')]=0x0;this[_0xa3a1('0x13')]=0x0;for(var _0x43d5dc=0x0;_0x43d5dc<this[_0xa3a1('0xc')]['length'];_0x43d5dc+=0x1){if(this[_0xa3a1('0xc')][_0x43d5dc][_0xa3a1('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x43d5dc][_0xa3a1('0x15')]){this['paused']+=0x1;}}this[_0xa3a1('0x16')]=this[_0xa3a1('0x12')]-this[_0xa3a1('0x13')];this[_0xa3a1('0x16')]=this[_0xa3a1('0x16')]>=0x0?this[_0xa3a1('0x16')]:0x0;var _0x40c401={'id':this['id'],'available':this['available'],'loggedIn':this[_0xa3a1('0x12')],'name':this[_0xa3a1('0x8')],'paused':this[_0xa3a1('0x13')],'waiting':this['waiting']};var _0xc31c7b=md5(JSON['stringify'](_0x40c401));if(this[_0xa3a1('0x1')]!==_0xc31c7b){this[_0xa3a1('0x1')]=_0xc31c7b;io['to'](util['format'](_0xa3a1('0x17'),_0x40c401[_0xa3a1('0x8')]))[_0xa3a1('0x18')](_0xa3a1('0x19'),_0x40c401);}};module[_0xa3a1('0x1a')]=ChatQueue;
\ No newline at end of file
index be69765..a8c1802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc275=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','paused','length','online','faxPause','available','loggedIn','stringify','md5','format','fax:queue:%s','emit','fax_queue:save','lodash','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc275,0x8d));var _0x5c27=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc275[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0x5c27('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x5c27('0x1'));var config=require(_0x5c27('0x2'));config[_0x5c27('0x3')]=_['defaults'](config['redis'],{'host':_0x5c27('0x4'),'port':0x18eb});var io=require(_0x5c27('0x5'))(new Redis(config['redis']));function FaxQueue(_0x559f7d){this['id']=_0x559f7d['id']||0x0;this[_0x5c27('0x6')]=_0x559f7d[_0x5c27('0x6')]||'';this[_0x5c27('0x7')]=_0x559f7d[_0x5c27('0x7')]||0xa;this[_0x5c27('0x8')]=_0x559f7d[_0x5c27('0x8')]||_0x5c27('0x9');this[_0x5c27('0xa')]=_0x559f7d['Agents'];this[_0x5c27('0xb')]={};this[_0x5c27('0xc')]=0x0;this['md5']='';this[_0x5c27('0xd')]();this[_0x5c27('0xe')]();}FaxQueue[_0x5c27('0xf')][_0x5c27('0xd')]=function(){var _0x2e23a7=this[_0x5c27('0xb')][_0x5c27('0x10')];this[_0x5c27('0xb')]=_[_0x5c27('0x11')](this[_0x5c27('0xa')],'id');this[_0x5c27('0xb')][_0x5c27('0x10')]=_0x2e23a7;};FaxQueue['prototype'][_0x5c27('0xe')]=function(){this['loggedIn']=0x0;this[_0x5c27('0x12')]=0x0;for(var _0x40c646=0x0;_0x40c646<this[_0x5c27('0xa')][_0x5c27('0x13')];_0x40c646+=0x1){if(this['Agents'][_0x40c646][_0x5c27('0x14')]){this['loggedIn']+=0x1;}if(this[_0x5c27('0xa')][_0x40c646][_0x5c27('0x15')]){this[_0x5c27('0x12')]+=0x1;}}this['available']=this['loggedIn']-this[_0x5c27('0x12')];this['available']=this[_0x5c27('0x16')]>=0x0?this['available']:0x0;var _0x46340d={'id':this['id'],'available':this[_0x5c27('0x16')],'loggedIn':this[_0x5c27('0x17')],'name':this[_0x5c27('0x6')],'paused':this['paused'],'waiting':this[_0x5c27('0xc')]};var _0x1b2a5b=md5(JSON[_0x5c27('0x18')](_0x46340d));if(this[_0x5c27('0x19')]!==_0x1b2a5b){this[_0x5c27('0x19')]=_0x1b2a5b;io['to'](util[_0x5c27('0x1a')](_0x5c27('0x1b'),_0x46340d['name']))[_0x5c27('0x1c')](_0x5c27('0x1d'),_0x46340d);}};module['exports']=FaxQueue;
\ No newline at end of file
+var _0x2e4b=['available','format','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','faxPause','paused'];(function(_0x318229,_0x8461b1){var _0x4958d7=function(_0x2fa180){while(--_0x2fa180){_0x318229['push'](_0x318229['shift']());}};_0x4958d7(++_0x8461b1);}(_0x2e4b,0xc9));var _0xb2e4=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0x2e4b[_0x59bcb1];return _0x4a737f;};'use strict';var _=require(_0xb2e4('0x0'));var md5=require(_0xb2e4('0x1'));var util=require(_0xb2e4('0x2'));var Redis=require(_0xb2e4('0x3'));var config=require(_0xb2e4('0x4'));config['redis']=_[_0xb2e4('0x5')](config['redis'],{'host':_0xb2e4('0x6'),'port':0x18eb});var io=require(_0xb2e4('0x7'))(new Redis(config['redis']));function FaxQueue(_0x1dd20c){this['id']=_0x1dd20c['id']||0x0;this[_0xb2e4('0x8')]=_0x1dd20c['name']||'';this[_0xb2e4('0x9')]=_0x1dd20c['timeout']||0xa;this[_0xb2e4('0xa')]=_0x1dd20c[_0xb2e4('0xa')]||'beepall';this[_0xb2e4('0xb')]=_0x1dd20c[_0xb2e4('0xb')];this[_0xb2e4('0xc')]={};this['waiting']=0x0;this[_0xb2e4('0x1')]='';this[_0xb2e4('0xd')]();this[_0xb2e4('0xe')]();}FaxQueue[_0xb2e4('0xf')]['updateRouting']=function(){var _0x21e62b=this[_0xb2e4('0xc')][_0xb2e4('0x10')];this[_0xb2e4('0xc')]=_[_0xb2e4('0x11')](this['Agents'],'id');this['mapAgentsId'][_0xb2e4('0x10')]=_0x21e62b;};FaxQueue['prototype'][_0xb2e4('0xe')]=function(){this[_0xb2e4('0x12')]=0x0;this['paused']=0x0;for(var _0x182837=0x0;_0x182837<this['Agents'][_0xb2e4('0x13')];_0x182837+=0x1){if(this[_0xb2e4('0xb')][_0x182837][_0xb2e4('0x14')]){this[_0xb2e4('0x12')]+=0x1;}if(this[_0xb2e4('0xb')][_0x182837][_0xb2e4('0x15')]){this[_0xb2e4('0x16')]+=0x1;}}this['available']=this[_0xb2e4('0x12')]-this[_0xb2e4('0x16')];this[_0xb2e4('0x17')]=this[_0xb2e4('0x17')]>=0x0?this[_0xb2e4('0x17')]:0x0;var _0x405183={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb2e4('0x12')],'name':this[_0xb2e4('0x8')],'paused':this[_0xb2e4('0x16')],'waiting':this['waiting']};var _0x77a135=md5(JSON['stringify'](_0x405183));if(this[_0xb2e4('0x1')]!==_0x77a135){this[_0xb2e4('0x1')]=_0x77a135;io['to'](util[_0xb2e4('0x18')]('fax:queue:%s',_0x405183[_0xb2e4('0x8')]))[_0xb2e4('0x19')](_0xb2e4('0x1a'),_0x405183);}};module[_0xb2e4('0x1b')]=FaxQueue;
\ No newline at end of file
index eb3830a..7146721 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd2d=['exports','name','Intervals'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0xcd2d,0xf7));var _0xdcd2=function(_0x5a6594,_0xefbdf5){_0x5a6594=_0x5a6594-0x0;var _0x1eddce=_0xcd2d[_0x5a6594];return _0x1eddce;};'use strict';function Interval(_0x4e4e19){this['id']=_0x4e4e19['id']||0x0;this[_0xdcd2('0x0')]=_0x4e4e19['name']||'';this['Intervals']=_0x4e4e19[_0xdcd2('0x1')]||{};}module[_0xdcd2('0x2')]=Interval;
\ No newline at end of file
+var _0x410c=['name','Intervals','exports'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x410c,0xc3));var _0xc410=function(_0x1cbd67,_0x58b7b0){_0x1cbd67=_0x1cbd67-0x0;var _0x221375=_0x410c[_0x1cbd67];return _0x221375;};'use strict';function Interval(_0x4a4c8f){this['id']=_0x4a4c8f['id']||0x0;this['name']=_0x4a4c8f[_0xc410('0x0')]||'';this[_0xc410('0x1')]=_0x4a4c8f[_0xc410('0x1')]||{};}module[_0xc410('0x2')]=Interval;
\ No newline at end of file
index fa0d7d0..313f2e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x367b=['updateRealtime','updateRouting','_rr','prototype','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x935478,_0x7f6768){var _0x3972d9=function(_0x176d5d){while(--_0x176d5d){_0x935478['push'](_0x935478['shift']());}};_0x3972d9(++_0x7f6768);}(_0x367b,0x128));var _0xb367=function(_0x57771b,_0x382386){_0x57771b=_0x57771b-0x0;var _0x3b4571=_0x367b[_0x57771b];return _0x3b4571;};'use strict';var _=require(_0xb367('0x0'));var md5=require(_0xb367('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xb367('0x2'));config[_0xb367('0x3')]=_['defaults'](config['redis'],{'host':_0xb367('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb367('0x3')]));function MailQueue(_0x34c890){this['id']=_0x34c890['id']||0x0;this[_0xb367('0x5')]=_0x34c890['name']||'';this[_0xb367('0x6')]=_0x34c890[_0xb367('0x6')]||0xa;this[_0xb367('0x7')]=_0x34c890[_0xb367('0x7')]||_0xb367('0x8');this[_0xb367('0x9')]=_0x34c890['Agents'];this[_0xb367('0xa')]={};this[_0xb367('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xb367('0xc')]();}MailQueue['prototype'][_0xb367('0xd')]=function(){var _0x36a2b7=this[_0xb367('0xa')][_0xb367('0xe')];this[_0xb367('0xa')]=_['map'](this[_0xb367('0x9')],'id');this[_0xb367('0xa')][_0xb367('0xe')]=_0x36a2b7;};MailQueue[_0xb367('0xf')]['updateRealtime']=function(){this[_0xb367('0x10')]=0x0;this[_0xb367('0x11')]=0x0;for(var _0x554dbf=0x0;_0x554dbf<this['Agents'][_0xb367('0x12')];_0x554dbf+=0x1){if(this['Agents'][_0x554dbf][_0xb367('0x13')]){this[_0xb367('0x10')]+=0x1;}if(this[_0xb367('0x9')][_0x554dbf][_0xb367('0x14')]){this[_0xb367('0x11')]+=0x1;}}this[_0xb367('0x15')]=this[_0xb367('0x10')]-this[_0xb367('0x11')];this[_0xb367('0x15')]=this[_0xb367('0x15')]>=0x0?this[_0xb367('0x15')]:0x0;var _0x5df47e={'id':this['id'],'available':this[_0xb367('0x15')],'loggedIn':this[_0xb367('0x10')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb367('0xb')]};var _0x3e8e55=md5(JSON[_0xb367('0x16')](_0x5df47e));if(this['md5']!==_0x3e8e55){this[_0xb367('0x1')]=_0x3e8e55;io['to'](util[_0xb367('0x17')](_0xb367('0x18'),_0x5df47e[_0xb367('0x5')]))[_0xb367('0x19')](_0xb367('0x1a'),_0x5df47e);}};module[_0xb367('0x1b')]=MailQueue;
\ No newline at end of file
+var _0xe26f=['mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','paused','length','online','available','loggedIn','stringify'];(function(_0xe1c059,_0x14c48a){var _0x2ff4c6=function(_0xa84df5){while(--_0xa84df5){_0xe1c059['push'](_0xe1c059['shift']());}};_0x2ff4c6(++_0x14c48a);}(_0xe26f,0x14e));var _0xfe26=function(_0x44558e,_0x254077){_0x44558e=_0x44558e-0x0;var _0x5d270b=_0xe26f[_0x44558e];return _0x5d270b;};'use strict';var _=require(_0xfe26('0x0'));var md5=require(_0xfe26('0x1'));var util=require(_0xfe26('0x2'));var Redis=require(_0xfe26('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xfe26('0x4')](config[_0xfe26('0x5')],{'host':_0xfe26('0x6'),'port':0x18eb});var io=require(_0xfe26('0x7'))(new Redis(config[_0xfe26('0x5')]));function MailQueue(_0x259f25){this['id']=_0x259f25['id']||0x0;this['name']=_0x259f25[_0xfe26('0x8')]||'';this[_0xfe26('0x9')]=_0x259f25['timeout']||0xa;this[_0xfe26('0xa')]=_0x259f25['strategy']||_0xfe26('0xb');this[_0xfe26('0xc')]=_0x259f25['Agents'];this[_0xfe26('0xd')]={};this[_0xfe26('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0xfe26('0xf')]();}MailQueue[_0xfe26('0x10')][_0xfe26('0x11')]=function(){var _0x32902f=this[_0xfe26('0xd')][_0xfe26('0x12')];this[_0xfe26('0xd')]=_[_0xfe26('0x13')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x32902f;};MailQueue['prototype'][_0xfe26('0xf')]=function(){this['loggedIn']=0x0;this[_0xfe26('0x14')]=0x0;for(var _0x4d4135=0x0;_0x4d4135<this[_0xfe26('0xc')][_0xfe26('0x15')];_0x4d4135+=0x1){if(this[_0xfe26('0xc')][_0x4d4135][_0xfe26('0x16')]){this['loggedIn']+=0x1;}if(this[_0xfe26('0xc')][_0x4d4135]['mailPause']){this[_0xfe26('0x14')]+=0x1;}}this[_0xfe26('0x17')]=this[_0xfe26('0x18')]-this[_0xfe26('0x14')];this[_0xfe26('0x17')]=this[_0xfe26('0x17')]>=0x0?this[_0xfe26('0x17')]:0x0;var _0x52ffc2={'id':this['id'],'available':this[_0xfe26('0x17')],'loggedIn':this[_0xfe26('0x18')],'name':this['name'],'paused':this[_0xfe26('0x14')],'waiting':this[_0xfe26('0xe')]};var _0x563a4e=md5(JSON[_0xfe26('0x19')](_0x52ffc2));if(this[_0xfe26('0x1')]!==_0x563a4e){this[_0xfe26('0x1')]=_0x563a4e;io['to'](util['format'](_0xfe26('0x1a'),_0x52ffc2['name']))[_0xfe26('0x1b')](_0xfe26('0x1c'),_0x52ffc2);}};module[_0xfe26('0x1d')]=MailQueue;
\ No newline at end of file
index 93f440d..27eecc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x326f,0xd1));var _0xf326=function(_0x4003e9,_0x23d01b){_0x4003e9=_0x4003e9-0x0;var _0x2243b6=_0x326f[_0x4003e9];return _0x2243b6;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483<this[_0xf326('0xf')]['length'];_0x5c8483+=0x1){if(this['Agents'][_0x5c8483][_0xf326('0x13')]){this[_0xf326('0x11')]+=0x1;}if(this[_0xf326('0xf')][_0x5c8483][_0xf326('0x14')]){this[_0xf326('0x12')]+=0x1;}}this[_0xf326('0x15')]=this[_0xf326('0x11')]-this[_0xf326('0x12')];this['available']=this[_0xf326('0x15')]>=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x55a51e,_0x4eedbd){var _0x496d0e=function(_0x1a815e){while(--_0x1a815e){_0x55a51e['push'](_0x55a51e['shift']());}};_0x496d0e(++_0x4eedbd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x101a17,_0x5d047a){_0x101a17=_0x101a17-0x0;var _0x3b76ee=_0x5fc3[_0x101a17];return _0x3b76ee;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index 89f8c62..e00584c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d8=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','stringify','sms_queue:save','lodash','util','../../../config/environment','defaults','socket.io-emitter','redis','name','timeout','strategy','beepall'];(function(_0x534a4b,_0x44c67a){var _0x311ed6=function(_0x48b06a){while(--_0x48b06a){_0x534a4b['push'](_0x534a4b['shift']());}};_0x311ed6(++_0x44c67a);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x5bdbfd,_0x3aaf24){_0x5bdbfd=_0x5bdbfd-0x0;var _0x5711c0=_0xc6d8[_0x5bdbfd];return _0x5711c0;};'use strict';var _=require(_0x8c6d('0x0'));var md5=require('md5');var util=require(_0x8c6d('0x1'));var Redis=require('ioredis');var config=require(_0x8c6d('0x2'));config['redis']=_[_0x8c6d('0x3')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x8c6d('0x4'))(new Redis(config[_0x8c6d('0x5')]));function SmsQueue(_0x17781d){this['id']=_0x17781d['id']||0x0;this[_0x8c6d('0x6')]=_0x17781d[_0x8c6d('0x6')]||'';this[_0x8c6d('0x7')]=_0x17781d[_0x8c6d('0x7')]||0xa;this['strategy']=_0x17781d[_0x8c6d('0x8')]||_0x8c6d('0x9');this[_0x8c6d('0xa')]=_0x17781d['Agents'];this[_0x8c6d('0xb')]={};this[_0x8c6d('0xc')]=0x0;this[_0x8c6d('0xd')]='';this[_0x8c6d('0xe')]();this[_0x8c6d('0xf')]();}SmsQueue[_0x8c6d('0x10')][_0x8c6d('0xe')]=function(){var _0x392a6b=this['mapAgentsId'][_0x8c6d('0x11')];this['mapAgentsId']=_['map'](this[_0x8c6d('0xa')],'id');this[_0x8c6d('0xb')][_0x8c6d('0x11')]=_0x392a6b;};SmsQueue[_0x8c6d('0x10')][_0x8c6d('0xf')]=function(){this[_0x8c6d('0x12')]=0x0;this[_0x8c6d('0x13')]=0x0;for(var _0x103699=0x0;_0x103699<this[_0x8c6d('0xa')][_0x8c6d('0x14')];_0x103699+=0x1){if(this['Agents'][_0x103699][_0x8c6d('0x15')]){this['loggedIn']+=0x1;}if(this[_0x8c6d('0xa')][_0x103699]['smsPause']){this[_0x8c6d('0x13')]+=0x1;}}this[_0x8c6d('0x16')]=this['loggedIn']-this[_0x8c6d('0x13')];this[_0x8c6d('0x16')]=this['available']>=0x0?this[_0x8c6d('0x16')]:0x0;var _0x5a22de={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8c6d('0x12')],'name':this['name'],'paused':this[_0x8c6d('0x13')],'waiting':this[_0x8c6d('0xc')]};var _0x1d0f0a=md5(JSON[_0x8c6d('0x17')](_0x5a22de));if(this[_0x8c6d('0xd')]!==_0x1d0f0a){this['md5']=_0x1d0f0a;io['to'](util['format']('sms:queue:%s',_0x5a22de[_0x8c6d('0x6')]))['emit'](_0x8c6d('0x18'),_0x5a22de);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0x6953=['name','timeout','strategy','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','redis','localhost','socket.io-emitter'];(function(_0x4ee557,_0xcf8050){var _0x1e377f=function(_0x4a455f){while(--_0x4a455f){_0x4ee557['push'](_0x4ee557['shift']());}};_0x1e377f(++_0xcf8050);}(_0x6953,0x91));var _0x3695=function(_0x1ab181,_0x43ee89){_0x1ab181=_0x1ab181-0x0;var _0x1fd4a9=_0x6953[_0x1ab181];return _0x1fd4a9;};'use strict';var _=require(_0x3695('0x0'));var md5=require(_0x3695('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3695('0x2')]=_['defaults'](config[_0x3695('0x2')],{'host':_0x3695('0x3'),'port':0x18eb});var io=require(_0x3695('0x4'))(new Redis(config['redis']));function SmsQueue(_0xd0f9a5){this['id']=_0xd0f9a5['id']||0x0;this['name']=_0xd0f9a5[_0x3695('0x5')]||'';this[_0x3695('0x6')]=_0xd0f9a5[_0x3695('0x6')]||0xa;this[_0x3695('0x7')]=_0xd0f9a5[_0x3695('0x7')]||'beepall';this[_0x3695('0x8')]=_0xd0f9a5['Agents'];this[_0x3695('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0x3695('0xa')]();this['updateRealtime']();}SmsQueue[_0x3695('0xb')][_0x3695('0xa')]=function(){var _0x2a7ab7=this[_0x3695('0x9')][_0x3695('0xc')];this[_0x3695('0x9')]=_['map'](this[_0x3695('0x8')],'id');this[_0x3695('0x9')][_0x3695('0xc')]=_0x2a7ab7;};SmsQueue[_0x3695('0xb')][_0x3695('0xd')]=function(){this[_0x3695('0xe')]=0x0;this[_0x3695('0xf')]=0x0;for(var _0x4df429=0x0;_0x4df429<this[_0x3695('0x8')][_0x3695('0x10')];_0x4df429+=0x1){if(this[_0x3695('0x8')][_0x4df429]['online']){this[_0x3695('0xe')]+=0x1;}if(this[_0x3695('0x8')][_0x4df429][_0x3695('0x11')]){this[_0x3695('0xf')]+=0x1;}}this[_0x3695('0x12')]=this[_0x3695('0xe')]-this[_0x3695('0xf')];this['available']=this[_0x3695('0x12')]>=0x0?this['available']:0x0;var _0x1082db={'id':this['id'],'available':this[_0x3695('0x12')],'loggedIn':this[_0x3695('0xe')],'name':this[_0x3695('0x5')],'paused':this[_0x3695('0xf')],'waiting':this['waiting']};var _0x1bb921=md5(JSON[_0x3695('0x13')](_0x1082db));if(this[_0x3695('0x1')]!==_0x1bb921){this[_0x3695('0x1')]=_0x1bb921;io['to'](util[_0x3695('0x14')](_0x3695('0x15'),_0x1082db[_0x3695('0x5')]))[_0x3695('0x16')](_0x3695('0x17'),_0x1082db);}};module[_0x3695('0x18')]=SmsQueue;
\ No newline at end of file
index 2fe8ae7..4215488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9198=['whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','whatsappPause','available','format','whatsapp:queue:%s','emit'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0x9198,0xfa));var _0x8919=function(_0x5f60a6,_0x966173){_0x5f60a6=_0x5f60a6-0x0;var _0x3e1227=_0x9198[_0x5f60a6];return _0x3e1227;};'use strict';var _=require(_0x8919('0x0'));var md5=require(_0x8919('0x1'));var util=require(_0x8919('0x2'));var Redis=require(_0x8919('0x3'));var config=require(_0x8919('0x4'));config['redis']=_[_0x8919('0x5')](config['redis'],{'host':_0x8919('0x6'),'port':0x18eb});var io=require(_0x8919('0x7'))(new Redis(config[_0x8919('0x8')]));function WhatsappQueue(_0x169d79){this['id']=_0x169d79['id']||0x0;this['name']=_0x169d79[_0x8919('0x9')]||'';this['timeout']=_0x169d79[_0x8919('0xa')]||0xa;this['strategy']=_0x169d79[_0x8919('0xb')]||_0x8919('0xc');this[_0x8919('0xd')]=_0x169d79[_0x8919('0xd')];this[_0x8919('0xe')]={};this[_0x8919('0xf')]=0x0;this[_0x8919('0x1')]='';this['updateRouting']();this[_0x8919('0x10')]();}WhatsappQueue[_0x8919('0x11')][_0x8919('0x12')]=function(){var _0x2984a6=this[_0x8919('0xe')][_0x8919('0x13')];this['mapAgentsId']=_[_0x8919('0x14')](this[_0x8919('0xd')],'id');this[_0x8919('0xe')][_0x8919('0x13')]=_0x2984a6;};WhatsappQueue[_0x8919('0x11')]['updateRealtime']=function(){this[_0x8919('0x15')]=0x0;this[_0x8919('0x16')]=0x0;for(var _0x531ac4=0x0;_0x531ac4<this[_0x8919('0xd')][_0x8919('0x17')];_0x531ac4+=0x1){if(this['Agents'][_0x531ac4]['online']){this['loggedIn']+=0x1;}if(this[_0x8919('0xd')][_0x531ac4][_0x8919('0x18')]){this[_0x8919('0x16')]+=0x1;}}this[_0x8919('0x19')]=this[_0x8919('0x15')]-this[_0x8919('0x16')];this[_0x8919('0x19')]=this[_0x8919('0x19')]>=0x0?this[_0x8919('0x19')]:0x0;var _0x533607={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8919('0x15')],'name':this[_0x8919('0x9')],'paused':this[_0x8919('0x16')],'waiting':this['waiting']};var _0x40a521=md5(JSON['stringify'](_0x533607));if(this[_0x8919('0x1')]!==_0x40a521){this[_0x8919('0x1')]=_0x40a521;io['to'](util[_0x8919('0x1a')](_0x8919('0x1b'),_0x533607[_0x8919('0x9')]))[_0x8919('0x1c')](_0x8919('0x1d'),_0x533607);}};module[_0x8919('0x1e')]=WhatsappQueue;
\ No newline at end of file
+var _0x6d80=['loggedIn','length','online','whatsappPause','paused','available','stringify','format','whatsapp:queue:%s','emit','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','_rr','prototype'];(function(_0x28052b,_0x296e56){var _0x124155=function(_0xaa457a){while(--_0xaa457a){_0x28052b['push'](_0x28052b['shift']());}};_0x124155(++_0x296e56);}(_0x6d80,0x72));var _0x06d8=function(_0x2b7064,_0x4a1801){_0x2b7064=_0x2b7064-0x0;var _0x5258ca=_0x6d80[_0x2b7064];return _0x5258ca;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x06d8('0x0'));var Redis=require(_0x06d8('0x1'));var config=require(_0x06d8('0x2'));config[_0x06d8('0x3')]=_['defaults'](config['redis'],{'host':_0x06d8('0x4'),'port':0x18eb});var io=require(_0x06d8('0x5'))(new Redis(config[_0x06d8('0x3')]));function WhatsappQueue(_0x14b9d1){this['id']=_0x14b9d1['id']||0x0;this[_0x06d8('0x6')]=_0x14b9d1[_0x06d8('0x6')]||'';this[_0x06d8('0x7')]=_0x14b9d1[_0x06d8('0x7')]||0xa;this['strategy']=_0x14b9d1[_0x06d8('0x8')]||'beepall';this['Agents']=_0x14b9d1[_0x06d8('0x9')];this[_0x06d8('0xa')]={};this['waiting']=0x0;this[_0x06d8('0xb')]='';this[_0x06d8('0xc')]();this[_0x06d8('0xd')]();}WhatsappQueue['prototype'][_0x06d8('0xc')]=function(){var _0x54d339=this[_0x06d8('0xa')][_0x06d8('0xe')];this[_0x06d8('0xa')]=_['map'](this[_0x06d8('0x9')],'id');this[_0x06d8('0xa')][_0x06d8('0xe')]=_0x54d339;};WhatsappQueue[_0x06d8('0xf')][_0x06d8('0xd')]=function(){this[_0x06d8('0x10')]=0x0;this['paused']=0x0;for(var _0x467359=0x0;_0x467359<this[_0x06d8('0x9')][_0x06d8('0x11')];_0x467359+=0x1){if(this[_0x06d8('0x9')][_0x467359][_0x06d8('0x12')]){this[_0x06d8('0x10')]+=0x1;}if(this[_0x06d8('0x9')][_0x467359][_0x06d8('0x13')]){this[_0x06d8('0x14')]+=0x1;}}this[_0x06d8('0x15')]=this[_0x06d8('0x10')]-this[_0x06d8('0x14')];this['available']=this[_0x06d8('0x15')]>=0x0?this[_0x06d8('0x15')]:0x0;var _0x1409a7={'id':this['id'],'available':this[_0x06d8('0x15')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x06d8('0x14')],'waiting':this['waiting']};var _0x34081b=md5(JSON[_0x06d8('0x16')](_0x1409a7));if(this[_0x06d8('0xb')]!==_0x34081b){this[_0x06d8('0xb')]=_0x34081b;io['to'](util[_0x06d8('0x17')](_0x06d8('0x18'),_0x1409a7[_0x06d8('0x6')]))[_0x06d8('0x19')]('whatsapp_queue:save',_0x1409a7);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index 3170f82..fb5f57d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3c832a,_0x3fd924){var _0x780451=function(_0x3ae4d6){while(--_0x3ae4d6){_0x3c832a['push'](_0x3c832a['shift']());}};_0x780451(++_0x3fd924);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d2aea,_0x4a8f11){_0x4d2aea=_0x4d2aea-0x0;var _0x1715b8=_0xb10b[_0x4d2aea];return _0x1715b8;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index a892ebb..58daae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x996f=['addTagsToChatInteraction','../client','update','Request','updateChatInteraction','addTags'];(function(_0xdf52ab,_0x558085){var _0x2399be=function(_0x4d4932){while(--_0x4d4932){_0xdf52ab['push'](_0xdf52ab['shift']());}};_0x2399be(++_0x558085);}(_0x996f,0x97));var _0xf996=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x996f[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0xf996('0x0'));exports[_0xf996('0x1')]=function(_0xc448a8,_0x5d5f14){return client[_0xf996('0x2')]('UpdateChatInteraction',{'body':_0x5d5f14,'options':{'where':{'id':_0xc448a8}},'log':_0xf996('0x3')});};exports[_0xf996('0x4')]=function(_0x53035e,_0x14e50c){return client['Request']('AddTagsToChatInteraction',{'body':_0x14e50c,'options':{'where':{'id':_0x53035e}},'log':_0xf996('0x5')});};
\ No newline at end of file
+var _0x8188=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client'];(function(_0x58945b,_0x1dfcf5){var _0x13ddac=function(_0x471444){while(--_0x471444){_0x58945b['push'](_0x58945b['shift']());}};_0x13ddac(++_0x1dfcf5);}(_0x8188,0x18e));var _0x8818=function(_0x16f9f6,_0x300c07){_0x16f9f6=_0x16f9f6-0x0;var _0x24f2ff=_0x8188[_0x16f9f6];return _0x24f2ff;};'use strict';var client=require(_0x8818('0x0'));exports[_0x8818('0x1')]=function(_0x20db80,_0x25bb7b){return client[_0x8818('0x2')](_0x8818('0x3'),{'body':_0x25bb7b,'options':{'where':{'id':_0x20db80}},'log':_0x8818('0x4')});};exports[_0x8818('0x5')]=function(_0x5b13a6,_0x4765bc){return client[_0x8818('0x2')](_0x8818('0x6'),{'body':_0x4765bc,'options':{'where':{'id':_0x5b13a6}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index db6cc63..ed6abc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd03f=['CreateChatMessage','createChatMessage','../client','Request'];(function(_0x266e80,_0xc5183a){var _0x26cbaa=function(_0x59c43a){while(--_0x59c43a){_0x266e80['push'](_0x266e80['shift']());}};_0x26cbaa(++_0xc5183a);}(_0xd03f,0x1f2));var _0xfd03=function(_0x12bcac,_0x246c45){_0x12bcac=_0x12bcac-0x0;var _0x5ab2e0=_0xd03f[_0x12bcac];return _0x5ab2e0;};'use strict';var client=require(_0xfd03('0x0'));exports['create']=function(_0x5d08eb){return client[_0xfd03('0x1')](_0xfd03('0x2'),{'body':_0x5d08eb,'log':_0xfd03('0x3')});};
\ No newline at end of file
+'use strict';var client=require('../client');exports['create']=function(_0x3e5057){return client['Request']('CreateChatMessage',{'body':_0x3e5057,'log':'createChatMessage'});};
\ No newline at end of file
index f90edc5..6a0690c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d8=['chatPause','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x148629,_0x512b37){var _0x1f9858=function(_0x3fb49e){while(--_0x3fb49e){_0x148629['push'](_0x148629['shift']());}};_0x1f9858(++_0x512b37);}(_0x16d8,0xa3));var _0x816d=function(_0x4398da,_0xfe0269){_0x4398da=_0x4398da-0x0;var _0x1e6a6c=_0x16d8[_0x4398da];return _0x1e6a6c;};'use strict';var client=require('../client');exports[_0x816d('0x0')]=function(){return function(){return client[_0x816d('0x1')](_0x816d('0x2'),{'options':{'raw':![],'attributes':['id',_0x816d('0x3'),_0x816d('0x4'),_0x816d('0x5')],'include':[{'model':_0x816d('0x6'),'as':_0x816d('0x7'),'attributes':['id',_0x816d('0x3'),'online',_0x816d('0x8')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0x1354=['name','timeout','strategy','Agents','online','../client','getChatQueues','Request','GetChatQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1354,0x95));var _0x4135=function(_0x39d6a8,_0xc9c91a){_0x39d6a8=_0x39d6a8-0x0;var _0x93f3db=_0x1354[_0x39d6a8];return _0x93f3db;};'use strict';var client=require(_0x4135('0x0'));exports[_0x4135('0x1')]=function(){return function(){return client[_0x4135('0x2')](_0x4135('0x3'),{'options':{'raw':![],'attributes':['id',_0x4135('0x4'),_0x4135('0x5'),_0x4135('0x6')],'include':[{'model':'User','as':_0x4135('0x7'),'attributes':['id',_0x4135('0x4'),_0x4135('0x8'),'chatPause']}]},'log':_0x4135('0x1')});};};
\ No newline at end of file
index c708710..ad83c6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43f3=['UpdateChatQueueReport','create','CreateChatQueueReport','update','Request'];(function(_0x2c219a,_0x113ab1){var _0x54c0be=function(_0xb160c8){while(--_0xb160c8){_0x2c219a['push'](_0x2c219a['shift']());}};_0x54c0be(++_0x113ab1);}(_0x43f3,0xab));var _0x343f=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x43f3[_0x3c8e9a];return _0x2d4c57;};'use strict';var client=require('../client');exports[_0x343f('0x0')]=function(_0x177f01){return client['Request'](_0x343f('0x1'),{'body':_0x177f01,'log':'CreateChatQueueReport'});};exports[_0x343f('0x2')]=function(_0x48008f,_0x3339a9){return client[_0x343f('0x3')](_0x343f('0x4'),{'body':_0x3339a9,'options':{'where':{'uniqueid':_0x48008f},'order':[['id','DESC']],'limit':0x1},'log':_0x343f('0x4')});};
\ No newline at end of file
+var _0xc576=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x380af2,_0x36cf66){var _0x1789dc=function(_0x37b604){while(--_0x37b604){_0x380af2['push'](_0x380af2['shift']());}};_0x1789dc(++_0x36cf66);}(_0xc576,0x1ea));var _0x6c57=function(_0x19d0b6,_0x85209a){_0x19d0b6=_0x19d0b6-0x0;var _0x16060b=_0xc576[_0x19d0b6];return _0x16060b;};'use strict';var client=require(_0x6c57('0x0'));exports[_0x6c57('0x1')]=function(_0x8a70a3){return client[_0x6c57('0x2')](_0x6c57('0x3'),{'body':_0x8a70a3,'log':'CreateChatQueueReport'});};exports['update']=function(_0x10a252,_0x4e5df7){return client[_0x6c57('0x2')](_0x6c57('0x4'),{'body':_0x4e5df7,'options':{'where':{'uniqueid':_0x10a252},'order':[['id','DESC']],'limit':0x1},'log':_0x6c57('0x4')});};
\ No newline at end of file
index 87068f9..8996c6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xc753c8,_0x5627ff){var _0xd02f5c=function(_0xfb552e){while(--_0xfb552e){_0xc753c8['push'](_0xc753c8['shift']());}};_0xd02f5c(++_0x5627ff);}(_0x7a54,0x106));var _0x47a5=function(_0x52dd6a,_0x1eaa06){_0x52dd6a=_0x52dd6a-0x0;var _0x3023e7=_0x7a54[_0x52dd6a];return _0x3023e7;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0x4bc233,_0x5e94f2){_0x4bc233=_0x4bc233-0x0;var _0xafb2c8=_0x7a54[_0x4bc233];return _0xafb2c8;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
index 387e20f..7d4dec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe98a=['../client','createFaxMessage'];(function(_0x192e16,_0x4280b1){var _0x335f79=function(_0x4b5028){while(--_0x4b5028){_0x192e16['push'](_0x192e16['shift']());}};_0x335f79(++_0x4280b1);}(_0xe98a,0x106));var _0xae98=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0xe98a[_0x213518];return _0x1baf75;};'use strict';var client=require(_0xae98('0x0'));exports['create']=function(_0xc7680e){return client['Request']('CreateFaxMessage',{'body':_0xc7680e,'log':_0xae98('0x1')});};
\ No newline at end of file
+var _0xda9c=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xda9c,0xfc));var _0xcda9=function(_0x5278ed,_0x75b0c){_0x5278ed=_0x5278ed-0x0;var _0x160945=_0xda9c[_0x5278ed];return _0x160945;};'use strict';var client=require(_0xcda9('0x0'));exports['create']=function(_0x439048){return client[_0xcda9('0x1')](_0xcda9('0x2'),{'body':_0x439048,'log':_0xcda9('0x3')});};
\ No newline at end of file
index 67eddb6..9e95189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecd7=['strategy','Agents','faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout'];(function(_0x38924a,_0x5923c6){var _0x2c85db=function(_0xe7ce60){while(--_0xe7ce60){_0x38924a['push'](_0x38924a['shift']());}};_0x2c85db(++_0x5923c6);}(_0xecd7,0xf3));var _0x7ecd=function(_0x323e11,_0x3d9a92){_0x323e11=_0x323e11-0x0;var _0x4e27ca=_0xecd7[_0x323e11];return _0x4e27ca;};'use strict';var client=require(_0x7ecd('0x0'));exports[_0x7ecd('0x1')]=function(){return function(){return client[_0x7ecd('0x2')](_0x7ecd('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7ecd('0x4'),_0x7ecd('0x5')],'include':[{'model':'User','as':_0x7ecd('0x6'),'attributes':['id','name','online',_0x7ecd('0x7')]}]},'log':_0x7ecd('0x1')});};};
\ No newline at end of file
+var _0x80eb=['Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause','getFaxQueues','../client'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x80eb,0x10d));var _0xb80e=function(_0x5f8e8b,_0x1f9f15){_0x5f8e8b=_0x5f8e8b-0x0;var _0x1c4a04=_0x80eb[_0x5f8e8b];return _0x1c4a04;};'use strict';var client=require(_0xb80e('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xb80e('0x1')](_0xb80e('0x2'),{'options':{'raw':![],'attributes':['id',_0xb80e('0x3'),'timeout',_0xb80e('0x4')],'include':[{'model':_0xb80e('0x5'),'as':_0xb80e('0x6'),'attributes':['id',_0xb80e('0x3'),_0xb80e('0x7'),_0xb80e('0x8')]}]},'log':_0xb80e('0x9')});};};
\ No newline at end of file
index 475dc2b..94316ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27b9=['create','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x4db668,_0x2c146a){var _0x3420e1=function(_0x48b218){while(--_0x48b218){_0x4db668['push'](_0x4db668['shift']());}};_0x3420e1(++_0x2c146a);}(_0x27b9,0x1b5));var _0x927b=function(_0xf55c2c,_0xc63455){_0xf55c2c=_0xf55c2c-0x0;var _0x5c4c58=_0x27b9[_0xf55c2c];return _0x5c4c58;};'use strict';var client=require(_0x927b('0x0'));exports[_0x927b('0x1')]=function(_0x2043df){return client[_0x927b('0x2')](_0x927b('0x3'),{'body':_0x2043df,'log':_0x927b('0x3')});};exports[_0x927b('0x4')]=function(_0x3068db,_0x3006a9){return client[_0x927b('0x2')](_0x927b('0x5'),{'body':_0x3006a9,'options':{'where':{'uniqueid':_0x3068db},'order':[['id','DESC']],'limit':0x1},'log':_0x927b('0x5')});};
\ No newline at end of file
+var _0xfb10=['Request','CreateFaxQueueReport','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x44b219,_0x51b2d0){var _0x182ae8=function(_0x19d3b4){while(--_0x19d3b4){_0x44b219['push'](_0x44b219['shift']());}};_0x182ae8(++_0x51b2d0);}(_0xfb10,0x13c));var _0x0fb1=function(_0x2cf6ed,_0x590955){_0x2cf6ed=_0x2cf6ed-0x0;var _0xc05f1f=_0xfb10[_0x2cf6ed];return _0xc05f1f;};'use strict';var client=require(_0x0fb1('0x0'));exports[_0x0fb1('0x1')]=function(_0x5e25b0){return client[_0x0fb1('0x2')](_0x0fb1('0x3'),{'body':_0x5e25b0,'log':_0x0fb1('0x3')});};exports['update']=function(_0x3bac16,_0x1e2f33){return client[_0x0fb1('0x2')]('UpdateFaxQueueReport',{'body':_0x1e2f33,'options':{'where':{'uniqueid':_0x3bac16},'order':[['id',_0x0fb1('0x4')]],'limit':0x1},'log':_0x0fb1('0x5')});};
\ No newline at end of file
index adfe7c8..a1ed6ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6aa0=['getIntervals','Request','GetInterval','Interval','name','interval','../client'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x6aa0,0x1bf));var _0x06aa=function(_0xc8db6b,_0x320abd){_0xc8db6b=_0xc8db6b-0x0;var _0x12cb81=_0x6aa0[_0xc8db6b];return _0x12cb81;};'use strict';var client=require(_0x06aa('0x0'));exports[_0x06aa('0x1')]=function(){return function(){return client[_0x06aa('0x2')](_0x06aa('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x06aa('0x4'),'as':'Intervals','attributes':['id',_0x06aa('0x5'),_0x06aa('0x6')]}]},'log':_0x06aa('0x1')});};};
\ No newline at end of file
+var _0x6cb1=['GetInterval','name','Interval','interval','getIntervals','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cb1,0x154));var _0x16cb=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6cb1[_0x3947c9];return _0x2e7871;};'use strict';var client=require('../client');exports[_0x16cb('0x0')]=function(){return function(){return client[_0x16cb('0x1')](_0x16cb('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x16cb('0x3')],'include':[{'model':_0x16cb('0x4'),'as':'Intervals','attributes':['id','name',_0x16cb('0x5')]}]},'log':_0x16cb('0x0')});};};
\ No newline at end of file
index 1a9173b..b44cb1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x5d997d,_0x4e3d5b){var _0x37dda1=function(_0x48eee5){while(--_0x48eee5){_0x5d997d['push'](_0x5d997d['shift']());}};_0x37dda1(++_0x4e3d5b);}(_0xdb28,0x106));var _0x8db2=function(_0xba4859,_0x5bad78){_0xba4859=_0xba4859-0x0;var _0x14a59a=_0xdb28[_0xba4859];return _0x14a59a;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});};
\ No newline at end of file
+var _0x4137=['updateMailInteraction','addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var client=require(_0x7413('0x0'));exports[_0x7413('0x1')]=function(_0x370399,_0x4f372c){return client[_0x7413('0x2')](_0x7413('0x3'),{'body':_0x4f372c,'options':{'where':{'id':_0x370399}},'log':_0x7413('0x4')});};exports[_0x7413('0x5')]=function(_0x258255,_0x3dc48a){return client[_0x7413('0x2')](_0x7413('0x6'),{'body':_0x3dc48a,'options':{'where':{'id':_0x258255}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index f6f3081..d5cff76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bdf=['create','Request','CreateMailMessage','../client'];(function(_0x447d69,_0x58c94e){var _0x194f34=function(_0x994c18){while(--_0x994c18){_0x447d69['push'](_0x447d69['shift']());}};_0x194f34(++_0x58c94e);}(_0x0bdf,0x153));var _0xf0bd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0bdf[_0x21a9d9];return _0x46adce;};'use strict';var client=require(_0xf0bd('0x0'));exports[_0xf0bd('0x1')]=function(_0x2a3135){return client[_0xf0bd('0x2')](_0xf0bd('0x3'),{'body':_0x2a3135,'log':'createMailMessage'});};
\ No newline at end of file
+var _0xa029=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x4e03ca,_0x2149f9){var _0x39cd8a=function(_0x4760e7){while(--_0x4760e7){_0x4e03ca['push'](_0x4e03ca['shift']());}};_0x39cd8a(++_0x2149f9);}(_0xa029,0x1b7));var _0x9a02=function(_0xee566,_0x15f0d8){_0xee566=_0xee566-0x0;var _0x4176e4=_0xa029[_0xee566];return _0x4176e4;};'use strict';var client=require(_0x9a02('0x0'));exports[_0x9a02('0x1')]=function(_0x1add67){return client[_0x9a02('0x2')](_0x9a02('0x3'),{'body':_0x1add67,'log':_0x9a02('0x4')});};
\ No newline at end of file
index 49f2b39..a818ce1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7434=['getMailQueues','Request','GetMailQueue','name','timeout','User','Agents','online','mailPause','../client'];(function(_0x37feae,_0x540cfc){var _0x5be5db=function(_0x3e9ffe){while(--_0x3e9ffe){_0x37feae['push'](_0x37feae['shift']());}};_0x5be5db(++_0x540cfc);}(_0x7434,0x15d));var _0x4743=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7434[_0x40a045];return _0x1a687c;};'use strict';var client=require(_0x4743('0x0'));exports[_0x4743('0x1')]=function(){return function(){return client[_0x4743('0x2')](_0x4743('0x3'),{'options':{'raw':![],'attributes':['id',_0x4743('0x4'),_0x4743('0x5'),'strategy'],'include':[{'model':_0x4743('0x6'),'as':_0x4743('0x7'),'attributes':['id',_0x4743('0x4'),_0x4743('0x8'),_0x4743('0x9')]}]},'log':_0x4743('0x1')});};};
\ No newline at end of file
+var _0x4818=['../client','getMailQueues','Request','name','timeout','strategy','online','mailPause'];(function(_0x2644cd,_0x3e1e34){var _0x521b23=function(_0x127413){while(--_0x127413){_0x2644cd['push'](_0x2644cd['shift']());}};_0x521b23(++_0x3e1e34);}(_0x4818,0x158));var _0x8481=function(_0x5cb7ac,_0x368be8){_0x5cb7ac=_0x5cb7ac-0x0;var _0x8cfc1b=_0x4818[_0x5cb7ac];return _0x8cfc1b;};'use strict';var client=require(_0x8481('0x0'));exports[_0x8481('0x1')]=function(){return function(){return client[_0x8481('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x8481('0x3'),_0x8481('0x4'),_0x8481('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x8481('0x3'),_0x8481('0x6'),_0x8481('0x7')]}]},'log':_0x8481('0x1')});};};
\ No newline at end of file
index fc5263f..1549650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c65=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x7c65,0x15c));var _0x57c6=function(_0x4ff8d9,_0x22762b){_0x4ff8d9=_0x4ff8d9-0x0;var _0x290486=_0x7c65[_0x4ff8d9];return _0x290486;};'use strict';var client=require(_0x57c6('0x0'));exports[_0x57c6('0x1')]=function(_0xe1e147){return client[_0x57c6('0x2')](_0x57c6('0x3'),{'body':_0xe1e147,'log':'CreateMailQueueReport'});};exports[_0x57c6('0x4')]=function(_0xcd112d,_0x44e5e8){return client[_0x57c6('0x2')](_0x57c6('0x5'),{'body':_0x44e5e8,'options':{'where':{'uniqueid':_0xcd112d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
+var _0x7a74=['UpdateMailQueueReport','DESC','../client','Request','CreateMailQueueReport','update'];(function(_0x585ee5,_0x1c9dba){var _0x470808=function(_0x35c90d){while(--_0x35c90d){_0x585ee5['push'](_0x585ee5['shift']());}};_0x470808(++_0x1c9dba);}(_0x7a74,0x110));var _0x47a7=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x7a74[_0x4d8ed9];return _0x1e2140;};'use strict';var client=require(_0x47a7('0x0'));exports['create']=function(_0x4a6c2a){return client[_0x47a7('0x1')](_0x47a7('0x2'),{'body':_0x4a6c2a,'log':_0x47a7('0x2')});};exports[_0x47a7('0x3')]=function(_0x387b5f,_0x45d390){return client[_0x47a7('0x1')](_0x47a7('0x4'),{'body':_0x45d390,'options':{'where':{'uniqueid':_0x387b5f},'order':[['id',_0x47a7('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index 4717fef..ee9a2e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9086=['Request','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update'];(function(_0x41812a,_0x3a3ebb){var _0x218597=function(_0x24d6f1){while(--_0x24d6f1){_0x41812a['push'](_0x41812a['shift']());}};_0x218597(++_0x3a3ebb);}(_0x9086,0x72));var _0x6908=function(_0x4db190,_0x572393){_0x4db190=_0x4db190-0x0;var _0x1e579a=_0x9086[_0x4db190];return _0x1e579a;};'use strict';var client=require('../client');exports[_0x6908('0x0')]=function(_0x48ab51,_0x79e93){return client[_0x6908('0x1')]('UpdateOpenchannelInteraction',{'body':_0x79e93,'options':{'where':{'id':_0x48ab51}},'log':_0x6908('0x2')});};exports['addTags']=function(_0x1a99ae,_0x26c037){return client[_0x6908('0x1')](_0x6908('0x3'),{'body':_0x26c037,'options':{'where':{'id':_0x1a99ae}},'log':_0x6908('0x4')});};
\ No newline at end of file
+var _0x9219=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','AddTagsToOpenchannelInteraction'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x9219,0xdf));var _0x9921=function(_0x1e346a,_0x2fa16e){_0x1e346a=_0x1e346a-0x0;var _0x59ace9=_0x9219[_0x1e346a];return _0x59ace9;};'use strict';var client=require('../client');exports[_0x9921('0x0')]=function(_0x52f3dc,_0x58f8af){return client[_0x9921('0x1')](_0x9921('0x2'),{'body':_0x58f8af,'options':{'where':{'id':_0x52f3dc}},'log':_0x9921('0x3')});};exports['addTags']=function(_0x553dad,_0x13d378){return client[_0x9921('0x1')](_0x9921('0x4'),{'body':_0x13d378,'options':{'where':{'id':_0x553dad}},'log':_0x9921('0x5')});};
\ No newline at end of file
index 9f41384..ebceacd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68a2=['Request','../client'];(function(_0x1dbaf7,_0x3d05b3){var _0x593f05=function(_0x381936){while(--_0x381936){_0x1dbaf7['push'](_0x1dbaf7['shift']());}};_0x593f05(++_0x3d05b3);}(_0x68a2,0x15d));var _0x268a=function(_0x568363,_0x2e79a7){_0x568363=_0x568363-0x0;var _0x47f0ed=_0x68a2[_0x568363];return _0x47f0ed;};'use strict';var client=require(_0x268a('0x0'));exports['create']=function(_0x229cb5){return client[_0x268a('0x1')]('CreateOpenchannelMessage',{'body':_0x229cb5,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0xf240=['create','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x1b7631,_0x200191){var _0x5eb6ea=function(_0x28f282){while(--_0x28f282){_0x1b7631['push'](_0x1b7631['shift']());}};_0x5eb6ea(++_0x200191);}(_0xf240,0x107));var _0x0f24=function(_0x2fb3af,_0x560f89){_0x2fb3af=_0x2fb3af-0x0;var _0x5597ce=_0xf240[_0x2fb3af];return _0x5597ce;};'use strict';var client=require(_0x0f24('0x0'));exports[_0x0f24('0x1')]=function(_0x6b5e13){return client['Request'](_0x0f24('0x2'),{'body':_0x6b5e13,'log':_0x0f24('0x3')});};
\ No newline at end of file
index 7859002..aa08068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbac7=['Request','GetOpenchannelQueue','name','strategy','User','Agents','online','../client','getOpenchannelQueues'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbac7,0x1ae));var _0x7bac=function(_0x3aafec,_0x3f8e8a){_0x3aafec=_0x3aafec-0x0;var _0x250266=_0xbac7[_0x3aafec];return _0x250266;};'use strict';var client=require(_0x7bac('0x0'));exports[_0x7bac('0x1')]=function(){return function(){return client[_0x7bac('0x2')](_0x7bac('0x3'),{'options':{'raw':![],'attributes':['id',_0x7bac('0x4'),'timeout',_0x7bac('0x5')],'include':[{'model':_0x7bac('0x6'),'as':_0x7bac('0x7'),'attributes':['id',_0x7bac('0x4'),_0x7bac('0x8'),'openchannelPause']}]},'log':_0x7bac('0x1')});};};
\ No newline at end of file
+var _0x7220=['name','timeout','User','online','../client','Request','GetOpenchannelQueue'];(function(_0x394f3b,_0x49bfdd){var _0x5085c3=function(_0xf8e3cc){while(--_0xf8e3cc){_0x394f3b['push'](_0x394f3b['shift']());}};_0x5085c3(++_0x49bfdd);}(_0x7220,0x14d));var _0x0722=function(_0x488a7e,_0x1b1694){_0x488a7e=_0x488a7e-0x0;var _0x20fd80=_0x7220[_0x488a7e];return _0x20fd80;};'use strict';var client=require(_0x0722('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0x0722('0x1')](_0x0722('0x2'),{'options':{'raw':![],'attributes':['id',_0x0722('0x3'),_0x0722('0x4'),'strategy'],'include':[{'model':_0x0722('0x5'),'as':'Agents','attributes':['id',_0x0722('0x3'),_0x0722('0x6'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};};
\ No newline at end of file
index 34a106e..c002dbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae9=['UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x1254fb,_0x227094){var _0x3055d0=function(_0x4a0b0){while(--_0x4a0b0){_0x1254fb['push'](_0x1254fb['shift']());}};_0x3055d0(++_0x227094);}(_0xdae9,0x15e));var _0x9dae=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xdae9[_0x373dee];return _0x46798f;};'use strict';var client=require('../client');exports[_0x9dae('0x0')]=function(_0x59890e){return client[_0x9dae('0x1')](_0x9dae('0x2'),{'body':_0x59890e,'log':_0x9dae('0x2')});};exports[_0x9dae('0x3')]=function(_0x38403b,_0x2261ba){return client[_0x9dae('0x1')](_0x9dae('0x4'),{'body':_0x2261ba,'options':{'where':{'uniqueid':_0x38403b},'order':[['id',_0x9dae('0x5')]],'limit':0x1},'log':_0x9dae('0x4')});};
\ No newline at end of file
+var _0xc196=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x565a43,_0x567abc){var _0x27cea3=function(_0x5dda1b){while(--_0x5dda1b){_0x565a43['push'](_0x565a43['shift']());}};_0x27cea3(++_0x567abc);}(_0xc196,0x1bc));var _0x6c19=function(_0x166658,_0x450374){_0x166658=_0x166658-0x0;var _0xd492bc=_0xc196[_0x166658];return _0xd492bc;};'use strict';var client=require(_0x6c19('0x0'));exports[_0x6c19('0x1')]=function(_0x17a79c){return client[_0x6c19('0x2')](_0x6c19('0x3'),{'body':_0x17a79c,'log':_0x6c19('0x3')});};exports['update']=function(_0x50189b,_0x26b087){return client[_0x6c19('0x2')](_0x6c19('0x4'),{'body':_0x26b087,'options':{'where':{'uniqueid':_0x50189b},'order':[['id',_0x6c19('0x5')]],'limit':0x1},'log':_0x6c19('0x4')});};
\ No newline at end of file
index 6a6e487..c888c68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f1=['addTags','../client','update','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x04f1,0x92));var _0x104f=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0x04f1[_0x414297];return _0x51ea47;};'use strict';var client=require(_0x104f('0x0'));exports[_0x104f('0x1')]=function(_0x3978b8,_0x4daefc){return client['Request'](_0x104f('0x2'),{'body':_0x4daefc,'options':{'where':{'id':_0x3978b8}},'log':_0x104f('0x3')});};exports[_0x104f('0x4')]=function(_0x55c56e,_0x4b4197){return client['Request']('AddTagsToSmsInteraction',{'body':_0x4b4197,'options':{'where':{'id':_0x55c56e}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
+var _0x448b=['update','Request','UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x15704d,_0x35fe98){var _0x5ba0b6=function(_0x63842b){while(--_0x63842b){_0x15704d['push'](_0x15704d['shift']());}};_0x5ba0b6(++_0x35fe98);}(_0x448b,0x125));var _0xb448=function(_0x2ed408,_0x2d5ed5){_0x2ed408=_0x2ed408-0x0;var _0x1d369b=_0x448b[_0x2ed408];return _0x1d369b;};'use strict';var client=require(_0xb448('0x0'));exports[_0xb448('0x1')]=function(_0x2556f1,_0x1a965f){return client[_0xb448('0x2')](_0xb448('0x3'),{'body':_0x1a965f,'options':{'where':{'id':_0x2556f1}},'log':'updateSmsInteraction'});};exports[_0xb448('0x4')]=function(_0x32bcae,_0x172a89){return client[_0xb448('0x2')](_0xb448('0x5'),{'body':_0x172a89,'options':{'where':{'id':_0x32bcae}},'log':_0xb448('0x6')});};
\ No newline at end of file
index fa26920..790f551 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4465=['createSmsMessage','CreateSmsMessage'];(function(_0xfdb740,_0x14c2da){var _0x4a837d=function(_0x4b4f8a){while(--_0x4b4f8a){_0xfdb740['push'](_0xfdb740['shift']());}};_0x4a837d(++_0x14c2da);}(_0x4465,0x161));var _0x5446=function(_0x2561b9,_0x402710){_0x2561b9=_0x2561b9-0x0;var _0x4d9c94=_0x4465[_0x2561b9];return _0x4d9c94;};'use strict';var client=require('../client');exports['create']=function(_0x38cf10){return client['Request'](_0x5446('0x0'),{'body':_0x38cf10,'log':_0x5446('0x1')});};
\ No newline at end of file
+var _0x1dc8=['create','../client'];(function(_0x19573b,_0x4ce77d){var _0x5acb1b=function(_0x2e7465){while(--_0x2e7465){_0x19573b['push'](_0x19573b['shift']());}};_0x5acb1b(++_0x4ce77d);}(_0x1dc8,0x117));var _0x81dc=function(_0x33aeab,_0x480b1a){_0x33aeab=_0x33aeab-0x0;var _0xa3bb02=_0x1dc8[_0x33aeab];return _0xa3bb02;};'use strict';var client=require(_0x81dc('0x0'));exports[_0x81dc('0x1')]=function(_0x2a7971){return client['Request']('CreateSmsMessage',{'body':_0x2a7971,'log':'createSmsMessage'});};
\ No newline at end of file
index 356a086..010020b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0xb1680e,_0xea33e8){var _0x31cd58=function(_0xee461a){while(--_0xee461a){_0xb1680e['push'](_0xb1680e['shift']());}};_0x31cd58(++_0xea33e8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xcb91[_0x2f6f50];return _0x2cf365;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x220d3b,_0x29c503){var _0x14354a=function(_0x424c6b){while(--_0x424c6b){_0x220d3b['push'](_0x220d3b['shift']());}};_0x14354a(++_0x29c503);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};};
\ No newline at end of file
index 2af386c..eb81c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1e8972,_0x12b85d){var _0x353f33=function(_0x16f1da){while(--_0x16f1da){_0x1e8972['push'](_0x1e8972['shift']());}};_0x353f33(++_0x12b85d);}(_0x008c,0x188));var _0xc008=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x008c[_0x3a833e];return _0xdff445;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x2d1971,_0x20b764){var _0x4d7759=function(_0x56a550){while(--_0x56a550){_0x2d1971['push'](_0x2d1971['shift']());}};_0x4d7759(++_0x20b764);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b0037,_0xb7c617){_0x3b0037=_0x3b0037-0x0;var _0x1d94ca=_0xedd9[_0x3b0037];return _0x1d94ca;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
index 1626c8c..d82611c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2915b7,_0xc66b75){var _0x4a0368=function(_0x1f0e7d){while(--_0x1f0e7d){_0x2915b7['push'](_0x2915b7['shift']());}};_0x4a0368(++_0xc66b75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x23f96a,_0x35e08e){var _0x4a72ee=function(_0x6cf3ee){while(--_0x6cf3ee){_0x23f96a['push'](_0x23f96a['shift']());}};_0x4a72ee(++_0x35e08e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index 02ad8cf..f922556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacf4=['AddTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags'];(function(_0x4f6f84,_0x31e197){var _0x20d989=function(_0x34db70){while(--_0x34db70){_0x4f6f84['push'](_0x4f6f84['shift']());}};_0x20d989(++_0x31e197);}(_0xacf4,0xe7));var _0x4acf=function(_0x3e2c3c,_0x3fcf4e){_0x3e2c3c=_0x3e2c3c-0x0;var _0x5a79a6=_0xacf4[_0x3e2c3c];return _0x5a79a6;};'use strict';var client=require('../client');exports['update']=function(_0x867c40,_0x14a022){return client[_0x4acf('0x0')](_0x4acf('0x1'),{'body':_0x14a022,'options':{'where':{'id':_0x867c40}},'log':_0x4acf('0x2')});};exports[_0x4acf('0x3')]=function(_0x145264,_0x5cf22d){return client[_0x4acf('0x0')](_0x4acf('0x4'),{'body':_0x5cf22d,'options':{'where':{'id':_0x145264}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0x2ef3=['../client','update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0x2ef3,0xba));var _0x32ef=function(_0x18c34b,_0x4297b1){_0x18c34b=_0x18c34b-0x0;var _0x1746cb=_0x2ef3[_0x18c34b];return _0x1746cb;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(_0x47513a,_0x26e56e){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'body':_0x26e56e,'options':{'where':{'id':_0x47513a}},'log':'updateWhatsappInteraction'});};exports[_0x32ef('0x4')]=function(_0x38b7f3,_0x524ab6){return client[_0x32ef('0x2')](_0x32ef('0x5'),{'body':_0x524ab6,'options':{'where':{'id':_0x38b7f3}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index cfa8f7a..a901c30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc727=['Request','createWhatsappMessage','../client','create'];(function(_0x5f3905,_0x43a651){var _0x2923b1=function(_0x3c72d8){while(--_0x3c72d8){_0x5f3905['push'](_0x5f3905['shift']());}};_0x2923b1(++_0x43a651);}(_0xc727,0x166));var _0x7c72=function(_0x4275d0,_0x3a05c5){_0x4275d0=_0x4275d0-0x0;var _0x31d88a=_0xc727[_0x4275d0];return _0x31d88a;};'use strict';var client=require(_0x7c72('0x0'));exports[_0x7c72('0x1')]=function(_0x467a5c){return client[_0x7c72('0x2')]('CreateWhatsappMessage',{'body':_0x467a5c,'log':_0x7c72('0x3')});};
\ No newline at end of file
+var _0x53aa=['../client','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x53aa,0x6f));var _0xa53a=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x53aa[_0x11c573];return _0x6b72de;};'use strict';var client=require(_0xa53a('0x0'));exports['create']=function(_0x2ca6be){return client['Request'](_0xa53a('0x1'),{'body':_0x2ca6be,'log':_0xa53a('0x2')});};
\ No newline at end of file
index 623b751..eade0b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08cb=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','User','Agents','online'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x08cb,0x122));var _0xb08c=function(_0x44676e,_0x1ac4fc){_0x44676e=_0x44676e-0x0;var _0x17eee0=_0x08cb[_0x44676e];return _0x17eee0;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0xb08c('0x0')](_0xb08c('0x1'),{'options':{'raw':![],'attributes':['id',_0xb08c('0x2'),_0xb08c('0x3'),'strategy'],'include':[{'model':_0xb08c('0x4'),'as':_0xb08c('0x5'),'attributes':['id',_0xb08c('0x2'),_0xb08c('0x6'),_0xb08c('0x7')]}]},'log':_0xb08c('0x8')});};};
\ No newline at end of file
+var _0xf87d=['name','strategy','User','../client','Request','GetWhatsappQueue'];(function(_0x25ecb0,_0x356f6c){var _0x5297e2=function(_0x3be847){while(--_0x3be847){_0x25ecb0['push'](_0x25ecb0['shift']());}};_0x5297e2(++_0x356f6c);}(_0xf87d,0x147));var _0xdf87=function(_0x355e5f,_0x4134e7){_0x355e5f=_0x355e5f-0x0;var _0x3d24a2=_0xf87d[_0x355e5f];return _0x3d24a2;};'use strict';var client=require(_0xdf87('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0xdf87('0x1')](_0xdf87('0x2'),{'options':{'raw':![],'attributes':['id',_0xdf87('0x3'),'timeout',_0xdf87('0x4')],'include':[{'model':_0xdf87('0x5'),'as':'Agents','attributes':['id',_0xdf87('0x3'),'online','whatsappPause']}]},'log':'getWhatsappQueues'});};};
\ No newline at end of file
index 7b120de..fe91865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cb7=['DESC','../client','create','Request','UpdateWhatsappQueueReport'];(function(_0x5a11a1,_0x311e46){var _0x34a9a2=function(_0x234831){while(--_0x234831){_0x5a11a1['push'](_0x5a11a1['shift']());}};_0x34a9a2(++_0x311e46);}(_0x2cb7,0xfb));var _0x72cb=function(_0x122e42,_0x222609){_0x122e42=_0x122e42-0x0;var _0x4c019e=_0x2cb7[_0x122e42];return _0x4c019e;};'use strict';var client=require(_0x72cb('0x0'));exports[_0x72cb('0x1')]=function(_0x5f1343){return client[_0x72cb('0x2')]('CreateWhatsappQueueReport',{'body':_0x5f1343,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x3e15a0,_0x3c27ed){return client[_0x72cb('0x2')](_0x72cb('0x3'),{'body':_0x3c27ed,'options':{'where':{'uniqueid':_0x3e15a0},'order':[['id',_0x72cb('0x4')]],'limit':0x1},'log':_0x72cb('0x3')});};
\ No newline at end of file
+var _0x978d=['create','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x978d,0x73));var _0xd978=function(_0x2b1da8,_0x3050f5){_0x2b1da8=_0x2b1da8-0x0;var _0xd3ffb2=_0x978d[_0x2b1da8];return _0xd3ffb2;};'use strict';var client=require('../client');exports[_0xd978('0x0')]=function(_0x3d4d49){return client['Request']('CreateWhatsappQueueReport',{'body':_0x3d4d49,'log':_0xd978('0x1')});};exports[_0xd978('0x2')]=function(_0x41afb3,_0x47de71){return client['Request'](_0xd978('0x3'),{'body':_0x47de71,'options':{'where':{'uniqueid':_0x41afb3},'order':[['id',_0xd978('0x4')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
index 53f62ef..c85bfee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc3c=['next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','join','find','agents','createQueue','atimeout','channel','START:%s','end','close','rules','stop','[%s][AGENT]\x20ROUTING\x20END'];(function(_0x258a70,_0x5eea18){var _0x8bbdb9=function(_0x484c07){while(--_0x484c07){_0x258a70['push'](_0x258a70['shift']());}};_0x8bbdb9(++_0x5eea18);}(_0xdc3c,0x1e7));var _0xcdc3=function(_0x4e876a,_0x314ef1){_0x4e876a=_0x4e876a-0x0;var _0xd369fe=_0xdc3c[_0x4e876a];return _0xd369fe;};'use strict';var schema=require(_0xcdc3('0x0'));var _=require(_0xcdc3('0x1'));var util=require(_0xcdc3('0x2'));var seqqueue=require(_0xcdc3('0x3'));var logger=require(_0xcdc3('0x4'))('routing');var strategy=require(_0xcdc3('0x5'));var queue=schema({'name':{'type':_0xcdc3('0x6'),'required':!![],'message':_0xcdc3('0x7')},'timeout':{'type':_0xcdc3('0x8'),'message':_0xcdc3('0x9')}});function writeLog(_0x550abe,_0x18c9dd,_0x47eb8e){return logger[_0xcdc3('0xa')](util[_0xcdc3('0xb')](_0xcdc3('0xc'),_0x550abe,_0x18c9dd[_0xcdc3('0xd')],_0x47eb8e));}function handleFindAgent(_0x2c16a6){return function(_0x188d17){return _0x188d17['name'][_0xcdc3('0xe')]()===_0x2c16a6[_0xcdc3('0xe')]();};}exports[_0xcdc3('0xf')]=function(_0x5fb64f,_0x4a631a,_0x54c29e,_0x6c52a9){return function(_0x428a9a){try{var _0x2c4367={'name':_0x4a631a[0x0],'timeout':_0x4a631a[0x1]};var _0x130bd4=queue[_0xcdc3('0x0')](_0x2c4367,{'typecast':!![]});if(_0x130bd4[_0xcdc3('0x10')]){logger['error'](_0xcdc3('0x11'),_0x5fb64f,_[_0xcdc3('0x12')](_0x130bd4,'message')[_0xcdc3('0x13')](',\x20'));_0x428a9a['stop']();}else{var _0x89dda=_[_0xcdc3('0x14')](_0x54c29e[_0xcdc3('0x15')],handleFindAgent(_0x2c4367['name']));if(_0x89dda){var _0x10c271=(_0x2c4367['timeout']||0xa)*0x3e8;var _0x3044b3,_0xd2189f;var _0x59ea98=seqqueue[_0xcdc3('0x16')](_0x10c271);_0x59ea98['id']=_0x5fb64f;_0x59ea98[_0xcdc3('0x17')]=_0x10c271;_0x59ea98[_0xcdc3('0x18')]=_0x6c52a9[_0xcdc3('0x18')];writeLog(_0x5fb64f,_0x89dda,util[_0xcdc3('0xb')](_0xcdc3('0x19'),_0x10c271));_0x54c29e['rules'][_0x5fb64f]['on'](_0xcdc3('0x1a'),function(){logger[_0xcdc3('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x5fb64f);clearTimeout(_0xd2189f);_0xd2189f=undefined;_0x59ea98[_0xcdc3('0x1b')]();if(_0x54c29e[_0xcdc3('0x1c')][_0x5fb64f]){delete _0x54c29e[_0xcdc3('0x1c')][_0x5fb64f];}_0x428a9a[_0xcdc3('0x1d')]();});_0x54c29e[_0xcdc3('0x1c')][_0x5fb64f]['on']('complete',function(){if(_0x54c29e[_0xcdc3('0x1c')][_0x5fb64f]){delete _0x54c29e[_0xcdc3('0x1c')][_0x5fb64f];}});_0xd2189f=setTimeout(function(){logger[_0xcdc3('0xa')](_0xcdc3('0x1e'),_0x5fb64f);clearTimeout(_0xd2189f);_0x59ea98[_0xcdc3('0x1b')]();_0x428a9a[_0xcdc3('0x1f')]();},_0x10c271);strategy[_0xcdc3('0x20')](_0x59ea98,_0x89dda,_0x54c29e,_0x6c52a9);}else{logger[_0xcdc3('0x21')](_0xcdc3('0x22'),_0x5fb64f,_0x2c4367['name']);_0x428a9a[_0xcdc3('0x1d')]();}}}catch(_0x5ec35c){console[_0xcdc3('0x23')](_0x5ec35c);logger[_0xcdc3('0x21')](_0xcdc3('0x24'),_0x5fb64f,_0x5ec35c['stack']);_0x428a9a['stop']();}};};
\ No newline at end of file
+var _0x8a1f=['map','join','stop','find','agents','timeout','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s'];(function(_0x27e9fe,_0x20a34b){var _0x2cd812=function(_0x21b980){while(--_0x21b980){_0x27e9fe['push'](_0x27e9fe['shift']());}};_0x2cd812(++_0x20a34b);}(_0x8a1f,0x170));var _0xf8a1=function(_0x205c11,_0x941d3d){_0x205c11=_0x205c11-0x0;var _0x550e7b=_0x8a1f[_0x205c11];return _0x550e7b;};'use strict';var schema=require(_0xf8a1('0x0'));var _=require(_0xf8a1('0x1'));var util=require(_0xf8a1('0x2'));var seqqueue=require(_0xf8a1('0x3'));var logger=require(_0xf8a1('0x4'))(_0xf8a1('0x5'));var strategy=require(_0xf8a1('0x6'));var queue=schema({'name':{'type':_0xf8a1('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf8a1('0x8'),'message':_0xf8a1('0x9')}});function writeLog(_0x5a0d62,_0x3ff744,_0x58aeca){return logger[_0xf8a1('0xa')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5a0d62,_0x3ff744[_0xf8a1('0xb')],_0x58aeca));}function handleFindAgent(_0x568e21){return function(_0x5b4817){return _0x5b4817[_0xf8a1('0xb')]['toLowerCase']()===_0x568e21[_0xf8a1('0xc')]();};}exports[_0xf8a1('0xd')]=function(_0x38f6d6,_0x5b5f3e,_0x330d5d,_0x42ad9b){return function(_0x53d254){try{var _0x11b4c5={'name':_0x5b5f3e[0x0],'timeout':_0x5b5f3e[0x1]};var _0x40e59c=queue[_0xf8a1('0x0')](_0x11b4c5,{'typecast':!![]});if(_0x40e59c[_0xf8a1('0xe')]){logger[_0xf8a1('0xf')](_0xf8a1('0x10'),_0x38f6d6,_[_0xf8a1('0x11')](_0x40e59c,'message')[_0xf8a1('0x12')](',\x20'));_0x53d254[_0xf8a1('0x13')]();}else{var _0x1860f0=_[_0xf8a1('0x14')](_0x330d5d[_0xf8a1('0x15')],handleFindAgent(_0x11b4c5[_0xf8a1('0xb')]));if(_0x1860f0){var _0x149fae=(_0x11b4c5[_0xf8a1('0x16')]||0xa)*0x3e8;var _0x27b734,_0x45cf95;var _0x179273=seqqueue[_0xf8a1('0x17')](_0x149fae);_0x179273['id']=_0x38f6d6;_0x179273[_0xf8a1('0x18')]=_0x149fae;_0x179273['channel']=_0x42ad9b['channel'];writeLog(_0x38f6d6,_0x1860f0,util['format'](_0xf8a1('0x19'),_0x149fae));_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]['on'](_0xf8a1('0x1b'),function(){logger['info'](_0xf8a1('0x1c'),_0x38f6d6);clearTimeout(_0x45cf95);_0x45cf95=undefined;_0x179273[_0xf8a1('0x1d')]();if(_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]){delete _0x330d5d[_0xf8a1('0x1a')][_0x38f6d6];}_0x53d254[_0xf8a1('0x13')]();});_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]['on'](_0xf8a1('0x1e'),function(){if(_0x330d5d[_0xf8a1('0x1a')][_0x38f6d6]){delete _0x330d5d[_0xf8a1('0x1a')][_0x38f6d6];}});_0x45cf95=setTimeout(function(){logger[_0xf8a1('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x38f6d6);clearTimeout(_0x45cf95);_0x179273[_0xf8a1('0x1d')]();_0x53d254['next']();},_0x149fae);strategy[_0xf8a1('0x1f')](_0x179273,_0x1860f0,_0x330d5d,_0x42ad9b);}else{logger[_0xf8a1('0xf')](_0xf8a1('0x20'),_0x38f6d6,_0x11b4c5[_0xf8a1('0xb')]);_0x53d254[_0xf8a1('0x13')]();}}}catch(_0x24df39){console[_0xf8a1('0x21')](_0x24df39);logger[_0xf8a1('0xf')]('[%s][QUEUE]\x20%s',_0x38f6d6,_0x24df39[_0xf8a1('0x22')]);_0x53d254[_0xf8a1('0x13')]();}};};
\ No newline at end of file
index 4d9fcad..f39239a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82eb=['UserId','info','[%s][AMAZONLEX]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','then','body','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','providerName','amazonlex','providerResponse','Message','dialogState','next','aws-sdk','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x494ab9,_0x5dfb88){var _0xbbe59f=function(_0x5b12c9){while(--_0x5b12c9){_0x494ab9['push'](_0x494ab9['shift']());}};_0xbbe59f(++_0x5dfb88);}(_0x82eb,0x19d));var _0xb82e=function(_0x561066,_0x522b77){_0x561066=_0x561066-0x0;var _0x5a3420=_0x82eb[_0x561066];return _0x5a3420;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xb82e('0x0'));var utils=require('./utils');var logger=require(_0xb82e('0x1'))(_0xb82e('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xb82e('0x3')),'mailMessage':require(_0xb82e('0x4')),'smsMessage':require(_0xb82e('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb82e('0x6'))};exports[_0xb82e('0x7')]=function(_0x5065ff,_0x1e8a6a){return function(_0x381f51){try{if(!_[_0xb82e('0x8')](this[_0xb82e('0x9')][_0xb82e('0xa')])){logger[_0xb82e('0xb')](_0xb82e('0xc'),_0x5065ff,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x381f51['next']();}var _0x5f2b75={'ContactId':this[_0xb82e('0xd')]['id'],'sentAt':moment()[_0xb82e('0xe')](_0xb82e('0xf')),'direction':_0xb82e('0x10')};if(this[_0xb82e('0x11')]===_0xb82e('0x12')||this[_0xb82e('0x11')]===_0xb82e('0x13')){_0x5f2b75['phone']=this[_0xb82e('0x9')][_0xb82e('0x14')];}var _0x4be938=this[_0xb82e('0x11')];if(_0x4be938===_0xb82e('0x15')){_0x5f2b75['ChatWebsiteId']=this[_0xb82e('0x16')]['id'];}else{_0x5f2b75[_[_0xb82e('0x17')](_0x4be938)+_0xb82e('0x18')]=this['account']['id'];}_0x5f2b75[_['upperFirst'](_0x4be938)+_0xb82e('0x19')]=this[_0xb82e('0x9')]['id'];if(this[_0xb82e('0x9')][_0xb82e('0x1a')]){var _0x2f9edd=_0x1e8a6a[0x4];if(!_[_0xb82e('0x1b')](_0x2f9edd)){_0x5f2b75['body']=utils[_0xb82e('0x1c')](_0x2f9edd,this);return rpc[_0x4be938+'Message'][_0xb82e('0x1d')](_0x5f2b75)[_0xb82e('0x1e')](function(_0x4e5af1){logger[_0xb82e('0xb')]('[%s][AMAZONLEX]\x20%s',_0x5065ff,_0x5f2b75[_0xb82e('0x1f')]);})['catch'](function(_0x2cf03d){logger[_0xb82e('0x20')](_0xb82e('0xc'),_0x5065ff,JSON[_0xb82e('0x21')](_0x2cf03d));})[_0xb82e('0x22')](function(){logger[_0xb82e('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5065ff);_0x381f51[_0xb82e('0x23')]();});}else{logger[_0xb82e('0xb')](_0xb82e('0x24'),_0x5065ff);_0x381f51[_0xb82e('0x23')]();}}else{var _0x118c23=this;var _0x63cab5=new AWS[(_0xb82e('0x25'))]({'accessKeyId':_0x1e8a6a[0x0],'secretAccessKey':_0x1e8a6a[0x1],'region':_0x1e8a6a[0x2]});var _0x238c6d={'botAlias':_0xb82e('0x26'),'botName':_0x1e8a6a[0x3],'inputText':this[_0xb82e('0x27')][_0xb82e('0x1f')],'userId':this['channel']+':'+this['interaction']['id'][_0xb82e('0x28')]()};_0x63cab5['postText'](_0x238c6d,function(_0x4ca8ef,_0xe621df){if(_0x4ca8ef){logger[_0xb82e('0x20')](_0xb82e('0xc'),_0x5065ff,_0x4ca8ef['message']);_0x381f51['next']();}else if(_0xe621df&&_0xe621df[_0xb82e('0x27')]){_0x118c23[_0xb82e('0x1f')]['amazonlex']=_0xe621df;_0x5f2b75[_0xb82e('0x1f')]=_0xe621df['message'];_0x5f2b75[_0xb82e('0x29')]=_0xb82e('0x2a');_0x5f2b75[_0xb82e('0x2b')]=JSON[_0xb82e('0x21')](_0xe621df);return rpc[_0x4be938+_0xb82e('0x2c')][_0xb82e('0x1d')](_0x5f2b75)[_0xb82e('0x1e')](function(_0x2f5a03){logger[_0xb82e('0xb')](_0xb82e('0xc'),_0x5065ff,_0x5f2b75[_0xb82e('0x1f')]);if(_0xe621df[_0xb82e('0x2d')]=='Failed'){_0x381f51[_0xb82e('0x2e')]();}else{_0x381f51[_0xb82e('0x23')]();}})['catch'](function(_0x19cf31){logger[_0xb82e('0x20')]('[%s][AMAZONLEX]\x20%s',_0x5065ff,JSON[_0xb82e('0x21')](_0x19cf31));_0x381f51[_0xb82e('0x2e')]();});}else{_0x381f51[_0xb82e('0x2e')]();}});}}catch(_0x453b73){logger[_0xb82e('0x20')](_0xb82e('0xc'),_0x5065ff,JSON['stringify'](_0x453b73));_0x381f51['stop']();}};};
\ No newline at end of file
+var _0xee98=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','body','getMustacheRender','Message','create','then','catch','error','info','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','stringify','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','UserId','[%s][AMAZONLEX]\x20%s'];(function(_0x6a0be6,_0x55a79c){var _0x125fad=function(_0x2484ed){while(--_0x2484ed){_0x6a0be6['push'](_0x6a0be6['shift']());}};_0x125fad(++_0x55a79c);}(_0xee98,0x11e));var _0x8ee9=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xee98[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var moment=require(_0x8ee9('0x0'));var AWS=require(_0x8ee9('0x1'));var utils=require('./utils');var logger=require(_0x8ee9('0x2'))(_0x8ee9('0x3'));var rpc={'chatMessage':require(_0x8ee9('0x4')),'openchannelMessage':require(_0x8ee9('0x5')),'mailMessage':require(_0x8ee9('0x6')),'smsMessage':require(_0x8ee9('0x7')),'faxMessage':require(_0x8ee9('0x8')),'whatsappMessage':require(_0x8ee9('0x9'))};exports[_0x8ee9('0xa')]=function(_0x24ec95,_0x5124b3){return function(_0x14b4ed){try{if(!_[_0x8ee9('0xb')](this['interaction'][_0x8ee9('0xc')])){logger['info'](_0x8ee9('0xd'),_0x24ec95,_0x8ee9('0xe'));return _0x14b4ed[_0x8ee9('0xf')]();}var _0x48e2cb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x8ee9('0x10')),'direction':_0x8ee9('0x11')};if(this[_0x8ee9('0x12')]===_0x8ee9('0x13')||this[_0x8ee9('0x12')]===_0x8ee9('0x14')){_0x48e2cb[_0x8ee9('0x15')]=this['interaction']['phone'];}var _0xf82350=this[_0x8ee9('0x12')];if(_0xf82350===_0x8ee9('0x16')){_0x48e2cb[_0x8ee9('0x17')]=this[_0x8ee9('0x18')]['id'];}else{_0x48e2cb[_[_0x8ee9('0x19')](_0xf82350)+_0x8ee9('0x1a')]=this['account']['id'];}_0x48e2cb[_[_0x8ee9('0x19')](_0xf82350)+_0x8ee9('0x1b')]=this[_0x8ee9('0x1c')]['id'];if(this[_0x8ee9('0x1c')][_0x8ee9('0x1d')]){var _0x1087a0=_0x5124b3[0x4];if(!_['isEmpty'](_0x1087a0)){_0x48e2cb[_0x8ee9('0x1e')]=utils[_0x8ee9('0x1f')](_0x1087a0,this);return rpc[_0xf82350+_0x8ee9('0x20')][_0x8ee9('0x21')](_0x48e2cb)[_0x8ee9('0x22')](function(_0x4d823b){logger['info']('[%s][AMAZONLEX]\x20%s',_0x24ec95,_0x48e2cb[_0x8ee9('0x1e')]);})[_0x8ee9('0x23')](function(_0x173992){logger[_0x8ee9('0x24')]('[%s][AMAZONLEX]\x20%s',_0x24ec95,JSON['stringify'](_0x173992));})['finally'](function(){logger[_0x8ee9('0x25')](_0x8ee9('0x26'),_0x24ec95);_0x14b4ed[_0x8ee9('0x27')]();});}else{logger[_0x8ee9('0x25')](_0x8ee9('0x28'),_0x24ec95);_0x14b4ed['stop']();}}else{var _0x37f254=this;var _0x2b5a46=new AWS['LexRuntime']({'accessKeyId':_0x5124b3[0x0],'secretAccessKey':_0x5124b3[0x1],'region':_0x5124b3[0x2]});var _0x3385f1={'botAlias':_0x8ee9('0x29'),'botName':_0x5124b3[0x3],'inputText':this[_0x8ee9('0x2a')][_0x8ee9('0x1e')],'userId':this['channel']+':'+this['interaction']['id'][_0x8ee9('0x2b')]()};_0x2b5a46[_0x8ee9('0x2c')](_0x3385f1,function(_0x49c5e0,_0x394d27){if(_0x49c5e0){logger[_0x8ee9('0x24')]('[%s][AMAZONLEX]\x20%s',_0x24ec95,_0x49c5e0[_0x8ee9('0x2a')]);_0x14b4ed[_0x8ee9('0xf')]();}else if(_0x394d27&&_0x394d27[_0x8ee9('0x2a')]){_0x37f254[_0x8ee9('0x1e')][_0x8ee9('0x2d')]=_0x394d27;_0x48e2cb[_0x8ee9('0x1e')]=_0x394d27[_0x8ee9('0x2a')];_0x48e2cb['providerName']=_0x8ee9('0x2d');_0x48e2cb[_0x8ee9('0x2e')]=JSON['stringify'](_0x394d27);return rpc[_0xf82350+_0x8ee9('0x20')][_0x8ee9('0x21')](_0x48e2cb)[_0x8ee9('0x22')](function(_0x390d00){logger['info'](_0x8ee9('0xd'),_0x24ec95,_0x48e2cb[_0x8ee9('0x1e')]);if(_0x394d27[_0x8ee9('0x2f')]==_0x8ee9('0x30')){_0x14b4ed[_0x8ee9('0xf')]();}else{_0x14b4ed[_0x8ee9('0x27')]();}})[_0x8ee9('0x23')](function(_0xc267a6){logger[_0x8ee9('0x24')](_0x8ee9('0xd'),_0x24ec95,JSON[_0x8ee9('0x31')](_0xc267a6));_0x14b4ed[_0x8ee9('0xf')]();});}else{_0x14b4ed['next']();}});}}catch(_0x931ab9){logger['error'](_0x8ee9('0xd'),_0x24ec95,JSON[_0x8ee9('0x31')](_0x931ab9));_0x14b4ed[_0x8ee9('0x27')]();}};};
\ No newline at end of file
index f81111f..1b1391d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51d7=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','next','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','headers','All','sendMailMessage','account','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','stop','lodash','./utils','../../../../config/logger','routing'];(function(_0x2bad09,_0x691b73){var _0x3d37d5=function(_0x29d09b){while(--_0x29d09b){_0x2bad09['push'](_0x2bad09['shift']());}};_0x3d37d5(++_0x691b73);}(_0x51d7,0x18e));var _0x751d=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x51d7[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x751d('0x0'));var moment=require('moment');var utils=require(_0x751d('0x1'));var logger=require(_0x751d('0x2'))(_0x751d('0x3'));var rpc={'chatMessage':require(_0x751d('0x4')),'openchannelMessage':require(_0x751d('0x5')),'mailMessage':require(_0x751d('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x751d('0x7')),'whatsappMessage':require(_0x751d('0x8')),'chatInteraction':require(_0x751d('0x9')),'openchannelInteraction':require(_0x751d('0xa')),'mailInteraction':require(_0x751d('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x751d('0xc')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x751d('0xd'));exports[_0x751d('0xe')]=function(_0x5c8e62,_0x465910,_0x4c5528,_0x9d95d1){return function(_0x430755){try{var _0x47c6f7=this[_0x751d('0xf')];if(_0x47c6f7===_0x751d('0x10')&&_0x9d95d1[_0x751d('0x11')][_0x751d('0x12')]){logger[_0x751d('0x13')](_0x751d('0x14'),_0x5c8e62,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x430755[_0x751d('0x15')]();}if(_0x465910[0x0]==='1'&&(_['isNil'](this[_0x751d('0x16')][_0x751d('0x17')])||!this[_0x751d('0x16')][_0x751d('0x17')])){logger[_0x751d('0x13')](_0x751d('0x14'),_0x5c8e62,_0x751d('0x18'));return _0x430755[_0x751d('0x15')]();}if(_0x465910[0x0]==='2'&&this['interaction'][_0x751d('0x19')]){logger['info'](_0x751d('0x1a'),_0x5c8e62,_0x751d('0x1b'));return _0x430755[_0x751d('0x15')]();}var _0x3342ce={'ContactId':this[_0x751d('0x1c')]['id'],'sentAt':moment()[_0x751d('0x1d')](_0x751d('0x1e')),'direction':'out'};if(this['channel']==='mail'){_0x3342ce['body']=utils[_0x751d('0x1f')](_0x465910[0x2],this);}else{_0x3342ce[_0x751d('0x11')]=utils['getMustacheRender'](_0x465910[0x1],this);}if(this[_0x751d('0x20')]){_0x3342ce['to']=this[_0x751d('0x20')][_0x751d('0x21')]||'';if(this[_0x751d('0xf')]===_0x751d('0x10')&&_0x465910[0x1]==='1'){_0x3342ce['cc']=this[_0x751d('0x20')]['cc']||'';}_0x3342ce['from']=this[_0x751d('0x20')]['to']||'';_0x3342ce[_0x751d('0x22')]=this[_0x751d('0x20')]['phone']||'';_0x3342ce['read']=!![];if(this['message'][_0x751d('0x23')]){_0x3342ce[_0x751d('0x23')]='';_0x3342ce[_0x751d('0x23')]+=_[_0x751d('0x24')](this[_0x751d('0x20')]['subject'],_0x751d('0x25'))?'':_0x751d('0x26');_0x3342ce['subject']+=this[_0x751d('0x20')][_0x751d('0x23')];}}if(this[_0x751d('0xf')]==='chat'){_0x3342ce['ChatWebsiteId']=this['account']['id'];}else{_0x3342ce[_[_0x751d('0x27')](this['channel'])+_0x751d('0x28')]=this['account']['id'];}_0x3342ce[_[_0x751d('0x27')](this[_0x751d('0xf')])+_0x751d('0x29')]=this[_0x751d('0x16')]['id'];var _0x125017=this[_0x751d('0x16')];if(rpc[this[_0x751d('0xf')]+_0x751d('0x2a')]){if(this[_0x751d('0xf')]===_0x751d('0x10')){_0x3342ce[_0x751d('0x2b')]=this[_0x751d('0x20')]['messageId'];_0x3342ce[_0x751d('0x2c')]=_0x751d('0x2d')+_[_0x751d('0x2e')](_0x3342ce[_0x751d('0x11')],_0x751d('0x2f'),_0x751d('0x30'))+'</div>';_0x3342ce[_0x751d('0x31')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x751d('0x32'),'Precedence':'auto_reply'};return mailRpc[_0x751d('0x33')](this[_0x751d('0x34')][_0x751d('0x35')],_0x3342ce)[_0x751d('0x36')](function(_0x2b36b0){logger[_0x751d('0x13')](_0x751d('0x37'),_0x5c8e62);_0x3342ce[_0x751d('0x38')]=_0x2b36b0[_0x751d('0x20')][_0x751d('0x38')];return rpc[_0x47c6f7+_0x751d('0x2a')][_0x751d('0x39')](_0x3342ce);})[_0x751d('0x36')](function(_0x191c98){logger[_0x751d('0x13')](_0x751d('0x14'),_0x5c8e62,JSON['stringify'](_0x191c98));})[_0x751d('0x3a')](function(_0x35cdca){logger[_0x751d('0x3b')](_0x751d('0x3c'),_0x5c8e62,JSON[_0x751d('0x3d')](_0x35cdca));})['finally'](function(){Promise['resolve']()[_0x751d('0x36')](function(){if(_0x465910[0x0]!=='2'||_0x125017[_0x751d('0x19')])return;return rpc[_0x47c6f7+_0x751d('0x3e')][_0x751d('0x3f')](_0x125017['id'],{'autoreplyExecuted':!![]})[_0x751d('0x36')](function(_0xbc7925){logger[_0x751d('0x13')](_0x751d('0x1a'),_0x5c8e62,JSON['stringify'](_0xbc7925));})['catch'](function(_0x9ff067){logger[_0x751d('0x3b')](_0x751d('0x40'),_0x5c8e62,JSON['stringify'](_0x9ff067));});})[_0x751d('0x36')](function(){_0x430755[_0x751d('0x15')]();});});}else{return rpc[this[_0x751d('0xf')]+_0x751d('0x2a')][_0x751d('0x39')](_0x3342ce)['then'](function(){logger['info'](_0x751d('0x14'),_0x5c8e62,_0x3342ce[_0x751d('0x11')]);})[_0x751d('0x3a')](function(_0x814f71){logger[_0x751d('0x3b')](_0x751d('0x14'),_0x5c8e62,JSON[_0x751d('0x3d')](_0x814f71));})['finally'](function(){Promise[_0x751d('0x41')]()['then'](function(){if(_0x465910[0x0]!=='2'||_0x125017['autoreplyExecuted'])return;return rpc[_0x47c6f7+_0x751d('0x3e')][_0x751d('0x3f')](_0x125017['id'],{'autoreplyExecuted':!![]})[_0x751d('0x36')](function(_0x383836){logger[_0x751d('0x13')](_0x751d('0x1a'),_0x5c8e62,JSON[_0x751d('0x3d')](_0x383836));})[_0x751d('0x3a')](function(_0x165db7){logger[_0x751d('0x3b')](_0x751d('0x40'),_0x5c8e62,JSON['stringify'](_0x165db7));});})['then'](function(){_0x430755['next']();});});}}}catch(_0x259579){logger[_0x751d('0x3b')](_0x751d('0x14'),_0x5c8e62,JSON['stringify'](_0x259579));_0x430755[_0x751d('0x42')]();}};};
\ No newline at end of file
+var _0xaa5d=['./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','body','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','mail','phone','read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','AccountId','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div\x20id=\x22xm-mail-content\x22','<div','headers','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','finally','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','stop','lodash','moment'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xaa5d,0x178));var _0xdaa5=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xaa5d[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0xdaa5('0x0'));var moment=require(_0xdaa5('0x1'));var utils=require(_0xdaa5('0x2'));var logger=require(_0xdaa5('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdaa5('0x4')),'mailMessage':require(_0xdaa5('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xdaa5('0x6')),'whatsappMessage':require(_0xdaa5('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xdaa5('0x8')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xdaa5('0x9'))};var mailRpc=require(_0xdaa5('0xa'));exports['consequence']=function(_0x326545,_0x2f48cd,_0x5ae828,_0x415f85){return function(_0x1402c7){try{var _0x264004=this[_0xdaa5('0xb')];if(_0x264004==='mail'&&_0x415f85[_0xdaa5('0xc')]['isAutoreply']){logger['info'](_0xdaa5('0xd'),_0x326545,_0xdaa5('0xe'));return _0x1402c7[_0xdaa5('0xf')]();}if(_0x2f48cd[0x0]==='1'&&(_[_0xdaa5('0x10')](this[_0xdaa5('0x11')][_0xdaa5('0x12')])||!this[_0xdaa5('0x11')][_0xdaa5('0x12')])){logger['info'](_0xdaa5('0xd'),_0x326545,_0xdaa5('0x13'));return _0x1402c7['next']();}if(_0x2f48cd[0x0]==='2'&&this[_0xdaa5('0x11')][_0xdaa5('0x14')]){logger[_0xdaa5('0x15')](_0xdaa5('0x16'),_0x326545,_0xdaa5('0x17'));return _0x1402c7['next']();}var _0x142afc={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xdaa5('0x18')),'direction':'out'};if(this[_0xdaa5('0xb')]==='mail'){_0x142afc[_0xdaa5('0xc')]=utils[_0xdaa5('0x19')](_0x2f48cd[0x2],this);}else{_0x142afc[_0xdaa5('0xc')]=utils[_0xdaa5('0x19')](_0x2f48cd[0x1],this);}if(this[_0xdaa5('0x1a')]){_0x142afc['to']=this[_0xdaa5('0x1a')][_0xdaa5('0x1b')]||'';if(this['channel']===_0xdaa5('0x1c')&&_0x2f48cd[0x1]==='1'){_0x142afc['cc']=this['message']['cc']||'';}_0x142afc[_0xdaa5('0x1b')]=this[_0xdaa5('0x1a')]['to']||'';_0x142afc[_0xdaa5('0x1d')]=this[_0xdaa5('0x1a')]['phone']||'';_0x142afc[_0xdaa5('0x1e')]=!![];if(this['message'][_0xdaa5('0x1f')]){_0x142afc[_0xdaa5('0x1f')]='';_0x142afc['subject']+=_[_0xdaa5('0x20')](this[_0xdaa5('0x1a')]['subject'],_0xdaa5('0x21'))?'':_0xdaa5('0x22');_0x142afc[_0xdaa5('0x1f')]+=this[_0xdaa5('0x1a')]['subject'];}}if(this[_0xdaa5('0xb')]===_0xdaa5('0x23')){_0x142afc['ChatWebsiteId']=this[_0xdaa5('0x24')]['id'];}else{_0x142afc[_[_0xdaa5('0x25')](this[_0xdaa5('0xb')])+_0xdaa5('0x26')]=this[_0xdaa5('0x24')]['id'];}_0x142afc[_['upperFirst'](this[_0xdaa5('0xb')])+'InteractionId']=this[_0xdaa5('0x11')]['id'];var _0xd3444e=this[_0xdaa5('0x11')];if(rpc[this[_0xdaa5('0xb')]+_0xdaa5('0x27')]){if(this[_0xdaa5('0xb')]===_0xdaa5('0x1c')){_0x142afc[_0xdaa5('0x28')]=this[_0xdaa5('0x1a')][_0xdaa5('0x29')];_0x142afc[_0xdaa5('0x2a')]=_0xdaa5('0x2b')+_['replace'](_0x142afc[_0xdaa5('0xc')],_0xdaa5('0x2c'),_0xdaa5('0x2d'))+'</div>';_0x142afc[_0xdaa5('0x2e')]={'Auto-Submitted':_0xdaa5('0x2f'),'X-Auto-Response-Suppress':_0xdaa5('0x30'),'Precedence':_0xdaa5('0x31')};return mailRpc[_0xdaa5('0x32')](this[_0xdaa5('0x24')][_0xdaa5('0x33')],_0x142afc)[_0xdaa5('0x34')](function(_0x2e0c35){logger[_0xdaa5('0x15')](_0xdaa5('0x35'),_0x326545);_0x142afc[_0xdaa5('0x29')]=_0x2e0c35['message'][_0xdaa5('0x29')];return rpc[_0x264004+_0xdaa5('0x27')][_0xdaa5('0x36')](_0x142afc);})[_0xdaa5('0x34')](function(_0x260d31){logger[_0xdaa5('0x15')]('[%s][AUTOREPLY]\x20%s',_0x326545,JSON[_0xdaa5('0x37')](_0x260d31));})['catch'](function(_0x439700){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x326545,JSON[_0xdaa5('0x37')](_0x439700));})[_0xdaa5('0x38')](function(){Promise['resolve']()[_0xdaa5('0x34')](function(){if(_0x2f48cd[0x0]!=='2'||_0xd3444e['autoreplyExecuted'])return;return rpc[_0x264004+_0xdaa5('0x39')][_0xdaa5('0x3a')](_0xd3444e['id'],{'autoreplyExecuted':!![]})[_0xdaa5('0x34')](function(_0x56c30f){logger[_0xdaa5('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x326545,JSON[_0xdaa5('0x37')](_0x56c30f));})['catch'](function(_0x4b897c){logger[_0xdaa5('0x3b')](_0xdaa5('0x3c'),_0x326545,JSON[_0xdaa5('0x37')](_0x4b897c));});})[_0xdaa5('0x34')](function(){_0x1402c7[_0xdaa5('0xf')]();});});}else{return rpc[this[_0xdaa5('0xb')]+_0xdaa5('0x27')][_0xdaa5('0x36')](_0x142afc)['then'](function(){logger['info'](_0xdaa5('0xd'),_0x326545,_0x142afc[_0xdaa5('0xc')]);})['catch'](function(_0x478eca){logger['error'](_0xdaa5('0xd'),_0x326545,JSON['stringify'](_0x478eca));})[_0xdaa5('0x38')](function(){Promise['resolve']()[_0xdaa5('0x34')](function(){if(_0x2f48cd[0x0]!=='2'||_0xd3444e[_0xdaa5('0x14')])return;return rpc[_0x264004+'Interaction'][_0xdaa5('0x3a')](_0xd3444e['id'],{'autoreplyExecuted':!![]})[_0xdaa5('0x34')](function(_0x122d96){logger[_0xdaa5('0x15')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x326545,JSON['stringify'](_0x122d96));})[_0xdaa5('0x3d')](function(_0x1c505c){logger['error'](_0xdaa5('0x3c'),_0x326545,JSON['stringify'](_0x1c505c));});})[_0xdaa5('0x34')](function(){_0x1402c7['next']();});});}}}catch(_0x4c5efa){logger[_0xdaa5('0x3b')](_0xdaa5('0xd'),_0x326545,JSON[_0xdaa5('0x37')](_0x4c5efa));_0x1402c7[_0xdaa5('0x3e')]();}};};
\ No newline at end of file
index c2a4a81..813ae7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb0=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing'];(function(_0x30817f,_0x487653){var _0x1ec8c1=function(_0xf6bbc9){while(--_0xf6bbc9){_0x30817f['push'](_0x30817f['shift']());}};_0x1ec8c1(++_0x487653);}(_0x6bb0,0x7b));var _0x06bb=function(_0x394b03,_0x3cecf5){_0x394b03=_0x394b03-0x0;var _0x5c420d=_0x6bb0[_0x394b03];return _0x5c420d;};'use strict';var moment=require(_0x06bb('0x0'));var logger=require(_0x06bb('0x1'))(_0x06bb('0x2'));var rpc={'chatInteraction':require(_0x06bb('0x3')),'openchannelInteraction':require(_0x06bb('0x4')),'smsInteraction':require(_0x06bb('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x06bb('0x6'))};exports[_0x06bb('0x7')]=function(_0xa4f207,_0x138ccc,_0x485d34,_0x2d8808){return function(_0x189bf2){try{logger[_0x06bb('0x8')](_0x06bb('0x9'),_0xa4f207,_0x138ccc[0x0]);var _0x4f8c78={'closed':0x1,'closedAt':moment()['format'](_0x06bb('0xa')),'closeReason':'system','disposition':_0x138ccc[0x0]};if(rpc[_0x2d8808[_0x06bb('0xb')]+'Interaction']){rpc[_0x2d8808[_0x06bb('0xb')]+_0x06bb('0xc')][_0x06bb('0xd')](_0x2d8808[_0x06bb('0xe')]['id'],_0x4f8c78)['then'](function(_0x549a54){logger[_0x06bb('0x8')](_0x06bb('0xf'),_0xa4f207,_0x2d8808[_0x06bb('0xe')]['id']);})[_0x06bb('0x10')](function(_0x2e4429){logger[_0x06bb('0x11')]('[%s][CLOSE]\x20%s',_0xa4f207,JSON['stringify'](_0x2e4429));})['finally'](function(){_0x189bf2['stop']();});}}catch(_0x1f708d){logger[_0x06bb('0x11')](_0x06bb('0x12'),_0xa4f207,JSON[_0x06bb('0x13')](_0x1f708d));_0x189bf2[_0x06bb('0x14')]();}};};
\ No newline at end of file
+var _0xfe68=['../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','stringify','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x5523ac,_0x15b2bc){var _0x292fb8=function(_0x45a0e0){while(--_0x45a0e0){_0x5523ac['push'](_0x5523ac['shift']());}};_0x292fb8(++_0x15b2bc);}(_0xfe68,0x122));var _0x8fe6=function(_0x4604ad,_0x2c516e){_0x4604ad=_0x4604ad-0x0;var _0x3ed8ef=_0xfe68[_0x4604ad];return _0x3ed8ef;};'use strict';var moment=require(_0x8fe6('0x0'));var logger=require(_0x8fe6('0x1'))('routing');var rpc={'chatInteraction':require(_0x8fe6('0x2')),'openchannelInteraction':require(_0x8fe6('0x3')),'smsInteraction':require(_0x8fe6('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8fe6('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x8fe6('0x6')]=function(_0x1fb0ec,_0x246119,_0x23d263,_0xe494e9){return function(_0x3de56c){try{logger[_0x8fe6('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x1fb0ec,_0x246119[0x0]);var _0x1cbbaa={'closed':0x1,'closedAt':moment()[_0x8fe6('0x8')](_0x8fe6('0x9')),'closeReason':_0x8fe6('0xa'),'disposition':_0x246119[0x0]};if(rpc[_0xe494e9[_0x8fe6('0xb')]+_0x8fe6('0xc')]){rpc[_0xe494e9[_0x8fe6('0xb')]+_0x8fe6('0xc')][_0x8fe6('0xd')](_0xe494e9[_0x8fe6('0xe')]['id'],_0x1cbbaa)[_0x8fe6('0xf')](function(_0x496401){logger[_0x8fe6('0x7')](_0x8fe6('0x10'),_0x1fb0ec,_0xe494e9[_0x8fe6('0xe')]['id']);})['catch'](function(_0x3e40d0){logger[_0x8fe6('0x11')]('[%s][CLOSE]\x20%s',_0x1fb0ec,JSON[_0x8fe6('0x12')](_0x3e40d0));})['finally'](function(){_0x3de56c[_0x8fe6('0x13')]();});}}catch(_0x503c73){logger[_0x8fe6('0x11')](_0x8fe6('0x14'),_0x1fb0ec,JSON[_0x8fe6('0x12')](_0x503c73));_0x3de56c['stop']();}};};
\ No newline at end of file
index 650a368..c844601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab9f=['channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','body','Message','create','then','info','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out'];(function(_0x3cae04,_0x44456b){var _0x325f6b=function(_0xb1f961){while(--_0xb1f961){_0x3cae04['push'](_0x3cae04['shift']());}};_0x325f6b(++_0x44456b);}(_0xab9f,0x1bd));var _0xfab9=function(_0x69a748,_0x7e2ee1){_0x69a748=_0x69a748-0x0;var _0x116db0=_0xab9f[_0x69a748];return _0x116db0;};'use strict';var _=require(_0xfab9('0x0'));var moment=require('moment');var apiai=require(_0xfab9('0x1'));var md5=require(_0xfab9('0x2'));var utils=require(_0xfab9('0x3'));var logger=require('../../../../config/logger')(_0xfab9('0x4'));var rpc={'chatMessage':require(_0xfab9('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfab9('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfab9('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xfab9('0x8')]=function(_0x341aaf,_0x1918e4){return function(_0x27e769){try{if(!_['isNil'](this[_0xfab9('0x9')][_0xfab9('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x341aaf,_0xfab9('0xb'));return _0x27e769[_0xfab9('0xc')]();}var _0xcc59f9={'ContactId':this[_0xfab9('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xfab9('0xe')};if(this[_0xfab9('0xf')]===_0xfab9('0x10')||this[_0xfab9('0xf')]===_0xfab9('0x11')){_0xcc59f9[_0xfab9('0x12')]=this[_0xfab9('0x9')][_0xfab9('0x12')];}var _0x3a39c0=this[_0xfab9('0xf')];if(_0x3a39c0==='chat'){_0xcc59f9[_0xfab9('0x13')]=this[_0xfab9('0x14')]['id'];}else{_0xcc59f9[_[_0xfab9('0x15')](_0x3a39c0)+_0xfab9('0x16')]=this[_0xfab9('0x14')]['id'];}_0xcc59f9[_[_0xfab9('0x15')](_0x3a39c0)+'InteractionId']=this[_0xfab9('0x9')]['id'];if(this[_0xfab9('0x9')][_0xfab9('0x17')]){var _0x479db4=_0x1918e4[0x2];if(!_['isEmpty'](_0x479db4)){_0xcc59f9[_0xfab9('0x18')]=utils['getMustacheRender'](_0x479db4,this);return rpc[_0x3a39c0+_0xfab9('0x19')][_0xfab9('0x1a')](_0xcc59f9)[_0xfab9('0x1b')](function(_0x41509f){logger[_0xfab9('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x341aaf,_0xcc59f9[_0xfab9('0x18')]);})[_0xfab9('0x1d')](function(_0x3f3180){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x3f3180));})[_0xfab9('0x21')](function(){logger[_0xfab9('0x1c')](_0xfab9('0x22'),_0x341aaf);_0x27e769[_0xfab9('0x23')]();});}else{logger[_0xfab9('0x1c')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x341aaf);_0x27e769[_0xfab9('0x23')]();}}else{var _0x2ba794=this;var _0x39ef03=apiai(_0x1918e4[0x0],{'language':_0x1918e4[0x1]||'en'});return _0x39ef03[_0xfab9('0x24')](this['message'][_0xfab9('0x18')],{'sessionId':md5(this[_0xfab9('0x9')]['id'])})[_0xfab9('0x1b')](function(_0x1dd605){_0x2ba794[_0xfab9('0x18')][_0xfab9('0x25')]=_0x1dd605;_0xcc59f9[_0xfab9('0x18')]=_0x1dd605[_0xfab9('0x26')][_0xfab9('0x27')][_0xfab9('0x28')];_0xcc59f9[_0xfab9('0x29')]=_0xfab9('0x25');_0xcc59f9[_0xfab9('0x2a')]=JSON[_0xfab9('0x20')](_0x1dd605);return rpc[_0x3a39c0+_0xfab9('0x19')][_0xfab9('0x1a')](_0xcc59f9)['then'](function(_0x1bb377){logger[_0xfab9('0x1c')](_0xfab9('0x1f'),_0x341aaf,_0xcc59f9[_0xfab9('0x18')]);if(_0x1dd605['result'][_0xfab9('0x2b')][_0xfab9('0x2c')]){_0x27e769[_0xfab9('0xc')]();}else{_0x27e769[_0xfab9('0x23')]();}})[_0xfab9('0x1d')](function(_0x155440){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x155440));_0x27e769[_0xfab9('0xc')]();});})[_0xfab9('0x1d')](function(_0x34b04e){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,_0x34b04e[_0xfab9('0x2d')]);_0x27e769[_0xfab9('0xc')]();});}}catch(_0x10cca4){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x10cca4));_0x27e769[_0xfab9('0x23')]();}};};
\ No newline at end of file
+var _0x4cfd=['body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','textRequest','message','dialogflow','result','providerResponse','metadata','endConversation','stop','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty'];(function(_0x5dd69b,_0x118e05){var _0x1bc678=function(_0x4ff184){while(--_0x4ff184){_0x5dd69b['push'](_0x5dd69b['shift']());}};_0x1bc678(++_0x118e05);}(_0x4cfd,0x170));var _0xd4cf=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x4cfd[_0x215e65];return _0xa85842;};'use strict';var _=require(_0xd4cf('0x0'));var moment=require(_0xd4cf('0x1'));var apiai=require('apiai-promise');var md5=require(_0xd4cf('0x2'));var utils=require(_0xd4cf('0x3'));var logger=require(_0xd4cf('0x4'))(_0xd4cf('0x5'));var rpc={'chatMessage':require(_0xd4cf('0x6')),'openchannelMessage':require(_0xd4cf('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xd4cf('0x8')),'faxMessage':require(_0xd4cf('0x9')),'whatsappMessage':require(_0xd4cf('0xa'))};exports[_0xd4cf('0xb')]=function(_0x2ebea9,_0x1b5e6f){return function(_0x4c992d){try{if(!_[_0xd4cf('0xc')](this[_0xd4cf('0xd')][_0xd4cf('0xe')])){logger[_0xd4cf('0xf')](_0xd4cf('0x10'),_0x2ebea9,_0xd4cf('0x11'));return _0x4c992d[_0xd4cf('0x12')]();}var _0x4cca5e={'ContactId':this[_0xd4cf('0x13')]['id'],'sentAt':moment()[_0xd4cf('0x14')](_0xd4cf('0x15')),'direction':_0xd4cf('0x16')};if(this[_0xd4cf('0x17')]==='sms'||this['channel']===_0xd4cf('0x18')){_0x4cca5e[_0xd4cf('0x19')]=this['interaction'][_0xd4cf('0x19')];}var _0x539d06=this[_0xd4cf('0x17')];if(_0x539d06==='chat'){_0x4cca5e[_0xd4cf('0x1a')]=this[_0xd4cf('0x1b')]['id'];}else{_0x4cca5e[_['upperFirst'](_0x539d06)+_0xd4cf('0x1c')]=this[_0xd4cf('0x1b')]['id'];}_0x4cca5e[_[_0xd4cf('0x1d')](_0x539d06)+_0xd4cf('0x1e')]=this[_0xd4cf('0xd')]['id'];if(this[_0xd4cf('0xd')]['created']){var _0x3aa40d=_0x1b5e6f[0x2];if(!_[_0xd4cf('0x1f')](_0x3aa40d)){_0x4cca5e[_0xd4cf('0x20')]=utils[_0xd4cf('0x21')](_0x3aa40d,this);return rpc[_0x539d06+_0xd4cf('0x22')][_0xd4cf('0x23')](_0x4cca5e)[_0xd4cf('0x24')](function(_0x1df3e0){logger[_0xd4cf('0xf')](_0xd4cf('0x10'),_0x2ebea9,_0x4cca5e[_0xd4cf('0x20')]);})[_0xd4cf('0x25')](function(_0x32c249){logger[_0xd4cf('0x26')](_0xd4cf('0x10'),_0x2ebea9,JSON[_0xd4cf('0x27')](_0x32c249));})[_0xd4cf('0x28')](function(){logger[_0xd4cf('0xf')](_0xd4cf('0x29'),_0x2ebea9);_0x4c992d['stop']();});}else{logger[_0xd4cf('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2ebea9);_0x4c992d['stop']();}}else{var _0x10f6a7=this;var _0x3dbe6d=apiai(_0x1b5e6f[0x0],{'language':_0x1b5e6f[0x1]||'en'});return _0x3dbe6d[_0xd4cf('0x2a')](this[_0xd4cf('0x2b')][_0xd4cf('0x20')],{'sessionId':md5(this[_0xd4cf('0xd')]['id'])})['then'](function(_0x14c159){_0x10f6a7['body'][_0xd4cf('0x2c')]=_0x14c159;_0x4cca5e[_0xd4cf('0x20')]=_0x14c159[_0xd4cf('0x2d')]['fulfillment']['speech'];_0x4cca5e['providerName']=_0xd4cf('0x2c');_0x4cca5e[_0xd4cf('0x2e')]=JSON['stringify'](_0x14c159);return rpc[_0x539d06+'Message']['create'](_0x4cca5e)[_0xd4cf('0x24')](function(_0x5a3962){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x2ebea9,_0x4cca5e[_0xd4cf('0x20')]);if(_0x14c159['result'][_0xd4cf('0x2f')][_0xd4cf('0x30')]){_0x4c992d[_0xd4cf('0x12')]();}else{_0x4c992d[_0xd4cf('0x31')]();}})[_0xd4cf('0x25')](function(_0x2183c1){logger[_0xd4cf('0x26')](_0xd4cf('0x10'),_0x2ebea9,JSON['stringify'](_0x2183c1));_0x4c992d[_0xd4cf('0x12')]();});})[_0xd4cf('0x25')](function(_0x155f50){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2ebea9,_0x155f50[_0xd4cf('0x2b')]);_0x4c992d[_0xd4cf('0x12')]();});}}catch(_0x37b387){logger[_0xd4cf('0x26')](_0xd4cf('0x10'),_0x2ebea9,JSON[_0xd4cf('0x27')](_0x37b387));_0x4c992d[_0xd4cf('0x31')]();}};};
\ No newline at end of file
index 828207c..d465479 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b98=['DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerName','fulfillmentText','push','all','stop','lodash','dialogflow','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','body','stringify','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','catch','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x4b98,0x186));var _0x84b9=function(_0x402075,_0x567fe4){_0x402075=_0x402075-0x0;var _0x2e87b3=_0x4b98[_0x402075];return _0x2e87b3;};'use strict';var _=require(_0x84b9('0x0'));var dialogflow=require(_0x84b9('0x1'));var md5=require('md5');var moment=require(_0x84b9('0x2'));var Promise=require(_0x84b9('0x3'));var logger=require('../../../../config/logger')(_0x84b9('0x4'));var utils=require(_0x84b9('0x5'));var rpc={'chatMessage':require(_0x84b9('0x6')),'openchannelMessage':require(_0x84b9('0x7')),'mailMessage':require(_0x84b9('0x8')),'smsMessage':require(_0x84b9('0x9')),'faxMessage':require(_0x84b9('0xa')),'whatsappMessage':require(_0x84b9('0xb'))};function createMessage(_0x155250,_0xa652d1,_0x3dd09d,_0x24ce8b){return new Promise(function(_0x3e96f4,_0x311703){var _0x38fa9c=_[_0x84b9('0xc')](_0x3dd09d);_0x38fa9c['body']=_0x24ce8b;return rpc[_0xa652d1+_0x84b9('0xd')][_0x84b9('0xe')](_0x38fa9c)[_0x84b9('0xf')](function(){logger[_0x84b9('0x10')](_0x84b9('0x11'),_0x155250,_0x38fa9c[_0x84b9('0x12')]);_0x3e96f4();})['catch'](function(_0x1d9886){logger['error'](_0x84b9('0x11'),_0x155250,JSON[_0x84b9('0x13')](_0x1d9886));_0x311703(_0x1d9886);});});}exports[_0x84b9('0x14')]=function(_0x2c10da,_0x2fb9f2){return function(_0x39f6b0){try{if(!_[_0x84b9('0x15')](this[_0x84b9('0x16')][_0x84b9('0x17')])){logger[_0x84b9('0x10')](_0x84b9('0x11'),_0x2c10da,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x39f6b0[_0x84b9('0x18')]();}var _0x2fa957={'ContactId':this[_0x84b9('0x19')]['id'],'sentAt':moment()[_0x84b9('0x1a')](_0x84b9('0x1b')),'direction':_0x84b9('0x1c')};if(this[_0x84b9('0x1d')]===_0x84b9('0x1e')||this[_0x84b9('0x1d')]===_0x84b9('0x1f')){_0x2fa957[_0x84b9('0x20')]=this[_0x84b9('0x16')][_0x84b9('0x20')];}var _0x1c206e=this[_0x84b9('0x1d')];if(_0x1c206e==='chat'){_0x2fa957[_0x84b9('0x21')]=this['account']['id'];}else{_0x2fa957[_[_0x84b9('0x22')](_0x1c206e)+_0x84b9('0x23')]=this[_0x84b9('0x24')]['id'];}_0x2fa957[_[_0x84b9('0x22')](_0x1c206e)+_0x84b9('0x25')]=this[_0x84b9('0x16')]['id'];if(this['interaction'][_0x84b9('0x26')]){var _0xc3d745=_0x2fb9f2[0x4];if(!_[_0x84b9('0x27')](_0xc3d745)){_0x2fa957[_0x84b9('0x12')]=utils[_0x84b9('0x28')](_0xc3d745,this);return rpc[_0x1c206e+'Message'][_0x84b9('0xe')](_0x2fa957)[_0x84b9('0xf')](function(_0x42c290){logger[_0x84b9('0x10')](_0x84b9('0x11'),_0x2c10da,_0x2fa957[_0x84b9('0x12')]);})[_0x84b9('0x29')](function(_0x2a0a64){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,JSON[_0x84b9('0x13')](_0x2a0a64));})[_0x84b9('0x2b')](function(){logger[_0x84b9('0x10')](_0x84b9('0x2c'),_0x2c10da);_0x39f6b0['stop']();});}else{logger[_0x84b9('0x10')](_0x84b9('0x2d'),_0x2c10da);_0x39f6b0['stop']();}}else{var _0x4bcf3f=this;var _0x1b9640=_0x2fb9f2[0x2]['replace'](/\\n/g,'\x0a');var _0x2d356d={'credentials':{'private_key':_0x1b9640,'client_email':_0x2fb9f2[0x1]}};var _0x3c9b52=new dialogflow['SessionsClient'](_0x2d356d);var _0x228419=_0x3c9b52[_0x84b9('0x2e')](_0x2fb9f2[0x0],md5(_0x4bcf3f[_0x84b9('0x16')]['id']));var _0x437394={'session':_0x228419,'queryInput':{'text':{'text':_0x4bcf3f[_0x84b9('0x2f')][_0x84b9('0x12')],'languageCode':_0x2fb9f2[0x3]||'en'}}};return _0x3c9b52[_0x84b9('0x30')](_0x437394)['then'](function(_0x92f21){if(_0x92f21&&_0x92f21[_0x84b9('0x31')]){_0x4bcf3f['body'][_0x84b9('0x32')]=_0x92f21;var _0x3bb3c2=_0x92f21[0x0];var _0x54d638=_0x3bb3c2[_0x84b9('0x33')]['diagnosticInfo']&&_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x34')][_0x84b9('0x35')]?_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x34')]['fields']['end_conversation'][_0x84b9('0x36')]:![];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x37')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x38')];_0x4bcf3f[_0x84b9('0x12')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x39')];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x3a')]=_0x3bb3c2['queryResult'][_0x84b9('0x34')]&&_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x34')][_0x84b9('0x35')]?_0x3bb3c2['queryResult']['diagnosticInfo'][_0x84b9('0x35')][_0x84b9('0x3b')][_0x84b9('0x36')]:![];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x3c')]=_0x3bb3c2['queryResult'][_0x84b9('0x3d')][_0x84b9('0x3e')];_0x4bcf3f[_0x84b9('0x12')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x3d')][_0x84b9('0x3f')];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x40')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x3d')][_0x84b9('0x41')];_0x4bcf3f['body'][_0x84b9('0x42')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x43')];_0x4bcf3f[_0x84b9('0x12')][_0x84b9('0x44')]=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x45')];_0x4bcf3f[_0x84b9('0x12')]['DIALOGFLOWV2_SCORE']=_0x3bb3c2[_0x84b9('0x33')][_0x84b9('0x46')];_0x2fa957[_0x84b9('0x47')]=_0x84b9('0x32');_0x2fa957['providerResponse']=JSON[_0x84b9('0x13')](_0x92f21);var _0xf5ed55=[];for(var _0x5614a0=0x0;_0x5614a0<_0x92f21[_0x84b9('0x31')];_0x5614a0++){var _0xccc6c7=_0x92f21[_0x5614a0];if(_0xccc6c7&&_0xccc6c7[_0x84b9('0x33')]&&_0xccc6c7[_0x84b9('0x33')][_0x84b9('0x48')]){_0xf5ed55[_0x84b9('0x49')](createMessage(_0x2c10da,_0x1c206e,_0x2fa957,_0xccc6c7[_0x84b9('0x33')][_0x84b9('0x48')]));}}return Promise[_0x84b9('0x4a')](_0xf5ed55)[_0x84b9('0xf')](function(){if(_0x54d638){_0x39f6b0[_0x84b9('0x18')]();}else{_0x39f6b0['stop']();}})['catch'](function(_0x169bfc){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,JSON[_0x84b9('0x13')](_0x169bfc));_0x39f6b0['next']();});}})[_0x84b9('0x29')](function(_0x362926){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,_0x362926['message']);_0x39f6b0['next']();});}}catch(_0x58446f){logger[_0x84b9('0x2a')](_0x84b9('0x11'),_0x2c10da,JSON[_0x84b9('0x13')](_0x58446f));_0x39f6b0[_0x84b9('0x4b')]();}};};
\ No newline at end of file
+var _0xa22a=['channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','create','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','boolValue','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','body','Message','then','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out'];(function(_0x12d48d,_0x4c060b){var _0x4503da=function(_0x1e80b4){while(--_0x1e80b4){_0x12d48d['push'](_0x12d48d['shift']());}};_0x4503da(++_0x4c060b);}(_0xa22a,0x153));var _0xaa22=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa22a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xaa22('0x0'));var dialogflow=require(_0xaa22('0x1'));var md5=require(_0xaa22('0x2'));var moment=require(_0xaa22('0x3'));var Promise=require(_0xaa22('0x4'));var logger=require('../../../../config/logger')(_0xaa22('0x5'));var utils=require(_0xaa22('0x6'));var rpc={'chatMessage':require(_0xaa22('0x7')),'openchannelMessage':require(_0xaa22('0x8')),'mailMessage':require(_0xaa22('0x9')),'smsMessage':require(_0xaa22('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xaa22('0xb'))};function createMessage(_0x4b03ae,_0x45b092,_0x2a556a,_0x145ae0){return new Promise(function(_0x2136d6,_0x57572d){var _0x3544a1=_['clone'](_0x2a556a);_0x3544a1[_0xaa22('0xc')]=_0x145ae0;return rpc[_0x45b092+_0xaa22('0xd')]['create'](_0x3544a1)[_0xaa22('0xe')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x4b03ae,_0x3544a1[_0xaa22('0xc')]);_0x2136d6();})['catch'](function(_0x449289){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x4b03ae,JSON[_0xaa22('0x11')](_0x449289));_0x57572d(_0x449289);});});}exports[_0xaa22('0x12')]=function(_0x40dffc,_0x82ec35){return function(_0x2e2c54){try{if(!_[_0xaa22('0x13')](this[_0xaa22('0x14')]['UserId'])){logger[_0xaa22('0x15')](_0xaa22('0x10'),_0x40dffc,_0xaa22('0x16'));return _0x2e2c54[_0xaa22('0x17')]();}var _0x1c56d3={'ContactId':this[_0xaa22('0x18')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xaa22('0x19')};if(this[_0xaa22('0x1a')]===_0xaa22('0x1b')||this[_0xaa22('0x1a')]===_0xaa22('0x1c')){_0x1c56d3[_0xaa22('0x1d')]=this['interaction']['phone'];}var _0x227a50=this[_0xaa22('0x1a')];if(_0x227a50===_0xaa22('0x1e')){_0x1c56d3[_0xaa22('0x1f')]=this[_0xaa22('0x20')]['id'];}else{_0x1c56d3[_[_0xaa22('0x21')](_0x227a50)+_0xaa22('0x22')]=this[_0xaa22('0x20')]['id'];}_0x1c56d3[_[_0xaa22('0x21')](_0x227a50)+_0xaa22('0x23')]=this[_0xaa22('0x14')]['id'];if(this[_0xaa22('0x14')][_0xaa22('0x24')]){var _0x2da6df=_0x82ec35[0x4];if(!_[_0xaa22('0x25')](_0x2da6df)){_0x1c56d3['body']=utils[_0xaa22('0x26')](_0x2da6df,this);return rpc[_0x227a50+_0xaa22('0xd')][_0xaa22('0x27')](_0x1c56d3)[_0xaa22('0xe')](function(_0x343f81){logger[_0xaa22('0x15')](_0xaa22('0x10'),_0x40dffc,_0x1c56d3[_0xaa22('0xc')]);})[_0xaa22('0x28')](function(_0x3cc867){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,JSON[_0xaa22('0x11')](_0x3cc867));})[_0xaa22('0x29')](function(){logger['info'](_0xaa22('0x2a'),_0x40dffc);_0x2e2c54[_0xaa22('0x2b')]();});}else{logger['info'](_0xaa22('0x2c'),_0x40dffc);_0x2e2c54[_0xaa22('0x2b')]();}}else{var _0x5132d4=this;var _0xcfaffa=_0x82ec35[0x2][_0xaa22('0x2d')](/\\n/g,'\x0a');var _0x5e4681={'credentials':{'private_key':_0xcfaffa,'client_email':_0x82ec35[0x1]}};var _0x4e3267=new dialogflow[(_0xaa22('0x2e'))](_0x5e4681);var _0x5b5104=_0x4e3267[_0xaa22('0x2f')](_0x82ec35[0x0],md5(_0x5132d4['interaction']['id']));var _0x490160={'session':_0x5b5104,'queryInput':{'text':{'text':_0x5132d4[_0xaa22('0x30')]['body'],'languageCode':_0x82ec35[0x3]||'en'}}};return _0x4e3267['detectIntent'](_0x490160)[_0xaa22('0xe')](function(_0x5aeae1){if(_0x5aeae1&&_0x5aeae1['length']){_0x5132d4['body'][_0xaa22('0x31')]=_0x5aeae1;var _0x31a245=_0x5aeae1[0x0];var _0x58b829=_0x31a245[_0xaa22('0x32')]['diagnosticInfo']&&_0x31a245['queryResult'][_0xaa22('0x33')][_0xaa22('0x34')]?_0x31a245[_0xaa22('0x32')][_0xaa22('0x33')][_0xaa22('0x34')][_0xaa22('0x35')]['boolValue']:![];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x36')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x37')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x38')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x39')];_0x5132d4['body']['DIALOGFLOWV2_ENDCONVERSATION']=_0x31a245[_0xaa22('0x32')]['diagnosticInfo']&&_0x31a245[_0xaa22('0x32')][_0xaa22('0x33')][_0xaa22('0x34')]?_0x31a245[_0xaa22('0x32')][_0xaa22('0x33')][_0xaa22('0x34')][_0xaa22('0x35')][_0xaa22('0x3a')]:![];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x3b')]=_0x31a245[_0xaa22('0x32')]['intent'][_0xaa22('0x3c')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x3d')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x3e')][_0xaa22('0x3f')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x40')]=_0x31a245[_0xaa22('0x32')]['intent'][_0xaa22('0x41')];_0x5132d4['body'][_0xaa22('0x42')]=_0x31a245[_0xaa22('0x32')]['languageCode'];_0x5132d4['body'][_0xaa22('0x43')]=_0x31a245[_0xaa22('0x32')][_0xaa22('0x44')];_0x5132d4[_0xaa22('0xc')][_0xaa22('0x45')]=_0x31a245[_0xaa22('0x32')]['intentDetectionConfidence'];_0x1c56d3['providerName']=_0xaa22('0x31');_0x1c56d3['providerResponse']=JSON[_0xaa22('0x11')](_0x5aeae1);var _0x18fc90=[];for(var _0x520a3=0x0;_0x520a3<_0x5aeae1['length'];_0x520a3++){var _0x48c957=_0x5aeae1[_0x520a3];if(_0x48c957&&_0x48c957[_0xaa22('0x32')]&&_0x48c957[_0xaa22('0x32')][_0xaa22('0x46')]){_0x18fc90[_0xaa22('0x47')](createMessage(_0x40dffc,_0x227a50,_0x1c56d3,_0x48c957[_0xaa22('0x32')][_0xaa22('0x46')]));}}return Promise[_0xaa22('0x48')](_0x18fc90)['then'](function(){if(_0x58b829){_0x2e2c54[_0xaa22('0x17')]();}else{_0x2e2c54['stop']();}})[_0xaa22('0x28')](function(_0x517e42){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,JSON[_0xaa22('0x11')](_0x517e42));_0x2e2c54['next']();});}})[_0xaa22('0x28')](function(_0x5d6003){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,_0x5d6003[_0xaa22('0x30')]);_0x2e2c54[_0xaa22('0x17')]();});}}catch(_0x49fdbe){logger[_0xaa22('0xf')](_0xaa22('0x10'),_0x40dffc,JSON[_0xaa22('0x11')](_0x49fdbe));_0x2e2c54['stop']();}};};
\ No newline at end of file
index 7c550d9..59e7b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8838=['lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','[%s][GOTOIF]\x20%s','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','next','error','stringify'];(function(_0x388794,_0x443c2a){var _0x51b475=function(_0x5641ad){while(--_0x5641ad){_0x388794['push'](_0x388794['shift']());}};_0x51b475(++_0x443c2a);}(_0x8838,0xa8));var _0x8883=function(_0x5d6085,_0x1a5a81){_0x5d6085=_0x5d6085-0x0;var _0x750d19=_0x8838[_0x5d6085];return _0x750d19;};'use strict';var schema=require('validate');var _=require(_0x8883('0x0'));var htmlToText=require(_0x8883('0x1'));var utils=require(_0x8883('0x2'));var logger=require(_0x8883('0x3'))(_0x8883('0x4'));var gotoif=schema({'condition':{'type':_0x8883('0x5'),'required':!![],'message':_0x8883('0x6')},'priorityTrue':{'type':_0x8883('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x8883('0x7'),'message':_0x8883('0x8')}});exports[_0x8883('0x9')]=function(_0x4c790d,_0x571dff){return function(_0x2691c8){try{var _0x2e343f={'condition':htmlToText[_0x8883('0xa')](utils['getMustacheRender'](_0x571dff[0x0],this),{'wordwrap':![]})[_0x8883('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x571dff[0x1],'priorityFalse':_0x571dff[0x2]};var _0x210500=gotoif['validate'](_0x2e343f,{'typecast':!![]});if(_0x210500['length']){logger['error'](_0x8883('0xc'),_0x4c790d,_['map'](_0x210500,_0x8883('0xd'))['join'](',\x20'));_0x2691c8[_0x8883('0xe')]();}else{try{var _0x2f654c=eval('('+_0x2e343f[_0x8883('0xf')]+')');var _0x424690=_0x2f654c?_0x2e343f[_0x8883('0x10')]:_0x2e343f[_0x8883('0x11')];logger[_0x8883('0x12')](_0x8883('0x13'),_0x4c790d,_0x2e343f[_0x8883('0xf')],_0x2f654c,_0x424690||'next');if(_0x424690){var _0xb47786=_[_0x8883('0x14')](_0x2691c8['rules'](),{'p':_0x424690});if(_0xb47786>=0x0){logger[_0x8883('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4c790d,_0x424690||_0x8883('0x15'),_0xb47786);_0x2691c8[_0x8883('0x15')](_0xb47786);}else{logger[_0x8883('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x4c790d,_0x424690||_0x8883('0x15'));_0x2691c8[_0x8883('0xe')]();}}else{_0x2691c8[_0x8883('0x15')]();}}catch(_0x1db505){logger[_0x8883('0x16')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4c790d,_0x1db505[_0x8883('0xd')]);_0x2691c8[_0x8883('0xe')]();}}}catch(_0x269077){logger[_0x8883('0x16')](_0x8883('0xc'),_0x4c790d,JSON[_0x8883('0x17')](_0x269077));_0x2691c8['stop']();}};};
\ No newline at end of file
+var _0xeb54=['[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found'];(function(_0x1510e4,_0x1613e0){var _0xe0f3a9=function(_0x1af25f){while(--_0x1af25f){_0x1510e4['push'](_0x1510e4['shift']());}};_0xe0f3a9(++_0x1613e0);}(_0xeb54,0x14c));var _0x4eb5=function(_0x25534e,_0x316818){_0x25534e=_0x25534e-0x0;var _0x13e366=_0xeb54[_0x25534e];return _0x13e366;};'use strict';var schema=require(_0x4eb5('0x0'));var _=require(_0x4eb5('0x1'));var htmlToText=require(_0x4eb5('0x2'));var utils=require('./utils');var logger=require(_0x4eb5('0x3'))(_0x4eb5('0x4'));var gotoif=schema({'condition':{'type':_0x4eb5('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x4eb5('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4eb5('0x6'),'message':_0x4eb5('0x7')}});exports[_0x4eb5('0x8')]=function(_0x20cd2a,_0x4f0a4c){return function(_0x3e5ef8){try{var _0x20adb9={'condition':htmlToText[_0x4eb5('0x9')](utils[_0x4eb5('0xa')](_0x4f0a4c[0x0],this),{'wordwrap':![]})[_0x4eb5('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4f0a4c[0x1],'priorityFalse':_0x4f0a4c[0x2]};var _0x59d83d=gotoif[_0x4eb5('0x0')](_0x20adb9,{'typecast':!![]});if(_0x59d83d[_0x4eb5('0xc')]){logger[_0x4eb5('0xd')](_0x4eb5('0xe'),_0x20cd2a,_[_0x4eb5('0xf')](_0x59d83d,_0x4eb5('0x10'))[_0x4eb5('0x11')](',\x20'));_0x3e5ef8[_0x4eb5('0x12')]();}else{try{var _0x172a45=eval('('+_0x20adb9[_0x4eb5('0x13')]+')');var _0x3dd77c=_0x172a45?_0x20adb9[_0x4eb5('0x14')]:_0x20adb9[_0x4eb5('0x15')];logger[_0x4eb5('0x16')](_0x4eb5('0x17'),_0x20cd2a,_0x20adb9['condition'],_0x172a45,_0x3dd77c||_0x4eb5('0x18'));if(_0x3dd77c){var _0x5d7fba=_[_0x4eb5('0x19')](_0x3e5ef8['rules'](),{'p':_0x3dd77c});if(_0x5d7fba>=0x0){logger['info'](_0x4eb5('0x1a'),_0x20cd2a,_0x3dd77c||_0x4eb5('0x18'),_0x5d7fba);_0x3e5ef8[_0x4eb5('0x18')](_0x5d7fba);}else{logger[_0x4eb5('0x16')](_0x4eb5('0x1b'),_0x20cd2a,_0x3dd77c||_0x4eb5('0x18'));_0x3e5ef8['stop']();}}else{_0x3e5ef8['next']();}}catch(_0x1a2a69){logger['error'](_0x4eb5('0x1c'),_0x20cd2a,_0x1a2a69[_0x4eb5('0x10')]);_0x3e5ef8['stop']();}}}catch(_0x30188d){logger[_0x4eb5('0xd')]('[%s][GOTOIF]\x20%s',_0x20cd2a,JSON[_0x4eb5('0x1d')](_0x30188d));_0x3e5ef8[_0x4eb5('0x12')]();}};};
\ No newline at end of file
index 0b276a7..2d14d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f5f=['[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x7f5f,0x1e2));var _0xf7f5=function(_0x3b1da4,_0x1ba706){_0x3b1da4=_0x3b1da4-0x0;var _0x2dba6d=_0x7f5f[_0x3b1da4];return _0x2dba6d;};'use strict';var schema=require(_0xf7f5('0x0'));var _=require(_0xf7f5('0x1'));var logger=require(_0xf7f5('0x2'))(_0xf7f5('0x3'));var gotop=schema({'priority':{'type':_0xf7f5('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xf7f5('0x5')]=function(_0x1e0981,_0x23d5cb){return function(_0x23a13c){try{var _0x1097aa={'priority':_0x23d5cb[0x0]};var _0x887688=gotop['validate'](_0x1097aa,{'typecast':!![]});if(_0x887688[_0xf7f5('0x6')]){logger[_0xf7f5('0x7')](_0xf7f5('0x8'),_0x1e0981,_['map'](_0x887688,_0xf7f5('0x9'))[_0xf7f5('0xa')](',\x20'));_0x23a13c[_0xf7f5('0xb')]();}else{logger[_0xf7f5('0xc')](_0xf7f5('0xd'),_0x1e0981,_0x1097aa[_0xf7f5('0xe')]);if(_0x1097aa[_0xf7f5('0xe')]){var _0x38a783=_[_0xf7f5('0xf')](_0x23a13c[_0xf7f5('0x10')](),{'p':_0x1097aa[_0xf7f5('0xe')]});if(_0x38a783>=0x0){logger[_0xf7f5('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1e0981,_0x1097aa[_0xf7f5('0xe')]||_0xf7f5('0x11'),_0x38a783);_0x23a13c[_0xf7f5('0x11')](_0x38a783);}else{logger[_0xf7f5('0xc')](_0xf7f5('0x12'),_0x1e0981,_0x1097aa[_0xf7f5('0xe')]||_0xf7f5('0x11'));_0x23a13c[_0xf7f5('0xb')]();}}else{_0x23a13c['next']();}}}catch(_0x52054d){logger[_0xf7f5('0x7')](_0xf7f5('0x8'),_0x1e0981,JSON[_0xf7f5('0x13')](_0x52054d));_0x23a13c['stop']();}};};
\ No newline at end of file
+var _0x3cf9=['info','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','error','stringify','validate','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','[%s][GOTOP]\x20%s','map','message','join'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x3cf9,0xd3));var _0x93cf=function(_0x1aef20,_0x4173f){_0x1aef20=_0x1aef20-0x0;var _0x216604=_0x3cf9[_0x1aef20];return _0x216604;};'use strict';var schema=require(_0x93cf('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')(_0x93cf('0x1'));var gotop=schema({'priority':{'type':_0x93cf('0x2'),'required':!![],'message':_0x93cf('0x3')}});exports[_0x93cf('0x4')]=function(_0x43d755,_0x1dc40a){return function(_0x14a52b){try{var _0x9e14d1={'priority':_0x1dc40a[0x0]};var _0x2c4881=gotop[_0x93cf('0x0')](_0x9e14d1,{'typecast':!![]});if(_0x2c4881[_0x93cf('0x5')]){logger['error'](_0x93cf('0x6'),_0x43d755,_[_0x93cf('0x7')](_0x2c4881,_0x93cf('0x8'))[_0x93cf('0x9')](',\x20'));_0x14a52b['stop']();}else{logger[_0x93cf('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x43d755,_0x9e14d1[_0x93cf('0xb')]);if(_0x9e14d1[_0x93cf('0xb')]){var _0x5170de=_['findIndex'](_0x14a52b['rules'](),{'p':_0x9e14d1[_0x93cf('0xb')]});if(_0x5170de>=0x0){logger[_0x93cf('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x43d755,_0x9e14d1[_0x93cf('0xb')]||_0x93cf('0xc'),_0x5170de);_0x14a52b['next'](_0x5170de);}else{logger[_0x93cf('0xa')](_0x93cf('0xd'),_0x43d755,_0x9e14d1[_0x93cf('0xb')]||_0x93cf('0xc'));_0x14a52b[_0x93cf('0xe')]();}}else{_0x14a52b['next']();}}}catch(_0x9add20){logger[_0x93cf('0xf')](_0x93cf('0x6'),_0x43d755,JSON[_0x93cf('0x10')](_0x9add20));_0x14a52b[_0x93cf('0xe')]();}};};
\ No newline at end of file
index ae97019..a0f4a94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac7a=['next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','body'];(function(_0x5e7514,_0x30c2e1){var _0x12f472=function(_0x33ddb6){while(--_0x33ddb6){_0x5e7514['push'](_0x5e7514['shift']());}};_0x12f472(++_0x30c2e1);}(_0xac7a,0x128));var _0xaac7=function(_0x400eb4,_0x229c79){_0x400eb4=_0x400eb4-0x0;var _0x544f8e=_0xac7a[_0x400eb4];return _0x544f8e;};'use strict';var _=require(_0xaac7('0x0'));var utils=require(_0xaac7('0x1'));var logger=require(_0xaac7('0x2'))(_0xaac7('0x3'));var rpc={'chatMessage':require(_0xaac7('0x4')),'openchannelMessage':require(_0xaac7('0x5')),'mailMessage':require(_0xaac7('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xaac7('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xaac7('0x8')]=function(_0x1bcbe0,_0x4264b2){return function(_0x3be7be){try{var _0x2239bc={'body':utils[_0xaac7('0x9')](_0x4264b2[0x0],this),'ContactId':this[_0xaac7('0xa')]['id']};if(this[_0xaac7('0xb')]===_0xaac7('0xc')){_0x2239bc[_0xaac7('0xd')]=this[_0xaac7('0xe')]['id'];}else{_0x2239bc[_[_0xaac7('0xf')](this[_0xaac7('0xb')])+_0xaac7('0x10')]=this[_0xaac7('0xe')]['id'];}_0x2239bc[_[_0xaac7('0xf')](this[_0xaac7('0xb')])+_0xaac7('0x11')]=this[_0xaac7('0x12')]['id'];if(rpc[this[_0xaac7('0xb')]+_0xaac7('0x13')]){return rpc[this['channel']+_0xaac7('0x13')][_0xaac7('0x14')](_0x2239bc)[_0xaac7('0x15')](function(_0xe50e0){logger['info']('[%s][MESSAGE]\x20%s',_0x1bcbe0,_0x2239bc[_0xaac7('0x16')]);_0x3be7be[_0xaac7('0x17')]();})[_0xaac7('0x18')](function(_0x1f6e62){logger[_0xaac7('0x19')](_0xaac7('0x1a'),_0x1bcbe0,JSON[_0xaac7('0x1b')](_0x1f6e62));_0x3be7be[_0xaac7('0x1c')]();});}}catch(_0x5d4833){logger[_0xaac7('0x19')]('[%s][MESSAGE]\x20%s',_0x1bcbe0,JSON[_0xaac7('0x1b')](_0x5d4833));_0x3be7be['stop']();}};};
\ No newline at end of file
+var _0x5216=['info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/faxMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then'];(function(_0x64a5fd,_0x4973a6){var _0x267481=function(_0x40c058){while(--_0x40c058){_0x64a5fd['push'](_0x64a5fd['shift']());}};_0x267481(++_0x4973a6);}(_0x5216,0x165));var _0x6521=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5216[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var utils=require(_0x6521('0x0'));var logger=require(_0x6521('0x1'))(_0x6521('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6521('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6521('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x6521('0x5')]=function(_0x3023bf,_0x52053c){return function(_0x7c46f8){try{var _0x54ebf2={'body':utils[_0x6521('0x6')](_0x52053c[0x0],this),'ContactId':this['contact']['id']};if(this[_0x6521('0x7')]===_0x6521('0x8')){_0x54ebf2[_0x6521('0x9')]=this[_0x6521('0xa')]['id'];}else{_0x54ebf2[_[_0x6521('0xb')](this[_0x6521('0x7')])+_0x6521('0xc')]=this[_0x6521('0xa')]['id'];}_0x54ebf2[_['upperFirst'](this['channel'])+_0x6521('0xd')]=this[_0x6521('0xe')]['id'];if(rpc[this[_0x6521('0x7')]+_0x6521('0xf')]){return rpc[this[_0x6521('0x7')]+_0x6521('0xf')][_0x6521('0x10')](_0x54ebf2)[_0x6521('0x11')](function(_0x40abac){logger[_0x6521('0x12')](_0x6521('0x13'),_0x3023bf,_0x54ebf2[_0x6521('0x14')]);_0x7c46f8[_0x6521('0x15')]();})['catch'](function(_0x26c746){logger[_0x6521('0x16')](_0x6521('0x13'),_0x3023bf,JSON[_0x6521('0x17')](_0x26c746));_0x7c46f8[_0x6521('0x18')]();});}}catch(_0x28711d){logger[_0x6521('0x16')](_0x6521('0x13'),_0x3023bf,JSON[_0x6521('0x17')](_0x28711d));_0x7c46f8[_0x6521('0x18')]();}};};
\ No newline at end of file
index b55648b..0f9ec13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe73=['next','stop','./utils','../../../../config/logger','routing','consequence','info'];(function(_0x1cec84,_0x101ec2){var _0x12b7d3=function(_0x9679d8){while(--_0x9679d8){_0x1cec84['push'](_0x1cec84['shift']());}};_0x12b7d3(++_0x101ec2);}(_0xfe73,0x12f));var _0x3fe7=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xfe73[_0x5a9c0c];return _0x53c77d;};'use strict';var utils=require(_0x3fe7('0x0'));var logger=require(_0x3fe7('0x1'))(_0x3fe7('0x2'));exports[_0x3fe7('0x3')]=function(_0x53a864,_0x5540b4){return function(_0x32ec33){try{logger[_0x3fe7('0x4')]('[%s][NOOP]\x20%s',_0x53a864,utils['getMustacheRender'](_0x5540b4[0x0],this));_0x32ec33[_0x3fe7('0x5')]();}catch(_0x560fd4){logger['error']('[%s][NOOP]\x20%s',_0x53a864,JSON['stringify'](_0x560fd4));_0x32ec33[_0x3fe7('0x6')]();}};};
\ No newline at end of file
+var _0x4a84=['../../../../config/logger','routing','consequence','info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','./utils'];(function(_0xe3e180,_0x517cdc){var _0x2b6435=function(_0x46f198){while(--_0x46f198){_0xe3e180['push'](_0xe3e180['shift']());}};_0x2b6435(++_0x517cdc);}(_0x4a84,0x12b));var _0x44a8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4a84[_0xa464c9];return _0x3d73c4;};'use strict';var utils=require(_0x44a8('0x0'));var logger=require(_0x44a8('0x1'))(_0x44a8('0x2'));exports[_0x44a8('0x3')]=function(_0x142c29,_0x6bb3fa){return function(_0xa40ec7){try{logger[_0x44a8('0x4')]('[%s][NOOP]\x20%s',_0x142c29,utils[_0x44a8('0x5')](_0x6bb3fa[0x0],this));_0xa40ec7[_0x44a8('0x6')]();}catch(_0x28c8f2){logger[_0x44a8('0x7')](_0x44a8('0x8'),_0x142c29,JSON[_0x44a8('0x9')](_0x28c8f2));_0xa40ec7['stop']();}};};
\ No newline at end of file
index 1dd79c8..0fb4015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe336=['map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue','from','joinAt','clone','queue_id','account','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','save','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','list','QueueId','upperFirst','channel','interaction','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','waiting','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','length','[%s][QUEUE]\x20%s'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xe336,0xf7));var _0x6e33=function(_0x56c7ae,_0x94d752){_0x56c7ae=_0x56c7ae-0x0;var _0x478cba=_0xe336[_0x56c7ae];return _0x478cba;};'use strict';var schema=require(_0x6e33('0x0'));var _=require(_0x6e33('0x1'));var util=require(_0x6e33('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x6e33('0x3'));var Redis=require(_0x6e33('0x4'));var config=require(_0x6e33('0x5'));var logger=require(_0x6e33('0x6'))(_0x6e33('0x7'));var strategy=require(_0x6e33('0x8'));config[_0x6e33('0x9')]=_[_0x6e33('0xa')](config[_0x6e33('0x9')],{'host':_0x6e33('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6e33('0x9')]));var attributes=['id','queue_id','account',_0x6e33('0xc'),_0x6e33('0xd'),_0x6e33('0xe')];function emit(_0x425be6,_0x44f8b9,_0x1584b4){io['to'](_0x425be6)['emit'](_0x44f8b9,_0x1584b4);}function emitChannelQueueInteraction(_0x1d290d,_0x2fc78f,_0x2f7e28,_0x39c89b,_0x2133cf,_0x37e2c8,_0x26f286,_0x56a2c3){var _0x4b56bb=_[_0x6e33('0xf')](_0x2f7e28);_0x4b56bb[_0x6e33('0x10')]=_0x56a2c3;_0x4b56bb[_0x6e33('0xc')]=_0x2fc78f;_0x4b56bb[_0x6e33('0x11')]=_0x39c89b;_0x4b56bb['id']=_0x2133cf;if(_0x37e2c8){attributes['push'](_[_0x6e33('0x12')](_0x1d290d)+_0x6e33('0x13'));_0x26f286[util[_0x6e33('0x14')](_0x6e33('0x15'),_0x1d290d)][_0x2133cf]=_['pick'](_0x4b56bb,attributes);}else{delete _0x26f286[util[_0x6e33('0x14')](_0x6e33('0x15'),_0x1d290d)][_0x2133cf];}emit(util[_0x6e33('0x14')](_0x6e33('0x16'),_0x1d290d,_0x2fc78f),util[_0x6e33('0x14')]('%s_queue_waiting_interaction:%s',_0x1d290d,_0x37e2c8?_0x6e33('0x17'):'remove'),_[_0x6e33('0x18')](_0x4b56bb,attributes));}var rpc={'openchannelQueueReport':require(_0x6e33('0x19')),'mailQueueReport':require(_0x6e33('0x1a')),'chatQueueReport':require(_0x6e33('0x1b')),'smsQueueReport':require(_0x6e33('0x1c')),'faxQueueReport':require(_0x6e33('0x1d')),'whatsappQueueReport':require(_0x6e33('0x1e'))};var queue=schema({'name':{'type':_0x6e33('0x1f'),'required':!![],'message':_0x6e33('0x20')},'timeout':{'type':'number','message':_0x6e33('0x21')}});function startRouting(_0x266e3c,_0x380768,_0x328f69,_0x485760){if(_0x266e3c&&_0x380768&&_0x328f69){_0x380768['waiting']+=0x1;var _0x3f7d5f={'uniqueid':_0x266e3c,'from':_0x328f69[_0x6e33('0x22')]?_0x328f69[_0x6e33('0x22')][_0x6e33('0xd')]:'','joinAt':moment()[_0x6e33('0x14')](_0x6e33('0x23')),'ContactId':_0x328f69['contact']?_0x328f69['contact']['id']:null,'ListId':_0x328f69[_0x6e33('0x24')]?_0x328f69[_0x6e33('0x24')]['id']:null};_0x3f7d5f[_['upperFirst'](_0x328f69['channel'])+_0x6e33('0x25')]=_0x380768['id']||null;_0x3f7d5f[_[_0x6e33('0x26')](_0x328f69[_0x6e33('0x27')])+'InteractionId']=_0x328f69[_0x6e33('0x28')]?_0x328f69[_0x6e33('0x28')]['id']:null;_0x3f7d5f[_[_0x6e33('0x26')](_0x328f69[_0x6e33('0x27')])+'MessageId']=_0x328f69['message']?_0x328f69[_0x6e33('0x29')]['id']:null;_0x3f7d5f[_[_0x6e33('0x26')](_0x328f69[_0x6e33('0x27')])+(_0x328f69[_0x6e33('0x27')]!==_0x6e33('0x2a')?'AccountId':'WebsiteId')]=_0x328f69[_0x6e33('0x11')]?_0x328f69[_0x6e33('0x11')]['id']:null;logger[_0x6e33('0x2b')](util[_0x6e33('0x14')](_0x6e33('0x2c'),_0x266e3c,_0x380768[_0x6e33('0x2d')]));emitChannelQueueInteraction(_0x328f69[_0x6e33('0x27')],_0x380768['name'],_0x3f7d5f,_0x328f69[_0x6e33('0x11')]['name'],_0x328f69[_0x6e33('0x29')]['id'],!![],_0x485760,_0x380768['id']);if(rpc[_0x328f69['channel']+_0x6e33('0x2e')]){return rpc[_0x328f69['channel']+'QueueReport']['create'](_0x3f7d5f)[_0x6e33('0x2f')](function(_0x5adf95){logger[_0x6e33('0x30')](_0x6e33('0x31'));});}}}function stopRouting(_0x3fc9a6,_0x48578d,_0x27adb0,_0x58508e){if(_0x3fc9a6&&_0x48578d){_0x48578d[_0x6e33('0x32')]-=0x1;var _0x2d2ae0={'leaveAt':moment()[_0x6e33('0x14')](_0x6e33('0x23')),'acceptAt':moment()[_0x6e33('0x14')](_0x6e33('0x23')),'reason':'accepted'};logger[_0x6e33('0x2b')](util[_0x6e33('0x14')](_0x6e33('0x33'),_0x3fc9a6,_0x48578d['name']));emitChannelQueueInteraction(_0x27adb0[_0x6e33('0x27')],_0x48578d['name'],_0x27adb0[_0x6e33('0x22')],_0x27adb0[_0x6e33('0x11')][_0x6e33('0x2d')],_0x27adb0[_0x6e33('0x29')]['id'],![],_0x58508e,_0x48578d['id']);if(rpc[_0x27adb0[_0x6e33('0x27')]+_0x6e33('0x2e')]){return rpc[_0x27adb0[_0x6e33('0x27')]+_0x6e33('0x2e')][_0x6e33('0x34')](_0x3fc9a6,_0x2d2ae0)[_0x6e33('0x2f')](function(_0x41ff69){logger[_0x6e33('0x30')](_0x6e33('0x35'));});}}}function endRouting(_0x4e41dc,_0x231a29,_0x22159b,_0x1979c4){if(_0x4e41dc&&_0x231a29){_0x231a29['waiting']-=0x1;var _0x7d9ada={'leaveAt':moment()['format'](_0x6e33('0x23')),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x6e33('0x36')};logger[_0x6e33('0x2b')](util[_0x6e33('0x14')]('[%s][END:QUEUE][NAME:%s]',_0x4e41dc,_0x231a29[_0x6e33('0x2d')]));emitChannelQueueInteraction(_0x22159b['channel'],_0x231a29[_0x6e33('0x2d')],_0x22159b['body'],_0x22159b['account'][_0x6e33('0x2d')],_0x22159b['message']['id'],![],_0x1979c4);if(rpc[_0x22159b['channel']+'QueueReport']){return rpc[_0x22159b[_0x6e33('0x27')]+_0x6e33('0x2e')][_0x6e33('0x34')](_0x4e41dc,_0x7d9ada)[_0x6e33('0x2f')](function(_0x1e0520){logger[_0x6e33('0x30')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x4b54a1){return function(_0x1c2186){return _0x1c2186[_0x6e33('0x2d')]['toLowerCase']()===_0x4b54a1['toLowerCase']();};}exports['consequence']=function(_0xfab1fb,_0x1bd614,_0x3dab8c,_0x23f8f9){return function(_0x12e89d){try{var _0x1f16f1={'name':_0x1bd614[0x0],'timeout':_0x1bd614[0x1]};var _0x498372=queue[_0x6e33('0x0')](_0x1f16f1,{'typecast':!![]});if(_0x498372[_0x6e33('0x37')]){logger['error'](_0x6e33('0x38'),_0xfab1fb,_[_0x6e33('0x39')](_0x498372,_0x6e33('0x29'))[_0x6e33('0x3a')](',\x20'));_0x12e89d[_0x6e33('0x3b')]();}else{var _0x1b7a63=_[_0x6e33('0x3c')](_0x3dab8c[_0x23f8f9[_0x6e33('0x27')]+_0x6e33('0x3d')],handleFindQueue(_0x1f16f1[_0x6e33('0x2d')]));if(_0x1b7a63){startRouting(_0xfab1fb,_0x1b7a63,_0x23f8f9,_0x3dab8c);var _0x5713aa=(_0x1b7a63['timeout']||0xa)*0x3e8;var _0x2eb2b4=(_0x1f16f1[_0x6e33('0x36')]||0x14)*0x3e8;var _0x4d2ca5;if(_0x5713aa>_0x2eb2b4){_0x2eb2b4=_0x5713aa;}var _0x546a99=seqqueue[_0x6e33('0x3e')](_0x5713aa);_0x546a99['id']=_0xfab1fb;_0x546a99[_0x6e33('0x3f')]=_0x5713aa;_0x546a99[_0x6e33('0x40')]=_0x2eb2b4;_0x546a99['channel']=_0x23f8f9[_0x6e33('0x27')];_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]['on'](_0x6e33('0x42'),function(){logger['info'](_0x6e33('0x43'),_0xfab1fb);stopRouting(_0xfab1fb,_0x1b7a63,_0x23f8f9,_0x3dab8c);clearTimeout(_0x4d2ca5);_0x4d2ca5=undefined;_0x546a99['close'](!![]);if(_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]){delete _0x3dab8c[_0x6e33('0x41')][_0xfab1fb];}_0x12e89d[_0x6e33('0x3b')]();});_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]['on']('complete',function(){if(_0x3dab8c[_0x6e33('0x41')][_0xfab1fb]){delete _0x3dab8c['rules'][_0xfab1fb];}});_0x4d2ca5=setTimeout(function(){logger[_0x6e33('0x2b')](_0x6e33('0x44'),_0xfab1fb);endRouting(_0xfab1fb,_0x1b7a63,_0x23f8f9,_0x3dab8c);clearTimeout(_0x4d2ca5);_0x546a99['close'](!![]);_0x12e89d[_0x6e33('0x45')]();},_0x2eb2b4);switch(_0x1b7a63[_0x6e33('0x46')]){case _0x6e33('0x47'):strategy[_0x6e33('0x47')](_0x546a99,_0x1b7a63,_0x3dab8c,_0x23f8f9);break;default:strategy[_0x6e33('0x48')](_0x546a99,_0x1b7a63,_0x3dab8c,_0x23f8f9);}}else{logger[_0x6e33('0x30')](_0x6e33('0x49'),_0xfab1fb,_0x1f16f1[_0x6e33('0x2d')]);_0x12e89d[_0x6e33('0x3b')]();}}}catch(_0xc5cfab){console[_0x6e33('0x4a')](_0xc5cfab);logger[_0x6e33('0x30')](_0x6e33('0x38'),_0xfab1fb,_0xc5cfab[_0x6e33('0x4b')]);_0x12e89d[_0x6e33('0x3b')]();}};};
\ No newline at end of file
+var _0x0621=['InteractionId','interaction','MessageId','message','AccountId','info','name','QueueReport','create','catch','create\x20queue\x20report','accepted','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','localhost','socket.io-emitter','queue_id','account','from','joinAt','capitalize','pick','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel'];(function(_0x246a5a,_0x407cf8){var _0x3f7a94=function(_0x580cfe){while(--_0x580cfe){_0x246a5a['push'](_0x246a5a['shift']());}};_0x3f7a94(++_0x407cf8);}(_0x0621,0x1ea));var _0x1062=function(_0x465c9f,_0x2e8e90){_0x465c9f=_0x465c9f-0x0;var _0x83187f=_0x0621[_0x465c9f];return _0x83187f;};'use strict';var schema=require(_0x1062('0x0'));var _=require('lodash');var util=require(_0x1062('0x1'));var seqqueue=require(_0x1062('0x2'));var moment=require(_0x1062('0x3'));var Redis=require(_0x1062('0x4'));var config=require(_0x1062('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x1062('0x6'));config['redis']=_['defaults'](config[_0x1062('0x7')],{'host':_0x1062('0x8'),'port':0x18eb});var io=require(_0x1062('0x9'))(new Redis(config[_0x1062('0x7')]));var attributes=['id',_0x1062('0xa'),_0x1062('0xb'),'queue',_0x1062('0xc'),_0x1062('0xd')];function emit(_0x410d48,_0xf3fb8e,_0x3ca8cd){io['to'](_0x410d48)['emit'](_0xf3fb8e,_0x3ca8cd);}function emitChannelQueueInteraction(_0x194a50,_0x24c199,_0x357b51,_0x2cffe4,_0x15d2b3,_0xf275a6,_0x2ab79a,_0x4c58d6){var _0x7c0d4=_['clone'](_0x357b51);_0x7c0d4['queue_id']=_0x4c58d6;_0x7c0d4['queue']=_0x24c199;_0x7c0d4[_0x1062('0xb')]=_0x2cffe4;_0x7c0d4['id']=_0x15d2b3;if(_0xf275a6){attributes['push'](_[_0x1062('0xe')](_0x194a50)+'InteractionId');_0x2ab79a[util['format']('%sQueuesWaitingInteractions',_0x194a50)][_0x15d2b3]=_[_0x1062('0xf')](_0x7c0d4,attributes);}else{delete _0x2ab79a[util[_0x1062('0x10')](_0x1062('0x11'),_0x194a50)][_0x15d2b3];}emit(util[_0x1062('0x10')]('%s:queue:%s',_0x194a50,_0x24c199),util[_0x1062('0x10')](_0x1062('0x12'),_0x194a50,_0xf275a6?'save':_0x1062('0x13')),_[_0x1062('0xf')](_0x7c0d4,attributes));}var rpc={'openchannelQueueReport':require(_0x1062('0x14')),'mailQueueReport':require(_0x1062('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0x1062('0x16')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x1062('0x17'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x1062('0x18')},'timeout':{'type':_0x1062('0x19'),'message':_0x1062('0x1a')}});function startRouting(_0x3b6f00,_0x46a845,_0x4d870e,_0x5f0ef7){if(_0x3b6f00&&_0x46a845&&_0x4d870e){_0x46a845[_0x1062('0x1b')]+=0x1;var _0x1d9a65={'uniqueid':_0x3b6f00,'from':_0x4d870e[_0x1062('0x1c')]?_0x4d870e[_0x1062('0x1c')]['from']:'','joinAt':moment()[_0x1062('0x10')](_0x1062('0x1d')),'ContactId':_0x4d870e[_0x1062('0x1e')]?_0x4d870e[_0x1062('0x1e')]['id']:null,'ListId':_0x4d870e[_0x1062('0x1f')]?_0x4d870e[_0x1062('0x1f')]['id']:null};_0x1d9a65[_[_0x1062('0x20')](_0x4d870e['channel'])+_0x1062('0x21')]=_0x46a845['id']||null;_0x1d9a65[_[_0x1062('0x20')](_0x4d870e[_0x1062('0x22')])+_0x1062('0x23')]=_0x4d870e[_0x1062('0x24')]?_0x4d870e[_0x1062('0x24')]['id']:null;_0x1d9a65[_[_0x1062('0x20')](_0x4d870e[_0x1062('0x22')])+_0x1062('0x25')]=_0x4d870e[_0x1062('0x26')]?_0x4d870e[_0x1062('0x26')]['id']:null;_0x1d9a65[_[_0x1062('0x20')](_0x4d870e[_0x1062('0x22')])+(_0x4d870e['channel']!=='chat'?_0x1062('0x27'):'WebsiteId')]=_0x4d870e['account']?_0x4d870e[_0x1062('0xb')]['id']:null;logger[_0x1062('0x28')](util[_0x1062('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x3b6f00,_0x46a845[_0x1062('0x29')]));emitChannelQueueInteraction(_0x4d870e['channel'],_0x46a845[_0x1062('0x29')],_0x1d9a65,_0x4d870e[_0x1062('0xb')]['name'],_0x4d870e[_0x1062('0x26')]['id'],!![],_0x5f0ef7,_0x46a845['id']);if(rpc[_0x4d870e['channel']+'QueueReport']){return rpc[_0x4d870e['channel']+_0x1062('0x2a')][_0x1062('0x2b')](_0x1d9a65)[_0x1062('0x2c')](function(_0x5cbc9b){logger['error'](_0x1062('0x2d'));});}}}function stopRouting(_0x2e320b,_0x367f7b,_0x5313b8,_0x11153c){if(_0x2e320b&&_0x367f7b){_0x367f7b[_0x1062('0x1b')]-=0x1;var _0x418d7d={'leaveAt':moment()['format'](_0x1062('0x1d')),'acceptAt':moment()[_0x1062('0x10')](_0x1062('0x1d')),'reason':_0x1062('0x2e')};logger[_0x1062('0x28')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x2e320b,_0x367f7b[_0x1062('0x29')]));emitChannelQueueInteraction(_0x5313b8[_0x1062('0x22')],_0x367f7b[_0x1062('0x29')],_0x5313b8[_0x1062('0x1c')],_0x5313b8['account'][_0x1062('0x29')],_0x5313b8[_0x1062('0x26')]['id'],![],_0x11153c,_0x367f7b['id']);if(rpc[_0x5313b8['channel']+_0x1062('0x2a')]){return rpc[_0x5313b8[_0x1062('0x22')]+_0x1062('0x2a')][_0x1062('0x2f')](_0x2e320b,_0x418d7d)[_0x1062('0x2c')](function(_0x1cb76e){logger[_0x1062('0x30')](_0x1062('0x31'));});}}}function endRouting(_0x411989,_0x17d8bc,_0x3f875a,_0x390467){if(_0x411989&&_0x17d8bc){_0x17d8bc[_0x1062('0x1b')]-=0x1;var _0x133fd4={'leaveAt':moment()[_0x1062('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x1062('0x10')](_0x1062('0x1d')),'reason':_0x1062('0x32')};logger[_0x1062('0x28')](util[_0x1062('0x10')](_0x1062('0x33'),_0x411989,_0x17d8bc[_0x1062('0x29')]));emitChannelQueueInteraction(_0x3f875a[_0x1062('0x22')],_0x17d8bc['name'],_0x3f875a['body'],_0x3f875a[_0x1062('0xb')]['name'],_0x3f875a[_0x1062('0x26')]['id'],![],_0x390467);if(rpc[_0x3f875a[_0x1062('0x22')]+_0x1062('0x2a')]){return rpc[_0x3f875a['channel']+_0x1062('0x2a')][_0x1062('0x2f')](_0x411989,_0x133fd4)[_0x1062('0x2c')](function(_0x3361e9){logger['error'](_0x1062('0x31'));});}}}function handleFindQueue(_0x3f4f2c){return function(_0x5edf9f){return _0x5edf9f[_0x1062('0x29')][_0x1062('0x34')]()===_0x3f4f2c[_0x1062('0x34')]();};}exports[_0x1062('0x35')]=function(_0x36dfca,_0x40bed2,_0x4d1269,_0x2b010b){return function(_0xb1c06a){try{var _0x5824c9={'name':_0x40bed2[0x0],'timeout':_0x40bed2[0x1]};var _0x232539=queue[_0x1062('0x0')](_0x5824c9,{'typecast':!![]});if(_0x232539[_0x1062('0x36')]){logger[_0x1062('0x30')](_0x1062('0x37'),_0x36dfca,_[_0x1062('0x38')](_0x232539,_0x1062('0x26'))[_0x1062('0x39')](',\x20'));_0xb1c06a[_0x1062('0x3a')]();}else{var _0x5e8fac=_[_0x1062('0x3b')](_0x4d1269[_0x2b010b[_0x1062('0x22')]+'Queues'],handleFindQueue(_0x5824c9['name']));if(_0x5e8fac){startRouting(_0x36dfca,_0x5e8fac,_0x2b010b,_0x4d1269);var _0x1a40ab=(_0x5e8fac[_0x1062('0x32')]||0xa)*0x3e8;var _0x3d766a=(_0x5824c9[_0x1062('0x32')]||0x14)*0x3e8;var _0x5c11f1;if(_0x1a40ab>_0x3d766a){_0x3d766a=_0x1a40ab;}var _0xbc7f34=seqqueue[_0x1062('0x3c')](_0x1a40ab);_0xbc7f34['id']=_0x36dfca;_0xbc7f34[_0x1062('0x3d')]=_0x1a40ab;_0xbc7f34[_0x1062('0x3e')]=_0x3d766a;_0xbc7f34[_0x1062('0x22')]=_0x2b010b['channel'];_0x4d1269['rules'][_0x36dfca]['on'](_0x1062('0x3f'),function(){logger[_0x1062('0x28')](_0x1062('0x40'),_0x36dfca);stopRouting(_0x36dfca,_0x5e8fac,_0x2b010b,_0x4d1269);clearTimeout(_0x5c11f1);_0x5c11f1=undefined;_0xbc7f34[_0x1062('0x41')](!![]);if(_0x4d1269[_0x1062('0x42')][_0x36dfca]){delete _0x4d1269[_0x1062('0x42')][_0x36dfca];}_0xb1c06a['stop']();});_0x4d1269[_0x1062('0x42')][_0x36dfca]['on'](_0x1062('0x43'),function(){if(_0x4d1269[_0x1062('0x42')][_0x36dfca]){delete _0x4d1269['rules'][_0x36dfca];}});_0x5c11f1=setTimeout(function(){logger['info'](_0x1062('0x44'),_0x36dfca);endRouting(_0x36dfca,_0x5e8fac,_0x2b010b,_0x4d1269);clearTimeout(_0x5c11f1);_0xbc7f34[_0x1062('0x41')](!![]);_0xb1c06a[_0x1062('0x45')]();},_0x3d766a);switch(_0x5e8fac[_0x1062('0x46')]){case _0x1062('0x47'):strategy[_0x1062('0x47')](_0xbc7f34,_0x5e8fac,_0x4d1269,_0x2b010b);break;default:strategy['beepall'](_0xbc7f34,_0x5e8fac,_0x4d1269,_0x2b010b);}}else{logger[_0x1062('0x30')](_0x1062('0x48'),_0x36dfca,_0x5824c9[_0x1062('0x29')]);_0xb1c06a['stop']();}}}catch(_0x19ef15){console[_0x1062('0x49')](_0x19ef15);logger[_0x1062('0x30')](_0x1062('0x37'),_0x36dfca,_0x19ef15[_0x1062('0x4a')]);_0xb1c06a['stop']();}};};
\ No newline at end of file
index c4f1414..cfcb1ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eea=['STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','bind','timeout','drained','prototype','handleRun','handleTimeout','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','removeWaitingNotification'];(function(_0x24304c,_0x5c5332){var _0x457533=function(_0x340cdf){while(--_0x340cdf){_0x24304c['push'](_0x24304c['shift']());}};_0x457533(++_0x5c5332);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x7b3af,_0x5edd84){_0x7b3af=_0x7b3af-0x0;var _0x16bc36=_0x3eea[_0x7b3af];return _0x16bc36;};'use strict';var _=require(_0xa3ee('0x0'));var uuid=require('uuid');var util=require(_0xa3ee('0x1'));var logger=require(_0xa3ee('0x2'))(_0xa3ee('0x3'));var Agent=function(_0x1c6a49,_0x46acfa,_0x269141,_0x104913){this[_0xa3ee('0x4')]=uuid['v4']();this[_0xa3ee('0x5')]=_0x1c6a49;this[_0xa3ee('0x6')]=_0x46acfa;this[_0xa3ee('0x7')]=_0x269141;this['routing']=_0x104913;this['squeue'][_0xa3ee('0x8')](this['handleRun'][_0xa3ee('0x9')](this),this['handleTimeout'][_0xa3ee('0x9')](this));this['squeue']['on'](_0xa3ee('0xa'),this['handleTimeout'][_0xa3ee('0x9')](this));this[_0xa3ee('0x5')]['on'](_0xa3ee('0xb'),this['handleDrained'][_0xa3ee('0x9')](this));};Agent[_0xa3ee('0xc')]['push']=function(){this['squeue'][_0xa3ee('0x8')](this[_0xa3ee('0xd')][_0xa3ee('0x9')](this),this[_0xa3ee('0xe')]['bind'](this));};Agent[_0xa3ee('0xc')]['handleDrained']=function(){this[_0xa3ee('0xe')](!![]);};Agent[_0xa3ee('0xc')][_0xa3ee('0xd')]=function(){logger[_0xa3ee('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xa3ee('0x5')]['id'],this[_0xa3ee('0x6')]['id']);if(_['isNil'](this['realtime']['agents'][this[_0xa3ee('0x6')]['id']])){logger[_0xa3ee('0xf')](_0xa3ee('0x10'),this[_0xa3ee('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xa3ee('0x8')][_0xa3ee('0x9')](this),0x3e8);}else{if(this[_0xa3ee('0x3')][_0xa3ee('0x11')]||util[_0xa3ee('0x12')](this['squeue']['id'],this[_0xa3ee('0x7')][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],this[_0xa3ee('0x5')][_0xa3ee('0x14')],![])){this[_0xa3ee('0x7')]['agents'][this[_0xa3ee('0x6')]['id']][_0xa3ee('0x15')]=!![];this['realtime'][_0xa3ee('0x13')][this['agent']['id']][_0xa3ee('0x16')]=undefined;util[_0xa3ee('0x17')](this[_0xa3ee('0x7')],this[_0xa3ee('0x3')],this[_0xa3ee('0x6')],this[_0xa3ee('0x5')][_0xa3ee('0x14')]);util[_0xa3ee('0x18')](this[_0xa3ee('0x4')],this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],null,this[_0xa3ee('0x3')]);util[_0xa3ee('0x19')](this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],_0xa3ee('0x1a')+(this[_0xa3ee('0x3')][_0xa3ee('0x11')]?_0xa3ee('0x1b'):''));}else{logger[_0xa3ee('0xf')](_0xa3ee('0x1c'),this[_0xa3ee('0x5')]['id'],this[_0xa3ee('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent['prototype'][_0xa3ee('0xe')]=function(_0x481358){if(_[_0xa3ee('0x1d')](this[_0xa3ee('0x7')][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']])){return logger[_0xa3ee('0xf')](_0xa3ee('0x10'),this[_0xa3ee('0x5')]['id'],this[_0xa3ee('0x6')]['id']);}else{logger[_0xa3ee('0xf')](_0xa3ee('0x1e'),this['squeue']['id'],this[_0xa3ee('0x6')]['id']);util['hideNotification'](this[_0xa3ee('0x4')],this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this['agent']['id']],null,this[_0xa3ee('0x3')]);this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']][_0xa3ee('0x15')]=![];this[_0xa3ee('0x7')][_0xa3ee('0x13')][this['agent']['id']][_0xa3ee('0x16')]=undefined;util[_0xa3ee('0x1f')](this[_0xa3ee('0x7')],this['routing'],this[_0xa3ee('0x6')],this['squeue'][_0xa3ee('0x14')]);util['writeLog'](this[_0xa3ee('0x5')]['id'],this['realtime'][_0xa3ee('0x13')][this[_0xa3ee('0x6')]['id']],_0x481358?_0xa3ee('0x20'):_0xa3ee('0x21'));}if(!_0x481358){setTimeout(this[_0xa3ee('0x8')][_0xa3ee('0x9')](this),0x3e8);}};function agent(_0xcc8e71,_0x42c66f,_0x256c63,_0x218317){return new Agent(_0xcc8e71,_0x42c66f,_0x256c63,_0x218317);}module[_0xa3ee('0x22')]=agent;
\ No newline at end of file
+var _0xf021=['routing','notificationId','realtime','squeue','push','handleRun','bind','handleTimeout','drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','forcedOwnership','busyQueue','channel','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','busy','STOP','lodash','uuid','./util','../../../../../config/logger'];(function(_0x27456f,_0x84b51e){var _0x35b210=function(_0x3d1e3b){while(--_0x3d1e3b){_0x27456f['push'](_0x27456f['shift']());}};_0x35b210(++_0x84b51e);}(_0xf021,0x18f));var _0x1f02=function(_0x38750a,_0x316de4){_0x38750a=_0x38750a-0x0;var _0x92e34a=_0xf021[_0x38750a];return _0x92e34a;};'use strict';var _=require(_0x1f02('0x0'));var uuid=require(_0x1f02('0x1'));var util=require(_0x1f02('0x2'));var logger=require(_0x1f02('0x3'))(_0x1f02('0x4'));var Agent=function(_0x53cc42,_0x1027d2,_0x54cd44,_0x2e8594){this[_0x1f02('0x5')]=uuid['v4']();this['squeue']=_0x53cc42;this['agent']=_0x1027d2;this[_0x1f02('0x6')]=_0x54cd44;this['routing']=_0x2e8594;this[_0x1f02('0x7')][_0x1f02('0x8')](this[_0x1f02('0x9')][_0x1f02('0xa')](this),this[_0x1f02('0xb')]['bind'](this));this[_0x1f02('0x7')]['on']('timeout',this['handleTimeout']['bind'](this));this[_0x1f02('0x7')]['on'](_0x1f02('0xc'),this[_0x1f02('0xd')][_0x1f02('0xa')](this));};Agent[_0x1f02('0xe')]['push']=function(){this[_0x1f02('0x7')][_0x1f02('0x8')](this[_0x1f02('0x9')]['bind'](this),this[_0x1f02('0xb')][_0x1f02('0xa')](this));};Agent[_0x1f02('0xe')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1f02('0x9')]=function(){logger[_0x1f02('0xf')](_0x1f02('0x10'),this[_0x1f02('0x7')]['id'],this[_0x1f02('0x11')]['id']);if(_[_0x1f02('0x12')](this[_0x1f02('0x6')][_0x1f02('0x13')][this['agent']['id']])){logger[_0x1f02('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this['push'][_0x1f02('0xa')](this),0x3e8);}else{if(this[_0x1f02('0x4')][_0x1f02('0x14')]||util['isAgentAvailable'](this[_0x1f02('0x7')]['id'],this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],this['squeue']['channel'],![])){this[_0x1f02('0x6')][_0x1f02('0x13')][this['agent']['id']]['busy']=!![];this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']][_0x1f02('0x15')]=undefined;util['saveWaitingNotification'](this[_0x1f02('0x6')],this[_0x1f02('0x4')],this[_0x1f02('0x11')],this[_0x1f02('0x7')][_0x1f02('0x16')]);util[_0x1f02('0x17')](this[_0x1f02('0x5')],this['squeue']['id'],this[_0x1f02('0x6')][_0x1f02('0x13')][this['agent']['id']],null,this[_0x1f02('0x4')]);util[_0x1f02('0x18')](this['squeue']['id'],this['realtime'][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],_0x1f02('0x19')+(this[_0x1f02('0x4')][_0x1f02('0x14')]?_0x1f02('0x1a'):''));}else{logger[_0x1f02('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x1f02('0x8')][_0x1f02('0xa')](this),0x3e8);}}};Agent[_0x1f02('0xe')]['handleTimeout']=function(_0x5c2c42){if(_[_0x1f02('0x12')](this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']])){return logger[_0x1f02('0xf')](_0x1f02('0x1b'),this[_0x1f02('0x7')]['id'],this[_0x1f02('0x11')]['id']);}else{logger[_0x1f02('0xf')](_0x1f02('0x1c'),this['squeue']['id'],this[_0x1f02('0x11')]['id']);util['hideNotification'](this[_0x1f02('0x5')],this[_0x1f02('0x7')]['id'],this[_0x1f02('0x6')][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],null,this[_0x1f02('0x4')]);this['realtime']['agents'][this[_0x1f02('0x11')]['id']][_0x1f02('0x1d')]=![];this['realtime'][_0x1f02('0x13')][this['agent']['id']][_0x1f02('0x15')]=undefined;util['removeWaitingNotification'](this[_0x1f02('0x6')],this['routing'],this['agent'],this[_0x1f02('0x7')][_0x1f02('0x16')]);util[_0x1f02('0x18')](this[_0x1f02('0x7')]['id'],this['realtime'][_0x1f02('0x13')][this[_0x1f02('0x11')]['id']],_0x5c2c42?_0x1f02('0x1e'):'TIMEOUT');}if(!_0x5c2c42){setTimeout(this[_0x1f02('0x8')][_0x1f02('0xa')](this),0x3e8);}};function agent(_0x2a82fa,_0x390686,_0x4292b7,_0x2dbdc5){return new Agent(_0x2a82fa,_0x390686,_0x4292b7,_0x2dbdc5);}module['exports']=agent;
\ No newline at end of file
index 4ef05be..4ec000c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x286b=['length','isNil','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','name','saveWaitingNotification','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','busy','busyQueue','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','prototype','handleDrained','queue','Agents'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x286b,0xcc));var _0xb286=function(_0x32df0d,_0x56b571){_0x32df0d=_0x32df0d-0x0;var _0xc5a7aa=_0x286b[_0x32df0d];return _0xc5a7aa;};'use strict';var _=require(_0xb286('0x0'));var uuid=require(_0xb286('0x1'));var util=require(_0xb286('0x2'));var logger=require(_0xb286('0x3'))(_0xb286('0x4'));var Beepall=function(_0x1c8b9b,_0x1aef48,_0x5276bb,_0xaa9f88){this[_0xb286('0x5')]=uuid['v4']();this[_0xb286('0x6')]=_0x1c8b9b;this['queue']=_0x1aef48;this[_0xb286('0x7')]=_0x5276bb;this[_0xb286('0x4')]=_0xaa9f88;this[_0xb286('0x6')][_0xb286('0x8')](this[_0xb286('0x9')][_0xb286('0xa')](this),this[_0xb286('0xb')][_0xb286('0xa')](this));this['squeue']['on'](_0xb286('0xc'),this['handleTimeout'][_0xb286('0xa')](this));this[_0xb286('0x6')]['on'](_0xb286('0xd'),this['handleDrained'][_0xb286('0xa')](this));};Beepall[_0xb286('0xe')][_0xb286('0x8')]=function(){this[_0xb286('0x6')][_0xb286('0x8')](this[_0xb286('0x9')]['bind'](this),this[_0xb286('0xb')][_0xb286('0xa')](this));};Beepall[_0xb286('0xe')][_0xb286('0xf')]=function(){this[_0xb286('0xb')](!![]);};Beepall[_0xb286('0xe')][_0xb286('0x9')]=function(){var _0x33db73=!![];if(!_['isNil'](this[_0xb286('0x10')])&&!_['isNil'](this[_0xb286('0x10')][_0xb286('0x11')])&&this[_0xb286('0x10')]['Agents'][_0xb286('0x12')]>0x0){for(var _0x16321a=0x0,_0x4d9368;_0x16321a<this[_0xb286('0x10')]['Agents'][_0xb286('0x12')];_0x16321a+=0x1){_0x4d9368=this['queue'][_0xb286('0x11')][_0x16321a]['id'];if(_[_0xb286('0x13')](this[_0xb286('0x7')][_0xb286('0x14')][_0x4d9368])){logger[_0xb286('0x15')](_0xb286('0x16'),this[_0xb286('0x6')]['id'],_0x4d9368);}else{if(util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0xb286('0x14')][_0x4d9368],this[_0xb286('0x6')][_0xb286('0x17')],!![])){_0x33db73=![];util['writeLog'](this[_0xb286('0x6')]['id'],this[_0xb286('0x7')][_0xb286('0x14')][_0x4d9368],'RINGING');this[_0xb286('0x7')][_0xb286('0x14')][_0x4d9368]['busy']=!![];this[_0xb286('0x7')]['agents'][_0x4d9368]['busyQueue']=this['queue'][_0xb286('0x18')];util[_0xb286('0x19')](this[_0xb286('0x7')],this[_0xb286('0x4')],this[_0xb286('0x10')][_0xb286('0x11')][_0x16321a],this[_0xb286('0x6')][_0xb286('0x17')]);util[_0xb286('0x1a')](this[_0xb286('0x5')],this[_0xb286('0x6')]['id'],this['realtime']['agents'][_0x4d9368],this[_0xb286('0x10')],this[_0xb286('0x4')]);}}}if(_0x33db73){logger[_0xb286('0x15')](_0xb286('0x1b'),this[_0xb286('0x6')]['id']);setTimeout(this[_0xb286('0x8')]['bind'](this),0x3e8);}}else{logger[_0xb286('0x15')](_0xb286('0x1c'),this[_0xb286('0x6')]['id']);setTimeout(this[_0xb286('0x8')]['bind'](this),0x3e8);}};Beepall[_0xb286('0xe')][_0xb286('0xb')]=function(_0x57b081){if(!_[_0xb286('0x13')](this[_0xb286('0x10')])&&!_[_0xb286('0x13')](this[_0xb286('0x10')][_0xb286('0x11')])){for(var _0x471e01=0x0,_0x1b367b;_0x471e01<this['queue']['Agents'][_0xb286('0x12')];_0x471e01+=0x1){_0x1b367b=this[_0xb286('0x10')][_0xb286('0x11')][_0x471e01]['id'];if(_[_0xb286('0x13')](this[_0xb286('0x7')][_0xb286('0x14')][_0x1b367b])){logger[_0xb286('0x15')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xb286('0x6')]['id'],_0x1b367b);}else{util[_0xb286('0x1d')](this[_0xb286('0x5')],this['squeue']['id'],this['realtime']['agents'][_0x1b367b],this[_0xb286('0x10')],this[_0xb286('0x4')]);util[_0xb286('0x1e')](this[_0xb286('0x6')]['id'],this[_0xb286('0x7')][_0xb286('0x14')][_0x1b367b],_0x57b081?_0xb286('0x1f'):_0xb286('0x20'));this['realtime']['agents'][_0x1b367b][_0xb286('0x21')]=![];this[_0xb286('0x7')][_0xb286('0x14')][_0x1b367b][_0xb286('0x22')]=undefined;util[_0xb286('0x23')](this[_0xb286('0x7')],this[_0xb286('0x4')],this[_0xb286('0x7')][_0xb286('0x14')][_0x1b367b],this[_0xb286('0x6')][_0xb286('0x17')]);}}}if(!_0x57b081){setTimeout(this[_0xb286('0x8')]['bind'](this),0x3e8);}};function beepall(_0x7c97ed,_0x5d4d0e,_0x3c941b,_0x2ffeee){return new Beepall(_0x7c97ed,_0x5d4d0e,_0x3c941b,_0x2ffeee);}module[_0xb286('0x24')]=beepall;
\ No newline at end of file
+var _0x15e1=['push','handleRun','bind','timeout','drained','prototype','handleTimeout','handleDrained','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20EMPTY','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x15e1,0x10f));var _0x115e=function(_0x31523e,_0x3ce635){_0x31523e=_0x31523e-0x0;var _0x195270=_0x15e1[_0x31523e];return _0x195270;};'use strict';var _=require(_0x115e('0x0'));var uuid=require(_0x115e('0x1'));var util=require(_0x115e('0x2'));var logger=require(_0x115e('0x3'))(_0x115e('0x4'));var Beepall=function(_0x3d91a1,_0xdd3f4,_0x27b2c8,_0x63569){this[_0x115e('0x5')]=uuid['v4']();this[_0x115e('0x6')]=_0x3d91a1;this[_0x115e('0x7')]=_0xdd3f4;this[_0x115e('0x8')]=_0x27b2c8;this[_0x115e('0x4')]=_0x63569;this[_0x115e('0x6')][_0x115e('0x9')](this[_0x115e('0xa')][_0x115e('0xb')](this),this['handleTimeout']['bind'](this));this[_0x115e('0x6')]['on'](_0x115e('0xc'),this['handleTimeout'][_0x115e('0xb')](this));this[_0x115e('0x6')]['on'](_0x115e('0xd'),this['handleDrained'][_0x115e('0xb')](this));};Beepall[_0x115e('0xe')][_0x115e('0x9')]=function(){this['squeue'][_0x115e('0x9')](this['handleRun'][_0x115e('0xb')](this),this[_0x115e('0xf')]['bind'](this));};Beepall['prototype'][_0x115e('0x10')]=function(){this[_0x115e('0xf')](!![]);};Beepall[_0x115e('0xe')][_0x115e('0xa')]=function(){var _0xabe4b9=!![];if(!_[_0x115e('0x11')](this[_0x115e('0x7')])&&!_['isNil'](this[_0x115e('0x7')][_0x115e('0x12')])&&this['queue'][_0x115e('0x12')]['length']>0x0){for(var _0x113fda=0x0,_0x48aaf5;_0x113fda<this['queue'][_0x115e('0x12')][_0x115e('0x13')];_0x113fda+=0x1){_0x48aaf5=this['queue'][_0x115e('0x12')][_0x113fda]['id'];if(_[_0x115e('0x11')](this['realtime'][_0x115e('0x14')][_0x48aaf5])){logger['debug'](_0x115e('0x15'),this[_0x115e('0x6')]['id'],_0x48aaf5);}else{if(util[_0x115e('0x16')](this['squeue']['id'],this[_0x115e('0x8')][_0x115e('0x14')][_0x48aaf5],this[_0x115e('0x6')][_0x115e('0x17')],!![])){_0xabe4b9=![];util[_0x115e('0x18')](this[_0x115e('0x6')]['id'],this[_0x115e('0x8')][_0x115e('0x14')][_0x48aaf5],_0x115e('0x19'));this[_0x115e('0x8')][_0x115e('0x14')][_0x48aaf5][_0x115e('0x1a')]=!![];this[_0x115e('0x8')][_0x115e('0x14')][_0x48aaf5][_0x115e('0x1b')]=this[_0x115e('0x7')]['name'];util[_0x115e('0x1c')](this[_0x115e('0x8')],this['routing'],this['queue'][_0x115e('0x12')][_0x113fda],this[_0x115e('0x6')][_0x115e('0x17')]);util[_0x115e('0x1d')](this['notificationId'],this[_0x115e('0x6')]['id'],this['realtime'][_0x115e('0x14')][_0x48aaf5],this[_0x115e('0x7')],this[_0x115e('0x4')]);}}}if(_0xabe4b9){logger[_0x115e('0x1e')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x115e('0x6')]['id']);setTimeout(this['push'][_0x115e('0xb')](this),0x3e8);}}else{logger[_0x115e('0x1e')](_0x115e('0x1f'),this[_0x115e('0x6')]['id']);setTimeout(this[_0x115e('0x9')][_0x115e('0xb')](this),0x3e8);}};Beepall[_0x115e('0xe')][_0x115e('0xf')]=function(_0x275fd1){if(!_['isNil'](this[_0x115e('0x7')])&&!_[_0x115e('0x11')](this[_0x115e('0x7')][_0x115e('0x12')])){for(var _0x30269e=0x0,_0x110187;_0x30269e<this[_0x115e('0x7')][_0x115e('0x12')][_0x115e('0x13')];_0x30269e+=0x1){_0x110187=this['queue'][_0x115e('0x12')][_0x30269e]['id'];if(_[_0x115e('0x11')](this[_0x115e('0x8')][_0x115e('0x14')][_0x110187])){logger['debug'](_0x115e('0x15'),this[_0x115e('0x6')]['id'],_0x110187);}else{util['hideNotification'](this[_0x115e('0x5')],this[_0x115e('0x6')]['id'],this[_0x115e('0x8')]['agents'][_0x110187],this[_0x115e('0x7')],this['routing']);util[_0x115e('0x18')](this[_0x115e('0x6')]['id'],this[_0x115e('0x8')][_0x115e('0x14')][_0x110187],_0x275fd1?'STOP':_0x115e('0x20'));this[_0x115e('0x8')][_0x115e('0x14')][_0x110187]['busy']=![];this[_0x115e('0x8')][_0x115e('0x14')][_0x110187]['busyQueue']=undefined;util[_0x115e('0x21')](this['realtime'],this[_0x115e('0x4')],this['realtime'][_0x115e('0x14')][_0x110187],this[_0x115e('0x6')]['channel']);}}}if(!_0x275fd1){setTimeout(this[_0x115e('0x9')][_0x115e('0xb')](this),0x3e8);}};function beepall(_0x547e4f,_0x510b34,_0x2208e8,_0x4cf295){return new Beepall(_0x547e4f,_0x510b34,_0x2208e8,_0x4cf295);}module[_0x115e('0x22')]=beepall;
\ No newline at end of file
index ffbe6a9..5474779 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb185=['./beepall','./agent','exports','./rrmemory'];(function(_0x131950,_0x2c837c){var _0xce6737=function(_0xb3ed48){while(--_0xb3ed48){_0x131950['push'](_0x131950['shift']());}};_0xce6737(++_0x2c837c);}(_0xb185,0x1ca));var _0x5b18=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb185[_0x5d2803];return _0xdcad2c;};'use strict';module[_0x5b18('0x0')]={'rrmemory':require(_0x5b18('0x1')),'beepall':require(_0x5b18('0x2')),'agent':require(_0x5b18('0x3'))};
\ No newline at end of file
+var _0x66c9=['exports','./rrmemory'];(function(_0x5d5ab2,_0x1d3681){var _0xb8fe37=function(_0x29a76c){while(--_0x29a76c){_0x5d5ab2['push'](_0x5d5ab2['shift']());}};_0xb8fe37(++_0x1d3681);}(_0x66c9,0x70));var _0x966c=function(_0x4ac851,_0x2e7ffc){_0x4ac851=_0x4ac851-0x0;var _0xe82217=_0x66c9[_0x4ac851];return _0xe82217;};'use strict';module[_0x966c('0x0')]={'rrmemory':require(_0x966c('0x1')),'beepall':require('./beepall'),'agent':require('./agent')};
\ No newline at end of file
index 600e2fc..3521254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e80=['handleDrained','prototype','isAgentAvailable','realtime','agentId','channel','debug','queue','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','done','agents','busyQueue','showNotification','routing','writeLog','RINGING','handleCheckReject','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','busy','exports','uuid','./util','../../../../../config/logger','notificationId','squeue','intervals','push','handleRun','handleTimeout','timeout','bind','drained'];(function(_0x36fc7b,_0x1a4c4b){var _0x20b70f=function(_0x8b9e2a){while(--_0x8b9e2a){_0x36fc7b['push'](_0x36fc7b['shift']());}};_0x20b70f(++_0x1a4c4b);}(_0x8e80,0x1a4));var _0x08e8=function(_0x2d10f7,_0x36abd0){_0x2d10f7=_0x2d10f7-0x0;var _0x94c2f7=_0x8e80[_0x2d10f7];return _0x94c2f7;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x08e8('0x0'));var util=require(_0x08e8('0x1'));var logger=require(_0x08e8('0x2'))('routing');var RRMemory=function(_0x421287,_0x1f62dc,_0x55e005,_0x3eb15c){this[_0x08e8('0x3')]=uuid['v4']();this[_0x08e8('0x4')]=_0x421287;this['queue']=_0x1f62dc;this['realtime']=_0x55e005;this['routing']=_0x3eb15c;this[_0x08e8('0x5')]={};this['squeue'][_0x08e8('0x6')](this[_0x08e8('0x7')]['bind'](this),this[_0x08e8('0x8')]['bind'](this),this['module']);this['squeue']['on'](_0x08e8('0x9'),this[_0x08e8('0x8')][_0x08e8('0xa')](this));this[_0x08e8('0x4')]['on'](_0x08e8('0xb'),this[_0x08e8('0xc')][_0x08e8('0xa')](this));};RRMemory[_0x08e8('0xd')]['push']=function(){this[_0x08e8('0x4')][_0x08e8('0x6')](this[_0x08e8('0x7')][_0x08e8('0xa')](this),this[_0x08e8('0x8')]['bind'](this));};RRMemory['prototype'][_0x08e8('0xc')]=function(){this[_0x08e8('0x8')](!![]);};RRMemory[_0x08e8('0xd')]['handleCheckReject']=function(_0x3406f8){if(util[_0x08e8('0xe')](this[_0x08e8('0x4')]['id'],this[_0x08e8('0xf')]['agents'][this[_0x08e8('0x10')]],this[_0x08e8('0x4')][_0x08e8('0x11')],!![])){logger[_0x08e8('0x12')]('[%s][QUEUE]\x20available\x20again\x20%s',this['squeue']['id'],this[_0x08e8('0x10')]);clearInterval(this[_0x08e8('0x5')][this['agentId']]);_0x3406f8['done']();setTimeout(this[_0x08e8('0x6')]['bind'](this),0x3e8);}};RRMemory[_0x08e8('0xd')][_0x08e8('0x7')]=function(_0x11ba91){this[_0x08e8('0x10')]=rr(this[_0x08e8('0x13')][_0x08e8('0x14')]);logger[_0x08e8('0x12')](_0x08e8('0x15'),this[_0x08e8('0x4')]['id'],this[_0x08e8('0x10')]);if(_['isNil'](this[_0x08e8('0xf')]['agents'][this[_0x08e8('0x10')]])){logger[_0x08e8('0x12')](_0x08e8('0x16'),this[_0x08e8('0x4')]['id'],this[_0x08e8('0x10')]);_0x11ba91[_0x08e8('0x17')]();setTimeout(this[_0x08e8('0x6')][_0x08e8('0xa')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x08e8('0x4')]['id'],this['realtime'][_0x08e8('0x18')][this['agentId']],this[_0x08e8('0x4')][_0x08e8('0x11')],!![])){this[_0x08e8('0xf')]['agents'][this['agentId']]['busy']=!![];this['realtime'][_0x08e8('0x18')][this['agentId']][_0x08e8('0x19')]=this[_0x08e8('0x13')]['name'];util['saveWaitingNotification'](this[_0x08e8('0xf')],this['routing'],this['realtime'][_0x08e8('0x18')][this[_0x08e8('0x10')]],this[_0x08e8('0x4')][_0x08e8('0x11')]);util[_0x08e8('0x1a')](this[_0x08e8('0x3')],this[_0x08e8('0x4')]['id'],this['realtime'][_0x08e8('0x18')][this[_0x08e8('0x10')]],this['queue'],this[_0x08e8('0x1b')]);util[_0x08e8('0x1c')](this['squeue']['id'],this[_0x08e8('0xf')][_0x08e8('0x18')][this[_0x08e8('0x10')]],_0x08e8('0x1d'));this[_0x08e8('0x5')][this[_0x08e8('0x10')]]=setInterval(this[_0x08e8('0x1e')][_0x08e8('0xa')](this,_0x11ba91),0x3e8);}else{logger[_0x08e8('0x12')]('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x08e8('0x4')]['id'],this[_0x08e8('0x10')]);_0x11ba91[_0x08e8('0x17')]();setTimeout(this['push'][_0x08e8('0xa')](this),0x3e8);}}};RRMemory[_0x08e8('0xd')][_0x08e8('0x8')]=function(_0x59950d){logger[_0x08e8('0x12')](_0x08e8('0x1f'),this['squeue']['id'],this[_0x08e8('0x10')]);if(_['isNil'](this[_0x08e8('0xf')][_0x08e8('0x18')][this[_0x08e8('0x10')]])){logger[_0x08e8('0x12')](_0x08e8('0x16'),this[_0x08e8('0x4')]['id'],this[_0x08e8('0x10')]);}else{clearInterval(this['intervals'][this[_0x08e8('0x10')]]);util[_0x08e8('0x20')](this[_0x08e8('0x3')],this[_0x08e8('0x4')]['id'],this['realtime'][_0x08e8('0x18')][this[_0x08e8('0x10')]],this[_0x08e8('0x13')],this[_0x08e8('0x1b')]);util[_0x08e8('0x1c')](this[_0x08e8('0x4')]['id'],this[_0x08e8('0xf')][_0x08e8('0x18')][this[_0x08e8('0x10')]],_0x08e8('0x21'));this[_0x08e8('0xf')][_0x08e8('0x18')][this[_0x08e8('0x10')]][_0x08e8('0x22')]=![];this[_0x08e8('0xf')][_0x08e8('0x18')][this['agentId']]['busyQueue']=undefined;util['removeWaitingNotification'](this['realtime'],this['routing'],this[_0x08e8('0xf')][_0x08e8('0x18')][this[_0x08e8('0x10')]],this[_0x08e8('0x4')][_0x08e8('0x11')]);}if(!_0x59950d){setTimeout(this['push']['bind'](this),0x3e8);}};function rrmemory(_0x58625e,_0x2e8f3a,_0x5776d4,_0x17d7dc){return new RRMemory(_0x58625e,_0x2e8f3a,_0x5776d4,_0x17d7dc);}module[_0x08e8('0x23')]=rrmemory;
\ No newline at end of file
+var _0x7769=['handleTimeout','drained','prototype','handleDrained','isAgentAvailable','agents','agentId','debug','[%s][QUEUE]\x20available\x20again\x20%s','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','done','busy','busyQueue','name','saveWaitingNotification','writeLog','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','notificationId','TIMEOUT','removeWaitingNotification','channel','exports','lodash','uuid','./util','routing','squeue','queue','realtime','intervals','push','handleRun','bind','module','timeout'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x7769,0x164));var _0x9776=function(_0x240a43,_0x40c85d){_0x240a43=_0x240a43-0x0;var _0x4e6269=_0x7769[_0x240a43];return _0x4e6269;};'use strict';var rr=require('rr');var _=require(_0x9776('0x0'));var uuid=require(_0x9776('0x1'));var util=require(_0x9776('0x2'));var logger=require('../../../../../config/logger')(_0x9776('0x3'));var RRMemory=function(_0x3357c9,_0x2b729f,_0xdbde03,_0x16cccb){this['notificationId']=uuid['v4']();this[_0x9776('0x4')]=_0x3357c9;this[_0x9776('0x5')]=_0x2b729f;this[_0x9776('0x6')]=_0xdbde03;this[_0x9776('0x3')]=_0x16cccb;this[_0x9776('0x7')]={};this[_0x9776('0x4')][_0x9776('0x8')](this[_0x9776('0x9')][_0x9776('0xa')](this),this['handleTimeout'][_0x9776('0xa')](this),this[_0x9776('0xb')]);this[_0x9776('0x4')]['on'](_0x9776('0xc'),this[_0x9776('0xd')][_0x9776('0xa')](this));this['squeue']['on'](_0x9776('0xe'),this['handleDrained']['bind'](this));};RRMemory[_0x9776('0xf')][_0x9776('0x8')]=function(){this[_0x9776('0x4')][_0x9776('0x8')](this[_0x9776('0x9')][_0x9776('0xa')](this),this[_0x9776('0xd')][_0x9776('0xa')](this));};RRMemory['prototype'][_0x9776('0x10')]=function(){this[_0x9776('0xd')](!![]);};RRMemory[_0x9776('0xf')]['handleCheckReject']=function(_0xcbc68e){if(util[_0x9776('0x11')](this[_0x9776('0x4')]['id'],this[_0x9776('0x6')][_0x9776('0x12')][this[_0x9776('0x13')]],this[_0x9776('0x4')]['channel'],!![])){logger[_0x9776('0x14')](_0x9776('0x15'),this['squeue']['id'],this['agentId']);clearInterval(this['intervals'][this['agentId']]);_0xcbc68e['done']();setTimeout(this[_0x9776('0x8')][_0x9776('0xa')](this),0x3e8);}};RRMemory[_0x9776('0xf')][_0x9776('0x9')]=function(_0x238cab){this[_0x9776('0x13')]=rr(this[_0x9776('0x5')][_0x9776('0x16')]);logger[_0x9776('0x14')](_0x9776('0x17'),this[_0x9776('0x4')]['id'],this[_0x9776('0x13')]);if(_[_0x9776('0x18')](this[_0x9776('0x6')][_0x9776('0x12')][this['agentId']])){logger[_0x9776('0x14')](_0x9776('0x19'),this[_0x9776('0x4')]['id'],this[_0x9776('0x13')]);_0x238cab[_0x9776('0x1a')]();setTimeout(this[_0x9776('0x8')]['bind'](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x9776('0x4')]['id'],this[_0x9776('0x6')]['agents'][this[_0x9776('0x13')]],this[_0x9776('0x4')]['channel'],!![])){this[_0x9776('0x6')][_0x9776('0x12')][this['agentId']][_0x9776('0x1b')]=!![];this['realtime'][_0x9776('0x12')][this[_0x9776('0x13')]][_0x9776('0x1c')]=this[_0x9776('0x5')][_0x9776('0x1d')];util[_0x9776('0x1e')](this[_0x9776('0x6')],this[_0x9776('0x3')],this[_0x9776('0x6')]['agents'][this[_0x9776('0x13')]],this['squeue']['channel']);util['showNotification'](this['notificationId'],this[_0x9776('0x4')]['id'],this['realtime'][_0x9776('0x12')][this[_0x9776('0x13')]],this[_0x9776('0x5')],this[_0x9776('0x3')]);util[_0x9776('0x1f')](this['squeue']['id'],this[_0x9776('0x6')]['agents'][this[_0x9776('0x13')]],'RINGING');this[_0x9776('0x7')][this[_0x9776('0x13')]]=setInterval(this[_0x9776('0x20')][_0x9776('0xa')](this,_0x238cab),0x3e8);}else{logger[_0x9776('0x14')](_0x9776('0x21'),this[_0x9776('0x4')]['id'],this[_0x9776('0x13')]);_0x238cab[_0x9776('0x1a')]();setTimeout(this[_0x9776('0x8')][_0x9776('0xa')](this),0x3e8);}}};RRMemory[_0x9776('0xf')][_0x9776('0xd')]=function(_0x1604fd){logger[_0x9776('0x14')](_0x9776('0x22'),this[_0x9776('0x4')]['id'],this[_0x9776('0x13')]);if(_['isNil'](this['realtime'][_0x9776('0x12')][this[_0x9776('0x13')]])){logger[_0x9776('0x14')](_0x9776('0x19'),this[_0x9776('0x4')]['id'],this[_0x9776('0x13')]);}else{clearInterval(this[_0x9776('0x7')][this[_0x9776('0x13')]]);util[_0x9776('0x23')](this[_0x9776('0x24')],this['squeue']['id'],this[_0x9776('0x6')][_0x9776('0x12')][this[_0x9776('0x13')]],this[_0x9776('0x5')],this[_0x9776('0x3')]);util['writeLog'](this[_0x9776('0x4')]['id'],this[_0x9776('0x6')][_0x9776('0x12')][this[_0x9776('0x13')]],_0x9776('0x25'));this['realtime'][_0x9776('0x12')][this[_0x9776('0x13')]][_0x9776('0x1b')]=![];this[_0x9776('0x6')][_0x9776('0x12')][this[_0x9776('0x13')]][_0x9776('0x1c')]=undefined;util[_0x9776('0x26')](this[_0x9776('0x6')],this[_0x9776('0x3')],this[_0x9776('0x6')][_0x9776('0x12')][this[_0x9776('0x13')]],this[_0x9776('0x4')][_0x9776('0x27')]);}if(!_0x1604fd){setTimeout(this[_0x9776('0x8')][_0x9776('0xa')](this),0x3e8);}};function rrmemory(_0x403117,_0x5cca73,_0x57c786,_0x1c3470){return new RRMemory(_0x403117,_0x5cca73,_0x57c786,_0x1c3470);}module[_0x9776('0x28')]=rrmemory;
\ No newline at end of file
index b38c302..d075816 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5aa5=['channel','some','saveWaitingNotification','agents','removeWaitingNotification','WaitingInteractions','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','notificationSound','account','body','queue','getMustacheRender','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','save','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications','interaction','UserId','QueuesWaitingInteractions'];(function(_0x2b1041,_0x28297f){var _0x57cd82=function(_0x1086c0){while(--_0x1086c0){_0x2b1041['push'](_0x2b1041['shift']());}};_0x57cd82(++_0x28297f);}(_0x5aa5,0xa3));var _0x55aa=function(_0x5d6ec7,_0x283e2f){_0x5d6ec7=_0x5d6ec7-0x0;var _0x5a2401=_0x5aa5[_0x5d6ec7];return _0x5a2401;};'use strict';var _=require(_0x55aa('0x0'));var util=require(_0x55aa('0x1'));var utils=require(_0x55aa('0x2'));var Redis=require(_0x55aa('0x3'));var config=require(_0x55aa('0x4'));var logger=require(_0x55aa('0x5'))(_0x55aa('0x6'));config['redis']=_[_0x55aa('0x7')](config[_0x55aa('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x55aa('0x9'))(new Redis(config['redis']));function sendNotification(_0x4fd8cf,_0x15c00a,_0x21349e,_0x3d7eee,_0x5a7888,_0x413fa5){io['to'](util[_0x55aa('0xa')](_0x55aa('0xb'),_0x3d7eee[_0x55aa('0xc')]))[_0x55aa('0xd')](_0x55aa('0xe'),_0x3d7eee);var _0x55ff7c=_0x413fa5||{};var _0x358d1f=_0x21349e[_0x55aa('0xf')]('.');var _0x4ce894={'uniqueid':_0x15c00a,'channel':_0x358d1f[0x0],'id':_0x358d1f[0x1],'title':_0x358d1f[0x0]+_0x55aa('0x10'),'interactionId':_0x358d1f[0x2],'queue':_0x5a7888?_0x5a7888['name']:null,'sound':_0x55ff7c['account'][_0x55aa('0x11')],'shake':_0x55ff7c[_0x55aa('0x12')]['notificationShake']};try{if(!_0x55ff7c[_0x55aa('0x13')]){_0x55ff7c[_0x55aa('0x13')]={};}if(_0x5a7888){_0x55ff7c['body'][_0x55aa('0x14')]=_0x5a7888;}else if(_0x55ff7c[_0x55aa('0x13')][_0x55aa('0x14')]){delete _0x55ff7c[_0x55aa('0x13')][_0x55aa('0x14')];}_0x4ce894['msg']=utils[_0x55aa('0x15')](_0x55ff7c[_0x55aa('0x12')]['notificationTemplate'],_0x55ff7c);}catch(_0x2fd62b){_0x4ce894[_0x55aa('0x16')]=_0x55aa('0x17');logger[_0x55aa('0x18')](util[_0x55aa('0xa')](_0x55aa('0x19'),_0x15c00a,_0x2fd62b[_0x55aa('0x1a')]));}io['to'](util[_0x55aa('0xa')](_0x55aa('0xb'),_0x3d7eee[_0x55aa('0xc')]))[_0x55aa('0xd')](util[_0x55aa('0xa')]('notification:%s',_0x4fd8cf?_0x55aa('0x1b'):'remove'),_0x4ce894);}function writeLog(_0x3396e6,_0x4630f3,_0x10deaa){return logger[_0x55aa('0x1c')](util[_0x55aa('0xa')](_0x55aa('0x1d'),_0x3396e6,_0x4630f3['name'],_0x10deaa));}exports[_0x55aa('0x1e')]=function(_0x31338a,_0x305674,_0x527eb5,_0x27c20c){if(_0x305674[_0x55aa('0x1f')]){writeLog(_0x31338a,_0x305674,'BUSY');return![];}if(!_0x305674['online']){writeLog(_0x31338a,_0x305674,'OFFLINE');return![];}if(_0x305674[_0x527eb5+_0x55aa('0x20')]){writeLog(_0x31338a,_0x305674,_0x55aa('0x21'));return![];}if(_0x27c20c&&_0x305674[_0x55aa('0x22')](_0x527eb5+_0x55aa('0x23'))&&_0x305674['hasOwnProperty'](_0x527eb5+_0x55aa('0x24'))){if(_0x305674[_0x527eb5+'Capacity']>0x0&&_0x305674[_0x527eb5+_0x55aa('0x24')]>=_0x305674[_0x527eb5+_0x55aa('0x23')]){writeLog(_0x31338a,_0x305674,_0x527eb5[_0x55aa('0x25')]()+_0x55aa('0x26'));return![];}}return!![];};exports[_0x55aa('0x27')]=function(_0x2c4ee9,_0x299e8f,_0x2a3d53,_0x5e23a1,_0x3c708c){return sendNotification(!![],_0x2c4ee9,_0x299e8f,_0x2a3d53,_0x5e23a1,_0x3c708c);};exports[_0x55aa('0x28')]=function(_0x27235e,_0x1e80b3,_0x383b23,_0x4aa734,_0x54bb51){return sendNotification(![],_0x27235e,_0x1e80b3,_0x383b23,_0x4aa734,_0x54bb51);};exports[_0x55aa('0x29')]=function(_0x33a309,_0x240f9e,_0x10bdc7){var _0x4b7fe0=_0x240f9e[_0x55aa('0x2a')][_0x55aa('0x2b')];if(!_0x4b7fe0&&_0x10bdc7){_0x4b7fe0=_0x10bdc7['id'];}var _0x29397e=_['some'](_0x33a309[_0x240f9e['channel']+_0x55aa('0x2c')],function(_0x556a03){var _0x4ac6bf=_['capitalize'](_0x240f9e[_0x55aa('0x2d')])+'InteractionId';return _0x556a03[_0x4ac6bf]===_0x240f9e[_0x55aa('0x2a')]['id'];});if(!_0x29397e&&_0x4b7fe0){_0x29397e=_[_0x55aa('0x2e')](_0x33a309['agents'][_0x4b7fe0][_0x240f9e[_0x55aa('0x2d')]+'WaitingInteractions'],function(_0x28723a){return _0x28723a['id']===_0x240f9e['interaction']['id'];});}return _0x29397e;};exports[_0x55aa('0x2f')]=function(_0x458ea1,_0x2a85c8,_0x2b49ff,_0x2a8b79){_0x458ea1[_0x55aa('0x30')][_0x2b49ff['id']][_0x2a8b79+'WaitingInteractions'][_0x2a85c8[_0x55aa('0x1a')]['id']]={'id':_0x2a85c8[_0x55aa('0x2a')]['id']};};exports[_0x55aa('0x31')]=function(_0x47ca31,_0x3b7adc,_0x5529a3,_0x508654){delete _0x47ca31[_0x55aa('0x30')][_0x5529a3['id']][_0x508654+_0x55aa('0x32')][_0x3b7adc[_0x55aa('0x1a')]['id']];};exports[_0x55aa('0x33')]=writeLog;
\ No newline at end of file
+var _0x851e=['interaction','UserId','some','channel','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','notification:%s','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','checkWaitingNotifications'];(function(_0x153d3f,_0x242877){var _0x3e78a5=function(_0x3ea851){while(--_0x3ea851){_0x153d3f['push'](_0x153d3f['shift']());}};_0x3e78a5(++_0x242877);}(_0x851e,0x177));var _0xe851=function(_0x2d0cdd,_0x5b25b4){_0x2d0cdd=_0x2d0cdd-0x0;var _0x30ba3a=_0x851e[_0x2d0cdd];return _0x30ba3a;};'use strict';var _=require(_0xe851('0x0'));var util=require('util');var utils=require(_0xe851('0x1'));var Redis=require(_0xe851('0x2'));var config=require(_0xe851('0x3'));var logger=require(_0xe851('0x4'))(_0xe851('0x5'));config[_0xe851('0x6')]=_['defaults'](config[_0xe851('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe851('0x7'))(new Redis(config['redis']));function sendNotification(_0x34b61c,_0x4fd4df,_0x48297a,_0x326243,_0x545c35,_0x1d24f3){io['to'](util[_0xe851('0x8')](_0xe851('0x9'),_0x326243[_0xe851('0xa')]))[_0xe851('0xb')](_0xe851('0xc'),_0x326243);var _0x82b3fb=_0x1d24f3||{};var _0x2856ba=_0x48297a[_0xe851('0xd')]('.');var _0x14530e={'uniqueid':_0x4fd4df,'channel':_0x2856ba[0x0],'id':_0x2856ba[0x1],'title':_0x2856ba[0x0]+_0xe851('0xe'),'interactionId':_0x2856ba[0x2],'queue':_0x545c35?_0x545c35[_0xe851('0xa')]:null,'sound':_0x82b3fb[_0xe851('0xf')][_0xe851('0x10')],'shake':_0x82b3fb[_0xe851('0xf')][_0xe851('0x11')]};try{if(!_0x82b3fb[_0xe851('0x12')]){_0x82b3fb[_0xe851('0x12')]={};}if(_0x545c35){_0x82b3fb[_0xe851('0x12')][_0xe851('0x13')]=_0x545c35;}else if(_0x82b3fb[_0xe851('0x12')][_0xe851('0x13')]){delete _0x82b3fb[_0xe851('0x12')][_0xe851('0x13')];}_0x14530e[_0xe851('0x14')]=utils['getMustacheRender'](_0x82b3fb[_0xe851('0xf')]['notificationTemplate'],_0x82b3fb);}catch(_0x592a2b){_0x14530e[_0xe851('0x14')]=_0xe851('0x15');logger['error'](util[_0xe851('0x8')](_0xe851('0x16'),_0x4fd4df,_0x592a2b[_0xe851('0x17')]));}io['to'](util[_0xe851('0x8')](_0xe851('0x9'),_0x326243[_0xe851('0xa')]))[_0xe851('0xb')](util[_0xe851('0x8')](_0xe851('0x18'),_0x34b61c?'save':_0xe851('0x19')),_0x14530e);}function writeLog(_0x4da1e2,_0x18b126,_0x525b3e){return logger['debug'](util[_0xe851('0x8')](_0xe851('0x1a'),_0x4da1e2,_0x18b126['name'],_0x525b3e));}exports[_0xe851('0x1b')]=function(_0x36f0ba,_0x3efe3b,_0x191375,_0x1f866c){if(_0x3efe3b['busy']){writeLog(_0x36f0ba,_0x3efe3b,_0xe851('0x1c'));return![];}if(!_0x3efe3b[_0xe851('0x1d')]){writeLog(_0x36f0ba,_0x3efe3b,_0xe851('0x1e'));return![];}if(_0x3efe3b[_0x191375+_0xe851('0x1f')]){writeLog(_0x36f0ba,_0x3efe3b,_0xe851('0x20'));return![];}if(_0x1f866c&&_0x3efe3b['hasOwnProperty'](_0x191375+_0xe851('0x21'))&&_0x3efe3b[_0xe851('0x22')](_0x191375+_0xe851('0x23'))){if(_0x3efe3b[_0x191375+_0xe851('0x21')]>0x0&&_0x3efe3b[_0x191375+_0xe851('0x23')]>=_0x3efe3b[_0x191375+_0xe851('0x21')]){writeLog(_0x36f0ba,_0x3efe3b,_0x191375[_0xe851('0x24')]()+_0xe851('0x25'));return![];}}return!![];};exports[_0xe851('0x26')]=function(_0x59395b,_0x219e09,_0x4d54b0,_0xb109e,_0xcf2b23){return sendNotification(!![],_0x59395b,_0x219e09,_0x4d54b0,_0xb109e,_0xcf2b23);};exports[_0xe851('0x27')]=function(_0x29d159,_0x476c6b,_0x16911a,_0xc0a98d,_0x4c3d83){return sendNotification(![],_0x29d159,_0x476c6b,_0x16911a,_0xc0a98d,_0x4c3d83);};exports[_0xe851('0x28')]=function(_0x22bdc7,_0xd954c2,_0x10728f){var _0x3b79df=_0xd954c2[_0xe851('0x29')][_0xe851('0x2a')];if(!_0x3b79df&&_0x10728f){_0x3b79df=_0x10728f['id'];}var _0x3c115b=_[_0xe851('0x2b')](_0x22bdc7[_0xd954c2[_0xe851('0x2c')]+'QueuesWaitingInteractions'],function(_0x49f3f1){var _0xb1a2ec=_[_0xe851('0x2d')](_0xd954c2['channel'])+_0xe851('0x2e');return _0x49f3f1[_0xb1a2ec]===_0xd954c2[_0xe851('0x29')]['id'];});if(!_0x3c115b&&_0x3b79df){_0x3c115b=_[_0xe851('0x2b')](_0x22bdc7[_0xe851('0x2f')][_0x3b79df][_0xd954c2[_0xe851('0x2c')]+_0xe851('0x30')],function(_0x3d5e57){return _0x3d5e57['id']===_0xd954c2['interaction']['id'];});}return _0x3c115b;};exports[_0xe851('0x31')]=function(_0x387ff1,_0x346dc1,_0x234b2f,_0x55f04b){_0x387ff1[_0xe851('0x2f')][_0x234b2f['id']][_0x55f04b+_0xe851('0x30')][_0x346dc1[_0xe851('0x17')]['id']]={'id':_0x346dc1[_0xe851('0x29')]['id']};};exports[_0xe851('0x32')]=function(_0x203524,_0x21be76,_0x3ab1ed,_0x4c3248){delete _0x203524[_0xe851('0x2f')][_0x3ab1ed['id']][_0x4c3248+_0xe851('0x30')][_0x21be76[_0xe851('0x17')]['id']];};exports[_0xe851('0x33')]=writeLog;
\ No newline at end of file
index a15af1a..09736d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9de=['message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map'];(function(_0xf80808,_0x675e16){var _0x3c9420=function(_0x1f0f50){while(--_0x1f0f50){_0xf80808['push'](_0xf80808['shift']());}};_0x3c9420(++_0x675e16);}(_0xd9de,0x160));var _0xed9d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd9de[_0x397e5f];return _0x5302b8;};'use strict';var schema=require('validate');var sh=require(_0xed9d('0x0'));var _=require(_0xed9d('0x1'));var utils=require('./utils');var logger=require(_0xed9d('0x2'))(_0xed9d('0x3'));var system=schema({'command':{'type':_0xed9d('0x4'),'required':!![],'message':_0xed9d('0x5')}});exports[_0xed9d('0x6')]=function(_0x2b3dbd,_0x33c751){return function(_0x2e1718){try{var _0xcadc38={'command':_0x33c751[0x0]};var _0x4a1d46=system[_0xed9d('0x7')](_0xcadc38,{'typecast':!![]});if(_0x4a1d46[_0xed9d('0x8')]){logger[_0xed9d('0x9')](_0xed9d('0xa'),_0x2b3dbd,_[_0xed9d('0xb')](_0x4a1d46,_0xed9d('0xc'))[_0xed9d('0xd')](',\x20'));logger[_0xed9d('0xe')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2b3dbd);_0x2e1718['next']();}else{var _0x4e1d68=this;var _0x139d19=utils[_0xed9d('0xf')](_0x33c751[0x0],this);logger[_0xed9d('0xe')](_0xed9d('0x10'),_0x2b3dbd,_0x139d19);sh[_0xed9d('0x11')](_[_0xed9d('0x12')](_0x139d19),function(_0x38277c,_0x1bd156){logger[_0xed9d('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2b3dbd,_0x38277c);if(_0x38277c==0x0){var _0x142269=_0x1bd156[_0xed9d('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x33c751[0x1])||_[_0xed9d('0x14')](_0x33c751[0x1])){logger[_0xed9d('0xe')](_0xed9d('0x15'),_0x2b3dbd);_0x4e1d68[_0xed9d('0x16')][_0x33c751[0x1]]=_0x142269;}else{logger[_0xed9d('0xe')](_0xed9d('0x17'),_0x2b3dbd,_0x33c751[0x1],_0x142269);_0x4e1d68['body'][_0x33c751[0x1]]=_0x142269;}}_0x2e1718[_0xed9d('0x18')]();});}}catch(_0x565f8b){logger[_0xed9d('0x9')](_0xed9d('0xa'),_0x2b3dbd,_[_0xed9d('0x19')](_0x565f8b)?JSON[_0xed9d('0x1a')](_0x565f8b):_0x565f8b);logger[_0xed9d('0xe')](_0xed9d('0x1b'),_0x2b3dbd);_0x2e1718[_0xed9d('0x18')]();}};};
\ No newline at end of file
+var _0x3337=['isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x5e9b8f,_0x31aa85){var _0xfbda62=function(_0xc9e587){while(--_0xc9e587){_0x5e9b8f['push'](_0x5e9b8f['shift']());}};_0xfbda62(++_0x31aa85);}(_0x3337,0x12e));var _0x7333=function(_0x25f797,_0x449916){_0x25f797=_0x25f797-0x0;var _0x157fdd=_0x3337[_0x25f797];return _0x157fdd;};'use strict';var schema=require(_0x7333('0x0'));var sh=require(_0x7333('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0x7333('0x2'))(_0x7333('0x3'));var system=schema({'command':{'type':_0x7333('0x4'),'required':!![],'message':_0x7333('0x5')}});exports[_0x7333('0x6')]=function(_0x388430,_0x207847){return function(_0x4f3527){try{var _0x36e66a={'command':_0x207847[0x0]};var _0x636aa6=system[_0x7333('0x0')](_0x36e66a,{'typecast':!![]});if(_0x636aa6[_0x7333('0x7')]){logger[_0x7333('0x8')](_0x7333('0x9'),_0x388430,_['map'](_0x636aa6,_0x7333('0xa'))[_0x7333('0xb')](',\x20'));logger[_0x7333('0xc')](_0x7333('0xd'),_0x388430);_0x4f3527[_0x7333('0xe')]();}else{var _0x216cdf=this;var _0x3616d2=utils[_0x7333('0xf')](_0x207847[0x0],this);logger['info'](_0x7333('0x10'),_0x388430,_0x3616d2);sh[_0x7333('0x11')](_[_0x7333('0x12')](_0x3616d2),function(_0x481563,_0xe92b73){logger[_0x7333('0xc')](_0x7333('0x13'),_0x388430,_0x481563);if(_0x481563==0x0){var _0x2c3bc8=_0xe92b73[_0x7333('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x7333('0x15')](_0x207847[0x1])||_[_0x7333('0x16')](_0x207847[0x1])){logger['info'](_0x7333('0x17'),_0x388430);_0x216cdf['body'][_0x207847[0x1]]=_0x2c3bc8;}else{logger[_0x7333('0xc')](_0x7333('0x18'),_0x388430,_0x207847[0x1],_0x2c3bc8);_0x216cdf['body'][_0x207847[0x1]]=_0x2c3bc8;}}_0x4f3527[_0x7333('0xe')]();});}}catch(_0x5014f4){logger[_0x7333('0x8')](_0x7333('0x9'),_0x388430,_[_0x7333('0x19')](_0x5014f4)?JSON[_0x7333('0x1a')](_0x5014f4):_0x5014f4);logger[_0x7333('0xc')](_0x7333('0xd'),_0x388430);_0x4f3527['next']();}};};
\ No newline at end of file
index 89c09b3..d896f31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9075=['catch','stringify','isObject','validate','lodash','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction'];(function(_0x34e885,_0x3a67a4){var _0x138046=function(_0x4b2a48){while(--_0x4b2a48){_0x34e885['push'](_0x34e885['shift']());}};_0x138046(++_0x3a67a4);}(_0x9075,0xd2));var _0x5907=function(_0x5d547f,_0x50a029){_0x5d547f=_0x5d547f-0x0;var _0x66efe3=_0x9075[_0x5d547f];return _0x66efe3;};'use strict';var schema=require(_0x5907('0x0'));var _=require(_0x5907('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x5907('0x2')),'mailInteraction':require(_0x5907('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x5907('0x4'))};var logger=require('../../../../config/logger')(_0x5907('0x5'));var tag=schema({'tag':{'type':_0x5907('0x6'),'required':!![],'message':_0x5907('0x7')}});exports['consequence']=function(_0x2cfe90,_0x4348bf,_0x33abb,_0x4c3f55){return function(_0x2c472a){try{var _0x3fa7ab={'tag':_0x4348bf[0x0]};var _0x5bacaa=tag[_0x5907('0x0')](_0x3fa7ab,{'typecast':!![]});if(_0x5bacaa['length']){logger[_0x5907('0x8')](_0x5907('0x9'),_0x2cfe90,_[_0x5907('0xa')](_0x5bacaa,_0x5907('0xb'))[_0x5907('0xc')](',\x20'));logger[_0x5907('0xd')](_0x5907('0xe'),_0x2cfe90);_0x2c472a[_0x5907('0xf')]();}else{var _0x1d07a9={'ids':[_0x4348bf[0x0]]};if(rpc[_0x4c3f55[_0x5907('0x10')]+'Interaction']){rpc[_0x4c3f55[_0x5907('0x10')]+_0x5907('0x11')]['addTags'](_0x4c3f55['interaction']['id'],_0x1d07a9)['then'](function(_0x1837d5){logger[_0x5907('0xd')](_0x5907('0x12'),_0x2cfe90,_0x4348bf[0x1],_0x4c3f55[_0x5907('0x10')],_0x4c3f55[_0x5907('0x13')]['id']);})[_0x5907('0x14')](function(_0x5b5cc1){logger[_0x5907('0x8')](_0x5907('0x9'),_0x2cfe90,JSON[_0x5907('0x15')](_0x5b5cc1));logger[_0x5907('0xd')](_0x5907('0xe'),_0x2cfe90);})['finally'](function(){_0x2c472a['next']();});}}}catch(_0x273e0d){logger[_0x5907('0x8')](_0x5907('0x9'),_0x2cfe90,_[_0x5907('0x16')](_0x273e0d)?JSON[_0x5907('0x15')](_0x273e0d):_0x273e0d);logger[_0x5907('0xd')](_0x5907('0xe'),_0x2cfe90);_0x2c472a[_0x5907('0xf')]();}};};
\ No newline at end of file
+var _0x0d63=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x27c023,_0x14ace3){var _0x432271=function(_0x1581d5){while(--_0x1581d5){_0x27c023['push'](_0x27c023['shift']());}};_0x432271(++_0x14ace3);}(_0x0d63,0x130));var _0x30d6=function(_0x5bc27a,_0x3471d1){_0x5bc27a=_0x5bc27a-0x0;var _0x93af7d=_0x0d63[_0x5bc27a];return _0x93af7d;};'use strict';var schema=require(_0x30d6('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x30d6('0x1')),'openchannelInteraction':require(_0x30d6('0x2')),'smsInteraction':require(_0x30d6('0x3')),'mailInteraction':require(_0x30d6('0x4')),'faxInteraction':require(_0x30d6('0x5')),'whatsappInteraction':require(_0x30d6('0x6'))};var logger=require(_0x30d6('0x7'))(_0x30d6('0x8'));var tag=schema({'tag':{'type':_0x30d6('0x9'),'required':!![],'message':_0x30d6('0xa')}});exports['consequence']=function(_0x427acb,_0x1664ff,_0x179b56,_0x386537){return function(_0x4a3692){try{var _0x365ded={'tag':_0x1664ff[0x0]};var _0x1b99c8=tag[_0x30d6('0x0')](_0x365ded,{'typecast':!![]});if(_0x1b99c8['length']){logger[_0x30d6('0xb')](_0x30d6('0xc'),_0x427acb,_[_0x30d6('0xd')](_0x1b99c8,_0x30d6('0xe'))[_0x30d6('0xf')](',\x20'));logger[_0x30d6('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x427acb);_0x4a3692[_0x30d6('0x11')]();}else{var _0xb7c38f={'ids':[_0x1664ff[0x0]]};if(rpc[_0x386537[_0x30d6('0x12')]+_0x30d6('0x13')]){rpc[_0x386537[_0x30d6('0x12')]+_0x30d6('0x13')][_0x30d6('0x14')](_0x386537[_0x30d6('0x15')]['id'],_0xb7c38f)[_0x30d6('0x16')](function(_0x2f563e){logger['info'](_0x30d6('0x17'),_0x427acb,_0x1664ff[0x1],_0x386537['channel'],_0x386537[_0x30d6('0x15')]['id']);})[_0x30d6('0x18')](function(_0x42cb80){logger[_0x30d6('0xb')](_0x30d6('0xc'),_0x427acb,JSON[_0x30d6('0x19')](_0x42cb80));logger[_0x30d6('0x10')](_0x30d6('0x1a'),_0x427acb);})[_0x30d6('0x1b')](function(){_0x4a3692[_0x30d6('0x11')]();});}}}catch(_0x24576b){logger[_0x30d6('0xb')](_0x30d6('0xc'),_0x427acb,_['isObject'](_0x24576b)?JSON['stringify'](_0x24576b):_0x24576b);logger[_0x30d6('0x10')](_0x30d6('0x1a'),_0x427acb);_0x4a3692[_0x30d6('0x11')]();}};};
\ No newline at end of file
index 77d6a03..986ae94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cc0=['&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','../../../../config/logger','routing','lodash','replace','\x20-\x20','includes','?params=','title','2.0','method','login','push','params','stringify','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId='];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3cc0,0x10d));var _0x03cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3cc0[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var logger=require(_0x03cc('0x0'))(_0x03cc('0x1'));var _=require(_0x03cc('0x2'));var arr=[];exports['consequence']=function(_0x5495fd,_0x401b97){return function(_0x1ff7ef){var _0x214c0f=_0x401b97[0xa];var _0x188f66=_0x401b97[0xb];var _0x51477e=_0x401b97[0xc];var _0x274156=_0x401b97[0xd];var _0x23b4a4=_0x401b97[0xe];var _0x355f7b=_0x401b97[0xf][_0x03cc('0x3')](/\n/g,_0x03cc('0x4'));var _0x2c5418=_0x401b97[0x10][_0x03cc('0x3')](/\n/g,'\x20');if(!arr[_0x03cc('0x5')](_0x188f66)){arr['push'](_0x188f66);var _0x12514c=_0x401b97[0x3];var _0x109e70=_0x401b97[0x4];var _0x369ccc=_0x401b97[0x1];var _0x561861=_0x401b97[0x0];var _0x4e3123={};_0x4e3123['urlOnAnswer']=_0x401b97[0x8]+_0x03cc('0x6')+_0x51477e+'|'+_0x214c0f+'|'+_0x274156+'|'+_0x188f66+'|'+_0x23b4a4;_0x4e3123['urlOnRing']=_0x401b97[0x7]+_0x03cc('0x6')+_0x51477e+'|'+_0x214c0f+'|'+_0x274156+'|'+_0x188f66+'|'+_0x23b4a4+'|'+_0x355f7b+'|'+_0x2c5418;_0x4e3123[_0x03cc('0x7')]=_0x401b97[0x9];var _0x15ed96={};_0x15ed96['jsonrpc']=_0x03cc('0x8');_0x15ed96[_0x03cc('0x9')]=_0x03cc('0xa');var _0x1bdb3a=[];_0x1bdb3a[_0x03cc('0xb')](_0x401b97[0x2]);_0x1bdb3a[_0x03cc('0xb')](_0x401b97[0x5]);_0x1bdb3a['push'](_0x401b97[0x6]);_0x15ed96[_0x03cc('0xc')]=_0x1bdb3a;_0x15ed96['id']=0x1;var _0x1e1175=JSON[_0x03cc('0xd')](_0x15ed96);var _0x230f3f={'encoding':'utf8','method':'POST','timeout':0x2710,'url':_0x12514c,'headers':{'Content-Type':_0x03cc('0xe')},'body':_0x1e1175};return rp(_0x230f3f)[_0x03cc('0xf')](function(_0x197a62){const _0x2927ed=JSON[_0x03cc('0x10')](_0x197a62);if(!_0x2927ed[_0x03cc('0x11')]['logged']){throw new Error(_0x03cc('0x12'));}var _0x397bc6=_0x188f66;var _0x54f6a8=_0x03cc('0x13')+_0x369ccc+'&serviceId='+_0x561861+_0x03cc('0x14')+_0x397bc6+_0x03cc('0x15')+JSON[_0x03cc('0xd')](_0x4e3123);var _0x1db891=_0x109e70+'?'+_0x54f6a8;return rp(_0x1db891);})['then'](function(_0x3658a5){logger[_0x03cc('0x16')](_0x03cc('0x17'),_0x5495fd,_0x3658a5);_0x1ff7ef[_0x03cc('0x18')]();})['catch'](function(_0x22fc8a){logger[_0x03cc('0x19')](_0x03cc('0x1a'),_0x5495fd,_[_0x03cc('0x1b')](_0x22fc8a)?JSON[_0x03cc('0xd')](_0x22fc8a):_0x22fc8a);_0x1ff7ef['stop']();});}else{logger[_0x03cc('0x16')](_0x03cc('0x1c'),_0x5495fd);_0x1ff7ef['next']();}};};
\ No newline at end of file
+var _0xe597=['POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','jsonrpc','2.0','method','login','stringify','utf8'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xe597,0x7f));var _0x7e59=function(_0x596905,_0x17c3b2){_0x596905=_0x596905-0x0;var _0x1ec83d=_0xe597[_0x596905];return _0x1ec83d;};'use strict';var rp=require(_0x7e59('0x0'));var logger=require(_0x7e59('0x1'))(_0x7e59('0x2'));var _=require(_0x7e59('0x3'));var arr=[];exports[_0x7e59('0x4')]=function(_0x128adb,_0x1ca340){return function(_0xa3c741){var _0x45cb1c=_0x1ca340[0xa];var _0x53b4e4=_0x1ca340[0xb];var _0x4b57a4=_0x1ca340[0xc];var _0x5d4d6b=_0x1ca340[0xd];var _0x1f27e=_0x1ca340[0xe];var _0x459c72=_0x1ca340[0xf][_0x7e59('0x5')](/\n/g,_0x7e59('0x6'));var _0x1be1f7=_0x1ca340[0x10][_0x7e59('0x5')](/\n/g,'\x20');if(!arr[_0x7e59('0x7')](_0x53b4e4)){arr[_0x7e59('0x8')](_0x53b4e4);var _0x38f65f=_0x1ca340[0x3];var _0x2f7ecf=_0x1ca340[0x4];var _0x681ba2=_0x1ca340[0x1];var _0x1f2700=_0x1ca340[0x0];var _0x2181d6={};_0x2181d6[_0x7e59('0x9')]=_0x1ca340[0x8]+_0x7e59('0xa')+_0x4b57a4+'|'+_0x45cb1c+'|'+_0x5d4d6b+'|'+_0x53b4e4+'|'+_0x1f27e;_0x2181d6['urlOnRing']=_0x1ca340[0x7]+_0x7e59('0xa')+_0x4b57a4+'|'+_0x45cb1c+'|'+_0x5d4d6b+'|'+_0x53b4e4+'|'+_0x1f27e+'|'+_0x459c72+'|'+_0x1be1f7;_0x2181d6['title']=_0x1ca340[0x9];var _0x5747e2={};_0x5747e2[_0x7e59('0xb')]=_0x7e59('0xc');_0x5747e2[_0x7e59('0xd')]=_0x7e59('0xe');var _0x446c03=[];_0x446c03[_0x7e59('0x8')](_0x1ca340[0x2]);_0x446c03[_0x7e59('0x8')](_0x1ca340[0x5]);_0x446c03[_0x7e59('0x8')](_0x1ca340[0x6]);_0x5747e2['params']=_0x446c03;_0x5747e2['id']=0x1;var _0xad9e10=JSON[_0x7e59('0xf')](_0x5747e2);var _0x2d7064={'encoding':_0x7e59('0x10'),'method':_0x7e59('0x11'),'timeout':0x2710,'url':_0x38f65f,'headers':{'Content-Type':_0x7e59('0x12')},'body':_0xad9e10};return rp(_0x2d7064)[_0x7e59('0x13')](function(_0x4721c6){const _0x6e56e9=JSON[_0x7e59('0x14')](_0x4721c6);if(!_0x6e56e9[_0x7e59('0x15')][_0x7e59('0x16')]){throw new Error(_0x7e59('0x17'));}var _0x3f4c4e=_0x53b4e4;var _0x39333e='channelId='+_0x681ba2+_0x7e59('0x18')+_0x1f2700+_0x7e59('0x19')+_0x3f4c4e+_0x7e59('0x1a')+JSON[_0x7e59('0xf')](_0x2181d6);var _0x402bdd=_0x2f7ecf+'?'+_0x39333e;return rp(_0x402bdd);})['then'](function(_0x4b02bf){logger['info'](_0x7e59('0x1b'),_0x128adb,_0x4b02bf);_0xa3c741[_0x7e59('0x1c')]();})[_0x7e59('0x1d')](function(_0x15b024){logger[_0x7e59('0x1e')](_0x7e59('0x1f'),_0x128adb,_[_0x7e59('0x20')](_0x15b024)?JSON['stringify'](_0x15b024):_0x15b024);_0xa3c741[_0x7e59('0x1c')]();});}else{logger[_0x7e59('0x21')](_0x7e59('0x22'),_0x128adb);_0xa3c741[_0x7e59('0x23')]();}};};
\ No newline at end of file
index 3f04436..8890e00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x543e81,_0x447282){var _0xcef42a=function(_0x1c499c){while(--_0x1c499c){_0x543e81['push'](_0x543e81['shift']());}};_0xcef42a(++_0x447282);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
+var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x37f623,_0x3ab407){var _0x15737b=function(_0x45bb67){while(--_0x45bb67){_0x37f623['push'](_0x37f623['shift']());}};_0x15737b(++_0x3ab407);}(_0xe706,0xa3));var _0x6e70=function(_0x56edce,_0x3718d7){_0x56edce=_0x56edce-0x0;var _0x3ea2fe=_0xe706[_0x56edce];return _0x3ea2fe;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
index 2c4e957..8bb6d2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7a8=['server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','.js','toLowerCase','appdata','split','mail','push','slice','dialogflow','join','dialogflowv2','amazonlex','tag','TagId','tvox','getMustacheRender','account','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf7a8,0x71));var _0x8f7a=function(_0x16cd43,_0x5a7e02){_0x16cd43=_0x16cd43-0x0;var _0xbc906a=_0xf7a8[_0x16cd43];return _0xbc906a;};'use strict';var _=require(_0x8f7a('0x0'));var util=require(_0x8f7a('0x1'));var path=require(_0x8f7a('0x2'));var fs=require('fs');var jayson=require(_0x8f7a('0x3'));var BPromise=require(_0x8f7a('0x4'));var utils=require(_0x8f7a('0x5'));var sUtils=require('./applications/strategy/util');var logger=require('../../../config/logger')(_0x8f7a('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8f7a('0x7')),'chatQueueReport':require(_0x8f7a('0x8')),'smsQueueReport':require(_0x8f7a('0x9')),'faxQueueReport':require(_0x8f7a('0xa')),'whatsappQueueReport':require(_0x8f7a('0xb'))};var RuleEngine=require(_0x8f7a('0xc'));function getId(_0x1981b1,_0x2dd4a4,_0x4993b7){return util[_0x8f7a('0xd')](_0x8f7a('0xe'),_0x1981b1,_0x2dd4a4||0x0,_0x4993b7||0x0);}function getIntervals(_0xc32962,_0x5ce80f){var _0x6afc96=[];if(!_[_0x8f7a('0xf')](_0x5ce80f[_0x8f7a('0x10')])&&!_[_0x8f7a('0xf')](_0xc32962[_0x5ce80f[_0x8f7a('0x10')]])&&!_[_0x8f7a('0xf')](_0xc32962[_0x5ce80f['IntervalId']][_0x8f7a('0x11')])){_0x6afc96=_[_0x8f7a('0x12')](_0xc32962[_0x5ce80f[_0x8f7a('0x10')]][_0x8f7a('0x11')],_0x8f7a('0x13'));}else if(!_[_0x8f7a('0xf')](_0x5ce80f[_0x8f7a('0x13')])){_0x6afc96=[_0x5ce80f['interval']];}return _0x6afc96;}exports[_0x8f7a('0x14')]=function(_0x15534b){_0x15534b[_0x8f7a('0x15')]={};return new BPromise(function(_0x2b4613,_0x2e1dda){var _0x3c7252={'Start':function(_0x592869){var _0x4b5395=this;return new Promise(function(_0x15c5de,_0x221405){if(_0x592869){try{var _0x4b5fd8=[];var _0x58bbdc=getId(_0x592869[_0x8f7a('0x16')],_0x592869['message']?_0x592869[_0x8f7a('0x17')]['id']:0x0,_0x592869[_0x8f7a('0x18')]?_0x592869[_0x8f7a('0x18')]['id']:0x0);var _0x502fe5=sUtils['checkWaitingNotifications'](_0x15534b,_0x592869);if(!_0x502fe5&&_0x592869[_0x8f7a('0x19')]&&_[_0x8f7a('0x1a')](_0x592869[_0x8f7a('0x19')])&&_0x592869[_0x8f7a('0x19')][_0x8f7a('0x1b')]){for(var _0x20bc98=0x0;_0x20bc98<_0x592869['applications']['length'];_0x20bc98+=0x1){var _0x12f705=_0x592869[_0x8f7a('0x19')][_0x20bc98];if(fs[_0x8f7a('0x1c')](path['join'](__dirname,'applications',_0x12f705[_0x8f7a('0x1d')]+_0x8f7a('0x1e')))){var _0x479e9e=[];switch(_0x12f705['app'][_0x8f7a('0x1f')]()){case'autoreply':var _0x52ed1a=_0x12f705[_0x8f7a('0x20')][_0x8f7a('0x21')](',');if(_0x592869[_0x8f7a('0x16')]===_0x8f7a('0x22')){_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x52ed1a['slice'](0x2,_0x52ed1a[_0x8f7a('0x1b')])['join'](','));}else{_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x52ed1a[_0x8f7a('0x24')](0x1,_0x52ed1a[_0x8f7a('0x1b')])['join'](','));}break;case _0x8f7a('0x25'):var _0x228c95=_0x12f705['appdata'][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x228c95[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x228c95[0x1]);_0x479e9e['push'](_0x228c95['slice'](0x2,_0x228c95[_0x8f7a('0x1b')])[_0x8f7a('0x26')](','));break;case _0x8f7a('0x27'):var _0x543248=_0x12f705['appdata'][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x543248[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x543248[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x543248[0x2]);_0x479e9e[_0x8f7a('0x23')](_0x543248[0x3]);_0x479e9e[_0x8f7a('0x23')](_0x543248[_0x8f7a('0x24')](0x4,_0x543248[_0x8f7a('0x1b')])[_0x8f7a('0x26')](','));break;case _0x8f7a('0x28'):var _0x3b7d04=_0x12f705['appdata'][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x0]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x2]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04[0x3]);_0x479e9e[_0x8f7a('0x23')](_0x3b7d04['slice'](0x4,_0x3b7d04['length'])[_0x8f7a('0x26')](','));break;case _0x8f7a('0x17'):_0x479e9e[_0x8f7a('0x23')](_0x12f705[_0x8f7a('0x20')]);break;case _0x8f7a('0x29'):_0x479e9e['push'](_0x12f705[_0x8f7a('0x2a')]);_0x479e9e[_0x8f7a('0x23')](_0x12f705[_0x8f7a('0x20')]);break;case _0x8f7a('0x2b'):var _0xe94d89=utils[_0x8f7a('0x2c')](_0x592869[_0x8f7a('0x2d')]['notificationTemplate'],_0x592869);var _0x390ae1=_0x12f705[_0x8f7a('0x20')][_0x8f7a('0x21')](',');_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x0]);_0x479e9e['push'](_0x390ae1[0x1]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x2]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x3]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x4]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x5]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x6]);_0x479e9e['push'](_0x390ae1[0x7]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x8]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0x9]);_0x479e9e[_0x8f7a('0x23')](_0x390ae1[0xa]);_0x479e9e['push'](_0x592869[_0x8f7a('0x18')]['id']);_0x479e9e['push'](_0x592869['message']['id']);_0x479e9e[_0x8f7a('0x23')](_0x12f705[_0x8f7a('0x2e')]);_0x479e9e['push'](_0x592869['interaction'][_0x8f7a('0x2f')]);_0x479e9e[_0x8f7a('0x23')](_0x592869[_0x8f7a('0x30')][_0x8f7a('0x30')]);_0x479e9e[_0x8f7a('0x23')](_0xe94d89);break;default:_0x479e9e=_[_0x8f7a('0xf')](_0x12f705[_0x8f7a('0x20')])?[]:_0x12f705[_0x8f7a('0x20')][_0x8f7a('0x21')](',');}var _0x561b06={'id':util[_0x8f7a('0xd')](_0x8f7a('0x31'),_0x58bbdc,_0x12f705['id'],_0x12f705[_0x8f7a('0x1d')]),'condition':require(_0x8f7a('0x32'))[_0x8f7a('0x33')](_0x58bbdc,getIntervals(_0x15534b['intervals'],_0x12f705),_0x15534b),'consequence':require('./applications/'+_0x12f705['app'])[_0x8f7a('0x34')](_0x58bbdc,_0x479e9e,_0x15534b,_0x592869),'p':_0x12f705[_0x8f7a('0x35')]||0x0};logger[_0x8f7a('0x36')](_0x8f7a('0x37'),_0x561b06['id'],_0x8f7a('0x38'),getIntervals(_0x15534b[_0x8f7a('0x39')],_0x12f705)[_0x8f7a('0x26')](_0x8f7a('0x3a')));_0x4b5fd8[_0x8f7a('0x23')](_0x561b06);}else{logger[_0x8f7a('0x3b')](_0x8f7a('0x3c'),path[_0x8f7a('0x26')](__dirname,'applications',_0x12f705[_0x8f7a('0x1d')]+_0x8f7a('0x1e')));}}_0x15534b['rules'][_0x58bbdc]=new RuleEngine(_0x4b5fd8);_0x15534b[_0x8f7a('0x15')][_0x58bbdc][_0x8f7a('0x3d')](_0x592869,function(_0x42b948){logger[_0x8f7a('0x36')](_0x8f7a('0x3e'),JSON[_0x8f7a('0x3f')](_0x42b948['matchPath']));if(_0x15534b[_0x8f7a('0x15')][_0x58bbdc]){_0x15534b[_0x8f7a('0x15')][_0x58bbdc][_0x8f7a('0x40')](_0x8f7a('0x41'));}});return _0x15c5de({'code':0xc8,'message':_0x592869});}else{if(_0x502fe5){logger['info'](util[_0x8f7a('0xd')](_0x8f7a('0x42'),_0x58bbdc));}else{logger['info'](_0x8f7a('0x43'));}return _0x15c5de({'code':0xc8,'message':_0x592869});}}catch(_0x954833){logger[_0x8f7a('0x3b')](_0x954833[_0x8f7a('0x44')]);return _0x221405(_0x4b5395[_0x8f7a('0x3b')](0x1f4,_0x954833));}}return _0x221405(_0x8f7a('0x45'));});},'AcceptMessage':function(_0x30cc51){var _0x68327=this;return new Promise(function(_0x5718ee,_0x47eb4c){if(_0x30cc51[_0x8f7a('0x46')]&&_0x30cc51['agent']['id']){if(_0x15534b[_0x8f7a('0x47')][_0x30cc51[_0x8f7a('0x46')]['id']]){_0x15534b[_0x8f7a('0x47')][_0x30cc51[_0x8f7a('0x46')]['id']]['busy']=![];_0x15534b['agents'][_0x30cc51[_0x8f7a('0x46')]['id']][_0x8f7a('0x48')]=undefined;}}if(_0x30cc51[_0x8f7a('0x17')]&&_0x30cc51[_0x8f7a('0x17')]['id']){try{var _0x53056e=getId(_0x30cc51[_0x8f7a('0x16')],_0x30cc51['message']?_0x30cc51[_0x8f7a('0x17')]['id']:0x0,_0x30cc51[_0x8f7a('0x18')]?_0x30cc51[_0x8f7a('0x18')]['id']:0x0);if(_0x15534b[_0x8f7a('0x15')][_0x53056e]){_0x15534b[_0x8f7a('0x15')][_0x53056e]['emit'](_0x8f7a('0x49'));if(rpc[_0x30cc51['channel']+_0x8f7a('0x4a')]){rpc[_0x30cc51[_0x8f7a('0x16')]+'QueueReport'][_0x8f7a('0x4b')](_0x53056e,{'UserId':_0x30cc51[_0x8f7a('0x17')][_0x8f7a('0x4c')]})[_0x8f7a('0x4d')](function(){logger[_0x8f7a('0x3b')](_0x8f7a('0x4e'));});}}return _0x5718ee({'code':0xc8,'message':_0x30cc51});}catch(_0x10d010){logger[_0x8f7a('0x3b')](_0x10d010[_0x8f7a('0x44')]);return _0x47eb4c(_0x68327[_0x8f7a('0x3b')](0x1f4,_0x10d010));}}logger[_0x8f7a('0x3b')]('message\x20is\x20empty');return _0x47eb4c(_0x68327['error'](0x1f4,_0x8f7a('0x4f')));});},'RejectMessage':function(_0x4c9587){var _0x3a1d00=this;return new Promise(function(_0x3c3d15,_0x1f0d32){if(_0x4c9587[_0x8f7a('0x46')]&&_0x4c9587[_0x8f7a('0x46')]['id']){try{if(_0x15534b[_0x8f7a('0x47')][_0x4c9587[_0x8f7a('0x46')]['id']]){_0x15534b[_0x8f7a('0x47')][_0x4c9587[_0x8f7a('0x46')]['id']][_0x8f7a('0x50')]=![];_0x15534b[_0x8f7a('0x47')][_0x4c9587[_0x8f7a('0x46')]['id']][_0x8f7a('0x48')]=undefined;}return _0x3c3d15({'code':0xc8,'message':_0x4c9587});}catch(_0x2ae862){logger['error'](_0x2ae862['stack']);return _0x1f0d32(_0x3a1d00[_0x8f7a('0x3b')](0x1f4,_0x2ae862));}}logger[_0x8f7a('0x3b')](_0x8f7a('0x4f'));return _0x1f0d32(_0x3a1d00[_0x8f7a('0x3b')](0x1f4,_0x8f7a('0x4f')));});},'AbandonInteraction':function(_0x466487){var _0x25f6b2=this;return new Promise(function(_0x54f50e,_0x4a47d3){if(_0x466487[_0x8f7a('0x16')]&&_0x466487['interaction']&&_0x466487['interaction']['id']){try{var _0x56a92d=getId(_0x466487[_0x8f7a('0x16')],_0x466487[_0x8f7a('0x17')]?_0x466487['message']['id']:0x0,_0x466487[_0x8f7a('0x18')]?_0x466487[_0x8f7a('0x18')]['id']:0x0);if(_0x15534b[_0x8f7a('0x15')][_0x56a92d]){_0x15534b[_0x8f7a('0x15')][_0x56a92d][_0x8f7a('0x40')](_0x8f7a('0x49'));}return _0x54f50e({'code':0xc8,'message':_0x466487});}catch(_0x5a3089){logger['error'](_0x5a3089['stack']);return _0x4a47d3(_0x25f6b2[_0x8f7a('0x3b')](0x1f4,_0x5a3089));}}logger['error']('message\x20is\x20empty');return _0x4a47d3(_0x25f6b2[_0x8f7a('0x3b')](0x1f4,_0x8f7a('0x4f')));});},'AgentCapacity':function(_0x475522){var _0x58308a=this;return new Promise(function(_0x1c8728,_0x1b142a){if(_0x15534b[_0x8f7a('0x47')][_0x8f7a('0x51')](_0x475522['id'])){for(var _0x57366e in _0x475522[_0x8f7a('0x52')]){if(_0x475522[_0x8f7a('0x52')]['hasOwnProperty'](_0x57366e)){if(_0x15534b[_0x8f7a('0x47')][_0x475522['id']][_0x8f7a('0x51')](_0x57366e+_0x8f7a('0x53'))){_0x15534b[_0x8f7a('0x47')][_0x475522['id']][_0x57366e+_0x8f7a('0x53')]=parseInt(_0x475522[_0x8f7a('0x52')][_0x57366e],0xa);}}}_0x15534b[_0x8f7a('0x47')][_0x475522['id']]['updateRealtime']();return _0x1c8728({'code':0xc8,'message':_0x15534b['agents'][_0x475522['id']]});}else{return _0x1b142a(_0x58308a['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4493dd){return new Promise(function(_0x592af8){var _0x4836ed=_['values'](_0x15534b[_0x8f7a('0x47')]);if(_0x4493dd&&_0x4493dd['id']){var _0x56cbbf=_[_0x8f7a('0x54')](_0x4836ed,function(_0x3c3ba0){return _0x3c3ba0['id']===_0x4493dd['id'];});_0x592af8(_0x56cbbf);}else{_0x592af8({'count':_0x4836ed['length'],'rows':_0x4836ed});}});},'ChatQueues':function(){return new Promise(function(_0x39f5ff){var _0x1c0c97=[];for(var _0x56c3d9 in _0x15534b[_0x8f7a('0x55')]){if(_0x15534b['chatQueues'][_0x8f7a('0x51')](_0x56c3d9)){var _0x555a61=_0x15534b['chatQueues'][_0x56c3d9];var _0x4b6013={'id':_0x555a61['id'],'available':_0x555a61[_0x8f7a('0x56')],'loggedIn':_0x555a61[_0x8f7a('0x57')],'name':_0x555a61[_0x8f7a('0x58')],'paused':_0x555a61[_0x8f7a('0x59')],'waiting':_0x555a61[_0x8f7a('0x5a')]};_0x1c0c97[_0x8f7a('0x23')](_0x4b6013);}}_0x39f5ff({'count':_0x1c0c97[_0x8f7a('0x1b')],'rows':_0x1c0c97});});},'MailQueues':function(){return new Promise(function(_0x340e6f){var _0x53c2fc=[];for(var _0x38313c in _0x15534b[_0x8f7a('0x5b')]){if(_0x15534b[_0x8f7a('0x5b')][_0x8f7a('0x51')](_0x38313c)){var _0x517584=_0x15534b['mailQueues'][_0x38313c];var _0x58d185={'id':_0x517584['id'],'available':_0x517584[_0x8f7a('0x56')],'loggedIn':_0x517584[_0x8f7a('0x57')],'name':_0x517584[_0x8f7a('0x58')],'paused':_0x517584[_0x8f7a('0x59')],'waiting':_0x517584[_0x8f7a('0x5a')]};_0x53c2fc[_0x8f7a('0x23')](_0x58d185);}}_0x340e6f({'count':_0x53c2fc[_0x8f7a('0x1b')],'rows':_0x53c2fc});});},'OpenchannelQueues':function(){return new Promise(function(_0x2b7fa1){var _0x3fd061=[];for(var _0xb07cae in _0x15534b[_0x8f7a('0x5c')]){if(_0x15534b[_0x8f7a('0x5c')][_0x8f7a('0x51')](_0xb07cae)){var _0x30923c=_0x15534b[_0x8f7a('0x5c')][_0xb07cae];var _0x3a49f4={'id':_0x30923c['id'],'available':_0x30923c[_0x8f7a('0x56')],'loggedIn':_0x30923c[_0x8f7a('0x57')],'name':_0x30923c[_0x8f7a('0x58')],'paused':_0x30923c[_0x8f7a('0x59')],'waiting':_0x30923c[_0x8f7a('0x5a')]};_0x3fd061[_0x8f7a('0x23')](_0x3a49f4);}}_0x2b7fa1({'count':_0x3fd061['length'],'rows':_0x3fd061});});},'SmsQueues':function(){return new Promise(function(_0x2270fa){var _0x5364c7=[];for(var _0x37b821 in _0x15534b[_0x8f7a('0x5d')]){if(_0x15534b[_0x8f7a('0x5d')]['hasOwnProperty'](_0x37b821)){var _0x4a8ece=_0x15534b[_0x8f7a('0x5d')][_0x37b821];var _0x5c91f9={'id':_0x4a8ece['id'],'available':_0x4a8ece[_0x8f7a('0x56')],'loggedIn':_0x4a8ece[_0x8f7a('0x57')],'name':_0x4a8ece[_0x8f7a('0x58')],'paused':_0x4a8ece[_0x8f7a('0x59')],'waiting':_0x4a8ece[_0x8f7a('0x5a')]};_0x5364c7[_0x8f7a('0x23')](_0x5c91f9);}}_0x2270fa({'count':_0x5364c7['length'],'rows':_0x5364c7});});},'FaxQueues':function(){return new Promise(function(_0x5431a0){var _0x5ad99a=[];for(var _0x4c7775 in _0x15534b['faxQueues']){if(_0x15534b[_0x8f7a('0x5e')]['hasOwnProperty'](_0x4c7775)){var _0x37f41e=_0x15534b['faxQueues'][_0x4c7775];var _0x1d483d={'id':_0x37f41e['id'],'available':_0x37f41e['available'],'loggedIn':_0x37f41e['loggedIn'],'name':_0x37f41e[_0x8f7a('0x58')],'paused':_0x37f41e[_0x8f7a('0x59')],'waiting':_0x37f41e[_0x8f7a('0x5a')]};_0x5ad99a['push'](_0x1d483d);}}_0x5431a0({'count':_0x5ad99a['length'],'rows':_0x5ad99a});});},'WhatsappQueues':function(){return new Promise(function(_0xfcb7e2){var _0x4ff7e2=[];for(var _0x4a5bc5 in _0x15534b[_0x8f7a('0x5f')]){if(_0x15534b[_0x8f7a('0x5f')]['hasOwnProperty'](_0x4a5bc5)){var _0x2807c5=_0x15534b[_0x8f7a('0x5f')][_0x4a5bc5];var _0x19e523={'id':_0x2807c5['id'],'available':_0x2807c5[_0x8f7a('0x56')],'loggedIn':_0x2807c5[_0x8f7a('0x57')],'name':_0x2807c5[_0x8f7a('0x58')],'paused':_0x2807c5['paused'],'waiting':_0x2807c5['waiting']};_0x4ff7e2[_0x8f7a('0x23')](_0x19e523);}}_0xfcb7e2({'count':_0x4ff7e2['length'],'rows':_0x4ff7e2});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x41c548){var _0x45c87c=_[_0x8f7a('0x60')](_0x15534b[_0x8f7a('0x61')]);_0x41c548({'count':_0x45c87c['length'],'rows':_0x45c87c});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x36f1f4){var _0x13a781=_[_0x8f7a('0x60')](_0x15534b[_0x8f7a('0x62')]);_0x36f1f4({'count':_0x13a781[_0x8f7a('0x1b')],'rows':_0x13a781});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x51209b){var _0x542500=_['values'](_0x15534b[_0x8f7a('0x63')]);_0x51209b({'count':_0x542500[_0x8f7a('0x1b')],'rows':_0x542500});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x581ecc){var _0x1721d5=_[_0x8f7a('0x60')](_0x15534b[_0x8f7a('0x64')]);_0x581ecc({'count':_0x1721d5[_0x8f7a('0x1b')],'rows':_0x1721d5});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x55ee7d){var _0x5eba8a=_[_0x8f7a('0x60')](_0x15534b['faxQueuesWaitingInteractions']);_0x55ee7d({'count':_0x5eba8a[_0x8f7a('0x1b')],'rows':_0x5eba8a});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x4be253){var _0x57d553=_[_0x8f7a('0x60')](_0x15534b['whatsappQueuesWaitingInteractions']);_0x4be253({'count':_0x57d553[_0x8f7a('0x1b')],'rows':_0x57d553});});}};var _0xb9ca31=jayson[_0x8f7a('0x65')](_0x3c7252)[_0x8f7a('0x66')]();_0xb9ca31['on']('error',function(_0x4d4939){logger[_0x8f7a('0x3b')](JSON[_0x8f7a('0x3f')](_0x4d4939));return _0x2e1dda(_0x4d4939);});_0xb9ca31['listen'](0x232c,_0x8f7a('0x67'),function(){console[_0x8f7a('0x68')](_0x8f7a('0x69'),0x232c);return _0x2b4613(_0x8f7a('0x6a')+0x232c);});});};
\ No newline at end of file
+var _0x4349=['toLowerCase','autoreply','push','slice','dialogflow','split','dialogflowv2','appdata','amazonlex','tag','TagId','getMustacheRender','account','ContactId','body','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4349,0x17e));var _0x9434=function(_0x677895,_0x2ed156){_0x677895=_0x677895-0x0;var _0x156217=_0x4349[_0x677895];return _0x156217;};'use strict';var _=require(_0x9434('0x0'));var util=require(_0x9434('0x1'));var path=require(_0x9434('0x2'));var fs=require('fs');var jayson=require(_0x9434('0x3'));var BPromise=require(_0x9434('0x4'));var utils=require(_0x9434('0x5'));var sUtils=require(_0x9434('0x6'));var logger=require(_0x9434('0x7'))(_0x9434('0x8'));var rpc={'openchannelQueueReport':require(_0x9434('0x9')),'mailQueueReport':require(_0x9434('0xa')),'chatQueueReport':require(_0x9434('0xb')),'smsQueueReport':require(_0x9434('0xc')),'faxQueueReport':require(_0x9434('0xd')),'whatsappQueueReport':require(_0x9434('0xe'))};var RuleEngine=require(_0x9434('0xf'));function getId(_0x10d41b,_0xb5e6d7,_0x116abf){return util[_0x9434('0x10')](_0x9434('0x11'),_0x10d41b,_0xb5e6d7||0x0,_0x116abf||0x0);}function getIntervals(_0x5a5489,_0x3f2845){var _0x1ecd03=[];if(!_[_0x9434('0x12')](_0x3f2845[_0x9434('0x13')])&&!_[_0x9434('0x12')](_0x5a5489[_0x3f2845[_0x9434('0x13')]])&&!_[_0x9434('0x12')](_0x5a5489[_0x3f2845[_0x9434('0x13')]]['Intervals'])){_0x1ecd03=_['map'](_0x5a5489[_0x3f2845['IntervalId']][_0x9434('0x14')],'interval');}else if(!_[_0x9434('0x12')](_0x3f2845[_0x9434('0x15')])){_0x1ecd03=[_0x3f2845[_0x9434('0x15')]];}return _0x1ecd03;}exports[_0x9434('0x16')]=function(_0x53b063){_0x53b063[_0x9434('0x17')]={};return new BPromise(function(_0x55c4f4,_0x4b4f81){var _0x31a14f={'Start':function(_0x58de55){var _0x4ad7cf=this;return new Promise(function(_0x2b5a45,_0x2c3009){if(_0x58de55){try{var _0x3cee90=[];var _0x417ffd=getId(_0x58de55[_0x9434('0x18')],_0x58de55[_0x9434('0x19')]?_0x58de55[_0x9434('0x19')]['id']:0x0,_0x58de55[_0x9434('0x1a')]?_0x58de55[_0x9434('0x1a')]['id']:0x0);var _0xeed87=sUtils['checkWaitingNotifications'](_0x53b063,_0x58de55);if(!_0xeed87&&_0x58de55[_0x9434('0x1b')]&&_[_0x9434('0x1c')](_0x58de55[_0x9434('0x1b')])&&_0x58de55[_0x9434('0x1b')][_0x9434('0x1d')]){for(var _0x59cff9=0x0;_0x59cff9<_0x58de55[_0x9434('0x1b')][_0x9434('0x1d')];_0x59cff9+=0x1){var _0x13572b=_0x58de55[_0x9434('0x1b')][_0x59cff9];if(fs[_0x9434('0x1e')](path[_0x9434('0x1f')](__dirname,_0x9434('0x1b'),_0x13572b[_0x9434('0x20')]+_0x9434('0x21')))){var _0x1d4e75=[];switch(_0x13572b[_0x9434('0x20')][_0x9434('0x22')]()){case _0x9434('0x23'):var _0x426a46=_0x13572b['appdata']['split'](',');if(_0x58de55[_0x9434('0x18')]==='mail'){_0x1d4e75[_0x9434('0x24')](_0x426a46[0x0]);_0x1d4e75[_0x9434('0x24')](_0x426a46[0x1]);_0x1d4e75[_0x9434('0x24')](_0x426a46[_0x9434('0x25')](0x2,_0x426a46[_0x9434('0x1d')])[_0x9434('0x1f')](','));}else{_0x1d4e75[_0x9434('0x24')](_0x426a46[0x0]);_0x1d4e75[_0x9434('0x24')](_0x426a46['slice'](0x1,_0x426a46[_0x9434('0x1d')])[_0x9434('0x1f')](','));}break;case _0x9434('0x26'):var _0x4e410b=_0x13572b['appdata'][_0x9434('0x27')](',');_0x1d4e75[_0x9434('0x24')](_0x4e410b[0x0]);_0x1d4e75['push'](_0x4e410b[0x1]);_0x1d4e75[_0x9434('0x24')](_0x4e410b[_0x9434('0x25')](0x2,_0x4e410b[_0x9434('0x1d')])[_0x9434('0x1f')](','));break;case _0x9434('0x28'):var _0x1a9e4c=_0x13572b[_0x9434('0x29')][_0x9434('0x27')](',');_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x0]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x1]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x2]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[0x3]);_0x1d4e75[_0x9434('0x24')](_0x1a9e4c[_0x9434('0x25')](0x4,_0x1a9e4c[_0x9434('0x1d')])[_0x9434('0x1f')](','));break;case _0x9434('0x2a'):var _0x3e3f7f=_0x13572b[_0x9434('0x29')][_0x9434('0x27')](',');_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x0]);_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x1]);_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x2]);_0x1d4e75[_0x9434('0x24')](_0x3e3f7f[0x3]);_0x1d4e75['push'](_0x3e3f7f[_0x9434('0x25')](0x4,_0x3e3f7f[_0x9434('0x1d')])[_0x9434('0x1f')](','));break;case _0x9434('0x19'):_0x1d4e75[_0x9434('0x24')](_0x13572b['appdata']);break;case _0x9434('0x2b'):_0x1d4e75[_0x9434('0x24')](_0x13572b[_0x9434('0x2c')]);_0x1d4e75[_0x9434('0x24')](_0x13572b['appdata']);break;case'tvox':var _0x197b69=utils[_0x9434('0x2d')](_0x58de55[_0x9434('0x2e')]['notificationTemplate'],_0x58de55);var _0xa90738=_0x13572b['appdata'][_0x9434('0x27')](',');_0x1d4e75['push'](_0xa90738[0x0]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x1]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x2]);_0x1d4e75['push'](_0xa90738[0x3]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x4]);_0x1d4e75['push'](_0xa90738[0x5]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x6]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x7]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x8]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0x9]);_0x1d4e75[_0x9434('0x24')](_0xa90738[0xa]);_0x1d4e75[_0x9434('0x24')](_0x58de55[_0x9434('0x1a')]['id']);_0x1d4e75[_0x9434('0x24')](_0x58de55['message']['id']);_0x1d4e75[_0x9434('0x24')](_0x13572b['ChatWebsiteId']);_0x1d4e75[_0x9434('0x24')](_0x58de55[_0x9434('0x1a')][_0x9434('0x2f')]);_0x1d4e75[_0x9434('0x24')](_0x58de55[_0x9434('0x30')][_0x9434('0x30')]);_0x1d4e75[_0x9434('0x24')](_0x197b69);break;default:_0x1d4e75=_['isNil'](_0x13572b[_0x9434('0x29')])?[]:_0x13572b[_0x9434('0x29')][_0x9434('0x27')](',');}var _0x82f6a7={'id':util[_0x9434('0x10')](_0x9434('0x31'),_0x417ffd,_0x13572b['id'],_0x13572b['app']),'condition':require(_0x9434('0x32'))[_0x9434('0x33')](_0x417ffd,getIntervals(_0x53b063[_0x9434('0x34')],_0x13572b),_0x53b063),'consequence':require('./applications/'+_0x13572b[_0x9434('0x20')])[_0x9434('0x35')](_0x417ffd,_0x1d4e75,_0x53b063,_0x58de55),'p':_0x13572b[_0x9434('0x36')]||0x0};logger[_0x9434('0x37')]('Push\x20new\x20rule',_0x82f6a7['id'],'on\x20interval',getIntervals(_0x53b063[_0x9434('0x34')],_0x13572b)['join'](_0x9434('0x38')));_0x3cee90['push'](_0x82f6a7);}else{logger[_0x9434('0x39')](_0x9434('0x3a'),path[_0x9434('0x1f')](__dirname,_0x9434('0x1b'),_0x13572b['app']+'.js'));}}_0x53b063[_0x9434('0x17')][_0x417ffd]=new RuleEngine(_0x3cee90);_0x53b063[_0x9434('0x17')][_0x417ffd][_0x9434('0x3b')](_0x58de55,function(_0x4d69a3){logger[_0x9434('0x37')](_0x9434('0x3c'),JSON[_0x9434('0x3d')](_0x4d69a3[_0x9434('0x3e')]));if(_0x53b063[_0x9434('0x17')][_0x417ffd]){_0x53b063[_0x9434('0x17')][_0x417ffd][_0x9434('0x3f')](_0x9434('0x40'));}});return _0x2b5a45({'code':0xc8,'message':_0x58de55});}else{if(_0xeed87){logger[_0x9434('0x37')](util[_0x9434('0x10')](_0x9434('0x41'),_0x417ffd));}else{logger['info'](_0x9434('0x42'));}return _0x2b5a45({'code':0xc8,'message':_0x58de55});}}catch(_0x556263){logger[_0x9434('0x39')](_0x556263[_0x9434('0x43')]);return _0x2c3009(_0x4ad7cf['error'](0x1f4,_0x556263));}}return _0x2c3009('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2f81f2){var _0x3d397d=this;return new Promise(function(_0x36ac8a,_0x5532e0){if(_0x2f81f2['agent']&&_0x2f81f2[_0x9434('0x44')]['id']){if(_0x53b063[_0x9434('0x45')][_0x2f81f2[_0x9434('0x44')]['id']]){_0x53b063[_0x9434('0x45')][_0x2f81f2[_0x9434('0x44')]['id']][_0x9434('0x46')]=![];_0x53b063[_0x9434('0x45')][_0x2f81f2['agent']['id']][_0x9434('0x47')]=undefined;}}if(_0x2f81f2[_0x9434('0x19')]&&_0x2f81f2[_0x9434('0x19')]['id']){try{var _0x288df2=getId(_0x2f81f2[_0x9434('0x18')],_0x2f81f2[_0x9434('0x19')]?_0x2f81f2[_0x9434('0x19')]['id']:0x0,_0x2f81f2['interaction']?_0x2f81f2[_0x9434('0x1a')]['id']:0x0);if(_0x53b063[_0x9434('0x17')][_0x288df2]){_0x53b063[_0x9434('0x17')][_0x288df2][_0x9434('0x3f')](_0x9434('0x48'));if(rpc[_0x2f81f2['channel']+_0x9434('0x49')]){rpc[_0x2f81f2[_0x9434('0x18')]+'QueueReport'][_0x9434('0x4a')](_0x288df2,{'UserId':_0x2f81f2[_0x9434('0x19')][_0x9434('0x4b')]})['catch'](function(){logger[_0x9434('0x39')]('error\x20update\x20queue\x20report');});}}return _0x36ac8a({'code':0xc8,'message':_0x2f81f2});}catch(_0x50f125){logger[_0x9434('0x39')](_0x50f125['stack']);return _0x5532e0(_0x3d397d[_0x9434('0x39')](0x1f4,_0x50f125));}}logger[_0x9434('0x39')]('message\x20is\x20empty');return _0x5532e0(_0x3d397d[_0x9434('0x39')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x56232a){var _0x5851d4=this;return new Promise(function(_0xc45ff7,_0x237ef3){if(_0x56232a[_0x9434('0x44')]&&_0x56232a['agent']['id']){try{if(_0x53b063['agents'][_0x56232a[_0x9434('0x44')]['id']]){_0x53b063[_0x9434('0x45')][_0x56232a[_0x9434('0x44')]['id']][_0x9434('0x46')]=![];_0x53b063[_0x9434('0x45')][_0x56232a[_0x9434('0x44')]['id']][_0x9434('0x47')]=undefined;}return _0xc45ff7({'code':0xc8,'message':_0x56232a});}catch(_0x3ba6ab){logger[_0x9434('0x39')](_0x3ba6ab[_0x9434('0x43')]);return _0x237ef3(_0x5851d4['error'](0x1f4,_0x3ba6ab));}}logger['error'](_0x9434('0x4c'));return _0x237ef3(_0x5851d4[_0x9434('0x39')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5222ae){var _0x1ecf36=this;return new Promise(function(_0x220d12,_0x494441){if(_0x5222ae[_0x9434('0x18')]&&_0x5222ae[_0x9434('0x1a')]&&_0x5222ae[_0x9434('0x1a')]['id']){try{var _0x1cf375=getId(_0x5222ae[_0x9434('0x18')],_0x5222ae[_0x9434('0x19')]?_0x5222ae[_0x9434('0x19')]['id']:0x0,_0x5222ae[_0x9434('0x1a')]?_0x5222ae[_0x9434('0x1a')]['id']:0x0);if(_0x53b063[_0x9434('0x17')][_0x1cf375]){_0x53b063[_0x9434('0x17')][_0x1cf375][_0x9434('0x3f')](_0x9434('0x48'));}return _0x220d12({'code':0xc8,'message':_0x5222ae});}catch(_0x385c8a){logger[_0x9434('0x39')](_0x385c8a['stack']);return _0x494441(_0x1ecf36['error'](0x1f4,_0x385c8a));}}logger[_0x9434('0x39')](_0x9434('0x4c'));return _0x494441(_0x1ecf36[_0x9434('0x39')](0x1f4,_0x9434('0x4c')));});},'AgentCapacity':function(_0x254f50){var _0x5d9829=this;return new Promise(function(_0x231e04,_0x31c948){if(_0x53b063[_0x9434('0x45')][_0x9434('0x4d')](_0x254f50['id'])){for(var _0x263e87 in _0x254f50[_0x9434('0x4e')]){if(_0x254f50[_0x9434('0x4e')][_0x9434('0x4d')](_0x263e87)){if(_0x53b063[_0x9434('0x45')][_0x254f50['id']]['hasOwnProperty'](_0x263e87+_0x9434('0x4f'))){_0x53b063[_0x9434('0x45')][_0x254f50['id']][_0x263e87+_0x9434('0x4f')]=parseInt(_0x254f50[_0x9434('0x4e')][_0x263e87],0xa);}}}_0x53b063[_0x9434('0x45')][_0x254f50['id']][_0x9434('0x50')]();return _0x231e04({'code':0xc8,'message':_0x53b063[_0x9434('0x45')][_0x254f50['id']]});}else{return _0x31c948(_0x5d9829[_0x9434('0x39')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x307e9f){return new Promise(function(_0x44a904){var _0x108b5b=_[_0x9434('0x51')](_0x53b063[_0x9434('0x45')]);if(_0x307e9f&&_0x307e9f['id']){var _0x327ee1=_['find'](_0x108b5b,function(_0x9cecf3){return _0x9cecf3['id']===_0x307e9f['id'];});_0x44a904(_0x327ee1);}else{_0x44a904({'count':_0x108b5b['length'],'rows':_0x108b5b});}});},'ChatQueues':function(){return new Promise(function(_0x4c288c){var _0x33876b=[];for(var _0x246df1 in _0x53b063[_0x9434('0x52')]){if(_0x53b063[_0x9434('0x52')][_0x9434('0x4d')](_0x246df1)){var _0x411785=_0x53b063[_0x9434('0x52')][_0x246df1];var _0x275877={'id':_0x411785['id'],'available':_0x411785[_0x9434('0x53')],'loggedIn':_0x411785[_0x9434('0x54')],'name':_0x411785[_0x9434('0x55')],'paused':_0x411785[_0x9434('0x56')],'waiting':_0x411785[_0x9434('0x57')]};_0x33876b['push'](_0x275877);}}_0x4c288c({'count':_0x33876b[_0x9434('0x1d')],'rows':_0x33876b});});},'MailQueues':function(){return new Promise(function(_0x14789e){var _0x19d5d5=[];for(var _0x356ae3 in _0x53b063[_0x9434('0x58')]){if(_0x53b063[_0x9434('0x58')][_0x9434('0x4d')](_0x356ae3)){var _0x34fead=_0x53b063['mailQueues'][_0x356ae3];var _0x475879={'id':_0x34fead['id'],'available':_0x34fead[_0x9434('0x53')],'loggedIn':_0x34fead[_0x9434('0x54')],'name':_0x34fead[_0x9434('0x55')],'paused':_0x34fead[_0x9434('0x56')],'waiting':_0x34fead[_0x9434('0x57')]};_0x19d5d5[_0x9434('0x24')](_0x475879);}}_0x14789e({'count':_0x19d5d5['length'],'rows':_0x19d5d5});});},'OpenchannelQueues':function(){return new Promise(function(_0x11d687){var _0x4b4b58=[];for(var _0x3c6261 in _0x53b063[_0x9434('0x59')]){if(_0x53b063[_0x9434('0x59')][_0x9434('0x4d')](_0x3c6261)){var _0x2e13b0=_0x53b063[_0x9434('0x59')][_0x3c6261];var _0x3be26b={'id':_0x2e13b0['id'],'available':_0x2e13b0[_0x9434('0x53')],'loggedIn':_0x2e13b0[_0x9434('0x54')],'name':_0x2e13b0[_0x9434('0x55')],'paused':_0x2e13b0[_0x9434('0x56')],'waiting':_0x2e13b0[_0x9434('0x57')]};_0x4b4b58[_0x9434('0x24')](_0x3be26b);}}_0x11d687({'count':_0x4b4b58[_0x9434('0x1d')],'rows':_0x4b4b58});});},'SmsQueues':function(){return new Promise(function(_0x16d9db){var _0x4e0c1c=[];for(var _0x2a61e6 in _0x53b063[_0x9434('0x5a')]){if(_0x53b063[_0x9434('0x5a')]['hasOwnProperty'](_0x2a61e6)){var _0x68c4ef=_0x53b063[_0x9434('0x5a')][_0x2a61e6];var _0x5efbd7={'id':_0x68c4ef['id'],'available':_0x68c4ef[_0x9434('0x53')],'loggedIn':_0x68c4ef[_0x9434('0x54')],'name':_0x68c4ef[_0x9434('0x55')],'paused':_0x68c4ef[_0x9434('0x56')],'waiting':_0x68c4ef[_0x9434('0x57')]};_0x4e0c1c[_0x9434('0x24')](_0x5efbd7);}}_0x16d9db({'count':_0x4e0c1c[_0x9434('0x1d')],'rows':_0x4e0c1c});});},'FaxQueues':function(){return new Promise(function(_0x4eaa68){var _0x21337d=[];for(var _0x1c2a5f in _0x53b063[_0x9434('0x5b')]){if(_0x53b063['faxQueues'][_0x9434('0x4d')](_0x1c2a5f)){var _0xf21e12=_0x53b063[_0x9434('0x5b')][_0x1c2a5f];var _0x5425ea={'id':_0xf21e12['id'],'available':_0xf21e12['available'],'loggedIn':_0xf21e12[_0x9434('0x54')],'name':_0xf21e12['name'],'paused':_0xf21e12[_0x9434('0x56')],'waiting':_0xf21e12[_0x9434('0x57')]};_0x21337d[_0x9434('0x24')](_0x5425ea);}}_0x4eaa68({'count':_0x21337d[_0x9434('0x1d')],'rows':_0x21337d});});},'WhatsappQueues':function(){return new Promise(function(_0x5a29cb){var _0xcad7ee=[];for(var _0x420939 in _0x53b063['whatsappQueues']){if(_0x53b063[_0x9434('0x5c')]['hasOwnProperty'](_0x420939)){var _0x114c75=_0x53b063['whatsappQueues'][_0x420939];var _0x5a25eb={'id':_0x114c75['id'],'available':_0x114c75[_0x9434('0x53')],'loggedIn':_0x114c75[_0x9434('0x54')],'name':_0x114c75[_0x9434('0x55')],'paused':_0x114c75[_0x9434('0x56')],'waiting':_0x114c75[_0x9434('0x57')]};_0xcad7ee[_0x9434('0x24')](_0x5a25eb);}}_0x5a29cb({'count':_0xcad7ee['length'],'rows':_0xcad7ee});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x4098cd){var _0x29a1bf=_[_0x9434('0x51')](_0x53b063['chatQueuesWaitingInteractions']);_0x4098cd({'count':_0x29a1bf[_0x9434('0x1d')],'rows':_0x29a1bf});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x164a27){var _0x4ebc50=_[_0x9434('0x51')](_0x53b063[_0x9434('0x5d')]);_0x164a27({'count':_0x4ebc50['length'],'rows':_0x4ebc50});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x12708b){var _0x3fb4b9=_[_0x9434('0x51')](_0x53b063[_0x9434('0x5e')]);_0x12708b({'count':_0x3fb4b9[_0x9434('0x1d')],'rows':_0x3fb4b9});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1f8d49){var _0x1368d9=_[_0x9434('0x51')](_0x53b063[_0x9434('0x5f')]);_0x1f8d49({'count':_0x1368d9['length'],'rows':_0x1368d9});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x390f9d){var _0x1194f9=_['values'](_0x53b063[_0x9434('0x60')]);_0x390f9d({'count':_0x1194f9['length'],'rows':_0x1194f9});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x1dde9c){var _0x2b5506=_[_0x9434('0x51')](_0x53b063[_0x9434('0x61')]);_0x1dde9c({'count':_0x2b5506[_0x9434('0x1d')],'rows':_0x2b5506});});}};var _0x5c3d58=jayson[_0x9434('0x62')](_0x31a14f)[_0x9434('0x63')]();_0x5c3d58['on'](_0x9434('0x39'),function(_0x4e56c2){logger['error'](JSON['stringify'](_0x4e56c2));return _0x4b4f81(_0x4e56c2);});_0x5c3d58[_0x9434('0x16')](0x232c,_0x9434('0x64'),function(){console[_0x9434('0x65')](_0x9434('0x66'),0x232c);return _0x55c4f4(_0x9434('0x67')+0x232c);});});};
\ No newline at end of file
index ab3827b..3062768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34f5=['iftime\x20%s','indexOf','true','all','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','message','result','catch','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format'];(function(_0x451f95,_0x565322){var _0x310906=function(_0x52b37d){while(--_0x52b37d){_0x451f95['push'](_0x451f95['shift']());}};_0x310906(++_0x565322);}(_0x34f5,0x122));var _0x534f=function(_0x361521,_0x4312d7){_0x361521=_0x361521-0x0;var _0x508e53=_0x34f5[_0x361521];return _0x508e53;};'use strict';var util=require(_0x534f('0x0'));var BPromise=require(_0x534f('0x1'));var jayson=require(_0x534f('0x2'));var _=require(_0x534f('0x3'));var logger=require(_0x534f('0x4'))(_0x534f('0x5'));var client=jayson['client'][_0x534f('0x6')]({'port':0x232a});function request(_0xa39cb4,_0x10e74d){return new BPromise(function(_0x9c117b,_0x1b3e05){return client[_0x534f('0x7')](_0xa39cb4,_0x10e74d)[_0x534f('0x8')](function(_0x2fec80){if(_0x2fec80['error']){return _0x1b3e05(_0x2fec80[_0x534f('0x9')][_0x534f('0xa')]);}else{return _0x9c117b(_0x2fec80[_0x534f('0xb')]);}})[_0x534f('0xc')](function(_0x1ce6f2){return _0x1b3e05(_0x1ce6f2);});});}exports['condition']=function(_0x2ec4c1,_0x18e4a6,_0x3e9273){return function(_0x557ecf){if(_0x3e9273[_0x534f('0xd')]&&!_0x3e9273[_0x534f('0xd')][_0x2ec4c1]){logger[_0x534f('0xe')](_0x534f('0xf'),_0x2ec4c1);return _0x557ecf[_0x534f('0x10')]();}var _0x2613bb=[];for(var _0x4d0168=0x0;_0x4d0168<_0x18e4a6[_0x534f('0x11')];_0x4d0168+=0x1){_0x2613bb['push'](request(_0x534f('0x12'),{'command':util[_0x534f('0x13')](_0x534f('0x14'),_0x18e4a6[_0x4d0168])})[_0x534f('0x8')](function(_0xbcb590){return _0xbcb590&&_0xbcb590[_0x534f('0xa')]&&_0xbcb590[_0x534f('0xa')][_0x534f('0x15')](_0x534f('0x16'))>=0x0?!![]:![];})[_0x534f('0xc')](function(_0x13a179){logger[_0x534f('0x9')]('[%s][INTERVAL]\x20%s',_0x2ec4c1,_0x18e4a6[_0x4d0168]);}));}BPromise[_0x534f('0x17')](_0x2613bb)['then'](function(_0x1cdafd){var _0x35c857=_[_0x534f('0x18')](_0x1cdafd);logger[_0x534f('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x2ec4c1,_0x18e4a6[_0x534f('0x19')](_0x534f('0x1a')),_0x35c857);_0x557ecf[_0x534f('0x1b')](_0x35c857);})['catch'](function(_0x512343){console[_0x534f('0x1c')](_0x512343);logger[_0x534f('0x9')](_0x534f('0x1d'),_0x2ec4c1,_0x18e4a6[_0x534f('0x19')](_0x534f('0x1a')),_0x512343[_0x534f('0x1e')]);_0x557ecf['stop']();});};};
\ No newline at end of file
+var _0xceac=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join','when','log','\x20|\x20','stack','util','jayson/promise','lodash','routing','client','http','request','then','error','message','result','catch','condition'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xceac,0x1a5));var _0xccea=function(_0x477d8b,_0x156290){_0x477d8b=_0x477d8b-0x0;var _0x211e73=_0xceac[_0x477d8b];return _0x211e73;};'use strict';var util=require(_0xccea('0x0'));var BPromise=require('bluebird');var jayson=require(_0xccea('0x1'));var _=require(_0xccea('0x2'));var logger=require('../../../config/logger')(_0xccea('0x3'));var client=jayson[_0xccea('0x4')][_0xccea('0x5')]({'port':0x232a});function request(_0x4b9d8d,_0x310041){return new BPromise(function(_0x14ed74,_0x4cf47b){return client[_0xccea('0x6')](_0x4b9d8d,_0x310041)[_0xccea('0x7')](function(_0x1ee156){if(_0x1ee156[_0xccea('0x8')]){return _0x4cf47b(_0x1ee156['error'][_0xccea('0x9')]);}else{return _0x14ed74(_0x1ee156[_0xccea('0xa')]);}})[_0xccea('0xb')](function(_0x23236e){return _0x4cf47b(_0x23236e);});});}exports[_0xccea('0xc')]=function(_0x151abb,_0x12ea75,_0x1ab1b9){return function(_0x3bca61){if(_0x1ab1b9[_0xccea('0xd')]&&!_0x1ab1b9[_0xccea('0xd')][_0x151abb]){logger[_0xccea('0xe')](_0xccea('0xf'),_0x151abb);return _0x3bca61[_0xccea('0x10')]();}var _0x260c36=[];for(var _0x5898b0=0x0;_0x5898b0<_0x12ea75[_0xccea('0x11')];_0x5898b0+=0x1){_0x260c36[_0xccea('0x12')](request(_0xccea('0x13'),{'command':util[_0xccea('0x14')]('iftime\x20%s',_0x12ea75[_0x5898b0])})[_0xccea('0x7')](function(_0x16daae){return _0x16daae&&_0x16daae['message']&&_0x16daae[_0xccea('0x9')][_0xccea('0x15')](_0xccea('0x16'))>=0x0?!![]:![];})[_0xccea('0xb')](function(_0x21c082){logger[_0xccea('0x8')](_0xccea('0x17'),_0x151abb,_0x12ea75[_0x5898b0]);}));}BPromise[_0xccea('0x18')](_0x260c36)[_0xccea('0x7')](function(_0x500ba8){var _0xfdb15=_[_0xccea('0x19')](_0x500ba8);logger[_0xccea('0xe')]('[%s][INTERVAL]\x20%s\x20%s',_0x151abb,_0x12ea75[_0xccea('0x1a')]('\x20|\x20'),_0xfdb15);_0x3bca61[_0xccea('0x1b')](_0xfdb15);})[_0xccea('0xb')](function(_0x5aad34){console[_0xccea('0x1c')](_0x5aad34);logger[_0xccea('0x8')]('[%s][INTERVAL]\x20%s\x20%s',_0x151abb,_0x12ea75[_0xccea('0x1a')](_0xccea('0x1d')),_0x5aad34[_0xccea('0x1e')]);_0x3bca61[_0xccea('0x10')]();});};};
\ No newline at end of file
index 34d9c00..7b22218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf109=['transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','transfertype','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','hangup','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','[%s][agents][hangup]','lodash','util','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','type','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','now','called','info','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','error','queuecallerabandon','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','reason','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer'];(function(_0xb22d18,_0x16ac56){var _0x4cf9a1=function(_0x4fc67b){while(--_0x4fc67b){_0xb22d18['push'](_0xb22d18['shift']());}};_0x4cf9a1(++_0x16ac56);}(_0xf109,0xce));var _0x9f10=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf109[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var utils=require(_0x9f10('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5d2950,_0x5b381d){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4'),_0x5d2950[_0x9f10('0x5')],_0x5d2950[_0x9f10('0x6')],_0x5d2950[_0x9f10('0x7')],_0x5d2950[_0x9f10('0x8')],_0x5d2950[_0x9f10('0x9')],_0x5d2950[_0x9f10('0xa')],_0x5d2950[_0x9f10('0xb')],_0x5d2950[_0x9f10('0xc')]));if(_0x5d2950[_0x9f10('0x7')]){utils['getVoiceQueueByName'](_0x5d2950[_0x9f10('0x7')])[_0x9f10('0xd')](function(_0x1a0668){if(_0x1a0668){_0x5d2950[_0x9f10('0xe')]=_0x1a0668[_0x9f10('0xe')];_0x5d2950['agentacw']=_0x5d2950[_0x9f10('0xf')]?_0x1a0668[_0x9f10('0x10')]:![];_0x5d2950[_0x9f10('0x11')]=_0x5d2950['agentacw']?_0x1a0668['acwTimeout']:0x0;}utils[_0x9f10('0x12')](_0x9f10('0x13'),_0x5d2950);});}else{utils[_0x9f10('0x12')]('CreateVoiceAgentReport',_0x5d2950);}if(_0x5b381d){delete transfers[_0x5d2950[_0x9f10('0x5')]];}else{delete agents[_0x5d2950[_0x9f10('0x14')]];}}exports[_0x9f10('0x15')]=function(_0x58067f){try{utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]',_0x58067f[_0x9f10('0x5')]),_0x58067f);agents[_0x58067f[_0x9f10('0x14')]]=_0x58067f;agents[_0x58067f['destuniqueid']]['agentcalledAt']=utils[_0x9f10('0x17')]();agents[_0x58067f[_0x9f10('0x14')]]['lastevent']=_0x9f10('0x18');agents[_0x58067f['destuniqueid']][_0x9f10('0xb')]=null;agents[_0x58067f[_0x9f10('0x14')]]['connectedlinename']=null;utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x58067f[_0x9f10('0x5')],agents[_0x58067f['destuniqueid']][_0x9f10('0x8')],_0x58067f['destuniqueid']));}catch(_0x2c5064){utils['error'](util['format'](_0x9f10('0x1a'),_0x58067f[_0x9f10('0x5')]),_0x2c5064);}};exports[_0x9f10('0x1b')]=function(_0x3a78be){try{if(!_[_0x9f10('0x1c')](agents[_0x3a78be[_0x9f10('0x14')]])){utils[_0x9f10('0x16')](util['format'](_0x9f10('0x1d'),_0x3a78be['uniqueid']),_0x3a78be);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x1e'),_0x3a78be['uniqueid'],agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x8')],_0x3a78be[_0x9f10('0x14')]));agents[_0x3a78be['destuniqueid']][_0x9f10('0x1b')]=!![];agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x1f')]=utils['now']();agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x20');agents[_0x3a78be[_0x9f10('0x14')]]['reason']='timeout';agents[_0x3a78be['destuniqueid']][_0x9f10('0x21')]=_0x3a78be['ringtime']?parseInt(_0x3a78be[_0x9f10('0x22')])/0x3e8:0x0;agents[_0x3a78be[_0x9f10('0x14')]][_0x9f10('0x23')]=0x0;unanswered[_0x9f10('0x24')](_0x3a78be[_0x9f10('0x14')]);}}catch(_0x4f6b0c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x1d'),_0x3a78be[_0x9f10('0x5')]),_0x4f6b0c);}};exports[_0x9f10('0x26')]=function(_0x2c4373){try{_['forIn'](agents,function(_0x358d3f,_0x501ee){if(_0x358d3f[_0x9f10('0x5')]==_0x2c4373[_0x9f10('0x5')]&&!_['includes'](unanswered,_0x358d3f[_0x9f10('0x14')])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x2c4373);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x27'),_0x2c4373[_0x9f10('0x5')],_0x358d3f['membername'],_0x358d3f[_0x9f10('0x14')]));_0x358d3f[_0x9f10('0x1b')]=!![];_0x358d3f[_0x9f10('0x1f')]=utils[_0x9f10('0x17')]();_0x358d3f[_0x9f10('0xc')]='abandoned';_0x358d3f[_0x9f10('0x28')]='abandoned';_0x358d3f[_0x9f10('0x21')]=_0x2c4373[_0x9f10('0x21')];_0x358d3f[_0x9f10('0x23')]=0x0;writeDB(_0x358d3f);}});}catch(_0x11ee9c){utils[_0x9f10('0x25')](util[_0x9f10('0x3')]('[%s][agents][queuecallerabandon]',_0x2c4373[_0x9f10('0x5')]),_0x11ee9c);}};exports[_0x9f10('0x29')]=function(_0x1b8018){try{if(agents[_0x1b8018['destuniqueid']]){utils[_0x9f10('0x16')](util[_0x9f10('0x3')]('[%s][agents][agentconnect]',_0x1b8018[_0x9f10('0x5')]),_0x1b8018);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x2a'),_0x1b8018[_0x9f10('0x5')],agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x8')],_0x1b8018[_0x9f10('0x14')]));agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0x2b')]=utils['now']();agents[_0x1b8018[_0x9f10('0x14')]][_0x9f10('0xb')]=_0x1b8018[_0x9f10('0xb')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x2c')]=_0x1b8018[_0x9f10('0x2c')];agents[_0x1b8018['destuniqueid']][_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];agents[_0x1b8018[_0x9f10('0x14')]]['lastevent']='connect';_[_0x9f10('0x2d')](agents,function(_0x2ff98d,_0x1deed4){if(_0x2ff98d[_0x9f10('0x14')]!=_0x1b8018[_0x9f10('0x14')]&&_0x2ff98d[_0x9f10('0x5')]==_0x1b8018[_0x9f10('0x5')]){_0x2ff98d[_0x9f10('0x23')]=0x0;_0x2ff98d[_0x9f10('0x21')]=_0x1b8018[_0x9f10('0x22')];_0x2ff98d[_0x9f10('0x1b')]=!![];_0x2ff98d[_0x9f10('0x1f')]=utils['now']();_0x2ff98d['lastevent']='answered_elsewhere';_0x2ff98d[_0x9f10('0x28')]='answered_elsewhere';_0x2ff98d[_0x9f10('0x2e')]=_0x1b8018[_0x9f10('0x14')];_0x2ff98d[_0x9f10('0x2f')]=_0x1b8018['membername'];writeDB(_0x2ff98d);}});}}catch(_0x3cfce6){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x30'),_0x1b8018[_0x9f10('0x5')]),_0x3cfce6);}};exports['agentcomplete']=function(_0x578368){try{if(!_['isNil'](agents[_0x578368[_0x9f10('0x14')]])){utils['debug'](util[_0x9f10('0x3')]('[%s][agents][agentcomplete]',_0x578368[_0x9f10('0x5')]),_0x578368);utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x31'),_0x578368['uniqueid'],agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x8')],_0x578368['destuniqueid']));agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xf')]=!![];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x23')]=utils[_0x9f10('0x33')](agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0x32')],agents[_0x578368['destuniqueid']][_0x9f10('0x2b')]);agents[_0x578368[_0x9f10('0x14')]]['reason']=_0x578368[_0x9f10('0x28')];agents[_0x578368[_0x9f10('0x14')]][_0x9f10('0xc')]=_0x9f10('0x34');writeDB(agents[_0x578368['destuniqueid']]);}}catch(_0x283f04){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x35'),_0x578368[_0x9f10('0x5')]),_0x283f04);}};exports[_0x9f10('0x36')]=function(_0x479b46){try{if(!_[_0x9f10('0x1c')](agents[_0x479b46[_0x9f10('0x37')]])){utils[_0x9f10('0x16')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46[_0x9f10('0x5')]),_0x479b46);utils['info'](util[_0x9f10('0x3')](_0x9f10('0x39'),_0x479b46[_0x9f10('0x5')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x8')],agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x5')]));agents[_0x479b46[_0x9f10('0x37')]]['transfer']=!![];agents[_0x479b46[_0x9f10('0x37')]]['transfertype']=_0x9f10('0x3a');agents[_0x479b46['transfereruniqueid']][_0x9f10('0x3b')]=_0x479b46[_0x9f10('0x3c')];agents[_0x479b46[_0x9f10('0x37')]][_0x9f10('0x3d')]=agents[_0x479b46[_0x9f10('0x37')]]['uniqueid'];}}catch(_0x12cf34){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x38'),_0x479b46['uniqueid']),_0x12cf34);}};exports['attendedtransfer']=function(_0x265f69){try{utils[_0x9f10('0x16')](util['format']('[%s][agents][attendedtransfer]',_0x265f69[_0x9f10('0x3e')]),_0x265f69);if(_0x265f69[_0x9f10('0x3e')]==_0x265f69[_0x9f10('0x3f')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x40')]])){utils[_0x9f10('0x19')](util[_0x9f10('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x8')]));agents[_0x265f69['secondtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x40')]]['transfertype']=_0x9f10('0x42');agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x43')];agents[_0x265f69[_0x9f10('0x40')]]['transferuniqueid']=_0x265f69[_0x9f10('0x3e')];}if(_0x265f69['transfereeuniqueid']&&agents[_0x265f69['transfereeuniqueid']]){agents[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x44')]]=_[_0x9f10('0x46')](agents[_0x265f69[_0x9f10('0x44')]]);transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0xa')]=agents[_0x265f69['secondtransfereruniqueid']]['calleridnum'];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x47')]=agents[_0x265f69[_0x9f10('0x40')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x44')]][_0x9f10('0x48')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfereeuniqueid']][_0x9f10('0x21')]=0x0;transfers[_0x265f69[_0x9f10('0x44')]]['agententerreason']=0x2;}}else if(_0x265f69[_0x9f10('0x40')]==_0x265f69[_0x9f10('0x49')]){if(!_['isNil'](agents[_0x265f69[_0x9f10('0x3e')]])){utils['info'](util[_0x9f10('0x3')](_0x9f10('0x4a'),_0x265f69[_0x9f10('0x3e')],agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x8')]));agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x41')]=!![];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x4b')]='ATTENDED';agents[_0x265f69['origtransfereruniqueid']][_0x9f10('0x3b')]=_0x265f69[_0x9f10('0x4c')];agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x3d')]=_0x265f69[_0x9f10('0x40')];}if(_0x265f69[_0x9f10('0x4d')]&&agents[_0x265f69[_0x9f10('0x4d')]]){agents[_0x265f69['transfertargetuniqueid']][_0x9f10('0x45')]=0x1;transfers[_0x265f69[_0x9f10('0x4d')]]=_['clone'](agents[_0x265f69[_0x9f10('0x4d')]]);transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0xa')]=agents[_0x265f69[_0x9f10('0x3e')]]['calleridnum'];transfers[_0x265f69[_0x9f10('0x4d')]]['calleridname']=agents[_0x265f69[_0x9f10('0x3e')]][_0x9f10('0x47')];transfers[_0x265f69[_0x9f10('0x4d')]]['agentcalledAt']=utils[_0x9f10('0x17')]();transfers[_0x265f69['transfertargetuniqueid']][_0x9f10('0x2b')]=utils[_0x9f10('0x17')]();transfers[_0x265f69[_0x9f10('0x4d')]]['holdtime']=0x0;transfers[_0x265f69[_0x9f10('0x4d')]]['agententerreason']=0x2;}}}catch(_0x5708c1){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x4e'),_0x265f69['origtransfereruniqueid']),_0x5708c1);}};exports[_0x9f10('0x4f')]=function(_0x5a64ae){try{utils['debug'](util[_0x9f10('0x3')]('[%s][agents][hangup]',_0x5a64ae['uniqueid']),_0x5a64ae);if(agents[_0x5a64ae[_0x9f10('0x5')]]&&agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]===_0x9f10('0x20')){if(_0x5a64ae[_0x9f10('0x50')]==='21'){agents[_0x5a64ae['uniqueid']][_0x9f10('0x28')]=_0x9f10('0x51');agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]='rejected';}utils['info'](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],agents[_0x5a64ae['uniqueid']][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);var _0x27f337=unanswered[_0x9f10('0x53')](_0x5a64ae[_0x9f10('0x5')]);if(_0x27f337>-0x1){unanswered[_0x9f10('0x54')](_0x27f337,0x1);}}if(transfers[_0x5a64ae[_0x9f10('0x5')]]){transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xf')]=!![];transfers[_0x5a64ae['uniqueid']][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x23')]=utils['diffTime'](transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]);transfers[_0x5a64ae['uniqueid']]['reason']=_0x9f10('0x55');transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]=_0x9f10('0x34');utils[_0x9f10('0x19')](util[_0x9f10('0x3')](_0x9f10('0x52'),_0x5a64ae[_0x9f10('0x5')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x8')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')],transfers[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(transfers[_0x5a64ae[_0x9f10('0x5')]],!![]);}if(agents[_0x5a64ae['uniqueid']]&&agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x2b')]){agents[_0x5a64ae['uniqueid']][_0x9f10('0xf')]=!![];agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')]=utils[_0x9f10('0x17')]();agents[_0x5a64ae['uniqueid']][_0x9f10('0x23')]=utils['diffTime'](agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x32')],agents[_0x5a64ae[_0x9f10('0x5')]]['agentconnectAt']);agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0x28')]=agents[_0x5a64ae[_0x9f10('0x5')]]['transfer']?_0x9f10('0x41'):_0x9f10('0x55');agents[_0x5a64ae[_0x9f10('0x5')]]['lastevent']='complete';utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5a64ae['uniqueid'],agents[_0x5a64ae['uniqueid']][_0x9f10('0x8')],agents[_0x5a64ae[_0x9f10('0x5')]]['reason'],agents[_0x5a64ae[_0x9f10('0x5')]][_0x9f10('0xc')]));writeDB(agents[_0x5a64ae[_0x9f10('0x5')]]);}}catch(_0x3b3dd8){utils[_0x9f10('0x25')](util[_0x9f10('0x3')](_0x9f10('0x56'),_0x5a64ae[_0x9f10('0x5')]),_0x3b3dd8);}};
\ No newline at end of file
+var _0xa571=['calleridname','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','debug','[%s][agents][agentcalled]','agentcalledAt','now','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','transferexten','transferuniqueid','transfereeuniqueid','agententerreason'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa571,0x107));var _0x1a57=function(_0x37062b,_0x1d9e05){_0x37062b=_0x37062b-0x0;var _0x3a9d05=_0xa571[_0x37062b];return _0x3a9d05;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var utils=require(_0x1a57('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1067d9,_0x48485e){utils[_0x1a57('0x3')](util[_0x1a57('0x4')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1067d9['uniqueid'],_0x1067d9[_0x1a57('0x5')],_0x1067d9['queue'],_0x1067d9[_0x1a57('0x6')],_0x1067d9[_0x1a57('0x7')],_0x1067d9[_0x1a57('0x8')],_0x1067d9[_0x1a57('0x9')],_0x1067d9[_0x1a57('0xa')]));if(_0x1067d9[_0x1a57('0xb')]){utils['getVoiceQueueByName'](_0x1067d9[_0x1a57('0xb')])[_0x1a57('0xc')](function(_0x3631d6){if(_0x3631d6){_0x1067d9['type']=_0x3631d6[_0x1a57('0xd')];_0x1067d9[_0x1a57('0xe')]=_0x1067d9[_0x1a57('0xf')]?_0x3631d6[_0x1a57('0x10')]:![];_0x1067d9[_0x1a57('0x11')]=_0x1067d9[_0x1a57('0xe')]?_0x3631d6[_0x1a57('0x12')]:0x0;}utils[_0x1a57('0x13')]('CreateVoiceAgentReport',_0x1067d9);});}else{utils['request'](_0x1a57('0x14'),_0x1067d9);}if(_0x48485e){delete transfers[_0x1067d9[_0x1a57('0x15')]];}else{delete agents[_0x1067d9[_0x1a57('0x16')]];}}exports['agentcalled']=function(_0x3de36a){try{utils[_0x1a57('0x17')](util['format'](_0x1a57('0x18'),_0x3de36a['uniqueid']),_0x3de36a);agents[_0x3de36a[_0x1a57('0x16')]]=_0x3de36a;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();agents[_0x3de36a['destuniqueid']][_0x1a57('0xa')]='called';agents[_0x3de36a['destuniqueid']][_0x1a57('0x9')]=null;agents[_0x3de36a[_0x1a57('0x16')]][_0x1a57('0x1b')]=null;utils['info'](util[_0x1a57('0x4')](_0x1a57('0x1c'),_0x3de36a[_0x1a57('0x15')],agents[_0x3de36a['destuniqueid']][_0x1a57('0x6')],_0x3de36a[_0x1a57('0x16')]));}catch(_0x451b34){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentcalled]',_0x3de36a['uniqueid']),_0x451b34);}};exports[_0x1a57('0x1e')]=function(_0x21e811){try{if(!_[_0x1a57('0x1f')](agents[_0x21e811['destuniqueid']])){utils['debug'](util['format'](_0x1a57('0x20'),_0x21e811[_0x1a57('0x15')]),_0x21e811);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x21'),_0x21e811[_0x1a57('0x15')],agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x6')],_0x21e811[_0x1a57('0x16')]));agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x1e')]=!![];agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x22')]=utils[_0x1a57('0x1a')]();agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x24')]=_0x1a57('0x23');agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x25')]=_0x21e811['ringtime']?parseInt(_0x21e811['ringtime'])/0x3e8:0x0;agents[_0x21e811[_0x1a57('0x16')]][_0x1a57('0x26')]=0x0;unanswered['push'](_0x21e811[_0x1a57('0x16')]);}}catch(_0x54f6a5){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')]('[%s][agents][agentringnoanswer]',_0x21e811[_0x1a57('0x15')]),_0x54f6a5);}};exports[_0x1a57('0x27')]=function(_0x30527c){try{_[_0x1a57('0x28')](agents,function(_0x492b90,_0x366d5f){if(_0x492b90[_0x1a57('0x15')]==_0x30527c[_0x1a57('0x15')]&&!_[_0x1a57('0x29')](unanswered,_0x492b90['destuniqueid'])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0x30527c);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x2b'),_0x30527c[_0x1a57('0x15')],_0x492b90[_0x1a57('0x6')],_0x492b90['destuniqueid']));_0x492b90[_0x1a57('0x1e')]=!![];_0x492b90[_0x1a57('0x22')]=utils['now']();_0x492b90['lastevent']=_0x1a57('0x2c');_0x492b90[_0x1a57('0x24')]=_0x1a57('0x2c');_0x492b90[_0x1a57('0x25')]=_0x30527c[_0x1a57('0x25')];_0x492b90[_0x1a57('0x26')]=0x0;writeDB(_0x492b90);}});}catch(_0xe80d94){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2a'),_0x30527c[_0x1a57('0x15')]),_0xe80d94);}};exports[_0x1a57('0x2d')]=function(_0x12f3a7){try{if(agents[_0x12f3a7[_0x1a57('0x16')]]){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x12f3a7);utils['info'](util[_0x1a57('0x4')](_0x1a57('0x2f'),_0x12f3a7[_0x1a57('0x15')],agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x6')],_0x12f3a7[_0x1a57('0x16')]));agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();agents[_0x12f3a7['destuniqueid']]['connectedlinenum']=_0x12f3a7['connectedlinenum'];agents[_0x12f3a7['destuniqueid']][_0x1a57('0x1b')]=_0x12f3a7[_0x1a57('0x1b')];agents[_0x12f3a7[_0x1a57('0x16')]]['holdtime']=_0x12f3a7[_0x1a57('0x31')];agents[_0x12f3a7[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x32');_['forIn'](agents,function(_0x1be254,_0x5e79f0){if(_0x1be254[_0x1a57('0x16')]!=_0x12f3a7[_0x1a57('0x16')]&&_0x1be254[_0x1a57('0x15')]==_0x12f3a7['uniqueid']){_0x1be254[_0x1a57('0x26')]=0x0;_0x1be254[_0x1a57('0x25')]=_0x12f3a7[_0x1a57('0x31')];_0x1be254[_0x1a57('0x1e')]=!![];_0x1be254[_0x1a57('0x22')]=utils['now']();_0x1be254[_0x1a57('0xa')]='answered_elsewhere';_0x1be254['reason']=_0x1a57('0x33');_0x1be254['answeredelsewheredestinationuniqueid']=_0x12f3a7[_0x1a57('0x16')];_0x1be254[_0x1a57('0x34')]=_0x12f3a7[_0x1a57('0x6')];writeDB(_0x1be254);}});}}catch(_0x59abb1){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x2e'),_0x12f3a7[_0x1a57('0x15')]),_0x59abb1);}};exports['agentcomplete']=function(_0xc7bab4){try{if(!_[_0x1a57('0x1f')](agents[_0xc7bab4['destuniqueid']])){utils[_0x1a57('0x17')](util['format']('[%s][agents][agentcomplete]',_0xc7bab4[_0x1a57('0x15')]),_0xc7bab4);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x35'),_0xc7bab4['uniqueid'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x6')],_0xc7bab4[_0x1a57('0x16')]));agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xf')]=!![];agents[_0xc7bab4['destuniqueid']][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x26')]=utils['diffTime'](agents[_0xc7bab4[_0x1a57('0x16')]]['agentcompleteAt'],agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x30')]);agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0x24')]=_0xc7bab4[_0x1a57('0x24')];agents[_0xc7bab4[_0x1a57('0x16')]][_0x1a57('0xa')]=_0x1a57('0x37');writeDB(agents[_0xc7bab4[_0x1a57('0x16')]]);}}catch(_0x424065){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x38'),_0xc7bab4['uniqueid']),_0x424065);}};exports[_0x1a57('0x39')]=function(_0x480aff){try{if(!_[_0x1a57('0x1f')](agents[_0x480aff[_0x1a57('0x3a')]])){utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x480aff);utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x3c'),_0x480aff['uniqueid'],agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x6')],agents[_0x480aff['transfereruniqueid']][_0x1a57('0x15')]));agents[_0x480aff[_0x1a57('0x3a')]]['transfer']=!![];agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x3d')]='blind';agents[_0x480aff['transfereruniqueid']]['transferexten']=_0x480aff[_0x1a57('0x3e')];agents[_0x480aff[_0x1a57('0x3a')]]['transferuniqueid']=agents[_0x480aff[_0x1a57('0x3a')]][_0x1a57('0x15')];}}catch(_0x572202){utils['error'](util['format'](_0x1a57('0x3b'),_0x480aff[_0x1a57('0x15')]),_0x572202);}};exports[_0x1a57('0x3f')]=function(_0x31be00){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x31be00);if(_0x31be00['origtransfereruniqueid']==_0x31be00['origtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00['secondtransfereruniqueid']])){utils['info'](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x6')]));agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x44')]=!![];agents[_0x31be00[_0x1a57('0x43')]]['transfertype']='ATTENDED';agents[_0x31be00['secondtransfereruniqueid']][_0x1a57('0x45')]=_0x31be00['origtransfererexten'];agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x41')];}if(_0x31be00[_0x1a57('0x47')]&&agents[_0x31be00[_0x1a57('0x47')]]){agents[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x48')]=0x1;transfers[_0x31be00['transfereeuniqueid']]=_['clone'](agents[_0x31be00['transfereeuniqueid']]);transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x43')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x49')]=agents[_0x31be00[_0x1a57('0x43')]]['calleridname'];transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x19')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x47')]]['holdtime']=0x0;transfers[_0x31be00['transfereeuniqueid']][_0x1a57('0x48')]=0x2;}}else if(_0x31be00[_0x1a57('0x43')]==_0x31be00['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x31be00[_0x1a57('0x41')]])){utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x42'),_0x31be00[_0x1a57('0x41')],agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x6')]));agents[_0x31be00['origtransfereruniqueid']]['transfer']=!![];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x3d')]=_0x1a57('0x4a');agents[_0x31be00[_0x1a57('0x41')]]['transferexten']=_0x31be00[_0x1a57('0x4b')];agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x46')]=_0x31be00[_0x1a57('0x43')];}if(_0x31be00[_0x1a57('0x4c')]&&agents[_0x31be00['transfertargetuniqueid']]){agents[_0x31be00['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x31be00[_0x1a57('0x4c')]]=_[_0x1a57('0x4d')](agents[_0x31be00[_0x1a57('0x4c')]]);transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x8')]=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x8')];transfers[_0x31be00[_0x1a57('0x4c')]]['calleridname']=agents[_0x31be00[_0x1a57('0x41')]][_0x1a57('0x49')];transfers[_0x31be00['transfertargetuniqueid']]['agentcalledAt']=utils[_0x1a57('0x1a')]();transfers[_0x31be00['transfertargetuniqueid']][_0x1a57('0x30')]=utils[_0x1a57('0x1a')]();transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x25')]=0x0;transfers[_0x31be00[_0x1a57('0x4c')]][_0x1a57('0x48')]=0x2;}}}catch(_0x213576){utils[_0x1a57('0x1d')](util['format'](_0x1a57('0x40'),_0x31be00[_0x1a57('0x41')]),_0x213576);}};exports['hangup']=function(_0x24b56c){try{utils[_0x1a57('0x17')](util[_0x1a57('0x4')]('[%s][agents][hangup]',_0x24b56c['uniqueid']),_0x24b56c);if(agents[_0x24b56c[_0x1a57('0x15')]]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]===_0x1a57('0x23')){if(_0x24b56c['cause']==='21'){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')]=_0x1a57('0x4e');agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]='rejected';}utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x6')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);var _0x48a10e=unanswered[_0x1a57('0x50')](_0x24b56c[_0x1a57('0x15')]);if(_0x48a10e>-0x1){unanswered['splice'](_0x48a10e,0x1);}}if(transfers[_0x24b56c[_0x1a57('0x15')]]){transfers[_0x24b56c[_0x1a57('0x15')]]['agentcomplete']=!![];transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x26')]=utils[_0x1a57('0x51')](transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],transfers[_0x24b56c['uniqueid']][_0x1a57('0x30')]);transfers[_0x24b56c[_0x1a57('0x15')]]['reason']=_0x1a57('0x52');transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]=_0x1a57('0x37');utils[_0x1a57('0x3')](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],transfers[_0x24b56c[_0x1a57('0x15')]]['membername'],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],transfers[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xa')]));writeDB(transfers[_0x24b56c[_0x1a57('0x15')]],!![]);}if(agents[_0x24b56c['uniqueid']]&&agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x30')]){agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0xf')]=!![];agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')]=utils[_0x1a57('0x1a')]();agents[_0x24b56c[_0x1a57('0x15')]]['talktime']=utils[_0x1a57('0x51')](agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x36')],agents[_0x24b56c[_0x1a57('0x15')]]['agentconnectAt']);agents[_0x24b56c['uniqueid']]['reason']=agents[_0x24b56c['uniqueid']]['transfer']?_0x1a57('0x44'):_0x1a57('0x52');agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]=_0x1a57('0x37');utils['info'](util[_0x1a57('0x4')](_0x1a57('0x4f'),_0x24b56c[_0x1a57('0x15')],agents[_0x24b56c[_0x1a57('0x15')]]['membername'],agents[_0x24b56c[_0x1a57('0x15')]][_0x1a57('0x24')],agents[_0x24b56c['uniqueid']][_0x1a57('0xa')]));writeDB(agents[_0x24b56c[_0x1a57('0x15')]]);}}catch(_0x42d41e){utils[_0x1a57('0x1d')](util[_0x1a57('0x4')](_0x1a57('0x53'),_0x24b56c[_0x1a57('0x15')]),_0x42d41e);}};
\ No newline at end of file
index daeb953..b5e5605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0023=['origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','[%s][calls][varset]','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','variable','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','sipcallid','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','appdata','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','linkedid','OutgoingSpoolFailed','exten','calleridnum','context','now','DOCUMENTATION','[%s][calls][newchannel]','newstate','debug','[%s][calls][newstate]','channelstate','isNil','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','billableseconds','error','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]'];(function(_0x5cdb77,_0x55d284){var _0x2a05a6=function(_0xe5f717){while(--_0xe5f717){_0x5cdb77['push'](_0x5cdb77['shift']());}};_0x2a05a6(++_0x55d284);}(_0x0023,0x10a));var _0x3002=function(_0x59809d,_0x321327){_0x59809d=_0x59809d-0x0;var _0x5922c9=_0x0023[_0x59809d];return _0x5922c9;};'use strict';var _=require(_0x3002('0x0'));var util=require('util');var utils=require(_0x3002('0x1'));var transfers=require(_0x3002('0x2'));var dispositions=[_0x3002('0x3'),_0x3002('0x4'),'FAILED',_0x3002('0x3'),_0x3002('0x3'),'NO\x20ANSWER',_0x3002('0x5'),'BUSY',_0x3002('0x4'),_0x3002('0x4'),_0x3002('0x4')];var channels={};function writeDB(_0x77f084){var _0x1f7523;if(transfers[_0x3002('0x6')][_0x77f084['uniqueid']]){_0x1f7523=_0x77f084[_0x3002('0x7')];_0x77f084['uniqueid']=transfers[_0x3002('0x6')][_0x77f084[_0x3002('0x7')]][_0x3002('0x8')];}utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0xb'),_0x77f084['uniqueid'],_0x77f084[_0x3002('0xc')],_0x77f084[_0x3002('0xd')],_0x77f084[_0x3002('0xe')],_0x77f084[_0x3002('0xf')],_0x77f084['calleridnum'],_0x77f084[_0x3002('0x10')],_0x77f084[_0x3002('0x11')]));if(_0x77f084[_0x3002('0x12')]){utils[_0x3002('0x13')](_0x77f084[_0x3002('0x12')])[_0x3002('0x14')](function(_0x2148b6){if(_0x2148b6){_0x77f084[_0x3002('0x15')]=_0x2148b6['id'];}utils[_0x3002('0x16')](_0x3002('0x17'),_0x77f084);});}else{utils[_0x3002('0x16')](_0x3002('0x17'),_0x77f084);}if(channels[_0x77f084['uniqueid']]){delete channels[_0x77f084[_0x3002('0x7')]];}else if(_0x1f7523&&channels[_0x1f7523]){if(!transfers['blinds'][_0x1f7523][_0x3002('0x18')])delete transfers['blinds'][_0x1f7523];delete channels[_0x1f7523];}}exports['newchannel']=function(_0x3628f9){try{utils['debug'](util[_0x3002('0xa')]('[%s][calls][newchannel]',_0x3628f9['uniqueid']),_0x3628f9);if(_0x3628f9[_0x3002('0x7')]==_0x3628f9[_0x3002('0x19')]&&_0x3628f9[_0x3002('0xc')]!=_0x3002('0x1a')){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x3628f9[_0x3002('0x7')],_0x3628f9['context'],_0x3628f9[_0x3002('0x1b')]));channels[_0x3628f9[_0x3002('0x7')]]={'uniqueid':_0x3628f9[_0x3002('0x7')],'accountcode':_0x3628f9['accountcode'],'source':_0x3628f9[_0x3002('0x1c')],'destination':_0x3628f9[_0x3002('0x1b')],'destinationcontext':_0x3628f9[_0x3002('0x1d')],'channel':_0x3628f9['channel'],'starttime':utils[_0x3002('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x3002('0x3'),'amaflags':_0x3002('0x1f')};}}catch(_0xe953f9){utils['error'](util[_0x3002('0xa')](_0x3002('0x20'),_0x3628f9[_0x3002('0x7')]),_0xe953f9);}};exports[_0x3002('0x21')]=function(_0x14cdb4){try{utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x23'),_0x14cdb4[_0x3002('0x7')]),_0x14cdb4);if(!_['isNil'](channels[_0x14cdb4[_0x3002('0x7')]])&&_0x14cdb4[_0x3002('0x24')]==0x6){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x14cdb4[_0x3002('0x7')],_0x14cdb4[_0x3002('0x1d')],_0x14cdb4[_0x3002('0xc')]));if(_[_0x3002('0x25')](channels[_0x14cdb4[_0x3002('0x7')]][_0x3002('0x26')])){channels[_0x14cdb4['uniqueid']][_0x3002('0x26')]=utils[_0x3002('0x1e')]();}}else if(!_[_0x3002('0x25')](channels[_0x14cdb4[_0x3002('0x19')]])&&_0x14cdb4[_0x3002('0x24')]==0x6&&_0x14cdb4['context']!=_0x3002('0x27')){utils['info'](util['format'](_0x3002('0x28'),_0x14cdb4[_0x3002('0x7')],_0x14cdb4[_0x3002('0x19')],_0x14cdb4[_0x3002('0x1d')],_0x14cdb4[_0x3002('0xc')]));channels[_0x14cdb4[_0x3002('0x19')]][_0x3002('0x12')]=_0x14cdb4['accountcode'];channels[_0x14cdb4[_0x3002('0x19')]][_0x3002('0x29')]=_0x14cdb4['channel'];if(_[_0x3002('0x25')](channels[_0x14cdb4['linkedid']][_0x3002('0x2a')])){channels[_0x14cdb4[_0x3002('0x19')]][_0x3002('0x2a')]=utils[_0x3002('0x1e')]();}channels[_0x14cdb4['linkedid']][_0x3002('0x2b')]=dispositions[_[_0x3002('0x2c')](_0x14cdb4[_0x3002('0x24')])]||_0x3002('0x5');}}catch(_0x1822d6){utils['error'](util[_0x3002('0xa')](_0x3002('0x23'),_0x14cdb4[_0x3002('0x7')]),_0x1822d6);}};exports[_0x3002('0x2d')]=function(_0x52e27c){try{if(!_[_0x3002('0x25')](channels[_0x52e27c['uniqueid']])){utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x2e'),_0x52e27c['uniqueid']),_0x52e27c);if(_['isNil'](channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x2f')])){channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x2f')]=_0x52e27c[_0x3002('0x30')]+'\x20<'+_0x52e27c[_0x3002('0x1c')]+'>';}utils['info'](util[_0x3002('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x52e27c[_0x3002('0x7')],channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x2f')],_0x52e27c[_0x3002('0x31')]));channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x32')]=utils[_0x3002('0x1e')]();channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x33')]=utils[_0x3002('0x34')](channels[_0x52e27c['uniqueid']][_0x3002('0x32')],channels[_0x52e27c[_0x3002('0x7')]]['starttime']);channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x35')]=channels[_0x52e27c[_0x3002('0x7')]]['answertime']?utils[_0x3002('0x34')](channels[_0x52e27c[_0x3002('0x7')]][_0x3002('0x32')],channels[_0x52e27c[_0x3002('0x7')]]['answertime']):0x0;writeDB(channels[_0x52e27c[_0x3002('0x7')]]);}}catch(_0x40c899){utils[_0x3002('0x36')](util[_0x3002('0xa')](_0x3002('0x2e'),_0x52e27c[_0x3002('0x7')]),_0x40c899);}};exports[_0x3002('0x37')]=function(_0x3cbf07){try{if(!_['isNil'](channels[_0x3cbf07[_0x3002('0x38')]])){utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x39'),_0x3cbf07[_0x3002('0x3a')]),_0x3cbf07);if(channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0xc')]==_0x3cbf07[_0x3002('0x3b')]){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x3c'),_0x3cbf07[_0x3002('0x3a')],_0x3cbf07[_0x3002('0x38')],_0x3cbf07[_0x3002('0x3d')]));channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0x29')]=_0x3cbf07[_0x3002('0x3d')];channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0x3e')]=_0x3002('0x3f');}else if(channels[_0x3cbf07[_0x3002('0x38')]][_0x3002('0xc')]=_0x3cbf07['transfertargetchannel']){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x3c'),_0x3cbf07[_0x3002('0x3a')],_0x3cbf07[_0x3002('0x38')],_0x3cbf07['origtransfererchannel']));channels[_0x3cbf07[_0x3002('0x38')]]['destinationchannel']=_0x3cbf07[_0x3002('0x40')];channels[_0x3cbf07['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x265d73){utils['error'](util[_0x3002('0xa')](_0x3002('0x39'),_0x3cbf07[_0x3002('0x3a')]),_0x265d73);}};exports['musiconholdstart']=function(_0x550755){try{if(!_[_0x3002('0x25')](channels[_0x550755[_0x3002('0x7')]])){utils[_0x3002('0x22')](util[_0x3002('0xa')](_0x3002('0x41'),_0x550755[_0x3002('0x7')]),_0x550755);channels[_0x550755[_0x3002('0x7')]][_0x3002('0x42')]=utils[_0x3002('0x1e')]();utils['info'](util['format'](_0x3002('0x43'),_0x550755[_0x3002('0x7')],channels[_0x550755[_0x3002('0x7')]][_0x3002('0x42')]));}}catch(_0x2af362){utils['error'](util[_0x3002('0xa')]('[%s][calls][musiconholdstart]',_0x550755[_0x3002('0x7')]),_0x2af362);}};exports['musiconholdstop']=function(_0x653622){try{if(!_[_0x3002('0x25')](channels[_0x653622['uniqueid']])){utils[_0x3002('0x22')](util['format']('[%s][calls][musiconholdstop]',_0x653622[_0x3002('0x7')]),_0x653622);if(!_[_0x3002('0x25')](channels[_0x653622[_0x3002('0x7')]]['musiconholdstartAt'])){channels[_0x653622[_0x3002('0x7')]][_0x3002('0x44')]+=utils[_0x3002('0x34')](utils['now'](),channels[_0x653622['uniqueid']]['musiconholdstartAt']);utils['info'](util[_0x3002('0xa')](_0x3002('0x45'),_0x653622[_0x3002('0x7')],channels[_0x653622[_0x3002('0x7')]][_0x3002('0x44')]));delete channels[_0x653622[_0x3002('0x7')]]['musiconholdstartAt'];}}}catch(_0x32838b){utils['error'](util[_0x3002('0xa')](_0x3002('0x46'),_0x653622[_0x3002('0x7')]),_0x32838b);}};exports['varset']=function(_0x349c38){try{if(!_[_0x3002('0x25')](channels[_0x349c38[_0x3002('0x7')]])){utils[_0x3002('0x22')](util['format'](_0x3002('0x47'),_0x349c38[_0x3002('0x7')]),_0x349c38);if(!_['isNil'](_0x349c38['variable']['xmd-originatecalleridnum'])){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x349c38[_0x3002('0x7')],_0x349c38['value']));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x48')]=_0x349c38[_0x3002('0x49')];}if(!_['isNil'](_0x349c38['variable'][_0x3002('0x4a')])){utils[_0x3002('0x9')](util['format'](_0x3002('0x4b'),_0x349c38[_0x3002('0x7')],_0x349c38[_0x3002('0x49')]));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x4c')]=_0x349c38['value'];channels[_0x349c38[_0x3002('0x7')]]['callerid']='\x22'+_0x349c38['value']+_0x3002('0x4d')+_0x349c38['value']+'>';}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x4f')])||!_[_0x3002('0x25')](_0x349c38['variable']['xmd-callerid'])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x50'),_0x349c38[_0x3002('0x7')],!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')]['xmd-callerid-preview'])?_0x3002('0x4f'):_0x3002('0x51'),_0x349c38[_0x3002('0x49')]));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x2f')]=_0x349c38['value'];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x52')])||!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x53')])){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x349c38[_0x3002('0x7')],!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x52')])?_0x3002('0x52'):_0x3002('0x53'),_0x349c38['value']));channels[_0x349c38[_0x3002('0x7')]]['lastapplication']=_0x3002('0x54');channels[_0x349c38['uniqueid']][_0x3002('0x55')]=_0x349c38[_0x3002('0x49')];channels[_0x349c38[_0x3002('0x7')]][_0x3002('0xd')]=!![];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x56')])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x57'),_0x349c38[_0x3002('0x7')],_0x349c38['value']));channels[_0x349c38['uniqueid']][_0x3002('0x58')]=_0x349c38[_0x3002('0x49')];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')][_0x3002('0x59')])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x5a'),_0x349c38[_0x3002('0x7')],_0x349c38[_0x3002('0x49')]));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x5b')]=_0x349c38[_0x3002('0x49')];}if(!_[_0x3002('0x25')](_0x349c38['variable'][_0x3002('0x5c')])){utils[_0x3002('0x9')](util[_0x3002('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x349c38['uniqueid'],_0x349c38['value']));channels[_0x349c38[_0x3002('0x7')]][_0x3002('0x5d')]=_0x349c38['value'];}if(!_[_0x3002('0x25')](_0x349c38[_0x3002('0x4e')]['sipcallid'])){utils[_0x3002('0x9')](util[_0x3002('0xa')](_0x3002('0x5e'),_0x349c38[_0x3002('0x7')],_0x349c38[_0x3002('0x49')]));channels[_0x349c38['uniqueid']][_0x3002('0x5f')]=_0x349c38['value'];}}}catch(_0x4dbd4c){utils[_0x3002('0x36')](util[_0x3002('0xa')](_0x3002('0x47'),_0x349c38[_0x3002('0x7')]),_0x4dbd4c);}};exports['newexten']=function(_0x5f32fd){try{if(!_[_0x3002('0x25')](channels[_0x5f32fd[_0x3002('0x7')]])){utils[_0x3002('0x22')](util['format'](_0x3002('0x60'),_0x5f32fd[_0x3002('0x7')]),_0x5f32fd);utils['info'](util['format'](_0x3002('0x61'),_0x5f32fd[_0x3002('0x7')],_0x5f32fd[_0x3002('0x62')],_0x5f32fd['appdata']));if(_0x5f32fd[_0x3002('0x62')][_0x3002('0x63')]()=='set'&&_['startsWith'](_0x5f32fd[_0x3002('0x64')][_0x3002('0x63')](),'cdr')){var _0x19dc51=_0x5f32fd[_0x3002('0x64')]['split']('=');var _0x1ebc14=_0x19dc51[0x0][_0x3002('0x65')](_0x19dc51[0x0][_0x3002('0x66')]('(')+0x1,_0x19dc51[0x0]['lastIndexOf'](')'));var _0x183256=_0x19dc51[0x1];channels[_0x5f32fd[_0x3002('0x7')]][_0x1ebc14]=_0x183256;}if(!_[_0x3002('0x67')](['hangup',_0x3002('0x68'),_0x3002('0x69'),_0x3002('0x6a'),_0x3002('0x6b')],_0x5f32fd[_0x3002('0x62')][_0x3002('0x63')]())){channels[_0x5f32fd['uniqueid']]['lastapplication']=_0x5f32fd[_0x3002('0x62')];channels[_0x5f32fd['uniqueid']][_0x3002('0x55')]=_0x5f32fd[_0x3002('0x64')];}}}catch(_0x5b62bf){utils[_0x3002('0x36')](util['format'](_0x3002('0x60'),_0x5f32fd[_0x3002('0x7')]),_0x5b62bf);}};
\ No newline at end of file
+var _0xeaab=['lastIndexOf','noop','gotoif','lastapplication','[%s][calls][newexten]','lodash','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','calleridnum','lastevent','getUserByInternal','accountcode','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','hangup','callerid','calleridname','cause-txt','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','application','appdata','toLowerCase','set','startsWith','split','substring'];(function(_0x13c491,_0x2909a9){var _0x24bf67=function(_0x3514cf){while(--_0x3514cf){_0x13c491['push'](_0x13c491['shift']());}};_0x24bf67(++_0x2909a9);}(_0xeaab,0xd9));var _0xbeaa=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xeaab[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xbeaa('0x0'));var util=require('util');var utils=require(_0xbeaa('0x1'));var transfers=require(_0xbeaa('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0xbeaa('0x3'),_0xbeaa('0x4'),_0xbeaa('0x4'),_0xbeaa('0x4'),_0xbeaa('0x5'),_0xbeaa('0x6'),_0xbeaa('0x3'),_0xbeaa('0x3'),_0xbeaa('0x3')];var channels={};function writeDB(_0x42a779){var _0x346043;if(transfers[_0xbeaa('0x7')][_0x42a779[_0xbeaa('0x8')]]){_0x346043=_0x42a779[_0xbeaa('0x8')];_0x42a779['uniqueid']=transfers[_0xbeaa('0x7')][_0x42a779[_0xbeaa('0x8')]][_0xbeaa('0x9')];}utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0xc'),_0x42a779[_0xbeaa('0x8')],_0x42a779['channel'],_0x42a779[_0xbeaa('0xd')],_0x42a779['membername'],_0x42a779[_0xbeaa('0xe')],_0x42a779[_0xbeaa('0xf')],_0x42a779['connectedlinenum'],_0x42a779[_0xbeaa('0x10')]));if(_0x42a779['accountcode']){utils[_0xbeaa('0x11')](_0x42a779[_0xbeaa('0x12')])['then'](function(_0x3f2f3d){if(_0x3f2f3d){_0x42a779[_0xbeaa('0x13')]=_0x3f2f3d['id'];}utils[_0xbeaa('0x14')](_0xbeaa('0x15'),_0x42a779);});}else{utils[_0xbeaa('0x14')](_0xbeaa('0x15'),_0x42a779);}if(channels[_0x42a779[_0xbeaa('0x8')]]){delete channels[_0x42a779[_0xbeaa('0x8')]];}else if(_0x346043&&channels[_0x346043]){if(!transfers[_0xbeaa('0x7')][_0x346043][_0xbeaa('0x16')])delete transfers[_0xbeaa('0x7')][_0x346043];delete channels[_0x346043];}}exports[_0xbeaa('0x17')]=function(_0x24c1ce){try{utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')](_0xbeaa('0x19'),_0x24c1ce[_0xbeaa('0x8')]),_0x24c1ce);if(_0x24c1ce[_0xbeaa('0x8')]==_0x24c1ce[_0xbeaa('0x1a')]&&_0x24c1ce[_0xbeaa('0x1b')]!=_0xbeaa('0x1c')){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x1d'),_0x24c1ce[_0xbeaa('0x8')],_0x24c1ce['context'],_0x24c1ce[_0xbeaa('0x1e')]));channels[_0x24c1ce[_0xbeaa('0x8')]]={'uniqueid':_0x24c1ce[_0xbeaa('0x8')],'accountcode':_0x24c1ce[_0xbeaa('0x12')],'source':_0x24c1ce[_0xbeaa('0xf')],'destination':_0x24c1ce[_0xbeaa('0x1e')],'destinationcontext':_0x24c1ce[_0xbeaa('0x1f')],'channel':_0x24c1ce['channel'],'starttime':utils[_0xbeaa('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbeaa('0x4'),'amaflags':'DOCUMENTATION'};}}catch(_0x5f1ac0){utils['error'](util[_0xbeaa('0xb')](_0xbeaa('0x19'),_0x24c1ce[_0xbeaa('0x8')]),_0x5f1ac0);}};exports[_0xbeaa('0x21')]=function(_0x5345b9){try{utils['debug'](util['format'](_0xbeaa('0x22'),_0x5345b9[_0xbeaa('0x8')]),_0x5345b9);if(!_[_0xbeaa('0x23')](channels[_0x5345b9[_0xbeaa('0x8')]])&&_0x5345b9[_0xbeaa('0x24')]==0x6){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x25'),_0x5345b9[_0xbeaa('0x8')],_0x5345b9['context'],_0x5345b9[_0xbeaa('0x1b')]));if(_[_0xbeaa('0x23')](channels[_0x5345b9[_0xbeaa('0x8')]]['systemanswertime'])){channels[_0x5345b9[_0xbeaa('0x8')]]['systemanswertime']=utils[_0xbeaa('0x20')]();}}else if(!_[_0xbeaa('0x23')](channels[_0x5345b9[_0xbeaa('0x1a')]])&&_0x5345b9[_0xbeaa('0x24')]==0x6&&_0x5345b9[_0xbeaa('0x1f')]!='transfer'){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x5345b9[_0xbeaa('0x8')],_0x5345b9[_0xbeaa('0x1a')],_0x5345b9['context'],_0x5345b9[_0xbeaa('0x1b')]));channels[_0x5345b9['linkedid']]['accountcode']=_0x5345b9['accountcode'];channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x26')]=_0x5345b9[_0xbeaa('0x1b')];if(_['isNil'](channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x27')])){channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x27')]=utils['now']();}channels[_0x5345b9[_0xbeaa('0x1a')]][_0xbeaa('0x28')]=dispositions[_[_0xbeaa('0x29')](_0x5345b9[_0xbeaa('0x24')])]||_0xbeaa('0x5');}}catch(_0x44b2a8){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x22'),_0x5345b9['uniqueid']),_0x44b2a8);}};exports[_0xbeaa('0x2b')]=function(_0x197d0d){try{if(!_['isNil'](channels[_0x197d0d['uniqueid']])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')]('[%s][calls][hangup]',_0x197d0d[_0xbeaa('0x8')]),_0x197d0d);if(_[_0xbeaa('0x23')](channels[_0x197d0d[_0xbeaa('0x8')]]['callerid'])){channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x2c')]=_0x197d0d[_0xbeaa('0x2d')]+'\x20<'+_0x197d0d[_0xbeaa('0xf')]+'>';}utils['info'](util['format']('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x197d0d['uniqueid'],channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x2c')],_0x197d0d[_0xbeaa('0x2e')]));channels[_0x197d0d[_0xbeaa('0x8')]]['endtime']=utils[_0xbeaa('0x20')]();channels[_0x197d0d[_0xbeaa('0x8')]]['duration']=utils[_0xbeaa('0x2f')](channels[_0x197d0d['uniqueid']][_0xbeaa('0x30')],channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x31')]);channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x32')]=channels[_0x197d0d[_0xbeaa('0x8')]]['answertime']?utils[_0xbeaa('0x2f')](channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x30')],channels[_0x197d0d[_0xbeaa('0x8')]][_0xbeaa('0x27')]):0x0;writeDB(channels[_0x197d0d['uniqueid']]);}}catch(_0x586f50){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')]('[%s][calls][hangup]',_0x197d0d['uniqueid']),_0x586f50);}};exports[_0xbeaa('0x33')]=function(_0x4eab56){try{if(!_[_0xbeaa('0x23')](channels[_0x4eab56[_0xbeaa('0x34')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')](_0xbeaa('0x35'),_0x4eab56[_0xbeaa('0x36')]),_0x4eab56);if(channels[_0x4eab56[_0xbeaa('0x34')]][_0xbeaa('0x1b')]==_0x4eab56['transfereechannel']){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x37'),_0x4eab56['origtransfereruniqueid'],_0x4eab56[_0xbeaa('0x34')],_0x4eab56['secondtransfererchannel']));channels[_0x4eab56[_0xbeaa('0x34')]][_0xbeaa('0x26')]=_0x4eab56[_0xbeaa('0x38')];channels[_0x4eab56[_0xbeaa('0x34')]][_0xbeaa('0x39')]=_0xbeaa('0x3a');}else if(channels[_0x4eab56['localtwolinkedid']][_0xbeaa('0x1b')]=_0x4eab56['transfertargetchannel']){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x37'),_0x4eab56['origtransfereruniqueid'],_0x4eab56[_0xbeaa('0x34')],_0x4eab56[_0xbeaa('0x3b')]));channels[_0x4eab56['localtwolinkedid']][_0xbeaa('0x26')]=_0x4eab56[_0xbeaa('0x3b')];channels[_0x4eab56['localtwolinkedid']][_0xbeaa('0x39')]=_0xbeaa('0x3a');}}}catch(_0x5962f9){utils['error'](util['format'](_0xbeaa('0x35'),_0x4eab56[_0xbeaa('0x36')]),_0x5962f9);}};exports[_0xbeaa('0x3c')]=function(_0x8bbbd3){try{if(!_[_0xbeaa('0x23')](channels[_0x8bbbd3[_0xbeaa('0x8')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')](_0xbeaa('0x3d'),_0x8bbbd3[_0xbeaa('0x8')]),_0x8bbbd3);channels[_0x8bbbd3[_0xbeaa('0x8')]][_0xbeaa('0x3e')]=utils[_0xbeaa('0x20')]();utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x8bbbd3[_0xbeaa('0x8')],channels[_0x8bbbd3['uniqueid']][_0xbeaa('0x3e')]));}}catch(_0x5e46de){utils['error'](util[_0xbeaa('0xb')](_0xbeaa('0x3d'),_0x8bbbd3[_0xbeaa('0x8')]),_0x5e46de);}};exports[_0xbeaa('0x3f')]=function(_0x490ef1){try{if(!_[_0xbeaa('0x23')](channels[_0x490ef1[_0xbeaa('0x8')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')]('[%s][calls][musiconholdstop]',_0x490ef1[_0xbeaa('0x8')]),_0x490ef1);if(!_['isNil'](channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x3e')])){channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x40')]+=utils['diffTime'](utils['now'](),channels[_0x490ef1['uniqueid']]['musiconholdstartAt']);utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x41'),_0x490ef1[_0xbeaa('0x8')],channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x40')]));delete channels[_0x490ef1[_0xbeaa('0x8')]][_0xbeaa('0x3e')];}}}catch(_0x38f662){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x42'),_0x490ef1[_0xbeaa('0x8')]),_0x38f662);}};exports[_0xbeaa('0x43')]=function(_0x1e4ad4){try{if(!_['isNil'](channels[_0x1e4ad4['uniqueid']])){utils['debug'](util[_0xbeaa('0xb')](_0xbeaa('0x44'),_0x1e4ad4['uniqueid']),_0x1e4ad4);if(!_[_0xbeaa('0x23')](_0x1e4ad4['variable'][_0xbeaa('0x45')])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1e4ad4['uniqueid'],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x47')]=_0x1e4ad4[_0xbeaa('0x46')];}if(!_['isNil'](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x49')])){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x4a'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4['value']));channels[_0x1e4ad4['uniqueid']][_0xbeaa('0x4b')]=_0x1e4ad4['value'];channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x2c')]='\x22'+_0x1e4ad4['value']+_0xbeaa('0x4c')+_0x1e4ad4[_0xbeaa('0x46')]+'>';}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x4d')])||!_[_0xbeaa('0x23')](_0x1e4ad4['variable']['xmd-callerid'])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x4e'),_0x1e4ad4[_0xbeaa('0x8')],!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x4d')])?_0xbeaa('0x4d'):_0xbeaa('0x4f'),_0x1e4ad4['value']));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x2c')]=_0x1e4ad4[_0xbeaa('0x46')];}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x50')])||!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x51')])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x4e'),_0x1e4ad4[_0xbeaa('0x8')],!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')]['xmd-queue'])?_0xbeaa('0x50'):_0xbeaa('0x51'),_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]]['lastapplication']=_0xbeaa('0x52');channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x53')]=_0x1e4ad4['value'];channels[_0x1e4ad4['uniqueid']][_0xbeaa('0xd')]=!![];}if(!_['isNil'](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x54')])){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x55'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x56')]=_0x1e4ad4['value'];}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x57')])){utils['info'](util[_0xbeaa('0xb')](_0xbeaa('0x58'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]]['type']=_0x1e4ad4[_0xbeaa('0x46')];}if(!_[_0xbeaa('0x23')](_0x1e4ad4[_0xbeaa('0x48')][_0xbeaa('0x59')])){utils[_0xbeaa('0xa')](util[_0xbeaa('0xb')](_0xbeaa('0x5a'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4[_0xbeaa('0x8')]][_0xbeaa('0x5b')]=_0x1e4ad4[_0xbeaa('0x46')];}if(!_['isNil'](_0x1e4ad4['variable'][_0xbeaa('0x5c')])){utils[_0xbeaa('0xa')](util['format'](_0xbeaa('0x5d'),_0x1e4ad4[_0xbeaa('0x8')],_0x1e4ad4[_0xbeaa('0x46')]));channels[_0x1e4ad4['uniqueid']][_0xbeaa('0x5c')]=_0x1e4ad4[_0xbeaa('0x46')];}}}catch(_0x398f06){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x44'),_0x1e4ad4[_0xbeaa('0x8')]),_0x398f06);}};exports['newexten']=function(_0x3a7866){try{if(!_['isNil'](channels[_0x3a7866[_0xbeaa('0x8')]])){utils[_0xbeaa('0x18')](util[_0xbeaa('0xb')]('[%s][calls][newexten]',_0x3a7866[_0xbeaa('0x8')]),_0x3a7866);utils[_0xbeaa('0xa')](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x3a7866['uniqueid'],_0x3a7866[_0xbeaa('0x5e')],_0x3a7866[_0xbeaa('0x5f')]));if(_0x3a7866[_0xbeaa('0x5e')][_0xbeaa('0x60')]()==_0xbeaa('0x61')&&_[_0xbeaa('0x62')](_0x3a7866[_0xbeaa('0x5f')][_0xbeaa('0x60')](),'cdr')){var _0x38b591=_0x3a7866[_0xbeaa('0x5f')][_0xbeaa('0x63')]('=');var _0x476bd6=_0x38b591[0x0][_0xbeaa('0x64')](_0x38b591[0x0][_0xbeaa('0x65')]('(')+0x1,_0x38b591[0x0]['lastIndexOf'](')'));var _0x449415=_0x38b591[0x1];channels[_0x3a7866['uniqueid']][_0x476bd6]=_0x449415;}if(!_['includes']([_0xbeaa('0x2b'),_0xbeaa('0x66'),'execif',_0xbeaa('0x61'),_0xbeaa('0x67')],_0x3a7866[_0xbeaa('0x5e')][_0xbeaa('0x60')]())){channels[_0x3a7866[_0xbeaa('0x8')]][_0xbeaa('0x68')]=_0x3a7866[_0xbeaa('0x5e')];channels[_0x3a7866['uniqueid']]['lastdata']=_0x3a7866[_0xbeaa('0x5f')];}}}catch(_0x383afa){utils[_0xbeaa('0x2a')](util[_0xbeaa('0xb')](_0xbeaa('0x69'),_0x3a7866[_0xbeaa('0x8')]),_0x383afa);}};
\ No newline at end of file
index 7ac5858..bdc503b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa720=['[core]\x20close','managerevent','./utils','connect','info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x6bddeb,_0x1eea53){var _0x6285cb=function(_0x1bef1f){while(--_0x1bef1f){_0x6bddeb['push'](_0x6bddeb['shift']());}};_0x6285cb(++_0x1eea53);}(_0xa720,0x115));var _0x0a72=function(_0x11d418,_0xba2735){_0x11d418=_0x11d418-0x0;var _0x57677d=_0xa720[_0x11d418];return _0x57677d;};'use strict';var utils=require(_0x0a72('0x0'));exports[_0x0a72('0x1')]=function(){utils[_0x0a72('0x2')]('[core]\x20connected');};exports['shutdown']=function(){utils['info'](_0x0a72('0x3'));};exports[_0x0a72('0x4')]=function(){utils[_0x0a72('0x2')](_0x0a72('0x5'));};exports['error']=function(_0x2131ec){utils[_0x0a72('0x6')](_0x0a72('0x7'),_0x2131ec);};exports[_0x0a72('0x8')]=function(){utils[_0x0a72('0x2')](_0x0a72('0x9'));};exports[_0x0a72('0xa')]=function(_0x449cd5){};
\ No newline at end of file
+var _0x6cff=['[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','connect','info','[core]\x20connected','shutdown'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x6cff,0x11c));var _0xf6cf=function(_0x569a45,_0x2da15b){_0x569a45=_0x569a45-0x0;var _0x1a5ef8=_0x6cff[_0x569a45];return _0x1a5ef8;};'use strict';var utils=require('./utils');exports[_0xf6cf('0x0')]=function(){utils[_0xf6cf('0x1')](_0xf6cf('0x2'));};exports[_0xf6cf('0x3')]=function(){utils[_0xf6cf('0x1')](_0xf6cf('0x4'));};exports['fullybooted']=function(){utils[_0xf6cf('0x1')](_0xf6cf('0x5'));};exports[_0xf6cf('0x6')]=function(_0x4353fa){utils[_0xf6cf('0x6')](_0xf6cf('0x7'),_0x4353fa);};exports[_0xf6cf('0x8')]=function(){utils[_0xf6cf('0x1')]('[core]\x20close');};exports['managerevent']=function(_0x47dbbf){};
\ No newline at end of file
index 548f2ad..44f5b42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc790=['connectedlinenum','CreateVoiceDialReport','newexten','[%s][dials][newexten]','application','set','cdr(routeid)','appdata','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','debug','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','dialstatus','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','duration','diffTime','endtime','holdtime','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xc790,0x11c));var _0x0c79=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xc790[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x0c79('0x0'));var util=require(_0x0c79('0x1'));var utils=require(_0x0c79('0x2'));var dials={};function writeDB(_0x471a93){utils[_0x0c79('0x3')](util[_0x0c79('0x4')](_0x0c79('0x5'),_0x471a93[_0x0c79('0x6')],_0x471a93[_0x0c79('0x7')],_0x471a93[_0x0c79('0x8')],_0x471a93[_0x0c79('0x9')],_0x471a93[_0x0c79('0xa')],_0x471a93['dialstatus']));utils['request'](_0x0c79('0xb'),_0x471a93);delete dials[_0x471a93[_0x0c79('0x6')]];}exports[_0x0c79('0xc')]=function(_0x4326d3){try{utils['debug'](util['format'](_0x0c79('0xd'),_0x4326d3['uniqueid']),_0x4326d3);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x4326d3['uniqueid'],_0x4326d3['application'],_0x4326d3['appdata']));if(_0x4326d3[_0x0c79('0xe')]['toLowerCase']()==_0x0c79('0xf')&&_['startsWith'](_0x4326d3['appdata']['toLowerCase'](),_0x0c79('0x10'))){var _0x223b15=_0x4326d3[_0x0c79('0x11')][_0x0c79('0x12')]('=');dials[_0x4326d3['uniqueid']]={'routeId':_0x223b15[0x1]};}}catch(_0x47955e){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0xd'),_0x4326d3[_0x0c79('0x6')]),_0x47955e);}};exports[_0x0c79('0x14')]=function(_0x17af5){try{utils['debug'](util['format'](_0x0c79('0x15'),_0x17af5[_0x0c79('0x6')]),_0x17af5);if(!_['isNil'](_0x17af5[_0x0c79('0x16')][_0x0c79('0x17')])){utils[_0x0c79('0x3')](util['format'](_0x0c79('0x18'),_0x17af5[_0x0c79('0x6')],_0x17af5[_0x0c79('0x19')]));dials[_0x17af5[_0x0c79('0x6')]]={'routeId':_0x17af5[_0x0c79('0x19')]};}}catch(_0x891f4d){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0x15'),_0x17af5['uniqueid']),_0x891f4d);}};exports[_0x0c79('0x1a')]=function(_0x8f03fa){try{if(!_[_0x0c79('0x1b')](dials[_0x8f03fa[_0x0c79('0x6')]])){utils[_0x0c79('0x1c')](util['format'](_0x0c79('0x1d'),_0x8f03fa[_0x0c79('0x6')]),_0x8f03fa);dials[_0x8f03fa[_0x0c79('0x6')]]=_[_0x0c79('0x1e')](dials[_0x8f03fa[_0x0c79('0x6')]],_0x8f03fa);dials[_0x8f03fa['uniqueid']][_0x0c79('0x1f')]=utils['now']();dials[_0x8f03fa[_0x0c79('0x6')]][_0x0c79('0x20')]=_0x0c79('0x21');utils[_0x0c79('0x3')](util[_0x0c79('0x4')](_0x0c79('0x22'),_0x8f03fa[_0x0c79('0x6')],dials[_0x8f03fa[_0x0c79('0x6')]][_0x0c79('0x1f')]));}}catch(_0x268dc8){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0x1d'),_0x8f03fa[_0x0c79('0x6')]),_0x268dc8);}};exports['dialend']=function(_0x4dae53){try{if(!_[_0x0c79('0x1b')](dials[_0x4dae53[_0x0c79('0x6')]])){utils[_0x0c79('0x1c')](util[_0x0c79('0x4')](_0x0c79('0x23'),_0x4dae53[_0x0c79('0x6')]),_0x4dae53);dials[_0x4dae53['uniqueid']][_0x0c79('0x24')]=_0x4dae53[_0x0c79('0x24')];if(_0x4dae53[_0x0c79('0x24')]==_0x0c79('0x25')){dials[_0x4dae53[_0x0c79('0x6')]]=_['assign'](dials[_0x4dae53['uniqueid']],_0x4dae53);dials[_0x4dae53[_0x0c79('0x6')]][_0x0c79('0x26')]=utils[_0x0c79('0x27')]();dials[_0x4dae53[_0x0c79('0x6')]][_0x0c79('0x20')]=_0x0c79('0x28');utils[_0x0c79('0x3')](util[_0x0c79('0x4')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x4dae53[_0x0c79('0x6')],_0x4dae53[_0x0c79('0x24')],dials[_0x4dae53[_0x0c79('0x6')]][_0x0c79('0x26')]));}else{utils[_0x0c79('0x3')](util['format'](_0x0c79('0x29'),_0x4dae53['uniqueid'],_0x4dae53[_0x0c79('0x24')]));}}}catch(_0x31cbdc){utils['error'](util[_0x0c79('0x4')](_0x0c79('0x23'),_0x4dae53['uniqueid']),_0x31cbdc);}};exports['hangup']=function(_0x1cdaea){try{if(!_[_0x0c79('0x1b')](dials[_0x1cdaea[_0x0c79('0x6')]])){utils[_0x0c79('0x1c')](util['format'](_0x0c79('0x2a'),_0x1cdaea[_0x0c79('0x6')]),_0x1cdaea);utils[_0x0c79('0x3')](util[_0x0c79('0x4')](_0x0c79('0x2b'),_0x1cdaea[_0x0c79('0x6')],_0x1cdaea[_0x0c79('0x9')],_0x1cdaea['calleridname'],_0x1cdaea[_0x0c79('0x2c')]));dials[_0x1cdaea[_0x0c79('0x6')]]=_[_0x0c79('0x1e')](dials[_0x1cdaea[_0x0c79('0x6')]],{'endtime':utils[_0x0c79('0x27')](),'lastevent':'complete'});dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x2d')]=utils[_0x0c79('0x2e')](dials[_0x1cdaea['uniqueid']][_0x0c79('0x2f')],dials[_0x1cdaea['uniqueid']][_0x0c79('0x1f')]);dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x30')]=utils[_0x0c79('0x2e')](dials[_0x1cdaea['uniqueid']][_0x0c79('0x26')]||dials[_0x1cdaea['uniqueid']]['endtime'],dials[_0x1cdaea['uniqueid']][_0x0c79('0x1f')]);dials[_0x1cdaea[_0x0c79('0x6')]]['billableseconds']=dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x26')]?utils[_0x0c79('0x2e')](dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x2f')],dials[_0x1cdaea[_0x0c79('0x6')]][_0x0c79('0x26')]):0x0;writeDB(dials[_0x1cdaea[_0x0c79('0x6')]]);}}catch(_0x22a5b6){utils[_0x0c79('0x13')](util[_0x0c79('0x4')](_0x0c79('0x2a'),_0x1cdaea[_0x0c79('0x6')]),_0x22a5b6);}};
\ No newline at end of file
+var _0x9519=['answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','calleridname','cause-txt','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','info','application','set','startsWith','toLowerCase','cdr(routeid)','appdata','split','error','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER'];(function(_0x383519,_0x199f38){var _0x4c5cc1=function(_0x24d75e){while(--_0x24d75e){_0x383519['push'](_0x383519['shift']());}};_0x4c5cc1(++_0x199f38);}(_0x9519,0x130));var _0x9951=function(_0x15a0a1,_0x167337){_0x15a0a1=_0x15a0a1-0x0;var _0xfe6be4=_0x9519[_0x15a0a1];return _0xfe6be4;};'use strict';var _=require(_0x9951('0x0'));var util=require(_0x9951('0x1'));var utils=require(_0x9951('0x2'));var dials={};function writeDB(_0x44dd8e){utils['info'](util[_0x9951('0x3')](_0x9951('0x4'),_0x44dd8e[_0x9951('0x5')],_0x44dd8e['channel'],_0x44dd8e['dialstring'],_0x44dd8e[_0x9951('0x6')],_0x44dd8e[_0x9951('0x7')],_0x44dd8e[_0x9951('0x8')]));utils['request'](_0x9951('0x9'),_0x44dd8e);delete dials[_0x44dd8e[_0x9951('0x5')]];}exports[_0x9951('0xa')]=function(_0x15b064){try{utils[_0x9951('0xb')](util[_0x9951('0x3')](_0x9951('0xc'),_0x15b064[_0x9951('0x5')]),_0x15b064);utils[_0x9951('0xd')](util[_0x9951('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x15b064['uniqueid'],_0x15b064[_0x9951('0xe')],_0x15b064['appdata']));if(_0x15b064[_0x9951('0xe')]['toLowerCase']()==_0x9951('0xf')&&_[_0x9951('0x10')](_0x15b064['appdata'][_0x9951('0x11')](),_0x9951('0x12'))){var _0x2bb737=_0x15b064[_0x9951('0x13')][_0x9951('0x14')]('=');dials[_0x15b064[_0x9951('0x5')]]={'routeId':_0x2bb737[0x1]};}}catch(_0x511e00){utils[_0x9951('0x15')](util[_0x9951('0x3')]('[%s][dials][newexten]',_0x15b064[_0x9951('0x5')]),_0x511e00);}};exports[_0x9951('0x16')]=function(_0x4e2b45){try{utils[_0x9951('0xb')](util[_0x9951('0x3')](_0x9951('0x17'),_0x4e2b45[_0x9951('0x5')]),_0x4e2b45);if(!_[_0x9951('0x18')](_0x4e2b45['variable'][_0x9951('0x19')])){utils[_0x9951('0xd')](util['format'](_0x9951('0x1a'),_0x4e2b45[_0x9951('0x5')],_0x4e2b45[_0x9951('0x1b')]));dials[_0x4e2b45[_0x9951('0x5')]]={'routeId':_0x4e2b45[_0x9951('0x1b')]};}}catch(_0x5b7402){utils[_0x9951('0x15')](util[_0x9951('0x3')]('[%s][dials][varset]',_0x4e2b45[_0x9951('0x5')]),_0x5b7402);}};exports[_0x9951('0x1c')]=function(_0x397a0b){try{if(!_['isNil'](dials[_0x397a0b[_0x9951('0x5')]])){utils[_0x9951('0xb')](util[_0x9951('0x3')]('[%s][dials][dialbegin]',_0x397a0b[_0x9951('0x5')]),_0x397a0b);dials[_0x397a0b[_0x9951('0x5')]]=_[_0x9951('0x1d')](dials[_0x397a0b[_0x9951('0x5')]],_0x397a0b);dials[_0x397a0b[_0x9951('0x5')]][_0x9951('0x1e')]=utils[_0x9951('0x1f')]();dials[_0x397a0b[_0x9951('0x5')]][_0x9951('0x20')]=_0x9951('0x21');utils['info'](util['format'](_0x9951('0x22'),_0x397a0b[_0x9951('0x5')],dials[_0x397a0b[_0x9951('0x5')]]['starttime']));}}catch(_0x28f0fd){utils['error'](util[_0x9951('0x3')](_0x9951('0x23'),_0x397a0b[_0x9951('0x5')]),_0x28f0fd);}};exports[_0x9951('0x24')]=function(_0x4d2dff){try{if(!_[_0x9951('0x18')](dials[_0x4d2dff[_0x9951('0x5')]])){utils[_0x9951('0xb')](util[_0x9951('0x3')](_0x9951('0x25'),_0x4d2dff['uniqueid']),_0x4d2dff);dials[_0x4d2dff['uniqueid']][_0x9951('0x8')]=_0x4d2dff['dialstatus'];if(_0x4d2dff[_0x9951('0x8')]==_0x9951('0x26')){dials[_0x4d2dff[_0x9951('0x5')]]=_[_0x9951('0x1d')](dials[_0x4d2dff[_0x9951('0x5')]],_0x4d2dff);dials[_0x4d2dff[_0x9951('0x5')]][_0x9951('0x27')]=utils[_0x9951('0x1f')]();dials[_0x4d2dff[_0x9951('0x5')]][_0x9951('0x20')]=_0x9951('0x28');utils[_0x9951('0xd')](util[_0x9951('0x3')](_0x9951('0x29'),_0x4d2dff[_0x9951('0x5')],_0x4d2dff[_0x9951('0x8')],dials[_0x4d2dff[_0x9951('0x5')]][_0x9951('0x27')]));}else{utils['info'](util[_0x9951('0x3')](_0x9951('0x2a'),_0x4d2dff['uniqueid'],_0x4d2dff['dialstatus']));}}}catch(_0xd0f6e5){utils[_0x9951('0x15')](util[_0x9951('0x3')](_0x9951('0x25'),_0x4d2dff[_0x9951('0x5')]),_0xd0f6e5);}};exports['hangup']=function(_0x46bb0c){try{if(!_[_0x9951('0x18')](dials[_0x46bb0c[_0x9951('0x5')]])){utils['debug'](util[_0x9951('0x3')]('[%s][dials][hangup]',_0x46bb0c[_0x9951('0x5')]),_0x46bb0c);utils[_0x9951('0xd')](util['format']('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x46bb0c[_0x9951('0x5')],_0x46bb0c[_0x9951('0x6')],_0x46bb0c[_0x9951('0x2b')],_0x46bb0c[_0x9951('0x2c')]));dials[_0x46bb0c[_0x9951('0x5')]]=_['assign'](dials[_0x46bb0c[_0x9951('0x5')]],{'endtime':utils[_0x9951('0x1f')](),'lastevent':'complete'});dials[_0x46bb0c[_0x9951('0x5')]]['duration']=utils[_0x9951('0x2d')](dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2e')],dials[_0x46bb0c[_0x9951('0x5')]]['starttime']);dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2f')]=utils[_0x9951('0x2d')](dials[_0x46bb0c['uniqueid']]['answertime']||dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2e')],dials[_0x46bb0c[_0x9951('0x5')]]['starttime']);dials[_0x46bb0c['uniqueid']][_0x9951('0x30')]=dials[_0x46bb0c['uniqueid']][_0x9951('0x27')]?utils['diffTime'](dials[_0x46bb0c[_0x9951('0x5')]][_0x9951('0x2e')],dials[_0x46bb0c['uniqueid']]['answertime']):0x0;writeDB(dials[_0x46bb0c['uniqueid']]);}}catch(_0x5a6d07){utils[_0x9951('0x15')](util[_0x9951('0x3')]('[%s][dials][hangup]',_0x46bb0c[_0x9951('0x5')]),_0x5a6d07);}};
\ No newline at end of file
index a68c1ea..dda0947 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb9=['format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./dials.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','debug','[%s][index][devicestatechange]','device','devicestatechange'];(function(_0x2da45d,_0x35397b){var _0x1012a0=function(_0x2babc3){while(--_0x2babc3){_0x2da45d['push'](_0x2da45d['shift']());}};_0x1012a0(++_0x35397b);}(_0x6bb9,0x142));var _0x96bb=function(_0xd0809d,_0x434817){_0xd0809d=_0xd0809d-0x0;var _0x2c8946=_0x6bb9[_0xd0809d];return _0x2c8946;};var AsteriskManager=require(_0x96bb('0x0'));var config=require(_0x96bb('0x1'));var utils=require('./utils');var util=require(_0x96bb('0x2'));var isXDREnabled=config[_0x96bb('0x3')]&&config[_0x96bb('0x3')][_0x96bb('0x4')]?!config[_0x96bb('0x3')][_0x96bb('0x4')]:!![];var isProduction=config[_0x96bb('0x5')]===_0x96bb('0x6')||![];var isLocalAsterisk=config['xdr']&&config[_0x96bb('0x3')][_0x96bb('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x96bb('0x8')][_0x96bb('0x9')],config[_0x96bb('0x8')]['ip'],config[_0x96bb('0x8')][_0x96bb('0xa')],config['asterisk'][_0x96bb('0xb')],!![]);ami[_0x96bb('0xc')]();if(!isXDREnabled){utils[_0x96bb('0xd')](_0x96bb('0xe'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x96bb('0xd')](_0x96bb('0xf'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x96bb('0x10'));var transfers=require('./transfers.controller');var core=require(_0x96bb('0x11'));ami['on'](_0x96bb('0x12'),core[_0x96bb('0x12')]);ami['on'](_0x96bb('0x13'),core[_0x96bb('0x13')]);ami['on'](_0x96bb('0x14'),core[_0x96bb('0x14')]);ami['on'](_0x96bb('0x15'),core[_0x96bb('0x15')]);ami['on'](_0x96bb('0x16'),core['close']);ami['on'](_0x96bb('0x17'),core[_0x96bb('0x17')]);ami['on']('devicestatechange',function(_0x2d55b8){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x19'),_0x2d55b8[_0x96bb('0x1a')]),_0x2d55b8);members[_0x96bb('0x1b')](_0x2d55b8);}catch(_0x3cd8b){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x19'),_0x2d55b8[_0x96bb('0x1a')]),_0x3cd8b);}});ami['on'](_0x96bb('0x1d'),function(_0x19343c){try{utils['debug'](util[_0x96bb('0x1c')](_0x96bb('0x1e'),_0x19343c[_0x96bb('0x1f')]),_0x19343c);agents[_0x96bb('0x1d')](_0x19343c);}catch(_0xa03a9){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')]('[%s][index][agentcalled]',_0x19343c[_0x96bb('0x1f')]),_0xa03a9);}});ami['on'](_0x96bb('0x20'),function(_0x33401f){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x21'),_0x33401f[_0x96bb('0x1f')]),_0x33401f);agents['agentringnoanswer'](_0x33401f);}catch(_0x4841db){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x21'),_0x33401f[_0x96bb('0x1f')]),_0x4841db);}});ami['on'](_0x96bb('0x22'),function(_0x1b37f9){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x23'),_0x1b37f9[_0x96bb('0x1f')]),_0x1b37f9);agents[_0x96bb('0x22')](_0x1b37f9);queues[_0x96bb('0x22')](_0x1b37f9);}catch(_0x3177c8){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x23'),_0x1b37f9['uniqueid']),_0x3177c8);}});ami['on'](_0x96bb('0x24'),function(_0x19e10f){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x25'),_0x19e10f[_0x96bb('0x1f')]),_0x19e10f);agents[_0x96bb('0x24')](_0x19e10f);queues[_0x96bb('0x24')](_0x19e10f);members['agentcomplete'](_0x19e10f);}catch(_0x23c442){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x25'),_0x19e10f['uniqueid']),_0x23c442);}});ami['on'](_0x96bb('0x26'),function(_0x5ad765){try{utils['debug'](util['format']('[%s][index][queuecallerabandon]',_0x5ad765[_0x96bb('0x1f')]),_0x5ad765);agents[_0x96bb('0x26')](_0x5ad765);queues['queuecallerabandon'](_0x5ad765);}catch(_0x5e7a53){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x27'),_0x5ad765['uniqueid']),_0x5e7a53);}});ami['on'](_0x96bb('0x28'),function(_0x5c81a7){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x29'),_0x5c81a7[_0x96bb('0x1f')]),_0x5c81a7);queues[_0x96bb('0x28')](_0x5c81a7);recordings[_0x96bb('0x28')](_0x5c81a7);}catch(_0x1ae5f8){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x29'),_0x5c81a7[_0x96bb('0x1f')]),_0x1ae5f8);}});ami['on'](_0x96bb('0x2a'),function(_0x43f6b6){try{utils['debug'](util['format'](_0x96bb('0x2b'),_0x43f6b6['uniqueid']),_0x43f6b6);queues[_0x96bb('0x2a')](_0x43f6b6);}catch(_0xbf1acb){utils['error'](util['format'](_0x96bb('0x2b'),_0x43f6b6[_0x96bb('0x1f')]),_0xbf1acb);}});ami['on'](_0x96bb('0x2c'),function(_0x31eba6){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x2d'),_0x31eba6[_0x96bb('0x1f')]),_0x31eba6);queues[_0x96bb('0x2c')](_0x31eba6);calls[_0x96bb('0x2c')](_0x31eba6);}catch(_0x599405){utils['error'](util['format'](_0x96bb('0x2d'),_0x31eba6[_0x96bb('0x1f')]),_0x599405);}});ami['on'](_0x96bb('0x2e'),function(_0x1457a7){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x2f'),_0x1457a7[_0x96bb('0x1f')]),_0x1457a7);queues[_0x96bb('0x2e')](_0x1457a7);calls[_0x96bb('0x2e')](_0x1457a7);}catch(_0x4234c2){utils[_0x96bb('0x15')](util['format'](_0x96bb('0x2f'),_0x1457a7[_0x96bb('0x1f')]),_0x4234c2);}});ami['on']('newstate',function(_0xed9a57){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x30'),_0xed9a57['uniqueid']),_0xed9a57);calls[_0x96bb('0x31')](_0xed9a57);recordings['newstate'](_0xed9a57);}catch(_0x3638a8){utils[_0x96bb('0x15')](util['format'](_0x96bb('0x30'),_0xed9a57[_0x96bb('0x1f')]),_0x3638a8);}});ami['on'](_0x96bb('0x32'),function(_0x2128fd){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x33'),_0x2128fd[_0x96bb('0x1f')]),_0x2128fd);calls[_0x96bb('0x32')](_0x2128fd);recordings[_0x96bb('0x32')](_0x2128fd);dials['hangup'](_0x2128fd);agents[_0x96bb('0x32')](_0x2128fd);queues[_0x96bb('0x32')](_0x2128fd);}catch(_0x4481ba){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x33'),_0x2128fd[_0x96bb('0x1f')]),_0x4481ba);}});ami['on'](_0x96bb('0x34'),function(_0x1f42fb){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x35'),_0x1f42fb['uniqueid']),_0x1f42fb);members[_0x96bb('0x34')](_0x1f42fb);}catch(_0x44c84f){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x35'),_0x1f42fb[_0x96bb('0x1f')]),_0x44c84f);}});ami['on']('blindtransfer',function(_0x327678){try{utils[_0x96bb('0x18')](util['format']('[%s][index][blindtransfer]',_0x327678[_0x96bb('0x1f')]),_0x327678);queues[_0x96bb('0x36')](_0x327678);agents['blindtransfer'](_0x327678);transfers['blindtransfer'](_0x327678);recordings[_0x96bb('0x36')](_0x327678);}catch(_0x5bbb60){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x37'),_0x327678[_0x96bb('0x1f')]),_0x5bbb60);}});ami['on']('attendedtransfer',function(_0x3371da){try{utils[_0x96bb('0x18')](util['format'](_0x96bb('0x38'),_0x3371da[_0x96bb('0x39')]),_0x3371da);queues[_0x96bb('0x3a')](_0x3371da);transfers[_0x96bb('0x3a')](_0x3371da);agents['attendedtransfer'](_0x3371da);calls[_0x96bb('0x3a')](_0x3371da);}catch(_0x10e894){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x38'),_0x3371da[_0x96bb('0x39')]),_0x10e894);}});ami['on'](_0x96bb('0x3b'),function(_0x2cd953){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x3c'),_0x2cd953[_0x96bb('0x1f')]),_0x2cd953);queues[_0x96bb('0x3b')](_0x2cd953);recordings[_0x96bb('0x3b')](_0x2cd953);calls[_0x96bb('0x3b')](_0x2cd953);dials[_0x96bb('0x3b')](_0x2cd953);}catch(_0x350a40){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x3c'),_0x2cd953[_0x96bb('0x1f')]),_0x350a40);}});ami['on'](_0x96bb('0x3d'),function(_0x16f7ba){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x3e'),_0x16f7ba['uniqueid']),_0x16f7ba);calls[_0x96bb('0x3d')](_0x16f7ba);recordings[_0x96bb('0x3d')](_0x16f7ba);dials['newexten'](_0x16f7ba);}catch(_0x4f3dbc){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x3e'),_0x16f7ba[_0x96bb('0x1f')]),_0x4f3dbc);}});ami['on'](_0x96bb('0x3f'),function(_0x5ae00c){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')]('[%s][index][newchannel]',_0x5ae00c[_0x96bb('0x1f')]),_0x5ae00c);calls[_0x96bb('0x3f')](_0x5ae00c);recordings[_0x96bb('0x3f')](_0x5ae00c);}catch(_0x263fdd){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x40'),_0x5ae00c['uniqueid']),_0x263fdd);}});ami['on'](_0x96bb('0x41'),function(_0x98e088){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x42'),_0x98e088[_0x96bb('0x1f')]),_0x98e088);dials['dialbegin'](_0x98e088);}catch(_0x426130){utils['error'](util[_0x96bb('0x1c')](_0x96bb('0x43'),_0x98e088[_0x96bb('0x1f')]),_0x426130);}});ami['on']('dialend',function(_0x38dcfa){try{utils[_0x96bb('0x18')](util[_0x96bb('0x1c')](_0x96bb('0x44'),_0x38dcfa[_0x96bb('0x1f')]),_0x38dcfa);dials[_0x96bb('0x45')](_0x38dcfa);}catch(_0x3ecf8e){utils[_0x96bb('0x15')](util[_0x96bb('0x1c')](_0x96bb('0x44'),_0x38dcfa[_0x96bb('0x1f')]),_0x3ecf8e);}});}
\ No newline at end of file
+var _0xc3f3=['blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','username','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./queues.controller','./recordings.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]'];(function(_0x4622ef,_0x5590bb){var _0xab19c9=function(_0x3f6216){while(--_0x3f6216){_0x4622ef['push'](_0x4622ef['shift']());}};_0xab19c9(++_0x5590bb);}(_0xc3f3,0x124));var _0x3c3f=function(_0x534485,_0x154021){_0x534485=_0x534485-0x0;var _0x4b63af=_0xc3f3[_0x534485];return _0x4b63af;};var AsteriskManager=require('asterisk-manager');var config=require(_0x3c3f('0x0'));var utils=require(_0x3c3f('0x1'));var util=require(_0x3c3f('0x2'));var isXDREnabled=config[_0x3c3f('0x3')]&&config[_0x3c3f('0x3')]['disabled']?!config[_0x3c3f('0x3')][_0x3c3f('0x4')]:!![];var isProduction=config[_0x3c3f('0x5')]===_0x3c3f('0x6')||![];var isLocalAsterisk=config[_0x3c3f('0x3')]&&config[_0x3c3f('0x3')][_0x3c3f('0x7')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x3c3f('0x8')],config['asterisk']['ip'],config[_0x3c3f('0x9')][_0x3c3f('0xa')],config[_0x3c3f('0x9')]['password'],!![]);ami[_0x3c3f('0xb')]();if(!isXDREnabled){utils[_0x3c3f('0xc')](_0x3c3f('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x3c3f('0xc')](_0x3c3f('0xe'));}else{var agents=require(_0x3c3f('0xf'));var calls=require('./calls.controller');var queues=require(_0x3c3f('0x10'));var recordings=require(_0x3c3f('0x11'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0x3c3f('0x12'));ami['on'](_0x3c3f('0x13'),core['connect']);ami['on'](_0x3c3f('0x14'),core['shutdown']);ami['on'](_0x3c3f('0x15'),core[_0x3c3f('0x15')]);ami['on']('error',core[_0x3c3f('0x16')]);ami['on'](_0x3c3f('0x17'),core['close']);ami['on'](_0x3c3f('0x18'),core['managerevent']);ami['on'](_0x3c3f('0x19'),function(_0x50943c){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x1b'),_0x50943c['device']),_0x50943c);members[_0x3c3f('0x19')](_0x50943c);}catch(_0x2f57e1){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x1b'),_0x50943c['device']),_0x2f57e1);}});ami['on'](_0x3c3f('0x1d'),function(_0x5ade44){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x1e'),_0x5ade44[_0x3c3f('0x1f')]),_0x5ade44);agents[_0x3c3f('0x1d')](_0x5ade44);}catch(_0x41482b){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x1e'),_0x5ade44['uniqueid']),_0x41482b);}});ami['on'](_0x3c3f('0x20'),function(_0x364292){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x21'),_0x364292['uniqueid']),_0x364292);agents[_0x3c3f('0x20')](_0x364292);}catch(_0x58b742){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x21'),_0x364292['uniqueid']),_0x58b742);}});ami['on'](_0x3c3f('0x22'),function(_0xe85aa5){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x23'),_0xe85aa5['uniqueid']),_0xe85aa5);agents[_0x3c3f('0x22')](_0xe85aa5);queues['agentconnect'](_0xe85aa5);}catch(_0x590530){utils['error'](util['format']('[%s][index][agentconnect]',_0xe85aa5[_0x3c3f('0x1f')]),_0x590530);}});ami['on'](_0x3c3f('0x24'),function(_0x37b277){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x25'),_0x37b277[_0x3c3f('0x1f')]),_0x37b277);agents[_0x3c3f('0x24')](_0x37b277);queues['agentcomplete'](_0x37b277);members[_0x3c3f('0x24')](_0x37b277);}catch(_0x2d9f1c){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x25'),_0x37b277['uniqueid']),_0x2d9f1c);}});ami['on'](_0x3c3f('0x26'),function(_0x3a9c6a){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x27'),_0x3a9c6a['uniqueid']),_0x3a9c6a);agents[_0x3c3f('0x26')](_0x3a9c6a);queues[_0x3c3f('0x26')](_0x3a9c6a);}catch(_0x1546f8){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x27'),_0x3a9c6a['uniqueid']),_0x1546f8);}});ami['on'](_0x3c3f('0x28'),function(_0xfc898b){try{utils[_0x3c3f('0x1a')](util['format']('[%s][index][queuecallerjoin]',_0xfc898b[_0x3c3f('0x1f')]),_0xfc898b);queues[_0x3c3f('0x28')](_0xfc898b);recordings[_0x3c3f('0x28')](_0xfc898b);}catch(_0x46c714){utils['error'](util['format'](_0x3c3f('0x29'),_0xfc898b['uniqueid']),_0x46c714);}});ami['on']('queuecallerleave',function(_0x47cf5b){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x2a'),_0x47cf5b[_0x3c3f('0x1f')]),_0x47cf5b);queues['queuecallerleave'](_0x47cf5b);}catch(_0x2296ef){utils['error'](util['format'](_0x3c3f('0x2a'),_0x47cf5b[_0x3c3f('0x1f')]),_0x2296ef);}});ami['on'](_0x3c3f('0x2b'),function(_0x4786ef){try{utils[_0x3c3f('0x1a')](util['format'](_0x3c3f('0x2c'),_0x4786ef['uniqueid']),_0x4786ef);queues[_0x3c3f('0x2b')](_0x4786ef);calls['musiconholdstart'](_0x4786ef);}catch(_0x4f86dc){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x2c'),_0x4786ef[_0x3c3f('0x1f')]),_0x4f86dc);}});ami['on'](_0x3c3f('0x2d'),function(_0x222d7c){try{utils['debug'](util[_0x3c3f('0x1c')](_0x3c3f('0x2e'),_0x222d7c[_0x3c3f('0x1f')]),_0x222d7c);queues[_0x3c3f('0x2d')](_0x222d7c);calls[_0x3c3f('0x2d')](_0x222d7c);}catch(_0xee044){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x2e'),_0x222d7c[_0x3c3f('0x1f')]),_0xee044);}});ami['on']('newstate',function(_0x1a064c){try{utils['debug'](util[_0x3c3f('0x1c')](_0x3c3f('0x2f'),_0x1a064c['uniqueid']),_0x1a064c);calls[_0x3c3f('0x30')](_0x1a064c);recordings[_0x3c3f('0x30')](_0x1a064c);}catch(_0x260430){utils[_0x3c3f('0x16')](util['format']('[%s][index][newstate]',_0x1a064c[_0x3c3f('0x1f')]),_0x260430);}});ami['on'](_0x3c3f('0x31'),function(_0x5087b7){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x32'),_0x5087b7[_0x3c3f('0x1f')]),_0x5087b7);calls['hangup'](_0x5087b7);recordings[_0x3c3f('0x31')](_0x5087b7);dials[_0x3c3f('0x31')](_0x5087b7);agents[_0x3c3f('0x31')](_0x5087b7);queues[_0x3c3f('0x31')](_0x5087b7);}catch(_0x127561){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x32'),_0x5087b7['uniqueid']),_0x127561);}});ami['on'](_0x3c3f('0x33'),function(_0x5257c3){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x34'),_0x5257c3[_0x3c3f('0x1f')]),_0x5257c3);members[_0x3c3f('0x33')](_0x5257c3);}catch(_0x4336f6){utils['error'](util[_0x3c3f('0x1c')](_0x3c3f('0x34'),_0x5257c3['uniqueid']),_0x4336f6);}});ami['on'](_0x3c3f('0x35'),function(_0x166234){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x36'),_0x166234[_0x3c3f('0x1f')]),_0x166234);queues[_0x3c3f('0x35')](_0x166234);agents[_0x3c3f('0x35')](_0x166234);transfers['blindtransfer'](_0x166234);recordings[_0x3c3f('0x35')](_0x166234);}catch(_0x5e473b){utils['error'](util[_0x3c3f('0x1c')]('[%s][index][blindtransfer]',_0x166234[_0x3c3f('0x1f')]),_0x5e473b);}});ami['on'](_0x3c3f('0x37'),function(_0x35dfc8){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x38'),_0x35dfc8['origtransfereruniqueid']),_0x35dfc8);queues['attendedtransfer'](_0x35dfc8);transfers[_0x3c3f('0x37')](_0x35dfc8);agents[_0x3c3f('0x37')](_0x35dfc8);calls['attendedtransfer'](_0x35dfc8);}catch(_0x1869f6){utils['error'](util[_0x3c3f('0x1c')]('[%s][index][attendedtransfer]',_0x35dfc8[_0x3c3f('0x39')]),_0x1869f6);}});ami['on'](_0x3c3f('0x3a'),function(_0x40b804){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')]('[%s][index][varset]',_0x40b804[_0x3c3f('0x1f')]),_0x40b804);queues['varset'](_0x40b804);recordings[_0x3c3f('0x3a')](_0x40b804);calls[_0x3c3f('0x3a')](_0x40b804);dials[_0x3c3f('0x3a')](_0x40b804);}catch(_0x2fc750){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')](_0x3c3f('0x3b'),_0x40b804[_0x3c3f('0x1f')]),_0x2fc750);}});ami['on']('newexten',function(_0x299c03){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x3c'),_0x299c03['uniqueid']),_0x299c03);calls['newexten'](_0x299c03);recordings[_0x3c3f('0x3d')](_0x299c03);dials[_0x3c3f('0x3d')](_0x299c03);}catch(_0x4b23f1){utils['error'](util[_0x3c3f('0x1c')]('[%s][index][newexten]',_0x299c03[_0x3c3f('0x1f')]),_0x4b23f1);}});ami['on'](_0x3c3f('0x3e'),function(_0x3e76b9){try{utils[_0x3c3f('0x1a')](util[_0x3c3f('0x1c')](_0x3c3f('0x3f'),_0x3e76b9[_0x3c3f('0x1f')]),_0x3e76b9);calls['newchannel'](_0x3e76b9);recordings['newchannel'](_0x3e76b9);}catch(_0x3b5152){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x3f'),_0x3e76b9[_0x3c3f('0x1f')]),_0x3b5152);}});ami['on'](_0x3c3f('0x40'),function(_0x44a54b){try{utils['debug'](util['format'](_0x3c3f('0x41'),_0x44a54b['uniqueid']),_0x44a54b);dials[_0x3c3f('0x40')](_0x44a54b);}catch(_0x3cc724){utils[_0x3c3f('0x16')](util['format'](_0x3c3f('0x42'),_0x44a54b[_0x3c3f('0x1f')]),_0x3cc724);}});ami['on'](_0x3c3f('0x43'),function(_0x37a13c){try{utils['debug'](util[_0x3c3f('0x1c')](_0x3c3f('0x44'),_0x37a13c['uniqueid']),_0x37a13c);dials[_0x3c3f('0x43')](_0x37a13c);}catch(_0x28ba7f){utils[_0x3c3f('0x16')](util[_0x3c3f('0x1c')]('[%s][index][dialend]',_0x37a13c[_0x3c3f('0x1f')]),_0x28ba7f);}});}
\ No newline at end of file
index 1df9275..530b397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1689=['debug','device','info','state','INUSE','voice','now','agent','NOT_INUSE','isNil','duration','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','data1','type','./utils','Local/_attended@transfer','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','getUserByInterface','then','internal','request','CreateMemberReport','getUserByName','split','membername','catch','error','format','[%s][members][writeDB]','some','startsWith'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x1689,0x19a));var _0x9168=function(_0x200f29,_0x3af579){_0x200f29=_0x200f29-0x0;var _0x200077=_0x1689[_0x200f29];return _0x200077;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9168('0x0'));var members={};var exclude=[_0x9168('0x1'),_0x9168('0x2')];function writeDB(_0x4b45a4){utils['info'](util['format'](_0x9168('0x3'),_0x4b45a4[_0x9168('0x4')],_0x4b45a4[_0x9168('0x5')],_0x4b45a4[_0x9168('0x6')],_0x4b45a4[_0x9168('0x7')],_0x4b45a4['membername'],_0x4b45a4['type']));if(_0x4b45a4[_0x9168('0x5')]){utils[_0x9168('0x8')](_0x4b45a4['interface'])[_0x9168('0x9')](function(_0xbf9054){if(_0xbf9054){_0x4b45a4['membername']=_0xbf9054['name'];_0x4b45a4['internal']=_0xbf9054[_0x9168('0xa')];utils[_0x9168('0xb')](_0x9168('0xc'),_0x4b45a4);}else{utils[_0x9168('0xd')](_0x4b45a4[_0x9168('0x5')][_0x9168('0xe')]('/')[0x1])[_0x9168('0x9')](function(_0x3cd31f){if(_0x3cd31f){_0x4b45a4[_0x9168('0xf')]=_0x3cd31f['name'];_0x4b45a4[_0x9168('0xa')]=_0x3cd31f[_0x9168('0xa')];utils[_0x9168('0xb')](_0x9168('0xc'),_0x4b45a4);}});}})[_0x9168('0x10')](function(_0x215f1b){utils[_0x9168('0x11')](util[_0x9168('0x12')](_0x9168('0x13'),_0x4b45a4[_0x9168('0x4')]),_0x215f1b);});}delete members[_0x4b45a4[_0x9168('0x5')]];}function startsWith(_0x2bf469,_0x1d15df){return _[_0x9168('0x14')](_0x2bf469,function(_0x5885cd){return _[_0x9168('0x15')](_0x1d15df,_0x5885cd);});}exports['devicestatechange']=function(_0x479fa8){try{utils[_0x9168('0x16')](util['format']('[%s][members][devicestatechange]',members[_0x479fa8['device']]?members[_0x479fa8[_0x9168('0x17')]]['uniqueid']:_0x479fa8[_0x9168('0x17')]),_0x479fa8);utils[_0x9168('0x18')](util[_0x9168('0x12')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x479fa8['device']]?members[_0x479fa8['device']]['uniqueid']:_0x479fa8[_0x9168('0x17')],_0x479fa8['state'],_0x479fa8['device']));switch(_0x479fa8[_0x9168('0x19')]){case _0x9168('0x1a'):case'BUSY':if(!startsWith(exclude,_0x479fa8[_0x9168('0x17')])){members[_0x479fa8[_0x9168('0x17')]]={'channel':_0x9168('0x1b'),'interface':_0x479fa8[_0x9168('0x17')],'type':'TALKING','enterAt':utils[_0x9168('0x1c')](),'role':_0x9168('0x1d')};}break;case _0x9168('0x1e'):if(!_[_0x9168('0x1f')](members[_0x479fa8['device']])){members[_0x479fa8[_0x9168('0x17')]]['exitAt']=utils[_0x9168('0x1c')]();members[_0x479fa8['device']][_0x9168('0x20')]=utils['diffTime'](members[_0x479fa8[_0x9168('0x17')]][_0x9168('0x21')],members[_0x479fa8[_0x9168('0x17')]][_0x9168('0x22')]);if(members[_0x479fa8[_0x9168('0x17')]]['uniqueid']){writeDB(members[_0x479fa8[_0x9168('0x17')]]);}}break;default:break;}}catch(_0x3e09ff){utils['error'](util[_0x9168('0x12')](_0x9168('0x23'),members[_0x479fa8[_0x9168('0x17')]]?members[_0x479fa8['device']][_0x9168('0x4')]:_0x479fa8[_0x9168('0x17')]),_0x3e09ff);}};exports[_0x9168('0x24')]=function(_0x57929d){try{if(!_[_0x9168('0x1f')](members[_0x57929d[_0x9168('0x5')]])){utils['debug'](util['format'](_0x9168('0x25'),_0x57929d['uniqueid']),_0x57929d);utils['info'](util['format'](_0x9168('0x26'),_0x57929d['uniqueid'],_0x57929d[_0x9168('0x5')],_0x57929d['queue']));members[_0x57929d['interface']]=_[_0x9168('0x27')](members[_0x57929d['interface']],{'data4':_0x57929d['queue'],'uniqueid':_0x57929d[_0x9168('0x4')]});}}catch(_0x4aa9cf){utils[_0x9168('0x11')](util[_0x9168('0x12')](_0x9168('0x25'),_0x57929d[_0x9168('0x4')]),_0x4aa9cf);}};exports[_0x9168('0x28')]=function(_0x43c5c6){try{utils[_0x9168('0x16')](util[_0x9168('0x12')]('[%s][members][cdr]',_0x43c5c6['uniqueid']),_0x43c5c6);if(_0x43c5c6['channel']){var _0xcd9213=_0x43c5c6[_0x9168('0x6')][_0x9168('0xe')]('-')[0x0];if(!_[_0x9168('0x1f')](members[_0xcd9213])){members[_0xcd9213]=_[_0x9168('0x27')](members[_0xcd9213],{'data1':members[_0xcd9213]['data1']||_0x43c5c6['type'],'data2':members[_0xcd9213][_0x9168('0x7')]||_0x43c5c6[_0x9168('0x29')],'data3':members[_0xcd9213]['data3']||_0x43c5c6[_0x9168('0x2a')],'uniqueid':members[_0xcd9213][_0x9168('0x4')]||_0x43c5c6['uniqueid']});utils['info'](util[_0x9168('0x12')](_0x9168('0x2b'),_0x43c5c6[_0x9168('0x4')],members[_0xcd9213]['data1'],members[_0xcd9213]['data2'],members[_0xcd9213][_0x9168('0x2c')]));if(members[_0xcd9213][_0x9168('0x21')]){writeDB(members[_0xcd9213]);}}}if(_0x43c5c6['destinationchannel']){var _0x2fbcbe=_0x43c5c6[_0x9168('0x2d')][_0x9168('0xe')]('-')[0x0];if(!_['isNil'](members[_0x2fbcbe])){members[_0x2fbcbe]=_['assign'](members[_0x2fbcbe],{'data1':members[_0x2fbcbe][_0x9168('0x2e')]||_0x43c5c6[_0x9168('0x2f')],'data2':members[_0x2fbcbe]['data2']||_0x43c5c6[_0x9168('0x29')],'data3':members[_0x2fbcbe][_0x9168('0x2c')]||_0x43c5c6[_0x9168('0x2a')],'uniqueid':members[_0x2fbcbe][_0x9168('0x4')]||_0x43c5c6['uniqueid']});utils[_0x9168('0x18')](util[_0x9168('0x12')](_0x9168('0x2b'),_0x43c5c6[_0x9168('0x4')],members[_0x2fbcbe][_0x9168('0x2e')],members[_0x2fbcbe][_0x9168('0x7')],members[_0x2fbcbe][_0x9168('0x2c')]));if(members[_0x2fbcbe][_0x9168('0x21')]){writeDB(members[_0x2fbcbe]);}}}}catch(_0xe4b4c4){utils[_0x9168('0x11')](util[_0x9168('0x12')]('[%s][members][cdr]',_0x43c5c6[_0x9168('0x4')]),_0xe4b4c4);}};
\ No newline at end of file
+var _0xc678=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','getUserByInterface','interface','then','internal','request','CreateMemberReport','getUserByName','split','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','TALKING','now','agent','NOT_INUSE','exitAt','duration','error','agentcomplete','isNil','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','data2','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','destinationchannel','source','./utils','Local/_attended@transfer','Queue:','info','format'];(function(_0x5c3596,_0x18c2bb){var _0x4b1e03=function(_0x1d7d06){while(--_0x1d7d06){_0x5c3596['push'](_0x5c3596['shift']());}};_0x4b1e03(++_0x18c2bb);}(_0xc678,0x1b4));var _0x8c67=function(_0x5dedb5,_0x1e3333){_0x5dedb5=_0x5dedb5-0x0;var _0x760ae3=_0xc678[_0x5dedb5];return _0x760ae3;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x8c67('0x0'));var members={};var exclude=[_0x8c67('0x1'),_0x8c67('0x2')];function writeDB(_0x4e359d){utils[_0x8c67('0x3')](util[_0x8c67('0x4')](_0x8c67('0x5'),_0x4e359d[_0x8c67('0x6')],_0x4e359d['interface'],_0x4e359d[_0x8c67('0x7')],_0x4e359d['data2'],_0x4e359d[_0x8c67('0x8')],_0x4e359d[_0x8c67('0x9')]));if(_0x4e359d['interface']){utils[_0x8c67('0xa')](_0x4e359d[_0x8c67('0xb')])[_0x8c67('0xc')](function(_0x10aa60){if(_0x10aa60){_0x4e359d[_0x8c67('0x8')]=_0x10aa60['name'];_0x4e359d[_0x8c67('0xd')]=_0x10aa60['internal'];utils[_0x8c67('0xe')](_0x8c67('0xf'),_0x4e359d);}else{utils[_0x8c67('0x10')](_0x4e359d['interface'][_0x8c67('0x11')]('/')[0x1])[_0x8c67('0xc')](function(_0x136cd){if(_0x136cd){_0x4e359d[_0x8c67('0x8')]=_0x136cd['name'];_0x4e359d[_0x8c67('0xd')]=_0x136cd['internal'];utils['request']('CreateMemberReport',_0x4e359d);}});}})['catch'](function(_0x284f6c){utils['error'](util[_0x8c67('0x4')]('[%s][members][writeDB]',_0x4e359d[_0x8c67('0x6')]),_0x284f6c);});}delete members[_0x4e359d[_0x8c67('0xb')]];}function startsWith(_0x28fbb0,_0x3b20df){return _['some'](_0x28fbb0,function(_0x3be259){return _[_0x8c67('0x12')](_0x3b20df,_0x3be259);});}exports[_0x8c67('0x13')]=function(_0x1bae2f){try{utils['debug'](util['format'](_0x8c67('0x14'),members[_0x1bae2f[_0x8c67('0x15')]]?members[_0x1bae2f[_0x8c67('0x15')]]['uniqueid']:_0x1bae2f[_0x8c67('0x15')]),_0x1bae2f);utils[_0x8c67('0x3')](util['format'](_0x8c67('0x16'),members[_0x1bae2f['device']]?members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x6')]:_0x1bae2f[_0x8c67('0x15')],_0x1bae2f[_0x8c67('0x17')],_0x1bae2f[_0x8c67('0x15')]));switch(_0x1bae2f['state']){case _0x8c67('0x18'):case _0x8c67('0x19'):if(!startsWith(exclude,_0x1bae2f['device'])){members[_0x1bae2f[_0x8c67('0x15')]]={'channel':'voice','interface':_0x1bae2f[_0x8c67('0x15')],'type':_0x8c67('0x1a'),'enterAt':utils[_0x8c67('0x1b')](),'role':_0x8c67('0x1c')};}break;case _0x8c67('0x1d'):if(!_['isNil'](members[_0x1bae2f[_0x8c67('0x15')]])){members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x1e')]=utils[_0x8c67('0x1b')]();members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x1f')]=utils['diffTime'](members[_0x1bae2f['device']][_0x8c67('0x1e')],members[_0x1bae2f['device']]['enterAt']);if(members[_0x1bae2f[_0x8c67('0x15')]][_0x8c67('0x6')]){writeDB(members[_0x1bae2f[_0x8c67('0x15')]]);}}break;default:break;}}catch(_0x506a77){utils[_0x8c67('0x20')](util[_0x8c67('0x4')](_0x8c67('0x14'),members[_0x1bae2f[_0x8c67('0x15')]]?members[_0x1bae2f['device']][_0x8c67('0x6')]:_0x1bae2f[_0x8c67('0x15')]),_0x506a77);}};exports[_0x8c67('0x21')]=function(_0x4768c4){try{if(!_[_0x8c67('0x22')](members[_0x4768c4[_0x8c67('0xb')]])){utils[_0x8c67('0x23')](util['format'](_0x8c67('0x24'),_0x4768c4[_0x8c67('0x6')]),_0x4768c4);utils[_0x8c67('0x3')](util[_0x8c67('0x4')](_0x8c67('0x25'),_0x4768c4['uniqueid'],_0x4768c4['interface'],_0x4768c4[_0x8c67('0x26')]));members[_0x4768c4[_0x8c67('0xb')]]=_[_0x8c67('0x27')](members[_0x4768c4[_0x8c67('0xb')]],{'data4':_0x4768c4[_0x8c67('0x26')],'uniqueid':_0x4768c4['uniqueid']});}}catch(_0x5c1dcb){utils[_0x8c67('0x20')](util[_0x8c67('0x4')](_0x8c67('0x24'),_0x4768c4['uniqueid']),_0x5c1dcb);}};exports[_0x8c67('0x28')]=function(_0x1f5a0b){try{utils['debug'](util['format'](_0x8c67('0x29'),_0x1f5a0b['uniqueid']),_0x1f5a0b);if(_0x1f5a0b['channel']){var _0x2a855a=_0x1f5a0b[_0x8c67('0x7')][_0x8c67('0x11')]('-')[0x0];if(!_[_0x8c67('0x22')](members[_0x2a855a])){members[_0x2a855a]=_[_0x8c67('0x27')](members[_0x2a855a],{'data1':members[_0x2a855a][_0x8c67('0x2a')]||_0x1f5a0b[_0x8c67('0x9')],'data2':members[_0x2a855a][_0x8c67('0x2b')]||_0x1f5a0b['source'],'data3':members[_0x2a855a]['data3']||_0x1f5a0b[_0x8c67('0x2c')],'uniqueid':members[_0x2a855a]['uniqueid']||_0x1f5a0b[_0x8c67('0x6')]});utils['info'](util[_0x8c67('0x4')](_0x8c67('0x2d'),_0x1f5a0b[_0x8c67('0x6')],members[_0x2a855a][_0x8c67('0x2a')],members[_0x2a855a]['data2'],members[_0x2a855a][_0x8c67('0x2e')]));if(members[_0x2a855a][_0x8c67('0x1e')]){writeDB(members[_0x2a855a]);}}}if(_0x1f5a0b['destinationchannel']){var _0x64ec58=_0x1f5a0b[_0x8c67('0x2f')][_0x8c67('0x11')]('-')[0x0];if(!_['isNil'](members[_0x64ec58])){members[_0x64ec58]=_['assign'](members[_0x64ec58],{'data1':members[_0x64ec58][_0x8c67('0x2a')]||_0x1f5a0b[_0x8c67('0x9')],'data2':members[_0x64ec58]['data2']||_0x1f5a0b[_0x8c67('0x30')],'data3':members[_0x64ec58][_0x8c67('0x2e')]||_0x1f5a0b[_0x8c67('0x2c')],'uniqueid':members[_0x64ec58][_0x8c67('0x6')]||_0x1f5a0b['uniqueid']});utils['info'](util[_0x8c67('0x4')](_0x8c67('0x2d'),_0x1f5a0b['uniqueid'],members[_0x64ec58]['data1'],members[_0x64ec58][_0x8c67('0x2b')],members[_0x64ec58][_0x8c67('0x2e')]));if(members[_0x64ec58][_0x8c67('0x1e')]){writeDB(members[_0x64ec58]);}}}}catch(_0xd6dc2f){utils[_0x8c67('0x20')](util[_0x8c67('0x4')](_0x8c67('0x29'),_0x1f5a0b[_0x8c67('0x6')]),_0xd6dc2f);}};
\ No newline at end of file
index 708923e..d1f15ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ca3=['[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','destaccountcode','[%s][queues][agentcomplete]','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','debug','[%s][queues][varset]','isNil','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','ABANDONED','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','count'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0x8ca3,0x15d));var _0x38ca=function(_0x3130b5,_0x23faf7){_0x3130b5=_0x3130b5-0x0;var _0xa6d8a3=_0x8ca3[_0x3130b5];return _0xa6d8a3;};'use strict';var _=require(_0x38ca('0x0'));var util=require(_0x38ca('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1f661f){utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x4'),_0x1f661f[_0x38ca('0x5')],_0x1f661f[_0x38ca('0x6')],_0x1f661f[_0x38ca('0x7')],_0x1f661f[_0x38ca('0x8')],_0x1f661f[_0x38ca('0x9')],_0x1f661f['accountcode'],_0x1f661f['queuecallerexitreason']));if(_0x1f661f[_0x38ca('0x7')]){utils[_0x38ca('0xa')](_0x1f661f[_0x38ca('0x7')])[_0x38ca('0xb')](function(_0x15547a){if(_0x15547a){_0x1f661f[_0x38ca('0xc')]=_0x15547a[_0x38ca('0xc')];}utils['request'](_0x38ca('0xd'),_0x1f661f);});}else{utils[_0x38ca('0xe')](_0x38ca('0xd'),_0x1f661f);}if(_0x1f661f['transfereduniqueid']){delete queues[_0x1f661f[_0x38ca('0xf')]];}else{delete queues[_0x1f661f[_0x38ca('0x5')]];}}exports[_0x38ca('0x10')]=function(_0x1c3632){try{utils['debug'](util[_0x38ca('0x3')]('[%s][queues][queuecallerjoin]',_0x1c3632[_0x38ca('0x5')]),_0x1c3632);utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x11'),_0x1c3632[_0x38ca('0x5')],_0x1c3632[_0x38ca('0x7')],_0x1c3632[_0x38ca('0x12')]));queues[_0x1c3632[_0x38ca('0x5')]]=_[_0x38ca('0x13')](_0x1c3632,{'originalposition':_0x1c3632[_0x38ca('0x12')],'queuecallerjoinAt':utils[_0x38ca('0x14')](),'mohtime':0x0});}catch(_0x93088b){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x16'),_0x1c3632['uniqueid']),_0x93088b);}};exports[_0x38ca('0x17')]=function(_0x194b5c){try{if(!_['isNil'](queues[_0x194b5c['uniqueid']])){utils['debug'](util[_0x38ca('0x3')](_0x38ca('0x18'),_0x194b5c[_0x38ca('0x5')]),_0x194b5c);if(queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x19')]){if(!queues[_0x194b5c['uniqueid']][_0x38ca('0x1a')]&&!queues[_0x194b5c[_0x38ca('0x5')]]['queuecallerexit']){queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1b')]=!![];queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1c')]=utils[_0x38ca('0x14')]();queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1d')]='COMPLETEDBYAGENT';}utils[_0x38ca('0x2')](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x194b5c[_0x38ca('0x5')],queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1e')],queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0x1d')]));writeDB(queues[_0x194b5c[_0x38ca('0x5')]]);}else if(queues[_0x194b5c['uniqueid']][_0x38ca('0xf')]){utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x1f'),_0x194b5c[_0x38ca('0x5')],queues[_0x194b5c['uniqueid']][_0x38ca('0x1e')],queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0xf')]));queues[queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0xf')]]=queues[_0x194b5c[_0x38ca('0x5')]];queues[queues[_0x194b5c[_0x38ca('0x5')]][_0x38ca('0xf')]][_0x38ca('0x20')]=0x2;delete queues[_0x194b5c[_0x38ca('0x5')]];}}}catch(_0xc181dd){utils['error'](util['format'](_0x38ca('0x18'),_0x194b5c[_0x38ca('0x5')]),_0xc181dd);}};exports[_0x38ca('0x21')]=function(_0x110278){try{utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x23'),_0x110278[_0x38ca('0x5')]),_0x110278);if(!_[_0x38ca('0x24')](_0x110278['variable'][_0x38ca('0x25')])&&_0x110278[_0x38ca('0x26')][_0x38ca('0x27')]()!==_0x38ca('0x28')){if(!_['isNil'](queues[_0x110278[_0x38ca('0x5')]])){queues[_0x110278[_0x38ca('0x5')]]['queuecallerabandon']=![];queues[_0x110278['uniqueid']][_0x38ca('0x29')]=null;queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x2a')]=!![];queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x2b')]=utils[_0x38ca('0x14')]();queues[_0x110278[_0x38ca('0x5')]]['queuecallerexitreason']=_0x110278['value'][_0x38ca('0x27')]();utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x2c'),_0x110278[_0x38ca('0x5')],queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1e')],_0x110278['value'],queues[_0x110278[_0x38ca('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x110278[_0x38ca('0x5')]]);}}else if(!_[_0x38ca('0x24')](_0x110278['variable'][_0x38ca('0x2d')])){if(!_[_0x38ca('0x24')](queues[_0x110278[_0x38ca('0x5')]])&&!queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1a')]){queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1a')]=![];queues[_0x110278[_0x38ca('0x5')]]['queuecallerabandonAt']=null;queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x2a')]=!![];queues[_0x110278[_0x38ca('0x5')]]['queuecallerexitAt']=utils[_0x38ca('0x14')]();queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1d')]=_0x38ca('0x2e');utils[_0x38ca('0x2')](util[_0x38ca('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x110278[_0x38ca('0x5')],queues[_0x110278['uniqueid']][_0x38ca('0x1e')],_0x110278[_0x38ca('0x26')],queues[_0x110278[_0x38ca('0x5')]][_0x38ca('0x1d')]));}}}catch(_0x113a0b){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x23'),_0x110278[_0x38ca('0x5')]),_0x113a0b);}};exports[_0x38ca('0x1a')]=function(_0x2f18b5){try{if(!_[_0x38ca('0x24')](queues[_0x2f18b5[_0x38ca('0x5')]])){utils[_0x38ca('0x22')](util[_0x38ca('0x3')]('[%s][queues][queuecallerabandon]',_0x2f18b5[_0x38ca('0x5')]),_0x2f18b5);queues[_0x2f18b5[_0x38ca('0x5')]]['queuecallerexit']=![];queues[_0x2f18b5['uniqueid']][_0x38ca('0x2b')]=null;queues[_0x2f18b5['uniqueid']][_0x38ca('0x1a')]=!![];queues[_0x2f18b5[_0x38ca('0x5')]]['queuecallerabandonAt']=utils['now']();queues[_0x2f18b5[_0x38ca('0x5')]][_0x38ca('0x1d')]=_0x38ca('0x2f');utils[_0x38ca('0x2')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2f18b5['uniqueid'],queues[_0x2f18b5[_0x38ca('0x5')]][_0x38ca('0x1e')],queues[_0x2f18b5[_0x38ca('0x5')]]['queuecallerexitreason']));}}catch(_0x1e9a9f){utils[_0x38ca('0x15')](util[_0x38ca('0x3')]('[%s][queues][queuecallerabandon]',_0x2f18b5[_0x38ca('0x5')]),_0x1e9a9f);}};exports['queuecallerleave']=function(_0x33b1c0){try{if(!_[_0x38ca('0x24')](queues[_0x33b1c0['uniqueid']])){utils[_0x38ca('0x22')](util['format']('[%s][queues][queuecallerleave]',_0x33b1c0[_0x38ca('0x5')]),_0x33b1c0);utils['info'](util[_0x38ca('0x3')](_0x38ca('0x30'),_0x33b1c0[_0x38ca('0x5')],queues[_0x33b1c0['uniqueid']][_0x38ca('0x1e')],_0x33b1c0[_0x38ca('0x31')],_0x33b1c0[_0x38ca('0x32')]));queues[_0x33b1c0['uniqueid']][_0x38ca('0x33')]=!![];queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x19')]=utils[_0x38ca('0x14')]();queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x34')]=utils[_0x38ca('0x35')](queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x19')],queues[_0x33b1c0[_0x38ca('0x5')]]['queuecallerjoinAt']);queues[_0x33b1c0['uniqueid']][_0x38ca('0x12')]=_0x33b1c0[_0x38ca('0x12')];queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x36')]=_0x33b1c0['count'];queues[_0x33b1c0['uniqueid']][_0x38ca('0x31')]=_0x33b1c0[_0x38ca('0x31')];queues[_0x33b1c0[_0x38ca('0x5')]][_0x38ca('0x32')]=_0x33b1c0['connectedlinename'];}}catch(_0x42b387){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x37'),_0x33b1c0['uniqueid']),_0x42b387);}};exports[_0x38ca('0x38')]=function(_0x2d23fc){try{if(!_[_0x38ca('0x24')](queues[_0x2d23fc[_0x38ca('0x5')]])){utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x39'),_0x2d23fc[_0x38ca('0x5')]),_0x2d23fc);utils[_0x38ca('0x2')](util['format'](_0x38ca('0x3a'),_0x2d23fc[_0x38ca('0x5')],queues[_0x2d23fc[_0x38ca('0x5')]][_0x38ca('0x1e')],_0x2d23fc[_0x38ca('0x3b')],_0x2d23fc['destaccountcode']));queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerabandon']=![];queues[_0x2d23fc['uniqueid']][_0x38ca('0x1a')]=![];queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerabandonAt']=null;queues[_0x2d23fc[_0x38ca('0x5')]][_0x38ca('0x2a')]=![];queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerexitreason']=null;queues[_0x2d23fc[_0x38ca('0x5')]]['queuecallerexitAt']=null;queues[_0x2d23fc[_0x38ca('0x5')]][_0x38ca('0x3c')]=!![];queues[_0x2d23fc['uniqueid']]['accountcode']=_0x2d23fc[_0x38ca('0x3d')];queues[_0x2d23fc[_0x38ca('0x5')]]['lastAssignedTo']=_0x2d23fc['membername'];}}catch(_0x3c9bc5){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x39'),_0x2d23fc['uniqueid']),_0x3c9bc5);}};exports['agentcomplete']=function(_0x43662b){try{if(!_[_0x38ca('0x24')](queues[_0x43662b[_0x38ca('0x5')]])){if(queues[_0x43662b['uniqueid']][_0x38ca('0x19')]){utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x3e'),_0x43662b[_0x38ca('0x5')]),_0x43662b);queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1a')]=![];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1a')]=![];queues[_0x43662b[_0x38ca('0x5')]]['queuecallerabandonAt']=null;queues[_0x43662b['uniqueid']][_0x38ca('0x2a')]=![];queues[_0x43662b['uniqueid']][_0x38ca('0x2b')]=null;queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x3c')]=!![];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x8')]=_0x43662b[_0x38ca('0x3b')];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1b')]=!![];queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1c')]=utils[_0x38ca('0x14')]();if(_0x43662b['reason']==_0x38ca('0x3f')){if(!queues[_0x43662b['uniqueid']]['transfer']){queues[_0x43662b[_0x38ca('0x5')]]['queuecallerexitreason']=_0x38ca('0x40');}}else{queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1d')]=_0x38ca('0x41')+_0x43662b[_0x38ca('0x42')]['toUpperCase']();}utils[_0x38ca('0x2')](util['format'](_0x38ca('0x43'),_0x43662b[_0x38ca('0x5')],queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1e')],_0x43662b[_0x38ca('0x3b')],queues[_0x43662b[_0x38ca('0x5')]][_0x38ca('0x1d')]));writeDB(queues[_0x43662b[_0x38ca('0x5')]]);}}}catch(_0x429eb6){utils[_0x38ca('0x15')](util['format'](_0x38ca('0x3e'),_0x43662b[_0x38ca('0x5')]),_0x429eb6);}};exports[_0x38ca('0x44')]=function(_0x2097df){try{if(!_[_0x38ca('0x24')](queues[_0x2097df[_0x38ca('0x45')]])){utils[_0x38ca('0x22')](util['format']('[%s][queues][blindtransfer]',_0x2097df[_0x38ca('0x5')]),_0x2097df);queues[_0x2097df[_0x38ca('0x45')]]['transfer']=!![];queues[_0x2097df['transfereeuniqueid']][_0x38ca('0x46')]=_0x38ca('0x47');queues[_0x2097df['transfereeuniqueid']][_0x38ca('0x48')]=_0x2097df['extension'];queues[_0x2097df[_0x38ca('0x45')]][_0x38ca('0x49')]=_0x2097df['transfereeuniqueid'];queues[_0x2097df[_0x38ca('0x45')]][_0x38ca('0x1d')]=_0x38ca('0x4a');utils[_0x38ca('0x2')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x2097df['uniqueid'],queues[_0x2097df['transfereeuniqueid']][_0x38ca('0x1e')],_0x2097df['transfereeuniqueid'],_0x2097df[_0x38ca('0x4b')]));}}catch(_0x36b016){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x4c'),_0x2097df['uniqueid']),_0x36b016);}};exports[_0x38ca('0x4d')]=function(_0x57f955){try{utils['debug'](util[_0x38ca('0x3')](_0x38ca('0x4e'),_0x57f955[_0x38ca('0x4f')]),_0x57f955);if(_0x57f955[_0x38ca('0x4f')]==_0x57f955[_0x38ca('0x50')]){if(!_['isNil'](queues[_0x57f955['secondtransfererlinkedid']])){utils[_0x38ca('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x51')]][_0x38ca('0x1e')],_0x57f955['origtransfererexten']));queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0x3f')]=!![];queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0x46')]=_0x38ca('0x52');queues[_0x57f955['secondtransfererlinkedid']]['transferexten']=_0x57f955[_0x38ca('0x53')];queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0x49')]=_0x57f955[_0x38ca('0x4f')];queues[_0x57f955[_0x38ca('0x51')]][_0x38ca('0x1d')]=_0x38ca('0x54');}if(!_[_0x38ca('0x24')](queues[_0x57f955['origtransfererlinkedid']])){if(_0x57f955[_0x38ca('0x55')]&&queues[_0x57f955[_0x38ca('0x55')]]){queues[_0x57f955[_0x38ca('0x55')]][_0x38ca('0x20')]=0x1;queues[_0x57f955[_0x38ca('0x45')]]=_['clone'](queues[_0x57f955[_0x38ca('0x55')]]);queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x56')];queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x20')]=0x2;queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x9')]=queues[_0x57f955[_0x38ca('0x51')]]['calleridnum'];queues[_0x57f955[_0x38ca('0x45')]]['calleridname']=queues[_0x57f955[_0x38ca('0x51')]]['calleridname'];queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x57')]=utils[_0x38ca('0x14')]();queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x19')]=utils[_0x38ca('0x14')]();queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x34')]=0x0;queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x58')]=0x0;utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x59'),_0x57f955['origtransfereruniqueid'],queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x1e')],queues[_0x57f955['transfereeuniqueid']][_0x38ca('0x9')],queues[_0x57f955[_0x38ca('0x45')]][_0x38ca('0x5a')]));}else{utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x5b'),_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x50')]][_0x38ca('0x1e')],_0x57f955[_0x38ca('0x51')]));queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x51')];}}}else if(_0x57f955[_0x38ca('0x5c')]==_0x57f955[_0x38ca('0x51')]){if(!_[_0x38ca('0x24')](queues[_0x57f955[_0x38ca('0x50')]])){utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x5d'),_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x50')]]['name'],_0x57f955[_0x38ca('0x5c')],_0x57f955[_0x38ca('0x5e')]));queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0x3f')]=!![];queues[_0x57f955['origtransfererlinkedid']]['transfertype']=_0x38ca('0x52');queues[_0x57f955[_0x38ca('0x50')]][_0x38ca('0x48')]=_0x57f955[_0x38ca('0x5e')];queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0x49')]=_0x57f955[_0x38ca('0x5c')];queues[_0x57f955[_0x38ca('0x50')]]['queuecallerexitreason']=_0x38ca('0x54');}if(!_[_0x38ca('0x24')](queues[_0x57f955[_0x38ca('0x51')]])){if(_0x57f955[_0x38ca('0x5f')]&&queues[_0x57f955[_0x38ca('0x5f')]]){queues[_0x57f955['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x57f955[_0x38ca('0x56')]]=_[_0x38ca('0x60')](queues[_0x57f955['transfertargetlinkedid']]);queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x56')];queues[_0x57f955[_0x38ca('0x56')]]['queuecallerenterreason']=0x2;queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x9')]=queues[_0x57f955[_0x38ca('0x50')]][_0x38ca('0x9')];queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x5a')]=queues[_0x57f955['origtransfererlinkedid']][_0x38ca('0x5a')];queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x57')]=utils[_0x38ca('0x14')]();queues[_0x57f955['transfertargetuniqueid']][_0x38ca('0x19')]=utils['now']();queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x34')]=0x0;queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x58')]=0x0;utils['info'](util[_0x38ca('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x1e')],queues[_0x57f955['transfertargetuniqueid']][_0x38ca('0xf')],queues[_0x57f955[_0x38ca('0x56')]][_0x38ca('0x9')],queues[_0x57f955['transfertargetuniqueid']][_0x38ca('0x5a')]));}else{utils[_0x38ca('0x2')](util[_0x38ca('0x3')](_0x38ca('0x5b'),_0x57f955[_0x38ca('0x4f')],queues[_0x57f955[_0x38ca('0x51')]]['name'],_0x57f955[_0x38ca('0x50')]));queues[_0x57f955['secondtransfererlinkedid']][_0x38ca('0xf')]=_0x57f955[_0x38ca('0x50')];}}}}catch(_0x50dcb1){utils[_0x38ca('0x15')](util['format'](_0x38ca('0x4e'),_0x57f955[_0x38ca('0x4f')]),_0x50dcb1);}};exports['musiconholdstart']=function(_0x2e4e37){try{if(!_[_0x38ca('0x24')](queues[_0x2e4e37[_0x38ca('0x5')]])){utils['debug'](util['format'](_0x38ca('0x61'),_0x2e4e37[_0x38ca('0x5')]),_0x2e4e37);queues[_0x2e4e37[_0x38ca('0x5')]][_0x38ca('0x62')]=utils[_0x38ca('0x14')]();utils[_0x38ca('0x2')](util[_0x38ca('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x2e4e37[_0x38ca('0x5')],queues[_0x2e4e37[_0x38ca('0x5')]][_0x38ca('0x1e')],queues[_0x2e4e37[_0x38ca('0x5')]][_0x38ca('0x62')]));}}catch(_0x43961f){utils[_0x38ca('0x15')](util['format'](_0x38ca('0x61'),_0x2e4e37[_0x38ca('0x5')]),_0x43961f);}};exports[_0x38ca('0x63')]=function(_0x454573){try{if(!_[_0x38ca('0x24')](queues[_0x454573[_0x38ca('0x5')]])){if(!_[_0x38ca('0x24')](queues[_0x454573[_0x38ca('0x5')]]['musiconholdstartAt'])){utils[_0x38ca('0x22')](util[_0x38ca('0x3')](_0x38ca('0x64'),_0x454573[_0x38ca('0x5')]),_0x454573);queues[_0x454573[_0x38ca('0x5')]][_0x38ca('0x58')]+=utils[_0x38ca('0x35')](utils[_0x38ca('0x14')](),queues[_0x454573['uniqueid']]['musiconholdstartAt']);utils[_0x38ca('0x2')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x454573[_0x38ca('0x5')],queues[_0x454573[_0x38ca('0x5')]]['name'],queues[_0x454573[_0x38ca('0x5')]][_0x38ca('0x58')]));delete queues[_0x454573[_0x38ca('0x5')]][_0x38ca('0x62')];}}}catch(_0x121d01){utils[_0x38ca('0x15')](util[_0x38ca('0x3')](_0x38ca('0x64'),_0x454573[_0x38ca('0x5')]),_0x121d01);}};
\ No newline at end of file
+var _0xf1df=['[%s][queues][agentcomplete]','queuecallercompleteAt','reason','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfer','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferexten','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridnum','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','uniqueid','channel','lastAssignedTo','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','format','[%s][queues][queuecallerjoin]','hangup','isNil','queuecallerleaveAt','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','info','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','queuestatus','value','toUpperCase','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','assigned','membername','agentcomplete'];(function(_0x48ce47,_0xf0cac1){var _0x1a85bc=function(_0x2154af){while(--_0x2154af){_0x48ce47['push'](_0x48ce47['shift']());}};_0x1a85bc(++_0xf0cac1);}(_0xf1df,0x8e));var _0xff1d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf1df[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0xff1d('0x0'));var utils=require(_0xff1d('0x1'));var queues={};function writeDB(_0x384da4){utils['info'](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x384da4[_0xff1d('0x2')],_0x384da4[_0xff1d('0x3')],_0x384da4['queue'],_0x384da4[_0xff1d('0x4')],_0x384da4['calleridnum'],_0x384da4[_0xff1d('0x5')],_0x384da4[_0xff1d('0x6')]));if(_0x384da4[_0xff1d('0x7')]){utils[_0xff1d('0x8')](_0x384da4[_0xff1d('0x7')])[_0xff1d('0x9')](function(_0xe5869b){if(_0xe5869b){_0x384da4[_0xff1d('0xa')]=_0xe5869b['type'];}utils[_0xff1d('0xb')](_0xff1d('0xc'),_0x384da4);});}else{utils[_0xff1d('0xb')](_0xff1d('0xc'),_0x384da4);}if(_0x384da4[_0xff1d('0xd')]){delete queues[_0x384da4[_0xff1d('0xd')]];}else{delete queues[_0x384da4['uniqueid']];}}exports['queuecallerjoin']=function(_0xbeec6d){try{utils[_0xff1d('0xe')](util['format']('[%s][queues][queuecallerjoin]',_0xbeec6d[_0xff1d('0x2')]),_0xbeec6d);utils['info'](util['format'](_0xff1d('0xf'),_0xbeec6d[_0xff1d('0x2')],_0xbeec6d[_0xff1d('0x7')],_0xbeec6d['position']));queues[_0xbeec6d['uniqueid']]=_[_0xff1d('0x10')](_0xbeec6d,{'originalposition':_0xbeec6d[_0xff1d('0x11')],'queuecallerjoinAt':utils[_0xff1d('0x12')](),'mohtime':0x0});}catch(_0x4e3bc3){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x15'),_0xbeec6d[_0xff1d('0x2')]),_0x4e3bc3);}};exports[_0xff1d('0x16')]=function(_0x38cf12){try{if(!_[_0xff1d('0x17')](queues[_0x38cf12[_0xff1d('0x2')]])){utils['debug'](util[_0xff1d('0x14')]('[%s][queues][hangup]',_0x38cf12[_0xff1d('0x2')]),_0x38cf12);if(queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x18')]){if(!queues[_0x38cf12[_0xff1d('0x2')]]['queuecallerabandon']&&!queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x19')]){queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x1a')]=!![];queues[_0x38cf12[_0xff1d('0x2')]]['queuecallercompleteAt']=utils[_0xff1d('0x12')]();queues[_0x38cf12['uniqueid']][_0xff1d('0x6')]=_0xff1d('0x1b');}utils[_0xff1d('0x1c')](util[_0xff1d('0x14')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x38cf12['uniqueid'],queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x1d')],queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0x6')]));writeDB(queues[_0x38cf12[_0xff1d('0x2')]]);}else if(queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0xd')]){utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x1e'),_0x38cf12['uniqueid'],queues[_0x38cf12['uniqueid']][_0xff1d('0x1d')],queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0xd')]));queues[queues[_0x38cf12[_0xff1d('0x2')]][_0xff1d('0xd')]]=queues[_0x38cf12['uniqueid']];queues[queues[_0x38cf12[_0xff1d('0x2')]]['transfereduniqueid']][_0xff1d('0x1f')]=0x2;delete queues[_0x38cf12[_0xff1d('0x2')]];}}}catch(_0x14da69){utils['error'](util[_0xff1d('0x14')](_0xff1d('0x20'),_0x38cf12[_0xff1d('0x2')]),_0x14da69);}};exports['varset']=function(_0x4e3685){try{utils[_0xff1d('0xe')](util[_0xff1d('0x14')](_0xff1d('0x21'),_0x4e3685[_0xff1d('0x2')]),_0x4e3685);if(!_[_0xff1d('0x17')](_0x4e3685['variable'][_0xff1d('0x22')])&&_0x4e3685[_0xff1d('0x23')][_0xff1d('0x24')]()!=='CONTINUE'){if(!_[_0xff1d('0x17')](queues[_0x4e3685[_0xff1d('0x2')]])){queues[_0x4e3685['uniqueid']]['queuecallerabandon']=![];queues[_0x4e3685['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x19')]=!![];queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x25')]=utils[_0xff1d('0x12')]();queues[_0x4e3685[_0xff1d('0x2')]]['queuecallerexitreason']=_0x4e3685['value']['toUpperCase']();utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x26'),_0x4e3685['uniqueid'],queues[_0x4e3685[_0xff1d('0x2')]]['name'],_0x4e3685[_0xff1d('0x23')],queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x6')]));writeDB(queues[_0x4e3685[_0xff1d('0x2')]]);}}else if(!_[_0xff1d('0x17')](_0x4e3685['variable'][_0xff1d('0x27')])){if(!_[_0xff1d('0x17')](queues[_0x4e3685[_0xff1d('0x2')]])&&!queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x28')]){queues[_0x4e3685[_0xff1d('0x2')]]['queuecallerabandon']=![];queues[_0x4e3685['uniqueid']][_0xff1d('0x29')]=null;queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x19')]=!![];queues[_0x4e3685[_0xff1d('0x2')]]['queuecallerexitAt']=utils[_0xff1d('0x12')]();queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x6')]=_0xff1d('0x2a');utils[_0xff1d('0x1c')](util['format'](_0xff1d('0x2b'),_0x4e3685[_0xff1d('0x2')],queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x1d')],_0x4e3685['value'],queues[_0x4e3685[_0xff1d('0x2')]][_0xff1d('0x6')]));}}}catch(_0x1334ae){utils[_0xff1d('0x13')](util[_0xff1d('0x14')]('[%s][queues][varset]',_0x4e3685[_0xff1d('0x2')]),_0x1334ae);}};exports['queuecallerabandon']=function(_0x3ccb67){try{if(!_[_0xff1d('0x17')](queues[_0x3ccb67[_0xff1d('0x2')]])){utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x2c'),_0x3ccb67[_0xff1d('0x2')]),_0x3ccb67);queues[_0x3ccb67[_0xff1d('0x2')]]['queuecallerexit']=![];queues[_0x3ccb67['uniqueid']][_0xff1d('0x25')]=null;queues[_0x3ccb67['uniqueid']]['queuecallerabandon']=!![];queues[_0x3ccb67['uniqueid']][_0xff1d('0x29')]=utils[_0xff1d('0x12')]();queues[_0x3ccb67['uniqueid']][_0xff1d('0x6')]=_0xff1d('0x2d');utils[_0xff1d('0x1c')](util[_0xff1d('0x14')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x3ccb67['uniqueid'],queues[_0x3ccb67[_0xff1d('0x2')]]['name'],queues[_0x3ccb67['uniqueid']]['queuecallerexitreason']));}}catch(_0x110754){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x2c'),_0x3ccb67['uniqueid']),_0x110754);}};exports[_0xff1d('0x2e')]=function(_0x18bb88){try{if(!_[_0xff1d('0x17')](queues[_0x18bb88['uniqueid']])){utils[_0xff1d('0xe')](util[_0xff1d('0x14')]('[%s][queues][queuecallerleave]',_0x18bb88[_0xff1d('0x2')]),_0x18bb88);utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x2f'),_0x18bb88[_0xff1d('0x2')],queues[_0x18bb88[_0xff1d('0x2')]]['name'],_0x18bb88['connectedlinenum'],_0x18bb88[_0xff1d('0x30')]));queues[_0x18bb88['uniqueid']][_0xff1d('0x2e')]=!![];queues[_0x18bb88['uniqueid']]['queuecallerleaveAt']=utils[_0xff1d('0x12')]();queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x31')]=utils[_0xff1d('0x32')](queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x18')],queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x33')]);queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x11')]=_0x18bb88['position'];queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x34')]=_0x18bb88['count'];queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x35')]=_0x18bb88[_0xff1d('0x35')];queues[_0x18bb88[_0xff1d('0x2')]][_0xff1d('0x30')]=_0x18bb88['connectedlinename'];}}catch(_0x1fbe41){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x36'),_0x18bb88['uniqueid']),_0x1fbe41);}};exports[_0xff1d('0x37')]=function(_0x593590){try{if(!_['isNil'](queues[_0x593590[_0xff1d('0x2')]])){utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x38'),_0x593590['uniqueid']),_0x593590);utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x39'),_0x593590['uniqueid'],queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x1d')],_0x593590['membername'],_0x593590[_0xff1d('0x3a')]));queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x28')]=![];queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x28')]=![];queues[_0x593590[_0xff1d('0x2')]]['queuecallerabandonAt']=null;queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x19')]=![];queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x6')]=null;queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x25')]=null;queues[_0x593590[_0xff1d('0x2')]][_0xff1d('0x3b')]=!![];queues[_0x593590['uniqueid']]['accountcode']=_0x593590['destaccountcode'];queues[_0x593590['uniqueid']][_0xff1d('0x4')]=_0x593590[_0xff1d('0x3c')];}}catch(_0x395a8f){utils['error'](util[_0xff1d('0x14')](_0xff1d('0x38'),_0x593590[_0xff1d('0x2')]),_0x395a8f);}};exports[_0xff1d('0x3d')]=function(_0x1720e2){try{if(!_[_0xff1d('0x17')](queues[_0x1720e2[_0xff1d('0x2')]])){if(queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x18')]){utils[_0xff1d('0xe')](util[_0xff1d('0x14')](_0xff1d('0x3e'),_0x1720e2[_0xff1d('0x2')]),_0x1720e2);queues[_0x1720e2['uniqueid']]['queuecallerabandon']=![];queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x28')]=![];queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x29')]=null;queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x19')]=![];queues[_0x1720e2[_0xff1d('0x2')]]['queuecallerexitAt']=null;queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x3b')]=!![];queues[_0x1720e2[_0xff1d('0x2')]]['lastAssignedTo']=_0x1720e2['membername'];queues[_0x1720e2['uniqueid']][_0xff1d('0x1a')]=!![];queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x3f')]=utils[_0xff1d('0x12')]();if(_0x1720e2[_0xff1d('0x40')]=='transfer'){if(!queues[_0x1720e2[_0xff1d('0x2')]]['transfer']){queues[_0x1720e2['uniqueid']]['queuecallerexitreason']=_0xff1d('0x41');}}else{queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x6')]='COMPLETEDBY'+_0x1720e2[_0xff1d('0x40')]['toUpperCase']();}utils['info'](util[_0xff1d('0x14')](_0xff1d('0x42'),_0x1720e2[_0xff1d('0x2')],queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x1d')],_0x1720e2[_0xff1d('0x3c')],queues[_0x1720e2[_0xff1d('0x2')]][_0xff1d('0x6')]));writeDB(queues[_0x1720e2[_0xff1d('0x2')]]);}}}catch(_0x2403a5){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x3e'),_0x1720e2[_0xff1d('0x2')]),_0x2403a5);}};exports[_0xff1d('0x43')]=function(_0x213d4e){try{if(!_[_0xff1d('0x17')](queues[_0x213d4e[_0xff1d('0x44')]])){utils[_0xff1d('0xe')](util[_0xff1d('0x14')](_0xff1d('0x45'),_0x213d4e[_0xff1d('0x2')]),_0x213d4e);queues[_0x213d4e['transfereeuniqueid']][_0xff1d('0x46')]=!![];queues[_0x213d4e[_0xff1d('0x44')]]['transfertype']='BLIND';queues[_0x213d4e['transfereeuniqueid']]['transferexten']=_0x213d4e[_0xff1d('0x47')];queues[_0x213d4e[_0xff1d('0x44')]][_0xff1d('0x48')]=_0x213d4e[_0xff1d('0x44')];queues[_0x213d4e[_0xff1d('0x44')]]['queuecallerexitreason']='BLINDTRANSFER';utils['info'](util[_0xff1d('0x14')](_0xff1d('0x49'),_0x213d4e[_0xff1d('0x2')],queues[_0x213d4e['transfereeuniqueid']][_0xff1d('0x1d')],_0x213d4e[_0xff1d('0x44')],_0x213d4e['extension']));}}catch(_0x53186c){utils[_0xff1d('0x13')](util[_0xff1d('0x14')](_0xff1d('0x45'),_0x213d4e['uniqueid']),_0x53186c);}};exports['attendedtransfer']=function(_0xf25582){try{utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x4a'),_0xf25582[_0xff1d('0x4b')]),_0xf25582);if(_0xf25582[_0xff1d('0x4b')]==_0xf25582[_0xff1d('0x4c')]){if(!_[_0xff1d('0x17')](queues[_0xf25582[_0xff1d('0x4d')]])){utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x4e'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x1d')],_0xf25582[_0xff1d('0x4f')]));queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x46')]=!![];queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x50')]=_0xff1d('0x51');queues[_0xf25582['secondtransfererlinkedid']][_0xff1d('0x52')]=_0xf25582[_0xff1d('0x4f')];queues[_0xf25582['secondtransfererlinkedid']][_0xff1d('0x48')]=_0xf25582[_0xff1d('0x4b')];queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x6')]=_0xff1d('0x53');}if(!_[_0xff1d('0x17')](queues[_0xf25582[_0xff1d('0x4c')]])){if(_0xf25582[_0xff1d('0x54')]&&queues[_0xf25582[_0xff1d('0x54')]]){queues[_0xf25582[_0xff1d('0x54')]][_0xff1d('0x1f')]=0x1;queues[_0xf25582[_0xff1d('0x44')]]=_['clone'](queues[_0xf25582[_0xff1d('0x54')]]);queues[_0xf25582['transfereeuniqueid']][_0xff1d('0xd')]=_0xf25582[_0xff1d('0x55')];queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x1f')]=0x2;queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x56')]=queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x56')];queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x57')]=queues[_0xf25582[_0xff1d('0x4d')]][_0xff1d('0x57')];queues[_0xf25582[_0xff1d('0x44')]]['queuecallerjoinAt']=utils[_0xff1d('0x12')]();queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x18')]=utils[_0xff1d('0x12')]();queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x31')]=0x0;queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x58')]=0x0;utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x59'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x44')]][_0xff1d('0x1d')],queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x56')],queues[_0xf25582['transfereeuniqueid']][_0xff1d('0x57')]));}else{utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x5a'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x1d')],_0xf25582['secondtransfererlinkedid']));queues[_0xf25582[_0xff1d('0x4c')]]['transfereduniqueid']=_0xf25582[_0xff1d('0x4d')];}}}else if(_0xf25582[_0xff1d('0x5b')]==_0xf25582[_0xff1d('0x4d')]){if(!_[_0xff1d('0x17')](queues[_0xf25582[_0xff1d('0x4c')]])){utils['info'](util['format'](_0xff1d('0x5c'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x1d')],_0xf25582[_0xff1d('0x5b')],_0xf25582[_0xff1d('0x5d')]));queues[_0xf25582[_0xff1d('0x4c')]]['transfer']=!![];queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x50')]=_0xff1d('0x51');queues[_0xf25582['origtransfererlinkedid']][_0xff1d('0x52')]=_0xf25582[_0xff1d('0x5d')];queues[_0xf25582['origtransfererlinkedid']][_0xff1d('0x48')]=_0xf25582[_0xff1d('0x5b')];queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x6')]=_0xff1d('0x53');}if(!_[_0xff1d('0x17')](queues[_0xf25582['secondtransfererlinkedid']])){if(_0xf25582[_0xff1d('0x5e')]&&queues[_0xf25582[_0xff1d('0x5e')]]){queues[_0xf25582['transfertargetlinkedid']][_0xff1d('0x1f')]=0x1;queues[_0xf25582[_0xff1d('0x55')]]=_[_0xff1d('0x5f')](queues[_0xf25582[_0xff1d('0x5e')]]);queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0xd')]=_0xf25582[_0xff1d('0x55')];queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x1f')]=0x2;queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x56')]=queues[_0xf25582[_0xff1d('0x4c')]]['calleridnum'];queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x57')]=queues[_0xf25582[_0xff1d('0x4c')]][_0xff1d('0x57')];queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0x33')]=utils[_0xff1d('0x12')]();queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x18')]=utils[_0xff1d('0x12')]();queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x31')]=0x0;queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0x58')]=0x0;utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x60'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x1d')],queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0xd')],queues[_0xf25582[_0xff1d('0x55')]][_0xff1d('0x56')],queues[_0xf25582['transfertargetuniqueid']][_0xff1d('0x57')]));}else{utils[_0xff1d('0x1c')](util['format'](_0xff1d('0x5a'),_0xf25582[_0xff1d('0x4b')],queues[_0xf25582[_0xff1d('0x4d')]]['name'],_0xf25582[_0xff1d('0x4c')]));queues[_0xf25582['secondtransfererlinkedid']][_0xff1d('0xd')]=_0xf25582[_0xff1d('0x4c')];}}}}catch(_0x4d8de4){utils[_0xff1d('0x13')](util['format']('[%s][queues][attendedtransfer]',_0xf25582[_0xff1d('0x4b')]),_0x4d8de4);}};exports['musiconholdstart']=function(_0x38b164){try{if(!_['isNil'](queues[_0x38b164[_0xff1d('0x2')]])){utils[_0xff1d('0xe')](util['format'](_0xff1d('0x61'),_0x38b164[_0xff1d('0x2')]),_0x38b164);queues[_0x38b164[_0xff1d('0x2')]][_0xff1d('0x62')]=utils[_0xff1d('0x12')]();utils['info'](util[_0xff1d('0x14')](_0xff1d('0x63'),_0x38b164[_0xff1d('0x2')],queues[_0x38b164[_0xff1d('0x2')]]['name'],queues[_0x38b164['uniqueid']]['musiconholdstartAt']));}}catch(_0x1d2eaa){utils['error'](util['format'](_0xff1d('0x61'),_0x38b164['uniqueid']),_0x1d2eaa);}};exports['musiconholdstop']=function(_0x46eba2){try{if(!_[_0xff1d('0x17')](queues[_0x46eba2[_0xff1d('0x2')]])){if(!_[_0xff1d('0x17')](queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x62')])){utils['debug'](util[_0xff1d('0x14')](_0xff1d('0x64'),_0x46eba2[_0xff1d('0x2')]),_0x46eba2);queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x58')]+=utils['diffTime'](utils[_0xff1d('0x12')](),queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x62')]);utils[_0xff1d('0x1c')](util[_0xff1d('0x14')](_0xff1d('0x65'),_0x46eba2[_0xff1d('0x2')],queues[_0x46eba2[_0xff1d('0x2')]][_0xff1d('0x1d')],queues[_0x46eba2['uniqueid']][_0xff1d('0x58')]));delete queues[_0x46eba2['uniqueid']][_0xff1d('0x62')];}}}catch(_0x4aa506){utils[_0xff1d('0x13')](util[_0xff1d('0x14')]('[%s][queues][musiconholdstop]',_0x46eba2['uniqueid']),_0x4aa506);}};
\ No newline at end of file
index 1c29016..82ef576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5b9=['request','newchannel','debug','[%s][recordings][newchannel]','linkedid','context','exten','accountcode','channel','error','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','[%s][recordings][newstate]','varset','variable','mixmonitor_filename','value','endsWith','.wav49','replace','.WAV','monitors','push','[%s][recordings][varset]','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','application','toLowerCase','appdata','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording'];(function(_0x308c6a,_0xe04d64){var _0x257b4d=function(_0x31125c){while(--_0x31125c){_0x308c6a['push'](_0x308c6a['shift']());}};_0x257b4d(++_0xe04d64);}(_0xf5b9,0x7d));var _0x9f5b=function(_0x2e10b7,_0x51a536){_0x2e10b7=_0x2e10b7-0x0;var _0x381d16=_0xf5b9[_0x2e10b7];return _0x381d16;};'use strict';var _=require(_0x9f5b('0x0'));var util=require(_0x9f5b('0x1'));var utils=require('./utils');var transfers=require(_0x9f5b('0x2'));var recordings={};function writeDB(_0x50ea0a){var _0x5e9d51;utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')](_0x9f5b('0x5'),_0x50ea0a['uniqueid']));if(transfers[_0x9f5b('0x6')][_0x50ea0a[_0x9f5b('0x7')]]){_0x5e9d51=_0x50ea0a[_0x9f5b('0x7')];_0x50ea0a[_0x9f5b('0x7')]=transfers[_0x9f5b('0x6')][_0x50ea0a[_0x9f5b('0x7')]][_0x9f5b('0x8')];}if(_0x50ea0a['accountcode']){utils[_0x9f5b('0x9')](_0x50ea0a['accountcode'])[_0x9f5b('0xa')](function(_0x1d771a){if(_0x1d771a){_0x50ea0a[_0x9f5b('0xb')]=_0x1d771a[_0x9f5b('0xc')];_0x50ea0a[_0x9f5b('0xd')]=_0x1d771a['id'];}utils['request'](_0x9f5b('0xe'),_0x50ea0a);});}else{utils[_0x9f5b('0xf')](_0x9f5b('0xe'),_0x50ea0a);}if(_0x5e9d51)delete transfers[_0x9f5b('0x6')][_0x5e9d51];}exports[_0x9f5b('0x10')]=function(_0x3c5b08){try{utils[_0x9f5b('0x11')](util[_0x9f5b('0x4')](_0x9f5b('0x12'),_0x3c5b08[_0x9f5b('0x7')]),_0x3c5b08);if(_0x3c5b08[_0x9f5b('0x7')]==_0x3c5b08[_0x9f5b('0x13')]){utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x3c5b08['uniqueid'],_0x3c5b08[_0x9f5b('0x14')],_0x3c5b08[_0x9f5b('0x15')]));recordings[_0x3c5b08[_0x9f5b('0x7')]]={'uniqueid':_0x3c5b08[_0x9f5b('0x7')],'accountcode':_0x3c5b08[_0x9f5b('0x16')],'exten':_0x3c5b08['exten'],'context':_0x3c5b08['context'],'channel':_0x3c5b08[_0x9f5b('0x17')],'monitors':[]};}}catch(_0x9fec98){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')]('[%s][recordings][newchannel]',_0x3c5b08['uniqueid']),_0x9fec98);}};exports['newstate']=function(_0x6adbad){try{utils['debug'](util[_0x9f5b('0x4')]('[%s][recordings][newstate]',_0x6adbad[_0x9f5b('0x7')]),_0x6adbad);if(!_[_0x9f5b('0x19')](recordings[_0x6adbad[_0x9f5b('0x7')]])&&_0x6adbad['channelstate']==0x6){utils['info'](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x6adbad['uniqueid'],_0x6adbad['context'],_0x6adbad[_0x9f5b('0x17')]));}else if(!_['isNil'](recordings[_0x6adbad[_0x9f5b('0x13')]])&&_0x6adbad[_0x9f5b('0x1a')]==0x6&&_0x6adbad[_0x9f5b('0x14')]!=_0x9f5b('0x1b')){utils['info'](util['format'](_0x9f5b('0x1c'),_0x6adbad[_0x9f5b('0x7')],_0x6adbad['linkedid'],_0x6adbad[_0x9f5b('0x14')],_0x6adbad[_0x9f5b('0x17')]));recordings[_0x6adbad[_0x9f5b('0x13')]][_0x9f5b('0x16')]=_0x6adbad['accountcode'];}}catch(_0x195e4f){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x1d'),_0x6adbad[_0x9f5b('0x7')]),_0x195e4f);}};exports[_0x9f5b('0x1e')]=function(_0x4d9b23){try{if(!_['isNil'](_0x4d9b23[_0x9f5b('0x1f')])&&!_[_0x9f5b('0x19')](_0x4d9b23[_0x9f5b('0x1f')][_0x9f5b('0x20')])){utils['debug'](util['format']('[%s][recordings][varset]',_0x4d9b23[_0x9f5b('0x7')]),_0x4d9b23);utils['info'](util[_0x9f5b('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x4d9b23[_0x9f5b('0x7')],_0x4d9b23['variable'],_0x4d9b23[_0x9f5b('0x21')]));if(_[_0x9f5b('0x22')](_0x4d9b23[_0x9f5b('0x21')],_0x9f5b('0x23'))){_0x4d9b23[_0x9f5b('0x21')]=_0x4d9b23[_0x9f5b('0x21')][_0x9f5b('0x24')](_0x9f5b('0x23'),_0x9f5b('0x25'));}if(recordings[_0x4d9b23[_0x9f5b('0x13')]]){var _0x1f672d=_['find'](recordings[_0x4d9b23[_0x9f5b('0x13')]][_0x9f5b('0x26')],{'value':_0x4d9b23[_0x9f5b('0x21')]});if(_[_0x9f5b('0x19')](_0x1f672d)){recordings[_0x4d9b23[_0x9f5b('0x13')]][_0x9f5b('0x26')][_0x9f5b('0x27')]({'value':_0x4d9b23[_0x9f5b('0x21')]});}}}}catch(_0x302fab){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x28'),_0x4d9b23[_0x9f5b('0x7')]),_0x302fab);}};exports[_0x9f5b('0x29')]=function(_0x133fa2){try{if(!_[_0x9f5b('0x19')](recordings[_0x133fa2['uniqueid']])){utils[_0x9f5b('0x11')](util[_0x9f5b('0x4')](_0x9f5b('0x2a'),_0x133fa2[_0x9f5b('0x7')]),_0x133fa2);utils[_0x9f5b('0x3')](util['format'](_0x9f5b('0x2b'),_0x133fa2[_0x9f5b('0x7')],_0x133fa2[_0x9f5b('0x2c')],_0x133fa2[_0x9f5b('0x2d')],_0x133fa2[_0x9f5b('0x2e')]));recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x2c')]=_0x133fa2[_0x9f5b('0x2c')];recordings[_0x133fa2[_0x9f5b('0x7')]]['calleridname']=_0x133fa2['calleridname'];recordings[_0x133fa2[_0x9f5b('0x7')]]['connectedlinenum']=_0x133fa2[_0x9f5b('0x2f')];recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x30')]=_0x133fa2[_0x9f5b('0x30')];if(recordings[_0x133fa2[_0x9f5b('0x7')]]['type']==_0x9f5b('0x31')&&recordings[_0x133fa2[_0x9f5b('0x7')]]['accountcode']){recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x2f')]=recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x16')];recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x30')]='';}recordings[_0x133fa2[_0x9f5b('0x7')]][_0x9f5b('0x26')][_0x9f5b('0x32')](function(_0x4cc684){var _0x21528a=_[_0x9f5b('0x33')](recordings[_0x133fa2['uniqueid']]);_0x21528a[_0x9f5b('0x21')]=_0x4cc684[_0x9f5b('0x21')];writeDB(_0x21528a);});delete recordings[_0x133fa2[_0x9f5b('0x7')]];}}catch(_0x570d5c){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x2a'),_0x133fa2[_0x9f5b('0x7')]),_0x570d5c);}};exports[_0x9f5b('0x34')]=function(_0x23a130){try{if(!_[_0x9f5b('0x19')](recordings[_0x23a130['uniqueid']])){utils['debug'](util[_0x9f5b('0x4')](_0x9f5b('0x35'),_0x23a130[_0x9f5b('0x7')]),_0x23a130);utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x23a130[_0x9f5b('0x7')],_0x23a130[_0x9f5b('0x36')],_0x23a130['appdata']));if(_0x23a130['application'][_0x9f5b('0x37')]()=='set'&&_['startsWith'](_0x23a130[_0x9f5b('0x38')][_0x9f5b('0x37')](),'cdr')){var _0x493683=_0x23a130['appdata'][_0x9f5b('0x39')]('=');var _0x1b00bf=_0x493683[0x0][_0x9f5b('0x3a')](_0x493683[0x0]['lastIndexOf']('(')+0x1,_0x493683[0x0][_0x9f5b('0x3b')](')'));var _0x5a0a6b=_0x493683[0x1];recordings[_0x23a130['uniqueid']][_0x1b00bf]=_0x5a0a6b;}}}catch(_0x1e097b){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x35'),_0x23a130[_0x9f5b('0x7')]),_0x1e097b);}};exports[_0x9f5b('0x3c')]=function(_0x342b43){try{if(!_[_0x9f5b('0x19')](recordings[_0x342b43[_0x9f5b('0x7')]])){utils[_0x9f5b('0x11')](util['format'](_0x9f5b('0x3d'),_0x342b43[_0x9f5b('0x7')]),_0x342b43);utils[_0x9f5b('0x3')](util[_0x9f5b('0x4')](_0x9f5b('0x3e'),_0x342b43['uniqueid'],_0x342b43['queue']));recordings[_0x342b43[_0x9f5b('0x7')]]['queue']=_0x342b43['queue'];}}catch(_0x2ae27d){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')](_0x9f5b('0x3d'),_0x342b43[_0x9f5b('0x7')]),_0x2ae27d);}};exports[_0x9f5b('0x3f')]=function(_0x6f4f83){try{utils[_0x9f5b('0x11')](util['format']('[%s][recordings][blindtransfer]',_0x6f4f83['uniqueid']),_0x6f4f83);utils['info'](util[_0x9f5b('0x4')](_0x9f5b('0x40'),_0x6f4f83[_0x9f5b('0x7')],_0x6f4f83[_0x9f5b('0x41')],_0x6f4f83[_0x9f5b('0x42')],_0x6f4f83[_0x9f5b('0x43')],_0x6f4f83['transfereecalleridname']));if(recordings[_0x6f4f83['transfereruniqueid']]&&transfers[_0x9f5b('0x6')][_0x6f4f83[_0x9f5b('0x44')]]){transfers[_0x9f5b('0x6')][_0x6f4f83[_0x9f5b('0x44')]][_0x9f5b('0x45')]=!![];}}catch(_0x403e71){utils[_0x9f5b('0x18')](util[_0x9f5b('0x4')]('[%s][recordings][blindtransfer]',_0x6f4f83['uniqueid']),_0x403e71);}};
\ No newline at end of file
+var _0x9fd7=['cdr','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','error','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','context','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','isNil','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith'];(function(_0xf7fe02,_0x8938b6){var _0x4b7f19=function(_0x28e94c){while(--_0x28e94c){_0xf7fe02['push'](_0xf7fe02['shift']());}};_0x4b7f19(++_0x8938b6);}(_0x9fd7,0x1b1));var _0x79fd=function(_0x2793ec,_0x22261b){_0x2793ec=_0x2793ec-0x0;var _0x1ff26b=_0x9fd7[_0x2793ec];return _0x1ff26b;};'use strict';var _=require('lodash');var util=require(_0x79fd('0x0'));var utils=require(_0x79fd('0x1'));var transfers=require(_0x79fd('0x2'));var recordings={};function writeDB(_0x24d495){var _0x327a25;utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x5'),_0x24d495[_0x79fd('0x6')]));if(transfers['blinds'][_0x24d495[_0x79fd('0x6')]]){_0x327a25=_0x24d495[_0x79fd('0x6')];_0x24d495[_0x79fd('0x6')]=transfers[_0x79fd('0x7')][_0x24d495[_0x79fd('0x6')]][_0x79fd('0x8')];}if(_0x24d495[_0x79fd('0x9')]){utils[_0x79fd('0xa')](_0x24d495['accountcode'])[_0x79fd('0xb')](function(_0x3a842d){if(_0x3a842d){_0x24d495['membername']=_0x3a842d['name'];_0x24d495[_0x79fd('0xc')]=_0x3a842d['id'];}utils[_0x79fd('0xd')](_0x79fd('0xe'),_0x24d495);});}else{utils[_0x79fd('0xd')]('CreateVoiceRecording',_0x24d495);}if(_0x327a25)delete transfers[_0x79fd('0x7')][_0x327a25];}exports['newchannel']=function(_0x1e1020){try{utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x10'),_0x1e1020[_0x79fd('0x6')]),_0x1e1020);if(_0x1e1020['uniqueid']==_0x1e1020[_0x79fd('0x11')]){utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x12'),_0x1e1020[_0x79fd('0x6')],_0x1e1020['context'],_0x1e1020['exten']));recordings[_0x1e1020['uniqueid']]={'uniqueid':_0x1e1020[_0x79fd('0x6')],'accountcode':_0x1e1020[_0x79fd('0x9')],'exten':_0x1e1020[_0x79fd('0x13')],'context':_0x1e1020['context'],'channel':_0x1e1020['channel'],'monitors':[]};}}catch(_0x4395c6){utils[_0x79fd('0x14')](util[_0x79fd('0x4')]('[%s][recordings][newchannel]',_0x1e1020[_0x79fd('0x6')]),_0x4395c6);}};exports['newstate']=function(_0x395b48){try{utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x15'),_0x395b48[_0x79fd('0x6')]),_0x395b48);if(!_['isNil'](recordings[_0x395b48[_0x79fd('0x6')]])&&_0x395b48[_0x79fd('0x16')]==0x6){utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x17'),_0x395b48['uniqueid'],_0x395b48[_0x79fd('0x18')],_0x395b48[_0x79fd('0x19')]));}else if(!_['isNil'](recordings[_0x395b48[_0x79fd('0x11')]])&&_0x395b48[_0x79fd('0x16')]==0x6&&_0x395b48[_0x79fd('0x18')]!='transfer'){utils[_0x79fd('0x3')](util['format'](_0x79fd('0x1a'),_0x395b48[_0x79fd('0x6')],_0x395b48[_0x79fd('0x11')],_0x395b48[_0x79fd('0x18')],_0x395b48[_0x79fd('0x19')]));recordings[_0x395b48[_0x79fd('0x11')]]['accountcode']=_0x395b48[_0x79fd('0x9')];}}catch(_0x557fa3){utils[_0x79fd('0x14')](util[_0x79fd('0x4')]('[%s][recordings][newstate]',_0x395b48[_0x79fd('0x6')]),_0x557fa3);}};exports['varset']=function(_0x434ba8){try{if(!_['isNil'](_0x434ba8['variable'])&&!_[_0x79fd('0x1b')](_0x434ba8[_0x79fd('0x1c')][_0x79fd('0x1d')])){utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x1e'),_0x434ba8[_0x79fd('0x6')]),_0x434ba8);utils[_0x79fd('0x3')](util[_0x79fd('0x4')](_0x79fd('0x1f'),_0x434ba8['uniqueid'],_0x434ba8['variable'],_0x434ba8[_0x79fd('0x20')]));if(_[_0x79fd('0x21')](_0x434ba8[_0x79fd('0x20')],_0x79fd('0x22'))){_0x434ba8[_0x79fd('0x20')]=_0x434ba8['value'][_0x79fd('0x23')](_0x79fd('0x22'),_0x79fd('0x24'));}if(recordings[_0x434ba8[_0x79fd('0x11')]]){var _0x54c6b8=_['find'](recordings[_0x434ba8[_0x79fd('0x11')]][_0x79fd('0x25')],{'value':_0x434ba8[_0x79fd('0x20')]});if(_['isNil'](_0x54c6b8)){recordings[_0x434ba8[_0x79fd('0x11')]]['monitors'][_0x79fd('0x26')]({'value':_0x434ba8['value']});}}}}catch(_0x2ba943){utils[_0x79fd('0x14')](util[_0x79fd('0x4')](_0x79fd('0x1e'),_0x434ba8[_0x79fd('0x6')]),_0x2ba943);}};exports[_0x79fd('0x27')]=function(_0x590451){try{if(!_['isNil'](recordings[_0x590451[_0x79fd('0x6')]])){utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x28'),_0x590451[_0x79fd('0x6')]),_0x590451);utils[_0x79fd('0x3')](util[_0x79fd('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x590451[_0x79fd('0x6')],_0x590451[_0x79fd('0x29')],_0x590451[_0x79fd('0x2a')],_0x590451['cause-txt']));recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x29')]=_0x590451['calleridnum'];recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2a')]=_0x590451[_0x79fd('0x2a')];recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2b')]=_0x590451[_0x79fd('0x2b')];recordings[_0x590451[_0x79fd('0x6')]]['connectedlinename']=_0x590451[_0x79fd('0x2c')];if(recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2d')]==_0x79fd('0x2e')&&recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x9')]){recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x2b')]=recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x9')];recordings[_0x590451[_0x79fd('0x6')]]['connectedlinename']='';}recordings[_0x590451[_0x79fd('0x6')]][_0x79fd('0x25')][_0x79fd('0x2f')](function(_0x13b845){var _0xff1d9c=_[_0x79fd('0x30')](recordings[_0x590451['uniqueid']]);_0xff1d9c[_0x79fd('0x20')]=_0x13b845[_0x79fd('0x20')];writeDB(_0xff1d9c);});delete recordings[_0x590451[_0x79fd('0x6')]];}}catch(_0x5d2283){utils[_0x79fd('0x14')](util['format'](_0x79fd('0x28'),_0x590451[_0x79fd('0x6')]),_0x5d2283);}};exports[_0x79fd('0x31')]=function(_0x567098){try{if(!_[_0x79fd('0x1b')](recordings[_0x567098[_0x79fd('0x6')]])){utils['debug'](util[_0x79fd('0x4')](_0x79fd('0x32'),_0x567098['uniqueid']),_0x567098);utils[_0x79fd('0x3')](util['format'](_0x79fd('0x33'),_0x567098[_0x79fd('0x6')],_0x567098[_0x79fd('0x34')],_0x567098[_0x79fd('0x35')]));if(_0x567098['application'][_0x79fd('0x36')]()==_0x79fd('0x37')&&_[_0x79fd('0x38')](_0x567098[_0x79fd('0x35')]['toLowerCase'](),_0x79fd('0x39'))){var _0x2536db=_0x567098[_0x79fd('0x35')][_0x79fd('0x3a')]('=');var _0x1ed67a=_0x2536db[0x0][_0x79fd('0x3b')](_0x2536db[0x0][_0x79fd('0x3c')]('(')+0x1,_0x2536db[0x0][_0x79fd('0x3c')](')'));var _0x354bd3=_0x2536db[0x1];recordings[_0x567098['uniqueid']][_0x1ed67a]=_0x354bd3;}}}catch(_0x457bba){utils['error'](util[_0x79fd('0x4')]('[%s][recordings][newexten]',_0x567098['uniqueid']),_0x457bba);}};exports['queuecallerjoin']=function(_0x53ea80){try{if(!_[_0x79fd('0x1b')](recordings[_0x53ea80['uniqueid']])){utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x3d'),_0x53ea80['uniqueid']),_0x53ea80);utils[_0x79fd('0x3')](util['format'](_0x79fd('0x3e'),_0x53ea80[_0x79fd('0x6')],_0x53ea80['queue']));recordings[_0x53ea80[_0x79fd('0x6')]]['queue']=_0x53ea80[_0x79fd('0x3f')];}}catch(_0x1275fc){utils[_0x79fd('0x14')](util['format'](_0x79fd('0x3d'),_0x53ea80[_0x79fd('0x6')]),_0x1275fc);}};exports['blindtransfer']=function(_0xfae1d9){try{utils[_0x79fd('0xf')](util[_0x79fd('0x4')](_0x79fd('0x40'),_0xfae1d9[_0x79fd('0x6')]),_0xfae1d9);utils[_0x79fd('0x3')](util[_0x79fd('0x4')]('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0xfae1d9[_0x79fd('0x6')],_0xfae1d9[_0x79fd('0x41')],_0xfae1d9['transferercalleridname'],_0xfae1d9[_0x79fd('0x42')],_0xfae1d9[_0x79fd('0x43')]));if(recordings[_0xfae1d9[_0x79fd('0x44')]]&&transfers[_0x79fd('0x7')][_0xfae1d9[_0x79fd('0x44')]]){transfers[_0x79fd('0x7')][_0xfae1d9['transfereruniqueid']][_0x79fd('0x45')]=!![];}}catch(_0x2f68a0){utils['error'](util[_0x79fd('0x4')](_0x79fd('0x40'),_0xfae1d9[_0x79fd('0x6')]),_0x2f68a0);}};
\ No newline at end of file
index dc262b5..f8cdf8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6553=['type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','format','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info'];(function(_0xfeb97e,_0x31427a){var _0x26b720=function(_0x1ec7b8){while(--_0x1ec7b8){_0xfeb97e['push'](_0xfeb97e['shift']());}};_0x26b720(++_0x31427a);}(_0x6553,0x177));var _0x3655=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6553[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x3655('0x0'));var utils=require(_0x3655('0x1'));function writeDB(_0x2c99c4){utils[_0x3655('0x2')](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x2c99c4[_0x3655('0x3')]===_0x3655('0x4')?_0x2c99c4[_0x3655('0x5')]:_0x2c99c4[_0x3655('0x6')],_0x2c99c4['type']));utils['request'](_0x3655('0x7'),_0x2c99c4);}exports[_0x3655('0x8')]={};exports[_0x3655('0x9')]=function(_0x2b35ba){try{utils[_0x3655('0xa')](util['format'](_0x3655('0xb'),_0x2b35ba[_0x3655('0x6')]),_0x2b35ba);utils[_0x3655('0x2')](util[_0x3655('0xc')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x2b35ba['uniqueid'],_0x2b35ba[_0x3655('0xd')],_0x2b35ba['transferercalleridname'],_0x2b35ba[_0x3655('0xe')],_0x2b35ba[_0x3655('0xf')]));_0x2b35ba[_0x3655('0x3')]='blind';exports[_0x3655('0x8')][_0x2b35ba[_0x3655('0x10')]]=_0x2b35ba;writeDB(_0x2b35ba);}catch(_0x289c22){utils[_0x3655('0x11')](util[_0x3655('0xc')](_0x3655('0xb'),_0x2b35ba[_0x3655('0x6')]),_0x289c22);}};exports[_0x3655('0x12')]=function(_0x10efda){try{utils[_0x3655('0xa')](util[_0x3655('0xc')](_0x3655('0x13'),_0x10efda[_0x3655('0x5')]),_0x10efda);utils[_0x3655('0x2')](util[_0x3655('0xc')](_0x3655('0x14'),_0x10efda[_0x3655('0x5')],_0x10efda[_0x3655('0x15')],_0x10efda[_0x3655('0x16')],_0x10efda[_0x3655('0x17')],_0x10efda[_0x3655('0x18')]));_0x10efda=_['assign'](_0x10efda,{'transfererchannel':_0x10efda[_0x3655('0x19')],'transferercalleridnum':_0x10efda[_0x3655('0x15')],'transferercalleridname':_0x10efda[_0x3655('0x16')],'transfererconnectedlinenum':_0x10efda[_0x3655('0x1a')],'transfererconnectedlinename':_0x10efda[_0x3655('0x1b')],'transfereraccountcode':_0x10efda['origtransfereraccountcode'],'transferercontext':_0x10efda[_0x3655('0x1c')],'transfererexten':_0x10efda[_0x3655('0x1d')],'transfererlinkedid':_0x10efda[_0x3655('0x1e')],'context':_0x10efda[_0x3655('0x1f')],'extension':_0x10efda[_0x3655('0x20')],'type':_0x3655('0x4')});if(_[_0x3655('0x21')](_0x10efda[_0x3655('0x22')])){_0x10efda=_['assign'](_0x10efda,{'transfereechannel':_0x10efda[_0x3655('0x23')],'transfereecalleridnum':_0x10efda[_0x3655('0x17')],'transfereecalleridname':_0x10efda[_0x3655('0x18')],'transfereeconnectedlinenum':_0x10efda[_0x3655('0x24')],'transfereeconnectedlinename':_0x10efda[_0x3655('0x25')],'transfereeaccountcode':_0x10efda[_0x3655('0x26')],'transfereecontext':_0x10efda[_0x3655('0x27')],'transfereeexten':_0x10efda[_0x3655('0x28')],'transfereelinkedid':_0x10efda[_0x3655('0x29')]});}writeDB(_0x10efda);}catch(_0x2665cf){utils['error'](util[_0x3655('0xc')](_0x3655('0x13'),_0x10efda[_0x3655('0x5')]),_0x2665cf);}};
\ No newline at end of file
+var _0x7fb2=['transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','blind','transfereruniqueid','error','attendedtransfer','info','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode'];(function(_0x13c09f,_0x700024){var _0x3ef8b2=function(_0x42eac6){while(--_0x42eac6){_0x13c09f['push'](_0x13c09f['shift']());}};_0x3ef8b2(++_0x700024);}(_0x7fb2,0x1a8));var _0x27fb=function(_0x40db83,_0x3e5848){_0x40db83=_0x40db83-0x0;var _0x533552=_0x7fb2[_0x40db83];return _0x533552;};'use strict';var _=require(_0x27fb('0x0'));var util=require('util');var utils=require(_0x27fb('0x1'));function writeDB(_0x274cf8){utils['info'](util[_0x27fb('0x2')](_0x27fb('0x3'),_0x274cf8[_0x27fb('0x4')]===_0x27fb('0x5')?_0x274cf8[_0x27fb('0x6')]:_0x274cf8['uniqueid'],_0x274cf8[_0x27fb('0x4')]));utils['request'](_0x27fb('0x7'),_0x274cf8);}exports[_0x27fb('0x8')]={};exports[_0x27fb('0x9')]=function(_0x3b38cb){try{utils[_0x27fb('0xa')](util['format'](_0x27fb('0xb'),_0x3b38cb[_0x27fb('0xc')]),_0x3b38cb);utils['info'](util[_0x27fb('0x2')](_0x27fb('0xd'),_0x3b38cb['uniqueid'],_0x3b38cb['transferercalleridnum'],_0x3b38cb[_0x27fb('0xe')],_0x3b38cb[_0x27fb('0xf')],_0x3b38cb['transfereecalleridname']));_0x3b38cb[_0x27fb('0x4')]=_0x27fb('0x10');exports[_0x27fb('0x8')][_0x3b38cb[_0x27fb('0x11')]]=_0x3b38cb;writeDB(_0x3b38cb);}catch(_0x5aecc1){utils[_0x27fb('0x12')](util['format'](_0x27fb('0xb'),_0x3b38cb[_0x27fb('0xc')]),_0x5aecc1);}};exports[_0x27fb('0x13')]=function(_0x3ef149){try{utils['debug'](util['format']('[%s][transfers][attendedtransfer]',_0x3ef149[_0x27fb('0x6')]),_0x3ef149);utils[_0x27fb('0x14')](util[_0x27fb('0x2')](_0x27fb('0x15'),_0x3ef149[_0x27fb('0x6')],_0x3ef149[_0x27fb('0x16')],_0x3ef149[_0x27fb('0x17')],_0x3ef149[_0x27fb('0x18')],_0x3ef149['transfertargetcalleridname']));_0x3ef149=_[_0x27fb('0x19')](_0x3ef149,{'transfererchannel':_0x3ef149[_0x27fb('0x1a')],'transferercalleridnum':_0x3ef149['origtransferercalleridnum'],'transferercalleridname':_0x3ef149['origtransferercalleridname'],'transfererconnectedlinenum':_0x3ef149['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3ef149['secondtransfererconnectedlinename'],'transfereraccountcode':_0x3ef149['origtransfereraccountcode'],'transferercontext':_0x3ef149[_0x27fb('0x1b')],'transfererexten':_0x3ef149[_0x27fb('0x1c')],'transfererlinkedid':_0x3ef149['origtransfererlinkedid'],'context':_0x3ef149[_0x27fb('0x1d')],'extension':_0x3ef149[_0x27fb('0x1e')],'type':_0x27fb('0x5')});if(_[_0x27fb('0x1f')](_0x3ef149[_0x27fb('0x20')])){_0x3ef149=_[_0x27fb('0x19')](_0x3ef149,{'transfereechannel':_0x3ef149[_0x27fb('0x21')],'transfereecalleridnum':_0x3ef149[_0x27fb('0x18')],'transfereecalleridname':_0x3ef149[_0x27fb('0x22')],'transfereeconnectedlinenum':_0x3ef149[_0x27fb('0x23')],'transfereeconnectedlinename':_0x3ef149[_0x27fb('0x24')],'transfereeaccountcode':_0x3ef149[_0x27fb('0x25')],'transfereecontext':_0x3ef149[_0x27fb('0x26')],'transfereeexten':_0x3ef149[_0x27fb('0x27')],'transfereelinkedid':_0x3ef149[_0x27fb('0x28')]});}writeDB(_0x3ef149);}catch(_0x24ea9c){utils[_0x27fb('0x12')](util[_0x27fb('0x2')](_0x27fb('0x29'),_0x3ef149[_0x27fb('0x6')]),_0x24ea9c);}};
\ No newline at end of file
index 524d184..610290a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4ce=['catch','[utils][getUserByInternal]','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','format','subtractTime','subtract','YYYY-MM-DD\x20HH:mm:ss','sumTime','isAfter','isBefore','bluebird','moment','util','client','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','found','notfound'];(function(_0x5565a5,_0x340a20){var _0x25a05d=function(_0x3d0d2c){while(--_0x3d0d2c){_0x5565a5['push'](_0x5565a5['shift']());}};_0x25a05d(++_0x340a20);}(_0xe4ce,0x198));var _0xee4c=function(_0x7f04a3,_0x2294ce){_0x7f04a3=_0x7f04a3-0x0;var _0x50def=_0xe4ce[_0x7f04a3];return _0x50def;};'use strict';var BPromise=require(_0xee4c('0x0'));var jayson=require('jayson/promise');var moment=require(_0xee4c('0x1'));var util=require(_0xee4c('0x2'));var client=jayson[_0xee4c('0x3')]['http']({'port':0x2329});var logger=require(_0xee4c('0x4'))(_0xee4c('0x5'));exports[_0xee4c('0x6')]=function(_0x39ebf4,_0x4e2abe){logger[_0xee4c('0x6')](_0x39ebf4,_0x4e2abe?util['inspect'](_0x4e2abe,{'showHidden':![],'depth':null}):'');};exports[_0xee4c('0x7')]=function(_0x52a051,_0x2b7f31){logger[_0xee4c('0x7')](_0x52a051,_0x2b7f31?util[_0xee4c('0x8')](_0x2b7f31,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x24fdc3,_0x3be7df){logger[_0xee4c('0x9')](_0x24fdc3,_0x3be7df?util[_0xee4c('0x8')](_0x3be7df,{'showHidden':![],'depth':null}):'');};exports[_0xee4c('0xa')]=function(_0xc61b2,_0x3e8b73){return client[_0xee4c('0xa')](_0xc61b2,{'body':_0x3e8b73})[_0xee4c('0xb')](function(_0x13f45d){logger[_0xee4c('0x7')](_0xee4c('0xc'),_0xc61b2,_0x13f45d?util[_0xee4c('0x8')](_0x13f45d,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x59e4cd){logger[_0xee4c('0x9')](_0xee4c('0xc'),_0xc61b2,_0x59e4cd?util[_0xee4c('0x8')](_0x59e4cd,{'showHidden':![],'depth':null}):'');});};function getUser(_0x40655b){return client[_0xee4c('0xa')](_0xee4c('0xd'),{'options':{'raw':!![],'attributes':['id',_0xee4c('0xe'),_0xee4c('0xf'),'interface'],'where':_0x40655b,'limit':0x1}})['then'](function(_0x3b8b3e){logger[_0xee4c('0x7')](_0xee4c('0x10'),JSON[_0xee4c('0x11')](_0x40655b),_0x3b8b3e?util[_0xee4c('0x8')](_0x3b8b3e,{'showHidden':![],'depth':null}):'');return _0x3b8b3e[_0xee4c('0x12')]['length']?_0x3b8b3e[_0xee4c('0x12')][0x0]:null;});}exports[_0xee4c('0x13')]=function(_0x5b0195){return new BPromise(function(_0x4da0ed,_0x4c8656){if(_0x5b0195){return getUser({'internal':_0x5b0195})[_0xee4c('0xb')](function(_0x45eb10){logger[_0xee4c('0x6')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x5b0195,_0x45eb10?_0xee4c('0x14'):_0xee4c('0x15'));return _0x4da0ed(_0x45eb10);})[_0xee4c('0x16')](function(_0x1440b4){logger[_0xee4c('0x9')](_0xee4c('0x17'),_0x1440b4?util[_0xee4c('0x8')](_0x1440b4,{'showHidden':![],'depth':null}):'');return _0x4da0ed(null);});}return _0x4da0ed(null);});};exports['getUserByInterface']=function(_0x424659){return new BPromise(function(_0x2cc05f,_0x3354c1){if(_0x424659){return getUser({'interface':_0x424659})['then'](function(_0x13f31a){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x424659,_0x13f31a?'found':_0xee4c('0x15'));return _0x2cc05f(_0x13f31a);})['catch'](function(_0x573d3e){logger[_0xee4c('0x9')](_0xee4c('0x18'),_0x573d3e?util[_0xee4c('0x8')](_0x573d3e,{'showHidden':![],'depth':null}):'');return _0x2cc05f(null);});}return _0x2cc05f(null);});};exports[_0xee4c('0x19')]=function(_0x31e4f6){return new BPromise(function(_0x46fe1d,_0x2d9f36){if(_0x31e4f6){return getUser({'name':_0x31e4f6})[_0xee4c('0xb')](function(_0x2df7da){logger['info'](_0xee4c('0x1a'),_0x31e4f6,_0x2df7da?'found':_0xee4c('0x15'));return _0x46fe1d(_0x2df7da);})[_0xee4c('0x16')](function(_0x13a7b9){logger[_0xee4c('0x9')](_0xee4c('0x1b'),_0x13a7b9?util[_0xee4c('0x8')](_0x13a7b9,{'showHidden':![],'depth':null}):'');return _0x46fe1d(null);});}return _0x46fe1d(null);});};exports[_0xee4c('0x1c')]=function(_0x427684){return new BPromise(function(_0x1992c6,_0x4cf6a6){if(_0x427684){return client[_0xee4c('0xa')](_0xee4c('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xee4c('0xf'),'type',_0xee4c('0x1e'),'acwTimeout'],'where':{'name':_0x427684},'limit':0x1}})['then'](function(_0x2eb92f){logger['debug'](_0xee4c('0x1f'),_0x427684,_0x2eb92f?util['inspect'](_0x2eb92f,{'showHidden':![],'depth':null}):'');logger['info'](_0xee4c('0x20'),_0x427684,_0x2eb92f?'found':_0xee4c('0x15'));return _0x1992c6(_0x2eb92f[_0xee4c('0x12')]['length']?_0x2eb92f[_0xee4c('0x12')][0x0]:null);})[_0xee4c('0x16')](function(_0x385765){logger['error'](_0xee4c('0x21'),_0x385765?util[_0xee4c('0x8')](_0x385765,{'showHidden':![],'depth':null}):'');return _0x1992c6(null);});}return _0x1992c6(null);});};exports[_0xee4c('0x22')]=function(_0x3dc51d,_0x5390ef){return moment(_0x3dc51d)['add'](_0x5390ef,_0xee4c('0x23'))[_0xee4c('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xee4c('0x25')]=function(_0x22ac60,_0x47652b){return moment(_0x22ac60)[_0xee4c('0x26')](_0x47652b,'seconds')[_0xee4c('0x24')](_0xee4c('0x27'));};exports['diffTime']=function(_0x3eb1ed,_0x4cea39){return moment(_0x3eb1ed)['diff'](moment(_0x4cea39),_0xee4c('0x23'));};exports[_0xee4c('0x28')]=function(_0x1fffbb,_0xe1905){return parseInt(_0x1fffbb,0xa)+parseInt(_0xe1905,0xa);};exports['now']=function(){return moment()[_0xee4c('0x24')](_0xee4c('0x27'));};exports[_0xee4c('0x29')]=function(_0x472c03,_0x1dbcc2){if(_0x1dbcc2){return moment(_0x472c03)[_0xee4c('0x29')](_0x1dbcc2);}return!![];};exports[_0xee4c('0x2a')]=function(_0x3c5fc3,_0x46a0a6){if(_0x46a0a6){return moment(_0x3c5fc3)['isBefore'](_0x46a0a6);}else if(_0x3c5fc3){return!![];}return![];};
\ No newline at end of file
+var _0x01aa=['bluebird','jayson/promise','util','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','name','interface','[utils][getUser]\x20where:%s','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','now','isAfter','isBefore'];(function(_0x59531c,_0x22cd3f){var _0x220a99=function(_0x1ed609){while(--_0x1ed609){_0x59531c['push'](_0x59531c['shift']());}};_0x220a99(++_0x22cd3f);}(_0x01aa,0x1ef));var _0xa01a=function(_0x34bf1b,_0x19d373){_0x34bf1b=_0x34bf1b-0x0;var _0x12976b=_0x01aa[_0x34bf1b];return _0x12976b;};'use strict';var BPromise=require(_0xa01a('0x0'));var jayson=require(_0xa01a('0x1'));var moment=require('moment');var util=require(_0xa01a('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0xa01a('0x3'))(_0xa01a('0x4'));exports[_0xa01a('0x5')]=function(_0x19843b,_0x4ab7aa){logger[_0xa01a('0x5')](_0x19843b,_0x4ab7aa?util[_0xa01a('0x6')](_0x4ab7aa,{'showHidden':![],'depth':null}):'');};exports[_0xa01a('0x7')]=function(_0x406d4f,_0x3892e5){logger['debug'](_0x406d4f,_0x3892e5?util['inspect'](_0x3892e5,{'showHidden':![],'depth':null}):'');};exports[_0xa01a('0x8')]=function(_0x3803c3,_0x497e57){logger[_0xa01a('0x8')](_0x3803c3,_0x497e57?util[_0xa01a('0x6')](_0x497e57,{'showHidden':![],'depth':null}):'');};exports[_0xa01a('0x9')]=function(_0x3c0a0d,_0x258454){return client['request'](_0x3c0a0d,{'body':_0x258454})[_0xa01a('0xa')](function(_0x70db91){logger['debug'](_0xa01a('0xb'),_0x3c0a0d,_0x70db91?util[_0xa01a('0x6')](_0x70db91,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x34c37e){logger[_0xa01a('0x8')](_0xa01a('0xb'),_0x3c0a0d,_0x34c37e?util[_0xa01a('0x6')](_0x34c37e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3e9590){return client[_0xa01a('0x9')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xa01a('0xc'),_0xa01a('0xd')],'where':_0x3e9590,'limit':0x1}})['then'](function(_0x1056dc){logger['debug'](_0xa01a('0xe'),JSON['stringify'](_0x3e9590),_0x1056dc?util[_0xa01a('0x6')](_0x1056dc,{'showHidden':![],'depth':null}):'');return _0x1056dc['result'][_0xa01a('0xf')]?_0x1056dc['result'][0x0]:null;});}exports[_0xa01a('0x10')]=function(_0x4545b3){return new BPromise(function(_0x2a3a8f,_0x5b47bd){if(_0x4545b3){return getUser({'internal':_0x4545b3})[_0xa01a('0xa')](function(_0xa5e72e){logger[_0xa01a('0x5')](_0xa01a('0x11'),_0x4545b3,_0xa5e72e?_0xa01a('0x12'):_0xa01a('0x13'));return _0x2a3a8f(_0xa5e72e);})[_0xa01a('0x14')](function(_0x58e23a){logger['error'](_0xa01a('0x15'),_0x58e23a?util[_0xa01a('0x6')](_0x58e23a,{'showHidden':![],'depth':null}):'');return _0x2a3a8f(null);});}return _0x2a3a8f(null);});};exports['getUserByInterface']=function(_0x50a7c9){return new BPromise(function(_0x437892,_0x30f93b){if(_0x50a7c9){return getUser({'interface':_0x50a7c9})[_0xa01a('0xa')](function(_0x3527fc){logger[_0xa01a('0x5')](_0xa01a('0x16'),_0x50a7c9,_0x3527fc?_0xa01a('0x12'):_0xa01a('0x13'));return _0x437892(_0x3527fc);})[_0xa01a('0x14')](function(_0x49d524){logger[_0xa01a('0x8')](_0xa01a('0x17'),_0x49d524?util[_0xa01a('0x6')](_0x49d524,{'showHidden':![],'depth':null}):'');return _0x437892(null);});}return _0x437892(null);});};exports[_0xa01a('0x18')]=function(_0x41d8f2){return new BPromise(function(_0xcd060c,_0x3bab3a){if(_0x41d8f2){return getUser({'name':_0x41d8f2})[_0xa01a('0xa')](function(_0x5d35af){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x41d8f2,_0x5d35af?'found':_0xa01a('0x13'));return _0xcd060c(_0x5d35af);})[_0xa01a('0x14')](function(_0x218219){logger[_0xa01a('0x8')](_0xa01a('0x19'),_0x218219?util[_0xa01a('0x6')](_0x218219,{'showHidden':![],'depth':null}):'');return _0xcd060c(null);});}return _0xcd060c(null);});};exports['getVoiceQueueByName']=function(_0x3b086d){return new BPromise(function(_0x17325c,_0x196e23){if(_0x3b086d){return client[_0xa01a('0x9')](_0xa01a('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xa01a('0xc'),'type',_0xa01a('0x1b'),_0xa01a('0x1c')],'where':{'name':_0x3b086d},'limit':0x1}})['then'](function(_0x5c640f){logger[_0xa01a('0x7')](_0xa01a('0x1d'),_0x3b086d,_0x5c640f?util['inspect'](_0x5c640f,{'showHidden':![],'depth':null}):'');logger[_0xa01a('0x5')](_0xa01a('0x1e'),_0x3b086d,_0x5c640f?_0xa01a('0x12'):_0xa01a('0x13'));return _0x17325c(_0x5c640f['result'][_0xa01a('0xf')]?_0x5c640f[_0xa01a('0x1f')][0x0]:null);})['catch'](function(_0x2e21e4){logger[_0xa01a('0x8')](_0xa01a('0x20'),_0x2e21e4?util[_0xa01a('0x6')](_0x2e21e4,{'showHidden':![],'depth':null}):'');return _0x17325c(null);});}return _0x17325c(null);});};exports[_0xa01a('0x21')]=function(_0x16801b,_0x5956e1){return moment(_0x16801b)[_0xa01a('0x22')](_0x5956e1,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa01a('0x23')]=function(_0x3a2bb8,_0x2646f4){return moment(_0x3a2bb8)[_0xa01a('0x24')](_0x2646f4,_0xa01a('0x25'))[_0xa01a('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa01a('0x27')]=function(_0x5605be,_0x3bb571){return moment(_0x5605be)[_0xa01a('0x28')](moment(_0x3bb571),_0xa01a('0x25'));};exports[_0xa01a('0x29')]=function(_0x2c5b1a,_0x490c6c){return parseInt(_0x2c5b1a,0xa)+parseInt(_0x490c6c,0xa);};exports[_0xa01a('0x2a')]=function(){return moment()[_0xa01a('0x26')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa01a('0x2b')]=function(_0x39a22b,_0x4d069c){if(_0x4d069c){return moment(_0x39a22b)['isAfter'](_0x4d069c);}return!![];};exports[_0xa01a('0x2c')]=function(_0x5c3106,_0x5f27b3){if(_0x5f27b3){return moment(_0x5c3106)[_0xa01a('0x2c')](_0x5f27b3);}else if(_0x5c3106){return!![];}return![];};
\ No newline at end of file
index 0fb1513..c47dad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10da=['body','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','other','agent_name','test','setupLoggers','lodash','express-winston','path','./loggers','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','/var','log','xcally','join','client','name','ensureDir','then','user','no-user','data','error','auth','set','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x10da,0xf5));var _0xa10d=function(_0x40ee34,_0x35f6aa){_0x40ee34=_0x40ee34-0x0;var _0x1ef672=_0x10da[_0x40ee34];return _0x1ef672;};var fs=require('fs-extra');var _=require(_0xa10d('0x0'));var ewinston=require(_0xa10d('0x1'));var path=require(_0xa10d('0x2'));var util=require('util');var fileLogger=require(_0xa10d('0x3'))['fileLogger'];var safeTemplate=require(_0xa10d('0x4'))[_0xa10d('0x5')];var maskSensitiveData=require(_0xa10d('0x6'))[_0xa10d('0x7')];function ClientSideLogger(){function _0x3cd3be(_0xc280ff){var _0x4c846c=path['join'](_0xa10d('0x8'),_0xa10d('0x9'),_0xa10d('0xa'));var _0x1afdcc=path[_0xa10d('0xb')](_0xa10d('0xc'),_0xc280ff['role']+'-'+_0xc280ff[_0xa10d('0xd')]);return fs[_0xa10d('0xe')](path[_0xa10d('0xb')](_0x4c846c,_0x1afdcc))[_0xa10d('0xf')](function(){var _0x3d3ea6=fileLogger(_0xa10d('0xc'),path[_0xa10d('0xb')](_0x4c846c,_0x1afdcc));return _0x3d3ea6;})['catch'](function(_0x152707){throw _0x152707;});}this[_0xa10d('0x9')]=function(_0x3bbde5,_0x4be6e0,_0x58d2ce,_0x3e9fd4){return _0x3cd3be(_0x3bbde5['user'])[_0xa10d('0xf')](function(_0x1e6f93){var _0x1af619=_0x1e6f93[_0x4be6e0];return _0x1af619;})[_0xa10d('0xf')](function(_0x4f7611){var _0x54843b=_0x3bbde5[_0xa10d('0x10')]?_0x3bbde5[_0xa10d('0x10')]['id']:_0xa10d('0x11');var _0x145df5=_0x3e9fd4[_0xa10d('0x12')];var _0x23560f=_0x3e9fd4['timestamp'];var _0x2406d1=new Date(Number(_0x23560f));return _0x4f7611(_0x54843b,_0x2406d1,_0x58d2ce,_0x145df5);})['catch'](function(_0x504f2d){fileLogger(_0xa10d('0xc'))[_0xa10d('0x13')](_0x504f2d);});};}function setupLoggers(_0x1bb8f2){return new Promise(function(_0x11baf5){var _0x13c9fd=new ClientSideLogger();var _0x245a4d=fileLogger('api');var _0x1a796f=fileLogger(_0xa10d('0x14'));_0x1bb8f2[_0xa10d('0x15')]('client-side-logger',_0x13c9fd);_0x1bb8f2[_0xa10d('0x16')](ewinston['logger']({'winstonInstance':_0x245a4d,'meta':![],'statusLevels':!![],'msg':function(_0x582801,_0x131ce7){var _0x36ba75=_0xa10d('0x17');if(!_[_0xa10d('0x18')](_0x582801[_0xa10d('0x19')])){_0x36ba75+='\x20body=%s';var _0x22fcad=_0x582801['body'];maskSensitiveData(_0x22fcad);}return safeTemplate(util['format'](_0x36ba75,_0x582801[_0xa10d('0x1a')],_0x582801[_0xa10d('0x1b')][_0xa10d('0x1c')]?_0x582801['headers'][_0xa10d('0x1c')]:_0x582801[_0xa10d('0x1d')][_0xa10d('0x1e')]||_0x582801['ip'],_0x582801[_0xa10d('0x1f')],_0x131ce7[_0xa10d('0x20')],_0x131ce7[_0xa10d('0x21')],_0x582801[_0xa10d('0x10')]?_0x582801[_0xa10d('0x10')]['id']:null,_0x582801[_0xa10d('0x10')]?_0x582801[_0xa10d('0x10')][_0xa10d('0xd')]:null,_0x582801[_0xa10d('0x10')]?_0x582801['user'][_0xa10d('0x22')]:null,_0x22fcad?util[_0xa10d('0x23')](_0x22fcad,![],null):''));}}));_0x1bb8f2[_0xa10d('0x16')](ewinston['logger']({'winstonInstance':_0x1a796f,'meta':![],'statusLevels':!![],'msg':function(_0x503f86,_0x4443a5){var _0x3a7718=_0xa10d('0x24');if(_0x503f86[_0xa10d('0x19')]&&_0x503f86['body'][_0xa10d('0x25')]&&_0x503f86[_0xa10d('0x19')][_0xa10d('0x26')]){_0x3a7718=_0xa10d('0x27');}return util[_0xa10d('0x28')](_0x3a7718,_0x503f86[_0xa10d('0x1a')],_0x503f86['headers'][_0xa10d('0x1c')]?_0x503f86[_0xa10d('0x1b')]['x-forwarded-for']:_0x503f86[_0xa10d('0x1d')]['remoteAddress']||_0x503f86['ip'],_0x503f86[_0xa10d('0x1f')],_0x4443a5[_0xa10d('0x20')],_0x4443a5[_0xa10d('0x21')],_0x503f86['user']?_0x503f86[_0xa10d('0x10')]['id']:null,_0x503f86['user']?_0x503f86['user'][_0xa10d('0xd')]:null,_0x503f86['user']?_0x503f86[_0xa10d('0x10')][_0xa10d('0x22')]:null,_0x503f86[_0xa10d('0x19')]&&_0x503f86['body'][_0xa10d('0x25')]?_0x503f86[_0xa10d('0x19')][_0xa10d('0x25')]:_0xa10d('0x29'),_0x503f86[_0xa10d('0x19')]&&_0x503f86[_0xa10d('0x19')][_0xa10d('0x26')]?_0x503f86[_0xa10d('0x19')][_0xa10d('0x26')]:'',_0x503f86[_0xa10d('0x19')]&&_0x503f86[_0xa10d('0x19')]['agent_name']?_0x503f86[_0xa10d('0x19')][_0xa10d('0x2a')]:'');},'ignoreRoute':function(_0x509f04){var _0x5a4f67=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5a4f67[_0xa10d('0x2b')](_0x509f04[_0xa10d('0x1f')]);}}));return _0x11baf5();});}exports[_0xa10d('0x2c')]=setupLoggers;
\ No newline at end of file
+var _0x3e60=['lodash','path','util','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','log','xcally','role','name','ensureDir','then','client','catch','user','no-user','data','timestamp','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','headers','x-forwarded-for','connection','url','statusCode','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','remoteAddress','responseTime','agent_id','agent_name','setupLoggers','fs-extra'];(function(_0x54cdbe,_0x125fa4){var _0x52d8df=function(_0x41e1d3){while(--_0x41e1d3){_0x54cdbe['push'](_0x54cdbe['shift']());}};_0x52d8df(++_0x125fa4);}(_0x3e60,0x1c1));var _0x03e6=function(_0x5a5395,_0x5361f6){_0x5a5395=_0x5a5395-0x0;var _0x4da43d=_0x3e60[_0x5a5395];return _0x4da43d;};var fs=require(_0x03e6('0x0'));var _=require(_0x03e6('0x1'));var ewinston=require('express-winston');var path=require(_0x03e6('0x2'));var util=require(_0x03e6('0x3'));var fileLogger=require('./loggers')[_0x03e6('0x4')];var safeTemplate=require(_0x03e6('0x5'))[_0x03e6('0x6')];var maskSensitiveData=require(_0x03e6('0x7'))['maskSensitiveData'];function ClientSideLogger(){function _0x12a2c4(_0x2a1956){var _0x15930a=path[_0x03e6('0x8')](_0x03e6('0x9'),_0x03e6('0xa'),_0x03e6('0xb'));var _0x175c05=path[_0x03e6('0x8')]('client',_0x2a1956[_0x03e6('0xc')]+'-'+_0x2a1956[_0x03e6('0xd')]);return fs[_0x03e6('0xe')](path[_0x03e6('0x8')](_0x15930a,_0x175c05))[_0x03e6('0xf')](function(){var _0x3d77c6=fileLogger(_0x03e6('0x10'),path['join'](_0x15930a,_0x175c05));return _0x3d77c6;})[_0x03e6('0x11')](function(_0x218c97){throw _0x218c97;});}this[_0x03e6('0xa')]=function(_0x85674,_0x5b0a4c,_0x2cae46,_0x379e01){return _0x12a2c4(_0x85674[_0x03e6('0x12')])['then'](function(_0x5e5c1d){var _0x3bf510=_0x5e5c1d[_0x5b0a4c];return _0x3bf510;})[_0x03e6('0xf')](function(_0x2b0998){var _0x3385c9=_0x85674[_0x03e6('0x12')]?_0x85674[_0x03e6('0x12')]['id']:_0x03e6('0x13');var _0x265c2d=_0x379e01[_0x03e6('0x14')];var _0x430d13=_0x379e01[_0x03e6('0x15')];var _0x29839c=new Date(Number(_0x430d13));return _0x2b0998(_0x3385c9,_0x29839c,_0x2cae46,_0x265c2d);})[_0x03e6('0x11')](function(_0x5613d4){fileLogger(_0x03e6('0x10'))['error'](_0x5613d4);});};}function setupLoggers(_0x3dd2aa){return new Promise(function(_0x3bdded){var _0x2aec48=new ClientSideLogger();var _0x5828cb=fileLogger(_0x03e6('0x16'));var _0x2098fb=fileLogger(_0x03e6('0x17'));_0x3dd2aa[_0x03e6('0x18')](_0x03e6('0x19'),_0x2aec48);_0x3dd2aa[_0x03e6('0x1a')](ewinston[_0x03e6('0x1b')]({'winstonInstance':_0x5828cb,'meta':![],'statusLevels':!![],'msg':function(_0x317537,_0x38e7dd){var _0x317f68=_0x03e6('0x1c');if(!_[_0x03e6('0x1d')](_0x317537[_0x03e6('0x1e')])){_0x317f68+='\x20body=%s';var _0x37932c=_0x317537['body'];maskSensitiveData(_0x37932c);}return safeTemplate(util['format'](_0x317f68,_0x317537[_0x03e6('0x1f')],_0x317537['headers']['x-forwarded-for']?_0x317537[_0x03e6('0x20')][_0x03e6('0x21')]:_0x317537[_0x03e6('0x22')]['remoteAddress']||_0x317537['ip'],_0x317537[_0x03e6('0x23')],_0x38e7dd[_0x03e6('0x24')],_0x38e7dd['responseTime'],_0x317537[_0x03e6('0x12')]?_0x317537[_0x03e6('0x12')]['id']:null,_0x317537[_0x03e6('0x12')]?_0x317537[_0x03e6('0x12')][_0x03e6('0xd')]:null,_0x317537[_0x03e6('0x12')]?_0x317537[_0x03e6('0x12')]['role']:null,_0x37932c?util['inspect'](_0x37932c,![],null):''));}}));_0x3dd2aa[_0x03e6('0x1a')](ewinston[_0x03e6('0x1b')]({'winstonInstance':_0x2098fb,'meta':![],'statusLevels':!![],'msg':function(_0x2f92c6,_0xed5910){var _0x701871='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6['body'][_0x03e6('0x25')]&&_0x2f92c6[_0x03e6('0x1e')]['agent_id']){_0x701871=_0x03e6('0x26');}return util[_0x03e6('0x27')](_0x701871,_0x2f92c6[_0x03e6('0x1f')],_0x2f92c6[_0x03e6('0x20')][_0x03e6('0x21')]?_0x2f92c6['headers'][_0x03e6('0x21')]:_0x2f92c6[_0x03e6('0x22')][_0x03e6('0x28')]||_0x2f92c6['ip'],_0x2f92c6[_0x03e6('0x23')],_0xed5910[_0x03e6('0x24')],_0xed5910[_0x03e6('0x29')],_0x2f92c6['user']?_0x2f92c6[_0x03e6('0x12')]['id']:null,_0x2f92c6[_0x03e6('0x12')]?_0x2f92c6[_0x03e6('0x12')][_0x03e6('0xd')]:null,_0x2f92c6[_0x03e6('0x12')]?_0x2f92c6[_0x03e6('0x12')][_0x03e6('0xc')]:null,_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6[_0x03e6('0x1e')][_0x03e6('0x25')]?_0x2f92c6['body']['device']:'other',_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6[_0x03e6('0x1e')][_0x03e6('0x2a')]?_0x2f92c6['body'][_0x03e6('0x2a')]:'',_0x2f92c6[_0x03e6('0x1e')]&&_0x2f92c6['body'][_0x03e6('0x2b')]?_0x2f92c6[_0x03e6('0x1e')][_0x03e6('0x2b')]:'');},'ignoreRoute':function(_0x311798){var _0x1fda78=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1fda78['test'](_0x311798['url']);}}));return _0x3bdded();});}exports[_0x03e6('0x2c')]=setupLoggers;
\ No newline at end of file
index a3e2580..7a949e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf61=['isBefore','startOf','day','endOf','isBetween','exports','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','isMoment','padStart','length','iftime','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','circularDoWInterval','circularMonthInterval','clone','hours','minutes'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0xaf61,0x145));var _0x1af6=function(_0x289907,_0x240685){_0x289907=_0x289907-0x0;var _0x261df9=_0xaf61[_0x289907];return _0x261df9;};var _=require(_0x1af6('0x0'));var moment=require(_0x1af6('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x1af6('0x2')](function(_0x596ef5){return _0x596ef5['source'];})[_0x1af6('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x1af6('0x4');var EINVALID_DATE=_0x1af6('0x5');function throwIfDateNotValid(_0x333686){if(!_0x333686[_0x1af6('0x6')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x47e115){var _0x593eb8=_0x47e115[_0x1af6('0x7')](':')[_0x1af6('0x2')](function(_0x5af546){return parseInt(_0x5af546,0xa);});var _0x23a9a8=_0x593eb8[0x0];var _0x3df14e=_0x593eb8[0x1];if(_0x23a9a8<0x0||_0x23a9a8>0x17||_0x3df14e<0x0||_0x3df14e>0x3b){throw new Error(EINVALID_DATE);}return[_0x23a9a8,_0x3df14e];}function circularDoWInterval(_0x3962ac,_0xf7fa13){if(_0x3962ac===_0xf7fa13){return[_0x3962ac];}else{var _0x123860=moment[_0x1af6('0x8')]();moment['locale']('en');var _0x1f405a=moment[_0x1af6('0x9')]()[_0x1af6('0x2')](function(_0x232a74){return _0x232a74[_0x1af6('0xa')]();});moment['locale'](_0x123860);var _0x38c23a=_0x1f405a[_0x1af6('0xb')](_0x3962ac);var _0x56505e=_0x1f405a[_0x1af6('0xb')](_0xf7fa13);if(_0x56505e>_0x38c23a){return _0x1f405a[_0x1af6('0xc')](_0x38c23a,_0x56505e+0x1);}else{var _0x25b2c8=_0x1f405a[_0x1af6('0xc')](0x0,_0x56505e+0x1);var _0x3cb8d7=_0x1f405a['slice'](_0x38c23a);return _0x3cb8d7[_0x1af6('0xd')](_0x25b2c8);}}}module['exports'][_0x1af6('0xe')]=circularDoWInterval;function circularMonthInterval(_0x3afec3,_0x3fe2f2){if(_0x3afec3===_0x3fe2f2){return[_0x3afec3];}else{var _0x3a4e83=moment['locale']();moment[_0x1af6('0x8')]('en');var _0x25130b=moment['monthsShort']()[_0x1af6('0x2')](function(_0x636f25){return _0x636f25[_0x1af6('0xa')]();});moment['locale'](_0x3a4e83);var _0xafdbbe=_0x25130b[_0x1af6('0xb')](_0x3afec3);var _0x7f85b8=_0x25130b[_0x1af6('0xb')](_0x3fe2f2);if(_0x7f85b8>_0xafdbbe){return _0x25130b[_0x1af6('0xc')](_0xafdbbe,_0x7f85b8+0x1);}else{var _0x155bd0=_0x25130b[_0x1af6('0xc')](0x0,_0x7f85b8+0x1);var _0x50bd0a=_0x25130b[_0x1af6('0xc')](_0xafdbbe);return _0x50bd0a['concat'](_0x155bd0);}}}module['exports'][_0x1af6('0xf')]=circularMonthInterval;function parseDom(_0x4177d0){var _0x3e96a5=parseInt(_0x4177d0,0xa);if(_0x3e96a5<0x1||_0x3e96a5>0x1f){throw new Error(EINVALID_DATE);}return _0x3e96a5;}function timeCompare(_0x494a4d,_0xb1b343,_0x125ba0){var _0x298f92=_0x494a4d[_0x1af6('0x10')]();var _0x333e1f=extractTime(_0xb1b343);var _0x58106e=_0x333e1f[0x0];var _0x296225=_0x333e1f[0x1];var _0x20cf9a=_0x494a4d[_0x1af6('0x10')]()[_0x1af6('0x11')](_0x58106e)[_0x1af6('0x12')](_0x296225);throwIfDateNotValid(_0x20cf9a);var _0x581036=extractTime(_0x125ba0);var _0x252cad=_0x581036[0x0];var _0x39f2b6=_0x581036[0x1];var _0x3509ef=_0x494a4d['clone']()[_0x1af6('0x11')](_0x252cad)[_0x1af6('0x12')](_0x39f2b6);throwIfDateNotValid(_0x3509ef);if(_0x3509ef[_0x1af6('0x13')](_0x20cf9a)){var _0x88b6fd=_0x298f92['clone']()[_0x1af6('0x14')](_0x1af6('0x15'));var _0x5bbd65=_0x298f92[_0x1af6('0x10')]()[_0x1af6('0x16')](_0x1af6('0x15'));return _0x298f92[_0x1af6('0x17')](_0x20cf9a,_0x5bbd65,undefined,'[]')||_0x298f92[_0x1af6('0x17')](_0x88b6fd,_0x3509ef,undefined,'[]');}else{return _0x298f92[_0x1af6('0x17')](_0x20cf9a,_0x3509ef,undefined,'[]');}}module[_0x1af6('0x18')][_0x1af6('0x19')]=timeCompare;function dowCompare(_0x350df9,_0x2450a5,_0x2fe545){var _0x3a92ec=_0x350df9['locale']('en')[_0x1af6('0x1a')](_0x1af6('0x1b'))['toLowerCase']();return circularDoWInterval(_0x2450a5,_0x2fe545)[_0x1af6('0x1c')](_0x3a92ec);}module['exports'][_0x1af6('0x1d')]=dowCompare;function domCompare(_0x4288c0,_0x2a6c19,_0x54a894){var _0x22161e=_0x4288c0[_0x1af6('0x1e')]();if(_0x2a6c19===_0x54a894){return _0x22161e===_0x2a6c19;}else{var _0x35b902=_0x4288c0[_0x1af6('0x1f')]();var _0x5be95b=_0x2a6c19<_0x54a894;let _0x4e301f=![];var _0x501119=0x0;var _0x4f1d76=0x0;if(_0x5be95b){_0x501119=Math[_0x1af6('0x20')](0x1,_0x2a6c19);_0x4f1d76=Math[_0x1af6('0x21')](_0x54a894,_0x35b902);_0x4e301f=_0x22161e>=_0x501119&&_0x22161e<=_0x4f1d76;}else{_0x501119=Math[_0x1af6('0x21')](_0x2a6c19,_0x35b902);_0x4f1d76=Math['max'](0x1,_0x54a894);_0x4e301f=_0x22161e>=_0x501119||_0x22161e<=_0x4f1d76;}return _0x4e301f;}}module[_0x1af6('0x18')][_0x1af6('0x22')]=domCompare;function monthCompare(_0x341002,_0x5df487,_0x13e762){var _0x56aea7=_0x341002[_0x1af6('0x8')]('en')['format'](_0x1af6('0x23'))['toLowerCase']();return circularMonthInterval(_0x5df487,_0x13e762)[_0x1af6('0x1c')](_0x56aea7);}module['exports'][_0x1af6('0x24')]=monthCompare;function iftime(_0x16bf27,_0x412de4=moment['tz'][_0x1af6('0x25')](),_0x334056=moment()){if(!validateRx[_0x1af6('0x26')](_0x16bf27)){throw new Error(EINVALID_STRING);}else{var _0x44b9a2=(moment[_0x1af6('0x27')](_0x334056)?_0x334056[_0x1af6('0x10')]():moment(_0x334056))['tz'](_0x412de4)[_0x1af6('0x8')]('en');throwIfDateNotValid(_0x44b9a2);var _0xb2e132=_0x16bf27[_0x1af6('0x7')](',');var _0x29cc97=_0xb2e132[0x0];var _0x14af49=_0xb2e132[0x1];var _0x3eb86a=_0xb2e132[0x2];var _0x13cd40=_0xb2e132[0x3];let _0x55b7a1=!![];if(_0x29cc97!=='*'){var _0x5ff9da=_0x29cc97[_0x1af6('0x7')]('-');var _0x58a2af=_[_0x1af6('0x28')](_0x5ff9da[0x0],0x5,'0');var _0x588f52=_0x5ff9da['length']===0x2?_[_0x1af6('0x28')](_0x5ff9da[0x1],0x5,'0'):_0x58a2af;_0x55b7a1=timeCompare(_0x44b9a2,_0x58a2af,_0x588f52);}let _0x4e8ca0=!![];if(_0x14af49!=='*'){var _0x24e798=_0x14af49['split']('-');var _0x465d93=_0x24e798[0x0];var _0x329e0d=_0x24e798[_0x1af6('0x29')]===0x2?_0x24e798[0x1]:_0x465d93;_0x4e8ca0=dowCompare(_0x44b9a2,_0x465d93,_0x329e0d);}let _0x5760cb=!![];if(_0x3eb86a!=='*'){var _0x312585=_0x3eb86a[_0x1af6('0x7')]('-');var _0x266d07=parseDom(_0x312585[0x0]);var _0x16e522=_0x312585['length']===0x2?parseDom(_0x312585[0x1]):_0x266d07;_0x5760cb=domCompare(_0x44b9a2,_0x266d07,_0x16e522);}let _0x5d8c93=!![];if(_0x13cd40!=='*'){var _0x22c213=_0x13cd40[_0x1af6('0x7')]('-');var _0x5f0b11=_0x22c213[0x0];var _0x22a62d=_0x22c213[_0x1af6('0x29')]===0x2?_0x22c213[0x1]:_0x22c213[0x0];_0x5d8c93=monthCompare(_0x44b9a2,_0x5f0b11,_0x22a62d);}return _0x55b7a1&&_0x4e8ca0&&_0x5760cb&&_0x5d8c93;}}module[_0x1af6('0x18')][_0x1af6('0x2a')]=iftime;
\ No newline at end of file
+var _0x47e0=['monthsShort','map','circularMonthInterval','clone','minutes','hours','day','endOf','isBetween','format','ddd','includes','dowCompare','daysInMonth','min','max','domCompare','monthCompare','guess','isMoment','padStart','length','moment-timezone','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','split','locale','toLowerCase','indexOf','slice','concat','exports'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x47e0,0x1f2));var _0x047e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x47e0[_0x20a584];return _0x4b41a8;};var _=require('lodash');var moment=require(_0x047e('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x522fde){return _0x522fde['source'];})[_0x047e('0x1')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x047e('0x2');var EINVALID_DATE=_0x047e('0x3');function throwIfDateNotValid(_0x5951d0){if(!_0x5951d0[_0x047e('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4dd78a){var _0x5ab727=_0x4dd78a[_0x047e('0x5')](':')['map'](function(_0x406275){return parseInt(_0x406275,0xa);});var _0x42aa2d=_0x5ab727[0x0];var _0xb60a89=_0x5ab727[0x1];if(_0x42aa2d<0x0||_0x42aa2d>0x17||_0xb60a89<0x0||_0xb60a89>0x3b){throw new Error(EINVALID_DATE);}return[_0x42aa2d,_0xb60a89];}function circularDoWInterval(_0x2240bd,_0x293215){if(_0x2240bd===_0x293215){return[_0x2240bd];}else{var _0x437c89=moment[_0x047e('0x6')]();moment[_0x047e('0x6')]('en');var _0x446708=moment['weekdaysShort']()['map'](function(_0x2a425c){return _0x2a425c[_0x047e('0x7')]();});moment[_0x047e('0x6')](_0x437c89);var _0x2b041b=_0x446708['indexOf'](_0x2240bd);var _0xa86f59=_0x446708[_0x047e('0x8')](_0x293215);if(_0xa86f59>_0x2b041b){return _0x446708[_0x047e('0x9')](_0x2b041b,_0xa86f59+0x1);}else{var _0x55caf8=_0x446708[_0x047e('0x9')](0x0,_0xa86f59+0x1);var _0x201bf2=_0x446708[_0x047e('0x9')](_0x2b041b);return _0x201bf2[_0x047e('0xa')](_0x55caf8);}}}module[_0x047e('0xb')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x18e736,_0xb01638){if(_0x18e736===_0xb01638){return[_0x18e736];}else{var _0x18f4a4=moment[_0x047e('0x6')]();moment[_0x047e('0x6')]('en');var _0x58f237=moment[_0x047e('0xc')]()[_0x047e('0xd')](function(_0x4ad6f8){return _0x4ad6f8[_0x047e('0x7')]();});moment[_0x047e('0x6')](_0x18f4a4);var _0x584147=_0x58f237[_0x047e('0x8')](_0x18e736);var _0xf6a4e9=_0x58f237[_0x047e('0x8')](_0xb01638);if(_0xf6a4e9>_0x584147){return _0x58f237['slice'](_0x584147,_0xf6a4e9+0x1);}else{var _0x3871d7=_0x58f237['slice'](0x0,_0xf6a4e9+0x1);var _0x1b0483=_0x58f237['slice'](_0x584147);return _0x1b0483[_0x047e('0xa')](_0x3871d7);}}}module[_0x047e('0xb')][_0x047e('0xe')]=circularMonthInterval;function parseDom(_0x104cd7){var _0x68fb36=parseInt(_0x104cd7,0xa);if(_0x68fb36<0x1||_0x68fb36>0x1f){throw new Error(EINVALID_DATE);}return _0x68fb36;}function timeCompare(_0x26ea87,_0x156a18,_0x21c100){var _0x31492a=_0x26ea87[_0x047e('0xf')]();var _0x25aaf8=extractTime(_0x156a18);var _0x3b4537=_0x25aaf8[0x0];var _0x135c8c=_0x25aaf8[0x1];var _0x42d00=_0x26ea87[_0x047e('0xf')]()['hours'](_0x3b4537)[_0x047e('0x10')](_0x135c8c);throwIfDateNotValid(_0x42d00);var _0x56a421=extractTime(_0x21c100);var _0x65b602=_0x56a421[0x0];var _0x294e53=_0x56a421[0x1];var _0x3412d4=_0x26ea87[_0x047e('0xf')]()[_0x047e('0x11')](_0x65b602)['minutes'](_0x294e53);throwIfDateNotValid(_0x3412d4);if(_0x3412d4['isBefore'](_0x42d00)){var _0x264528=_0x31492a['clone']()['startOf'](_0x047e('0x12'));var _0x5683b8=_0x31492a[_0x047e('0xf')]()[_0x047e('0x13')](_0x047e('0x12'));return _0x31492a[_0x047e('0x14')](_0x42d00,_0x5683b8,undefined,'[]')||_0x31492a[_0x047e('0x14')](_0x264528,_0x3412d4,undefined,'[]');}else{return _0x31492a[_0x047e('0x14')](_0x42d00,_0x3412d4,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x5df54a,_0x43564d,_0x186813){var _0x10bdaa=_0x5df54a[_0x047e('0x6')]('en')[_0x047e('0x15')](_0x047e('0x16'))[_0x047e('0x7')]();return circularDoWInterval(_0x43564d,_0x186813)[_0x047e('0x17')](_0x10bdaa);}module[_0x047e('0xb')][_0x047e('0x18')]=dowCompare;function domCompare(_0x2af856,_0x4b9823,_0x28e8db){var _0x4630dd=_0x2af856['date']();if(_0x4b9823===_0x28e8db){return _0x4630dd===_0x4b9823;}else{var _0x305929=_0x2af856[_0x047e('0x19')]();var _0x13c765=_0x4b9823<_0x28e8db;let _0x4b4380=![];var _0x4c1bf6=0x0;var _0x3c9e6d=0x0;if(_0x13c765){_0x4c1bf6=Math['max'](0x1,_0x4b9823);_0x3c9e6d=Math[_0x047e('0x1a')](_0x28e8db,_0x305929);_0x4b4380=_0x4630dd>=_0x4c1bf6&&_0x4630dd<=_0x3c9e6d;}else{_0x4c1bf6=Math['min'](_0x4b9823,_0x305929);_0x3c9e6d=Math[_0x047e('0x1b')](0x1,_0x28e8db);_0x4b4380=_0x4630dd>=_0x4c1bf6||_0x4630dd<=_0x3c9e6d;}return _0x4b4380;}}module[_0x047e('0xb')][_0x047e('0x1c')]=domCompare;function monthCompare(_0x46884e,_0x1f5006,_0x242f48){var _0x5c9ad4=_0x46884e[_0x047e('0x6')]('en')[_0x047e('0x15')]('MMM')[_0x047e('0x7')]();return circularMonthInterval(_0x1f5006,_0x242f48)[_0x047e('0x17')](_0x5c9ad4);}module[_0x047e('0xb')][_0x047e('0x1d')]=monthCompare;function iftime(_0x14d497,_0x3e0690=moment['tz'][_0x047e('0x1e')](),_0x701ebd=moment()){if(!validateRx['test'](_0x14d497)){throw new Error(EINVALID_STRING);}else{var _0x40a049=(moment[_0x047e('0x1f')](_0x701ebd)?_0x701ebd[_0x047e('0xf')]():moment(_0x701ebd))['tz'](_0x3e0690)['locale']('en');throwIfDateNotValid(_0x40a049);var _0xe63047=_0x14d497[_0x047e('0x5')](',');var _0x4a8803=_0xe63047[0x0];var _0x28e97c=_0xe63047[0x1];var _0x4a5c53=_0xe63047[0x2];var _0x29e896=_0xe63047[0x3];let _0x5a19c6=!![];if(_0x4a8803!=='*'){var _0x4795c3=_0x4a8803[_0x047e('0x5')]('-');var _0x21f683=_[_0x047e('0x20')](_0x4795c3[0x0],0x5,'0');var _0x5d77e4=_0x4795c3[_0x047e('0x21')]===0x2?_['padStart'](_0x4795c3[0x1],0x5,'0'):_0x21f683;_0x5a19c6=timeCompare(_0x40a049,_0x21f683,_0x5d77e4);}let _0x3c1431=!![];if(_0x28e97c!=='*'){var _0x5ebd7a=_0x28e97c['split']('-');var _0x15d720=_0x5ebd7a[0x0];var _0x458603=_0x5ebd7a[_0x047e('0x21')]===0x2?_0x5ebd7a[0x1]:_0x15d720;_0x3c1431=dowCompare(_0x40a049,_0x15d720,_0x458603);}let _0x698dab=!![];if(_0x4a5c53!=='*'){var _0x588012=_0x4a5c53['split']('-');var _0xe0eb82=parseDom(_0x588012[0x0]);var _0x4fb448=_0x588012['length']===0x2?parseDom(_0x588012[0x1]):_0xe0eb82;_0x698dab=domCompare(_0x40a049,_0xe0eb82,_0x4fb448);}let _0x3304e8=!![];if(_0x29e896!=='*'){var _0x455d8d=_0x29e896[_0x047e('0x5')]('-');var _0x1d6a50=_0x455d8d[0x0];var _0xf3d0fc=_0x455d8d[_0x047e('0x21')]===0x2?_0x455d8d[0x1]:_0x455d8d[0x0];_0x3304e8=monthCompare(_0x40a049,_0x1d6a50,_0xf3d0fc);}return _0x5a19c6&&_0x3c1431&&_0x698dab&&_0x3304e8;}}module[_0x047e('0xb')]['iftime']=iftime;
\ No newline at end of file
index 6c798e6..8e90745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc828=['red','bold\x20yellow','white','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','}}}','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info'];(function(_0x2b5ad1,_0x9cbdd6){var _0x1495b9=function(_0x3cc312){while(--_0x3cc312){_0x2b5ad1['push'](_0x2b5ad1['shift']());}};_0x1495b9(++_0x9cbdd6);}(_0xc828,0x1f0));var _0x8c82=function(_0x1313c0,_0x440849){_0x1313c0=_0x1313c0-0x0;var _0x504022=_0xc828[_0x1313c0];return _0x504022;};'use strict';var path=require(_0x8c82('0x0'));var util=require(_0x8c82('0x1'));var moment=require(_0x8c82('0x2'));var winston=require(_0x8c82('0x3'));var config=require(_0x8c82('0x4'));var debugLevel=config[_0x8c82('0x5')]?config[_0x8c82('0x5')][_0x8c82('0x6')]():_0x8c82('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':_0x8c82('0x8'),'warn':_0x8c82('0x9'),'info':_0x8c82('0xa'),'print':_0x8c82('0xb'),'success':_0x8c82('0xc'),'http':_0x8c82('0xd'),'verbose':_0x8c82('0xe'),'debug':_0x8c82('0xf'),'silly':_0x8c82('0x10')};winston[_0x8c82('0x11')](XC_LOG_COLORS);function getLogFileName(_0x35f93d,_0xf02565,_0x6434ea){var _0x2da170=_0x35f93d||_0x8c82('0x12');return path[_0x8c82('0x13')](_0x2da170,util[_0x8c82('0x14')]('%s-%s.log',_0xf02565,_0x6434ea));}function formatter(_0x323481,_0x568424){_0x568424[_0x8c82('0x15')]=_0x568424[_0x8c82('0x15')][_0x8c82('0x16')](/@@{/g,_0x8c82('0x17'))['replace'](/}@@/g,_0x8c82('0x18'))[_0x8c82('0x16')](/@{/g,'{{')[_0x8c82('0x16')](/}@/g,'}}');return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x8c82('0x14')](_0x8c82('0x19')),_0x568424[_0x8c82('0x1a')][_0x8c82('0x1b')](),_0x323481,_0x568424['message']);}function fileFormat(_0x247507,_0x19dc49){_0x19dc49[_0x8c82('0x15')]=_0x19dc49[_0x8c82('0x15')][_0x8c82('0x16')](/@@{/g,_0x8c82('0x17'))[_0x8c82('0x16')](/}@@/g,'}}}')[_0x8c82('0x16')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x1a3736=_0x19dc49[_0x8c82('0x1c')]&&Object[_0x8c82('0x1d')](_0x19dc49['meta'])[_0x8c82('0x1e')]?'\x0a\x09'+JSON[_0x8c82('0x1f')](_0x19dc49[_0x8c82('0x1c')]):'';return util['format'](_0x8c82('0x20'),moment()[_0x8c82('0x14')](_0x8c82('0x19')),_0x19dc49[_0x8c82('0x1a')][_0x8c82('0x1b')](),_0x247507,_0x19dc49['message'],_0x1a3736);}function consoleLogger(){var _0x268f43=new winston[(_0x8c82('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8c82('0x22'))][(_0x8c82('0x23'))]({'level':_0x8c82('0x24'),'json':![],'formatter':function(_0x1ef3ed){return formatter('',_0x1ef3ed);}})]});return _0x268f43;}function fileLogger(_0xd734d3,_0x4adc15){var _0x1f344a=new winston[(_0x8c82('0x21'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8c82('0x22'))][(_0x8c82('0x25'))]({'name':util['format']('%s-%s',_0xd734d3,_0x8c82('0x26')),'filename':getLogFileName(_0x4adc15,_0xd734d3,'error'),'level':_0x8c82('0x26'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x264c2f){return fileFormat(_0xd734d3,_0x264c2f);}}),new winston[(_0x8c82('0x22'))]['File']({'name':util[_0x8c82('0x14')](_0x8c82('0x27'),_0xd734d3,debugLevel),'filename':getLogFileName(_0x4adc15,_0xd734d3,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3ad540){return fileFormat(_0xd734d3,_0x3ad540);}}),new winston[(_0x8c82('0x22'))][(_0x8c82('0x23'))]({'level':'warn','json':![],'formatter':function(_0x12ff44){return fileFormat(_0xd734d3,_0x12ff44);}})]});return _0x1f344a;}exports[_0x8c82('0x28')]=consoleLogger;exports[_0x8c82('0x29')]=fileLogger;
\ No newline at end of file
+var _0x563b=['keys','meta','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','toUpperCase','Logger','transports','Console','warn','%s-%s','error','File','consoleLogger','path','moment','winston','../config/environment','debugLevel','info','redBG\x20white','red','bold\x20yellow','white','bold\x20green','bold\x20magenta','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','}}}'];(function(_0x2c4e32,_0x3a5590){var _0x1eac30=function(_0x236c8e){while(--_0x236c8e){_0x2c4e32['push'](_0x2c4e32['shift']());}};_0x1eac30(++_0x3a5590);}(_0x563b,0xf8));var _0xb563=function(_0x23f80f,_0x10c1e6){_0x23f80f=_0x23f80f-0x0;var _0x2afe74=_0x563b[_0x23f80f];return _0x2afe74;};'use strict';var path=require(_0xb563('0x0'));var util=require('util');var moment=require(_0xb563('0x1'));var winston=require(_0xb563('0x2'));var config=require(_0xb563('0x3'));var debugLevel=config[_0xb563('0x4')]?config[_0xb563('0x4')]['toLowerCase']():_0xb563('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xb563('0x6'),'error':_0xb563('0x7'),'warn':_0xb563('0x8'),'info':_0xb563('0x9'),'print':'bold\x20white','success':_0xb563('0xa'),'http':'gray','verbose':_0xb563('0xb'),'debug':_0xb563('0xc'),'silly':_0xb563('0xd')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x58272c,_0x67dca8,_0x1b3209){var _0x13782f=_0x58272c||_0xb563('0xe');return path[_0xb563('0xf')](_0x13782f,util[_0xb563('0x10')](_0xb563('0x11'),_0x67dca8,_0x1b3209));}function formatter(_0x3a60ae,_0x1e41d4){_0x1e41d4[_0xb563('0x12')]=_0x1e41d4[_0xb563('0x12')][_0xb563('0x13')](/@@{/g,_0xb563('0x14'))[_0xb563('0x13')](/}@@/g,'}}}')[_0xb563('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xb563('0x10')](_0xb563('0x15'),moment()['format'](_0xb563('0x16')),_0x1e41d4[_0xb563('0x17')]['toUpperCase'](),_0x3a60ae,_0x1e41d4[_0xb563('0x12')]);}function fileFormat(_0x1ba516,_0x5d8b67){_0x5d8b67[_0xb563('0x12')]=_0x5d8b67[_0xb563('0x12')][_0xb563('0x13')](/@@{/g,_0xb563('0x14'))[_0xb563('0x13')](/}@@/g,_0xb563('0x18'))[_0xb563('0x13')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x26e556=_0x5d8b67['meta']&&Object[_0xb563('0x19')](_0x5d8b67[_0xb563('0x1a')])[_0xb563('0x1b')]?'\x0a\x09'+JSON[_0xb563('0x1c')](_0x5d8b67[_0xb563('0x1a')]):'';return util[_0xb563('0x10')](_0xb563('0x1d'),moment()['format'](_0xb563('0x16')),_0x5d8b67[_0xb563('0x17')][_0xb563('0x1e')](),_0x1ba516,_0x5d8b67[_0xb563('0x12')],_0x26e556);}function consoleLogger(){var _0x346fc7=new winston[(_0xb563('0x1f'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb563('0x20'))][(_0xb563('0x21'))]({'level':_0xb563('0x22'),'json':![],'formatter':function(_0x3b42c5){return formatter('',_0x3b42c5);}})]});return _0x346fc7;}function fileLogger(_0x3e53b7,_0x306f05){var _0x24fba0=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xb563('0x20'))]['File']({'name':util[_0xb563('0x10')](_0xb563('0x23'),_0x3e53b7,_0xb563('0x24')),'filename':getLogFileName(_0x306f05,_0x3e53b7,_0xb563('0x24')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1f2a34){return fileFormat(_0x3e53b7,_0x1f2a34);}}),new winston[(_0xb563('0x20'))][(_0xb563('0x25'))]({'name':util['format'](_0xb563('0x23'),_0x3e53b7,debugLevel),'filename':getLogFileName(_0x306f05,_0x3e53b7,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x414a74){return fileFormat(_0x3e53b7,_0x414a74);}}),new winston[(_0xb563('0x20'))][(_0xb563('0x21'))]({'level':'warn','json':![],'formatter':function(_0x3db024){return fileFormat(_0x3e53b7,_0x3db024);}})]});return _0x24fba0;}exports[_0xb563('0x26')]=consoleLogger;exports['fileLogger']=fileLogger;
\ No newline at end of file
index 238001a..c76fa02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['replace','}@@','includes','exports','maskSensitiveData','lodash','password','newPassword','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientSecret','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isPlainObject','isArray','length','isString'];(function(_0x203d64,_0x1ec79c){var _0x462ab3=function(_0x55ee6e){while(--_0x55ee6e){_0x203d64['push'](_0x203d64['shift']());}};_0x462ab3(++_0x1ec79c);}(_0x4975,0x86));var _0x5497=function(_0x58bdc2,_0x444bd5){_0x58bdc2=_0x58bdc2-0x0;var _0x51227d=_0x4975[_0x58bdc2];return _0x51227d;};var _=require(_0x5497('0x0'));var sensitiveFields=['username',_0x5497('0x1'),_0x5497('0x2'),_0x5497('0x3'),_0x5497('0x4'),_0x5497('0x5'),_0x5497('0x6'),_0x5497('0x7'),_0x5497('0x8'),_0x5497('0x9'),_0x5497('0xa'),'clientId',_0x5497('0xb'),'securityToken',_0x5497('0xc'),_0x5497('0xd'),_0x5497('0xe'),'token',_0x5497('0xf'),'accessToken',_0x5497('0x10'),_0x5497('0x11'),_0x5497('0x12'),_0x5497('0x13'),_0x5497('0x14'),_0x5497('0x15'),_0x5497('0x16'),_0x5497('0x17'),'vidaooApiKey','clientEmail','privateKey',_0x5497('0x18'),_0x5497('0x19'),_0x5497('0x1a'),_0x5497('0x1b'),_0x5497('0x1c'),_0x5497('0x1d'),_0x5497('0x1e'),_0x5497('0x1f'),_0x5497('0x20'),_0x5497('0x21'),'oldPassword'];function maskSensitiveData(_0x11b0a9){const _0x4fb8e9=/(?!^)[\s\S](?!$)/g;if(_[_0x5497('0x22')](_0x11b0a9)){for(const _0x2bfd8a in _0x11b0a9){if(_[_0x5497('0x23')](_0x11b0a9[_0x2bfd8a])){for(let _0x3ce50b=0x0;_0x3ce50b<_0x11b0a9[_0x2bfd8a][_0x5497('0x24')];_0x3ce50b++){maskSensitiveData(_0x11b0a9[_0x2bfd8a][_0x3ce50b]);}}else if(_[_0x5497('0x22')](_0x11b0a9[_0x2bfd8a])){maskSensitiveData(_0x11b0a9[_0x2bfd8a]);}else if(_[_0x5497('0x25')](_0x11b0a9[_0x2bfd8a])){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a]['replace'](/{{{/g,'@@{')[_0x5497('0x26')](/}}}/g,_0x5497('0x27'))[_0x5497('0x26')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x5497('0x28')](sensitiveFields,_0x2bfd8a)){_0x11b0a9[_0x2bfd8a]=_0x11b0a9[_0x2bfd8a][_0x5497('0x26')](_0x4fb8e9,'*');}}}}}module[_0x5497('0x29')][_0x5497('0x2a')]=maskSensitiveData;
\ No newline at end of file
+var _0xda2d=['@@{','replace','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','accessToken','accessTokenSecret','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','key','user','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','isArray','isString'];(function(_0x1dfdde,_0x945501){var _0x57e2c7=function(_0x159673){while(--_0x159673){_0x1dfdde['push'](_0x1dfdde['shift']());}};_0x57e2c7(++_0x945501);}(_0xda2d,0x102));var _0xdda2=function(_0x349c33,_0x426d0e){_0x349c33=_0x349c33-0x0;var _0x5d9d1b=_0xda2d[_0x349c33];return _0x5d9d1b;};var _=require('lodash');var sensitiveFields=[_0xdda2('0x0'),_0xdda2('0x1'),_0xdda2('0x2'),_0xdda2('0x3'),_0xdda2('0x4'),'lastName','street','phone',_0xdda2('0x5'),_0xdda2('0x6'),_0xdda2('0x7'),_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'channelSecret',_0xdda2('0xf'),_0xdda2('0x10'),'authToken',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'privateKey','accesskeyid','secretaccesskey',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'registry',_0xdda2('0x20')];function maskSensitiveData(_0x4b0220){const _0xbef148=/(?!^)[\s\S](?!$)/g;if(_[_0xdda2('0x21')](_0x4b0220)){for(const _0x3553d5 in _0x4b0220){if(_[_0xdda2('0x22')](_0x4b0220[_0x3553d5])){for(let _0x1922b1=0x0;_0x1922b1<_0x4b0220[_0x3553d5]['length'];_0x1922b1++){maskSensitiveData(_0x4b0220[_0x3553d5][_0x1922b1]);}}else if(_['isPlainObject'](_0x4b0220[_0x3553d5])){maskSensitiveData(_0x4b0220[_0x3553d5]);}else if(_[_0xdda2('0x23')](_0x4b0220[_0x3553d5])){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5]['replace'](/{{{/g,_0xdda2('0x24'))[_0xdda2('0x25')](/}}}/g,_0xdda2('0x26'))[_0xdda2('0x25')](/{{/g,'@{')[_0xdda2('0x25')](/}}/g,'}@');if(_[_0xdda2('0x27')](sensitiveFields,_0x3553d5)){_0x4b0220[_0x3553d5]=_0x4b0220[_0x3553d5][_0xdda2('0x25')](_0xbef148,'*');}}}}}module[_0xdda2('0x28')][_0xdda2('0x29')]=maskSensitiveData;
\ No newline at end of file
index 58cd2d8..e62d730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray','isPlainObject','keys','reduce','safeTemplate'];(function(_0x5a81a0,_0x4f006e){var _0x172074=function(_0x3eace5){while(--_0x3eace5){_0x5a81a0['push'](_0x5a81a0['shift']());}};_0x172074(++_0x4f006e);}(_0xef0f,0x168));var _0xfef0=function(_0xf09399,_0x14686c){_0xf09399=_0xf09399-0x0;var _0x45646b=_0xef0f[_0xf09399];return _0x45646b;};var _=require(_0xfef0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x581303){return _0x581303==='{{'?_0xfef0('0x1'):_0xfef0('0x2');}function safeTemplate(_0x19f865){var _0x4d29e5=_0x19f865;if(typeof _0x19f865===_0xfef0('0x3')){_0x4d29e5=_0x19f865[_0xfef0('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xfef0('0x5')](_0x19f865)){_0x4d29e5=_0x19f865['map'](function(_0x2a6fcf){return safeTemplate(_0x2a6fcf);});}else if(_[_0xfef0('0x6')](_0x19f865)){_0x4d29e5=Object[_0xfef0('0x7')](_0x19f865)[_0xfef0('0x8')](function(_0xad43e,_0x11dfd7){_0xad43e[_0x11dfd7]=safeTemplate(_0x19f865[_0x11dfd7]);return _0xad43e;},{});}return _0x4d29e5;}module['exports'][_0xfef0('0x9')]=safeTemplate;
\ No newline at end of file
+var _0xb62e=['map','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','isArray'];(function(_0x12b830,_0xd66540){var _0x261dc4=function(_0x57037a){while(--_0x57037a){_0x12b830['push'](_0x12b830['shift']());}};_0x261dc4(++_0xd66540);}(_0xb62e,0x1de));var _0xeb62=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb62e[_0xbca1b1];return _0x4e1686;};var _=require(_0xeb62('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x46335b){return _0x46335b==='{{'?_0xeb62('0x1'):_0xeb62('0x2');}function safeTemplate(_0x57a5ba){var _0x3dfdef=_0x57a5ba;if(typeof _0x57a5ba===_0xeb62('0x3')){_0x3dfdef=_0x57a5ba[_0xeb62('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb62('0x5')](_0x57a5ba)){_0x3dfdef=_0x57a5ba[_0xeb62('0x6')](function(_0x1ebdbb){return safeTemplate(_0x1ebdbb);});}else if(_['isPlainObject'](_0x57a5ba)){_0x3dfdef=Object[_0xeb62('0x7')](_0x57a5ba)[_0xeb62('0x8')](function(_0x31f5ea,_0x5e0dc4){_0x31f5ea[_0x5e0dc4]=safeTemplate(_0x57a5ba[_0x5e0dc4]);return _0x31f5ea;},{});}return _0x3dfdef;}module[_0xeb62('0x9')][_0xeb62('0xa')]=safeTemplate;
\ No newline at end of file